[
  {
    "path": ".editorconfig",
    "content": "# Editor configuration, see http://editorconfig.org\n# Visual studio supported code style syntax https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference\n# Visual studio supported naming convention syntax https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-naming-conventions\n# Undocumented https://kent-boogaart.com/blog/editorconfig-reference-for-c-developers\n# Undocumented CS options https://github.com/dotnet/roslyn/blob/master/src/Workspaces/CSharp/Portable/Formatting/CSharpFormattingOptions.cs\n# Undocumented .NET options https://github.com/dotnet/roslyn/blob/master/src/Workspaces/Core/Portable/CodeStyle/CodeStyleOptions.cs\n\n# top-most EditorConfig file, hierarchy search will stop in this file\nroot = true\n\n# ----------------------------------------------------------------------------------------------------------------------\n# General settings\n# ----------------------------------------------------------------------------------------------------------------------\n\n# Don't use tabs for indentation.\n[*]\nindent_style = space\n# (Please don't specify an indent_size here; that has too many unintended consequences.)\n\n[*.md]\ntrim_trailing_whitespace = false\nend_of_line = lf\n\n# Code files\n[*.{cs,csx,vb,vbx}]\ncharset = utf-8-bom\nindent_size = 4\ninsert_final_newline = true\ntrim_trailing_whitespace = true\nend_of_line = lf\nmax_line_length = 200\n\n# Xml project files\n[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]\nindent_size = 2\n\n# Xml config files\n[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]\nindent_size = 2\n\n# JSON and YML files\n[*.{json,yml}]\nindent_size = 2\n\n# Scripting files\n[*.{ps1,bat,cmd}]\nindent_size = 4\n\n# Java code files\n[*.java]\nindent_size = 2\n\n# Pom files\n[pom.xml]\nindent_size = 2\n\n# ----------------------------------------------------------------------------------------------------------------------\n# Coding styles\n# ----------------------------------------------------------------------------------------------------------------------\n\n# Dotnet code style settings:\n[*.{cs,vb}]\ntab_width = 4\n# Sort using and Import directives with System.* appearing first\ndotnet_sort_system_directives_first = true\n\n# Avoid \"this.\" and \"Me.\" if not necessary\ndotnet_style_qualification_for_field = false:warning\ndotnet_style_qualification_for_property = false:warning\ndotnet_style_qualification_for_method = false:warning\ndotnet_style_qualification_for_event = false:warning\n\n# Use language keywords instead of framework type names for type references\ndotnet_style_predefined_type_for_locals_parameters_members = true:warning\ndotnet_style_predefined_type_for_member_access = true:warning\n\ndotnet_style_require_accessibility_modifiers = for_non_interface_members:warning\n\n# Suggest more modern language features when available\ndotnet_style_coalesce_expression = true:warning\ndotnet_style_collection_initializer = true:warning\ndotnet_style_prefer_collection_expression = when_types_loosely_match:warning\ndotnet_style_explicit_tuple_names = true:warning\ndotnet_style_namespace_match_folder = true:warning    # This is activated only on production code below via IDE0130 settings\ndotnet_style_null_propagation = true:warning\ndotnet_style_object_initializer = true:warning\ndotnet_style_operator_placement_when_wrapping = beginning_of_line:warning\ndotnet_style_prefer_auto_properties = true:warning\ndotnet_style_prefer_compound_assignment = true:warning\ndotnet_style_prefer_conditional_expression_over_assignment = true:warning\ndotnet_style_prefer_conditional_expression_over_return = false:silent\ndotnet_style_prefer_inferred_anonymous_type_member_names = true:warning\ndotnet_style_prefer_inferred_tuple_names = true:warning\ndotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning\ndotnet_style_prefer_simplified_interpolation = true:warning\ndotnet_style_prefer_simplified_boolean_expressions = true:warning\ndotnet_style_readonly_field = true:warning\n\n# Parameter preferences\ndotnet_code_quality_unused_parameters = non_public:warning\n\n# Parentheses\ndotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:silent\ndotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent\ndotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent\ndotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent\n\n# CSharp code style settings:\n[*.cs]\ncsharp_prefer_braces = true:warning\n\n# Prefer \"var\" everywhere\ncsharp_style_var_for_built_in_types = true:warning\ncsharp_style_var_when_type_is_apparent = true:warning\ncsharp_style_var_elsewhere = true:warning\n\n# Prefer expression-body\ncsharp_style_expression_bodied_methods = true:warning\ncsharp_style_expression_bodied_constructors = true:warning\ncsharp_style_expression_bodied_operators = true:warning\ncsharp_style_expression_bodied_properties = true:warning\ncsharp_style_expression_bodied_indexers = true:warning\ncsharp_style_expression_bodied_accessors = true:warning\ncsharp_style_expression_bodied_lambdas = true:warning\ncsharp_style_expression_bodied_local_functions = true:warning\n\n# Suggest more modern language features when available\ncsharp_style_pattern_matching_over_is_with_cast_check = true:warning\ncsharp_style_pattern_matching_over_as_with_null_check = true:warning\ncsharp_style_inlined_variable_declaration = true:warning\ncsharp_prefer_simple_default_expression = true:warning\ncsharp_style_deconstructed_variable_declaration = true:warning\ncsharp_style_throw_expression = true:warning\ncsharp_style_conditional_delegate_call = true:warning\n\n# IDE0055 configuration\n# Newline settings\ncsharp_new_line_before_open_brace = all\ncsharp_new_line_before_else = true\ncsharp_new_line_before_catch = true\ncsharp_new_line_before_finally = true\ncsharp_new_line_before_members_in_object_initializers = true\ncsharp_new_line_before_members_in_anonymous_types = true\ncsharp_new_line_between_query_expression_clauses = true\n\n# Indent\ncsharp_indent_case_contents = true\ncsharp_indent_switch_labels = true\ncsharp_indent_labels = flush_left\ncsharp_indent_block_contents = true\ncsharp_indent_braces = false\ncsharp_indent_case_contents_when_block = true\n\n# Spaces\ncsharp_space_after_cast = false\ncsharp_space_after_keywords_in_control_flow_statements = true\ncsharp_space_between_method_declaration_parameter_list_parentheses = false\ncsharp_space_between_method_call_parameter_list_parentheses = false\ncsharp_space_between_parentheses = false\ncsharp_space_between_method_call_name_and_opening_parenthesis = false\ncsharp_space_between_method_declaration_name_and_open_parenthesis = false\ncsharp_space_after_colon_in_inheritance_clause = true\ncsharp_space_before_colon_in_inheritance_clause = true\ncsharp_space_after_comma = true\ncsharp_space_before_comma = false\ncsharp_space_after_dot = false\ncsharp_space_before_dot = false\ncsharp_space_after_semicolon_in_for_statement = true\ncsharp_space_before_semicolon_in_for_statement = false\n# Extra space before equals sign DOES MATTER https://github.com/dotnet/roslyn/issues/20355\ncsharp_space_around_binary_operators  = before_and_after\ncsharp_space_around_declaration_statements = false\ncsharp_space_before_open_square_brackets = false\ncsharp_space_between_empty_square_brackets = false\ncsharp_space_between_method_call_empty_parameter_list_parentheses = false\ncsharp_space_between_method_declaration_empty_parameter_list_parentheses = false\ncsharp_space_between_square_brackets = false\n\n# Wrapping\ncsharp_preserve_single_line_statements = false\ncsharp_preserve_single_line_blocks = true\n# End of IDE0055 configuration\n\ncsharp_using_directive_placement = outside_namespace:warning\ncsharp_prefer_simple_using_statement = true:warning\ncsharp_style_namespace_declarations = file_scoped:warning\ncsharp_style_prefer_method_group_conversion = true:warning\ncsharp_style_prefer_top_level_statements = true:warning\ncsharp_style_prefer_primary_constructors = false:suggestion\ncsharp_prefer_system_threading_lock = true:warning\ncsharp_style_prefer_null_check_over_type_check = true:warning\ncsharp_style_prefer_local_over_anonymous_function = true:warning\ncsharp_style_prefer_index_operator = false:silent\ncsharp_style_prefer_range_operator = false:silent\ncsharp_style_implicit_object_creation_when_type_is_apparent = true:warning\ncsharp_style_prefer_tuple_swap = false:silent\ncsharp_style_prefer_unbound_generic_type_in_nameof = true:warning\ncsharp_style_prefer_utf8_string_literals = true:warning\ncsharp_style_unused_value_assignment_preference = unused_local_variable:silent\ncsharp_style_unused_value_expression_statement_preference = discard_variable:silent\ncsharp_prefer_static_local_function = true:warning\ncsharp_prefer_static_anonymous_function = true:warning\ncsharp_style_prefer_readonly_struct = true:warning\ncsharp_style_prefer_readonly_struct_member = true:warning\ncsharp_style_prefer_switch_expression = true:warning\ncsharp_style_prefer_pattern_matching = true:warning\ncsharp_style_prefer_not_pattern = true:warning\ncsharp_style_prefer_extended_property_pattern = true:warning\ncsharp_style_prefer_implicitly_typed_lambda_expression = true:warning\n\n# ----------------------------------------------------------------------------------------------------------------------\n# Naming conventions\n# ----------------------------------------------------------------------------------------------------------------------\n\n# ORDERING DOES MATTER!!!\n# Naming conventions should be ordered from most-specific to least-specific in the .editorconfig file.\n# The first rule encountered that can be applied is the only rule that is applied.\n\n[*.{cs,vb}]\n\n# Naming rules\n\ndotnet_naming_rule.interface_must_start_with_i.severity = warning\ndotnet_naming_rule.interface_must_start_with_I.symbols = interface_types\ndotnet_naming_rule.interface_must_start_with_i.style = I_style\n\ndotnet_naming_rule.variables_must_be_camel_style.severity = warning\ndotnet_naming_rule.variables_must_be_camel_style.symbols = parameter_types\ndotnet_naming_rule.variables_must_be_camel_style.style = camel_style\n\ndotnet_naming_rule.types_should_be_pascal_case.severity = warning\ndotnet_naming_rule.types_should_be_pascal_case.symbols = types\ndotnet_naming_rule.types_should_be_pascal_case.style = pascal_case\n\ndotnet_naming_rule.non_field_members_should_be_pascal_case.severity = warning\ndotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members\ndotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case\n\n# Symbol specifications\n\ndotnet_naming_symbols.interface_types.applicable_kinds = interface\ndotnet_naming_symbols.interface_types.applicable_accessibilities = *\n\ndotnet_naming_symbols.parameter_types.applicable_kinds = parameter\n\ndotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum\ndotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected\n\ndotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method\ndotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected\n\n# Naming styles\n\ndotnet_naming_style.pascal_case.capitalization = pascal_case\n\ndotnet_naming_style.camel_style.capitalization = camel_case\n\ndotnet_naming_style.I_style.required_prefix = I\ndotnet_naming_style.I_style.capitalization = pascal_case\n\n# ----------------------------------------------------------------------------------------------------------------------\n# Rules\n# ----------------------------------------------------------------------------------------------------------------------\n\ndotnet_diagnostic.CS7035.severity = none    # CS7035: it expects the build number to fit in 16 bits, our build numbers are bigger https://github.com/dotnet/roslyn/issues/17024#issuecomment-1669503201\ndotnet_diagnostic.CA1822.severity = warning # Increase visibility for Member 'xxx' does not access instance data and can be marked as static\ndotnet_diagnostic.RS2008.severity = none    # Enable analyzer release tracking - we don't use the release tracking analyzer\ndotnet_diagnostic.RS1036.severity = none    # A project containing analyzers or source generators should specify the property '<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>' - we're intentionally violating a lot of those types\ndotnet_diagnostic.JSON002.severity = none   # Probable JSON string detected, noisy in UTs\ndotnet_analyzer_diagnostic.category-Style.severity = warning # Default severity for analyzer diagnostics with category 'Style'\ndotnet_diagnostic.IDE0008.severity = none   # Use explicit type instead of var\ndotnet_diagnostic.IDE0009.severity = none   # Add this or Me qualification\ndotnet_diagnostic.IDE0010.severity = none   # Add missing cases to switch statement\ndotnet_diagnostic.IDE0017.severity = none   # Use object initializers\ndotnet_diagnostic.IDE0046.severity = none   # Use conditional expression for return\ndotnet_diagnostic.IDE0047.severity = none   # Remove unnecessary parentheses\ndotnet_diagnostic.IDE0048.severity = none   # Add parentheses for clarity\ndotnet_diagnostic.IDE0056.severity = none   # Use index operator\ndotnet_diagnostic.IDE0057.severity = none   # Use range operator\ndotnet_diagnostic.IDE0058.severity = none   # Remove unused expression value\ndotnet_diagnostic.IDE0059.severity = none   # Remove unnecessary value assignment\ndotnet_diagnostic.IDE0072.severity = none   # Add missing cases to switch expression\ndotnet_diagnostic.IDE0073.severity = none   # Use file header\ndotnet_diagnostic.IDE0160.severity = none   # Use block-scoped namespace\ndotnet_diagnostic.IDE0180.severity = none   # Use tuple to swap values\ndotnet_diagnostic.IDE0211.severity = none   # Convert to 'Program.Main' style program\ndotnet_diagnostic.IDE0220.severity = none   # Add explicit cast in foreach loop\ndotnet_diagnostic.IDE0290.severity = none   # Use primary constructor\nresharper_convert_to_primary_constructor_highlighting = none\ndotnet_diagnostic.IDE0303.severity = none   # Use collection expression for Create()\ndotnet_diagnostic.IDE0304.severity = none   # Use collection expression for builder\ndotnet_diagnostic.IDE0305.severity = none   # Use collection expression for fluent\ndotnet_diagnostic.IDE2006.severity = none   # Blank line not allowed after arrow expression clause token\n\n# ----------------------------------------------------------------------------------------------------------------------\n# SyleCop.Analyzers rules - note that the URLs below are for tag 1.1.118\n# ----------------------------------------------------------------------------------------------------------------------\n\n# Spacing Rules (SA1000-) https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/1.1.118/documentation/SpacingRules.md\n\ndotnet_diagnostic.SA1000.severity = warning\ndotnet_diagnostic.SA1001.severity = warning\ndotnet_diagnostic.SA1002.severity = warning\ndotnet_diagnostic.SA1003.severity = warning\ndotnet_diagnostic.SA1004.severity = warning\ndotnet_diagnostic.SA1005.severity = warning\ndotnet_diagnostic.SA1006.severity = warning\ndotnet_diagnostic.SA1007.severity = warning\ndotnet_diagnostic.SA1008.severity = warning\ndotnet_diagnostic.SA1009.severity = warning\ndotnet_diagnostic.SA1010.severity = warning\ndotnet_diagnostic.SA1011.severity = warning\ndotnet_diagnostic.SA1012.severity = none # noisy on collection initializers\ndotnet_diagnostic.SA1013.severity = none # noisy on collection initializers\ndotnet_diagnostic.SA1014.severity = warning\ndotnet_diagnostic.SA1015.severity = warning\ndotnet_diagnostic.SA1016.severity = warning\ndotnet_diagnostic.SA1017.severity = warning\ndotnet_diagnostic.SA1018.severity = warning\ndotnet_diagnostic.SA1019.severity = warning\ndotnet_diagnostic.SA1020.severity = warning\ndotnet_diagnostic.SA1021.severity = warning\ndotnet_diagnostic.SA1022.severity = warning\ndotnet_diagnostic.SA1023.severity = warning\ndotnet_diagnostic.SA1024.severity = warning\ndotnet_diagnostic.SA1025.severity = none # noisy on aligned comments\ndotnet_diagnostic.SA1026.severity = warning\ndotnet_diagnostic.SA1027.severity = none # RSPEC-105\ndotnet_diagnostic.SA1028.severity = warning\n\n# Readability Rules (SA1100-) https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/1.1.118/DOCUMENTATION.md\n\ndotnet_diagnostic.SA1100.severity = warning\ndotnet_diagnostic.SA1101.severity = none    # Doesn't match our coding style, we don't use \"this.\" when not neded\ndotnet_diagnostic.SA1102.severity = warning\ndotnet_diagnostic.SA1103.severity = warning\ndotnet_diagnostic.SA1104.severity = warning\ndotnet_diagnostic.SA1105.severity = warning\ndotnet_diagnostic.SA1106.severity = warning\ndotnet_diagnostic.SA1107.severity = warning\ndotnet_diagnostic.SA1108.severity = none    # Noisy for short comments on short lines (if, for, foreach)\ndotnet_diagnostic.SA1109.severity = warning\ndotnet_diagnostic.SA1110.severity = warning\ndotnet_diagnostic.SA1111.severity = warning\ndotnet_diagnostic.SA1112.severity = warning\ndotnet_diagnostic.SA1113.severity = warning\ndotnet_diagnostic.SA1114.severity = none    # Prevents putting comment before first member in ImmutableArray.Create\ndotnet_diagnostic.SA1115.severity = warning\ndotnet_diagnostic.SA1116.severity = none    # Waste of new lines in simple scenarios\ndotnet_diagnostic.SA1117.severity = none    # Waste of new lines in simple scenarios\ndotnet_diagnostic.SA1118.severity = none    # Noisy in UTs\ndotnet_diagnostic.SA1119.severity = warning\ndotnet_diagnostic.SA1120.severity = warning\ndotnet_diagnostic.SA1121.severity = warning\ndotnet_diagnostic.SA1122.severity = warning\ndotnet_diagnostic.SA1123.severity = warning\ndotnet_diagnostic.SA1124.severity = none    # We need regions sometimes\ndotnet_diagnostic.SA1125.severity = warning\ndotnet_diagnostic.SA1126.severity = none    # Deprecated / not implemented rule\ndotnet_diagnostic.SA1127.severity = none    # Noisy for single-line method declarations\ndotnet_diagnostic.SA1128.severity = none    # Doesn't match our code base\ndotnet_diagnostic.SA1129.severity = warning\ndotnet_diagnostic.SA1130.severity = warning\ndotnet_diagnostic.SA1131.severity = warning\ndotnet_diagnostic.SA1132.severity = warning\ndotnet_diagnostic.SA1133.severity = warning\ndotnet_diagnostic.SA1134.severity = warning\ndotnet_diagnostic.SA1135.severity = none    # Noisy for generics\ndotnet_diagnostic.SA1136.severity = warning\ndotnet_diagnostic.SA1137.severity = warning\ndotnet_diagnostic.SA1138.severity = none    # Deprecated / not implemented rule\ndotnet_diagnostic.SA1139.severity = warning\n\n# Ordering Rules (SA1200-) https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/1.1.118/documentation/OrderingRules.md\n\ndotnet_diagnostic.SA1200.severity = warning\ndotnet_diagnostic.SA1201.severity = none # Doesn't match our coding style (properties before constructor)\ndotnet_diagnostic.SA1202.severity = warning\ndotnet_diagnostic.SA1203.severity = warning\ndotnet_diagnostic.SA1204.severity = none # Doesn't match our coding style for private static methods\ndotnet_diagnostic.SA1205.severity = warning\ndotnet_diagnostic.SA1206.severity = warning\ndotnet_diagnostic.SA1207.severity = warning\ndotnet_diagnostic.SA1208.severity = warning\ndotnet_diagnostic.SA1209.severity = warning\ndotnet_diagnostic.SA1210.severity = warning\ndotnet_diagnostic.SA1211.severity = warning\ndotnet_diagnostic.SA1212.severity = warning\ndotnet_diagnostic.SA1213.severity = warning\ndotnet_diagnostic.SA1214.severity = warning\ndotnet_diagnostic.SA1215.severity = warning\ndotnet_diagnostic.SA1216.severity = warning\ndotnet_diagnostic.SA1217.severity = warning\n\n# Naming Rules (SA1300-) https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/1.1.118/documentation/NamingRules.md\n\ndotnet_diagnostic.SA1300.severity = warning\ndotnet_diagnostic.SA1301.severity = warning\ndotnet_diagnostic.SA1302.severity = warning\ndotnet_diagnostic.SA1303.severity = warning\ndotnet_diagnostic.SA1304.severity = warning\ndotnet_diagnostic.SA1305.severity = none # Noisy for other prefixes csFileName, orCondition\ndotnet_diagnostic.SA1306.severity = warning\ndotnet_diagnostic.SA1307.severity = warning\ndotnet_diagnostic.SA1308.severity = warning\ndotnet_diagnostic.SA1309.severity = warning\ndotnet_diagnostic.SA1310.severity = warning\ndotnet_diagnostic.SA1311.severity = warning\ndotnet_diagnostic.SA1312.severity = warning\ndotnet_diagnostic.SA1313.severity = warning\ndotnet_diagnostic.SA1314.severity = warning\n\n# Maintainability Rules (SA1400-) https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/1.1.118/documentation/MaintainabilityRules.md\n\ndotnet_diagnostic.SA1400.severity = warning\ndotnet_diagnostic.SA1401.severity = none # We have better rules S2357 and S1104\ndotnet_diagnostic.SA1402.severity = none # we use the pattern of keeping 2 base classes in the same file to split generic from non-generic logic\ndotnet_diagnostic.SA1403.severity = warning\ndotnet_diagnostic.SA1404.severity = warning\ndotnet_diagnostic.SA1405.severity = warning\ndotnet_diagnostic.SA1406.severity = warning\ndotnet_diagnostic.SA1407.severity = none # very noisy on hash calculations; can lead to less readable code\ndotnet_diagnostic.SA1408.severity = warning\ndotnet_diagnostic.SA1409.severity = none # Deprecated / not implemented rule\ndotnet_diagnostic.SA1410.severity = warning\ndotnet_diagnostic.SA1411.severity = warning\ndotnet_diagnostic.SA1412.severity = warning\ndotnet_diagnostic.SA1413.severity = none    # we do not want this\ndotnet_diagnostic.SA1414.severity = warning\n\n# Layout Rules (SA1500-) https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/1.1.118/documentation/LayoutRules.md\n\ndotnet_diagnostic.SA1500.severity = warning\ndotnet_diagnostic.SA1501.severity = warning\ndotnet_diagnostic.SA1502.severity = none # noisy on empty constructors calling base\ndotnet_diagnostic.SA1503.severity = warning\ndotnet_diagnostic.SA1504.severity = warning\ndotnet_diagnostic.SA1505.severity = warning\ndotnet_diagnostic.SA1506.severity = warning\ndotnet_diagnostic.SA1507.severity = warning\ndotnet_diagnostic.SA1508.severity = warning\ndotnet_diagnostic.SA1509.severity = warning\ndotnet_diagnostic.SA1510.severity = warning\ndotnet_diagnostic.SA1511.severity = warning\ndotnet_diagnostic.SA1512.severity = warning\ndotnet_diagnostic.SA1513.severity = none # on short methods, it does not apply\ndotnet_diagnostic.SA1514.severity = warning\ndotnet_diagnostic.SA1515.severity = none # we do not respect this\ndotnet_diagnostic.SA1516.severity = none # we do not respect this for fields, properties and abstract members\ndotnet_diagnostic.SA1517.severity = warning\ndotnet_diagnostic.SA1518.severity = warning\ndotnet_diagnostic.SA1519.severity = warning\ndotnet_diagnostic.SA1520.severity = warning\n\n# Documentation Rules (SA1600-) https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/1.1.118/documentation/DocumentationRules.md\n# We don't require code documentation, however, when we do add it, we want it to be valid.\n\ndotnet_diagnostic.SA1600.severity = none\ndotnet_diagnostic.SA1601.severity = none\ndotnet_diagnostic.SA1602.severity = none\ndotnet_diagnostic.SA1603.severity = warning\ndotnet_diagnostic.SA1604.severity = none\ndotnet_diagnostic.SA1605.severity = none\ndotnet_diagnostic.SA1606.severity = warning\ndotnet_diagnostic.SA1607.severity = warning\ndotnet_diagnostic.SA1608.severity = none\ndotnet_diagnostic.SA1609.severity = none\ndotnet_diagnostic.SA1610.severity = none\ndotnet_diagnostic.SA1611.severity = none\ndotnet_diagnostic.SA1612.severity = none    # noisy when method has 3 parameters and only one has documentation\ndotnet_diagnostic.SA1613.severity = warning\ndotnet_diagnostic.SA1614.severity = warning\ndotnet_diagnostic.SA1615.severity = none\ndotnet_diagnostic.SA1616.severity = warning\ndotnet_diagnostic.SA1617.severity = warning\ndotnet_diagnostic.SA1618.severity = none\ndotnet_diagnostic.SA1619.severity = none\ndotnet_diagnostic.SA1620.severity = warning\ndotnet_diagnostic.SA1621.severity = warning\ndotnet_diagnostic.SA1622.severity = warning\ndotnet_diagnostic.SA1623.severity = none\ndotnet_diagnostic.SA1624.severity = none\ndotnet_diagnostic.SA1625.severity = none\ndotnet_diagnostic.SA1626.severity = none\ndotnet_diagnostic.SA1627.severity = warning\ndotnet_diagnostic.SA1628.severity = warning\ndotnet_diagnostic.SA1629.severity = warning\ndotnet_diagnostic.SA1630.severity = none\ndotnet_diagnostic.SA1631.severity = none\ndotnet_diagnostic.SA1632.severity = none\ndotnet_diagnostic.SA1633.severity = none\ndotnet_diagnostic.SA1634.severity = none\ndotnet_diagnostic.SA1635.severity = none\ndotnet_diagnostic.SA1636.severity = none\ndotnet_diagnostic.SA1637.severity = none\ndotnet_diagnostic.SA1638.severity = none\ndotnet_diagnostic.SA1639.severity = none\ndotnet_diagnostic.SA1640.severity = none\ndotnet_diagnostic.SA1641.severity = none\ndotnet_diagnostic.SA1642.severity = none\ndotnet_diagnostic.SA1643.severity = none\ndotnet_diagnostic.SA1644.severity = none\ndotnet_diagnostic.SA1645.severity = none\ndotnet_diagnostic.SA1646.severity = none\ndotnet_diagnostic.SA1647.severity = none\ndotnet_diagnostic.SA1648.severity = none\ndotnet_diagnostic.SA1649.severity = none\ndotnet_diagnostic.SA1650.severity = none\ndotnet_diagnostic.SA1651.severity = none\ndotnet_diagnostic.SA1652.severity = none\n\n# Alternative Rules (SX0000-)\n\ndotnet_diagnostic.SX1101.severity = none\ndotnet_diagnostic.SX1309.severity = none\ndotnet_diagnostic.SX1309S.severity = none\n# IDE0130 Change namespace to match folder structure\n[**.Test/**/*.cs]     # Do not raise in UTs, as we use .Test suffix after the whole namespace\ndotnet_diagnostic.IDE0130.severity = none\nresharper_check_namespace_highlighting = none\n\n[*.Roslyn.cs]       # Do not raise on files copied from Roslyn repository\ndotnet_diagnostic.IDE0130.severity = none\nresharper_check_namespace_highlighting = none\n\n[**/Rules/*/*.cs]      # Do not raise on files nested inside Rules (like Rules/AspNet/xxx.cs), as those are for logical separation and don't need a dedicated namespace\ndotnet_diagnostic.IDE0130.severity = none\nresharper_check_namespace_highlighting = none\n\n[**/ITs.JsonParser/**]     # Do not raise in ITs.JsonParser as it is not production code.\ndotnet_diagnostic.T0003.severity = none     # Do not use ValueTuple in the production code due to missing System.ValueTuple.dll.\n"
  },
  {
    "path": ".gitattributes",
    "content": "*.cs text eol=lf\n*.vb text eol=lf\n*.ps1 text eol=lf\n*.verified.cs text eol=lf working-tree-encoding=UTF-8\npackages.lock.json text eol=lf"
  },
  {
    "path": ".github/CODEOWNERS",
    "content": ".github/CODEOWNERS @SonarSource/quality-dotnet-squad\n"
  },
  {
    "path": ".github/GitHub.shproj",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"15.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <!-- This is a minimal Shared project to show the directory structure in Solution Explorer. This project should not be built nor referenced. -->\n  <Import Project=\"$(MSBuildExtensionsPath32)\\Microsoft\\VisualStudio\\v$(VisualStudioVersion)\\CodeSharing\\Microsoft.CodeSharing.CSharp.targets\" />\n  <ItemGroup>\n    <None Include=\"**\\*\" />\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/1-FalsePositive.yml",
    "content": "name: Report False Positive\ndescription: Analysis is raising an incorrect issue.\ntitle: \"Fix Sxxxx FP: \"\nbody:\n  - type: textarea\n    attributes:\n      label: Description\n      description: Explain the issue and context, why it should not be raised, and do not forget to mention the rule ID.\n      placeholder: Explain the issue and context, why it should not be raised, and do not forget to mention the rule ID.\n    validations:\n      required: true\n\n  - type: textarea\n    attributes:\n      label: Reproducer\n      description: Minimal code snippet which reproduces the problem.\n      value: |\n        ```\n        ```\n    validations:\n      required: true\n\n  - type: input\n    attributes:\n      label: Product and Version\n      description: What is the product name and version that you are using? SonarQube Cloud, SonarQube Server, SonarQube for Visual Studio, NuGet, etc.\n    validations:\n      required: true\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/2-FalseNegative.yml",
    "content": "name: Report False Negative\ndescription: Analysis is not raising an issue where it should.\ntitle: \"Fix Sxxxx FN: \"\nbody:\n  - type: textarea\n    attributes:\n      label: Description\n      description: Explain the context, why the issue should be raised, and do not forget to mention rule ID.\n      placeholder: Explain the context, why the issue should be raised, and do not forget to mention rule ID.\n    validations:\n      required: true\n\n  - type: textarea\n    attributes:\n      label: Reproducer\n      description: Minimal code snippet which reproduces the problem.\n      value: |\n        ```\n        ```\n    validations:\n      required: true\n\n  - type: input\n    attributes:\n      label: Product and Version\n      description: What is the product name and version that you are using? SonarQube Cloud, SonarQube Server, SonarQube for Visual Studio, NuGet, etc.\n    validations:\n      required: true\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/3-AD0001.yml",
    "content": "name: Report AD0001\ndescription: Analysis is throwing an AD0001 error.\ntitle: \"Fix AD0001: \"\nbody:\n  - type: textarea\n    attributes:\n      label: Description\n      placeholder: Explain the issue you are facing, including the full error message.\n    validations:\n      required: true\n\n  - type: textarea\n    attributes:\n      label: Reproducer\n      description: Minimal code snippet which reproduces the problem, if possible.\n      value: |\n        ```\n        ```\n    validations:\n      required: false   # Optional for AD0001 as those can be hard to find but important to report\n\n  - type: input\n    attributes:\n      label: Product and Version\n      description: What is the product name and version that you are using? SonarQube Cloud, SonarQube Server, SonarQube for Visual Studio, NuGet, etc.\n    validations:\n      required: true\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/4-NewRule.yml",
    "content": "name: Suggest New Rule\ndescription: Suggest an idea for a new rule that does not exist yet.\ntitle: \"New Rule Idea: \"\nbody:\n  - type: markdown\n    attributes:\n      value: |\n        Take a look at [existing New Rule ideas](https://github.com/SonarSource/sonar-dotnet/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22Rule%20Idea%22&page=1) to avoid duplications. Leave a comment on rule ideas that you'd like to be implemented.\n\n  - type: textarea\n    attributes:\n      label: Description\n      description: Explain why the rule is needed and what it should detect.\n      placeholder: Write rule description\n    validations:\n      required: true\n\n  - type: textarea\n    attributes:\n      label: Noncompliant code snippet\n      description: Minimal code snippet which illustrates what the issue should detect.\n      value: |\n        ```\n        ```\n    validations:\n      required: true\n\n  - type: textarea\n    attributes:\n      label: Compliant code snippet\n      description: Minimal code snippet which illustrates the expected fixed code.\n      value: |\n        ```\n        ```\n    validations:\n      required: true\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/config.yml",
    "content": "blank_issues_enabled: false\n\ncontact_links:\n\n  - name: Request support or report a bug using SonarQube Cloud.\n    url: https://community.sonarsource.com/c/sc/9\n    about: Community Forum - SonarQube Cloud.\n\n  - name: Request support or report a bug using SonarQube Server / Community Build.\n    url: https://community.sonarsource.com/c/sq/10\n    about: Community Forum - SonarQube Server / Community Build.\n\n  - name: Request support or report a bug using SonarQube for IDE.\n    url: https://community.sonarsource.com/c/sl/11\n    about: Community Forum - SonarQube for IDE.\n"
  },
  {
    "path": ".github/workflows/LabelIssue.yml",
    "content": "name: Issue labeled\n\non:\n  issues:\n    types: [\"labeled\"]\n\njobs:\n  CreateJiraIssue_job:\n    name: Create Jira issue\n    runs-on: github-ubuntu-latest-s\n    permissions:\n      id-token: write\n      issues: write\n    steps:\n      - id: secrets\n        uses: SonarSource/vault-action-wrapper@v3\n        with:\n          secrets: |\n            development/kv/data/jira user | JIRA_USER;\n            development/kv/data/jira token | JIRA_TOKEN;\n      - uses: sonarsource/gh-action-lt-backlog/ImportIssue@v2\n        with:\n          github-token: ${{ secrets.GITHUB_TOKEN }}\n          jira-user:    ${{ fromJSON(steps.secrets.outputs.vault).JIRA_USER }}\n          jira-token:   ${{ fromJSON(steps.secrets.outputs.vault).JIRA_TOKEN }}\n          jira-project: NET\n"
  },
  {
    "path": ".github/workflows/SlackNotification.yml",
    "content": "---\nname: Slack Notifications\non:\n  workflow_dispatch: # for testing\n  check_suite:\n    types: [completed]\n\njobs:\n  notify:\n    runs-on: github-ubuntu-latest-s # Public GitHub hosted runner required, Self-Hosted runners do not support Docker-in-Docker\n    permissions:\n      id-token: write\n      checks: read\n    if: github.event.check_suite.head_branch == 'master' && !contains(fromJson('[\"SUCCESS\", \"NEUTRAL\", \"SKIPPED\"]'), github.event.check_suite.conclusion)\n    steps:\n      - name: Vault Secrets\n        id: secrets\n        uses: SonarSource/vault-action-wrapper@v3\n        with:\n          secrets: development/kv/data/slack token | SLACK_TOKEN;\n\n      - name: Check run details\n        id: failedRun\n        env: \n          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n        shell: pwsh\n        run: |\n          $SuccessConclusions = @(\"SUCCESS\", \"NEUTRAL\", \"SKIPPED\")\n          $Event = Get-Content -Path $env:GITHUB_EVENT_PATH | ConvertFrom-Json -Depth 100\n          $Request = gh api $Event.check_suite.check_runs_url\n          $FailedRuns = $Request | ConvertFrom-Json | select -ExpandProperty check_runs | where { $SuccessConclusions -NotContains $_.conclusion } | foreach  { \"* [$($_.name)]($($_.details_url))\" }\n          $OFS = [Environment]::NewLine # https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-7.5#ofs\n          $EOF = (New-Guid).Guid        # https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-commands#multiline-strings\n          $Message=@\"\n          message<<$EOF\n          $($Event.check_suite.app.name ?? 'Pipeline') in [$($Event.repository.name)]($($Event.repository.html_url)) failed ($($Event.check_suite.conclusion)) on $($Event.check_suite.head_branch): $($Event.check_suite.head_commit.message -replace '[\\n\\r].*')\n          $FailedRuns\n          $EOF\n          \"@\n          $Message\n\n          $Message >> $env:GITHUB_OUTPUT\n\n      - name: Slack Notification\n        uses: rtCamp/action-slack-notify@e31e87e03dd19038e411e38ae27cbad084a90661 # v2.3.3\n        if: always()\n        env:\n          SLACK_TOKEN: ${{ fromJSON(steps.secrets.outputs.vault).SLACK_TOKEN }}\n          SLACK_CHANNEL: squad-dotnet # for testing: notification_tester\n          SLACK_TITLE: Build failed\n          SLACK_MESSAGE: ${{ steps.failedRun.outputs.message }}\n          SLACK_USERNAME: NotifierBot\n          SLACK_COLOR: danger\n          MSG_MINIMAL: true\n          SLACKIFY_MARKDOWN: true\n          SLACK_FOOTER: ' '\n          SLACK_MSG_AUTHOR: ' '\n          SLACK_ICON_EMOJI: dotnet\n"
  },
  {
    "path": ".gitignore",
    "content": "# Maven\ntarget/\n\n# IntelliJ IDEA\n*.iws\n*.iml\n*.ipr\n.idea/\n\n# Eclipse\n.classpath\n.project\n.settings\n\n# ---- Mac OS X\n.DS_Store\nIcon?\n# Thumbnails\n._*\n# Files that might appear on external disk\n.Spotlight-V100\n.Trashes\n\n# ---- Windows\n# Windows image file caches\nThumbs.db\n# Folder config file\nDesktop.ini\n\n# User-specific files + Visual Studio files\n*.suo\n*.user\n*.sln.docstates\n*.psess\n*.vsp\n.vs/\n\n# Build results\n[Dd]ebug/\n[Dd]ebugPublic/\n[Rr]elease/\nx64/\nbld/\n[Bb]in/\n[Oo]bj/\n\n# NuGet\npackages/\n*.nupkg\n\n# Roslyn\n*.sln.ide/\n\n# Sonar\n.sonar/\n.sonarqube/\n\n# Product of its\\projects\\ScannerCli\n.scannerwork/\n\n# MSTest test results\n[Tt]est[Rr]esult*/\n[Bb]uild[Ll]og.*\n\n# rule-api temp artifacts\n*.restext\n.generated/\n\n# Analyzer binaries\nanalyzers/packaging/binaries/\nanalyzers/packaging/internal/\n\n# Actual SARIF files\n/private/analyzers/its/actual/\n\n# MSBuild & other output\n/private/analyzers/its/output/\n\n# Temporary diff folder\n/private/analyzers/its/diff/\n\n/its/projects/WebApplication/.scannerwork/report-task.txt\n/its/projects/WebApplication/.scannerwork/.sonar_lock\n\n# ITs.JsonParser expects to be run from \"sonar-dotnet-enterprise/private/analyzers/its\".\n# Feel free to configure your local launchSettings.json.\nanalyzers/src/ITs.JsonParser/Properties/launchSettings.json\n\n# Claude Code\n.claude/*\nCLAUDE.local.md\n\n# Codex\n.codex\n\n# Sonar Code Context\n.sonar-code-context\n\n#Verify https://github.com/VerifyTests/Verify/blob/main/docs/wiz/Windows_VisualStudio_Cli_MSTest_AzureDevOps.md#conventions\n*.received.*"
  },
  {
    "path": ".globalconfig",
    "content": "# top-most GlobalConfig file, hierarchy search will stop in this file\nroot = true\n\n# Issues produced from a source generators needs to be in global config, see https://github.com/dotnet/roslyn/issues/81479\ndotnet_diagnostic.CS8784.severity = error   # Do not hide root cause for: Generator 'xxx' failed to initialize.      It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'xxx' with message 'xxx'\ndotnet_diagnostic.CS8785.severity = error   # Do not hide root cause for: Generator 'xxx' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'xxx' with message 'xxx'\n"
  },
  {
    "path": "LICENSE.txt",
    "content": "SONAR Source-Available License v1.0\nLast Updated November 13, 2024\n\n1. DEFINITIONS\n\n\"Agreement\" means this Sonar Source-Available License v1.0\n\n\"Competing\" means marketing a product or service as a substitute for the\nfunctionality or value of SonarQube. A product or service may compete regardless\nof how it is designed or deployed. For example, a product or service may compete\neven if it provides its functionality via any kind of interface (including\nservices, libraries, or plug-ins), even if it is ported to a different platform\nor programming language, and even if it is provided free of charge.\n\n\"Contribution\" means:\n\n  a) in the case of the initial Contributor, the initial content Distributed under\nthis Agreement, and\n\n  b) in the case of each subsequent Contributor:\n    i) changes to the Program, and\n    ii) additions to the Program;\n\nwhere such changes and/or additions to the Program originate from and are\nDistributed by that particular Contributor. A Contribution \"originates\" from a\nContributor if it was added to the Program by such Contributor itself or anyone\nacting on such Contributor's behalf. Contributions do not include changes or\nadditions to the Program that are not Modified Works.\n\n\"Contributor\" means any person or entity that Distributes the Program.\n\n\"Derivative Works\" shall mean any work, whether in Source Code or other form,\nthat is based on (or derived from) the Program and for which the editorial\nrevisions, annotations, elaborations, or other modifications represent, as a\nwhole, an original work of authorship.\n\n\"Distribute\" means the acts of a) distributing or b) making available in any\nmanner that enables the transfer of a copy.\n\n\"Licensed Patents\" mean patent claims licensable by a Contributor that are\nnecessarily infringed by the use or sale of its Contribution alone or when\ncombined with the Program.\n\n\"Modified Works\" shall mean any work in Source Code or other form that results\nfrom an addition to, deletion from, or modification of the contents of the\nProgram, including, for purposes of clarity, any new file in Source Code form\nthat contains any contents of the Program. Modified Works shall not include\nworks that contain only declarations, interfaces, types, classes, structures, or\nfiles of the Program solely in each case in order to link to, bind by name, or\nsubclass the Program or Modified Works thereof.\n\n\"Non-competitive Purpose\" means any purpose except for (a) providing to others\nany product or service that includes or offers the same or substantially similar\nfunctionality as SonarQube, (b) Competing with SonarQube, and/or (c) employing,\nusing, or engaging artificial intelligence technology that is not part of the\nProgram to ingest, interpret, analyze, train on, or interact with the data\nprovided by the Program, or to engage with the Program in any manner.\n\n\"Notices\" means any legal statements or attributions included with the Program,\nincluding, without limitation, statements concerning copyright, patent,\ntrademark, disclaimers of warranty, or limitations of liability\n\n\"Program\" means the Contributions Distributed in accordance with this Agreement.\n\n\"Recipient\" means anyone who receives the Program under this Agreement,\nincluding Contributors.\n\n\"SonarQube\" means an open-source or commercial edition of software offered by\nSonarSource that is branded \"SonarQube\".\n\n\"SonarSource\" means SonarSource SA, a Swiss company registered in Switzerland\nunder UID No. CHE-114.587.664.\n\n\"Source Code\" means the form of a Program preferred for making modifications,\nincluding but not limited to software source code, documentation source, and\nconfiguration files.\n\n2. GRANT OF RIGHTS\n\n  a) Subject to the terms of this Agreement, each Contributor hereby grants\nRecipient a non-exclusive, worldwide, royalty-free copyright license, for any\nNon-competitive Purpose, to reproduce, prepare Derivative Works of, publicly\ndisplay, publicly perform, Distribute and sublicense the Contribution of such\nContributor, if any, and such Derivative Works.\n\n  b) Subject to the terms of this Agreement, each Contributor hereby grants\nRecipient a non-exclusive, worldwide, royalty-free patent license under Licensed\nPatents, for any Non-competitive Purpose, to make, use, sell, offer to sell,\nimport, and otherwise transfer the Contribution of such Contributor, if any, in\nSource Code or other form. This patent license shall apply to the combination of\nthe Contribution and the Program if, at the time the Contribution is added by\nthe Contributor, such addition of the Contribution causes such combination to be\ncovered by the Licensed Patents. The patent license shall not apply to any other\ncombinations that include the Contribution.\n\n  c) Recipient understands that although each Contributor grants the licenses to\nits Contributions set forth herein, no assurances are provided by any\nContributor that the Program does not infringe the patent or other intellectual\nproperty rights of any other entity. Each Contributor disclaims any liability to\nRecipient for claims brought by any other entity based on infringement of\nintellectual property rights or otherwise. As a condition to exercising the\nrights and licenses granted hereunder, each Recipient hereby assumes sole\nresponsibility to secure any other intellectual property rights needed, if any.\nFor example, if a third-party patent license is required to allow Recipient to\nDistribute the Program, it is Recipient's responsibility to acquire that license\nbefore distributing the Program.\n\n  d) Each Contributor represents that to its knowledge it has sufficient copyright\nrights in its Contribution, if any, to grant the copyright license set forth in\nthis Agreement.\n\n3. REQUIREMENTS\n\n3.1 If a Contributor Distributes the Program in any form, then the Program must\nalso be made available as Source Code, in accordance with section 3.2, and the\nContributor must accompany the Program with a statement that the Source Code for\nthe Program is available under this Agreement, and inform Recipients how to\nobtain it in a reasonable manner on or through a medium customarily used for\nsoftware exchange; and\n\n3.2 When the Program is Distributed as Source Code:\n\n  a) it must be made available under this Agreement, and\n\n  b) a copy of this Agreement must be included with each copy of the Program.\n\n3.3 Contributors may not remove or alter any Notices contained within the\nProgram from any copy of the Program which they Distribute, provided that\nContributors may add their own appropriate Notices.\n\n4. NO WARRANTY\n\nEXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT\nLIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,\nMERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely\nresponsible for determining the appropriateness of using and distributing the\nProgram and assumes all risks associated with its exercise of rights under this\nAgreement, including but not limited to the risks and costs of program errors,\ncompliance with applicable laws, damage to or loss of data, programs or\nequipment, and unavailability or interruption of operations.\n\n5. DISCLAIMER OF LIABILITY\n\nEXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF\nTHE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF\nTHE POSSIBILITY OF SUCH DAMAGES.\n\n6. GENERAL\n\nIf any provision of this Agreement is invalid or unenforceable under applicable\nlaw, it shall not affect the validity or enforceability of the remainder of the\nterms of this Agreement, and without further action by the parties hereto, such\nprovision shall be reformed to the minimum extent necessary to make such\nprovision valid and enforceable.\n\nIf Recipient institutes patent litigation against any entity (including a\ncross-claim or counterclaim in a lawsuit) alleging that the Program itself\n(excluding combinations of the Program with other software or hardware)\ninfringes such Recipient’s patent(s), then such Recipient’s rights granted under\nSection 2(b) shall terminate as of the date such litigation is filed.\n\nAll Recipient’s rights under this Agreement shall terminate if it fails to\ncomply with any of the material terms or conditions of this Agreement and does\nnot cure such failure in a reasonable period of time after becoming aware of\nsuch noncompliance. If all Recipient’s rights under this Agreement terminate,\nRecipient agrees to cease use and distribution of the Program as soon as\nreasonably practicable. However, Recipient’s obligations under this Agreement\nand any licenses granted by Recipient relating to the Program shall continue and\nsurvive.\n\nExcept as expressly stated in Sections 2(a) and 2(b) above, Recipient receives\nno rights or licenses to the intellectual property of any Contributor under this\nAgreement, whether expressly, by implication, estoppel, or otherwise. All rights\nin the Program not expressly granted under this Agreement are reserved. Nothing\nin this Agreement is intended to be enforceable by any entity that is not a\nContributor or Recipient. No third-party beneficiary rights are created under\nthis Agreement.\n"
  },
  {
    "path": "NOTICE.txt",
    "content": "﻿Copyright (C) SonarSource Sàrl\nmailto:info AT sonarsource DOT com\n\nThis product includes software developed at\nSonarSource (https://sonarsource.com/).\n\nSee LICENSE.txt file for details of the \napplicable license.\n\nFor further legal information, see \nhttps://sonarsource.com/legal/\n"
  },
  {
    "path": "README.md",
    "content": "﻿# Code Quality and Security for C\\# and VB.NET\r\n\r\n[![Build Status](https://dev.azure.com/sonarsource/DotNetTeam%20Project/_apis/build/status/Sonar.Net?branchName=master)](https://dev.azure.com/sonarsource/DotNetTeam%20Project/_build/latest?definitionId=77&branchName=master)\r\n\r\n|Product|Quality Gate|Coverage|\r\n|:--:|:--:|:--:|\r\n|Analyzer|[![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=sonaranalyzer-dotnet&metric=alert_status)](https://sonarcloud.io/dashboard?id=sonaranalyzer-dotnet)|[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=sonaranalyzer-dotnet&metric=coverage)](https://sonarcloud.io/component_measures?id=sonaranalyzer-dotnet&metric=coverage)|\r\n|Plugin|[![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=org.sonarsource.dotnet%3Asonar-dotnet&metric=alert_status)](https://sonarcloud.io/dashboard?id=org.sonarsource.dotnet%3Asonar-dotnet)|[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=org.sonarsource.dotnet%3Asonar-dotnet&metric=coverage)](https://sonarcloud.io/component_measures?id=org.sonarsource.dotnet%3Asonar-dotnet&metric=coverage)|\r\n\r\n[Static analysis](https://en.wikipedia.org/wiki/Static_program_analysis) of C# and VB.NET\r\nlanguages in [SonarQube server](https://www.sonarsource.com/products/sonarqube), [SonarQube cloud](https://www.sonarsource.com/products/sonarcloud) and [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint) code quality and security products. These Roslyn analyzers allow you to deliver code with integrated code quality and security that is safe, reliable and maintainable by helping you find and correct bugs, vulnerabilities and code smells in your codebase.\r\n\r\n## Features\r\n\r\n* 470+ C# rules and 210+ VB.&#8203;NET rules\r\n* Metrics (cognitive complexity, duplications, number of lines, etc.)\r\n* Import of [test coverage reports](https://community.sonarsource.com/t/9871) from Visual Studio Code Coverage, dotCover, OpenCover, Coverlet, Altcover.\r\n* Import of third-party Roslyn Analyzers results\r\n* Support for [custom rules](https://github.com/SonarSource/sonarqube-roslyn-sdk)\r\n\r\n## Useful public resources\r\n\r\n* [Project homepage](https://redirect.sonarsource.com/plugins/csharp.html)\r\n* [Issue tracking](./docs/issues.md)\r\n\r\n### Nuget.org packages\r\n\r\n* [SonarAnalyzer.CSharp](https://www.nuget.org/packages/SonarAnalyzer.CSharp/)\r\n* [SonarAnalyzer.VisualBasic](https://www.nuget.org/packages/SonarAnalyzer.VisualBasic/)\r\n\r\n### Integration with SonarQube\r\n\r\n* [Analyze projects with SonarScanner for .NET](https://redirect.sonarsource.com/doc/install-configure-scanner-msbuild.html)\r\n* [Importing code coverage](https://community.sonarsource.com/t/9871)\r\n* [SonarQube and the code coverage](https://community.sonarsource.com/t/4725)\r\n\r\n## Do you have a question or feedback?\r\n\r\n* Contact us on [our Community Forum](https://community.sonarsource.com/) to provide feedback, ask for help, and request new rules or features.\r\n* [Create a GitHub Issue](https://github.com/SonarSource/sonar-dotnet/issues/new/choose) if you've found a bug, False-Positive or False-Negative.\r\n\r\n## Get started\r\n\r\n* [Building, testing and debugging the .NET analyzer](./docs/contributing-analyzer.md)\r\n* [Building, testing and debugging the Java plugin](./docs/contributing-plugin.md)\r\n* [How to re-generate NuGet lock files](./docs/regenerate-lock-files.md)\r\n* [Using the rspec.ps1 script](./scripts/rspec/README.md)\r\n\r\n## How to contribute\r\n\r\nThere are many ways you can contribute to the `sonar-dotnet` project.\r\nWhen contributing, please respect our [Code of Conduct](./docs/code-of-conduct.md).\r\n\r\n### Join the discussions\r\n\r\nOne of the easiest ways to contribute is to share your feedback with us (see [give feedback](#do-you-have-a-question-or-feedback)) and also answer questions from [our community forum](https://community.sonarsource.com/).\r\nYou can also monitor the activity on this repository (opened issues, opened PRs) to get more acquainted with what we do.\r\n\r\n### Pull Request (PR)\r\n\r\nIf you want to fix [an issue](https://github.com/SonarSource/sonar-dotnet/issues),\r\nplease read the [Get started](#get-started) pages first and make sure that you follow [our coding style](./docs/coding-style.md).\r\nWe suggest avoiding the implementation of new rules, as a specification process is required first.\r\r\n\r\nBefore submitting the PR, make sure [all tests](./docs/contributing-analyzer.md#running-unit-tests) are passing (all checks must be green).\r\n\r\nIf you did not sign the Contributor License Agreement in the past, please let us know in the PR your user handle from our [Community Forum](https://community.sonarsource.com/). We will arrange the signing via private message.\r\n\r\nNote: Our CI does not get automatically triggered on the PRs from external contributors.\r\nA member of our team will review the code and trigger the CI on demand by adding a comment on the PR (see [Azure Pipelines Comment triggers docs](https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/github?view=azure-devops&tabs=yaml#comment-triggers)):\r\n- `/azp run Sonar.Net` - It will run the full pipeline, including plugin tests and promotion\r\n\r\n## Custom Rules\r\n\r\nTo request new rules, Contact us on [our Community Forum](https://community.sonarsource.com/c/suggestions/).\r\n\r\nIf you have an idea for a rule but you are not sure that everyone needs it, you can implement your own Roslyn analyzer.\r\n- You can start with [this tutorial from Microsoft](https://docs.microsoft.com/en-us/dotnet/csharp/roslyn-sdk/tutorials/how-to-write-csharp-analyzer-code-fix) to write an analyzer.\r\n- All Roslyn-based issues are picked up by the [SonarScanner for .NET](https://redirect.sonarsource.com/doc/install-configure-scanner-msbuild.html)\r\nand pushed to SonarQube as external issues.\r\n- Also check out [SonarQube Roslyn SDK](https://github.com/SonarSource-VisualStudio/sonarqube-roslyn-sdk) to embed\r\nyour Roslyn analyzer in a SonarQube plugin, if you want to manage your rules from SonarQube.\r\n\r\n## Configuring Rules\r\n\r\n### SonarQube for IDE\r\n\r\nThe easiest way is to configure a Quality Profile in SonarQube. Use SonarQube for IDE Connected Mode to connect to SonarQube Server or Cloud.\r\n\r\n### Standalone NuGet\r\n\r\nThe rules from standalone NuGet packages can be enabled or disabled in the same way as the other analyzers based on Roslyn, by using the `.globalconfig` or `.editorconfig` files.\r\nSee: https://learn.microsoft.com/en-us/visualstudio/code-quality/use-roslyn-analyzers?view=vs-2022#set-rule-severity-in-an-editorconfig-file\r\n\r\nIf the rules are parameterized, the parameter values can be changed using `SonarLint.xml` additional files.\r\n\r\nThe first step is to create a new file, named `SonarLint.xml`, that has the following structure:\r\n\r\n```xml\r\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<AnalysisInput xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\r\n  <Settings>\r\n    <Setting>\r\n      <Key>sonar.cs.analyzeGeneratedCode</Key>\r\n      <Value>false</Value>\r\n    </Setting>\r\n  </Settings>\r\n  <Rules>\r\n    <Rule>\r\n      <Key>S107</Key>\r\n      <Parameters>\r\n        <Parameter>\r\n          <Key>max</Key>\r\n          <Value>2</Value>\r\n        </Parameter>\r\n      </Parameters>\r\n    </Rule>\r\n  </Rules>\r\n</AnalysisInput>\r\n```\r\nThen, update the projects to include this additional file:\r\n```xml\r\n<ItemGroup>\r\n  <AdditionalFiles Include=\"SonarLint.xml\" />\r\n</ItemGroup>\r\n```\r\n\r\n## Security Issues\r\n\r\nIf you believe you have discovered a security vulnerability in Sonar's products, please check [this document](./SECURITY.md).\r\n\r\n## License\r\n\r\nCopyright SonarSource Sàrl.\r\n\r\nLicensed under the [SONAR Source-Available License v1.0](https://www.sonarsource.com/license/ssal/)\r\n\r\n"
  },
  {
    "path": "SECURITY.md",
    "content": "# Reporting Security Issues\n\nA mature software vulnerability treatment process is a cornerstone of a robust information security management system. Contributions from the community play an important role in the evolution and security of our products, and in safeguarding the security and privacy of our users.\n\nIf you believe you have discovered a security vulnerability in Sonar's products, we encourage you to report it immediately.\n\nTo responsibly report a security issue, please email us at [security@sonarsource.com](mailto:security@sonarsource.com). Sonar’s security team will acknowledge your report, guide you through the next steps, or request additional information if necessary. Customers with a support contract can also report the vulnerability directly through the support channel.\n\nFor security vulnerabilities found in third-party libraries, please also contact the library's owner or maintainer directly.\n\n## Responsible Disclosure Policy\n\nFor more information about disclosing a security vulnerability to Sonar, please refer to our community post: [Responsible Vulnerability Disclosure](https://community.sonarsource.com/t/9317).\n"
  },
  {
    "path": "analyzers/.runsettings",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RunSettings>\n  <RunConfiguration>\n    <!-- 0 will run all Test DLL in parallel locally -->\n    <MaxCpuCount>0</MaxCpuCount>\n  </RunConfiguration>\n</RunSettings>"
  },
  {
    "path": "analyzers/CI.NuGet.Config",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <packageSources>\n    <clear />\n    <add key=\"Repox\" value=\"https://repox.jfrog.io/artifactory/api/nuget/v3/nuget/index.json\" protocolVersion=\"3\" />\n  </packageSources>\n  <packageSourceCredentials>\n    <Repox>\n      <add key=\"Username\" value=\"%ARTIFACTORY_USER%\" />\n      <add key=\"ClearTextPassword\" value=\"%ARTIFACTORY_PASSWORD%\" />\n    </Repox>\n  </packageSourceCredentials>\n  <config>\n    <clear />\n    <add key=\"signatureValidationMode\" value=\"require\" />\n  </config>\n  <trustedSigners>\n    <clear />\n    <repository name=\"nuget.org\" serviceIndex=\"https://api.nuget.org/v3/index.json\">\n      <!-- Subject Name: CN=NuGet.org Repository by Microsoft, valid from 2018-04-10 -->\n      <certificate fingerprint=\"0E5F38F57DC1BCC806D8494F4F90FBCEDD988B46760709CBEEC6F4219AA6157D\" hashAlgorithm=\"SHA256\" allowUntrustedRoot=\"false\" />\n      <!-- Subject Name: CN=NuGet.org Repository by Microsoft, valid from 2021-02-16 -->\n      <certificate fingerprint=\"5A2901D6ADA3D18260B9C6DFE2133C95D74B9EEF6AE0E5DC334C8454D1477DF4\" hashAlgorithm=\"SHA256\" allowUntrustedRoot=\"false\" />\n      <!-- Subject Name: CN=NuGet.org Repository by Microsoft, valid from 2024-02-23 -->\n      <certificate fingerprint=\"1F4B311D9ACC115C8DC8018B5A49E00FCE6DA8E2855F9F014CA6F34570BC482D\" hashAlgorithm=\"SHA256\" allowUntrustedRoot=\"false\" />\n      <!-- sharwell = author of StyleCop.Analyzers -->\n      <!-- test dependencies: -->\n      <!-- meirb = Meir Blachman, author of FluentAssertions.Analyzers -->\n      <!-- jonorossi = Jonathon Rossi, maintainer of Castle Project -->\n      <!-- onovotny = Claire Novotny, author of Humanizer.Core -->\n      <!-- SteveGilham = author of AltCover-->\n      <!-- jamesnk = author of Newtonsoft.Json -->\n      <!-- commandlineparser = author of CommandLineParser -->\n      <!-- grpc-packages = author of Grpc.Tools -->\n      <!-- Nsubstitute = author of NSubstitute -->\n      <!-- simoncropp = author of Verify -->\n      <!-- Youssef1313 = Youssef Korani, author of Combinatorial.MSTest -->\n      <owners>Youssef1313;protobuf-packages;Microsoft;sharwell;meirb;dotnetfoundation;castleproject;jonorossi;onovotny;fluentassertions;SteveGilham;jamesnk;commandlineparser;grpc-packages;Fody;NSubstitute;jetbrains;simoncropp</owners>\n    </repository>\n    <author name=\"SonarSource\">\n      <!-- Subject Name: CN=SonarSource SA, O=SonarSource SA, L=Vernier, S=Genève, C=CH, valid from 2025-01-23 -->\n      <certificate fingerprint=\"404ADA6248101C569ED40D7B6D621878F1A5DCF66D900368894CBAE6DCE10A29\" hashAlgorithm=\"SHA256\" allowUntrustedRoot=\"false\" />\n    </author>\n  </trustedSigners>\n</configuration>\n"
  },
  {
    "path": "analyzers/CodeAnalysis.targets",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project>\n  <ItemGroup>\n    <PackageReference Include=\"SonarAnalyzer.CSharp.Styling\" Version=\"10.21.0.135717\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"StyleCop.Analyzers\" Version=\"1.2.0-beta.556\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers\" Version=\"3.3.1\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>\n    <AdditionalFiles Include=\"$(MSBuildThisFileDirectory)stylecop.json\">\n      <Link>stylecop.json</Link>\n    </AdditionalFiles>\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "analyzers/Common.targets",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project>\n  <!-- This file is included in all projects inside src and tests directories. -->\n  <Import Project=\"$(MSBuildThisFileDirectory)\\CodeAnalysis.targets\" />\n  <Import Project=\"$(MSBuildThisFileDirectory)\\Version.targets\" />\n\n  <PropertyGroup>\n    <LangVersion>14</LangVersion>\n    <RunAnalyzersDuringBuild>false</RunAnalyzersDuringBuild>\n    <!-- Store output of Source Generators in obj\\debug\\net46\\generated for easier debugging -->\n    <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>\n    <CompilerGeneratedFilesOutputPath>$(IntermediateOutputPath)generated</CompilerGeneratedFilesOutputPath>\n    <RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>\n    <!-- Disable package pruning to ensure consistent lock files between Renovate (csproj restore) and CI (sln restore).\n         Pruning is applied during csproj restore but not during sln restore (NuGet bug), causing NU1004 in locked mode.\n         See NET-3274 and https://github.com/NuGet/Home/issues/14272 -->\n    <RestoreEnablePackagePruning>false</RestoreEnablePackagePruning>\n    <DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>\n    <!-- Generation of Assembly Attributes that are visible in the DLL properties -->\n    <Company>SonarSource Sàrl</Company>\n    <Version>$(ShortVersion)</Version>\n    <FileVersion>$(FullVersion)</FileVersion>\n    <InformationalVersion>Version:$(FullVersion) Branch:$(Branch) Sha1:$(Sha1)</InformationalVersion>\n    <Copyright>Copyright © SonarSource Sàrl</Copyright>\n    <Product>SonarAnalyzer</Product>\n    <Trademark>SonarLint, SonarQube, SonarSource</Trademark>\n    <NeutralLanguage>en</NeutralLanguage>\n    <!-- This prevents appending of additional \"+sha\" at the end of InformationalVersion -->\n    <IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <Using Include=\"System\" />\n    <Using Include=\"System.Collections.Generic\" />\n    <Using Include=\"System.Collections.Immutable\" />\n    <Using Include=\"System.Diagnostics\" />\n    <Using Include=\"System.Linq\" />\n    <Using Include=\"System.Threading\" />\n    <Using Include=\"System.Threading.Tasks\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Compile Include=\"$(MSBuildThisFileDirectory)\\src\\AssemblyInfo.Shared.cs\" Link=\"Properties\\AssemblyInfo.Shared.cs\" />\n  </ItemGroup>\n\n  <PropertyGroup Condition=\"'$(TF_BUILD)' == 'true'\">\n    <ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>\n    <Deterministic>true</Deterministic>\n  </PropertyGroup>\n\n  <ItemGroup Condition=\"'$(TF_BUILD)' == 'true'\">\n    <SourceRoot Include=\"$(MSBuildThisFileDirectory)/\"/>\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "analyzers/README.md",
    "content": "# SonarAnalyzer for C# and Visual Basic .NET\n\nThis folder contains the code specific to the Roslyn based analyzer for C# and VB.NET.\n\nTo get more information please read the repository main [README](../README.md).\n"
  },
  {
    "path": "analyzers/SonarAnalyzer.sln",
    "content": "Microsoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio Version 18\nVisualStudioVersion = 18.0.11205.157 d18.0\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"Tests\", \"Tests\", \"{B7233F78-E142-4882-B084-7C83BE472109}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"SonarAnalyzer.Core\", \"src\\SonarAnalyzer.Core\\SonarAnalyzer.Core.csproj\", \"{8A8A663E-1318-4361-BC97-2E63666FEADB}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"SonarAnalyzer.Test\", \"tests\\SonarAnalyzer.Test\\SonarAnalyzer.Test.csproj\", \"{E11606CA-A186-4FEE-BA30-B1688747CD1A}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"RuleDescriptorGenerator\", \"src\\RuleDescriptorGenerator\\RuleDescriptorGenerator.csproj\", \"{07E31F39-7419-4B4E-998E-C2BF1A6BB91C}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"SonarAnalyzer.CSharp\", \"src\\SonarAnalyzer.CSharp\\SonarAnalyzer.CSharp.csproj\", \"{CA8EEC07-8775-42E3-91EB-E51F4DB72A48}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"SonarAnalyzer.VisualBasic\", \"src\\SonarAnalyzer.VisualBasic\\SonarAnalyzer.VisualBasic.csproj\", \"{7CFA8FA5-8842-4E89-BB90-39D5C0F20BA8}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"SonarAnalyzer.CFG\", \"src\\SonarAnalyzer.CFG\\SonarAnalyzer.CFG.csproj\", \"{F766F556-CB91-408A-9149-EB963DE1B817}\"\nEndProject\nProject(\"{D954291E-2A0B-460D-934E-DC6B0785DB48}\") = \"SonarAnalyzer.Shared\", \"src\\SonarAnalyzer.Shared\\SonarAnalyzer.Shared.shproj\", \"{892CF3FA-3BE2-42E8-A7E6-76AE72864DEC}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"SonarAnalyzer.ShimLayer.CodeGeneration\", \"src\\SonarAnalyzer.ShimLayer.CodeGeneration\\SonarAnalyzer.ShimLayer.CodeGeneration.csproj\", \"{684F0AD7-BBC9-40C8-9E54-D9C2B57560D9}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"SonarAnalyzer.SourceGenerators\", \"src\\SonarAnalyzer.SourceGenerators\\SonarAnalyzer.SourceGenerators.csproj\", \"{76D6EBB8-D2B0-41C1-8880-027EC78CB7FF}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"SonarAnalyzer.TestFramework.Test\", \"tests\\SonarAnalyzer.TestFramework.Test\\SonarAnalyzer.TestFramework.Test.csproj\", \"{ADBE6CFE-980F-4D4F-8E25-E391581D291E}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"SonarAnalyzer.TestFramework\", \"tests\\SonarAnalyzer.TestFramework\\SonarAnalyzer.TestFramework.csproj\", \"{4C1DB1C4-C1FC-4AA1-B855-0D1948E68FB8}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"SonarAnalyzer.CSharp.Styling\", \"src\\SonarAnalyzer.CSharp.Styling\\SonarAnalyzer.CSharp.Styling.csproj\", \"{7F1A25AD-2EEF-4CF9-92D9-FE5B203EECE3}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"SonarAnalyzer.CSharp.Styling.Test\", \"tests\\SonarAnalyzer.CSharp.Styling.Test\\SonarAnalyzer.CSharp.Styling.Test.csproj\", \"{6F4F7666-8A0D-47FE-A312-56010C4CE082}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"SonarAnalyzer.ShimLayer.Lightup\", \"src\\SonarAnalyzer.ShimLayer.Lightup\\SonarAnalyzer.ShimLayer.Lightup.csproj\", \"{93AF346B-C43A-4A42-AD5B-72681367180E}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"SonarAnalyzer.CSharp.Core\", \"src\\SonarAnalyzer.CSharp.Core\\SonarAnalyzer.CSharp.Core.csproj\", \"{6841D9C0-1B5D-4853-87A5-9D846A165948}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"SonarAnalyzer.VisualBasic.Core\", \"src\\SonarAnalyzer.VisualBasic.Core\\SonarAnalyzer.VisualBasic.Core.csproj\", \"{6273FCC8-CD1C-4C50-B1C8-CCA1A26BFB3C}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"SonarAnalyzer.Core.Test\", \"tests\\SonarAnalyzer.Core.Test\\SonarAnalyzer.Core.Test.csproj\", \"{F97BFB85-443A-45D1-98AB-119BE9A1D121}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"SonarAnalyzer.CSharp.Core.Test\", \"tests\\SonarAnalyzer.CSharp.Core.Test\\SonarAnalyzer.CSharp.Core.Test.csproj\", \"{04CA2E3F-D46B-4178-B198-EB170C1685AC}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"SonarAnalyzer.VisualBasic.Core.Test\", \"tests\\SonarAnalyzer.VisualBasic.Core.Test\\SonarAnalyzer.VisualBasic.Core.Test.csproj\", \"{5624BF83-AA2B-4D55-97FB-BB8B0158C92A}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"SonarAnalyzer.ShimLayer.Generator\", \"src\\SonarAnalyzer.ShimLayer.Generator\\SonarAnalyzer.ShimLayer.Generator.csproj\", \"{3DB9C3E6-E845-F032-3E92-9F3D90FBF1A6}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"SonarAnalyzer.ShimLayer\", \"src\\SonarAnalyzer.ShimLayer\\SonarAnalyzer.ShimLayer.csproj\", \"{F38DD14C-BD40-F98B-93CC-635BFD353558}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"SonarAnalyzer.ShimLayer.Generator.Test\", \"tests\\SonarAnalyzer.ShimLayer.Generator.Test\\SonarAnalyzer.ShimLayer.Generator.Test.csproj\", \"{ECAEE259-90AD-50B6-BA9C-110A0CC40D30}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Any CPU = Debug|Any CPU\n\t\tRelease|Any CPU = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{8A8A663E-1318-4361-BC97-2E63666FEADB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{8A8A663E-1318-4361-BC97-2E63666FEADB}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{8A8A663E-1318-4361-BC97-2E63666FEADB}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{8A8A663E-1318-4361-BC97-2E63666FEADB}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{E11606CA-A186-4FEE-BA30-B1688747CD1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{E11606CA-A186-4FEE-BA30-B1688747CD1A}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{E11606CA-A186-4FEE-BA30-B1688747CD1A}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{E11606CA-A186-4FEE-BA30-B1688747CD1A}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{07E31F39-7419-4B4E-998E-C2BF1A6BB91C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{07E31F39-7419-4B4E-998E-C2BF1A6BB91C}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{07E31F39-7419-4B4E-998E-C2BF1A6BB91C}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{07E31F39-7419-4B4E-998E-C2BF1A6BB91C}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{CA8EEC07-8775-42E3-91EB-E51F4DB72A48}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{CA8EEC07-8775-42E3-91EB-E51F4DB72A48}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{CA8EEC07-8775-42E3-91EB-E51F4DB72A48}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{CA8EEC07-8775-42E3-91EB-E51F4DB72A48}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{7CFA8FA5-8842-4E89-BB90-39D5C0F20BA8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{7CFA8FA5-8842-4E89-BB90-39D5C0F20BA8}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{7CFA8FA5-8842-4E89-BB90-39D5C0F20BA8}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{7CFA8FA5-8842-4E89-BB90-39D5C0F20BA8}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{F766F556-CB91-408A-9149-EB963DE1B817}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{F766F556-CB91-408A-9149-EB963DE1B817}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{F766F556-CB91-408A-9149-EB963DE1B817}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{F766F556-CB91-408A-9149-EB963DE1B817}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{684F0AD7-BBC9-40C8-9E54-D9C2B57560D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{684F0AD7-BBC9-40C8-9E54-D9C2B57560D9}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{684F0AD7-BBC9-40C8-9E54-D9C2B57560D9}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{684F0AD7-BBC9-40C8-9E54-D9C2B57560D9}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{76D6EBB8-D2B0-41C1-8880-027EC78CB7FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{76D6EBB8-D2B0-41C1-8880-027EC78CB7FF}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{76D6EBB8-D2B0-41C1-8880-027EC78CB7FF}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{76D6EBB8-D2B0-41C1-8880-027EC78CB7FF}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{ADBE6CFE-980F-4D4F-8E25-E391581D291E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{ADBE6CFE-980F-4D4F-8E25-E391581D291E}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{ADBE6CFE-980F-4D4F-8E25-E391581D291E}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{ADBE6CFE-980F-4D4F-8E25-E391581D291E}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{4C1DB1C4-C1FC-4AA1-B855-0D1948E68FB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{4C1DB1C4-C1FC-4AA1-B855-0D1948E68FB8}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{4C1DB1C4-C1FC-4AA1-B855-0D1948E68FB8}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{4C1DB1C4-C1FC-4AA1-B855-0D1948E68FB8}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{7F1A25AD-2EEF-4CF9-92D9-FE5B203EECE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{7F1A25AD-2EEF-4CF9-92D9-FE5B203EECE3}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{7F1A25AD-2EEF-4CF9-92D9-FE5B203EECE3}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{7F1A25AD-2EEF-4CF9-92D9-FE5B203EECE3}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{6F4F7666-8A0D-47FE-A312-56010C4CE082}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{6F4F7666-8A0D-47FE-A312-56010C4CE082}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{6F4F7666-8A0D-47FE-A312-56010C4CE082}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{6F4F7666-8A0D-47FE-A312-56010C4CE082}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{93AF346B-C43A-4A42-AD5B-72681367180E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{93AF346B-C43A-4A42-AD5B-72681367180E}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{93AF346B-C43A-4A42-AD5B-72681367180E}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{93AF346B-C43A-4A42-AD5B-72681367180E}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{6841D9C0-1B5D-4853-87A5-9D846A165948}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{6841D9C0-1B5D-4853-87A5-9D846A165948}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{6841D9C0-1B5D-4853-87A5-9D846A165948}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{6841D9C0-1B5D-4853-87A5-9D846A165948}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{6273FCC8-CD1C-4C50-B1C8-CCA1A26BFB3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{6273FCC8-CD1C-4C50-B1C8-CCA1A26BFB3C}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{6273FCC8-CD1C-4C50-B1C8-CCA1A26BFB3C}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{6273FCC8-CD1C-4C50-B1C8-CCA1A26BFB3C}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{F97BFB85-443A-45D1-98AB-119BE9A1D121}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{F97BFB85-443A-45D1-98AB-119BE9A1D121}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{F97BFB85-443A-45D1-98AB-119BE9A1D121}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{F97BFB85-443A-45D1-98AB-119BE9A1D121}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{04CA2E3F-D46B-4178-B198-EB170C1685AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{04CA2E3F-D46B-4178-B198-EB170C1685AC}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{04CA2E3F-D46B-4178-B198-EB170C1685AC}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{04CA2E3F-D46B-4178-B198-EB170C1685AC}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{5624BF83-AA2B-4D55-97FB-BB8B0158C92A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{5624BF83-AA2B-4D55-97FB-BB8B0158C92A}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{5624BF83-AA2B-4D55-97FB-BB8B0158C92A}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{5624BF83-AA2B-4D55-97FB-BB8B0158C92A}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{3DB9C3E6-E845-F032-3E92-9F3D90FBF1A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{3DB9C3E6-E845-F032-3E92-9F3D90FBF1A6}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{3DB9C3E6-E845-F032-3E92-9F3D90FBF1A6}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{3DB9C3E6-E845-F032-3E92-9F3D90FBF1A6}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{F38DD14C-BD40-F98B-93CC-635BFD353558}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{F38DD14C-BD40-F98B-93CC-635BFD353558}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{F38DD14C-BD40-F98B-93CC-635BFD353558}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{F38DD14C-BD40-F98B-93CC-635BFD353558}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{ECAEE259-90AD-50B6-BA9C-110A0CC40D30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{ECAEE259-90AD-50B6-BA9C-110A0CC40D30}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{ECAEE259-90AD-50B6-BA9C-110A0CC40D30}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{ECAEE259-90AD-50B6-BA9C-110A0CC40D30}.Release|Any CPU.Build.0 = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\n\tGlobalSection(NestedProjects) = preSolution\n\t\t{E11606CA-A186-4FEE-BA30-B1688747CD1A} = {B7233F78-E142-4882-B084-7C83BE472109}\n\t\t{ADBE6CFE-980F-4D4F-8E25-E391581D291E} = {B7233F78-E142-4882-B084-7C83BE472109}\n\t\t{4C1DB1C4-C1FC-4AA1-B855-0D1948E68FB8} = {B7233F78-E142-4882-B084-7C83BE472109}\n\t\t{6F4F7666-8A0D-47FE-A312-56010C4CE082} = {B7233F78-E142-4882-B084-7C83BE472109}\n\t\t{F97BFB85-443A-45D1-98AB-119BE9A1D121} = {B7233F78-E142-4882-B084-7C83BE472109}\n\t\t{04CA2E3F-D46B-4178-B198-EB170C1685AC} = {B7233F78-E142-4882-B084-7C83BE472109}\n\t\t{5624BF83-AA2B-4D55-97FB-BB8B0158C92A} = {B7233F78-E142-4882-B084-7C83BE472109}\n\t\t{ECAEE259-90AD-50B6-BA9C-110A0CC40D30} = {B7233F78-E142-4882-B084-7C83BE472109}\n\tEndGlobalSection\n\tGlobalSection(ExtensibilityGlobals) = postSolution\n\t\tSolutionGuid = {4259CA71-C565-42DD-8D58-F59819A11065}\n\tEndGlobalSection\n\tGlobalSection(SharedMSBuildProjectFiles) = preSolution\n\t\tsrc\\SonarAnalyzer.Shared\\SonarAnalyzer.Shared.projitems*{6273fcc8-cd1c-4c50-b1c8-cca1a26bfb3c}*SharedItemsImports = 5\n\t\tsrc\\SonarAnalyzer.Shared\\SonarAnalyzer.Shared.projitems*{6841d9c0-1b5d-4853-87a5-9d846a165948}*SharedItemsImports = 5\n\t\tsrc\\SonarAnalyzer.Shared\\SonarAnalyzer.Shared.projitems*{7cfa8fa5-8842-4e89-bb90-39d5c0f20ba8}*SharedItemsImports = 5\n\t\tsrc\\SonarAnalyzer.Shared\\SonarAnalyzer.Shared.projitems*{892cf3fa-3be2-42e8-a7e6-76ae72864dec}*SharedItemsImports = 13\n\t\tsrc\\SonarAnalyzer.Shared\\SonarAnalyzer.Shared.projitems*{ca8eec07-8775-42e3-91eb-e51f4db72a48}*SharedItemsImports = 5\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "analyzers/Version.targets",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project>\n  <PropertyGroup>\n    <!-- These 4 values are set via set-version.ps1 -->\n    <ShortVersion>10.26</ShortVersion>\n    <BuildNumber>0</BuildNumber>\n    <Branch>\n    </Branch>\n    <Sha1>\n    </Sha1>\n    <!-- Computed values -->\n    <ShortVersionSuffix Condition=\"$(ShortVersion.IndexOf('.')) == $(ShortVersion.LastIndexOf('.'))\">.0</ShortVersionSuffix>\n    <FullVersion>$(ShortVersion)$(ShortVersionSuffix).$(BuildNumber)</FullVersion>\n  </PropertyGroup>\n</Project>"
  },
  {
    "path": "analyzers/packaging/Licenses/THIRD_PARTY_LICENSES/Google.Protobuf-LICENSE.txt",
    "content": "Copyright 2008 Google Inc.  All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n    * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n    * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nCode generated by the Protocol Buffer compiler is owned by the owner\nof the input file used when generating it.  This code is not\nstandalone and requires a support library to be linked with it.  This\nsupport library is itself covered by the above license."
  },
  {
    "path": "analyzers/packaging/Licenses/THIRD_PARTY_LICENSES/Roslyn-LICENSE.txt",
    "content": "The MIT License (MIT)\n\nCopyright (c) .NET Foundation and Contributors\n\nAll rights reserved.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "analyzers/packaging/Licenses/THIRD_PARTY_LICENSES/StyleCop.Analyzers-LICENSE.txt",
    "content": "MIT License\n\nCopyright (c) Tunnel Vision Laboratories, LLC\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."
  },
  {
    "path": "analyzers/packaging/SonarAnalyzer.CFG.nuspec",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<package xmlns=\"http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd\">\n  <metadata>\n    <id>SonarAnalyzer.CFG</id>\n    <version>$Version$</version>\n    <title>CFG library for SonarAnalyzer</title>\n    <authors>SonarSource</authors>\n    <owners>SonarSource</owners>\n    <license type=\"file\">licenses\\LICENSE.txt</license>\n    <repository type=\"git\" url=\"https://github.com/SonarSource/sonar-dotnet\" />\n    <requireLicenseAcceptance>false</requireLicenseAcceptance>\n    <description>SonarSource CFG library</description>\n    <releaseNotes>https://github.com/SonarSource/sonar-dotnet/releases/tag/$Version$</releaseNotes>\n    <language>en-US</language>\n    <copyright>Copyright © SonarSource Sàrl</copyright>\n    <frameworkAssemblies>\n      <frameworkAssembly assemblyName=\"System\" targetFramework=\"\" />\n    </frameworkAssemblies>\n  </metadata>\n  <files>\n    <file src=\"binaries\\SonarAnalyzer.CFG\\*.dll\" target=\"lib\\netstandard2.0\" />\n    <file src=\"licenses\\THIRD_PARTY_LICENSES\\StyleCop.Analyzers-LICENSE.txt\" target=\"licenses\\THIRD_PARTY_LICENSES\\\" />\n    <file src=\"..\\..\\LICENSE.txt\" target=\"licenses\\\" />\n  </files>\n</package>\n"
  },
  {
    "path": "analyzers/packaging/SonarAnalyzer.CSharp.Styling.nuspec",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<package xmlns=\"http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd\">\n  <metadata>\n    <id>SonarAnalyzer.CSharp.Styling</id>\n    <version>$Version$</version>\n    <title>Internal Sonar styling analyzer for C#</title>\n    <authors>SonarSource</authors>\n    <owners>SonarSource</owners>\n    <license type=\"file\">licenses\\LICENSE.txt</license>\n    <projectUrl>https://redirect.sonarsource.com/doc/sonar-visualstudio.html</projectUrl>\n    <repository type=\"git\" url=\"https://github.com/SonarSource/sonar-dotnet\" />\n    <icon>images\\sonarsource_64.png</icon>\n    <requireLicenseAcceptance>false</requireLicenseAcceptance>\n    <summary>Internal Sonar styling analyzer for C#</summary>\n    <description>This package contains a set of coding style rules to follow in Sonar code base. Coding style changes as well as breaking changes will appear between minor versions without prior notice. We do not provide support for this package.</description>\n    <releaseNotes>https://github.com/SonarSource/sonar-dotnet/releases/tag/$Version$</releaseNotes>\n    <language>en-US</language>\n    <copyright>Copyright © SonarSource Sàrl</copyright>\n    <developmentDependency>true</developmentDependency>\n    <frameworkAssemblies>\n      <frameworkAssembly assemblyName=\"System\" targetFramework=\"\" />\n    </frameworkAssemblies>\n  </metadata>\n  <files>\n    <file src=\"binaries\\SonarAnalyzer.CSharp.Styling\\Internal.SonarAnalyzer.CSharp.Styling.dll\" target=\"analyzers\" />\n    <file src=\"logos\\sonarsource_64.png\" target=\"images\\\" />\n    <file src=\"licenses\\THIRD_PARTY_LICENSES\\*\" target=\"licenses\\THIRD_PARTY_LICENSES\\\" />\n    <file src=\"..\\..\\LICENSE.txt\" target=\"licenses\\\" />\n  </files>\n</package>\n"
  },
  {
    "path": "analyzers/packaging/SonarAnalyzer.CSharp.nuspec",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<package xmlns=\"http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd\">\n  <metadata>\n    <id>SonarAnalyzer.CSharp</id>\n    <version>$Version$</version>\n    <title>SonarAnalyzer for C#</title>\n    <authors>SonarSource</authors>\n    <owners>SonarSource</owners>\n    <license type=\"file\">licenses\\LICENSE.txt</license>\n    <projectUrl>https://redirect.sonarsource.com/doc/sonar-visualstudio.html</projectUrl>\n    <repository type=\"git\" url=\"https://github.com/SonarSource/sonar-dotnet\" />\n    <icon>images\\sonarsource_64.png</icon>\n    <requireLicenseAcceptance>false</requireLicenseAcceptance>\n    <summary>Roslyn analyzers that spot Bugs, Vulnerabilities and Code Smells in your code. For an even better overall experience, you can use SonarQube for IDE (Visual Studio, Rider), which is a free extension that can be used standalone or with SonarQube (Server, Cloud).</summary>\n    <description>Roslyn analyzers that spot Bugs, Vulnerabilities and Code Smells in your code. For an even better overall experience, you can use SonarQube for IDE (Visual Studio, Rider, see https://www.sonarsource.com/products/sonarlint), which is a free extension that can be used standalone or with SonarQube (Server, Cloud, see: https://www.sonarsource.com/products/sonarqube/ and https://www.sonarsource.com/products/sonarcloud/).</description>\n    <releaseNotes>https://github.com/SonarSource/sonar-dotnet/releases/tag/$Version$</releaseNotes>\n    <language>en-US</language>\n    <copyright>Copyright © SonarSource Sàrl</copyright>\n    <tags>Roslyn Analyzer Analyzers Refactoring CodeAnalysis CleanCode Clean Code Sonar SonarAnalyzer Dotnet CSharp CodeQuality CodeReview StaticCodeAnalysis SonarQube SonarCloud SonarLint SonarQubeServer SonarQubeCloud SonarQubeIDE</tags>\n    <developmentDependency>true</developmentDependency>\n    <frameworkAssemblies>\n      <frameworkAssembly assemblyName=\"System\" targetFramework=\"\" />\n    </frameworkAssemblies>\n  </metadata>\n  <files>\n    <file src=\"binaries\\SonarAnalyzer.CSharp\\*.dll\" target=\"analyzers\" />\n    <file src=\"tools-cs\\*.ps1\" target=\"tools\\\" />\n    <file src=\"logos\\sonarsource_64.png\" target=\"images\\\" />\n    <file src=\"licenses\\THIRD_PARTY_LICENSES\\*\" target=\"licenses\\THIRD_PARTY_LICENSES\\\" />\n    <file src=\"..\\..\\LICENSE.txt\" target=\"licenses\\\" />\n  </files>\n</package>\n"
  },
  {
    "path": "analyzers/packaging/SonarAnalyzer.VisualBasic.nuspec",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<package xmlns=\"http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd\">\n  <metadata>\n    <id>SonarAnalyzer.VisualBasic</id>\n    <version>$Version$</version>\n    <title>SonarAnalyzer for Visual Basic</title>\n    <authors>SonarSource</authors>\n    <owners>SonarSource</owners>\n    <license type=\"file\">licenses\\LICENSE.txt</license>\n    <projectUrl>https://redirect.sonarsource.com/doc/sonar-visualstudio.html</projectUrl>\n    <repository type=\"git\" url=\"https://github.com/SonarSource/sonar-dotnet\" />\n    <icon>images\\sonarsource_64.png</icon>\n    <requireLicenseAcceptance>false</requireLicenseAcceptance>\n    <summary>Roslyn analyzers that spot Bugs, Vulnerabilities and Code Smells in your code. For an even better overall experience, you can use SonarQube for IDE (Visual Studio, Rider), which is a free extension that can be used standalone or with SonarQube (Server, Cloud).</summary>\n    <description>Roslyn analyzers that spot Bugs, Vulnerabilities and Code Smells in your code. For an even better overall experience, you can use SonarQube for IDE (Visual Studio, Rider, see https://www.sonarsource.com/products/sonarlint), which is a free extension that can be used standalone or with SonarQube (Server, Cloud, see: https://www.sonarsource.com/products/sonarqube/ and https://www.sonarsource.com/products/sonarcloud/).</description>\n    <releaseNotes>https://github.com/SonarSource/sonar-dotnet/releases/tag/$Version$</releaseNotes>\n    <language>en-US</language>\n    <copyright>Copyright © SonarSource Sàrl</copyright>\n    <tags>Roslyn Analyzer Analyzers Refactoring CodeAnalysis CleanCode Clean Code Sonar SonarAnalyzer Dotnet VisualBasic CodeQuality CodeReview StaticCodeAnalysis SonarQube SonarCloud SonarLint</tags>\n    <developmentDependency>true</developmentDependency>\n    <frameworkAssemblies>\n      <frameworkAssembly assemblyName=\"System\" targetFramework=\"\" />\n    </frameworkAssemblies>\n  </metadata>\n  <files>\n    <file src=\"binaries\\SonarAnalyzer.VisualBasic\\*.dll\" target=\"analyzers\" />\n    <file src=\"tools-vbnet\\*.ps1\" target=\"tools\\\" />\n    <file src=\"logos\\sonarsource_64.png\" target=\"images\\\" />\n    <file src=\"licenses\\THIRD_PARTY_LICENSES\\*\" target=\"licenses\\THIRD_PARTY_LICENSES\\\" />\n    <file src=\"..\\..\\LICENSE.txt\" target=\"licenses\\\" />\n  </files>\n</package>\n"
  },
  {
    "path": "analyzers/packaging/tools-cs/install.ps1",
    "content": "﻿param($installPath, $toolsPath, $package, $project)\n\n$invalidVsVersion = $false\n\nif ([Version]$project.DTE.Version -lt [Version]\"14.0\") {\n    $invalidVsVersion = $true\n}\n\nif ($project.DTE.Version -eq '14.0') {\n    $currentAppDomainBaseDir = [System.AppDomain]::CurrentDomain.BaseDirectory\n    $path = Join-Path $currentAppDomainBaseDir \"msenv.dll\"\n\n    if (Test-Path $path) {\n        $versionInfo = (Get-Item $path).VersionInfo\n        $fullVersion =  New-Object System.Version -ArgumentList @(\n            $versionInfo.FileMajorPart\n            $versionInfo.FileMinorPart\n            $versionInfo.FileBuildPart\n            $versionInfo.FilePrivatePart\n        )\n        $minVersion = [version]\"14.0.25420.00\"\n        if ($fullVersion -lt $minVersion) {\n            $invalidVsVersion = $true\n        }\n    } else {\n        $invalidVsVersion = $true\n    }\n}\n\nif ($invalidVsVersion) {\n    throw 'This package can only be installed on Visual Studio 2015 Update 3 or later.'\n}\n\nif ($project.Object.AnalyzerReferences -eq $null) {\n    throw 'This package cannot be installed without an analyzer reference.'\n}\n\nif ($project.Type -ne \"C#\") {\n    throw 'This package can only be installed on C# projects.'\n}\n\n$analyzersPath = Split-Path -Path $toolsPath -Parent\n$analyzersPath = Join-Path $analyzersPath \"analyzers\"\n\n$analyzerFilePath = Join-Path $analyzersPath \"SonarAnalyzer.CSharp.dll\"\n$project.Object.AnalyzerReferences.Add($analyzerFilePath)\n\n"
  },
  {
    "path": "analyzers/packaging/tools-cs/uninstall.ps1",
    "content": "﻿param($installPath, $toolsPath, $package, $project)\n\nif ($project.Type -ne \"C#\") {\n    return\n}\n\nif ([Version]$project.DTE.Version -lt [Version]\"14.0\") {\n    return\n}\n\nif ($project.Object.AnalyzerReferences -eq $null) {\n    return\n}\n\n$analyzersPath = Split-Path -Path $toolsPath -Parent\n$analyzersPath = Join-Path $analyzersPath \"analyzers\"\n\n$analyzerFilePath = Join-Path $analyzersPath \"SonarAnalyzer.CSharp.dll\"\ntry {\n    $project.Object.AnalyzerReferences.Remove($analyzerFilePath)\n}\ncatch {\n}\n\n\n"
  },
  {
    "path": "analyzers/packaging/tools-vbnet/install.ps1",
    "content": "﻿param($installPath, $toolsPath, $package, $project)\n\n$invalidVsVersion = $false\n\nif ([Version]$project.DTE.Version -lt [Version]\"14.0\") {\n    $invalidVsVersion = $true\n}\n\nif ($project.DTE.Version -eq '14.0') {\n    $currentAppDomainBaseDir = [System.AppDomain]::CurrentDomain.BaseDirectory\n    $path = Join-Path $currentAppDomainBaseDir \"msenv.dll\"\n\n    if (Test-Path $path) {\n        $versionInfo = (Get-Item $path).VersionInfo\n        $fullVersion =  New-Object System.Version -ArgumentList @(\n            $versionInfo.FileMajorPart\n            $versionInfo.FileMinorPart\n            $versionInfo.FileBuildPart\n            $versionInfo.FilePrivatePart\n        )\n        $minVersion = [version]\"14.0.25420.00\"\n        if ($fullVersion -lt $minVersion) {\n            $invalidVsVersion = $true\n        }\n    } else {\n        $invalidVsVersion = $true\n    }\n}\n\nif ($invalidVsVersion) {\n    throw 'This package can only be installed on Visual Studio 2015 Update 3 or later.'\n}\n\nif ($project.Object.AnalyzerReferences -eq $null) {\n    throw 'This package cannot be installed without an analyzer reference.'\n}\n\nif ($project.Type -ne \"VB.NET\") {\n    throw 'This package can only be installed on VB.NET projects.'\n}\n\n$analyzersPath = Split-Path -Path $toolsPath -Parent\n$analyzersPath = Join-Path $analyzersPath \"analyzers\"\n\n$analyzerFilePath = Join-Path $analyzersPath \"SonarAnalyzer.VisualBasic.dll\"\n$project.Object.AnalyzerReferences.Add($analyzerFilePath)\n"
  },
  {
    "path": "analyzers/packaging/tools-vbnet/uninstall.ps1",
    "content": "﻿param($installPath, $toolsPath, $package, $project)\n\nif ($project.Type -ne \"VB.NET\") {\n    return\n}\n\nif ([Version]$project.DTE.Version -lt [Version]\"14.0\") {\n    return\n}\n\nif ($project.Object.AnalyzerReferences -eq $null) {\n    return\n}\n\n$analyzersPath = Split-Path -Path $toolsPath -Parent\n$analyzersPath = Join-Path $analyzersPath \"analyzers\"\n\n$analyzerFilePath = Join-Path $analyzersPath \"SonarAnalyzer.VisualBasic.dll\"\ntry {\n    $project.Object.AnalyzerReferences.Remove($analyzerFilePath)\n}\ncatch {\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S100.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Shared naming conventions allow teams to collaborate efficiently.</p>\n<p>This rule raises an issue when a method or a property name is not PascalCased.</p>\n<p>For example, the method</p>\n<pre>\npublic int doSomething() {...} // Noncompliant\n</pre>\n<p>should be renamed to</p>\n<pre>\npublic int DoSomething() {...}\n</pre>\n<h3>Exceptions</h3>\n<ul>\n  <li>The rule ignores members in types marked with <code>ComImportAttribute</code> or <code>InterfaceTypeAttribute</code>.</li>\n  <li>The rule ignores <code>extern</code> methods.</li>\n  <li>To reduce noise, two consecutive upper-case characters are allowed unless they form the full name. So, <code>MyXMethod</code> is compliant, but\n  <code>XM</code> is not.</li>\n  <li>The camel casing is not enforced when a name contains the <code>'_'</code> character.</li>\n</ul>\n<pre>\nvoid My_method_(){...} // Noncompliant, leading and trailing underscores are reported\n\nvoid My_method(){...} // Compliant by exception\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<p><a href=\"https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/capitalization-conventions\">Microsoft Capitalization\nConventions</a></p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S100.json",
    "content": "{\n  \"title\": \"Methods and properties should be named in PascalCase\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-100\",\n  \"sqKey\": \"S100\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1006.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/named-and-optional-arguments#optional-arguments\">Default\narguments</a> are determined by the static type of the object.</p>\n<pre>\nclass Base\n{\n    public virtual void Run(int distance = 42) { /* ... */ }\n}\n\nclass Derived : Base\n{\n    public override void Run(int distance = 5) { /* ... */ }\n}\n\nBase x = new Base();\nx.Run(); // Here the default value of distance is 42\nDerived d = new Derived();\nd.Run(); // Here the default value of distance is 5\nBase b = new Derived();\nb.Run(); // Here the default value of distance is 42, not 5\n</pre>\n<p>If a default argument is different for a parameter in an overriding method, the value used in the call will be different when calls are made via\nthe base or derived object, which may be contrary to developer expectations.</p>\n<p>Default parameter values in <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/interfaces/explicit-interface-implementation\">explicit interface\nimplementations</a> will be never used, because the static type of the object will always be the implemented interface. Thus, specifying default\nvalues in this case is confusing.</p>\n<pre>\ninterface IRunner\n{\n    void Run(int distance = 42) { /* ... */ }\n}\n\nclass Runner : IRunner\n{\n    void IRunner.Run(int distance = 5) { /* ... */ }\n}\n\nIRunner x = new Runner();\nx.Run(); // Here the default value of distance is 42\nRunner d = new Runner();\nd.Run(); // This will not compile as the Run method is only visible through the specified interface\n</pre>\n<h3>Noncompliant code example</h3>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nusing System;\n\npublic class Base\n{\n    public virtual void Write(int i = 42)\n    {\n        Console.WriteLine(i);\n    }\n}\n\npublic class Derived : Base\n{\n    public override void Write(int i = 5) // Noncompliant\n    {\n        Console.WriteLine(i);\n    }\n}\n\npublic class Program\n{\n    public static void Main()\n    {\n        var derived = new Derived();\n        derived.Write(); // writes 5\n        Print(derived); // writes 42; was that expected?\n    }\n\n    private static void Print(Base item)\n    {\n        item.Write();\n    }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nusing System;\n\npublic class Base\n{\n    public virtual void Write(int i = 42)\n    {\n        Console.WriteLine(i);\n    }\n}\n\npublic class Derived : Base\n{\n    public override void Write(int i = 42)\n    {\n        Console.WriteLine(i);\n    }\n}\n\npublic class Program\n{\n    public static void Main()\n    {\n        var derived = new Derived();\n        derived.Write(); // writes 42\n        Print(derived);  // writes 42\n    }\n\n    private static void Print(Base item)\n    {\n        item.Write();\n    }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/named-and-optional-arguments#optional-arguments\">Optional arguments</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/interfaces/explicit-interface-implementation\">Explicit Interface\n  Implementation</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1006.json",
    "content": "{\n  \"title\": \"Method overrides should not change parameter defaults\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-1006\",\n  \"sqKey\": \"S1006\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S101.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Shared naming conventions allow teams to collaborate efficiently.</p>\n<p>This rule raises an issue when a type name is not PascalCased.</p>\n<p>For example, the classes</p>\n<pre>\nclass my_class {...}\nclass SOMEName42 {...}\n</pre>\n<p>should be renamed to</p>\n<pre>\nclass MyClass {...}\nclass SomeName42 {...}\n</pre>\n<h3>Exceptions</h3>\n<ul>\n  <li>The rule ignores types marked with <code>ComImportAttribute</code> or <code>InterfaceTypeAttribute</code>.</li>\n  <li>To reduce noise, two consecutive upper case characters are allowed unless they form the full type name. So, <code>MyXClass</code> is compliant,\n  but <code>XC</code> is not.</li>\n  <li>The rule allows having <code>'_'</code> characters in class names inside test projects: in that case, each word separated by <code>'_'</code>\n  should be PascalCased.</li>\n</ul>\n<pre>\nclass Some_Name___42 {...} // Compliant in tests\nclass Some_name___42 {...} // Noncompliant\nclass Some_Name_XC {...} // Noncompliant because of XC, should be Some_Name_Xc\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/capitalization-conventions\">Microsoft Capitalization\n  Conventions</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S101.json",
    "content": "{\n  \"title\": \"Types should be named in PascalCase\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-101\",\n  \"sqKey\": \"S101\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S103.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Scrolling horizontally to see a full line of code lowers the code readability.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S103.json",
    "content": "{\n  \"title\": \"Lines should not be too long\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"FORMATTED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-103\",\n  \"sqKey\": \"S103\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S104.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When a source file grows too much, it can accumulate numerous responsibilities and become challenging to understand and maintain.</p>\n<p>Above a specific threshold, refactor the file into smaller files whose code focuses on well-defined tasks. Those smaller files will be easier to\nunderstand and test.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S104.json",
    "content": "{\n  \"title\": \"Files should not have too many lines of code\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"FOCUSED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1h\"\n  },\n  \"tags\": [\n    \"brain-overload\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-104\",\n  \"sqKey\": \"S104\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1048.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/finalizers\">finalizers</a> are used to perform\n<a href=\"https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/fundamentals#unmanaged-resources\">any necessary final clean-up</a> when\nthe garbage collector is collecting a class instance. The programmer has no control over when the finalizer is called; the garbage collector decides\nwhen to call it.</p>\n<p>When creating a finalizer, it should never throw an exception, as there is a high risk of having the application terminated leaving unmanaged\nresources without a graceful cleanup.</p>\n<p>The rule raises an issue on <code>throw</code> statements used in a finalizer.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nclass MyClass\n{\n    ~MyClass()\n    {\n        throw new NotImplementedException(); // Noncompliant: finalizer throws an exception\n    }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nclass MyClass\n{\n    ~MyClass()\n    {\n        // Compliant: finalizer does not throw an exception\n    }\n}\n</pre>\n<h3>Going the extra mile</h3>\n<p>In general object finalization can be a complex and error-prone operation and should not be implemented except within the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/implementing-dispose\">dispose pattern</a>.</p>\n<p>When <a href=\"https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/unmanaged\">cleaning up unmanaged resources</a>, it is\nrecommended to implement the dispose pattern or, to cover uncalled <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.idisposable.dispose\"><code>Dispose</code></a> method by the consumer, implement <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.safehandle\"><code>SafeHandle</code></a>.</p>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/fundamentals\">Fundamentals of garbage\n  collection</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/unmanaged\">Cleaning up unmanaged\n  resources</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/implementing-dispose\">Implement a Dispose\n  method</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.safehandle\"><code>SafeHandle</code>\n  Class</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.idisposable.dispose\"><code>IDisposable.Dispose</code>\n  Method</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/finalizers\">Finalizers\n  (destructors)</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1048.json",
    "content": "{\n  \"title\": \"Finalizers should not throw exceptions\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-1048\",\n  \"sqKey\": \"S1048\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S105.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The tab width can differ from one development environment to another. Using tabs may require other developers to configure their environment (text\neditor, preferences, etc.) to read source code.</p>\n<p>That is why using spaces is preferable.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S105.json",
    "content": "{\n  \"title\": \"Tabulation characters should not be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"FORMATTED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-105\",\n  \"sqKey\": \"S105\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S106.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>In software development, logs serve as a record of events within an application, providing crucial insights for debugging. When logging, it is\nessential to ensure that the logs are:</p>\n<ul>\n  <li>easily accessible</li>\n  <li>uniformly formatted for readability</li>\n  <li>properly recorded</li>\n  <li>securely logged when dealing with sensitive data</li>\n</ul>\n<p>Those requirements are not met if a program directly writes to the standard outputs (e.g., Console). That is why defining and using a dedicated\nlogger is highly recommended.</p>\n<h3>Exceptions</h3>\n<p>The rule doesn’t raise an issue for:</p>\n<ul>\n  <li>Console Applications</li>\n  <li>Calls in methods decorated with <code>[Conditional (\"DEBUG\")]</code></li>\n  <li>Calls included in DEBUG preprocessor branches (<code>#if DEBUG</code>)</li>\n</ul>\n<h3>Code examples</h3>\n<p>The following noncompliant code:</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic class MyClass\n{\n    private void DoSomething()\n    {\n        // ...\n        Console.WriteLine(\"My Message\"); // Noncompliant\n        // ...\n    }\n}\n</pre>\n<p>Could be replaced by:</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic class MyClass\n{\n    private readonly ILogger _logger;\n\n    // ...\n\n    private void DoSomething()\n    {\n        // ...\n        _logger.LogInformation(\"My Message\");\n        // ...\n    }\n}\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A09_2021-Security_Logging_and_Monitoring_Failures/\">Top 10 2021 Category A9 - Security Logging and\n  Monitoring Failures</a></li>\n  <li>OWASP - <a href=\"https://www.owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure\">Top 10 2017 Category A3 - Sensitive Data\n  Exposure</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S106.json",
    "content": "{\n  \"title\": \"Standard outputs should not be used directly to log anything\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"MODULAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"bad-practice\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-106\",\n  \"sqKey\": \"S106\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"OWASP\": [\n      \"A3\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A9\"\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1066.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Nested code - blocks of code inside blocks of code - is eventually necessary, but increases complexity. This is why keeping the code as flat as\npossible, by avoiding unnecessary nesting, is considered a good practice.</p>\n<p>Merging <code>if</code> statements when possible will decrease the nesting of the code and improve its readability.</p>\n<p>Code like</p>\n<pre>\nif (condition1)\n{\n    if (condition2)           // Noncompliant\n    {\n        // ...\n    }\n}\n</pre>\n<p>Will be more readable as</p>\n<pre>\nif (condition1 &amp;&amp; condition2) // Compliant\n{\n    // ...\n}\n</pre>\n<h2>How to fix it</h2>\n<p>If merging the conditions seems to result in a more complex code, extracting the condition or part of it in a named function or variable is a\nbetter approach to fix readability.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre>\nif (file != null)\n{\n  if (file.isFile() || file.isDirectory())    // Noncompliant\n  {\n    /* ... */\n  }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre>\nbool isFileOrDirectory(File file)\n{\n  return file.isFile() || file.isDirectory();\n}\n\n/* ... */\n\nif (file != null &amp;&amp; isFileOrDirectory(file))  // Compliant\n{\n  /* ... */\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1066.json",
    "content": "{\n  \"title\": \"Mergeable \\\"if\\\" statements should be combined\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1066\",\n  \"sqKey\": \"S1066\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1067.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The complexity of an expression is defined by the number of <code>&amp;&amp;</code>, <code>||</code> and <code>condition ? ifTrue : ifFalse</code>\noperators it contains.</p>\n<p>A single expression’s complexity should not become too high to keep the code readable.</p>\n<h3>Noncompliant code example</h3>\n<p>With the default threshold value of 3</p>\n<pre>\nif (((condition1 &amp;&amp; condition2) || (condition3 &amp;&amp; condition4)) &amp;&amp; condition5) { ... }\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nif ((MyFirstCondition() || MySecondCondition()) &amp;&amp; MyLastCondition()) { ... }\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1067.json",
    "content": "{\n  \"title\": \"Expressions should not be too complex\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"FOCUSED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"3min\"\n  },\n  \"tags\": [\n    \"brain-overload\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-1067\",\n  \"sqKey\": \"S1067\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S107.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Methods with a long parameter list are difficult to use because maintainers must figure out the role of each parameter and keep track of their\nposition.</p>\n<pre>\nvoid SetCoordinates(int x1, int y1, int z1, int x2, int y2, int z2) // Noncompliant\n{\n   // ...\n}\n</pre>\n<p>The solution can be to:</p>\n<ul>\n  <li>Split the method into smaller ones</li>\n</ul>\n<pre>\n// Each function does a part of what the original setCoordinates function was doing, so confusion risks are lower\nvoid SetOrigin(int x, int y, int z)\n{\n   // ...\n}\n\nvoid SetSize(int width, int height, int depth)\n{\n   //\n}\n</pre>\n<ul>\n  <li>Find a better data structure for the parameters that group data in a way that makes sense for the specific application domain</li>\n</ul>\n<pre>\n// In geometry, Point is a logical structure to group data\nreadonly record struct Point(int X, int Y, int Z);\n\nvoid SetCoordinates(Point p1, Point p2)\n{\n    // ...\n}\n</pre>\n<p>This rule raises an issue when a method has more parameters than the provided threshold.</p>\n<h3>Exceptions</h3>\n<p>The rule does not count the parameters intended for a base class constructor.</p>\n<p>With a maximum number of 4 parameters:</p>\n<pre>\npublic class BaseClass\n{\n    public BaseClass(int param1)\n    {\n        // ...\n    }\n}\n\npublic class DerivedClass : BaseClass\n{\n    public DerivedClass(int param1, int param2, int param3, string param4, long param5) : base(param1) // Compliant by exception\n    {\n        // ...\n    }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S107.json",
    "content": "{\n  \"title\": \"Methods should not have too many parameters\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"FOCUSED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"brain-overload\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-107\",\n  \"sqKey\": \"S107\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1075.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Hard-coding a URI makes it difficult to test a program for a variety of reasons:</p>\n<ul>\n  <li>path literals are not always portable across operating systems</li>\n  <li>a given absolute path may not exist in a specific test environment</li>\n  <li>a specified Internet URL may not be available when executing the tests</li>\n  <li>production environment filesystems usually differ from the development environment</li>\n</ul>\n<p>In addition, hard-coded URIs can contain sensitive information, like IP addresses, and they should not be stored in the code.</p>\n<p>For all those reasons, a URI should never be hard coded. Instead, it should be replaced by a customizable parameter.</p>\n<p>Further, even if the elements of a URI are obtained dynamically, portability can still be limited if the path delimiters are hard-coded.</p>\n<p>This rule raises an issue when URIs or path delimiters are hard-coded.</p>\n<h3>Exceptions</h3>\n<p>This rule does not raise an issue when an ASP.NET virtual path is passed as an argument to one of the following:</p>\n<ul>\n  <li>methods: <code>System.Web.HttpServerUtilityBase.MapPath()</code>, <code>System.Web.HttpRequestBase.MapPath()</code>,\n  <code>System.Web.HttpResponseBase.ApplyAppPathModifier()</code>, <code>System.Web.Mvc.UrlHelper.Content()</code></li>\n  <li>all methods of: <code>System.Web.VirtualPathUtility</code></li>\n  <li>constructors of: <code>Microsoft.AspNetCore.Mvc.VirtualFileResult</code>, <code>Microsoft.AspNetCore.Routing.VirtualPathData</code></li>\n</ul>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic class Foo {\n  public List&lt;User&gt; ListUsers() {\n    string userListPath = \"/home/mylogin/Dev/users.txt\"; // Noncompliant\n    return ParseUsers(userListPath);\n  }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic class Foo {\n  // Configuration is a class that returns customizable properties: it can be mocked to be injected during tests.\n  private Configuration config;\n  public Foo(Configuration myConfig) {\n    this.config = myConfig;\n  }\n  public List&lt;User&gt; ListUsers() {\n    // Find here the way to get the correct folder, in this case using the Configuration object\n    string listingFolder = config.GetProperty(\"myApplication.listingFolder\");\n    // and use this parameter instead of the hard coded path\n    string userListPath = Path.Combine(listingFolder, \"users.txt\"); // Compliant\n    return ParseUsers(userListPath);\n  }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1075.json",
    "content": "{\n  \"title\": \"URIs should not be hardcoded\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1075\",\n  \"sqKey\": \"S1075\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S108.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>An empty code block is confusing. It will require some effort from maintainers to determine if it is intentional or indicates the implementation is\nincomplete.</p>\n<pre>\nfor (int i = 0; i &lt; 42; i++){}  // Noncompliant: is the block empty on purpose, or is code missing?\n</pre>\n<p>Removing or filling the empty code blocks takes away ambiguity and generally results in a more straightforward and less surprising code.</p>\n<h3>Exceptions</h3>\n<p>The rule ignores code blocks that contain comments.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S108.json",
    "content": "{\n  \"title\": \"Nested blocks of code should not be left empty\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-108\",\n  \"sqKey\": \"S108\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S109.html",
    "content": "<p>A magic number is a hard-coded numerical value that may lack context or meaning. They should not be used because they can make the code less\nreadable and maintainable.</p>\n<h2>Why is this an issue?</h2>\n<p>Magic numbers make the code more complex to understand as it requires the reader to have knowledge about the global context to understand the\nnumber itself. Their usage may seem obvious when writing the code, but it may not be the case for another developer or later once the context faded\naway. -1, 0, and 1 are not considered magic numbers.</p>\n<h3>Exceptions</h3>\n<p>This rule doesn’t raise an issue when the magic number is used as part of:</p>\n<ul>\n  <li>the <code>GetHashCode</code> method</li>\n  <li>a variable/field declaration</li>\n  <li>the single argument of an attribute</li>\n  <li>a named argument for a method or attribute</li>\n  <li>a constructor call</li>\n  <li>a default value for a method argument</li>\n</ul>\n<h2>How to fix it</h2>\n<p>Replacing them with a constant allows us to provide a meaningful name associated with the value. Instead of adding complexity to the code, it\nbrings clarity and helps to understand the context and the global meaning.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic void DoSomething()\n{\n    for (int i = 0; i &lt; 4; i++)  // Noncompliant, 4 is a magic number\n    {\n        ...\n    }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nprivate const int NUMBER_OF_CYCLES = 4;\n\npublic void DoSomething()\n{\n    for (int i = 0; i &lt; NUMBER_OF_CYCLES; i++)  // Compliant\n    {\n        ...\n    }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S109.json",
    "content": "{\n  \"title\": \"Magic numbers should not be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"brain-overload\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-109\",\n  \"sqKey\": \"S109\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S110.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Inheritance is one of the most valuable concepts in object-oriented programming. It’s a way to categorize and reuse code by creating collections of\nattributes and behaviors called classes, which can be based on previously created classes.</p>\n<p>But abusing this concept by creating a deep inheritance tree can lead to complex and unmaintainable source code. Often, an inheritance tree\nbecoming too deep is the symptom of systematic use of \"inheritance\" when other approaches like \"composition\" would be better suited.</p>\n<p>This rule raises an issue when the inheritance tree, starting from <code>Object</code>, has a greater depth than is allowed.</p>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<p><a href=\"https://en.wikipedia.org/wiki/Composition_over_inheritance\">Composition over inheritance: difference between composition and inheritance\nin object-oriented programming</a></p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S110.json",
    "content": "{\n  \"title\": \"Inheritance tree of classes should not be too deep\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"FOCUSED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Linear with offset\",\n    \"linearDesc\": \"Number of parents above the defined threshold\",\n    \"linearOffset\": \"4h\",\n    \"linearFactor\": \"30min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-110\",\n  \"sqKey\": \"S110\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1104.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Public fields in public classes do not respect the encapsulation principle and have three main disadvantages:</p>\n<ul>\n  <li>Additional behavior such as validation cannot be added.</li>\n  <li>The internal representation is exposed, and cannot be changed afterwards.</li>\n  <li>Member values are subject to change from anywhere in the code and may not meet the programmer’s assumptions.</li>\n</ul>\n<p>To prevent unauthorized modifications, private attributes and accessor methods (set and get) should be used.</p>\n<p>Note that due to optimizations on simple properties, public fields provide only very little performance gain.</p>\n<h3>What is the potential impact?</h3>\n<p>Public fields can be modified by any part of the code and this can lead to unexpected changes and hard-to-trace bugs.</p>\n<p>Public fields don’t hide the implementation details. As a consequence, it is no longer possible to change how the data is stored internally without\nimpacting the client code of the class.</p>\n<p>The code is harder to maintain.</p>\n<h3>Exceptions</h3>\n<p>Fields marked as <code>readonly</code> or <code>const</code> are ignored by this rule.</p>\n<p>Fields inside classes or structs annotated with <code>[StructLayout]</code> are ignored by this rule.</p>\n<p>Fields inside classes or structs annotated with <code>[Serializable]</code> are ignored by this rule unless they are annotated with\n<code>[NonSerialized]</code>.</p>\n<h2>How to fix it</h2>\n<p>Depending on your needs:</p>\n<ul>\n  <li>Use auto-implemented properties:\n    <br>\n    For common cases, where no validation is required, auto-implemented properties are a good alternative to fields: these allows fine grained access\n    control and offers the flexibility to add validation or change internal storage afterwards. <em>Note:</em> as a bonus it is now possible to\n    monitor value changes using breakpoints.</li>\n  <li>Encapsulate the fields in your class. To do so:\n    <ol>\n      <li>Make the field private.</li>\n      <li>Use public properties (set and get) to access and modify the field.</li>\n    </ol></li>\n  <li>Mark field as <code>readonly</code> or <code>const</code>.</li>\n</ul>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic class Foo\n{\n    public int InstanceData = 32; // Noncompliant\n    public int AnotherInstanceData = 32; // Noncompliant\n\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic class Foo\n{\n    // using auto-implemented properties\n    public int InstanceData { get; set; } = 32;\n\n    // using field encapsulation\n    private int _anotherInstanceData = 32;\n\n    public int AnotherInstanceData\n    {\n        get { return _anotherInstanceData; }\n        set\n        {\n            // perform validation\n            _anotherInstanceData = value;\n        }\n    }\n\n}\n</pre>\n<h3>Pitfalls</h3>\n<p>Please be aware that changing a field by a property in a software that uses serialization could lead to binary incompatibility.</p>\n<h2>Resources</h2>\n<ul>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/493\">CWE-493 - Critical Public Variable Without Final Modifier</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1104.json",
    "content": "{\n  \"title\": \"Fields should not have public accessibility\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"MODULAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1104\",\n  \"sqKey\": \"S1104\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      493\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1109.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Shared coding conventions make it possible for a team to efficiently collaborate. This rule makes it mandatory to place a close curly brace at the\nbeginning of a line.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nif(condition)\n{\n  doSomething();}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nif(condition)\n{\n  doSomething();\n}\n</pre>\n<h3>Exceptions</h3>\n<p>When blocks are inlined (open and close curly braces on the same line), no issue is triggered.</p>\n<pre>\nif(condition) {doSomething();}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1109.json",
    "content": "{\n  \"title\": \"A close curly brace should be located at the beginning of a line\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"FORMATTED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1109\",\n  \"sqKey\": \"S1109\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1110.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Parentheses can disambiguate the order of operations in complex expressions and make the code easier to understand.</p>\n<pre>\na = (b * c) + (d * e); // Compliant: the intent is clear.\n</pre>\n<p>Redundant parentheses are parenthesis that do not change the behavior of the code, and do not clarify the intent. They can mislead and complexify\nthe code. They should be removed.</p>\n<h3>Noncompliant code example</h3>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nint x = ((y / 2 + 1)); // Noncompliant\n\nif (a &amp;&amp; ((x + y &gt; 0))) { // Noncompliant\n  return ((x + 1)); // Noncompliant\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nint x = (y / 2 + 1);\n\nif (a &amp;&amp; (x + y &gt; 0)) {\n  return (x + 1);\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1110.json",
    "content": "{\n  \"title\": \"Redundant pairs of parentheses should be removed\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1min\"\n  },\n  \"tags\": [\n    \"confusing\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1110\",\n  \"sqKey\": \"S1110\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1116.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Empty statements represented by a semicolon <code>;</code> are statements that do not perform any operation. They are often the result of a typo or\na misunderstanding of the language syntax. It is a good practice to remove empty statements since they don’t add value and lead to confusion and\nerrors.</p>\n<h3>Exceptions</h3>\n<p>This rule does not raise when an empty statement is the only statement in a loop.</p>\n<pre>\nfor (int i = 0; i &lt; 3; Console.WriteLine(i), i++);\n</pre>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nvoid DoSomething()\n{\n    ; // Noncompliant - was used as a kind of TODO marker\n}\n\nvoid DoSomethingElse()\n{\n    Console.WriteLine(\"Hello, world!\");;  // Noncompliant - double ;\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nvoid DoSomething()\n{\n}\n\nvoid DoSomethingElse()\n{\n    Console.WriteLine(\"Hello, world!\");\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1116.json",
    "content": "{\n  \"title\": \"Empty statements should be removed\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"unused\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1116\",\n  \"sqKey\": \"S1116\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1117.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Shadowing occurs when a local variable has the same name as a variable, field, or property in an outer scope.</p>\n<p>This can lead to three main problems:</p>\n<ul>\n  <li>Confusion: The same name can refer to different variables in different parts of the scope, making the code hard to read and understand.</li>\n  <li>Unintended Behavior: You might accidentally use the wrong variable, leading to hard-to-detect bugs.</li>\n  <li>Maintenance Issues: If the inner variable is removed or renamed, the code’s behavior might change unexpectedly because the outer variable is now\n  being used.</li>\n</ul>\n<p>To avoid these problems, rename the shadowing, shadowed, or both variables/fields/properties to accurately represent their purpose with unique and\nmeaningful names. It improves clarity and allows reasoning locally about the code without considering other software parts.</p>\n<p>This rule focuses on variables shadowing fields or properties.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nclass Foo\n{\n  public int myField;\n  public int MyProperty { get; set; }\n\n  public void DoSomething()\n  {\n    int myField = 0;    // Noncompliant\n    int MyProperty = 0; // Noncompliant\n  }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/fields\">Fields</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/properties\">Properties</a></li>\n</ul>\n<h3>Related rules</h3>\n<ul>\n  <li>{rule:csharpsquid:S2387} - Child class fields should not shadow parent class fields</li>\n  <li>{rule:csharpsquid:S3218} - Inner class members should not shadow outer class \"static\" or type members</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1117.json",
    "content": "{\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"suspicious\",\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1117\",\n  \"sqKey\": \"S1117\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\",\n  \"title\": \"Local variables should not shadow class fields or properties\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1118.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Whenever there are portions of code that are duplicated and do not depend on the state of their container class, they can be centralized inside a\n\"utility class\". A utility class is a class that only has static members, hence it should not be instantiated.</p>\n<h2>How to fix it</h2>\n<p>To prevent the class from being instantiated, you should define a non-public constructor. This will prevent the compiler from implicitly generating\na public parameterless constructor.</p>\n<p>Alternatively, adding the <code>static</code> keyword as class modifier will also prevent it from being instantiated.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic class StringUtils // Noncompliant: implicit public constructor\n{\n  public static string Concatenate(string s1, string s2)\n  {\n    return s1 + s2;\n  }\n}\n</pre>\n<p>or</p>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\npublic class StringUtils // Noncompliant: explicit public constructor\n{\n  public StringUtils()\n  {\n  }\n\n  public static string Concatenate(string s1, string s2)\n  {\n    return s1 + s2;\n  }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic static class StringUtils // Compliant: the class is static\n{\n  public static string Concatenate(string s1, string s2)\n  {\n    return s1 + s2;\n  }\n}\n</pre>\n<p>or</p>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\npublic class StringUtils // Compliant: the constructor is not public\n{\n  private StringUtils()\n  {\n  }\n\n  public static string Concatenate(string s1, string s2)\n  {\n    return s1 + s2;\n  }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1118.json",
    "content": "{\n  \"title\": \"Utility classes should not have public constructors\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"design\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1118\",\n  \"sqKey\": \"S1118\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S112.html",
    "content": "<p>This rule raises an issue when a general or reserved exception is thrown.</p>\n<h2>Why is this an issue?</h2>\n<p>Throwing general exceptions such as <code>Exception</code>, <code>SystemException</code> and <code>ApplicationException</code> will have a negative\nimpact on any code trying to catch these exceptions.</p>\n<p>From a consumer perspective, it is generally a best practice to only catch exceptions you intend to handle. Other exceptions should ideally be let\nto propagate up the stack trace so that they can be dealt with appropriately. When a general exception is thrown, it forces consumers to catch\nexceptions they do not intend to handle, which they then have to re-throw.</p>\n<p>Besides, when working with a general type of exception, the only way to distinguish between multiple exceptions is to check their message, which is\nerror-prone and difficult to maintain. Legitimate exceptions may be unintentionally silenced and errors may be hidden.</p>\n<p>For instance, if an exception such as <code>StackOverflowException</code> is caught and not re-thrown, it may prevent the program from terminating\ngracefully.</p>\n<p>When throwing an exception, it is therefore recommended to throw the most specific exception possible so that it can be handled intentionally by\nconsumers.</p>\n<p>Additionally, some reserved exceptions should not be thrown manually. Exceptions such as <code>IndexOutOfRangeException</code>,\n<code>NullReferenceException</code>, <code>OutOfMemoryException</code> or <code>ExecutionEngineException</code> will be thrown automatically by the\nruntime when the corresponding error occurs. Many of them indicate serious errors, which the application may not be able to recover from. It is\ntherefore recommended to avoid throwing them as well as using them as base classes.</p>\n<h2>How to fix it</h2>\n<p>To fix this issue, make sure to throw specific exceptions that are relevant to the context in which they arise. It is recommended to either:</p>\n<ul>\n  <li>Throw a subtype of <code>Exception</code> when one matches. For instance <code>ArgumentException</code> could be raised when an unexpected\n  argument is provided to a function.</li>\n  <li>Define a custom exception type that derives from <code>Exception</code> or one of its subclasses.</li>\n</ul>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic void DoSomething(object obj)\n{\n  if (obj == null)\n  {\n    throw new NullReferenceException(\"obj\");  // Noncompliant: This reserved exception should not be thrown manually\n  }\n  // ...\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic void DoSomething(object obj)\n{\n  if (obj == null)\n  {\n    throw new ArgumentNullException(\"obj\");  // Compliant: this is a specific and non-reserved exception type\n  }\n  // ...\n}\n</pre>\n<h2>Resources</h2>\n<h3>Standards</h3>\n<ul>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/397\">CWE-397 Declaration of Throws for Generic Exception</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S112.json",
    "content": "{\n  \"title\": \"General or reserved exceptions should never be thrown\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"error-handling\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-112\",\n  \"sqKey\": \"S112\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      397\n    ]\n  },\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1121.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>A common code smell that can hinder the clarity of source code is making assignments within sub-expressions. This practice involves assigning a\nvalue to a variable inside a larger expression, such as within a loop or a conditional statement.</p>\n<p>This practice essentially gives a side-effect to a larger expression, thus making it less readable. This often leads to confusion and potential\nerrors.</p>\n<h3>Exceptions</h3>\n<p>Assignments inside lambda and delegate expressions are allowed.</p>\n<pre>\nvar result = Foo(() =&gt;\n{\n   int x = 100; // dead store, but ignored\n   x = 200;\n   return x;\n}\n</pre>\n<p>The rule also ignores the following patterns:</p>\n<ul>\n  <li>Chained assignments</li>\n</ul>\n<pre>\nvar a = b = c = 10;\n</pre>\n<ul>\n  <li>Assignments that are part of a condition of an <code>if</code> statement or a loop</li>\n</ul>\n<pre>\nwhile ((val = GetNewValue()) &gt; 0)\n{\n...\n}\n</pre>\n<ul>\n  <li>Assignment in the right-hand side of a coalescing operator</li>\n</ul>\n<pre>\nprivate MyClass instance;\npublic MyClass Instance =&gt; instance ?? (instance = new MyClass());\n</pre>\n<h2>How to fix it</h2>\n<p>Making assignments within sub-expressions can hinder the clarity of source code.</p>\n<p>This practice essentially gives a side-effect to a larger expression, thus making it less readable. This often leads to confusion and potential\nerrors.</p>\n<p>Extracting assignments into separate statements is encouraged to keep the code clear and straightforward.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nif (string.IsNullOrEmpty(result = str.Substring(index, length))) // Noncompliant\n{\n  // do something with \"result\"\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nvar result = str.Substring(index, length);\nif (string.IsNullOrEmpty(result))\n{\n  // do something with \"result\"\n}\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/481\">CWE-481 - Assigning instead of Comparing</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1121.json",
    "content": "{\n  \"title\": \"Assignments should not be made from within sub-expressions\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1121\",\n  \"sqKey\": \"S1121\",\n  \"scope\": \"All\",\n  \"securityStandards\": {\n    \"CWE\": [\n      481\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1123.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The <code>Obsolete</code> attribute can be applied with or without a message argument. Marking something <code>Obsolete</code> without including\nadvice on why it’s obsolete or what to use instead will lead maintainers to waste time trying to figure those things out.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic class Car\n{\n\n  [Obsolete]  // Noncompliant\n  public void CrankEngine(int turnsOfCrank)\n  { ... }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic class Car\n{\n\n  [Obsolete(\"Replaced by the automatic starter\")]\n  public void CrankEngine(int turnsOfCrank)\n  { ... }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1123.json",
    "content": "{\n  \"title\": \"\\\"Obsolete\\\" attributes should include explanations\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"obsolete\",\n    \"bad-practice\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1123\",\n  \"sqKey\": \"S1123\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1125.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>A boolean literal can be represented in two different ways: <code>true</code> or <code>false</code>. They can be combined with logical operators\n(<code>!, &amp;&amp;, ||, ==, !=</code>) to produce logical expressions that represent truth values. However, comparing a boolean literal to a\nvariable or expression that evaluates to a boolean value is unnecessary and can make the code harder to read and understand. The more complex a\nboolean expression is, the harder it will be for developers to understand its meaning and expected behavior, and it will favour the introduction of\nnew bugs.</p>\n<h2>How to fix it</h2>\n<p>Remove redundant boolean literals from expressions to improve readability and make the code more maintainable.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nif (booleanMethod() == true) { /* ... */ }\nif (booleanMethod() == false) { /* ... */ }\nif (booleanMethod() || false) { /* ... */ }\ndoSomething(!false);\ndoSomething(booleanMethod() == true);\n\nbooleanVariable = booleanMethod() ? true : false;\nbooleanVariable = booleanMethod() ? true : exp;\nbooleanVariable = booleanMethod() ? false : exp;\nbooleanVariable = booleanMethod() ? exp : true;\nbooleanVariable = booleanMethod() ? exp : false;\n\nfor (var x = 0; true; x++)\n{\n ...\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nif (booleanMethod()) { /* ... */ }\nif (!booleanMethod()) { /* ... */ }\nif (booleanMethod()) { /* ... */ }\ndoSomething(true);\ndoSomething(booleanMethod());\n\nbooleanVariable = booleanMethod();\nbooleanVariable = booleanMethod() || exp;\nbooleanVariable = !booleanMethod() &amp;&amp; exp;\nbooleanVariable = !booleanMethod() || exp;\nbooleanVariable = booleanMethod() &amp;&amp; exp;\n\nfor (var x = 0; ; x++)\n{\n ...\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1125.json",
    "content": "{\n  \"title\": \"Boolean literals should not be redundant\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1125\",\n  \"sqKey\": \"S1125\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1128.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Unnecessary <code>using</code> directives refer to importing namespaces, types or creating aliases that are not used or referenced anywhere in the\ncode.</p>\n<p>Although they don’t affect the runtime behavior of the application after compilation, removing them will:</p>\n<ul>\n  <li>Improve the readability and maintainability of the code.</li>\n  <li>Help avoid potential naming conflicts.</li>\n  <li>Improve the build time, as the compiler has fewer lines to read and fewer types to resolve.</li>\n  <li>Reduce the number of items the code editor will show for auto-completion, thereby showing fewer irrelevant suggestions.</li>\n</ul>\n<p>Starting with C# 10, it’s possible to define <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/using-directive#global-modifier\">global usings</a> for an entire\nproject. They reduce the need for repetitive namespace inclusions, but can also mask which namespaces are truly necessary for the code at hand.\nOver-relying on them can lead to less transparent code dependencies, especially for newcomers to the project.</p>\n<h3>Exceptions</h3>\n<p>The rule will not raise a warning for <code>global using</code> directives, even if none of the types of that namespace are used in the\nproject:</p>\n<pre>\nglobal using System.Net.Sockets; // Compliant by exception\n</pre>\n<p>Unnecessary <code>using</code> directives are ignored in ASP.NET Core projects in the following files:</p>\n<ul>\n  <li><code>_Imports.razor</code></li>\n  <li><code>_ViewImports.cshtml</code></li>\n</ul>\n<h2>How to fix it</h2>\n<p>While it’s not difficult to remove these unneeded lines manually, modern code editors support the removal of every unnecessary <code>using</code>\ndirective with a single click from every file of the project.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nusing System.IO;\nusing System.Linq;\nusing System.Collections.Generic;   // Noncompliant - no types are used from this namespace\nusing MyApp.Helpers;                // Noncompliant - FileHelper is in the same namespace\nusing MyCustomNamespace;            // Noncompliant - no types are used from this namespace\n\nnamespace MyApp.Helpers\n{\n    public class FileHelper\n    {\n        public static string ReadFirstLine(string filePath) =&gt;\n            File.ReadAllLines(filePath).First();\n    }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nusing System.IO;\nusing System.Linq;\n\nnamespace MyApp.Helpers\n{\n    public class FileHelper\n    {\n        public static string ReadFirstLine(string filePath) =&gt;\n            File.ReadAllLines(filePath).First();\n    }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/using-directive\">MSDN - using directives</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/namespace\">MSDN - namespaces</a></li>\n</ul>\n<h3>Related rules</h3>\n<ul>\n  <li>{rule:csharpsquid:S1144} - Unused private types or members should be removed</li>\n  <li>{rule:csharpsquid:S1481} - Unused local variables should be removed</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1128.json",
    "content": "{\n  \"title\": \"Unnecessary \\\"using\\\" should be removed\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1min\"\n  },\n  \"tags\": [\n    \"unused\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1128\",\n  \"sqKey\": \"S1128\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S113.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Some tools work better when files end with an empty line.</p>\n<p>This rule simply generates an issue if it is missing.</p>\n<p>For example, a Git diff looks like this if the empty line is missing at the end of the file:</p>\n<pre>\n+class Test\n+{\n+}\n\\ No newline at end of file\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S113.json",
    "content": "{\n  \"title\": \"Files should end with a newline\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-113\",\n  \"sqKey\": \"S113\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1133.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>This rule is meant to be used as a way to track code which is marked as being deprecated. Deprecated code should eventually be removed.</p>\n<h3>Noncompliant code example</h3>\n<pre>\n[Obsolete] // Noncompliant\nvoid Method()\n{\n    // ..\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1133.json",
    "content": "{\n  \"title\": \"Deprecated code should be removed\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"INFO\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"obsolete\"\n  ],\n  \"defaultSeverity\": \"Info\",\n  \"ruleSpecification\": \"RSPEC-1133\",\n  \"sqKey\": \"S1133\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1134.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><code>FIXME</code> tags are commonly used to mark places where a bug is suspected, but which the developer wants to deal with later.</p>\n<p>Sometimes the developer will not have the time or will simply forget to get back to that tag.</p>\n<p>This rule is meant to track those tags and to ensure that they do not go unnoticed.</p>\n<pre>\nprivate int Divide(int numerator, int denominator)\n{\n    return numerator / denominator; // FIXME denominator value might be 0\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/546\">CWE-546 - Suspicious Comment</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1134.json",
    "content": "{\n  \"title\": \"Track uses of \\\"FIXME\\\" tags\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"0min\"\n  },\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1134\",\n  \"sqKey\": \"S1134\",\n  \"scope\": \"All\",\n  \"securityStandards\": {\n    \"CWE\": [\n      546\n    ]\n  },\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1135.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Developers often use <code>TODO</code> tags to mark areas in the code where additional work or improvements are needed but are not implemented\nimmediately. However, these <code>TODO</code> tags sometimes get overlooked or forgotten, leading to incomplete or unfinished code. This rule aims to\nidentify and address unattended <code>TODO</code> tags to ensure a clean and maintainable codebase. This description explores why this is a problem\nand how it can be fixed to improve the overall code quality.</p>\n<h3>What is the potential impact?</h3>\n<p>Unattended <code>TODO</code> tags in code can have significant implications for the development process and the overall codebase.</p>\n<p>Incomplete Functionality: When developers leave <code>TODO</code> tags without implementing the corresponding code, it results in incomplete\nfunctionality within the software. This can lead to unexpected behavior or missing features, adversely affecting the end-user experience.</p>\n<p>Missed Bug Fixes: If developers do not promptly address <code>TODO</code> tags, they might overlook critical bug fixes and security updates.\nDelayed bug fixes can result in more severe issues and increase the effort required to resolve them later.</p>\n<p>Impact on Collaboration: In team-based development environments, unattended <code>TODO</code> tags can hinder collaboration. Other team members\nmight not be aware of the intended changes, leading to conflicts or redundant efforts in the codebase.</p>\n<p>Codebase Bloat: The accumulation of unattended <code>TODO</code> tags over time can clutter the codebase and make it difficult to distinguish\nbetween work in progress and completed code. This bloat can make it challenging to maintain an organized and efficient codebase.</p>\n<p>Addressing this code smell is essential to ensure a maintainable, readable, reliable codebase and promote effective collaboration among\ndevelopers.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nprivate void DoSomething()\n{\n  // TODO\n}\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/546\">CWE-546 - Suspicious Comment</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1135.json",
    "content": "{\n  \"title\": \"Track uses of \\\"TODO\\\" tags\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"INFO\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"0min\"\n  },\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Info\",\n  \"ruleSpecification\": \"RSPEC-1135\",\n  \"sqKey\": \"S1135\",\n  \"scope\": \"All\",\n  \"securityStandards\": {\n    \"CWE\": [\n      546\n    ]\n  },\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1144.html",
    "content": "<p>This rule raises an issue when a private/internal type or member is never referenced in the code.</p>\n<h2>Why is this an issue?</h2>\n<p>A type or member that is never called is dead code, and should be removed. Cleaning out dead code decreases the size of the maintained codebase,\nmaking it easier to understand the program and preventing bugs from being introduced.</p>\n<p>This rule detects type or members that are never referenced from inside a translation unit, and cannot be referenced from the outside.</p>\n<h3>Exceptions</h3>\n<p>This rule doesn’t raise issues on:</p>\n<ul>\n  <li>empty constructors</li>\n  <li>members with attributes</li>\n  <li>the <code>Main</code> method of the application</li>\n  <li><code>void</code> methods with two parameters when the second parameter type derives from <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.eventargs\">EventArgs</a></li>\n  <li>empty serialization constructor on type with <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.serializableattribute\">System.SerializableAttribute</a> attribute.</li>\n  <li>field and property members of types marked with <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.serializableattribute\">System.SerializableAttribute</a> attribute</li>\n  <li>internal members in assemblies that have a <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.internalsvisibletoattribute\">System.Runtime.CompilerServices.InternalsVisibleToAttribute</a> attribute.</li>\n  <li>types and members decorated with the <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.dynamicallyaccessedmembersattribute\">System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute</a> attribute (available in .NET 5.0+) or a custom attribute named <code>DynamicallyAccessedMembersAttribute</code>.</li>\n</ul>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic class Foo\n{\n    private void UnusedPrivateMethod(){...} // Noncompliant, this private method is unused and can be removed.\n\n    private class UnusedClass {...} // Noncompliant, unused private class that can be removed.\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic class Foo\n{\n    public Foo()\n    {\n        UsedPrivateMethod();\n    }\n\n    private void UsedPrivateMethod()\n    {\n        var c = new UsedClass();\n    }\n\n    private class UsedClass {...}\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/access-modifiers\">Access Modifiers (C#\n  Programming Guide)</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1144.json",
    "content": "{\n  \"title\": \"Unused private types or members should be removed\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"unused\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1144\",\n  \"sqKey\": \"S1144\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1147.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Calling <code>Environment.Exit(exitCode)</code> or <code>Application.Exit()</code> terminates the process and returns an exit code to the operating\nsystem..</p>\n<p>Each of these methods should be used with extreme care, and only when the intent is to stop the whole application.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nEnvironment.Exit(0);\nApplication.Exit();\n</pre>\n<h3>Exceptions</h3>\n<p>These methods are ignored inside <code>Main</code>.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1147.json",
    "content": "{\n  \"title\": \"Exit methods should not be called\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-1147\",\n  \"sqKey\": \"S1147\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      382\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1151.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The <code>switch</code> statement should be used only to clearly define some new branches in the control flow. As soon as a <code>case</code>\nclause contains too many statements this highly decreases the readability of the overall control flow statement. In such case, the content of the\n<code>case</code> clause should be extracted into a dedicated method.</p>\n<h3>Noncompliant code example</h3>\n<p>With the default threshold of 8:</p>\n<pre>\nswitch (myVariable)\n{\n    case 0: // Noncompliant: 9 statements in the case\n        methodCall1(\"\");\n        methodCall2(\"\");\n        methodCall3(\"\");\n        methodCall4(\"\");\n        methodCall5(\"\");\n        methodCall6(\"\");\n        methodCall7(\"\");\n        methodCall8(\"\");\n        methodCall9(\"\");\n        break;\n    case 1:\n        ...\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nswitch (myVariable)\n{\n    case 0:\n        DoSomething()\n        break;\n    case 1:\n        ...\n}\n...\nprivate void DoSomething()\n{\n    methodCall1(\"\");\n    methodCall2(\"\");\n    methodCall3(\"\");\n    methodCall4(\"\");\n    methodCall5(\"\");\n    methodCall6(\"\");\n    methodCall7(\"\");\n    methodCall8(\"\");\n    methodCall9(\"\");\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1151.json",
    "content": "{\n  \"title\": \"\\\"switch case\\\" clauses should not have too many lines of code\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"FOCUSED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"brain-overload\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1151\",\n  \"sqKey\": \"S1151\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1155.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When you call <code>Any()</code>, it clearly communicates the code’s intention, which is to check if the collection is empty. Using <code>Count()\n== 0</code> for this purpose is less direct and makes the code slightly more complex. However, there are some cases where special attention should be\npaid:</p>\n<ul>\n  <li>if the collection is an <code>EntityFramework</code> or other ORM query, calling <code>Count()</code> will cause executing a potentially massive\n  SQL query and could put a large overhead on the application database. Calling <code>Any()</code> will also connect to the database, but will\n  generate much more efficient SQL.</li>\n  <li>if the collection is part of a LINQ query that contains <code>Select()</code> statements that create objects, a large amount of memory could be\n  unnecessarily allocated. Calling <code>Any()</code> will be much more efficient because it will execute fewer iterations of the enumerable.</li>\n</ul>\n<h2>How to fix it</h2>\n<p>Prefer using <code>Any()</code> to test for emptiness over <code>Count()</code>.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nprivate static bool HasContent(IEnumerable&lt;string&gt; strings)\n{\n  return strings.Count() &gt; 0;  // Noncompliant\n}\n\nprivate static bool HasContent2(IEnumerable&lt;string&gt; strings)\n{\n  return strings.Count() &gt;= 1;  // Noncompliant\n}\n\nprivate static bool IsEmpty(IEnumerable&lt;string&gt; strings)\n{\n  return strings.Count() == 0;  // Noncompliant\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nprivate static bool HasContent(IEnumerable&lt;string&gt; strings)\n{\n  return strings.Any();\n}\n\nprivate static bool HasContent2(IEnumerable&lt;string&gt; strings)\n{\n  return strings.Any();\n}\n\nprivate static bool IsEmpty(IEnumerable&lt;string&gt; strings)\n{\n  return !strings.Any();\n}\n</pre>\n<h2>Resources</h2>\n<h3>Benchmarks</h3>\n<table>\n  <colgroup>\n    <col style=\"width: 25%;\">\n    <col style=\"width: 25%;\">\n    <col style=\"width: 25%;\">\n    <col style=\"width: 25%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>Method</th>\n      <th>Runtime</th>\n      <th>Mean</th>\n      <th>Standard Deviation</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p>Count</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>2,841.003 ns</p>\n      </td>\n      <td>\n        <p>266.0238 ns</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>Any</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>1.749 ns</p>\n      </td>\n      <td>\n        <p>0.1242 ns</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>Count</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>71,125.275 ns</p>\n      </td>\n      <td>\n        <p>731.0382 ns</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>Any</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>31.774 ns</p>\n      </td>\n      <td>\n        <p>0.3196 ns</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h4>Glossary</h4>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Arithmetic_mean\">Mean</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Standard_deviation\">Standard Deviation</a></li>\n</ul>\n<p>The results were generated by running the following snippet with <a href=\"https://github.com/dotnet/BenchmarkDotNet\">BenchmarkDotNet</a>:</p>\n<pre>\nprivate IEnumerable&lt;int&gt; collection;\n\npublic const int N = 10_000;\n\n[GlobalSetup]\npublic void GlobalSetup()\n{\n    collection = Enumerable.Range(0, N).Select(x =&gt; N - x);\n}\n\n[Benchmark(Baseline = true)]\npublic bool Count() =&gt;\n    collection.Count() &gt; 0;\n\n[Benchmark]\npublic bool Any() =&gt;\n    collection.Any();\n</pre>\n<p>Hardware Configuration:</p>\n<pre>\nBenchmarkDotNet v0.14.0, Windows 10 (10.0.19045.5247/22H2/2022Update)\n12th Gen Intel Core i7-12800H, 1 CPU, 20 logical and 14 physical cores\n  [Host]               : .NET Framework 4.8.1 (4.8.9282.0), X64 RyuJIT VectorSize=256\n  .NET 9.0             : .NET 9.0.0 (9.0.24.52809), X64 RyuJIT AVX2\n  .NET Framework 4.8.1 : .NET Framework 4.8.1 (4.8.9282.0), X64 RyuJIT VectorSize=256\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1155.json",
    "content": "{\n  \"title\": \"\\\"Any()\\\" should be used to test for emptiness\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1155\",\n  \"sqKey\": \"S1155\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1163.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>If an exception is already being thrown within the <code>try</code> block or caught in a <code>catch</code> block, throwing another exception in\nthe <code>finally</code> block will override the original exception. This means that the original exception’s message and stack trace will be lost,\npotentially making it challenging to diagnose and troubleshoot the root cause of the problem.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\ntry\n{\n  // Some work which end up throwing an exception\n  throw new ArgumentException();\n}\nfinally\n{\n  // Cleanup\n  throw new InvalidOperationException(); // Noncompliant: will mask the ArgumentException\n}\n</pre>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\ntry\n{\n  // Some work which end up throwing an exception\n  throw new ArgumentException();\n}\nfinally\n{\n  // Cleanup without throwing\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/exceptions/\">Exceptions and Exception Handling</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/exceptions/how-to-use-finally-blocks\">Finally blocks</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/exceptions/how-to-execute-cleanup-code-using-finally\">How to execute\n  cleanup code using finally</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1163.json",
    "content": "{\n  \"title\": \"Exceptions should not be thrown in finally blocks\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"tags\": [\n    \"error-handling\",\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-1163\",\n  \"sqKey\": \"S1163\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1168.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Returning <code>null</code> or <code>default</code> instead of an actual collection forces the method callers to explicitly test for null, making\nthe code more complex and less readable.</p>\n<p>Moreover, in many cases, <code>null</code> or <code>default</code> is used as a synonym for empty.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic Result[] GetResults()\n{\n    return null; // Noncompliant\n}\n\npublic IEnumerable&lt;Result&gt; GetResults(bool condition)\n{\n    var results = GenerateResults();\n    return condition\n        ? results\n        : null; // Noncompliant\n}\n\npublic IEnumerable&lt;Result&gt; GetResults() =&gt; null; // Noncompliant\n\npublic IEnumerable&lt;Result&gt; Results\n{\n    get\n    {\n        return default(IEnumerable&lt;Result&gt;); // Noncompliant\n    }\n}\n\npublic IEnumerable&lt;Result&gt; Results =&gt; default; // Noncompliant\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic Result[] GetResults()\n{\n    return new Result[0];\n}\n\npublic IEnumerable&lt;Result&gt; GetResults(bool condition)\n{\n    var results = GenerateResults();\n    return condition\n        ? results\n        : Enumerable.Empty&lt;Result&gt;();\n}\n\npublic IEnumerable&lt;Result&gt; GetResults() =&gt; Enumerable.Empty&lt;Result&gt;();\n\npublic IEnumerable&lt;Result&gt; Results\n{\n    get\n    {\n        return Enumerable.Empty&lt;Result&gt;();\n    }\n}\n\npublic IEnumerable&lt;Result&gt; Results =&gt; Enumerable.Empty&lt;Result&gt;();\n</pre>\n<h3>Exceptions</h3>\n<p>Although <code>string</code> is a collection, the rule won’t report on it.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1168.json",
    "content": "{\n  \"title\": \"Empty arrays and collections should be returned instead of null\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1168\",\n  \"sqKey\": \"S1168\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1172.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>A typical code smell known as unused function parameters refers to parameters declared in a function but not used anywhere within the function’s\nbody. While this might seem harmless at first glance, it can lead to confusion and potential errors in your code. Disregarding the values passed to\nsuch parameters, the function’s behavior will be the same, but the programmer’s intention won’t be clearly expressed anymore. Therefore, removing\nfunction parameters that are not being utilized is considered best practice.</p>\n<p>This rule raises an issue when a <code>private</code> method or constructor of a class/struct takes a parameter without using it.</p>\n<h3>Exceptions</h3>\n<p>This rule doesn’t raise any issue in the following contexts:</p>\n<ul>\n  <li>The <code>this</code> parameter of extension methods.</li>\n  <li>Methods decorated with attributes.</li>\n  <li>Empty methods.</li>\n  <li>Methods which only throw <code>NotImplementedException</code>.</li>\n  <li>The Main method of the application.</li>\n  <li><code>virtual</code>, <code>override</code> methods.</li>\n  <li>interface implementations.</li>\n</ul>\n<h2>How to fix it</h2>\n<p>Having unused function parameters in your code can lead to confusion and misunderstanding of a developer’s intention. They reduce code readability\nand introduce the potential for errors. To avoid these problems, developers should remove unused parameters from function declarations.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nprivate void DoSomething(int a, int b) // Noncompliant, \"b\" is unused\n{\n    Compute(a);\n}\n\nprivate void DoSomething2(int a) // Noncompliant, the value of \"a\" is unused\n{\n    a = 10;\n    Compute(a);\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nprivate void DoSomething(int a)\n{\n    Compute(a);\n}\n\nprivate void DoSomething2()\n{\n    var a = 10;\n    Compute(a);\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1172.json",
    "content": "{\n  \"title\": \"Unused method parameters should be removed\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"unused\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1172\",\n  \"sqKey\": \"S1172\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1185.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Overriding a method just to call the same method from the base class without performing any other actions is useless and misleading. The only time\nthis is justified is in <code>sealed</code> overriding methods, where the effect is to lock in the parent class behavior. This rule ignores overrides\nof <code>Equals</code> and <code>GetHashCode</code>.</p>\n<p>NOTE: In some cases it might be dangerous to add or remove empty overrides, as they might be breaking changes.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic override void Method() // Noncompliant\n{\n  base.Method();\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic override void Method()\n{\n  //do something else\n}\n</pre>\n<h3>Exceptions</h3>\n<p>If there is an attribute in any level of the overriding chain, then the overridden member is ignored.</p>\n<pre>\npublic class Base\n{\n  [Required]\n  public virtual string Name { get; set; }\n}\n\npublic class Derived : Base\n{\n  public override string Name\n  {\n    get\n    {\n      return base.Name;\n    }\n    set\n    {\n      base.Name = value;\n    }\n  }\n}\n</pre>\n<p>If there is a documentation comment on the overriding method, it will be ignored:</p>\n<pre>\npublic class Foo : Bar\n{\n    /// &lt;summary&gt;\n    /// Keep this method for backwards compatibility.\n    /// &lt;/summary&gt;\n    public override void DoSomething()\n    {\n        base.DoSomething();\n    }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1185.json",
    "content": "{\n  \"title\": \"Overriding members should do more than simply call the same member in the base class\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"redundant\",\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1185\",\n  \"sqKey\": \"S1185\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1186.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>An empty method is generally considered bad practice and can lead to confusion, readability, and maintenance issues. Empty methods bring no\nfunctionality and are misleading to others as they might think the method implementation fulfills a specific and identified requirement.</p>\n<p>There are several reasons for a method not to have a body:</p>\n<ul>\n  <li>It is an unintentional omission, and should be fixed to prevent an unexpected behavior in production.</li>\n  <li>It is not yet, or never will be, supported. In this case an exception should be thrown.</li>\n  <li>The method is an intentionally-blank override. In this case a nested comment should explain the reason for the blank override.</li>\n</ul>\n<h3>Exceptions</h3>\n<p>The following empty methods are considered compliant:</p>\n<ul>\n  <li>empty <code>virtual</code> methods as the implementation might not be required in the base class</li>\n  <li>empty methods that override an <code>abstract</code> method as the implementation is mandatory for child class</li>\n  <li>empty overrides in test assemblies for mocking purposes</li>\n</ul>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic void ShouldNotBeEmpty() {  // Noncompliant - method is empty\n}\n\npublic void NotImplementedYet() {  // Noncompliant - method is empty\n}\n\npublic void WillNeverBeImplemented() {  // Noncompliant - method is empty\n}\n\npublic void EmptyOnPurpose() {  // Noncompliant - method is empty\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic void ShouldNotBeEmpty() {\n    DoSomething();\n}\n\npublic void NotImplementedYet() {\n    throw new NotImplementedException();\n}\n\npublic void WillNeverBeImplemented() {\n    throw new NotSupportedException();\n}\n\npublic void EmptyOnPurpose() {\n  // comment explaining why the method is empty\n}\n</pre>\n<h4>Compliant solution</h4>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1186.json",
    "content": "{\n  \"title\": \"Methods should not be empty\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-1186\",\n  \"sqKey\": \"S1186\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1192.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Duplicated string literals make the process of refactoring complex and error-prone, as any change would need to be propagated on all\noccurrences.</p>\n<h3>Exceptions</h3>\n<p>The following are ignored:</p>\n<ul>\n  <li>literals with fewer than 5 characters</li>\n  <li>literals matching one of the parameter names</li>\n  <li>literals used in attributes</li>\n</ul>\n<h2>How to fix it</h2>\n<p>Use constants to replace the duplicated string literals. Constants can be referenced from many places, but only need to be updated in a single\nplace.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic class Foo\n{\n    private string name = \"foobar\"; // Noncompliant\n\n    public string DefaultName { get; } = \"foobar\"; // Noncompliant\n\n    public Foo(string value = \"foobar\") // Noncompliant\n    {\n        var something = value ?? \"foobar\"; // Noncompliant\n    }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic class Foo\n{\n    private const string Foobar = \"foobar\";\n\n    private string name = Foobar;\n\n    public string DefaultName { get; } = Foobar;\n\n    public Foo(string value = Foobar)\n    {\n        var something = value ?? Foobar;\n    }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1192.json",
    "content": "{\n  \"title\": \"String literals should not be duplicated\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"DISTINCT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Linear with offset\",\n    \"linearDesc\": \"per duplicate instance\",\n    \"linearOffset\": \"2min\",\n    \"linearFactor\": \"2min\"\n  },\n  \"tags\": [\n    \"design\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1192\",\n  \"sqKey\": \"S1192\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1199.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Nested code blocks create new scopes where variables declared within are inaccessible from the outside, and their lifespan ends with the block.</p>\n<p>Although this may appear beneficial, their usage within a function often suggests that the function is overloaded. Thus, it may violate the Single\nResponsibility Principle, and the function needs to be broken down into smaller functions.</p>\n<p>The presence of nested blocks that don’t affect the control flow might suggest possible mistakes in the code.</p>\n<h3>Exceptions</h3>\n<p>The usage of a code block after a <code>case</code> is allowed.</p>\n<h2>How to fix it</h2>\n<p>The nested code blocks should be extracted into separate methods.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic void Evaluate()\n{\n    /* ... */\n    {     // Noncompliant - nested code block '{' ... '}'\n          int a = stack.pop();\n          int b = stack.pop();\n          int result = a + b;\n          stack.push(result);\n    }\n    /* ... */\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic void Evaluate()\n{\n    /* ... */\n    StackAdd();\n    /* ... */\n}\n\nprivate void StackAdd()\n{\n      int a = stack.pop();\n      int b = stack.pop();\n      int result = a + b;\n      stack.push(result);\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Single-responsibility_principle\">Single Responsibility Principle</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1199.json",
    "content": "{\n  \"title\": \"Nested code blocks should not be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"bad-practice\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1199\",\n  \"sqKey\": \"S1199\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1200.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>According to the Single Responsibility Principle, introduced by Robert C. Martin in his book \"Principles of Object Oriented Design\", a class should\nhave only one responsibility:</p>\n<blockquote>\n  <p>If a class has more than one responsibility, then the responsibilities become coupled.</p>\n  <p>Changes to one responsibility may impair or inhibit the class' ability to meet the others.</p>\n  <p>This kind of coupling leads to fragile designs that break in unexpected ways when changed.</p>\n</blockquote>\n<p>Classes which rely on many other classes tend to aggregate too many responsibilities and should be split into several smaller ones.</p>\n<p>Nested classes dependencies are not counted as dependencies of the outer class.</p>\n<h3>Noncompliant code example</h3>\n<p>With a threshold of 5:</p>\n<pre>\npublic class Foo    // Noncompliant - Foo depends on too many classes: T1, T2, T3, T4, T5, T6 and T7\n{\n  private T1 a1;    // Foo is coupled to T1\n  private T2 a2;    // Foo is coupled to T2\n  private T3 a3;    // Foo is coupled to T3\n\n  public T4 Compute(T5 a, T6 b)    // Foo is coupled to T4, T5 and T6\n  {\n    T7 result = a.Process(b);    // Foo is coupled to T7\n    return result;\n  }\n\n  public static class Bar    // Compliant - Bar depends on 2 classes: T8 and T9\n  {\n    public T8 a8;\n    public T9 a9;\n  }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1200.json",
    "content": "{\n  \"title\": \"Classes should not be coupled to too many other classes\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"FOCUSED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2h\"\n  },\n  \"tags\": [\n    \"brain-overload\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1200\",\n  \"sqKey\": \"S1200\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1206.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Suppose you override <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.object.equals\">Object.Equals</a> in a type, you must also\noverride <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.object.gethashcode\">Object.GetHashCode</a>. If two objects are equal according\nto the <code>Equals</code> method, then calling <code>GetHashCode</code> on each of them must yield the same integer. If this is not the case, many\ncollections, such as a <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.hashtable\">Hashtable</a> or a <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2\">Dictionary</a> won’t handle class instances correctly.</p>\n<p>In order to not have unpredictable behavior, <code>Equals</code> and <code>GetHashCode</code> should be either both inherited, or both\noverridden.</p>\n<h2>How to fix it</h2>\n<p>When you override <code>Equals</code> then you have to also override <code>GetHashCode</code>. You have to override both of them, or simply inherit\nthem.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nclass MyClass   // Noncompliant: should also override GetHashCode\n{\n    public override bool Equals(object obj)\n    {\n        // ...\n    }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nclass MyClass\n{\n    public override bool Equals(object obj)\n    {\n        // ...\n    }\n\n    public override int GetHashCode()\n    {\n        // ...\n    }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/581\">CWE-581 - Object Model Violation: Just One of Equals and Hashcode Defined</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.object.equals\">Object.Equals Method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.object.gethashcode\">Object.GetHashCode Method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.hashtable\">Hashtable class</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2\">Dictionary&lt;TKey,TValue&gt; Class</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1206.json",
    "content": "{\n  \"title\": \"\\\"Equals(Object)\\\" and \\\"GetHashCode()\\\" should be overridden in pairs\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"LOW\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15 min\"\n  },\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1206\",\n  \"sqKey\": \"S1206\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      581\n    ]\n  },\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S121.html",
    "content": "<p>Control structures are code statements that impact the program’s control flow (e.g., if statements, for loops, etc.)</p>\n<h2>Why is this an issue?</h2>\n<p>While not technically incorrect, the omission of curly braces can be misleading and may lead to the introduction of errors during maintenance.</p>\n<p>In the following example, the two calls seem to be attached to the <code>if</code> statement, but only the first one is, and\n<code>CheckSomething</code> will always be executed:</p>\n<pre>\nif (condition) // Noncompliant\n  ExecuteSomething();\n  CheckSomething();\n</pre>\n<p>Adding curly braces improves the code readability and its robustness:</p>\n<pre>\nif (condition)\n{\n  ExecuteSomething();\n  CheckSomething();\n}\n</pre>\n<p>The rule raises an issue when a control structure has no curly braces.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S121.json",
    "content": "{\n  \"title\": \"Control structures should use curly braces\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-121\",\n  \"sqKey\": \"S121\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1210.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When you implement <code>IComparable</code> or <code>IComparable&lt;T&gt;</code> on a class you should also override <code>Equals(object)</code>\nand overload the comparison operators (<code>==</code>, <code>!=</code>, <code>&lt;</code>, <code>&lt;=</code>, <code>&gt;</code>,\n<code>&gt;=</code>). That’s because the CLR cannot automatically call your <code>CompareTo</code> implementation from <code>Equals(object)</code> or\nfrom the base comparison operator implementations. Additionally, it is best practice to override <code>GetHashCode</code> along with\n<code>Equals</code>.</p>\n<p>This rule raises an issue when a class implements <code>IComparable</code> without also overriding <code>Equals(object)</code> and the comparison\noperators.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic class Foo: IComparable  // Noncompliant\n{\n  public int CompareTo(object obj) { /* ... */ }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic class Foo: IComparable\n{\n  public int CompareTo(object obj) { /* ... */ }\n  public override bool Equals(object obj)\n  {\n    var other = obj as Foo;\n    if (object.ReferenceEquals(other, null))\n    {\n      return false;\n    }\n    return this.CompareTo(other) == 0;\n  }\n  public int GetHashCode() { /* ... */ }\n  public static bool operator == (Foo left, Foo right)\n  {\n    if (object.ReferenceEquals(left, null))\n    {\n      return object.ReferenceEquals(right, null);\n    }\n    return left.Equals(right);\n  }\n  public static bool operator &gt; (Foo left, Foo right)\n  {\n    return Compare(left, right) &gt; 0;\n  }\n  public static bool operator &lt; (Foo left, Foo right)\n  {\n    return Compare(left, right) &lt; 0;\n  }\n  public static bool operator != (Foo left, Foo right)\n  {\n    return !(left == right);\n  }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1210.json",
    "content": "{\n  \"title\": \"\\\"Equals\\\" and the comparison operators should be overridden when implementing \\\"IComparable\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1210\",\n  \"sqKey\": \"S1210\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1215.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.gc.collect\">GC.Collect</a> is a method that forces or suggests to the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/\">garbage collector</a> to run a collection of objects in the managed heap\nthat are no longer being used and free their memory.</p>\n<p>Calling <code>GC.Collect</code> is rarely necessary and can significantly affect application performance. That’s because it is a <a\nhref=\"https://en.wikipedia.org/wiki/Tracing_garbage_collection\">tracing garbage collector</a> and needs to examine <em>every object in memory</em> for\ncleanup and analyze all reachable objects from every application’s root (static fields, local variables on thread stacks, etc.).</p>\n<p>To perform tracing and memory releasing correctly, the garbage collection <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/latency\">may</a> need to block all threads currently in execution. That is\nwhy, as a general rule, the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/performance#troubleshoot-performance-issues\">performance implications</a>\nof calling <code>GC.Collect</code> far outweigh the benefits.</p>\n<p>This rule raises an issue when any overload of <code>Collect</code> is invoked.</p>\n<pre>\nstatic void Main(string[] args)\n{\n  // ...\n  GC.Collect();                              // Noncompliant\n  GC.Collect(2, GCCollectionMode.Optimized); // Noncompliant\n}\n</pre>\n<p>There may be exceptions to this rule: for example, you’ve just triggered some event that is unique in the run of your program that caused a lot of\nlong-lived objects to die, and you want to release their memory.</p>\n<p>This rule also raises on <code>GC.GetTotalMemory</code> when <code>forceFullCollection</code> is true as it directly invokes\n<code>GC.Collect</code>.</p>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/\">Garbage collection</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.gc.collect\">GC.Collect</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.gc.gettotalmemory\">GC.GetTotalMemory</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/latency\">Garbage collection latency modes</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/performance#troubleshoot-performance-issues\">Garbage collection\n  troubleshoot performance issues</a></li>\n</ul>\n<h3>Benchmarks</h3>\n<p>Each .NET runtime features distinct implementations, modes, and configurations for its garbage collector. The benchmark below illustrates how\ninvoking <code>GC.Collect()</code> can have opposite effects across different runtimes.</p>\n<table>\n  <colgroup>\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>Runtime</th>\n      <th>Collect</th>\n      <th>Mean</th>\n      <th>Standard Deviation</th>\n      <th>Allocated</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>False</p>\n      </td>\n      <td>\n        <p>659.2 ms</p>\n      </td>\n      <td>\n        <p>15.69 ms</p>\n      </td>\n      <td>\n        <p>205.95 MB</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>True</p>\n      </td>\n      <td>\n        <p>888.8 ms</p>\n      </td>\n      <td>\n        <p>15.34 ms</p>\n      </td>\n      <td>\n        <p>205.95 MB</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>False</p>\n      </td>\n      <td>\n        <p>545.7 ms</p>\n      </td>\n      <td>\n        <p>19.49 ms</p>\n      </td>\n      <td>\n        <p>228.8 MB</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>True</p>\n      </td>\n      <td>\n        <p>484.8 ms</p>\n      </td>\n      <td>\n        <p>11.79 ms</p>\n      </td>\n      <td>\n        <p>228.8 MB</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h4>Glossary</h4>\n<ul>\n  <li>Collect - if <code>True</code>, <code>GC.Collect()</code> is called in the middle of the allocation heavy <code>Benchmark()</code> method</li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Arithmetic_mean\">Mean</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Standard_deviation\">Standard Deviation</a></li>\n  <li><a href=\"https://github.com/dotnet/BenchmarkDotNet/blob/master/docs/articles/configs/diagnosers.md\">Allocated</a></li>\n</ul>\n<p>The results were generated by running the following snippet with <a href=\"https://github.com/dotnet/BenchmarkDotNet\">BenchmarkDotNet</a>:</p>\n<pre>\nclass Tree\n{\n    public List&lt;Tree&gt; Children = new();\n}\n\nprivate void AppendToTree(Tree tree, int childsPerTree, int depth)\n{\n    if (depth == 0)\n    {\n        return;\n    }\n    for (int i = 0; i &lt; childsPerTree; i++)\n    {\n        var child = new Tree();\n        tree.Children.Add(child);\n        AppendToTree(child, childsPerTree, depth - 1);\n    }\n}\n\n[Benchmark]\n[Arguments(true)]\n[Arguments(false)]\npublic void Benchmark(bool collect)\n{\n    var tree = new Tree();\n    AppendToTree(tree, 8, 7);        // Create 8^7 Tree objects (2.097.152 objects) linked via List&lt;Tree&gt; Children\n    GC.Collect();\n    GC.Collect();                    // Move the objects to generation 2\n    AppendToTree(new Tree(), 8, 6);  // Add some more memory preasure (8^6 262.144 objects) which can be collected right after this call\n    tree = null;                     // Remove all references to the tree and its content. This freees up 8^7 Tree objects (2.097.152 objects)\n    if (collect)\n    {\n        GC.Collect();                // Force GC to run and block until it finishes\n    }\n    AppendToTree(new Tree(), 3, 10); // Do some more allocations (3^10 = 59.049)\n    AppendToTree(new Tree(), 4, 7);  // 4^10 = 1.048.576\n    AppendToTree(new Tree(), 5, 7);  // 5^7 = 78.125\n    GC.Collect();                    // Collect all the memory allocated in this method\n}\n</pre>\n<p>Hardware configuration:</p>\n<pre>\nBenchmarkDotNet v0.14.0, Windows 10 (10.0.19045.5247/22H2/2022Update)\nIntel Core Ultra 7 165H, 1 CPU, 22 logical and 16 physical cores\n  [Host]               : .NET Framework 4.8.1 (4.8.9282.0), X64 RyuJIT VectorSize=256\n  .NET 9.0             : .NET 9.0.0 (9.0.24.52809), X64 RyuJIT AVX2\n  .NET Framework 4.8.1 : .NET Framework 4.8.1 (4.8.9282.0), X64 RyuJIT VectorSize=256\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1215.json",
    "content": "{\n  \"title\": \"\\\"GC.Collect\\\" should not be called\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"tags\": [\n    \"performance\",\n    \"unpredictable\",\n    \"bad-practice\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-1215\",\n  \"sqKey\": \"S1215\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S122.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Putting multiple statements on a single line lowers the code readability and makes debugging the code more complex.</p>\n<pre>\nif (someCondition) { DoSomething(); } // Noncompliant\n\nDoSomething(); DoSomethingElse(); // Noncompliant\n</pre>\n<p>Write one statement per line to improve readability.</p>\n<pre>\nif (someCondition)\n{\n  DoSomething();\n}\n\nDoSomething();\nDoSomethingElse();\n</pre>\n<h3>Exceptions</h3>\n<p>The rule ignores:</p>\n<ul>\n  <li>block statements</li>\n  <li>anonymous functions containing a single statement</li>\n</ul>\n<pre>\nFunc&lt;object, bool&gt; item1 = o =&gt; { return true; }; // Compliant by exception\nFunc&lt;object, bool&gt; item1 = o =&gt; { var r = false; return r; }; // Noncompliant\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/csharp-formatting-options\">C# formatting\n  options</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S122.json",
    "content": "{\n  \"title\": \"Statements should be on separate lines\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"FORMATTED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-122\",\n  \"sqKey\": \"S122\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1226.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>While it is technically correct to assign to parameters from within method bodies, doing so before the parameter value is read is likely a bug.\nInstead, initial values of parameters, caught exceptions, and foreach parameters should be, if not treated as <code>final</code>, then at least read\nbefore reassignment.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic void DoTheThing(string str, int i, List&lt;string&gt; strings)\n{\n  str = i.ToString(i);  // Noncompliant\n\n  foreach (var s in strings)\n  {\n    s = \"hello world\";  // Noncompliant\n  }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1226.json",
    "content": "{\n  \"title\": \"Method parameters, caught exceptions and foreach variables\\u0027 initial values should not be ignored\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1226\",\n  \"sqKey\": \"S1226\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1227.html",
    "content": "<p>This rule is deprecated, and will eventually be removed.</p>\n<h2>Why is this an issue?</h2>\n<p><code>break;</code> is an unstructured control flow statement which makes code harder to read.</p>\n<p>Ideally, every loop should have a single termination condition.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nint i = 0;\nwhile (true)\n{\n  if (i == 10)\n  {\n    break;      // Non-Compliant\n  }\n\n  Console.WriteLine(i);\n  i++;\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nint i = 0;\nwhile (i != 10) // Compliant\n{\n  Console.WriteLine(i);\n  i++;\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1227.json",
    "content": "{\n  \"title\": \"break statements should not be used except for switch cases\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"deprecated\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1227\",\n  \"sqKey\": \"S1227\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1244.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Floating point numbers in C# (and in most other programming languages) are not precise. They are a binary approximation of the actual value. This\nmeans that even if two floating point numbers appear to be equal, they might not be due to the tiny differences in their binary representation.</p>\n<p>Even simple floating point assignments are not simple:</p>\n<pre>\nfloat f = 0.100000001f; // 0.1\ndouble d = 0.10000000000000001; // 0.1\n</pre>\n<p>(Note: Results may vary based on the compiler and its settings)</p>\n<p>This issue is further compounded by the <a href=\"https://en.wikipedia.org/wiki/Associative_property\">non-associative</a> nature of floating point\narithmetic. The order in which operations are performed can affect the outcome due to the rounding that occurs at each step. Consequently, the outcome\nof a series of mathematical operations can vary based on the order of operations.</p>\n<p>As a result, using the equality (<code>==</code>) or inequality (<code>!=</code>) operators with <code>float</code> or <code>double</code> values\nis typically a mistake, as it can lead to unexpected behavior.</p>\n<h2>How to fix it</h2>\n<p>Consider using a small tolerance value to check if the numbers are \"close enough\" to be considered equal. This tolerance value, often called\n<code>epsilon</code>, should be chosen based on the specifics of your program.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nfloat myNumber = 3.146f;\n\nif (myNumber == 3.146f) // Noncompliant: due to floating point imprecision, this will likely be false\n{\n  // ...\n}\n\nif (myNumber &lt; 4 || myNumber &gt; 4) // Noncompliant: indirect inequality test\n{\n  // ...\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nfloat myNumber = 3.146f;\nfloat epsilon = 0.0001f; // or some other small value\n\nif (Math.Abs(myNumber - 3.146f) &lt; epsilon)\n{\n  // ...\n}\n\nif (myNumber &lt;= 4 - epsilon || myNumber &gt;= 4 + epsilon)\n{\n  // ...\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html\">Floating-Point Arithmetic Complexities</a> by David Goldberg</li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/floating-point-numeric-types#comparing-floating-point-numbers\">Floating-point numeric types</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Associative_property\">Associative property</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1244.json",
    "content": "{\n  \"title\": \"Floating point numbers should not be tested for equality\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1244\",\n  \"sqKey\": \"S1244\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S125.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Commented-out code distracts the focus from the actual executed code. It creates a noise that increases maintenance code. And because it is never\nexecuted, it quickly becomes out of date and invalid.</p>\n<p>Commented-out code should be deleted and can be retrieved from source control history if required.</p>\n<h2>How to fix it</h2>\n<p>Delete the commented out code.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nvoid Method(string s)\n{\n    // if (s.StartsWith('A'))\n    // {\n    //     s = s.Substring(1);\n    // }\n\n    // Do something...\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nvoid Method(string s)\n{\n    // Do something...\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S125.json",
    "content": "{\n  \"title\": \"Sections of code should not be commented out\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"unused\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-125\",\n  \"sqKey\": \"S125\",\n  \"scope\": \"All\",\n  \"quickfix\": \"partial\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S126.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>This rule applies whenever an <code>if</code> statement is followed by one or more <code>else if</code> statements; the final <code>else if</code>\nshould be followed by an <code>else</code> statement.</p>\n<p>The requirement for a final <code>else</code> statement is defensive programming.</p>\n<p>The <code>else</code> statement should either take appropriate action or contain a suitable comment as to why no action is taken. This is\nconsistent with the requirement to have a final <code>default</code> clause in a <code>switch</code> statement.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nif (x == 0)\n{\n    DoSomething();\n}\nelse if (x == 1)\n{\n    DoSomethingElse();\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nif (x == 0)\n{\n    DoSomething();\n}\nelse if (x == 1)\n{\n    DoSomethingElse();\n}\nelse\n{\n    throw new InvalidOperationException();\n}\n</pre>\n<h3>Exceptions</h3>\n<p>None</p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S126.json",
    "content": "{\n  \"title\": \"\\\"if ... else if\\\" constructs should end with \\\"else\\\" clauses\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-126\",\n  \"sqKey\": \"S126\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1264.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Using a <code>for</code> loop without its typical structure (initialization, condition, increment) can be confusing. In those cases, it is better\nto use a <code>while</code> loop as it is more readable.</p>\n<p>The initializer section should contain a variable declaration to be considered as a valid initialization.</p>\n<h2>How to fix it</h2>\n<p>Replace the <code>for</code> loop with a <code>while</code> loop.</p>\n<h3>Code example</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nfor (;condition;) // Noncompliant; both the initializer and increment sections are missing\n{\n    // Do something\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nwhile (condition)\n{\n    // Do something\n}\n</pre>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nint i;\n\nfor (i = 0; i &lt; 10;) // Noncompliant; the initializer section should contain a variable declaration\n{\n    // Do something\n    i++;\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nint i = 0;\n\nwhile (i &lt; 10)\n{\n    // Do something\n    i++;\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/iteration-statements#the-for-statement\">The <code>for</code>\n  statement</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1264.json",
    "content": "{\n  \"title\": \"A \\\"while\\\" loop should be used instead of a \\\"for\\\" loop\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1264\",\n  \"sqKey\": \"S1264\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S127.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>A <code>for</code> loop stop condition should test the loop counter against an invariant value, one that is true at both the beginning and ending\nof every loop iteration. Ideally, this means that the stop condition is set to a local variable just before the loop begins.</p>\n<p>This rule tracks when incremented counters used in the stop condition are updated in the body of the <code>for</code> loop.</p>\n<h3>What is the potential impact?</h3>\n<p>Non-invariant stop conditions can lead to unexpected loop behavior, making the code harder to debug and maintain. If the stop condition changes\nunexpectedly during iteration, it may cause:</p>\n<ul>\n  <li>infinite loops or premature loop termination</li>\n  <li>off-by-one errors that are difficult to trace</li>\n  <li>subtle bugs that only manifest under specific conditions</li>\n</ul>\n<h2>How to fix it</h2>\n<p>It is generally recommended to only update the loop counter in the loop declaration. If skipping elements or iterating at a different pace based on\na condition is needed, consider using a while loop or a different structure that better fits the needs.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nfor (int i = 1; i &lt;= 5; i++)\n{\n    Console.WriteLine(i);\n    if (condition)\n    {\n        i = 20;\n    }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nint i = 1;\nwhile (i &lt;= 5)\n{\n    Console.WriteLine(i);\n    if (condition)\n    {\n        i = 20;\n    }\n    else\n    {\n        i++;\n    }\n}\n</pre>\n<h3>How does this work?</h3>\n<p>A <code>while</code> loop signals that the iteration logic may be more complex, so readers will naturally look for control flow changes within the\nloop body. This makes the code’s intent clearer and easier to reason about.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S127.json",
    "content": "{\n  \"title\": \"\\\"for\\\" loop stop conditions should be invariant\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-127\",\n  \"sqKey\": \"S127\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1301.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><code>switch</code> statements and expressions are useful when there are many different cases depending on the value of the same expression.</p>\n<p>When a <code>switch</code> statement or expression is simple enough, the code will be more readable with a single <code>if</code>,\n<code>if-else</code> or ternary conditional operator.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nswitch (variable)\n{\n  case 0:\n    doSomething();\n    break;\n  default:\n    doSomethingElse();\n    break;\n}\n\nvar foo = variable switch\n{\n  0 =&gt; doSomething(),\n  _ =&gt; doSomethingElse(),\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nif (variable == 0)\n{\n  doSomething();\n}\nelse\n{\n  doSomethingElse();\n}\n\nvar foo = variable == 0\n  ? doSomething()\n  : doSomethingElse();\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1301.json",
    "content": "{\n  \"title\": \"\\\"switch\\\" statements should have at least 3 \\\"case\\\" clauses\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"bad-practice\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1301\",\n  \"sqKey\": \"S1301\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1309.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>This rule allows you to track the usage of the <code>SuppressMessage</code> attributes and <code>#pragma warning disable</code> mechanism.</p>\n<h3>Noncompliant code example</h3>\n<pre>\n[SuppressMessage(\"\", \"S100\")]\n...\n\n#pragma warning disable S100\n...\n#pragma warning restore S100\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1309.json",
    "content": "{\n  \"title\": \"Track uses of in-source issue suppressions\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"INFO\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Info\",\n  \"ruleSpecification\": \"RSPEC-1309\",\n  \"sqKey\": \"S1309\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S131.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The requirement for a final <code>default</code> clause is defensive programming. The clause should either take appropriate action, or contain a\nsuitable comment as to why no action is taken. Even when the <code>switch</code> covers all current values of an <code>enum</code>, a\n<code>default</code> case should still be used because there is no guarantee that the <code>enum</code> won’t be extended.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nint foo = 42;\nswitch (foo) // Noncompliant\n{\n  case 0:\n    Console.WriteLine(\"foo = 0\");\n    break;\n  case 42:\n    Console.WriteLine(\"foo = 42\");\n    break;\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nint foo = 42;\nswitch (foo) // Compliant\n{\n  case 0:\n    Console.WriteLine(\"foo = 0\");\n    break;\n  case 42:\n    Console.WriteLine(\"foo = 42\");\n    break;\n  default:\n    throw new InvalidOperationException(\"Unexpected value foo = \" + foo);\n}\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/478\">CWE-478 - Missing Default Case in Switch Statement</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S131.json",
    "content": "{\n  \"title\": \"\\\"switch\\/Select\\\" statements should contain a \\\"default\\/Case Else\\\" clauses\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-131\",\n  \"sqKey\": \"S131\",\n  \"scope\": \"All\",\n  \"securityStandards\": {\n    \"CWE\": [\n      478\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1312.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Regardless of the logging framework in use (Microsoft.Extension.Logging, Serilog, Log4net, NLog, …​​), logger fields should be:</p>\n<ul>\n  <li><strong>private</strong>: this restricts access to the logger from outside the enclosing type (class, struct, record…​). Using any other access\n  modifier would allow other types to use the logger to log messages in the type where it’s defined.</li>\n  <li><strong>static</strong>: making the logger field <code>static</code> will ensure that the lifetime of the object doesn’t depend on the lifetime\n  of the instance of the enclosing type.</li>\n  <li><strong>readonly</strong>: marking the field as <code>readonly</code> will prevent modifications to the reference of the logger. This ensures\n  that the reference to the logger remains consistent and doesn’t get accidentally reassigned during the lifetime of the enclosing type.</li>\n</ul>\n<p>This rule should be activated when <a href=\"https://en.wikipedia.org/wiki/Service_locator_pattern\">Service Locator Design pattern</a> is followed\nin place of <a href=\"https://en.wikipedia.org/wiki/Dependency_injection\">Dependency Injection</a> for logging.</p>\n<p>The rule supports the most popular logging frameworks:</p>\n<ul>\n  <li><a href=\"https://www.nuget.org/packages/Microsoft.Extensions.Logging\">Microsoft.Extensions.Logging</a></li>\n  <li><a href=\"https://www.nuget.org/packages/Serilog\">Serilog</a></li>\n  <li><a href=\"https://www.nuget.org/packages/Castle.Core\">Castle.Core</a></li>\n  <li><a href=\"https://www.nuget.org/packages/NLog\">NLog</a></li>\n  <li><a href=\"https://www.nuget.org/packages/log4net\">log4net</a></li>\n</ul>\n<h2>How to fix it</h2>\n<p>Make the logging field <code>{private static readonly}</code>.</p>\n<h3>Noncompliant code example</h3>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic Logger logger;\n</pre>\n<h3>Compliant solution</h3>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nprivate static readonly Logger logger;\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/access-modifiers\">Access\n  modifiers</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/static-classes-and-static-class-members\"><code>static</code> class members</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/readonly\"><code>readonly</code>\n  keyword</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Service_locator_pattern\">Service locator pattern</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Dependency_injection\">Dependency injection</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li><a href=\"https://stackoverflow.com/questions/968132/c-sharp-private-static-and-readonly\">C# <code>private</code>, <code>static</code>, and\n  <code>readonly</code></a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1312.json",
    "content": "{\n  \"title\": \"Logger fields should be \\\"private static readonly\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"convention\",\n    \"logging\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1312\",\n  \"sqKey\": \"S1312\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1313.html",
    "content": "<p>Hardcoding IP addresses is security-sensitive. It has led in the past to the following vulnerabilities:</p>\n<ul>\n  <li><a href=\"https://www.cve.org/CVERecord?id=CVE-2006-5901\">CVE-2006-5901</a></li>\n  <li><a href=\"https://www.cve.org/CVERecord?id=CVE-2005-3725\">CVE-2005-3725</a></li>\n</ul>\n<p>Today’s services have an ever-changing architecture due to their scaling and redundancy needs. It is a mistake to think that a service will always\nhave the same IP address. When it does change, the hardcoded IP will have to be modified too. This will have an impact on the product development,\ndelivery, and deployment:</p>\n<ul>\n  <li>The developers will have to do a rapid fix every time this happens, instead of having an operation team change a configuration file.</li>\n  <li>It misleads to use the same address in every environment (dev, sys, qa, prod).</li>\n</ul>\n<p>Last but not least it has an effect on application security. Attackers might be able to decompile the code and thereby discover a potentially\nsensitive address. They can perform a Denial of Service attack on the service, try to get access to the system, or try to spoof the IP address to\nbypass security checks. Such attacks can always be possible, but in the case of a hardcoded IP address solving the issue will take more time, which\nwill increase an attack’s impact.</p>\n<h2>Ask Yourself Whether</h2>\n<p>The disclosed IP address is sensitive, e.g.:</p>\n<ul>\n  <li>Can give information to an attacker about the network topology.</li>\n  <li>It’s a personal (assigned to an identifiable person) IP address.</li>\n</ul>\n<p>There is a risk if you answered yes to any of these questions.</p>\n<h2>Recommended Secure Coding Practices</h2>\n<p>Don’t hard-code the IP address in the source code, instead make it configurable with environment variables, configuration files, or a similar\napproach. Alternatively, if confidentially is not required a domain name can be used since it allows to change the destination quickly without having\nto rebuild the software.</p>\n<h2>Sensitive Code Example</h2>\n<pre>\nvar ip = \"192.168.12.42\";\nvar address = IPAddress.Parse(ip);\n</pre>\n<h2>Compliant Solution</h2>\n<pre>\nvar ip = ConfigurationManager.AppSettings[\"myapplication.ip\"];\nvar address = IPAddress.Parse(ip);\n</pre>\n<h2>Exceptions</h2>\n<p>No issue is reported for the following cases because they are not considered sensitive:</p>\n<ul>\n  <li>Loopback addresses 127.0.0.0/8 in CIDR notation (from 127.0.0.0 to 127.255.255.255)</li>\n  <li>Broadcast address 255.255.255.255</li>\n  <li>Non-routable address 0.0.0.0</li>\n  <li>Strings of the form <code>2.5.&lt;number&gt;.&lt;number&gt;</code> as they <a href=\"https://en.wikipedia.org/wiki/Object_identifier\">often match\n  Object Identifiers</a> (OID)</li>\n  <li>Addresses in the ranges 192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24, reserved for documentation purposes by <a\n  href=\"https://datatracker.ietf.org/doc/html/rfc5737\">RFC 5737</a></li>\n  <li>Addresses in the range 2001:db8::/32, reserved for documentation purposes by <a href=\"https://datatracker.ietf.org/doc/html/rfc3849\">RFC\n  3849</a></li>\n</ul>\n<h2>See</h2>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A01_2021-Broken_Access_Control/\">Top 10 2021 Category A1 - Broken Access Control</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure\">Top 10 2017 Category A3 - Sensitive Data\n  Exposure</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1313.json",
    "content": "{\n  \"title\": \"Using hardcoded IP addresses is security-sensitive\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1313\",\n  \"sqKey\": \"S1313\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"OWASP\": [\n      \"A3\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A1\"\n    ],\n    \"CWE\": [\n      547\n    ]\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S134.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Nested control flow statements <code>if</code>, <code>switch</code>, <code>for</code>, <code>foreach</code>, <code>while</code>, <code>do</code>,\nand <code>try</code> are often key ingredients in creating what’s known as \"Spaghetti code\". This code smell can make your program difficult to\nunderstand and maintain.</p>\n<p>When numerous control structures are placed inside one another, the code becomes a tangled, complex web. This significantly reduces the code’s\nreadability and maintainability, and it also complicates the testing process.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<p>The following example demonstrates the behavior of the rule with the default threshold of 3 levels of nesting and one of the potential ways to fix\nthe code smell by introducing guard clauses:</p>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nif (condition1)                  // Compliant - depth = 1\n{\n  /* ... */\n  if (condition2)                // Compliant - depth = 2\n  {\n    /* ... */\n    for (int i = 0; i &lt; 10; i++)  // Compliant - depth = 3\n    {\n      /* ... */\n      if (condition4)            // Noncompliant - depth = 4, which exceeds the limit\n      {\n        if (condition5)          // Depth = 5, exceeding the limit, but issues are only reported on depth = 4\n        {\n          /* ... */\n        }\n        return;\n      }\n    }\n  }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nif (!condition1)\n{\n  return;\n}\n/* ... */\nif (!condition2)\n{\n  return;\n}\nfor (int i = 0; i &lt; 10; i++)\n{\n  /* ... */\n  if (condition4)\n  {\n    if (condition5)\n    {\n      /* ... */\n    }\n    return;\n  }\n}\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Guard_(computer_science)\">Guard clauses in programming</a> - one of the approaches to reducing the depth\n  of nesting</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S134.json",
    "content": "{\n  \"title\": \"Control flow statements \\\"if\\\", \\\"switch\\\", \\\"for\\\", \\\"foreach\\\", \\\"while\\\", \\\"do\\\"  and \\\"try\\\" should not be nested too deeply\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"FOCUSED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"brain-overload\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-134\",\n  \"sqKey\": \"S134\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S138.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>A function that grows too large tends to aggregate too many responsibilities.</p>\n<p>Such functions inevitably become harder to understand and therefore harder to maintain.</p>\n<p>Above a specific threshold, it is strongly advised to refactor into smaller functions which focus on well-defined tasks.</p>\n<p>Those smaller functions will not only be easier to understand, but also probably easier to test.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S138.json",
    "content": "{\n  \"title\": \"Functions should not have too many lines of code\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"FOCUSED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"brain-overload\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-138\",\n  \"sqKey\": \"S138\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1449.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><code>string.ToLower()</code>, <code>ToUpper</code>, <code>IndexOf</code>, <code>LastIndexOf</code>, and <code>Compare</code> are all\nculture-dependent, as are some (floating point number and <code>DateTime</code>-related) calls to <code>ToString</code>. Fortunately, all have\nvariants which accept an argument specifying the culture or formatter to use. Leave that argument off and the call will use the system default\nculture, possibly creating problems with international characters.</p>\n<p><code>string.CompareTo()</code> is also culture specific, but has no overload that takes a culture information, so instead it’s better to use\n<code>CompareOrdinal</code>, or <code>Compare</code> with culture.</p>\n<p>Calls without a culture may work fine in the system’s \"home\" environment, but break in ways that are extremely difficult to diagnose for customers\nwho use different encodings. Such bugs can be nearly, if not completely, impossible to reproduce when it’s time to fix them.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nvar lowered = someString.ToLower(); //Noncompliant\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nvar lowered = someString.ToLower(CultureInfo.InvariantCulture);\n</pre>\n<p>or</p>\n<pre>\nvar lowered = someString.ToLowerInvariant();\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1449.json",
    "content": "{\n  \"title\": \"Culture should be specified for \\\"string\\\" operations\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"unpredictable\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1449\",\n  \"sqKey\": \"S1449\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1450.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When the value of a private field is always assigned to in a class' methods before being read, then it is not being used to store class\ninformation. Therefore, it should become a local variable in the relevant methods to prevent any misunderstanding.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic class Foo\n{\n  private int singularField;\n\n  public void DoSomething(int x)\n  {\n    singularField = x + 5;\n\n    if (singularField == 0) { /* ... */ }\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic class Foo\n{\n  public void DoSomething(int x)\n  {\n    int localVariable = x + 5;\n\n    if (localVariable == 0) { /* ... */ }\n  }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1450.json",
    "content": "{\n  \"title\": \"Private fields only used as local variables in methods should become local variables\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1450\",\n  \"sqKey\": \"S1450\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1451.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Each source file should start with a header stating file ownership and the license which must be used to distribute the application.</p>\n<p>This rule must be fed with the header text that is expected at the beginning of every file.</p>\n<p>The <code>headerFormat</code> must end with an empty line if you want to have an empty line between the file header and the first line for your\nsource file (<code>using</code>, <code>namespace</code>…​).</p>\n<p>For example, if you want the source file to look like this</p>\n<pre>\n// Copyright (c) SonarSource. All Rights Reserved. Licensed under the LGPL License.  See License.txt in the project root for license information.\n\nnamespace Foo\n{\n}\n</pre>\n<p>then the <code>headerFormat</code> parameter should end with an empty line like this</p>\n<pre>\n// Copyright (c) SonarSource. All Rights Reserved. Licensed under the LGPL License.  See License.txt in the project root for license information.\n</pre>\n<h3>Compliant solution</h3>\n<pre>\n/*\n * SonarQube, open source software quality management tool.\n * Copyright (C) 2008-2013 SonarSource\n * mailto:contact AT sonarsource DOT com\n *\n * SonarQube is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 3 of the License, or (at your option) any later version.\n *\n * SonarQube is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this program; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\n */\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1451.json",
    "content": "{\n  \"title\": \"Track lack of copyright and license headers\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"LAWFUL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-1451\",\n  \"sqKey\": \"S1451\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1479.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/selection-statements#the-switch-statement\">switch</a>\nstatements have large sets of multi-line <code>case</code> clauses, the code becomes hard to read and maintain.</p>\n<p>For example, the <a href=\"https://www.sonarsource.com/docs/CognitiveComplexity.pdf\">Cognitive Complexity</a> is going to be particularly high.</p>\n<p>In such scenarios, it’s better to refactor the <code>switch</code> to only have single-line case clauses.</p>\n<p>When all the <code>case</code> clauses of a <code>switch</code> statement are single-line, the readability of the code is not affected. Moreover,\n<code>switch</code> statements with single-line <code>case</code> clauses can easily be converted into <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/switch-expression\"><code>switch</code> expressions</a>, which are\nmore concise for assignment and avoid the need for <code>break</code> statements.</p>\n<h3>Exceptions</h3>\n<p>This rule ignores:</p>\n<ul>\n  <li><code>switch</code> statements over <code>Enum</code> arguments</li>\n  <li>fall-through cases</li>\n  <li><code>return</code>, <code>break</code> and <code>throw</code> statements in case clauses</li>\n</ul>\n<h2>How to fix it</h2>\n<p>Extract the logic of multi-line <code>case</code> clauses into separate methods.</p>\n<h3>Code examples</h3>\n<p>The examples below use the \"Maximum number of case\" property set to <code>4</code>.</p>\n<p>Note that from C# 8, you can use <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/switch-expression\"><code>switch</code> expression</a>.</p>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic int MapChar(char ch, int value)\n{\n    switch(ch) // Noncompliant\n    {\n        case 'a':\n            return 1;\n        case 'b':\n            return 2;\n        case 'c':\n            return 3;\n        // ...\n        case '-':\n            if (value &gt; 10)\n            {\n                return 42;\n            }\n            else if (value &lt; 5 &amp;&amp; value &gt; 1)\n            {\n                return 21;\n            }\n            return 99;\n        default:\n            return 1000;\n    }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic int MapChar(char ch, int value)\n{\n    switch(ch) // Compliant: All 5 cases are single line statements\n    {\n        case 'a':\n            return 1;\n        case 'b':\n            return 2;\n        case 'c':\n            return 3;\n        // ...\n        case '-':\n            return HandleDash(value);\n        default:\n            return 1000;\n    }\n}\n\nprivate int HandleDash(int value)\n{\n    if (value &gt; 10)\n    {\n        return 42;\n    }\n    else if (value &lt; 5 &amp;&amp; value &gt; 1)\n    {\n        return 21;\n    }\n    return 99;\n}\n</pre>\n<p>For this example, a <code>switch</code> expression is more concise and clear:</p>\n<pre>\npublic int MapChar(char ch, int value) =&gt;\n    ch switch // Compliant\n    {\n        'a' =&gt; 1,\n        'b' =&gt; 2,\n        'c' =&gt; 3,\n        // ...\n        '-' =&gt; HandleDash(value),\n        _ =&gt; 1000,\n    };\n\nprivate int HandleDash(int value)\n{\n    if (value &gt; 10)\n    {\n        return 42;\n    }\n    else if (value &lt; 5 &amp;&amp; value &gt; 1)\n    {\n        return 21;\n    }\n    return 99;\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Sonar - <a href=\"https://www.sonarsource.com/docs/CognitiveComplexity.pdf\">Cognitive Complexity</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/selection-statements#the-switch-statement\">The\n  <code>switch</code> statement</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/switch-expression\">C#: Switch\n  Expression</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1479.json",
    "content": "{\n  \"title\": \"\\\"switch\\\" statements with many \\\"case\\\" clauses should have only one statement\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"FOCUSED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"tags\": [\n    \"brain-overload\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1479\",\n  \"sqKey\": \"S1479\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1481.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>An unused local variable is a variable that has been declared but is not used anywhere in the block of code where it is defined. It is dead code,\ncontributing to unnecessary complexity and leading to confusion when reading the code. Therefore, it should be removed from your code to maintain\nclarity and efficiency.</p>\n<h3>What is the potential impact?</h3>\n<p>Having unused local variables in your code can lead to several issues:</p>\n<ul>\n  <li><strong>Decreased Readability</strong>: Unused variables can make your code more difficult to read. They add extra lines and complexity, which\n  can distract from the main logic of the code.</li>\n  <li><strong>Misunderstanding</strong>: When other developers read your code, they may wonder why a variable is declared but not used. This can lead\n  to confusion and misinterpretation of the code’s intent.</li>\n  <li><strong>Potential for Bugs</strong>: If a variable is declared but not used, it might indicate a bug or incomplete code. For example, if you\n  declared a variable intending to use it in a calculation, but then forgot to do so, your program might not work as expected.</li>\n  <li><strong>Maintenance Issues</strong>: Unused variables can make code maintenance more difficult. If a programmer sees an unused variable, they\n  might think it is a mistake and try to 'fix' the code, potentially introducing new bugs.</li>\n  <li><strong>Memory Usage</strong>: Although modern compilers are smart enough to ignore unused variables, not all compilers do this. In such cases,\n  unused variables take up memory space, leading to inefficient use of resources.</li>\n</ul>\n<p>In summary, unused local variables can make your code less readable, more confusing, and harder to maintain, and they can potentially lead to bugs\nor inefficient memory use. Therefore, it is best to remove them.</p>\n<h3>Exceptions</h3>\n<p>Unused locally created resources in a <code>using</code> statement are not reported.</p>\n<pre>\nusing(var t = new TestTimer()) // t never used, but compliant.\n{\n  //...\n}\n</pre>\n<h2>How to fix it</h2>\n<p>The fix for this issue is straightforward. Once you ensure the unused variable is not part of an incomplete implementation leading to bugs, you\njust need to remove it.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic int NumberOfMinutes(int hours)\n{\n  int seconds = 0;   // Noncompliant - seconds is unused\n  return hours * 60;\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic int NumberOfMinutes(int hours)\n{\n  return hours * 60;\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1481.json",
    "content": "{\n  \"title\": \"Unused local variables should be removed\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"unused\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1481\",\n  \"sqKey\": \"S1481\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1541.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The cyclomatic complexity of methods and properties should not exceed a defined threshold. Complex code can perform poorly and will in any case be\ndifficult to understand and therefore to maintain.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1541.json",
    "content": "{\n  \"title\": \"Methods and properties should not be too complex\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"FOCUSED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"brain-overload\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-1541\",\n  \"sqKey\": \"S1541\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1607.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When a test fails due, for example, to infrastructure issues, you might want to ignore it temporarily. But without some kind of notation about why\nthe test is being ignored, it may never be reactivated. Such tests are difficult to address without comprehensive knowledge of the project, and end up\npolluting their projects.</p>\n<p>This rule raises an issue for each ignored test that does not have a <code>WorkItem</code> attribute nor a comment about why it is being skipped on\nthe right side of the <code>Ignore</code> attribute.</p>\n<h3>Noncompliant code example</h3>\n<pre>\n[TestMethod]\n[Ignore]\npublic void Test_DoTheThing()\n{\n  // ...\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\n[TestMethod]\n[Ignore]  // renable when TCKT-1234 is fixed\npublic void Test_DoTheThing()\n{\n  // ...\n}\n</pre>\n<p>or</p>\n<pre>\n[TestMethod]\n[Ignore]\n[WorkItem(1234)]\npublic void Test_DoTheThing()\n{\n  // ...\n}\n</pre>\n<h3>Exceptions</h3>\n<p>The rule doesn’t raise an issue if:</p>\n<ul>\n  <li>the test method is also marked with <code>WorkItem</code> attribute</li>\n  <li>there is a comment on the right side of the <code>Ignore</code> attribute</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1607.json",
    "content": "{\n  \"title\": \"Tests should not be ignored\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"TESTED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"tests\",\n    \"bad-practice\",\n    \"confusing\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1607\",\n  \"sqKey\": \"S1607\",\n  \"scope\": \"Tests\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1643.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Concatenating multiple string literals or strings using the <code>+</code> operator creates a new string object for each concatenation. This can\nlead to a large number of intermediate string objects and can be inefficient. The <code>StringBuilder</code> class is more efficient than string\nconcatenation, especially when the operator is repeated over and over as in loops.</p>\n<h2>How to fix it</h2>\n<p>Replace string concatenation with <code>StringBuilder</code>.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nstring str = \"\";\nfor (int i = 0; i &lt; arrayOfStrings.Length ; ++i)\n{\n  str = str + arrayOfStrings[i];\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nStringBuilder bld = new StringBuilder();\nfor (int i = 0; i &lt; arrayOfStrings.Length; ++i)\n{\n  bld.Append(arrayOfStrings[i]);\n}\nstring str = bld.ToString();\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.text.stringbuilder\">StringBuilder Class</a></li>\n</ul>\n<h3>Benchmarks</h3>\n<table>\n  <colgroup>\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>Method</th>\n      <th>Runtime</th>\n      <th>Mean</th>\n      <th>Standard Deviation</th>\n      <th>Allocated</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p>StringConcatenation</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>50,530.75 us</p>\n      </td>\n      <td>\n        <p>2,699.189 us</p>\n      </td>\n      <td>\n        <p>586280.70 KB</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>StringBuilder</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>82.31 us</p>\n      </td>\n      <td>\n        <p>3.387 us</p>\n      </td>\n      <td>\n        <p>243.79 KB</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>StringConcatenation</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>37,453.72 us</p>\n      </td>\n      <td>\n        <p>1,543.051 us</p>\n      </td>\n      <td>\n        <p>586450.38 KB</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>StringBuilder</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>178.32 us</p>\n      </td>\n      <td>\n        <p>6.148 us</p>\n      </td>\n      <td>\n        <p>244.15 KB</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h4>Glossary</h4>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Arithmetic_mean\">Mean</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Standard_deviation\">Standard Deviation</a></li>\n</ul>\n<p>The results were generated by running the following snippet with <a href=\"https://github.com/dotnet/BenchmarkDotNet\">BenchmarkDotNet</a>:</p>\n<pre>\n[Params(10_000)]\npublic int Iterations;\n\n[Benchmark]\npublic void StringConcatenation()\n{\n    string str = \"\";\n    for (int i = 0; i &lt; Iterations; i++)\n    {\n        str = str + \"append\";\n    }\n}\n\n[Benchmark]\npublic void StringBuilder()\n{\n    StringBuilder builder = new StringBuilder();\n    for (int i = 0; i &lt; Iterations; i++)\n    {\n        builder.Append(\"append\");\n    }\n    _ = builder.ToString();\n}\n</pre>\n<p>Hardware Configuration:</p>\n<pre>\nBenchmarkDotNet v0.14.0, Windows 10 (10.0.19045.5247/22H2/2022Update)\n12th Gen Intel Core i7-12800H, 1 CPU, 20 logical and 14 physical cores\n  [Host]               : .NET Framework 4.8.1 (4.8.9282.0), X64 RyuJIT VectorSize=256\n  .NET 9.0             : .NET 9.0.0 (9.0.24.52809), X64 RyuJIT AVX2\n  .NET Framework 4.8.1 : .NET Framework 4.8.1 (4.8.9282.0), X64 RyuJIT VectorSize=256\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1643.json",
    "content": "{\n  \"title\": \"Strings should not be concatenated using \\u0027+\\u0027 in a loop\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1643\",\n  \"sqKey\": \"S1643\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1656.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Re-assigning a variable to itself is a defect as it has no actual effect and indicates meaning to do something else. It usually means that:</p>\n<ul>\n  <li>The statement is redundant and should be removed</li>\n  <li>The re-assignment is a mistake, and another value or variable was intended for the assignment instead</li>\n</ul>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic class Choice {\n    private bool selected;\n\n    public void MakeChoice(bool selected)\n    {\n        selected = selected; // Noncompliant\n    }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic class Choice {\n    private bool selected;\n\n    public void MakeChoice(bool selected)\n    {\n        this.selected = selected; // Compliant\n    }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/misc/cs1717\">Compiler Warning (level 3) CS1717</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1656.json",
    "content": "{\n  \"title\": \"Variables should not be self-assigned\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"3min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1656\",\n  \"sqKey\": \"S1656\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1659.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Declaring multiple variable on one line is difficult to read.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nclass MyClass\n{\n  private int a, b; // Noncompliant\n\n  public void Method()\n  {\n    int c, d; // Noncompliant\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nclass MyClass\n{\n  private int a;\n  private int b;\n\n  public void Method()\n  {\n    int c;\n    int d;\n  }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1659.json",
    "content": "{\n  \"title\": \"Multiple variables should not be declared on the same line\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"FORMATTED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1659\",\n  \"sqKey\": \"S1659\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1694.html",
    "content": "<p>A <code>class</code> with only <code>abstract</code> methods and no inheritable behavior should be converted to an <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/interfaces/\"><code>interface</code></a>.</p>\n<h2>Why is this an issue?</h2>\n<p>The purpose of an <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/abstract-and-sealed-classes-and-class-members\"><code>abstract</code>\nclass</a> is to provide some overridable behaviors while also defining methods that are required to be implemented by sub-classes.</p>\n<p>A class that contains only <code>abstract</code> methods, often called pure abstract class, is effectively an interface, but with the disadvantage\nof not being able to be implemented by multiple classes.</p>\n<p>Using interfaces over pure abstract classes presents multiple advantages:</p>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Multiple_inheritance\"><strong>Multiple Inheritance</strong></a>: Unlike classes, an interface doesn’t\n  count towards the single inheritance limit in C#. This means a class can implement multiple interfaces, which can be useful when you need to define\n  behavior that can be shared across multiple classes.</li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Loose_coupling#In_programming\"><strong>Loose Coupling</strong></a>: Interfaces provide a way to achieve\n  loose coupling between classes. This is because an interface only specifies what methods a class must have, but not how they are implemented. This\n  makes it easier to swap out implementations without changing the code that uses them.</li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Polymorphism_(computer_science)\"><strong>Polymorphism</strong></a>: Interfaces allow you to use\n  polymorphism, which means you can use an interface type to refer to any object that implements that interface. This can be useful when you want to\n  write code that can work with any class that implements a certain interface, <em>without knowing what the actual class is</em>.</li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Design_by_contract\"><strong>Design by contract</strong></a>: Interfaces provide a clear contract of what\n  a class should do, without specifying how it should do it. This makes it easier to understand the intended behavior of a class, and to ensure that\n  different implementations of an interface are consistent with each other.</li>\n</ul>\n<h3>Exceptions</h3>\n<p><code>abstract</code> classes that contain non-abstract methods, in addition to <code>abstract</code> ones, cannot easily be converted to\ninterfaces, and are not the subject of this rule:</p>\n<pre>\npublic abstract class Lamp // Compliant: Glow is abstract, but FlipSwitch is not\n{\n  private bool switchLamp = false;\n\n  public abstract void Glow();\n\n  public void FlipSwitch()\n  {\n    switchLamp = !switchLamp;\n    if (switchLamp)\n    {\n      Glow();\n    }\n  }\n}\n</pre>\n<p>Notice that, since C# 8.0, you can also define <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/advanced-topics/interface-implementation/default-interface-methods-versions\">default\nimplementations for interface methods</a>, which is yet another reason to prefer interfaces over abstract classes when you don’t need to provide any\ninheritable behavior.</p>\n<p>However, interfaces cannot have fields (such as <code>switchLamp</code> in the example above), and that remains true even in C# 8.0 and upwards.\nThis can be a valid reason to still prefer an abstract class over an interface.</p>\n<h2>How to fix it</h2>\n<p>Convert the <code>abstract</code> class to an <code>interface</code> with the same methods.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic abstract class Animal // Noncompliant: should be an interface\n{\n  public abstract void Move();\n  public abstract void Feed();\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic interface Animal\n{\n  void Move();\n  void Feed();\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/abstract-and-sealed-classes-and-class-members\">Abstract\n  and Sealed Classes and Class Members (C# Programming Guide)</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/interfaces/\">Interfaces - define behavior for\n  multiple types</a></li>\n  <li>C# Language Design - <a href=\"https://github.com/dotnet/csharplang/blob/main/proposals/csharp-8.0/default-interface-methods.md\">Default\n  Interface Methods</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/advanced-topics/interface-implementation/default-interface-methods-versions\">Tutorial: Update\n  interfaces with default interface methods</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/object-oriented/inheritance\">Inheritance - derive types\n  to create more specialized behavior</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Multiple_inheritance\">Multiple Inheritance</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Loose_coupling#In_programming\">Loose Coupling - In programming</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Polymorphism_(computer_science)\">Polymorphism (computer science)</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Design_by_contract\">Design by contract</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1694.json",
    "content": "{\n  \"title\": \"An abstract class should have both abstract and concrete methods\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1694\",\n  \"sqKey\": \"S1694\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1696.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Catching <code>NullReferenceException</code> is generally considered a bad practice because it can hide bugs in your code. Instead of catching this\nexception, you should aim to prevent it. This makes your code more robust and easier to understand. In addition, constantly catching and handling\n<code>NullReferenceException</code> can lead to performance issues. Exceptions are expensive in terms of system resources, so they should be used\ncautiously and only for exceptional conditions, not for regular control flow.</p>\n<h2>How to fix it</h2>\n<p>Instead of catching NullReferenceException, it’s better to prevent it from happening in the first place. You can do this by using null checks or\nnull conditional operators (<code>?.</code>) before accessing members of an object.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic int GetLengthPlusTwo(string str)\n{\n    try\n    {\n        return str.Length + 2;\n    }\n    catch (NullReferenceException e)\n    {\n        return 2;\n    }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic int GetLengthPlusTwo(string str)\n{\n    if (str is null)\n    {\n        return 2;\n    }\n    return str.Length + 2;\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/395\">CWE-395 - Use of NullPointerException Catch to Detect NULL Pointer\n  Dereference</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.nullreferenceexception\">NullReferenceException class</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/member-access-operators#null-conditional-operators--and-\">Null-conditional operators ?. and ?[]</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1696.json",
    "content": "{\n  \"title\": \"NullReferenceException should not be caught\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"error-handling\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1696\",\n  \"sqKey\": \"S1696\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      395\n    ]\n  },\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1698.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Using the equality <code>==</code> and inequality <code>!=</code> operators to compare two objects generally works. The operators can be\noverloaded, and therefore the comparison can resolve to the appropriate method. However, when the operators are used on interface instances, then\n<code>==</code> resolves to reference equality, which may result in unexpected behavior if implementing classes override <code>Equals</code>.\nSimilarly, when a class overrides <code>Equals</code>, but instances are compared with non-overloaded <code>==</code>, there is a high chance that\nvalue comparison was meant instead of the reference one.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic interface IMyInterface\n{\n}\n\npublic class MyClass : IMyInterface\n{\n    public override bool Equals(object obj)\n    {\n        //...\n    }\n}\n\npublic class Program\n{\n    public static void Method(IMyInterface instance1, IMyInterface instance2)\n    {\n        if (instance1 == instance2) // Noncompliant, will do reference equality check, but was that intended? MyClass overrides Equals.\n        {\n            Console.WriteLine(\"Equal\");\n        }\n    }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic interface IMyInterface\n{\n}\n\npublic class MyClass : IMyInterface\n{\n    public override bool Equals(object obj)\n    {\n        //...\n    }\n}\n\npublic class Program\n{\n    public static void Method(IMyInterface instance1, IMyInterface instance2)\n    {\n        if (object.Equals(instance1, instance2)) // object.Equals checks for null and then calls the instance based Equals, so MyClass.Equals\n        {\n            Console.WriteLine(\"Equal\");\n        }\n    }\n}\n</pre>\n<h3>Exceptions</h3>\n<p>The rule does not report on comparisons of <code>System.Type</code> instances and on comparisons inside <code>Equals</code> overrides.</p>\n<p>It also does not raise an issue when one of the operands is <code>null</code> nor when one of the operand is cast to <code>object</code> (because\nin this case we want to ensure reference equality even if some <code>==</code> overload is present).</p>\n<h2>Resources</h2>\n<ul>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/595\">CWE-595 - Comparison of Object References Instead of Object Contents</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/597\">CWE-597 - Use of Wrong Operator in String Comparison</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1698.json",
    "content": "{\n  \"title\": \"\\\"\\u003d\\u003d\\\" should not be used when \\\"Equals\\\" is overridden\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1698\",\n  \"sqKey\": \"S1698\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      595,\n      597\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1699.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Calling an overridable method from a constructor could result in failures or strange behaviors when instantiating a subclass which overrides the\nmethod.</p>\n<p>When constructing an object of a derived class, the constructor of the parent class is invoked first, and only then the constructor of the derived\nclass is called. This sequential construction process applies to multiple levels of inheritance as well, starting from the base class and progressing\nto the most derived class.</p>\n<p>If an overridable method is called within the constructor of the parent class, it may inadvertently invoke an overridden implementation in the\nderived class. This can lead to unexpected failures or strange behaviors because the object’s construction is still in progress and may not have\nreached a fully initialized state. Consequently, the overridden method may rely on uninitialized members or have assumptions about the object’s state\nthat are not yet valid.</p>\n<p>For example:</p>\n<pre>\npublic class Parent\n{\n  public Parent()\n  {\n    DoSomething();  // Noncompliant\n  }\n\n  public virtual void DoSomething() // can be overridden\n  {\n    // ...\n  }\n}\n\npublic class Child : Parent\n{\n  private string foo;\n\n  public Child(string foo) // leads to call DoSomething() in Parent constructor which triggers a NullReferenceException as foo has not yet been initialized\n  {\n    this.foo = foo;\n  }\n\n  public override void DoSomething()\n  {\n    Console.WriteLine(this.foo.Length);\n  }\n}\n</pre>\n<ul>\n  <li>The <code>Child</code> class constructor starts by calling the <code>Parent</code> class constructor.</li>\n  <li>The <code>Parent</code> class constructor calls the method <code>DoSomething</code>, which has been overridden in the <code>Child</code>\n  class.</li>\n  <li>If the behavior of the <code>Child</code> class overridden <code>DoSomething</code> method depends on fields that are initialized in the\n  <code>Child</code> class constructor, unexpected behavior (such as a <code>NullReferenceException</code>) can result, because the fields aren’t\n  initialized yet.</li>\n</ul>\n<h2>How to fix it</h2>\n<p>Depending on the context, you can either:</p>\n<ul>\n  <li>avoid calling overridable methods from constructors. This is the recommended approach</li>\n  <li>ensure that the method is not overridden in any derived classes. This can be done by marking the method as <code>sealed</code> in the current\n  class</li>\n  <li>ensure that the class is not inherited from. This can be done by marking the class as <code>sealed</code></li>\n</ul>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nclass Parent\n{\n  public virtual void DoSomething() { }\n}\n\nclass Child : Parent\n{\n  public Child()\n  {\n    DoSomething();  // Noncompliant\n  }\n}\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nclass Parent\n{\n  public virtual void DoSomething() { }\n}\n\nclass Child : Parent\n{\n  public Child()\n  {\n    DoSomething();  // Noncompliant\n  }\n}\n</pre>\n<pre data-diff-id=\"3\" data-diff-type=\"noncompliant\">\nclass Parent\n{\n  public virtual void DoSomething() { }\n}\n\nclass Child : Parent\n{\n  public Child()\n  {\n    DoSomething();  // Noncompliant\n  }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nclass Parent\n{\n  public virtual void DoSomething() { }\n}\n\nclass Child : Parent\n{\n  public Child()\n  {\n    // Call removed\n  }\n}\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nclass Parent\n{\n  public virtual void DoSomething() { }\n}\n\nclass Child : Parent\n{\n  public Child()\n  {\n    DoSomething();\n  }\n\n  // Method sealed to prevent overriding\n  public sealed override void DoSomething()\n  {\n    base.DoSomething();\n  }\n}\n</pre>\n<pre data-diff-id=\"3\" data-diff-type=\"compliant\">\nclass Parent\n{\n  public virtual void DoSomething() { }\n}\n\n// Class sealed to prevent inheritance\nsealed class Child : Parent\n{\n  public Child()\n  {\n    DoSomething();\n  }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/constructors\">Constructors</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/object-oriented/inheritance\">Inheritance</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/object-oriented/polymorphism\">Polimorphism</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/methods#method-signatures\">Methods - Method\n  signatures</a></li>\n  <li>Stack Overflow - Answer by Eric Lippert for <a href=\"https://stackoverflow.com/a/20418640\">Overriding and calling same method in Base class\n  constructor in C#</a></li>\n  <li>Fabulous adventures in coding - <a\n  href=\"https://ericlippert.com/2008/02/15/why-do-initializers-run-in-the-opposite-order-as-constructors-part-one\">Why Do Initializers Run In The\n  Opposite Order As Constructors?</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1699.json",
    "content": "{\n  \"title\": \"Constructors should only call non-overridable methods\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-1699\",\n  \"sqKey\": \"S1699\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1751.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>A <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/iteration-statements\">loop statement</a> with at most one\niteration is equivalent to an <code>if</code> statement; the following block is executed only once.</p>\n<p>If the initial intention was to conditionally execute the block only once, an <code>if</code> statement should be used instead. If that was not the\ninitial intention, the block of the loop should be fixed so the block is executed multiple times.</p>\n<p>A loop statement with at most one iteration can happen when a statement unconditionally transfers control, such as a <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/jump-statements\">jump statement</a> or a <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/exception-handling-statements#the-throw-statement\">throw\nstatement</a>, is misplaced inside the loop block.</p>\n<p>This rule raises when the following statements are misplaced:</p>\n<ul>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/jump-statements#the-break-statement\"><code>break</code></a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/jump-statements#the-continue-statement\"><code>continue</code></a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/jump-statements#the-return-statement\"><code>return</code></a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/exception-handling-statements#the-throw-statement\"><code>throw</code></a></li>\n</ul>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic object Method(IEnumerable&lt;object&gt; items)\n{\n    for (int i = 0; i &lt; 10; i++)\n    {\n        Console.WriteLine(i);\n        break; // Noncompliant: loop only executes once\n    }\n\n    foreach (object item in items)\n    {\n        return item; // Noncompliant: loop only executes once\n    }\n    return null;\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic object Method(IEnumerable&lt;object&gt; items)\n{\n    for (int i = 0; i &lt; 10; i++)\n    {\n        Console.WriteLine(i);\n    }\n\n    var item = items.FirstOrDefault();\n    if (item != null)\n    {\n        return item;\n    }\n    return null;\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/iteration-statements\">Iteration\n  statements - <code>for</code>, <code>foreach</code>, <code>do</code>, and <code>while</code></a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/jump-statements\">Jump statements -\n  <code>break</code>, <code>continue</code>, <code>return</code>, and <code>goto</code></a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/exception-handling-statements#the-throw-statement\">The\n  <code>throw</code> statement</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1751.json",
    "content": "{\n  \"title\": \"Loops with at most one iteration should be refactored\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"confusing\",\n    \"bad-practice\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1751\",\n  \"sqKey\": \"S1751\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1764.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Using the same value on both sides of certain operators is a code defect. In the case of logical operators, it is either a copy/paste error and,\ntherefore, a bug, or it is simply duplicated code and should be simplified. For bitwise operators and most binary mathematical operators, having the\nsame value on both sides of an operator yields predictable results and should be simplified as well to avoid further code defects.</p>\n<p>This rule raises for the following operators.</p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/equality-operators\">Equality operators</a>\n  (<code>==</code> and <code>!=</code>)</li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/comparison-operators\">Comparison operators</a> (<code>&lt;\n  =</code>, <code>&lt;</code>, <code>&gt;</code>, <code>&gt;=</code>)</li>\n  <li>The following <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/boolean-logical-operators\">Logical\n  Operators</a>:\n    <ul>\n      <li>Logical OR (<code>|</code> )</li>\n      <li>Conditional logical OR (<code>||</code>)</li>\n      <li>Logical AND (<code>&amp;</code>)</li>\n      <li>Conditional logical AND (<code>&amp;&amp;</code>)</li>\n      <li>Logical exclusive OR (<code>^</code>)</li>\n    </ul></li>\n  <li>The following <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/arithmetic-operators\">arithmetic\n  operators</a>:\n    <ul>\n      <li>Subtraction (<code>-</code>)</li>\n      <li>Division (<code>\\</code>)</li>\n      <li>Remainder operator (<code>%</code>)</li>\n      <li>Subtraction assignment operator (<code>-=</code>)</li>\n      <li>Divide assignment operator (<code>\\=</code>)</li>\n    </ul></li>\n</ul>\n<h3>Exceptions</h3>\n<p>This rule ignores the following operators:</p>\n<ul>\n  <li>Multiplication (*)</li>\n  <li>Addition (+)</li>\n  <li>Assignment (=)</li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/bitwise-and-shift-operators#left-shift-operator-\">Left-shift\n  (&lt;&lt;)</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/bitwise-and-shift-operators#right-shift-operator-\">Right-shift\n  (&gt;&gt;)</a></li>\n</ul>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre>\nif ( a == a ) // always true\n{\n  doZ();\n}\nif ( a != a ) // always false\n{\n  doY();\n}\nif ( a == b &amp;&amp; a == b ) // if the first one is true, the second one is too\n{\n  doX();\n}\nif ( a == b || a == b ) // if the first one is true, the second one is too\n{\n  doW();\n}\n\nint j = 5 / 5; // always 1\nint k = 5 - 5; // always 0\n\nc.Equals(c);    // always true\nObject.Equals(c, c); // always true\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/arithmetic-operators\">Arithmetic Operators</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/boolean-logical-operators\">Boolean logical\n  operators</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/bitwise-and-shift-operators\">Bitwise and shift\n  operators</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/equality-operators\">Equality operators - test if two\n  objects are equal or not</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/comparison-operators\">Comparison operators</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/assignment-operator\">Assignment operators</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1764.json",
    "content": "{\n  \"title\": \"Identical expressions should not be used on both sides of operators\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1764\",\n  \"sqKey\": \"S1764\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1821.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Nested <code>switch</code> structures are difficult to understand because you can easily confuse the cases of an inner <code>switch</code> as\nbelonging to an outer statement. Therefore nested <code>switch</code> statements should be avoided.</p>\n<p>Specifically, you should structure your code to avoid the need for nested <code>switch</code> statements, but if you cannot, then consider moving\nthe inner <code>switch</code> to another function.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1821.json",
    "content": "{\n  \"title\": \"\\\"switch\\\" statements should not be nested\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"FOCUSED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-1821\",\n  \"sqKey\": \"S1821\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1848.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Creating objects that are not used is a vulnerability that can lead to unexpected behavior.</p>\n<p>If this was done intentionally due to side effects in the object’s constructor, the code should be moved to a dedicated method.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic void Method(MyObject myObject)\n{\n    if (myObject is null)\n    {\n        new MyObject(); // Noncompliant\n    }\n\n    if (myObject.IsCorrupted)\n    {\n        new ArgumentException($\"{nameof(myObject)} is corrupted\"); // Noncompliant\n    }\n\n    // ...\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic void Method(MyObject myObject)\n{\n    if (myObject is null)\n    {\n        myObject = new MyObject(); // Compliant\n    }\n\n    if (myObject.IsCorrupted)\n    {\n        throw new ArgumentException($\"{nameof(myObject)} is corrupted\"); // Compliant\n    }\n\n    // ...\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1848.json",
    "content": "{\n  \"title\": \"Objects should not be created to be dropped immediately without being used\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1848\",\n  \"sqKey\": \"S1848\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1854.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Dead stores refer to assignments made to local variables that are subsequently never used or immediately overwritten. Such assignments are\nunnecessary and don’t contribute to the functionality or clarity of the code. They may even negatively impact performance. Removing them enhances code\ncleanliness and readability. Even if the unnecessary operations do not do any harm in terms of the program’s correctness, they are - at best - a waste\nof computing resources.</p>\n<h3>Exceptions</h3>\n<p>No issue is reported when</p>\n<ul>\n  <li>the analyzed method body contains <code>try</code> blocks</li>\n  <li>a lambda expression captures the local variable</li>\n  <li>the variable is unused (case covered by Rule {rule:csharpsquid:S1481})</li>\n  <li>it’s an initialization to <code>-1</code>, <code>0</code>, <code>1</code>, <code>null</code>, <code>true</code>, <code>false</code>,\n  <code>\"\"</code> or <code>string.Empty</code></li>\n</ul>\n<h2>How to fix it</h2>\n<p>Remove the unnecessary assignment, then test the code to make sure that the right-hand side of a given assignment had no side effects (e.g. a\nmethod that writes certain data to a file and returns the number of written bytes).</p>\n<p>You can also use <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/functional/discards\">discards</a> (rather than a variable)\nto express that result of a method call is ignored on purpose.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nint Foo(int y)\n{\n  int x = 100; // Noncompliant: dead store\n  x = 150;     // Noncompliant: dead store\n  x = 200;\n  return x + y;\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nint Foo(int y)\n{\n  int x = 200; // Compliant: no unnecessary assignment\n  return x + y;\n}\n</pre>\n<h2>Resources</h2>\n<h3>Standards</h3>\n<ul>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/563\">CWE-563 - Assignment to Variable without Use ('Unused Variable')</a></li>\n</ul>\n<h3>Related rules</h3>\n<ul>\n  <li>{rule:csharpsquid:S2583} - Conditionally executed code should be reachable</li>\n  <li>{rule:csharpsquid:S2589} - Boolean expressions should not be gratuitous</li>\n  <li>{rule:csharpsquid:S3626} - Jump statements should not be redundant</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1854.json",
    "content": "{\n  \"title\": \"Unused assignments should be removed\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"unused\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1854\",\n  \"sqKey\": \"S1854\",\n  \"scope\": \"All\",\n  \"securityStandards\": {\n    \"CWE\": [\n      563\n    ]\n  },\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1858.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Invoking a method designed to return a string representation of an object which is already a string is a waste of keystrokes. Similarly, explicitly\ninvoking <code>ToString()</code> when the compiler would do it implicitly is also needless code-bloat.</p>\n<p>This rule raises an issue when <code>ToString()</code> is invoked:</p>\n<ul>\n  <li>on a <code>string</code></li>\n  <li>on a non-<code>string</code> operand to concatenation</li>\n  <li>on an argument to <code>string.Format</code></li>\n</ul>\n<h3>Noncompliant code example</h3>\n<pre>\nvar s = \"foo\";\nvar t = \"fee fie foe \" + s.ToString();  // Noncompliant\nvar someObject = new object();\nvar u = \"\" + someObject.ToString(); // Noncompliant\nvar v = string.Format(\"{0}\", someObject.ToString()); // Noncompliant\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nvar s = \"foo\";\nvar t = \"fee fie foe \" + s;\nvar someObject = new object();\nvar u = \"\" + someObject;\nvar v = string.Format(\"{0}\", someObject);\n</pre>\n<h3>Exceptions</h3>\n<p>The rule does not report on value types, where leaving off the <code>ToString()</code> call would result in automatic boxing.</p>\n<pre>\nvar v = string.Format(\"{0}\", 1.ToString());\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1858.json",
    "content": "{\n  \"title\": \"\\\"ToString()\\\" calls should not be redundant\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"finding\",\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1858\",\n  \"sqKey\": \"S1858\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1862.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>A chain of <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/selection-statements#the-if-statement\">if/else\nif</a> statements is evaluated from top to bottom. At most, only one branch will be executed: the first statement with a condition that evaluates to\n<code>true</code>. Therefore, duplicating a condition leads to unreachable code inside the duplicated condition block. Usually, this is due to a\ncopy/paste error.</p>\n<p>The result of such duplication can lead to unreachable code or even to unexpected behavior.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nif (param == 1)\n{\n  OpenWindow();\n}\nelse if (param == 2)\n{\n  CloseWindow();\n}\nelse if (param == 1) // Noncompliant: condition has already been checked\n{\n  MoveWindowToTheBackground(); // unreachable code\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nif (param == 1)\n{\n  OpenWindow();\n}\nelse if (param == 2)\n{\n  CloseWindow();\n}\nelse if (param == 3)\n{\n  MoveWindowToTheBackground();\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/selection-statements#the-if-statement\">The if\n  statement</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1862.json",
    "content": "{\n  \"title\": \"Related \\\"if\\/else if\\\" statements should not have the same condition\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"unused\",\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1862\",\n  \"sqKey\": \"S1862\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1871.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When the same code is duplicated in two or more separate branches of a conditional, it can make the code harder to understand, maintain, and can\npotentially introduce bugs if one instance of the code is changed but others are not.</p>\n<p>Having two <code>cases</code> in a <code>switch</code> statement or two branches in an <code>if</code> chain with the same implementation is at\nbest duplicate code, and at worst a coding error.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nif (a &gt;= 0 &amp;&amp; a &lt; 10)\n{\n  DoFirst();\n  DoTheThing();\n}\nelse if (a &gt;= 10 &amp;&amp; a &lt; 20)\n{\n  DoTheOtherThing();\n}\nelse if (a &gt;= 20 &amp;&amp; a &lt; 50) // Noncompliant; duplicates first condition\n{\n  DoFirst();\n  DoTheThing();\n}\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nswitch (i)\n{\n  case 1:\n    DoFirst();\n    DoSomething();\n    break;\n  case 2:\n    DoSomethingDifferent();\n    break;\n  case 3:  // Noncompliant; duplicates case 1's implementation\n    DoFirst();\n    DoSomething();\n    break;\n  default:\n    DoTheRest();\n}\n</pre>\n<p>If the same logic is truly needed for both instances, then:</p>\n<ul>\n  <li>in an <code>if</code> chain they should be combined</li>\n</ul>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nif ((a &gt;= 0 &amp;&amp; a &lt; 10) || (a &gt;= 20 &amp;&amp; a &lt; 50))\n{\n  DoFirst();\n  DoTheThing();\n}\nelse if (a &gt;= 10 &amp;&amp; a &lt; 20)\n{\n  DoTheOtherThing();\n}\n</pre>\n<ul>\n  <li>for a <code>switch</code>, one should fall through to the other</li>\n</ul>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nswitch (i)\n{\n  case 1:\n  case 3:\n    DoFirst();\n    DoSomething();\n    break;\n  case 2:\n    DoSomethingDifferent();\n    break;\n  default:\n    DoTheRest();\n}\n</pre>\n<h3>Exceptions</h3>\n<p>The rule does not raise an issue for blocks in an <code>if</code> chain that contain a single line of code. The same applies to blocks in a\n<code>switch</code> statement that contain a single line of code with or without a following <code>break</code>.</p>\n<pre>\nif (a &gt;= 0 &amp;&amp; a &lt; 10)\n{\n  DoTheThing();\n}\nelse if (a &gt;= 10 &amp;&amp; a &lt; 20)\n{\n  DoTheOtherThing();\n}\nelse if (a &gt;= 20 &amp;&amp; a &lt; 50)    //no issue, usually this is done on purpose to increase the readability\n{\n  DoTheThing();\n}\n</pre>\n<p>However, this exception does not apply to <code>if</code> chains without an <code>else</code> statement or to a <code>switch</code> statement\nwithout a <code>default</code> clause when all branches have the same single line of code.</p>\n<pre>\nif (a == 1)\n{\n  DoSomething();  // Noncompliant, this might have been done on purpose but probably not\n}\nelse if (a == 2)\n{\n  DoSomething();\n}\n</pre>\n<h2>Resources</h2>\n<h3>Related rules</h3>\n<ul>\n  <li>{rule:csharpsquid:S3923} - All branches in a conditional structure should not have exactly the same implementation</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1871.json",
    "content": "{\n  \"title\": \"Two branches in a conditional structure should not have exactly the same implementation\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"DISTINCT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"design\",\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1871\",\n  \"sqKey\": \"S1871\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1905.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Casting expressions are utilized to convert one data type to another, such as transforming an integer into a string. This is especially crucial in\nstrongly typed languages like C, C++, C#, Java, Python, and others.</p>\n<p>However, there are instances where casting expressions are not needed. These include situations like:</p>\n<ul>\n  <li>casting a variable to its own type</li>\n  <li>casting a subclass to a parent class (in the case of polymorphism)</li>\n  <li>the programming language is capable of automatically converting the given type to another</li>\n</ul>\n<p>These scenarios are considered unnecessary casting expressions. They can complicate the code and make it more difficult to understand, without\noffering any advantages.</p>\n<p>As a result, it’s generally advised to avoid unnecessary casting expressions. Instead, rely on the language’s type system to ensure type safety and\ncode clarity.</p>\n<h3>Exceptions</h3>\n<p>Issues are not raised against the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/types/casting-and-type-conversions\">default literal</a>.</p>\n<h2>How to fix it</h2>\n<p>To fix your code remove the unnecessary casting expression.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic int Example(int i)\n{\n    return (int) (i + 42); // Noncompliant\n}\n\npublic IEnumerable&lt;int&gt; ExampleCollection(IEnumerable&lt;int&gt; coll)\n{\n    return coll.Reverse().OfType&lt;int&gt;(); // Noncompliant\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic int Example(int i)\n{\n    return i + 42;\n}\n\npublic IEnumerable&lt;int&gt; ExampleCollection(IEnumerable&lt;int&gt; coll)\n{\n    return coll.Reverse();\n}\n</pre>\n<pre>\nbool b = (bool)default; // Doesn't raise an issue\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/types/casting-and-type-conversions\">Casting and type\n  conversions</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Type_conversion\">Type Conversion</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Strong_and_weak_typing\">Strong and Weak Typing</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Polymorphism_(computer_science)\"> Polymorphism (Computer Science)</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1905.json",
    "content": "{\n  \"title\": \"Redundant casts should not be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"redundant\",\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1905\",\n  \"sqKey\": \"S1905\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1939.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>An inheritance list entry is redundant if:</p>\n<ul>\n  <li>It is <code>Object</code> - all classes extend <code>Object</code> implicitly.</li>\n  <li>It is <code>int</code> for an <code>enum</code></li>\n  <li>It is a base class of another listed inheritance.</li>\n</ul>\n<p>Such redundant declarations should be removed because they needlessly clutter the code and can be confusing.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic class MyClass : Object  // Noncompliant\n\nenum MyEnum : int  // Noncompliant\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic class MyClass\n\nenum MyEnum\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1939.json",
    "content": "{\n  \"title\": \"Inheritance list should not be redundant\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1min\"\n  },\n  \"tags\": [\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1939\",\n  \"sqKey\": \"S1939\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1940.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>It is needlessly complex to invert the result of a boolean comparison. The opposite comparison should be made instead.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nif ( !(a == 2)) { ...}  // Noncompliant\nbool b = !(i &lt; 10);  // Noncompliant\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nif (a != 2) { ...}\nbool b = (i &gt;= 10);\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1940.json",
    "content": "{\n  \"title\": \"Boolean checks should not be inverted\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1940\",\n  \"sqKey\": \"S1940\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1944.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>A cast is an <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/types/casting-and-type-conversions#explicit-conversions\">explicit\nconversion</a>, which is a way to tell the compiler the intent to convert from one type to another.</p>\n<pre>\nvoid Method(object value)\n{\n    int i;\n    i = (int)value;   // Casting (explicit conversion) from float to int\n}\n</pre>\n<p>In most cases, the compiler will be able to catch invalid casts between incompatible value types or reference types.</p>\n<p>However, the compiler will not be able to detect invalid casts to <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/interface\">interfaces</a>.</p>\n<h3>What is the potential impact?</h3>\n<p>Invalid casts will lead to unexpected behaviors or runtime errors such as <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.invalidcastexception\">InvalidCastException</a>.</p>\n<h3>Exceptions</h3>\n<p>No issue is reported if the interface has no implementing class in the assembly.</p>\n<h2>How to fix it</h2>\n<p>To prevent an <code>InvalidCastException</code> from raising during an explicit conversion, it is recommended to use the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/type-testing-and-cast#as-operator\"><code>as</code> operator</a>.\nWhen the conversion is not possible, the <code>as</code> operator returns <code>null</code> and will never raise an exception.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic interface IMyInterface\n{ /* ... */ }\n\npublic class Implementer : IMyInterface\n{ /* ... */ }\n\npublic class AnotherClass\n{ /* ... */ }\n\npublic static class Program\n{\n  public static void Main()\n  {\n    var another = new AnotherClass();\n    var x = (IMyInterface)another;     // Noncompliant: InvalidCastException is being thrown\n  }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic interface IMyInterface\n{ /* ... */ }\n\npublic class Implementer : IMyInterface\n{ /* ... */ }\n\npublic class AnotherClass\n{ /* ... */ }\n\npublic static class Program\n{\n  public static void Main()\n  {\n    var another = new AnotherClass();\n    var x = another as IMyInterface;    // Compliant: but will always be null\n  }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/types/casting-and-type-conversions#explicit-conversions\">Casting and\n  type conversions - Explicit conversion</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/type-testing-and-cast\">Type-testing operators and cast\n  expressions</a>\n    <ul>\n      <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/type-testing-and-cast#is-operator\"><code>is</code>\n      operator</a></li>\n      <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/type-testing-and-cast#as-operator\"><code>as</code>\n      operator</a></li>\n    </ul></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/conversions#103-explicit-conversions\">Conversions -\n  Explicit conversions in C#</a>\n    <ul>\n      <li><a\n      href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/conversions#1035-explicit-reference-conversions\">Conversions - Explicit reference conversions in C#</a></li>\n    </ul></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/588\">CWE-588 - Attempt to Access Child of a Non-structure Pointer</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/704\">CWE-704 - Incorrect Type Conversion or Cast</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1944.json",
    "content": "{\n  \"title\": \"Invalid casts should be avoided\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-1944\",\n  \"sqKey\": \"S1944\",\n  \"scope\": \"All\",\n  \"securityStandards\": {\n    \"CWE\": [\n      588,\n      704\n    ]\n  },\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S1994.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The <code>for</code> loop is designed to iterate over a range using a counter variable, with the counter being updated in the loop’s increment\nsection. Misusing this structure can lead to issues such as infinite loops if the counter is not updated correctly. If this is intentional, use a\n<code>while</code> or <code>do while</code> loop instead of a <code>for</code> loop.</p>\n<p>Using a for loop for purposes other than its intended use can lead to confusion and potential bugs. If the <code>for</code> loop structure does not\nfit your needs, consider using an alternative <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/iteration-statements\">iteration statement</a>.</p>\n<h2>How to fix it</h2>\n<p>Move the counter variable update to the loop’s increment section. If this is impossible, consider using another iteration statement instead.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nint sum = 0;\nfor (int i = 0; i &lt; 10; sum++) // Noncompliant: `i` is not updated in the increment section\n{\n  // ...\n  i++;\n}\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nfor (int i = 0;; i++) // Noncompliant: the loop condition is empty although incrementing `i`\n{\n  // ...\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nint sum = 0;\nfor (int i = 0; i &lt; 10; i++)\n{\n  // ...\n  sum++;\n}\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nint i = 0;\nwhile (true)\n{\n  // ...\n  i++;\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/iteration-statements#the-for-statement\">The <code>for</code>\n  statement</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/iteration-statements\">Iteration\n  statements - <code>for</code>, <code>foreach</code>, <code>do</code>, and <code>while</code></a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S1994.json",
    "content": "{\n  \"title\": \"\\\"for\\\" loop increment clauses should modify the loops\\u0027 counters\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"confusing\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-1994\",\n  \"sqKey\": \"S1994\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2053.html",
    "content": "<p>This vulnerability increases the likelihood that attackers are able to compute the cleartext of password hashes.</p>\n<h2>Why is this an issue?</h2>\n<p>During the process of password hashing, an additional component, known as a \"salt,\" is often integrated to bolster the overall security. This salt,\nacting as a defensive measure, primarily wards off certain types of attacks that leverage pre-computed tables to crack passwords.</p>\n<p>However, potential risks emerge when the salt is deemed insecure. This can occur when the salt is consistently the same across all users or when it\nis too short or predictable. In scenarios where users share the same password and salt, their password hashes will inevitably mirror each other.\nSimilarly, a short salt heightens the probability of multiple users unintentionally having identical salts, which can potentially lead to identical\npassword hashes. These identical hashes streamline the process for potential attackers to recover clear-text passwords. Thus, the emphasis on\nimplementing secure, unique, and sufficiently lengthy salts in password-hashing functions is vital.</p>\n<h3>What is the potential impact?</h3>\n<p>Despite best efforts, even well-guarded systems might have vulnerabilities that could allow an attacker to gain access to the hashed passwords.\nThis could be due to software vulnerabilities, insider threats, or even successful phishing attempts that give attackers the access they need.</p>\n<p>Once the attacker has these hashes, they will likely attempt to crack them using a couple of methods. One is brute force, which entails trying\nevery possible combination until the correct password is found. While this can be time-consuming, having the same salt for all users or a short salt\ncan make the task significantly easier and faster.</p>\n<p>If multiple users have the same password and the same salt, their password hashes would be identical. This means that if an attacker successfully\ncracks one hash, they have effectively cracked all identical ones, granting them access to multiple accounts at once.</p>\n<p>A short salt, while less critical than a shared one, still increases the odds of different users having the same salt. This might create clusters\nof password hashes with identical salt that can then be attacked as explained before.</p>\n<p>With short salts, the probability of a collision between two users' passwords and salts couple might be low depending on the salt size. The shorter\nthe salt, the higher the collision probability. In any case, using longer, cryptographically secure salt should be preferred.</p>\n<h3>Exceptions</h3>\n<p>To securely store password hashes, it is a recommended to rely on key derivation functions that are computationally intensive. Examples of such\nfunctions are:</p>\n<ul>\n  <li>Argon2</li>\n  <li>PBKDF2</li>\n  <li>Scrypt</li>\n  <li>Bcrypt</li>\n</ul>\n<p>When they are used for password storage, using a secure, random salt is required.</p>\n<p>However, those functions can also be used for other purposes such as master key derivation or password-based pre-shared key generation. In those\ncases, the implemented cryptographic protocol might require using a fixed salt to derive keys in a deterministic way. In such cases, using a fixed\nsalt is safe and accepted.</p>\n<h2>How to fix it in .NET</h2>\n<h3>Code examples</h3>\n<p>The following code contains examples of hard-coded salts.</p>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nusing System.Security.Cryptography;\n\npublic static void hash(string password)\n{\n    var salt = Encoding.UTF8.GetBytes(\"salty\");\n    var hashed = new Rfc2898DeriveBytes(password, salt); // Noncompliant\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nusing System.Security.Cryptography;\n\npublic static void hash(string password)\n{\n    var saltSize = 16;\n    var iterations = 100_000;\n    var hashed = new Rfc2898DeriveBytes(password, saltSize, iterations, HashAlgorithmName.SHA512);\n}\n</pre>\n<h3>How does this work?</h3>\n<p>This code ensures that each user’s password has a unique salt value associated with it. It generates a salt randomly and with a length that\nprovides the required security level. It uses a salt length of at least 16 bytes (128 bits), as recommended by industry standards.</p>\n<p>In the case of the code sample, the class automatically takes care of generating a secure salt if none is specified.</p>\n<h2>Resources</h2>\n<h3>Standards</h3>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A02_2021-Cryptographic_Failures/\">Top 10 2021 Category A2 - Cryptographic Failures</a></li>\n  <li>OWASP - <a href=\"https://www.owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure\">Top 10 2017 Category A3 - Sensitive Data\n  Exposure</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/759\">CWE-759 - Use of a One-Way Hash without a Salt</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/760\">CWE-760 - Use of a One-Way Hash with a Predictable Salt</a></li>\n  <li>STIG Viewer - <a href=\"https://stigviewer.com/stigs/application_security_and_development/2024-12-06/finding/V-222542\">Application Security and\n  Development: V-222542</a> - The application must only store cryptographic representations of passwords.</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2053.json",
    "content": "{\n  \"title\": \"Password hashing functions should use an unpredictable salt\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"HIGH\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"symbolic-execution\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-2053\",\n  \"sqKey\": \"S2053\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      759,\n      760\n    ],\n    \"OWASP\": [\n      \"A3\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A2\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"6.5.10\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"6.2.4\"\n    ],\n    \"STIG ASD_V5R3\": [\n      \"V-222542\"\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2068.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Hard-coding credentials in source code or binaries makes it easy for attackers to extract sensitive information, especially in distributed or\nopen-source applications. This practice exposes your application to significant security risks.</p>\n<p>This rule flags instances of hard-coded credentials used in database and LDAP connections. It looks for hard-coded credentials in connection\nstrings, and for variable names that match any of the patterns from the provided list.</p>\n<p>In the past, it has led to the following vulnerabilities:</p>\n<ul>\n  <li><a href=\"https://www.cve.org/CVERecord?id=CVE-2019-13466\">CVE-2019-13466</a></li>\n  <li><a href=\"https://www.cve.org/CVERecord?id=CVE-2018-15389\">CVE-2018-15389</a></li>\n</ul>\n<h3>Exceptions</h3>\n<ul>\n  <li>Issue is not raised when URI username and password are the same.</li>\n  <li>Issue is not raised when searched pattern is found in variable name and value.</li>\n</ul>\n<h2>How to fix it</h2>\n<p>Credentials should be stored in a configuration file that is not committed to the code repository, in a database, or managed by your cloud\nprovider’s secrets management service. If a password is exposed in the source code, it must be changed immediately.</p>\n<h3>Code Examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nstring username = \"admin\";\nstring password = \"Admin123\"; // Noncompliant\nstring usernamePassword  = \"user=admin&amp;password=Admin123\"; // Noncompliant\nstring url = \"scheme://user:Admin123@domain.com\"; // Noncompliant\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nstring username = \"admin\";\nstring password = GetEncryptedPassword();\nstring usernamePassword = string.Format(\"user={0}&amp;password={1}\", GetEncryptedUsername(), GetEncryptedPassword());\nstring url = $\"scheme://{username}:{password}@domain.com\";\n\nstring url2 = \"http://guest:guest@domain.com\"; // Compliant\nconst string Password_Property = \"custom.password\"; // Compliant\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures/\">Top 10 2021 Category A7 - Identification and\n  Authentication Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A2_2017-Broken_Authentication\">Top 10 2017 Category A2 - Broken\n  Authentication</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/798\">CWE-798 - Use of Hard-coded Credentials</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/259\">CWE-259 - Use of Hard-coded Password</a></li>\n  <li>Derived from FindSecBugs rule <a href=\"https://h3xstream.github.io/find-sec-bugs/bugs.htm#HARD_CODE_PASSWORD\">Hard Coded Password</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2068.json",
    "content": "{\n  \"title\": \"Credentials should not be hard-coded\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"quickfix\": \"infeasible\",\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2068\",\n  \"sqKey\": \"S2068\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      798,\n      259\n    ],\n    \"OWASP\": [\n      \"A2\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A7\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"6.5.10\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"6.2.4\"\n    ],\n    \"ASVS 4.0\": [\n      \"2.10.4\",\n      \"3.5.2\",\n      \"6.4.1\"\n    ]\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2077.html",
    "content": "<p>Formatted SQL queries can be difficult to maintain, debug and can increase the risk of SQL injection when concatenating untrusted values into the\nquery. However, this rule doesn’t detect SQL injections (unlike rule {rule:csharpsquid:S3649}), the goal is only to highlight complex/formatted\nqueries.</p>\n<h2>Ask Yourself Whether</h2>\n<ul>\n  <li>Some parts of the query come from untrusted values (like user inputs).</li>\n  <li>The query is repeated/duplicated in other parts of the code.</li>\n  <li>The application must support different types of relational databases.</li>\n</ul>\n<p>There is a risk if you answered yes to any of those questions.</p>\n<h2>Recommended Secure Coding Practices</h2>\n<ul>\n  <li>Use <a href=\"https://cheatsheetseries.owasp.org/cheatsheets/Query_Parameterization_Cheat_Sheet.html\">parameterized queries, prepared statements,\n  or stored procedures</a> and bind variables to SQL query parameters.</li>\n  <li>Consider using ORM frameworks if there is a need to have an abstract layer to access data.</li>\n</ul>\n<h2>Sensitive Code Example</h2>\n<pre>\npublic void Foo(DbContext context, string query, string param)\n{\n    string sensitiveQuery = string.Concat(query, param);\n    context.Database.ExecuteSqlCommand(sensitiveQuery); // Sensitive\n    context.Query&lt;User&gt;().FromSql(sensitiveQuery); // Sensitive\n\n    context.Database.ExecuteSqlCommand($\"SELECT * FROM mytable WHERE mycol={value}\", param); // Sensitive, the FormattableString is evaluated and converted to RawSqlString\n    string query = $\"SELECT * FROM mytable WHERE mycol={param}\";\n    context.Database.ExecuteSqlCommand(query); // Sensitive, the FormattableString has already been evaluated, it won't be converted to a parametrized query.\n}\n\npublic void Bar(SqlConnection connection, string param)\n{\n    SqlCommand command;\n    string sensitiveQuery = string.Format(\"INSERT INTO Users (name) VALUES (\\\"{0}\\\")\", param);\n    command = new SqlCommand(sensitiveQuery); // Sensitive\n\n    command.CommandText = sensitiveQuery; // Sensitive\n\n    SqlDataAdapter adapter;\n    adapter = new SqlDataAdapter(sensitiveQuery, connection); // Sensitive\n}\n</pre>\n<h2>Compliant Solution</h2>\n<pre>\npublic void Foo(DbContext context, string query, string param)\n{\n    context.Database.ExecuteSqlCommand(\"SELECT * FROM mytable WHERE mycol=@p0\", param); // Compliant, it's a parametrized safe query\n}\n</pre>\n<h2>See</h2>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A03_2021-Injection/\">Top 10 2021 Category A3 - Injection</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A1_2017-Injection\">Top 10 2017 Category A1 - Injection</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/20\">CWE-20 - Improper Input Validation</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/89\">CWE-89 - Improper Neutralization of Special Elements used in an SQL Command</a></li>\n  <li>Derived from FindSecBugs rules <a href=\"https://h3xstream.github.io/find-sec-bugs/bugs.htm#SQL_INJECTION_JPA\">Potential SQL/JPQL Injection\n  (JPA)</a>, <a href=\"https://h3xstream.github.io/find-sec-bugs/bugs.htm#SQL_INJECTION_JDO\">Potential SQL/JDOQL Injection (JDO)</a>, <a\n  href=\"https://h3xstream.github.io/find-sec-bugs/bugs.htm#SQL_INJECTION_HIBERNATE\">Potential SQL/HQL Injection (Hibernate)</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2077.json",
    "content": "{\n  \"title\": \"Formatting SQL queries is security-sensitive\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\",\n      \"SECURITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"bad-practice\",\n    \"sql\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2077\",\n  \"sqKey\": \"S2077\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      20,\n      89\n    ],\n    \"OWASP\": [\n      \"A1\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A3\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"6.5.1\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"6.2.4\"\n    ],\n    \"ASVS 4.0\": [\n      \"5.1.3\",\n      \"5.1.4\",\n      \"5.3.4\",\n      \"5.3.5\"\n    ]\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2092.html",
    "content": "<p>When a cookie is protected with the <code>secure</code> attribute set to <em>true</em> it will not be send by the browser over an unencrypted HTTP\nrequest and thus cannot be observed by an unauthorized person during a man-in-the-middle attack.</p>\n<h2>Ask Yourself Whether</h2>\n<ul>\n  <li>the cookie is for instance a <em>session-cookie</em> not designed to be sent over non-HTTPS communication.</li>\n  <li>it’s not sure that the website contains <a href=\"https://developer.mozilla.org/en-US/docs/Web/Security/Mixed_content\">mixed content</a> or not\n  (ie HTTPS everywhere or not)</li>\n</ul>\n<p>There is a risk if you answered yes to any of those questions.</p>\n<h2>Recommended Secure Coding Practices</h2>\n<ul>\n  <li>It is recommended to use <code>HTTPs</code> everywhere so setting the <code>secure</code> flag to <em>true</em> should be the default behaviour\n  when creating cookies.</li>\n  <li>Set the <code>secure</code> flag to <em>true</em> for session-cookies.</li>\n</ul>\n<h2>Sensitive Code Example</h2>\n<p>When the <code>HttpCookie.Secure</code> property is set to <code>false</code> then the cookie will be send during an unencrypted HTTP request:</p>\n<pre>\nHttpCookie myCookie = new HttpCookie(\"Sensitive cookie\");\nmyCookie.Secure = false; //  Sensitive: a security-sensitive cookie is created with the secure flag set to false\n</pre>\n<p>The <a href=\"https://docs.microsoft.com/en-us/dotnet/api/system.web.httpcookie.secure?view=netframework-4.8\">default value</a> of\n<code>Secure</code> flag is <code>false</code>, unless overwritten by an application’s configuration file:</p>\n<pre>\nHttpCookie myCookie = new HttpCookie(\"Sensitive cookie\");\n//  Sensitive: a security-sensitive cookie is created with the secure flag not defined (by default set to false)\n</pre>\n<h2>Compliant Solution</h2>\n<p>Set the <code>HttpCookie.Secure</code> property to <code>true</code>:</p>\n<pre>\nHttpCookie myCookie = new HttpCookie(\"Sensitive cookie\");\nmyCookie.Secure = true; // Compliant\n</pre>\n<p>Or change the default flag values for the whole application by editing the <a\nhref=\"https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/ms228262(v=vs.100)\">Web.config configuration file</a>:</p>\n<pre>\n&lt;httpCookies httpOnlyCookies=\"true\" requireSSL=\"true\" /&gt;\n</pre>\n<ul>\n  <li>the <code>requireSSL</code> attribute corresponds programmatically to the <code>Secure</code> field.</li>\n  <li>the <code>httpOnlyCookies</code> attribute corresponds programmatically to the <code>httpOnly</code> field.</li>\n</ul>\n<h2>See</h2>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A04_2021-Insecure_Design/\">Top 10 2021 Category A4 - Insecure Design</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A05_2021-Security_Misconfiguration/\">Top 10 2021 Category A5 - Security Misconfiguration</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure\">Top 10 2017 Category A3 - Sensitive Data\n  Exposure</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/311\">CWE-311 - Missing Encryption of Sensitive Data</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/315\">CWE-315 - Cleartext Storage of Sensitive Information in a Cookie</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/614\">CWE-614 - Sensitive Cookie in HTTPS Session Without 'Secure' Attribute</a></li>\n  <li>STIG Viewer - <a href=\"https://stigviewer.com/stigs/application_security_and_development/2024-12-06/finding/V-222576\">Application Security and\n  Development: V-222576</a> - The application must set the secure flag on session cookies.</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2092.json",
    "content": "{\n  \"title\": \"Creating cookies without the \\\"secure\\\" flag is security-sensitive\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"LOW\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"privacy\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2092\",\n  \"sqKey\": \"S2092\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      614,\n      311,\n      315\n    ],\n    \"OWASP\": [\n      \"A3\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A4\",\n      \"A5\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"6.5.10\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"6.2.4\"\n    ],\n    \"ASVS 4.0\": [\n      \"3.4.1\",\n      \"6.1.1\",\n      \"6.1.2\",\n      \"6.1.3\"\n    ],\n    \"STIG ASD_V5R3\": [\n      \"V-222576\"\n    ]\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2094.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>There is no good excuse for an empty class. If it’s being used simply as a common extension point, it should be replaced with an\n<code>interface</code>. If it was stubbed in as a placeholder for future development it should be fleshed-out. In any other case, it should be\neliminated.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic class Empty // Noncompliant\n{\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic interface IEmpty\n{\n}\n</pre>\n<h3>Exceptions</h3>\n<ul>\n  <li>Partial classes are ignored entirely, as source generators often use them.</li>\n  <li>Classes with names ending in <code>Command</code>, <code>Message</code>, <code>Event</code>, or <code>Query</code> are ignored as messaging\n  libraries often use them.</li>\n  <li>Subclasses of <code>System.Exception</code> are ignored; even an empty Exception class can provide helpful information by its type name\n  alone.</li>\n  <li>Subclasses of <code>System.Attribute</code> and classes annotated with attributes are ignored.</li>\n  <li>Subclasses of generic classes are ignored, as they can be used for type specialization even when empty.</li>\n  <li>Subclasses of certain framework types — like the <code>PageModel</code> class used in ASP.NET Core Razor Pages — are ignored.</li>\n  <li>Subclass of a class with non-public default constructors are ignored, as they widen the constructor accessibility.</li>\n</ul>\n<pre>\nusing Microsoft.AspNetCore.Mvc.RazorPages;\n\npublic class EmptyPageModel: PageModel // Compliant - an empty PageModel can be fully functional, the C# code can be in the cshtml file\n{\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2094.json",
    "content": "{\n  \"title\": \"Classes should not be empty\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2094\",\n  \"sqKey\": \"S2094\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2114.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Passing a collection as an argument to the collection’s own method is a code defect. Doing so might either have unexpected side effects or always\nhave the same result.</p>\n<p>Another case is using set-like operations. For example, using <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.union\">Union</a> between a list and itself will always return the same list.\nConversely, using <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.except\">Except</a> between a list and itself will\nalways return an empty list.</p>\n<p>Exceptions to this rule are the methods <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1.addrange\"><code>AddRange</code></a> and <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.concat\"><code>Concat</code></a>, since the developer can use them to\nmultiply the list elements or the list itself respectively.</p>\n<pre>\nvar list = new List&lt;int&gt;();\n\nlist.Union(list);             // Noncompliant: always returns list\nlist.Intersect(list);         // Noncompliant: always returns list\nlist.Except(list);            // Noncompliant: always returns empty\nlist.SequenceEqual(list);     // Noncompliant: always returns true\n\nvar set = new HashSet&lt;int&gt;();\nset.UnionWith(set);           // Noncompliant: no changes\nset.IntersectWith(set);       // Noncompliant: no changes\nset.ExceptWith(set);          // Noncompliant: always returns empty\nset.SymmetricExceptWith(set); // Noncompliant: always returns empty\nset.IsProperSubsetOf(set);    // Noncompliant: always returns false\nset.IsProperSupersetOf(set);  // Noncompliant: always returns false\nset.IsSubsetOf(set);          // Noncompliant: always returns true\nset.IsSupersetOf(set);        // Noncompliant: always returns true\nset.Overlaps(set);            // Noncompliant: always returns true\nset.SetEquals(set);           // Noncompliant: always returns true\n\nlist.AddRange(list);          // Compliant\nlist.Concat(list);            // Compliant\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/collections\">Collections</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2114.json",
    "content": "{\n  \"title\": \"Collections should not be passed as arguments to their own methods\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2114\",\n  \"sqKey\": \"S2114\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2115.html",
    "content": "<p>When accessing a database, an empty password should be avoided as it introduces a weakness.</p>\n<h2>Why is this an issue?</h2>\n<p>When a database does not require a password for authentication, it allows anyone to access and manipulate the data stored within it. Exploiting\nthis vulnerability typically involves identifying the target database and establishing a connection to it without the need for any authentication\ncredentials.</p>\n<h3>What is the potential impact?</h3>\n<p>Once connected, an attacker can perform various malicious actions, such as viewing, modifying, or deleting sensitive information, potentially\nleading to data breaches or unauthorized access to critical systems. It is crucial to address this vulnerability promptly to ensure the security and\nintegrity of the database and the data it contains.</p>\n<h4>Unauthorized Access to Sensitive Data</h4>\n<p>When a database lacks a password for authentication, it opens the door for unauthorized individuals to gain access to sensitive data. This can\ninclude personally identifiable information (PII), financial records, intellectual property, or any other confidential information stored in the\ndatabase. Without proper access controls in place, malicious actors can exploit this vulnerability to retrieve sensitive data, potentially leading to\nidentity theft, financial loss, or reputational damage.</p>\n<h4>Compromise of System Integrity</h4>\n<p>Without a password requirement, unauthorized individuals can gain unrestricted access to a database, potentially compromising the integrity of the\nentire system. Attackers can inject malicious code, alter configurations, or manipulate data within the database, leading to system malfunctions,\nunauthorized system access, or even complete system compromise. This can disrupt business operations, cause financial losses, and expose the\norganization to further security risks.</p>\n<h4>Unwanted Modifications or Deletions</h4>\n<p>The absence of a password for database access allows anyone to make modifications or deletions to the data stored within it. This poses a\nsignificant risk, as unauthorized changes can lead to data corruption, loss of critical information, or the introduction of malicious content. For\nexample, an attacker could modify financial records, tamper with customer orders, or delete important files, causing severe disruptions to business\nprocesses and potentially leading to financial and legal consequences.</p>\n<p>Overall, the lack of a password configured to access a database poses a serious security risk, enabling unauthorized access, data breaches, system\ncompromise, and unwanted modifications or deletions. It is essential to address this vulnerability promptly to safeguard sensitive data, maintain\nsystem integrity, and protect the organization from potential harm.</p>\n<h2>How to fix it in Entity Framework Core</h2>\n<h3>Code examples</h3>\n<p>The following code uses an empty password to connect to a SQL Server database.</p>\n<p>The vulnerability can be fixed by using Windows authentication (sometimes referred to as integrated security).</p>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"302\" data-diff-type=\"noncompliant\">\nprotected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)\n{\n  optionsBuilder.UseSqlServer(\"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=\"); // Noncompliant\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"302\" data-diff-type=\"compliant\">\nprotected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)\n{\n  optionsBuilder.UseSqlServer(\"Server=myServerAddress;Database=myDataBase;Integrated Security=True\");\n}\n</pre>\n<h3>How does this work?</h3>\n<h4>Windows authentication (integrated security)</h4>\n<p>When the connection string includes the <code>Integrated Security=true</code> parameter, it enables Windows authentication (sometimes called\nintegrated security) for the database connection. With integrated security, the user’s Windows credentials are used to authenticate and authorize\naccess to the database. It eliminates the need for a separate username and password for the database connection. Integrated security simplifies\nauthentication and leverages the existing Windows authentication infrastructure for secure database access in your C# application.</p>\n<p>It’s important to note that when using integrated security, the user running the application must have the necessary permissions to access the\ndatabase. Ensure that the user account running the application has the appropriate privileges and is granted access to the database.</p>\n<p>The syntax employed in connection strings varies by provider:</p>\n<table>\n  <colgroup>\n    <col style=\"width: 50%;\">\n    <col style=\"width: 50%;\">\n  </colgroup>\n  <tbody>\n    <tr>\n      <td>\n        <p>Syntax</p>\n      </td>\n      <td>\n        <p>Supported by</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p><code>Integrated Security=true;</code></p>\n      </td>\n      <td>\n        <p>SQL Server, Oracle, Postgres</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p><code>Integrated Security=SSPI;</code></p>\n      </td>\n      <td>\n        <p>SQL Server, OLE DB</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p><code>Integrated Security=yes;</code></p>\n      </td>\n      <td>\n        <p>MySQL</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p><code>Trusted_Connection=true;</code></p>\n      </td>\n      <td>\n        <p>SQL Server</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p><code>Trusted_Connection=yes;</code></p>\n      </td>\n      <td>\n        <p>ODBC</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<p>Note: Some providers such as MySQL do not support Windows authentication with .NET Core.</p>\n<h3>Pitfalls</h3>\n<h4>Hard-coded passwords</h4>\n<p>It could be tempting to replace the empty password with a hard-coded one. Hard-coding passwords in the code can pose significant security risks.\nHere are a few reasons why it is not recommended:</p>\n<ol>\n  <li>Security Vulnerability: Hard-coded passwords can be easily discovered by anyone who has access to the code, such as other developers or\n  attackers. This can lead to unauthorized access to the database and potential data breaches.</li>\n  <li>Lack of Flexibility: Hard-coded passwords make it difficult to change the password without modifying the code. If the password needs to be\n  updated, it would require recompiling and redeploying the code, which can be time-consuming and error-prone.</li>\n  <li>Version Control Issues: Storing passwords in code can lead to version control issues. If the code is shared or stored in a version control\n  system, the password will be visible to anyone with access to the repository, which is a security risk.</li>\n</ol>\n<p>To mitigate these risks, it is recommended to use secure methods for storing and retrieving passwords, such as using environment variables,\nconfiguration files, or secure key management systems. These methods allow for better security, flexibility, and separation of sensitive information\nfrom the codebase.</p>\n<h2>How to fix it in ASP.NET</h2>\n<h3>Code examples</h3>\n<p>The following configuration file uses an empty password to connect to a database.</p>\n<p>The vulnerability can be fixed by using Windows authentication (sometimes referred to as integrated security)</p>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"301\" data-diff-type=\"noncompliant\">\n&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;configuration&gt;\n  &lt;connectionStrings&gt;\n    &lt;add name=\"myConnection\" connectionString=\"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=\" /&gt; &lt;!-- Noncompliant --&gt;\n  &lt;/connectionStrings&gt;\n&lt;/configuration&gt;\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"301\" data-diff-type=\"compliant\">\n&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;configuration&gt;\n  &lt;connectionStrings&gt;\n    &lt;add name=\"myConnection\" connectionString=\"Server=myServerAddress;Database=myDataBase;Integrated Security=True\" /&gt;\n  &lt;/connectionStrings&gt;\n&lt;/configuration&gt;\n</pre>\n<h3>How does this work?</h3>\n<h4>Windows authentication (integrated security)</h4>\n<p>When the connection string includes the <code>Integrated Security=true</code> parameter, it enables Windows authentication (sometimes called\nintegrated security) for the database connection. With integrated security, the user’s Windows credentials are used to authenticate and authorize\naccess to the database. It eliminates the need for a separate username and password for the database connection. Integrated security simplifies\nauthentication and leverages the existing Windows authentication infrastructure for secure database access in your C# application.</p>\n<p>It’s important to note that when using integrated security, the user running the application must have the necessary permissions to access the\ndatabase. Ensure that the user account running the application has the appropriate privileges and is granted access to the database.</p>\n<p>The syntax employed in connection strings varies by provider:</p>\n<table>\n  <colgroup>\n    <col style=\"width: 50%;\">\n    <col style=\"width: 50%;\">\n  </colgroup>\n  <tbody>\n    <tr>\n      <td>\n        <p>Syntax</p>\n      </td>\n      <td>\n        <p>Supported by</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p><code>Integrated Security=true;</code></p>\n      </td>\n      <td>\n        <p>SQL Server, Oracle, Postgres</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p><code>Integrated Security=SSPI;</code></p>\n      </td>\n      <td>\n        <p>SQL Server, OLE DB</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p><code>Integrated Security=yes;</code></p>\n      </td>\n      <td>\n        <p>MySQL</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p><code>Trusted_Connection=true;</code></p>\n      </td>\n      <td>\n        <p>SQL Server</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p><code>Trusted_Connection=yes;</code></p>\n      </td>\n      <td>\n        <p>ODBC</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<p>Note: Some providers such as MySQL do not support Windows authentication with .NET Core.</p>\n<h3>Pitfalls</h3>\n<h4>Hard-coded passwords</h4>\n<p>It could be tempting to replace the empty password with a hard-coded one. Hard-coding passwords in the code can pose significant security risks.\nHere are a few reasons why it is not recommended:</p>\n<ol>\n  <li>Security Vulnerability: Hard-coded passwords can be easily discovered by anyone who has access to the code, such as other developers or\n  attackers. This can lead to unauthorized access to the database and potential data breaches.</li>\n  <li>Lack of Flexibility: Hard-coded passwords make it difficult to change the password without modifying the code. If the password needs to be\n  updated, it would require recompiling and redeploying the code, which can be time-consuming and error-prone.</li>\n  <li>Version Control Issues: Storing passwords in code can lead to version control issues. If the code is shared or stored in a version control\n  system, the password will be visible to anyone with access to the repository, which is a security risk.</li>\n</ol>\n<p>To mitigate these risks, it is recommended to use secure methods for storing and retrieving passwords, such as using environment variables,\nconfiguration files, or secure key management systems. These methods allow for better security, flexibility, and separation of sensitive information\nfrom the codebase.</p>\n<h2>Resources</h2>\n<ul>\n  <li><a href=\"https://docs.microsoft.com/en-us/troubleshoot/aspnet/create-web-config\">Create the Web.config file for an ASP.NET application</a></li>\n</ul>\n<h3>Standards</h3>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures/\">Top 10 2021 Category A7 - Identification and\n  Authentication Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A2_2017-Broken_Authentication\">Top 10 2017 Category A2 - Broken\n  Authentication</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure\">Top 10 2017 Category A3 - Sensitive Data\n  Exposure</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/521\">CWE-521 - Weak Password Requirements</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2115.json",
    "content": "{\n  \"title\": \"A secure password should be used when connecting to a database\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"45min\"\n  },\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-2115\",\n  \"sqKey\": \"S2115\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      521\n    ],\n    \"OWASP\": [\n      \"A2\",\n      \"A3\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A7\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"6.5.10\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"6.2.4\"\n    ],\n    \"ASVS 4.0\": [\n      \"9.2.2\",\n      \"9.2.3\"\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2123.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When using the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/arithmetic-operators#postfix-increment-operator\">postfix\nincrement</a> operator, it is important to know that the result of the expression <code>x++</code> is the value <strong>before</strong> the operation\n<code>x</code>.</p>\n<p>This means that in some cases, the result might not be what you expect:</p>\n<ul>\n  <li>When assigning <code>x++</code> to <code>x</code>, it’s the same as assigning <code>x</code> to itself, since the value is assigned before the\n  increment takes place</li>\n  <li>When returning <code>x++</code>, the returning value is <code>x</code>, not <code>x+1</code></li>\n</ul>\n<p>The same applies to the postfix and prefix <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/arithmetic-operators#decrement-operator---\">decrement</a>\noperators.</p>\n<h2>How to fix it</h2>\n<p>To solve the issue in assignments, eliminate the assignment, since <code>x\\++</code> mutates <code>x</code> anyways.</p>\n<p>To solve the issue in return statements, consider using the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/arithmetic-operators#prefix-increment-operator\">prefix\nincrement</a> operator, since it works in reverse: the result of the expression <code>++x</code> is the value <strong>after</strong> the operation,\nwhich is <code>x+1</code>, as one might expect.</p>\n<p>The same applies to the postfix and prefix <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/arithmetic-operators#decrement-operator---\">decrement</a>\noperators.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nint PickNumber()\n{\n  int i = 0;\n  int j = 0;\n\n  i = i++;      // Noncompliant: i is still 0\n  return j--;   // Noncompliant: returns 0\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nint PickNumber()\n{\n  int i = 0;\n  int j = 0;\n\n  i++;          // Compliant: i is incremented to 1\n  return --j;   // Compliant: returns -1\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/arithmetic-operators\">Arithmetic\n  operators (C# reference)</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li>StackOverflow - <a href=\"https://stackoverflow.com/a/3346729\">\"What is the difference between i and i in C#?\" - Eric Lippert’s answer</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2123.json",
    "content": "{\n  \"title\": \"Values should not be uselessly incremented\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"unused\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2123\",\n  \"sqKey\": \"S2123\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2139.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When an exception is logged and rethrown, the upstream code may not be aware that the exception has already been logged. As a result, the same\nexception gets logged multiple times, making it difficult to identify the root cause of the issue. This can be particularly problematic in\nmulti-threaded applications where messages from other threads can be interwoven with the repeated log entries.</p>\n<h3>Exceptions</h3>\n<p>This rule will not generate issues if, within the catch block, one of the following conditions are met:</p>\n<ul>\n  <li>The logs generated within the catch block do not contain any references to the exception being caught.</li>\n  <li>The exception being thrown from the catch block is not the same exception that is being caught.</li>\n</ul>\n<h2>How to fix it</h2>\n<p>To address this issue, it is recommended to modify the code to log exceptions only when they are handled locally. In all other cases, simply\nrethrow the exception and allow the higher-level layers of the application to handle the logging and appropriate actions.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\ntry {}\ncatch (Exception ex)\n{\n  logger.LogError(ex.Message);\n  throw;\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\ntry {}\ncatch (Exception ex)\n{\n  logger.LogError(ex.Message);\n  // Handle exception\n}\n</pre>\n<p>or</p>\n<pre>\ntry {}\ncatch (Exception ex)\n{\n  // ...\n  throw;\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/exception-handling-statements\">Exception-handling\n  statements</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li><a href=\"https://rolf-engelhard.de/2013/04/logging-anti-patterns-part-ii/\">Rolf Engelhard - Logging anti-patterns</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2139.json",
    "content": "{\n  \"title\": \"Exceptions should be either logged or rethrown but not both\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"DISTINCT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [\n    \"logging\",\n    \"error-handling\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2139\",\n  \"sqKey\": \"S2139\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2148.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Beginning with C# 7, it is possible to add underscores ('_') to numeric literals to enhance readability. The addition of underscores in this manner\nhas no semantic meaning, but makes it easier for maintainers to understand the code.</p>\n<p>The number of digits to the left of a decimal point needed to trigger this rule varies by base.</p>\n<table>\n  <colgroup>\n    <col style=\"width: 50%;\">\n    <col style=\"width: 50%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>Base</th>\n      <th>Minimum digits</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p>binary</p>\n      </td>\n      <td>\n        <p>9</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>decimal</p>\n      </td>\n      <td>\n        <p>6</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>hexadecimal</p>\n      </td>\n      <td>\n        <p>9</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<p>It is only the presence of underscores, not their spacing that is scrutinized by this rule.</p>\n<p><strong>Note</strong> that this rule is automatically disabled when the project’s <code>C# version</code> is lower than <code>7</code>.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nint i = 10000000;  // Noncompliant; is this 10 million or 100 million?\nint  j = 0b01101001010011011110010101011110;  // Noncompliant\nlong l = 0x7fffffffffffffffL;  // Noncompliant\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nint i = 10_000_000;\nint  j = 0b01101001_01001101_11100101_01011110;\nlong l = 0x7fff_ffff_ffff_ffffL;\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2148.json",
    "content": "{\n  \"title\": \"Underscores should be used to make large numbers readable\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"FORMATTED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2148\",\n  \"sqKey\": \"S2148\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2156.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The difference between <code>private</code> and <code>protected</code> visibility is that child classes can see and use <code>protected</code>\nmembers, but they cannot see <code>private</code> ones. Since a <code>sealed</code> class cannot have children, marking its members\n<code>protected</code> is confusingly pointless.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic sealed class MySealedClass\n{\n    protected string name = \"Fred\";  // Noncompliant\n    protected void SetName(string name) // Noncompliant\n    {\n        // ...\n    }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic sealed class MySealedClass\n{\n    private string name = \"Fred\";\n    public void SetName(string name)\n    {\n        // ...\n    }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2156.json",
    "content": "{\n  \"title\": \"\\\"sealed\\\" classes should not have \\\"protected\\\" members\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"confusing\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2156\",\n  \"sqKey\": \"S2156\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2166.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Clear, communicative naming is important in code. It helps maintainers and API users understand the intentions for and uses of a unit of code.\nUsing \"exception\" in the name of a class that does not extend <code>Exception</code> or one of its subclasses is a clear violation of the expectation\nthat a class' name will indicate what it is and/or does.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic class FruitException // Noncompliant - this has nothing to do with Exception\n{\n  private Fruit expected;\n  private string unusualCharacteristics;\n  private bool appropriateForCommercialExploitation;\n  // ...\n}\n\npublic class CarException // Noncompliant - does not derive from any Exception-based class\n{\n  public CarException(string message, Exception inner)\n  {\n     // ...\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic class FruitSport // Compliant - class name does not end with 'Exception'\n{\n  private Fruit expected;\n  private string unusualCharacteristics;\n  private bool appropriateForCommercialExploitation;\n  // ...\n}\n\npublic class CarException: Exception // Compliant - correctly extends System.Exception\n{\n  public CarException(string message, Exception inner): base(message, inner)\n  {\n     // ...\n  }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2166.json",
    "content": "{\n  \"title\": \"Classes named like \\\"Exception\\\" should extend \\\"Exception\\\" or a subclass\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"convention\",\n    \"error-handling\",\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2166\",\n  \"sqKey\": \"S2166\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2178.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><a href=\"https://en.wikipedia.org/wiki/Short-circuit_evaluation\">Short-circuit evaluation</a> is an evaluation strategy for <a\nhref=\"https://en.wikipedia.org/wiki/Logical_connective\">Boolean operators</a>, that doesn’t evaluates the second argument of the operator if it is not\nneeded to determine the result of the operation.</p>\n<p>C# provides logical operators that implement short-circuit evaluation: <code>&amp;&amp;</code> and <code>||</code>, as well as non-short-circuit\nversions: <code>&amp;</code> and <code>|</code>. Unlike short-circuit operators, non-short-circuit ones evaluate both operands and afterwards perform\nthe logical operation.</p>\n<p>For example <code>false &amp;&amp; FunctionCall()</code> always results in <code>false</code>, even when <code>FunctionCall</code> invocation would\nraise an exception. Instead, <code>false &amp; FunctionCall()</code> also evaluates <code>FunctionCall()</code>, and results in an exception if\n<code>FunctionCall()</code> invocation raises an exception.</p>\n<p>Similarly, <code>true || FunctionCall()</code> always results in <code>true</code>, no matter what the return value of <code>FunctionCall()</code>\nwould be.</p>\n<p>The use of non-short-circuit logic in a boolean context is likely a mistake - one that could cause serious program errors as conditions are\nevaluated under the wrong circumstances.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nif (GetTrue() | GetFalse()) // Noncompliant: both sides evaluated\n{\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nif (GetTrue() || GetFalse()) // Compliant: short-circuit logic used\n{\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/boolean-logical-operators\">Boolean logical operators -\n  AND, OR, NOT, XOR</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Short-circuit_evaluation\">Short-circuit evaluation</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Logical_connective\">Boolean operators</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li><a href=\"https://ericlippert.com/2015/11/02/when-would-you-use-on-a-bool/\">Eric Lippert’s blog - When would you use &amp; on a bool?</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2178.json",
    "content": "{\n  \"title\": \"Short-circuit logic should be used in boolean contexts\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-2178\",\n  \"sqKey\": \"S2178\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2183.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/bitwise-and-shift-operators#left-shift-operator-\">shifting</a>\noperators are used to do an <a href=\"https://en.wikipedia.org/wiki/Arithmetic_shift\">arithmetic shift</a> to the bits of an <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/integral-numeric-types\">integral numeric</a> value, either to\nthe left or the right.</p>\n<pre>\nvar number = 14;         // ...01110 (14)\nvar left = number &lt;&lt; 1;  // ...11100 (28)\nvar right = number &gt;&gt; 1; // ...00111 (7)\n</pre>\n<p>Therefore, shifting an integral number by 0 is equivalent to doing nothing, since the bits do not move any positions to the left or the right.</p>\n<p>On the other hand, shifting an integral number by a value greater than their count of bits minus one (<code>n_bits-1</code>) is equivalent to\nshifting by the value <a href=\"https://en.wikipedia.org/wiki/Modulo\">modulo</a> the bit count of the number (<code>value % n_bits</code>).</p>\n<p>In the case of <code>int</code> and <code>uint</code>, which take 32 bits in the memory, the shift count is given by the five low-order bits of the\nsecond operand, which can represent numbers from 0 to 31. This means that numbers having the same five low-order bits are treated the same by the\nshift operators.</p>\n<pre>\nvar one =         0b0_00001;\nvar thirtyThree = 0b1_00001; // Same five low-order bits, 33 % 32 = 1\n\nvar shifted1 = 42 &lt;&lt; one;           // Results in 84\nvar shifted2 = 42 &lt;&lt; thirtyThree;   // Results in 84\n</pre>\n<p>Note that integral number with a less than 32-bit quantity (e.g. <code>short</code>, <code>ushort</code>) are implicitly converted to\n<code>int</code> before the shifting operation and so the rule for <code>int</code>/<code>uint</code> applies.</p>\n<p>If the first operand is a <code>long</code> or <code>ulong</code> (64-bit quantity), the shift count is given by the six low-order bits of the\nsecond operand. That is, the actual shift count is 0 to 63 bits.</p>\n<h3>Exceptions</h3>\n<p>This rule doesn’t raise an issue when the shift by zero is obviously for cosmetic reasons:</p>\n<ul>\n  <li>When the value shifted is a literal.</li>\n  <li>When there is a similar shift at the same position on line before or after. E.g.:</li>\n</ul>\n<pre>\nbytes[loc+0] = (byte)(value &gt;&gt; 8);\nbytes[loc+1] = (byte)(value &gt;&gt; 0);\n</pre>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nshort s = 1;\nshort shortShift1 = (short)(s &lt;&lt; 0); // Noncompliant: the value does not change\nshort shortShift2 = (short)(s &lt;&lt; 33); // Noncompliant: this is equivalent to shifting by 1\n\nint i = 1;\nint intShift = i &lt;&lt; 33; // Noncompliant: this is equivalent to shifting by 1\n\nlong lg = 1;\nlong longShift1 = lg &lt;&lt; 0; // Noncompliant: the value does not change\nlong longShift2 = lg &lt;&lt; 65; // Noncompliant: this is equivalent to shifting by 1\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nshort s = 1;\nshort shortShift1 = s;\nshort shortShift2 = (short)(s &lt;&lt; 1);\n\nint i = 1;\nvar intShift = i &lt;&lt; 1;\n\nlong lg = 1;\nvar longShift1 = lg;\nvar longShift2 = lg &lt;&lt; 1;\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a\n  href=\"https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/bitwise-and-shift-operators#left-shift-operator-\">Bitwise and\n  shift operators (C# reference)</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Arithmetic_shift\">Arithmetic shift</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Modulo\">Modulo</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2183.json",
    "content": "{\n  \"title\": \"Integral numbers should not be shifted by zero or more than their number of bits-1\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2183\",\n  \"sqKey\": \"S2183\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2184.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When division is performed on <code>int</code>s, the result will always be an <code>int</code>. You can assign that result to a\n<code>double</code>, <code>float</code> or <code>decimal</code> with automatic type conversion, but having started as an <code>int</code>, the result\nwill likely not be what you expect. If the result of <code>int</code> division is assigned to a floating-point variable, precision will have been lost\nbefore the assignment. Instead, at least one operand should be cast or promoted to the final type before the operation takes place.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nstatic void Main()\n{\n  decimal dec = 3/2; // Noncompliant\n  Method(3/2); // Noncompliant\n}\n\nstatic void Method(float f) { }\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nstatic void Main()\n{\n  decimal dec = (decimal)3/2;\n  Method(3.0F/2);\n}\n\nstatic void Method(float f) { }\n</pre>\n<h2>Resources</h2>\n<h3>Standards</h3>\n<ul>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/190\">CWE-190 - Integer Overflow or Wraparound</a></li>\n  <li>STIG Viewer - <a href=\"https://stigviewer.com/stigs/application_security_and_development/2024-12-06/finding/V-222612\">Application Security and\n  Development: V-222612</a> - The application must not be vulnerable to overflow attacks.</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2184.json",
    "content": "{\n  \"title\": \"Results of integer division should not be assigned to floating point variables\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"overflow\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2184\",\n  \"sqKey\": \"S2184\",\n  \"scope\": \"All\",\n  \"securityStandards\": {\n    \"CWE\": [\n      190\n    ],\n    \"ASVS 4.0\": [\n      \"5.4.3\"\n    ],\n    \"STIG ASD_V5R3\": [\n      \"V-222612\"\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2187.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>To ensure proper testing, it is important to include test cases in a test class. If a test class does not have any test cases, it can give the\nwrong impression that the class being tested has been thoroughly tested, when in reality, it has not.</p>\n<p>This rule will raise an issue when any of these conditions are met:</p>\n<ul>\n  <li>For <code>NUnit</code>, a class is marked with <code>TestFixture</code> but does not contain any method marked with <code>Test</code>,\n  <code>TestCase</code>, <code>TestCaseSource</code>, or <code>Theory</code>.</li>\n  <li>For <code>MSTest</code>, a class is marked with <code>TestClass</code> but does not contain any method marked with <code>TestMethod</code> or\n  <code>DataTestMethod</code>.</li>\n</ul>\n<p>It does not apply to <code>xUnit</code> since <code>xUnit</code> does not require a <a href=\"https://xunit.net/docs/comparisons#attributes\">test\nclass attribute</a>.</p>\n<h3>Exceptions</h3>\n<p>There are scenarios where not having any test cases within a test class is perfectly acceptable and not seen as a problem.</p>\n<h4>Abstract classes</h4>\n<p>To facilitate the creation of common test cases, test logic, or test infrastructure, it is advisable to use a base class.</p>\n<p>Additionally, in both <code>NUnit</code> and <code>MSTest</code>, abstract classes that are annotated with their respective attributes\n(<code>TestFixture</code> in NUnit and <code>TestClass</code> in MSTest) are automatically ignored.</p>\n<p>Therefore, there is no need to raise an issue in this particular scenario.</p>\n<p>More information here:</p>\n<ul>\n  <li><a href=\"https://docs.nunit.org/articles/nunit/writing-tests/attributes/testfixture.html\"><code>TestFixture</code> documentation in\n  <code>NUnit</code></a></li>\n  <li><a\n  href=\"https://github.com/microsoft/testfx/blob/0f19160cc319338ef6e23acb320da1562b40decd/src/Adapter/MSTest.TestAdapter/Discovery/TypeValidator.cs#L86-L97\"><code>TypeValidator</code> class in <code>MSTest</code> (GitHub)</a></li>\n</ul>\n<h4>Derived classes that inherit test cases from a base class</h4>\n<p>A base class containing one or more test cases to provide generic test cases is also considered a compliant scenario.</p>\n<h4>Classes that contain <code>AssemblyInitialize</code> or <code>AssemblyCleanup</code> methods</h4>\n<p><strong>This particular exception scenario only applies to the MSTest test framework.</strong></p>\n<p>The <code>AssemblyInitialize</code> and <code>AssemblyCleanup</code> attributes are used to annotate methods that are executed only once at the\nbeginning and at the end of a test run. These attributes can only be applied once per assembly.</p>\n<p>It is logical to have a dedicated class for these methods, and this scenario is also considered compliant.</p>\n<p>Furthermore, it is important to note that the test engine will execute a method annotated with either the <code>AssemblyInitialize</code> or\n<code>AssemblyCleanup</code> attribute only if that method is part of a class annotated with the <code>TestClass</code> attribute.</p>\n<p>More information here:</p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2008/ms245278(v=vs.90)\"><code>AssemblyInitialize</code>\n  attribute</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2008/ms245265(v=vs.90)\"><code>AssemblyCleanup</code>\n  attribute</a></li>\n</ul>\n<h2>How to fix it in MSTest</h2>\n<p>To fix this issue in <code>MSTest</code>, it is important that all test classes annotated with the <code>[TestClass]</code> attribute contain at\nleast one test case.</p>\n<p>To achieve this, at least one method needs to be annotated with one of the following method attributes:</p>\n<ul>\n  <li><code>TestMethod</code></li>\n  <li><code>DataTestMethod</code></li>\n</ul>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\n[TestClass]\npublic class SomeOtherClassTest { } // Noncompliant: no test\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n[TestClass]\npublic class SomeOtherClassTest\n{\n    [TestMethod]\n    public void SomeMethodShouldReturnTrue() { }\n}\n</pre>\n<h2>How to fix it in NUnit</h2>\n<p>To fix this issue in <code>NUnit</code>, it is important that all test classes annotated with the <code>[TestFixture]</code> attribute contain at\nleast one test case.</p>\n<p>To achieve this, at least one method needs to be annotated with one of the following method attributes:</p>\n<ul>\n  <li><code>Test</code></li>\n  <li><code>TestCase</code></li>\n  <li><code>TestCaseSource</code></li>\n  <li><code>Theory</code></li>\n</ul>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"11\" data-diff-type=\"noncompliant\">\n[TestFixture]\npublic class SomeClassTest { } // Noncompliant: no test\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"11\" data-diff-type=\"compliant\">\n[TestFixture]\npublic class SomeClassTest\n{\n    [Test]\n    public void SomeMethodShouldReturnTrue() { }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://docs.nunit.org/articles/nunit/intro.html\"><code>NUnit</code> documentation</a>\n    <ul>\n      <li><a href=\"https://docs.nunit.org/articles/nunit/writing-tests/attributes/testfixture.html\"><code>TestFixture</code> attribute</a></li>\n      <li><a href=\"https://docs.nunit.org/articles/nunit/writing-tests/attributes/test.html\"><code>Test</code> attribute</a></li>\n      <li><a href=\"https://docs.nunit.org/articles/nunit/writing-tests/attributes/testcase.html\"><code>TestCase</code> attribute</a></li>\n      <li><a href=\"https://docs.nunit.org/articles/nunit/writing-tests/attributes/testcasesource.html\"><code>TestCaseSource</code> attribute</a></li>\n      <li><a href=\"https://docs.nunit.org/articles/nunit/writing-tests/attributes/theory.html\"><code>Theory</code> attribute</a></li>\n    </ul></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-with-mstest\">Unit testing C# with MSTest</a></li>\n  <li><a href=\"https://github.com/microsoft/testfx/blob/main/docs/README.md\"><code>MSTest</code> documentation</a></li>\n  <li><a href=\"https://xunit.net/docs/comparisons#attributes\">Comparing <code>xUnit</code> to other frameworks - Attributes</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2187.json",
    "content": "{\n  \"title\": \"Test classes should contain at least one test case\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"TESTED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"tests\",\n    \"unused\",\n    \"confusing\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-2187\",\n  \"sqKey\": \"S2187\",\n  \"scope\": \"Tests\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2190.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Having an infinite loop or recursion will lead to a program failure or a program never finishing the execution.</p>\n<pre>\npublic int Sum()\n{\n    var i = 0;\n    var result = 0;\n    while (true) // Noncompliant: the program will never stop\n    {\n        result += i;\n        i++;\n    }\n    return result;\n}\n</pre>\n<p>This can happen in multiple scenarios.</p>\n<h3>Loop statements</h3>\n<p><code>while</code> and <code>for</code> loops with no <code>break</code> or <code>return</code> statements that have exit conditions which are\nalways <code>false</code> will be indefinitely executed.</p>\n<h3>\"goto\" statements</h3>\n<p><code>goto</code> statement with nothing that stops it from being executed over and over again will prevent the program from the completion.</p>\n<h3>Recursion</h3>\n<p>When a <a href=\"https://en.wikipedia.org/wiki/Recursion_(computer_science)\">recursive</a> method call chain lacks an exit condition, the <a\nhref=\"https://en.wikipedia.org/wiki/Call_stack\">call stack</a> will reach its limit and the program will crash due to a <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.stackoverflowexception\">StackOverflowException</a>.</p>\n<pre>\nint Pow(int num, int exponent)\n{\n  return num * Pow(num, exponent - 1); // Noncompliant: no condition under which Pow isn't re-called\n}\n</pre>\n<p>In this example, <code>Pow</code> will keep calling <code>Pow</code> with <code>exponent - 1</code> forever, until the program crashes with a\nStackOverflowException.</p>\n<p>Recursion provides some benefits.</p>\n<ul>\n  <li><strong>Simplified code</strong>: recursion can often lead to more concise and elegant code by breaking down complex problems into smaller, more\n  manageable parts.</li>\n  <li><strong>Improved code readability</strong>: compared to iterative solutions, recursive solutions can be easier to understand and reason\n  about.</li>\n</ul>\n<p>However, it has disadvantages as well.</p>\n<ul>\n  <li><strong>Stack overflow</strong>: Recursive functions can lead to <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.stackoverflowexception\">stack overflow</a> if the recursion is too deep, potentially\n  causing the program to crash.</li>\n  <li><strong>Performance overhead</strong>: Recursive function calls can lead to poor performance due to the need to push and pop stack frames,\n  making them potentially slower than iterative solutions.</li>\n  <li><strong>Difficulty in debugging</strong>: Debugging recursive code can be challenging, as multiple recursive calls can make it harder to track\n  the flow of execution and identify logical errors.</li>\n  <li><strong>Space complexity</strong>: Recursive algorithms may require more memory compared to iterative approaches, as each recursive call adds a\n  new frame to the call stack.</li>\n  <li><strong>Lack of control</strong>: Recursion can sometimes lead to infinite loops or unexpected behavior if not properly implemented or\n  terminated, making it crucial to have proper base cases and exit conditions.</li>\n</ul>\n<h2>How to fix it</h2>\n<p>The program’s logic should incorporate a mechanism to break out of the control flow loop. Here are some examples.</p>\n<h3>Code examples</h3>\n<ul>\n  <li>Use a loop condition which eventually evaluates to <code>false</code></li>\n</ul>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic int Sum()\n{\n    var i = 0;\n    var result = 0;\n    while (true) // Noncompliant: the program will never stop\n    {\n        result += i;\n        i++;\n    }\n    return result;\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic int Sum()\n{\n    var i = 0;\n    var result = 0;\n    while (result &lt; 1000)\n    {\n        result += i;\n        i++;\n    }\n    return result;\n}\n</pre>\n<ul>\n  <li>As {rule:csharpsquid:S907} generally suggests, avoid using <code>goto</code> statements. Instead, you can use a loop statement or explicit\n  recursion.</li>\n</ul>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\npublic int Sum()\n{\n    var result = 0;\n    var i = 0;\niteration:\n    // Noncompliant: program never ends\n    result += i;\n    i++;\n    goto iteration;\n    return result;\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\npublic int Sum()\n{\n    var i = 0;\n    var result = 0;\n    while (result &lt; 1000)\n    {\n        result += i;\n        i++;\n    }\n    return result;\n}\n</pre>\n<ul>\n  <li>For a recursion make sure there is a base case when the recursive method is not re-called.</li>\n</ul>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"3\" data-diff-type=\"noncompliant\">\nint Pow(int num, int exponent)\n{\n  return num * Pow(num, exponent - 1); // Noncompliant: no condition under which Pow isn't re-called\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"3\" data-diff-type=\"compliant\">\nint Pow(int num, int exponent)\n{\n  if (exponent &gt; 1) // recursion is now conditional and stoppable\n  {\n    num = num * Pow(num, exponent - 1);\n  }\n  return num;\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/iteration-statements#the-for-statement\">The \"for\"\n  statement</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/iteration-statements#the-while-statement\">The \"while\"\n  statement</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/jump-statements#the-goto-statement\">The\n  \"goto\" statement</a></li>\n  <li>Wikipedia <a href=\"https://en.wikipedia.org/wiki/Recursion_(computer_science)\">Recursion - wiki</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.stackoverflowexception?view=net-7.0\">StackOverflowException\n  class</a></li>\n  <li>{rule:csharpsquid:S907} - \"goto\" statement should not be used</li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li>Edsger Dijkstra - <a href=\"https://www.cs.utexas.edu/users/EWD/transcriptions/EWD02xx/EWD215.html\">A Case against the GO TO Statement</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2190.json",
    "content": "{\n  \"title\": \"Loops and recursions should not be infinite\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"tags\": [\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-2190\",\n  \"sqKey\": \"S2190\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2197.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When the modulus of a negative number is calculated, the result will either be negative or zero. Thus, comparing the modulus of a variable for\nequality with a positive number (or a negative one) could result in unexpected results.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic bool IsOdd(int x)\n{\n  return x % 2 == 1;  // Noncompliant; if x is an odd negative, x % 2 == -1\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic bool IsOdd(int x)\n{\n  return x % 2 != 0;\n}\n</pre>\n<p>or</p>\n<pre>\npublic bool IsOdd(uint x)\n{\n  return x % 2 == 1;\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2197.json",
    "content": "{\n  \"title\": \"Modulus results should not be checked for direct equality\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-2197\",\n  \"sqKey\": \"S2197\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2198.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Certain <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/comparison-operators\">mathematical comparisons</a>\nwill always return the same value, and should not be performed.</p>\n<p>Specifically, the following comparisons will return either always <code>true</code> or always <code>false</code> depending on the kind of\ncomparison:</p>\n<ul>\n  <li>comparing a <code>char</code> with a numeric constant that is outside of the range of <code>char</code></li>\n  <li>comparing a <code>float</code> with a numeric constant that is outside of the range of <code>float</code></li>\n  <li>comparing a <code>long</code> with a numeric constant that is outside of the range of <code>long</code></li>\n  <li>comparing a <code>ulong</code> with a numeric constant that is outside of the range of <code>ulong</code></li>\n  <li>etc.</li>\n</ul>\n<h3>Noncompliant code example</h3>\n<pre>\nfloat f = 42.0f;\nif (f &lt;= double.MaxValue) { } // Noncompliant: always true\nif (f &gt; double.MaxValue) { }  // Noncompliant: always false\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn: <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/comparison-operators\">Comparison\n  operators (C# reference)</a></li>\n  <li>Microsoft Learn: <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/integral-numeric-types#characteristics-of-the-integral-types\">Ranges for integral numeric types (C# reference)</a></li>\n  <li>Microsoft Learn: <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/char\">Range for char (C#\n  reference)</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2198.json",
    "content": "{\n  \"title\": \"Unnecessary mathematical comparisons should not be made\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-2198\",\n  \"sqKey\": \"S2198\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2201.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When you do not use the return value of a method with no side effects, it indicates that something is wrong. Either this method is unnecessary, or\nthe source code does not behave as expected and could lead to code defects. For example, there are methods, such as <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetime.addyears\">DateTime.AddYears</a>, that don’t change the value of the input object,\nbut instead, they return a new object whose value is the result of this operation, and as a result that you will have unexpected effects if you do not\nuse the return value.</p>\n<p>This rule raises an issue when the results of the following methods are ignored:</p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/linq/\">LINQ</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.contracts.pureattribute\"><code>Pure</code> methods</a></li>\n  <li>Any method on <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/built-in-types\">build-in types</a></li>\n  <li>Any method on <a href=\"https://learn.microsoft.com/en-us/archive/msdn-magazine/2017/march/net-framework-immutable-collections\">Immutable\n  collections</a></li>\n</ul>\n<p>Special cases:</p>\n<ul>\n  <li>Although <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.intern\"><code>string.Intern</code></a> has a side effect, ignoring\n  its return value is still suspicious as it is the only reference ensured to point to the intern pool.</li>\n  <li>LINQ methods can have side effects if they are misused. For example:</li>\n</ul>\n<pre>\ndata.All(x =&gt;\n{\n    x.Property = \"foo\";\n    return true;\n});\n</pre>\n<p>Such code should be rewritten as a loop because <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.all\"><code>Enumerable.All&lt;TSource&gt;</code></a> method should be used to\ndetermine if all elements satisfy a condition and not to change their state.</p>\n<h3>Exceptions</h3>\n<p>This rule doesn’t report issues on invocations with <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/out-parameter-modifier\"><code>out</code></a> or <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/ref\"><code>ref</code></a> arguments.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\ndata.Where(x =&gt; x &gt; 5).Select(x =&gt; x * x); // Noncompliant\n\"this string\".Equals(\"other string\"); // Noncompliant\n\ndata.All(x =&gt;  // Noncompliant\n{\n    x.Property = \"foo\";\n    return true;\n});\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nvar res = data.Where(x =&gt; x &gt; 5).Select(x =&gt; x * x);\nvar isEqual = \"this string\".Equals(\"other string\");\n\nforeach (var x in data)\n{\n    x.Property = \"foo\";\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.contracts.pureattribute\"><code>PureAttribute</code>\n  Class</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/out-parameter-modifier\"><code>out</code>\n  parameter modifier</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/ref\"><code>ref</code> keyword</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.intern\"><code>String.Intern(String)</code> Method</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/linq/\">LINQ</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/built-in-types\">build-in\n  types</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/archive/msdn-magazine/2017/march/net-framework-immutable-collections\">Immutable\n  collections</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li><a href=\"https://www.daniellittle.dev/dont-ignore-your-functions\">Don’t ignore your functions</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2201.json",
    "content": "{\n  \"title\": \"Methods without side effects should not have their return values ignored\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"suspicious\",\n    \"confusing\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2201\",\n  \"sqKey\": \"S2201\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2219.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>To check the type of an object there are several options:</p>\n<ul>\n  <li><code>expr is SomeType</code> or <code>expr.GetType() == typeof(SomeType)</code> if the type is known at compile time,</li>\n  <li><code>typeInstance.IsInstanceOfType(expr)</code> if the type is calculated during runtime.</li>\n</ul>\n<p>If runtime calculated <code>Type</code>s need to be compared:</p>\n<ul>\n  <li><code>typeInstance1.IsAssignableFrom(typeInstance2)</code>.</li>\n</ul>\n<p>Depending on whether the type is returned by a <code>GetType()</code> or <code>typeof()</code> call, the <code>IsAssignableFrom()</code> and\n<code>IsInstanceOfType()</code> might be simplified. Similarly, if the type is <code>sealed</code>, the type comparison with <code>==</code> can be\nconverted to an <code>is</code> call. Simplifying the calls also make <code>null</code> checking unnecessary because both <code>is</code> and\n<code>IsInstanceOfType</code> performs it already.</p>\n<p>Finally, utilizing the most concise language constructs for type checking makes the code more readable, so</p>\n<ul>\n  <li><code>expr as T != null</code> checks should be simplified to <code>expr is T</code>, and</li>\n  <li><code>expr is T</code> should be converted to <code>expr != null</code>, when <code>expr</code> is of type <code>T</code>.</li>\n</ul>\n<h3>Noncompliant code example</h3>\n<pre>\nclass Fruit { }\nsealed class Apple : Fruit { }\n\nclass Program\n{\n  static void Main()\n  {\n    var apple = new Apple();\n    var b = apple != null &amp;&amp; apple.GetType() == typeof (Apple); // Noncompliant\n    b = typeof(Apple).IsInstanceOfType(apple); // Noncompliant\n    if (apple != null)\n    {\n      b = typeof(Apple).IsAssignableFrom(apple.GetType()); // Noncompliant\n    }\n    var appleType = typeof (Apple);\n    if (apple != null)\n    {\n      b = appleType.IsAssignableFrom(apple.GetType()); // Noncompliant\n    }\n\n    Fruit f = apple;\n    if (f as Apple != null) // Noncompliant\n    {\n    }\n    if (apple is Apple) // Noncompliant\n    {\n    }\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nclass Fruit { }\nsealed class Apple : Fruit { }\n\nclass Program\n{\n  static void Main()\n  {\n    var apple = new Apple();\n    var b = apple is Apple;\n    b = apple is Apple;\n    b = apple is Apple;\n    var appleType = typeof(Apple);\n    b = appleType.IsInstanceOfType(apple);\n\n    Fruit f = apple;\n    if (f is Apple)\n    {\n    }\n    if (apple != null)\n    {\n    }\n  }\n}\n</pre>\n<h3>Exceptions</h3>\n<p>Calling <code>GetType</code> on an object of <code>Nullable&lt;T&gt;</code> type returns the underlying generic type parameter <code>T</code>, thus\na comparison with <code>typeof(Nullable&lt;T&gt;)</code> can’t be simplified to use the <code>is</code> operator, which doesn’t make difference\nbetween <code>T</code> and <code>T?</code>.</p>\n<pre>\nint? i = 42;\nbool condition = i.GetType() == typeof(int?); // false;\ncondition = i is int?; // true\n</pre>\n<p>No issue is reported on the following expressions:</p>\n<ul>\n  <li><code>expr is T</code>&nbsp;when either operand of the <code>is</code> operator is a value type. In that case CS0183 or CS0184 reports</li>\n  <li><code>expr is object</code>, as this is a common and efficient pattern to do null checks</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2219.json",
    "content": "{\n  \"title\": \"Runtime type checking should be simplified\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2219\",\n  \"sqKey\": \"S2219\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2221.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Catching <code>System.Exception</code> seems like an efficient way to handle multiple possible exceptions. Unfortunately, it traps all exception\ntypes, including the ones that were not intended to be caught. To prevent any misunderstandings, exception filters should be used. Alternatively, each\nexception type should be in a separate <code>catch</code> block.</p>\n<h3>Noncompliant code example</h3>\n<pre>\ntry\n{\n  // do something that might throw a FileNotFoundException or IOException\n}\ncatch (Exception e) // Noncompliant\n{\n  // log exception ...\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\ntry\n{\n  // do something\n}\ncatch (Exception e) when (e is FileNotFoundException or IOException)\n{\n  // do something\n}\n</pre>\n<h3>Exceptions</h3>\n<p>The final option is to catch <code>System.Exception</code> and <code>throw</code> it in the last statement in the <code>catch</code> block. This is\nthe least-preferred option, as it is an old-style code, which also suffers from performance penalties compared to exception filters.</p>\n<pre>\ntry\n{\n  // do something\n}\ncatch (Exception e)\n{\n  if (e is FileNotFoundException or IOException)\n  {\n    // do something\n  }\n  else\n  {\n    throw;\n  }\n}\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/396\">CWE-396 - Declaration of Catch for Generic Exception</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2221.json",
    "content": "{\n  \"title\": \"\\\"Exception\\\" should not be caught\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"error-handling\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2221\",\n  \"sqKey\": \"S2221\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      396\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2222.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>To prevent potential <a href=\"https://en.wikipedia.org/wiki/Deadlock\">deadlocks</a> in an application, it is crucial to release any locks that are\nacquired within a method along all possible execution paths.</p>\n<p>Failing to release locks properly can lead to potential deadlocks, where the lock might not be released, causing issues in the application.</p>\n<p>This rule specifically focuses on tracking the following types from the <code>System.Threading</code> namespace:</p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.monitor\"><code>Monitor</code></a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.mutex\"><code>Mutex</code></a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlock\"><code>ReaderWriterLock</code></a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlockslim\"><code>ReaderWriterLockSlim</code></a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.spinlock\"><code>SpinLock</code> </a></li>\n</ul>\n<p>An issue is reported when a lock is acquired within a method but not released on all paths.</p>\n<h3>Exceptions</h3>\n<p>If the lock is never released within the method, no issue is raised, assuming that the callers will handle the release.</p>\n<h2>How to fix it</h2>\n<p>To make sure that a lock is always released correctly, you can follow one of these two methods:</p>\n<ul>\n  <li>Use a <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/lock\"><code>lock</code></a> statement with your\n  lock object.</li>\n  <li>Use a <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/exception-handling-statements#the-try-finally-statement\"><code>try-finally</code></a> statement and put the release of your lock object within the finally block.</li>\n</ul>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nclass MyClass\n{\n  private object obj = new object();\n\n  public void DoSomethingWithMonitor()\n  {\n    Monitor.Enter(obj); // Noncompliant: not all paths release the lock\n    if (IsInitialized())\n    {\n      // ...\n      Monitor.Exit(obj);\n    }\n  }\n}\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nclass MyClass\n{\n  private ReaderWriterLockSlim lockObj = new ReaderWriterLockSlim();\n\n  public void DoSomethingWithReaderWriteLockSlim()\n  {\n    lockObj.EnterReadLock(); // Noncompliant: not all paths release the lock\n    if (IsInitialized())\n    {\n      // ...\n      lockObj.ExitReadLock();\n    }\n  }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nclass MyClass\n{\n  private object obj = new object();\n\n  public void DoSomethingWithMonitor()\n  {\n    lock(obj) // Compliant: the lock will be released at the end of the lock block\n    {\n      if (IsInitialized())\n      {\n        // ...\n      }\n    }\n  }\n}\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nclass MyClass\n{\n  private ReaderWriterLockSlim lockObj = new ReaderWriterLockSlim();\n\n  public void DoSomethingWithReaderWriteLockSlim()\n  {\n    lockObj.EnterReadLock(); // Compliant: the lock will be released in the finally block\n    try\n    {\n      if (IsInitialized())\n      {\n        // ...\n      }\n    }\n    finally\n    {\n      lockObj.ExitReadLock();\n    }\n  }\n}\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li><a\n  href=\"https://docs.microsoft.com/en-us/dotnet/standard/threading/overview-of-synchronization-primitives#synchronization-of-access-to-a-shared-resource\">Synchronization of access to a shared resource</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/459\">CWE-459 - Incomplete Cleanup</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/lock\"><code>lock</code> statement</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/exception-handling-statements#the-try-finally-statement\">The\n  <code>try-finally</code> statement</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2222.json",
    "content": "{\n  \"title\": \"Locks should be released on all paths\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"multi-threading\",\n    \"symbolic-execution\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-2222\",\n  \"sqKey\": \"S2222\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      459\n    ]\n  },\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2223.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Unlike instance fields, which can only be accessed by code having a hold on the instance, <code>static</code> fields can be accessed by any code\nhaving visibility of the field and its type.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic class Math\n{\n    public static double Pi = 3.14;  // Noncompliant\n}\n\n// Somewhere else, where Math and Math.Pi are visible\nvar pi = Math.Pi; // Reading the value\nMath.Pi = 3.1416; // Mutating the value\n</pre>\n<p>Another typical scenario of the use of a non-private mutable <code>static</code> field is the following:</p>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\npublic class Shape\n{\n    public static Shape Empty = new EmptyShape();  // Noncompliant\n\n    private class EmptyShape : Shape\n    {\n    }\n}\n</pre>\n<p>Non-private <code>static</code> fields that are neither <code>const</code> nor <code>readonly</code>, like the ones in the examples above, can lead\nto errors and unpredictable behavior.</p>\n<p>This can happen because:</p>\n<ul>\n  <li>Any object can modify these fields and alter the global state. This makes the code more difficult to read, debug and test.\n    <pre>\nclass Counters\n{\n    public static int ErrorCounter = 0;\n}\n\nclass Program\n{\n    public static void Thread1()\n    {\n        // ...\n        Counters.ErrorCounter = 0; // Error counter reset\n        // ...\n    }\n\n    public static void Thread2()\n    {\n        // ...\n        if (Counters.ErrorCounter &gt; 0)\n        {\n            Trace.TraceError($\"There are {Counters.ErrorCounter} errors\"); // It may print \"There are 0 errors\"\n        }\n        // ...\n    }\n}\n</pre></li>\n  <li>Correctly accessing these fields from different threads needs synchronization with <code>lock</code> or equivalent mechanisms. Improper\n  synchronization may lead to unexpected results.\n    <pre>\nclass Counters\n{\n    public static volatile int ErrorCounter;\n}\n\nclass Program\n{\n    public static void ImproperSynchronization()\n    {\n        Counters.ErrorCounter = 0;\n        Parallel.ForEach(Enumerable.Range(0, 1000), _ =&gt; Counters.ErrorCounter++); // Volatile is not enough\n        Console.WriteLine(Counters.ErrorCounter); // May print less than 1000\n    }\n\n    public static void ProperSynchronization()\n    {\n        Counters.ErrorCounter = 0;\n        Parallel.ForEach(Enumerable.Range(0, 1000), _ =&gt; Interlocked.Increment(ref Counters.ErrorCounter));\n        Console.WriteLine(Counters.ErrorCounter); // Always prints 1000\n    }\n}\n</pre></li>\n</ul>\n<p>Publicly visible <code>static</code> fields should only be used to store shared data that does not change. To enforce this intent, these fields\nshould be marked <code>readonly</code> or converted to <code>const</code>.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic class Math\n{\n    public const double Pi = 3.14;\n}\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\npublic class Shape\n{\n    public static readonly Shape Empty = new EmptyShape();\n\n    private class EmptyShape : Shape\n    {\n    }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/static\">static (C# Reference)</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/threading/overview-of-synchronization-primitives\">Overview of synchronization\n  primitives</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/volatile\">volatile (C# Reference)</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li><a href=\"https://softwareengineering.stackexchange.com/a/148154\">Stack Exchange - Mutable global state is evil and alternatives to it</a></li>\n  <li><a href=\"https://ericlippert.com/2007/11/13/immutability-in-c-part-one-kinds-of-immutability/\">Fabulous adventures in coding - Eric Lippert:\n  Immutability in C#</a></li>\n  <li><a href=\"https://stackoverflow.com/a/4628660\">Stack Overflow - Eric Lippert: ++ is not \"threadsafe\"</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2223.json",
    "content": "{\n  \"title\": \"Non-constant static fields should not be visible\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-2223\",\n  \"sqKey\": \"S2223\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2225.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Calling <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.object.tostring\">ToString()</a> on an object should always return a\n<code>string</code>. Thus, <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/how-to-override-the-tostring-method\">overriding the\nToString method</a> should never return <code>null</code>, as it breaks the method’s implicit contract, and as a result the consumer’s\nexpectations.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic override string ToString ()\n{\n  if (this.collection.Count == 0)\n  {\n    return null; // Noncompliant\n  }\n  else\n  {\n    // ...\n  }\n}\n</pre>\n<p>A better alternative is to use the <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.empty\">String.Empty</a> built-in field.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic override string ToString ()\n{\n  if (this.collection.Count == 0)\n  {\n    return string.Empty;\n  }\n  else\n  {\n    // ...\n  }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/476\">CWE-476 - NULL Pointer Dereference</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.object.tostring\">Object.ToString Method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/how-to-override-the-tostring-method\">How to\n  override the ToString method</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2225.json",
    "content": "{\n  \"title\": \"\\\"ToString()\\\" method should not return null\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2225\",\n  \"sqKey\": \"S2225\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      476\n    ]\n  },\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2234.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Calling a method with argument variables whose names match the method parameter names but in a different order can cause confusion. It could\nindicate a mistake in the arguments' order, leading to unexpected results.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic double Divide(int divisor, int dividend)\n{\n    return divisor / dividend;\n}\n\npublic void DoTheThing()\n{\n    int divisor = 15;\n    int dividend = 5;\n\n    double result = Divide(dividend, divisor);  // Noncompliant: arguments' order doesn't match their respective parameter names\n    // ...\n}\n</pre>\n<p>However, matching the method parameters' order contributes to clearer and more readable code:</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic double Divide(int divisor, int dividend)\n{\n    return divisor / dividend;\n}\n\npublic void DoTheThing()\n{\n    int divisor = 15;\n    int dividend = 5;\n\n    double result = Divide(divisor, dividend); // Compliant\n    // ...\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2234.json",
    "content": "{\n  \"title\": \"Arguments should be passed in the same order as the method parameters\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2234\",\n  \"sqKey\": \"S2234\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2245.html",
    "content": "<p>PRNGs are algorithms that produce sequences of numbers that only approximate true randomness. While they are suitable for applications like\nsimulations or modeling, they are not appropriate for security-sensitive contexts because their outputs can be predictable if the internal state is\nknown.</p>\n<p>In contrast, cryptographically secure pseudorandom number generators (CSPRNGs) are designed to be secure against prediction attacks. CSPRNGs use\ncryptographic algorithms to ensure that the generated sequences are not only random but also unpredictable, even if part of the sequence or the\ninternal state becomes known. This unpredictability is crucial for security-related tasks such as generating encryption keys, tokens, or any other\nvalues that must remain confidential and resistant to guessing attacks.</p>\n<p>For example, the use of non-cryptographic PRNGs has led to vulnerabilities such as:</p>\n<ul>\n  <li><a href=\"https://www.cve.org/CVERecord?id=CVE-2013-6386\">CVE-2013-6386</a></li>\n  <li><a href=\"https://www.cve.org/CVERecord?id=CVE-2006-3419\">CVE-2006-3419</a></li>\n  <li><a href=\"https://www.cve.org/CVERecord?id=CVE-2008-4102\">CVE-2008-4102</a></li>\n</ul>\n<p>When software generates predictable values in a context requiring unpredictability, it may be possible for an attacker to guess the next value that\nwill be generated, and use this guess to impersonate another user or access sensitive information. Therefore, it is critical to use CSPRNGs in any\nsecurity-sensitive application to ensure the robustness and security of the system.</p>\n<p>As the <code>System.Random</code> class relies on a non-cryptographic pseudorandom number generator, it should not be used for security-critical\napplications or for protecting sensitive data. In such context, the <code>System.Cryptography.RandomNumberGenerator</code> class which relies on a\nCSPRNG should be used in place.</p>\n<h2>Ask Yourself Whether</h2>\n<ul>\n  <li>the code using the generated value requires it to be unpredictable. It is the case for all encryption mechanisms or when a secret value, such as\n  a password, is hashed.</li>\n  <li>the function you use is a non-cryptographic PRNG.</li>\n  <li>the generated value is used multiple times.</li>\n  <li>an attacker can access the generated value.</li>\n</ul>\n<p>There is a risk if you answered yes to any of those questions.</p>\n<h2>Recommended Secure Coding Practices</h2>\n<ul>\n  <li>Only use random number generators which are <a\n  href=\"https://cheatsheetseries.owasp.org/cheatsheets/Cryptographic_Storage_Cheat_Sheet.html#secure-random-number-generation\">recommended by\n  OWASP</a> or any other trusted organization.</li>\n  <li>Use the generated random values only once.</li>\n  <li>You should not expose the generated random value. If you have to store it, make sure that the database or file is secure.</li>\n</ul>\n<h2>Sensitive Code Example</h2>\n<pre>\nvar random = new Random(); // Sensitive use of Random\nbyte[] data = new byte[16];\nrandom.NextBytes(data);\nreturn BitConverter.ToString(data); // Check if this value is used for hashing or encryption\n</pre>\n<h2>Compliant Solution</h2>\n<pre>\nusing System.Security.Cryptography;\n...\nvar randomGenerator = RandomNumberGenerator.Create();\nbyte[] data = new byte[16];\nrandomGenerator.GetBytes(data);\nreturn BitConverter.ToString(data);\n</pre>\n<h2>See</h2>\n<ul>\n  <li>OWASP - <a href=\"https://cheatsheetseries.owasp.org/cheatsheets/Cryptographic_Storage_Cheat_Sheet.html#secure-random-number-generation\">Secure\n  Random Number Generation Cheat Sheet</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A02_2021-Cryptographic_Failures/\">Top 10 2021 Category A2 - Cryptographic Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure\">Top 10 2017 Category A3 - Sensitive Data\n  Exposure</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/338\">CWE-338 - Use of Cryptographically Weak Pseudo-Random Number Generator\n  (PRNG)</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/330\">CWE-330 - Use of Insufficiently Random Values</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/326\">CWE-326 - Inadequate Encryption Strength</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/1241\">CWE-1241 - Use of Predictable Algorithm in Random Number Generator</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2245.json",
    "content": "{\n  \"title\": \"Using pseudorandom number generators (PRNGs) is security-sensitive\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"HIGH\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-2245\",\n  \"sqKey\": \"S2245\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      326,\n      330,\n      338,\n      1241\n    ],\n    \"OWASP\": [\n      \"A3\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A2\"\n    ],\n    \"ASVS 4.0\": [\n      \"6.2.4\"\n    ]\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2251.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>A <code>for</code> loop with a counter that moves in the wrong direction, away from the stop condition, is not an infinite loop. Because of <a\nhref=\"https://en.wikipedia.org/wiki/Integer_overflow#:~:text=The%20most%20common%20result%20of%20an%20overflow%20is%20that%20the%20least%20significant%20representable%20digits%20of%20the%20result%20are%20stored%3B%20the%20result%20is%20said%20to%20wrap%20around%20the%20maximum\">wraparound</a>,\nthe loop will eventually reach its stop condition, but in doing so, it will probably run more times than anticipated, potentially causing unexpected\nbehavior.</p>\n<h2>How to fix it</h2>\n<p>If your <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/iteration-statements#the-for-statement:~:text=The%20condition%20section%20that%20determines%20if%20the%20next%20iteration%20in%20the%20loop%20should%20be%20executed\">stop\ncondition</a> indicates a <strong>maximum</strong> value, the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/iteration-statements#the-for-statement:~:text=The%20iterator%20section%20that%20defines%20what%20happens%20after%20each%20execution%20of%20the%20body%20of%20the%20loop\">iterator</a>\nshould <strong>increase</strong> towards it. Conversely, if your stop condition indicates a <strong>minimum</strong> value, the iterator should\n<strong>decrease</strong> towards it.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nfor (int i = 0; i &lt; maximum; i--)  // Noncompliant: runs until it underflows to int.MaxValue\n{\n    // ...\n}\n\nfor (int i = maximum; i &gt;= maximum; i++)  // Noncompliant: runs until it overflows to int.MinValue\n{\n    // ...\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nfor (int i = 0; i &lt; maximum; i++) // Compliant: Increment towards the maximum value\n{\n}\n\nfor (int i = maximum; i &gt;= 0; i--) // Compliant: Decrement towards the minimum value\n{\n    // ...\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Integer_overflow\">Integer overflow</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/iteration-statements#the-for-statement\">The\n  <code>for</code> statement</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2251.json",
    "content": "{\n  \"title\": \"A \\\"for\\\" loop update clause should move the counter in the right direction\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2251\",\n  \"sqKey\": \"S2251\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2252.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>A <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/iteration-statements#the-for-statement\"><code>for</code></a> loop\nis a fundamental programming construct used to execute a block of code repeatedly. However, if the loop’s condition is false before the first\niteration, the loop will never execute.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nfor (int i = 0; i &lt; 0; i++)  // Noncompliant: the condition is always false, the loop will never execute\n{\n    // ...\n}\n</pre>\n<p>Rewrite the loop to ensure the condition evaluates to <code>true</code> at least once.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nfor (int i = 0; i &lt; 10; i++)  // Compliant: the condition is true at least once, the loop will execute\n{\n    // ...\n}\n</pre>\n<p>This bug has the potential to cause unexpected outcomes as the loop might contain critical code that needs to be executed.</p>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/iteration-statements#the-for-statement\">The <code>for</code>\n  statement</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2252.json",
    "content": "{\n  \"title\": \"For-loop conditions should be true at least once\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2252\",\n  \"sqKey\": \"S2252\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2257.html",
    "content": "<p>The use of a non-standard algorithm is dangerous because a determined attacker may be able to break the algorithm and compromise whatever data has\nbeen protected. Standard algorithms like <code>AES</code>, <code>RSA</code>, <code>SHA</code>, …​ should be used instead.</p>\n<p>This rule tracks custom implementation of these types from <code>System.Security.Cryptography</code> namespace:</p>\n<ul>\n  <li><code>AsymmetricAlgorithm</code></li>\n  <li><code>AsymmetricKeyExchangeDeformatter</code></li>\n  <li><code>AsymmetricKeyExchangeFormatter</code></li>\n  <li><code>AsymmetricSignatureDeformatter</code></li>\n  <li><code>AsymmetricSignatureFormatter</code></li>\n  <li><code>DeriveBytes</code></li>\n  <li><code>HashAlgorithm</code></li>\n  <li><code>ICryptoTransform</code></li>\n  <li><code>SymmetricAlgorithm</code></li>\n</ul>\n<h2>Recommended Secure Coding Practices</h2>\n<ul>\n  <li>Use a standard algorithm instead of creating a custom one.</li>\n</ul>\n<h2>Sensitive Code Example</h2>\n<pre>\npublic class CustomHash : HashAlgorithm // Noncompliant\n{\n    private byte[] result;\n\n    public override void Initialize() =&gt; result = null;\n    protected override byte[] HashFinal() =&gt; result;\n\n    protected override void HashCore(byte[] array, int ibStart, int cbSize) =&gt;\n        result ??= array.Take(8).ToArray();\n}\n</pre>\n<h2>Compliant Solution</h2>\n<pre>\nSHA256 mySHA256 = SHA256.Create()\n</pre>\n<h2>See</h2>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A02_2021-Cryptographic_Failures/\">Top 10 2021 Category A2 - Cryptographic Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure\">Top 10 2017 Category A3 - Sensitive Data\n  Exposure</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/327\">CWE-327 - Use of a Broken or Risky Cryptographic Algorithm</a></li>\n  <li>Derived from FindSecBugs rule <a href=\"https://h3xstream.github.io/find-sec-bugs/bugs.htm#CUSTOM_MESSAGE_DIGEST\">MessageDigest is\n  Custom</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2257.json",
    "content": "{\n  \"title\": \"Using non-standard cryptographic algorithms is security-sensitive\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"HIGH\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1d\"\n  },\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-2257\",\n  \"sqKey\": \"S2257\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      327\n    ],\n    \"OWASP\": [\n      \"A3\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A2\"\n    ],\n    \"ASVS 4.0\": [\n      \"2.9.3\",\n      \"6.2.2\",\n      \"8.3.7\"\n    ]\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2259.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Accessing a <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/null\">null</a> value will always throw a <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.nullreferenceexception\">NullReferenceException</a> most likely causing an abrupt program\ntermination.</p>\n<p>Such termination might expose sensitive information that a malicious third party could exploit to, for instance, bypass security measures.</p>\n<h3>Exceptions</h3>\n<p>In the following cases, the rule does not raise:</p>\n<h4>Extensions Methods</h4>\n<p>Calls to extension methods can still operate on <code>null</code> values.</p>\n<pre>\nusing System;\nusing System.Text.RegularExpressions;\n\npublic static class Program\n{\n    public static string RemoveVowels(this string value)\n    {\n        if (value == null)\n        {\n            return null;\n        }\n        return Regex.Replace(value, \"[aeoui]*\",\"\", RegexOptions.IgnoreCase);\n    }\n\n    public static void Main()\n    {\n        Console.WriteLine(((string?)null).RemoveVowels());  // Compliant: 'RemoveVowels' is an extension method\n    }\n}\n</pre>\n<h4>Unreachable code</h4>\n<p>Unreachable code is not executed, thus <code>null</code> values will never be accessed.</p>\n<pre>\npublic void Method()\n{\n    object o = null;\n    if (false)\n    {\n        o.ToString();    // Compliant: code is unreachable\n    }\n}\n</pre>\n<h4>Validated value by analysis attributes</h4>\n<p><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/attributes/nullable-analysis\">Nullable analysis attributes</a> enable\nthe developer to annotate methods with information about the null-state of its arguments. Thus, potential <code>null</code> values validated by one of\nthe following attributes will not raise:</p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.notnullattribute\">NotNullAttribute</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.notnullwhenattribute\">NotNullWhenAttribute</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.doesnotreturnattribute\">DoesNotReturnAttribute</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.doesnotreturnifattribute\">DoesNotReturnIfAttribute</a></li>\n</ul>\n<p>It is important to note those attributes are only available starting .NET Core 3. As a workaround, it is possible to define those attributes\nmanually in a custom class:</p>\n<pre>\nusing System;\n\npublic sealed class NotNullAttribute : Attribute { } // The alternative name 'ValidatedNotNullAttribute' is also supported\n\npublic static class Guard\n{\n    public static void NotNull&lt;T&gt;([NotNull] T value, string name) where T : class\n    {\n        if (value == null)\n        {\n            throw new ArgumentNullException(name);\n        }\n    }\n}\n\npublic static class Utils\n{\n    public static string Normalize(string value)\n    {\n        Guard.NotNull(value, nameof(value)); // Will throw if value is null\n        return value.ToUpper(); // Compliant: value is known to be not null here.\n    }\n}\n</pre>\n<h4>Validated value by Debug.Assert</h4>\n<p>A value validated with <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.debug.assert\">Debug.Assert</a> to not be\n<code>null</code> is safe to access.</p>\n<pre>\nusing System.Diagnostics;\n\npublic void Method(object myObject)\n{\n    Debug.Assert(myObject != null);\n    myObject.ToString(); // Compliant: 'myObject' is known to be not null here.\n}\n</pre>\n<h4>Validated value by IDE-specific attributes</h4>\n<p>Like with null-analysis-attribute, potential <code>null</code> values validated by one of the following IDE-specific attributes will not raise</p>\n<h5>Visual Studio</h5>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.validatednotnullattribute\">ValidatedNotNullAttribute</a>  (The attribute is\n  interpreted the same as the <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.notnullattribute\">NotNullAttribute</a>) </li>\n</ul>\n<h5>JetBrains Rider</h5>\n<ul>\n  <li><a href=\"https://www.jetbrains.com/help/resharper/Reference__Code_Annotation_Attributes.html#NotNullAttribute\">NotNullAttribute</a></li>\n  <li><a\n  href=\"https://www.jetbrains.com/help/resharper/Reference__Code_Annotation_Attributes.html#TerminatesProgramAttribute\">TerminatesProgramAttribute</a>\n    <pre>\nusing System;\nusing JetBrains.Annotations;\n\npublic class Utils\n{\n    [TerminatesProgram]\n    public void TerminateProgram()\n    {\n        Environment.FailFast(\"A catastrophic failure has occurred.\")\n    }\n\n    public void TerminatesProgramIsRespected()\n    {\n        object myObject = null;\n        TerminateProgram();\n        myObject.ToString(); // Compliant: unreachable\n    }\n}\n</pre></li>\n</ul>\n<h4>Null forgiving operator</h4>\n<p>Expression marked with the <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/null-forgiving\">null forgiving\noperator</a></p>\n<pre>\npublic void Method()\n{\n    object o = null;\n    o!.ToString();    // Compliant: the null forgiving operator suppresses the nullable warning\n}\n</pre>\n<h2>How to fix it</h2>\n<p>To fix the issue, the access of the <code>null</code> value needs to be prevented by either:</p>\n<ul>\n  <li>ensuring the variable has a value, or</li>\n  <li>by checking if the value is not <code>null</code></li>\n</ul>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<p>The variable <code>myObject</code> is equal to <code>null</code>, meaning it has no value:</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic void Method()\n{\n    object myObject = null;\n    Console.WriteLine(o.ToString()); // Noncompliant: 'myObject' is always null\n}\n</pre>\n<p>The parameter <code>input</code> might be <code>null</code> as suggested by the <code>if</code> condition:</p>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\npublic void Method(object input)\n{\n    if (input is null)\n    {\n        // ...\n    }\n    Console.WriteLine(input.ToString()); // Noncompliant: the if condition suggests 'input' might be null\n}\n</pre>\n<h4>Compliant solution</h4>\n<p>Ensuring the variable <code>myObject</code> has a value resolves the issue:</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic void Method()\n{\n    var myObject = new object();\n    Console.WriteLine(myObject.ToString()); // Compliant: 'myObject' is not null\n}\n</pre>\n<p>Preventing the non-compliant code to be executed by returning early:</p>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\npublic void Method(object input)\n{\n    if (input is null)\n    {\n        return;\n    }\n    Console.WriteLine(input.ToString()); // Compliant: if 'input' is null, this is unreachable\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>CVE - <a href=\"https://cwe.mitre.org/data/definitions/476\">CWE-476 - NULL Pointer Dereference</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.nullreferenceexception\">NullReferenceException Class</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/attributes/nullable-analysis\">Attributes for\n  null-state static analysis interpreted by the C# compiler</a>\n    <ul>\n      <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.notnullattribute\">NotNullAttribute\n      Class</a></li>\n      <li>Microsoft Learn - <a\n      href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.notnullwhenattribute\">NotNullWhenAttribute Class</a></li>\n      <li>Microsoft Learn - <a\n      href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.doesnotreturnattribute\">DoesNotReturnAttribute Class</a></li>\n      <li>Microsoft Learn - <a\n      href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.doesnotreturnifattribute\">DoesNotReturnIfAttribute\n      Class</a></li>\n    </ul></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.validatednotnullattribute\">ValidatedNotNullAttribute Class</a>\n  in Visual Studio</li>\n  <li>JetBrains Resharper - <a\n  href=\"https://www.jetbrains.com/help/resharper/Reference__Code_Annotation_Attributes.html#NotNullAttribute\">NotNullAttribute</a></li>\n  <li>JetBrains Resharper - <a\n  href=\"https://www.jetbrains.com/help/resharper/Reference__Code_Annotation_Attributes.html#TerminatesProgramAttribute\">TerminatesProgramAttribute</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/null\">null (C# Reference)</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/null-forgiving\">! (null-forgiving)\n  operator (C# reference)</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2259.json",
    "content": "{\n  \"title\": \"Null pointers should not be dereferenced\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"symbolic-execution\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2259\",\n  \"sqKey\": \"S2259\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      476\n    ]\n  },\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2275.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Composite format strings in C# are evaluated at runtime, which means they are not verified by the compiler. Introducing an ill-formed format item,\nor indexing mismatch can lead to unexpected behaviors or runtime errors. The purpose of this rule is to perform static validation on composite format\nstrings used in various string formatting functions to ensure their correct usage. This rule validates the proper behavior of composite formats when\ninvoking the following methods:</p>\n<ul>\n  <li><code>String.Format</code></li>\n  <li><code>StringBuilder.AppendFormat</code></li>\n  <li><code>Console.Write</code></li>\n  <li><code>Console.WriteLine</code></li>\n  <li><code>TextWriter.Write</code></li>\n  <li><code>TextWriter.WriteLine</code></li>\n  <li><code>Debug.WriteLine(String, Object[])</code></li>\n  <li><code>Trace.TraceError(String, Object[])</code></li>\n  <li><code>Trace.TraceInformation(String, Object[])</code></li>\n  <li><code>Trace.TraceWarning(String, Object[])</code></li>\n  <li><code>TraceSource.TraceInformation(String, Object[])</code></li>\n</ul>\n<h3>Noncompliant code example</h3>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\ns = string.Format(\"[0}\", arg0); // Noncompliant: square bracket '[' instead of curly bracket '{'\ns = string.Format(\"{{0}\", arg0); // Noncompliant: double starting curly brackets '{{'\ns = string.Format(\"{0}}\", arg0); // Noncompliant: double ending curly brackets '}}'\ns = string.Format(\"{-1}\", arg0); // Noncompliant: invalid index for the format item, must be &gt;= 0\ns = string.Format(\"{0} {1}\", arg0); // Noncompliant: two format items in the string but only one argument provided\n</pre>\n<h3>Compliant solution</h3>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\ns = string.Format(\"{0}\", 42); // Compliant\ns = string.Format(\"{0,10}\", 42); // Compliant\ns = string.Format(\"{0,-10}\", 42); // Compliant\ns = string.Format(\"{0:0000}\", 42); // Compliant\ns = string.Format(\"{2}-{0}-{1}\", 1, 2, 3); // Compliant\ns = string.Format(\"no format\"); // Compliant\n</pre>\n<h3>Exceptions</h3>\n<p>The rule does not perform any checks on the format specifier, if present (defined after the <code>:</code>). Moreover, no issues are raised in the\nfollowing cases:</p>\n<ul>\n  <li>the format string is not a <code>const</code>.\n    <pre>\nvar pattern = \"{0} {1} {2}\";\nvar res = string.Format(pattern, 1, 2); // Compliant, non-constant string are not recognized\n</pre></li>\n  <li>the argument is not an inline creation array.\n    <pre>\nvar array = new int[] {};\nvar res = string.Format(\"{0} {1}\", array); // Compliant the rule does not check the size of the array\n</pre></li>\n</ul>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/base-types/composite-formatting\">Composite formatting</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.format\">String.Format</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.text.stringbuilder.appendformat\">StringBuilder.AppendFormat</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.console.write\">Console.Write</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.console.writeline\">Console.WriteLine</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.io.textwriter.write\">TextWriter.Write</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.io.textwriter.writeline\">TextWriter.WriteLine</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.debug.writeline\">Debug.WriteLine</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.traceerror\">Trace.TraceError</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.traceinformation\">Trace.TraceInformation</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.tracewarning\">Trace.TraceWarning</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.tracesource.traceinformation\">TraceSource.TraceInformation</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/base-types/formatting-types\">Standard format strings</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2275.json",
    "content": "{\n  \"title\": \"Composite format strings should not lead to unexpected behavior at runtime\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-2275\",\n  \"sqKey\": \"S2275\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2290.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/event-pattern#define-and-raise-field-like-events\">Field-like</a> events are events that do\nnot have explicit <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/add\"><code>add</code></a> and <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/remove\"><code>remove</code></a> accessors.</p>\n<pre>\npublic event EventHandler MyEvent; // No add and remove accessors\n</pre>\n<p>The compiler generates a <code>private</code> <code>delegate</code> field to back the event, as well as generating the implicit <code>add</code>\nand <code>remove</code> accessors.</p>\n<p>When a <code>virtual</code> field-like <code>event</code> is overridden by another field-like <code>event</code>, the behavior of the C# compiler\nis to generate a new <code>private</code> <code>delegate</code> field in the derived class, separate from the parent’s field. This results in multiple\nand separate events being created, which is rarely what’s actually intended.</p>\n<h3>Noncompliant code example</h3>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nabstract class Car\n{\n  public virtual event EventHandler OnRefuel; // Noncompliant\n\n  public void Refuel()\n  {\n    // This OnRefuel will always be null\n     if (OnRefuel != null)\n     {\n       OnRefuel(this, EventArgs.Empty);\n     }\n  }\n}\n\nclass R2 : Car\n{\n  public override event EventHandler OnRefuel;\n}\n\nclass Program\n{\n  static void Main(string[] args)\n  {\n    var r2 = new R2();\n    r2.OnRefuel += (o, a) =&gt;\n    {\n        Console.WriteLine(\"This event will be called\");\n    };\n    r2.Refuel();\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<p>To prevent this, remove the <code>virtual</code> designation from the parent class event.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nabstract class Car\n{\n  public event EventHandler OnRefuel; // Compliant\n\n  public void Refuel()\n  {\n    if (OnRefuel != null)\n    {\n      OnRefuel(this, EventArgs.Empty);\n    }\n  }\n}\n\nclass R2 : Car\n{\n\n}\n\nclass Program\n{\n  static void Main(string[] args)\n  {\n    var r2 = new R2();\n    r2.OnRefuel += (o, a) =&gt;\n    {\n        Console.WriteLine(\"This event will be called\");\n    };\n    r2.Refuel();\n  }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/add\">Add keyword</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/remove\">Remove keyword</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/delegate-class\">Delegates</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/events-overview\">Introduction to events</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/event-pattern#define-and-raise-field-like-events\">Field-like events</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2290.json",
    "content": "{\n  \"title\": \"Field-like events should not be virtual\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-2290\",\n  \"sqKey\": \"S2290\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2291.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.sum\">Enumerable.Sum()</a> always executes addition in a\n<code>checked</code> context, so an <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.overflowexception\">OverflowException</a> will be\nthrown if the value exceeds <code>MaxValue</code>, even if an <code>unchecked</code> context was specified. Therefore, using this method inside an\n<code>unchecked</code> context will only make the code more confusing, since the behavior will still be <code>checked</code>.</p>\n<p>This rule raises an issue when an <code>unchecked</code> context is specified for a <code>Sum</code> on integer types.</p>\n<h3>Exceptions</h3>\n<p>When the <code>Sum</code> call is inside a <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/exceptions/\">try-catch block</a>,\nno issues are reported, since the exception is properly handled.</p>\n<pre>\nvoid Add(List&lt;int&gt; list)\n{\n  unchecked\n  {\n    try\n    {\n      int total = list.Sum();\n    }\n    catch (System.OverflowException e)\n    {\n      // Exception handling\n    }\n  }\n}\n</pre>\n<h2>How to fix it</h2>\n<p>Remove the <code>unchecked</code> operator/statement, and optionally add some exception handling for the <code>OverflowException</code>.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nvoid Add(List&lt;int&gt; list)\n{\n  int total1 = unchecked(list.Sum());  // Noncompliant\n\n  unchecked\n  {\n    int total2 = list.Sum();  // Noncompliant\n  }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nvoid Add(List&lt;int&gt; list)\n{\n  int total1 = list.Sum();\n\n  try\n  {\n    int total2 = list.Sum();\n  }\n  catch (System.OverflowException e)\n  {\n    // Exception handling\n  }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.sum\"><code>Enumerable.Sum</code> Method</a></li>\n  <li><a\n  href=\"https://github.com/microsoft/referencesource/blob/51cf7850defa8a17d815b4700b67116e3fa283c2/System.Core/System/Linq/Enumerable.cs#L1408-L1415\"><code>Enumerable.Sum</code> implementation</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/checked-and-unchecked\"><code>checked</code> and\n  <code>unchecked</code> statements</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/expressions#12819-the-checked-and-unchecked-operators\"><code>checked</code> and <code>unchecked</code> operators</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/exceptions/\">Exceptions and Exception Handling</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.overflowexception\"><code>OverflowException</code> Class</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Integer_overflow\">Integer overflow</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2291.json",
    "content": "{\n  \"title\": \"Overflow checking should not be disabled for \\\"Enumerable.Sum\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [\n    \"error-handling\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-2291\",\n  \"sqKey\": \"S2291\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2292.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Trivial properties, which include no logic but setting and getting a backing field should be converted to auto-implemented properties, yielding\ncleaner and more readable code.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic class Car\n{\n  private string _make;\n  public string Make // Noncompliant\n  {\n    get { return _make; }\n    set { _make = value; }\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic class Car\n{\n  public string Make { get; set; }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2292.json",
    "content": "{\n  \"title\": \"Trivial properties should be auto-implemented\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2292\",\n  \"sqKey\": \"S2292\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2302.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Because parameter names could be changed during refactoring, they should not be spelled out literally in strings. Instead, use\n<code>nameof()</code>, and the string that’s output will always be correct.</p>\n<p>This rule raises an issue when a string in the <code>throw</code> statement contains the name of one of the method parameters.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nvoid DoSomething(int someParameter, string anotherParam)\n{\n    if (someParameter &lt; 0)\n    {\n        throw new ArgumentException(\"Bad argument\", \"someParameter\");  // Noncompliant\n    }\n    if (anotherParam == null)\n    {\n        throw new Exception(\"anotherParam should not be null\"); // Noncompliant\n    }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nvoid DoSomething(int someParameter)\n{\n    if (someParameter &lt; 0)\n    {\n        throw new ArgumentException(\"Bad argument\", nameof(someParameter));\n    }\n    if (anotherParam == null)\n    {\n        throw new Exception($\"{nameof(anotherParam)} should not be null\");\n    }\n}\n</pre>\n<h3>Exceptions</h3>\n<ul>\n  <li>The rule doesn’t raise any issue when using C# &lt; 6.0.</li>\n  <li>When the parameter name is contained in a sentence inside the <code>throw</code> statement string, the rule will raise an issue only if the\n  parameter name is at least 5 characters long. This is to avoid false positives.</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2302.json",
    "content": "{\n  \"title\": \"\\\"nameof\\\" should be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"MODULAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"bad-practice\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-2302\",\n  \"sqKey\": \"S2302\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2306.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Since C# 5.0, <code>async</code> and <code>await</code> are <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/#contextual-keywords\">contextual keywords</a>. Contextual keywords\ndo have a particular meaning in some contexts, but are not reserved and therefore can be used as variable names.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nint await = 42; // Noncompliant, but compiles\nint async = 42; // Noncompliant, but compiles\n</pre>\n<p><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords\">Keywords</a>, on the other hand, are always reserved and\ntherefore are not valid variable names.</p>\n<pre>\nint abstract = 42; // Error CS1585: Member modifier 'abstract' must precede the member type and name\nint foreach = 42; // Error CS1519: Invalid token 'foreach' in class, struct, or interface member declaration\n</pre>\n<p>To avoid any confusion, it is best to not use <code>async</code> and <code>await</code> as identifiers.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nint someVariableName = 42;\nint someOtherVariableName = 42;\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/#contextual-keywords\">Contextual Keywords - MSDN</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/asynchronous-programming/\">Asynchronous programming - MSDN</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2306.json",
    "content": "{\n  \"title\": \"\\\"async\\\" and \\\"await\\\" should not be used as identifiers\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-2306\",\n  \"sqKey\": \"S2306\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2325.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Methods and properties that don’t access instance data should be marked as <code>static</code> for the following reasons:</p>\n<ul>\n  <li>Clarity and Intent: Marking a method/property as static makes it clear that the method does not depend on instance data and can be called\n  without creating an instance of the class. This improves the readability of the code by clearly conveying the member’s intended use.</li>\n  <li>Performance: Instance methods/properties in C# require an instance of the class to be called. This means that even if the it doesn’t use any\n  instance data, the runtime still needs to pass a reference to the instance during the call. For static methods and properties, this overhead is\n  avoided, leading to slightly better performance.</li>\n  <li>Memory Usage: Since instance methods implicitly carry a reference to the instance (the caller object), they can potentially prevent the garbage\n  collector from collecting the instance whem it is not otherwise referenced. Static members do not carry this overhead, potentially reducing memory\n  usage.</li>\n  <li>Testing: Static members can be easier to test since they do not require an instance of the class. This can simplify unit testing and reduce the\n  amount of boilerplate code needed to set up tests.</li>\n</ul>\n<h3>Exceptions</h3>\n<p>Methods with the following names are excluded because they can’t be made <code>static</code>:</p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.web.httpapplication.authenticaterequest\">Application_AuthenticateRequest</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.web.httpapplication.beginrequest\">Application_BeginRequest</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/previous-versions/aspnet/ms178473(v=vs.100)\">Application_End</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.web.httpapplication.endrequest\">Application_EndRequest</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/previous-versions/aspnet/24395wz3(v=vs.100)\">Application_Error</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/previous-versions/aspnet/ms178473(v=vs.100)\">Application_Init</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/previous-versions/aspnet/ms178473(v=vs.100)\">Application_Start</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.web.sessionstate.sessionstatemodule.end\">Session_End</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.web.sessionstate.sessionstatemodule.start\">Session_Start</a></li>\n</ul>\n<p>Event handler methods part of a <a href=\"https://learn.microsoft.com/en-us/dotnet/desktop/winforms\">Windows Forms</a> or <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/desktop/wpf\">Windows Presentation Foundation</a> class are excluded because they can’t be made\n<code>static</code>.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic class Utilities\n{\n    public int MagicNum // Noncompliant - only returns a constant value\n    {\n        get\n        {\n            return 42;\n        }\n    }\n\n    private static string magicWord = \"please\";\n    public string MagicWord  // Noncompliant - only accesses a static field\n    {\n        get\n        {\n            return magicWord;\n        }\n        set\n        {\n            magicWord = value;\n        }\n    }\n\n    public int Sum(int a, int b)  // Noncompliant - doesn't access instance data, only the method parameters\n    {\n        return a + b;\n    }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic class Utilities\n{\n    public static int MagicNum\n    {\n        get\n        {\n            return 42;\n        }\n    }\n\n    private static string magicWord = \"please\";\n    public static string MagicWord\n    {\n        get\n        {\n            return magicWord;\n        }\n        set\n        {\n            magicWord = value;\n        }\n    }\n\n    public static int Sum(int a, int b)\n    {\n        return a + b;\n    }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/static\">The static modifier</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2325.json",
    "content": "{\n  \"title\": \"Methods and properties that don\\u0027t access instance data should be static\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2325\",\n  \"sqKey\": \"S2325\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2326.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Type parameters that aren’t used are dead code, which can only distract and possibly confuse developers during maintenance. Therefore, unused type\nparameters should be removed.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic class MoreMath&lt;T&gt;   // Noncompliant; &lt;T&gt; is ignored\n{\n  public int Add&lt;T&gt;(int a, int b) // Noncompliant; &lt;T&gt; is ignored\n  {\n    return a + b;\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic class MoreMath\n{\n  public int Add (int a, int b)\n  {\n    return a + b;\n  }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2326.json",
    "content": "{\n  \"title\": \"Unused type parameters should be removed\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"unused\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2326\",\n  \"sqKey\": \"S2326\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2327.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When multiple, adjacent <code>try</code> statements have duplicate <code>catch</code> and/or <code>finally</code> blocks, they should be merged to\nconsolidate the <code>catch/finally</code> logic for cleaner, more readable code. Note that this applies even when there is intervening code outside\nany <code>try</code> block.</p>\n<h3>Noncompliant code example</h3>\n<pre>\ntry\n{\n  DoTheFirstThing(a, b);\n}\ncatch (InvalidOperationException ex)\n{\n  HandleException(ex);\n}\n\nDoSomeOtherStuff();\n\ntry  // Noncompliant; catch is identical to previous\n{\n  DoTheSecondThing();\n}\ncatch (InvalidOperationException ex)\n{\n  HandleException(ex);\n}\n\ntry  // Compliant; catch handles exception differently\n{\n  DoTheThirdThing(a);\n}\ncatch (InvalidOperationException ex)\n{\n  LogAndDie(ex);\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\ntry\n{\n  DoTheFirstThing(a, b);\n  DoSomeOtherStuff();\n  DoTheSecondThing();\n}\ncatch (InvalidOperationException ex)\n{\n  HandleException(ex);\n}\n\ntry  // Compliant; catch handles exception differently\n{\n  DoTheThirdThing(a);\n}\ncatch (InvalidOperationException ex)\n{\n  LogAndDie(ex);\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2327.json",
    "content": "{\n  \"title\": \"\\\"try\\\" statements with identical \\\"catch\\\" and\\/or \\\"finally\\\" blocks should be merged\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"DISTINCT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2327\",\n  \"sqKey\": \"S2327\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2328.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><code>GetHashCode</code> is used to file an object in a <code>Dictionary</code> or <code>Hashtable</code>. If <code>GetHashCode</code> uses\nnon-<code>readonly</code> fields and those fields change after the object is stored, the object immediately becomes mis-filed in the\n<code>Hashtable</code>. Any subsequent test to see if the object is in the <code>Hashtable</code> will return a false negative.</p>\n<h3>Exceptions</h3>\n<p>This rule does not raise if the type implementing <code>GetHashCode</code> is a value type, for example a <code>struct</code> or a <code>record\nstruct</code>, since when a value type is stored in a <code>Dictionary</code> or <code>Hashtable</code>, a copy of the value is stored, not a\nreference to the value.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic class Person\n{\n  public int age;\n  public string name;\n\n  public override int GetHashCode()\n  {\n    int hash = 12;\n    hash += this.age.GetHashCode(); // Noncompliant\n    hash += this.name.GetHashCode(); // Noncompliant\n    return hash;\n  }\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic class Person\n{\n  public readonly DateTime birthday;\n  public string name;\n\n  public override int GetHashCode()\n  {\n    int hash = 12;\n    hash += this.birthday.GetHashCode();\n    return hash;\n  }\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2328.json",
    "content": "{\n  \"title\": \"\\\"GetHashCode\\\" should not reference mutable fields\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"LOW\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2328\",\n  \"sqKey\": \"S2328\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2330.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Array covariance is the principle that if an implicit or explicit reference conversion exits from type <code>A</code> to <code>B</code>, then the\nsame conversion exists from the array type <code>A[]</code> to <code>B[]</code>.</p>\n<p>While this array conversion can be useful in readonly situations to pass instances of <code>A[]</code> where <code>B[]</code> is expected, it must\nbe used with care, since assigning an instance of <code>B</code> into an array of <code>A</code> will cause an <code>ArrayTypeMismatchException</code>\nto be thrown at runtime.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nabstract class Fruit { }\nclass Apple : Fruit { }\nclass Orange : Fruit { }\n\nclass Program\n{\n  static void Main(string[] args)\n  {\n    Fruit[] fruits = new Apple[1]; // Noncompliant - array covariance is used\n    FillWithOranges(fruits);\n  }\n\n  // Just looking at the code doesn't reveal anything suspicious\n  static void FillWithOranges(Fruit[] fruits)\n  {\n    for (int i = 0; i &lt; fruits.Length; i++)\n    {\n      fruits[i] = new Orange(); // Will throw an ArrayTypeMismatchException\n    }\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nabstract class Fruit { }\nclass Apple : Fruit { }\nclass Orange : Fruit { }\n\nclass Program\n{\n  static void Main(string[] args)\n  {\n    Orange[] fruits = new Orange[1]; // Compliant\n    FillWithOranges(fruits);\n  }\n\n  static void FillWithOranges(Orange[] fruits)\n  {\n    for (int i = 0; i &lt; fruits.Length; i++)\n    {\n      fruits[i] = new Orange();\n    }\n  }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2330.json",
    "content": "{\n  \"title\": \"Array covariance should not be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-2330\",\n  \"sqKey\": \"S2330\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2333.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Unnecessary keywords simply clutter the code and should be removed. Specifically:</p>\n<ul>\n  <li><code>partial</code> on type declarations that are completely defined in one place</li>\n  <li><code>sealed</code> on members of <code>sealed</code> classes</li>\n  <li><code>unsafe</code> method or block inside construct already marked with <code>unsafe</code>, or when there are no <code>unsafe</code>\n  constructs in the block</li>\n  <li><code>checked</code> and <code>unchecked</code> blocks with no integral-type arithmetic operations</li>\n</ul>\n<h3>Noncompliant code example</h3>\n<pre>\npublic partial class MyClass // Noncompliant\n{\n  public virtual void Method()\n  {\n  }\n}\n\npublic sealed class MyOtherClass : MyClass\n{\n  public sealed override void Method() // Noncompliant\n  {\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic class MyClass\n{\n  public virtual void Method()\n  {\n  }\n}\n\npublic sealed class MyOtherClass : MyClass\n{\n  public override void Method()\n  {\n  }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2333.json",
    "content": "{\n  \"title\": \"Redundant modifiers should not be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"unused\",\n    \"finding\",\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2333\",\n  \"sqKey\": \"S2333\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2339.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Constant members are copied at compile time to the call sites, instead of being fetched at runtime.</p>\n<p>As an example, say you have a library with a constant <code>Version</code> member set to <code>1.0</code>, and a client application linked to it.\nThis library is then updated and <code>Version</code> is set to <code>2.0</code>. Unfortunately, even after the old DLL is replaced by the new one,\n<code>Version</code> will still be <code>1.0</code> for the client application. In order to see <code>2.0</code>, the client application would need to\nbe rebuilt against the new version of the library.</p>\n<p>This means that you should use constants to hold values that by definition will never change, such as <code>Zero</code>. In practice, those cases\nare uncommon, and therefore it is generally better to avoid constant members.</p>\n<p>This rule only reports issues on public constant fields, which can be reached from outside the defining assembly.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic class Foo\n{\n    public const double Version = 1.0;           // Noncompliant\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic class Foo\n{\n    public static double Version\n    {\n      get { return 1.0; }\n    }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2339.json",
    "content": "{\n  \"title\": \"Public constant members should not be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-2339\",\n  \"sqKey\": \"S2339\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2342.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Shared naming conventions allow teams to collaborate efficiently. This rule checks that all <code>enum</code> names match a provided regular\nexpression.</p>\n<p>The default configuration is the one recommended by Microsoft:</p>\n<ul>\n  <li>Pascal casing, starting with an upper case character, e.g. BackColor</li>\n  <li>Short abbreviations of 2 letters can be capitalized, e.g. GetID</li>\n  <li>Longer abbreviations need to be lower case, e.g. GetHtml</li>\n  <li>If the enum is marked as [Flags] then its name should be plural (e.g. MyOptions), otherwise, names should be singular (e.g. MyOption)</li>\n</ul>\n<h3>Noncompliant code example</h3>\n<p>With the default regular expression for non-flags enums: <code>^([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?$</code></p>\n<pre>\npublic enum foo // Noncompliant\n{\n    FooValue = 0\n}\n</pre>\n<p>With the default regular expression for flags enums: <code>^([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?s$</code></p>\n<pre>\n[Flags]\npublic enum Option // Noncompliant\n{\n    None = 0,\n    Option1 = 1,\n    Option2 = 2\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic enum Foo\n{\n    FooValue = 0\n}\n</pre>\n<pre>\n[Flags]\npublic enum Options\n{\n    None = 0,\n    Option1 = 1,\n    Option2 = 2\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2342.json",
    "content": "{\n  \"title\": \"Enumeration types should comply with a naming convention\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2342\",\n  \"sqKey\": \"S2342\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2344.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The information that an enumeration type is actually an enumeration or a set of flags should not be duplicated in its name.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nenum FooFlags // Noncompliant\n{\n    Foo = 1\n    Bar = 2\n    Baz = 4\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nenum Foo\n{\n    Foo = 1\n    Bar = 2\n    Baz = 4\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2344.json",
    "content": "{\n  \"title\": \"Enumeration type names should not have \\\"Flags\\\" or \\\"Enum\\\" suffixes\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2344\",\n  \"sqKey\": \"S2344\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2345.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When you annotate an <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.enum\">Enum</a> with the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.flagsattribute\">Flags attribute</a>, you must not rely on the values that are automatically\nset by the language to the <code>Enum</code> members, but you should define the enumeration constants in powers of two (1, 2, 4, 8, and so on).\nAutomatic value initialization will set the first member to zero and increment the value by one for each subsequent member. As a result, you won’t be\nable to use the enum members with bitwise operators.</p>\n<h3>Exceptions</h3>\n<p>The default initialization of <code>0, 1, 2, 3, 4, …​</code> matches <code>0, 1, 2, 4, 8 …​</code> in the first three values, so no issue is\nreported if the first three members of the enumeration are not initialized.</p>\n<h2>How to fix it</h2>\n<p>Define enumeration constants in powers of two, that is, 1, 2, 4, 8, and so on.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nvar bananaAndStrawberry = FruitType.Banana | FruitType.Strawberry;\nConsole.WriteLine(bananaAndStrawberry.ToString());  // Will display only \"Strawberry\"\n\n[Flags]\nenum FruitType    // Noncompliant\n{\n  None,\n  Banana,\n  Orange,\n  Strawberry\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nvar bananaAndStrawberry = FruitType.Banana | FruitType.Strawberry;\nConsole.WriteLine(bananaAndStrawberry.ToString()); // Will display \"Banana, Strawberry\"\n\n[Flags]\nenum FruitType\n{\n  None = 0,\n  Banana = 1,\n  Orange = 2,\n  Strawberry = 4\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.enum\">Enum Class</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.flagsattribute\">FlagsAttribute Class</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2345.json",
    "content": "{\n  \"title\": \"Flags enumerations should explicitly initialize all their members\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"LOW\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2345\",\n  \"sqKey\": \"S2345\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2346.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>An enumeration can be decorated with the <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.flagsattribute\">FlagsAttribute</a> to\nindicate that it can be used as a <a href=\"https://en.wikipedia.org/wiki/Bit_field\">bit field</a>: a set of flags, that can be independently set and\nreset.</p>\n<p>For example, the following definition of the day of the week:</p>\n<pre>\n[Flags]\nenum Days\n{\n    Monday = 1,    // 0b00000001\n    Tuesday = 2,   // 0b00000010\n    Wednesday = 4, // 0b00000100\n    Thursday = 8,  // 0b00001000\n    Friday = 16,   // 0b00010000\n    Saturday = 32, // 0b00100000\n    Sunday = 64    // 0b01000000\n}\n</pre>\n<p>allows to define special set of days, such as <code>WeekDays</code> and <code>Weekend</code> using the <code>|</code> operator:</p>\n<pre>\n[Flags]\nenum Days\n{\n    // ...\n    None = 0,                                                    // 0b00000000\n    Weekdays = Monday | Tuesday | Wednesday | Thursday | Friday, // 0b00011111\n    Weekend = Saturday | Sunday,                                 // 0b01100000\n    All = Weekdays | Weekend                                     // 0b01111111\n}\n</pre>\n<p>These can be used to write more expressive conditions, taking advantage of <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/bitwise-and-shift-operators\">bitwise operators</a> and <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.enum.hasflag\">Enum.HasFlag</a>:</p>\n<pre>\nvar someDays = Days.Wednesday | Days.Weekend;  // 0b01100100\nsomeDays.HasFlag(Days.Wednesday);              // someDays contains Wednesday\n\nvar mondayAndWednesday = Days.Monday | Days.Wednesday;\nsomeDays.HasFlag(mondayAndWednesday);          // someDays contains Monday and Wednesday\nsomeDays.HasFlag(Days.Monday) || someDays.HasFlag(Days.Wednesday); // someDays contains Monday or Wednesday\nsomeDays &amp; Days.Weekend != Days.None;          // someDays overlaps with the weekend\nsomeDays &amp; Days.Weekdays == Days.Weekdays;     // someDays is only made of weekdays\n</pre>\n<p>Consistent use of <code>None</code> in flag enumerations indicates that all flag values are cleared. The value 0 should not be used to indicate any\nother state since there is no way to check that the bit <code>0</code> is set.</p>\n<pre>\n[Flags]\nenum Days\n{\n    Monday = 0,    // 0 is used to indicate Monday\n    Tuesday = 1,\n    Wednesday = 2,\n    Thursday = 4,\n    Friday = 8,\n    Saturday = 16,\n    Sunday = 32,\n    Weekdays = Monday | Tuesday | Wednesday | Thursday | Friday,\n    Weekend = Saturday | Sunday,\n    All = Weekdays | Weekend\n}\n\nvar someDays = Days.Wednesday | Days.Thursday;\nsomeDays &amp; Days.Tuesday == Days.Tuesday // False, because someDays doesn't contains Tuesday\nsomeDays &amp; Days.Monday == Days.Monday   // True, even though someDays doesn't contains Monday!\nsomeDays.HasFlag(Days.Monday)           // Same issue as above\n</pre>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\n[Flags]\nenum FruitType\n{\n    Void = 0,        // Non-Compliant\n    Banana = 1,\n    Orange = 2,\n    Strawberry = 4\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n[Flags]\nenum FruitType\n{\n    None = 0,        // Compliant\n    Banana = 1,\n    Orange = 2,\n    Strawberry = 4\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.flagsattribute\">FlagsAttribute</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Bit_field\">Bit field</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/bitwise-and-shift-operators\">Bitwise and shift operators\n  (C# reference)</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.enum.hasflag\">Enum.HasFlag(Enum) Method</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/ms229062(v=vs.100)\">Designing Flags Enumerations</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2346.json",
    "content": "{\n  \"title\": \"Flags enumerations zero-value members should be named \\\"None\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-2346\",\n  \"sqKey\": \"S2346\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2357.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Fields should not be part of an API, and therefore should always be private. Indeed, they cannot be added to an interface for instance, and\nvalidation cannot be added later on without breaking backward compatibility. Instead, developers should encapsulate their fields into properties.\nExplicit property getters and setters can be introduced for validation purposes or to smooth the transition to a newer system.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic class Foo\n{\n  public int MagicNumber = 42;\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic class Foo\n{\n  public int MagicNumber\n  {\n    get { return 42; }\n  }\n}\n</pre>\n<p>or</p>\n<pre>\npublic class Foo\n{\n  private int MagicNumber = 42;\n}\n</pre>\n<h3>Exceptions</h3>\n<p><code>struct</code>s are ignored, as are <code>static</code> and <code>const</code> fields in classes.</p>\n<p>Further, an issue is only raised when the real accessibility is <code>public</code>, taking into account the class accessibility.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2357.json",
    "content": "{\n  \"title\": \"Fields should be private\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"MODULAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2357\",\n  \"sqKey\": \"S2357\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2360.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The overloading mechanism should be used in place of optional parameters for several reasons:</p>\n<ul>\n  <li>Optional parameter values are baked into the method call site code, thus, if a default value has been changed, all referencing assemblies need\n  to be rebuilt, otherwise the original values will be used.</li>\n  <li>The Common Language Specification (CLS) allows compilers to ignore default parameter values, and thus require the caller to explicitly specify\n  the values. For example, if you want to consume a method with default argument from another .NET compatible language (for instance C++/CLI), you\n  will have to provide all arguments. When using method overloads, you could achieve similar behavior as default arguments.</li>\n  <li>Optional parameters prevent muddying the definition of the function contract. Here is a simple example: if there are two optional parameters,\n  when one is defined, is the second one still optional or mandatory?</li>\n</ul>\n<h3>Noncompliant code example</h3>\n<pre>\nvoid Notify(string company, string office = \"QJZ\") // Noncompliant\n{\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nvoid Notify(string company)\n{\n  Notify(company, \"QJZ\");\n}\nvoid Notify(string company, string office)\n{\n}\n</pre>\n<h3>Exceptions</h3>\n<p>The rule ignores non externally visible methods.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2360.json",
    "content": "{\n  \"title\": \"Optional parameters should not be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-2360\",\n  \"sqKey\": \"S2360\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2365.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Most developers expect property access to be as efficient as field access. However, if a property returns a copy of an array or collection, it will\nbe much slower than a simple field access, contrary to the caller’s likely expectations. Therefore, such properties should be refactored into methods\nso that callers are not surprised by the unexpectedly poor performance.</p>\n<p>This rule tracks calls to the following methods inside properties:</p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.tolist\">Enumerable.ToList</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.toarray\">Enumerable.ToArray</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.array.clone\">Array.Clone</a></li>\n</ul>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nprivate List&lt;string&gt; foo = new List&lt;string&gt; { \"a\", \"b\", \"c\" };\nprivate string[] bar = new string[] { \"a\", \"b\", \"c\" };\n\npublic IEnumerable&lt;string&gt; Foo =&gt; foo.ToList(); // Noncompliant: collection foo is copied\n\npublic IEnumerable&lt;string&gt; Bar =&gt; (string[])bar.Clone(); // Noncompliant: array bar is copied\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nprivate List&lt;string&gt; foo = new List&lt;string&gt; { \"a\", \"b\", \"c\" };\nprivate string[] bar = new string[] { \"a\", \"b\", \"c\" };\n\npublic IEnumerable&lt;string&gt; GetFoo() =&gt; foo.ToList();\n\npublic IEnumerable&lt;string&gt; GetBar() =&gt; (string[])bar.Clone();\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/properties\">Properties (C# Programming\n  Guide)</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/fields\">Fields (C# Programming Guide)</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/collections\">Collections (C#)</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.tolist\">Enumerable.ToList</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.toarray\">Enumerable.ToArray</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.array.clone\">Array.Clone</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2365.json",
    "content": "{\n  \"title\": \"Properties should not make collection or array copies\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"api-design\",\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-2365\",\n  \"sqKey\": \"S2365\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2368.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Using <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/arrays/multidimensional-arrays\">multidimensional</a> and <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/arrays/jagged-arrays\">jagged</a> arrays as method parameters in C# can be\nchallenging for developers.</p>\n<p>When these methods are exposed to external users, it requires advanced language knowledge for effective usage.</p>\n<p>Determining the appropriate data to pass to these parameters may not be intuitive.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic class Program\n{\n    public void WriteMatrix(int[][] matrix) // Noncompliant: data type is not intuitive\n    {\n        // ...\n    }\n}\n</pre>\n<p>In this example, it cannot be inferred easily what the matrix should look like. Is it a 2x2 Matrix or even a triangular Matrix?</p>\n<p>Using a collection, data structure, or class that provides a more suitable representation of the required data is recommended instead of a\nmultidimensional array or jagged array to enhance code readability.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic class Matrix2x2\n{\n    // ...\n}\n\npublic class Program\n{\n    public void WriteMatrix(Matrix2x2 matrix) // Compliant: data type is intuitive\n    {\n        // ...\n    }\n}\n</pre>\n<p>As a result, avoiding exposing such methods to external users is recommended.</p>\n<h3>Exceptions</h3>\n<p>However, using multidimensional and jagged array method parameters internally, such as in <code>private</code> or <code>internal</code> methods or\nwithin <code>internal</code> classes, is compliant since they are not publicly exposed.</p>\n<pre>\npublic class FirstClass\n{\n    private void UpdateMatrix(int[][] matrix) // Compliant: method is private\n    {\n        // ...\n    }\n}\n\ninternal class SecondClass\n{\n    public void UpdateMatrix(int[][] matrix) // Compliant: class is internal\n    {\n        // ...\n    }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/collections/\">Collections and Data Structures</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/arrays/jagged-arrays\">Jagged Arrays</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/arrays/multidimensional-arrays\">Multidimensional Arrays</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2368.json",
    "content": "{\n  \"title\": \"Public methods should not have multidimensional array parameters\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1h\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-2368\",\n  \"sqKey\": \"S2368\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2372.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Property getters should be simple operations that are always safe to call. If exceptions need to be thrown, it is best to convert the property to a\nmethod.</p>\n<p>It is valid to throw exceptions from indexed property getters and from property setters, which are not detected by this rule.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic int Foo\n{\n    get\n    {\n        throw new Exception(); // Noncompliant\n    }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic int Foo\n{\n    get\n    {\n        return 42;\n    }\n}\n</pre>\n<h3>Exceptions</h3>\n<p>No issue is raised when the thrown exception derives from or is of type <code>NotImplementedException</code>, <code>NotSupportedException</code> or\n<code>InvalidOperationException</code>.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2372.json",
    "content": "{\n  \"title\": \"Exceptions should not be thrown from property getters\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"error-handling\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2372\",\n  \"sqKey\": \"S2372\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2376.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Properties with only setters are confusing and counterintuitive. Instead, a property getter should be added if possible, or the property should be\nreplaced with a setter method.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nclass Program\n{\n    public int Foo  //Non-Compliant\n    {\n        set\n        {\n            // ... some code ...\n        }\n    }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nclass Program\n{\n    private int foo;\n\n    public void SetFoo(int value)\n    {\n        // ... some code ...\n        foo = value;\n    }\n}\n</pre>\n<p>or</p>\n<pre>\nclass Program\n{\n  public int Foo { get; set; } // Compliant\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2376.json",
    "content": "{\n  \"title\": \"Write-only properties should not be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2376\",\n  \"sqKey\": \"S2376\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2386.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><code>public static</code> mutable fields of classes which are accessed directly should be protected to the degree possible. This can be done by\nreducing the accessibility of the field or by changing the return type to an immutable type.</p>\n<p>This rule raises issues for <code>public static</code> fields with a type inheriting/implementing <code>System.Array</code> or\n<code>System.Collections.Generic.ICollection&lt;T&gt;</code>.</p>\n<h3>Noncompliant code example</h3>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic class A\n{\n    public static string[] strings1 = {\"first\",\"second\"};  // Noncompliant\n    public static List&lt;String&gt; strings3 = new List&lt;String&gt;();  // Noncompliant\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic class A\n{\n    protected static string[] strings1 = {\"first\",\"second\"};\n    protected static List&lt;String&gt; strings3 = new List&lt;String&gt;();\n}\n</pre>\n<h3>Exceptions</h3>\n<p>No issue is reported:</p>\n<ul>\n  <li>If the type of the field inherits/implements one (at least) of the following types:\n    <ul>\n      <li><a\n      href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.objectmodel.readonlycollection-1\"><code>System.Collections.ObjectModel.ReadOnlyCollection&lt;T&gt;</code></a></li>\n      <li><a\n      href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.objectmodel.readonlydictionary-2\"><code>System.Collections.ObjectModel.ReadOnlyDictionary&lt;TKey, TValue&gt;</code></a></li>\n      <li><a\n      href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.frozen.frozendictionary-2\"><code>System.Collections.Frozen.FrozenDictionary&lt;TKey, TValue&gt;</code></a></li>\n      <li><a\n      href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.frozen.frozenset-1\"><code>System.Collections.Frozen.FrozenSet&lt;T&gt;</code></a></li>\n      <li><a\n      href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable.immutablearray-1\"><code>System.Collections.Immutable.ImmutableArray&lt;T&gt;</code></a></li>\n      <li><a\n      href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable.iimmutabledictionary-2\"><code>System.Collections.Immutable.IImmutableDictionary&lt;TKey, TValue&gt;</code></a></li>\n      <li><a\n      href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable.iimmutablelist-1\"><code>System.Collections.Immutable.IImmutableList&lt;T&gt;</code></a></li>\n      <li><a\n      href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable.iimmutableset-1\"><code>System.Collections.Immutable.IImmutableSet&lt;T&gt;</code></a></li>\n      <li><a\n      href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable.iimmutablestack-1\"><code>System.Collections.Immutable.IImmutableStack&lt;T&gt;</code></a></li>\n      <li><a\n      href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable.iimmutablequeue-1\"><code>System.Collections.Immutable.IImmutableQueue&lt;T&gt;</code></a></li>\n    </ul></li>\n  <li>If the field is <code>readonly</code> and is initialized inline with an immutable type (i.e. inherits/implements one of the types in the\n  previous list) or null.</li>\n</ul>\n<h2>Resources</h2>\n<ul>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/582\">CWE-582 - Array Declared Public, Final, and Static</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/607\">CWE-607 - Public Static Final Field References Mutable Object</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2386.json",
    "content": "{\n  \"title\": \"Mutable fields should not be \\\"public static\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"unpredictable\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2386\",\n  \"sqKey\": \"S2386\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      607,\n      582\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2387.html",
    "content": "<p>This rule is deprecated, and will eventually be removed.</p>\n<h2>Why is this an issue?</h2>\n<p>Having a variable with the same name in two unrelated classes is fine, but do the same thing within a class hierarchy and you’ll get confusion at\nbest, chaos at worst.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic class Fruit\n{\n  protected Season ripe;\n  protected Color flesh;\n\n  // ...\n}\n\npublic class Raspberry : Fruit\n{\n  private bool ripe; // Noncompliant\n  private static Color FLESH; // Noncompliant\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic class Fruit\n{\n  protected Season ripe;\n  protected Color flesh;\n\n  // ...\n}\n\npublic class Raspberry : Fruit\n{\n  private bool ripened;\n  private static Color FLESH_COLOR;\n}\n</pre>\n<h3>Exceptions</h3>\n<p>This rule ignores same-name fields that are <code>static</code> in both the parent and child classes. It also ignores <code>private</code> parent\nclass fields, but in all other such cases, the child class field should be renamed.</p>\n<pre>\npublic class Fruit\n{\n  private Season ripe;\n  // ...\n}\n\npublic class Raspberry : Fruit\n{\n  private Season ripe;  // Compliant as parent field 'ripe' is anyway not visible from Raspberry\n  // ...\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2387.json",
    "content": "{\n  \"title\": \"Child class fields should not shadow parent class fields\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"deprecated\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-2387\",\n  \"sqKey\": \"S2387\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2436.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>A method or class with too many type parameters has likely aggregated too many responsibilities and should be split.</p>\n<h3>Noncompliant code example</h3>\n<p>With the default parameter value of 2:</p>\n<pre>\n&lt;S, T, U, V&gt; void foo() {} // Noncompliant; not really readable\n&lt;String, Integer, Object, String&gt;foo(); // especially on invocations\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2436.json",
    "content": "{\n  \"title\": \"Types and methods should not have too many generic parameters\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"FOCUSED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"brain-overload\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2436\",\n  \"sqKey\": \"S2436\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2437.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Certain <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/bitwise-and-shift-operators\">bitwise operations</a>\nare not needed and should not be performed because their results are predictable.</p>\n<p>Specifically, using <code>&amp; -1</code> with any value always results in the original value.</p>\n<p>That is because the binary representation of <code>-1</code> on a <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/integral-numeric-types\">integral numeric type</a> supporting\nnegative numbers, such as <code>int</code> or <code>long</code>, is based on <a href=\"https://en.wikipedia.org/wiki/Two%27s_complement\">two’s\ncomplement</a> and made of all 1s: <code>0b111…​111</code>.</p>\n<p>Performing <code>&amp;</code> between a value and <code>0b111…​111</code> means applying the <code>&amp;</code> operator to each bit of the value\nand the bit <code>1</code>, resulting in a value equal to the provided one, bit by bit.</p>\n<pre>\nanyValue &amp; -1 // Noncompliant\nanyValue      // Compliant\n</pre>\n<p>Similarly, <code>anyValue | 0</code> always results in <code>anyValue</code>, because the binary representation of <code>0</code> is always\n<code>0b000…​000</code> and the <code>|</code> operator returns its first input when the second is <code>0</code>.</p>\n<pre>\nanyValue | 0  // Noncompliant\nanyValue      // Compliant\n</pre>\n<p>The same applies to <code>anyValue ^ 0</code>: the <code>^</code> operator returns <code>1</code> when its two input bits are different\n(<code>1</code> and <code>0</code> or <code>0</code> and <code>1</code>) and returns <code>0</code> when its two input bits are the same (both\n<code>0</code> or both <code>1</code>). When <code>^</code> is applied with <code>0</code>, the result would be <code>1</code> if the other input is\n<code>1</code>, because the two input bits are different, and <code>0</code> if the other input bit is <code>0</code>, because the two input are the\nsame. That results in returning <code>anyValue</code>.</p>\n<pre>\nanyValue ^ 0  // Noncompliant\nanyValue      // Compliant\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/bitwise-and-shift-operators\">Bitwise operations (C#\n  reference)</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/operators/and-operator\">And Operator (Visual Basic)</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/operators/or-operator\">Or Operator (Visual Basic)</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/operators/xor-operator\">Xor Operator (Visual Basic)</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/integral-numeric-types\">Integral numeric types (C#\n  reference)</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/data-types/numeric-data-types\">Numeric Data\n  Types (Visual Basic)</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Two%27s_complement\">Two’s complement</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li><a href=\"https://stackoverflow.com/questions/12764670/are-there-any-bitwise-operator-laws\">Stack Overflow - Are there any Bitwise Operator\n  Laws?</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2437.json",
    "content": "{\n  \"title\": \"Unnecessary bit operations should not be performed\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-2437\",\n  \"sqKey\": \"S2437\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2445.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/lock\">Locking</a> on a class field synchronizes not on the\nfield itself, but on the object assigned to it. Thus, there are some good practices to follow to avoid problems related to <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/standard/threading/threads-and-threading\">thread</a> synchronization.</p>\n<ul>\n  <li>Locking on a non-<code>readonly</code> field makes it possible for the field’s value to change while a thread is in the code block, locked on\n  the old value. This allows another thread to lock on the new value and access the same block concurrently.\n    <pre>\nprivate Color color = new Color(\"red\");\nprivate void DoSomething()\n{\n  // Synchronizing access via \"color\"\n  lock (color) // Noncompliant: lock is actually on object instance \"red\" referred to by the \"color\" field\n  {\n    //...\n    color = new Color(\"green\"); // other threads now allowed into this block\n    // ...\n  }\n}\n</pre></li>\n  <li>Locking on a new instance of an object undermines synchronization because two different threads running the same method in parallel will lock on\n  different instances of the same object, allowing them to access the synchronized block at the same time.\n    <pre>\nprivate void DoSomething()\n{\n  lock (new object()) // Noncompliant: every thread locks on a different new instance\n  {\n    // ...\n  }\n}\n</pre></li>\n  <li>Locking on a string literal is also dangerous since, depending on whether the string is interned or not, different threads may or may not\n  synchronize on the same object instance.\n    <pre>\nprivate readonly string colorString = \"red\";\nprivate void DoSomething()\n{\n  lock (colorString)  // Noncompliant: strings can be interned\n  {\n    // ...\n  }\n}\n</pre></li>\n</ul>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nprivate Color color = new Color(\"red\");\nprivate void DoSomething()\n{\n  // Synchronizing access via \"color\"\n  lock (color) // Noncompliant: lock is actually on object instance \"red\" referred to by the \"color\" field\n  {\n    //...\n    color = new Color(\"green\"); // other threads now allowed into this block\n    // ...\n  }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nprivate Color color = new Color(\"red\");\nprivate readonly object lockObj = new object();\n\nprivate void DoSomething()\n{\n  lock (lockObj)\n  {\n    //...\n    color = new Color(\"green\");\n    // ...\n  }\n}\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/lock\">Lock Statement</a> - lock statement - ensure\n  exclusive access to a shared resource</li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.intern\">String.Intern</a> - <code>String.Intern(String)</code> Method</li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/412\">CWE-412 - Unrestricted Externally Accessible Lock</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/413\">CWE-413 - Improper Resource Locking</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/threading/threads-and-threading\">Threads and threading</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2445.json",
    "content": "{\n  \"title\": \"Blocks should be synchronized on read-only fields\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"multi-threading\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2445\",\n  \"sqKey\": \"S2445\",\n  \"scope\": \"All\",\n  \"securityStandards\": {\n    \"CWE\": [\n      412,\n      413\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2479.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Non-encoded <a href=\"https://en.wikipedia.org/wiki/Control_character\">control characters</a> and whitespace characters are often injected in the\nsource code because of a bad manipulation. They are either invisible or difficult to recognize, which can result in bugs when the string is not what\nthe developer expects. If you actually need to use a control character use their encoded version:</p>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/ASCII\">ASCII</a>, for example <code>\\n</code> and <code>\\t</code></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Unicode\">Unicode</a>, for example <code>U+000D</code> and <code>U+0009</code></li>\n</ul>\n<p>This rule raises an issue when the following characters are seen in a <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/strings/\">string literal</a>:</p>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/ASCII#Control_characters\">ASCII control character</a>. (character index &lt; 32 or = 127)</li>\n  <li>Unicode <a href=\"https://en.wikipedia.org/wiki/Unicode_character_property#Whitespace\">whitespace characters</a>.</li>\n  <li>Unicode <a href=\"https://en.wikipedia.org/wiki/C0_and_C1_control_codes\">C0 control characters</a></li>\n  <li>Unicode characters <code>U+200B, U+200C, U+200D, U+2060, U+FEFF, U+2028, U+2029</code></li>\n</ul>\n<h3>Exceptions</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/strings/#verbatim-string-literals\">Verbatim string literals</a> and\n  <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/strings/#raw-string-literals\">raw string literals</a>, since they have no\n  escape mechanism</li>\n  <li>The simple space character: Unicode <code>U+0020</code>, ASCII 32</li>\n</ul>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nstring tabInside = \"A\tB\";                 // Noncompliant: contains a tabulation\nstring zeroWidthSpaceInside = \"foo​bar\";     // Noncompliant: contains a U+200B character inside\nConsole.WriteLine(zeroWidthSpaceInside);    // Prints \"foo?bar\"\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nstring tabInside = \"A\\tB\";                      // Compliant: escaped value\nstring zeroWidthSpaceInside = \"foo\\u200Bbar\";   // Compliant: escaped value\nConsole.WriteLine(zeroWidthSpaceInside);        // Prints \"foo?bar\"\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/strings/\">Strings and string literals</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Control_character\">Control character</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2479.json",
    "content": "{\n  \"title\": \"Whitespace and control characters in string literals should be explicit\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-2479\",\n  \"sqKey\": \"S2479\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2486.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When exceptions occur, it is usually a bad idea to simply ignore them. Instead, it is better to handle them properly, or at least to log them.</p>\n<p>This rule only reports on empty catch clauses that catch generic <code>Exception</code>s.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nstring text = \"\";\ntry\n{\n    text = File.ReadAllText(fileName);\n}\ncatch (Exception exc) // Noncompliant\n{\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nstring text = \"\";\ntry\n{\n    text = File.ReadAllText(fileName);\n}\ncatch (Exception exc)\n{\n    logger.Log(exc);\n}\n</pre>\n<h3>Exceptions</h3>\n<p>When a block contains a comment, it is not considered to be empty.</p>\n<h2>Resources</h2>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A09_2021-Security_Logging_and_Monitoring_Failures/\">Top 10 2021 Category A9 - Security Logging and\n  Monitoring Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A10_2017-Insufficient_Logging%2526Monitoring\">Top 10 2017 Category A10 -\n  Insufficient Logging &amp; Monitoring</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/390\">CWE-390 - Detection of Error Condition Without Action</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2486.json",
    "content": "{\n  \"title\": \"Generic exceptions should not be ignored\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1h\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"error-handling\",\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2486\",\n  \"sqKey\": \"S2486\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      390\n    ],\n    \"OWASP\": [\n      \"A10\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A9\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"6.5.5\",\n      \"10.1\",\n      \"10.2\",\n      \"10.3\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"6.2.4\",\n      \"10.2\"\n    ],\n    \"ASVS 4.0\": [\n      \"11.1.8\"\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2551.html",
    "content": "<p>The instance passed to the <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/lock\"><code>lock</code>\nstatement</a> should be a dedicated private field.</p>\n<h2>Why is this an issue?</h2>\n<p>If the instance representing an exclusively acquired lock is publicly accessible, another thread in another part of the program could accidentally\nattempt to acquire the same lock. This increases the likelihood of <a href=\"https://en.wikipedia.org/wiki/Deadlock\">deadlocks</a>.</p>\n<p>For example, a <code>string</code> should never be used for locking. When a <code>string</code> is <a\nhref=\"https://en.wikipedia.org/wiki/Interning_(computer_science)\">interned</a> by the runtime, it can be shared by multiple threads, breaking the\nlocking mechanism.</p>\n<p>Instead, a dedicated private <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.lock?view=net-9.0\"><code>Lock</code></a> object\ninstance (or <code>object</code> instance, for frameworks before .Net 9) should be used for locking. This minimizes access to the lock instance and\ntherefore prevents accidential lock sharing.</p>\n<p>The following objects are considered potentially prone to accidental lock sharing:</p>\n<ul>\n  <li>a reference to <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/this\">this</a>: if the instance is publicly\n  accessibly, the lock might be shared</li>\n  <li>a <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.type\">Type</a> object: if the type class is publicly accessibly, the lock might\n  be shared</li>\n  <li>a <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/strings/\">string</a> literal or instance: if any other part of the\n  program uses the same string, the lock is shared because of interning</li>\n</ul>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nvoid MyLockingMethod()\n{\n    lock (this) // Noncompliant\n    {\n        // ...\n    }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n#if NET9_0_OR_GREATER\nprivate readonly Lock lockObj = new();\n#else\nprivate readonly object lockObj = new();\n#endif\n\nvoid MyLockingMethod()\n{\n    lock (lockObj)\n    {\n        // ...\n    }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Thread_(computing)\">Thread</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Lock_(computer_science)\">Locking</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Deadlock\">Deadlock</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Interning_(computer_science)\">Interning</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.intern#remarks\">String interning by the runtime</a></li>\n  <li>Microsoft Learn - <a href=\"https://docs.microsoft.com/en-us/dotnet/standard/threading/managed-threading-best-practices\">Managed Threading Best\n  Practices</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/lock\">The lock statement - ensure\n  exclusive access to a shared resource</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2551.json",
    "content": "{\n  \"title\": \"Shared resources should not be used for locking\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [\n    \"multi-threading\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-2551\",\n  \"sqKey\": \"S2551\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2583.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Conditional expressions which are always <code>true</code> or <code>false</code> can lead to <a\nhref=\"https://en.wikipedia.org/wiki/Unreachable_code\">unreachable code</a>.</p>\n<p>In the case below, the call of <code>Dispose()</code> never happens.</p>\n<pre>\nvar a = false;\nif (a)\n{\n    Dispose(); // Never reached\n}\n</pre>\n<h3>Exceptions</h3>\n<p>This rule will not raise an issue in either of these cases:</p>\n<ul>\n  <li>When the condition is a single <code>const bool</code>\n    <pre>\nconst bool debug = false;\n//...\nif (debug)\n{\n  // Print something\n}\n</pre></li>\n  <li>When the condition is the literal <code>true</code> or <code>false</code>.</li>\n</ul>\n<p>In these cases, it is obvious the code is as intended.</p>\n<h2>How to fix it</h2>\n<p>The conditions should be reviewed to decide whether:</p>\n<ul>\n  <li>to update the condition or</li>\n  <li>to remove the condition.</li>\n</ul>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic void Sample(bool b)\n{\n    bool a = false;\n    if (a)                  // Noncompliant: The true branch is never reached\n    {\n        DoSomething();      // Never reached\n    }\n\n    if (!a || b)            // Noncompliant: \"!a\" is always \"true\" and the false branch is never reached\n    {\n        DoSomething();\n    }\n    else\n    {\n        DoSomethingElse();  // Never reached\n    }\n\n    var c = \"xxx\";\n    var res = c ?? \"value\"; // Noncompliant: c is always not null, \"value\" is never used\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic void Sample(bool b)\n{\n    bool a = false;\n    if (Foo(a))             // Condition was updated\n    {\n        DoSomething();\n    }\n\n    if (b)                  // Parts of the condition were removed.\n    {\n        DoSomething();\n    }\n    else\n    {\n        DoSomethingElse();\n    }\n\n    var c = \"xxx\";\n    var res = c;            // ?? \"value\" was removed\n}\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/570\">CWE-570 - Expression is Always False</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/571\">CWE-571 - Expression is Always True</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Unreachable_code\">Unreachable code</a></li>\n</ul>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/boolean-logical-operators#conditional-logical-and-operator-\">Conditional logical AND operator &amp;&amp;</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/boolean-logical-operators#conditional-logical-or-operator-\">Conditional logical OR operator ||</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/null-coalescing-operator\">?? and ??=\n  operators - the null-coalescing operators</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2583.json",
    "content": "{\n  \"title\": \"Conditionally executed code should be reachable\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"unused\",\n    \"suspicious\",\n    \"pitfall\",\n    \"symbolic-execution\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2583\",\n  \"sqKey\": \"S2583\",\n  \"scope\": \"All\",\n  \"securityStandards\": {\n    \"CWE\": [\n      489,\n      571,\n      570\n    ]\n  },\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2589.html",
    "content": "<p>Gratuitous boolean expressions are conditions that do not change the evaluation of a program. This issue can indicate logical errors and affect the\ncorrectness of an application, as well as its maintainability.</p>\n<h2>Why is this an issue?</h2>\n<p>Control flow constructs like <code>if</code>-statements allow the programmer to direct the flow of a program depending on a boolean expression.\nHowever, if the condition is always true or always false, only one of the branches will ever be executed. In that case, the control flow construct and\nthe condition no longer serve a purpose; they become <em>gratuitous</em>.</p>\n<h3>What is the potential impact?</h3>\n<p>The presence of gratuitous conditions can indicate a logical error. For example, the programmer <em>intended</em> to have the program branch into\ndifferent paths but made a mistake when formulating the branching condition. In this case, this issue might result in a bug and thus affect the\nreliability of the application. For instance, it might lead to the computation of incorrect results.</p>\n<p>Additionally, gratuitous conditions and control flow constructs introduce unnecessary complexity. The source code becomes harder to understand, and\nthus, the application becomes more difficult to maintain.</p>\n<p>This rule looks for operands of a boolean expression never changing the result of the expression. It also applies to the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/null-coalescing-operator\">null coalescing operator</a> when one of\nthe operands always evaluates to <code>null</code>.</p>\n<pre>\nstring d = null;\nvar v1 = d ?? \"value\";      // Noncompliant\n</pre>\n<h3>Exceptions</h3>\n<p>This rule will not raise an issue in either of these cases:</p>\n<ul>\n  <li>When the condition is a single <code>const bool</code>\n    <pre>\nconst bool debug = false;\n//...\nif (debug)                  // Compliant\n{\n  // Print something\n}\n</pre></li>\n  <li>When the condition is the literal <code>true</code> or <code>false</code>.</li>\n</ul>\n<p>In these cases, it is obvious the code is as intended.</p>\n<h2>How to fix it</h2>\n<p>Gratuitous boolean expressions are suspicious and should be carefully removed from the code.</p>\n<p>First, the boolean expression in question should be closely inspected for logical errors. If a mistake was made, it can be corrected so the\ncondition is no longer gratuitous.</p>\n<p>If it becomes apparent that the condition is actually unnecessary, it can be removed. The associated control flow construct (e.g., the\n<code>if</code>-statement containing the condition) will be adapted or even removed, leaving only the necessary branches.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre>\npublic void Sample(bool b, bool c)\n{\n    var a = true;\n    if (a)                  // Noncompliant: \"a\" is always \"true\"\n    {\n        DoSomething();\n    }\n\n    if (b &amp;&amp; a)             // Noncompliant: \"a\" is always \"true\"\n    {\n        DoSomething();\n    }\n\n    if (c || !a)            // Noncompliant: \"!a\" is always \"false\"\n    {\n        DoSomething();\n    }\n\n    string d = null;\n    var v1 = d ?? \"value\";  // Noncompliant: \"d\" is always null and v1 is always \"value\".\n    var v2 = s ?? d;        // Noncompliant: \"d\" is always null and v2 is always equal to s.\n}\n</pre>\n<h4>Compliant solution</h4>\n<p>The unnecessary operand is updated:</p>\n<pre>\npublic void Sample(bool b, bool c, string s)\n{\n    var a = IsAllowed();\n    if (a)                  // Compliant\n    {\n        DoSomething();\n    }\n\n    if (b &amp;&amp; a)             // Compliant\n    {\n        DoSomething();\n    }\n\n    if (c || !a)            // Compliant\n    {\n        DoSomething();\n    }\n\n    string d = GetStringData();\n    var v1 = d ?? \"value\";  // Compliant\n    var v2 = s ?? d;        // Compliant\n}\n</pre>\n<p>The unnecessary operand is removed:</p>\n<pre>\npublic void Sample(bool b, bool c, string s)\n{\n    DoSomething();\n\n    if (b)                  // Compliant\n    {\n        DoSomething();\n    }\n\n    if (c)                  // Compliant\n    {\n        DoSomething();\n    }\n\n    var v1 = \"value\";       // Compliant\n    var v2 = s;             // Compliant\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/571\">CWE-571 - Expression is Always True</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/570\">CWE-570 - Expression is Always False</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/boolean-logical-operators#conditional-logical-and-operator-\">Conditional logical AND operator &amp;&amp;</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/boolean-logical-operators#conditional-logical-or-operator-\">Conditional logical OR operator ||</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/null-coalescing-operator\">Null-coalescing operators ?? and\n  ??=</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2589.json",
    "content": "{\n  \"title\": \"Boolean expressions should not be gratuitous\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"suspicious\",\n    \"redundant\",\n    \"symbolic-execution\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2589\",\n  \"sqKey\": \"S2589\",\n  \"scope\": \"All\",\n  \"securityStandards\": {\n    \"CWE\": [\n      489,\n      571,\n      570\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2612.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>In Windows, \"Everyone\" group is similar and includes all members of the Authenticated Users group as well as the built-in Guest account, and\nseveral other built-in security accounts.</p>\n<p>Granting permissions to this category can lead to unintended access to files or directories that could allow attackers to obtain sensitive\ninformation, disrupt services or elevate privileges.</p>\n<h3>What is the potential impact?</h3>\n<h4>Unauthorized access to sensitive information</h4>\n<p>When file or directory permissions grant access to all users on a system (often represented as \"others\" or \"everyone\" in permission models),\nattackers who gain access to any user account can read sensitive files containing credentials, configuration data, API keys, database passwords,\npersonal information, or proprietary business data. This exposure can lead to data breaches, identity theft, compliance violations, and competitive\ndisadvantage.</p>\n<h4>Service disruption and data corruption</h4>\n<p>Granting write permissions to broad user categories allows any user on the system to modify or delete critical files and directories. Attackers or\ncompromised low-privileged accounts can corrupt application data, modify configuration files to alter system behavior or disrupt services, or delete\nimportant resources, leading to service outages, system instability, data loss, and denial of service.</p>\n<h4>Privilege escalation</h4>\n<p>When executable files or scripts have overly permissive permissions, especially when combined with special permission bits that allow programs to\nexecute with the permissions of the file owner or group rather than the executing user, attackers can replace legitimate executables with malicious\ncode. When these modified files are executed by privileged users or processes, the attacker’s code runs with elevated privileges, potentially enabling\nthem to escalate from a low-privileged account to root or administrator access, install backdoors, or pivot to other systems in the network.</p>\n<h2>How to fix it in .NET Framework</h2>\n<p>Instead of granting access to \"Everyone\", explicitly deny access to this group or grant permissions only to specific users or groups that require\naccess. Use <code>AccessControlType.Deny</code> to prevent the \"Everyone\" group from accessing the file.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nvar accessRule = new FileSystemAccessRule(\n    \"Everyone\",\n    FileSystemRights.FullControl,\n    AccessControlType.Allow);\n\nvar fileSecurity = File.GetAccessControl(\"path\");\nfileSecurity.AddAccessRule(accessRule); // Noncompliant\nFile.SetAccessControl(\"fileName\", fileSecurity);\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nvar accessRule = new FileSystemAccessRule(\n    \"Everyone\",\n    FileSystemRights.FullControl,\n    AccessControlType.Deny);\n\nvar fileSecurity = File.GetAccessControl(\"path\");\nfileSecurity.AddAccessRule(accessRule);\nFile.SetAccessControl(\"path\", fileSecurity);\n</pre>\n<h2>How to fix it in .NET</h2>\n<p>Use <code>AccessControlType.Deny</code> instead of <code>AccessControlType.Allow</code> when setting access rules for the \"Everyone\" group. This\nprevents the broad group from having write or full control access to files.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nvar accessRule = new FileSystemAccessRule(\"Everyone\", FileSystemRights.Write, AccessControlType.Allow);\nvar fileInfo = new FileInfo(\"path\");\nvar fileSecurity = fileInfo.GetAccessControl();\n\nfileSecurity.SetAccessRule(accessRule); // Noncompliant\nfileInfo.SetAccessControl(fileSecurity);\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nvar accessRule = new FileSystemAccessRule(\"Everyone\", FileSystemRights.FullControl, AccessControlType.Deny);\nvar fileInfo = new FileInfo(\"path\");\nvar fileSecurity = fileInfo.GetAccessControl();\n\nfileSecurity.SetAccessRule(accessRule);\nfileInfo.SetAccessControl(fileSecurity);\n</pre>\n<h2>How to fix it in Mono</h2>\n<p>Avoid setting permissions that grant read, write, or execute access to \"others\" (all users). Instead, restrict permissions to the file owner or\nspecific groups. Use <code>FileAccessPermissions.UserExecute</code> or other restrictive permission flags that limit access to the owner only.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"3\" data-diff-type=\"noncompliant\">\nvar fsEntry = UnixFileSystemInfo.GetFileSystemEntry(\"path\");\nfsEntry.FileAccessPermissions = FileAccessPermissions.OtherReadWriteExecute; // Noncompliant\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"3\" data-diff-type=\"compliant\">\nvar fsEntry = UnixFileSystemInfo.GetFileSystemEntry(\"path\");\nfsEntry.FileAccessPermissions = FileAccessPermissions.UserExecute;\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>OWASP File Permission Testing Guide - <a\n  href=\"https://owasp.org/www-project-web-security-testing-guide/latest/4-Web_Application_Security_Testing/02-Configuration_and_Deployment_Management_Testing/09-Test_File_Permission\">OWASP guidance on testing file permissions in web applications</a></li>\n</ul>\n<h3>Standards</h3>\n<ul>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/266\">CWE-266 - Incorrect Privilege Assignment</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/732\">CWE-732 - Incorrect Permission Assignment for Critical Resource</a></li>\n  <li>STIG Viewer - <a href=\"https://stigviewer.com/stigs/application_security_and_development/2024-12-06/finding/V-222430\">Application Security and\n  Development: V-222430</a> - The application must execute without excessive account permissions</li>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A01_2021-Broken_Access_Control/\">Top 10 2021 Category A1 - Broken Access Control</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A04_2021-Insecure_Design/\">Top 10 2021 Category A4 - Insecure Design</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A5_2017-Broken_Access_Control\">Top 10 2017 Category A5 - Broken Access Control -\n  OWASP Top 10 2017</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2612.json",
    "content": "{\n  \"title\": \"File permissions should not be set to world-accessible values\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"former-hotspot\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2612\",\n  \"sqKey\": \"S2612\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      732,\n      266\n    ],\n    \"OWASP\": [\n      \"A5\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A1\",\n      \"A4\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"6.5.8\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"6.2.4\"\n    ],\n    \"ASVS 4.0\": [\n      \"4.3.3\"\n    ],\n    \"STIG ASD_V5R3\": [\n      \"V-222430\"\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2629.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Logging arguments should not require evaluation in order to avoid unnecessary performance overhead. When passing concatenated strings or string\ninterpolations directly into a logging method, the evaluation of these expressions occurs every time the logging method is called, regardless of the\nlog level. This can lead to inefficient code execution and increased resource consumption.</p>\n<p>Instead, it is recommended to use the overload of the logger that accepts a log format and its arguments as separate parameters. By separating the\nlog format from the arguments, the evaluation of expressions can be deferred until it is necessary, based on the log level. This approach improves\nperformance by reducing unnecessary evaluations and ensures that logging statements are only evaluated when needed.</p>\n<p>Furthermore, using a constant log format enhances observability and facilitates searchability in log aggregation and monitoring software.</p>\n<p>The rule covers the following logging frameworks:</p>\n<ul>\n  <li><a href=\"https://www.nuget.org/packages/Microsoft.Extensions.Logging\">Microsoft.Extensions.Logging</a></li>\n  <li><a href=\"https://www.nuget.org/packages/Castle.Core\">Castle.Core</a></li>\n  <li><a href=\"https://www.nuget.org/packages/log4net\">log4net</a></li>\n  <li><a href=\"https://www.nuget.org/packages/Serilog\">Serilog</a></li>\n  <li><a href=\"https://www.nuget.org/packages/NLog\">Nlog</a></li>\n</ul>\n<h2>How to fix it</h2>\n<p>Use an overload that takes the log format and the parameters as separate arguments. The log format should be a constant string.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nlogger.DebugFormat($\"The value of the parameter is: {parameter}.\");\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nlogger.DebugFormat(\"The value of the parameter is: {Parameter}.\", parameter);\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.interpolatedstringhandlerattribute\">InterpolatedStringHandlerArgumentAttribute</a></li>\n</ul>\n<h3>Benchmarks</h3>\n<table>\n  <colgroup>\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>Method</th>\n      <th>Runtime</th>\n      <th>Mean</th>\n      <th>Standard Deviation</th>\n      <th>Allocated</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>CastleCoreLoggingTemplateNotConstant</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>230.306 us</p>\n      </td>\n      <td>\n        <p>2.7116 us</p>\n      </td>\n      <td>\n        <p>479200 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>CastleCoreLoggingTemplateConstant</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>46.827 us</p>\n      </td>\n      <td>\n        <p>1.4743 us</p>\n      </td>\n      <td>\n        <p>560000 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>CastleCoreLoggingTemplateNotConstant</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>1,060.413 us</p>\n      </td>\n      <td>\n        <p>32.3559 us</p>\n      </td>\n      <td>\n        <p>1115276 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>CastleCoreLoggingTemplateConstant</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>93.697 us</p>\n      </td>\n      <td>\n        <p>1.8201 us</p>\n      </td>\n      <td>\n        <p>561650 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>MSLoggingTemplateNotConstant</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>333.246 us</p>\n      </td>\n      <td>\n        <p>12.9214 us</p>\n      </td>\n      <td>\n        <p>479200 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>MSLoggingTemplateConstant</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>441.118 us</p>\n      </td>\n      <td>\n        <p>68.7999 us</p>\n      </td>\n      <td>\n        <p>560000 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>MSLoggingTemplateNotConstant</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>1,542.076 us</p>\n      </td>\n      <td>\n        <p>99.3423 us</p>\n      </td>\n      <td>\n        <p>1115276 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>MSLoggingTemplateConstant</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>698.071 us</p>\n      </td>\n      <td>\n        <p>18.6319 us</p>\n      </td>\n      <td>\n        <p>561653 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>NLogLoggingTemplateNotConstant</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>178.789 us</p>\n      </td>\n      <td>\n        <p>9.2528 us</p>\n      </td>\n      <td>\n        <p>479200 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>NLogLoggingTemplateConstant</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>6.009 us</p>\n      </td>\n      <td>\n        <p>1.3303 us</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>NLogLoggingTemplateNotConstant</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>1,086.260 us</p>\n      </td>\n      <td>\n        <p>44.1670 us</p>\n      </td>\n      <td>\n        <p>1115276 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>NLogLoggingTemplateConstant</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>25.132 us</p>\n      </td>\n      <td>\n        <p>0.5666 us</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>SerilogLoggingTemplateNotConstant</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>234.460 us</p>\n      </td>\n      <td>\n        <p>7.4831 us</p>\n      </td>\n      <td>\n        <p>479200 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>SerilogLoggingTemplateConstant</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>49.854 us</p>\n      </td>\n      <td>\n        <p>1.8232 us</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>SerilogLoggingTemplateNotConstant</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>1,103.939 us</p>\n      </td>\n      <td>\n        <p>47.0203 us</p>\n      </td>\n      <td>\n        <p>1115276 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>SerilogLoggingTemplateConstant</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>35.752 us</p>\n      </td>\n      <td>\n        <p>0.6022 us</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>Log4NetLoggingTemplateNotConstant</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>255.754 us</p>\n      </td>\n      <td>\n        <p>5.6046 us</p>\n      </td>\n      <td>\n        <p>479200 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>Log4NetLoggingTemplateConstant</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>46.425 us</p>\n      </td>\n      <td>\n        <p>1.7087 us</p>\n      </td>\n      <td>\n        <p>240000 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>Log4NetLoggingTemplateNotConstant</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>1,109.874 us</p>\n      </td>\n      <td>\n        <p>23.4388 us</p>\n      </td>\n      <td>\n        <p>1115276 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>Log4NetLoggingTemplateConstant</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>92.305 us</p>\n      </td>\n      <td>\n        <p>2.4161 us</p>\n      </td>\n      <td>\n        <p>240707 B</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h4>Glossary</h4>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Arithmetic_mean\">Mean</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Standard_deviation\">Standard Deviation</a></li>\n</ul>\n<p>The results were generated by running the following snippet with <a href=\"https://github.com/dotnet/BenchmarkDotNet\">BenchmarkDotNet</a>:</p>\n<pre>\nusing Microsoft.Extensions.Logging;\nusing ILogger = Microsoft.Extensions.Logging.ILogger;\n\n[Params(10_000)]\npublic int Iterations;\n\nprivate ILogger ms_logger;\nprivate Castle.Core.Logging.ILogger cc_logger;\nprivate log4net.ILog l4n_logger;\nprivate Serilog.ILogger se_logger;\nprivate NLog.ILogger nl_logger;\n\n[GlobalSetup]\npublic void GlobalSetup()\n{\n    ms_logger = new LoggerFactory().CreateLogger&lt;LoggingTemplates&gt;();\n    cc_logger = new Castle.Core.Logging.NullLogFactory().Create(\"Castle.Core.Logging\");\n    l4n_logger = log4net.LogManager.GetLogger(typeof(LoggingTemplates));\n    se_logger = Serilog.Log.Logger;\n    nl_logger = NLog.LogManager.GetLogger(\"NLog\");\n}\n\n[BenchmarkCategory(\"Microsoft.Extensions.Logging\")]\n[Benchmark]\npublic void MSLoggingTemplateNotConstant()\n{\n    for (int i = 0; i &lt; Iterations; i++)\n    {\n        ms_logger.LogInformation($\"Param: {i}\");\n    }\n}\n\n[BenchmarkCategory(\"Microsoft.Extensions.Logging\")]\n[Benchmark]\npublic void MSLoggingTemplateConstant()\n{\n    for (int i = 0; i &lt; Iterations; i++)\n    {\n        ms_logger.LogInformation(\"Param: {Parameter}\", i);\n    }\n}\n\n[BenchmarkCategory(\"Castle.Core.Logging\")]\n[Benchmark]\npublic void CastleCoreLoggingTemplateNotConstant()\n{\n    for (int i = 0; i &lt; Iterations; i++)\n    {\n        cc_logger.Info($\"Param: {i}\");\n    }\n}\n\n[BenchmarkCategory(\"Castle.Core.Logging\")]\n[Benchmark]\npublic void CastleCoreLoggingTemplateConstant()\n{\n    for (int i = 0; i &lt; Iterations; i++)\n    {\n        cc_logger.InfoFormat(\"Param: {Parameter}\", i);\n    }\n}\n\n[BenchmarkCategory(\"log4net\")]\n[Benchmark]\npublic void Log4NetLoggingTemplateNotConstant()\n{\n    for (int i = 0; i &lt; Iterations; i++)\n    {\n        l4n_logger.Info($\"Param: {i}\");\n    }\n}\n\n[BenchmarkCategory(\"log4net\")]\n[Benchmark]\npublic void Log4NetLoggingTemplateConstant()\n{\n    for (int i = 0; i &lt; Iterations; i++)\n    {\n        l4n_logger.InfoFormat(\"Param: {Parameter}\", i);\n    }\n}\n\n[BenchmarkCategory(\"Serilog\")]\n[Benchmark]\npublic void SerilogLoggingTemplateNotConstant()\n{\n    for (int i = 0; i &lt; Iterations; i++)\n    {\n        se_logger.Information($\"Param: {i}\");\n    }\n}\n\n[BenchmarkCategory(\"Serilog\")]\n[Benchmark]\npublic void SerilogLoggingTemplateConstant()\n{\n    for (int i = 0; i &lt; Iterations; i++)\n    {\n        se_logger.Information(\"Param: {Parameter}\", i);\n    }\n}\n\n[BenchmarkCategory(\"NLog\")]\n[Benchmark]\npublic void NLogLoggingTemplateNotConstant()\n{\n    for (int i = 0; i &lt; Iterations; i++)\n    {\n        nl_logger.Info($\"Param: {i}\");\n    }\n}\n\n[BenchmarkCategory(\"NLog\")]\n[Benchmark]\npublic void NLogLoggingTemplateConstant()\n{\n    for (int i = 0; i &lt; Iterations; i++)\n    {\n        nl_logger.Info(\"Param: {Parameter}\", i);\n    }\n}\n</pre>\n<p>Hardware Configuration:</p>\n<pre>\nBenchmarkDotNet v0.14.0, Windows 10 (10.0.19045.5247/22H2/2022Update)\n12th Gen Intel Core i7-12800H, 1 CPU, 20 logical and 14 physical cores\n  [Host]               : .NET Framework 4.8.1 (4.8.9282.0), X64 RyuJIT VectorSize=256\n  .NET 9.0             : .NET 9.0.0 (9.0.24.52809), X64 RyuJIT AVX2\n  .NET Framework 4.8.1 : .NET Framework 4.8.1 (4.8.9282.0), X64 RyuJIT VectorSize=256\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2629.json",
    "content": "{\n  \"title\": \"Logging templates should be constant\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"performance\",\n    \"logging\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2629\",\n  \"sqKey\": \"S2629\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2674.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Invoking a stream reading method without verifying the number of bytes read can lead to erroneous assumptions. A Stream can represent any I/O\noperation, such as reading a file, network communication, or inter-process communication. As such, it is not guaranteed that the <code>byte[]</code>\npassed into the method will be filled with the requested number of bytes. Therefore, inspecting the value returned by the reading method is important\nto ensure the number of bytes read.</p>\n<p>Neglecting the returned length read can result in a bug that is difficult to reproduce.</p>\n<p>This rule raises an issue when the returned value is ignored for the following methods:</p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.io.stream.read\">Stream.Read</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.io.stream.readasync\">Stream.ReadAsync</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.io.stream.readatleast\">Stream.ReadAtLeast</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.io.stream.readatleastasync\">Stream.ReadAtLeastAsync</a></li>\n</ul>\n<h2>How to fix it</h2>\n<p>Check the return value of stream reading methods to verify the actual number of bytes read, and use this value when processing the data to avoid\npotential bugs.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic byte[] ReadFile(string fileName)\n{\n    using var stream = File.Open(fileName, FileMode.Open);\n    var result = new byte[stream.Length];\n\n    stream.Read(result, 0, (int)stream.Length); // Noncompliant\n\n    return result;\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic byte[] ReadFile(string fileName)\n{\n    using var stream = File.Open(fileName, FileMode.Open);\n    using var ms = new MemoryStream();\n    var buffer = new byte[1024];\n    int read;\n\n    while ((read = stream.Read(buffer, 0, buffer.Length)) &gt; 0)\n    {\n        ms.Write(buffer, 0, read);\n    }\n\n    return ms.ToArray();\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.io.stream.read\">Stream.Read Method</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.io.stream.readasync\">Stream.ReadAsync Method</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.io.stream.readatleast\">Stream.ReadAtLeast Method</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.io.stream.readatleastasync\">Stream.ReadAtLeastAsync\n  Method</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2674.json",
    "content": "{\n  \"title\": \"The length returned from a stream read should be checked\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"LOW\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2674\",\n  \"sqKey\": \"S2674\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2681.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Having inconsistent indentation and omitting curly braces from a control structure, such as an <code>if</code> statement or <code>for</code> loop,\nis misleading and can induce bugs.</p>\n<p>This rule raises an issue when the indentation of the lines after a control structure indicates an intent to include those lines in the block, but\nthe omission of curly braces means the lines will be unconditionally executed once.</p>\n<p>The following patterns are recognized:</p>\n<pre>\nif (condition)\n  FirstActionInBlock();\n  SecondAction();  // Noncompliant: SecondAction is executed unconditionally\nThirdAction();\n</pre>\n<pre>\nif(condition) FirstActionInBlock(); SecondAction();  // Noncompliant: SecondAction is executed unconditionally\n</pre>\n<pre>\nif (condition) FirstActionInBlock();\n  SecondAction();  // Noncompliant: SecondAction is executed unconditionally\n</pre>\n<pre>\nstring str = null;\nfor (int i = 0; i &lt; array.Length; i++)\n  str = array[i];\n  DoTheThing(str);  // Noncompliant: executed only on the last element\n</pre>\n<p>Note that this rule considers tab characters to be equivalent to 1 space. When mixing spaces and tabs, a code may look fine in one editor but be\nconfusing in another configured differently.</p>\n<h2>Resources</h2>\n<ul>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/483\">CWE-483 - Incorrect Block Delimitation</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2681.json",
    "content": "{\n  \"title\": \"Multiline blocks should be enclosed in curly braces\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"FORMATTED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2681\",\n  \"sqKey\": \"S2681\",\n  \"scope\": \"All\",\n  \"securityStandards\": {\n    \"CWE\": [\n      483\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2688.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.double.nan\">double.NaN</a> and <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.single.nan\">float.NaN</a> are not equal to anything, not even themselves.</p>\n<p>When anything is compared with <code>NaN</code> using one of the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/comparison-operators\">comparison operators</a> <code>&gt;</code>,\n<code>&gt;=</code>, <code>&lt;</code>, <code>⇐</code> or the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/equality-operators#equality-operator-\">equality operator</a>\n<code>==</code>, the result will always be <code>false</code>. In contrast, when anything is compared with <code>NaN</code> using the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/equality-operators#inequality-operator-\">inequality operator</a>\n<code>!=</code>, the result will always be <code>true</code>.</p>\n<p>Instead, the best way to see whether a variable is equal to <code>NaN</code> is to use the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.single.isnan\">float.IsNaN</a> and <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.double.isnan\">double.IsNaN</a> methods, which work as expected.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nvar a = double.NaN;\n\nif (a == double.NaN) // Noncompliant: always false\n{\n  Console.WriteLine(\"a is not a number\");\n}\nif (a != double.NaN)  // Noncompliant: always true\n{\n  Console.WriteLine(\"a is not NaN\");\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nvar a = double.NaN;\n\nif (double.IsNaN(a))\n{\n  Console.WriteLine(\"a is not a number\");\n}\nif (!double.IsNaN(a))\n{\n  Console.WriteLine(\"a is not NaN\");\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2688.json",
    "content": "{\n  \"title\": \"\\\"NaN\\\" should not be used in comparisons\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2688\",\n  \"sqKey\": \"S2688\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2692.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Most checks against an <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.indexof\">IndexOf</a> value compare it with -1 because\n<strong>0 is a valid index</strong>.</p>\n<pre>\nstrings.IndexOf(someString) == -1 // Test for \"index not found\"\nstrings.IndexOf(someString) &lt; 0   // Test for \"index not found\"\nstrings.IndexOf(someString) &gt;= 0  // Test for \"index found\"\n</pre>\n<p>Any checks which look for values <code>&gt; 0</code> ignore the first element, which is likely a bug. If the intent is merely to check the\ninclusion of a value in a <code>string</code>, <code>List</code>, or array, consider using the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.contains\">Contains</a> method instead.</p>\n<pre>\nstrings.Contains(someString) // bool result\n</pre>\n<p>This rule raises an issue when the output value of any of the following methods is tested against <code>&gt; 0</code>:</p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.ilist.indexof\">IndexOf</a>, applied to <code>string</code>, list or\n  array</li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.indexofany\">IndexOfAny</a>, applied to a <code>string</code></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.lastindexof\">LastIndexOf</a>, applied to a <code>string</code>, list or\n  array</li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.lastindexofany\">LastIndexOfAny</a>, applied to a <code>string</code></li>\n</ul>\n<pre>\nsomeArray.IndexOf(someItem) &gt; 0        // Noncompliant: index 0 missing\nsomeString.IndexOfAny(charsArray) &gt; 0  // Noncompliant: index 0 missing\nsomeList.LastIndexOf(someItem) &gt; 0     // Noncompliant: index 0 missing\nsomeString.LastIndexOf(charsArray) &gt; 0 // Noncompliant: index 0 missing\n</pre>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nstring color = \"blue\";\nstring name = \"ishmael\";\n\nList&lt;string&gt; strings = new List&lt;string&gt;();\nstrings.Add(color);\nstrings.Add(name);\nstring[] stringArray = strings.ToArray();\n\nif (strings.IndexOf(color) &gt; 0) // Noncompliant\n{\n  // ...\n}\n\nif (name.IndexOf(\"ish\") &gt; 0) // Noncompliant\n{\n  // ...\n}\n\nif (name.IndexOf(\"ae\") &gt; 0) // Noncompliant\n{\n  // ...\n}\n\nif (Array.IndexOf(stringArray, color) &gt; 0) // Noncompliant\n{\n  // ...\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nstring color = \"blue\";\nstring name = \"ishmael\";\n\nList&lt;string&gt; strings = new List&lt;string&gt;();\nstrings.Add(color);\nstrings.Add(name);\nstring[] stringArray = strings.ToArray();\n\nif (strings.IndexOf(color) &gt; -1)\n{\n  // ...\n}\n\nif (name.IndexOf(\"ish\") &gt;= 0)\n{\n  // ...\n}\n\nif (name.Contains(\"ae\"))\n{\n  // ...\n}\n\nif (Array.IndexOf(stringArray, color) &gt;= 0)\n{\n  // ...\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.contains\">String.Contains Method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.indexofany\">String.IndexOfAny Method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.lastindexof\">String.LastIndexOf Method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.lastindexofany\">String.LastIndexOfAny Method</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2692.json",
    "content": "{\n  \"title\": \"\\\"IndexOf\\\" checks should not be for positive numbers\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-2692\",\n  \"sqKey\": \"S2692\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2696.html",
    "content": "<p>This rule raises an issue each time a <code>static</code> field is updated from a non-static method or property.</p>\n<h2>Why is this an issue?</h2>\n<p>Updating a <code>static</code> field from a non-<code>static</code> method introduces significant challenges and potential bugs. Multiple class\ninstances and threads can access and modify the <code>static</code> field concurrently, leading to unintended consequences for other instances or\nthreads (unexpected behavior, <a href=\"https://www.c-sharpcorner.com/UploadFile/1d42da/race-conditions-in-threading-C-Sharp/\">race conditions</a> and\nsynchronization problems).</p>\n<pre>\nclass MyClass\n{\n  private static int count = 0;\n\n  public void DoSomething()\n  {\n    //...\n    count++;  // Noncompliant: make the enclosing instance property 'static' or remove this set on the 'static' field.\n  }\n}\n\ninterface MyInterface\n{\n  private static int count = 0;\n\n  public void DoSomething()\n  {\n    //...\n    count++;  // Noncompliant: remove this set, which updates a 'static' field from an instance method.\n  }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/static-classes-and-static-class-members\">Static\n  Classes and Static Class Members</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/threading/using-threads-and-threading\">Using threads and threading</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li><a href=\"https://www.c-sharpcorner.com/UploadFile/1d42da/race-conditions-in-threading-C-Sharp/\">Race Conditions in C#</a></li>\n</ul>\n<h3>Standards</h3>\n<ul>\n  <li>STIG Viewer - <a href=\"https://stigviewer.com/stigs/application_security_and_development/2024-12-06/finding/V-222567\">Application Security and\n  Development: V-222567</a> - The application must not be vulnerable to race conditions.</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2696.json",
    "content": "{\n  \"title\": \"Instance members should not write to \\\"static\\\" fields\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"multi-threading\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-2696\",\n  \"sqKey\": \"S2696\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"STIG ASD_V5R3\": [\n      \"V-222567\"\n    ]\n  },\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2699.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The rule targets test methods that lack an assertion and consist solely of an action and, optionally, a setup.</p>\n<pre>\n[TestMethod]\npublic void Add_SingleNumber_ReturnsSameNumber()\n{\n    var stringCalculator = new StringCalculator();\n    var actual = stringCalculator.Add(\"0\");\n}\n</pre>\n<p>Such tests only verify that the system under test does not throw any exceptions without providing any guarantees regarding the code’s behavior\nunder test. Those tests increase the coverage without enforcing anything on the covered code, resulting in a false sense of security.</p>\n<p>The rule identifies a potential issue when no assertions are present in tests utilizing the following frameworks:</p>\n<ul>\n  <li><code>MSTest</code></li>\n  <li><code>NUnit</code></li>\n  <li><code>xUnit</code></li>\n  <li><code>FluentAssertions</code> (4.x and 5.x)</li>\n  <li><code>NFluent</code></li>\n  <li><code>NSubstitute</code></li>\n  <li><code>Moq</code></li>\n  <li><code>Shoudly</code></li>\n</ul>\n<p>By enforcing the presence of assertions, this rule aims to enhance the reliability and comprehensiveness of tests by ensuring that they provide\nmeaningful validation of the expected behavior.</p>\n<h3>Exceptions</h3>\n<p>Test methods that include a call to a custom assertion method will not raise any issues.</p>\n<h3>How can you fix it?</h3>\n<p>To address this issue, you should include assertions to validate the expected behavior. Choose an appropriate assertion method provided by your\ntesting framework (such as MSTest, NUnit, xUnit) or select a suitable assertion library like FluentAssertions, NFluent, NSubstitute, Moq, or\nShouldly.</p>\n<p>In addition to using built-in assertion methods, you also have the option to create custom assertion methods. To do this, declare an attribute\nnamed <code>[AssertionMethodAttribute]</code> and apply it to the respective method. This allows you to encapsulate specific validation logic within\nyour custom assertion methods without raising the issue. Here’s an example:</p>\n<pre>\nusing System;\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\n\n[TestClass]\npublic class CustomTestExample\n{\n    [TestMethod]\n    public void Add_SingleNumber_ReturnsSameNumber()\n    {\n        var stringCalculator = new StringCalculator();\n        var actual = stringCalculator.Add(\"0\");\n        Validator.AssertCustomEquality(0, actual); // Compliant\n    }\n}\n\npublic static class Validator\n{\n    [AssertionMethod]\n    public static void AssertCustomEquality(int expected, int actual)\n    {\n        // ...\n    }\n}\n\npublic class AssertionMethodAttribute : Attribute { }\n</pre>\n<h2>How to fix it in MSTest</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\n[TestMethod]\npublic void Add_SingleNumber_ReturnsSameNumber()\n{\n    var stringCalculator = new StringCalculator();\n    var actual = stringCalculator.Add(\"0\");\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n[TestMethod]\npublic void Add_SingleNumber_ReturnsSameNumber()\n{\n    var stringCalculator = new StringCalculator();\n    var actual = stringCalculator.Add(\"0\");\n    Assert.AreEqual(0, actual);\n}\n</pre>\n<h2>How to fix it in NUnit</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\n[Test]\npublic void Add_SingleNumber_ReturnsSameNumber()\n{\n    var stringCalculator = new StringCalculator();\n    var actual = stringCalculator.Add(\"0\");\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\n[Test]\npublic void Add_SingleNumber_ReturnsSameNumber()\n{\n    var stringCalculator = new StringCalculator();\n    var actual = stringCalculator.Add(\"0\");\n    Assert.That(0, Is.EqualTo(actual));\n}\n</pre>\n<h2>How to fix it in xUnit</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"3\" data-diff-type=\"noncompliant\">\n[Fact]\npublic void Add_SingleNumber_ReturnsSameNumber()\n{\n    var stringCalculator = new StringCalculator();\n    var actual = stringCalculator.Add(\"0\");\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"3\" data-diff-type=\"compliant\">\n[Fact]\npublic void Add_SingleNumber_ReturnsSameNumber()\n{\n    var stringCalculator = new StringCalculator();\n    var actual = stringCalculator.Add(\"0\");\n    Assert.Equal(0, actual);\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-with-mstest\">Unit testing C# with MSTest</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-with-nunit\">Unit testing C# with NUnit</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-with-dotnet-test\">Unit testing C# with xUnit</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li><a href=\"https://www.everydayunittesting.com/2017/03/unit-testing-anti-pattern-not-asserting.html\">Unit Testing anti-pattern</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2699.json",
    "content": "{\n  \"title\": \"Tests should include assertions\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"TESTED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"tests\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-2699\",\n  \"sqKey\": \"S2699\",\n  \"scope\": \"Tests\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2701.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Using literal boolean values in assertions can lead to less readable and less informative unit tests. When a test fails, it’s important to have a\nclear understanding of what the test was checking and why it failed. Most of the testing frameworks provide more explicit assertion methods that will\nprovide a more helpful error message if the test fails.</p>\n<h3>Exceptions</h3>\n<p>In the context of xUnit, <code>Assert.True</code> and <code>Assert.False</code> are not flagged by this rule. This is because\n<code>Assert.Fail</code> was only introduced in 2020 with version <code>2.4.2</code>. Prior to this, developers used <code>Assert.True(false,\nmessage)</code> and <code>Assert.False(true, message)</code> as workarounds to simulate the functionality of <code>Assert.Fail()</code>.</p>\n<h2>How to fix it in MSTest</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nbool someResult;\n\nAssert.AreEqual(false, someResult); // Noncompliant: use Assert.IsFalse\nAssert.AreEqual(true, someResult); // Noncompliant: use Assert.IsTrue\nAssert.AreNotEqual(false, someResult); // Noncompliant: use Assert.IsTrue\nAssert.AreNotEqual(true, someResult); // Noncompliant: use Assert.IsFalse\nAssert.IsFalse(true, \"Should not reach this line!\"); // Noncompliant: use Assert.Fail\nAssert.IsTrue(false, \"Should not reach this line!\"); // Noncompliant: use Assert.Fail\nAssert.IsFalse(false); // Noncompliant: remove it\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nbool someResult;\n\nAssert.IsFalse(someResult);\nAssert.IsTrue(someResult);\nAssert.IsTrue(someResult);\nAssert.IsFalse(someResult);\nAssert.Fail(\"Should not reach this line!\");\nAssert.Fail(\"Should not reach this line!\");\n// Removed\n</pre>\n<h2>How to fix it in NUnit</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nbool someResult;\n\nAssert.AreEqual(false, someResult); // Noncompliant: use Assert.False\nAssert.AreEqual(true, someResult); // Noncompliant: use Assert.True\nAssert.AreNotEqual(false, someResult); // Noncompliant: use Assert.True\nAssert.AreNotEqual(true, someResult); // Noncompliant: use Assert.False\nAssert.False(true, \"Should not reach this line!\"); // Noncompliant: use Assert.Fail\nAssert.True(false, \"Should not reach this line!\"); // Noncompliant: use Assert.Fail\nAssert.False(false); // Noncompliant: remove it\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nbool someResult;\n\nAssert.False(someResult);\nAssert.True(someResult);\nAssert.True(someResult);\nAssert.False(someResult);\nAssert.Fail(\"Should not reach this line!\");\nAssert.Fail(\"Should not reach this line!\");\n// Removed\n</pre>\n<h2>How to fix it in xUnit</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"3\" data-diff-type=\"noncompliant\">\nbool someResult;\n\nAssert.Equal(false, someResult); // Noncompliant: use Assert.False\nAssert.Equal(true, someResult); // Noncompliant: use Assert.True\nAssert.NotEqual(false, someResult); // Noncompliant: use Assert.True\nAssert.NotEqual(true, someResult); // Noncompliant: use Assert.False\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"3\" data-diff-type=\"compliant\">\nbool someResult;\n\nAssert.False(someResult);\nAssert.True(someResult);\nAssert.True(someResult);\nAssert.False(someResult);\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://docs.nunit.org/\">NUnit Documentation</a></li>\n  <li><a href=\"https://xunit.net/docs/getting-started/netcore/cmdline\">xUnit Documentation</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-with-mstest\">MSTest Documentation</a></li>\n  <li><a href=\"https://github.com/xunit/xunit/issues/2027\">Xunit doesn’t have an Assert.Fail() operation</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2701.json",
    "content": "{\n  \"title\": \"Literal boolean values should not be used in assertions\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"tests\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-2701\",\n  \"sqKey\": \"S2701\",\n  \"scope\": \"Tests\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2737.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>A <code>catch</code> clause that only rethrows the caught exception has the same effect as omitting the <code>catch</code> altogether and letting\nit bubble up automatically.</p>\n<pre>\nstring s = \"\";\ntry\n{\n  s = File.ReadAllText(fileName);\n}\ncatch (Exception e)  // Noncompliant\n{\n  throw;\n}\n</pre>\n<p>Such clauses should either be removed or populated with the appropriate logic.</p>\n<pre>\nstring s = File.ReadAllText(fileName);\n</pre>\n<p>or</p>\n<pre>\nstring s = \"\";\ntry\n{\n  s = File.ReadAllText(fileName);\n}\ncatch (Exception e)\n{\n  logger.LogError(e);\n  throw;\n}\n</pre>\n<h3>Exceptions</h3>\n<p>This rule will not generate issues for <code>catch</code> blocks if they are followed by a <code>catch</code> block for a more general exception\ntype that does more than just rethrowing the exception.</p>\n<pre>\nvar s = \"\"\ntry\n{\n    s = File.ReadAllText(fileName);\n}\ncatch (IOException) // Compliant by exception: removing it would change the logic\n{\n    throw;\n}\ncatch (Exception)  // Compliant: does more than just rethrow\n{\n    logger.LogError(e);\n    throw;\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2737.json",
    "content": "{\n  \"title\": \"\\\"catch\\\" clauses should do more than rethrow\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"error-handling\",\n    \"unused\",\n    \"finding\",\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2737\",\n  \"sqKey\": \"S2737\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2743.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>A static field in a generic type is not shared among instances of different closed constructed types, thus\n<code>LengthLimitedSingletonCollection&lt;int&gt;.instances</code> and <code>LengthLimitedSingletonCollection&lt;string&gt;.instances</code> will\npoint to different objects, even though <code>instances</code> is seemingly shared among all <code>LengthLimitedSingletonCollection&lt;&gt;</code>\ngeneric classes.</p>\n<p>If you need to have a static field shared among instances with different generic arguments, define a non-generic base class to store your static\nmembers, then set your generic type to inherit from the base class.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic class LengthLimitedSingletonCollection&lt;T&gt; where T : new()\n{\n  protected const int MaxAllowedLength = 5;\n  protected static Dictionary&lt;Type, object&gt; instances = new Dictionary&lt;Type, object&gt;(); // Noncompliant\n\n  public static T GetInstance()\n  {\n    object instance;\n\n    if (!instances.TryGetValue(typeof(T), out instance))\n    {\n      if (instances.Count &gt;= MaxAllowedLength)\n      {\n        throw new Exception();\n      }\n      instance = new T();\n      instances.Add(typeof(T), instance);\n    }\n    return (T)instance;\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic class SingletonCollectionBase\n{\n  protected static Dictionary&lt;Type, object&gt; instances = new Dictionary&lt;Type, object&gt;();\n}\n\npublic class LengthLimitedSingletonCollection&lt;T&gt; : SingletonCollectionBase where T : new()\n{\n  protected const int MaxAllowedLength = 5;\n\n  public static T GetInstance()\n  {\n    object instance;\n\n    if (!instances.TryGetValue(typeof(T), out instance))\n    {\n      if (instances.Count &gt;= MaxAllowedLength)\n      {\n        throw new Exception();\n      }\n      instance = new T();\n      instances.Add(typeof(T), instance);\n    }\n    return (T)instance;\n  }\n}\n</pre>\n<h3>Exceptions</h3>\n<p>If the static field or property uses a type parameter, then the developer is assumed to understand that the static member is not shared among the\nclosed constructed types.</p>\n<pre>\npublic class Cache&lt;T&gt;\n{\n   private static Dictionary&lt;string, T&gt; CacheDictionary { get; set; } // Compliant\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2743.json",
    "content": "{\n  \"title\": \"Static fields should not be used in generic types\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2743\",\n  \"sqKey\": \"S2743\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2755.html",
    "content": "<p>This vulnerability allows the usage of external entities in XML.</p>\n<h2>Why is this an issue?</h2>\n<p>External Entity Processing allows for XML parsing with the involvement of external entities. However, when this functionality is enabled without\nproper precautions, it can lead to a vulnerability known as XML External Entity (XXE) attack.</p>\n<h3>What is the potential impact?</h3>\n<h4>Exposing sensitive data</h4>\n<p>One significant danger of XXE vulnerabilities is the potential for sensitive data exposure. By crafting malicious XML payloads, attackers can\nreference external entities that contain sensitive information, such as system files, database credentials, or configuration files. When these\nentities are processed during XML parsing, the attacker can extract the contents and gain unauthorized access to sensitive data. This poses a severe\nthreat to the confidentiality of critical information.</p>\n<h4>Exhausting system resources</h4>\n<p>Another consequence of XXE vulnerabilities is the potential for denial-of-service attacks. By exploiting the ability to include external entities,\nattackers can construct XML payloads that cause resource exhaustion. This can overwhelm the system’s memory, CPU, or other critical resources, leading\nto system unresponsiveness or crashes. A successful DoS attack can disrupt the availability of services and negatively impact the user experience.</p>\n<h4>Forging requests</h4>\n<p>XXE vulnerabilities can also enable Server-Side Request Forgery (SSRF) attacks. By leveraging the ability to include external entities, an attacker\ncan make the vulnerable application send arbitrary requests to other internal or external systems. This can result in unintended actions, such as\nretrieving data from internal resources, scanning internal networks, or attacking other systems. SSRF attacks can lead to severe consequences,\nincluding unauthorized data access, system compromise, or even further exploitation within the network infrastructure.</p>\n<h2>How to fix it in .NET</h2>\n<h3>Code examples</h3>\n<p>The following code contains examples of XML parsers that have external entity processing enabled. As a result, the parsers are vulnerable to XXE\nattacks if an attacker can control the XML file that is processed.</p>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nusing System.Xml;\n\npublic static void decode()\n{\n    XmlDocument parser = new XmlDocument();\n    parser.XmlResolver = new XmlUrlResolver(); // Noncompliant\n    parser.LoadXml(\"xxe.xml\");\n}\n</pre>\n<h4>Compliant solution</h4>\n<p><code>XmlDocument</code> is safe by default since .NET Framework 4.5.2. For older versions, set <code>XmlResolver</code> explicitly to\n<code>null</code>.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nusing System.Xml;\n\npublic static void decode()\n{\n    XmlDocument parser = new XmlDocument();\n    parser.XmlResolver = null;\n    parser.LoadXml(\"xxe.xml\");\n}\n</pre>\n<h3>How does this work?</h3>\n<h4>Disable external entities</h4>\n<p>The most effective approach to prevent XXE vulnerabilities is to disable external entity processing entirely, unless it is explicitly required for\nspecific use cases. By default, XML parsers should be configured to reject the processing of external entities. This can be achieved by setting the\nappropriate properties or options in your XML parser library or framework.</p>\n<p>If external entity processing is necessary for certain scenarios, adopt a whitelisting approach to restrict the entities that can be resolved\nduring XML parsing. Create a list of trusted external entities and disallow all others. This approach ensures that only known and safe entities are\nprocessed.\n  <br>\n  You should rely on features provided by your XML parser to restrict the external entities.</p>\n<h2>Resources</h2>\n<h3>Standards</h3>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A05_2021-Security_Misconfiguration/\">Top 10 2021 Category A5 - Security Misconfiguration</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A4_2017-XML_External_Entities_(XXE)\">Top 10 2017 Category A4 - XML External Entities\n  (XXE)</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/611\">CWE-611 - Information Exposure Through XML External Entity Reference</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/827\">CWE-827 - Improper Control of Document Type Definition</a></li>\n  <li>STIG Viewer - <a href=\"https://stigviewer.com/stigs/application_security_and_development/2024-12-06/finding/V-222608\">Application Security and\n  Development: V-222608</a> - The application must not be vulnerable to XML-oriented attacks.</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2755.json",
    "content": "{\n  \"title\": \"XML parsers should not be vulnerable to XXE attacks\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-2755\",\n  \"sqKey\": \"S2755\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      611,\n      827\n    ],\n    \"OWASP\": [\n      \"A4\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A5\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"6.5.1\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"6.2.4\"\n    ],\n    \"ASVS 4.0\": [\n      \"5.5.2\"\n    ],\n    \"STIG ASD_V5R3\": [\n      \"V-222608\"\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2757.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Using operator pairs (<code>=+</code>, <code>=-</code>, or <code>=!</code>) that look like reversed single operators (<code>+=</code>,\n<code>-=</code> or <code>!=</code>) is confusing. They compile and run but do not produce the same result as their mirrored counterpart.</p>\n<pre>\nint target = -5;\nint num = 3;\n\ntarget =- num;  // Noncompliant: target = -3. Is that the intended behavior?\ntarget =+ num; // Noncompliant: target = 3\n</pre>\n<p>This rule raises an issue when <code>=+</code>, <code>=-</code>, or <code>=!</code> are used without any space between the operators and when there\nis at least one whitespace after.</p>\n<p>Replace the operators with a single one if that is the intention</p>\n<pre>\nint target = -5;\nint num = 3;\n\ntarget -= num;  // target = -8\n</pre>\n<p>Or fix the spacing to avoid confusion</p>\n<pre>\nint target = -5;\nint num = 3;\n\ntarget = -num;  // target = -3\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2757.json",
    "content": "{\n  \"title\": \"Non-existent operators like \\\"\\u003d+\\\" should not be used\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2757\",\n  \"sqKey\": \"S2757\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2760.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When the same condition is checked twice in a row, it is either confusing - why have separate checks? - or an error - some other condition should\nhave been checked in the second test.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nif (a == b)\n{\n  doTheThing(b);\n}\nif (a == b) // Noncompliant; is this really what was intended?\n{\n  doTheThing(c);\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nif (a == b)\n{\n  doTheThing(b);\n  doTheThing(c);\n}\n</pre>\n<p>or</p>\n<pre>\nif (a == b)\n{\n  doTheThing(b);\n}\nif (b == c)\n{\n  doTheThing(c);\n}\n</pre>\n<h3>Exceptions</h3>\n<p>Since it is a common pattern to test a variable, reassign it if it fails the test, then re-test it, that pattern is ignored.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2760.json",
    "content": "{\n  \"title\": \"Sequential tests should not check the same condition\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"suspicious\",\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2760\",\n  \"sqKey\": \"S2760\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2761.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The repetition of a prefix operator (<code>!</code>, or <code>~</code>) is usually a typo. The second operator invalidates the first one.</p>\n<pre>\nint v1 = 0;\nbool v2 = false;\n\nvar v3 = !!v1; // Noncompliant: equivalent to \"v1\"\nvar v4 = ~~v2; // Noncompliant: equivalent to \"v2\"\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2761.json",
    "content": "{\n  \"title\": \"Doubled prefix operators \\\"!!\\\" and \\\"~~\\\" should not be used\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2761\",\n  \"sqKey\": \"S2761\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2857.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When concatenating strings, it is very easy to forget a whitespace.</p>\n<p>In some scenarios this might cause runtime errors, one of which is while creating an SQL query via concatenation:</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nstring select = \"SELECT p.FirstName, p.LastName, p.PhoneNumber\" +\n        \"FROM Person as p\" +    // Noncompliant: concatenation results in \"p.PhoneNumberFROM\"\n        \"WHERE p.Id = @Id\";     // Noncompliant: concatenation results in \"pWHERE\"\n</pre>\n<p>This rule raises an issue when the spacing around SQL keywords appears to be missing, making the concatenated string invalid SQL syntax. It would\nrequire the user to add the appropriate whitespaces:</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nstring select = \"SELECT p.FirstName, p.LastName, p.PhoneNumber\" +\n        \" FROM Person as p\" +\n        \" WHERE p.Id = @Id\";\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2857.json",
    "content": "{\n  \"title\": \"SQL keywords should be delimited by whitespace\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"sql\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-2857\",\n  \"sqKey\": \"S2857\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2925.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Using <code>Thread.Sleep</code> in a test might introduce unpredictable and inconsistent results depending on the environment. Furthermore, it will\nblock the <a href=\"https://en.wikipedia.org/wiki/Thread_(computing)\">thread</a>, which means the system resources are not being fully used.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\n[TestMethod]\npublic void SomeTest()\n{\n    Thread.Sleep(500); // Noncompliant\n    // assertions...\n}\n</pre>\n<p>An alternative is a task-based asynchronous approach, using <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/asynchronous-programming/\">async and await</a>.</p>\n<p>More specifically the <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task.delay\">Task.Delay</a> method should be\nused, because of the following advantages:</p>\n<ul>\n  <li>It is <strong>asynchronous</strong>: The thread will not be blocked, but instead will be reused by other operations</li>\n  <li>It is more <strong>precise</strong> in timing the delay than <code>Thread.Sleep</code></li>\n  <li>It can be <strong>canceled and continued</strong>, which gives more flexibility and control in the timing of your code</li>\n</ul>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n[TestMethod]\npublic async Task SomeTest()\n{\n    await Task.Delay(500);\n    // assertions...\n}\n</pre>\n<p>Another scenario is when some data might need to be mocked using <a href=\"https://github.com/moq/moq4\">Moq</a>, and a delay needs to be\nintroduced:</p>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\n[TestMethod]\npublic void UserService_Test()\n{\n    var userService = new Mock&lt;UserService&gt;();\n    var expected = new User();\n\n    userService\n        .Setup(m =&gt; m.GetUserById(42))\n        .Returns(() =&gt;\n        {\n            Thread.Sleep(500); // Noncompliant\n            return Task.FromResult(expected);\n        });\n\n    // assertions...\n}\n</pre>\n<p>An alternative to <code>Thread.Sleep</code> while mocking with <code>Moq</code> is to use <code>ReturnsAsync</code> and pass the amount of time to\ndelay there:</p>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\n[TestMethod]\npublic void UserService_Test()\n{\n    var userService = new Mock&lt;UserService&gt;();\n    var expected = new User();\n\n    userService\n        .Setup(m =&gt; m.GetUserById(42))\n        .ReturnsAsync(expected, TimeSpan.FromMilliseconds(500));\n\n    // assertions...\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.thread.sleep\">Thread.Sleep method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task.delay\">Task.Delay method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/asynchronous-programming/\">Asynchronous programming with async and await</a></li>\n  <li><a href=\"https://github.com/moq/moq4\">Moq mocking library</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2925.json",
    "content": "{\n  \"title\": \"\\\"Thread.Sleep\\\" should not be used in tests\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"tests\",\n    \"bad-practice\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2925\",\n  \"sqKey\": \"S2925\",\n  \"scope\": \"Tests\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2930.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When writing <a href=\"https://learn.microsoft.com/en-us/dotnet/standard/managed-code\">managed code</a>, there is no need to worry about memory\nallocation or deallocation as it is taken care of by the <a href=\"https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection\">garbage\ncollector</a>. However, certain objects, such as <code>Bitmap</code>, utilize unmanaged memory for specific purposes like <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/unsafe-code\">pointer arithmetic</a>. These objects may have substantial\nunmanaged memory footprints while having minimal managed footprints. Unfortunately, the garbage collector only recognizes the small managed footprint\nand does not promptly reclaim the corresponding unmanaged memory (by invoking the finalizer method of <code>Bitmap</code>) for efficiency reasons.</p>\n<p>In addition, it’s essential to manage other system resources besides memory. The operating system has limits on the number of <a\nhref=\"https://en.wikipedia.org/wiki/File_descriptor\">file descriptors</a> (e.g., <code>FileStream</code>) or <a\nhref=\"https://en.wikipedia.org/wiki/Network_socket\">sockets</a> (e.g., <code>WebClient</code>) that can remain open simultaneously. Therefore, it’s\ncrucial to <code>Dispose</code> of these resources promptly when they are no longer required, instead of relying on the garbage collector to invoke\nthe finalizers of these objects at an unpredictable time in the future.</p>\n<p>This rule keeps track of <code>private</code> fields and local variables of specific types that implement <code>IDisposable</code> or\n<code>IAsyncDisposable</code>. It identifies instances of these types that are not properly disposed, closed, aliased, returned, or passed to other\nmethods. This applies to instances that are either directly created using the <code>new</code> operator or instantiated through a predefined list of\nfactory methods.</p>\n<p>Here is the list of the types tracked by this rule:</p>\n<ul>\n  <li><code>FluentAssertions.Execution.AssertionScope</code></li>\n  <li><code>System.Drawing.Bitmap</code></li>\n  <li><code>System.Drawing.Image</code></li>\n  <li><code>System.IO.FileStream</code></li>\n  <li><code>System.IO.StreamReader</code></li>\n  <li><code>System.IO.StreamWriter</code></li>\n  <li><code>System.Net.Sockets.TcpClient</code></li>\n  <li><code>System.Net.Sockets.UdpClient</code></li>\n  <li><code>System.Net.WebClient</code></li>\n</ul>\n<p>Here is the list of predefined factory methods tracked by this rule:</p>\n<ul>\n  <li><code>System.Drawing.Image.FromFile()</code></li>\n  <li><code>System.Drawing.Image.FromStream()</code></li>\n  <li><code>System.IO.File.Create()</code></li>\n  <li><code>System.IO.File.Open()</code></li>\n</ul>\n<h3>Exceptions</h3>\n<p><code>IDisposable</code> / <code>IAsyncDisposable</code> variables returned from a method or passed to other methods are ignored, as are local\n<code>IDisposable</code> / <code>IAsyncDisposable</code> objects that are initialized with other <code>IDisposable</code> /\n<code>IAsyncDisposable</code> objects.</p>\n<pre>\npublic Stream WriteToFile(string path, string text)\n{\n  var fs = new FileStream(path, FileMode.Open); // Compliant: it is returned\n  var bytes = Encoding.UTF8.GetBytes(text);\n  fs.Write(bytes, 0, bytes.Length);\n  return fs;\n}\n\npublic void ReadFromStream(Stream s)\n{\n  var sr = new StreamReader(s); // Compliant: it would close the underlying stream.\n  // ...\n}\n</pre>\n<h2>How to fix it</h2>\n<p>It is essential to identify what kind of disposable resource variable is used to know how to fix this issue.</p>\n<p>In the case of a disposable resource store as a member (either as field or property), it should be disposed at the same time as the class. The best\nway to achieve this is to follow the <a href=\"https://learn.microsoft.com/en-us/dotnet/standard/design-guidelines/dispose-pattern\">dispose\npattern</a>.</p>\n<p>When creating the disposable resource for a one-time use (cases not covered by the exceptions), it should be disposed at the end of its creation\nscope. The easiest to ensure your resource is disposed when reaching the end of a scope is to either use <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/using\">the using statement or the using declaration</a></p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic class ResourceHolder\n{\n  private FileStream fs; // Noncompliant: dispose or close are never called\n\n  public void OpenResource(string path)\n  {\n    this.fs = new FileStream(path, FileMode.Open);\n  }\n\n  public void WriteToFile(string path, string text)\n  {\n    var fs = new FileStream(path, FileMode.Open); // Noncompliant: not disposed, returned or initialized with another disposable object\n    var bytes = Encoding.UTF8.GetBytes(text);\n    fs.Write(bytes, 0, bytes.Length);\n  }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic class ResourceHolder : IDisposable, IAsyncDisposable\n{\n  private FileStream fs; // Compliant: disposed in Dispose/DisposeAsync methods\n\n  public void OpenResource(string path)\n  {\n    this.fs = new FileStream(path, FileMode.Open);\n  }\n\n  public void Dispose()\n  {\n    this.fs.Dispose();\n  }\n\n  public async ValueTask DisposeAsync()\n  {\n    await fs.DisposeAsync().ConfigureAwait(false);\n  }\n\n  public void WriteToFile(string path, string text)\n  {\n    using (var fs = new FileStream(path, FileMode.Open)) // Compliant: disposed at the end of the using block\n    {\n      var bytes = Encoding.UTF8.GetBytes(text);\n      fs.Write(bytes, 0, bytes.Length);\n    }\n  }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/standard/managed-code\">What is \"managed code\"?</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection\">Garbage collection</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/finalizers\">Finalizers</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/unsafe-code\">Unsafe code, pointer types, and\n  function pointers</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/File_descriptor\">File descriptor</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Network_socket\">Network socket</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/standard/design-guidelines/dispose-pattern\">Dispose pattern</a>\n    <ul>\n      <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/implementing-dispose\">Implement a Dispose\n      method</a></li>\n      <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/implementing-disposeasync\">Implement a\n      DisposeAsync method</a></li>\n    </ul></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/using\">using statement and using\n  declaration</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/459\">CWE-459 - Incomplete Cleanup</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2930.json",
    "content": "{\n  \"title\": \"\\\"IDisposables\\\" should be disposed\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"denial-of-service\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-2930\",\n  \"sqKey\": \"S2930\",\n  \"scope\": \"All\",\n  \"securityStandards\": {\n    \"CWE\": [\n      459\n    ]\n  },\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2931.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>An <code>IDisposable</code> object should be disposed (there are some rare exceptions where not disposing is fine, most notably <code>Task</code>).\nIf a class has an <code>IDisposable</code> field, there can be two situations:</p>\n<ul>\n  <li>The class observes a field that is under the responsibility of another class.</li>\n  <li>The class owns the field, and is therefore responsible for calling <code>Dispose</code> on it.</li>\n</ul>\n<p>In the second case, the safest way for the class to ensure <code>Dispose</code> is called is to call it in its own <code>Dispose</code> function,\nand therefore to be itself <code>IDisposable</code>. A class is considered to own an <code>IDisposable</code> field resource if it created the object\nreferenced by the field.</p>\n<h3>Noncompliant code example</h3>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic class ResourceHolder   // Noncompliant; doesn't implement IDisposable\n{\n    private FileStream fs;  // This member is never Disposed\n    public void OpenResource(string path)\n    {\n        this.fs = new FileStream(path, FileMode.Open); // I create the FileStream, I'm owning it\n    }\n    public void CloseResource()\n    {\n        this.fs.Close();\n    }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic class ResourceHolder : IDisposable\n{\n    private FileStream fs;\n    public void OpenResource(string path)\n    {\n        this.fs = new FileStream(path, FileMode.Open); // I create the FileStream, I'm owning it\n    }\n    public void CloseResource()\n    {\n        this.fs.Close();\n    }\n    public void Dispose()\n    {\n        this.fs.Dispose();\n    }\n}\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/459\">CWE-459 - Incomplete Cleanup</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2931.json",
    "content": "{\n  \"title\": \"Classes with \\\"IDisposable\\\" members should implement \\\"IDisposable\\\"\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"denial-of-service\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-2931\",\n  \"sqKey\": \"S2931\",\n  \"scope\": \"All\",\n  \"securityStandards\": {\n    \"CWE\": [\n      459\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2933.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><code>readonly</code> fields can only be assigned in a class constructor. If a class has a field that’s not marked <code>readonly</code> but is\nonly set in the constructor, it could cause confusion about the field’s intended use. To avoid confusion, such fields should be marked\n<code>readonly</code> to make their intended use explicit, and to prevent future maintainers from inadvertently changing their use.</p>\n<h3>Exceptions</h3>\n<ul>\n  <li>Fields declared in classes marked with the <code>Serializable</code> attribute.</li>\n  <li>Fields declared in <code>partial</code> classes.</li>\n  <li>Fields with attributes are ignored.</li>\n  <li>Fields of type <code>struct</code> that are not primitive or pointer types are also ignored because of possible unwanted behavior.</li>\n</ul>\n<h2>How to fix it</h2>\n<p>Mark the given field with the <code>readonly</code> modifier.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic class Person\n{\n    private int _birthYear; // Noncompliant\n\n    Person(int birthYear)\n    {\n        _birthYear = birthYear;\n    }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic class Person\n{\n    private readonly int _birthYear;\n\n    Person(int birthYear)\n    {\n        _birthYear = birthYear;\n    }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/readonly\">readonly</a></li>\n  <li>Fabulous adventures in coding - <a href=\"https://ericlippert.com/2008/05/14/mutating-readonly-structs/\">Mutating readonly structs</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2933.json",
    "content": "{\n  \"title\": \"Fields that are only assigned in the constructor should be \\\"readonly\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"confusing\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2933\",\n  \"sqKey\": \"S2933\",\n  \"scope\": \"All\",\n  \"quickfix\": \"partial\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2934.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>While the properties of a <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/readonly\"><code>readonly</code></a>\n<a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/reference-types\">reference type</a> field can still be changed\nafter initialization, those of a <code>readonly</code> <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/value-types\">value type</a> field, such as a <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/struct\"><code>struct</code></a>, cannot.</p>\n<p>If the member could be either a <code>class</code> or a <code>struct</code> then assignment to its properties could be unreliable, working\nsometimes but not others.</p>\n<h2>How to fix it</h2>\n<p>There are two ways to fix this issue:</p>\n<ul>\n  <li>Restrict the type of the field to a <code>class</code></li>\n  <li>Remove the assignment entirely, if it is not possible to restrict the type of the field</li>\n</ul>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\ninterface IPoint\n{\n    int X { get; set; }\n    int Y { get; set; }\n}\n\nclass PointManager&lt;T1, T2&gt;\n    where T1 : IPoint\n    where T2 : IPoint\n{\n    readonly T1 point1;  // this could be a struct\n    readonly T2 point2;  // this could be a struct\n\n    public PointManager(T1 point1, T2 point2)\n    {\n        this.point1 = point1;\n        this.point2 = point2;\n    }\n\n    public void MovePoints(int newX)\n    {\n        point1.X = newX; //Noncompliant: if point is a struct, then nothing happened\n        point2.X = newX; //Noncompliant: if point is a struct, then nothing happened\n    }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\ninterface IPoint\n{\n    int X { get; set; }\n    int Y { get; set; }\n}\n\nclass PointManager&lt;T1, T2&gt;\n    where T1 : IPoint\n    where T2 : class, IPoint\n{\n    readonly T1 point1;  // this could be a struct\n    readonly T2 point2;  // this is a class\n\n    public PointManager(T1 point1, T2 point2)\n    {\n        this.point1 = point1;\n        this.point2 = point2;\n    }\n\n    public void MovePoints(int newX) // assignment to point1 has been removed\n    {\n        point2.X = newX; // Compliant: point2 is a class\n    }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/readonly\">readonly (C#\n  Reference)</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/reference-types\">Reference types (C#\n  reference)</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/value-types\">Value types (C#\n  reference)</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/struct\">Structure types (C#\n  reference)</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2934.json",
    "content": "{\n  \"title\": \"Property assignments should not be made for \\\"readonly\\\" fields not constrained to reference types\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"LOW\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2934\",\n  \"sqKey\": \"S2934\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2952.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>It is possible in an <code>IDisposable</code> to call <code>Dispose</code> on class members from any method, but the contract of\n<code>Dispose</code> is that it will clean up all unmanaged resources. Move disposing of members to some other method, and you risk resource\nleaks.</p>\n<p>This rule also applies for disposable ref structs.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic class ResourceHolder : IDisposable\n{\n  private FileStream fs;\n  public void OpenResource(string path)\n  {\n    this.fs = new FileStream(path, FileMode.Open);\n  }\n  public void CloseResource()\n  {\n    this.fs.Close();\n  }\n\n  public void CleanUp()\n  {\n    this.fs.Dispose(); // Noncompliant; Dispose not called in class' Dispose method\n  }\n\n  public void Dispose()\n  {\n    // method added to satisfy demands of interface\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic class ResourceHolder : IDisposable\n{\n  private FileStream fs;\n  public void OpenResource(string path)\n  {\n    this.fs = new FileStream(path, FileMode.Open);\n  }\n  public void CloseResource()\n  {\n    this.fs.Close();\n  }\n\n  public void Dispose()\n  {\n    this.fs.Dispose();\n  }\n}\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/459\">CWE-459 - Incomplete Cleanup</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2952.json",
    "content": "{\n  \"title\": \"Classes should \\\"Dispose\\\" of members from the classes\\u0027 own \\\"Dispose\\\" methods\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"denial-of-service\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-2952\",\n  \"sqKey\": \"S2952\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      459\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2953.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.idisposable\">IDisposable</a> is an interface implemented by all types which need to\nprovide a mechanism for <a href=\"https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/unmanaged\">releasing unmanaged\nresources</a>.</p>\n<p>Unlike managed memory, which is taken care of by the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/fundamentals\">garbage collection</a>,</p>\n<p>The interface declares a <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.idisposable.dispose\">Dispose</a> method, which the\nimplementer has to define.</p>\n<p>The method name <code>Dispose</code> should be used exclusively to implement <code>IDisposable.Dispose</code> to prevent any confusion.</p>\n<p>It may be tempting to create a <code>Dispose</code> method for other purposes, but doing so will result in confusion and likely lead to problems in\nproduction.</p>\n<h3>Exceptions</h3>\n<p>Methods named <code>Dispose</code> and invoked from the <code>IDisposable.Dispose</code> implementation are not reported.</p>\n<pre>\npublic class GarbageDisposal : IDisposable\n{\n  protected virtual void Dispose(bool disposing)\n  {\n    //...\n  }\n  public void Dispose()\n  {\n    Dispose(true);\n    GC.SuppressFinalize(this);\n  }\n}\n</pre>\n<h2>How to fix it</h2>\n<p>First, it is important to determine whether instances of the type defining the <code>Dispose</code> method should support the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.idisposable\">IDisposable</a> interface or not.</p>\n<p>The decision would be based on whether the instance can have unmanaged resources which have to be dealt with, upon destruction or earlier in the\nlifetime of the object.</p>\n<p>The <a href=\"https://learn.microsoft.com/en-us/dotnet/standard/design-guidelines/dispose-pattern\">Dispose pattern</a> can help to take the\ndecision.</p>\n<p>If the type should not support the pattern, the <code>Dispose</code> method should be renamed to something which is different than\n<code>Dispose</code>, but still relevant and possibly more specific to the context.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre>\npublic class GarbageDisposal\n{\n  private int Dispose()  // Noncompliant\n  {\n    // ...\n  }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre>\npublic class GarbageDisposal : IDisposable\n{\n  public void Dispose()\n  {\n    // ...\n  }\n}\n</pre>\n<p>or</p>\n<pre>\npublic class GarbageDisposal\n{\n  private int Grind()\n  {\n    // ...\n  }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/fundamentals\">Fundamentals of garbage collection</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/unmanaged\">Cleaning up unmanaged resources</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.idisposable\">IDisposable Interface</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/implementing-dispose\">Implement a Dispose method</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2953.json",
    "content": "{\n  \"title\": \"Methods named \\\"Dispose\\\" should implement \\\"IDisposable.Dispose\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-2953\",\n  \"sqKey\": \"S2953\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2955.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>In C#, without constraints on a generic type parameter, both <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/reference-types\">reference</a> and <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/value-types\">value</a> types can be passed. However, comparing\nthis type parameter to <code>null</code> can be misleading as value types, like <code>struct</code>, can never be null.</p>\n<h2>How to fix it</h2>\n<p>To avoid unexpected comparisons:</p>\n<ul>\n  <li>if you expect a value type, use <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/default#default-operator\">default()</a> for comparison</li>\n  <li>if you expect a reference type, add a <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/generics/constraints-on-type-parameters\">constraint</a> to prevent value\n  types from being passed</li>\n</ul>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nbool IsDefault&lt;T&gt;(T value)\n{\n  if (value == null) // Noncompliant\n  {\n    // ...\n  }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nbool IsDefault&lt;T&gt;(T value)\n{\n  if (EqualityComparer&lt;T&gt;.Default.Equals(value, default(T)))\n  {\n    // ...\n  }\n}\n</pre>\n<p>or</p>\n<pre>\nbool IsDefault&lt;T&gt;(T value) where T : class\n{\n  if (value == null)\n  {\n    // ...\n  }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/generics/constraints-on-type-parameters\">Constraints on type\n  parameters</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/reference-types\">Reference types</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/value-types\">Value types</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/default#default-operator\"><code>default</code> operator</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2955.json",
    "content": "{\n  \"title\": \"Generic parameters not constrained to reference types should not be compared to \\\"null\\\"\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"LOW\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2955\",\n  \"sqKey\": \"S2955\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2970.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>This rule addresses the issue of incomplete assertions that can occur when using certain test frameworks. Incomplete assertions can lead to tests\nthat do not effectively verify anything. The rule enforces the use of complete assertions in specific cases, namely:</p>\n<ul>\n  <li>Fluent Assertions: <a href=\"https://fluentassertions.com/introduction\">Should()</a> is not followed by an assertion invocation.</li>\n</ul>\n<pre>\nstring actual = \"Using Fluent Assertions\";\nactual.Should(); // Noncompliant\n</pre>\n<ul>\n  <li>NFluent: <a href=\"https://www.n-fluent.net\">Check.That()</a> is not followed by an assertion invocation.</li>\n</ul>\n<pre>\nstring actual = \"Using NFluent\";\nCheck.That(actual); // Noncompliant\n</pre>\n<ul>\n  <li>NSubstitute: <a href=\"https://nsubstitute.github.io/help/received-calls\">Received()</a> is not followed by an invocation.</li>\n</ul>\n<pre>\ncommand.Received(); // Noncompliant\n</pre>\n<p>In such cases, what is intended to be a test doesn’t actually verify anything.</p>\n<h2>How to fix it in Fluent Assertions</h2>\n<p><code>Fluent Assertions</code> provides an interface for writing assertions, and it is important to ensure that <code>Should()</code> is properly\nused in conjunction with an assertion method.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nstring actual = \"Hello World!\";\nactual.Should(); // Noncompliant\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nstring actual = \"Hello World!\";\nactual.Should().Contain(\"Hello\");\n</pre>\n<h2>How to fix it in NFluent</h2>\n<p><code>NFluent</code> offers a syntax for assertions, and it’s important to follow <code>Check.That()</code> with an assertion method to complete\nthe assertion.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nstring actual = \"Hello World!\";\nCheck.That(actual); // Noncompliant\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nstring actual = \"Hello World!\";\nCheck.That(actual).Contains(\"Hello\");\n</pre>\n<h2>How to fix it in NSubstitute</h2>\n<p><code>NSubstitute</code> is a mocking framework, and <code>Received()</code> is used to verify that a specific method has been called. However,\ninvoking a method on the mock after calling <code>Received()</code> is necessary to ensure the complete assertion.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"3\" data-diff-type=\"noncompliant\">\ncommand.Received(); // Noncompliant\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"3\" data-diff-type=\"compliant\">\ncommand.Received().Execute();\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://fluentassertions.com/introduction\">Fluent assertions: Should()</a></li>\n  <li><a href=\"https://www.n-fluent.net\">NFluent: Check.That()</a></li>\n  <li><a href=\"https://nsubstitute.github.io/help/received-calls\">NSubstitute: Received()</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2970.json",
    "content": "{\n  \"title\": \"Assertions should be complete\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"TESTED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"tests\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-2970\",\n  \"sqKey\": \"S2970\",\n  \"scope\": \"Tests\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2971.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>In the interests of readability, code that can be simplified should be simplified. To that end, there are several ways <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1\">IEnumerable</a> language integrated queries (LINQ) can be\nsimplified. This not only improves readabilty but can also lead to improved performance.</p>\n<h2>How to fix it</h2>\n<p>Simplify the LINQ expressions:</p>\n<ul>\n  <li>Use <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.oftype\">OfType</a> instead of <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.select\">Select</a> with the <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/type-testing-and-cast#as-operator\">as operator</a> to type cast\n  elements and then null-checking in a query expression to choose elements based on type.</li>\n  <li>Use <code>OfType</code> instead of using <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.where\">Where</a> and the\n  <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/type-testing-and-cast#is-operator\">is operator</a>, followed\n  by a cast in a <code>Select</code></li>\n  <li>Use an expression in <code>Any</code> instead of <code>Where(element ⇒ [expression]).Any()</code>.</li>\n  <li>Use the <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1.count\">Count</a> or <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.array.length\">Length</a> properties instead of the <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.count\">Count() method</a> when it’s available (unless you use the\n  predicate parameter of the method for filtering).</li>\n  <li>Don’t call <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.toarray\">ToArray()</a> or <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.tolist\">ToList()</a> in the middle of a query chain.</li>\n</ul>\n<p>Using <a href=\"https://learn.microsoft.com/en-us/ef/\">Entity Framework</a> may require enforcing client evaluations. Such queries should use <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.asenumerable\">AsEnumerable()</a> instead of <code>ToArray()</code> or\n<code>ToList()</code> in the middle of a query chain.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic void Foo(IEnumerable&lt;Vehicle&gt; seq, List&lt;int&gt; list)\n{\n    var result1 = seq.Select(x =&gt; x as Car).Any(x =&gt; x != null);               // Noncompliant; use OfType\n    var result2 = seq.Select(x =&gt; x as Car).Any(x =&gt; x != null &amp;&amp; x.HasOwner); // Noncompliant; use OfType before calling Any\n    var result3 = seq.Where(x =&gt; x is Car).Select(x =&gt; x as Car);              // Noncompliant; use OfType\n    var result4 = seq.Where(x =&gt; x is Car).Select(x =&gt; (Car)x);                // Noncompliant; use OfType\n    var result5 = seq.Where(x =&gt; x.HasOwner).Any();                            // Noncompliant; use Any([predicate])\n\n    var num = list.Count();                                                    // Noncompliant; use the Count property\n    var arr = seq.ToList().ToArray();                                          // Noncompliant; ToList is not needed\n    var count = seq.ToList().Count(x =&gt; x.HasOwner);                           // Noncompliant; ToList is not needed\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic void Foo(IEnumerable&lt;Vehicle&gt; seq, List&lt;int&gt; list)\n{\n    var result1 = seq.OfType&lt;Car&gt;().Any();\n    var result2 = seq.OfType&lt;Car&gt;().Any(x =&gt; x.HasOwner);\n    var result3 = seq.OfType&lt;Car&gt;();\n    var result4 = seq.OfType&lt;Car&gt;();\n    var result5 = seq.Any(x =&gt; x.HasOwner);\n\n    var num = list.Count;\n    var arr = seq.ToArray();\n    var count = seq.Count(x =&gt; x.HasOwner);\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/linq\">Language Integrated Queries in C#</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2971.json",
    "content": "{\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"FOCUSED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2971\",\n  \"sqKey\": \"S2971\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\",\n  \"title\": \"LINQ expressions should be simplified\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2995.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>In C#, the <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.object.referenceequals\"><code>Object.ReferenceEquals</code></a> method is\nused to compare two <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/reference-types\">reference type</a>\nvariables. If you use this method to compare two <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/value-types\">value types</a>, such as <code>int</code>,\n<code>float</code>, or <code>bool</code> you will not get the expected results because value type variables contain an instance of the type and not a\nreference to it.</p>\n<p>Due to value type variables containing directly an instance of the type, they can’t have the same reference, and using\n<code>Object.ReferenceEquals</code> to compare them will always return <code>false</code> even if the compared variables have the same value.</p>\n<h2>How to fix it</h2>\n<p>When comparing value types, prefer using the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.object.equals\"><code>Object.Equals</code></a>.</p>\n<p>Note that in the case of <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/struct\">structure types</a>, it\nis recommended to <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/statements-expressions-operators/how-to-define-value-equality-for-a-type#struct-example\">implement\nvalue equality</a>. If not, {rule:csharpsquid:S3898} might raise.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nusing System;\n\nstruct MyStruct\n{\n    int valueA;\n    int valueB;\n}\n\nstatic class MyClass\n{\n    public static void Method(MyStruct struct1, MyStruct struct2)\n    {\n        if (Object.ReferenceEquals(struct1, struct2)) // Noncompliant: this will be always false\n        {\n            // ...\n        }\n    }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nusing System;\n\nstruct MyStruct : IEquatable&lt;MyStruct&gt;\n{\n    int valueA;\n    int valueB;\n\n    public bool Equals(MyStruct other) =&gt; valueA == other.valueA &amp;&amp; valueB == other.valueB;\n\n    public override bool Equals(object obj) =&gt; obj is MyStruct other &amp;&amp; Equals(other);\n\n    public override int GetHashCode() =&gt; HashCode.Combine(valueA, valueB);\n\n    public static bool operator ==(MyStruct lhs, MyStruct rhs) =&gt; lhs.Equals(rhs);\n\n    public static bool operator !=(MyStruct lhs, MyStruct rhs) =&gt; !(lhs == rhs);\n}\n\nstatic class MyClass\n{\n    public static void Method(MyStruct struct1, MyStruct struct2)\n    {\n        if (struct1.Equals(struct2)) // Compliant: value are compared\n        {\n            // ...\n        }\n    }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.object.referenceequals\"><code>Object.ReferenceEquals(Object,\n  Object)</code> Method</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.object.equals\"><code>Object.Equals</code> Method</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/value-types\">Value types (C#\n  reference)</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/reference-types\">Reference types (C#\n  reference)</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/equality-operators\">Equality operators -\n  test if two objects are equal or not</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/statements-expressions-operators/how-to-define-value-equality-for-a-type#struct-example\">How to define value equality for a class or struct (C# Programming Guide)</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/struct\">Structure types (C#\n  reference)</a></li>\n  <li>{rule:csharpsquid:S3898} - Value types should implement \"IEquatable&lt;T&gt;\"</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2995.json",
    "content": "{\n  \"title\": \"\\\"Object.ReferenceEquals\\\" should not be used for value types\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2995\",\n  \"sqKey\": \"S2995\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2996.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When an object has a field annotated with <code>ThreadStatic</code>, that field is shared within a given thread, but unique across threads. Since a\nclass' static initializer is only invoked for the first thread created, it also means that only the first thread will have the expected initial\nvalues.</p>\n<p>Instead, allow such fields to be initialized to their default values or make the initialization lazy.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic class Foo\n{\n  [ThreadStatic]\n  public static object PerThreadObject = new object(); // Noncompliant. Will be null in all the threads except the first one.\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic class Foo\n{\n  [ThreadStatic]\n  public static object _perThreadObject;\n  public static object PerThreadObject\n  {\n    get\n    {\n      if (_perThreadObject == null)\n      {\n        _perThreadObject = new object();\n      }\n      return _perThreadObject;\n    }\n  }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2996.json",
    "content": "{\n  \"title\": \"\\\"ThreadStatic\\\" fields should not be initialized\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"multi-threading\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2996\",\n  \"sqKey\": \"S2996\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S2997.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When you use a <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/using\"><code>using</code> statement</a>, the\ngoal is to ensure the correct disposal of an <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.idisposable\"><code>IDisposable</code></a>\ninstance when the control leaves the <code>using</code> statement block.</p>\n<p>If you return that <code>IDisposable</code> instance inside the block, <code>using</code> will dispose it before the caller can use it, likely\ncausing exceptions at runtime. You should either remove <code>using</code> statement or avoid returning the <code>IDisposable</code> in the\n<code>using</code> statement block.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic FileStream WriteToFile(string path, string text)\n{\n  using (var fs = File.Create(path)) // Noncompliant: 'fs' is disposed at the end of the using scope\n  {\n    var bytes = Encoding.UTF8.GetBytes(text);\n    fs.Write(bytes, 0, bytes.Length);\n    return fs;\n  }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic FileStream WriteToFile(string path, string text)\n{\n  var fs = File.Create(path);\n  var bytes = Encoding.UTF8.GetBytes(text);\n  fs.Write(bytes, 0, bytes.Length);\n  return fs; // Compliant: 'fs' is not disposed once the end of the scope is reached and the caller can use it\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/using\">using statement - ensure the\n  correct use of disposable objects</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.idisposable\">IDisposable</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S2997.json",
    "content": "{\n  \"title\": \"\\\"IDisposables\\\" created in a \\\"using\\\" statement should not be returned\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2997\",\n  \"sqKey\": \"S2997\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3005.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When you annotate a field with the <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threadstaticattribute\"><code>ThreadStatic</code>\nattribute</a>, it is an indication that the value of this field is unique for each thread. But if you don’t mark the field as <code>static</code>,\nthen the <code>ThreadStatic</code> attribute is ignored.</p>\n<p>The <code>ThreadStatic</code> attribute should either be removed or replaced with the use of <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.threadlocal-1\"><code>ThreadLocal&lt;T&gt;</code></a> class, which gives a similar\nbehavior for non-static fields.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre>\npublic class MyClass\n{\n  [ThreadStatic]  // Noncompliant\n  private int count = 0;\n\n  // ...\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre>\npublic class MyClass\n{\n  private int count = 0;\n\n  // ...\n}\n</pre>\n<p>or</p>\n<pre>\npublic class MyClass\n{\n  private readonly ThreadLocal&lt;int&gt; count = new ThreadLocal&lt;int&gt;();\n  public int Count\n  {\n    get { return count.Value; }\n    set { count.Value = value; }\n  }\n  // ...\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threadstaticattribute\">ThreadStaticAttribute Class</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.threadlocal-1\">ThreadLocal&lt;T&gt; Class</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3005.json",
    "content": "{\n  \"title\": \"\\\"ThreadStatic\\\" should not be used on non-static fields\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"unused\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3005\",\n  \"sqKey\": \"S3005\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3010.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Assigning a value to a <code>static</code> field in a constructor could cause unreliable behavior at runtime since it will change the value for all\ninstances of the class.</p>\n<p>Instead remove the field’s <code>static</code> modifier, or initialize it statically.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic class Person\n{\n  private static DateTime dateOfBirth;\n  private static int expectedFingers;\n\n  public Person(DateTime birthday)\n  {\n    dateOfBirth = birthday;  // Noncompliant; now everyone has this birthday\n    expectedFingers = 10;  // Noncompliant\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic class Person\n{\n  private DateTime dateOfBirth;\n  private static int expectedFingers = 10;\n\n  public Person(DateTime birthday)\n  {\n    this.dateOfBirth = birthday;\n  }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3010.json",
    "content": "{\n  \"title\": \"Static fields should not be updated in constructors\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3010\",\n  \"sqKey\": \"S3010\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3011.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Altering or bypassing the accessibility of classes, methods, or fields through reflection violates the encapsulation principle. This can break the\ninternal contracts of the accessed target and lead to maintainability issues and runtime errors.</p>\n<p>This rule raises an issue when reflection is used to change the visibility of a class, method or field, and when it is used to directly update a\nfield value.</p>\n<pre>\nusing System.Reflection;\n\nType dynClass = Type.GetType(\"MyInternalClass\");\n// Noncompliant. Using BindingFlags.NonPublic will return non-public members\nBindingFlags bindingAttr = BindingFlags.NonPublic | BindingFlags.Static;\nMethodInfo dynMethod = dynClass.GetMethod(\"mymethod\", bindingAttr);\nobject result = dynMethod.Invoke(dynClass, null);\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Encapsulation_(computer_programming)\">Wikipedia definition of Encapsulation</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3011.json",
    "content": "{\n  \"title\": \"Reflection should not be used to increase accessibility of classes, methods, or fields\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"MODULAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3011\",\n  \"sqKey\": \"S3011\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3052.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The compiler automatically initializes class fields, auto-properties and events to their default values before setting them with any initialization\nvalues, so there is no need to explicitly set a member to its default value. Further, under the logic that cleaner code is better code, it’s\nconsidered poor style to do so.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nclass X\n{\n  public int field = 0; // Noncompliant\n  public object o = null; // Noncompliant\n  public object MyProperty { get; set; } = null; // Noncompliant\n  public event EventHandler MyEvent = null;  // Noncompliant\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nclass X\n{\n  public int field;\n  public object o;\n  public object MyProperty { get; set; }\n  public event EventHandler MyEvent;\n}\n</pre>\n<h3>Exceptions</h3>\n<p><code>const</code> fields are ignored.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3052.json",
    "content": "{\n  \"title\": \"Members should not be initialized to default values\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"convention\",\n    \"finding\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3052\",\n  \"sqKey\": \"S3052\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3059.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>There’s no point in having a <code>public</code> member in a non-<code>public</code> type because objects that can’t access the type will never\nhave the chance to access the member.</p>\n<p>This rule raises an issue when a type has methods, fields, or inner types with higher visibility than the type itself has.</p>\n<h3>Noncompliant code example</h3>\n<pre>\ninternal class MyClass\n{\n    public static decimal PI = 3.14m;  // Noncompliant\n\n    public int GetOne() // Noncompliant\n    {\n        return 1;\n    }\n\n    protected record NestedType // Noncompliant: outer class is internal\n    {\n        public bool FlipCoin() // Noncompliant: outer class is internal\n        {\n            return false;\n        }\n        // ...\n    }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic class MyClass // Class visibility upgrade makes members compliant\n{\n    public static decimal PI = 3.14m;\n\n    public int GetOne()\n    {\n        return 1;\n    }\n\n    protected record NestedType\n    {\n        public bool FlipCoin() // Outer type is public\n        {\n            return false;\n        }\n        // ...\n    }\n}\n</pre>\n<h3>Exceptions</h3>\n<p>User defined operators need to be public:</p>\n<pre>\npublic static implicit operator byte(MyClass a) =&gt; 1; // Compliant\npublic static explicit operator MyClass(byte a) =&gt; new MyClass(a); // Compliant\n</pre>\n<p>Nested types, even if private, can be used and inherited in the parent type. In this case, the visibility of the outer type is considered.</p>\n<pre>\ninternal class MyClass\n{\n    private class NestedClass\n    {\n        public int PublicProperty { get; } // Noncompliant: should be internal\n        protected internal int ProtectedInternalProperty { get; } // Compliant: can be used in `InternalsVisibleTo` assemblies\n        internal int InternalProperty { get; } // Compliant: can be used in `InternalsVisibleTo` assemblies\n        protected int ProtectedProperty { get; } // Compliant: can be used in derived type\n        private protected int PrivateProtectedProperty { get; } // Compliant: can be used in derived type\n        private int PrivateProperty { get; }\n    }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3059.json",
    "content": "{\n  \"title\": \"Types should not have members with visibility set higher than the type\\u0027s visibility\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [\n    \"confusing\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3059\",\n  \"sqKey\": \"S3059\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3060.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>One of the possible ways of performing <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/type-testing-and-cast\">type-testing</a> is via the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/is\">is operator</a>: <code>food is Pizza</code>.</p>\n<p>The <code>is</code> operator is often used before a direct <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/type-testing-and-cast#cast-expression\">cast</a> to the target type,\nas a more flexible and powerful alternative to the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/type-testing-and-cast#as-operator\">as operator</a>, especially when\nused to perform <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/type-testing-and-cast#type-testing-with-pattern-matching\">pattern\nmatching</a>.</p>\n<pre>\nif (food is Pizza pizza)\n</pre>\n<p>There’s no valid reason to test <code>this</code> with <code>is</code>. The only plausible explanation for such a test is that you’re executing\ncode in a parent class conditionally based on the kind of child class <code>this</code> is.</p>\n<pre>\npublic class Food\n{\n  public void DoSomething()\n  {\n    if (this is Pizza) // Noncompliant\n    {\n      // Code specific to Pizza...\n    }\n  }\n}\n</pre>\n<p>However, code that’s specific to a child class should be <em>in</em> that child class, not in the parent.</p>\n<h2>How to fix it</h2>\n<p>One way is to take advantage of the <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/tutorials/oop\">object-orientation</a> of\nC# and use <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/object-oriented/polymorphism\">polymorphism</a>.</p>\n<ul>\n  <li>Make the method <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/virtual\">virtual</a>, if it is not already.\n  That will allow derived classes to perform <a href=\"https://en.wikipedia.org/wiki/Method_overriding\">method overriding</a>.</li>\n  <li>Move the code to the right level of the type hierarchy.</li>\n  <li>Use <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/base\">base</a> to call the method on the base class\n  that has been overridden.</li>\n</ul>\n<p>For example, when simple method polymorphism is not enough because it is necessary to reuse multiple sections of the parent method, the <a\nhref=\"https://en.wikipedia.org/wiki/Template_method_pattern\">Template method pattern</a> might help.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic class Food\n{\n  public void DoSomething()\n  {\n    // Code shared by all Food...\n    if (this is Pizza) // Noncompliant\n    {\n      // Code specific to Pizza...\n    }\n  }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic class Food\n{\n  public virtual void DoSomething()\n  {\n    // Code shared by all Food...\n  }\n}\n\npublic class Pizza : Food\n{\n  public override void DoSomething()\n  {\n    base.DoSomething();\n    // Code specific to Pizza...\n  }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/type-testing-and-cast\">Type-testing operators and cast\n  expressions - is, as, typeof and casts</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/functional/pattern-matching\">Pattern matching overview</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/tutorials/oop\">Object-Oriented programming (C#)</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/object-oriented/polymorphism\">Polymorphism</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Template_method_pattern\">Template method pattern</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Method_overriding\">Method overriding</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3060.json",
    "content": "{\n  \"title\": \"\\\"is\\\" should not be used with \\\"this\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"tags\": [\n    \"api-design\",\n    \"bad-practice\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-3060\",\n  \"sqKey\": \"S3060\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3063.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><code>StringBuilder</code> instances that never build a <code>string</code> clutter the code and worse are a drag on performance. Either they\nshould be removed, or the missing <code>ToString()</code> call should be added.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic void DoSomething(List&lt;string&gt; strings) {\n  var sb = new StringBuilder();  // Noncompliant\n  sb.Append(\"Got: \");\n  foreach(var str in strings) {\n    sb.Append(str).Append(\", \");\n    // ...\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic void DoSomething(List&lt;string&gt; strings) {\n  foreach(var str in strings) {\n    // ...\n  }\n}\n</pre>\n<p>or</p>\n<pre>\npublic void DoSomething(List&lt;string&gt; strings) {\n  var sb = new StringBuilder();\n  sb.Append(\"Got: \");\n  foreach(var str in strings) {\n    sb.Append(str).Append(\", \");\n    // ...\n  }\n  logger.LogInformation(sb.ToString());\n}\n</pre>\n<h3>Exceptions</h3>\n<p>No issue is reported when <code>StringBuilder</code> is:</p>\n<ul>\n  <li>Accessed through <code>sb.CopyTo()</code>, <code>sb.GetChunks()</code>, <code>sb.Length</code>, or <code>sb[index]</code>.</li>\n  <li>Passed as a method argument, on the grounds that it will likely be accessed through a <code>ToString()</code> invocation there.</li>\n  <li>Passed in as a parameter to the current method, on the grounds that the callee will materialize the string.</li>\n  <li>Retrieved by a custom function (<code>var sb = GetStringBuilder();</code>).</li>\n  <li>Returned by the method.</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3063.json",
    "content": "{\n  \"title\": \"\\\"StringBuilder\\\" data should be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3063\",\n  \"sqKey\": \"S3063\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3168.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>An <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/async\"><code>async</code></a> method with a\n<code>void</code> return type does not follow the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/asynchronous-programming/task-asynchronous-programming-model\">task asynchronous programming\n(TAP)</a> model since the return type should be <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task\"><code>Task</code></a> or <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1\"><code>Task&lt;TResult&gt;</code></a></p>\n<p>Doing so prevents control over the <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/asynchronous-programming/async-scenarios\">asynchronous\nexecution</a>, such as:</p>\n<ul>\n  <li>waiting for the execution to complete</li>\n  <li>catching any exception that might occur during execution</li>\n  <li>testing execution behavior</li>\n</ul>\n<h3>Exceptions</h3>\n<ul>\n  <li>Methods implementing an interface</li>\n  <li>Methods overriding a base class method</li>\n  <li>Virtual methods</li>\n  <li>Methods with the <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.eventhandler\"><code>EventHandler</code></a> delegate signature \n  Using <code>void</code> for <code>EventHandler</code> is compliant with the TAP model.\n    <pre>\npublic async void button1_Click(object sender, EventArgs e)\n{\n  await DoSomethingAsync();\n}\n</pre></li>\n  <li>Methods name matching <code>On[A-Z]\\w*</code> pattern  Some frameworks may not use the same <code>EventHandler</code> method signature.\n    <pre>\npublic async void OnClick(EventContext data)\n{\n  await DoSomethingAsync();\n}\n</pre></li>\n</ul>\n<h2>How to fix it</h2>\n<p>Update the return type of the method from <code>void</code> to <code>Task</code>.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nprivate async void ThrowExceptionAsync() // Noncompliant: async method return type is 'void'\n{\n  throw new InvalidOperationException();\n}\n\npublic void Method()\n{\n  try\n  {\n    ThrowExceptionAsync();\n  }\n  catch (Exception)\n  {\n    // The exception is never caught here\n    throw;\n  }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nprivate async Task ThrowExceptionAsync() // Compliant: async method return type is 'Task'\n{\n  throw new InvalidOperationException();\n}\n\npublic async Task Method()\n{\n  try\n  {\n    await ThrowExceptionAsync();\n  }\n  catch (Exception)\n  {\n    // The exception is caught here\n    throw;\n  }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/async\"><code>async</code> (C#\n  Reference)</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/asynchronous-programming/async-scenarios\">Asynchronous\n  programming</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/asynchronous-programming/task-asynchronous-programming-model\">Task\n  asynchronous programming model</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task\"><code>Task</code> Class</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1\"><code>Task&lt;TResult&gt;</code>\n  Class</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.eventhandler\"><code>EventHandler</code> Delegate</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3168.json",
    "content": "{\n  \"title\": \"\\\"async\\\" methods should not return \\\"void\\\"\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [\n    \"multi-threading\",\n    \"async-await\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3168\",\n  \"sqKey\": \"S3168\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3169.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>There’s no point in chaining multiple <code>OrderBy</code> calls in a LINQ; only the last one will be reflected in the result because each\nsubsequent call completely reorders the list. Thus, calling <code>OrderBy</code> multiple times is a performance issue as well, because all of the\nsorting will be executed, but only the result of the last sort will be kept.</p>\n<h2>How to fix it</h2>\n<p>Instead, use <code>ThenBy</code> for each call after the first.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nvar x = personList\n  .OrderBy(person =&gt; person.Age)\n  .OrderBy(person =&gt; person.Name)  // Noncompliant\n  .ToList();  // x is sorted by Name, not sub-sorted\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nvar x = personList\n  .OrderBy(person =&gt; person.Age)\n  .ThenBy(person =&gt; person.Name)\n  .ToList();\n</pre>\n<h2>Resources</h2>\n<h3>Benchmarks</h3>\n<table>\n  <colgroup>\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>Method</th>\n      <th>Runtime</th>\n      <th>Mean</th>\n      <th>StdDev</th>\n      <th>Allocated</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p>OrderByAge</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>12.84 ms</p>\n      </td>\n      <td>\n        <p>0.804 ms</p>\n      </td>\n      <td>\n        <p>1.53 MB</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>OrderByAgeOrderBySize</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>24.08 ms</p>\n      </td>\n      <td>\n        <p>0.267 ms</p>\n      </td>\n      <td>\n        <p>3.05 MB</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>OrderByAgeThenBySize</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>18.58 ms</p>\n      </td>\n      <td>\n        <p>0.747 ms</p>\n      </td>\n      <td>\n        <p>1.91 MB</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>OrderByAge</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>22.99 ms</p>\n      </td>\n      <td>\n        <p>0.228 ms</p>\n      </td>\n      <td>\n        <p>1.53 MB</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>OrderByAgeOrderBySize</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>44.90 ms</p>\n      </td>\n      <td>\n        <p>0.581 ms</p>\n      </td>\n      <td>\n        <p>4.3 MB</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>OrderByAgeThenBySize</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>31.72 ms</p>\n      </td>\n      <td>\n        <p>0.402 ms</p>\n      </td>\n      <td>\n        <p>1.91 MB</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h4>Glossary</h4>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Arithmetic_mean\">Mean</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Standard_deviation\">Standard Deviation</a></li>\n</ul>\n<p>The results were generated by running the following snippet with <a href=\"https://github.com/dotnet/BenchmarkDotNet\">BenchmarkDotNet</a>:</p>\n<pre>\npublic class Person\n{\n    public string Name { get; set; }\n    public int Age { get; set; }\n    public int Size { get; set; }\n}\n\nprivate Random random = new Random(1);\nprivate Consumer consumer = new Consumer();\nprivate Person[] array;\n\n[Params(100_000)]\npublic int N { get; set; }\n\n[GlobalSetup]\npublic void GlobalSetup()\n{\n    array = Enumerable.Range(0, N).Select(x =&gt; new Person\n    {\n      Name = Path.GetRandomFileName(),\n      Age = random.Next(0, 100),\n      Size = random.Next(0, 200)\n    }).ToArray();\n}\n\n[Benchmark(Baseline = true)]\npublic void OrderByAge() =&gt;\n    array.OrderBy(x =&gt; x.Age).Consume(consumer);\n\n[Benchmark]\npublic void OrderByAgeOrderBySize() =&gt;\n    array.OrderBy(x =&gt; x.Age).OrderBy(x =&gt; x.Size).Consume(consumer);\n\n[Benchmark]\npublic void OrderByAgeThenBySize() =&gt;\n    array.OrderBy(x =&gt; x.Age).ThenBy(x =&gt; x.Size).Consume(consumer);\n</pre>\n<p>Hardware configuration:</p>\n<pre>\nBenchmarkDotNet v0.14.0, Windows 10 (10.0.19045.5247/22H2/2022Update)\nIntel Core Ultra 7 165H, 1 CPU, 22 logical and 16 physical cores\n  [Host]               : .NET Framework 4.8.1 (4.8.9282.0), X64 RyuJIT VectorSize=256\n  .NET 9.0             : .NET 9.0.0 (9.0.24.52809), X64 RyuJIT AVX2\n  .NET Framework 4.8.1 : .NET Framework 4.8.1 (4.8.9282.0), X64 RyuJIT VectorSize=256\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3169.json",
    "content": "{\n  \"title\": \"Multiple \\\"OrderBy\\\" calls should not be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3169\",\n  \"sqKey\": \"S3169\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3172.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>In C#, delegates can be added together to chain their execution, and subtracted to remove their execution from the chain.</p>\n<p>Subtracting a chain of delegates from another one might yield unexpected results as shown hereunder - and is likely to be a bug.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nMyDelegate first, second, third, fourth;\nfirst = () =&gt; Console.Write(\"1\");\nsecond = () =&gt; Console.Write(\"2\");\nthird = () =&gt; Console.Write(\"3\");\nfourth = () =&gt; Console.Write(\"4\");\n\nMyDelegate chain1234 = first + second + third + fourth; // Compliant - chain sequence = \"1234\"\nMyDelegate chain12 = chain1234 - third - fourth; // Compliant - chain sequence = \"12\"\n\n\nMyDelegate chain14 = first + fourth; // creates a new MyDelegate instance which is a list under the covers\nMyDelegate chain23 = chain1234 - chain14; // Noncompliant; (first + fourth) doesn't exist in chain1234\n\n\n// The chain sequence of \"chain23\" will be \"1234\" instead of \"23\"!\n// Indeed, the sequence \"1234\" does not contain the subsequence \"14\", so nothing is subtracted\n// (but note that \"1234\" contains both the \"1\" and \"4\" subsequences)\nchain23 = chain1234 - (first + fourth); // Noncompliant\n\nchain23(); // will print \"1234\"!\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nMyDelegate chain23 = chain1234 - first - fourth; // Compliant - \"1\" is first removed, followed by \"4\"\n\nchain23(); // will print \"23\"\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3172.json",
    "content": "{\n  \"title\": \"Delegates should not be subtracted\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3172\",\n  \"sqKey\": \"S3172\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3215.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Needing to cast from an <code>interface</code> to a concrete type indicates that something is wrong with the abstractions in use, likely that\nsomething is missing from the <code>interface</code>. Instead of casting to a discrete type, the missing functionality should be added to the\n<code>interface</code>. Otherwise there is a risk of runtime exceptions.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic interface IMyInterface\n{\n  void DoStuff();\n}\n\npublic class MyClass1 : IMyInterface\n{\n  public int Data { get { return new Random().Next(); } }\n\n  public void DoStuff()\n  {\n    // TODO...\n  }\n}\n\npublic static class DowncastExampleProgram\n{\n  static void EntryPoint(IMyInterface interfaceRef)\n  {\n    MyClass1 class1 = (MyClass1)interfaceRef;  // Noncompliant\n    int privateData = class1.Data;\n\n    class1 = interfaceRef as MyClass1;  // Noncompliant\n    if (class1 != null)\n    {\n      // ...\n    }\n  }\n}\n</pre>\n<h3>Exceptions</h3>\n<p>Casting to <code>object</code> doesn’t raise an issue, because it can never fail.</p>\n<pre>\nstatic void EntryPoint(IMyInterface interfaceRef)\n{\n  var o = (object)interfaceRef;\n  ...\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3215.json",
    "content": "{\n  \"title\": \"\\\"interface\\\" instances should not be cast to concrete types\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"FOCUSED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1h\"\n  },\n  \"tags\": [\n    \"design\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-3215\",\n  \"sqKey\": \"S3215\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3216.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>After an <code>await</code>ed <code>Task</code> has executed, you can continue execution in the original, calling thread or any arbitrary thread.\nUnless the rest of the code needs the context from which the <code>Task</code> was spawned, <code>Task.ConfigureAwait(false)</code> should be used to\nkeep execution in the <code>Task</code> thread to avoid the need for context switching and the possibility of deadlocks.</p>\n<p>This rule raises an issue when code in a class library targeting .Net Framework <code>await</code>s a <code>Task</code> and continues execution in\nthe original calling thread.</p>\n<p>The rule does not raise for .Net Core libraries as there is no <code>SynchronizationContext</code> in .Net Core.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nvar response = await httpClient.GetAsync(url);  // Noncompliant\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nvar response = await httpClient.GetAsync(url).ConfigureAwait(false);\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3216.json",
    "content": "{\n  \"title\": \"\\\"ConfigureAwait(false)\\\" should be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [\n    \"multi-threading\",\n    \"async-await\",\n    \"suspicious\",\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-3216\",\n  \"sqKey\": \"S3216\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3217.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/iteration-statements#the-foreach-statement\">foreach</a>\nstatement was introduced in the C# language prior to generics to make it easier to work with the non-generic collections available at that time such\nas <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.arraylist\">ArrayList</a>. The <code>foreach</code> statements allow you to\ndowncast elements of a collection of <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.object\">Objects</a> to any other type.</p>\n<p>The problem is that to achieve the cast, the <code>foreach</code> statements silently perform <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/types/casting-and-type-conversions#explicit-conversions\">explicit type\nconversion</a>, which at runtime can result in an <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.invalidcastexception\">InvalidCastException</a>.</p>\n<p>C# code iterating on generic collections or arrays should not rely on <code>foreach</code> statement’s silent <code>explicit</code>\nconversions.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic class Fruit { }\npublic class Orange : Fruit { }\npublic class Apple : Fruit { }\n\nclass MyTest\n{\n  public void Test()\n  {\n    var fruitBasket = new List&lt;Fruit&gt;();\n    fruitBasket.Add(new Orange());\n    fruitBasket.Add(new Orange());\n    fruitBasket.Add(new Apple());\n\n    foreach (Orange orange in fruitBasket) // Noncompliant\n    {\n      //...\n    }\n  }\n}\n</pre>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic class Fruit { }\npublic class Orange : Fruit { }\npublic class Apple : Fruit { }\n\nclass MyTest\n{\n  public void Test()\n  {\n    var fruitBasket = new List&lt;Fruit&gt;();\n    fruitBasket.Add(new Orange());\n    fruitBasket.Add(new Orange());\n    fruitBasket.Add(new Apple());\n\n    foreach (Orange orange in fruitBasket.OfType&lt;Orange&gt;())\n    {\n      //...\n    }\n  }\n}\n</pre>\n<h3>Exceptions</h3>\n<p>The rule ignores iterations on collections of <code>objects</code>. This includes legacy code that uses <code>ArrayList</code>. Furthermore, the\nrule does not report on cases when user-defined conversions are being called.</p>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/iteration-statements#the-foreach-statement\">Foreach\n  statement</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.arraylist\">ArrayList</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.object\">Object class</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/types/casting-and-type-conversions#explicit-conversions\">Explicit\n  conversion</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.invalidcastexception\">InvalidCastException</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3217.json",
    "content": "{\n  \"title\": \"\\\"Explicit\\\" conversions of \\\"foreach\\\" loops should not be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-3217\",\n  \"sqKey\": \"S3217\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3218.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Naming the members of an inner class the same as the static members of its enclosing class is possible but generally considered a bad practice.\nThat’s because maintainers may be confused about which members are being used in a given context. Instead the inner class member should be given\ndistinct and descriptive name, and all references to it should be updated accordingly.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nclass Outer\n{\n  public static int A;\n\n  public class Inner\n  {\n    public int A; // Noncompliant\n\n    public int MyProp\n    {\n      get =&gt; A; // Returns inner A. Was that intended?\n    }\n  }\n}\n</pre>\n<p>Here’s an example of compliant code after renaming the inner class member, this way the property will return the <code>Outer</code> A:</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nclass Outer\n{\n  public static int A;\n\n  public class Inner\n  {\n    public int B; // Compliant\n\n    public int MyProp\n    {\n      get =&gt; A; // Returns outer A\n    }\n  }\n}\n</pre>\n<p>Or if you want to reference the <code>Inner</code> A field:</p>\n<pre>\nclass Outer\n{\n  public static int B;\n\n  public class Inner\n  {\n    public int A; // Compliant\n\n    public int MyProp\n    {\n      get =&gt; A; // Returns inner A\n    }\n  }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/coding-conventions\">Common Coding Conventions</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/nested-types\">Nested Types</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3218.json",
    "content": "{\n  \"title\": \"Inner class members should not shadow outer class \\\"static\\\" or type members\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"design\",\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-3218\",\n  \"sqKey\": \"S3218\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3220.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The rules for method resolution are complex and perhaps not properly understood by all coders. The <code>params</code> keyword can make method\ndeclarations overlap in non-obvious ways, so that slight changes in the argument types of an invocation can resolve to different methods.</p>\n<p>This rule raises an issue when an invocation resolves to a method declaration with <code>params</code>, but could also resolve to another\nnon-<code>params</code> method too.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic class MyClass\n{\n    private void Format(string a, params object[] b) { }\n\n    private void Format(object a, object b, object c) { }\n}\n\n// ...\nMyClass myClass = new MyClass();\n\nmyClass.Format(\"\", null, null); // Noncompliant, resolves to the first Format with params, but was that intended?\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3220.json",
    "content": "{\n  \"title\": \"Method calls should not resolve ambiguously to overloads with \\\"params\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3220\",\n  \"sqKey\": \"S3220\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3234.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><code>GC.SuppressFinalize</code> asks the Common Language Runtime not to call the finalizer of an object. This is useful when implementing the\ndispose pattern where object finalization is already handled in <code>IDisposable.Dispose</code>. However, it has no effect if there is no finalizer\ndefined in the object’s type, so using it in such cases is just confusing.</p>\n<p>This rule raises an issue when <code>GC.SuppressFinalize</code> is called for objects of <code>sealed</code> types without a finalizer.</p>\n<p><strong>Note:</strong> {rule:csharpsquid:S3971} is a stricter version of this rule. Typically it makes sense to activate only one of these 2\nrules.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nsealed class MyClass\n{\n  public void Method()\n  {\n    ...\n    GC.SuppressFinalize(this); //Noncompliant\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nsealed class MyClass\n{\n  public void Method()\n  {\n    ...\n  }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3234.json",
    "content": "{\n  \"title\": \"\\\"GC.SuppressFinalize\\\" should not be invoked for types without destructors\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"unused\",\n    \"confusing\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3234\",\n  \"sqKey\": \"S3234\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3235.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Redundant parentheses are simply wasted keystrokes, and should be removed.</p>\n<h3>Noncompliant code example</h3>\n<pre>\n[MyAttribute()] //Noncompliant\nclass MyClass\n{\n  public int MyProperty { get; set; }\n  public static MyClass CreateNew(int propertyValue)\n  {\n    return new MyClass() //Noncompliant\n    {\n      MyProperty = propertyValue\n    };\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\n[MyAttribute]\nclass MyClass\n{\n  public int MyProperty { get; set; }\n  public static MyClass CreateNew(int propertyValue)\n  {\n    return new MyClass\n    {\n      MyProperty = propertyValue\n    };\n  }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3235.json",
    "content": "{\n  \"title\": \"Redundant parentheses should not be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"unused\",\n    \"finding\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3235\",\n  \"sqKey\": \"S3235\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3236.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Caller information attributes: <code>CallerFilePathAttribute</code>, <code>CallerLineNumberAttribute</code>, and\n<code>CallerArgumentExpressionAttribute</code> provide a way to get information about the caller of a method through optional parameters. But the\narguments for these optional parameters are only generated if they are not explicitly defined in the call. Thus, specifying the argument values\ndefeats the purpose of the attributes.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nvoid TraceMessage(string message,\n  [CallerFilePath] string filePath = null,\n  [CallerLineNumber] int lineNumber = 0)\n{\n  /* ... */\n}\n\nvoid MyMethod()\n{\n  TraceMessage(\"my message\", \"A.B.C.Foo.cs\", 42); // Noncompliant\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nvoid TraceMessage(string message,\n  [CallerFilePath] string filePath = \"\",\n  [CallerLineNumber] int lineNumber = 0)\n{\n  /* ... */\n}\n\nvoid MyMethod()\n{\n  TraceMessage(\"my message\");\n}\n</pre>\n<h3>Exceptions</h3>\n<ul>\n  <li><code>CallerMemberName</code> is not checked to avoid False-Positives with WPF/UWP applications.</li>\n  <li><code>System.Diagnostics.Debug.Assert</code> is excluded as a custom message from the developer is sometimes preferred as an explanation of the\n  failed assertion.</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3236.json",
    "content": "{\n  \"title\": \"Caller information arguments should not be provided explicitly\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3236\",\n  \"sqKey\": \"S3236\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3237.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When you need to get external input for <code>set</code> and <code>init</code> methods defined for properties and indexers or for\n<code>remove</code> and <code>add</code> methods for events, you should always get this input throught the <code>value</code> contextual keyword.</p>\n<p>The contextual keyword <code>value</code> is similar to an input parameter of a method; it references the value that the client code is attempting\nto assign to the property, indexer or event.</p>\n<p>The keyword <code>value</code> holds the value the accessor was called with. Not using it means that the accessor ignores the caller’s intent which\ncould cause unexpected results at runtime.</p>\n<h3>Noncompliant code example</h3>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nprivate int count;\npublic int Count\n{\n  get { return count; }\n  set { count = 42; } // Noncompliant\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nprivate int count;\npublic int Count\n{\n  get { return count; }\n  set { count = value; }\n}\n</pre>\n<h3>Exceptions</h3>\n<p>This rule doesn’t raise an issue when the setter is empty and part of the implementation of an <code>interface</code>. The assumption is that this\npart of the interface is not meaningful to that particular implementation. A good example of that would be a \"sink\" logger that discards any logs.</p>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/properties\">Properties</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/value\">Value keyword</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/add\">Add keyword</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/remove\">Remove keyword</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/set\">Set keyword</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3237.json",
    "content": "{\n  \"title\": \"\\\"value\\\" contextual keyword should be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-3237\",\n  \"sqKey\": \"S3237\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3240.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>In the interests of keeping code clean, the simplest possible conditional syntax should be used. That means</p>\n<ul>\n  <li>using the <code>??=</code> operator for a self-assign-if-not-null operation,</li>\n  <li>using the <code>??</code> operator for an assign-if-not-null operation, and</li>\n  <li>using the ternary operator <code>?:</code> for assignment to a single variable.</li>\n</ul>\n<h3>Noncompliant code example</h3>\n<pre>\nobject a = null, b = null, x;\n\nif (a != null) // Noncompliant; needlessly verbose\n{\n  x = a;\n}\nelse\n{\n  x = b;\n}\n\nx = a != null ? a : b; // Noncompliant; better but could still be simplified\n\nx = (a == null) ? new object() : a; // Noncompliant\n\nif (condition) // Noncompliant\n{\n  x = a;\n}\nelse\n{\n  x = b;\n}\n\nif (a == null)  // Noncompliant\n    a = new object();\n\nvar y = null ?? new object(); // Noncompliant\n\na = a ?? new object();  // Noncompliant for C# 8\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nobject x;\n\nx = a ?? b;\nx = a ?? b;\nx = a ?? new object();\nx = condition ? a : b;\na ??= new object();\nvar y = new object();\na ??= new object();\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3240.json",
    "content": "{\n  \"title\": \"The simplest possible condition syntax should be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3240\",\n  \"sqKey\": \"S3240\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3241.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Private methods are intended for use only within their scope. If these methods return values that are not utilized by any calling functions, it\nindicates that the return operation is unnecessary. Removing such returns can enhance both efficiency and code clarity.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nclass SomeClass\n{\n     private int PrivateMethod() =&gt; 42;\n\n     public void PublicMethod()\n     {\n          PrivateMethod(); // Noncompliant: the result of PrivateMethod is not used\n     }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3241.json",
    "content": "{\n  \"title\": \"Methods should not return values that are never used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"design\",\n    \"unused\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3241\",\n  \"sqKey\": \"S3241\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3242.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When a derived type is used as a parameter instead of the base type, it limits the uses of the method. If the additional functionality that is\nprovided in the derived type is not required then that limitation isn’t required, and should be removed.</p>\n<p>This rule raises an issue when a method declaration includes a parameter that is a derived type and accesses only members of the base type.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nusing System;\nusing System.IO;\n\nnamespace MyLibrary\n{\n  public class Foo\n  {\n    public void ReadStream(FileStream stream) // Noncompliant: Uses only System.IO.Stream methods\n    {\n      int a;\n      while ((a = stream.ReadByte()) != -1)\n      {\n            // Do something.\n      }\n    }\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nusing System;\nusing System.IO;\n\nnamespace MyLibrary\n{\n  public class Foo\n  {\n    public void ReadStream(Stream stream)\n    {\n      int a;\n      while ((a = stream.ReadByte()) != -1)\n      {\n            // Do something.\n      }\n    }\n  }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3242.json",
    "content": "{\n  \"title\": \"Method parameters should be declared with base types\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"api-design\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3242\",\n  \"sqKey\": \"S3242\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3244.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When working with <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/lambda-expressions\">anonymous\nfunctions</a>, it is important to keep in mind that each time you create one, it is a completely new instance.</p>\n<p>In this example, even though the same lambda expression is used, the expressions are stored separately in the memory and are therefore not equal or\nthe same.</p>\n<pre>\nFunc&lt;int, int&gt; lambda1 = x =&gt; x + 1;\nFunc&lt;int, int&gt; lambda2 = x =&gt; x + 1;\n\nvar result = lambda1 == lambda2; // result is false here\n</pre>\n<p>This is even more true when working with <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/events/\">events</a> since they\nare <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/delegates/how-to-combine-delegates-multicast-delegates\">multicast\ndelegates</a> that offer ways of <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/events/how-to-subscribe-to-and-unsubscribe-from-events\">subscribing and\nunsubscribing</a> to them. If an anonymous function is used to subscribe to an event, it is impossible to unsubscribe from it. This happens because to\nremove the entry from the subscription list, a reference to the original method is needed, but if the anonymous function has not been stored before\nsubscribing, there is no way to find a reference to it.</p>\n<p>Instead, store the callback to a variable or a named method and use the variable or method to subscribe and unsubscribe.</p>\n<h2>How to fix it</h2>\n<p>Store the callback to a variable or a named method and use the variable or method to subscribe and unsubscribe.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nevent EventHandler myEvent;\n\nvoid DoWork()\n{\n        myEvent += (s, e) =&gt; Console.WriteLine($\"Event raised with sender {s} and arguments {e}!\");\n        // ...\n        myEvent -= (s, e) =&gt; Console.WriteLine($\"Event raised with sender {s} and arguments {e}!\"); // Noncompliant: this callback was never subscribed\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nevent EventHandler myEvent;\nvoid LogEvent(object s, EventArgs e) =&gt; Console.WriteLine($\"Event raised with sender {s} and arguments {e}!\");\n\nvoid DoWork()\n{\n        myEvent += LogEvent;\n        // ...\n        myEvent -= LogEvent; // Compliant: LogEvent points to the same callback used for subscribing\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/events/\">Events (C# Programming Guide)</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/lambda-expressions\">Lambda expressions\n  and anonymous functions</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/events/how-to-subscribe-to-and-unsubscribe-from-events\">How to subscribe to\n  and unsubscribe from events (C# Programming Guide)</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/delegates/how-to-combine-delegates-multicast-delegates\">How to combine\n  delegates (Multicast Delegates) (C# Programming Guide)</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3244.json",
    "content": "{\n  \"title\": \"Anonymous delegates should not be used to unsubscribe from Events\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3244\",\n  \"sqKey\": \"S3244\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3246.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>In the interests of making code as usable as possible, interfaces and delegates with generic parameters should use the <code>out</code> and\n<code>in</code> modifiers when possible to make the interfaces and delegates covariant and contravariant, respectively.</p>\n<p>The <code>out</code> keyword can be used when the type parameter is used only as a return type in the interface or delegate. Doing so makes the\nparameter covariant, and allows interface and delegate instances created with a sub-type to be used as instances created with a base type. The most\nnotable example of this is <code>IEnumerable&lt;out T&gt;</code>, which allows the assignment of an <code>IEnumerable&lt;string&gt;</code> instance to\nan <code>IEnumerable&lt;object&gt;</code> variable, for instance.</p>\n<p>The <code>in</code> keyword can be used when the type parameter is used only as a method parameter in the interface or a parameter in the delegate.\nDoing so makes the parameter contravariant, and allows interface and delegate instances created with a base type to be used as instances created with\na sub-type. I.e. this is the inversion of covariance. The most notable example of this is the <code>Action&lt;in T&gt;</code> delegate, which allows\nthe assignment of an <code>Action&lt;object&gt;</code> instance to a <code>Action&lt;string&gt;</code> variable, for instance.</p>\n<h3>Noncompliant code example</h3>\n<pre>\ninterface IConsumer&lt;T&gt;  // Noncompliant\n{\n    bool Eat(T fruit);\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\ninterface IConsumer&lt;in T&gt;\n{\n    bool Eat(T fruit);\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3246.json",
    "content": "{\n  \"title\": \"Generic type parameters should be co\\/contravariant when possible\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"MODULAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"api-design\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3246\",\n  \"sqKey\": \"S3246\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3247.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>In C#, the <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/type-testing-and-cast#is-operator\"><code>is</code>\ntype testing operator</a> can be used to check if the run-time type of an object is compatible with a given type. If the object is not null, then the\n<code>is</code> operator performs a cast, and so performing another cast following the check result is redundant.</p>\n<p>This can impact:</p>\n<ul>\n  <li>Performance: Performing the type check and cast separately can lead to minor performance issues. While this might not be noticeable in small\n  applications, it can add up in larger, more complex systems.</li>\n  <li>Readability: The code is less readable and less clean because it requires two lines (and two operations) to achieve something that could be done\n  in one.</li>\n</ul>\n<h2>How to fix it</h2>\n<p>Use <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/functional/pattern-matching\">pattern macthing</a> to perform the check\nand retrieve the cast result.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nif (x is Fruit)  // Noncompliant\n{\n  var f = (Fruit)x; // or x as Fruit\n  // ...\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nif (x is Fruit fruit)\n{\n  // ...\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/type-testing-and-cast\">Type-testing\n  operators and cast expressions - <code>is</code>, <code>as</code>, <code>typeof</code> and casts</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/is\">is operator (C# reference)</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/functional/pattern-matching\">Pattern matching\n  overview</a></li>\n</ul>\n<h3>Benchmarks</h3>\n<table>\n  <colgroup>\n    <col style=\"width: 25%;\">\n    <col style=\"width: 25%;\">\n    <col style=\"width: 25%;\">\n    <col style=\"width: 25%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>Method</th>\n      <th>Runtime</th>\n      <th>Mean</th>\n      <th>Standard Deviation</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p>IsPattern_Class</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>176.48 ns</p>\n      </td>\n      <td>\n        <p>0.765 ns</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>IsWithCast_Class</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>246.12 ns</p>\n      </td>\n      <td>\n        <p>22.391 ns</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>IsPattern_Class</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>325.11 ns</p>\n      </td>\n      <td>\n        <p>14.435 ns</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>IsWithCast_Class</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>311.22 ns</p>\n      </td>\n      <td>\n        <p>11.145 ns</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>IsPattern_Interface</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>26.77 ns</p>\n      </td>\n      <td>\n        <p>1.123 ns</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>IsWithCast_Interface</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>26.45 ns</p>\n      </td>\n      <td>\n        <p>2.115 ns</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>IsPattern_Interface</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>119.80 ns</p>\n      </td>\n      <td>\n        <p>5.411 ns</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>IsWithCast_Interface</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>119.33 ns</p>\n      </td>\n      <td>\n        <p>4.380 ns</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>IsPattern_ValueType</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>22.58 ns</p>\n      </td>\n      <td>\n        <p>1.161 ns</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>IsWithCast_ValueType</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>19.41 ns</p>\n      </td>\n      <td>\n        <p>2.675 ns</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>IsPattern_ValueType</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>39.66 ns</p>\n      </td>\n      <td>\n        <p>0.645 ns</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>IsWithCast_ValueType</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>41.34 ns</p>\n      </td>\n      <td>\n        <p>0.462 ns</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h4>Glossary</h4>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Arithmetic_mean\">Mean</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Standard_deviation\">Standard Deviation</a></li>\n</ul>\n<p>The results were generated by running the following snippet with <a href=\"https://github.com/dotnet/BenchmarkDotNet\">BenchmarkDotNet</a>:</p>\n<pre>\nprivate Random random = new Random(1);\n\nprivate object ReturnSometimes&lt;T&gt;() where T : new() =&gt;\n    random.Next(2) switch\n    {\n        0 =&gt; new T(),\n        1 =&gt; new object(),\n    };\n\n[BenchmarkCategory(\"ValueType\"), Benchmark(Baseline = true)]\npublic int IsPattern_ValueType()\n{\n    var i = ReturnSometimes&lt;int&gt;();\n    return i is int d\n        ? d\n        : default;\n}\n\n[BenchmarkCategory(\"ValueType\"), Benchmark]\npublic int IsWithCast_ValueType()\n{\n    var i = ReturnSometimes&lt;int&gt;();\n    return i is int\n        ? (int)i\n        : default;\n}\n\n[BenchmarkCategory(\"Class\"), Benchmark(Baseline = true)]\npublic DuplicateCasts IsPattern_Class()\n{\n    var i = ReturnSometimes&lt;DuplicateCasts&gt;();\n    return i is DuplicateCasts d\n        ? d\n        : default;\n}\n\n[BenchmarkCategory(\"Class\"), Benchmark]\npublic DuplicateCasts IsWithCast_Class()\n{\n    var i = ReturnSometimes&lt;DuplicateCasts&gt;();\n    return i is DuplicateCasts\n        ? (DuplicateCasts)i\n        : default;\n}\n\n[BenchmarkCategory(\"Interface\"), Benchmark(Baseline = true)]\npublic IReadOnlyList&lt;int&gt; IsPattern_Interface()\n{\n    var i = ReturnSometimes&lt;List&lt;int&gt;&gt;();\n    return i is IReadOnlyList&lt;int&gt; d\n        ? d\n        : default;\n}\n\n[BenchmarkCategory(\"Interface\"), Benchmark]\npublic IReadOnlyList&lt;int&gt; IsWithCast_Interface()\n{\n    var i = ReturnSometimes&lt;List&lt;int&gt;&gt;();\n    return i is IReadOnlyList&lt;int&gt;\n        ? (IReadOnlyList&lt;int&gt;)i\n        : default;\n}\n</pre>\n<p>Hardware configuration:</p>\n<pre>\nBenchmarkDotNet v0.14.0, Windows 10 (10.0.19045.5247/22H2/2022Update)\nIntel Core Ultra 7 165H, 1 CPU, 22 logical and 16 physical cores\n  [Host]               : .NET Framework 4.8.1 (4.8.9282.0), X64 RyuJIT VectorSize=256\n  .NET 9.0             : .NET 9.0.0 (9.0.24.52809), X64 RyuJIT AVX2\n  .NET Framework 4.8.1 : .NET Framework 4.8.1 (4.8.9282.0), X64 RyuJIT VectorSize=256\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3247.json",
    "content": "{\n  \"title\": \"Duplicate casts should not be made\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3247\",\n  \"sqKey\": \"S3247\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3249.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Making a <code>base</code> call when overriding a method is generally a good idea, but not in the case of <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.object.gethashcode\"><code>GetHashCode</code></a> and <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.object.equals\"><code>Equals</code></a> for classes that directly extend <code>Object</code>.\nThese methods are based on the object’s reference, meaning that no two objects that use those <code>base</code> methods can be equal or have the same\nhash.</p>\n<h3>Exceptions</h3>\n<p>This rule doesn’t report on guard conditions checking for reference equality. For example:</p>\n<pre>\npublic override bool Equals(object obj)\n{\n  if (base.Equals(obj)) // Compliant, it's a guard condition.\n  {\n    return true;\n  }\n  ...\n}\n</pre>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nvar m1 = new MyClass(2);\nvar m2 = new MyClass(2);\n\nm1.Equals(m2) // False\nm1.GetHashCode(); // 43942919\nm2.GetHashCode(); // 59941935\n\nclass MyClass\n{\n    private readonly int x;\n    public MyClass(int x) =&gt;\n        this.x = x;\n\n    public override bool Equals(Object obj) =&gt;\n        base.Equals();\n\n    public override int GetHashCode() =&gt;\n        x.GetHashCode() ^ base.GetHashCode(); // Noncompliant, base.GetHashCode returns a code based on the objects reference\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nvar m1 = new MyClass(2);\nvar m2 = new MyClass(2);\n\nm1.Equals(m2) // True\nm1.GetHashCode(); // 2\nm2.GetHashCode(); // 2\n\nclass MyClass\n{\n    private readonly int x;\n    public MyClass(int x) =&gt;\n        this.x = x;\n\n    public override bool Equals(Object obj) =&gt;\n        this.x == ((MyClass)obj).x;\n\n    public override int GetHashCode() =&gt;\n        x.GetHashCode()\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.object.gethashcode?view=net-7.0\">Object.GetHashCode\n  Method</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.object.equals\">Object.Equals Method</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3249.json",
    "content": "{\n  \"title\": \"Classes directly extending \\\"object\\\" should not call \\\"base\\\" in \\\"GetHashCode\\\" or \\\"Equals\\\"\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3249\",\n  \"sqKey\": \"S3249\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3251.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><code>partial</code> methods allow an increased degree of flexibility in programming a system. Hooks can be added to generated code by invoking\nmethods that define their signature, but might not have an implementation yet. But if the implementation is still missing when the code makes it to\nproduction, the compiler silently removes the call. In the best case scenario, such calls simply represent cruft, but in they worst case they are\ncritical, missing functionality, the loss of which will lead to unexpected results at runtime.</p>\n<p>This rule raises an issue for partial methods for which no implementation can be found in the assembly.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npartial class C\n{\n  partial void M(); //Noncompliant\n\n  void OtherM()\n  {\n    M(); //Noncompliant. Will be removed.\n  }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3251.json",
    "content": "{\n  \"title\": \"Implementations should be provided for \\\"partial\\\" methods\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3251\",\n  \"sqKey\": \"S3251\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3253.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Since the compiler will automatically invoke the base type’s no-argument constructor, there’s no need to specify its invocation explicitly. Also,\nwhen only a single <code>public</code> parameterless constructor is defined in a class, then that constructor can be removed because the compiler\nwould generate it automatically. Similarly, empty <code>static</code> constructors and empty destructors are also wasted keystrokes.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nclass X\n{\n  public X() { } // Noncompliant\n  static X() { }  // Noncompliant\n  ~X() { } // Noncompliant\n\n  ...\n}\n\nclass Y : X\n{\n  public Y(int parameter) : base() // Noncompliant\n  {\n    /* does something with the parameter */\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nclass X\n{\n  ...\n}\n\nclass Y : X\n{\n  public Y(int parameter)\n  {\n    /* does something with the parameter */\n  }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3253.json",
    "content": "{\n  \"title\": \"Constructor and destructor declarations should not be redundant\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"finding\",\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3253\",\n  \"sqKey\": \"S3253\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3254.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Specifying the default parameter values in a method call is redundant. Such values should be omitted in the interests of readability.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic void M(int x, int y=5, int z = 7) { /* ... */ }\n\n// ...\nM(1, 5); // Noncompliant, y has the default value\nM(1, z: 7); // Noncompliant, z has the default value\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic void M(int x, int y=5, int z = 7) { /* ... */ }\n\n// ...\nM(1);\nM(1);\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3254.json",
    "content": "{\n  \"title\": \"Default parameter values should not be passed as arguments\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"finding\",\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3254\",\n  \"sqKey\": \"S3254\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3256.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Using <code>string.Equals</code> to determine if a string is empty is significantly slower than using <code>string.IsNullOrEmpty()</code> or\nchecking for <code>string.Length == 0</code>. <code>string.IsNullOrEmpty()</code> is both clear and concise, and therefore preferred to laborious,\nerror-prone, manual null- and emptiness-checking.</p>\n<h3>Noncompliant code example</h3>\n<pre>\n\"\".Equals(name); // Noncompliant\n!name.Equals(\"\"); // Noncompliant\nname.Equals(string.Empty); // Noncompliant\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nname != null &amp;&amp; name.Length &gt; 0 // Compliant but more error prone\n!string.IsNullOrEmpty(name)\nstring.IsNullOrEmpty(name)\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3256.json",
    "content": "{\n  \"title\": \"\\\"string.IsNullOrEmpty\\\" should be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3256\",\n  \"sqKey\": \"S3256\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3257.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>In C#, the type of a variable can often be inferred by the compiler. The use of the [var keyword](<a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/implicitly-typed-local-variables\">https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/implicitly-typed-local-variables</a>)\nallows you to avoid repeating the type name in a variable declaration and object instantiation because the declared type can often be inferred by the\ncompiler.</p>\n<p>Additionally, initializations providing the default value can also be omitted, helping to make the code more concise and readable.</p>\n<p>Unnecessarily verbose declarations and initializations should be simplified. Specifically, the following should be omitted when they can be\ninferred:</p>\n<ul>\n  <li>array element type</li>\n  <li>array size</li>\n  <li><code>new DelegateType</code></li>\n  <li><code>new Nullable&lt;Type&gt;</code></li>\n  <li>object or collection initializers ({})</li>\n  <li>type of lambda expression parameters</li>\n  <li>parameter declarations of anonymous methods when the parameters are not used.</li>\n</ul>\n<h2>How to fix it</h2>\n<p>Remove any unneeded code. C# provides many features designed to help you write more concise code.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nvar l = new List&lt;int&gt;() {}; // Noncompliant, {} can be removed\nvar o = new object() {}; // Noncompliant, {} can be removed\n\nvar ints = new int[] {1, 2, 3}; // Noncompliant, int can be omitted\nints = new int[3] {1, 2, 3}; // Noncompliant, the size specification can be removed\n\nint? i = new int?(5); // Noncompliant new int? could be omitted, it can be inferred from the declaration, and there's implicit conversion from T to T?\nvar j = new int?(5);\n\nFunc&lt;int, int&gt; f1 = (int i) =&gt; 1; //Noncompliant, can be simplified\n\nclass Class\n{\n    private event EventHandler MyEvent;\n\n    public Class()\n    {\n        MyEvent += new EventHandler((a,b)=&gt;{ }); // Noncompliant, needlessly verbose\n    }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nvar l = new List&lt;int&gt;();\nvar o = new object();\n\nvar ints = new [] {1, 2, 3};\nints = new [] {1, 2, 3};\n\nint? i = 5;\nvar j = new int?(5);\n\nFunc&lt;int, int&gt; f1 = (i) =&gt; 1;\n\nclass Class\n{\n    private event EventHandler MyEvent;\n\n    public Class()\n    {\n        MyEvent += (a,b)=&gt;{ };\n    }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/declarations\">Declaration\n  statements</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3257.json",
    "content": "{\n  \"title\": \"Declarations and initializations should be as concise as possible\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1min\"\n  },\n  \"tags\": [\n    \"finding\",\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3257\",\n  \"sqKey\": \"S3257\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3260.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Classes and records with either <code>private</code> or <code>file</code> access modifiers aren’t visible outside of their assemblies or files, so\nif they’re not extended inside their scope, they should be made explicitly non-extensible with the addition of the <code>sealed</code> keyword.</p>\n<h3>What is the potential impact?</h3>\n<p>We measured at least 4x improvement in execution time. For more details see the <code>Benchmarks</code> section from the <code>More info</code>\ntab.</p>\n<h2>How to fix it</h2>\n<p>The code can be improved by adding the <code>sealed</code> keyword in front of the <code>class</code> or <code>record</code> types that have no\ninheritors.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nprivate class MyClass  // Noncompliant\n{\n  // ...\n}\n\nprivate record MyRecord  // Noncompliant\n{\n  // ...\n}\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nfile class MyClass  // Noncompliant\n{\n  // ...\n}\n\nfile record MyRecord  // Noncompliant\n{\n  // ...\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nprivate sealed class MyClass\n{\n  // ...\n}\n\nprivate sealed record MyRecord\n{\n  // ...\n}\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nfile sealed class MyClass\n{\n  // ...\n}\n\nfile sealed record MyRecord\n{\n  // ...\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/sealed\">The <code>sealed</code> keyword</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li><a href=\"https://code-maze.com/improve-performance-sealed-classes-dotnet\">Boosting Performance With Sealed Classes in .NET</a></li>\n  <li><a href=\"https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-6/#peanut-butter\">Performance Improvements in .NET 6</a></li>\n</ul>\n<h3>Benchmarks</h3>\n<table>\n  <colgroup>\n    <col style=\"width: 25%;\">\n    <col style=\"width: 25%;\">\n    <col style=\"width: 25%;\">\n    <col style=\"width: 25%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>Method</th>\n      <th>Runtime</th>\n      <th>Mean</th>\n      <th>Standard Deviation</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p>UnsealedType</p>\n      </td>\n      <td>\n        <p>.NET 5.0</p>\n      </td>\n      <td>\n        <p>918.7 us</p>\n      </td>\n      <td>\n        <p>10.72 us</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>SealedType</p>\n      </td>\n      <td>\n        <p>.NET 5.0</p>\n      </td>\n      <td>\n        <p>231.2 us</p>\n      </td>\n      <td>\n        <p>3.20 us</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>UnsealedType</p>\n      </td>\n      <td>\n        <p>.NET 6.0</p>\n      </td>\n      <td>\n        <p>867.9 us</p>\n      </td>\n      <td>\n        <p>5.65 us</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>SealedType</p>\n      </td>\n      <td>\n        <p>.NET 6.0</p>\n      </td>\n      <td>\n        <p>218.4 us</p>\n      </td>\n      <td>\n        <p>0.59 us</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>UnsealedType</p>\n      </td>\n      <td>\n        <p>.NET 7.0</p>\n      </td>\n      <td>\n        <p>1,074.5 us</p>\n      </td>\n      <td>\n        <p>3.15 us</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>SealedType</p>\n      </td>\n      <td>\n        <p>.NET 7.0</p>\n      </td>\n      <td>\n        <p>216.1 us</p>\n      </td>\n      <td>\n        <p>1.19 us</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h4>Glossary</h4>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Arithmetic_mean\">Mean</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Standard_deviation\">Standard Deviation</a></li>\n</ul>\n<p>The results were generated by running the following snippet with <a href=\"https://github.com/dotnet/BenchmarkDotNet\">BenchmarkDotNet</a>:</p>\n<pre>\n[Params(1_000_000)]\npublic int Iterations { get; set; }\n\nprivate readonly UnsealedClass unsealedType = new UnsealedClass();\nprivate readonly SealedClass sealedType = new SealedClass();\n\n[Benchmark(Baseline = true)]\npublic void UnsealedType()\n{\n    for (int i = 0; i &lt; Iterations; i++)\n    {\n        unsealedType.DoNothing();\n    }\n}\n\n[Benchmark]\npublic void SealedType()\n{\n    for (int i = 0; i &lt; Iterations; i++)\n    {\n        sealedType.DoNothing();\n    }\n}\n\nprivate class BaseType\n{\n    public virtual void DoNothing() { }\n}\n\nprivate class UnsealedClass : BaseType\n{\n    public override void DoNothing() { }\n}\n\nprivate sealed class SealedClass : BaseType\n{\n    public override void DoNothing() { }\n}\n</pre>\n<p>Hardware Configuration:</p>\n<pre>\nBenchmarkDotNet=v0.13.5, OS=Windows 10 (10.0.19045.2846/22H2/2022Update)\n12th Gen Intel Core i7-12800H, 1 CPU, 20 logical and 14 physical cores\n.NET SDK=7.0.203\n  [Host]   : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2\n  .NET 5.0 : .NET 5.0.17 (5.0.1722.21314), X64 RyuJIT AVX2\n  .NET 6.0 : .NET 6.0.16 (6.0.1623.17311), X64 RyuJIT AVX2\n  .NET 7.0 : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3260.json",
    "content": "{\n  \"title\": \"Non-derived \\\"private\\\" classes and records should be \\\"sealed\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3260\",\n  \"sqKey\": \"S3260\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3261.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Namespaces with no lines of code clutter a project and should be removed.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nnamespace MyEmptyNamespace // Noncompliant\n{\n\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3261.json",
    "content": "{\n  \"title\": \"Namespaces should not be empty\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"unused\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3261\",\n  \"sqKey\": \"S3261\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3262.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Overriding methods automatically inherit the <code>params</code> behavior. To ease readability, this modifier should be explicitly used in the\noverriding method as well.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nclass Base\n{\n  public virtual void Method(params int[] numbers)\n  {\n    ...\n  }\n}\nclass Derived : Base\n{\n  public override void Method(int[] numbers) // Noncompliant, the params is missing.\n  {\n    ...\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nclass Base\n{\n  public virtual void Method(params int[] numbers)\n  {\n    ...\n  }\n}\nclass Derived : Base\n{\n  public override void Method(params int[] numbers)\n  {\n    ...\n  }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3262.json",
    "content": "{\n  \"title\": \"\\\"params\\\" should be used on overrides\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"confusing\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3262\",\n  \"sqKey\": \"S3262\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3263.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Static field initializers are executed in the order in which they appear in the class from top to bottom. Thus, placing a static field in a class\nabove the field or fields required for its initialization will yield unexpected results.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nclass MyClass\n{\n  public static int X = Y; // Noncompliant; Y at this time is still assigned default(int), i.e. 0\n  public static int Y = 42;\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nclass MyClass\n{\n  public static int Y = 42;\n  public static int X = Y;\n}\n</pre>\n<p>or</p>\n<pre>\nclass MyClass\n{\n  public static int X;\n  public static int Y = 42;\n\n  static MyClass()\n  {\n    X = Y;\n  }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3263.json",
    "content": "{\n  \"title\": \"Static fields should appear in the order they must be initialized \",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3263\",\n  \"sqKey\": \"S3263\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3264.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Events that are not invoked anywhere are dead code, and there’s no good reason to keep them in the source.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nclass UninvokedEventSample\n{\n    private event Action&lt;object, EventArgs&gt; Happened; // Noncompliant\n\n    public void RegisterEventHandler(Action&lt;object, EventArgs&gt; handler)\n    {\n        Happened += handler; // we register some event handlers\n    }\n\n    public void RaiseEvent()\n    {\n        if (Happened != null)\n        {\n            // Happened(this, null); // the event is never triggered, because this line is commented out.\n        }\n    }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3264.json",
    "content": "{\n  \"title\": \"Events should be invoked\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"unused\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3264\",\n  \"sqKey\": \"S3264\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3265.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/enum\">Enumerations</a> are commonly used to identify\ndistinct elements from a set of values.</p>\n<p>However, they can also serve as <a href=\"https://en.wikipedia.org/wiki/Bit_field\">bit flags</a>, enabling bitwise operations to combine multiple\nelements within a single value.</p>\n<pre>\n// Saturday = 0b00100000, Sunday = 0b01000000, weekend = 0b01100000\nvar weekend = Days.Saturday | Days.Sunday;  // Combining elements\n</pre>\n<p>When enumerations are used as bit flags, it is considered <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/enum#enumeration-types-as-bit-flags\">good practice</a> to\nannotate the enum type with the <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.flagsattribute\">FlagsAttribute</a>:</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nenum Permissions\n{\n  None = 0,\n  Read = 1,\n  Write = 2,\n  Execute = 4\n}\n\n// ...\n\nvar x = Permissions.Read | Permissions.Write;  // Noncompliant: enum is not annotated with [Flags]\n</pre>\n<p>The <code>FlagsAttribute</code> explicitly marks an enumeration as bit flags, making it clear that it uses bit fields and is intended to be used as\nflags.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n[Flags]\nenum Permissions\n{\n  None = 0,\n  Read = 1,\n  Write = 2,\n  Execute = 4\n}\n\n// ...\n\nvar x = Permissions.Read | Permissions.Write;  // Compliant: enum is annotated with [Flags]\n</pre>\n<p>Additionally, adding the <code>FlagsAttribute</code> to the enumeration enable a <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.flagsattribute#examples\">better string representation</a> when using the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.enum.tostring\">Enum.ToString</a> method.</p>\n<h3>Exception</h3>\n<p>This rule will not raise for <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.methodimplattribute?view=net-10.0\">MethodImplAttribute</a> because,\ndespite not having the <code>FlagsAttribute</code>, it is often used in a similar fashion.</p>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/enum\">Enumeration in C#</a>\n    <ul>\n      <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/enum#enumeration-types-as-bit-flags\">Enumeration\n      types as bit flags</a></li>\n    </ul></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.flagsattribute\">FlagsAttribute class</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.enum.tostring\">Enum.ToString method</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Bit_field\">Bit field - Wikipedia</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3265.json",
    "content": "{\n  \"title\": \"Non-flags enums should not be used in bitwise operations\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-3265\",\n  \"sqKey\": \"S3265\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3267.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Using explicit loops for filtering, selecting, or aggregating elements can make code more verbose and harder to read. LINQ expressions provide a\nmore concise and expressive way to perform these operations, improving code clarity and maintainability.</p>\n<h3>Performance Considerations</h3>\n<p>If the affected code is part of a performance-critical hot path and that the fix would negatively impact performance, you can self-declare the\n<code>PerformanceSensitiveAttribute</code> in your codebase, or use the one provided by <a\nhref=\"https://www.nuget.org/packages/Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers\">Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers</a>:</p>\n<pre>\n[AttributeUsage(AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = true, Inherited = false)]\npublic sealed class PerformanceSensitiveAttribute() : Attribute;\n\n[PerformanceSensitiveAttribute]\nList&lt;string&gt; Method(IEnumerable&lt;string&gt; collection, Predicate&lt;string&gt; condition)\n{\n  var result = new List&lt;string&gt;();\n  foreach (var element in collection)  // Without the attribute, this would raise an issue\n  {\n    if (condition(element))\n    {\n      result.Add(element);\n    }\n  }\n  return result;\n}\n</pre>\n<p>The rule will respect the <a\nhref=\"https://github.com/dotnet/roslyn-analyzers/blob/b924542a1b526322929725a1aaa9586c21b1b231/nuget/PerformanceSensitiveAnalyzers/PerformanceSensitiveAttribute.cs#L68-L72\"><code>AllowGenericEnumeration</code></a>\nproperty:</p>\n<pre>\n[PerformanceSensitive(\"Enumeration\", AllowGenericEnumeration = true)]\nList&lt;string&gt; Method(IEnumerable&lt;string&gt; collection, Predicate&lt;string&gt; condition) { }\n</pre>\n<p>In this case, the rule will not be disabled even if the method is marked with the <code>PerformanceSensitiveAttribute</code> attribute.</p>\n<h2>How to fix it</h2>\n<p>Replace explicit loops and conditional blocks with equivalent LINQ expressions.</p>\n<p>Use the <a href=\"https://www.nuget.org/packages/System.Linq.Async\">System.Linq.Async</a> package to enable LINQ operations on <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.iasyncenumerable-1\">IAsyncEnumerable</a> prior to .NET 10.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nList&lt;string&gt; Method(IEnumerable&lt;string&gt; collection, Predicate&lt;string&gt; condition)\n{\n  var result = new List&lt;string&gt;();\n  foreach (var element in collection)  // Noncompliant\n  {\n    if (condition(element))\n    {\n      result.Add(element);\n    }\n  }\n  return result;\n}\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nList&lt;string&gt; Method(IEnumerable&lt;MyDto&gt; collection)\n{\n  var result = new List&lt;string&gt;();\n  foreach (var element in collection) // Noncompliant\n  {\n    var someValue = element.Property;\n    if (someValue != null)\n    {\n      result.Add(someValue);\n    }\n  }\n  return result;\n}\n</pre>\n<pre data-diff-id=\"3\" data-diff-type=\"noncompliant\">\npublic void Method(List&lt;string&gt; list)\n{\n  foreach (var element in list)\n  {\n    var someValue = element.Length;\n  }\n}\n</pre>\n<pre data-diff-id=\"4\" data-diff-type=\"noncompliant\">\nasync void Method(IAsyncEnumerable&lt;int&gt; collection)\n{\n  await foreach (var element in collection)\n  {\n    if (element is 42)\n    {\n      Console.WriteLine(\"The meaning of Life.\");\n    }\n  }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nList&lt;string&gt; Method(IEnumerable&lt;string&gt; collection, Predicate&lt;string&gt; condition) =&gt;\n  collection.Where(x =&gt; condition(x)).ToList();\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nList&lt;string&gt; Method(IEnumerable&lt;MyDto&gt; collection) =&gt;\n  collection.Select(x =&gt; x.Property).Where(y =&gt; y != null).ToList();\n</pre>\n<pre data-diff-id=\"3\" data-diff-type=\"compliant\">\nvoid Method(List&lt;int&gt; list)\n{\n  foreach (var length in list.Select(x =&gt; x.Length))\n  {\n    var someValue = length;\n  }\n}\n</pre>\n<pre data-diff-id=\"4\" data-diff-type=\"compliant\">\nasync void Method(IAsyncEnumerable&lt;int&gt; collection)\n{\n  await foreach (var element in collection.Where(x =&gt; x is 42)))\n  {\n    Console.WriteLine(\"The meaning of Life.\");\n  }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/linq\">Language Integrated Query (LINQ)</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.iasyncenumerable-1\">IAsyncEnumerable&lt;T&gt;\n  Interface</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/10.0/asyncenumerable\">System.Linq.AsyncEnumerable in .NET\n  10</a></li>\n  <li>NuGet - <a href=\"https://www.nuget.org/packages/System.Linq.Async\">System.Linq.Async</a></li>\n  <li>NuGet - <a\n  href=\"https://www.nuget.org/packages/Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers\">Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3267.json",
    "content": "{\n  \"title\": \"Loops should be simplified with \\\"LINQ\\\" expressions\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3267\",\n  \"sqKey\": \"S3267\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3329.html",
    "content": "<p>This vulnerability exposes encrypted data to a number of attacks whose goal is to recover the plaintext.</p>\n<h2>Why is this an issue?</h2>\n<p>Encryption algorithms are essential for protecting sensitive information and ensuring secure communications in a variety of domains. They are used\nfor several important reasons:</p>\n<ul>\n  <li>Confidentiality, privacy, and intellectual property protection</li>\n  <li>Security during transmission or on storage devices</li>\n  <li>Data integrity, general trust, and authentication</li>\n</ul>\n<p>When selecting encryption algorithms, tools, or combinations, you should also consider two things:</p>\n<ol>\n  <li>No encryption is unbreakable.</li>\n  <li>The strength of an encryption algorithm is usually measured by the effort required to crack it within a reasonable time frame.</li>\n</ol>\n<p>In the mode Cipher Block Chaining (CBC), each block is used as cryptographic input for the next block. For this reason, the first block requires an\ninitialization vector (IV), also called a \"starting variable\" (SV).</p>\n<p>If the same IV is used for multiple encryption sessions or messages, each new encryption of the same plaintext input would always produce the same\nciphertext output. This may allow an attacker to detect patterns in the ciphertext.</p>\n<h3>What is the potential impact?</h3>\n<p>After retrieving encrypted data and performing cryptographic attacks on it on a given timeframe, attackers can recover the plaintext that\nencryption was supposed to protect.</p>\n<p>Depending on the recovered data, the impact may vary.</p>\n<p>Below are some real-world scenarios that illustrate the potential impact of an attacker exploiting the vulnerability.</p>\n<h4>Additional attack surface</h4>\n<p>By modifying the plaintext of the encrypted message, an attacker may be able to trigger additional vulnerabilities in the code. An attacker can\nfurther exploit a system to obtain more information.\n  <br>\n  Encrypted values are often considered trustworthy because it would not be possible for a third party to modify them under normal circumstances.</p>\n<h4>Breach of confidentiality and privacy</h4>\n<p>When encrypted data contains personal or sensitive information, its retrieval by an attacker can lead to privacy violations, identity theft,\nfinancial loss, reputational damage, or unauthorized access to confidential systems.</p>\n<p>In this scenario, a company, its employees, users, and partners could be seriously affected.</p>\n<p>The impact is twofold, as data breaches and exposure of encrypted data can undermine trust in the organization, as customers, clients and\nstakeholders may lose confidence in the organization’s ability to protect their sensitive data.</p>\n<h4>Legal and compliance issues</h4>\n<p>In many industries and locations, there are legal and compliance requirements to protect sensitive data. If encrypted data is compromised and the\nplaintext can be recovered, companies face legal consequences, penalties, or violations of privacy laws.</p>\n<h2>How to fix it in .NET</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nusing System.IO;\nusing System.Security.Cryptography;\n\npublic void Encrypt(byte[] key, byte[] dataToEncrypt, MemoryStream target)\n{\n    var aes = new AesCryptoServiceProvider();\n\n    byte[] iv     = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };\n    var encryptor = aes.CreateEncryptor(key, iv); // Noncompliant\n\n    var cryptoStream = new CryptoStream(target, encryptor, CryptoStreamMode.Write);\n    var swEncrypt    = new StreamWriter(cryptoStream);\n\n    swEncrypt.Write(dataToEncrypt);\n}\n</pre>\n<h4>Compliant solution</h4>\n<p>In this example, the code implicitly uses a number generator that is considered <strong>strong</strong>, thanks to <code>aes.IV</code>.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nusing System.IO;\nusing System.Security.Cryptography;\n\npublic void Encrypt(byte[] key, byte[] dataToEncrypt, MemoryStream target)\n{\n    var aes = new AesCryptoServiceProvider();\n\n    var encryptor = aes.CreateEncryptor(key, aes.IV);\n\n    var cryptoStream = new CryptoStream(target, encryptor, CryptoStreamMode.Write);\n    var swEncrypt    = new StreamWriter(cryptoStream);\n\n    swEncrypt.Write(dataToEncrypt);\n}\n</pre>\n<h3>How does this work?</h3>\n<h4>Use unique IVs</h4>\n<p>To ensure high security, initialization vectors must meet two important criteria:</p>\n<ul>\n  <li>IVs must be unique for each encryption operation.</li>\n  <li>For CBC and CFB modes, a secure FIPS-compliant random number generator should be used to generate unpredictable IVs.</li>\n</ul>\n<p>The IV does not need be secret, so the IV or information sufficient to determine the IV may be transmitted along with the ciphertext.</p>\n<p>In the previous non-compliant example, the problem is not that the IV is hard-coded.\n  <br>\n  It is that the same IV is used for multiple encryption attempts.</p>\n<h2>Resources</h2>\n<h3>Standards</h3>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A02_2021-Cryptographic_Failures/\">Top 10 2021 Category A2 - Cryptographic Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure\">Top 10 2017 Category A3 - Sensitive Data\n  Exposure</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A6_2017-Security_Misconfiguration\">Top 10 2017 Category A6 - Security\n  Misconfiguration</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/329\">CWE-329 - Not Using an Unpredictable IV with CBC Mode</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/780\">CWE-780 - Use of RSA Algorithm without OAEP</a></li>\n  <li><a href=\"https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38a.pdf\">NIST, SP-800-38A</a> - Recommendation for Block Cipher\n  Modes of Operation</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3329.json",
    "content": "{\n  \"title\": \"Cipher Block Chaining IVs should be unpredictable\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"HIGH\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"symbolic-execution\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-3329\",\n  \"sqKey\": \"S3329\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      327,\n      780\n    ],\n    \"OWASP\": [\n      \"A6\",\n      \"A3\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A2\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"4.1\",\n      \"6.5.3\",\n      \"6.5.4\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"4.2.1\",\n      \"6.2.4\"\n    ],\n    \"ASVS 4.0\": [\n      \"2.9.3\",\n      \"6.2.2\",\n      \"8.3.7\"\n    ]\n  },\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3330.html",
    "content": "<p>When a cookie is configured with the <code>HttpOnly</code> attribute set to <em>true</em>, the browser guaranties that no client-side script will\nbe able to read it. In most cases, when a cookie is created, the default value of <code>HttpOnly</code> is <em>false</em> and it’s up to the developer\nto decide whether or not the content of the cookie can be read by the client-side script. As a majority of Cross-Site Scripting (XSS) attacks target\nthe theft of session-cookies, the <code>HttpOnly</code> attribute can help to reduce their impact as it won’t be possible to exploit the XSS\nvulnerability to steal session-cookies.</p>\n<h2>Ask Yourself Whether</h2>\n<ul>\n  <li>the cookie is sensitive, used to authenticate the user, for instance a <em>session-cookie</em></li>\n  <li>the <code>HttpOnly</code> attribute offer an additional protection (not the case for an <em>XSRF-TOKEN cookie</em> / CSRF token for\n  example)</li>\n</ul>\n<p>There is a risk if you answered yes to any of those questions.</p>\n<h2>Recommended Secure Coding Practices</h2>\n<ul>\n  <li>By default the <code>HttpOnly</code> flag should be set to <em>true</em> for most of the cookies and it’s mandatory for session /\n  sensitive-security cookies.</li>\n</ul>\n<h2>Sensitive Code Example</h2>\n<p>When the <code>HttpCookie.HttpOnly</code> property is set to <code>false</code> then the cookie can be accessed by client side code:</p>\n<pre>\nHttpCookie myCookie = new HttpCookie(\"Sensitive cookie\");\nmyCookie.HttpOnly = false; // Sensitive: this cookie is created with the httponly flag set to false and so it can be stolen easily in case of XSS vulnerability\n</pre>\n<p>The <a href=\"https://docs.microsoft.com/en-us/dotnet/api/system.web.httpcookie.httponly?view=netframework-4.8\">default value</a> of\n<code>HttpOnly</code> flag is <code>false</code>, unless overwritten by an application’s configuration file:</p>\n<pre>\nHttpCookie myCookie = new HttpCookie(\"Sensitive cookie\");\n// Sensitive: this cookie is created without the httponly flag  (by default set to false) and so it can be stolen easily in case of XSS vulnerability\n</pre>\n<h2>Compliant Solution</h2>\n<p>Set the <code>HttpCookie.HttpOnly</code> property to <code>true</code>:</p>\n<pre>\nHttpCookie myCookie = new HttpCookie(\"Sensitive cookie\");\nmyCookie.HttpOnly = true; // Compliant: the sensitive cookie is protected against theft thanks to the HttpOnly property set to true (HttpOnly = true)\n</pre>\n<p>Or change the default flag values for the whole application by editing the <a\nhref=\"https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/ms228262(v=vs.100)\">Web.config configuration file</a>:</p>\n<pre>\n&lt;httpCookies httpOnlyCookies=\"true\" requireSSL=\"true\" /&gt;\n</pre>\n<ul>\n  <li>the <code>requireSSL</code> attribute corresponds programmatically to the <code>Secure</code> field.</li>\n  <li>the <code>httpOnlyCookies</code> attribute corresponds programmatically to the <code>httpOnly</code> field.</li>\n</ul>\n<h2>See</h2>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A05_2021-Security_Misconfiguration/\">Top 10 2021 Category A5 - Security Misconfiguration</a></li>\n  <li><a href=\"https://owasp.org/www-community/HttpOnly\">OWASP HttpOnly</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A7_2017-Cross-Site_Scripting_(XSS)\">Top 10 2017 Category A7 - Cross-Site Scripting\n  (XSS)</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/1004\">CWE-1004 - Sensitive Cookie Without 'HttpOnly' Flag</a></li>\n  <li>Derived from FindSecBugs rule <a href=\"https://find-sec-bugs.github.io/bugs.htm#HTTPONLY_COOKIE\">HTTPONLY_COOKIE</a></li>\n  <li>STIG Viewer - <a href=\"https://stigviewer.com/stigs/application_security_and_development/2024-12-06/finding/V-222575\">Application Security and\n  Development: V-222575</a> - The application must set the HTTPOnly flag on session cookies.</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3330.json",
    "content": "{\n  \"title\": \"Creating cookies without the \\\"HttpOnly\\\" flag is security-sensitive\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"LOW\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"privacy\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3330\",\n  \"sqKey\": \"S3330\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      1004\n    ],\n    \"OWASP\": [\n      \"A7\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A5\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"6.5.10\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"6.2.4\"\n    ],\n    \"ASVS 4.0\": [\n      \"3.4.2\"\n    ],\n    \"STIG ASD_V5R3\": [\n      \"V-222575\"\n    ]\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3343.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/attributes/caller-information\">Caller information attributes</a>\nprovide a way to get information about the caller of a method through <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/named-and-optional-arguments#optional-arguments\">optional</a>\nparameters. But they only work right if their values aren’t provided explicitly. So if you define a method with caller info attributes in the middle\nof the parameter list, the caller is forced to use named arguments if they want to use the method properly.</p>\n<p>This rule raises an issue when the following attributes are used on parameters before the end of the parameter list:</p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.callerfilepathattribute\">CallerFilePathAttribute</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.callerlinenumberattribute\">CallerLineNumberAttribute</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.callermembernameattribute\">CallerMemberNameAttribute</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.callerargumentexpressionattribute\">CallerArgumentExpressionAttribute</a></li>\n</ul>\n<h2>How to fix it</h2>\n<p>Move the decorated parameters to the end of the parameter list.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nvoid TraceMessage([CallerMemberName] string memberName = \"\",\n  [CallerFilePath] string filePath = \"\",\n  [CallerLineNumber] int lineNumber = 0,\n  string message = null)  // Noncompliant: decorated parameters appear before \"message\" parameter\n{\n  /* ... */\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nvoid TraceMessage(string message = null,\n  [CallerMemberName] string memberName = \"\",\n  [CallerFilePath] string filePath = \"\",\n  [CallerLineNumber] int lineNumber = 0)\n{\n  /* ... */\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/attributes/caller-information\">Determine caller information using\n  attributes interpreted by the C# compiler</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.callerfilepathattribute\">CallerFilePathAttribute\n  Class</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.callerlinenumberattribute\">CallerLineNumberAttribute\n  Class</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.callermembernameattribute\">CallerMemberNameAttribute\n  Class</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.callerargumentexpressionattribute\">CallerArgumentExpressionAttribute Class</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/named-and-optional-arguments#optional-arguments\">Named\n  and Optional Arguments</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3343.json",
    "content": "{\n  \"title\": \"Caller information parameters should come at the end of the parameter list\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"api-design\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3343\",\n  \"sqKey\": \"S3343\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3346.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>An assertion is a piece of code that’s used during development when the <a\nhref=\"https://learn.microsoft.com/en-us/visualstudio/debugger/how-to-set-debug-and-release-configurations\">compilation debug mode is activated</a>. It\nallows a program to check itself as it runs. When an assertion is <code>true</code>, that means everything is operating as expected.</p>\n<p>In non-debug mode, all <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.debug.assert\"><code>Debug.Assert</code></a> calls\nare automatically left out (via the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.conditionalattribute\"><code>Conditional(\"DEBUG\")</code></a> mechanism). So, by\ncontract, the boolean expressions that are evaluated by those assertions must not contain any <a\nhref=\"https://en.wikipedia.org/wiki/Side_effect_(computer_science)\">side effects</a>. Otherwise, when leaving the debug mode, the functional behavior\nof the application is not the same anymore.</p>\n<p>The rule will raise if the method name starts with any of the following <code>remove</code>, <code>delete</code>, <code>add</code>,\n<code>pop</code>, <code>update</code>, <code>retain</code>, <code>insert</code>, <code>push</code>, <code>append</code>, <code>clear</code>,\n<code>dequeue</code>, <code>enqueue</code>, <code>dispose</code>, <code>put</code>, or <code>set</code>, although <code>SetEquals</code> will be\nignored.</p>\n<h2>How to fix it</h2>\n<p>In the following example, the assertion checks the return value of the remove method in the argument. Because the whole line is skipped in\nnon-debug builds, the call to <code>Remove</code> never happens in such builds.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nDebug.Assert(list.Remove(\"dog\"));\n</pre>\n<h4>Compliant solution</h4>\n<p>The <code>Remove</code> call must be extracted and the return value needs to be asserted instead.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nbool result = list.Remove(\"dog\");\nDebug.Assert(result);\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.debug.assert/\"><code>Debug.Assert</code>\n  Method</a></li>\n  <li>Microsoft Learn <a href=\"https://learn.microsoft.com/en-us/dotnet/framework/debug-trace-profile/\">Debugging, tracing, and profiling</a></li>\n  <li>Microsoft Learn <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/framework/debug-trace-profile/how-to-compile-conditionally-with-trace-and-debug\">How to: Compile\n  Conditionally with Trace and Debug</a></li>\n  <li>Microsoft Learn <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/attributes/general#conditional-attribute\">Miscellaneous attributes\n  interpreted by the C# compiler - <code>Conditional</code> attribute</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li>Wikipedia <a href=\"https://en.wikipedia.org/wiki/Side_effect_(computer_science)\">Side effect (computer science)</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3346.json",
    "content": "{\n  \"title\": \"Expressions used in \\\"Debug.Assert\\\" should not produce side effects\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3346\",\n  \"sqKey\": \"S3346\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3353.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>If a variable that is not supposed to change is not marked as <code>const</code>, it could be accidentally reassigned elsewhere in the code,\nleading to unexpected behavior and bugs that can be hard to track down.</p>\n<p>By declaring a variable as <code>const</code>, you ensure that its value remains constant throughout the code. It also signals to other developers\nthat this value is intended to remain constant. This can make the code easier to understand and maintain.</p>\n<p>In some cases, using <code>const</code> can lead to performance improvements. The compiler might be able to make optimizations knowing that the\nvalue of a <code>const</code> variable will not change.</p>\n<h2>How to fix it</h2>\n<p>Mark the given variable with the <code>const</code> modifier.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic bool Seek(int[] input)\n{\n  var target = 32;  // Noncompliant\n  foreach (int i in input)\n  {\n    if (i == target)\n    {\n      return true;\n    }\n  }\n  return false;\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic bool Seek(int[] input)\n{\n  const int target = 32;\n  foreach (int i in input)\n  {\n    if (i == target)\n    {\n      return true;\n    }\n  }\n  return false;\n}\n</pre>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\npublic class Sample\n{\n  public void Method()\n  {\n    var context = $\"{nameof(Sample)}.{nameof(Method)}\";  // Noncompliant (C# 10 and above only)\n  }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\npublic class Sample\n{\n  public void Method()\n  {\n    const string context = $\"{nameof(Sample)}.{nameof(Method)}\";\n  }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/const\">const</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3353.json",
    "content": "{\n  \"title\": \"Unchanged variables should be marked as \\\"const\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-3353\",\n  \"sqKey\": \"S3353\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"partial\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3358.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Nested ternaries are hard to read and can make the order of operations complex to understand.</p>\n<pre>\npublic string GetReadableStatus(Job j)\n{\n  return j.IsRunning ? \"Running\" : j.HasErrors ? \"Failed\" : \"Succeeded\";  // Noncompliant\n}\n</pre>\n<p>Instead, use another line to express the nested operation in a separate statement.</p>\n<pre>\npublic string GetReadableStatus(Job j)\n{\n  if (j.IsRunning)\n  {\n    return \"Running\";\n  }\n  return j.HasErrors ? \"Failed\" : \"Succeeded\";\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3358.json",
    "content": "{\n  \"title\": \"Ternary operators should not be nested\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"confusing\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3358\",\n  \"sqKey\": \"S3358\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3363.html",
    "content": "<p>You should only set a property of a temporal type (like <code>DateTime</code> or <code>DateTimeOffset</code>) as the primary key of a table if the\nvalues are guaranteed to be unique.</p>\n<h2>Why is this an issue?</h2>\n<p>Using temporal types as the primary key of a table is risky. When these types are used as primary keys, it usually means that each new key is\ncreated with the use of <code>.Now</code> or <code>.UtcNow</code> properties from <code>DateTime</code> and <code>DateTimeOffset</code> classes. In\nthose cases, duplicate keys exceptions may occur in many ways:</p>\n<ul>\n  <li>when entries are added consecutively by a machine with low-enough system clock resolution;</li>\n  <li>when two different threads are inserting entries in close enough sequence for both to have the same time;</li>\n  <li>when changes such as daylight saving time (DST) transitions occur, where values can be repeated the following hour (only for\n  <code>DateTime</code> type);</li>\n</ul>\n<p>The rule raises an issue if:</p>\n<ul>\n  <li>Entity Framework, or Entity Framework Core dependencies are found;</li>\n  <li>a class contains a property either named <code>Id</code>, <code>&lt;type name&gt;Id</code> or decorated by the <code>[Key]</code> or\n  <code>[PrimaryKey]</code> attribute.</li>\n  <li>the key property is of one of the following types:\n    <ul>\n      <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetime\">System.DateTime</a></li>\n      <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetimeoffset\">System.DateTimeOffset</a></li>\n      <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.timespan\">System.TimeSpan</a></li>\n      <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.dateonly\">System.DateOnly</a></li>\n      <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.timeonly\">System.TimeOnly</a></li>\n    </ul></li>\n</ul>\n<h2>How to fix it</h2>\n<p>Either use a GUID or the auto generated ID as a primary key.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\ninternal class Account\n{\n    public DateTime Id { get; set; }\n\n    public string Name { get; set; }\n    public string Surname { get; set; }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\ninternal class Account\n{\n    public Guid Id { get; set; }\n\n    public string Name { get; set; }\n    public string Surname { get; set; }\n}\n</pre>\n<p>or</p>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\ninternal class Person\n{\n    [Key]\n    public DateTime PersonIdentifier { get; set; }\n\n    public string Name { get; set; }\n    public string Surname { get; set; }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\ninternal class Person\n{\n    [Key]\n    public Guid PersonIdentifier { get; set; }\n\n    public string Name { get; set; }\n    public string Surname { get; set; }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/ef/core/modeling/keys?tabs=data-annotations\">Entity Framework keys and data annotation</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.guid\">GUID</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3363.json",
    "content": "{\n  \"title\": \"Date and time should not be used as a type for primary keys\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"LOW\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3363\",\n  \"sqKey\": \"S3363\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3366.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>In single-threaded environments, the use of <code>this</code> in constructors is normal, and expected. But in multi-threaded environments, it could\nexpose partially-constructed objects to other threads, and should be used with caution.</p>\n<p>The classic example is a class with a <code>static</code> list of its instances. If the constructor stores <code>this</code> in the list, another\nthread could access the object before it’s fully-formed. Even when the storage of <code>this</code> is the last instruction in the constructor,\nthere’s still a danger if the class is not <code>final</code>. In that case, the initialization of subclasses won’t be complete before\n<code>this</code> is exposed.</p>\n<p>This rule raises an issue when <code>this</code> is assigned to any globally-visible object in a constructor, and when it is passed to the method\nof another object in a constructor</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic class Monument\n{\n  public static readonly List&lt;Monument&gt; ALL_MONUMENTS = new List&lt;Monument&gt;();\n  // ...\n\n  public Monument(string location, ...)\n  {\n    ALL_MONUMENTS.Add(this);  // Noncompliant; passed to a method of another object\n\n    this.location = location;\n    // ...\n  }\n}\n</pre>\n<h3>Exceptions</h3>\n<p>This rule ignores instances of assigning <code>this</code> directly to a <code>static</code> field of the same class because that case is covered\nby {rule:csharpsquid:S3010} .</p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3366.json",
    "content": "{\n  \"title\": \"\\\"this\\\" should not be exposed from constructors\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"tags\": [\n    \"multi-threading\",\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3366\",\n  \"sqKey\": \"S3366\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3376.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Adherence to the standard naming conventions makes your code not only more readable, but more usable. For instance, <code>class FirstAttribute :\nAttribute</code> can be used simply with <code>First</code>, but you must use the full name for <code>class AttributeOne : Attribute</code>.</p>\n<p>This rule raises an issue when classes extending <code>Attribute</code>, <code>EventArgs</code>, or <code>Exception</code>, do not end with their\nparent class names.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nclass AttributeOne : Attribute  // Noncompliant\n{\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nclass FirstAttribute : Attribute\n{\n}\n</pre>\n<h3>Exceptions</h3>\n<p>If a class' direct base class doesn’t follow the convention, then no issue is reported on the class itself, regardless of whether or not it\nconforms to the convention.</p>\n<pre>\nclass Timeout : Exception // Noncompliant\n{\n}\nclass ExtendedTimeout : Timeout // Ignored; doesn't conform to convention, but the direct base doesn't conform either\n{\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3376.json",
    "content": "{\n  \"title\": \"Attribute, EventArgs, and Exception type names should end with the type being extended\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3376\",\n  \"sqKey\": \"S3376\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3397.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><code>object.Equals()</code> overrides can be optimized by checking first for reference equality between <code>this</code> and the parameter. This\ncheck can be implemented by calling <code>object.ReferenceEquals()</code> or <code>base.Equals()</code>, where <code>base</code> is\n<code>object</code>. However, using <code>base.Equals()</code> is a maintenance hazard because while it works if you extend <code>Object</code>\ndirectly, if you introduce a new base class that overrides <code>Equals</code>, it suddenly stops working.</p>\n<p>This rule raises an issue if <code>base.Equals()</code> is used but <code>base</code> is not <code>object</code>.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nclass Base\n{\n  private int baseField;\n\n  public override bool Equals(object other)\n  {\n    if (base.Equals(other)) // Okay; base is object\n    {\n      return true;\n    }\n\n    return this.baseField == ((Base)other).baseField;\n  }\n}\n\nclass Derived : Base\n{\n  private int derivedField;\n\n  public override bool Equals(object other)\n  {\n    if (base.Equals(other))  // Noncompliant\n    {\n      return true;\n    }\n\n    return this.derivedField == ((Derived)other).derivedField;\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nclass Base\n{\n  private int baseField;\n\n  public override bool Equals(object other)\n  {\n    if (object.ReferenceEquals(this, other))  // base.Equals is okay here, but object.ReferenceEquals is better\n    {\n      return true;\n    }\n\n    return this.baseField == ((Base)other).baseField;\n  }\n}\n\nclass Derived : Base\n{\n  private int derivedField;\n\n  public override bool Equals(object other)\n  {\n    if (object.ReferenceEquals(this, other))\n    {\n      return true;\n    }\n\n    return base.Equals(other) &amp;&amp; this.derivedField == ((Derived)other).derivedField;\n  }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3397.json",
    "content": "{\n  \"title\": \"\\\"base.Equals\\\" should not be used to check for reference equality in \\\"Equals\\\" if \\\"base\\\" is not \\\"object\\\"\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"LOW\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3397\",\n  \"sqKey\": \"S3397\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3398.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When a <code>private static</code> method is only invoked by a nested class, there’s no reason not to move it into that class. It will still have\nthe same access to the outer class' static members, but the outer class will be clearer and less cluttered.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic class Outer\n{\n    private const int base = 42;\n\n    private static void Print(int num)  // Noncompliant - static method is only used by the nested class, should be moved there\n    {\n        Console.WriteLine(num + base);\n    }\n\n    public class Nested\n    {\n        public void SomeMethod()\n        {\n            Outer.Print(1);\n        }\n    }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic class Outer\n{\n    private const int base = 42;\n\n    public class Nested\n    {\n        public void SomeMethod()\n        {\n            Print(1);\n        }\n\n        private static void Print(int num)\n        {\n            Console.WriteLine(num + base);\n        }\n    }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3398.json",
    "content": "{\n  \"title\": \"\\\"private\\\" methods called only by inner classes should be moved to those classes\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"confusing\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3398\",\n  \"sqKey\": \"S3398\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3400.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>There’s no point in forcing the overhead of a method call for a method that always returns the same constant value. Even worse, the fact that a\nmethod call must be made will likely mislead developers who call the method thinking that something more is done. Declare a constant instead.</p>\n<p>This rule raises an issue if on methods that contain only one statement: the <code>return</code> of a constant value.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nint GetBestNumber()\n{\n  return 12;  // Noncompliant\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nconst int BestNumber = 12;\n</pre>\n<p>or</p>\n<pre>\nstatic readonly int BestNumber = 12;\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3400.json",
    "content": "{\n  \"title\": \"Methods should not return constants\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"confusing\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3400\",\n  \"sqKey\": \"S3400\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3415.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The standard assertions library methods such as <code>AreEqual</code> and <code>AreSame</code> in <strong>MSTest</strong> and\n<strong>NUnit</strong>, or <code>Equal</code> and <code>Same</code> in <strong>XUnit</strong>, expect the first argument to be the expected value and\nthe second argument to be the actual value.</p>\n<h3>What is the potential impact?</h3>\n<p>Having the expected value and the actual value in the wrong order will not alter the outcome of tests, (succeed/fail when it should) but the error\nmessages will contain misleading information.</p>\n<p>This rule raises an issue when the actual argument to an assertions library method is a hard-coded value and the expected argument is not.</p>\n<h2>How to fix it</h2>\n<p>You should provide the assertion methods with a hard-coded value as the expected value, while the actual value of the assertion should derive from\nthe portion of code that you want to test.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nAssert.AreEqual(runner.ExitCode, 0, \"Unexpected exit code\"); // Noncompliant; Yields error message like: Expected:&lt;-1&gt;. Actual:&lt;0&gt;.\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nAssert.AreEqual(0, runner.ExitCode, \"Unexpected exit code\");\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3415.json",
    "content": "{\n  \"title\": \"Assertion arguments should be passed in the correct order\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"tests\",\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3415\",\n  \"sqKey\": \"S3415\",\n  \"scope\": \"Tests\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3416.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>It is a well-established convention to name each logger after its enclosing type. This rule raises an issue when the convention is not\nrespected.</p>\n<pre>\nclass EnclosingType\n{\n    private readonly ILogger logger;\n\n    public EnclosingType(ILoggerFactory loggerFactory)\n    {\n        logger = loggerFactory.CreateLogger&lt;AnotherType&gt;();   // Noncompliant\n        logger = loggerFactory.CreateLogger&lt;EnclosingType&gt;(); // Compliant\n    }\n}\n</pre>\n<p>Not following such a convention can result in confusion and logging misconfiguration.</p>\n<p>For example, the person configuring the log may attempt to change the logging behavior for the <code>MyNamespace.EnclosingType</code> type, by\noverriding defaults for the logger named after that type.</p>\n<pre>\n{\n    \"Logging\": {\n        \"LogLevel\": {\n            \"Default\": \"Error\",\n            \"MyNamespace.EnclosingType\": \"Debug\"\n        }\n    }\n}\n</pre>\n<p>However, if the convention is not in place, the override would not affect logs from <code>MyNamespace.EnclosingType</code>, since they are made via\na logger with a different name.</p>\n<p>Moreover, using the same logger name for multiple types prevents the granular configuration of each type’s logger, since there is no way to\ndistinguish them in configuration.</p>\n<p>The rule targets the following logging frameworks: * <a href=\"https://learn.microsoft.com/en-us/dotnet/core/extensions/logging\">Microsoft\nExtensions Logging</a> * <a href=\"https://logging.apache.org/log4net/\">Apache log4net</a> * <a href=\"https://nlog-project.org/\">NLog</a></p>\n<h3>Exceptions</h3>\n<p>The rule doesn’t raise issues when custom handling of logging names is in place, and the logger name is not derived from a <code>Type</code>.</p>\n<pre>\nclass EnclosingType\n{\n    private readonly ILogger logger;\n\n    EnclosingType(ILoggerFactory loggerFactory)\n    {\n        logger = loggerFactory.CreateLogger(\"My cross-type logging category\");   // Compliant\n        logger = loggerFactory.CreateLogger(AComplexLogicToFindTheRightType());  // Compliant\n    }\n}\n</pre>\n<h2>How to fix it</h2>\n<p>When the logger name is defined by a generic type parameter:</p>\n<pre>\nclass EnclosingType\n{\n    private readonly ILogger logger;\n\n    public EnclosingType(ILoggerFactory loggerFactory)\n    {\n        logger = loggerFactory.CreateLogger&lt;AnotherType&gt;();   // Noncompliant\n        logger = loggerFactory.CreateLogger&lt;EnclosingType&gt;(); // Compliant\n    }\n}\n</pre>\n<p>When the logger name is defined by an input parameter of type <code>Type</code>:</p>\n<pre>\nclass EnclosingType\n{\n    private readonly ILogger logger;\n\n    public EnclosingType(ILoggerFactory loggerFactory)\n    {\n        logger = loggerFactory.CreateLogger(typeof(AnotherType));   // Noncompliant\n        logger = loggerFactory.CreateLogger(typeof(EnclosingType)); // Compliant\n        logger = loggerFactory.CreateLogger(GetType());             // Compliant\n    }\n}\n</pre>\n<p>When the logger name is a string, derived from a <code>Type</code>:</p>\n<pre>\nclass EnclosingType\n{\n    private readonly ILogger logger;\n\n    public EnclosingType(ILoggerFactory loggerFactory)\n    {\n        logger = loggerFactory.CreateLogger(typeof(AnotherType).Name);       // Noncompliant\n        logger = loggerFactory.CreateLogger(typeof(AnotherType).FullName);   // Noncompliant\n        logger = loggerFactory.CreateLogger(nameof(AnotherType));            // Noncompliant\n        // Fix by referring to the right type\n        logger = loggerFactory.CreateLogger(typeof(EnclosingType).Name);     // Compliant\n        logger = loggerFactory.CreateLogger(typeof(EnclosingType).FullName); // Compliant\n        logger = loggerFactory.CreateLogger(nameof(EnclosingType));          // Compliant\n        // or by retrieving the right type dynamically\n        logger = loggerFactory.CreateLogger(GetType().FullName);             // Compliant\n    }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/core/diagnostics/logging-tracing\">.NET logging and tracing</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/core/extensions/logging?tabs=command-line#log-category\">Logging in C# and\n  .NET - Log category</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/core/extensions/logging?tabs=command-line#configure-logging\">Logging in C#\n  and .NET - Configure logging</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.ilogger-1\">ILogger&lt;TCategoryName&gt;\n  Interface</a></li>\n  <li>Apache Logging - <a href=\"https://logging.apache.org/log4net/\">Apache log4net</a></li>\n  <li>NLog - <a href=\"https://nlog-project.org/\">Flexible &amp; free open-source logging for .NET</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li>Raygun Blog - <a href=\"https://raygun.com/blog/c-sharp-logging-best-practices/\">C# logging: Best practices in 2023 with examples and\n  tools</a></li>\n  <li>Apache Logging - <a href=\"https://logging.apache.org/log4net/manual/configuration.html\">Apache log4net Manual - Configuration</a></li>\n  <li>GitHub NLog repository - <a href=\"https://github.com/nlog/nlog/wiki/Tutorial#best-practices-for-using-nlog\">Best practices for using\n  NLog</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3416.json",
    "content": "{\n  \"title\": \"Loggers should be named for their enclosing types\",\n  \"type\": \"CODE_SMELL\",\n  \"status\": \"ready\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"confusing\",\n    \"logging\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3416\",\n  \"sqKey\": \"S3416\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3427.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The rules for method resolution can be complex and may not be fully understood by all developers. The situation becomes even more challenging when\ndealing with method overloads that have optional parameter values.</p>\n<p>This rule raises an issue when an overload with default parameter values is hidden by another overload that does not have the optional\nparameters.</p>\n<h3>What is the potential impact?</h3>\n<p>See the following example:</p>\n<pre>\nMyClass.Print(1);  // which overload of Print will be called?\n\npublic static class MyClass\n{\n  public static void Print(int number) { }\n  public static void Print(int number, string delimiter = \"\\n\") { } // Noncompliant, default parameter value is hidden by overload\n}\n</pre>\n<p>In this code snippet, the <code>Print</code> method is overloaded with two versions, where the first one hides the second one. This can lead to\nconfusion and uncertainty about which overload of the method will be invoked when calling it.</p>\n<h2>How to fix it</h2>\n<p>To address the problem you have a couple of options:</p>\n<ul>\n  <li>Adjust the existing overloads to expose the optional parameters consistently across all overloads. By doing so, callers will have explicit\n  control over which overload they want to invoke.</li>\n  <li>Alternatively, you can differentiate the overloads by giving them distinct names. This approach clarifies the usage and intent of each overload,\n  making it clear to developers which overload to use in different contexts.</li>\n</ul>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nMyClass.Print(1);  // which overload of Print will be called?\n\npublic static class MyClass\n{\n  public static void Print(int number) { }\n  public static void Print(int number, string delimiter = \"\\n\") { } // Noncompliant: default parameter value is hidden by overload\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nMyClass.PrintWithDelimiter(1);\n\npublic static class MyClass\n{\n  public static void Print(int number) { }\n  public static void PrintWithDelimiter(int number, string delimiter = \"\\n\") { } // Compliant\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/design-guidelines/member-overloading\">Member overloading</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/named-and-optional-arguments#optional-arguments\">Optional arguments</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li><a href=\"https://ericlippert.com/2011/05/09/optional-argument-corner-cases-part-one/\">Optional argument corner cases - Eric Lippert’s\n  blog</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3427.json",
    "content": "{\n  \"title\": \"Method overloads with default parameter values should not overlap\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"unused\",\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-3427\",\n  \"sqKey\": \"S3427\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3431.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>It should be clear to a casual reader what code a test is testing and what results are expected. Unfortunately, that’s not usually the case with\nthe <code>ExpectedException</code> attribute since an exception could be thrown from almost any line in the method.</p>\n<p>This rule detects MSTest and NUnit <code>ExpectedException</code> attribute.</p>\n<h3>Exceptions</h3>\n<p>This rule ignores:</p>\n<ul>\n  <li>single-line tests, since it is obvious in such methods where the exception is expected to be thrown</li>\n  <li>tests when it tests control flow and assertion are present in either a <code>catch</code> or <code>finally</code> clause</li>\n</ul>\n<pre>\n[TestMethod]\n[ExpectedException(typeof(InvalidOperationException))]\npublic void UsingTest()\n{\n    Console.ForegroundColor = ConsoleColor.Black;\n    try\n    {\n        using var _ = new ConsoleAlert();\n        Assert.AreEqual(ConsoleColor.Red, Console.ForegroundColor);\n        throw new InvalidOperationException();\n    }\n    finally\n    {\n        Assert.AreEqual(ConsoleColor.Black, Console.ForegroundColor); // The exception itself is not relevant for the test.\n    }\n}\n\npublic sealed class ConsoleAlert : IDisposable\n{\n    private readonly ConsoleColor previous;\n\n    public  ConsoleAlert()\n    {\n        previous = Console.ForegroundColor;\n        Console.ForegroundColor = ConsoleColor.Red;\n    }\n\n    public void Dispose() =&gt;\n        Console.ForegroundColor = previous;\n}\n</pre>\n<h2>How to fix it in MSTest</h2>\n<p>Remove the <code>ExpectedException</code> attribute in favor of using the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.visualstudio.testtools.unittesting.assert.throwsexception\">Assert.ThrowsException</a>\nassertion.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\n[TestMethod]\n[ExpectedException(typeof(ArgumentNullException))]  // Noncompliant\npublic void Method_NullParam()\n{\n    var sut = new MyService();\n    sut.Method(null);\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n[TestMethod]\npublic void Method_NullParam()\n{\n    var sut = new MyService();\n    Assert.ThrowsException&lt;ArgumentNullException&gt;(() =&gt; sut.Method(null));\n}\n</pre>\n<h2>How to fix it in NUnit</h2>\n<p>Remove the <code>ExpectedException</code> attribute in favor of using the <a\nhref=\"https://docs.nunit.org/articles/nunit/writing-tests/assertions/classic-assertions/Assert.Throws.html\">Assert.Throws</a> assertion.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\n[Test]\n[ExpectedException(typeof(ArgumentNullException))]  // Noncompliant\npublic void Method_NullParam()\n{\n    var sut = new MyService();\n    sut.Method(null);\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\n[Test]\npublic void Method_NullParam()\n{\n    var sut = new MyService();\n    Assert.Throws&lt;ArgumentNullException&gt;(() =&gt; sut.Method(null));\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.visualstudio.testtools.unittesting.assert.throwsexception\">Assert.ThrowsException\n  Method</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.visualstudio.testtools.unittesting.expectedexceptionattribute\">ExpectedExceptionAttribute Class</a></li>\n  <li>NUnit - <a href=\"https://docs.nunit.org/articles/nunit/writing-tests/assertions/classic-assertions/Assert.Throws.html\">Assert.Throws</a></li>\n  <li>NUnit - <a href=\"https://docs.nunit.org/2.4/exception.html\">ExpectedExceptionAttribute</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3431.json",
    "content": "{\n  \"title\": \"\\\"[ExpectedException]\\\" should not be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"tests\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3431\",\n  \"sqKey\": \"S3431\",\n  \"scope\": \"Tests\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3433.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>A method is identified as a test method if it is marked with one of the following attributes:</p>\n<ul>\n  <li><code>[TestMethod]</code> or <code>[DataTestMethod]</code> (for <strong>MSTest</strong>).</li>\n  <li><code>[Fact]</code> or <code>[Theory]</code> (for <strong>xUnit</strong>).</li>\n  <li><code>[Test]</code>, <code>[TestCase]</code>, <code>[TestCaseSource]</code>, or <code>[Theory]</code> (for <strong>NUnit</strong>).</li>\n</ul>\n<p>However, non-<code>public</code> methods are not considered test methods and will not be executed, regardless of whether they have a test\nattribute. Additionally, methods with the <code>async void</code> modifier or methods that contain generics <code>&lt;T&gt;</code> anywhere in their\nsignatures are also excluded from being recognized as tests and will not be executed.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\n[TestMethod]\nvoid TestNullArg()  // Noncompliant, method is not public\n{  /* ... */  }\n\n[TestMethod]\npublic async void MyIgnoredTestMethod()  // Noncompliant, this is an 'async void' method\n{ /* ... */ }\n\n[TestMethod]\npublic void MyIgnoredGenericTestMethod&lt;T&gt;(T foo)  // Noncompliant, method has generics in its signature\n{ /* ... */ }\n</pre>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n[TestMethod]\npublic void TestNullArg()\n{  /* ... */  }\n\n[TestMethod]\npublic async Task MyIgnoredTestMethod()\n{ /* ... */ }\n\n[TestMethod]\npublic void MyIgnoredGenericTestMethod(int foo)\n{ /* ... */ }\n</pre>\n<h3>Exceptions</h3>\n<p>For <strong>xUnit</strong>, accessibility is disregarded when it comes to <code>[Fact]</code> test methods, as they do not necessarily need to be\ndeclared as <code>public</code>.</p>\n<p>In <strong>xUnit</strong>, <code>[Theory]</code> test methods, as well as <code>[TestCase]</code> and <code>[TestCaseSource]</code> test methods in\n<strong>NUnit</strong>, have the flexibility to be generic, allowing for a wider range of test scenarios.</p>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-with-mstest\">Unit testing C# with MSTest</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-with-nunit\">Unit testing C# with NUnit</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-with-dotnet-test\">Unit testing C# with xUnit</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3433.json",
    "content": "{\n  \"title\": \"Test method signatures should be correct\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"tests\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-3433\",\n  \"sqKey\": \"S3433\",\n  \"scope\": \"Tests\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3440.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>There’s no point in checking a variable against the value you’re about to assign it. Save the cycles and lines of code, and simply perform the\nassignment.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nif (x != a)  // Noncompliant; why bother?\n{\n    x = a;\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nx = a;\n</pre>\n<h3>Exceptions</h3>\n<p>Properties and checks inside setters are excluded from this rule because they could have side effects and removing the check could lead to\nundesired side effects.</p>\n<pre>\nif (MyProperty != a)\n{\n    MyProperty = a; // Compliant because the setter could be expensive call\n}\n</pre>\n<pre>\nprivate int myField;\npublic int SomeProperty\n{\n    get\n    {\n        return myField;\n    }\n    set\n    {\n        if (myField != value)\n        {\n            myField = value;\n        }\n    }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3440.json",
    "content": "{\n  \"title\": \"Variables should not be checked against the values they\\u0027re about to be assigned\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"confusing\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3440\",\n  \"sqKey\": \"S3440\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3441.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When an anonymous type’s properties are copied from properties or variables with the same names, it yields cleaner code to omit the new type’s\nproperty name and the assignment operator.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nvar X = 5;\n\nvar anon = new\n{\n  X = X, //Noncompliant, the new object would have the same property without the \"X =\" part.\n  Y = \"my string\"\n};\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nvar X = 5;\n\nvar anon = new\n{\n  X,\n  Y = \"my string\"\n};\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3441.json",
    "content": "{\n  \"title\": \"Redundant property names should be omitted in anonymous classes\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"finding\",\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3441\",\n  \"sqKey\": \"S3441\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3442.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/abstract\">abstract</a> modifier in a class declaration is\nused to indicate that a class is intended only to be a base class of other classes, not instantiated on its own.</p>\n<p>Since <code>abstract</code> classes cannot be instantiated, there is no need for <code>public</code> or <code>internal</code> constructors. If\nthere is basic initialization logic that should run when an extending class instance is created, you can add it in a <code>private</code>,\n<code>private protected</code> or <code>protected</code> constructor.</p>\n<h2>How to fix it</h2>\n<p>Restrict the constructor visibility to the minimum: <code>private</code>, <code>private protected</code> or <code>protected</code>, depending on\nthe usage.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nabstract class Base\n{\n    public Base() // Noncompliant: should be private, private protected or protected.\n    {\n      //...\n    }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nabstract class Base\n{\n    protected Base()\n    {\n      //...\n    }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/abstract\">abstract keyword</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Abstract_type\">abstract type</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3442.json",
    "content": "{\n  \"title\": \"\\\"abstract\\\" classes should not have \\\"public\\\" constructors\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"confusing\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3442\",\n  \"sqKey\": \"S3442\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3443.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Calling <code>GetType</code> on a <code>Type</code> variable will always return the <code>System.Type</code> representation, which is equivalent to\n<code>typeof(System.Type)</code>. This also applies to passing a <code>Type</code> argument to <code>IsInstanceOfType</code> which always returns\n<code>false</code>.</p>\n<p>In both cases, the results are entirely predictable and should be avoided.</p>\n<h3>Exceptions</h3>\n<p>Calling <code>GetType</code> on <code>System.Type</code> is considered compliant to get an instance of <code>System.RuntimeType</code>, as\ndemonstrated in the following example:</p>\n<pre>\ntypeof(Type).GetType(); // Can be used by convention to get an instance of 'System.RuntimeType'\n</pre>\n<h2>How to fix it</h2>\n<p>Make sure the usage of <code>GetType</code> or <code>IsInstanceOfType</code> is invoked with the correct variable or argument type.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nvoid ExamineSystemType(string str)\n{\n    Type stringType = str.GetType();\n    Type runtimeType = stringType.GetType(); // Noncompliant\n\n    if (stringType.IsInstanceOfType(typeof(string))) // Noncompliant; will always return false\n    { /* ... */ }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nvoid ExamineSystemType(string str)\n{\n    Type stringType = str.GetType();\n\n    if (stringType.IsInstanceOfType(str)) // Compliant\n    { /* ... */ }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.type\">\"Type\" class</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.object.gettype\">\"GetType\" Method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.type.isinstanceoftype\">\"IsInstanceOfType\" Method</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li><a href=\"https://stackoverflow.com/a/5737947\">Difference between \"System.Type\" and \"System.RuntimeType\"</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3443.json",
    "content": "{\n  \"title\": \"Type should not be examined on \\\"System.Type\\\" instances\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-3443\",\n  \"sqKey\": \"S3443\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3444.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When an interface inherits from two interfaces that both define a member with the same name, trying to access that member through the derived\ninterface will result in the compiler error <code>CS0229 Ambiguity between 'IBase1.SomeProperty' and 'IBase2.SomeProperty'</code>.</p>\n<p>So instead, every caller will be forced to cast instances of the derived interface to one or the other of its base interfaces to resolve the\nambiguity and be able to access the member. Instead, it is better to resolve the ambiguity in the definition of the derived interface either by:</p>\n<ul>\n  <li>renaming the member in one of the base interfaces to remove the collision</li>\n  <li>also defining that member in the derived interface. Use this only if all copies of the member are meant to hold the same value.</li>\n</ul>\n<h3>Noncompliant code example</h3>\n<pre>\npublic interface IBase1\n{\n  string SomeProperty { get; set; }\n}\n\npublic interface IBase2\n{\n  string SomeProperty { get; set; }\n}\n\npublic interface IDerived : IBase1, IBase2 // Noncompliant, accessing IDerived.SomeProperty is ambiguous\n{\n}\n\npublic class MyClass : IDerived\n{\n  // Implements both IBase1.SomeProperty and IBase2.SomeProperty\n  public string SomeProperty { get; set; } = \"Hello\";\n\n  public static void Main()\n  {\n    MyClass myClass = new MyClass();\n    Console.WriteLine(myClass.SomeProperty); // Writes \"Hello\" as expected\n    Console.WriteLine(((IBase1)myClass).SomeProperty); // Writes \"Hello\" as expected\n    Console.WriteLine(((IBase2)myClass).SomeProperty); // Writes \"Hello\" as expected\n    Console.WriteLine(((IDerived)myClass).SomeProperty); // Error CS0229 Ambiguity between 'IBase1.SomeProperty' and 'IBase2.SomeProperty'\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic interface IDerived : IBase1, IBase2\n{\n  new string SomeProperty { get; set; }\n}\n\npublic class MyClass : IDerived\n{\n  // Implements IBase1.SomeProperty, IBase2.SomeProperty and IDerived.SomeProperty\n  public string SomeProperty { get; set; } = \"Hello\";\n\n  public static void Main()\n  {\n    MyClass myClass = new MyClass();\n    Console.WriteLine(myClass.SomeProperty); // Writes \"Hello\" as expected\n    Console.WriteLine(((IBase1)myClass).SomeProperty); // Writes \"Hello\" as expected\n    Console.WriteLine(((IBase2)myClass).SomeProperty); // Writes \"Hello\" as expected\n    Console.WriteLine(((IDerived)myClass).SomeProperty); // Writes \"Hello\" as expected\n  }\n}\n</pre>\n<p>or</p>\n<pre>\npublic interface IBase1\n{\n  string SomePropertyOne { get; set; }\n}\n\npublic interface IBase2\n{\n  string SomePropertyTwo { get; set; }\n}\n\npublic interface IDerived : IBase1, IBase2\n{\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3444.json",
    "content": "{\n  \"title\": \"Interfaces should not simply inherit from base interfaces with colliding members\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"design\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3444\",\n  \"sqKey\": \"S3444\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3445.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>In C#, the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/statements#13106-the-throw-statement\">throw</a>\nstatement can be used in two different ways:</p>\n<ul>\n  <li>by specifying an expression</li>\n  <li>without specifying an expression</li>\n</ul>\n<h3>By specifying an expression</h3>\n<p>In the software development context, an expression is a value or anything that executes and ends up being a value. The expression shall be\nimplicitly convertible to <code>System.Exception</code>, and the result of evaluating the expression is converted to <code>System.Exception</code>\nbefore being thrown.</p>\n<pre>\ntry\n{\n}\ncatch(Exception exception)\n{\n  // code that uses the exception\n  throw exception; // The exception stack trace is cleared up to this point.\n}\n</pre>\n<p>In this case, the <a href=\"https://en.wikipedia.org/wiki/Stack_trace\">stack trace</a>, will be cleared, losing the list of method calls between the\noriginal method that threw the exception and the current method.</p>\n<h3>Without specifying an expression</h3>\n<p>This syntax is supported only in a <code>catch</code> block, in which case, that statement re-throws the exception currently being handled by that\n<code>catch</code> block, preserving the stack trace.</p>\n<pre>\ntry\n{\n}\ncatch(Exception exception)\n{\n  // code that uses the exception\n  throw; // The stack trace of the initial exception is preserved.\n}\n</pre>\n<h3>Exceptions</h3>\n<p>It is allowed using the thrown <code>exception</code> as an argument and wrapping it in another <code>exception</code>.</p>\n<pre>\ntry\n{\n}\ncatch(Exception exception)\n{\n  throw new Exception(\"Additional information\", exception);\n}\n</pre>\n<h2>How to fix it</h2>\n<p>The recommended way to re-throw an exception is to use the throw statement without including an expression. This ensures that all call stack\ninformation is preserved when the exception is propagated to the caller, making debugging easier.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\ntry\n{\n}\ncatch(Exception exception)\n{\n  throw exception;\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\ntry\n{\n}\ncatch(Exception)\n{\n  throw;\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.exception#re-throwing-an-exception\">Re-throwing an exception</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/statements#13106-the-throw-statement\">The\n  throw statement</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Stack_trace\">stack trace</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3445.json",
    "content": "{\n  \"title\": \"Exceptions should not be explicitly rethrown\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"error-handling\",\n    \"confusing\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3445\",\n  \"sqKey\": \"S3445\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3447.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The use of <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/ref\">ref</a> or <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/out-parameter-modifier\">out</a> in combination with <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.optionalattribute\">Optional</a> attribute is both confusing and\ncontradictory. <code>[Optional]</code> indicates that the parameter doesn’t have to be provided, while <code>out</code> and <code>ref</code> mean that\nthe parameter will be used to return data to the caller (<code>ref</code> additionally indicates that the parameter may also be used to pass data into\nthe method).</p>\n<p>Thus, making it <code>[Optional]</code> to provide the parameter in which you will be passing back the method results doesn’t make sense. In fact,\nthe compiler will raise an error on such code. Unfortunately, it raises the error on method calls where the <code>[Optional]</code> parameter has been\nomitted, not the source of the problem, the method declaration.</p>\n<h3>Noncompliant code example</h3>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nclass MyClass\n{\n  public void DoStuff([Optional] ref int i) // Noncompliant\n  {\n    Console.WriteLine(i);\n  }\n\n  public static void Main()\n  {\n    new MyClass().DoStuff(); // Compilation Error [CS7036]\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nclass MyClass\n{\n  public void DoStuff(ref int i)\n  {\n    Console.WriteLine(i);\n  }\n\n  public static void Main()\n  {\n    var i = 42;\n    new MyClass().DoStuff(ref i);\n  }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/ref\">ref keyword</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/out-parameter-modifier\">out parameter modifier</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.optionalattribute\">OptionalAttribute</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3447.json",
    "content": "{\n  \"title\": \"\\\"[Optional]\\\" should not be used on \\\"ref\\\" or \\\"out\\\" parameters\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-3447\",\n  \"sqKey\": \"S3447\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3449.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Numbers can be shifted with the <code>&lt;&lt;</code> and <code>&gt;&gt;</code> <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/bitwise-and-shift-operators#left-shift-operator-\">operators</a>,\nbut the right operand of the operation needs to be an <code>int</code> or a type that has an <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/conversions#102-implicit-conversions\">implicit\nconversion</a> to <code>int</code>. However, when the left operand is <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/advanced-topics/interop/using-type-dynamic\">dynamic</a>, the compiler’s type checking is turned\noff, so you can pass anything to the right of a shift operator and have it compile. And if the argument can’t be implicitly converted to\n<code>int</code> at runtime, then a <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.csharp.runtimebinder.runtimebinderexception\">RuntimeBinderException</a> will be\nraised.</p>\n<pre>\ndynamic d = 5;\nvar x = d &gt;&gt; 5.4;   // Noncompliant\nx = d &lt;&lt; null;      // Noncompliant\nx &lt;&lt;= new object(); // Noncompliant\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/bitwise-and-shift-operators#left-shift-operator-\">Shift\n  Operators</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/conversions#102-implicit-conversions\">Implicit\n  Conversions</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.csharp.runtimebinder.runtimebinderexception\">RuntimeBinderException\n  Class</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/advanced-topics/interop/using-type-dynamic\">Using type dynamic</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3449.json",
    "content": "{\n  \"title\": \"Right operands of shift operators should be integers\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-3449\",\n  \"sqKey\": \"S3449\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3450.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>There is no point in providing a default value for a parameter if callers are required to provide a value for it anyway. Thus,\n<code>[DefaultParameterValue]</code> should always be used in conjunction with <code>[Optional]</code>.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic void MyMethod([DefaultParameterValue(5)] int j) //Noncompliant, useless\n{\n  Console.WriteLine(j);\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic void MyMethod(int j = 5)\n{\n  Console.WriteLine(j);\n}\n</pre>\n<p>or</p>\n<pre>\npublic void MyMethod([DefaultParameterValue(5)][Optional] int j)\n{\n  Console.WriteLine(j);\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3450.json",
    "content": "{\n  \"title\": \"Parameters with \\\"[DefaultParameterValue]\\\" attributes should also be marked \\\"[Optional]\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3450\",\n  \"sqKey\": \"S3450\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3451.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.defaultvalueattribute\">DefaultValue</a> does not make the compiler set\nthe default value, as its name may suggest. What you probably wanted to use is <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.defaultparametervalueattribute\">DefaultParameterValue</a>.</p>\n<p>The <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.defaultvalueattribute\">DefaultValue</a> attribute from the\n<code>System.ComponentModel</code> namespace, is sometimes used to declare a member’s default value. This can be used, for instance, by the reset\nfeature of a visual designer or by a code generator.</p>\n<pre>\npublic void DoStuff([DefaultValue(4)] int i)\n{\n    // i is not automatically assigned 4\n}\n</pre>\n<p>The <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.optionalattribute\">Optional</a> attribute from the\n<code>System.Runtime.InteropServices</code> namespace is sometimes used to indicate that a parameter is optional, as an alternative to the\nlanguage-specific construct.</p>\n<pre>\npublic void DoStuff([Optional] int i)\n{\n    // i would be assigned default(int) = 0\n}\n</pre>\n<p>The use of <code>[DefaultValue]</code> with <code>[Optional]</code> has no more effect than <code>[Optional]</code> alone. That’s because\n<code>[DefaultValue]</code> doesn’t actually do anything; it merely indicates the intent for the value.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nclass MyClass\n{\n    public void DoStuff([Optional][DefaultValue(4)] int i, int j = 5)  // Noncompliant\n    {\n        Console.WriteLine(i);\n    }\n\n    public static void Main()\n    {\n        new MyClass().DoStuff(); // prints 0, since [DefaultValue] doesn't actually set the default, and default(int) is used instead\n    }\n}\n</pre>\n<p>More than likely, <code>[DefaultValue]</code> was used in confusion instead of <code>[DefaultParameterValue]</code>, the language-agnostic version\nof the default parameter initialization mechanism provided by C#.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nclass MyClass\n{\n    public void DoStuff([Optional][DefaultParameterValue(4)] int i, int j = 5)\n    {\n        Console.WriteLine(i);\n    }\n\n    public static void Main()\n    {\n        new MyClass().DoStuff(); // prints 4\n    }\n}\n</pre>\n<p>Notice that you can’t use both <code>[DefaultParameterValue]</code> and default parameter initialization on the same parameter.</p>\n<pre>\nvoid DoStuff([Optional][DefaultParameterValue(4)] int i = 5) // Error CS1745 Cannot specify default parameter value in conjunction with DefaultParameterAttribute or OptionalAttribute\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.optionalattribute\">OptionalAttribute Class</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.defaultvalueattribute\">DefaultValueAttribute Class</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.defaultparametervalueattribute\">DefaultParameterValueAttribute\n  Class</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/named-and-optional-arguments#optional-arguments\">Optional arguments (C# Programming Guide)</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li><a href=\"https://stackoverflow.com/questions/40171095/use-optional-defaultparametervalue-attribute-or-not\">Stack Overflow - Use \"Optional,\n  DefaultParameterValue\" attribute, or not?</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3451.json",
    "content": "{\n  \"title\": \"\\\"[DefaultValue]\\\" should not be used when \\\"[DefaultParameterValue]\\\" is meant\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-3451\",\n  \"sqKey\": \"S3451\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3453.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When a class has only a <code>private</code> constructor, it can’t be instantiated except within the class itself. Such classes can be considered\n<a href=\"https://en.wikipedia.org/wiki/Dead_code\">dead code</a> and should be fixed</p>\n<h3>Exceptions</h3>\n<ul>\n  <li>Classes that access their private constructors (<a href=\"https://en.wikipedia.org/wiki/Singleton_pattern\">singletons</a> or <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/architecture/microservices/microservice-ddd-cqrs-patterns/enumeration-classes-over-enum-types\">smart\n  enums</a>) are ignored.</li>\n  <li>Classes with only <code>static</code> members are also ignored because they are covered by Rule {rule:csharpsquid:S1118}.</li>\n  <li>Classes that derive from <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.safehandle\">SafeHandle</a> since\n  they can be instantiate through <a href=\"https://learn.microsoft.com/en-us/dotnet/standard/native-interop/pinvoke\">P/Invoke</a>.</li>\n</ul>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic class MyClass // Noncompliant: the class contains only private constructors\n{\n  private MyClass() { ... }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic class MyClass // Compliant: the class contains at least one non-private constructor\n{\n  public MyClass() { ... }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>{rule:csharpsquid:S1118} - Utility classes should not have public constructors</li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.safehandle\">SafeHandle Class</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/standard/native-interop/pinvoke\">Platform Invoke (P/Invoke)</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/architecture/microservices/microservice-ddd-cqrs-patterns/enumeration-classes-over-enum-types\">Use\n  enumeration classes instead of enum types</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Dead_code\">Dead code</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Singleton_pattern\">Singleton pattern</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li>C# in Depth - <a href=\"https://csharpindepth.com/articles/singleton\">Implementing the Singleton Pattern in C#</a></li>\n  <li>Medium - <a href=\"https://medium.com/null-exception/making-enums-smarter-in-c-518108cdaa73\">Making enums smarter in C#</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3453.json",
    "content": "{\n  \"title\": \"Classes should not have only \\\"private\\\" constructors\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"design\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3453\",\n  \"sqKey\": \"S3453\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3456.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The <code>string</code> type offers an indexer property that allows you to treat it as a <code>char</code> array. Therefore, if you just need to\naccess a specific character or iterate over all of them, the <code>ToCharArray</code> call should be omitted. For these cases, not omitting makes the\ncode harder to read and less efficient as <code>ToCharArray</code> copies the characters from the <code>string</code> object into a new Unicode\ncharacter array.</p>\n<p>The same principle applies to <a href=\"https://devblogs.microsoft.com/dotnet/csharp-11-preview-updates/#utf-8-string-literals\">utf-8 literals\ntypes</a> (<code>ReadOnlySpan&lt;byte&gt;</code>, <code>Span&lt;byte&gt;</code>) and the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.span-1.toarray?view=net-7.0\"><code>ToArray</code></a> method.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nstring str = \"some string\";\nforeach (var c in str.ToCharArray()) // Noncompliant\n{\n  // ...\n}\n\nReadOnlySpan&lt;byte&gt; span = \"some UTF-8 string literal\"u8;\nforeach (var c in span.ToArray()) // Noncompliant\n{\n  // ...\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nstring str = \"some string\";\nforeach (var c in str)\n{\n  // ...\n}\n\nReadOnlySpan&lt;byte&gt; span = \"some UTF-8 string literal\"u8;\nforeach (var b in span) // Compliant\n{\n  // ...\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.tochararray\">String.ToCharArray Method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/strings/#accessing-individual-characters\">Accessing individual\n  characters</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-11.0/utf8-string-literals\">UTF-8 Strings\n  literals</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3456.json",
    "content": "{\n  \"title\": \"\\\"string.ToCharArray()\\\" and \\\"ReadOnlySpan\\u003cT\\u003e.ToArray()\\\" should not be called redundantly\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3456\",\n  \"sqKey\": \"S3456\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3457.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>A <a href=\"https://learn.microsoft.com/en-us/dotnet/standard/base-types/composite-formatting\">composite format string</a> is a string that contains\nplaceholders, represented by indices inside curly braces \"{0}\", \"{1}\", etc. These placeholders are replaced by values when the string is printed or\nlogged.</p>\n<p>Because composite format strings are interpreted at runtime, rather than validated by the compiler, they can contain errors that lead to unexpected\nbehaviors or runtime errors.</p>\n<p>This rule validates the correspondence between arguments and composite formats when calling the following methods:</p>\n<ul>\n  <li> <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.format\"><code>String.Format</code></a> </li>\n  <li> <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.text.stringbuilder.appendformat\"><code>StringBuilder.AppendFormat</code></a> </li>\n  <li> <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.console.write\"><code>Console.Write</code></a> </li>\n  <li> <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.console.writeline\"><code>Console.WriteLine</code></a> </li>\n  <li> <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.io.textwriter.write\"><code>TextWriter.Write</code></a> </li>\n  <li> <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.io.textwriter.writeline\"><code>TextWriter.WriteLine</code></a> </li>\n  <li> <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.debug.writeline\"><code>Debug.WriteLine(String, Object[])</code></a>\n  </li>\n  <li> <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.traceerror\"><code>Trace.TraceError(String, Object[])</code></a>\n  </li>\n  <li> <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.traceinformation\"><code>Trace.TraceInformation(String, Object[])</code></a> </li>\n  <li> <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.tracewarning\"><code>Trace.TraceWarning(String, Object[])</code></a>\n  </li>\n  <li> <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.tracesource.traceinformation\"><code>TraceSource.TraceInformation(String, Object[])</code></a> </li>\n</ul>\n<h3>Exceptions</h3>\n<ul>\n  <li> No issue is raised if the format string is not a string literal, but comes from a variable. </li>\n</ul>\n<pre>\nvar pattern = \"{0} {1} {2}\";\nvar res = string.Format(pattern, 1, 2); // Incorrect, but the analyzer doesn't raise any warnings here\n</pre>\n<ul>\n  <li> No issue is raised if the argument is not an inline created array. </li>\n</ul>\n<pre>\nvar array = new int[] {};\nvar res = string.Format(\"{0} {1}\", array); // Compliant; we don't know the size of the array\n</pre>\n<ul>\n  <li> This rule doesn’t check whether the format specifier (defined after the <code>:</code>) is actually valid. </li>\n</ul>\n<h2>How to fix it</h2>\n<p>A composite format string contains placeholders, replaced by values when the string is printed or logged. Mismatch in the format specifiers and the\narguments provided can lead to incorrect strings being created.</p>\n<p>To avoid issues, a developer should ensure that the provided arguments match format specifiers.</p>\n<p>Moreover, use <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/tutorials/string-interpolation\">string interpolation</a> when possible.</p>\n<p>Instead of</p>\n<pre>\nstring str = string.Format(\"Hello {0} {1}!\", firstName, lastName);\n</pre>\n<p>use</p>\n<pre>\nstring str = $\"Hello {firstName} {lastName}!\";\n</pre>\n<p>With string interpolation:</p>\n<ul>\n  <li> the arguments are validated at compilation time rather than runtime </li>\n  <li> modern code editors provide auto-completion when typing the interpolation expression </li>\n</ul>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\ns = string.Format(\"{0}\", arg0, arg1); // Noncompliant, arg1 is declared but not used.\ns = string.Format(\"{0} {2}\", arg0, arg1, arg2); // Noncompliant, the format item with index 1 is missing, so arg1 will not be used.\ns = string.Format(\"foo\"); // Noncompliant; there is no need to use \"string.Format\" here.\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\ns = string.Format(\"{0}\", arg0);\ns = string.Format(\"{0} {1}\", arg0, arg2);\ns = \"foo\";\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3457.json",
    "content": "{\n  \"title\": \"Composite format strings should be used correctly\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1min\"\n  },\n  \"tags\": [\n    \"confusing\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3457\",\n  \"sqKey\": \"S3457\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3458.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Empty <code>case</code> clauses that fall through to the default are useless. Whether or not such a <code>case</code> is present, the\n<code>default</code> clause will be invoked. Such <code>case</code>s simply clutter the code, and should be removed.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nswitch(ch)\n{\n  case 'a' :\n    HandleA();\n    break;\n  case 'b' :\n    HandleB();\n    break;\n  case 'c' :  // Noncompliant\n  default:\n    HandleTheRest();\n    break;\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nswitch(ch)\n{\n  case 'a' :\n    HandleA();\n    break;\n  case 'b' :\n    HandleB();\n    break;\n  default:\n    HandleTheRest();\n    break;\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3458.json",
    "content": "{\n  \"title\": \"Empty \\\"case\\\" clauses that fall through to the \\\"default\\\" should be omitted\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1min\"\n  },\n  \"tags\": [\n    \"finding\",\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3458\",\n  \"sqKey\": \"S3458\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3459.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Fields and auto-properties that are never assigned to hold the default values for their types. They are either pointless code or, more likely,\nmistakes.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nclass MyClass\n{\n  private int field; // Noncompliant, shouldn't it be initialized? This way the value is always default(int), 0.\n  private int Property { get; set; }  // Noncompliant\n  public void Print()\n  {\n    Console.WriteLine(field); //Will always print 0\n    Console.WriteLine(Property); //Will always print 0\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nclass MyClass\n{\n  private int field = 1;\n  private int Property { get; set; } = 42;\n  public void Print()\n  {\n    field++;\n    Console.WriteLine(field);\n    Console.WriteLine(Property);\n  }\n}\n</pre>\n<h3>Exceptions</h3>\n<ul>\n  <li>Fields on types decorated with <code>System.SerializableAttribute</code> attribute.</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3459.json",
    "content": "{\n  \"title\": \"Unassigned members should be removed\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3459\",\n  \"sqKey\": \"S3459\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3464.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><a href=\"https://en.wikipedia.org/wiki/Recursion\">Recursion</a> is a technique used to define a problem in terms of the problem itself, usually in\nterms of a simpler version of the problem itself.</p>\n<p>For example, the implementation of the generator for the n-th value of the <a href=\"https://en.wikipedia.org/wiki/Fibonacci_sequence\">Fibonacci\nsequence</a> comes naturally from its mathematical definition, when recursion is used:</p>\n<pre>\nint NthFibonacciNumber(int n)\n{\n    if (n &lt;= 1)\n    {\n        return 1;\n    }\n    else\n    {\n        return NthFibonacciNumber(n - 1) + NthFibonacciNumber(n - 2);\n    }\n}\n</pre>\n<p>As opposed to:</p>\n<pre>\nint NthFibonacciNumber(int n)\n{\n    int previous = 0;\n\tint last = 1;\n\tfor (var i = 0; i &lt; n; i++)\n\t{\n        (previous, last) = (last, last + previous);\n\t}\n\treturn last;\n}\n</pre>\n<p>The use of recursion is acceptable in methods, like the one above, where you can break out of it.</p>\n<pre>\nint NthFibonacciNumber(int n)\n{\n    if (n &lt;= 1)\n    {\n        return 1; // Base case: stop the recursion\n    }\n    // ...\n}\n</pre>\n<p>It is also acceptable and makes sense in some type definitions:</p>\n<pre>\nclass Box : IComparable&lt;Box&gt;\n{\n    public int CompareTo(Box? other)\n    {\n        // Compare the two Box instances...\n    }\n}\n</pre>\n<p>With types, some invalid recursive definitions are caught by the compiler:</p>\n<pre>\nclass C2&lt;T&gt; : C2&lt;T&gt;     // Error CS0146: Circular base type dependency\n{\n}\n\nclass C2&lt;T&gt; : C2&lt;C2&lt;T&gt;&gt; // Error CS0146: Circular base type dependency\n{\n}\n</pre>\n<p>In more complex scenarios, however, the code will compile but execution will result in a <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.typeloadexception\">TypeLoadException</a> if you try to instantiate the class.</p>\n<pre>\nclass C1&lt;T&gt;\n{\n}\n\nclass C2&lt;T&gt; : C1&lt;C2&lt;C2&lt;T&gt;&gt;&gt; // Noncompliant\n{\n}\n\nvar c2 = new C2&lt;int&gt;();     // This would result into a TypeLoadException\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Recursion_(computer_science)\">Recursion</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.typeloadexception\">TypeLoadException</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern\">Curiously recurring template pattern</a></li>\n  <li><a href=\"https://blog.stephencleary.com/2022/09/modern-csharp-techniques-1-curiously-recurring-generic-pattern.html\">Modern C# Techniques, Part\n  1: Curiously Recurring Generic Pattern</a></li>\n  <li><a href=\"https://ericlippert.com/2011/02/02/curiouser-and-curiouser/\">Curiouser and curiouser</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3464.json",
    "content": "{\n  \"title\": \"Type inheritance should not be recursive\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1h\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-3464\",\n  \"sqKey\": \"S3464\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3466.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When optional parameter values are not passed to base method calls, the value passed in by the caller is ignored. This can cause the function to\nbehave differently than expected, leading to errors and making the code difficult to debug.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic class BaseClass\n{\n    public virtual void MyMethod(int i = 1)\n    {\n        Console.WriteLine(i);\n    }\n}\n\npublic class DerivedClass : BaseClass\n{\n    public override void MyMethod(int i = 1)\n    {\n        // ...\n        base.MyMethod(); // Noncompliant: caller's value is ignored\n    }\n\n    static int Main(string[] args)\n    {\n        DerivedClass dc = new DerivedClass();\n        dc.MyMethod(12);  // prints 1\n    }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic class BaseClass\n{\n    public virtual void MyMethod(int i = 1)\n    {\n        Console.WriteLine(i);\n    }\n}\n\npublic class DerivedClass : BaseClass\n{\n    public override void MyMethod(int i = 1)\n    {\n        // ...\n        base.MyMethod(i);\n    }\n\n    static int Main(string[] args)\n    {\n        DerivedClass dc = new DerivedClass();\n        dc.MyMethod(12);  // prints 12\n    }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<p>Microsoft Learn - <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/named-and-optional-arguments#optional-arguments\">Optional\nArguments</a></p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3466.json",
    "content": "{\n  \"title\": \"Optional parameters should be passed to \\\"base\\\" calls\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3466\",\n  \"sqKey\": \"S3466\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3532.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The <code>default</code> clause should take appropriate action. Having an empty <code>default</code> is a waste of keystrokes.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nenum Fruit\n{\n  Apple,\n  Orange,\n  Banana\n}\n\nvoid PrintName(Fruit fruit)\n{\n  switch(fruit)\n  {\n    case Fruit.Apple:\n      Console.WriteLine(\"apple\");\n      break;\n    default:  //Noncompliant\n      break;\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nenum Fruit\n{\n  Apple,\n  Orange,\n  Banana\n}\n\nvoid PrintName(Fruit fruit)\n{\n  switch(fruit)\n  {\n    case Fruit.Apple:\n      Console.WriteLine(\"apple\");\n      break;\n    default:\n      throw new NotSupportedException();\n  }\n}\n</pre>\n<p>or</p>\n<pre>\nvoid PrintName(Fruit fruit)\n{\n  switch(fruit)\n  {\n    case Fruit.Apple:\n      Console.WriteLine(\"apple\");\n      break;\n  }\n}\n</pre>\n<h3>Exceptions</h3>\n<p><code>default</code> clauses containing only a comment are ignored with the assumption that they are empty on purpose and the comment documents\nwhy.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3532.json",
    "content": "{\n  \"title\": \"Empty \\\"default\\\" clauses should be removed\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \" 1min\"\n  },\n  \"tags\": [\n    \"unused\",\n    \"finding\",\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3532\",\n  \"sqKey\": \"S3532\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3597.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The <code>ServiceContract</code> attribute specifies that a class or interface defines the communication contract of a Windows Communication\nFoundation (WCF) service. The service operations of this class or interface are defined by <code>OperationContract</code> attributes added to methods.\nIt doesn’t make sense to define a contract without any service operations; thus, in a <code>ServiceContract</code> class or interface at least one\nmethod should be annotated with <code>OperationContract</code>. Similarly, WCF only serves <code>OperationContract</code> methods that are defined\ninside <code>ServiceContract</code> classes or interfaces; thus, this rule also checks that <code>ServiceContract</code> is added to the containing\ntype of <code>OperationContract</code> methods.</p>\n<h3>Noncompliant code example</h3>\n<pre>\n[ServiceContract]\ninterface IMyService // Noncompliant\n{\n  int MyServiceMethod();\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\n[ServiceContract]\ninterface IMyService\n{\n  [OperationContract]\n  int MyServiceMethod();\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3597.json",
    "content": "{\n  \"title\": \"\\\"ServiceContract\\\" and \\\"OperationContract\\\" attributes should be used together\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"api-design\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3597\",\n  \"sqKey\": \"S3597\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3598.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When declaring a Windows Communication Foundation (WCF) <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.servicemodel.operationcontractattribute?view=dotnet-plat-ext-7.0\"><code>OperationContract</code></a>\nmethod as <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.servicemodel.operationcontractattribute.isoneway?view=dotnet-plat-ext-7.0\"><code>one-way</code></a>,\nthat service method won’t return any result, not even an underlying empty confirmation message. These are fire-and-forget methods that are useful in\nevent-like communication. Therefore, specifying a return type has no effect and can confuse readers.</p>\n<h3>Exceptions</h3>\n<p>The rule doesn’t report if <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.servicemodel.operationcontractattribute.asyncpattern\"><code>OperationContractAttribute.AsyncPattern</code></a>\nis set to <code>true</code>.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\n[ServiceContract]\ninterface IMyService\n{\n  [OperationContract(IsOneWay = true)]\n  int SomethingHappened(int parameter); // Noncompliant\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n[ServiceContract]\ninterface IMyService\n{\n  [OperationContract(IsOneWay = true)]\n  void SomethingHappened(int parameter);\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<p>Microsoft Learn - <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.servicemodel.operationcontractattribute\">OperationContractAttribute</a></p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3598.json",
    "content": "{\n  \"title\": \"One-way \\\"OperationContract\\\" methods should have \\\"void\\\" return type\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3598\",\n  \"sqKey\": \"S3598\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3600.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Adding <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/params\">params</a> to a method override has no effect.\nThe compiler accepts it, but the callers won’t be able to benefit from the added modifier.</p>\n<h3>Noncompliant code example</h3>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nclass Base\n{\n  public virtual void Method(int[] numbers)\n  {\n    ...\n  }\n}\nclass Derived : Base\n{\n  public override void Method(params int[] numbers) // Noncompliant, method can't be called with params syntax.\n  {\n    ...\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nclass Base\n{\n  public virtual void Method(int[] numbers)\n  {\n    ...\n  }\n}\nclass Derived : Base\n{\n  public override void Method(int[] numbers)\n  {\n    ...\n  }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/params\">params keyword</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3600.json",
    "content": "{\n  \"title\": \"\\\"params\\\" should not be introduced on overrides\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1min\"\n  },\n  \"tags\": [\n    \"confusing\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-3600\",\n  \"sqKey\": \"S3600\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3603.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Marking a method with the <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.contracts.pureattribute\"><code>Pure</code></a>\nattribute indicates that the method doesn’t make any visible state changes. Therefore, a <code>Pure</code> method should return a result. Otherwise,\nit indicates a no-operation call.</p>\n<p>Using <code>Pure</code> on a <code>void</code> method is either by mistake or the method is not doing a meaningful task.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nclass Person\n{\n  private int age;\n\n  [Pure] // Noncompliant: The method makes a state change\n  void ConfigureAge(int age) =&gt;\n    this.age = age;\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nclass Person\n{\n  private int age;\n\n  void ConfigureAge(int age) =&gt;\n    this.age = age;\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.contracts.pureattribute\">PureAttribute Class</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3603.json",
    "content": "{\n  \"title\": \"Methods with \\\"Pure\\\" attribute should return a value \",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3603\",\n  \"sqKey\": \"S3603\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3604.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Fields, properties and events can be initialized either inline or in the constructor. Initializing them inline and in the constructor at the same\ntime is redundant; the inline initialization will be overridden.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nclass Person\n{\n  int age = 42; // Noncompliant\n  public Person(int age)\n  {\n    this.age = age;\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nclass Person\n{\n  int age;\n  public Person(int age)\n  {\n    this.age = age;\n  }\n}\n</pre>\n<h3>Exceptions</h3>\n<p>This rule doesn’t report an issue if not all constructors initialize the field. If the field is initialized inline to its default value, then\n{rule:csharpsquid:S3052} already reports an issue on the initialization.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3604.json",
    "content": "{\n  \"title\": \"Member initializer values should not be redundant\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3604\",\n  \"sqKey\": \"S3604\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3610.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Calling <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.object.gettype\">GetType()</a> on a <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/nullable-value-types\">nullable value type</a> object returns\nthe underlying value type. Therefore, comparing the returned <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.type\"><code>Type</code></a>\nobject to <code>typeof(Nullable&lt;SomeType&gt;)</code> will either throw an <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.nullreferenceexception\">NullReferenceException</a> or the result will always be\n<code>true</code> or <code>false</code> and can be known at compile time.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nvoid DoChecks&lt;T&gt;(Nullable&lt;T&gt; value) where T : struct\n{\n    bool areEqual = value.GetType() == typeof(Nullable&lt;int&gt;); // Noncompliant: always false\n    bool areNotEqual = value.GetType() != typeof(Nullable&lt;int&gt;); // Noncompliant: always true\n\n    Nullable&lt;int&gt; nullable = null;\n    bool nullComparison = nullable.GetType() != typeof(Nullable&lt;int&gt;); // Noncompliant: throws NullReferenceException\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nvoid DoChecks&lt;T&gt;(Nullable&lt;T&gt; value) where T : struct\n{\n    bool areEqual = value.GetType() == typeof(int); // Compliant: can be true or false\n    bool areNotEqual = value.GetType() != typeof(int); // Compliant: can be true or false\n\n    Nullable&lt;int&gt; nullable = null;\n    bool nullComparison = nullable is not null &amp;&amp; nullable.GetType() == typeof(int); // Compliant: does not throw NullReferenceException\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.object.gettype\">Object.GetType Method</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/nullable-value-types\">Nullable value\n  types (C# reference)</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.type\">Type Class</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.nullreferenceexception\">NullReferenceException Class</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3610.json",
    "content": "{\n  \"title\": \"Nullable type comparison should not be redundant\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"redundant\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3610\",\n  \"sqKey\": \"S3610\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3626.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Jump statements, such as <code>return</code>, <code>yield break</code>, <code>goto</code>, and <code>continue</code> are used to change the normal\nflow of execution in a program. However, redundant jump statements can make code difficult to read and maintain.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nvoid Foo()\n{\n  goto A; // Noncompliant\n  A:\n  while (condition1)\n  {\n    if (condition2)\n    {\n      continue; // Noncompliant\n    }\n    else\n    {\n      DoTheThing();\n    }\n  }\n  return; // Noncompliant; this is a void method\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nvoid Foo()\n{\n  while (condition1)\n  {\n    if (!condition2)\n    {\n      DoTheThing();\n    }\n  }\n}\n</pre>\n<h3>Exceptions</h3>\n<ul>\n  <li><code>return</code> statements followed by a local function declaration are not considered redundant, as they help with readability.</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3626.json",
    "content": "{\n  \"title\": \"Jump statements should not be redundant\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1min\"\n  },\n  \"tags\": [\n    \"redundant\",\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3626\",\n  \"sqKey\": \"S3626\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3655.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.nullable-1\">Nullable value types</a> can hold either a value or <code>null</code>.</p>\n<p>The value held in the nullable type can be accessed with the <code>Value</code> property or by casting it to the underlying type. Still, both\noperations throw an <code>InvalidOperationException</code> when the value is <code>null</code>. A nullable type should always be tested before\naccessing the value to avoid raising exceptions.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nvoid Sample(bool condition)\n{\n    int? nullableValue = condition ? 42 : null;\n    Console.WriteLine(nullableValue.Value); // Noncompliant: InvalidOperationException is raised\n\n    int? nullableCast = condition ? 42 : null;\n    Console.WriteLine((int)nullableCast);   // Noncompliant: InvalidOperationException is raised\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nvoid Sample(bool condition)\n{\n    int? nullableValue = condition ? 42 : null;\n    if (nullableValue.HasValue)\n    {\n      Console.WriteLine(nullableValue.Value);\n    }\n\n    int? nullableCast = condition ? 42 : null;\n    if (nullableCast is not null)\n    {\n      Console.WriteLine((int)nullableCast);\n    }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.nullable-1\">Nullable&lt;T&gt;</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/476\">CWE-476 - NULL Pointer Dereference</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3655.json",
    "content": "{\n  \"title\": \"Empty nullable value should not be accessed\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"symbolic-execution\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3655\",\n  \"sqKey\": \"S3655\",\n  \"scope\": \"All\",\n  \"securityStandards\": {\n    \"CWE\": [\n      476\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3717.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><code>NotImplementedException</code> is often used to mark methods which must be implemented for the overall functionality to be complete, but\nwhich the developer wants to implement later. That’s as opposed to the <code>NotSupportedException</code> which is thrown by methods which are\nrequired by base classes or interfaces, but which are not appropriate to the current class.</p>\n<p>This rule raises an exception when <code>NotImplementedException</code> is thrown.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nvoid doTheThing()\n{\n    throw new NotImplementedException();\n}\n</pre>\n<h3>Exceptions</h3>\n<p>Exceptions derived from <code>NotImplementedException</code> are ignored.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3717.json",
    "content": "{\n  \"title\": \"Track use of \\\"NotImplementedException\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1h\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3717\",\n  \"sqKey\": \"S3717\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3776.html",
    "content": "<p>This rule raises an issue when the code cognitive complexity of a function is above a certain threshold.</p>\n<h2>Why is this an issue?</h2>\n<p>Cognitive Complexity is a measure of how hard it is to understand the control flow of a unit of code. Code with high cognitive complexity is hard\nto read, understand, test, and modify.</p>\n<p>As a rule of thumb, high cognitive complexity is a sign that the code should be refactored into smaller, easier-to-manage pieces.</p>\n<h3>Which syntax in code does impact cognitive complexity score?</h3>\n<p>Here are the core concepts:</p>\n<ul>\n  <li><strong>Cognitive complexity is incremented each time the code breaks the normal linear reading flow.</strong>\n    <br>\n    This concerns, for example, loop structures, conditionals, catches, switches, jumps to labels, and conditions mixing multiple operators.</li>\n  <li><strong>Each nesting level increases complexity.</strong>\n    <br>\n    During code reading, the deeper you go through nested layers, the harder it becomes to keep the context in mind.</li>\n  <li><strong>Method calls are free</strong>\n    <br>\n    A well-picked method name is a summary of multiple lines of code. A reader can first explore a high-level view of what the code is performing then\n    go deeper and deeper by looking at called functions content.\n    <br>\n    <em>Note:</em> This does not apply to recursive calls, those will increment cognitive score.</li>\n</ul>\n<p>The method of computation is fully detailed in the pdf linked in the resources.</p>\n<h3>What is the potential impact?</h3>\n<p>Developers spend more time reading and understanding code than writing it. High cognitive complexity slows down changes and increases the cost of\nmaintenance.</p>\n<h2>How to fix it</h2>\n<p>Reducing cognitive complexity can be challenging.\n  <br>\n  Here are a few suggestions:</p>\n<ul>\n  <li><strong>Extract complex conditions in a new function.</strong>\n    <br>\n    Mixed operators in condition will increase complexity. Extracting the condition in a new function with an appropriate name will reduce cognitive\n    load.</li>\n  <li><strong>Break down large functions.</strong>\n    <br>\n    Large functions can be hard to understand and maintain. If a function is doing too many things, consider breaking it down into smaller, more\n    manageable functions. Each function should have a single responsibility.</li>\n  <li><strong>Avoid deep nesting by returning early.</strong>\n    <br>\n    To avoid the nesting of conditions, process exceptional cases first and return early.</li>\n  <li><strong>Use null-safe operations (if available in the language).</strong>\n    <br>\n    When available the <code>.?</code> or <code>??</code> operator replaces multiple tests and simplifies the flow.</li>\n</ul>\n<h3>Code examples</h3>\n<p><strong>Extraction of a complex condition in a new function.</strong></p>\n<h4>Noncompliant code example</h4>\n<p>The code is using a complex condition and has a cognitive cost of 3.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\ndecimal CalculateFinalPrice(User user, Cart cart)\n{\n    decimal total = CalculateTotal(cart);\n    if (user.HasMembership()               // +1 (if)\n        &amp;&amp; user.OrdersCount &gt; 10           // +1 (more than one condition)\n        &amp;&amp; user.AccountActive\n        &amp;&amp; !user.HasDiscount\n        || user.OrdersCount == 1)          // +1 (change of operator in condition)\n    {\n\n        total = ApplyDiscount(user, total);\n    }\n    return total;\n}\n</pre>\n<h4>Compliant solution</h4>\n<p>Even if the cognitive complexity of the whole program did not change, it is easier for a reader to understand the code of the\n<code>calculateFinalPrice</code> function, which now only has a cognitive cost of 1.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\ndecimal CalculateFinalPrice(User user, Cart cart)\n{\n    decimal total = CalculateTotal(cart);\n    if (IsEligibleForDiscount(user))       // +1 (if)\n    {\n        total = applyDiscount(user, total);\n    }\n    return total;\n}\n\nbool IsEligibleForDiscount(User user)\n{\n    return user.HasMembership()\n            &amp;&amp; user.OrdersCount &gt; 10       // +1 (more than one condition)\n            &amp;&amp; user.AccountActive\n            &amp;&amp; !user.HasDiscount\n            || user.OrdersCount == 1;      // +1 (change of operator in condition)\n}\n</pre>\n<p><strong>Break down large functions.</strong></p>\n<h4>Noncompliant code example</h4>\n<p>For example, consider a function that calculates the total price of a shopping cart, including sales tax and shipping.\n  <br>\n  <em>Note:</em> The code is simplified here, to illustrate the purpose. Please imagine there is more happening in the <code>foreach</code> loops.</p>\n<pre data-diff-id=\"3\" data-diff-type=\"noncompliant\">\ndecimal CalculateTotal(Cart cart)\n{\n    decimal total = 0;\n    foreach (Item item in cart.Items) // +1 (foreach)\n    {\n        total += item.Price;\n    }\n\n    // calculateSalesTax\n    foreach (Item item in cart.Items) // +1 (foreach)\n    {\n        total += 0.2m * item.Price;\n    }\n\n    //calculateShipping\n    total += 5m * cart.Items.Count;\n\n    return total;\n}\n</pre>\n<p>This function could be refactored into smaller functions: The complexity is spread over multiple functions and the complex\n<code>CalculateTotal</code> has now a complexity score of zero.</p>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"3\" data-diff-type=\"compliant\">\ndecimal CalculateTotal(Cart cart)\n{\n    decimal total = 0;\n    total = CalculateSubtotal(cart, total);\n    total += CalculateSalesTax(cart, total);\n    total += CalculateShipping(cart, total);\n    return total;\n}\n\ndecimal CalculateSubtotal(Cart cart, decimal total)\n{\n    foreach (Item item in cart.Items) // +1 (foreach)\n    {\n        total += item.Price;\n    }\n\n    return total;\n}\n\ndecimal CalculateSalesTax(Cart cart, decimal total)\n{\n    foreach (Item item in cart.Items)  // +1 (foreach)\n    {\n        total += 0.2m * item.Price;\n    }\n\n    return total;\n}\n\ndecimal CalculateShipping(Cart cart, decimal total)\n{\n    total += 5m * cart.Items.Count;\n    return total;\n}\n</pre>\n<p><strong>Avoid deep nesting by returning early.</strong></p>\n<h4>Noncompliant code example</h4>\n<p>The below code has a cognitive complexity of 6.</p>\n<pre data-diff-id=\"4\" data-diff-type=\"noncompliant\">\ndecimal CalculateDiscount(decimal price, User user)\n{\n    if (IsEligibleForDiscount(user))    // +1 ( if )\n    {\n        if (user.HasMembership())       // +2 ( nested if )\n        {\n            return price * 0.9m;\n        }\n        else if (user.OrdersCount == 1) // +1 ( else )\n        {\n            return price * 0.95m;\n        }\n        else                            // +1 ( else )\n        {\n            return price;\n        }\n    }\n    else                                // +1 ( else )\n    {\n        return price;\n    }\n}\n</pre>\n<h4>Compliant solution</h4>\n<p>Checking for the edge case first flattens the <code>if</code> statements and reduces the cognitive complexity to 3.</p>\n<pre data-diff-id=\"4\" data-diff-type=\"compliant\">\ndecimal CalculateDiscount(decimal price, User user)\n{\n    if (!IsEligibleForDiscount(user)) // +1 ( if )\n    {\n        return price;\n    }\n\n    if (user.HasMembership())         // +1 (  if )\n    {\n        return price * 0.9m;\n    }\n\n    if (user.OrdersCount == 1)        // +1 ( else )\n    {\n        return price * 0.95m;\n    }\n\n    return price;\n}\n</pre>\n<p><strong>Use the null-conditional operator to access data.</strong></p>\n<p>In the below code, the cognitive complexity is increased due to the multiple checks required to access the manufacturer’s name. This can be\nsimplified using the optional chaining operator.</p>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nstring GetManufacturerName(Product product)\n{\n    string manufacturerName = null;\n    if (product != null &amp;&amp; product.Details != null &amp;&amp;\n        product.Details.Manufacturer != null) // +1 (if) +1 (multiple condition)\n    {\n        manufacturerName = product.Details.Manufacturer.Name;\n    }\n\n    if (manufacturerName != null) // +1 (if)\n    {\n        return manufacturerName;\n    }\n\n    return \"Unknown\";\n}\n</pre>\n<h4>Compliant solution</h4>\n<p>The optional chaining operator will return <code>null</code> if any reference in the chain is <code>null</code>, avoiding multiple checks. The\n<code>??</code> operator allows to provide the default value to use.</p>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nstring GetManufacturerName(Product product)\n{\n    return product?.Details?.Manufacturer?.Name ?? \"Unknown\";\n}\n</pre>\n<h3>Pitfalls</h3>\n<p>As this code is complex, ensure that you have unit tests that cover the code before refactoring.</p>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Sonar - <a href=\"https://www.sonarsource.com/docs/CognitiveComplexity.pdf\">Cognitive Complexity</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li>Sonar Blog - <a href=\"https://www.sonarsource.com/blog/5-clean-code-tips-for-reducing-cognitive-complexity/\">5 Clean Code Tips for Reducing\n  Cognitive Complexity</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3776.json",
    "content": "{\n  \"title\": \"Cognitive Complexity of methods should not be too high\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"FOCUSED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Linear with offset\",\n    \"linearDesc\": \"per complexity point over the threshold\",\n    \"linearOffset\": \"5min\",\n    \"linearFactor\": \"1min\"\n  },\n  \"tags\": [\n    \"brain-overload\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-3776\",\n  \"sqKey\": \"S3776\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3869.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The <code>SafeHandle.DangerousGetHandle</code> method poses significant risks and should be used carefully. This method carries the inherent danger\nof potentially returning an invalid handle, which can result in resource leaks and security vulnerabilities. Although it is technically possible to\nutilize this method without encountering issues, doing so correctly requires a high level of expertise. Therefore, it is recommended to avoid using\nthis method altogether.</p>\n<h3>What is the potential impact?</h3>\n<p>The <code>SafeHandle.DangerousGetHandle</code> method is potentially prone to leaks and vulnerabilities due to its nature and usage. Here are a few\nreasons why:</p>\n<ul>\n  <li><strong>Invalid handles</strong>: the method retrieves the raw handle value without performing any validation or safety checks. This means that\n  the method can return a handle that is no longer valid or has been closed, leading to undefined behavior or errors when attempting to use it.</li>\n  <li><strong>Resource leaks</strong>: by directly accessing the handle without the proper safeguards and cleanup provided by the\n  <code>SafeHandle</code> class, there is an increased risk of failing to dispose system resources correctly.</li>\n  <li><strong>Security vulnerabilities</strong>: when the handle is interacting with sensitive resources (e.g. file handles, process handles) using\n  <code>SafeHandle.DangerousGetHandle</code> without proper validation can lead to security vulnerabilities that can be exploited by an attacker.</li>\n</ul>\n<pre>\nstatic void Main(string[] args)\n{\n    System.Reflection.FieldInfo fieldInfo = ...;\n    SafeHandle handle = (SafeHandle)fieldInfo.GetValue(rKey);\n    IntPtr dangerousHandle = handle.DangerousGetHandle(); // Noncompliant\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.safehandle.dangerousgethandle\">SafeHandle.DangerousGetHandle\n  Method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.safehandle\">SafeHandle Class</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li><a href=\"https://stackoverflow.com/questions/8396923/why-is-safehandle-dangerousgethandle-dangerous\">Why is SafeHandle.DangerousGetHandle()\n  \"Dangerous\"? - Stackoverflow</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3869.json",
    "content": "{\n  \"title\": \"\\\"SafeHandle.DangerousGetHandle\\\" should not be called\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"leak\",\n    \"unpredictable\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-3869\",\n  \"sqKey\": \"S3869\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3871.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The point of having custom exception types is to convey more information than is available in standard types. But custom exception types must be\n<code>public</code> for that to work.</p>\n<p>If a method throws a non-public exception, the best you can do on the caller’s side is to <code>catch</code> the closest <code>public</code> base\nof the class. However, you lose all the information that the new exception type carries.</p>\n<p>This rule will raise an issue if you directly inherit one of the following exception types in a non-public class:</p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.exception\">Exception</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.systemexception\">SystemException</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.applicationexception\">ApplicationException</a></li>\n</ul>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\ninternal class MyException : Exception   // Noncompliant\n{\n  // ...\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic class MyException : Exception\n{\n  // ...\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A10_2017-Insufficient_Logging%2526Monitoring\">Top 10 2017 Category A10 -\n  Insufficient Logging &amp; Monitoring</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.exception\">Exception</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.systemexception\">SystemException</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.applicationexception\">ApplicationException</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/access-modifiers\">Access modifiers</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/exceptions\">Exceptions and Exception Handling</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3871.json",
    "content": "{\n  \"title\": \"Exception types should be \\\"public\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"error-handling\",\n    \"api-design\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-3871\",\n  \"sqKey\": \"S3871\",\n  \"scope\": \"All\",\n  \"securityStandards\": {\n    \"OWASP\": [\n      \"A10\"\n    ]\n  },\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3872.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The name of a method should communicate what it does, and the names of its parameters should indicate how they’re used. If a method and its\nparameter have the same name it is an indication that one of these rules of thumb has been broken, if not both. Even if by some trick of language\nthat’s not the case, it is still likely to confuse callers and maintainers.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic void Login(string login)  // Noncompliant\n{\n  //...\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic void Login(string userName)\n{\n  //...\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3872.json",
    "content": "{\n  \"title\": \"Parameter names should not duplicate the names of their methods\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"convention\",\n    \"confusing\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3872\",\n  \"sqKey\": \"S3872\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3874.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Passing a parameter by reference, which is what happens when you use the <code>out</code> or <code>ref</code> parameter modifiers, means that the\nmethod will receive a pointer to the argument, rather than the argument itself. If the argument was a value type, the method will be able to change\nthe argument’s values. If it was a reference type, then the method receives a pointer to a pointer, which is usually not what was intended. Even when\nit is what was intended, this is the sort of thing that’s difficult to get right, and should be used with caution.</p>\n<p>This rule raises an issue when <code>out</code> or <code>ref</code> is used on a non-<code>Optional</code> parameter in a public method.\n<code>Optional</code> parameters are covered by {rule:csharpsquid:S3447}.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic void GetReply(\n         ref MyClass input, // Noncompliant\n         out string reply)  // Noncompliant\n{ ... }\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic string GetReply(MyClass input)\n{ ... }\n\npublic bool TryGetReply(MyClass input, out string reply)\n{ ... }\n\npublic ReplyData GetReply(MyClass input)\n{ ... }\n\ninternal void GetReply(ref MyClass input, out string reply)\n{ ... }\n</pre>\n<h3>Exceptions</h3>\n<p>This rule will not raise issues for:</p>\n<ul>\n  <li>non-public methods</li>\n  <li>methods with only 'out' parameters, name starting with \"Try\" and return type bool.</li>\n  <li>interface implementation methods</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3874.json",
    "content": "{\n  \"title\": \"\\\"out\\\" and \\\"ref\\\" parameters should not be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-3874\",\n  \"sqKey\": \"S3874\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3875.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The use of <code>==</code> to compare two objects is expected to do a reference comparison. That is, it is expected to return <code>true</code> if\nand only if they are the same object instance. Overloading the operator to do anything else will inevitably lead to the introduction of bugs by\ncallers.</p>\n<pre>\npublic static bool operator ==(MyType x, MyType y) // Noncompliant: confusing for the caller\n{\n    // custom implementation\n}\n</pre>\n<p>On the other hand, overloading it to do exactly that is pointless; that’s what <code>==</code> does by default.</p>\n<pre>\npublic static bool operator ==(MyType x, MyType y) // Noncompliant: redundant\n{\n    if (x == null)\n    {\n        return y == null;\n    }\n\n    return object.ReferenceEquals(x,y);\n}\n</pre>\n<h3>Exceptions</h3>\n<ul>\n  <li>Classes with overloaded <code>operator +</code> or <code>operator -</code> are ignored.</li>\n  <li>Classes that implement <code>IComparable&lt;T&gt;</code> or <code>IEquatable&lt;T&gt;</code> most probably behave as value-type objects and are\n  ignored.</li>\n</ul>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/reference-types\">Reference types</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/equality-operators\">Equality operators</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3875.json",
    "content": "{\n  \"title\": \"\\\"operator\\u003d\\u003d\\\" should not be overloaded on reference types\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-3875\",\n  \"sqKey\": \"S3875\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3876.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Strings and integral types are typically used as indexers. When some other type is required, it typically indicates design problems, and\npotentially a situation where a method should be used instead.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic int this[MyCustomClass index]  // Noncompliant\n{\n    // get and set accessors\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3876.json",
    "content": "{\n  \"title\": \"Strings or integral types should be used for indexers\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"design\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3876\",\n  \"sqKey\": \"S3876\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3877.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The rule is reporting when an exception is thrown from certain methods and constructors. These methods are expected to behave in a specific way and\nthrowing an exception from them can lead to unexpected behavior and break the calling code.</p>\n<pre>\npublic override string ToString()\n{\n  if (string.IsNullOrEmpty(Name))\n  {\n    throw new ArgumentException(nameof(Name));  // Noncompliant\n  }\n  //...\n}\n</pre>\n<p>An issue is raised when an exception is thrown from any of the following:</p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.object.tostring\">ToString</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.object.equals\">Object.Equals</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.iequatable-1.equals\">IEquatable.Equals</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.object.gethashcode\">GetHashCode</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.idisposable.dispose\">IDisposable.Dispose</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/events/how-to-implement-custom-event-accessors\">Event\n  accessors</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/static-constructors\">static constructors</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.moduleinitializerattribute\">Module initializer\n  attribute</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/operator-overloading\">https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/operator-overloading</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/user-defined-conversion-operators\">implicit cast\n  operators</a></li>\n</ul>\n<h3>Exceptions</h3>\n<p>Certain exceptions will be ignored in specific contexts, thus not raising the issue:</p>\n<ul>\n  <li><code>System.NotImplementedException</code> and its derivatives are ignored for all the aforementioned.</li>\n  <li><code>System.InvalidOperationException</code>, <code>System.NotSupportedException</code>, and <code>System.ArgumentException</code> and their\n  derivatives are ignored in event accessors.</li>\n</ul>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/exceptions/\">Exceptions and Exception Handling</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/exceptions/best-practices-for-exceptions\">Best practices for exceptions</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1065\">CA1065: Do not raise exceptions in unexpected\n  locations</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3877.json",
    "content": "{\n  \"title\": \"Exceptions should not be thrown from unexpected methods\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-3877\",\n  \"sqKey\": \"S3877\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3878.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Creating an array or using a collection expression solely for the purpose of passing it to a <code>params</code> parameter is unnecessary. Simply\npass the elements directly, and they will be automatically consolidated into the appropriate collection type.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic void Base()\n{\n    Method(new string[] { \"s1\", \"s2\" }); // Noncompliant: resolves to string[] overload\n    Method(new string[] { });            // Noncompliant: resolves to string[] overload\n    Method([\"s3\", \"s4\"]);                // Noncompliant: resolves to ReadOnlySpan overload\n    Method(new string[12]);              // Compliant: resolves to string[] overload\n}\n\npublic void Method(params string[] args)\n{\n    // ...\n}\n\npublic void Method(params ReadOnlySpan&lt;string&gt; args) // C# 13 params collections\n{\n    // C# 13 params collection\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic void Base()\n{\n    Method(\"s1\", \"s2\");     // resolves to ReadOnlySpan overload\n    Method();               // resolves to ReadOnlySpan overload\n    Method(\"s3\", \"s4\");     // resolves to ReadOnlySpan overload\n    Method(new string[12]); // resolves to string[]  overload\n}\n\npublic void Method(params string[] args)\n{\n    // ..\n}\n\npublic void Method(params ReadOnlySpan&lt;string&gt; args) // C# 13 params collections\n{\n    // ..\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/method-parameters#params-modifier\"><code>params</code>\n  modifier</a></li>\n  <li>Microsoft Learn - C# 13 <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-13#params-collections\"><code>params</code>\n  collections</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/collection-expressions\">Collection\n  expressions</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3878.json",
    "content": "{\n  \"title\": \"Arrays should not be created for params parameters\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3878\",\n  \"sqKey\": \"S3878\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3880.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Finalizers come with a performance cost due to the overhead of tracking the life cycle of objects. An empty one is consequently costly with no\nbenefit or justification.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic class Foo\n{\n    ~Foo() // Noncompliant\n    {\n    }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3880.json",
    "content": "{\n  \"title\": \"Finalizers should not be empty\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3880\",\n  \"sqKey\": \"S3880\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3881.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The <code>IDisposable</code> interface is a mechanism to release unmanaged resources, if not implemented correctly this could result in resource\nleaks or more severe bugs.</p>\n<p>This rule raises an issue when the recommended dispose pattern, as defined by Microsoft, is not adhered to. See the <strong>Compliant\nSolution</strong> section for examples.</p>\n<p>Satisfying the rule’s conditions will enable potential derived classes to correctly dispose the members of your class:</p>\n<ul>\n  <li><code>sealed</code> classes are not checked.</li>\n  <li>If a base class implements <code>IDisposable</code> your class should not have <code>IDisposable</code> in the list of its interfaces. In such\n  cases it is recommended to override the base class’s <code>protected virtual void Dispose(bool)</code> method or its equivalent.</li>\n  <li>The class should not implement <code>IDisposable</code> explicitly, e.g. the <code>Dispose()</code> method should be public.</li>\n  <li>The class should contain <code>protected virtual void Dispose(bool)</code> method. This method allows the derived classes to correctly dispose\n  the resources of this class.</li>\n  <li>The content of the <code>Dispose()</code> method should be invocation of <code>Dispose(true)</code> followed by\n  <code>GC.SuppressFinalize(this)</code></li>\n  <li>If the class has a finalizer, i.e. a destructor, the only code in its body should be a single invocation of <code>Dispose(false)</code>.</li>\n  <li>If the class inherits from a class that implements <code>IDisposable</code> it must call the <code>Dispose</code>, or <code>Dispose(bool)</code>\n  method of the base class from within its own implementation of <code>Dispose</code> or <code>Dispose(bool)</code>, respectively. This ensures that\n  all resources from the base class are properly released.</li>\n</ul>\n<h3>Noncompliant code example</h3>\n<pre>\npublic class Foo1 : IDisposable // Noncompliant - provide protected overridable implementation of Dispose(bool) on Foo or mark the type as sealed.\n{\n    public void Dispose() // Noncompliant - should contain only a call to Dispose(true) and then GC.SuppressFinalize(this)\n    {\n        // Cleanup\n    }\n}\n\npublic class Foo2 : IDisposable\n{\n    void IDisposable.Dispose() // Noncompliant - Dispose() should be public\n    {\n        Dispose(true);\n        GC.SuppressFinalize(this);\n    }\n\n    public virtual void Dispose() // Noncompliant - Dispose() should be sealed\n    {\n        Dispose(true);\n        GC.SuppressFinalize(this);\n    }\n}\n\npublic class Foo3 : IDisposable\n{\n    public void Dispose()\n    {\n        Dispose(true);\n        GC.SuppressFinalize(this);\n    }\n\n    protected virtual void Dispose(bool disposing)\n    {\n        // Cleanup\n    }\n\n    ~Foo3() // Noncompliant - Modify Foo.~Foo() so that it calls Dispose(false) and then returns.\n    {\n        // Cleanup\n    }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\n// Sealed class\npublic sealed class Foo1 : IDisposable\n{\n    public void Dispose()\n    {\n        // Cleanup\n    }\n}\n\n// Simple implementation\npublic class Foo2 : IDisposable\n{\n    public void Dispose()\n    {\n        Dispose(true);\n        GC.SuppressFinalize(this);\n    }\n\n    protected virtual void Dispose(bool disposing)\n    {\n        // Cleanup\n    }\n}\n\n// Implementation with a finalizer\npublic class Foo3 : IDisposable\n{\n    public void Dispose()\n    {\n        Dispose(true);\n        GC.SuppressFinalize(this);\n    }\n\n    protected virtual void Dispose(bool disposing)\n    {\n        // Cleanup\n    }\n\n    ~Foo3()\n    {\n        Dispose(false);\n    }\n}\n\n// Base disposable class\npublic class Foo4 : DisposableBase\n{\n    protected override void Dispose(bool disposing)\n    {\n        // Cleanup\n        // Do not forget to call base\n        base.Dispose(disposing);\n    }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://msdn.microsoft.com/en-us/library/498928w2.aspx\">MSDN</a> for complete documentation on the dispose pattern.</li>\n  <li><a href=\"https://blog.stephencleary.com/2009/08/how-to-implement-idisposable-and.html\">Stephen Cleary</a> for excellent Q&amp;A about\n  IDisposable</li>\n  <li><a href=\"https://pragmateek.com/c-scope-your-global-state-changes-with-idisposable-and-the-using-statement/\">Pragma Geek</a> for additional\n  usages of IDisposable, beyond releasing resources.</li>\n  <li><a href=\"https://docs.microsoft.com/en-us/dotnet/api/system.idisposable?view=netframework-4.7\">IDisposable documentation</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3881.json",
    "content": "{\n  \"title\": \"\\\"IDisposable\\\" should be implemented correctly\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3881\",\n  \"sqKey\": \"S3881\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3884.html",
    "content": "<p>This rule is deprecated, and will eventually be removed.</p>\n<h2>Why is this an issue?</h2>\n<p><code>CoSetProxyBlanket</code> and <code>CoInitializeSecurity</code> both work to set the permissions context in which the process invoked\nimmediately after is executed. Calling them from within that process is useless because it’s too late at that point; the permissions context has\nalready been set.</p>\n<p>Specifically, these methods are meant to be called from non-managed code such as a C++ wrapper that then invokes the managed, i.e. C# or VB.NET,\ncode.</p>\n<h3>Noncompliant code example</h3>\n<pre>\n[DllImport(\"ole32.dll\")]\nstatic extern int CoSetProxyBlanket([MarshalAs(UnmanagedType.IUnknown)]object pProxy, uint dwAuthnSvc, uint dwAuthzSvc,\n\t[MarshalAs(UnmanagedType.LPWStr)] string pServerPrincName, uint dwAuthnLevel, uint dwImpLevel, IntPtr pAuthInfo,\n\tuint dwCapabilities);\n\npublic enum RpcAuthnLevel\n{\n\tDefault = 0,\n\tNone = 1,\n\tConnect = 2,\n\tCall = 3,\n\tPkt = 4,\n\tPktIntegrity = 5,\n\tPktPrivacy = 6\n}\n\npublic enum RpcImpLevel\n{\n\tDefault = 0,\n\tAnonymous = 1,\n\tIdentify = 2,\n\tImpersonate = 3,\n\tDelegate = 4\n}\n\npublic enum EoAuthnCap\n{\n\tNone = 0x00,\n\tMutualAuth = 0x01,\n\tStaticCloaking = 0x20,\n\tDynamicCloaking = 0x40,\n\tAnyAuthority = 0x80,\n\tMakeFullSIC = 0x100,\n\tDefault = 0x800,\n\tSecureRefs = 0x02,\n\tAccessControl = 0x04,\n\tAppID = 0x08,\n\tDynamic = 0x10,\n\tRequireFullSIC = 0x200,\n\tAutoImpersonate = 0x400,\n\tNoCustomMarshal = 0x2000,\n\tDisableAAA = 0x1000\n}\n\n[DllImport(\"ole32.dll\")]\npublic static extern int CoInitializeSecurity(IntPtr pVoid, int cAuthSvc, IntPtr asAuthSvc, IntPtr pReserved1,\n\tRpcAuthnLevel level, RpcImpLevel impers, IntPtr pAuthList, EoAuthnCap dwCapabilities, IntPtr pReserved3);\n\nstatic void Main(string[] args)\n{\n\tvar hres1 = CoSetProxyBlanket(null, 0, 0, null, 0, 0, IntPtr.Zero, 0); // Noncompliant\n\n\tvar hres2 = CoInitializeSecurity(IntPtr.Zero, -1, IntPtr.Zero, IntPtr.Zero, RpcAuthnLevel.None,\n\t\tRpcImpLevel.Impersonate, IntPtr.Zero, EoAuthnCap.None, IntPtr.Zero); // Noncompliant\n}\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A01_2021-Broken_Access_Control/\">Top 10 2021 Category A1 - Broken Access Control</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A6_2017-Security_Misconfiguration\">Top 10 2017 Category A6 - Security\n  Misconfiguration</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/648\">CWE-648 - Incorrect Use of Privileged APIs</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3884.json",
    "content": "{\n  \"title\": \"\\\"CoSetProxyBlanket\\\" and \\\"CoInitializeSecurity\\\" should not be used\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"deprecated\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-3884\",\n  \"sqKey\": \"S3884\",\n  \"scope\": \"All\",\n  \"securityStandards\": {\n    \"CWE\": [\n      648\n    ],\n    \"OWASP\": [\n      \"A6\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A1\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"6.5.8\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"6.2.4\"\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3885.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The parameter to <code>Assembly.Load</code> includes the full specification of the dll to be loaded. Use another method, and you might end up with\na dll other than the one you expected.</p>\n<p>This rule raises an issue when <code>Assembly.LoadFrom</code>, <code>Assembly.LoadFile</code>, or <code>Assembly.LoadWithPartialName</code> is\ncalled.</p>\n<h3>Exceptions</h3>\n<p>The rule does not raise an issue when the methods are used within an <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.appdomain.assemblyresolve\"><code>AssemblyResolve</code> event handler</a>. In this context,\nusing <code>Assembly.Load</code> can cause a <code>StackOverflowException</code> due to recursive event firing, making <code>Assembly.LoadFrom</code>\nor <code>Assembly.LoadFile</code> the appropriate choices.</p>\n<pre>\nstatic void Main()\n{\n    AppDomain.CurrentDomain.AssemblyResolve += OnAssemblyResolve;\n}\n\nstatic Assembly OnAssemblyResolve(object sender, ResolveEventArgs args)\n{\n    return Assembly.LoadFrom(\"MyAssembly.dll\"); // Compliant: within AssemblyResolve handler\n}\n</pre>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nstatic void Main(string[] args)\n{\n    Assembly.LoadFrom(\"MyAssembly.dll\"); // Noncompliant\n}\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nstatic void Main(string[] args)\n{\n    Assembly.LoadFile(@\"C:\\MyPath\\MyAssembly.dll\"); // Noncompliant\n}\n</pre>\n<pre data-diff-id=\"3\" data-diff-type=\"noncompliant\">\nstatic void Main(string[] args)\n{\n    Assembly.LoadWithPartialName(\"MyAssembly\"); // Noncompliant\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nstatic void Main(string[] args)\n{\n    Assembly.Load(\"MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null\"); // Compliant\n}\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nstatic void Main(string[] args)\n{\n    Assembly.Load(\"MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null\"); // Compliant\n}\n</pre>\n<pre data-diff-id=\"3\" data-diff-type=\"compliant\">\nstatic void Main(string[] args)\n{\n    Assembly.Load(\"MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null\"); // Compliant\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.reflection.assembly.load\">Assembly.Load Method</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.reflection.assembly.loadfrom\">Assembly.LoadFrom Method</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.reflection.assembly.loadfile\">Assembly.LoadFile Method</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.appdomain.assemblyresolve\">AppDomain.AssemblyResolve\n  Event</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.reflection.assembly.loadwithpartialname\">Assembly.LoadWithPartialName Method</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/standard/assembly/resolve-loads#what-the-event-handler-should-not-do\">Resolve assembly loads - What\n  the event handler should not do</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3885.json",
    "content": "{\n  \"title\": \"\\\"Assembly.Load\\\" should be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"unpredictable\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3885\",\n  \"sqKey\": \"S3885\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3887.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Using the <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/readonly\"><code>readonly</code> keyword</a> on a\nfield means it can’t be changed after initialization. However, that’s only partly true when applied to collections or arrays. The\n<code>readonly</code> keyword enforces that another instance can’t be assigned to the field, but it cannot keep the contents from being updated. In\npractice, the field value can be changed, and the use of <code>readonly</code> on such a field is misleading, and you’re likely not getting the\nbehavior you expect.</p>\n<p>This rule raises an issue when a non-private, <code>readonly</code> field is an array or collection.</p>\n<h2>How to fix it</h2>\n<p>To fix this, you should either use an <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable\">immutable</a> or <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.frozen\">frozen</a> collection or remove the <code>readonly</code> modifier to\nclarify the behavior.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic class MyClass\n{\n  public readonly string[] strings1;  // Noncompliant\n  public readonly string[] strings2;  // Noncompliant\n  public readonly string[] strings3;  // Noncompliant\n  // ...\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic class MyClass\n{\n  public string[] strings1;                         // Compliant: remove readonly modifier\n  public readonly ImmutableArray&lt;string&gt; strings;   // Compliant: use an Immutable collection\n  private readonly string[] strings;                // Compliant: reduced accessibility to private\n\n  // ...\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/readonly\">readonly (C#\n  Reference)</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3887.json",
    "content": "{\n  \"title\": \"Mutable, non-private fields should not be \\\"readonly\\\"\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3887\",\n  \"sqKey\": \"S3887\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3889.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><code>Thread.Suspend</code> and <code>Thread.Resume</code> can give unpredictable results, and both methods have been deprecated. Indeed, if\n<code>Thread.Suspend</code> is not used very carefully, a <a href=\"https://en.wikipedia.org/wiki/Thread_(computing)\">thread</a> can be suspended while\nholding a <a href=\"https://en.wikipedia.org/wiki/Lock_(computer_science)\">lock</a>, thus leading to a <a\nhref=\"https://en.wikipedia.org/wiki/Deadlock\">deadlock</a>.</p>\n<p>There are other synchronization mechanisms that are safer and should be used instead, such as:</p>\n<ul>\n  <li><code>Monitor</code> provides a mechanism that synchronizes access to objects.</li>\n  <li><code>Mutex</code> provides a mechanism that synchronizes interprocess access to a protected resource.</li>\n  <li><code>Semaphore</code> provides a mechanism that allows limiting the number of threads that have access to a protected resources\n  concurrently.</li>\n  <li><code>Events</code> enable a class to notify others when something of interest occurs.</li>\n</ul>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://msdn.microsoft.com/en-us/library/system.threading.thread.resume.aspx\">Thread.Resume Method</a></li>\n  <li><a href=\"https://msdn.microsoft.com/en-us/library/system.threading.thread.suspend(v=vs.110).aspx\">Thread.Suspend Method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.monitor?view=net-7.0\">Monitor Class</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.mutex?view=net-7.0\">Mutex Class</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.semaphore?view=net-7.0\">Semaphore Class</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/events/\">Events Programming Guide</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/lock\">lock statement</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li><a href=\"https://stephencleary.com/book/\">Concurrency in C# Cookbook - Stephen Cleary</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3889.json",
    "content": "{\n  \"title\": \"\\\"Thread.Resume\\\" and \\\"Thread.Suspend\\\" should not be used\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"multi-threading\",\n    \"unpredictable\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-3889\",\n  \"sqKey\": \"S3889\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3897.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The <code>IEquatable&lt;T&gt;</code> interface has only one method in it: <code>Equals(&lt;T&gt;)</code>. If you’ve already written\n<code>Equals(T)</code>, there’s no reason not to explicitly implement <code>IEquatable&lt;T&gt;</code>. Doing so expands the utility of your class by\nallowing it to be used where an <code>IEquatable</code> is called for.</p>\n<p><strong>Note</strong>: Classes that implement <code>IEquatable&lt;T&gt;</code> should also be <code>sealed</code>.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nclass MyClass  // Noncompliant\n{\n  public bool Equals(MyClass other)\n  {\n    //...\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nsealed class MyClass : IEquatable&lt;MyClass&gt;\n{\n  public override bool Equals(object other)\n  {\n    return Equals(other as MyClass);\n  }\n\n  public bool Equals(MyClass other)\n  {\n    //...\n  }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3897.json",
    "content": "{\n  \"title\": \"Classes that provide \\\"Equals(\\u003cT\\u003e)\\\" should implement \\\"IEquatable\\u003cT\\u003e\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"api-design\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3897\",\n  \"sqKey\": \"S3897\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3898.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>If you’re using a <code>struct</code>, it is likely because you’re interested in performance. But by failing to implement\n<code>IEquatable&lt;T&gt;</code> you’re loosing performance when comparisons are made because without <code>IEquatable&lt;T&gt;</code>, boxing and\nreflection are used to make comparisons.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nstruct MyStruct  // Noncompliant\n{\n    public int Value { get; set; }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nstruct MyStruct : IEquatable&lt;MyStruct&gt;\n{\n    public int Value { get; set; }\n\n    public bool Equals(MyStruct other)\n    {\n        // ...\n    }\n}\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.iequatable-1\">IEquatable&lt;T&gt; Interface</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3898.json",
    "content": "{\n  \"title\": \"Value types should implement \\\"IEquatable\\u003cT\\u003e\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3898\",\n  \"sqKey\": \"S3898\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3900.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Methods declared as <code>public</code>, <code>protected</code>, or <code>protected internal</code> can be accessed from other assemblies, which\nmeans you should validate parameters to be within the expected constraints. In general, checking against <code>null</code> is recommended in defensive\nprogramming.</p>\n<p>This rule raises an issue when a parameter of a publicly accessible method is not validated against <code>null</code> before being\ndereferenced.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic class MyClass\n{\n    private MyOtherClass other;\n\n    public void Foo(MyOtherClass other)\n    {\n        this.other = other.Clone(); // Noncompliant\n    }\n\n    protected void Bar(MyOtherClass other)\n    {\n        this.other = other.Clone(); // Noncompliant\n    }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic class MyClass\n{\n    private MyOtherClass other;\n\n    public void Foo(MyOtherClass other)\n    {\n        if (other != null)\n        {\n            this.other = other.Clone();\n        }\n    }\n\n    protected void Bar(MyOtherClass other)\n    {\n        if (other != null)\n        {\n            this.other = other.Clone();\n        }\n    }\n\n    public void Baz(MyOtherClass other)\n    {\n        ArgumentNullException.ThrowIfNull(other);\n\n        this.other = other.Clone();\n    }\n\n    public void Qux(MyOtherClass other)\n    {\n        this.other = other; // Compliant: \"other\" is not being dereferenced\n    }\n\n    private void Xyzzy(MyOtherClass other)\n    {\n        this.other = other.Clone(); // Compliant: method is not publicly accessible\n    }\n}\n</pre>\n<h3>Exceptions</h3>\n<ul>\n  <li>Arguments validated for <code>null</code> via helper methods should be annotated with the <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/attributes/nullable-analysis#postconditions-maybenull-and-notnull\"><code>[NotNull</code></a>] attribute.</li>\n  <li>Method parameters marked with the <code>[NotNull]</code> <a\n  href=\"https://www.jetbrains.com/help/resharper/Reference__Code_Annotation_Attributes.html#ItemNotNullAttribute\">Resharper code annotation\n  attribute</a> are supported as well.</li>\n  <li>To create a custom null validation method declare an attribute with name <code>ValidatedNotNullAttribute</code> and mark the parameter that is\n  validated for null in your method declaration with it:</li>\n</ul>\n<pre>\nusing System;\n\n[AttributeUsage(AttributeTargets.Parameter, Inherited=false)]\npublic sealed class ValidatedNotNullAttribute : Attribute { }\n\npublic static class Guard\n{\n    public static void NotNull&lt;T&gt;([ValidatedNotNullAttribute] T value, [CallerArgumentExpression(\"value\")] string name = \"\") where T : class\n    {\n        if (value == null)\n            throw new ArgumentNullException(name);\n    }\n}\n\npublic static class Utils\n{\n    public static string ToUpper(string value)\n    {\n        Guard.NotNull(value);\n\n        return value.ToUpper(); // Compliant\n    }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3900.json",
    "content": "{\n  \"title\": \"Arguments of public methods should be validated against null\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"convention\",\n    \"symbolic-execution\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3900\",\n  \"sqKey\": \"S3900\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3902.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Using <code>Type.Assembly</code> to get the current assembly is nearly free in terms of performance; it’s a simple property access. On the other\nhand, <code>Assembly.GetExecutingAssembly()</code> can take up to 30 times as long because it walks up the call stack to find the assembly.</p>\n<p>Note that <code>Assembly.GetExecutingAssembly()</code> is different than <code>Type.Assembly</code> because it dynamically returns the assembly\nthat contains the startup object of the currently executed application. For example, if executed from an application it will return the application\nassembly, but if executed from a unit test project it could return the unit test assembly. <code>Type.Assembly</code> always returns the assembly that\ncontains the specified type.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic class Example\n{\n   public static void Main()\n   {\n      Assembly assem = Assembly.GetExecutingAssembly(); // Noncompliant\n      Console.WriteLine(\"Assembly name: {0}\", assem.FullName);\n   }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic class Example\n{\n   public static void Main()\n   {\n      Assembly assem = typeof(Example).Assembly; // Here we use the type of the current class\n      Console.WriteLine(\"Assembly name: {0}\", assem.FullName);\n   }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3902.json",
    "content": "{\n  \"title\": \"\\\"Assembly.GetExecutingAssembly\\\" should not be called\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3902\",\n  \"sqKey\": \"S3902\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3903.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Types are declared in namespaces in order to prevent name collisions and as a way to organize them into the object hierarchy. Types that are\ndefined outside any named namespace are in a global namespace that cannot be referenced in code.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic class Foo // Noncompliant\n{\n}\n\npublic struct Bar // Noncompliant\n{\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nnamespace SomeSpace\n{\n    public class Foo\n    {\n    }\n\n    public struct Bar\n    {\n    }\n}\n</pre>\n<p>or alternatively in C#10 and above</p>\n<pre>\nnamespace SomeSpace;\npublic class Foo\n{\n}\n\npublic struct Bar\n{\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3903.json",
    "content": "{\n  \"title\": \"Types should be defined in named namespaces\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"MODULAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3903\",\n  \"sqKey\": \"S3903\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3904.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.reflection.assemblyversionattribute\">AssemblyVersion</a> attribute is used to\nspecify the version number of an assembly. An assembly is a compiled unit of code, which can be marked with a version number by applying the attribute\nto an assembly’s source code file.</p>\n<p>The <code>AssemblyVersion</code> attribute is useful for many reasons:</p>\n<ul>\n  <li><strong>Versioning</strong>: The attribute allows developers to track and manage different versions of an assembly. By incrementing the version\n  number for each new release, you can easily identify and differentiate between different versions of the same assembly. This is particularly useful\n  when distributing and deploying software, as it helps manage updates and compatibility between different versions.</li>\n  <li><strong>Dependency management</strong>: When an assembly references another assembly, it can specify the specific version of the dependency it\n  requires. By using the <code>AssemblyVersion</code> attribute, you can ensure that the correct version of the referenced assembly is used. This\n  helps avoid compatibility issues and ensures that the expected behavior and functionality are maintained.</li>\n  <li><strong>GAC management</strong>: The <a href=\"https://learn.microsoft.com/en-us/dotnet/framework/app-domains/gac\">GAC</a>, also known as Global\n  Assembly Cache, is a central repository for storing shared assemblies on a system. The AssemblyVersion attribute plays a crucial role in managing\n  assemblies in the GAC. Different versions of an assembly can coexist in the GAC, allowing applications to use the specific version they\n  require.</li>\n</ul>\n<p>If no <code>AssemblyVersion</code> is provided, the same default version will be used for every build. Since the version number is used by .NET\nFramework to uniquely identify an assembly, this can lead to broken dependencies.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nusing System.Reflection;\n\n[assembly: AssemblyTitle(\"MyAssembly\")] // Noncompliant\nnamespace MyLibrary\n{\n    // ...\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nusing System.Reflection;\n\n[assembly: AssemblyTitle(\"MyAssembly\")]\n[assembly: AssemblyVersion(\"42.1.125.0\")]\nnamespace MyLibrary\n{\n    // ...\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://docs.microsoft.com/en-us/dotnet/standard/assembly/versioning\">Assembly Versioning</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/framework/app-domains/gac\">Global Assembly Cache</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3904.json",
    "content": "{\n  \"title\": \"Assemblies should have version information\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-3904\",\n  \"sqKey\": \"S3904\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3906.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Delegate event handlers (i.e. delegates used as type of an event) should have a very specific signature:</p>\n<ul>\n  <li>Return type <code>void</code>.</li>\n  <li>First argument of type <code>System.Object</code> and named 'sender'.</li>\n  <li>Second argument of type <code>System.EventArgs</code> (or any derived type) and is named 'e'.</li>\n</ul>\n<p>This rule raises an issue whenever a <code>delegate</code> declaration doesn’t match that signature.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic delegate void AlarmEventHandler(object s);\n\npublic class Foo\n{\n    public event AlarmEventHandler AlarmEvent; // Noncompliant\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic delegate void AlarmEventHandler(object sender, AlarmEventArgs e);\n\npublic class Foo\n{\n    public event AlarmEventHandler AlarmEvent; // Compliant\n}\n</pre>\n<h2>Resources</h2>\n<p><a href=\"https://msdn.microsoft.com/en-us/library/edzehd2t.aspx\">Handling and Raising Events</a></p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3906.json",
    "content": "{\n  \"title\": \"Event Handlers should have the correct signature\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3906\",\n  \"sqKey\": \"S3906\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3908.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Since .Net Framework version 2.0 it is not necessary to declare a delegate that specifies a class derived from <code>System.EventArgs</code>. The\n<code>System.EventHandler&lt;TEventArgs&gt;</code> delegate mechanism should be used instead as it allows any class derived from\n<code>EventArgs</code> to be used with that handler.</p>\n<p>This rule raises an issue when an old style delegate is used as an event handler.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic class MyEventArgs : EventArgs\n{\n}\n\npublic delegate void MyEventHandler(object sender, MyEventArgs e); // Noncompliant\n\npublic class EventProducer\n{\n  public event MyEventHandler MyEvent;\n\n  protected virtual void OnMyEvent(MyEventArgs e)\n  {\n    if (MyEvent != null)\n    {\n      MyEvent(e);\n    }\n  }\n}\n\npublic class EventConsumer\n{\n  public EventConsumer(EventProducer producer)\n  {\n      producer.MyEvent += HandleEvent;\n  }\n\n  private void HandleEvent(object sender, MyEventArgs e)\n  {\n    // Do something...\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic class MyEventArgs : EventArgs\n{\n}\n\npublic class EventProducer\n{\n  public event EventHandler&lt;MyEventArgs&gt; MyEvent;\n\n  protected virtual void OnMyEvent(MyEventArgs e)\n  {\n    if (MyEvent != null)\n    {\n      MyEvent(e);\n    }\n  }\n}\n\npublic class EventConsumer\n{\n  public EventConsumer(EventProducer producer)\n  {\n      producer.MyEvent += HandleEvent;\n  }\n\n  private void HandleEvent(object sender, MyEventArgs e)\n  {\n    // Do something...\n  }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3908.json",
    "content": "{\n  \"title\": \"Generic event handlers should be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3908\",\n  \"sqKey\": \"S3908\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3909.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The NET Framework 2.0 introduced the generic interface <code>System.Collections.Generic.IEnumerable&lt;T&gt;</code> and it should be preferred over\nthe older, non generic, interfaces.</p>\n<p>This rule raises an issue when a public type implements <code>System.Collections.IEnumerable</code>.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nusing System;\nusing System.Collections;\n\npublic class MyData\n{\n  public MyData()\n  {\n  }\n}\n\npublic class MyList : CollectionBase // Noncompliant\n{\n  public void Add(MyData data)\n  {\n    InnerList.Add(data);\n  }\n\n  // ...\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nusing System;\nusing System.Collections.ObjectModel;\n\npublic class MyData\n{\n  public MyData()\n  {\n  }\n}\n\npublic class MyList : Collection&lt;MyData&gt;\n{\n  // Implementation...\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3909.json",
    "content": "{\n  \"title\": \"Collections should implement the generic interface\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3909\",\n  \"sqKey\": \"S3909\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3923.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Having all branches of a <code>switch</code> or <code>if</code> chain with the same implementation indicates a problem.</p>\n<p>In the following code:</p>\n<pre>\nif (b == 0)  // Noncompliant\n{\n    DoTheThing();\n}\nelse\n{\n    DoTheThing();\n}\n\nint b = a &gt; 12 ? 4 : 4;  // Noncompliant\n\nswitch (i) // Noncompliant\n{\n    case 1:\n        DoSomething();\n        break;\n    case 2:\n        DoSomething();\n        break;\n    case 3:\n        DoSomething();\n        break;\n    default:\n        DoSomething();\n}\n</pre>\n<p>Either there is a copy-paste error that needs fixing or an unnecessary <code>switch</code> or <code>if</code> chain that should be removed.</p>\n<h3>Exceptions</h3>\n<p>This rule does not apply to <code>if</code> chains without <code>else</code>, nor to <code>switch</code> without a <code>default</code> clause.</p>\n<pre>\nif (b == 0)    //no issue, this could have been done on purpose to make the code more readable\n{\n    DoSomething();\n}\nelse if (b == 1)\n{\n    DoSomething();\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3923.json",
    "content": "{\n  \"title\": \"All branches in a conditional structure should not have exactly the same implementation\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3923\",\n  \"sqKey\": \"S3923\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3925.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.iserializable\"><code>ISerializable</code></a> interface is\nthe mechanism to control the type serialization process. If not implemented correctly this could result in an invalid serialization and hard-to-detect\nbugs.</p>\n<p>This rule raises an issue on types that implement <code>ISerializable</code> without following the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/standard/design-guidelines/serialization\">serialization pattern recommended by Microsoft</a>.</p>\n<p>Specifically, this rule checks for these problems:</p>\n<ul>\n  <li>The <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.serializableattribute\"><code>SerializableAttribute</code></a> attribute is\n  missing.</li>\n  <li>Non-serializable fields are not marked with the <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.nonserializedattribute\"><code>NonSerializedAttribute</code></a> attribute.</li>\n  <li>There is no serialization constructor.</li>\n  <li>An unsealed type has a serialization constructor that is not <code>protected</code>.</li>\n  <li>A sealed type has a serialization constructor that is not <code>private</code>.</li>\n  <li>An unsealed type has an <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.iserializable.getobjectdata\"><code>ISerializable.GetObjectData</code></a> that is not both <code>public</code> and <code>virtual</code>.</li>\n  <li>A derived type has a serialization constructor that does not call the <code>base</code> constructor.</li>\n  <li>A derived type has an <code>ISerializable.GetObjectData</code> method that does not call the <code>base</code> method.</li>\n  <li>A derived type has serializable fields but the <code>ISerializable.GetObjectData</code> method is not overridden.</li>\n</ul>\n<p>Classes that inherit from <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.exception\"><code>Exception</code></a> are implementing\n<code>ISerializable</code>. Make sure the <code>[Serializable]</code> attribute is used and that <code>ISerializable</code> is correctly implemented.\nEven if you don’t plan to explicitly serialize the object yourself, it might still require serialization, for instance when crossing the boundary of\nan <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.appdomain\"><code>AppDomain</code></a>.</p>\n<p>This rule only raises an issue on classes that indicate that they are interested in serialization (see the <em>Exceptions</em> section). That is to\nreduce noise because a lot of classes in the base class library are implementing <code>ISerializable</code>, including the following classes: <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.exception\"><code>Exception</code></a>, <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.uri\"><code>Uri</code></a>, <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.hashtable\"><code>Hashtable</code></a>, <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2\"><code>Dictionary&lt;TKey,TValue&gt;</code></a>, <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.data.dataset\"><code>DataSet</code></a>, <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.net.httpwebrequest\"><code>HttpWebRequest</code></a>, <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.regex\"><code>Regex</code></a> <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.treenode\"><code>TreeNode</code></a>, and others. There is often no need to add\nserialization support in classes derived from these types.</p>\n<h3>Exceptions</h3>\n<ul>\n  <li>Classes in test projects are not checked.</li>\n  <li>Classes need to indicate that they are interested in serialization support by either\n    <ol>\n      <li>Applying the <code>[Serializable]</code> attribute</li>\n      <li>Having <code>ISerializable</code> in their base type list</li>\n      <li>Declaring a <a\n      href=\"https://learn.microsoft.com/en-us/dotnet/standard/design-guidelines/serialization#supporting-runtime-serialization\">serialization\n      constructor</a></li>\n    </ol></li>\n</ul>\n<pre>\n[Serializable]                                                                                 // 1.\npublic class SerializationOptIn_Attribute\n{\n}\n\npublic class SerializationOptIn_Interface : ISerializable                                      // 2.\n{\n}\n\npublic class SerializationOptIn_Constructor\n{\n    protected SerializationOptIn_Constructor(SerializationInfo info, StreamingContext context) // 3.\n    {\n    }\n}\n</pre>\n<h2>How to fix it</h2>\n<p>Make sure to follow the <a href=\"https://learn.microsoft.com/en-us/dotnet/standard/design-guidelines/serialization\">recommended guidelines</a> when\nimplementing <code>ISerializable</code>.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic class Bar\n{\n}\n\npublic class Foo : ISerializable // Noncompliant: serialization constructor is missing\n                                 // Noncompliant: the [Serializable] attribute is missing\n{\n    private readonly Bar bar; // Noncompliant: the field is not marked with [NonSerialized]\n}\n\npublic sealed class SealedFoo : Foo\n{\n    private int val; // Noncompliant: 'val' is serializable and GetObjectData is not overridden\n\n    public SealedFoo()\n    {\n        // ...\n    }\n\n    public SealedFoo(SerializationInfo info, StreamingContext context) // Noncompliant: serialization constructor is not `private`\n                                                                       // Noncompliant: serialization constructor does not call base constructor\n    {\n        // ...\n    }\n}\n\npublic class UnsealedFoo : Foo\n{\n    public UnsealedFoo()\n    {\n        // ...\n    }\n\n    public UnsealedFoo(SerializationInfo info, StreamingContext context) // Noncompliant: serialization constructor is not `protected`\n        : base(info, context)\n    {\n        // ...\n    }\n\n    protected void GetObjectData(SerializationInfo info, StreamingContext context) // Noncompliant: GetObjectData is not public virtual\n    {\n        // Noncompliant: does not call base.GetObjectData(info, context)\n    }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic class Bar\n{\n}\n\n[Serializable]\npublic class Foo : ISerializable // Compliant: the class is marked with [Serializable]\n{\n    [NonSerialized]\n    private readonly Bar bar; // Compliant: the field is marked with [NonSerialized]\n\n    public Foo()\n    {\n        // ...\n    }\n\n    protected Foo(SerializationInfo info, StreamingContext context) // Compliant: serialization constructor is present\n    {\n        // ...\n    }\n\n    public virtual void GetObjectData(SerializationInfo info, StreamingContext context)\n    {\n        // ...\n    }\n}\n\n[Serializable]\npublic sealed class SealedFoo : Foo\n{\n    private int val; // Compliant: 'val' is serializable and GetObjectData is overridden\n\n    public SealedFoo()\n    {\n        // ...\n    }\n\n    private SealedFoo(SerializationInfo info, StreamingContext context) // Compliant: serialization constructor is `private`\n        : base(info, context) // Compliant: serialization constructor calls base constructor\n    {\n        // ...\n    }\n\n    public override void GetObjectData(SerializationInfo info, StreamingContext context)\n    {\n        base.GetObjectData(info, context);\n        // ...\n    }\n}\n\n[Serializable]\npublic class UnsealedFoo : Foo\n{\n    public UnsealedFoo()\n    {\n        // ...\n    }\n\n    protected UnsealedFoo(SerializationInfo info, StreamingContext context) // Compliant: serialization constructor is `protected`\n        : base(info, context)\n    {\n        // ...\n    }\n\n    public virtual void GetObjectData(SerializationInfo info, StreamingContext context) // Compliant: GetObjectData is public virtual\n    {\n        base.GetObjectData(info, context); // Compliant: calls base.GetObjectData(info, context)\n        // ...\n\n    }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/standard/design-guidelines/serialization\">Serialization</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.iserializable\"><code>ISerializable</code>\n  Interface</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.serializableattribute\"><code>SerializableAttribute</code>\n  Class</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.nonserializedattribute\"><code>NonSerializedAttribute</code>\n  Class</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.iserializable.getobjectdata\"><code>ISerializable.GetObjectData</code> Method</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.exception\"><code>Exception</code> Class</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3925.json",
    "content": "{\n  \"title\": \"\\\"ISerializable\\\" should be implemented correctly\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3925\",\n  \"sqKey\": \"S3925\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3926.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Fields marked with <code>System.Runtime.Serialization.OptionalFieldAttribute</code> are serialized just like any other field. But such fields are\nignored on deserialization, and retain the default values associated with their types. Therefore, deserialization event handlers should be declared to\nset such fields during the deserialization process.</p>\n<p>This rule raises when at least one field with the <code>System.Runtime.Serialization.OptionalFieldAttribute</code> attribute is declared but one\n(or both) of the following event handlers <code>System.Runtime.Serialization.OnDeserializingAttribute</code> or\n<code>System.Runtime.Serialization.OnDeserializedAttribute</code> are not present.</p>\n<h3>Noncompliant code example</h3>\n<pre>\n[Serializable]\npublic class Foo\n{\n    [OptionalField(VersionAdded = 2)]\n    int optionalField = 5;\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\n[Serializable]\npublic class Foo\n{\n    [OptionalField(VersionAdded = 2)]\n    int optionalField = 5;\n\n    [OnDeserializing]\n    void OnDeserializing(StreamingContext context)\n    {\n\t    optionalField = 5;\n    }\n\n    [OnDeserialized]\n    void OnDeserialized(StreamingContext context)\n    {\n        // Set optionalField if dependent on other deserialized values.\n    }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3926.json",
    "content": "{\n  \"title\": \"Deserialization methods should be provided for \\\"OptionalField\\\" members\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"serialization\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3926\",\n  \"sqKey\": \"S3926\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3927.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Serialization event handlers that don’t have the correct signature will not be called, bypassing augmentations to automated serialization and\ndeserialization events.</p>\n<p>A method is designated a serialization event handler by applying one of the following serialization event attributes:</p>\n<ul>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.onserializingattribute\"><code>OnSerializingAttribute</code></a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.onserializedattribute\"><code>OnSerializedAttribute</code></a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.ondeserializingattribute\"><code>OnDeserializingAttribute</code></a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.ondeserializedattribute\"><code>OnDeserializedAttribute</code></a></li>\n</ul>\n<p>Serialization event handlers take a single parameter of type <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.streamingcontext\"><code>StreamingContext</code></a>, return\n<code>void</code>, and have <code>private</code> visibility.</p>\n<p>This rule raises an issue when any of these constraints are not respected.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\n[Serializable]\npublic class Foo\n{\n    [OnSerializing]\n    public void OnSerializing(StreamingContext context) {} // Noncompliant: should be private\n\n    [OnSerialized]\n    int OnSerialized(StreamingContext context) {} // Noncompliant: should return void\n\n    [OnDeserializing]\n    void OnDeserializing() {} // Noncompliant: should have a single parameter of type StreamingContext\n\n    [OnSerializing]\n    public void OnSerializing2&lt;T&gt;(StreamingContext context) {} // Noncompliant: should have no type parameters\n\n    [OnDeserialized]\n    void OnDeserialized(StreamingContext context, string str) {} // Noncompliant: should have a single parameter of type StreamingContext\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n[Serializable]\npublic class Foo\n{\n    [OnSerializing]\n    private void OnSerializing(StreamingContext context) {}\n\n    [OnSerialized]\n    private void OnSerialized(StreamingContext context) {}\n\n    [OnDeserializing]\n    private void OnDeserializing(StreamingContext context) {}\n\n    [OnDeserialized]\n    private void OnDeserialized(StreamingContext context) {}\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/visualstudio/code-quality/ca2238\">CA2238: Implement serialization methods\n  correctly</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3927.json",
    "content": "{\n  \"title\": \"Serialization event handlers should be implemented correctly\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3927\",\n  \"sqKey\": \"S3927\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3928.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Some constructors of the <code>ArgumentException</code>, <code>ArgumentNullException</code>, <code>ArgumentOutOfRangeException</code> and\n<code>DuplicateWaitObjectException</code> classes must be fed with a valid parameter name. This rule raises an issue in two cases:</p>\n<ul>\n  <li>When this parameter name doesn’t match any existing ones.</li>\n  <li>When a call is made to the default (parameterless) constructor</li>\n</ul>\n<h3>Noncompliant code example</h3>\n<pre>\npublic void Foo(Bar a, int[] b)\n{\n  throw new ArgumentException();                                        // Noncompliant\n  throw new ArgumentException(\"My error message\", \"c\");                 // Noncompliant\n  throw new ArgumentException(\"My error message\", \"c\", innerException); // Noncompliant\n\n  throw new ArgumentNullException(\"c\");                     // Noncompliant\n  throw new ArgumentNullException(nameof(c));               // Noncompliant\n  throw new ArgumentNullException(\"My error message\", \"a\"); // Noncompliant\n\n  throw new ArgumentOutOfRangeException(\"c\");                           // Noncompliant\n  throw new ArgumentOutOfRangeException(\"c\", \"My error message\");       // Noncompliant\n  throw new ArgumentOutOfRangeException(\"c\", b, \"My error message\");    // Noncompliant\n\n  throw new DuplicateWaitObjectException(\"c\", \"My error message\");      // Noncompliant\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic void Foo(Bar a, int[] b)\n{\n  throw new ArgumentException(\"My error message\", \"a\");\n  throw new ArgumentException(\"My error message\", \"b\", innerException);\n\n  throw new ArgumentNullException(\"a\");\n  throw new ArgumentNullException(nameof(a));\n  throw new ArgumentNullException(\"a\", \"My error message\");\n\n  throw new ArgumentOutOfRangeException(\"b\");\n  throw new ArgumentOutOfRangeException(\"b\", \"My error message\");\n  throw new ArgumentOutOfRangeException(\"b\", b, \"My error message\");\n\n  throw new DuplicateWaitObjectException(\"b\", \"My error message\");\n}\n</pre>\n<h3>Exceptions</h3>\n<p>The rule won’t raise an issue if the parameter name is not a constant value.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3928.json",
    "content": "{\n  \"title\": \"Parameter names used into ArgumentException constructors should match an existing one \",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3928\",\n  \"sqKey\": \"S3928\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3937.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The use of punctuation characters to separate subgroups in a number can make the number more readable. For instance consider 1,000,000,000 versus\n1000000000. But when the grouping is irregular, such as 1,000,00,000; it indicates an error.</p>\n<p>This rule raises an issue when underscores (<code>_</code>) are used to break a number into irregular subgroups.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nint thousand = 100_0;\nint tenThousand = 100_00;\nint million = 1_000_00_000;\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nint thousand = 1000;\nint tenThousand = 10_000;\nint tenThousandWithout = 10000;\nint duos = 1_00_00;\nint million = 100_000_000;\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3937.json",
    "content": "{\n  \"title\": \"Number patterns should be regular\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"FORMATTED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-3937\",\n  \"sqKey\": \"S3937\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3949.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Numbers are infinite, but the types that hold them are not. Each numeric type has hard upper and lower bounds. Try to calculate or assign numbers\nbeyond those bounds, and the result will be a value that has silently wrapped around from the expected positive value to a negative one, or vice\nversa.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic int Transform(int value)\n{\n    if (value &lt;= 0)\n    {\n        return value;\n    }\n    int number = int.MaxValue;\n    return number + value;  // Noncompliant\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic long Transform(int value)\n{\n    if (value &lt;= 0)\n    {\n        return value;\n    }\n    long number = int.MaxValue;\n    return number + value;\n}\n</pre>\n<h2>Resources</h2>\n<h3>Standards</h3>\n<ul>\n  <li>STIG Viewer - <a href=\"https://stigviewer.com/stigs/application_security_and_development/2024-12-06/finding/V-222612\">Application Security and\n  Development: V-222612</a> - The application must not be vulnerable to overflow attacks.</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3949.json",
    "content": "{\n  \"title\": \"Calculations should not overflow\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"overflow\",\n    \"symbolic-execution\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3949\",\n  \"sqKey\": \"S3949\",\n  \"scope\": \"All\",\n  \"securityStandards\": {\n    \"STIG ASD_V5R3\": [\n      \"V-222612\"\n    ]\n  },\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3956.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><code>System.Collections.Generic.List&lt;T&gt;</code> is a generic collection that is designed for performance and not inheritance. For example, it\ndoes not contain virtual members that make it easier to change the behavior of an inherited class. That means that future attempts to expand the\nbehavior will be spoiled because the extension points simply aren’t there. Instead, one of the following generic collections should be used:</p>\n<ul>\n  <li><code>System.Collections.Generic.IEnumerable&lt;T&gt;</code></li>\n  <li><code>System.Collections.Generic.IReadOnlyCollection&lt;T&gt;</code></li>\n  <li><code>System.Collections.Generic.ICollection&lt;TKey&gt;</code></li>\n  <li><code>System.Collections.Generic.IReadOnlyList&lt;T&gt;</code></li>\n  <li><code>System.Collections.Generic.IList&lt;TKey&gt;</code></li>\n  <li><code>System.Collections.ObjectModel.Collection&lt;T&gt;</code></li>\n  <li><code>System.Collections.ObjectModel.ReadOnlyCollection&lt;T&gt;</code></li>\n  <li><code>System.Collections.ObjectModel.KeyedCollection&lt;TKey, Titem&gt;</code></li>\n</ul>\n<p>This rule raises an issue every time a <code>System.Collections.Generic.List&lt;T&gt;</code> is exposed:</p>\n<ul>\n  <li>As an externally visible member.</li>\n  <li>As the return type of an externally visible method.</li>\n  <li>As a parameter type of an an externally visible method.</li>\n</ul>\n<h3>Noncompliant code example</h3>\n<pre>\nnamespace Foo\n{\n   public class Bar\n   {\n      public List&lt;T&gt; Method1(T arg) // Noncompliant\n      {\n           //...\n      }\n   }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nnamespace Foo\n{\n   public class Bar\n   {\n      public Collection&lt;T&gt; Method1(T arg)\n      {\n           //...\n      }\n   }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3956.json",
    "content": "{\n  \"title\": \"\\\"Generic.List\\\" instances should not be part of public APIs\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"api-design\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3956\",\n  \"sqKey\": \"S3956\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3962.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The value of a <code>static readonly</code> field is computed at runtime while the value of a <code>const</code> field is calculated at compile\ntime, which improves performance.</p>\n<p>This rule raises an issue when a <code>static readonly</code> field is initialized with a value that is computable at compile time.</p>\n<p>As specified by Microsoft, the list of types that can have a constant value are:</p>\n<table>\n  <colgroup>\n    <col style=\"width: 50%;\">\n    <col style=\"width: 50%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>C# type</th>\n      <th>.Net Fwk type</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p>bool</p>\n      </td>\n      <td>\n        <p>System.Boolean</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>byte</p>\n      </td>\n      <td>\n        <p>System.Byte</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>sbyte</p>\n      </td>\n      <td>\n        <p>System.SByte</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>char</p>\n      </td>\n      <td>\n        <p>System.Char</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>decimal</p>\n      </td>\n      <td>\n        <p>System.Decimal</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>double</p>\n      </td>\n      <td>\n        <p>System.Double</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>float</p>\n      </td>\n      <td>\n        <p>System.Single</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>int</p>\n      </td>\n      <td>\n        <p>System.Int32</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>uint</p>\n      </td>\n      <td>\n        <p>System.UInt32</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>long</p>\n      </td>\n      <td>\n        <p>System.Int64</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ulong</p>\n      </td>\n      <td>\n        <p>System.UInt64</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>short</p>\n      </td>\n      <td>\n        <p>System.Int16</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ushort</p>\n      </td>\n      <td>\n        <p>System.UInt16</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>string</p>\n      </td>\n      <td>\n        <p>System.String</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h3>Noncompliant code example</h3>\n<pre>\nnamespace myLib\n{\n  public class Foo\n  {\n    static readonly int x = 1;  // Noncompliant\n    static readonly int y = x + 4; // Noncompliant\n    static readonly string s = \"Bar\";  // Noncompliant\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nnamespace myLib\n{\n  public class Foo\n  {\n    const int x = 1;\n    const int y = x + 4;\n    const string s = \"Bar\";\n  }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3962.json",
    "content": "{\n  \"title\": \"\\\"static readonly\\\" constants should be \\\"const\\\" instead\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3962\",\n  \"sqKey\": \"S3962\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3963.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When a <code>static</code> constructor serves no other purpose that initializing <code>static</code> fields, it comes with an unnecessary\nperformance cost because the compiler generates a check before each <code>static</code> method or instance constructor invocation.</p>\n<p>Instead, inline initialization is highly recommended.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nnamespace myLib\n{\n  public class Foo\n  {\n    static int i;\n    static string s;\n\n    static Foo() // Noncompliant\n    {\n      i = 3;\n      ResourceManager sm =  new ResourceManager(\"strings\", Assembly.GetExecutingAssembly());\n      s = sm.GetString(\"mystring\");\n    }\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nnamespace myLib\n{\n  public class Foo\n  {\n    static int i =3;\n    static string s = InitString();\n\n    static string InitString()\n    {\n      ResourceManager sm = new ResourceManager(\"strings\", Assembly.GetExecutingAssembly());\n      return sm.GetString(\"mystring\");\n    }\n  }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3963.json",
    "content": "{\n  \"title\": \"\\\"static\\\" fields should be initialized inline\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3963\",\n  \"sqKey\": \"S3963\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3966.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Disposing an object twice in the same method, either with the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/using\">using</a> keyword or by calling <code>Dispose</code>\ndirectly, is confusing and error-prone. For example, another developer might try to use an already-disposed object, or there can be runtime errors for\nspecific paths in the code.</p>\n<p>In addition, even if the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.idisposable.dispose#System_IDisposable_Dispose\">documentation</a> explicitly states that\ncalling the <code>Dispose</code> method multiple times should not throw an exception, some implementations still do it. Thus it is safer to not\ndispose of an object twice when possible.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nvar foo = new Disposable();\nfoo.Dispose();\nfoo.Dispose(); // Noncompliant\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nusing (var bar = new Disposable()) // Noncompliant\n{\n    bar.Dispose();\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nvar foo = new Disposable();\nfoo.Dispose();\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nusing (var bar = new Disposable()) // Compliant\n{\n\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.idisposable.dispose?redirectedfrom=MSDN#System_IDisposable_Dispose\">Dispose\n  method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.iasyncdisposable.disposeasync\">DisposeAsync method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/implementing-dispose\">Implement a Dispose method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/implementing-disposeasync\">Implement a DisposeAsync\n  method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/using\">Using statement</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3966.json",
    "content": "{\n  \"title\": \"Objects should not be disposed more than once\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"confusing\",\n    \"pitfall\",\n    \"symbolic-execution\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3966\",\n  \"sqKey\": \"S3966\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3967.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>A jagged array is an array whose elements are arrays. It is recommended over a multidimensional array because the arrays that make up the elements\ncan be of different sizes, which avoids wasting memory space.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nint [,] myArray =  // Noncompliant\n    {\n        {1,2,3,4},\n        {5,6,7,0},\n        {8,0,0,0},\n        {9,0,0,0}\n    };\n// ...\nmyArray[1,1] = 0;\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nint[][] myArray =\n    {\n        new int[] {1,2,3,4},\n        new int[] {5,6,7},\n        new int[] {8},\n        new int[] {9}\n    };\n// ...\nmyArray[1][1] = 0;\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3967.json",
    "content": "{\n  \"title\": \"Multidimensional arrays should not be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"design\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3967\",\n  \"sqKey\": \"S3967\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3971.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><code>GC.SuppressFinalize</code> requests that the system not call the finalizer for the specified object. This should only be done when\nimplementing <code>Dispose</code> as part of the <a\nhref=\"https://docs.microsoft.com/en-us/dotnet/standard/garbage-collection/implementing-dispose\">Dispose Pattern</a>.</p>\n<p>This rule raises an issue when <code>GC.SuppressFinalize</code> is called outside that pattern.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3971.json",
    "content": "{\n  \"title\": \"\\\"GC.SuppressFinalize\\\" should not be called\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3971\",\n  \"sqKey\": \"S3971\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3972.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Placing an <code>if</code> statement on the same line as the closing <code>}</code> from a preceding <code>if</code>, <code>else</code>, or\n<code>else if</code> block can lead to confusion and potential errors. It may indicate a missing <code>else</code> statement or create ambiguity for\nmaintainers who might fail to understand that the two statements are unconnected.</p>\n<p>The following code snippet is confusing:</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nif (condition1) {\n  // ...\n} if (condition2) {  // Noncompliant\n  //...\n}\n</pre>\n<p>Either the two conditions are unrelated and they should be visually separated:</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nif (condition1) {\n  // ...\n}\n\nif (condition2) {\n  //...\n}\n</pre>\n<p>Or they were supposed to be exclusive and you should use <code>else if</code> instead:</p>\n<pre>\nif (condition1) {\n  // ...\n} else if (condition2) {\n  //...\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/selection-statements#the-if-statement\">If\n  statement</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3972.json",
    "content": "{\n  \"title\": \"Conditionals should start on new lines\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"FORMATTED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-3972\",\n  \"sqKey\": \"S3972\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3973.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When the line immediately after conditional statements has neither curly braces nor indentation, the intent of the code is unclear and perhaps not\nexecuted as expected. Additionally, such code is confusing to maintainers.</p>\n<p>The rule will check the line indentation after the following conditional statements:</p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/selection-statements#the-if-statement\">if and if-else\n  statements</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/iteration-statements#the-for-statement\">for\n  statement</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/iteration-statements#the-foreach-statement\">foreach\n  statement</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/iteration-statements#the-do-statement\">do\n  statement</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/iteration-statements#the-while-statement\">while\n  statement</a></li>\n</ul>\n<pre>\nif (condition)  // Noncompliant\nDoTheThing();\nDoTheOtherThing(); // Was the intent to call this function unconditionally?\n</pre>\n<p>It becomes even more confusing and bug-prone if lines get commented out.</p>\n<pre>\nif (condition)  // Noncompliant\n//   DoTheThing();\nDoTheOtherThing(); // Was the intent to call this function conditionally?\n</pre>\n<p>Indentation alone or together with curly braces makes the intent clear.</p>\n<pre>\nif (condition)\n  DoTheThing();\nDoTheOtherThing(); // Clear intent to call this function unconditionally\n\n// or\n\nif (condition)\n{\n  DoTheThing();\n}\nDoTheOtherThing(); // Clear intent to call this function unconditionally\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3973.json",
    "content": "{\n  \"title\": \"A conditionally executed single line should be denoted by indentation\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"FORMATTED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"confusing\",\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-3973\",\n  \"sqKey\": \"S3973\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3981.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The size of a collection and the length of an array are always greater than or equal to zero. Testing it doesn’t make sense, since the result is\nalways <code>true</code>.</p>\n<pre>\nif(collection.Count &gt;= 0){...} // Noncompliant: always true\n\nif(array.Length &gt;= 0){...} // Noncompliant: always true\n</pre>\n<p>Similarly testing that it is less than zero will always return <code>false</code>.</p>\n<pre>\nif(enumerable.Count() &lt; 0){...} // Noncompliant: always false\n</pre>\n<p>Fix the code to properly check for emptiness if it was the intent, or remove the redundant code to keep the current behavior.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3981.json",
    "content": "{\n  \"title\": \"Collection sizes and array length comparisons should make sense\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"confusing\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3981\",\n  \"sqKey\": \"S3981\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3984.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Creating a new <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.exception\"><code>Exception</code></a> without actually throwing does\nnot achieve the intended purpose.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nif (x &lt; 0)\n{\n    new ArgumentException(\"x must be nonnegative\");\n}\n</pre>\n<p>Ensure to throw the <code>Exception</code> with a <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/exception-handling-statements#the-throw-statement\"><code>throw</code>\nstatement</a>.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nif (x &lt; 0)\n{\n    throw new ArgumentException(\"x must be nonnegative\");\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.exception\"><code>Exception</code> Class</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/exception-handling-statements\">Exception-handling statements -\n  <code>throw</code>, <code>try-catch</code>, <code>try-finally</code>, and <code>try-catch-finally</code></a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3984.json",
    "content": "{\n  \"title\": \"Exceptions should not be created without being thrown\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"error-handling\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3984\",\n  \"sqKey\": \"S3984\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3990.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Assemblies should conform with the Common Language Specification (CLS) in order to be usable across programming languages. To be compliant an\nassembly has to indicate it with <code>System.CLSCompliantAttribute</code>.</p>\n<h3>Compliant solution</h3>\n<pre>\nusing System;\n\n[assembly:CLSCompliant(true)]\nnamespace MyLibrary\n{\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3990.json",
    "content": "{\n  \"title\": \"Assemblies should be marked as CLS compliant\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1min\"\n  },\n  \"tags\": [\n    \"api-design\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3990\",\n  \"sqKey\": \"S3990\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3992.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Assemblies should explicitly indicate whether they are meant to be COM visible or not. If the <code>ComVisibleAttribute</code> is not present, the\ndefault is to make the content of the assembly visible to COM clients.</p>\n<p>Note that COM visibility can be overridden for individual types and members.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nusing System;\n\nnamespace MyLibrary  // Noncompliant\n{\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nusing System;\n\n[assembly: System.Runtime.InteropServices.ComVisible(false)]\nnamespace MyLibrary\n{\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3992.json",
    "content": "{\n  \"title\": \"Assemblies should explicitly specify COM visibility\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1min\"\n  },\n  \"tags\": [\n    \"api-design\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3992\",\n  \"sqKey\": \"S3992\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3993.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When defining custom attributes, <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.attributeusageattribute\">AttributeUsageAttribute</a>\nmust be used to indicate where the attribute can be applied. This will:</p>\n<ul>\n  <li>indicate how the attribute can be used</li>\n  <li>prevent it from being used at invalid locations</li>\n</ul>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic sealed class MyAttribute : Attribute // Noncompliant - AttributeUsage is missing\n{\n    private string text;\n\n    public MyAttribute(string text)\n    {\n        this.text = text;\n    }\n\n    public string Text =&gt; text;\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n[AttributeUsage(AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Interface | AttributeTargets.Delegate)]\npublic sealed class MyAttribute : Attribute\n{\n    private string text;\n\n    public MyAttribute(string text)\n    {\n        this.text = text;\n    }\n\n    public string Text =&gt; text;\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/advanced-topics/reflection-and-attributes/creating-custom-attributes\">Create custom\n  attributes</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.attributeusageattribute\">AttributeUsageAttribute class</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.attribute\">Attribute class</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3993.json",
    "content": "{\n  \"title\": \"Custom attributes should be marked with \\\"System.AttributeUsageAttribute\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"api-design\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3993\",\n  \"sqKey\": \"S3993\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3994.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>String representations of URIs or URLs are prone to parsing and encoding errors which can lead to vulnerabilities. The <code>System.Uri</code>\nclass is a safe alternative and should be preferred. At minimum, an overload of the method taking a <code>System.Uri</code> as a parameter should be\nprovided in each class that contains a method with an apparent Uri passed as a <code>string</code>.</p>\n<p>This rule raises issues when a method has a string parameter with a name containing \"uri\", \"Uri\", \"urn\", \"Urn\", \"url\" or \"Url\", and the type\ndoesn’t declare a corresponding overload taking an <code>System.Uri</code> parameter instead.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nusing System;\n\nnamespace MyLibrary\n{\n   public class MyClass\n   {\n\n      public void FetchResource(string uriString) { } // Noncompliant\n   }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nusing System;\n\nnamespace MyLibrary\n{\n   public class MyClass\n   {\n\n      public void FetchResource(string uriString)\n      {\n          FetchResource(new Uri(uriString));\n      }\n\n      public void FetchResource(Uri uri) { }\n   }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3994.json",
    "content": "{\n  \"title\": \"URI Parameters should not be strings\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3994\",\n  \"sqKey\": \"S3994\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3995.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>String representations of URIs or URLs are prone to parsing and encoding errors which can lead to vulnerabilities. The <code>System.Uri</code>\nclass is a safe alternative and should be preferred.</p>\n<p>This rule raises an issue when a method has a <code>string</code> return type and its name contains \"Uri\", \"Urn\", or \"Url\" or begins with \"uri\",\n\"urn\", or \"url\".</p>\n<h3>Noncompliant code example</h3>\n<pre>\nusing System;\n\nnamespace MyLibrary\n{\n   public class MyClass\n   {\n      public string GetParentUri() // Noncompliant\n      {\n         return \"http://www.mysite.com\";\n      }\n   }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nusing System;\n\nnamespace MyLibrary\n{\n   public class MyClass\n   {\n\n      public Uri GetParentUri()\n      {\n         return new URI(\"http://www.mysite.com\");\n      }\n   }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3995.json",
    "content": "{\n  \"title\": \"URI return values should not be strings\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3995\",\n  \"sqKey\": \"S3995\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3996.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>String representations of URIs or URLs are prone to parsing and encoding errors which can lead to vulnerabilities. The <code>System.Uri</code>\nclass is a safe alternative and should be preferred.</p>\n<p>This rule raises an issue when a property is a string type and its name contains \"uri\", \"Uri\", \"urn\", \"Urn\", \"url\" or \"Url\".</p>\n<h3>Noncompliant code example</h3>\n<pre>\nusing System;\n\nnamespace MyLibrary\n{\n   public class MyClass\n   {\n      string myUri;\n\n      public string MyUri // Noncompliant\n      {\n         get { return myURI; }\n         set { myUri = value; }\n      }\n   }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nusing System;\n\nnamespace MyLibrary\n{\n   public class MyClass\n   {\n      Uri myUri;\n\n      public Uri MyUri\n      {\n         get { return myURI; }\n         set { myUri = value; }\n      }\n   }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3996.json",
    "content": "{\n  \"title\": \"URI properties should not be strings\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3996\",\n  \"sqKey\": \"S3996\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3997.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>String representations of URIs or URLs are prone to parsing and encoding errors which can lead to vulnerabilities. The <code>System.Uri</code>\nclass is a safe alternative and should be preferred.</p>\n<p>This rule raises an issue when two overloads differ only by the string / <code>Uri</code> parameter and the string overload doesn’t call the\n<code>Uri</code> overload. It is assumed that the string parameter represents a URI because of the exact match besides that parameter type. It stands\nto reason that the safer overload should be used.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nusing System;\n\nnamespace MyLibrary\n{\n   public class MyClass\n   {\n      public void FetchResource(string uriString) // Noncompliant\n      {\n         // No calls to FetResource(Uri)\n      }\n\n      public void FetchResource(Uri uri) { }\n   }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nusing System;\n\nnamespace MyLibrary\n{\n   public class MyClass\n   {\n      public void FetchResource(string uriString)\n      {\n          FetchResource(new Uri(uriString));\n      }\n\n      public void FetchResource(Uri uri) { }\n   }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3997.json",
    "content": "{\n  \"title\": \"String URI overloads should call \\\"System.Uri\\\" overloads\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3997\",\n  \"sqKey\": \"S3997\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S3998.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Objects that can be accessed across <a href=\"https://learn.microsoft.com/en-us/dotnet/framework/app-domains/application-domains\">application\ndomain</a> boundaries are said to have weak identity. This means that these objects can be considered shared resources outside of the domain, which\ncan be lead to them being accessed or modified by multiple threads or concurrent parts of a program, outside of the domain.</p>\n<p>A <a href=\"https://en.wikipedia.org/wiki/Thread_(computing)\">thread</a> acquiring a <a\nhref=\"https://en.wikipedia.org/wiki/Lock_(computer_science)\">lock</a> on such an object runs the risk of being blocked by another thread in a\ndifferent application domain, leading to poor performance and potentially <a\nhref=\"https://stackoverflow.com/questions/1162587/what-is-starvation\">thread starvation</a> and <a\nhref=\"https://en.wikipedia.org/wiki/Deadlock\">deadlocks</a>.</p>\n<p>Types with weak identity are:</p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.marshalbyrefobject\">MarshalByRefObject</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.executionengineexception\">ExecutionEngineException</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.outofmemoryexception\">OutOfMemoryException</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.stackoverflowexception\">StackOverflowException</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string\">String</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.reflection.memberinfo\">MemberInfo</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.reflection.parameterinfo\">ParameterInfo</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.thread\">Thread</a></li>\n</ul>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic class Sample\n{\n    private readonly StackOverflowException myLock = new();\n\n    public void Go()\n    {\n        lock (myLock) // Noncompliant\n        {\n            // ...\n        }\n    }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic class Sample\n{\n    private readonly object myLock = new();\n\n    public void Go()\n    {\n        lock (myLock)\n        {\n            // ...\n        }\n    }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Thread_(computing)\">Thread</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Lock_(computer_science)\">Locking</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Deadlock\">Deadlock</a></li>\n  <li><a href=\"https://docs.microsoft.com/en-us/dotnet/standard/threading/managed-threading-best-practices\">Managed Threading Best Practices</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/framework/app-domains/application-domains\">Application domains</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li><a href=\"https://stackoverflow.com/questions/1162587/what-is-starvation\">What is (thread) starvation?</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Readers%E2%80%93writers_problem\">Readers-writers problem</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Dining_philosophers_problem\">Dining philosophers problem</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S3998.json",
    "content": "{\n  \"title\": \"Threads should not lock on objects with weak identity\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"multi-threading\",\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-3998\",\n  \"sqKey\": \"S3998\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4000.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Pointer and unmanaged function pointer types such as <code>IntPtr</code>, <code>UIntPtr</code>, <code>int*</code> etc. are used to access unmanaged\nmemory, usually in order to use C or C++ libraries. If such a pointer is not secured by making it <code>private</code>, <code>internal</code> or\n<code>readonly</code>, it can lead to a vulnerability allowing access to arbitrary locations.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nusing System;\n\nnamespace MyLibrary\n{\n  public class MyClass\n  {\n    public IntPtr myPointer;  // Noncompliant\n    protected UIntPtr myOtherPointer; // Noncompliant\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nusing System;\n\nnamespace MyLibrary\n{\n  public class MyClass\n  {\n    private IntPtr myPointer;\n    protected readonly UIntPtr myOtherPointer;\n  }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4000.json",
    "content": "{\n  \"title\": \"Pointers to unmanaged memory should not be visible\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-4000\",\n  \"sqKey\": \"S4000\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4002.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>This rule raises an issue when a disposable type contains fields of the following types and does not implement a finalizer:</p>\n<ul>\n  <li><code>System.IntPtr</code></li>\n  <li><code>System.UIntPtr</code></li>\n  <li><code>System.Runtime.InteropService.HandleRef</code></li>\n</ul>\n<h3>Noncompliant code example</h3>\n<pre>\nusing System;\nusing System.Runtime.InteropServices;\n\nnamespace MyLibrary\n{\n  public class Foo : IDisposable // Noncompliant: Doesn't have a finalizer\n  {\n    private IntPtr myResource;\n    private bool disposed = false;\n\n    protected virtual void Dispose(bool disposing)\n    {\n      if (!disposed)\n      {\n        // Dispose of resources held by this instance.\n        FreeResource(myResource);\n        disposed = true;\n\n        // Suppress finalization of this disposed instance.\n        if (disposing)\n        {\n          GC.SuppressFinalize(this);\n        }\n      }\n    }\n\n    public void Dispose() {\n      Dispose(true);\n    }\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nusing System;\nusing System.Runtime.InteropServices;\n\nnamespace MyLibrary\n{\n  public class Foo : IDisposable\n  {\n    private IntPtr myResource;\n    private bool disposed = false;\n\n    protected virtual void Dispose(bool disposing)\n    {\n      if (!disposed)\n      {\n        // Dispose of resources held by this instance.\n        FreeResource(myResource);\n        disposed = true;\n\n        // Suppress finalization of this disposed instance.\n        if (disposing)\n        {\n          GC.SuppressFinalize(this);\n        }\n      }\n    }\n\n    ~Foo()\n    {\n      Dispose(false);\n    }\n  }\n}\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li>Related: {rule:csharpsquid:S3881} - \"IDisposable\" should be implemented correctly</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4002.json",
    "content": "{\n  \"title\": \"Disposable types should declare finalizers\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-4002\",\n  \"sqKey\": \"S4002\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4004.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>A writable collection property can be replaced by a completely different collection. Making it <code>readonly</code> prevents that while still\nallowing individual members to be set. If you want to allow the replacement of the whole collection the recommended pattern is to implement a method\nto remove all the elements (e.g. <code>System.Collections.List&lt;T&gt;.Clear</code>) and a method to populate the collection (e.g.\n<code>System.Collections.List&lt;T&gt;.AddRange</code>).</p>\n<p>This rule raises an issue when an externally visible writable property is of a type that implements <code>System.Collections.ICollection</code> or\n<code>System.Collections.Generic.ICollection&lt;T&gt;</code>.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nusing System;\nusing System.Collections;\n\nnamespace MyLibrary\n{\n  public class Foo\n  {\n    List&lt;string&gt; strings;\n\n    public List&lt;string&gt; SomeStrings\n    {\n      get { return strings; }\n      set { strings = value; } // Noncompliant\n    }\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nusing System;\nusing System.Collections;\n\nnamespace MyLibrary\n{\n  public class Foo\n  {\n    List&lt;string&gt; strings;\n\n    public List&lt;string&gt; SomeStrings\n    {\n      get { return strings; }\n    }\n  }\n}\n</pre>\n<h3>Exceptions</h3>\n<p>This rule does not raise issues for</p>\n<ul>\n  <li><code>string</code>, <code>Array</code> and <code>PermissionSet,</code></li>\n  <li>properties marked as <code>DataMemberAttribute</code></li>\n  <li>classes marked as <code>Serializable</code></li>\n  <li>properties overriding a base class member</li>\n  <li>properties implementing interface</li>\n</ul>\n<p>&nbsp;</p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4004.json",
    "content": "{\n  \"title\": \"Collection properties should be readonly\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-4004\",\n  \"sqKey\": \"S4004\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4005.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>String representations of URIs or URLs are prone to parsing and encoding errors which can lead to vulnerabilities. The <code>System.Uri</code>\nclass is a safe alternative and should be preferred.</p>\n<p>This rule raises an issue when a called method has a string parameter with a name containing \"uri\", \"Uri\", \"urn\", \"Urn\", \"url\" or \"Url\" and the\ndeclaring type contains a corresponding overload that takes a <code>System.Uri</code> as a parameter.</p>\n<p>When there is a choice between two overloads that differ only regarding the representation of a URI, the user should choose the overload that takes\na <code>System.Uri</code> argument.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nusing System;\n\nnamespace MyLibrary\n{\n   public class Foo\n   {\n      public void FetchResource(string uriString) { }\n      public void FetchResource(Uri uri) { }\n\n      public string ReadResource(string uriString, string name, bool isLocal) { }\n      public string ReadResource(Uri uri, string name, bool isLocal) { }\n\n      public void Main() {\n        FetchResource(\"http://www.mysite.com\"); // Noncompliant\n        ReadResource(\"http://www.mysite.com\", \"foo-resource\", true); // Noncompliant\n      }\n   }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nusing System;\n\nnamespace MyLibrary\n{\n   public class Foo\n   {\n      public void FetchResource(string uriString) { }\n      public void FetchResource(Uri uri) { }\n\n      public string ReadResource(string uriString, string name, bool isLocal) { }\n      public string ReadResource(Uri uri, string name, bool isLocal) { }\n\n      public void Main() {\n        FetchResource(new Uri(\"http://www.mysite.com\"));\n        ReadResource(new Uri(\"http://www.mysite.com\"), \"foo-resource\", true);\n      }\n   }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4005.json",
    "content": "{\n  \"title\": \"\\\"System.Uri\\\" arguments should be used instead of strings\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-4005\",\n  \"sqKey\": \"S4005\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4015.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Decreasing the <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/access-modifiers\">accessibility\nlevel</a> of an inherited method that is not <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/override\">overridable</a> to <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/private\">private</a> will shadow the name of the base method and can\nlead to confusion.</p>\n<pre>\npublic class Base\n{\n    public void SomeMethod(int count) { }\n}\npublic class Derived : Base\n{\n    private void SomeMethod(int count) { } // Noncompliant\n}\n\nclass Program\n{\n    public void DoWork()\n    {\n        var derived = new Derived();\n        derived.SomeMethod(42); // Base.SomeMethod is accessed here\n    }\n}\n</pre>\n<p>Another potential problem is the case of a class deriving from <code>Derived</code> and accessing <code>SomeMethod</code>. In this scenario, the\nmethod accessed will instead be the <code>Base</code> implementation, which might not be what was expected.</p>\n<pre>\npublic class Base\n{\n    public void SomeMethod(int count) { }\n}\npublic class Derived : Base\n{\n    private void SomeMethod(int count) { } // Noncompliant\n}\n\npublic class SecondDerived : Derived\n{\n    public void DoWork()\n    {\n        SomeMethod(42); // Base.SomeMethod is accessed here\n    }\n}\n</pre>\n<p>One way to mitigate this, is by sealing the <code>Derived</code> class by using the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/sealed\">sealed</a> modifier, thus preventing inheritance from this\npoint on.</p>\n<pre>\npublic class Base\n{\n    public void SomeMethod(int count) { }\n}\npublic sealed class Derived : Base\n{\n    private void SomeMethod(int count) { } // Compliant: class is marked as sealed\n}\n</pre>\n<p>Another way to mitigate this, is by having the <code>Derived</code> implementation match the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/access-modifiers\">accessibility</a> modifier of the\n<code>Base</code> implementation of <code>SomeMethod</code>. From a caller’s perspective, this is closer to the expected behavior.</p>\n<pre>\nusing System;\n\nnamespace MyLibrary\n{\n    public class Base\n    {\n        public void SomeMethod(int count) { }\n    }\n    public class Derived : Base\n    {\n        public void SomeMethod(int count) { } // Compliant: same accessibility as Base.SomeMethod\n    }\n\n    public class Program\n    {\n        public void DoWork()\n        {\n            var derived = new Derived();\n            derived.SomeMethod(42); // Derived.SomeMethod is called\n        }\n    }\n}\n</pre>\n<p>Last but not least, consider using a different name for the <code>Derived</code> method, thus completely eliminating any confusion caused by the\nnaming collision.</p>\n<pre>\npublic class Base\n{\n    public void SomeMethod(int count) { }\n}\npublic class Derived : Base\n{\n    private void SomeOtherMethod(int count) { } // Compliant\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/access-modifiers\">Access Modifiers</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/override\">override</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/sealed\">sealed</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4015.json",
    "content": "{\n  \"title\": \"Inherited member visibility should not be decreased\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-4015\",\n  \"sqKey\": \"S4015\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4016.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>If an <code>enum</code> member’s name contains the word \"reserved\" it implies it is not currently used and will be change in the future. However\nchanging an <code>enum</code> member is a breaking change and can create significant problems. There is no need to reserve an <code>enum</code> member\nsince a new member can be added in the future, and such an addition will usually not be a breaking change.</p>\n<p>This rule raises an issue when the name of an enumeration member contains \"reserved\".</p>\n<h3>Noncompliant code example</h3>\n<pre>\nusing System;\n\nnamespace MyLibrary\n{\n  public enum Color\n  {\n        None,\n        Red,\n        Orange,\n        Yellow,\n        ReservedColor  // Noncompliant\n    }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4016.json",
    "content": "{\n  \"title\": \"Enumeration members should not be named \\\"Reserved\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-4016\",\n  \"sqKey\": \"S4016\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4017.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>A nested type is a type argument that is also a generic type. Calling a method with such a nested type argument requires complicated and confusing\ncode. It should be avoided as much as possible.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nusing System;\nusing System.Collections.Generic;\n\nnamespace MyLibrary\n{\n  public class Foo\n  {\n    public void DoSomething(ICollection&lt;ICollection&lt;int&gt;&gt; outerCollect) // Noncompliant\n    {\n    }\n  }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4017.json",
    "content": "{\n  \"title\": \"Method signatures should not contain nested generic types\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"tags\": [\n    \"confusing\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-4017\",\n  \"sqKey\": \"S4017\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4018.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Type inference enables the call of a generic method without explicitly specifying its type arguments. This is not possible when a parameter type is\nmissing from the argument list.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nusing System;\n\nnamespace MyLibrary\n{\n  public class Foo\n  {\n    public void MyMethod&lt;T&gt;()  // Noncompliant\n    {\n        // this method can only be invoked by providing the type argument e.g. 'MyMethod&lt;int&gt;()'\n    }\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nusing System;\n\nnamespace MyLibrary\n{\n  public class Foo\n  {\n    public void MyMethod&lt;T&gt;(T param)\n    {\n        // type inference allows this to be invoked 'MyMethod(arg)'\n    }\n  }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4018.json",
    "content": "{\n  \"title\": \"All type parameters should be used in the parameter list to enable type inference\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-4018\",\n  \"sqKey\": \"S4018\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4019.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When a method in a derived class has:</p>\n<ul>\n  <li>the same name as a method in the base class</li>\n  <li>but types of parameters that are ancestors (for example <code>string</code> in the base class and <code>object</code> in the derived class)</li>\n</ul>\n<p>the result is that the base method becomes hidden.</p>\n<p>As shown in the following code snippet, when an instance of the derived class is used, invoking the method with an argument that matches the less\nderived parameter type will invoke the derived class method instead of the base class method:</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nclass BaseClass\n{\n  internal void MyMethod(string str) =&gt; Console.WriteLine(\"BaseClass: Method(string)\");\n}\n\nclass DerivedClass : BaseClass\n{\n  internal void MyMethod(object str) =&gt; Console.WriteLine(\"DerivedClass: Method(object)\"); // Noncompliant\n}\n\n// ...\nBaseClass baseObj = new BaseClass();\nbaseObj.MyMethod(\"Hello\"); // Output: BaseClass: Method(string)\n\nDerivedClass derivedObj = new DerivedClass();\nderivedObj.MyMethod(\"Hello\"); // Output: DerivedClass: Method(object) - DerivedClass method is hiding the BaseClass method\n\nBaseClass derivedAsBase = new DerivedClass();\nderivedAsBase.MyMethod(\"Hello\"); // Output: BaseClass: Method(string)\n</pre>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nclass BaseClass\n{\n  internal void MyMethod(string str) =&gt; Console.WriteLine(\"BaseClass: Method(string)\");\n}\n\nclass DerivedClass : BaseClass\n{\n  internal void MyOtherMethod(object str) =&gt; Console.WriteLine(\"DerivedClass: Method(object)\"); // Compliant\n}\n\n// ...\nBaseClass baseObj = new BaseClass();\nbaseObj.MyMethod(\"Hello\"); // Output: BaseClass: Method(string)\n\nDerivedClass derivedObj = new DerivedClass();\nderivedObj.MyMethod(\"Hello\"); // Output: BaseClass: Method(string)\n\nBaseClass derivedAsBase = new DerivedClass();\nderivedAsBase.MyMethod(\"Hello\"); // Output: BaseClass: Method(string)\n</pre>\n<p>Keep in mind that you cannot fix this issue by using the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/new-modifier\">new keyword</a> or by marking the method in the base\nclass as <code>virtual</code> and overriding it in the <code>DerivedClass</code> because the parameter types are different.</p>\n<h3>Exceptions</h3>\n<p>The rule is not raised when the two methods have the same parameter types.</p>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/knowing-when-to-use-override-and-new-keywords\">Knowing\n  When to Use Override and New Keywords</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/design-guidelines/member-overloading\">Member overloading</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/new-modifier\">'new' modifier</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/cs0108\">CS0108 - Hiding inherited member</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4019.json",
    "content": "{\n  \"title\": \"Base class methods should not be hidden\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-4019\",\n  \"sqKey\": \"S4019\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4022.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>By default the storage type of an <code>enum</code> is <code>Int32</code>. In most cases it is not necessary to change this. In particular you will\nnot achieve any performance gain by using a smaller data type (e.g. <code>Byte</code>) and may limit future uses.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nusing System;\n\nnamespace MyLibrary\n{\n    public enum Visibility : sbyte // Noncompliant\n    {\n        Visible = 0,\n        Invisible = 1,\n    }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nusing System;\n\nnamespace MyLibrary\n{\n    public enum Visibility\n    {\n        Visible = 0,\n        Invisible = 1,\n    }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4022.json",
    "content": "{\n  \"title\": \"Enumerations should have \\\"Int32\\\" storage\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-4022\",\n  \"sqKey\": \"S4022\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4023.html",
    "content": "<p>Empty interfaces should be avoided as they do not provide any functional requirements for implementing classes.</p>\n<h2>Why is this an issue?</h2>\n<p>Empty interfaces are either useless or used as a <a href=\"https://en.wikipedia.org/wiki/Marker_interface_pattern\">marker</a>. <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/standard/attributes/writing-custom-attributes\">Custom attributes</a> are a better alternative to marker\ninterfaces. See the <em>How to fix it</em> section for more information.</p>\n<h3>Exceptions</h3>\n<p>This rule doesn’t raise in any of the following cases:</p>\n<h4>Aggregation of multiple interfaces</h4>\n<pre>\npublic interface IAggregate: IComparable, IFormattable { } // Compliant: Aggregates two interfaces\n</pre>\n<h4>Generic specialization</h4>\n<p>An empty interface with a single base interface is compliant as long as the resulting interface binds a generic parameter or constrains it.</p>\n<pre>\n// Compliant: Bound to a concrete type\npublic interface IStringEquatable: IEquatable&lt;string&gt; { }\n// Compliant: Specialized by type parameter constraint\npublic interface ICreateableEquatable&lt;T&gt;: IEquatable&lt;T&gt; where T: new() { }\n</pre>\n<h4>Custom attribute</h4>\n<p>An empty interface is compliant if a custom attribute is applied to the interface.</p>\n<pre>\n[Obsolete]\npublic interface ISorted { } // Compliant: An attribute is applied to the interface declaration\n</pre>\n<h2>How to fix it</h2>\n<p>Do any of the following to fix the issue:</p>\n<ul>\n  <li>Add members to the interface</li>\n  <li>Remove the useless interface</li>\n  <li>Replace the usage as a marker interface with custom attributes</li>\n</ul>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<p>The empty interface does not add any functionality.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic interface IFoo // Noncompliant\n{\n\n}\n</pre>\n<h4>Compliant solution</h4>\n<p>Add members to the interface to be compliant.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic interface IFoo\n{\n    void Bar();\n}\n</pre>\n<h4>Noncompliant code example</h4>\n<p>A typical use case for marker interfaces is doing type inspection via <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/framework/reflection-and-codedom/reflection\">reflection</a> as shown below.</p>\n<p>The <code>IIncludeFields</code> marker interface is used to configure the JSON serialization of an object.</p>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\n// An example marker interface\npublic interface IIncludeFields { }\n\npublic class OptInToIncludeFields: IIncludeFields { }\n\nSerialize(new OptInToIncludeFields());\n\nvoid Serialize&lt;T&gt;(T o)\n{\n    // Use reflection to check if the interface is applied to the type\n    var includeFields = o.GetType()\n        .GetInterfaces().Any(i =&gt; i == typeof(IIncludeFields));\n    var options = new JsonSerializerOptions()\n    {\n        // Take decisions based on the presence of the marker\n        IncludeFields = includeFields,\n    };\n}\n</pre>\n<p>The same example can be rewritten using custom attributes. This approach is preferable because it is more fine-grained, allows parameterization,\nand is more flexible in type hierarchies.</p>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\n// A custom attribute used as a marker\n[AttributeUsage(AttributeTargets.Class)]\npublic sealed class IncludeFieldsAttribute: Attribute { }\n\n[IncludeFields]\npublic class OptInToIncludeFields { }\n\nSerialize(new OptInToIncludeFields());\n\nvoid Serialize&lt;T&gt;(T o)\n{\n    // Use reflection to check if the attribute is applied to the type\n    var includeFields = o.GetType()\n        .GetCustomAttributes(typeof(IncludeFieldsAttribute), inherit: true).Any();\n    var options = new JsonSerializerOptions()\n    {\n        // Take decisions based on the presence of the marker\n        IncludeFields = includeFields,\n    };\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/types/interfaces\">Interfaces - define behavior for\n  multiple types</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Marker_interface_pattern\">Marker interface pattern</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/standard/attributes/writing-custom-attributes\">Writing custom\n  attributes</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4023.json",
    "content": "{\n  \"title\": \"Interfaces should not be empty\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-4023\",\n  \"sqKey\": \"S4023\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4025.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Having a field in a child class with a name that differs from a parent class' field only by capitalization is sure to cause confusion. Such child\nclass fields should be renamed.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic class Fruit\n{\n  protected string plantingSeason;\n  //...\n}\n\npublic class Raspberry : Fruit\n{\n  protected string plantingseason;  // Noncompliant\n  // ...\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic class Fruit\n{\n  protected string plantingSeason;\n  //...\n}\n\npublic class Raspberry : Fruit\n{\n  protected string whenToPlant;\n  // ...\n}\n</pre>\n<p>Or</p>\n<pre>\npublic class Fruit\n{\n  protected string plantingSeason;\n  //...\n}\n\npublic class Raspberry : Fruit\n{\n  // field removed; parent field will be used instead\n  // ...\n}\n</pre>\n<h3>Exceptions</h3>\n<p>This rule ignores same-name fields that are <code>static</code> in both the parent and child classes. It also ignores <code>private</code> parent\nclass fields, but in all other such cases, the child class field should be renamed.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4025.json",
    "content": "{\n  \"title\": \"Child class fields should not differ from parent class fields only by capitalization\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-4025\",\n  \"sqKey\": \"S4025\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4026.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>It is important to inform the <code>ResourceManager</code> of the language used to display the resources of the neutral culture for an assembly.\nThis improves lookup performance for the first resource loaded.</p>\n<p>This rule raises an issue when an assembly contains a <code>ResX</code>-based resource but does not have the\n<code>System.Resources.NeutralResourcesLanguageAttribute</code> applied to it.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nusing System;\n\npublic class MyClass // Noncompliant\n{\n   public static void Main()\n   {\n      string[] cultures = { \"de-DE\", \"en-us\", \"fr-FR\" };\n      Random rnd = new Random();\n      int index = rnd.Next(0, cultures.Length);\n      Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture(cultures[index]);\n\n      ResourceManager rm = new ResourceManager(\"MyResources\" ,\n                                               typeof(MyClass).Assembly);\n      string greeting = rm.GetString(\"Greeting\");\n\n      Console.Write(\"Enter your name: \");\n      string name = Console.ReadLine();\n      Console.WriteLine(\"{0} {1}!\", greeting, name);\n   }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nusing System;\n\n[assembly:NeutralResourcesLanguageAttribute(\"en\")]\npublic class MyClass\n{\n   public static void Main()\n   {\n      string[] cultures = { \"de-DE\", \"en-us\", \"fr-FR\" };\n      Random rnd = new Random();\n      int index = rnd.Next(0, cultures.Length);\n      Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture(cultures[index]);\n\n      ResourceManager rm = new ResourceManager(\"MyResources\" ,\n                                               typeof(MyClass).Assembly);\n      string greeting = rm.GetString(\"Greeting\");\n\n      Console.Write(\"Enter your name: \");\n      string name = Console.ReadLine();\n      Console.WriteLine(\"{0} {1}!\", greeting, name);\n   }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4026.json",
    "content": "{\n  \"title\": \"Assemblies should be marked with \\\"NeutralResourcesLanguageAttribute\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-4026\",\n  \"sqKey\": \"S4026\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4027.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Exceptions types should provide the following constructors:</p>\n<ul>\n  <li><code>public MyException()</code></li>\n  <li><code>public MyException(string)</code></li>\n  <li><code>public MyException(string, Exception)</code></li>\n</ul>\n<p>The absence of these constructors can complicate exception handling and limit the information that can be provided when an exception is thrown.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic class MyException : Exception // Noncompliant: several constructors are missing\n{\n    public MyException()\n    {\n    }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic class MyException : Exception\n{\n    public MyException()\n    {\n    }\n\n    public MyException(string message)\n        : base(message)\n    {\n    }\n\n    public MyException(string message, Exception innerException)\n        : base(message, innerException)\n    {\n    }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn: <a href=\"https://learn.microsoft.com/en-us/dotnet/standard/exceptions/how-to-create-user-defined-exceptions\">How to create\n  user-defined exceptions</a></li>\n  <li>Microsoft Learn: <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.exception\">Exception Class</a></li>\n  <li>Microsoft Learn: <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/exceptions/creating-and-throwing-exceptions#define-exception-classes\">Define\n  exception classes</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4027.json",
    "content": "{\n  \"title\": \"Exceptions should provide standard constructors\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-4027\",\n  \"sqKey\": \"S4027\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4035.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When a class implements the <code>IEquatable&lt;T&gt;</code> interface, it enters a contract that, in effect, states \"I know how to compare two\ninstances of type T or any type derived from T for equality.\". However if that class is derived, it is very unlikely that the base class will know how\nto make a meaningful comparison. Therefore that implicit contract is now broken.</p>\n<p>Alternatively <code>IEqualityComparer&lt;T&gt;</code> provides a safer interface and is used by collections or <code>Equals</code> could be made\n<code>virtual</code>.</p>\n<p>This rule raises an issue when an unsealed, <code>public</code> or <code>protected</code> class implements <code>IEquatable&lt;T&gt;</code> and the\n<code>Equals</code> is neither <code>virtual</code> nor <code>abstract</code>.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nusing System;\n\nnamespace MyLibrary\n{\n  public class Base : IEquatable&lt;Base&gt; // Noncompliant\n  {\n    public bool Equals(Base other)\n    {\n      if (other == null) { return false; }\n      // do comparison of base properties\n      return true;\n    }\n\n    public override bool Equals(object other)  =&gt; Equals(other as Base);\n  }\n\n  class A : Base\n  {\n    public bool Equals(A other)\n    {\n      if (other == null) { return false; }\n      // do comparison of A properties\n      return base.Equals(other);\n    }\n\n    public override bool Equals(object other)  =&gt; Equals(other as A);\n  }\n\n  class B : Base\n  {\n    public bool Equals(B other)\n    {\n      if (other == null) { return false; }\n      // do comparison of B properties\n      return base.Equals(other);\n    }\n\n    public override bool Equals(object other)  =&gt; Equals(other as B);\n  }\n\n  internal class Program\n  {\n    static void Main(string[] args)\n    {\n        A a = new A();\n        B b = new B();\n         Console.WriteLine(a.Equals(b)); // This calls the WRONG equals. This causes Base.Equals(Base)\n                                         // to be called which only compares the properties in Base and ignores the fact that\n                                         // a and b are different types. In the working example A.Equals(Object) would have been\n                                         // called and Equals would return false because it correctly recognizes that a and b are\n                                         // different types. If a and b have the same base properties they will be returned as equal.\n    }\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nusing System;\n\nnamespace MyLibrary\n{\n    public sealed class Foo : IEquatable&lt;Foo&gt;\n    {\n        public bool Equals(Foo other)\n        {\n            // Your code here\n        }\n    }\n}\n</pre>\n<h2>Resources</h2>\n<p><a href=\"https://msdn.microsoft.com/en-us/library/ms132151(v=vs.110).aspx\">IEqualityComparer&lt;T&gt; Interface</a></p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4035.json",
    "content": "{\n  \"title\": \"Classes implementing \\\"IEquatable\\u003cT\\u003e\\\" should be sealed\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-4035\",\n  \"sqKey\": \"S4035\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4036.html",
    "content": "<p>When you run an OS command, it is always important to protect yourself against the risk of accidental or malicious replacement of the executables\nin the production system.</p>\n<p>To do so, it is important to point to the specific executable that should be used.</p>\n<p>For example, if you call <code>git</code> (without specifying a path), the operating system will search for the executable in the directories\nspecified in the <code>PATH</code> environment variable.\n  <br>\n  An attacker could have added, in a permissive directory covered by <code>PATH</code> , another executable called <code>git</code>, but with a\n  completely different behavior, for example exfiltrating data or exploiting a vulnerability in your own code.</p>\n<p>However, by calling <code>/usr/bin/git</code> or <code>../git</code> (relative path) directly, the operating system will always use the intended\nexecutable.\n  <br>\n  Note that you still need to make sure that the executable is not world-writeable and potentially overwritten. This is not the scope of this\n  rule.</p>\n<h2>Ask Yourself Whether</h2>\n<ul>\n  <li>The PATH environment variable only contains fixed, trusted directories.</li>\n</ul>\n<p>There is a risk if you answered no to this question.</p>\n<h2>Recommended Secure Coding Practices</h2>\n<p>If you wish to rely on the <code>PATH</code> environment variable to locate the OS command, make sure that each of its listed directories is fixed,\nnot susceptible to change, and not writable by unprivileged users.</p>\n<p>If you determine that these folders cannot be altered, and that you are sure that the program you intended to use will be used, then you can\ndetermine that these risks are under your control.</p>\n<p>A good practice you can use is to also hardcode the <code>PATH</code> variable you want to use, if you can do so in the framework you use.</p>\n<p>If the previous recommendations cannot be followed due to their complexity or other requirements, then consider using the absolute path of the\ncommand instead.</p>\n<pre>\n$ whereis git\ngit: /usr/bin/git /usr/share/man/man1/git.1.gz\n$ ls -l /usr/bin/git\n-rwxr-xr-x 1 root root 3376112 Jan 28 10:13 /usr/bin/git\n</pre>\n<h2>Sensitive Code Example</h2>\n<pre>\nProcess p = new Process();\np.StartInfo.FileName = \"binary\"; // Sensitive\n</pre>\n<h2>Compliant Solution</h2>\n<pre>\nProcess p = new Process();\np.StartInfo.FileName = @\"C:\\Apps\\binary.exe\";\n</pre>\n<h2>See</h2>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A08_2021-Software_and_Data_Integrity_Failures/\">Top 10 2021 Category A8 - Software and Data Integrity\n  Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A1_2017-Injection\">Top 10 2017 Category A1 - Injection</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/426\">CWE-426 - Untrusted Search Path</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/427\">CWE-427 - Uncontrolled Search Path Element</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4036.json",
    "content": "{\n  \"title\": \"Searching OS commands in PATH is security-sensitive\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"LOW\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-4036\",\n  \"sqKey\": \"S4036\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      427,\n      426\n    ],\n    \"OWASP\": [\n      \"A1\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A8\"\n    ]\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4039.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When a base type explicitly implements a public interface method, property or event, that member is only accessible in derived types through a\nreference to the current instance (namely <code>this</code>). If the derived type explicitly overrides that interface member, the base implementation\nbecomes inaccessible.</p>\n<p>This rule raises an issue when an unsealed, externally visible type provides an explicit member implementation of an <code>interface</code> and\ndoes not provide an alternate, externally visible member with the same name.</p>\n<h3>Exceptions</h3>\n<p>This rule does not report a violation for an explicit implementation of <code>IDisposable.Dispose</code> when an externally visible\n<code>Close()</code> or <code>System.IDisposable.Dispose(Boolean)</code> method is provided.</p>\n<h2>How to fix it</h2>\n<p>Make the class sealed, change the class member to a non-explicit declaration, or provide a new class member exposing the functionality of the\nexplicit interface member.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic interface IMyInterface\n{\n    void MyMethod();\n}\n\npublic class Foo : IMyInterface\n{\n    void IMyInterface.MyMethod() // Noncompliant\n    {\n        MyMethod();\n    }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic interface IMyInterface\n{\n    void MyMethod();\n}\n\npublic class Foo : IMyInterface\n{\n    void IMyInterface.MyMethod()\n    {\n        MyMethod();\n    }\n\n    // This method can be public or protected\n    protected void MyMethod()\n    {\n        // Do something ...\n    }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/interfaces/explicit-interface-implementation\">Explicit Interface\n  Implementation</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4039.json",
    "content": "{\n  \"title\": \"Interface methods should be callable by derived types\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-4039\",\n  \"sqKey\": \"S4039\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4040.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Certain characters, once normalized to lowercase, cannot make a round trip. That is, they can not be converted from one locale to another and then\naccurately restored to their original characters.</p>\n<p>It is therefore strongly recommended to normalize characters and strings to uppercase instead.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nThread.CurrentThread.CurrentCulture = new CultureInfo(\"tr-TR\");\nvar areStringEqual = \"INTEGER\".ToLower() == \"integer\"; // Noncompliant, the result is false as the ToLower will resolve to \"ınteger\"\nvar areCharEqual = char.ToLower('I') == 'i'; // Noncompliant, the result is false as the ToLower will resolve to \"ı\"\n\nvar incorrectRoundtrip = \"İ\".ToLowerInvariant().ToUpper() == \"I\".ToLowerInvariant().ToUpper(); // Noncompliant, because of the lower we lose the information about the correct uppercase character\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nThread.CurrentThread.CurrentCulture = new CultureInfo(\"tr-TR\");\nvar areStringEqual = \"ınteger\".ToUpperInvariant() == \"ıNTEGER\";\nvar areCharEqual = char.ToUpperInvariant('ı') == 'ı';\nvar correctRoundtrip = \"İ\".ToUpperInvariant().ToLower() != \"I\".ToUpperInvariant().ToLower();\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li><a href=\"http://www.i18nguy.com/unicode/turkish-i18n.html\">Internationalization for Turkish</a></li>\n  <li><a href=\"https://gingter.org/2018/07/10/how-to-correctly-normalize-strings-and-how-to-compare-them-in-net/\">How to correctly normalize\n  strings</a></li>\n  <li><a href=\"https://docs.microsoft.com/en-us/dotnet/standard/base-types/best-practices-strings#recommendations-for-string-usage\">Best Practices for\n  Using Strings in .NET</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4040.json",
    "content": "{\n  \"title\": \"Strings should be normalized to uppercase\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-4040\",\n  \"sqKey\": \"S4040\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4041.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When a type name matches the name of a publicly defined namespace, for instance one in the .NET framework class library, it leads to confusion and\nmakes the library that much harder to use.</p>\n<p>This rule raises an issue when a name of a public type matches the name of a .NET Framework namespace, or a namespace of the project assembly, in a\ncase-insensitive comparison.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nusing System;\n\nnamespace MyLibrary\n{\n  public class Text   // Noncompliant: Collides with System.Text\n  {\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nusing System;\n\nnamespace MyLibrary\n{\n  public class MyText\n  {\n  }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4041.json",
    "content": "{\n  \"title\": \"Type names should not match namespaces\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-4041\",\n  \"sqKey\": \"S4041\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4047.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When a reference parameter (keyword <code>ref</code>) is used, the passed argument type must exactly match the reference parameter type. This means\nthat to be able to pass a derived type, it must be cast and assigned to a variable of the proper type. Use of generic methods eliminates that\ncumbersome down casting and should therefore be preferred.</p>\n<p>This rule raises an issue when a method contains a <code>ref</code> parameter of type <code>System.Object</code>.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nusing System;\n\nnamespace MyLibrary\n{\n  public class Foo\n  {\n    public void Bar(ref object o1, ref object o2) // Noncompliant\n    {\n    }\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nusing System;\n\nnamespace MyLibrary\n{\n  public class Foo\n  {\n    public void Bar&lt;T&gt;(ref T ref1, ref T ref2)\n    {\n    }\n  }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4047.json",
    "content": "{\n  \"title\": \"Generics should be used when appropriate\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-4047\",\n  \"sqKey\": \"S4047\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4049.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Properties are accessed like fields which makes them easier to use.</p>\n<p>This rule raises an issue when the name of a <code>public</code> or <code>protected</code> method starts with <code>Get</code>, takes no parameter,\nand returns a value that is not an array.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nusing System;\n\nnamespace MyLibrary\n{\n    public class Foo\n    {\n        private string name;\n\n        public string GetName()  // Noncompliant\n        {\n            return name;\n        }\n    }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nusing System;\n\nnamespace MyLibrary\n{\n    public class Foo\n    {\n        private string name;\n\n        public string Name\n        {\n            get\n            {\n                return name;\n            }\n        }\n    }\n}\n</pre>\n<h3>Exceptions</h3>\n<p>The rule doesn’t raise an issue when the method:</p>\n<ul>\n  <li>Is a constructor</li>\n  <li>Is an <code>override</code></li>\n  <li>Is an interface implementation</li>\n  <li>Is <code>async</code></li>\n  <li>Returns <code>Task</code>, <code>Task&lt;T&gt;</code></li>\n  <li>Is named <code>GetEnumerator</code>, <code>GetAwaiter</code></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4049.json",
    "content": "{\n  \"title\": \"Properties should be preferred\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-4049\",\n  \"sqKey\": \"S4049\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4050.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When overloading some arithmetic operator overloads, it is very important to make sure that all related operators and methods are consistent in\ntheir implementation.</p>\n<p>The following guidelines should be followed:</p>\n<ul>\n  <li>When providing <code>operator ==, !=</code> you should also provide <code>Equals(Object)</code> and <code>GetHashCode()</code>.</li>\n  <li>When providing <code>operator +, -, *, / or %</code>&nbsp;you should also provide <code>operator ==</code>, respecting the previous\n  guideline.</li>\n</ul>\n<p>This rule raises an issue when any of these guidelines are not followed on a publicly-visible class or struct (<code>public</code>,\n<code>protected</code> or <code>protected internal</code>).</p>\n<h2>How to fix it</h2>\n<p>Make sure to implement all related operators.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic class Foo // Noncompliant\n{\n    private int left;\n    private int right;\n\n    public Foo(int l, int r)\n    {\n        this.left = l;\n        this.right = r;\n    }\n\n    public static Foo operator +(Foo a, Foo b)\n    {\n        return new Foo(a.left + b.left, a.right + b.right);\n    }\n\n    public static Foo operator -(Foo a, Foo b)\n    {\n        return new Foo(a.left - b.left, a.right - b.right);\n    }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic class Foo\n{\n    private int left;\n    private int right;\n\n    public Foo(int l, int r)\n    {\n      this.left = l;\n      this.right = r;\n    }\n\n    public override bool Equals(Object obj)\n    {\n        var a = obj as Foo;\n        if (a == null)\n          return false;\n        return this == a;\n    }\n\n    public override int GetHashCode()\n    {\n        return HashCode.Combine(right, left);\n    }\n\n    public static Foo operator +(Foo a, Foo b)\n    {\n        return new Foo(a.left + b.left, a.right + b.right);\n    }\n\n    public static Foo operator -(Foo a, Foo b)\n    {\n        return new Foo(a.left - b.left, a.right - b.right);\n    }\n\n    public static bool operator ==(Foo a, Foo b)\n    {\n        return a.left == b.left &amp;&amp; a.right == b.right;\n    }\n\n    public static bool operator !=(Foo a, Foo b)\n    {\n        return !(a == b);\n    }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/operator-overloading\">Operator\n  overloading</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/equality-operators\">Equality\n  operators</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/arithmetic-operators\">Arithmetic\n  operators (C# reference)</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4050.json",
    "content": "{\n  \"title\": \"Operators should be overloaded consistently\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-4050\",\n  \"sqKey\": \"S4050\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4052.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>With the advent of .NET Framework 2.0, certain practices and types have become obsolete.</p>\n<p>In particular, exceptions should now extend <code>System.Exception</code> instead of <code>System.ApplicationException</code>. Similarly, generic\ncollections should be used instead of the older, non-generic, ones. Finally when creating an XML view, you should not extend\n<code>System.Xml.XmlDocument</code>. This rule raises an issue when an externally visible type extends one of these types:</p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.applicationexception\">System.ApplicationException</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.xml.xmldocument\">System.Xml.XmlDocument</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.collectionbase\">System.Collections.CollectionBase</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.dictionarybase\">System.Collections.DictionaryBase</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.queue\">System.Collections.Queue</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.readonlycollectionbase\">System.Collections.ReadOnlyCollectionBase</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.sortedlist\">System.Collections.SortedList</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.stack\">System.Collections.Stack</a></li>\n</ul>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nusing System;\nusing System.Collections;\n\nnamespace MyLibrary\n{\n  public class MyCollection : CollectionBase  // Noncompliant\n  {\n  }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nusing System;\nusing System.Collections.ObjectModel;\n\nnamespace MyLibrary\n{\n  public class MyCollection : Collection&lt;T&gt;\n  {\n  }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4052.json",
    "content": "{\n  \"title\": \"Types should not extend outdated base types\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-4052\",\n  \"sqKey\": \"S4052\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4055.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>String literals embedded in the source code will not be localized properly.</p>\n<p>This rule raises an issue when a literal string is passed as a parameter or property and one or more of the following cases is true:</p>\n<ul>\n  <li>The <code>LocalizableAttribute</code> attribute of the parameter or property is set to true.</li>\n  <li>The parameter or property name contains \"Text\", \"Message\", or \"Caption\".</li>\n  <li>The name of the string parameter that is passed to a <code>Console.Write</code> or <code>Console.WriteLine</code> method is either \"value\" or\n  \"format\".</li>\n</ul>\n<h3>Noncompliant code example</h3>\n<pre>\nusing System;\nusing System.Globalization;\nusing System.Reflection;\nusing System.Windows.Forms;\n\n[assembly: NeutralResourcesLanguageAttribute(\"en-US\")]\nnamespace MyLibrary\n{\n    public class Foo\n    {\n        public void SetHour(int hour)\n        {\n            if (hour &lt; 0 || hour &gt; 23)\n            {\n                MessageBox.Show(\"The valid range is 0 - 23.\"); // Noncompliant\n            }\n        }\n    }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nusing System;\nusing System.Globalization;\nusing System.Reflection;\nusing System.Resources;\nusing System.Windows.Forms;\n\n\n\n[assembly: NeutralResourcesLanguageAttribute(\"en-US\")]\nnamespace MyLibrary\n{\n    public class Foo\n    {\n        ResourceManager rm;\n        public Foo()\n        {\n            rm = new ResourceManager(\"en-US\", Assembly.GetExecutingAssembly());\n        }\n\n        public void SetHour(int hour)\n        {\n            if (hour &lt; 0 || hour &gt; 23)\n            {\n                MessageBox.Show(\n                rm.GetString(\"OutOfRangeMessage\", CultureInfo.CurrentUICulture));\n            }\n        }\n    }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4055.json",
    "content": "{\n  \"title\": \"Literals should not be passed as localized parameters\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"localisation\",\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-4055\",\n  \"sqKey\": \"S4055\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4056.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When a <code>System.Globalization.CultureInfo</code> or <code>IFormatProvider</code> object is not supplied, the default value that is supplied by\nthe overloaded member might not have the effect that you want in all locales.</p>\n<p>You should supply culture-specific information according to the following guidelines:</p>\n<ul>\n  <li>If the value will be displayed to the user, use the current culture. See <code>CultureInfo.CurrentCulture</code>.</li>\n  <li>If the value will be stored and accessed by software (persisted to a file or database), use the invariant culture. See\n  <code>CultureInfo.InvariantCulture</code>.</li>\n  <li>If you do not know the destination of the value, have the data consumer or provider specify the culture.</li>\n</ul>\n<p>This rule raises an issue when a method or constructor calls one or more members that have overloads that accept a\n<code>System.IFormatProvider</code> parameter, and the method or constructor does not call the overload that takes the <code>IFormatProvider</code>\nparameter. This rule ignores calls to .NET Framework methods that are documented as ignoring the <code>IFormatProvider</code> parameter as well as the\nfollowing methods:</p>\n<ul>\n  <li><code>Activator.CreateInstance</code></li>\n  <li><code>ResourceManager.GetObject</code></li>\n  <li><code>ResourceManager.GetString</code></li>\n</ul>\n<h3>Noncompliant code example</h3>\n<pre>\nusing System;\n\nnamespace MyLibrary\n{\n    public class Foo\n    {\n        public void Bar(String string1)\n        {\n            if(string.Compare(string1, string2, false) == 0) // Noncompliant\n            {\n                Console.WriteLine(string3.ToLower()); // Noncompliant\n            }\n        }\n    }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nusing System;\nusing System.Globalization;\n\nnamespace MyLibrary\n{\n    public class Foo\n    {\n        public void Bar(String string1, String string2, String string3)\n        {\n            if(string.Compare(string1, string2, false,\n                              CultureInfo.InvariantCulture) == 0)\n            {\n                Console.WriteLine(string3.ToLower(CultureInfo.CurrentCulture));\n            }\n        }\n    }\n}\n</pre>\n<h3>Exceptions</h3>\n<p>This rule will not raise an issue when the overload is marked as obsolete.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4056.json",
    "content": "{\n  \"title\": \"Overloads with a \\\"CultureInfo\\\" or an \\\"IFormatProvider\\\" parameter should be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"localisation\",\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-4056\",\n  \"sqKey\": \"S4056\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4057.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When you create a <code>DataTable</code> or <code>DataSet</code>, you should set the locale explicitly. By default, the locale for these types is\nthe current culture. For data that is stored in a database or file and is shared globally, the locale should ordinarily be set to the invariant\nculture (<code>CultureInfo.InvariantCulture</code>).</p>\n<p>This rule raises an issue when <code>System.Data.DataTable</code> or <code>System.Data.DataSet</code> instances are created without explicitly\nsetting the locale property (<code>DataTable.Locale</code> or <code>DataSet.Locale</code>).</p>\n<h3>Noncompliant code example</h3>\n<pre>\nusing System;\nusing System.Data;\n\nnamespace MyLibrary\n{\n    public class Foo\n    {\n        public DataTable CreateTable()\n        {\n            DataTable table = new DataTable(\"Customers\"); // Noncompliant table.Locale not set\n            DataColumn key = table.Columns.Add(\"ID\", typeof(Int32));\n\n            key.AllowDBNull = false;\n            key.Unique = true;\n            table.Columns.Add(\"LastName\", typeof(String));\n            table.Columns.Add(\"FirstName\", typeof(String));\n            return table;\n        }\n    }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nusing System;\nusing System.Data;\nusing System.Globalization;\n\nnamespace MyLibrary\n{\n    public class Foo\n    {\n        public DataTable CreateTable()\n        {\n            DataTable table = new DataTable(\"Customers\");\n            table.Locale = CultureInfo.InvariantCulture;\n            DataColumn key = table.Columns.Add(\"ID\", typeof(Int32));\n\n            key.AllowDBNull = false;\n            key.Unique = true;\n            table.Columns.Add(\"LastName\", typeof(String));\n            table.Columns.Add(\"FirstName\", typeof(String));\n            return table;\n        }\n    }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4057.json",
    "content": "{\n  \"title\": \"Locales should be set for data types\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"localisation\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-4057\",\n  \"sqKey\": \"S4057\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4058.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Many string operations, the <code>Compare</code> and <code>Equals</code> methods in particular, provide an overload that accepts a\n<code>StringComparison</code> enumeration value as a parameter. Calling these overloads and explicitly providing this parameter makes your code\nclearer and easier to maintain.</p>\n<p>This rule raises an issue when a string comparison operation doesn’t use the overload that takes a <code>StringComparison</code> parameter.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nusing System;\n\nnamespace MyLibrary\n{\n  public class Foo\n  {\n    public bool HaveSameNames(string name1, string name2)\n    {\n      return string.Compare(name1, name2) == 0; // Noncompliant\n    }\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nusing System;\n\nnamespace MyLibrary\n{\n  public class Foo\n  {\n    public bool HaveSameNames(string name1, string name2)\n    {\n      return string.Compare(name1, name2, StringComparison.OrdinalIgnoreCase) == 0;\n    }\n  }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4058.json",
    "content": "{\n  \"title\": \"Overloads with a \\\"StringComparison\\\" parameter should be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-4058\",\n  \"sqKey\": \"S4058\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4059.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Properties and Get method should have names that makes them clearly distinguishable.</p>\n<p>This rule raises an issue when the name of a public or protected member starts with 'Get' and otherwise matches the name of a public or protected\nproperty.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nusing System;\n\nnamespace MyLibrary\n{\n    public class Foo\n    {\n        public DateTime Date\n        {\n            get { return DateTime.Today; }\n        }\n\n        public string GetDate() // Noncompliant\n        {\n            return this.Date.ToString();\n        }\n    }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nusing System;\n\nnamespace MyLibrary\n{\n    public class Foo\n    {\n        public DateTime Date\n        {\n            get { return DateTime.Today; }\n        }\n\n        public string GetDateAsString()\n        {\n            return this.Date.ToString();\n        }\n    }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4059.json",
    "content": "{\n  \"title\": \"Property names should not match get methods\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"confusing\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-4059\",\n  \"sqKey\": \"S4059\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4060.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The .NET framework class library provides methods for retrieving custom attributes. Sealing the attribute eliminates the search through the\ninheritance hierarchy, and can improve performance.</p>\n<p>This rule raises an issue when a public type inherits from <code>System.Attribute</code>, is not abstract, and is not sealed.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nusing System;\n\npublic class MyAttribute: Attribute // Noncompliant\n{\n    public string Name { get; }\n\n    public MyAttribute(string name) =&gt;\n        Name = name;\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nusing System;\n\npublic sealed class MyAttribute : Attribute\n{\n    public string Name { get; }\n\n    public MyAttribute(string name) =&gt;\n        Name = name;\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4060.json",
    "content": "{\n  \"title\": \"Non-abstract attributes should be sealed\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-4060\",\n  \"sqKey\": \"S4060\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4061.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>A method using the <code>VarArgs</code> calling convention is not Common Language Specification (CLS) compliant and might not be accessible across\nprogramming languages, while the <code>params</code> keyword works the same way and is CLS compliant.</p>\n<p>This rule raises an issue when a <code>public</code> or <code>protected</code> type contains a <code>public</code> or <code>protected</code> method\nthat uses the <code>VarArgs</code> calling convention.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nusing System;\n\nnamespace MyLibrary\n{\n    public class Foo\n    {\n        public void Bar(__arglist) // Noncompliant\n        {\n            ArgIterator argumentIterator = new ArgIterator(__arglist);\n            for(int i = 0; i &lt; argumentIterator.GetRemainingCount(); i++)\n            {\n                Console.WriteLine(\n                    __refvalue(argumentIterator.GetNextArg(), string));\n            }\n        }\n    }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nusing System;\n\n[assembly: CLSCompliant(true)]\nnamespace MyLibrary\n{\n    public class Foo\n    {\n        public void Bar(params string[] wordList)\n        {\n            for(int i = 0; i &lt; wordList.Length; i++)\n            {\n                Console.WriteLine(wordList[i]);\n            }\n        }\n    }\n}\n</pre>\n<h3>Exceptions</h3>\n<p>Interop methods using <code>VarArgs</code> calling convention do not raise an issue.</p>\n<pre>\n[DllImport(\"msvcrt40.dll\")]\npublic static extern int printf(string format, __arglist); // Compliant\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4061.json",
    "content": "{\n  \"title\": \"\\\"params\\\" should be used instead of \\\"varargs\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-4061\",\n  \"sqKey\": \"S4061\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4069.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Operator overloading is convenient but unfortunately not portable across languages. To be able to access the same functionality from another\nlanguage you need to provide an alternate named method following the convention:</p>\n<table>\n  <colgroup>\n    <col style=\"width: 50%;\">\n    <col style=\"width: 50%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>Operator</th>\n      <th>Method Name</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p><code>+</code> (binary)</p>\n      </td>\n      <td>\n        <p>Add</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p><code>&amp;</code></p>\n      </td>\n      <td>\n        <p>BitwiseAnd</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p><code>|</code></p>\n      </td>\n      <td>\n        <p>BitwiseOr</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p><code>/</code></p>\n      </td>\n      <td>\n        <p>Divide</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p><code>==</code></p>\n      </td>\n      <td>\n        <p>Equals</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p><code>^</code></p>\n      </td>\n      <td>\n        <p>Xor</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p><code>&gt;</code></p>\n      </td>\n      <td>\n        <p>Compare</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p><code>&gt;=</code></p>\n      </td>\n      <td>\n        <p>Compare</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p><code>!=</code></p>\n      </td>\n      <td>\n        <p>Equals</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p><code>&lt;</code></p>\n      </td>\n      <td>\n        <p>Compare</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p><code>&lt;=</code></p>\n      </td>\n      <td>\n        <p>Compare</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p><code>!</code></p>\n      </td>\n      <td>\n        <p>LogicalNot</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p><code>%</code></p>\n      </td>\n      <td>\n        <p>Mod</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p><code>*</code> (binary)</p>\n      </td>\n      <td>\n        <p>Multiply</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p><code>~</code></p>\n      </td>\n      <td>\n        <p>OnesComplement</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p><code>-</code> (binary)</p>\n      </td>\n      <td>\n        <p>Subtract</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p><code>-</code> (unary)</p>\n      </td>\n      <td>\n        <p>Negate</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p><code>+</code> (unary)</p>\n      </td>\n      <td>\n        <p>Plus</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<p>This rule raises an issue when there is an operator overload without the expected named alternative method.</p>\n<h3>Exceptions</h3>\n<p>This rule does not raise an issue when the class implementing the comparison operators <code>&gt;</code>, <code>&lt;</code>, <code>&gt;=</code> and\n<code>&lt;=</code> contains a method named <code>CompareTo</code>.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4069.json",
    "content": "{\n  \"title\": \"Operator overloads should have named alternatives\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-4069\",\n  \"sqKey\": \"S4069\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4070.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>This rule raises an issue when an externally visible enumeration is marked with <code>FlagsAttribute</code> and one, or more, of its values is not\na power of 2 or a combination of the other defined values.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nusing System;\n\nnamespace MyLibrary\n{\n    [Flags]\n    public enum Color // Noncompliant, Orange is neither a power of two, nor a combination of any of the defined values\n    {\n        None    = 0,\n        Red     = 1,\n        Orange  = 3,\n        Yellow  = 4\n    }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nusing System;\n\nnamespace MyLibrary\n{\n    public enum Color // Compliant - no FlagsAttribute\n    {\n        None = 0,\n        Red = 1,\n        Orange = 3,\n        Yellow = 4\n    }\n\n    [Flags]\n    public enum Days\n    {\n        None = 0,\n        Monday = 1,\n        Tuesday = 2,\n        Wednesday = 4,\n        Thursday = 8,\n        Friday = 16,\n        All = Monday| Tuesday | Wednesday | Thursday | Friday    // Compliant - combination of other values\n    }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4070.json",
    "content": "{\n  \"title\": \"Non-flags enums should not be marked with \\\"FlagsAttribute\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-4070\",\n  \"sqKey\": \"S4070\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4136.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>For clarity, all overloads of the same method should be grouped together. That lets both users and maintainers quickly understand all the current\navailable options.</p>\n<h3>Noncompliant code example</h3>\n<pre>\ninterface IMyInterface\n{\n  int DoTheThing(); // Noncompliant - overloaded method declarations are not grouped together\n  string DoTheOtherThing();\n  int DoTheThing(string s);\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\ninterface IMyInterface\n{\n  int DoTheThing();\n  int DoTheThing(string s);\n  string DoTheOtherThing();\n}\n</pre>\n<h3>Exceptions</h3>\n<p>As it is common practice to group method declarations by implemented interface, no issue will be raised for implicit and explicit interface\nimplementations if grouped together with other members of that interface.</p>\n<p>As it is also a common practice to group method declarations by accessibility level, no issue will be raised for method overloads having different\naccess modifiers.</p>\n<p>Example:</p>\n<pre>\nclass MyClass\n{\n  private void DoTheThing(string s) // Ok - this method is declared as private while the other one is public\n  {\n    // ...\n  }\n\n  private string DoTheOtherThing(string s)\n  {\n    // ...\n  }\n\n  public void DoTheThing()\n  {\n    // ...\n  }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4136.json",
    "content": "{\n  \"title\": \"Method overloads should be grouped together\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"FORMATTED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-4136\",\n  \"sqKey\": \"S4136\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4143.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Storing a value inside a collection at a given key or index and then unconditionally overwriting it without reading the initial value is a case of\na \"dead store\".</p>\n<pre>\nlist[index] = \"value 1\";\nlist[index] = \"value 2\";  // Noncompliant\n\ndictionary.Add(key, \"value 1\");\ndictionary[key] = \"value 2\"; // Noncompliant\n</pre>\n<p>This practice is redundant and will cause confusion for the reader. More importantly, it is often an error and not what the developer intended to\ndo.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4143.json",
    "content": "{\n  \"title\": \"Collection elements should not be replaced unconditionally\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-4143\",\n  \"sqKey\": \"S4143\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4144.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Two methods having the same implementation are suspicious. It might be that something else was intended. Or the duplication is intentional, which\nbecomes a maintenance burden.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nprivate const string CODE = \"secret\";\nprivate int callCount = 0;\n\npublic string GetCode()\n{\n  callCount++;\n  return CODE;\n}\n\npublic string GetName() // Noncompliant: duplicates GetCode\n{\n  callCount++;\n  return CODE;\n}\n</pre>\n<p>If the identical logic is intentional, the code should be refactored to avoid duplication. For example, by having both methods call the same method\nor by having one implementation invoke the other.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nprivate const string CODE = \"secret\";\nprivate int callCount = 0;\n\npublic string GetCode()\n{\n  callCount++;\n  return CODE;\n}\n\npublic string GetName() // Intent is clear\n{\n  return GetCode();\n}\n</pre>\n<h3>Exceptions</h3>\n<p>Empty methods, methods with only one line of code and methods with the same name (overload) are ignored.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4144.json",
    "content": "{\n  \"title\": \"Methods should not have identical implementations\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"DISTINCT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [\n    \"confusing\",\n    \"duplicate\",\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-4144\",\n  \"sqKey\": \"S4144\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4158.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When a collection is empty, iterating it has no effect. Doing so anyway is likely a bug; either population was accidentally omitted, or the\niteration needs to be revised.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic void Method()\n{\n    var values = new List&lt;string&gt;();\n    values.Remove(\"bar\");              // Noncompliant\n    if (values.Contains(\"foo\")) { }    // Noncompliant\n    foreach (var str in values) { }    // Noncompliant\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic void Method()\n{\n    var values = LoadValues();\n    values.Remove(\"bar\");\n    if (values.Contains(\"foo\")) { }\n    foreach (var str in values) { }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4158.json",
    "content": "{\n  \"title\": \"Empty collections should not be accessed or iterated\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"LOW\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [\n    \"symbolic-execution\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-4158\",\n  \"sqKey\": \"S4158\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4159.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The <a href=\"https://learn.microsoft.com/en-us/dotnet/framework/mef/attributed-programming-model-overview-mef\">Attributed Programming Model</a>,\nalso known as <a href=\"https://en.wikipedia.org/wiki/Attribute-oriented_programming\">Attribute-oriented programming (@OP)</a>, is a programming model\nused to embed attributes within codes.</p>\n<p>In this model, objects are required to conform to a specific structure so that they can be used by the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/framework/mef/\">Managed Extensibility Framework (MEF)</a>.</p>\n<p>MEF provides a way to discover available components implicitly, via <strong>composition</strong>. A MEF component, called a <strong>part</strong>,\ndeclaratively specifies:</p>\n<ul>\n  <li>both its dependencies, known as <strong>imports</strong></li>\n  <li>and what capabilities it makes available, known as <strong>exports</strong></li>\n</ul>\n<p>The <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.composition.exportattribute\">ExportAttribute</a> declares that a part \"exports\",\nor provides to the composition container, an object that fulfills a particular contract.</p>\n<p>During composition, parts with imports that have matching contracts will have those dependencies filled by the exported object.</p>\n<p>If the type doesn’t implement the interface it is exporting there will be an issue at runtime (either a cast exception or just a container not\nfilled with the exported type) leading to unexpected behaviors/crashes.</p>\n<p>The rule raises an issue when a class doesn’t implement or inherit the type declared in the <code>ExportAttribute</code>.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\n[Export(typeof(ISomeType))]\npublic class SomeType // Noncompliant: doesn't implement 'ISomeType'.\n{\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n[Export(typeof(ISomeType))]\npublic class SomeType : ISomeType\n{\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Attribute-oriented_programming\">Attribute-oriented programming (@OP)</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/framework/mef/attributed-programming-model-overview-mef\">Attributed Programming Model</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/framework/mef/\">Managed Extensibility Framework (MEF)</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.composition.exportattribute\">ExportAttribute Class</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4159.json",
    "content": "{\n  \"title\": \"Classes should implement their \\\"ExportAttribute\\\" interfaces\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [\n    \"mef\",\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-4159\",\n  \"sqKey\": \"S4159\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4200.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Native methods are functions that reside in libraries outside the .NET runtime. Calling them is helpful for interoperability with applications and\nlibraries written in other programming languages, mainly when performing platform-specific operations. However, doing so comes with additional risks\nsince it means stepping out of the memory-safety model of the runtime. It is therefore highly recommended to take extra steps, like input validation,\nwhen invoking native methods. Making the native method <code>private</code> and providing a wrapper that performs these additional steps is the best\nway to do so.</p>\n<p>This rule raises an issue when a native method is declared <code>public</code> or its wrapper is too trivial.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nusing System;\nusing System.Runtime.InteropServices;\n\nnamespace MyLibrary\n{\n  class Foo\n  {\n    [DllImport(\"mynativelib\")]\n    extern public static void Bar(string s, int x); // Noncompliant\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nusing System;\nusing System.Runtime.InteropServices;\n\nnamespace MyLibrary\n{\n  class Foo\n  {\n    [DllImport(\"mynativelib\")]\n    extern private static void Bar(string s, int x);\n\n    public void BarWrapper(string s, int x)\n    {\n      if (s != null &amp;&amp; x &gt;= 0  &amp;&amp; x &lt; s.Length)\n      {\n        Bar(s, x);\n      }\n    }\n  }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4200.json",
    "content": "{\n  \"title\": \"Native methods should be wrapped\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-4200\",\n  \"sqKey\": \"S4200\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4201.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>There’s no need to null test in conjunction with an <code>is</code> test. <code>null</code> is not an instance of anything, so a null check is\nredundant.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nif (x != null &amp;&amp; x is MyClass) { ... }  // Noncompliant\n\nif (x == null || !(x is MyClass)) { ... } // Noncompliant\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nif (x is MyClass) { ... }\n\nif (!(x is MyClass)) { ... }\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4201.json",
    "content": "{\n  \"title\": \"Null checks should not be combined with \\\"is\\\" operator checks\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"redundant\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-4201\",\n  \"sqKey\": \"S4201\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4210.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When an assembly uses Windows Forms (classes and interfaces from the <code>System.Windows.Forms</code> namespace) its entry point should be marked\nwith the <code>STAThreadAttribute</code> to indicate that the threading model should be \"Single-Threaded Apartment\" (STA) which is the only one\nsupported by Windows Forms.</p>\n<p>This rule raises an issue when the entry point (<code>static void Main</code> method) of an assembly using Windows Forms is not marked as STA.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nusing System;\nusing System.Windows.Forms;\n\nnamespace MyLibrary\n{\n    public class MyForm: Form\n    {\n        public MyForm()\n        {\n            this.Text = \"Hello World!\";\n        }\n\n        public static void Main()  // Noncompliant\n        {\n            var form = new MyForm();\n            Application.Run(form);\n        }\n    }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nusing System;\nusing System.Windows.Forms;\n\nnamespace MyLibrary\n{\n    public class MyForm: Form\n    {\n        public MyForm()\n        {\n            this.Text = \"Hello World!\";\n        }\n\n        [STAThread]\n        public static void Main()\n        {\n            var form = new MyForm();\n            Application.Run(form);\n        }\n    }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4210.json",
    "content": "{\n  \"title\": \"Windows Forms entry points should be marked with STAThread\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"winforms\",\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-4210\",\n  \"sqKey\": \"S4210\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4211.html",
    "content": "<p>Transparency attributes in the .NET Framework, designed to protect security-critical operations, can lead to ambiguities and vulnerabilities when\ndeclared at different levels such as both for the class and a method.</p>\n<h2>Why is this an issue?</h2>\n<p>Transparency attributes can be declared at several levels. If two different attributes are declared at two different levels, the attribute that\nprevails is the one in the highest level. For example, you can declare that a class is <code>SecuritySafeCritical</code> and that a method of this\nclass is <code>SecurityCritical</code>. In this case, the method will be <code>SecuritySafeCritical</code> and the <code>SecurityCritical</code>\nattribute attached to it is ignored.</p>\n<h3>What is the potential impact?</h3>\n<p>Below are some real-world scenarios that illustrate some impacts of an attacker exploiting the vulnerability.</p>\n<h4>Elevation of Privileges</h4>\n<p>An attacker could potentially exploit conflicting transparency attributes to perform actions with higher privileges than intended.</p>\n<h4>Data Exposure</h4>\n<p>If a member with conflicting attributes is involved in handling sensitive data, an attacker could exploit the vulnerability to gain unauthorized\naccess to this data. This could lead to breaches of confidentiality and potential data loss.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nusing System;\nusing System.Security;\n\nnamespace MyLibrary\n{\n    [SecuritySafeCritical]\n    public class Foo\n    {\n        [SecurityCritical] // Noncompliant\n        public void Bar()\n        {\n        }\n    }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nusing System;\nusing System.Security;\n\nnamespace MyLibrary\n{\n    public class Foo\n    {\n        [SecurityCritical]\n        public void Bar()\n        {\n        }\n    }\n}\n</pre>\n<h3>How does this work?</h3>\n<h4>Never set class-level annotations</h4>\n<p>A class should never have class-level annotations if some functions have different permission levels. Instead, make sure every function has its own\ncorrect annotation.</p>\n<p>If no function needs a particularly distinct security annotation in a class, just set a class-level <code>[SecurityCritical]</code>.</p>\n<h2>Resources</h2>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li>Redgate Hub - <a\n  href=\"https://www.red-gate.com/simple-talk/development/dotnet-development/whats-new-in-code-access-security-in-net-framework-4-0-part-i/\">What’s New\n  in Code Access Security in .NET Framework 4.0 – Part I</a></li>\n</ul>\n<h3>Standards</h3>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A05_2021-Security_Misconfiguration/\">Top 10 2021 Category A5 - Security Misconfiguration</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A6_2017-Security_Misconfiguration\">Top 10 2017 Category A6 - Security\n  Misconfiguration</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4211.json",
    "content": "{\n  \"title\": \"Members should not have conflicting transparency annotations\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-4211\",\n  \"sqKey\": \"S4211\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"OWASP\": [\n      \"A6\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A5\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"6.5.8\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"6.2.4\"\n    ],\n    \"CWE\": [\n      269\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4212.html",
    "content": "<p>This rule is deprecated, and will eventually be removed.</p>\n<h2>Why is this an issue?</h2>\n<p>Because serialization constructors allocate and initialize objects, security checks that are present on regular constructors must also be present\non a serialization constructor. Failure to do so would allow callers that could not otherwise create an instance to use the serialization constructor\nto do this.</p>\n<p>This rule raises an issue when a type implements the <code>System.Runtime.Serialization.ISerializable</code> interface, is not a delegate or\ninterface, is declared in an assembly that allows partially trusted callers and has a constructor that takes a\n<code>System.Runtime.Serialization.SerializationInfo</code> object and a <code>System.Runtime.Serialization.StreamingContext</code> object which is\nnot secured by a security check, but one or more of the regular constructors in the type is secured.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nusing System;\nusing System.IO;\nusing System.Runtime.Serialization;\nusing System.Runtime.Serialization.Formatters.Binary;\nusing System.Security;\nusing System.Security.Permissions;\n\n[assembly: AllowPartiallyTrustedCallersAttribute()]\nnamespace MyLibrary\n{\n    [Serializable]\n    public class Foo : ISerializable\n    {\n        private int n;\n\n        [FileIOPermissionAttribute(SecurityAction.Demand, Unrestricted = true)]\n        public Foo()\n        {\n           n = -1;\n        }\n\n        protected Foo(SerializationInfo info, StreamingContext context) // Noncompliant\n        {\n           n = (int)info.GetValue(\"n\", typeof(int));\n        }\n\n        void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)\n        {\n           info.AddValue(\"n\", n);\n        }\n    }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nusing System;\nusing System.IO;\nusing System.Runtime.Serialization;\nusing System.Runtime.Serialization.Formatters.Binary;\nusing System.Security;\nusing System.Security.Permissions;\n\n[assembly: AllowPartiallyTrustedCallersAttribute()]\nnamespace MyLibrary\n{\n    [Serializable]\n    public class Foo : ISerializable\n    {\n        private int n;\n\n        [FileIOPermissionAttribute(SecurityAction.Demand, Unrestricted = true)]\n        public Foo()\n        {\n           n = -1;\n        }\n\n        [FileIOPermissionAttribute(SecurityAction.Demand, Unrestricted = true)]\n        protected Foo(SerializationInfo info, StreamingContext context)\n        {\n           n = (int)info.GetValue(\"n\", typeof(int));\n        }\n\n        void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)\n        {\n           info.AddValue(\"n\", n);\n        }\n    }\n}\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A08_2021-Software_and_Data_Integrity_Failures/\">Top 10 2021 Category A8 - Software and Data Integrity\n  Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A8_2017-Insecure_Deserialization\">Top 10 2017 Category A8 - Insecure Deserialization\n  </a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4212.json",
    "content": "{\n  \"title\": \"Serialization constructors should be secured\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"deprecated\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"serialization\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-4212\",\n  \"sqKey\": \"S4212\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"OWASP\": [\n      \"A8\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A8\"\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4214.html",
    "content": "<p>This rule is deprecated; use {rule:csharpsquid:S4200} instead.</p>\n<h2>Why is this an issue?</h2>\n<p>Methods marked with the <code>System.Runtime.InteropServices.DllImportAttribute</code> attribute use Platform Invocation Services to access\nunmanaged code and should not be exposed. Keeping them private or internal makes sure that their access is controlled and properly managed.</p>\n<p>This rule raises an issue when a method declared with <code>DllImport</code> is public or protected.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nusing System;\nusing System.Runtime.InteropServices;\n\nnamespace MyLibrary\n{\n    public class Foo\n    {\n        [DllImport(\"kernel32.dll\", CharSet = CharSet.Unicode)]\n        public static extern bool RemoveDirectory(string name);  // Noncompliant\n    }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nusing System;\nusing System.Runtime.InteropServices;\n\nnamespace MyLibrary\n{\n    public class Foo\n    {\n        [DllImport(\"kernel32.dll\", CharSet = CharSet.Unicode)]\n        private static extern bool RemoveDirectory(string name);\n    }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4214.json",
    "content": "{\n  \"title\": \"\\\"P\\/Invoke\\\" methods should not be visible\",\n  \"type\": \"CODE_SMELL\",\n  \"status\": \"deprecated\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-4214\",\n  \"sqKey\": \"S4214\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4220.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When raising an event, two arguments are expected by the <code>EventHandler</code> delegate: Sender and event-data. There are three guidelines\nregarding these parameters:</p>\n<ul>\n  <li>Do not pass <code>null</code> as the sender when raising a non-static event.</li>\n  <li>Do pass <code>null</code> as the sender when raising a static event.</li>\n  <li>Do not pass <code>null</code> as the event-data. If no data should be passed, then <code>EventArgs.Empty</code> should be used.</li>\n</ul>\n<p>This rule raises an issue when any of these guidelines is not met.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nusing System;\n\nnamespace MyLibrary\n{\n  class Foo\n  {\n    public event EventHandler ThresholdReached;\n\n    protected virtual void OnThresholdReached(EventArgs e)\n    {\n        ThresholdReached?.Invoke(null, e); // Noncompliant\n    }\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nusing System;\n\nnamespace MyLibrary\n{\n  class Foo\n  {\n    public event EventHandler ThresholdReached;\n\n    protected virtual void OnThresholdReached(EventArgs e)\n    {\n        ThresholdReached?.Invoke(this, e);\n    }\n  }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4220.json",
    "content": "{\n  \"title\": \"Events should have proper arguments\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"event\",\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-4220\",\n  \"sqKey\": \"S4220\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4225.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>﻿Creating an extension method that extends <code>object</code> is not recommended because it makes the method available on <em>every</em> type.\nExtensions should be applied at the most specialized level possible, and that is very unlikely to be <code>object</code>.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic static class MyExtensions\n{\n    public static void SomeExtension(this object obj) // Noncompliant\n    {\n        // ...\n    }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4225.json",
    "content": "{\n  \"title\": \"Extension methods should not extend \\\"object\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"FOCUSED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-4225\",\n  \"sqKey\": \"S4225\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4226.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>It makes little sense to create an extension method when it is possible to just add that method to the class itself.</p>\n<p>This rule raises an issue when an extension is declared in the same namespace as the class it is extending.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nnamespace MyLibrary\n{\n    public class Foo\n    {\n        // ...\n    }\n\n    public static class MyExtensions\n    {\n        public static void Bar(this Foo a) // Noncompliant\n        {\n            // ...\n        }\n    }\n}\n</pre>\n<h3>Compliant solution</h3>\n<p>Using separate namespace:</p>\n<pre>\nnamespace MyLibrary\n{\n    public class Foo\n    {\n        // ...\n    }\n}\n\nnamespace Helpers\n{\n    public static class MyExtensions\n    {\n        public static void Bar(this Foo a)\n        {\n            // ...\n        }\n    }\n}\n</pre>\n<p>Merging the method in the class:</p>\n<pre>\nnamespace MyLibrary\n{\n    public class Foo\n    {\n        // ...\n        public void Bar()\n        {\n            // ...\n        }\n    }\n}\n</pre>\n<h3>Exceptions</h3>\n<ul>\n  <li>Extension methods added for clases decorated with <code>System.CodeDom.Compiler.GeneratedCodeAttribute</code> attribute.</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4226.json",
    "content": "{\n  \"title\": \"Extensions should be in separate namespaces\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"MODULAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"confusing\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-4226\",\n  \"sqKey\": \"S4226\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4260.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When creating a custom <a href=\"https://learn.microsoft.com/en-us/dotnet/desktop/wpf/advanced/markup-extensions-and-wpf-xaml\">Markup Extension</a>\nthat accepts parameters in WPF, the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.windows.markup.constructorargumentattribute\"><code>ConstructorArgument</code></a> markup\nmust be used to identify the discrete properties that match these parameters. However since this is done via a string, the compiler won’t give you any\nwarning in case there are typos.</p>\n<p>This rule raises an issue when the string argument to <code>ConstructorArgumentAttribute</code> doesn’t match any parameter of any constructor.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nusing System;\n\nnamespace MyLibrary\n{\n  public class MyExtension : MarkupExtension\n  {\n    public MyExtension() { }\n\n    public MyExtension(object value1)\n    {\n      Value1 = value1;\n    }\n\n    [ConstructorArgument(\"value2\")]   // Noncompliant\n    public object Value1 { get; set; }\n  }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nusing System;\n\nnamespace MyLibrary\n{\n  public class MyExtension : MarkupExtension\n  {\n    public MyExtension() { }\n\n    public MyExtension(object value1)\n    {\n      Value1 = value1;\n    }\n\n    [ConstructorArgument(\"value1\")]\n    public object Value1 { get; set; }\n  }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/desktop/wpf/advanced/markup-extensions-and-wpf-xaml\">Markup Extensions and\n  WPF XAML</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.windows.markup.markupextension\">MarkupExtension Class</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.windows.markup.constructorargumentattribute\">ConstructorArgumentAttribute Class</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4260.json",
    "content": "{\n  \"title\": \"\\\"ConstructorArgument\\\" parameters should exist in constructors\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"xaml\",\n    \"wpf\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-4260\",\n  \"sqKey\": \"S4260\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4261.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>According to the Task-based Asynchronous Pattern (TAP), methods returning either a <code>System.Threading.Tasks.Task</code> or a\n<code>System.Threading.Tasks.Task&lt;TResult&gt;</code> are considered \"asynchronous\". Such methods should use the <code>Async</code> suffix.\nConversely methods which do not return such Tasks should not have an \"Async\" suffix in their names.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nusing System;\nusing  System.Threading.Tasks;\n\nnamespace myLibrary\n{\n\n  public class Foo\n  {\n    public Task Read(byte [] buffer, int offset, int count, // Noncompliant\n                                CancellationToken cancellationToken)\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nusing System;\nusing  System.Threading.Tasks;\n\nnamespace myLibrary\n{\n\n  public class Foo\n  {\n    public Task ReadAsync(byte [] buffer, int offset, int count, CancellationToken cancellationToken)\n  }\n}\n</pre>\n<h3>Exceptions</h3>\n<p>This rule doesn’t raise an issue when the method is an override or part of the implementation of an interface since it can not be renamed.</p>\n<h2>Resources</h2>\n<ul>\n  <li><a href=\"https://docs.microsoft.com/en-us/dotnet/standard/asynchronous-programming-patterns/task-based-asynchronous-pattern-tap\">Task-based\n  Asynchronous Pattern</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4261.json",
    "content": "{\n  \"title\": \"Methods should be named according to their synchronicities\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-4261\",\n  \"sqKey\": \"S4261\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4275.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Properties provide a way to enforce <a href=\"https://en.wikipedia.org/wiki/Encapsulation_(computer_programming)\">encapsulation</a> by providing\naccessors that give controlled access to <code>private</code> fields. However, in classes with multiple fields, it is not unusual that <a\nhref=\"https://en.wikipedia.org/wiki/Copy-and-paste_programming\">copy-and-paste</a> is used to quickly create the needed properties, which can result\nin the wrong field being accessed by a getter or setter.</p>\n<pre>\nclass C\n{\n    private int x;\n    private int y;\n    public int Y =&gt; x; // Noncompliant: The returned field should be 'y'\n}\n</pre>\n<p>This rule raises an issue in any of these cases:</p>\n<ul>\n  <li>A getter does not access the field with the corresponding name.</li>\n  <li>A setter does not update the field with the corresponding name.</li>\n</ul>\n<p>For simple properties, it is better to use <a\nhref=\"https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/auto-implemented-properties\">auto-implemented\nproperties</a> (C# 3.0 or later).</p>\n<p>Field and property names are compared as case-insensitive. All underscore characters are ignored.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nclass A\n{\n    private int x;\n    private int y;\n\n    public int X\n    {\n        get { return x; }\n        set { x = value; }\n    }\n\n    public int Y\n    {\n        get { return x; }  // Noncompliant: field 'y' is not used in the return value\n        set { x = value; } // Noncompliant: field 'y' is not updated\n    }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nclass A\n{\n    private int x;\n    private int y;\n\n    public int X\n    {\n        get { return x; }\n        set { x = value; }\n    }\n\n    public int Y\n    {\n        get { return y; }\n        set { y = value; }\n    }\n}\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li>Microsoft Learn: <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/properties\">Properties (C#\n  Programming Guide)</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4275.json",
    "content": "{\n  \"title\": \"Getters and setters should access the expected fields\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-4275\",\n  \"sqKey\": \"S4275\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4277.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Marking a class with <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.composition.partcreationpolicyattribute\"><code>PartCreationPolicy</code></a>(<a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.composition.creationpolicy\"><code>CreationPolicy.Shared</code></a>), which is\npart of <a href=\"https://learn.microsoft.com/en-us/dotnet/framework/mef\">Managed Extensibility Framework (MEF)</a>, means that a single, shared\ninstance of the exported object will be created. Therefore it doesn’t make sense to create new instances using the constructor and it will most likely\nresult in unexpected behaviours.</p>\n<p>This rule raises an issue when a constructor of a class marked shared with a <code>PartCreationPolicyAttribute</code> is invoked.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\n[Export(typeof(IFooBar))]\n[PartCreationPolicy(CreationPolicy.Shared)]\npublic class FooBar : IFooBar\n{\n}\n\npublic class Program\n{\n    public static void Main()\n    {\n        var fooBar = new FooBar(); // Noncompliant;\n    }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n[Export(typeof(IFooBar))]\n[PartCreationPolicy(CreationPolicy.Shared)]\npublic class FooBar : IFooBar\n{\n}\n\npublic class Program\n{\n    public static void Main()\n    {\n        var fooBar = serviceProvider.GetService&lt;IFooBar&gt;();\n    }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.composition.partcreationpolicyattribute\"><code>PartCreationPolicy</code></a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.composition.creationpolicy\"><code>CreationPolicy.Shared</code></a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/framework/mef\">Managed Extensibility Framework</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4277.json",
    "content": "{\n  \"title\": \"\\\"Shared\\\" parts should not be created with \\\"new\\\"\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"mef\",\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-4277\",\n  \"sqKey\": \"S4277\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4347.html",
    "content": "<p>Cryptographic operations often rely on unpredictable random numbers to enhance security. These random numbers are created by cryptographically\nsecure pseudo-random number generators (CSPRNG). It is important not to use a predictable seed with these random number generators otherwise the\nrandom numbers will also become predictable.</p>\n<h2>Why is this an issue?</h2>\n<p>Random number generators are often used to generate random values for cryptographic algorithms. When a random number generator is used for\ncryptographic purposes, the generated numbers must be as random and unpredictable as possible. When the random number generator is improperly seeded\nwith a constant or a predictable value, its output will also be predictable.</p>\n<p>This can have severe security implications for cryptographic operations that rely on the randomness of the generated numbers. By using a\npredictable seed, an attacker can potentially guess or deduce the generated numbers, compromising the security of whatever cryptographic algorithm\nrelies on the random number generator.</p>\n<h3>What is the potential impact?</h3>\n<p>It is crucial to understand that the strength of cryptographic algorithms heavily relies on the quality of the random numbers used. By improperly\nseeding a CSPRNG, we introduce a significant weakness that can be exploited by attackers.</p>\n<h4>Insecure cryptographic keys</h4>\n<p>One of the primary use cases for CSPRNGs is generating cryptographic keys. If an attacker can predict the seed used to initialize the random number\ngenerator, they may be able to derive the same keys. Depending on the use case, this can lead to multiple severe outcomes, such as:</p>\n<ul>\n  <li>Being able to decrypt sensitive documents, leading to privacy breaches or identity theft.</li>\n  <li>Gaining access to a private key used for signing, allowing an attacker to forge digital signatures and impersonate legitimate entities.</li>\n  <li>Bypassing authentication mechanisms that rely on public-key infrastructure (PKI), which can be abused to gain unauthorized access to systems or\n  networks.</li>\n</ul>\n<h4>Session hijacking and man-in-the-middle attack</h4>\n<p>Another scenario where this vulnerability can be exploited is in the generation of session tokens or nonces for secure communication protocols. If\nan attacker can predict the seed used to generate these tokens, they can impersonate legitimate users or intercept sensitive information.</p>\n<h2>How to fix it in BouncyCastle</h2>\n<p>BouncyCastle provides several random number generators implementations. Most of these will automatically create unpredictable output.</p>\n<p>The remaining random number generators require seeding with an unpredictable value before they will produce unpredictable outputs. These should be\nseeded with at least 16 bytes of random data to ensure unpredictable output and that the random seed cannot be guessed using a brute-force attack.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<p><code>SecureRandom</code> instances created with <code>GetInstance()</code> are seeded by default. Disabling seeding results in predictable\noutput.</p>\n<pre data-diff-id=\"101\" data-diff-type=\"noncompliant\">\nusing Org.BouncyCastle.Security;\n\nbyte[] random = new byte[8];\n\nSecureRandom sr = SecureRandom.GetInstance(\"SHA256PRNG\", false);\nsr.NextBytes(random); // Noncompliant\n</pre>\n<p><code>DigestRandomGenerator</code> and <code>VmpcRandomGenerator</code> instances require seeding before use. Predictable seed values will result\nin predictable outputs.</p>\n<pre data-diff-id=\"102\" data-diff-type=\"noncompliant\">\nusing Org.BouncyCastle.Crypto.Digest;\nusing Org.BouncyCastle.Crypto.Prng;\n\nbyte[] random = new byte[8];\n\nIRandomGenerator digest = new DigestRandomGenerator(new Sha256Digest());\ndigest.AddSeedMaterial(Encoding.UTF8.GetBytes(\"predictable seed value\"));\ndigest.NextBytes(random); // Noncompliant\n\nIRandomGenerator vmpc = new VmpcRandomGenerator();\nvmpc.AddSeedMaterial(Convert.FromBase64String(\"2hq9pkyqLQJkrYTrEv1eNw==\"));\nvmpc.NextBytes(random); // Noncompliant\n</pre>\n<p>When a <code>SecureRandom</code> is created using an unseeded <code>DigestRandomGenerator</code> and <code>VmpcRandomGenerator</code> instance, the\n<code>SecureRandom</code> will create predictable outputs.</p>\n<pre data-diff-id=\"103\" data-diff-type=\"noncompliant\">\nusing Org.BouncyCastle.Crypto.Digest;\nusing Org.BouncyCastle.Crypto.Prng;\nusing Org.BouncyCastle.Security;\n\nbyte[] random = new byte[8];\n\nIRandomGenerator digest = new DigestRandomGenerator(new Sha256Digest());\nSecureRandom sr = new SecureRandom(digest);\nsr.NextBytes(random); // Noncompliant\n</pre>\n<h4>Compliant solution</h4>\n<p>Allow <code>SecureRandom.GetInstance()</code> to automatically seed new <code>SecureRandom</code> instances.</p>\n<pre data-diff-id=\"101\" data-diff-type=\"compliant\">\nusing Org.BouncyCastle.Security;\n\nbyte[] random = new byte[8];\n\nSecureRandom sr = SecureRandom.GetInstance(\"SHA256PRNG\");\nsr.NextBytes(random);\n</pre>\n<p>Use unpredictable values to seed <code>DigestRandomGenerator</code> and <code>VmpcRandomGenerator</code> instances. The\n<code>SecureRandom.GenerateSeed()</code> method is designed for this purpose.</p>\n<pre data-diff-id=\"102\" data-diff-type=\"compliant\">\nusing Org.BouncyCastle.Crypto.Digest;\nusing Org.BouncyCastle.Crypto.Prng;\nusing Org.BouncyCastle.Security;\n\nbyte[] random = new byte[8];\n\nIRandomGenerator digest = new DigestRandomGenerator(new Sha256Digest());\ndigest.AddSeedMaterial(SecureRandom.GenerateSeed(16));\ndigest.NextBytes(random);\n\nIRandomGenerator vmpc = new VmpcRandomGenerator();\nvmpc.AddSeedMaterial(SecureRandom.GenerateSeed(16));\nvmpc.NextBytes(random);\n</pre>\n<p>An overload of the <code>SecureRandom</code> constructor will automatically seed the underlying <code>IRandomGenerator</code> with an unpredictable\nvalue.</p>\n<pre data-diff-id=\"103\" data-diff-type=\"compliant\">\nusing Org.BouncyCastle.Crypto.Digest;\nusing Org.BouncyCastle.Crypto.Prng;\nusing Org.BouncyCastle.Security;\n\nbyte[] random = new byte[8];\n\nIRandomGenerator digest = new DigestRandomGenerator(new Sha256Digest());\nSecureRandom sr = new SecureRandom(digest, 16);\nsr.NextBytes(random);\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Bouncy Castle - <a href=\"https://downloads.bouncycastle.org/csharp/docs/BC-CSharpDotNet-UserGuide.pdf\">The BouncyCastle.NET User Guide</a></li>\n</ul>\n<h3>Standards</h3>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A02_2021-Cryptographic_Failures/\">Top 10 2021 Category A2 - Cryptographic Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A6_2017-Security_Misconfiguration\">Top 10 2017 Category A6 - Security\n  Misconfiguration</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/330\">CWE-330 - Use of Insufficiently Random Values</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/332\">CWE-332 - Insufficient Entropy in PRNG</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/336\">CWE-336 - Same Seed in Pseudo-Random Number Generator (PRNG)</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/337\">CWE-337 - Predictable Seed in Pseudo-Random Number Generator (PRNG)</a></li>\n  <li><a href=\"https://wiki.sei.cmu.edu/confluence/display/java/MSC63-J.+Ensure+that+SecureRandom+is+properly+seeded\">CERT, MSC63J.</a> - Ensure that\n  SecureRandom is properly seeded</li>\n</ul>\n<h2>Implementation Specification</h2>\n<p>(visible only on this page)</p>\n<h3>Message</h3>\n<p>When the random number generator’s output <strong>is not</strong> predictable by default:</p>\n<blockquote>\n  <p>Change this seed value to something unpredictable, or remove the seed.</p>\n</blockquote>\n<p>When the random number generator’s output <strong>is</strong> predictable by default:</p>\n<blockquote>\n  <p>Set an unpredictable seed before generating random values.</p>\n</blockquote>\n<h3>Highlighting</h3>\n<p>When the random number generator’s output <strong>is not</strong> predictable by default:</p>\n<ul>\n  <li>The most recent function call that sets a seed. For example:\n    <ul>\n      <li>The factory method that returns the RNG, where the seed is passed as a parameter.</li>\n      <li>The RNG constructor, where the seed is a parameter.</li>\n      <li>The function call on the RNG that sets the seed.</li>\n    </ul></li>\n</ul>\n<p>When the random number generator’s output <strong>is</strong> predictable by default:</p>\n<ul>\n  <li>The function call on the RNG that returns a random value.</li>\n</ul>\n<p>If the factory method or constructor is not already highlighted, it should become a secondary highlight.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4347.json",
    "content": "{\n  \"title\": \"Secure random number generators should not output predictable values\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"HIGH\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"pitfall\",\n    \"symbolic-execution\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-4347\",\n  \"sqKey\": \"S4347\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      330,\n      332,\n      336,\n      337\n    ],\n    \"OWASP\": [\n      \"A6\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A2\"\n    ],\n    \"ASVS 4.0\": [\n      \"2.3.1\",\n      \"2.6.2\",\n      \"2.9.2\"\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4423.html",
    "content": "<p>This vulnerability exposes encrypted data to a number of attacks whose goal is to recover the plaintext.</p>\n<h2>Why is this an issue?</h2>\n<p>Encryption algorithms are essential for protecting sensitive information and ensuring secure communications in a variety of domains. They are used\nfor several important reasons:</p>\n<ul>\n  <li>Confidentiality, privacy, and intellectual property protection</li>\n  <li>Security during transmission or on storage devices</li>\n  <li>Data integrity, general trust, and authentication</li>\n</ul>\n<p>When selecting encryption algorithms, tools, or combinations, you should also consider two things:</p>\n<ol>\n  <li>No encryption is unbreakable.</li>\n  <li>The strength of an encryption algorithm is usually measured by the effort required to crack it within a reasonable time frame.</li>\n</ol>\n<p>For these reasons, as soon as cryptography is included in a project, it is important to choose encryption algorithms that are considered strong and\nsecure by the cryptography community.</p>\n<p>To provide communication security over a network, SSL and TLS are generally used. However, it is important to note that the following protocols are\nall considered weak by the cryptographic community, and are officially deprecated:</p>\n<ul>\n  <li>SSL versions 1.0, 2.0 and 3.0</li>\n  <li>TLS versions 1.0 and 1.1</li>\n</ul>\n<p>When these unsecured protocols are used, it is best practice to expect a breach: that a user or organization with malicious intent will perform\nmathematical attacks on this data after obtaining it by other means.</p>\n<h3>What is the potential impact?</h3>\n<p>After retrieving encrypted data and performing cryptographic attacks on it on a given timeframe, attackers can recover the plaintext that\nencryption was supposed to protect.</p>\n<p>Depending on the recovered data, the impact may vary.</p>\n<p>Below are some real-world scenarios that illustrate the potential impact of an attacker exploiting the vulnerability.</p>\n<h4>Additional attack surface</h4>\n<p>By modifying the plaintext of the encrypted message, an attacker may be able to trigger additional vulnerabilities in the code. An attacker can\nfurther exploit a system to obtain more information.\n  <br>\n  Encrypted values are often considered trustworthy because it would not be possible for a third party to modify them under normal circumstances.</p>\n<h4>Breach of confidentiality and privacy</h4>\n<p>When encrypted data contains personal or sensitive information, its retrieval by an attacker can lead to privacy violations, identity theft,\nfinancial loss, reputational damage, or unauthorized access to confidential systems.</p>\n<p>In this scenario, the company, its employees, users, and partners could be seriously affected.</p>\n<p>The impact is twofold, as data breaches and exposure of encrypted data can undermine trust in the organization, as customers, clients and\nstakeholders may lose confidence in the organization’s ability to protect their sensitive data.</p>\n<h4>Legal and compliance issues</h4>\n<p>In many industries and locations, there are legal and compliance requirements to protect sensitive data. If encrypted data is compromised and the\nplaintext can be recovered, companies face legal consequences, penalties, or violations of privacy laws.</p>\n<h2>How to fix it in .NET</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<p>These samples use TLSv1.0 as the default TLS algorithm, which is cryptographically weak.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nusing System.Net;\n\npublic void encrypt()\n{\n    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls; // Noncompliant\n}\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nusing System.Net.Http;\nusing System.Security.Authentication;\n\npublic void encrypt()\n{\n    new HttpClientHandler\n    {\n        SslProtocols = SslProtocols.Tls // Noncompliant\n    };\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nUsing System.Net;\n\npublic void encrypt()\n{\n    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls13;\n}\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nusing System.Net.Http;\nusing System.Security.Authentication;\n\npublic void encrypt()\n{\n    new HttpClientHandler\n    {\n        SslProtocols = SslProtocols.Tls12\n    };\n}\n</pre>\n<h3>How does this work?</h3>\n<p>As a rule of thumb, by default you should use the cryptographic algorithms and mechanisms that are considered strong by the cryptographic\ncommunity.</p>\n<p>The best choices at the moment are the following.</p>\n<h4>Use TLS v1.2 or TLS v1.3</h4>\n<p>Even though TLS V1.3 is available, using TLS v1.2 is still considered good and secure practice by the cryptography community.\n  <br></p>\n<p>The use of TLS v1.2 ensures compatibility with a wide range of platforms and enables seamless communication between different systems that do not\nyet have TLS v1.3 support.</p>\n<p>The only drawback depends on whether the framework used is outdated: its TLS v1.2 settings may enable older and insecure cipher suites that are\ndeprecated as insecure.</p>\n<p>On the other hand, TLS v1.3 removes support for older and weaker cryptographic algorithms, eliminates known vulnerabilities from previous TLS\nversions, and improves performance.</p>\n<h2>Resources</h2>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Padding_oracle_attack\">Wikipedia, Padding Oracle Attack</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Chosen-ciphertext_attack\">Wikipedia, Chosen-Ciphertext Attack</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Chosen-plaintext_attack\">Wikipedia, Chosen-Plaintext Attack</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Semantic_security\">Wikipedia, Semantically Secure Cryptosystems</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Optimal_asymmetric_encryption_padding\">Wikipedia, OAEP</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Galois/Counter_Mode\">Wikipedia, Galois/Counter Mode</a></li>\n</ul>\n<h3>Standards</h3>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A02_2021-Cryptographic_Failures/\">Top 10 2021 Category A2 - Cryptographic Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures/\">Top 10 2021 Category A7 - Identification and\n  Authentication Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure\">Top 10 2017 Category A3 - Sensitive Data\n  Exposure</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A6_2017-Security_Misconfiguration\">Top 10 2017 Category A6 - Security\n  Misconfiguration</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/327\">CWE-327 - Use of a Broken or Risky Cryptographic Algorithm</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4423.json",
    "content": "{\n  \"title\": \"Weak SSL\\/TLS protocols should not be used\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"HIGH\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"privacy\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-4423\",\n  \"sqKey\": \"S4423\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      327,\n      326,\n      295\n    ],\n    \"OWASP\": [\n      \"A3\",\n      \"A6\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A2\",\n      \"A7\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"4.1\",\n      \"6.5.4\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"4.2.1\",\n      \"6.2.4\"\n    ],\n    \"ASVS 4.0\": [\n      \"8.3.7\",\n      \"9.1.2\",\n      \"9.1.3\"\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4426.html",
    "content": "<p>This vulnerability exposes encrypted data to attacks whose goal is to recover the plaintext.</p>\n<h2>Why is this an issue?</h2>\n<p>Encryption algorithms are essential for protecting sensitive information and ensuring secure communications in a variety of domains. They are used\nfor several important reasons:</p>\n<ul>\n  <li>Confidentiality, privacy, and intellectual property protection</li>\n  <li>Security during transmission or on storage devices</li>\n  <li>Data integrity, general trust, and authentication</li>\n</ul>\n<p>When selecting encryption algorithms, tools, or combinations, you should also consider two things:</p>\n<ol>\n  <li>No encryption is unbreakable.</li>\n  <li>The strength of an encryption algorithm is usually measured by the effort required to crack it within a reasonable time frame.</li>\n</ol>\n<p>In today’s cryptography, the length of the <strong>key</strong> directly affects the security level of cryptographic algorithms.</p>\n<p>Note that depending on the algorithm, the term <strong>key</strong> refers to a different mathematical property. For example:</p>\n<ul>\n  <li>For RSA, the key is the product of two large prime numbers, also called the <strong>modulus</strong>.</li>\n  <li>For Elliptic Curve Cryptography (ECC), the key is only a sequence of randomly generated bytes.\n    <ul>\n      <li>In some cases, keys are derived from a master key or a passphrase using a Key Derivation Function (KDF) like PBKDF2 (Password-Based Key\n      Derivation Function 2)</li>\n    </ul></li>\n</ul>\n<p>If an application uses a key that is considered short and <strong>insecure</strong>, the encrypted data is exposed to attacks aimed at getting at\nthe plaintext.</p>\n<p>In general, it is best practice to expect a breach: that a user or organization with malicious intent will perform cryptographic attacks on this\ndata after obtaining it by other means.</p>\n<h3>What is the potential impact?</h3>\n<p>After retrieving encrypted data and performing cryptographic attacks on it on a given timeframe, attackers can recover the plaintext that\nencryption was supposed to protect.</p>\n<p>Depending on the recovered data, the impact may vary.</p>\n<p>Below are some real-world scenarios that illustrate the potential impact of an attacker exploiting the vulnerability.</p>\n<h4>Additional attack surface</h4>\n<p>By modifying the plaintext of the encrypted message, an attacker may be able to trigger additional vulnerabilities in the code. An attacker can\nfurther exploit a system to obtain more information.\n  <br>\n  Encrypted values are often considered trustworthy because it would not be possible for a third party to modify them under normal circumstances.</p>\n<h4>Breach of confidentiality and privacy</h4>\n<p>When encrypted data contains personal or sensitive information, its retrieval by an attacker can lead to privacy violations, identity theft,\nfinancial loss, reputational damage, or unauthorized access to confidential systems.</p>\n<p>In this scenario, the company, its employees, users, and partners could be seriously affected.</p>\n<p>The impact is twofold, as data breaches and exposure of encrypted data can undermine trust in the organization, as customers, clients and\nstakeholders may lose confidence in the organization’s ability to protect their sensitive data.</p>\n<h4>Legal and compliance issues</h4>\n<p>In many industries and locations, there are legal and compliance requirements to protect sensitive data. If encrypted data is compromised and the\nplaintext can be recovered, companies face legal consequences, penalties, or violations of privacy laws.</p>\n<h2>How to fix it in .NET</h2>\n<h3>Code examples</h3>\n<p>The following code examples either explicitly or implicitly generate keys. Note that there are differences in the size of the keys depending on the\nalgorithm.</p>\n<p>Due to the mathematical properties of the algorithms, the security requirements for the key size vary depending on the algorithm.\n  <br>\n  For example, a 256-bit ECC key provides about the same level of security as a 3072-bit RSA key and a 128-bit symmetric key.</p>\n<h4>Noncompliant code example</h4>\n<p>Here is an example of a private key generation with RSA:</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nusing System;\nusing System.Security.Cryptography;\n\npublic void encrypt()\n{\n    var RsaCsp = new RSACryptoServiceProvider(); // Noncompliant\n}\n</pre>\n<p>Here is an example of a key generation with the Digital Signature Algorithm (DSA):</p>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nusing System;\nusing System.Security.Cryptography;\n\npublic void encrypt()\n{\n    var DsaCsp = new DSACryptoServiceProvider(); // Noncompliant\n}\n</pre>\n<p>Here is an example of an Elliptic Curve (EC) initialization. It implicitly generates a private key whose size is indicated in the elliptic curve\nname:</p>\n<pre data-diff-id=\"3\" data-diff-type=\"noncompliant\">\nusing System;\nusing System.Security.Cryptography;\n\npublic void encrypt()\n{\n    ECDsa ecdsa = ECDsa.Create(ECCurve.NamedCurves.brainpoolP160t1); // Noncompliant\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nusing System;\nusing System.Security.Cryptography;\n\npublic void encrypt()\n{\n    var RsaCsp = new RSACryptoServiceProvider(2048);\n}\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nusing System;\nusing System.Security.Cryptography;\n\npublic void encrypt()\n{\n    var Dsa = new DSACng(2048);\n}\n</pre>\n<pre data-diff-id=\"3\" data-diff-type=\"compliant\">\nusing System;\nusing System.Security.Cryptography;\n\npublic void encrypt()\n{\n    ECDsa ecdsa = ECDsa.Create(ECCurve.NamedCurves.nistP256);\n}\n</pre>\n<h3>How does this work?</h3>\n<p>As a rule of thumb, use the cryptographic algorithms and mechanisms that are considered strong by the cryptography community.</p>\n<p>The appropriate choices are the following.</p>\n<h4>RSA (Rivest-Shamir-Adleman) and DSA (Digital Signature Algorithm)</h4>\n<p>The security of these algorithms depends on the difficulty of attacks attempting to solve their underlying mathematical problem.</p>\n<p>In general, a minimum key size of <strong>2048</strong> bits is recommended for both. It provides 112 bits of security. A key length of\n<strong>3072</strong> or <strong>4096</strong> should be preferred when possible.</p>\n<h4>Elliptic Curve Cryptography (ECC)</h4>\n<p>Elliptic curve cryptography is also used in various algorithms, such as ECDSA, ECDH, or ECMQV. The length of keys generated with elliptic curve\nalgorithms is mentioned directly in their names. For example, <code>secp256k1</code> generates a 256-bits long private key.</p>\n<p>Currently, a minimum key size of <strong>224 bits</strong> is recommended for EC-based algorithms.</p>\n<p>Additionally, some curves that theoretically provide sufficiently long keys are still discouraged. This can be because of a flaw in the curve\nparameters, a bad overall design, or poor performance. It is generally advised to use a NIST-approved elliptic curve wherever possible. Such curves\ncurrently include:</p>\n<ul>\n  <li>NIST P curves with a size of at least 224 bits, e.g. secp256r1.</li>\n  <li>Curve25519, generally known as ed25519 or x25519 depending on its application.</li>\n  <li>Curve448.</li>\n  <li>Brainpool curves with a size of at least 224 bits, e.g. brainpoolP224r1</li>\n</ul>\n<h3>Pitfalls</h3>\n<h4>The KeySize Property is not a setter</h4>\n<p>The following code is invalid:</p>\n<pre>\n ----\n     var RsaCsp = new RSACryptoServiceProvider();\n     RsaCsp.KeySize = 2048;\n----\n</pre>\n<p>The KeySize property of CryptoServiceProviders cannot be updated because the setter simply does not exist. This means that this line will not\nperform any update on <code>KeySize</code>, and the compiler won’t raise an Exception when compiling it. This should not be considered a workaround.\n  <br>\n  To change the key size, use one of the overloaded constructors with the desired key size instead.</p>\n<h3>Going the extra mile</h3>\n<h4>Pre-Quantum Cryptography</h4>\n<p>Encrypted data and communications recorded today could be decrypted in the future by an attack from a quantum computer.\n  <br>\n  It is important to keep in mind that NIST-approved digital signature schemes, key agreement, and key transport may need to be replaced with secure\n  quantum-resistant (or \"post-quantum\") counterpart.</p>\n<p>Thus, if data is to remain secure beyond 2030, proactive measures should be taken now to ensure its safety.</p>\n<p><a href=\"https://www.enisa.europa.eu/publications/post-quantum-cryptography-current-state-and-quantum-mitigation\">Learn more here</a>.</p>\n<h2>Resources</h2>\n<ul>\n  <li>Documentation\n    <ul>\n      <li>NIST Documentation - <a href=\"https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-186.pdf\">NIST SP 800-186: Recommendations\n      for Discrete Logarithm-based Cryptography: Elliptic Curve Domain Parameters</a></li>\n      <li>IETF - <a href=\"https://datatracker.ietf.org/doc/html/rfc5639\">rfc5639: Elliptic Curve Cryptography (ECC) Brainpool Standard Curves and\n      Curve Generation</a></li>\n    </ul></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/security/vulnerabilities-cbc-mode\">Microsoft, Timing vulnerabilities with CBC-mode\n  symmetric decryption using padding</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Padding_oracle_attack\">Wikipedia, Padding Oracle Attack</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Chosen-ciphertext_attack\">Wikipedia, Chosen-Ciphertext Attack</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Chosen-plaintext_attack\">Wikipedia, Chosen-Plaintext Attack</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Semantic_security\">Wikipedia, Semantically Secure Cryptosystems</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Optimal_asymmetric_encryption_padding\">Wikipedia, OAEP</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Galois/Counter_Mode\">Wikipedia, Galois/Counter Mode</a></li>\n</ul>\n<h3>Standards</h3>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A02_2021-Cryptographic_Failures/\">Top 10 2021 Category A2 - Cryptographic Failures</a></li>\n  <li>OWASP - <a href=\"https://www.owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure\">Top 10 2017 Category A3 - Sensitive Data\n  Exposure</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A6_2017-Security_Misconfiguration\">Top 10 2017 Category A6 - Security\n  Misconfiguration</a></li>\n  <li><a href=\"https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-131Ar1.pdf\">NIST 800-131A</a> - Recommendation for Transitioning the\n  Use of Cryptographic Algorithms and Key Lengths</li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/326\">CWE-326 - Inadequate Encryption Strength</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/327\">CWE-327 - Use of a Broken or Risky Cryptographic Algorithm</a></li>\n  <li><a href=\"https://wiki.sei.cmu.edu/confluence/x/hDdGBQ\">CERT, MSC61-J.</a> - Do not use insecure or weak cryptographic algorithms</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4426.json",
    "content": "{\n  \"title\": \"Cryptographic keys should be robust\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"HIGH\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"privacy\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-4426\",\n  \"sqKey\": \"S4426\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      326\n    ],\n    \"OWASP\": [\n      \"A3\",\n      \"A6\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A2\"\n    ],\n    \"ASVS 4.0\": [\n      \"6.2.3\"\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4428.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>To customize the default behavior for an export in the <a href=\"https://learn.microsoft.com/en-us/dotnet/framework/mef/\">Managed Extensibility\nFramework</a> (MEF), applying the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.composition.partcreationpolicyattribute\"><code>PartCreationPolicyAttribute</code></a>\nis necessary. For the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.composition.partcreationpolicyattribute\"><code>PartCreationPolicyAttribute</code></a>\nto be meaningful in the context of an export, the class must also be annotated with the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.composition.exportattribute\"><code>ExportAttribute</code></a>.</p>\n<p>This rule raises an issue when a class is annotated with the <code>PartCreationPolicyAttribute</code> but not with the\n<code>ExportAttribute</code>.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nusing System.ComponentModel.Composition;\n\n[PartCreationPolicy(CreationPolicy.Any)] // Noncompliant\npublic class FooBar : IFooBar { }\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nusing System.ComponentModel.Composition;\n\n[Export(typeof(IFooBar))]\n[PartCreationPolicy(CreationPolicy.Any)]\npublic class FooBar : IFooBar { }\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/framework/mef/\">Managed Extensibility Framework (MEF)</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/framework/mef/attributed-programming-model-overview-mef\">Attributed\n  programming model overview (MEF)</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.composition.partcreationpolicyattribute\">PartCreationPolicyAttribute\n  Class</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.composition.exportattribute\">ExportAttribute\n  Class</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.composition.creationpolicy\">CreationPolicy\n  Enum</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li>Stefan Henneken - <a href=\"https://stefanhenneken.net/2015/11/08/mef-part-1-fundamentals-imports-and-exports/\">MEF Part 1 – Fundamentals,\n  Imports and Exports</a></li>\n  <li>Stefan Henneken - <a href=\"https://stefanhenneken.net/2019/01/26/mef-part-2-metadata-and-creation-policies/\">MEF Part 2 – Metadata and creation\n  policies</a></li>\n  <li>Stefan Henneken - <a href=\"https://stefanhenneken.net/2019/03/06/mef-part-3-life-cycle-management-and-monitoring/\">MEF Part 3 – Life cycle\n  management and monitoring</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4428.json",
    "content": "{\n  \"title\": \"\\\"PartCreationPolicyAttribute\\\" should be used with \\\"ExportAttribute\\\"\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"mef\",\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-4428\",\n  \"sqKey\": \"S4428\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4433.html",
    "content": "<p>Lightweight Directory Access Protocol (LDAP) servers provide two main authentication methods: the <em>SASL</em> and <em>Simple</em> ones. The\n<em>Simple Authentication</em> method also breaks down into three different mechanisms:</p>\n<ul>\n  <li><em>Anonymous</em> Authentication</li>\n  <li><em>Unauthenticated</em> Authentication</li>\n  <li><em>Name/Password</em> Authentication</li>\n</ul>\n<p>A server that accepts either the <em>Anonymous</em> or <em>Unauthenticated</em> mechanisms will accept connections from clients not providing\ncredentials.</p>\n<h2>Why is this an issue?</h2>\n<p>When configured to accept the Anonymous or Unauthenticated authentication mechanism, an LDAP server will accept connections from clients that do\nnot provide a password or other authentication credentials. Such users will be able to read or modify part or all of the data contained in the hosted\ndirectory.</p>\n<h3>What is the potential impact?</h3>\n<p>An attacker exploiting unauthenticated access to an LDAP server can access the data that is stored in the corresponding directory. The impact\nvaries depending on the permission obtained on the directory and the type of data it stores.</p>\n<h4>Authentication bypass</h4>\n<p>If attackers get write access to the directory, they will be able to alter most of the data it stores. This might include sensitive technical data\nsuch as user passwords or asset configurations. Such an attack can typically lead to an authentication bypass on applications and systems that use the\naffected directory as an identity provider.</p>\n<p>In such a case, all users configured in the directory might see their identity and privileges taken over.</p>\n<h4>Sensitive information leak</h4>\n<p>If attackers get read-only access to the directory, they will be able to read the data it stores. That data might include security-sensitive pieces\nof information.</p>\n<p>Typically, attackers might get access to user account lists that they can use in further intrusion steps. For example, they could use such lists to\nperform password spraying, or related attacks, on all systems that rely on the affected directory as an identity provider.</p>\n<p>If the directory contains some Personally Identifiable Information, an attacker accessing it might represent a violation of regulatory requirements\nin some countries. For example, this kind of security event would go against the European GDPR law.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<p>The following code indicates an anonymous LDAP authentication vulnerability because it binds to a remote server using an Anonymous Simple\nauthentication mechanism.</p>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nDirectoryEntry myDirectoryEntry = new DirectoryEntry(adPath);\nmyDirectoryEntry.AuthenticationType = AuthenticationTypes.None; // Noncompliant\n\nDirectoryEntry myDirectoryEntry = new DirectoryEntry(adPath, \"u\", \"p\", AuthenticationTypes.None); // Noncompliant\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nDirectoryEntry myDirectoryEntry = new DirectoryEntry(myADSPath); // Compliant; default DirectoryEntry.AuthenticationType property value is \"Secure\" since .NET Framework 2.0\n\nDirectoryEntry myDirectoryEntry = new DirectoryEntry(myADSPath, \"u\", \"p\", AuthenticationTypes.Secure);\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://datatracker.ietf.org/doc/html/rfc4513#section-5\">RFC 4513 - Lightweight Directory Access Protocol (LDAP): Authentication\n  Methods and Security Mechanisms</a> - Bind operations</li>\n</ul>\n<h3>Standards</h3>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures/\">Top 10 2021 Category A7 - Identification and\n  Authentication Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A2_2017-Broken_Authentication\">Top 10 2017 Category A2 - Broken\n  Authentication</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/521\">CWE-521 - Weak Password Requirements</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4433.json",
    "content": "{\n  \"title\": \"LDAP connections should be authenticated\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"HIGH\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-4433\",\n  \"sqKey\": \"S4433\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      521\n    ],\n    \"OWASP\": [\n      \"A2\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A7\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"6.5.10\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"6.2.4\"\n    ],\n    \"ASVS 4.0\": [\n      \"9.2.2\",\n      \"9.2.3\"\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4456.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Because of the way <code>yield</code> methods are rewritten by the compiler (they become lazily evaluated state machines) any exceptions thrown\nduring the parameters check will happen only when the collection is iterated over. That could happen far away from the source of the buggy code.</p>\n<p>Therefore it is recommended to split the method into two: an outer method handling the validation (no longer lazy) and an inner (lazy) method to\nhandle the iteration.</p>\n<p>This rule raises an issue when a method throws any exception derived from <code>ArgumentException</code> and contains the <code>yield</code>\nkeyword.</p>\n<h3>Noncompliant code example</h3>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic static IEnumerable&lt;TSource&gt; TakeWhile&lt;TSource&gt;(this IEnumerable&lt;TSource&gt; source, Func&lt;TSource, bool&gt; predicate) // Noncompliant\n{\n    if (source == null) { throw new ArgumentNullException(nameof(source)); }\n    if (predicate == null) { throw new ArgumentNullException(nameof(predicate)); }\n\n    foreach (var element in source)\n    {\n        if (!predicate(element)) { break; }\n        yield return element;\n    }\n}\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\npublic static async IAsyncEnumerable&lt;TSource&gt; TakeWhileAsync(this IEnumerable&lt;TSource&gt; source, Func&lt;TSource, bool&gt; predicate) // Noncompliant\n{\n    if (source == null) { throw new ArgumentNullException(nameof(source)); }\n    if (predicate == null) { throw new ArgumentNullException(nameof(predicate)); }\n\n    foreach (var element in source)\n    {\n        await Task.Delay(10);\n        if (!predicate(element)) { break; }\n        yield return element;\n    }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic static IEnumerable&lt;TSource&gt; TakeWhile&lt;TSource&gt;(this IEnumerable&lt;TSource&gt; source, Func&lt;TSource, bool&gt; predicate)\n{\n    if (source == null) { throw new ArgumentNullException(nameof(source)); }\n    if (predicate == null) { throw new ArgumentNullException(nameof(predicate)); }\n    return TakeWhileIterator&lt;TSource&gt;(source, predicate);\n}\n\nprivate static IEnumerable&lt;TSource&gt; TakeWhileIterator&lt;TSource&gt;(IEnumerable&lt;TSource&gt; source, Func&lt;TSource, bool&gt; predicate)\n{\n    foreach (TSource element in source)\n    {\n        if (!predicate(element)) break;\n        yield return element;\n    }\n}\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\npublic static IAsyncEnumerable&lt;TSource&gt; TakeWhileAsync(this IEnumerable&lt;TSource&gt; source, Func&lt;TSource, bool&gt; predicate)\n{\n    if (source == null) { throw new ArgumentNullException(nameof(source)); }\n    if (predicate == null) { throw new ArgumentNullException(nameof(predicate)); }\n\n    return TakeWhileAsyncIterator&lt;TSource&gt;(source, predicate);\n}\n\nprivate static async IAsyncEnumerable&lt;TSource&gt; TakeWhileAsyncIterator&lt;TSource&gt;(IEnumerable&lt;TSource&gt; source, Func&lt;TSource, bool&gt; predicate)\n{\n    foreach (TSource element in source)\n    {\n        await Task.Delay(10);\n        if (!predicate(element)) break;\n        yield return element;\n    }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Related rules</h3>\n<ul>\n  <li>{rule:csharpsquid:S4457} - Parameter validation in <code>async</code>/<code>await</code> methods should be wrapped</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4456.json",
    "content": "{\n  \"title\": \"Parameter validation in yielding methods should be wrapped\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [\n    \"yield\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-4456\",\n  \"sqKey\": \"S4456\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4457.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Because of the way <code>async</code>/<code>await</code> methods are rewritten by the compiler, any exceptions thrown during the parameters check\nare captured in the returned <code>Task</code> and will only be observed when the task is awaited. That could happen far away from the source of the\nbuggy code or never happen for fire-and-forget tasks.</p>\n<p>Therefore it is recommended to split the method into two: an outer method handling the parameter checks (without being\n<code>async</code>/<code>await</code>) and an inner method to handle the iterator block with the <code>async</code>/<code>await</code> pattern.</p>\n<p>This rule raises an issue when an <code>async</code> method throws any exception derived from <code>ArgumentException</code> and contains the\n<code>await</code> keyword.</p>\n<h3>Noncompliant code example</h3>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic static async Task SkipLinesAsync(this TextReader reader, int linesToSkip) // Noncompliant\n{\n    if (reader == null) { throw new ArgumentNullException(nameof(reader)); }\n    if (linesToSkip &lt; 0) { throw new ArgumentOutOfRangeException(nameof(linesToSkip)); }\n\n    for (var i = 0; i &lt; linesToSkip; ++i)\n    {\n        var line = await reader.ReadLineAsync().ConfigureAwait(false);\n        if (line == null) { break; }\n    }\n}\n\nvar task = SkipLinesAsync(null, -1); // No exception - captured in the task\nawait task;                          // ArgumentNullException thrown here\n</pre>\n<h3>Compliant solution</h3>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic static Task SkipLinesAsync(this TextReader reader, int linesToSkip)\n{\n    if (reader == null) { throw new ArgumentNullException(nameof(reader)); }\n    if (linesToSkip &lt; 0) { throw new ArgumentOutOfRangeException(nameof(linesToSkip)); }\n\n    return reader.SkipLinesInternalAsync(linesToSkip);\n}\n\nprivate static async Task SkipLinesInternalAsync(this TextReader reader, int linesToSkip)\n{\n    for (var i = 0; i &lt; linesToSkip; ++i)\n    {\n        var line = await reader.ReadLineAsync().ConfigureAwait(false);\n        if (line == null) { break; }\n    }\n}\n\nvar task = SkipLinesAsync(null, -1); // ArgumentNullException thrown here\nawait task;\n</pre>\n<h2>Resources</h2>\n<h3>Related rules</h3>\n<ul>\n  <li>{rule:csharpsquid:S4456} - Parameter validation in yielding methods should be wrapped</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4457.json",
    "content": "{\n  \"title\": \"Parameter validation in \\\"async\\\"\\/\\\"await\\\" methods should be wrapped\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [\n    \"async-await\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-4457\",\n  \"sqKey\": \"S4457\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4462.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Making blocking calls to <code>async</code> methods transforms code that was intended to be asynchronous into a blocking operation. Doing so can\ncause deadlocks and unexpected blocking of context threads.</p>\n<p>According to the MSDN documentation:</p>\n<blockquote>\n  <p>The root cause of this deadlock is due to the way <code>await</code> handles contexts. By default, when an incomplete <code>Task</code> is\n  awaited, the current “context” is captured and used to resume the method when the <code>Task</code> completes. This “context” is the current\n  <code>SynchronizationContext</code> unless it’s null, in which case it’s the current <code>TaskScheduler</code>. GUI and ASP.NET applications have a\n  <code>SynchronizationContext</code> that permits only one chunk of code to run at a time. When the <code>await</code> completes, it attempts to\n  execute the remainder of the <code>async</code> method within the captured context. But that context already has a thread in it, which is\n  (synchronously) waiting for the <code>async</code> method to complete. They’re each waiting for the other, causing a deadlock.</p>\n</blockquote>\n<table>\n  <colgroup>\n    <col style=\"width: 33.3333%;\">\n    <col style=\"width: 33.3333%;\">\n    <col style=\"width: 33.3334%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>To Do This …</th>\n      <th>Instead of This …</th>\n      <th>Use This</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p>Retrieve the result of a background task</p>\n      </td>\n      <td>\n        <p><code>Task.Wait</code>, <code>Task.Result</code> or <code>Task.GetAwaiter.GetResult</code></p>\n      </td>\n      <td>\n        <p><code>await</code></p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>Wait for any task to complete</p>\n      </td>\n      <td>\n        <p><code>Task.WaitAny</code></p>\n      </td>\n      <td>\n        <p><code>await Task.WhenAny</code></p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>Retrieve the results of multiple tasks</p>\n      </td>\n      <td>\n        <p><code>Task.WaitAll</code></p>\n      </td>\n      <td>\n        <p><code>await Task.WhenAll</code></p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>Wait a period of time</p>\n      </td>\n      <td>\n        <p><code>Thread.Sleep</code></p>\n      </td>\n      <td>\n        <p><code>await Task.Delay</code></p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h3>Noncompliant code example</h3>\n<pre>\npublic static class DeadlockDemo\n{\n    private static async Task DelayAsync()\n    {\n        await Task.Delay(1000);\n    }\n\n    // This method causes a deadlock when called in a GUI or ASP.NET context.\n    public static void Test()\n    {\n        // Start the delay.\n        var delayTask = DelayAsync();\n        // Wait for the delay to complete.\n        delayTask.Wait(); // Noncompliant\n    }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic static class DeadlockDemo\n{\n    private static async Task DelayAsync()\n    {\n        await Task.Delay(1000);\n    }\n\n    public static async Task TestAsync()\n    {\n        // Start the delay.\n        var delayTask = DelayAsync();\n        // Wait for the delay to complete.\n        await delayTask;\n    }\n}\n</pre>\n<h3>Exceptions</h3>\n<ul>\n  <li>Main methods of Console Applications are not subject to this deadlock issue and so are ignored by this rule.</li>\n  <li><code>Thread.Sleep</code> is also ignored when it is used in a non-<code>async</code> method.</li>\n  <li>Calls chained after <code>Task.Run</code> or <code>Task.Factory.StartNew</code> are ignored because they don’t suffer from this deadlock\n  issue</li>\n</ul>\n<h2>Resources</h2>\n<ul>\n  <li><a href=\"https://msdn.microsoft.com/en-us/magazine/jj991977.aspx\">Async/Await - Best Practices in Asynchronous Programming</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4462.json",
    "content": "{\n  \"title\": \"Calls to \\\"async\\\" methods should not be blocking\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"async-await\",\n    \"deadlock\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-4462\",\n  \"sqKey\": \"S4462\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4487.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Private fields which are written but never read are a case of \"dead store\". Changing the value of such a field is useless and most probably\nindicates an error in the code.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic class Rectangle\n{\n  private readonly int length;\n  private readonly int width;  // Noncompliant: width is written but never read\n\n  public Rectangle(int length, int width)\n  {\n    this.length = length;\n    this.width = width;\n  }\n\n  public int Surface\n  {\n    get\n    {\n      return length * length;\n    }\n  }\n}\n</pre>\n<p>Remove this field if it doesn’t need to be read, or fix the code to read it.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic class Rectangle\n{\n  private readonly int length;\n  private readonly int width;\n\n  public Rectangle(int length, int width)\n  {\n    this.length = length;\n    this.width = width;\n  }\n\n  public int Surface\n  {\n    get\n    {\n      return length * width;\n    }\n  }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Standards</h3>\n<ul>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/563\">CWE-563 - Assignment to Variable without Use ('Unused Variable')</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4487.json",
    "content": "{\n  \"title\": \"Unread \\\"private\\\" fields should be removed\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"unused\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-4487\",\n  \"sqKey\": \"S4487\",\n  \"scope\": \"All\",\n  \"securityStandards\": {\n    \"CWE\": [\n      563\n    ]\n  },\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4502.html",
    "content": "<p>A cross-site request forgery (CSRF) attack occurs when a trusted user of a web application can be forced, by an attacker, to perform sensitive\nactions that he didn’t intend, such as updating his profile or sending a message, more generally anything that can change the state of the\napplication.</p>\n<p>The attacker can trick the user/victim to click on a link, corresponding to the privileged action, or to visit a malicious web site that embeds a\nhidden web request and as web browsers automatically include cookies, the actions can be authenticated and sensitive.</p>\n<h2>Ask Yourself Whether</h2>\n<ul>\n  <li>The web application uses cookies to authenticate users.</li>\n  <li>There exist sensitive operations in the web application that can be performed when the user is authenticated.</li>\n  <li>The state / resources of the web application can be modified by doing HTTP POST or HTTP DELETE requests for example.</li>\n</ul>\n<p>There is a risk if you answered yes to any of those questions.</p>\n<h2>Recommended Secure Coding Practices</h2>\n<ul>\n  <li>Protection against CSRF attacks is strongly recommended:\n    <ul>\n      <li>to be activated by default for all <a href=\"https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Safe_methods\">unsafe HTTP\n      methods</a>.</li>\n      <li>implemented, for example, with an unguessable CSRF token</li>\n    </ul></li>\n  <li>Of course all sensitive operations should not be performed with <a\n  href=\"https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Safe_methods\">safe HTTP</a> methods like <code>GET</code> which are designed to be\n  used only for information retrieval.</li>\n</ul>\n<h2>Sensitive Code Example</h2>\n<pre>\npublic void ConfigureServices(IServiceCollection services)\n{\n    // ...\n    services.AddControllersWithViews(options =&gt; options.Filters.Add(new IgnoreAntiforgeryTokenAttribute())); // Sensitive\n    // ...\n}\n</pre>\n<pre>\n[HttpPost, IgnoreAntiforgeryToken] // Sensitive\npublic IActionResult ChangeEmail(ChangeEmailModel model) =&gt; View(\"~/Views/...\");\n</pre>\n<h2>Compliant Solution</h2>\n<pre>\npublic void ConfigureServices(IServiceCollection services)\n{\n    // ...\n    services.AddControllersWithViews(options =&gt; options.Filters.Add(new AutoValidateAntiforgeryTokenAttribute()));\n    // or\n    services.AddControllersWithViews(options =&gt; options.Filters.Add(new ValidateAntiForgeryTokenAttribute()));\n    // ...\n}\n</pre>\n<pre>\n[HttpPost]\n[AutoValidateAntiforgeryToken]\npublic IActionResult ChangeEmail(ChangeEmailModel model) =&gt; View(\"~/Views/...\");\n</pre>\n<h2>See</h2>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A01_2021-Broken_Access_Control/\">Top 10 2021 Category A1 - Broken Access Control</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/352\">CWE-352 - Cross-Site Request Forgery (CSRF)</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A6_2017-Security_Misconfiguration\">Top 10 2017 Category A6 - Security\n  Misconfiguration</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-community/attacks/csrf\">Cross-Site Request Forgery</a></li>\n  <li>STIG Viewer - <a href=\"https://stigviewer.com/stigs/application_security_and_development/2024-12-06/finding/V-222603\">Application Security and\n  Development: V-222603</a> - The application must protect from Cross-Site Request Forgery (CSRF) vulnerabilities.</li>\n  <li>PortSwigger - <a href=\"https://portswigger.net/research/web-storage-the-lesser-evil-for-session-tokens\">Web storage: the lesser evil for session\n  tokens</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4502.json",
    "content": "{\n  \"title\": \"Disabling CSRF protections is security-sensitive\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"HIGH\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-4502\",\n  \"sqKey\": \"S4502\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      352\n    ],\n    \"OWASP\": [\n      \"A6\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A1\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"6.5.9\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"6.2.4\"\n    ],\n    \"ASVS 4.0\": [\n      \"13.2.3\",\n      \"4.2.2\"\n    ],\n    \"STIG ASD_V5R3\": [\n      \"V-222603\"\n    ]\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4507.html",
    "content": "<p>Development tools and frameworks usually have options to make debugging easier for developers. Although these features are useful during\ndevelopment, they should never be enabled for applications deployed in production. Debug instructions or error messages can leak detailed information\nabout the system, like the application’s path or file names.</p>\n<h2>Ask Yourself Whether</h2>\n<ul>\n  <li>The code or configuration enabling the application debug features is deployed on production servers or distributed to end users.</li>\n  <li>The application runs by default with debug features activated.</li>\n</ul>\n<p>There is a risk if you answered yes to any of those questions.</p>\n<h2>Recommended Secure Coding Practices</h2>\n<p>Do not enable debugging features on production servers.</p>\n<p>The .Net Core framework offers multiple features which help during debug.\n<code>Microsoft.AspNetCore.Builder.IApplicationBuilder.UseDeveloperExceptionPage</code> and\n<code>Microsoft.AspNetCore.Builder.IApplicationBuilder.UseDatabaseErrorPage</code> are two of them. Make sure that those features are disabled in\nproduction.</p>\n<p>Use <code>if (env.IsDevelopment())</code> to disable debug code.</p>\n<h2>Sensitive Code Example</h2>\n<p>This rule raises issues when the following .Net Core methods are called:\n<code>Microsoft.AspNetCore.Builder.IApplicationBuilder.UseDeveloperExceptionPage</code>,\n<code>Microsoft.AspNetCore.Builder.IApplicationBuilder.UseDatabaseErrorPage</code>.</p>\n<pre>\nusing Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Hosting;\n\nnamespace mvcApp\n{\n    public class Startup2\n    {\n        public void Configure(IApplicationBuilder app, IHostingEnvironment env)\n        {\n            // Those calls are Sensitive because it seems that they will run in production\n            app.UseDeveloperExceptionPage(); // Sensitive\n            app.UseDatabaseErrorPage(); // Sensitive\n        }\n    }\n}\n</pre>\n<h2>Compliant Solution</h2>\n<pre>\nusing Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Hosting;\n\nnamespace mvcApp\n{\n    public class Startup2\n    {\n        public void Configure(IApplicationBuilder app, IHostingEnvironment env)\n        {\n            if (env.IsDevelopment())\n            {\n                // The following calls are ok because they are disabled in production\n                app.UseDeveloperExceptionPage(); // Compliant\n                app.UseDatabaseErrorPage(); // Compliant\n            }\n        }\n    }\n}\n</pre>\n<h2>Exceptions</h2>\n<p>This rule does not analyze configuration files. Make sure that debug mode is not enabled by default in those files.</p>\n<h2>See</h2>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A05_2021-Security_Misconfiguration/\">Top 10 2021 Category A5 - Security Misconfiguration</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure\">Top 10 2017 Category A3 - Sensitive Data\n  Exposure</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/489\">CWE-489 - Active Debug Code</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/215\">CWE-215 - Information Exposure Through Debug Information</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4507.json",
    "content": "{\n  \"title\": \"Delivering code in production with debug features activated is security-sensitive\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"LOW\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"error-handling\",\n    \"debug\",\n    \"user-experience\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-4507\",\n  \"sqKey\": \"S4507\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      489,\n      215\n    ],\n    \"OWASP\": [\n      \"A3\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A5\"\n    ],\n    \"ASVS 4.0\": [\n      \"14.3.2\"\n    ]\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4524.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/selection-statements#the-switch-statement\">switch\nstatement</a> is a conditional statement that executes a sequence of instructions based on patterns matching the provided value.</p>\n<pre>\nswitch (temperatureInCelsius)\n{\n    case &lt; 35.0:\n        Console.WriteLine(\"Hypothermia\");\n        break;\n    case &gt;= 36.5 and &lt;= 37.5:\n        Console.WriteLine(\"Normal\");\n        break;\n    case &gt; 37.5 and &lt;= 40.0:\n        Console.WriteLine(\"Fever or hyperthermia\");\n        break;\n    case &gt; 40.0:\n        Console.WriteLine(\"Hyperpyrexia\");\n        break;\n}\n</pre>\n<p>The <code>switch</code> statement can optionally contain a <code>default</code> clause, executed when none of the <code>case</code> clauses are\nexecuted (or in presence of a <code>goto default;</code>).</p>\n<pre>\nswitch (gradeLetter)\n{\n    case \"A+\":\n    case \"A\":\n    case \"A-\":\n        Console.WriteLine(\"Excellent\");\n        break;\n    case \"B+\":\n    case \"B\":\n        Console.WriteLine(\"Very Good\");\n        break;\n    case \"B-\":\n    case \"C+\":\n        Console.WriteLine(\"Good\");\n        break;\n    case \"C\":\n        Console.WriteLine(\"Pass\");\n        break;\n    case \"F\":\n        Console.WriteLine(\"Fail\");\n        break;\n    default:\n        Console.WriteLine(\"Invalid grade letter!\");\n        break;\n}\n</pre>\n<p>The <code>default</code> clause can be defined for various reasons:</p>\n<ul>\n  <li>to handle <strong>unexpected values</strong>, as shown in the example above</li>\n  <li>or to show that all the cases were properly considered, making the function explicitely <strong>total</strong> (as opposed to <a\n  href=\"https://en.wikipedia.org/wiki/Partial_function\">partial</a>)</li>\n</ul>\n<p>While C# allows the <code>default</code> clause to appear in any place within a <code>switch</code> statement, and while its position doesn’t alter\nits behavior, it is recommended to put the <code>default</code> clause either at the beginning or at the end of the <code>switch</code> statement.</p>\n<p>That improves readability and helps the developer to quickly find the default behavior of a <code>switch</code> statement.</p>\n<p>This rule raises an issue if the <code>default</code> clause is neither the first nor the last one of the <code>switch</code> statement.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nswitch (param)\n{\n    case 0:\n        DoSomething();\n        break;\n    default: // Noncompliant: default clause should be the first or last one\n        Error();\n        break;\n    case 1:\n        DoSomethingElse();\n        break;\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nswitch (param)\n{\n    case 0:\n        DoSomething();\n        break;\n    case 1:\n        DoSomethingElse();\n        break;\n    default:\n        Error();\n        break;\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/selection-statements#the-switch-statement\">Switch\n  statement</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Partial_function\">Partial function</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4524.json",
    "content": "{\n  \"title\": \"\\\"default\\\" clauses should be first or last\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"FORMATTED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-4524\",\n  \"sqKey\": \"S4524\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4545.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The <code>DebuggerDisplayAttribute</code> is used to determine how an object is displayed in the debugger window.</p>\n<p>The <code>DebuggerDisplayAttribute</code> constructor takes a single mandatory argument: the string to be displayed in the value column for\ninstances of the type. Any text within curly braces is evaluated as the name of a field or property, or any complex expression containing method calls\nand operators.</p>\n<p>Naming a non-existent member between curly braces will result in a CS0103 error in the debug window when debugging objects. Although there is no\nimpact on the production code, providing a wrong value can lead to difficulties when debugging the application.</p>\n<p>This rule raises an issue when text specified between curly braces refers to members that don’t exist in the current context.</p>\n<h3>Noncompliant code example</h3>\n<pre>\n[DebuggerDisplay(\"Name: {Name}\")] // Noncompliant - Name doesn't exist in this context\npublic class Person\n{\n    public string FullName { get; private set; }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\n[DebuggerDisplay(\"Name: {FullName}\")]\npublic class Person\n{\n    public string FullName { get; private set; }\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4545.json",
    "content": "{\n  \"title\": \"\\\"DebuggerDisplayAttribute\\\" strings should reference existing members\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-4545\",\n  \"sqKey\": \"S4545\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4581.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When the syntax <code>new Guid()</code> (i.e. parameterless instantiation) is used, it must be that one of three things is wanted:</p>\n<ol>\n  <li>An empty GUID, in which case <code>Guid.Empty</code> is clearer.</li>\n  <li>A randomly-generated GUID, in which case <code>Guid.NewGuid()</code> should be used.</li>\n  <li>A new GUID with a specific initialization, in which case the initialization parameter is missing.</li>\n</ol>\n<p>This rule raises an issue when a parameterless instantiation of the <code>Guid</code> struct is found.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic void Foo()\n{\n    var g1 = new Guid();    // Noncompliant - what's the intent?\n    Guid g2 = new();        // Noncompliant\n    var g3 = default(Guid); // Noncompliant\n    Guid g4 = default;      // Noncompliant\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic void Foo(byte[] bytes)\n{\n    var g1 = Guid.Empty;\n    var g2 = Guid.NewGuid();\n    var g3 = new Guid(bytes);\n}\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4581.json",
    "content": "{\n  \"title\": \"\\\"new Guid()\\\" should not be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5 min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-4581\",\n  \"sqKey\": \"S4581\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4583.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When calling the <code>BeginInvoke</code> method of a <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.delegate\">delegate</a>,\nresources are allocated that are only freed up when <code>EndInvoke</code> is called. Failing to pair <code>BeginInvoke</code> with\n<code>EndInvoke</code> can lead to <a href=\"https://en.wikipedia.org/wiki/Resource_leak\">resource leaks</a> and incomplete asynchronous calls.</p>\n<p>This rule raises an issue in the following scenarios:</p>\n<ul>\n  <li>The <code>BeginInvoke</code> method is called without any callback, and it is not paired with a call to <code>EndInvoke</code> in the same\n  block.</li>\n  <li>A callback with a single parameter of type <code>IAsyncResult</code> does not contain a call to <code>EndInvoke</code> in the same block.</li>\n</ul>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<p><code>BeginInvoke</code> without callback:</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic delegate string AsyncMethodCaller();\n\npublic static void Main()\n{\n    AsyncExample asyncExample = new AsyncExample();\n    AsyncMethodCaller caller = new AsyncMethodCaller(asyncExample.MyMethod);\n\n    // Initiate the asynchronous call.\n    IAsyncResult result = caller.BeginInvoke(null, null); // Noncompliant: not paired with EndInvoke\n}\n</pre>\n<p><code>BeginInvoke</code> with callback:</p>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\npublic delegate string AsyncMethodCaller();\n\npublic static void Main()\n{\n    AsyncExample asyncExample = new AsyncExample();\n    AsyncMethodCaller caller = new AsyncMethodCaller(asyncExample.MyMethod);\n\n    IAsyncResult result = caller.BeginInvoke(\n        new AsyncCallback((IAsyncResult ar) =&gt; {}),\n        null); // Noncompliant: not paired with EndInvoke\n}\n</pre>\n<h4>Compliant solution</h4>\n<p><code>BeginInvoke</code> without callback:</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic delegate string AsyncMethodCaller();\n\npublic static void Main()\n{\n    AsyncExample asyncExample = new AsyncExample();\n    AsyncMethodCaller caller = new AsyncMethodCaller(asyncExample.MyMethod);\n\n    IAsyncResult result = caller.BeginInvoke(null, null);\n\n    string returnValue = caller.EndInvoke(result);\n}\n</pre>\n<p><code>BeginInvoke</code> with callback:</p>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\npublic delegate string AsyncMethodCaller();\n\npublic static void Main()\n{\n    AsyncExample asyncExample = new AsyncExample();\n    AsyncMethodCaller caller = new AsyncMethodCaller(asyncExample.MyMethod);\n\n    IAsyncResult result = caller.BeginInvoke(\n        new AsyncCallback((IAsyncResult ar) =&gt;\n            {\n                // Call EndInvoke to retrieve the results.\n                string returnValue = caller.EndInvoke(ar);\n            }), null);\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/asynchronous-programming-patterns/calling-synchronous-methods-asynchronously\">Calling\n  Synchronous Methods Asynchronously</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-using-delegates\">Asynchronous\n  Programming Using Delegates</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.control.begininvoke\">BeginInvoke()</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.control.endinvoke\">EndInvoke()</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.asynccallback\">AsyncCallback Delegate</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4583.json",
    "content": "{\n  \"title\": \"Calls to delegate\\u0027s method \\\"BeginInvoke\\\" should be paired with calls to \\\"EndInvoke\\\"\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-4583\",\n  \"sqKey\": \"S4583\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4586.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Returning <code>null</code> from a non-<code>async</code> <code>Task</code>/<code>Task&lt;TResult&gt;</code> method will cause a\n<code>NullReferenceException</code> at runtime if the method is awaited. This problem can be avoided by returning <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task.completedtask\"><code>Task.CompletedTask</code></a> or <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task.fromresult\"><code>Task.FromResult&lt;TResult&gt;(null)</code></a>\nrespectively.</p>\n<pre>\npublic Task DoFooAsync()\n{\n    return null;               // Noncompliant: Causes a NullReferenceException if awaited.\n}\n\npublic async Task Main()\n{\n    await DoFooAsync();        // NullReferenceException\n}\n</pre>\n<h2>How to fix it</h2>\n<p>Instead of <code>null</code> <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task.completedtask\"><code>Task.CompletedTask</code></a> or <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task.fromresult\"><code>Task.FromResult&lt;TResult&gt;(null)</code></a>\nshould be returned.</p>\n<h3>Code examples</h3>\n<p>A <code>Task</code> returning method can be fixed like so:</p>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic Task DoFooAsync()\n{\n    return null;               // Noncompliant: Causes a NullReferenceException if awaited.\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic Task DoFooAsync()\n{\n    return Task.CompletedTask; // Compliant: Method can be awaited.\n}\n</pre>\n<p>A <code>Task&lt;TResult&gt;</code> returning method can be fixed like so:</p>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\npublic Task&lt;object&gt; GetFooAsync()\n{\n    return null;                          // Noncompliant: Causes a NullReferenceException if awaited.\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\npublic Task&lt;object&gt; GetFooAsync()\n{\n    return Task.FromResult&lt;object&gt;(null); // Compliant: Method can be awaited.\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task.completedtask\"><code>Task.CompletedTask</code> Property</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task.fromresult\"><code>Task.FromResult&lt;TResult&gt;(TResult)</code>\n  Method</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li>StackOverflow - Answer by Stephen Cleary for <a href=\"https://stackoverflow.com/a/45350108\">Is it better to return an empty task or\n  null?</a></li>\n  <li>StackOverflow - Answer by Stephen Cleary for <a href=\"https://stackoverflow.com/a/27551261\">Best way to handle null task inside async\n  method?</a></li>\n  <li>C# Language Design - <a href=\"https://github.com/dotnet/csharplang/issues/35\">Proposal Champion \"Null-conditional await\"</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4586.json",
    "content": "{\n  \"title\": \"Non-async \\\"Task\\/Task\\u003cT\\u003e\\\" methods should not return null\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5 min\"\n  },\n  \"tags\": [\n    \"async-await\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-4586\",\n  \"sqKey\": \"S4586\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4635.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>It is important to be careful when searching for characters within a substring. Let’s consider the following example:</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nif (str.SubString(startIndex).IndexOf(char1) == -1) // Noncompliant: a new string is going to be created by \"Substring\"\n{\n   // ...\n}\n</pre>\n<p>A new <code>string</code> object is created with every call to the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.substring\"><code>Substring</code></a> method. When chaining it with any of the\nfollowing methods, it creates a new object for one-time use only:</p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.indexof\"><code>IndexOf</code></a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.indexofany\"><code>IndexOfAny</code></a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.lastindexof\"><code>LastIndexOf</code></a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.lastindexofany\"><code>LastIndexOfAny</code></a></li>\n</ul>\n<h3>What is the potential impact?</h3>\n<p>Creating a new object consumes significant <a href=\"https://en.wikipedia.org/wiki/System_resource\">system resources</a>, especially CPU and memory.\nWhen using <code>Substring</code> repeatedly, such as in a loop, it can greatly impact the overall performance of the application or program.</p>\n<p>To mitigate the creation of new objects while searching for characters within a substring, it is possible to use an overload of the mentioned\nmethods with a <code>startIndex</code> parameter:</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nif (str.IndexOf(char1, startIndex) == -1)           // Compliant: no new instance of string is created\n{\n   // ...\n}\n</pre>\n<p>Using these methods gives the same result while avoiding the creation of additional <code>string</code> objects.</p>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.substring\"><code>String.Substring</code> Method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.indexof\"><code>String.IndexOf</code> Method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.indexofany\"><code>String.IndexOfAny</code> Method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.lastindexof\"><code>String.LastIndexOf</code> Method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.lastindexofany\"><code>String.LastIndexOfAny</code> Method</a></li>\n</ul>\n<h3>Benchmarks</h3>\n<table>\n  <colgroup>\n    <col style=\"width: 14.2857%;\">\n    <col style=\"width: 14.2857%;\">\n    <col style=\"width: 14.2857%;\">\n    <col style=\"width: 14.2857%;\">\n    <col style=\"width: 14.2857%;\">\n    <col style=\"width: 14.2857%;\">\n    <col style=\"width: 14.2858%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>Method</th>\n      <th>Runtime</th>\n      <th>StringSize</th>\n      <th>Mean</th>\n      <th>StdDev</th>\n      <th>Ratio</th>\n      <th>Allocated</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p>SubstringThenIndexOf</p>\n      </td>\n      <td>\n        <p>.NET 7.0</p>\n      </td>\n      <td>\n        <p>10</p>\n      </td>\n      <td>\n        <p>11.234 ms</p>\n      </td>\n      <td>\n        <p>0.1319 ms</p>\n      </td>\n      <td>\n        <p>1.00</p>\n      </td>\n      <td>\n        <p>40000008 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>IndexOfOnly</p>\n      </td>\n      <td>\n        <p>.NET 7.0</p>\n      </td>\n      <td>\n        <p>10</p>\n      </td>\n      <td>\n        <p>2.477 ms</p>\n      </td>\n      <td>\n        <p>0.0473 ms</p>\n      </td>\n      <td>\n        <p>0.22</p>\n      </td>\n      <td>\n        <p>2 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>SubstringThenIndexOf</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.6.2</p>\n      </td>\n      <td>\n        <p>10</p>\n      </td>\n      <td>\n        <p>8.634 ms</p>\n      </td>\n      <td>\n        <p>0.4195 ms</p>\n      </td>\n      <td>\n        <p>1.00</p>\n      </td>\n      <td>\n        <p>48141349 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>IndexOfOnly</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.6.2</p>\n      </td>\n      <td>\n        <p>10</p>\n      </td>\n      <td>\n        <p>1.724 ms</p>\n      </td>\n      <td>\n        <p>0.0346 ms</p>\n      </td>\n      <td>\n        <p>0.19</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>SubstringThenIndexOf</p>\n      </td>\n      <td>\n        <p>.NET 7.0</p>\n      </td>\n      <td>\n        <p>100</p>\n      </td>\n      <td>\n        <p>14.651 ms</p>\n      </td>\n      <td>\n        <p>0.2977 ms</p>\n      </td>\n      <td>\n        <p>1.00</p>\n      </td>\n      <td>\n        <p>176000008 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>IndexOfOnly</p>\n      </td>\n      <td>\n        <p>.NET 7.0</p>\n      </td>\n      <td>\n        <p>100</p>\n      </td>\n      <td>\n        <p>2.464 ms</p>\n      </td>\n      <td>\n        <p>0.0501 ms</p>\n      </td>\n      <td>\n        <p>0.17</p>\n      </td>\n      <td>\n        <p>2 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>SubstringThenIndexOf</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.6.2</p>\n      </td>\n      <td>\n        <p>100</p>\n      </td>\n      <td>\n        <p>13.363 ms</p>\n      </td>\n      <td>\n        <p>0.2044 ms</p>\n      </td>\n      <td>\n        <p>1.00</p>\n      </td>\n      <td>\n        <p>176518761 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>IndexOfOnly</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.6.2</p>\n      </td>\n      <td>\n        <p>100</p>\n      </td>\n      <td>\n        <p>1.689 ms</p>\n      </td>\n      <td>\n        <p>0.0290 ms</p>\n      </td>\n      <td>\n        <p>0.13</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>SubstringThenIndexOf</p>\n      </td>\n      <td>\n        <p>.NET 7.0</p>\n      </td>\n      <td>\n        <p>1000</p>\n      </td>\n      <td>\n        <p>78.688 ms</p>\n      </td>\n      <td>\n        <p>2.4727 ms</p>\n      </td>\n      <td>\n        <p>1.00</p>\n      </td>\n      <td>\n        <p>1528000072 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>IndexOfOnly</p>\n      </td>\n      <td>\n        <p>.NET 7.0</p>\n      </td>\n      <td>\n        <p>1000</p>\n      </td>\n      <td>\n        <p>2.456 ms</p>\n      </td>\n      <td>\n        <p>0.0397 ms</p>\n      </td>\n      <td>\n        <p>0.03</p>\n      </td>\n      <td>\n        <p>2 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>SubstringThenIndexOf</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.6.2</p>\n      </td>\n      <td>\n        <p>1000</p>\n      </td>\n      <td>\n        <p>75.994 ms</p>\n      </td>\n      <td>\n        <p>1.2650 ms</p>\n      </td>\n      <td>\n        <p>1.00</p>\n      </td>\n      <td>\n        <p>1532637240 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>IndexOfOnly</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.6.2</p>\n      </td>\n      <td>\n        <p>1000</p>\n      </td>\n      <td>\n        <p>1.699 ms</p>\n      </td>\n      <td>\n        <p>0.0216 ms</p>\n      </td>\n      <td>\n        <p>0.02</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<p>The results were generated by running the following snippet with <a href=\"https://github.com/dotnet/BenchmarkDotNet\">BenchmarkDotNet</a>:</p>\n<pre>\nprivate string theString;\nprivate int iteration = 1_000_000;\n\n[Params(10, 100, 1_000)]\npublic int StringSize { get; set; }\n\n[GlobalSetup]\npublic void Setup() =&gt;\n    theString = new string('a', StringSize);\n\n[Benchmark(Baseline = true)]\npublic void SubstringThenIndexOf()\n{\n    for (var i = 0; i &lt; iteration; i++)\n    {\n        _ = theString.Substring(StringSize / 4).IndexOf('a');\n    }\n}\n\n[Benchmark]\npublic void IndexOfOnly()\n{\n    for (var i = 0; i &lt; iteration; i++)\n    {\n        _ = theString.IndexOf('a', StringSize / 4) - StringSize / 4;\n    }\n}\n</pre>\n<p>Hardware configuration:</p>\n<pre>\nBenchmarkDotNet=v0.13.5, OS=Windows 10 (10.0.19045.2965/22H2/2022Update)\n12th Gen Intel Core i7-12800H, 1 CPU, 20 logical and 14 physical cores\n.NET SDK=7.0.203\n  [Host]               : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2\n  .NET 7.0             : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2\n  .NET Framework 4.6.2 : .NET Framework 4.8 (4.8.4614.0), X64 RyuJIT VectorSize=256\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4635.json",
    "content": "{\n  \"title\": \"Start index should be used instead of calling Substring\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-4635\",\n  \"sqKey\": \"S4635\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4663.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Empty comments, as shown in the example, hurt readability and might indicate an oversight.</p>\n<pre>\n//\n\n/*\n*/\n\n///\n\n/**\n*/\n</pre>\n<p>Some meaningful text should be added to the comment, or the comment markers should be removed.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4663.json",
    "content": "{\n  \"title\": \"Comments should not be empty\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-4663\",\n  \"sqKey\": \"S4663\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4790.html",
    "content": "<p>Cryptographic hash algorithms such as <code>MD2</code>, <code>MD4</code>, <code>MD5</code>, <code>MD6</code>, <code>HAVAL-128</code>,\n<code>DSA</code> (which uses <code>SHA-1</code>), <code>RIPEMD</code>, <code>RIPEMD-128</code>, <code>RIPEMD-160</code>and <code>SHA-1</code> are no\nlonger considered secure, because it is possible to have <code>collisions</code> (little computational effort is enough to find two or more different\ninputs that produce the same hash).</p>\n<p>Message authentication code (MAC) algorithms such as <code>HMAC-MD5</code> or <code>HMAC-SHA1</code> use weak hash functions as building blocks.\nAlthough they are not all proven to be weak, they are considered legacy algorithms and should be avoided.</p>\n<h2>Ask Yourself Whether</h2>\n<p>The hashed value is used in a security context like:</p>\n<ul>\n  <li>User-password storage.</li>\n  <li>Security token generation (used to confirm e-mail when registering on a website, reset password, etc …​).</li>\n  <li>To compute some message integrity.</li>\n</ul>\n<p>There is a risk if you answered yes to any of those questions.</p>\n<h2>Recommended Secure Coding Practices</h2>\n<p>Safer alternatives, such as <code>SHA-256</code>, <code>SHA-512</code>, <code>SHA-3</code> are recommended, and for password hashing, it’s even\nbetter to use algorithms that do not compute too \"quickly\", like <code>bcrypt</code>, <code>scrypt</code>, <code>argon2</code> or <code>pbkdf2</code>\nbecause it slows down <code>brute force attacks</code>.</p>\n<h2>Sensitive Code Example</h2>\n<pre>\nvar hashProvider1 = new MD5CryptoServiceProvider(); // Sensitive\nvar hashProvider2 = (HashAlgorithm)CryptoConfig.CreateFromName(\"MD5\"); // Sensitive\nvar hashProvider3 = new SHA1Managed(); // Sensitive\nvar hashProvider4 = HashAlgorithm.Create(\"SHA1\"); // Sensitive\n</pre>\n<h2>Compliant Solution</h2>\n<pre>\nvar hashProvider1 = new SHA512Managed(); // Compliant\nvar hashProvider2 = (HashAlgorithm)CryptoConfig.CreateFromName(\"SHA512Managed\"); // Compliant\nvar hashProvider3 = HashAlgorithm.Create(\"SHA512Managed\"); // Compliant\n</pre>\n<h2>See</h2>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A02_2021-Cryptographic_Failures/\">Top 10 2021 Category A2 - Cryptographic Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure\">Top 10 2017 Category A3 - Sensitive Data\n  Exposure</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A6_2017-Security_Misconfiguration\">Top 10 2017 Category A6 - Security\n  Misconfiguration</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/1240\">CWE-1240 - Use of a Risky Cryptographic Primitive</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4790.json",
    "content": "{\n  \"title\": \"Using weak hashing algorithms is security-sensitive\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"HIGH\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  },\n  \"status\": \"ready\",\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-4790\",\n  \"sqKey\": \"S4790\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      1240\n    ],\n    \"OWASP\": [\n      \"A3\",\n      \"A6\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A2\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"3.4\",\n      \"6.5.3\",\n      \"6.5.4\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"6.2.4\"\n    ]\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4792.html",
    "content": "<p>This rule is deprecated, and will eventually be removed.</p>\n<p>Configuring loggers is security-sensitive. It has led in the past to the following vulnerabilities:</p>\n<ul>\n  <li><a href=\"https://www.cve.org/CVERecord?id=CVE-2018-0285\">CVE-2018-0285</a></li>\n  <li><a href=\"https://www.cve.org/CVERecord?id=CVE-2000-1127\">CVE-2000-1127</a></li>\n  <li><a href=\"https://www.cve.org/CVERecord?id=CVE-2017-15113\">CVE-2017-15113</a></li>\n  <li><a href=\"https://www.cve.org/CVERecord?id=CVE-2015-5742\">CVE-2015-5742</a></li>\n</ul>\n<p>Logs are useful before, during and after a security incident.</p>\n<ul>\n  <li>Attackers will most of the time start their nefarious work by probing the system for vulnerabilities. Monitoring this activity and stopping it\n  is the first step to prevent an attack from ever happening.</li>\n  <li>In case of a successful attack, logs should contain enough information to understand what damage an attacker may have inflicted.</li>\n</ul>\n<p>Logs are also a target for attackers because they might contain sensitive information. Configuring loggers has an impact on the type of information\nlogged and how they are logged.</p>\n<p>This rule flags for review code that initiates loggers configuration. The goal is to guide security code reviews.</p>\n<h2>Ask Yourself Whether</h2>\n<ul>\n  <li>unauthorized users might have access to the logs, either because they are stored in an insecure location or because the application gives access\n  to them.</li>\n  <li>the logs contain sensitive information on a production server. This can happen when the logger is in debug mode.</li>\n  <li>the log can grow without limit. This can happen when additional information is written into logs every time a user performs an action and the\n  user can perform the action as many times as he/she wants.</li>\n  <li>the logs do not contain enough information to understand the damage an attacker might have inflicted. The loggers mode (info, warn, error) might\n  filter out important information. They might not print contextual information like the precise time of events or the server hostname.</li>\n  <li>the logs are only stored locally instead of being backuped or replicated.</li>\n</ul>\n<p>There is a risk if you answered yes to any of those questions.</p>\n<h2>Recommended Secure Coding Practices</h2>\n<ul>\n  <li>Check that your production deployment doesn’t have its loggers in \"debug\" mode as it might write sensitive information in logs.</li>\n  <li>Production logs should be stored in a secure location which is only accessible to system administrators.</li>\n  <li>Configure the loggers to display all warnings, info and error messages. Write relevant information such as the precise time of events and the\n  hostname.</li>\n  <li>Choose log format which is easy to parse and process automatically. It is important to process logs rapidly in case of an attack so that the\n  impact is known and limited.</li>\n  <li>Check that the permissions of the log files are correct. If you index the logs in some other service, make sure that the transfer and the\n  service are secure too.</li>\n  <li>Add limits to the size of the logs and make sure that no user can fill the disk with logs. This can happen even when the user does not control\n  the logged information. An attacker could just repeat a logged action many times.</li>\n</ul>\n<p>Remember that configuring loggers properly doesn’t make them bullet-proof. Here is a list of recommendations explaining on how to use your\nlogs:</p>\n<ul>\n  <li>Don’t log any sensitive information. This obviously includes passwords and credit card numbers but also any personal information such as user\n  names, locations, etc…​ Usually any information which is protected by law is good candidate for removal.</li>\n  <li>Sanitize all user inputs before writing them in the logs. This includes checking its size, content, encoding, syntax, etc…​ As for any user\n  input, validate using whitelists whenever possible. Enabling users to write what they want in your logs can have many impacts. It could for example\n  use all your storage space or compromise your log indexing service.</li>\n  <li>Log enough information to monitor suspicious activities and evaluate the impact an attacker might have on your systems. Register events such as\n  failed logins, successful logins, server side input validation failures, access denials and any important transaction.</li>\n  <li>Monitor the logs for any suspicious activity.</li>\n</ul>\n<h2>Sensitive Code Example</h2>\n<p><strong>.Net Core</strong>: configure programmatically</p>\n<pre>\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Hosting;\nusing Microsoft.Extensions.Configuration;\nusing Microsoft.Extensions.DependencyInjection;\nusing Microsoft.Extensions.Logging;\nusing Microsoft.Extensions.Options;\nusing Microsoft.AspNetCore;\n\nnamespace MvcApp\n{\n    public class ProgramLogging\n    {\n        public static IWebHostBuilder CreateWebHostBuilder(string[] args) =&gt;\n            WebHost.CreateDefaultBuilder(args)\n                .ConfigureLogging((hostingContext, logging) =&gt; // Sensitive\n                {\n                    // ...\n                })\n                .UseStartup&lt;StartupLogging&gt;();\n    }\n\n    public class StartupLogging\n    {\n        public void ConfigureServices(IServiceCollection services)\n        {\n            services.AddLogging(logging =&gt; // Sensitive\n            {\n                // ...\n            });\n        }\n\n        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)\n        {\n            IConfiguration config = null;\n            LogLevel level = LogLevel.Critical;\n            Boolean includeScopes = false;\n            Func&lt;string,Microsoft.Extensions.Logging.LogLevel,bool&gt; filter = null;\n            Microsoft.Extensions.Logging.Console.IConsoleLoggerSettings consoleSettings = null;\n            Microsoft.Extensions.Logging.AzureAppServices.AzureAppServicesDiagnosticsSettings azureSettings = null;\n            Microsoft.Extensions.Logging.EventLog.EventLogSettings eventLogSettings = null;\n\n            // An issue will be raised for each call to an ILoggerFactory extension methods adding loggers.\n            loggerFactory.AddAzureWebAppDiagnostics(); // Sensitive\n            loggerFactory.AddAzureWebAppDiagnostics(azureSettings); // Sensitive\n            loggerFactory.AddConsole(); // Sensitive\n            loggerFactory.AddConsole(level); // Sensitive\n            loggerFactory.AddConsole(level, includeScopes); // Sensitive\n            loggerFactory.AddConsole(filter); // Sensitive\n            loggerFactory.AddConsole(filter, includeScopes); // Sensitive\n            loggerFactory.AddConsole(config); // Sensitive\n            loggerFactory.AddConsole(consoleSettings); // Sensitive\n            loggerFactory.AddDebug(); // Sensitive\n            loggerFactory.AddDebug(level); // Sensitive\n            loggerFactory.AddDebug(filter); // Sensitive\n            loggerFactory.AddEventLog(); // Sensitive\n            loggerFactory.AddEventLog(eventLogSettings); // Sensitive\n            loggerFactory.AddEventLog(level); // Sensitive\n            loggerFactory.AddEventSourceLogger(); // Sensitive\n\n            IEnumerable&lt;ILoggerProvider&gt; providers = null;\n            LoggerFilterOptions filterOptions1 = null;\n            IOptionsMonitor&lt;LoggerFilterOptions&gt; filterOptions2 = null;\n\n            LoggerFactory factory = new LoggerFactory(); // Sensitive\n            new LoggerFactory(providers); // Sensitive\n            new LoggerFactory(providers, filterOptions1); // Sensitive\n            new LoggerFactory(providers, filterOptions2); // Sensitive\n        }\n    }\n}\n</pre>\n<p><strong>Log4Net</strong></p>\n<pre>\nusing System;\nusing System.IO;\nusing System.Xml;\nusing log4net.Appender;\nusing log4net.Config;\nusing log4net.Repository;\n\nnamespace Logging\n{\n    class Log4netLogging\n    {\n        void Foo(ILoggerRepository repository, XmlElement element, FileInfo configFile, Uri configUri, Stream configStream,\n        IAppender appender, params IAppender[] appenders) {\n            log4net.Config.XmlConfigurator.Configure(repository); // Sensitive\n            log4net.Config.XmlConfigurator.Configure(repository, element); // Sensitive\n            log4net.Config.XmlConfigurator.Configure(repository, configFile); // Sensitive\n            log4net.Config.XmlConfigurator.Configure(repository, configUri); // Sensitive\n            log4net.Config.XmlConfigurator.Configure(repository, configStream); // Sensitive\n            log4net.Config.XmlConfigurator.ConfigureAndWatch(repository, configFile); // Sensitive\n\n            log4net.Config.DOMConfigurator.Configure(); // Sensitive\n            log4net.Config.DOMConfigurator.Configure(repository); // Sensitive\n            log4net.Config.DOMConfigurator.Configure(element); // Sensitive\n            log4net.Config.DOMConfigurator.Configure(repository, element); // Sensitive\n            log4net.Config.DOMConfigurator.Configure(configFile); // Sensitive\n            log4net.Config.DOMConfigurator.Configure(repository, configFile); // Sensitive\n            log4net.Config.DOMConfigurator.Configure(configStream); // Sensitive\n            log4net.Config.DOMConfigurator.Configure(repository, configStream); // Sensitive\n            log4net.Config.DOMConfigurator.ConfigureAndWatch(configFile); // Sensitive\n            log4net.Config.DOMConfigurator.ConfigureAndWatch(repository, configFile); // Sensitive\n\n            log4net.Config.BasicConfigurator.Configure(); // Sensitive\n            log4net.Config.BasicConfigurator.Configure(appender); // Sensitive\n            log4net.Config.BasicConfigurator.Configure(appenders); // Sensitive\n            log4net.Config.BasicConfigurator.Configure(repository); // Sensitive\n            log4net.Config.BasicConfigurator.Configure(repository, appender); // Sensitive\n            log4net.Config.BasicConfigurator.Configure(repository, appenders); // Sensitive\n        }\n    }\n}\n</pre>\n<p><strong>NLog</strong>: configure programmatically</p>\n<pre>\nnamespace Logging\n{\n    class NLogLogging\n    {\n        void Foo(NLog.Config.LoggingConfiguration config) {\n            NLog.LogManager.Configuration = config; // Sensitive, this changes the logging configuration.\n        }\n    }\n}\n</pre>\n<p><strong>Serilog</strong></p>\n<pre>\nnamespace Logging\n{\n    class SerilogLogging\n    {\n        void Foo() {\n            new Serilog.LoggerConfiguration(); // Sensitive\n        }\n    }\n}\n</pre>\n<h2>See</h2>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A09_2021-Security_Logging_and_Monitoring_Failures/\">Top 10 2021 Category A9 - Security Logging and\n  Monitoring Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure\">Top 10 2017 Category A3 - Sensitive Data\n  Exposure</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A10_2017-Insufficient_Logging%2526Monitoring\">Top 10 2017 Category A10 -\n  Insufficient Logging &amp; Monitoring</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/117\">CWE-117 - Improper Output Neutralization for Logs</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/532\">CWE-532 - Information Exposure Through Log Files</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4792.json",
    "content": "{\n  \"title\": \"Configuring loggers is security-sensitive\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"HIGH\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"deprecated\",\n  \"tags\": [],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-4792\",\n  \"sqKey\": \"S4792\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      117,\n      532\n    ],\n    \"OWASP\": [\n      \"A3\",\n      \"A10\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A9\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"10.1\",\n      \"10.2\",\n      \"10.3\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"10.2\"\n    ],\n    \"ASVS 4.0\": [\n      \"7.1.1\",\n      \"7.1.2\"\n    ]\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S4830.html",
    "content": "<p>This vulnerability makes it possible that an encrypted communication is intercepted.</p>\n<h2>Why is this an issue?</h2>\n<p>Transport Layer Security (TLS) provides secure communication between systems over the internet by encrypting the data sent between them.\nCertificate validation adds an extra layer of trust and security to this process to ensure that a system is indeed the one it claims to be.</p>\n<p>When certificate validation is disabled, the client skips a critical security check. This creates an opportunity for attackers to pose as a trusted\nentity and intercept, manipulate, or steal the data being transmitted.</p>\n<h3>What is the potential impact?</h3>\n<p>Establishing trust in a secure way is a non-trivial task. When you disable certificate validation, you are removing a key mechanism designed to\nbuild this trust in internet communication, opening your system up to a number of potential threats.</p>\n<h4>Identity spoofing</h4>\n<p>If a system does not validate certificates, it cannot confirm the identity of the other party involved in the communication. An attacker can\nexploit this by creating a fake server and masquerading as a legitimate one. For example, they might set up a server that looks like your bank’s\nserver, tricking your system into thinking it is communicating with the bank. This scenario, called identity spoofing, allows the attacker to collect\nany data your system sends to them, potentially leading to significant data breaches.</p>\n<h4>Loss of data integrity</h4>\n<p>When TLS certificate validation is disabled, the integrity of the data you send and receive cannot be guaranteed. An attacker could modify the data\nin transit, and you would have no way of knowing. This could range from subtle manipulations of the data you receive to the injection of malicious\ncode or malware into your system. The consequences of such breaches of data integrity can be severe, depending on the nature of the data and the\nsystem.</p>\n<h2>How to fix it in .NET</h2>\n<h3>Code examples</h3>\n<p>In the following example, the callback change impacts the entirety of HTTP requests made by the application.</p>\n<p>The certificate validation gets disabled by overriding <code>ServerCertificateValidationCallback</code> with an empty implementation. It is highly\nrecommended to use the original implementation.</p>\n<h4>Noncompliant code example</h4>\n<pre>\nusing System.Net;\nusing System.Net.Http;\n\npublic static void connect()\n{\n    ServicePointManager.ServerCertificateValidationCallback +=\n\t (sender, certificate, chain, errors) =&gt; {\n\t     return true; // Noncompliant\n    };\n\n    HttpClient httpClient = new HttpClient();\n    HttpResponseMessage response = httpClient.GetAsync(\"https://example.com\").Result;\n}\n</pre>\n<h3>How does this work?</h3>\n<p>Addressing the vulnerability of disabled TLS certificate validation primarily involves re-enabling the default validation.</p>\n<p>To avoid running into problems with invalid certificates, consider the following sections.</p>\n<h4>Using trusted certificates</h4>\n<p>If possible, always use a certificate issued by a well-known, trusted CA for your server. Most programming environments come with a predefined list\nof trusted root CAs, and certificates issued by these authorities are validated automatically. This is the best practice, and it requires no\nadditional code or configuration.</p>\n<h4>Working with self-signed certificates or non-standard CAs</h4>\n<p>In some cases, you might need to work with a server using a self-signed certificate, or a certificate issued by a CA not included in your trusted\nroots. Rather than disabling certificate validation in your code, you can add the necessary certificates to your trust store.</p>\n<h2>Resources</h2>\n<h3>Standards</h3>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A02_2021-Cryptographic_Failures/\">Top 10 2021 Category A2 - Cryptographic Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A05_2021-Security_Misconfiguration/\">Top 10 2021 Category A5 - Security Misconfiguration</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures/\">Top 10 2021 Category A7 - Identification and\n  Authentication Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure\">Top 10 2017 Category A3 - Sensitive Data\n  Exposure</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A6_2017-Security_Misconfiguration\">Top 10 2017 Category A6 - Security\n  Misconfiguration</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/295\">CWE-295 - Improper Certificate Validation</a></li>\n  <li>STIG Viewer - <a href=\"https://stigviewer.com/stigs/application_security_and_development/2024-12-06/finding/V-222550\">Application Security and\n  Development: V-222550</a> - The application must validate certificates by constructing a certification path to an accepted trust anchor.</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S4830.json",
    "content": "{\n  \"title\": \"Server certificates should be verified during SSL\\/TLS connections\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"HIGH\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"privacy\",\n    \"ssl\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-4830\",\n  \"sqKey\": \"S4830\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      295\n    ],\n    \"OWASP\": [\n      \"A6\",\n      \"A3\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A2\",\n      \"A5\",\n      \"A7\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"4.1\",\n      \"6.5.4\",\n      \"6.5.10\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"4.2.1\",\n      \"6.2.4\"\n    ],\n    \"ASVS 4.0\": [\n      \"1.9.2\",\n      \"9.2.1\"\n    ],\n    \"STIG ASD_V5R3\": [\n      \"V-222550\"\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S5034.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><code>ValueTask&lt;TResult&gt;</code> provides a value type that wraps a <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1\">Task&lt;TResult&gt;</a> and the corresponding <code>TResult</code>.\nIt was introduced in .NET Core 2.0 <a href=\"https://devblogs.microsoft.com/dotnet/understanding-the-whys-whats-and-whens-of-valuetask\">to optimize\nmemory allocation</a> when functions return their results synchronously.</p>\n<p>Using <code>ValueTask</code> and <code>ValueTask&lt;TResult&gt;</code> in the following ways is discouraged as it could result in a race\ncondition:</p>\n<ul>\n  <li>Calling <code>await</code> multiple times on a <code>ValueTask</code>/<code>ValueTask&lt;TResult&gt;</code>. The wrapped object may have been\n  reused by another operation. This differs from <code>Task</code>/<code>Task&lt;TResult&gt;</code>, on which you can await multiple times and always\n  get the same result.</li>\n  <li>Calling <code>await</code> concurrently on a <code>ValueTask</code>/<code>ValueTask&lt;TResult&gt;</code>. The underlying object is not thread\n  safe. What’s more, it has the same effect as awaiting multiple times a <code>ValueTask</code>/<code>ValueTask&lt;TResult&gt;</code>. This again\n  differs from <code>Task</code>/<code>Task&lt;TResult&gt;</code>, which support concurrent <code>await</code>.</li>\n  <li>Using <code>.Result</code> or <code>.GetAwaiter().GetResult()</code> without checking if the operation is completed.\n  <code>IValueTaskSource</code>/<code>IValueTaskSource&lt;TResult&gt;</code> implementations are not required to block until the operation completes.\n  On the other hand, <code>Task</code>/<code>Task&lt;TResult&gt;</code> blocks the call until the task completes.</li>\n</ul>\n<p>It is recommended to use <code>ValueTask</code>/<code>ValueTask&lt;TResult&gt;</code> either by calling <code>await</code> on the function\nreturning it, optionally calling <code>ConfigureAwait(false)</code> on it, or by calling <code>.AsTask()</code> on it.</p>\n<p>This rule raises an issue when the following operations are performed on a <code>ValueTask</code>/<code>ValueTask&lt;TResult&gt;</code> instance\nunless it happens in a loop:</p>\n<ul>\n  <li>Awaiting the instance multiple times.</li>\n  <li>Calling <code>AsTask</code> multiple times.</li>\n  <li>Using <code>.Result</code> or <code>.GetAwaiter().GetResult()</code> multiple times</li>\n  <li>Using <code>.Result</code> or <code>.GetAwaiter().GetResult()</code> when the operation has not yet completed</li>\n  <li>Using of these ways to consume the instance multiple times.</li>\n</ul>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nValueTask&lt;int&gt; vt = ComputeAsync();\nint result = await vt;\nresult = await vt; // Noncompliant, variable is awaited multiple times\n\nint value = ComputeAsync()).GetAwaiter().GetResult(); // Noncompliant, uses GetAwaiter().GetResult() when it's not known to be done\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nValueTask&lt;int&gt; vt = ComputeAsync();\nint result = await vt;\n\nint value = await ComputeAsync().AsTask();\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.valuetask\">ValueTask</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.valuetask-1\">ValueTask&lt;TResult&gt;</a></li>\n  <li><a href=\"https://blogs.msdn.microsoft.com/dotnet/2018/11/07/understanding-the-whys-whats-and-whens-of-valuetask\">Understanding the Whys, Whats,\n  and Whens of ValueTask</a></li>\n</ul>\n<h3>Standards</h3>\n<ul>\n  <li>STIG Viewer - <a href=\"https://stigviewer.com/stigs/application_security_and_development/2024-12-06/finding/V-222567\">Application Security and\n  Development: V-222567</a> - The application must not be vulnerable to race conditions.</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S5034.json",
    "content": "{\n  \"title\": \"\\\"ValueTask\\\" should be consumed correctly\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"async-await\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-5034\",\n  \"sqKey\": \"S5034\",\n  \"scope\": \"All\",\n  \"securityStandards\": {\n    \"STIG ASD_V5R3\": [\n      \"V-222567\"\n    ]\n  },\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S5042.html",
    "content": "<p>Successful Zip Bomb attacks occur when an application expands untrusted archive files without controlling the size of the expanded data, which can\nlead to denial of service. A Zip bomb is usually a malicious archive file of a few kilobytes of compressed data but turned into gigabytes of\nuncompressed data. To achieve this extreme <a href=\"https://en.wikipedia.org/wiki/Data_compression_ratio\">compression ratio</a>, attackers will\ncompress irrelevant data (eg: a long string of repeated bytes).</p>\n<h2>Ask Yourself Whether</h2>\n<p>Archives to expand are untrusted and:</p>\n<ul>\n  <li>There is no validation of the number of entries in the archive.</li>\n  <li>There is no validation of the total size of the uncompressed data.</li>\n  <li>There is no validation of the ratio between the compressed and uncompressed archive entry.</li>\n</ul>\n<p>There is a risk if you answered yes to any of those questions.</p>\n<h2>Recommended Secure Coding Practices</h2>\n<ul>\n  <li>Define and control the ratio between compressed and uncompressed data, in general the data compression ratio for most of the legit archives is 1\n  to 3.</li>\n  <li>Define and control the threshold for maximum total size of the uncompressed data.</li>\n  <li>Count the number of file entries extracted from the archive and abort the extraction if their number is greater than a predefined threshold, in\n  particular it’s not recommended to recursively expand archives (an entry of an archive could be also an archive).</li>\n</ul>\n<h2>Sensitive Code Example</h2>\n<pre>\nusing var zipToOpen = new FileStream(@\"ZipBomb.zip\", FileMode.Open);\nusing var archive = new ZipArchive(zipToOpen, ZipArchiveMode.Read);\nforeach (ZipArchiveEntry entry in archive.Entries)\n{\n  entry.ExtractToFile(\"./output_onlyfortesting.txt\", true); // Sensitive\n}\n</pre>\n<h2>Compliant Solution</h2>\n<pre>\nint THRESHOLD_ENTRIES = 10000;\nint THRESHOLD_SIZE = 1000000000; // 1 GB\ndouble THRESHOLD_RATIO = 10;\nint totalSizeArchive = 0;\nint totalEntryArchive = 0;\n\nusing var zipToOpen = new FileStream(@\"ZipBomb.zip\", FileMode.Open);\nusing var archive = new ZipArchive(zipToOpen, ZipArchiveMode.Read);\nforeach (ZipArchiveEntry entry in archive.Entries)\n{\n  totalEntryArchive ++;\n\n  using (Stream st = entry.Open())\n  {\n    byte[] buffer = new byte[1024];\n    int totalSizeEntry = 0;\n    int numBytesRead = 0;\n\n    do\n    {\n      numBytesRead = st.Read(buffer, 0, 1024);\n      totalSizeEntry += numBytesRead;\n      totalSizeArchive += numBytesRead;\n      double compressionRatio = totalSizeEntry / entry.CompressedLength;\n\n      if(compressionRatio &gt; THRESHOLD_RATIO) {\n        // ratio between compressed and uncompressed data is highly suspicious, looks like a Zip Bomb Attack\n        break;\n      }\n    }\n    while (numBytesRead &gt; 0);\n  }\n\n  if(totalSizeArchive &gt; THRESHOLD_SIZE) {\n      // the uncompressed data size is too much for the application resource capacity\n      break;\n  }\n\n  if(totalEntryArchive &gt; THRESHOLD_ENTRIES) {\n      // too much entries in this archive, can lead to inodes exhaustion of the system\n      break;\n  }\n}\n</pre>\n<h2>See</h2>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A01_2021-Broken_Access_Control/\">Top 10 2021 Category A1 - Broken Access Control</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A05_2021-Security_Misconfiguration/\">Top 10 2021 Category A5 - Security Misconfiguration</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A5_2017-Broken_Access_Control\">Top 10 2017 Category A5 - Broken Access\n  Control</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A6_2017-Security_Misconfiguration\">Top 10 2017 Category A6 - Security\n  Misconfiguration</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/409\">CWE-409 - Improper Handling of Highly Compressed Data (Data Amplification)</a></li>\n  <li><a href=\"https://www.bamsoftware.com/hacks/zipbomb/\">bamsoftware.com</a> - A better Zip Bomb</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S5042.json",
    "content": "{\n  \"title\": \"Expanding archive files without controlling resource consumption is security-sensitive\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"HIGH\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-5042\",\n  \"sqKey\": \"S5042\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      409\n    ],\n    \"OWASP\": [\n      \"A5\",\n      \"A6\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A1\",\n      \"A5\"\n    ],\n    \"ASVS 4.0\": [\n      \"12.1.2\"\n    ]\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S5122.html",
    "content": "<p>Having a permissive Cross-Origin Resource Sharing policy is security-sensitive. It has led in the past to the following vulnerabilities:</p>\n<ul>\n  <li><a href=\"https://www.cve.org/CVERecord?id=CVE-2018-0269\">CVE-2018-0269</a></li>\n  <li><a href=\"https://www.cve.org/CVERecord?id=CVE-2017-14460\">CVE-2017-14460</a></li>\n</ul>\n<p><a href=\"https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy\">Same origin policy</a> in browsers prevents, by default and for\nsecurity-reasons, a javascript frontend to perform a cross-origin HTTP request to a resource that has a different origin (domain, protocol, or port)\nfrom its own. The requested target can append additional HTTP headers in response, called <a\nhref=\"https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS\">CORS</a>, that act like directives for the browser and change the access control policy\n/ relax the same origin policy.</p>\n<h2>Ask Yourself Whether</h2>\n<ul>\n  <li>You don’t trust the origin specified, example: <code>Access-Control-Allow-Origin: untrustedwebsite.com</code>.</li>\n  <li>Access control policy is entirely disabled: <code>Access-Control-Allow-Origin: *</code></li>\n  <li>Your access control policy is dynamically defined by a user-controlled input like <a\n  href=\"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin\"><code>origin</code></a> header.</li>\n</ul>\n<p>There is a risk if you answered yes to any of those questions.</p>\n<h2>Recommended Secure Coding Practices</h2>\n<ul>\n  <li>The <code>Access-Control-Allow-Origin</code> header should be set only for a trusted origin and for specific resources.</li>\n  <li>Allow only selected, trusted domains in the <code>Access-Control-Allow-Origin</code> header. Prefer whitelisting domains over blacklisting or\n  allowing any domain (do not use * wildcard nor blindly return the <code>Origin</code> header content without any checks).</li>\n</ul>\n<h2>Sensitive Code Example</h2>\n<p>ASP.NET Core MVC:</p>\n<pre>\n[HttpGet]\npublic string Get()\n{\n    Response.Headers.Add(\"Access-Control-Allow-Origin\", \"*\"); // Sensitive\n    Response.Headers.Add(HeaderNames.AccessControlAllowOrigin, \"*\"); // Sensitive\n}\n</pre>\n<pre>\npublic void ConfigureServices(IServiceCollection services)\n{\n    services.AddCors(options =&gt;\n    {\n        options.AddDefaultPolicy(builder =&gt;\n        {\n            builder.WithOrigins(\"*\"); // Sensitive\n        });\n\n        options.AddPolicy(name: \"EnableAllPolicy\", builder =&gt;\n        {\n            builder.WithOrigins(\"*\"); // Sensitive\n        });\n\n        options.AddPolicy(name: \"OtherPolicy\", builder =&gt;\n        {\n            builder.AllowAnyOrigin(); // Sensitive\n        });\n    });\n\n    services.AddControllers();\n}\n</pre>\n<p>ASP.NET MVC:</p>\n<pre>\npublic class HomeController : ApiController\n{\n    public HttpResponseMessage Get()\n    {\n        var response = HttpContext.Current.Response;\n\n        response.Headers.Add(\"Access-Control-Allow-Origin\", \"*\"); // Sensitive\n        response.Headers.Add(HeaderNames.AccessControlAllowOrigin, \"*\"); // Sensitive\n        response.AppendHeader(HeaderNames.AccessControlAllowOrigin, \"*\"); // Sensitive\n    }\n}\n</pre>\n<pre>\n[EnableCors(origins: \"*\", headers: \"*\", methods: \"GET\")] // Sensitive\npublic HttpResponseMessage Get() =&gt; new HttpResponseMessage()\n{\n    Content = new StringContent(\"content\")\n};\n</pre>\n<p>User-controlled origin:</p>\n<pre>\nString origin = Request.Headers[\"Origin\"];\nResponse.Headers.Add(\"Access-Control-Allow-Origin\", origin); // Sensitive\n</pre>\n<h2>Compliant Solution</h2>\n<p>ASP.NET Core MVC:</p>\n<pre>\n[HttpGet]\npublic string Get()\n{\n    Response.Headers.Add(\"Access-Control-Allow-Origin\", \"https://trustedwebsite.com\"); // Safe\n    Response.Headers.Add(HeaderNames.AccessControlAllowOrigin, \"https://trustedwebsite.com\"); // Safe\n}\n</pre>\n<pre>\npublic void ConfigureServices(IServiceCollection services)\n{\n    services.AddCors(options =&gt;\n    {\n        options.AddDefaultPolicy(builder =&gt;\n        {\n            builder.WithOrigins(\"https://trustedwebsite.com\", \"https://anothertrustedwebsite.com\"); // Safe\n        });\n\n        options.AddPolicy(name: \"EnableAllPolicy\", builder =&gt;\n        {\n            builder.WithOrigins(\"https://trustedwebsite.com\"); // Safe\n        });\n    });\n\n    services.AddControllers();\n}\n</pre>\n<p>ASP.Net MVC:</p>\n<pre>\npublic class HomeController : ApiController\n{\n    public HttpResponseMessage Get()\n    {\n        var response = HttpContext.Current.Response;\n\n        response.Headers.Add(\"Access-Control-Allow-Origin\", \"https://trustedwebsite.com\");\n        response.Headers.Add(HeaderNames.AccessControlAllowOrigin, \"https://trustedwebsite.com\");\n        response.AppendHeader(HeaderNames.AccessControlAllowOrigin, \"https://trustedwebsite.com\");\n    }\n}\n</pre>\n<pre>\n[EnableCors(origins: \"https://trustedwebsite.com\", headers: \"*\", methods: \"GET\")]\npublic HttpResponseMessage Get() =&gt; new HttpResponseMessage()\n{\n    Content = new StringContent(\"content\")\n};\n</pre>\n<p>User-controlled origin validated with an allow-list:</p>\n<pre>\nString origin = Request.Headers[\"Origin\"];\n\nif (trustedOrigins.Contains(origin))\n{\n    Response.Headers.Add(\"Access-Control-Allow-Origin\", origin);\n}\n</pre>\n<h2>See</h2>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A05_2021-Security_Misconfiguration/\">Top 10 2021 Category A5 - Security Misconfiguration</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures/\">Top 10 2021 Category A7 - Identification and\n  Authentication Failures</a></li>\n  <li><a href=\"https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS\">developer.mozilla.org</a> - CORS</li>\n  <li><a href=\"https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy\">developer.mozilla.org</a> - Same origin policy</li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A6_2017-Security_Misconfiguration\">Top 10 2017 Category A6 - Security\n  Misconfiguration</a></li>\n  <li><a href=\"https://cheatsheetseries.owasp.org/cheatsheets/HTML5_Security_Cheat_Sheet.html#cross-origin-resource-sharing\">OWASP HTML5 Security\n  Cheat Sheet</a> - Cross Origin Resource Sharing</li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/346\">CWE-346 - Origin Validation Error</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/942\">CWE-942 - Overly Permissive Cross-domain Whitelist</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S5122.json",
    "content": "{\n  \"title\": \"Having a permissive Cross-Origin Resource Sharing policy is security-sensitive\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"LOW\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-5122\",\n  \"sqKey\": \"S5122\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      346,\n      942\n    ],\n    \"OWASP\": [\n      \"A6\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A5\",\n      \"A7\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"6.5.8\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"6.2.4\"\n    ],\n    \"ASVS 4.0\": [\n      \"14.5.2\",\n      \"14.5.3\"\n    ]\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S5332.html",
    "content": "<p>Clear-text protocols such as <code>ftp</code>, <code>telnet</code>, or <code>http</code> lack encryption of transported data, as well as the\ncapability to build an authenticated connection. It means that an attacker able to sniff traffic from the network can read, modify, or corrupt the\ntransported content. These protocols are not secure as they expose applications to an extensive range of risks:</p>\n<ul>\n  <li>sensitive data exposure</li>\n  <li>traffic redirected to a malicious endpoint</li>\n  <li>malware-infected software update or installer</li>\n  <li>execution of client-side code</li>\n  <li>corruption of critical information</li>\n</ul>\n<p>Even in the context of isolated networks like offline environments or segmented cloud environments, the insider threat exists. Thus, attacks\ninvolving communications being sniffed or tampered with can still happen.</p>\n<p>For example, attackers could successfully compromise prior security layers by:</p>\n<ul>\n  <li>bypassing isolation mechanisms</li>\n  <li>compromising a component of the network</li>\n  <li>getting the credentials of an internal IAM account (either from a service account or an actual person)</li>\n</ul>\n<p>In such cases, encrypting communications would decrease the chances of attackers to successfully leak data or steal credentials from other network\ncomponents. By layering various security practices (segmentation and encryption, for example), the application will follow the\n<em>defense-in-depth</em> principle.</p>\n<p>Note that using the <code>http</code> protocol is being deprecated by <a\nhref=\"https://blog.mozilla.org/security/2015/04/30/deprecating-non-secure-http\">major web browsers</a>.</p>\n<p>In the past, it has led to the following vulnerabilities:</p>\n<ul>\n  <li><a href=\"https://nvd.nist.gov/vuln/detail/CVE-2019-6169\">CVE-2019-6169</a></li>\n  <li><a href=\"https://nvd.nist.gov/vuln/detail/CVE-2019-12327\">CVE-2019-12327</a></li>\n  <li><a href=\"https://nvd.nist.gov/vuln/detail/CVE-2019-11065\">CVE-2019-11065</a></li>\n</ul>\n<h2>Ask Yourself Whether</h2>\n<ul>\n  <li>Application data needs to be protected against falsifications or leaks when transiting over the network.</li>\n  <li>Application data transits over an untrusted network.</li>\n  <li>Compliance rules require the service to encrypt data in transit.</li>\n  <li>Your application renders web pages with a relaxed mixed content policy.</li>\n  <li>OS-level protections against clear-text traffic are deactivated.</li>\n</ul>\n<p>There is a risk if you answered yes to any of those questions.</p>\n<h2>Recommended Secure Coding Practices</h2>\n<ul>\n  <li>Make application data transit over a secure, authenticated and encrypted protocol like TLS or SSH. Here are a few alternatives to the most\n  common clear-text protocols:\n    <ul>\n      <li>Use <code>ssh</code> as an alternative to <code>telnet</code>.</li>\n      <li>Use <code>sftp</code>, <code>scp</code>, or <code>ftps</code> instead of <code>ftp</code>.</li>\n      <li>Use <code>https</code> instead of <code>http</code>.</li>\n      <li>Use <code>SMTP</code> over <code>SSL/TLS</code> or <code>SMTP</code> with <code>STARTTLS</code> instead of clear-text SMTP.</li>\n    </ul></li>\n  <li>Enable encryption of cloud components communications whenever it is possible.</li>\n  <li>Configure your application to block mixed content when rendering web pages.</li>\n  <li>If available, enforce OS-level deactivation of all clear-text traffic.</li>\n</ul>\n<p>It is recommended to secure all transport channels, even on local networks, as it can take a single non-secure connection to compromise an entire\napplication or system.</p>\n<h2>Sensitive Code Example</h2>\n<pre>\nvar urlHttp = \"http://example.com\";                 // Noncompliant\nvar urlFtp = \"ftp://anonymous@example.com\";         // Noncompliant\nvar urlTelnet = \"telnet://anonymous@example.com\";   // Noncompliant\n</pre>\n<pre>\nusing var smtp = new SmtpClient(\"host\", 25); // Noncompliant, EnableSsl is not set\nusing var telnet = new MyTelnet.Client(\"host\", port); // Noncompliant, rule raises Security Hotspot on any member containing \"Telnet\"\n</pre>\n<h2>Compliant Solution</h2>\n<pre>\nvar urlHttps = \"https://example.com\";\nvar urlSftp = \"sftp://anonymous@example.com\";\nvar urlSsh = \"ssh://anonymous@example.com\";\n</pre>\n<pre>\nusing var smtp = new SmtpClient(\"host\", 25) { EnableSsl = true };\nusing var ssh = new MySsh.Client(\"host\", port);\n</pre>\n<h2>Exceptions</h2>\n<p>No issue is reported for the following cases because they are not considered sensitive:</p>\n<ul>\n  <li>Insecure protocol scheme followed by loopback addresses like 127.0.0.1 or <code>localhost</code>.</li>\n</ul>\n<h2>See</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>AWS Documentation - <a href=\"https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html\">Listeners for\n  your Application Load Balancers</a></li>\n  <li>AWS Documentation - <a\n  href=\"https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kinesis-stream-streamencryption.html\">Stream Encryption</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li>Google - <a href=\"https://security.googleblog.com/2016/09/moving-towards-more-secure-web.html\">Moving towards more secure web</a></li>\n  <li>Mozilla - <a href=\"https://blog.mozilla.org/security/2015/04/30/deprecating-non-secure-http/\">Deprecating non secure http</a></li>\n</ul>\n<h3>Standards</h3>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure\">Top 10 2017 Category A3 - Sensitive Data\n  Exposure</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A02_2021-Cryptographic_Failures/\">Top 10 2021 Category A2 - Cryptographic Failures</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/200\">CWE-200 - Exposure of Sensitive Information to an Unauthorized Actor</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/319\">CWE-319 - Cleartext Transmission of Sensitive Information</a></li>\n  <li>STIG Viewer - <a href=\"https://stigviewer.com/stigs/application_security_and_development/2024-12-06/finding/V-222397\">Application Security and\n  Development: V-222397</a> - The application must implement cryptographic mechanisms to protect the integrity of remote access sessions.</li>\n  <li>STIG Viewer - <a href=\"https://stigviewer.com/stigs/application_security_and_development/2024-12-06/finding/V-222534\">Application Security and\n  Development: V-222534</a> - Service-Oriented Applications handling non-releasable data must authenticate endpoint devices via mutual SSL/TLS.</li>\n  <li>STIG Viewer - <a href=\"https://stigviewer.com/stigs/application_security_and_development/2024-12-06/finding/V-222562\">Application Security and\n  Development: V-222562</a> - Applications used for non-local maintenance must implement cryptographic mechanisms to protect the integrity of\n  maintenance and diagnostic communications.</li>\n  <li>STIG Viewer - <a href=\"https://stigviewer.com/stigs/application_security_and_development/2024-12-06/finding/V-222563\">Application Security and\n  Development: V-222563</a> - Applications used for non-local maintenance must implement cryptographic mechanisms to protect the confidentiality of\n  maintenance and diagnostic communications.</li>\n  <li>STIG Viewer - <a href=\"https://stigviewer.com/stigs/application_security_and_development/2024-12-06/finding/V-222577\">Application Security and\n  Development: V-222577</a> - The application must not expose session IDs.</li>\n  <li>STIG Viewer - <a href=\"https://stigviewer.com/stigs/application_security_and_development/2024-12-06/finding/V-222596\">Application Security and\n  Development: V-222596</a> - The application must protect the confidentiality and integrity of transmitted information.</li>\n  <li>STIG Viewer - <a href=\"https://stigviewer.com/stigs/application_security_and_development/2024-12-06/finding/V-222597\">Application Security and\n  Development: V-222597</a> - The application must implement cryptographic mechanisms to prevent unauthorized disclosure of information and/or detect\n  changes to information during transmission.</li>\n  <li>STIG Viewer - <a href=\"https://stigviewer.com/stigs/application_security_and_development/2024-12-06/finding/V-222598\">Application Security and\n  Development: V-222598</a> - The application must maintain the confidentiality and integrity of information during preparation for transmission.</li>\n  <li>STIG Viewer - <a href=\"https://stigviewer.com/stigs/application_security_and_development/2024-12-06/finding/V-222599\">Application Security and\n  Development: V-222599</a> - The application must maintain the confidentiality and integrity of information during reception.</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S5332.json",
    "content": "{\n  \"title\": \"Using clear-text protocols is security-sensitive\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"HIGH\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-5332\",\n  \"sqKey\": \"S5332\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      200,\n      319\n    ],\n    \"OWASP\": [\n      \"A3\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A2\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"4.1\",\n      \"6.5.4\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"4.2.1\",\n      \"6.2.4\"\n    ],\n    \"ASVS 4.0\": [\n      \"1.9.1\",\n      \"9.1.1\",\n      \"9.2.2\"\n    ],\n    \"STIG ASD_V5R3\": [\n      \"V-222397\",\n      \"V-222534\",\n      \"V-222562\",\n      \"V-222563\",\n      \"V-222577\",\n      \"V-222596\",\n      \"V-222597\",\n      \"V-222598\",\n      \"V-222599\"\n    ]\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S5344.html",
    "content": "<p>The improper storage of passwords poses a significant security risk to software applications. This vulnerability arises when passwords are stored\nin plaintext or with a fast hashing algorithm. To exploit this vulnerability, an attacker typically requires access to the stored passwords.</p>\n<h2>Why is this an issue?</h2>\n<p>Attackers who would get access to the stored passwords could reuse them without further attacks or with little additional effort.\n  <br>\n  Obtaining the plaintext passwords, they could then gain unauthorized access to user accounts, potentially leading to various malicious\n  activities.</p>\n<h3>What is the potential impact?</h3>\n<p>Plaintext or weakly hashed password storage poses a significant security risk to software applications.</p>\n<h4>Unauthorized Access</h4>\n<p>When passwords are stored in plaintext or with weak hashing algorithms, an attacker who gains access to the password database can easily retrieve\nand use the passwords to gain unauthorized access to user accounts. This can lead to various malicious activities, such as unauthorized data access,\nidentity theft, or even financial fraud.</p>\n<h4>Credential Reuse</h4>\n<p>Many users tend to reuse passwords across multiple platforms. If an attacker obtains plaintext or weakly hashed passwords, they can potentially use\nthese credentials to gain unauthorized access to other accounts held by the same user. This can have far-reaching consequences, as sensitive personal\ninformation or critical systems may be compromised.</p>\n<h4>Regulatory Compliance</h4>\n<p>Many industries and jurisdictions have specific regulations and standards to protect user data and ensure its confidentiality. Storing passwords in\nplaintext or with weak hashing algorithms can lead to non-compliance with these regulations, potentially resulting in legal consequences, financial\npenalties, and damage to the reputation of the software application and its developers.</p>\n<h2>How to fix it in ASP.NET Core</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<p>Using <code>Microsoft.AspNetCore.Cryptography.KeyDerivation</code>:</p>\n<pre data-diff-id=\"101\" data-diff-type=\"noncompliant\">\nusing Microsoft.AspNetCore.Cryptography.KeyDerivation;\nusing System.Security.Cryptography;\n\nstring password = Request.Query[\"password\"];\nbyte[] salt = RandomNumberGenerator.GetBytes(128 / 8);\n\nstring hashed = Convert.ToBase64String(KeyDerivation.Pbkdf2(\n    password: password!,\n    salt: salt,\n    prf: KeyDerivationPrf.HMACSHA256,\n    iterationCount: 1, // Noncompliant\n    numBytesRequested: 256 / 8));\n</pre>\n<p>Using <code>System.Security.Cryptography</code>:</p>\n<pre data-diff-id=\"102\" data-diff-type=\"noncompliant\">\nusing System.Security.Cryptography;\n\nstring password = Request.Query[\"password\"];\nbyte[] salt = RandomNumberGenerator.GetBytes(128 / 8);\nRfc2898DeriveBytes kdf = new Rfc2898DeriveBytes(password, 128/8); // Noncompliant\nstring hashed = Convert.ToBase64String(kdf.GetBytes(256 / 8));\n</pre>\n<p>Using <code>Microsoft.AspNetCore.Identity</code>:</p>\n<pre data-diff-id=\"103\" data-diff-type=\"noncompliant\">\nusing Microsoft.AspNetCore.Identity;\nusing Microsoft.Extensions.Options;\n\nstring password = Request.Query[\"password\"];\nIOptions&lt;PasswordHasherOptions&gt; options = Options.Create(new PasswordHasherOptions() {\n    IterationCount = 1 // Noncompliant\n});\nPasswordHasher&lt;User&gt; hasher = new PasswordHasher&lt;User&gt;(options);\nstring hash = hasher.HashPassword(new User(\"test\"), password);\n</pre>\n<h4>Compliant solution</h4>\n<p>Using <code>Microsoft.AspNetCore.Cryptography.KeyDerivation</code>:</p>\n<pre data-diff-id=\"101\" data-diff-type=\"compliant\">\nusing Microsoft.AspNetCore.Cryptography.KeyDerivation;\nusing System.Security.Cryptography;\n\nstring password = Request.Query[\"password\"];\nbyte[] salt = RandomNumberGenerator.GetBytes(128 / 8);\n\nstring hashed = Convert.ToBase64String(KeyDerivation.Pbkdf2(\n    password: password!,\n    salt: salt,\n    prf: KeyDerivationPrf.HMACSHA256,\n    iterationCount: 100_000,\n    numBytesRequested: 256 / 8));\n</pre>\n<p>Using <code>System.Security.Cryptography</code></p>\n<pre data-diff-id=\"102\" data-diff-type=\"compliant\">\nusing System.Security.Cryptography;\n\nstring password = Request.Query[\"password\"];\nbyte[] salt = RandomNumberGenerator.GetBytes(128 / 8);\nRfc2898DeriveBytes kdf = new Rfc2898DeriveBytes(password, salt, 100_000, HashAlgorithmName.SHA256);\nstring hashed = Convert.ToBase64String(kdf.GetBytes(256 / 8));\n</pre>\n<p>Using <code>Microsoft.AspNetCore.Identity</code>:</p>\n<pre data-diff-id=\"103\" data-diff-type=\"compliant\">\nusing Microsoft.AspNetCore.Identity;\nusing Microsoft.Extensions.Options;\n\nstring password = Request.Query[\"password\"];\nPasswordHasher&lt;User&gt; hasher = new PasswordHasher&lt;User&gt;();\nstring hash = hasher.HashPassword(new User(\"test\"), password);\n</pre>\n<h3>How does this work?</h3>\n<h4>Select the correct PBKDF2 parameters</h4>\n<p>If PBKDF2 must be used, be aware that default values might not be considered secure.\n  <br>\n  Depending on the algorithm used, the number of iterations should be adjusted to ensure that the derived key is secure. The following are the\n  recommended number of iterations for PBKDF2:</p>\n<ul>\n  <li>PBKDF2-HMAC-SHA1: 1,300,000 iterations</li>\n  <li>PBKDF2-HMAC-SHA256: 600,000 iterations</li>\n  <li>PBKDF2-HMAC-SHA512: 210,000 iterations</li>\n</ul>\n<p>Note that PBKDF2-HMAC-SHA256 is recommended by NIST.\n  <br>\n  Iterations are also called \"rounds\" depending on the library used.</p>\n<p>When recommended cost factors are too high in the context of the application or if the performance cost is unacceptable, a cost factor reduction\nmight be considered. In that case, it should not be chosen under 100,000.</p>\n<h3>Going the extra mile</h3>\n<h4>Pepper</h4>\n<p>In a defense-in-depth security approach, <strong>peppering</strong> can also be used. This is a security technique where an external secret value\nis added to a password before it is hashed.\n  <br>\n  This makes it more difficult for an attacker to crack the hashed passwords, as they would need to know the secret value to generate the correct\n  hash.\n  <br>\n  <a href=\"https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html#peppering\">Learn more here</a>.</p>\n<h2>How to fix it in ASP.NET</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"201\" data-diff-type=\"noncompliant\">\nusing System.Security.Cryptography;\n\nRNGCryptoServiceProvider rngCsp = new RNGCryptoServiceProvider();\nbyte[] salt = new byte[32];\nrngCsp.GetBytes(salt);\nRfc2898DeriveBytes kdf = new Rfc2898DeriveBytes(password, salt, 100, HashAlgorithmName.SHA256); // Noncompliant\nstring hashed = Convert.ToBase64String(kdf.GetBytes(256 / 8));\n</pre>\n<p>Using <code>using Microsoft.AspNet.Identity</code>:</p>\n<pre>\nusing Microsoft.AspNet.Identity;\n\nstring password = \"NotSoSecure\";\nPasswordHasher hasher = new PasswordHasher();\nstring hash = hasher.HashPassword(password); // Noncompliant\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"201\" data-diff-type=\"compliant\">\nusing System.Security.Cryptography;\n\nRNGCryptoServiceProvider rngCsp = new RNGCryptoServiceProvider();\nbyte[] salt = new byte[32];\nrngCsp.GetBytes(salt);\nRfc2898DeriveBytes kdf = new Rfc2898DeriveBytes(password, salt, 100_000, HashAlgorithmName.SHA256); // Compliant\nstring hashed = Convert.ToBase64String(kdf.GetBytes(256 / 8));\n</pre>\n<h3>How does this work?</h3>\n<h4>Select the correct PBKDF2 parameters</h4>\n<p>If PBKDF2 must be used, be aware that default values might not be considered secure.\n  <br>\n  Depending on the algorithm used, the number of iterations should be adjusted to ensure that the derived key is secure. The following are the\n  recommended number of iterations for PBKDF2:</p>\n<ul>\n  <li>PBKDF2-HMAC-SHA1: 1,300,000 iterations</li>\n  <li>PBKDF2-HMAC-SHA256: 600,000 iterations</li>\n  <li>PBKDF2-HMAC-SHA512: 210,000 iterations</li>\n</ul>\n<p>Note that PBKDF2-HMAC-SHA256 is recommended by NIST.\n  <br>\n  Iterations are also called \"rounds\" depending on the library used.</p>\n<p>When recommended cost factors are too high in the context of the application or if the performance cost is unacceptable, a cost factor reduction\nmight be considered. In that case, it should not be chosen under 100,000.</p>\n<h3>Going the extra mile</h3>\n<h4>Pepper</h4>\n<p>In a defense-in-depth security approach, <strong>peppering</strong> can also be used. This is a security technique where an external secret value\nis added to a password before it is hashed.\n  <br>\n  This makes it more difficult for an attacker to crack the hashed passwords, as they would need to know the secret value to generate the correct\n  hash.\n  <br>\n  <a href=\"https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html#peppering\">Learn more here</a>.</p>\n<h2>How to fix it in BouncyCastle</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<p>Using SCrypt:</p>\n<pre data-diff-id=\"301\" data-diff-type=\"noncompliant\">\nusing Org.BouncyCastle.Crypto.Generators;\n\nstring password = Request.Query[\"password\"];\nbyte[] salt = RandomNumberGenerator.GetBytes(128 / 8); // divide by 8 to convert bits to bytes\n\nstring hashed = Convert.ToBase64String(SCrypt.Generate(Encoding.Unicode.GetBytes(password), salt, 4, 2, 1, 32));  // Noncompliant\n</pre>\n<p>Using BCrypt:</p>\n<pre data-diff-id=\"302\" data-diff-type=\"noncompliant\">\nusing Org.BouncyCastle.Crypto.Generators;\nusing Org.BouncyCastle.Crypto.Parameters;\n\nstring password = Request.Query[\"password\"];\nbyte[] salt = RandomNumberGenerator.GetBytes(128 / 8);\n\nstring hashed = OpenBsdBCrypt.Generate(password.ToCharArray(), salt, 4); // Noncompliant\n</pre>\n<p>Using PBKDF2:</p>\n<pre data-diff-id=\"303\" data-diff-type=\"noncompliant\">\nusing Org.BouncyCastle.Crypto.Generators;\nusing Org.BouncyCastle.Crypto.Parameters;\nusing System.Security.Cryptography;\n\nstring password = Request.Query[\"password\"];\nbyte[] salt = RandomNumberGenerator.GetBytes(128 / 8);\nPkcs5S2ParametersGenerator gen = new Pkcs5S2ParametersGenerator();\ngen.Init(Encoding.Unicode.GetBytes(password), salt, 100);  // Noncompliant\nKeyParameter keyParam = (KeyParameter) gen.GenerateDerivedMacParameters(256);\nstring hashed = Convert.ToBase64String(keyParam.GetKey());\n</pre>\n<h4>Compliant solution</h4>\n<p>Using SCrypt:</p>\n<pre data-diff-id=\"301\" data-diff-type=\"compliant\">\nusing Org.BouncyCastle.Crypto.Generators;\n\nstring password = Request.Query[\"password\"];\nbyte[] salt = RandomNumberGenerator.GetBytes(128 / 8); // divide by 8 to convert bits to bytes\n\nstring hashed = Convert.ToBase64String(SCrypt.Generate(Encoding.Unicode.GetBytes(password), salt, 1&lt;&lt;12, 8, 1, 32));  // Noncompliant\n</pre>\n<p>Using BCrypt:</p>\n<pre data-diff-id=\"302\" data-diff-type=\"compliant\">\nusing Org.BouncyCastle.Crypto.Generators;\nusing Org.BouncyCastle.Crypto.Parameters;\n\nstring password = Request.Query[\"password\"];\nbyte[] salt = RandomNumberGenerator.GetBytes(128 / 8);\n\nstring hashed = OpenBsdBCrypt.Generate(password.ToCharArray(), salt, 14); // Noncompliant\n</pre>\n<p>Using PBKDF2:</p>\n<pre data-diff-id=\"303\" data-diff-type=\"compliant\">\nusing Org.BouncyCastle.Crypto.Generators;\nusing Org.BouncyCastle.Crypto.Parameters;\nusing System.Security.Cryptography;\n\nstring password = Request.Query[\"password\"];\nbyte[] salt = RandomNumberGenerator.GetBytes(128 / 8);\nPkcs5S2ParametersGenerator gen = new Pkcs5S2ParametersGenerator();\ngen.Init(Encoding.Unicode.GetBytes(password), salt, 100_000);  // Noncompliant\nKeyParameter keyParam = (KeyParameter) gen.GenerateDerivedMacParameters(256);\nstring hashed = Convert.ToBase64String(keyParam.GetKey());\n</pre>\n<h3>How does this work?</h3>\n<h4>Select the correct Bcrypt parameters</h4>\n<p>When bcrypt’s hashing function is used, it is important to select a round count that is high enough to make the function slow enough to prevent\nbrute force: More than 12 rounds.</p>\n<p>For bcrypt’s key derivation function, the number of rounds should likewise be high enough to make the function slow enough to prevent brute force:\nMore than 4096 rounds <code>(2^12)</code>.\n  <br>\n  This number is not the same coefficient as the first one because it uses a different algorithm.</p>\n<h4>Select the correct Scrypt parameters</h4>\n<p>If scrypt must be used, the default values of scrypt are considered secure.</p>\n<p>Like Argon2id, scrypt has three different parameters that can be configured. N is the CPU/memory cost parameter and must be a power of two. r is\nthe block size and p is the parallelization factor.</p>\n<p>All three parameters affect the memory and CPU usage of the algorithm. Higher values of N, r and p result in safer hashes, but come at the cost of\nhigher resource usage.</p>\n<p>For scrypt, OWASP recommends to have a hash length of at least 64 bytes, and to set N, p and r to the values of one of the following rows:</p>\n<table>\n  <colgroup>\n    <col style=\"width: 33.3333%;\">\n    <col style=\"width: 33.3333%;\">\n    <col style=\"width: 33.3334%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>N (cost parameter)</th>\n      <th>p (parallelization factor)</th>\n      <th>r (block size)</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p>2<sup>17</sup> (<code>1 &lt;&lt; 17</code>)</p>\n      </td>\n      <td>\n        <p>1</p>\n      </td>\n      <td>\n        <p>8</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>2<sup>16</sup> (<code>1 &lt;&lt; 16</code>)</p>\n      </td>\n      <td>\n        <p>2</p>\n      </td>\n      <td>\n        <p>8</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>2<sup>15</sup> (<code>1 &lt;&lt; 15</code>)</p>\n      </td>\n      <td>\n        <p>3</p>\n      </td>\n      <td>\n        <p>8</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>2<sup>14</sup> (<code>1 &lt;&lt; 14</code>)</p>\n      </td>\n      <td>\n        <p>5</p>\n      </td>\n      <td>\n        <p>8</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>2<sup>13</sup> (<code>1 &lt;&lt; 13</code>)</p>\n      </td>\n      <td>\n        <p>10</p>\n      </td>\n      <td>\n        <p>8</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<p>Every row provides the same level of defense. They only differ in the amount of CPU and RAM used: the top row has low CPU usage and high memory\nusage, while the bottom row has high CPU usage and low memory usage.</p>\n<h4>Select the correct PBKDF2 parameters</h4>\n<p>If PBKDF2 must be used, be aware that default values might not be considered secure.\n  <br>\n  Depending on the algorithm used, the number of iterations should be adjusted to ensure that the derived key is secure. The following are the\n  recommended number of iterations for PBKDF2:</p>\n<ul>\n  <li>PBKDF2-HMAC-SHA1: 1,300,000 iterations</li>\n  <li>PBKDF2-HMAC-SHA256: 600,000 iterations</li>\n  <li>PBKDF2-HMAC-SHA512: 210,000 iterations</li>\n</ul>\n<p>Note that PBKDF2-HMAC-SHA256 is recommended by NIST.\n  <br>\n  Iterations are also called \"rounds\" depending on the library used.</p>\n<p>When recommended cost factors are too high in the context of the application or if the performance cost is unacceptable, a cost factor reduction\nmight be considered. In that case, it should not be chosen under 100,000.</p>\n<h3>Going the extra mile</h3>\n<h4>Pepper</h4>\n<p>In a defense-in-depth security approach, <strong>peppering</strong> can also be used. This is a security technique where an external secret value\nis added to a password before it is hashed.\n  <br>\n  This makes it more difficult for an attacker to crack the hashed passwords, as they would need to know the secret value to generate the correct\n  hash.\n  <br>\n  <a href=\"https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html#peppering\">Learn more here</a>.</p>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>OWASP CheatSheet - <a href=\"https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html\">Password Storage Cheat\n  Sheet</a></li>\n</ul>\n<h3>Standards</h3>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A02_2021-Cryptographic_Failures/\">Top 10 2021 Category A2 - Cryptographic Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A04_2021-Insecure_Design/\">Top 10 2021 Category A4 - Insecure Design</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure\">Top 10 2017 Category A3 - Sensitive Data\n  Exposure</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/256\">CWE-256 - Plaintext Storage of a Password</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/916\">CWE-916 - Use of Password Hash With Insufficient Computational Effort</a></li>\n  <li>STIG Viewer - <a href=\"https://stigviewer.com/stigs/application_security_and_development/2024-12-06/finding/V-222542\">Application Security and\n  Development: V-222542</a> - The application must only store cryptographic representations of passwords.</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S5344.json",
    "content": "{\n  \"title\": \"Passwords should not be stored in plaintext or with a fast hashing algorithm\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"HIGH\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"spring\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-5344\",\n  \"sqKey\": \"S5344\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      256,\n      916\n    ],\n    \"OWASP\": [\n      \"A3\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A2\",\n      \"A4\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"6.5.3\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"6.2.4\"\n    ],\n    \"ASVS 4.0\": [\n      \"2.10.3\",\n      \"2.4.1\",\n      \"2.4.2\",\n      \"2.4.3\",\n      \"2.4.4\",\n      \"2.4.5\"\n    ],\n    \"STIG ASD_V5R3\": [\n      \"V-222542\"\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S5443.html",
    "content": "<p>Operating systems have global directories where any user has write access. Those folders are mostly used as temporary storage areas like\n<code>/tmp</code> in Linux based systems. An application manipulating files from these folders is exposed to race conditions on filenames: a malicious\nuser can try to create a file with a predictable name before the application does. A successful attack can result in other files being accessed,\nmodified, corrupted or deleted. This risk is even higher if the application runs with elevated permissions.</p>\n<p>In the past, it has led to the following vulnerabilities:</p>\n<ul>\n  <li><a href=\"https://nvd.nist.gov/vuln/detail/CVE-2012-2451\">CVE-2012-2451</a></li>\n  <li><a href=\"https://nvd.nist.gov/vuln/detail/CVE-2015-1838\">CVE-2015-1838</a></li>\n</ul>\n<p>This rule raises an issue whenever it detects a hard-coded path to a publicly writable directory like <code>/tmp</code> (see examples bellow). It\nalso detects access to environment variables that point to publicly writable directories, e.g., <code>TMP</code>, <code>TMPDIR</code> and\n<code>TEMP</code>.</p>\n<ul>\n  <li><code>/tmp</code></li>\n  <li><code>/var/tmp</code></li>\n  <li><code>/usr/tmp</code></li>\n  <li><code>/dev/shm</code></li>\n  <li><code>/dev/mqueue</code></li>\n  <li><code>/run/lock</code></li>\n  <li><code>/var/run/lock</code></li>\n  <li><code>/Library/Caches</code></li>\n  <li><code>/Users/Shared</code></li>\n  <li><code>/private/tmp</code></li>\n  <li><code>/private/var/tmp</code></li>\n  <li><code>\\Windows\\Temp</code></li>\n  <li><code>\\Temp</code></li>\n  <li><code>\\TMP</code></li>\n  <li><code>%USERPROFILE%\\AppData\\Local\\Temp</code></li>\n</ul>\n<h2>Ask Yourself Whether</h2>\n<ul>\n  <li>Files are read from or written into a publicly writable folder</li>\n  <li>The application creates files with predictable names into a publicly writable folder</li>\n</ul>\n<p>There is a risk if you answered yes to any of those questions.</p>\n<h2>Recommended Secure Coding Practices</h2>\n<p>Out of the box, .NET is missing secure-by-design APIs to create temporary files. To overcome this, one of the following options can be used:</p>\n<ul>\n  <li>Use a dedicated sub-folder with tightly controlled permissions</li>\n  <li>Created temporary files in a publicly writable folder and make sure:\n    <ul>\n      <li>Generated filename is unpredictable</li>\n      <li>File is readable and writable only by the creating user ID</li>\n      <li>File descriptor is not inherited by child processes</li>\n      <li>File is destroyed as soon as it is closed</li>\n    </ul></li>\n</ul>\n<h2>Sensitive Code Example</h2>\n<pre>\nusing var writer = new StreamWriter(\"/tmp/f\"); // Sensitive\n</pre>\n<pre>\nvar tmp = Environment.GetEnvironmentVariable(\"TMP\"); // Sensitive\n</pre>\n<h2>Compliant Solution</h2>\n<pre>\nvar randomPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());\n\n// Creates a new file with write, non inheritable permissions which is deleted on close.\nusing var fileStream = new FileStream(randomPath, FileMode.CreateNew, FileAccess.Write, FileShare.None, 4096, FileOptions.DeleteOnClose);\nusing var writer = new StreamWriter(fileStream);\n</pre>\n<h2>See</h2>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A01_2021-Broken_Access_Control/\">Top 10 2021 Category A1 - Broken Access Control</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A5_2017-Broken_Access_Control\">Top 10 2017 Category A5 - Broken Access\n  Control</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure\">Top 10 2017 Category A3 - Sensitive Data\n  Exposure</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/377\">CWE-377 - Insecure Temporary File</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/379\">CWE-379 - Creation of Temporary File in Directory with Incorrect Permissions</a></li>\n  <li><a href=\"https://owasp.org/www-community/vulnerabilities/Insecure_Temporary_File\">OWASP, Insecure Temporary File</a></li>\n  <li>STIG Viewer - <a href=\"https://stigviewer.com/stigs/application_security_and_development/2024-12-06/finding/V-222567\">Application Security and\n  Development: V-222567</a> - The application must not be vulnerable to race conditions.</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S5443.json",
    "content": "{\n  \"title\": \"Using publicly writable directories is security-sensitive\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"HIGH\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-5443\",\n  \"sqKey\": \"S5443\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      377,\n      379\n    ],\n    \"OWASP\": [\n      \"A5\",\n      \"A3\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A1\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"6.5.8\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"6.2.4\"\n    ],\n    \"STIG ASD_V5R3\": [\n      \"V-222567\"\n    ]\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S5445.html",
    "content": "<p>Temporary files are considered insecurely created when the file existence check is performed separately from the actual file creation. Such a\nsituation can occur when creating temporary files using normal file handling functions or when using dedicated temporary file handling functions that\nare not atomic.</p>\n<h2>Why is this an issue?</h2>\n<p>Creating temporary files in a non-atomic way introduces race condition issues in the application’s behavior. Indeed, a third party can create a\ngiven file between when the application chooses its name and when it creates it.</p>\n<p>In such a situation, the application might use a temporary file that it does not entirely control. In particular, this file’s permissions might be\ndifferent than expected. This can lead to trust boundary issues.</p>\n<h3>What is the potential impact?</h3>\n<p>Attackers with control over a temporary file used by a vulnerable application will be able to modify it in a way that will affect the application’s\nlogic. By changing this file’s Access Control List or other operating system-level properties, they could prevent the file from being deleted or\nemptied. They may also alter the file’s content before or while the application uses it.</p>\n<p>Depending on why and how the affected temporary files are used, the exploitation of a race condition in an application can have various\nconsequences. They can range from sensitive information disclosure to more serious application or hosting infrastructure compromise.</p>\n<h4>Information disclosure</h4>\n<p>Because attackers can control the permissions set on temporary files and prevent their removal, they can read what the application stores in them.\nThis might be especially critical if this information is sensitive.</p>\n<p>For example, an application might use temporary files to store users' session-related information. In such a case, attackers controlling those\nfiles can access session-stored information. This might allow them to take over authenticated users' identities and entitlements.</p>\n<h4>Attack surface extension</h4>\n<p>An application might use temporary files to store technical data for further reuse or as a communication channel between multiple components. In\nthat case, it might consider those files part of the trust boundaries and use their content without additional security validation or sanitation. In\nsuch a case, an attacker controlling the file content might use it as an attack vector for further compromise.</p>\n<p>For example, an application might store serialized data in temporary files for later use. In such a case, attackers controlling those files'\ncontent can change it in a way that will lead to an insecure deserialization exploitation. It might allow them to execute arbitrary code on the\napplication hosting server and take it over.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<p>The following code example is vulnerable to a race condition attack because it creates a temporary file using an unsafe API function.</p>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nusing System.IO;\n\npublic void Example()\n{\n    var tempPath = Path.GetTempFileName();  // Noncompliant\n\n    using (var writer = new StreamWriter(tempPath))\n    {\n        writer.WriteLine(\"content\");\n    }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nusing System.IO;\n\npublic void Example()\n{\n    var randomPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());\n\n    using (var fileStream = new FileStream(randomPath, FileMode.CreateNew, FileAccess.Write, FileShare.None, 4096, FileOptions.DeleteOnClose))\n    using (var writer = new StreamWriter(fileStream))\n    {\n        writer.WriteLine(\"content\");\n    }\n}\n</pre>\n<h3>How does this work?</h3>\n<p>Applications should create temporary files so that no third party can read or modify their content. It requires that the files' name, location, and\npermissions are carefully chosen and set. This can be achieved in multiple ways depending on the applications' technology stacks.</p>\n<h4>Strong security controls</h4>\n<p>Temporary files can be created using unsafe functions and API as long as strong security controls are applied. Non-temporary file-handling\nfunctions and APIs can also be used for that purpose.</p>\n<p>In general, applications should ensure that attackers can not create a file before them. This turns into the following requirements when creating\nthe files:</p>\n<ul>\n  <li>Files should be created in a non-public directory.</li>\n  <li>File names should be unique.</li>\n  <li>File names should be unpredictable. They should be generated using a cryptographically secure random generator.</li>\n  <li>File creation should fail if a target file already exists.</li>\n</ul>\n<p>Moreover, when possible, it is recommended that applications destroy temporary files after they have finished using them.</p>\n<p>Here the example compliant code uses the <code>Path.GetTempPath</code> and <code>Path.GetRandomFileName</code> functions to generate a unique\nrandom file name. The file is then open with the <code>FileMode.CreateNew</code> option that will ensure the creation fails if the file already\nexists. The <code>FileShare.None</code> option will additionally prevent the file from being opened again by any process. To finish, this code ensures\nthe file will get destroyed once the application has finished using it with the <code>FileOptions.DeleteOnClose</code> option.</p>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://owasp.org/www-community/vulnerabilities/Insecure_Temporary_File\">OWASP</a> - Insecure Temporary File</li>\n</ul>\n<h3>Standards</h3>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A01_2021-Broken_Access_Control/\">Top 10 2021 Category A1 - Broken Access Control</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/377\">CWE-377 - Insecure Temporary File</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/379\">CWE-379 - Creation of Temporary File in Directory with Incorrect Permissions</a></li>\n  <li>STIG Viewer - <a href=\"https://stigviewer.com/stigs/application_security_and_development/2024-12-06/finding/V-222567\">Application Security and\n  Development: V-222567</a> - The application must not be vulnerable to race conditions.</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S5445.json",
    "content": "{\n  \"title\": \"Insecure temporary file creation methods should not be used\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"HIGH\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-5445\",\n  \"sqKey\": \"S5445\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      377,\n      379\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A1\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"6.5.8\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"6.2.4\"\n    ],\n    \"STIG ASD_V5R3\": [\n      \"V-222567\"\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S5542.html",
    "content": "<p>This vulnerability exposes encrypted data to a number of attacks whose goal is to recover the plaintext.</p>\n<h2>Why is this an issue?</h2>\n<p>Encryption algorithms are essential for protecting sensitive information and ensuring secure communications in a variety of domains. They are used\nfor several important reasons:</p>\n<ul>\n  <li>Confidentiality, privacy, and intellectual property protection</li>\n  <li>Security during transmission or on storage devices</li>\n  <li>Data integrity, general trust, and authentication</li>\n</ul>\n<p>When selecting encryption algorithms, tools, or combinations, you should also consider two things:</p>\n<ol>\n  <li>No encryption is unbreakable.</li>\n  <li>The strength of an encryption algorithm is usually measured by the effort required to crack it within a reasonable time frame.</li>\n</ol>\n<p>For these reasons, as soon as cryptography is included in a project, it is important to choose encryption algorithms that are considered strong and\nsecure by the cryptography community.</p>\n<p>For AES, the weakest mode is ECB (Electronic Codebook). Repeated blocks of data are encrypted to the same value, making them easy to identify and\nreducing the difficulty of recovering the original cleartext.</p>\n<p>Unauthenticated modes such as CBC (Cipher Block Chaining) may be used but are prone to attacks that manipulate the ciphertext. They must be used\nwith caution.</p>\n<p>For RSA, the weakest algorithms are either using it without padding or using the PKCS1v1.5 padding scheme.</p>\n<h3>What is the potential impact?</h3>\n<p>The cleartext of an encrypted message might be recoverable. Additionally, it might be possible to modify the cleartext of an encrypted message.</p>\n<p>Below are some real-world scenarios that illustrate possible impacts of an attacker exploiting the vulnerability.</p>\n<h4>Theft of sensitive data</h4>\n<p>The encrypted message might contain data that is considered sensitive and should not be known to third parties.</p>\n<p>By using a weak algorithm the likelihood that an attacker might be able to recover the cleartext drastically increases.</p>\n<h4>Additional attack surface</h4>\n<p>By modifying the cleartext of the encrypted message it might be possible for an attacker to trigger other vulnerabilities in the code. Encrypted\nvalues are often considered trusted, since under normal circumstances it would not be possible for a third party to modify them.</p>\n<h2>How to fix it in .NET</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<p>Example with a symmetric cipher, AES:</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nusing System.Security.Cryptography;\n\npublic void encrypt()\n{\n    AesManaged aes = new AesManaged\n    {\n        keysize = 128,\n        blocksize = 128,\n        mode = ciphermode.ecb,        // Noncompliant\n        padding = paddingmode.pkcs7\n    };\n}\n</pre>\n<p>Note that Microsoft has marked derived cryptographic types like <code>AesManaged</code> as no longer recommended for use.</p>\n<p>Example with an asymmetric cipher, RSA:</p>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nusing System.Security.Cryptography;\n\npublic void encrypt()\n{\n    RSACryptoServiceProvider RsaCsp = new RSACryptoServiceProvider();\n    byte[] encryptedData            = RsaCsp.Encrypt(dataToEncrypt, false); // Noncompliant\n}\n</pre>\n<h4>Compliant solution</h4>\n<p>For the AES symmetric cipher, use the GCM mode:</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nusing System.Security.Cryptography;\n\npublic void encrypt()\n{\n    AesGcm aes = AesGcm(key);\n}\n</pre>\n<p>For the RSA asymmetric cipher, use the Optimal Asymmetric Encryption Padding (OAEP):</p>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nusing System.Security.Cryptography;\n\npublic void encrypt()\n{\n    RSACryptoServiceProvider RsaCsp = new RSACryptoServiceProvider();\n    byte[] encryptedData            = RsaCsp.Encrypt(dataToEncrypt, true);\n}\n</pre>\n<h3>How does this work?</h3>\n<p>As a rule of thumb, use the cryptographic algorithms and mechanisms that are considered strong by the cryptographic community.</p>\n<p>Appropriate choices are currently the following.</p>\n<h4>For AES: use authenticated encryption modes</h4>\n<p>The best-known authenticated encryption mode for AES is Galois/Counter mode (GCM).</p>\n<p>GCM mode combines encryption with authentication and integrity checks using a cryptographic hash function and provides both confidentiality and\nauthenticity of data.</p>\n<p>Other similar modes are:</p>\n<ul>\n  <li>CCM: <code>Counter with CBC-MAC</code></li>\n  <li>CWC: <code>Cipher Block Chaining with Message Authentication Code</code></li>\n  <li>EAX: <code>Encrypt-and-Authenticate</code></li>\n  <li>IAPM: <code>Integer Authenticated Parallelizable Mode</code></li>\n  <li>OCB: <code>Offset Codebook Mode</code></li>\n</ul>\n<p>It is also possible to use AES-CBC with HMAC for integrity checks. However, it is considered more straightforward to use AES-GCM directly\ninstead.</p>\n<h4>For RSA: use the OAEP scheme</h4>\n<p>The Optimal Asymmetric Encryption Padding scheme (OAEP) adds randomness and a secure hash function that strengthens the regular inner workings of\nRSA.</p>\n<h2>Resources</h2>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/security/vulnerabilities-cbc-mode\">Microsoft, Timing vulnerabilities with CBC-mode\n  symmetric decryption using padding</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Padding_oracle_attack\">Wikipedia, Padding Oracle Attack</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Chosen-ciphertext_attack\">Wikipedia, Chosen-Ciphertext Attack</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Chosen-plaintext_attack\">Wikipedia, Chosen-Plaintext Attack</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Semantic_security\">Wikipedia, Semantically Secure Cryptosystems</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Optimal_asymmetric_encryption_padding\">Wikipedia, OAEP</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Galois/Counter_Mode\">Wikipedia, Galois/Counter Mode</a></li>\n</ul>\n<h3>Standards</h3>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A02_2021-Cryptographic_Failures/\">Top 10 2021 Category A2 - Cryptographic Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure\">Top 10 2017 Category A3 - Sensitive Data\n  Exposure</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A6_2017-Security_Misconfiguration\">Top 10 2017 Category A6 - Security\n  Misconfiguration</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/327\">CWE-327 - Use of a Broken or Risky Cryptographic Algorithm</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S5542.json",
    "content": "{\n  \"title\": \"Encryption algorithms should be used with secure mode and padding scheme\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"HIGH\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"privacy\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-5542\",\n  \"sqKey\": \"S5542\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      327,\n      780\n    ],\n    \"OWASP\": [\n      \"A6\",\n      \"A3\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A2\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"4.1\",\n      \"6.5.3\",\n      \"6.5.4\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"4.2.1\",\n      \"6.2.4\"\n    ],\n    \"ASVS 4.0\": [\n      \"2.9.3\",\n      \"6.2.2\",\n      \"8.3.7\"\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S5547.html",
    "content": "<p>This vulnerability makes it possible that the cleartext of the encrypted message might be recoverable without prior knowledge of the key.</p>\n<h2>Why is this an issue?</h2>\n<p>Encryption algorithms are essential for protecting sensitive information and ensuring secure communication in various domains. They are used for\nseveral important reasons:</p>\n<ul>\n  <li>Confidentiality, privacy, and intellectual property protection</li>\n  <li>Security during transmission or on storage devices</li>\n  <li>Data integrity, general trust, and authentication</li>\n</ul>\n<p>When selecting encryption algorithms, tools, or combinations, you should also consider two things:</p>\n<ol>\n  <li>No encryption is unbreakable.</li>\n  <li>The strength of an encryption algorithm is usually measured by the effort required to crack it within a reasonable time frame.</li>\n</ol>\n<p>For these reasons, as soon as cryptography is included in a project, it is important to choose encryption algorithms that are considered strong and\nsecure by the cryptography community.</p>\n<h3>What is the potential impact?</h3>\n<p>The cleartext of an encrypted message might be recoverable. Additionally, it might be possible to modify the cleartext of an encrypted message.</p>\n<p>Below are some real-world scenarios that illustrate some impacts of an attacker exploiting the vulnerability.</p>\n<h4>Theft of sensitive data</h4>\n<p>The encrypted message might contain data that is considered sensitive and should not be known to third parties.</p>\n<p>By using a weak algorithm the likelihood that an attacker might be able to recover the cleartext drastically increases.</p>\n<h4>Additional attack surface</h4>\n<p>By modifying the cleartext of the encrypted message it might be possible for an attacker to trigger other vulnerabilities in the code. Encrypted\nvalues are often considered trusted, since under normal circumstances it would not be possible for a third party to modify them.</p>\n<h2>How to fix it in .NET</h2>\n<h3>Code examples</h3>\n<p>The following code contains examples of algorithms that are not considered highly resistant to cryptanalysis and thus should be avoided.</p>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"11\" data-diff-type=\"noncompliant\">\nusing System.Security.Cryptography;\n\npublic void encrypt()\n{\n    var simpleDES = new DESCryptoServiceProvider(); // Noncompliant\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"11\" data-diff-type=\"compliant\">\nusing System.Security.Cryptography;\n\npublic void encrypt()\n{\n    using (Aes aes = Aes.Create())\n    {\n        // ...\n    }\n}\n</pre>\n<h3>How does this work?</h3>\n<h4>Use a secure algorithm</h4>\n<p>It is highly recommended to use an algorithm that is currently considered secure by the cryptographic community. A common choice for such an\nalgorithm is the Advanced Encryption Standard (AES).</p>\n<p>For block ciphers, it is not recommended to use algorithms with a block size that is smaller than 128 bits.</p>\n<h2>How to fix it in BouncyCastle</h2>\n<h3>Code examples</h3>\n<p>The following code contains examples of algorithms that are not considered highly resistant to cryptanalysis and thus should be avoided.</p>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nusing Org.BouncyCastle.Crypto.Engines;\nusing Org.BouncyCastle.Crypto.Parameters;\n\npublic void encrypt()\n{\n    AesFastEngine aesFast = new AesFastEngine(); // Noncompliant\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nusing Org.BouncyCastle.Crypto.Engines;\nusing Org.BouncyCastle.Crypto.Parameters;\n\npublic void encrypt()\n{\n    var AES = new AESEngine();\n}\n</pre>\n<h3>How does this work?</h3>\n<h4>Use a secure algorithm</h4>\n<p>It is highly recommended to use an algorithm that is currently considered secure by the cryptographic community. A common choice for such an\nalgorithm is the Advanced Encryption Standard (AES).</p>\n<p>For block ciphers, it is not recommended to use algorithms with a block size that is smaller than 128 bits.</p>\n<h2>Resources</h2>\n<h3>Standards</h3>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A02_2021-Cryptographic_Failures/\">Top 10 2021 Category A2 - Cryptographic Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure\">Top 10 2017 Category A3 - Sensitive Data\n  Exposure</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A6_2017-Security_Misconfiguration\">Top 10 2017 Category A6 - Security\n  Misconfiguration</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/327\">CWE-327 - Use of a Broken or Risky Cryptographic Algorithm</a></li>\n  <li>STIG Viewer - <a href=\"https://stigviewer.com/stigs/application_security_and_development/2024-12-06/finding/V-222396\">Application Security and\n  Development: V-222396</a> - The application must implement DoD-approved encryption to protect the confidentiality of remote access sessions.</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S5547.json",
    "content": "{\n  \"title\": \"Cipher algorithms should be robust\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"HIGH\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"privacy\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-5547\",\n  \"sqKey\": \"S5547\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      327,\n      326\n    ],\n    \"OWASP\": [\n      \"A3\",\n      \"A6\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A2\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"4.1\",\n      \"6.5.3\",\n      \"6.5.4\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"4.2.1\",\n      \"6.2.4\"\n    ],\n    \"ASVS 4.0\": [\n      \"6.2.2\",\n      \"6.2.3\",\n      \"6.2.5\",\n      \"8.3.7\"\n    ],\n    \"STIG ASD_V5R3\": [\n      \"V-222396\"\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S5659.html",
    "content": "<p>This vulnerability allows forging of JSON Web Tokens to impersonate other users.</p>\n<h2>Why is this an issue?</h2>\n<p>JSON Web Tokens (JWTs), a popular method of securely transmitting information between parties as a JSON object, can become a significant security\nrisk when they are not properly signed with a robust cipher algorithm, left unsigned altogether, or if the signature is not verified. This\nvulnerability class allows malicious actors to craft fraudulent tokens, effectively impersonating user identities. In essence, the integrity of a JWT\nhinges on the strength and presence of its signature.</p>\n<h3>What is the potential impact?</h3>\n<p>When a JSON Web Token is not appropriately signed with a strong cipher algorithm or if the signature is not verified, it becomes a significant\nthreat to data security and the privacy of user identities.</p>\n<h4>Impersonation of users</h4>\n<p>JWTs are commonly used to represent user authorization claims. They contain information about the user’s identity, user roles, and access rights.\nWhen these tokens are not securely signed, it allows an attacker to forge them. In essence, a weak or missing signature gives an attacker the power to\ncraft a token that could impersonate any user. For instance, they could create a token for an administrator account, gaining access to high-level\npermissions and sensitive data.</p>\n<h4>Unauthorized data access</h4>\n<p>When a JWT is not securely signed, it can be tampered with by an attacker, and the integrity of the data it carries cannot be trusted. An attacker\ncan manipulate the content of the token and grant themselves permissions they should not have, leading to unauthorized data access.</p>\n<h2>How to fix it in Jwt.Net</h2>\n<h3>Code examples</h3>\n<p>The following code contains an example of JWT decoding without verification of the signature.</p>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nusing JWT;\n\npublic static void decode(IJwtDecoder decoder)\n{\n    decoder.Decode(token, secret, verify: false); // Noncompliant\n}\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nusing JWT;\n\npublic static void decode()\n{\n    var jwt = new JwtBuilder()\n        .WithSecret(secret)\n        .Decode(token); // Noncompliant\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nusing JWT;\n\npublic static void decode(IJwtDecoder decoder)\n{\n    decoder.Decode(token, secret, verify: true);\n}\n</pre>\n<p>When using <code>JwtBuilder</code>, make sure to call <code>MustVerifySignature()</code>.</p>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nusing JWT;\n\npublic static void decode()\n{\n    var jwt = new JwtBuilder()\n        .WithSecret(secret)\n        .MustVerifySignature()\n        .Decode(token);\n}\n</pre>\n<h3>How does this work?</h3>\n<h4>Verify the signature of your tokens</h4>\n<p>Resolving a vulnerability concerning the validation of JWT token signatures is mainly about incorporating a critical step into your process:\nvalidating the signature every time a token is decoded. Just having a signed token using a secure algorithm is not enough. If you are not validating\nsignatures, they are not serving their purpose.</p>\n<p>Every time your application receives a JWT, it needs to decode the token to extract the information contained within. It is during this decoding\nprocess that the signature of the JWT should also be checked.</p>\n<p>To resolve the issue, follow these instructions:</p>\n<ol>\n  <li>Use framework-specific functions for signature verification: Most programming frameworks that support JWTs provide specific functions to not\n  only decode a token but also validate its signature simultaneously. Make sure to use these functions when handling incoming tokens.</li>\n  <li>Handle invalid signatures appropriately: If a JWT’s signature does not validate correctly, it means the token is not trustworthy, indicating\n  potential tampering. The action to take when encountering an invalid token should be denying the request carrying it and logging the event for\n  further investigation.</li>\n  <li>Incorporate signature validation in your tests: When you are writing tests for your application, include tests that check the signature\n  validation functionality. This can help you catch any instances where signature verification might be unintentionally skipped or bypassed.</li>\n</ol>\n<p>By following these practices, you can ensure the security of your application’s JWT handling process, making it resistant to attacks that rely on\ntampering with tokens. Validation of the signature needs to be an integral and non-negotiable part of your token handling process.</p>\n<h3>Going the extra mile</h3>\n<h4>Securely store your secret keys</h4>\n<p>Ensure that your secret keys are stored securely. They should not be hard-coded into your application code or checked into your version control\nsystem. Instead, consider using environment variables, secure key management systems, or vault services.</p>\n<h4>Rotate your secret keys</h4>\n<p>Even with the strongest cipher algorithms, there is a risk that your secret keys may be compromised. Therefore, it is a good practice to\nperiodically rotate your secret keys. By doing so, you limit the amount of time that an attacker can misuse a stolen key. When you rotate keys, be\nsure to allow a grace period where tokens signed with the old key are still accepted to prevent service disruptions.</p>\n<h2>Resources</h2>\n<h3>Standards</h3>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A02_2021-Cryptographic_Failures/\">Top 10 2021 Category A2 - Cryptographic Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure\">Top 10 2017 Category A3 - Sensitive Data\n  Exposure</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/347\">CWE-347 - Improper Verification of Cryptographic Signature</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S5659.json",
    "content": "{\n  \"title\": \"JWT should be signed and verified with strong cipher algorithms\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"HIGH\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"privacy\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-5659\",\n  \"sqKey\": \"S5659\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      347\n    ],\n    \"OWASP\": [\n      \"A3\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A2\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"6.5.10\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"6.2.4\"\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S5693.html",
    "content": "<p>Rejecting requests with significant content length is a good practice to control the network traffic intensity and thus resource consumption in\norder to prevent DoS attacks.</p>\n<h2>Ask Yourself Whether</h2>\n<ul>\n  <li>size limits are not defined for the different resources of the web application.</li>\n  <li>the web application is not protected by <a href=\"https://en.wikipedia.org/wiki/Rate_limiting\">rate limiting</a> features.</li>\n  <li>the web application infrastructure has limited resources.</li>\n</ul>\n<p>There is a risk if you answered yes to any of those questions.</p>\n<h2>Recommended Secure Coding Practices</h2>\n<ul>\n  <li>For most of the features of an application, it is recommended to limit the size of requests to:\n    <ul>\n      <li>lower or equal to 8mb for file uploads.</li>\n      <li>lower or equal to 2mb for other requests.</li>\n    </ul></li>\n</ul>\n<p>It is recommended to customize the rule with the limit values that correspond to the web application.</p>\n<h2>Sensitive Code Example</h2>\n<pre>\nusing Microsoft.AspNetCore.Mvc;\n\npublic class MyController : Controller\n{\n    [HttpPost]\n    [DisableRequestSizeLimit] // Sensitive: No size  limit\n    [RequestSizeLimit(10485760)] // Sensitive: 10485760 B = 10240 KB = 10 MB is more than the recommended limit of 8MB\n    public IActionResult PostRequest(Model model)\n    {\n    // ...\n    }\n\n    [HttpPost]\n    [RequestFormLimits(MultipartBodyLengthLimit = 10485760)] // Sensitive: 10485760 B = 10240 KB = 10 MB is more than the recommended limit of 8MB\n    public IActionResult MultipartFormRequest(Model model)\n    {\n    // ...\n    }\n}\n</pre>\n<p>In Web.config:</p>\n<pre>\n&lt;configuration&gt;\n    &lt;system.web&gt;\n        &lt;httpRuntime maxRequestLength=\"81920\" executionTimeout=\"3600\" /&gt;\n        &lt;!-- Sensitive: maxRequestLength is expressed in KB, so 81920 KB = 80 MB  --&gt;\n    &lt;/system.web&gt;\n    &lt;system.webServer&gt;\n        &lt;security&gt;\n            &lt;requestFiltering&gt;\n                &lt;requestLimits maxAllowedContentLength=\"83886080\" /&gt;\n                &lt;!-- Sensitive: maxAllowedContentLength is expressed in bytes, so 83886080 B = 81920 KB = 80 MB  --&gt;\n            &lt;/requestFiltering&gt;\n        &lt;/security&gt;\n    &lt;/system.webServer&gt;\n&lt;/configuration&gt;\n</pre>\n<h2>Compliant Solution</h2>\n<pre>\nusing Microsoft.AspNetCore.Mvc;\n\npublic class MyController : Controller\n{\n    [HttpPost]\n    [RequestSizeLimit(8388608)] // Compliant: 8388608 B = 8192 KB = 8 MB\n    public IActionResult PostRequest(Model model)\n    {\n    // ...\n    }\n\n    [HttpPost]\n    [RequestFormLimits(MultipartBodyLengthLimit = 8388608)] // Compliant: 8388608 B = 8192 KB = 8 MB\n    public IActionResult MultipartFormRequest(Model model)\n    {\n    // ...\n    }\n}\n</pre>\n<p>In Web.config:</p>\n<pre>\n&lt;configuration&gt;\n    &lt;system.web&gt;\n        &lt;httpRuntime maxRequestLength=\"8192\" executionTimeout=\"3600\" /&gt;\n        &lt;!-- Compliant: maxRequestLength is expressed in KB, so 8192 KB = 8 MB  --&gt;\n    &lt;/system.web&gt;\n    &lt;system.webServer&gt;\n        &lt;security&gt;\n            &lt;requestFiltering&gt;\n                &lt;requestLimits maxAllowedContentLength=\"8388608\" /&gt;\n                &lt;!-- Compliant: maxAllowedContentLength is expressed in bytes, so 8388608 B = 8192 KB = 8 MB  --&gt;\n            &lt;/requestFiltering&gt;\n        &lt;/security&gt;\n    &lt;/system.webServer&gt;\n&lt;/configuration&gt;\n</pre>\n<h2>See</h2>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A05_2021-Security_Misconfiguration/\">Top 10 2021 Category A5 - Security Misconfiguration</a></li>\n  <li><a href=\"https://cheatsheetseries.owasp.org/cheatsheets/Denial_of_Service_Cheat_Sheet.html\">Owasp Cheat Sheet</a> - Owasp Denial of Service\n  Cheat Sheet</li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A6_2017-Security_Misconfiguration\">Top 10 2017 Category A6 - Security\n  Misconfiguration</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/770\">CWE-770 - Allocation of Resources Without Limits or Throttling</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/400\">CWE-400 - Uncontrolled Resource Consumption</a></li>\n  <li><a href=\"https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/web-config\">Web.config</a> - XML-formatted config file for IIS\n  applications</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S5693.json",
    "content": "{\n  \"title\": \"Allowing requests with excessive content length is security-sensitive\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-5693\",\n  \"sqKey\": \"S5693\",\n  \"scope\": \"All\",\n  \"securityStandards\": {\n    \"CWE\": [\n      400,\n      770\n    ],\n    \"OWASP\": [\n      \"A6\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A5\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"2.2\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"2.2\"\n    ],\n    \"ASVS 4.0\": [\n      \"12.1.1\",\n      \"12.1.3\"\n    ]\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S5753.html",
    "content": "<p>ASP.NET 1.1+ comes with a feature called <em>Request Validation</em>, preventing the server to accept content containing un-encoded HTML. This\nfeature comes as a first protection layer against Cross-Site Scripting (XSS) attacks and act as a simple Web Application Firewall (WAF) rejecting\nrequests potentially containing malicious content.</p>\n<p>While this feature is not a silver bullet to prevent all XSS attacks, it helps to catch basic ones. It will for example prevent <code>&lt;script\ntype=\"text/javascript\" src=\"https://malicious.domain/payload.js\"&gt;</code> to reach your Controller.</p>\n<p>Note: <em>Request Validation</em> feature being only available for ASP.NET, no Security Hotspot is raised on ASP.NET Core applications.</p>\n<h2>Ask Yourself Whether</h2>\n<ul>\n  <li>the developer doesn’t know the impact to deactivate the Request Validation feature</li>\n  <li>the web application accepts user-supplied data</li>\n  <li>all user-supplied data are not validated</li>\n</ul>\n<p>There is a risk if you answered yes to any of those questions.</p>\n<h2>Recommended Secure Coding Practices</h2>\n<ul>\n  <li>Activate the Request Validation feature for all HTTP requests</li>\n</ul>\n<h2>Sensitive Code Example</h2>\n<p>At Controller level:</p>\n<pre>\n[ValidateInput(false)]\npublic ActionResult Welcome(string name)\n{\n  ...\n}\n</pre>\n<p>At application level, configured in the Web.config file:</p>\n<pre>\n&lt;configuration&gt;\n   &lt;system.web&gt;\n      &lt;pages validateRequest=\"false\" /&gt;\n      ...\n      &lt;httpRuntime requestValidationMode=\"0.0\" /&gt;\n   &lt;/system.web&gt;\n&lt;/configuration&gt;\n</pre>\n<h2>Compliant Solution</h2>\n<p>At Controller level:</p>\n<pre>\n[ValidateInput(true)]\npublic ActionResult Welcome(string name)\n{\n  ...\n}\n</pre>\n<p>or</p>\n<pre>\npublic ActionResult Welcome(string name)\n{\n  ...\n}\n</pre>\n<p>At application level, configured in the Web.config file:</p>\n<pre>\n&lt;configuration&gt;\n   &lt;system.web&gt;\n      &lt;pages validateRequest=\"true\" /&gt;\n      ...\n      &lt;httpRuntime requestValidationMode=\"4.5\" /&gt;\n   &lt;/system.web&gt;\n&lt;/configuration&gt;\n</pre>\n<h2>See</h2>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A03_2021-Injection/\">Top 10 2021 Category A3 - Injection</a></li>\n  <li><a\n  href=\"https://docs.microsoft.com/en-us/dotnet/api/system.web.configuration.httpruntimesection.requestvalidationmode?view=netframework-4.8\">HttpRuntimeSection.RequestValidationMode Property</a></li>\n  <li><a href=\"https://owasp.org/www-community/ASP-NET_Request_Validation\">OWASP ASP.NET Request Validation</a></li>\n  <li><a href=\"https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html\">OWASP Cheat Sheet</a> - XSS Prevention\n  Cheat Sheet</li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A7_2017-Cross-Site_Scripting_(XSS)\">Top 10 2017 Category A7 - Cross-Site Scripting\n  (XSS)</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/79\">CWE-79 - Improper Neutralization of Input During Web Page Generation ('Cross-site\n  Scripting')</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S5753.json",
    "content": "{\n  \"title\": \"Disabling ASP.NET \\\"Request Validation\\\" feature is security-sensitive\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-5753\",\n  \"sqKey\": \"S5753\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      79\n    ],\n    \"OWASP\": [\n      \"A7\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A3\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"6.5.7\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"6.2.4\"\n    ],\n    \"ASVS 4.0\": [\n      \"5.3.3\"\n    ]\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S5766.html",
    "content": "<p>When an object is created via deserialization, its constructor is often not executed: the object is instead built directly from its serialized\ndata.\n  <br>\n  This means an attacker can create a malicious object and completely bypass security checks.</p>\n<h2>Ask Yourself Whether</h2>\n<ul>\n  <li>Constructors of this <code>Serializable</code> class lack relevant security checks.</li>\n  <li>Security checks performed during deserialization differ from those in the constructor.</li>\n</ul>\n<p>There is a risk if you answered yes to any of those questions.</p>\n<h2>Recommended Secure Coding Practices</h2>\n<ul>\n  <li>Ensure validation is applied to all entry points of an application.</li>\n  <li>Ensure that validation is identical regardless of how an object gets created.</li>\n</ul>\n<h2>Sensitive Code Example</h2>\n<p>In the following examples, <code>Serializable</code> classes either omit validation or apply different validation logic during instantiation than\nduring deserialization.</p>\n<p>For classes inheriting <a\nhref=\"https://docs.microsoft.com/en-us/dotnet/api/system.runtime.serialization.iserializable?view=netframework-4.8\">ISerializable</a>:</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\n[Serializable]\npublic class InternalUrl : ISerializable\n{\n    private string url;\n\n    public InternalUrl(string tmpUrl)\n    {\n        if(!tmpUrl.StartsWith(\"http://localhost/\"))\n        {\n            url = \"http://localhost/default\";\n        }\n        else\n        {\n            url = tmpUrl;\n        }\n    }\n\n    // Special Deserialization constructor\n    protected InternalUrl(SerializationInfo info, StreamingContext context)\n    {\n       url = (string) info.GetValue(\"url\", typeof(string));\n       // Sensitive - no validation\n     }\n\n    void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)\n    {\n        info.AddValue(\"url\", url);\n    }\n}\n</pre>\n<p>For classes inheriting <a\nhref=\"https://docs.microsoft.com/en-us/dotnet/api/system.runtime.serialization.ideserializationcallback?view=netframework-4.8\">IDeserializationCallback</a>:</p>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\n[Serializable]\npublic class InternalUrl : IDeserializationCallback\n{\n    private string url;\n\n    public InternalUrl(string tmpUrl)\n    {\n        if(!tmpUrl.StartsWith(\"http://localhost/\"))\n        {\n            url = \"http://localhost/default\";\n        }\n        else\n        {\n            url = tmpUrl;\n        }\n    }\n\n    void IDeserializationCallback.OnDeserialization(object sender)\n    {\n       // Sensitive - no validation\n    }\n}\n</pre>\n<p>For classes inheriting from neither of previous types:</p>\n<pre data-diff-id=\"3\" data-diff-type=\"noncompliant\">\n[Serializable]\npublic class InternalUrl\n{\n    private string url;\n\n    public InternalUrl(string tmpUrl)\n    {\n        // Sensitive - no validation\n        url = tmpUrl;\n    }\n}\n</pre>\n<h2>Compliant Solution</h2>\n<p>For classes inheriting <a\nhref=\"https://docs.microsoft.com/en-us/dotnet/api/system.runtime.serialization.iserializable?view=netframework-4.8\">ISerializable</a>:</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n[Serializable]\npublic class InternalUrl : ISerializable\n{\n    private string url;\n\n    public InternalUrl(string tmpUrl)\n    {\n        url = tmpUrl;\n        validate();\n    }\n\n    // Special Deserialization constructor\n    protected InternalUrl(SerializationInfo info, StreamingContext context)\n    {\n       url = (string) info.GetValue(\"url\", typeof(string));\n       validate();\n     }\n\n    void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)\n    {\n        info.AddValue(\"url\", url);\n    }\n\n    void validate()\n    {\n        if(!url.StartsWith(\"http://localhost/\"))\n        {\n            url = \"http://localhost/default\";\n        }\n    }\n}\n</pre>\n<p>For classes inheriting <a\nhref=\"https://docs.microsoft.com/en-us/dotnet/api/system.runtime.serialization.ideserializationcallback?view=netframework-4.8\">IDeserializationCallback</a>:</p>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\n[Serializable]\npublic class InternalUrl : IDeserializationCallback\n{\n    private string url;\n\n    public InternalUrl(string tmpUrl)\n    {\n        url = tmpUrl;\n        validate();\n    }\n\n    void IDeserializationCallback.OnDeserialization(object sender)\n    {\n        validate();\n    }\n}\n</pre>\n<p>For classes inheriting from neither of previous types:</p>\n<pre data-diff-id=\"3\" data-diff-type=\"compliant\">\n[Serializable]\npublic class InternalUrl\n{\n    private string url;\n\n    public InternalUrl(string tmpUrl)\n    {\n        if(!tmpUrl.StartsWith(\"http://localhost/\"))\n        {\n            url = \"http://localhost/default\";\n        }\n        else\n        {\n            url = tmpUrl;\n        }\n    }\n}\n</pre>\n<h2>See</h2>\n<ul>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/502\">CWE-502 - Deserialization of Untrusted Data</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A08_2021-Software_and_Data_Integrity_Failures/\">Top 10 2021 Category A8 - Software and Data Integrity\n  Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A8_2017-Insecure_Deserialization\">Top 10 2017 Category A8 - Insecure\n  Deserialization</a></li>\n  <li>Microsoft - <a href=\"https://docs.microsoft.com/en-us/dotnet/framework/misc/security-and-serialization\">Security And Serialization</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S5766.json",
    "content": "{\n  \"title\": \"Creating Serializable objects without data validation checks is security-sensitive\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-5766\",\n  \"sqKey\": \"S5766\",\n  \"scope\": \"All\",\n  \"securityStandards\": {\n    \"CWE\": [\n      502\n    ],\n    \"OWASP\": [\n      \"A8\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A8\"\n    ],\n    \"ASVS 4.0\": [\n      \"1.5.2\",\n      \"5.5.1\",\n      \"5.5.3\"\n    ]\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S5773.html",
    "content": "<p>Deserialization is the process of converting serialized data (such as objects or data structures) back into their original form. Types allowed to\nbe unserialized should be strictly controlled.</p>\n<h2>Why is this an issue?</h2>\n<p>During the deserialization process, the state of an object will be reconstructed from the serialized data stream. By allowing unrestricted\ndeserialization of types, the application makes it possible for attackers to use types with dangerous or otherwise sensitive behavior during the\ndeserialization process.</p>\n<h3>What is the potential impact?</h3>\n<p>When an application deserializes untrusted data without proper restrictions, an attacker can craft malicious serialized objects. Depending on the\naffected objects and properties, the consequences can vary.</p>\n<h3>Remote Code Execution</h3>\n<p>If attackers can craft malicious serialized objects that contain executable code, this code will run within the application’s context, potentially\ngaining full control over the system. This can lead to unauthorized access, data breaches, or even complete system compromise.</p>\n<p>For example, a well-known attack vector consists in serializing an object of type <code><a\nhref=\"https://docs.microsoft.com/en-us/dotnet/api/system.codedom.compiler.tempfilecollection.-ctor?view=netframework-4.8#System_CodeDom_Compiler_TempFileCollection__ctor\">TempFileCollection</a></code>\nwith arbitrary files (defined by an attacker) which will be deleted on the application deserializing this object (when the <a\nhref=\"https://docs.microsoft.com/en-us/dotnet/api/system.codedom.compiler.tempfilecollection.finalize?view=netframework-4.8\">finalize()</a> method of\nthe TempFileCollection object is called). These kinds of specially crafted serialized objects are called \"<a\nhref=\"https://github.com/pwntester/ysoserial.net\">gadgets</a>\".</p>\n<h3>Privilege escalation</h3>\n<p>Unrestricted deserialization can also enable attackers to escalate their privileges within the application. By manipulating the serialized data, an\nattacker can modify object properties or bypass security checks, granting them elevated privileges that they should not have. This can result in\nunauthorized access to sensitive data, unauthorized actions, or even administrative control over the application.</p>\n<h3>Denial of Service</h3>\n<p>In some cases, an attacker can abuse the deserialization process to cause a denial of service (DoS) condition. By providing specially crafted\nserialized data, the attacker can trigger excessive resource consumption, leading to system instability or unresponsiveness. This can disrupt the\navailability of the application, impacting its functionality and causing inconvenience to users.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<p>With <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.formatters.binary.binaryformatter\"><code>BinaryFormatter</code></a>,\n<a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.netdatacontractserializer\"><code>NetDataContractSerializer</code></a>\nor <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.formatters.soap.soapformatter\"><code>SoapFormatter</code></a>:</p>\n<pre data-diff-id=\"101\" data-diff-type=\"noncompliant\">\nvar myBinaryFormatter = new BinaryFormatter();\nmyBinaryFormatter.Deserialize(stream); // Noncompliant\n</pre>\n<p>With <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.web.script.serialization.javascriptserializer\"><code>JavaScriptSerializer</code></a>:</p>\n<pre data-diff-id=\"102\" data-diff-type=\"noncompliant\">\nJavaScriptSerializer serializer1 = new JavaScriptSerializer(new SimpleTypeResolver()); // Noncompliant\nserializer1.Deserialize&lt;ExpectedType&gt;(json);\n</pre>\n<h4>Compliant solution</h4>\n<p>With <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.formatters.binary.binaryformatter\"><code>BinaryFormatter</code></a>,\n<a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.netdatacontractserializer\"><code>NetDataContractSerializer</code></a>\nor <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.formatters.soap.soapformatter\"><code>SoapFormatter</code></a>:</p>\n<pre data-diff-id=\"101\" data-diff-type=\"compliant\">\nsealed class CustomBinder : SerializationBinder\n{\n   public override Type BindToType(string assemblyName, string typeName)\n   {\n       if (!(typeName == \"type1\" || typeName == \"type2\" || typeName == \"type3\"))\n       {\n          throw new SerializationException(\"Only type1, type2 and type3 are allowed\");\n       }\n       return Assembly.Load(assemblyName).GetType(typeName);\n   }\n}\n\nvar myBinaryFormatter = new BinaryFormatter();\nmyBinaryFormatter.Binder = new CustomBinder();\nmyBinaryFormatter.Deserialize(stream);\n</pre>\n<p>With <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.web.script.serialization.javascriptserializer\"><code>JavaScriptSerializer</code></a>:</p>\n<pre data-diff-id=\"102\" data-diff-type=\"compliant\">\npublic class CustomSafeTypeResolver : JavaScriptTypeResolver\n{\n   public override Type ResolveType(string id)\n   {\n      if(id != \"ExpectedType\") {\n         throw new ArgumentNullException(\"Only ExpectedType is allowed during deserialization\");\n      }\n      return Type.GetType(id);\n   }\n}\n\nJavaScriptSerializer serializer = new JavaScriptSerializer(new CustomSafeTypeResolver());\nserializer.Deserialize&lt;ExpectedType&gt;(json);\n</pre>\n<h3>Going the extra mile</h3>\n<p>Instead of using <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.formatters.binary.binaryformatter\"><code>BinaryFormatter</code></a>\nand similar serializers, it is recommended to use safer alternatives in most of the cases, such as <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.xml.serialization.xmlserializer\"><code>XmlSerializer</code></a> or <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.datacontractserializer\"><code>DataContractSerializer</code></a>.</p>\n<p>If it’s not possible then try to mitigate the risk by restricting the types allowed to be deserialized:</p>\n<ul>\n  <li>by implementing an \"allow-list\" of types, but keep in mind that novel dangerous types are regularly discovered and this protection could be\n  insufficient over time.</li>\n  <li>or/and implementing a tamper protection, such as <a href=\"https://en.wikipedia.org/wiki/HMAC\">message authentication codes</a> (MAC). This way\n  only objects serialized with the correct MAC hash will be deserialized.</li>\n</ul>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.formatters.binary.binaryformatter\">BinaryFormatter Class</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.netdatacontractserializer\">NetDataContractSerializer Class</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.formatters.soap.soapformatter\">SoapFormatter Class</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.web.script.serialization.javascriptserializer\">JavaScriptSerializer Class</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.xml.serialization.xmlserializer\">XmlSerializer Class</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.datacontractserializer\">DataContractSerializer Class</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://docs.microsoft.com/en-us/dotnet/standard/serialization/binaryformatter-security-guide?s=03\">Deserialization\n  risks in use of BinaryFormatter and related types</a></li>\n  <li>OWASP - <a href=\"https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Deserialization_Cheat_Sheet.md\">Deserialization Cheat\n  Sheet</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/HMAC\">Message Authentication Codes (MAC)</a></li>\n</ul>\n<h3>Standards</h3>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A08_2021-Software_and_Data_Integrity_Failures/\">Top 10 2021 Category A8 - Software and Data Integrity\n  Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A8_2017-Insecure_Deserialization\">Top 10 2017 Category A8 - Insecure\n  Deserialization</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/502\">CWE-502 - Deserialization of Untrusted Data</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S5773.json",
    "content": "{\n  \"title\": \"Types allowed to be deserialized should be restricted\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  },\n  \"status\": \"ready\",\n  \"quickfix\": \"targeted\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"symbolic-execution\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-5773\",\n  \"sqKey\": \"S5773\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      502\n    ],\n    \"OWASP\": [\n      \"A8\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A8\"\n    ],\n    \"ASVS 4.0\": [\n      \"1.5.2\",\n      \"5.5.1\",\n      \"5.5.3\"\n    ]\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S5856.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/base-types/regular-expressions\">Regular expressions</a> have their own syntax that is\nunderstood by regular expression engines. Those engines will throw an exception at runtime if they are given a regular expression that does not\nconform to that syntax.</p>\n<p>To avoid syntax errors, special characters should be <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/standard/base-types/character-escapes-in-regular-expressions\">escaped with backslashes</a> when they\nare intended to be matched literally and references to capturing groups should use the correctly spelled name or number of the group.</p>\n<p>Negative <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/standard/base-types/regular-expression-language-quick-reference#lookarounds-at-a-glance\">lookaround</a>\ngroups cannot be combined with <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/standard/base-types/backtracking-in-regular-expressions\">RegexOptions.NonBacktracking</a>. Such\ncombination would throw an exception during runtime.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nvoid Regexes(string input)\n{\n    var regex = new Regex(\"[A\");                                                    // Noncompliant\n    var match = Regex.Match(input, \"[A\");                                           // Noncompliant\n    var negativeLookahead = new Regex(\"a(?!b)\", RegexOptions.NonBacktracking);      // Noncompliant\n    var negativeLookbehind = new Regex(\"(?&lt;!a)b\", RegexOptions.NonBacktracking);    // Noncompliant\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nvoid Regexes(string input)\n{\n    var regex = new Regex(\"[A-Z]\");\n    var match = Regex.Match(input, \"[A-Z]\");\n    var negativeLookahead = new Regex(\"a(?!b)\");\n    var negativeLookbehind = new Regex(\"(?&lt;!a)b\");\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/base-types/regular-expressions\">.NET Regular expressions</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/standard/base-types/regular-expression-language-quick-reference#lookarounds-at-a-glance\">Lookarounds\n  at a glance</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/base-types/backtracking-in-regular-expressions\">Backtracking in Regular\n  Expressions</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/base-types/character-escapes-in-regular-expressions\">Character Escapes in Regular\n  Expressions</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S5856.json",
    "content": "{\n  \"title\": \"Regular expressions should be syntactically valid\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [\n    \"regex\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-5856\",\n  \"sqKey\": \"S5856\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6354.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>One of the principles of a unit test is that it must have full control of the system under test. This is problematic when production code includes\ncalls to static methods, which cannot be changed or controlled. Date/time functions are usually provided by system libraries as static methods.</p>\n<p>This can be improved by wrapping the system calls in an object or service that can be controlled inside the unit test.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic class Foo\n{\n    public string HelloTime() =&gt;\n        $\"Hello at {DateTime.UtcNow}\";\n}\n</pre>\n<h3>Compliant solution</h3>\n<p>There are different approaches to solve this problem. One of them is suggested below. There are also open source libraries (such as NodaTime) which\nalready implement an <code>IClock</code> interface and a <code>FakeClock</code> testing class.</p>\n<pre>\npublic interface IClock\n{\n    DateTime UtcNow();\n}\n\npublic class Foo\n{\n    public string HelloTime(IClock clock) =&gt;\n        $\"Hello at {clock.UtcNow()}\";\n}\n\npublic class FooTest\n{\n    public record TestClock(DateTime now) : IClock\n    {\n        public DateTime UtcNow() =&gt; now;\n    }\n\n    [Fact]\n    public void HelloTime_Gives_CorrectTime()\n    {\n        var dateTime = new DateTime(2017, 06, 11);\n        Assert.Equal((new Foo()).HelloTime(new TestClock(dateTime)), $\"Hello at {dateTime}\");\n    }\n}\n</pre>\n<p>Another possible solution is using an adaptable static class, ideally supports an IDisposable method, that not only adjusts the time behaviour for\nthe current thread only, but also for scope of the using.</p>\n<pre>\npublic static class Clock\n{\n    public static DateTime UtcNow() { /* ... */ }\n    public static IDisposable SetTimeForCurrentThread(Func&lt;DateTime&gt; time) { /* ... */ }\n}\n\npublic class Foo\n{\n    public string HelloTime() =&gt;\n        $\"Hello at {Clock.UtcNow()}\";\n}\n\npublic class FooTest\n{\n    [Fact]\n    public void HelloTime_Gives_CorrectTime()\n    {\n        var dateTime = new DateTime(2017, 06, 11);\n        using (Clock.SetTimeForCurrentThread(() =&gt; dateTime))\n        {\n             Assert.Equal((new Foo()).HelloTime(), $\"Hello at {dateTime}\");\n        }\n    }\n}\n</pre>\n<h2>Resources</h2>\n<p><a href=\"https://nodatime.org/3.0.x/api/NodaTime.Testing.html\">NodaTime testing</a></p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6354.json",
    "content": "{\n  \"title\": \"Use a testable date\\/time provider\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"TESTED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6354\",\n  \"sqKey\": \"S6354\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6377.html",
    "content": "<p>XML signatures are a method used to ensure the integrity and authenticity of XML documents. However, if XML signatures are not validated securely,\nit can lead to potential vulnerabilities.</p>\n<h2>Why is this an issue?</h2>\n<p>XML can be used for a wide variety of purposes. Using a signature on an XML message generally indicates this message requires authenticity and\nintegrity. However, if the signature validation is not properly implemented this authenticity can not be guaranteed.</p>\n<h3>What is the potential impact?</h3>\n<p>By not enforcing secure validation, the XML Digital Signature API is more susceptible to attacks such as signature spoofing and injections.</p>\n<h3>Increased Vulnerability to Signature Spoofing</h3>\n<p>By disabling secure validation, the application becomes more susceptible to signature spoofing attacks. Attackers can potentially manipulate the\nXML signature in a way that bypasses the validation process, allowing them to forge or tamper with the signature. This can lead to the acceptance of\ninvalid or maliciously modified signatures, compromising the integrity and authenticity of the XML documents.</p>\n<h3>Risk of Injection Attacks</h3>\n<p>Disabling secure validation can expose the application to injection attacks. Attackers can inject malicious code or entities into the XML document,\ntaking advantage of the weakened validation process. In some cases, it can also expose the application to denial-of-service attacks. Attackers can\nexploit vulnerabilities in the validation process to cause excessive resource consumption or system crashes, leading to service unavailability or\ndisruption.</p>\n<h2>How to fix it in ASP.NET Core</h2>\n<h3>Code examples</h3>\n<p>The following noncompliant code example verifies an XML signature without providing a trusted public key. This code will validate the signature\nagainst the embedded public key, accepting any forged signature.</p>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nXmlDocument xmlDoc = new()\n{\n    PreserveWhitespace = true\n};\nxmlDoc.Load(\"/data/login.xml\");\nSignedXml signedXml = new(xmlDoc);\nXmlNodeList nodeList = xmlDoc.GetElementsByTagName(\"Signature\");\nsignedXml.LoadXml((XmlElement?)nodeList[0]);\nif (signedXml.CheckSignature()) {\n    // Process the XML content\n} else {\n    // Raise an error\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nCspParameters cspParams = new()\n{\n    KeyContainerName = \"MY_RSA_KEY\"\n};\nRSACryptoServiceProvider rsaKey = new(cspParams);\n\nXmlDocument xmlDoc = new()\n{\n    PreserveWhitespace = true\n};\nxmlDoc.Load(\"/data/login.xml\");\nSignedXml signedXml = new(xmlDoc);\nXmlNodeList nodeList = xmlDoc.GetElementsByTagName(\"Signature\");\nsignedXml.LoadXml((XmlElement?)nodeList[0]);\nif (signedXml.CheckSignature(rsaKey)) {\n    // Process the XML content\n} else {\n    // Raise an error\n}\n</pre>\n<h3>How does this work?</h3>\n<p>Here, the compliant solution provides an RSA public key to the signature validation function. This will ensure only signatures computed with the\nassociated private key will be accepted, preventing signature forgery attacks.</p>\n<p>Using the <code>CheckSignature</code> method without providing a key can be risky because it may search the <code>AddressBook</code> store for\ncertificates, which includes all trusted root CA certificates on the machine. This broad trust base can be exploited by attackers. Additionally, if\nthe document is not signed with an X.509 signature, the method will use the key embedded in the signature element, which can lead to accepting\nsignatures from untrusted sources.</p>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.security.cryptography.xml\">System.Security.Cryptography.Xml\n  Namespace</a></li>\n  <li>Microsfot Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/standard/security/how-to-verify-the-digital-signatures-of-xml-documents\">How\n  to: Verify the Digital Signatures of XML Documents</a></li>\n</ul>\n<h3>Standards</h3>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A02_2021-Cryptographic_Failures/\">Top 10:2021 A02:2021 - Cryptographic Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure\">Top 10 2017 Category A3 - Sensitive Data\n  Exposure</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/347\">CWE-347 - Improper Verification of Cryptographic Signature</a></li>\n  <li>STIG Viewer - <a href=\"https://stigviewer.com/stigs/application_security_and_development/2024-12-06/finding/V-222608\">Application Security and\n  Development: V-222608</a> - The application must not be vulnerable to XML-oriented attacks.</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6377.json",
    "content": "{\n  \"title\": \"XML signatures should be validated securely\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6377\",\n  \"sqKey\": \"S6377\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      347\n    ],\n    \"OWASP\": [\n      \"A3\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A2\"\n    ],\n    \"STIG ASD_V5R3\": [\n      \"V-222608\"\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6418.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Hard-coding secrets in source code or binaries makes it easy for attackers to extract sensitive information, especially in distributed or\nopen-source applications. This practice exposes credentials and tokens, increasing the risk of unauthorized access and data breaches.</p>\n<p>This rule detects variables/fields/properties having a name matching a list of words (secret, token, credential, auth, api[_.-]?key) being assigned\na pseudorandom hard-coded value. The pseudorandomness of the hard-coded value is based on its entropy and the probability to be human-readable. The\nrandomness sensibility can be adjusted if needed. Lower values will detect less random values, raising potentially more false positives.</p>\n<h2>How to fix it</h2>\n<p>Secrets should be stored in a configuration file that is not committed to the code repository, in a database, or managed by your cloud provider’s\nsecrets management service. If a secret is exposed in the source code, it must be rotated immediately.</p>\n<h3>Code Examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nconst string mySecret = \"47828a8dd77ee1eb9dde2d5e93cb221ce8c32b37\";\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nstatic readonly string mySecret = Environment.GetEnvironmentVariable(\"MY_APP_SECRET\");\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures/\">Top 10 2021 Category A7 - Identification and\n  Authentication Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A2_2017-Broken_Authentication\">Top 10 2017 Category A2 - Broken\n  Authentication</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/798\">CWE-798 - Use of Hard-coded Credentials</a></li>\n  <li>MSC - <a href=\"https://wiki.sei.cmu.edu/confluence/x/OjdGBQ\">MSC03-J - Never hard code sensitive information</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6418.json",
    "content": "{\n  \"title\": \"Secrets should not be hard-coded\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"quickfix\": \"infeasible\",\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-6418\",\n  \"sqKey\": \"S6418\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CERT\": [\n      \"MSC03-J.\"\n    ],\n    \"CWE\": [\n      798\n    ],\n    \"OWASP\": [\n      \"A2\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A7\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"6.5.10\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"6.2.4\"\n    ],\n    \"ASVS 4.0\": [\n      \"2.10.4\",\n      \"3.5.2\",\n      \"6.4.1\"\n    ]\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6419.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>An Azure Function should be stateless as there’s no control over where and when function instances are provisioned and de-provisioned. Managing and\nstoring data/state between requests can lead to inconsistencies. If, for any reason, you need to have a stateful function, consider using the Durable\nFunctions extension of Azure Functions.</p>\n<h3>Noncompliant code example</h3>\n<pre>\n    public static class HttpExample\n    {\n        private static readonly int port = 2000;\n        private static int numOfRequests = 1;\n\n        [FunctionName(\"HttpExample\")]\n        public static async Task&lt;IActionResult&gt; Run( [HttpTrigger(AuthorizationLevel.Anonymous, \"get\", Route = null)] HttpRequest request, ILogger log)\n        {\n            numOfRequests += 1; // Noncompliant\n            log.LogInformation($\"Number of POST requests is {numOfRequests}.\");\n\n            string responseMessage = $\"HttpRequest was made on port {port}.\"; // Compliant, state is only read.\n\n            return new OkObjectResult(responseMessage);\n        }\n    }\n</pre>\n<h3>Compliant solution</h3>\n<pre>\n    public static class HttpExample\n    {\n        private static readonly int port = 2000;\n\n        [FunctionName(\"HttpExample\")]\n        public static async Task&lt;IActionResult&gt; Run( [HttpTrigger(AuthorizationLevel.Anonymous, \"get\", Route = null)] HttpRequest request, ILogger log)\n        {\n            // A compliant solution would be to manage the `numOfRequests` with an entity function or would use storage (e.g., Azure Blob storage, Azure Queue Storage)\n            // to share the state between functions.\n\n            string responseMessage = $\"HttpRequest was made on port {port}.\";\n\n            return new OkObjectResult(responseMessage);\n        }\n    }\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li><a href=\"https://docs.microsoft.com/en-us/azure/azure-functions/performance-reliability#write-functions-to-be-stateless\">Improve the performance\n  and reliability of Azure Functions</a></li>\n  <li><a href=\"https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-overview?tabs=csharp\">Durable Functions\n  Overview</a></li>\n  <li><a href=\"https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-entities?tabs=csharp\">Durable Functions - Entity\n  Functions</a></li>\n  <li><a href=\"https://docs.microsoft.com/en-us/azure/azure-functions/storage-considerations\">Storage considerations for Azure Functions</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6419.json",
    "content": "{\n  \"title\": \"Azure Functions should be stateless\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1h\"\n  },\n  \"tags\": [\n    \"azure\",\n    \"bad-practice\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6419\",\n  \"sqKey\": \"S6419\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6420.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>To avoid holding more connections than necessary and to avoid potentially exhausting the number of available sockets when using\n<code>HttpClient</code>, <code>DocumentClient</code>, <code>QueueClient</code>, <code>ConnectionMultiplexer</code> or Azure Storage clients,\nconsider:</p>\n<ul>\n  <li>Creating a single, thread-safe static client that every Azure Function invocation can use. Provide it in a shared class when different Azure\n  Functions need it.</li>\n  <li>Instantiate the client as a thread-safe Singleton or a pool of reusable instances and use it with dependency injection.</li>\n</ul>\n<p>These classes typically manage their own connections to the resource, and thus are intended to be instantiated once and reused throughout the\nlifetime of an application.</p>\n<h3>Noncompliant code example</h3>\n<pre>\n    public class HttpExample\n    {\n        [FunctionName(\"HttpExample\")]\n        public async Task&lt;IActionResult&gt; Run([HttpTrigger(AuthorizationLevel.Anonymous, \"get\", Route = null)] HttpRequest request)\n        {\n            HttpClient httpClient = new HttpClient(); // Noncompliant\n\n            var response = await httpClient.GetAsync(\"https://example.com\");\n            // rest of the function\n        }\n    }\n</pre>\n<h3>Compliant solution</h3>\n<pre>\n    public class HttpExample\n    {\n        [FunctionName(\"HttpExample\")]\n        public async Task&lt;IActionResult&gt; Run([HttpTrigger(AuthorizationLevel.Anonymous, \"get\", Route = null)] HttpRequest request, IHttpClientFactory clientFactory)\n        {\n            var httpClient = clientFactory.CreateClient();\n            var response = await httpClient.GetAsync(\"https://example.com\");\n            // rest of the function\n        }\n    }\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li><a href=\"https://docs.microsoft.com/en-us/azure/azure-functions/manage-connections?tabs=csharp#static-clients\">Manage connections in Azure\n  Functions: Static Clients</a></li>\n  <li><a href=\"https://docs.microsoft.com/en-us/azure/azure-functions/functions-dotnet-dependency-injection#service-lifetimes\">Azure Functions -\n  Dependency Injection: Service Lifetimes</a></li>\n  <li><a href=\"https://docs.microsoft.com/en-us/azure/architecture/antipatterns/improper-instantiation/\">Improper Instantiation antipattern</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6420.json",
    "content": "{\n  \"title\": \"Client instances should not be recreated on each Azure Function invocation\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"azure\",\n    \"bad-practice\",\n    \"design\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6420\",\n  \"sqKey\": \"S6420\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6421.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The top-most level of an Azure Function code should include a try/catch block to capture and log all errors so you can monitor the health of the\napplication effectively. In case a retry policy has been defined for your Azure Function, you should rethrow any errors that should result in a\nretry.</p>\n<h3>Noncompliant code example</h3>\n<pre>\n[FunctionName(\"HttpExample\")]\npublic static async Task&lt;IActionResult&gt; Run(\n    [HttpTrigger(AuthorizationLevel.Function, \"get\", \"post\", Route = null)] HttpRequest req)\n{\n    // Noncompliant\n    string requestBody = await new StreamReader(req.Body).ReadToEndAsync();\n    dynamic data = JsonConvert.DeserializeObject(requestBody);\n    // do stuff\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\n[FunctionName(\"HttpExample\")]\npublic static async Task&lt;IActionResult&gt; Run(\n    [HttpTrigger(AuthorizationLevel.Function, \"get\", \"post\", Route = null)] HttpRequest req)\n{\n    try\n    {\n        string requestBody = await new StreamReader(req.Body).ReadToEndAsync();\n        dynamic data = JsonConvert.DeserializeObject(requestBody);\n        // do stuff\n    }\n    catch (Exception ex)\n    {\n        // do stuff\n    }\n}\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li><a href=\"https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-error-pages?tabs=csharp\">Azure Functions error handling and\n  retries</a></li>\n  <li><a href=\"https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-error-pages?tabs=csharp#retry-policies-preview\">Azure\n  Functions retry policies</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6421.json",
    "content": "{\n  \"title\": \"Azure Functions should use Structured Error Handling\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1min\"\n  },\n  \"tags\": [\n    \"azure\",\n    \"error-handling\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6421\",\n  \"sqKey\": \"S6421\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6422.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Making <a href=\"https://en.wikipedia.org/wiki/Blocking_(computing)\">blocking calls</a> to <code>async</code> methods transforms the code into a\nsynchronous operation. Doing so inside an Azure Function can lead to thread pool exhaustion.</p>\n<p>Thread pool exhaustion refers to a situation where all available threads in a thread pool are occupied, and new tasks or work items cannot be\nscheduled for execution due to the lack of available threads. This can lead to delayed execution and degraded performance.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nclass RequestParser\n{\n\t[FunctionName(nameof(ParseRequest))]\n\tpublic static async Task&lt;IActionResult&gt; ParseRequest([HttpTrigger(AuthorizationLevel.Function, \"get\", \"post\", Route = null)] HttpRequest req)\n\t{\n\t\t// This can lead to thread exhaustion\n\t\tstring requestBody = new StreamReader(req.Body).ReadToEndAsync().Result;\n\t\t// do stuff...\n\t}\n}\n</pre>\n<p>Instead, <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/asynchronous-programming/\">asynchronous</a> mechanisms should be used:</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nclass RequestParser\n{\n\t[FunctionName(nameof(ParseRequest))]\n\tpublic static async Task&lt;IActionResult&gt; ParseRequest([HttpTrigger(AuthorizationLevel.Function, \"get\", \"post\", Route = null)] HttpRequest req)\n\t{\n\t\t// Non-blocking, asynchronous operation\n\t\tstring requestBody = await new StreamReader(req.Body).ReadToEndAsync();\n\t\t// do stuff...\n\t}\n}\n</pre>\n<p>This applies to multiple methods that are available when working with tasks:</p>\n<table>\n  <colgroup>\n    <col style=\"width: 33.3333%;\">\n    <col style=\"width: 33.3333%;\">\n    <col style=\"width: 33.3334%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>Goal</th>\n      <th>Blocking</th>\n      <th>Asynchronous</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p>Wait for the result of a task</p>\n      </td>\n      <td>\n        <p><code>Task.Wait</code>, <code>Task.Result</code> or <code>Task.GetAwaiter.GetResult</code></p>\n      </td>\n      <td>\n        <p><code>await</code></p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>Wait for any of many task to complete</p>\n      </td>\n      <td>\n        <p><code>Task.WaitAny</code></p>\n      </td>\n      <td>\n        <p><code>await Task.WhenAny</code></p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>Wait for all of many tasks to complete</p>\n      </td>\n      <td>\n        <p><code>Task.WaitAll</code></p>\n      </td>\n      <td>\n        <p><code>await Task.WhenAll</code></p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>Wait a period of time</p>\n      </td>\n      <td>\n        <p><code>Thread.Sleep</code></p>\n      </td>\n      <td>\n        <p><code>await Task.Delay</code></p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/archive/msdn-magazine/2013/march/async-await-best-practices-in-asynchronous-programming\">Async/Await - Best\n  Practices in Asynchronous Programming</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/azure/azure-functions/performance-reliability#use-async-code-but-avoid-blocking-calls\">Improve the\n  performance and reliability of Azure Functions - Scalability best practices</a></li>\n  <li>Github - <a href=\"https://github.com/davidfowl/AspNetCoreDiagnosticScenarios/blob/master/AsyncGuidance.md\">Async Guidance by David\n  Fowler</a></li>\n  <li>{rule:csharpsquid:S4462} - Calls to \"async\" methods should not be blocking (a more general version of this rule)</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6422.json",
    "content": "{\n  \"title\": \"Calls to \\\"async\\\" methods should not be blocking in Azure Functions\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"azure\",\n    \"async-await\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-6422\",\n  \"sqKey\": \"S6422\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6423.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Capturing and logging errors is critical to monitoring the health of your Azure Functions application.</p>\n<p>Each <code>catch</code> block inside an Azure Function should log helpful details about the failure. Moreover, the logging should not be done at\n<code>Debug</code> or <code>Trace</code> level.</p>\n<p>Consider using the built-in integration with Application Insights for better monitoring of your Application.</p>\n<h3>Noncompliant code example</h3>\n<pre>\n[FunctionName(\"Foo\")]\npublic static async Task&lt;IActionResult&gt; Run(\n\t[HttpTrigger(AuthorizationLevel.Anonymous, \"get\", \"post\", Route = null)] HttpRequest req,\n\tILogger log)\n{\n\ttry\n\t{\n\t\t// do stuff that can fail\n\t}\n\tcatch (Exception ex)\n\t{\n\t\t// the failure is not logged at all OR is logged at DEBUG/TRACE level\n\t}\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\n[FunctionName(\"Foo\")]\npublic static async Task&lt;IActionResult&gt; Run(\n\t[HttpTrigger(AuthorizationLevel.Anonymous, \"get\", \"post\", Route = null)] HttpRequest req,\n\tILogger log)\n{\n\ttry\n\t{\n\t\t// do stuff that can fail\n\t}\n\tcatch (Exception ex)\n\t{\n\t\tlog.LogError(ex, \"Give details that will help investigations\");\n\t}\n}\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li><a href=\"https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-error-pages?tabs=csharp\">Azure Functions error handling and\n  retries</a></li>\n  <li><a href=\"https://docs.microsoft.com/en-us/azure/azure-functions/functions-monitoring\">Monitor Azure Functions</a></li>\n  <li><a href=\"https://docs.microsoft.com/en-us/azure/azure-monitor/app/azure-functions-supported-features\">Application Insights for Azure Functions\n  supported features</a></li>\n  <li>STIG Viewer - <a href=\"https://stigviewer.com/stigs/application_security_and_development/2024-12-06/finding/V-222610\">Application Security and\n  Development: V-222610</a> - The application must generate error messages that provide information necessary for corrective actions without revealing\n  information that could be exploited by adversaries.</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6423.json",
    "content": "{\n  \"title\": \"Azure Functions should log all failures\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"azure\",\n    \"error-handling\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6423\",\n  \"sqKey\": \"S6423\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"STIG ASD_V5R3\": [\n      \"V-222610\"\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6424.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The recommended way to access Azure Durable Entities is through generated proxy objects with the help of interfaces.</p>\n<p>The following restrictions, during interface design, are enforced:</p>\n<ul>\n  <li>Entity interfaces must be defined in the same assembly as the entity class. This is not detected by the rule.</li>\n  <li>Entity interfaces must only define methods.</li>\n  <li>Entity interfaces must not contain generic parameters.</li>\n  <li>Entity interface methods must not have more than one parameter.</li>\n  <li>Entity interface methods must return void, Task, or Task&lt;T&gt;.</li>\n</ul>\n<p>If any of these rules are violated, an <code>InvalidOperationException</code> is thrown at runtime when the interface is used as a type argument to\n<code>IDurableEntityContext.SignalEntity&lt;TEntityInterface&gt;</code>, <code>IDurableEntityClient.SignalEntityAsync&lt;TEntityInterface&gt;</code>\nor <code>IDurableOrchestrationContext.CreateEntityProxy&lt;TEntityInterface&gt;</code>. The exception message explains which rule was broken.</p>\n<p>This rule raises an issue in case any of the restrictions above is not respected.</p>\n<h3>Noncompliant code example</h3>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nnamespace Foo // Noncompliant, must be defined in the same assembly as the entity class that implements it\n{\n    public interface ICounter&lt;T&gt; // Noncompliant, interfaces cannot contain generic parameters\n    {\n        string Name { get; set; } // Noncompliant, interface must only define methods\n        void Add(int amount, int secondParameter); // Noncompliant, methods must not have more than one parameter\n        int Get(); // Noncompliant, methods must return void, Task, or Task&lt;T&gt;\n    }\n}\n\nnamespace Bar\n{\n    public class Counter : ICounter\n    {\n        // do stuff\n    }\n\n    public static class AddToCounterFromQueue\n    {\n        [FunctionName(\"AddToCounterFromQueue\")]\n        public static Task Run(\n            [QueueTrigger(\"durable-function-trigger\")] string input,\n            [DurableClient] IDurableEntityClient client)\n        {\n            var entityId = new EntityId(\"Counter\", \"myCounter\");\n            int amount = int.Parse(input);\n            return client.SignalEntityAsync&lt;ICounter&gt;(entityId, proxy =&gt; proxy.Add(amount, 10));\n        }\n    }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nnamespace Bar\n{\n    public interface ICounter\n    {\n        void Add(int amount);\n        Task&lt;int&gt; Get();\n    }\n}\n\nnamespace Bar\n{\n    public class Counter : ICounter\n    {\n        // do stuff\n    }\n\n    public static class AddToCounterFromQueue\n    {\n        [FunctionName(\"AddToCounterFromQueue\")]\n        public static Task Run(\n            [QueueTrigger(\"durable-function-trigger\")] string input,\n            [DurableClient] IDurableEntityClient client)\n        {\n            var entityId = new EntityId(\"Counter\", \"myCounter\");\n            int amount = int.Parse(input);\n            return client.SignalEntityAsync&lt;ICounter&gt;(entityId, proxy =&gt; proxy.Add(amount));\n        }\n    }\n}\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li><a\n  href=\"https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-dotnet-entities#restrictions-on-entity-interfaces\">Restrictions on Entity Interfaces</a></li>\n  <li><a href=\"https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-entities?tabs=csharp\">Durable Entities</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.webjobs.extensions.durabletask.idurableentitycontext.signalentity?view=azure-dotnet\">IDurableEntityContext.SignalEntity</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.webjobs.extensions.durabletask.idurableentityclient.signalentityasync?view=azure-dotnet\">IDurableEntityClient.SignalEntityAsync</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.webjobs.extensions.durabletask.idurableorchestrationcontext.createentityproxy?view=azure-dotnet\">IDurableOrchestrationContext.CreateEntity</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6424.json",
    "content": "{\n  \"title\": \"Interfaces for durable entities should satisfy the restrictions\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"tags\": [\n    \"azure\",\n    \"design\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-6424\",\n  \"sqKey\": \"S6424\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6444.html",
    "content": "<p>Not specifying a timeout for regular expressions can lead to a Denial-of-Service attack. Pass a timeout when using\n<code>System.Text.RegularExpressions</code> to process untrusted input because a malicious user might craft a value for which the evaluation lasts\nexcessively long.</p>\n<h2>Ask Yourself Whether</h2>\n<ul>\n  <li>the input passed to the regular expression is untrusted.</li>\n  <li>the regular expression contains patterns vulnerable to <a href=\"https://www.regular-expressions.info/catastrophic.html\">catastrophic\n  backtracking</a>.</li>\n</ul>\n<p>There is a risk if you answered yes to any of those questions.</p>\n<h2>Recommended Secure Coding Practices</h2>\n<ul>\n  <li>It is recommended to specify a <a\n  href=\"https://learn.microsoft.com/dotnet/standard/base-types/best-practices#use-time-out-values\"><code>matchTimeout</code></a> when executing a\n  regular expression.</li>\n  <li>Make sure regular expressions are not vulnerable to Denial-of-Service attacks by reviewing the patterns.</li>\n  <li>Consider using a non-backtracking algorithm by specifying <a\n  href=\"https://learn.microsoft.com/dotnet/api/system.text.regularexpressions.regexoptions?view=net-7.0\"><code>RegexOptions.NonBacktracking</code></a>.</li>\n</ul>\n<h2>Sensitive Code Example</h2>\n<pre>\npublic void RegexPattern(string input)\n{\n    var emailPattern = new Regex(\".+@.+\", RegexOptions.None);\n    var isNumber = Regex.IsMatch(input, \"[0-9]+\");\n    var isLetterA = Regex.IsMatch(input, \"(a+)+\");\n}\n</pre>\n<h2>Compliant Solution</h2>\n<pre>\npublic void RegexPattern(string input)\n{\n    var emailPattern = new Regex(\".+@.+\", RegexOptions.None, TimeSpan.FromMilliseconds(100));\n    var isNumber = Regex.IsMatch(input, \"[0-9]+\", RegexOptions.None, TimeSpan.FromMilliseconds(100));\n    var isLetterA = Regex.IsMatch(input, \"(a+)+\", RegexOptions.NonBacktracking); // .Net 7 and above\n    AppDomain.CurrentDomain.SetData(\"REGEX_DEFAULT_MATCH_TIMEOUT\", TimeSpan.FromMilliseconds(100)); // process-wide setting\n}\n</pre>\n<h2>See</h2>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A1_2017-Injection\">Top 10 2017 Category A1 - Injection</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/400\">CWE-400 - Uncontrolled Resource Consumption</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/1333\">CWE-1333 - Inefficient Regular Expression Complexity</a></li>\n  <li><a href=\"https://www.regular-expressions.info/catastrophic.html\">regular-expressions.info</a> - Runaway Regular Expressions: Catastrophic\n  Backtracking</li>\n  <li><a href=\"https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS\">owasp.org</a> - Regular expression Denial of\n  Service - ReDoS</li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/1333\">CWE-1333 - Inefficient Regular Expression Complexity</a></li>\n  <li><a href=\"https://docs.microsoft.com/dotnet/standard/base-types/best-practices\">docs.microsoft.com</a> - Best practices for regular expressions\n  in .NET</li>\n  <li><a href=\"https://docs.microsoft.com/dotnet/standard/base-types/backtracking-in-regular-expressions\">docs.microsoft.com</a> - Backtracking in\n  Regular Expressions</li>\n  <li><a\n  href=\"https://devblogs.microsoft.com/dotnet/regular-expression-improvements-in-dotnet-7/#backtracking-and-regexoptions-nonbacktracking\">devblogs.microsoft.com</a> - Regular Expression Improvements in .NET 7: Backtracking (and RegexOptions.NonBacktracking)</li>\n  <li><a href=\"https://docs.microsoft.com/dotnet/api/system.text.regularexpressions.regex.matchtimeout\">docs.microsoft.com</a> - Regex.MatchTimeout\n  Property</li>\n  <li><a href=\"https://docs.microsoft.com/dotnet/api/system.text.regularexpressions.regexoptions?view=net-7.0\">docs.microsoft.com</a> - RegexOptions\n  Enum (NonBacktracking option)</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6444.json",
    "content": "{\n  \"title\": \"Not specifying a timeout for regular expressions is security-sensitive\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"regex\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6444\",\n  \"sqKey\": \"S6444\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      400,\n      1333\n    ],\n    \"OWASP\": [\n      \"A1\"\n    ]\n  },\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6507.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Locking on a local variable can undermine synchronization because two different threads running the same method in parallel will potentially lock\non different instances of the same object, allowing them to access the synchronized block at the same time.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nprivate void DoSomething()\n{\n  object local = new object();\n  // Code potentially modifying the local variable ...\n\n  lock (local) // Noncompliant\n  {\n    // ...\n  }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nprivate readonly object lockObj = new object();\n\nprivate void DoSomething()\n{\n  lock (lockObj)\n  {\n    //...\n  }\n}\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/lock\">Lock Statement</a> - lock statement - ensure\n  exclusive access to a shared resource</li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/412\">CWE-412 - Unrestricted Externally Accessible Lock</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/413\">CWE-413 - Improper Resource Locking</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6507.json",
    "content": "{\n  \"title\": \"Blocks should not be synchronized on local variables\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"multi-threading\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6507\",\n  \"sqKey\": \"S6507\",\n  \"scope\": \"All\",\n  \"securityStandards\": {\n    \"CWE\": [\n      412,\n      413\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6513.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The <a\nhref=\"https://learn.microsoft.com/dotnet/api/system.diagnostics.codeanalysis.excludefromcodecoverageattribute\">ExcludeFromCodeCoverageAttribute</a> is\nused to exclude portions of code from <a href=\"https://learn.microsoft.com/dotnet/core/testing/unit-testing-code-coverage\">code coverage\nreporting</a>. It is a bad practice to retain code that is not covered by unit tests. In .Net 5, the <code>Justification</code> property was added to\nthe <code>ExcludeFromCodeCoverageAttribute</code> as an opportunity to document the rationale for the exclusion. This rule raises an issue when no\nsuch justification is given.</p>\n<h3>Noncompliant code example</h3>\n<pre>\npublic struct Coordinates\n{\n    public int X { get; }\n    public int Y { get; }\n\n    [ExcludeFromCodeCoverage] // Noncompliant\n    public override bool Equals(object obj) =&gt; obj is Coordinates coordinates &amp;&amp; X == coordinates.X &amp;&amp; Y == coordinates.Y;\n\n    [ExcludeFromCodeCoverage] // Noncompliant\n    public override int GetHashCode()\n    {\n        var hashCode = 1861411795;\n        hashCode = hashCode * -1521134295 + X.GetHashCode();\n        hashCode = hashCode * -1521134295 + Y.GetHashCode();\n        return hashCode;\n    }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic struct Coordinates\n{\n    public int X { get; }\n    public int Y { get; }\n\n    [ExcludeFromCodeCoverage(Justification = \"Code generated by Visual Studio refactoring\")] // Compliant\n    public override bool Equals(object obj) =&gt; obj is Coordinates coordinates &amp;&amp; X == coordinates.X &amp;&amp; Y == coordinates.Y;\n\n    [ExcludeFromCodeCoverage(Justification = \"Code generated by Visual Studio refactoring\")] // Compliant\n    public override int GetHashCode()\n    {\n        var hashCode = 1861411795;\n        hashCode = hashCode * -1521134295 + X.GetHashCode();\n        hashCode = hashCode * -1521134295 + Y.GetHashCode();\n        return hashCode;\n    }\n}\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/dotnet/api/system.diagnostics.codeanalysis.excludefromcodecoverageattribute\">API browser</a> -\n  ExcludeFromCodeCoverageAttribute</li>\n  <li><a href=\"https://learn.microsoft.com/dotnet/core/testing/unit-testing-code-coverage\">DevOps and testing</a> - Code coverage reporting</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6513.json",
    "content": "{\n  \"title\": \"\\\"ExcludeFromCodeCoverage\\\" attributes should include a justification\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"bad-practice\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-6513\",\n  \"sqKey\": \"S6513\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6561.html",
    "content": "<p>The rule targets the use of <code>DateTime.Now</code> call followed by some arithmetic operation.</p>\n<h2>Why is this an issue?</h2>\n<p>Using <code>DateTime.Now</code> calls within a subtraction operation to measure elapsed time is not recommended. This property is subject to\nchanges such as daylight savings transitions, which can invalidate the calculation if the change occurs during the benchmark session, or when updating\na timer. Moreover, <code>DateTime.Now</code> is dependent on the system clock, which may have low resolution on older systems (as low as 15\nmilliseconds).</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<p>If the purpose is to benchmark something then, instead of the <code>DateTime.Now</code> property, it’s recommended to use <code>Stopwatch</code>,\nwhich is not affected by changes in time such as daylight savings (DST) and automatically checks for the existence of high-precision timers. As a\nbonus, the <code>StopWatch</code> class is also lightweight and computationally faster than <code>DateTime</code>.</p>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nvar start = DateTime.Now; // First call, on March 26th 2:59 am\nMethodToBeBenchmarked();\n\nConsole.WriteLine($\"{(DateTime.Now - start).TotalMilliseconds} ms\"); // Second call happens 2 minutes later but `Now` is March 26th, 4:01 am as there's a shift to summer time\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nvar stopWatch = Stopwatch.StartNew(); // Compliant\nMethodToBeBenchmarked();\nstopWatch.Stop();\n\nConsole.WriteLine($\"{stopWatch.ElapsedMilliseconds} ms\");\n</pre>\n<p>If, on the other hand, the goal is to refresh a timer prefer using the <code>DateTime.UtcNow</code> property, which guarantees reliable results\nwhen doing arithmetic operations during DST transitions.</p>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nif ((DateTime.Now - lastRefresh).TotalMilliseconds &gt; MinRefreshInterval)\n{\n    lastRefresh = DateTime.Now;\n    // Refresh\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nif ((DateTime.UtcNow - lastRefresh).TotalMilliseconds &gt; MinRefreshInterval)\n{\n    lastRefresh = DateTime.UtcNow;\n    // Refresh\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetime?#datetime-resolution\">DateTime resolution</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetime.now\">DateTime.Now</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.stopwatch?\">Stopwatch class documentation</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6561.json",
    "content": "{\n  \"title\": \"Avoid using \\\"DateTime.Now\\\" for benchmarking or timing operations\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6561\",\n  \"sqKey\": \"S6561\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6562.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Not knowing the <code>Kind</code> of the <code>DateTime</code> object that an application is using can lead to misunderstandings when displaying or\ncomparing them. Explicitly setting the <code>Kind</code> property helps the application to stay consistent, and its maintainers understand what kind\nof date is being managed. To achieve this, when instantiating a new <code>DateTime</code> object you should always use a constructor overload that\nallows you to define the <code>Kind</code> property.</p>\n<h3>What is the potential impact?</h3>\n<p>Creating the <code>DateTime</code> object without specifying the property <code>Kind</code> will set it to the default value of\n<code>DateTimeKind.Unspecified</code>. In this case, calling the method <code>ToUniversalTime</code> will assume that <code>Kind</code> is\n<code>DateTimeKind.Local</code> and calling the method <code>ToLocalTime</code> will assume that it’s <code>DateTimeKind.Utc</code>. As a result, you\nmight have mismatched <code>DateTime</code> objects in your application.</p>\n<h2>How to fix it</h2>\n<p>To resolve this issue, use a <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetime.-ctor\">constructor overload</a> that lets you\nspecify the <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetimekind\"><code>DateTimeKind</code></a> when creating the\n<code>DateTime</code> object. From .Net 6 onwards, use the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.dateonly\"><code>DateOnly</code></a> type if the time portion of the date is not\nrelevant.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nvoid CreateNewTime()\n{\n    var birthDate = new DateTime(1994, 7, 5, 16, 23, 42);\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nvoid CreateNewTime()\n{\n    var birthDate = new DateTime(1994, 7, 5, 16, 23, 42, DateTimeKind.Utc);\n    // or from .Net 6 onwards, use DateOnly:\n    var birthDate = new DateOnly(1994, 7, 5);\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetimekind\">DateTimeKind Enum</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetime.-ctor\">DateTime Constructors</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.dateonly\">DateOnly Struct</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/standard/base-types/how-to-round-trip-date-and-time-values\">How to:\n  Round-trip Date and time values</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/standard/design-guidelines/member-overloading\">Member Overloading</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6562.json",
    "content": "{\n  \"title\": \"Always set the \\\"DateTimeKind\\\" when creating new \\\"DateTime\\\" instances\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"localisation\",\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6562\",\n  \"sqKey\": \"S6562\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6563.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>You should avoid recording time instants with the use of property <code>DateTime.Now</code>. The property <code>DateTime.Now</code> returns the\ncurrent date and time expressed in the machine’s local time without containing any timezone-related information (for example, the offset from\nCoordinated Universal Time). Not having this information means that if you need to display this <code>DateTime</code> object or use it for\ncomputations in another machine placed in a different time zone, you won’t be able to reconstruct it in the second machine’s local time without\nknowing the origin’s offset. This will likely lead to confusion and potential bugs.</p>\n<p>Instead, you should record the <code>DateTime</code> instants in UTC, which gives you the date and time as it is in the Coordinated Universal Time.\nUTC is a time standard for all time zones and is not subjected to Daylight Saving Time (DST).</p>\n<p>Similarly, the use of the <code>DateTime.Today</code> property should also be avoided, as it can return different date values depending on the time\nzone.</p>\n<p>Generally, unless the purpose is to only display the Date and Time to a user on their local machine, you should always use UTC (for example, when\nstoring dates in a datebase or using them for calculations).</p>\n<h3>What is the potential impact?</h3>\n<p>You can end up with <code>DateTime</code> instants that have no meaning for anyone except the machine they were recorded on. Using UTC gives an\nunambiguous representation of an instant, and this UTC instant can be transformed into any equivalent local time. This operation isn’t reversible as\nsome local times are ambiguous and can be matched to more than one UTC instant (for example, due to daylight savings).</p>\n<h2>How to fix it</h2>\n<p>Instead of <code>DateTime.Now</code> use any of the following:</p>\n<ul>\n  <li><code>DateTime.UtcNow</code>,</li>\n  <li><code>DateTimeOffSet.Now</code> (as it contains offset information)</li>\n  <li><code>DateTimeOffSet.UtcNow</code></li>\n</ul>\n<p>Instead of <code>DateTime.Today</code> use any of the following:</p>\n<ul>\n  <li><code>DateTime.UtcNow.Date</code>,</li>\n  <li><code>DateOnly.FromDateTime(DateTime.UtcNow)</code> (.NET 6.0+)</li>\n</ul>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nvoid LogDateTime()\n{\n    using var streamWriter = new StreamWriter(\"logs.txt\", true);\n    streamWriter.WriteLine($\"DateTime:{DateTime.Now.ToString(\"o\")}\"); // This log won't have any meaning if it's reconstructed in a machine in a different timezone.\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nvoid LogDateTime()\n{\n    using var streamWriter = new StreamWriter(\"logs.txt\", true);\n    streamWriter.WriteLine($\"DateTime:{DateTime.UtcNow.ToString(\"o\")}\");\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetime.now\">DateTime.Now Property</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetime.utcnow\">DateTime.UtcNow Property</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetime.today\">DateTime.Today Property</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetimeoffset\">DateTimeOffset Struct</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.dateonly.fromdatetime\">DateOnly.FromDateTime(DateTime)\n  Method</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/standard/datetime/resolve-ambiguous-times\">How to: Resolve ambiguous\n  times</a></li>\n  <li>Time and Date - <a href=\"https://www.timeanddate.com/time/zone/timezone/utc\">Time Zone in UTC - What Is UTC?</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li>StackOverflow - <a href=\"https://stackoverflow.com/a/2580518\">Ambiguous times by John Skeet</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6563.json",
    "content": "{\n  \"title\": \"Use UTC when recording DateTime instants\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6563\",\n  \"sqKey\": \"S6563\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6566.html",
    "content": "<p>This rule recommends using <code>DateTimeOffset</code> instead of <code>DateTime</code> for projects targeting .NET Framework 2.0 or later.</p>\n<h2>Why is this an issue?</h2>\n<p>You should use <code>DateTimeOffset</code> instead of <code>DateTime</code> as it provides all the information that the <code>DateTime</code>\nstruct has, and additionally, the offset from Coordinated Universal Time (UTC). This way you can avoid potential problems created by the lack of\ntimezone awareness (see the \"Pitfalls\" section below for more information).</p>\n<p>However, it’s important to note that although <code>DateTimeOffset</code> contains more information than <code>DateTime</code> by storing the\noffset to UTC, it isn’t tied to a specific time zone. This information must be stored separately to have a full picture of the moment in time with the\nuse of <code>TimeZoneInfo</code>.</p>\n<h2>How to fix it</h2>\n<p>In most cases, you can directly replace <code>DateTime</code> with <code>DateTimeOffset</code>. When hardcoding dates with local kind, remember\nthat the offset is timezone dependent, so it should be set according to which timezone that data represents. For more information, refer to\n<code>DateTime</code> and <code>DateTimeOffset</code> documentation from Microsoft (see the \"Resources\" section below).</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nDateTime myDate = new DateTime(2008, 6, 19, 7, 0, 0, DateTimeKind.Local); // Noncompliant\n\nvar now = DateTime.Now; // Noncompliant\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nDateTimeOffset myDate = new DateTimeOffset(2008, 6, 19, 7, 0, 0, TimeSpan.FromHours(-7)); // Compliant\n\nvar now = DateTimeOffset.Now; // Compliant\n</pre>\n<h3>Pitfalls</h3>\n<p>Common <code>DateTime</code> pitfalls include:</p>\n<ul>\n  <li>when working with <code>DateTime</code> of kind <code>Local</code> consider the time offset of the machine where the program is running. Not\n  storing the offset from UTC separately can result in meaningless data when retrieved from a different location.</li>\n  <li>when working with <code>DateTime</code> of kind <code>Unknown</code>, calling <code>ToUniversalTime()</code> presumes the\n  <code>DateTime.Kind</code> is local and converts to UTC, if you call the method <code>ToLocalTime()</code>, it assumes the\n  <code>DateTime.Kind</code> is UTC and converts it to local.</li>\n  <li>when comparing <code>DateTimes</code> objects, the user must ensure they are within the same time zone. <code>DateTime</code> doesn’t consider\n  UTC/Local when comparing; it only cares about the number of <code>Ticks</code> on the objects.</li>\n</ul>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/datetime/converting-between-datetime-and-offset?redirectedfrom=MSDN\">Converting\n  between DateTime and DateTimeOffset</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/datetime/choosing-between-datetime\">Choose between DateTime, DateOnly,\n  DateTimeOffset, TimeSpan, TimeOnly, and TimeZoneInfo</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/datetime/performing-arithmetic-operations\">Performing arithmetic operations with\n  dates and times</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.timezoneinfo\">TimeZoneInfo documentation</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6566.json",
    "content": "{\n  \"title\": \"Use \\\"DateTimeOffset\\\" instead of \\\"DateTime\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6566\",\n  \"sqKey\": \"S6566\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6575.html",
    "content": "<p>Since .NET 6 you don’t have to use the <code>TimeZoneConverter</code> library to manually do the conversion between IANA and Windows timezones. The\n.NET 6.0 introduced new Time Zone enhancements, one being the <code>TimeZoneInfo.FindSystemTimeZoneById(string timezone)</code> method now accepts as\ninput both IANA and Windows time zone IDs on any operating system with installed time zone data. <code>TimeZoneInfo.FindSystemTimeZoneById</code> will\nautomatically convert its input from IANA to Windows and vice versa if the requested time zone is not found on the system.</p>\n<h2>Why is this an issue?</h2>\n<p>The method <code>TimeZoneInfo.FindSystemTimeZoneById(string timezone)</code> can get both IANA and Windows timezones as input and automatically\nconvert one to the other if the requested time zone is not found on the system. Because one does not need to handle the conversion, the code will be\nless complex and easier to maintain.</p>\n<h2>How to fix it</h2>\n<p>There’s no need to translate manually between time zones; it is enough to call <code>TimeZoneInfo.FindSystemTimeZoneById(string timezone)</code>,\nwhere the timezone can be IANA or Windows format. Depending on the OS, the equivalent time zone will be returned (Windows Time Zones for Windows and\nIANA timezones for Linux, macOS).</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\n// Assuming we are in Windows OS and we need to get the Tokyo Time Zone.\nvar ianaTimeZone = \"Asia/Tokyo\";\nvar windowsTimeZone = TZConvert.IanaToWindows(ianaTimeZone);\nTimeZoneInfo tokyoWindowsTimeZone = TimeZoneInfo.FindSystemTimeZoneById(windowsTimeZone);\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n// Assuming we are in Windows OS and we need to get the Tokyo Time Zone.\nvar ianaTimeZone = \"Asia/Tokyo\";\nTimeZoneInfo tokyoWindowsTimeZone = TimeZoneInfo.FindSystemTimeZoneById(ianaTimeZone);\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.timezoneinfo.findsystemtimezonebyid\">TimeZoneInfo.FindSystemTimeZoneById\n  documentation</a></li>\n  <li><a href=\"https://devblogs.microsoft.com/dotnet/date-time-and-time-zone-enhancements-in-net-6/\">Date, Time, and Time Zone Enhancements in .NET\n  6</a></li>\n  <li><a href=\"https://github.com/mattjohnsonpint/TimeZoneConverter\">TimeZoneConverter</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li><a href=\"https://codeblog.jonskeet.uk/2022/02/05/whats-up-with-timezoneinfo-on-net-6-part-1/\">What’s up with TimeZoneInfo on .NET 6?</a></li>\n</ul>\n<h3>Standards</h3>\n<ul>\n  <li><a href=\"https://www.iana.org/time-zones\">IANA Time Zone Database</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11\">Windows Time Zones</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6575.json",
    "content": "{\n  \"title\": \"Use \\\"TimeZoneInfo.FindSystemTimeZoneById\\\" without converting the timezones with \\\"TimezoneConverter\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6575\",\n  \"sqKey\": \"S6575\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6580.html",
    "content": "<p>When converting a string representation of a date and time to a <code>DateTime</code> object or any other temporal type with one of the available\nsystem parsing methods, you should always provide an <code>IFormatProvider</code> parameter.</p>\n<h2>Why is this an issue?</h2>\n<p>If you try to parse a string representation of a date or time without a format provider, the method will use the machine’s\n<code>CultureInfo</code>; if the given string does not follow it, you’ll have an object that does not match the string representation or an unexpected\nruntime error.</p>\n<p>This rule raises an issue for the following date and time string representation parsing methods:</p>\n<ul>\n  <li><code>Parse</code></li>\n  <li><code>ParseExact</code></li>\n  <li><code>TryParse</code></li>\n  <li><code>TryParseExact</code></li>\n</ul>\n<p>Of the following types:</p>\n<ul>\n  <li><code>System.DateOnly</code></li>\n  <li><code>System.DateTime</code></li>\n  <li><code>System.DateTimeOffset</code></li>\n  <li><code>System.TimeOnly</code></li>\n  <li><code>System.TimeSpan</code></li>\n</ul>\n<h2>How to fix it</h2>\n<p>Alway use an overload of the parse method, where you can provide an <code>IFormatProvider</code> parameter.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nvar dateTimeString = \"4/12/2023 4:05:48 PM\"; // This is an en-US format string - 12 of April 2023\nvar dateTimeObject = DateTime.Parse(dateTimeString); // This is wrongly parsed as 4th of December, when it's read in a machine with \"CultureInfo.CurrentCulture\" en-150 (English Europe)\n\nvar dateTimeString2 = \"4/13/2023 4:05:48 PM\"; // This is an en-US format string - 13 of April 2023\nvar dateTimeObject2 = DateTime.Parse(dateTimeString2); // Runtime Error, when it's parsed in a machine with \"CultureInfo.CurrentCulture\" en-150 (English Europe).\n\nvar timeInSaudiArabia = new TimeOnly(16, 23).ToString(new CultureInfo(\"ar-SA\"));\nvar timeObject = TimeOnly.Parse(timeInSaudiArabia); // Runtime Error, when it's parsed in a machine with \"CultureInfo.CurrentCulture\" en-150 (English Europe).\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nvar dateTimeString = \"4/12/2023 4:05:48 PM\"; // This is an en-US format string - 12 of April 2023\nvar dateTimeObject = DateTime.Parse(dateTimeString, new CultureInfo(\"en-US\"));\n\nvar dateTimeString2 = \"4/13/2023 4:05:48 PM\"; // This is an en-US format string - 13 of April 2023\nvar dateTimeObject2 = DateTime.Parse(dateTimeString2, new CultureInfo(\"en-US\"))\n\nvar timeInSaudiArabia = new TimeOnly(16, 23).ToString(new CultureInfo(\"ar-SA\"));\nvar timeObject = TimeOnly.Parse(timeInSaudiArabia, new CultureInfo(\"ar-SA\"));\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetime.parse\">DateTime.Parse method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetime.parseexact\">DateTime.ParseExact method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetime.tryparse\">DateTime.TryParse method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetime.tryparseexact\">DateTime.TryParseExact method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.dateonly\">DateOnly type</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetime\">DateTime type</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetimeoffset\">DateTimeOffset type</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.timeonly\">TimeOnly type</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.timespan\">TimeSpan type</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.globalization.cultureinfo\">Culture Info class documentation</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings\">Standard date and time format\n  strings</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6580.json",
    "content": "{\n  \"title\": \"Use a format provider when parsing date and time\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"pitfall\",\n    \"bug\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6580\",\n  \"sqKey\": \"S6580\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6585.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Hardcoding the date and time format strings can lead to formats that consumers misunderstand. Also, if the same format is meant to be used in\nmultiple places, it is easier to make a mistake when it’s hardcoded instead of using a format provided by an <code>IFormatProvider</code> or using one\nof the standard format strings.</p>\n<h3>What is the potential impact?</h3>\n<p>If a non-conventional format is used, the formatted date and time can be misunderstood. Also, if a mistake is made in the format, the formatted\ndate can be incomplete. For example, you might switch the place of the minutes and month parts of a date or simply forget to print the year.</p>\n<h2>How to fix it</h2>\n<p>Instead of hardcoding the format, provide one from the available formats through an <code>IFormatProvider</code> or use one of the standard format\nstrings.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nvoid PrintTime()\n{\n    Console.WriteLine(DateTime.UtcNow.ToString(\"dd/MM/yyyy HH:mm:ss\"));\n\n    Console.WriteLine(DateTime.UtcNow.ToString(\"dd/mm/yyyy HH:MM:ss\")); // Months and minutes have changed their places\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nvoid PrintTime()\n{\n    Console.WriteLine(DateTime.UtcNow.ToString(CultureInfo.GetCultureInfo(\"es-MX\")));\n\n    Console.WriteLine(DateTime.UtcNow.ToString(CultureInfo.InvariantCulture)); // Better provide a well known culture, so this kind of issues do not pop up\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.iformatprovider\">IFormatProvider documentation</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.globalization.cultureinfo\">CultureInfo documentation</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings\">Standard date and time format\n  strings</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings\">Custom date and time format\n  strings</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-timespan-format-strings\">Standard TimeSpan format\n  strings</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/base-types/custom-timespan-format-strings\">Custom TimeSpan format strings</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6585.json",
    "content": "{\n  \"title\": \"Don\\u0027t hardcode the format when turning dates and times to strings\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-6585\",\n  \"sqKey\": \"S6585\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6588.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>With .NET Core the <code>UnixEpoch</code> field was introduced to <code>DateTime</code> and <code>DateTimeOffset</code> types. Using this field\nclearly states that the intention is to use the beginning of the Unix epoch.</p>\n<h3>What is the potential impact?</h3>\n<p>You should not use the <code>DateTime</code> or <code>DateTimeOffset</code> constructors to set the time to the 1st of January 1970 to represent\nthe beginning of the Unix epoch. Not everyone is familiar with what this particular date is representing and it can be misleading.</p>\n<h2>How to fix it</h2>\n<p>To fix this issue, use the <code>UnixEpoch</code> field of <code>DateTime</code> or <code>DateTimeOffset</code> instead of the constructor.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nvoid GetEpochTime()\n{\n    var epochTime = new DateTime(1970, 1, 1);\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nvoid GetEpochTime()\n{\n    var epochTime = DateTime.UnixEpoch;\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetime.unixepoch\">DateTime.UnixEpoch documentation</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetimeoffset.unixepoch\">DateTimeOffset.UnixEpoch documentation</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Unix_time\">Unix time</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6588.json",
    "content": "{\n  \"title\": \"Use the \\\"UnixEpoch\\\" field instead of creating \\\"DateTime\\\" instances that point to the beginning of the Unix epoch\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-6588\",\n  \"sqKey\": \"S6588\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6602.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Both the <code>List.Find</code> method and the <code>Enumerable.FirstOrDefault</code> method can be used to locate the first element that meets a\nspecified condition within a collection. However, for <code>List</code> objects, <code>List.Find</code> may offer superior performance compared to\n<code>Enumerable.FirstOrDefault</code>. While the performance difference might be negligible for small collections, it can become significant for\nlarger collections. This observation also holds true for <code>ImmutableList</code> and arrays.</p>\n<p>It is important to enable this rule with caution, as performance outcomes can vary significantly across different runtimes. Notably, the <a\nhref=\"https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-9/#collections\">performance improvements in .NET 9</a> have brought\n<code>FirstOrDefault</code> closer to the performance of collection-specific <code>Find</code> methods in most scenarios.</p>\n<p><strong>Applies to</strong></p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1.find\">List</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.array.find\">Array</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable.immutablelist-1.find\">ImmutableList</a></li>\n</ul>\n<h3>What is the potential impact?</h3>\n<p>We measured at least 2x improvement in the execution time. For more details see the <code>Benchmarks</code> section from the <code>More info</code>\ntab.</p>\n<h2>How to fix it</h2>\n<p>The <code>Find</code> method is defined on the collection class, and it has the same signature as <code>FirstOrDefault</code> extension method. The\nfunction can be replaced in place.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nint GetValue(List&lt;int&gt; data) =&gt;\n    data.FirstOrDefault(x =&gt; x % 2 == 0);\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nint GetValue(int[] data) =&gt;\n    data.FirstOrDefault(x =&gt; x % 2 == 0);\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nint GetValue(List&lt;int&gt; data) =&gt;\n    data.Find(x =&gt; x % 2 == 0);\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nint GetValue(int[] data) =&gt;\n    Array.Find(data, x =&gt; x % 2 == 0);\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1.find\">List&lt;T&gt;.Find(Predicate&lt;T&gt;)</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.array.find\">Array.Find&lt;T&gt;(T[], Predicate&lt;T&gt;)</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable.immutablelist-1.find\">ImmutableList&lt;T&gt;.Find(Predicate&lt;T&gt;)</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.firstordefault\">Enumerable.FirstOrDefault(Predicate&lt;T&gt;)</a></li>\n</ul>\n<h3>Benchmarks</h3>\n<table>\n  <colgroup>\n    <col style=\"width: 16.6666%;\">\n    <col style=\"width: 16.6666%;\">\n    <col style=\"width: 16.6666%;\">\n    <col style=\"width: 16.6666%;\">\n    <col style=\"width: 16.6666%;\">\n    <col style=\"width: 16.667%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>Method</th>\n      <th>Runtime</th>\n      <th>Categories</th>\n      <th>Mean</th>\n      <th>Standard Deviation</th>\n      <th>Allocated</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p>ArrayFirstOrDefault</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>Array</p>\n      </td>\n      <td>\n        <p>10.515 μs</p>\n      </td>\n      <td>\n        <p>0.1410 μs</p>\n      </td>\n      <td>\n        <p>32 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ArrayFind</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>Array</p>\n      </td>\n      <td>\n        <p>4.417 μs</p>\n      </td>\n      <td>\n        <p>0.0729 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ArrayFirstOrDefault</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>Array</p>\n      </td>\n      <td>\n        <p>2.262 μs</p>\n      </td>\n      <td>\n        <p>0.0135 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ArrayFind</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>Array</p>\n      </td>\n      <td>\n        <p>3.428 μs</p>\n      </td>\n      <td>\n        <p>0.0206 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ArrayFirstOrDefault</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>Array</p>\n      </td>\n      <td>\n        <p>45.074 μs</p>\n      </td>\n      <td>\n        <p>0.7517 μs</p>\n      </td>\n      <td>\n        <p>32 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ArrayFind</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>Array</p>\n      </td>\n      <td>\n        <p>13.948 μs</p>\n      </td>\n      <td>\n        <p>0.1496 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListFirstOrDefault</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>83.796 μs</p>\n      </td>\n      <td>\n        <p>1.3199 μs</p>\n      </td>\n      <td>\n        <p>72 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListFind</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>59.720 μs</p>\n      </td>\n      <td>\n        <p>1.0723 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListFirstOrDefault</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>81.984 μs</p>\n      </td>\n      <td>\n        <p>1.0886 μs</p>\n      </td>\n      <td>\n        <p>72 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListFind</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>58.288 μs</p>\n      </td>\n      <td>\n        <p>0.8079 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListFirstOrDefault</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>446.893 μs</p>\n      </td>\n      <td>\n        <p>9.8430 μs</p>\n      </td>\n      <td>\n        <p>76 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListFind</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>427.476 μs</p>\n      </td>\n      <td>\n        <p>3.3371 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ListFirstOrDefault</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>List&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>14.808 μs</p>\n      </td>\n      <td>\n        <p>0.1723 μs</p>\n      </td>\n      <td>\n        <p>40 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ListFind</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>List&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>6.040 μs</p>\n      </td>\n      <td>\n        <p>0.1104 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ListFirstOrDefault</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>List&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>2.233 μs</p>\n      </td>\n      <td>\n        <p>0.0154 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ListFind</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>List&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>4.458 μs</p>\n      </td>\n      <td>\n        <p>0.0745 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ListFirstOrDefault</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>List&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>57.290 μs</p>\n      </td>\n      <td>\n        <p>1.0494 μs</p>\n      </td>\n      <td>\n        <p>40 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ListFind</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>List&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>18.476 μs</p>\n      </td>\n      <td>\n        <p>0.0504 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h4>Glossary</h4>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Arithmetic_mean\">Mean</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Standard_deviation\">Standard Deviation</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Memory_management\">Allocated</a></li>\n</ul>\n<p>The results were generated by running the following snippet with <a href=\"https://github.com/dotnet/BenchmarkDotNet\">BenchmarkDotNet</a>:</p>\n<pre>\n// Explicitly cache the delegates to avoid allocations inside the benchmark.\nprivate readonly static Func&lt;int, bool&gt; ConditionFunc = static x =&gt; x == 1;\nprivate readonly static Predicate&lt;int&gt; ConditionPredicate = static x =&gt; x == 1;\nprivate List&lt;int&gt; list;\nprivate ImmutableList&lt;int&gt; immutableList;\nprivate int[] array;\npublic const int N = 10_000;\n\n[GlobalSetup]\npublic void GlobalSetup()\n{\n    list = Enumerable.Range(0, N).Select(x =&gt; N - x).ToList();\n    immutableList = ImmutableList.CreateRange(list);\n    array = list.ToArray();\n}\n\n[BenchmarkCategory(\"List&lt;T&gt;\"), Benchmark(Baseline = true)]\npublic int ListFirstOrDefault() =&gt;\n    list.FirstOrDefault(ConditionFunc);\n\n[BenchmarkCategory(\"List&lt;T&gt;\"), Benchmark]\npublic int ListFind() =&gt;\n    list.Find(ConditionPredicate);\n\n[BenchmarkCategory(\"ImmutableList&lt;T&gt;\"), Benchmark(Baseline = true)]\npublic int ImmutableListFirstOrDefault() =&gt;\n    immutableList.FirstOrDefault(ConditionFunc);\n\n[BenchmarkCategory(\"ImmutableList&lt;T&gt;\"), Benchmark]\npublic int ImmutableListFind() =&gt;\n    immutableList.Find(ConditionPredicate);\n\n[BenchmarkCategory(\"Array\"), Benchmark(Baseline = true)]\npublic int ArrayFirstOrDefault() =&gt;\n    array.FirstOrDefault(ConditionFunc);\n\n[BenchmarkCategory(\"Array\"), Benchmark]\npublic int ArrayFind() =&gt;\n    Array.Find(array, ConditionPredicate);\n</pre>\n<p>Hardware configuration:</p>\n<pre>\nBenchmarkDotNet v0.14.0, Windows 11 (10.0.22631.4317/23H2/2023Update/SunValley3)\n11th Gen Intel Core i7-11850H 2.50GHz, 1 CPU, 16 logical and 8 physical cores\n  [Host]               : .NET Framework 4.8.1 (4.8.9277.0), X64 RyuJIT VectorSize=256\n  .NET 8.0             : .NET 8.0.10 (8.0.1024.46610), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI\n  .NET 9.0             : .NET 9.0.0 (9.0.24.47305), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI\n  .NET Framework 4.8.1 : .NET Framework 4.8.1 (4.8.9277.0), X64 RyuJIT VectorSize=256\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6602.json",
    "content": "{\n  \"title\": \"\\\"Find\\\" method should be used instead of the \\\"FirstOrDefault\\\" extension\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-6602\",\n  \"sqKey\": \"S6602\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6603.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Both the <code>List.TrueForAll</code> method and the <code>IEnumerable.All</code> method can be used to check if all list elements satisfy a given\ncondition in a collection. However, <code>List.TrueForAll</code> can be faster than <code>IEnumerable.All</code> for <code>List</code> objects. The\nperformance difference may be minor for small collections, but for large collections, it can be noticeable.</p>\n<p>It is important to enable this rule with caution, as performance outcomes can vary significantly across different runtimes. Notably, the <a\nhref=\"https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-9/#collections\">performance improvements in .NET 9</a> have brought\n<code>All</code> closer to the performance of collection-specific <code>TrueForAll</code> methods in most scenarios.</p>\n<p><strong>Applies to</strong></p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1.trueforall\">List</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.array.trueforall\">Array</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable.immutablelist-1.trueforall\">ImmutableList</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable.immutablelist-1.builder.trueforall\">ImmutableList.Builder</a></li>\n</ul>\n<h3>What is the potential impact?</h3>\n<p>We measured at least 4x improvement both in execution time. For more details see the <code>Benchmarks</code> section from the <code>More\ninfo</code> tab.</p>\n<h2>How to fix it</h2>\n<p>The <code>TrueForAll</code> method is defined on the collection class, and it has the same signature as the <code>All</code> extension method. The\nmethod can be replaced in place.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic bool AreAllEven(List&lt;int&gt; data) =&gt;\n    data.All(x =&gt; x % 2 == 0);\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\npublic bool AreAllEven(int[] data) =&gt;\n    data.All(x =&gt; x % 2 == 0);\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic bool AreAllEven(List&lt;int&gt; data) =&gt;\n    data.TrueForAll(x =&gt; x % 2 == 0);\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\npublic bool AreAllEven(int[] data) =&gt;\n    Array.TrueForAll(data, x =&gt; x % 2 == 0);\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1.trueforall\">List&lt;T&gt;.TrueForAll(Predicate&lt;T&gt;)</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.array.trueforall\">Array.TrueForAll&lt;T&gt;(T[],\n  Predicate&lt;T&gt;)</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable.immutablelist-1.trueforall\">ImmutableList&lt;T&gt;.TrueForAll(Predicate&lt;T&gt;)</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable.immutablelist-1.builder.trueforall\">ImmutableList&lt;T&gt;.Builder.TrueForAll(Predicate&lt;T&gt;)</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.all\">Enumerable.All&lt;TSource&gt;</a></li>\n</ul>\n<h3>Benchmarks</h3>\n<table>\n  <colgroup>\n    <col style=\"width: 16.6666%;\">\n    <col style=\"width: 16.6666%;\">\n    <col style=\"width: 16.6666%;\">\n    <col style=\"width: 16.6666%;\">\n    <col style=\"width: 16.6666%;\">\n    <col style=\"width: 16.667%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>Method</th>\n      <th>Runtime</th>\n      <th>Categories</th>\n      <th>Mean</th>\n      <th>Standard Deviation</th>\n      <th>Allocated</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p>ArrayAll</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>Array</p>\n      </td>\n      <td>\n        <p>109.25 μs</p>\n      </td>\n      <td>\n        <p>1.767 μs</p>\n      </td>\n      <td>\n        <p>32 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ArrayTrueForAll</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>Array</p>\n      </td>\n      <td>\n        <p>45.01 μs</p>\n      </td>\n      <td>\n        <p>0.547 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ArrayAll</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>Array</p>\n      </td>\n      <td>\n        <p>22.28 μs</p>\n      </td>\n      <td>\n        <p>0.254 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ArrayTrueForAll</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>Array</p>\n      </td>\n      <td>\n        <p>37.60 μs</p>\n      </td>\n      <td>\n        <p>0.382 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ArrayAll</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>Array</p>\n      </td>\n      <td>\n        <p>495.90 μs</p>\n      </td>\n      <td>\n        <p>4.342 μs</p>\n      </td>\n      <td>\n        <p>40 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ArrayTrueForAll</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>Array</p>\n      </td>\n      <td>\n        <p>164.52 μs</p>\n      </td>\n      <td>\n        <p>2.030 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListAll</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>940.29 μs</p>\n      </td>\n      <td>\n        <p>5.600 μs</p>\n      </td>\n      <td>\n        <p>72 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListTrueForAll</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>679.46 μs</p>\n      </td>\n      <td>\n        <p>2.371 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListAll</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>922.43 μs</p>\n      </td>\n      <td>\n        <p>14.564 μs</p>\n      </td>\n      <td>\n        <p>72 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListTrueForAll</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>692.31 μs</p>\n      </td>\n      <td>\n        <p>8.897 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListAll</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>4,578.72 μs</p>\n      </td>\n      <td>\n        <p>77.920 μs</p>\n      </td>\n      <td>\n        <p>128 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListTrueForAll</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>4,393.49 μs</p>\n      </td>\n      <td>\n        <p>122.061 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListBuilderAll</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;.Builder</p>\n      </td>\n      <td>\n        <p>970.45 μs</p>\n      </td>\n      <td>\n        <p>13.598 μs</p>\n      </td>\n      <td>\n        <p>73 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListBuilderTrueForAll</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;.Builder</p>\n      </td>\n      <td>\n        <p>687.82 μs</p>\n      </td>\n      <td>\n        <p>6.142 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListBuilderAll</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;.Builder</p>\n      </td>\n      <td>\n        <p>981.17 μs</p>\n      </td>\n      <td>\n        <p>12.966 μs</p>\n      </td>\n      <td>\n        <p>72 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListBuilderTrueForAll</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;.Builder</p>\n      </td>\n      <td>\n        <p>710.19 μs</p>\n      </td>\n      <td>\n        <p>16.195 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListBuilderAll</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;.Builder</p>\n      </td>\n      <td>\n        <p>4,780.50 μs</p>\n      </td>\n      <td>\n        <p>43.282 μs</p>\n      </td>\n      <td>\n        <p>128 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListBuilderTrueForAll</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;.Builder</p>\n      </td>\n      <td>\n        <p>4,493.82 μs</p>\n      </td>\n      <td>\n        <p>76.530 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ListAll</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>List&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>151.12 μs</p>\n      </td>\n      <td>\n        <p>2.028 μs</p>\n      </td>\n      <td>\n        <p>40 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ListTrueForAll</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>List&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>58.03 μs</p>\n      </td>\n      <td>\n        <p>0.493 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ListAll</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>List&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>22.14 μs</p>\n      </td>\n      <td>\n        <p>0.327 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ListTrueForAll</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>List&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>46.01 μs</p>\n      </td>\n      <td>\n        <p>0.327 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ListAll</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>List&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>619.86 μs</p>\n      </td>\n      <td>\n        <p>6.037 μs</p>\n      </td>\n      <td>\n        <p>48 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ListTrueForAll</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>List&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>208.49 μs</p>\n      </td>\n      <td>\n        <p>2.340 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h4>Glossary</h4>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Arithmetic_mean\">Mean</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Standard_deviation\">Standard Deviation</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Memory_management\">Allocated</a></li>\n</ul>\n<p>The results were generated by running the following snippet with <a href=\"https://github.com/dotnet/BenchmarkDotNet\">BenchmarkDotNet</a>:</p>\n<pre>\n// Explicitly cache the delegates to avoid allocations inside the benchmark.\nprivate readonly static Func&lt;int, bool&gt; ConditionFunc = static x =&gt; x == Math.Abs(x);\nprivate readonly static Predicate&lt;int&gt; ConditionPredicate = static x =&gt; x == Math.Abs(x);\n\nprivate List&lt;int&gt; list;\nprivate ImmutableList&lt;int&gt; immutableList;\nprivate ImmutableList&lt;int&gt;.Builder immutableListBuilder;\nprivate int[] array;\n\n[Params(100_000)]\npublic int N { get; set; }\n\n[GlobalSetup]\npublic void GlobalSetup()\n{\n    list = Enumerable.Range(0, N).Select(x =&gt; N - x).ToList();\n    immutableList = ImmutableList.CreateRange(list);\n    immutableListBuilder = ImmutableList.CreateBuilder&lt;int&gt;();\n    immutableListBuilder.AddRange(list);\n    array = list.ToArray();\n}\n\n[BenchmarkCategory(\"List&lt;T&gt;\"), Benchmark]\npublic bool ListAll() =&gt;\n    list.All(ConditionFunc);\n\n[BenchmarkCategory(\"List&lt;T&gt;\"), Benchmark(Baseline = true)]\npublic bool ListTrueForAll() =&gt;\n    list.TrueForAll(ConditionPredicate);\n\n[BenchmarkCategory(\"ImmutableList&lt;T&gt;\"), Benchmark(Baseline = true)]\npublic bool ImmutableListAll() =&gt;\n    immutableList.All(ConditionFunc);\n\n[BenchmarkCategory(\"ImmutableList&lt;T&gt;\"), Benchmark]\npublic bool ImmutableListTrueForAll() =&gt;\n    immutableList.TrueForAll(ConditionPredicate);\n\n[BenchmarkCategory(\"ImmutableList&lt;T&gt;.Builder\"), Benchmark(Baseline = true)]\npublic bool ImmutableListBuilderAll() =&gt;\n    immutableListBuilder.All(ConditionFunc);\n\n[BenchmarkCategory(\"ImmutableList&lt;T&gt;.Builder\"), Benchmark]\npublic bool ImmutableListBuilderTrueForAll() =&gt;\n    immutableListBuilder.TrueForAll(ConditionPredicate);\n\n[BenchmarkCategory(\"Array\"), Benchmark(Baseline = true)]\npublic bool ArrayAll() =&gt;\n    array.All(ConditionFunc);\n\n[BenchmarkCategory(\"Array\"), Benchmark]\npublic bool ArrayTrueForAll() =&gt;\n    Array.TrueForAll(array, ConditionPredicate);\n</pre>\n<p>Hardware configuration:</p>\n<pre>\nBenchmarkDotNet v0.14.0, Windows 11 (10.0.22631.4317/23H2/2023Update/SunValley3)\n11th Gen Intel Core i7-11850H 2.50GHz, 1 CPU, 16 logical and 8 physical cores\n  [Host]               : .NET Framework 4.8.1 (4.8.9277.0), X64 RyuJIT VectorSize=256\n  .NET 8.0             : .NET 8.0.10 (8.0.1024.46610), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI\n  .NET 9.0             : .NET 9.0.0 (9.0.24.47305), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI\n  .NET Framework 4.8.1 : .NET Framework 4.8.1 (4.8.9277.0), X64 RyuJIT VectorSize=256\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6603.json",
    "content": "{\n  \"title\": \"The collection-specific \\\"TrueForAll\\\" method should be used instead of the \\\"All\\\" extension\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-6603\",\n  \"sqKey\": \"S6603\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6605.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Both the <code>List.Exists</code> method and <code>IEnumerable.Any</code> method can be used to find the first element that satisfies a predicate\nin a collection. However, <code>List.Exists</code> can be faster than <code>IEnumerable.Any</code> for <code>List</code> objects, as well as requires\nsignificantly less memory. For small collections, the performance difference may be negligible, but for large collections, it can be noticeable. The\nsame applies to <code>ImmutableList</code> and arrays too.</p>\n<p>It is important to enable this rule with caution, as performance outcomes can vary significantly across different runtimes. Notably, the <a\nhref=\"https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-9/#collections\">performance improvements in .NET 9</a> have brought\n<code>Any</code> closer to the performance of collection-specific <code>Exists</code> methods in most scenarios.</p>\n<p><strong>Applies to</strong></p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1.exists\">List</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.array.exists\">Array</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable.immutablelist-1.exists\">ImmutableList</a></li>\n</ul>\n<h3>What is the potential impact?</h3>\n<p>We measured at least 3x improvement in execution time. For more details see the <code>Benchmarks</code> section from the <code>More info</code>\ntab.</p>\n<p>Also, no memory allocations were needed for the <code>Exists</code> method, since the search is done in-place.</p>\n<h3>Exceptions</h3>\n<p>Since <code><a href=\"https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/ef/language-reference/linq-to-entities\">LINQ to\nEntities</a></code> relies a lot on <code>System.Linq</code> for <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/ef/language-reference/linq-to-entities#query-conversion\">query conversion</a>,\nthis rule won’t raise when used within LINQ to Entities syntaxes.</p>\n<h2>How to fix it</h2>\n<p>The <code>Exists</code> method is defined on the collection class, and it has the same signature as <code>Any</code> extension method if a\npredicate is used. The method can be replaced in place.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nbool ContainsEven(List&lt;int&gt; data) =&gt;\n    data.Any(x =&gt; x % 2 == 0);\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nbool ContainsEven(int[] data) =&gt;\n    data.Any(x =&gt; x % 2 == 0);\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nbool ContainsEven(List&lt;int&gt; data) =&gt;\n    data.Exists(x =&gt; x % 2 == 0);\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nbool ContainsEven(int[] data) =&gt;\n    Array.Exists(data, x =&gt; x % 2 == 0);\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1.exists\">List&lt;T&gt;.Exists(Predicate&lt;T&gt;)</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.array.exists\">Array.Exists&lt;T&gt;(T[],\n  Predicate&lt;T&gt;)</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable.immutablelist-1.exists\">ImmutableList&lt;T&gt;.Exists(Predicate&lt;T&gt;)</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.any\">Enumerable.Any(Predicate&lt;T&gt;)</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/ef/language-reference/linq-to-entities\">LINQ to\n  Entities</a></li>\n</ul>\n<h3>Benchmarks</h3>\n<table>\n  <colgroup>\n    <col style=\"width: 16.6666%;\">\n    <col style=\"width: 16.6666%;\">\n    <col style=\"width: 16.6666%;\">\n    <col style=\"width: 16.6666%;\">\n    <col style=\"width: 16.6666%;\">\n    <col style=\"width: 16.667%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>Method</th>\n      <th>Runtime</th>\n      <th>Categories</th>\n      <th>Mean</th>\n      <th>Standard Deviation</th>\n      <th>Allocated</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p>ArrayAny</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>Array</p>\n      </td>\n      <td>\n        <p>1,174.0 ns</p>\n      </td>\n      <td>\n        <p>16.44 ns</p>\n      </td>\n      <td>\n        <p>32 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ArrayExists</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>Array</p>\n      </td>\n      <td>\n        <p>570.6 ns</p>\n      </td>\n      <td>\n        <p>7.12 ns</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ArrayAny</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>Array</p>\n      </td>\n      <td>\n        <p>358.5 ns</p>\n      </td>\n      <td>\n        <p>5.57 ns</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ArrayExists</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>Array</p>\n      </td>\n      <td>\n        <p>581.6 ns</p>\n      </td>\n      <td>\n        <p>6.17 ns</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ArrayAny</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>Array</p>\n      </td>\n      <td>\n        <p>4,896.0 ns</p>\n      </td>\n      <td>\n        <p>102.83 ns</p>\n      </td>\n      <td>\n        <p>32 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ArrayExists</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>Array</p>\n      </td>\n      <td>\n        <p>1,649.4 ns</p>\n      </td>\n      <td>\n        <p>29.81 ns</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListAny</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>7,859.3 ns</p>\n      </td>\n      <td>\n        <p>91.45 ns</p>\n      </td>\n      <td>\n        <p>72 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListExists</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>5,898.1 ns</p>\n      </td>\n      <td>\n        <p>81.69 ns</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListAny</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>7,748.9 ns</p>\n      </td>\n      <td>\n        <p>119.10 ns</p>\n      </td>\n      <td>\n        <p>72 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListExists</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>5,705.0 ns</p>\n      </td>\n      <td>\n        <p>31.53 ns</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListAny</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>45,118.5 ns</p>\n      </td>\n      <td>\n        <p>168.72 ns</p>\n      </td>\n      <td>\n        <p>72 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListExists</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>41,966.0 ns</p>\n      </td>\n      <td>\n        <p>631.59 ns</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ListAny</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>List&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>1,643.5 ns</p>\n      </td>\n      <td>\n        <p>13.09 ns</p>\n      </td>\n      <td>\n        <p>40 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ListExists</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>List&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>726.2 ns</p>\n      </td>\n      <td>\n        <p>11.99 ns</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ListAny</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>List&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>398.6 ns</p>\n      </td>\n      <td>\n        <p>8.20 ns</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ListExists</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>List&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>612.4 ns</p>\n      </td>\n      <td>\n        <p>18.73 ns</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ListAny</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>List&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>5,621.5 ns</p>\n      </td>\n      <td>\n        <p>35.80 ns</p>\n      </td>\n      <td>\n        <p>40 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ListExists</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>List&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>1,748.0 ns</p>\n      </td>\n      <td>\n        <p>11.76 ns</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h4>Glossary</h4>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Arithmetic_mean\">Mean</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Standard_deviation\">Standard Deviation</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Memory_management\">Allocated</a></li>\n</ul>\n<p>The results were generated by running the following snippet with <a href=\"https://github.com/dotnet/BenchmarkDotNet\">BenchmarkDotNet</a>:</p>\n<pre>\n// Explicitly cache the delegates to avoid allocations inside the benchmark.\nprivate readonly static Func&lt;int, bool&gt; ConditionFunc = static x =&gt; x == -1 * Math.Abs(x);\nprivate readonly static Predicate&lt;int&gt; ConditionPredicate = static x =&gt; x == -1 * Math.Abs(x);\n\nprivate List&lt;int&gt; list;\nprivate ImmutableList&lt;int&gt; immutableList;\nprivate int[] array;\n\n[Params(1_000)]\npublic int N { get; set; }\n\n[GlobalSetup]\npublic void GlobalSetup()\n{\n    list = Enumerable.Range(0, N).Select(x =&gt; N - x).ToList();\n    immutableList = ImmutableList.CreateRange(list);\n    array = list.ToArray();\n}\n\n[BenchmarkCategory(\"List&lt;T&gt;\"), Benchmark]\npublic bool ListAny() =&gt;\n    list.Any(ConditionFunc);\n\n[BenchmarkCategory(\"List&lt;T&gt;\"), Benchmark(Baseline = true)]\npublic bool ListExists() =&gt;\n    list.Exists(ConditionPredicate);\n\n[BenchmarkCategory(\"ImmutableList&lt;T&gt;\"), Benchmark(Baseline = true)]\npublic bool ImmutableListAny() =&gt;\n    immutableList.Any(ConditionFunc);\n\n[BenchmarkCategory(\"ImmutableList&lt;T&gt;\"), Benchmark]\npublic bool ImmutableListExists() =&gt;\n    immutableList.Exists(ConditionPredicate);\n\n[BenchmarkCategory(\"Array\"), Benchmark(Baseline = true)]\npublic bool ArrayAny() =&gt;\n    array.Any(ConditionFunc);\n\n[BenchmarkCategory(\"Array\"), Benchmark]\npublic bool ArrayExists() =&gt;\n    Array.Exists(array, ConditionPredicate);\n</pre>\n<p>Hardware configuration:</p>\n<pre>\nBenchmarkDotNet v0.14.0, Windows 11 (10.0.22631.4317/23H2/2023Update/SunValley3)\n11th Gen Intel Core i7-11850H 2.50GHz, 1 CPU, 16 logical and 8 physical cores\n  [Host]               : .NET Framework 4.8.1 (4.8.9277.0), X64 RyuJIT VectorSize=256\n  .NET 8.0             : .NET 8.0.10 (8.0.1024.46610), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI\n  .NET 9.0             : .NET 9.0.0 (9.0.24.47305), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI\n  .NET Framework 4.8.1 : .NET Framework 4.8.1 (4.8.9277.0), X64 RyuJIT VectorSize=256\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6605.json",
    "content": "{\n  \"title\": \"Collection-specific \\\"Exists\\\" method should be used instead of the \\\"Any\\\" extension\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-6605\",\n  \"sqKey\": \"S6605\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6607.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When working with LINQ in C#, it is recommended to pay attention to the order in which methods are chained, especially when using\n<code>Where</code> and <code>OrderBy</code> methods. It is advised to call the <code>Where</code> method before <code>OrderBy</code> because\n<code>Where</code> filters the elements of the sequence based on a given condition and returns a new sequence containing only the elements that\nsatisfy that condition. Calling <code>OrderBy</code> before <code>Where</code>, may end up sorting elements that will be later discarded, which can\nlead to inefficiency. Conversely, calling <code>Where</code> before <code>OrderBy</code>, will first filter the sequence to include only the elements\nof interest, and then sort them based on the specified order.</p>\n<h3>What is the potential impact?</h3>\n<p>We measured at least 2x improvement in execution time. For more details see the <code>Benchmarks</code> section from the <code>More info</code>\ntab.</p>\n<h2>How to fix it</h2>\n<p>The issue can be fixed by calling <code>Where</code> before <code>OrderBy</code>.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic IEnumerable&lt;int&gt; GetSortedFilteredList(IEnumerable&lt;int&gt; data) =&gt;\n    data.OrderBy(x =&gt; x).Where(x =&gt; x % 2 == 0);\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic IEnumerable&lt;int&gt; GetSortedFilteredList(IEnumerable&lt;int&gt; data) =&gt;\n     data.Where(x =&gt; x % 2 == 0).OrderBy(x =&gt; x);\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.orderby\">Enumerable.OrderBy</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.where\">Enumerable.Where</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li><a href=\"https://stackoverflow.com/questions/7499384/does-the-order-of-linq-functions-matter/7499454#7499454\">Jon Skeet’s explanation on Stack\n  Overflow</a></li>\n</ul>\n<h3>Benchmarks</h3>\n<table>\n  <colgroup>\n    <col style=\"width: 25%;\">\n    <col style=\"width: 25%;\">\n    <col style=\"width: 25%;\">\n    <col style=\"width: 25%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>Method</th>\n      <th>Runtime</th>\n      <th>Mean</th>\n      <th>Standard Deviation</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p>OrderByThenWhere</p>\n      </td>\n      <td>\n        <p>.NET 7.0</p>\n      </td>\n      <td>\n        <p>175.36 ms</p>\n      </td>\n      <td>\n        <p>5.101 ms</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>WhereThenOrderBy</p>\n      </td>\n      <td>\n        <p>.NET 7.0</p>\n      </td>\n      <td>\n        <p>85.58 ms</p>\n      </td>\n      <td>\n        <p>1.697 ms</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h4>Glossary</h4>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Arithmetic_mean\">Mean</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Standard_deviation\">Standard Deviation</a></li>\n</ul>\n<p>The results were generated by running the following snippet with <a href=\"https://github.com/dotnet/BenchmarkDotNet\">BenchmarkDotNet</a>:</p>\n<pre>\nprivate IList&lt;int&gt; data;\nprivate static readonly Random Random = new Random();\n\n[Params(1_000_000)]\npublic int NumberOfEntries;\n\n[GlobalSetup]\npublic void Setup() =&gt;\n    data = Enumerable.Range(0, NumberOfEntries).Select(x =&gt; Random.Next(0, NumberOfEntries)).ToList();\n\n[Benchmark(Baseline = true)]\npublic void OrderByThenWhere() =&gt;\n    _ = data.OrderBy(x =&gt; x).Where(x =&gt; x % 2 == 0 ).ToList();  // OrderBy followed by Where\n\n[Benchmark]\npublic void WhereThenOrderBy() =&gt;\n    _ = data.Where(x =&gt; x % 2 == 0 ).OrderBy(x =&gt; x).ToList();  // Where followed by OrderBy\n</pre>\n<p>Hardware configuration:</p>\n<pre>\nBenchmarkDotNet=v0.13.5, OS=Windows 10 (10.0.19045.2846/22H2/2022Update)\n12th Gen Intel Core i7-12800H, 1 CPU, 20 logical and 14 physical cores\n.NET SDK=7.0.203\n  [Host]               : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2\n  .NET 7.0             : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6607.json",
    "content": "{\n  \"title\": \"The collection should be filtered before sorting by using \\\"Where\\\" before \\\"OrderBy\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-6607\",\n  \"sqKey\": \"S6607\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6608.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Indexes in C# provide direct access to an element at a specific position within an array or collection. When compared to <code>Enumerable</code>\nmethods, indexing can be more efficient for certain scenarios, such as iterating over a large collection, due to avoiding the overhead of checking the\nunderlying collection type before accessing it.</p>\n<p>This applies to types that implement one of these interfaces:</p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.ilist\">IList</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ilist-1\">IList&lt;T&gt;</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ireadonlylist-1\">IReadonlyList&lt;T&gt;</a></li>\n</ul>\n<h3>What is the potential impact?</h3>\n<p>We measured a significant improvement in execution time. For more details see the <code>Benchmarks</code> section from the <code>More info</code>\ntab.</p>\n<h2>How to fix it</h2>\n<p>If the type you are using implements <code>IList</code>, <code>IList&lt;T&gt;</code> or <code>IReadonlyList&lt;T&gt;</code>, it implements\n<code>this[int index]</code>. This means calls to <code>First</code>, <code>Last</code>, or <code>ElementAt(index)</code> can be replaced with\nindexing at <code>0</code>, <code>Count-1</code> and <code>index</code> respectively.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nint GetAt(List&lt;int&gt; data, int index)\n    =&gt; data.ElementAt(index);\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nint GetFirst(List&lt;int&gt; data)\n    =&gt; data.First();\n</pre>\n<pre data-diff-id=\"3\" data-diff-type=\"noncompliant\">\nint GetLast(List&lt;int&gt; data)\n    =&gt; data.Last();\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nint GetAt(List&lt;int&gt; data, int index)\n    =&gt; data[index];\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nint GetFirst(List&lt;int&gt; data)\n    =&gt; data[0];\n</pre>\n<pre data-diff-id=\"3\" data-diff-type=\"compliant\">\nint GetLast(List&lt;int&gt; data)\n    =&gt; data[data.Count-1];\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.ilist.item\">IList.Item[Int32]</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ilist-1.item\">IList&lt;T&gt;.Item[Int32]</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ireadonlylist-1.item\">IReadonlyList&lt;T&gt;.Item[Int32]</a></li>\n</ul>\n<h3>Benchmarks</h3>\n<table>\n  <colgroup>\n    <col style=\"width: 25%;\">\n    <col style=\"width: 25%;\">\n    <col style=\"width: 25%;\">\n    <col style=\"width: 25%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>Method</th>\n      <th>Runtime</th>\n      <th>Mean</th>\n      <th>Standard Deviation</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p>ElementAt</p>\n      </td>\n      <td>\n        <p>3,403.4 ns</p>\n      </td>\n      <td>\n        <p>28.52 ns</p>\n      </td>\n      <td>\n        <p>26.67 ns</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>Index</p>\n      </td>\n      <td>\n        <p>478.0 ns</p>\n      </td>\n      <td>\n        <p>6.93 ns</p>\n      </td>\n      <td>\n        <p>6.48 ns</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>First</p>\n      </td>\n      <td>\n        <p>6,160.0 ns</p>\n      </td>\n      <td>\n        <p>57.66 ns</p>\n      </td>\n      <td>\n        <p>53.93 ns</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>First_Index</p>\n      </td>\n      <td>\n        <p>485.7 ns</p>\n      </td>\n      <td>\n        <p>5.81 ns</p>\n      </td>\n      <td>\n        <p>5.15 ns</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>Last</p>\n      </td>\n      <td>\n        <p>6,034.3 ns</p>\n      </td>\n      <td>\n        <p>20.34 ns</p>\n      </td>\n      <td>\n        <p>16.98 ns</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>Last_Index</p>\n      </td>\n      <td>\n        <p>408.3 ns</p>\n      </td>\n      <td>\n        <p>2.54 ns</p>\n      </td>\n      <td>\n        <p>2.38 ns</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h4>Glossary</h4>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Arithmetic_mean\">Mean</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Standard_deviation\">Standard Deviation</a></li>\n</ul>\n<p>The results were generated by running the following snippet with <a href=\"https://github.com/dotnet/BenchmarkDotNet\">BenchmarkDotNet</a>:</p>\n<pre>\nprivate List&lt;byte&gt; data;\nprivate Random random;\n\n[Params(1_000_000)]\npublic int SampleSize;\n\n[Params(1_000)]\npublic int LoopSize;\n\n[GlobalSetup]\npublic void Setup()\n{\n    random = new Random(42);\n\n    var bytes = new byte[SampleSize];\n    random.NextBytes(bytes);\n    data = bytes.ToList();\n}\n\n[Benchmark]\npublic int ElementAt()\n{\n    int result = default;\n\n    for (var i = 0; i &lt; LoopSize; i++)\n    {\n        result = data.ElementAt(i);\n    }\n\n    return result;\n}\n\n[Benchmark]\npublic int Index()\n{\n    int result = default;\n\n    for (var i = 0; i &lt; LoopSize; i++)\n    {\n        result = data[i];\n    }\n\n    return result;\n}\n\n[Benchmark]\npublic int First()\n{\n    int result = default;\n\n    for (var i = 0; i &lt; LoopSize; i++)\n    {\n        result = data.First();\n    }\n\n    return result;\n}\n\n[Benchmark]\npublic int First_Index()\n{\n    int result = default;\n\n    for (var i = 0; i &lt; LoopSize; i++)\n    {\n        result = data[0];\n    }\n\n    return result;\n}\n\n[Benchmark]\npublic int Last()\n{\n    int result = default;\n\n    for (var i = 0; i &lt; LoopSize; i++)\n    {\n        result = data.Last();\n    }\n\n    return result;\n}\n\n[Benchmark]\npublic int Last_Index()\n{\n    int result = default;\n\n    for (var i = 0; i &lt; LoopSize; i++)\n    {\n        result = data[data.Count - 1];\n    }\n\n    return result;\n}\n</pre>\n<p>Hardware configuration:</p>\n<pre>\nBenchmarkDotNet=v0.13.5, OS=Windows 10 (10.0.19045.4412/22H2/2022Update)\n11th Gen Intel Core i7-11850H 2.50GHz, 1 CPU, 16 logical and 8 physical cores\n.NET SDK=8.0.301\n  [Host]   : .NET 8.0.6 (8.0.624.26715), X64 RyuJIT AVX2\n  .NET 8.0 : .NET 8.0.6 (8.0.624.26715), X64 RyuJIT AVX2\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6608.json",
    "content": "{\n  \"title\": \"Prefer indexing instead of \\\"Enumerable\\\" methods on types implementing \\\"IList\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-6608\",\n  \"sqKey\": \"S6608\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6609.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Both the <code>Enumerable.Max</code> extension method and the <code>SortedSet&lt;T&gt;.Max</code> property can be used to find the maximum value in\na <code>SortedSet&lt;T&gt;</code>. However, <code>SortedSet&lt;T&gt;.Max</code> is much faster than <code>Enumerable.Max</code>. For small\ncollections, the performance difference may be minor, but for large collections, it can be noticeable. The same applies for the <code>Min</code>\nproperty as well.</p>\n<p><code>Max</code> and <code>Min</code> in <code>SortedSet&lt;T&gt;</code> exploit the fact that the set is implemented via a <code>Red-Black\ntree</code>. The algorithm to find the <code>Max</code>/<code>Min</code> is \"go left/right whenever possible\". The operation has the time complexity\nof <code>O(h)</code> which becomes <code>O(ln(n))</code> due to the fact that the tree is balanced. This is much better than the <code>O(n)</code>\ntime complexity of extension methods.</p>\n<p><code>Max</code> and <code>Min</code> in <code>ImmutableSortedSet&lt;T&gt;</code> exploits a tree augmentation technique, storing the\n<code>Min</code>, <code>Max</code> and <code>Count</code> values on each node of the data structure. The time complexity in this case is\n<code>O(1)</code> that is significantly better than <code>O(n)</code> of extension methods.</p>\n<p><strong>Applies to:</strong></p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.sortedset-1.max\">SortedSet&lt;T&gt;.Max</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.sortedset-1.min\">SortedSet&lt;T&gt;.Min</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable.immutablesortedset-1.max\">ImmutableSortedSet&lt;T&gt;.Max</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable.immutablesortedset-1.min\">ImmutableSortedSet&lt;T&gt;.Min</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable.immutablesortedset-1.builder.max\">ImmutableSortedSet&lt;T&gt;.Builder.Max</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable.immutablesortedset-1.builder.min\">ImmutableSortedSet&lt;T&gt;.Builder.Min</a></li>\n</ul>\n<h3>What is the potential impact?</h3>\n<p>We measured a significant improvement both in execution time and memory allocation. For more details see the <code>Benchmarks</code> section from\nthe <code>More info</code> tab.</p>\n<h2>How to fix it</h2>\n<p>The <code>Min</code> and <code>Max</code> properties are defined on the following classes, and the extension method call can be replaced by calling\nthe propery instead:</p>\n<ul>\n  <li><code>SortedSet&lt;T&gt;</code></li>\n  <li><code>ImmutableSortedSet&lt;T&gt;</code></li>\n  <li><code>ImmutableSortedSet&lt;T&gt;.Builder</code></li>\n</ul>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nint GetMax(SortedSet&lt;int&gt; data) =&gt;\n    data.Max();\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nint GetMin(SortedSet&lt;int&gt; data) =&gt;\n    data.Min();\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nint GetMax(SortedSet&lt;int&gt; data) =&gt;\n    data.Max;\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nint GetMin(SortedSet&lt;int&gt; data) =&gt;\n    data.Min;\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.sortedset-1\">SortedSet&lt;T&gt;</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable.immutablesortedset-1\">ImmutableSortedSet&lt;T&gt;</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable.immutablesortedset-1.builder\">ImmutableSortedSet&lt;T&gt;.Builder</a></li>\n</ul>\n<h3>Benchmarks</h3>\n<table>\n  <colgroup>\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>Method</th>\n      <th>Runtime</th>\n      <th>Mean</th>\n      <th>Standard Deviation</th>\n      <th>Allocated</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p>MaxMethod</p>\n      </td>\n      <td>\n        <p>.NET 7.0</p>\n      </td>\n      <td>\n        <p>68,961.483 us</p>\n      </td>\n      <td>\n        <p>499.6623 us</p>\n      </td>\n      <td>\n        <p>248063 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>MaxProperty</p>\n      </td>\n      <td>\n        <p>.NET 7.0</p>\n      </td>\n      <td>\n        <p>4.638 us</p>\n      </td>\n      <td>\n        <p>0.0634 us</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>MaxMethod</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.6.2</p>\n      </td>\n      <td>\n        <p>85,827.359 us</p>\n      </td>\n      <td>\n        <p>1,531.1611 us</p>\n      </td>\n      <td>\n        <p>281259 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>MaxProperty</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.6.2</p>\n      </td>\n      <td>\n        <p>67.682 us</p>\n      </td>\n      <td>\n        <p>0.3757 us</p>\n      </td>\n      <td>\n        <p>312919 B</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h4>Glossary</h4>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Arithmetic_mean\">Mean</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Standard_deviation\">Standard Deviation</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Memory_management\">Allocated</a></li>\n</ul>\n<p>The results were generated by running the following snippet with <a href=\"https://github.com/dotnet/BenchmarkDotNet\">BenchmarkDotNet</a>:</p>\n<pre>\nprivate SortedSet&lt;string&gt; data;\n\n[Params(1_000)]\npublic int Iterations;\n\n[GlobalSetup]\npublic void Setup() =&gt;\n    data = new SortedSet&lt;string&gt;(Enumerable.Range(0, Iterations).Select(x =&gt; Guid.NewGuid().ToString()));\n\n[Benchmark(Baseline = true)]\npublic void MaxMethod()\n{\n    for (var i = 0; i &lt; Iterations; i++)\n    {\n        _ = data.Max();     // Max() extension method\n    }\n}\n\n[Benchmark]\npublic void MaxProperty()\n{\n    for (var i = 0; i &lt; Iterations; i++)\n    {\n        _ = data.Max;       // Max property\n    }\n}\n</pre>\n<p>Hardware configuration:</p>\n<pre>\nBenchmarkDotNet=v0.13.5, OS=Windows 10 (10.0.19045.2846/22H2/2022Update)\n11th Gen Intel Core i7-11850H 2.50GHz, 1 CPU, 16 logical and 8 physical cores\n  [Host]               : .NET Framework 4.8 (4.8.4614.0), X64 RyuJIT VectorSize=256\n  .NET 7.0             : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2\n  .NET Framework 4.6.2 : .NET Framework 4.8 (4.8.4614.0), X64 RyuJIT VectorSize=256\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6609.json",
    "content": "{\n  \"title\": \"\\\"Min\\/Max\\\" properties of \\\"Set\\\" types should be used instead of the \\\"Enumerable\\\" extension methods\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-6609\",\n  \"sqKey\": \"S6609\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6610.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>With <code>string.StartsWith(char)</code> and <code>string.EndsWith(char)</code>, only the first character of the string is compared to the\nprovided character, whereas the <code>string</code> versions of those methods have to do checks about the current <code>StringComparison</code> and\n<code>CultureInfo</code>. Thus, the <code>char</code> overloads are significantly faster for default comparison scenarios.</p>\n<p>These overloads were introduced in <code>.NET Core 2.0</code>.</p>\n<h3>What is the potential impact?</h3>\n<p>We measured at least 3.5x improvement in execution time. For more details see the <code>Benchmarks</code> section from the <code>More info</code>\ntab.</p>\n<h2>How to fix it</h2>\n<p>If you are targeting a runtime version equal or greater than <code>.NET Core 2.0</code>, the <code>string.StartsWith</code> and\n<code>string.EndsWith</code> overloads are available, with the argument’s type being <code>char</code> instead of <code>string</code>. Thus, an\nargument of <code>char</code> type can be provided.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nbool StartsWithSlash(string s) =&gt;\n    s.StartsWith(\"/\");\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nbool EndsWithSlash(string s) =&gt;\n    s.EndsWith(\"/\");\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nbool StartsWithSlash(string s) =&gt;\n    s.StartsWith('/');\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nbool EndsWithSlash(string s) =&gt;\n    s.EndsWith('/');\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.startswith\">string.StartsWith</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.endswith\">string.EndsWith</a></li>\n</ul>\n<h3>Benchmarks</h3>\n<table>\n  <colgroup>\n    <col style=\"width: 33.3333%;\">\n    <col style=\"width: 33.3333%;\">\n    <col style=\"width: 33.3334%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>Method</th>\n      <th>Mean</th>\n      <th>Standard Deviation</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p>StartsWith_String</p>\n      </td>\n      <td>\n        <p>30.965 ms</p>\n      </td>\n      <td>\n        <p>3.2732 ms</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>StartsWith_Char</p>\n      </td>\n      <td>\n        <p>7.568 ms</p>\n      </td>\n      <td>\n        <p>0.3235 ms</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>EndsWith_String</p>\n      </td>\n      <td>\n        <p>30.421 ms</p>\n      </td>\n      <td>\n        <p>5.1136 ms</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>EndsWith_Char</p>\n      </td>\n      <td>\n        <p>8.067 ms</p>\n      </td>\n      <td>\n        <p>0.7092 ms</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h4>Glossary</h4>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Arithmetic_mean\">Mean</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Standard_deviation\">Standard Deviation</a></li>\n</ul>\n<p>The results were generated by running the following snippet with <a href=\"https://github.com/dotnet/BenchmarkDotNet\">BenchmarkDotNet</a>:</p>\n<pre>\nprivate List&lt;string&gt; data;\n\n[Params(1_000_000)]\npublic int N { get; set; }\n\n[GlobalSetup]\npublic void Setup() =&gt;\n    data = Enumerable.Range(0, N).Select(_ =&gt; Guid.NewGuid().ToString()).ToList();\n\n[Benchmark]\npublic void StartsWith_String()\n{\n    _ = data.Where(guid =&gt; guid.StartsWith(\"d\")).ToList();\n}\n\n[Benchmark]\npublic void StartsWith_Char()\n{\n    _ = data.Where(guid =&gt; guid.StartsWith('d')).ToList();\n}\n\n[Benchmark]\npublic void EndsWith_String()\n{\n    _ = data.Where(guid =&gt; guid.EndsWith(\"d\")).ToList();\n}\n\n[Benchmark]\npublic void EndsWith_Char()\n{\n    _ = data.Where(guid =&gt; guid.EndsWith('d')).ToList();\n}\n</pre>\n<p>Hardware configuration:</p>\n<pre>\nBenchmarkDotNet=v0.13.5, OS=Windows 10 (10.0.19045.2846/22H2/2022Update)\n11th Gen Intel Core i7-11850H 2.50GHz, 1 CPU, 16 logical and 8 physical cores\n.NET SDK=7.0.203\n  [Host]   : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2\n  .NET 7.0 : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6610.json",
    "content": "{\n  \"title\": \"\\\"StartsWith\\\" and \\\"EndsWith\\\" overloads that take a \\\"char\\\" should be used instead of the ones that take a \\\"string\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-6610\",\n  \"sqKey\": \"S6610\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6612.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When using the <code>ConcurrentDictionary</code>, there are many overloads of the <code>GetOrAdd</code> and <code>AddOrUpdate</code> methods that\ntake both a <code>TKey</code> argument and a lambda that expects a <code>TKey</code> parameter. This means that the right side of the lambda can be\nwritten using either the lambda’s parameter or the method’s argument. However, using the method’s argument leads to the lambda capturing it, and the\ncompiler will need to generate a class and instantiate it before the call. This means memory allocations, as well as more time spend during Garbage\nCollection.</p>\n<h3>What is the potential impact?</h3>\n<p>We measured a significant improvement both in execution time and memory allocation. For more details see the <code>Benchmarks</code> section from\nthe <code>More info</code> tab.</p>\n<h2>How to fix it</h2>\n<p>When you are using the <code>ConcurrentDictionary</code> methods <code>GetOrAdd</code> or <code>AddOrUpdate</code>, reference the key by using the\nlambda’s parameter instead of the method’s one.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nint UpdateValue(ConcurrentDictionary&lt;int, int&gt; dict, int key) =&gt;\n    dict.GetOrAdd(key, _ =&gt; key + 42);\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nint UpdateValue(ConcurrentDictionary&lt;int, int&gt; dict, int key) =&gt;\n    dict.GetOrAdd(key, x =&gt; x + 42);\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.concurrent.concurrentdictionary-2.getoradd\">ConcurrentDictionary&lt;TKey,TValue&gt;.GetOrAdd</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.concurrent.concurrentdictionary-2.addorupdate\">ConcurrentDictionary&lt;TKey,TValue&gt;.AddOrUpdate</a></li>\n</ul>\n<h3>Benchmarks</h3>\n<table>\n  <colgroup>\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>Method</th>\n      <th>Runtime</th>\n      <th>Mean</th>\n      <th>Standard Deviation</th>\n      <th>Allocated</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p>Capture</p>\n      </td>\n      <td>\n        <p>.NET 7.0</p>\n      </td>\n      <td>\n        <p>68.52 ms</p>\n      </td>\n      <td>\n        <p>4.450 ms</p>\n      </td>\n      <td>\n        <p>88000063 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>Lambda</p>\n      </td>\n      <td>\n        <p>.NET 7.0</p>\n      </td>\n      <td>\n        <p>39.29 ms</p>\n      </td>\n      <td>\n        <p>3.712 ms</p>\n      </td>\n      <td>\n        <p>50 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>Capture</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.6.2</p>\n      </td>\n      <td>\n        <p>74.58 ms</p>\n      </td>\n      <td>\n        <p>5.199 ms</p>\n      </td>\n      <td>\n        <p>88259787 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>Lambda</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.6.2</p>\n      </td>\n      <td>\n        <p>42.03 ms</p>\n      </td>\n      <td>\n        <p>2.752 ms</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h4>Glossary</h4>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Arithmetic_mean\">Mean</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Standard_deviation\">Standard Deviation</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Memory_management\">Allocated</a></li>\n</ul>\n<p>The results were generated by running the following snippet with <a href=\"https://github.com/dotnet/BenchmarkDotNet\">BenchmarkDotNet</a>:</p>\n<pre>\nprivate ConcurrentDictionary&lt;int, string&gt; dict;\nprivate List&lt;int&gt; data;\n\n[Params(1_000_000)]\npublic int N { get; set; }\n\n[GlobalSetup]\npublic void Setup()\n{\n    dict = new ConcurrentDictionary&lt;int, string&gt;();\n    data = Enumerable.Range(0, N).OrderBy(_ =&gt; Guid.NewGuid()).ToList();\n}\n\n[Benchmark(baseline=true)]\npublic void Capture()\n{\n    foreach (var guid in data)\n    {\n        dict.GetOrAdd(guid, _ =&gt; $\"{guid}\"); // \"guid\" is captured\n    }\n}\n\n[Benchmark]\npublic void Lambda()\n{\n    foreach (var guid in data)\n    {\n        dict.GetOrAdd(guid, x =&gt; $\"{x}\"); // no capture\n    }\n}\n</pre>\n<p>Hardware configuration:</p>\n<pre>\nBenchmarkDotNet=v0.13.5, OS=Windows 10 (10.0.19045.2846/22H2/2022Update)\n11th Gen Intel Core i7-11850H 2.50GHz, 1 CPU, 16 logical and 8 physical cores\n.NET SDK=7.0.203\n  [Host]               : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2\n  .NET 7.0             : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2\n  .NET Framework 4.6.2 : .NET Framework 4.8.1 (4.8.9139.0), X64 RyuJIT VectorSize=256\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6612.json",
    "content": "{\n  \"title\": \"The lambda parameter should be used instead of capturing arguments in \\\"ConcurrentDictionary\\\" methods\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-6612\",\n  \"sqKey\": \"S6612\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6613.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Both the <code>Enumerable.First</code> extension method and the <code>LinkedList&lt;T&gt;.First</code> property can be used to find the first value\nin a <code>LinkedList&lt;T&gt;</code>. However, <code>LinkedList&lt;T&gt;.First</code> is much faster than <code>Enumerable.First</code>. For small\ncollections, the performance difference may be minor, but for large collections, it can be noticeable. The same applies for the <code>Last</code>\nproperty as well.</p>\n<p><strong>Applies to:</strong></p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.linkedlist-1.first\">LinkedList&lt;T&gt;.First</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.linkedlist-1.last\">LinkedList&lt;T&gt;.Last</a></li>\n</ul>\n<h3>What is the potential impact?</h3>\n<p>We measured a significant improvement both in execution time and memory allocation. For more details see the <code>Benchmarks</code> section from\nthe <code>More info</code> tab.</p>\n<h2>How to fix it</h2>\n<p>The <code>First</code> and <code>Last</code> properties are defined on the <code>LinkedList</code> class, and the extension method call can be\nreplaced by calling the propery instead.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nint GetFirst(LinkedList&lt;int&gt; data) =&gt;\n    data.First();\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nint GetLast(LinkedList&lt;int&gt; data) =&gt;\n    data.Last();\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nint GetFirst(LinkedList&lt;int&gt; data) =&gt;\n    data.First.Value;\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nint GetLast(LinkedList&lt;int&gt; data) =&gt;\n    data.Last.Value;\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.linkedlist-1\">LinkedList&lt;T&gt;</a></li>\n</ul>\n<h3>Benchmarks</h3>\n<table>\n  <colgroup>\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>Method</th>\n      <th>Runtime</th>\n      <th>Mean</th>\n      <th>Standard Deviation</th>\n      <th>Allocated</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p>LastMethod</p>\n      </td>\n      <td>\n        <p>.NET 7.0</p>\n      </td>\n      <td>\n        <p>919,577,629.0 ns</p>\n      </td>\n      <td>\n        <p>44,299,688.61 ns</p>\n      </td>\n      <td>\n        <p>48504 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>LastProperty</p>\n      </td>\n      <td>\n        <p>.NET 7.0</p>\n      </td>\n      <td>\n        <p>271.8 ns</p>\n      </td>\n      <td>\n        <p>15.63 ns</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>LastMethod</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.6.2</p>\n      </td>\n      <td>\n        <p>810,316,427.1 ns</p>\n      </td>\n      <td>\n        <p>47,768,482.31 ns</p>\n      </td>\n      <td>\n        <p>57344 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>LastProperty</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.6.2</p>\n      </td>\n      <td>\n        <p>372.0 ns</p>\n      </td>\n      <td>\n        <p>13.38 ns</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h4>Glossary</h4>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Arithmetic_mean\">Mean</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Standard_deviation\">Standard Deviation</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Memory_management\">Allocated</a></li>\n</ul>\n<p>The results were generated by running the following snippet with <a href=\"https://github.com/dotnet/BenchmarkDotNet\">BenchmarkDotNet</a>:</p>\n<pre>\nprivate LinkedList&lt;int&gt; data;\nprivate Random random = new Random();\n\n[Params(100_000)]\npublic int Size { get; set; }\n\n[Params(1_000)]\npublic int Runs { get; set; }\n\n[GlobalSetup]\npublic void Setup() =&gt;\n    data = new LinkedList&lt;int&gt;(Enumerable.Range(0, Size).Select(x =&gt; random.Next()));\n\n[Benchmark(Baseline = true)]\npublic void LastMethod()\n{\n    for (var i = 0; i &lt; Runs; i++)\n    {\n        _ = data.Last();                // Enumerable.Last()\n    }\n}\n\n[Benchmark]\npublic void LastProperty()\n{\n    for (var i = 0; i &lt; Runs; i++)\n    {\n        _ = data.Last;                  // Last property\n    }\n}\n</pre>\n<p>Hardware configuration:</p>\n<pre>\nBenchmarkDotNet=v0.13.5, OS=Windows 10 (10.0.19045.2846/22H2/2022Update)\n11th Gen Intel Core i7-11850H 2.50GHz, 1 CPU, 16 logical and 8 physical cores\n  [Host]               : .NET Framework 4.8 (4.8.4614.0), X64 RyuJIT VectorSize=256\n  .NET 7.0             : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2\n  .NET Framework 4.6.2 : .NET Framework 4.8 (4.8.4614.0), X64 RyuJIT VectorSize=256\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6613.json",
    "content": "{\n  \"title\": \"\\\"First\\\" and \\\"Last\\\" properties of \\\"LinkedList\\\" should be used instead of the \\\"First()\\\" and \\\"Last()\\\" extension methods\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-6613\",\n  \"sqKey\": \"S6613\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6617.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When testing if a collection contains a specific item by simple equality, both <code>ICollection.Contains(T item)</code> and\n<code>IEnumerable.Any(x ⇒ x == item)</code> can be used. However, <code>Any</code> searches the data structure in a linear manner using a foreach\nloop, whereas <code>Contains</code> is considerably faster in some collection types, because of the underlying implementation. More specifically:</p>\n<ul>\n  <li><code>HashSet&lt;T&gt;</code> is a hashtable, and therefore has an O(1) lookup</li>\n  <li><code>SortedSet&lt;T&gt;</code> is a red-black tree, and therefore has a O(logN) lookup</li>\n  <li><code>List&lt;T&gt;</code> is a linear search, and therefore has an O(N) lookup, but the EqualityComparer is optimized for the <code>T</code>\n  type, which is not the case for <code>Any</code></li>\n</ul>\n<p>For small collections, the performance difference may be negligible, but for large collections, it can be noticeable.</p>\n<h3>What is the potential impact?</h3>\n<p>We measured a significant improvement both in execution time and memory allocation. For more details see the <code>Benchmarks</code> section from\nthe <code>More info</code> tab.</p>\n<h3>Exceptions</h3>\n<p>Since <code><a href=\"https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/ef/language-reference/linq-to-entities\">LINQ to\nEntities</a></code> relies a lot on <code>System.Linq</code> for <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/ef/language-reference/linq-to-entities#query-conversion\">query conversion</a>,\nthis rule won’t raise when used within LINQ to Entities syntaxes.</p>\n<h2>How to fix it</h2>\n<p><code>Contains</code> is a method defined on the <code>ICollection&lt;T&gt;</code> interface and takes a <code>T item</code> argument.\n<code>Any</code> is an extension method defined on the <code>IEnumerable&lt;T&gt;</code> interface and takes a predicate argument. Therefore, calls\nwith simple equality checks like <code>Any(x ⇒ x == item)</code> can be replaced by <code>Contains(item)</code>.</p>\n<p>This applies to the following collection types:</p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.hashset-1\">HashSet&lt;T&gt;</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.sortedset-1\">SortedSet&lt;T&gt;</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1\">List&lt;T&gt;</a></li>\n</ul>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nbool ValueExists(HashSet&lt;int&gt; data) =&gt;\n    data.Any(x =&gt; x == 42);\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nbool ValueExists(List&lt;int&gt; data) =&gt;\n    data.Any(x =&gt; x == 42);\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nbool ValueExists(HashSet&lt;int&gt; data) =&gt;\n    data.Contains(42);\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nbool ValueExists(List&lt;int&gt; data) =&gt;\n    data.Contains(42);\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.hashset-1.contains\">HashSet&lt;T&gt;.Contains(T)</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.sortedset-1.contains\">SortedSet&lt;T&gt;.Contains(T)</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1.contains\">List.Contains(T)</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.any\">Enumerable.Any</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/ef/language-reference/linq-to-entities\">LINQ to Entities</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/collections/\">Collections and Data Structures</a></li>\n</ul>\n<h3>Benchmarks</h3>\n<table>\n  <colgroup>\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>Method</th>\n      <th>Runtime</th>\n      <th>Mean</th>\n      <th>Standard Deviation</th>\n      <th>Allocated</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p>HashSet_Any</p>\n      </td>\n      <td>\n        <p>.NET 7.0</p>\n      </td>\n      <td>\n        <p>35,388.333 us</p>\n      </td>\n      <td>\n        <p>620.1863 us</p>\n      </td>\n      <td>\n        <p>40132 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>HashSet_Contains</p>\n      </td>\n      <td>\n        <p>.NET 7.0</p>\n      </td>\n      <td>\n        <p>3.799 us</p>\n      </td>\n      <td>\n        <p>0.1489 us</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>List_Any</p>\n      </td>\n      <td>\n        <p>.NET 7.0</p>\n      </td>\n      <td>\n        <p>32,851.509 us</p>\n      </td>\n      <td>\n        <p>667.1658 us</p>\n      </td>\n      <td>\n        <p>40130 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>List_Contains</p>\n      </td>\n      <td>\n        <p>.NET 7.0</p>\n      </td>\n      <td>\n        <p>375.132 us</p>\n      </td>\n      <td>\n        <p>8.0764 us</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>HashSet_Any</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.6.2</p>\n      </td>\n      <td>\n        <p>28,979.763 us</p>\n      </td>\n      <td>\n        <p>678.0093 us</p>\n      </td>\n      <td>\n        <p>40448 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>HashSet_Contains</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.6.2</p>\n      </td>\n      <td>\n        <p>5.987 us</p>\n      </td>\n      <td>\n        <p>0.1090 us</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>List_Any</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.6.2</p>\n      </td>\n      <td>\n        <p>25,830.221 us</p>\n      </td>\n      <td>\n        <p>487.2470 us</p>\n      </td>\n      <td>\n        <p>40448 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>List_Contains</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.6.2</p>\n      </td>\n      <td>\n        <p>5,935.812 us</p>\n      </td>\n      <td>\n        <p>57.7569 us</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h4>Glossary</h4>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Arithmetic_mean\">Mean</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Standard_deviation\">Standard Deviation</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Memory_management\">Allocated</a></li>\n</ul>\n<p>The results were generated by running the following snippet with <a href=\"https://github.com/dotnet/BenchmarkDotNet\">BenchmarkDotNet</a>:</p>\n<pre>\n[Params(10_000)]\npublic int SampleSize;\n\n[Params(1_000)]\npublic int Iterations;\n\nprivate static HashSet&lt;int&gt; hashSet;\nprivate static List&lt;int&gt; list;\n\n[GlobalSetup]\npublic void Setup()\n{\n    hashSet = new HashSet&lt;int&gt;(Enumerable.Range(0, SampleSize));\n    list = Enumerable.Range(0, SampleSize).ToList();\n}\n\n[Benchmark]\npublic void HashSet_Any() =&gt;\n    CheckAny(hashSet, SampleSize / 2);\n\n[Benchmark]\npublic void HashSet_Contains() =&gt;\n    CheckContains(hashSet, SampleSize / 2);\n\n[Benchmark]\npublic void List_Any() =&gt;\n    CheckAny(list, SampleSize / 2);\n\n[Benchmark]\npublic void List_Contains() =&gt;\n    CheckContains(list, SampleSize / 2);\n\nvoid CheckAny(IEnumerable&lt;int&gt; values, int target)\n{\n    for (int i = 0; i &lt; Iterations; i++)\n    {\n        _ = values.Any(x =&gt; x == target);  // Enumerable.Any\n    }\n}\n\nvoid CheckContains(ICollection&lt;int&gt; values, int target)\n{\n    for (int i = 0; i &lt; Iterations; i++)\n    {\n        _ = values.Contains(target); // ICollection&lt;T&gt;.Contains\n    }\n}\n</pre>\n<p>Hardware configuration:</p>\n<pre>\nBenchmarkDotNet=v0.13.5, OS=Windows 10 (10.0.19045.2846/22H2/2022Update)\n11th Gen Intel Core i7-11850H 2.50GHz, 1 CPU, 16 logical and 8 physical cores\n.NET SDK=7.0.203\n  [Host]               : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2\n  .NET 7.0             : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2\n  .NET Framework 4.6.2 : .NET Framework 4.8.1 (4.8.9139.0), X64 RyuJIT VectorSize=256\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6617.json",
    "content": "{\n  \"title\": \"\\\"Contains\\\" should be used instead of \\\"Any\\\" for simple equality checks\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-6617\",\n  \"sqKey\": \"S6617\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6618.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>In order to produce a formatted string, both <code>string.Create</code> and either <code>FormattableString.Invariant</code> or\n<code>FormattableString.CurrentCulture</code> can be used. However, <code>string.Create</code> rents array buffers from\n<code>ArrayPool&lt;char&gt;</code> making it more performant, as well as preventing unnecessary allocations and future stress on the Garbage\nCollector.</p>\n<p>This applies to .NET versions after .NET 6, when these <code>string.Create</code> overloads were introduced.</p>\n<h3>What is the potential impact?</h3>\n<p>We measured a significant improvement both in execution time and memory allocation. For more details see the <code>Benchmarks</code> section from\nthe <code>More info</code> tab.</p>\n<h2>How to fix it</h2>\n<p>Replace calls to <code>FormattableString.CurrentCulture</code> or <code>FormattableString.Invariant</code> with calls to\n<code>string.Create(CultureInfo.CurrentCulture, …​)</code> or <code>string.Create(CultureInfo.InvariantCulture, …​)</code> respectively.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nstring Interpolate(string value) =&gt;\n    FormattableString.Invariant($\"Value: {value}\");\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nstring Interpolate(string value) =&gt;\n    FormattableString.CurrentCulture($\"Value: {value}\");\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nstring Interpolate(string value) =&gt;\n    string.Create(CultureInfo.InvariantCulture, $\"Value: {value}\");\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nstring Interpolate(string value) =&gt;\n    string.Create(CultureInfo.CurrentCulture, $\"Value: {value}\");\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.create?view=net-7.0\">string.Create</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.formattablestring.invariant\">FormattableString.Invariant</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.formattablestring.currentculture\">FormattableString.CurrentCulture</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/tokens/interpolated#compilation-of-interpolated-strings\">Compilation\n  of interpolated strings</a></li>\n</ul>\n<h3>Benchmarks</h3>\n<p>The results were generated by running the following snippet with <a href=\"https://github.com/dotnet/BenchmarkDotNet\">BenchmarkDotNet</a>:</p>\n<table>\n  <colgroup>\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>Method</th>\n      <th>Runtime</th>\n      <th>Mean</th>\n      <th>Standard Deviation</th>\n      <th>Allocated</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p>StringCreate</p>\n      </td>\n      <td>\n        <p>.NET 7.0</p>\n      </td>\n      <td>\n        <p>152.5 ms</p>\n      </td>\n      <td>\n        <p>3.09 ms</p>\n      </td>\n      <td>\n        <p>83.92 MB</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>FormattableString</p>\n      </td>\n      <td>\n        <p>.NET 7.0</p>\n      </td>\n      <td>\n        <p>191.8 ms</p>\n      </td>\n      <td>\n        <p>6.92 ms</p>\n      </td>\n      <td>\n        <p>198.36 MB</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h4>Glossary</h4>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Arithmetic_mean\">Mean</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Standard_deviation\">Standard Deviation</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Memory_management\">Allocated</a></li>\n</ul>\n<p>The results were generated by running the following snippet with <a href=\"https://github.com/dotnet/BenchmarkDotNet\">BenchmarkDotNet</a>:</p>\n<pre>\nint Value = 42;\nDateTime Now = DateTime.UtcNow;\n\n[Params(1_000_000)]\npublic int N;\n\n[Benchmark]\npublic void StringCreate()\n{\n    for (int i = 0; i &lt; N; i++)\n    {\n        _ = string.Create(CultureInfo.InvariantCulture, $\"{Now}: Value is {Value}\");\n    }\n}\n\n[Benchmark]\npublic void FormattableStringInvariant()\n{\n    for (int i = 0; i &lt; N; i++)\n    {\n        _ = FormattableString.Invariant($\"{Now}: Value is {Value}\");\n    }\n}\n</pre>\n<p>Hardware configuration:</p>\n<pre>\nBenchmarkDotNet=v0.13.5, OS=Windows 10 (10.0.19045.2728/22H2/2022Update)\n11th Gen Intel Core i7-11850H 2.50GHz, 1 CPU, 16 logical and 8 physical cores\n.NET SDK=7.0.203\n  [Host]   : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2\n  .NET 7.0 : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6618.json",
    "content": "{\n  \"title\": \"\\\"string.Create\\\" should be used instead of \\\"FormattableString\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-6618\",\n  \"sqKey\": \"S6618\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6640.html",
    "content": "<p>Using <code>unsafe</code> code blocks can lead to unintended security or stability risks.</p>\n<p><code>unsafe</code> code blocks allow developers to use features such as pointers, fixed buffers, function calls through pointers and manual memory\nmanagement. Such features may be necessary for interoperability with native libraries, as these often require pointers. It may also increase\nperformance in some critical areas, as certain bounds checks are not executed in an unsafe context.</p>\n<p><code>unsafe</code> code blocks aren’t necessarily dangerous, however, the contents of such blocks are not verified by the Common Language Runtime.\nTherefore, it is up to the programmer to ensure that no bugs are introduced through manual memory management or casting. If not done correctly, then\nthose bugs can lead to memory corruption vulnerabilities such as stack overflows. <code>unsafe</code> code blocks should be used with caution because\nof these security and stability risks.</p>\n<h2>Ask Yourself Whether</h2>\n<ul>\n  <li>There are any pointers or fixed buffers declared within the <code>unsafe</code> code block.</li>\n</ul>\n<p>There is a risk if you answered yes to the question.</p>\n<h2>Recommended Secure Coding Practices</h2>\n<p>Unless absolutely necessary, do not use <code>unsafe</code> code blocks. If <code>unsafe</code> is used to increase performance, then the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/standard/memory-and-spans/\">Span and Memory APIs</a> may serve a similar purpose in a safe context.</p>\n<p>If it is not possible to remove the code block, then it should be kept as short as possible. Doing so reduces risk, as there is less code that can\npotentially introduce new bugs. Within the <code>unsafe</code> code block, make sure that:</p>\n<ul>\n  <li>All type casts are correct.</li>\n  <li>Memory is correctly allocated and then released.</li>\n  <li>Array accesses can never go out of bounds.</li>\n</ul>\n<h2>Sensitive Code Example</h2>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic unsafe int SubarraySum(int[] array, int start, int end)  // Sensitive\n{\n    var sum = 0;\n\n    // Skip array bound checks for extra performance\n    fixed (int* firstNumber = array)\n    {\n        for (int i = start; i &lt; end; i++)\n            sum += *(firstNumber + i);\n    }\n\n    return sum;\n}\n</pre>\n<h2>Compliant Solution</h2>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic int SubarraySum(int[] array, int start, int end)\n{\n    var sum = 0;\n\n    Span&lt;int&gt; span = array.AsSpan();\n    for (int i = start; i &lt; end; i++)\n        sum += span[i];\n\n    return sum;\n}\n</pre>\n<h2>See</h2>\n<ul>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/787\">CWE-787 - Out-of-bounds Write</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/unsafe-code\">Microsoft Learn</a> - Unsafe code, pointer types, and\n  function pointers</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6640.json",
    "content": "{\n  \"title\": \"Using unsafe code blocks is security-sensitive\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"60min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6640\",\n  \"sqKey\": \"S6640\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\",\n  \"securityStandards\": {\n    \"CWE\": [\n      119,\n      787\n    ]\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6664.html",
    "content": "<p>A code block should not contain too many logging statements of a specific level.</p>\n<h2>Why is this an issue?</h2>\n<p>Excessive logging within a code block can lead to several problems:</p>\n<ul>\n  <li><strong>Log file overload</strong>: generating an overwhelming number of log entries can fill up disk space quickly (thus increasing the storage\n  space cost) and make it challenging to identify important log events promptly.</li>\n  <li><strong>Performance degradation</strong>: writing a large number of log statements can impact the performance of an application, especially when\n  the logs are placed in frequently executed paths.</li>\n  <li><strong>Code readability and maintainability</strong>: excessive logging can clutter the code and increase the code’s complexity, making it\n  difficult for developers to identify essential logic.</li>\n</ul>\n<p>Only the logging statements that are directly within the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/tour-of-csharp/program-building-blocks#statements\">code block</a> will be counted, and any\nlogging statements within nested blocks will count towards their own. For example consider the snippet below:</p>\n<pre>\nvoid MyMethod(List&lt;MyObject&gt; items)\n{\n    logger.Debug(\"The operation started\");\n    foreach(var item in items)\n    {\n        logger.Debug($\"Evaluating {item.Name}\");\n        var result = Evaluate(item);\n        logger.Debug($\"Evaluating resulted in {result}\");\n    }\n    logger.Debug(\"The operation ended\");\n}\n</pre>\n<p>The rule will count 2 logging statements that are within the method block (namely <code>logger.Debug(\"The operation started\")</code> and\n<code>logger.Debug(\"The operation ended\")</code>). Any statements within nested blocks, such as the <code>foreach</code> block will be counted\nseparately. The rule considers the log level of the calls, as follows:</p>\n<ul>\n  <li><strong>Debug</strong>, <strong>Trace</strong> and <strong>Verbose</strong> logging level statements will count together and raise when the\n  <strong><em>Debug threshold</em></strong> parameter is exceeded (default value: <em>4</em>);</li>\n  <li><strong>Information</strong> logging level statements will raise when the <strong><em>Information threshold</em></strong> parameter is exceeded\n  (default value: <em>2</em>);</li>\n  <li><strong>Warning</strong> logging level statements will raise when the <strong><em>Warning threshold</em></strong> parameter is exceeded (default\n  value: <em>1</em>);</li>\n  <li><strong>Error</strong> and <strong>Fatal</strong> logging level statements will count together and raise when the <strong><em>Error\n  threshold</em></strong> parameter is exceeded (default value: <em>1</em>);</li>\n</ul>\n<p>The most popular logging frameworks are supported:</p>\n<ul>\n  <li>Nuget package - <a href=\"https://www.nuget.org/packages/Microsoft.Extensions.Logging\">Microsoft.Extensions.Logging</a></li>\n  <li>Nuget package - <a href=\"https://www.nuget.org/packages/Serilog\">Serilog</a></li>\n  <li>Nuget package - <a href=\"https://www.nuget.org/packages/Castle.Core\">Castle.Core</a></li>\n  <li>Nuget package - <a href=\"https://www.nuget.org/packages/NLog\">NLog</a></li>\n  <li>Nuget package - <a href=\"https://www.nuget.org/packages/log4net\">log4net</a></li>\n</ul>\n<h2>How to fix it</h2>\n<p>Reduce the number of specific logging level calls within the code block by identifying and selecting essential log statements with relevant\ninformation, necessary for understanding the flow of execution or diagnosing issues.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<p>With the default Information threshold parameter value 2:</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nvoid MyMethod(List&lt;MyObject&gt; items)\n{\n    logger.Debug(\"The operation started\");\n    foreach(var item in items)\n    {\n        logger.Information($\"Evaluating {item.Name}\"); // Noncompliant\n        var result = Evaluate(item);\n        logger.Information($\"Evaluating resulted in {result}\"); // Secondary 1\n        if (item.Name is string.Empty)\n        {\n            logger.Error(\"Invalid item name\");\n        }\n        logger.Information(\"End item evaluation\"); // Secondary 2\n    }\n    logger.Debug(\"The operation ended\");\n}\n</pre>\n<h4>Compliant solution</h4>\n<p>With the default Information threshold parameter value 2:</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nvoid MyMethod(List&lt;MyObject&gt; items)\n{\n    logger.Debug(\"The operation started\");\n    foreach(var item in items)\n    {\n        logger.Information($\"Evaluating {item.Name}\");\n        var result = Evaluate(item);\n        if (item.Name is string.Empty)\n        {\n            logger.Error(\"Invalid item name\");\n        }\n        logger.Information($\"End item evaluation with result: {result}\");\n    }\n    logger.Debug(\"The operation ended\");\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/tour-of-csharp/program-building-blocks#statements\">Code\n  blocks</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/exception-handling-statements\">Exception-handling\n  statements</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6664.json",
    "content": "{\n  \"title\": \"The code block contains too many logging calls\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"FOCUSED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"logging\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-6664\",\n  \"sqKey\": \"S6664\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6667.html",
    "content": "<p>This rule raises an issue on logging calls inside a <code>catch</code> clause that does not pass the raised <code>Exception</code>.</p>\n<h2>Why is this an issue?</h2>\n<p>A log entry should contain all the relevant information about the current execution context. The <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.exception\">Exception</a> raised in a catch block not only provides the message but also:</p>\n<ul>\n  <li>the exception type</li>\n  <li>the <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.exception.stacktrace\">stack trace</a></li>\n  <li>any <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.exception.innerexception\">inner exceptions</a></li>\n  <li>and more about the cause of the error.</li>\n</ul>\n<p><a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loggerextensions\">Logging methods</a> provide overloads that\naccept an <code>Exception</code> as a parameter and <a href=\"https://learn.microsoft.com/en-us/dotnet/core/extensions/logging-providers\">logging\nproviders</a> persist the <code>Exception</code> in a structured way to facilitate the tracking of system failures. Therefore <code>Exceptions</code>\nshould be passed to the logger.</p>\n<p>The rule covers the following logging frameworks:</p>\n<ul>\n  <li>Nuget package - <a href=\"https://www.nuget.org/packages/Castle.Core\">Castle.Core</a></li>\n  <li>Nuget package - <a href=\"https://www.nuget.org/packages/Common.Logging.Core\">Common.Core</a></li>\n  <li>Nuget package - <a href=\"https://www.nuget.org/packages/log4net\">log4net</a></li>\n  <li>Nuget package - <a href=\"https://www.nuget.org/packages/NLog\">NLog</a></li>\n  <li>Nuget package - <a href=\"https://www.nuget.org/packages/Microsoft.Extensions.Logging\">Microsoft.Extensions.Logging</a></li>\n</ul>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic bool Save()\n{\n    try\n    {\n        DoSave();\n        return true;\n    }\n    catch(IOException)\n    {\n        logger.LogError(\"Saving failed.\");             // Noncompliant: No specifics about the error are logged\n        return false;\n    }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic bool Save()\n{\n    try\n    {\n        DoSave();\n        return true;\n    }\n    catch(IOException exception)\n    {\n        logger.LogError(exception, \"Saving failed.\");  // Compliant: Exception details are logged\n        return false;\n    }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/core/extensions/logging?tabs=command-line#log-exceptions\">Log\n  exceptions</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loggerextensions\">LoggerExtensions\n  Class</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/core/extensions/logging-providers\">Logging providers</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/exception-handling-statements#the-try-catch-statement\">The\n  <code>try-catch</code> statement</a></li>\n  <li>Serilog - <a href=\"https://github.com/serilog/serilog/wiki/Getting-Started#example-application\">Example application</a></li>\n  <li>Serilog Analyzer - <a href=\"https://github.com/Suchiman/SerilogAnalyzer#serilog001-exception-usage\"><code>Serilog001</code>: Exception\n  Usage</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6667.json",
    "content": "{\n  \"title\": \"Logging in a catch clause should pass the caught exception as a parameter.\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"error-handling\",\n    \"logging\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-6667\",\n  \"sqKey\": \"S6667\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6668.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Most logging frameworks have methods that take a log level, an event ID or an exception as a separate input next to the log format and its\narguments. There is a high chance that if the log level, the event ID or the exception are passed as the arguments to the message format, it was a\nmistake. This rule is going to raise in that scenario.</p>\n<p>The rule covers the following logging frameworks:</p>\n<ul>\n  <li>Nuget package - <a href=\"https://www.nuget.org/packages/Castle.Core\">Castle.Core</a></li>\n  <li>Nuget package - <a href=\"https://www.nuget.org/packages/Serilog\">Serilog</a></li>\n  <li>Nuget package - <a href=\"https://www.nuget.org/packages/NLog\">NLog</a></li>\n  <li>Nuget package - <a href=\"https://www.nuget.org/packages/Microsoft.Extensions.Logging\">Microsoft.Extensions.Logging</a></li>\n</ul>\n<h2>How to fix it</h2>\n<p>Use the dedicated overload that takes the log level, event id, and/or exception as arguments.</p>\n<h3>Noncompliant code example</h3>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\ntry { }\ncatch (Exception ex)\n{\n    logger.LogDebug(\"An exception occured {Exception} with {EventId}.\", ex, eventId); // Noncompliant\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\ntry { }\ncatch (Exception ex)\n{\n    logger.LogDebug(eventId, ex, \"An exception occured.\");\n}\n</pre>\n<h3>Exceptions</h3>\n<p>This rule will not raise an issue if one of the parameters mentioned above is passed twice, once as a separate argument to the invocation and once\nas an argument to the message format.</p>\n<pre>\ntry { }\ncatch (Exception ex)\n{\n    logger.LogDebug(ex, \"An exception occured {Exception}.\", ex); // Compliant\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loggerextensions\">LoggerExtensions\n  Class</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6668.json",
    "content": "{\n  \"title\": \"Logging arguments should be passed to the correct parameter\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"LOW\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"logging\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-6668\",\n  \"sqKey\": \"S6668\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6669.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Sharing some naming conventions is a key point to make it possible for a team to efficiently collaborate. This rule checks that the logger field or\nproperty name matches a provided regular expression.</p>\n<p>The rule supports the most popular logging frameworks:</p>\n<ul>\n  <li> Nuget package - <a href=\"https://www.nuget.org/packages/Microsoft.Extensions.Logging\">Microsoft.Extensions.Logging</a> </li>\n  <li> Nuget package - <a href=\"https://www.nuget.org/packages/Serilog\">Serilog</a> </li>\n  <li> Nuget package - <a href=\"https://www.nuget.org/packages/Castle.Core\">Castle.Core</a> </li>\n  <li> Nuget package - <a href=\"https://www.nuget.org/packages/NLog\">NLog</a> </li>\n  <li> Nuget package - <a href=\"https://www.nuget.org/packages/log4net\">log4net</a> </li>\n</ul>\n<h2>How to fix it</h2>\n<p>Update the name of the field or property to follow the configured naming convention. By default, the following names are considered compliant:</p>\n<ul>\n  <li> <code>{logger}</code> </li>\n  <li> <code>{_logger}</code> </li>\n  <li> <code>{Logger}</code> </li>\n  <li> <code>{_Logger}</code> </li>\n  <li> <code>{log}</code> </li>\n  <li> <code>{_log}</code> </li>\n</ul>\n<h3>Noncompliant code example</h3>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nprivate readonly ILogger myLogger; // Noncompliant\n\npublic ILogger MyLogger { get; set; } // Noncompliant\n</pre>\n<h3>Compliant solution</h3>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nprivate readonly ILogger logger; // Compliant\n\npublic ILogger Logger { get; set; } // Compliant\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li> Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/coding-conventions\">Coding conventions</a>\n  </li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6669.json",
    "content": "{\n  \"title\": \"Logger field or property name should comply with a naming convention\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"logging\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-6669\",\n  \"sqKey\": \"S6669\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6670.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.write\">Trace.Write</a> and <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.writeline\">Trace.WriteLine</a> methods are writing to the underlying\noutput stream directly, bypassing the trace formatting and filtering performed by <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.tracelistener.traceevent\">TraceListener.TraceEvent</a> implementations. It is\npreferred to use <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.traceerror\">Trace.TraceError</a>, <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.tracewarning\">Trace.TraceWarning</a>, and <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.traceinformation\">Trace.TraceInformation</a> methods instead because they\ncall the <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.tracelistener.traceevent\">TraceEvent method</a> which filters the\ntrace output according to the <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.traceeventtype\">TraceEventType</a> (Error,\nWarning or Information) and enhance the output with additional information.</p>\n<h2>How to fix it</h2>\n<p>Use the <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.traceerror\">Trace.TraceError</a>, <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.tracewarning\">Trace.TraceWarning</a>, or <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.traceinformation\">Trace.TraceInformation</a> methods.</p>\n<h3>Noncompliant code example</h3>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\ntry\n{\n    var message = RetrieveMessage();\n    Trace.Write($\"Message received: {message}\"); // Noncompliant\n}\ncatch (Exception ex)\n{\n    Trace.WriteLine(ex); // Noncompliant\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\ntry\n{\n    var message = RetrieveMessage();\n    Trace.TraceInformation($\"Message received: {message}\");\n}\ncatch (Exception ex)\n{\n    Trace.TraceError(ex);\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.traceerror\">Trace.TraceError Method</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.traceinformation\">Trace.TraceInformation\n  Method</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.tracewarning\">Trace.TraceWarning\n  Method</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.write\">Trace.Write Method</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.writeline\">Trace.WriteLine Method</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.tracelistener.traceevent\">TraceListener.TraceEvent\n  Method</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li>Stackoverflow - <a href=\"https://stackoverflow.com/q/26350620\">Difference between Trace.Write() and Trace.TraceInformation()</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6670.json",
    "content": "{\n  \"title\": \"\\\"Trace.Write\\\" and \\\"Trace.WriteLine\\\" should not be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"LOW\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"logging\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-6670\",\n  \"sqKey\": \"S6670\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6672.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>In most logging frameworks, it’s good practice to set the logger name to match its enclosing type, as enforced by {rule:csharpsquid:S3416}.</p>\n<p>Logging frameworks can define or use <a href=\"https://learn.microsoft.com/en-us/dotnet/standard/generics/interfaces\">Generic interfaces</a> for the\nlogger, such as <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.ilogger-1\"><code>ILogger&lt;TCategoryName&gt;</code></a>.</p>\n<p>The use of a logger of a generic type parameter <code>A</code> (e.g. <code>ILogger&lt;A&gt;</code>) in a type different than <code>A</code>, say\n<code>B</code>, goes against the convention.</p>\n<p>Because the instance of type <code>A</code> would log with a logger named after <code>B</code>, log items would appear as if they were logged by\n<code>B</code> instead, resulting in confusion and logging misconfiguration:</p>\n<ul>\n  <li>overriding defaults for the logger named after <code>A</code> would not take effect for entries logged in the type <code>A</code></li>\n  <li>fine-graned logging configuration would not be possible, since there would be no way to distinguish entries logged in the type <code>A</code>\n  from entries logged in the type <code>B</code></li>\n</ul>\n<p>Further details and examples are provided in {rule:csharpsquid:S3416}.</p>\n<p>This rule specifically targets the generic logging interface <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.ilogger-1\"><code>ILogger&lt;TCategoryName&gt;</code> Interface</a>\ndefined by <a href=\"https://learn.microsoft.com/en-us/dotnet/core/extensions/logging\">Microsoft Extensions Logging</a>.</p>\n<h2>How to fix it</h2>\n<p>Change the generic type parameter of the <code>ILogger</code> interface to match the enclosing type.</p>\n<h3>Noncompliant code example</h3>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nclass EnclosingType\n{\n    public EnclosingType(ILogger&lt;AnotherType&gt; logger) // Noncompliant\n    {\n        // ...\n    }\n}\n</pre>\n<h3>Compliant solution</h3>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nclass EnclosingType\n{\n    public EnclosingType(ILogger&lt;EnclosingType&gt; logger) // Compliant\n    {\n        // ...\n    }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/core/diagnostics/logging-tracing\">.NET logging and tracing</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/standard/generics/interfaces\">Generic interface</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.ilogger-1\"><code>ILogger&lt;TCategoryName&gt;</code>\n  Interface</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/core/extensions/logging?tabs=command-line#log-category\">Logging in C# and\n  .NET - Log category</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6672.json",
    "content": "{\n  \"title\": \"Generic logger injection should match enclosing type\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"confusing\",\n    \"logging\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-6672\",\n  \"sqKey\": \"S6672\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6673.html",
    "content": "<p>The positions of arguments in a logging call should match the positions of their <a href=\"https://messagetemplates.org\">message template</a>\nplaceholders.</p>\n<h2>Why is this an issue?</h2>\n<p>The placeholders of a <a href=\"https://messagetemplates.org\">message template</a> are defined by their name and their position. Log methods specify\nthe values for the placeholder at runtime by passing them in a <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/params\">params array</a>:</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nlogger.LogError(\"{First} placeholder and {Second} one.\", first, second);\n</pre>\n<p>This rule raises an issue if the position of an argument does not match the position of the corresponding placeholder:</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\n// 'first' and 'second' are swapped\nlogger.LogError(\"{First} placeholder and {Second} one.\", second, first);\n//                                                       ^^^^^^  ^^^^^\n</pre>\n<h3>What is the potential impact?</h3>\n<p>Logging providers use placeholder names to create key/value pairs in the log entry. The key corresponds to the placeholder and the value is the\nargument passed in the log call.</p>\n<p>If the positions of the placeholder and the argument do not match, the value is associated with the wrong key. This corrupts the logs entry and\nmakes log analytics unreliable.</p>\n<h2>How to fix it</h2>\n<p>Make sure that the placeholder positions and the argument positions match. Use local variables, fields, or properties for the arguments and name\nthe placeholders accordingly.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<p>'path' and 'fileName' are swapped and therefore assigned to the wrong placeholders.</p>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nlogger.LogError(\"File {FileName} not found in folder {Path}\", path, fileName);\n//                                                            ^^^^  ^^^^^^^^\n</pre>\n<h4>Compliant solution</h4>\n<p>Swap the arguments.</p>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nlogger.LogError(\"File {FileName} not found in folder {Path}\", fileName, path);\n</pre>\n<h4>Noncompliant code example</h4>\n<p>'Name' is detected but 'Folder' is not. The placeholder’s name should correspond to the name from the argument.</p>\n<pre data-diff-id=\"3\" data-diff-type=\"noncompliant\">\nlogger.LogError(\"File {Name} not found in folder {Folder}\", file.DirectoryName, file.Name);\n//                                                                                   ^^^^\n</pre>\n<h4>Compliant solution</h4>\n<p>Swap the arguments and rename the placeholder to 'DirectoryName'.</p>\n<pre data-diff-id=\"3\" data-diff-type=\"compliant\">\nlogger.LogError(\"File {Name} not found in folder {DirectoryName}\", file.Name, file.DirectoryName);\n</pre>\n<h4>Noncompliant code example</h4>\n<p>Not detected: A name for the arguments can not be inferred. Use locals to support detection.</p>\n<pre data-diff-id=\"4\" data-diff-type=\"noncompliant\">\nlogger.LogError(\"Sum is {Sum} and product is {Product}\", x * y, x + y); // Not detected\n</pre>\n<h4>Compliant solution</h4>\n<p>Help detection by using arguments with a name.</p>\n<pre data-diff-id=\"4\" data-diff-type=\"compliant\">\nvar sum = x + y;\nvar product = x * y;\nlogger.LogError(\"Sum is {Sum} and product is {Product}\", sum, product);\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Message Templates - <a href=\"https://messagetemplates.org\">Message template specification</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/core/extensions/logging?tabs=command-line#log-message-template\">Log message\n  template</a></li>\n  <li>Serilog - <a href=\"https://github.com/serilog/serilog/wiki/Structured-Data\">Structured Data</a></li>\n  <li>NLog - <a href=\"https://github.com/NLog/NLog/wiki/How-to-use-structured-logging\">How to use structured logging</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6673.json",
    "content": "{\n  \"title\": \"Log message template placeholders should be in the right order\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"logging\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6673\",\n  \"sqKey\": \"S6673\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6674.html",
    "content": "<p>A <a href=\"https://messagetemplates.org/\">message template</a> must conform to the specification. The rule raises an issue if the template string\nviolates the template string grammar.</p>\n<h2>Why is this an issue?</h2>\n<p>A message template needs to comply with a set of rules. <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/core/extensions/logging-providers\">Logging provider</a> parse the template and enrich log entries with\nthe information found in the template. An unparsable message template leads to corrupted log entries and might result in a loss of information in the\nlogs.</p>\n<p>The rule covers the following logging frameworks:</p>\n<ul>\n  <li>Nuget package - <a href=\"https://www.nuget.org/packages/Serilog\">Serilog</a></li>\n  <li>Nuget package - <a href=\"https://www.nuget.org/packages/NLog\">Nlog</a></li>\n  <li>Nuget package - <a href=\"https://www.nuget.org/packages/Microsoft.Extensions.Logging\">Microsoft.Extensions.Logging</a></li>\n</ul>\n<h2>How to fix it</h2>\n<p>Follow the syntax described on <a href=\"https://messagetemplates.org/\">https://messagetemplates.org/</a>.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nlogger.LogError(\"Login failed for {User\", user);       // Noncompliant: Syntactically incorrect\nlogger.LogError(\"Login failed for {}\", user);          // Noncompliant: Empty placeholder\nlogger.LogError(\"Login failed for {User-Name}\", user); // Noncompliant: Only letters, numbers, and underscore are allowed for placeholders\nlogger.LogDebug(\"Retry attempt {Cnt,r}\", cnt);         // Noncompliant: The alignment specifier must be numeric\nlogger.LogDebug(\"Retry attempt {Cnt:}\", cnt);          // Noncompliant: Empty format specifier is not allowed\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nlogger.LogError(\"Login failed for {User}\", user);\nlogger.LogError(\"Login failed for {User}\", user);\nlogger.LogError(\"Login failed for {User_Name}\", user);\nlogger.LogDebug(\"Retry attempt {Cnt,-5}\", cnt);\nlogger.LogDebug(\"Retry attempt {Cnt:000}\", cnt);\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Message Templates - <a href=\"https://messagetemplates.org/\">Message template specification</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/core/extensions/logging?tabs=command-line#log-message-template-formatting\">Log message template\n  formatting</a></li>\n  <li>NLog - <a href=\"https://github.com/NLog/NLog/wiki/How-to-use-structured-logging\">How to use structured logging</a></li>\n  <li>Serilog - <a href=\"https://github.com/serilog/serilog/wiki/Structured-Data\">Structured Data</a></li>\n  <li>Serilog - <a\n  href=\"https://github.com/Suchiman/SerilogAnalyzer/blob/master/README.md#serilog002-message-template-syntax-verifier\"><code>Serilog002</code>:\n  Message template syntax verifier</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6674.json",
    "content": "{\n  \"title\": \"Log message template should be syntactically correct\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"logging\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-6674\",\n  \"sqKey\": \"S6674\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6675.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.writelineif\"><code>Trace.WriteLineIf</code> Method</a> from the\n<a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace\"><code>System.Diagnostic.Trace</code></a> facility writes a trace if\nthe condition passed as the first parameter is <code>true</code>.</p>\n<p><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.traceswitch\"><code>TraceSwitch</code></a> allows trace control via\n<code>bool</code> properties for each relevant <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.tracelevel\"><code>TraceLevel</code></a>, such as <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.traceswitch.traceerror\"><code>TraceSwitch.TraceError</code></a>.</p>\n<p>Using <code>Trace.WriteLineIf</code> with such properties should be avoided since it can lead to misinterpretation and produce confusion.</p>\n<p>In particular, <code>Trace.WriteLineIf</code> may appear as equivalent to the level-specific tracing methods provided by <code>Trace</code>, such\nas <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.traceerror\"><code>Trace.Error</code></a>, but it is not.</p>\n<p>The difference is that <code>Trace.WriteLineIf(switch.TraceError, …​)</code> conditionally writes the trace, based on the switch, whereas\n<code>Trace.TraceError</code> always writes the trace, no matter whether <code>switch.TraceError</code> is <code>true</code> or\n<code>false</code>.</p>\n<p>Moreover, unlike <code>Trace.TraceError</code>, <code>Trace.WriteLineIf(switch.TraceError, …​)</code> would behave like\n<code>Trace.WriteLine(…​)</code> when <code>switch.TraceError</code> is <code>true</code>, writing unfiltered to the underlying trace listeners and\nnot categorizing the log entry by level, as described more in detail in {rule:csharpsquid:S6670}.</p>\n<h2>How to fix it</h2>\n<p>The fix depends on the intent behind the use of <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.traceswitch\"><code>TraceSwitch</code></a> levels with <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.writelineif\"><code>Trace.WriteLineIf</code></a>.</p>\n<p>If it is <strong>trace categorization</strong>, level-specific tracing methods, such as <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.traceerror\"><code>Trace.TraceError</code></a> or <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.tracewarning\"><code>Trace.TraceWarning</code></a>, should be used\ninstead.</p>\n<p>If it is <strong>trace filtering</strong>, <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.tracesource\"><code>TraceSource</code></a> should be used instead.</p>\n<p>If it is <strong>log filtering</strong>, <code>Trace</code> should be replaced by logging APIs, such as the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/core/diagnostics/logging-tracing#net-logging-apis\"><code>ILogger</code> API</a>.</p>\n<p>Modern logging APIs are also more suitable than <code>Trace</code> when <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/core/extensions/high-performance-logging\">high-performance logging</a> is required.</p>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.writelineif\"><code>Trace.WriteLineIf</code>\n  Method</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.traceswitch\"><code>TraceSwitch</code></a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.tracesource\"><code>TraceSource</code></a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.writeline\"><code>Trace.WriteLine</code>\n  Method</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/core/extensions/high-performance-logging\">High-performance logging in\n  .NET</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li>StackOverflow - <a href=\"https://stackoverflow.com/a/5118040\">Difference between Trace.WriteLineIf and Trace.Error</a></li>\n  <li>StackOverflow - <a href=\"https://stackoverflow.com/a/3691841\">Difference between TraceSwitch and SourceSwitch</a></li>\n  <li>InfoSupport Blogs - <a href=\"https://blogs.infosupport.com/please-be-careful-when-using-trace-writelineif/\">Please be careful when using\n  Trace.WriteLineIf()</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6675.json",
    "content": "{\n  \"title\": \"\\\"Trace.WriteLineIf\\\" should not be used with \\\"TraceSwitch\\\" levels\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"confusing\",\n    \"clumsy\",\n    \"logging\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-6675\",\n  \"sqKey\": \"S6675\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6677.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Named placeholders in <a href=\"https://messagetemplates.org\">message templates</a> should be unique. The meaning of the named placeholders is to\nstore the value of the provided argument under that name, enabling easier log querying. Since the named placeholder is used multiple times, it cannot\nstore the different values uniquely with each name hence not serving its original purpose. There can be different behaviours when using the same named\nplaceholder multiple times:</p>\n<ul>\n  <li><a href=\"https://www.nuget.org/packages/Microsoft.Extensions.Logging\">Microsoft.Extensions.Logging</a> saves the different values under the same\n  name</li>\n  <li><a href=\"https://www.nuget.org/packages/Serilog\">Serilog</a> stores only the latest assigned value</li>\n  <li><a href=\"https://www.nuget.org/packages/NLog\">Nlog</a> makes the name unique by suffixing it with <code>_index</code></li>\n</ul>\n<p>The rule covers the following logging frameworks:</p>\n<ul>\n  <li><a href=\"https://www.nuget.org/packages/Microsoft.Extensions.Logging\">Microsoft.Extensions.Logging</a></li>\n  <li><a href=\"https://www.nuget.org/packages/Serilog\">Serilog</a></li>\n  <li><a href=\"https://www.nuget.org/packages/NLog\">Nlog</a></li>\n</ul>\n<h2>How to fix it</h2>\n<p>Assign unique names to each template placeholder.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic void Checkout(ILogger logger, User user, Order order)\n{\n    logger.LogDebug(\"User {Id} purchased order {Id}\", user.Id, order.Id);\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic void Checkout(ILogger logger, User user, Order order)\n{\n    logger.LogDebug(\"User {UserId} purchased order {OrderId}\", user.Id, order.Id);\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Message Templates - <a href=\"https://messagetemplates.org/\">Message template specification</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/core/extensions/logging?tabs=command-line#log-message-template-formatting\">Log message template\n  formatting</a></li>\n  <li>NLog - <a href=\"https://github.com/NLog/NLog/wiki/How-to-use-structured-logging\">How to use structured logging</a></li>\n  <li>Serilog - <a href=\"https://github.com/serilog/serilog/wiki/Structured-Data\">Structured Data</a></li>\n  <li>Serilog - <a\n  href=\"https://github.com/Suchiman/SerilogAnalyzer/blob/master/README.md#serilog005-unique-property-name-verifier\"><code>Serilog005</code>: Unique\n  Property Name Verifier</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6677.json",
    "content": "{\n  \"title\": \"Message template placeholders should be unique\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"logging\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6677\",\n  \"sqKey\": \"S6677\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6678.html",
    "content": "<p>Within a <a href=\"https://messagetemplates.org/\">message template</a> each named placeholder should be in PascalCase.</p>\n<h2>Why is this an issue?</h2>\n<p>Using consistent naming conventions is important for the readability and maintainability of code. In the case of message templates, using\nPascalCase for named placeholders ensures consistency with structured logging conventions, where each named placeholder is used as a property name in\nthe structured data.</p>\n<p>The rule covers the following logging frameworks:</p>\n<ul>\n  <li>Nuget package - <a href=\"https://www.nuget.org/packages/Microsoft.Extensions.Logging\">Microsoft.Extensions.Logging</a></li>\n  <li>Nuget package - <a href=\"https://www.nuget.org/packages/Serilog\">Serilog</a></li>\n  <li>Nuget package - <a href=\"https://www.nuget.org/packages/NLog\">Nlog</a></li>\n</ul>\n<h2>How to fix it</h2>\n<p>Use PascalCase for named placeholders.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nlogger.LogDebug(\"User {firstName} logged in\", firstName); // Noncompliant\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nlogger.LogDebug(\"User {FirstName} logged in\", firstName); // Compliant\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1727\">CA1727: Use PascalCase for\n  named placeholders</a></li>\n  <li>Serilog Analyzer - <a\n  href=\"https://github.com/Suchiman/SerilogAnalyzer/blob/master/README.md#serilog006-pascal-cased-property-verifier\">Serilog006: Pascal Cased Property\n  Verifier</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6678.json",
    "content": "{\n  \"title\": \"Use PascalCase for named placeholders\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1min\"\n  },\n  \"tags\": [\n    \"logging\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-6678\",\n  \"sqKey\": \"S6678\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6781.html",
    "content": "<p>Secret leaks often occur when a sensitive piece of authentication data is stored with the source code of an application. Considering the source\ncode is intended to be deployed across multiple assets, including source code repositories or application hosting servers, the secrets might get\nexposed to an unintended audience.</p>\n<h2>Why is this an issue?</h2>\n<p>In most cases, trust boundaries are violated when a secret is exposed in a source code repository or an uncontrolled deployment environment.\nUnintended people who don’t need to know the secret might get access to it. They might then be able to use it to gain unwanted access to associated\nservices or resources.</p>\n<p>The trust issue can be more or less severe depending on the people’s role and entitlement.</p>\n<h3>What is the potential impact?</h3>\n<p>If a JWT secret key leaks to an unintended audience, it can have serious security implications for the corresponding application. The secret key is\nused to encode and decode JWTs when using a symmetric signing algorithm, and an attacker could potentially use it to perform malicious actions.</p>\n<p>For example, an attacker could use the secret key to create their own authentication tokens that appear to be legitimate, allowing them to bypass\nauthentication and gain access to sensitive data or functionality.</p>\n<p>In the worst-case scenario, an attacker could be able to execute arbitrary code on the application by abusing administrative features, and take\nover its hosting server.</p>\n<h2>How to fix it in ASP.NET Core</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<p>Secrets stored in <code>appsettings.json</code> can be read by anyone with access to the file.</p>\n<pre data-diff-id=\"101\" data-diff-type=\"noncompliant\">\n[ApiController]\n[Route(\"login-example\")]\npublic class LoginExampleController : ControllerBase\n{\n    private readonly IConfiguration _config;\n    public LoginExampleController(IConfiguration config)\n    {\n        _config = config;\n    }\n\n    [HttpPost]\n    public IActionResult Post([FromBody] LoginModel login)\n    {\n        // Code to validate the login information is omitted\n\n        var key = _config[\"Jwt:Key\"] ??\n            throw new ApplicationException(\"JWT key is not configured.\");\n        var securityKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(key)); // Noncompliant\n        var credentials = new SigningCredentials(securityKey, SecurityAlgorithms.HmacSha256);\n\n        var Sectoken = new JwtSecurityToken(\n            \"example.com\",\n            \"example.com\",\n            null,\n            expires: DateTime.Now.AddMinutes(120),\n            signingCredentials: credentials);\n\n        var token = new JwtSecurityTokenHandler().WriteToken(Sectoken);\n        return Ok(token);\n    }\n}\n</pre>\n<p>Secrets that are hard-coded into the application can be read by anyone with access to the source code or can be decompiled from the application\nbinaries.</p>\n<pre>\n[ApiController]\n[Route(\"login-example\")]\npublic class LoginExampleController : ControllerBase\n{\n    private const string key = \"SecretSecretSecretSecretSecretSecretSecretSecret\";\n\n    [HttpPost]\n    public IActionResult Post([FromBody] LoginModel login)\n    {\n        // Code to validate the login information is omitted\n\n        var securityKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(key)); // Noncompliant\n        var credentials = new SigningCredentials(securityKey, SecurityAlgorithms.HmacSha256);\n\n        var Sectoken = new JwtSecurityToken(\n            \"example.com\",\n            \"example.com\",\n            null,\n            expires: DateTime.Now.AddMinutes(120),\n            signingCredentials: credentials);\n\n        var token = new JwtSecurityTokenHandler().WriteToken(Sectoken);\n        return Ok(token);\n    }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"101\" data-diff-type=\"compliant\">\n[ApiController]\n[Route(\"login-example\")]\npublic class LoginExampleController : ControllerBase\n{\n    [HttpPost]\n    public IActionResult Post([FromBody] LoginModel login)\n    {\n        // Code to validate the login information is omitted\n\n        var key = Environment.GetEnvironmentVariable(\"JWT_KEY\") ??\n            throw new ApplicationException(\"JWT key is not configured.\");\n        var securityKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(key));\n        var credentials = new SigningCredentials(securityKey, SecurityAlgorithms.HmacSha256);\n\n        var Sectoken = new JwtSecurityToken(\n            \"example.com\",\n            \"example.com\",\n            null,\n            expires: DateTime.Now.AddMinutes(120),\n            signingCredentials: credentials);\n\n        var token = new JwtSecurityTokenHandler().WriteToken(Sectoken);\n        return Ok(token);\n    }\n}\n</pre>\n<h3>How does this work?</h3>\n<p>Here, the compliant solution uses an environment variable to hold the secret. Environment variables are easy to change and are not easily\naccessible outside of the application.</p>\n<h3>Going the extra mile</h3>\n<h4>Use a secret vault</h4>\n<p>Secret vaults provide secure methods for storing and accessing secrets. They protect against the unexpected disclosure of the secrets they\nstore.</p>\n<p>Microsoft recommends using Azure Key Vault with .NET Core applications.</p>\n<pre>\nvar builder = WebApplication.CreateBuilder(args);\n\n// Get the name of the key vault\nvar keyVaultName = Environment.GetEnvironmentVariable(\"AZURE_KEYVAULT\") ??\n    throw new ApplicationException(\"Azure Key Vault location is not configured.\");\n// Add Azure Key Vault in the configuration\nbuilder.Configuration.AddAzureKeyVault(new Uri($\"https://{keyVaultName}.vault.azure.net/\"), new EnvironmentCredential());\n// Get the JWT secret from Azure Key Vault\nvar jwtKey = builder.Configuration.GetSection(\"JWT-KEY\").Get&lt;string&gt;() ??\n    throw new ApplicationException(\"JWT key is not configured.\");\n\nbuilder.Services\n  .AddAuthentication(JwtBearerDefaults.AuthenticationScheme)\n  .AddJwtBearer(options =&gt; {\n      options.TokenValidationParameters = new TokenValidationParameters{\n        IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(jwtKey!)),\n        ValidateIssuerSigningKey = true,\n        ValidIssuer = \"example.com\",\n        ValidateIssuer = true,\n        ValidAudience = \"example.com\",\n        ValidateAudience = true,\n        ValidateLifetime = true,\n      };\n  });\n</pre>\n<h2>How to fix it in ASP.NET</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<p>Secrets stored in <code>web.config</code> can be read by anyone with access to the file.</p>\n<pre data-diff-id=\"201\" data-diff-type=\"noncompliant\">\npublic class LoginExampleController : ApiController\n{\n    public IHttpActionResult Post([FromBody] LoginModel login)\n    {\n        // Code to validate the login information is omitted\n\n        var key = ConfigurationManager.AppSettings[\"key\"] ??\n            throw new ApplicationException(\"JWT key is not configured.\");\n        var securityKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(key));\n        var credentials = new SigningCredentials(securityKey, SecurityAlgorithms.HmacSha256);\n\n        var secToken = new JwtSecurityToken(\n            \"example.com\",\n            \"example.com\",\n            null,\n            expires: DateTime.Now.AddMinutes(120),\n            signingCredentials: credentials\n        );\n\n        var token = new JwtSecurityTokenHandler().WriteToken(secToken);\n        return Ok(token);\n    }\n}\n</pre>\n<p>Secrets that are hard-coded into the application can be read by anyone with access to the source code or can be decompiled from the application\nbinaries.</p>\n<pre>\npublic class LoginExampleController : ApiController\n{\n    private const string key = \"SecretSecretSecretSecretSecretSecretSecretSecret\";\n\n    public IHttpActionResult Post([FromBody] LoginModel login)\n    {\n        // Code to validate the login information is omitted\n\n        var securityKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(key));\n        var credentials = new SigningCredentials(securityKey, SecurityAlgorithms.HmacSha256);\n\n        var secToken = new JwtSecurityToken(\n            \"example.com\",\n            \"example.com\",\n            null,\n            expires: DateTime.Now.AddMinutes(120),\n            signingCredentials: credentials\n        );\n\n        var token = new JwtSecurityTokenHandler().WriteToken(secToken);\n        return Ok(token);\n    }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"201\" data-diff-type=\"compliant\">\npublic class LoginExampleController : ApiController\n{\n    public IHttpActionResult Post([FromBody] LoginModel login)\n    {\n        // Code to validate the login information is omitted\n\n        var key = Environment.GetEnvironmentVariable(\"JWT_KEY\") ??\n            throw new ApplicationException(\"JWT key is not configured.\");\n        var securityKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(key));\n        var credentials = new SigningCredentials(securityKey, SecurityAlgorithms.HmacSha256);\n\n        var secToken = new JwtSecurityToken(\n            \"example.com\",\n            \"example.com\",\n            null,\n            expires: DateTime.Now.AddMinutes(120),\n            signingCredentials: credentials\n        );\n\n        var token = new JwtSecurityTokenHandler().WriteToken(secToken);\n        return Ok(token);\n    }\n}\n</pre>\n<h3>How does this work?</h3>\n<p>Here, the compliant solution uses an environment variable to hold the secret. Environment variables are easy to change and are not easily\naccessible outside of the application.</p>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.identitymodel.tokens.jwt.jwtsecuritytoken?view=msal-web-dotnet-latest\">JwtSecurityToken\n  Class Class</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.identitymodel.tokens.symmetricsecuritykey?view=dotnet-plat-ext-8.0\">SymmetricSecurityKey\n  Class</a></li>\n</ul>\n<h3>Standards</h3>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures/\">Top 10 2021 Category A7 - Identification and\n  Authentication Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure\">Top 10 2017 Category A3 - Sensitive Data\n  Exposure</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/798\">CWE-798 - Use of Hard-coded Credentials</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/259\">CWE-259 - Use of Hard-coded Password</a></li>\n  <li>STIG Viewer - <a href=\"https://stigviewer.com/stigs/application_security_and_development/2024-12-06/finding/V-222642\">Application Security and\n  Development: V-222642</a> - The application must not contain embedded authentication data.</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6781.json",
    "content": "{\n  \"title\": \"JWT secret keys should not be disclosed\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"symbolic-execution\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-6781\",\n  \"sqKey\": \"S6781\",\n  \"scope\": \"All\",\n  \"securityStandards\": {\n    \"CWE\": [\n      798,\n      259\n    ],\n    \"OWASP\": [\n      \"A3\"\n    ],\n    \"CERT\": [\n      \"MSC03-J.\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A7\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"6.5.10\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"6.2.4\"\n    ],\n    \"ASVS 4.0\": [\n      \"2.10.4\",\n      \"6.4.1\"\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6797.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.supplyparameterfromqueryattribute\">SupplyParameterFromQuery</a>\nattribute can be used to specify that a component parameter, of a routable component, comes from the query string.</p>\n<p>Component parameters supplied from the query string support the following types:</p>\n<ul>\n  <li>bool, DateTime, decimal, double, float, Guid, int, long, string.</li>\n  <li>Nullable variants of the preceding types.</li>\n  <li>Arrays of the preceding types, whether they’re nullable or not nullable.</li>\n</ul>\n<p>Query parameters should have one of the supported types. Otherwise, an unhandled exception will be raised at runtime.</p>\n<pre>\nUnhandled exception rendering component: Querystring values cannot be parsed as type '&lt;type&gt;'.\nSystem.NotSupportedException: Querystring values cannot be parsed as type '&lt;type&gt;'\n...\n</pre>\n<h2>How to fix it</h2>\n<p>Change the parameter type to one of the following ones:</p>\n<ul>\n  <li>bool, DateTime, decimal, double, float, Guid, int, long, string.</li>\n  <li>Nullable variants of the preceding types.</li>\n  <li>Arrays of the preceding types, whether they’re nullable or not nullable.</li>\n</ul>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\n@page \"/print\"\n&lt;p&gt; Parameter value is: @Value &lt;/p&gt;\n@code {\n    [Parameter]\n    [SupplyParameterFromQuery()]\n    public TimeSpan Value { get; set; }     // Noncompliant\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n@page \"/print\"\n&lt;p&gt; Parameter value is: @Value &lt;/p&gt;\n@code {\n    [Parameter]\n    [SupplyParameterFromQuery()]\n    public long Value { get; set; }         // Compliant\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.supplyparameterfromqueryattribute\">SupplyParameterFromQueryAttribute</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6797.json",
    "content": "{\n  \"title\": \"Blazor query parameter type should be supported\",\n  \"type\": \"BUG\",\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"blazor\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6797\",\n  \"sqKey\": \"S6797\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6798.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>In Blazor, the <a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.jsinterop.jsinvokableattribute\">[JSInvokable]</a> attribute is used\nto annotate a method, enabling it to be invoked from JavaScript code. The prerequisite for this functionality is that the method must be declared as\n<code>public</code>.\n  <br>\n  Otherwise, a runtime error will be triggered when an attempt is made to call the method from JavaScript.</p>\n<h2>How to fix it</h2>\n<p>To fix the issue, ensure the methods annotated with the <code>[JSInvokable]</code> attribute are <code>public.</code></p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\n@code {\n    [JSInvokable]\n    private static void MyStaticMethod() { } // Noncompliant\n\n    [JSInvokable]\n    internal void MyMethod() { } // Noncompliant\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n@code {\n    [JSInvokable]\n    public static void MyStaticMethod() { } // Compliant\n\n    [JSInvokable]\n    public void MyMethod() { } // Compliant\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/blazor/javascript-interoperability/call-dotnet-from-javascript\">Call\n  .NET methods from JavaScript functions in ASP.NET Core Blazor</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.jsinterop.jsinvokableattribute\">JSInvokableAttribute\n  Class</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6798.json",
    "content": "{\n  \"title\": \"[JSInvokable] attribute should only be used on public methods\",\n  \"type\": \"BUG\",\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"blazor\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6798\",\n  \"sqKey\": \"S6798\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6800.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>In Blazor, when a <a href=\"https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/routing#route-constraints\">route parameter\nconstraint</a> is applied, the value is automatically cast to the corresponding component parameter type. If the constraint type does not match the\ncomponent parameter type, it can lead to confusion and potential runtime errors due to unsuccessful casting. Therefore, it is crucial to ensure that\nthe types of route parameters and component parameters match to prevent such issues and maintain code clarity.</p>\n<h2>How to fix it</h2>\n<p>Ensure the component parameter type matches the route parameter constraint type.</p>\n<table>\n  <colgroup>\n    <col style=\"width: 50%;\">\n    <col style=\"width: 50%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>Constraint Type</th>\n      <th>.NET Type</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p>bool</p>\n      </td>\n      <td>\n        <p>bool</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>datetime</p>\n      </td>\n      <td>\n        <p>DateTime</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>decimal</p>\n      </td>\n      <td>\n        <p>decimal</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>double</p>\n      </td>\n      <td>\n        <p>double</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>float</p>\n      </td>\n      <td>\n        <p>float</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>guid</p>\n      </td>\n      <td>\n        <p>Guid</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>int</p>\n      </td>\n      <td>\n        <p>int</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>long</p>\n      </td>\n      <td>\n        <p>long</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>string</p>\n      </td>\n      <td>\n        <p>string</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\n@page \"/my-route/{Param:datetime}\"\n\n@code {\n    [Parameter]\n    public string Param { get; set; } // Noncompliant\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n@page \"/my-route/{Param:datetime}\"\n\n@code {\n    [Parameter]\n    public DateTime Param { get; set; } // Compliant\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/routing#route-constraints\">Blazor routing and\n  navigation - Route Constraints</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6800.json",
    "content": "{\n  \"title\": \"Component parameter type should match the route parameter type constraint\",\n  \"type\": \"BUG\",\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"blazor\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6800\",\n  \"sqKey\": \"S6800\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6802.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>In Blazor, using <a href=\"https://learn.microsoft.com/en-us/aspnet/core/blazor/components/event-handling#lambda-expressions\">lambda expressions</a>\nas <a href=\"https://learn.microsoft.com/en-us/aspnet/core/blazor/components/event-handling#lambda-expressions\">event handlers</a> when the UI elements\nare rendered in a loop can lead to negative user experiences and performance issues. This is particularly noticeable when rendering a large number of\nelements.</p>\n<p>The reason behind this is that Blazor rebuilds all lambda expressions within the loop every time the UI elements are rendered.</p>\n<h2>How to fix it</h2>\n<p>Ensure to not use a delegate in elements rendered in loops, you can try:</p>\n<ul>\n  <li>using a collection of objects containing the delegate as an <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.action\">Action</a>,</li>\n  <li>or extracting the elements into a dedicated component and using an <a\n  href=\"https://learn.microsoft.com/en-us/aspnet/core/blazor/components/event-handling#eventcallback\">EventCallback</a> to call the delegate</li>\n</ul>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\n@for (var i = 1; i &lt; 100; i++)\n{\n    var buttonNumber = i;\n\n    &lt;button @onclick=\"@(e =&gt; DoAction(e, buttonNumber))\"&gt; @* Noncompliant *@\n        Button #@buttonNumber\n    &lt;/button&gt;\n}\n\n@code {\n    private void DoAction(MouseEventArgs e, int button)\n    {\n        // Do something here\n    }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n@foreach (var button in Buttons)\n{\n    &lt;button @key=\"button.Id\" @onclick=\"button.Action\"&gt;  @* Compliant *@\n        Button #@button.Id\n    &lt;/button&gt;\n}\n\n@code {\n    private List&lt;Button&gt; Buttons { get; set; } = new();\n\n    protected override void OnInitialized()\n    {\n        for (var i = 0; i &lt; 100; i++)\n        {\n            var button = new Button();\n\n            button.Action = (e) =&gt; DoAction(e, button);\n\n            Buttons.Add(button);\n        }\n    }\n\n    private void DoAction(MouseEventArgs e, Button button)\n    {\n        // Do something here\n    }\n\n    private class Button\n    {\n        public string? Id { get; } = Guid.NewGuid().ToString();\n        public Action&lt;MouseEventArgs&gt; Action { get; set; } = e =&gt; { };\n    }\n}\n</pre>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\n@* Component.razor *@\n\n@for (var i = 1; i &lt; 100; i++)\n{\n    var buttonNumber = i;\n\n    &lt;button @onclick=\"@(e =&gt; DoAction(e, buttonNumber))\"&gt; @* Noncompliant *@\n        Button #@buttonNumber\n    &lt;/button&gt;\n}\n\n@code {\n    private void DoAction(MouseEventArgs e, int button)\n    {\n        // Do something here\n    }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\n@* MyButton.razor *@\n\n&lt;button @onclick=\"OnClickCallback\"&gt;\n    @ChildContent\n&lt;/button&gt;\n\n@code {\n    [Parameter]\n    public int Id { get; set; }\n\n    [Parameter]\n    public EventCallback&lt;int&gt; OnClick { get; set; }\n\n    [Parameter]\n    public RenderFragment ChildContent { get; set; }\n\n    private void OnClickCallback()\n    {\n        OnClick.InvokeAsync(Id);\n    }\n}\n\n@* Component.razor *@\n\n@for (var i = 1; i &lt; 100; i++)\n{\n    var buttonNumber = i;\n    &lt;MyButton Id=\"buttonNumber\" OnClick=\"DoAction\"&gt;\n        Button #@buttonNumber\n    &lt;/MyButton&gt;\n}\n\n@code {\n    private void DoAction(int button)\n    {\n        // Do something here\n    }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/aspnet/core/blazor/performance#avoid-recreating-delegates-for-many-repeated-elements-or-components\">ASP.NET\n  Core Blazor performance best practices</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/blazor/components/event-handling#lambda-expressions\">ASP.NET Core\n  Blazor event handling - Lambda expressions</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/blazor/components/event-handling#eventcallback\">Event handling -\n  EventCallback Struct</a></li>\n</ul>\n<h3>Benchmarks</h3>\n<p>The results were generated with the help of <a href=\"https://github.com/dotnet/BenchmarkDotNet\">BenchmarkDotNet</a> and <a\nhref=\"https://github.com/egil/Benchmark.Blazor/tree/main\">Benchmark.Blazor</a>:</p>\n<table>\n  <colgroup>\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>Method</th>\n      <th>NbButtonRendered</th>\n      <th>Mean</th>\n      <th>StdDev</th>\n      <th>Ratio</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p>UseDelegate</p>\n      </td>\n      <td>\n        <p>10</p>\n      </td>\n      <td>\n        <p>6.603 us</p>\n      </td>\n      <td>\n        <p>0.0483 us</p>\n      </td>\n      <td>\n        <p>1.00</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>UseAction</p>\n      </td>\n      <td>\n        <p>10</p>\n      </td>\n      <td>\n        <p>1.994 us</p>\n      </td>\n      <td>\n        <p>0.0592 us</p>\n      </td>\n      <td>\n        <p>0.29</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>UseDelegate</p>\n      </td>\n      <td>\n        <p>100</p>\n      </td>\n      <td>\n        <p>50.666 us</p>\n      </td>\n      <td>\n        <p>0.5449 us</p>\n      </td>\n      <td>\n        <p>1.00</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>UseAction</p>\n      </td>\n      <td>\n        <p>100</p>\n      </td>\n      <td>\n        <p>2.016 us</p>\n      </td>\n      <td>\n        <p>0.0346 us</p>\n      </td>\n      <td>\n        <p>0.04</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>UseDelegate</p>\n      </td>\n      <td>\n        <p>1000</p>\n      </td>\n      <td>\n        <p>512.513 us</p>\n      </td>\n      <td>\n        <p>9.7561 us</p>\n      </td>\n      <td>\n        <p>1.000</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>UseAction</p>\n      </td>\n      <td>\n        <p>1000</p>\n      </td>\n      <td>\n        <p>2.005 us</p>\n      </td>\n      <td>\n        <p>0.0243 us</p>\n      </td>\n      <td>\n        <p>0.004</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<p>Hardware configuration:</p>\n<pre>\nBenchmarkDotNet v0.13.9+228a464e8be6c580ad9408e98f18813f6407fb5a, Windows 10 (10.0.19045.3448/22H2/2022Update)\n12th Gen Intel Core i7-12800H, 1 CPU, 20 logical and 14 physical cores\n.NET SDK 8.0.100-rc.1.23463.5\n  [Host]   : .NET 7.0.11 (7.0.1123.42427), X64 RyuJIT AVX2\n  .NET 7.0 : .NET 7.0.11 (7.0.1123.42427), X64 RyuJIT AVX2\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6802.json",
    "content": "{\n  \"title\": \"Using lambda expressions in loops should be avoided in Blazor markup section\",\n  \"type\": \"CODE_SMELL\",\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1h\"\n  },\n  \"tags\": [\n    \"blazor\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6802\",\n  \"sqKey\": \"S6802\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6803.html",
    "content": "<p><strong>This rule is deprecated, and will eventually be removed.</strong></p>\n<p>Component parameters can only receive query parameter values in routable components with an @page directive.</p>\n<h2>Why is this an issue?</h2>\n<p><a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.supplyparameterfromqueryattribute\">SupplyParameterFromQuery</a>\nattribute is used to specify that a component parameter of a routable component comes from the <a\nhref=\"https://en.wikipedia.org/wiki/Query_string\">query string</a>.</p>\n<p>In the case of non-routable components, the <code>SupplyParameterFromQuery</code> does not contribute to the functionality, and removing it will\nnot affect the behavior.</p>\n<h2>How to fix it</h2>\n<p>Either make the component routable or remove the <code>SupplyParameterFromQuery</code> attribute.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\n&lt;h3&gt;Component&lt;/h3&gt;\n\n@code {\n    [Parameter]\n    [SupplyParameterFromQuery]  // Noncompliant\n    public bool Param { get; set; }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n@page \"/component\"\n\n&lt;h3&gt;Component&lt;/h3&gt;\n\n@code {\n    [Parameter]\n    [SupplyParameterFromQuery]  // Compliant\n    public bool Param { get; set; }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/routing#query-strings\">Query strings</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.supplyparameterfromqueryattribute\">SupplyParameterFromQueryAttribute Class</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Query_string\">query string</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6803.json",
    "content": "{\n  \"title\": \"Parameters with SupplyParameterFromQuery attribute should be used only in routable components\",\n  \"type\": \"CODE_SMELL\",\n  \"status\": \"deprecated\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"blazor\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6803\",\n  \"sqKey\": \"S6803\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6930.html",
    "content": "<p>Backslash characters (<code>\\</code>) should be avoided in <a\nhref=\"https://learn.microsoft.com/en-us/aspnet/core/fundamentals/routing#route-templates\">route templates</a>.</p>\n<h2>Why is this an issue?</h2>\n<p><a href=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/routing\">Routing</a> in ASP.NET MVC maps <a\nhref=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/actions#what-is-a-controller\">controllers</a> and <a\nhref=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/actions#defining-actions\">actions</a> to paths in request <a\nhref=\"https://en.wikipedia.org/wiki/Uniform_Resource_Identifier\">URIs</a>.</p>\n<p>In the former syntax specification of URIs, backslash characters (<code>\\</code>) were not allowed at all (see <a\nhref=\"https://datatracker.ietf.org/doc/html/rfc2396/#section-2.4.3\">section \"2.4.3. Excluded US-ASCII Characters\" of RFC 2396</a>). While the current\nspecification (<a href=\"https://datatracker.ietf.org/doc/html/rfc3986\">RFC 3986</a>) doesn’t include anymore the \"Excluded US-ASCII Characters\"\nsection, most URL processors still don’t support backslash properly.</p>\n<p>For instance, a backslash in the <a href=\"https://datatracker.ietf.org/doc/html/rfc3986#section-3.3\">\"path\" part</a> of a <a\nhref=\"https://en.wikipedia.org/wiki/URL#Syntax\">URL</a> is automatically converted to a forward slash (<code>/</code>) both by Chrome and Internet\nExplorer (see <a href=\"https://stackoverflow.com/q/10438008\">here</a>).</p>\n<p>As an example, <code>\\Calculator\\Evaluate?expression=3\\4</code> is converted on the fly into <code>/Calculator/Evaluate?expression=3\\4</code>\nbefore the HTTP request is made to the server.</p>\n<p>While backslashes are allowed in the \"query\" part of a URL, and it’s common to have them as part of a complex query expression, the route of a\ncontroller is always part of the \"path\".</p>\n<p>That is why the use of backslashes in controller templates should be avoided in general.</p>\n<h3>What is the potential impact?</h3>\n<p>A backslash in the route pattern of a controller would only make sense if the developer intended the backslash in the route to be explicitly\nescaped by the user, using <a href=\"https://en.wikipedia.org/wiki/Percent-encoding#Character_data\"><code>%5C</code></a>.</p>\n<p>For example, the route <code>Something\\[controller]</code> for the <code>HomeController</code> would need to be called as\n<code>Something%5CHome</code>.</p>\n<p>The validity of such a scenario is unlikely and the resulting behavior is surprising.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\n[Route(@\"Something\\[controller]\")] // Noncompliant: Replace '\\' with '/'.\npublic class HomeController : Controller\n{\n    [HttpGet]\n    public ActionResult Index() =&gt; View();\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n[Route(@\"Something/[controller]\")] // '\\' replaced with '/'\npublic class HomeController : Controller\n{\n    [HttpGet]\n    public ActionResult Index() =&gt; View();\n}\n</pre>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\napp.MapControllerRoute(\n    name: \"default\",\n    pattern: \"{controller=Home}\\\\{action=Index}\"); // Noncompliant: Replace '\\' with '/'.\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\napp.MapControllerRoute(\n    name: \"default\",\n    pattern: \"{controller=Home}/{action=Index}\"); // '\\' replaced with '/'\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/fundamentals/routing\">Routing in ASP.NET Core</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/routing\">Routing to controller actions in ASP.NET\n  Core</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/actions\">Handle requests with controllers in ASP.NET\n  Core MVC</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Uniform_Resource_Identifier\">Uniform Resource Identifier</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/URL#Syntax\">URL - Syntax</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Percent-encoding\">Percent-encoding</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li>StackOverflow - <a href=\"https://stackoverflow.com/questions/10438008\">Different behaviours of treating \\ (backslash) in the url by FireFox and\n  Chrome</a></li>\n</ul>\n<h3>Standards</h3>\n<ul>\n  <li>IETF.org - <a href=\"https://datatracker.ietf.org/doc/html/rfc3986\">RFC 3986 - Uniform Resource Identifier (URI): Generic Syntax</a></li>\n  <li>IETF.org - <a href=\"https://datatracker.ietf.org/doc/html/rfc2396\">RFC 2396 - Uniform Resource Identifiers (URI): Generic Syntax (OBSOLETE,\n  replaced by RFC 3986)</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6930.json",
    "content": "{\n  \"title\": \"Backslash should be avoided in route templates\",\n  \"type\": \"BUG\",\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"asp.net\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6930\",\n  \"sqKey\": \"S6930\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"targeted\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6931.html",
    "content": "<p>Route templates for <a href=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/actions#defining-actions\">ASP.NET controller\nactions</a>, defined via a <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.routeattribute\"><code>RouteAttribute</code></a> or any derivation of <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.routing.httpmethodattribute\"><code>HttpMethodAttribute</code></a>, should\nnot start with \"/\".</p>\n<h2>Why is this an issue?</h2>\n<p><a href=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/routing\">Routing</a> in ASP.NET Core MVC maps <a\nhref=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/actions#what-is-a-controller\">controllers</a> and <a\nhref=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/actions#defining-actions\">actions</a> to paths in request <a\nhref=\"https://en.wikipedia.org/wiki/Uniform_Resource_Identifier\">URIs</a>. Similar <a\nhref=\"https://learn.microsoft.com/en-us/aspnet/mvc/overview/older-versions-1/controllers-and-routing/asp-net-mvc-routing-overview-cs\">routing</a>\nhappens in ASP.NET Framework MVC.</p>\n<p>In ASP.NET Core MVC, when an action defines a route template starting with a \"/\", the route is considered absolute and the action is registered at\nthe root of the web application.</p>\n<p>In such a scenario, any route defined at the controller level is disregarded, as shown in the following example:</p>\n<pre>\n[Route(\"[controller]\")]  // This route is ignored for the routing of Index1 and Index2\npublic class HomeController : Controller\n{\n    [HttpGet(\"/Index1\")] // This action is mapped to the root of the web application\n    public ActionResult Index1() =&gt; View();\n\n    [Route(\"/Index2\")]   // The same applies here\n    public ActionResult Index2() =&gt; View();\n}\n</pre>\n<p>The behavior can be found confusing and surprising because any relative action route is relativized to the controller route.</p>\n<p>Therefore, in the vast majority of scenarios, controllers group all related actions not only in the source code, but also at the routing level.</p>\n<p>In ASP.NET Framework MVC with attribute routing enabled via <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.web.mvc.routecollectionattributeroutingextensions.mapmvcattributeroutes\"><code>MapMvcAttributeRoutes</code></a>,\nthe mere presence of an absolute route at the action level will produce an <code>InvalidOperationException</code> at runtime.</p>\n<p>It is then a good practice to avoid absolute routing at the action level and move the \"/\" to the root level, changing the template defined in the\n<code>RouteAttribute</code> of the controller appropriately.</p>\n<h3>Exceptions</h3>\n<p>The rule only applies when all route templates of all actions of the controller start with \"/\". Sometimes some actions may have both relative and\nabsolute route templates, for example for backward compatibility reasons (i.e. a former route needs to be preserved). In such scenarios, it may make\nsense to keep the absolute route template at the action level.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\n[Route(\"[controller]\")]  // This route is ignored\npublic class ReviewsController : Controller // Noncompliant\n{\n    // Route is /reviews\n    [HttpGet(\"/reviews\")]\n    public ActionResult Index() { /* ... */ }\n\n    // Route is /reviews/{reviewId}\n    [Route(\"/reviews/{reviewId}\")]\n    public ActionResult Show(int reviewId)() { /* ... */ }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n[Route(\"/\")] // Turns on attribute routing\npublic class ReviewsController : Controller\n{\n    // Route is /reviews\n    [HttpGet(\"reviews\")]\n    public ActionResult Index() { /* ... */ }\n\n    // Route is /reviews/{reviewId}\n    [Route(\"reviews/{reviewId}\")]\n    public ActionResult Show(int reviewId)() { /* ... */ }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/routing\">ASP.NET Core: Routing to controller actions in\n  ASP.NET Core</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/routing#attribute-routing-for-rest-apis\">ASP.NET Core:\n  Routing to controller actions in ASP.NET Core - Attribute routing for REST APIs</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/actions\">ASP.NET Core: Handle requests with controllers\n  in ASP.NET Core MVC</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/aspnet/mvc/overview/older-versions-1/controllers-and-routing/asp-net-mvc-routing-overview-cs\">ASP.NET MVC\n  Routing Overview (C#)</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li>.NET Blog - <a href=\"https://devblogs.microsoft.com/dotnet/attribute-routing-in-asp-net-mvc-5/\">Attribute Routing in ASP.NET MVC 5</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6931.json",
    "content": "{\n  \"title\": \"ASP.NET controller actions should not have a route template starting with \\\"\\/\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"asp.net\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6931\",\n  \"sqKey\": \"S6931\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"partial\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6932.html",
    "content": "<p>The <code>HttpRequest</code> class provides access to the raw request data through the <code>QueryString</code>, <code>Headers</code>, and\n<code>Forms</code> properties. However, whenever possible it is recommended to use model binding instead of directly accessing the input data.</p>\n<h2>Why is this an issue?</h2>\n<p>Both ASP.Net MVC implementations - <a href=\"https://learn.microsoft.com/en-us/aspnet/core\">Core</a> and <a\nhref=\"https://learn.microsoft.com/en-us/aspnet/overview\">Framework</a> - support model binding in a comparable fashion. Model binding streamlines the\nprocess by automatically aligning data from HTTP requests with action method parameters, providing numerous benefits compared to manually parsing raw\nincoming request data:</p>\n<dl>\n  <dt>Simplicity</dt>\n  <dd>\n    <p>Model binding simplifies the code by automatically mapping data from HTTP requests to action method parameters. You don’t need to write any\n    code to manually extract values from the request.</p>\n  </dd>\n  <dt>Type Safety</dt>\n  <dd>\n    <p>Model binding provides type safety by automatically converting the incoming data into the appropriate .NET types. If the conversion fails, the\n    model state becomes invalid, which you can easily check using <code>ModelState.IsValid</code>.</p>\n  </dd>\n  <dt>Validation</dt>\n  <dd>\n    <p>With model binding, you can easily apply validation rules to your models using data annotations. If the incoming data doesn’t comply with these\n    rules, the model state becomes invalid.</p>\n  </dd>\n  <dt>Security</dt>\n  <dd>\n    <p>Model binding helps protect against over-posting attacks by only including properties in the model that you explicitly bind using the\n    <code>[Bind]</code> attribute or by using view models that only contain the properties you want to update.</p>\n  </dd>\n  <dt>Maintainability</dt>\n  <dd>\n    <p>By using model binding, your code becomes cleaner, easier to read, and maintain. It promotes the use of strongly typed views, which can provide\n    compile-time checking of your views.</p>\n  </dd>\n</dl>\n<h2>How to fix it in ASP.NET Core</h2>\n<p><a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.httprequest.form\"><code>Request.Form</code></a>, <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.iformcollection.files\"><code>Request.Form.Files</code></a>, <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.httprequest.headers\"><code>Request.Headers</code></a>, <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.httprequest.query\"><code>Request.Query</code></a> and <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.httprequest.routeValues\"><code>Request.RouteValues</code></a> are keyed\ncollections that expose data from the incoming HTTP request:</p>\n<ul>\n  <li><code>Request.Form</code> - <a\n  href=\"https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST#:~:text=%3Cbutton%3E%20elements%3A-,application/x%2Dwww%2Dform%2Durlencoded,-%3A%20the%20keys%20and\"><code>application/x-www-form-urlencoded</code></a> form data from the HTTP request body</li>\n  <li><code>Request.Form.Files</code> - <a\n  href=\"https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST#:~:text=form%2Ddata%20instead)-,multipart/form%2Ddata,-%3A%20each%20value%20is\"><code>multipart/form-data</code></a> file data from the HTTP request body</li>\n  <li><code>Request.Headers</code> - <a href=\"https://developer.mozilla.org/en-US/docs/Glossary/Request_header\">HTTP Header values</a></li>\n  <li><code>Request.Query</code> - <a\n  href=\"https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Web_mechanics/What_is_a_URL#parameters\">URL parameter values</a></li>\n  <li><code>Request.RouteValues</code> - Values extracted from the <a\n  href=\"https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Web_mechanics/What_is_a_URL#path_to_resource\">path portion of the URL</a></li>\n</ul>\n<p>Model binding can bind these keyed collections to</p>\n<ul>\n  <li>action method parameters by matching the key to the parameter name or</li>\n  <li>the property of a complex type by matching the key to the property name.</li>\n</ul>\n<p>To replace the keyed collection access, you can:</p>\n<table>\n  <colgroup>\n    <col style=\"width: 25%;\">\n    <col style=\"width: 25%;\">\n    <col style=\"width: 25%;\">\n    <col style=\"width: 25%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>Replace</th>\n      <th>with parameter binding</th>\n      <th>or complex type binding</th>\n      <th>or route binding</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p><code><a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.httprequest.form\">Request.Form</a>[\"id\"]</code></p>\n      </td>\n      <td>\n        <p>optional <a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.fromformattribute\"><code>[FromForm]</code></a>\n        attribute on the parameter or a <a\n        href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.formcollection\"><code>FormCollection</code></a> parameter</p>\n      </td>\n      <td>\n        <p>optional <a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.fromformattribute\"><code>[FromForm]</code></a>\n        attribute on the property</p>\n      </td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p><a\n        href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.iformcollection.files\"><code>Request.Form.Files</code></a></p>\n      </td>\n      <td>\n        <p><a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.iformfile\"><code>IFormFile</code></a>, <a\n        href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.iformfilecollection\"><code>IFormFileCollection</code></a>, or\n        <code>IEnumerable&lt;IFormFile&gt;</code> parameter</p>\n      </td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p><code><a\n        href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.httprequest.headers\">Request.Headers</a>[\"id\"]</code></p>\n      </td>\n      <td>\n        <p><a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.fromheaderattribute\"><code>[FromHeader]</code></a> attribute\n        on the parameter</p>\n      </td>\n      <td>\n        <p><a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.fromheaderattribute\"><code>[FromHeader]</code></a> attribute\n        on the property</p>\n      </td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p><code><a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.httprequest.query\">Request.Query</a>[\"id\"]</code></p>\n      </td>\n      <td>\n        <p>optional <a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.fromqueryattribute\"><code>[FromQuery]</code></a>\n        attribute on the parameter</p>\n      </td>\n      <td>\n        <p>optional <a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.fromqueryattribute\"><code>[FromQuery]</code></a>\n        attribute on the property</p>\n      </td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p><code><a\n        href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.httprequest.routevalues\">Request.RouteValues</a>[\"id\"]</code></p>\n      </td>\n      <td>\n        <p>optional <a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.fromrouteattribute\"><code>[FromRoute]</code></a>\n        attribute on the parameter</p>\n      </td>\n      <td></td>\n      <td>\n        <p>optional <a\n        href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.fromrouteattribute\"><code>[Route(\"{id}\")]</code></a>attribute on\n        the action method/controller or via conventional routing</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<p>The <a href=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/models/model-binding\">Model Binding in ASP.NET Core</a> article describes the\nmechanisms, conventions, and customization options for model binding in more detail. Route-based binding is described in the <a\nhref=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/routing\">Routing to controller actions in ASP.NET Core</a> document.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic IActionResult Post()\n{\n    var name = Request.Form[\"name\"];                           // Noncompliant: Request.Form\n    var birthdate = DateTime.Parse(Request.Form[\"Birthdate\"]); // Noncompliant: Request.Form\n\n    var locale = Request.Query.TryGetValue(\"locale\", out var locales)\n        ? locales.ToString()\n        : \"en-US\";                                             // Noncompliant: Request.Query\n    // ..\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic record User\n{\n    [Required, StringLength(100)]\n    public required string Name { get; init; }\n    [DataType(DataType.Date)]\n    public DateTime? Birthdate { get; init; }\n}\n\npublic IActionResult Post(User user, [FromHeader] string origin, [FromQuery] string locale = \"en-US\")\n{\n    if (ModelState.IsValid)\n    {\n        // ...\n    }\n}\n</pre>\n<h3>How does this work?</h3>\n<p>Model binding in ASP.NET Core MVC and ASP.NET MVC 4.x works by automatically mapping data from HTTP requests to action method parameters. Here’s a\nstep-by-step breakdown of how it works:</p>\n<ol>\n  <li><strong>Request Data</strong> When a user submits a form or sends a request to an ASP.NET application, the request data might include form data,\n  query string parameters, request body, and HTTP headers.</li>\n  <li><strong>Model Binder</strong> The model binder’s job is to create .NET objects from the request data. It looks at each parameter in the action\n  method and attempts to populate it with the incoming data.</li>\n  <li><strong>Value Providers</strong> The model binder uses Value Providers to get data from various parts of the request, such as the query string,\n  form data, or route data. Each value provider tells the model binder where to find values in the request.</li>\n  <li><strong>Binding</strong> The model binder tries to match the keys from the incoming data with the properties of the action method’s parameters.\n  If a match is found, it attempts to convert the incoming data into the appropriate .NET type and assigns it to the parameter.</li>\n  <li><strong>Validation</strong> If the model binder can’t convert the value or if the converted value doesn’t pass any specified validation rules,\n  it adds an error to the <code>ModelState.Errors</code> collection. You can check <code>ModelState.IsValid</code> in your action method to see if any\n  errors occurred during model binding.</li>\n  <li><strong>Action Method Execution</strong> The action method is executed with the bound parameters. If <code>ModelState.IsValid</code> is\n  <code>false</code>, you can handle the errors in your action method and return an appropriate response.</li>\n</ol>\n<p>See the links in the <a href=\"#_resources\">Resources</a> section for more information.</p>\n<h2>How to fix it in ASP.NET MVC 4.x</h2>\n<p><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.web.httprequestbase.form\"><code>Request.Form</code></a> and <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.web.httprequestbase.querystring\"><code>Request.QueryString</code></a> are keyed collections\nthat expose data from the incoming HTTP request:</p>\n<ul>\n  <li><code>Request.Form</code> - <a\n  href=\"https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST#:~:text=%3Cbutton%3E%20elements%3A-,application/x%2Dwww%2Dform%2Durlencoded,-%3A%20the%20keys%20and\"><code>application/x-www-form-urlencoded</code></a> form data from the HTTP request body</li>\n  <li><code>Request.QueryString</code> - <a\n  href=\"https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Web_mechanics/What_is_a_URL#parameters\">URL parameter values</a></li>\n</ul>\n<p>Model binding can bind these keyed collections to</p>\n<ul>\n  <li>action method parameters by matching the key to the parameter name or</li>\n  <li>the property of a complex type by matching the key to the property name.</li>\n</ul>\n<p>To replace the keyed collection access, you can:</p>\n<table>\n  <colgroup>\n    <col style=\"width: 33.3333%;\">\n    <col style=\"width: 33.3333%;\">\n    <col style=\"width: 33.3334%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>Replace</th>\n      <th>with parameter binding</th>\n      <th>or complex type binding</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p><code><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.web.httprequestbase.form\">Request.Form</a>[\"id\"]</code></p>\n      </td>\n      <td>\n        <p>optional <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.web.mvc.bindattribute\"><code>[Bind]</code></a> attribute on the\n        parameter or a <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.web.mvc.formcollection\"><code>FormCollection</code></a>\n        parameter</p>\n      </td>\n      <td>\n        <p>optional <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.web.mvc.bindattribute\"><code>[Bind]</code></a> attribute on the\n        parameter or type</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p><code><a\n        href=\"https://learn.microsoft.com/en-us/dotnet/api/system.web.httprequestbase.querystring\">Request.QueryString</a>[\"id\"]</code></p>\n      </td>\n      <td>\n        <p>optional <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.web.mvc.bindattribute\"><code>[Bind]</code></a> attribute on the\n        parameter</p>\n      </td>\n      <td>\n        <p>property name must match query parameter key</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\npublic ActionResult Post()\n{\n    var name = Request.Form[\"name\"];                            // Noncompliant: Request.Form\n    Debug.WriteLine(Request.Form[0]);                           // Compliant: Binding by index is not supported.\n    var birthdate = DateTime.Parse(Request.Form[\"Birthdate\"]);  // Noncompliant: Request.Form\n\n    var cultureName = Request.QueryString[\"locale\"] ?? \"en-US\"; // Noncompliant: Request.QueryString\n    // ..\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\npublic class User\n{\n    [Required, StringLength(100)]\n    public string Name { get; set; }\n    [DataType(DataType.Date)]\n    public DateTime? Birthdate { get; set; }\n}\n\npublic ActionResult Post(User user, [Bind(Prefix = \"locale\")] string cultureName = \"en-US\")\n{\n    if (ModelState.IsValid)\n    {\n        // ...\n    }\n}\n\npublic IActionResult Post()\n{\n    var origin = Request.Headers[HeaderNames.Origin];          // Compliant: Access via non-constant field\n    var nameField = \"name\";\n    var name = Request.Form[nameField];                        // Compliant: Access via local\n    var birthdate = DateTime.Parse(Request.Form[\"Birthdate\"]); // Compliant: Access via constant and variable keys is mixed.\n                                                               // Model binding would only work partially in the method, so we do not raise here.\n    return Ok();\n    // ..\n}\n</pre>\n<h3>How does this work?</h3>\n<p>Model binding in ASP.NET Core MVC and ASP.NET MVC 4.x works by automatically mapping data from HTTP requests to action method parameters. Here’s a\nstep-by-step breakdown of how it works:</p>\n<ol>\n  <li><strong>Request Data</strong> When a user submits a form or sends a request to an ASP.NET application, the request data might include form data,\n  query string parameters, request body, and HTTP headers.</li>\n  <li><strong>Model Binder</strong> The model binder’s job is to create .NET objects from the request data. It looks at each parameter in the action\n  method and attempts to populate it with the incoming data.</li>\n  <li><strong>Value Providers</strong> The model binder uses Value Providers to get data from various parts of the request, such as the query string,\n  form data, or route data. Each value provider tells the model binder where to find values in the request.</li>\n  <li><strong>Binding</strong> The model binder tries to match the keys from the incoming data with the properties of the action method’s parameters.\n  If a match is found, it attempts to convert the incoming data into the appropriate .NET type and assigns it to the parameter.</li>\n  <li><strong>Validation</strong> If the model binder can’t convert the value or if the converted value doesn’t pass any specified validation rules,\n  it adds an error to the <code>ModelState.Errors</code> collection. You can check <code>ModelState.IsValid</code> in your action method to see if any\n  errors occurred during model binding.</li>\n  <li><strong>Action Method Execution</strong> The action method is executed with the bound parameters. If <code>ModelState.IsValid</code> is\n  <code>false</code>, you can handle the errors in your action method and return an appropriate response.</li>\n</ol>\n<p>See the links in the <a href=\"#_resources\">Resources</a> section for more information.</p>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - Asp.Net Core - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/models/model-binding\">Model Binding in ASP.NET\n  Core</a></li>\n  <li>Microsoft Learn - Asp.Net Core - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/models/validation\">Model validation in ASP.NET Core\n  MVC and Razor Pages</a></li>\n  <li>Microsoft Learn - Asp.Net Core - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/advanced/custom-model-binding\">Custom Model Binding\n  in ASP.NET Core</a></li>\n  <li>Microsoft Learn - Asp.Net Core - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.httprequest.form\">HttpRequest.Form Property</a></li>\n  <li>Microsoft Learn - Asp.Net Core - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.iformcollection.files\">IFormCollection.Files Property</a></li>\n  <li>Microsoft Learn - Asp.Net Core - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.httprequest.headers\">HttpRequest.Headers Property</a></li>\n  <li>Microsoft Learn - Asp.Net Core - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.httprequest.query\">HttpRequest.Query Property</a></li>\n  <li>Microsoft Learn - Asp.Net Core - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.httprequest.routevalues\">HttpRequest.RouteValues Property</a></li>\n  <li>Microsoft Learn - Asp.Net Core - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.formcollection\">FormCollection\n  Class</a></li>\n  <li>Microsoft Learn - Asp.Net Core - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.iformfile\">IFormFile\n  Interface</a></li>\n  <li>Microsoft Learn - Asp.Net Core - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.iformfilecollection\">IFormFileCollection Interface</a></li>\n  <li>Microsoft Learn - Asp.Net Core - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.bindattribute\">BindAttribute\n  Class</a></li>\n  <li>Microsoft Learn - ASP.NET MVC 4.x - <a\n  href=\"https://learn.microsoft.com/en-us/aspnet/web-api/overview/formats-and-model-binding/parameter-binding-in-aspnet-web-api\">Parameter Binding in\n  ASP.NET Web API</a></li>\n  <li>Microsoft Learn - ASP.NET MVC 4.x - <a\n  href=\"https://learn.microsoft.com/en-us/aspnet/mvc/overview/getting-started/introduction/adding-a-controller\">Adding a New Controller</a></li>\n  <li>Microsoft Learn - ASP.NET MVC 4.x - <a\n  href=\"https://learn.microsoft.com/en-us/aspnet/mvc/overview/getting-started/introduction/adding-a-model\">Adding a New Model</a></li>\n  <li>Microsoft Learn - ASP.NET MVC 4.x - <a\n  href=\"https://learn.microsoft.com/en-us/aspnet/mvc/overview/getting-started/introduction/adding-validation\">Adding Validation</a></li>\n  <li>Microsoft Learn - ASP.NET MVC 4.x - <a\n  href=\"https://learn.microsoft.com/en-us/aspnet/web-api/overview/formats-and-model-binding/model-validation-in-aspnet-web-api\">Model Validation in\n  ASP.NET Web API</a></li>\n  <li>Microsoft Learn - ASP.NET MVC 4.x - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.web.httprequest.form\">HttpRequest.Form\n  Property</a></li>\n  <li>Microsoft Learn - ASP.NET MVC 4.x - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.web.httprequest.querystring\">HttpRequest.QueryString Property</a></li>\n  <li>Microsoft Learn - ASP.NET MVC 4.x - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.web.mvc.bindattribute\">BindAttribute\n  Class</a></li>\n  <li>MDN - <a href=\"https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST\">HTTP request methods &gt; POST</a></li>\n  <li>MDN - <a href=\"https://developer.mozilla.org/en-US/docs/Glossary/Request_header\">Request header</a></li>\n  <li>MDN - <a href=\"https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Web_mechanics/What_is_a_URL\">What is a URL?</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6932.json",
    "content": "{\n  \"title\": \"Use model binding instead of reading raw request data\",\n  \"type\": \"CODE_SMELL\",\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"asp.net\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6932\",\n  \"sqKey\": \"S6932\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\",\n      \"RELIABILITY\": \"MEDIUM\",\n      \"SECURITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"FOCUSED\"\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6934.html",
    "content": "<p>When a route template is defined through an attribute on an action method, conventional routing for that action is disabled. To maintain good\npractice, it’s recommended not to combine conventional and attribute-based routing within a single controller to avoid unpredicted behavior. As such,\nthe controller should exclude itself from conventional routing by applying a <code>[Route]</code> attribute.</p>\n<h2>Why is this an issue?</h2>\n<p>In <a href=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/overview\">ASP.NET Core MVC</a>, the <a\nhref=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/routing\">routing</a> middleware utilizes a series of rules and conventions to\nidentify the appropriate controller and action method to handle a specific HTTP request. This process, known as <em>conventional routing</em>, is\ngenerally established using the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.builder.controllerendpointroutebuilderextensions.mapcontrollerroute\"><code>MapControllerRoute</code></a>\nmethod. This method is typically configured in one central location for all controllers during the application setup.</p>\n<p>Conversely, <em>attribute routing</em> allows routes to be defined at the controller or action method level. It is possible to <a\nhref=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/routing#mixed-routing-attribute-routing-vs-conventional-routing\">mix both\nmechanisms</a>. Although it’s permissible to employ diverse routing strategies across multiple controllers, combining both mechanisms within one\ncontroller can result in confusion and increased complexity, as illustrated below.</p>\n<pre>\n// Conventional mapping definition\napp.MapControllerRoute(\n    name: \"default\",\n    pattern: \"{controller=Home}/{action=Index}/{id?}\");\n\npublic class PersonController\n{\n    // Conventional routing:\n    // Matches e.g. /Person/Index/123\n    public IActionResult Index(int? id) =&gt; View();\n\n    // Attribute routing:\n    // Matches e.g. /Age/Ascending (and model binds \"Age\" to sortBy and \"Ascending\" to direction)\n    // but does not match /Person/List/Age/Ascending\n    [HttpGet(template: \"{sortBy}/{direction}\")]\n    public IActionResult List(string sortBy, SortOrder direction) =&gt; View();\n}\n</pre>\n<h2>How to fix it in ASP.NET Core</h2>\n<p>When any of the controller actions are annotated with a <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.routing.httpmethodattribute\"><code>HttpMethodAttribute</code></a> with a\nroute template defined, you should specify a route template on the controller with the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.routeattribute\"><code>RouteAttribute</code></a> as well.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic class PersonController : Controller\n{\n    // Matches /Person/Index/123\n    public IActionResult Index(int? id) =&gt; View();\n\n    // Matches /Age/Ascending\n    [HttpGet(template: \"{sortBy}/{direction}\")] // Noncompliant: The \"Index\" and the \"List\" actions are\n                                                // reachable via different routing mechanisms and routes\n    public IActionResult List(string sortBy, SortOrder direction) =&gt; View();\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n[Route(\"[controller]/{action=Index}\")]\npublic class PersonController : Controller\n{\n    // Matches /Person/Index/123\n    [Route(\"{id?}\")]\n    public IActionResult Index(int? id) =&gt; View();\n\n    // Matches Person/List/Age/Ascending\n    [HttpGet(\"{sortBy}/{direction}\")] // Compliant: The route is relative to the controller\n    public IActionResult List(string sortBy, SortOrder direction) =&gt; View();\n}\n</pre>\n<p>There are also alternative options to prevent the mixing of conventional and attribute-based routing:</p>\n<pre>\n// Option 1. Replace the attribute-based routing with a conventional route\napp.MapControllerRoute(\n    name: \"Lists\",\n    pattern: \"{controller}/List/{sortBy}/{direction}\",\n    defaults: new { action = \"List\" } ); // Matches Person/List/Age/Ascending\n\n// Option 2. Use a binding, that does not depend on route templates\npublic class PersonController : Controller\n{\n    // Matches Person/List?sortBy=Age&amp;direction=Ascending\n    [HttpGet] // Compliant: Parameters are bound from the query string\n    public IActionResult List(string sortBy, SortOrder direction) =&gt; View();\n}\n\n// Option 3. Use an absolute route\npublic class PersonController : Controller\n{\n    // Matches Person/List/Age/Ascending\n    [HttpGet(\"/[controller]/[action]/{sortBy}/{direction}\")] // Illustrate the expected route by starting with \"/\"\n    public IActionResult List(string sortBy, SortOrder direction) =&gt; View();\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/overview\">Overview of ASP.NET Core MVC</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/routing\">Routing to controller actions in ASP.NET\n  Core</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/routing#mixed-routing-attribute-routing-vs-conventional-routing\">Mixed routing:\n  Attribute routing vs conventional routing</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.routing.httpmethodattribute\">HttpMethodAttribute Class</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.routeattribute\">RouteAttribute Class</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li>Medium - <a href=\"https://medium.com/quick-code/routing-in-asp-net-core-c433bff3f1a4\">Routing in ASP.NET Core</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6934.json",
    "content": "{\n  \"title\": \"A Route attribute should be added to the controller when a route template is specified at the action level\",\n  \"type\": \"CODE_SMELL\",\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"asp.net\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6934\",\n  \"sqKey\": \"S6934\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"partial\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6960.html",
    "content": "<p><a href=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/actions\">ASP.NET controllers</a> should not have mixed responsibilities.\nFollowing the <a href=\"https://en.wikipedia.org/wiki/Single_responsibility_principle\">Single Responsibility Principle (SRP)</a>, they should be kept\nlean and <a href=\"https://learn.microsoft.com/en-us/dotnet/architecture/modern-web-apps-azure/architectural-principles#separation-of-concerns\">focused\non a single, separate concern</a>. In short, they should have a <em>single reason to change</em>.</p>\n<p>The rule identifies different responsibilities by looking at groups of actions that use different sets of services defined in the controller.</p>\n<p>Basic services that are typically required by most controllers are not considered:</p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/aspnet/core/fundamentals/logging/\"><code>ILogger</code></a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Mediator_pattern\"><code>IMediator</code></a></li>\n  <li><a href=\"https://medium.com/@sumit.kharche/how-to-integrate-automapper-in-asp-net-core-web-api-b765b5bed35c\"><code>IMapper</code></a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/aspnet/core/fundamentals/configuration/\"><code>IConfiguration</code></a></li>\n  <li><a href=\"https://masstransit.io/documentation/configuration#configuration\"><code>IBus</code></a></li>\n  <li><a href=\"https://wolverinefx.io/guide/messaging/message-bus.html\"><code>IMessageBus</code></a></li>\n</ul>\n<p>The rule currently applies to ASP.NET Core only, and doesn’t cover <a\nhref=\"https://learn.microsoft.com/en-us/aspnet/core/fundamentals/choose-aspnet-framework\">ASP.NET MVC 4.x</a>.</p>\n<p>It also only takes into account web APIs controllers, i.e. the ones marked with the <a\nhref=\"https://learn.microsoft.com/en-us/aspnet/core/web-api/#apicontroller-attribute\"><code>ApiController</code> attribute</a>. MVC controllers are\nnot in scope.</p>\n<h2>Why is this an issue?</h2>\n<p>Multiple issues can appear when the Single Responsibility Principle (SRP) is violated.</p>\n<h3>Harder to read and understand</h3>\n<p>A controller violating SRP is <strong>harder to read and understand</strong> since its Cognitive Complexity is generally above average (see\n{rule:csharpsquid:S3776}).</p>\n<p><em>For example, a controller <code>MediaController</code> that is in charge of both the \"movies\" and \"photos\" APIs would need to define all the\nactions dealing with movies, alongside the ones dealing with photos, all defined in the same controller class.</em></p>\n<p><em>The alternative is to define two controllers: a <code>MovieController</code> and a <code>PhotoController</code>, each in charge of a smaller\nnumber of actions.</em></p>\n<h3>Harder to maintain and modify</h3>\n<p>Such complexity makes the controller <strong>harder to maintain and modify</strong>, slowing down new development and <a\nhref=\"https://arxiv.org/abs/1912.01142\">increasing the likelihood of bugs</a>.</p>\n<p><em>For example, a change in <code>MediaController</code> made for the movies APIs may inadvertently have an impact on the photos APIs as well.\nBecause the change was made in the context of movies, tests on photos may be overlooked, resulting in bugs in production.</em></p>\n<p><em>That would not be likely to happen when two distinct controllers, <code>MovieController</code> and a <code>PhotoController</code>, are\ndefined.</em></p>\n<h3>Harder to test</h3>\n<p>The controller also becomes <strong>harder to test</strong> since the test suite would need to define a set of tests for each of the\nresponsibilities of the controller, resulting in a large and complex test suite.</p>\n<p><em>For example, the <code>MediaController</code> introduced above would need to be tested on all movies-related actions, as well as on all\nphotos-related actions.</em></p>\n<p><em>All those tests would be defined in the same test suite for <code>MediaController</code>, which would be affected by the same issues of\ncognitive complexity as the controller under test by the suite.</em></p>\n<h3>Harder to reuse</h3>\n<p>A controller that has multiple responsibilities is <strong>less likely to be reusable</strong>. Lack of reuse can result in code duplication.</p>\n<p><em>For example, when a new controller wants to derive from an existing one, it’s less probable that the new controller requires all the behaviors\nexposed by the reused controller.</em></p>\n<p><em>Rather, it’s much more common that the new controller only needs to reuse a fraction of the existing one. When reuse is not possible, the only\nvalid alternative is to duplicate part of the logic in the new controller.</em></p>\n<h3>Higher likelihood of performance issues</h3>\n<p>A controller that has multiple responsibilities may end up doing more than strictly necessary, resulting in a <strong>higher likelihood of\nperformance issues</strong>.</p>\n<p>To understand why, it’s important to consider the difference between ASP.NET application vs non-ASP.NET applications.</p>\n<p>In a non-ASP.NET application, controllers may be defined as <a href=\"https://en.wikipedia.org/wiki/Singleton_pattern\">Singletons</a> via a <a\nhref=\"https://learn.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection\">Dependency Injection</a> library.</p>\n<p>In such a scenario, they would typically be instantiated only once, lazily or eagerly, at application startup.</p>\n<p>In ASP.NET applications, however, the default is that controllers are instantiated <em>as many times as the number of requests that are served by\nthe web server</em>. Each instance of the controller would need to resolve services independently.</p>\n<p>While <strong>service instantiation</strong> is typically handled at application startup, <strong>service resolution</strong> happens every time an\ninstance of controller needs to be built, for each service declared in the controller.</p>\n<p>Whether the resolution is done via Dependency Injection, direct static access (in the case of a Singleton), or a <a\nhref=\"https://en.wikipedia.org/wiki/Service_locator_pattern\">Service Locator</a>, the cost of resolution needs to be paid at every single\ninstantiation.</p>\n<p><em>For example, the movies-related APIs of the <code>MediaController</code> mentioned above may require the instantiation of an\n<code>IStreamingService</code>, typically done via <a\nhref=\"https://learn.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection\">dependency injection</a>. Such a service may not be relevant\nfor photos-related APIs.</em></p>\n<p><em>Similarly, some of the photos-related APIs may require the instantiation of an <code>IRedEyeRemovalService</code>, which may not work at all\nwith movies.</em></p>\n<p><em>Having a single controller would force the developer to deal with both instantiations, even though a given instance of the controller may be\nused only for photos, or only for movies.</em></p>\n<h3>More complex routing</h3>\n<p>A controller that deals with multiple concerns often has unnecessarily complex routing: the route template at controller level cannot factorize the\nroute identifying the concern, so the full route template needs to be defined at the action level.</p>\n<p><em>For example, the <code>MediaController</code> would have an empty route (or equivalent, e.g. <code>/</code> or <code>~/</code>) and the actions\nwould need to define themselves the <code>movie</code> or <code>photo</code> prefix, depending on the type of media they deal with.</em></p>\n<p><em>On the other hand, <code>MovieController</code> and <code>PhotoController</code> can factorize the <code>movie</code> and <code>photo</code>\nroute respectively, so that the route on the action would only contain action-specific information.</em></p>\n<h3>What is the potential impact?</h3>\n<p>As the size and the responsibilities of the controller increase, the issues that come with such an increase will have a further impact on the\ncode.</p>\n<ul>\n  <li>The increased complexity of reading and understanding the code may require the introduction of <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/preprocessor-directives#defining-regions\">regions</a> or <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/partial-classes-and-methods\">partial classes</a>, to be\n  able to visually separate the actions related to the different concerns. Those are patches, that don’t address the underlying issue.</li>\n  <li>The increased complexity to maintain and modify will not give incentives to keep the architecture clean, leading to a <strong>more tightly\n  coupled and less modular system</strong>.</li>\n  <li>The reduced reusability of the code may bring <strong>code duplication</strong>, which breaks the <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/architecture/modern-web-apps-azure/architectural-principles#dont-repeat-yourself-dry\">Don’t repeat\n  yourself (DRY)</a> principle and which itself comes with a whole lot of issues, such as <strong>lack of maintainability and\n  consistency</strong>.</li>\n  <li>The performance penalty of conflating multiple responsibilities into a single controller may induce the use of techniques such as lazy service\n  resolution (you can find an example of this approach <a\n  href=\"https://medium.com/@jayeshtambe/lazy-t-in-dependency-injection-with-c-net-core-c418cc80cd13\">here</a>). Those <strong>increase the\n  complexity</strong> of the code and make the <strong>runtime behavior less predictable</strong>.</li>\n</ul>\n<h3>Why MVC controllers are not in scope</h3>\n<p>Alongside <a href=\"https://learn.microsoft.com/en-us/aspnet/web-api/overview/web-api-routing-and-actions/attribute-routing-in-web-api-2\">attribute\nrouting</a>, which is typical of web APIs, MVC controllers also come with [conventional routing].</p>\n<p>In MVC, the file structure of controllers is important, since it drives <a\nhref=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/routing#conventional-routing\">conventional routing</a>, which is specific to MVC,\nas well as <a href=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/views/overview#how-controllers-specify-views\">default view mapping</a>.</p>\n<p>For those reasons, splitting an MVC controller into smaller pieces may break core behaviors of the web application such as routing and views,\ntriggering a large refactor of the whole project.</p>\n<h2>How to fix it in ASP.NET Core</h2>\n<p>Split the controller into multiple controllers, each dealing with a single responsibility.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\n[Route(\"media\")]\npublic class MediaController( // Noncompliant: This controller has multiple responsibilities and could be split into 2 smaller units.\n    // Used by all actions\n    ILogger&lt;MediaController&gt; logger,\n    // Movie-specific dependencies\n    IStreamingService streamingService, ISubtitlesService subtitlesService,\n    // Photo-specific dependencies\n    IRedEyeRemovalService redEyeRemovalService, IPhotoEnhancementService photoEnhancementService) : Controller\n{\n    [Route(\"movie/stream\")]\n    public IActionResult MovieStream([FromQuery] StreamRequest request) // Belongs to responsibility #1.\n    {\n        logger.LogInformation(\"Requesting movie stream for {MovieId}\", request.MovieId);\n        return File(streamingService.GetStream(request.MovieId), \"video/mp4\");\n    }\n\n    [Route(\"movie/subtitles\")]\n    public IActionResult MovieSubtitles([FromQuery] SubtitlesRequest request) // Belongs to responsibility #1.\n    {\n        logger.LogInformation(\"Requesting movie subtitles for {MovieId}\", request.MovieId);\n        return File(subtitlesService.GetSubtitles(request.MovieId, request.Language), \"text/vtt\");\n    }\n\n    [Route(\"photo/remove-red-eye\")]\n    public IActionResult RemoveRedEye([FromQuery] RedEyeRemovalRequest request) // Belongs to responsibility #2.\n    {\n        logger.LogInformation(\"Removing red-eye from photo {PhotoId}\", request.PhotoId);\n        return File(redEyeRemovalService.RemoveRedEye(request.PhotoId, request.Sensitivity), \"image/jpeg\");\n    }\n\n    [Route(\"photo/enhance\")]\n    public IActionResult EnhancePhoto([FromQuery] PhotoEnhancementRequest request) // Belongs to responsibility #2.\n    {\n        logger.LogInformation(\"Enhancing photo {PhotoId}\", request.PhotoId);\n        return File(photoEnhancementService.EnhancePhoto(request.PhotoId, request.ColorGrading), \"image/jpeg\");\n    }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n[Route(\"media/[controller]\")]\npublic class MovieController(\n    ILogger&lt;MovieController&gt; logger,\n    IStreamingService streamingService, ISubtitlesService subtitlesService) : Controller\n{\n    [Route(\"stream\")]\n    public IActionResult MovieStream([FromQuery] StreamRequest request)\n    {\n        logger.LogInformation(\"Requesting movie stream for {MovieId}\", request.MovieId);\n        return File(streamingService.GetStream(request.MovieId), \"video/mp4\");\n    }\n\n    [Route(\"subtitles\")]\n    public IActionResult MovieSubtitles([FromQuery] SubtitlesRequest request)\n    {\n        logger.LogInformation(\"Requesting movie subtitles for {MovieId}\", request.MovieId);\n        return File(subtitlesService.GetSubtitles(request.MovieId, request.Language), \"text/vtt\");\n    }\n}\n\n[Route(\"media/[controller]\")]\npublic class PhotoController(\n    ILogger&lt;PhotoController&gt; logger,\n    IRedEyeRemovalService redEyeRemovalService, IPhotoEnhancementService photoEnhancementService) : Controller\n{\n    [Route(\"remove-red-eye\")]\n    public IActionResult RemoveRedEye([FromQuery] RedEyeRemovalRequest request)\n    {\n        logger.LogInformation(\"Removing red-eye from photo {PhotoId}\", request.PhotoId);\n        return File(redEyeRemovalService.RemoveRedEye(request.PhotoId, request.Sensitivity), \"image/jpeg\");\n    }\n\n    [Route(\"enhance\")]\n    public IActionResult EnhancePhoto([FromQuery] PhotoEnhancementRequest request)\n    {\n        logger.LogInformation(\"Enhancing photo {PhotoId}\", request.PhotoId);\n        return File(photoEnhancementService.EnhancePhoto(request.PhotoId, request.ColorGrading), \"image/jpeg\");\n    }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/web-api/#apicontroller-attribute\">Create web APIs with ASP.NET Core:\n  <code>ApiController</code> attribute</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/web-api/overview/web-api-routing-and-actions/\">Web API Routing</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/architecture/modern-web-apps-azure/architectural-principles#separation-of-concerns\">Architectural\n  principles: Separation of concerns</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/architecture/modern-web-apps-azure/architectural-principles#single-responsibility\">Architectural\n  principles: Single responsibility</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/actions\">ASP.NET Core: Handle requests with controllers\n  in ASP.NET Core MVC</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/archive/msdn-magazine/2014/may/csharp-best-practices-dangers-of-violating-solid-principles-in-csharp#the-single-responsibility-principle\">C# Best Practices: Dangers of Violating SOLID Principles in C#</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/fundamentals/choose-aspnet-framework\">Choose between ASP.NET 4.x and\n  ASP.NET Core</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection\">Dependency injection in ASP.NET\n  Core</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/architecture/microservices/microservice-ddd-cqrs-patterns/microservice-application-layer-implementation-web-api#implement-the-command-process-pipeline-with-a-mediator-pattern-mediatr\">Implement the command process pipeline with a mediator pattern (MediatR)</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.lazy-1\">Lazy&lt;T&gt; Class</a></li>\n  <li>MassTransit - <a href=\"https://masstransit.io/documentation/concepts\">Concepts</a></li>\n  <li>Sonar - <a href=\"https://www.sonarsource.com/docs/CognitiveComplexity.pdf\">Cognitive Complexity</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Single_responsibility_principle\">Single responsibility principle</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Mediator_pattern\">Mediator pattern</a></li>\n  <li>Wolverine - <a href=\"https://wolverinefx.io/introduction/getting-started.html\">Getting Started</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li>Sonar Blog - <a href=\"https://www.sonarsource.com/blog/5-clean-code-tips-for-reducing-cognitive-complexity/\">5 Clean Code Tips for Reducing\n  Cognitive Complexity</a></li>\n  <li>Medium - <a href=\"https://medium.com/@jayeshtambe/lazy-t-in-dependency-injection-with-c-net-core-c418cc80cd13\">Lazy&lt;T&gt; in Dependency\n  Injection with C# .Net Core</a></li>\n  <li>Medium - <a href=\"https://medium.com/@sumit.kharche/how-to-integrate-automapper-in-asp-net-core-web-api-b765b5bed35c\">How to integrate\n  AutoMapper in ASP.NET Core Web API</a></li>\n</ul>\n<h3>Conference presentations</h3>\n<ul>\n  <li>Cornell University arxiv.org - <a href=\"https://arxiv.org/abs/1912.01142\">Changqi Chen: An Empirical Investigation of Correlation between Code\n  Complexity and Bugs</a></li>\n</ul>\n<h3>Related rules</h3>\n<ul>\n  <li>{rule:csharpsquid:S3776} - Cognitive Complexity of functions should not be too high</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6960.json",
    "content": "{\n  \"title\": \"Controllers should not have mixed responsibilities\",\n  \"type\": \"CODE_SMELL\",\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Linear\",\n    \"linearDesc\": \"responsibilities\",\n    \"linearFactor\": \"15min\"\n  },\n  \"tags\": [\n    \"asp.net\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6960\",\n  \"sqKey\": \"S6960\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"partial\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"MODULAR\"\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6961.html",
    "content": "<p>In <a href=\"https://learn.microsoft.com/en-us/aspnet/core\">ASP.NET Core</a>, controllers usually inherit either from <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.controllerbase\"><code>ControllerBase</code></a> or <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.controller\"><code>Controller</code></a>. If a controller does not use any\nView-specific functionality, it is recommended to inherit from <code>ControllerBase</code>.</p>\n<h2>Why is this an issue?</h2>\n<p>The <code>ControllerBase</code> class contains all the necessary functionality to handle <a href=\"https://en.wikipedia.org/wiki/Web_API\">API</a>\nrequests and responses. The <code>Controller</code> class inherits from <code>ControllerBase</code> and adds support for <a\nhref=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/views/overview\">Views</a>, <a\nhref=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/views/partial\">PartialViews</a> and <a\nhref=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/views/view-components\">ViewComponents</a>.</p>\n<p>Inheriting from <code>Controller</code> when not using any View-specific functionality exposes unnecessary methods and can lead to confusion about\nthe intention of the class.</p>\n<p>Furthermore, inheriting from <code>Controller</code> may come with a performance cost. Even though the controller might only deal with API\noperations, the support for Views might introduce some overhead from the MVC framework during the <a\nhref=\"https://learn.microsoft.com/en-us/aspnet/core/fundamentals/middleware\">request processing pipeline</a>.</p>\n<p>An issue is raised when:</p>\n<ul>\n  <li>The class is marked with the <a\n  href=\"https://learn.microsoft.com/en-us/aspnet/core/web-api#apicontroller-attribute\"><code>[ApiController]</code></a> attribute.</li>\n  <li>The class inherits <em>directly</em> from <code>Controller</code>.</li>\n  <li>No View-specific functionality is used in the class.</li>\n</ul>\n<h3>Exceptions</h3>\n<ul>\n  <li>If a class is marked with the <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.noncontrollerattribute\"><code>[NonController]</code></a> attribute.</li>\n  <li>If a class does not have <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/public\">public</a>\n  accessibility.</li>\n</ul>\n<h2>How to fix it</h2>\n<p>Change the base type of the controller from <code>Controller</code> to <code>ControllerBase</code>.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\n[ApiController]\npublic class MyController : Controller // Noncompliant: Inherit from ControllerBase instead of Controller.\n//                          ^^^^^^^^^^\n{\n    // ..\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n[ApiController]\npublic class MyController : ControllerBase\n{\n    // ..\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Web_API\">Web API</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core\">ASP.NET Core</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.controller\">Controller Class</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.controllerbase\">ControllerBase Class</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.apicontrollerattribute\">ApiControllerAttribute\n  Class</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.noncontrollerattribute\">NonControllerAttribute\n  Class</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/views/overview\">Views in ASP.NET Core MVC</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/views/partial\">Partial Views in ASP.NET Core MVC</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/views/view-components\">View Components in ASP.NET Core MVC</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/fundamentals/middleware\">ASP.NET Core Middleware</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6961.json",
    "content": "{\n  \"title\": \"API Controllers should derive from ControllerBase instead of Controller\",\n  \"type\": \"CODE_SMELL\",\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"asp.net\",\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6961\",\n  \"sqKey\": \"S6961\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"targeted\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"COMPLETE\"\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6962.html",
    "content": "<p>In frequently used code paths, such as controller actions, you should avoid using the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpclient\">HttpClient</a> directly and opt for <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/core/extensions/httpclient-factory\">one of the IHttpClientFactory-based mechanisms</a> instead. This\nway, you avoid wasting resources and creating performance overhead.</p>\n<h2>Why is this an issue?</h2>\n<p>If a code path that creates and disposes of HttpClient objects is frequently used, then the following issues can occur:</p>\n<ul>\n  <li>Under heavy load, there’s the risk of <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/fundamentals/networking/http/httpclient-guidelines#pooled-connections\">running out of available\n  sockets</a>, leading to <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.net.sockets.socketexception\">SocketException</a> errors. This\n  is because each HttpClient instance uses a separate network connection, and there’s a limit to the number of connections that can be opened\n  simultaneously. Note that even after you dispose of an HttpClient <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests#issues-with-the-original-httpclient-class-available-in-net\">its sockets are not immediately freed up</a>.</li>\n  <li>Each HttpClient has its own set of resources (like headers, base address, timeout, etc.) that must be managed. Creating a new HttpClient for\n  every request means these resources are not being reused, leading to resource waste.</li>\n  <li>You introduce a significant performance overhead when creating a new HttpClient for every HTTP request.</li>\n</ul>\n<h2>How to fix it</h2>\n<p>The <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.net.http.ihttpclientfactory\"><code>IHttpClientFactory</code></a> was introduced in\nASP.NET Core 2.1 to solve these problems. It handles pooling HTTP connections to optimize performance and reliability.</p>\n<p>There are <a href=\"https://learn.microsoft.com/en-us/aspnet/core/fundamentals/http-requests#consumption-patterns\">several ways</a> that you can use\nIHttpClientFactory in your application:</p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/core/extensions/httpclient-factory#basic-usage\">Basic usage</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/core/extensions/httpclient-factory#named-clients\">Named Clients</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/core/extensions/httpclient-factory#typed-clients\">Typed Clients</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/core/extensions/httpclient-factory#generated-clients\">Generated Clients</a></li>\n</ul>\n<p>Alternatively, you may cache the HttpClient in a singleton or a static field. You should be aware that by default, the HttpClient doesn’t respect\nthe DNS’s Time To Live (TTL) settings. If the IP address associated with a domain name changes, HttpClient might still use the old, cached IP address,\nleading to failed requests.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\n[ApiController]\n[Route(\"controller\")]\npublic class FooController : Controller\n{\n    [HttpGet]\n    public async Task&lt;string&gt; Foo()\n    {\n        using var client = new HttpClient();  // Noncompliant\n        return await client.GetStringAsync(_url);\n    }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n// File: Startup.cs\npublic class Startup\n{\n    public void ConfigureServices(IServiceCollection services)\n    {\n        services.AddHttpClient();\n        // ...\n    }\n}\n\n[ApiController]\n[Route(\"controller\")]\npublic class FooController : Controller\n{\n    private readonly IHttpClientFactory _clientFactory;\n\n    public FooController(IHttpClientFactory clientFactory)\n    {\n        _clientFactory = clientFactory;\n    }\n\n    [HttpGet]\n    public async Task&lt;string&gt; Foo()\n    {\n        using var client = _clientFactory.CreateClient(); // Compliant (Basic usage)\n        return await client.GetStringAsync(_url);\n    }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>{rule:csharpsquid:S6420} - Client instances should not be recreated on each Azure Function invocation</li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.net.http.ihttpclientfactory\">IHttpClientFactory\n  Interface</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpclient\">HttpClient Class</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/core/extensions/httpclient-factory\">IHttpClientFactory with .NET</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests\">Use IHttpClientFactory to implement resilient HTTP requests</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/fundamentals/http-requests\">Make HTTP requests using IHttpClientFactory\n  in ASP.NET Core</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/fundamentals/networking/http/httpclient-guidelines\">Guidelines for using\n  HttpClient</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6962.json",
    "content": "{\n  \"title\": \"You should pool HTTP connections with HttpClientFactory\",\n  \"type\": \"CODE_SMELL\",\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1h\"\n  },\n  \"tags\": [\n    \"asp.net\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6962\",\n  \"sqKey\": \"S6962\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"COMPLETE\"\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6964.html",
    "content": "<p><a\nhref=\"https://learn.microsoft.com/en-us/aspnet/web-api/overview/formats-and-model-binding/model-validation-in-aspnet-web-api#data-annotations\">\"Under-posting\"</a>\nrefers to a situation where a client sends less data than expected to the server during an HTTP request, for example when the client omits some\nproperties from the request body that the server expects to receive.</p>\n<h2>Why is this an issue?</h2>\n<p>One of the main issues that under-posting can cause is data inconsistency. If the client sends less data than expected, the application might fill\nany value type properties with their default values, leading to inaccurate or inconsistent data in your database. Additionally, there might be\nunexpected behavior if there are certain data expected that are not provided and even security issues; for example, if a user omits a role or\npermission field from a POST request, and the server fills in a default value, it could inadvertently grant more access than intended.</p>\n<p>A <a href=\"https://learn.microsoft.com/en-us/aspnet/core/tutorials/first-mvc-app/adding-model\">model class</a> (in this case the\n<code>Product</code> class) can be an input of an HTTP handler method:</p>\n<pre>\npublic class ProductsController : Controller\n{\n    [HttpPost]\n    public IActionResult Create([FromBody]Product product)\n    {\n        // Process product data...\n    }\n}\n</pre>\n<h3>Exceptions</h3>\n<p>This rule does not raise an issue when properties are decorated with the following attributes:</p>\n<ul>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.modelbinding.validation.validateneverattribute\">ValidateNever</a></li>\n  <li><a href=\"https://www.newtonsoft.com/json/help/html/JsonPropertyRequired.htm\">JsonProperty(Required = Required.Always)</a></li>\n  <li><a href=\"https://www.newtonsoft.com/json/help/html/JsonPropertyRequired.htm\">JsonProperty(Required = Required.AllowNull)</a></li>\n  <li><a href=\"https://www.newtonsoft.com/json/help/html/PropertyJsonIgnore.htm\">Newtonsoft.Json.JsonIgnore</a></li>\n  <li><a href=\"https://www.newtonsoft.com/json/help/html/t_newtonsoft_json_jsonrequiredattribute.htm\">Newtonsoft.Json.JsonRequired</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.text.json.serialization.jsonrequiredattribute\">System.Text.Json.Serialization.JsonRequired</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.text.json.serialization.jsonignoreattribute\">System.Text.Json.Serialization.JsonIgnore</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.dataannotations.rangeattribute\">Range</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.modelbinding.bindneverattribute\">BindNever</a></li>\n</ul>\n<p>Additionally, this rule does not raise for properties in model classes that are not in the same project as the Controller class that references\nthem. This is due to a limitation of Roslyn (see <a href=\"https://github.com/SonarSource/sonar-dotnet/issues/9243\">here</a>).</p>\n<h2>How to fix it</h2>\n<p>You should mark any model value-type property as <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/nullable-value-types\">nullable</a>, <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/required\">required</a> or <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.text.json.serialization.jsonrequiredattribute\">JsonRequired</a>. Thus when a client\nunderposts, you ensure that the missing properties can be detected on the server side rather than being auto-filled, and therefore, incoming data\nmeets the application’s expectations.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic class Product\n{\n    public int Id { get; set; }             // Noncompliant\n    public string Name { get; set; }\n    public int NumberOfItems { get; set; }  // Noncompliant\n    public decimal Price { get; set; }      // Noncompliant\n}\n</pre>\n<p>If the client sends a request without setting the <code>NumberOfItems</code> or <code>Price</code> properties, they will default to <code>0</code>.\nIn the request handler method, there’s no way to determine whether they were intentionally set to <code>0</code> or omitted by mistake.</p>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic class Product\n{\n    public required int Id { get; set; }\n    public string Name { get; set; }\n    public int? NumberOfItems { get; set; }            // Compliant - property is optional\n    [JsonRequired] public decimal Price { get; set; }  // Compliant - property must have a value\n}\n</pre>\n<p>In this example, the request handler method can</p>\n<ul>\n  <li>manually check whether <code>NumberOfItems</code> was filled out through the <code>HasValue</code> property</li>\n  <li>rely on Model Validation to make sure <code>Price</code> is not missing</li>\n</ul>\n<pre>\npublic class ProductsController : Controller\n{\n    [HttpPost]\n    public IActionResult Create(Product product)\n    {\n        if (!ModelState.IsValid)    // if product.Price is missing then the model state will not be valid\n        {\n            return View(product);\n        }\n\n        if (product.NumberOfItems.HasValue)\n        {\n            // ...\n        }\n        // Process input...\n    }\n}\n</pre>\n<h2>Recommended Secure Coding Practices</h2>\n<ul>\n  <li>Client-Side Validation: While server-side validation is crucial, implementing client-side validation can provide immediate feedback to the user\n  when certain fields are not filled out, which helps to avoid under-posting.</li>\n  <li>Comprehensive Testing: Include testing scenarios that specifically check for under-posting vulnerabilities to ensure that all required data is\n  correctly validated and processed.</li>\n</ul>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/overview\">Overview of ASP.NET Core MVC</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/mvc/overview/getting-started/introduction/getting-started\">Overview of\n  ASP.NET MVC 5</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/razor-pages\">Overview of ASP.NET Razor Pages</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/tutorials/first-mvc-app/adding-model\">Model Classes in ASP.NET\n  MVC</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/models/model-binding\">Model Binding in ASP.NET Core</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/aspnet/web-api/overview/formats-and-model-binding/model-validation-in-aspnet-web-api\">Model Validation in\n  ASP.NET Web API</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/nullable-value-types\">Nullable Value\n  Types in .NET</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/aspnet/web-api/overview/formats-and-model-binding/model-validation-in-aspnet-web-api#data-annotations\">Data\n  Annotations</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.routing.httpmethodattribute\">RequiredAttribute\n  Class</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.modelbinding.validation.validateneverattribute\">ValidateNeverAttribute\n  Class</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6964.json",
    "content": "{\n  \"title\": \"Value type property used as input in a controller action should be nullable, required or annotated with the JsonRequiredAttribute to avoid under-posting.\",\n  \"type\": \"CODE_SMELL\",\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"asp.net\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6964\",\n  \"sqKey\": \"S6964\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"targeted\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6965.html",
    "content": "<p>When building a <a href=\"https://learn.microsoft.com/en-us/aspnet/core/tutorials/first-web-api\">REST API</a>, <a\nhref=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/routing?view=aspnetcore-8.0#attribute-routing-with-http-verb-attributes\">it’s\nrecommended</a> to annotate the controller actions with the available <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.routing.httpmethodattribute\">HTTP attributes</a> to be precise about what\nyour API supports.</p>\n<h2>Why is this an issue?</h2>\n<ul>\n  <li><strong>Ambiguity</strong>: Without HttpAttributes, it’s unclear which HTTP methods an action method should respond to. This can lead to\n  confusion and make the code harder to understand and maintain.</li>\n  <li><strong>Unsupported HTTP Methods</strong>: If an action is not annotated at all or is annotated only with the <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.routeattribute\">Route attribute</a>, it accepts all HTTP methods even if\n  they are not supported by that action, which leads to further confusion.</li>\n  <li><strong>Problems with Swagger</strong>: <a\n  href=\"https://learn.microsoft.com/en-us/aspnet/core/tutorials/web-api-help-pages-using-swagger\">Swagger</a> relies on HttpAttributes to generate\n  parts of the API documentation. These attributes are necessary for the generated documentation to be complete.</li>\n  <li><strong>Route path conflicts</strong>: Without HttpAttributes, it’s possible to accidentally create action methods that respond to the same\n  route and HTTP method. This can lead to unexpected behavior and hard-to-diagnose bugs.</li>\n  <li><strong>Lack of routing flexibility</strong>: The HTTP attributes allow you to define multiple action methods in the same controller that\n  respond to the same route but different HTTP methods. If you don’t use them, you might have limited flexibility when designing your API.</li>\n</ul>\n<h2>How to fix it</h2>\n<p>You should annotate the controller actions with the available HttpMethod attributes. You can still use them in conjunction with the Route\nattribute, in case there are multiple templates for one action and you need to <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.routeattribute.order?view=aspnetcore-8.0\">set the order</a>. This allows\nyou to clearly define the HTTP methods each action method should respond to, while still being able to customize your routes.</p>\n<h2>Exceptions</h2>\n<p>This rule does not raise if the controller or the action is annotated with <code>[<a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.apiexplorersettingsattribute\">ApiExplorerSettings</a>(IgnoreApi =\ntrue)]</code> or <a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.acceptverbsattribute\"><code>AcceptsVerbs</code>\nattribute</a>.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\n[Route(\"Customer\")]                                                        // This route conflicts with GetCustomers action route\npublic async Task&lt;IResult&gt; ChangeCustomer([FromBody] CustomerData data)   // Noncompliant\n{\n    // ...\n    return Results.Ok();\n}\n\n[Route(\"Customer\")]                         // This route conflicts with ChangeCustomer action route\npublic async Task&lt;string&gt; GetCustomers()    // Noncompliant\n{\n    return _customerRepository.GetAll();\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n[Route(\"Customer\")]\n[HttpPost]\npublic async Task&lt;IResult&gt; ChangeCustomer([FromBody] CustomerData data)    // Compliant\n{\n    // ...\n    return Results.Ok();\n}\n\n[HttpGet(\"Customer\")]\npublic async Task&lt;string&gt; GetCustomers()    // Compliant\n{\n    return _customerRepository.GetAll();\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/routing\">Routing to controller actions in ASP.NET\n  Core</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/routing#attribute-routing-with-http-verb-attributes\">Attribute routing with Http\n  verb attributes</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/tutorials/getting-started-with-swashbuckle\">Get started with\n  Swashbuckle and ASP.NET Core</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/web-api/handle-errors#exception-handler\">ASP.NET Core Exception\n  handler</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.routeattribute\">RouteAttribute Class</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6965.json",
    "content": "{\n  \"title\": \"REST API actions should be annotated with an HTTP verb attribute\",\n  \"type\": \"CODE_SMELL\",\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"asp.net\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6965\",\n  \"sqKey\": \"S6965\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6966.html",
    "content": "<p>In an <code>async</code> method, any blocking operations should be avoided.</p>\n<h2>Why is this an issue?</h2>\n<p>Using a synchronous method instead of its <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/asynchronous-programming/\">asynchronous</a>\ncounterpart in an <code>async</code> method blocks the execution and is considered bad practice for several reasons:</p>\n<dl>\n  <dt>Resource Utilization</dt>\n  <dd>\n    <p>Each thread consumes system resources, such as memory. When a thread is blocked, it’s not doing any useful work, but it’s still consuming these\n    resources. This can lead to inefficient use of system resources.</p>\n  </dd>\n  <dt>Scalability</dt>\n  <dd>\n    <p>Blocking threads can limit the scalability of your application. In a high-load scenario where many operations are happening concurrently, each\n    blocked thread represents a missed opportunity to do useful work. This can prevent your application from effectively handling increased load.</p>\n  </dd>\n  <dt>Performance</dt>\n  <dd>\n    <p>Blocking threads can degrade the performance of your application. If all threads in the thread pool become blocked, new tasks can’t start\n    executing until an existing task completes and frees up a thread. This can lead to delays and poor responsiveness.</p>\n  </dd>\n</dl>\n<p>Instead of blocking, it’s recommended to use the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/await\"><code>async</code> operator</a> with async methods. This\nallows the system to release the current thread back to the thread pool until the awaited task is complete, improving scalability and\nresponsiveness.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic async Task Examples(Stream stream, DbSet&lt;Person&gt; dbSet)\n{\n    stream.Read(array, 0, 1024);            // Noncompliant\n    File.ReadAllLines(\"path\");              // Noncompliant\n    dbSet.ToList();                         // Noncompliant in Entity Framework Core queries\n    dbSet.FirstOrDefault(x =&gt; x.Age &gt;= 18); // Noncompliant in Entity Framework Core queries\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic async Task Examples(Stream stream, DbSet&lt;Person&gt; dbSet)\n{\n    await stream.ReadAsync(array, 0, 1024);\n    await File.ReadAllLinesAsync(\"path\");\n    await dbSet.ToListAsync();\n    await dbSet.FirstOrDefaultAsync(x =&gt; x.Age &gt;= 18);\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/async\">async (C# Reference)</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/await\">await operator - asynchronously\n  await for a task to complete</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/asynchronous-programming/#dont-block-await-instead\">Asynchronous\n  programming with async and await - Don’t block, await instead</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/archive/msdn-magazine/2013/march/async-await-best-practices-in-asynchronous-programming\">Async/Await - Best\n  Practices in Asynchronous Programming</a></li>\n  <li>Microsoft Developer Blog - <a href=\"https://devblogs.microsoft.com/pfxteam/asyncawait-faq/\">Async/Await FAQ</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6966.json",
    "content": "{\n  \"title\": \"Awaitable method should be used\",\n  \"type\": \"CODE_SMELL\",\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"async-await\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6966\",\n  \"sqKey\": \"S6966\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"COMPLETE\"\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6967.html",
    "content": "<p>In the context of ASP.NET Core MVC web applications, both model binding and model validation are processes that take place prior to the execution\nof a controller action. It is imperative for the application to examine the <code>ModelState.IsValid</code> and respond accordingly.</p>\n<p>This rule enforces the developer to validate the model within a controller action, ensuring the application’s robustness and reliability.</p>\n<h2>Why is this an issue?</h2>\n<p>Querying the <code>ModelState.IsValid</code> property is necessary because it checks if the submitted data in the HTTP request is valid or not.\nThis property evaluates all the validation attributes applied on your model properties and determines whether the data provided satisfies those\nvalidation rules.</p>\n<h3>What is the potential impact?</h3>\n<p>Skipping model validation can lead to:</p>\n<ul>\n  <li>Data Integrity Issues: Without validation, incorrect or inconsistent data can be saved to your database, leading to potential data corruption or\n  loss.</li>\n  <li>Security Vulnerabilities: Skipping validation can expose your application to security risks because incoming user data isn’t properly checked.\n  For example, any <a href=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/models/validation?view=aspnetcore-9.0#built-in-attributes\">validation\n  attributes</a>] applied to your model properties, will be ignored. This lack of proper input validation could lead to various injection attacks,\n  like SQL injection, cross-site scripting and others.</li>\n  <li>Application Errors: Invalid data can lead to unexpected application errors or crashes, which can disrupt the user experience and potentially\n  lead to data loss.</li>\n  <li>Poor User Experience: Without validation, users may not receive appropriate feedback about any mistakes in the data they have entered, leading\n  to confusion and frustration.</li>\n  <li>Increased Debugging Time: If invalid data causes issues in your application and was not validatated at the entry point, it can take\n  significantly more time to debug and fix these issues.</li>\n</ul>\n<p>Therefore, it’s highly recommended to always validate models in your application to ensure data integrity, application stability, and a good user\nexperience.</p>\n<p>While client-side validation enhances user experience by providing immediate feedback, it’s not sufficient due to potential manipulation of\nclient-side code, browser compatibility issues, and dependence on JavaScript. Users can bypass or disable it, leading to invalid or malicious data\nbeing submitted. Therefore, server-side validation is essential to ensure data integrity and security, making it a best practice to use both\nclient-side and server-side validation in your application.</p>\n<h3>Exceptions</h3>\n<ul>\n  <li>Web API controllers don’t have to check <code>ModelState.IsValid</code> if they have the <code>[ApiController]</code> attribute. In that case,\n  an automatic HTTP <code>400</code> response containing error details is returned when model state is invalid.</li>\n  <li>When action filters are used for controller actions, the analyzer will skip the model validation detection to avoid false positives since the\n  model state could be verified by the action filer.</li>\n  <li><code>TryValidateModel</code> can also be used for model validation.</li>\n  <li>The project references a 3rd-party library for validation, e.g. FluentValidation.</li>\n  <li>The rule will not raise issues if the model, or the model members, are not decorated with validation attributes, or if it does not implement\n  custom validation.</li>\n</ul>\n<h2>How to fix it</h2>\n<p>If <code>ModelState.IsValid</code> returns true, it means that the data is valid and the process can continue. If it returns false, it means that\nthe validation failed, indicating that the data is not in the expected format or is missing required information.</p>\n<p>In such cases, the controller action should handle this by returning an appropriate response, such as re-displaying the form with error messages.\nThis helps maintain the integrity of the data and provides feedback to the user, enhancing the overall user experience and security of your\napplication.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic async Task&lt;IActionResult&gt; Create(Movie movie) // Noncompliant: model validity check is missing\n{\n    _context.Movies.Add(movie);\n    await _context.SaveChangesAsync();\n\n    return RedirectToAction(nameof(Index));\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic async Task&lt;IActionResult&gt; Create(Movie movie)\n{\n    if (!ModelState.IsValid)\n    {\n        return View(movie);\n    }\n\n    _context.Movies.Add(movie);\n    await _context.SaveChangesAsync();\n\n    return RedirectToAction(nameof(Index));\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/models/validation\">Model Validation</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.modelbinding.modelstatedictionary.isvalid\">IsValid property</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.dataannotations.validationattribute\">ValidationAttribute</a></li>\n  <li>Fluent Validation - <a href=\"https://docs.fluentvalidation.net/en/latest/aspnet.html\">ASP.NET Core integration</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6967.json",
    "content": "{\n  \"title\": \"ModelState.IsValid should be called in controller actions\",\n  \"type\": \"CODE_SMELL\",\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"asp.net\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-6967\",\n  \"sqKey\": \"S6967\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\",\n      \"RELIABILITY\": \"HIGH\",\n      \"SECURITY\": \"HIGH\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S6968.html",
    "content": "<p>In an <a href=\"https://learn.microsoft.com/en-us/aspnet/core\">ASP.NET Core</a> <a href=\"https://en.wikipedia.org/wiki/Web_API\">Web API</a>,\ncontroller actions can optionally return a result value. If a controller action returns a value in the <a\nhref=\"https://en.wikipedia.org/wiki/Happy_path\">happy path</a>, for example <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.controllerbase.ok#microsoft-aspnetcore-mvc-controllerbase-ok(system-object)\">ControllerBase.Ok(Object)</a>,\nannotating the action with one of the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.producesresponsetypeattribute\"><code>[ProducesResponseType]</code></a>\noverloads that describe the type is recommended.</p>\n<h2>Why is this an issue?</h2>\n<p>If an ASP.NET Core Web API uses <a href=\"https://swagger.io/\">Swagger</a>, the API documentation will be generated based on the input/output types\nof the controller actions, as well as the attributes annotating the actions. If an action returns <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.iactionresult\">IActionResult</a> or <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.iresult\">IResult</a>, Swagger cannot infer the type of the response. From\nthe consumer’s perspective, this can be confusing and lead to unexpected results and bugs in the long run without the API provider’s awareness.</p>\n<p>This rule raises an issue on a controller action when:</p>\n<ul>\n  <li>The action returns a value in the happy path. This can be either:\n    <ul>\n      <li><a href=\"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/200\">200 OK</a></li>\n      <li><a href=\"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/201\">201 Created</a></li>\n      <li><a href=\"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/202\">202 Accepted</a></li>\n    </ul></li>\n  <li>There is no <code>[ProducesResponseType]</code> attribute containing the return type, either at controller or action level.</li>\n  <li>There is no <code>[SwaggerResponse]</code> attribute containing the return type, either at controller or action level.</li>\n  <li>The controller is annotated with the <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.apicontrollerattribute\"><code>[ApiController]</code></a> attribute.</li>\n  <li>The controller action returns either <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.iactionresult\">IActionResult</a> or <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.iresult\">IResult</a>.</li>\n  <li>The application has enabled the <a\n  href=\"https://learn.microsoft.com/en-us/aspnet/core/tutorials/getting-started-with-swashbuckle#add-and-configure-swagger-middleware\">Swagger\n  middleware</a>.</li>\n</ul>\n<h2>How to fix it</h2>\n<p>There are multiple ways to fix this issue:</p>\n<ul>\n  <li>Annotate the action with <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.producesresponsetypeattribute\"><code>[ProducesResponseType]</code></a>\n  containing the return type.</li>\n  <li>Annotate the action with <a\n  href=\"https://github.com/domaindrivendev/Swashbuckle.AspNetCore/blob/master/README.md#enrich-response-metadata\">SwaggerResponse Class</a> containing\n  the return type.</li>\n  <li>Return <a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.actionresult-1\">ActionResult&lt;TValue&gt;</a> instead of\n  <code>[IActionResult]</code> or <code>[IResult]</code>.</li>\n  <li>Return <a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.httpresults.results-2\">Results&lt;TResult1,\n  TResult2&gt;</a> instead of <code>[IActionResult]</code> or <code>[IResult]</code>.</li>\n</ul>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\n[HttpGet(\"foo\")]\n// Noncompliant: Annotate this method with ProducesResponseType containing the return type for succesful responses.\npublic IActionResult MagicNumber() =&gt; Ok(42);\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\n[HttpGet(\"foo\")]\n// Noncompliant: Use the ProducesResponseType overload containing the return type for succesful responses.\n[ProducesResponseType(StatusCodes.Status200OK)]\npublic IActionResult MagicNumber() =&gt; Ok(42);\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n[HttpGet(\"foo\")]\n[ProducesResponseType&lt;int&gt;(StatusCodes.Status200OK)]\npublic IActionResult MagicNumber() =&gt; Ok(42);\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\n[HttpGet(\"foo\")]\n[ProducesResponseType(typeof(int), StatusCodes.Status200OK)]\npublic IActionResult MagicNumber() =&gt; Ok(42);\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Web_API\">Web API</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Happy_path\">Happy path</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core\">ASP.NET Core</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/tutorials/getting-started-with-swashbuckle\">Get started with\n  Swashbuckle and ASP.NET Core</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.apicontrollerattribute\">ApiControllerAttribute\n  Class</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.producesresponsetypeattribute\">ProducesResponseTypeAttribute\n  Class</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.producesresponsetypeattribute-1\">ProducesResponseTypeAttribute&lt;T&gt;\n  Class</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.actionresult-1\">ActionResult&lt;TValue&gt;\n  Class</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.httpresults.results-2\">Results&lt;TResult1,\n  TResult2&gt; Class</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/web-api/action-return-types#httpresults-type\">HttpResults type</a></li>\n  <li>GitHub - <a href=\"https://github.com/domaindrivendev/Swashbuckle.AspNetCore/blob/master/README.md#enrich-response-metadata\">SwaggerResponse\n  Class</a></li>\n  <li>SmartBear - <a href=\"https://swagger.io/\">Swagger</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S6968.json",
    "content": "{\n  \"title\": \"Actions that return a value should be annotated with ProducesResponseTypeAttribute containing the return type\",\n  \"type\": \"CODE_SMELL\",\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"asp.net\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6968\",\n  \"sqKey\": \"S6968\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"partial\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S7039.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The Content Security Policy (CSP) is a computer security standard that serves as an additional layer of protection against various types of\nattacks, including Cross-Site Scripting (XSS) and clickjacking. It provides a set of standard procedures for loading resources by user agents, which\ncan help to mitigate the risk of content injection vulnerabilities.</p>\n<p>However, it is important to note that CSP is not a primary line of defense, but rather a safety net that catches attempts to exploit\nvulnerabilities that exist in the system despite other protective measures. An insecure CSP does not automatically imply that the website is\nvulnerable, but it does mean that this additional layer of protection is weakened.</p>\n<p>A CSP can be considered insecure if it allows potentially harmful practices, such as inline scripts or loading resources from arbitrary domains.\nThese practices can increase the risk of content injection attacks.</p>\n<h3>What is the potential impact?</h3>\n<p>An insecure Content Security Policy (CSP) can increase the potential severity of other vulnerabilities in the system. For instance, if an attacker\nmanages to exploit a Cross-Site Scripting (XSS) vulnerability, an insecure CSP might not provide the intended additional protection.</p>\n<p>The impact of a successful XSS attack can be severe. XSS allows an attacker to inject malicious scripts into web pages viewed by other users. These\nscripts can then be used to steal sensitive information like session cookies, personal data, or credit card details, leading to identity theft or\nfinancial fraud.</p>\n<p>Moreover, XSS can be used to perform actions on behalf of the user without their consent, such as changing their email address or password, or\nmaking transactions. This can lead to unauthorized access and potential loss of control over user accounts.</p>\n<p>In addition, an insecure CSP that allows loading resources from arbitrary domains could potentially expose sensitive user data to untrusted\nsources. This could lead to data breaches, which can have serious legal and reputational consequences.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nusing System.Web;\n\npublic async Task InvokeAsync(HttpContext context)\n{\n    context.Response.Headers.ContentSecurityPolicy = \"script-src 'self' 'unsafe-inline';\"; // Noncompliant\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nusing System.Web;\n\npublic async Task InvokeAsync(HttpContext context)\n{\n    context.Response.Headers.ContentSecurityPolicy = \"script-src 'self' 'sha256-RFWPLDbv2BY+rCkDzsE+0fr8ylGr2R2faWMhq4lfEQc=';\";\n}\n</pre>\n<h3>How does this work?</h3>\n<p>To fix an insecure Content Security Policy (CSP), you should adhere to the principle of least privilege. This principle states that a user should\nbe given the minimum levels of access necessary to complete their tasks. In the context of CSP, this means restricting the sources from which content\ncan be loaded to the minimum necessary.</p>\n<p>Here are some steps to secure your CSP:</p>\n<ul>\n  <li>Avoid 'unsafe-inline' and 'unsafe-eval': These settings allow inline scripts and script evaluation, which can open the door for executing\n  malicious scripts. Instead, use script hashes, nonces, or strict dynamic scripting if scripts must be used.</li>\n  <li>Specify exact sources: Rather than using a wildcard (*) which allows any domain, specify the exact domains from which resources can be loaded.\n  This reduces the risk of loading resources from potentially malicious sources.</li>\n  <li>Use 'self' cautiously: While 'self' is safer than a wildcard, it can still lead to vulnerabilities if your own site has been compromised or\n  hosts user-uploaded content. Be sure to validate and sanitize all user content.</li>\n</ul>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>MDN web docs - <a href=\"https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP\">Content Security Policy (CSP)</a></li>\n  <li>CSP docs - <a href=\"https://content-security-policy.com/hash/\">Using a hash with CSP</a></li>\n</ul>\n<h3>Standards</h3>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A05_2021-Security_Misconfiguration/\">Top 10 2021 Category A5 - Security Misconfiguration</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A6_2017-Security_Misconfiguration.html\">Top 10 2017 Category A6 - Security\n  Misconfiguration</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/693\">CWE-693 - Protection Mechanism Failure</a></li>\n  <li>STIG Viewer - <a href=\"https://stigviewer.com/stigs/application_security_and_development/2024-12-06/finding/V-222602\">Application Security and\n  Development: V-222602</a> - The application must protect from Cross-Site Scripting (XSS) vulnerabilities.</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S7039.json",
    "content": "{\n  \"title\": \"Content Security Policies should be restrictive\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-7039\",\n  \"sqKey\": \"S7039\",\n  \"scope\": \"All\",\n  \"securityStandards\": {\n    \"CWE\": [\n      693\n    ],\n    \"OWASP\": [\n      \"A6\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A5\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"6.5.7\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"6.2.4\"\n    ],\n    \"ASVS 4.0\": [\n      \"5.3.3\"\n    ],\n    \"STIG ASD_V5R3\": [\n      \"V-222602\"\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S7130.html",
    "content": "<p>When working with collections that are known to be non-empty, using <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.first\">First</a> or <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.single\">Single</a> is generally preferred over <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.firstordefault\">FirstOrDefault</a> or <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.singleordefault\">SingleOrDefault</a>.</p>\n<h2>Why is this an issue?</h2>\n<p>Using <code>FirstOrDefault</code> or <code>SingleOrDefault</code> on collections that are known to be non-empty is an issue due to:</p>\n<ul>\n  <li>Code Clarity and intent: When you use <code>FirstOrDefault</code> or <code>SingleOrDefault</code>, it implies that the collection might be\n  empty, which can be misleading if you know it is not. It can be confusing for other developers who read your code, making it harder for them to\n  understand the actual constraints and behavior of the collection. This leads to confusion and harder-to-maintain code.</li>\n  <li>Error handling: If the developer’s intend is for the collection not to be empty, using <code>FirstOrDefault</code> and\n  <code>SingleOrDefault</code> can lead to subtle bugs. These methods return a default value (<code>null</code> for reference types and\n  <code>default</code> for value types) when the collection is empty, potentially causing issues like <code>NullReferenceException</code> later in the\n  code. In contrast, <code>First</code> or <code>Single</code> will throw an <code>InvalidOperationException</code> immediately if the collection is\n  empty, making it easier to detect and address issues early in the development process.</li>\n  <li>Code coverage: Potentially, having to check if the result is <code>null</code>, you introduces a condition that cannot be fully tested,\n  impacting the code coverage.</li>\n</ul>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nvar items = new List&lt;int&gt; { 1, 2, 3 };\n\nint firstItem = items.FirstOrDefault(); // Noncompliant, this implies the collection might be empty, when we know it is not\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nvar items = new List&lt;int&gt; { 1, 2, 3 };\n\nint firstItem = items.First(); // Compliant\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.single\"><code>Single</code></a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.first\"><code>First</code></a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.singleordefault\"><code>SingleOrDefault</code></a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.firstordefault\"><code>FirstOrDefault</code></a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li><a href=\"https://medium.com/@anyanwuraphaelc/first-vs-firstordefault-single-vs-singleordefault-a-high-level-look-d24db17a2bc3\">First vs\n  FirstOrDefault, Single vs SingleOrDefault: A High-level Look</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S7130.json",
    "content": "{\n  \"title\": \"First\\/Single should be used instead of FirstOrDefault\\/SingleOrDefault on collections that are known to be non-empty\",\n  \"type\": \"CODE_SMELL\",\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1min\"\n  },\n  \"tags\": [\n    \"symbolic-execution\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-7130\",\n  \"sqKey\": \"S7130\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S7131.html",
    "content": "<p>When using <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlock\">ReaderWriterLock</a> and <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlockslim\">ReaderWriterLockSlim</a> for managing read and write locks,\nyou should not release a read lock while holding a write lock and vice versa, otherwise you might have runtime exceptions. The locks should be always\ncorrectly paired so that the shared resource is accessed safely.</p>\n<p>This rule raises if:</p>\n<ul>\n  <li>you call <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlock.acquirewriterlock\">ReaderWriterLock.AcquireWriterLock</a> or <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlock.upgradetowriterlock\">ReaderWriterLock.UpgradeToWriterLock</a>\n  and then use <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlock.releasereaderlock\">ReaderWriterLock.ReleaseReaderLock</a></li>\n  <li>you call <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlockslim.enterwritelock\">ReaderWriterLockSlim.EnterWriteLock</a> or\n  <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlockslim.tryenterwritelock\">ReaderWriterLockSlim.TryEnterWriteLock</a> and then use <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlockslim.exitreadlock\">ReaderWriterLockSlim.ExitReadLock</a></li>\n  <li>you call <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlock.acquirereaderlock\">ReaderWriterLock.AcquireReaderLock</a> or <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlock.downgradefromwriterlock\">ReaderWriterLock.DowngradeFromWriterLock</a> and then use <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlock.releasewriterlock\">ReaderWriterLock.ReleaseWriterLock</a></li>\n  <li>or you call <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlockslim.enterreadlock\">ReaderWriterLockSlim.EnterReadLock</a>, <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlockslim.tryenterreadlock\">ReaderWriterLockSlim.TryEnterReadLock</a>, <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlockslim.enterupgradeablereadlock\">ReaderWriterLockSlim.EnterUpgradeableReadLock</a> or <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlockslim.tryenterupgradeablereadlock\">ReaderWriterLockSlim.TryEnterUpgradeableReadLock</a> and then use <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlockslim.exitwritelock\">ReaderWriterLockSlim.ExitWriteLock</a></li>\n</ul>\n<h2>Why is this an issue?</h2>\n<p>If you use the <code>ReaderWriterLockSlim</code> class, you will get a <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.lockrecursionexception\">LockRecursionException</a>. In the case of\n<code>ReaderWriterLock</code>, you’ll get a runtime exception for trying to release a lock that is not owned by the calling thread.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic class Example\n{\n    private static ReaderWriterLock rwLock = new();\n\n    public void Writer()\n    {\n        rwLock.AcquireWriterLock(2000);\n        try\n        {\n            // ...\n        }\n        finally\n        {\n            rwLock.ReleaseReaderLock(); // Noncompliant, will throw runtime exception\n        }\n    }\n\n    public void Reader()\n    {\n        rwLock.AcquireReaderLock(2000);\n        try\n        {\n            // ...\n        }\n        finally\n        {\n            rwLock.ReleaseWriterLock(); // Noncompliant, will throw runtime exception\n        }\n    }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic class Example\n{\n    private static ReaderWriterLock rwLock = new();\n\n    public static void Writer()\n    {\n        rwLock.AcquireWriterLock(2000);\n        try\n        {\n            // ...\n        }\n        finally\n        {\n            rwLock.ReleaseWriterLock();\n        }\n    }\n\n    public static void Reader()\n    {\n        rwLock.AcquireReaderLock(2000);\n        try\n        {\n            // ...\n        }\n        finally\n        {\n            rwLock.ReleaseReaderLock();\n        }\n    }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlock\">ReaderWriterLock Class</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlockslim\">ReaderWriterLockSlim</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S7131.json",
    "content": "{\n  \"title\": \"A write lock should not be released when a read lock has been acquired and vice versa\",\n  \"type\": \"BUG\",\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"tags\": [\n    \"symbolic-execution\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-7131\",\n  \"sqKey\": \"S7131\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"LOGICAL\"\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S7133.html",
    "content": "<p>This rule raises if you acquire a lock with one of the following methods, and do not release it within the same method.</p>\n<ul>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlock.acquirereaderlock\">ReaderWriterLock.AcquireReaderLock</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlock.acquirewriterlock\">ReaderWriterLock.AcquireWriterLock</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlockslim.enterreadlock\">ReaderWriterLockSlim.EnterReadLock</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlockslim.enterupgradeablereadlock\">ReaderWriterLockSlim.EnterUpgradeableReadLock</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlockslim.tryenterreadlock\">ReaderWriterLockSlim.TryEnterReadLock</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlockslim.tryenterupgradeablereadlock\">ReaderWriterLockSlim.TryEnterUpgradeableReadLock</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlockslim.enterwritelock\">ReaderWriterLockSlim.EnterWriteLock</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlockslim.tryenterwritelock\">ReaderWriterLockSlim.TryEnterWriteLock</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.spinlock.enter\">SpinLock.Enter</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.spinlock.tryenter\">SpinLock.TryEnter</a></li>\n</ul>\n<p>This rule will raise an issue when the code uses the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/implementing-dispose\">disposable pattern</a>. This pattern makes locking\neasy to use and delegates the responsibility to the caller. Users should accept issues in such cases, as they should appear only once for each\nsynchronization type.</p>\n<h2>Why is this an issue?</h2>\n<p>Not releasing a lock in the same method where you acquire it, and releasing in another one, makes the code less clear and harder to maintain. You\nare also introducing the risk of not releasing a lock at all which can lead to deadlocks or exceptions.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic class Example\n{\n    private static ReaderWriterLock rwLock = new();\n\n    public void AcquireWriterLock() =&gt;\n        rwLock.AcquireWriterLock(2000);  // Noncompliant, as the lock release is on the callers responsibility\n\n    public void DoSomething()\n    {\n        // ...\n    }\n\n    public void ReleaseWriterLock() =&gt;\n        rwLock.ReleaseWriterLock();\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic class Example\n{\n    private static ReaderWriterLock rwLock = new();\n\n    public void DoSomething()\n    {\n        rwLock.AcquireWriterLock(2000); // Compliant, locks are released in the same method\n        try\n        {\n            // ...\n        }\n        finally\n        {\n            rwLock.ReleaseWriterLock();\n        }\n    }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlock\">ReaderWriterLock Class</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlockslim\">ReaderWriterLockSlim\n  Classs</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.spinlock\">SpinLock Struct</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S7133.json",
    "content": "{\n  \"title\": \"Locks should be released within the same method\",\n  \"type\": \"BUG\",\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"symbolic-execution\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-7133\",\n  \"sqKey\": \"S7133\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S818.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Using upper case literal suffixes removes the potential ambiguity between \"1\" (digit 1) and \"l\" (letter el) for declaring literals.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nconst long b = 0l;      // Noncompliant\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nconst long b = 0L;\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S818.json",
    "content": "{\n  \"title\": \"Literal suffixes should be upper case\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"convention\",\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-818\",\n  \"sqKey\": \"S818\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S8367.html",
    "content": "<p>This rule raises an issue when code uses 'field' as an identifier in contexts where it conflicts with the new <code>field</code> contextual keyword\nintroduced in C# 14.</p>\n<h2>Why is this an issue?</h2>\n<p>C# 14 introduces the <code>field</code> contextual keyword for field-backed properties. This keyword allows access to the synthesized backing\nfields directly within property accessors, simplifying property implementations that need custom logic.</p>\n<p>By using 'field' as an identifier, several problems can occur:</p>\n<ul>\n  <li><strong>Compilation errors</strong>: Local variable declarations or parameters named <code>field</code> within property accessors cause compiler\n  error CS9273. References to existing members named <code>field</code> within property accessors cause compiler error CS9258. See <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/property-declaration-errors\">Compiler errors on property\n  declarations</a>.</li>\n  <li><strong>Semantic confusion</strong>: Existing class members named <code>field</code> may be unexpectedly overshadowed by the synthesized backing\n  field when referenced within property accessors, leading to logic errors and unexpected runtime behavior.</li>\n  <li><strong>Upgrade barriers</strong>: Code that compiles successfully in C# 13 and earlier may fail to compile or change behavior when upgrading to\n  C# 14.</li>\n</ul>\n<h3>What is the potential impact?</h3>\n<p>Using 'field' as an identifier can prevent successful compilation when upgrading to C# 14. In property accessors, local variables or parameters\nnamed 'field' will cause compilation errors, while class members named 'field' may be unexpectedly overshadowed by synthesized backing fields, leading\nto logic errors and unexpected runtime behavior.</p>\n<h2>How to fix it</h2>\n<p>Rename the identifier, escape it by prefixing with <code>@</code>, or qualify member access with <code>this.</code> or <code>base.</code> to avoid\nconflicts with the contextual keyword. This rule applies only inside property <code>get</code>, <code>set</code>, and <code>init</code> accessors;\nindexer and event accessors are not affected.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\npublic class ClassFieldExample\n{\n    private string field;\n\n    public string Message\n    {\n        get =&gt; field; // Noncompliant\n        set =&gt; field = value; // Noncompliant\n    }\n}\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\npublic class LocalFunctionExample\n{\n    public int Value\n    {\n        get\n        {\n            return LocalFunction(42);\n\n            int LocalFunction(int field) // Noncompliant\n                =&gt; field;\n        }\n    }\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\npublic class ClassFieldExample\n{\n    private string field;\n\n    public string Message\n    {\n        get =&gt; this.field;          // or @field\n        set =&gt; this.field = value;  // or @field = value;\n    }\n}\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\npublic class LocalFunctionExample\n{\n    public int Value\n    {\n        get\n        {\n            return LocalFunction(42);\n\n            int LocalFunction(int value) // Compliant - renamed\n                =&gt; value;\n        }\n    }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/field\">The <code>field</code>\n  keyword</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/property-declaration-errors\">Compiler errors on property\n  declarations</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/breaking-changes/compiler%20breaking%20changes%20-%20dotnet%2010#expression-field-in-a-property-accessor-refers-to-synthesized-backing-field\">C# compiler breaking changes since C# 13 - Expression <code>field</code> in a property accessor refers to synthesized backing field</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/breaking-changes/compiler%20breaking%20changes%20-%20dotnet%2010#variable-named-field-disallowed-in-a-property-accessor\">C# compiler breaking changes since C# 13 - Variable named <code>field</code> disallowed in a property accessor</a> (documentation incorrectly references CS9272; the actual error code is CS9273)</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S8367.json",
    "content": "{\n  \"title\": \"Identifiers should not conflict with the C# 14 \\\"field\\\" contextual keyword\",\n  \"type\": \"CODE_SMELL\",\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5 min\"\n  },\n  \"tags\": [\n    \"csharp-14\",\n    \"compatibility\",\n    \"upgrade\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-8367\",\n  \"sqKey\": \"S8367\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S8368.html",
    "content": "<p>Identifiers named <code>extension</code> should be renamed or use the <code>@</code> escape prefix to avoid breaking changes in C# 14 or later.</p>\n<h2>Why is this an issue?</h2>\n<p>Starting with C# 14, <code>extension</code> <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/breaking-changes/compiler%20breaking%20changes%20-%20dotnet%2010#extension-treated-as-a-contextual-keyword\">is\na contextual keyword</a> for declaring extension members and extension containers. This change can cause compilation errors in existing code that uses\nthe word <code>extension</code> as an identifier. For example, a class named 'extension' will be interpreted as an extension container declaration,\nleading to parsing failures.</p>\n<p>This rule flags any unescaped <code>extension</code> identifiers used in the following cases:</p>\n<ul>\n  <li>Type declaration names</li>\n  <li>Type parameter names</li>\n  <li>Constructor names</li>\n  <li>Using alias names</li>\n  <li>Return types, property types, and field types (including arrays and pointers)</li>\n</ul>\n<p>Note that method names, parameter names, and local variable names are not affected by this breaking change. For example, <code>void extension() {\n}</code> remains valid in C# 14.</p>\n<h3>What is the potential impact?</h3>\n<p>Code that currently compiles will fail to compile when the project is upgraded to C# 14.</p>\n<h2>How to fix it</h2>\n<p>Rename the identifier, or add the <code>@</code> prefix to it.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nclass extension { }\nclass MyClass\n{\n    extension field;\n    extension Property { get; }\n}\n</pre>\n<h4>Compliant solution</h4>\n<p>Escape the identifier with the <code>@</code> verbatim prefix:</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nclass @extension { }\nclass MyClass\n{\n    @extension field;\n    @extension Property { get; }\n}\n</pre>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nclass extension { }\nclass MyClass\n{\n    extension ReturnType() { return default; }\n}\n</pre>\n<h4>Compliant solution</h4>\n<p>Rename the identifier:</p>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nclass MyExtension { }\nclass MyClass\n{\n    MyExtension ReturnType() { return default; }\n}\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/breaking-changes/compiler%20breaking%20changes%20-%20dotnet%2010#extension-treated-as-a-contextual-keyword\"><code>extension</code> treated as a contextual keyword</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/extension\">Extension member\n  declarations</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/tutorials/extension-members\">Explore extension members in\n  C# 14</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/tokens/verbatim\">Verbatim identifiers\n  (<code>@</code> prefix)</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S8368.json",
    "content": "{\n  \"title\": \"Identifiers should not conflict with the C# 14 \\\"extension\\\" contextual keyword\",\n  \"type\": \"CODE_SMELL\",\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1 min\"\n  },\n  \"tags\": [\n    \"csharp14\",\n    \"breaking-change\",\n    \"contextual-keyword\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-8368\",\n  \"sqKey\": \"S8368\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S8380.html",
    "content": "<p>Using <code>partial</code> as a return type identifier will cause a compilation error when upgrading to C# 14.</p>\n<h2>Why is this an issue?</h2>\n<p>In C# 14, <code>partial</code> in a return type position is always treated as a modifier, even when a type named <code>partial</code> is in scope.\nThis causes compilation errors in code that previously compiled successfully.</p>\n<p>The issue specifically affects method declarations where a custom type named <code>partial</code> is used as the return type. Other uses of the\n<code>partial</code> type (such as in variable declarations or constructor calls) are not affected by this change.</p>\n<h3>What is the potential impact?</h3>\n<p>This breaking change will cause compilation failures when upgrading existing codebases to C# 14. The compilation error prevents the application\nfrom building, requiring immediate attention to fix the syntax.</p>\n<p>While this is not a runtime issue, it can block development and deployment processes until resolved. The fix is straightforward but must be applied\nto all affected method declarations.</p>\n<h2>How to fix it</h2>\n<p>Add the <code>@</code> prefix before <code>partial</code> when used as a return type. This tells the compiler to treat <code>partial</code> as an\nidentifier rather than a modifier. Alternatively, rename the type to avoid the conflict.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nclass C\n{\n    partial F() =&gt; new partial(); // Noncompliant\n}\n\nclass partial { }\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nclass C\n{\n    @partial F() =&gt; new partial();\n}\n\nclass partial { }\n</pre>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nclass C\n{\n    partial F() =&gt; new partial(); // Noncompliant\n}\n\nclass partial { }\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nclass C\n{\n    PartialItem F() =&gt; new PartialItem();\n}\n\nclass PartialItem { }\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/breaking-changes/compiler%20breaking%20changes%20-%20dotnet%2010#partial-cannot-be-a-return-type-of-methods\">Breaking changes in C# - <code>partial</code> cannot be a return type of methods</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/lexical-structure#643-identifiers\">C# Language\n  Specification - Identifiers</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S8380.json",
    "content": "{\n  \"title\": \"Return types named \\\"partial\\\" should be escaped with \\\"@\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5 min\"\n  },\n  \"tags\": [\n    \"breaking-change\",\n    \"csharp14\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-8380\",\n  \"sqKey\": \"S8380\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S8381.html",
    "content": "<p>Using <code>scoped</code> as a type name in lambda parameter lists will cause a compilation error when upgrading to C# 14 or later.</p>\n<h2>Why is this an issue?</h2>\n<p>In C# 14, the language introduced the ability to write lambdas with parameter modifiers without specifying parameter types. As part of this\nenhancement, a breaking change was implemented where <code>scoped</code> is always treated as a modifier in lambda parameter lists.</p>\n<p>As a result, parenthesized lambda parameters that use <code>scoped</code> as an identifier or type name will fail to compile after upgrading to C#\n14. In that context, the compiler interprets <code>scoped</code> as a modifier unless it is escaped with <code>@</code>.</p>\n<p>This breaking change affects existing code that was valid in earlier C# versions, particularly when upgrading projects to C# 14. The issue is\nspecific to lambda expressions and doesn’t affect other contexts where the <code>scoped</code> type name might be used.</p>\n<h3>What is the potential impact?</h3>\n<p>This issue prevents code compilation when upgrading to C# 14. Projects that previously compiled successfully will fail to build, blocking\ndevelopment and deployment processes until the code is updated.</p>\n<h2>How to fix it</h2>\n<p>Rename the type, or escape the type name <code>scoped</code> with the <code>@</code> prefix. This tells the compiler to treat it as an identifier\nrather than a contextual keyword.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nAction&lt;int&gt; lambda1 = (scoped) =&gt; { }; // Noncompliant\nvar lambda2 = (scoped scoped) =&gt; { }; // Noncompliant\nvar lambda3 = (scoped scoped parameter) =&gt; { }; // Noncompliant\n\nref struct @scoped { }\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nAction&lt;int&gt; lambda1 = (@scoped) =&gt; { };\nvar lambda2 = (@scoped scoped) =&gt; { };\nvar lambda3 = (scoped @scoped parameter) =&gt; { };\n\nref struct @scoped { }\n</pre>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nvar lambda = (scoped scoped parameter) =&gt; { }; // Noncompliant\n\nref struct @scoped { }\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nvar lambda = (scoped ScopedItem parameter) =&gt; { };\n\nref struct ScopedItem { }\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/tokens/verbatim\">Documentation about verbatim\n  identifiers and how to use the @ prefix to escape contextual keywords as identifiers</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-14.0/simple-lambda-parameters-with-modifiers\">C# 14\n  feature spec for simple lambda parameters with modifiers</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/breaking-changes/compiler%20breaking%20changes%20-%20dotnet%2010#scoped-in-a-lambda-parameter-list-is-now-always-a-modifier\">scoped in a lambda parameter list is now always a modifier</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S8381.json",
    "content": "{\n  \"title\": \"\\\"scoped\\\" should be escaped when used as an identifier or type name in parenthesized lambda parameter lists\",\n  \"type\": \"CODE_SMELL\",\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5 min\"\n  },\n  \"tags\": [\n    \"csharp14\",\n    \"breaking-change\",\n    \"lambda\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-8381\",\n  \"sqKey\": \"S8381\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S881.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The use of increment and decrement operators in method calls or in combination with other arithmetic operators is not recommended, because:</p>\n<ul>\n  <li>It can significantly impair the readability of the code.</li>\n  <li>It introduces additional side effects into a statement, with the potential for undefined behavior.</li>\n  <li>It is safer to use these operators in isolation from any other arithmetic operators.</li>\n</ul>\n<h3>Noncompliant code example</h3>\n<pre>\nu8a = ++u8b + u8c--;\nfoo = bar++ / 4;\n</pre>\n<h3>Compliant solution</h3>\n<p>The following sequence is clearer and therefore safer:</p>\n<pre>\n++u8b;\nu8a = u8b + u8c;\nu8c--;\nfoo = bar / 4;\nbar++;\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S881.json",
    "content": "{\n  \"title\": \"Increment (++) and decrement (--) operators should not be used in a method call or mixed with other operators in an expression\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-881\",\n  \"sqKey\": \"S881\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S907.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><code>goto</code> is an unstructured control flow statement. It makes code less readable and maintainable. Structured control flow statements such\nas <code>if</code>, <code>for</code>, <code>while</code>, <code>continue</code> or <code>break</code> should be used instead.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S907.json",
    "content": "{\n  \"title\": \"\\\"goto\\\" statement should not be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"brain-overload\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-907\",\n  \"sqKey\": \"S907\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/S927.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Parameters are part of the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/methods#method-signatures\">method signature</a> and its\nidentity.</p>\n<p>Implementing a method from an interface, a base class, or a partial method and changing one of its parameters' names will confuse and impact the\nmethod’s readability.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\ninterface IBankAccount\n{\n  void AddMoney(int money);\n}\n\nclass BankAccount : IBankAccount\n{\n  void AddMoney(int amount) // Noncompliant: parameter's name differs from base\n  {\n    // ...\n  }\n}\n</pre>\n<p>To avoid any ambiguity in the code, a parameter’s name should match the initial declaration, whether its initial declaration is from an interface,\na base class, or a partial method.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\ninterface IBankAccount\n{\n  void AddMoney(int money);\n}\n\nclass BankAccount : IBankAccount\n{\n  void AddMoney(int money) // Compliant: parameter's name match base name\n  {\n    // ...\n  }\n}\n</pre>\n<h3>Exceptions</h3>\n<p>The rule is ignored if both the parameter defined in the initial decalaration is a generic type and the implementing member’s declaration is a\nnon-generic type.</p>\n<p>This allows the implementing member to be more specific and provide more information.</p>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/methods#method-signatures\">Method signatures in\n  C#</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Type_signature#Method_signature\">Method signatures - Wiki</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/cs/S927.json",
    "content": "{\n  \"title\": \"Parameter names should match base declaration and other partial definitions\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-927\",\n  \"sqKey\": \"S927\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/cs/Sonar_way_profile.json",
    "content": "{\n  \"name\": \"Sonar way\",\n  \"ruleKeys\": [\n    \"S101\",\n    \"S107\",\n    \"S108\",\n    \"S110\",\n    \"S112\",\n    \"S125\",\n    \"S127\",\n    \"S818\",\n    \"S907\",\n    \"S927\",\n    \"S1006\",\n    \"S1048\",\n    \"S1066\",\n    \"S1075\",\n    \"S1104\",\n    \"S1110\",\n    \"S1116\",\n    \"S1117\",\n    \"S1118\",\n    \"S1121\",\n    \"S1123\",\n    \"S1125\",\n    \"S1133\",\n    \"S1134\",\n    \"S1135\",\n    \"S1144\",\n    \"S1155\",\n    \"S1163\",\n    \"S1168\",\n    \"S1172\",\n    \"S1185\",\n    \"S1186\",\n    \"S1192\",\n    \"S1199\",\n    \"S1206\",\n    \"S1210\",\n    \"S1215\",\n    \"S1244\",\n    \"S1264\",\n    \"S1313\",\n    \"S1450\",\n    \"S1479\",\n    \"S1481\",\n    \"S1607\",\n    \"S1643\",\n    \"S1656\",\n    \"S1694\",\n    \"S1696\",\n    \"S1699\",\n    \"S1751\",\n    \"S1764\",\n    \"S1848\",\n    \"S1854\",\n    \"S1862\",\n    \"S1871\",\n    \"S1905\",\n    \"S1939\",\n    \"S1940\",\n    \"S1944\",\n    \"S1994\",\n    \"S2053\",\n    \"S2068\",\n    \"S2077\",\n    \"S2092\",\n    \"S2094\",\n    \"S2114\",\n    \"S2115\",\n    \"S2123\",\n    \"S2139\",\n    \"S2166\",\n    \"S2178\",\n    \"S2183\",\n    \"S2184\",\n    \"S2187\",\n    \"S2190\",\n    \"S2198\",\n    \"S2201\",\n    \"S2219\",\n    \"S2222\",\n    \"S2223\",\n    \"S2225\",\n    \"S2234\",\n    \"S2245\",\n    \"S2251\",\n    \"S2252\",\n    \"S2257\",\n    \"S2259\",\n    \"S2275\",\n    \"S2290\",\n    \"S2291\",\n    \"S2292\",\n    \"S2306\",\n    \"S2325\",\n    \"S2326\",\n    \"S2328\",\n    \"S2342\",\n    \"S2344\",\n    \"S2345\",\n    \"S2346\",\n    \"S2365\",\n    \"S2368\",\n    \"S2372\",\n    \"S2376\",\n    \"S2386\",\n    \"S2436\",\n    \"S2437\",\n    \"S2445\",\n    \"S2479\",\n    \"S2486\",\n    \"S2551\",\n    \"S2583\",\n    \"S2589\",\n    \"S2612\",\n    \"S2629\",\n    \"S2674\",\n    \"S2681\",\n    \"S2688\",\n    \"S2692\",\n    \"S2696\",\n    \"S2699\",\n    \"S2701\",\n    \"S2737\",\n    \"S2743\",\n    \"S2755\",\n    \"S2757\",\n    \"S2761\",\n    \"S2857\",\n    \"S2925\",\n    \"S2930\",\n    \"S2933\",\n    \"S2934\",\n    \"S2953\",\n    \"S2955\",\n    \"S2970\",\n    \"S2971\",\n    \"S2995\",\n    \"S2996\",\n    \"S2997\",\n    \"S3005\",\n    \"S3010\",\n    \"S3011\",\n    \"S3060\",\n    \"S3063\",\n    \"S3168\",\n    \"S3169\",\n    \"S3172\",\n    \"S3217\",\n    \"S3218\",\n    \"S3220\",\n    \"S3236\",\n    \"S3237\",\n    \"S3241\",\n    \"S3244\",\n    \"S3246\",\n    \"S3247\",\n    \"S3249\",\n    \"S3251\",\n    \"S3260\",\n    \"S3261\",\n    \"S3262\",\n    \"S3263\",\n    \"S3264\",\n    \"S3265\",\n    \"S3267\",\n    \"S3329\",\n    \"S3330\",\n    \"S3343\",\n    \"S3346\",\n    \"S3358\",\n    \"S3363\",\n    \"S3376\",\n    \"S3397\",\n    \"S3398\",\n    \"S3400\",\n    \"S3415\",\n    \"S3427\",\n    \"S3431\",\n    \"S3433\",\n    \"S3440\",\n    \"S3442\",\n    \"S3443\",\n    \"S3444\",\n    \"S3445\",\n    \"S3447\",\n    \"S3449\",\n    \"S3450\",\n    \"S3451\",\n    \"S3453\",\n    \"S3456\",\n    \"S3457\",\n    \"S3458\",\n    \"S3459\",\n    \"S3464\",\n    \"S3466\",\n    \"S3597\",\n    \"S3598\",\n    \"S3600\",\n    \"S3603\",\n    \"S3604\",\n    \"S3610\",\n    \"S3626\",\n    \"S3655\",\n    \"S3776\",\n    \"S3869\",\n    \"S3871\",\n    \"S3875\",\n    \"S3877\",\n    \"S3878\",\n    \"S3881\",\n    \"S3885\",\n    \"S3887\",\n    \"S3889\",\n    \"S3897\",\n    \"S3903\",\n    \"S3904\",\n    \"S3923\",\n    \"S3925\",\n    \"S3926\",\n    \"S3927\",\n    \"S3928\",\n    \"S3949\",\n    \"S3963\",\n    \"S3966\",\n    \"S3971\",\n    \"S3972\",\n    \"S3973\",\n    \"S3981\",\n    \"S3984\",\n    \"S3993\",\n    \"S3998\",\n    \"S4015\",\n    \"S4019\",\n    \"S4035\",\n    \"S4036\",\n    \"S4050\",\n    \"S4052\",\n    \"S4061\",\n    \"S4070\",\n    \"S4136\",\n    \"S4143\",\n    \"S4144\",\n    \"S4158\",\n    \"S4159\",\n    \"S4200\",\n    \"S4201\",\n    \"S4210\",\n    \"S4211\",\n    \"S4220\",\n    \"S4260\",\n    \"S4275\",\n    \"S4277\",\n    \"S4347\",\n    \"S4423\",\n    \"S4426\",\n    \"S4428\",\n    \"S4433\",\n    \"S4456\",\n    \"S4487\",\n    \"S4502\",\n    \"S4507\",\n    \"S4524\",\n    \"S4545\",\n    \"S4581\",\n    \"S4583\",\n    \"S4586\",\n    \"S4635\",\n    \"S4663\",\n    \"S4790\",\n    \"S4830\",\n    \"S5034\",\n    \"S5042\",\n    \"S5122\",\n    \"S5332\",\n    \"S5344\",\n    \"S5443\",\n    \"S5445\",\n    \"S5542\",\n    \"S5547\",\n    \"S5659\",\n    \"S5693\",\n    \"S5753\",\n    \"S5766\",\n    \"S5773\",\n    \"S5856\",\n    \"S6377\",\n    \"S6418\",\n    \"S6419\",\n    \"S6420\",\n    \"S6422\",\n    \"S6424\",\n    \"S6444\",\n    \"S6561\",\n    \"S6562\",\n    \"S6575\",\n    \"S6580\",\n    \"S6588\",\n    \"S6607\",\n    \"S6608\",\n    \"S6609\",\n    \"S6610\",\n    \"S6612\",\n    \"S6613\",\n    \"S6617\",\n    \"S6618\",\n    \"S6640\",\n    \"S6664\",\n    \"S6667\",\n    \"S6668\",\n    \"S6669\",\n    \"S6670\",\n    \"S6672\",\n    \"S6673\",\n    \"S6674\",\n    \"S6675\",\n    \"S6677\",\n    \"S6678\",\n    \"S6781\",\n    \"S6797\",\n    \"S6798\",\n    \"S6800\",\n    \"S6930\",\n    \"S6931\",\n    \"S6932\",\n    \"S6934\",\n    \"S6960\",\n    \"S6961\",\n    \"S6962\",\n    \"S6964\",\n    \"S6965\",\n    \"S6966\",\n    \"S6967\",\n    \"S6968\",\n    \"S7039\",\n    \"S7130\",\n    \"S7131\",\n    \"S7133\",\n    \"S8367\",\n    \"S8368\",\n    \"S8380\",\n    \"S8381\"\n  ]\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S101.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Shared naming conventions allow teams to collaborate efficiently.</p>\n<p>This rule raises an issue when a class name does not match a provided regular expression.</p>\n<p>The default configuration is the one recommended by Microsoft:</p>\n<ul>\n  <li>Pascal casing, starting with an upper case character, e.g., <code>BackColor</code></li>\n  <li>Short abbreviations of 2 letters can be capitalized, e.g., <code>GetID</code></li>\n  <li>Longer abbreviations need to be lowercased, e.g., <code>GetHtml</code></li>\n</ul>\n<p>For example, with the default regular expression <code>^([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?$</code>, the class:</p>\n<pre>\nClass foo ' Noncompliant\nEnd Class\n</pre>\n<p>should be renamed to</p>\n<pre>\nClass Foo\nEnd Class\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/programming-guide/program-structure/naming-conventions\">Visual Basic Naming\n  Conventions</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/design-guidelines/capitalization-conventions\">Microsoft Capitalization\n  Conventions</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S101.json",
    "content": "{\n  \"title\": \"Class names should comply with a naming convention\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-101\",\n  \"sqKey\": \"S101\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S103.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Scrolling horizontally to see a full line of code lowers the code readability.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S103.json",
    "content": "{\n  \"title\": \"Lines should not be too long\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"FORMATTED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-103\",\n  \"sqKey\": \"S103\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S104.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When a source file grows too much, it can accumulate numerous responsibilities and become challenging to understand and maintain.</p>\n<p>Above a specific threshold, refactor the file into smaller files whose code focuses on well-defined tasks. Those smaller files will be easier to\nunderstand and test.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S104.json",
    "content": "{\n  \"title\": \"Files should not have too many lines of code\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"FOCUSED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1h\"\n  },\n  \"tags\": [\n    \"brain-overload\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-104\",\n  \"sqKey\": \"S104\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1048.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.object.finalize\">Finalize methods</a> are used to perform <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/fundamentals#unmanaged-resources\">any necessary final clean-up</a> when the\ngarbage collector is collecting a class instance. The programmer has no control over when the Finalize method is called; the garbage collector decides\nwhen to call it.</p>\n<p>When creating a Finalize method, it should never throw an exception, as there is a high risk of having the application terminated leaving unmanaged\nresources without a graceful cleanup.</p>\n<p>The rule raises an issue on <code>throw</code> statements used in a Finalize method.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nClass Sample\n    Protected Overrides Sub Finalize()\n        Throw New NotImplementedException() ' Noncompliant: Finalize method throws an exception\n    End Sub\nEnd Class\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nClass Sample\n    Protected Overrides Sub Finalize()\n        ' Noncompliant: Finalize method does not throw an exception\n    End Sub\nEnd Class\n</pre>\n<h3>Going the extra mile</h3>\n<p>In general object finalization can be a complex and error-prone operation and should not be implemented except within the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/implementing-dispose\">dispose pattern</a>.</p>\n<p>When <a href=\"https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/unmanaged\">cleaning up unmanaged resources</a>, it is\nrecommended to implement the dispose pattern or, to cover uncalled <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.idisposable.dispose\"><code>Dispose</code></a> method by the consumer, implement <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.safehandle\"><code>SafeHandle</code></a>.</p>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/fundamentals\">Fundamentals of garbage\n  collection</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/unmanaged\">Cleaning up unmanaged\n  resources</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/implementing-dispose\">Implement a Dispose\n  method</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.safehandle\"><code>SafeHandle</code>\n  Class</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.idisposable.dispose\"><code>IDisposable.Dispose</code>\n  Method</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.object.finalize\">Object.Finalize method</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1048.json",
    "content": "{\n  \"title\": \"Finalize method should not throw exceptions\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-1048\",\n  \"sqKey\": \"S1048\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S105.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The tab width can differ from one development environment to another. Using tabs may require other developers to configure their environment (text\neditor, preferences, etc.) to read source code.</p>\n<p>That is why using spaces is preferable.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S105.json",
    "content": "{\n  \"title\": \"Tabulation characters should not be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"FORMATTED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-105\",\n  \"sqKey\": \"S105\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1066.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Nested code - blocks of code inside blocks of code - is eventually necessary, but increases complexity. This is why keeping the code as flat as\npossible, by avoiding unnecessary nesting, is considered a good practice.</p>\n<p>Merging <code>if</code> statements when possible will decrease the nesting of the code and improve its readability.</p>\n<p>Code like</p>\n<pre>\nIf condition1 Then\n    If condition2 Then ' Noncompliant\n        ' ...\n    End If\nEnd If\n</pre>\n<p>Will be more readable as</p>\n<pre>\nIf condition1 AndAlso condition2 Then\n    ' ...\nEnd If\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1066.json",
    "content": "{\n  \"title\": \"Mergeable \\\"if\\\" statements should be combined\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1066\",\n  \"sqKey\": \"S1066\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1067.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Complex boolean expressions are hard to read and so to maintain.</p>\n<h3>Noncompliant code example</h3>\n<p>With the default threshold value of 3</p>\n<pre>\nIf ((condition1 AndAlso condition2) OrElse (condition3 AndAlso condition4)) AndAlso condition5) Then  'Noncompliant\n  ...\nEnd If\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nIf ((MyFirstCondition() OrElse MySecondCondition()) AndAlso MyLastCondition()) Then\n  ...\nEnd If\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1067.json",
    "content": "{\n  \"title\": \"Expressions should not be too complex\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"FOCUSED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"3min\"\n  },\n  \"tags\": [\n    \"brain-overload\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-1067\",\n  \"sqKey\": \"S1067\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S107.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Procedures with a long parameter list are difficult to use because maintainers must figure out the role of each parameter and keep track of their\nposition.</p>\n<pre>\nSub SetCoordinates(x1 As Integer, y1 As Integer, z1 As Integer, x2 As Integer, y2 As Integer, z2 As Integer) ' Noncompliant\n    ' ...\nEnd Sub\n</pre>\n<p>The solution can be to:</p>\n<ul>\n  <li>Split the procedure into smaller ones</li>\n</ul>\n<pre>\n' Each function does a part of what the original setCoordinates function was doing, so confusion risks are lower\nSub SetOrigin(x As Integer, y As Integer, z As Integer)\n   ' ...\nEnd Sub\n\nSub SetSize(width As Integer, height As Integer, depth As Integer)\n   ' ...\nEnd Sub\n</pre>\n<ul>\n  <li>Find a better data structure for the parameters that group data in a way that makes sense for the specific application domain</li>\n</ul>\n<pre>\nClass Point ' In geometry, Point is a logical structure to group data\n\n    Public x As Integer\n    Public y As Integer\n    Public z As Integer\n\nEnd Class\n\nSub SetCoordinates(p1 As Point, p2 As Point)\n    ' ...\nEnd Sub\n</pre>\n<p>This rule raises an issue when a procedure has more parameters than the provided threshold.</p>\n<h3>Exceptions</h3>\n<p>The rule does not count the parameters intended for a base class constructor.</p>\n<p>With a maximum number of 4 parameters:</p>\n<pre>\nClass BaseClass\n\n    Sub New(Param1 As Integer)\n        ' ...\n    End Sub\n\nEnd Class\n\nClass DerivedClass\n    Inherits BaseClass\n\n    Public Sub New(Param1 As Integer, Param2 As Integer, Param3 As Integer, Param4 As Integer, Param5 As Long)\n    ' Compliant by exception: Param1 is used in the base class constructor, so it does not count in the sum of the parameter list.\n        MyBase.New(Param1)\n        ' ...\n    End Sub\n\nEnd Class\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S107.json",
    "content": "{\n  \"title\": \"Procedures should not have too many parameters\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"FOCUSED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"brain-overload\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-107\",\n  \"sqKey\": \"S107\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1075.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Hard-coding a URI makes it difficult to test a program for a variety of reasons:</p>\n<ul>\n  <li>path literals are not always portable across operating systems</li>\n  <li>a given absolute path may not exist in a specific test environment</li>\n  <li>a specified Internet URL may not be available when executing the tests</li>\n  <li>production environment filesystems usually differ from the development environment</li>\n</ul>\n<p>In addition, hard-coded URIs can contain sensitive information, like IP addresses, and they should not be stored in the code.</p>\n<p>For all those reasons, a URI should never be hard coded. Instead, it should be replaced by a customizable parameter.</p>\n<p>Further, even if the elements of a URI are obtained dynamically, portability can still be limited if the path delimiters are hard-coded.</p>\n<p>This rule raises an issue when URIs or path delimiters are hard-coded.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1075.json",
    "content": "{\n  \"title\": \"URIs should not be hardcoded\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1075\",\n  \"sqKey\": \"S1075\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S108.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>An empty code block is confusing. It will require some effort from maintainers to determine if it is intentional or indicates the implementation is\nincomplete.</p>\n<pre>\nFor Index As Integer = 1 To 42 ' Noncompliant: is the block empty on purpose, or is code missing?\nNext\n</pre>\n<p>Removing or filling the empty code blocks takes away ambiguity and generally results in a more straightforward and less surprising code.</p>\n<h3>Exceptions</h3>\n<p>The rule ignores code blocks that contain comments.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S108.json",
    "content": "{\n  \"title\": \"Nested blocks of code should not be left empty\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-108\",\n  \"sqKey\": \"S108\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1110.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The use of parentheses, even those not required to enforce a desired order of operations, can clarify the intent behind a piece of code. However,\nredundant pairs of parentheses could be misleading and should be removed.</p>\n<h3>Noncompliant code example</h3>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nIf a AndAlso ((x + y &gt; 0)) Then ' Noncompliant\n    ' ...\nEnd If\n\nReturn ((x + 1))  ' Noncompliant\n</pre>\n<h3>Compliant solution</h3>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nIf a AndAlso x + y &gt; 0 Then\n    ' ...\nEnd If\n\nReturn x + 1\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1110.json",
    "content": "{\n  \"title\": \"Redundant pairs of parentheses should be removed\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1min\"\n  },\n  \"tags\": [\n    \"confusing\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1110\",\n  \"sqKey\": \"S1110\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S112.html",
    "content": "<p>This rule raises an issue when a generic exception (such as <code>Exception</code>, <code>SystemException</code>,\n<code>ApplicationException</code>, <code>IndexOutOfRangeException</code>, <code>NullReferenceException</code>, <code>OutOfMemoryException</code> or\n<code>ExecutionEngineException</code>) is thrown.</p>\n<h2>Why is this an issue?</h2>\n<p>Throwing general exceptions such as <code>Exception</code>, <code>SystemException</code> and <code>ApplicationException</code> will have a negative\nimpact on any code trying to catch these exceptions.</p>\n<p>From a consumer perspective, it is generally a best practice to only catch exceptions you intend to handle. Other exceptions should ideally not be\ncaught and let to propagate up the stack trace so that they can be dealt with appropriately. When a generic exception is thrown, it forces consumers\nto catch exceptions they do not intend to handle, which they then have to re-throw.</p>\n<p>Besides, when working with a generic type of exception, the only way to distinguish between multiple exceptions is to check their message, which is\nerror-prone and difficult to maintain. Legitimate exceptions may be unintentionally silenced and errors may be hidden.</p>\n<p>For instance, if an exception such as <code>StackOverflowException</code> is caught and not re-thrown, it may prevent the program from terminating\ngracefully.</p>\n<p>When throwing an exception, it is therefore recommended to throw the most specific exception possible so that it can be handled intentionally by\nconsumers.</p>\n<p>Additionally, some reserved exceptions should not be thrown manually. Exceptions such as <code>IndexOutOfRangeException</code>,\n<code>NullReferenceException</code>, <code>OutOfMemoryException</code> or <code>ExecutionEngineException</code> will be thrown automatically by the\nruntime when the corresponding error occurs. Many of them indicate serious errors, which the application may not be able to recover from. It is\ntherefore recommended to avoid throwing them as well as using them as base classes.</p>\n<h2>How to fix it</h2>\n<p>To fix this issue, make sure to throw specific exceptions that are relevant to the context in which they arise. It is recommended to either:</p>\n<ul>\n  <li>Throw a subtype of <code>Exception</code> when one matches. For instance <code>ArgumentException</code> could be raised when an unexpected\n  argument is provided to a function.</li>\n  <li>Define a custom exception type that derives from <code>Exception</code> or one of its subclasses.</li>\n</ul>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nPublic Sub DoSomething(obj As Object)\n  If obj Is Nothing Then\n    ' Noncompliant\n    Throw New NullReferenceException(\"obj\") ' Noncompliant: This reserved exception should not be thrown manually\n  End If\n  ' ...\nEnd Sub\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nPublic Sub DoSomething(obj As Object)\n  If obj Is Nothing Then\n    Throw New ArgumentNullException(\"obj\") ' Compliant: this is a specific and non-reserved exception type\n  End If\n  ' ...\nEnd Sub\n</pre>\n<h2>Resources</h2>\n<h3>Standards</h3>\n<ul>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/397\">CWE-397 Declaration of Throws for Generic Exception</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S112.json",
    "content": "{\n  \"title\": \"General or reserved exceptions should never be thrown\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"error-handling\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-112\",\n  \"sqKey\": \"S112\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      397\n    ]\n  },\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1123.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The <code>Obsolete</code> attribute can be applied with or without a message argument. Marking something <code>Obsolete</code> without including\nadvice on why it’s obsolete or what to use instead will lead maintainers to waste time trying to figure those things out.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nPublic Class Car\n\n    &lt;Obsolete&gt;  ' Noncompliant\n    Public Sub CrankEngine(Turns As Integer)\n        ' ...\n    End Sub\n\nEnd Class\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nPublic Class Car\n\n    &lt;Obsolete(\"Replaced by the automatic starter\")&gt;\n    Public Sub CrankEngine(Turns As Integer)\n        ' ...\n    End Sub\n\nEnd Class\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1123.json",
    "content": "{\n  \"title\": \"\\\"Obsolete\\\" attributes should include explanations\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"obsolete\",\n    \"bad-practice\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1123\",\n  \"sqKey\": \"S1123\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1125.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>A boolean literal can be represented in two different ways: <code>True</code> or <code>False</code>. They can be combined with logical operators\n(<code>Not, And, Or, =</code>) to produce logical expressions that represent truth values. However, comparing a boolean literal to a variable or\nexpression that evaluates to a boolean value is unnecessary and can make the code harder to read and understand. The more complex a boolean expression\nis, the harder it will be for developers to understand its meaning and expected behavior, and it will favour the introduction of new bugs.</p>\n<h2>How to fix it</h2>\n<p>Remove redundant boolean literals from expressions to improve readability and make the code more maintainable.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nIf BooleanMethod() = True Then ' Noncompliant\n  ' ...\nEnd If\nIf BooleanMethod() = False Then ' Noncompliant\n  ' ...\nEnd If\nIf BooleanMethod() OrElse False Then ' Noncompliant\n  ' ...\nEnd If\nDoSomething(Not False) ' Noncompliant\nDoSomething(BooleanMethod() = True) ' Noncompliant\n\nDim booleanVariable = If(BooleanMethod(), True, False) ' Noncompliant\nbooleanVariable = If(BooleanMethod(), True, exp) ' Noncompliant\nbooleanVariable = If(BooleanMethod(), False, exp) ' Noncompliant\nbooleanVariable = If(BooleanMethod(), exp, True) ' Noncompliant\nbooleanVariable = If(BooleanMethod(), exp, False) ' Noncompliant\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nIf BooleanMethod() Then\n  ' ...\nEnd If\nIf Not BooleanMethod() Then\n  ' ...\nEnd If\nIf BooleanMethod() Then\n  ' ...\nEnd If\nDoSomething(True)\nDoSomething(BooleanMethod())\n\nDim booleanVariable = BooleanMethod()\nbooleanVariable = BooleanMethod() OrElse exp\nbooleanVariable = Not BooleanMethod() AndAlso exp\nbooleanVariable = Not BooleanMethod() OrElse exp\nbooleanVariable = BooleanMethod() AndAlso exp\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1125.json",
    "content": "{\n  \"title\": \"Boolean literals should not be redundant\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1125\",\n  \"sqKey\": \"S1125\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1133.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>This rule is meant to be used as a way to track code which is marked as being deprecated. Deprecated code should eventually be removed.</p>\n<h3>Noncompliant code example</h3>\n<pre>\n&lt;Obsolete&gt; ' Noncompliant\nSub Procedure()\nEnd Sub\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1133.json",
    "content": "{\n  \"title\": \"Deprecated code should be removed\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"INFO\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"obsolete\"\n  ],\n  \"defaultSeverity\": \"Info\",\n  \"ruleSpecification\": \"RSPEC-1133\",\n  \"sqKey\": \"S1133\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1134.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><code>FIXME</code> tags are commonly used to mark places where a bug is suspected, but which the developer wants to deal with later.</p>\n<p>Sometimes the developer will not have the time or will simply forget to get back to that tag.</p>\n<p>This rule is meant to track those tags and to ensure that they do not go unnoticed.</p>\n<pre>\nFunction Divide(numerator As Integer, denominator As Integer) As Integer\n    Return numerator / denominator  ' FIXME denominator value might be  0\nEnd Function\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/546\">CWE-546 - Suspicious Comment</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1134.json",
    "content": "{\n  \"title\": \"Track uses of \\\"FIXME\\\" tags\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"0min\"\n  },\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1134\",\n  \"sqKey\": \"S1134\",\n  \"scope\": \"All\",\n  \"securityStandards\": {\n    \"CWE\": [\n      546\n    ]\n  },\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1135.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Developers often use <code>TODO</code> tags to mark areas in the code where additional work or improvements are needed but are not implemented\nimmediately. However, these <code>TODO</code> tags sometimes get overlooked or forgotten, leading to incomplete or unfinished code. This rule aims to\nidentify and address unattended <code>TODO</code> tags to ensure a clean and maintainable codebase. This description explores why this is a problem\nand how it can be fixed to improve the overall code quality.</p>\n<h3>What is the potential impact?</h3>\n<p>Unattended <code>TODO</code> tags in code can have significant implications for the development process and the overall codebase.</p>\n<p>Incomplete Functionality: When developers leave <code>TODO</code> tags without implementing the corresponding code, it results in incomplete\nfunctionality within the software. This can lead to unexpected behavior or missing features, adversely affecting the end-user experience.</p>\n<p>Missed Bug Fixes: If developers do not promptly address <code>TODO</code> tags, they might overlook critical bug fixes and security updates.\nDelayed bug fixes can result in more severe issues and increase the effort required to resolve them later.</p>\n<p>Impact on Collaboration: In team-based development environments, unattended <code>TODO</code> tags can hinder collaboration. Other team members\nmight not be aware of the intended changes, leading to conflicts or redundant efforts in the codebase.</p>\n<p>Codebase Bloat: The accumulation of unattended <code>TODO</code> tags over time can clutter the codebase and make it difficult to distinguish\nbetween work in progress and completed code. This bloat can make it challenging to maintain an organized and efficient codebase.</p>\n<p>Addressing this code smell is essential to ensure a maintainable, readable, reliable codebase and promote effective collaboration among\ndevelopers.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nSub DoSomething()\n    ' TODO\nEnd Sub\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/546\">CWE-546 - Suspicious Comment</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1135.json",
    "content": "{\n  \"title\": \"Track uses of \\\"TODO\\\" tags\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"INFO\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"0min\"\n  },\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Info\",\n  \"ruleSpecification\": \"RSPEC-1135\",\n  \"sqKey\": \"S1135\",\n  \"scope\": \"All\",\n  \"securityStandards\": {\n    \"CWE\": [\n      546\n    ]\n  },\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S114.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Sharing some naming conventions is a key point to make it possible for a team to efficiently collaborate.</p>\n<p>This rule allows to check that all interface names match a provided regular expression.</p>\n<p>The default configuration is the one recommended by Microsoft:</p>\n<ul>\n  <li>Must start with an upper case 'I' character, e.g. IFoo</li>\n  <li>Followed by Pascal casing, starting with an upper case character, e.g. IEnumerable</li>\n  <li>Short abbreviations of 2 letters can be capitalized, e.g. IFooID</li>\n  <li>Longer abbreviations need to be lower cased, e.g. IFooHtml</li>\n</ul>\n<h3>Noncompliant code example</h3>\n<p>With the default regular expression <code>^I([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?$</code>:</p>\n<pre>\nInterface Foo  ' Noncompliant\nEnd Interface\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nInterface IFoo ' Compliant\nEnd Interface\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S114.json",
    "content": "{\n  \"title\": \"Interface names should comply with a naming convention\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-114\",\n  \"sqKey\": \"S114\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1147.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><code>End</code> statements exit the control flow of the program in an unstructured way. This statement stops code execution immediately without\nexecuting <code>Dispose</code> or <code>Finalize</code> methods, or executing <code>Finally</code> blocks. Therefore, it should be avoided.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nModule Module1\n    Sub Print(ByVal str As String)\n       Try\n            ...\n            End       ' Noncompliant\n        Finally\n            ' do something important here\n            ...\n        End Try\n    End Sub\nEnd Module\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1147.json",
    "content": "{\n  \"title\": \"\\\"End\\\" statements should not be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-1147\",\n  \"sqKey\": \"S1147\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      382\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1151.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The <code>Select...Case</code> statement should be used only to clearly define some new branches in the control flow. As soon as a case clause\ncontains too many statements this highly decreases the readability of the overall control flow statement. In such case, the content of the case clause\nshould be extracted into a dedicated procedure.</p>\n<h3>Noncompliant code example</h3>\n<p>With the default threshold of 3:</p>\n<pre>\nSelect Case number\n    Case 1 To 5 ' Noncompliant: 4 statements in the case\n        MethodCall1(\"\")\n        MethodCall2(\"\")\n        MethodCall3(\"\")\n        MethodCall4(\"\")\n    Case Else\n        ' ...\nEnd Select\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nSelect Case number\n    Case 1 To 5\n        DoSomething()\n    Case Else\n        ' ...\nEnd Select\n...\nSub DoSomething()\n    MethodCall1(\"\")\n    MethodCall2(\"\")\n    MethodCall3(\"\")\n    MethodCall4(\"\")\nEnd Sub\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1151.json",
    "content": "{\n  \"title\": \"\\\"Select...Case\\\" clauses should not have too many lines of code\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"FOCUSED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"brain-overload\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1151\",\n  \"sqKey\": \"S1151\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1155.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Using <code>.Count()</code> to test for emptiness works, but using <code>.Any()</code> makes the intent clearer, and the code more readable.\nHowever, there are some cases where special attention should be paid:</p>\n<ul>\n  <li>if the collection is an <code>EntityFramework</code> or other ORM query, calling <code>.Count()</code> will cause executing a potentially\n  massive SQL query and could put a large overhead on the application database. Calling <code>.Any()</code> will also connect to the database, but\n  will generate much more efficient SQL.</li>\n  <li>if the collection is part of a LINQ query that contains <code>.Select()</code> statements that create objects, a large amount of memory could be\n  unnecessarily allocated. Calling <code>.Any()</code> will be much more efficient because it will execute fewer iterations of the enumerable.</li>\n</ul>\n<h3>Noncompliant code example</h3>\n<pre>\nPrivate Function HasContent(Strings As IEnumerable(Of String)) As Boolean\n    Return Strings.Count() &gt; 0      ' Noncompliant\nEnd Function\n\nPrivate Function HasContent2(Strings As IEnumerable(Of String)) As Boolean\n    Return Strings.Count() &gt;= 1     ' Noncompliant\nEnd Function\n\nPrivate Function IsEmpty(Strings As IEnumerable(Of String)) As Boolean\n    Return Strings.Count() = 0      ' Noncompliant\nEnd Function\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nPrivate Function HasContent(Strings As IEnumerable(Of String)) As Boolean\n    Return Strings.Any\nEnd Function\n\nPrivate Function HasContent2(Strings As IEnumerable(Of String)) As Boolean\n    Return Strings.Any\nEnd Function\n\nPrivate Function IsEmpty(Strings As IEnumerable(Of String)) As Boolean\n    Return Not Strings.Any\nEnd Function\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1155.json",
    "content": "{\n  \"title\": \"\\\"Any()\\\" should be used to test for emptiness\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1155\",\n  \"sqKey\": \"S1155\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1163.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>If an exception is already being thrown within the <code>try</code> block or caught in a <code>catch</code> block, throwing another exception in\nthe <code>finally</code> block will override the original exception. This means that the original exception’s message and stack trace will be lost,\npotentially making it challenging to diagnose and troubleshoot the root cause of the problem.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nTry\n    ' Some work which end up throwing an exception\n    Throw New ArgumentException()\nFinally\n    ' Cleanup\n    Throw New InvalidOperationException() ' Noncompliant: will mask the ArgumentException\nEnd Try\n</pre>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nTry\n    ' Some work which end up throwing an exception\n    Throw New ArgumentException()\nFinally\n    ' Cleanup without throwing\nEnd Try\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/exceptions/\">Exceptions and Exception Handling</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/exceptions/how-to-use-finally-blocks\">Finally blocks</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/exceptions/how-to-execute-cleanup-code-using-finally\">How to execute\n  cleanup code using finally</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1163.json",
    "content": "{\n  \"title\": \"Exceptions should not be thrown in finally blocks\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"tags\": [\n    \"error-handling\",\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-1163\",\n  \"sqKey\": \"S1163\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S117.html",
    "content": "<p>Local variables should be named consistently to communicate intent and improve maintainability. Rename your local variable to follow your project’s\nnaming convention to address this issue.</p>\n<h2>Why is this an issue?</h2>\n<p>A naming convention in software development is a set of guidelines for naming code elements like variables, functions, and classes.\n  <br>\n  Local variables hold the meaning of the written code. Their names should be meaningful and follow a consistent and easily recognizable pattern.\n  <br>\n  Adhering to a consistent naming convention helps to make the code more readable and understandable, which makes it easier to maintain and debug. It\n  also ensures consistency in the code, especially when multiple developers are working on the same project.</p>\n<p>This rule checks that local variable names match a provided regular expression.</p>\n<h3>What is the potential impact?</h3>\n<p>Inconsistent naming of local variables can lead to several issues in your code:</p>\n<ul>\n  <li><strong>Reduced Readability</strong>: Inconsistent local variable names make the code harder to read and understand; consequently, it is more\n  difficult to identify the purpose of each variable, spot errors, or comprehend the logic.</li>\n  <li><strong>Difficulty in Identifying Variables</strong>: The local variables that don’t adhere to a standard naming convention are challenging to\n  identify; thus, the coding process slows down, especially when dealing with a large codebase.</li>\n  <li><strong>Increased Risk of Errors</strong>: Inconsistent or unclear local variable names lead to misunderstandings about what the variable\n  represents. This ambiguity leads to incorrect assumptions and, consequently, bugs in the code.</li>\n  <li><strong>Collaboration Difficulties</strong>: In a team setting, inconsistent naming conventions lead to confusion and miscommunication among\n  team members.</li>\n  <li><strong>Difficulty in Code Maintenance</strong>: Inconsistent naming leads to an inconsistent codebase. The code is difficult to understand, and\n  making changes feels like refactoring constantly, as you face different naming methods. Ultimately, it makes the codebase harder to maintain.</li>\n</ul>\n<p>In summary, not adhering to a naming convention for local variables can lead to confusion, errors, and inefficiencies, making the code harder to\nread, understand, and maintain.</p>\n<h2>How to fix it</h2>\n<p>First, familiarize yourself with the particular naming convention of the project in question. Then, update the name to match the convention, as\nwell as all usages of the name. For many IDEs, you can use built-in renaming and refactoring features to update all usages at once.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<p>With the default regular expression <code>^[a-z][a-z0-9]*([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?$</code>, bringing the following constraints:</p>\n<ul>\n  <li>Camel casing, starting with a lowercase character, for example backColor</li>\n  <li>Short abbreviations of 2 letters can be capitalized only when not at the beginning, for example id, productID</li>\n  <li>Longer abbreviations need to be lowercased, for example html</li>\n</ul>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nModule Module1\n    Sub Main()\n        Dim Foo = 0 ' Noncompliant\n    End Sub\nEnd Module\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nModule Module1\n    Sub Main()\n        Dim foo = 0 ' Compliant\n    End Sub\nEnd Module\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/programming-guide/program-structure/naming-conventions\">Visual\n  Basic Naming Conventions</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Naming_convention_(programming)\">Naming Convention (programming)</a></li>\n</ul>\n<h3>Related rules</h3>\n<ul>\n  <li>{rule:vbnet:S101} - Class names should comply with a naming convention</li>\n  <li>{rule:vbnet:S114} - Interface names should comply with a naming convention</li>\n  <li>{rule:vbnet:S119} - Generic type parameter names should comply with a naming convention</li>\n  <li>{rule:vbnet:S1542} - Functions and procedures should comply with a naming convention</li>\n  <li>{rule:vbnet:S1654} - Method parameters should follow a naming convention</li>\n  <li>{rule:vbnet:S2304} - Namespace names should comply with a naming convention</li>\n  <li>{rule:vbnet:S2342} - Enumeration types should comply with a naming convention</li>\n  <li>{rule:vbnet:S2343} - Enumeration values should comply with a naming convention</li>\n  <li>{rule:vbnet:S2347} - Event handlers should comply with a naming convention</li>\n  <li>{rule:vbnet:S2348} - Events should comply with a naming convention</li>\n  <li>{rule:vbnet:S2362} - Private constants should comply with a naming convention</li>\n  <li>{rule:vbnet:S2363} - \"Private Shared ReadOnly\" fields should comply with a naming convention</li>\n  <li>{rule:vbnet:S2364} - \"Private\" fields should comply with a naming convention</li>\n  <li>{rule:vbnet:S2366} - Properties should comply with a naming convention</li>\n  <li>{rule:vbnet:S2367} - Non-private constants should comply with a naming convention</li>\n  <li>{rule:vbnet:S2369} - Non-private fields should comply with a naming convention</li>\n  <li>{rule:vbnet:S2370} - Non-private \"Shared ReadOnly\" fields should comply with a naming convention</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S117.json",
    "content": "{\n  \"title\": \"Local variable names should comply with a naming convention\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-117\",\n  \"sqKey\": \"S117\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1172.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>A typical code smell known as unused function parameters refers to parameters declared in a function but not used anywhere within the function’s\nbody. While this might seem harmless at first glance, it can lead to confusion and potential errors in your code. Disregarding the values passed to\nsuch parameters, the function’s behavior will be the same, but the programmer’s intention won’t be clearly expressed anymore. Therefore, removing\nfunction parameters that are not being utilized is considered best practice.</p>\n<p>This rule raises an issue when a <code>private</code> procedure of a <code>Class</code>, <code>Module</code> or <code>Structure</code> takes a\nparameter without using it.</p>\n<h3>Exceptions</h3>\n<p>This rule doesn’t raise any issue in the following contexts:</p>\n<ul>\n  <li>Procedures decorated with attributes.</li>\n  <li>Empty procedures.</li>\n  <li>Procedures which only throw <code>NotImplementedException</code>.</li>\n  <li>Main methods.</li>\n  <li><code>virtual</code>, <code>override</code> procedures.</li>\n  <li>Interface implementations.</li>\n  <li>Event handlers.</li>\n</ul>\n<h2>How to fix it</h2>\n<p>Having unused function parameters in your code can lead to confusion and misunderstanding of a developer’s intention. They reduce code readability\nand introduce the potential for errors. To avoid these problems, developers should remove unused parameters from function declarations.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nPrivate Sub DoSomething(ByVal a As Integer, ByVal b as Integer) ' \"b\" is unused\n    Compute(a)\nEnd Sub\n\nPrivate Function DoSomething2(ByVal a As Integer, ByVal b As Integer) As Integer ' \"a\" is unused\n    Compute(b)\n    Return b\nEnd Function\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nPrivate Sub DoSomething(ByVal a As Integer)\n    Compute(a)\nEnd Sub\n\nPrivate Function DoSomething2(ByVal b As Integer) As Integer\n    Compute(b)\n    Return b\nEnd Function\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1172.json",
    "content": "{\n  \"title\": \"Unused procedure parameters should be removed\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"unused\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1172\",\n  \"sqKey\": \"S1172\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1186.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>An empty method is generally considered bad practice and can lead to confusion, readability, and maintenance issues. Empty methods bring no\nfunctionality and are misleading to others as they might think the method implementation fulfills a specific and identified requirement.</p>\n<p>There are several reasons for a method not to have a body:</p>\n<ul>\n  <li>It is an unintentional omission, and should be fixed to prevent an unexpected behavior in production.</li>\n  <li>It is not yet, or never will be, supported. In this case an exception should be thrown.</li>\n  <li>The method is an intentionally-blank override. In this case a nested comment should explain the reason for the blank override.</li>\n</ul>\n<h3>Exceptions</h3>\n<p>The following empty methods are considered compliant:</p>\n<ul>\n  <li>empty <code>Overridable</code> methods, as the implementation might not be required in the base class</li>\n  <li>empty methods that override a <code>MustOverride</code> method as the implementation is mandatory for child class</li>\n  <li>empty overrides in test assemblies for mocking purposes</li>\n</ul>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nSub ShouldNotBeEmpty()  ' Noncompliant - method is empty\nEnd Sub\n\nSub NotImplementedYet()  ' Noncompliant - method is empty\nEnd Sub\n\nSub WillNeverBeImplemented()  ' Noncompliant - method is empty\nEnd Sub\n\nSub EmptyOnPurpose()  ' Noncompliant - method is empty\nEnd Sub\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nSub ShouldNotBeEmpty()\n    DoSomething()\nEnd Sub\n\nSub NotImplementedYet()\n    Throw New NotImplementedException\nEnd Sub\n\nSub WillNeverBeImplemented()\n    Throw New NotSupportedException\nEnd Sub\n\nSub EmptyOnPurpose()\n    ' Do nothing because of X\nEnd Sub\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1186.json",
    "content": "{\n  \"title\": \"Methods should not be empty\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-1186\",\n  \"sqKey\": \"S1186\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S119.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Inconsistent naming conventions can lead to confusion and errors when working in a team. This rule ensures that all generic type parameter names\nfollow a consistent naming convention by checking them against a provided regular expression.</p>\n<p>The default configuration follows Microsoft’s recommended convention:</p>\n<ul>\n  <li>Generic type parameter names must start with an upper case 'T', e.g. T</li>\n  <li>The rest of the name should use Pascal casing, starting with an upper case character, e.g. TKey</li>\n  <li>Short abbreviations of 2 letters can be capitalized, e.g. TFooID</li>\n  <li>Longer abbreviations should be lowercased, e.g. TFooHtml</li>\n</ul>\n<h2>How to fix it</h2>\n<p>To fix this issue, ensure that all generic type parameter names in your code follow the naming convention specified in the regular expression.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<p>With the default parameter value <code>^T(([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?)?$</code>:</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nPublic Class Foo(Of tkey) ' Noncompliant\nEnd Class\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nPublic Class Foo(Of TKey) ' Compliant\nEnd Class\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/generics/generic-type-parameters\">Generic Type\n  Parameters (C# reference)</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S119.json",
    "content": "{\n  \"title\": \"Generic type parameter names should comply with a naming convention\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-119\",\n  \"sqKey\": \"S119\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1192.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Duplicated string literals make the process of refactoring complex and error-prone, as any change would need to be propagated on all\noccurrences.</p>\n<h3>Exceptions</h3>\n<p>The following are ignored:</p>\n<ul>\n  <li>literals with fewer than 5 characters</li>\n  <li>literals matching one of the parameter names</li>\n  <li>literals used in attributes</li>\n</ul>\n<h2>How to fix it</h2>\n<p>Use constants to replace the duplicated string literals. Constants can be referenced from many places, but only need to be updated in a single\nplace.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nPublic Class Foo\n\n    Private Name As String = \"foobar\" ' Noncompliant\n\n    Public ReadOnly Property DefaultName As String = \"foobar\" ' Noncompliant\n\n    Public Sub New(Optional Value As String = \"foobar\") ' Noncompliant\n\n        Dim Something = If(Value, \"foobar\") ' Noncompliant\n\n    End Sub\n\nEnd Class\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nPublic Class Foo\n\n    Private Const Foobar As String = \"foobar\"\n\n    Private Name As String = Foobar\n\n    Public ReadOnly Property DefaultName As String = Foobar\n\n    Public Sub New(Optional Value As String = Foobar)\n\n        Dim Something = If(Value, Foobar)\n\n    End Sub\n\nEnd Class\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1192.json",
    "content": "{\n  \"title\": \"String literals should not be duplicated\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"DISTINCT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Linear with offset\",\n    \"linearDesc\": \"per duplicate instance\",\n    \"linearOffset\": \"2min\",\n    \"linearFactor\": \"2min\"\n  },\n  \"tags\": [\n    \"design\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1192\",\n  \"sqKey\": \"S1192\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1197.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Array designators should always be located on the type for better code readability. Otherwise, developers must look both at the type and the\nvariable name to know whether or not a variable is an array.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nModule Module1\n    Sub Main()\n        Dim foo() As String ' Noncompliant\n    End Sub\nEnd Module\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nModule Module1\n    Sub Main()\n        Dim foo As String() ' Compliant\n    End Sub\nEnd Module\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1197.json",
    "content": "{\n  \"title\": \"Array designators \\\"()\\\" should be on the type, not the variable\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"FORMATTED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1197\",\n  \"sqKey\": \"S1197\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S122.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Putting multiple statements on a single line lowers the code readability and makes debugging the code more complex.</p>\n<pre>\nDim a = 0 : Dim b = 0  ' Noncompliant\n</pre>\n<p>Write one statement per line to improve readability.</p>\n<pre>\nDim a = 0\nDim b = 0\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S122.json",
    "content": "{\n  \"title\": \"Statements should be on separate lines\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"FORMATTED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-122\",\n  \"sqKey\": \"S122\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1226.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>While it is technically correct to assign to parameters from within method bodies, doing so before the parameter value is read is likely a bug.\nInstead, initial values of parameters should be, if not treated as <code>readonly</code> then at least read before reassignment.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nModule Module1\n    Sub Foo(ByVal a As Integer)\n        a = 42                  ' Noncompliant\n    End Sub\nEnd Module\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nModule Module1\n    Sub Foo(ByVal a As Integer)\n        Dim tmp = a\n        tmp = 42\n    End Sub\nEnd Module\n</pre>\n<h3>Exceptions</h3>\n<p><code>ByRef</code> parameters are ignored.</p>\n<pre>\nModule Module1\n    Sub Foo(ByRef a As Integer)\n        a = 42                  ' Ignored; it is a ByRef parameter\n    End Sub\nEnd Module\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1226.json",
    "content": "{\n  \"title\": \"Method parameters and caught exceptions should not be reassigned\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1226\",\n  \"sqKey\": \"S1226\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S126.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>This rule applies whenever an <code>If</code> statement is followed by one or more <code>ElseIf</code> statements; the final <code>ElseIf</code>\nshould be followed by an <code>Else</code> statement.</p>\n<p>The requirement for a final <code>Else</code> statement is defensive programming.</p>\n<p>The <code>Else</code> statement should either take appropriate action or contain a suitable comment as to why no action is taken. This is\nconsistent with the requirement to have a final <code>Case Else</code> clause in a <code>Select Case</code> statement.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nIf x = 0 Then\n    DoSomething()\nElseIf x = 1 Then\n    DoSomethingElse()\nEnd If\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nIf x = 0 Then\n    DoSomething()\nElseIf x = 1 Then\n    DoSomethingElse()\nElse\n    Throw New ArgumentException(\"...\")\nEnd If\n</pre>\n<h3>Exceptions</h3>\n<p>None</p>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S126.json",
    "content": "{\n  \"title\": \"\\\"If ... ElseIf\\\" constructs should end with \\\"Else\\\" clauses\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-126\",\n  \"sqKey\": \"S126\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1301.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><code>switch</code> statements are useful when there are many different cases depending on the value of the same expression.</p>\n<p>For just one or two cases, however, the code will be more readable with <code>if</code> statements.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nSelect Case variable\n    Case 0\n        doSomething()\n    Case Else\n        doSomethingElse()\nEnd Select\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nIf variable = 0 Then\n    doSomething()\nElse\n    doSomethingElse()\nEnd If\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1301.json",
    "content": "{\n  \"title\": \"\\\"Select\\\" statements should have at least 3 \\\"Case\\\" clauses\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"bad-practice\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1301\",\n  \"sqKey\": \"S1301\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S131.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The requirement for a final <code>Case Else</code> clause is defensive programming.</p>\n<p>This clause should either take appropriate action or contain a suitable comment as to why no action is taken.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nSelect Case param ' Noncompliant - Case Else clause is missing\n  Case 0\n    DoSomething()\n  Case 1\n    DoSomethingElse()\nEnd Select\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nSelect Case param\n  Case 0\n    DoSomething()\n  Case 1\n    DoSomethingElse()\n  Case Else ' Compliant\n    DoSomethingElse()\nEnd Select\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/478\">CWE-478 - Missing Default Case in Switch Statement</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S131.json",
    "content": "{\n  \"title\": \"\\\"Select\\\" statements should end with a \\\"Case Else\\\" clause\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-131\",\n  \"sqKey\": \"S131\",\n  \"scope\": \"All\",\n  \"securityStandards\": {\n    \"CWE\": [\n      478\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1313.html",
    "content": "<p>Hardcoding IP addresses is security-sensitive. It has led in the past to the following vulnerabilities:</p>\n<ul>\n  <li><a href=\"https://www.cve.org/CVERecord?id=CVE-2006-5901\">CVE-2006-5901</a></li>\n  <li><a href=\"https://www.cve.org/CVERecord?id=CVE-2005-3725\">CVE-2005-3725</a></li>\n</ul>\n<p>Today’s services have an ever-changing architecture due to their scaling and redundancy needs. It is a mistake to think that a service will always\nhave the same IP address. When it does change, the hardcoded IP will have to be modified too. This will have an impact on the product development,\ndelivery, and deployment:</p>\n<ul>\n  <li>The developers will have to do a rapid fix every time this happens, instead of having an operation team change a configuration file.</li>\n  <li>It misleads to use the same address in every environment (dev, sys, qa, prod).</li>\n</ul>\n<p>Last but not least it has an effect on application security. Attackers might be able to decompile the code and thereby discover a potentially\nsensitive address. They can perform a Denial of Service attack on the service, try to get access to the system, or try to spoof the IP address to\nbypass security checks. Such attacks can always be possible, but in the case of a hardcoded IP address solving the issue will take more time, which\nwill increase an attack’s impact.</p>\n<h2>Ask Yourself Whether</h2>\n<p>The disclosed IP address is sensitive, e.g.:</p>\n<ul>\n  <li>Can give information to an attacker about the network topology.</li>\n  <li>It’s a personal (assigned to an identifiable person) IP address.</li>\n</ul>\n<p>There is a risk if you answered yes to any of these questions.</p>\n<h2>Recommended Secure Coding Practices</h2>\n<p>Don’t hard-code the IP address in the source code, instead make it configurable with environment variables, configuration files, or a similar\napproach. Alternatively, if confidentially is not required a domain name can be used since it allows to change the destination quickly without having\nto rebuild the software.</p>\n<h2>Sensitive Code Example</h2>\n<pre>\nDim ip = \"192.168.12.42\" ' Sensitive\nDim address = IPAddress.Parse(ip)\n</pre>\n<h2>Compliant Solution</h2>\n<pre>\nDim ip = ConfigurationManager.AppSettings(\"myapplication.ip\") ' Compliant\nDim address = IPAddress.Parse(ip)\n</pre>\n<h2>Exceptions</h2>\n<p>No issue is reported for the following cases because they are not considered sensitive:</p>\n<ul>\n  <li>Loopback addresses 127.0.0.0/8 in CIDR notation (from 127.0.0.0 to 127.255.255.255)</li>\n  <li>Broadcast address 255.255.255.255</li>\n  <li>Non-routable address 0.0.0.0</li>\n  <li>Strings of the form <code>2.5.&lt;number&gt;.&lt;number&gt;</code> as they <a href=\"https://en.wikipedia.org/wiki/Object_identifier\">often match\n  Object Identifiers</a> (OID)</li>\n  <li>Addresses in the ranges 192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24, reserved for documentation purposes by <a\n  href=\"https://datatracker.ietf.org/doc/html/rfc5737\">RFC 5737</a></li>\n  <li>Addresses in the range 2001:db8::/32, reserved for documentation purposes by <a href=\"https://datatracker.ietf.org/doc/html/rfc3849\">RFC\n  3849</a></li>\n</ul>\n<h2>See</h2>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A01_2021-Broken_Access_Control/\">Top 10 2021 Category A1 - Broken Access Control</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure\">Top 10 2017 Category A3 - Sensitive Data\n  Exposure</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1313.json",
    "content": "{\n  \"title\": \"Using hardcoded IP addresses is security-sensitive\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"LOW\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1313\",\n  \"sqKey\": \"S1313\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"OWASP\": [\n      \"A3\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A1\"\n    ],\n    \"CWE\": [\n      547\n    ]\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S134.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Nested control flow statements <code>If</code>, <code>Select</code>, <code>For</code>, <code>For Each</code>, <code>While</code>, <code>Do</code>,\nand <code>Try</code> are often key ingredients in creating what’s known as \"Spaghetti code\". This code smell can make your program difficult to\nunderstand and maintain.</p>\n<p>When numerous control structures are placed inside one another, the code becomes a tangled, complex web. This significantly reduces the code’s\nreadability and maintainability, and it also complicates the testing process.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<p>The following example demonstrates the behavior of the rule with the default threshold of 3 levels of nesting:</p>\n<h4>Noncompliant code example</h4>\n<pre>\nIf condition1 ' Compliant - depth = 1\n  ' ...\n  If condition2 ' Compliant - depth = 2\n    ' ...\n    For i = 0 to 10 ' Compliant - depth = 3, not exceeding the limit\n      ' ...\n      If condition4 ' Noncompliant - depth = 4\n        If condition5 ' Depth = 5, exceeding the limit, but issues are only reported on depth = 4\n          ' ...\n        End If\n        Return\n      End If\n    Next\n  End If\nEnd If\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S134.json",
    "content": "{\n  \"title\": \"Control flow statements \\\"If\\\", \\\"For\\\", \\\"For Each\\\", \\\"Do\\\", \\\"While\\\", \\\"Select\\\" and \\\"Try\\\" should not be nested too deeply\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"FOCUSED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"brain-overload\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-134\",\n  \"sqKey\": \"S134\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S138.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>A procedure that grows too large tends to aggregate too many responsibilities.</p>\n<p>Such procedures inevitably become harder to understand and therefore harder to maintain.</p>\n<p>Above a specific threshold, it is strongly advised to refactor into smaller procedures which focus on well-defined tasks.</p>\n<p>Those smaller procedures will not only be easier to understand but also probably easier to test.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S138.json",
    "content": "{\n  \"title\": \"Procedures should not have too many lines of code\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"FOCUSED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"brain-overload\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-138\",\n  \"sqKey\": \"S138\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S139.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>This rule verifies that single-line comments are not located at the ends of lines of code. The main idea behind this rule is that in order to be\nreally readable, trailing comments would have to be properly written and formatted (correct alignment, no interference with the visual structure of\nthe code, not too long to be visible) but most often, automatic code formatters would not handle this correctly: the code would end up less readable.\nComments are far better placed on the previous empty line of code, where they will always be visible and properly formatted.</p>\n<h3>Noncompliant code example</h3>\n<p>With the default comment pattern <code>^'\\s*\\S+\\s*$</code>, which ignores single word comments:</p>\n<pre>\nModule Module1\n  Sub Main()\n    Console.WriteLine(\"Hello, world!\") ' Noncompliant - My first program!\n    Console.WriteLine(\"Hello, world!\") ' CompliantOneWord\n  End Sub\nEnd Module\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nModule Module1\n  Sub Main()\n    ' Compliant - My first program!\n    Console.WriteLine(\"Hello, world!\")\n    Console.WriteLine(\"Hello, world!\") ' CompliantOneWord\n  End Sub\nEnd Module\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S139.json",
    "content": "{\n  \"title\": \"Comments should not be located at the end of lines of code\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"FORMATTED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-139\",\n  \"sqKey\": \"S139\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1451.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Each source file should start with a header stating file ownership and the license which must be used to distribute the application.</p>\n<p>This rule must be fed with the header text that is expected at the beginning of every file.</p>\n<p>The <code>headerFormat</code> must end with an empty line if you want to have an empty line between the file header and the first line for your\nsource file (<code>using</code>, <code>namespace</code>…​).</p>\n<p>For example, if you want the source file to look like this</p>\n<pre>\n' Copyright (c) SonarSource. All Rights Reserved. Licensed under the LGPL License.  See License.txt in the project root for license information.\n\nnamespace Foo\n{\n}\n</pre>\n<p>then the <code>headerFormat</code> parameter should end with an empty line like this</p>\n<pre>\n' Copyright (c) SonarSource. All Rights Reserved. Licensed under the LGPL License.  See License.txt in the project root for license information.\n</pre>\n<h3>Compliant solution</h3>\n<pre>\n/*\n * SonarQube, open source software quality management tool.\n * Copyright (C) 2008-2013 SonarSource\n * mailto:contact AT sonarsource DOT com\n *\n * SonarQube is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 3 of the License, or (at your option) any later version.\n *\n * SonarQube is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this program; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\n */\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1451.json",
    "content": "{\n  \"title\": \"Track lack of copyright and license headers\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"LAWFUL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-1451\",\n  \"sqKey\": \"S1451\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1479.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When <a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/select-case-statement\">Select Case</a> statements\nhave large sets of multi-line <code>Case</code> clauses, the code becomes hard to read and maintain.</p>\n<p>For example, the <a href=\"https://www.sonarsource.com/docs/CognitiveComplexity.pdf\">Cognitive Complexity</a> is going to be particularly high.</p>\n<p>In such scenarios, it’s better to refactor the <code>Select Case</code> to only have single-line case clauses.</p>\n<p>When all the <code>Case</code> clauses of a <code>Select Case</code> statement are single-line, the readability of the code is not affected.</p>\n<h3>Exceptions</h3>\n<p>This rule ignores:</p>\n<ul>\n  <li><code>Select Case</code> statements over <code>Enum</code> arguments</li>\n  <li>fall-through cases</li>\n  <li><code>Return</code> and <code>Throw</code> statements in <code>Case</code> clauses</li>\n</ul>\n<h2>How to fix it</h2>\n<p>Extract the logic of multi-line <code>Case</code> clauses into separate methods.</p>\n<h3>Code examples</h3>\n<p>The examples below use the \"Maximum number of case\" property set to <code>4</code>.</p>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nPublic Function MapChar(ch As Char, value As Integer) As Integer ' Noncompliant\n    Select Case ch\n        Case \"a\"c\n            Return 1\n        Case \"b\"c\n            Return 2\n        Case \"c\"c\n            Return 3\n        ' ...\n        Case \"-\"c\n            If value &gt; 10 Then\n                Return 42\n            ElseIf value &lt; 5 AndAlso value &gt; 1 Then\n                Return 21\n            End If\n            Return 99\n        Case Else\n            Return 1000\n    End Select\nEnd Function\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nPublic Function MapChar(ch As Char, value As Integer) As Integer\n    Select Case ch\n        Case \"a\"c\n            Return 1\n        Case \"b\"c\n            Return 2\n        Case \"c\"c\n            Return 3\n        ' ...\n        Case \"-\"c\n            Return HandleDash(value)\n        Case Else\n            Return 1000\n    End Select\nEnd Function\n\nPrivate Function HandleDash(value As Integer) As Integer\n    If value &gt; 10 Then\n        Return 42\n    ElseIf value &lt; 5 AndAlso value &gt; 1 Then\n        Return 21\n    End If\n    Return 99\nEnd Function\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Sonar - <a href=\"https://www.sonarsource.com/docs/CognitiveComplexity.pdf\">Cognitive Complexity</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/select-case-statement\">Select…​Case Statement</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1479.json",
    "content": "{\n  \"title\": \"\\\"Select Case\\\" statement with many \\\"Case\\\" clauses should have only one statement\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"FOCUSED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"tags\": [\n    \"brain-overload\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1479\",\n  \"sqKey\": \"S1479\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1481.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>An unused local variable is a variable that has been declared but is not used anywhere in the block of code where it is defined. It is dead code,\ncontributing to unnecessary complexity and leading to confusion when reading the code. Therefore, it should be removed from your code to maintain\nclarity and efficiency.</p>\n<h3>What is the potential impact?</h3>\n<p>Having unused local variables in your code can lead to several issues:</p>\n<ul>\n  <li><strong>Decreased Readability</strong>: Unused variables can make your code more difficult to read. They add extra lines and complexity, which\n  can distract from the main logic of the code.</li>\n  <li><strong>Misunderstanding</strong>: When other developers read your code, they may wonder why a variable is declared but not used. This can lead\n  to confusion and misinterpretation of the code’s intent.</li>\n  <li><strong>Potential for Bugs</strong>: If a variable is declared but not used, it might indicate a bug or incomplete code. For example, if you\n  declared a variable intending to use it in a calculation, but then forgot to do so, your program might not work as expected.</li>\n  <li><strong>Maintenance Issues</strong>: Unused variables can make code maintenance more difficult. If a programmer sees an unused variable, they\n  might think it is a mistake and try to 'fix' the code, potentially introducing new bugs.</li>\n  <li><strong>Memory Usage</strong>: Although modern compilers are smart enough to ignore unused variables, not all compilers do this. In such cases,\n  unused variables take up memory space, leading to inefficient use of resources.</li>\n</ul>\n<p>In summary, unused local variables can make your code less readable, more confusing, and harder to maintain, and they can potentially lead to bugs\nor inefficient memory use. Therefore, it is best to remove them.</p>\n<h3>Exceptions</h3>\n<p>Unused locally created resources in a <code>Using</code> statement are not reported.</p>\n<pre>\nUsing t = New TestTimer()\nEnd Using\n</pre>\n<h2>How to fix it</h2>\n<p>The fix for this issue is straightforward. Once you ensure the unused variable is not part of an incomplete implementation leading to bugs, you\njust need to remove it.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nPublic Function NumberOfMinutes(ByVal hours As Integer) As Integer\n    Dim seconds As Integer = 0 ' Noncompliant - seconds is unused\n    Return hours * 60\nEnd Function\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nPublic Function NumberOfMinutes(ByVal hours As Integer) As Integer\n    Return hours * 60\nEnd Function\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1481.json",
    "content": "{\n  \"title\": \"Unused local variables should be removed\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"unused\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1481\",\n  \"sqKey\": \"S1481\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1541.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The cyclomatic complexity of a function, procedure or property should not exceed a defined threshold. Complex code can perform poorly and will in\nany case be difficult to understand and therefore to maintain.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1541.json",
    "content": "{\n  \"title\": \"Functions, procedures and properties should not be too complex\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"FOCUSED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"brain-overload\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-1541\",\n  \"sqKey\": \"S1541\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1542.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Shared naming conventions allow teams to collaborate efficiently. This rule checks that all subroutine and function names match a provided regular\nexpression.</p>\n<p>The default configuration is the one recommended by Microsoft:</p>\n<ul>\n  <li>Pascal casing, starting with an upper case character, e.g. BackColor</li>\n  <li>Short abbreviations of 2 letters can be capitalized, e.g. GetID</li>\n  <li>Longer abbreviations need to be lower cased, e.g. GetHtml</li>\n  <li>Event handlers with a handles clause and two-parameter methods with <code>EventArgs</code> second parameter are not covered by this rule.</li>\n</ul>\n<h3>Noncompliant code example</h3>\n<p>With the default regular expression <code>^([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?$</code></p>\n<pre>\nModule Module1\n  Sub bad_subroutine()                      ' Noncompliant\n  End Sub\n\n  Public Function Bad_Function() As Integer ' Noncompliant\n    Return 42\n  End Function\nEnd Module\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nModule Module1\n  Sub GoodSubroutine()                      ' Compliant\n  End Sub\n\n  Public Function GoodFunction() As Integer ' Compliant\n    Return 42\n  End Function\nEnd Module\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1542.json",
    "content": "{\n  \"title\": \"Functions and procedures should comply with a naming convention\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1542\",\n  \"sqKey\": \"S1542\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1643.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><code>StringBuilder</code> is more efficient than string concatenation, especially when the operator is repeated over and over as in loops.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nModule Module1\n    Sub Main()\n        Dim foo = \"\"\n        foo &amp;= \"Result: \"       ' Compliant - outside of loop\n\n        For i = 1 To 9\n            foo &amp;= i            ' Noncompliant\n        Next\n    End Sub\nEnd Module\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nModule Module1\n    Sub Main()\n        Dim foo = New System.Text.StringBuilder\n        foo.Append(\"Result: \")  ' Compliant\n\n        For i = 1 To 9\n            foo.Append(i)       ' Compliant\n        Next\n    End Sub\nEnd Module\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1643.json",
    "content": "{\n  \"title\": \"Strings should not be concatenated using \\\"+\\\" or \\\"\\u0026\\\" in a loop\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1643\",\n  \"sqKey\": \"S1643\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1645.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Consistently using the <code>&amp;</code> operator for string concatenation make the developer intentions clear.</p>\n<p><code>&amp;</code>, unlike <code>+</code>, will convert its operands to strings and perform an actual concatenation.</p>\n<p><code>+</code> on the other hand can be an addition, or a concatenation, depending on the operand types.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nModule Module1\n    Sub Main()\n        Console.WriteLine(\"1\" + 2) ' Noncompliant - will display \"3\"\n    End Sub\nEnd Module\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nModule Module1\n    Sub Main()\n        Console.WriteLine(1 &amp; 2)   ' Compliant - will display \"12\"\n        Console.WriteLine(1 + 2)   ' Compliant - but will display \"3\"\n        Console.WriteLine(\"1\" &amp; 2) ' Compliant - will display \"12\"\n    End Sub\nEnd Module\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1645.json",
    "content": "{\n  \"title\": \"The \\\"\\u0026\\\" operator should be used to concatenate strings\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-1645\",\n  \"sqKey\": \"S1645\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1654.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Sharing some naming conventions is a key point to make it possible for a team to efficiently collaborate.</p>\n<p>This rule allows to check that all parameter names match a provided regular expression.</p>\n<p>The default configuration is the one recommended by Microsoft:</p>\n<ul>\n  <li>Camel casing, starting with a lower case character, e.g. backColor</li>\n  <li>Short abbreviations of 2 letters can be capitalized only when not at the beginning, e.g. id, productID</li>\n  <li>Longer abbreviations need to be lower cased, e.g. html</li>\n</ul>\n<h3>Noncompliant code example</h3>\n<p>With the default regular expression <code>^[a-z][a-z0-9]*([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?$</code></p>\n<pre>\nModule Module1\n    Sub GetSomething(ByVal ID As Integer) ' Noncompliant\n    End Sub\nEnd Module\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nModule Module1\n    Sub GetSomething(ByVal id As Integer) ' Compliant\n    End Sub\nEnd Module\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1654.json",
    "content": "{\n  \"title\": \"Method parameters should follow a naming convention\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1654\",\n  \"sqKey\": \"S1654\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1656.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>There is no reason to re-assign a variable to itself. Either this statement is redundant and should be removed, or the re-assignment is a mistake\nand some other value or variable was intended for the assignment instead.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nPublic Sub SetName(name As String)\n  name = name ' Noncompliant\nEnd Sub\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nPublic Sub SetName(name As String)\n  Me.name = name ' Compliant\nEnd Sub\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1656.json",
    "content": "{\n  \"title\": \"Variables should not be self-assigned\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"3min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1656\",\n  \"sqKey\": \"S1656\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1659.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Declaring multiple variable on one line is difficult to read.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nModule Module1\n  Public Const AAA As Integer = 5, BBB = 42, CCC As String = \"foo\"  ' Noncompliant\nEnd Module\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nModule Module1\n  Public Const AAA As Integer = 5\n  Public Const BBB = 42\n  Public Const CCC as String = \"foo\"\nEnd Module\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1659.json",
    "content": "{\n  \"title\": \"Multiple variables should not be declared on the same line\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"FORMATTED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1659\",\n  \"sqKey\": \"S1659\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1751.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>A <a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/control-flow/loop-structures\">loop</a>\nstatement with at most one iteration is equivalent to an <code>If</code> statement; the following block is executed only once.</p>\n<p>If the initial intention was to conditionally execute the block only once, an <code>If</code> statement should be used instead. If that was not the\ninitial intention, the block of the loop should be fixed so the block is executed multiple times.</p>\n<p>A loop statement with at most one iteration can happen when a statement unconditionally transfers control, such as a jump statement or a throw\nstatement, is misplaced inside the loop block.</p>\n<p>This rule raises when the following statements are misplaced:</p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/exit-statement\"><code>Exit</code></a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/continue-statement\"><code>Continue</code></a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/return-statement\"><code>Return</code></a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/throw-statement\"><code>Throw</code></a></li>\n</ul>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nPublic Function Method(items As IEnumerable(Of Object)) As Object\n    For i As Integer = 0 To 9\n        Console.WriteLine(i)\n        Exit For ' Noncompliant: loop only executes once\n    Next\n\n    For Each item As Object In items\n        Return item ' Noncompliant: loop only executes once\n    Next\n    Return Nothing\nEnd Function\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nPublic Function Method(items As IEnumerable(Of Object)) As Object\n    For i As Integer = 0 To 9\n        Console.WriteLine(i)\n    Next\n\n    Dim item = items.FirstOrDefault()\n    If item IsNot Nothing Then\n        Return item\n    End If\n    Return Nothing\nEnd Function\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/control-flow/loop-structures\">Loop Structures\n  (Visual Basic)</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/exit-statement\"><code>Exit</code>\n  Statement (Visual Basic)</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/continue-statement\"><code>Continue</code> Statement\n  (Visual Basic)</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/return-statement\"><code>Return</code> Statement (Visual\n  Basic)</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/throw-statement\"><code>Throw</code> Statement (Visual\n  Basic)</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/throw-statement\">Throw Statement\n  (Visual Basic)</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1751.json",
    "content": "{\n  \"title\": \"Loops with at most one iteration should be refactored\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"confusing\",\n    \"bad-practice\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1751\",\n  \"sqKey\": \"S1751\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1764.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Using the same value on either side of a binary operator is almost always a mistake. In the case of logical operators, it is either a copy/paste\nerror and therefore a bug, or it is simply wasted code, and should be simplified. In the case of most binary mathematical operators, having the same\nvalue on both sides of an operator yields predictable results, and should be simplified.</p>\n<p>This rule ignores <code>*</code>, <code>+</code>, <code>&amp;</code>, <code>&lt;&lt;</code>, and <code>&gt;&gt;</code>.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nIf (a = a) Then\n  doZ()\nEnd If\n\nIf a = b OrElse a = b Then\n  doW()\nEnd If\n\nDim j = 5 / 5\nj = 5 \\ 5\nj = 5 Mod 5\nDim k = 5 - 5\n\nDim i = 42\ni /= i\ni -= i\n</pre>\n<h3>Exceptions</h3>\n<p>This rule ignores <code>*</code>, <code>+</code>, and <code>=</code>.</p>\n<h2>Resources</h2>\n<ul>\n  <li>{rule:vbnet:S1656} - Implements a check on <code>=</code>.</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1764.json",
    "content": "{\n  \"title\": \"Identical expressions should not be used on both sides of a binary operator\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1764\",\n  \"sqKey\": \"S1764\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1821.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Nested <code>Select Case</code> structures are difficult to understand because you can easily confuse the cases of an inner <code>Select\nCase</code> as belonging to an outer statement. Therefore nested <code>Select Case</code> statements should be avoided.</p>\n<p>Specifically, you should structure your code to avoid the need for nested <code>Select Case</code> statements, but if you cannot, then consider\nmoving the inner <code>Select Case</code> to another function.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nPublic Sub Foo(A As Integer, B As Integer)\n    Select Case A\n        Case 0\n            ' ...\n        Case 1\n            Select Case B   ' Noncompliant; nested Select Case\n                Case 2\n                    ' ...\n                Case 3\n                    ' ...\n                Case 4\n                    ' ...\n                Case Else\n                    ' ...\n            End Select\n        Case 2\n            ' ...\n        Case Else\n            ' ...\n    End Select\nEnd Sub\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nPublic Sub Foo(A As Integer, B As Integer)\n    Select Case A\n        Case 0\n            ' ...\n        Case 1\n            HandleB(B)\n        Case 2\n            ' ...\n        Case Else\n            ' ...\n    End Select\nEnd Sub\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1821.json",
    "content": "{\n  \"title\": \"\\\"Select Case\\\" statements should not be nested\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"FOCUSED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-1821\",\n  \"sqKey\": \"S1821\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1862.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>A chain of <a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/if-then-else-statement\">If/ElseIf</a>\nstatements is evaluated from top to bottom. At most, only one branch will be executed: the first statement with a condition that evaluates to\n<code>True</code>. Therefore, duplicating a condition leads to unreachable code inside the duplicated condition block. Usually, this is due to a\ncopy/paste error.</p>\n<p>The result of such duplication can lead to unreachable code or even to unexpected behavior.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nIf param = 1 Then\n  OpenWindow()\nElseIf param = 2 Then\n  CloseWindow()\nElseIf param = 1 Then ' Noncompliant: condition has already been checked\n  MoveWindowToTheBackground() ' unreachable code\nEnd If\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nIf param = 1 Then\n  OpenWindow()\nElseIf param = 2 Then\n  CloseWindow()\nElseIf param = 3 Then\n  MoveWindowToTheBackground()\nEnd If\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/if-then-else-statement\">If…​Then…​Else\n  Statement</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1862.json",
    "content": "{\n  \"title\": \"Related \\\"If\\/ElseIf\\\" statements should not have the same condition\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"unused\",\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1862\",\n  \"sqKey\": \"S1862\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1871.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When the same code is duplicated in two or more separate branches of a conditional, it can make the code harder to understand, maintain, and can\npotentially introduce bugs if one instance of the code is changed but others are not.</p>\n<p>Having two <code>Cases</code> in the same <code>Select</code> statement or branches in the same <code>If</code> structure with the same\nimplementation is at best duplicate code, and at worst a coding error.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nIf a &gt;= 0 AndAlso a &lt; 10 Then\n  DoFirst()\n  DoTheThing()\nElseIf a &gt;= 10 AndAlso a &lt; 20 Then\n  DoTheOtherThing()\nElseIf a &gt;= 20 AndAlso a &lt; 50   ' Noncompliant; duplicates first condition\n  DoFirst()\n  DoTheThing()\nElse\n  DoTheRest();\nEnd If\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nSelect i\n  Case 1\n    DoFirst()\n    DoSomething()\n  Case 2\n    DoSomethingDifferent()\n  Case 3  ' Noncompliant; duplicates case 1's implementation\n    DoFirst()\n    DoSomething()\n  Case Else:\n    DoTheRest()\nEnd Select\n</pre>\n<p>If the same logic is needed for both instances, then:</p>\n<ul>\n  <li>in an <code>If</code> structure they should be combined</li>\n</ul>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nIf (a &gt;= 0 AndAlso a &lt; 10) OrElse (a &gt;= 20 AndAlso a &lt; 50) Then\n  DoFirst()\n  DoTheThing()\nElseIf a &gt;= 10 AndAlso a &lt; 20 Then\n  DoTheOtherThing()\nElse\n  DoTheRest();\nEnd If\n</pre>\n<ul>\n  <li>for a <code>Select</code>, the values should be put in the <code>Case</code> expression list.</li>\n</ul>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nSelect i\n  Case 1, 3\n    DoFirst()\n    DoSomething()\n  Case 2\n    DoSomethingDifferent()\n  Case Else:\n    DoTheRest()\nEnd Select\n</pre>\n<h3>Exceptions</h3>\n<p>Blocks in an <code>If</code> chain or <code>Case</code> clause that contain a single line of code are ignored.</p>\n<pre>\nIf a &gt;= 0 AndAlso a &lt; 10 Then\n  DoTheThing()\nElseIf a &gt;= 10 AndAlso a &lt; 20 Then\n  DoTheOtherThing()\nElseIf a &gt;= 20 AndAlso a &lt; 50   ' no issue, usually this is done on purpose to increase the readability\n  DoTheThing()\nEnd If\n</pre>\n<p>But this exception does not apply to <code>If</code> chains without <code>Else</code>-s, or to <code>Select</code>-s without <code>Case Else</code>\nclauses when all branches have the same single line of code. In the case of <code>If</code> chains with <code>Else</code>-s, or of\n<code>Select</code>-es with <code>Case Else</code> clauses, rule {rule:vbnet:S3923} raises a bug.</p>\n<pre>\nIf a == 1 Then\n  DoTheThing() ' Noncompliant, this might have been done on purpose but probably not\nElseIf a == 2 Then\n  DoTheThing()\nEnd If\n</pre>\n<h2>Resources</h2>\n<h3>Related rules</h3>\n<ul>\n  <li>{rule:vbnet:S3923} - All branches in a conditional structure should not have exactly the same implementation</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1871.json",
    "content": "{\n  \"title\": \"Two branches in a conditional structure should not have exactly the same implementation\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"DISTINCT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"design\",\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1871\",\n  \"sqKey\": \"S1871\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1940.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>It is needlessly complex to invert the result of a boolean comparison. The opposite comparison should be made instead.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nIf Not (a = 2) Then  // Noncompliant\nDim b as Boolean = Not (i &lt; 10)  // Noncompliant\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nIf a &lt;&gt; 2 Then\nDim b as Boolean = i &gt;= 10\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1940.json",
    "content": "{\n  \"title\": \"Boolean checks should not be inverted\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-1940\",\n  \"sqKey\": \"S1940\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1944.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>A cast is an <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/data-types/implicit-and-explicit-conversions\">explicit\nconversion</a>, which is a way to tell the compiler the intent to convert from one type to another.</p>\n<p>In Visual Basic, there are two explicit conversion operators:</p>\n<pre>\nPublic Sub Method(Value As Object)\n    Dim i As Integer\n    i = DirectCast(Value, Integer)  ' Direct casting from object holding an integer type to Integer\n    i = CType(Value, Integer)       ' Conversion from the underlying type to Integer\nEnd Sub\n</pre>\n<p>In most cases, the compiler will be able to catch invalid casts between incompatible value types or reference types.</p>\n<p>However, the compiler will not be able to detect invalid casts to <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/interfaces/\">interfaces</a>.</p>\n<h3>What is the potential impact?</h3>\n<p>Invalid casts will lead to unexpected behaviors or runtime errors such as <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.invalidcastexception\">InvalidCastException</a>.</p>\n<h3>Exceptions</h3>\n<p>No issue is reported if the interface has no implementing class in the assembly.</p>\n<h2>How to fix it</h2>\n<p>To prevent an <code>InvalidCastException</code> from raising during an explicit conversion, it is recommended to use the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/operators/trycast-operator\"><code>TryCast</code> operator</a>. When the\nconversion is not possible, the <code>TryCast</code> operator returns <code>Nothing</code> and will never raise an exception.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nPublic Interface IMyInterface\nEnd Interface\n\nPublic Class Implementer\n    Implements IMyInterface\nEnd Class\n\nPublic Class AnotherClass\nEnd Class\n\nModule Program\n    Sub Main()\n        Dim Another As New AnotherClass\n        Dim x As IMyInterface = DirectCast(Another, IMyInterface)   ' Noncompliant: InvalidCastException is being thrown\n    End Sub\nEnd Module\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nPublic Interface IMyInterface\nEnd Interface\n\nPublic Class Implementer\n    Implements IMyInterface\nEnd Class\n\nPublic Class AnotherClass\nEnd Class\n\nModule Program\n    Sub Main()\n        Dim Another As New AnotherClass\n        Dim x = TryCast(Another, IMyInterface)                      ' Compliant: but will always be Nothing\n    End Sub\nEnd Module\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/data-types/type-conversions\">Type Conversions\n  in Visual Basic</a>\n    <ul>\n      <li><a\n      href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/data-types/implicit-and-explicit-conversions\">Implicit and Explicit Conversions in Visual Basic</a></li>\n      <li><a\n      href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/data-types/how-to-convert-an-object-to-another-type\">How to: Convert an Object to Another Type in Visual Basic</a></li>\n    </ul></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/operators/directcast-operator\"><code>DirectCast</code>\n  operator</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/functions/ctype-function\"><code>CType</code> function</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/operators/trycast-operator\"><code>TryCast</code>\n  operator</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/588\">CWE-588 - Attempt to Access Child of a Non-structure Pointer</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/704\">CWE-704 - Incorrect Type Conversion or Cast</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S1944.json",
    "content": "{\n  \"title\": \"Invalid casts should be avoided\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-1944\",\n  \"sqKey\": \"S1944\",\n  \"scope\": \"All\",\n  \"securityStandards\": {\n    \"CWE\": [\n      588,\n      704\n    ]\n  },\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2053.html",
    "content": "<p>This vulnerability increases the likelihood that attackers are able to compute the cleartext of password hashes.</p>\n<h2>Why is this an issue?</h2>\n<p>During the process of password hashing, an additional component, known as a \"salt,\" is often integrated to bolster the overall security. This salt,\nacting as a defensive measure, primarily wards off certain types of attacks that leverage pre-computed tables to crack passwords.</p>\n<p>However, potential risks emerge when the salt is deemed insecure. This can occur when the salt is consistently the same across all users or when it\nis too short or predictable. In scenarios where users share the same password and salt, their password hashes will inevitably mirror each other.\nSimilarly, a short salt heightens the probability of multiple users unintentionally having identical salts, which can potentially lead to identical\npassword hashes. These identical hashes streamline the process for potential attackers to recover clear-text passwords. Thus, the emphasis on\nimplementing secure, unique, and sufficiently lengthy salts in password-hashing functions is vital.</p>\n<h3>What is the potential impact?</h3>\n<p>Despite best efforts, even well-guarded systems might have vulnerabilities that could allow an attacker to gain access to the hashed passwords.\nThis could be due to software vulnerabilities, insider threats, or even successful phishing attempts that give attackers the access they need.</p>\n<p>Once the attacker has these hashes, they will likely attempt to crack them using a couple of methods. One is brute force, which entails trying\nevery possible combination until the correct password is found. While this can be time-consuming, having the same salt for all users or a short salt\ncan make the task significantly easier and faster.</p>\n<p>If multiple users have the same password and the same salt, their password hashes would be identical. This means that if an attacker successfully\ncracks one hash, they have effectively cracked all identical ones, granting them access to multiple accounts at once.</p>\n<p>A short salt, while less critical than a shared one, still increases the odds of different users having the same salt. This might create clusters\nof password hashes with identical salt that can then be attacked as explained before.</p>\n<p>With short salts, the probability of a collision between two users' passwords and salts couple might be low depending on the salt size. The shorter\nthe salt, the higher the collision probability. In any case, using longer, cryptographically secure salt should be preferred.</p>\n<h3>Exceptions</h3>\n<p>To securely store password hashes, it is a recommended to rely on key derivation functions that are computationally intensive. Examples of such\nfunctions are:</p>\n<ul>\n  <li>Argon2</li>\n  <li>PBKDF2</li>\n  <li>Scrypt</li>\n  <li>Bcrypt</li>\n</ul>\n<p>When they are used for password storage, using a secure, random salt is required.</p>\n<p>However, those functions can also be used for other purposes such as master key derivation or password-based pre-shared key generation. In those\ncases, the implemented cryptographic protocol might require using a fixed salt to derive keys in a deterministic way. In such cases, using a fixed\nsalt is safe and accepted.</p>\n<h2>How to fix it in .NET</h2>\n<h3>Code examples</h3>\n<p>The following code contains examples of hard-coded salts.</p>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nImports System.Security.Cryptography\n\nPublic Sub Hash(Password As String)\n    Dim Salt As Byte() = Encoding.UTF8.GetBytes(\"salty\")\n    Dim Hashed As New Rfc2898DeriveBytes(Password, Salt) ' Noncompliant\nEnd Sub\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nImports System.Security.Cryptography\n\nPublic Sub Hash(Password As String)\n    Dim Hashed As New Rfc2898DeriveBytes(Password, 16, 10000, HashAlgorithmName.SHA256)\nEnd Sub\n</pre>\n<h3>How does this work?</h3>\n<p>This code ensures that each user’s password has a unique salt value associated with it. It generates a salt randomly and with a length that\nprovides the required security level. It uses a salt length of at least 16 bytes (128 bits), as recommended by industry standards.</p>\n<p>In the case of the code sample, the class automatically takes care of generating a secure salt if none is specified.</p>\n<h2>Resources</h2>\n<h3>Standards</h3>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A02_2021-Cryptographic_Failures/\">Top 10 2021 Category A2 - Cryptographic Failures</a></li>\n  <li>OWASP - <a href=\"https://www.owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure\">Top 10 2017 Category A3 - Sensitive Data\n  Exposure</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/759\">CWE-759 - Use of a One-Way Hash without a Salt</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/760\">CWE-760 - Use of a One-Way Hash with a Predictable Salt</a></li>\n  <li>STIG Viewer - <a href=\"https://stigviewer.com/stigs/application_security_and_development/2024-12-06/finding/V-222542\">Application Security and\n  Development: V-222542</a> - The application must only store cryptographic representations of passwords.</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2053.json",
    "content": "{\n  \"title\": \"Password hashing functions should use an unpredictable salt\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"HIGH\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"symbolic-execution\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-2053\",\n  \"sqKey\": \"S2053\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      759,\n      760\n    ],\n    \"OWASP\": [\n      \"A3\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A2\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"6.5.10\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"6.2.4\"\n    ],\n    \"STIG ASD_V5R3\": [\n      \"V-222542\"\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2068.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Hard-coding credentials in source code or binaries makes it easy for attackers to extract sensitive information, especially in distributed or\nopen-source applications. This practice exposes your application to significant security risks.</p>\n<p>This rule flags instances of hard-coded credentials used in database and LDAP connections. It looks for hard-coded credentials in connection\nstrings, and for variable names that match any of the patterns from the provided list.</p>\n<p>In the past, it has led to the following vulnerabilities:</p>\n<ul>\n  <li><a href=\"https://www.cve.org/CVERecord?id=CVE-2019-13466\">CVE-2019-13466</a></li>\n  <li><a href=\"https://www.cve.org/CVERecord?id=CVE-2018-15389\">CVE-2018-15389</a></li>\n</ul>\n<h2>How to fix it</h2>\n<p>Credentials should be stored in a configuration file that is not committed to the code repository, in a database, or managed by your cloud\nprovider’s secrets management service. If a password is exposed in the source code, it must be changed immediately.</p>\n<h3>Code Examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nDim username As String = \"admin\"\nDim password As String = \"Password123\" ' Noncompliant\nDim usernamePassword As String = \"user=admin&amp;password=Password123\" ' Noncompliant\nDim url As String = \"scheme://user:Admin123@domain.com\" ' Noncompliant\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nDim username As String = \"admin\"\nDim password As String = GetEncryptedPassword()\nDim usernamePassword As String = String.Format(\"user={0}&amp;password={1}\", GetEncryptedUsername(), GetEncryptedPassword())\nDim url As String = $\"scheme://{username}:{password}@domain.com\"\n\nDim url2 As String= \"http://guest:guest@domain.com\" ' Compliant\nConst Password_Property As String = \"custom.password\" ' Compliant\n</pre>\n<h2>Exceptions</h2>\n<ul>\n  <li>Issue is not raised when URI username and password are the same.</li>\n  <li>Issue is not raised when searched pattern is found in variable name and value.</li>\n</ul>\n<h2>Resources</h2>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures/\">Top 10 2021 Category A7 - Identification and\n  Authentication Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A2_2017-Broken_Authentication\">Top 10 2017 Category A2 - Broken\n  Authentication</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/798\">CWE-798 - Use of Hard-coded Credentials</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/259\">CWE-259 - Use of Hard-coded Password</a></li>\n  <li>Derived from FindSecBugs rule <a href=\"https://h3xstream.github.io/find-sec-bugs/bugs.htm#HARD_CODE_PASSWORD\">Hard Coded Password</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2068.json",
    "content": "{\n  \"title\": \"Credentials should not be hard-coded\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"quickfix\": \"infeasible\",\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2068\",\n  \"sqKey\": \"S2068\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      798,\n      259\n    ],\n    \"OWASP\": [\n      \"A2\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A7\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"6.5.10\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"6.2.4\"\n    ],\n    \"ASVS 4.0\": [\n      \"2.10.4\",\n      \"3.5.2\",\n      \"6.4.1\"\n    ]\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2077.html",
    "content": "<p>Formatted SQL queries can be difficult to maintain, debug and can increase the risk of SQL injection when concatenating untrusted values into the\nquery. However, this rule doesn’t detect SQL injections, the goal is only to highlight complex/formatted queries.</p>\n<h2>Ask Yourself Whether</h2>\n<ul>\n  <li>Some parts of the query come from untrusted values (like user inputs).</li>\n  <li>The query is repeated/duplicated in other parts of the code.</li>\n  <li>The application must support different types of relational databases.</li>\n</ul>\n<p>There is a risk if you answered yes to any of those questions.</p>\n<h2>Recommended Secure Coding Practices</h2>\n<ul>\n  <li>Use <a href=\"https://cheatsheetseries.owasp.org/cheatsheets/Query_Parameterization_Cheat_Sheet.html\">parameterized queries, prepared statements,\n  or stored procedures</a> and bind variables to SQL query parameters.</li>\n  <li>Consider using ORM frameworks if there is a need to have an abstract layer to access data.</li>\n</ul>\n<h2>Sensitive Code Example</h2>\n<pre>\nPublic Sub SqlCommands(ByVal connection As SqlConnection, ByVal query As String, ByVal param As String)\n    Dim sensitiveQuery As String = String.Concat(query, param)\n    command = New SqlCommand(sensitiveQuery) ' Sensitive\n\n    command.CommandText = sensitiveQuery ' Sensitive\n\n    Dim adapter As SqlDataAdapter\n    adapter = New SqlDataAdapter(sensitiveQuery, connection) ' Sensitive\nEnd Sub\n\nPublic Sub Foo(ByVal context As DbContext, ByVal query As String, ByVal param As String)\n    Dim sensitiveQuery As String = String.Concat(query, param)\n    context.Database.ExecuteSqlCommand(sensitiveQuery) ' Sensitive\n\n    context.Query(Of User)().FromSql(sensitiveQuery) ' Sensitive\nEnd Sub\n</pre>\n<h2>Compliant Solution</h2>\n<pre>\nPublic Sub Foo(ByVal context As DbContext, ByVal value As String)\n    context.Database.ExecuteSqlCommand(\"SELECT * FROM mytable WHERE mycol=@p0\", value) ' Compliant, the query is parameterized\nEnd Sub\n</pre>\n<h2>See</h2>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A03_2021-Injection/\">Top 10 2021 Category A3 - Injection</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A1_2017-Injection\">Top 10 2017 Category A1 - Injection</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/20\">CWE-20 - Improper Input Validation</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/89\">CWE-89 - Improper Neutralization of Special Elements used in an SQL Command</a></li>\n  <li>Derived from FindSecBugs rules <a href=\"https://h3xstream.github.io/find-sec-bugs/bugs.htm#SQL_INJECTION_JPA\">Potential SQL/JPQL Injection\n  (JPA)</a>, <a href=\"https://h3xstream.github.io/find-sec-bugs/bugs.htm#SQL_INJECTION_JDO\">Potential SQL/JDOQL Injection (JDO)</a>, <a\n  href=\"https://h3xstream.github.io/find-sec-bugs/bugs.htm#SQL_INJECTION_HIBERNATE\">Potential SQL/HQL Injection (Hibernate)</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2077.json",
    "content": "{\n  \"title\": \"Formatting SQL queries is security-sensitive\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\",\n      \"SECURITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"bad-practice\",\n    \"sql\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2077\",\n  \"sqKey\": \"S2077\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      20,\n      89\n    ],\n    \"OWASP\": [\n      \"A1\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A3\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"6.5.1\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"6.2.4\"\n    ],\n    \"ASVS 4.0\": [\n      \"5.1.3\",\n      \"5.1.4\",\n      \"5.3.4\",\n      \"5.3.5\"\n    ]\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2094.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>There is no good excuse for an empty class. If it’s being used simply as a common extension point, it should be replaced with an\n<code>interface</code>. If it was stubbed in as a placeholder for future development it should be fleshed-out. In any other case, it should be\neliminated.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nPublic Class Empty ' Noncompliant\n\nEnd Class\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nPublic Interface IEmpty\n\nEnd Interface\n</pre>\n<h3>Exceptions</h3>\n<ul>\n  <li>Partial classes are ignored entirely, as source generators often use them.</li>\n  <li>Classes with names ending in <code>Command</code>, <code>Message</code>, <code>Event</code>, or <code>Query</code> are ignored as messaging\n  libraries often use them.</li>\n  <li>Subclasses of <code>System.Exception</code> are ignored; even an empty Exception class can provide helpful information by its type name\n  alone.</li>\n  <li>Subclasses of <code>System.Attribute</code> and classes annotated with attributes are ignored.</li>\n  <li>Subclasses of generic classes are ignored, as they can be used for type specialization even when empty.</li>\n  <li>Subclasses of certain framework types — like the <code>PageModel</code> class used in ASP.NET Core Razor Pages — are ignored.</li>\n  <li>Subclass of a class with non-public default constructors are ignored, as they widen the constructor accessibility.</li>\n</ul>\n<pre>\nImports Microsoft.AspNetCore.Mvc.RazorPages\n\nPublic Class EmptyPageModel ' Compliant - an empty PageModel can be fully functional, the VB code can be in the vbhtml file\n    Inherits PageModel\nEnd Class\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2094.json",
    "content": "{\n  \"title\": \"Classes should not be empty\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2094\",\n  \"sqKey\": \"S2094\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2166.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Clear, communicative naming is important in code. It helps maintainers and API users understand the intentions for and uses of a unit of code.\nUsing \"exception\" in the name of a class that does not extend <code>Exception</code> or one of its subclasses is a clear violation of the expectation\nthat a class' name will indicate what it is and/or does.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nPublic Class FruitException ' Noncompliant - this has nothing to do with Exception\n    Private expected As Fruit\n    Private unusualCharacteristics As String\n    Private appropriateForCommercialExploitation As Boolean\n    ' ...\nEnd Class\n\nPublic Class CarException ' Noncompliant - does not derive from any Exception-based class\n    Public Sub New(message As String, inner As Exception)\n        ' ...\n    End Sub\nEnd Class\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nPublic Class FruitSport ' Compliant - class name does not end with 'Exception'\n    Private expected As Fruit\n    Private unusualCharacteristics As String\n    Private appropriateForCommercialExploitation As Boolean\n    ' ...\nEnd Class\n\nPublic Class CarException Inherits Exception ' Compliant - correctly extends System.Exception\n    Public Sub New(message As String, inner As Exception)\n        MyBase.New(message, inner)\n        ' ...\n    End Sub\nEnd Class\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2166.json",
    "content": "{\n  \"title\": \"Classes named like \\\"Exception\\\" should extend \\\"Exception\\\" or a subclass\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"convention\",\n    \"error-handling\",\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2166\",\n  \"sqKey\": \"S2166\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2178.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><a href=\"https://en.wikipedia.org/wiki/Short-circuit_evaluation\">Short-circuit evaluation</a> is an evaluation strategy for <a\nhref=\"https://en.wikipedia.org/wiki/Logical_connective\">Boolean operators</a>, that doesn’t evaluate the second argument of the operator if it is not\nneeded to determine the result of the operation.</p>\n<p>VB.NET provides logical operators that implement short-circuiting evaluations <code>AndAlso</code> and <code>OrElse</code>, as well as the\nnon-short-circuiting versions <code>And</code> and <code>Or</code>. Unlike short-circuiting operators, the non-short-circuiting operators evaluate\nboth operands and afterward perform the logical operation.</p>\n<p>For example <code>False AndAlso FunctionCall</code> always results in <code>False</code> even when the <code>FunctionCall</code> invocation would\nraise an exception. In contrast, <code>False And FunctionCall</code> also evaluates <code>FunctionCall</code>, and results in an exception if\n<code>FunctionCall</code> raises an exception.</p>\n<p>Similarly, <code>True OrElse FunctionCall</code> always results in <code>True</code>, no matter what the return value of <code>FunctionCall</code>\nwould be.</p>\n<p>The use of non-short-circuit logic in a boolean context is likely a mistake, one that could cause serious program errors as conditions are\nevaluated under the wrong circumstances.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nIf GetTrue() Or GetFalse() Then ' Noncompliant: both sides evaluated\nEnd If\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nIf GetTrue() OrElse GetFalse() Then ' Compliant: short-circuit logic used\nEnd If\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/operators-and-expressions/logical-and-bitwise-operators\">Logical and Bitwise Operators in Visual Basic</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Short-circuit_evaluation\">Short-circuit evaluation</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Logical_connective\">Boolean operators</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li><a href=\"https://ericlippert.com/2015/11/02/when-would-you-use-on-a-bool/\">Eric Lippert’s blog - When would you use &amp; on a bool?</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2178.json",
    "content": "{\n  \"title\": \"Short-circuit logic should be used in boolean contexts\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-2178\",\n  \"sqKey\": \"S2178\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2222.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>To prevent potential <a href=\"https://en.wikipedia.org/wiki/Deadlock\">deadlocks</a> in an application, it is crucial to release any locks that are\nacquired within a method along all possible execution paths.</p>\n<p>Failing to release locks properly can lead to potential deadlocks, where the lock might not be released, causing issues in the application.</p>\n<p>This rule specifically focuses on tracking the following types from the <code>System.Threading</code> namespace:</p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.monitor\"><code>Monitor</code></a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.mutex\"><code>Mutex</code></a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlock\"><code>ReaderWriterLock</code></a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlockslim\"><code>ReaderWriterLockSlim</code></a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.spinlock\"><code>SpinLock</code> </a></li>\n</ul>\n<p>An issue is reported when a lock is acquired within a method but not released on all paths.</p>\n<h3>Exceptions</h3>\n<p>If the lock is never released within the method, no issue is raised, assuming that the callers will handle the release.</p>\n<h2>How to fix it</h2>\n<p>To make sure that a lock is always released correctly, you can follow one of these two methods:</p>\n<ul>\n  <li>Use a <a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/synclock-statement\"><code>SyncLock</code></a>\n  statement with your lock object.</li>\n  <li>Use a <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/try-catch-finally-statement\"><code>Try-Finally</code></a>\n  statement and put the release of your lock object within a <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/try-catch-finally-statement#finally-block\"><code>Finally</code></a> block.</li>\n</ul>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nClass Example\n    Private obj As Object = New Object()\n\n    Public Sub DoSomethingWithMonitor()\n        Monitor.Enter(obj) ' Noncompliant: not all paths release the lock\n\n        If IsInitialized() Then\n            ' ...\n            Monitor.Exit(obj)\n        End If\n    End Sub\nEnd Class\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nClass Example\n    Private lockObj As ReaderWriterLockSlim = New ReaderWriterLockSlim()\n\n    Public Sub DoSomethingWithReaderWriteLockSlim()\n        lockObj.EnterReadLock() ' Noncompliant: not all paths release the lock\n        If IsInitialized() Then\n            ' ...\n            lockObj.ExitReadLock()\n        End If\n    End Sub\nEnd Class\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nClass Example\n    Private obj As Object = New Object()\n\n    Public Sub DoSomethingWithMonitor()\n        SyncLock obj ' Compliant: the lock will be released at the end of the SyncLock block\n            If IsInitialized() Then\n                ' ...\n            End If\n        End SyncLock\n    End Sub\nEnd Class\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nClass Example\n    Private lockObj As ReaderWriterLockSlim = New ReaderWriterLockSlim()\n\n    Public Sub DoSomethingWithReaderWriteLockSlim()\n        lockObj.EnterReadLock() ' Compliant: the lock will be released in the finally block\n\n        Try\n            If IsInitialized() Then\n                ' ...\n            End If\n        Finally\n            lockObj.ExitReadLock()\n        End Try\n    End Sub\nEnd Class\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li><a\n  href=\"https://docs.microsoft.com/en-us/dotnet/standard/threading/overview-of-synchronization-primitives#synchronization-of-access-to-a-shared-resource\">Synchronization of access to a shared resource</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/459\">CWE-459 - Incomplete Cleanup</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/synclock-statement\"><code>SyncLock</code>\n  statement</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/try-catch-finally-statement#finally-block\"><code>Finally</code> block</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2222.json",
    "content": "{\n  \"title\": \"Locks should be released on all paths\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"multi-threading\",\n    \"symbolic-execution\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-2222\",\n  \"sqKey\": \"S2222\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      459\n    ]\n  },\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2225.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Calling <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.object.tostring\">ToString()</a> on an object should always return a\n<code>string</code>. Thus, overriding the ToString method should never return <code>Nothing</code> because it breaks the method’s implicit contract,\nand as a result the consumer’s expectations.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nPublic Overrides Function ToString() As String\n    Return Nothing ' Noncompliant\nEnd Function\n</pre>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nPublic Overrides Function ToString() As String\n    Return \"\"\nEnd Function\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/476\">CWE-476 - NULL Pointer Dereference</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.object.tostring\">Object.ToString Method</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2225.json",
    "content": "{\n  \"title\": \"\\\"ToString()\\\" method should not return Nothing\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2225\",\n  \"sqKey\": \"S2225\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      476\n    ]\n  },\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2234.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Calling a procedure with argument variables whose names match the procedure parameter names but in a different order can cause confusion. It could\nindicate a mistake in the arguments' order, leading to unexpected results.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nPublic Function Divide(divisor As Integer, dividend As Integer) As Double\n    Return divisor / dividend\nEnd Function\n\nPublic Sub DoTheThing()\n    Dim divisor = 15\n    Dim dividend = 5\n\n    Dim result = Divide(dividend, divisor)  ' Noncompliant: arguments' order doesn't match their respective parameter names\n    '...\nEnd Sub\n</pre>\n<p>However, matching the procedure parameters' order contributes to clearer and more readable code:</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nPublic Function Divide(divisor As Integer, dividend As Integer) As Double\n    Return divisor / dividend\nEnd Function\n\nPublic Sub DoTheThing()\n    Dim divisor = 15\n    Dim dividend = 5\n\n    Dim result = Divide(divisor, dividend) ' Compliant\n    '...\nEnd Sub\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2234.json",
    "content": "{\n  \"title\": \"Arguments should be passed in the same order as the procedure parameters\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2234\",\n  \"sqKey\": \"S2234\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2257.html",
    "content": "<p>The use of a non-standard algorithm is dangerous because a determined attacker may be able to break the algorithm and compromise whatever data has\nbeen protected. Standard algorithms like <code>AES</code>, <code>RSA</code>, <code>SHA</code>, …​ should be used instead.</p>\n<p>This rule tracks custom implementation of these types from <code>System.Security.Cryptography</code> namespace:</p>\n<ul>\n  <li><code>AsymmetricAlgorithm</code></li>\n  <li><code>AsymmetricKeyExchangeDeformatter</code></li>\n  <li><code>AsymmetricKeyExchangeFormatter</code></li>\n  <li><code>AsymmetricSignatureDeformatter</code></li>\n  <li><code>AsymmetricSignatureFormatter</code></li>\n  <li><code>DeriveBytes</code></li>\n  <li><code>HashAlgorithm</code></li>\n  <li><code>ICryptoTransform</code></li>\n  <li><code>SymmetricAlgorithm</code></li>\n</ul>\n<h2>Recommended Secure Coding Practices</h2>\n<ul>\n  <li>Use a standard algorithm instead of creating a custom one.</li>\n</ul>\n<h2>Sensitive Code Example</h2>\n<pre>\nPublic Class CustomHash     ' Noncompliant\n    Inherits HashAlgorithm\n\n    Private fResult() As Byte\n\n    Public Overrides Sub Initialize()\n        fResult = Nothing\n    End Sub\n\n    Protected Overrides Function HashFinal() As Byte()\n        Return fResult\n    End Function\n\n    Protected Overrides Sub HashCore(array() As Byte, ibStart As Integer, cbSize As Integer)\n        fResult = If(fResult, array.Take(8).ToArray)\n    End Sub\n\nEnd Class\n</pre>\n<h2>Compliant Solution</h2>\n<pre>\nDim mySHA256 As SHA256 = SHA256.Create()\n</pre>\n<h2>See</h2>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A02_2021-Cryptographic_Failures/\">Top 10 2021 Category A2 - Cryptographic Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure\">Top 10 2017 Category A3 - Sensitive Data\n  Exposure</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/327\">CWE-327 - Use of a Broken or Risky Cryptographic Algorithm</a></li>\n  <li>Derived from FindSecBugs rule <a href=\"https://h3xstream.github.io/find-sec-bugs/bugs.htm#CUSTOM_MESSAGE_DIGEST\">MessageDigest is\n  Custom</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2257.json",
    "content": "{\n  \"title\": \"Using non-standard cryptographic algorithms is security-sensitive\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"HIGH\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1d\"\n  },\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-2257\",\n  \"sqKey\": \"S2257\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      327\n    ],\n    \"OWASP\": [\n      \"A3\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A2\"\n    ],\n    \"ASVS 4.0\": [\n      \"2.9.3\",\n      \"6.2.2\",\n      \"8.3.7\"\n    ]\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2259.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Accessing a <a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/nothing\">Nothing</a> value will always throw a <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.nullreferenceexception\">NullReferenceException</a> most likely causing an abrupt program\ntermination.</p>\n<p>Such termination might expose sensitive information that a malicious third party could exploit to, for instance, bypass security measures.</p>\n<h3>Exceptions</h3>\n<p>In the following cases, the rule does not raise:</p>\n<h4>Extensions Methods</h4>\n<p>Calls to extension methods can still operate on <code>Nothing</code> values.</p>\n<pre>\nImports System.Diagnostics.CodeAnalysis\nImports System.Runtime.CompilerServices\nImports System.Text.RegularExpressions\n\nModule Program\n    &lt;Extension&gt;\n    Function RemoveVowels(Value As String) As String\n        If Value Is Nothing Then\n            Return Nothing\n        End If\n        Return Regex.Replace(Value, \"[aeoui]*\", \"\", RegexOptions.IgnoreCase)\n    End Function\n\n    Sub Main()\n        Dim StrValue As String = Nothing\n        Console.WriteLine(StrValue.RemoveVowels()) ' Compliant: 'RemoveVowels' is an extension method\n    End Sub\nEnd Module\n</pre>\n<h4>Unreachable code</h4>\n<p>Unreachable code is not executed, thus <code>Nothing</code> values will never be accessed.</p>\n<pre>\nPublic Sub Method()\n    Dim o As Object = Nothing\n    If False Then\n        o.ToString() ' Compliant: code is unreachable\n    End If\nEnd Sub\n</pre>\n<h4>Validated value by analysis attributes</h4>\n<p><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/attributes/nullable-analysis\">Nullable analysis attributes</a> enable\nthe developer to annotate methods with information about the null-state of its arguments. Thus, potential <code>Nothing</code> values validated by one\nof the following attributes will not raise:</p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.notnullattribute\">NotNullAttribute</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.notnullwhenattribute\">NotNullWhenAttribute</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.doesnotreturnattribute\">DoesNotReturnAttribute</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.doesnotreturnifattribute\">DoesNotReturnIfAttribute</a></li>\n</ul>\n<p>It is important to note those attributes are only available starting .NET Core 3. As a workaround, it is possible to define those attributes\nmanually in a custom class:</p>\n<pre>\nPublic NotInheritable Class NotNullAttribute ' The alternative name 'ValidatedNotNullAttribute' is also supported\n    Inherits Attribute\nEnd Class\n\nPublic Module Guard\n    Public Sub CheckNotNull(Of T)(&lt;NotNull&gt; Value As T, Name As String)\n        If Value Is Nothing Then Throw New ArgumentNullException(Name)\n    End Sub\nEnd Module\n\nPublic Module Utils\n    Public Function Normalize(Value As String) As String\n        CheckNotNull(Value, nameof(Value)) ' Will throw if 'Value' is Nothing\n        Return Value.ToUpper() ' Compliant: value is known to be not Nothing here\n    End Function\nEnd Module\n</pre>\n<h4>Validated value by Debug.Assert</h4>\n<p>A value validated with <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.debug.assert\">Debug.Assert</a> to not be\n<code>Nothing</code> is safe to access.</p>\n<pre>\nImports System.Diagnostics\n\nPublic Sub Method(MyObject As Object)\n    Debug.Assert(MyObject IsNot Nothing)\n    MyObject.ToString() ' Compliant: 'MyObject' is known to be not Nothing here.\nEnd Sub\n</pre>\n<h4>Validated value by IDE-specific attributes</h4>\n<p>Like with null-analysis-attribute, potential <code>Nothing</code> values validated by one of the following IDE-specific attributes will not\nraise</p>\n<h5>Visual Studio</h5>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.validatednotnullattribute\">ValidatedNotNullAttribute</a>  (The attribute is\n  interpreted the same as the <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.notnullattribute\">NotNullAttribute</a>) </li>\n</ul>\n<h5>JetBrains Rider</h5>\n<ul>\n  <li><a href=\"https://www.jetbrains.com/help/resharper/Reference__Code_Annotation_Attributes.html#NotNullAttribute\">NotNullAttribute</a></li>\n  <li><a\n  href=\"https://www.jetbrains.com/help/resharper/Reference__Code_Annotation_Attributes.html#TerminatesProgramAttribute\">TerminatesProgramAttribute</a>\n    <pre>\nImports System\nImports JetBrains.Annotations\n\nPublic Class Utils\n    &lt;TerminatesProgram&gt;\n    Public Sub TerminateProgram()\n        Environment.FailFast(\"A catastrophic failure has occurred.\")\n    End Sub\n\n    Public Sub Method()\n        Dim MyObject As Object = Nothing\n        TerminateProgram()\n        MyObject.ToString() ' Compliant: unreachable\n    End Sub\nEnd Class\n</pre></li>\n</ul>\n<h2>How to fix it</h2>\n<p>To fix the issue, the access of the <code>Nothing</code> value needs to be prevented by either:</p>\n<ul>\n  <li>ensuring the variable has a value, or</li>\n  <li>by checking if the value is not <code>Nothing</code></li>\n</ul>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<p>The variable <code>MyObject</code> is equal to <code>Nothing</code>, meaning it has no value:</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nPublic Sub Method()\n    Dim MyObject As Object = Nothing\n    Console.WriteLine(MyObject.ToString)   ' Noncompliant: 'MyObject' is always Nothing\nEnd Sub\n</pre>\n<p>The parameter <code>Input</code> might be <code>Nothing</code> as suggested by the <code>if</code> condition:</p>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nPublic Sub Method(Input As Object)\n    If Input Is Nothing Then\n        ' ...\n    End If\n    Console.WriteLine(Input.ToString) ' Noncompliant: 'Input' might be Nothing\nEnd Sub\n</pre>\n<h4>Compliant solution</h4>\n<p>Ensuring the variable <code>MyObject</code> has a value resolves the issue:</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nPublic Sub Method()\n    Dim MyObject As New Object\n    Console.WriteLine(MyObject.ToString) ' Compliant: 'MyObject' is not Nothing\nEnd Sub\n</pre>\n<p>Preventing the non-compliant code to be executed by returning early:</p>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nPublic Sub Method(Input As Object)\n    If Input Is Nothing Then\n        Return\n    End If\n    Console.WriteLine(Input.ToString) ' Compliant: if 'Input' is Nothing, this part is unreachable\nEnd Sub\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>CVE - <a href=\"https://cwe.mitre.org/data/definitions/476\">CWE-476 - NULL Pointer Dereference</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.nullreferenceexception\">NullReferenceException Class</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/attributes/nullable-analysis\">Attributes for\n  null-state static analysis interpreted by the C# compiler</a>\n    <ul>\n      <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.notnullattribute\">NotNullAttribute\n      Class</a></li>\n      <li>Microsoft Learn - <a\n      href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.notnullwhenattribute\">NotNullWhenAttribute Class</a></li>\n      <li>Microsoft Learn - <a\n      href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.doesnotreturnattribute\">DoesNotReturnAttribute Class</a></li>\n      <li>Microsoft Learn - <a\n      href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.doesnotreturnifattribute\">DoesNotReturnIfAttribute\n      Class</a></li>\n    </ul></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.validatednotnullattribute\">ValidatedNotNullAttribute Class</a>\n  in Visual Studio</li>\n  <li>JetBrains Resharper - <a\n  href=\"https://www.jetbrains.com/help/resharper/Reference__Code_Annotation_Attributes.html#NotNullAttribute\">NotNullAttribute</a></li>\n  <li>JetBrains Resharper - <a\n  href=\"https://www.jetbrains.com/help/resharper/Reference__Code_Annotation_Attributes.html#TerminatesProgramAttribute\">TerminatesProgramAttribute</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/nothing\">Nothing keyword (Visual\n  Basic)</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2259.json",
    "content": "{\n  \"title\": \"Null pointers should not be dereferenced\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"symbolic-execution\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2259\",\n  \"sqKey\": \"S2259\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      476\n    ]\n  },\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2302.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Because parameter names could be changed during refactoring, they should not be spelled out literally in strings. Instead, use\n<code>NameOf()</code>, and the string that’s output will always be correct.</p>\n<p>This rule raises an issue when any string in the <code>Throw</code> statement is an exact match for the name of one of the method parameters.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nPublic Sub DoSomething(param As Integer, secondParam As String)\n    If (param &lt; 0)\n        Throw New Exception(\"param\") ' Noncompliant\n    End If\n    If secondParam is Nothing\n      Throw New Exception(\"secondParam should be valid\") ' Noncompliant\n    End If\nEnd Sub\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nPublic Sub DoSomething(param As Integer, secondParam As String)\n    If (param &lt; 0)\n        Throw New Exception(NameOf(param))\n    End If\n    If secondParam is Nothing\n      Throw New Exception($\"{NameOf(secondParam)} should be valid\")\n    End If\nEnd Sub\n</pre>\n<h3>Exceptions</h3>\n<ul>\n  <li>The rule doesn’t raise any issue when using VB.NET &lt; 14.0.</li>\n  <li>When the parameter name is contained in a sentence inside the <code>Throw</code> statement string, the rule will raise an issue only if the\n  parameter name is at least 5 characters long. This is to avoid false positives.</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2302.json",
    "content": "{\n  \"title\": \"\\\"NameOf\\\" should be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"MODULAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"bad-practice\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-2302\",\n  \"sqKey\": \"S2302\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2304.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Shared coding conventions allow teams to collaborate efficiently. This rule checks that all namespace names match a provided regular\nexpression.</p>\n<p>The default configuration is the one recommended by Microsoft:</p>\n<ul>\n  <li>Pascal casing, starting with an upper case character, e.g. Microsoft, System</li>\n  <li>Short abbreviations of 2 letters can be capitalized, e.g. System.IO</li>\n  <li>Longer abbreviations need to be lower cased</li>\n</ul>\n<h3>Noncompliant code example</h3>\n<p>With the default regular expression: <code>^([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?(\\.([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2}))*$</code></p>\n<pre>\nNamespace foo  ' Noncompliant\nEnd Namespace\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nNamespace Foo  ' Compliant\nEnd Namespace\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2304.json",
    "content": "{\n  \"title\": \"Namespace names should comply with a naming convention\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2304\",\n  \"sqKey\": \"S2304\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2339.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Constant members are copied at compile time to the call sites, instead of being fetched at runtime.</p>\n<p>As an example, say you have a library with a constant <code>Version</code> member set to <code>1.0</code>, and a client application linked to it.\nThis library is then updated and <code>Version</code> is set to <code>2.0</code>. Unfortunately, even after the old DLL is replaced by the new one,\n<code>Version</code> will still be <code>1.0</code> for the client application. In order to see <code>2.0</code>, the client application would need to\nbe rebuilt against the new version of the library.</p>\n<p>This means that you should use constants to hold values that by definition will never change, such as <code>Zero</code>. In practice, those cases\nare uncommon, and therefore it is generally better to avoid constant members.</p>\n<p>This rule only reports issues on public constant fields, which can be reached from outside the defining assembly.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nPublic Class Foo\n    Public Const Version = 1.0           ' Noncompliant\nEnd Class\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nPublic Class Foo\n    Public Shared ReadOnly Property Version = 1.0 ' Compliant\nEnd Class\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2339.json",
    "content": "{\n  \"title\": \"Public constant members should not be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-2339\",\n  \"sqKey\": \"S2339\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2340.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>A <code>Do ... Loop</code> without a <code>While</code> or <code>Until</code> condition must be terminated by an unstructured <code>Exit Do</code>\nstatement. It is safer and more readable to use structured loops instead.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nModule Module1\n    Sub Main()\n        Dim i = 1\n\n        Do                        ' Non-Compliant\n            If i = 10 Then\n                Exit Do\n            End If\n\n            Console.WriteLine(i)\n\n            i = i + 1\n        Loop\n    End Sub\nEnd Module\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nModule Module1\n    Sub Main()\n        For i = 1 To 9            ' Compliant\n            Console.WriteLine(i)\n        Next\n    End Sub\nEnd Module\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2340.json",
    "content": "{\n  \"title\": \"\\\"Do\\\" loops should not be used without a \\\"While\\\" or \\\"Until\\\" condition\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-2340\",\n  \"sqKey\": \"S2340\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2342.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Shared naming conventions allow teams to collaborate efficiently. This rule checks that all enum names match a provided regular expression.</p>\n<p>The default configuration is the one recommended by Microsoft:</p>\n<ul>\n  <li>Pascal casing, starting with an upper case character, e.g. BackColor</li>\n  <li>Short abbreviations of 2 letters can be capitalized, e.g. GetID</li>\n  <li>Longer abbreviations need to be lower case, e.g. GetHtml</li>\n  <li>If the enum is marked as [Flags] then its name should be plural (e.g. MyOptions), otherwise, names should be singular (e.g. MyOption)</li>\n</ul>\n<h3>Noncompliant code example</h3>\n<p>With the default regular expression for non-flags enums: <code>^([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?$</code></p>\n<pre>\nPublic Enum foo ' Noncompliant\n    FooValue = 0\nEnd Enum\n</pre>\n<p>With the default regular expression for flags enums: <code>^([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?s$</code></p>\n<pre>\n&lt;Flags()&gt;\nPublic Enum Option ' Noncompliant\n    None = 0,\n    Option1 = 1,\n    Option2 = 2\nEnd Enum\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nPublic Enum Foo\n    FooValue = 0\nEnd Enum\n</pre>\n<pre>\n&lt;Flags()&gt;\nPublic Enum Options\n    None = 0,\n    Option1 = 1,\n    Option2 = 2\nEnd Enum\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2342.json",
    "content": "{\n  \"title\": \"Enumeration types should comply with a naming convention\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2342\",\n  \"sqKey\": \"S2342\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2343.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Shared coding conventions allow teams to collaborate efficiently. This rule checks that all enumeration value names match a provided regular\nexpression.</p>\n<p>The default configuration is the one recommended by Microsoft:</p>\n<ul>\n  <li>Pascal casing, starting with an upper case character, e.g. BackColor</li>\n  <li>Short abbreviations of 2 letters can be capitalized, e.g. GetID</li>\n  <li>Longer abbreviations need to be lower cased, e.g. GetHtml</li>\n</ul>\n<h3>Noncompliant code example</h3>\n<p>With the default regular expression <code>^([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?$</code>:</p>\n<pre>\nEnum Foo\n    fooValue   ' Noncompliant\nEnd Enum\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nEnum Foo\n    FooValue   ' Compliant\nEnd Enum\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2343.json",
    "content": "{\n  \"title\": \"Enumeration values should comply with a naming convention\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2343\",\n  \"sqKey\": \"S2343\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2344.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The information that an enumeration type is actually an enumeration or a set of flags should not be duplicated in its name.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nEnum FooFlags ' Noncompliant\n    Foo = 1\n    Bar = 2\n    Baz = 4\nEnd Enum\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nEnum Foo      ' Compliant\n    Foo = 1\n    Bar = 2\n    Baz = 4\nEnd Enum\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2344.json",
    "content": "{\n  \"title\": \"Enumeration type names should not have \\\"Flags\\\" or \\\"Enum\\\" suffixes\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2344\",\n  \"sqKey\": \"S2344\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2345.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When you annotate an <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.enum\">Enum</a> with the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.flagsattribute\">Flags attribute</a>, you must not rely on the values that are automatically\nset by the language to the <code>Enum</code> members, but you should define the enumeration constants in powers of two (1, 2, 4, 8, and so on).\nAutomatic value initialization will set the first member to zero and increment the value by one for each subsequent member. As a result, you won’t be\nable to use the enum members with bitwise operators.</p>\n<h3>Exceptions</h3>\n<p>The default initialization of <code>0, 1, 2, 3, 4, …​</code> matches <code>0, 1, 2, 4, 8 …​</code> in the first three values, so no issue is\nreported if the first three members of the enumeration are not initialized.</p>\n<h2>How to fix it</h2>\n<p>Define enumeration constants in powers of two, that is, 1, 2, 4, 8, and so on.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\n&lt;Flags()&gt;\nEnum FruitType    ' Non-Compliant\n  None\n  Banana\n  Orange\n  Strawberry\nEnd Enum\n\nModule Module1\n  Sub Main()\n    Dim bananaAndStrawberry = FruitType.Banana Or FruitType.Strawberry\n    Console.WriteLine(bananaAndStrawberry.ToString()) ' Will display only \"Strawberry\"\n  End Sub\nEnd Module\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n&lt;Flags()&gt;\nEnum FruitType    ' Compliant\n  None = 0\n  Banana = 1\n  Orange = 2\n  Strawberry = 4\nEnd Enum\n\nModule Module1\n  Sub Main()\n    Dim bananaAndStrawberry = FruitType.Banana Or FruitType.Strawberry\n    Console.WriteLine(bananaAndStrawberry.ToString()) ' Will display \"Banana, Strawberry\"\n  End Sub\nEnd Module\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.enum\">Enum Class</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.flagsattribute\">FlagsAttribute Class</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2345.json",
    "content": "{\n  \"title\": \"Flags enumerations should explicitly initialize all their members\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"LOW\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2345\",\n  \"sqKey\": \"S2345\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2346.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>An enumeration can be decorated with the <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.flagsattribute\">FlagsAttribute</a> to\nindicate that it can be used as a <a href=\"https://en.wikipedia.org/wiki/Bit_field\">bit field</a>: a set of flags, that can be independently set and\nreset.</p>\n<p>For example, the following definition of the day of the week:</p>\n<pre>\n&lt;Flags()&gt;\nEnum Days\n    Monday = 1    ' 0b00000001\n    Tuesday = 2   ' 0b00000010\n    Wednesday = 4 ' 0b00000100\n    Thursday = 8  ' 0b00001000\n    Friday = 16   ' 0b00010000\n    Saturday = 32 ' 0b00100000\n    Sunday = 64   ' 0b01000000\nEnd Enum\n</pre>\n<p>allows to define special set of days, such as <code>WeekDays</code> and <code>Weekend</code> using the <code>Or</code> operator:</p>\n<pre>\n&lt;Flags()&gt;\nEnum Days\n    ' ...\n    None = 0                                                        ' 0b00000000\n    Weekdays = Monday Or Tuesday Or Wednesday Or Thursday Or Friday ' 0b00011111\n    Weekend = Saturday Or Sunday                                    ' 0b01100000\n    All = Weekdays Or Weekend                                       ' 0b01111111\nEnd Enum\n</pre>\n<p>These can be used to write more expressive conditions, taking advantage of <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/operators-and-expressions/logical-and-bitwise-operators#bitwise-operations\">bitwise\noperators</a> and <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.enum.hasflag\">Enum.HasFlag</a>:</p>\n<pre>\nDim someDays = Days.Wednesday | Days.Weekend ' 0b01100100\nsomeDays.HasFlag(Days.Wednesday)             ' someDays contains Wednesday\n\nDim mondayAndWednesday = Days.Monday Or Days.Wednesday\nsomeDays.HasFlag(mondayAndWednesday)         ' someDays contains Monday and Wednesday\nsomeDays.HasFlag(Days.Monday) OrElse someDays.HasFlag(Days.Wednesday) ' someDays contains Monday or Wednesday\nsomeDays And Days.Weekend &lt;&gt; Days.None       ' someDays overlaps with the weekend\nsomeDays And Days.Weekdays = Days.Weekdays   ' someDays is only made of weekdays\n</pre>\n<p>Consistent use of <code>None</code> in flag enumerations indicates that all flag values are cleared. The value 0 should not be used to indicate any\nother state since there is no way to check that the bit <code>0</code> is set.</p>\n<pre>\n&lt;Flags()&gt;\nEnum Days\n    Monday = 0    ' 0 is used to indicate Monday\n    Tuesday = 1\n    Wednesday = 2\n    Thursday = 4\n    Friday = 8\n    Saturday = 16\n    Sunday = 32\n    Weekdays = Monday Or Tuesday Or Wednesday Or Thursday Or Friday\n    Weekend = Saturday Or Sunday\n    All = Weekdays Or Weekend\nEnd Enum\n\nDim someDays = Days.Wednesday Or Days.Thursday\nsomeDays &amp; Days.Tuesday = Days.Tuesday ' False, because someDays doesn't contains Tuesday\nsomeDays &amp; Days.Monday = Days.Monday   ' True, even though someDays doesn't contains Monday!\nsomeDays.HasFlag(Days.Monday)          ' Same issue as above\n</pre>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\n&lt;Flags()&gt;\nEnum FruitType\n    Void = 0        ' Non-Compliant\n    Banana = 1\n    Orange = 2\n    Strawberry = 4\nEnd Enum\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n&lt;Flags()&gt;\nEnum FruitType\n    None = 0        ' Compliant\n    Banana = 1\n    Orange = 2\n    Strawberry = 4\nEnd Enum\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.flagsattribute\">FlagsAttribute</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Bit_field\">Bit field</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/operators-and-expressions/logical-and-bitwise-operators#bitwise-operations\">Logical and Bitwise Operators in Visual Basic</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.enum.hasflag\">Enum.HasFlag(Enum) Method</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/ms229062(v=vs.100)\">Designing Flags Enumerations</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2346.json",
    "content": "{\n  \"title\": \"Flags enumerations zero-value members should be named \\\"None\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-2346\",\n  \"sqKey\": \"S2346\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2347.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Shared coding conventions allow teams to collaborate efficiently. This rule checks that all even handler names match a provided regular\nexpression.</p>\n<p>The default configuration is:</p>\n<ul>\n  <li>Either in Pascal case, i.e. starting with an upper case letter, e.g. OnMyButtonClicked</li>\n  <li>Or, a subject, in Pascal or camel case, followed by an underscore followed by an event name, in Pascal case, e.g. btn1_Clicked</li>\n</ul>\n<p>Event handlers with a <code>handles</code> clause and two-parameter methods with <code>EventArgs</code> second parameter are covered by this\nrule.</p>\n<h3>Noncompliant code example</h3>\n<p>With the default regular expression <code>^(([a-z][a-z0-9]*)?([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?_)?([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?$</code>:</p>\n<pre>\nModule Module1\n    Sub subject__SomeEvent() Handles X.SomeEvent   ' Noncompliant - two underscores\n    End Sub\nEnd Module\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nModule Module1\n    Sub subject_SomeEvent() Handles X.SomeEvent    ' Compliant\n    End Sub\nEnd Module\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2347.json",
    "content": "{\n  \"title\": \"Event handlers should comply with a naming convention\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2347\",\n  \"sqKey\": \"S2347\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2348.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Shared coding conventions allow teams to collaborate efficiently. This rule checks that all even names match a provided regular expression.</p>\n<p>The default configuration is the one recommended by Microsoft:</p>\n<ul>\n  <li>Pascal casing, starting with an upper case character, e.g. BackColor</li>\n  <li>Short abbreviations of 2 letters can be capitalized, e.g. GetID</li>\n  <li>Longer abbreviations need to be lower cased, e.g. GetHtml</li>\n</ul>\n<h3>Noncompliant code example</h3>\n<p>With the default regular expression <code>^([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?$</code>:</p>\n<pre>\nClass Foo\n    Event fooEvent() ' Noncompliant\nEnd Class\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nClass Foo\n    Event FooEvent() ' Compliant\nEnd Class\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2348.json",
    "content": "{\n  \"title\": \"Events should comply with a naming convention\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2348\",\n  \"sqKey\": \"S2348\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2349.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>\"After\" and \"Before\" prefixes or suffixes should not be used to indicate pre and post events. The concepts of before and after should be given to\nevents using the present and past tense.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nClass Foo\n    Event BeforeClose() ' Noncompliant\n    Event AfterClose()  ' Noncompliant\nEnd Class\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nClass Foo\n    Event Closing()     ' Compliant\n    Event Closed()      ' Compliant\nEnd Class\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2349.json",
    "content": "{\n  \"title\": \"Event names should not have \\\"Before\\\" or \\\"After\\\" as a prefix or suffix\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2349\",\n  \"sqKey\": \"S2349\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2352.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Indexed properties are meant to represent access to a logical collection. When multiple parameters are required, this design guideline may be\nviolated, and refactoring the property into a method is preferable.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nModule Module1\n    ReadOnly Property Sum(ByVal a As Integer, ByVal b As Integer) ' Noncompliant\n        Get\n            Return a + b\n        End Get\n    End Property\nEnd Module\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nModule Module1\n    Function Sum(ByVal a As Integer, ByVal b As Integer)          ' Compliant\n        Return a + b\n    End Function\nEnd Module\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2352.json",
    "content": "{\n  \"title\": \"Indexed properties with more than one parameter should not be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2352\",\n  \"sqKey\": \"S2352\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2354.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>To improve the code readability, the explicit line continuation character, <code>_</code>, should not be used. Instead, it is better to break lines\nafter an operator.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nModule Module1\n    Sub Main()\n        ' Noncompliant\n        Console.WriteLine(\"Hello\" _\n                          &amp; \"world\")\n    End Sub\nEnd Module\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nModule Module1\n    Sub Main()\n\n        Console.WriteLine(\"Hello\" &amp;\n                          \"world\")\n    End Sub\nEnd Module\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2354.json",
    "content": "{\n  \"title\": \"Line continuations should not be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"FORMATTED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2354\",\n  \"sqKey\": \"S2354\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2355.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Array literals are more compact than array creation expressions.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nModule Module1\n    Sub Main()\n        Dim foo = New String() {\"a\", \"b\", \"c\"} ' Noncompliant\n    End Sub\nEnd Module\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nModule Module1\n    Sub Main()\n        Dim foo = {\"a\", \"b\", \"c\"}              ' Compliant\n    End Sub\nEnd Module\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2355.json",
    "content": "{\n  \"title\": \"Array literals should be used instead of array creation expressions\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2355\",\n  \"sqKey\": \"S2355\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2357.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Fields should not be part of an API, and therefore should always be private. Indeed, they cannot be added to an interface for instance, and\nvalidation cannot be added later on without breaking backward compatibility. Instead, developers should encapsulate their fields into properties.\nExplicit property getters and setters can be introduced for validation purposes or to smooth the transition to a newer system.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nClass Foo\n    Public Foo = 42          ' Noncompliant\nEnd Class\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nClass Foo\n    Public Property Foo = 42 ' Compliant\nEnd Class\n</pre>\n<h3>Exceptions</h3>\n<p><code>Shared</code> and <code>Const</code> fields are ignored.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2357.json",
    "content": "{\n  \"title\": \"Fields should be private\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"MODULAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2357\",\n  \"sqKey\": \"S2357\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2358.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The <code>... IsNot ...</code> syntax is more compact and more readable than the <code>Not ... Is ...</code> syntax.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nModule Module1\n    Sub Main()\n        Dim a = Not \"a\" Is Nothing ' Noncompliant\n    End Sub\nEnd Module\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nModule Module1\n    Sub Main()\n        Dim a = \"a\" IsNot Nothing  ' Compliant\n    End Sub\nEnd Module\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2358.json",
    "content": "{\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2358\",\n  \"sqKey\": \"S2358\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"covered\",\n  \"title\": \"\\\"IsNot\\\" should be used instead of \\\"Not ... Is ...\\\"\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2359.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Prefer the use of <code>Try ... Catch</code> blocks instead of <code>On Error</code> statements.</p>\n<p>Visual Basic .NET and Visual Basic 2005 offer structured exception handling that provides a powerful, more readable alternative to the <code>On\nError Goto</code> error handling from previous versions of Microsoft Visual Basic. Structured exception handling is more powerful because it allows\nyou to nest error handlers inside other error handlers within the same procedure. Furthermore, structured exception handling uses a block syntax\nsimilar to the <code>If...Else...End If</code> statement. This makes Visual Basic .NET and Visual Basic 2005 code more readable and easier to\nmaintain.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nSub DivideByZero()\n  On Error GoTo nextstep\n  Dim result As Integer\n  Dim num As Integer\n  num = 100\n  result = num / 0\nnextstep:\n  System.Console.WriteLine(\"Error\")\nEnd Sub\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nSub DivideByZero()\n  Try\n    Dim result As Integer\n    Dim num As Integer\n    num = 100\n    result = num / 0\n  Catch\n    System.Console.WriteLine(\"Error\")\n  End Try\nEnd Sub\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2359.json",
    "content": "{\n  \"title\": \"\\\"On Error\\\" statements should not be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [\n    \"bad-practice\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2359\",\n  \"sqKey\": \"S2359\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2360.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The overloading mechanism should be used in place of optional parameters for several reasons:</p>\n<ul>\n  <li>Optional parameter values are baked into the method call site code, thus, if a default value has been changed, all referencing assemblies need\n  to be rebuilt, otherwise the original values will be used.</li>\n  <li>The Common Language Specification (CLS) allows compilers to ignore default parameter values, and thus require the caller to explicitly specify\n  the values. For example, if you want to consume a method with default argument from another .NET compatible language (for instance C++/CLI), you\n  will have to provide all arguments. When using method overloads, you could achieve similar behavior as default arguments.</li>\n  <li>Optional parameters prevent muddying the definition of the function contract. Here is a simple example: if there are two optional parameters,\n  when one is defined, is the second one still optional or mandatory?</li>\n</ul>\n<h3>Noncompliant code example</h3>\n<pre>\nSub Notify(ByVal Company As String, Optional ByVal Office As String = \"QJZ\") ' Noncompliant\n\nEnd Sub\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nSub Notify(ByVal Company As String)\n  Notify(Company, \"QJZ\")\nEnd Sub\n\nSub Notify(ByVal Company As String, ByVal Office As String)\n\nEnd Sub\n</pre>\n<h3>Exceptions</h3>\n<p>The rule ignores non externally visible methods.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2360.json",
    "content": "{\n  \"title\": \"Optional parameters should not be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-2360\",\n  \"sqKey\": \"S2360\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2362.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Shared coding conventions allow teams to collaborate efficiently. This rule checks that all <code>Private Const</code> field names comply with the\nprovided regular expression.</p>\n<p>The default configuration is:</p>\n<ul>\n  <li>Optionally, can start with an underscore character or \"s_\", e.g. <code>_foo</code>, <code>s_foo</code></li>\n  <li>Camel casing, starting with a lower case character, e.g. backColor</li>\n  <li>Short abbreviations of 2 letters can be capitalized only when not at the beginning, e.g. \"id\" in productID</li>\n  <li>Longer abbreviations need to be lower cased, e.g. html</li>\n</ul>\n<h3>Noncompliant code example</h3>\n<p>With the default regular expression <code>^(s_|_)?[a-z][a-z0-9]*([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?$</code>:</p>\n<pre>\nModule Module1\n    Private Const Foo = 0  ' Noncompliant\nEnd Module\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nModule Module1\n    Private Const foo = 0  ' Compliant\nEnd Module\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2362.json",
    "content": "{\n  \"title\": \"Private constants should comply with a naming convention\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2362\",\n  \"sqKey\": \"S2362\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2363.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Shared coding conventions allow teams to collaborate efficiently. This rule checks that all <code>Private Shared ReadOnly</code> field names comply\nwith the provided regular expression.</p>\n<p>The default configuration is:</p>\n<ul>\n  <li>Optionally, can start with an underscore character or \"s_\", e.g. <code>_foo</code>, <code>s_foo</code></li>\n  <li>Camel casing, starting with a lower case character, e.g. backColor</li>\n  <li>Short abbreviations of 2 letters can be capitalized only when not at the beginning, e.g. \"id\" in productID</li>\n  <li>Longer abbreviations need to be lower cased, e.g. html</li>\n</ul>\n<h3>Noncompliant code example</h3>\n<p>With the default regular expression <code>^(s_|_)?[a-z][a-z0-9]*([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?$</code>:</p>\n<pre>\nClass Foo\n    Private Shared ReadOnly Foo As Integer  ' Noncompliant\nEnd Class\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nClass Foo\n    Private Shared ReadOnly foo As Integer  ' Compliant\nEnd Class\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2363.json",
    "content": "{\n  \"title\": \"\\\"Private Shared ReadOnly\\\" fields should comply with a naming convention\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2363\",\n  \"sqKey\": \"S2363\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2364.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Shared coding conventions allow teams to collaborate efficiently. This rule checks that all <code>Private</code> field names match the provided\nregular expression.</p>\n<p>Note that this rule does not apply to <code>Private Shared ReadOnly</code> fields, which are checked by another rule.</p>\n<p>The default configuration is:</p>\n<ul>\n  <li>Optionally, can start with an underscore character or \"s_\", e.g. <code>_foo</code>, <code>s_foo</code></li>\n  <li>Camel casing, starting with a lower case character, e.g. backColor</li>\n  <li>Short abbreviations of 2 letters can be capitalized only when not at the beginning, e.g. \"id\" in productID</li>\n  <li>Longer abbreviations need to be lower cased, e.g. html</li>\n</ul>\n<h3>Noncompliant code example</h3>\n<p>With the default regular expression <code>^(s_|_)?[a-z][a-z0-9]*([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?$</code>:</p>\n<pre>\nClass Foo\n    Private Foo As Integer  ' Noncompliant\nEnd Class\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nClass Foo\n    Private foo As Integer  ' Compliant\nEnd Class\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2364.json",
    "content": "{\n  \"title\": \"\\\"Private\\\" fields should comply with a naming convention\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2364\",\n  \"sqKey\": \"S2364\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2365.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Most developers expect property access to be as efficient as field access. However, if a property returns a copy of an array or collection, it will\nbe much slower than a simple field access, contrary to the caller’s likely expectations. Therefore, such properties should be refactored into methods\nso that callers are not surprised by the unexpectedly poor performance.</p>\n<p>This rule tracks calls to the following methods inside properties:</p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.tolist\">Enumerable.ToList</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.toarray\">Enumerable.ToArray</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.array.clone\">Array.Clone</a></li>\n</ul>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nPrivate fFoo As New List(Of String) From {\"a\", \"b\", \"c\"}\nPrivate fBar As String() = {\"a\", \"b\", \"c\"}\n\nPublic ReadOnly Property Foo() As IEnumerable(Of String) ' Noncompliant: collection fFoo is copied\n    Get\n        Return fFoo.ToList()\n    End Get\nEnd Property\n\nPublic ReadOnly Property Bar() As IEnumerable(Of String) ' Noncompliant: array fBar is copied\n    Get\n        Return DirectCast(fBar.Clone(), String())\n    End Get\nEnd Property\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nPrivate fFoo As New List(Of String) From {\"a\", \"b\", \"c\"}\nPrivate fBar As String() = {\"a\", \"b\", \"c\"}\n\nPublic Function GetFoo() As IEnumerable(Of String)\n    Return fFoo.ToList()\nEnd Function\n\nPublic Function GetBar() As IEnumerable(Of String)\n    Return DirectCast(fBar.Clone(), String())\nEnd Function\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/properties\">Properties (Visual Basic)</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/objects-and-classes/#fields-and-properties\">Fields\n  and properties</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/programming-guide/concepts/collections\">Collections (Visual Basic)</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2365.json",
    "content": "{\n  \"title\": \"Properties should not make collection or array copies\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"api-design\",\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-2365\",\n  \"sqKey\": \"S2365\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2366.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Shared coding conventions allow teams to collaborate efficiently. This rule checks that property names match a provided regular expression.</p>\n<p>The default configuration is the one recommended by Microsoft:</p>\n<ul>\n  <li>Pascal casing, starting with an upper case character, e.g. BackColor</li>\n  <li>Short abbreviations of 2 letters can be capitalized, e.g. GetID</li>\n  <li>Longer abbreviations need to be lower cased, e.g. GetHtml</li>\n</ul>\n<h3>Noncompliant code example</h3>\n<p>With the default regular expression <code>^([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?$</code>:</p>\n<pre>\nModule Module1\n    Public Property foo As Integer   ' Noncompliant\nEnd Module\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nModule Module1\n    Public Property Foo As Integer   ' Compliant\nEnd Module\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2366.json",
    "content": "{\n  \"title\": \"Properties should comply with a naming convention\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2366\",\n  \"sqKey\": \"S2366\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2367.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Shared coding conventions allow teams to collaborate efficiently. This rule checks that all non-private <code>Const</code> field names comply with\nthe provided regular expression.</p>\n<p>The default configuration is the one recommended by Microsoft:</p>\n<ul>\n  <li>Pascal casing, starting with an upper case character, e.g. BackColor</li>\n  <li>Short abbreviations of 2 letters can be capitalized, e.g. GetID</li>\n  <li>Longer abbreviations need to be lower cased, e.g. GetHtml</li>\n</ul>\n<h3>Noncompliant code example</h3>\n<p>With the default regular expression <code>^([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?$</code>:</p>\n<pre>\nModule Module1\n    Public Const foo = 0  ' Noncompliant\nEnd Module\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nModule Module1\n    Public Const Foo = 0  ' Compliant\nEnd Module\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2367.json",
    "content": "{\n  \"title\": \"Non-private constants should comply with a naming convention\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2367\",\n  \"sqKey\": \"S2367\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2368.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Using <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/arrays/multidimensional-arrays\">multidimensional</a> and <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/arrays/jagged-arrays\">jagged</a> arrays as method parameters in C# can be\nchallenging for developers.</p>\n<p>When these methods are exposed to external users, it requires advanced language knowledge for effective usage.</p>\n<p>Determining the appropriate data to pass to these parameters may not be intuitive.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nPublic Class Program\n    Public Sub WriteMatrix(matrix As Integer()()) ' Noncompliant: data type is not intuitive\n        ' ...\n    End Sub\nEnd Class\n</pre>\n<p>In this example, it cannot be inferred easily what the matrix should look like. Is it a 2x2 Matrix or even a triangular Matrix?</p>\n<p>Using a collection, data structure, or class that provides a more suitable representation of the required data is recommended instead of a\nmultidimensional array or jagged array to enhance code readability.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nPublic Class Matrix2x2\n    ' ...\nEnd Class\n\nPublic Class Program\n    Public Sub WriteMatrix(matrix As Matrix2x2) ' Compliant: data type is intuitive\n        ' ...\n    End Sub\nEnd Class\n</pre>\n<p>As a result, avoiding exposing such methods to external users is recommended.</p>\n<h3>Exceptions</h3>\n<p>However, using multidimensional and jagged array method parameters internally, such as in <code>private</code> or <code>internal</code> methods or\nwithin <code>internal</code> classes, is compliant since they are not publicly exposed.</p>\n<pre>\nPublic Class FirstClass\n    Private Sub UpdateMatrix(matrix As Integer()()) ' Compliant: method is private\n        ' ...\n    End Sub\nEnd Class\n\nFriend Class SecondClass\n    Public Sub UpdateMatrix(matrix As Integer()()) ' Compliant: class is internal\n        ' ...\n    End Sub\nEnd Class\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/collections/\">Collections and Data Structures</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/arrays/\">Arrays in Visual Basic</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/arrays/array-dimensions\">Array Dimensions in\n  Visual Basic</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2368.json",
    "content": "{\n  \"title\": \"Public methods should not have multidimensional array parameters\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1h\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-2368\",\n  \"sqKey\": \"S2368\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2369.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Shared coding conventions allow teams to collaborate efficiently. This rule checks that all non-private fields names match a provided regular\nexpression.</p>\n<p>Note that this rule does not apply to non-private <code>Shared ReadOnly</code> fields, for which there is another rule.</p>\n<p>The default configuration is:</p>\n<ul>\n  <li>Pascal casing, starting with an upper case character, e.g. BackColor</li>\n  <li>Short abbreviations of 2 letters can be capitalized, e.g. GetID</li>\n  <li>Longer abbreviations need to be lower cased, e.g. GetHtml</li>\n</ul>\n<h3>Noncompliant code example</h3>\n<p>With the default regular expression <code>^([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?$</code>:</p>\n<pre>\nClass Foo\n    Public foo As Integer  ' Noncompliant\nEnd Class\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nClass Foo\n    Public Foo As Integer  ' Compliant\nEnd Class\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2369.json",
    "content": "{\n  \"title\": \"Non-private fields should comply with a naming convention\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2369\",\n  \"sqKey\": \"S2369\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2370.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Shared naming conventions allow teams to collaborate efficiently. This rule checks that all non-private <code>Shared ReadOnly</code> fields names\nmatch a provided regular expression.</p>\n<p>The default configuration is:</p>\n<ul>\n  <li>Pascal casing, starting with an upper case character, e.g. BackColor</li>\n  <li>Short abbreviations of 2 letters can be capitalized, e.g. GetID</li>\n  <li>Longer abbreviations need to be lower cased, e.g. GetHtml</li>\n</ul>\n<h3>Noncompliant code example</h3>\n<p>With the default regular expression <code>^([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?$</code>:</p>\n<pre>\nClass Foo\n    Public Shared ReadOnly foo As Integer  ' Noncompliant\nEnd Class\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nClass Foo\n    Public Shared ReadOnly Foo As Integer  ' Compliant\nEnd Class\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2370.json",
    "content": "{\n  \"title\": \"Non-private \\\"Shared ReadOnly\\\" fields should comply with a naming convention\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2370\",\n  \"sqKey\": \"S2370\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2372.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Property getters should be simple operations that are always safe to call. If exceptions need to be thrown, it is best to convert the property to a\nmethod.</p>\n<p>It is valid to throw exceptions from indexed property getters and from property setters, which are not detected by this rule.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nModule Module1\n    Public Property Foo() As Integer\n        Get\n            Throw New Exception  ' Non-Compliant\n        End Get\n        Set(ByVal value As Integer)\n            ' ... some code ...\n        End Set\n    End Property\nEnd Module\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nModule Module1\n    Sub SetFoo(ByVal value As Integer)         ' Compliant\n        ' ... some code ...\n    End Sub\nEnd Module\n</pre>\n<h3>Exceptions</h3>\n<p>No issue is raised when the thrown exception derives from or is of type <code>NotImplementedException</code>, <code>NotSupportedException</code> or\n<code>InvalidOperationException</code>.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2372.json",
    "content": "{\n  \"title\": \"Exceptions should not be thrown from property getters\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"error-handling\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2372\",\n  \"sqKey\": \"S2372\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2373.html",
    "content": "<p>This rule is deprecated; use {rule:vbnet:S119} instead.</p>\n<h2>Why is this an issue?</h2>\n<p>Shared naming conventions allow teams to collaborate efficiently. This rule checks that all generic type parameter names match a provided regular\nexpression.</p>\n<p>The default configuration is the one recommended by Microsoft:</p>\n<ul>\n  <li>Must start with an upper case 'T' character, e.g. T</li>\n  <li>Followed by Pascal casing, starting with an upper case character, e.g. TKey</li>\n  <li>Short abbreviations of 2 letters can be capitalized, e.g. TFooID</li>\n  <li>Longer abbreviations need to be lower cased, e.g. TFooHtml</li>\n</ul>\n<h3>Noncompliant code example</h3>\n<p>With the default parameter value <code>^T(([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?)?$</code>:</p>\n<pre>\nPublic Class Foo(Of t) ' Noncompliant\nEnd Class\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nPublic Class Foo(Of T) ' Compliant\nEnd Class\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2373.json",
    "content": "{\n  \"title\": \"Generic type parameter names should comply with a naming convention\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"deprecated\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2373\",\n  \"sqKey\": \"S2373\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2374.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Unsigned integers have different arithmetic operators than signed ones - operators that few developers understand. Therefore, signed types should\nbe preferred where possible.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nModule Module1\n    Sub Main()\n        Dim foo1 As UShort   ' Noncompliant\n        Dim foo2 As UInteger ' Noncompliant\n        Dim foo3 As ULong    ' Noncompliant\n    End Sub\nEnd Module\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nModule Module1\n    Sub Main()\n        Dim foo1 As Short\n        Dim foo2 As Integer\n        Dim foo3 As Long\n    End Sub\nEnd Module\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2374.json",
    "content": "{\n  \"title\": \"Signed types should be preferred to unsigned ones\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-2374\",\n  \"sqKey\": \"S2374\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2375.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Using the <code>With</code> statement for a series of calls to the same object makes the code more readable.</p>\n<h3>Noncompliant code example</h3>\n<p>With the default value of 6:</p>\n<pre>\nModule Module1\n    Dim product = New With {.Name = \"paperclips\", .RetailPrice = 1.2, .WholesalePrice = 0.6, .A = 0, .B = 0, .C = 0}\n\n    Sub Main()\n        product.Name = \"\"           ' Noncompliant\n        product.RetailPrice = 0\n        product.WholesalePrice = 0\n        product.A = 0\n        product.B = 0\n        product.C = 0\n    End Sub\nEnd Module\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nModule Module1\n    Dim product = New With {.Name = \"paperclips\", .RetailPrice = 1.2, .WholesalePrice = 0.6, .A = 0, .B = 0, .C = 0}\n\n    Sub Main()\n        With product\n            .Name = \"\"\n            .RetailPrice = 0\n            .WholesalePrice = 0\n            .A = 0\n            .B = 0\n            .C = 0\n        End With\n    End Sub\nEnd Module\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2375.json",
    "content": "{\n  \"title\": \"\\\"With\\\" statements should be used for a series of calls to the same object\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2375\",\n  \"sqKey\": \"S2375\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2376.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Properties with only setters are confusing and counterintuitive. Instead, a property getter should be added if possible, or the property should be\nreplaced with a setter method.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nModule Module1\n    WriteOnly Property Foo() As Integer ' Non-Compliant\n        Set(ByVal value As Integer)\n            ' ... some code ...\n        End Set\n    End Property\nEnd Module\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nModule Module1\n    Sub SetFoo(ByVal value As Integer)  ' Compliant\n        ' ... some code ...\n    End Sub\nEnd Module\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2376.json",
    "content": "{\n  \"title\": \"Write-only properties should not be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2376\",\n  \"sqKey\": \"S2376\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2387.html",
    "content": "<p>This rule is deprecated, and will eventually be removed.</p>\n<h2>Why is this an issue?</h2>\n<p>Having a variable with the same name in two unrelated classes is fine, but do the same thing within a class hierarchy and you’ll get confusion at\nbest, chaos at worst.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nPublic Class Fruit\n\n    Protected Ripe As Season\n    Protected Flesh As Color\n\n    ' ...\n\nEnd Class\n\nPublic Class Raspberry\n    Inherits Fruit\n\n    Private Ripe As Boolean         ' Noncompliant\n    Private Shared FLESH As Color   ' Noncompliant\n\n    ' ...\n\nEnd Class\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nPublic Class Fruit\n\n    Protected Ripe As Season\n    Protected Flesh As Color\n\n    ' ...\n\nEnd Class\n\nPublic Class Raspberry\n    Inherits Fruit\n\n    Private Riped As Boolean\n    Private Shared FLESH_COLOR As Color   ' Noncompliant\n\n    ' ...\n\nEnd Class\n</pre>\n<h3>Exceptions</h3>\n<p>This rule ignores same-name fields that are <code>Shared</code> in both the parent and child classes. It also ignores <code>Private</code> parent\nclass fields and fields explicitly declared as <code>Shadows</code>, but in all other such cases, the child class field should be renamed.</p>\n<pre>\nPublic Class Fruit\n\n    Private Ripe As Season\n    Protected Flesh As Color\n\n    ' ...\n\nEnd Class\n\nPublic Class Raspberry\n    Inherits Fruit\n\n    Private Ripe As Season      ' Compliant as parent field 'Ripe' is not visible from Raspberry anyway\n    Protected Shadows Flesh As Color    ' Compliant as the intention is explicitly declared\n\n    ' ...\n\nEnd Class\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2387.json",
    "content": "{\n  \"title\": \"Child class fields should not shadow parent class fields\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"deprecated\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-2387\",\n  \"sqKey\": \"S2387\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2429.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The <code>... = {}</code> syntax is more compact, more readable and less error-prone.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nModule Module1\n  Sub Main()\n    Dim foo(1) As String   ' Noncompliant\n    foo(0) = \"foo\"\n    foo(1) = \"bar\"\n  End Sub\nEnd Module\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nModule Module1\n  Sub Main()\n    Dim foo = {\"foo\", \"bar\"}  ' Compliant\n  End Sub\nEnd Module\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2429.json",
    "content": "{\n  \"title\": \"Arrays should be initialized using the \\\"... \\u003d {}\\\" syntax\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2429\",\n  \"sqKey\": \"S2429\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2437.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Certain <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/operators-and-expressions/logical-and-bitwise-operators#bitwise-operations\">bitwise\noperations</a> are not needed and should not be performed because their results are predictable.</p>\n<p>Specifically, using <code>And -1</code> with any value always results in the original value.</p>\n<p>That is because the binary representation of <code>-1</code> on a <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/data-types/numeric-data-types\">numeric data type</a>\nsupporting negative numbers, such as <code>Integer</code> or <code>Long</code>, is based on <a\nhref=\"https://en.wikipedia.org/wiki/Two%27s_complement\">two’s complement</a> and made of all 1s: <code>&amp;B111…​111</code>.</p>\n<p>Performing <code>And</code> between a value and <code>&amp;B111…​111</code> means applying the <code>And</code> operator to each bit of the value\nand the bit <code>1</code>, resulting in a value equal to the provided one, bit by bit.</p>\n<pre>\nanyValue And -1 ' Noncompliant\nanyValue        ' Compliant\n</pre>\n<p>Similarly, <code>anyValue Or 0</code> always results in <code>anyValue</code>, because the binary representation of <code>0</code> is always\n<code>&amp;B000…​000</code> and the <code>Or</code> operator returns its first input when the second is <code>0</code>.</p>\n<pre>\nanyValue Or 0 ' Noncompliant\nanyValue      ' Compliant\n</pre>\n<p>The same applies to <code>anyValue Xor 0</code>: the <code>Xor</code> operator returns <code>1</code> when its two input bits are different\n(<code>1</code> and <code>0</code> or <code>0</code> and <code>1</code>) and returns <code>0</code> when its two input bits are the same (both\n<code>0</code> or both <code>1</code>). When <code>Xor</code> is applied with <code>0</code>, the result would be <code>1</code> if the other input is\n<code>1</code>, because the two input bits are different, and <code>0</code> if the other input bit is <code>0</code>, because the two input are the\nsame. That results in returning <code>anyValue</code>.</p>\n<pre>\nanyValue Xor 0 ' Noncompliant\nanyValue       ' Compliant\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/bitwise-and-shift-operators\">Bitwise operations (C#\n  reference)</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/operators/and-operator\">And Operator (Visual Basic)</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/operators/or-operator\">Or Operator (Visual Basic)</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/operators/xor-operator\">Xor Operator (Visual Basic)</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/integral-numeric-types\">Integral numeric types (C#\n  reference)</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/data-types/numeric-data-types\">Numeric Data\n  Types (Visual Basic)</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Two%27s_complement\">Two’s complement</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li><a href=\"https://stackoverflow.com/questions/12764670/are-there-any-bitwise-operator-laws\">Stack Overflow - Are there any Bitwise Operator\n  Laws?</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2437.json",
    "content": "{\n  \"title\": \"Unnecessary bit operations should not be performed\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-2437\",\n  \"sqKey\": \"S2437\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2551.html",
    "content": "<p>The instance passed to the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/synclock-statement\"><code>SyncLock</code> statement</a>\nshould be a dedicated private field.</p>\n<h2>Why is this an issue?</h2>\n<p>If the instance representing an exclusively acquired lock is publicly accessible, another thread in another part of the program could accidentally\nattempt to acquire the same lock. This increases the likelihood of <a href=\"https://en.wikipedia.org/wiki/Deadlock\">deadlocks</a>.</p>\n<p>For example, a <code>string</code> should never be used for locking. When a <code>string</code> is <a\nhref=\"https://en.wikipedia.org/wiki/Interning_(computer_science)\">interned</a> by the runtime, it can be shared by multiple threads, breaking the\nlocking mechanism.</p>\n<p>Instead, a dedicated private <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.lock?view=net-9.0\"><code>Lock</code></a> object\ninstance (or <code>object</code> instance, for frameworks before .Net 9) should be used for locking. This minimizes access to the lock instance and\ntherefore prevents accidential lock sharing.</p>\n<p>The following objects are considered potentially prone to accidental lock sharing:</p>\n<ul>\n  <li>a reference to <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/programming-guide/program-structure/me-my-mybase-and-myclass#me\">Me</a>: if the instance\n  is publicly accessible, the lock might be shared</li>\n  <li>a <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.type\">Type</a> object: if the type class is publicly accessible, the lock might\n  be shared</li>\n  <li>a <a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/data-types/string-data-type\">String</a> literal or instance:\n  if any other part of the program uses the same string, the lock is shared because of interning</li>\n</ul>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nPublic Sub MyLockingMethod()\n    SyncLock Me 'Noncompliant\n        ' ...\n    End SyncLock\nEnd Sub\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nPrivate lockObj As New Object()\nPublic Sub MyLockingMethod()\n    SyncLock lockObj\n        ' ...\n    End SyncLock\nEnd Sub\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Thread_(computing)\">Thread</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Lock_(computer_science)\">Locking</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Deadlock\">Deadlock</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Interning_(computer_science)\">Interning</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.intern#remarks\">String interning by the runtime</a></li>\n  <li>Microsoft Learn - <a href=\"https://docs.microsoft.com/en-us/dotnet/standard/threading/managed-threading-best-practices\">Managed Threading Best\n  Practices</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/synclock-statement\">SyncLock\n  Statement</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2551.json",
    "content": "{\n  \"title\": \"Shared resources should not be used for locking\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [\n    \"multi-threading\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-2551\",\n  \"sqKey\": \"S2551\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2583.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Conditional expressions which are always <code>true</code> or <code>false</code> can lead to <a\nhref=\"https://en.wikipedia.org/wiki/Unreachable_code\">unreachable code</a>.</p>\n<p>In the case below, the call of <code>Dispose()</code> never happens.</p>\n<pre>\nDim a = False\n\nIf a Then\n    Dispose() ' Never reached\nEnd If\n</pre>\n<h3>Exceptions</h3>\n<p>This rule will not raise an issue in either of these cases:</p>\n<ul>\n  <li>When the condition is a single <code>const bool</code></li>\n</ul>\n<pre>\nConst debug = False\n'...\nIf debug Then\n    ' Print something\nEnd If\n</pre>\n<ul>\n  <li>When the condition is the literal <code>true</code> or <code>false</code>.</li>\n</ul>\n<p>In these cases, it is obvious the code is as intended.</p>\n<h2>How to fix it</h2>\n<p>The conditions should be reviewed to decide whether:</p>\n<ul>\n  <li>to update the condition or</li>\n  <li>to remove the condition.</li>\n</ul>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nPublic Sub Sample(ByVal b As Boolean)\n    Dim a = False\n    If a Then                   ' Noncompliant: The true branch is never reached\n        DoSomething()           ' Never reached\n    End If\n\n    If Not a OrElse b Then      ' Noncompliant: \"not a\" is always \"True\" and the false branch is never reached\n        DoSomething()\n    Else\n        DoSomethingElse()       ' Never reached\n    End If\n\n    Dim c = \"xxx\"\n    Dim res = If(c, \"value\")    ' Noncompliant: d is always not Nothing, \"value\" is never used\nEnd Sub\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nPublic Sub Sample(ByVal b As Boolean)\n    Dim a = False\n    If Foo(a) Then             ' Condition was updated\n        DoSomething()\n    End If\n\n    If b Then                  ' Parts of the condition were removed.\n        DoSomething()\n    Else\n        DoSomethingElse()\n    End If\n\n    Dim c = \"xxx\"\n    Dim res = c                ' \"value\" was removed\nEnd Sub\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/570\">CWE-570 - Expression is Always False</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/571\">CWE-571 - Expression is Always True</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Unreachable_code\">Unreachable code</a></li>\n</ul>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/operators-and-expressions/logical-and-bitwise-operators\">Logical and Bitwise Operators in Visual Basic</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/operators/null-conditional-operators\">?. and\n  ?() null-conditional operators (Visual Basic)</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/operators/if-operator#if-operator-called-with-two-arguments\">If\n  operator called with two arguments</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2583.json",
    "content": "{\n  \"title\": \"Conditionally executed code should be reachable\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"unused\",\n    \"suspicious\",\n    \"pitfall\",\n    \"symbolic-execution\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2583\",\n  \"sqKey\": \"S2583\",\n  \"scope\": \"All\",\n  \"securityStandards\": {\n    \"CWE\": [\n      489,\n      571,\n      570\n    ]\n  },\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2589.html",
    "content": "<p>Gratuitous boolean expressions are conditions that do not change the evaluation of a program. This issue can indicate logical errors and affect the\ncorrectness of an application, as well as its maintainability.</p>\n<h2>Why is this an issue?</h2>\n<p>Control flow constructs like <code>if</code>-statements allow the programmer to direct the flow of a program depending on a boolean expression.\nHowever, if the condition is always true or always false, only one of the branches will ever be executed. In that case, the control flow construct and\nthe condition no longer serve a purpose; they become <em>gratuitous</em>.</p>\n<h3>What is the potential impact?</h3>\n<p>The presence of gratuitous conditions can indicate a logical error. For example, the programmer <em>intended</em> to have the program branch into\ndifferent paths but made a mistake when formulating the branching condition. In this case, this issue might result in a bug and thus affect the\nreliability of the application. For instance, it might lead to the computation of incorrect results.</p>\n<p>Additionally, gratuitous conditions and control flow constructs introduce unnecessary complexity. The source code becomes harder to understand, and\nthus, the application becomes more difficult to maintain.</p>\n<p>This rule looks for operands of a boolean expression never changing the result of the expression. It also applies to the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/operators/null-conditional-operators\">null conditional operator</a>\nwhen one of the operands always evaluates to <code>Nothing</code>.</p>\n<pre>\nDim d As String = Nothing\nDim v1 = If(d, \"value\")\n</pre>\n<h3>Exceptions</h3>\n<p>This rule will not raise an issue in either of these cases:</p>\n<ul>\n  <li>When the condition is a single <code>Const bool</code></li>\n</ul>\n<pre>\nConst debug = False\n'...\nIf debug Then\n    ' Print something\nEnd If\n</pre>\n<ul>\n  <li>When the condition is the literal <code>True</code> or <code>False</code>.</li>\n</ul>\n<p>In these cases, it is obvious the code is as intended.</p>\n<h2>How to fix it</h2>\n<p>Gratuitous boolean expressions are suspicious and should be carefully removed from the code.</p>\n<p>First, the boolean expression in question should be closely inspected for logical errors. If a mistake was made, it can be corrected so the\ncondition is no longer gratuitous.</p>\n<p>If it becomes apparent that the condition is actually unnecessary, it can be removed. The associated control flow construct (e.g., the\n<code>if</code>-statement containing the condition) will be adapted or even removed, leaving only the necessary branches.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nPublic Sub Sample(ByVal b As Boolean, ByVal c As Boolean)\n    Dim a = True\n    If a Then                  ' Noncompliant: \"a\" is always \"true\"\n        DoSomething()\n    End If\n\n    If b AndAlso a Then        ' Noncompliant: \"a\" is always \"true\"\n        DoSomething()\n    End If\n\n    If c OrElse Not a Then     ' Noncompliant: \"Not a\" is always \"false\"\n        DoSomething()\n    End If\n\n    Dim d As String = Nothing\n    Dim v1 = If(d, \"value\")    ' Noncompliant: \"d\" is always Nothing and v1 is always \"value\".\n    Dim v2 = If(s, d)          ' Noncompliant: \"d\" is always Nothing and v2 is always equal to s.\nEnd Sub\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nPublic Sub Sample(ByVal b As Boolean, ByVal c As Boolean, ByVal s As String)\n    Dim a = IsAllowed()\n    If a Then                   ' Compliant\n        DoSomething()\n    End If\n\n    If b AndAlso a Then         ' Compliant\n        DoSomething()\n    End If\n\n    If c OrElse Not a Then      ' Compliant\n        DoSomething()\n    End If\n\n    Dim d As String = GetStringData()\n    Dim v1 = If(d, \"value\")     ' Compliant\n    Dim v2 = If(s, d)           ' Compliant\nEnd Sub\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/571\">CWE-571 - Expression is Always True</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/570\">CWE-570 - Expression is Always False</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/operators-and-expressions/logical-and-bitwise-operators\">Logical and Bitwise Operators in Visual Basic</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/operators/null-conditional-operators\">?. and\n  ?() null-conditional operators (Visual Basic)</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/operators/null-conditional-operators\">If\n  operator called with two arguments</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2589.json",
    "content": "{\n  \"title\": \"Boolean expressions should not be gratuitous\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"suspicious\",\n    \"redundant\",\n    \"symbolic-execution\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2589\",\n  \"sqKey\": \"S2589\",\n  \"scope\": \"All\",\n  \"securityStandards\": {\n    \"CWE\": [\n      489,\n      571,\n      570\n    ]\n  },\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2612.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>In Windows, \"Everyone\" group is similar and includes all members of the Authenticated Users group as well as the built-in Guest account, and\nseveral other built-in security accounts.</p>\n<p>Granting permissions to this category can lead to unintended access to files or directories that could allow attackers to obtain sensitive\ninformation, disrupt services or elevate privileges.</p>\n<h3>What is the potential impact?</h3>\n<h4>Unauthorized access to sensitive information</h4>\n<p>When file or directory permissions grant access to all users on a system (often represented as \"others\" or \"everyone\" in permission models),\nattackers who gain access to any user account can read sensitive files containing credentials, configuration data, API keys, database passwords,\npersonal information, or proprietary business data. This exposure can lead to data breaches, identity theft, compliance violations, and competitive\ndisadvantage.</p>\n<h4>Service disruption and data corruption</h4>\n<p>Granting write permissions to broad user categories allows any user on the system to modify or delete critical files and directories. Attackers or\ncompromised low-privileged accounts can corrupt application data, modify configuration files to alter system behavior or disrupt services, or delete\nimportant resources, leading to service outages, system instability, data loss, and denial of service.</p>\n<h4>Privilege escalation</h4>\n<p>When executable files or scripts have overly permissive permissions, especially when combined with special permission bits that allow programs to\nexecute with the permissions of the file owner or group rather than the executing user, attackers can replace legitimate executables with malicious\ncode. When these modified files are executed by privileged users or processes, the attacker’s code runs with elevated privileges, potentially enabling\nthem to escalate from a low-privileged account to root or administrator access, install backdoors, or pivot to other systems in the network.</p>\n<h2>How to fix it in .NET Framework</h2>\n<p>Replace the <code>AccessControlType.Allow</code> with <code>AccessControlType.Deny</code> when creating file system access rules for the \"Everyone\"\ngroup. This explicitly denies permissions rather than granting them, ensuring that broad user groups cannot access the file.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nDim unsafeAccessRule = new FileSystemAccessRule(\"Everyone\", FileSystemRights.FullControl, AccessControlType.Allow)\n\nDim fileSecurity = File.GetAccessControl(\"path\")\nfileSecurity.AddAccessRule(unsafeAccessRule) ' Noncompliant\nFile.SetAccessControl(\"fileName\", fileSecurity)\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nDim safeAccessRule = new FileSystemAccessRule(\"Everyone\", FileSystemRights.FullControl, AccessControlType.Deny)\n\nDim fileSecurity = File.GetAccessControl(\"path\")\nfileSecurity.AddAccessRule(safeAccessRule)\nFile.SetAccessControl(\"path\", fileSecurity)\n</pre>\n<h2>How to fix it in .NET</h2>\n<p>Use <code>AccessControlType.Deny</code> instead of <code>AccessControlType.Allow</code> when setting access rules for the \"Everyone\" group. This\nprevents the broad group from having write or full control access to files.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nDim accessRule   = new FileSystemAccessRule(\"Everyone\", FileSystemRights.Write, AccessControlType.Allow)\nDim fileInfo     = new FileInfo(\"path\")\nDim fileSecurity = fileInfo.GetAccessControl()\n\nfileSecurity.SetAccessRule(accessRule) ' Noncompliant\nfileInfo.SetAccessControl(fileSecurity)\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nDim accessRule   = new FileSystemAccessRule(\"Everyone\", FileSystemRights.FullControl, AccessControlType.Deny)\nDim fileInfo     = new FileInfo(\"path\")\nDim fileSecurity = fileInfo.GetAccessControl()\n\nfileSecurity.SetAccessRule(accessRule)\nfileInfo.SetAccessControl(fileSecurity)\n</pre>\n<h2>How to fix it in Mono</h2>\n<p>Avoid setting permissions that grant read, write, or execute access to \"others\" (all users). Instead, restrict permissions to the file owner or\nspecific groups. Use <code>FileAccessPermissions.UserExecute</code> or other restrictive permission flags that limit access to the owner only.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"3\" data-diff-type=\"noncompliant\">\nDim fsEntry = UnixFileSystemInfo.GetFileSystemEntry(\"path\")\nfsEntry.FileAccessPermissions = FileAccessPermissions.OtherReadWriteExecute ' Noncompliant\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"3\" data-diff-type=\"compliant\">\nDim fsEntry = UnixFileSystemInfo.GetFileSystemEntry(\"path\")\nfsEntry.FileAccessPermissions = FileAccessPermissions.UserExecute\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>OWASP File Permission Testing Guide - <a\n  href=\"https://owasp.org/www-project-web-security-testing-guide/latest/4-Web_Application_Security_Testing/02-Configuration_and_Deployment_Management_Testing/09-Test_File_Permission\">OWASP guidance on testing file permissions in web applications</a></li>\n</ul>\n<h3>Standards</h3>\n<ul>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/266\">CWE-266 - Incorrect Privilege Assignment</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/732\">CWE-732 - Incorrect Permission Assignment for Critical Resource</a></li>\n  <li>STIG Viewer - <a href=\"https://stigviewer.com/stigs/application_security_and_development/2024-12-06/finding/V-222430\">Application Security and\n  Development: V-222430</a> - The application must execute without excessive account permissions</li>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A01_2021-Broken_Access_Control/\">Top 10 2021 Category A1 - Broken Access Control</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A04_2021-Insecure_Design/\">Top 10 2021 Category A4 - Insecure Design</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A5_2017-Broken_Access_Control\">Top 10 2017 Category A5 - Broken Access Control -\n  OWASP Top 10 2017</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2612.json",
    "content": "{\n  \"title\": \"File permissions should not be set to world-accessible values\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"former-hotspot\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2612\",\n  \"sqKey\": \"S2612\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      732,\n      266\n    ],\n    \"OWASP\": [\n      \"A5\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A1\",\n      \"A4\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"6.5.8\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"6.2.4\"\n    ],\n    \"ASVS 4.0\": [\n      \"4.3.3\"\n    ],\n    \"STIG ASD_V5R3\": [\n      \"V-222430\"\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2692.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Most checks against an <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.indexof\">IndexOf</a> value compare it with -1 because\n<strong>0 is a valid index</strong>.</p>\n<pre>\nstrings.IndexOf(someString) = -1  ' Test for \"index not found\"\nstrings.IndexOf(someString) &lt; 0   ' Test for \"index not found\"\nstrings.IndexOf(someString) &gt;= 0  ' Test for \"index found\"\n</pre>\n<p>Any checks which look for values <code>&gt; 0</code> ignore the first element, which is likely a bug. If the intent is merely to check the\ninclusion of a value in a <code>String</code>, <code>List</code>, or array, consider using the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.contains\">Contains</a> method instead.</p>\n<pre>\nstrings.Contains(someString) ' Boolean result\n</pre>\n<p>This rule raises an issue when the output value of any of the following methods is tested against <code>&gt; 0</code>:</p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.ilist.indexof\">IndexOf</a>, applied to <code>String</code>, list or\n  array</li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.indexofany\">IndexOfAny</a>, applied to a <code>String</code></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.lastindexof\">LastIndexOf</a>, applied to a <code>String</code>, list or\n  array</li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.lastindexofany\">LastIndexOfAny</a>, applied to a <code>String</code></li>\n</ul>\n<pre>\nsomeArray.IndexOf(someItem) &gt; 0        ' Noncompliant: index 0 missing\nsomeString.IndexOfAny(charsArray) &gt; 0  ' Noncompliant: index 0 missing\nsomeList.LastIndexOf(someItem) &gt; 0     ' Noncompliant: index 0 missing\nsomeString.LastIndexOf(charsArray) &gt; 0 ' Noncompliant: index 0 missing\n</pre>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nDim Color As String = \"blue\"\nDim Name As String = \"ishmael\"\n\nDim Strings As New List(Of String)\nStrings.Add(Color)\nStrings.Add(Name)\nDim StringArray As String() = Strings.ToArray()\n\nIf Strings.IndexOf(Color) &gt; 0 Then ' Noncompliant\n  ' ...\nEnd If\n\nIf Name.IndexOf(\"ish\") &gt; 0 Then ' Noncompliant\n  ' ...\nEnd If\n\nIf Name.IndexOf(\"ae\") &gt; 0 Then ' Noncompliant\n  ' ...\nEnd If\n\nIf Array.IndexOf(StringArray, Color) &gt; 0 Then ' Noncompliant\n  ' ...\nEnd If\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nDim Color As String = \"blue\"\nDim Name As String = \"ishmael\"\n\nDim Strings As New List(Of String)\nStrings.Add(Color)\nStrings.Add(Name)\nDim StringArray As String() = Strings.ToArray()\n\nIf Strings.IndexOf(Color) &gt; -1 Then\n  ' ...\nEnd If\n\nIf Name.IndexOf(\"ish\") &gt;= 0 Then\n  ' ...\nEnd If\n\nIf Name.Contains(\"ae\") Then\n  ' ...\nEnd If\n\nIf Array.IndexOf(StringArray, Color) &gt;= 0 Then\n  ' ...\nEnd If\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.contains\">String.Contains Method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.indexofany\">String.IndexOfAny Method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.lastindexof\">String.LastIndexOf Method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.lastindexofany\">String.LastIndexOfAny Method</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2692.json",
    "content": "{\n  \"title\": \"\\\"IndexOf\\\" checks should not be for positive numbers\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-2692\",\n  \"sqKey\": \"S2692\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2737.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>A <code>Catch</code> clause that only rethrows the caught exception has the same effect as omitting the <code>Catch</code> altogether and letting\nit bubble up automatically.</p>\n<pre>\nDim s As String = \"\"\nTry\n    s = File.ReadAllText(fileName)\nCatch e As Exception\n    Throw\nEnd Try\n</pre>\n<p>Such clauses should either be removed or populated with the appropriate logic.</p>\n<pre>\nDim s As String = File.ReadAllText(fileName)\n</pre>\n<p>or</p>\n<pre>\nDim s As String = \"\"\nTry\n    s = File.ReadAllText(fileName)\nCatch e As Exception\n    logger.LogError(e)\n    Throw\nEnd Try\n</pre>\n<h3>Exceptions</h3>\n<p>This rule will not generate issues for <code>Catch</code> blocks if they are followed by a <code>Catch</code> block for a more general exception\ntype that does more than just rethrowing the exception.</p>\n<pre>\nDim s As String = \"\"\nTry\n    s = File.ReadAllText(fileName)\nCatch e As IOException 'Compliant by exception: removing it would change the logic\n    Throw\nCatch e As Exception 'Compliant: does more than just rethrow\n    logger.LogError(e)\n    Throw\nEnd Try\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2737.json",
    "content": "{\n  \"title\": \"\\\"catch\\\" clauses should do more than rethrow\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"error-handling\",\n    \"unused\",\n    \"finding\",\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2737\",\n  \"sqKey\": \"S2737\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2757.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Using operator pairs (<code>=+</code> or <code>=-</code>) that look like reversed single operators (<code>+=</code> or <code>-=</code>) is\nconfusing. They compile and run but do not produce the same result as their mirrored counterpart.</p>\n<pre>\nDim target As Integer = -5\nDim num As Integer = 3\n\ntarget =- num ' Noncompliant: target = -3. Is that the intended behavior?\ntarget =+ num ' Noncompliant: target = 3\n</pre>\n<p>This rule raises an issue when <code>=+</code> or <code>=-</code> are used without any space between the operators and when there is at least one\nwhitespace after.</p>\n<p>Replace the operators with a single one if that is the intention</p>\n<pre>\nDim num As Integer = 3\n\ntarget -= num  ' target = -8\n</pre>\n<p>Or fix the spacing to avoid confusion</p>\n<pre>\nDim num As Integer = 3\n\ntarget = -num  // target = -3\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2757.json",
    "content": "{\n  \"title\": \"Non-existent operators like \\\"\\u003d+\\\" should not be used\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2757\",\n  \"sqKey\": \"S2757\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2761.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The repetition of the <code>Not</code> operator is usually a typo. The second operator invalidates the first one:</p>\n<pre>\nDim b As Boolean = False\nDim c As Boolean = Not Not b 'Noncompliant: equivalent to \"b\"\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2761.json",
    "content": "{\n  \"title\": \"\\u0027Not\\u0027 boolean operator should not be repeated\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2761\",\n  \"sqKey\": \"S2761\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2925.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Using <code>Thread.Sleep</code> in a test might introduce unpredictable and inconsistent results depending on the environment. Furthermore, it will\nblock the <a href=\"https://en.wikipedia.org/wiki/Thread_(computing)\">thread</a>, which means the system resources are not being fully used.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\n&lt;TestMethod&gt;\nPublic Sub SomeTest()\n    Threading.Thread.Sleep(500) ' Noncompliant\n    ' assertions...\nEnd Sub\n</pre>\n<p>An alternative is a task-based asynchronous approach, using <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/csharp/asynchronous-programming/\">async and await</a>.</p>\n<p>More specifically the <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task.delay\">Task.Delay</a> method should be\nused, because of the following advantages:</p>\n<ul>\n  <li>It is <strong>asynchronous</strong>: The thread will not be blocked, but instead will be reused by other operations</li>\n  <li>It is more <strong>precise</strong> in timing the delay than <code>Thread.Sleep</code></li>\n  <li>It can be <strong>canceled and continued</strong>, which gives more flexibility and control in the timing of your code</li>\n</ul>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n&lt;TestMethod&gt;\nPublic Async Function SomeTest() As Task\n    Await Task.Delay(500)\n    ' assertions...\nEnd Function\n</pre>\n<p>Another scenario is when some data might need to be mocked using <a href=\"https://github.com/moq/moq4\">Moq</a>, and a delay needs to be\nintroduced:</p>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\n&lt;TestMethod&gt;\nPublic Sub UserService_Test()\n    Dim UserService As New Mock(Of UserService)\n    Dim Expected As New User\n    UserService.Setup(Function(X) X.GetUserById(42)).Returns(\n        Function()\n            Threading.Thread.Sleep(500) ' Noncompliant\n            Return Task.FromResult(Expected)\n        End Function)\n    ' assertions...\nEnd Sub\n</pre>\n<p>An alternative to <code>Thread.Sleep</code> while mocking with <code>Moq</code> is to use <code>ReturnsAsync</code> and pass the amount of time to\ndelay there:</p>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\n&lt;TestMethod&gt;\nPublic Sub UserService_Test()\n    Dim UserService As New Mock(Of UserService)\n    Dim Expected As New User\n    UserService.Setup(Function(X) X.GetUserById(42)).ReturnsAsync(Expected, TimeSpan.FromMilliseconds(500))\n    ' assertions...\nEnd Sub\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.thread.sleep\">Thread.Sleep method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task.delay\">Task.Delay method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/asynchronous-programming/\">Asynchronous programming with async and await</a></li>\n  <li><a href=\"https://github.com/moq/moq4\">Moq mocking library</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2925.json",
    "content": "{\n  \"title\": \"\\\"Thread.Sleep\\\" should not be used in tests\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"tests\",\n    \"bad-practice\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-2925\",\n  \"sqKey\": \"S2925\",\n  \"scope\": \"Tests\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2951.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Visual Basic .NET, unlike many other programming languages, has no \"fall-through\" for its <code>Select</code> cases. Each case already has an\nimplicit <code>Exit Select</code> as its last instruction. It therefore is redundant to explicitly add one.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nModule Module1\n  Sub Main()\n    Dim x = 0\n    Select Case x\n      Case 0\n        Console.WriteLine(\"0\")\n        Exit Select                ' Noncompliant\n      Case Else\n        Console.WriteLine(\"Not 0\")\n        Exit Select                ' Noncompliant\n    End Select\n  End Sub\nEnd Module\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nModule Module1\n  Sub Main()\n    Dim x = 0\n    Select Case x\n      Case 0                         ' Compliant\n        Console.WriteLine(\"0\")\n      Case Else                      ' Compliant\n        Console.WriteLine(\"Not 0\")\n    End Select\n  End Sub\nEnd Module\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S2951.json",
    "content": "{\n  \"title\": \"\\\"Exit Select\\\" statements should not be used redundantly\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"unused\",\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-2951\",\n  \"sqKey\": \"S2951\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3011.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Altering or bypassing the accessibility of classes, methods, or fields through reflection violates the encapsulation principle. This can break the\ninternal contracts of the accessed target and lead to maintainability issues and runtime errors.</p>\n<p>This rule raises an issue when reflection is used to change the visibility of a class, method or field, and when it is used to directly update a\nfield value.</p>\n<pre>\nImports System.Reflection\n\nDim dynClass = Type.GetType(\"MyInternalClass\")\n' Sensitive. Using BindingFlags.NonPublic will return non-public members\nDim bindingAttr As BindingFlags = BindingFlags.NonPublic Or BindingFlags.Static\nDim dynMethod As MethodInfo = dynClass.GetMethod(\"mymethod\", bindingAttr)\nDim result = dynMethod.Invoke(dynClass, Nothing)\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Encapsulation_(computer_programming)\">Wikipedia definition of Encapsulation</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3011.json",
    "content": "{\n  \"title\": \"Reflection should not be used to increase accessibility of classes, methods, or fields\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"MODULAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3011\",\n  \"sqKey\": \"S3011\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3063.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><code>StringBuilder</code> instances that never build a <code>string</code> clutter the code and worse are a drag on performance. Either they\nshould be removed, or the missing <code>ToString()</code> call should be added.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nPublic Sub DoSomething(ByVal strings As List(Of String))\n    Dim sb As StringBuilder = New StringBuilder() ' Noncompliant\n    sb.Append(\"Got: \")\n\n    For Each str As String In strings\n        sb.Append(str).Append(\", \")\n    Next\nEnd Sub\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nPublic Sub DoSomething(ByVal strings As List(Of String))\n    For Each str As String In strings\n    Next\nEnd Sub\n</pre>\n<p>or</p>\n<pre>\nPublic Sub DoSomething(ByVal strings As List(Of String))\n    Dim sb As StringBuilder = New StringBuilder()\n    sb.Append(\"Got: \")\n\n    For Each str As String In strings\n        sb.Append(str).Append(\", \")\n    Next\n\n    My.Application.Log.WriteEntry(sb.ToString())\nEnd Sub\n</pre>\n<h3>Exceptions</h3>\n<p>No issue is reported when <code>StringBuilder</code> is:</p>\n<ul>\n  <li>Accessed through <code>sb.CopyTo()</code>, <code>sb.GetChunks()</code>, <code>sb.Length</code>, or <code>sb(index)</code>.</li>\n  <li>Passed as a method argument, on the grounds that it will likely be accessed through a <code>ToString()</code> invocation there.</li>\n  <li>Passed in as a parameter to the current method, on the grounds that the callee will materialize the string.</li>\n  <li>Retrieved by a custom function (<code>Dim sb As StringBuilder = GetStringBuilder()</code>).</li>\n  <li>Returned by the method.</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3063.json",
    "content": "{\n  \"title\": \"\\\"StringBuilder\\\" data should be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3063\",\n  \"sqKey\": \"S3063\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3329.html",
    "content": "<p>This vulnerability exposes encrypted data to a number of attacks whose goal is to recover the plaintext.</p>\n<h2>Why is this an issue?</h2>\n<p>Encryption algorithms are essential for protecting sensitive information and ensuring secure communications in a variety of domains. They are used\nfor several important reasons:</p>\n<ul>\n  <li>Confidentiality, privacy, and intellectual property protection</li>\n  <li>Security during transmission or on storage devices</li>\n  <li>Data integrity, general trust, and authentication</li>\n</ul>\n<p>When selecting encryption algorithms, tools, or combinations, you should also consider two things:</p>\n<ol>\n  <li>No encryption is unbreakable.</li>\n  <li>The strength of an encryption algorithm is usually measured by the effort required to crack it within a reasonable time frame.</li>\n</ol>\n<p>In the mode Cipher Block Chaining (CBC), each block is used as cryptographic input for the next block. For this reason, the first block requires an\ninitialization vector (IV), also called a \"starting variable\" (SV).</p>\n<p>If the same IV is used for multiple encryption sessions or messages, each new encryption of the same plaintext input would always produce the same\nciphertext output. This may allow an attacker to detect patterns in the ciphertext.</p>\n<h3>What is the potential impact?</h3>\n<p>After retrieving encrypted data and performing cryptographic attacks on it on a given timeframe, attackers can recover the plaintext that\nencryption was supposed to protect.</p>\n<p>Depending on the recovered data, the impact may vary.</p>\n<p>Below are some real-world scenarios that illustrate the potential impact of an attacker exploiting the vulnerability.</p>\n<h4>Additional attack surface</h4>\n<p>By modifying the plaintext of the encrypted message, an attacker may be able to trigger additional vulnerabilities in the code. An attacker can\nfurther exploit a system to obtain more information.\n  <br>\n  Encrypted values are often considered trustworthy because it would not be possible for a third party to modify them under normal circumstances.</p>\n<h4>Breach of confidentiality and privacy</h4>\n<p>When encrypted data contains personal or sensitive information, its retrieval by an attacker can lead to privacy violations, identity theft,\nfinancial loss, reputational damage, or unauthorized access to confidential systems.</p>\n<p>In this scenario, a company, its employees, users, and partners could be seriously affected.</p>\n<p>The impact is twofold, as data breaches and exposure of encrypted data can undermine trust in the organization, as customers, clients and\nstakeholders may lose confidence in the organization’s ability to protect their sensitive data.</p>\n<h4>Legal and compliance issues</h4>\n<p>In many industries and locations, there are legal and compliance requirements to protect sensitive data. If encrypted data is compromised and the\nplaintext can be recovered, companies face legal consequences, penalties, or violations of privacy laws.</p>\n<h2>How to fix it in .NET</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nImports System.IO\nImports System.Security.Cryptography\n\nPublic Sub Encrypt(key As Byte(), dataToEncrypt As Byte(), target As MemoryStream)\n    Dim aes = New AesCryptoServiceProvider()\n\n    Dim iv = New Byte() {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}\n    Dim encryptor = aes.CreateEncryptor(key, iv) ' Noncompliant\n\n    Dim cryptoStream = New CryptoStream(target, encryptor, CryptoStreamMode.Write)\n    Dim swEncrypt = New StreamWriter(cryptoStream)\n\n    swEncrypt.Write(dataToEncrypt)\nEnd Sub\n</pre>\n<h4>Compliant solution</h4>\n<p>In this example, the code implicitly uses a number generator that is considered <strong>strong</strong>, thanks to <code>aes.IV</code>.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nImports System.IO\nImports System.Security.Cryptography\n\nPublic Sub Encrypt(key As Byte(), dataToEncrypt As Byte(), target As MemoryStream)\n    Dim aes = New AesCryptoServiceProvider()\n\n    Dim encryptor = aes.CreateEncryptor(key, aes.IV)\n\n    Dim cryptoStream = New CryptoStream(target, encryptor, CryptoStreamMode.Write)\n    Dim swEncrypt = New StreamWriter(cryptoStream)\n\n    swEncrypt.Write(dataToEncrypt)\nEnd Sub\n</pre>\n<h3>How does this work?</h3>\n<h4>Use unique IVs</h4>\n<p>To ensure high security, initialization vectors must meet two important criteria:</p>\n<ul>\n  <li>IVs must be unique for each encryption operation.</li>\n  <li>For CBC and CFB modes, a secure FIPS-compliant random number generator should be used to generate unpredictable IVs.</li>\n</ul>\n<p>The IV does not need be secret, so the IV or information sufficient to determine the IV may be transmitted along with the ciphertext.</p>\n<p>In the previous non-compliant example, the problem is not that the IV is hard-coded.\n  <br>\n  It is that the same IV is used for multiple encryption attempts.</p>\n<h2>Resources</h2>\n<h3>Standards</h3>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A02_2021-Cryptographic_Failures/\">Top 10 2021 Category A2 - Cryptographic Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure\">Top 10 2017 Category A3 - Sensitive Data\n  Exposure</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A6_2017-Security_Misconfiguration\">Top 10 2017 Category A6 - Security\n  Misconfiguration</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/329\">CWE-329 - Not Using an Unpredictable IV with CBC Mode</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/780\">CWE-780 - Use of RSA Algorithm without OAEP</a></li>\n  <li><a href=\"https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38a.pdf\">NIST, SP-800-38A</a> - Recommendation for Block Cipher\n  Modes of Operation</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3329.json",
    "content": "{\n  \"title\": \"Cipher Block Chaining IVs should be unpredictable\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"HIGH\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"symbolic-execution\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-3329\",\n  \"sqKey\": \"S3329\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      327,\n      780\n    ],\n    \"OWASP\": [\n      \"A6\",\n      \"A3\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A2\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"4.1\",\n      \"6.5.3\",\n      \"6.5.4\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"4.2.1\",\n      \"6.2.4\"\n    ],\n    \"ASVS 4.0\": [\n      \"2.9.3\",\n      \"6.2.2\",\n      \"8.3.7\"\n    ]\n  },\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3358.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Nested ternaries are hard to read and can make the order of operations complex to understand.</p>\n<pre>\nPublic Function GetReadableStatus(job As Job) As String\n    Return If(job.IsRunning, \"Running\", If(job.HasErrors, \"Failed\", \"Succeeded\")) ' Noncompliant\nEnd Function\n</pre>\n<p>Instead, use another line to express the nested operation in a separate statement.</p>\n<pre>\nPublic Function GetReadableStatus(job As Job) As String\n    If job.IsRunning Then Return \"Running\"\n    Return If(job.HasErrors, \"Failed\", \"Succeeded\")\nEnd Function\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3358.json",
    "content": "{\n  \"title\": \"If operators should not be nested\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"confusing\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3358\",\n  \"sqKey\": \"S3358\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3363.html",
    "content": "<p>You should only set a property of a temporal type (like <code>DateTime</code> or <code>DateTimeOffset</code>) as the primary key of a table if the\nvalues are guaranteed to be unique.</p>\n<h2>Why is this an issue?</h2>\n<p>Using temporal types as the primary key of a table is risky. When these types are used as primary keys, it usually means that each new key is\ncreated with the use of <code>.Now</code> or <code>.UtcNow</code> properties from <code>DateTime</code> and <code>DateTimeOffset</code> classes. In\nthose cases, duplicate keys exceptions may occur in many ways:</p>\n<ul>\n  <li>when entries are added consecutively by a machine with low-enough system clock resolution;</li>\n  <li>when two different threads are inserting entries in close enough sequence for both to have the same time;</li>\n  <li>when changes such as daylight saving time (DST) transitions occur, where values can be repeated the following hour (only for\n  <code>DateTime</code> type);</li>\n</ul>\n<p>The rule raises an issue if:</p>\n<ul>\n  <li>Entity Framework, or Entity Framework Core dependencies are found;</li>\n  <li>a class contains a property either named <code>Id</code>, <code>&lt;type name&gt;Id</code> or decorated by the <code>[Key]</code> or\n  <code>[PrimaryKey]</code> attribute.</li>\n  <li>the key property is of one of the following types:\n    <ul>\n      <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetime\">System.DateTime</a></li>\n      <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetimeoffset\">System.DateTimeOffset</a></li>\n      <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.timespan\">System.TimeSpan</a></li>\n      <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.dateonly\">System.DateOnly</a></li>\n      <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.timeonly\">System.TimeOnly</a></li>\n    </ul></li>\n</ul>\n<h2>How to fix it</h2>\n<p>Either use a GUID or the auto generated ID as a primary key.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nPublic Class Account\n    Public Property Id As DateTime\n\n    Public Property Name As String\n    Public Property Surname As String\nEnd Class\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nPublic Class Account\n    Public Property Id As Guid\n\n    Public Property Name As String\n    Public Property Surname As String\nEnd Class\n</pre>\n<p>or</p>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nPublic Class Person\n    &lt;Key&gt;\n    Public Property PersonIdentifier As DateTime\n\n    Public Property Name As String\n    Public Property Surname As String\nEnd Class\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nPublic Class Person\n    &lt;Key&gt;\n    Public Property PersonIdentifier As Guid\n\n    Public Property Name As String\n    Public Property Surname As String\nEnd Class\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/ef/core/modeling/keys?tabs=data-annotations\">Entity Framework keys and data annotation</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.guid\">GUID</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3363.json",
    "content": "{\n  \"title\": \"Date and time should not be used as a type for primary keys\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"LOW\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3363\",\n  \"sqKey\": \"S3363\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3385.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><code>Exit Function</code>, <code>Exit Property</code>, and <code>Exit Sub</code> are all poor, less-readable substitutes for a simple\n<code>Return</code>, and if used with code that should return a value (<code>Exit Function</code> and in some cases <code>Exit Property</code>) they\ncould result in a <code>NullReferenceException</code>.</p>\n<p>This rule raises an issue for all their usages.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nPublic Class Sample\n\n  Public Sub MySub(Condition As Boolean)\n    If Condition Then Exit Sub                  ' Noncompliant\n    ' ...\n  End Sub\n\n  Public Function MyFunction(Condition As Boolean) As Integer\n    If Condition Then\n        MyFunction = 42\n        Exit Function              ' Noncompliant\n    End If\n    ' ...\n  End Function\n\nEnd Class\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nPublic Class Sample\n\n  Public Sub MySub(Condition As Boolean)\n    If Condition Then Return                  ' Noncompliant\n    ' ...\n  End Sub\n\n  Public Function MyFunction(Condition As Boolean) As Integer\n    If Condition Then Return 42\n    ' ...\n  End Function\n\nEnd Class\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3385.json",
    "content": "{\n  \"title\": \"\\\"Exit\\\" statements should not be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"brain-overload\",\n    \"bad-practice\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3385\",\n  \"sqKey\": \"S3385\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3431.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>It should be clear to a casual reader what code a test is testing and what results are expected. Unfortunately, that’s not usually the case with\nthe <code>ExpectedException</code> attribute since an exception could be thrown from almost any line in the method.</p>\n<p>This rule detects MSTest and NUnit <code>ExpectedException</code> attribute.</p>\n<h3>Exceptions</h3>\n<p>This rule ignores:</p>\n<ul>\n  <li>single-line tests, since it is obvious in such methods where the exception is expected to be thrown</li>\n  <li>tests when it tests control flow and assertion are present in either a <code>Catch</code> or <code>Finally</code> clause</li>\n</ul>\n<pre>\n&lt;TestMethod&gt;\n&lt;ExpectedException(GetType(InvalidOperationException))&gt;\nPublic Sub UsingTest()\n    Console.ForegroundColor = ConsoleColor.Black\n    Try\n        Using alert As New ConsoleAlert()\n            Assert.AreEqual(ConsoleColor.Red, Console.ForegroundColor)\n            Throw New InvalidOperationException()\n        End Using\n    Finally\n        Assert.AreEqual(ConsoleColor.Black, Console.ForegroundColor) ' The exception itself is not relevant for the test.\n    End Try\nEnd Sub\n\nPublic NotInheritable Class ConsoleAlert\n    Implements IDisposable\n\n    Private ReadOnly previous As ConsoleColor\n\n    Public Sub New()\n        previous = Console.ForegroundColor\n        Console.ForegroundColor = ConsoleColor.Red\n    End Sub\n\n    Public Sub Dispose() Implements IDisposable.Dispose\n        Console.ForegroundColor = previous\n    End Sub\nEnd Class\n</pre>\n<h2>How to fix it in MSTest</h2>\n<p>Remove the <code>ExpectedException</code> attribute in favor of using the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.visualstudio.testtools.unittesting.assert.throwsexception\">Assert.ThrowsException</a>\nassertion.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\n&lt;TestMethod&gt;\n&lt;ExpectedException(GetType(ArgumentNullException))&gt;  ' Noncompliant\nPublic Sub Method_NullParam()\n    Dim sut As New MyService()\n    sut.Method(Nothing)\nEnd Sub\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n&lt;TestMethod&gt;\nPublic Sub Method_NullParam()\n    Dim sut As New MyService()\n    Assert.ThrowsException(Of ArgumentNullException)(Sub() sut.Method(Nothing))\nEnd Sub\n</pre>\n<h2>How to fix it in NUnit</h2>\n<p>Remove the <code>ExpectedException</code> attribute in favor of using the <a\nhref=\"https://docs.nunit.org/articles/nunit/writing-tests/assertions/classic-assertions/Assert.Throws.html\">Assert.Throws</a> assertion.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\n&lt;Test&gt;\n&lt;ExpectedException(GetType(ArgumentNullException))&gt;  ' Noncompliant\nPublic Sub Method_NullParam()\n    Dim sut As New MyService()\n    sut.Method(Nothing)\nEnd Sub\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\n&lt;Test&gt;\nPublic Sub Method_NullParam()\n    Dim sut As New MyService()\n    Assert.Throws(Of ArgumentNullException)(Sub() sut.Method(Nothing))\nEnd Sub\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.visualstudio.testtools.unittesting.assert.throwsexception\">Assert.ThrowsException\n  Method</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.visualstudio.testtools.unittesting.expectedexceptionattribute\">ExpectedExceptionAttribute Class</a></li>\n  <li>NUnit - <a href=\"https://docs.nunit.org/articles/nunit/writing-tests/assertions/classic-assertions/Assert.Throws.html\">Assert.Throws</a></li>\n  <li>NUnit - <a href=\"https://docs.nunit.org/2.4/exception.html\">ExpectedExceptionAttribute</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3431.json",
    "content": "{\n  \"title\": \"\\\"[ExpectedException]\\\" should not be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"tests\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3431\",\n  \"sqKey\": \"S3431\",\n  \"scope\": \"Tests\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3449.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Numbers can be shifted with the <code>&lt;&lt;</code> and <code>&gt;&gt;</code> <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/operators/bit-shift-operators\">operators</a>, but the right operand of\nthe operation needs to be an <code>int</code> or a type that has an <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/data-types/implicit-and-explicit-conversions\">implicit\nconversion</a> to <code>int</code>. However, when the left operand is an <code>object</code>, the compiler’s type checking is turned off, therfore you\ncan pass anything to the right of a shift operator and have it compile. If the argument can’t be implicitly converted to <code>int</code> at runtime,\na <a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.csharp.runtimebinder.runtimebinderexception\">RuntimeBinderException</a> will be\nraised.</p>\n<pre>\nDim o As Object = 5\nDim x As Integer = 5\n\nx = o &gt;&gt; 5 ' Noncompliant\nx = x &lt;&lt; o ' Noncompliant\n</pre>\n<h3>Exceptions</h3>\n<p>This rule does not raise when the left or the right expression is <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/nothing\">Nothing</a>.</p>\n<pre>\nx = Nothing &gt;&gt; 5\nx = 5 &lt;&lt; Nothing\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/operators/bit-shift-operators\">Bit Shift Operators</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/data-types/implicit-and-explicit-conversions\">Implicit and Explicit Conversions</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.csharp.runtimebinder.runtimebinderexception\">RuntimeBinderException\n  Class</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3449.json",
    "content": "{\n  \"title\": \"Right operands of shift operators should be integers\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-3449\",\n  \"sqKey\": \"S3449\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3453.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When a class has only a <code>private</code> constructor, it can’t be instantiated except within the class itself. Such classes can be considered\n<a href=\"https://en.wikipedia.org/wiki/Dead_code\">dead code</a> and should be fixed</p>\n<h3>Exceptions</h3>\n<ul>\n  <li>Classes that access their private constructors (<a href=\"https://en.wikipedia.org/wiki/Singleton_pattern\">singletons</a> or <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/architecture/microservices/microservice-ddd-cqrs-patterns/enumeration-classes-over-enum-types\">smart\n  enums</a>) are ignored.</li>\n  <li>Classes with only <code>static</code> members are also ignored because they are covered by Rule {rule:vbnet:S1118}.</li>\n  <li>Classes that derive from <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.safehandle\">SafeHandle</a> since\n  they can be instantiate through <a href=\"https://learn.microsoft.com/en-us/dotnet/standard/native-interop/pinvoke\">P/Invoke</a>.</li>\n</ul>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nPublic Class [MyClass] ' Noncompliant: the class contains only private constructors\n    Private Sub New()\n        ' ...\n    End Sub\nEnd Class\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nPublic Class [MyClass] ' Compliant: the class contains at least one non-private constructor\n    Public Sub New()\n        ' ...\n    End Sub\nEnd Class\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>{rule:vbnet:S1118} - Utility classes should not have public constructors</li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.safehandle\">SafeHandle Class</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/standard/native-interop/pinvoke\">Platform Invoke (P/Invoke)</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/architecture/microservices/microservice-ddd-cqrs-patterns/enumeration-classes-over-enum-types\">Use\n  enumeration classes instead of enum types</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Dead_code\">Dead code</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Singleton_pattern\">Singleton pattern</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3453.json",
    "content": "{\n  \"title\": \"Classes should not have only \\\"private\\\" constructors\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"design\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3453\",\n  \"sqKey\": \"S3453\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3464.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><a href=\"https://en.wikipedia.org/wiki/Recursion\">Recursion</a> is a technique used to define a problem in terms of the problem itself, usually in\nterms of a simpler version of the problem itself.</p>\n<p>For example, the implementation of the generator for the n-th value of the <a href=\"https://en.wikipedia.org/wiki/Fibonacci_sequence\">Fibonacci\nsequence</a> comes naturally from its mathematical definition, when recursion is used:</p>\n<pre>\nFunction NthFibonacciNumber(ByVal n As Integer) As Integer\n    If n &lt;= 1 Then\n        Return 1\n    Else\n        Return NthFibonacciNumber(n - 1) + NthFibonacciNumber(n - 2)\n    End If\nEnd Function\n</pre>\n<p>As opposed to:</p>\n<pre>\nFunction NthFibonacciNumber(ByVal n As Integer) As Integer\n    Dim previous As Integer = 0\n    Dim last As Integer = 1\n\n    For i = 0 To n - 1\n        Dim temp = previous\n        previous = last\n        last = last + temp\n    Next\n\n    Return last\nEnd Function\n</pre>\n<p>The use of recursion is acceptable in methods, like the one above, where you can break out of it.</p>\n<pre>\nFunction NthFibonacciNumber(ByVal n As Integer) As Integer\n    If n &lt;= 1 Then\n        Return 1 ' Base case: stop the recursion\n    End If\n    ' ...\nEnd Function\n</pre>\n<p>It is also acceptable and makes sense in some type definitions:</p>\n<pre>\nClass Box\n    Inherits IComparable(Of Box)\n\n    Public Function CompareTo(ByVal other As Box?) As Integer\n        ' Compare the two Box instances...\n    End Function\nEnd Class\n</pre>\n<p>With types, some invalid recursive definitions are caught by the compiler:</p>\n<pre>\nClass C2(Of T)               ' Error BC31447 C2(Of T) cannot reference itself in Inherits clause\n    Inherits C2(Of T)\nEnd Class\n\nClass C2(Of T)\n    Inherits C2(Of C2(Of T)) ' Error BC31447 C2(Of T) cannot reference itself in Inherits clause\nEnd Class\n</pre>\n<p>In more complex scenarios, however, the code will compile but execution will result in a <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.typeloadexception\">TypeLoadException</a> if you try to instantiate the class.</p>\n<pre>\nClass C1(Of T)\nEnd Class\n\nClass C2(Of T)              ' Noncompliant\n    Inherits C1(Of C2(Of C2(Of T)))\nEnd Class\n\nDim c2 = New C2(Of Integer) ' This would result into a TypeLoadException\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Recursion_(computer_science)\">Recursion</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.typeloadexception\">TypeLoadException</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern\">Curiously recurring template pattern</a></li>\n  <li><a href=\"https://blog.stephencleary.com/2022/09/modern-csharp-techniques-1-curiously-recurring-generic-pattern.html\">Modern C# Techniques, Part\n  1: Curiously Recurring Generic Pattern</a></li>\n  <li><a href=\"https://ericlippert.com/2011/02/02/curiouser-and-curiouser/\">Curiouser and curiouser</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3464.json",
    "content": "{\n  \"title\": \"Type inheritance should not be recursive\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1h\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-3464\",\n  \"sqKey\": \"S3464\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3466.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When optional parameter values are not passed to base method calls, the value passed in by the caller is ignored. This can cause the function to\nbehave differently than expected, leading to errors and making the code difficult to debug.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nPublic Class BaseClass\n    Public Overridable Sub MyMethod(ByVal Optional i As Integer = 1)\n        Console.WriteLine(i)\n    End Sub\nEnd Class\n\nPublic Class DerivedClass\n    Inherits BaseClass\n\n    Public Overrides Sub MyMethod(ByVal Optional i As Integer = 1)\n        ' ...\n        MyBase.MyMethod() ' Noncompliant: caller's value is ignored\n    End Sub\n\n    Private Shared Function Main(ByVal args As String()) As Integer\n        Dim dc As DerivedClass = New DerivedClass()\n        dc.MyMethod(12) ' prints 1\n    End Function\nEnd Class\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nPublic Class BaseClass\n    Public Overridable Sub MyMethod(ByVal Optional i As Integer = 1)\n        Console.WriteLine(i)\n    End Sub\nEnd Class\n\nPublic Class DerivedClass\n    Inherits BaseClass\n\n    Public Overrides Sub MyMethod(ByVal Optional i As Integer = 1)\n        ' ...\n        MyBase.MyMethod(i)\n    End Sub\n\n    Private Shared Function Main(ByVal args As String()) As Integer\n        Dim dc As DerivedClass = New DerivedClass()\n        dc.MyMethod(12) ' prints 12\n    End Function\nEnd Class\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<p>Microsoft Learn - <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/procedures/optional-parameters\">Optional Arguments\n(Visual Basic)</a></p>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3466.json",
    "content": "{\n  \"title\": \"Optional parameters should be passed to \\\"base\\\" calls\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3466\",\n  \"sqKey\": \"S3466\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3598.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When declaring a Windows Communication Foundation (WCF) <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.servicemodel.operationcontractattribute?view=dotnet-plat-ext-7.0\"><code>OperationContract</code></a>\nmethod as <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.servicemodel.operationcontractattribute.isoneway?view=dotnet-plat-ext-7.0\"><code>one-way</code></a>,\nthat service method won’t return any result, not even an underlying empty confirmation message. These are fire-and-forget methods that are useful in\nevent-like communication. Therefore, specifying a return type has no effect and can confuse readers.</p>\n<h3>Exceptions</h3>\n<p>The rule doesn’t report if <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.servicemodel.operationcontractattribute.asyncpattern\"><code>OperationContractAttribute.AsyncPattern</code></a>\nis set to <code>true</code>.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\n&lt;ServiceContract&gt;\nInterface IMyService\n    &lt;OperationContract(IsOneWay:=True)&gt;\n    Function SomethingHappened(ByVal parameter As Integer) As Integer ' Noncompliant\nEnd Interface\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n&lt;ServiceContract&gt;\nInterface IMyService\n    &lt;OperationContract(IsOneWay:=True)&gt;\n    Sub SomethingHappened(ByVal parameter As Integer)\nEnd Interface\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<p>Microsoft Learn - <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.servicemodel.operationcontractattribute\">OperationContractAttribute</a></p>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3598.json",
    "content": "{\n  \"title\": \"One-way \\\"OperationContract\\\" methods should have \\\"void\\\" return type\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3598\",\n  \"sqKey\": \"S3598\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3603.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Marking a method with the <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.contracts.pureattribute\"><code>Pure</code></a>\nattribute indicates that the method doesn’t make any visible state changes. Therefore, a <code>Pure</code> method should return a result. Otherwise,\nit indicates a no-operation call.</p>\n<p>Using <code>Pure</code> on a <code>void</code> method is either by mistake or the method is not doing a meaningful task.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nClass Person\n    Private age As Integer\n\n    &lt;Pure&gt; ' Noncompliant: The method makes a state change\n    Private Sub ConfigureAge(ByVal age As Integer)\n        Me.age = age\n    End Sub\n\n    &lt;Pure&gt;\n    Private Sub WriteAge() ' Noncompliant\n        Console.WriteLine(Me.age)\n    End Sub\n\nEnd Class\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nClass Person\n    Private age As Integer\n\n    Private Sub ConfigureAge(ByVal age As Integer)\n        Me.age = age\n    End Sub\n\n    &lt;Pure&gt;\n    Private Function Age() As Integer\n        Return Me.age\n    End Function\n\n    ' or remove Pure attribute from the method\n\n    Private Sub WriteAge()\n        Console.WriteLine(Me.age)\n    End Sub\n\nEnd Class\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.contracts.pureattribute\">PureAttribute Class</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3603.json",
    "content": "{\n  \"title\": \"Methods with \\\"Pure\\\" attribute should return a value \",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3603\",\n  \"sqKey\": \"S3603\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3655.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.nullable-1\">Nullable value types</a> can hold either a value or\n<code>Nothing</code>.</p>\n<p>The value stored in the nullable type can be accessed with the <code>Value</code> property or by casting it to the underlying type. Still, both\noperations throw an <code>InvalidOperationException</code> when the value is <code>Nothing</code>. A nullable type should always be tested before\naccessing the value to avoid raising exceptions.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nSub Sample(condition As Boolean)\n    Dim nullableValue As Integer? = If(condition, 42, Nothing)\n    Console.WriteLine(nullableValue.Value)             ' Noncompliant: InvalidOperationException is raised\n\n    Dim nullableCast As Integer? = If(condition, 42, Nothing)\n    Console.WriteLine(CType(nullableCast, Integer))    ' Noncompliant: InvalidOperationException is raised\nEnd Sub\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nSub Sample(condition As Boolean)\n    Dim nullableValue As Integer? = If(condition, 42, Nothing)\n    If nullableValue.HasValue Then\n        Console.WriteLine(nullableValue.Value)\n    End If\n\n    Dim nullableCast As Integer? = If(condition, 42, Nothing)\n    If nullableCast.HasValue Then\n        Console.WriteLine(CType(nullableCast, Integer))\n    End If\nEnd Sub\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.nullable-1\">Nullable&lt;T&gt;</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/476\">CWE-476 - NULL Pointer Dereference</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3655.json",
    "content": "{\n  \"title\": \"Empty nullable value should not be accessed\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"symbolic-execution\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3655\",\n  \"sqKey\": \"S3655\",\n  \"scope\": \"All\",\n  \"securityStandards\": {\n    \"CWE\": [\n      476\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3776.html",
    "content": "<p>This rule raises an issue when the code cognitive complexity of a function is above a certain threshold.</p>\n<h2>Why is this an issue?</h2>\n<p>Cognitive Complexity is a measure of how hard it is to understand the control flow of a unit of code. Code with high cognitive complexity is hard\nto read, understand, test, and modify.</p>\n<p>As a rule of thumb, high cognitive complexity is a sign that the code should be refactored into smaller, easier-to-manage pieces.</p>\n<h3>Which syntax in code does impact cognitive complexity score?</h3>\n<p>Here are the core concepts:</p>\n<ul>\n  <li><strong>Cognitive complexity is incremented each time the code breaks the normal linear reading flow.</strong>\n    <br>\n    This concerns, for example, loop structures, conditionals, catches, switches, jumps to labels, and conditions mixing multiple operators.</li>\n  <li><strong>Each nesting level increases complexity.</strong>\n    <br>\n    During code reading, the deeper you go through nested layers, the harder it becomes to keep the context in mind.</li>\n  <li><strong>Method calls are free</strong>\n    <br>\n    A well-picked method name is a summary of multiple lines of code. A reader can first explore a high-level view of what the code is performing then\n    go deeper and deeper by looking at called functions content.\n    <br>\n    <em>Note:</em> This does not apply to recursive calls, those will increment cognitive score.</li>\n</ul>\n<p>The method of computation is fully detailed in the pdf linked in the resources.</p>\n<h3>What is the potential impact?</h3>\n<p>Developers spend more time reading and understanding code than writing it. High cognitive complexity slows down changes and increases the cost of\nmaintenance.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nFunction Abs(ByVal n As Integer) As Integer ' Noncompliant: cognitive complexity = 5\n    If n &gt;= 0 Then    ' +1\n        Return n\n    Else              ' +2, due to nesting\n        If n = Integer.MinValue Then      ' +1\n            Throw New ArgumentException(\"The absolute value of int.MinValue is outside of int boundaries\")\n        Else                              ' +1\n            Return -n\n        End If\n    End If\nEnd Function\n</pre>\n<p>They should be refactored to have lower complexity:</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nFunction Abs(ByVal n As Integer) As Integer  ' Compliant: cognitive complexity = 3\n    If n = Integer.MinValue Then    ' +1\n        Throw New ArgumentException(\"The absolute value of int.MinValue is outside of int boundaries\")\n    Else If n &gt;= 0 Then             ' +1\n        Return n\n    Else                            ' +1\n        Return -n\n    End If\nEnd Function\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Sonar - <a href=\"https://www.sonarsource.com/docs/CognitiveComplexity.pdf\">Cognitive Complexity</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li>Sonar Blog - <a href=\"https://www.sonarsource.com/blog/5-clean-code-tips-for-reducing-cognitive-complexity/\">5 Clean Code Tips for Reducing\n  Cognitive Complexity</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3776.json",
    "content": "{\n  \"title\": \"Cognitive Complexity of methods should not be too high\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"FOCUSED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Linear with offset\",\n    \"linearDesc\": \"per complexity point over the threshold\",\n    \"linearOffset\": \"5min\",\n    \"linearFactor\": \"1min\"\n  },\n  \"tags\": [\n    \"brain-overload\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-3776\",\n  \"sqKey\": \"S3776\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3860.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Since Visual Studio 2010 SP1, the <code>ByVal</code> parameter modifier is implicitly applied, and therefore not required anymore. Removing it from\nyour source code will improve readability.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nSub Foo(ByVal bar As String)\n  ' ...\nEnd Sub\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nSub Foo(bar As String)\n  ' ...\nEnd Sub\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3860.json",
    "content": "{\n  \"title\": \"\\\"ByVal\\\" should not be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1min\"\n  },\n  \"tags\": [\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3860\",\n  \"sqKey\": \"S3860\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3866.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Visual Basic .NET offers a non-short-circuit conditional function, <code>IIf()</code>, which returns either its second or third parameter based on\nthe expression in the first parameter. Using it is slower than using <code>If()</code> because each parameter is unconditionally evaluated. Further,\nits use can lead to runtime exceptions because <code>IIf</code> always evaluates all three of its arguments.</p>\n<p>The newer version, <code>If()</code>, should be used instead because it short-circuits the evaluation of its parameters.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nPublic Class Foo\n    Public Sub Bar()\n        Dim var As Object = IIf(Date.Now.Year = 1999, \"Lets party!\", \"Lets party like it is 1999!\") ' Noncompliant\n    End Sub\nEnd Class\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nPublic Class Foo\n    Public Sub Bar()\n        Dim var As String = If(Date.Now.Year = 1999, \"Lets party!\", \"Lets party like it is 1999!\")\n    End Sub\nEnd Class\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li><a href=\"https://msdn.microsoft.com/en-us/library/27ydhh0d(v=vs.90).aspx\">IIf Function (MSDN)</a></li>\n  <li><a href=\"https://msdn.microsoft.com/en-us/library/bb513985(v=vs.90).aspx\">If Operator (MSDN)</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3866.json",
    "content": "{\n  \"title\": \"\\\"IIf\\\" should not be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-3866\",\n  \"sqKey\": \"S3866\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3869.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The <code>SafeHandle.DangerousGetHandle</code> method poses significant risks and should be used carefully. This method carries the inherent danger\nof potentially returning an invalid handle, which can result in resource leaks and security vulnerabilities. Although it is technically possible to\nutilize this method without encountering issues, doing so correctly requires a high level of expertise. Therefore, it is recommended to avoid using\nthis method altogether.</p>\n<h3>What is the potential impact?</h3>\n<p>The <code>SafeHandle.DangerousGetHandle</code> method is potentially prone to leaks and vulnerabilities due to its nature and usage. Here are a few\nreasons why:</p>\n<ul>\n  <li><strong>Invalid handles</strong>: the method retrieves the raw handle value without performing any validation or safety checks. This means that\n  the method can return a handle that is no longer valid or has been closed, leading to undefined behavior or errors when attempting to use it.</li>\n  <li><strong>Resource leaks</strong>: by directly accessing the handle without the proper safeguards and cleanup provided by the\n  <code>SafeHandle</code> class, there is an increased risk of failing to dispose system resources correctly.</li>\n  <li><strong>Security vulnerabilities</strong>: when the handle is interacting with sensitive resources (e.g. file handles, process handles) using\n  <code>SafeHandle.DangerousGetHandle</code> without proper validation can lead to security vulnerabilities that can be exploited by an attacker.</li>\n</ul>\n<pre>\nSub Dangerous(fieldInfo As System.Reflection.FieldInfo)\n  Dim handle As SafeHandle = CType(fieldInfo.GetValue(fieldInfo), SafeHandle)\n  Dim dangerousHandle As IntPtr = handle.DangerousGetHandle ' Noncompliant\nEnd Sub\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.safehandle.dangerousgethandle\">SafeHandle.DangerousGetHandle\n  Method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.safehandle\">SafeHandle Class</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li><a href=\"https://stackoverflow.com/questions/8396923/why-is-safehandle-dangerousgethandle-dangerous\">Why is SafeHandle.DangerousGetHandle()\n  \"Dangerous\"? - Stackoverflow</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3869.json",
    "content": "{\n  \"title\": \"\\\"SafeHandle.DangerousGetHandle\\\" should not be called\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"leak\",\n    \"unpredictable\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-3869\",\n  \"sqKey\": \"S3869\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3871.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The point of having custom exception types is to convey more information than is available in standard types. But custom exception types must be\n<code>public</code> for that to work.</p>\n<p>If a method throws a non-public exception, the best you can do on the caller’s side is to <code>catch</code> the closest <code>public</code> base\nof the class. However, you lose all the information that the new exception type carries.</p>\n<p>This rule will raise an issue if you directly inherit one of the following exception types in a non-public class:</p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.exception\">Exception</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.systemexception\">SystemException</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.applicationexception\">ApplicationException</a></li>\n</ul>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nFriend Class MyException    ' Noncompliant\n    Inherits Exception\n    ' ...\nEnd Class\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nPublic Class MyException\n    Inherits Exception\n    ' ...\nEnd Class\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A10_2017-Insufficient_Logging%2526Monitoring\">Top 10 2017 Category A10 -\n  Insufficient Logging &amp; Monitoring</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.exception\">Exception</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.systemexception\">SystemException</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.applicationexception\">ApplicationException</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/declared-elements/access-levels\">Access\n  levels</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3871.json",
    "content": "{\n  \"title\": \"Exception types should be \\\"Public\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"error-handling\",\n    \"api-design\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-3871\",\n  \"sqKey\": \"S3871\",\n  \"scope\": \"All\",\n  \"securityStandards\": {\n    \"OWASP\": [\n      \"A10\"\n    ]\n  },\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3878.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>There’s no point in creating an array solely for the purpose of passing it to a <code>ParamArray</code> parameter. Simply pass the elements\ndirectly. They will be consolidated into an array automatically.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nClass SurroundingClass\n    Public Sub Base()\n        Method(New String() { \"s1\", \"s2\" }) ' Noncompliant: unnecessary\n        Method(New String(12) {}) ' Compliant\n    End Sub\n\n    Public Sub Method(ParamArray args As String())\n        ' Do something\n    End Sub\nEnd Class\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nClass SurroundingClass\n    Public Sub Base()\n        Method(\"s1\", \"s2\")\n        Method(New String(12) {})\n    End Sub\n\n    Public Sub Method(ParamArray args As String())\n        ' Do something\n    End Sub\nEnd Class\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3878.json",
    "content": "{\n  \"title\": \"Arrays should not be created for ParamArray parameters\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"clumsy\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-3878\",\n  \"sqKey\": \"S3878\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3884.html",
    "content": "<p>This rule is deprecated, and will eventually be removed.</p>\n<h2>Why is this an issue?</h2>\n<p><code>CoSetProxyBlanket</code> and <code>CoInitializeSecurity</code> both work to set the permissions context in which the process invoked\nimmediately after is executed. Calling them from within that process is useless because it’s too late at that point; the permissions context has\nalready been set.</p>\n<p>Specifically, these methods are meant to be called from non-managed code such as a C++ wrapper that then invokes the managed, i.e. C# or VB.NET,\ncode.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nPublic Class Noncompliant\n\n    &lt;DllImport(\"ole32.dll\")&gt;\n    Public Shared Function CoSetProxyBlanket(&lt;MarshalAs(UnmanagedType.IUnknown)&gt;pProxy As Object, dwAuthnSvc as UInt32, dwAuthzSvc As UInt32, &lt;MarshalAs(UnmanagedType.LPWStr)&gt; pServerPrincName As String, dwAuthnLevel As UInt32, dwImpLevel As UInt32, pAuthInfo As IntPtr, dwCapabilities As UInt32) As Integer\n    End Function\n\n    Public Enum RpcAuthnLevel\n        [Default] = 0\n        None = 1\n        Connect = 2\n        [Call] = 3\n        Pkt = 4\n        PktIntegrity = 5\n        PktPrivacy = 6\n    End Enum\n\n    Public Enum RpcImpLevel\n        [Default] = 0\n        Anonymous = 1\n        Identify = 2\n        Impersonate = 3\n        [Delegate] = 4\n    End Enum\n\n    Public Enum EoAuthnCap\n        None = &amp;H00\n        MutualAuth = &amp;H01\n        StaticCloaking = &amp;H20\n        DynamicCloaking = &amp;H40\n        AnyAuthority = &amp;H80\n        MakeFullSIC = &amp;H100\n        [Default] = &amp;H800\n        SecureRefs = &amp;H02\n        AccessControl = &amp;H04\n        AppID = &amp;H08\n        Dynamic = &amp;H10\n        RequireFullSIC = &amp;H200\n        AutoImpersonate = &amp;H400\n        NoCustomMarshal = &amp;H2000\n        DisableAAA = &amp;H1000\n    End Enum\n\n    &lt;DllImport(\"ole32.dll\")&gt;\n    Public Shared Function CoInitializeSecurity(pVoid As IntPtr, cAuthSvc As Integer, asAuthSvc As IntPtr, pReserved1 As IntPtr, level As RpcAuthnLevel, impers As RpcImpLevel, pAuthList As IntPtr, dwCapabilities As EoAuthnCap, pReserved3 As IntPtr) As Integer\n    End Function\n\n    Public Sub DoSomething()\n        Dim Hres1 As Integer = CoSetProxyBlanket(Nothing, 0, 0, Nothing, 0, 0, IntPtr.Zero, 0) ' Noncompliant\n        Dim Hres2 As Integer = CoInitializeSecurity(IntPtr.Zero, -1, IntPtr.Zero, IntPtr.Zero, RpcAuthnLevel.None, RpcImpLevel.Impersonate, IntPtr.Zero, EoAuthnCap.None, IntPtr.Zero) ' Noncompliant\n    End Sub\n\nEnd Class\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A01_2021-Broken_Access_Control/\">Top 10 2021 Category A1 - Broken Access Control</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A6_2017-Security_Misconfiguration\">Top 10 2017 Category A6 - Security\n  Misconfiguration</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/648\">CWE-648 - Incorrect Use of Privileged APIs</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3884.json",
    "content": "{\n  \"title\": \"\\\"CoSetProxyBlanket\\\" and \\\"CoInitializeSecurity\\\" should not be used\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"deprecated\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-3884\",\n  \"sqKey\": \"S3884\",\n  \"scope\": \"All\",\n  \"securityStandards\": {\n    \"CWE\": [\n      648\n    ],\n    \"OWASP\": [\n      \"A6\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A1\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"6.5.8\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"6.2.4\"\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3889.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><code>Thread.Suspend</code> and <code>Thread.Resume</code> can give unpredictable results, and both methods have been deprecated. Indeed, if\n<code>Thread.Suspend</code> is not used very carefully, a <a href=\"https://en.wikipedia.org/wiki/Thread_(computing)\">thread</a> can be suspended while\nholding a <a href=\"https://en.wikipedia.org/wiki/Lock_(computer_science)\">lock</a>, thus leading to a <a\nhref=\"https://en.wikipedia.org/wiki/Deadlock\">deadlock</a>.</p>\n<p>There are other synchronization mechanisms that are safer and should be used instead, such as:</p>\n<ul>\n  <li><code>Monitor</code> provides a mechanism that synchronizes access to objects.</li>\n  <li><code>Mutex</code> provides a mechanism that synchronizes interprocess access to a protected resource.</li>\n  <li><code>Semaphore</code> provides a mechanism that allows limiting the number of threads that have access to a protected resources\n  concurrently.</li>\n  <li><code>Events</code> enable a class to notify others when something of interest occurs.</li>\n</ul>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://msdn.microsoft.com/en-us/library/system.threading.thread.resume.aspx\">Thread.Resume Method</a></li>\n  <li><a href=\"https://msdn.microsoft.com/en-us/library/system.threading.thread.suspend(v=vs.110).aspx\">Thread.Suspend Method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.monitor?view=net-7.0\">Monitor Class</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.mutex?view=net-7.0\">Mutex Class</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.semaphore?view=net-7.0\">Semaphore Class</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/events/\">Events Programming Guide</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/synclock-statement\">SyncLock Statement</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3889.json",
    "content": "{\n  \"title\": \"\\\"Thread.Resume\\\" and \\\"Thread.Suspend\\\" should not be used\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"multi-threading\",\n    \"unpredictable\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-3889\",\n  \"sqKey\": \"S3889\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3898.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>If you’re using a <code>Structure</code>, it is likely because you’re interested in performance. But by failing to implement\n<code>IEquatable&lt;T&gt;</code> you’re loosing performance when comparisons are made because without <code>IEquatable&lt;T&gt;</code>, boxing and\nreflection are used to make comparisons.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nStructure MyStruct ' Noncompliant\n\n    Public Property Value As Integer\n\nEnd Structure\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nStructure MyStruct\n    Implements IEquatable(Of MyStruct)\n\n    Public Property Value As Integer\n\n    Public Overloads Function Equals(other As MyStruct) As Boolean Implements IEquatable(Of MyStruct).Equals\n        ' ...\n    End Function\n\nEnd Structure\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.iequatable-1\">IEquatable&lt;T&gt; Interface</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3898.json",
    "content": "{\n  \"title\": \"Value types should implement \\\"IEquatable\\u003cT\\u003e\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3898\",\n  \"sqKey\": \"S3898\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3900.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Methods declared as <code>Public</code>, <code>Protected</code>, or <code>Protected Friend</code> can be accessed from other assemblies, which\nmeans you should validate parameters to be within the expected constraints. In general, checking against <code>Nothing</code> is recommended in\ndefensive programming.</p>\n<p>This rule raises an issue when a parameter of a publicly accessible method is not validated against <code>Nothing</code> before being\ndereferenced.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nPublic Class Sample\n\n    Public Property Message As String\n\n    Public Sub PublicMethod(Arg As Exception)\n        Message = Arg.Message   ' Noncompliant\n    End Sub\n\n    Protected Sub ProtectedMethod(Arg As Exception)\n        Message = Arg.Message   ' Noncompliant\n    End Sub\n\nEnd Class\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nPublic Class Sample\n\n    Public Property Message As String\n\n    Public Sub PublicMethod(Arg As Exception)\n        If Arg IsNot Nothing Then Message = Arg.Message   ' Noncompliant\n    End Sub\n\n    Protected Sub ProtectedMethod(Arg As Exception)\n        ArgumentNullException.ThrowIfNull(Arg)\n        Message = Arg.Message   ' Noncompliant\n    End Sub\n\n    Private Sub PrivateMethod(Arg As Exception)\n        Message = Arg.Message   ' Compliant: method is not publicly accessible\n    End Sub\n\nEnd Class\n</pre>\n<h3>Exceptions</h3>\n<ul>\n  <li>Arguments validated for <code>Nothing</code> via helper methods should be annotated with the <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/attributes/nullable-analysis#postconditions-maybenull-and-notnull\"><code>[NotNull</code></a>] attribute.</li>\n  <li>Method parameters marked with the <code>[NotNull]</code> <a\n  href=\"https://www.jetbrains.com/help/resharper/Reference__Code_Annotation_Attributes.html#ItemNotNullAttribute\">Resharper code annotation\n  attribute</a> are supported as well.</li>\n  <li>To create a custom null validation method declare an attribute with name <code>ValidatedNotNullAttribute</code> and mark the parameter that is\n  validated for null in your method declaration with it:</li>\n</ul>\n<pre>\nImports System.Runtime.CompilerServices\n\n&lt;AttributeUsage(AttributeTargets.Parameter, Inherited:=False)&gt;\nPublic NotInheritable Class ValidatedNotNullAttribute\n    Inherits Attribute\n\nEnd Class\n\nPublic Module Guard\n\n    Public Sub NotNull(Of T As Class)(&lt;ValidatedNotNullAttribute&gt; Value As T, &lt;CallerArgumentExpression(\"Value\")&gt; Optional Name As String = \"\")\n        If Value Is Nothing Then Throw New ArgumentNullException(Name)\n    End Sub\n\nEnd Module\n\nPublic Module SampleUsage\n\n    Public Function CustomToUpper(Value As String) As String\n        Guard.NotNull(Value)\n        Return Value.ToUpper\n    End Function\n\nEnd Module\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3900.json",
    "content": "{\n  \"title\": \"Arguments of public methods should be validated against Nothing\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"convention\",\n    \"symbolic-execution\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3900\",\n  \"sqKey\": \"S3900\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3903.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Types are declared in namespaces in order to prevent name collisions and as a way to organize them into the object hierarchy. Types that are\ndefined outside any named namespace are in a global namespace that cannot be referenced in code.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nPublic Class Foo\nEnd Class\n\nPublic Structure Bar\nEnd Structure\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nNamespace SomeSpace\n    Public Class Foo\n    End Class\n\n    Public Structure Bar\n    End Structure\nEnd Namespace\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3903.json",
    "content": "{\n  \"title\": \"Types should be defined in named namespaces\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"MODULAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3903\",\n  \"sqKey\": \"S3903\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3904.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.reflection.assemblyversionattribute\">AssemblyVersion</a> attribute is used to\nspecify the version number of an assembly. An assembly is a compiled unit of code, which can be marked with a version number by applying the attribute\nto an assembly’s source code file.</p>\n<p>The <code>AssemblyVersion</code> attribute is useful for many reasons:</p>\n<ul>\n  <li><strong>Versioning</strong>: The attribute allows developers to track and manage different versions of an assembly. By incrementing the version\n  number for each new release, you can easily identify and differentiate between different versions of the same assembly. This is particularly useful\n  when distributing and deploying software, as it helps manage updates and compatibility between different versions.</li>\n  <li><strong>Dependency management</strong>: When an assembly references another assembly, it can specify the specific version of the dependency it\n  requires. By using the <code>AssemblyVersion</code> attribute, you can ensure that the correct version of the referenced assembly is used. This\n  helps avoid compatibility issues and ensures that the expected behavior and functionality are maintained.</li>\n  <li><strong>GAC management</strong>: The <a href=\"https://learn.microsoft.com/en-us/dotnet/framework/app-domains/gac\">GAC</a>, also known as Global\n  Assembly Cache, is a central repository for storing shared assemblies on a system. The AssemblyVersion attribute plays a crucial role in managing\n  assemblies in the GAC. Different versions of an assembly can coexist in the GAC, allowing applications to use the specific version they\n  require.</li>\n</ul>\n<p>If no <code>AssemblyVersion</code> is provided, the same default version will be used for every build. Since the version number is used by .NET\nFramework to uniquely identify an assembly, this can lead to broken dependencies.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nImports System.Reflection\n&lt;Assembly: AssemblyTitle(\"MyAssembly\")&gt; ' Noncompliant\nNamespace MyLibrary\n' ...\nEnd Namespace\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nImports System.Reflection\n&lt;Assembly: AssemblyTitle(\"MyAssembly\")&gt;\n&lt;Assembly: AssemblyVersion(\"42.1.125.0\")&gt;\nNamespace MyLibrary\n' ...\nEnd Namespace\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://docs.microsoft.com/en-us/dotnet/standard/assembly/versioning\">Assembly Versioning</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/framework/app-domains/gac\">Global Assembly Cache</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3904.json",
    "content": "{\n  \"title\": \"Assemblies should have version information\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-3904\",\n  \"sqKey\": \"S3904\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3923.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Having all branches of a <code>Select Case</code> or <code>If</code> chain with the same implementation indicates a problem.</p>\n<p>In the following code:</p>\n<pre>\nDim b As Integer = If(a &gt; 12, 4, 4)  // Noncompliant\n\nIf b = 0 Then  // Noncompliant\n    DoTheThing()\nElse\n    DoTheThing()\nEnd If\n\nSelect Case i  // Noncompliant\n    Case 1\n        DoSomething()\n    Case 2\n        DoSomething()\n    Case 3\n        DoSomething()\n    Case Else\n        DoSomething()\nEnd Select\n</pre>\n<p>Either there is a copy-paste error that needs fixing or an unnecessary <code>Select Case</code> or <code>If</code> chain that needs removing.</p>\n<h3>Exceptions</h3>\n<p>This rule does not apply to <code>If</code> chains without <code>Else</code>, nor to <code>Select Case</code> without a <code>Case Else</code>\nclause.</p>\n<pre>\nIf b = 0 Then ' No issue, this could have been done on purpose to make the code more readable\n    DoTheThing()\nElseIf\n    DoTheThing()\nEnd If\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3923.json",
    "content": "{\n  \"title\": \"All branches in a conditional structure should not have exactly the same implementation\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3923\",\n  \"sqKey\": \"S3923\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3926.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Fields marked with <code>System.Runtime.Serialization.OptionalFieldAttribute</code> are serialized just like any other field. But such fields are\nignored on deserialization, and retain the default values associated with their types. Therefore, deserialization event handlers should be declared to\nset such fields during the deserialization process.</p>\n<p>This rule raises when at least one field with the <code>System.Runtime.Serialization.OptionalFieldAttribute</code> attribute is declared but one\n(or both) of the following event handlers <code>System.Runtime.Serialization.OnDeserializingAttribute</code> or\n<code>System.Runtime.Serialization.OnDeserializedAttribute</code> are not present.</p>\n<h3>Noncompliant code example</h3>\n<pre>\n&lt;Serializable&gt;\nPublic Class Foo ' Noncompliant\n    &lt;OptionalField(VersionAdded:=2)&gt;\n    Private optionalField As Integer = 5\nEnd Class\n</pre>\n<h3>Compliant solution</h3>\n<pre>\n&lt;Serializable&gt;\nPublic Class Foo\n    &lt;OptionalField(VersionAdded:=2)&gt;\n    Private optionalField As Integer = 5\n\n    &lt;OnDeserializing&gt;\n    Private Sub OnDeserializing(ByVal context As StreamingContext)\n        optionalField = 5\n    End Sub\n\n    &lt;OnDeserialized&gt;\n    Private Sub OnDeserialized(ByVal context As StreamingContext)\n    End Sub\nEnd Class\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3926.json",
    "content": "{\n  \"title\": \"Deserialization methods should be provided for \\\"OptionalField\\\" members\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"serialization\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3926\",\n  \"sqKey\": \"S3926\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3927.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Serialization event handlers that don’t have the correct signature will not be called, bypassing augmentations to automated serialization and\ndeserialization events.</p>\n<p>A method is designated a serialization event handler by applying one of the following serialization event attributes:</p>\n<ul>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.onserializingattribute\"><code>OnSerializingAttribute</code></a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.onserializedattribute\"><code>OnSerializedAttribute</code></a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.ondeserializingattribute\"><code>OnDeserializingAttribute</code></a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.ondeserializedattribute\"><code>OnDeserializedAttribute</code></a></li>\n</ul>\n<p>Serialization event handlers take a single parameter of type <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.streamingcontext\"><code>StreamingContext</code></a>, return\n<code>void</code>, and have <code>private</code> visibility.</p>\n<p>This rule raises an issue when any of these constraints are not respected.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\n&lt;Serializable&gt;\nPublic Class Foo\n    &lt;OnSerializing&gt;\n    Public Sub OnSerializing(ByVal context As StreamingContext) ' Noncompliant: should be private\n    End Sub\n\n    &lt;OnSerialized&gt;\n    Private Function OnSerialized(ByVal context As StreamingContext) As Integer '  Noncompliant: should return void\n    End Function\n\n    &lt;OnDeserializing&gt;\n    Private Sub OnDeserializing() ' Noncompliant: should have a single parameter of type StreamingContext\n    End Sub\n\n    &lt;OnSerializing&gt;\n    Public Sub OnSerializing2(Of T)(ByVal context As StreamingContext) ' Noncompliant: should have no type parameters\n    End Sub\n\n    &lt;OnDeserialized&gt;\n    Private Sub OnDeserialized(ByVal context As StreamingContext, ByVal str As String) ' Noncompliant: should have a single parameter of type StreamingContext\n    End Sub\nEnd Class\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n&lt;Serializable&gt;\nPublic Class Foo\n    &lt;OnSerializing&gt;\n    Private Sub OnSerializing(ByVal context As StreamingContext)\n    End Sub\n\n    &lt;OnSerialized&gt;\n    Private Sub OnSerialized(ByVal context As StreamingContext)\n    End Sub\n\n    &lt;OnDeserializing&gt;\n    Private Sub OnDeserializing(ByVal context As StreamingContext)\n    End Sub\n\n    &lt;OnDeserialized&gt;\n    Private Sub OnDeserialized(ByVal context As StreamingContext)\n    End Sub\nEnd Class\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/visualstudio/code-quality/ca2238\">CA2238: Implement serialization methods\n  correctly</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3927.json",
    "content": "{\n  \"title\": \"Serialization event handlers should be implemented correctly\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3927\",\n  \"sqKey\": \"S3927\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3949.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Numbers are infinite, but the types that hold them are not. Each numeric type has hard upper and lower bounds. Try to calculate numbers beyond\nthose bounds, and the result will be an <code>OverflowException</code>. When the compilation is configured to remove integer overflow checking, the\nvalue will be silently wrapped around from the expected positive value to a negative one, or vice versa.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nPublic Function Transform(Value As Integer) As Integer\n    If Value &lt;= 0 Then Return Value\n    Dim Number As Integer = Integer.MaxValue\n    Return Number + Value       ' Noncompliant\nEnd Function\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nPublic Function Transform(Value As Integer) As Long\n    If Value &lt;= 0 Then Return Value\n    Dim Number As Long = Integer.MaxValue\n    Return Number + Value\nEnd Function\n</pre>\n<h2>Resources</h2>\n<h3>Standards</h3>\n<ul>\n  <li>STIG Viewer - <a href=\"https://stigviewer.com/stigs/application_security_and_development/2024-12-06/finding/V-222612\">Application Security and\n  Development: V-222612</a> - The application must not be vulnerable to overflow attacks.</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3949.json",
    "content": "{\n  \"title\": \"Calculations should not overflow\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"overflow\",\n    \"symbolic-execution\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3949\",\n  \"sqKey\": \"S3949\",\n  \"scope\": \"All\",\n  \"securityStandards\": {\n    \"STIG ASD_V5R3\": [\n      \"V-222612\"\n    ]\n  },\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3966.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Disposing an object twice in the same method, either with the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/using-statement\">Using statement</a> or by calling\n<code>Dispose</code> directly, is confusing and error-prone. For example, another developer might try to use an already-disposed object, or there can\nbe runtime errors for specific paths in the code.</p>\n<p>In addition, even if the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.idisposable.dispose#System_IDisposable_Dispose\">documentation</a> explicitly states that\ncalling the <code>Dispose</code> method multiple times should not throw an exception, some implementations still do it. Thus it is safer to not\ndispose of an object twice when possible.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nDim foo As New Disposable()\nfoo.Dispose()\nfoo.Dispose() ' Noncompliant\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nUsing bar As New Disposable()  ' Noncompliant\n    bar.Dispose()\nEnd Using\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nDim foo As New Disposable()\nfoo.Dispose()\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nUsing bar As New Disposable()  ' Compliant\n\nEnd Using\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.idisposable.dispose#System_IDisposable_Dispose\">Dispose method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.iasyncdisposable.disposeasync\">DisposeAsync method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/implementing-dispose\">Implement a Dispose method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/implementing-disposeasync\">Implement a DisposeAsync\n  method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/using-statement\">Using statement</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3966.json",
    "content": "{\n  \"title\": \"Objects should not be disposed more than once\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"confusing\",\n    \"pitfall\",\n    \"symbolic-execution\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3966\",\n  \"sqKey\": \"S3966\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3981.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The size of a collection and the length of an array are always greater than or equal to zero. Testing it doesn’t make sense, since the result is\nalways <code>true</code>.</p>\n<pre>\nIf Collection.Count &gt;= 0 Then ... 'Noncompliant always true\n\nIf array.Length &gt;= 0 Then ... 'Noncompliant always true\n</pre>\n<p>Similarly testing that it is less than zero will always return <code>false</code>.</p>\n<pre>\nIf Enumerable.Count &lt; 0 Then ... 'Noncompliant always false\n\nDim result As Boolean = Array.Length &gt;= 0 'Noncompliant always true\n</pre>\n<p>Fix the code to properly check for emptiness if it was the intent, or remove the redundant code to keep the current behavior.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3981.json",
    "content": "{\n  \"title\": \"Collection sizes and array length comparisons should make sense\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"confusing\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3981\",\n  \"sqKey\": \"S3981\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3990.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Assemblies should conform with the Common Language Specification (CLS) in order to be usable across programming languages. To be compliant an\nassembly has to indicate it with <code>System.CLSCompliantAttribute</code>.</p>\n<h3>Compliant solution</h3>\n<pre>\n&lt;Assembly: CLSCompliant(True)&gt;\n\nNamespace MyLibrary\n\nEnd Namespace\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3990.json",
    "content": "{\n  \"title\": \"Assemblies should be marked as CLS compliant\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1min\"\n  },\n  \"tags\": [\n    \"api-design\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3990\",\n  \"sqKey\": \"S3990\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3992.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Assemblies should explicitly indicate whether they are meant to be COM visible or not. If the <code>ComVisibleAttribute</code> is not present, the\ndefault is to make the content of the assembly visible to COM clients.</p>\n<p>Note that COM visibility can be overridden for individual types and members.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nNamespace MyLibrary  ' Noncompliant\n\nEnd Namespace\n</pre>\n<h3>Compliant solution</h3>\n<pre>\n&lt;Assembly: Runtime.InteropServices.ComVisible(False)&gt;\n\nNamespace MyLibrary\n\nEnd Namespace\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3992.json",
    "content": "{\n  \"title\": \"Assemblies should explicitly specify COM visibility\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1min\"\n  },\n  \"tags\": [\n    \"api-design\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-3992\",\n  \"sqKey\": \"S3992\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3998.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Objects that can be accessed across <a href=\"https://learn.microsoft.com/en-us/dotnet/framework/app-domains/application-domains\">application\ndomain</a> boundaries are said to have weak identity. This means that these objects can be considered shared resources outside of the domain, which\ncan be lead to them being accessed or modified by multiple threads or concurrent parts of a program, outside of the domain.</p>\n<p>A <a href=\"https://en.wikipedia.org/wiki/Thread_(computing)\">thread</a> acquiring a <a\nhref=\"https://en.wikipedia.org/wiki/Lock_(computer_science)\">lock</a> on such an object runs the risk of being blocked by another thread in a\ndifferent application domain, leading to poor performance and potentially <a\nhref=\"https://stackoverflow.com/questions/1162587/what-is-starvation\">thread starvation</a> and <a\nhref=\"https://en.wikipedia.org/wiki/Deadlock\">deadlocks</a>.</p>\n<p>Types with weak identity are:</p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.marshalbyrefobject\">MarshalByRefObject</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.executionengineexception\">ExecutionEngineException</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.outofmemoryexception\">OutOfMemoryException</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.stackoverflowexception\">StackOverflowException</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string\">String</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.reflection.memberinfo\">MemberInfo</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.reflection.parameterinfo\">ParameterInfo</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.thread\">Thread</a></li>\n</ul>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nPublic Class Sample\n    Private ReadOnly myLock As New StackOverflowException\n\n    Public Sub Go()\n        SyncLock myLock ' Noncompliant\n        ' ...\n        End SyncLock\n    End Sub\nEnd Class\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nPublic Class Sample\n    Private ReadOnly myLock As New Object\n\n    Public Sub Go()\n        SyncLock myLock\n        ' ...\n        End SyncLock\n    End Sub\nEnd Class\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Thread_(computing)\">Thread</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Lock_(computer_science)\">Locking</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Deadlock\">Deadlock</a></li>\n  <li><a href=\"https://docs.microsoft.com/en-us/dotnet/standard/threading/managed-threading-best-practices\">Managed Threading Best Practices</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/framework/app-domains/application-domains\">Application domains</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li><a href=\"https://stackoverflow.com/questions/1162587/what-is-starvation\">What is (thread) starvation?</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Readers%E2%80%93writers_problem\">Readers-writers problem</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Dining_philosophers_problem\">Dining philosophers problem</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S3998.json",
    "content": "{\n  \"title\": \"Threads should not lock on objects with weak identity\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"multi-threading\",\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-3998\",\n  \"sqKey\": \"S3998\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4025.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Having a field in a child class with a name that differs from a parent class' field only by capitalization is sure to cause confusion. Such child\nclass fields should be renamed.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nPublic Class Fruit\n\n    Protected PlantingSeason As String\n\n    ' ...\n\nEnd Class\n\nPublic Class Raspberry\n    Inherits Fruit\n\n    Protected Plantingseason As String  ' Noncompliant\n\n    ' ...\n\nEnd Class\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nPublic Class Fruit\n\n    Protected PlantingSeason As String\n\n    ' ...\n\nEnd Class\n\nPublic Class Raspberry\n    Inherits Fruit\n\n    Protected WhenToPlant As String\n\n    ' ...\n\nEnd Class\n</pre>\n<p>Or</p>\n<pre>\nPublic Class Fruit\n\n    Protected PlantingSeason As String\n\n    ' ...\n\nEnd Class\n\nPublic Class Raspberry\n    Inherits Fruit\n\n    ' Field removed, parent field will be used instead\n\nEnd Class\n</pre>\n<h3>Exceptions</h3>\n<p>This rule ignores same-name fields that are <code>Shared</code> in both the parent and child classes. It also ignores <code>Private</code> parent\nclass fields and fields explicitly declared as <code>Shadows</code>, but in all other such cases, the child class field should be renamed.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4025.json",
    "content": "{\n  \"title\": \"Child class fields should not differ from parent class fields only by capitalization\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-4025\",\n  \"sqKey\": \"S4025\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4036.html",
    "content": "<p>When you run an OS command, it is always important to protect yourself against the risk of accidental or malicious replacement of the executables\nin the production system.</p>\n<p>To do so, it is important to point to the specific executable that should be used.</p>\n<p>For example, if you call <code>git</code> (without specifying a path), the operating system will search for the executable in the directories\nspecified in the <code>PATH</code> environment variable.\n  <br>\n  An attacker could have added, in a permissive directory covered by <code>PATH</code> , another executable called <code>git</code>, but with a\n  completely different behavior, for example exfiltrating data or exploiting a vulnerability in your own code.</p>\n<p>However, by calling <code>/usr/bin/git</code> or <code>../git</code> (relative path) directly, the operating system will always use the intended\nexecutable.\n  <br>\n  Note that you still need to make sure that the executable is not world-writeable and potentially overwritten. This is not the scope of this\n  rule.</p>\n<h2>Ask Yourself Whether</h2>\n<ul>\n  <li>The PATH environment variable only contains fixed, trusted directories.</li>\n</ul>\n<p>There is a risk if you answered no to this question.</p>\n<h2>Recommended Secure Coding Practices</h2>\n<p>If you wish to rely on the <code>PATH</code> environment variable to locate the OS command, make sure that each of its listed directories is fixed,\nnot susceptible to change, and not writable by unprivileged users.</p>\n<p>If you determine that these folders cannot be altered, and that you are sure that the program you intended to use will be used, then you can\ndetermine that these risks are under your control.</p>\n<p>A good practice you can use is to also hardcode the <code>PATH</code> variable you want to use, if you can do so in the framework you use.</p>\n<p>If the previous recommendations cannot be followed due to their complexity or other requirements, then consider using the absolute path of the\ncommand instead.</p>\n<pre>\n$ whereis git\ngit: /usr/bin/git /usr/share/man/man1/git.1.gz\n$ ls -l /usr/bin/git\n-rwxr-xr-x 1 root root 3376112 Jan 28 10:13 /usr/bin/git\n</pre>\n<h2>Sensitive Code Example</h2>\n<pre>\nDim p As New Process()\np.StartInfo.FileName = \"binary\" ' Sensitive\n</pre>\n<h2>Compliant Solution</h2>\n<pre>\nDim p As New Process()\np.StartInfo.FileName = \"C:\\Apps\\binary.exe\"\n</pre>\n<h2>See</h2>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A08_2021-Software_and_Data_Integrity_Failures/\">Top 10 2021 Category A8 - Software and Data Integrity\n  Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A1_2017-Injection\">Top 10 2017 Category A1 - Injection</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/426\">CWE-426 - Untrusted Search Path</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/427\">CWE-427 - Uncontrolled Search Path Element</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4036.json",
    "content": "{\n  \"title\": \"Searching OS commands in PATH is security-sensitive\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"LOW\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-4036\",\n  \"sqKey\": \"S4036\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      427,\n      426\n    ],\n    \"OWASP\": [\n      \"A1\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A8\"\n    ]\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4060.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The .NET framework class library provides methods for retrieving custom attributes. Sealing the attribute eliminates the search through the\ninheritance hierarchy, and can improve performance.</p>\n<p>This rule raises an issue when a public type inherits from <code>System.Attribute</code>, is not abstract, and is not sealed.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nPublic Class MyAttribute    ' Noncompliant\n    Inherits Attribute\n\n    Public ReadOnly Property Name As String\n\n    Public Sub New(Name As String)\n        Me.Name = Name\n    End Sub\n\nEnd Class\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nPublic NotInheritable Class MyAttribute\n    Inherits Attribute\n\n    Public ReadOnly Property Name As String\n\n    Public Sub New(Name As String)\n        Me.Name = Name\n    End Sub\n\nEnd Class\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4060.json",
    "content": "{\n  \"title\": \"Non-abstract attributes should be sealed\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-4060\",\n  \"sqKey\": \"S4060\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4136.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>For clarity, all overloads of the same method should be grouped together. That lets both users and maintainers quickly understand all the current\navailable options.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nInterface IMyInterface\n    Function DoTheThing() As Integer\n    Function DoTheOtherThing() As String // Noncompliant\n    Function DoTheThing(ByVal Path As String) As Integer\nEnd Interface\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nInterface IMyInterface\n    Function DoTheThing() As Integer\n    Function DoTheThing(ByVal Path As String) As Integer\n    Function DoTheOtherThing() As String\nEnd Interface\n</pre>\n<h3>Exceptions</h3>\n<p>As it is common practice to group method declarations by implemented interface, no issue will be raised for interface implementations if grouped\ntogether with other members of that interface.</p>\n<p>As it is also a common practice to group method declarations by accessibility level, no issue will be raised for method overloads having different\naccess modifiers.</p>\n<p>Example:</p>\n<pre>\nClass MyClass\n\n    Private Sub DoTheThing(s As String) ' Ok - this method is declared as Private while the other one is Public\n        ' ...\n    End Sub\n\n    Private Sub DoTheOtherThing(s As String)\n        ' ...\n    End Sub\n\n    Public Sub DoTheThing()\n        ' ...\n    End Sub\n\nEnd Class\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4136.json",
    "content": "{\n  \"title\": \"Method overloads should be grouped together\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"FORMATTED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1min\"\n  },\n  \"tags\": [\n    \"convention\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-4136\",\n  \"sqKey\": \"S4136\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4143.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Storing a value inside a collection at a given key or index and then unconditionally overwriting it without reading the initial value is a case of\na \"dead store\".</p>\n<pre>\ntowns.Item(x) = \"London\"\ntowns.Item(x) = \"Chicago\";  // Noncompliant\n</pre>\n<p>This practice is redundant and will cause confusion for the reader. More importantly, it is often an error and not what the developer intended to\ndo.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4143.json",
    "content": "{\n  \"title\": \"Map values should not be replaced unconditionally\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-4143\",\n  \"sqKey\": \"S4143\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4144.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Two methods having the same implementation are suspicious. It might be that something else was intended. Or the duplication is intentional, which\nbecomes a maintenance burden.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nPrivate Const CODE As String = \"bounteous\"\nPrivate callCount As Integer = 0\n\nPublic Function GetCode() As String\n  callCount = callCount + 1\n  Return CODE\nEnd Function\n\nPublic Function GetName() As String ' Noncompliant: duplicates GetCode\n  callCount = callCount + 1\n  Return CODE\nEnd Function\n</pre>\n<p>If the identical logic is intentional, the code should be refactored to avoid duplication. For example, by having both methods call the same method\nor by having one implementation invoke the other.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nPrivate Const CODE As String = \"bounteous\"\nPrivate callCount As Integer = 0\n\nPublic Function GetCode() As String\n  callCount = callCount + 1\n  Return CODE\nEnd Function\n\nPublic Function GetName() As String ' Intent is clear\n  Return GetCode()\nEnd Function\n</pre>\n<h3>Exceptions</h3>\n<p>Empty methods, methods with only one line of code and methods with the same name (overload) are ignored.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4144.json",
    "content": "{\n  \"title\": \"Methods should not have identical implementations\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"DISTINCT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [\n    \"confusing\",\n    \"duplicate\",\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-4144\",\n  \"sqKey\": \"S4144\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4158.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When a collection is empty, iterating it has no effect. Doing so anyway is likely a bug; either population was accidentally omitted, or the\niteration needs to be revised.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nPublic Sub Method()\n    Dim Values As New List(Of String)\n    Values.Remove(\"bar\")                ' Noncompliant\n    If Values.Contains(\"foo\") Then      ' Noncompliant\n    End If\n    For Each Value As String In Values  ' Noncompliant\n    Next\nEnd Sub\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nPublic Sub Method()\n    Dim Values As List(Of String) = LoadValues()\n    Values.Remove(\"bar\")\n    If Values.Contains(\"foo\") Then\n    End If\n    For Each Value As String In Values\n    Next\nEnd Sub\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4158.json",
    "content": "{\n  \"title\": \"Empty collections should not be accessed or iterated\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"LOW\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [\n    \"symbolic-execution\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-4158\",\n  \"sqKey\": \"S4158\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4159.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The <a href=\"https://learn.microsoft.com/en-us/dotnet/framework/mef/attributed-programming-model-overview-mef\">Attributed Programming Model</a>,\nalso known as <a href=\"https://en.wikipedia.org/wiki/Attribute-oriented_programming\">Attribute-oriented programming (@OP)</a>, is a programming model\nused to embed attributes within codes.</p>\n<p>In this model, objects are required to conform to a specific structure so that they can be used by the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/framework/mef/\">Managed Extensibility Framework (MEF)</a>.</p>\n<p>MEF provides a way to discover available components implicitly, via <strong>composition</strong>. A MEF component, called a <strong>part</strong>,\ndeclaratively specifies:</p>\n<ul>\n  <li>both its dependencies, known as <strong>imports</strong></li>\n  <li>and what capabilities it makes available, known as <strong>exports</strong></li>\n</ul>\n<p>The <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.composition.exportattribute\">ExportAttribute</a> declares that a part \"exports\",\nor provides to the composition container, an object that fulfills a particular contract.</p>\n<p>During composition, parts with imports that have matching contracts will have those dependencies filled by the exported object.</p>\n<p>If the type doesn’t implement the interface it is exporting there will be an issue at runtime (either a cast exception or just a container not\nfilled with the exported type) leading to unexpected behaviors/crashes.</p>\n<p>The rule raises an issue when a class doesn’t implement or inherit the type declared in the <code>ExportAttribute</code>.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\n&lt;Export(GetType(ISomeType))&gt;\nPublic Class SomeType  ' Noncompliant: doesn't implement 'ISomeType'.\nEnd Class\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n&lt;Export(GetType(ISomeType))&gt;\nPublic Class SomeType\n    Inherits ISomeType\nEnd Class\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Attribute-oriented_programming\">Attribute-oriented programming (@OP)</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/framework/mef/attributed-programming-model-overview-mef\">Attributed Programming Model</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/framework/mef/\">Managed Extensibility Framework (MEF)</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.composition.exportattribute\">ExportAttribute Class</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4159.json",
    "content": "{\n  \"title\": \"Classes should implement their \\\"ExportAttribute\\\" interfaces\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [\n    \"mef\",\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-4159\",\n  \"sqKey\": \"S4159\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4201.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>There’s no need to null test in conjunction with an <code>TypeOf ... Is</code> test. <code>Nothing</code> is not an instance of anything, so a null\ncheck is redundant.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nIf (x IsNot Nothing And TypeOf x Is MyClass)\n    ' ...\nEnd If\n\nIf (x Is Nothing Or TypeOf x IsNot MyClass)\n    ' ...\nEnd If\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nIf (TypeOf x Is MyClass)\n    ' ...\nEnd If\n\nIf (TypeOf x IsNot MyClass)\n    ' ...\nEnd If\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4201.json",
    "content": "{\n  \"title\": \"Null checks should not be combined with \\\"TypeOf Is\\\" operator checks\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"redundant\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-4201\",\n  \"sqKey\": \"S4201\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4210.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When an assembly uses Windows Forms (classes and interfaces from the <code>System.Windows.Forms</code> namespace) its entry point should be marked\nwith the <code>STAThreadAttribute</code> to indicate that the threading model should be \"Single-Threaded Apartment\" (STA) which is the only one\nsupported by Windows Forms.</p>\n<p>This rule raises an issue when the entry point (<code>Shared Sub Main</code> method) of an assembly using Windows Forms is not marked as STA.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nImports System.Windows.Forms\n\nPublic Class Foo\n  Shared Sub Main()\n    Dim winForm As Form = New Form\n    Application.Run(winForm)\n  End Sub\nEnd Class\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nImports System.Windows.Forms\n\nPublic Class Foo\n  &lt;STAThread()&gt; Shared Sub Main()\n    Dim winForm As Form = New Form\n    Application.Run(winForm)\n  End Sub\nEnd Class\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4210.json",
    "content": "{\n  \"title\": \"Windows Forms entry points should be marked with STAThread\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"winforms\",\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-4210\",\n  \"sqKey\": \"S4210\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4225.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Creating an extension method that extends <code>Object</code> is not recommended because it makes the method available on <em>every</em> type.\nExtensions should be applied at the most specialized level possible, and that is very unlikely to be <code>Object</code>.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nImports System.Runtime.CompilerServices\n\nModule MyExtensions\n    &lt;Extension&gt;\n    Sub SomeExtension(obj As Object) ' Noncompliant\n        ' ...\n    End Sub\nEnd Module\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4225.json",
    "content": "{\n  \"title\": \"Extension methods should not extend \\\"Object\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"FOCUSED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-4225\",\n  \"sqKey\": \"S4225\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4260.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When creating a custom <a href=\"https://learn.microsoft.com/en-us/dotnet/desktop/wpf/advanced/markup-extensions-and-wpf-xaml\">Markup Extension</a>\nthat accepts parameters in WPF, the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.windows.markup.constructorargumentattribute\"><code>ConstructorArgument</code></a> markup\nmust be used to identify the discrete properties that match these parameters. However since this is done via a string, the compiler won’t give you any\nwarning in case there are typos.</p>\n<p>This rule raises an issue when the string argument to <code>ConstructorArgumentAttribute</code> doesn’t match any parameter of any constructor.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nImports System\n\nNamespace MyLibrary\n    Public Class MyExtension\n        Inherits MarkupExtension\n\n        Public Sub New()\n        End Sub\n\n        Public Sub New(ByVal value1 As Object)\n            Value1 = value1\n        End Sub\n\n        &lt;ConstructorArgument(\"value2\")&gt; ' Noncompliant\n        Public Property Value1 As Object\n    End Class\nEnd Namespace\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nImports System\n\nNamespace MyLibrary\n    Public Class MyExtension\n        Inherits MarkupExtension\n\n        Public Sub New()\n        End Sub\n\n        Public Sub New(ByVal value1 As Object)\n            Value1 = value1\n        End Sub\n\n        &lt;ConstructorArgument(\"value1\")&gt;\n        Public Property Value1 As Object\n    End Class\nEnd Namespace\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/desktop/wpf/advanced/markup-extensions-and-wpf-xaml\">Markup Extensions and\n  WPF XAML</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.windows.markup.markupextension\">MarkupExtension Class</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.windows.markup.constructorargumentattribute\">ConstructorArgumentAttribute Class</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4260.json",
    "content": "{\n  \"title\": \"\\\"ConstructorArgument\\\" parameters should exist in constructors\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"xaml\",\n    \"wpf\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-4260\",\n  \"sqKey\": \"S4260\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4275.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Properties provide a way to enforce <a href=\"https://en.wikipedia.org/wiki/Encapsulation_(computer_programming)\">encapsulation</a> by providing\nproperty procedures that give controlled access to <code>Private</code> fields. However, in classes with multiple fields, it is not unusual that <a\nhref=\"https://en.wikipedia.org/wiki/Copy-and-paste_programming\">copy-and-paste</a> is used to quickly create the needed properties, which can result\nin the wrong field being accessed by the property procedures.</p>\n<pre>\nClass C\n    Private _x As Integer\n    Private _Y As Integer\n\n    Public ReadOnly Property Y As Integer\n        Get\n            Return _x ' Noncompliant: The returned field should be '_y'\n        End Get\n    End Property\nEnd Class\n</pre>\n<p>This rule raises an issue in any of these cases:</p>\n<ul>\n  <li>A get procedure does not access the field with the corresponding name.</li>\n  <li>A set procedure does not update the field with the corresponding name.</li>\n</ul>\n<p>For simple properties, it is better to use <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/procedures/auto-implemented-properties\">auto-implemented\nproperties</a> (VB.NET 10.0 or later).</p>\n<p>Field and property names are compared as case-insensitive. All underscore characters are ignored.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nPublic Class Sample\n\n    Private _x As Integer\n    Private _y As Integer\n\n    Public Property Y As Integer\n        Get\n            Return _x   ' Noncompliant: field '_y' is not used in the return value\n        End Get\n        Set(value As Integer)\n            _x = value  ' Noncompliant: field '_y' is not updated\n        End Set\n    End Property\n\nEnd Class\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nPublic Class Sample\n\n    Private _x As Integer\n    Private _y As Integer\n\n    Public Property Y As Integer\n        Get\n            Return _y\n        End Get\n        Set(value As Integer)\n            _y = value\n        End Set\n    End Property\n\nEnd Class\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li>Microsoft Learn: <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/procedures/property-procedures\">Property Procedures\n  (Visual Basic)</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4275.json",
    "content": "{\n  \"title\": \"Property procedures should access the expected fields\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-4275\",\n  \"sqKey\": \"S4275\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4277.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Marking a class with <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.composition.partcreationpolicyattribute\"><code>PartCreationPolicy</code></a>(<a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.composition.creationpolicy\"><code>CreationPolicy.Shared</code></a>), which is\npart of <a href=\"https://learn.microsoft.com/en-us/dotnet/framework/mef\">Managed Extensibility Framework (MEF)</a>, means that a single, shared\ninstance of the exported object will be created. Therefore it doesn’t make sense to create new instances using the constructor and it will most likely\nresult in unexpected behaviours.</p>\n<p>This rule raises an issue when a constructor of a class marked shared with a <code>PartCreationPolicyAttribute</code> is invoked.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\n&lt;Export(GetType(IFooBar))&gt;\n&lt;PartCreationPolicy(CreationPolicy.[Shared])&gt;\nPublic Class FooBar\n    Inherits IFooBar\nEnd Class\n\nPublic Class Program\n    Public Shared Sub Main()\n        Dim fooBar = New FooBar() ' Noncompliant\n    End Sub\nEnd Class\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n&lt;Export(GetType(IFooBar))&gt;\n&lt;PartCreationPolicy(CreationPolicy.[Shared])&gt;\nPublic Class FooBar\n    Inherits IFooBar\nEnd Class\n\nPublic Class Program\n    Public Shared Sub Main()\n        Dim fooBar = serviceProvider.GetService(Of IFooBar)()\n    End Sub\nEnd Class\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.composition.partcreationpolicyattribute\"><code>PartCreationPolicy</code></a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.composition.creationpolicy\"><code>CreationPolicy.Shared</code></a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/framework/mef\">Managed Extensibility Framework</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4277.json",
    "content": "{\n  \"title\": \"\\\"Shared\\\" parts should not be created with \\\"new\\\"\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"mef\",\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-4277\",\n  \"sqKey\": \"S4277\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4423.html",
    "content": "<p>This vulnerability exposes encrypted data to a number of attacks whose goal is to recover the plaintext.</p>\n<h2>Why is this an issue?</h2>\n<p>Encryption algorithms are essential for protecting sensitive information and ensuring secure communications in a variety of domains. They are used\nfor several important reasons:</p>\n<ul>\n  <li>Confidentiality, privacy, and intellectual property protection</li>\n  <li>Security during transmission or on storage devices</li>\n  <li>Data integrity, general trust, and authentication</li>\n</ul>\n<p>When selecting encryption algorithms, tools, or combinations, you should also consider two things:</p>\n<ol>\n  <li>No encryption is unbreakable.</li>\n  <li>The strength of an encryption algorithm is usually measured by the effort required to crack it within a reasonable time frame.</li>\n</ol>\n<p>For these reasons, as soon as cryptography is included in a project, it is important to choose encryption algorithms that are considered strong and\nsecure by the cryptography community.</p>\n<p>To provide communication security over a network, SSL and TLS are generally used. However, it is important to note that the following protocols are\nall considered weak by the cryptographic community, and are officially deprecated:</p>\n<ul>\n  <li>SSL versions 1.0, 2.0 and 3.0</li>\n  <li>TLS versions 1.0 and 1.1</li>\n</ul>\n<p>When these unsecured protocols are used, it is best practice to expect a breach: that a user or organization with malicious intent will perform\nmathematical attacks on this data after obtaining it by other means.</p>\n<h3>What is the potential impact?</h3>\n<p>After retrieving encrypted data and performing cryptographic attacks on it on a given timeframe, attackers can recover the plaintext that\nencryption was supposed to protect.</p>\n<p>Depending on the recovered data, the impact may vary.</p>\n<p>Below are some real-world scenarios that illustrate the potential impact of an attacker exploiting the vulnerability.</p>\n<h4>Additional attack surface</h4>\n<p>By modifying the plaintext of the encrypted message, an attacker may be able to trigger additional vulnerabilities in the code. An attacker can\nfurther exploit a system to obtain more information.\n  <br>\n  Encrypted values are often considered trustworthy because it would not be possible for a third party to modify them under normal circumstances.</p>\n<h4>Breach of confidentiality and privacy</h4>\n<p>When encrypted data contains personal or sensitive information, its retrieval by an attacker can lead to privacy violations, identity theft,\nfinancial loss, reputational damage, or unauthorized access to confidential systems.</p>\n<p>In this scenario, the company, its employees, users, and partners could be seriously affected.</p>\n<p>The impact is twofold, as data breaches and exposure of encrypted data can undermine trust in the organization, as customers, clients and\nstakeholders may lose confidence in the organization’s ability to protect their sensitive data.</p>\n<h4>Legal and compliance issues</h4>\n<p>In many industries and locations, there are legal and compliance requirements to protect sensitive data. If encrypted data is compromised and the\nplaintext can be recovered, companies face legal consequences, penalties, or violations of privacy laws.</p>\n<h2>How to fix it in .NET</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<p>These samples use a default TLS algorithm, which is a weak cryptographical algorithm: TLSv1.0.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nImports System.Net\nImports System.Security.Authentication\n\nPublic Sub Encrypt()\n    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls ' Noncompliant\nEnd Sub\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nImports System.Net.Http\nImports System.Security.Authentication\n\nPublic Sub Encrypt()\n    Dim Handler As New HttpClientHandler With {\n        .SslProtocols = SslProtocols.Tls ' Noncompliant\n    }\nEnd Sub\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nImports System.Net\nImports System.Security.Authentication\n\nPublic Sub Encrypt()\n    ServicePointManager.SecurityProtocol = _\n        SecurityProtocolType.Tls12 _\n        Or SecurityProtocolType.Tls13\nEnd Sub\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nImports System.Net.Http\nImports System.Security.Authentication\n\nPublic Sub Encrypt()\n    Dim Handler As New HttpClientHandler With {\n        .SslProtocols = SslProtocols.Tls12\n    }\nEnd Sub\n</pre>\n<h3>How does this work?</h3>\n<p>As a rule of thumb, by default you should use the cryptographic algorithms and mechanisms that are considered strong by the cryptographic\ncommunity.</p>\n<p>The best choices at the moment are the following.</p>\n<h4>Use TLS v1.2 or TLS v1.3</h4>\n<p>Even though TLS V1.3 is available, using TLS v1.2 is still considered good and secure practice by the cryptography community.\n  <br></p>\n<p>The use of TLS v1.2 ensures compatibility with a wide range of platforms and enables seamless communication between different systems that do not\nyet have TLS v1.3 support.</p>\n<p>The only drawback depends on whether the framework used is outdated: its TLS v1.2 settings may enable older and insecure cipher suites that are\ndeprecated as insecure.</p>\n<p>On the other hand, TLS v1.3 removes support for older and weaker cryptographic algorithms, eliminates known vulnerabilities from previous TLS\nversions, and improves performance.</p>\n<h2>Resources</h2>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Padding_oracle_attack\">Wikipedia, Padding Oracle Attack</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Chosen-ciphertext_attack\">Wikipedia, Chosen-Ciphertext Attack</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Chosen-plaintext_attack\">Wikipedia, Chosen-Plaintext Attack</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Semantic_security\">Wikipedia, Semantically Secure Cryptosystems</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Optimal_asymmetric_encryption_padding\">Wikipedia, OAEP</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Galois/Counter_Mode\">Wikipedia, Galois/Counter Mode</a></li>\n</ul>\n<h3>Standards</h3>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A02_2021-Cryptographic_Failures/\">Top 10 2021 Category A2 - Cryptographic Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures/\">Top 10 2021 Category A7 - Identification and\n  Authentication Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure\">Top 10 2017 Category A3 - Sensitive Data\n  Exposure</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A6_2017-Security_Misconfiguration\">Top 10 2017 Category A6 - Security\n  Misconfiguration</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/327\">CWE-327 - Use of a Broken or Risky Cryptographic Algorithm</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4423.json",
    "content": "{\n  \"title\": \"Weak SSL\\/TLS protocols should not be used\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"HIGH\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"2min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"privacy\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-4423\",\n  \"sqKey\": \"S4423\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      327,\n      326,\n      295\n    ],\n    \"OWASP\": [\n      \"A3\",\n      \"A6\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A2\",\n      \"A7\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"4.1\",\n      \"6.5.4\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"4.2.1\",\n      \"6.2.4\"\n    ],\n    \"ASVS 4.0\": [\n      \"8.3.7\",\n      \"9.1.2\",\n      \"9.1.3\"\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4428.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>To customize the default behavior for an export in the <a href=\"https://learn.microsoft.com/en-us/dotnet/framework/mef/\">Managed Extensibility\nFramework</a> (MEF), applying the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.composition.partcreationpolicyattribute\"><code>PartCreationPolicyAttribute</code></a>\nis necessary. For the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.composition.partcreationpolicyattribute\"><code>PartCreationPolicyAttribute</code></a>\nto be meaningful in the context of an export, the class must also be annotated with the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.composition.exportattribute\"><code>ExportAttribute</code></a>.</p>\n<p>This rule raises an issue when a class is annotated with the <code>PartCreationPolicyAttribute</code> but not with the\n<code>ExportAttribute</code>.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nImports System.ComponentModel.Composition\n\n&lt;PartCreationPolicy(CreationPolicy.Any)&gt; ' Noncompliant\nPublic Class FooBar\n    Inherits IFooBar\nEnd Class\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nImports System.ComponentModel.Composition\n\n&lt;Export(GetType(IFooBar))&gt;\n&lt;PartCreationPolicy(CreationPolicy.Any)&gt;\nPublic Class FooBar\n    Inherits IFooBar\nEnd Class\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/framework/mef/\">Managed Extensibility Framework (MEF)</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/framework/mef/attributed-programming-model-overview-mef\">Attributed\n  programming model overview (MEF)</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.composition.partcreationpolicyattribute\">PartCreationPolicyAttribute\n  Class</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.composition.exportattribute\">ExportAttribute\n  Class</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.composition.creationpolicy\">CreationPolicy\n  Enum</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li>Stefan Henneken - <a href=\"https://stefanhenneken.net/2015/11/08/mef-part-1-fundamentals-imports-and-exports/\">MEF Part 1 – Fundamentals,\n  Imports and Exports</a></li>\n  <li>Stefan Henneken - <a href=\"https://stefanhenneken.net/2019/01/26/mef-part-2-metadata-and-creation-policies/\">MEF Part 2 – Metadata and creation\n  policies</a></li>\n  <li>Stefan Henneken - <a href=\"https://stefanhenneken.net/2019/03/06/mef-part-3-life-cycle-management-and-monitoring/\">MEF Part 3 – Life cycle\n  management and monitoring</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4428.json",
    "content": "{\n  \"title\": \"\\\"PartCreationPolicyAttribute\\\" should be used with \\\"ExportAttribute\\\"\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"mef\",\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-4428\",\n  \"sqKey\": \"S4428\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4507.html",
    "content": "<p>Development tools and frameworks usually have options to make debugging easier for developers. Although these features are useful during\ndevelopment, they should never be enabled for applications deployed in production. Debug instructions or error messages can leak detailed information\nabout the system, like the application’s path or file names.</p>\n<h2>Ask Yourself Whether</h2>\n<ul>\n  <li>The code or configuration enabling the application debug features is deployed on production servers or distributed to end users.</li>\n  <li>The application runs by default with debug features activated.</li>\n</ul>\n<p>There is a risk if you answered yes to any of those questions.</p>\n<h2>Recommended Secure Coding Practices</h2>\n<p>Do not enable debugging features on production servers.</p>\n<p>The .Net Core framework offers multiple features which help during debug.\n<code>Microsoft.AspNetCore.Builder.IApplicationBuilder.UseDeveloperExceptionPage</code> and\n<code>Microsoft.AspNetCore.Builder.IApplicationBuilder.UseDatabaseErrorPage</code> are two of them. Make sure that those features are disabled in\nproduction.</p>\n<p>Use <code>If env.IsDevelopment()</code> to disable debug code.</p>\n<h2>Sensitive Code Example</h2>\n<p>This rule raises issues when the following .Net Core methods are called:\n<code>Microsoft.AspNetCore.Builder.IApplicationBuilder.UseDeveloperExceptionPage</code>,\n<code>Microsoft.AspNetCore.Builder.IApplicationBuilder.UseDatabaseErrorPage</code>.</p>\n<pre>\nImports Microsoft.AspNetCore.Builder\nImports Microsoft.AspNetCore.Hosting\n\nNamespace MyMvcApp\n    Public Class Startup\n        Public Sub Configure(ByVal app As IApplicationBuilder, ByVal env As IHostingEnvironment)\n            ' Those calls are Sensitive because it seems that they will run in production\n            app.UseDeveloperExceptionPage() 'Sensitive\n            app.UseDatabaseErrorPage() 'Sensitive\n        End Sub\n    End Class\nEnd Namespace\n</pre>\n<h2>Compliant Solution</h2>\n<pre>\nImports Microsoft.AspNetCore.Builder\nImports Microsoft.AspNetCore.Hosting\n\nNamespace MyMvcApp\n    Public Class Startup\n        Public Sub Configure(ByVal app As IApplicationBuilder, ByVal env As IHostingEnvironment)\n            If env.IsDevelopment() Then ' Compliant\n                ' The following calls are ok because they are disabled in production\n                app.UseDeveloperExceptionPage()\n                app.UseDatabaseErrorPage()\n            End If\n        End Sub\n    End Class\nEnd Namespace\n</pre>\n<h2>See</h2>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A05_2021-Security_Misconfiguration/\">Top 10 2021 Category A5 - Security Misconfiguration</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure\">Top 10 2017 Category A3 - Sensitive Data\n  Exposure</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/489\">CWE-489 - Active Debug Code</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/215\">CWE-215 - Information Exposure Through Debug Information</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4507.json",
    "content": "{\n  \"title\": \"Delivering code in production with debug features activated is security-sensitive\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"LOW\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"error-handling\",\n    \"debug\",\n    \"user-experience\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-4507\",\n  \"sqKey\": \"S4507\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      489,\n      215\n    ],\n    \"OWASP\": [\n      \"A3\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A5\"\n    ],\n    \"ASVS 4.0\": [\n      \"14.3.2\"\n    ]\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4545.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The <code>DebuggerDisplayAttribute</code> is used to determine how an object is displayed in the debugger window.</p>\n<p>The <code>DebuggerDisplayAttribute</code> constructor takes a single mandatory argument: the string to be displayed in the value column for\ninstances of the type. Any text within curly braces is evaluated as the name of a field or property, or any complex expression containing method calls\nand operators.</p>\n<p>Naming a non-existent member between curly braces will result in a BC30451 error in the debug window when debugging objects. Although there is no\nimpact on the production code, providing a wrong value can lead to difficulties when debugging the application.</p>\n<p>This rule raises an issue when text specified between curly braces refers to members that don’t exist in the current context.</p>\n<h3>Noncompliant code example</h3>\n<pre>\n&lt;DebuggerDisplay(\"Name: {Name}\")&gt; ' Noncompliant - Name doesn't exist in this context\nPublic Class Person\n\n    Public Property FullName As String\n\nEnd Class\n</pre>\n<h3>Compliant solution</h3>\n<pre>\n&lt;DebuggerDisplay(\"Name: {FullName}\")&gt;\nPublic Class Person\n\n    Public Property FullName As String\n\nEnd Class\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4545.json",
    "content": "{\n  \"title\": \"\\\"DebuggerDisplayAttribute\\\" strings should reference existing members\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-4545\",\n  \"sqKey\": \"S4545\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4581.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When the syntax <code>new Guid()</code> (i.e. parameterless instantiation) is used, it must be that one of three things is wanted:</p>\n<ol>\n  <li>An empty GUID, in which case <code>Guid.Empty</code> is clearer.</li>\n  <li>A randomly-generated GUID, in which case <code>Guid.NewGuid()</code> should be used.</li>\n  <li>A new GUID with a specific initialization, in which case the initialization parameter is missing.</li>\n</ol>\n<p>This rule raises an issue when a parameterless instantiation of the <code>Guid</code> struct is found.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nPublic Sub Foo()\n    Dim G1 As New Guid        ' Noncompliant - what's the intent?\n    Dim G2 As Guid = Nothing  ' Noncompliant\nEnd Sub\n</pre>\n<h3>Compliant solution</h3>\n<pre>\npublic void Foo(byte[] bytes)\nPublic Sub Foo(Bytes As Byte())\n    Dim G1 As Guid = Guid.Empty\n    Dim G2 As Guid = Guid.NewGuid()\n    Dim G3 As Guid = New Guid(Bytes)\nEnd Sub\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4581.json",
    "content": "{\n  \"title\": \"\\\"new Guid()\\\" should not be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5 min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-4581\",\n  \"sqKey\": \"S4581\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4583.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When calling the <code>BeginInvoke</code> method of a <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.delegate\">delegate</a>,\nresources are allocated that are only freed up when <code>EndInvoke</code> is called. Failing to pair <code>BeginInvoke</code> with\n<code>EndInvoke</code> can lead to <a href=\"https://en.wikipedia.org/wiki/Resource_leak\">resource leaks</a> and incomplete asynchronous calls.</p>\n<p>This rule raises an issue in the following scenarios:</p>\n<ul>\n  <li>The <code>BeginInvoke</code> method is called without any callback, and it is not paired with a call to <code>EndInvoke</code> in the same\n  block.</li>\n  <li>A callback with a single parameter of type <code>IAsyncResult</code> does not contain a call to <code>EndInvoke</code> in the same block.</li>\n</ul>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<p><code>BeginInvoke</code> without callback:</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nPublic Delegate Function AsyncMethodCaller() As String\n\nPublic Class Sample\n\n    Public Sub DoSomething()\n        Dim Example As New AsyncExample()\n        Dim Caller As New AsyncMethodCaller(Example.SomeMethod)\n        ' Initiate the asynchronous call.\n        Dim Result As IAsyncResult = Caller.BeginInvoke(Nothing, Nothing) ' Noncompliant: Not paired With EndInvoke\n    End Sub\n\nEnd Class\n</pre>\n<p><code>BeginInvoke</code> with callback:</p>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nPublic Delegate Function AsyncMethodCaller() As String\n\nPublic Class Sample\n\n    Public Sub DoSomething()\n        Dim Example As New AsyncExample()\n        Dim Caller As New AsyncMethodCaller(Example.SomeMethod)\n        ' Initiate the asynchronous call.\n        Dim Result As IAsyncResult = Caller.BeginInvoke(New AsyncCallback(Sub(ar)\n                                                                          End Sub), Nothing) ' Noncompliant: Not paired With EndInvoke\n    End Sub\n\nEnd Class\n</pre>\n<h4>Compliant solution</h4>\n<p><code>BeginInvoke</code> without callback:</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nPublic Delegate Function AsyncMethodCaller() As String\n\nPublic Class Sample\n\n    Public Function DoSomething() As String\n        Dim Example As New AsyncExample()\n        Dim Caller As New AsyncMethodCaller(Example.SomeMethod)\n        ' Initiate the asynchronous call.\n        Dim Result As IAsyncResult = Caller.BeginInvoke(Nothing, Nothing)\n        ' ...\n        Return Caller.EndInvoke(Result)\n    End Function\n\nEnd Class\n</pre>\n<p><code>BeginInvoke</code> with callback:</p>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nPublic Delegate Function AsyncMethodCaller() As String\n\nPublic Class Sample\n\n    Public Sub DoSomething()\n        Dim Example As New AsyncExample()\n        Dim Caller As New AsyncMethodCaller(Example.SomeMethod)\n        ' Initiate the asynchronous call.\n        Dim Result As IAsyncResult = Caller.BeginInvoke(New AsyncCallback(Sub(ar)\n                                                                              ' Call EndInvoke to retrieve the results.\n                                                                              Dim Ret As String = Caller.EndInvoke(ar)\n                                                                              ' ...\n                                                                          End Sub), Nothing)\n    End Sub\n\nEnd Class\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/asynchronous-programming-patterns/calling-synchronous-methods-asynchronously\">Calling\n  Synchronous Methods Asynchronously</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-using-delegates\">Asynchronous\n  Programming Using Delegates</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.control.begininvoke\">BeginInvoke()</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.control.endinvoke\">EndInvoke()</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.asynccallback\">AsyncCallback Delegate</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4583.json",
    "content": "{\n  \"title\": \"Calls to delegate\\u0027s method \\\"BeginInvoke\\\" should be paired with calls to \\\"EndInvoke\\\"\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-4583\",\n  \"sqKey\": \"S4583\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4586.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Returning <code>Nothing</code> from a non-<code>Async</code> <code>Task</code>/<code>Task(Of TResult)</code> procedure will cause a\n<code>NullReferenceException</code> at runtime if the procedure is awaited. This problem can be avoided by returning <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task.completedtask\"><code>Task.CompletedTask</code></a> or <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task.fromresult\"><code>Task.FromResult(Of TResult)(Nothing)</code></a>\nrespectively.</p>\n<pre>\nPublic Function DoFooAsync() As Task\n    Return Nothing            ' Noncompliant: Causes a NullReferenceException if awaited.\nEnd Function\n\nPublic Async Function Main() As Task\n    Await DoFooAsync()        ' NullReferenceException\nEnd Function\n</pre>\n<h2>How to fix it</h2>\n<p>Instead of <code>Nothing</code> <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task.completedtask\"><code>Task.CompletedTask</code></a> or <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task.fromresult\"><code>Task.FromResult(Of TResult)(Nothing)</code></a>\nshould be returned.</p>\n<h3>Code examples</h3>\n<p>A <code>Task</code> returning procedure can be fixed like so:</p>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nPublic Function DoFooAsync() As Task\n    Return Nothing            ' Noncompliant: Causes a NullReferenceException if awaited.\nEnd Function\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nPublic Function DoFooAsync() As Task\n    Return Task.CompletedTask ' Compliant: Method can be awaited.\nEnd Function\n</pre>\n<p>A <code>Task(Of TResult)</code> returning procedure can be fixed like so:</p>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nPublic Function GetFooAsync() As Task(Of Object)\n    Return Nothing                             ' Noncompliant: Causes a NullReferenceException if awaited.\nEnd Function\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nPublic Function GetFooAsync() As Task(Of Object)\n    Return Task.FromResult(Of Object)(Nothing) ' Compliant: Method can be awaited.\nEnd Function\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task.completedtask\"><code>Task.CompletedTask</code> Property</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task.fromresult\"><code>Task.FromResult&lt;TResult&gt;(TResult)</code>\n  Method</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li>StackOverflow - Answer by Stephen Cleary for <a href=\"https://stackoverflow.com/a/45350108\">Is it better to return an empty task or\n  null?</a></li>\n  <li>StackOverflow - Answer by Stephen Cleary for <a href=\"https://stackoverflow.com/a/27551261\">Best way to handle null task inside async\n  method?</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4586.json",
    "content": "{\n  \"title\": \"Non-async \\\"Task\\/Task\\u003cT\\u003e\\\" methods should not return null\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5 min\"\n  },\n  \"tags\": [\n    \"async-await\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-4586\",\n  \"sqKey\": \"S4586\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4663.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Empty comments, as shown in the example, hurt readability and might indicate an oversight.</p>\n<pre>\n'\n\n'''\n</pre>\n<p>Some meaningful text should be added to the comment, or the comment markers should be removed.</p>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4663.json",
    "content": "{\n  \"title\": \"Comments should not be empty\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-4663\",\n  \"sqKey\": \"S4663\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4790.html",
    "content": "<p>Cryptographic hash algorithms such as <code>MD2</code>, <code>MD4</code>, <code>MD5</code>, <code>MD6</code>, <code>HAVAL-128</code>,\n<code>DSA</code> (which uses <code>SHA-1</code>), <code>RIPEMD</code>, <code>RIPEMD-128</code>, <code>RIPEMD-160</code>and <code>SHA-1</code> are no\nlonger considered secure, because it is possible to have <code>collisions</code> (little computational effort is enough to find two or more different\ninputs that produce the same hash).</p>\n<p>Message authentication code (MAC) algorithms such as <code>HMAC-MD5</code> or <code>HMAC-SHA1</code> use weak hash functions as building blocks.\nAlthough they are not all proven to be weak, they are considered legacy algorithms and should be avoided.</p>\n<h2>Ask Yourself Whether</h2>\n<p>The hashed value is used in a security context like:</p>\n<ul>\n  <li>User-password storage.</li>\n  <li>Security token generation (used to confirm e-mail when registering on a website, reset password, etc …​).</li>\n  <li>To compute some message integrity.</li>\n</ul>\n<p>There is a risk if you answered yes to any of those questions.</p>\n<h2>Recommended Secure Coding Practices</h2>\n<p>Safer alternatives, such as <code>SHA-256</code>, <code>SHA-512</code>, <code>SHA-3</code> are recommended, and for password hashing, it’s even\nbetter to use algorithms that do not compute too \"quickly\", like <code>bcrypt</code>, <code>scrypt</code>, <code>argon2</code> or <code>pbkdf2</code>\nbecause it slows down <code>brute force attacks</code>.</p>\n<h2>Sensitive Code Example</h2>\n<pre>\nImports System.Security.Cryptography\n\nSub ComputeHash()\n\n    ' Review all instantiations of classes that inherit from HashAlgorithm, for example:\n    Dim hashAlgo As HashAlgorithm = HashAlgorithm.Create() ' Sensitive\n    Dim hashAlgo2 As HashAlgorithm = HashAlgorithm.Create(\"SHA1\") ' Sensitive\n    Dim sha As SHA1 = New SHA1CryptoServiceProvider() ' Sensitive\n    Dim md5 As MD5 = New MD5CryptoServiceProvider() ' Sensitive\n\n    ' ...\nEnd Sub\n\nClass MyHashAlgorithm\n    Inherits HashAlgorithm ' Sensitive\n\n    ' ...\nEnd Class\n</pre>\n<h2>Compliant Solution</h2>\n<pre>\nImports System.Security.Cryptography\n\nSub ComputeHash()\n    Dim sha256 = New SHA256CryptoServiceProvider() ' Compliant\n    Dim sha384 = New SHA384CryptoServiceProvider() ' Compliant\n    Dim sha512 = New SHA512CryptoServiceProvider() ' Compliant\n\n    ' ...\nEnd Sub\n</pre>\n<h2>See</h2>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A02_2021-Cryptographic_Failures/\">Top 10 2021 Category A2 - Cryptographic Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure\">Top 10 2017 Category A3 - Sensitive Data\n  Exposure</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A6_2017-Security_Misconfiguration\">Top 10 2017 Category A6 - Security\n  Misconfiguration</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/1240\">CWE-1240 - Use of a Risky Cryptographic Primitive</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4790.json",
    "content": "{\n  \"title\": \"Using weak hashing algorithms is security-sensitive\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"HIGH\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  },\n  \"status\": \"ready\",\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-4790\",\n  \"sqKey\": \"S4790\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      1240\n    ],\n    \"OWASP\": [\n      \"A3\",\n      \"A6\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A2\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"3.4\",\n      \"6.5.3\",\n      \"6.5.4\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"6.2.4\"\n    ]\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4792.html",
    "content": "<p>This rule is deprecated, and will eventually be removed.</p>\n<p>Configuring loggers is security-sensitive. It has led in the past to the following vulnerabilities:</p>\n<ul>\n  <li><a href=\"https://www.cve.org/CVERecord?id=CVE-2018-0285\">CVE-2018-0285</a></li>\n  <li><a href=\"https://www.cve.org/CVERecord?id=CVE-2000-1127\">CVE-2000-1127</a></li>\n  <li><a href=\"https://www.cve.org/CVERecord?id=CVE-2017-15113\">CVE-2017-15113</a></li>\n  <li><a href=\"https://www.cve.org/CVERecord?id=CVE-2015-5742\">CVE-2015-5742</a></li>\n</ul>\n<p>Logs are useful before, during and after a security incident.</p>\n<ul>\n  <li>Attackers will most of the time start their nefarious work by probing the system for vulnerabilities. Monitoring this activity and stopping it\n  is the first step to prevent an attack from ever happening.</li>\n  <li>In case of a successful attack, logs should contain enough information to understand what damage an attacker may have inflicted.</li>\n</ul>\n<p>Logs are also a target for attackers because they might contain sensitive information. Configuring loggers has an impact on the type of information\nlogged and how they are logged.</p>\n<p>This rule flags for review code that initiates loggers configuration. The goal is to guide security code reviews.</p>\n<h2>Ask Yourself Whether</h2>\n<ul>\n  <li>unauthorized users might have access to the logs, either because they are stored in an insecure location or because the application gives access\n  to them.</li>\n  <li>the logs contain sensitive information on a production server. This can happen when the logger is in debug mode.</li>\n  <li>the log can grow without limit. This can happen when additional information is written into logs every time a user performs an action and the\n  user can perform the action as many times as he/she wants.</li>\n  <li>the logs do not contain enough information to understand the damage an attacker might have inflicted. The loggers mode (info, warn, error) might\n  filter out important information. They might not print contextual information like the precise time of events or the server hostname.</li>\n  <li>the logs are only stored locally instead of being backuped or replicated.</li>\n</ul>\n<p>There is a risk if you answered yes to any of those questions.</p>\n<h2>Recommended Secure Coding Practices</h2>\n<ul>\n  <li>Check that your production deployment doesn’t have its loggers in \"debug\" mode as it might write sensitive information in logs.</li>\n  <li>Production logs should be stored in a secure location which is only accessible to system administrators.</li>\n  <li>Configure the loggers to display all warnings, info and error messages. Write relevant information such as the precise time of events and the\n  hostname.</li>\n  <li>Choose log format which is easy to parse and process automatically. It is important to process logs rapidly in case of an attack so that the\n  impact is known and limited.</li>\n  <li>Check that the permissions of the log files are correct. If you index the logs in some other service, make sure that the transfer and the\n  service are secure too.</li>\n  <li>Add limits to the size of the logs and make sure that no user can fill the disk with logs. This can happen even when the user does not control\n  the logged information. An attacker could just repeat a logged action many times.</li>\n</ul>\n<p>Remember that configuring loggers properly doesn’t make them bullet-proof. Here is a list of recommendations explaining on how to use your\nlogs:</p>\n<ul>\n  <li>Don’t log any sensitive information. This obviously includes passwords and credit card numbers but also any personal information such as user\n  names, locations, etc…​ Usually any information which is protected by law is good candidate for removal.</li>\n  <li>Sanitize all user inputs before writing them in the logs. This includes checking its size, content, encoding, syntax, etc…​ As for any user\n  input, validate using whitelists whenever possible. Enabling users to write what they want in your logs can have many impacts. It could for example\n  use all your storage space or compromise your log indexing service.</li>\n  <li>Log enough information to monitor suspicious activities and evaluate the impact an attacker might have on your systems. Register events such as\n  failed logins, successful logins, server side input validation failures, access denials and any important transaction.</li>\n  <li>Monitor the logs for any suspicious activity.</li>\n</ul>\n<h2>Sensitive Code Example</h2>\n<p><strong>.Net Core</strong>: configure programmatically</p>\n<pre>\nImports System\nImports System.Collections\nImports System.Collections.Generic\nImports Microsoft.AspNetCore\nImports Microsoft.AspNetCore.Builder\nImports Microsoft.AspNetCore.Hosting\nImports Microsoft.Extensions.Configuration\nImports Microsoft.Extensions.DependencyInjection\nImports Microsoft.Extensions.Logging\nImports Microsoft.Extensions.Options\n\nNamespace MvcApp\n\n    Public Class ProgramLogging\n\n        Public Shared Function CreateWebHostBuilder(args As String()) As IWebHostBuilder\n\n            WebHost.CreateDefaultBuilder(args) _\n                .ConfigureLogging(Function(hostingContext, Logging) ' Sensitive\n                                      ' ...\n                                  End Function) _\n            .UseStartup(Of StartupLogging)()\n\n            '...\n        End Function\n    End Class\n\n\n    Public Class StartupLogging\n\n        Public Sub ConfigureServices(services As IServiceCollection)\n\n            services.AddLogging(Function(logging) ' Sensitive\n                                    '...\n                                End Function)\n        End Sub\n\n        Public Sub Configure(app As IApplicationBuilder, env As IHostingEnvironment, loggerFactory As ILoggerFactory)\n\n            Dim config As IConfiguration = Nothing\n            Dim level As LogLevel = LogLevel.Critical\n            Dim includeScopes As Boolean = False\n            Dim filter As Func(Of String, Microsoft.Extensions.Logging.LogLevel, Boolean) = Nothing\n            Dim consoleSettings As Microsoft.Extensions.Logging.Console.IConsoleLoggerSettings = Nothing\n            Dim azureSettings As Microsoft.Extensions.Logging.AzureAppServices.AzureAppServicesDiagnosticsSettings = Nothing\n            Dim eventLogSettings As Microsoft.Extensions.Logging.EventLog.EventLogSettings = Nothing\n\n            ' An issue will be raised for each call to an ILoggerFactory extension methods adding loggers.\n            loggerFactory.AddAzureWebAppDiagnostics() ' Sensitive\n            loggerFactory.AddAzureWebAppDiagnostics(azureSettings) ' Sensitive\n            loggerFactory.AddConsole() ' Sensitive\n            loggerFactory.AddConsole(level) ' Sensitive\n            loggerFactory.AddConsole(level, includeScopes) ' Sensitive\n            loggerFactory.AddConsole(filter) ' Sensitive\n            loggerFactory.AddConsole(filter, includeScopes) ' Sensitive\n            loggerFactory.AddConsole(config) ' Sensitive\n            loggerFactory.AddConsole(consoleSettings) ' Sensitive\n            loggerFactory.AddDebug() ' Sensitive\n            loggerFactory.AddDebug(level) ' Sensitive\n            loggerFactory.AddDebug(filter) ' Sensitive\n            loggerFactory.AddEventLog() ' Sensitive\n            loggerFactory.AddEventLog(eventLogSettings) ' Sensitive\n            loggerFactory.AddEventLog(level) ' Sensitive\n            ' Only available for NET Standard 2.0 and above\n            'loggerFactory.AddEventSourceLogger() ' Sensitive\n\n            Dim providers As IEnumerable(Of ILoggerProvider) = Nothing\n            Dim filterOptions1 As LoggerFilterOptions = Nothing\n            Dim filterOptions2 As IOptionsMonitor(Of LoggerFilterOptions) = Nothing\n\n            Dim factory As LoggerFactory = New LoggerFactory() ' Sensitive\n            factory = New LoggerFactory(providers) ' Sensitive\n            factory = New LoggerFactory(providers, filterOptions1) ' Sensitive\n            factory = New LoggerFactory(providers, filterOptions2) ' Sensitive\n        End Sub\n    End Class\nEnd Namespace\n</pre>\n<p><strong>Log4Net</strong></p>\n<pre>\nImports System\nImports System.IO\nImports System.Xml\nImports log4net.Appender\nImports log4net.Config\nImports log4net.Repository\n\nNamespace Logging\n    Class Log4netLogging\n        Private Sub Foo(ByVal repository As ILoggerRepository, ByVal element As XmlElement, ByVal configFile As FileInfo, ByVal configUri As Uri, ByVal configStream As Stream, ByVal appender As IAppender, ParamArray appenders As IAppender())\n            log4net.Config.XmlConfigurator.Configure(repository) ' Sensitive\n            log4net.Config.XmlConfigurator.Configure(repository, element) ' Sensitive\n            log4net.Config.XmlConfigurator.Configure(repository, configFile) ' Sensitive\n            log4net.Config.XmlConfigurator.Configure(repository, configUri) ' Sensitive\n            log4net.Config.XmlConfigurator.Configure(repository, configStream) ' Sensitive\n            log4net.Config.XmlConfigurator.ConfigureAndWatch(repository, configFile) ' Sensitive\n\n            log4net.Config.DOMConfigurator.Configure() ' Sensitive\n            log4net.Config.DOMConfigurator.Configure(repository) ' Sensitive\n            log4net.Config.DOMConfigurator.Configure(element) ' Sensitive\n            log4net.Config.DOMConfigurator.Configure(repository, element) ' Sensitive\n            log4net.Config.DOMConfigurator.Configure(configFile) ' Sensitive\n            log4net.Config.DOMConfigurator.Configure(repository, configFile) ' Sensitive\n            log4net.Config.DOMConfigurator.Configure(configStream) ' Sensitive\n            log4net.Config.DOMConfigurator.Configure(repository, configStream) ' Sensitive\n            log4net.Config.DOMConfigurator.ConfigureAndWatch(configFile) ' Sensitive\n            log4net.Config.DOMConfigurator.ConfigureAndWatch(repository, configFile) ' Sensitive\n\n            log4net.Config.BasicConfigurator.Configure() ' Sensitive\n            log4net.Config.BasicConfigurator.Configure(appender) ' Sensitive\n            log4net.Config.BasicConfigurator.Configure(appenders) ' Sensitive\n            log4net.Config.BasicConfigurator.Configure(repository) ' Sensitive\n            log4net.Config.BasicConfigurator.Configure(repository, appender) ' Sensitive\n            log4net.Config.BasicConfigurator.Configure(repository, appenders) ' Sensitive\n        End Sub\n    End Class\nEnd Namespace\n</pre>\n<p><strong>NLog</strong>: configure programmatically</p>\n<pre>\nNamespace Logging\n    Class NLogLogging\n        Private Sub Foo(ByVal config As NLog.Config.LoggingConfiguration)\n            NLog.LogManager.Configuration = config ' Sensitive\n        End Sub\n    End Class\nEnd Namespace\n</pre>\n<p><strong>Serilog</strong></p>\n<pre>\nNamespace Logging\n    Class SerilogLogging\n        Private Sub Foo()\n            Dim config As Serilog.LoggerConfiguration = New Serilog.LoggerConfiguration() ' Sensitive\n        End Sub\n    End Class\nEnd Namespace\n</pre>\n<h2>See</h2>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A09_2021-Security_Logging_and_Monitoring_Failures/\">Top 10 2021 Category A9 - Security Logging and\n  Monitoring Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure\">Top 10 2017 Category A3 - Sensitive Data\n  Exposure</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A10_2017-Insufficient_Logging%2526Monitoring\">Top 10 2017 Category A10 -\n  Insufficient Logging &amp; Monitoring</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/117\">CWE-117 - Improper Output Neutralization for Logs</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/532\">CWE-532 - Information Exposure Through Log Files</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4792.json",
    "content": "{\n  \"title\": \"Configuring loggers is security-sensitive\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"HIGH\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"deprecated\",\n  \"tags\": [],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-4792\",\n  \"sqKey\": \"S4792\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      117,\n      532\n    ],\n    \"OWASP\": [\n      \"A3\",\n      \"A10\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A9\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"10.1\",\n      \"10.2\",\n      \"10.3\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"10.2\"\n    ],\n    \"ASVS 4.0\": [\n      \"7.1.1\",\n      \"7.1.2\"\n    ]\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4830.html",
    "content": "<p>This vulnerability makes it possible that an encrypted communication is intercepted.</p>\n<h2>Why is this an issue?</h2>\n<p>Transport Layer Security (TLS) provides secure communication between systems over the internet by encrypting the data sent between them.\nCertificate validation adds an extra layer of trust and security to this process to ensure that a system is indeed the one it claims to be.</p>\n<p>When certificate validation is disabled, the client skips a critical security check. This creates an opportunity for attackers to pose as a trusted\nentity and intercept, manipulate, or steal the data being transmitted.</p>\n<h3>What is the potential impact?</h3>\n<p>Establishing trust in a secure way is a non-trivial task. When you disable certificate validation, you are removing a key mechanism designed to\nbuild this trust in internet communication, opening your system up to a number of potential threats.</p>\n<h4>Identity spoofing</h4>\n<p>If a system does not validate certificates, it cannot confirm the identity of the other party involved in the communication. An attacker can\nexploit this by creating a fake server and masquerading as a legitimate one. For example, they might set up a server that looks like your bank’s\nserver, tricking your system into thinking it is communicating with the bank. This scenario, called identity spoofing, allows the attacker to collect\nany data your system sends to them, potentially leading to significant data breaches.</p>\n<h4>Loss of data integrity</h4>\n<p>When TLS certificate validation is disabled, the integrity of the data you send and receive cannot be guaranteed. An attacker could modify the data\nin transit, and you would have no way of knowing. This could range from subtle manipulations of the data you receive to the injection of malicious\ncode or malware into your system. The consequences of such breaches of data integrity can be severe, depending on the nature of the data and the\nsystem.</p>\n<h2>How to fix it in .NET</h2>\n<h3>Code examples</h3>\n<p>In the following example, the callback change impacts the entirety of HTTP requests made by the application.</p>\n<p>The certificate validation gets disabled by overriding <code>ServerCertificateValidationCallback</code> with an empty implementation. It is highly\nrecommended to use the original implementation.</p>\n<h4>Noncompliant code example</h4>\n<pre>\nImports System.Net\n\nPublic Sub Send()\n    ServicePointManager.ServerCertificateValidationCallback =\n        Function(sender, certificate, chain, errors) True ' Noncompliant\n\n    Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(New System.Uri(\"https://example.com\"))\n    request.Method = System.Net.WebRequestMethods.Http.Get\n    Dim response As System.Net.HttpWebResponse = request.GetResponse()\n    response.Close()\nEnd Sub\n</pre>\n<h3>How does this work?</h3>\n<p>Addressing the vulnerability of disabled TLS certificate validation primarily involves re-enabling the default validation.</p>\n<p>To avoid running into problems with invalid certificates, consider the following sections.</p>\n<h4>Using trusted certificates</h4>\n<p>If possible, always use a certificate issued by a well-known, trusted CA for your server. Most programming environments come with a predefined list\nof trusted root CAs, and certificates issued by these authorities are validated automatically. This is the best practice, and it requires no\nadditional code or configuration.</p>\n<h4>Working with self-signed certificates or non-standard CAs</h4>\n<p>In some cases, you might need to work with a server using a self-signed certificate, or a certificate issued by a CA not included in your trusted\nroots. Rather than disabling certificate validation in your code, you can add the necessary certificates to your trust store.</p>\n<h2>Resources</h2>\n<h3>Standards</h3>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A02_2021-Cryptographic_Failures/\">Top 10 2021 Category A2 - Cryptographic Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A05_2021-Security_Misconfiguration/\">Top 10 2021 Category A5 - Security Misconfiguration</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures/\">Top 10 2021 Category A7 - Identification and\n  Authentication Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure\">Top 10 2017 Category A3 - Sensitive Data\n  Exposure</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A6_2017-Security_Misconfiguration\">Top 10 2017 Category A6 - Security\n  Misconfiguration</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/295\">CWE-295 - Improper Certificate Validation</a></li>\n  <li>STIG Viewer - <a href=\"https://stigviewer.com/stigs/application_security_and_development/2024-12-06/finding/V-222550\">Application Security and\n  Development: V-222550</a> - The application must validate certificates by constructing a certification path to an accepted trust anchor.</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S4830.json",
    "content": "{\n  \"title\": \"Server certificates should be verified during SSL\\/TLS connections\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"HIGH\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"privacy\",\n    \"ssl\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-4830\",\n  \"sqKey\": \"S4830\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      295\n    ],\n    \"OWASP\": [\n      \"A6\",\n      \"A3\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A2\",\n      \"A5\",\n      \"A7\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"4.1\",\n      \"6.5.4\",\n      \"6.5.10\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"4.2.1\",\n      \"6.2.4\"\n    ],\n    \"ASVS 4.0\": [\n      \"1.9.2\",\n      \"9.2.1\"\n    ],\n    \"STIG ASD_V5R3\": [\n      \"V-222550\"\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S5042.html",
    "content": "<p>Successful Zip Bomb attacks occur when an application expands untrusted archive files without controlling the size of the expanded data, which can\nlead to denial of service. A Zip bomb is usually a malicious archive file of a few kilobytes of compressed data but turned into gigabytes of\nuncompressed data. To achieve this extreme <a href=\"https://en.wikipedia.org/wiki/Data_compression_ratio\">compression ratio</a>, attackers will\ncompress irrelevant data (eg: a long string of repeated bytes).</p>\n<h2>Ask Yourself Whether</h2>\n<p>Archives to expand are untrusted and:</p>\n<ul>\n  <li>There is no validation of the number of entries in the archive.</li>\n  <li>There is no validation of the total size of the uncompressed data.</li>\n  <li>There is no validation of the ratio between the compressed and uncompressed archive entry.</li>\n</ul>\n<p>There is a risk if you answered yes to any of those questions.</p>\n<h2>Recommended Secure Coding Practices</h2>\n<ul>\n  <li>Define and control the ratio between compressed and uncompressed data, in general the data compression ratio for most of the legit archives is 1\n  to 3.</li>\n  <li>Define and control the threshold for maximum total size of the uncompressed data.</li>\n  <li>Count the number of file entries extracted from the archive and abort the extraction if their number is greater than a predefined threshold, in\n  particular it’s not recommended to recursively expand archives (an entry of an archive could be also an archive).</li>\n</ul>\n<h2>Sensitive Code Example</h2>\n<pre>\nFor Each entry As ZipArchiveEntry in archive.Entries\n    ' entry.FullName could contain parent directory references \"..\" and the destinationPath variable could become outside of the desired path\n    string destinationPath = Path.GetFullPath(Path.Combine(path, entry.FullName))\n    entry.ExtractToFile(destinationPath) ' Sensitive, extracts the entry to a file\n\n    Dim stream As Stream\n    stream = entry.Open() ' Sensitive, the entry is about to be extracted\nNext\n</pre>\n<h2>Compliant Solution</h2>\n<pre>\nConst ThresholdRatio As Double = 10\nConst ThresholdSize As Integer = 1024 * 1024 * 1024 ' 1 GB\nConst ThresholdEntries As Integer = 10000\nDim TotalSizeArchive, TotalEntryArchive, TotalEntrySize, Cnt As Integer\nDim Buffer(1023) As Byte\nUsing ZipToOpen As New FileStream(\"ZipBomb.zip\", FileMode.Open), Archive As New ZipArchive(ZipToOpen, ZipArchiveMode.Read)\n    For Each Entry As ZipArchiveEntry In Archive.Entries\n        Using s As Stream = Entry.Open\n            TotalEntryArchive += 1\n            TotalEntrySize = 0\n            Do\n                Cnt = s.Read(Buffer, 0, Buffer.Length)\n                TotalEntrySize += Cnt\n                TotalSizeArchive += Cnt\n                If TotalEntrySize / Entry.CompressedLength &gt; ThresholdRatio Then Exit Do    ' Ratio between compressed And uncompressed data Is highly suspicious, looks Like a Zip Bomb Attack\n            Loop While Cnt &gt; 0\n        End Using\n        If TotalSizeArchive &gt; ThresholdSize Then Exit For       ' The uncompressed data size Is too much for the application resource capacity\n        If TotalEntryArchive &gt; ThresholdEntries Then Exit For   ' Too much entries in this archive, can lead to inodes exhaustion of the system\n    Next\nEnd Using\n</pre>\n<h2>See</h2>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A01_2021-Broken_Access_Control/\">Top 10 2021 Category A1 - Broken Access Control</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A05_2021-Security_Misconfiguration/\">Top 10 2021 Category A5 - Security Misconfiguration</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A5_2017-Broken_Access_Control\">Top 10 2017 Category A5 - Broken Access\n  Control</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A6_2017-Security_Misconfiguration\">Top 10 2017 Category A6 - Security\n  Misconfiguration</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/409\">CWE-409 - Improper Handling of Highly Compressed Data (Data Amplification)</a></li>\n  <li><a href=\"https://www.bamsoftware.com/hacks/zipbomb/\">bamsoftware.com</a> - A better Zip Bomb</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S5042.json",
    "content": "{\n  \"title\": \"Expanding archive files without controlling resource consumption is security-sensitive\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"HIGH\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-5042\",\n  \"sqKey\": \"S5042\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      409\n    ],\n    \"OWASP\": [\n      \"A5\",\n      \"A6\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A1\",\n      \"A5\"\n    ],\n    \"ASVS 4.0\": [\n      \"12.1.2\"\n    ]\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S5443.html",
    "content": "<p>Operating systems have global directories where any user has write access. Those folders are mostly used as temporary storage areas like\n<code>/tmp</code> in Linux based systems. An application manipulating files from these folders is exposed to race conditions on filenames: a malicious\nuser can try to create a file with a predictable name before the application does. A successful attack can result in other files being accessed,\nmodified, corrupted or deleted. This risk is even higher if the application runs with elevated permissions.</p>\n<p>In the past, it has led to the following vulnerabilities:</p>\n<ul>\n  <li><a href=\"https://nvd.nist.gov/vuln/detail/CVE-2012-2451\">CVE-2012-2451</a></li>\n  <li><a href=\"https://nvd.nist.gov/vuln/detail/CVE-2015-1838\">CVE-2015-1838</a></li>\n</ul>\n<p>This rule raises an issue whenever it detects a hard-coded path to a publicly writable directory like <code>/tmp</code> (see examples bellow). It\nalso detects access to environment variables that point to publicly writable directories, e.g., <code>TMP</code>, <code>TMPDIR</code> and\n<code>TEMP</code>.</p>\n<ul>\n  <li><code>/tmp</code></li>\n  <li><code>/var/tmp</code></li>\n  <li><code>/usr/tmp</code></li>\n  <li><code>/dev/shm</code></li>\n  <li><code>/dev/mqueue</code></li>\n  <li><code>/run/lock</code></li>\n  <li><code>/var/run/lock</code></li>\n  <li><code>/Library/Caches</code></li>\n  <li><code>/Users/Shared</code></li>\n  <li><code>/private/tmp</code></li>\n  <li><code>/private/var/tmp</code></li>\n  <li><code>\\Windows\\Temp</code></li>\n  <li><code>\\Temp</code></li>\n  <li><code>\\TMP</code></li>\n  <li><code>%USERPROFILE%\\AppData\\Local\\Temp</code></li>\n</ul>\n<h2>Ask Yourself Whether</h2>\n<ul>\n  <li>Files are read from or written into a publicly writable folder</li>\n  <li>The application creates files with predictable names into a publicly writable folder</li>\n</ul>\n<p>There is a risk if you answered yes to any of those questions.</p>\n<h2>Recommended Secure Coding Practices</h2>\n<p>Out of the box, .NET is missing secure-by-design APIs to create temporary files. To overcome this, one of the following options can be used:</p>\n<ul>\n  <li>Use a dedicated sub-folder with tightly controlled permissions</li>\n  <li>Created temporary files in a publicly writable folder and make sure:\n    <ul>\n      <li>Generated filename is unpredictable</li>\n      <li>File is readable and writable only by the creating user ID</li>\n      <li>File descriptor is not inherited by child processes</li>\n      <li>File is destroyed as soon as it is closed</li>\n    </ul></li>\n</ul>\n<h2>Sensitive Code Example</h2>\n<pre>\nUsing Writer As New StreamWriter(\"/tmp/f\") ' Sensitive\n' ...\nEnd Using\n</pre>\n<pre>\nDim Tmp As String = Environment.GetEnvironmentVariable(\"TMP\") ' Sensitive\n</pre>\n<h2>Compliant Solution</h2>\n<pre>\nDim RandomPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName())\n\n' Creates a new file with write, non inheritable permissions which is deleted on close.\nUsing FileStream As New FileStream(RandomPath, FileMode.CreateNew, FileAccess.Write, FileShare.None, 4096, FileOptions.DeleteOnClose)\n    Using Writer As New StreamWriter(FileStream) ' Sensitive\n    ' ...\n    End Using\nEnd Using\n</pre>\n<h2>See</h2>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A01_2021-Broken_Access_Control/\">Top 10 2021 Category A1 - Broken Access Control</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A5_2017-Broken_Access_Control\">Top 10 2017 Category A5 - Broken Access\n  Control</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure\">Top 10 2017 Category A3 - Sensitive Data\n  Exposure</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/377\">CWE-377 - Insecure Temporary File</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/379\">CWE-379 - Creation of Temporary File in Directory with Incorrect Permissions</a></li>\n  <li><a href=\"https://owasp.org/www-community/vulnerabilities/Insecure_Temporary_File\">OWASP, Insecure Temporary File</a></li>\n  <li>STIG Viewer - <a href=\"https://stigviewer.com/stigs/application_security_and_development/2024-12-06/finding/V-222567\">Application Security and\n  Development: V-222567</a> - The application must not be vulnerable to race conditions.</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S5443.json",
    "content": "{\n  \"title\": \"Using publicly writable directories is security-sensitive\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"HIGH\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-5443\",\n  \"sqKey\": \"S5443\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      377,\n      379\n    ],\n    \"OWASP\": [\n      \"A5\",\n      \"A3\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A1\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"6.5.8\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"6.2.4\"\n    ],\n    \"STIG ASD_V5R3\": [\n      \"V-222567\"\n    ]\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S5445.html",
    "content": "<p>Temporary files are considered insecurely created when the file existence check is performed separately from the actual file creation. Such a\nsituation can occur when creating temporary files using normal file handling functions or when using dedicated temporary file handling functions that\nare not atomic.</p>\n<h2>Why is this an issue?</h2>\n<p>Creating temporary files in a non-atomic way introduces race condition issues in the application’s behavior. Indeed, a third party can create a\ngiven file between when the application chooses its name and when it creates it.</p>\n<p>In such a situation, the application might use a temporary file that it does not entirely control. In particular, this file’s permissions might be\ndifferent than expected. This can lead to trust boundary issues.</p>\n<h3>What is the potential impact?</h3>\n<p>Attackers with control over a temporary file used by a vulnerable application will be able to modify it in a way that will affect the application’s\nlogic. By changing this file’s Access Control List or other operating system-level properties, they could prevent the file from being deleted or\nemptied. They may also alter the file’s content before or while the application uses it.</p>\n<p>Depending on why and how the affected temporary files are used, the exploitation of a race condition in an application can have various\nconsequences. They can range from sensitive information disclosure to more serious application or hosting infrastructure compromise.</p>\n<h4>Information disclosure</h4>\n<p>Because attackers can control the permissions set on temporary files and prevent their removal, they can read what the application stores in them.\nThis might be especially critical if this information is sensitive.</p>\n<p>For example, an application might use temporary files to store users' session-related information. In such a case, attackers controlling those\nfiles can access session-stored information. This might allow them to take over authenticated users' identities and entitlements.</p>\n<h4>Attack surface extension</h4>\n<p>An application might use temporary files to store technical data for further reuse or as a communication channel between multiple components. In\nthat case, it might consider those files part of the trust boundaries and use their content without additional security validation or sanitation. In\nsuch a case, an attacker controlling the file content might use it as an attack vector for further compromise.</p>\n<p>For example, an application might store serialized data in temporary files for later use. In such a case, attackers controlling those files'\ncontent can change it in a way that will lead to an insecure deserialization exploitation. It might allow them to execute arbitrary code on the\napplication hosting server and take it over.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<p>The following code example is vulnerable to a race condition attack because it creates a temporary file using an unsafe API function.</p>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nImports System.IO\n\nSub Example()\n    Dim TempPath = Path.GetTempFileName() 'Noncompliant\n\n    Using Writer As New StreamWriter(TempPath)\n        Writer.WriteLine(\"content\")\n    End Using\nEnd Sub\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nImports System.IO\n\nSub Example()\n    Dim RandomPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName())\n\n    Using FileStream As New FileStream(RandomPath, FileMode.CreateNew, FileAccess.Write, FileShare.None, 4096, FileOptions.DeleteOnClose)\n        Using Writer As New StreamWriter(FileStream)\n            Writer.WriteLine(\"content\")\n        End Using\n    End Using\nEnd Sub\n</pre>\n<h3>How does this work?</h3>\n<p>Applications should create temporary files so that no third party can read or modify their content. It requires that the files' name, location, and\npermissions are carefully chosen and set. This can be achieved in multiple ways depending on the applications' technology stacks.</p>\n<h4>Strong security controls</h4>\n<p>Temporary files can be created using unsafe functions and API as long as strong security controls are applied. Non-temporary file-handling\nfunctions and APIs can also be used for that purpose.</p>\n<p>In general, applications should ensure that attackers can not create a file before them. This turns into the following requirements when creating\nthe files:</p>\n<ul>\n  <li>Files should be created in a non-public directory.</li>\n  <li>File names should be unique.</li>\n  <li>File names should be unpredictable. They should be generated using a cryptographically secure random generator.</li>\n  <li>File creation should fail if a target file already exists.</li>\n</ul>\n<p>Moreover, when possible, it is recommended that applications destroy temporary files after they have finished using them.</p>\n<p>Here the example compliant code uses the <code>Path.GetTempPath</code> and <code>Path.GetRandomFileName</code> functions to generate a unique\nrandom file name. The file is then open with the <code>FileMode.CreateNew</code> option that will ensure the creation fails if the file already\nexists. The <code>FileShare.None</code> option will additionally prevent the file from being opened again by any process. To finish, this code ensures\nthe file will get destroyed once the application has finished using it with the <code>FileOptions.DeleteOnClose</code> option.</p>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://owasp.org/www-community/vulnerabilities/Insecure_Temporary_File\">OWASP</a> - Insecure Temporary File</li>\n</ul>\n<h3>Standards</h3>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A01_2021-Broken_Access_Control/\">Top 10 2021 Category A1 - Broken Access Control</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/377\">CWE-377 - Insecure Temporary File</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/379\">CWE-379 - Creation of Temporary File in Directory with Incorrect Permissions</a></li>\n  <li>STIG Viewer - <a href=\"https://stigviewer.com/stigs/application_security_and_development/2024-12-06/finding/V-222567\">Application Security and\n  Development: V-222567</a> - The application must not be vulnerable to race conditions.</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S5445.json",
    "content": "{\n  \"title\": \"Insecure temporary file creation methods should not be used\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"HIGH\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-5445\",\n  \"sqKey\": \"S5445\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      377,\n      379\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A1\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"6.5.8\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"6.2.4\"\n    ],\n    \"STIG ASD_V5R3\": [\n      \"V-222567\"\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S5542.html",
    "content": "<p>This vulnerability exposes encrypted data to a number of attacks whose goal is to recover the plaintext.</p>\n<h2>Why is this an issue?</h2>\n<p>Encryption algorithms are essential for protecting sensitive information and ensuring secure communications in a variety of domains. They are used\nfor several important reasons:</p>\n<ul>\n  <li>Confidentiality, privacy, and intellectual property protection</li>\n  <li>Security during transmission or on storage devices</li>\n  <li>Data integrity, general trust, and authentication</li>\n</ul>\n<p>When selecting encryption algorithms, tools, or combinations, you should also consider two things:</p>\n<ol>\n  <li>No encryption is unbreakable.</li>\n  <li>The strength of an encryption algorithm is usually measured by the effort required to crack it within a reasonable time frame.</li>\n</ol>\n<p>For these reasons, as soon as cryptography is included in a project, it is important to choose encryption algorithms that are considered strong and\nsecure by the cryptography community.</p>\n<p>For AES, the weakest mode is ECB (Electronic Codebook). Repeated blocks of data are encrypted to the same value, making them easy to identify and\nreducing the difficulty of recovering the original cleartext.</p>\n<p>Unauthenticated modes such as CBC (Cipher Block Chaining) may be used but are prone to attacks that manipulate the ciphertext. They must be used\nwith caution.</p>\n<p>For RSA, the weakest algorithms are either using it without padding or using the PKCS1v1.5 padding scheme.</p>\n<h3>What is the potential impact?</h3>\n<p>The cleartext of an encrypted message might be recoverable. Additionally, it might be possible to modify the cleartext of an encrypted message.</p>\n<p>Below are some real-world scenarios that illustrate possible impacts of an attacker exploiting the vulnerability.</p>\n<h4>Theft of sensitive data</h4>\n<p>The encrypted message might contain data that is considered sensitive and should not be known to third parties.</p>\n<p>By using a weak algorithm the likelihood that an attacker might be able to recover the cleartext drastically increases.</p>\n<h4>Additional attack surface</h4>\n<p>By modifying the cleartext of the encrypted message it might be possible for an attacker to trigger other vulnerabilities in the code. Encrypted\nvalues are often considered trusted, since under normal circumstances it would not be possible for a third party to modify them.</p>\n<h2>How to fix it in .NET</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<p>Example with a symmetric cipher, AES:</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nImports System.Security.Cryptography\n\nPublic Module Example\n\n    Public Sub Encrypt()\n        Dim Algorithm As New AesManaged() With {\n            .KeySize = 128,\n            .BlockSize = 128,\n            .Mode = CipherMode.ECB, ' Noncompliant\n            .Padding = PaddingMode.PKCS7\n            }\n    End Sub\nEnd Module\n</pre>\n<p>Example with an asymmetric cipher, RSA:</p>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nImports System.Security.Cryptography\n\nPublic Module Example\n\n    Public Sub Encrypt()\n        Dim data(10) As Byte\n        Dim RsaCsp = New RSACryptoServiceProvider()\n        RsaCsp.Encrypt(data, False) ' Noncompliant\n    End Sub\nEnd Module\n</pre>\n<h4>Compliant solution</h4>\n<p>For the AES symmetric cipher, use the GCM mode:</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nImports System.Security.Cryptography\n\nPublic Module Example\n\n    Public Sub Encrypt()\n        Dim data(10) As Byte\n        Dim Algorithm As New AesGcm(data)\n    End Sub\nEnd Module\n</pre>\n<p>For the RSA asymmetric cipher, use the Optimal Asymmetric Encryption Padding (OAEP):</p>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nImports System.Security.Cryptography\n\nPublic Module Example\n\n    Public Sub Encrypt()\n        Dim data(10) As Byte\n        Dim RsaCsp = New RSACryptoServiceProvider()\n        RsaCsp.Encrypt(data, True) ' Noncompliant\n    End Sub\nEnd Module\n</pre>\n<h3>How does this work?</h3>\n<p>As a rule of thumb, use the cryptographic algorithms and mechanisms that are considered strong by the cryptographic community.</p>\n<p>Appropriate choices are currently the following.</p>\n<h4>For AES: use authenticated encryption modes</h4>\n<p>The best-known authenticated encryption mode for AES is Galois/Counter mode (GCM).</p>\n<p>GCM mode combines encryption with authentication and integrity checks using a cryptographic hash function and provides both confidentiality and\nauthenticity of data.</p>\n<p>Other similar modes are:</p>\n<ul>\n  <li>CCM: <code>Counter with CBC-MAC</code></li>\n  <li>CWC: <code>Cipher Block Chaining with Message Authentication Code</code></li>\n  <li>EAX: <code>Encrypt-and-Authenticate</code></li>\n  <li>IAPM: <code>Integer Authenticated Parallelizable Mode</code></li>\n  <li>OCB: <code>Offset Codebook Mode</code></li>\n</ul>\n<p>It is also possible to use AES-CBC with HMAC for integrity checks. However, it is considered more straightforward to use AES-GCM directly\ninstead.</p>\n<h4>For RSA: use the OAEP scheme</h4>\n<p>The Optimal Asymmetric Encryption Padding scheme (OAEP) adds randomness and a secure hash function that strengthens the regular inner workings of\nRSA.</p>\n<h2>Resources</h2>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/security/vulnerabilities-cbc-mode\">Microsoft, Timing vulnerabilities with CBC-mode\n  symmetric decryption using padding</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Padding_oracle_attack\">Wikipedia, Padding Oracle Attack</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Chosen-ciphertext_attack\">Wikipedia, Chosen-Ciphertext Attack</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Chosen-plaintext_attack\">Wikipedia, Chosen-Plaintext Attack</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Semantic_security\">Wikipedia, Semantically Secure Cryptosystems</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Optimal_asymmetric_encryption_padding\">Wikipedia, OAEP</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Galois/Counter_Mode\">Wikipedia, Galois/Counter Mode</a></li>\n</ul>\n<h3>Standards</h3>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A02_2021-Cryptographic_Failures/\">Top 10 2021 Category A2 - Cryptographic Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure\">Top 10 2017 Category A3 - Sensitive Data\n  Exposure</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A6_2017-Security_Misconfiguration\">Top 10 2017 Category A6 - Security\n  Misconfiguration</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/327\">CWE-327 - Use of a Broken or Risky Cryptographic Algorithm</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S5542.json",
    "content": "{\n  \"title\": \"Encryption algorithms should be used with secure mode and padding scheme\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"HIGH\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"privacy\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-5542\",\n  \"sqKey\": \"S5542\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      327,\n      780\n    ],\n    \"OWASP\": [\n      \"A6\",\n      \"A3\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A2\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"4.1\",\n      \"6.5.3\",\n      \"6.5.4\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"4.2.1\",\n      \"6.2.4\"\n    ],\n    \"ASVS 4.0\": [\n      \"2.9.3\",\n      \"6.2.2\",\n      \"8.3.7\"\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S5547.html",
    "content": "<p>This vulnerability makes it possible that the cleartext of the encrypted message might be recoverable without prior knowledge of the key.</p>\n<h2>Why is this an issue?</h2>\n<p>Encryption algorithms are essential for protecting sensitive information and ensuring secure communication in various domains. They are used for\nseveral important reasons:</p>\n<ul>\n  <li>Confidentiality, privacy, and intellectual property protection</li>\n  <li>Security during transmission or on storage devices</li>\n  <li>Data integrity, general trust, and authentication</li>\n</ul>\n<p>When selecting encryption algorithms, tools, or combinations, you should also consider two things:</p>\n<ol>\n  <li>No encryption is unbreakable.</li>\n  <li>The strength of an encryption algorithm is usually measured by the effort required to crack it within a reasonable time frame.</li>\n</ol>\n<p>For these reasons, as soon as cryptography is included in a project, it is important to choose encryption algorithms that are considered strong and\nsecure by the cryptography community.</p>\n<h3>What is the potential impact?</h3>\n<p>The cleartext of an encrypted message might be recoverable. Additionally, it might be possible to modify the cleartext of an encrypted message.</p>\n<p>Below are some real-world scenarios that illustrate some impacts of an attacker exploiting the vulnerability.</p>\n<h4>Theft of sensitive data</h4>\n<p>The encrypted message might contain data that is considered sensitive and should not be known to third parties.</p>\n<p>By using a weak algorithm the likelihood that an attacker might be able to recover the cleartext drastically increases.</p>\n<h4>Additional attack surface</h4>\n<p>By modifying the cleartext of the encrypted message it might be possible for an attacker to trigger other vulnerabilities in the code. Encrypted\nvalues are often considered trusted, since under normal circumstances it would not be possible for a third party to modify them.</p>\n<h2>How to fix it in .NET</h2>\n<h3>Code examples</h3>\n<p>The following code contains examples of algorithms that are not considered highly resistant to cryptanalysis and thus should be avoided.</p>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"11\" data-diff-type=\"noncompliant\">\nImports System.Security.Cryptography\n\nPublic Sub Encrypt()\n    Dim SimpleDES As New DESCryptoServiceProvider() ' Noncompliant\nEnd Sub\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"11\" data-diff-type=\"compliant\">\nImports System.Security.Cryptography\n\nPublic Sub Encrypt()\n    Dim AES128ECB = Aes.Create()\nEnd Sub\n</pre>\n<h3>How does this work?</h3>\n<h4>Use a secure algorithm</h4>\n<p>It is highly recommended to use an algorithm that is currently considered secure by the cryptographic community. A common choice for such an\nalgorithm is the Advanced Encryption Standard (AES).</p>\n<p>For block ciphers, it is not recommended to use algorithms with a block size that is smaller than 128 bits.</p>\n<h2>How to fix it in BouncyCastle</h2>\n<h3>Code examples</h3>\n<p>The following code contains examples of algorithms that are not considered highly resistant to cryptanalysis and thus should be avoided.</p>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\n```suggestion\nImports Org.BouncyCastle.Crypto.Engines\nImports Org.BouncyCastle.Crypto.Parameters\n\nPublic Sub Encrypt()\n    Dim AesFast As new AesFastEngine() ' Noncompliant\nEnd Sub\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nImports Org.BouncyCastle.Crypto.Engines\nImports Org.BouncyCastle.Crypto.Parameters\n\n```suggestion\nPublic Sub Encrypt()\n    Dim AES As new AESEngine()\nEnd Sub\n</pre>\n<h3>How does this work?</h3>\n<h4>Use a secure algorithm</h4>\n<p>It is highly recommended to use an algorithm that is currently considered secure by the cryptographic community. A common choice for such an\nalgorithm is the Advanced Encryption Standard (AES).</p>\n<p>For block ciphers, it is not recommended to use algorithms with a block size that is smaller than 128 bits.</p>\n<h2>Resources</h2>\n<h3>Standards</h3>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A02_2021-Cryptographic_Failures/\">Top 10 2021 Category A2 - Cryptographic Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure\">Top 10 2017 Category A3 - Sensitive Data\n  Exposure</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A6_2017-Security_Misconfiguration\">Top 10 2017 Category A6 - Security\n  Misconfiguration</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/327\">CWE-327 - Use of a Broken or Risky Cryptographic Algorithm</a></li>\n  <li>STIG Viewer - <a href=\"https://stigviewer.com/stigs/application_security_and_development/2024-12-06/finding/V-222396\">Application Security and\n  Development: V-222396</a> - The application must implement DoD-approved encryption to protect the confidentiality of remote access sessions.</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S5547.json",
    "content": "{\n  \"title\": \"Cipher algorithms should be robust\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"HIGH\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"privacy\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-5547\",\n  \"sqKey\": \"S5547\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      327,\n      326\n    ],\n    \"OWASP\": [\n      \"A3\",\n      \"A6\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A2\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"4.1\",\n      \"6.5.3\",\n      \"6.5.4\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"4.2.1\",\n      \"6.2.4\"\n    ],\n    \"ASVS 4.0\": [\n      \"6.2.2\",\n      \"6.2.3\",\n      \"6.2.5\",\n      \"8.3.7\"\n    ],\n    \"STIG ASD_V5R3\": [\n      \"V-222396\"\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S5659.html",
    "content": "<p>This vulnerability allows forging of JSON Web Tokens to impersonate other users.</p>\n<h2>Why is this an issue?</h2>\n<p>JSON Web Tokens (JWTs), a popular method of securely transmitting information between parties as a JSON object, can become a significant security\nrisk when they are not properly signed with a robust cipher algorithm, left unsigned altogether, or if the signature is not verified. This\nvulnerability class allows malicious actors to craft fraudulent tokens, effectively impersonating user identities. In essence, the integrity of a JWT\nhinges on the strength and presence of its signature.</p>\n<h3>What is the potential impact?</h3>\n<p>When a JSON Web Token is not appropriately signed with a strong cipher algorithm or if the signature is not verified, it becomes a significant\nthreat to data security and the privacy of user identities.</p>\n<h4>Impersonation of users</h4>\n<p>JWTs are commonly used to represent user authorization claims. They contain information about the user’s identity, user roles, and access rights.\nWhen these tokens are not securely signed, it allows an attacker to forge them. In essence, a weak or missing signature gives an attacker the power to\ncraft a token that could impersonate any user. For instance, they could create a token for an administrator account, gaining access to high-level\npermissions and sensitive data.</p>\n<h4>Unauthorized data access</h4>\n<p>When a JWT is not securely signed, it can be tampered with by an attacker, and the integrity of the data it carries cannot be trusted. An attacker\ncan manipulate the content of the token and grant themselves permissions they should not have, leading to unauthorized data access.</p>\n<h2>How to fix it in Jwt.Net</h2>\n<h3>Code examples</h3>\n<p>The following code contains examples of JWT encoding and decoding without a strong cipher algorithm.</p>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nImports JWT\n\nPublic Sub Decode(decoder AS IJwtDecoder)\n    Dim decoded As String = decoder.Decode(token, secret, verify:= false) ' Noncompliant\nEnd Sub\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nImports JWT\n\nPublic Sub Decode()\n    Dim decoded As String = new JwtBuilder()\n        .WithSecret(secret)\n        .Decode(token) ' Noncompliant\nEnd Sub\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nImports JWT\n\nPublic Sub Decode(decoder AS IJwtDecoder)\n    Dim decoded As String = decoder.Decode(token, secret, verify:= true)\nEnd Sub\n</pre>\n<p>When using <code>JwtBuilder</code>, make sure to call <code>MustVerifySignature()</code>.</p>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nImports JWT\n\nPublic Sub Decode()\n    Dim decoded As String = new JwtBuilder()\n        .WithSecret(secret)\n        .MustVerifySignature()\n        .Decode(token)\nEnd Sub\n</pre>\n<h3>How does this work?</h3>\n<h4>Verify the signature of your tokens</h4>\n<p>Resolving a vulnerability concerning the validation of JWT token signatures is mainly about incorporating a critical step into your process:\nvalidating the signature every time a token is decoded. Just having a signed token using a secure algorithm is not enough. If you are not validating\nsignatures, they are not serving their purpose.</p>\n<p>Every time your application receives a JWT, it needs to decode the token to extract the information contained within. It is during this decoding\nprocess that the signature of the JWT should also be checked.</p>\n<p>To resolve the issue, follow these instructions:</p>\n<ol>\n  <li>Use framework-specific functions for signature verification: Most programming frameworks that support JWTs provide specific functions to not\n  only decode a token but also validate its signature simultaneously. Make sure to use these functions when handling incoming tokens.</li>\n  <li>Handle invalid signatures appropriately: If a JWT’s signature does not validate correctly, it means the token is not trustworthy, indicating\n  potential tampering. The action to take when encountering an invalid token should be denying the request carrying it and logging the event for\n  further investigation.</li>\n  <li>Incorporate signature validation in your tests: When you are writing tests for your application, include tests that check the signature\n  validation functionality. This can help you catch any instances where signature verification might be unintentionally skipped or bypassed.</li>\n</ol>\n<p>By following these practices, you can ensure the security of your application’s JWT handling process, making it resistant to attacks that rely on\ntampering with tokens. Validation of the signature needs to be an integral and non-negotiable part of your token handling process.</p>\n<h3>Going the extra mile</h3>\n<h4>Securely store your secret keys</h4>\n<p>Ensure that your secret keys are stored securely. They should not be hard-coded into your application code or checked into your version control\nsystem. Instead, consider using environment variables, secure key management systems, or vault services.</p>\n<h4>Rotate your secret keys</h4>\n<p>Even with the strongest cipher algorithms, there is a risk that your secret keys may be compromised. Therefore, it is a good practice to\nperiodically rotate your secret keys. By doing so, you limit the amount of time that an attacker can misuse a stolen key. When you rotate keys, be\nsure to allow a grace period where tokens signed with the old key are still accepted to prevent service disruptions.</p>\n<h2>Resources</h2>\n<h3>Standards</h3>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A02_2021-Cryptographic_Failures/\">Top 10 2021 Category A2 - Cryptographic Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure\">Top 10 2017 Category A3 - Sensitive Data\n  Exposure</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/347\">CWE-347 - Improper Verification of Cryptographic Signature</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S5659.json",
    "content": "{\n  \"title\": \"JWT should be signed and verified with strong cipher algorithms\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"HIGH\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"privacy\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-5659\",\n  \"sqKey\": \"S5659\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      347\n    ],\n    \"OWASP\": [\n      \"A3\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A2\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"6.5.10\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"6.2.4\"\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S5693.html",
    "content": "<p>Rejecting requests with significant content length is a good practice to control the network traffic intensity and thus resource consumption in\norder to prevent DoS attacks.</p>\n<h2>Ask Yourself Whether</h2>\n<ul>\n  <li>size limits are not defined for the different resources of the web application.</li>\n  <li>the web application is not protected by <a href=\"https://en.wikipedia.org/wiki/Rate_limiting\">rate limiting</a> features.</li>\n  <li>the web application infrastructure has limited resources.</li>\n</ul>\n<p>There is a risk if you answered yes to any of those questions.</p>\n<h2>Recommended Secure Coding Practices</h2>\n<ul>\n  <li>For most of the features of an application, it is recommended to limit the size of requests to:\n    <ul>\n      <li>lower or equal to 8mb for file uploads.</li>\n      <li>lower or equal to 2mb for other requests.</li>\n    </ul></li>\n</ul>\n<p>It is recommended to customize the rule with the limit values that correspond to the web application.</p>\n<h2>Sensitive Code Example</h2>\n<pre>\nImports Microsoft.AspNetCore.Mvc\n\nPublic Class MyController\n    Inherits Controller\n\n    &lt;HttpPost&gt;\n    &lt;DisableRequestSizeLimit&gt; ' Sensitive: No size  limit\n    &lt;RequestSizeLimit(10485760)&gt; ' Sensitive: 10485760 B = 10240 KB = 10 MB is more than the recommended limit of 8MB\n    Public Function PostRequest(Model model) As IActionResult\n    ' ...\n    End Function\n\n    &lt;HttpPost&gt;\n    &lt;RequestFormLimits(MultipartBodyLengthLimit = 10485760)&gt; ' Sensitive: 10485760 B = 10240 KB = 10 MB is more than the recommended limit of 8MB\n    Public Function MultipartFormRequest(Model model) As IActionResult\n    ' ...\n    End Function\n\nEnd Class\n</pre>\n<h2>Compliant Solution</h2>\n<pre>\nImports Microsoft.AspNetCore.Mvc\n\nPublic Class MyController\n    Inherits Controller\n\n    &lt;HttpPost&gt;\n    &lt;RequestSizeLimit(8388608)&gt; ' Compliant: 8388608 B = 8192 KB = 8 MB\n    Public Function PostRequest(Model model) As IActionResult\n    ' ...\n    End Function\n\n    &lt;HttpPost&gt;\n    &lt;RequestFormLimits(MultipartBodyLengthLimit = 8388608)&gt; ' Compliant: 8388608 B = 8192 KB = 8 MB\n    Public Function MultipartFormRequest(Model model) AS IActionResult\n    ' ...\n    End Function\n\nEnd Class\n</pre>\n<h2>See</h2>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A05_2021-Security_Misconfiguration/\">Top 10 2021 Category A5 - Security Misconfiguration</a></li>\n  <li><a href=\"https://cheatsheetseries.owasp.org/cheatsheets/Denial_of_Service_Cheat_Sheet.html\">Owasp Cheat Sheet</a> - Owasp Denial of Service\n  Cheat Sheet</li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A6_2017-Security_Misconfiguration\">Top 10 2017 Category A6 - Security\n  Misconfiguration</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/770\">CWE-770 - Allocation of Resources Without Limits or Throttling</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/400\">CWE-400 - Uncontrolled Resource Consumption</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S5693.json",
    "content": "{\n  \"title\": \"Allowing requests with excessive content length is security-sensitive\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-5693\",\n  \"sqKey\": \"S5693\",\n  \"scope\": \"All\",\n  \"securityStandards\": {\n    \"CWE\": [\n      400,\n      770\n    ],\n    \"OWASP\": [\n      \"A6\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A5\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"2.2\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"2.2\"\n    ],\n    \"ASVS 4.0\": [\n      \"12.1.1\",\n      \"12.1.3\"\n    ]\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S5753.html",
    "content": "<p>ASP.NET 1.1+ comes with a feature called <em>Request Validation</em>, preventing the server to accept content containing un-encoded HTML. This\nfeature comes as a first protection layer against Cross-Site Scripting (XSS) attacks and act as a simple Web Application Firewall (WAF) rejecting\nrequests potentially containing malicious content.</p>\n<p>While this feature is not a silver bullet to prevent all XSS attacks, it helps to catch basic ones. It will for example prevent <code>&lt;script\ntype=\"text/javascript\" src=\"https://malicious.domain/payload.js\"&gt;</code> to reach your Controller.</p>\n<p>Note: <em>Request Validation</em> feature being only available for ASP.NET, no Security Hotspot is raised on ASP.NET Core applications.</p>\n<h2>Ask Yourself Whether</h2>\n<ul>\n  <li>the developer doesn’t know the impact to deactivate the Request Validation feature</li>\n  <li>the web application accepts user-supplied data</li>\n  <li>all user-supplied data are not validated</li>\n</ul>\n<p>There is a risk if you answered yes to any of those questions.</p>\n<h2>Recommended Secure Coding Practices</h2>\n<ul>\n  <li>Activate the Request Validation feature for all HTTP requests</li>\n</ul>\n<h2>Sensitive Code Example</h2>\n<p>At Controller level:</p>\n<pre>\n&lt;ValidateInput(False)&gt;\nPublic Function Welcome(Name As String) As ActionResult\n  ...\nEnd Function\n</pre>\n<p>At application level, configured in the Web.config file:</p>\n<pre>\n&lt;configuration&gt;\n   &lt;system.web&gt;\n      &lt;pages validateRequest=\"false\" /&gt;\n      ...\n      &lt;httpRuntime requestValidationMode=\"0.0\" /&gt;\n   &lt;/system.web&gt;\n&lt;/configuration&gt;\n</pre>\n<h2>Compliant Solution</h2>\n<p>At Controller level:</p>\n<pre>\n&lt;ValidateInput(True)&gt;\nPublic Function Welcome(Name As String) As ActionResult\n  ...\nEnd Function\n</pre>\n<p>or</p>\n<pre>\nPublic Function Welcome(Name As String) As ActionResult\n  ...\nEnd Function\n</pre>\n<p>At application level, configured in the Web.config file:</p>\n<pre>\n&lt;configuration&gt;\n   &lt;system.web&gt;\n      &lt;pages validateRequest=\"true\" /&gt;\n      ...\n      &lt;httpRuntime requestValidationMode=\"4.5\" /&gt;\n   &lt;/system.web&gt;\n&lt;/configuration&gt;\n</pre>\n<h2>See</h2>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A03_2021-Injection/\">Top 10 2021 Category A3 - Injection</a></li>\n  <li><a\n  href=\"https://docs.microsoft.com/en-us/dotnet/api/system.web.configuration.httpruntimesection.requestvalidationmode?view=netframework-4.8\">HttpRuntimeSection.RequestValidationMode Property</a></li>\n  <li><a href=\"https://owasp.org/www-community/ASP-NET_Request_Validation\">OWASP ASP.NET Request Validation</a></li>\n  <li><a href=\"https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html\">OWASP Cheat Sheet</a> - XSS Prevention\n  Cheat Sheet</li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A7_2017-Cross-Site_Scripting_(XSS)\">Top 10 2017 Category A7 - Cross-Site Scripting\n  (XSS)</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/79\">CWE-79 - Improper Neutralization of Input During Web Page Generation ('Cross-site\n  Scripting')</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S5753.json",
    "content": "{\n  \"title\": \"Disabling ASP.NET \\\"Request Validation\\\" feature is security-sensitive\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-5753\",\n  \"sqKey\": \"S5753\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      79\n    ],\n    \"OWASP\": [\n      \"A7\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A3\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"6.5.7\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"6.2.4\"\n    ],\n    \"ASVS 4.0\": [\n      \"5.3.3\"\n    ]\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S5773.html",
    "content": "<p>Deserialization is the process of converting serialized data (such as objects or data structures) back into their original form. Types allowed to\nbe unserialized should be strictly controlled.</p>\n<h2>Why is this an issue?</h2>\n<p>During the deserialization process, the state of an object will be reconstructed from the serialized data stream. By allowing unrestricted\ndeserialization of types, the application makes it possible for attackers to use types with dangerous or otherwise sensitive behavior during the\ndeserialization process.</p>\n<h3>What is the potential impact?</h3>\n<p>When an application deserializes untrusted data without proper restrictions, an attacker can craft malicious serialized objects. Depending on the\naffected objects and properties, the consequences can vary.</p>\n<h3>Remote Code Execution</h3>\n<p>If attackers can craft malicious serialized objects that contain executable code, this code will run within the application’s context, potentially\ngaining full control over the system. This can lead to unauthorized access, data breaches, or even complete system compromise.</p>\n<p>For example, a well-known attack vector consists in serializing an object of type <code><a\nhref=\"https://docs.microsoft.com/en-us/dotnet/api/system.codedom.compiler.tempfilecollection.-ctor?view=netframework-4.8#System_CodeDom_Compiler_TempFileCollection__ctor\">TempFileCollection</a></code>\nwith arbitrary files (defined by an attacker) which will be deleted on the application deserializing this object (when the <a\nhref=\"https://docs.microsoft.com/en-us/dotnet/api/system.codedom.compiler.tempfilecollection.finalize?view=netframework-4.8\">finalize()</a> method of\nthe TempFileCollection object is called). These kinds of specially crafted serialized objects are called \"<a\nhref=\"https://github.com/pwntester/ysoserial.net\">gadgets</a>\".</p>\n<h3>Privilege escalation</h3>\n<p>Unrestricted deserialization can also enable attackers to escalate their privileges within the application. By manipulating the serialized data, an\nattacker can modify object properties or bypass security checks, granting them elevated privileges that they should not have. This can result in\nunauthorized access to sensitive data, unauthorized actions, or even administrative control over the application.</p>\n<h3>Denial of Service</h3>\n<p>In some cases, an attacker can abuse the deserialization process to cause a denial of service (DoS) condition. By providing specially crafted\nserialized data, the attacker can trigger excessive resource consumption, leading to system instability or unresponsiveness. This can disrupt the\navailability of the application, impacting its functionality and causing inconvenience to users.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<p>With <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.formatters.binary.binaryformatter\"><code>BinaryFormatter</code></a>,\n<a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.netdatacontractserializer\"><code>NetDataContractSerializer</code></a>\nor <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.formatters.soap.soapformatter\"><code>SoapFormatter</code></a>:</p>\n<pre data-diff-id=\"201\" data-diff-type=\"noncompliant\">\nDim myBinaryFormatter = New BinaryFormatter()\nmyBinaryFormatter.Deserialize(stream) ' Noncompliant\n</pre>\n<p>With <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.web.script.serialization.javascriptserializer\"><code>JavaScriptSerializer</code></a>:</p>\n<pre data-diff-id=\"202\" data-diff-type=\"noncompliant\">\nDim serializer1 As JavaScriptSerializer = New JavaScriptSerializer(New SimpleTypeResolver()) ' Noncompliant: SimpleTypeResolver is insecure (every type is resolved)\nserializer1.Deserialize(Of ExpectedType)(json)\n</pre>\n<h4>Compliant solution</h4>\n<p>With <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.formatters.binary.binaryformatter\"><code>BinaryFormatter</code></a>,\n<a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.netdatacontractserializer\"><code>NetDataContractSerializer</code></a>\nor <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.formatters.soap.soapformatter\"><code>SoapFormatter</code></a>:</p>\n<pre data-diff-id=\"201\" data-diff-type=\"compliant\">\nNotInheritable Class CustomBinder\n    Inherits SerializationBinder\n    Public Overrides Function BindToType(assemblyName As String, typeName As String) As Type\n        If Not (Equals(typeName, \"type1\") OrElse Equals(typeName, \"type2\") OrElse Equals(typeName, \"type3\")) Then\n            Throw New SerializationException(\"Only type1, type2 and type3 are allowed\")\n        End If\n        Return Assembly.Load(assemblyName).[GetType](typeName)\n    End Function\nEnd Class\n\nDim myBinaryFormatter = New BinaryFormatter()\nmyBinaryFormatter.Binder = New CustomBinder()\nmyBinaryFormatter.Deserialize(stream)\n</pre>\n<p>With <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.web.script.serialization.javascriptserializer\"><code>JavaScriptSerializer</code></a>:</p>\n<pre data-diff-id=\"202\" data-diff-type=\"compliant\">\nPublic Class CustomSafeTypeResolver\n    Inherits JavaScriptTypeResolver\n    Public Overrides Function ResolveType(id As String) As Type\n        If Not Equals(id, \"ExpectedType\") Then\n            Throw New ArgumentNullException(\"Only ExpectedType is allowed during deserialization\")\n        End If\n        Return Type.[GetType](id)\n    End Function\nEnd Class\n\nDim serializer As JavaScriptSerializer = New JavaScriptSerializer(New CustomSafeTypeResolver())\nserializer.Deserialize(Of ExpectedType)(json)\n</pre>\n<h3>Going the extra mile</h3>\n<p>Instead of using <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.formatters.binary.binaryformatter\"><code>BinaryFormatter</code></a>\nand similar serializers, it is recommended to use safer alternatives in most of the cases, such as <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.xml.serialization.xmlserializer\"><code>XmlSerializer</code></a> or <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.datacontractserializer\"><code>DataContractSerializer</code></a>.</p>\n<p>If it’s not possible then try to mitigate the risk by restricting the types allowed to be deserialized:</p>\n<ul>\n  <li>by implementing an \"allow-list\" of types, but keep in mind that novel dangerous types are regularly discovered and this protection could be\n  insufficient over time.</li>\n  <li>or/and implementing a tamper protection, such as <a href=\"https://en.wikipedia.org/wiki/HMAC\">message authentication codes</a> (MAC). This way\n  only objects serialized with the correct MAC hash will be deserialized.</li>\n</ul>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.formatters.binary.binaryformatter\">BinaryFormatter Class</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.netdatacontractserializer\">NetDataContractSerializer Class</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.formatters.soap.soapformatter\">SoapFormatter Class</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.web.script.serialization.javascriptserializer\">JavaScriptSerializer Class</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.xml.serialization.xmlserializer\">XmlSerializer Class</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.datacontractserializer\">DataContractSerializer Class</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://docs.microsoft.com/en-us/dotnet/standard/serialization/binaryformatter-security-guide?s=03\">Deserialization\n  risks in use of BinaryFormatter and related types</a></li>\n  <li>OWASP - <a href=\"https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Deserialization_Cheat_Sheet.md\">Deserialization Cheat\n  Sheet</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/HMAC\">Message Authentication Codes (MAC)</a></li>\n</ul>\n<h3>Standards</h3>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A08_2021-Software_and_Data_Integrity_Failures/\">Top 10 2021 Category A8 - Software and Data Integrity\n  Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A8_2017-Insecure_Deserialization\">Top 10 2017 Category A8 - Insecure\n  Deserialization</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/502\">CWE-502 - Deserialization of Untrusted Data</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S5773.json",
    "content": "{\n  \"title\": \"Types allowed to be deserialized should be restricted\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  },\n  \"status\": \"ready\",\n  \"quickfix\": \"targeted\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"symbolic-execution\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-5773\",\n  \"sqKey\": \"S5773\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      502\n    ],\n    \"OWASP\": [\n      \"A8\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A8\"\n    ],\n    \"ASVS 4.0\": [\n      \"1.5.2\",\n      \"5.5.1\",\n      \"5.5.3\"\n    ]\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S5856.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/base-types/regular-expressions\">Regular expressions</a> have their own syntax that is\nunderstood by regular expression engines. Those engines will throw an exception at runtime if they are given a regular expression that does not\nconform to that syntax.</p>\n<p>To avoid syntax errors, special characters should be <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/standard/base-types/character-escapes-in-regular-expressions\">escaped with backslashes</a> when they\nare intended to be matched literally and references to capturing groups should use the correctly spelled name or number of the group.</p>\n<p>Negative <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/standard/base-types/regular-expression-language-quick-reference#lookarounds-at-a-glance\">lookaround</a>\ngroups cannot be combined with <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/standard/base-types/backtracking-in-regular-expressions\">RegexOptions.NonBacktracking</a>. Such\ncombination would throw an exception during runtime.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nSub Regexes(Input As String)\n    Dim Rx As New Regex(\"[A\")                                                       ' Noncompliant: unmatched \"[\"\n    Dim Match = Regex.Match(Input, \"[A\")                                            ' Noncompliant\n    Dim NegativeLookahead As New Regex(\"a(?!b)\", RegexOptions.NonBacktracking)      ' Noncompliant: negative lookahead without backtracking\n    Dim NegativeLookbehind As New Regex(\"(?&lt;!a)b\", RegexOptions.NonBacktracking)    ' Noncompliant: negative lookbehind without backtracking\nEnd Sub\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nSub Regexes(Input As String)\n    Dim Rx As New Regex(\"[A-Z]\")\n    Dim Match = Regex.Match(Input, \"[A-Z]\")\n    Dim NegativeLookahead As New Regex(\"a(?!b)\")\n    Dim NegativeLookbehind As New Regex(\"(?&lt;!a)b\")\nEnd Sub\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/base-types/regular-expressions\">.NET Regular expressions</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/standard/base-types/regular-expression-language-quick-reference#lookarounds-at-a-glance\">Lookarounds\n  at a glance</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/base-types/backtracking-in-regular-expressions\">Backtracking in Regular\n  Expressions</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/base-types/character-escapes-in-regular-expressions\">Character Escapes in Regular\n  Expressions</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S5856.json",
    "content": "{\n  \"title\": \"Regular expressions should be syntactically valid\",\n  \"type\": \"BUG\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"LOGICAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"15min\"\n  },\n  \"tags\": [\n    \"regex\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-5856\",\n  \"sqKey\": \"S5856\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S5944.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Functions can return values using two different syntaxes. The modern, and correct, way to do it is to use a <code>Return</code> statement. The VB6\nway, i.e. old way, is to assign a return value to the function’s name .</p>\n<p>The VB6 syntax is obsolete as it was introduced to simplify migration from VB6 projects. The compiler will create a local variable which is\nimplicitly returned when execution exits the function’s scope.</p>\n<p><code>Return</code> statement should be used instead as they are easier to read and understand.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nPublic Function FunctionName() As Integer\n    FunctionName = 42 ' Noncompliant\nEnd Function\n\nPublic Function FunctionNameFromVariable() As Integer\n    Dim Value As Integer = 42\n    FunctionNameFromVariable = Value ' Noncompliant\nEnd Function\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nPublic Function FunctionName() As Integer\n    Return 42\nEnd Function\n\nPublic Function FunctionNameFromVariable() As Integer\n    Dim Value As Integer = 42\n    Return Value\nEnd Function\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li><a href=\"https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/function-statement#returning-from-a-function\">.Net\n  documentation - Returning from a Function</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S5944.json",
    "content": "{\n  \"title\": \"\\\"Return\\\" statements should be used instead of assigning values to function names\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"bad-practice\",\n    \"confusing\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-5944\",\n  \"sqKey\": \"S5944\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6145.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>There are several compilations options available for Visual Basic source code and <code>Option Strict</code> defines compiler behavior for implicit\ndata type conversions. Specifying <code>Option Strict Off</code> will allow:</p>\n<ul>\n  <li>Implicit narrowing conversions</li>\n  <li>Late binding</li>\n  <li>Implicit typing that results in an <code>Object</code> type</li>\n</ul>\n<p>This behavior can lead to unexpected runtime errors due to type mismatch or missing members.</p>\n<p><code>Option Strict</code> can be set in project properties or overridden in individual source files.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nOption Strict Off    ' Noncompliant\n\nPublic Class KnownType\n\n    Public ReadOnly Property Name As String\n\nEnd Class\n\nPublic Module MainMod\n\n    Public Function DoSomething(Arg) As String  ' Type for \"Arg\" argument is not defined.\n        Dim Item As KnownType = Arg             ' Implicit narrowing conversion doesn't enforce \"Arg\" to be of type \"KnownType\"\n        Return Arg.Title                        ' \"Title\" might not exist in \"Arg\"\n    End Function\n\nEnd Module\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nOption Strict On\n\nPublic Class KnownType\n\n    Public ReadOnly Property Name As String\n\nEnd Class\n\nPublic Module MainMod\n\n    Public Function DoSomething(Arg As KnownType) As String\n        Dim Item As KnownType = Arg\n        Return Arg.Name\n    End Function\n\nEnd Module\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li><a href=\"https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/option-strict-statement\">Visual Basic documentation\n  - Option Strict Statement</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6145.json",
    "content": "{\n  \"title\": \"\\\"Option Strict\\\" should be enabled\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [\n    \"bad-practice\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6145\",\n  \"sqKey\": \"S6145\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6146.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>There are several compilations options available for Visual Basic source code and <code>Option Explicit</code> defines compiler behavior for\nimplicit variable declarations. Specifying <code>Option Explicit Off</code> will allow creating a variable by it’s first usage. This behavior can lead\nto unexpected runtime errors due to typos in variable names.</p>\n<p><code>Option Explicit</code> can be set in project properties or overridden in individual source files.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nOption Explicit Off ' Noncompliant\n\nModule MainMod\n\n    Public Sub DoSomething(First As String, Second As String)\n        Parameter = Fist        ' New local variable \"Fist\" is created and assigned to new local variable \"Parameter\" instead of \"First\" argument.\n        DoSomething(Parameter)\n        Parametr = Second       ' \"Second\" argument is assigned to newly created variable \"Parametr\" instead of intended \"Parameter\".\n        DoSomething(Parameter)  ' Value of \"Parameter\" is always Nothing\n    End Sub\n\n    Private Sub DoSomething(Parameter As String)\n        ' ...\n    End Sub\n\nEnd Module\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nOption Explicit On\n\nModule MainMod\n\n    Public Sub DoSomething(First As String, Second As String)\n        Dim Parameter As String = First\n        DoSomething(Parameter)\n        Parameter = Second\n        DoSomething(Parameter)\n    End Sub\n\n    Private Sub DoSomething(Parameter As String)\n        ' ...\n    End Sub\n\nEnd Module\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li><a href=\"https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/option-explicit-statement\">Visual Basic\n  documentation - Option Explicit Statement</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6146.json",
    "content": "{\n  \"title\": \"\\\"Option Explicit\\\" should be enabled\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"3h\"\n  },\n  \"tags\": [\n    \"bad-practice\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-6146\",\n  \"sqKey\": \"S6146\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6354.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>One of the principles of a unit test is that it must have full control of the system under test. This is problematic when production code includes\ncalls to static methods, which cannot be changed or controlled. Date/time functions are usually provided by system libraries as static methods.</p>\n<p>This can be improved by wrapping the system calls in an object or service that can be controlled inside the unit test.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nPublic Class Foo\n    Public Function HelloTime() As String\n        Return $\"Hello at {DateTime.UtcNow}\"\n    End Function\nEnd Class\n</pre>\n<h3>Compliant solution</h3>\n<p>There are different approaches to solve this problem. One of them is suggested below. There are also open source libraries (such as NodaTime) which\nalready implement an <code>IClock</code> interface and a <code>FakeClock</code> testing class.</p>\n<pre>\nPublic Interface IClock\n    Function UtcNow() As Date\nEnd Interface\n\nPublic Class Foo\n    Public Function HelloTime(clock As IClock) As String\n        Return $\"Hello at {clock.UtcNow()}\"\n    End Function\nEnd Class\n\nPublic Class FooTest\n    Public Class TestClock\n        Implements IClock\n        ' implement\n    End Class\n\n    &lt;Fact&gt;\n    Public Sub HelloTime_Gives_CorrectTime()\n        Dim dateTime = New DateTime(2017, 06, 11)\n        Assert.Equal((New Foo()).HelloTime(New TestClock(dateTime)), $\"Hello at {dateTime}\")\n    End Sub\nEnd Class\n</pre>\n<p>Another possible solution is using an adaptable module, ideally supports an IDisposable method, that not only adjusts the time behaviour for the\ncurrent thread only, but also for scope of the using.</p>\n<pre>\nPublic Module Clock\n    Public Function UtcNow() As Date\n    End Function\n\n    Public Function SetTimeForCurrentThread(time As Func(Of Date)) As IDisposable\n    End Function\nEnd Module\n\nPublic Class Foo\n    Public Function HelloTime() As String\n        Return $\"Hello at {Clock.UtcNow()}\"\n    End Function\nEnd Class\n\nPublic Class FooTest\n    &lt;Fact&gt;\n    Public Sub HelloTime_Gives_CorrectTime()\n        Dim dateTime = New DateTime(2017, 06, 11)\n\n        Using SetTimeForCurrentThread(Function() dateTime)\n            Assert.Equal((New Foo()).HelloTime(), $\"Hello at {dateTime}\")\n        End Using\n    End Sub\nEnd Class\n</pre>\n<h2>Resources</h2>\n<p><a href=\"https://nodatime.org/3.0.x/api/NodaTime.Testing.html\">NodaTime testing</a></p>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6354.json",
    "content": "{\n  \"title\": \"Use a testable date\\/time provider\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"TESTED\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"20min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6354\",\n  \"sqKey\": \"S6354\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6418.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Hard-coding secrets in source code or binaries makes it easy for attackers to extract sensitive information, especially in distributed or\nopen-source applications. This practice exposes credentials and tokens, increasing the risk of unauthorized access and data breaches.</p>\n<p>This rule detects variables/fields/properties having a name matching a list of words (secret, token, credential, auth, api[_.-]?key) being assigned\na pseudorandom hard-coded value. The pseudorandomness of the hard-coded value is based on its entropy and the probability to be human-readable. The\nrandomness sensibility can be adjusted if needed. Lower values will detect less random values, raising potentially more false positives.</p>\n<h2>How to fix it</h2>\n<p>Secrets should be stored in a configuration file that is not committed to the code repository, in a database, or managed by your cloud provider’s\nsecrets management service. If a secret is exposed in the source code, it must be rotated immediately.</p>\n<h3>Code Examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nPrivate MySecret As String = \"47828a8dd77ee1eb9dde2d5e93cb221ce8c32b37\"\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nPrivate MySecret As String = Environment.GetEnvironmentVariable(\"MYSECRET\")\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures/\">Top 10 2021 Category A7 - Identification and\n  Authentication Failures</a></li>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A2_2017-Broken_Authentication\">Top 10 2017 Category A2 - Broken\n  Authentication</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/798\">CWE-798 - Use of Hard-coded Credentials</a></li>\n  <li>MSC - <a href=\"https://wiki.sei.cmu.edu/confluence/x/OjdGBQ\">MSC03-J - Never hard code sensitive information</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6418.json",
    "content": "{\n  \"title\": \"Secrets should not be hard-coded\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"BLOCKER\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"quickfix\": \"infeasible\",\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-6418\",\n  \"sqKey\": \"S6418\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CERT\": [\n      \"MSC03-J.\"\n    ],\n    \"CWE\": [\n      798\n    ],\n    \"OWASP\": [\n      \"A2\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A7\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"6.5.10\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"6.2.4\"\n    ],\n    \"ASVS 4.0\": [\n      \"2.10.4\",\n      \"3.5.2\",\n      \"6.4.1\"\n    ]\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6444.html",
    "content": "<p>Not specifying a timeout for regular expressions can lead to a Denial-of-Service attack. Pass a timeout when using\n<code>System.Text.RegularExpressions</code> to process untrusted input because a malicious user might craft a value for which the evaluation lasts\nexcessively long.</p>\n<h2>Ask Yourself Whether</h2>\n<ul>\n  <li>the input passed to the regular expression is untrusted.</li>\n  <li>the regular expression contains patterns vulnerable to <a href=\"https://www.regular-expressions.info/catastrophic.html\">catastrophic\n  backtracking</a>.</li>\n</ul>\n<p>There is a risk if you answered yes to any of those questions.</p>\n<h2>Recommended Secure Coding Practices</h2>\n<ul>\n  <li>It is recommended to specify a <a\n  href=\"https://learn.microsoft.com/dotnet/standard/base-types/best-practices#use-time-out-values\"><code>matchTimeout</code></a> when executing a\n  regular expression.</li>\n  <li>Make sure regular expressions are not vulnerable to Denial-of-Service attacks by reviewing the patterns.</li>\n  <li>Consider using a non-backtracking algorithm by specifying <a\n  href=\"https://learn.microsoft.com/dotnet/api/system.text.regularexpressions.regexoptions?view=net-7.0\"><code>RegexOptions.NonBacktracking</code></a>.</li>\n</ul>\n<h2>Sensitive Code Example</h2>\n<pre>\nPublic Sub RegexPattern(Input As String)\n    Dim EmailPattern As New Regex(\".+@.+\", RegexOptions.None)\n    Dim IsNumber as Boolean = Regex.IsMatch(Input, \"[0-9]+\")\n    Dim IsLetterA as Boolean = Regex.IsMatch(Input, \"(a+)+\")\nEnd Sub\n</pre>\n<h2>Compliant Solution</h2>\n<pre>\nPublic Sub RegexPattern(Input As String)\n    Dim EmailPattern As New Regex(\".+@.+\", RegexOptions.None, TimeSpan.FromMilliseconds(100))\n    Dim IsNumber as Boolean = Regex.IsMatch(Input, \"[0-9]+\", RegexOptions.None, TimeSpan.FromMilliseconds(100))\n    Dim IsLetterA As Boolean = Regex.IsMatch(Input, \"(a+)+\", RegexOptions.NonBacktracking) '.Net 7 And above\n    AppDomain.CurrentDomain.SetData(\"REGEX_DEFAULT_MATCH_TIMEOUT\", TimeSpan.FromMilliseconds(100)) 'process-wide setting\nEnd Sub\n</pre>\n<h2>See</h2>\n<ul>\n  <li>OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A1_2017-Injection\">Top 10 2017 Category A1 - Injection</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/400\">CWE-400 - Uncontrolled Resource Consumption</a></li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/1333\">CWE-1333 - Inefficient Regular Expression Complexity</a></li>\n  <li><a href=\"https://www.regular-expressions.info/catastrophic.html\">regular-expressions.info</a> - Runaway Regular Expressions: Catastrophic\n  Backtracking</li>\n  <li><a href=\"https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS\">owasp.org</a> - Regular expression Denial of\n  Service - ReDoS</li>\n  <li>CWE - <a href=\"https://cwe.mitre.org/data/definitions/1333\">CWE-1333 - Inefficient Regular Expression Complexity</a></li>\n  <li><a href=\"https://docs.microsoft.com/dotnet/standard/base-types/best-practices\">docs.microsoft.com</a> - Best practices for regular expressions\n  in .NET</li>\n  <li><a href=\"https://docs.microsoft.com/dotnet/standard/base-types/backtracking-in-regular-expressions\">docs.microsoft.com</a> - Backtracking in\n  Regular Expressions</li>\n  <li><a\n  href=\"https://devblogs.microsoft.com/dotnet/regular-expression-improvements-in-dotnet-7/#backtracking-and-regexoptions-nonbacktracking\">devblogs.microsoft.com</a> - Regular Expression Improvements in .NET 7: Backtracking (and RegexOptions.NonBacktracking)</li>\n  <li><a href=\"https://docs.microsoft.com/dotnet/api/system.text.regularexpressions.regex.matchtimeout\">docs.microsoft.com</a> - Regex.MatchTimeout\n  Property</li>\n  <li><a href=\"https://docs.microsoft.com/dotnet/api/system.text.regularexpressions.regexoptions?view=net-7.0\">docs.microsoft.com</a> - RegexOptions\n  Enum (NonBacktracking option)</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6444.json",
    "content": "{\n  \"title\": \"Not specifying a timeout for regular expressions is security-sensitive\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"regex\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6444\",\n  \"sqKey\": \"S6444\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      400,\n      1333\n    ],\n    \"OWASP\": [\n      \"A1\"\n    ]\n  },\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6513.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>The <a\nhref=\"https://learn.microsoft.com/dotnet/api/system.diagnostics.codeanalysis.excludefromcodecoverageattribute\">ExcludeFromCodeCoverageAttribute</a> is\nused to exclude portions of code from <a href=\"https://learn.microsoft.com/dotnet/core/testing/unit-testing-code-coverage\">code coverage\nreporting</a>. It is a bad practice to retain code that is not covered by unit tests. In .Net 5, the <code>Justification</code> property was added to\nthe <code>ExcludeFromCodeCoverageAttribute</code> as an opportunity to document the rationale for the exclusion. This rule raises an issue when no\nsuch justification is given.</p>\n<h3>Noncompliant code example</h3>\n<pre>\nPublic Structure Coordinates\n\n    Public ReadOnly Property X As Integer\n    Public ReadOnly Property Y As Integer\n\n    &lt;ExcludeFromCodeCoverage&gt; ' Noncompliant\n    Public Overrides Function Equals(obj As Object) As Boolean\n        If Not (TypeOf obj Is Coordinates) Then\n            Return False\n        End If\n\n        Dim coordinates = DirectCast(obj, Coordinates)\n        Return X = coordinates.X AndAlso\n               Y = coordinates.Y\n    End Function\n\n    &lt;ExcludeFromCodeCoverage&gt; ' Noncompliant\n    Public Overrides Function GetHashCode() As Integer\n        Dim hashCode As Long = 1861411795\n        hashCode = (hashCode * -1521134295 + X.GetHashCode()).GetHashCode()\n        hashCode = (hashCode * -1521134295 + Y.GetHashCode()).GetHashCode()\n        Return hashCode\n    End Function\nEnd Structure\n</pre>\n<h3>Compliant solution</h3>\n<pre>\nPublic Structure Coordinates\n\n    Public ReadOnly Property X As Integer\n    Public ReadOnly Property Y As Integer\n\n    &lt;ExcludeFromCodeCoverage(Justification:=\"Code generated by Visual Studio refactoring\")&gt; ' Compliant\n    Public Overrides Function Equals(obj As Object) As Boolean\n        If Not (TypeOf obj Is Coordinates) Then\n            Return False\n        End If\n\n        Dim coordinates = DirectCast(obj, Coordinates)\n        Return X = coordinates.X AndAlso\n               Y = coordinates.Y\n    End Function\n\n    &lt;ExcludeFromCodeCoverage(Justification:=\"Code generated by Visual Studio refactoring\")&gt; ' Compliant\n    Public Overrides Function GetHashCode() As Integer\n        Dim hashCode As Long = 1861411795\n        hashCode = (hashCode * -1521134295 + X.GetHashCode()).GetHashCode()\n        hashCode = (hashCode * -1521134295 + Y.GetHashCode()).GetHashCode()\n        Return hashCode\n    End Function\nEnd Structure\n</pre>\n<h2>Resources</h2>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/dotnet/api/system.diagnostics.codeanalysis.excludefromcodecoverageattribute\">API browser</a> -\n  ExcludeFromCodeCoverageAttribute</li>\n  <li><a href=\"https://learn.microsoft.com/dotnet/core/testing/unit-testing-code-coverage\">DevOps and testing</a> - Code coverage reporting</li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6513.json",
    "content": "{\n  \"title\": \"\\\"ExcludeFromCodeCoverage\\\" attributes should include a justification\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"bad-practice\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-6513\",\n  \"sqKey\": \"S6513\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6561.html",
    "content": "<p>The rule targets the use of <code>DateTime.Now</code> call followed by some arithmetic operation.</p>\n<h2>Why is this an issue?</h2>\n<p>Using <code>DateTime.Now</code> calls within a subtraction operation to measure elapsed time is not recommended. This property is subject to\nchanges such as daylight savings transitions, which can invalidate the calculation if the change occurs during the benchmark session, or when updating\na timer. Moreover, <code>DateTime.Now</code> is dependent on the system clock, which may have low resolution on older systems (as low as 15\nmilliseconds).</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<p>If the purpose is to benchmark something then, instead of the <code>DateTime.Now</code> property, it’s recommended to use <code>Stopwatch</code>,\nwhich is not affected by changes in time such as daylight savings (DST) and automatically checks for the existence of high-precision timers. As a\nbonus, the <code>StopWatch</code> class is also lightweight and computationally faster than <code>DateTime</code>.</p>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nDim start = DateTime.Now ' First call, on March 26th 2:59 am\n' Method to be benchmarked\n\nConsole.WriteLine($\"{CInt((DateTime.Now - start).TotalMilliseconds)} ms\") ' Second call happens 2 minutes later but `Now` is March 26th, 4:01 am as there's a shift to summer time\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nDim stopWatch = Stopwatch.StartNew() ' Compliant\n' Method to be benchmarked\nstopWatch.Stop()\n\nConsole.WriteLine($\"{stopWatch.ElapsedMilliseconds} ms\")\n</pre>\n<p>If, on the other hand, the goal is to refresh a timer prefer using the <code>DateTime.UtcNow</code> property, which guarantees reliable results\nwhen doing arithmetic operations during DST transitions.</p>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nIf (Date.Now - lastRefresh).TotalMilliseconds &gt; MinRefreshInterval Then\n    lastRefresh = Date.Now\n    ' Refresh\nEnd If\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nIf (Date.UtcNow - lastRefresh).TotalMilliseconds &gt; MinRefreshInterval Then\n    lastRefresh = Date.UtcNow\n    ' Refresh\nEnd If\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetime?#datetime-resolution\">DateTime resolution</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetime.now\">DateTime.Now</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.stopwatch?\">Stopwatch class documentation</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6561.json",
    "content": "{\n  \"title\": \"Avoid using \\\"DateTime.Now\\\" for benchmarking or timing operations\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6561\",\n  \"sqKey\": \"S6561\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6562.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Not knowing the <code>Kind</code> of the <code>DateTime</code> object that an application is using can lead to misunderstandings when displaying or\ncomparing them. Explicitly setting the <code>Kind</code> property helps the application to stay consistent, and its maintainers understand what kind\nof date is being managed. To achieve this, when instantiating a new <code>DateTime</code> object you should always use a constructor overload that\nallows you to define the <code>Kind</code> property.</p>\n<h3>What is the potential impact?</h3>\n<p>Creating the <code>DateTime</code> object without specifying the property <code>Kind</code> will set it to the default value of\n<code>DateTimeKind.Unspecified</code>. In this case, calling the method <code>ToUniversalTime</code> will assume that <code>Kind</code> is\n<code>DateTimeKind.Local</code> and calling the method <code>ToLocalTime</code> will assume that it’s <code>DateTimeKind.Utc</code>. As a result, you\nmight have mismatched <code>DateTime</code> objects in your application.</p>\n<h2>How to fix it</h2>\n<p>To resolve this issue, use a <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetime.-ctor\">constructor overload</a> that lets you\nspecify the <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetimekind\"><code>DateTimeKind</code></a> when creating the\n<code>DateTime</code> object. From .Net 6 onwards, use the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.dateonly\"><code>DateOnly</code></a> type if the time portion of the date is not\nrelevant.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nPrivate Sub CreateNewTime()\n    Dim birthDate = New DateTime(1994, 7, 5, 16, 23, 42)\nEnd Sub\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nPrivate Sub CreateNewTime()\n    Dim birthDate = New DateTime(1994, 7, 5, 16, 23, 42, DateTimeKind.Utc)\n    ' or from .Net 6 onwards, use DateOnly:\n    Dim birthDate = New DateOnly(1994, 7, 5)\nEnd Sub\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetimekind\">DateTimeKind Enum</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetime.-ctor\">DateTime Constructors</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.dateonly\">DateOnly Struct</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/standard/base-types/how-to-round-trip-date-and-time-values\">How to:\n  Round-trip Date and time values</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/standard/design-guidelines/member-overloading\">Member Overloading</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6562.json",
    "content": "{\n  \"title\": \"Always set the \\\"DateTimeKind\\\" when creating new \\\"DateTime\\\" instances\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"localisation\",\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6562\",\n  \"sqKey\": \"S6562\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6563.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>You should avoid recording time instants with the use of property <code>DateTime.Now</code>. The property <code>DateTime.Now</code> returns the\ncurrent date and time expressed in the machine’s local time without containing any timezone-related information (for example, the offset from\nCoordinated Universal Time). Not having this information means that if you need to display this <code>DateTime</code> object or use it for\ncomputations in another machine placed in a different time zone, you won’t be able to reconstruct it in the second machine’s local time without\nknowing the origin’s offset. This will likely lead to confusion and potential bugs.</p>\n<p>Instead, you should record the <code>DateTime</code> instants in UTC, which gives you the date and time as it is in the Coordinated Universal Time.\nUTC is a time standard for all time zones and is not subjected to Daylight Saving Time (DST).</p>\n<p>Similarly, the use of the <code>DateTime.Today</code> property should also be avoided, as it can return different date values depending on the time\nzone.</p>\n<p>Generally, unless the purpose is to only display the Date and Time to a user on their local machine, you should always use UTC (for example, when\nstoring dates in a datebase or using them for calculations).</p>\n<h3>What is the potential impact?</h3>\n<p>You can end up with <code>DateTime</code> instants that have no meaning for anyone except the machine they were recorded on. Using UTC gives an\nunambiguous representation of an instant, and this UTC instant can be transformed into any equivalent local time. This operation isn’t reversible as\nsome local times are ambiguous and can be matched to more than one UTC instant (for example, due to daylight savings).</p>\n<h2>How to fix it</h2>\n<p>Instead of <code>DateTime.Now</code> use any of the following:</p>\n<ul>\n  <li><code>DateTime.UtcNow</code>,</li>\n  <li><code>DateTimeOffSet.Now</code> (as it contains offset information)</li>\n  <li><code>DateTimeOffSet.UtcNow</code></li>\n</ul>\n<p>Instead of <code>DateTime.Today</code> use any of the following:</p>\n<ul>\n  <li><code>DateTime.UtcNow.Date</code>,</li>\n  <li><code>DateOnly.FromDateTime(DateTime.UtcNow)</code> (.NET 6.0+)</li>\n</ul>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nPrivate Sub LogDateTime()\n    Using streamWriter = New StreamWriter(\"logs.txt\", True)\n    End Using\n\n    streamWriter.WriteLine($\"DateTime:{DateTime.Now.ToString(\"o\")}\") ' This log won't have any meaning if it's reconstructed in a machine in a different timezone.\nEnd Sub\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nPrivate Sub LogDateTime()\n    Using streamWriter = New StreamWriter(\"logs.txt\", True)\n    End Using\n\n    streamWriter.WriteLine($\"DateTime:{DateTime.UtcNow.ToString(\"o\")}\")\nEnd Sub\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetime.now\">DateTime.Now Property</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetime.utcnow\">DateTime.UtcNow Property</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetime.today\">DateTime.Today Property</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetimeoffset\">DateTimeOffset Struct</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.dateonly.fromdatetime\">DateOnly.FromDateTime(DateTime)\n  Method</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/standard/datetime/resolve-ambiguous-times\">How to: Resolve ambiguous\n  times</a></li>\n  <li>Time and Date - <a href=\"https://www.timeanddate.com/time/zone/timezone/utc\">Time Zone in UTC - What Is UTC?</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li>StackOverflow - <a href=\"https://stackoverflow.com/a/2580518\">Ambiguous times by John Skeet</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6563.json",
    "content": "{\n  \"title\": \"Use UTC when recording DateTime instants\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"pitfall\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6563\",\n  \"sqKey\": \"S6563\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6566.html",
    "content": "<p>This rule recommends using <code>DateTimeOffset</code> instead of <code>DateTime</code> for projects targeting .NET Framework 2.0 or later.</p>\n<h2>Why is this an issue?</h2>\n<p>You should use <code>DateTimeOffset</code> instead of <code>DateTime</code> as it provides all the information that the <code>DateTime</code>\nstruct has, and additionally, the offset from Coordinated Universal Time (UTC). This way you can avoid potential problems created by the lack of\ntimezone awareness (see the \"Pitfalls\" section below for more information).</p>\n<p>However, it’s important to note that although <code>DateTimeOffset</code> contains more information than <code>DateTime</code> by storing the\noffset to UTC, it isn’t tied to a specific time zone. This information must be stored separately to have a full picture of the moment in time with the\nuse of <code>TimeZoneInfo</code>.</p>\n<h2>How to fix it</h2>\n<p>In most cases, you can directly replace <code>DateTime</code> with <code>DateTimeOffset</code>. When hardcoding dates with local kind, remember\nthat the offset is timezone dependent, so it should be set according to which timezone that data represents. For more information, refer to\n<code>DateTime</code> and <code>DateTimeOffset</code> documentation from Microsoft (see the \"Resources\" section below).</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nDim myDate As DateTime = New DateTime(2008, 6, 19, 7, 0, 0, DateTimeKind.Local) ' Noncompliant\n\nDim now = DateTime.Now ' Noncompliant\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nDim myDate As DateTimeOffset = New DateTimeOffset(2008, 6, 19, 7, 0, 0, TimeSpan.FromHours(-7)) ' Compliant\n\nDim now = DateTimeOffset.Now ' Compliant\n</pre>\n<h3>Pitfalls</h3>\n<p>Common <code>DateTime</code> pitfalls include:</p>\n<ul>\n  <li>when working with <code>DateTime</code> of kind <code>Local</code> consider the time offset of the machine where the program is running. Not\n  storing the offset from UTC separately can result in meaningless data when retrieved from a different location.</li>\n  <li>when working with <code>DateTime</code> of kind <code>Unknown</code>, calling <code>ToUniversalTime()</code> presumes the\n  <code>DateTime.Kind</code> is local and converts to UTC, if you call the method <code>ToLocalTime()</code>, it assumes the\n  <code>DateTime.Kind</code> is UTC and converts it to local.</li>\n  <li>when comparing <code>DateTimes</code> objects, the user must ensure they are within the same time zone. <code>DateTime</code> doesn’t consider\n  UTC/Local when comparing; it only cares about the number of <code>Ticks</code> on the objects.</li>\n</ul>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/datetime/converting-between-datetime-and-offset?redirectedfrom=MSDN\">Converting\n  between DateTime and DateTimeOffset</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/datetime/choosing-between-datetime\">Choose between DateTime, DateOnly,\n  DateTimeOffset, TimeSpan, TimeOnly, and TimeZoneInfo</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/datetime/performing-arithmetic-operations\">Performing arithmetic operations with\n  dates and times</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.timezoneinfo\">TimeZoneInfo documentation</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6566.json",
    "content": "{\n  \"title\": \"Use \\\"DateTimeOffset\\\" instead of \\\"DateTime\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6566\",\n  \"sqKey\": \"S6566\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6575.html",
    "content": "<p>Since .NET 6 you don’t have to use the <code>TimeZoneConverter</code> library to manually do the conversion between IANA and Windows timezones. The\n.NET 6.0 introduced new Time Zone enhancements, one being the <code>TimeZoneInfo.FindSystemTimeZoneById(string timezone)</code> method now accepts as\ninput both IANA and Windows time zone IDs on any operating system with installed time zone data. <code>TimeZoneInfo.FindSystemTimeZoneById</code> will\nautomatically convert its input from IANA to Windows and vice versa if the requested time zone is not found on the system.</p>\n<h2>Why is this an issue?</h2>\n<p>The method <code>TimeZoneInfo.FindSystemTimeZoneById(string timezone)</code> can get both IANA and Windows timezones as input and automatically\nconvert one to the other if the requested time zone is not found on the system. Because one does not need to handle the conversion, the code will be\nless complex and easier to maintain.</p>\n<h2>How to fix it</h2>\n<p>There’s no need to translate manually between time zones; it is enough to call <code>TimeZoneInfo.FindSystemTimeZoneById(string timezone)</code>,\nwhere the timezone can be IANA or Windows format. Depending on the OS, the equivalent time zone will be returned (Windows Time Zones for Windows and\nIANA timezones for Linux, macOS).</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\n// Assuming we are in Windows OS and we need to get the Tokyo Time Zone.\nDim ianaTimeZone = \"Asia/Tokyo\"\nDim windowsTimeZone = TZConvert.IanaToWindows(ianaTimeZone)\nDim tokyoWindowsTimeZone As TimeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(windowsTimeZone)\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n// Assuming we are in Windows OS and we need to get the Tokyo Time Zone.\nDim ianaTimeZone = \"Asia/Tokyo\"\nDim tokyoWindowsTimeZone As TimeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(ianaTimeZone)\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.timezoneinfo.findsystemtimezonebyid\">TimeZoneInfo.FindSystemTimeZoneById\n  documentation</a></li>\n  <li><a href=\"https://devblogs.microsoft.com/dotnet/date-time-and-time-zone-enhancements-in-net-6/\">Date, Time, and Time Zone Enhancements in .NET\n  6</a></li>\n  <li><a href=\"https://github.com/mattjohnsonpint/TimeZoneConverter\">TimeZoneConverter</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li><a href=\"https://codeblog.jonskeet.uk/2022/02/05/whats-up-with-timezoneinfo-on-net-6-part-1/\">What’s up with TimeZoneInfo on .NET 6?</a></li>\n</ul>\n<h3>Standards</h3>\n<ul>\n  <li><a href=\"https://www.iana.org/time-zones\">IANA Time Zone Database</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11\">Windows Time Zones</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6575.json",
    "content": "{\n  \"title\": \"Use \\\"TimeZoneInfo.FindSystemTimeZoneById\\\" without converting the timezones with \\\"TimezoneConverter\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6575\",\n  \"sqKey\": \"S6575\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6580.html",
    "content": "<p>When converting a string representation of a date and time to a <code>DateTime</code> object or any other temporal type with one of the available\nsystem parsing methods, you should always provide an <code>IFormatProvider</code> parameter.</p>\n<h2>Why is this an issue?</h2>\n<p>If you try to parse a string representation of a date or time without a format provider, the method will use the machine’s\n<code>CultureInfo</code>; if the given string does not follow it, you’ll have an object that does not match the string representation or an unexpected\nruntime error.</p>\n<p>This rule raises an issue for the following date and time string representation parsing methods:</p>\n<ul>\n  <li><code>Parse</code></li>\n  <li><code>ParseExact</code></li>\n  <li><code>TryParse</code></li>\n  <li><code>TryParseExact</code></li>\n</ul>\n<p>Of the following types:</p>\n<ul>\n  <li><code>System.DateOnly</code></li>\n  <li><code>System.DateTime</code></li>\n  <li><code>System.DateTimeOffset</code></li>\n  <li><code>System.TimeOnly</code></li>\n  <li><code>System.TimeSpan</code></li>\n</ul>\n<h2>How to fix it</h2>\n<p>Alway use an overload of the parse method, where you can provide an <code>IFormatProvider</code> parameter.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nDim dateTimeString = \"4/12/2023 4:05:48 PM\" ' This is an en-US format string - 12 of April 2023\nDim dateTimeObject = DateTime.Parse(dateTimeString) ' This is wrongly parsed as 4th of December, when it's read in a machine with \"CultureInfo.CurrentCulture\" en-150 (English Europe)\n\nDim dateTimeString2 = \"4/13/2023 4:05:48 PM\" ' This is an en-US format string - 13 of April 2023\nDim dateTimeObject2 = DateTime.Parse(dateTimeString2) ' Runtime Error, when it's parsed in a machine with \"CultureInfo.CurrentCulture\" en-150 (English Europe).\n\nDim timeInSaudiArabia = New TimeOnly(16, 23).ToString(New CultureInfo(\"ar-SA\"))\nDim timeObject = TimeOnly.Parse(timeInSaudiArabia) ' Runtime Error, when it's parsed in a machine with \"CultureInfo.CurrentCulture\" en-150 (English Europe).\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nDim dateTimeString = \"4/12/2023 4:05:48 PM\" ' This is an en-US format string - 12 of April 2023\nDim dateTimeObject = DateTime.Parse(dateTimeString, New CultureInfo(\"en-US\"))\n\nDim dateTimeString2 = \"4/13/2023 4:05:48 PM\" ' This is an en-US format string - 13 of April 2023\nDim dateTimeObject2 = DateTime.Parse(dateTimeString2, New CultureInfo(\"en-US\"))\n\nDim timeInSaudiArabia = New TimeOnly(16, 23).ToString(New CultureInfo(\"ar-SA\"))\nDim timeObject = TimeOnly.Parse(timeInSaudiArabia, New CultureInfo(\"ar-SA\"))\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetime.parse\">DateTime.Parse method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetime.parseexact\">DateTime.ParseExact method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetime.tryparse\">DateTime.TryParse method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetime.tryparseexact\">DateTime.TryParseExact method</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.dateonly\">DateOnly type</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetime\">DateTime type</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetimeoffset\">DateTimeOffset type</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.timeonly\">TimeOnly type</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.timespan\">TimeSpan type</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.globalization.cultureinfo\">Culture Info class documentation</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings\">Standard date and time format\n  strings</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6580.json",
    "content": "{\n  \"title\": \"Use a format provider when parsing date and time\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"pitfall\",\n    \"bug\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6580\",\n  \"sqKey\": \"S6580\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6585.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Hardcoding the date and time format strings can lead to formats that consumers misunderstand. Also, if the same format is meant to be used in\nmultiple places, it is easier to make a mistake when it’s hardcoded instead of using a format provided by an <code>IFormatProvider</code> or using one\nof the standard format strings.</p>\n<h3>What is the potential impact?</h3>\n<p>If a non-conventional format is used, the formatted date and time can be misunderstood. Also, if a mistake is made in the format, the formatted\ndate can be incomplete. For example, you might switch the place of the minutes and month parts of a date or simply forget to print the year.</p>\n<h2>How to fix it</h2>\n<p>Instead of hardcoding the format, provide one from the available formats through an <code>IFormatProvider</code> or use one of the standard format\nstrings.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nPrivate Sub PrintTime()\n    Console.WriteLine(DateTime.UtcNow.ToString(\"dd/MM/yyyy HH:mm:ss\"))\n\n    Console.WriteLine(DateTime.UtcNow.ToString(\"dd/mm/yyyy HH:MM:ss\")) ' Months and minutes have changed their places\nEnd Sub\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nPrivate Sub PrintTime()\n    Console.WriteLine(DateTime.UtcNow.ToString(CultureInfo.GetCultureInfo(\"es-MX\")))\n\n    Console.WriteLine(DateTime.UtcNow.ToString(CultureInfo.InvariantCulture)) ' Better provide a well known culture, so this kind of issues do not pop up\nEnd Sub\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.iformatprovider\">IFormatProvider documentation</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.globalization.cultureinfo\">CultureInfo documentation</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings\">Standard date and time format\n  strings</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings\">Custom date and time format\n  strings</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-timespan-format-strings\">Standard TimeSpan format\n  strings</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/base-types/custom-timespan-format-strings\">Custom TimeSpan format strings</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6585.json",
    "content": "{\n  \"title\": \"Don\\u0027t hardcode the format when turning dates and times to strings\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"COMPLETE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-6585\",\n  \"sqKey\": \"S6585\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6588.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>With .NET Core the <code>UnixEpoch</code> field was introduced to <code>DateTime</code> and <code>DateTimeOffset</code> types. Using this field\nclearly states that the intention is to use the beginning of the Unix epoch.</p>\n<h3>What is the potential impact?</h3>\n<p>You should not use the <code>DateTime</code> or <code>DateTimeOffset</code> constructors to set the time to the 1st of January 1970 to represent\nthe beginning of the Unix epoch. Not everyone is familiar with what this particular date is representing and it can be misleading.</p>\n<h2>How to fix it</h2>\n<p>To fix this issue, use the <code>UnixEpoch</code> field of <code>DateTime</code> or <code>DateTimeOffset</code> instead of the constructor.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nPrivate Sub GetEpochTime()\n    Dim epochTime = New DateTime(1970, 1, 1)\nEnd Sub\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nPrivate Sub GetEpochTime()\n    Dim epochTime = DateTime.UnixEpoch\nEnd Sub\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetime.unixepoch\">DateTime.UnixEpoch documentation</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.datetimeoffset.unixepoch\">DateTimeOffset.UnixEpoch documentation</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Unix_time\">Unix time</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6588.json",
    "content": "{\n  \"title\": \"Use the \\\"UnixEpoch\\\" field instead of creating \\\"DateTime\\\" instances that point to the beginning of the Unix epoch\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-6588\",\n  \"sqKey\": \"S6588\",\n  \"scope\": \"All\",\n  \"quickfix\": \"covered\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6602.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Both the <code>List.Find</code> method and the <code>Enumerable.FirstOrDefault</code> method can be used to locate the first element that meets a\nspecified condition within a collection. However, for <code>List</code> objects, <code>List.Find</code> may offer superior performance compared to\n<code>Enumerable.FirstOrDefault</code>. While the performance difference might be negligible for small collections, it can become significant for\nlarger collections. This observation also holds true for <code>ImmutableList</code> and arrays.</p>\n<p>It is important to enable this rule with caution, as performance outcomes can vary significantly across different runtimes. Notably, the <a\nhref=\"https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-9/#collections\">performance improvements in .NET 9</a> have brought\n<code>FirstOrDefault</code> closer to the performance of collection-specific <code>Find</code> methods in most scenarios.</p>\n<p><strong>Applies to</strong></p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1.find\">List</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.array.find\">Array</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable.immutablelist-1.find\">ImmutableList</a></li>\n</ul>\n<h3>What is the potential impact?</h3>\n<p>We measured at least 2x improvement in the execution time. For more details see the <code>Benchmarks</code> section from the <code>More info</code>\ntab.</p>\n<h2>How to fix it</h2>\n<p>The <code>Find</code> method is defined on the collection class, and it has the same signature as <code>FirstOrDefault</code> extension method. The\nfunction can be replaced in place.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nFunction GetValue(data As List(Of Integer)) As Integer\n    Return data.FirstOrDefault(Function(x) x Mod 2 = 0)\nEnd Function\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nFunction GetValue(data() As Integer) As Integer\n    Return data.FirstOrDefault(Function(x) x Mod 2 = 0)\nEnd Function\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nFunction GetValue(data As List(Of Integer)) As Integer\n    Return data.Find(Function(x) x Mod 2 = 0)\nEnd Function\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nFunction GetValue(data() As Integer) As Integer\n    Return Array.Find(data, Function(x) x Mod 2 = 0)\nEnd Function\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1.find\">List&lt;T&gt;.Find(Predicate&lt;T&gt;)</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.array.find\">Array.Find&lt;T&gt;(T[], Predicate&lt;T&gt;)</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable.immutablelist-1.find\">ImmutableList&lt;T&gt;.Find(Predicate&lt;T&gt;)</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.firstordefault\">Enumerable.FirstOrDefault(Predicate&lt;T&gt;)</a></li>\n</ul>\n<h3>Benchmarks</h3>\n<table>\n  <colgroup>\n    <col style=\"width: 16.6666%;\">\n    <col style=\"width: 16.6666%;\">\n    <col style=\"width: 16.6666%;\">\n    <col style=\"width: 16.6666%;\">\n    <col style=\"width: 16.6666%;\">\n    <col style=\"width: 16.667%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>Method</th>\n      <th>Runtime</th>\n      <th>Categories</th>\n      <th>Mean</th>\n      <th>Standard Deviation</th>\n      <th>Allocated</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p>ArrayFirstOrDefault</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>Array</p>\n      </td>\n      <td>\n        <p>10.515 μs</p>\n      </td>\n      <td>\n        <p>0.1410 μs</p>\n      </td>\n      <td>\n        <p>32 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ArrayFind</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>Array</p>\n      </td>\n      <td>\n        <p>4.417 μs</p>\n      </td>\n      <td>\n        <p>0.0729 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ArrayFirstOrDefault</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>Array</p>\n      </td>\n      <td>\n        <p>2.262 μs</p>\n      </td>\n      <td>\n        <p>0.0135 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ArrayFind</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>Array</p>\n      </td>\n      <td>\n        <p>3.428 μs</p>\n      </td>\n      <td>\n        <p>0.0206 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ArrayFirstOrDefault</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>Array</p>\n      </td>\n      <td>\n        <p>45.074 μs</p>\n      </td>\n      <td>\n        <p>0.7517 μs</p>\n      </td>\n      <td>\n        <p>32 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ArrayFind</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>Array</p>\n      </td>\n      <td>\n        <p>13.948 μs</p>\n      </td>\n      <td>\n        <p>0.1496 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListFirstOrDefault</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>83.796 μs</p>\n      </td>\n      <td>\n        <p>1.3199 μs</p>\n      </td>\n      <td>\n        <p>72 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListFind</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>59.720 μs</p>\n      </td>\n      <td>\n        <p>1.0723 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListFirstOrDefault</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>81.984 μs</p>\n      </td>\n      <td>\n        <p>1.0886 μs</p>\n      </td>\n      <td>\n        <p>72 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListFind</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>58.288 μs</p>\n      </td>\n      <td>\n        <p>0.8079 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListFirstOrDefault</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>446.893 μs</p>\n      </td>\n      <td>\n        <p>9.8430 μs</p>\n      </td>\n      <td>\n        <p>76 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListFind</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>427.476 μs</p>\n      </td>\n      <td>\n        <p>3.3371 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ListFirstOrDefault</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>List&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>14.808 μs</p>\n      </td>\n      <td>\n        <p>0.1723 μs</p>\n      </td>\n      <td>\n        <p>40 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ListFind</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>List&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>6.040 μs</p>\n      </td>\n      <td>\n        <p>0.1104 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ListFirstOrDefault</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>List&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>2.233 μs</p>\n      </td>\n      <td>\n        <p>0.0154 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ListFind</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>List&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>4.458 μs</p>\n      </td>\n      <td>\n        <p>0.0745 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ListFirstOrDefault</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>List&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>57.290 μs</p>\n      </td>\n      <td>\n        <p>1.0494 μs</p>\n      </td>\n      <td>\n        <p>40 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ListFind</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>List&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>18.476 μs</p>\n      </td>\n      <td>\n        <p>0.0504 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h4>Glossary</h4>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Arithmetic_mean\">Mean</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Standard_deviation\">Standard Deviation</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Memory_management\">Allocated</a></li>\n</ul>\n<p>The results were generated by running the following snippet with <a href=\"https://github.com/dotnet/BenchmarkDotNet\">BenchmarkDotNet</a>:</p>\n<pre>\n// Explicitly cache the delegates to avoid allocations inside the benchmark.\nprivate readonly static Func&lt;int, bool&gt; ConditionFunc = static x =&gt; x == 1;\nprivate readonly static Predicate&lt;int&gt; ConditionPredicate = static x =&gt; x == 1;\nprivate List&lt;int&gt; list;\nprivate ImmutableList&lt;int&gt; immutableList;\nprivate int[] array;\npublic const int N = 10_000;\n\n[GlobalSetup]\npublic void GlobalSetup()\n{\n    list = Enumerable.Range(0, N).Select(x =&gt; N - x).ToList();\n    immutableList = ImmutableList.CreateRange(list);\n    array = list.ToArray();\n}\n\n[BenchmarkCategory(\"List&lt;T&gt;\"), Benchmark(Baseline = true)]\npublic int ListFirstOrDefault() =&gt;\n    list.FirstOrDefault(ConditionFunc);\n\n[BenchmarkCategory(\"List&lt;T&gt;\"), Benchmark]\npublic int ListFind() =&gt;\n    list.Find(ConditionPredicate);\n\n[BenchmarkCategory(\"ImmutableList&lt;T&gt;\"), Benchmark(Baseline = true)]\npublic int ImmutableListFirstOrDefault() =&gt;\n    immutableList.FirstOrDefault(ConditionFunc);\n\n[BenchmarkCategory(\"ImmutableList&lt;T&gt;\"), Benchmark]\npublic int ImmutableListFind() =&gt;\n    immutableList.Find(ConditionPredicate);\n\n[BenchmarkCategory(\"Array\"), Benchmark(Baseline = true)]\npublic int ArrayFirstOrDefault() =&gt;\n    array.FirstOrDefault(ConditionFunc);\n\n[BenchmarkCategory(\"Array\"), Benchmark]\npublic int ArrayFind() =&gt;\n    Array.Find(array, ConditionPredicate);\n</pre>\n<p>Hardware configuration:</p>\n<pre>\nBenchmarkDotNet v0.14.0, Windows 11 (10.0.22631.4317/23H2/2023Update/SunValley3)\n11th Gen Intel Core i7-11850H 2.50GHz, 1 CPU, 16 logical and 8 physical cores\n  [Host]               : .NET Framework 4.8.1 (4.8.9277.0), X64 RyuJIT VectorSize=256\n  .NET 8.0             : .NET 8.0.10 (8.0.1024.46610), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI\n  .NET 9.0             : .NET 9.0.0 (9.0.24.47305), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI\n  .NET Framework 4.8.1 : .NET Framework 4.8.1 (4.8.9277.0), X64 RyuJIT VectorSize=256\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6602.json",
    "content": "{\n  \"title\": \"\\\"Find\\\" method should be used instead of the \\\"FirstOrDefault\\\" extension\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-6602\",\n  \"sqKey\": \"S6602\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6603.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Both the <code>List.TrueForAll</code> method and the <code>IEnumerable.All</code> method can be used to check if all list elements satisfy a given\ncondition in a collection. However, <code>List.TrueForAll</code> can be faster than <code>IEnumerable.All</code> for <code>List</code> objects. The\nperformance difference may be minor for small collections, but for large collections, it can be noticeable.</p>\n<p>It is important to enable this rule with caution, as performance outcomes can vary significantly across different runtimes. Notably, the <a\nhref=\"https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-9/#collections\">performance improvements in .NET 9</a> have brought\n<code>All</code> closer to the performance of collection-specific <code>TrueForAll</code> methods in most scenarios.</p>\n<p><strong>Applies to</strong></p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1.trueforall\">List</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.array.trueforall\">Array</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable.immutablelist-1.trueforall\">ImmutableList</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable.immutablelist-1.builder.trueforall\">ImmutableList.Builder</a></li>\n</ul>\n<h3>What is the potential impact?</h3>\n<p>We measured at least 4x improvement both in execution time. For more details see the <code>Benchmarks</code> section from the <code>More\ninfo</code> tab.</p>\n<h2>How to fix it</h2>\n<p>The <code>TrueForAll</code> method is defined on the collection class, and it has the same signature as the <code>All</code> extension method. The\nmethod can be replaced in place.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nPublic Function AreAllEven(data As List(Of Integer)) As Boolean\n    Return data.All(Function(x) x Mod 2 = 0)\nEnd Function\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nPublic Function AreAllEven(data As Integer()) As Boolean\n    Return data.All(Function(x) x Mod 2 = 0)\nEnd Function\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nPublic Function AreAllEven(data As List(Of Integer)) As Boolean\n    Return data.TrueForAll(Function(x) x Mod 2 = 0)\nEnd Function\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nPublic Function AreAllEven(data As Integer()) As Boolean\n    Return Array.TrueForAll(data, Function(x) x Mod 2 = 0)\nEnd Function\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1.trueforall\">List&lt;T&gt;.TrueForAll(Predicate&lt;T&gt;)</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.array.trueforall\">Array.TrueForAll&lt;T&gt;(T[],\n  Predicate&lt;T&gt;)</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable.immutablelist-1.trueforall\">ImmutableList&lt;T&gt;.TrueForAll(Predicate&lt;T&gt;)</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable.immutablelist-1.builder.trueforall\">ImmutableList&lt;T&gt;.Builder.TrueForAll(Predicate&lt;T&gt;)</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.all\">Enumerable.All&lt;TSource&gt;</a></li>\n</ul>\n<h3>Benchmarks</h3>\n<table>\n  <colgroup>\n    <col style=\"width: 16.6666%;\">\n    <col style=\"width: 16.6666%;\">\n    <col style=\"width: 16.6666%;\">\n    <col style=\"width: 16.6666%;\">\n    <col style=\"width: 16.6666%;\">\n    <col style=\"width: 16.667%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>Method</th>\n      <th>Runtime</th>\n      <th>Categories</th>\n      <th>Mean</th>\n      <th>Standard Deviation</th>\n      <th>Allocated</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p>ArrayAll</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>Array</p>\n      </td>\n      <td>\n        <p>109.25 μs</p>\n      </td>\n      <td>\n        <p>1.767 μs</p>\n      </td>\n      <td>\n        <p>32 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ArrayTrueForAll</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>Array</p>\n      </td>\n      <td>\n        <p>45.01 μs</p>\n      </td>\n      <td>\n        <p>0.547 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ArrayAll</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>Array</p>\n      </td>\n      <td>\n        <p>22.28 μs</p>\n      </td>\n      <td>\n        <p>0.254 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ArrayTrueForAll</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>Array</p>\n      </td>\n      <td>\n        <p>37.60 μs</p>\n      </td>\n      <td>\n        <p>0.382 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ArrayAll</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>Array</p>\n      </td>\n      <td>\n        <p>495.90 μs</p>\n      </td>\n      <td>\n        <p>4.342 μs</p>\n      </td>\n      <td>\n        <p>40 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ArrayTrueForAll</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>Array</p>\n      </td>\n      <td>\n        <p>164.52 μs</p>\n      </td>\n      <td>\n        <p>2.030 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListAll</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>940.29 μs</p>\n      </td>\n      <td>\n        <p>5.600 μs</p>\n      </td>\n      <td>\n        <p>72 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListTrueForAll</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>679.46 μs</p>\n      </td>\n      <td>\n        <p>2.371 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListAll</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>922.43 μs</p>\n      </td>\n      <td>\n        <p>14.564 μs</p>\n      </td>\n      <td>\n        <p>72 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListTrueForAll</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>692.31 μs</p>\n      </td>\n      <td>\n        <p>8.897 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListAll</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>4,578.72 μs</p>\n      </td>\n      <td>\n        <p>77.920 μs</p>\n      </td>\n      <td>\n        <p>128 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListTrueForAll</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>4,393.49 μs</p>\n      </td>\n      <td>\n        <p>122.061 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListBuilderAll</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;.Builder</p>\n      </td>\n      <td>\n        <p>970.45 μs</p>\n      </td>\n      <td>\n        <p>13.598 μs</p>\n      </td>\n      <td>\n        <p>73 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListBuilderTrueForAll</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;.Builder</p>\n      </td>\n      <td>\n        <p>687.82 μs</p>\n      </td>\n      <td>\n        <p>6.142 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListBuilderAll</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;.Builder</p>\n      </td>\n      <td>\n        <p>981.17 μs</p>\n      </td>\n      <td>\n        <p>12.966 μs</p>\n      </td>\n      <td>\n        <p>72 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListBuilderTrueForAll</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;.Builder</p>\n      </td>\n      <td>\n        <p>710.19 μs</p>\n      </td>\n      <td>\n        <p>16.195 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListBuilderAll</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;.Builder</p>\n      </td>\n      <td>\n        <p>4,780.50 μs</p>\n      </td>\n      <td>\n        <p>43.282 μs</p>\n      </td>\n      <td>\n        <p>128 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListBuilderTrueForAll</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;.Builder</p>\n      </td>\n      <td>\n        <p>4,493.82 μs</p>\n      </td>\n      <td>\n        <p>76.530 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ListAll</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>List&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>151.12 μs</p>\n      </td>\n      <td>\n        <p>2.028 μs</p>\n      </td>\n      <td>\n        <p>40 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ListTrueForAll</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>List&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>58.03 μs</p>\n      </td>\n      <td>\n        <p>0.493 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ListAll</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>List&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>22.14 μs</p>\n      </td>\n      <td>\n        <p>0.327 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ListTrueForAll</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>List&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>46.01 μs</p>\n      </td>\n      <td>\n        <p>0.327 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ListAll</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>List&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>619.86 μs</p>\n      </td>\n      <td>\n        <p>6.037 μs</p>\n      </td>\n      <td>\n        <p>48 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ListTrueForAll</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>List&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>208.49 μs</p>\n      </td>\n      <td>\n        <p>2.340 μs</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h4>Glossary</h4>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Arithmetic_mean\">Mean</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Standard_deviation\">Standard Deviation</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Memory_management\">Allocated</a></li>\n</ul>\n<p>The results were generated by running the following snippet with <a href=\"https://github.com/dotnet/BenchmarkDotNet\">BenchmarkDotNet</a>:</p>\n<pre>\n// Explicitly cache the delegates to avoid allocations inside the benchmark.\nprivate readonly static Func&lt;int, bool&gt; ConditionFunc = static x =&gt; x == Math.Abs(x);\nprivate readonly static Predicate&lt;int&gt; ConditionPredicate = static x =&gt; x == Math.Abs(x);\n\nprivate List&lt;int&gt; list;\nprivate ImmutableList&lt;int&gt; immutableList;\nprivate ImmutableList&lt;int&gt;.Builder immutableListBuilder;\nprivate int[] array;\n\n[Params(100_000)]\npublic int N { get; set; }\n\n[GlobalSetup]\npublic void GlobalSetup()\n{\n    list = Enumerable.Range(0, N).Select(x =&gt; N - x).ToList();\n    immutableList = ImmutableList.CreateRange(list);\n    immutableListBuilder = ImmutableList.CreateBuilder&lt;int&gt;();\n    immutableListBuilder.AddRange(list);\n    array = list.ToArray();\n}\n\n[BenchmarkCategory(\"List&lt;T&gt;\"), Benchmark]\npublic bool ListAll() =&gt;\n    list.All(ConditionFunc);\n\n[BenchmarkCategory(\"List&lt;T&gt;\"), Benchmark(Baseline = true)]\npublic bool ListTrueForAll() =&gt;\n    list.TrueForAll(ConditionPredicate);\n\n[BenchmarkCategory(\"ImmutableList&lt;T&gt;\"), Benchmark(Baseline = true)]\npublic bool ImmutableListAll() =&gt;\n    immutableList.All(ConditionFunc);\n\n[BenchmarkCategory(\"ImmutableList&lt;T&gt;\"), Benchmark]\npublic bool ImmutableListTrueForAll() =&gt;\n    immutableList.TrueForAll(ConditionPredicate);\n\n[BenchmarkCategory(\"ImmutableList&lt;T&gt;.Builder\"), Benchmark(Baseline = true)]\npublic bool ImmutableListBuilderAll() =&gt;\n    immutableListBuilder.All(ConditionFunc);\n\n[BenchmarkCategory(\"ImmutableList&lt;T&gt;.Builder\"), Benchmark]\npublic bool ImmutableListBuilderTrueForAll() =&gt;\n    immutableListBuilder.TrueForAll(ConditionPredicate);\n\n[BenchmarkCategory(\"Array\"), Benchmark(Baseline = true)]\npublic bool ArrayAll() =&gt;\n    array.All(ConditionFunc);\n\n[BenchmarkCategory(\"Array\"), Benchmark]\npublic bool ArrayTrueForAll() =&gt;\n    Array.TrueForAll(array, ConditionPredicate);\n</pre>\n<p>Hardware configuration:</p>\n<pre>\nBenchmarkDotNet v0.14.0, Windows 11 (10.0.22631.4317/23H2/2023Update/SunValley3)\n11th Gen Intel Core i7-11850H 2.50GHz, 1 CPU, 16 logical and 8 physical cores\n  [Host]               : .NET Framework 4.8.1 (4.8.9277.0), X64 RyuJIT VectorSize=256\n  .NET 8.0             : .NET 8.0.10 (8.0.1024.46610), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI\n  .NET 9.0             : .NET 9.0.0 (9.0.24.47305), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI\n  .NET Framework 4.8.1 : .NET Framework 4.8.1 (4.8.9277.0), X64 RyuJIT VectorSize=256\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6603.json",
    "content": "{\n  \"title\": \"The collection-specific \\\"TrueForAll\\\" method should be used instead of the \\\"All\\\" extension\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-6603\",\n  \"sqKey\": \"S6603\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6605.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Both the <code>List.Exists</code> method and <code>IEnumerable.Any</code> method can be used to find the first element that satisfies a predicate\nin a collection. However, <code>List.Exists</code> can be faster than <code>IEnumerable.Any</code> for <code>List</code> objects, as well as requires\nsignificantly less memory. For small collections, the performance difference may be negligible, but for large collections, it can be noticeable. The\nsame applies to <code>ImmutableList</code> and arrays too.</p>\n<p>It is important to enable this rule with caution, as performance outcomes can vary significantly across different runtimes. Notably, the <a\nhref=\"https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-9/#collections\">performance improvements in .NET 9</a> have brought\n<code>Any</code> closer to the performance of collection-specific <code>Exists</code> methods in most scenarios.</p>\n<p><strong>Applies to</strong></p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1.exists\">List</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.array.exists\">Array</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable.immutablelist-1.exists\">ImmutableList</a></li>\n</ul>\n<h3>What is the potential impact?</h3>\n<p>We measured at least 3x improvement in execution time. For more details see the <code>Benchmarks</code> section from the <code>More info</code>\ntab.</p>\n<p>Also, no memory allocations were needed for the <code>Exists</code> method, since the search is done in-place.</p>\n<h3>Exceptions</h3>\n<p>Since <code><a href=\"https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/ef/language-reference/linq-to-entities\">LINQ to\nEntities</a></code> relies a lot on <code>System.Linq</code> for <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/ef/language-reference/linq-to-entities#query-conversion\">query conversion</a>,\nthis rule won’t raise when used within LINQ to Entities syntaxes.</p>\n<h2>How to fix it</h2>\n<p>The <code>Exists</code> method is defined on the collection class, and it has the same signature as <code>Any</code> extension method if a\npredicate is used. The method can be replaced in place.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nFunction ContainsEven(data As List(Of Integer)) As Boolean\n    Return data.Any(Function(x) x Mod 2 = 0)\nEnd Function\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nFunction ContainsEven(data() As Integer) As Boolean\n    Return data.Any(Function(x) x Mod 2 = 0)\nEnd Function\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nFunction ContainsEven(data As List(Of Integer)) As Boolean\n    Return data.Exists(Function(x) x Mod 2 = 0)\nEnd Function\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nFunction ContainsEven(data() As Integer) As Boolean\n    Return Array.Exists(data, Function(x) x Mod 2 = 0)\nEnd Function\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1.exists\">List&lt;T&gt;.Exists(Predicate&lt;T&gt;)</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.array.exists\">Array.Exists&lt;T&gt;(T[],\n  Predicate&lt;T&gt;)</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable.immutablelist-1.exists\">ImmutableList&lt;T&gt;.Exists(Predicate&lt;T&gt;)</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.any\">Enumerable.Any(Predicate&lt;T&gt;)</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/ef/language-reference/linq-to-entities\">LINQ to\n  Entities</a></li>\n</ul>\n<h3>Benchmarks</h3>\n<table>\n  <colgroup>\n    <col style=\"width: 16.6666%;\">\n    <col style=\"width: 16.6666%;\">\n    <col style=\"width: 16.6666%;\">\n    <col style=\"width: 16.6666%;\">\n    <col style=\"width: 16.6666%;\">\n    <col style=\"width: 16.667%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>Method</th>\n      <th>Runtime</th>\n      <th>Categories</th>\n      <th>Mean</th>\n      <th>Standard Deviation</th>\n      <th>Allocated</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p>ArrayAny</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>Array</p>\n      </td>\n      <td>\n        <p>1,174.0 ns</p>\n      </td>\n      <td>\n        <p>16.44 ns</p>\n      </td>\n      <td>\n        <p>32 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ArrayExists</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>Array</p>\n      </td>\n      <td>\n        <p>570.6 ns</p>\n      </td>\n      <td>\n        <p>7.12 ns</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ArrayAny</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>Array</p>\n      </td>\n      <td>\n        <p>358.5 ns</p>\n      </td>\n      <td>\n        <p>5.57 ns</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ArrayExists</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>Array</p>\n      </td>\n      <td>\n        <p>581.6 ns</p>\n      </td>\n      <td>\n        <p>6.17 ns</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ArrayAny</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>Array</p>\n      </td>\n      <td>\n        <p>4,896.0 ns</p>\n      </td>\n      <td>\n        <p>102.83 ns</p>\n      </td>\n      <td>\n        <p>32 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ArrayExists</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>Array</p>\n      </td>\n      <td>\n        <p>1,649.4 ns</p>\n      </td>\n      <td>\n        <p>29.81 ns</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListAny</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>7,859.3 ns</p>\n      </td>\n      <td>\n        <p>91.45 ns</p>\n      </td>\n      <td>\n        <p>72 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListExists</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>5,898.1 ns</p>\n      </td>\n      <td>\n        <p>81.69 ns</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListAny</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>7,748.9 ns</p>\n      </td>\n      <td>\n        <p>119.10 ns</p>\n      </td>\n      <td>\n        <p>72 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListExists</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>5,705.0 ns</p>\n      </td>\n      <td>\n        <p>31.53 ns</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListAny</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>45,118.5 ns</p>\n      </td>\n      <td>\n        <p>168.72 ns</p>\n      </td>\n      <td>\n        <p>72 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ImmutableListExists</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>ImmutableList&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>41,966.0 ns</p>\n      </td>\n      <td>\n        <p>631.59 ns</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ListAny</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>List&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>1,643.5 ns</p>\n      </td>\n      <td>\n        <p>13.09 ns</p>\n      </td>\n      <td>\n        <p>40 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ListExists</p>\n      </td>\n      <td>\n        <p>.NET 8.0</p>\n      </td>\n      <td>\n        <p>List&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>726.2 ns</p>\n      </td>\n      <td>\n        <p>11.99 ns</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ListAny</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>List&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>398.6 ns</p>\n      </td>\n      <td>\n        <p>8.20 ns</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ListExists</p>\n      </td>\n      <td>\n        <p>.NET 9.0</p>\n      </td>\n      <td>\n        <p>List&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>612.4 ns</p>\n      </td>\n      <td>\n        <p>18.73 ns</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>\n        <p>ListAny</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>List&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>5,621.5 ns</p>\n      </td>\n      <td>\n        <p>35.80 ns</p>\n      </td>\n      <td>\n        <p>40 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>ListExists</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.8.1</p>\n      </td>\n      <td>\n        <p>List&lt;T&gt;</p>\n      </td>\n      <td>\n        <p>1,748.0 ns</p>\n      </td>\n      <td>\n        <p>11.76 ns</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h4>Glossary</h4>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Arithmetic_mean\">Mean</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Standard_deviation\">Standard Deviation</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Memory_management\">Allocated</a></li>\n</ul>\n<p>The results were generated by running the following snippet with <a href=\"https://github.com/dotnet/BenchmarkDotNet\">BenchmarkDotNet</a>:</p>\n<pre>\n// Explicitly cache the delegates to avoid allocations inside the benchmark.\nprivate readonly static Func&lt;int, bool&gt; ConditionFunc = static x =&gt; x == -1 * Math.Abs(x);\nprivate readonly static Predicate&lt;int&gt; ConditionPredicate = static x =&gt; x == -1 * Math.Abs(x);\n\nprivate List&lt;int&gt; list;\nprivate ImmutableList&lt;int&gt; immutableList;\nprivate int[] array;\n\n[Params(1_000)]\npublic int N { get; set; }\n\n[GlobalSetup]\npublic void GlobalSetup()\n{\n    list = Enumerable.Range(0, N).Select(x =&gt; N - x).ToList();\n    immutableList = ImmutableList.CreateRange(list);\n    array = list.ToArray();\n}\n\n[BenchmarkCategory(\"List&lt;T&gt;\"), Benchmark]\npublic bool ListAny() =&gt;\n    list.Any(ConditionFunc);\n\n[BenchmarkCategory(\"List&lt;T&gt;\"), Benchmark(Baseline = true)]\npublic bool ListExists() =&gt;\n    list.Exists(ConditionPredicate);\n\n[BenchmarkCategory(\"ImmutableList&lt;T&gt;\"), Benchmark(Baseline = true)]\npublic bool ImmutableListAny() =&gt;\n    immutableList.Any(ConditionFunc);\n\n[BenchmarkCategory(\"ImmutableList&lt;T&gt;\"), Benchmark]\npublic bool ImmutableListExists() =&gt;\n    immutableList.Exists(ConditionPredicate);\n\n[BenchmarkCategory(\"Array\"), Benchmark(Baseline = true)]\npublic bool ArrayAny() =&gt;\n    array.Any(ConditionFunc);\n\n[BenchmarkCategory(\"Array\"), Benchmark]\npublic bool ArrayExists() =&gt;\n    Array.Exists(array, ConditionPredicate);\n</pre>\n<p>Hardware configuration:</p>\n<pre>\nBenchmarkDotNet v0.14.0, Windows 11 (10.0.22631.4317/23H2/2023Update/SunValley3)\n11th Gen Intel Core i7-11850H 2.50GHz, 1 CPU, 16 logical and 8 physical cores\n  [Host]               : .NET Framework 4.8.1 (4.8.9277.0), X64 RyuJIT VectorSize=256\n  .NET 8.0             : .NET 8.0.10 (8.0.1024.46610), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI\n  .NET 9.0             : .NET 9.0.0 (9.0.24.47305), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI\n  .NET Framework 4.8.1 : .NET Framework 4.8.1 (4.8.9277.0), X64 RyuJIT VectorSize=256\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6605.json",
    "content": "{\n  \"title\": \"Collection-specific \\\"Exists\\\" method should be used instead of the \\\"Any\\\" extension\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-6605\",\n  \"sqKey\": \"S6605\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6607.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When working with LINQ in C#, it is recommended to pay attention to the order in which methods are chained, especially when using\n<code>Where</code> and <code>OrderBy</code> methods. It is advised to call the <code>Where</code> method before <code>OrderBy</code> because\n<code>Where</code> filters the elements of the sequence based on a given condition and returns a new sequence containing only the elements that\nsatisfy that condition. Calling <code>OrderBy</code> before <code>Where</code>, may end up sorting elements that will be later discarded, which can\nlead to inefficiency. Conversely, calling <code>Where</code> before <code>OrderBy</code>, will first filter the sequence to include only the elements\nof interest, and then sort them based on the specified order.</p>\n<h3>What is the potential impact?</h3>\n<p>We measured at least 2x improvement in execution time. For more details see the <code>Benchmarks</code> section from the <code>More info</code>\ntab.</p>\n<h2>How to fix it</h2>\n<p>The issue can be fixed by calling <code>Where</code> before <code>OrderBy</code>.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nPublic Function GetSortedFilteredList(data As IEnumerable(Of Integer)) As IEnumerable(Of Integer)\n    Return data.OrderBy(Function(x) x).Where(Function(x) x Mod 2 = 0)\nEnd Function\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nPublic Function GetSortedFilteredList(data As IEnumerable(Of Integer)) As IEnumerable(Of Integer)\n    Return data.Where(Function(x) x Mod 2 = 0).OrderBy(Function(x) x)\nEnd Function\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.orderby\">Enumerable.OrderBy</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.where\">Enumerable.Where</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li><a href=\"https://stackoverflow.com/questions/7499384/does-the-order-of-linq-functions-matter/7499454#7499454\">Jon Skeet’s explanation on Stack\n  Overflow</a></li>\n</ul>\n<h3>Benchmarks</h3>\n<table>\n  <colgroup>\n    <col style=\"width: 25%;\">\n    <col style=\"width: 25%;\">\n    <col style=\"width: 25%;\">\n    <col style=\"width: 25%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>Method</th>\n      <th>Runtime</th>\n      <th>Mean</th>\n      <th>Standard Deviation</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p>OrderByThenWhere</p>\n      </td>\n      <td>\n        <p>.NET 7.0</p>\n      </td>\n      <td>\n        <p>175.36 ms</p>\n      </td>\n      <td>\n        <p>5.101 ms</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>WhereThenOrderBy</p>\n      </td>\n      <td>\n        <p>.NET 7.0</p>\n      </td>\n      <td>\n        <p>85.58 ms</p>\n      </td>\n      <td>\n        <p>1.697 ms</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h4>Glossary</h4>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Arithmetic_mean\">Mean</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Standard_deviation\">Standard Deviation</a></li>\n</ul>\n<p>The results were generated by running the following snippet with <a href=\"https://github.com/dotnet/BenchmarkDotNet\">BenchmarkDotNet</a>:</p>\n<pre>\nprivate IList&lt;int&gt; data;\nprivate static readonly Random Random = new Random();\n\n[Params(1_000_000)]\npublic int NumberOfEntries;\n\n[GlobalSetup]\npublic void Setup() =&gt;\n    data = Enumerable.Range(0, NumberOfEntries).Select(x =&gt; Random.Next(0, NumberOfEntries)).ToList();\n\n[Benchmark(Baseline = true)]\npublic void OrderByThenWhere() =&gt;\n    _ = data.OrderBy(x =&gt; x).Where(x =&gt; x % 2 == 0 ).ToList();  // OrderBy followed by Where\n\n[Benchmark]\npublic void WhereThenOrderBy() =&gt;\n    _ = data.Where(x =&gt; x % 2 == 0 ).OrderBy(x =&gt; x).ToList();  // Where followed by OrderBy\n</pre>\n<p>Hardware configuration:</p>\n<pre>\nBenchmarkDotNet=v0.13.5, OS=Windows 10 (10.0.19045.2846/22H2/2022Update)\n12th Gen Intel Core i7-12800H, 1 CPU, 20 logical and 14 physical cores\n.NET SDK=7.0.203\n  [Host]               : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2\n  .NET 7.0             : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6607.json",
    "content": "{\n  \"title\": \"The collection should be filtered before sorting by using \\\"Where\\\" before \\\"OrderBy\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-6607\",\n  \"sqKey\": \"S6607\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6608.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Indexes in C# provide direct access to an element at a specific position within an array or collection. When compared to <code>Enumerable</code>\nmethods, indexing can be more efficient for certain scenarios, such as iterating over a large collection, due to avoiding the overhead of checking the\nunderlying collection type before accessing it.</p>\n<p>This applies to types that implement one of these interfaces:</p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.ilist\">IList</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ilist-1\">IList&lt;T&gt;</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ireadonlylist-1\">IReadonlyList&lt;T&gt;</a></li>\n</ul>\n<h3>What is the potential impact?</h3>\n<p>We measured a significant improvement in execution time. For more details see the <code>Benchmarks</code> section from the <code>More info</code>\ntab.</p>\n<h2>How to fix it</h2>\n<p>If the type you are using implements <code>IList</code>, <code>IList&lt;T&gt;</code> or <code>IReadonlyList&lt;T&gt;</code>, it implements\n<code>this[int index]</code>. This means calls to <code>First</code>, <code>Last</code>, or <code>ElementAt(index)</code> can be replaced with\nindexing at <code>0</code>, <code>Count-1</code> and <code>index</code> respectively.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nFunction GetAt(data As List(Of Integer), index As Integer) As Integer\n    Return data.ElementAt(index)\nEnd Function\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nFunction GetFirst(data As List(Of Integer)) As Integer\n    Return data.First()\nEnd Function\n</pre>\n<pre data-diff-id=\"3\" data-diff-type=\"noncompliant\">\nFunction GetLast(data As List(Of Integer)) As Integer\n    Return data.Last()\nEnd Function\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nFunction GetAt(data As List(Of Integer), index As Integer) As Integer\n    Return data(index)\nEnd Function\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nFunction GetFirst(data As List(Of Integer)) As Integer\n    Return data(0)\nEnd Function\n</pre>\n<pre data-diff-id=\"3\" data-diff-type=\"compliant\">\nFunction GetLast(data As List(Of Integer)) As Integer\n    Return data(data.Count-1)\nEnd Function\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.ilist.item\">IList.Item[Int32]</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ilist-1.item\">IList&lt;T&gt;.Item[Int32]</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ireadonlylist-1.item\">IReadonlyList&lt;T&gt;.Item[Int32]</a></li>\n</ul>\n<h3>Benchmarks</h3>\n<table>\n  <colgroup>\n    <col style=\"width: 25%;\">\n    <col style=\"width: 25%;\">\n    <col style=\"width: 25%;\">\n    <col style=\"width: 25%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>Method</th>\n      <th>Runtime</th>\n      <th>Mean</th>\n      <th>Standard Deviation</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p>ElementAt</p>\n      </td>\n      <td>\n        <p>3,403.4 ns</p>\n      </td>\n      <td>\n        <p>28.52 ns</p>\n      </td>\n      <td>\n        <p>26.67 ns</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>Index</p>\n      </td>\n      <td>\n        <p>478.0 ns</p>\n      </td>\n      <td>\n        <p>6.93 ns</p>\n      </td>\n      <td>\n        <p>6.48 ns</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>First</p>\n      </td>\n      <td>\n        <p>6,160.0 ns</p>\n      </td>\n      <td>\n        <p>57.66 ns</p>\n      </td>\n      <td>\n        <p>53.93 ns</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>First_Index</p>\n      </td>\n      <td>\n        <p>485.7 ns</p>\n      </td>\n      <td>\n        <p>5.81 ns</p>\n      </td>\n      <td>\n        <p>5.15 ns</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>Last</p>\n      </td>\n      <td>\n        <p>6,034.3 ns</p>\n      </td>\n      <td>\n        <p>20.34 ns</p>\n      </td>\n      <td>\n        <p>16.98 ns</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>Last_Index</p>\n      </td>\n      <td>\n        <p>408.3 ns</p>\n      </td>\n      <td>\n        <p>2.54 ns</p>\n      </td>\n      <td>\n        <p>2.38 ns</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h4>Glossary</h4>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Arithmetic_mean\">Mean</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Standard_deviation\">Standard Deviation</a></li>\n</ul>\n<p>The results were generated by running the following snippet with <a href=\"https://github.com/dotnet/BenchmarkDotNet\">BenchmarkDotNet</a>:</p>\n<pre>\nprivate List&lt;byte&gt; data;\nprivate Random random;\n\n[Params(1_000_000)]\npublic int SampleSize;\n\n[Params(1_000)]\npublic int LoopSize;\n\n[GlobalSetup]\npublic void Setup()\n{\n    random = new Random(42);\n\n    var bytes = new byte[SampleSize];\n    random.NextBytes(bytes);\n    data = bytes.ToList();\n}\n\n[Benchmark]\npublic int ElementAt()\n{\n    int result = default;\n\n    for (var i = 0; i &lt; LoopSize; i++)\n    {\n        result = data.ElementAt(i);\n    }\n\n    return result;\n}\n\n[Benchmark]\npublic int Index()\n{\n    int result = default;\n\n    for (var i = 0; i &lt; LoopSize; i++)\n    {\n        result = data[i];\n    }\n\n    return result;\n}\n\n[Benchmark]\npublic int First()\n{\n    int result = default;\n\n    for (var i = 0; i &lt; LoopSize; i++)\n    {\n        result = data.First();\n    }\n\n    return result;\n}\n\n[Benchmark]\npublic int First_Index()\n{\n    int result = default;\n\n    for (var i = 0; i &lt; LoopSize; i++)\n    {\n        result = data[0];\n    }\n\n    return result;\n}\n\n[Benchmark]\npublic int Last()\n{\n    int result = default;\n\n    for (var i = 0; i &lt; LoopSize; i++)\n    {\n        result = data.Last();\n    }\n\n    return result;\n}\n\n[Benchmark]\npublic int Last_Index()\n{\n    int result = default;\n\n    for (var i = 0; i &lt; LoopSize; i++)\n    {\n        result = data[data.Count - 1];\n    }\n\n    return result;\n}\n</pre>\n<p>Hardware configuration:</p>\n<pre>\nBenchmarkDotNet=v0.13.5, OS=Windows 10 (10.0.19045.4412/22H2/2022Update)\n11th Gen Intel Core i7-11850H 2.50GHz, 1 CPU, 16 logical and 8 physical cores\n.NET SDK=8.0.301\n  [Host]   : .NET 8.0.6 (8.0.624.26715), X64 RyuJIT AVX2\n  .NET 8.0 : .NET 8.0.6 (8.0.624.26715), X64 RyuJIT AVX2\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6608.json",
    "content": "{\n  \"title\": \"Prefer indexing instead of \\\"Enumerable\\\" methods on types implementing \\\"IList\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-6608\",\n  \"sqKey\": \"S6608\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6609.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Both the <code>Enumerable.Max</code> extension method and the <code>SortedSet&lt;T&gt;.Max</code> property can be used to find the maximum value in\na <code>SortedSet&lt;T&gt;</code>. However, <code>SortedSet&lt;T&gt;.Max</code> is much faster than <code>Enumerable.Max</code>. For small\ncollections, the performance difference may be minor, but for large collections, it can be noticeable. The same applies for the <code>Min</code>\nproperty as well.</p>\n<p><code>Max</code> and <code>Min</code> in <code>SortedSet&lt;T&gt;</code> exploit the fact that the set is implemented via a <code>Red-Black\ntree</code>. The algorithm to find the <code>Max</code>/<code>Min</code> is \"go left/right whenever possible\". The operation has the time complexity\nof <code>O(h)</code> which becomes <code>O(ln(n))</code> due to the fact that the tree is balanced. This is much better than the <code>O(n)</code>\ntime complexity of extension methods.</p>\n<p><code>Max</code> and <code>Min</code> in <code>ImmutableSortedSet&lt;T&gt;</code> exploits a tree augmentation technique, storing the\n<code>Min</code>, <code>Max</code> and <code>Count</code> values on each node of the data structure. The time complexity in this case is\n<code>O(1)</code> that is significantly better than <code>O(n)</code> of extension methods.</p>\n<p><strong>Applies to:</strong></p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.sortedset-1.max\">SortedSet&lt;T&gt;.Max</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.sortedset-1.min\">SortedSet&lt;T&gt;.Min</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable.immutablesortedset-1.max\">ImmutableSortedSet&lt;T&gt;.Max</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable.immutablesortedset-1.min\">ImmutableSortedSet&lt;T&gt;.Min</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable.immutablesortedset-1.builder.max\">ImmutableSortedSet&lt;T&gt;.Builder.Max</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable.immutablesortedset-1.builder.min\">ImmutableSortedSet&lt;T&gt;.Builder.Min</a></li>\n</ul>\n<h3>What is the potential impact?</h3>\n<p>We measured a significant improvement both in execution time and memory allocation. For more details see the <code>Benchmarks</code> section from\nthe <code>More info</code> tab.</p>\n<h2>How to fix it</h2>\n<p>The <code>Min</code> and <code>Max</code> properties are defined on the following classes, and the extension method call can be replaced by calling\nthe propery instead:</p>\n<ul>\n  <li><code>SortedSet&lt;T&gt;</code></li>\n  <li><code>ImmutableSortedSet&lt;T&gt;</code></li>\n  <li><code>ImmutableSortedSet&lt;T&gt;.Builder</code></li>\n</ul>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nFunction GetMax(data As SortedSet(Of Integer)) As Integer\n    Return Enumerable.Max(data)\nEnd Function\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nFunction GetMin(data As SortedSet(Of Integer)) As Integer\n    Return Enumerable.Min(data)\nEnd Function\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nFunction GetMax(data As SortedSet(Of Integer)) As Integer\n    Return data.Max()\nEnd Function\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nFunction GetMin(data As SortedSet(Of Integer)) As Integer\n    Return data.Min()\nEnd Function\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.sortedset-1\">SortedSet&lt;T&gt;</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable.immutablesortedset-1\">ImmutableSortedSet&lt;T&gt;</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable.immutablesortedset-1.builder\">ImmutableSortedSet&lt;T&gt;.Builder</a></li>\n</ul>\n<h3>Benchmarks</h3>\n<table>\n  <colgroup>\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>Method</th>\n      <th>Runtime</th>\n      <th>Mean</th>\n      <th>Standard Deviation</th>\n      <th>Allocated</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p>MaxMethod</p>\n      </td>\n      <td>\n        <p>.NET 7.0</p>\n      </td>\n      <td>\n        <p>68,961.483 us</p>\n      </td>\n      <td>\n        <p>499.6623 us</p>\n      </td>\n      <td>\n        <p>248063 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>MaxProperty</p>\n      </td>\n      <td>\n        <p>.NET 7.0</p>\n      </td>\n      <td>\n        <p>4.638 us</p>\n      </td>\n      <td>\n        <p>0.0634 us</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>MaxMethod</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.6.2</p>\n      </td>\n      <td>\n        <p>85,827.359 us</p>\n      </td>\n      <td>\n        <p>1,531.1611 us</p>\n      </td>\n      <td>\n        <p>281259 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>MaxProperty</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.6.2</p>\n      </td>\n      <td>\n        <p>67.682 us</p>\n      </td>\n      <td>\n        <p>0.3757 us</p>\n      </td>\n      <td>\n        <p>312919 B</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h4>Glossary</h4>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Arithmetic_mean\">Mean</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Standard_deviation\">Standard Deviation</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Memory_management\">Allocated</a></li>\n</ul>\n<p>The results were generated by running the following snippet with <a href=\"https://github.com/dotnet/BenchmarkDotNet\">BenchmarkDotNet</a>:</p>\n<pre>\nprivate SortedSet&lt;string&gt; data;\n\n[Params(1_000)]\npublic int Iterations;\n\n[GlobalSetup]\npublic void Setup() =&gt;\n    data = new SortedSet&lt;string&gt;(Enumerable.Range(0, Iterations).Select(x =&gt; Guid.NewGuid().ToString()));\n\n[Benchmark(Baseline = true)]\npublic void MaxMethod()\n{\n    for (var i = 0; i &lt; Iterations; i++)\n    {\n        _ = data.Max();     // Max() extension method\n    }\n}\n\n[Benchmark]\npublic void MaxProperty()\n{\n    for (var i = 0; i &lt; Iterations; i++)\n    {\n        _ = data.Max;       // Max property\n    }\n}\n</pre>\n<p>Hardware configuration:</p>\n<pre>\nBenchmarkDotNet=v0.13.5, OS=Windows 10 (10.0.19045.2846/22H2/2022Update)\n11th Gen Intel Core i7-11850H 2.50GHz, 1 CPU, 16 logical and 8 physical cores\n  [Host]               : .NET Framework 4.8 (4.8.4614.0), X64 RyuJIT VectorSize=256\n  .NET 7.0             : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2\n  .NET Framework 4.6.2 : .NET Framework 4.8 (4.8.4614.0), X64 RyuJIT VectorSize=256\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6609.json",
    "content": "{\n  \"title\": \"\\\"Min\\/Max\\\" properties of \\\"Set\\\" types should be used instead of the \\\"Enumerable\\\" extension methods\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-6609\",\n  \"sqKey\": \"S6609\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6610.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>With <code>string.StartsWith(char)</code> and <code>string.EndsWith(char)</code>, only the first character of the string is compared to the\nprovided character, whereas the <code>string</code> versions of those methods have to do checks about the current <code>StringComparison</code> and\n<code>CultureInfo</code>. Thus, the <code>char</code> overloads are significantly faster for default comparison scenarios.</p>\n<p>These overloads were introduced in <code>.NET Core 2.0</code>.</p>\n<h3>What is the potential impact?</h3>\n<p>We measured at least 3.5x improvement in execution time. For more details see the <code>Benchmarks</code> section from the <code>More info</code>\ntab.</p>\n<h2>How to fix it</h2>\n<p>If you are targeting a runtime version equal or greater than <code>.NET Core 2.0</code>, the <code>string.StartsWith</code> and\n<code>string.EndsWith</code> overloads are available, with the argument’s type being <code>char</code> instead of <code>string</code>. Thus, an\nargument of <code>char</code> type can be provided.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nFunction StartsWithSlash(s As String) As Boolean\n    Return s.StartsWith(\"/\")\nEnd Function\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nFunction EndsWithSlash(s As String) As Boolean\n    Return s.EndsWith(\"/\")\nEnd Function\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nFunction StartsWithSlash(s As String) As Boolean\n    Return s.StartsWith(\"/\"c)\nEnd Function\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nFunction EndsWithSlash(s As String) As Boolean\n    Return s.EndsWith(\"/\"c)\nEnd Function\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.startswith\">string.StartsWith</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.string.endswith\">string.EndsWith</a></li>\n</ul>\n<h3>Benchmarks</h3>\n<table>\n  <colgroup>\n    <col style=\"width: 33.3333%;\">\n    <col style=\"width: 33.3333%;\">\n    <col style=\"width: 33.3334%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>Method</th>\n      <th>Mean</th>\n      <th>Standard Deviation</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p>StartsWith_String</p>\n      </td>\n      <td>\n        <p>30.965 ms</p>\n      </td>\n      <td>\n        <p>3.2732 ms</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>StartsWith_Char</p>\n      </td>\n      <td>\n        <p>7.568 ms</p>\n      </td>\n      <td>\n        <p>0.3235 ms</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>EndsWith_String</p>\n      </td>\n      <td>\n        <p>30.421 ms</p>\n      </td>\n      <td>\n        <p>5.1136 ms</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>EndsWith_Char</p>\n      </td>\n      <td>\n        <p>8.067 ms</p>\n      </td>\n      <td>\n        <p>0.7092 ms</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h4>Glossary</h4>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Arithmetic_mean\">Mean</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Standard_deviation\">Standard Deviation</a></li>\n</ul>\n<p>The results were generated by running the following snippet with <a href=\"https://github.com/dotnet/BenchmarkDotNet\">BenchmarkDotNet</a>:</p>\n<pre>\nprivate List&lt;string&gt; data;\n\n[Params(1_000_000)]\npublic int N { get; set; }\n\n[GlobalSetup]\npublic void Setup() =&gt;\n    data = Enumerable.Range(0, N).Select(_ =&gt; Guid.NewGuid().ToString()).ToList();\n\n[Benchmark]\npublic void StartsWith_String()\n{\n    _ = data.Where(guid =&gt; guid.StartsWith(\"d\")).ToList();\n}\n\n[Benchmark]\npublic void StartsWith_Char()\n{\n    _ = data.Where(guid =&gt; guid.StartsWith('d')).ToList();\n}\n\n[Benchmark]\npublic void EndsWith_String()\n{\n    _ = data.Where(guid =&gt; guid.EndsWith(\"d\")).ToList();\n}\n\n[Benchmark]\npublic void EndsWith_Char()\n{\n    _ = data.Where(guid =&gt; guid.EndsWith('d')).ToList();\n}\n</pre>\n<p>Hardware configuration:</p>\n<pre>\nBenchmarkDotNet=v0.13.5, OS=Windows 10 (10.0.19045.2846/22H2/2022Update)\n11th Gen Intel Core i7-11850H 2.50GHz, 1 CPU, 16 logical and 8 physical cores\n.NET SDK=7.0.203\n  [Host]   : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2\n  .NET 7.0 : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6610.json",
    "content": "{\n  \"title\": \"\\\"StartsWith\\\" and \\\"EndsWith\\\" overloads that take a \\\"char\\\" should be used instead of the ones that take a \\\"string\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-6610\",\n  \"sqKey\": \"S6610\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6612.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When using the <code>ConcurrentDictionary</code>, there are many overloads of the <code>GetOrAdd</code> and <code>AddOrUpdate</code> methods that\ntake both a <code>TKey</code> argument and a lambda that expects a <code>TKey</code> parameter. This means that the right side of the lambda can be\nwritten using either the lambda’s parameter or the method’s argument. However, using the method’s argument leads to the lambda capturing it, and the\ncompiler will need to generate a class and instantiate it before the call. This means memory allocations, as well as more time spend during Garbage\nCollection.</p>\n<h3>What is the potential impact?</h3>\n<p>We measured a significant improvement both in execution time and memory allocation. For more details see the <code>Benchmarks</code> section from\nthe <code>More info</code> tab.</p>\n<h2>How to fix it</h2>\n<p>When you are using the <code>ConcurrentDictionary</code> methods <code>GetOrAdd</code> or <code>AddOrUpdate</code>, reference the key by using the\nlambda’s parameter instead of the method’s one.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nFunction UpdateValue(dict As ConcurrentDictionary(Of Integer, Integer), key As Integer) As Integer\n    Return dict.GetOrAdd(key, Function(k)\n                                   Return key + 42\n                               End Function)\nEnd Function\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nFunction UpdateValue(dict As ConcurrentDictionary(Of Integer, Integer), key As Integer) As Integer\n    Return dict.GetOrAdd(key, Function(k)\n                                   Return k + 42\n                               End Function)\nEnd Function\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.concurrent.concurrentdictionary-2.getoradd\">ConcurrentDictionary&lt;TKey,TValue&gt;.GetOrAdd</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.concurrent.concurrentdictionary-2.addorupdate\">ConcurrentDictionary&lt;TKey,TValue&gt;.AddOrUpdate</a></li>\n</ul>\n<h3>Benchmarks</h3>\n<table>\n  <colgroup>\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>Method</th>\n      <th>Runtime</th>\n      <th>Mean</th>\n      <th>Standard Deviation</th>\n      <th>Allocated</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p>Capture</p>\n      </td>\n      <td>\n        <p>.NET 7.0</p>\n      </td>\n      <td>\n        <p>68.52 ms</p>\n      </td>\n      <td>\n        <p>4.450 ms</p>\n      </td>\n      <td>\n        <p>88000063 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>Lambda</p>\n      </td>\n      <td>\n        <p>.NET 7.0</p>\n      </td>\n      <td>\n        <p>39.29 ms</p>\n      </td>\n      <td>\n        <p>3.712 ms</p>\n      </td>\n      <td>\n        <p>50 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>Capture</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.6.2</p>\n      </td>\n      <td>\n        <p>74.58 ms</p>\n      </td>\n      <td>\n        <p>5.199 ms</p>\n      </td>\n      <td>\n        <p>88259787 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>Lambda</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.6.2</p>\n      </td>\n      <td>\n        <p>42.03 ms</p>\n      </td>\n      <td>\n        <p>2.752 ms</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h4>Glossary</h4>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Arithmetic_mean\">Mean</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Standard_deviation\">Standard Deviation</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Memory_management\">Allocated</a></li>\n</ul>\n<p>The results were generated by running the following snippet with <a href=\"https://github.com/dotnet/BenchmarkDotNet\">BenchmarkDotNet</a>:</p>\n<pre>\nprivate ConcurrentDictionary&lt;int, string&gt; dict;\nprivate List&lt;int&gt; data;\n\n[Params(1_000_000)]\npublic int N { get; set; }\n\n[GlobalSetup]\npublic void Setup()\n{\n    dict = new ConcurrentDictionary&lt;int, string&gt;();\n    data = Enumerable.Range(0, N).OrderBy(_ =&gt; Guid.NewGuid()).ToList();\n}\n\n[Benchmark(baseline=true)]\npublic void Capture()\n{\n    foreach (var guid in data)\n    {\n        dict.GetOrAdd(guid, _ =&gt; $\"{guid}\"); // \"guid\" is captured\n    }\n}\n\n[Benchmark]\npublic void Lambda()\n{\n    foreach (var guid in data)\n    {\n        dict.GetOrAdd(guid, x =&gt; $\"{x}\"); // no capture\n    }\n}\n</pre>\n<p>Hardware configuration:</p>\n<pre>\nBenchmarkDotNet=v0.13.5, OS=Windows 10 (10.0.19045.2846/22H2/2022Update)\n11th Gen Intel Core i7-11850H 2.50GHz, 1 CPU, 16 logical and 8 physical cores\n.NET SDK=7.0.203\n  [Host]               : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2\n  .NET 7.0             : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2\n  .NET Framework 4.6.2 : .NET Framework 4.8.1 (4.8.9139.0), X64 RyuJIT VectorSize=256\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6612.json",
    "content": "{\n  \"title\": \"The lambda parameter should be used instead of capturing arguments in \\\"ConcurrentDictionary\\\" methods\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-6612\",\n  \"sqKey\": \"S6612\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6613.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Both the <code>Enumerable.First</code> extension method and the <code>LinkedList&lt;T&gt;.First</code> property can be used to find the first value\nin a <code>LinkedList&lt;T&gt;</code>. However, <code>LinkedList&lt;T&gt;.First</code> is much faster than <code>Enumerable.First</code>. For small\ncollections, the performance difference may be minor, but for large collections, it can be noticeable. The same applies for the <code>Last</code>\nproperty as well.</p>\n<p><strong>Applies to:</strong></p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.linkedlist-1.first\">LinkedList&lt;T&gt;.First</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.linkedlist-1.last\">LinkedList&lt;T&gt;.Last</a></li>\n</ul>\n<h3>What is the potential impact?</h3>\n<p>We measured a significant improvement both in execution time and memory allocation. For more details see the <code>Benchmarks</code> section from\nthe <code>More info</code> tab.</p>\n<h2>How to fix it</h2>\n<p>The <code>First</code> and <code>Last</code> properties are defined on the <code>LinkedList</code> class, and the extension method call can be\nreplaced by calling the propery instead.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nFunction GetFirst(data As LinkedList(Of Integer)) As Integer\n    Return Enumerable.First(data)\nEnd Function\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nFunction GetLast(data As LinkedList(Of Integer)) As Integer\n    Return Enumerable.Last(data)\nEnd Function\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nFunction GetFirst(data As LinkedList(Of Integer)) As Integer\n    Return data.First.Value\nEnd Function\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nFunction GetLast(data As LinkedList(Of Integer)) As Integer\n    Return data.Last.Value\nEnd Function\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.linkedlist-1\">LinkedList&lt;T&gt;</a></li>\n</ul>\n<h3>Benchmarks</h3>\n<table>\n  <colgroup>\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>Method</th>\n      <th>Runtime</th>\n      <th>Mean</th>\n      <th>Standard Deviation</th>\n      <th>Allocated</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p>LastMethod</p>\n      </td>\n      <td>\n        <p>.NET 7.0</p>\n      </td>\n      <td>\n        <p>919,577,629.0 ns</p>\n      </td>\n      <td>\n        <p>44,299,688.61 ns</p>\n      </td>\n      <td>\n        <p>48504 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>LastProperty</p>\n      </td>\n      <td>\n        <p>.NET 7.0</p>\n      </td>\n      <td>\n        <p>271.8 ns</p>\n      </td>\n      <td>\n        <p>15.63 ns</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>LastMethod</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.6.2</p>\n      </td>\n      <td>\n        <p>810,316,427.1 ns</p>\n      </td>\n      <td>\n        <p>47,768,482.31 ns</p>\n      </td>\n      <td>\n        <p>57344 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>LastProperty</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.6.2</p>\n      </td>\n      <td>\n        <p>372.0 ns</p>\n      </td>\n      <td>\n        <p>13.38 ns</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h4>Glossary</h4>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Arithmetic_mean\">Mean</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Standard_deviation\">Standard Deviation</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Memory_management\">Allocated</a></li>\n</ul>\n<p>The results were generated by running the following snippet with <a href=\"https://github.com/dotnet/BenchmarkDotNet\">BenchmarkDotNet</a>:</p>\n<pre>\nprivate LinkedList&lt;int&gt; data;\nprivate Random random = new Random();\n\n[Params(100_000)]\npublic int Size { get; set; }\n\n[Params(1_000)]\npublic int Runs { get; set; }\n\n[GlobalSetup]\npublic void Setup() =&gt;\n    data = new LinkedList&lt;int&gt;(Enumerable.Range(0, Size).Select(x =&gt; random.Next()));\n\n[Benchmark(Baseline = true)]\npublic void LastMethod()\n{\n    for (var i = 0; i &lt; Runs; i++)\n    {\n        _ = data.Last();                // Enumerable.Last()\n    }\n}\n\n[Benchmark]\npublic void LastProperty()\n{\n    for (var i = 0; i &lt; Runs; i++)\n    {\n        _ = data.Last;                  // Last property\n    }\n}\n</pre>\n<p>Hardware configuration:</p>\n<pre>\nBenchmarkDotNet=v0.13.5, OS=Windows 10 (10.0.19045.2846/22H2/2022Update)\n11th Gen Intel Core i7-11850H 2.50GHz, 1 CPU, 16 logical and 8 physical cores\n  [Host]               : .NET Framework 4.8 (4.8.4614.0), X64 RyuJIT VectorSize=256\n  .NET 7.0             : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2\n  .NET Framework 4.6.2 : .NET Framework 4.8 (4.8.4614.0), X64 RyuJIT VectorSize=256\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6613.json",
    "content": "{\n  \"title\": \"\\\"First\\\" and \\\"Last\\\" properties of \\\"LinkedList\\\" should be used instead of the \\\"First()\\\" and \\\"Last()\\\" extension methods\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-6613\",\n  \"sqKey\": \"S6613\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6617.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>When testing if a collection contains a specific item by simple equality, both <code>ICollection.Contains(T item)</code> and\n<code>IEnumerable.Any(x ⇒ x == item)</code> can be used. However, <code>Any</code> searches the data structure in a linear manner using a foreach\nloop, whereas <code>Contains</code> is considerably faster in some collection types, because of the underlying implementation. More specifically:</p>\n<ul>\n  <li><code>HashSet&lt;T&gt;</code> is a hashtable, and therefore has an O(1) lookup</li>\n  <li><code>SortedSet&lt;T&gt;</code> is a red-black tree, and therefore has a O(logN) lookup</li>\n  <li><code>List&lt;T&gt;</code> is a linear search, and therefore has an O(N) lookup, but the EqualityComparer is optimized for the <code>T</code>\n  type, which is not the case for <code>Any</code></li>\n</ul>\n<p>For small collections, the performance difference may be negligible, but for large collections, it can be noticeable.</p>\n<h3>What is the potential impact?</h3>\n<p>We measured a significant improvement both in execution time and memory allocation. For more details see the <code>Benchmarks</code> section from\nthe <code>More info</code> tab.</p>\n<h3>Exceptions</h3>\n<p>Since <code><a href=\"https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/ef/language-reference/linq-to-entities\">LINQ to\nEntities</a></code> relies a lot on <code>System.Linq</code> for <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/ef/language-reference/linq-to-entities#query-conversion\">query conversion</a>,\nthis rule won’t raise when used within LINQ to Entities syntaxes.</p>\n<h2>How to fix it</h2>\n<p><code>Contains</code> is a method defined on the <code>ICollection&lt;T&gt;</code> interface and takes a <code>T item</code> argument.\n<code>Any</code> is an extension method defined on the <code>IEnumerable&lt;T&gt;</code> interface and takes a predicate argument. Therefore, calls\nwith simple equality checks like <code>Any(x ⇒ x == item)</code> can be replaced by <code>Contains(item)</code>.</p>\n<p>This applies to the following collection types:</p>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.hashset-1\">HashSet&lt;T&gt;</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.sortedset-1\">SortedSet&lt;T&gt;</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1\">List&lt;T&gt;</a></li>\n</ul>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nFunction ValueExists(data As HashSet(Of Integer)) As Boolean\n    Return data.Any(Function(x) x = 42)\nEnd Function\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\nFunction ValueExists(data As List(Of Integer)) As Boolean\n    Return data.Any(Function(x) x = 42)\nEnd Function\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nFunction ValueExists(data As HashSet(Of Integer)) As Boolean\n    Return data.Contains(42)\nEnd Function\n</pre>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\nFunction ValueExists(data As List(Of Integer)) As Boolean\n    Return data.Contains(42)\nEnd Function\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.hashset-1.contains\">HashSet&lt;T&gt;.Contains(T)</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.sortedset-1.contains\">SortedSet&lt;T&gt;.Contains(T)</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1.contains\">List.Contains(T)</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.any\">Enumerable.Any</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/ef/language-reference/linq-to-entities\">LINQ to Entities</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/standard/collections/\">Collections and Data Structures</a></li>\n</ul>\n<h3>Benchmarks</h3>\n<table>\n  <colgroup>\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n    <col style=\"width: 20%;\">\n  </colgroup>\n  <thead>\n    <tr>\n      <th>Method</th>\n      <th>Runtime</th>\n      <th>Mean</th>\n      <th>Standard Deviation</th>\n      <th>Allocated</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>\n        <p>HashSet_Any</p>\n      </td>\n      <td>\n        <p>.NET 7.0</p>\n      </td>\n      <td>\n        <p>35,388.333 us</p>\n      </td>\n      <td>\n        <p>620.1863 us</p>\n      </td>\n      <td>\n        <p>40132 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>HashSet_Contains</p>\n      </td>\n      <td>\n        <p>.NET 7.0</p>\n      </td>\n      <td>\n        <p>3.799 us</p>\n      </td>\n      <td>\n        <p>0.1489 us</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>List_Any</p>\n      </td>\n      <td>\n        <p>.NET 7.0</p>\n      </td>\n      <td>\n        <p>32,851.509 us</p>\n      </td>\n      <td>\n        <p>667.1658 us</p>\n      </td>\n      <td>\n        <p>40130 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>List_Contains</p>\n      </td>\n      <td>\n        <p>.NET 7.0</p>\n      </td>\n      <td>\n        <p>375.132 us</p>\n      </td>\n      <td>\n        <p>8.0764 us</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>HashSet_Any</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.6.2</p>\n      </td>\n      <td>\n        <p>28,979.763 us</p>\n      </td>\n      <td>\n        <p>678.0093 us</p>\n      </td>\n      <td>\n        <p>40448 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>HashSet_Contains</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.6.2</p>\n      </td>\n      <td>\n        <p>5.987 us</p>\n      </td>\n      <td>\n        <p>0.1090 us</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>List_Any</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.6.2</p>\n      </td>\n      <td>\n        <p>25,830.221 us</p>\n      </td>\n      <td>\n        <p>487.2470 us</p>\n      </td>\n      <td>\n        <p>40448 B</p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <p>List_Contains</p>\n      </td>\n      <td>\n        <p>.NET Framework 4.6.2</p>\n      </td>\n      <td>\n        <p>5,935.812 us</p>\n      </td>\n      <td>\n        <p>57.7569 us</p>\n      </td>\n      <td>\n        <p>-</p>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h4>Glossary</h4>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Arithmetic_mean\">Mean</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Standard_deviation\">Standard Deviation</a></li>\n  <li><a href=\"https://en.wikipedia.org/wiki/Memory_management\">Allocated</a></li>\n</ul>\n<p>The results were generated by running the following snippet with <a href=\"https://github.com/dotnet/BenchmarkDotNet\">BenchmarkDotNet</a>:</p>\n<pre>\n[Params(10_000)]\npublic int SampleSize;\n\n[Params(1_000)]\npublic int Iterations;\n\nprivate static HashSet&lt;int&gt; hashSet;\nprivate static List&lt;int&gt; list;\n\n[GlobalSetup]\npublic void Setup()\n{\n    hashSet = new HashSet&lt;int&gt;(Enumerable.Range(0, SampleSize));\n    list = Enumerable.Range(0, SampleSize).ToList();\n}\n\n[Benchmark]\npublic void HashSet_Any() =&gt;\n    CheckAny(hashSet, SampleSize / 2);\n\n[Benchmark]\npublic void HashSet_Contains() =&gt;\n    CheckContains(hashSet, SampleSize / 2);\n\n[Benchmark]\npublic void List_Any() =&gt;\n    CheckAny(list, SampleSize / 2);\n\n[Benchmark]\npublic void List_Contains() =&gt;\n    CheckContains(list, SampleSize / 2);\n\nvoid CheckAny(IEnumerable&lt;int&gt; values, int target)\n{\n    for (int i = 0; i &lt; Iterations; i++)\n    {\n        _ = values.Any(x =&gt; x == target);  // Enumerable.Any\n    }\n}\n\nvoid CheckContains(ICollection&lt;int&gt; values, int target)\n{\n    for (int i = 0; i &lt; Iterations; i++)\n    {\n        _ = values.Contains(target); // ICollection&lt;T&gt;.Contains\n    }\n}\n</pre>\n<p>Hardware configuration:</p>\n<pre>\nBenchmarkDotNet=v0.13.5, OS=Windows 10 (10.0.19045.2846/22H2/2022Update)\n11th Gen Intel Core i7-11850H 2.50GHz, 1 CPU, 16 logical and 8 physical cores\n.NET SDK=7.0.203\n  [Host]               : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2\n  .NET 7.0             : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2\n  .NET Framework 4.6.2 : .NET Framework 4.8.1 (4.8.9139.0), X64 RyuJIT VectorSize=256\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6617.json",
    "content": "{\n  \"title\": \"\\\"Contains\\\" should be used instead of \\\"Any\\\" for simple equality checks\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"EFFICIENT\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"performance\"\n  ],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-6617\",\n  \"sqKey\": \"S6617\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6930.html",
    "content": "<p>Backslash characters (<code>\\</code>) should be avoided in <a\nhref=\"https://learn.microsoft.com/en-us/aspnet/core/fundamentals/routing#route-templates\">route templates</a>.</p>\n<h2>Why is this an issue?</h2>\n<p><a href=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/routing\">Routing</a> in ASP.NET MVC maps <a\nhref=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/actions#what-is-a-controller\">controllers</a> and <a\nhref=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/actions#defining-actions\">actions</a> to paths in request <a\nhref=\"https://en.wikipedia.org/wiki/Uniform_Resource_Identifier\">URIs</a>.</p>\n<p>In the former syntax specification of URIs, backslash characters (<code>\\</code>) were not allowed at all (see <a\nhref=\"https://datatracker.ietf.org/doc/html/rfc2396/#section-2.4.3\">section \"2.4.3. Excluded US-ASCII Characters\" of RFC 2396</a>). While the current\nspecification (<a href=\"https://datatracker.ietf.org/doc/html/rfc3986\">RFC 3986</a>) doesn’t include anymore the \"Excluded US-ASCII Characters\"\nsection, most URL processors still don’t support backslash properly.</p>\n<p>For instance, a backslash in the <a href=\"https://datatracker.ietf.org/doc/html/rfc3986#section-3.3\">\"path\" part</a> of a <a\nhref=\"https://en.wikipedia.org/wiki/URL#Syntax\">URL</a> is automatically converted to a forward slash (<code>/</code>) both by Chrome and Internet\nExplorer (see <a href=\"https://stackoverflow.com/q/10438008\">here</a>).</p>\n<p>As an example, <code>\\Calculator\\Evaluate?expression=3\\4</code> is converted on the fly into <code>/Calculator/Evaluate?expression=3\\4</code>\nbefore the HTTP request is made to the server.</p>\n<p>While backslashes are allowed in the \"query\" part of a URL, and it’s common to have them as part of a complex query expression, the route of a\ncontroller is always part of the \"path\".</p>\n<p>That is why the use of backslashes in controller templates should be avoided in general.</p>\n<h3>What is the potential impact?</h3>\n<p>A backslash in the route pattern of a controller would only make sense if the developer intended the backslash in the route to be explicitly\nescaped by the user, using <a href=\"https://en.wikipedia.org/wiki/Percent-encoding#Character_data\"><code>%5C</code></a>.</p>\n<p>For example, the route <code>Something\\[controller]</code> for the <code>HomeController</code> would need to be called as\n<code>Something%5CHome</code>.</p>\n<p>The validity of such a scenario is unlikely and the resulting behavior is surprising.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\n&lt;Route(\"Something\\[controller]\")&gt; ' Noncompliant: Replace '\\' with '/'.\nPublic Class HomeController\n    Inherits Controller\n\n    &lt;HttpGet&gt;\n    Public Function Index() As ActionResult\n        Return View()\n    End Function\nEnd Class\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n&lt;Route(\"Something/[controller]\")&gt; ' '\\' replaced with '/'\nPublic Class HomeController\n    Inherits Controller\n\n    &lt;HttpGet&gt;\n    Public Function Index() As ActionResult\n        Return View()\n    End Function\nEnd Class\n</pre>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"noncompliant\">\napp.MapControllerRoute(\n    name:=\"default\",\n    pattern:=\"{controller=Home}\\{action=Index}\") ' Noncompliant: Replace '\\' with '/'.\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"2\" data-diff-type=\"compliant\">\napp.MapControllerRoute(\n    name:=\"default\",\n    pattern:=\"{controller=Home}/{action=Index}\") ' '\\' replaced with '/'\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/fundamentals/routing\">Routing in ASP.NET Core</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/routing\">Routing to controller actions in ASP.NET\n  Core</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/actions\">Handle requests with controllers in ASP.NET\n  Core MVC</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Uniform_Resource_Identifier\">Uniform Resource Identifier</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/URL#Syntax\">URL - Syntax</a></li>\n  <li>Wikipedia - <a href=\"https://en.wikipedia.org/wiki/Percent-encoding\">Percent-encoding</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li>StackOverflow - <a href=\"https://stackoverflow.com/questions/10438008\">Different behaviours of treating \\ (backslash) in the url by FireFox and\n  Chrome</a></li>\n</ul>\n<h3>Standards</h3>\n<ul>\n  <li>IETF.org - <a href=\"https://datatracker.ietf.org/doc/html/rfc3986\">RFC 3986 - Uniform Resource Identifier (URI): Generic Syntax</a></li>\n  <li>IETF.org - <a href=\"https://datatracker.ietf.org/doc/html/rfc2396\">RFC 2396 - Uniform Resource Identifiers (URI): Generic Syntax (OBSOLETE,\n  replaced by RFC 3986)</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6930.json",
    "content": "{\n  \"title\": \"Backslash should be avoided in route templates\",\n  \"type\": \"BUG\",\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"asp.net\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6930\",\n  \"sqKey\": \"S6930\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"targeted\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"LOGICAL\"\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6931.html",
    "content": "<p>Route templates for <a href=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/actions#defining-actions\">ASP.NET controller\nactions</a>, defined via a <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.routeattribute\"><code>RouteAttribute</code></a> or any derivation of <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.routing.httpmethodattribute\"><code>HttpMethodAttribute</code></a>, should\nnot start with \"/\".</p>\n<h2>Why is this an issue?</h2>\n<p><a href=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/routing\">Routing</a> in ASP.NET Core MVC maps <a\nhref=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/actions#what-is-a-controller\">controllers</a> and <a\nhref=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/actions#defining-actions\">actions</a> to paths in request <a\nhref=\"https://en.wikipedia.org/wiki/Uniform_Resource_Identifier\">URIs</a>. Similar <a\nhref=\"https://learn.microsoft.com/en-us/aspnet/mvc/overview/older-versions-1/controllers-and-routing/asp-net-mvc-routing-overview-cs\">routing</a>\nhappens in ASP.NET Framework MVC.</p>\n<p>In ASP.NET Core MVC, when an action defines a route template starting with a \"/\", the route is considered absolute and the action is registered at\nthe root of the web application.</p>\n<p>In such a scenario, any route defined at the controller level is disregarded, as shown in the following example:</p>\n<pre>\n&lt;Route(\"[controller]\")&gt; ' This route is ignored for the routing of Index1 and Index2\nPublic Class HomeController\n    Inherits Controller\n\n    &lt;HttpGet(\"/Index1\")&gt; ' This action is mapped to the root of the web application\n    Public Function Index1() As ActionResult\n        Return View()\n    End Function\n\n    &lt;Route(\"/Index2\")&gt;   ' The same applies here\n    Public Function Index2() As ActionResult\n        Return View()\n    End Function\nEnd Class\n</pre>\n<p>The behavior can be found confusing and surprising because any relative action route is relativized to the controller route.</p>\n<p>Therefore, in the vast majority of scenarios, controllers group all related actions not only in the source code, but also at the routing level.</p>\n<p>In ASP.NET Framework MVC with attribute routing enabled via <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.web.mvc.routecollectionattributeroutingextensions.mapmvcattributeroutes\"><code>MapMvcAttributeRoutes</code></a>,\nthe mere presence of an absolute route at the action level will produce an <code>InvalidOperationException</code> at runtime.</p>\n<p>It is then a good practice to avoid absolute routing at the action level and move the \"/\" to the root level, changing the template defined in the\n<code>RouteAttribute</code> of the controller appropriately.</p>\n<h3>Exceptions</h3>\n<p>The rule only applies when all route templates of all actions of the controller start with \"/\". Sometimes some actions may have both relative and\nabsolute route templates, for example for backward compatibility reasons (i.e. a former route needs to be preserved). In such scenarios, it may make\nsense to keep the absolute route template at the action level.</p>\n<h2>How to fix it</h2>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\n&lt;Route(\"[controller]\")&gt; ' This route is ignored\nPublic Class ReviewsController\n    Inherits Controller\n\n    ' Route is /reviews\n    &lt;HttpGet(\"/reviews\")&gt;\n    Public Function Index() As ActionResult\n        ' ...\n    End Function\n\n    ' Route is /reviews/{reviewId}\n    &lt;Route(\"/reviews/{reviewId}\")&gt;\n    Public Function Show(reviewId As Integer) As ActionResult\n        ' ...\n    End Function\nEnd Class\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\n&lt;Route(\"/\")&gt; ' Turns on attribute routing\nPublic Class ReviewsController\n    Inherits Controller\n\n    ' Route is /reviews\n    &lt;HttpGet(\"reviews\")&gt;\n    Public Function Index() As ActionResult\n        ' ...\n    End Function\n\n    ' Route is /reviews/{reviewId}\n    &lt;Route(\"reviews/{reviewId}\")&gt;\n    Public Function Show(reviewId As Integer) As ActionResult\n        ' ...\n    End Function\nEnd Class\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/routing\">ASP.NET Core: Routing to controller actions in\n  ASP.NET Core</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/routing#attribute-routing-for-rest-apis\">ASP.NET Core:\n  Routing to controller actions in ASP.NET Core - Attribute routing for REST APIs</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/actions\">ASP.NET Core: Handle requests with controllers\n  in ASP.NET Core MVC</a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/aspnet/mvc/overview/older-versions-1/controllers-and-routing/asp-net-mvc-routing-overview-cs\">ASP.NET MVC\n  Routing Overview (C#)</a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li>.NET Blog - <a href=\"https://devblogs.microsoft.com/dotnet/attribute-routing-in-asp-net-mvc-5/\">Attribute Routing in ASP.NET MVC 5</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S6931.json",
    "content": "{\n  \"title\": \"ASP.NET controller actions should not have a route template starting with \\\"\\/\\\"\",\n  \"type\": \"CODE_SMELL\",\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"asp.net\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-6931\",\n  \"sqKey\": \"S6931\",\n  \"scope\": \"Main\",\n  \"quickfix\": \"partial\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S7130.html",
    "content": "<p>When working with collections that are known to be non-empty, using <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.first\">First</a> or <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.single\">Single</a> is generally preferred over <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.firstordefault\">FirstOrDefault</a> or <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.singleordefault\">SingleOrDefault</a>.</p>\n<h2>Why is this an issue?</h2>\n<p>Using <code>FirstOrDefault</code> or <code>SingleOrDefault</code> on collections that are known to be non-empty is an issue due to:</p>\n<ul>\n  <li>Code Clarity and intent: When you use <code>FirstOrDefault</code> or <code>SingleOrDefault</code>, it implies that the collection might be\n  empty, which can be misleading if you know it is not. It can be confusing for other developers who read your code, making it harder for them to\n  understand the actual constraints and behavior of the collection. This leads to confusion and harder-to-maintain code.</li>\n  <li>Error handling: If the developer’s intend is for the collection not to be empty, using <code>FirstOrDefault</code> and\n  <code>SingleOrDefault</code> can lead to subtle bugs. These methods return a default value (<code>null</code> for reference types and\n  <code>default</code> for value types) when the collection is empty, potentially causing issues like <code>NullReferenceException</code> later in the\n  code. In contrast, <code>First</code> or <code>Single</code> will throw an <code>InvalidOperationException</code> immediately if the collection is\n  empty, making it easier to detect and address issues early in the development process.</li>\n  <li>Code coverage: Potentially, having to check if the result is <code>null</code>, you introduces a condition that cannot be fully tested,\n  impacting the code coverage.</li>\n</ul>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nDim Items As New list(Of Integer) From {1, 2, 3}\n\nDim FirstItem As Integer = Items.FirstOrDefault() ' Noncompliant, this implies the collection might be empty, when we know it is not\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nDim Items As New list(Of Integer) From {1, 2, 3}\n\nDim FirstItem As Integer = Items.First() ' Compliant\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.single\"><code>Single</code></a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.first\"><code>First</code></a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.singleordefault\"><code>SingleOrDefault</code></a></li>\n  <li>Microsoft Learn - <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.firstordefault\"><code>FirstOrDefault</code></a></li>\n</ul>\n<h3>Articles &amp; blog posts</h3>\n<ul>\n  <li><a href=\"https://medium.com/@anyanwuraphaelc/first-vs-firstordefault-single-vs-singleordefault-a-high-level-look-d24db17a2bc3\">First vs\n  FirstOrDefault, Single vs SingleOrDefault: A High-level Look</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S7130.json",
    "content": "{\n  \"title\": \"First\\/Single should be used instead of FirstOrDefault\\/SingleOrDefault on collections that are known to be non-empty\",\n  \"type\": \"CODE_SMELL\",\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"1min\"\n  },\n  \"tags\": [\n    \"symbolic-execution\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-7130\",\n  \"sqKey\": \"S7130\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S7131.html",
    "content": "<p>When using <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlock\">ReaderWriterLock</a> and <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlockslim\">ReaderWriterLockSlim</a> for managing read and write locks,\nyou should not release a read lock while holding a write lock and vice versa, otherwise you might have runtime exceptions. The locks should be always\ncorrectly paired so that the shared resource is accessed safely.</p>\n<p>This rule raises if:</p>\n<ul>\n  <li>you call <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlock.acquirewriterlock\">ReaderWriterLock.AcquireWriterLock</a> or <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlock.upgradetowriterlock\">ReaderWriterLock.UpgradeToWriterLock</a>\n  and then use <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlock.releasereaderlock\">ReaderWriterLock.ReleaseReaderLock</a></li>\n  <li>you call <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlockslim.enterwritelock\">ReaderWriterLockSlim.EnterWriteLock</a> or\n  <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlockslim.tryenterwritelock\">ReaderWriterLockSlim.TryEnterWriteLock</a> and then use <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlockslim.exitreadlock\">ReaderWriterLockSlim.ExitReadLock</a></li>\n  <li>you call <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlock.acquirereaderlock\">ReaderWriterLock.AcquireReaderLock</a> or <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlock.downgradefromwriterlock\">ReaderWriterLock.DowngradeFromWriterLock</a> and then use <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlock.releasewriterlock\">ReaderWriterLock.ReleaseWriterLock</a></li>\n  <li>or you call <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlockslim.enterreadlock\">ReaderWriterLockSlim.EnterReadLock</a>, <a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlockslim.tryenterreadlock\">ReaderWriterLockSlim.TryEnterReadLock</a>, <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlockslim.enterupgradeablereadlock\">ReaderWriterLockSlim.EnterUpgradeableReadLock</a> or <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlockslim.tryenterupgradeablereadlock\">ReaderWriterLockSlim.TryEnterUpgradeableReadLock</a> and then use <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlockslim.exitwritelock\">ReaderWriterLockSlim.ExitWriteLock</a></li>\n</ul>\n<h2>Why is this an issue?</h2>\n<p>If you use the <code>ReaderWriterLockSlim</code> class, you will get a <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.lockrecursionexception\">LockRecursionException</a>. In the case of\n<code>ReaderWriterLock</code>, you’ll get a runtime exception for trying to release a lock that is not owned by the calling thread.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nPublic Class Example\n\n    Private Shared rwLock As New ReaderWriterLock()\n\n    Public Sub Writer()\n        rwLock.AcquireWriterLock(2000)\n        Try\n            ' ...\n        Finally\n            rwLock.ReleaseReaderLock() ' Noncompliant, will throw runtime exception\n        End Try\n    End Sub\n\n    Public Sub Reader()\n        rwLock.AcquireReaderLock(2000)\n        Try\n            ' ...\n        Finally\n            rwLock.ReleaseWriterLock() ' Noncompliant, will throw runtime exception\n        End Try\n    End Sub\n\nEnd Class\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nPublic Class Example\n\n    Private Shared rwLock As New ReaderWriterLock()\n\n    Public Shared Sub Writer()\n        rwLock.AcquireWriterLock(2000)\n        Try\n            ' ...\n        Finally\n            rwLock.ReleaseWriterLock()\n        End Try\n    End Sub\n\n    Public Shared Sub Reader()\n        rwLock.AcquireReaderLock(2000)\n        Try\n            ' ...\n        Finally\n            rwLock.ReleaseReaderLock()\n        End Try\n    End Sub\n\nEnd Class\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlock\">ReaderWriterLock Class</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlockslim\">ReaderWriterLockSlim</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S7131.json",
    "content": "{\n  \"title\": \"A write lock should not be released when a read lock has been acquired and vice versa\",\n  \"type\": \"BUG\",\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"30min\"\n  },\n  \"tags\": [\n    \"symbolic-execution\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-7131\",\n  \"sqKey\": \"S7131\",\n  \"scope\": \"All\",\n  \"quickfix\": \"infeasible\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"LOGICAL\"\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S7133.html",
    "content": "<p>This rule raises if you acquire a lock with one of the following methods, and do not release it within the same method.</p>\n<ul>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlock.acquirereaderlock\">ReaderWriterLock.AcquireReaderLock</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlock.acquirewriterlock\">ReaderWriterLock.AcquireWriterLock</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlockslim.enterreadlock\">ReaderWriterLockSlim.EnterReadLock</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlockslim.enterupgradeablereadlock\">ReaderWriterLockSlim.EnterUpgradeableReadLock</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlockslim.tryenterreadlock\">ReaderWriterLockSlim.TryEnterReadLock</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlockslim.tryenterupgradeablereadlock\">ReaderWriterLockSlim.TryEnterUpgradeableReadLock</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlockslim.enterwritelock\">ReaderWriterLockSlim.EnterWriteLock</a></li>\n  <li><a\n  href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlockslim.tryenterwritelock\">ReaderWriterLockSlim.TryEnterWriteLock</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.spinlock.enter\">SpinLock.Enter</a></li>\n  <li><a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.spinlock.tryenter\">SpinLock.TryEnter</a></li>\n</ul>\n<p>This rule will raise an issue when the code uses the <a\nhref=\"https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/implementing-dispose\">disposable pattern</a>. This pattern makes locking\neasy to use and delegates the responsibility to the caller. Users should accept issues in such cases, as they should appear only once for each\nsynchronization type.</p>\n<h2>Why is this an issue?</h2>\n<p>Not releasing a lock in the same method where you acquire it, and releasing in another one, makes the code less clear and harder to maintain. You\nare also introducing the risk of not releasing a lock at all which can lead to deadlocks or exceptions.</p>\n<h3>Code examples</h3>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nPublic Class Example\n\n    Private Shared rwLock As New ReaderWriterLock\n\n    Public Sub AcquireWriterLock()\n        rwLock.AcquireWriterLock(2000)  ' Noncompliant, as the lock release is on the callers responsibility\n    End Sub\n\n    Public Sub DoSomething()\n        ' ...\n    End Sub\n\n    Public Sub ReleaseWriterLock()\n        rwLock.ReleaseWriterLock()\n    End Sub\n\nEnd Class\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nPublic Class Example\n\n    Private Shared rwLock As New ReaderWriterLock\n\n    Public Sub DoSomething()\n        rwLock.AcquireWriterLock(2000)  ' Compliant, locks are released in the same method\n        Try\n            ' ...\n        Finally\n            rwLock.ReleaseWriterLock()\n        End Try\n    End Sub\n\nEnd Class\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlock\">ReaderWriterLock Class</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlockslim\">ReaderWriterLockSlim\n  Classs</a></li>\n  <li>Microsoft Learn - <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.threading.spinlock\">SpinLock Struct</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S7133.json",
    "content": "{\n  \"title\": \"Locks should be released within the same method\",\n  \"type\": \"BUG\",\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"symbolic-execution\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-7133\",\n  \"sqKey\": \"S7133\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\",\n  \"code\": {\n    \"impacts\": {\n      \"RELIABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  }\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S907.html",
    "content": "<h2>Why is this an issue?</h2>\n<p><code>GoTo</code> is an unstructured control flow statement. It makes code less readable and maintainable. Structured control flow statements such\nas <code>If</code>, <code>For</code>, <code>While</code>, or <code>Exit</code> should be used instead.</p>\n<h3>Noncompliant code example</h3>\n<pre>\n    Sub GoToStatementDemo()\n        Dim number As Integer = 1\n        Dim sampleString As String\n        ' Evaluate number and branch to appropriate label.\n        If number = 1 Then GoTo Line1 Else GoTo Line2\nLine1:\n        sampleString = \"Number equals 1\"\n        GoTo LastLine\nLine2:\n        ' The following statement never gets executed because number = 1.\n        sampleString = \"Number equals 2\"\nLastLine:\n        ' Write \"Number equals 1\" in the Debug window.\n        Debug.WriteLine(sampleString)\n    End Sub\n</pre>\n<h3>Compliant solution</h3>\n<pre>\n    Sub GoToStatementDemo()\n        Dim number As Integer = 1\n        Dim sampleString As String\n        ' Evaluate number and branch to appropriate label.\n        If number = 1 Then\n            sampleString = \"Number equals 1\"\n        Else\n            sampleString = \"Number equals 2\"\n        End If\n        Debug.WriteLine(sampleString)\n    End Sub\n</pre>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S907.json",
    "content": "{\n  \"title\": \"\\\"GoTo\\\" statements should not be used\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"MEDIUM\"\n    },\n    \"attribute\": \"CLEAR\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"brain-overload\"\n  ],\n  \"defaultSeverity\": \"Major\",\n  \"ruleSpecification\": \"RSPEC-907\",\n  \"sqKey\": \"S907\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S927.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Parameters are part of the <a href=\"https://en.wikipedia.org/wiki/Type_signature#Method_signature\">method signature</a> and its identity.</p>\n<p>Implementing a method from an interface, a base class, or a partial method and changing one of its parameters' names will confuse and impact the\nmethod’s readability.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"noncompliant\">\nInterface IBankAccount\n    Sub AddMoney(money As Integer)\nEnd Interface\n\nClass BankAccount\n    Implements IBankAccount\n\n    Private Sub AddMoney(amount As Integer) ' Noncompliant: parameter's name differs from base\n        ' ...\n    End Sub\nEnd Class\n</pre>\n<p>To avoid any ambiguity in the code, a parameter’s name should match the initial declaration, whether its initial declaration is from an interface,\na base class, or a partial method.</p>\n<pre data-diff-id=\"1\" data-diff-type=\"compliant\">\nInterface IBankAccount\n    Sub AddMoney(money As Integer)\nEnd Interface\n\nClass BankAccount\n    Implements IBankAccount\n\n    Private Sub AddMoney(money As Integer) ' Compliant: parameter's name match base name\n        ' ...\n    End Sub\nEnd Class\n</pre>\n<h3>Exceptions</h3>\n<p>The rule is ignored if both the parameter defined in the initial decalaration is a generic type and the implementing member’s declaration is a\nnon-generic type.</p>\n<p>This allows the implementing member to be more specific and provide more information.</p>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<ul>\n  <li><a href=\"https://en.wikipedia.org/wiki/Type_signature#Method_signature\">Method signatures - Wiki</a></li>\n</ul>\n\n"
  },
  {
    "path": "analyzers/rspec/vbnet/S927.json",
    "content": "{\n  \"title\": \"Parameter names should match base declaration\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"HIGH\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"10min\"\n  },\n  \"tags\": [\n    \"suspicious\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-927\",\n  \"sqKey\": \"S927\",\n  \"scope\": \"All\",\n  \"quickfix\": \"targeted\"\n}\n"
  },
  {
    "path": "analyzers/rspec/vbnet/Sonar_way_profile.json",
    "content": "{\n  \"name\": \"Sonar way\",\n  \"ruleKeys\": [\n    \"S101\",\n    \"S107\",\n    \"S108\",\n    \"S112\",\n    \"S114\",\n    \"S117\",\n    \"S907\",\n    \"S927\",\n    \"S1048\",\n    \"S1066\",\n    \"S1075\",\n    \"S1110\",\n    \"S1123\",\n    \"S1125\",\n    \"S1133\",\n    \"S1134\",\n    \"S1135\",\n    \"S1155\",\n    \"S1163\",\n    \"S1172\",\n    \"S1186\",\n    \"S1192\",\n    \"S1313\",\n    \"S1479\",\n    \"S1481\",\n    \"S1542\",\n    \"S1643\",\n    \"S1645\",\n    \"S1654\",\n    \"S1656\",\n    \"S1751\",\n    \"S1764\",\n    \"S1862\",\n    \"S1871\",\n    \"S1940\",\n    \"S1944\",\n    \"S2053\",\n    \"S2068\",\n    \"S2077\",\n    \"S2094\",\n    \"S2166\",\n    \"S2178\",\n    \"S2222\",\n    \"S2225\",\n    \"S2234\",\n    \"S2257\",\n    \"S2259\",\n    \"S2304\",\n    \"S2340\",\n    \"S2342\",\n    \"S2344\",\n    \"S2345\",\n    \"S2346\",\n    \"S2347\",\n    \"S2349\",\n    \"S2352\",\n    \"S2355\",\n    \"S2358\",\n    \"S2359\",\n    \"S2365\",\n    \"S2368\",\n    \"S2372\",\n    \"S2375\",\n    \"S2376\",\n    \"S2437\",\n    \"S2551\",\n    \"S2583\",\n    \"S2589\",\n    \"S2612\",\n    \"S2692\",\n    \"S2737\",\n    \"S2757\",\n    \"S2761\",\n    \"S2925\",\n    \"S2951\",\n    \"S3011\",\n    \"S3063\",\n    \"S3329\",\n    \"S3358\",\n    \"S3363\",\n    \"S3385\",\n    \"S3431\",\n    \"S3449\",\n    \"S3453\",\n    \"S3464\",\n    \"S3466\",\n    \"S3598\",\n    \"S3603\",\n    \"S3655\",\n    \"S3776\",\n    \"S3869\",\n    \"S3871\",\n    \"S3878\",\n    \"S3889\",\n    \"S3903\",\n    \"S3904\",\n    \"S3923\",\n    \"S3926\",\n    \"S3927\",\n    \"S3949\",\n    \"S3966\",\n    \"S3981\",\n    \"S3998\",\n    \"S4036\",\n    \"S4136\",\n    \"S4143\",\n    \"S4144\",\n    \"S4158\",\n    \"S4159\",\n    \"S4201\",\n    \"S4210\",\n    \"S4260\",\n    \"S4275\",\n    \"S4277\",\n    \"S4423\",\n    \"S4428\",\n    \"S4507\",\n    \"S4545\",\n    \"S4581\",\n    \"S4583\",\n    \"S4586\",\n    \"S4663\",\n    \"S4790\",\n    \"S4830\",\n    \"S5042\",\n    \"S5443\",\n    \"S5445\",\n    \"S5542\",\n    \"S5547\",\n    \"S5659\",\n    \"S5693\",\n    \"S5753\",\n    \"S5773\",\n    \"S5856\",\n    \"S5944\",\n    \"S6145\",\n    \"S6146\",\n    \"S6418\",\n    \"S6444\",\n    \"S6561\",\n    \"S6562\",\n    \"S6575\",\n    \"S6580\",\n    \"S6588\",\n    \"S6607\",\n    \"S6608\",\n    \"S6609\",\n    \"S6610\",\n    \"S6612\",\n    \"S6613\",\n    \"S6617\",\n    \"S6930\",\n    \"S6931\",\n    \"S7130\",\n    \"S7131\",\n    \"S7133\"\n  ]\n}\n"
  },
  {
    "path": "analyzers/src/AssemblyInfo.Shared.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Runtime.InteropServices;\n\n[assembly: CLSCompliant(false)]\n[assembly: ComVisible(false)]\n"
  },
  {
    "path": "analyzers/src/Directory.Build.targets",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project>\n  <Import Project=\"$(MSBuildThisFileDirectory)\\..\\Common.targets\" />\n\n  <PropertyGroup>\n    <!-- `BinariesFolder` - binary files folder used by ITs, NuGet and java packaging -->\n    <BinariesFolder>$(MSBuildThisFileDirectory)..\\packaging\\binaries\\$(ProjectName)</BinariesFolder>\n  </PropertyGroup>\n\n  <Target Name=\"CleanBinaries\" AfterTargets=\"Clean\" Condition=\"Exists('$(BinariesFolder)')\">\n    <RemoveDir Directories=\"$(BinariesFolder)\" />\n  </Target>\n</Project>\n"
  },
  {
    "path": "analyzers/src/RuleCatalog.targets",
    "content": "<Project>\n  <ItemGroup>\n    <!-- needed for RuleCatalogGenerator -->\n    <AdditionalFiles Include=\"../../rspec/$(RSpecLanguage)/*.json\" Exclude=\"../../rspec/$(RSpecLanguage)/Sonar_way_profile.json\" RspecFile=\"json\" />\n    <AdditionalFiles Include=\"../../rspec/$(RSpecLanguage)/Sonar_way_profile.json\" RspecFile=\"qualityprofile\" />\n    <AdditionalFiles Include=\"../../rspec/$(RSpecLanguage)/*.html\" RspecFile=\"html\" />\n    <CompilerVisibleItemMetadata Include=\"AdditionalFiles\" MetadataName=\"RspecFile\" />\n    <CompilerVisibleProperty Include=\"RootNamespace\" />\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "analyzers/src/RuleDescriptorGenerator/Descriptors/Rule.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace RuleDescriptorGenerator;\n\n[ExcludeFromCodeCoverage]\npublic record Rule(string Id, RuleParameter[] Parameters);\n"
  },
  {
    "path": "analyzers/src/RuleDescriptorGenerator/Descriptors/RuleParameter.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Diagnostics.CodeAnalysis;\nusing System.Reflection;\nusing SonarAnalyzer.Core.Common;\n\nnamespace RuleDescriptorGenerator;\n\n[ExcludeFromCodeCoverage]\npublic class RuleParameter\n{\n    // To speed up the use of reflection in the PropertyValue() method for the 4 properties, we cache the PropertyInfo instances.\n    // It's only used in a single-threaded Console application.\n    // The RuleParameter constructor is called hundreds of times, so it's worth caching the PropertyInfo instances.\n    private static readonly Dictionary<string, PropertyInfo> PropertyInfoCache = [];\n\n    public string Key { get; set; }\n    public string Description { get; set; }\n    public string Type { get; set; }\n    public string DefaultValue { get; set; }\n\n    public RuleParameter() { }\n\n    public RuleParameter(object attribute)\n    {\n        Key = PropertyValue<string>(attribute, nameof(RuleParameterAttribute.Key));\n        Description = PropertyValue<string>(attribute, nameof(RuleParameterAttribute.Description));\n        Type = ToServerApi(PropertyValue<int>(attribute, nameof(RuleParameterAttribute.Type)));\n        DefaultValue = PropertyValue<string>(attribute, nameof(RuleParameterAttribute.DefaultValue));\n    }\n\n    /// <summary>\n    /// sonar-plugin-api / RuleParamTypeTest.java contains other possibilities how to serialize enum values with single-select and multi-select:\n    /// SINGLE_SELECT_LIST,multiple=false,values=\"First,Second,Third\"\n    /// SINGLE_SELECT_LIST,multiple=true,values=\"First,Second,Third\"\n    /// </summary>\n    private static string ToServerApi(int type) =>\n        type switch\n        {\n            (int)PropertyType.String => \"STRING\",\n            (int)PropertyType.Text => \"TEXT\",\n            (int)PropertyType.Boolean => \"BOOLEAN\",\n            (int)PropertyType.Integer => \"INTEGER\",\n            (int)PropertyType.Float => \"FLOAT\",\n            (int)PropertyType.RegularExpression => \"REGULAR_EXPRESSION\",  // This will be translated to STRING by RuleParamType.parse() on the sonar-plugin-api side\n            _ => throw new UnexpectedValueException(nameof(type), type.ToString())\n        };\n\n    // Reflection must be used because of the merged assemblies in the pipeline.\n    // RuleDescriptionGenerator will not recognize the RuleParameterAttribute type because it's no longer in the SonarAnalyzer.Common module, as it was during compilation.\n    private static T PropertyValue<T>(object target, string propertyName)\n    {\n        if (!PropertyInfoCache.TryGetValue(propertyName, out var propertyInfo))\n        {\n            propertyInfo = target.GetType().GetProperty(propertyName);\n            PropertyInfoCache[propertyName] = propertyInfo;\n        }\n        return (T)propertyInfo.GetValue(target, null);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/RuleDescriptorGenerator/Program.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Diagnostics.CodeAnalysis;\nusing System.IO;\nusing System.Reflection;\nusing System.Text.Json;\nusing SonarAnalyzer.Core.Common;\nusing SonarAnalyzer.Core.Rules;\n\nnamespace RuleDescriptorGenerator;\n\n[ExcludeFromCodeCoverage]\npublic static class Program\n{\n    public static void Main(string[] args)\n    {\n        if (args.Length > 1)\n        {\n            var analyzers = args.Skip(1).SelectMany(LoadAnalyzerTypes).ToArray();\n            var rules = LoadRules(analyzers);\n            var json = JsonSerializer.Serialize(rules, new JsonSerializerOptions { WriteIndented = true, PropertyNamingPolicy = JsonNamingPolicy.CamelCase });\n            File.WriteAllText(args[0], json);\n        }\n        else\n        {\n            Console.WriteLine(\"Application expects at least two arguments: <Path-To-Output-Json> <Path-To-Dll> [, <Path-To-Dll> ...] \");\n            Console.WriteLine(\"DiagnosticAnalyzer metadata from <Path-To-Dll> will be serialized to <Path-To-Output-Json>.\");\n        }\n    }\n\n    private static Type[] LoadAnalyzerTypes(string path) =>\n        Assembly.LoadFrom(path)  // We don't need 'Load', we have full control over the environment. It would make local build too complicated.\n            .ExportedTypes\n            .Where(x => !x.IsAbstract\n                && typeof(DiagnosticAnalyzer).IsAssignableFrom(x)\n                && !IsUtilityAnalyzer(x)\n                && !x.Name.Contains('{')) // Due to the merging of assemblies some classes are duplicated with a '{GUID}' suffix, e.g. 'DeadStores{D6DF12A3-12E5-4602-8A69-B80EE29DFD59}'\n            .ToArray();\n\n    private static Rule[] LoadRules(Type[] analyzers) =>\n        analyzers.Select(x => new { Type = x, Parameters = RuleParameters(x) })\n            .SelectMany(x => UniqueIds(x.Type).Select(id => new { Id = id, x.Parameters }))\n            .GroupBy(x => x.Id)     // Same id can be in multiple classes (see InvalidCastToInterface)\n            .Select(x => new Rule(x.Key, x.SelectMany(x => x.Parameters).ToArray()))\n            .ToArray();\n\n    private static RuleParameter[] RuleParameters(Type analyzer) =>\n        analyzer.GetProperties()\n            .Select(x => x.GetCustomAttributes().SingleOrDefault(x => x.GetType().Name == nameof(RuleParameterAttribute)))\n            .Where(x => x is not null)\n            .Select(x => new RuleParameter(x))\n            .ToArray();\n\n    // One class can have the same ruleId multiple times, see S3240\n    private static string[] UniqueIds(Type analyzer) =>\n        ((DiagnosticAnalyzer)Activator.CreateInstance(analyzer)).SupportedDiagnostics.Select(x => x.Id).Distinct().ToArray();\n\n    private static bool IsUtilityAnalyzer(Type analyzerType)\n    {\n        var baseType = analyzerType;\n        while (baseType is not null)\n        {\n            // this needs to be checked by name due to the merging of assemblies in the pipeline\n            // UtilityAnalyzerBase is in the SonarAnalyzer.Core assembly\n            if (baseType.FullName == typeof(UtilityAnalyzerBase).FullName)\n            {\n                return true;\n            }\n            baseType = baseType.BaseType;\n        }\n        return false;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/RuleDescriptorGenerator/RuleDescriptorGenerator.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <OutputType>Exe</OutputType>\n    <TargetFramework>net8</TargetFramework>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\SonarAnalyzer.Core\\SonarAnalyzer.Core.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <!-- Roslyn packages are needed to properly load rule types at runtime -->\n    <PackageReference Include=\"Microsoft.CodeAnalysis.CSharp.Workspaces\" Version=\"1.3.2\" />\n    <PackageReference Include=\"Microsoft.CodeAnalysis.VisualBasic.Workspaces\" Version=\"1.3.2\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Using Include=\"Microsoft.CodeAnalysis\" />\n    <Using Include=\"Microsoft.CodeAnalysis.Diagnostics\" />\n  </ItemGroup>\n\n  <Target Name=\"CopyBinaries\" AfterTargets=\"Build\">\n    <ItemGroup>\n      <BinariesToCopy Include=\"$(OutputPath)\\*.dll\" />\n      <BinariesToCopy Include=\"$(OutputPath)\\*.json\" />\n    </ItemGroup>\n    <Copy SourceFiles=\"@(BinariesToCopy)\" DestinationFolder=\"$(BinariesFolder)\" />\n  </Target>\n\n</Project>\n"
  },
  {
    "path": "analyzers/src/RuleDescriptorGenerator/packages.lock.json",
    "content": "{\n  \"version\": 1,\n  \"dependencies\": {\n    \"net8.0\": {\n      \"Microsoft.CodeAnalysis.CSharp.Workspaces\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.3.2, )\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"MwGmrrPx3okEJuCogSn4TM3yTtJUDdmTt8RXpnjVo0dPund0YSAq4bHQQ9bxgArbrrapcopJmkb7UOLAvanXkg==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp\": \"[1.3.2]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2]\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[3.3.1, )\",\n        \"resolved\": \"3.3.1\",\n        \"contentHash\": \"eT+kgNCDdTRbQ5WF6BGx1HI3D5jYfHteza/koefhWC2vNZGxObA74XxwWfg40dy3uUv7dn3OGKLK5GUPLroVog==\"\n      },\n      \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.3.2, )\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"I5Z2WBgFsx0G22Na1uVFPDkT6Ob4XI+g91GPN8JWldYUMlmIBcUDBfGmfr8oQPdUipvThpaU1x1xZrnNwRR8JA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.VisualBasic\": \"[1.3.2]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2]\"\n        }\n      },\n      \"SonarAnalyzer.CSharp.Styling\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[10.21.0.135717, )\",\n        \"resolved\": \"10.21.0.135717\",\n        \"contentHash\": \"hl264jF539oB7m2jED5QGM345eFSiDAdoJc8TH0HM6L7ZeqT5TDqZDQeZ8IDP02dVIpH/Fhhn+HsGfEcj8ohyQ==\"\n      },\n      \"StyleCop.Analyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.2.0-beta.556, )\",\n        \"resolved\": \"1.2.0-beta.556\",\n        \"contentHash\": \"llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==\",\n        \"dependencies\": {\n          \"StyleCop.Analyzers.Unstable\": \"1.2.0.556\"\n        }\n      },\n      \"Google.Protobuf\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"3.6.1\",\n        \"contentHash\": \"741fGeDQjixBJaU2j+0CbrmZXsNJkTn/hWbOh4fLVXndHsCclJmWznCPWrJmPoZKvajBvAz3e8ECJOUvRtwjNQ==\",\n        \"dependencies\": {\n          \"NETStandard.Library\": \"1.6.1\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.1.0\",\n        \"contentHash\": \"HS3iRWZKcUw/8eZ/08GXKY2Bn7xNzQPzf8gRPHGSowX7u7XXu9i9YEaBeBNKUXWfI7qjvT2zXtLUvbN0hds8vg==\"\n      },\n      \"Microsoft.CodeAnalysis.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"lOinFNbjpCvkeYQHutjKi+CfsjoKu88wAFT6hAumSR/XJSJmmVGvmnbzCWW8kUJnDVrw1RrcqS8BzgPMj263og==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"1.1.0\",\n          \"System.AppContext\": \"4.1.0\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.Collections.Concurrent\": \"4.0.12\",\n          \"System.Collections.Immutable\": \"1.2.0\",\n          \"System.Console\": \"4.0.0\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Diagnostics.FileVersionInfo\": \"4.0.0\",\n          \"System.Diagnostics.StackTrace\": \"4.0.1\",\n          \"System.Diagnostics.Tools\": \"4.0.1\",\n          \"System.Dynamic.Runtime\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Linq.Expressions\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Metadata\": \"1.3.0\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Runtime.Numerics\": \"4.0.1\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.X509Certificates\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Text.Encoding.CodePages\": \"4.0.1\",\n          \"System.Text.Encoding.Extensions\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\",\n          \"System.Threading.Tasks.Parallel\": \"4.0.1\",\n          \"System.Threading.Thread\": \"4.0.0\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\",\n          \"System.Xml.XDocument\": \"4.0.11\",\n          \"System.Xml.XPath.XDocument\": \"4.0.1\",\n          \"System.Xml.XmlDocument\": \"4.0.1\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"GrYMp6ScZDOMR0fNn/Ce6SegNVFw1G/QRT/8FiKv7lAP+V6lEZx9e42n0FvFUgjjcKgcEJOI4muU6i+3LSvOBA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Common\": \"[1.3.2]\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.VisualBasic\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"yllH3rSYEc0bV15CJ2T9Jtx+tSXO5/OVNb+xofuWrACn65Q5VqeFBKgcbgwpyVY/98ypPcGQIWNQL2A/L1seJg==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Common\": \"1.3.2\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Workspaces.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"kvdo+rkImlx5MuBgkayl4OV3Mg8/qirUdYgCIfQ9EqN15QasJFlQXmDAtCGqpkK9sYLLO/VK+y+4mvKjfh/FOA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Common\": \"[1.3.2]\",\n          \"Microsoft.Composition\": \"1.0.27\"\n        }\n      },\n      \"Microsoft.Composition\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.27\",\n        \"contentHash\": \"pwu80Ohe7SBzZ6i69LVdzowp6V+LaVRzd5F7A6QlD42vQkX0oT7KXKWWPlM/S00w1gnMQMRnEdbtOV12z6rXdQ==\"\n      },\n      \"Microsoft.NETCore.Platforms\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.1\",\n        \"contentHash\": \"2G6OjjJzwBfNOO8myRV/nFrbTw5iA+DEm0N+qUqhrOmaVtn4pC77h38I1jsXGw5VH55+dPfQsqHD0We9sCl9FQ==\"\n      },\n      \"Microsoft.NETCore.Targets\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.1\",\n        \"contentHash\": \"rkn+fKobF/cbWfnnfBOQHKVKIOpxMZBvlSHkqDWgBpwGDcLRduvs3D9OLGeV6GWGvVwNlVi2CBbTjuPmtHvyNw==\"\n      },\n      \"runtime.native.System\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"QfS/nQI7k/BLgmLrw7qm7YBoULEvgWnPI+cYsbfCVFTW8Aj+i8JhccxcFMu1RWms0YZzF+UHguNBK4Qn89e2Sg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\"\n        }\n      },\n      \"runtime.native.System.Net.Http\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"Nh0UPZx2Vifh8r+J+H2jxifZUD3sBrmolgiFWJd2yiNrxO0xTa6bAw3YwRn1VOiSen/tUXMS31ttNItCZ6lKuA==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\"\n        }\n      },\n      \"runtime.native.System.Security.Cryptography\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"2CQK0jmO6Eu7ZeMgD+LOFbNJSXHFVQbCJJkEyEwowh1SCgYnrn9W9RykMfpeeVGw7h4IBvYikzpGUlmZTUafJw==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\"\n        }\n      },\n      \"StyleCop.Analyzers.Unstable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.2.0.556\",\n        \"contentHash\": \"zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==\"\n      },\n      \"System.AppContext\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"3QjO4jNV7PdKkmQAVp9atA+usVnKRwI3Kx1nMwJ93T0LcQfx7pKAYk0nKz5wn1oP5iqlhZuy6RXOFdhr7rDwow==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Collections\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"YUJGz6eFKqS0V//mLt25vFGrrCvOnsXjlvFQs+KimpwNxug9x0Pzy4PlFMU3Q2IzqAa9G2L4LsK3+9vCBK7oTg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Collections.Concurrent\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.12\",\n        \"contentHash\": \"2gBcbb3drMLgxlI0fBfxMA31ec6AEyYCHygGse4vxceJan8mRIWeKJ24BFzN7+bi/NFTgdIgufzb94LWO5EERQ==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Diagnostics.Tracing\": \"4.1.0\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Collections.Immutable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.2.0\",\n        \"contentHash\": \"Cma8cBW6di16ZLibL8LYQ+cLjGzoKxpOTu/faZfDcx94ZjAGq6Nv5RO7+T1YZXqEXTZP9rt1wLVEONVpURtUqw==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Console\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"qSKUSOIiYA/a0g5XXdxFcUFmv1hNICBD7QZ0QhGYVipPIhvpiydY8VZqr1thmCXvmn8aipMg64zuanB4eotK9A==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\"\n        }\n      },\n      \"System.Diagnostics.Debug\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"w5U95fVKHY4G8ASs/K5iK3J5LY+/dLFd4vKejsnI/ZhBsWS9hQakfx3Zr7lRWKg4tAw9r4iktyvsTagWkqYCiw==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Diagnostics.FileVersionInfo\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"qjF74OTAU+mRhLaL4YSfiWy3vj6T3AOz8AW37l5zCwfbBfj0k7E94XnEsRaf2TnhE/7QaV6Hvqakoy2LoV8MVg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Reflection.Metadata\": \"1.3.0\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.InteropServices\": \"4.1.0\"\n        }\n      },\n      \"System.Diagnostics.StackTrace\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"6i2EbRq0lgGfiZ+FDf0gVaw9qeEU+7IS2+wbZJmFVpvVzVOgZEt0ScZtyenuBvs6iDYbGiF51bMAa0oDP/tujQ==\",\n        \"dependencies\": {\n          \"System.Collections.Immutable\": \"1.2.0\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Metadata\": \"1.3.0\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\"\n        }\n      },\n      \"System.Diagnostics.Tools\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"xBfJ8pnd4C17dWaC9FM6aShzbJcRNMChUMD42I6772KGGrqaFdumwhn9OdM68erj1ueNo3xdQ1EwiFjK5k8p0g==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Diagnostics.Tracing\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"vDN1PoMZCkkdNjvZLql592oYJZgS7URcJzJ7bxeBgGtx5UtR5leNm49VmfHGqIffX4FKacHbI3H6UyNSHQknBg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Dynamic.Runtime\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"db34f6LHYM0U0JpE+sOmjar27BnqTVkbLJhgfwMpTdgTigG/Hna3m2MYVwnFzGGKnEJk2UXFuoVTr8WUbU91/A==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Linq.Expressions\": \"4.1.0\",\n          \"System.ObjectModel\": \"4.0.12\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Emit\": \"4.0.1\",\n          \"System.Reflection.Emit.ILGeneration\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Reflection.TypeExtensions\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Globalization\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"B95h0YLEL2oSnwF/XjqSWKnwKOy/01VWkNlsCeMTFJLLabflpGV26nK164eRs5GiaRSBGpOxQ3pKoSnnyZN5pg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Globalization.Calendars\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"L1c6IqeQ88vuzC1P81JeHmHA8mxq8a18NUBNXnIY/BVb+TCyAaGIFbhpZt60h9FJNmisymoQkHEFSE9Vslja1Q==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.IO\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"3KlTJceQc3gnGIaHZ7UBZO26SHL1SHE4ddrmiwumFnId+CEHP+O8r386tZKaE6zlk5/mF8vifMBzHj9SaXN+mQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.IO.FileSystem\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"IBErlVq5jOggAD69bg1t0pJcHaDbJbWNUZTPI96fkYWzwYbN6D9wRHMULLDd9dHsl7C2YsxXL31LMfPI1SWt8w==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.IO.FileSystem.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"kWkKD203JJKxJeE74p8aF8y4Qc9r9WQx4C0cHzHPrY3fv/L/IhWnyCHaFJ3H1QPOH6A93whlQ2vG5nHlBDvzWQ==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Linq\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"bQ0iYFOQI0nuTnt+NQADns6ucV4DUvMdwN6CbkB1yj8i7arTGiTN5eok1kQwdnnNWSDZfIUySQY+J3d5KjWn0g==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\"\n        }\n      },\n      \"System.Linq.Expressions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"I+y02iqkgmCAyfbqOmSDOgqdZQ5tTj80Akm5BPSS8EeB0VGWdy6X1KCoYe8Pk6pwDoAKZUOdLVxnTJcExiv5zw==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.ObjectModel\": \"4.0.12\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Emit\": \"4.0.1\",\n          \"System.Reflection.Emit.ILGeneration\": \"4.0.1\",\n          \"System.Reflection.Emit.Lightweight\": \"4.0.1\",\n          \"System.Reflection.Extensions\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Reflection.TypeExtensions\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.ObjectModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.12\",\n        \"contentHash\": \"tAgJM1xt3ytyMoW4qn4wIqgJYm7L7TShRZG4+Q4Qsi2PCcj96pXN7nRywS9KkB3p/xDUjc2HSwP9SROyPYDYKQ==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Reflection\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"JCKANJ0TI7kzoQzuwB/OoJANy1Lg338B6+JVacPl4TpUwi3cReg3nMLplMq2uqYfHFQpKIlHAUVAJlImZz/4ng==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Emit\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"P2wqAj72fFjpP6wb9nSfDqNBMab+2ovzSDzUZK7MVIm54tBJEPr9jWfSjjoTpPwj1LeKcmX3vr0ttyjSSFM47g==\",\n        \"dependencies\": {\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Emit.ILGeneration\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Emit.ILGeneration\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"Ov6dU8Bu15Bc7zuqttgHF12J5lwSWyTf1S+FJouUXVMSqImLZzYaQ+vRr1rQ0OZ0HqsrwWl4dsKHELckQkVpgA==\",\n        \"dependencies\": {\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Emit.Lightweight\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"sSzHHXueZ5Uh0OLpUQprhr+ZYJrLPA2Cmr4gn0wj9+FftNKXx8RIMKvO9qnjk2ebPYUjZ+F2ulGdPOsvj+MEjA==\",\n        \"dependencies\": {\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Emit.ILGeneration\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"GYrtRsZcMuHF3sbmRHfMYpvxZoIN2bQGrYGerUiWLEkqdEUQZhH3TRSaC/oI4wO0II1RKBPlpIa1TOMxIcOOzQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Metadata\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.0\",\n        \"contentHash\": \"jMSCxA4LSyKBGRDm/WtfkO03FkcgRzHxwvQRib1bm2GZ8ifKM1MX1al6breGCEQK280mdl9uQS7JNPXRYk90jw==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Collections.Immutable\": \"1.2.0\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Extensions\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Text.Encoding.Extensions\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Reflection.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"4inTox4wTBaDhB7V3mPvp9XlCbeGYWVEM9/fXALd52vNEAVisc1BoVWQPuUuD0Ga//dNbA/WeMy9u9mzLxGTHQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.TypeExtensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"tsQ/ptQ3H5FYfON8lL4MxRk/8kFyE0A+tGPXmVP967cT/gzLHYxIejIYSxp4JmIeFHVP78g/F2FE1mUUTbDtrg==\",\n        \"dependencies\": {\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Resources.ResourceManager\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"TxwVeUNoTgUOdQ09gfTjvW411MF+w9MBYL7AtNVc+HtBCFlutPLhUCdZjNkjbhj3bNQWMdHboF0KIWEOjJssbA==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Runtime\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"v6c/4Yaa9uWsq+JMhnOFewrYkgdNHNG2eMKuNqRn8P733rNXeRCGvV5FkkjBXn2dbVkPXOsO0xjsEeM1q2zC0g==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\"\n        }\n      },\n      \"System.Runtime.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"CUOHjTT/vgP0qGW22U4/hDlOqXmcPq5YicBaXdUR2UiUoLwBT+olO6we4DVbq57jeX5uXH2uerVZhf0qGj+sVQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Runtime.Handles\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"nCJvEKguXEvk2ymk1gqj625vVnlK3/xdGzx0vOKicQkoquaTBJTP13AIYkocSUwHCLNBwUbXTqTWGDxBTWpt7g==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Runtime.InteropServices\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"16eu3kjHS633yYdkjwShDHZLRNMKVi/s0bY8ODiqJ2RfMhDMAwxZaUaWVnZ2P71kr/or+X9o/xFWtNqz8ivieQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\"\n        }\n      },\n      \"System.Runtime.Numerics\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"+XbKFuzdmLP3d1o9pdHu2nxjNr2OEPqGzKeegPLCUMM71a0t50A/rOcIRmGs9wR7a8KuHX6hYs/7/TymIGLNqg==\",\n        \"dependencies\": {\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\"\n        }\n      },\n      \"System.Security.Cryptography.Algorithms\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.2.0\",\n        \"contentHash\": \"8JQFxbLVdrtIOKMDN38Fn0GWnqYZw/oMlwOUG/qz1jqChvyZlnUmu+0s7wLx7JYua/nAXoESpHA3iw11QFWhXg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Runtime.Numerics\": \"4.0.1\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"runtime.native.System.Security.Cryptography\": \"4.0.0\"\n        }\n      },\n      \"System.Security.Cryptography.Cng\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.2.0\",\n        \"contentHash\": \"cUJ2h+ZvONDe28Szw3st5dOHdjndhJzQ2WObDEXAWRPEQBtVItVoxbXM/OEsTthl3cNn2dk2k0I3y45igCQcLw==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\"\n        }\n      },\n      \"System.Security.Cryptography.Csp\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"/i1Usuo4PgAqgbPNC0NjbO3jPW//BoBlTpcWFD1EHVbidH21y4c1ap5bbEMSGAXjAShhMH4abi/K8fILrnu4BQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Security.Cryptography.Encoding\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"FbKgE5MbxSQMPcSVRgwM6bXN3GtyAh04NkV8E5zKCBE26X0vYW0UtTa2FIgkH33WVqBVxRgxljlVYumWtU+HcQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.Collections.Concurrent\": \"4.0.12\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"runtime.native.System.Security.Cryptography\": \"4.0.0\"\n        }\n      },\n      \"System.Security.Cryptography.OpenSsl\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"HUG/zNUJwEiLkoURDixzkzZdB5yGA5pQhDP93ArOpDPQMteURIGERRNzzoJlmTreLBWr5lkFSjjMSk8ySEpQMw==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Runtime.Numerics\": \"4.0.1\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"runtime.native.System.Security.Cryptography\": \"4.0.0\"\n        }\n      },\n      \"System.Security.Cryptography.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"Wkd7QryWYjkQclX0bngpntW5HSlMzeJU24UaLJQ7YTfI8ydAVAaU2J+HXLLABOVJlKTVvAeL0Aj39VeTe7L+oA==\",\n        \"dependencies\": {\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Security.Cryptography.X509Certificates\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"4HEfsQIKAhA1+ApNn729Gi09zh+lYWwyIuViihoMDWp1vQnEkL2ct7mAbhBlLYm+x/L4Rr/pyGge1lIY635e0w==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Globalization.Calendars\": \"4.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Runtime.Numerics\": \"4.0.1\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Cng\": \"4.2.0\",\n          \"System.Security.Cryptography.Csp\": \"4.0.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.OpenSsl\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\",\n          \"runtime.native.System\": \"4.0.0\",\n          \"runtime.native.System.Net.Http\": \"4.0.1\",\n          \"runtime.native.System.Security.Cryptography\": \"4.0.0\"\n        }\n      },\n      \"System.Text.Encoding\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"U3gGeMlDZXxCEiY4DwVLSacg+DFWCvoiX+JThA/rvw37Sqrku7sEFeVBBBMBnfB6FeZHsyDx85HlKL19x0HtZA==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Text.Encoding.CodePages\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"h4z6rrA/hxWf4655D18IIZ0eaLRa3tQC/j+e26W+VinIHY0l07iEXaAvO0YSYq3MvCjMYy8Zs5AdC1sxNQOB7Q==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Text.Encoding.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"jtbiTDtvfLYgXn8PTfWI+SiBs51rrmO4AAckx4KR6vFK9Wzf6tI8kcRdsYQNwriUeQ1+CtQbM1W4cMbLXnj/OQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\"\n        }\n      },\n      \"System.Text.RegularExpressions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"i88YCXpRTjCnoSQZtdlHkAOx4KNNik4hMy83n0+Ftlb7jvV6ZiZWMpnEZHhjBp6hQVh8gWd/iKNPzlPF7iyA2g==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Threading\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"N+3xqIcg3VDKyjwwCGaZ9HawG9aC6cSDI+s7ROma310GQo8vilFZa86hqKppwTHleR/G0sfOzhvgnUxWCR/DrQ==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Threading.Tasks\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"k1S4Gc6IGwtHGT8188RSeGaX86Qw/wnrgNLshJvsdNUOPP9etMmo8S07c+UlOAx4K/xLuN9ivA1bD0LVurtIxQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Threading.Tasks.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"pH4FZDsZQ/WmgJtN4LWYmRdJAEeVkyriSwrv2Teoe5FOU0Yxlb6II6GL8dBPOfRmutHGATduj3ooMt7dJ2+i+w==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Threading.Tasks.Parallel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"7Pc9t25bcynT9FpMvkUw4ZjYwUiGup/5cJFW72/5MgCG+np2cfVUMdh29u8d7onxX7d8PS3J+wL73zQRqkdrSA==\",\n        \"dependencies\": {\n          \"System.Collections.Concurrent\": \"4.0.12\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Diagnostics.Tracing\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Threading.Thread\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"gIdJqDXlOr5W9zeqFErLw3dsOsiShSCYtF9SEHitACycmvNvY8odf9kiKvp6V7aibc8C4HzzNBkWXjyfn7plbQ==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Xml.ReaderWriter\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"ZIiLPsf67YZ9zgr31vzrFaYQqxRPX9cVHjtPSnmx4eN6lbS/yEyYNr2vs1doGDEscF0tjCZFsk9yUg1sC9e8tg==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Text.Encoding.Extensions\": \"4.0.11\",\n          \"System.Text.RegularExpressions\": \"4.1.0\",\n          \"System.Threading.Tasks\": \"4.0.11\",\n          \"System.Threading.Tasks.Extensions\": \"4.0.0\"\n        }\n      },\n      \"System.Xml.XDocument\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"Mk2mKmPi0nWaoiYeotq1dgeNK1fqWh61+EK+w4Wu8SWuTYLzpUnschb59bJtGywaPq7SmTuPf44wrXRwbIrukg==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Diagnostics.Tools\": \"4.0.1\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\"\n        }\n      },\n      \"System.Xml.XmlDocument\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"2eZu6IP+etFVBBFUFzw2w6J21DqIN5eL9Y8r8JfJWUmV28Z5P0SNU01oCisVHQgHsDhHPnmq2s1hJrJCFZWloQ==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\"\n        }\n      },\n      \"System.Xml.XPath\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"UWd1H+1IJ9Wlq5nognZ/XJdyj8qPE4XufBUkAW59ijsCPjZkZe0MUzKKJFBr+ZWBe5Wq1u1d5f2CYgE93uH7DA==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\"\n        }\n      },\n      \"System.Xml.XPath.XDocument\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"FLhdYJx4331oGovQypQ8JIw2kEmNzCsjVOVYY/16kZTUoquZG85oVn7yUhBE2OZt1yGPSXAL0HTEfzjlbNpM7Q==\",\n        \"dependencies\": {\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\",\n          \"System.Xml.XDocument\": \"4.0.11\",\n          \"System.Xml.XPath\": \"4.0.1\"\n        }\n      },\n      \"sonaranalyzer.cfg\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer.Lightup\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.core\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Google.Protobuf\": \"[3.6.1, )\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.CFG\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer.lightup\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/CfgSerializer/CfgSerializer.RoslynCfgWalker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text;\nusing SonarAnalyzer.CFG.Roslyn;\n\nnamespace SonarAnalyzer.CFG;\n\npublic static partial class CfgSerializer\n{\n    private class RoslynCfgWalker\n    {\n        protected readonly DotWriter writer;\n        private readonly HashSet<BasicBlock> visited = [];\n        private readonly RoslynCfgIdProvider cfgIdProvider;\n        private readonly int cfgId;\n\n        public RoslynCfgWalker(DotWriter writer, RoslynCfgIdProvider cfgIdProvider)\n        {\n            this.writer = writer;\n            this.cfgIdProvider = cfgIdProvider;\n            cfgId = cfgIdProvider.Next();\n        }\n\n        public void Visit(ControlFlowGraph cfg, string title)\n        {\n            writer.WriteGraphStart(title);\n            VisitContent(cfg, title);\n            writer.WriteGraphEnd();\n        }\n\n        protected virtual void WriteEdges(BasicBlock block)\n        {\n            foreach (var predecessor in block.Predecessors)\n            {\n                var condition = string.Empty;\n                if (predecessor.Source.ConditionKind != ControlFlowConditionKind.None)\n                {\n                    condition = predecessor == predecessor.Source.ConditionalSuccessor ? predecessor.Source.ConditionKind.ToString() : \"Else\";\n                }\n                var semantics = predecessor.Semantics == ControlFlowBranchSemantics.Regular ? null : predecessor.Semantics.ToString();\n                writer.WriteEdge(BlockId(predecessor.Source), BlockId(block), $\"{semantics} {condition}\".Trim());\n            }\n            if (block.FallThroughSuccessor is { Destination: null })\n            {\n                writer.WriteEdge(BlockId(block), \"NoDestination_\" + BlockId(block), block.FallThroughSuccessor.Semantics.ToString());\n            }\n        }\n\n        protected string BlockId(BasicBlock block) =>\n            $\"cfg{cfgId}_block{block.Ordinal}\";\n\n        private void VisitSubGraph(ControlFlowGraph cfg, string title)\n        {\n            writer.WriteSubGraphStart(cfgIdProvider.Next(), title);\n            VisitContent(cfg, title);\n            writer.WriteSubGraphEnd();\n        }\n\n        private void VisitContent(ControlFlowGraph cfg, string titlePrefix)\n        {\n            foreach (var region in cfg.Root.NestedRegions)\n            {\n                Visit(cfg, region);\n            }\n            foreach (var block in cfg.Blocks.Where(x => !visited.Contains(x)).ToArray())\n            {\n                Visit(block);\n            }\n            foreach (var localFunction in cfg.LocalFunctions)\n            {\n                var localFunctionCfg = cfg.GetLocalFunctionControlFlowGraph(localFunction, default);\n                new RoslynCfgWalker(writer, cfgIdProvider).VisitSubGraph(localFunctionCfg, $\"{titlePrefix}.{localFunction.Name}\");\n            }\n            foreach (var anonymousFunction in AnonymousFunctions(cfg))\n            {\n                var anonymousFunctionCfg = cfg.GetAnonymousFunctionControlFlowGraph(anonymousFunction, default);\n                new RoslynCfgWalker(writer, cfgIdProvider).VisitSubGraph(anonymousFunctionCfg, $\"{titlePrefix}.anonymous\");\n            }\n        }\n\n        private void Visit(ControlFlowGraph cfg, ControlFlowRegion region)\n        {\n            writer.WriteSubGraphStart(cfgIdProvider.Next(), SerializeRegion(region));\n            foreach (var nested in region.NestedRegions)\n            {\n                Visit(cfg, nested);\n            }\n            foreach (var block in cfg.Blocks.Where(x => x.EnclosingRegion == region))\n            {\n                Visit(block);\n            }\n            writer.WriteSubGraphEnd();\n        }\n\n        private void Visit(BasicBlock block)\n        {\n            visited.Add(block);\n            WriteNode(block);\n            WriteEdges(block);\n        }\n\n        private void WriteNode(BasicBlock block)\n        {\n            var header = block.Kind.ToString().ToUpperInvariant() + \" #\" + block.Ordinal;\n            writer.WriteRecordNode(BlockId(block), header, block.Operations.SelectMany(SerializeOperation).Concat(SerializeBranchValue(block.BranchValue)).ToArray());\n        }\n\n        private static IEnumerable<string> SerializeBranchValue(IOperation operation) =>\n            operation is null ? [] : new[] { \"## BranchValue ##\" }.Concat(SerializeOperation(operation));\n\n        private static IEnumerable<string> SerializeOperation(IOperation operation) =>\n            SerializeOperation(0, null, operation).Concat(new[] { \"##########\" });\n\n        private static IEnumerable<string> SerializeOperation(int level, string prefix, IOperation operation)\n        {\n            var prefixes = operation.GetType().GetProperties()\n                .GroupBy(x => x.GetValue(operation) as IOperation, x => x.Name)\n                .Where(x => x.Key is not null)\n                .ToDictionary(x => x.Key, x => string.Join(\", \", x));\n            var ret = new List<string> { $\"{level}#: {prefix}{operation.Serialize()}\" };\n            foreach (var child in operation.ToSonar().Children)\n            {\n                ret.AddRange(SerializeOperation(level + 1, prefixes.TryGetValue(child, out var childPrefix) ? $\"{level}#.{childPrefix}: \" : null, child));\n            }\n            return ret;\n        }\n\n        private static string SerializeRegion(ControlFlowRegion region)\n        {\n            var sb = new StringBuilder();\n            sb.Append(region.Kind.ToString()).Append(\" region\");\n            if (region.ExceptionType is not null)\n            {\n                sb.Append(\": \").Append(region.ExceptionType);\n            }\n            if (region.Locals.Any())\n            {\n                sb.Append(\", Locals: \").Append(string.Join(\", \", region.Locals.Select(x => x.Name ?? \"N/A\")));\n            }\n            if (region.CaptureIds.Any())\n            {\n                sb.Append(\", Captures: \").Append(string.Join(\", \", region.CaptureIds.Select(x => x.Serialize())));  // Same as IOperationExtension.SerializeSuffix\n            }\n            return sb.ToString();\n        }\n\n        private static IEnumerable<IFlowAnonymousFunctionOperationWrapper> AnonymousFunctions(ControlFlowGraph cfg) =>\n            cfg.Blocks\n                .SelectMany(x => x.Operations)\n                .Concat(cfg.Blocks.Select(x => x.BranchValue).Where(x => x is not null))\n                .SelectMany(x => x.DescendantsAndSelf())\n                .Where(IFlowAnonymousFunctionOperationWrapper.IsInstance)\n                .Select(IFlowAnonymousFunctionOperationWrapper.FromOperation);\n    }\n\n    private sealed class RoslynCfgIdProvider\n    {\n        private int value;\n\n        public int Next() => value++;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/CfgSerializer/CfgSerializer.RoslynLvaWalker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CFG.LiveVariableAnalysis;\nusing SonarAnalyzer.CFG.Roslyn;\n\nnamespace SonarAnalyzer.CFG;\n\npublic static partial class CfgSerializer\n{\n    private sealed class RoslynLvaWalker : RoslynCfgWalker\n    {\n        private readonly RoslynLiveVariableAnalysis lva;\n\n        public RoslynLvaWalker(RoslynLiveVariableAnalysis lva, DotWriter writer, RoslynCfgIdProvider cfgIdProvider) : base(writer, cfgIdProvider)\n        {\n            this.lva = lva;\n        }\n\n        protected override void WriteEdges(BasicBlock block)\n        {\n            foreach (var predecessor in lva.BlockPredecessors[block.Ordinal].Where(x => !block.Predecessors.Any(y => y.Source == x)))\n            {\n                writer.WriteEdge(BlockId(predecessor), BlockId(block), \"LVA\\\" fontcolor=\\\"blue\\\" penwidth=\\\"2\\\" color=\\\"blue\");\n            }\n            base.WriteEdges(block);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/CfgSerializer/CfgSerializer.SonarCfgWalker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing SonarAnalyzer.CFG.Sonar;\n\nnamespace SonarAnalyzer.CFG;\n\npublic static partial class CfgSerializer\n{\n    private sealed class SonarCfgWalker\n    {\n        private readonly BlockIdProvider blockId = new();\n        private readonly DotWriter writer;\n\n        public SonarCfgWalker(DotWriter writer) =>\n            this.writer = writer;\n\n        public void Visit(IControlFlowGraph cfg, string title)\n        {\n            writer.WriteGraphStart(title);\n            foreach (var block in cfg.Blocks)\n            {\n                Visit(block);\n            }\n            writer.WriteGraphEnd();\n        }\n\n        private void Visit(Block block)\n        {\n            if (block is BinaryBranchBlock binaryBranchBlock)\n            {\n                WriteNode(block, binaryBranchBlock.BranchingNode);\n            }\n            else if (block is BranchBlock branchBlock)\n            {\n                WriteNode(block, branchBlock.BranchingNode);\n            }\n            else if (block is ExitBlock)\n            {\n                WriteNode(block);\n            }\n            else if (block is ForeachCollectionProducerBlock foreachBlock)\n            {\n                WriteNode(foreachBlock, foreachBlock.ForeachNode);\n            }\n            else if (block is ForInitializerBlock forBlock)\n            {\n                WriteNode(forBlock, forBlock.ForNode);\n            }\n            else if (block is JumpBlock jumpBlock)\n            {\n                WriteNode(jumpBlock, jumpBlock.JumpNode);\n            }\n            else if (block is LockBlock lockBlock)\n            {\n                WriteNode(lockBlock, lockBlock.LockNode);\n            }\n            else if (block is UsingEndBlock usingBlock)\n            {\n                WriteNode(usingBlock, usingBlock.UsingStatement);\n            }\n            else\n            {\n                WriteNode(block);\n            }\n            WriteEdges(block);\n        }\n\n        private void WriteNode(Block block, SyntaxNode terminator = null)\n        {\n            var header = block.GetType().Name.SplitCamelCaseToWords().First().ToUpperInvariant();\n            if (terminator is not null)\n            {\n                header += \":\" + terminator.Kind().ToString().Replace(\"Syntax\", string.Empty);\n            }\n            writer.WriteRecordNode(blockId.Get(block), header, block.Instructions.Select(x => x.ToString()).ToArray());\n        }\n\n        private void WriteEdges(Block block)\n        {\n            foreach (var successor in block.SuccessorBlocks)\n            {\n                writer.WriteEdge(blockId.Get(block), blockId.Get(successor), Label());\n\n                string Label()\n                {\n                    if (block is BinaryBranchBlock binary)\n                    {\n                        if (successor == binary.TrueSuccessorBlock)\n                        {\n                            return bool.TrueString;\n                        }\n                        else if (successor == binary.FalseSuccessorBlock)\n                        {\n                            return bool.FalseString;\n                        }\n                    }\n                    return string.Empty;\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/CfgSerializer/CfgSerializer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CFG.LiveVariableAnalysis;\nusing SonarAnalyzer.CFG.Roslyn;\nusing SonarAnalyzer.CFG.Sonar;\n\nnamespace SonarAnalyzer.CFG;\n\npublic static partial class CfgSerializer\n{\n    public static string Serialize(IControlFlowGraph cfg, string title = \"SonarCfg\")\n    {\n        var writer = new DotWriter();\n        new SonarCfgWalker(writer).Visit(cfg, title);\n        return writer.ToString();\n    }\n\n    public static string Serialize(ControlFlowGraph cfg, string title = \"RoslynCfg\")\n    {\n        var writer = new DotWriter();\n        new RoslynCfgWalker(writer, new RoslynCfgIdProvider()).Visit(cfg, title);\n        return writer.ToString();\n    }\n\n    public static string Serialize(RoslynLiveVariableAnalysis lva, string title = \"RoslynCfgLva\")\n    {\n        var writer = new DotWriter();\n        new RoslynLvaWalker(lva, writer, new RoslynCfgIdProvider()).Visit(lva.Cfg, title);\n        return writer.ToString();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/CfgSerializer/DotWriter.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text;\n\nnamespace SonarAnalyzer.CFG;\n\npublic class DotWriter\n{\n    private readonly StringBuilder builder = new StringBuilder();\n    private readonly StringBuilder edges = new StringBuilder();\n    private bool started;\n\n    public void WriteGraphStart(string graphName)\n    {\n        if (started)\n        {\n            throw new InvalidOperationException(\"Graph was already started\");\n        }\n        started = true;\n        builder.AppendLine($\"digraph \\\"{Encode(graphName)}\\\" {{\");\n    }\n\n    public void WriteGraphEnd()\n    {\n        if (!started)\n        {\n            throw new InvalidOperationException(\"Graph was not started\");\n        }\n        started = false;\n        builder.Append(edges).AppendLine(\"}\");  // Edges crossing subgraphs must be listed at the end of the main graph to keep nodes rendered in the correct subgraph\n        edges.Clear();\n    }\n\n    public void WriteSubGraphStart(int id, string title) =>\n        builder.AppendLine($\"subgraph \\\"cluster_{id}\\\" {{\\nlabel = \\\"{Encode(title)}\\\"\");\n\n    public void WriteSubGraphEnd() =>\n        builder.AppendLine(\"}\");\n\n    public void WriteRecordNode(string id, string header, params string[] items)\n    {\n        // Curly braces in the label reverse the orientation of the columns/rows\n        // Columns/rows are created with pipe\n        // New lines are inserted with \\n; \\r\\n does not work well.\n        // ID [shape=record label=\"{<header>|<line1>\\n<line2>\\n...}\"]\n        builder.Append(id).Append(\" [shape=record label=\\\"{\").Append(header);\n        foreach (var item in items)\n        {\n            builder.Append(\"|\").Append(Encode(item));\n        }\n        builder.AppendLine(\"}\\\"]\");\n    }\n\n    public void WriteNode(string id, string[] attributes)\n    {\n        builder.Append(id);\n        if (attributes.Length > 0)\n        {\n            builder.Append(\" [\").Append(string.Join(\" \", attributes)).Append(\"]\");\n        }\n        builder.AppendLine();\n    }\n\n    public void WriteEdge(string startId, string endId, string label)\n    {\n        edges.Append(startId).Append(\" -> \").Append(endId);\n        if (!string.IsNullOrEmpty(label))\n        {\n            edges.Append($\" [label=\\\"{label}\\\"]\");\n        }\n        edges.AppendLine();\n    }\n\n    public override string ToString() =>\n        builder.ToString();\n\n    private static string Encode(string s) =>\n        s.Replace(\"\\r\", string.Empty)\n            .Replace(\"\\n\", @\"\\n\")\n            .Replace(\"{\", @\"\\{\")\n            .Replace(\"}\", @\"\\}\")\n            .Replace(\"|\", @\"\\|\")\n            .Replace(\"<\", @\"\\<\")\n            .Replace(\">\", @\"\\>\")\n            .Replace(\"\\\"\", @\"\\\"\"\");\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Common/RoslynVersion.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CFG.Common;\n\npublic static class RoslynVersion\n{\n    public const int VS2017MajorVersion = 2;\n    public const int MinimalSupportedMajorVersion = 3;\n\n    public static bool IsRoslynCfgSupported(int minimalVersion = MinimalSupportedMajorVersion) =>\n        !IsVersionLessThan(minimalVersion);\n\n    public static bool IsVersionLessThan(int minimalVersion = MinimalSupportedMajorVersion) =>\n        CurrentVersion().Major < minimalVersion;\n\n    public static bool IsVersionLessThan(Version version) =>\n        CurrentVersion() < version;\n\n    private static Version CurrentVersion() =>\n        typeof(SemanticModel).Assembly.GetName().Version;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Common/UniqueQueue.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Collections;\n\nnamespace SonarAnalyzer.CFG.Common;\n\ninternal class UniqueQueue<T> : IEnumerable<T>\n{\n    private readonly Queue<T> queue = new Queue<T>();\n    private readonly ISet<T> unique = new HashSet<T>();\n\n    public void Enqueue(T item)\n    {\n        if (!unique.Contains(item))\n        {\n            queue.Enqueue(item);\n            unique.Add(item);\n        }\n    }\n\n    public T Dequeue()\n    {\n        var ret = queue.Dequeue();\n        unique.Remove(ret);\n        return ret;\n    }\n\n    public IEnumerator<T> GetEnumerator() =>\n        queue.GetEnumerator();\n\n    IEnumerator IEnumerable.GetEnumerator() =>\n        GetEnumerator();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Extensions/BasicBlockExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CFG.Roslyn;\n\nnamespace SonarAnalyzer.CFG.Extensions;\n\npublic static class BasicBlockExtensions\n{\n    public static bool IsEnclosedIn(this BasicBlock block, ControlFlowRegionKind kind)\n    {\n        var enclosing = kind == ControlFlowRegionKind.LocalLifetime ? block.EnclosingRegion : block.EnclosingNonLocalLifetimeRegion();\n        return enclosing.Kind == kind;\n    }\n\n    public static ControlFlowRegion EnclosingNonLocalLifetimeRegion(this BasicBlock block) =>\n        block.EnclosingRegion.EnclosingNonLocalLifetimeRegion();\n\n    public static ControlFlowRegion EnclosingRegion(this BasicBlock block, ControlFlowRegionKind kind) =>\n        block.EnclosingRegion.EnclosingRegionOrSelf(kind);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Extensions/ControlFlowGraphExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CFG.Roslyn;\n\nnamespace SonarAnalyzer.CFG.Extensions;\n\npublic static class ControlFlowGraphExtensions\n{\n    public static IEnumerable<IFlowAnonymousFunctionOperationWrapper> FlowAnonymousFunctionOperations(this ControlFlowGraph cfg) =>\n        cfg.Blocks\n           .SelectMany(x => x.OperationsAndBranchValue)\n           .SelectMany(x => x.DescendantsAndSelf())\n           .Where(IFlowAnonymousFunctionOperationWrapper.IsInstance)\n           .Select(IFlowAnonymousFunctionOperationWrapper.FromOperation);\n\n    // Similar to ControlFlowGraphExtensions.GetLocalFunctionControlFlowGraphInScope from Roslyn\n    public static ControlFlowGraph FindLocalFunctionCfgInScope(this ControlFlowGraph cfg, IMethodSymbol localFunction, CancellationToken cancel)\n    {\n        var current = cfg;\n        while (current is not null)\n        {\n            if (current.LocalFunctions.Contains(localFunction))\n            {\n                return current.GetLocalFunctionControlFlowGraph(localFunction, cancel);\n            }\n            current = current.Parent;\n        }\n        throw new ArgumentOutOfRangeException(nameof(localFunction));\n    }\n\n    public static ControlFlowGraph GetLocalFunctionControlFlowGraph(this ControlFlowGraph cfg, SyntaxNode localFunction, CancellationToken cancel) =>\n        cfg.GetLocalFunctionControlFlowGraph(cfg.LocalFunctions.Single(x => x.DeclaringSyntaxReferences.Single().GetSyntax() == localFunction), cancel);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Extensions/ControlFlowRegionExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CFG.Roslyn;\n\nnamespace SonarAnalyzer.CFG.Extensions;\n\npublic static class ControlFlowRegionExtensions\n{\n    public static IEnumerable<BasicBlock> Blocks(this ControlFlowRegion region, ControlFlowGraph cfg) =>\n        cfg.Blocks.Where((_, i) => region.FirstBlockOrdinal <= i && i <= region.LastBlockOrdinal);\n\n    public static ControlFlowRegion EnclosingNonLocalLifetimeRegion(this ControlFlowRegion region)\n    {\n        while (region.EnclosingRegion is not null && region.Kind == ControlFlowRegionKind.LocalLifetime)\n        {\n            region = region.EnclosingRegion;\n        }\n        return region;\n    }\n\n    public static ControlFlowRegion EnclosingRegionOrSelf(this ControlFlowRegion region, ControlFlowRegionKind kind)\n    {\n        while (region is not null && region.Kind != kind)\n        {\n            if (region.Kind == ControlFlowRegionKind.Root)\n            {\n                return null;    // Do not traverse from inner lambda CFG to the outer method CFG\n            }\n            region = region.EnclosingRegion;\n        }\n        return region;\n    }\n\n    public static ControlFlowRegion EnclosingRegion(this ControlFlowRegion region, ControlFlowRegionKind kind) =>\n        region.EnclosingRegion.EnclosingRegionOrSelf(kind);\n\n    public static ControlFlowRegion NestedRegion(this ControlFlowRegion region, ControlFlowRegionKind kind) =>\n        region.NestedRegions.Single(x => x.Kind == kind);\n\n    /// <summary>\n    /// Returns all Catch, FilterAndHandler, and Finally regions that are reachable from the given try region.\n    /// </summary>\n    public static IEnumerable<ControlFlowRegion> ReachableHandlers(this ControlFlowRegion tryRegion) =>\n        tryRegion is null\n            ? []\n            : tryRegion.EnclosingRegion.NestedRegions.Where(x => x.Kind != ControlFlowRegionKind.Try)\n                .Concat(ReachableHandlers(tryRegion.EnclosingRegion(ControlFlowRegionKind.Try)));   // Use also all outer candidates for nested try/catch.\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Extensions/DictionaryExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CFG.Extensions;\n\ninternal static class DictionaryExtensions\n{\n    public static TValue GetOrAdd<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key, Func<TKey, TValue> factory)\n    {\n        if (!dictionary.TryGetValue(key, out var value))\n        {\n            value = factory(key);\n            dictionary.Add(key, value);\n        }\n        return value;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Extensions/ExpressionSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\n\nnamespace SonarAnalyzer.CFG.Extensions;\n\ninternal static class ExpressionSyntaxExtensions\n{\n    public static ExpressionSyntax RemoveParentheses(this ExpressionSyntax expression) =>\n        (ExpressionSyntax)SyntaxNodeExtensions.RemoveParentheses(expression);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Extensions/IEnumerableExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CFG.Extensions;\n\ninternal static class IEnumerableExtensions\n{\n    public static HashSet<T> ToHashSet<T>(this IEnumerable<T> enumerable, IEqualityComparer<T> equalityComparer = null)\n    {\n        enumerable ??= [];\n        return equalityComparer is null\n            ? new(enumerable)\n            : new(enumerable, equalityComparer);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Extensions/IOperationExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CFG.Operations.Utilities;\n\nnamespace SonarAnalyzer.CFG.Extensions;\n\npublic static class IOperationExtensions\n{\n    [Obsolete(\"Use extension methods for IOperation properties instead.\")] // should be made private and ObsoleteAttribute removed when there is no usage outside of this file left\n    public static IOperationWrapperSonar ToSonar(this IOperation operation) =>\n        new(operation);\n\n    [Obsolete(\"Use extension methods for IOperation properties instead.\")] // should be made private and ObsoleteAttribute removed when there is no usage outside of this file left\n    public static IOperationWrapperSonar ToSonar(this IOperationWrapper operation) =>\n        new(operation.WrappedOperation);\n\n    public static IOperation Parent(this IOperation operation) =>\n        operation.ToSonar().Parent;\n\n    public static IOperation Parent(this IOperationWrapper operation) =>\n        operation.WrappedOperation.Parent();\n\n    public static IEnumerable<IOperation> Children(this IOperation operation) =>\n        operation.ToSonar().Children;\n\n    public static IEnumerable<IOperation> Children(this IOperationWrapper operation) =>\n        operation.WrappedOperation.Children();\n\n    public static string Language(this IOperation operation) =>\n        operation.ToSonar().Language;\n\n    public static string Language(this IOperationWrapper operation) =>\n        operation.WrappedOperation.Language();\n\n    public static bool IsImplicit(this IOperation operation) =>\n        operation.ToSonar().IsImplicit;\n\n    public static bool IsImplicit(this IOperationWrapper operation) =>\n        operation.WrappedOperation.IsImplicit();\n\n    public static SemanticModel SemanticModel(this IOperation operation) =>\n        operation.ToSonar().SemanticModel;\n\n    public static SemanticModel SemanticModel(this IOperationWrapper operation) =>\n        operation.WrappedOperation.SemanticModel();\n\n    public static bool IsOutArgumentReference(this IOperation operation) =>\n        operation.ToSonar() is var wrapped\n        && IArgumentOperationWrapper.IsInstance(wrapped.Parent)\n        && IArgumentOperationWrapper.FromOperation(wrapped.Parent).Parameter.RefKind == RefKind.Out;\n\n    public static bool IsAssignmentTarget(this IOperationWrapper operation) =>\n        operation.ToSonar().Parent is { } parent\n        && ISimpleAssignmentOperationWrapper.IsInstance(parent)\n        && ISimpleAssignmentOperationWrapper.FromOperation(parent).Target == operation.WrappedOperation;\n\n    public static bool IsCompoundAssignmentTarget(this IOperationWrapper operation) =>\n        operation.ToSonar().Parent is { } parent\n        && ICompoundAssignmentOperationWrapper.IsInstance(parent)\n        && ICompoundAssignmentOperationWrapper.FromOperation(parent).Target == operation.WrappedOperation;\n\n    public static bool IsOutArgument(this IOperationWrapper operation) =>\n        operation.ToSonar().Parent is { } parent\n        && IArgumentOperationWrapper.IsInstance(parent)\n        && IArgumentOperationWrapper.FromOperation(parent).Parameter.RefKind == RefKind.Out;\n\n    public static bool IsAnyKind(this IOperation operation, params OperationKind[] kinds) =>\n        kinds.Contains(operation.Kind);\n\n    public static IOperation RootOperation(this IOperation operation)\n    {\n        var wrapper = operation.ToSonar();\n        while (wrapper.Parent is not null)\n        {\n            wrapper = wrapper.Parent.ToSonar();\n        }\n        return wrapper.Instance;\n    }\n\n    /// <inheritdoc cref=\"ArgumentValue(ImmutableArray{IOperation}, string)\"/>\n    public static IOperation ArgumentValue(this IInvocationOperationWrapper invocation, string parameterName) =>\n        ArgumentValue(invocation.Arguments, parameterName);\n\n    /// <inheritdoc cref=\"ArgumentValue(ImmutableArray{IOperation}, string)\"/>\n    public static IOperation ArgumentValue(this IObjectCreationOperationWrapper objectCreation, string parameterName) =>\n        ArgumentValue(objectCreation.Arguments, parameterName);\n\n    /// <inheritdoc cref=\"ArgumentValue(ImmutableArray{IOperation}, string)\"/>\n    public static IOperation ArgumentValue(this IPropertyReferenceOperationWrapper propertyReference, string parameterName) =>\n        ArgumentValue(propertyReference.Arguments, parameterName);\n\n    /// <inheritdoc cref=\"ArgumentValue(ImmutableArray{IOperation}, string)\"/>\n    public static IOperation ArgumentValue(this IRaiseEventOperationWrapper raiseEvent, string parameterName) =>\n        ArgumentValue(raiseEvent.Arguments, parameterName);\n\n    public static OperationExecutionOrder ToExecutionOrder(this IEnumerable<IOperation> operations) =>\n        new(operations, false);\n\n    public static OperationExecutionOrder ToReversedExecutionOrder(this IEnumerable<IOperation> operations) =>\n        new(operations, true);\n\n    public static string Serialize(this IOperation operation) =>\n        $\"{OperationPrefix(operation)}{OperationSuffix(operation)}: {operation.Syntax}\";\n\n    // This method is taken from Roslyn implementation\n    public static IEnumerable<IOperation> DescendantsAndSelf(this IOperation operation) =>\n        Descendants(operation, true);\n\n    public static IAnonymousFunctionOperationWrapper? AsAnonymousFunction(this IOperation operation) =>\n        operation.As(OperationKindEx.AnonymousFunction, IAnonymousFunctionOperationWrapper.FromOperation);\n\n    public static IArgumentOperationWrapper? AsArgument(this IOperation operation) =>\n        operation.As(OperationKindEx.Argument, IArgumentOperationWrapper.FromOperation);\n\n    public static IAssignmentOperationWrapper? AsAssignment(this IOperation operation) =>\n        operation.As(OperationKindEx.SimpleAssignment, IAssignmentOperationWrapper.FromOperation);\n\n    public static ISimpleAssignmentOperationWrapper? AsSimpleAssignment(this IOperation operation) =>\n        operation.As(OperationKindEx.SimpleAssignment, ISimpleAssignmentOperationWrapper.FromOperation);\n\n    public static IArrayCreationOperationWrapper? AsArrayCreation(this IOperation operation) =>\n        operation.As(OperationKindEx.ArrayCreation, IArrayCreationOperationWrapper.FromOperation);\n\n    public static IArrayElementReferenceOperationWrapper? AsArrayElementReference(this IOperation operation) =>\n        operation.As(OperationKindEx.ArrayElementReference, IArrayElementReferenceOperationWrapper.FromOperation);\n\n    public static IConversionOperationWrapper? AsConversion(this IOperation operation) =>\n        operation.As(OperationKindEx.Conversion, IConversionOperationWrapper.FromOperation);\n\n    public static IDeclarationExpressionOperationWrapper? AsDeclarationExpression(this IOperation operation) =>\n        operation.As(OperationKindEx.DeclarationExpression, IDeclarationExpressionOperationWrapper.FromOperation);\n\n    public static IDeclarationPatternOperationWrapper? AsDeclarationPattern(this IOperation operation) =>\n        operation.As(OperationKindEx.DeclarationPattern, IDeclarationPatternOperationWrapper.FromOperation);\n\n    public static IFlowAnonymousFunctionOperationWrapper? AsFlowAnonymousFunction(this IOperation operation) =>\n        operation.As(OperationKindEx.FlowAnonymousFunction, IFlowAnonymousFunctionOperationWrapper.FromOperation);\n\n    public static IFlowCaptureOperationWrapper? AsFlowCapture(this IOperation operation) =>\n        operation.As(OperationKindEx.FlowCapture, IFlowCaptureOperationWrapper.FromOperation);\n\n    public static IFlowCaptureReferenceOperationWrapper? AsFlowCaptureReference(this IOperation operation) =>\n        operation.As(OperationKindEx.FlowCaptureReference, IFlowCaptureReferenceOperationWrapper.FromOperation);\n\n    public static IForEachLoopOperationWrapper? AsForEachLoop(this IOperation operation)\n    {\n        if (operation is null)  // null check to be consistent with other the other As methods\n        {\n            throw new NullReferenceException(nameof(operation));\n        }\n        // Other LoopKinds (e.g. For, While) are still OperationKindEx.Loop, but cannot be cast to IForEachLoopOperationWrapper so we need an additional check\n        return IForEachLoopOperationWrapper.IsInstance(operation) ? IForEachLoopOperationWrapper.FromOperation(operation) : null;\n    }\n\n    public static IInvocationOperationWrapper? AsInvocation(this IOperation operation) =>\n        operation.As(OperationKindEx.Invocation, IInvocationOperationWrapper.FromOperation);\n\n    public static ILocalFunctionOperationWrapper? AsLocalFunction(this IOperation operation) =>\n        operation.As(OperationKindEx.LocalFunction, ILocalFunctionOperationWrapper.FromOperation);\n\n    public static ILocalReferenceOperationWrapper? AsLocalReference(this IOperation operation) =>\n        operation.As(OperationKindEx.LocalReference, ILocalReferenceOperationWrapper.FromOperation);\n\n    public static IIsNullOperationWrapper? AsIsNull(this IOperation operation) =>\n        operation.As(OperationKindEx.IsNull, IIsNullOperationWrapper.FromOperation);\n\n    public static IIsPatternOperationWrapper? AsIsPattern(this IOperation operation) =>\n        operation.As(OperationKindEx.IsPattern, IIsPatternOperationWrapper.FromOperation);\n\n    public static IParameterReferenceOperationWrapper? AsParameterReference(this IOperation operation) =>\n        operation.As(OperationKindEx.ParameterReference, IParameterReferenceOperationWrapper.FromOperation);\n\n    public static IMethodReferenceOperationWrapper? AsMethodReference(this IOperation operation) =>\n        operation.As(OperationKindEx.MethodReference, IMethodReferenceOperationWrapper.FromOperation);\n\n    public static IObjectCreationOperationWrapper? AsObjectCreation(this IOperation operation) =>\n        operation.As(OperationKindEx.ObjectCreation, IObjectCreationOperationWrapper.FromOperation);\n\n    public static IPropertyReferenceOperationWrapper? AsPropertyReference(this IOperation operation) =>\n        operation.As(OperationKindEx.PropertyReference, IPropertyReferenceOperationWrapper.FromOperation);\n\n    public static IRecursivePatternOperationWrapper? AsRecursivePattern(this IOperation operation) =>\n        operation.As(OperationKindEx.RecursivePattern, IRecursivePatternOperationWrapper.FromOperation);\n\n    public static ISpreadOperationWrapper? AsSpread(this IOperation operation) =>\n        operation.As(OperationKindEx.Spread, ISpreadOperationWrapper.FromOperation);\n\n    public static ITupleOperationWrapper? AsTuple(this IOperation operation) =>\n        operation.As(OperationKindEx.Tuple, ITupleOperationWrapper.FromOperation);\n\n    public static IVariableDeclaratorOperationWrapper? AsVariableDeclarator(this IOperation operation) =>\n        operation.As(OperationKindEx.VariableDeclarator, IVariableDeclaratorOperationWrapper.FromOperation);\n\n    public static IAddressOfOperationWrapper ToAddressOf(this IOperation operation) =>\n        IAddressOfOperationWrapper.FromOperation(operation);\n\n    public static IAwaitOperationWrapper ToAwait(this IOperation operation) =>\n        IAwaitOperationWrapper.FromOperation(operation);\n\n    public static IArgumentOperationWrapper ToArgument(this IOperation operation) =>\n        IArgumentOperationWrapper.FromOperation(operation);\n\n    public static IArrayCreationOperationWrapper ToArrayCreation(this IOperation operation) =>\n        IArrayCreationOperationWrapper.FromOperation(operation);\n\n    public static IAssignmentOperationWrapper ToAssignment(this IOperation operation) =>\n        IAssignmentOperationWrapper.FromOperation(operation);\n\n    public static IArrayElementReferenceOperationWrapper ToArrayElementReference(this IOperation operation) =>\n        IArrayElementReferenceOperationWrapper.FromOperation(operation);\n\n    public static IBinaryOperationWrapper ToBinary(this IOperation operation) =>\n        IBinaryOperationWrapper.FromOperation(operation);\n\n    public static IBinaryPatternOperationWrapper ToBinaryPattern(this IOperation operation) =>\n        IBinaryPatternOperationWrapper.FromOperation(operation);\n\n    public static ICatchClauseOperationWrapper ToCatchClause(this IOperation operation) =>\n        ICatchClauseOperationWrapper.FromOperation(operation);\n\n    public static ICompoundAssignmentOperationWrapper ToCompoundAssignment(this IOperation operation) =>\n        ICompoundAssignmentOperationWrapper.FromOperation(operation);\n\n    public static IConstantPatternOperationWrapper ToConstantPattern(this IOperation operation) =>\n        IConstantPatternOperationWrapper.FromOperation(operation);\n\n    public static IConversionOperationWrapper ToConversion(this IOperation operation) =>\n        IConversionOperationWrapper.FromOperation(operation);\n\n    public static IDeclarationPatternOperationWrapper ToDeclarationPattern(this IOperation operation) =>\n        IDeclarationPatternOperationWrapper.FromOperation(operation);\n\n    public static IEventReferenceOperationWrapper ToEventReference(this IOperation operation) =>\n        IEventReferenceOperationWrapper.FromOperation(operation);\n\n    public static IFieldReferenceOperationWrapper ToFieldReference(this IOperation operation) =>\n        IFieldReferenceOperationWrapper.FromOperation(operation);\n\n    public static IFlowCaptureOperationWrapper ToFlowCapture(this IOperation operation) =>\n        IFlowCaptureOperationWrapper.FromOperation(operation);\n\n    public static IFlowCaptureReferenceOperationWrapper ToFlowCaptureReference(this IOperation operation) =>\n        IFlowCaptureReferenceOperationWrapper.FromOperation(operation);\n\n    public static IIncrementOrDecrementOperationWrapper ToIncrementOrDecrement(this IOperation operation) =>\n        IIncrementOrDecrementOperationWrapper.FromOperation(operation);\n\n    public static IInvocationOperationWrapper ToInvocation(this IOperation operation) =>\n        IInvocationOperationWrapper.FromOperation(operation);\n\n    public static IIsTypeOperationWrapper ToIsType(this IOperation operation) =>\n        IIsTypeOperationWrapper.FromOperation(operation);\n\n    public static ILocalFunctionOperationWrapper ToLocalFunction(this IOperation operation) =>\n        ILocalFunctionOperationWrapper.FromOperation(operation);\n\n    public static ILocalReferenceOperationWrapper ToLocalReference(this IOperation operation) =>\n        ILocalReferenceOperationWrapper.FromOperation(operation);\n\n    public static IMemberReferenceOperationWrapper ToMemberReference(this IOperation operation) =>\n        IMemberReferenceOperationWrapper.FromOperation(operation);\n\n    public static IMethodReferenceOperationWrapper ToMethodReference(this IOperation operation) =>\n        IMethodReferenceOperationWrapper.FromOperation(operation);\n\n    public static INegatedPatternOperationWrapper ToNegatedPattern(this IOperation operation) =>\n        INegatedPatternOperationWrapper.FromOperation(operation);\n\n    public static IObjectCreationOperationWrapper ToObjectCreation(this IOperation operation) =>\n        IObjectCreationOperationWrapper.FromOperation(operation);\n\n    public static IPatternOperationWrapper ToPattern(this IOperation operation) =>\n        IPatternOperationWrapper.FromOperation(operation);\n\n    public static IParameterReferenceOperationWrapper ToParameterReference(this IOperation operation) =>\n        IParameterReferenceOperationWrapper.FromOperation(operation);\n\n    public static IPropertyReferenceOperationWrapper ToPropertyReference(this IOperation operation) =>\n        IPropertyReferenceOperationWrapper.FromOperation(operation);\n\n    public static IRecursivePatternOperationWrapper ToRecursivePattern(this IOperation operation) =>\n        IRecursivePatternOperationWrapper.FromOperation(operation);\n\n    public static IRelationalPatternOperationWrapper ToRelationalPattern(this IOperation operation) =>\n        IRelationalPatternOperationWrapper.FromOperation(operation);\n\n    public static ITypePatternOperationWrapper ToTypePattern(this IOperation operation) =>\n        ITypePatternOperationWrapper.FromOperation(operation);\n\n    public static ITupleOperationWrapper ToTuple(this IOperation operation) =>\n        ITupleOperationWrapper.FromOperation(operation);\n\n    public static IUnaryOperationWrapper ToUnary(this IOperation operation) =>\n        IUnaryOperationWrapper.FromOperation(operation);\n\n    public static IVariableDeclarationOperationWrapper ToVariableDeclaration(this IOperation operation) =>\n        IVariableDeclarationOperationWrapper.FromOperation(operation);\n\n    public static IVariableDeclaratorOperationWrapper ToVariableDeclarator(this IOperation operation) =>\n        IVariableDeclaratorOperationWrapper.FromOperation(operation);\n\n    public static IOperation UnwrapConversion(this IOperation operation)\n    {\n        while (operation?.Kind == OperationKindEx.Conversion)\n        {\n            operation = operation.ToConversion().Operand;\n        }\n        return operation;\n    }\n\n    // This method is taken from Roslyn implementation\n    private static IEnumerable<IOperation> Descendants(IOperation operation, bool includeSelf)\n    {\n        if (operation is null)\n        {\n            yield break;\n        }\n        if (includeSelf)\n        {\n            yield return operation;\n        }\n        var stack = new Stack<IEnumerator<IOperation>>();\n        stack.Push(operation.ToSonar().Children.GetEnumerator());\n        while (stack.Any())\n        {\n            var iterator = stack.Pop();\n            if (!iterator.MoveNext())\n            {\n                continue;\n            }\n\n            stack.Push(iterator);\n            if (iterator.Current is { } current)\n            {\n                yield return current;\n                stack.Push(current.ToSonar().Children.GetEnumerator());\n            }\n        }\n    }\n\n    /// <summary>\n    /// Returns the argument value corresponding to <paramref name=\"parameterName\"/>. For <see langword=\"params\"/> parameter an IArrayCreationOperation is returned.\n    /// </summary>\n    private static IOperation ArgumentValue(ImmutableArray<IOperation> arguments, string parameterName)\n    {\n        foreach (var operation in arguments)\n        {\n            var argument = operation.ToArgument();\n            if (argument.Parameter.Name == parameterName)\n            {\n                return argument.Value;\n            }\n        }\n        return null;\n    }\n\n    private static string OperationPrefix(IOperation op) =>\n        op.Kind == OperationKindEx.Invalid ? \"INVALID\" : op.GetType().Name;\n\n    private static string OperationSuffix(IOperation op) =>\n        op switch\n        {\n            var _ when IInvocationOperationWrapper.IsInstance(op) => \": \" + IInvocationOperationWrapper.FromOperation(op).TargetMethod.Name,\n            var _ when IFlowCaptureOperationWrapper.IsInstance(op) => \": \" + IFlowCaptureOperationWrapper.FromOperation(op).Id.Serialize(),\n            var _ when IFlowCaptureReferenceOperationWrapper.IsInstance(op) => \": \" + IFlowCaptureReferenceOperationWrapper.FromOperation(op).Id.Serialize(),\n            _ => null\n        };\n\n    private static T? As<T>(this IOperation operation, OperationKind kind, Func<IOperation, T> fromOperation) where T : struct =>\n        operation.Kind == kind ? fromOperation(operation) : null;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Extensions/IsPatternExpressionSyntaxWrapperExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CFG.Extensions;\n\npublic static class IsPatternExpressionSyntaxWrapperExtensions\n{\n    public static bool IsNull(this IsPatternExpressionSyntaxWrapper isPatternWrapper) =>\n        isPatternWrapper.Pattern.IsNull();\n\n    public static bool IsNot(this IsPatternExpressionSyntaxWrapper isPatternWrapper) =>\n        isPatternWrapper.Pattern.RemoveParentheses() is var syntaxNode\n        && UnaryPatternSyntaxWrapper.IsInstance(syntaxNode)\n        && ((UnaryPatternSyntaxWrapper)syntaxNode) is var unaryPatternSyntaxWrapper\n        && unaryPatternSyntaxWrapper.IsNot();\n\n    public static bool IsNotNull(this IsPatternExpressionSyntaxWrapper isPatternWrapper) =>\n        isPatternWrapper.Pattern.RemoveParentheses() is var syntaxNode\n        && UnaryPatternSyntaxWrapper.IsInstance(syntaxNode)\n        && ((UnaryPatternSyntaxWrapper)syntaxNode) is var unaryPatternSyntaxWrapper\n        && unaryPatternSyntaxWrapper.IsNotNull();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Extensions/PatternSyntaxWrapperExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\n\nnamespace SonarAnalyzer.CFG.Extensions;\n\npublic static class PatternSyntaxWrapperExtensions\n{\n    public static bool IsNull(this PatternSyntaxWrapper patternSyntaxWrapper) =>\n        patternSyntaxWrapper.RemoveParentheses() is var syntaxNode\n        && ConstantPatternSyntaxWrapper.IsInstance(syntaxNode)\n        && (ConstantPatternSyntaxWrapper)syntaxNode is var constantPattern\n        && constantPattern.Expression.Kind() == SyntaxKind.NullLiteralExpression;\n\n    public static bool IsNot(this PatternSyntaxWrapper patternSyntaxWrapper) =>\n        patternSyntaxWrapper.RemoveParentheses().Kind() == SyntaxKindEx.NotPattern;\n\n    public static SyntaxNode RemoveParentheses(this PatternSyntaxWrapper patternSyntaxWrapper) =>\n        patternSyntaxWrapper.SyntaxNode.RemoveParentheses();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Extensions/PropertyInfoExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Collections;\nusing System.Reflection;\n\nnamespace SonarAnalyzer.CFG.Extensions;\n\ninternal static class PropertyInfoExtensions\n{\n    public static T ReadCached<T>(this PropertyInfo property, object instance, ref T cache) where T : class =>\n        cache ??= (T)property.GetValue(instance);\n\n    public static T ReadCached<T>(this PropertyInfo property, object instance, ref T? cache) where T : struct =>\n        cache ??= (T)property.GetValue(instance);\n\n    public static T ReadCached<T>(this PropertyInfo property, object instance, Func<object, T> createInstance, ref T cache) where T : class =>\n        cache ??= createInstance(property.GetValue(instance));\n\n    public static ImmutableArray<T> ReadCached<T>(this PropertyInfo property, object instance, ref ImmutableArray<T> cache) =>\n        ReadCached(property, instance, x => (T)x, ref cache);\n\n    public static ImmutableArray<T> ReadCached<T>(this PropertyInfo property, object instance, Func<object, T> createInstance, ref ImmutableArray<T> cache)\n    {\n        if (cache.IsDefault)\n        {\n            cache = ((IEnumerable)property.GetValue(instance)).Cast<object>().Select(createInstance).ToImmutableArray();\n        }\n        return cache;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Extensions/SemanticModelExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CFG.Extensions;\n\npublic static class SemanticModelExtensions\n{\n    /// <summary>\n    /// Starting .NET Framework 4.6.1, we've noticed that LINQ methods aren't resolved properly, so we need to use the CandidateSymbol.\n    /// </summary>\n    /// <param name=\"model\">Semantic model</param>\n    /// /// <param name=\"node\">Node for which it gets the symbol</param>\n    /// <returns>\n    /// The symbol if resolved.\n    /// The first candidate symbol if resolution failed.\n    /// Null if no symbol was found.\n    /// </returns>\n    public static ISymbol GetSymbolOrCandidateSymbol(this SemanticModel model, SyntaxNode node)\n    {\n        var symbolInfo = model.GetSymbolInfo(node);\n        if (symbolInfo.Symbol is not null)\n        {\n            return symbolInfo.Symbol;\n        }\n        return symbolInfo.CandidateSymbols.FirstOrDefault();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Extensions/StringExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text;\n\nnamespace SonarAnalyzer.CFG.Extensions;\n\npublic static class StringExtensions\n{\n    /// <summary>\n    /// Splits the input string to the list of words.\n    ///\n    /// Sequence of upper case letters is considered as single word.\n    ///\n    /// For example:\n    /// <list type=\"table\">\n    /// <item>thisIsAName => [\"THIS\", \"IS\", \"A\", \"NAME\"]</item>\n    /// <item>ThisIsSMTPName => [\"THIS\", \"IS\", \"SMTP\", \"NAME\"]</item>\n    /// <item>bin2hex => [\"BIN\", \"HEX\"]</item>\n    /// <item>HTML => [\"HTML\"]</item>\n    /// <item>SOME_value => [\"SOME\", \"VALUE\"]</item>\n    /// <item>PEHeader => [\"PE\", \"HEADER\"]</item>\n    /// </list>\n    /// </summary>\n    /// <param name=\"name\">A string containing words.</param>\n    /// <returns>A list of words (all uppercase) contained in the string.</returns>\n    public static IEnumerable<string> SplitCamelCaseToWords(this string name)\n    {\n        if (name is null)\n        {\n            yield break;\n        }\n\n        var currentWord = new StringBuilder();\n        var hasLower = false;\n\n        for (var i = 0; i < name.Length; i++)\n        {\n            var c = name[i];\n            if (!char.IsLetter(c))\n            {\n                if (currentWord.Length > 0)\n                {\n                    yield return currentWord.ToString();\n                    currentWord.Clear();\n                    hasLower = false;\n                }\n                continue;\n            }\n\n            if (char.IsUpper(c)\n                && currentWord.Length > 0\n                && (hasLower || IsFollowedByLower(i)))\n            {\n                yield return currentWord.ToString();\n                currentWord.Clear();\n                hasLower = false;\n            }\n\n            currentWord.Append(char.ToUpperInvariant(c));\n            hasLower = hasLower || char.IsLower(c);\n        }\n\n        if (currentWord.Length > 0)\n        {\n            yield return currentWord.ToString();\n        }\n\n        bool IsFollowedByLower(int i) => i + 1 < name.Length && char.IsLower(name[i + 1]);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Extensions/SyntaxNodeExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\n\nnamespace SonarAnalyzer.CFG.Extensions;\n\ninternal static class SyntaxNodeExtensions\n{\n    private static readonly ISet<SyntaxKind> ParenthesizedExpressionKinds = new HashSet<SyntaxKind> { SyntaxKind.ParenthesizedExpression, SyntaxKindEx.ParenthesizedPattern };\n\n    public static SyntaxNode RemoveParentheses(this SyntaxNode expression)\n    {\n        var currentExpression = expression;\n        while (currentExpression is not null && ParenthesizedExpressionKinds.Contains(currentExpression.Kind()))\n        {\n            if (currentExpression.IsKind(SyntaxKind.ParenthesizedExpression))\n            {\n                currentExpression = ((ParenthesizedExpressionSyntax)currentExpression).Expression;\n            }\n            else\n            {\n                currentExpression = ((ParenthesizedPatternSyntaxWrapper)currentExpression).Pattern;\n            }\n        }\n        return currentExpression;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Extensions/UnaryPatternSyntaxWrapperExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\n\nnamespace SonarAnalyzer.CFG.Extensions;\n\npublic static class UnaryPatternSyntaxWrapperExtensions\n{\n    public static bool IsNot(this UnaryPatternSyntaxWrapper unaryPatternSyntaxWrapper) =>\n        unaryPatternSyntaxWrapper.SyntaxNode.RemoveParentheses().Kind() == SyntaxKindEx.NotPattern;\n\n    public static bool IsNotNull(this UnaryPatternSyntaxWrapper unaryPatternSyntaxWrapper) =>\n        unaryPatternSyntaxWrapper.IsNot() && unaryPatternSyntaxWrapper.Pattern.IsNull();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/LiveVariableAnalysis/LiveVariableAnalysisBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CFG.Common;\n\nnamespace SonarAnalyzer.CFG.LiveVariableAnalysis;\n\npublic abstract class LiveVariableAnalysisBase<TCfg, TBlock>\n{\n    protected readonly ISymbol originalDeclaration;\n    protected readonly CancellationToken Cancel;\n    private readonly Dictionary<TBlock, HashSet<ISymbol>> blockLiveOut = new();\n    private readonly Dictionary<TBlock, HashSet<ISymbol>> blockLiveIn = new();\n    private readonly HashSet<ISymbol> captured = [];\n\n    public abstract bool IsLocal(ISymbol symbol);\n    protected abstract TBlock ExitBlock { get; }\n    protected abstract State ProcessBlock(TBlock block);\n    protected abstract IEnumerable<TBlock> ReversedBlocks();\n    protected abstract IEnumerable<TBlock> Successors(TBlock block);\n    protected abstract IEnumerable<TBlock> Predecessors(TBlock block);\n\n    public TCfg Cfg { get; }\n    public IReadOnlyCollection<ISymbol> CapturedVariables => captured;\n\n    protected LiveVariableAnalysisBase(TCfg cfg, ISymbol originalDeclaration, CancellationToken cancel)\n    {\n        Cfg = cfg;\n        this.originalDeclaration = originalDeclaration;\n        Cancel = cancel;\n    }\n\n    /// <summary>\n    /// LiveIn variables are alive when entering block. They are read inside the block or any of it's successors.\n    /// </summary>\n    public IEnumerable<ISymbol> LiveIn(TBlock block) =>\n        blockLiveIn[block].Except(captured);\n\n    /// <summary>\n    /// LiveOut variables are alive when exiting block. They are read in any of it's successors.\n    /// </summary>\n    public IEnumerable<ISymbol> LiveOut(TBlock block) =>\n        blockLiveOut[block].Except(captured);\n\n    protected void Analyze()\n    {\n        var states = new Dictionary<TBlock, State>();\n        var queue = new UniqueQueue<TBlock>();\n        foreach (var block in ReversedBlocks())\n        {\n            var state = ProcessBlock(block);\n            captured.UnionWith(state.Captured);\n            states.Add(block, state);\n            blockLiveIn.Add(block, new HashSet<ISymbol>());\n            blockLiveOut.Add(block, new HashSet<ISymbol>());\n            queue.Enqueue(block);\n        }\n        while (queue.Any())\n        {\n            Cancel.ThrowIfCancellationRequested();\n\n            var block = queue.Dequeue();\n            var liveOut = blockLiveOut[block];\n            // note that on the PHP LVA impl, the `liveOut` gets cleared before being updated\n            foreach (var successorLiveIn in Successors(block).Select(x => blockLiveIn[x]).Where(x => x.Any()))\n            {\n                liveOut.UnionWith(successorLiveIn);\n            }\n            // liveIn = UsedBeforeAssigned + (LiveOut - Assigned)\n            var liveIn = states[block].UsedBeforeAssigned.Concat(liveOut.Except(states[block].Assigned)).ToHashSet();\n            // Don't enqueue predecessors if nothing changed.\n            if (!liveIn.SetEquals(blockLiveIn[block]))\n            {\n                blockLiveIn[block] = liveIn;\n                foreach (var predecessor in Predecessors(block))\n                {\n                    queue.Enqueue(predecessor);\n                }\n            }\n        }\n        if (blockLiveOut[ExitBlock].Any())\n        {\n            throw new InvalidOperationException(\"Out of exit block should be empty\");\n        }\n    }\n\n    protected abstract class State\n    {\n        public HashSet<ISymbol> Assigned { get; } = [];            // Kill: The set of variables that are assigned a value.\n        public HashSet<ISymbol> UsedBeforeAssigned { get; } = [];  // Gen:  The set of variables that are used before any assignment.\n        public HashSet<ISymbol> ProcessedLocalFunctions { get; } = [];\n        public HashSet<ISymbol> Captured { get; } = [];\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/LiveVariableAnalysis/RoslynLiveVariableAnalysis.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CFG.Roslyn;\nusing SonarAnalyzer.CFG.Syntax.Utilities;\n\nnamespace SonarAnalyzer.CFG.LiveVariableAnalysis;\n\npublic sealed class RoslynLiveVariableAnalysis : LiveVariableAnalysisBase<ControlFlowGraph, BasicBlock>\n{\n    private readonly Dictionary<CaptureId, List<ISymbol>> flowCaptures = [];\n    private readonly Dictionary<int, List<BasicBlock>> blockPredecessors = [];\n    private readonly Dictionary<int, List<BasicBlock>> blockSuccessors = [];\n    private readonly SyntaxClassifierBase syntaxClassifier;\n\n    internal ImmutableDictionary<int, List<BasicBlock>> BlockPredecessors => blockPredecessors.ToImmutableDictionary();\n\n    protected override BasicBlock ExitBlock => Cfg.ExitBlock;\n\n    public RoslynLiveVariableAnalysis(ControlFlowGraph cfg, SyntaxClassifierBase syntaxClassifier, CancellationToken cancel)\n        : base(cfg, OriginalDeclaration(cfg.OriginalOperation), cancel)\n    {\n        this.syntaxClassifier = syntaxClassifier;\n        foreach (var ordinal in cfg.Blocks.Select(x => x.Ordinal))\n        {\n            blockPredecessors.Add(ordinal, []);\n            blockSuccessors.Add(ordinal, []);\n        }\n        foreach (var block in cfg.Blocks)\n        {\n            BuildBranches(block);\n        }\n        ResolveCaptures(cfg);\n        Analyze();\n    }\n\n    public IEnumerable<ISymbol> ParameterOrLocalSymbols(IOperation operation)\n    {\n        var candidates = operation switch\n        {\n            _ when operation.AsParameterReference() is { } parameterReference => [parameterReference.Parameter],\n            _ when operation.AsLocalReference() is { } localReference => [localReference.Local],\n            _ when operation.AsFlowCaptureReference() is { } flowCaptureReference => flowCaptures.TryGetValue(flowCaptureReference.Id, out var symbols) ? symbols : [],\n            _ => []\n        };\n        return candidates.Where(IsLocal);\n    }\n\n    public override bool IsLocal(ISymbol symbol) =>\n        originalDeclaration.Equals(symbol?.ContainingSymbol);\n\n    protected override IEnumerable<BasicBlock> ReversedBlocks() =>\n        Cfg.Blocks.Reverse();\n\n    protected override IEnumerable<BasicBlock> Predecessors(BasicBlock block) =>\n        blockPredecessors[block.Ordinal];\n\n    protected override IEnumerable<BasicBlock> Successors(BasicBlock block) =>\n        blockSuccessors[block.Ordinal];\n\n    protected override State ProcessBlock(BasicBlock block)\n    {\n        var ret = new RoslynState(this);\n        ret.ProcessBlock(Cfg, block);\n        return ret;\n    }\n\n    private void ResolveCaptures(ControlFlowGraph cfg) =>\n        ResolveCaptures(cfg, []);\n\n    private void ResolveCaptures(ControlFlowGraph cfg, HashSet<ISymbol> processedLocalFunctions)\n    {\n        foreach (var operation in cfg.Blocks.SelectMany(x => x.OperationsAndBranchValue).ToExecutionOrder().Select(x => x.Instance))\n        {\n            if (operation.AsFlowCapture() is { } flowCapture)\n            {\n                ProcessFlowCapture(flowCapture);\n            }\n            else if (operation.AsFlowAnonymousFunction() is { Symbol.IsStatic: false } flowAnonymousFunction)\n            {\n                ResolveCaptures(cfg.GetAnonymousFunctionControlFlowGraph(flowAnonymousFunction, Cancel), processedLocalFunctions);\n            }\n            else if (operation.AsInvocation() is { } invocation && HandleLocalFunction(processedLocalFunctions, invocation.TargetMethod.ConstructedFrom) is { } invocationLocalFunction)\n            {\n                ResolveCaptures(cfg.FindLocalFunctionCfgInScope(invocationLocalFunction, Cancel), processedLocalFunctions);\n            }\n            else if (operation.AsMethodReference() is { } reference && HandleLocalFunction(processedLocalFunctions, reference.Method.ConstructedFrom) is { } referenceLocalFunction)\n            {\n                ResolveCaptures(cfg.FindLocalFunctionCfgInScope(referenceLocalFunction, Cancel), processedLocalFunctions);\n            }\n        }\n    }\n\n    private void ProcessFlowCapture(IFlowCaptureOperationWrapper flowCapture)\n    {\n        if (flowCapture.Value.AsFlowCaptureReference() is { } captureReference\n            && flowCaptures.TryGetValue(captureReference.Id, out var symbols))\n        {\n            AppendFlowCaptureReference(flowCapture.Id, symbols);\n        }\n        else\n        {\n            AppendFlowCaptureReference(flowCapture.Id, ParameterOrLocalSymbols(flowCapture.Value));\n        }\n    }\n\n    private static IMethodSymbol HandleLocalFunction(ISet<ISymbol> processed, IMethodSymbol method)\n    {\n        // We need ConstructedFrom because TargetMethod of a generic local function invocation is not the correct symbol (has IsDefinition=False and wrong ContainingSymbol)\n        if (method.ConstructedFrom is { MethodKind: MethodKindEx.LocalFunction, IsStatic: false } localFunction\n            && !processed.Contains(localFunction))\n        {\n            processed.Add(localFunction);\n            return localFunction;\n        }\n        else\n        {\n            return null;\n        }\n    }\n\n    private void AppendFlowCaptureReference(CaptureId id, IEnumerable<ISymbol> symbols)\n    {\n        if (!flowCaptures.TryGetValue(id, out var list))\n        {\n            list = [];\n            flowCaptures.Add(id, list);\n        }\n        list.AddRange(symbols);\n    }\n\n    private void BuildBranches(BasicBlock block)\n    {\n        foreach (var successor in block.Successors)\n        {\n            if (successor.Destination is not null)\n            {\n                // When exiting finally region, redirect to finally instead of the normal destination\n                AddBranch(successor.Source, successor.FinallyRegions.Any() ? Cfg.Blocks[successor.FinallyRegions.First().FirstBlockOrdinal] : successor.Destination);\n            }\n            else if (successor.Source.EnclosingRegion is { Kind: ControlFlowRegionKind.Finally } finallyRegion)\n            {\n                BuildBranchesFinally(successor.Source, finallyRegion);\n            }\n            foreach (var catchOrFilterRegion in successor.EnteringRegions.Where(x => x.Kind == ControlFlowRegionKind.TryAndCatch).SelectMany(CatchOrFilterRegions))\n            {\n                AddBranch(block, Cfg.Blocks[catchOrFilterRegion.FirstBlockOrdinal]);\n            }\n        }\n        if (block.EnclosingNonLocalLifetimeRegion() is { Kind: ControlFlowRegionKind.Try } tryRegion)\n        {\n            var catchesAll = false;\n            if (tryRegion.EnclosingRegion(ControlFlowRegionKind.TryAndCatch) is { } tryAndCatchRegion)\n            {\n                foreach (var catchOrFilterRegion in CatchOrFilterRegions(tryAndCatchRegion))\n                {\n                    AddBranch(block, Cfg.Blocks[catchOrFilterRegion.FirstBlockOrdinal]);\n                    catchesAll = catchesAll || (catchOrFilterRegion.Kind == ControlFlowRegionKind.Catch && IsCatchAllType(catchOrFilterRegion.ExceptionType));\n                }\n            }\n            if (!catchesAll && block.EnclosingRegion(ControlFlowRegionKind.TryAndFinally)?.NestedRegion(ControlFlowRegionKind.Finally) is { } finallyRegion)\n            {\n                var finallyBlock = Cfg.Blocks[finallyRegion.FirstBlockOrdinal];\n                AddBranch(block, finallyBlock);\n                AddPredecessorsOutsideRegion(finallyBlock);\n            }\n        }\n        if (block.IsEnclosedIn(ControlFlowRegionKind.Catch) || block.IsEnclosedIn(ControlFlowRegionKind.Filter))\n        {\n            BuildBranchesCatch(block);\n        }\n        if (block.EnclosingNonLocalLifetimeRegion() is { Kind: ControlFlowRegionKind.Finally })\n        {\n            BuildBranchesToOuterCatch(block, block.EnclosingNonLocalLifetimeRegion().EnclosingRegion);\n        }\n\n        void AddPredecessorsOutsideRegion(BasicBlock destination)\n        {\n            // We assume that current block can throw in its first operation. Therefore predecessors outside this tryRegion need to be redirected to catch/filter/finally\n            foreach (var predecessor in block.Predecessors.Where(x => x.Source.Ordinal < tryRegion.FirstBlockOrdinal || x.Source.Ordinal > tryRegion.LastBlockOrdinal))\n            {\n                AddBranch(predecessor.Source, destination);\n            }\n        }\n    }\n\n    private void BuildBranchesCatch(BasicBlock source)\n    {\n        if (source.Successors.Any(x => x.Semantics is ControlFlowBranchSemantics.Rethrow or ControlFlowBranchSemantics.Throw))\n        {\n            BuildBranchesRethrow(source);\n        }\n        else if (source.EnclosingRegion(ControlFlowRegionKind.TryAndCatch) is { } innerTryCatch)\n        {\n            BuildBranchesToOuterCatch(source, innerTryCatch);\n        }\n    }\n\n    private void BuildBranchesToOuterCatch(BasicBlock source, ControlFlowRegion region)\n    {\n        if (region.EnclosingRegion(ControlFlowRegionKind.Try) is { } outerTry\n           && outerTry.EnclosingRegion(ControlFlowRegionKind.TryAndCatch) is { } outerTryCatch)\n        {\n            foreach (var outerCatch in CatchOrFilterRegions(outerTryCatch))\n            {\n                AddBranch(source, Cfg.Blocks[outerCatch.FirstBlockOrdinal]);\n            }\n        }\n    }\n\n    private void BuildBranchesFinally(BasicBlock source, ControlFlowRegion finallyRegion)\n    {\n        foreach (var trySuccessor in TryRegionSuccessors(source.EnclosingRegion))\n        {\n            // Redirect exit from finally to the next block\n            var destination = trySuccessor.FinallyRegions.SkipWhile(x => x != finallyRegion).Skip(1).FirstOrDefault() is { } nextOuterFinally\n                ? Cfg.Blocks[nextOuterFinally.FirstBlockOrdinal]    // Outer finally that directly follows this finally\n                : trySuccessor.Destination;                         // Normal block directly after this finally\n            AddBranch(source, destination);\n        }\n    }\n\n    private void BuildBranchesRethrow(BasicBlock block)\n    {\n        var currentTryCatchRegion = block.EnclosingRegion(ControlFlowRegionKind.TryAndCatch);\n        var reachableHandlerRegions = currentTryCatchRegion.NestedRegion(ControlFlowRegionKind.Try).ReachableHandlers();\n        var reachableCatchAndFinallyBlocks = reachableHandlerRegions.Where(x => x.FirstBlockOrdinal > currentTryCatchRegion.LastBlockOrdinal).SelectMany(x => x.Blocks(Cfg));\n        // On the use of `EnclosingRegion` below: Other than a finally region, a `Catch` region also acts as a `LocalLifetime` region.\n        // Therefore blocks in a `catch` always have the `Catch` region as their direct parent and thus checking `EnclosingRegion` instead of `IsEnclosedIn` is sufficient.\n        foreach (var catchBlock in reachableCatchAndFinallyBlocks.Where(x => x.EnclosingRegion.Kind is ControlFlowRegionKind.Catch))\n        {\n            AddBranch(block, catchBlock);\n        }\n        if (reachableCatchAndFinallyBlocks.FirstOrDefault(x => x.IsEnclosedIn(ControlFlowRegionKind.Finally)) is { } finallyBlock)\n        {\n            AddBranch(block, finallyBlock);\n        }\n    }\n\n    private void AddBranch(BasicBlock source, BasicBlock destination)\n    {\n        blockSuccessors[source.Ordinal].Add(destination);\n        blockPredecessors[destination.Ordinal].Add(source);\n    }\n\n    private IEnumerable<ControlFlowBranch> TryRegionSuccessors(ControlFlowRegion finallyRegion)\n    {\n        var tryRegion = finallyRegion.EnclosingRegion.NestedRegion(ControlFlowRegionKind.Try);\n        return tryRegion.Blocks(Cfg).SelectMany(x => x.Successors).Where(x => x.FinallyRegions.Contains(finallyRegion));\n    }\n\n    private static IEnumerable<ControlFlowRegion> CatchOrFilterRegions(ControlFlowRegion tryAndCatchRegion)\n    {\n        foreach (var region in tryAndCatchRegion.NestedRegions)\n        {\n            if (region.Kind == ControlFlowRegionKind.Catch)\n            {\n                yield return region;\n            }\n            else if (region.Kind == ControlFlowRegionKind.FilterAndHandler)\n            {\n                yield return region.NestedRegions.Single(x => x.Kind == ControlFlowRegionKind.Filter);\n            }\n        }\n    }\n\n    private static bool IsCatchAllType(ITypeSymbol exceptionType) =>\n        exceptionType.SpecialType == SpecialType.System_Object  // catch { ... }\n        || exceptionType is { ContainingNamespace: { Name: nameof(System), ContainingNamespace.IsGlobalNamespace: true }, Name: nameof(Exception) };  // catch(Exception) { ... }\n\n    private static ISymbol OriginalDeclaration(IOperation originalOperation)\n    {\n        if (originalOperation.IsAnyKind(OperationKindEx.MethodBody, OperationKindEx.Block, OperationKindEx.ConstructorBody))\n        {\n            var syntax = originalOperation.Syntax.IsKind(Microsoft.CodeAnalysis.CSharp.SyntaxKind.ArrowExpressionClause) ? originalOperation.Syntax.Parent : originalOperation.Syntax;\n            return originalOperation.ToSonar().SemanticModel.GetDeclaredSymbol(syntax);\n        }\n        else\n        {\n            return originalOperation switch\n            {\n                var _ when originalOperation.AsAnonymousFunction() is { } anonymousFunction => anonymousFunction.Symbol,\n                var _ when originalOperation.AsLocalFunction() is { } localFunction => localFunction.Symbol,\n                _ => throw new NotSupportedException($\"Operations of kind: {originalOperation.Kind} are not supported.\")\n            };\n        }\n    }\n\n    private sealed class RoslynState : State\n    {\n        private readonly RoslynLiveVariableAnalysis owner;\n        private readonly ISet<ISymbol> capturedLocalFunctions = new HashSet<ISymbol>();\n\n        public RoslynState(RoslynLiveVariableAnalysis owner) =>\n            this.owner = owner;\n\n        public void ProcessBlock(ControlFlowGraph cfg, BasicBlock block)\n        {\n            foreach (var operation in block.OperationsAndBranchValue.ToReversedExecutionOrder().Select(x => x.Instance))\n            {\n                ProcessOperation(cfg, operation);\n            }\n        }\n\n        private void ProcessOperation(ControlFlowGraph cfg, IOperation operation)\n        {\n            // Everything that is added here needs to be considered inside ProcessCaptured as well\n            if (operation.AsLocalReference() is { } localReference)\n            {\n                ProcessParameterOrLocalReference(localReference);\n            }\n            else if (operation.AsParameterReference() is { } parameterReference)\n            {\n                ProcessParameterOrLocalReference(parameterReference);\n            }\n            else if (operation.AsFlowCaptureReference() is { } flowCaptureReference)\n            {\n                ProcessParameterOrLocalReference(flowCaptureReference);\n            }\n            else if (operation.AsSimpleAssignment() is { } assignment)\n            {\n                ProcessSimpleAssignment(assignment);\n            }\n            else if (operation.AsFlowAnonymousFunction() is { } flowAnonymousFunction)\n            {\n                ProcessFlowAnonymousFunction(cfg, flowAnonymousFunction);\n            }\n            else if (operation.AsInvocation() is { } invocation)\n            {\n                ProcessLocalFunction(cfg, invocation.TargetMethod);\n            }\n            else if (operation.AsMethodReference() is { } methodReference)\n            {\n                ProcessLocalFunction(cfg, methodReference.Method);\n                // For .Select(variable.MethodReference), there's no LocalReferenceOperation in the CFG for variable, so we handle it from the syntax\n                if (owner.syntaxClassifier.MemberAccessExpression(operation.Syntax) is { } expression)\n                {\n                    var symbol = owner.Cfg.OriginalOperation.ToSonar().SemanticModel.GetSymbolInfo(expression).Symbol;\n                    if (symbol is ILocalSymbol or IParameterSymbol && owner.IsLocal(symbol))\n                    {\n                        ProcessParameterOrLocalSymbols([symbol], symbol is IParameterSymbol { RefKind: RefKind.Out }, false);\n                    }\n                }\n            }\n        }\n\n        private void ProcessParameterOrLocalReference(IOperationWrapper reference) =>\n            ProcessParameterOrLocalSymbols(\n                owner.ParameterOrLocalSymbols(reference.WrappedOperation),\n                reference.IsOutArgument(),\n                reference.IsAssignmentTarget() || reference.ToSonar().Parent?.Kind == OperationKindEx.FlowCapture);\n\n        private void ProcessParameterOrLocalSymbols(IEnumerable<ISymbol> symbols, bool isOutArgument, bool isAssignmentTarget)\n        {\n            if (isOutArgument)\n            {\n                Assigned.UnionWith(symbols);\n                UsedBeforeAssigned.ExceptWith(symbols);\n            }\n            else if (!isAssignmentTarget)\n            {\n                UsedBeforeAssigned.UnionWith(symbols);\n            }\n        }\n\n        private void ProcessSimpleAssignment(ISimpleAssignmentOperationWrapper assignment)\n        {\n            var targets = owner.ParameterOrLocalSymbols(assignment.Target);\n            Assigned.UnionWith(targets);\n            UsedBeforeAssigned.ExceptWith(targets);\n        }\n\n        private void ProcessFlowAnonymousFunction(ControlFlowGraph cfg, IFlowAnonymousFunctionOperationWrapper anonymousFunction)\n        {\n            if (!anonymousFunction.Symbol.IsStatic) // Performance: No need to descent into static\n            {\n                ProcessCaptured(cfg.GetAnonymousFunctionControlFlowGraph(anonymousFunction, owner.Cancel));\n            }\n        }\n\n        private void ProcessCaptured(ControlFlowGraph cfg)\n        {\n            foreach (var operation in cfg.Blocks.SelectMany(x => x.OperationsAndBranchValue).SelectMany(x => x.DescendantsAndSelf()))\n            {\n                var symbols = owner.ParameterOrLocalSymbols(operation);\n                if (symbols.Any())\n                {\n                    Captured.UnionWith(symbols);\n                }\n                else if (operation.AsFlowAnonymousFunction() is { } flowAnonymousFunction)\n                {\n                    ProcessFlowAnonymousFunction(cfg, flowAnonymousFunction);\n                }\n                else if (operation.AsInvocation() is { } invocation)\n                {\n                    ProcessCapturedLocalFunction(cfg, invocation.TargetMethod);\n                }\n                else if (operation.AsMethodReference() is { } methodReference)\n                {\n                    ProcessCapturedLocalFunction(cfg, methodReference.Method);\n                }\n            }\n        }\n\n        private void ProcessCapturedLocalFunction(ControlFlowGraph cfg, IMethodSymbol method)\n        {\n            if (HandleLocalFunction(capturedLocalFunctions, method) is { } localFunction)\n            {\n                ProcessCaptured(cfg.FindLocalFunctionCfgInScope(localFunction, owner.Cancel));\n            }\n        }\n\n        private void ProcessLocalFunction(ControlFlowGraph cfg, IMethodSymbol method)\n        {\n            if (HandleLocalFunction(ProcessedLocalFunctions, method) is { } localFunction)\n            {\n                var localFunctionCfg = cfg.FindLocalFunctionCfgInScope(localFunction, owner.Cancel);\n                foreach (var block in localFunctionCfg.Blocks.Reverse())    // Simplified approach, ignoring branching and try/catch/finally flows\n                {\n                    ProcessBlock(localFunctionCfg, block);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Operations/Utilities/OperationExecutionOrder.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Collections;\n\nnamespace SonarAnalyzer.CFG.Operations.Utilities;\n\npublic class OperationExecutionOrder : IEnumerable<IOperationWrapperSonar>\n{\n    private readonly IEnumerable<IOperation> operations;\n    private readonly bool reverseOrder;\n\n    public OperationExecutionOrder(IEnumerable<IOperation> operations, bool reverseOrder)\n    {\n        this.operations = operations;\n        this.reverseOrder = reverseOrder;\n    }\n\n    public IEnumerator<IOperationWrapperSonar> GetEnumerator() =>\n        new Enumerator(this);\n\n    IEnumerator IEnumerable.GetEnumerator() =>\n        GetEnumerator();\n\n    private sealed class Enumerator : IEnumerator<IOperationWrapperSonar>\n    {\n        private readonly OperationExecutionOrder owner;\n        private readonly Stack<StackItem> stack = new Stack<StackItem>();\n\n        public IOperationWrapperSonar Current { get; private set; }\n        object IEnumerator.Current => Current;\n\n        public Enumerator(OperationExecutionOrder owner)\n        {\n            this.owner = owner;\n            Init();\n        }\n\n        public bool MoveNext()\n        {\n            while (stack.Any())\n            {\n                if (owner.reverseOrder)\n                {\n                    var current = stack.Pop();\n                    while (current.NextChild() is { } child)\n                    {\n                        stack.Push(new StackItem(child));\n                    }\n                    Current = current.DisposeEnumeratorAndReturnOperation();\n                    return true;\n                }\n                else if (stack.Peek().NextChild() is { } child)\n                {\n                    stack.Push(new StackItem(child));\n                }\n                else\n                {\n                    Current = stack.Pop().DisposeEnumeratorAndReturnOperation();\n                    return true;\n                }\n            }\n            Current = default;\n            return false;\n        }\n\n        public void Reset()\n        {\n            Dispose();\n            Init();\n        }\n\n        public void Dispose()\n        {\n            while (stack.Any())\n            {\n                stack.Pop().Dispose();\n            }\n        }\n\n        private void Init()\n        {\n            // We need to push them to the stack in reversed order compared to reverseOrder argument\n            foreach (var operation in owner.reverseOrder ? owner.operations : owner.operations.Reverse())\n            {\n                stack.Push(new StackItem(operation));\n            }\n        }\n    }\n\n    private sealed class StackItem : IDisposable\n    {\n        private readonly IOperationWrapperSonar operation;\n        private readonly IEnumerator<IOperation> children;\n\n        public StackItem(IOperation operation)\n        {\n            this.operation = operation.ToSonar();\n            children = this.operation.Children.GetEnumerator();\n        }\n\n        public IOperation NextChild() =>\n            children.MoveNext() ? children.Current : null;\n\n        public IOperationWrapperSonar DisposeEnumeratorAndReturnOperation()\n        {\n            Dispose();\n            return operation;\n        }\n\n        public void Dispose() =>\n            children.Dispose();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Operations/Utilities/OperationFinder.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CFG.Roslyn;\n\nnamespace SonarAnalyzer.CFG.Operations.Utilities;\n\npublic abstract class OperationFinder<TResult>\n{\n    protected abstract bool TryFindOperation(IOperationWrapperSonar operation, out TResult result);\n\n    public bool TryFind(BasicBlock block, out TResult result) =>\n        TryFind(block.OperationsAndBranchValue, out result);\n\n    protected bool TryFind(IEnumerable<IOperation> operations, out TResult result)\n    {\n        var queue = new Queue<IOperation>();\n        foreach (var operation in operations)\n        {\n            queue.Enqueue(operation);\n            while (queue.Any())\n            {\n                var wrapper = queue.Dequeue().ToSonar();\n                if (TryFindOperation(wrapper, out result))\n                {\n                    return true;\n                }\n\n                foreach (var child in wrapper.Children)\n                {\n                    queue.Enqueue(child);\n                }\n            }\n        }\n\n        result = default;\n        return false;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Properties/AssemblyInfo.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Runtime.CompilerServices;\n\n[assembly: InternalsVisibleTo(\"SonarAnalyzer.Enterprise.Test\")]\n[assembly: InternalsVisibleTo(\"SonarAnalyzer.Test\")]\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Roslyn/BasicBlock.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Reflection;\nusing System.Runtime.CompilerServices;\n\nnamespace SonarAnalyzer.CFG.Roslyn;\n\npublic class BasicBlock\n{\n    private static readonly ConditionalWeakTable<object, BasicBlock> InstanceCache = new();\n    private static readonly PropertyInfo BranchValueProperty;\n    private static readonly PropertyInfo ConditionalSuccessorProperty;\n    private static readonly PropertyInfo ConditionKindProperty;\n    private static readonly PropertyInfo EnclosingRegionProperty;\n    private static readonly PropertyInfo FallThroughSuccessorProperty;\n    private static readonly PropertyInfo IsReachableProperty;\n    private static readonly PropertyInfo KindProperty;\n    private static readonly PropertyInfo OperationsProperty;\n    private static readonly PropertyInfo OrdinalProperty;\n    private static readonly PropertyInfo PredecessorsProperty;\n\n    private readonly object instance;\n    private readonly Lazy<ImmutableArray<ControlFlowBranch>> successors;\n    private readonly Lazy<ImmutableArray<BasicBlock>> successorBlocks;\n    private readonly Lazy<ImmutableArray<IOperation>> operationsAndBranchValue;\n    private IOperation branchValue;\n    private ControlFlowBranch conditionalSuccessor;\n    private ControlFlowConditionKind? conditionKind;\n    private ControlFlowRegion enclosingRegion;\n    private ControlFlowBranch fallThroughSuccessor;\n    private bool? isReachable;\n    private BasicBlockKind? kind;\n    private ImmutableArray<IOperation> operations;\n    private int? ordinal;\n    private ImmutableArray<ControlFlowBranch> predecessors;\n\n    public IOperation BranchValue => BranchValueProperty.ReadCached(instance, ref branchValue);\n    public ControlFlowBranch ConditionalSuccessor => ConditionalSuccessorProperty.ReadCached(instance, ControlFlowBranch.Wrap, ref conditionalSuccessor);\n    public ControlFlowConditionKind ConditionKind => ConditionKindProperty.ReadCached(instance, ref conditionKind);\n    public ControlFlowRegion EnclosingRegion => EnclosingRegionProperty.ReadCached(instance, ControlFlowRegion.Wrap, ref enclosingRegion);\n    public ControlFlowBranch FallThroughSuccessor => FallThroughSuccessorProperty.ReadCached(instance, ControlFlowBranch.Wrap, ref fallThroughSuccessor);\n    public bool IsReachable => IsReachableProperty.ReadCached(instance, ref isReachable);\n    public BasicBlockKind Kind => KindProperty.ReadCached(instance, ref kind);\n    public ImmutableArray<IOperation> Operations => OperationsProperty.ReadCached(instance, ref operations);\n    public int Ordinal => OrdinalProperty.ReadCached(instance, ref ordinal);\n    public ImmutableArray<ControlFlowBranch> Predecessors => PredecessorsProperty.ReadCached(instance, ControlFlowBranch.Wrap, ref predecessors);\n    public ImmutableArray<ControlFlowBranch> Successors => successors.Value;\n    public ImmutableArray<BasicBlock> SuccessorBlocks => successorBlocks.Value;\n    public ImmutableArray<IOperation> OperationsAndBranchValue => operationsAndBranchValue.Value;\n\n    static BasicBlock()\n    {\n        if (TypeLoader.FlowAnalysisType(\"BasicBlock\") is { } type)\n        {\n            BranchValueProperty = type.GetProperty(nameof(BranchValue));\n            ConditionalSuccessorProperty = type.GetProperty(nameof(ConditionalSuccessor));\n            ConditionKindProperty = type.GetProperty(nameof(ConditionKind));\n            EnclosingRegionProperty = type.GetProperty(nameof(EnclosingRegion));\n            FallThroughSuccessorProperty = type.GetProperty(nameof(FallThroughSuccessor));\n            IsReachableProperty = type.GetProperty(nameof(IsReachable));\n            KindProperty = type.GetProperty(nameof(Kind));\n            OperationsProperty = type.GetProperty(nameof(Operations));\n            OrdinalProperty = type.GetProperty(nameof(Ordinal));\n            PredecessorsProperty = type.GetProperty(nameof(Predecessors));\n        }\n    }\n\n    private BasicBlock(object instance)\n    {\n        this.instance = instance ?? throw new ArgumentNullException(nameof(instance));\n        successors = new Lazy<ImmutableArray<ControlFlowBranch>>(() =>\n        {\n            // since Roslyn does not differentiate between pattern types in CFG, it builds unreachable block for missing\n            // pattern match even when discard pattern option is presented. In this case we explicitly exclude this branch\n            if (SwitchExpressionArmSyntaxWrapper.IsInstance(BranchValue?.Syntax) && DiscardPatternSyntaxWrapper.IsInstance(((SwitchExpressionArmSyntaxWrapper)BranchValue.Syntax).Pattern))\n            {\n                return FallThroughSuccessor is null ? ImmutableArray<ControlFlowBranch>.Empty : ImmutableArray.Create(FallThroughSuccessor);\n            }\n            else\n            {\n                return new[] { FallThroughSuccessor, ConditionalSuccessor }.Where(x => x != null).ToImmutableArray();\n            }\n        });\n        successorBlocks = new Lazy<ImmutableArray<BasicBlock>>(() => Successors.Select(x => x.Destination).Where(x => x != null).ToImmutableArray());\n        operationsAndBranchValue = new Lazy<ImmutableArray<IOperation>>(() => BranchValue is null ? Operations : Operations.Add(BranchValue));\n    }\n\n    public static BasicBlock Wrap(object instance) =>\n        instance == null ? null : InstanceCache.GetValue(instance, x => new BasicBlock(x));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Roslyn/CfgAllPathValidator.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CFG.Roslyn;\n\npublic abstract class CfgAllPathValidator\n{\n    private readonly ControlFlowGraph cfg;\n\n    protected abstract bool IsValid(BasicBlock block);\n    protected abstract bool IsInvalid(BasicBlock block);\n\n    protected CfgAllPathValidator(ControlFlowGraph cfg) =>\n        this.cfg = cfg;\n\n    public bool CheckAllPaths()\n    {\n        HashSet<BasicBlock> visited = [];\n        var blocks = new Stack<BasicBlock>();\n        blocks.Push(cfg.EntryBlock);\n        while (blocks.Count > 0)\n        {\n            var block = blocks.Pop();\n            if (!visited.Add(block))\n            {\n                continue; // We already visited this block. (This protects from endless loops)\n            }\n            if (block == cfg.ExitBlock || IsInvalid(block))\n            {\n                return false;\n            }\n            if (IsValid(block))\n            {\n                continue;\n            }\n            if (block.SuccessorBlocks.IsEmpty)\n            {\n                return false;\n            }\n            foreach (var successorBlock in block.SuccessorBlocks)\n            {\n                blocks.Push(successorBlock);\n            }\n        }\n        return true;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Roslyn/ControlFlowBranch.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Reflection;\nusing System.Runtime.CompilerServices;\n\nnamespace SonarAnalyzer.CFG.Roslyn;\n\npublic class ControlFlowBranch\n{\n    private static readonly ConditionalWeakTable<object, ControlFlowBranch> InstanceCache = new();\n    private static readonly PropertyInfo SourceProperty;\n    private static readonly PropertyInfo DestinationProperty;\n    private static readonly PropertyInfo SemanticsProperty;\n    private static readonly PropertyInfo IsConditionalSuccessorProperty;\n    private static readonly PropertyInfo EnteringRegionsProperty;\n    private static readonly PropertyInfo LeavingRegionsProperty;\n    private static readonly PropertyInfo FinallyRegionsProperty;\n\n    private readonly object instance;\n    private BasicBlock source;\n    private BasicBlock destination;\n    private ControlFlowBranchSemantics? semantics;\n    private bool? isConditionalSuccessor;\n    private ImmutableArray<ControlFlowRegion> enteringRegions;\n    private ImmutableArray<ControlFlowRegion> leavingRegions;\n    private ImmutableArray<ControlFlowRegion> finallyRegions;\n\n    public BasicBlock Source => SourceProperty.ReadCached(instance, BasicBlock.Wrap, ref source);\n    public BasicBlock Destination => DestinationProperty.ReadCached(instance, BasicBlock.Wrap, ref destination);\n    public ControlFlowBranchSemantics Semantics => SemanticsProperty.ReadCached(instance, ref semantics);\n    public bool IsConditionalSuccessor => IsConditionalSuccessorProperty.ReadCached(instance, ref isConditionalSuccessor);\n    public ImmutableArray<ControlFlowRegion> EnteringRegions => EnteringRegionsProperty.ReadCached(instance, ControlFlowRegion.Wrap, ref enteringRegions);\n    public ImmutableArray<ControlFlowRegion> LeavingRegions => LeavingRegionsProperty.ReadCached(instance, ControlFlowRegion.Wrap, ref leavingRegions);\n    public ImmutableArray<ControlFlowRegion> FinallyRegions => FinallyRegionsProperty.ReadCached(instance, ControlFlowRegion.Wrap, ref finallyRegions);\n\n    static ControlFlowBranch()\n    {\n        if (TypeLoader.FlowAnalysisType(\"ControlFlowBranch\") is { } type)\n        {\n            SourceProperty = type.GetProperty(nameof(Source));\n            DestinationProperty = type.GetProperty(nameof(Destination));\n            SemanticsProperty = type.GetProperty(nameof(Semantics));\n            IsConditionalSuccessorProperty = type.GetProperty(nameof(IsConditionalSuccessor));\n            EnteringRegionsProperty = type.GetProperty(nameof(EnteringRegions));\n            LeavingRegionsProperty = type.GetProperty(nameof(LeavingRegions));\n            FinallyRegionsProperty = type.GetProperty(nameof(FinallyRegions));\n        }\n    }\n\n    private ControlFlowBranch(object instance) =>\n        this.instance = instance ?? throw new ArgumentNullException(nameof(instance));\n\n    public static ControlFlowBranch Wrap(object instance) =>\n        instance == null ? null : InstanceCache.GetValue(instance, x => new ControlFlowBranch(x));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Roslyn/ControlFlowGraph.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Reflection;\nusing System.Runtime.CompilerServices;\nusing SonarAnalyzer.CFG.Common;\n\nnamespace SonarAnalyzer.CFG.Roslyn;\n\npublic class ControlFlowGraph\n{\n    private static readonly ConditionalWeakTable<object, ControlFlowGraph> InstanceCache = new();\n    private static readonly PropertyInfo BlocksProperty;\n    private static readonly PropertyInfo LocalFunctionsProperty;\n    private static readonly PropertyInfo OriginalOperationProperty;\n    private static readonly PropertyInfo ParentProperty;\n    private static readonly PropertyInfo RootProperty;\n    private static readonly MethodInfo CreateMethod;\n    private static readonly MethodInfo GetAnonymousFunctionControlFlowGraphMethod;\n    private static readonly MethodInfo GetLocalFunctionControlFlowGraphMethod;\n\n    private readonly object instance;\n    private ImmutableArray<BasicBlock> blocks;\n    private ImmutableArray<IMethodSymbol> localFunctions;\n    private ControlFlowGraph parent;\n    private IOperation originalOperation;\n    private ControlFlowRegion root;\n\n    public static bool IsAvailable { get; }\n    public ImmutableArray<BasicBlock> Blocks => BlocksProperty.ReadCached(instance, BasicBlock.Wrap, ref blocks);\n    public ImmutableArray<IMethodSymbol> LocalFunctions => LocalFunctionsProperty.ReadCached<IMethodSymbol>(instance, ref localFunctions);\n    public IOperation OriginalOperation => OriginalOperationProperty.ReadCached(instance, ref originalOperation);\n    public ControlFlowGraph Parent => ParentProperty.ReadCached(instance, Wrap, ref parent);\n    public ControlFlowRegion Root => RootProperty.ReadCached(instance, ControlFlowRegion.Wrap, ref root);\n    public BasicBlock EntryBlock => Blocks[Root.FirstBlockOrdinal];\n    public BasicBlock ExitBlock => Blocks[Root.LastBlockOrdinal];\n\n    static ControlFlowGraph()\n    {\n        if (RoslynVersion.IsRoslynCfgSupported())\n        {\n            IsAvailable = true;\n            var type = TypeLoader.FlowAnalysisType(\"ControlFlowGraph\");\n            BlocksProperty = type.GetProperty(nameof(Blocks));\n            LocalFunctionsProperty = type.GetProperty(nameof(LocalFunctions));\n            OriginalOperationProperty = type.GetProperty(nameof(OriginalOperation));\n            ParentProperty = type.GetProperty(nameof(Parent));\n            RootProperty = type.GetProperty(nameof(Root));\n            CreateMethod = type.GetMethod(nameof(Create), new[] { typeof(SyntaxNode), typeof(SemanticModel), typeof(CancellationToken) });\n            GetAnonymousFunctionControlFlowGraphMethod = type.GetMethod(nameof(GetAnonymousFunctionControlFlowGraph));\n            GetLocalFunctionControlFlowGraphMethod = type.GetMethod(nameof(GetLocalFunctionControlFlowGraph));\n        }\n    }\n\n    private ControlFlowGraph(object instance)\n    {\n        this.instance = instance ?? throw new ArgumentNullException(nameof(instance));\n        Debug.Assert(EntryBlock.Kind == BasicBlockKind.Entry, \"Roslyn CFG Entry block is not the first one\");\n        Debug.Assert(ExitBlock.Kind == BasicBlockKind.Exit, \"Roslyn CFG Exit block is not the last one\");\n    }\n\n    public static ControlFlowGraph Create(SyntaxNode node, SemanticModel semanticModel, CancellationToken cancel) =>\n        IsAvailable\n            ? Wrap(CreateMethod.Invoke(null, new object[] { node, semanticModel, cancel }))\n            : throw new InvalidOperationException(\"CFG is not available under this version of Roslyn compiler.\");\n\n    public ControlFlowGraph GetAnonymousFunctionControlFlowGraph(IFlowAnonymousFunctionOperationWrapper anonymousFunction, CancellationToken cancel) =>\n        GetAnonymousFunctionControlFlowGraphMethod.Invoke(instance, new object[] { anonymousFunction.WrappedOperation, cancel }) is { } anonymousFunctionCfg\n            ? Wrap(anonymousFunctionCfg)\n            : null;\n\n    public ControlFlowGraph GetLocalFunctionControlFlowGraph(IMethodSymbol localFunction, CancellationToken cancel) =>\n        GetLocalFunctionControlFlowGraphMethod.Invoke(instance, new object[] { localFunction, cancel }) is { } localFunctionCfg\n            ? Wrap(localFunctionCfg)\n            : null;\n\n    public static ControlFlowGraph Wrap(object instance) =>\n        instance == null ? null : InstanceCache.GetValue(instance, x => new ControlFlowGraph(x));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Roslyn/ControlFlowGraphCache.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Collections.Concurrent;\nusing System.Runtime.CompilerServices;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\n\nnamespace SonarAnalyzer.CFG.Roslyn;\n\npublic abstract class ControlFlowGraphCacheBase\n{\n    // We need to cache per compilation to avoid reusing CFGs when compilation object is altered by VS configuration changes\n    private readonly ConditionalWeakTable<Compilation, ConcurrentDictionary<SyntaxNode, Wrapper>> compilationCache = new();\n\n    protected abstract bool HasNestedCfg(SyntaxNode node);\n    protected abstract bool IsLocalFunction(SyntaxNode node);\n\n    public ControlFlowGraph FindOrCreate(SyntaxNode declaration, SemanticModel model, CancellationToken cancel)\n    {\n        var cfgInputNode = declaration switch\n        {\n            IndexerDeclarationSyntax indexer => indexer.ExpressionBody,\n            PropertyDeclarationSyntax property => property.ExpressionBody,\n            _ => declaration\n        };\n\n        if (cfgInputNode is not null && model.GetOperation(cfgInputNode) is { } declarationOperation)\n        {\n            var rootSyntax = declarationOperation.RootOperation().Syntax;\n            var nodeCache = compilationCache.GetValue(model.Compilation, x => new());\n            if (!nodeCache.TryGetValue(rootSyntax, out var wrapper))\n            {\n                wrapper = new(ControlFlowGraph.Create(rootSyntax, model, cancel));\n                nodeCache[rootSyntax] = wrapper;\n            }\n            if (HasNestedCfg(cfgInputNode))\n            {\n                // We need to go up and track all possible enclosing lambdas, local functions and other FlowAnonymousFunctionOperations\n                foreach (var node in cfgInputNode.AncestorsAndSelf().TakeWhile(x => x != rootSyntax).Reverse())\n                {\n                    if (IsLocalFunction(node))\n                    {\n                        wrapper = new(wrapper.Cfg.GetLocalFunctionControlFlowGraph(node, cancel));\n                    }\n                    else if (wrapper.FlowOperation(node) is { WrappedOperation: not null } flowOperation)\n                    {\n                        wrapper = new(wrapper.Cfg.GetAnonymousFunctionControlFlowGraph(flowOperation, cancel));\n                    }\n                    else if (node == cfgInputNode)\n                    {\n                        return null;    // Lambda syntax is not always recognized as a FlowOperation for invalid syntaxes\n                    }\n                }\n            }\n            return wrapper.Cfg;\n        }\n        else\n        {\n            return null;\n        }\n    }\n\n    private sealed class Wrapper\n    {\n        private IFlowAnonymousFunctionOperationWrapper[] flowOperations;\n\n        public ControlFlowGraph Cfg { get; }\n\n        public Wrapper(ControlFlowGraph cfg) =>\n            Cfg = cfg;\n\n        public IFlowAnonymousFunctionOperationWrapper FlowOperation(SyntaxNode node)\n        {\n            flowOperations ??= Cfg.FlowAnonymousFunctionOperations().ToArray();  // Avoid recomputing, it's expensive and called many times for a single CFG\n            return flowOperations.SingleOrDefault(x => x.WrappedOperation.Syntax == node);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Roslyn/ControlFlowRegion.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Reflection;\nusing System.Runtime.CompilerServices;\n\nnamespace SonarAnalyzer.CFG.Roslyn;\n\npublic class ControlFlowRegion\n{\n    private static readonly ConditionalWeakTable<object, ControlFlowRegion> InstanceCache = new();\n    private static readonly PropertyInfo KindProperty;\n    private static readonly PropertyInfo EnclosingRegionProperty;\n    private static readonly PropertyInfo ExceptionTypeProperty;\n    private static readonly PropertyInfo FirstBlockOrdinalProperty;\n    private static readonly PropertyInfo LastBlockOrdinalProperty;\n    private static readonly PropertyInfo NestedRegionsProperty;\n    private static readonly PropertyInfo LocalsProperty;\n    private static readonly PropertyInfo LocalFunctionsProperty;\n    private static readonly PropertyInfo CaptureIdsProperty;\n\n    private readonly object instance;\n    private ControlFlowRegionKind? kind;\n    private ControlFlowRegion enclosingRegion;\n    private ITypeSymbol exceptionType;\n    private int? firstBlockOrdinal;\n    private int? lastBlockOrdinal;\n    private ImmutableArray<ControlFlowRegion> nestedRegions;\n    private ImmutableArray<ILocalSymbol> locals;\n    private ImmutableArray<IMethodSymbol> localFunctions;\n    private ImmutableArray<CaptureId> captureIds;\n\n    public ControlFlowRegionKind Kind => KindProperty.ReadCached(instance, ref kind);\n    public ControlFlowRegion EnclosingRegion => EnclosingRegionProperty.ReadCached(instance, Wrap, ref enclosingRegion);\n    public ITypeSymbol ExceptionType => ExceptionTypeProperty.ReadCached(instance, ref exceptionType);\n    public int FirstBlockOrdinal => FirstBlockOrdinalProperty.ReadCached(instance, ref firstBlockOrdinal);\n    public int LastBlockOrdinal => LastBlockOrdinalProperty.ReadCached(instance, ref lastBlockOrdinal);\n    public ImmutableArray<ControlFlowRegion> NestedRegions => NestedRegionsProperty.ReadCached(instance, Wrap, ref nestedRegions);\n    public ImmutableArray<ILocalSymbol> Locals => LocalsProperty.ReadCached(instance, ref locals);\n    public ImmutableArray<IMethodSymbol> LocalFunctions => LocalFunctionsProperty.ReadCached(instance, ref localFunctions);\n    public ImmutableArray<CaptureId> CaptureIds => CaptureIdsProperty.ReadCached(instance, x => new CaptureId(x), ref captureIds);\n\n    static ControlFlowRegion()\n    {\n        if (TypeLoader.FlowAnalysisType(\"ControlFlowRegion\") is { } type)\n        {\n            KindProperty = type.GetProperty(nameof(Kind));\n            EnclosingRegionProperty = type.GetProperty(nameof(EnclosingRegion));\n            ExceptionTypeProperty = type.GetProperty(nameof(ExceptionType));\n            FirstBlockOrdinalProperty = type.GetProperty(nameof(FirstBlockOrdinal));\n            LastBlockOrdinalProperty = type.GetProperty(nameof(LastBlockOrdinal));\n            NestedRegionsProperty = type.GetProperty(nameof(NestedRegions));\n            LocalsProperty = type.GetProperty(nameof(Locals));\n            LocalFunctionsProperty = type.GetProperty(nameof(LocalFunctions));\n            CaptureIdsProperty = type.GetProperty(nameof(CaptureIds));\n        }\n    }\n\n    private ControlFlowRegion(object instance) =>\n        this.instance = instance ?? throw new ArgumentNullException(nameof(instance));\n\n    public static ControlFlowRegion Wrap(object instance) =>\n        instance == null ? null : InstanceCache.GetValue(instance, x => new ControlFlowRegion(x));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Roslyn/TypeLoader.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CFG.Roslyn;\n\ninternal static class TypeLoader\n{\n    public static Type FlowAnalysisType(string typeName) =>\n        typeof(SemanticModel).Assembly.GetType(\"Microsoft.CodeAnalysis.FlowAnalysis.\" + typeName);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Sonar/AbstractControlFlowGraphBuilder.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CFG.Sonar\n{\n    public abstract class AbstractControlFlowGraphBuilder\n    {\n        private class ControlFlowGraph : IControlFlowGraph\n        {\n            private static readonly ISet<Type> RemovableBlockTypes = new HashSet<Type>\n            {\n                   typeof(SimpleBlock),\n                   typeof(TemporaryBlock)\n            };\n\n            public ControlFlowGraph(List<Block> reversedBlocks, Block entryBlock, ExitBlock exitBlock)\n            {\n                ExitBlock = exitBlock;\n                EntryBlock = RemoveEmptyBlocks(reversedBlocks, entryBlock);\n\n                Blocks = reversedBlocks.Reverse<Block>().ToImmutableArray();\n\n                if (Blocks.OfType<TemporaryBlock>().Any())\n                {\n                    throw new InvalidOperationException(\"Could not construct valid control flow graph\");\n                }\n\n                ComputePredecessors();\n            }\n\n            public IEnumerable<Block> Blocks { get; private set; }\n\n            public Block EntryBlock { get; private set; }\n\n            public ExitBlock ExitBlock { get; private set; }\n\n            private static Block RemoveEmptyBlocks(List<Block> reversedBlocks, Block entryBlock)\n            {\n                var emptyBlockReplacements = new Dictionary<Block, Block>();\n                var emptyBlocks = reversedBlocks.Where(b =>\n                    RemovableBlockTypes.Contains(b.GetType()) &&\n                    !b.ReversedInstructions.Any());\n\n                foreach (var block in emptyBlocks)\n                {\n                    var replacementBlock = block.GetPossibleNonEmptySuccessorBlock();\n                    if (replacementBlock != block)\n                    {\n                        emptyBlockReplacements.Add(block, replacementBlock);\n                    }\n                }\n\n                // Remove empty blocks\n                reversedBlocks.RemoveAll(b => emptyBlockReplacements.Keys.Contains(b));\n\n                // Replace successors\n                foreach (var block in reversedBlocks)\n                {\n                    block.ReplaceSuccessors(emptyBlockReplacements);\n                }\n\n                // Fix entry block\n                var newEntryBlock = entryBlock;\n                if (emptyBlockReplacements.ContainsKey(entryBlock))\n                {\n                    newEntryBlock = emptyBlockReplacements[entryBlock];\n                }\n\n                return newEntryBlock;\n            }\n\n            private void ComputePredecessors()\n            {\n                foreach (var block in Blocks)\n                {\n                    foreach (var successor in block.SuccessorBlocks)\n                    {\n                        successor.EditablePredecessorBlocks.Add(block);\n                    }\n                }\n            }\n        }\n\n        protected readonly SyntaxNode rootNode;\n        protected readonly SemanticModel semanticModel;\n        protected readonly List<Block> reversedBlocks = new List<Block>();\n        protected readonly Stack<Block> exitTarget = new Stack<Block>();\n\n        protected AbstractControlFlowGraphBuilder(SyntaxNode node, SemanticModel semanticModel)\n        {\n            this.rootNode = node ?? throw new ArgumentNullException(nameof(node));\n            this.semanticModel = semanticModel ?? throw new ArgumentNullException(nameof(semanticModel));\n\n            this.exitTarget.Push(CreateExitBlock());\n        }\n\n        protected abstract void PostProcessGraph();\n\n        public IControlFlowGraph Build()\n        {\n            var entryBlock = Build(this.rootNode, CreateBlock(this.exitTarget.Peek()));\n            PostProcessGraph();\n\n            return new ControlFlowGraph(this.reversedBlocks, entryBlock, (ExitBlock)this.exitTarget.Pop());\n        }\n\n        protected abstract Block Build(SyntaxNode node, Block currentBlock);\n\n        #region CreateBlock*\n\n        internal BinaryBranchBlock CreateBinaryBranchBlock(SyntaxNode branchingNode, Block trueSuccessor, Block falseSuccessor) =>\n            AddBlock(new BinaryBranchBlock(branchingNode, trueSuccessor, falseSuccessor));\n\n        internal SimpleBlock CreateBlock(Block successor) =>\n            AddBlock(new SimpleBlock(successor));\n\n        internal JumpBlock CreateJumpBlock(SyntaxNode jumpStatement, Block successor, Block wouldBeSuccessor = null) =>\n            AddBlock(new JumpBlock(jumpStatement, successor, wouldBeSuccessor));\n\n        internal BranchBlock CreateBranchBlock(SyntaxNode branchingNode, IEnumerable<Block> successors) =>\n            AddBlock(new BranchBlock(branchingNode, successors.ToArray()));\n\n        private ExitBlock CreateExitBlock() => AddBlock(new ExitBlock());\n\n        internal TemporaryBlock CreateTemporaryBlock() => AddBlock(new TemporaryBlock());\n\n        internal T AddBlock<T>(T block)\n            where T : Block\n        {\n            this.reversedBlocks.Add(block);\n            return block;\n        }\n\n        #endregion CreateBlock*\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Sonar/BlockIdProvider.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CFG.Sonar\n{\n    public  class BlockIdProvider\n    {\n        private readonly Dictionary<Block, string> map = new Dictionary<Block, string>();\n        private int counter;\n\n        public string Get(Block cfgBlock) =>\n            this.map.GetOrAdd(cfgBlock, b => $\"{this.counter++}\");\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Sonar/Blocks/BinaryBranchBlock.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CFG.Sonar\n{\n    public class BinaryBranchBlock : BranchBlock\n    {\n        internal BinaryBranchBlock(SyntaxNode branchingNode, Block trueSuccessor, Block falseSuccessor)\n            : base(branchingNode, trueSuccessor, falseSuccessor)\n        {\n            if (trueSuccessor == null)\n            {\n                throw new ArgumentNullException(nameof(trueSuccessor));\n            }\n\n            if (falseSuccessor == null)\n            {\n                throw new ArgumentNullException(nameof(falseSuccessor));\n            }\n        }\n\n        public Block TrueSuccessorBlock => this.successors[0];\n\n        public Block FalseSuccessorBlock => this.successors[1];\n\n        public SyntaxNode Parent => BranchingNode.Parent;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Sonar/Blocks/BinaryBranchingSimpleBlock.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CFG.Sonar\n{\n    public sealed class BinaryBranchingSimpleBlock : SimpleBlock\n    {\n        internal BinaryBranchingSimpleBlock(SyntaxNode branchingInstruction, Block trueAndFalseSuccessor)\n            : base(trueAndFalseSuccessor)\n        {\n            BranchingInstruction = branchingInstruction;\n        }\n\n        public SyntaxNode BranchingInstruction { get; }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Sonar/Blocks/Block.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CFG.Sonar\n{\n    /// <summary>\n    /// Basic building blocks of a Control Flow Graph (<see cref=\"IControlFlowGraph\"/>).\n    /// Holds a list of instructions which have no jumps between them.\n    /// </summary>\n    public class Block\n    {\n        private readonly Lazy<IReadOnlyList<SyntaxNode>> instructions;\n        private readonly Lazy<IReadOnlyCollection<Block>> predecessorBlocks;\n        private readonly Lazy<ISet<Block>> allSuccessors;\n        private readonly Lazy<ISet<Block>> allPredecessors;\n\n        // Protected to allow extending and mocking\n        protected Block()\n        {\n            this.instructions = new Lazy<IReadOnlyList<SyntaxNode>>(() => ReversedInstructions.Reverse().ToImmutableArray());\n            this.predecessorBlocks = new Lazy<IReadOnlyCollection<Block>>(() => EditablePredecessorBlocks.ToImmutableHashSet());\n            this.allSuccessors = new Lazy<ISet<Block>>(() => GetAll(this, b => b.SuccessorBlocks));\n            this.allPredecessors = new Lazy<ISet<Block>>(() => GetAll(this, b => b.PredecessorBlocks));\n        }\n\n        public virtual IReadOnlyList<SyntaxNode> Instructions => this.instructions.Value;\n\n        public virtual IReadOnlyCollection<Block> PredecessorBlocks => this.predecessorBlocks.Value;\n\n        public virtual IReadOnlyList<Block> SuccessorBlocks { get; } = ImmutableArray.Create<Block>();\n\n        internal IList<SyntaxNode> ReversedInstructions { get; } = new List<SyntaxNode>();\n\n        internal ISet<Block> EditablePredecessorBlocks { get; } = new HashSet<Block>();\n\n        internal virtual Block GetPossibleNonEmptySuccessorBlock()\n        {\n            return this;\n        }\n\n        internal virtual void ReplaceSuccessors(Dictionary<Block, Block> replacementMapping)\n        {\n        }\n\n        public ISet<Block> AllSuccessorBlocks => this.allSuccessors.Value;\n\n        public ISet<Block> AllPredecessorBlocks => this.allPredecessors.Value;\n\n        private static ISet<Block> GetAll(Block initial, Func<Block, IEnumerable<Block>> getNexts)\n        {\n            var toProcess = new Queue<Block>();\n            var alreadyProcesses = new HashSet<Block>();\n            getNexts(initial).ToList().ForEach(b => toProcess.Enqueue(b));\n            while (toProcess.Count != 0)\n            {\n                var current = toProcess.Dequeue();\n                if (alreadyProcesses.Contains(current))\n                {\n                    continue;\n                }\n\n                alreadyProcesses.Add(current);\n\n                getNexts(current).ToList().ForEach(b => toProcess.Enqueue(b));\n            }\n\n            return alreadyProcesses.ToHashSet();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Sonar/Blocks/BranchBlock.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CFG.Sonar\n{\n    public class BranchBlock : Block\n    {\n        internal BranchBlock(SyntaxNode branchingNode, params Block[] successors)\n        {\n            this.successors = successors ?? throw new ArgumentNullException(nameof(successors));\n            BranchingNode = branchingNode ?? throw new ArgumentNullException(nameof(branchingNode));\n        }\n\n        public SyntaxNode BranchingNode { get; }\n\n        protected readonly Block[] successors;\n\n        public override IReadOnlyList<Block> SuccessorBlocks => ImmutableArray.Create(this.successors);\n\n        internal override void ReplaceSuccessors(Dictionary<Block, Block> replacementMapping)\n        {\n            for (var i = 0; i < this.successors.Length; i++)\n            {\n                if (replacementMapping.ContainsKey(this.successors[i]))\n                {\n                    this.successors[i] = replacementMapping[this.successors[i]];\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Sonar/Blocks/ExitBlock.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CFG.Sonar\n{\n    public sealed class ExitBlock : Block\n    {\n        internal ExitBlock()\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Sonar/Blocks/ForInitializerBlock.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\n\nnamespace SonarAnalyzer.CFG.Sonar\n{\n    public sealed class ForInitializerBlock : SimpleBlock\n    {\n        internal ForInitializerBlock(ForStatementSyntax forNode, Block successor)\n            : base(successor)\n        {\n            ForNode = forNode ?? throw new ArgumentNullException(nameof(forNode));\n        }\n\n        public ForStatementSyntax ForNode { get; }\n\n        internal override Block GetPossibleNonEmptySuccessorBlock()\n        {\n            // This block can't be removed by the CFG simplification, unlike the base class SimpleBlock\n            return this;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Sonar/Blocks/ForeachCollectionProducerBlock.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\n\nnamespace SonarAnalyzer.CFG.Sonar\n{\n    public sealed class ForeachCollectionProducerBlock : SimpleBlock\n    {\n        internal ForeachCollectionProducerBlock(StatementSyntax foreachNode, Block successor)\n            : base(successor)\n        {\n            ForeachNode = foreachNode ?? throw new ArgumentNullException(nameof(foreachNode));\n        }\n\n        public StatementSyntax ForeachNode { get; }\n\n        internal override Block GetPossibleNonEmptySuccessorBlock()\n        {\n            // This block can't be removed by the CFG simplification, unlike the base class SimpleBlock\n            return this;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Sonar/Blocks/JumpBlock.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CFG.Sonar\n{\n    public sealed class JumpBlock : SimpleBlock\n    {\n        internal JumpBlock(SyntaxNode jumpNode, Block successor, Block wouldBeSuccessor)\n            : base(successor)\n        {\n            JumpNode = jumpNode ?? throw new ArgumentNullException(nameof(jumpNode));\n            WouldBeSuccessor = wouldBeSuccessor;\n        }\n\n        public SyntaxNode JumpNode { get; }\n\n        /// <summary>\n        /// If there was no jump, this block would be the successor.\n        /// It can be null, when it doesn't make sense. For example in case of lock statements.\n        /// </summary>\n        public Block WouldBeSuccessor { get; private set; }\n\n        internal override Block GetPossibleNonEmptySuccessorBlock()\n        {\n            // JumpBlock can't be removed by the CFG simplification, unlike the base class SimpleBlock\n            return this;\n        }\n\n        internal override void ReplaceSuccessors(Dictionary<Block, Block> replacementMapping)\n        {\n            base.ReplaceSuccessors(replacementMapping);\n\n            if (WouldBeSuccessor != null && replacementMapping.ContainsKey(WouldBeSuccessor))\n            {\n                WouldBeSuccessor = replacementMapping[WouldBeSuccessor];\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Sonar/Blocks/LockBlock.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\n\nnamespace SonarAnalyzer.CFG.Sonar\n{\n    public class LockBlock : SimpleBlock\n    {\n        public LockBlock(LockStatementSyntax lockNode, Block successor)\n            : base(successor)\n        {\n            LockNode = lockNode ?? throw new ArgumentNullException(nameof(lockNode));\n        }\n\n        public LockStatementSyntax LockNode { get; }\n\n        internal override Block GetPossibleNonEmptySuccessorBlock()\n        {\n            // This block can't be removed by the CFG simplification, unlike the base class SimpleBlock\n            return this;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Sonar/Blocks/SimpleBlock.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CFG.Sonar\n{\n    public class SimpleBlock : Block\n    {\n        internal SimpleBlock(Block successor)\n        {\n            SuccessorBlock = successor ?? throw new ArgumentNullException(nameof(successor));\n        }\n\n        public Block SuccessorBlock { get; internal set; }\n\n        public override IReadOnlyList<Block> SuccessorBlocks => ImmutableArray.Create(SuccessorBlock);\n\n        internal override void ReplaceSuccessors(Dictionary<Block, Block> replacementMapping)\n        {\n            if (replacementMapping.ContainsKey(SuccessorBlock))\n            {\n                SuccessorBlock = replacementMapping[SuccessorBlock];\n            }\n        }\n\n        internal override Block GetPossibleNonEmptySuccessorBlock()\n        {\n            if (ReversedInstructions.Any())\n            {\n                return this;\n            }\n\n            return SuccessorBlock.GetPossibleNonEmptySuccessorBlock();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Sonar/Blocks/TemporaryBlock.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CFG.Sonar\n{\n    public sealed class TemporaryBlock : Block\n    {\n        public Block SuccessorBlock { get; set; }\n\n        public override IReadOnlyList<Block> SuccessorBlocks => ImmutableArray.Create(SuccessorBlock);\n\n        internal override Block GetPossibleNonEmptySuccessorBlock()\n        {\n            if (SuccessorBlock == null)\n            {\n                throw new InvalidOperationException($\"{nameof(SuccessorBlock)} is null\");\n            }\n\n            return SuccessorBlock.GetPossibleNonEmptySuccessorBlock();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Sonar/Blocks/UsingEndBlock.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\n\nnamespace SonarAnalyzer.CFG.Sonar\n{\n    public class UsingEndBlock : SimpleBlock\n    {\n        public UsingStatementSyntax UsingStatement { get; }\n        public IEnumerable<SyntaxToken> Identifiers { get; }\n\n        public UsingEndBlock(UsingStatementSyntax usingStatement, Block successor)\n            : base(successor)\n        {\n            UsingStatement = usingStatement;\n\n            Identifiers = usingStatement.Declaration != null\n                ? GetIdentifiers(usingStatement.Declaration)\n                : GetIdentifiers(usingStatement.Expression);\n        }\n\n        private static IEnumerable<SyntaxToken> GetIdentifiers(VariableDeclarationSyntax declaration)\n        {\n            return declaration.Variables\n                .Select(v => v.Identifier)\n                .ToImmutableArray();\n        }\n\n        private static IEnumerable<SyntaxToken> GetIdentifiers(ExpressionSyntax expression)\n        {\n            return expression.RemoveParentheses() is IdentifierNameSyntax identifier ? ImmutableArray.Create(identifier.Identifier)\n                : expression.DescendantNodesAndSelf()\n                    .OfType<AssignmentExpressionSyntax>()\n                    .Select(a => a.Left)\n                    .OfType<IdentifierNameSyntax>()\n                    .Select(i => i.Identifier)\n                    .ToImmutableArray();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Sonar/CSharpControlFlowGraph.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\n\nnamespace SonarAnalyzer.CFG.Sonar\n{\n    public static class CSharpControlFlowGraph\n    {\n        public static bool TryGet(SyntaxNode node, SemanticModel semanticModel, out IControlFlowGraph cfg)\n        {\n            cfg = null;\n            var body = node switch\n            {\n                BaseMethodDeclarationSyntax n => (SyntaxNode)n.Body ?? n.ExpressionBody(),\n                PropertyDeclarationSyntax n => n.ExpressionBody?.Expression,\n                IndexerDeclarationSyntax n => n.ExpressionBody?.Expression,\n                AccessorDeclarationSyntax n => (SyntaxNode)n.Body ?? n.ExpressionBody,\n                AnonymousFunctionExpressionSyntax n => n.Body,\n                ArrowExpressionClauseSyntax n => n,\n                _ when node.IsKind(SyntaxKindEx.LocalFunctionStatement) && (LocalFunctionStatementSyntaxWrapper)node is var local => (SyntaxNode)local.Body ?? local.ExpressionBody,\n                _ => null\n            };\n            try\n            {\n                if (body is not null)\n                {\n                    cfg = Create(body, semanticModel);\n                }\n                else\n                {\n                    return false;\n                }\n            }\n            catch (Exception exc) when (exc is InvalidOperationException ||\n                                        exc is ArgumentException ||\n                                        exc is NotSupportedException)\n            {\n                // historically, these have been considered as expected\n                // but we should be aware of what syntax we do not yet support\n                // https://github.com/SonarSource/sonar-dotnet/issues/2541\n            }\n            catch (Exception exc) when (exc is NotImplementedException)\n            {\n                Debug.Fail(exc.ToString());\n            }\n\n            return cfg != null;\n        }\n\n        internal /* for testing */ static IControlFlowGraph Create(SyntaxNode node, SemanticModel semanticModel) =>\n            new CSharpControlFlowGraphBuilder(node, semanticModel).Build();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Sonar/CSharpControlFlowGraphBuilder.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\n\nnamespace SonarAnalyzer.CFG.Sonar\n{\n    public sealed class CSharpControlFlowGraphBuilder : AbstractControlFlowGraphBuilder\n    {\n        private const int SupportedExpressionNodeCountLimit = 500;\n\n        private readonly Stack<Block> breakTarget = new Stack<Block>();\n        private readonly Stack<Block> continueTargets = new Stack<Block>();\n        private readonly Stack<Dictionary<object, List<JumpBlock>>> switchGotoJumpBlocks = new Stack<Dictionary<object, List<JumpBlock>>>();\n        private readonly Dictionary<string, List<JumpBlock>> gotoJumpBlocks = new Dictionary<string, List<JumpBlock>>();\n        private readonly Dictionary<string, JumpBlock> labeledStatements = new Dictionary<string, JumpBlock>();\n        private static readonly object GotoDefaultEntry = new object();\n        private static readonly object GotoNullEntry = new object();\n\n        public CSharpControlFlowGraphBuilder(SyntaxNode node, SemanticModel semanticModel)\n            : base(node, semanticModel)\n        {\n        }\n\n        #region Fix jump statements\n\n        protected override void PostProcessGraph()\n        {\n            FixJumps(this.gotoJumpBlocks, this.labeledStatements.ToDictionary(e => e.Key, e => (Block)e.Value));\n        }\n\n        private void FixJumps<TLabel>(Dictionary<TLabel, List<JumpBlock>> jumpsToFix,\n            Dictionary<TLabel, Block> collectedJumpTargets)\n        {\n            foreach (var jumpToFix in jumpsToFix)\n            {\n                if (!collectedJumpTargets.ContainsKey(jumpToFix.Key))\n                {\n                    throw new InvalidOperationException(\"Jump to non-existent location\");\n                }\n\n                foreach (var jumpBlock in jumpToFix.Value)\n                {\n                    reversedBlocks.Remove(jumpBlock.SuccessorBlock);\n                    jumpBlock.SuccessorBlock = collectedJumpTargets[jumpToFix.Key];\n                }\n            }\n        }\n\n        #endregion Fix jump statements\n\n        #region Top level Build*\n\n        protected override Block Build(SyntaxNode node, Block currentBlock)\n        {\n            Block block = null;\n            if (node is StatementSyntax statement)\n            {\n                block = BuildStatement(statement, currentBlock);\n            }\n            else if (node is ArrowExpressionClauseSyntax arrowExpression)\n            {\n                block = BuildExpression(arrowExpression.Expression, currentBlock);\n            }\n            else if (node is ExpressionSyntax expression)\n            {\n                block = BuildExpression(expression, currentBlock);\n            }\n\n            if (block == null)\n            {\n                throw new ArgumentException(\"Neither a statement, nor an expression\", nameof(node));\n            }\n\n            if (node.Parent is ConstructorDeclarationSyntax constructorDeclaration &&\n                constructorDeclaration.Initializer != null)\n            {\n                block = BuildConstructorInitializer(constructorDeclaration.Initializer, block);\n            }\n\n            return block;\n        }\n\n        private Block BuildConstructorInitializer(ConstructorInitializerSyntax initializer, Block currentBlock)\n        {\n            currentBlock.ReversedInstructions.Add(initializer);\n\n            var arguments = initializer.ArgumentList == null\n                ? Enumerable.Empty<ExpressionSyntax>()\n                : initializer.ArgumentList.Arguments.Select(a => a.Expression);\n\n            return BuildExpressions(arguments, currentBlock);\n        }\n\n        private Block BuildStatement(StatementSyntax statement, Block currentBlock)\n        {\n            switch (statement.Kind())\n            {\n                case SyntaxKind.Block:\n                    return BuildBlock((BlockSyntax)statement, currentBlock);\n\n                case SyntaxKind.ExpressionStatement:\n                    return BuildExpression(((ExpressionStatementSyntax)statement).Expression, currentBlock);\n\n                case SyntaxKind.LocalDeclarationStatement:\n                    return BuildVariableDeclaration(((LocalDeclarationStatementSyntax)statement).Declaration,\n                        currentBlock);\n\n                case SyntaxKind.IfStatement:\n                    return BuildIfStatement((IfStatementSyntax)statement, currentBlock);\n\n                case SyntaxKind.WhileStatement:\n                    return BuildWhileStatement((WhileStatementSyntax)statement, currentBlock);\n\n                case SyntaxKind.DoStatement:\n                    return BuildDoStatement((DoStatementSyntax)statement, currentBlock);\n\n                case SyntaxKind.ForStatement:\n                    return BuildForStatement((ForStatementSyntax)statement, currentBlock);\n\n                case SyntaxKind.ForEachStatement:\n                    return BuildForEachStatement((ForEachStatementSyntax)statement, currentBlock);\n\n                case SyntaxKindEx.ForEachVariableStatement:\n                    return BuildForEachVariableStatement((ForEachVariableStatementSyntaxWrapper)statement, currentBlock);\n\n                case SyntaxKind.LockStatement:\n                    return BuildLockStatement((LockStatementSyntax)statement, currentBlock);\n\n                case SyntaxKind.UsingStatement:\n                    return BuildUsingStatement((UsingStatementSyntax)statement, currentBlock);\n\n                case SyntaxKind.FixedStatement:\n                    return BuildFixedStatement((FixedStatementSyntax)statement, currentBlock);\n\n                case SyntaxKind.UncheckedStatement:\n                case SyntaxKind.CheckedStatement:\n                    return BuildCheckedStatement((CheckedStatementSyntax)statement, currentBlock);\n\n                case SyntaxKind.UnsafeStatement:\n                    return BuildUnsafeStatement((UnsafeStatementSyntax)statement, currentBlock);\n\n                case SyntaxKind.ReturnStatement:\n                    return BuildReturnStatement((ReturnStatementSyntax)statement, currentBlock);\n\n                case SyntaxKind.YieldBreakStatement:\n                    return BuildYieldBreakStatement((YieldStatementSyntax)statement, currentBlock);\n\n                case SyntaxKind.ThrowStatement:\n                    return BuildThrowStatement((ThrowStatementSyntax)statement, currentBlock);\n\n                case SyntaxKind.YieldReturnStatement:\n                    return BuildYieldReturnStatement((YieldStatementSyntax)statement, currentBlock);\n\n                case SyntaxKind.EmptyStatement:\n                    return currentBlock;\n\n                case SyntaxKind.BreakStatement:\n                    return BuildBreakStatement((BreakStatementSyntax)statement, currentBlock);\n\n                case SyntaxKind.ContinueStatement:\n                    return BuildContinueStatement((ContinueStatementSyntax)statement, currentBlock);\n\n                case SyntaxKind.SwitchStatement:\n                    return BuildSwitchStatement((SwitchStatementSyntax)statement, currentBlock);\n\n                case SyntaxKind.GotoCaseStatement:\n                    return BuildGotoCaseStatement((GotoStatementSyntax)statement, currentBlock);\n\n                case SyntaxKind.GotoDefaultStatement:\n                    return BuildGotoDefaultStatement((GotoStatementSyntax)statement, currentBlock);\n\n                case SyntaxKind.GotoStatement:\n                    return BuildGotoStatement((GotoStatementSyntax)statement, currentBlock);\n\n                case SyntaxKind.LabeledStatement:\n                    return BuildLabeledStatement((LabeledStatementSyntax)statement, currentBlock);\n\n                case SyntaxKind.TryStatement:\n                    return BuildTryStatement((TryStatementSyntax)statement, currentBlock);\n\n                case SyntaxKindEx.LocalFunctionStatement:\n                    return currentBlock;\n\n                case SyntaxKind.GlobalStatement:\n                    throw new NotSupportedException($\"{statement.Kind()}\");\n\n                default:\n                    throw new NotSupportedException($\"{statement.Kind()}\");\n            }\n        }\n\n        private Block BuildExpression(ExpressionSyntax expression, Block currentBlock)\n        {\n            if (expression == null)\n            {\n                return currentBlock;\n            }\n            if (IsTooComplex(expression))\n            {\n                throw new NotSupportedException(\"Too complex expression\");\n            }\n\n            switch (expression.Kind())\n            {\n                case SyntaxKind.SimpleAssignmentExpression:\n                    return BuildSimpleAssignmentExpression((AssignmentExpressionSyntax)expression, currentBlock);\n\n                case SyntaxKindEx.CoalesceAssignmentExpression:\n                    return BuildCoalesceAssignmentExpression((AssignmentExpressionSyntax)expression, currentBlock);\n\n                case SyntaxKind.OrAssignmentExpression:\n                case SyntaxKind.AndAssignmentExpression:\n                case SyntaxKind.ExclusiveOrAssignmentExpression:\n\n                case SyntaxKind.SubtractAssignmentExpression:\n                case SyntaxKind.AddAssignmentExpression:\n                case SyntaxKind.DivideAssignmentExpression:\n                case SyntaxKind.MultiplyAssignmentExpression:\n                case SyntaxKind.ModuloAssignmentExpression:\n\n                case SyntaxKind.LeftShiftAssignmentExpression:\n                case SyntaxKind.RightShiftAssignmentExpression:\n                    return BuildAssignmentExpression((AssignmentExpressionSyntax)expression, currentBlock);\n\n                case SyntaxKind.LessThanExpression:\n                case SyntaxKind.LessThanOrEqualExpression:\n                case SyntaxKind.GreaterThanExpression:\n                case SyntaxKind.GreaterThanOrEqualExpression:\n                case SyntaxKind.EqualsExpression:\n                case SyntaxKind.NotEqualsExpression:\n\n                case SyntaxKind.BitwiseOrExpression:\n                case SyntaxKind.BitwiseAndExpression:\n                case SyntaxKind.ExclusiveOrExpression:\n\n                case SyntaxKind.SubtractExpression:\n                case SyntaxKind.AddExpression:\n                case SyntaxKind.DivideExpression:\n                case SyntaxKind.MultiplyExpression:\n                case SyntaxKind.ModuloExpression:\n\n                case SyntaxKind.LeftShiftExpression:\n                case SyntaxKind.RightShiftExpression:\n                    return BuildBinaryExpression((BinaryExpressionSyntax)expression, currentBlock);\n\n                case SyntaxKind.LogicalNotExpression:\n                case SyntaxKind.BitwiseNotExpression:\n                case SyntaxKind.UnaryMinusExpression:\n                case SyntaxKind.UnaryPlusExpression:\n                case SyntaxKind.PreIncrementExpression:\n                case SyntaxKind.PreDecrementExpression:\n                case SyntaxKind.AddressOfExpression:\n                case SyntaxKind.PointerIndirectionExpression:\n                    {\n                        var parent = (PrefixUnaryExpressionSyntax)expression;\n                        return BuildSimpleNestedExpression(parent, currentBlock, parent.Operand);\n                    }\n\n                case SyntaxKind.PostIncrementExpression:\n                case SyntaxKind.PostDecrementExpression:\n                    {\n                        var parent = (PostfixUnaryExpressionSyntax)expression;\n                        return BuildSimpleNestedExpression(parent, currentBlock, parent.Operand);\n                    }\n\n                case SyntaxKind.IdentifierName:\n                case SyntaxKind.GenericName:\n                case SyntaxKind.AliasQualifiedName:\n                case SyntaxKind.QualifiedName:\n                case SyntaxKind.CharacterLiteralExpression:\n                case SyntaxKind.StringLiteralExpression:\n                case SyntaxKind.NumericLiteralExpression:\n                case SyntaxKind.TrueLiteralExpression:\n                case SyntaxKind.FalseLiteralExpression:\n                case SyntaxKind.NullLiteralExpression:\n                case SyntaxKind.ThisExpression:\n                case SyntaxKind.BaseExpression:\n\n                case SyntaxKind.DefaultExpression:\n                case SyntaxKindEx.DefaultLiteralExpression:\n                case SyntaxKind.SizeOfExpression:\n                case SyntaxKind.TypeOfExpression:\n\n                case SyntaxKind.PredefinedType:\n                case SyntaxKind.NullableType:\n\n                case SyntaxKind.OmittedArraySizeExpression:\n\n                case SyntaxKind.AnonymousMethodExpression:\n                case SyntaxKind.ParenthesizedLambdaExpression:\n                case SyntaxKind.SimpleLambdaExpression:\n                case SyntaxKind.QueryExpression:\n\n                case SyntaxKind.ArgListExpression:\n                case SyntaxKindEx.RangeExpression:\n                case SyntaxKindEx.IndexExpression:\n                    currentBlock.ReversedInstructions.Add(expression);\n                    return currentBlock;\n\n                case SyntaxKind.PointerType:\n                    return BuildExpression(((PointerTypeSyntax)expression).ElementType, currentBlock);\n\n                case SyntaxKind.ParenthesizedExpression:\n                    return BuildExpression(((ParenthesizedExpressionSyntax)expression).Expression, currentBlock);\n\n                case SyntaxKind.AwaitExpression:\n                    {\n                        var parent = (AwaitExpressionSyntax)expression;\n                        return BuildSimpleNestedExpression(parent, currentBlock, parent.Expression);\n                    }\n\n                case SyntaxKind.CheckedExpression:\n                case SyntaxKind.UncheckedExpression:\n                    {\n                        var parent = (CheckedExpressionSyntax)expression;\n                        return BuildSimpleNestedExpression(parent, currentBlock, parent.Expression);\n                    }\n\n                case SyntaxKind.AsExpression:\n                case SyntaxKind.IsExpression:\n                    {\n                        var parent = (BinaryExpressionSyntax)expression;\n                        return BuildSimpleNestedExpression(parent, currentBlock, parent.Left);\n                    }\n\n                case SyntaxKind.CastExpression:\n                    {\n                        var parent = (CastExpressionSyntax)expression;\n                        return BuildSimpleNestedExpression(parent, currentBlock, parent.Expression);\n                    }\n\n                case SyntaxKind.InterpolatedStringExpression:\n                    return BuildInterpolatedStringExpression((InterpolatedStringExpressionSyntax)expression,\n                        currentBlock);\n\n                case SyntaxKind.InvocationExpression:\n                    return BuildInvocationExpression((InvocationExpressionSyntax)expression, currentBlock);\n\n                case SyntaxKind.AnonymousObjectCreationExpression:\n                    return BuildAnonymousObjectCreationExpression((AnonymousObjectCreationExpressionSyntax)expression,\n                        currentBlock);\n\n                case SyntaxKind.ObjectCreationExpression:\n                    return BuildObjectCreationExpression((ObjectCreationExpressionSyntax)expression, currentBlock);\n\n                case SyntaxKind.ElementAccessExpression:\n                    return BuildElementAccessExpression((ElementAccessExpressionSyntax)expression, currentBlock);\n\n                case SyntaxKind.ImplicitElementAccess:\n                    return BuildImplicitElementAccessExpression((ImplicitElementAccessSyntax)expression, currentBlock);\n\n                case SyntaxKind.LogicalAndExpression:\n                    return BuildLogicalAndExpression((BinaryExpressionSyntax)expression, currentBlock);\n\n                case SyntaxKind.LogicalOrExpression:\n                    return BuildLogicalOrExpression((BinaryExpressionSyntax)expression, currentBlock);\n\n                case SyntaxKind.ArrayCreationExpression:\n                    return BuildArrayCreationExpression((ArrayCreationExpressionSyntax)expression, currentBlock);\n\n                case SyntaxKind.ImplicitArrayCreationExpression:\n                    {\n                        var parent = (ImplicitArrayCreationExpressionSyntax)expression;\n\n                        var initializerBlock = BuildExpression(parent.Initializer, currentBlock);\n                        initializerBlock.ReversedInstructions.Add(parent);\n                        return initializerBlock;\n                    }\n\n                case SyntaxKind.StackAllocArrayCreationExpression:\n                    {\n                        var parent = (StackAllocArrayCreationExpressionSyntax)expression;\n                        return BuildSimpleNestedExpression(parent, currentBlock, parent.Type, parent.Initializer);\n                    }\n\n                case SyntaxKindEx.ImplicitStackAllocArrayCreationExpression:\n                    {\n                        var parent = (ImplicitStackAllocArrayCreationExpressionSyntaxWrapper)expression;\n                        return BuildSimpleNestedExpression(parent, currentBlock, parent.Initializer);\n                    }\n\n                case SyntaxKind.SimpleMemberAccessExpression:\n                case SyntaxKind.PointerMemberAccessExpression:\n                    {\n                        var parent = (MemberAccessExpressionSyntax)expression;\n                        return BuildSimpleNestedExpression(parent, currentBlock, parent.Expression);\n                    }\n\n                case SyntaxKind.ObjectInitializerExpression:\n                case SyntaxKind.ArrayInitializerExpression:\n                case SyntaxKind.CollectionInitializerExpression:\n                case SyntaxKind.ComplexElementInitializerExpression:\n                    {\n                        var parent = (InitializerExpressionSyntax)expression;\n                        return BuildSimpleNestedExpression(parent, currentBlock, parent.Expressions);\n                    }\n\n                case SyntaxKind.MakeRefExpression:\n                    {\n                        var parent = (MakeRefExpressionSyntax)expression;\n                        return BuildSimpleNestedExpression(parent, currentBlock, parent.Expression);\n                    }\n\n                case SyntaxKind.RefTypeExpression:\n                    {\n                        var parent = (RefTypeExpressionSyntax)expression;\n                        return BuildSimpleNestedExpression(parent, currentBlock, parent.Expression);\n                    }\n\n                case SyntaxKind.RefValueExpression:\n                    {\n                        var parent = (RefValueExpressionSyntax)expression;\n                        return BuildSimpleNestedExpression(parent, currentBlock, parent.Expression);\n                    }\n\n                case SyntaxKind.ArrayType:\n                    return BuildArrayType((ArrayTypeSyntax)expression, currentBlock);\n\n                case SyntaxKind.CoalesceExpression:\n                    return BuildCoalesceExpression((BinaryExpressionSyntax)expression, currentBlock);\n\n                case SyntaxKind.ConditionalExpression:\n                    return BuildConditionalExpression((ConditionalExpressionSyntax)expression, currentBlock);\n\n                // these look strange in the CFG:\n                case SyntaxKind.ConditionalAccessExpression:\n                    return BuildConditionalAccessExpression((ConditionalAccessExpressionSyntax)expression, currentBlock);\n\n                case SyntaxKind.MemberBindingExpression:\n                    {\n                        var parent = (MemberBindingExpressionSyntax)expression;\n                        return BuildSimpleNestedExpression(parent, currentBlock, parent.Name);\n                    }\n\n                case SyntaxKind.ElementBindingExpression:\n                    {\n                        var parent = (ElementBindingExpressionSyntax)expression;\n                        return BuildSimpleNestedExpression(parent, currentBlock,\n                            parent.ArgumentList?.Arguments.Select(a => a.Expression));\n                    }\n\n                case SyntaxKindEx.IsPatternExpression:\n                    var isPatternExpression = (IsPatternExpressionSyntaxWrapper)expression;\n\n                    currentBlock = BuildIsPatternExpression(isPatternExpression, currentBlock);\n\n                    return BuildExpression(isPatternExpression.Expression, currentBlock);\n\n                case SyntaxKindEx.ThrowExpression:\n\n                    var throwExpression = (ThrowExpressionSyntaxWrapper)expression;\n                    return BuildJumpToExitStatement(throwExpression, currentBlock, throwExpression.Expression);\n\n                case SyntaxKindEx.DeclarationExpression:\n                    currentBlock.ReversedInstructions.Add(expression);\n                    return currentBlock;\n\n                case SyntaxKindEx.RefExpression:\n                    {\n                        var parent = (RefExpressionSyntaxWrapper)expression;\n                        return BuildSimpleNestedExpression(parent, currentBlock, parent.Expression);\n                    }\n\n                case SyntaxKindEx.SwitchExpression:\n                    return BuildSwitchExpression((SwitchExpressionSyntaxWrapper)expression, currentBlock);\n\n                case SyntaxKindEx.TupleExpression:\n                    return BuildTupleExpression((TupleExpressionSyntaxWrapper)expression, currentBlock);\n\n                default:\n                    throw new NotSupportedException($\"{expression.Kind()}\");\n            }\n        }\n\n        private static bool IsTooComplex(SyntaxNode node)\n        {\n            var count = 0;  // Limit descending for performance reasons\n            // The evaluation doesn't descend into the content of lambda expression. We need to tolerate these for Razor Layout pages.\n            return node.DescendantNodes(x => ++count < SupportedExpressionNodeCountLimit && !IsLambda(x)).Count() >= SupportedExpressionNodeCountLimit;\n\n            static bool IsLambda(SyntaxNode node) =>\n                 node is LambdaExpressionSyntax;\n        }\n\n        #endregion Top level Build*\n\n        #region Build*\n\n        #region Build statements\n\n        private Block BuildStatements(IEnumerable<StatementSyntax> statements, Block currentBlock)\n        {\n            foreach (var statement in statements.Reverse())\n            {\n                currentBlock = BuildStatement(statement, currentBlock);\n            }\n\n            return currentBlock;\n        }\n\n        private Block BuildExpressions(IEnumerable<ExpressionSyntax> expressions, Block currentBlock)\n        {\n            foreach (var expression in expressions.Reverse())\n            {\n                currentBlock = BuildExpression(expression, currentBlock);\n            }\n\n            return currentBlock;\n        }\n\n        #region Build label, goto, goto case, goto default\n\n        private Block BuildLabeledStatement(LabeledStatementSyntax labeledStatement, Block currentBlock)\n        {\n            var statementBlock = BuildStatement(labeledStatement.Statement, currentBlock);\n            var jumpBlock = CreateJumpBlock(labeledStatement, statementBlock);\n\n            this.labeledStatements[labeledStatement.Identifier.ValueText] = jumpBlock;\n\n            return CreateBlock(jumpBlock);\n        }\n\n        private Block BuildTryStatement(TryStatementSyntax tryStatement, Block currentBlock)\n        {\n            // successor - either finally of next block after try statement\n            var catchSuccessor = currentBlock;\n\n            var hasFinally = tryStatement.Finally?.Block != null;\n            if (hasFinally)\n            {\n                var finallySuccessors = new List<Block>();\n                finallySuccessors.Add(CreateBlock(catchSuccessor));\n                finallySuccessors.Add(CreateBlock(this.exitTarget.Peek()));\n\n                // Create a finally block that can either go to try-finally successor (happy path) or exit target (exceptional path)\n                catchSuccessor = BuildBlock(tryStatement.Finally.Block, CreateBranchBlock(tryStatement.Finally, finallySuccessors));\n                // This finally block becomes current exit target stack in case we have a return inside the try/catch block\n                this.exitTarget.Push(catchSuccessor);\n            }\n\n            var catchBlocks = tryStatement.Catches\n                .Reverse()\n                .Select(catchClause =>\n                {\n                    Block catchBlock = BuildBlock(catchClause.Block, CreateBlock(catchSuccessor));\n                    if (catchClause.Filter?.FilterExpression != null)\n                    {\n                        catchBlock = BuildExpression(catchClause.Filter.FilterExpression,\n                            CreateBinaryBranchBlock(catchClause.Filter, catchBlock, catchSuccessor));\n                    }\n                    return catchBlock;\n                })\n                .ToList();\n\n            // If there is a catch with no Exception filter or equivalent we don't want to\n            // join the tryStatement start/end blocks with the exit block because all\n            // exceptions will be caught before going to finally\n            var areAllExceptionsCaught = tryStatement.Catches.Any(IsCatchingAllExceptions);\n\n            // try end\n            var tryEndStatementConnections = catchBlocks.ToList();\n            tryEndStatementConnections.Add(catchSuccessor); // happy path, no exceptions thrown\n            if (!areAllExceptionsCaught) // unexpected exception thrown, go to exit (through finally if present)\n            {\n                tryEndStatementConnections.Add(this.exitTarget.Peek());\n            }\n\n            Block tryBody;\n            if (tryStatement.Block.Statements.Any(s => s.IsKind(SyntaxKind.ReturnStatement)))\n            {\n                // there is a return inside the `try`, thus a JumpBlock directly to the finally or exit will be created\n                var returnBlock = BuildBlock(tryStatement.Block, catchSuccessor);\n                var connections = new List<Block>();\n                connections.Add(returnBlock);\n                // if an exception is thrown, it will reach the `catch` blocks\n                connections.AddRange(catchBlocks);\n                tryBody = CreateBranchBlock(tryStatement, connections);\n            }\n            else\n            {\n                tryBody = BuildBlock(tryStatement.Block, CreateBranchBlock(tryStatement,\n                    tryEndStatementConnections.Distinct()));\n            }\n\n            // if this try is inside another try, the `beforeTryBlock` must have edges to the outer catch & finally blocks\n            Block beforeTryBlock;\n            if (currentBlock is BranchBlock possibleOuterTry &&\n                possibleOuterTry.BranchingNode.IsKind(SyntaxKind.TryStatement))\n            {\n                var beforeTryConnections = possibleOuterTry.SuccessorBlocks.ToList();\n                beforeTryConnections.Add(tryBody);\n                beforeTryBlock = CreateBranchBlock(tryStatement, beforeTryConnections.Distinct());\n            }\n            else\n            {\n                // otherwise, what happens before the try is not handled by any catch or finally\n                beforeTryBlock = CreateBlock(tryBody);\n            }\n\n            if (hasFinally)\n            {\n                this.exitTarget.Pop();\n            }\n\n            return beforeTryBlock;\n        }\n\n        private static bool IsCatchingAllExceptions(CatchClauseSyntax catchClause)\n        {\n            if (catchClause.Declaration == null)\n            {\n                return true;\n            }\n\n            var exceptionTypeName = catchClause.Declaration.Type.GetText().ToString().Trim();\n\n            return catchClause.Filter == null &&\n                (exceptionTypeName == \"Exception\" || exceptionTypeName == \"System.Exception\");\n        }\n\n        private Block BuildGotoDefaultStatement(GotoStatementSyntax statement, Block currentBlock)\n        {\n            if (this.switchGotoJumpBlocks.Count == 0)\n            {\n                throw new InvalidOperationException(\"goto default; outside a switch\");\n            }\n\n            var jumpBlock = CreateJumpBlock(statement, CreateTemporaryBlock(), currentBlock);\n\n            var currentJumpBlocks = this.switchGotoJumpBlocks.Peek();\n            if (!currentJumpBlocks.ContainsKey(GotoDefaultEntry))\n            {\n                currentJumpBlocks.Add(GotoDefaultEntry, new List<JumpBlock>());\n            }\n\n            currentJumpBlocks[GotoDefaultEntry].Add(jumpBlock);\n\n            return jumpBlock;\n        }\n\n        private Block BuildGotoCaseStatement(GotoStatementSyntax statement, Block currentBlock)\n        {\n            if (this.switchGotoJumpBlocks.Count == 0)\n            {\n                throw new InvalidOperationException(\"goto case; outside a switch\");\n            }\n\n            var jumpBlock = CreateJumpBlock(statement, CreateTemporaryBlock(), currentBlock);\n            var currentJumpBlocks = this.switchGotoJumpBlocks.Peek();\n            var indexer = GetCaseIndexer(statement.Expression);\n\n            if (!currentJumpBlocks.ContainsKey(indexer))\n            {\n                currentJumpBlocks.Add(indexer, new List<JumpBlock>());\n            }\n\n            currentJumpBlocks[indexer].Add(jumpBlock);\n\n            return jumpBlock;\n        }\n\n        private Block BuildGotoStatement(GotoStatementSyntax statement, Block currentBlock)\n        {\n            var jumpBlock = CreateJumpBlock(statement, CreateTemporaryBlock(), currentBlock);\n\n            if (!(statement.Expression is IdentifierNameSyntax identifier))\n            {\n                throw new InvalidOperationException(\"goto with no identifier\");\n            }\n\n            if (!this.gotoJumpBlocks.ContainsKey(identifier.Identifier.ValueText))\n            {\n                this.gotoJumpBlocks.Add(identifier.Identifier.ValueText, new List<JumpBlock>());\n            }\n\n            this.gotoJumpBlocks[identifier.Identifier.ValueText].Add(jumpBlock);\n\n            return jumpBlock;\n        }\n\n        #endregion Build label, goto, goto case, goto default\n\n        #region Build switch\n\n        private Block BuildSwitchStatement(SwitchStatementSyntax switchStatement, Block currentBlock)\n        {\n            var caseBlocksByValue = new Dictionary<object, Block>();\n            this.breakTarget.Push(currentBlock);\n            this.switchGotoJumpBlocks.Push(new Dictionary<object, List<JumpBlock>>());\n\n            // Default section is always evaluated last, we are handling it first because\n            // the CFG is built in reverse order\n            var defaultSection = switchStatement.Sections.FirstOrDefault(ContainsDefaultLabel);\n            var defaultSectionBlock = currentBlock;\n            if (defaultSection != null)\n            {\n                defaultSectionBlock = BuildStatements(defaultSection.Statements, CreateBlock(currentBlock));\n                caseBlocksByValue[GotoDefaultEntry] = defaultSectionBlock; // All \"goto default;\" will jump to this block\n            }\n\n            var currentSectionBlock = defaultSectionBlock;\n            foreach (var section in switchStatement.Sections.Reverse())\n            {\n                Block sectionBlock;\n                if (defaultSection != null && section == defaultSection)\n                {\n                    // Skip the default section if it contains a single default label; we already handled it\n                    if (section.Labels.Count == 1)\n                    {\n                        continue;\n                    }\n                    sectionBlock = defaultSectionBlock;\n                }\n                else\n                {\n                    sectionBlock = BuildStatements(section.Statements, CreateBlock(currentBlock));\n                }\n\n                foreach (var label in section.Labels.Reverse())\n                {\n                    // Handle C#7 pattern matching case Block\n                    if (CasePatternSwitchLabelSyntaxWrapper.IsInstance(label))\n                    {\n                        var casePatternSwitchLabel = (CasePatternSwitchLabelSyntaxWrapper)label;\n                        currentSectionBlock = BuildCasePattern(casePatternSwitchLabel,\n                            trueSuccessor: sectionBlock, falseSuccessor: currentSectionBlock);\n                    }\n                    else if (label is CaseSwitchLabelSyntax simpleCaseLabel)\n                    {\n                        currentSectionBlock = BuildExpression(switchStatement.Expression, CreateBinaryBranchBlock(simpleCaseLabel,\n                            sectionBlock, currentSectionBlock));\n                        var key = GetCaseIndexer(simpleCaseLabel.Value);\n                        caseBlocksByValue[key] = sectionBlock;\n                    }\n                }\n            }\n\n            this.breakTarget.Pop();\n            var gotosToFix = this.switchGotoJumpBlocks.Pop();\n            FixJumps(gotosToFix, caseBlocksByValue);\n            var switchBlock = CreateBranchBlock(switchStatement, new[] { currentSectionBlock });\n            return BuildExpression(switchStatement.Expression, switchBlock);\n            bool ContainsDefaultLabel(SwitchSectionSyntax s) =>\n                s.Labels.Any(l => l.IsKind(SyntaxKind.DefaultSwitchLabel));\n        }\n\n        private Block BuildSwitchExpression(SwitchExpressionSyntaxWrapper switchExpressionSyntax, Block currentBlock)\n        {\n            var currentArmBlock = currentBlock;\n\n            for (var index = switchExpressionSyntax.Arms.Count - 1; index >= 0; index--)\n            {\n                var arm = switchExpressionSyntax.Arms[index];\n                var isLast = index == switchExpressionSyntax.Arms.Count - 1;\n\n                var armBlock = BuildExpression(arm.Expression, CreateBlock(currentBlock));\n\n                currentArmBlock = BuildArmBranch(arm, armBlock, currentArmBlock, isLast);\n\n                if (!isLast)\n                {\n                    currentArmBlock = BuildExpression(switchExpressionSyntax.GoverningExpression, currentArmBlock);\n                }\n            }\n\n            return currentArmBlock;\n        }\n\n        private Block BuildArmBranch(SwitchExpressionArmSyntaxWrapper switchExpressionArmSyntax, Block trueSuccessor, Block falseSuccessor, bool isLast)\n        {\n            var newTrueSuccessor = CreateWhenCloseNewTrueSuccessor(switchExpressionArmSyntax.WhenClause, trueSuccessor, falseSuccessor);\n\n            var currentBlock = CreateCurrentBlock(switchExpressionArmSyntax, newTrueSuccessor, falseSuccessor, isLast);\n\n            currentBlock = BuildPatternExpression(switchExpressionArmSyntax.Pattern, currentBlock);\n\n            return currentBlock;\n        }\n\n        private Block CreateCurrentBlock(SwitchExpressionArmSyntaxWrapper switchExpressionArmSyntax, Block trueSuccessor, Block falseSuccessor, bool isLast) =>\n            isLast\n                ? trueSuccessor\n                : (Block)CreateBinaryBranchBlock(switchExpressionArmSyntax, trueSuccessor, falseSuccessor);\n\n        private Block BuildCasePattern(CasePatternSwitchLabelSyntaxWrapper casePatternSwitchLabel,\n            Block trueSuccessor, Block falseSuccessor)\n        {\n            var newTrueSuccessor = CreateWhenCloseNewTrueSuccessor(casePatternSwitchLabel.WhenClause, trueSuccessor, falseSuccessor);\n\n            var currentBlock = CreateBinaryBranchBlock(casePatternSwitchLabel, newTrueSuccessor, falseSuccessor);\n\n            currentBlock.ReversedInstructions.Add(casePatternSwitchLabel.Pattern);\n\n            return currentBlock;\n        }\n\n        private Block CreateWhenCloseNewTrueSuccessor(WhenClauseSyntaxWrapper whenClauseSyntax, Block trueSuccessor, Block falseSuccessor) =>\n            whenClauseSyntax.SyntaxNode != null\n                ? BuildCondition(whenClauseSyntax.Condition, trueSuccessor, falseSuccessor)\n                : trueSuccessor;\n\n        private object GetCaseIndexer(ExpressionSyntax expression)\n        {\n            var constValue = semanticModel.GetConstantValue(expression);\n            if (!constValue.HasValue)\n            {\n                throw new InvalidOperationException(\"Expression has no constant value\");\n            }\n\n            var indexer = constValue.Value;\n            if (indexer == null)\n            {\n                indexer = GotoNullEntry;\n            }\n\n            return indexer;\n        }\n\n        #endregion Build switch\n\n        #region Build jumps: break, continue, return, throw, yield break\n\n        private Block BuildBreakStatement(BreakStatementSyntax breakStatement, Block currentBlock)\n        {\n            if (this.breakTarget.Count == 0)\n            {\n                throw new InvalidOperationException(\"break; outside a loop\");\n            }\n\n            var target = this.breakTarget.Peek();\n            if (currentBlock is BranchBlock possibleTryBlock &&\n                possibleTryBlock.BranchingNode.IsKind(SyntaxKind.TryStatement))\n            {\n                var newSuccessors = possibleTryBlock.SuccessorBlocks.ToList();\n                newSuccessors.Add(target);\n                var branchBlock = CreateBranchBlock(possibleTryBlock.BranchingNode, newSuccessors);\n                return branchBlock;\n            }\n            return CreateJumpBlock(breakStatement, target, currentBlock);\n        }\n\n        private Block BuildContinueStatement(ContinueStatementSyntax continueStatement, Block currentBlock)\n        {\n            if (this.continueTargets.Count == 0)\n            {\n                throw new InvalidOperationException(\"continue; outside a loop\");\n            }\n\n            var target = this.continueTargets.Peek();\n            return CreateJumpBlock(continueStatement, target, currentBlock);\n        }\n\n        private Block BuildReturnStatement(ReturnStatementSyntax returnStatement, Block currentBlock)\n        {\n            return BuildJumpToExitStatement(returnStatement, currentBlock, returnStatement.Expression);\n        }\n\n        private Block BuildThrowStatement(ThrowStatementSyntax throwStatement, Block currentBlock)\n        {\n            return BuildJumpToExitStatement(throwStatement, currentBlock, throwStatement.Expression);\n        }\n\n        private Block BuildYieldBreakStatement(YieldStatementSyntax yieldBreakStatement, Block currentBlock)\n        {\n            return BuildJumpToExitStatement(yieldBreakStatement, currentBlock);\n        }\n\n        private Block BuildYieldReturnStatement(YieldStatementSyntax yieldReturnStatement, Block currentBlock)\n        {\n            return BuildExpression(yieldReturnStatement.Expression, CreateJumpBlock(yieldReturnStatement, currentBlock, currentBlock));\n        }\n\n        private Block BuildJumpToExitStatement(StatementSyntax statement, Block currentBlock, ExpressionSyntax expression = null)\n        {\n            // When there is a `throw` inside a `try`, and there is a `catch` with a filter,\n            // the `throw` block should point to both the `catch` and the `exit` blocks.\n            if (currentBlock.SuccessorBlocks.Any(b => b is BinaryBranchBlock x && x.BranchingNode.IsKind(SyntaxKind.CatchFilterClause)) &&\n                currentBlock.SuccessorBlocks.Contains(this.exitTarget.Peek()))\n            {\n                return BuildExpression(expression, currentBlock);\n            }\n            return BuildExpression(expression, CreateJumpBlock(statement, this.exitTarget.Peek(), currentBlock));\n        }\n\n        private Block BuildJumpToExitStatement(ExpressionSyntax expression, Block currentBlock, ExpressionSyntax innerExpression)\n        {\n            return BuildExpression(innerExpression, CreateJumpBlock(expression, this.exitTarget.Peek(), currentBlock));\n        }\n\n        #endregion Build jumps: break, continue, return, throw, yield break\n\n        #region Build lock, using, fixed, unsafe checked statements\n\n        private Block BuildLockStatement(LockStatementSyntax lockStatement, Block currentBlock)\n        {\n            var lockStatementBlock = BuildStatement(lockStatement.Statement, CreateBlock(currentBlock));\n\n            return BuildExpression(lockStatement.Expression, CreateLockBlock(lockStatement, lockStatementBlock));\n        }\n\n        private Block BuildUsingStatement(UsingStatementSyntax usingStatement, Block currentBlock)\n        {\n            var usingStatementBlock = BuildStatement(usingStatement.Statement, CreateUsingFinalizerBlock(usingStatement, currentBlock));\n            var usingBlock = CreateJumpBlock(usingStatement, usingStatementBlock);\n\n            return usingStatement.Expression != null\n                ? BuildExpression(usingStatement.Expression, usingBlock)\n                : BuildVariableDeclaration(usingStatement.Declaration, usingBlock);\n        }\n\n        private Block BuildFixedStatement(FixedStatementSyntax fixedStatement, Block currentBlock)\n        {\n            var fixedStatementBlock = BuildStatement(fixedStatement.Statement, CreateBlock(currentBlock));\n            return BuildVariableDeclaration(fixedStatement.Declaration, CreateJumpBlock(fixedStatement, fixedStatementBlock));\n        }\n\n        private Block BuildUnsafeStatement(UnsafeStatementSyntax statement, Block currentBlock)\n        {\n            var unsafeStatement = BuildStatement(statement.Block, CreateBlock(currentBlock));\n            return CreateJumpBlock(statement, unsafeStatement);\n        }\n\n        private Block BuildCheckedStatement(CheckedStatementSyntax statement, Block currentBlock)\n        {\n            var statementBlock = BuildStatement(statement.Block, CreateBlock(currentBlock));\n            return CreateJumpBlock(statement, statementBlock);\n        }\n\n        #endregion Build lock, using, fixed, unsafe checked statements\n\n        #region Build loops - do, for, foreach, while\n\n        private Block BuildDoStatement(DoStatementSyntax doStatement, Block currentBlock)\n        {\n            //// while (A) { B; }\n            var conditionBlockTemp = CreateTemporaryBlock();\n\n            var conditionBlock = BuildCondition(doStatement.Condition, conditionBlockTemp, currentBlock); // A\n\n            this.breakTarget.Push(currentBlock);\n            this.continueTargets.Push(conditionBlock);\n\n            var loopBody = BuildStatement(doStatement.Statement, CreateBlock(conditionBlock)); // B\n            conditionBlockTemp.SuccessorBlock = loopBody;\n\n            this.breakTarget.Pop();\n            this.continueTargets.Pop();\n\n            return CreateBlock(loopBody);\n        }\n\n        private Block BuildForStatement(ForStatementSyntax forStatement, Block currentBlock)\n        {\n            //// for (A; B; C) { D; }\n\n            var tempLoopBlock = CreateTemporaryBlock();\n\n            var incrementorBlock = BuildExpressions(forStatement.Incrementors, CreateBlock(tempLoopBlock)); // C\n\n            this.breakTarget.Push(currentBlock);\n            this.continueTargets.Push(incrementorBlock);\n\n            var forBlock = BuildStatement(forStatement.Statement, CreateBlock(incrementorBlock)); // D\n\n            this.breakTarget.Pop();\n            this.continueTargets.Pop();\n\n            var conditionBlock = BuildExpression(forStatement.Condition,\n                CreateBinaryBranchBlock(forStatement, forBlock, currentBlock)); // B\n            tempLoopBlock.SuccessorBlock = conditionBlock;\n\n            Block forInitializer = AddBlock(new ForInitializerBlock(forStatement, conditionBlock)); // A\n            if (forStatement.Declaration != null)\n            {\n                forInitializer = BuildVariableDeclaration(forStatement.Declaration, forInitializer);\n            }\n\n            forInitializer = BuildExpressions(forStatement.Initializers, forInitializer);\n\n            return forInitializer;\n        }\n\n        private Block BuildForEachVariableStatement(ForEachVariableStatementSyntaxWrapper foreachStatement, Block currentBlock)\n            => BuildForEachStatement(foreachStatement, foreachStatement.Statement, foreachStatement.Expression, currentBlock);\n\n        private Block BuildForEachStatement(ForEachStatementSyntax foreachStatement, Block currentBlock)\n            => BuildForEachStatement(foreachStatement, foreachStatement.Statement, foreachStatement.Expression, currentBlock);\n\n        private Block BuildForEachStatement(StatementSyntax foreachStatement, StatementSyntax foreachBodyStatement, ExpressionSyntax foreachExpression, Block currentBlock)\n        {\n            var temp = CreateTemporaryBlock();\n\n            this.breakTarget.Push(currentBlock);\n            this.continueTargets.Push(temp);\n\n            var foreachBlock = BuildStatement(foreachBodyStatement, CreateBlock(temp));\n\n            this.breakTarget.Pop();\n            this.continueTargets.Pop();\n\n            // Variable declaration in a foreach statement is not a VariableDeclarator, otherwise it would be added here.\n            temp.SuccessorBlock = CreateBinaryBranchBlock(foreachStatement, foreachBlock, currentBlock);\n\n            return BuildExpression(foreachExpression, AddBlock(new ForeachCollectionProducerBlock(foreachStatement, temp)));\n        }\n\n        private Block BuildWhileStatement(WhileStatementSyntax whileStatement, Block currentBlock)\n        {\n            var loopTempBlock = CreateTemporaryBlock();\n\n            this.breakTarget.Push(currentBlock);\n            this.continueTargets.Push(loopTempBlock);\n\n            var bodyBlock = BuildStatement(whileStatement.Statement, CreateBlock(loopTempBlock));\n\n            this.breakTarget.Pop();\n            this.continueTargets.Pop();\n\n            var loopCondition = BuildCondition(whileStatement.Condition, bodyBlock, currentBlock);\n\n            loopTempBlock.SuccessorBlock = loopCondition;\n\n            return CreateBlock(loopCondition);\n        }\n\n        #endregion Build loops - do, for, foreach, while\n\n        #region Build if statement\n\n        private Block BuildIfStatement(IfStatementSyntax ifStatement, Block currentBlock)\n        {\n            var elseBlock = ifStatement.Else?.Statement != null\n                ? BuildStatement(ifStatement.Else.Statement, CreateBlock(currentBlock))\n                : currentBlock;\n            var trueBlock = BuildStatement(ifStatement.Statement, CreateBlock(currentBlock));\n\n            var ifConditionBlock = BuildCondition(ifStatement.Condition, trueBlock, elseBlock);\n\n            return ifConditionBlock;\n        }\n\n        #endregion Build if statement\n\n        #region Build block\n\n        private Block BuildBlock(BlockSyntax block, Block currentBlock)\n        {\n            return BuildStatements(block.Statements, currentBlock);\n        }\n\n        #endregion Build block\n\n        #endregion Build statements\n\n        #region Build expressions\n\n        private Block BuildConditionalAccessExpression(ConditionalAccessExpressionSyntax conditionalAccess,\n            Block currentBlock)\n        {\n            var whenNotNull = BuildExpression(conditionalAccess.WhenNotNull, CreateBlock(currentBlock));\n\n            return BuildExpression(conditionalAccess.Expression,\n                CreateBinaryBranchBlock(conditionalAccess, currentBlock, whenNotNull));\n        }\n\n        private Block BuildConditionalExpression(ConditionalExpressionSyntax conditional, Block currentBlock)\n        {\n            var falseBlock = BuildExpression(conditional.WhenFalse, CreateBlock(currentBlock));\n            var trueBlock = BuildExpression(conditional.WhenTrue, CreateBlock(currentBlock));\n\n            return BuildCondition(conditional.Condition, trueBlock, falseBlock);\n        }\n\n        private Block BuildCoalesceExpression(BinaryExpressionSyntax expression, Block currentBlock)\n        {\n            var rightBlock = BuildExpression(expression.Right, CreateBlock(currentBlock));\n\n            return BuildExpression(expression.Left, CreateBinaryBranchBlock(expression, rightBlock, currentBlock));\n        }\n\n        private Block BuildLogicalAndExpression(BinaryExpressionSyntax expression, Block currentBlock)\n        {\n            var rightBlock = BuildExpression(expression.Right,\n                AddBlock(new BinaryBranchingSimpleBlock(expression.Right, currentBlock)));\n\n            return BuildExpression(expression.Left, CreateBinaryBranchBlock(expression, rightBlock, currentBlock));\n        }\n\n        private Block BuildLogicalOrExpression(BinaryExpressionSyntax expression, Block currentBlock)\n        {\n            var rightBlock = BuildExpression(expression.Right,\n                AddBlock(new BinaryBranchingSimpleBlock(expression.Right, currentBlock)));\n\n            return BuildExpression(expression.Left, CreateBinaryBranchBlock(expression, currentBlock, rightBlock));\n        }\n\n        private Block BuildArrayCreationExpression(ArrayCreationExpressionSyntax expression, Block currentBlock)\n        {\n            var arrayInitializerBlock = BuildExpression(expression.Initializer, currentBlock);\n            arrayInitializerBlock.ReversedInstructions.Add(expression);\n\n            return BuildExpression(expression.Type, arrayInitializerBlock);\n        }\n\n        private Block BuildElementAccessExpression(ElementAccessExpressionSyntax expression, Block currentBlock)\n        {\n            return BuildInvocationLikeExpression(expression, currentBlock, expression.Expression,\n                expression.ArgumentList?.Arguments);\n        }\n\n        private Block BuildImplicitElementAccessExpression(ImplicitElementAccessSyntax expression, Block currentBlock)\n        {\n            return BuildInvocationLikeExpression(expression, currentBlock, null, expression.ArgumentList?.Arguments);\n        }\n\n        private Block BuildInvocationLikeExpression(ExpressionSyntax parent, Block currentBlock,\n            ExpressionSyntax child, IEnumerable<ArgumentSyntax> arguments)\n        {\n            currentBlock.ReversedInstructions.Add(parent);\n            var isNameof = parent is InvocationExpressionSyntax invocation && IsNameof(invocation);\n\n            // The nameof arguments are not evaluated at runtime and should not be added\n            // to the block as instructions\n            if (isNameof)\n            {\n                return currentBlock;\n            }\n\n            // ref arguments should be added at the end since they remove\n            // the constraints on the arguments after all the other arguments are evaluated\n            foreach (var arg in arguments.Reverse())\n            {\n                if (arg.RefOrOutKeyword.IsKind(SyntaxKind.RefKeyword))\n                {\n                    currentBlock = BuildExpression(arg.Expression, currentBlock);\n                }\n            }\n\n            foreach (var arg in arguments.Reverse())\n            {\n                if (!arg.RefOrOutKeyword.IsKind(SyntaxKind.RefKeyword))\n                {\n                    currentBlock = BuildExpression(arg.Expression, currentBlock);\n                }\n            }\n            return BuildExpression(child, currentBlock);\n        }\n\n        private Block BuildObjectCreationExpression(ObjectCreationExpressionSyntax expression, Block currentBlock)\n        {\n            var objectInitializerBlock = BuildExpression(expression.Initializer, currentBlock);\n            objectInitializerBlock.ReversedInstructions.Add(expression);\n\n            var arguments = expression.ArgumentList == null\n                ? Enumerable.Empty<ExpressionSyntax>()\n                : expression.ArgumentList.Arguments.Select(a => a.Expression);\n\n            return BuildExpressions(arguments, objectInitializerBlock);\n        }\n\n        private Block BuildAnonymousObjectCreationExpression(AnonymousObjectCreationExpressionSyntax expression,\n            Block currentBlock)\n        {\n            return BuildSimpleNestedExpression(expression, currentBlock,\n                expression.Initializers.Select(i => i.Expression));\n        }\n\n        private Block BuildInvocationExpression(InvocationExpressionSyntax expression, Block currentBlock)\n        {\n            return BuildInvocationLikeExpression(expression, currentBlock, expression.Expression,\n                expression.ArgumentList?.Arguments);\n        }\n\n        private Block BuildInterpolatedStringExpression(InterpolatedStringExpressionSyntax expression,\n            Block currentBlock)\n        {\n            return BuildSimpleNestedExpression(expression, currentBlock,\n                expression.Contents.OfType<InterpolationSyntax>().Select(i => i.Expression));\n        }\n\n        private Block BuildSimpleNestedExpression(ExpressionSyntax parent, Block currentBlock,\n            params ExpressionSyntax[] children)\n        {\n            return BuildSimpleNestedExpression(parent, currentBlock, (IEnumerable<ExpressionSyntax>)children);\n        }\n\n        private Block BuildSimpleNestedExpression(ExpressionSyntax parent, Block currentBlock,\n            IEnumerable<ExpressionSyntax> children)\n        {\n            currentBlock.ReversedInstructions.Add(parent);\n\n            // The nameof arguments are not evaluated at runtime and should not be added\n            // to the block as instructions\n            var isNameof = parent is InvocationExpressionSyntax invocation && IsNameof(invocation);\n\n            return children == null || isNameof\n                ? currentBlock\n                : BuildExpressions(children, currentBlock);\n        }\n\n        private Block BuildBinaryExpression(BinaryExpressionSyntax expression, Block currentBlock)\n        {\n            currentBlock.ReversedInstructions.Add(expression);\n            var binaryExpressionBlock = BuildExpression(expression.Right, currentBlock);\n            return BuildExpression(expression.Left, binaryExpressionBlock);\n        }\n\n        private Block BuildAssignmentExpression(AssignmentExpressionSyntax expression, Block currentBlock)\n        {\n            currentBlock.ReversedInstructions.Add(expression);\n            var binaryExpressionBlock = BuildExpression(expression.Right, currentBlock);\n            return BuildExpression(expression.Left, binaryExpressionBlock);\n        }\n\n        private Block BuildCoalesceAssignmentExpression(AssignmentExpressionSyntax expression, Block currentBlock)\n        {\n            currentBlock.ReversedInstructions.Add(expression);\n            var rightBlock = BuildExpression(expression.Right, CreateBlock(currentBlock));\n            return BuildExpression(expression.Left, CreateBinaryBranchBlock(expression, rightBlock, currentBlock));\n        }\n\n        private Block BuildSimpleAssignmentExpression(AssignmentExpressionSyntax expression, Block currentBlock)\n        {\n            currentBlock.ReversedInstructions.Add(expression);\n\n            var assignmentBlock = BuildExpression(expression.Right, currentBlock);\n            if (!IsAssignmentWithSimpleLeftSide(expression))\n            {\n                assignmentBlock = BuildExpression(expression.Left, assignmentBlock);\n            }\n            return assignmentBlock;\n        }\n\n        public static bool IsAssignmentWithSimpleLeftSide(AssignmentExpressionSyntax assignment)\n        {\n            return assignment.Left.RemoveParentheses() is IdentifierNameSyntax;\n        }\n\n        private Block BuildArrayType(ArrayTypeSyntax arrayType, Block currentBlock)\n        {\n            currentBlock.ReversedInstructions.Add(arrayType);\n\n            var arraySizes = arrayType.RankSpecifiers.SelectMany(rs => rs.Sizes);\n            return BuildExpressions(arraySizes, currentBlock);\n        }\n\n        private Block BuildIsPatternExpression(IsPatternExpressionSyntaxWrapper isPatternExpression, Block currentBlock)\n        {\n            currentBlock.ReversedInstructions.Add(isPatternExpression);\n\n            return BuildPatternExpression(isPatternExpression.Pattern, currentBlock);\n        }\n\n        private Block BuildPatternExpression(PatternSyntaxWrapper patternSyntaxWrapper, Block currentBlock)\n        {\n            if (ConstantPatternSyntaxWrapper.IsInstance(patternSyntaxWrapper))\n            {\n                var constantPattern = (ConstantPatternSyntaxWrapper)patternSyntaxWrapper;\n\n                return BuildExpression(constantPattern.Expression, currentBlock);\n            }\n            else if (DeclarationPatternSyntaxWrapper.IsInstance(patternSyntaxWrapper))\n            {\n                // Do nothing, this is just variable assignment and the Pattern itself contains\n                // only the new variable(s), which are not enough to evaluate the assignment.\n                // The handling should be done in SonarExplodedGraph and UcfgInstructionFactory.\n\n                return currentBlock;\n            }\n            else if (DiscardPatternSyntaxWrapper.IsInstance(patternSyntaxWrapper))\n            {\n                return currentBlock;\n            }\n            else if (RecursivePatternSyntaxWrapper.IsInstance(patternSyntaxWrapper))\n            {\n                // The recursive pattern will be handled in SonarExplodedGraph and UcfgInstructionFactory.\n                currentBlock.ReversedInstructions.Add(patternSyntaxWrapper);\n                return currentBlock;\n            }\n\n            throw new NotSupportedException($\"{patternSyntaxWrapper.SyntaxNode.Kind()}\");\n        }\n\n        private Block BuildTupleExpression(TupleExpressionSyntaxWrapper tuple, Block currentBlock)\n        {\n            currentBlock.ReversedInstructions.Add(tuple);\n            foreach (var arg in tuple.Arguments.Reverse())\n            {\n                currentBlock = BuildExpression(arg.Expression, currentBlock);\n            }\n            return currentBlock;\n        }\n\n        #endregion Build expressions\n\n        #region Build variable declaration\n\n        private Block BuildVariableDeclaration(VariableDeclarationSyntax declaration, Block currentBlock)\n        {\n            if (declaration == null)\n            {\n                return currentBlock;\n            }\n\n            var variableDeclaratorBlock = currentBlock;\n            foreach (var variable in declaration.Variables.Reverse())\n            {\n                variableDeclaratorBlock = BuildVariableDeclarator(variable, variableDeclaratorBlock);\n            }\n\n            return variableDeclaratorBlock;\n        }\n\n        private Block BuildVariableDeclarator(VariableDeclaratorSyntax variableDeclarator, Block currentBlock)\n        {\n            // There are variable declarations which implicitly get a value, such as foreach (var x in xs)\n            currentBlock.ReversedInstructions.Add(variableDeclarator);\n\n            var initializer = variableDeclarator.Initializer?.Value;\n            return initializer == null\n                ? currentBlock\n                : BuildExpression(initializer, currentBlock);\n        }\n\n        #endregion Build variable declaration\n\n        #region Create*\n\n        internal LockBlock CreateLockBlock(LockStatementSyntax lockStatement, Block successor) =>\n            AddBlock(new LockBlock(lockStatement, successor));\n\n        internal UsingEndBlock CreateUsingFinalizerBlock(UsingStatementSyntax usingStatement, Block successor) =>\n            AddBlock(new UsingEndBlock(usingStatement, successor));\n\n        #endregion Create*\n\n        #region Condition\n\n        /// <summary>\n        /// Builds a conditional expression with two successor blocks. The BuildExpression method\n        /// creates a tree with only one successor.\n        /// </summary>\n        private Block BuildCondition(ExpressionSyntax expression, Block trueSuccessor, Block falseSuccessor)\n        {\n            expression = expression.RemoveParentheses();\n\n            if (expression is BinaryExpressionSyntax binaryExpression)\n            {\n                switch (expression.Kind())\n                {\n                    case SyntaxKind.LogicalOrExpression:\n                        return BuildCondition(\n                            binaryExpression.Left,\n                            trueSuccessor,\n                            BuildCondition(binaryExpression.Right, trueSuccessor, falseSuccessor));\n\n                    case SyntaxKind.LogicalAndExpression:\n                        return BuildCondition(\n                            binaryExpression.Left,\n                            BuildCondition(binaryExpression.Right, trueSuccessor, falseSuccessor),\n                            falseSuccessor);\n\n                    case SyntaxKind.CoalesceExpression:\n                        return BuildCondition(\n                             binaryExpression.Left,\n                             BuildCondition(binaryExpression.Right, trueSuccessor, falseSuccessor),\n                             CreateBranchBlock(binaryExpression.Left, successors: new[] { trueSuccessor, falseSuccessor }));\n                }\n            }\n\n            // Fallback to generating an additional branch block for the if statement itself.\n            return BuildExpression(expression,\n                    AddBlock(new BinaryBranchBlock(expression, trueSuccessor, falseSuccessor)));\n        }\n\n        #endregion Condition\n\n        #endregion Build*\n\n        private bool IsNameof(InvocationExpressionSyntax expression) =>\n            (expression?.Expression as IdentifierNameSyntax)?.Identifier.ToString() == \"nameof\"\n            && semanticModel.GetSymbolOrCandidateSymbol(expression) is not IMethodSymbol;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Sonar/CfgAllPathValidator.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CFG.Sonar\n{\n    public class CfgAllPathValidator\n    {\n        protected readonly IControlFlowGraph cfg;\n\n        private readonly HashSet<Block> alreadyVisitedBlocks = new HashSet<Block>();\n\n        protected CfgAllPathValidator(IControlFlowGraph cfg)\n        {\n            this.cfg = cfg;\n        }\n\n        public bool CheckAllPaths()\n        {\n            return IsBlockValidWithSuccessors(this.cfg.EntryBlock);\n        }\n\n        private bool IsBlockValidWithSuccessors(Block block)\n        {\n            return !IsBlockInvalid(block) && (IsBlockValid(block) || AreAllSuccessorsValid(block));\n        }\n\n        private bool AreAllSuccessorsValid(Block block)\n        {\n            this.alreadyVisitedBlocks.Add(block);\n\n            if (block.SuccessorBlocks.Contains(this.cfg.ExitBlock) ||\n                !block.SuccessorBlocks.Except(this.alreadyVisitedBlocks).Any())\n            {\n                return false;\n            }\n\n            return block.SuccessorBlocks\n                .Except(this.alreadyVisitedBlocks)\n                .All(b => IsBlockValidWithSuccessors(b));\n        }\n\n        protected virtual bool IsBlockValid(Block block)\n        {\n            return false;\n        }\n\n        protected virtual bool IsBlockInvalid(Block block)\n        {\n            return false;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Sonar/IControlFlowGraph.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CFG.Sonar\n{\n    /// <summary>\n    /// Represents a Control Flow Graph of a method or property.\n    /// Provides access to the entry, exit and all blocks (<see cref=\"Block\"/>) inside the CFG.\n    /// </summary>\n    public interface IControlFlowGraph\n    {\n        IEnumerable<Block> Blocks { get;}\n\n        Block EntryBlock { get; }\n\n        ExitBlock ExitBlock { get; }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/SonarAnalyzer.CFG.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project Sdk=\"Microsoft.NET.Sdk\" ToolsVersion=\"Current\">\n  <PropertyGroup>\n    <TargetFramework>netstandard2.0</TargetFramework>\n    <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>\n    <CompilerGeneratedFilesOutputPath>$(MSBuildProjectDirectory)\\Lightup\\.generated</CompilerGeneratedFilesOutputPath>\n  </PropertyGroup>\n  <ItemGroup>\n    <PackageReference Include=\"Microsoft.CodeAnalysis.CSharp.Workspaces\" Version=\"1.3.2\" />\n    <PackageReference Include=\"Microsoft.Composition\" Version=\"1.0.27\">\n      <!-- This package is a dependency of Microsoft.CodeAnalysis.CSharp.Workspaces. It is safe to use since it's compatible with .Net Portable runtime -->\n      <NoWarn>NU1701</NoWarn>\n    </PackageReference>\n    <PackageReference Include=\"System.Collections.Immutable\" Version=\"1.1.37\">\n      <!-- Downgrade System.Collections.Immutable to support VS2015 Update 3 -->\n      <NoWarn>NU1605, NU1701</NoWarn>\n    </PackageReference>\n\n    <ProjectReference Include=\"..\\SonarAnalyzer.ShimLayer.Lightup\\SonarAnalyzer.ShimLayer.Lightup.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Using Include=\"Microsoft.CodeAnalysis\" />\n    <Using Include=\"Microsoft.CodeAnalysis.Diagnostics\" />\n    <Using Include=\"SonarAnalyzer.CFG.Extensions\" />\n    <Using Include=\"SonarAnalyzer.ShimLayer\" />\n    <Using Include=\"StyleCop.Analyzers.Lightup\" />\n  </ItemGroup>\n\n  <Target Name=\"CopyBinaries\" AfterTargets=\"Build\">\n    <ItemGroup>\n      <BinariesToCopy Include=\"$(OutputPath)SonarAnalyzer.CFG.dll\" />\n      <BinariesToCopy Include=\"$(OutputPath)SonarAnalyzer.ShimLayer.dll\" />\n      <BinariesToCopy Include=\"$(OutputPath)SonarAnalyzer.ShimLayer.Lightup.dll\" />\n    </ItemGroup>\n    <Copy SourceFiles=\"@(BinariesToCopy)\" DestinationFolder=\"$(BinariesFolder)\" />\n  </Target>\n\n</Project>\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/Syntax/Utilities/SyntaxClassifierBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CFG.Syntax.Utilities;\n\n/// <summary>\n/// This class violates the basic principle that SE should only depend on IOperation.\n///\n/// Anything added here needs to have extremely rare reason why it exists.\n/// </summary>\npublic abstract class SyntaxClassifierBase\n{\n    public abstract SyntaxNode MemberAccessExpression(SyntaxNode node);\n    protected abstract bool IsCfgBoundary(SyntaxNode node);\n    protected abstract bool IsStatement(SyntaxNode node);\n    protected abstract SyntaxNode ParentLoopCondition(SyntaxNode node);\n\n    // Detecting loops from CFG shape is not possible from the shape of CFG, because of nested loops.\n    public bool IsInLoopCondition(SyntaxNode node)\n    {\n        while (node is not null)\n        {\n            if (ParentLoopCondition(node) == node)\n            {\n                return true;\n            }\n            if (IsStatement(node) || IsCfgBoundary(node))\n            {\n                return false;\n            }\n            else\n            {\n                node = node.Parent;\n            }\n        }\n        return false;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CFG/packages.lock.json",
    "content": "{\n  \"version\": 1,\n  \"dependencies\": {\n    \".NETStandard,Version=v2.0\": {\n      \"Microsoft.CodeAnalysis.CSharp.Workspaces\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.3.2, )\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"MwGmrrPx3okEJuCogSn4TM3yTtJUDdmTt8RXpnjVo0dPund0YSAq4bHQQ9bxgArbrrapcopJmkb7UOLAvanXkg==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp\": \"[1.3.2]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2]\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[3.3.1, )\",\n        \"resolved\": \"3.3.1\",\n        \"contentHash\": \"eT+kgNCDdTRbQ5WF6BGx1HI3D5jYfHteza/koefhWC2vNZGxObA74XxwWfg40dy3uUv7dn3OGKLK5GUPLroVog==\"\n      },\n      \"Microsoft.Composition\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.0.27, )\",\n        \"resolved\": \"1.0.27\",\n        \"contentHash\": \"pwu80Ohe7SBzZ6i69LVdzowp6V+LaVRzd5F7A6QlD42vQkX0oT7KXKWWPlM/S00w1gnMQMRnEdbtOV12z6rXdQ==\"\n      },\n      \"NETStandard.Library\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[2.0.3, )\",\n        \"resolved\": \"2.0.3\",\n        \"contentHash\": \"st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.1.0\"\n        }\n      },\n      \"SonarAnalyzer.CSharp.Styling\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[10.21.0.135717, )\",\n        \"resolved\": \"10.21.0.135717\",\n        \"contentHash\": \"hl264jF539oB7m2jED5QGM345eFSiDAdoJc8TH0HM6L7ZeqT5TDqZDQeZ8IDP02dVIpH/Fhhn+HsGfEcj8ohyQ==\"\n      },\n      \"StyleCop.Analyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.2.0-beta.556, )\",\n        \"resolved\": \"1.2.0-beta.556\",\n        \"contentHash\": \"llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==\",\n        \"dependencies\": {\n          \"StyleCop.Analyzers.Unstable\": \"1.2.0.556\"\n        }\n      },\n      \"System.Collections.Immutable\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.1.37, )\",\n        \"resolved\": \"1.1.37\",\n        \"contentHash\": \"fTpqwZYBzoklTT+XjTRK8KxvmrGkYHzBiylCcKyQcxiOM8k+QvhNBxRvFHDWzy4OEP5f8/9n+xQ9mEgEXY+muA==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.0\",\n          \"System.Diagnostics.Debug\": \"4.0.0\",\n          \"System.Globalization\": \"4.0.0\",\n          \"System.Linq\": \"4.0.0\",\n          \"System.Resources.ResourceManager\": \"4.0.0\",\n          \"System.Runtime\": \"4.0.0\",\n          \"System.Runtime.Extensions\": \"4.0.0\",\n          \"System.Threading\": \"4.0.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.1.0\",\n        \"contentHash\": \"HS3iRWZKcUw/8eZ/08GXKY2Bn7xNzQPzf8gRPHGSowX7u7XXu9i9YEaBeBNKUXWfI7qjvT2zXtLUvbN0hds8vg==\"\n      },\n      \"Microsoft.CodeAnalysis.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"lOinFNbjpCvkeYQHutjKi+CfsjoKu88wAFT6hAumSR/XJSJmmVGvmnbzCWW8kUJnDVrw1RrcqS8BzgPMj263og==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"1.1.0\",\n          \"System.AppContext\": \"4.1.0\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.Collections.Concurrent\": \"4.0.12\",\n          \"System.Collections.Immutable\": \"1.2.0\",\n          \"System.Console\": \"4.0.0\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Diagnostics.FileVersionInfo\": \"4.0.0\",\n          \"System.Diagnostics.StackTrace\": \"4.0.1\",\n          \"System.Diagnostics.Tools\": \"4.0.1\",\n          \"System.Dynamic.Runtime\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Linq.Expressions\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Metadata\": \"1.3.0\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Runtime.Numerics\": \"4.0.1\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.X509Certificates\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Text.Encoding.CodePages\": \"4.0.1\",\n          \"System.Text.Encoding.Extensions\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\",\n          \"System.Threading.Tasks.Parallel\": \"4.0.1\",\n          \"System.Threading.Thread\": \"4.0.0\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\",\n          \"System.Xml.XDocument\": \"4.0.11\",\n          \"System.Xml.XPath.XDocument\": \"4.0.1\",\n          \"System.Xml.XmlDocument\": \"4.0.1\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"GrYMp6ScZDOMR0fNn/Ce6SegNVFw1G/QRT/8FiKv7lAP+V6lEZx9e42n0FvFUgjjcKgcEJOI4muU6i+3LSvOBA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Common\": \"[1.3.2]\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Workspaces.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"kvdo+rkImlx5MuBgkayl4OV3Mg8/qirUdYgCIfQ9EqN15QasJFlQXmDAtCGqpkK9sYLLO/VK+y+4mvKjfh/FOA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Common\": \"[1.3.2]\",\n          \"Microsoft.Composition\": \"1.0.27\"\n        }\n      },\n      \"Microsoft.NETCore.Platforms\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.1.0\",\n        \"contentHash\": \"kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==\"\n      },\n      \"Microsoft.NETCore.Targets\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.1\",\n        \"contentHash\": \"rkn+fKobF/cbWfnnfBOQHKVKIOpxMZBvlSHkqDWgBpwGDcLRduvs3D9OLGeV6GWGvVwNlVi2CBbTjuPmtHvyNw==\"\n      },\n      \"runtime.native.System\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"QfS/nQI7k/BLgmLrw7qm7YBoULEvgWnPI+cYsbfCVFTW8Aj+i8JhccxcFMu1RWms0YZzF+UHguNBK4Qn89e2Sg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\"\n        }\n      },\n      \"runtime.native.System.Net.Http\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"Nh0UPZx2Vifh8r+J+H2jxifZUD3sBrmolgiFWJd2yiNrxO0xTa6bAw3YwRn1VOiSen/tUXMS31ttNItCZ6lKuA==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\"\n        }\n      },\n      \"runtime.native.System.Security.Cryptography\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"2CQK0jmO6Eu7ZeMgD+LOFbNJSXHFVQbCJJkEyEwowh1SCgYnrn9W9RykMfpeeVGw7h4IBvYikzpGUlmZTUafJw==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\"\n        }\n      },\n      \"StyleCop.Analyzers.Unstable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.2.0.556\",\n        \"contentHash\": \"zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==\"\n      },\n      \"System.AppContext\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"3QjO4jNV7PdKkmQAVp9atA+usVnKRwI3Kx1nMwJ93T0LcQfx7pKAYk0nKz5wn1oP5iqlhZuy6RXOFdhr7rDwow==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Collections\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"YUJGz6eFKqS0V//mLt25vFGrrCvOnsXjlvFQs+KimpwNxug9x0Pzy4PlFMU3Q2IzqAa9G2L4LsK3+9vCBK7oTg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Collections.Concurrent\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.12\",\n        \"contentHash\": \"2gBcbb3drMLgxlI0fBfxMA31ec6AEyYCHygGse4vxceJan8mRIWeKJ24BFzN7+bi/NFTgdIgufzb94LWO5EERQ==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Diagnostics.Tracing\": \"4.1.0\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Console\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"qSKUSOIiYA/a0g5XXdxFcUFmv1hNICBD7QZ0QhGYVipPIhvpiydY8VZqr1thmCXvmn8aipMg64zuanB4eotK9A==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\"\n        }\n      },\n      \"System.Diagnostics.Debug\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"w5U95fVKHY4G8ASs/K5iK3J5LY+/dLFd4vKejsnI/ZhBsWS9hQakfx3Zr7lRWKg4tAw9r4iktyvsTagWkqYCiw==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Diagnostics.FileVersionInfo\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"qjF74OTAU+mRhLaL4YSfiWy3vj6T3AOz8AW37l5zCwfbBfj0k7E94XnEsRaf2TnhE/7QaV6Hvqakoy2LoV8MVg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Reflection.Metadata\": \"1.3.0\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.InteropServices\": \"4.1.0\"\n        }\n      },\n      \"System.Diagnostics.StackTrace\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"6i2EbRq0lgGfiZ+FDf0gVaw9qeEU+7IS2+wbZJmFVpvVzVOgZEt0ScZtyenuBvs6iDYbGiF51bMAa0oDP/tujQ==\",\n        \"dependencies\": {\n          \"System.Collections.Immutable\": \"1.2.0\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Metadata\": \"1.3.0\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\"\n        }\n      },\n      \"System.Diagnostics.Tools\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"xBfJ8pnd4C17dWaC9FM6aShzbJcRNMChUMD42I6772KGGrqaFdumwhn9OdM68erj1ueNo3xdQ1EwiFjK5k8p0g==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Diagnostics.Tracing\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"vDN1PoMZCkkdNjvZLql592oYJZgS7URcJzJ7bxeBgGtx5UtR5leNm49VmfHGqIffX4FKacHbI3H6UyNSHQknBg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Dynamic.Runtime\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"db34f6LHYM0U0JpE+sOmjar27BnqTVkbLJhgfwMpTdgTigG/Hna3m2MYVwnFzGGKnEJk2UXFuoVTr8WUbU91/A==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Linq.Expressions\": \"4.1.0\",\n          \"System.ObjectModel\": \"4.0.12\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Emit\": \"4.0.1\",\n          \"System.Reflection.Emit.ILGeneration\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Reflection.TypeExtensions\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Globalization\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"B95h0YLEL2oSnwF/XjqSWKnwKOy/01VWkNlsCeMTFJLLabflpGV26nK164eRs5GiaRSBGpOxQ3pKoSnnyZN5pg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Globalization.Calendars\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"L1c6IqeQ88vuzC1P81JeHmHA8mxq8a18NUBNXnIY/BVb+TCyAaGIFbhpZt60h9FJNmisymoQkHEFSE9Vslja1Q==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.IO\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"3KlTJceQc3gnGIaHZ7UBZO26SHL1SHE4ddrmiwumFnId+CEHP+O8r386tZKaE6zlk5/mF8vifMBzHj9SaXN+mQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.IO.FileSystem\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"IBErlVq5jOggAD69bg1t0pJcHaDbJbWNUZTPI96fkYWzwYbN6D9wRHMULLDd9dHsl7C2YsxXL31LMfPI1SWt8w==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.IO.FileSystem.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"kWkKD203JJKxJeE74p8aF8y4Qc9r9WQx4C0cHzHPrY3fv/L/IhWnyCHaFJ3H1QPOH6A93whlQ2vG5nHlBDvzWQ==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Linq\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"bQ0iYFOQI0nuTnt+NQADns6ucV4DUvMdwN6CbkB1yj8i7arTGiTN5eok1kQwdnnNWSDZfIUySQY+J3d5KjWn0g==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\"\n        }\n      },\n      \"System.Linq.Expressions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"I+y02iqkgmCAyfbqOmSDOgqdZQ5tTj80Akm5BPSS8EeB0VGWdy6X1KCoYe8Pk6pwDoAKZUOdLVxnTJcExiv5zw==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.ObjectModel\": \"4.0.12\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Emit\": \"4.0.1\",\n          \"System.Reflection.Emit.ILGeneration\": \"4.0.1\",\n          \"System.Reflection.Emit.Lightweight\": \"4.0.1\",\n          \"System.Reflection.Extensions\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Reflection.TypeExtensions\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.ObjectModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.12\",\n        \"contentHash\": \"tAgJM1xt3ytyMoW4qn4wIqgJYm7L7TShRZG4+Q4Qsi2PCcj96pXN7nRywS9KkB3p/xDUjc2HSwP9SROyPYDYKQ==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Reflection\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"JCKANJ0TI7kzoQzuwB/OoJANy1Lg338B6+JVacPl4TpUwi3cReg3nMLplMq2uqYfHFQpKIlHAUVAJlImZz/4ng==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Emit\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"P2wqAj72fFjpP6wb9nSfDqNBMab+2ovzSDzUZK7MVIm54tBJEPr9jWfSjjoTpPwj1LeKcmX3vr0ttyjSSFM47g==\",\n        \"dependencies\": {\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Emit.ILGeneration\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Emit.ILGeneration\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"Ov6dU8Bu15Bc7zuqttgHF12J5lwSWyTf1S+FJouUXVMSqImLZzYaQ+vRr1rQ0OZ0HqsrwWl4dsKHELckQkVpgA==\",\n        \"dependencies\": {\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Emit.Lightweight\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"sSzHHXueZ5Uh0OLpUQprhr+ZYJrLPA2Cmr4gn0wj9+FftNKXx8RIMKvO9qnjk2ebPYUjZ+F2ulGdPOsvj+MEjA==\",\n        \"dependencies\": {\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Emit.ILGeneration\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"GYrtRsZcMuHF3sbmRHfMYpvxZoIN2bQGrYGerUiWLEkqdEUQZhH3TRSaC/oI4wO0II1RKBPlpIa1TOMxIcOOzQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Metadata\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.0\",\n        \"contentHash\": \"jMSCxA4LSyKBGRDm/WtfkO03FkcgRzHxwvQRib1bm2GZ8ifKM1MX1al6breGCEQK280mdl9uQS7JNPXRYk90jw==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Collections.Immutable\": \"1.2.0\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Extensions\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Text.Encoding.Extensions\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Reflection.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"4inTox4wTBaDhB7V3mPvp9XlCbeGYWVEM9/fXALd52vNEAVisc1BoVWQPuUuD0Ga//dNbA/WeMy9u9mzLxGTHQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.TypeExtensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"tsQ/ptQ3H5FYfON8lL4MxRk/8kFyE0A+tGPXmVP967cT/gzLHYxIejIYSxp4JmIeFHVP78g/F2FE1mUUTbDtrg==\",\n        \"dependencies\": {\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Resources.ResourceManager\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"TxwVeUNoTgUOdQ09gfTjvW411MF+w9MBYL7AtNVc+HtBCFlutPLhUCdZjNkjbhj3bNQWMdHboF0KIWEOjJssbA==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Runtime\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"v6c/4Yaa9uWsq+JMhnOFewrYkgdNHNG2eMKuNqRn8P733rNXeRCGvV5FkkjBXn2dbVkPXOsO0xjsEeM1q2zC0g==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\"\n        }\n      },\n      \"System.Runtime.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"CUOHjTT/vgP0qGW22U4/hDlOqXmcPq5YicBaXdUR2UiUoLwBT+olO6we4DVbq57jeX5uXH2uerVZhf0qGj+sVQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Runtime.Handles\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"nCJvEKguXEvk2ymk1gqj625vVnlK3/xdGzx0vOKicQkoquaTBJTP13AIYkocSUwHCLNBwUbXTqTWGDxBTWpt7g==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Runtime.InteropServices\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"16eu3kjHS633yYdkjwShDHZLRNMKVi/s0bY8ODiqJ2RfMhDMAwxZaUaWVnZ2P71kr/or+X9o/xFWtNqz8ivieQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\"\n        }\n      },\n      \"System.Runtime.Numerics\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"+XbKFuzdmLP3d1o9pdHu2nxjNr2OEPqGzKeegPLCUMM71a0t50A/rOcIRmGs9wR7a8KuHX6hYs/7/TymIGLNqg==\",\n        \"dependencies\": {\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\"\n        }\n      },\n      \"System.Security.Cryptography.Algorithms\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.2.0\",\n        \"contentHash\": \"8JQFxbLVdrtIOKMDN38Fn0GWnqYZw/oMlwOUG/qz1jqChvyZlnUmu+0s7wLx7JYua/nAXoESpHA3iw11QFWhXg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Runtime.Numerics\": \"4.0.1\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"runtime.native.System.Security.Cryptography\": \"4.0.0\"\n        }\n      },\n      \"System.Security.Cryptography.Cng\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.2.0\",\n        \"contentHash\": \"cUJ2h+ZvONDe28Szw3st5dOHdjndhJzQ2WObDEXAWRPEQBtVItVoxbXM/OEsTthl3cNn2dk2k0I3y45igCQcLw==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\"\n        }\n      },\n      \"System.Security.Cryptography.Csp\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"/i1Usuo4PgAqgbPNC0NjbO3jPW//BoBlTpcWFD1EHVbidH21y4c1ap5bbEMSGAXjAShhMH4abi/K8fILrnu4BQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Security.Cryptography.Encoding\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"FbKgE5MbxSQMPcSVRgwM6bXN3GtyAh04NkV8E5zKCBE26X0vYW0UtTa2FIgkH33WVqBVxRgxljlVYumWtU+HcQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.Collections.Concurrent\": \"4.0.12\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"runtime.native.System.Security.Cryptography\": \"4.0.0\"\n        }\n      },\n      \"System.Security.Cryptography.OpenSsl\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"HUG/zNUJwEiLkoURDixzkzZdB5yGA5pQhDP93ArOpDPQMteURIGERRNzzoJlmTreLBWr5lkFSjjMSk8ySEpQMw==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Runtime.Numerics\": \"4.0.1\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"runtime.native.System.Security.Cryptography\": \"4.0.0\"\n        }\n      },\n      \"System.Security.Cryptography.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"Wkd7QryWYjkQclX0bngpntW5HSlMzeJU24UaLJQ7YTfI8ydAVAaU2J+HXLLABOVJlKTVvAeL0Aj39VeTe7L+oA==\",\n        \"dependencies\": {\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Security.Cryptography.X509Certificates\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"4HEfsQIKAhA1+ApNn729Gi09zh+lYWwyIuViihoMDWp1vQnEkL2ct7mAbhBlLYm+x/L4Rr/pyGge1lIY635e0w==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Globalization.Calendars\": \"4.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Runtime.Numerics\": \"4.0.1\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Cng\": \"4.2.0\",\n          \"System.Security.Cryptography.Csp\": \"4.0.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.OpenSsl\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\",\n          \"runtime.native.System\": \"4.0.0\",\n          \"runtime.native.System.Net.Http\": \"4.0.1\",\n          \"runtime.native.System.Security.Cryptography\": \"4.0.0\"\n        }\n      },\n      \"System.Text.Encoding\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"U3gGeMlDZXxCEiY4DwVLSacg+DFWCvoiX+JThA/rvw37Sqrku7sEFeVBBBMBnfB6FeZHsyDx85HlKL19x0HtZA==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Text.Encoding.CodePages\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"h4z6rrA/hxWf4655D18IIZ0eaLRa3tQC/j+e26W+VinIHY0l07iEXaAvO0YSYq3MvCjMYy8Zs5AdC1sxNQOB7Q==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Text.Encoding.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"jtbiTDtvfLYgXn8PTfWI+SiBs51rrmO4AAckx4KR6vFK9Wzf6tI8kcRdsYQNwriUeQ1+CtQbM1W4cMbLXnj/OQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\"\n        }\n      },\n      \"System.Text.RegularExpressions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"i88YCXpRTjCnoSQZtdlHkAOx4KNNik4hMy83n0+Ftlb7jvV6ZiZWMpnEZHhjBp6hQVh8gWd/iKNPzlPF7iyA2g==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Threading\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"N+3xqIcg3VDKyjwwCGaZ9HawG9aC6cSDI+s7ROma310GQo8vilFZa86hqKppwTHleR/G0sfOzhvgnUxWCR/DrQ==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Threading.Tasks\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"k1S4Gc6IGwtHGT8188RSeGaX86Qw/wnrgNLshJvsdNUOPP9etMmo8S07c+UlOAx4K/xLuN9ivA1bD0LVurtIxQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Threading.Tasks.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"pH4FZDsZQ/WmgJtN4LWYmRdJAEeVkyriSwrv2Teoe5FOU0Yxlb6II6GL8dBPOfRmutHGATduj3ooMt7dJ2+i+w==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Threading.Tasks.Parallel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"7Pc9t25bcynT9FpMvkUw4ZjYwUiGup/5cJFW72/5MgCG+np2cfVUMdh29u8d7onxX7d8PS3J+wL73zQRqkdrSA==\",\n        \"dependencies\": {\n          \"System.Collections.Concurrent\": \"4.0.12\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Diagnostics.Tracing\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Threading.Thread\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"gIdJqDXlOr5W9zeqFErLw3dsOsiShSCYtF9SEHitACycmvNvY8odf9kiKvp6V7aibc8C4HzzNBkWXjyfn7plbQ==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Xml.ReaderWriter\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"ZIiLPsf67YZ9zgr31vzrFaYQqxRPX9cVHjtPSnmx4eN6lbS/yEyYNr2vs1doGDEscF0tjCZFsk9yUg1sC9e8tg==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Text.Encoding.Extensions\": \"4.0.11\",\n          \"System.Text.RegularExpressions\": \"4.1.0\",\n          \"System.Threading.Tasks\": \"4.0.11\",\n          \"System.Threading.Tasks.Extensions\": \"4.0.0\"\n        }\n      },\n      \"System.Xml.XDocument\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"Mk2mKmPi0nWaoiYeotq1dgeNK1fqWh61+EK+w4Wu8SWuTYLzpUnschb59bJtGywaPq7SmTuPf44wrXRwbIrukg==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Diagnostics.Tools\": \"4.0.1\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\"\n        }\n      },\n      \"System.Xml.XmlDocument\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"2eZu6IP+etFVBBFUFzw2w6J21DqIN5eL9Y8r8JfJWUmV28Z5P0SNU01oCisVHQgHsDhHPnmq2s1hJrJCFZWloQ==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\"\n        }\n      },\n      \"System.Xml.XPath\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"UWd1H+1IJ9Wlq5nognZ/XJdyj8qPE4XufBUkAW59ijsCPjZkZe0MUzKKJFBr+ZWBe5Wq1u1d5f2CYgE93uH7DA==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\"\n        }\n      },\n      \"System.Xml.XPath.XDocument\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"FLhdYJx4331oGovQypQ8JIw2kEmNzCsjVOVYY/16kZTUoquZG85oVn7yUhBE2OZt1yGPSXAL0HTEfzjlbNpM7Q==\",\n        \"dependencies\": {\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\",\n          \"System.Xml.XDocument\": \"4.0.11\",\n          \"System.Xml.XPath\": \"4.0.1\"\n        }\n      },\n      \"sonaranalyzer.shimlayer\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer.lightup\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Metrics/CSharpCognitiveComplexityMetric.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Metrics;\n\nnamespace SonarAnalyzer.CSharp.Metrics;\n\npublic static class CSharpCognitiveComplexityMetric\n{\n    public static CognitiveComplexity GetComplexity(SyntaxNode node) =>\n        GetComplexity(node, false);\n\n    public static CognitiveComplexity GetComplexity(SyntaxNode node, bool onlyGlobalStatements)\n    {\n        var walker = new CognitiveWalker(onlyGlobalStatements);\n        if (node.IsKind(SyntaxKindEx.LocalFunctionStatement))\n        {\n            walker.VisitLocalFunction((LocalFunctionStatementSyntaxWrapper)node, true);\n        }\n        else\n        {\n            walker.SafeVisit(node);\n        }\n\n        return new CognitiveComplexity(walker.State.Complexity, walker.State.IncrementLocations.ToImmutableArray());\n    }\n\n    private sealed class CognitiveWalker : SafeCSharpSyntaxWalker\n    {\n        private readonly bool onlyGlobalStatements;\n\n        public CognitiveComplexityWalkerState<MethodDeclarationSyntax> State { get; } = new();\n\n        public CognitiveWalker(bool onlyGlobalStatements) =>\n            this.onlyGlobalStatements = onlyGlobalStatements;\n\n        public override void Visit(SyntaxNode node)\n        {\n            if (node.IsKind(SyntaxKindEx.LocalFunctionStatement))\n            {\n                VisitLocalFunction((LocalFunctionStatementSyntaxWrapper)node, false);\n            }\n            else if (SwitchExpressionSyntaxWrapper.IsInstance(node))\n            {\n                var switchExpression = (SwitchExpressionSyntaxWrapper)node;\n\n                State.IncreaseComplexityByNestingPlusOne(switchExpression.SwitchKeyword);\n                State.VisitWithNesting(node, base.Visit);\n            }\n            else if (BinaryPatternSyntaxWrapper.IsInstance(node))\n            {\n                var nodeKind = node.Kind();\n                var binaryPatternNode = (BinaryPatternSyntaxWrapper)node;\n                if ((nodeKind == SyntaxKindEx.AndPattern || nodeKind == SyntaxKindEx.OrPattern)\n                    && !State.LogicalOperationsToIgnore.Contains(binaryPatternNode))\n                {\n                    var left = binaryPatternNode.Left.SyntaxNode.RemoveParentheses();\n                    if (!left.IsKind(nodeKind))\n                    {\n                        State.IncreaseComplexityByOne(binaryPatternNode.OperatorToken);\n                    }\n\n                    var right = binaryPatternNode.Right.SyntaxNode.RemoveParentheses();\n                    if (right.IsKind(nodeKind))\n                    {\n                        State.LogicalOperationsToIgnore.Add(right);\n                    }\n                }\n\n                base.Visit(node);\n            }\n            else\n            {\n                base.Visit(node);\n            }\n        }\n\n        public override void VisitCompilationUnit(CompilationUnitSyntax node)\n        {\n            foreach (var globalStatement in node.Members.Where(x => x.IsKind(SyntaxKind.GlobalStatement)))\n            {\n                base.Visit(globalStatement);\n            }\n\n            if (!onlyGlobalStatements)\n            {\n                base.VisitCompilationUnit(node);\n            }\n        }\n\n        public override void VisitMethodDeclaration(MethodDeclarationSyntax node)\n        {\n            State.CurrentMethod = node;\n            base.VisitMethodDeclaration(node);\n\n            if (State.HasDirectRecursiveCall)\n            {\n                State.HasDirectRecursiveCall = false;\n                State.IncreaseComplexity(node.Identifier, 1, \"+1 (recursion)\");\n            }\n        }\n\n        public override void VisitIfStatement(IfStatementSyntax node)\n        {\n            if (node.Parent.IsKind(SyntaxKind.ElseClause))\n            {\n                base.VisitIfStatement(node);\n            }\n            else\n            {\n                State.IncreaseComplexityByNestingPlusOne(node.IfKeyword);\n                State.VisitWithNesting(node, base.VisitIfStatement);\n            }\n        }\n\n        public override void VisitElseClause(ElseClauseSyntax node)\n        {\n            State.IncreaseComplexityByOne(node.ElseKeyword);\n            base.VisitElseClause(node);\n        }\n\n        public override void VisitConditionalExpression(ConditionalExpressionSyntax node)\n        {\n            State.IncreaseComplexityByNestingPlusOne(node.QuestionToken);\n            State.VisitWithNesting(node, base.VisitConditionalExpression);\n        }\n\n        public override void VisitSwitchStatement(SwitchStatementSyntax node)\n        {\n            State.IncreaseComplexityByNestingPlusOne(node.SwitchKeyword);\n            State.VisitWithNesting(node, base.VisitSwitchStatement);\n        }\n\n        public override void VisitForStatement(ForStatementSyntax node)\n        {\n            State.IncreaseComplexityByNestingPlusOne(node.ForKeyword);\n            State.VisitWithNesting(node, base.VisitForStatement);\n        }\n\n        public override void VisitWhileStatement(WhileStatementSyntax node)\n        {\n            State.IncreaseComplexityByNestingPlusOne(node.WhileKeyword);\n            State.VisitWithNesting(node, base.VisitWhileStatement);\n        }\n\n        public override void VisitDoStatement(DoStatementSyntax node)\n        {\n            State.IncreaseComplexityByNestingPlusOne(node.DoKeyword);\n            State.VisitWithNesting(node, base.VisitDoStatement);\n        }\n\n        public override void VisitForEachStatement(ForEachStatementSyntax node)\n        {\n            State.IncreaseComplexityByNestingPlusOne(node.ForEachKeyword);\n            State.VisitWithNesting(node, base.VisitForEachStatement);\n        }\n\n        public override void VisitCatchClause(CatchClauseSyntax node)\n        {\n            State.IncreaseComplexityByNestingPlusOne(node.CatchKeyword);\n            State.VisitWithNesting(node, base.VisitCatchClause);\n        }\n\n        public override void VisitInvocationExpression(InvocationExpressionSyntax node)\n        {\n            if (State.CurrentMethod != null\n                && node.Expression is IdentifierNameSyntax identifierNameSyntax\n                && node.HasExactlyNArguments(State.CurrentMethod.ParameterList.Parameters.Count)\n                && string.Equals(identifierNameSyntax.Identifier.ValueText, State.CurrentMethod.Identifier.ValueText, StringComparison.Ordinal))\n            {\n                State.HasDirectRecursiveCall = true;\n            }\n\n            base.VisitInvocationExpression(node);\n        }\n\n        public override void VisitBinaryExpression(BinaryExpressionSyntax node)\n        {\n            var nodeKind = node.Kind();\n            if ((nodeKind == SyntaxKind.LogicalAndExpression || nodeKind == SyntaxKind.LogicalOrExpression)\n                && !State.LogicalOperationsToIgnore.Contains(node))\n            {\n                var left = node.Left.RemoveParentheses();\n                if (!left.IsKind(nodeKind))\n                {\n                    State.IncreaseComplexityByOne(node.OperatorToken);\n                }\n\n                var right = node.Right.RemoveParentheses();\n                if (right.IsKind(nodeKind))\n                {\n                    State.LogicalOperationsToIgnore.Add(right);\n                }\n            }\n\n            base.VisitBinaryExpression(node);\n        }\n\n        public override void VisitGotoStatement(GotoStatementSyntax node)\n        {\n            State.IncreaseComplexityByNestingPlusOne(node.GotoKeyword);\n            base.VisitGotoStatement(node);\n        }\n\n        public override void VisitSimpleLambdaExpression(SimpleLambdaExpressionSyntax node) =>\n            State.VisitWithNesting(node, base.VisitSimpleLambdaExpression);\n\n        public override void VisitParenthesizedLambdaExpression(ParenthesizedLambdaExpressionSyntax node) =>\n            State.VisitWithNesting(node, base.VisitParenthesizedLambdaExpression);\n\n        public void VisitLocalFunction(LocalFunctionStatementSyntaxWrapper localFunction, bool visitStaticLocalFunctions)\n        {\n            if (visitStaticLocalFunctions || !localFunction.Modifiers.Any(SyntaxKind.StaticKeyword))\n            {\n                State.VisitWithNesting(localFunction.SyntaxNode, base.Visit);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Metrics/CSharpCyclomaticComplexityMetric.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Metrics;\n\npublic static class CSharpCyclomaticComplexityMetric\n{\n    public class CyclomaticComplexity\n    {\n        public CyclomaticComplexity(ImmutableArray<SecondaryLocation> locations)\n        {\n            Locations = locations;\n        }\n\n        public ImmutableArray<SecondaryLocation> Locations { get; }\n        public int Complexity => Locations.Length;\n    }\n\n    public static CyclomaticComplexity GetComplexity(SyntaxNode syntaxNode) =>\n        GetComplexity(syntaxNode, false);\n\n    public static CyclomaticComplexity GetComplexity(SyntaxNode syntaxNode, bool onlyGlobalStatements)\n    {\n        var walker = new CyclomaticWalker(onlyGlobalStatements);\n        if (syntaxNode.IsKind(SyntaxKindEx.LocalFunctionStatement))\n        {\n            walker.VisitLocalFunction((LocalFunctionStatementSyntaxWrapper)syntaxNode);\n        }\n        else\n        {\n            walker.SafeVisit(syntaxNode);\n        }\n\n        return new CyclomaticComplexity(walker.IncrementLocations.ToImmutableArray());\n    }\n\n    private sealed class CyclomaticWalker : SafeCSharpSyntaxWalker\n    {\n        private readonly bool onlyGlobalStatements;\n\n        public List<SecondaryLocation> IncrementLocations { get; } = new();\n\n        public CyclomaticWalker(bool onlyGlobalStatements) =>\n            this.onlyGlobalStatements = onlyGlobalStatements;\n\n        public override void VisitCompilationUnit(CompilationUnitSyntax node)\n        {\n            foreach (var globalStatement in node.Members.Where(x => x.IsKind(SyntaxKind.GlobalStatement)))\n            {\n                if (!IsStaticLocalFunction(globalStatement))\n                {\n                    base.Visit(globalStatement);\n                }\n            }\n\n            if (!onlyGlobalStatements)\n            {\n                base.VisitCompilationUnit(node);\n            }\n        }\n\n        public override void VisitMethodDeclaration(MethodDeclarationSyntax node)\n        {\n            if (node.ExpressionBody != null || HasBody(node))\n            {\n                AddLocation(node.Identifier);\n            }\n            base.VisitMethodDeclaration(node);\n        }\n\n        public override void VisitPropertyDeclaration(PropertyDeclarationSyntax node)\n        {\n            if (node.ExpressionBody != null || HasBody(node))\n            {\n                AddLocation(node.Identifier);\n            }\n            base.VisitPropertyDeclaration(node);\n        }\n\n        public override void VisitOperatorDeclaration(OperatorDeclarationSyntax node)\n        {\n            AddLocation(node.OperatorToken);\n            base.VisitOperatorDeclaration(node);\n        }\n\n        public override void VisitConstructorDeclaration(ConstructorDeclarationSyntax node)\n        {\n            AddLocation(node.Identifier);\n            base.VisitConstructorDeclaration(node);\n        }\n\n        public override void VisitDestructorDeclaration(DestructorDeclarationSyntax node)\n        {\n            AddLocation(node.Identifier);\n            base.VisitDestructorDeclaration(node);\n        }\n\n        public override void VisitAccessorDeclaration(AccessorDeclarationSyntax node)\n        {\n            AddLocation(node.Keyword);\n            base.VisitAccessorDeclaration(node);\n        }\n\n        public override void VisitIfStatement(IfStatementSyntax node)\n        {\n            AddLocation(node.IfKeyword);\n            base.VisitIfStatement(node);\n        }\n\n        public override void VisitConditionalExpression(ConditionalExpressionSyntax node)\n        {\n            AddLocation(node.QuestionToken);\n            base.VisitConditionalExpression(node);\n        }\n\n        public override void VisitConditionalAccessExpression(ConditionalAccessExpressionSyntax node)\n        {\n            AddLocation(node.OperatorToken);\n            base.VisitConditionalAccessExpression(node);\n        }\n\n        public override void VisitWhileStatement(WhileStatementSyntax node)\n        {\n            AddLocation(node.WhileKeyword);\n            base.VisitWhileStatement(node);\n        }\n\n        public override void VisitDoStatement(DoStatementSyntax node)\n        {\n            AddLocation(node.DoKeyword);\n            base.VisitDoStatement(node);\n        }\n\n        public override void VisitForStatement(ForStatementSyntax node)\n        {\n            AddLocation(node.ForKeyword);\n            base.VisitForStatement(node);\n        }\n\n        public override void VisitForEachStatement(ForEachStatementSyntax node)\n        {\n            AddLocation(node.ForEachKeyword);\n            base.VisitForEachStatement(node);\n        }\n\n        public override void VisitBinaryExpression(BinaryExpressionSyntax node)\n        {\n            if (node.IsKind(SyntaxKind.CoalesceExpression) ||\n                node.IsKind(SyntaxKind.LogicalAndExpression) ||\n                node.IsKind(SyntaxKind.LogicalOrExpression))\n            {\n                AddLocation(node.OperatorToken);\n            }\n\n            base.VisitBinaryExpression(node);\n        }\n\n        public override void VisitAssignmentExpression(AssignmentExpressionSyntax node)\n        {\n            if (node.IsKind(SyntaxKindEx.CoalesceAssignmentExpression))\n            {\n                AddLocation(node.OperatorToken);\n            }\n\n            base.VisitAssignmentExpression(node);\n        }\n\n        public override void VisitCaseSwitchLabel(CaseSwitchLabelSyntax node)\n        {\n            AddLocation(node.Keyword);\n            base.VisitCaseSwitchLabel(node);\n        }\n\n        public void VisitLocalFunction(LocalFunctionStatementSyntaxWrapper node)\n        {\n            AddLocation(node.Identifier);\n            base.Visit(node.SyntaxNode);\n        }\n\n        public override void Visit(SyntaxNode node)\n        {\n            if (SwitchExpressionArmSyntaxWrapper.IsInstance(node))\n            {\n                var arm = (SwitchExpressionArmSyntaxWrapper)node;\n                AddLocation(arm.EqualsGreaterThanToken);\n            }\n            else if (node?.Kind() is SyntaxKindEx.AndPattern or SyntaxKindEx.OrPattern)\n            {\n                var binaryPatternNode = (BinaryPatternSyntaxWrapper)node;\n                AddLocation(binaryPatternNode.OperatorToken);\n            }\n\n            if (!IsStaticLocalFunction(node))\n            {\n                base.Visit(node);\n            }\n        }\n\n        private void AddLocation(SyntaxToken node) => IncrementLocations.Add(new SecondaryLocation(node.GetLocation(), \"+1\"));\n\n        private static bool HasBody(SyntaxNode node) => node.ChildNodes().AnyOfKind(SyntaxKind.Block);\n\n        private static bool IsStaticLocalFunction(SyntaxNode node) =>\n            node.IsKind(SyntaxKindEx.LocalFunctionStatement)\n            && ((LocalFunctionStatementSyntaxWrapper)node).Modifiers.Any(SyntaxKind.StaticKeyword);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Metrics/CSharpExecutableLinesMetric.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Metrics;\n\npublic static class CSharpExecutableLinesMetric\n{\n    public static ImmutableArray<int> GetLineNumbers(SyntaxTree syntaxTree, SemanticModel semanticModel)\n    {\n        var walker = GetWalker(syntaxTree, semanticModel);\n        walker.SafeVisit(syntaxTree.GetRoot());\n        return walker.ExecutableLineNumbers.ToImmutableArray();\n    }\n\n    private static ExecutableLinesWalker GetWalker(SyntaxTree syntaxTree, SemanticModel semanticModel) =>\n        GeneratedCodeRecognizer.IsRazor(syntaxTree)\n            ? new RazorExecutableLinesWalker(semanticModel)\n            : new ExecutableLinesWalker(semanticModel);\n\n    private class ExecutableLinesWalker : SafeCSharpSyntaxWalker\n    {\n        private readonly SemanticModel model;\n\n        public HashSet<int> ExecutableLineNumbers { get; } = new();\n\n        protected virtual bool AddExecutableLineNumbers(Location location)\n        {\n            ExecutableLineNumbers.Add(location.LineNumberToReport());\n            return true;\n        }\n\n        public ExecutableLinesWalker(SemanticModel model) =>\n            this.model = model;\n\n        public override void DefaultVisit(SyntaxNode node)\n        {\n            if (FindExecutableLines(node))\n            {\n                base.DefaultVisit(node);\n            }\n        }\n\n        private bool FindExecutableLines(SyntaxNode node)\n        {\n            switch (node.Kind())\n            {\n                case SyntaxKind.AttributeList:\n                    return false;\n\n                case SyntaxKind.CheckedStatement:\n                case SyntaxKind.UncheckedStatement:\n\n                case SyntaxKind.LockStatement:\n                case SyntaxKind.FixedStatement:\n                case SyntaxKind.UnsafeStatement:\n                case SyntaxKind.UsingStatement:\n\n                case SyntaxKind.EmptyStatement:\n                case SyntaxKind.ExpressionStatement:\n\n                case SyntaxKind.DoStatement:\n                case SyntaxKind.ForEachStatement:\n                case SyntaxKind.ForStatement:\n                case SyntaxKind.WhileStatement:\n\n                case SyntaxKind.IfStatement:\n                case SyntaxKind.LabeledStatement:\n                case SyntaxKind.SwitchStatement:\n                case SyntaxKind.ConditionalAccessExpression:\n                case SyntaxKind.ConditionalExpression:\n\n                case SyntaxKind.GotoStatement:\n                case SyntaxKind.ThrowStatement:\n                case SyntaxKind.ReturnStatement:\n                case SyntaxKind.BreakStatement:\n                case SyntaxKind.ContinueStatement:\n\n                case SyntaxKind.YieldBreakStatement:\n                case SyntaxKind.YieldReturnStatement:\n\n                case SyntaxKind.SimpleMemberAccessExpression:\n                case SyntaxKind.InvocationExpression:\n\n                case SyntaxKind.SimpleLambdaExpression:\n                case SyntaxKind.ParenthesizedLambdaExpression:\n\n                case SyntaxKind.ArrayInitializerExpression:\n                    return AddExecutableLineNumbers(node.GetLocation());\n\n                case SyntaxKind.StructDeclaration:\n                case SyntaxKind.ClassDeclaration:\n                case SyntaxKindEx.RecordDeclaration:\n                case SyntaxKindEx.RecordStructDeclaration:\n                    return !HasExcludedCodeAttribute(node, ((BaseTypeDeclarationSyntax)node).AttributeLists, true);\n\n                case SyntaxKind.MethodDeclaration:\n                case SyntaxKind.ConstructorDeclaration:\n                    return !HasExcludedCodeAttribute(node, ((BaseMethodDeclarationSyntax)node).AttributeLists, true);\n\n                case SyntaxKind.PropertyDeclaration:\n                    return !HasExcludedCodeAttribute(node, ((BasePropertyDeclarationSyntax)node).AttributeLists, true);\n\n                case SyntaxKind.EventDeclaration:\n                    return !HasExcludedCodeAttribute(node, ((BasePropertyDeclarationSyntax)node).AttributeLists, false);\n\n                case SyntaxKind.AddAccessorDeclaration:\n                case SyntaxKind.RemoveAccessorDeclaration:\n                case SyntaxKind.SetAccessorDeclaration:\n                case SyntaxKind.GetAccessorDeclaration:\n                case SyntaxKindEx.InitAccessorDeclaration:\n                    return !HasExcludedCodeAttribute(node, ((AccessorDeclarationSyntax)node).AttributeLists, false);\n\n                default:\n                    return true;\n            }\n        }\n\n        private bool HasExcludedCodeAttribute(SyntaxNode node, SyntaxList<AttributeListSyntax> attributeLists, bool canBePartial)\n        {\n            var hasExcludeFromCodeCoverageAttribute = attributeLists.SelectMany(x => x.Attributes).Any(IsExcludedAttribute);\n            return hasExcludeFromCodeCoverageAttribute || !canBePartial\n                ? hasExcludeFromCodeCoverageAttribute\n                : model.GetDeclaredSymbol(node) is { Kind: SymbolKind.Method or SymbolKind.Property or SymbolKind.NamedType} symbol\n                  && symbol.HasAttribute(KnownType.System_Diagnostics_CodeAnalysis_ExcludeFromCodeCoverageAttribute);\n        }\n\n        private bool IsExcludedAttribute(AttributeSyntax attribute) =>\n            attribute.IsKnownType(KnownType.System_Diagnostics_CodeAnalysis_ExcludeFromCodeCoverageAttribute, model);\n    }\n\n    private sealed class RazorExecutableLinesWalker : ExecutableLinesWalker\n    {\n        public RazorExecutableLinesWalker(SemanticModel model) : base(model) { }\n\n        protected override bool AddExecutableLineNumbers(Location location)\n        {\n            var mappedLocation = location.GetMappedLineSpan();\n            if (mappedLocation.HasMappedPath)\n            {\n                ExecutableLineNumbers.Add(mappedLocation.StartLinePosition.LineNumberToReport());\n            }\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Metrics/CSharpMetrics.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Metrics;\n\nnamespace SonarAnalyzer.CSharp.Metrics;\n\npublic class CSharpMetrics : MetricsBase\n{\n    private readonly Lazy<ImmutableArray<int>> lazyExecutableLines;\n\n    public override ImmutableArray<int> ExecutableLines =>\n        lazyExecutableLines.Value;\n\n    public CSharpMetrics(SyntaxTree tree, SemanticModel semanticModel) : base(tree)\n    {\n        if (tree.GetRoot().Language != LanguageNames.CSharp)\n        {\n            throw new ArgumentException(InitializationErrorTextPattern, nameof(tree));\n        }\n\n        lazyExecutableLines = new Lazy<ImmutableArray<int>>(() =>\n            CSharpExecutableLinesMetric.GetLineNumbers(tree, semanticModel));\n    }\n\n    protected override int ComputeCognitiveComplexity(SyntaxNode node) =>\n        CSharpCognitiveComplexityMetric.GetComplexity(node).Complexity;\n\n    public override int ComputeCyclomaticComplexity(SyntaxNode node) =>\n        CSharpCyclomaticComplexityMetric.GetComplexity(node).Complexity;\n\n    protected override bool IsClass(SyntaxNode node)\n    {\n        switch (node.Kind())\n        {\n            case SyntaxKind.ClassDeclaration:\n            case SyntaxKindEx.RecordDeclaration:\n            case SyntaxKind.StructDeclaration:\n            case SyntaxKindEx.RecordStructDeclaration:\n            case SyntaxKind.InterfaceDeclaration:\n                return IsInSameFile(node.GetLocation().GetMappedLineSpan());\n\n            default:\n                return false;\n        }\n    }\n\n    protected override bool IsCommentTrivia(SyntaxTrivia trivia) =>\n        trivia.IsComment();\n\n    protected override bool IsEndOfFile(SyntaxToken token) =>\n        token.IsKind(SyntaxKind.EndOfFileToken);\n\n    protected override bool IsFunction(SyntaxNode node)\n    {\n        switch (node.Kind())\n        {\n            case SyntaxKindEx.LocalFunctionStatement:\n                return true;\n\n            case SyntaxKind.PropertyDeclaration:\n                return ((PropertyDeclarationSyntax)node).ExpressionBody is not null;\n\n            case SyntaxKind.ConstructorDeclaration:\n            case SyntaxKind.ConversionOperatorDeclaration:\n            case SyntaxKind.DestructorDeclaration:\n            case SyntaxKind.OperatorDeclaration:\n                return ((BaseMethodDeclarationSyntax)node).HasBodyOrExpressionBody(); // Non-abstract, non-interface methods\n            case SyntaxKind.MethodDeclaration:\n                var methodDeclaration = (BaseMethodDeclarationSyntax)node;\n                return methodDeclaration.HasBodyOrExpressionBody() // Non-abstract, non-interface methods\n                    && IsInSameFile(methodDeclaration.GetLocation().GetMappedLineSpan()); // Excluding razor functions that are not mapped\n            case SyntaxKind.AddAccessorDeclaration:\n            case SyntaxKind.GetAccessorDeclaration:\n            case SyntaxKind.RemoveAccessorDeclaration:\n            case SyntaxKind.SetAccessorDeclaration:\n            case SyntaxKindEx.InitAccessorDeclaration:\n                var accessor = (AccessorDeclarationSyntax)node;\n                if (accessor.HasBodyOrExpressionBody())\n                {\n                    return true;\n                }\n\n                if (accessor is { Parent.Parent: BasePropertyDeclarationSyntax { RawKind: (int)SyntaxKind.PropertyDeclaration or (int)SyntaxKind.EventDeclaration } basePropertyNode })\n                {\n                    return !basePropertyNode.Modifiers.Any(x => x.IsAnyKind(SyntaxKind.AbstractKeyword, SyntaxKind.PartialKeyword))\n                        && !basePropertyNode.Parent.IsKind(SyntaxKind.InterfaceDeclaration);\n                }\n                // Unexpected\n                return false;\n\n            default:\n                return false;\n        }\n    }\n\n    protected override bool IsNoneToken(SyntaxToken token) =>\n        token.IsKind(SyntaxKind.None);\n\n    protected override bool IsStatement(SyntaxNode node)\n    {\n        switch (node.Kind())\n        {\n            case SyntaxKind.BreakStatement:\n            case SyntaxKind.CheckedStatement:\n            case SyntaxKind.ContinueStatement:\n            case SyntaxKind.DoStatement:\n            case SyntaxKind.EmptyStatement:\n            case SyntaxKind.ExpressionStatement:\n            case SyntaxKind.FixedStatement:\n            case SyntaxKind.ForEachStatement:\n            case SyntaxKindEx.ForEachVariableStatement:\n            case SyntaxKind.ForStatement:\n            case SyntaxKind.GlobalStatement:\n            case SyntaxKind.GotoCaseStatement:\n            case SyntaxKind.GotoDefaultStatement:\n            case SyntaxKind.GotoStatement:\n            case SyntaxKind.IfStatement:\n            case SyntaxKind.LabeledStatement:\n            case SyntaxKind.LocalDeclarationStatement:\n            case SyntaxKindEx.LocalFunctionStatement:\n            case SyntaxKind.LockStatement:\n            case SyntaxKind.ReturnStatement:\n            case SyntaxKind.SwitchStatement:\n            case SyntaxKind.ThrowStatement:\n            case SyntaxKind.TryStatement:\n            case SyntaxKind.UncheckedStatement:\n            case SyntaxKind.UnsafeStatement:\n            case SyntaxKind.UsingStatement:\n            case SyntaxKind.WhileStatement:\n            case SyntaxKind.YieldBreakStatement:\n            case SyntaxKind.YieldReturnStatement:\n                return IsInSameFile(node.GetLocation().GetMappedLineSpan()); // Excluding razor statements that are not mapped\n            case SyntaxKind.Block:\n                return false;\n\n            default:\n                return node is StatementSyntax\n                           ? throw new InvalidOperationException($\"{node.Kind()} is statement and it isn't handled.\")\n                           : false;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Properties/AssemblyInfo.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Runtime.CompilerServices;\n\n[assembly: InternalsVisibleTo(\"SonarAnalyzer.Test\")]\n[assembly: InternalsVisibleTo(\"SonarAnalyzer.Enterprise.Test\")]\n[assembly: InternalsVisibleTo(\"SonarAnalyzer.TestFramework.Test\")]\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/AbstractClassToInterface.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class AbstractClassToInterface : SonarDiagnosticAnalyzer<SyntaxKind>\n{\n    private const string DiagnosticId = \"S1694\";\n\n    protected override string MessageFormat => \"Convert this 'abstract' {0} to an interface.\";\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    public AbstractClassToInterface() : base(DiagnosticId) { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterSymbolAction(\n            c =>\n            {\n                var symbol = (INamedTypeSymbol)c.Symbol;\n                if (symbol.IsClass()\n                    && symbol.IsAbstract\n                    && symbol.BaseType.Is(KnownType.System_Object)\n                    && !IsRecordWithParameters(symbol)\n                    && AllMethodsAreAbstract(symbol)\n                    && !symbol.GetMembers().OfType<IFieldSymbol>().Any())\n                {\n                    foreach (var declaringSyntaxReference in symbol.DeclaringSyntaxReferences)\n                    {\n                        var node = declaringSyntaxReference.GetSyntax();\n                        if (node is ClassDeclarationSyntax classDeclaration)\n                        {\n                            c.ReportIssue(Rule, classDeclaration.Identifier, \"class\");\n                        }\n\n                        if (RecordDeclarationSyntaxWrapper.IsInstance(node))\n                        {\n                            var wrapper = (RecordDeclarationSyntaxWrapper)node;\n                            c.ReportIssue(Rule, wrapper.Identifier, \"record\");\n                        }\n                    }\n                }\n            },\n            SymbolKind.NamedType);\n\n    private static bool IsRecordWithParameters(ISymbol symbol) =>\n        symbol.DeclaringSyntaxReferences.Any(x => x.GetSyntax() is { } node\n                                                  && RecordDeclarationSyntaxWrapper.IsInstance(node)\n                                                  && ((RecordDeclarationSyntaxWrapper)node).ParameterList is { Parameters.Count: > 0 });\n\n    private static bool AllMethodsAreAbstract(INamedTypeSymbol symbol)\n    {\n        var methods = symbol.GetMembers().Where(x => x is IMethodSymbol { IsImplicitlyDeclared: false }).ToArray();\n        return methods.Any() && Array.TrueForAll(methods, x => x.IsAbstract);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/AbstractTypesShouldNotHaveConstructors.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class AbstractTypesShouldNotHaveConstructors : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S3442\";\n        private const string MessageFormat = \"Change the visibility of this constructor to '{0}'.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    if (c.Node.Parent.GetModifiers().Any(SyntaxKind.AbstractKeyword))\n                    {\n                        var invalidAccessModifier = c.Node.GetModifiers().FirstOrDefault(IsPublicOrInternal);\n                        if (invalidAccessModifier != default)\n                        {\n                            c.ReportIssue(Rule, invalidAccessModifier, SuggestModifier(invalidAccessModifier));\n                        }\n                    }\n                },\n                SyntaxKind.ConstructorDeclaration);\n\n        private static bool IsPublicOrInternal(SyntaxToken token) =>\n            token.IsKind(SyntaxKind.PublicKeyword) || token.IsKind(SyntaxKind.InternalKeyword);\n\n        private static string SuggestModifier(SyntaxToken token) =>\n            token.IsKind(SyntaxKind.InternalKeyword) ? \"private protected\" : \"protected\";\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/AllBranchesShouldNotHaveSameImplementation.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class AllBranchesShouldNotHaveSameImplementation : AllBranchesShouldNotHaveSameImplementationBase\n    {\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } =\n            ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                context => Analyze(context, (SwitchExpressionSyntaxWrapper)context.Node),\n                SyntaxKindEx.SwitchExpression);\n\n            context.RegisterNodeAction(\n                new SwitchStatementAnalyzer().GetAnalysisAction(rule),\n                SyntaxKind.SwitchStatement);\n\n            context.RegisterNodeAction(\n                new TernaryStatementAnalyzer().GetAnalysisAction(rule),\n                SyntaxKind.ConditionalExpression);\n\n            context.RegisterNodeAction(\n                new IfStatementAnalyzer().GetAnalysisAction(rule),\n                SyntaxKind.ElseClause);\n        }\n\n        private static void Analyze(SonarSyntaxNodeReportingContext context, SwitchExpressionSyntaxWrapper switchExpression)\n        {\n            var arms = switchExpression.Arms;\n            if (arms.Count < 2)\n            {\n                return;\n            }\n            var firstArm = arms[0];\n            if (switchExpression.HasDiscardPattern() &&\n                arms.Skip(1).All(arm => SyntaxFactory.AreEquivalent(arm.Expression, firstArm.Expression)))\n            {\n                context.ReportIssue(rule, switchExpression.SwitchKeyword, StatementsMessage);\n            }\n        }\n\n        private class IfStatementAnalyzer : IfStatementAnalyzerBase<ElseClauseSyntax, IfStatementSyntax>\n        {\n            protected override bool IsLastElseInChain(ElseClauseSyntax elseSyntax) =>\n                !(elseSyntax.Statement is IfStatementSyntax);\n\n            protected override IEnumerable<SyntaxNode> GetStatements(ElseClauseSyntax elseSyntax) =>\n                new[] { elseSyntax.Statement };\n\n            protected override IEnumerable<IEnumerable<SyntaxNode>> GetIfBlocksStatements(ElseClauseSyntax elseSyntax,\n                out IfStatementSyntax topLevelIf)\n            {\n                var allStatements = new List<IEnumerable<SyntaxNode>>();\n\n                var currentElse = elseSyntax;\n\n                topLevelIf = null;\n\n                while (currentElse?.Parent is IfStatementSyntax currentIf)\n                {\n                    topLevelIf = currentIf;\n                    allStatements.Add(new[] { currentIf.Statement });\n                    currentElse = currentIf.Parent as ElseClauseSyntax;\n                }\n\n                return allStatements;\n            }\n\n            protected override Location GetLocation(IfStatementSyntax topLevelIf) => topLevelIf.IfKeyword.GetLocation();\n        }\n\n        private class TernaryStatementAnalyzer : TernaryStatementAnalyzerBase<ConditionalExpressionSyntax>\n        {\n            protected override SyntaxNode GetWhenFalse(ConditionalExpressionSyntax ternaryStatement) =>\n                ternaryStatement.WhenFalse.RemoveParentheses();\n\n            protected override SyntaxNode GetWhenTrue(ConditionalExpressionSyntax ternaryStatement) =>\n                ternaryStatement.WhenTrue.RemoveParentheses();\n\n            protected override Location GetLocation(ConditionalExpressionSyntax ternaryStatement) =>\n                ternaryStatement.Condition.CreateLocation(ternaryStatement.QuestionToken);\n        }\n\n        private class SwitchStatementAnalyzer : SwitchStatementAnalyzerBase<SwitchStatementSyntax, SwitchSectionSyntax>\n        {\n            protected override bool AreEquivalent(SwitchSectionSyntax section1, SwitchSectionSyntax section2) =>\n                SyntaxFactory.AreEquivalent(section1.Statements, section2.Statements);\n\n            protected override IEnumerable<SwitchSectionSyntax> GetSections(SwitchStatementSyntax switchStatement) =>\n                switchStatement.Sections;\n\n            protected override bool HasDefaultLabel(SwitchStatementSyntax switchStatement) =>\n                switchStatement.HasDefaultLabel();\n\n            protected override Location GetLocation(SwitchStatementSyntax switchStatement) =>\n                switchStatement.SwitchKeyword.GetLocation();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/AlwaysSetDateTimeKind.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class AlwaysSetDateTimeKind : AlwaysSetDateTimeKindBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override SyntaxKind ObjectCreationExpression => SyntaxKind.ObjectCreationExpression;\n\n    protected override string[] ValidNames { get; } = new[] { nameof(DateTime) };\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        base.Initialize(context);\n        context.RegisterNodeAction(c =>\n        {\n            if (IsDateTimeConstructorWithoutKindParameter(c.Node, c.Model))\n            {\n                c.ReportIssue(Rule, c.Node);\n            }\n        },\n        SyntaxKindEx.ImplicitObjectCreationExpression);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/AnonymousDelegateEventUnsubscribe.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class AnonymousDelegateEventUnsubscribe : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S3244\";\n        private const string MessageFormat = \"Unsubscribe with the same delegate that was used for the subscription.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var assignment = (AssignmentExpressionSyntax)c.Node;\n\n\n                    if (c.Model.GetSymbolInfo(assignment.Left).Symbol is IEventSymbol @event &&\n                        assignment.Right is AnonymousFunctionExpressionSyntax)\n                    {\n                        c.ReportIssue(rule, assignment.OperatorToken.CreateLocation(assignment));\n                    }\n                },\n                SyntaxKind.SubtractAssignmentExpression);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ArgumentSpecifiedForCallerInfoParameter.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ArgumentSpecifiedForCallerInfoParameter : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S3236\";\n    private const string MessageFormat = \"Remove this argument from the method call; it hides the caller information.\";\n\n    private static readonly ImmutableArray<KnownType> CallerInfoAttributesToReportOn =\n    ImmutableArray.Create(\n        KnownType.System_Runtime_CompilerServices_CallerArgumentExpressionAttribute,\n        KnownType.System_Runtime_CompilerServices_CallerFilePathAttribute,\n        KnownType.System_Runtime_CompilerServices_CallerLineNumberAttribute);\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n        {\n            if (new CSharpMethodParameterLookup((InvocationExpressionSyntax)c.Node, c.Model) is { MethodSymbol: { } } methodParameterLookup\n                && !(methodParameterLookup.MethodSymbol.ContainingType.Is(KnownType.System_Diagnostics_Debug) && (methodParameterLookup.MethodSymbol.Name == \"Assert\"))\n                && methodParameterLookup.GetAllArgumentParameterMappings() is { } argumentMappings)\n            {\n                foreach (var argumentMapping in argumentMappings.Where(x =>\n                    x.Symbol.GetAttributes(CallerInfoAttributesToReportOn).Any()\n                    && !IsArgumentPassthroughOfParameter(c.Model, x.Node, x.Symbol)))\n                {\n                    c.ReportIssue(Rule, argumentMapping.Node);\n                }\n            }\n        }, SyntaxKind.InvocationExpression);\n\n    private static bool IsArgumentPassthroughOfParameter(SemanticModel model, ArgumentSyntax argument, IParameterSymbol targetParameter) =>\n        model.GetSymbolInfo(argument.Expression).Symbol is IParameterSymbol sourceParameter // the argument passed to the method is itself an parameter.\n                                                                                            // Let's check if it has the same attributes.\n            && sourceParameter.GetAttributes(CallerInfoAttributesToReportOn).ToList() is var sourceAttributes\n            && targetParameter.GetAttributes(CallerInfoAttributesToReportOn).ToList() is var targetAttributes\n            && targetAttributes.All(x => sourceAttributes.Any(y => x.AttributeClass.Name == y.AttributeClass.Name));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ArrayCovariance.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class ArrayCovariance : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S2330\";\n        private const string MessageFormat = \"Refactor the code to not rely on potentially unsafe array conversions.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(RaiseOnArrayCovarianceInSimpleAssignmentExpression, SyntaxKind.SimpleAssignmentExpression);\n            context.RegisterNodeAction(RaiseOnArrayCovarianceInVariableDeclaration, SyntaxKind.VariableDeclaration);\n            context.RegisterNodeAction(RaiseOnArrayCovarianceInInvocationExpression, SyntaxKind.InvocationExpression);\n            context.RegisterNodeAction(RaiseOnArrayCovarianceInCastExpression, SyntaxKind.CastExpression);\n        }\n\n        private static void RaiseOnArrayCovarianceInSimpleAssignmentExpression(SonarSyntaxNodeReportingContext context)\n        {\n            var assignment = (AssignmentExpressionSyntax)context.Node;\n            VerifyExpression(assignment.Right, context.Model.GetTypeInfo(assignment.Left).Type, context);\n        }\n\n        private static void RaiseOnArrayCovarianceInVariableDeclaration(SonarSyntaxNodeReportingContext context)\n        {\n            var variableDeclaration = (VariableDeclarationSyntax)context.Node;\n            var baseType = context.Model.GetTypeInfo(variableDeclaration.Type).Type;\n\n            foreach (var declaration in variableDeclaration.Variables.Where(syntax => syntax.Initializer != null))\n            {\n                VerifyExpression(declaration.Initializer.Value, baseType, context);\n            }\n        }\n\n        private static void RaiseOnArrayCovarianceInInvocationExpression(SonarSyntaxNodeReportingContext context)\n        {\n            var invocation = (InvocationExpressionSyntax)context.Node;\n            var methodParameterLookup = new CSharpMethodParameterLookup(invocation, context.Model);\n\n            foreach (var argument in invocation.ArgumentList.Arguments)\n            {\n                if (!methodParameterLookup.TryGetSymbol(argument, out var parameter) || parameter.IsParams)\n                {\n                    continue;\n                }\n\n                VerifyExpression(argument.Expression, parameter.Type, context);\n            }\n        }\n\n        private static void RaiseOnArrayCovarianceInCastExpression(SonarSyntaxNodeReportingContext context)\n        {\n            var castExpression = (CastExpressionSyntax)context.Node;\n            var baseType = context.Model.GetTypeInfo(castExpression.Type).Type;\n\n            VerifyExpression(castExpression.Expression, baseType, context);\n        }\n\n        private static void VerifyExpression(SyntaxNode node, ITypeSymbol baseType, SonarSyntaxNodeReportingContext context)\n        {\n            foreach (var pair in GetPossibleTypes(node, context.Model).Where(pair => AreCovariantArrayTypes(pair.Symbol, baseType)))\n            {\n                context.ReportIssue(Rule, pair.Node);\n            }\n        }\n\n        private static bool AreCovariantArrayTypes(ITypeSymbol typeDerivedArray, ITypeSymbol typeBaseArray)\n        {\n            if (typeDerivedArray == null\n                || !(typeBaseArray is {Kind: SymbolKind.ArrayType})\n                || typeDerivedArray.Kind != SymbolKind.ArrayType)\n            {\n                return false;\n            }\n\n            var typeDerivedElement = ((IArrayTypeSymbol)typeDerivedArray).ElementType;\n            var typeBaseElement = ((IArrayTypeSymbol)typeBaseArray).ElementType;\n\n            return typeDerivedElement.BaseType?.ConstructedFrom.DerivesFrom(typeBaseElement) == true;\n        }\n\n        private static IEnumerable<NodeTypePair> GetPossibleTypes(SyntaxNode syntax, SemanticModel semanticModel)\n        {\n            while (syntax is ParenthesizedExpressionSyntax parenthesizedExpression)\n            {\n                syntax = parenthesizedExpression.Expression;\n            }\n\n            if (syntax is ConditionalExpressionSyntax conditionalExpression)\n            {\n                yield return new NodeTypePair(conditionalExpression.WhenTrue, semanticModel);\n                yield return new NodeTypePair(conditionalExpression.WhenFalse, semanticModel);\n            }\n            else if (syntax.IsKind(SyntaxKind.CoalesceExpression))\n            {\n                var binaryExpression = (BinaryExpressionSyntax)syntax;\n                yield return new NodeTypePair(binaryExpression.Left, semanticModel);\n                yield return new NodeTypePair(binaryExpression.Right, semanticModel);\n            }\n            else\n            {\n                yield return new NodeTypePair(syntax, semanticModel);\n            }\n        }\n\n        private readonly struct NodeTypePair\n        {\n            public ITypeSymbol Symbol { get; }\n\n            public SyntaxNode Node { get; }\n\n            public NodeTypePair(SyntaxNode node, SemanticModel model)\n            {\n                Symbol = model.GetTypeInfo(node).Type;\n                Node = node;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ArrayPassedAsParams.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ArrayPassedAsParams : ArrayPassedAsParamsBase<SyntaxKind, CSharpSyntaxNode>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override SyntaxKind[] ExpressionKinds { get; } =\n        [\n            SyntaxKind.ObjectCreationExpression,\n            SyntaxKind.InvocationExpression,\n            SyntaxKindEx.ImplicitObjectCreationExpression,\n            SyntaxKind.Attribute\n        ];\n\n    protected override CSharpSyntaxNode LastArgumentIfArrayCreation(SyntaxNode expression)\n    {\n        CSharpSyntaxNode lastArgument = expression switch\n        {\n             AttributeSyntax { ArgumentList.Arguments: { Count: > 0 } args } when args.Last().NameEquals is null => args.Last(),\n            _ when ArgumentList(expression) is { Arguments: { Count: > 0 } args } => args.Last(),\n            _ => null\n        };\n\n        return IsArrayCreation(lastArgument)\n            ? lastArgument\n            : null;\n    }\n\n    protected override ITypeSymbol ArrayElementType(CSharpSyntaxNode argument, SemanticModel model) =>\n        ArgumentExpression(argument) switch\n        {\n            ArrayCreationExpressionSyntax arrayCreation => model.GetTypeInfo(arrayCreation.Type.ElementType).Type,\n            ImplicitArrayCreationExpressionSyntax implicitArrayCreation => (model.GetTypeInfo(implicitArrayCreation).Type as IArrayTypeSymbol)?.ElementType,\n            _ => null\n        };\n\n    private static BaseArgumentListSyntax ArgumentList(SyntaxNode expression) =>\n        expression switch\n        {\n            ObjectCreationExpressionSyntax { } creation => creation.ArgumentList,\n            InvocationExpressionSyntax { } invocation => invocation.ArgumentList,\n            _ when ImplicitObjectCreationExpressionSyntaxWrapper.IsInstance(expression) =>\n                ((ImplicitObjectCreationExpressionSyntaxWrapper)expression).ArgumentList,\n            _ => null\n        };\n\n    private static bool IsArrayCreation(CSharpSyntaxNode argument)\n    {\n        var expression = ArgumentExpression(argument);\n        return expression switch\n        {\n            ArrayCreationExpressionSyntax { Initializer: not null } => true,\n            ImplicitArrayCreationExpressionSyntax => true,\n            _ when CollectionExpressionSyntaxWrapper.IsInstance(expression) => !ContainsSpread((CollectionExpressionSyntaxWrapper)expression),\n            _ => false\n        };\n    }\n\n    // [x, y, ..z] is not possible to be passed as params\n    private static bool ContainsSpread(CollectionExpressionSyntaxWrapper expression) =>\n        expression.Elements.Any(x => x.SyntaxNode.IsKind(SyntaxKindEx.SpreadElement));\n\n    private static ExpressionSyntax ArgumentExpression(CSharpSyntaxNode node) =>\n        node switch\n        {\n            ArgumentSyntax arg => arg.Expression,\n            AttributeArgumentSyntax arg => arg.Expression,\n            _ => null\n        };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/AspNet/AnnotateApiActionsWithHttpVerb.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class AnnotateApiActionsWithHttpVerb : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S6965\";\n    private const string MessageFormat = \"REST API controller actions should be annotated with the appropriate HTTP verb attribute.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n    private static readonly ImmutableArray<KnownType> HttpMethodAttributes = ImmutableArray.Create(\n        KnownType.Microsoft_AspNetCore_Mvc_Routing_HttpMethodAttribute,\n        KnownType.Microsoft_AspNetCore_Mvc_AcceptVerbsAttribute); // AcceptVerbs is treated as an exception\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(compilationStartContext =>\n        {\n            if (!compilationStartContext.Compilation.ReferencesNetCoreControllers())\n            {\n                return;\n            }\n\n            compilationStartContext.RegisterSymbolStartAction(symbolStartContext =>\n            {\n                var controllerSymbol = (INamedTypeSymbol)symbolStartContext.Symbol;\n                var controllerAttributes = controllerSymbol.GetAttributesWithInherited();\n\n                if (controllerSymbol.IsControllerType()\n                    && controllerAttributes.Any(x => x.AttributeClass.DerivesFrom(KnownType.Microsoft_AspNetCore_Mvc_ApiControllerAttribute))\n                    && !IgnoresApiExplorer(controllerAttributes))\n                {\n                    symbolStartContext.RegisterSyntaxNodeAction(c =>\n                    {\n                        var methodNode = (MethodDeclarationSyntax)c.Node;\n                        var methodSymbol = c.Model.GetDeclaredSymbol(methodNode);\n                        var methodAttributes = methodSymbol.GetAttributesWithInherited();\n\n                        if (methodSymbol.IsControllerActionMethod()\n                            && !methodSymbol.IsAbstract\n                            && !methodAttributes.Any(x => x.AttributeClass.DerivesFromAny(HttpMethodAttributes))\n                            && !IgnoresApiExplorer(methodAttributes))\n                        {\n                            c.ReportIssue(Rule, methodNode.Identifier.GetLocation());\n                        }\n                    },\n                    SyntaxKind.MethodDeclaration);\n                }\n            },\n            SymbolKind.NamedType);\n        });\n\n    // Tracks [ApiExplorerSettings(IgnoreApi = true)]\n    private static bool IgnoresApiExplorer(IEnumerable<AttributeData> attributes) =>\n        attributes.FirstOrDefault(x => x.AttributeClass.DerivesFrom(KnownType.Microsoft_AspNetCore_Mvc_ApiExplorerSettingsAttribute)) is { } apiExplorerSettings\n        && apiExplorerSettings.TryGetAttributeValue<bool>(\"IgnoreApi\", out var ignoreApi)\n        && ignoreApi;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/AspNet/ApiControllersShouldNotDeriveDirectlyFromController.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ApiControllersShouldNotDeriveDirectlyFromController : SonarDiagnosticAnalyzer\n{\n    internal const string DiagnosticId = \"S6961\";\n    private const string MessageFormat = \"Inherit from ControllerBase instead of Controller.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    private static readonly HashSet<string> ViewIdentifiers =\n        [\n           \"Json\",\n           \"OnActionExecuted\",\n           \"OnActionExecuting\",\n           \"OnActionExecutionAsync\",\n           \"PartialView\",\n           \"TempData\",\n           \"View\",\n           \"ViewBag\",\n           \"ViewComponent\",\n           \"ViewData\",\n           \"ViewResult\"\n        ];\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(compilationStartContext =>\n        {\n            if (!compilationStartContext.Compilation.ReferencesNetCoreControllers())\n            {\n                return;\n            }\n\n            compilationStartContext.RegisterSymbolStartAction(symbolStartContext =>\n            CheckController(symbolStartContext),\n            SymbolKind.NamedType);\n        });\n\n    private static void CheckController(SonarSymbolStartAnalysisContext context)\n    {\n        var controllerSymbol = (INamedTypeSymbol)context.Symbol;\n        if (controllerSymbol.IsControllerType()\n            && controllerSymbol.IsPubliclyAccessible()\n            && controllerSymbol.AnyAttributeDerivesFrom(KnownType.Microsoft_AspNetCore_Mvc_ApiControllerAttribute)\n            && controllerSymbol.BaseType.Is(KnownType.Microsoft_AspNetCore_Mvc_Controller))\n        {\n            var shouldReportController = true;\n            context.RegisterSyntaxNodeAction(nodeContext =>\n            {\n                if (ViewIdentifiers.Contains(nodeContext.Node.GetName()))\n                {\n                    shouldReportController = false;\n                }\n            }, SyntaxKind.IdentifierName);\n\n            context.RegisterSymbolEndAction(symbolEndContext =>\n            {\n                if (shouldReportController)\n                {\n                    ReportIssue(symbolEndContext, controllerSymbol);\n                }\n            });\n        }\n    }\n\n    private static void ReportIssue(SonarSymbolReportingContext context, INamedTypeSymbol controllerSymbol)\n    {\n        var reportLocations = controllerSymbol.DeclaringSyntaxReferences\n            .Select(x => x.GetSyntax())\n            .OfType<ClassDeclarationSyntax>()\n            .Select(x => x.BaseList?.DescendantNodes().FirstOrDefault(x => x is TypeSyntax && x.NameIs(\"Controller\"))?.GetLocation())\n            .OfType<Location>();\n\n        foreach (var location in reportLocations)\n        {\n            context.ReportIssue(CSharpFacade.Instance.GeneratedCodeRecognizer, Rule, location);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/AspNet/ApiControllersShouldNotDeriveDirectlyFromControllerCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Formatting;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[ExportCodeFixProvider(LanguageNames.CSharp)]\npublic sealed class ApiControllersShouldNotDeriveDirectlyFromControllerCodeFix : SonarCodeFix\n{\n    internal const string Title = \"Inherit from ControllerBase instead of Controller.\";\n\n    public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(ApiControllersShouldNotDeriveDirectlyFromController.DiagnosticId);\n\n    protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n    {\n        var toReplace = root.FindNode(context.Diagnostics.First().Location.SourceSpan) as BaseTypeSyntax;\n        var replacement = root.ReplaceNode(toReplace, SyntaxFactory.SimpleBaseType(SyntaxFactory.IdentifierName(\"ControllerBase\").WithTriviaFrom(toReplace)))\n            .WithAdditionalAnnotations(Formatter.Annotation);\n\n        context.RegisterCodeFix(\n           Title,\n           x => Task.FromResult(context.Document.WithSyntaxRoot(replacement)), context.Diagnostics);\n        return Task.CompletedTask;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/AspNet/AvoidUnderPosting.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Collections.Concurrent;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class AvoidUnderPosting : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S6964\";\n    private const string MessageFormat = \"Value type property used as input in a controller action should be nullable, required or annotated with the JsonRequiredAttribute to avoid under-posting.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    private static readonly ImmutableArray<KnownType> IgnoredTypes = ImmutableArray.Create(\n        KnownType.Microsoft_AspNetCore_Http_IFormCollection,\n        KnownType.Microsoft_AspNetCore_Http_IFormFile,\n        KnownType.Microsoft_AspNetCore_Http_IFormFileCollection);\n\n    private static readonly ImmutableArray<KnownType> IgnoredAttributes = ImmutableArray.Create(\n        KnownType.Microsoft_AspNetCore_Mvc_ModelBinding_BindNeverAttribute,\n        KnownType.Microsoft_AspNetCore_Mvc_ModelBinding_BindRequiredAttribute,\n        KnownType.Newtonsoft_Json_JsonIgnoreAttribute,\n        KnownType.Newtonsoft_Json_JsonRequiredAttribute,\n        KnownType.System_ComponentModel_DataAnnotations_RangeAttribute,\n        KnownType.System_Text_Json_Serialization_JsonIgnoreAttribute,\n        KnownType.System_Text_Json_Serialization_JsonRequiredAttribute);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(compilationStart =>\n            {\n                if (!compilationStart.Compilation.ReferencesNetCoreControllers())\n                {\n                    return;\n                }\n                var examinedTypes = new ConcurrentDictionary<ITypeSymbol, bool>();\n\n                compilationStart.RegisterSymbolStartAction(symbolStart =>\n                    {\n                        var type = (INamedTypeSymbol)symbolStart.Symbol;\n                        if (type.IsControllerType())\n                        {\n                            symbolStart.RegisterSyntaxNodeAction(nodeContext => ProcessControllerMethods(nodeContext, examinedTypes), SyntaxKind.MethodDeclaration);\n                        }\n                    },\n                    SymbolKind.NamedType);\n            });\n\n    private static void ProcessControllerMethods(SonarSyntaxNodeReportingContext context, ConcurrentDictionary<ITypeSymbol, bool> examinedTypes)\n    {\n        if (context.Model.GetDeclaredSymbol(context.Node) is IMethodSymbol method\n            && method.IsControllerActionMethod())\n        {\n            var modelParameterTypes = method.Parameters\n                .Where(x => !HasValidateNeverAttribute(x))\n                .SelectMany(x => RelatedTypesToExamine(x.Type, method.ContainingType))\n                .Distinct();\n            foreach (var modelParameterType in modelParameterTypes)\n            {\n                CheckInvalidProperties(modelParameterType, context, examinedTypes);\n            }\n        }\n    }\n\n    private static void CheckInvalidProperties(INamedTypeSymbol parameterType, SonarSyntaxNodeReportingContext context, ConcurrentDictionary<ITypeSymbol, bool> examinedTypes)\n    {\n        var declaredProperties = new List<IPropertySymbol>();\n        GetAllDeclaredProperties(parameterType, examinedTypes, declaredProperties);\n        var invalidProperties = declaredProperties\n            .Where(x => !IsExcluded(x))\n            .Select(x => x.GetFirstSyntaxRef())\n            .Where(x => !IsInitialized(x));\n        foreach (var property in invalidProperties)\n        {\n            context.ReportIssue(Rule, property.GetIdentifier()?.GetLocation());\n        }\n\n        static bool IsExcluded(IPropertySymbol property) =>\n            CanBeNull(property.Type)\n            || property.HasAnyAttribute(IgnoredAttributes)\n            || IsNewtonsoftJsonPropertyRequired(property)\n            || property.IsRequired();\n\n        static bool IsNewtonsoftJsonPropertyRequired(IPropertySymbol property) =>\n            property.GetAttributes(KnownType.Newtonsoft_Json_JsonPropertyAttribute).FirstOrDefault() is { } attribute\n            && attribute.TryGetAttributeValue(\"Required\", out int required)\n            && (required is 1 or 2); // Required.AllowNull = 1,   Required.Always = 2, https://www.newtonsoft.com/json/help/html/T_Newtonsoft_Json_Required.htm\n    }\n\n    private static bool IgnoreType(ITypeSymbol type) =>\n        type is not INamedTypeSymbol namedType      // e.g. dynamic type\n        || namedType.IsAny(IgnoredTypes)\n        || !CanBeUsedInModelBinding(namedType);\n\n    private static bool CanBeUsedInModelBinding(INamedTypeSymbol type) =>\n        !type.IsTupleType()                                             // Tuples are not supported (unless a custom Model Binder is used)\n        && (type.Constructors.Any(x => x.Parameters.Length == 0)        // The type must have a parameterless constructor, unless\n            || type.IsValueType                                         // - it's a value type\n            || type.IsRecord()                                          // - it's a record type\n            || type.IsInterface()                                       // - it's an interface (although the type that implements will be actually used)\n            || type.Is(KnownType.System_String));                       // - it has a custom Model Binder (e.g. System.String has one)\n\n    private static bool CanBeNull(ITypeSymbol type) =>\n        type is ITypeParameterSymbol { HasValueTypeConstraint: false }\n        || type.IsReferenceType\n        || type.IsNullableValueType();\n\n    private static void GetAllDeclaredProperties(ITypeSymbol type, ConcurrentDictionary<ITypeSymbol, bool> examinedTypes, List<IPropertySymbol> declaredProperties)\n    {\n        if (type is INamedTypeSymbol namedType\n            && examinedTypes.TryAdd(namedType, true)\n            && !IgnoreType(namedType)\n            && !HasValidateNeverAttribute(type))\n        {\n            var properties = namedType.GetMembers()\n                .OfType<IPropertySymbol>()\n                .Where(x => x.GetEffectiveAccessibility() == Accessibility.Public\n                            && x.SetMethod?.DeclaredAccessibility is Accessibility.Public\n                            && !HasValidateNeverAttribute(x)\n                            && x.DeclaringSyntaxReferences.Length > 0\n                            && !IgnoreType(x.Type));\n            foreach (var property in properties)\n            {\n                declaredProperties.Add(property);\n                if (property.Type.DeclaringSyntaxReferences.Length > 0)\n                {\n                    GetAllDeclaredProperties(property.Type, examinedTypes, declaredProperties);\n                }\n            }\n            ITypeSymbol[] relatedTypes = [namedType.BaseType, .. namedType.TypeArguments];\n            foreach (var relatedType in relatedTypes)\n            {\n                GetAllDeclaredProperties(relatedType, examinedTypes, declaredProperties);\n            }\n        }\n    }\n\n    // We only consider Model types that are in the same assembly as the Controller, because Roslyn can't raise an issue when the location is in a different assembly than the one being analyzed.\n    private static IEnumerable<INamedTypeSymbol> RelatedTypesToExamine(ITypeSymbol type, ITypeSymbol controllerType) =>\n        type switch\n        {\n            IArrayTypeSymbol array => RelatedTypesToExamine(array.ElementType, controllerType),\n            INamedTypeSymbol collection when collection.DerivesOrImplements(KnownType.System_Collections_Generic_IEnumerable_T) =>\n                collection.TypeArguments.SelectMany(x => RelatedTypesToExamine(x, controllerType)),\n            INamedTypeSymbol namedType when type.IsInSameAssembly(controllerType)  && !type.HasAttribute(KnownType.Microsoft_AspNetCore_Mvc_ModelBinding_BindNeverAttribute) =>\n             [namedType],\n            _ => []\n        };\n\n    private static bool HasValidateNeverAttribute(ISymbol symbol) =>\n        symbol.HasAttribute(KnownType.Microsoft_AspNetCore_Mvc_ModelBinding_Validation_ValidateNeverAttribute);\n\n    private static bool IsInitialized(SyntaxNode node) =>\n        node is ParameterSyntax { Default: not null } or PropertyDeclarationSyntax { Initializer: not null };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/AspNet/BackslashShouldBeAvoidedInAspNetRoutes.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class BackslashShouldBeAvoidedInAspNetRoutes : BackslashShouldBeAvoidedInAspNetRoutesBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override SyntaxKind[] SyntaxKinds => [SyntaxKind.Argument, SyntaxKind.AttributeArgument];\n\n    protected override bool IsNamedAttributeArgument(SyntaxNode node) =>\n        node is AttributeArgumentSyntax { NameEquals: not null };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/AspNet/CallModelStateIsValid.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class CallModelStateIsValid : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S6967\";\n    private const string MessageFormat = \"ModelState.IsValid should be checked in controller actions.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    private static readonly SyntaxKind[] PropertyAccessSyntaxNodesToVisit = [\n        SyntaxKind.ConditionalAccessExpression,\n        SyntaxKind.SimpleMemberAccessExpression,\n        SyntaxKindEx.Subpattern];\n\n    private static readonly ImmutableArray<KnownType> IgnoredArgumentTypes = ImmutableArray.Create(\n        KnownType.System_Object,\n        KnownType.System_String,\n        KnownType.System_Threading_CancellationToken);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(compilationStart =>\n        {\n            // The rule ignores the project completely if any of these conditions are met:\n            // - the project doesn't reference ASP.NET MVC\n            // - the project references the FluentValidation library:\n            //      - as an alternative to using ModelState.IsValid\n            //      - this can made more accurate: check if those validation methods are used in the controller actions rather than just checking whether the library is referenced\n            // - the [ApiController] attribute is applied on the assembly level: this results in the attribute being applied to every Controller class in the project\n            if (compilationStart.Compilation.ReferencesNetCoreControllers()\n                && compilationStart.Compilation.GetTypeByMetadataName(KnownType.FluentValidation_IValidator) is null\n                && !compilationStart.Compilation.Assembly.HasAttribute(KnownType.Microsoft_AspNetCore_Mvc_ApiControllerAttribute))\n            {\n                compilationStart.RegisterSymbolStartAction(symbolStart =>\n                {\n                    var type = (INamedTypeSymbol)symbolStart.Symbol;\n                    if (type.DerivesFrom(KnownType.Microsoft_AspNetCore_Mvc_ControllerBase)\n                        && !HasApiControllerAttribute(type)\n                        && !HasActionFilterAttribute(type))\n                    {\n                        symbolStart.RegisterCodeBlockStartAction<SyntaxKind>(ProcessCodeBlock);\n                    }\n                }, SymbolKind.NamedType);\n            }\n        });\n\n    private static void ProcessCodeBlock(SonarCodeBlockStartAnalysisContext<SyntaxKind> codeBlockContext)\n    {\n        if (codeBlockContext.CodeBlock is MethodDeclarationSyntax methodDeclaration\n            && codeBlockContext.OwningSymbol is IMethodSymbol methodSymbol\n            && !methodSymbol.Parameters.All(IgnoreParameter)\n            && methodSymbol.IsControllerActionMethod()\n            && !HasActionFilterAttribute(methodSymbol))\n        {\n            var isModelValidated = false;\n            codeBlockContext.RegisterNodeAction(nodeContext =>\n            {\n                if (!isModelValidated)\n                {\n                    isModelValidated = IsCheckingValidityProperty(nodeContext.Node, nodeContext.Model);\n                }\n            }, PropertyAccessSyntaxNodesToVisit);\n            codeBlockContext.RegisterNodeAction(nodeContext =>\n            {\n                if (!isModelValidated)\n                {\n                    isModelValidated = IsTryValidateInvocation(nodeContext.Node, nodeContext.Model);\n                }\n            }, SyntaxKind.InvocationExpression);\n            codeBlockContext.RegisterCodeBlockEndAction(blockEnd =>\n            {\n                if (!isModelValidated)\n                {\n                    blockEnd.ReportIssue(Rule, methodDeclaration.Identifier);\n                }\n            });\n        }\n    }\n\n    private static bool IgnoreParameter(IParameterSymbol parameter) =>\n        !parameter.GetAttributes().Any(x => x.AttributeClass.DerivesFrom(KnownType.System_ComponentModel_DataAnnotations_ValidationAttribute))\n        && (parameter.Type.TypeKind == TypeKind.Dynamic || parameter.Type.IsAny(IgnoredArgumentTypes));\n\n    private static bool HasApiControllerAttribute(ITypeSymbol type) =>\n        type.GetAttributesWithInherited().Any(x => x.AttributeClass.DerivesFrom(KnownType.Microsoft_AspNetCore_Mvc_ApiControllerAttribute));\n\n    private static bool HasActionFilterAttribute(ISymbol symbol) =>\n        symbol.GetAttributesWithInherited().Any(x => x.AttributeClass.DerivesFrom(KnownType.Microsoft_AspNetCore_Mvc_Filters_ActionFilterAttribute));\n\n    private static bool IsCheckingValidityProperty(SyntaxNode node, SemanticModel model) =>\n        node.GetIdentifier() is { ValueText: \"IsValid\" or \"ValidationState\" } nodeIdentifier\n        && model.GetSymbolInfo(nodeIdentifier.Parent).Symbol is IPropertySymbol propertySymbol\n        && propertySymbol.ContainingType.Is(KnownType.Microsoft_AspNetCore_Mvc_ModelBinding_ModelStateDictionary);\n\n    private static bool IsTryValidateInvocation(SyntaxNode node, SemanticModel model) =>\n        node is InvocationExpressionSyntax invocation\n        && invocation.GetName() == \"TryValidateModel\"\n        && model.GetSymbolInfo(invocation.Expression).Symbol is IMethodSymbol method\n        && method.ContainingType.DerivesFrom(KnownType.Microsoft_AspNetCore_Mvc_ControllerBase);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/AspNet/ControllersHaveMixedResponsibilities.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Collections.Concurrent;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ControllersHaveMixedResponsibilities : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S6960\";\n    private const string MessageFormat = \"This controller has multiple responsibilities and could be split into {0} smaller controllers.\";\n    private const string UnspeakableIndexerName = \"<indexer>I\"; // All indexers are considered part of the same group\n\n    public enum MemberType\n    {\n        Service,\n        Action,\n    }\n\n    private static readonly HashSet<string> ExcludedWellKnownServices =\n    [\n        \"ILogger\",\n        \"IMediator\",\n        \"IMapper\",\n        \"IConfiguration\",\n        \"IBus\",\n        \"IMessageBus\",\n        \"IHttpClientFactory\"\n    ];\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(compilationStartContext =>\n        {\n            if (!compilationStartContext.Compilation.ReferencesNetCoreControllers())\n            {\n                return;\n            }\n\n            compilationStartContext.RegisterSymbolStartAction(symbolStartContext =>\n            {\n                var symbol = (INamedTypeSymbol)symbolStartContext.Symbol;\n                if (symbol.IsCoreApiController()\n                    && symbol.BaseType.Is(KnownType.Microsoft_AspNetCore_Mvc_ControllerBase)\n                    && !symbol.IsAbstract)\n                {\n                    var relevantMembers = RelevantMembers(symbol);\n\n                    if (relevantMembers.Count < 2)\n                    {\n                        return;\n                    }\n\n                    var dependencies = new ConcurrentStack<Dependency>();\n                    symbolStartContext.RegisterCodeBlockStartAction(PopulateDependencies(relevantMembers, dependencies));\n                    symbolStartContext.RegisterSymbolEndAction(CalculateAndReportOnResponsibilities(symbol, relevantMembers, dependencies));\n                }\n                }, SymbolKind.NamedType);\n        });\n\n    private static Action<SonarCodeBlockStartAnalysisContext<SyntaxKind>> PopulateDependencies(\n        ImmutableDictionary<string, MemberType> relevantMembers,\n        ConcurrentStack<Dependency> dependencies) =>\n        codeBlockStartContext =>\n        {\n            if (BlockName(codeBlockStartContext.CodeBlock) is { } blockName)\n            {\n                codeBlockStartContext.RegisterNodeAction(c =>\n                {\n                    if (c.Node.GetName() is { } dependencyName && relevantMembers.ContainsKey(blockName) && relevantMembers.ContainsKey(dependencyName))\n                    {\n                        dependencies.Push(new(blockName, dependencyName));\n                    }\n                }, SyntaxKind.IdentifierName);\n            }\n        };\n\n    private static Action<SonarSymbolReportingContext> CalculateAndReportOnResponsibilities(\n        INamedTypeSymbol controllerSymbol,\n        ImmutableDictionary<string, MemberType> relevantMembers,\n        ConcurrentStack<Dependency> dependencies) =>\n        symbolEndContext =>\n        {\n            if (ResponsibilityGroups(relevantMembers, dependencies) is { Count: > 1 } responsibilityGroups)\n            {\n                var secondaryLocations = SecondaryLocations(controllerSymbol, responsibilityGroups).ToList();\n                foreach (var primaryLocation in IdentifierLocations<ClassDeclarationSyntax>(controllerSymbol))\n                {\n                    symbolEndContext.ReportIssue(Rule, primaryLocation, secondaryLocations, responsibilityGroups.Count.ToString());\n                }\n            }\n        };\n\n    private static List<List<string>> ResponsibilityGroups(\n        ImmutableDictionary<string, MemberType> relevantMembers,\n        ConcurrentStack<Dependency> dependencies)\n    {\n        var dependencySets = new DisjointSets(relevantMembers.Keys);\n        foreach (var dependency in dependencies)\n        {\n            dependencySets.Union(dependency.From, dependency.To);\n        }\n\n        return dependencySets\n            .GetAllSets()\n            // Filter out sets of only actions or only services\n            .Where(x => x.Exists(x => relevantMembers[x] == MemberType.Service) && x.Exists(x => relevantMembers[x] == MemberType.Action))\n            .ToList();\n    }\n\n    private static string BlockName(SyntaxNode block) =>\n        block switch\n        {\n            AccessorDeclarationSyntax { Parent.Parent: PropertyDeclarationSyntax property } => property.GetName(),\n            AccessorDeclarationSyntax { Parent.Parent: IndexerDeclarationSyntax } => UnspeakableIndexerName,\n            ArrowExpressionClauseSyntax { Parent: PropertyDeclarationSyntax property } => property.GetName(),\n            ArrowExpressionClauseSyntax { Parent: IndexerDeclarationSyntax } => UnspeakableIndexerName,\n            MethodDeclarationSyntax method => method.GetName(),\n            PropertyDeclarationSyntax property => property.GetName(),\n            _ => null\n        };\n\n    private static ImmutableDictionary<string, MemberType> RelevantMembers(INamedTypeSymbol symbol)\n    {\n        var builder = ImmutableDictionary.CreateBuilder<string, MemberType>();\n        foreach (var member in symbol.GetMembers().Where(x => !x.IsStatic))\n        {\n            switch (member)\n            {\n                // Constructors are not considered because they have to be split anyway\n                // Accessors are not considered because they are part of properties, that are considered as a whole\n                case IMethodSymbol method when !method.IsConstructor() && method.MethodKind != MethodKind.StaticConstructor && method.AssociatedSymbol is not IPropertySymbol:\n                    builder.Add(method.Name, MemberType.Action);\n                    break;\n                // Indexers are treated as methods with an unspeakable name\n                case IPropertySymbol { IsIndexer: true }:\n                    builder.Add(UnspeakableIndexerName, MemberType.Action);\n                    break;\n                // Primary constructor parameters may or may not generate fields, and must be considered\n                case IMethodSymbol { IsPrimaryConstructor: true } method:\n                    builder.AddRange(method.Parameters.Where(IsService).Select(x => new KeyValuePair<string, MemberType>(x.Name, MemberType.Service)));\n                    break;\n                // Backing fields are excluded for auto-properties, since they are considered part of the property\n                case IFieldSymbol field when IsService(field) && !field.IsImplicitlyDeclared:\n                    builder.Add(field.Name, MemberType.Service);\n                    break;\n                case IPropertySymbol property when IsService(property):\n                    builder.Add(property.Name, MemberType.Service);\n                    break;\n            }\n        }\n\n        return builder.ToImmutable();\n    }\n\n    private static bool IsService(ISymbol symbol) =>\n        !ExcludedWellKnownServices.Contains(symbol.GetSymbolType().Name);\n\n    private static IEnumerable<SecondaryLocation> SecondaryLocations(INamedTypeSymbol controllerSymbol, List<List<string>> sets)\n    {\n        for (var setIndex = 0; setIndex < sets.Count; setIndex++)\n        {\n            foreach (var memberLocation in sets[setIndex].SelectMany(MemberLocations))\n            {\n                yield return new SecondaryLocation(memberLocation, $\"May belong to responsibility #{setIndex + 1}.\");\n            }\n        }\n\n        IEnumerable<Location> MemberLocations(string memberName) =>\n            controllerSymbol.GetMembers(memberName).OfType<IMethodSymbol>().SelectMany(IdentifierLocations<MethodDeclarationSyntax>);\n    }\n\n    private static IEnumerable<Location> IdentifierLocations<T>(ISymbol symbol) where T : SyntaxNode =>\n        symbol.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).OfType<T>().Select(x => x.GetIdentifier()?.GetLocation());\n\n    private record struct Dependency(string From, string To);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/AspNet/ControllersReuseClient.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ControllersReuseClient : ReuseClientBase\n{\n    private const string DiagnosticId = \"S6962\";\n    private const string MessageFormat = \"Reuse HttpClient instances rather than create new ones with each controller action invocation.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    protected override ImmutableArray<KnownType> ReusableClients => ImmutableArray.Create(KnownType.System_Net_Http_HttpClient);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(compilationStartContext =>\n        {\n            if (!compilationStartContext.Compilation.ReferencesNetCoreControllers())\n            {\n                return;\n            }\n            compilationStartContext.RegisterSymbolStartAction(symbolStartContext =>\n            {\n                var symbol = (INamedTypeSymbol)symbolStartContext.Symbol;\n                if (symbol.IsControllerType())\n                {\n                    symbolStartContext.RegisterSyntaxNodeAction(nodeContext =>\n                    {\n                        var node = nodeContext.Node;\n                        if (IsInPublicMethod(node)\n                            && IsReusableClient(nodeContext)\n                            && !IsInsideConstructor(node)\n                            && !IsAssignedForReuse(nodeContext))\n                        {\n                            nodeContext.ReportIssue(Rule, node);\n                        }\n                    },\n                    SyntaxKind.ObjectCreationExpression,\n                    SyntaxKindEx.ImplicitObjectCreationExpression);\n                }\n            }, SymbolKind.NamedType);\n        });\n\n    public static bool IsInPublicMethod(SyntaxNode node) =>\n        node.FirstAncestorOrSelf<MethodDeclarationSyntax>() is not { } method\n        || (method.FirstAncestorOrSelf<PropertyDeclarationSyntax>() is null\n            && method.Modifiers.Any(x => x.IsKind(SyntaxKind.PublicKeyword)));\n\n    private static bool IsInsideConstructor(SyntaxNode node) =>\n        node.HasAncestor(SyntaxKind.ConstructorDeclaration, SyntaxKindEx.PrimaryConstructorBaseType);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/AspNet/RouteTemplateShouldNotStartWithSlash.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class RouteTemplateShouldNotStartWithSlash : RouteTemplateShouldNotStartWithSlashBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/AspNet/SpecifyRouteAttribute.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Collections.Concurrent;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class SpecifyRouteAttribute() : SonarDiagnosticAnalyzer<SyntaxKind>(DiagnosticId)\n{\n    private const string DiagnosticId = \"S6934\";\n\n    private const string SecondaryLocationMessage = \"By specifying an HttpMethodAttribute or RouteAttribute here, you will need to specify the RouteAttribute at the class level.\";\n\n    protected override string MessageFormat => \"Specify the RouteAttribute when an HttpMethodAttribute or RouteAttribute is specified at an action level.\";\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(compilationStart =>\n        {\n            if (!UsesAttributeRouting(compilationStart.Compilation))\n            {\n                return;\n            }\n            compilationStart.RegisterSymbolStartAction(symbolStart =>\n            {\n                if (symbolStart.Symbol.GetAttributesWithInherited().Any(x => x.AttributeClass.DerivesOrImplements(KnownType.Microsoft_AspNetCore_Mvc_Routing_IRouteTemplateProvider)))\n                {\n                    return;\n                }\n                var secondaryLocations = new ConcurrentStack<SecondaryLocation>();\n                symbolStart.RegisterSyntaxNodeAction(nodeContext =>\n                {\n                    var methodDeclaration = (MethodDeclarationSyntax)nodeContext.Node;\n                    if (nodeContext.Model.GetDeclaredSymbol(methodDeclaration, nodeContext.Cancel) is { } method\n                        && !method.ContainingType.IsAbstract\n                        && method.IsControllerActionMethod()\n                        && method.GetAttributesWithInherited().Any(x => !CanBeIgnored(x.GetAttributeRouteTemplate())))\n                    {\n                        secondaryLocations.Push(methodDeclaration.Identifier.ToSecondaryLocation(SecondaryLocationMessage));\n                    }\n                }, SyntaxKind.MethodDeclaration);\n                symbolStart.RegisterSymbolEndAction(symbolEnd => ReportIssues(symbolEnd, symbolEnd.Symbol, secondaryLocations));\n            }, SymbolKind.NamedType);\n        });\n\n    private void ReportIssues(SonarSymbolReportingContext context, ISymbol symbol, ConcurrentStack<SecondaryLocation> secondaryLocations)\n    {\n        if (secondaryLocations.IsEmpty)\n        {\n            return;\n        }\n\n        foreach (var declaration in symbol.DeclaringSyntaxReferences.Select(x => x.GetSyntax()))\n        {\n            if (declaration.GetIdentifier() is { } identifier)\n            {\n                context.ReportIssue(CSharpGeneratedCodeRecognizer.Instance, Rule, identifier.GetLocation(), secondaryLocations);\n            }\n        }\n    }\n\n    private static bool UsesAttributeRouting(Compilation compilation) =>\n        compilation.GetTypeByMetadataName(KnownType.Microsoft_AspNetCore_Mvc_Routing_HttpMethodAttribute) is not null;\n\n    private static bool CanBeIgnored(string template) =>\n        string.IsNullOrEmpty(template)\n        // See: https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/routing#combining-attribute-routes\n        // Route templates applied to an action that begin with / or ~/ don't get combined with route templates applied to the controller.\n        || template.StartsWith(\"/\")\n        || template.StartsWith(\"~/\");\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/AspNet/UseAspNetModelBinding.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Collections.Concurrent;\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class UseAspNetModelBinding : SonarDiagnosticAnalyzer<SyntaxKind>\n{\n    private const string DiagnosticId = \"S6932\";\n    private const string UseAspNetModelBindingMessage = \"Use model binding instead of accessing the raw request data\";\n    private const string UseIFormFileBindingMessage = \"Use IFormFile or IFormFileCollection binding instead\";\n    private static readonly KnownType[] ActionFilterTypes = [\n        KnownType.Microsoft_AspNetCore_Mvc_Filters_IActionFilter,\n        KnownType.Microsoft_AspNetCore_Mvc_Filters_IAsyncActionFilter];\n\n    protected override string MessageFormat => \"{0}\";\n\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    public UseAspNetModelBinding() : base(DiagnosticId) { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(compilationStartContext =>\n        {\n            var descriptors = GetDescriptors(compilationStartContext.Compilation);\n            if (descriptors.ArgumentDescriptors.Any() || descriptors.PropertyAccessDescriptors.Any())\n            {\n                RegisterForSymbols(compilationStartContext, descriptors);\n            }\n        });\n\n    private void RegisterForSymbols(SonarCompilationStartAnalysisContext compilationStartContext, Descriptors descriptors) =>\n        compilationStartContext.RegisterSymbolStartAction(symbolStart =>\n        {\n            // If the user overrides any action filters, model binding may not be working as expected.\n            // Then we do not want to raise on expressions that originate from parameters.\n            // See the OverridesController.Undecidable test cases for details.\n            var hasActionFiltersOverrides = false;\n            var candidates = new ConcurrentStack<ReportCandidate>(); // In SymbolEnd, we filter the candidates based on the overriding we learn on the go.\n            if (((INamedTypeSymbol)symbolStart.Symbol).IsControllerType())\n            {\n                symbolStart.RegisterCodeBlockStartAction<SyntaxKind>(codeBlockStart =>\n                {\n                    if (IsOverridingFilterMethods(codeBlockStart.OwningSymbol))\n                    {\n                        // We do not want to raise in ActionFilter overrides and so we do not register.\n                        // The SymbolEndAction needs to be made aware, that there are\n                        // ActionFilter overrides, so it can filter out some candidates.\n                        hasActionFiltersOverrides = true;\n                    }\n                    else\n                    {\n                        RegisterCodeBlockActions(codeBlockStart, descriptors, candidates);\n                    }\n                });\n            }\n            symbolStart.RegisterSymbolEndAction(symbolEnd =>\n            {\n                foreach (var candidate in candidates.Where(x => !(hasActionFiltersOverrides && x.OriginatesFromParameter)))\n                {\n                    symbolEnd.ReportIssue(Rule, candidate.Location, candidate.Message);\n                }\n            });\n        }, SymbolKind.NamedType);\n\n    private void RegisterCodeBlockActions(\n        SonarCodeBlockStartAnalysisContext<SyntaxKind> codeBlockStart,\n        Descriptors descriptors,\n        ConcurrentStack<ReportCandidate> controllerCandidates)\n    {\n        // Within a single code block, access via constant and variable keys could be mixed.\n        // We only want to raise, if all access were done via constants.\n        var allConstantAccesses = true;\n        var codeBlockCandidates = new ConcurrentStack<ReportCandidate>();\n        var (argumentDescriptors, propertyAccessDescriptors) = descriptors;\n        if (argumentDescriptors.Any())\n        {\n            codeBlockStart.RegisterNodeAction(nodeContext =>\n            {\n                var argument = (ArgumentSyntax)nodeContext.Node;\n                var model = nodeContext.Model;\n                if (allConstantAccesses\n                    && AddMatchingArgumentToCandidates(model, codeBlockCandidates, argument, argumentDescriptors)\n                    && model.GetConstantValue(argument.Expression) is not { HasValue: true, Value: string })\n                {\n                    allConstantAccesses = false;\n                }\n            }, SyntaxKind.Argument);\n        }\n        if (propertyAccessDescriptors.Any())\n        {\n            codeBlockStart.RegisterNodeAction(nodeContext =>\n            {\n                // The property access of Request.Form.Files can be replaced by an IFormFile binding.\n                // Any access to a \"Files\" property is therefore noncompliant. This is different from the Argument handling above.\n                var memberAccess = (MemberAccessExpressionSyntax)nodeContext.Node;\n                var context = new PropertyAccessContext(memberAccess, nodeContext.Model, memberAccess.Name.Identifier.ValueText);\n                if (Language.Tracker.PropertyAccess.MatchProperty(propertyAccessDescriptors)(context)\n                    // form.Files is okay, if \"form\" is a parameter, because IFormCollection binding is considered appropriate for binding as well\n                    && nodeContext.Model.GetSymbolInfo(memberAccess.Expression).Symbol is not IParameterSymbol)\n                {\n                    codeBlockCandidates.Push(new(UseIFormFileBindingMessage, memberAccess.GetLocation(), IsOriginatingFromParameter(nodeContext.Model, memberAccess)));\n                }\n            }, SyntaxKind.SimpleMemberAccessExpression);\n        }\n        codeBlockStart.RegisterCodeBlockEndAction(codeBlockEnd =>\n        {\n            if (allConstantAccesses\n                && codeBlockCandidates.ToArray() is { Length: > 0 } candidates) // Net core 2.2: PushRange throws for empty arrays https://stackoverflow.com/q/7487097\n            {\n                controllerCandidates.PushRange(candidates);\n            }\n        });\n    }\n\n    private bool AddMatchingArgumentToCandidates(\n        SemanticModel model,\n        ConcurrentStack<ReportCandidate> codeBlockCandidates,\n        ArgumentSyntax argument,\n        ArgumentDescriptor[] argumentDescriptors)\n    {\n        var context = new ArgumentContext(argument, model);\n        if (Array.Exists(argumentDescriptors, x => Language.Tracker.Argument.MatchArgument(x)(context)))\n        {\n            codeBlockCandidates.Push(new(UseAspNetModelBindingMessage, GetPrimaryLocation(argument), IsOriginatingFromParameter(model, argument)));\n            return true;\n        }\n        return false;\n    }\n\n    private static Descriptors GetDescriptors(Compilation compilation)\n    {\n        var argumentDescriptors = new List<ArgumentDescriptor>();\n        var propertyAccessDescriptors = new List<MemberDescriptor>();\n        if (compilation.GetTypeByMetadataName(KnownType.Microsoft_AspNetCore_Mvc_ControllerAttribute) is { })\n        {\n            AddAspNetCoreDescriptors(argumentDescriptors, propertyAccessDescriptors);\n        }\n        // TODO: Add descriptors for Asp.Net MVC 4.x\n        return new([.. argumentDescriptors], [.. propertyAccessDescriptors]);\n    }\n\n    private static void AddAspNetCoreDescriptors(List<ArgumentDescriptor> argumentDescriptors, List<MemberDescriptor> propertyAccessDescriptors)\n    {\n        const string TryGetValue = nameof(IDictionary<int, int>.TryGetValue);\n        const string ContainsKey = nameof(IDictionary<int, int>.ContainsKey);\n        argumentDescriptors.AddRange([\n            ArgumentDescriptor.ElementAccess(// Request.Form[\"id\"]\n                invokedIndexerContainer: KnownType.Microsoft_AspNetCore_Http_IFormCollection,\n                invokedIndexerExpression: \"Form\",\n                parameterConstraint: _ => true, // There is only a single overload and it is getter only\n                argumentPosition: 0),\n            ArgumentDescriptor.MethodInvocation(// Request.Form.TryGetValue(\"id\", out _)\n                invokedType: KnownType.Microsoft_AspNetCore_Http_IFormCollection,\n                methodName: TryGetValue,\n                parameterName: \"key\",\n                argumentPosition: 0),\n            ArgumentDescriptor.MethodInvocation(// Request.Form.ContainsKey(\"id\")\n                invokedType: KnownType.Microsoft_AspNetCore_Http_IFormCollection,\n                methodName: ContainsKey,\n                parameterName: \"key\",\n                argumentPosition: 0),\n            ArgumentDescriptor.ElementAccess(// Request.Headers[\"id\"]\n                invokedIndexerContainer: KnownType.Microsoft_AspNetCore_Http_IHeaderDictionary,\n                invokedIndexerExpression: \"Headers\",\n                parameterConstraint: IsGetterParameter, // Headers are read/write\n                argumentPosition: 0),\n            ArgumentDescriptor.MethodInvocation(// Request.Headers.TryGetValue(\"id\", out _)\n                invokedMemberConstraint: x => IsIDictionaryStringStringValuesInvocation(x, TryGetValue), // TryGetValue is from IDictionary<TKey, TValue> here. We check the type arguments.\n                invokedMemberNameConstraint: (name, comparison) => string.Equals(name, TryGetValue, comparison),\n                invokedMemberNodeConstraint: IsAccessedViaHeaderDictionary,\n                parameterConstraint: x => string.Equals(x.Name, \"key\", StringComparison.Ordinal),\n                argumentListConstraint: (list, position) => list.Count == 2 && position is 0 or null,\n                refKind: RefKind.None),\n            ArgumentDescriptor.MethodInvocation(// Request.Headers.ContainsKey(\"id\")\n                invokedMemberConstraint: x => IsIDictionaryStringStringValuesInvocation(x, ContainsKey),\n                invokedMemberNameConstraint: (name, comparison) => string.Equals(name, ContainsKey, comparison),\n                invokedMemberNodeConstraint: IsAccessedViaHeaderDictionary,\n                parameterConstraint: x => string.Equals(x.Name, \"key\", StringComparison.Ordinal),\n                argumentListConstraint: (list, _) => list.Count == 1,\n                refKind: RefKind.None),\n            ArgumentDescriptor.ElementAccess(// Request.Query[\"id\"]\n                invokedIndexerContainer: KnownType.Microsoft_AspNetCore_Http_IQueryCollection,\n                invokedIndexerExpression: \"Query\",\n                parameterConstraint: _ => true, // There is only a single overload and it is getter only\n                argumentPosition: 0),\n            ArgumentDescriptor.MethodInvocation(// Request.Query.TryGetValue(\"id\", out _)\n                invokedType: KnownType.Microsoft_AspNetCore_Http_IQueryCollection,\n                methodName: TryGetValue,\n                parameterName: \"key\",\n                argumentPosition: 0),\n            ArgumentDescriptor.ElementAccess(// Request.RouteValues[\"id\"]\n                invokedIndexerContainer: KnownType.Microsoft_AspNetCore_Routing_RouteValueDictionary,\n                invokedIndexerExpression: \"RouteValues\",\n                parameterConstraint: IsGetterParameter, // RouteValues are read/write\n                argumentPosition: 0),\n            ArgumentDescriptor.MethodInvocation(// Request.RouteValues.TryGetValue(\"id\", out _)\n                invokedType: KnownType.Microsoft_AspNetCore_Routing_RouteValueDictionary,\n                methodName: TryGetValue,\n                parameterName: \"key\",\n                argumentPosition: 0)]);\n\n        propertyAccessDescriptors.Add(new(KnownType.Microsoft_AspNetCore_Http_IFormCollection, \"Files\")); // Request.Form.Files...\n    }\n\n    // Check that the \"Headers\" expression in the Headers.TryGetValue(\"id\", out _) invocation is of type IHeaderDictionary\n    private static bool IsAccessedViaHeaderDictionary(SemanticModel model, ILanguageFacade language, SyntaxNode invocation) =>\n        invocation is InvocationExpressionSyntax { Expression: { } expression }\n            && expression.GetLeftOfDot() is { } left\n            && model.GetTypeInfo(left) is { Type: { } typeSymbol }\n            && typeSymbol.Is(KnownType.Microsoft_AspNetCore_Http_IHeaderDictionary);\n\n    private static bool IsOverridingFilterMethods(ISymbol owningSymbol) =>\n        (owningSymbol.GetOverriddenMember() ?? owningSymbol).ExplicitOrImplicitInterfaceImplementations().Any(x =>\n            x is IMethodSymbol { ContainingType: { } container }\n            && container.IsAny(ActionFilterTypes));\n\n    private static bool IsOriginatingFromParameter(SemanticModel semanticModel, ArgumentSyntax argument) =>\n        GetExpressionOfArgumentParent(argument) is { } parentExpression && IsOriginatingFromParameter(semanticModel, parentExpression);\n\n    private static bool IsOriginatingFromParameter(SemanticModel semanticModel, ExpressionSyntax expression) =>\n        MostLeftOfDottedChain(expression) is { } mostLeft && semanticModel.GetSymbolInfo(mostLeft).Symbol is IParameterSymbol;\n\n    private static ExpressionSyntax MostLeftOfDottedChain(ExpressionSyntax root)\n    {\n        var current = root.GetRootConditionalAccessExpression()?.Expression ?? root;\n        while (current.Kind() is SyntaxKind.SimpleMemberAccessExpression or SyntaxKind.ElementAccessExpression)\n        {\n            current = current switch\n            {\n                MemberAccessExpressionSyntax { Expression: { } left } => left,\n                ElementAccessExpressionSyntax { Expression: { } left } => left,\n                _ => throw new InvalidOperationException(\"Unreachable\"),\n            };\n        }\n        return current;\n    }\n\n    private static ExpressionSyntax GetExpressionOfArgumentParent(ArgumentSyntax argument) =>\n        argument switch\n        {\n            { Parent: BracketedArgumentListSyntax { Parent: ElementBindingExpressionSyntax expression } } => expression.GetParentConditionalAccessExpression(),\n            { Parent: BracketedArgumentListSyntax { Parent: ElementAccessExpressionSyntax { Expression: { } expression } } } => expression,\n            { Parent: ArgumentListSyntax { Parent: InvocationExpressionSyntax { Expression: { } expression } } } => expression,\n            _ => null,\n        };\n\n    private static Location GetPrimaryLocation(ArgumentSyntax argument) =>\n        ((SyntaxNode)GetExpressionOfArgumentParent(argument) ?? argument).GetLocation();\n\n    private static bool IsGetterParameter(IParameterSymbol parameter) =>\n        parameter.ContainingSymbol is IMethodSymbol { MethodKind: MethodKind.PropertyGet };\n\n    private static bool IsIDictionaryStringStringValuesInvocation(IMethodSymbol method, string name) =>\n        method.Is(KnownType.System_Collections_Generic_IDictionary_TKey_TValue, name)\n            && method.ContainingType.TypeArguments is { Length: 2 } typeArguments\n            && typeArguments[0].Is(KnownType.System_String)\n            && typeArguments[1].Is(KnownType.Microsoft_Extensions_Primitives_StringValues);\n\n    private readonly record struct ReportCandidate(string Message, Location Location, bool OriginatesFromParameter);\n    private readonly record struct Descriptors(ArgumentDescriptor[] ArgumentDescriptors, MemberDescriptor[] PropertyAccessDescriptors);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/AssertionArgsShouldBePassedInCorrectOrder.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class AssertionArgsShouldBePassedInCorrectOrder : SonarDiagnosticAnalyzer\n{\n    internal const string DiagnosticId = \"S3415\";\n    private const string MessageFormat = \"Make sure these 2 arguments are in the correct order: expected value, actual value.\";\n\n    private const string Expected = \"expected\";\n    private const string Actual = \"actual\";\n    private const string NotExpected = \"notExpected\";\n    private const string ExpectedSubstring = \"expectedSubstring\";\n    private const string ActualString = \"actualString\";\n    private const string ExpectedEndString = \"expectedEndString\";\n    private const string ExpectedStartString = \"expectedStartString\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    private static readonly KnownAssertParameters[] NUnitParameters =\n    [\n        new(KnownType.NUnit_Framework_Assert, Expected, Actual),\n        new(KnownType.NUnit_Framework_Legacy_ClassicAssert, Expected, Actual)\n    ];\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                if (c.Node is InvocationExpressionSyntax { ArgumentList.Arguments.Count: >= 2 } invocation\n                    && Parameters(invocation.GetName()) is { } knownAssertParameters\n                    && c.Model.GetSymbolInfo(invocation).AllSymbols()\n                        .SelectMany(symbol =>\n                            symbol is IMethodSymbol { IsStatic: true, ContainingSymbol: INamedTypeSymbol container } methodSymbol\n                                ? knownAssertParameters.Select(knownParameters => FindWrongArguments(c.Model, container, methodSymbol, invocation, knownParameters))\n                                : [])\n                        .FirstOrDefault(x => x is not null) is { ExpectedArgs: { } wrongExpected, ActualArgs: { } wrongActual })\n                {\n                    c.ReportIssue(Rule, CreateLocation(wrongExpected, wrongActual));\n                }\n            },\n            SyntaxKind.InvocationExpression);\n\n    private static KnownAssertParameters[] Parameters(string name) =>\n        name switch\n        {\n            \"AreEqual\" =>\n            [\n                new(KnownType.Microsoft_VisualStudio_TestTools_UnitTesting_Assert, Expected, Actual),\n                ..NUnitParameters\n            ],\n            \"AreNotEqual\" =>\n            [\n                new(KnownType.Microsoft_VisualStudio_TestTools_UnitTesting_Assert, NotExpected, Actual),\n                ..NUnitParameters\n            ],\n            \"AreSame\" =>\n            [\n                new(KnownType.Microsoft_VisualStudio_TestTools_UnitTesting_Assert, Expected, Actual),\n                ..NUnitParameters\n            ],\n            \"AreNotSame\" =>\n            [\n                new(KnownType.Microsoft_VisualStudio_TestTools_UnitTesting_Assert, NotExpected, Actual),\n                ..NUnitParameters\n            ],\n            \"Equal\" or \"NotEqual\" or \"Same\" or \"NotSame\" or \"Equivalent\" or \"EquivalentWithExclusions\" or \"StrictEqual\" or \"NotStrictEqual\" =>\n            [\n                new(KnownType.Xunit_Assert, Expected, Actual)\n            ],\n            \"Contains\" or \"DoesNotContain\" =>\n            [\n                new(KnownType.Xunit_Assert, ExpectedSubstring, ActualString),\n            ],\n            \"EndsWith\" =>\n            [\n                new(KnownType.Xunit_Assert, ExpectedEndString, ActualString)\n            ],\n            \"StartsWith\" =>\n            [\n                new(KnownType.Xunit_Assert, ExpectedStartString, ActualString)\n            ],\n            _ => null\n        };\n\n    private static WrongArguments? FindWrongArguments(SemanticModel model,\n                                                      INamedTypeSymbol container,\n                                                      IMethodSymbol symbol,\n                                                      InvocationExpressionSyntax invocation,\n                                                      KnownAssertParameters knownParameters) =>\n        container.Is(knownParameters.AssertClass)\n        && CSharpFacade.Instance.MethodParameterLookup(invocation, symbol) is var parameterLookup\n        && parameterLookup.TryGetSyntax(knownParameters.ExpectedParameterName, out var expectedArguments)\n        && expectedArguments.FirstOrDefault() is { } expected\n        && !model.GetConstantValue(expected).HasValue\n        && parameterLookup.TryGetSyntax(knownParameters.ActualParameterName, out var actualArguments)\n        && actualArguments.FirstOrDefault() is { } actual\n        && model.GetConstantValue(actual).HasValue\n            ? new(expected, actual)\n            : null;\n\n    private static Location CreateLocation(SyntaxNode argument1, SyntaxNode argument2) =>\n        argument1.Span.CompareTo(argument2.Span) < 0\n            ? argument1.Parent.CreateLocation(argument2.Parent)\n            : argument2.Parent.CreateLocation(argument1.Parent);\n\n    private readonly record struct KnownAssertParameters(KnownType AssertClass, string ExpectedParameterName, string ActualParameterName);\n\n    private readonly record struct WrongArguments(SyntaxNode ExpectedArgs, SyntaxNode ActualArgs);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/AssertionsShouldBeComplete.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class AssertionsShouldBeComplete : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S2970\";\n    private const string MessageFormat = \"Complete the assertion\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(start =>\n            {\n                if (start.Compilation.References(KnownAssembly.FluentAssertions))\n                {\n                    start.RegisterNodeAction(c =>\n                        CheckInvocation(c, invocation =>\n                            invocation.NameIs(\"Should\")\n                            && c.Model.GetSymbolInfo(invocation).AllSymbols().Any(x =>\n                                x is IMethodSymbol\n                                {\n                                    IsExtensionMethod: true,\n                                    ReturnsVoid: false,\n                                    ContainingType: { } container,\n                                    ReturnType: { } returnType,\n                                }\n                                && (container.Is(KnownType.FluentAssertions_AssertionExtensions)\n                                    // ⬆️ Built in assertions. ⬇️ Custom assertions (the majority at least).\n                                    || returnType.DerivesFrom(KnownType.FluentAssertions_Primitives_ReferenceTypeAssertions)))),\n                        SyntaxKind.InvocationExpression);\n                }\n                if (start.Compilation.References(KnownAssembly.NFluent))\n                {\n                    start.RegisterNodeAction(c =>\n                        CheckInvocation(c, invocation =>\n                            invocation.NameIs(\"That\", \"ThatEnum\", \"ThatCode\", \"ThatAsyncCode\", \"ThatDynamic\")\n                            && c.Model.GetSymbolInfo(invocation) is\n                            {\n                                Symbol: IMethodSymbol\n                                {\n                                    IsStatic: true,\n                                    ReturnsVoid: false,\n                                    ContainingType: { IsStatic: true } container\n                                }\n                            }\n                            && container.Is(KnownType.NFluent_Check)),\n                        SyntaxKind.InvocationExpression);\n                }\n                if (start.Compilation.References(KnownAssembly.NSubstitute))\n                {\n                    start.RegisterNodeAction(c =>\n                        CheckInvocation(c, invocation =>\n                            invocation.NameIs(\"Received\", \"DidNotReceive\", \"ReceivedWithAnyArgs\", \"DidNotReceiveWithAnyArgs\", \"ReceivedCalls\")\n                            && c.Model.GetSymbolInfo(invocation) is\n                            {\n                                Symbol: IMethodSymbol\n                                {\n                                    IsExtensionMethod: true,\n                                    ReturnsVoid: false,\n                                    ContainingType: { } container,\n                                }\n                            }\n                            && container.Is(KnownType.NSubstitute_SubstituteExtensions)),\n                        SyntaxKind.InvocationExpression);\n                }\n            });\n\n    private static void CheckInvocation(SonarSyntaxNodeReportingContext c, Func<InvocationExpressionSyntax, bool> isAssertionMethod)\n    {\n        if (c.Node is InvocationExpressionSyntax invocation\n            && isAssertionMethod(invocation)\n            && !HasContinuation(invocation))\n        {\n            c.ReportIssue(Rule, invocation.GetIdentifier()?.GetLocation());\n        }\n    }\n\n    private static bool HasContinuation(InvocationExpressionSyntax invocation)\n    {\n        var closeParen = invocation.ArgumentList.CloseParenToken;\n        if (!closeParen.IsKind(SyntaxKind.CloseParenToken) || closeParen.IsMissing || !invocation.GetLastToken().Equals(closeParen))\n        {\n            // Any invocation should end with \")\". We are in unknown territory here.\n            return true;\n        }\n        var nextToken = closeParen.GetNextToken();\n        if (!nextToken.IsKind(SyntaxKind.SemicolonToken))\n        {\n            // There is something right to the invocation that is not a semicolon.\n            return true;\n        }\n        // We are in some kind of statement context \"??? Should();\"\n        // The result might be stored in a variable or returned from the method/property\n        return nextToken.Parent switch\n        {\n            MethodDeclarationSyntax { ReturnType: { } returnType } => !IsVoid(returnType),\n            { } parent when LocalFunctionStatementSyntaxWrapper.IsInstance(parent) => !IsVoid(((LocalFunctionStatementSyntaxWrapper)parent).ReturnType),\n            PropertyDeclarationSyntax => true,\n            AccessorDeclarationSyntax { Keyword.RawKind: (int)SyntaxKind.GetKeyword } => true,\n            ReturnStatementSyntax => true,\n            LocalDeclarationStatementSyntax => true,\n            ExpressionStatementSyntax { Expression: AssignmentExpressionSyntax or ConditionalAccessExpressionSyntax { WhenNotNull: AssignmentExpressionSyntax } } => true,\n            _ => false,\n        };\n    }\n\n    private static bool IsVoid(TypeSyntax type) =>\n        type is PredefinedTypeSyntax { Keyword.RawKind: (int)SyntaxKind.VoidKeyword };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/AssignmentInsideSubExpression.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class AssignmentInsideSubExpression : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S1121\";\n    private const string MessageFormat = \"Extract the assignment of '{0}' from this expression.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    private static readonly HashSet<SyntaxKind> AllowedParentExpressionKinds =\n    [\n        SyntaxKind.SimpleAssignmentExpression,\n        SyntaxKind.ParenthesizedLambdaExpression,\n        SyntaxKind.SimpleLambdaExpression,\n        SyntaxKind.AnonymousMethodExpression,\n    ];\n\n    private static readonly HashSet<SyntaxKind> RelationalExpressionKinds =\n    [\n        SyntaxKind.EqualsExpression,\n        SyntaxKind.NotEqualsExpression,\n        SyntaxKind.LessThanExpression,\n        SyntaxKind.LessThanOrEqualExpression,\n        SyntaxKind.GreaterThanExpression,\n        SyntaxKind.GreaterThanOrEqualExpression,\n        SyntaxKindEx.IsPatternExpression\n    ];\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            c =>\n            {\n                var assignment = (AssignmentExpressionSyntax)c.Node;\n                var topParenthesizedExpression = assignment.GetSelfOrTopParenthesizedExpression();\n                if (IsNonCompliantSubExpression(assignment, topParenthesizedExpression) || IsDirectlyInStatementCondition(assignment, topParenthesizedExpression))\n                {\n                    c.ReportIssue(Rule, assignment.OperatorToken, assignment.Left.ToString());\n                }\n            },\n            SyntaxKind.SimpleAssignmentExpression,\n            SyntaxKind.AddAssignmentExpression,\n            SyntaxKind.SubtractAssignmentExpression,\n            SyntaxKind.MultiplyAssignmentExpression,\n            SyntaxKind.DivideAssignmentExpression,\n            SyntaxKind.ModuloAssignmentExpression,\n            SyntaxKind.AndAssignmentExpression,\n            SyntaxKind.ExclusiveOrAssignmentExpression,\n            SyntaxKind.OrAssignmentExpression,\n            SyntaxKind.LeftShiftAssignmentExpression,\n            SyntaxKind.RightShiftAssignmentExpression,\n            SyntaxKindEx.UnsignedRightShiftAssignmentExpression);\n\n    private static bool IsNonCompliantSubExpression(AssignmentExpressionSyntax assignment, ExpressionSyntax topParenthesizedExpression) =>\n        !IsInInitializerExpression(topParenthesizedExpression)\n        && topParenthesizedExpression.Parent.FirstAncestorOrSelf<ExpressionSyntax>() is { } expressionParent\n        && !IsCompliantAssignmentInsideExpression(assignment, expressionParent);\n\n    private static bool IsInInitializerExpression(ExpressionSyntax expression) =>\n        expression.Parent?.Kind() is SyntaxKindEx.WithInitializerExpression or SyntaxKind.ObjectInitializerExpression;\n\n    private static bool IsCompliantAssignmentInsideExpression(AssignmentExpressionSyntax assignment, ExpressionSyntax expressionParent) =>\n        IsCompliantCoalesceExpression(expressionParent, assignment)\n        || IsCompliantNullConditionalAssignment(assignment)\n        || (RelationalExpressionKinds.Contains(expressionParent.Kind()) && IsInStatementCondition(expressionParent))\n        || (AllowedParentExpressionKinds.Contains(expressionParent.Kind()) && !IsInInitializerExpression(expressionParent));\n\n    private static bool IsCompliantNullConditionalAssignment(AssignmentExpressionSyntax assignment) =>\n        assignment.AncestorsAndSelf().TakeWhile(x => x is ExpressionSyntax).OfType<ConditionalAccessExpressionSyntax>().LastOrDefault() is { } conditionalAccess\n        && conditionalAccess.Parent.FirstAncestorOrSelf<ExpressionSyntax>() is var outerExpression\n        && (outerExpression is null || AllowedParentExpressionKinds.Contains(outerExpression.Kind()));\n\n    private static bool IsCompliantCoalesceExpression(ExpressionSyntax parentExpression, AssignmentExpressionSyntax assignment) =>\n        assignment.IsKind(SyntaxKind.SimpleAssignmentExpression)\n        && CoalesceExpressionParent(parentExpression) is { } coalesceExpression\n        && CSharpEquivalenceChecker.AreEquivalent(assignment.Left.RemoveParentheses(), coalesceExpression.Left.RemoveParentheses());\n\n    private static BinaryExpressionSyntax CoalesceExpressionParent(ExpressionSyntax parent) =>\n        parent.AncestorsAndSelf()\n            .TakeWhile(x => x is ExpressionSyntax)\n            .OfType<BinaryExpressionSyntax>()\n            .FirstOrDefault(x => x.IsKind(SyntaxKind.CoalesceExpression));\n\n    private static bool IsDirectlyInStatementCondition(ExpressionSyntax expression, ExpressionSyntax topParenthesizedExpression)\n    {\n        return IsDirectlyInStatementCondition<IfStatementSyntax>(x => x.Condition)\n            || IsDirectlyInStatementCondition<ForStatementSyntax>(x => x.Condition)\n            || IsDirectlyInStatementCondition<WhileStatementSyntax>(x => x.Condition)\n            || IsDirectlyInStatementCondition<DoStatementSyntax>(x => x.Condition);\n\n        bool IsDirectlyInStatementCondition<T>(Func<T, ExpressionSyntax> conditionSelector) where T : SyntaxNode =>\n            topParenthesizedExpression.Parent.FirstAncestorOrSelf<T>() is { } statement && conditionSelector(statement).RemoveParentheses() == expression;\n    }\n\n    private static bool IsInStatementCondition(ExpressionSyntax expression)\n    {\n        return expression.GetSelfOrTopParenthesizedExpression() is var expressionOrParenthesizedParent\n            && (IsInStatementCondition<IfStatementSyntax>(x => x.Condition)\n                || IsInStatementCondition<ForStatementSyntax>(x => x.Condition)\n                || IsInStatementCondition<WhileStatementSyntax>(x => x.Condition)\n                || IsInStatementCondition<DoStatementSyntax>(x => x.Condition));\n\n        bool IsInStatementCondition<T>(Func<T, ExpressionSyntax> conditionSelector) where T : SyntaxNode =>\n            expressionOrParenthesizedParent.Parent.FirstAncestorOrSelf<T>() is { } statement && conditionSelector(statement) is { } condition && condition.Contains(expression);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/AsyncAwaitIdentifier.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class AsyncAwaitIdentifier : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S2306\";\n        private const string MessageFormat = \"Rename '{0}' to not use a contextual keyword as an identifier.\";\n\n        private static readonly ISet<string> AsyncOrAwait = new HashSet<string> { \"async\", \"await\" };\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterTreeAction(\n                c =>\n                {\n                    foreach (var asyncOrAwaitToken in GetAsyncOrAwaitTokens(c.Tree.GetRoot())\n                        .Where(token => !token.Parent.AncestorsAndSelf().OfType<IdentifierNameSyntax>().Any()))\n                    {\n                        c.ReportIssue(rule, asyncOrAwaitToken, asyncOrAwaitToken.ToString());\n                    }\n                });\n        }\n\n        private static IEnumerable<SyntaxToken> GetAsyncOrAwaitTokens(SyntaxNode node)\n        {\n            return node.DescendantTokens()\n                .Where(token =>\n                    token.IsKind(SyntaxKind.IdentifierToken) &&\n                    AsyncOrAwait.Contains(token.ToString()));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/AsyncVoidMethod.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class AsyncVoidMethod : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S3168\";\n        private const string MessageFormat = \"Return 'Task' instead.\";\n        private const string MsTestV1AssemblyName = \"Microsoft.VisualStudio.QualityTools.UnitTestFramework\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        private static readonly ImmutableArray<KnownType> AllowedAsyncVoidMsTestAttributes =\n            ImmutableArray.Create(\n                KnownType.Microsoft_VisualStudio_TestTools_UnitTesting_AssemblyCleanupAttribute,\n                KnownType.Microsoft_VisualStudio_TestTools_UnitTesting_AssemblyInitializeAttribute,\n                KnownType.Microsoft_VisualStudio_TestTools_UnitTesting_ClassCleanupAttribute,\n                KnownType.Microsoft_VisualStudio_TestTools_UnitTesting_ClassInitializeAttribute,\n                KnownType.Microsoft_VisualStudio_TestTools_UnitTesting_TestCleanupAttribute,\n                KnownType.Microsoft_VisualStudio_TestTools_UnitTesting_TestInitializeAttribute);\n\n        private static readonly HashSet<SyntaxKind> ParentTypeSyntaxKinds =\n            [\n                SyntaxKind.ClassDeclaration,\n                SyntaxKind.StructDeclaration,\n                SyntaxKindEx.RecordDeclaration,\n                SyntaxKindEx.RecordStructDeclaration,\n                SyntaxKind.InterfaceDeclaration\n            ];\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var methodDeclaration = (MethodDeclarationSyntax)c.Node;\n                    var methodSymbol = c.Model.GetDeclaredSymbol(methodDeclaration);\n\n                    if (IsViolatingRule(methodSymbol) && !IsExceptionToTheRule(methodDeclaration, methodSymbol))\n                    {\n                        c.ReportIssue(Rule, methodDeclaration.ReturnType);\n                    }\n                },\n                SyntaxKind.MethodDeclaration);\n\n        private static bool IsViolatingRule(IMethodSymbol methodSymbol) =>\n            methodSymbol is {IsAsync: true, ReturnsVoid: true}\n            && methodSymbol.IsChangeable();\n\n        private static bool IsExceptionToTheRule(MethodDeclarationSyntax methodDeclaration, IMethodSymbol methodSymbol) =>\n            methodSymbol.IsEventHandler()\n            || IsAcceptedUsage(methodDeclaration)\n            || IsNamedAsEventHandler(methodSymbol)\n            || HasAnyMsTestV1AllowedAttribute(methodSymbol);\n\n        private static bool IsAcceptedUsage(MethodDeclarationSyntax methodDeclaration) =>\n            GetParentDeclaration(methodDeclaration) is { } parentDeclaration\n            && parentDeclaration\n               .DescendantNodes()\n               .SelectMany(node => node switch\n                                   {\n                                       ObjectCreationExpressionSyntax objectCreation => GetIdentifierArguments(objectCreation),\n                                       InvocationExpressionSyntax invocation => GetIdentifierArguments(invocation),\n                                       AssignmentExpressionSyntax assignment => GetIdentifierRightHandSide(assignment),\n                                       _ => Enumerable.Empty<IdentifierNameSyntax>()\n                                   })\n               .Any(x => x.Identifier.ValueText == methodDeclaration.Identifier.ValueText);\n\n        private static IEnumerable<IdentifierNameSyntax> GetIdentifierArguments(ObjectCreationExpressionSyntax objectCreation) =>\n            objectCreation.ArgumentList?.Arguments.Select(x => x.Expression).OfType<IdentifierNameSyntax>() ?? Enumerable.Empty<IdentifierNameSyntax>();\n\n        private static IEnumerable<IdentifierNameSyntax> GetIdentifierArguments(InvocationExpressionSyntax invocation) =>\n            invocation.ArgumentList.Arguments.Select(x => x.Expression).OfType<IdentifierNameSyntax>();\n\n        private static IEnumerable<IdentifierNameSyntax> GetIdentifierRightHandSide(AssignmentExpressionSyntax assignment) =>\n            assignment.IsKind(SyntaxKind.AddAssignmentExpression) && assignment.Right is IdentifierNameSyntax identifier\n                ? new[] { identifier }\n                : Enumerable.Empty<IdentifierNameSyntax>();\n\n        private static SyntaxNode GetParentDeclaration(SyntaxNode syntaxNode) =>\n            syntaxNode.FirstAncestorOrSelf<TypeDeclarationSyntax>(x => x.IsAnyKind(ParentTypeSyntaxKinds));\n\n        private static bool IsNamedAsEventHandler(ISymbol symbol) =>\n            symbol.Name.Length > 2\n            && symbol.Name.StartsWith(\"On\")\n            && char.IsUpper(symbol.Name[2]);\n\n        private static bool HasAnyMsTestV1AllowedAttribute(IMethodSymbol methodSymbol) =>\n            methodSymbol.GetAttributes().Any(x =>\n                x.AttributeClass.ContainingAssembly.Name == MsTestV1AssemblyName\n                && x.AttributeClass.IsAny(AllowedAsyncVoidMsTestAttributes));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/AvoidDateTimeNowForBenchmarking.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class AvoidDateTimeNowForBenchmarking : AvoidDateTimeNowForBenchmarkingBase<MemberAccessExpressionSyntax, InvocationExpressionSyntax, SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override bool ContainsDateTimeArgument(InvocationExpressionSyntax invocation, SemanticModel model) =>\n        invocation.ArgumentList.Arguments[0].Expression.IsKnownType(KnownType.System_DateTime, model);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/AvoidExcessiveClassCoupling.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class AvoidExcessiveClassCoupling : ParametrizedDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S1200\";\n        private const string MessageFormat = \"Split this {0} into smaller and more specialized ones to reduce its dependencies on other types from {1} to the maximum authorized {2} or less.\";\n        private const int ThresholdDefaultValue = 30;\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat, isEnabledByDefault: false);\n\n        private static readonly ImmutableArray<KnownType> IgnoredTypes =\n            ImmutableArray.Create(\n                KnownType.Void,\n                KnownType.System_Boolean,\n                KnownType.System_Byte,\n                KnownType.System_SByte,\n                KnownType.System_Int16,\n                KnownType.System_UInt16,\n                KnownType.System_Int32,\n                KnownType.System_UInt32,\n                KnownType.System_Int64,\n                KnownType.System_UInt64,\n                KnownType.System_IntPtr,\n                KnownType.System_UIntPtr,\n                KnownType.System_Char,\n                KnownType.System_Single,\n                KnownType.System_Double,\n                KnownType.System_String,\n                KnownType.System_Object,\n                KnownType.System_Threading_Tasks_Task,\n                KnownType.System_Threading_Tasks_Task_T,\n                KnownType.System_Threading_Tasks_ValueTask_TResult,\n                KnownType.System_Action,\n                KnownType.System_Action_T,\n                KnownType.System_Action_T1_T2,\n                KnownType.System_Action_T1_T2_T3,\n                KnownType.System_Action_T1_T2_T3_T4,\n                KnownType.System_Func_TResult,\n                KnownType.System_Func_T_TResult,\n                KnownType.System_Func_T1_T2_TResult,\n                KnownType.System_Func_T1_T2_T3_TResult,\n                KnownType.System_Func_T1_T2_T3_T4_TResult,\n                KnownType.System_Lazy);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        [RuleParameter(\"max\", PropertyType.Integer, \"Maximum number of types a single type is allowed to depend upon\", ThresholdDefaultValue)]\n        public int Threshold { get; set; } = ThresholdDefaultValue;\n\n        protected override void Initialize(SonarParametrizedAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n                {\n                    var typeDeclaration = (TypeDeclarationSyntax)c.Node;\n                    if (typeDeclaration.Identifier.IsMissing || c.IsRedundantPositionalRecordContext())\n                    {\n                        return;\n                    }\n\n                    var type = c.Model.GetDeclaredSymbol(typeDeclaration);\n                    var collector = new TypeDependencyCollector(c.Model, typeDeclaration);\n                    collector.SafeVisit(typeDeclaration);\n                    var dependentTypes = collector.DependentTypes\n                        .SelectMany(ExpandGenericTypes)\n                        .Distinct()\n                        .Where(IsTrackedType)\n                        .Where(t => !t.Equals(type))\n                        .ToList();\n\n                    if (dependentTypes.Count > Threshold)\n                    {\n                        c.ReportIssue(Rule, typeDeclaration.Identifier, typeDeclaration.Keyword.ValueText, dependentTypes.Count.ToString(), Threshold.ToString());\n                    }\n                },\n                SyntaxKind.ClassDeclaration,\n                SyntaxKind.StructDeclaration,\n                SyntaxKind.InterfaceDeclaration,\n                SyntaxKindEx.RecordDeclaration,\n                SyntaxKindEx.RecordStructDeclaration);\n\n        private static bool IsTrackedType(INamedTypeSymbol namedType) =>\n            namedType.TypeKind != TypeKind.Enum && !namedType.IsAny(IgnoredTypes);\n\n        /// <summary>\n        /// Returns all type symbols reachable from the provided named type:\n        /// the original generic definition, all containing types (recursively expanded),\n        /// and all type arguments (recursively expanded) or constraint types for unbound generics.\n        /// For example:\n        /// Dictionary&lt;string, int&gt; returns Dictionary&lt;TKey,TValue&gt;, string, int\n        /// List&lt;T&gt; where T : IDisposable returns List&lt;T&gt;, IDisposable\n        /// Outer&lt;int&gt;.Inner returns Outer&lt;T&gt;.Inner, Outer&lt;T&gt;, int\n        /// </summary>\n        private static IEnumerable<INamedTypeSymbol> ExpandGenericTypes(INamedTypeSymbol namedType)\n        {\n            yield return namedType.OriginalDefinition;\n            if (namedType.ContainingType is { } containing)\n            {\n                foreach (var expanded in ExpandGenericTypes(containing))\n                {\n                    yield return expanded;\n                }\n            }\n\n            if (!namedType.IsGenericType)\n            {\n                yield break;\n            }\n\n            var typeArgs = namedType.IsUnboundGenericType\n                ? namedType.TypeParameters.SelectMany(ConstraintTypes)\n                : namedType.TypeArguments.OfType<INamedTypeSymbol>().SelectMany(ExpandGenericTypes);\n            foreach (var expanded in typeArgs)\n            {\n                yield return expanded;\n            }\n\n            static IEnumerable<INamedTypeSymbol> ConstraintTypes(ITypeParameterSymbol typeParameter) =>\n                typeParameter.ConstraintTypes.OfType<INamedTypeSymbol>().SelectMany(ExpandGenericTypes);\n        }\n\n        private sealed class TypeDependencyCollector : SafeCSharpSyntaxWalker\n        {\n            private readonly SemanticModel model;\n            private readonly TypeDeclarationSyntax originalTypeDeclaration;\n\n            public ISet<INamedTypeSymbol> DependentTypes { get; } = new HashSet<INamedTypeSymbol>();\n\n            public TypeDependencyCollector(SemanticModel model, TypeDeclarationSyntax originalTypeDeclaration)\n            {\n                this.model = model;\n                this.originalTypeDeclaration = originalTypeDeclaration;\n            }\n\n            // This override centralises all traversal guards:\n            // - TypeSyntax subtrees are skipped entirely; type dependencies are collected at the parent level\n            //   via node.TypeSyntax() + AddDependentType, avoiding O(n²) GetSymbolInfo calls on every identifier.\n            // - Nested type declarations are not drilled into; each type is analysed independently.\n            //   VisitRecordDeclaration / VisitRecordStructDeclaration are not available in this Roslyn version,\n            //   so all type-declaration kinds are handled here uniformly via the facade's TypeDeclaration array.\n            public override void Visit(SyntaxNode node)\n            {\n                if (node is TypeSyntax)\n                {\n                    return;\n                }\n\n                if (node != originalTypeDeclaration && CSharpFacade.Instance.SyntaxKind.TypeDeclaration.Contains(node.Kind()))\n                {\n                    return;\n                }\n\n                if (node.TypeSyntax() is { } typeSyntax)\n                {\n                    AddDependentType(typeSyntax);\n                }\n\n                base.Visit(node);\n            }\n\n            public override void VisitVariableDeclarator(VariableDeclaratorSyntax node)\n            {\n                if (node.Initializer is not null)\n                {\n                    AddDependentType(model.GetTypeInfo(node.Initializer.Value));\n                }\n                base.VisitVariableDeclarator(node);\n            }\n\n            public override void VisitMemberAccessExpression(MemberAccessExpressionSyntax node)\n            {\n                // Only call GetSymbolInfo if the left-hand chain is a pure name chain (identifiers and member\n                // accesses terminating at a TypeSyntax). Invocation results, conditionals, array elements,\n                // this/base etc. can never be type references, so we skip the semantic lookup entirely.\n                if (!IsSimpleNameChain(node.Expression))\n                {\n                    base.VisitMemberAccessExpression(node);\n                    return;\n                }\n\n                if (model.GetSymbolInfo(node.Expression).Symbol is INamedTypeSymbol symbol)\n                {\n                    AddDependentType(symbol);\n                    return;\n                }\n                base.VisitMemberAccessExpression(node);\n            }\n\n            public override void VisitInvocationExpression(InvocationExpressionSyntax node)\n            {\n                if (!node.IsNameof(model))\n                {\n                    // GenericNameSyntax is a TypeSyntax, so Visit skips it. We must handle type arguments explicitly.\n                    if (node.Expression switch\n                    {\n                        GenericNameSyntax x => x,\n                        MemberAccessExpressionSyntax { Name: GenericNameSyntax x } => x,\n                        _ => null,\n                    } is { TypeArgumentList.Arguments: { } typeArgs })\n                    {\n                        foreach (var typeArg in typeArgs)\n                        {\n                            AddDependentType(typeArg);\n                        }\n                    }\n                    base.VisitInvocationExpression(node);\n                }\n            }\n\n            // Returns true if the expression is a chain of MemberAccessExpressionSyntax nodes whose\n            // leftmost element is a TypeSyntax (IdentifierName, QualifiedName, AliasQualifiedName, etc.).\n            // This means the chain could be a qualified type reference like Console, NS.MyClass, Outer.Inner.\n            // Any other terminal node (ThisExpression, BaseExpression, InvocationExpression, conditional, etc.)\n            // cannot be a type, so GetSymbolInfo does not need to be called.\n            private static bool IsSimpleNameChain(ExpressionSyntax expression)\n            {\n                var current = expression;\n                while (current is MemberAccessExpressionSyntax ma)\n                {\n                    current = ma.Expression;\n                }\n                return current is TypeSyntax;\n            }\n\n            private void AddDependentType(TypeSyntax typeSyntax)\n            {\n                if (typeSyntax?.Unwrap() is not PredefinedTypeSyntax and { } unwrapped)\n                {\n                    AddDependentType(model.GetSymbolInfo(unwrapped).Symbol);\n                }\n            }\n\n            private void AddDependentType(TypeInfo typeInfo)\n            {\n                AddDependentType(typeInfo.Type);\n                AddDependentType(typeInfo.ConvertedType);\n            }\n\n            private bool AddDependentType(ISymbol symbol) =>\n                symbol switch\n                {\n                    INamedTypeSymbol named => DependentTypes.Add(named),\n                    IArrayTypeSymbol array => AddDependentType(array.ElementType),\n                    IAliasSymbol alias => AddDependentType(alias.Target),\n                    IPointerTypeSymbol pointer => AddDependentType(pointer.PointedAtType),\n                    _ => false\n                };\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/AvoidExcessiveInheritance.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text.RegularExpressions;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public class AvoidExcessiveInheritance : ParametrizedDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S110\";\n        private const string MessageFormat = \"This {0} has {1} parents which is greater than {2} authorized.\";\n        private const string FilteredClassesDefaultValue = \"\";\n        private const int MaximumDepthDefaultValue = 5;\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat, false);\n        private string filteredClasses = FilteredClassesDefaultValue;\n        private ICollection<Regex> filters = new List<Regex>();\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        [RuleParameter(\"max\", PropertyType.Integer, \"Maximum depth of the inheritance tree. (Number)\", MaximumDepthDefaultValue)]\n        public int MaximumDepth { get; set; } = MaximumDepthDefaultValue;\n\n        [RuleParameter(\n            \"filteredClasses\",\n            PropertyType.String,\n            \"Comma-separated list of classes or records to be filtered out of the count of inheritance. Depth \" +\n            \"counting will stop when a filtered class or record is reached. For example: System.Windows.Controls.UserControl, \" +\n            \"System.Windows.*. (String)\",\n            FilteredClassesDefaultValue)]\n        public string FilteredClasses\n        {\n            get => filteredClasses;\n            set\n            {\n                filteredClasses = value;\n                filters = filteredClasses.Split(',').Select(WildcardPatternToRegularExpression).ToList();\n            }\n        }\n\n        protected override void Initialize(SonarParametrizedAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n                {\n                    if (c.IsRedundantPositionalRecordContext())\n                    {\n                        return;\n                    }\n                    var objectTypeInfo = new ObjectTypeInfo(c.Node, c.Model);\n                    if (objectTypeInfo.Symbol is null)\n                    {\n                        return;\n                    }\n\n                    var thisTypeRootNamespace = GetRootNamespace(objectTypeInfo.Symbol);\n                    var baseTypesCount = objectTypeInfo.Symbol.BaseType.GetSelfAndBaseTypes()\n                        .TakeWhile(s => GetRootNamespace(s) == thisTypeRootNamespace)\n                        .Select(nts => nts.OriginalDefinition.ToDisplayString())\n                        .TakeWhile(className => filters.All(regex => !regex.SafeIsMatch(className)))\n                        .Count();\n                    if (baseTypesCount > MaximumDepth)\n                    {\n                        c.ReportIssue(Rule, objectTypeInfo.Identifier, objectTypeInfo.Name, baseTypesCount.ToString(), MaximumDepth.ToString());\n                    }\n                },\n                SyntaxKind.ClassDeclaration,\n                SyntaxKindEx.RecordDeclaration);\n\n        private static string GetRootNamespace(ISymbol symbol)\n        {\n            var ns = symbol.ContainingNamespace;\n            while (ns?.ContainingNamespace?.IsGlobalNamespace is false)\n            {\n                ns = ns.ContainingNamespace;\n            }\n            return ns?.Name ?? string.Empty;\n        }\n\n        private static Regex WildcardPatternToRegularExpression(string pattern)\n        {\n            var regexPattern = string.Concat(\"^\", Regex.Escape(pattern).Replace(\"\\\\*\", \".*\"), \"$\");\n            return new Regex(regexPattern, RegexOptions.Compiled, Constants.DefaultRegexTimeout);\n        }\n\n        private readonly struct ObjectTypeInfo\n        {\n            public SyntaxToken Identifier { get; }\n\n            public INamedTypeSymbol Symbol { get; }\n\n            public string Name { get; }\n\n            public ObjectTypeInfo(SyntaxNode node, SemanticModel model)\n            {\n                if (node is ClassDeclarationSyntax classDeclaration)\n                {\n                    Identifier = classDeclaration.Identifier;\n                    Symbol = model.GetDeclaredSymbol(classDeclaration);\n                    Name = \"class\";\n                }\n                else\n                {\n                    var wrapper = (RecordDeclarationSyntaxWrapper)node;\n                    Identifier = wrapper.Identifier;\n                    Symbol = model.GetDeclaredSymbol(wrapper);\n                    Name = \"record\";\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/AvoidLambdaExpressionInLoopsInBlazor.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class AvoidLambdaExpressionInLoopsInBlazor : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S6802\";\n    private const string MessageFormat = \"Avoid using lambda expressions in loops in Blazor markup.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    private static readonly ISet<string> AddAttributeMethods = new HashSet<string> { \"AddAttribute\", \"AddMultipleAttributes\" };\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(cc =>\n        {\n            // If we are not in a Blazor project, we don't need to register for lambda expressions.\n            if (cc.Compilation.GetTypeByMetadataName(KnownType.Microsoft_AspNetCore_Components_Rendering_RenderTreeBuilder) is null)\n            {\n                return;\n            }\n\n            cc.RegisterNodeAction(c =>\n                {\n                    var node = (LambdaExpressionSyntax)c.Node;\n\n                    if (IsWithinLoopBody(node)\n                        && IsWithinRenderTreeBuilderInvocation(node, c.Model))\n                    {\n                        c.ReportIssue(Rule, node);\n                    }\n                },\n                SyntaxKind.SimpleLambdaExpression,\n                SyntaxKind.ParenthesizedLambdaExpression);\n        });\n\n    private static bool IsWithinRenderTreeBuilderInvocation(SyntaxNode node, SemanticModel semanticModel) =>\n        node.AncestorsAndSelf().Any(x => x is InvocationExpressionSyntax invocation\n                                         && AddAttributeMethods.Contains(invocation.GetName())\n                                         && semanticModel.GetSymbolInfo(invocation.Expression).Symbol is IMethodSymbol symbol\n                                         && symbol.ContainingType.GetSymbolType().Is(KnownType.Microsoft_AspNetCore_Components_Rendering_RenderTreeBuilder));\n\n    private static bool IsWithinLoopBody(SyntaxNode node) =>\n        node.AncestorsAndSelf().Any(x => x is BlockSyntax && x.Parent is ForStatementSyntax or ForEachStatementSyntax or WhileStatementSyntax or DoStatementSyntax);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/AvoidUnsealedAttributes.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class AvoidUnsealedAttributes : AvoidUnsealedAttributesBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/BeginInvokePairedWithEndInvoke.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class BeginInvokePairedWithEndInvoke : BeginInvokePairedWithEndInvokeBase<SyntaxKind, InvocationExpressionSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n    protected override SyntaxKind InvocationExpressionKind => SyntaxKind.InvocationExpression;\n    protected override string CallbackParameterName => \"callback\";\n\n    protected override ISet<SyntaxKind> ParentDeclarationKinds { get; } = new HashSet<SyntaxKind>\n    {\n        SyntaxKind.AnonymousMethodExpression,\n        SyntaxKind.ConstructorDeclaration,\n        SyntaxKind.ConversionOperatorDeclaration,\n        SyntaxKind.DestructorDeclaration,\n        SyntaxKind.InterfaceDeclaration,\n        SyntaxKindEx.LocalFunctionStatement,\n        SyntaxKind.MethodDeclaration,\n        SyntaxKind.OperatorDeclaration,\n        SyntaxKind.ParenthesizedLambdaExpression,\n        SyntaxKind.PropertyDeclaration,\n        SyntaxKind.SimpleLambdaExpression,\n    }.ToImmutableHashSet();\n\n    protected override void VisitInvocation(EndInvokeContext context) =>\n        new InvocationWalker(context).SafeVisit(context.Root);\n\n    protected override bool IsInvalidCallback(SyntaxNode callbackArg, SemanticModel semanticModel)\n    {\n        if (FindCallback(callbackArg, semanticModel) is { } callback)\n        {\n            var callbackModel = callback.EnsureCorrectSemanticModelOrDefault(semanticModel);\n            return callback is MemberAccessExpressionSyntax memberAccess && memberAccess.Name.ToString().Equals(EndInvoke)\n                ? callbackModel.GetSymbolInfo(callback).Symbol is not IMethodSymbol\n                : Language.Syntax.IsNullLiteral(callback) || !IsParentDeclarationWithEndInvoke(callback, callbackModel);\n        }\n\n        return false;\n    }\n\n    /// <summary>\n    /// This method is looking for the callback code which can be:\n    /// - in a identifier initializer (like a lambda)\n    /// - passed directly as a lambda argument\n    /// - passed as a new delegate instantiation (and the code can be inside the method declaration)\n    /// - a mix of the above.\n    /// </summary>\n    private static SyntaxNode FindCallback(SyntaxNode callbackArg, SemanticModel model)\n    {\n        var callback = callbackArg.RemoveParentheses();\n        if (callback is IdentifierNameSyntax identifier)\n        {\n            callback = LookupIdentifierInitializer(identifier, model);\n        }\n\n        if (callback is ObjectCreationExpressionSyntax objectCreation)\n        {\n            callback = objectCreation.ArgumentList.Arguments.Count == 1 ? objectCreation.ArgumentList.Arguments.Single().Expression : null;\n            if (callback is not null && callback.EnsureCorrectSemanticModelOrDefault(model) is { } safeModel && safeModel.GetSymbolInfo(callback).Symbol is IMethodSymbol methodSymbol)\n            {\n                callback = methodSymbol.ImplementationSyntax();\n            }\n        }\n\n        return callback;\n    }\n\n    private static SyntaxNode LookupIdentifierInitializer(IdentifierNameSyntax identifier, SemanticModel semantic) =>\n        semantic.GetSymbolInfo(identifier).Symbol?.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax() is VariableDeclaratorSyntax variableDeclarator\n        && variableDeclarator.Initializer is EqualsValueClauseSyntax equalsValueClause\n            ? equalsValueClause.Value.RemoveParentheses()\n            : null;\n\n    private class InvocationWalker : SafeCSharpSyntaxWalker\n    {\n        private readonly EndInvokeContext context;\n\n        public InvocationWalker(EndInvokeContext context) =>\n            this.context = context;\n\n        public override void Visit(SyntaxNode node)\n        {\n            if (context.Visit(node))\n            {\n                base.Visit(node);\n            }\n        }\n\n        public override void VisitInvocationExpression(InvocationExpressionSyntax node)\n        {\n            if (context.VisitInvocationExpression(node))\n            {\n                base.VisitInvocationExpression(node);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/BinaryOperationWithIdenticalExpressions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class BinaryOperationWithIdenticalExpressions : BinaryOperationWithIdenticalExpressionsBase\n    {\n        internal static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, \"{0}\");\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        private static readonly SyntaxKind[] SyntaxKindsToCheckBinary =\n        {\n            SyntaxKind.SubtractExpression,\n            SyntaxKind.DivideExpression, SyntaxKind.ModuloExpression,\n            SyntaxKind.LogicalOrExpression, SyntaxKind.LogicalAndExpression,\n            SyntaxKind.BitwiseOrExpression, SyntaxKind.BitwiseAndExpression, SyntaxKind.ExclusiveOrExpression,\n            SyntaxKind.EqualsExpression, SyntaxKind.NotEqualsExpression,\n            SyntaxKind.LessThanExpression, SyntaxKind.LessThanOrEqualExpression,\n            SyntaxKind.GreaterThanExpression, SyntaxKind.GreaterThanOrEqualExpression\n        };\n\n        private static readonly SyntaxKind[] SyntaxKindsToCheckAssignment =\n        {\n            SyntaxKind.SubtractAssignmentExpression,\n            SyntaxKind.DivideAssignmentExpression, SyntaxKind.ModuloAssignmentExpression,\n            SyntaxKind.OrAssignmentExpression, SyntaxKind.AndAssignmentExpression, SyntaxKind.ExclusiveOrAssignmentExpression\n        };\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var expression = (BinaryExpressionSyntax)c.Node;\n                    ReportIfOperatorExpressionsMatch(c, expression.Left, expression.Right, expression.OperatorToken);\n                },\n                SyntaxKindsToCheckBinary);\n\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var expression = (AssignmentExpressionSyntax)c.Node;\n                    ReportIfOperatorExpressionsMatch(c, expression.Left, expression.Right, expression.OperatorToken);\n                },\n                SyntaxKindsToCheckAssignment);\n\n            context.RegisterNodeAction(\n                c => ReportOnObjectEqualsMatches(c, (InvocationExpressionSyntax)c.Node),\n                SyntaxKind.InvocationExpression);\n        }\n\n        private static void ReportOnObjectEqualsMatches(SonarSyntaxNodeReportingContext context, InvocationExpressionSyntax invocation)\n        {\n            var methodSymbol = context.Model.GetSymbolInfo(invocation).Symbol as IMethodSymbol;\n\n            var operands = GetOperands(invocation, methodSymbol);\n            if (operands is not null && CSharpEquivalenceChecker.AreEquivalent(RemoveParentheses(operands.Item1), RemoveParentheses(operands.Item2)))\n            {\n                var message = string.Format(EqualsMessage, operands.Item2);\n                context.ReportIssue(Rule, operands.Item1.GetLocation(), [operands.Item2.ToSecondaryLocation()], message);\n            }\n        }\n\n        private static Tuple<SyntaxNode, SyntaxNode> GetOperands(InvocationExpressionSyntax invocation,\n            IMethodSymbol methodSymbol)\n        {\n            if (methodSymbol.IsStaticObjectEquals())\n            {\n                return new Tuple<SyntaxNode, SyntaxNode>(\n                    invocation.ArgumentList.Arguments[0],\n                    invocation.ArgumentList.Arguments[1]);\n            }\n\n            if (methodSymbol.IsObjectEquals())\n            {\n                var invokingExpression = (invocation.Expression as MemberAccessExpressionSyntax)?.Expression;\n                if (invokingExpression != null)\n                {\n                    return new Tuple<SyntaxNode, SyntaxNode>(\n                        invokingExpression,\n                        invocation.ArgumentList.Arguments[0].Expression);\n                }\n            }\n\n            return null;\n        }\n\n        private static SyntaxNode RemoveParentheses(SyntaxNode node) =>\n            node is ExpressionSyntax expression ? expression.RemoveParentheses() : node;\n\n        private static void ReportIfOperatorExpressionsMatch(SonarSyntaxNodeReportingContext context, ExpressionSyntax left, ExpressionSyntax right, SyntaxToken operatorToken)\n        {\n            if (CSharpEquivalenceChecker.AreEquivalent(left.RemoveParentheses(), right.RemoveParentheses()))\n            {\n                var message = string.Format(OperatorMessageFormat, operatorToken);\n                context.ReportIssue(Rule, right, [left.ToSecondaryLocation()], message);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/BlazorQueryParameterRoutableComponent.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class BlazorQueryParameterRoutableComponent : SonarDiagnosticAnalyzer\n{\n    [Obsolete(\"This rule has been deprecated since 9.25\")]\n    private const string NoRouteQueryDiagnosticId = \"S6803\";\n    private const string NoRouteQueryMessageFormat = \"Component parameters can only receive query parameter values in routable components.\";\n\n    private const string QueryTypeDiagnosticId = \"S6797\";\n    private const string QueryTypeMessageFormat = \"Query parameter type '{0}' is not supported.\";\n\n    private static readonly DiagnosticDescriptor S6803Rule = DescriptorFactory.Create(NoRouteQueryDiagnosticId, NoRouteQueryMessageFormat);\n    private static readonly DiagnosticDescriptor S6797Rule = DescriptorFactory.Create(QueryTypeDiagnosticId, QueryTypeMessageFormat);\n\n    private static readonly ISet<KnownType> SupportedQueryTypes = new HashSet<KnownType>\n    {\n        KnownType.System_Boolean,\n        KnownType.System_DateTime,\n        KnownType.System_Decimal,\n        KnownType.System_Double,\n        KnownType.System_Single,\n        KnownType.System_Int32,\n        KnownType.System_Int64,\n        KnownType.System_String,\n        KnownType.System_Guid\n    };\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(S6803Rule, S6797Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(c =>\n        {\n            if (c.Compilation.GetTypeByMetadataName(KnownType.Microsoft_AspNetCore_Components_RouteAttribute) is not null)\n            {\n                c.RegisterSymbolAction(CheckQueryProperties, SymbolKind.Property);\n            }\n        });\n\n    private static void CheckQueryProperties(SonarSymbolReportingContext c)\n    {\n        var property = (IPropertySymbol)c.Symbol;\n        if (property.HasAttribute(KnownType.Microsoft_AspNetCore_Components_SupplyParameterFromQueryAttribute)\n            && property.HasAttribute(KnownType.Microsoft_AspNetCore_Components_ParameterAttribute))\n        {\n            if (!property.ContainingType.HasAttribute(KnownType.Microsoft_AspNetCore_Components_RouteAttribute))\n            {\n                foreach (var location in property.Locations)\n                {\n                    c.ReportIssue(S6803Rule, location);\n                }\n            }\n            else if (!SupportedQueryTypes.Any(x => IsSupportedType(property.Type, x)))\n            {\n                foreach (var propertyType in property.DeclaringSyntaxReferences.Select(x => ((PropertyDeclarationSyntax)x.GetSyntax()).Type))\n                {\n                    c.ReportIssue(S6797Rule, propertyType.GetLocation(), GetTypeName(propertyType));\n                }\n            }\n        }\n    }\n\n    private static bool IsSupportedType(ITypeSymbol type, KnownType supportType)\n    {\n        if (type is IArrayTypeSymbol arrayTypeSymbol)\n        {\n            type = arrayTypeSymbol.ElementType;\n        }\n\n        if (KnownType.System_Nullable_T.Matches(type))\n        {\n            type = ((INamedTypeSymbol)type).TypeArguments[0];\n        }\n\n        return supportType.Matches(type);\n    }\n\n    private static string GetTypeName(TypeSyntax propertyType) =>\n        propertyType switch\n        {\n            GenericNameSyntax genericSyntax when propertyType.NameIs(KnownType.System_Nullable_T.TypeName) => genericSyntax.TypeArgumentList.Arguments[0].GetName(),\n            {} tuple when TupleTypeSyntaxWrapper.IsInstance(tuple) => KnownType.System_ValueTuple.TypeName,\n            _ => propertyType.GetName()\n        };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/BooleanCheckInverted.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class BooleanCheckInverted : BooleanCheckInvertedBase<BinaryExpressionSyntax>\n{\n    private static readonly ISet<SyntaxKind> UnsafeInversionOperators = new HashSet<SyntaxKind>\n        {\n            SyntaxKind.GreaterThanToken,\n            SyntaxKind.GreaterThanEqualsToken,\n            SyntaxKind.LessThanToken,\n            SyntaxKind.LessThanEqualsToken,\n        };\n\n    private static readonly Dictionary<SyntaxKind, string> OppositeTokens = new()\n        {\n            { SyntaxKind.GreaterThanToken, \"<=\" },\n            { SyntaxKind.GreaterThanEqualsToken, \"<\" },\n            { SyntaxKind.LessThanToken, \">=\" },\n            { SyntaxKind.LessThanEqualsToken, \">\" },\n            { SyntaxKind.EqualsEqualsToken, \"!=\" },\n            { SyntaxKind.ExclamationEqualsToken, \"==\" },\n        };\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            AnalysisAction(Rule),\n            SyntaxKind.GreaterThanExpression,\n            SyntaxKind.GreaterThanOrEqualExpression,\n            SyntaxKind.LessThanExpression,\n            SyntaxKind.LessThanOrEqualExpression,\n            SyntaxKind.EqualsExpression,\n            SyntaxKind.NotEqualsExpression);\n\n    protected override bool IsUnsafeInversionOperation(BinaryExpressionSyntax expression, SemanticModel model) =>\n        expression.OperatorToken.IsAnyKind(UnsafeInversionOperators)\n        && (IsNullable(expression.Left, model)\n            || IsNullable(expression.Right, model)\n            || IsConditionalAccessExpression(expression.Left)\n            || IsConditionalAccessExpression(expression.Right)\n            || IsFloatingPoint(expression.Left, model)\n            || IsFloatingPoint(expression.Right, model));\n\n    protected override SyntaxNode LogicalNotNode(BinaryExpressionSyntax expression) =>\n        expression.GetSelfOrTopParenthesizedExpression().Parent is PrefixUnaryExpressionSyntax prefixUnaryExpression\n        && prefixUnaryExpression.OperatorToken.IsKind(SyntaxKind.ExclamationToken)\n            ? prefixUnaryExpression\n            : null;\n\n    protected override string SuggestedReplacement(BinaryExpressionSyntax expression) =>\n        OppositeTokens[expression.OperatorToken.Kind()];\n\n    private static bool IsConditionalAccessExpression(ExpressionSyntax expression) =>\n        expression.RemoveParentheses().IsKind(SyntaxKind.ConditionalAccessExpression);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/BooleanCheckInvertedCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Formatting;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class BooleanCheckInvertedCodeFix : SonarCodeFix\n    {\n        internal const string Title = \"Invert 'Boolean' check\";\n        public override ImmutableArray<string> FixableDiagnosticIds\n        {\n            get\n            {\n                return ImmutableArray.Create(BooleanCheckInverted.DiagnosticId);\n            }\n        }\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n\n            if (!(root.FindNode(diagnosticSpan, getInnermostNodeForTie: true) is PrefixUnaryExpressionSyntax syntaxNode))\n            {\n                return Task.CompletedTask;\n            }\n\n            context.RegisterCodeFix(\n                Title,\n                c =>\n                {\n                    var expression = syntaxNode.Operand.RemoveParentheses();\n                    var newBinary = ChangeOperator((BinaryExpressionSyntax)expression);\n\n                    if (syntaxNode.Parent is ExpressionSyntax &&\n                        !(syntaxNode.Parent is AssignmentExpressionSyntax))\n                    {\n                        newBinary = SyntaxFactory.ParenthesizedExpression(newBinary);\n                    }\n\n                    var newRoot = root.ReplaceNode(\n                        syntaxNode,\n                        newBinary.WithAdditionalAnnotations(Formatter.Annotation));\n\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n\n            return Task.CompletedTask;\n        }\n\n        private static ExpressionSyntax ChangeOperator(BinaryExpressionSyntax binary)\n        {\n            return\n                SyntaxFactory.BinaryExpression(\n                    OppositeExpressionKinds[binary.Kind()],\n                    binary.Left,\n                    binary.Right)\n                .WithTriviaFrom(binary);\n        }\n\n        private static readonly Dictionary<SyntaxKind, SyntaxKind> OppositeExpressionKinds =\n            new Dictionary<SyntaxKind, SyntaxKind>\n            {\n                {SyntaxKind.GreaterThanExpression, SyntaxKind.LessThanOrEqualExpression},\n                {SyntaxKind.GreaterThanOrEqualExpression, SyntaxKind.LessThanExpression},\n                {SyntaxKind.LessThanExpression, SyntaxKind.GreaterThanOrEqualExpression},\n                {SyntaxKind.LessThanOrEqualExpression, SyntaxKind.GreaterThanExpression},\n                {SyntaxKind.EqualsExpression, SyntaxKind.NotEqualsExpression},\n                {SyntaxKind.NotEqualsExpression, SyntaxKind.EqualsExpression}\n            };\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/BooleanLiteralUnnecessary.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class BooleanLiteralUnnecessary : BooleanLiteralUnnecessaryBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n        protected override SyntaxToken? GetOperatorToken(SyntaxNode node) =>\n            node switch\n            {\n                BinaryExpressionSyntax binary => binary.OperatorToken,\n                _ when IsPatternExpressionSyntaxWrapper.IsInstance(node) => ((IsPatternExpressionSyntaxWrapper)node).IsKeyword,\n                _ => null,\n            };\n\n        protected override bool IsTrue(SyntaxNode syntaxNode) => syntaxNode.IsTrue();\n\n        protected override bool IsFalse(SyntaxNode syntaxNode) => syntaxNode.IsFalse();\n\n        protected override bool IsInsideTernaryWithThrowExpression(SyntaxNode syntaxNode) =>\n            syntaxNode.Parent is ConditionalExpressionSyntax conditionalExpression\n            && (IsThrowExpression(conditionalExpression.WhenTrue) || IsThrowExpression(conditionalExpression.WhenFalse));\n\n        protected override SyntaxNode GetLeftNode(SyntaxNode node) =>\n            node switch\n            {\n                BinaryExpressionSyntax binaryExpression => binaryExpression.Left,\n                _ when IsPatternExpressionSyntaxWrapper.IsInstance(node) => ((IsPatternExpressionSyntaxWrapper)node).Expression,\n                _ => null\n            };\n\n        protected override SyntaxNode GetRightNode(SyntaxNode node) =>\n            node switch\n            {\n                BinaryExpressionSyntax binaryExpression => binaryExpression.Right,\n                _ when IsPatternExpressionSyntaxWrapper.IsInstance(node) => ((IsPatternExpressionSyntaxWrapper)node).Pattern,\n                _ => null\n            };\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(CheckLogicalNot, SyntaxKind.LogicalNotExpression);\n            context.RegisterNodeAction(CheckAndExpression, SyntaxKind.LogicalAndExpression);\n            context.RegisterNodeAction(CheckOrExpression, SyntaxKind.LogicalOrExpression);\n            context.RegisterNodeAction(CheckEquals, SyntaxKind.EqualsExpression, SyntaxKindEx.IsPatternExpression);\n            context.RegisterNodeAction(CheckNotEquals, SyntaxKind.NotEqualsExpression);\n            context.RegisterNodeAction(CheckConditional, SyntaxKind.ConditionalExpression);\n            context.RegisterNodeAction(CheckForLoopCondition, SyntaxKind.ForStatement);\n            base.Initialize(context);\n        }\n\n        private void CheckForLoopCondition(SonarSyntaxNodeReportingContext context)\n        {\n            var forLoop = (ForStatementSyntax)context.Node;\n\n            if (forLoop.Condition != null\n                && CSharpEquivalenceChecker.AreEquivalent(forLoop.Condition.RemoveParentheses(), SyntaxConstants.TrueLiteralExpression))\n            {\n                context.ReportIssue(Rule, forLoop.Condition);\n            }\n        }\n\n        private void CheckLogicalNot(SonarSyntaxNodeReportingContext context)\n        {\n            var logicalNot = (PrefixUnaryExpressionSyntax)context.Node;\n            var logicalNotOperand = logicalNot.Operand.RemoveParentheses();\n            if (IsTrue(logicalNotOperand) || IsFalse(logicalNotOperand))\n            {\n                context.ReportIssue(Rule, logicalNot.Operand);\n            }\n        }\n\n        private void CheckConditional(SonarSyntaxNodeReportingContext context)\n        {\n            var conditional = (ConditionalExpressionSyntax)context.Node;\n            var whenTrue = conditional.WhenTrue;\n            var whenFalse = conditional.WhenFalse;\n            if (IsThrowExpression(whenTrue) || IsThrowExpression(whenFalse))\n            {\n                return;\n            }\n            var typeLeft = context.Model.GetTypeInfo(whenTrue).Type;\n            var typeRight = context.Model.GetTypeInfo(whenFalse).Type;\n            if (typeLeft.IsNullableBoolean()\n                || typeRight.IsNullableBoolean()\n                || typeLeft == null\n                || typeRight == null)\n            {\n                return;\n            }\n            CheckTernaryExpressionBranches(context, whenTrue, whenFalse);\n        }\n\n        private static bool IsThrowExpression(ExpressionSyntax expressionSyntax) =>\n            ThrowExpressionSyntaxWrapper.IsInstance(expressionSyntax);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/BooleanLiteralUnnecessaryCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Formatting;\nusing Microsoft.CodeAnalysis.Simplification;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class BooleanLiteralUnnecessaryCodeFix : SonarCodeFix\n    {\n        internal const string Title = \"Remove the unnecessary Boolean literal(s)\";\n        public override ImmutableArray<string> FixableDiagnosticIds =>\n            ImmutableArray.Create(BooleanLiteralUnnecessary.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            if (root.FindNode(diagnosticSpan, getInnermostNodeForTie: true) is not ExpressionSyntax syntaxNode)\n            {\n                return Task.CompletedTask;\n            }\n\n            var parent = syntaxNode.Parent;\n            syntaxNode = syntaxNode.RemoveParentheses();\n\n            if (syntaxNode is BinaryExpressionSyntax binary)\n            {\n                RegisterBinaryExpressionReplacement(context, root, syntaxNode, binary);\n                return Task.CompletedTask;\n            }\n\n            if (syntaxNode is ConditionalExpressionSyntax conditional)\n            {\n                RegisterConditionalExpressionRemoval(context, root, conditional);\n                return Task.CompletedTask;\n            }\n\n            if (IsPatternExpressionSyntaxWrapper.IsInstance(syntaxNode))\n            {\n                RegisterPatternExpressionReplacement(context, root, (IsPatternExpressionSyntaxWrapper)syntaxNode);\n            }\n\n            if (syntaxNode is not LiteralExpressionSyntax literal)\n            {\n                return Task.CompletedTask;\n            }\n\n            if (parent is PrefixUnaryExpressionSyntax)\n            {\n                RegisterBooleanInversion(context, root, literal);\n                return Task.CompletedTask;\n            }\n\n            if (parent is ConditionalExpressionSyntax conditionalParent)\n            {\n                RegisterConditionalExpressionRewrite(context, root, literal, conditionalParent);\n                return Task.CompletedTask;\n            }\n\n            if (parent is BinaryExpressionSyntax binaryParent)\n            {\n                RegisterBinaryExpressionRemoval(context, root, literal, binaryParent);\n                return Task.CompletedTask;\n            }\n\n            if (parent is ForStatementSyntax forStatement)\n            {\n                RegisterForStatementConditionRemoval(context, root, forStatement);\n                return Task.CompletedTask;\n            }\n\n            return Task.CompletedTask;\n        }\n\n        private static void RegisterPatternExpressionReplacement(SonarCodeFixContext context, SyntaxNode root, IsPatternExpressionSyntaxWrapper patternExpression)\n        {\n            var replacement = patternExpression.Pattern.SyntaxNode.IsTrue()\n                ? patternExpression.Expression\n                : GetNegatedExpression(patternExpression.Expression);\n\n            if (replacement.IsTrue())\n            {\n                replacement = SyntaxConstants.TrueLiteralExpression;\n            }\n            else if (replacement.IsFalse())\n            {\n                replacement = SyntaxConstants.FalseLiteralExpression;\n            }\n\n            context.RegisterCodeFix(\n                Title,\n                c =>\n                {\n                    var newRoot = root.ReplaceNode(patternExpression.SyntaxNode, replacement.WithAdditionalAnnotations(Formatter.Annotation));\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n        }\n\n        private static void RegisterForStatementConditionRemoval(SonarCodeFixContext context, SyntaxNode root, ForStatementSyntax forStatement) =>\n            context.RegisterCodeFix(\n                Title,\n                c =>\n                {\n                    var newRoot = root.ReplaceNode(\n                        forStatement,\n                        forStatement.WithCondition(null).WithAdditionalAnnotations(Formatter.Annotation));\n\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n\n        private static void RegisterBinaryExpressionRemoval(SonarCodeFixContext context, SyntaxNode root, LiteralExpressionSyntax literal, BinaryExpressionSyntax binaryParent)\n        {\n            var otherNode = binaryParent.Left.RemoveParentheses().Equals(literal)\n                ? binaryParent.Right\n                : binaryParent.Left;\n\n            context.RegisterCodeFix(\n                Title,\n                c =>\n                {\n                    var newExpression = GetNegatedExpression(otherNode).WithAdditionalAnnotations(Simplifier.Annotation);\n                    var newRoot = root.ReplaceNode(binaryParent, newExpression\n                        .WithAdditionalAnnotations(Formatter.Annotation));\n\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n        }\n\n        private static void RegisterConditionalExpressionRewrite(SonarCodeFixContext context, SyntaxNode root, LiteralExpressionSyntax literal, ConditionalExpressionSyntax conditionalParent) =>\n            context.RegisterCodeFix(\n                Title,\n                c => Task.FromResult(RewriteConditional(context.Document, root, literal, conditionalParent)),\n                context.Diagnostics);\n\n        private static void RegisterBooleanInversion(SonarCodeFixContext context, SyntaxNode root, LiteralExpressionSyntax literal) =>\n            context.RegisterCodeFix(\n                Title,\n                c => Task.FromResult(RemovePrefixUnary(context.Document, root, literal)),\n                context.Diagnostics);\n\n        private static void RegisterConditionalExpressionRemoval(SonarCodeFixContext context, SyntaxNode root, ConditionalExpressionSyntax conditional) =>\n            context.RegisterCodeFix(\n                Title,\n                c => Task.FromResult(RemoveConditional(context.Document, root, conditional)),\n                context.Diagnostics);\n\n        private static void RegisterBinaryExpressionReplacement(SonarCodeFixContext context, SyntaxNode root, SyntaxNode syntaxNode, BinaryExpressionSyntax binary) =>\n            context.RegisterCodeFix(\n                Title,\n                c =>\n                {\n                    var keepThisNode = FindNodeToKeep(binary).WithAdditionalAnnotations(Simplifier.Annotation);\n                    var newRoot = root.ReplaceNode(syntaxNode, keepThisNode\n                        .WithAdditionalAnnotations(Formatter.Annotation));\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n\n        private static SyntaxNode FindNodeToKeep(BinaryExpressionSyntax binary)\n        {\n            // logical and false, logical or true\n            if (binary.IsKind(SyntaxKind.LogicalAndExpression)\n                && (CSharpEquivalenceChecker.AreEquivalent(binary.Left, SyntaxConstants.FalseLiteralExpression)\n                   || CSharpEquivalenceChecker.AreEquivalent(binary.Right, SyntaxConstants.FalseLiteralExpression)))\n            {\n                return SyntaxConstants.FalseLiteralExpression;\n            }\n            if (binary.IsKind(SyntaxKind.LogicalOrExpression)\n                && (CSharpEquivalenceChecker.AreEquivalent(binary.Left, SyntaxConstants.TrueLiteralExpression)\n                   || CSharpEquivalenceChecker.AreEquivalent(binary.Right, SyntaxConstants.TrueLiteralExpression)))\n            {\n                return SyntaxConstants.TrueLiteralExpression;\n            }\n\n            // ==/!= both sides booleans\n            if (binary.IsKind(SyntaxKind.EqualsExpression)\n                && TwoSidesAreDifferentBooleans(binary))\n            {\n                return SyntaxConstants.FalseLiteralExpression;\n            }\n            if (binary.IsKind(SyntaxKind.EqualsExpression)\n                && TwoSidesAreSameBooleans(binary))\n            {\n                return SyntaxConstants.TrueLiteralExpression;\n            }\n            if (binary.IsKind(SyntaxKind.NotEqualsExpression)\n                && TwoSidesAreSameBooleans(binary))\n            {\n                return SyntaxConstants.FalseLiteralExpression;\n            }\n            if (binary.IsKind(SyntaxKind.NotEqualsExpression)\n                && TwoSidesAreDifferentBooleans(binary))\n            {\n                return SyntaxConstants.TrueLiteralExpression;\n            }\n\n            // ==/!= one side boolean\n            if (binary.IsKind(SyntaxKind.EqualsExpression))\n            {\n                // edge case [condition == false] -> !condition\n                if (CSharpEquivalenceChecker.AreEquivalent(binary.Right, SyntaxConstants.FalseLiteralExpression))\n                {\n                    return SyntaxFactory.PrefixUnaryExpression(SyntaxKind.LogicalNotExpression, binary.Left);\n                }\n                // edge case [false == condition] -> !condition\n                if (CSharpEquivalenceChecker.AreEquivalent(binary.Left, SyntaxConstants.FalseLiteralExpression))\n                {\n                    return SyntaxFactory.PrefixUnaryExpression(SyntaxKind.LogicalNotExpression, binary.Right);\n                }\n            }\n\n            return CSharpEquivalenceChecker.AreEquivalent(binary.Left, SyntaxConstants.TrueLiteralExpression)\n                   || CSharpEquivalenceChecker.AreEquivalent(binary.Left, SyntaxConstants.FalseLiteralExpression)\n                ? binary.Right\n                : binary.Left;\n        }\n\n        private static bool TwoSidesAreDifferentBooleans(BinaryExpressionSyntax binary) =>\n            (CSharpEquivalenceChecker.AreEquivalent(binary.Left, SyntaxConstants.TrueLiteralExpression)\n             && CSharpEquivalenceChecker.AreEquivalent(binary.Right, SyntaxConstants.FalseLiteralExpression))\n            || (CSharpEquivalenceChecker.AreEquivalent(binary.Left, SyntaxConstants.FalseLiteralExpression)\n               && CSharpEquivalenceChecker.AreEquivalent(binary.Right, SyntaxConstants.TrueLiteralExpression));\n\n        private static bool TwoSidesAreSameBooleans(BinaryExpressionSyntax binary) =>\n            (CSharpEquivalenceChecker.AreEquivalent(binary.Left, SyntaxConstants.TrueLiteralExpression)\n             && CSharpEquivalenceChecker.AreEquivalent(binary.Right, SyntaxConstants.TrueLiteralExpression))\n            || (CSharpEquivalenceChecker.AreEquivalent(binary.Left, SyntaxConstants.FalseLiteralExpression)\n               && CSharpEquivalenceChecker.AreEquivalent(binary.Right, SyntaxConstants.FalseLiteralExpression));\n\n        private static Document RemovePrefixUnary(Document document, SyntaxNode root, SyntaxNode literal)\n        {\n            if (CSharpEquivalenceChecker.AreEquivalent(literal, SyntaxConstants.TrueLiteralExpression))\n            {\n                var newRoot = root.ReplaceNode(literal.Parent, SyntaxConstants.FalseLiteralExpression);\n                return document.WithSyntaxRoot(newRoot);\n            }\n            else\n            {\n                var newRoot = root.ReplaceNode(literal.Parent, SyntaxConstants.TrueLiteralExpression);\n                return document.WithSyntaxRoot(newRoot);\n            }\n        }\n\n        private static Document RemoveConditional(Document document, SyntaxNode root, ConditionalExpressionSyntax conditional)\n        {\n            if (CSharpEquivalenceChecker.AreEquivalent(conditional.WhenTrue, SyntaxConstants.TrueLiteralExpression))\n            {\n                var newRoot = root.ReplaceNode(\n                    conditional,\n                    conditional.Condition.WithAdditionalAnnotations(Formatter.Annotation));\n                return document.WithSyntaxRoot(newRoot);\n            }\n            else\n            {\n                var newRoot = root.ReplaceNode(\n                    conditional,\n                    GetNegatedExpression(conditional.Condition).WithAdditionalAnnotations(Formatter.Annotation));\n                return document.WithSyntaxRoot(newRoot);\n            }\n        }\n\n        private static SyntaxNode ReplaceExpressionWithBinary(SyntaxNode nodeToReplace, SyntaxNode root, SyntaxKind binaryKind, ExpressionSyntax left, ExpressionSyntax right) =>\n            root.ReplaceNode(\n                nodeToReplace,\n                SyntaxFactory.BinaryExpression(binaryKind, left, right).WithAdditionalAnnotations(Formatter.Annotation));\n\n        private static Document RewriteConditional(Document document, SyntaxNode root, SyntaxNode syntaxNode, ConditionalExpressionSyntax conditional)\n        {\n            var whenTrue = conditional.WhenTrue.RemoveParentheses();\n            if (whenTrue.Equals(syntaxNode) && syntaxNode.IsTrue())\n            {\n                var newRoot = ReplaceExpressionWithBinary(\n                    conditional,\n                    root,\n                    SyntaxKind.LogicalOrExpression,\n                    conditional.Condition,\n                    AddParenthesis(conditional.WhenFalse));\n\n                return document.WithSyntaxRoot(newRoot);\n            }\n\n            if (whenTrue.Equals(syntaxNode) && syntaxNode.IsFalse())\n            {\n                var newRoot = ReplaceExpressionWithBinary(\n                    conditional,\n                    root,\n                    SyntaxKind.LogicalAndExpression,\n                    GetNegatedExpression(conditional.Condition),\n                    AddParenthesis(conditional.WhenFalse));\n\n                return document.WithSyntaxRoot(newRoot);\n            }\n\n            var whenFalse = conditional.WhenFalse.RemoveParentheses();\n\n            if (whenFalse.Equals(syntaxNode) && syntaxNode.IsTrue())\n            {\n                var newRoot = ReplaceExpressionWithBinary(\n                    conditional,\n                    root,\n                    SyntaxKind.LogicalOrExpression,\n                    GetNegatedExpression(conditional.Condition),\n                    AddParenthesis(conditional.WhenTrue));\n\n                return document.WithSyntaxRoot(newRoot);\n            }\n\n            if (whenFalse.Equals(syntaxNode) && syntaxNode.IsFalse())\n            {\n                var newRoot = ReplaceExpressionWithBinary(\n                    conditional,\n                    root,\n                    SyntaxKind.LogicalAndExpression,\n                    conditional.Condition,\n                    AddParenthesis(conditional.WhenTrue));\n\n                return document.WithSyntaxRoot(newRoot);\n            }\n\n            return document;\n        }\n\n        private static ExpressionSyntax GetNegatedExpression(ExpressionSyntax expression) =>\n            SyntaxFactory.PrefixUnaryExpression(SyntaxKind.LogicalNotExpression, AddParenthesis(expression));\n\n        private static ExpressionSyntax AddParenthesis(ExpressionSyntax expression) =>\n            SyntaxFactory.ParenthesizedExpression(expression).WithAdditionalAnnotations(Simplifier.Annotation);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/BreakOutsideSwitch.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class BreakOutsideSwitch : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S1227\";\n        private const string MessageFormat = \"Refactor the code in order to remove this break statement.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var breakNode = (BreakStatementSyntax)c.Node;\n                    if (!IsInSwitch(breakNode))\n                    {\n                        c.ReportIssue(rule, breakNode);\n                    }\n                },\n                SyntaxKind.BreakStatement);\n        }\n\n        private static bool IsInSwitch(BreakStatementSyntax node)\n        {\n            var ancestor = node.FirstAncestorOrSelf<SyntaxNode>(e => LoopOrSwitch.Contains(e.Kind()));\n\n            return ancestor != null && ancestor.IsKind(SyntaxKind.SwitchStatement);\n        }\n\n        private static IEnumerable<SyntaxKind> LoopOrSwitch =>\n            new[]\n                {\n                    SyntaxKind.SwitchStatement,\n                    SyntaxKind.WhileStatement,\n                    SyntaxKind.DoStatement,\n                    SyntaxKind.ForStatement,\n                    SyntaxKind.ForEachStatement,\n                    SyntaxKindEx.ForEachVariableStatement\n                };\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/BypassingAccessibility.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class BypassingAccessibility : BypassingAccessibilityBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n        public BypassingAccessibility() : base(AnalyzerConfiguration.AlwaysEnabled) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/CallToAsyncMethodShouldNotBeBlocking.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class CallToAsyncMethodShouldNotBeBlocking : SonarDiagnosticAnalyzer\n    {\n        private const string MessageFormat = \"Replace this use of '{0}' with '{1}'.\";\n        private const string ResultName = \"Result\";\n        private const string ContinueWithName = \"ContinueWith\";\n        private const string SleepName = \"Sleep\";\n        private const string AzureFunctionSuffix = @\" Do not perform blocking operations in Azure Functions.\";\n\n        private static readonly DiagnosticDescriptor RuleS4462 = DescriptorFactory.Create(\"S4462\", MessageFormat);\n        private static readonly DiagnosticDescriptor RuleS6422 = DescriptorFactory.Create(\"S6422\", MessageFormat + AzureFunctionSuffix);\n\n        private static readonly Dictionary<string, ImmutableArray<KnownType>> InvalidMemberAccess = new()\n        {\n            [\"GetResult\"] = ImmutableArray.Create(KnownType.System_Runtime_CompilerServices_TaskAwaiter, KnownType.System_Runtime_CompilerServices_TaskAwaiter_TResult),\n            [ResultName] = ImmutableArray.Create(KnownType.System_Threading_Tasks_Task_T),\n            [SleepName] = ImmutableArray.Create(KnownType.System_Threading_Thread),\n            [\"Wait\"] = ImmutableArray.Create(KnownType.System_Threading_Tasks_Task),\n            [\"WaitAll\"] = ImmutableArray.Create(KnownType.System_Threading_Tasks_Task),\n            [\"WaitAny\"] = ImmutableArray.Create(KnownType.System_Threading_Tasks_Task),\n        };\n\n        private static readonly Dictionary<string, string[]> MemberNameToMessageArguments = new()\n        {\n            [\"GetResult\"] = new[] { \"Task.GetAwaiter.GetResult\", \"await\" },\n            [ResultName] = new[] { \"Task.Result\", \"await\" },\n            [SleepName] = new[] { \"Thread.Sleep\", \"await Task.Delay\" },\n            [\"Wait\"] = new[] { \"Task.Wait\", \"await\" },\n            [\"WaitAll\"] = new[] { \"Task.WaitAll\", \"await Task.WhenAll\" },\n            [\"WaitAny\"] = new[] { \"Task.WaitAny\", \"await Task.WhenAny\" },\n        };\n\n        private static readonly Dictionary<string, KnownType> TaskThreadPoolCalls = new()\n        {\n            [\"StartNew\"] = KnownType.System_Threading_Tasks_TaskFactory,\n            [\"Run\"] = KnownType.System_Threading_Tasks_Task,\n        };\n\n        private static readonly Dictionary<string, KnownType> WaitForMultipleTasksExecutionCalls = new()\n        {\n            [\"WhenAll\"] = KnownType.System_Threading_Tasks_Task,\n            [\"WaitAll\"] = KnownType.System_Threading_Tasks_Task,\n        };\n\n        private static readonly Dictionary<string, KnownType> WaitForSingleExecutionCalls = new()\n        {\n            [\"Wait\"] = KnownType.System_Threading_Tasks_Task,\n            [\"RunSynchronously\"] = KnownType.System_Threading_Tasks_Task,\n        };\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(RuleS4462, RuleS6422);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(ReportOnViolation, SyntaxKind.SimpleMemberAccessExpression);\n\n        private static void ReportOnViolation(SonarSyntaxNodeReportingContext context)\n        {\n            var simpleMemberAccess = (MemberAccessExpressionSyntax)context.Node;\n            var memberAccessNameName = simpleMemberAccess.GetName();\n\n            if (memberAccessNameName == null\n                || !InvalidMemberAccess.ContainsKey(memberAccessNameName)\n                || IsResultInContinueWithCall(memberAccessNameName, simpleMemberAccess)\n                || IsChainedAfterThreadPoolCall(context.Model, simpleMemberAccess)\n                || simpleMemberAccess.IsInNameOfArgument(context.Model)\n                || simpleMemberAccess.HasAncestor(SyntaxKind.GlobalStatement))\n            {\n                return;\n            }\n\n            var possibleMemberAccesses = InvalidMemberAccess[memberAccessNameName];\n            var memberAccessSymbol = context.Model.GetSymbolInfo(simpleMemberAccess).Symbol;\n            if (memberAccessSymbol?.ContainingType == null || !memberAccessSymbol.ContainingType.ConstructedFrom.IsAny(possibleMemberAccesses))\n            {\n                return;\n            }\n            if (simpleMemberAccess.FirstAncestorOrSelf<BaseMethodDeclarationSyntax>() is { } enclosingMethod)\n            {\n                if (memberAccessNameName == SleepName && !enclosingMethod.Modifiers.Any(SyntaxKind.AsyncKeyword))\n                {\n                    return; // Thread.Sleep should not be used only in async methods\n                }\n                if (context.Model.GetDeclaredSymbol(enclosingMethod).IsMainMethod())\n                {\n                    return; // Main methods are not subject to deadlock issue so no need to report an issue\n                }\n                if (memberAccessNameName == ResultName && IsAwaited(context, simpleMemberAccess))\n                {\n                    return;  // No need to report an issue on a waited object\n                }\n            }\n            context.ReportIssue(context.IsAzureFunction() ? RuleS6422 : RuleS4462, simpleMemberAccess, MemberNameToMessageArguments[memberAccessNameName]);\n        }\n\n        private static bool IsAwaited(SonarSyntaxNodeReportingContext context, MemberAccessExpressionSyntax simpleMemberAccess)\n        {\n            return context.Model.GetSymbolInfo(simpleMemberAccess.Expression).Symbol is { } accessedSymbol\n                   && simpleMemberAccess.FirstAncestorOrSelf<StatementSyntax>() is { } currentStatement\n                   && currentStatement.GetPreviousStatements().Any(ContainsAwaitedInvocation);\n\n            bool ContainsAwaitedInvocation(StatementSyntax statement) =>\n                statement.DescendantNodes().OfType<InvocationExpressionSyntax>().Where(x => x.Expression.IsKind(SyntaxKind.SimpleMemberAccessExpression)).Any(IsTaskAwaited);\n\n            bool IsTaskAwaited(InvocationExpressionSyntax invocation) =>\n                IsAwaitForMultipleTasksExecutionCall(context.Model, invocation, accessedSymbol)\n                || IsAwaitForSingleTaskExecutionCall(context.Model, invocation, accessedSymbol);\n        }\n\n        private static bool IsAwaitForMultipleTasksExecutionCall(SemanticModel model, InvocationExpressionSyntax invocation, ISymbol accessedSymbol) =>\n            IsNamedSymbolOfExpectedType(model, (MemberAccessExpressionSyntax)invocation.Expression, WaitForMultipleTasksExecutionCalls)\n            && invocation.ArgumentList.Arguments.Any(x => Equals(accessedSymbol, model.GetSymbolInfo(x.Expression).Symbol));\n\n        private static bool IsAwaitForSingleTaskExecutionCall(SemanticModel model, InvocationExpressionSyntax invocation, ISymbol accessedSymbol) =>\n            IsNamedSymbolOfExpectedType(model, (MemberAccessExpressionSyntax)invocation.Expression, WaitForSingleExecutionCalls)\n            && Equals(accessedSymbol, model.GetSymbolInfo(((MemberAccessExpressionSyntax)invocation.Expression).Expression).Symbol);\n\n        private static bool IsResultInContinueWithCall(string memberAccessName, MemberAccessExpressionSyntax memberAccess) =>\n            memberAccessName == ResultName\n            && memberAccess.Expression is IdentifierNameSyntax identifierNameSyntax\n            && identifierNameSyntax.GetName() is { } identifierName\n            && memberAccess.FirstAncestorOrSelf<InvocationExpressionSyntax>(x => IsContinueWithCallWithArgumentName(x, identifierName)) is not null;\n\n        private static bool IsContinueWithCallWithArgumentName(InvocationExpressionSyntax invocation, string argumentName) =>\n            invocation.Expression.NameIs(ContinueWithName)\n            && invocation.ArgumentList.Arguments.Any(argument => IsLambdaExpressionWithArgumentName(argument.Expression, argumentName));\n\n        private static bool IsLambdaExpressionWithArgumentName(ExpressionSyntax expression, string argumentName) =>\n            expression switch\n            {\n                SimpleLambdaExpressionSyntax simpleLambda => simpleLambda.Parameter.Identifier.ValueText == argumentName,\n                ParenthesizedLambdaExpressionSyntax parenthesizedLambda => parenthesizedLambda.ParameterList.Parameters.Any(parameter => parameter.Identifier.ValueText == argumentName),\n                _ => false\n            };\n\n        private static bool IsChainedAfterThreadPoolCall(SemanticModel model, MemberAccessExpressionSyntax memberAccess) =>\n            memberAccess.Expression.DescendantNodes().OfType<MemberAccessExpressionSyntax>().Any(x => IsNamedSymbolOfExpectedType(model, x, TaskThreadPoolCalls));\n\n        private static bool IsNamedSymbolOfExpectedType(SemanticModel model, MemberAccessExpressionSyntax memberAccess, Dictionary<string, KnownType> expectedTypes) =>\n            expectedTypes.Keys.Any(memberAccess.NameIs)\n            && model.GetSymbolInfo(memberAccess).Symbol?.ContainingType?.ConstructedFrom is { } memberAccessSymbol\n            && memberAccessSymbol.Is(expectedTypes[memberAccess.Name.Identifier.ValueText]);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/CallerInformationParametersShouldBeLast.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class CallerInformationParametersShouldBeLast : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S3343\";\n        private const string MessageFormat = \"Move '{0}' to the end of the parameter list.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                ReportOnViolation,\n                SyntaxKind.MethodDeclaration,\n                SyntaxKind.ConstructorDeclaration,\n                SyntaxKind.DelegateDeclaration,\n                SyntaxKindEx.LocalFunctionStatement,\n                SyntaxKind.ClassDeclaration,\n                SyntaxKindEx.RecordDeclaration,\n                SyntaxKindEx.RecordStructDeclaration);\n\n        private static void ReportOnViolation(SonarSyntaxNodeReportingContext context)\n        {\n            var methodDeclaration = context.Node;\n            var parameterList = methodDeclaration.ParameterList();\n            if (parameterList is null or { Parameters.Count: 0 })\n            {\n                return;\n            }\n\n            var methodSymbol = context.Model.GetDeclaredSymbol(methodDeclaration);\n            if (methodSymbol == null ||\n                methodSymbol.IsOverride ||\n                methodSymbol.InterfaceMembers().Any())\n            {\n                return;\n            }\n\n            ParameterSyntax noCallerInfoParameter = null;\n            foreach (var parameter in parameterList.Parameters.Reverse())\n            {\n                if (parameter.AttributeLists.GetAttributes(KnownType.CallerInfoAttributes, context.Model).Any())\n                {\n                    if (noCallerInfoParameter != null && HasIdentifier(parameter))\n                    {\n                        context.ReportIssue(Rule, parameter, parameter.Identifier.Text);\n                    }\n                }\n                else\n                {\n                    noCallerInfoParameter = parameter;\n                }\n            }\n        }\n\n        private static bool HasIdentifier(ParameterSyntax parameter) =>\n            !string.IsNullOrEmpty(parameter.Identifier.Text);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/CastConcreteTypeToInterface.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class CastConcreteTypeToInterface : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S3215\";\n        private const string MessageFormat = \"Remove this cast and edit the interface to add the missing functionality.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var castExpression = (CastExpressionSyntax)c.Node;\n                    CheckForIssue(c, castExpression.Expression, castExpression.Type);\n                },\n                SyntaxKind.CastExpression);\n\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var castExpression = (BinaryExpressionSyntax)c.Node;\n                    CheckForIssue(c, castExpression.Left, castExpression.Right);\n                },\n                SyntaxKind.AsExpression);\n        }\n\n        private static void CheckForIssue(SonarSyntaxNodeReportingContext context, SyntaxNode fromExpression, SyntaxNode toExpression)\n        {\n            var castedFrom = context.Model.GetTypeInfo(fromExpression).Type;\n            var castedTo = context.Model.GetTypeInfo(toExpression).Type;\n            if (castedFrom.Is(TypeKind.Interface)\n                && castedFrom.DeclaringSyntaxReferences.Any()\n                && castedTo.Is(TypeKind.Class)\n                && !castedTo.Is(KnownType.System_Object))\n            {\n                context.ReportIssue(Rule, context.Node);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/CastShouldNotBeDuplicated.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class CastShouldNotBeDuplicated : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S3247\";\n    private const string MessageFormat = \"{0}\";\n    private const string UsePatternMatchingCheckMessage = \"Replace this type-check-and-cast sequence to use pattern matching.\";\n    private const string RemoveRedundantCastAnotherVariableMessage = \"Remove this cast and use the appropriate variable.\";\n    private const string RemoveRedundantCastMessage = \"Remove this redundant cast.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(IsExpression, SyntaxKind.IsExpression);\n        context.RegisterNodeAction(IsPatternExpression, SyntaxKindEx.IsPatternExpression);\n        context.RegisterNodeAction(SwitchExpressionArm, SyntaxKindEx.SwitchExpressionArm);\n        context.RegisterNodeAction(CasePatternSwitchLabel, SyntaxKindEx.CasePatternSwitchLabel);\n    }\n\n    private static void CasePatternSwitchLabel(SonarSyntaxNodeReportingContext analysisContext)\n    {\n        var casePatternSwitch = (CasePatternSwitchLabelSyntaxWrapper)analysisContext.Node;\n        if (casePatternSwitch.SyntaxNode.GetFirstNonParenthesizedParent().GetFirstNonParenthesizedParent() is SwitchStatementSyntax parentSwitchStatement)\n        {\n            ProcessPatternExpression(analysisContext, casePatternSwitch.Pattern, parentSwitchStatement.Expression, parentSwitchStatement);\n        }\n    }\n\n    private static void SwitchExpressionArm(SonarSyntaxNodeReportingContext analysisContext)\n    {\n        var isSwitchExpression = (SwitchExpressionArmSyntaxWrapper)analysisContext.Node;\n        var parent = isSwitchExpression.SyntaxNode.GetFirstNonParenthesizedParent();\n        if (parent.IsKind(SyntaxKindEx.SwitchExpression))\n        {\n            var switchExpression = (SwitchExpressionSyntaxWrapper)parent;\n            ProcessPatternExpression(analysisContext, isSwitchExpression.Pattern, switchExpression.GoverningExpression, isSwitchExpression);\n        }\n    }\n\n    private static void IsPatternExpression(SonarSyntaxNodeReportingContext analysisContext)\n    {\n        var isPatternExpression = (IsPatternExpressionSyntaxWrapper)analysisContext.Node;\n        if (isPatternExpression.SyntaxNode.GetFirstNonParenthesizedParent() is IfStatementSyntax parentIfStatement)\n        {\n            ProcessPatternExpression(analysisContext, isPatternExpression.Pattern, isPatternExpression.Expression, parentIfStatement.Statement);\n        }\n    }\n\n    private static void IsExpression(SonarSyntaxNodeReportingContext analysisContext)\n    {\n        var isExpression = (BinaryExpressionSyntax)analysisContext.Node;\n        if (isExpression.Right is TypeSyntax castType\n            && isExpression.GetFirstNonParenthesizedParent() is IfStatementSyntax parentIfStatement)\n        {\n            ReportPatternAtMainVariable(analysisContext, isExpression.Left, isExpression.GetLocation(), parentIfStatement.Statement, castType, UsePatternMatchingCheckMessage);\n        }\n    }\n\n    private static Location[] DuplicatedCastLocations(SonarSyntaxNodeReportingContext context, SyntaxNode parentStatement, TypeSyntax castType, SyntaxNode typedVariable)\n    {\n        var typeExpressionSymbol = context.Model.GetSymbolInfo(typedVariable).Symbol ?? context.Model.GetDeclaredSymbol(typedVariable);\n        return typeExpressionSymbol is null ? [] : parentStatement.DescendantNodes().Where(IsDuplicatedCast).Select(x => x.GetLocation()).ToArray();\n\n        bool IsDuplicatedCast(SyntaxNode node)\n        {\n            if (node is CastExpressionSyntax cast)\n            {\n                return IsDuplicatedCastOnSameSymbol(cast.Expression, cast.Type);\n            }\n            else if (node is BinaryExpressionSyntax binary && binary.Kind() is SyntaxKind.AsExpression or SyntaxKind.IsExpression)\n            {\n                return IsDuplicatedCastOnSameSymbol(binary.Left, binary.Right);\n            }\n            else\n            {\n                return false;\n            }\n        }\n\n        bool IsDuplicatedCastOnSameSymbol(ExpressionSyntax expression, SyntaxNode type) =>\n            type.WithoutTrivia().IsEquivalentTo(castType.WithoutTrivia())\n            && IsCastOnSameSymbol(expression)\n            && !CSharpFacade.Instance.Syntax.IsInExpressionTree(context.Model, expression); // see https://github.com/SonarSource/sonar-dotnet/issues/8735#issuecomment-1943419398\n\n        bool IsCastOnSameSymbol(ExpressionSyntax expression) =>\n            IsEquivalentVariable(expression, typedVariable)\n            && Equals(context.Model.GetSymbolInfo(expression).Symbol, typeExpressionSymbol);\n    }\n\n    private static void ProcessPatternExpression(SonarSyntaxNodeReportingContext analysisContext, SyntaxNode isPattern, SyntaxNode mainVariableExpression, SyntaxNode parentStatement)\n    {\n        foreach (var expressionPatternPair in ((ExpressionSyntax)mainVariableExpression).MapToPattern(isPattern))\n        {\n            var pattern = expressionPatternPair.Value;\n            var leftVariable = expressionPatternPair.Key;\n            var targetTypes = GetTypesFromPattern(pattern);\n            var rightPartsToCheck = new Dictionary<SyntaxNode, Tuple<TypeSyntax, Location>>();\n            foreach (var subPattern in pattern.DescendantNodesAndSelf().Where(x => x?.Kind() is SyntaxKindEx.DeclarationPattern or SyntaxKindEx.RecursivePattern))\n            {\n                if (DeclarationPatternSyntaxWrapper.IsInstance(subPattern) && (DeclarationPatternSyntaxWrapper)subPattern is var declarationPattern)\n                {\n                    rightPartsToCheck.Add(declarationPattern.Designation.SyntaxNode, new Tuple<TypeSyntax, Location>(declarationPattern.Type, subPattern.GetLocation()));\n                }\n                else if ((RecursivePatternSyntaxWrapper)subPattern is { Designation.SyntaxNode: { }, Type: { } } recursivePattern)\n                {\n                    rightPartsToCheck.Add(recursivePattern.Designation.SyntaxNode, new Tuple<TypeSyntax, Location>(recursivePattern.Type, subPattern.GetLocation()));\n                }\n            }\n\n            var mainVarMsg = rightPartsToCheck.Any()\n                ? RemoveRedundantCastAnotherVariableMessage\n                : RemoveRedundantCastMessage;\n            foreach (var targetType in targetTypes)\n            {\n                ReportPatternAtMainVariable(analysisContext, leftVariable, leftVariable.GetLocation(), parentStatement, targetType, mainVarMsg);\n            }\n\n            foreach (var variableTypePair in rightPartsToCheck)\n            {\n                ReportPatternAtCastLocation(analysisContext, variableTypePair.Key, variableTypePair.Value.Item2, parentStatement, variableTypePair.Value.Item1, RemoveRedundantCastMessage);\n            }\n        }\n    }\n\n    private static IEnumerable<TypeSyntax> GetTypesFromPattern(SyntaxNode pattern)\n    {\n        var targetTypes = new HashSet<TypeSyntax>();\n        if (RecursivePatternSyntaxWrapper.IsInstance(pattern) && ((RecursivePatternSyntaxWrapper)pattern is { PositionalPatternClause.SyntaxNode: { } } recursivePattern))\n        {\n            foreach (var subpattern in recursivePattern.PositionalPatternClause.Subpatterns)\n            {\n                AddPatternType(subpattern.Pattern, targetTypes);\n            }\n        }\n        else if (BinaryPatternSyntaxWrapper.IsInstance(pattern) && (BinaryPatternSyntaxWrapper)pattern is { } binaryPattern)\n        {\n            AddPatternType(binaryPattern.Left, targetTypes);\n            AddPatternType(binaryPattern.Right, targetTypes);\n        }\n        else if (ListPatternSyntaxWrapper.IsInstance(pattern) && (ListPatternSyntaxWrapper)pattern is { } listPattern)\n        {\n            foreach (var subpattern in listPattern.Patterns)\n            {\n                AddPatternType(subpattern, targetTypes);\n            }\n        }\n        else\n        {\n            AddPatternType(pattern, targetTypes);\n        }\n        return targetTypes;\n\n        static void AddPatternType(SyntaxNode pattern, ISet<TypeSyntax> targetTypes)\n        {\n            if (GetType(pattern) is { } patternType)\n            {\n                targetTypes.Add(patternType);\n            }\n        }\n    }\n\n    private static TypeSyntax GetType(SyntaxNode pattern)\n    {\n        if (ConstantPatternSyntaxWrapper.IsInstance(pattern))\n        {\n            return ((ConstantPatternSyntaxWrapper)pattern).Expression as TypeSyntax;\n        }\n        else if (DeclarationPatternSyntaxWrapper.IsInstance(pattern))\n        {\n            return ((DeclarationPatternSyntaxWrapper)pattern).Type;\n        }\n        else if (RecursivePatternSyntaxWrapper.IsInstance(pattern))\n        {\n            return ((RecursivePatternSyntaxWrapper)pattern).Type;\n        }\n        return null;\n    }\n\n    private static void ReportPatternAtMainVariable(SonarSyntaxNodeReportingContext context,\n                                                    SyntaxNode variableExpression,\n                                                    Location mainLocation,\n                                                    SyntaxNode parentStatement,\n                                                    TypeSyntax castType,\n                                                    string message)\n    {\n        var duplicatedCastLocations = DuplicatedCastLocations(context, parentStatement, castType, variableExpression);\n        if (duplicatedCastLocations.Any())\n        {\n            context.ReportIssue(Rule, mainLocation, duplicatedCastLocations.ToSecondary(), message);\n        }\n    }\n\n    private static void ReportPatternAtCastLocation(SonarSyntaxNodeReportingContext context,\n                                                    SyntaxNode variableExpression,\n                                                    Location patternLocation,\n                                                    SyntaxNode parentStatement,\n                                                    TypeSyntax castType,\n                                                    string message)\n    {\n        var duplicatedCastLocations = DuplicatedCastLocations(context, parentStatement, castType, variableExpression);\n        foreach (var castLocation in duplicatedCastLocations)\n        {\n            context.ReportIssue(Rule, castLocation, [patternLocation.ToSecondary()], message);\n        }\n    }\n\n    private static bool IsEquivalentVariable(ExpressionSyntax expression, SyntaxNode typedVariable)\n    {\n        var left = CleanupExpression(typedVariable).WithoutTrivia();\n        var right = CleanupExpression(expression).WithoutTrivia();\n\n        return left.IsEquivalentTo(right)\n            || (StandaloneIdentifier(left) is { } leftIdentifier && leftIdentifier == StandaloneIdentifier(right));\n\n        static string StandaloneIdentifier(SyntaxNode node) =>\n            node switch\n            {\n                IdentifierNameSyntax name => name.Identifier.ValueText,\n                _ when node.IsKind(SyntaxKindEx.SingleVariableDesignation) => ((SingleVariableDesignationSyntaxWrapper)node).Identifier.ValueText,\n                _ => null\n            };\n    }\n\n    private static SyntaxNode CleanupExpression(SyntaxNode node)\n    {\n        while (node is ParenthesizedExpressionSyntax parenthesized)\n        {\n            node = parenthesized.Expression;\n        }\n        return node is MemberAccessExpressionSyntax { Expression: ThisExpressionSyntax } memberAccess ? memberAccess.Name : node;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/CatchEmpty.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class CatchEmpty : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S2486\";\n        private const string MessageFormat = \"Handle the exception or explain in a comment why it can be ignored.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var catchClause = (CatchClauseSyntax)c.Node;\n\n                    if (!HasStatements(catchClause) &&\n                        !HasComments(catchClause) &&\n                        IsGenericCatch(catchClause, c.Model))\n                    {\n                        c.ReportIssue(rule, c.Node);\n                    }\n                },\n                SyntaxKind.CatchClause);\n        }\n\n        private static bool IsGenericCatch(CatchClauseSyntax catchClause, SemanticModel semanticModel)\n        {\n            if (catchClause.Declaration == null)\n            {\n                return true;\n            }\n\n            if (catchClause.Filter != null)\n            {\n                return false;\n            }\n\n            var type = semanticModel.GetTypeInfo(catchClause.Declaration.Type).Type;\n            return type.Is(KnownType.System_Exception);\n        }\n\n        private static bool HasComments(CatchClauseSyntax catchClause)\n        {\n            return catchClause.Block.OpenBraceToken.TrailingTrivia.Any(IsCommentTrivia) ||\n                catchClause.Block.CloseBraceToken.LeadingTrivia.Any(IsCommentTrivia);\n        }\n\n        private static bool IsCommentTrivia(SyntaxTrivia trivia)\n        {\n            return trivia.IsKind(SyntaxKind.MultiLineCommentTrivia) || trivia.IsKind(SyntaxKind.SingleLineCommentTrivia);\n        }\n\n        private static bool HasStatements(CatchClauseSyntax catchClause)\n        {\n            return catchClause.Block.Statements.Any();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/CatchRethrow.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class CatchRethrow : CatchRethrowBase<SyntaxKind, CatchClauseSyntax>\n{\n    private static readonly BlockSyntax ThrowBlock = SyntaxFactory.Block(SyntaxFactory.ThrowStatement());\n\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override bool ContainsOnlyThrow(CatchClauseSyntax currentCatch) =>\n        CSharpEquivalenceChecker.AreEquivalent(currentCatch.Block, ThrowBlock);\n\n    protected override CatchClauseSyntax[] AllCatches(SyntaxNode node) =>\n        ((TryStatementSyntax)node).Catches.ToArray();\n\n    protected override SyntaxNode DeclarationType(CatchClauseSyntax catchClause) =>\n        catchClause.Declaration?.Type;\n\n    protected override bool HasFilter(CatchClauseSyntax catchClause) =>\n        catchClause.Filter is not null;\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(RaiseOnInvalidCatch, SyntaxKind.TryStatement);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/CatchRethrowCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Formatting;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class CatchRethrowCodeFix : SonarCodeFix\n    {\n        internal const string Title = \"Remove redundant catch\";\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(CatchRethrow.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            var syntaxNode = root.FindNode(diagnosticSpan);\n\n            if (!(syntaxNode.Parent is TryStatementSyntax tryStatement))\n            {\n                return Task.CompletedTask;\n            }\n\n            context.RegisterCodeFix(\n                Title,\n                c =>\n                {\n                    var newRoot = CalculateNewRoot(root, syntaxNode, tryStatement);\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n\n            return Task.CompletedTask;\n        }\n\n        private static SyntaxNode CalculateNewRoot(SyntaxNode root, SyntaxNode currentNode, TryStatementSyntax tryStatement)\n        {\n            var isTryRemovable = tryStatement.Catches.Count == 1 && tryStatement.Finally == null;\n\n            return isTryRemovable\n                ? root.ReplaceNode(\n                    tryStatement,\n                    tryStatement.Block.Statements.Select(st => st.WithAdditionalAnnotations(Formatter.Annotation)))\n                : root.RemoveNode(currentNode, SyntaxRemoveOptions.KeepNoTrivia);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/CertificateValidationCheck.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class CertificateValidationCheck : CertificateValidationCheckBase<\n    SyntaxKind,\n    ArgumentSyntax,\n    ExpressionSyntax,\n    IdentifierNameSyntax,\n    AssignmentExpressionSyntax,\n    InvocationExpressionSyntax,\n    ParameterSyntax,\n    VariableDeclaratorSyntax,\n    ParenthesizedLambdaExpressionSyntax,\n    MemberAccessExpressionSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language { get; } = CSharpFacade.Instance;\n    protected override HashSet<SyntaxKind> MethodDeclarationKinds { get; } = [SyntaxKind.MethodDeclaration, SyntaxKindEx.LocalFunctionStatement];\n    protected override HashSet<SyntaxKind> TypeDeclarationKinds { get; } = CSharpFacade.Instance.SyntaxKind.TypeDeclaration.ToHashSet();\n\n    internal override MethodParameterLookupBase<ArgumentSyntax> CreateParameterLookup(SyntaxNode argumentListNode, IMethodSymbol method) =>\n        argumentListNode switch\n        {\n            InvocationExpressionSyntax invocation => new CSharpMethodParameterLookup(invocation.ArgumentList, method),\n            _ when ObjectCreationFactory.TryCreate(argumentListNode) is { ArgumentList: { } argumentList } => new CSharpMethodParameterLookup(argumentList, method),\n            _ => throw new ArgumentException(\"Unexpected type.\", nameof(argumentListNode))  // This should be throw only by bad usage of this method, not by input dependency\n        };\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        // Handling of += syntax\n        context.RegisterNodeAction(CheckAssignmentSyntax, SyntaxKind.AddAssignmentExpression);\n\n        // Handling of = syntax\n        context.RegisterNodeAction(CheckAssignmentSyntax, SyntaxKind.SimpleAssignmentExpression);\n\n        // Handling of constructor parameter syntax (SslStream)\n        context.RegisterNodeAction(CheckConstructorParameterSyntax, SyntaxKind.ObjectCreationExpression, SyntaxKindEx.ImplicitObjectCreationExpression);\n    }\n\n    protected override SyntaxNode FindRootTypeDeclaration(SyntaxNode node) =>\n        base.FindRootTypeDeclaration(node) ?? node.FirstAncestorOrSelf<GlobalStatementSyntax>()?.Parent;\n\n    protected override Location ExpressionLocation(SyntaxNode expression) =>\n        // For Lambda expression extract location of the parentheses only to separate them from secondary location of \"true\"\n        ((expression is ParenthesizedLambdaExpressionSyntax lambda) ? lambda.ParameterList : expression).GetLocation();\n\n    protected override void SplitAssignment(AssignmentExpressionSyntax assignment, out IdentifierNameSyntax leftIdentifier, out ExpressionSyntax right)\n    {\n        leftIdentifier = assignment.Left.DescendantNodesAndSelf().OfType<IdentifierNameSyntax>().LastOrDefault();\n        right = assignment.Right;\n    }\n\n    protected override IEqualityComparer<ExpressionSyntax> CreateNodeEqualityComparer() =>\n        new CSharpSyntaxNodeEqualityComparer<ExpressionSyntax>();\n\n    protected override ExpressionSyntax[] FindReturnAndThrowExpressions(InspectionContext c, SyntaxNode block) =>\n        block.DescendantNodes().OfType<ReturnStatementSyntax>().Select(x => x.Expression)\n            // Throw statements #2825. x.Expression can be NULL for standalone Throw and we need that one as well.\n            .Concat(block.DescendantNodes().OfType<ThrowStatementSyntax>().Select(x => x.Expression))\n            .ToArray();\n\n    protected override bool IsTrueLiteral(ExpressionSyntax expression) =>\n        expression?.RemoveParentheses().Kind() == SyntaxKind.TrueLiteralExpression;\n\n    protected override ExpressionSyntax VariableInitializer(VariableDeclaratorSyntax variable) =>\n        variable.Initializer?.Value;\n\n    protected override ImmutableArray<Location> LambdaLocations(InspectionContext c, ParenthesizedLambdaExpressionSyntax lambda)\n    {\n        if (lambda.Body is BlockSyntax block)\n        {\n            return BlockLocations(c, block);\n        }\n        if (lambda.Body is ExpressionSyntax expr && IsTrueLiteral(expr))   // LiteralExpressionSyntax or ParenthesizedExpressionSyntax like (((true)))\n        {\n            return new[] { lambda.Body.GetLocation() }.ToImmutableArray();      // Code was found guilty for lambda (...) => true\n        }\n        return ImmutableArray<Location>.Empty;\n    }\n\n    protected override SyntaxNode LocalVariableScope(VariableDeclaratorSyntax variable) =>\n        variable.FirstAncestorOrSelf<BlockSyntax>();\n\n    protected override SyntaxNode ExtractArgumentExpressionNode(SyntaxNode expression) =>\n        expression.RemoveParentheses();\n\n    protected override SyntaxNode SyntaxFromReference(SyntaxReference reference) =>\n        reference.GetSyntax();   // VB.NET has more complicated logic\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/CheckArgumentException.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public class CheckArgumentException : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S3928\";\n        private const string MessageFormat = \"{0}\";\n        private const string ParameterLessConstructorMessage = \"Use a constructor overloads that allows a more meaningful exception message to be provided.\";\n        private const string ConstructorParametersInverted = \"ArgumentException constructor arguments have been inverted.\";\n        private const string InvalidParameterName = \"The parameter name '{0}' is not declared in the argument list.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        private static readonly ImmutableArray<KnownType> ArgumentExceptionTypesToCheck =\n            ImmutableArray.Create(\n                KnownType.System_ArgumentException,\n                KnownType.System_ArgumentNullException,\n                KnownType.System_ArgumentOutOfRangeException,\n                KnownType.System_DuplicateWaitObjectException);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(CheckForIssue, SyntaxKind.ObjectCreationExpression, SyntaxKindEx.ImplicitObjectCreationExpression);\n\n        private static void CheckForIssue(SonarSyntaxNodeReportingContext analysisContext)\n        {\n            var objectCreation = ObjectCreationFactory.Create(analysisContext.Node);\n            var methodSymbol = objectCreation.MethodSymbol(analysisContext.Model);\n            if (methodSymbol?.ContainingType == null || !methodSymbol.ContainingType.IsAny(ArgumentExceptionTypesToCheck))\n            {\n                return;\n            }\n\n            if (objectCreation.ArgumentList == null || objectCreation.ArgumentList.Arguments.Count == 0)\n            {\n                analysisContext.ReportIssue(Rule, objectCreation.Expression, ParameterLessConstructorMessage);\n                return;\n            }\n\n            var parameterAndMessage = RetrieveParameterAndMessageArgumentValue(methodSymbol, objectCreation, analysisContext.Model);\n\n            var constructorParameterArgument = parameterAndMessage.Item1;\n            var constructorMessageArgument = parameterAndMessage.Item2;\n\n            if (!constructorParameterArgument.HasValue)\n            {\n                // can't check non-constant strings OR argument is not set\n                return;\n            }\n\n            var methodArgumentNames = GetMethodArgumentNames(objectCreation.Expression).ToHashSet();\n            if (!methodArgumentNames.Contains(TakeOnlyBeforeDot(constructorParameterArgument)))\n            {\n                var message = constructorMessageArgument.HasValue && methodArgumentNames.Contains(TakeOnlyBeforeDot(constructorMessageArgument))\n                    ? ConstructorParametersInverted\n                    : string.Format(InvalidParameterName, constructorParameterArgument.Value);\n                analysisContext.ReportIssue(Rule, objectCreation.Expression, message);\n            }\n        }\n\n        private static Tuple<Optional<object>, Optional<object>> RetrieveParameterAndMessageArgumentValue(IMethodSymbol methodSymbol, IObjectCreation objectCreation, SemanticModel semanticModel)\n        {\n            var parameterNameValue = default(Optional<object>);\n            var messageValue = default(Optional<object>);\n            for (var i = 0; i < methodSymbol.Parameters.Length; i++)\n            {\n                var argument = objectCreation.ArgumentList.Arguments[i];\n                var argumentExpression = objectCreation.ArgumentList.Arguments[i].Expression;\n                var argumentName = argument.NameColon != null\n                                   ? argument.NameColon.Name.Identifier.ValueText\n                                   : methodSymbol.Parameters[i].MetadataName;\n\n                if (argumentName.Equals(\"paramName\", StringComparison.Ordinal) || argumentName.Equals(\"parameterName\", StringComparison.Ordinal))\n                {\n                    parameterNameValue = semanticModel.GetConstantValue(argumentExpression);\n                }\n                else if (argumentName.Equals(\"message\", StringComparison.Ordinal))\n                {\n                    messageValue = semanticModel.GetConstantValue(argumentExpression);\n                }\n            }\n\n            return new Tuple<Optional<object>, Optional<object>>(parameterNameValue, messageValue);\n        }\n\n        private static IEnumerable<string> GetMethodArgumentNames(SyntaxNode creationSyntax)\n        {\n            var node = creationSyntax.AncestorsAndSelf().FirstOrDefault(ancestor =>\n                ancestor is SimpleLambdaExpressionSyntax\n                    or ParenthesizedLambdaExpressionSyntax\n                    or AccessorDeclarationSyntax\n                    or BaseMethodDeclarationSyntax\n                    or IndexerDeclarationSyntax\n                    or PropertyDeclarationSyntax\n                    or CompilationUnitSyntax\n                || LocalFunctionStatementSyntaxWrapper.IsInstance(ancestor));\n\n            var parameterList = node switch\n            {\n                SimpleLambdaExpressionSyntax simpleLambda => new[] { simpleLambda.Parameter.Identifier.ValueText },\n                BaseMethodDeclarationSyntax method => IdentifierNames(method.ParameterList),\n                ParenthesizedLambdaExpressionSyntax lambda => IdentifierNames(lambda.ParameterList),\n                AccessorDeclarationSyntax accessor => AccessorIdentifierNames(accessor),\n                IndexerDeclarationSyntax indexerDeclaration => IdentifierNames(indexerDeclaration.ParameterList),\n                PropertyDeclarationSyntax propertyDeclaration => ParentParameterList(propertyDeclaration),\n                CompilationUnitSyntax => new[] { \"args\" },\n                { } when LocalFunctionStatementSyntaxWrapper.IsInstance(node) => IdentifierNames(((LocalFunctionStatementSyntaxWrapper)node).ParameterList),\n                _ => Enumerable.Empty<string>()\n            };\n\n            return parameterList.Union(ParentParameterList(creationSyntax));\n\n            static IEnumerable<string> IdentifierNames(BaseParameterListSyntax parameterList) =>\n                    parameterList.Parameters.Select(x => x.Identifier.ValueText);\n\n            static IEnumerable<string> AccessorIdentifierNames(AccessorDeclarationSyntax accessor)\n            {\n                var arguments = new List<string>();\n                if (accessor.FirstAncestorOrSelf<IndexerDeclarationSyntax>() is { } indexer)\n                {\n                    arguments.AddRange(IdentifierNames(indexer.ParameterList));\n                }\n                if (accessor.Kind() is SyntaxKind.SetAccessorDeclaration or SyntaxKindEx.InitAccessorDeclaration)\n                {\n                    if (accessor.Parent.Parent is PropertyDeclarationSyntax propertyDeclaration)\n                    {\n                        arguments.Add(propertyDeclaration.Identifier.Text);\n                    }\n                    arguments.Add(\"value\");\n                }\n                return arguments;\n            }\n\n            static IEnumerable<string> ParentParameterList(SyntaxNode node) =>\n                node?.Ancestors().OfType<TypeDeclarationSyntax>().FirstOrDefault() is { } typeDeclaration\n                    ? GetIdentifierNames(typeDeclaration.ParameterList())\n                    : Enumerable.Empty<string>();\n\n            static IEnumerable<string> GetIdentifierNames(ParameterListSyntax parameterList) =>\n                parameterList is null ? Enumerable.Empty<string>() : IdentifierNames(parameterList);\n        }\n\n        private static string TakeOnlyBeforeDot(Optional<object> value) =>\n            (value.Value as string)?.Split('.').FirstOrDefault();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/CheckFileLicense.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public class CheckFileLicense : CheckFileLicenseBase\n    {\n        internal const string HeaderFormatDefaultValue = @\"/*\n * <Your-Product-Name>\n * Copyright (c) <Year-From>-<Year-To> <Your-Company-Name>\n *\n * Please configure this header in your SonarCloud/SonarQube quality profile.\n * You can also set it in SonarLint.xml additional file for SonarLint or standalone NuGet analyzer.\n */\n\";\n        [RuleParameter(HeaderFormatRuleParameterKey, PropertyType.Text, \"Expected copyright and license header.\", HeaderFormatDefaultValue)]\n        public override string HeaderFormat { get; set; } = HeaderFormatDefaultValue;\n\n        protected override ILanguageFacade Language => CSharpFacade.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/CheckFileLicenseCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class CheckFileLicenseCodeFix : SonarCodeFix\n    {\n        internal const string Title = \"Add or update license header\";\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(CheckFileLicense.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            if (!diagnostic.Properties.Any() ||\n                !diagnostic.Properties.ContainsKey(CheckFileLicense.IsRegularExpressionPropertyKey) ||\n                !diagnostic.Properties.ContainsKey(CheckFileLicense.HeaderFormatPropertyKey))\n            {\n                return Task.CompletedTask;\n            }\n\n            if (!bool.TryParse(diagnostic.Properties[CheckFileLicense.IsRegularExpressionPropertyKey], out var b) || b)\n            {\n                return Task.CompletedTask;\n            }\n\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            var syntaxNode = root.FindNode(diagnosticSpan);\n\n            context.RegisterCodeFix(\n                Title,\n                c =>\n                {\n                    var fileHeaderTrivias = CreateFileHeaderTrivias(diagnostic.Properties[CheckFileLicense.HeaderFormatPropertyKey]);\n                    var newRoot = root.ReplaceNode(syntaxNode, syntaxNode.WithLeadingTrivia(fileHeaderTrivias));\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n\n            return Task.CompletedTask;\n        }\n\n        private static IEnumerable<SyntaxTrivia> CreateFileHeaderTrivias(string comment)\n        {\n            return new[] { SyntaxFactory.Comment(comment), SyntaxFactory.CarriageReturnLineFeed };\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ClassAndMethodName.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class ClassAndMethodName : SonarDiagnosticAnalyzer\n    {\n        private const string MethodNameDiagnosticId = \"S100\";\n        private const string TypeNameDiagnosticId = \"S101\";\n\n        private const string MessageFormat = \"Rename {0} '{1}' to match pascal case naming rules, {2}.\";\n        private const string MessageFormatNonUnderscore = \"consider using '{0}'\";\n        private const string MessageFormatUnderscore = \"trim underscores from the name\";\n\n        private static readonly DiagnosticDescriptor MethodNameRule = DescriptorFactory.Create(MethodNameDiagnosticId, MessageFormat);\n        private static readonly DiagnosticDescriptor TypeNameRule = DescriptorFactory.Create(TypeNameDiagnosticId, MessageFormat);\n\n        private static readonly ImmutableArray<KnownType> ComRelatedTypes =\n            ImmutableArray.Create(\n                KnownType.System_Runtime_InteropServices_ComImportAttribute,\n                KnownType.System_Runtime_InteropServices_InterfaceTypeAttribute);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(MethodNameRule, TypeNameRule);\n\n        internal static IEnumerable<string> SplitToParts(string name)\n        {\n            var currentWord = new StringBuilder(name.Length);\n            foreach (var c in name)\n            {\n                if (char.IsUpper(c))\n                {\n                    if (currentWord.Length > 0 && !char.IsUpper(currentWord[currentWord.Length - 1]))\n                    {\n                        yield return currentWord.ToString();\n                        currentWord.Clear();\n                    }\n\n                    currentWord.Append(c);\n                }\n                else if (char.IsLower(c))\n                {\n                    if (currentWord.Length > 1 && char.IsUpper(currentWord[currentWord.Length - 1]))\n                    {\n                        var lastChar = currentWord[currentWord.Length - 1];\n                        currentWord.Length--;\n                        yield return currentWord.ToString();\n                        currentWord.Clear();\n                        currentWord.Append(lastChar);\n                    }\n\n                    currentWord.Append(c);\n                }\n                else\n                {\n                    if (currentWord.Length > 0)\n                    {\n                        yield return currentWord.ToString();\n                        currentWord.Clear();\n                    }\n\n                    yield return c.ToString();\n                }\n            }\n\n            if (currentWord.Length > 0)\n            {\n                yield return currentWord.ToString();\n            }\n        }\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(c =>\n                {\n                    if (c.IsRedundantPositionalRecordContext())\n                    {\n                        return;\n                    }\n                    CheckTypeName(c);\n                },\n                SyntaxKind.ClassDeclaration,\n                SyntaxKind.InterfaceDeclaration,\n                SyntaxKind.StructDeclaration,\n                SyntaxKindEx.RecordDeclaration,\n                SyntaxKindEx.RecordStructDeclaration);\n\n            context.RegisterNodeAction(c =>\n                {\n                    var identifier = GetDeclarationIdentifier(c.Node);\n                    CheckMemberName(c, identifier);\n                },\n                SyntaxKind.MethodDeclaration,\n                SyntaxKind.PropertyDeclaration,\n                SyntaxKindEx.LocalFunctionStatement);\n        }\n\n        private static void CheckTypeName(SonarSyntaxNodeReportingContext context)\n        {\n            var typeDeclaration = (BaseTypeDeclarationSyntax)context.Node;\n            var identifier = typeDeclaration.Identifier;\n            var symbol = context.Model.GetDeclaredSymbol(typeDeclaration);\n\n            if (symbol.GetAttributes(ComRelatedTypes).Any())\n            {\n                return;\n            }\n\n            if (identifier.ValueText.StartsWith(\"_\", StringComparison.Ordinal)\n                || identifier.ValueText.EndsWith(\"_\", StringComparison.Ordinal))\n            {\n                context.ReportIssue(TypeNameRule, identifier, typeDeclaration.GetDeclarationTypeName(), identifier.ValueText, MessageFormatUnderscore);\n                return;\n            }\n\n            if (typeDeclaration is ClassDeclarationSyntax && IsTestClassName(typeDeclaration.Identifier.ValueText))\n            {\n                return;\n            }\n\n            if (symbol.DeclaringSyntaxReferences.Length > 1\n                && symbol.DeclaringSyntaxReferences.Any(syntax => syntax.SyntaxTree.IsConsideredGenerated(CSharpGeneratedCodeRecognizer.Instance, context.IsRazorAnalysisEnabled())))\n            {\n                return;\n            }\n\n            var isNameValid = IsTypeNameValid(identifier.ValueText,\n                                              requireInitialI: typeDeclaration is InterfaceDeclarationSyntax,\n                                              allowInitialI: typeDeclaration.Modifiers.Any(SyntaxKind.StaticKeyword),\n                                              areUnderscoresAllowed: context.IsTestProject(),\n                                              suggestion: out var suggestion);\n\n            if (!isNameValid)\n            {\n                var messageEnding = string.Format(MessageFormatNonUnderscore, suggestion);\n                context.ReportIssue(TypeNameRule, identifier, typeDeclaration.GetDeclarationTypeName(), identifier.ValueText, messageEnding);\n            }\n        }\n\n        private static void CheckMemberName(SonarSyntaxNodeReportingContext context, SyntaxToken identifier)\n        {\n            var symbol = context.Model.GetDeclaredSymbol(context.Node);\n            if (symbol == null)\n            {\n                return;\n            }\n\n            if (string.IsNullOrWhiteSpace(identifier.ValueText)\n                || symbol.ContainingType.GetAttributes(ComRelatedTypes).Any()\n                || symbol.InterfaceMembers().Any()\n                || symbol.GetOverriddenMember() != null\n                || symbol.IsExtern)\n            {\n                return;\n            }\n\n            if (identifier.ValueText.StartsWith(\"_\", StringComparison.Ordinal)\n                || identifier.ValueText.EndsWith(\"_\", StringComparison.Ordinal))\n            {\n                context.ReportIssue(MethodNameRule, identifier, context.Node.GetDeclarationTypeName(), identifier.ValueText, MessageFormatUnderscore);\n                return;\n            }\n\n            if (identifier.ValueText.Contains(\"_\"))\n            {\n                return;\n            }\n\n            if (!IsMemberNameValid(identifier.ValueText, out var suggestion))\n            {\n                var messageEnding = string.Format(MessageFormatNonUnderscore, suggestion);\n                context.ReportIssue(MethodNameRule, identifier, context.Node.GetDeclarationTypeName(), identifier.ValueText, messageEnding);\n            }\n        }\n\n        private static bool IsMemberNameValid(string identifierName, out string suggestion)\n        {\n            if (identifierName.Length == 1)\n            {\n                suggestion = identifierName.ToUpperInvariant();\n                return suggestion == identifierName;\n            }\n\n            var idealNameVariant = new StringBuilder(identifierName.Length);\n            var acceptableNameVariant = new StringBuilder(identifierName.Length);\n\n            foreach (var part in SplitToParts(identifierName))\n            {\n                idealNameVariant.Append(SuggestFixedCaseName(part, 1));\n                acceptableNameVariant.Append(SuggestFixedCaseName(part, 2));\n            }\n\n            idealNameVariant[0] = char.ToUpperInvariant(idealNameVariant[0]);\n            suggestion = SuggestCapitalLetterAfterNonLetter(idealNameVariant);\n\n            acceptableNameVariant[0] = char.ToUpperInvariant(acceptableNameVariant[0]);\n            var acceptableSuggestion = SuggestCapitalLetterAfterNonLetter(acceptableNameVariant);\n\n            return acceptableSuggestion == identifierName\n                   || suggestion == identifierName;\n        }\n\n        private static bool IsTypeNameValid(string identifierName, bool requireInitialI, bool allowInitialI, bool areUnderscoresAllowed, out string suggestion)\n        {\n            if (identifierName.Length == 1)\n            {\n                suggestion = identifierName.ToUpperInvariant();\n                return suggestion == identifierName;\n            }\n\n            var idealNameVariant = new StringBuilder(identifierName.Length);\n            var acceptableNameVariant = new StringBuilder(identifierName.Length);\n\n            var parts = SplitToParts(identifierName).ToList();\n            for (var i = 0; i < parts.Count; i++)\n            {\n                var part = parts[i];\n                if (part.Length == 1 && part[0] == '_' && !areUnderscoresAllowed)\n                {\n                    continue;\n                }\n\n                var ideal = i == 0\n                    ? HandleFirstPartOfTypeName(part, requireInitialI, allowInitialI, 1)\n                    : SuggestFixedCaseName(part, 1);\n\n                var acceptable = i == 0\n                    ? HandleFirstPartOfTypeName(part, requireInitialI, allowInitialI, 2)\n                    : SuggestFixedCaseName(part, 2);\n\n                idealNameVariant.Append(ideal);\n                acceptableNameVariant.Append(acceptable);\n            }\n\n            suggestion = SuggestCapitalLetterAfterNonLetter(idealNameVariant);\n            var acceptableSuggestion = SuggestCapitalLetterAfterNonLetter(acceptableNameVariant);\n\n            return acceptableSuggestion == identifierName\n                   || suggestion == identifierName;\n        }\n\n        private static string HandleFirstPartOfTypeName(string input, bool requireInitialI, bool allowInitialI, int maxUppercase)\n        {\n            var startsWithI = input[0] == 'I';\n\n            if (requireInitialI)\n            {\n                var prefix = startsWithI ? string.Empty : \"I\";\n                return prefix + SuggestFixedCaseName(FirstCharToUpper(input), maxUppercase + 1);\n            }\n\n            var suggestionToProcess = ShouldExcludeFirstLetter()\n                ? FirstCharToUpper(input.Substring(1))\n                : FirstCharToUpper(input);\n\n            return SuggestFixedCaseName(suggestionToProcess, maxUppercase);\n\n            bool ShouldExcludeFirstLetter() =>\n                input.Length == 1\n                && !allowInitialI\n                && startsWithI\n                && IsCharUpper(input, 0);\n        }\n\n        private static string SuggestCapitalLetterAfterNonLetter(StringBuilder suggestion)\n        {\n            for (var i = 1; i < suggestion.Length; i++)\n            {\n                if (!char.IsLetter(suggestion[i - 1])\n                    && char.IsLower(suggestion[i]))\n                {\n                    suggestion[i] = char.ToUpperInvariant(suggestion[i]);\n                }\n            }\n\n            return suggestion.ToString();\n        }\n\n        private static string SuggestFixedCaseName(string input, int maxUppercaseCount)\n        {\n            var upper = input.Take(maxUppercaseCount);\n            var lower = input.Skip(maxUppercaseCount).Select(char.ToLowerInvariant);\n\n            return new string(upper.Concat(lower).ToArray());\n        }\n\n        private static string FirstCharToUpper(string input) =>\n            input.Length > 0\n                ? char.ToUpperInvariant(input[0]) + input.Substring(1)\n                : input;\n\n        private static bool IsCharUpper(string input, int idx) =>\n            idx >= 0\n            && idx < input.Length\n            && char.IsUpper(input[idx]);\n\n        private static SyntaxToken GetDeclarationIdentifier(SyntaxNode declaration) =>\n            declaration.Kind() switch\n            {\n                SyntaxKind.MethodDeclaration => ((MethodDeclarationSyntax)declaration).Identifier,\n                SyntaxKind.PropertyDeclaration => ((PropertyDeclarationSyntax)declaration).Identifier,\n                SyntaxKindEx.LocalFunctionStatement => ((LocalFunctionStatementSyntaxWrapper)declaration).Identifier,\n                _ => throw new InvalidOperationException(\"Method can only be called on known registered syntax kinds\")\n            };\n\n        private static bool IsTestClassName(string className) =>\n            className != \"ITest\"\n            && className != \"ITests\"\n            && (className.EndsWith(\"Test\") || className.EndsWith(\"Tests\"));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ClassNamedException.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ClassNamedException : ClassNamedExceptionBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ClassNotInstantiatable.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class ClassNotInstantiatable : ClassNotInstantiatableBase<BaseTypeDeclarationSyntax, SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n        protected override IEnumerable<ConstructorContext> CollectRemovableDeclarations(INamedTypeSymbol namedType, Compilation compilation, string messageArg)\n        {\n            var typeDeclarations = new CSharpRemovableDeclarationCollector(namedType, compilation).TypeDeclarations;\n\n            return typeDeclarations.Select(x => new ConstructorContext(x, Diagnostic.Create(Rule, x.Node.Identifier.GetLocation(), x.Node.GetDeclarationTypeName(), messageArg)));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ClassShouldNotBeEmpty.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ClassShouldNotBeEmpty : ClassShouldNotBeEmptyBase<SyntaxKind, BaseTypeDeclarationSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override bool IsEmptyAndNotPartial(SyntaxNode node) =>\n        node is TypeDeclarationSyntax { Members.Count: 0 } typeDeclaration\n        && !typeDeclaration.Modifiers.Any(x => x.IsKind(SyntaxKind.PartialKeyword))\n        && LacksParameterizedPrimaryConstructor(node);\n\n    protected override BaseTypeDeclarationSyntax GetIfHasDeclaredBaseClassOrInterface(SyntaxNode node) =>\n        node is TypeDeclarationSyntax { BaseList: not null } declaration\n            ? declaration\n            : null;\n\n    // Unlike in VB.NET there's no way to know for certain - by only looking at the syntax tree - from the declared types whether they are classes or interfaces.\n    // Unless the class has more than one base type, because then one of them has to be an interface, as there can't be more than one base class.\n    protected override bool HasInterfaceOrGenericBaseClass(BaseTypeDeclarationSyntax declaration) =>\n        declaration.BaseList.Types.Count > 1                                 // implements at least one interface\n        || declaration.BaseList.Types.Any(x => x.Type is GenericNameSyntax); // or a generic class/interface\n\n    protected override bool HasAnyAttribute(SyntaxNode node) =>\n        node is TypeDeclarationSyntax { AttributeLists.Count: > 0 };\n\n    protected override string DeclarationTypeKeyword(SyntaxNode node) =>\n        ((TypeDeclarationSyntax)node).Keyword.ValueText;\n\n    protected override bool HasConditionalCompilationDirectives(SyntaxNode node) =>\n        node.DescendantNodes(descendIntoTrivia: true)\n        .Any(x => x.Kind() is\n            SyntaxKind.IfDirectiveTrivia or\n            SyntaxKind.ElifDirectiveTrivia or\n            SyntaxKind.ElseDirectiveTrivia or\n            SyntaxKind.EndIfDirectiveTrivia);\n\n    private static bool LacksParameterizedPrimaryConstructor(SyntaxNode node) =>\n        IsParameterlessClass(node)\n        || IsParameterlessRecord(node);\n\n    private static bool IsParameterlessClass(SyntaxNode node) =>\n        node is ClassDeclarationSyntax declaration\n        && LacksParameters(declaration.ParameterList(), declaration.BaseList);\n\n    private static bool IsParameterlessRecord(SyntaxNode node) =>\n        RecordDeclarationSyntax(node) is { } declaration\n        && LacksParameters(declaration.ParameterList, declaration.BaseList);\n\n    private static bool LacksParameters(ParameterListSyntax parameterList, BaseListSyntax baseList) =>\n        parameterList?.Parameters is not { Count: > 0 }\n        && BaseTypeSyntax(baseList) is not { ArgumentList.Arguments.Count: > 0 };\n\n    private static RecordDeclarationSyntaxWrapper? RecordDeclarationSyntax(SyntaxNode node) =>\n        RecordDeclarationSyntaxWrapper.IsInstance(node)\n            ? (RecordDeclarationSyntaxWrapper)node\n            : null;\n\n    private static PrimaryConstructorBaseTypeSyntaxWrapper? BaseTypeSyntax(BaseListSyntax list) =>\n       list?.Types.FirstOrDefault() is { } type\n       && PrimaryConstructorBaseTypeSyntaxWrapper.IsInstance(type)\n           ? (PrimaryConstructorBaseTypeSyntaxWrapper)type\n           : null;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ClassWithEqualityShouldImplementIEquatable.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class ClassWithEqualityShouldImplementIEquatable : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S3897\";\n        private const string MessageFormat = \"Implement 'IEquatable<{0}>'.\";\n        private const string EqualsMethodName = nameof(object.Equals);\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var classDeclaration = (ClassDeclarationSyntax)c.Node;\n                    var classSymbol = c.Model.GetDeclaredSymbol(classDeclaration);\n                    if (classSymbol == null ||\n                        ImplementsIEquatableInterface(classSymbol) ||\n                        classDeclaration.Identifier.IsMissing)\n                    {\n                        return;\n                    }\n\n                    classSymbol.GetMembers(EqualsMethodName)\n                        .OfType<IMethodSymbol>()\n                        .Where(IsIEquatableEqualsMethodCandidate)\n                        .ToList()\n                        .ForEach(ms => c.ReportIssue(rule, classDeclaration.Identifier, ms.Parameters[0].Type.Name));\n                }, SyntaxKind.ClassDeclaration);\n        }\n\n        private bool ImplementsIEquatableInterface(ITypeSymbol classSymbol) =>\n            classSymbol.AllInterfaces.Any(@interface =>\n              @interface.ConstructedFrom.Is(KnownType.System_IEquatable_T) &&\n              @interface.TypeArguments.Length == 1 &&\n              @interface.TypeArguments[0].Equals(classSymbol));\n\n        private static bool IsIEquatableEqualsMethodCandidate(IMethodSymbol methodSymbol)\n        {\n            return methodSymbol.MethodKind == MethodKind.Ordinary &&\n                methodSymbol.Name == EqualsMethodName &&\n                !methodSymbol.IsOverride &&\n                methodSymbol.DeclaredAccessibility == Accessibility.Public &&\n                methodSymbol.ReturnType.Is(KnownType.System_Boolean) &&\n                methodSymbol.Parameters.Length == 1 &&\n                methodSymbol.Parameters[0].Type.Equals(methodSymbol.ContainingType);\n\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ClassWithOnlyStaticMember.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class ClassWithOnlyStaticMember : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S1118\";\n        private const string MessageFormat = \"{0}\";\n        private const string MessageFormatConstructor = \"Hide this public constructor by making it '{0}'.\";\n        private const string MessageFormatPrimaryConstructor = \"Remove this primary constructor.\";\n        private const string MessageFormatStaticClass = \"Add a '{0}' constructor or the 'static' keyword to the class declaration.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        private static readonly ISet<Accessibility> ProblematicConstructorAccessibility = new HashSet<Accessibility>\n        {\n            Accessibility.Public,\n            Accessibility.Internal\n        };\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterSymbolAction(\n                c =>\n                {\n                    var namedType = c.Symbol as INamedTypeSymbol;\n                    if (!namedType.IsClass())\n                    {\n                        return;\n                    }\n\n                    CheckClasses(c, namedType);\n                    CheckConstructors(c, namedType);\n                },\n                SymbolKind.NamedType);\n\n        private static void CheckClasses(SonarSymbolReportingContext context, INamedTypeSymbol utilityClass)\n        {\n            if (!ClassIsRelevant(utilityClass))\n            {\n                return;\n            }\n\n            var reportMessage = string.Format(MessageFormatStaticClass, utilityClass.IsSealed ? SyntaxConstants.Private : SyntaxConstants.Protected);\n\n            foreach (var syntaxReference in utilityClass.DeclaringSyntaxReferences)\n            {\n                if (syntaxReference.GetSyntax() is ClassDeclarationSyntax classDeclarationSyntax)\n                {\n                    context.ReportIssue(Rule, classDeclarationSyntax.Identifier, reportMessage);\n                }\n            }\n        }\n\n        private static void CheckConstructors(SonarSymbolReportingContext context, INamedTypeSymbol utilityClass)\n        {\n            if (!ClassQualifiesForIssue(utilityClass) || !HasMembersAndAllAreStaticExceptConstructors(utilityClass))\n            {\n                return;\n            }\n\n            foreach (var constructor in utilityClass.GetMembers()\n                                                    .Where(IsConstructor)\n                                                    .Where(symbol => ProblematicConstructorAccessibility.Contains(symbol.DeclaredAccessibility)))\n            {\n                var syntaxReferences = constructor.DeclaringSyntaxReferences;\n                foreach (var syntaxReference in syntaxReferences)\n                {\n                    switch (syntaxReference.GetSyntax())\n                    {\n                        case ConstructorDeclarationSyntax constructorDeclaration:\n                            var reportMessage = string.Format(MessageFormatConstructor, utilityClass.IsSealed ? SyntaxConstants.Private : SyntaxConstants.Protected);\n                            context.ReportIssue(Rule, constructorDeclaration.Identifier, reportMessage);\n                            break;\n                        case ClassDeclarationSyntax classDeclaration when classDeclaration.ParameterList() is { Parameters.Count: 0 }:\n                            context.ReportIssue(Rule, classDeclaration.Identifier, MessageFormatPrimaryConstructor);\n                            break;\n                        default:\n                            break;\n                    }\n                }\n            }\n        }\n\n        private static bool ClassIsRelevant(INamedTypeSymbol @class) =>\n            ClassQualifiesForIssue(@class)\n            && HasOnlyQualifyingMembers(@class, @class.GetMembers().Where(member => !member.IsImplicitlyDeclared).ToList());\n\n        private static bool ClassQualifiesForIssue(INamedTypeSymbol @class) =>\n            !@class.IsStatic\n            && !@class.IsAbstract\n            && !@class.AllInterfaces.Any()\n            && @class.BaseType.Is(KnownType.System_Object);\n\n        private static bool HasOnlyQualifyingMembers(INamedTypeSymbol @class, IList<ISymbol> members) =>\n            members.Any()\n            && members.All(member => member.IsStatic)\n            && !ClassUsedAsInstanceInMembers(@class, members);\n\n        private static bool ClassUsedAsInstanceInMembers(INamedTypeSymbol @class, IList<ISymbol> members) =>\n            members.OfType<IMethodSymbol>().Any(member => @class.Equals(member.ReturnType) || member.Parameters.Any(parameter => @class.Equals(parameter.Type)))\n            || members.OfType<IPropertySymbol>().Any(member => @class.Equals(member.Type))\n            || members.OfType<IFieldSymbol>().Any(member => @class.Equals(member.Type));\n\n        private static bool HasMembersAndAllAreStaticExceptConstructors(INamedTypeSymbol @class)\n        {\n            var membersExceptConstructors = @class.GetMembers()\n                .Where(member => !IsConstructor(member))\n                .ToList();\n\n            return HasOnlyQualifyingMembers(@class, membersExceptConstructors);\n        }\n\n        private static bool IsConstructor(ISymbol member) =>\n            member is IMethodSymbol { MethodKind: MethodKind.Constructor, IsImplicitlyDeclared: false };\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/CloudNative/AzureFunctionsCatchExceptions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class AzureFunctionsCatchExceptions : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S6421\";\n        private const string MessageFormat = \"Wrap Azure Function body in try/catch block.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n                {\n                    if (c.IsAzureFunction())\n                    {\n                        var method = (MethodDeclarationSyntax)c.Node;\n                        var walker = new Walker(c.Model);\n                        if (walker.SafeVisit(method.GetBodyOrExpressionBody()) && walker.HasInvocationOutsideTryCatch)\n                        {\n                            c.ReportIssue(Rule, method.Identifier);\n                        }\n                    }\n                },\n                SyntaxKind.MethodDeclaration);\n\n        private sealed class Walker : SafeCSharpSyntaxWalker\n        {\n            private readonly SemanticModel semanticModel;\n\n            public Walker(SemanticModel semanticModel) =>\n                this.semanticModel = semanticModel;\n\n            public bool HasInvocationOutsideTryCatch { get; private set; }\n\n            public override void Visit(SyntaxNode node)\n            {\n                if (!HasInvocationOutsideTryCatch   // Stop walking when we know the answer\n                    && !(node.Kind() is\n                        SyntaxKind.CatchClause or   // Do not visit content of \"catch\". It doesn't make sense to wrap logging in catch in another try/catch.\n                        SyntaxKind.AnonymousMethodExpression or\n                        SyntaxKind.SimpleLambdaExpression or\n                        SyntaxKind.ParenthesizedLambdaExpression or\n                        SyntaxKindEx.LocalFunctionStatement))\n                {\n                    base.Visit(node);\n                }\n            }\n\n            public override void VisitInvocationExpression(InvocationExpressionSyntax node)\n            {\n                if (!node.IsNameof(semanticModel))\n                {\n                    HasInvocationOutsideTryCatch = true;\n                }\n            }\n\n            public override void VisitTryStatement(TryStatementSyntax node)\n            {\n                if (!node.Catches.Any(CatchesAllExceptions))\n                {\n                    base.VisitTryStatement(node);\n                }\n            }\n\n            private static bool CatchesAllExceptions(CatchClauseSyntax catchClause) =>\n                catchClause.Declaration is null\n                || (catchClause.Declaration.Type.NameIs(nameof(Exception)) && catchClause.Filter is null);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/CloudNative/AzureFunctionsLogFailures.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class AzureFunctionsLogFailures : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S6423\";\n        private const string MessageFormat = \"Log exception via ILogger with LogLevel Information, Warning, Error, or Critical.\";\n\n        private static readonly int[] InvalidLogLevel =\n        {\n            0, // Trace\n            1, // Debug\n            6, // None\n        };\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n            {\n                var catchClause = (CatchClauseSyntax)c.Node;\n                if (c.AzureFunctionMethod() is { } entryPoint\n                    && HasLoggerInScope(entryPoint))\n                {\n                    var walker = new LoggerCallWalker(c.Model, c.Cancel);\n                    walker.SafeVisit(catchClause.Block);\n                    // Exception handling in the filter clause preserves log scopes and is therefore recommended\n                    // See https://blog.stephencleary.com/2020/06/a-new-pattern-for-exception-logging.html\n                    walker.SafeVisit(catchClause.Filter?.FilterExpression);\n                    if (!walker.HasValidLoggerCall)\n                    {\n                        c.ReportIssue(Rule, catchClause.CatchKeyword.GetLocation(), walker.InvalidLoggerInvocationLocations);\n                    }\n                }\n            },\n            SyntaxKind.CatchClause);\n\n        private static bool HasLoggerInScope(IMethodSymbol entryPoint) =>\n            entryPoint.Parameters.Any(x => x.Type.DerivesOrImplements(KnownType.Microsoft_Extensions_Logging_ILogger))\n                // Instance method entry points might have access to an ILogger via injected fields/properties\n                // https://docs.microsoft.com/en-us/azure/azure-functions/functions-dotnet-dependency-injection\n                || (entryPoint is { IsStatic: false, ContainingType: { } container }\n                    && HasLoggerMember(container));\n\n        internal static bool HasLoggerMember(ITypeSymbol typeSymbol)\n        {\n            var isOriginalType = true;\n            foreach (var type in typeSymbol.GetSelfAndBaseTypes())\n            {\n                if (type.GetMembers().Any(x => x.Kind is SymbolKind.Field or SymbolKind.Property\n                                               && (isOriginalType || x.GetEffectiveAccessibility() != Accessibility.Private)\n                                               && x.GetSymbolType()?.DerivesOrImplements(KnownType.Microsoft_Extensions_Logging_ILogger) is true))\n                {\n                    return true;\n                }\n                isOriginalType = false;\n            }\n            return false;\n        }\n\n        private sealed class LoggerCallWalker : SafeCSharpSyntaxWalker\n        {\n            private readonly SemanticModel model;\n            private readonly CancellationToken cancel;\n            private List<SecondaryLocation> invalidInvocations;\n\n            public bool HasValidLoggerCall { get; private set; }\n            public IEnumerable<SecondaryLocation> InvalidLoggerInvocationLocations => invalidInvocations ?? [];\n\n            public LoggerCallWalker(SemanticModel model, CancellationToken cancel)\n            {\n                this.model = model;\n                this.cancel = cancel;\n            }\n\n            public override void Visit(SyntaxNode node)\n            {\n                if (!HasValidLoggerCall)\n                {\n                    cancel.ThrowIfCancellationRequested();\n                    base.Visit(node);\n                }\n            }\n\n            public override void VisitInvocationExpression(InvocationExpressionSyntax node)\n            {\n                if (model.GetSymbolInfo(node, cancel).Symbol is IMethodSymbol { ReceiverType: { } receiver } methodSymbol\n                    && receiver.DerivesOrImplements(KnownType.Microsoft_Extensions_Logging_ILogger))\n                {\n                    if (IsValidLogCall(node, methodSymbol))\n                    {\n                        HasValidLoggerCall = true;\n                    }\n                    else\n                    {\n                        invalidInvocations ??= new();\n                        invalidInvocations.Add(node.ToSecondaryLocation());\n                    }\n                }\n                base.VisitInvocationExpression(node);\n            }\n\n            public override void VisitArgument(ArgumentSyntax node)\n            {\n                HasValidLoggerCall = HasValidLoggerCall || model.GetTypeInfo(node.Expression, cancel).Type?.DerivesOrImplements(KnownType.Microsoft_Extensions_Logging_ILogger) is true;\n                base.VisitArgument(node);\n            }\n\n            private bool IsValidLogCall(InvocationExpressionSyntax invocation, IMethodSymbol methodSymbol) =>\n                methodSymbol switch\n                {\n                    // Wellknown LoggerExtensions methods invocations\n                    { IsExtensionMethod: true } when methodSymbol.ContainingType.Is(KnownType.Microsoft_Extensions_Logging_LoggerExtensions) =>\n                        methodSymbol.Name switch\n                        {\n                            \"LogInformation\" or \"LogWarning\" or \"LogError\" or \"LogCritical\" => true,\n                            \"Log\" => IsPassingValidLogLevel(invocation, methodSymbol),\n                            \"LogTrace\" or \"LogDebug\" or \"BeginScope\" => false,\n                            _ => true, // Some unknown extension method on LoggerExtensions was called. Avoid FPs and assume it logs something.\n                        },\n                    { IsExtensionMethod: true } => true, // Any other extension method is assumed to log something to avoid FP.\n                    _ => // Instance invocations on an ILogger instance.\n                        methodSymbol.Name switch\n                        {\n                            \"Log\" => IsPassingValidLogLevel(invocation, methodSymbol),\n                            \"IsEnabled\" or \"BeginScope\" => false,\n                            _ => true, // Some unknown method on an ILogger was called. Avoid FPs and assume it logs something.\n                        },\n                };\n\n            private bool IsPassingValidLogLevel(InvocationExpressionSyntax invocation, IMethodSymbol symbol) =>\n                symbol.Parameters.FirstOrDefault(x => x.Name == \"logLevel\") is { } logLevelParameter\n                && new CSharpMethodParameterLookup(invocation, symbol).TryGetNonParamsSyntax(logLevelParameter, out var argumentSyntax)\n                && argumentSyntax.FindConstantValue(model) is int logLevel\n                    ? !InvalidLogLevel.Contains(logLevel)\n                    : true; // Compliant: Some non-constant value is passed as loglevel or there is no logLevel parameter\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/CloudNative/AzureFunctionsReuseClients.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class AzureFunctionsReuseClients : ReuseClientBase\n    {\n        private const string DiagnosticId = \"S6420\";\n        private const string MessageFormat = \"Reuse client instances rather than creating new ones with each function invocation.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n        protected override ImmutableArray<KnownType> ReusableClients => ImmutableArray.Create(\n                KnownType.System_Net_Http_HttpClient,\n                // ComosDb (DocumentClient is superseded by CosmosClient)\n                KnownType.Microsoft_Azure_Documents_Client_DocumentClient,\n                KnownType.Microsoft_Azure_Cosmos_CosmosClient,\n                // Servicebus V5\n                KnownType.Microsoft_Azure_ServiceBus_Management_ManagementClient,\n                KnownType.Microsoft_Azure_ServiceBus_QueueClient,\n                KnownType.Microsoft_Azure_ServiceBus_SessionClient,\n                KnownType.Microsoft_Azure_ServiceBus_SubscriptionClient,\n                KnownType.Microsoft_Azure_ServiceBus_TopicClient,\n                // Servicebus V7\n                KnownType.Azure_Messaging_ServiceBus_ServiceBusClient,\n                KnownType.Azure_Messaging_ServiceBus_Administration_ServiceBusAdministrationClient,\n                // Storage\n                KnownType.Azure_Storage_Blobs_BlobServiceClient,\n                KnownType.Azure_Storage_Queues_QueueServiceClient,\n                KnownType.Azure_Storage_Files_Shares_ShareServiceClient,\n                KnownType.Azure_Storage_Files_DataLake_DataLakeServiceClient,\n                // Resource manager\n                KnownType.Azure_ResourceManager_ArmClient);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n            {\n                if (c.AzureFunctionMethod() is not null\n                    && IsReusableClient(c)\n                    && !IsAssignedForReuse(c))\n                {\n                    c.ReportIssue(Rule, c.Node);\n                }\n            },\n            SyntaxKind.ObjectCreationExpression, SyntaxKindEx.ImplicitObjectCreationExpression);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/CloudNative/AzureFunctionsStateless.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class AzureFunctionsStateless : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S6419\";\n        private const string MessageFormat = \"Do not modify a static state from Azure Function.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c => CheckTarget(c, ((AssignmentExpressionSyntax)c.Node).Left),\n                SyntaxKind.SimpleAssignmentExpression,\n                SyntaxKind.AddAssignmentExpression,\n                SyntaxKind.SubtractAssignmentExpression,\n                SyntaxKind.MultiplyAssignmentExpression,\n                SyntaxKind.DivideAssignmentExpression,\n                SyntaxKind.ModuloAssignmentExpression,\n                SyntaxKind.AndAssignmentExpression,\n                SyntaxKind.ExclusiveOrAssignmentExpression,\n                SyntaxKind.OrAssignmentExpression,\n                SyntaxKind.LeftShiftAssignmentExpression,\n                SyntaxKind.RightShiftAssignmentExpression,\n                SyntaxKindEx.CoalesceAssignmentExpression,\n                SyntaxKindEx.UnsignedRightShiftAssignmentExpression);\n\n            context.RegisterNodeAction(\n                c => CheckTarget(c, ((PrefixUnaryExpressionSyntax)c.Node).Operand),\n                SyntaxKind.PreDecrementExpression,\n                SyntaxKind.PreIncrementExpression);\n\n            context.RegisterNodeAction(\n                c => CheckTarget(c, ((PostfixUnaryExpressionSyntax)c.Node).Operand),\n                SyntaxKind.PostDecrementExpression,\n                SyntaxKind.PostIncrementExpression);\n\n            context.RegisterNodeAction(c =>\n                {\n                    var argument = (ArgumentSyntax)c.Node;\n                    if (argument.RefOrOutKeyword != default)\n                    {\n                        CheckTarget(c, argument.Expression);\n                    }\n                },\n                SyntaxKind.Argument);\n        }\n\n        private static void CheckTarget(SonarSyntaxNodeReportingContext context, ExpressionSyntax target)\n        {\n            if (context.IsAzureFunction()\n                && context.Model.GetSymbolInfo((target as ElementAccessExpressionSyntax)?.Expression ?? target).Symbol is { } symbol\n                && symbol.IsStatic)\n            {\n                context.ReportIssue(Rule, target);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/CloudNative/DurableEntityInterfaceRestrictions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class DurableEntityInterfaceRestrictions : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S6424\";\n        private const string MessageFormat = \"Use valid entity interface. {0} {1}.\";\n        private const string SignalEntityName = \"SignalEntity\";\n        private const string SignalEntityAsyncName = \"SignalEntityAsync\";\n        private const string CreateEntityProxyName = \"CreateEntityProxy\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n                {\n                    var name = (GenericNameSyntax)c.Node;\n                    if (name.Identifier.ValueText is SignalEntityName or SignalEntityAsyncName or CreateEntityProxyName\n                        && name.TypeArgumentList.Arguments.Count == 1\n                        && c.Model.GetSymbolInfo(name).Symbol is IMethodSymbol method\n                        && IsRestrictedMethod(method)\n                        && method.TypeArguments.Single() is INamedTypeSymbol { TypeKind: not TypeKind.Error } entityInterface\n                        && InterfaceErrorMessage(entityInterface) is { } message)\n                    {\n                        c.ReportIssue(Rule, name, entityInterface.Name, message);\n                    }\n                },\n                SyntaxKind.GenericName);\n\n        private static bool IsRestrictedMethod(IMethodSymbol method) =>\n            method.Is(KnownType.Microsoft_Azure_WebJobs_Extensions_DurableTask_IDurableEntityContext, SignalEntityName)\n            || method.Is(KnownType.Microsoft_Azure_WebJobs_Extensions_DurableTask_IDurableEntityClient, SignalEntityAsyncName)\n            || method.Is(KnownType.Microsoft_Azure_WebJobs_Extensions_DurableTask_IDurableOrchestrationContext, CreateEntityProxyName);\n\n        private static string InterfaceErrorMessage(INamedTypeSymbol entityInterface)\n        {\n            if (entityInterface.TypeKind != TypeKind.Interface)\n            {\n                return \"is not an interface\";\n            }\n            else if (entityInterface.IsGenericType)\n            {\n                return \"is generic\";\n            }\n            else\n            {\n                var members = new[] { entityInterface }.Concat(entityInterface.AllInterfaces).SelectMany(x => x.GetMembers()).ToArray();\n                return members.Any()\n                    ? members.Select(MemberErrorMessage).WhereNotNull().FirstOrDefault()\n                    : \"is empty\";\n            }\n        }\n\n        private static string MemberErrorMessage(ISymbol member)\n        {\n            if (member is not IMethodSymbol method)\n            {\n                return $@\"contains {member.Kind.ToString().ToLower()} \"\"{member.Name}\"\". Only methods are allowed\";\n            }\n            else if (method.IsGenericMethod)\n            {\n                return $@\"contains generic method \"\"{method.Name}\"\"\";\n            }\n            else if (method.Parameters.Length > 1)\n            {\n                return $@\"contains method \"\"{method.Name}\"\" with {method.Parameters.Length} parameters. Zero or one are allowed\";\n            }\n            else if (!(method.ReturnsVoid\n                || method.ReturnType.Is(KnownType.System_Threading_Tasks_Task)\n                || method.ReturnType.Is(KnownType.System_Threading_Tasks_Task_T)))\n            {\n                return $@\"contains method \"\"{method.Name}\"\" with invalid return type. Only \"\"void\"\", \"\"Task\"\" and \"\"Task<T>\"\" are allowed\";\n            }\n            else\n            {\n                return null;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/CognitiveComplexity.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Text;\nusing SonarAnalyzer.CSharp.Metrics;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class CognitiveComplexity : CognitiveComplexityBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n        protected override void Initialize(SonarParametrizedAnalysisContext context)\n        {\n            context.RegisterNodeAction(c =>\n                {\n                    if (c.IsTopLevelMain)\n                    {\n                        CheckComplexity<CompilationUnitSyntax>(\n                            c,\n                            compilationUnit => compilationUnit,\n                            _ => Location.Create(c.Node.SyntaxTree, TextSpan.FromBounds(0, 0)),\n                            node => CSharpCognitiveComplexityMetric.GetComplexity(node, true),\n                            \"top-level file\",\n                            Threshold);\n                    }\n                },\n                SyntaxKind.CompilationUnit);\n\n            context.RegisterNodeAction(\n                c => CheckComplexity<MethodDeclarationSyntax>(\n                    c,\n                    m => m,\n                    m => m.Identifier.GetLocation(),\n                    CSharpCognitiveComplexityMetric.GetComplexity,\n                    \"method\",\n                    Threshold),\n                SyntaxKind.MethodDeclaration);\n\n            // Here, we only care about arrowed properties, others will be handled by the accessor.\n            context.RegisterNodeAction(\n                c => CheckComplexity<PropertyDeclarationSyntax>(\n                    c,\n                    p => p.ExpressionBody,\n                    p => p.Identifier.GetLocation(),\n                    CSharpCognitiveComplexityMetric.GetComplexity,\n                    \"property\",\n                    PropertyThreshold),\n                SyntaxKind.PropertyDeclaration);\n\n            context.RegisterNodeAction(\n                c => CheckComplexity<ConstructorDeclarationSyntax>(\n                    c,\n                    co => co,\n                    co => co.Identifier.GetLocation(),\n                    CSharpCognitiveComplexityMetric.GetComplexity,\n                    \"constructor\",\n                    Threshold),\n                SyntaxKind.ConstructorDeclaration);\n\n            context.RegisterNodeAction(\n                c => CheckComplexity<DestructorDeclarationSyntax>(\n                    c,\n                    d => d,\n                    d => d.Identifier.GetLocation(),\n                    CSharpCognitiveComplexityMetric.GetComplexity,\n                    \"destructor\",\n                    Threshold),\n                SyntaxKind.DestructorDeclaration);\n\n            context.RegisterNodeAction(\n                c => CheckComplexity<OperatorDeclarationSyntax>(\n                    c,\n                    o => o,\n                    o => o.OperatorToken.GetLocation(),\n                    CSharpCognitiveComplexityMetric.GetComplexity,\n                    \"operator\",\n                    Threshold),\n                SyntaxKind.OperatorDeclaration);\n\n            context.RegisterNodeAction(\n                c => CheckComplexity<AccessorDeclarationSyntax>(\n                    c,\n                    a => a,\n                    a => a.Keyword.GetLocation(),\n                    CSharpCognitiveComplexityMetric.GetComplexity,\n                    \"accessor\",\n                    PropertyThreshold),\n                SyntaxKind.GetAccessorDeclaration,\n                SyntaxKind.SetAccessorDeclaration,\n                SyntaxKindEx.InitAccessorDeclaration,\n                SyntaxKind.AddAccessorDeclaration,\n                SyntaxKind.RemoveAccessorDeclaration);\n\n            context.RegisterNodeAction(\n               c => CheckComplexity<FieldDeclarationSyntax>(\n                   c,\n                   f => f,\n                   f => f.Declaration.Variables[0].Identifier.GetLocation(),\n                   CSharpCognitiveComplexityMetric.GetComplexity,\n                   \"field\",\n                   Threshold),\n               SyntaxKind.FieldDeclaration);\n\n            context.RegisterNodeAction(c =>\n            {\n                if (((LocalFunctionStatementSyntaxWrapper)c.Node).Modifiers.Any(SyntaxKind.StaticKeyword))\n                {\n                   CheckComplexity<SyntaxNode>(\n                       c,\n                       m => m,\n                       m => ((LocalFunctionStatementSyntaxWrapper)m).Identifier.GetLocation(),\n                       CSharpCognitiveComplexityMetric.GetComplexity,\n                       \"static local function\",\n                       Threshold);\n                }\n            },\n            SyntaxKindEx.LocalFunctionStatement);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/CollectionEmptinessChecking.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class CollectionEmptinessChecking : CollectionEmptinessCheckingBase<SyntaxKind>\n    {\n        protected override string MessageFormat => \"Use '.Any()' to test whether this 'IEnumerable<{0}>' is empty or not.\";\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/CollectionEmptinessCheckingCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Formatting;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class CollectionEmptinessCheckingCodeFix : SonarCodeFix\n    {\n        private const string Title = \"Use Any() instead\";\n\n        private readonly CSharpFacade language = CSharpFacade.Instance;\n\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(CollectionEmptinessChecking.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            if (root.FindNode(context.Diagnostics.First().Location.SourceSpan)?.FirstAncestorOrSelf<BinaryExpressionSyntax>() is { } binary)\n            {\n                var binaryLeft = binary.Left;\n                var binaryRight = binary.Right;\n\n                if (language.ExpressionNumericConverter.ConstantIntValue(binaryLeft) is { } left)\n                {\n                    Simplify(root, binary, binaryRight, language.Syntax.ComparisonKind(binary).Mirror().Compare(left), context);\n                }\n                else if (language.ExpressionNumericConverter.ConstantIntValue(binaryRight) is { } right)\n                {\n                    Simplify(root, binary, binaryLeft, language.Syntax.ComparisonKind(binary).Compare(right), context);\n                }\n            }\n            return Task.CompletedTask;\n        }\n\n        private static void Simplify(SyntaxNode root, ExpressionSyntax expression, ExpressionSyntax countExpression, CountComparisonResult comparisonResult, SonarCodeFixContext context) =>\n            context.RegisterCodeFix(\n                Title,\n                _ => Replacement(root, expression, (InvocationExpressionSyntax)countExpression, comparisonResult, context),\n                context.Diagnostics);\n\n        private static Task<Document> Replacement(SyntaxNode root, ExpressionSyntax expression, InvocationExpressionSyntax count, CountComparisonResult comparison, SonarCodeFixContext context)\n        {\n            var any = IsExtension(count)\n                ? AnyFromExtension(count)\n                : AnyFromStaticMethod(count);\n\n            SyntaxNode replacement = comparison == CountComparisonResult.Empty\n                ? SyntaxFactory.PrefixUnaryExpression(SyntaxKind.LogicalNotExpression, any)\n                : any;\n\n            return Task.FromResult(context.Document.WithSyntaxRoot(root.ReplaceNode(expression, replacement).WithAdditionalAnnotations(Formatter.Annotation)));\n        }\n\n        private static InvocationExpressionSyntax AnyFromExtension(InvocationExpressionSyntax count)\n        {\n            var memberAccess = (MemberAccessExpressionSyntax)count.Expression;\n            var name = memberAccess.WithName(SyntaxFactory.IdentifierName(nameof(Enumerable.Any)));\n            return SyntaxFactory.InvocationExpression(name, count.ArgumentList);\n        }\n\n        private static InvocationExpressionSyntax AnyFromStaticMethod(InvocationExpressionSyntax count)\n        {\n            var expression = count.ArgumentList.Arguments[0].Expression;\n            var name = SyntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, expression, SyntaxFactory.IdentifierName(nameof(Enumerable.Any)));\n            var arguments = SyntaxFactory.ArgumentList(count.ArgumentList.Arguments.RemoveAt(0));\n            return SyntaxFactory.InvocationExpression(name, arguments);\n        }\n\n        private static bool IsExtension(InvocationExpressionSyntax count) =>\n            !count.ArgumentList.Arguments.Any()\n            || !((MemberAccessExpressionSyntax)count.Expression).Expression.NameIs(nameof(Enumerable));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/CollectionPropertiesShouldBeReadOnly.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class CollectionPropertiesShouldBeReadOnly : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S4004\";\n        private const string MessageFormat = \"Make the '{0}' property read-only by removing the property setter or making it private.\";\n\n        private static readonly ImmutableArray<KnownType> CollectionTypes =\n            ImmutableArray.Create(\n                KnownType.System_Collections_Generic_ICollection_T,\n                KnownType.System_Collections_ICollection);\n\n        private static readonly ImmutableArray<KnownType> IgnoredCollectionTypes =\n            ImmutableArray.Create(\n                KnownType.System_Array,\n                KnownType.System_Security_PermissionSet);\n\n        private static readonly ISet<Accessibility> PrivateOrInternalAccessibility = new HashSet<Accessibility>\n        {\n            Accessibility.Private,\n            Accessibility.Internal,\n        };\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var propertyDeclaration = (PropertyDeclarationSyntax)c.Node;\n                    var propertySymbol = c.Model.GetDeclaredSymbol(propertyDeclaration);\n\n                    if (propertyDeclaration.AccessorList != null\n                        && !propertyDeclaration.AccessorList.Accessors.AnyOfKind(SyntaxKindEx.InitAccessorDeclaration)\n                        && propertySymbol != null\n                        && HasPublicSetter(propertySymbol)\n                        && IsObservedCollectionType(propertySymbol))\n                    {\n                        c.ReportIssue(Rule, propertyDeclaration.Identifier, propertySymbol.Name);\n                    }\n                },\n                SyntaxKind.PropertyDeclaration);\n\n        private static bool IsObservedCollectionType(IPropertySymbol propertySymbol) =>\n            !propertySymbol.IsOverride\n            && !propertySymbol.HasAttribute(KnownType.System_Runtime_Serialization_DataMemberAttribute)\n            && !propertySymbol.HasAttribute(KnownType.Microsoft_AspNetCore_Components_ParameterAttribute)\n            && !propertySymbol.ContainingType.HasAttribute(KnownType.System_SerializableAttribute)\n            && propertySymbol.Type.OriginalDefinition.DerivesOrImplementsAny(CollectionTypes)\n            && !propertySymbol.Type.OriginalDefinition.DerivesOrImplementsAny(IgnoredCollectionTypes)\n            && !IsInterfaceImplementation(propertySymbol);\n\n        private static bool HasPublicSetter(IPropertySymbol propertySymbol) =>\n            propertySymbol.SetMethod != null\n            && !PrivateOrInternalAccessibility.Contains(propertySymbol.GetEffectiveAccessibility())\n            && !PrivateOrInternalAccessibility.Contains(propertySymbol.SetMethod.DeclaredAccessibility);\n\n        private static bool IsInterfaceImplementation(IPropertySymbol propertySymbol)\n        {\n            foreach (var @interface in propertySymbol.ContainingType.Interfaces)\n            {\n                if (@interface.GetMembers()\n                              .OfType<IPropertySymbol>()\n                              .Where(x => x.Name == propertySymbol.Name)\n                              .Any(x => Equals(propertySymbol.ContainingType.FindImplementationForInterfaceMember(x), propertySymbol)))\n                {\n                    return true;\n                }\n            }\n            return false;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/CollectionQuerySimplification.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class CollectionQuerySimplification : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S2971\";\n        private const string MessageFormat = \"{0}\";\n        internal const string MessageUseInstead = \"Use {0} here instead.\";\n        internal const string MessageDropAndChange = \"Drop '{0}' and move the condition into the '{1}'.\";\n        internal const string MessageDropFromMiddle = \"Drop this useless call to '{0}' or replace it by 'AsEnumerable' if \" +\n            \"you are using LINQ to Entities.\";\n\n        private static readonly DiagnosticDescriptor Rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        private static readonly ISet<string> MethodNamesWithPredicate = new HashSet<string>\n        {\n            \"Any\", \"LongCount\", \"Count\",\n            \"First\", \"FirstOrDefault\", \"Last\", \"LastOrDefault\",\n            \"Single\", \"SingleOrDefault\",\n        };\n\n        private static readonly ISet<string> MethodNamesForTypeCheckingWithSelect = new HashSet<string>\n        {\n            \"Any\", \"LongCount\", \"Count\",\n            \"First\", \"FirstOrDefault\", \"Last\", \"LastOrDefault\",\n            \"Single\", \"SingleOrDefault\", \"SkipWhile\", \"TakeWhile\",\n        };\n\n        private static readonly ISet<string> MethodNamesToCollection = new HashSet<string>\n        {\n            \"ToList\",\n            \"ToArray\",\n        };\n\n        private static readonly ISet<string> IgnoredMethodNames = new HashSet<string>\n        {\n            \"AsEnumerable\", // ignored as it is somewhat cleaner way to cast to IEnumerable<T> and has no side effects\n        };\n\n        private static readonly ISet<SyntaxKind> AsIsSyntaxKinds = new HashSet<SyntaxKind>\n        {\n            SyntaxKind.AsExpression,\n            SyntaxKind.IsExpression\n        };\n\n        private const string WhereMethodName = \"Where\";\n        private const int WherePredicateTypeArgumentNumber = 2;\n        private const string SelectMethodName = \"Select\";\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(CheckExtensionMethodsOnIEnumerable, SyntaxKind.InvocationExpression);\n            context.RegisterNodeAction(CheckToCollectionCalls, SyntaxKind.InvocationExpression);\n            context.RegisterNodeAction(CheckCountCall, SyntaxKind.InvocationExpression);\n        }\n\n        private static void CheckCountCall(SonarSyntaxNodeReportingContext context)\n        {\n            const string CountName = \"Count\";\n\n            var invocation = (InvocationExpressionSyntax)context.Node;\n            if (invocation is\n                {\n                    ArgumentList.Arguments.Count: 0,\n                    Expression: MemberAccessExpressionSyntax\n                    {\n                        Name.Identifier.ValueText: CountName,\n                        Expression: { } memberAccessExpression\n                    }\n                }\n                && context.Model.GetSymbolInfo(invocation).Symbol is IMethodSymbol { Name: CountName } methodSymbol\n                && methodSymbol.IsExtensionOn(KnownType.System_Collections_Generic_IEnumerable_T)\n                && HasCountProperty(memberAccessExpression, context.Model))\n            {\n                context.ReportIssue(Rule, GetReportLocation(invocation), string.Format(MessageUseInstead, $\"'{CountName}' property\"));\n            }\n\n            static bool HasCountProperty(ExpressionSyntax expression, SemanticModel semanticModel) =>\n                semanticModel.GetTypeInfo(expression).Type.GetMembers(CountName).OfType<IPropertySymbol>().Any();\n        }\n\n        private static void CheckToCollectionCalls(SonarSyntaxNodeReportingContext context)\n        {\n            var outerInvocation = (InvocationExpressionSyntax)context.Node;\n            if (context.Model.GetSymbolInfo(outerInvocation).Symbol is not IMethodSymbol outerMethodSymbol\n                || !MethodExistsOnIEnumerable(outerMethodSymbol, context.Model))\n            {\n                return;\n            }\n\n            var innerInvocation = GetInnerInvocation(outerInvocation, outerMethodSymbol);\n            if (innerInvocation == null)\n            {\n                return;\n            }\n\n            if (context.Model.GetSymbolInfo(innerInvocation).Symbol is IMethodSymbol innerMethodSymbol\n                && IsToCollectionCall(innerMethodSymbol))\n            {\n                context.ReportIssue(Rule, GetReportLocation(innerInvocation), GetToCollectionCallsMessage(context, innerInvocation, innerMethodSymbol));\n            }\n        }\n\n        private static bool MethodExistsOnIEnumerable(IMethodSymbol methodSymbol, SemanticModel semanticModel)\n        {\n            if (IgnoredMethodNames.Contains(methodSymbol.Name))\n            {\n                return false;\n            }\n\n            if (methodSymbol.IsExtensionOn(KnownType.System_Collections_Generic_IEnumerable_T))\n            {\n                return true;\n            }\n\n            var enumerableType = semanticModel.Compilation.GetTypeByMetadataName(KnownType.System_Linq_Enumerable);\n            if (enumerableType == null)\n            {\n                return false;\n            }\n\n            var members = enumerableType.GetMembers(methodSymbol.Name).OfType<IMethodSymbol>();\n            return members.Any(member => ParametersMatch(methodSymbol.OriginalDefinition, member));\n        }\n\n        private static bool ParametersMatch(IMethodSymbol originalDefinition, IMethodSymbol member)\n        {\n            var parameterIndexOffset = originalDefinition.IsExtensionMethod ? 0 : 1;\n\n            if (originalDefinition.Parameters.Length + parameterIndexOffset != member.Parameters.Length)\n            {\n                return false;\n            }\n\n            for (var i = 1; i < member.Parameters.Length; i++)\n            {\n                if (!originalDefinition.Parameters[i - parameterIndexOffset].Type.Equals(member.Parameters[i].Type))\n                {\n                    return false;\n                }\n            }\n\n            return true;\n        }\n\n        private static bool IsToCollectionCall(IMethodSymbol methodSymbol) =>\n            MethodNamesToCollection.Contains(methodSymbol.Name)\n            && (methodSymbol.IsExtensionOn(KnownType.System_Collections_Generic_IEnumerable_T)\n                || methodSymbol.ContainingType.ConstructedFrom.Is(KnownType.System_Collections_Generic_List_T));\n\n        private static string GetToCollectionCallsMessage(SonarSyntaxNodeReportingContext context, InvocationExpressionSyntax invocation, IMethodSymbol methodSymbol) =>\n            IsLinqDatabaseQuery(invocation, context.Model)\n                ? string.Format(MessageUseInstead, \"'AsEnumerable'\")\n                : string.Format(MessageDropFromMiddle, methodSymbol.Name);\n\n        private static bool IsLinqDatabaseQuery(InvocationExpressionSyntax node, SemanticModel model)\n        {\n            while (node?.Operands().Left is { } left)\n            {\n                if (GetNodeTypeSymbol(left, model).DerivesOrImplementsAny(KnownType.DatabaseBaseQueryTypes))\n                {\n                    return true;\n                }\n\n                node = left as InvocationExpressionSyntax;\n            }\n\n            return false;\n        }\n\n        private static ITypeSymbol GetNodeTypeSymbol(SyntaxNode node, SemanticModel model) =>\n            node.RemoveParentheses() switch\n            {\n                QueryExpressionSyntax { FromClause: { } fromClause } => GetNodeTypeSymbol(fromClause.Expression, model),\n                { } n => model.GetTypeInfo(n).Type\n            };\n\n        private static void CheckExtensionMethodsOnIEnumerable(SonarSyntaxNodeReportingContext context)\n        {\n            var outerInvocation = (InvocationExpressionSyntax)context.Node;\n            if (context.Model.GetSymbolInfo(outerInvocation).Symbol is not IMethodSymbol outerMethodSymbol\n                || !outerMethodSymbol.IsExtensionOn(KnownType.System_Collections_Generic_IEnumerable_T))\n            {\n                return;\n            }\n\n            var innerInvocation = GetInnerInvocation(outerInvocation, outerMethodSymbol);\n            if (innerInvocation == null)\n            {\n                return;\n            }\n\n            if (context.Model.GetSymbolInfo(innerInvocation).Symbol is not IMethodSymbol innerMethodSymbol\n                || !innerMethodSymbol.IsExtensionOn(KnownType.System_Collections_Generic_IEnumerable_T))\n            {\n                return;\n            }\n\n            if (CheckForSimplifiable(context, outerMethodSymbol, outerInvocation, innerMethodSymbol, innerInvocation))\n            {\n                return;\n            }\n\n            CheckForCastSimplification(context, outerMethodSymbol, outerInvocation, innerMethodSymbol, innerInvocation);\n        }\n\n        private static InvocationExpressionSyntax GetInnerInvocation(InvocationExpressionSyntax outerInvocation,\n            IMethodSymbol outerMethodSymbol)\n        {\n            if (outerMethodSymbol.MethodKind == MethodKind.ReducedExtension)\n            {\n                if (outerInvocation.Expression is MemberAccessExpressionSyntax memberAccess)\n                {\n                    return memberAccess.Expression as InvocationExpressionSyntax;\n                }\n            }\n            else\n            {\n                var argument = outerInvocation.ArgumentList.Arguments.FirstOrDefault();\n                if (argument != null)\n                {\n                    return argument.Expression as InvocationExpressionSyntax;\n                }\n\n                if (outerInvocation.Expression is MemberAccessExpressionSyntax memberAccess)\n                {\n                    return memberAccess.Expression as InvocationExpressionSyntax;\n                }\n            }\n\n            return null;\n        }\n\n        private static List<ArgumentSyntax> GetReducedArguments(IMethodSymbol methodSymbol, InvocationExpressionSyntax invocation) =>\n            methodSymbol.MethodKind == MethodKind.ReducedExtension\n                ? invocation.ArgumentList.Arguments.ToList()\n                : invocation.ArgumentList.Arguments.Skip(1).ToList();\n\n        private static void CheckForCastSimplification(SonarSyntaxNodeReportingContext context,\n                                                       IMethodSymbol outerMethodSymbol,\n                                                       InvocationExpressionSyntax outerInvocation,\n                                                       IMethodSymbol innerMethodSymbol,\n                                                       InvocationExpressionSyntax innerInvocation)\n        {\n            if (MethodNamesForTypeCheckingWithSelect.Contains(outerMethodSymbol.Name)\n                && innerMethodSymbol.Name == SelectMethodName\n                && IsFirstExpressionInLambdaIsNullChecking(outerMethodSymbol, outerInvocation)\n                && TryGetCastInLambda(SyntaxKind.AsExpression, innerMethodSymbol, innerInvocation, out var typeNameInInner))\n            {\n                context.ReportIssue(Rule, GetReportLocation(innerInvocation), string.Format(MessageUseInstead, $\"'OfType<{typeNameInInner}>()'\"));\n            }\n\n            if (outerMethodSymbol.Name == SelectMethodName\n                && innerMethodSymbol.Name == WhereMethodName\n                && IsExpressionInLambdaIsCast(outerMethodSymbol, outerInvocation, out var typeNameInOuter)\n                && TryGetCastInLambda(SyntaxKind.IsExpression, innerMethodSymbol, innerInvocation, out typeNameInInner)\n                && typeNameInOuter == typeNameInInner)\n            {\n                context.ReportIssue(Rule, GetReportLocation(innerInvocation), string.Format(MessageUseInstead, $\"'OfType<{typeNameInInner}>()'\"));\n            }\n        }\n\n        private static Location GetReportLocation(InvocationExpressionSyntax invocation) =>\n            invocation.Expression is not MemberAccessExpressionSyntax memberAccess\n                ? invocation.Expression.GetLocation()\n                : memberAccess.Name.GetLocation();\n\n        private static bool IsExpressionInLambdaIsCast(IMethodSymbol methodSymbol, InvocationExpressionSyntax invocation, out string typeName) =>\n            TryGetCastInLambda(SyntaxKind.AsExpression, methodSymbol, invocation, out typeName)\n            || TryGetCastInLambda(methodSymbol, invocation, out typeName);\n\n        private static bool IsFirstExpressionInLambdaIsNullChecking(IMethodSymbol methodSymbol, InvocationExpressionSyntax invocation)\n        {\n            var arguments = GetReducedArguments(methodSymbol, invocation);\n            if (arguments.Count != 1)\n            {\n                return false;\n            }\n            var expression = arguments[0].Expression;\n\n            var binaryExpression = GetExpressionFromLambda(expression).RemoveParentheses() as BinaryExpressionSyntax;\n            var lambdaParameter = GetLambdaParameter(expression);\n\n            while (binaryExpression != null)\n            {\n                if (!binaryExpression.IsKind(SyntaxKind.LogicalAndExpression))\n                {\n                    return binaryExpression.IsKind(SyntaxKind.NotEqualsExpression)\n                           && IsNullChecking(binaryExpression, lambdaParameter);\n                }\n                binaryExpression = binaryExpression.Left.RemoveParentheses() as BinaryExpressionSyntax;\n            }\n            return false;\n        }\n\n        private static bool IsNullChecking(BinaryExpressionSyntax binaryExpression, string lambdaParameter)\n        {\n            if (CSharpEquivalenceChecker.AreEquivalent(SyntaxConstants.NullLiteralExpression, binaryExpression.Left.RemoveParentheses())\n                && binaryExpression.Right.RemoveParentheses().ToString() == lambdaParameter)\n            {\n                return true;\n            }\n\n            if (CSharpEquivalenceChecker.AreEquivalent(SyntaxConstants.NullLiteralExpression, binaryExpression.Right.RemoveParentheses())\n                && binaryExpression.Left.RemoveParentheses().ToString() == lambdaParameter)\n            {\n                return true;\n            }\n\n            return false;\n        }\n\n        private static ExpressionSyntax GetExpressionFromLambda(ExpressionSyntax expression)\n        {\n            if (expression is not SimpleLambdaExpressionSyntax lambda)\n            {\n                var parenthesizedLambda = expression as ParenthesizedLambdaExpressionSyntax;\n                return parenthesizedLambda?.Body as ExpressionSyntax;\n            }\n\n            return lambda.Body as ExpressionSyntax;\n        }\n\n        private static string GetLambdaParameter(ExpressionSyntax expression)\n        {\n            if (expression is SimpleLambdaExpressionSyntax lambda)\n            {\n                return lambda.Parameter.Identifier.ValueText;\n            }\n\n            if (expression is not ParenthesizedLambdaExpressionSyntax parenthesizedLambda\n                || parenthesizedLambda.ParameterList.Parameters.Count == 0)\n            {\n                return null;\n            }\n            return parenthesizedLambda.ParameterList.Parameters[0].Identifier.ValueText;\n        }\n\n        private static bool TryGetCastInLambda(SyntaxKind asOrIs, IMethodSymbol methodSymbol, InvocationExpressionSyntax invocation, out string type)\n        {\n            type = null;\n            if (!AsIsSyntaxKinds.Contains(asOrIs))\n            {\n                return false;\n            }\n\n            var arguments = GetReducedArguments(methodSymbol, invocation);\n            if (arguments.Count != 1)\n            {\n                return false;\n            }\n\n            var expression = arguments[0].Expression;\n            var lambdaParameter = GetLambdaParameter(expression);\n            if (GetExpressionFromLambda(expression).RemoveParentheses() is not BinaryExpressionSyntax lambdaBody\n                || lambdaParameter == null\n                || !lambdaBody.IsKind(asOrIs))\n            {\n                return false;\n            }\n\n            var castedExpression = lambdaBody.Left.RemoveParentheses();\n            if (lambdaParameter != castedExpression.ToString())\n            {\n                return false;\n            }\n\n            type = lambdaBody.Right.ToString();\n            return true;\n        }\n\n        private static bool TryGetCastInLambda(IMethodSymbol methodSymbol, InvocationExpressionSyntax invocation, out string type)\n        {\n            type = null;\n            var arguments = GetReducedArguments(methodSymbol, invocation);\n            if (arguments.Count != 1)\n            {\n                return false;\n            }\n\n            var expression = arguments[0].Expression;\n            var lambdaParameter = GetLambdaParameter(expression);\n            if (GetExpressionFromLambda(expression).RemoveParentheses() is not CastExpressionSyntax castExpression\n                || lambdaParameter == null)\n            {\n                return false;\n            }\n\n            var castedExpression = castExpression.Expression.RemoveParentheses();\n            if (lambdaParameter != castedExpression.ToString())\n            {\n                return false;\n            }\n\n            type = castExpression.Type.ToString();\n            return true;\n        }\n\n        private static bool CheckForSimplifiable(SonarSyntaxNodeReportingContext context,\n                                                 IMethodSymbol outerMethodSymbol,\n                                                 InvocationExpressionSyntax outerInvocation,\n                                                 IMethodSymbol innerMethodSymbol,\n                                                 InvocationExpressionSyntax innerInvocation)\n        {\n            if (MethodIsNotUsingPredicate(outerMethodSymbol, outerInvocation)\n                && innerMethodSymbol.Name == WhereMethodName\n                && innerMethodSymbol.Parameters.Any(symbol => (symbol.Type as INamedTypeSymbol)?.TypeArguments.Length == WherePredicateTypeArgumentNumber))\n            {\n                context.ReportIssue(Rule, GetReportLocation(innerInvocation), string.Format(MessageDropAndChange, WhereMethodName, outerMethodSymbol.Name));\n                return true;\n            }\n\n            return false;\n        }\n\n        private static bool MethodIsNotUsingPredicate(IMethodSymbol methodSymbol, InvocationExpressionSyntax invocation)\n        {\n            var arguments = GetReducedArguments(methodSymbol, invocation);\n\n            return arguments.Count == 0 && MethodNamesWithPredicate.Contains(methodSymbol.Name);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/CollectionsShouldImplementGenericInterface.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class CollectionsShouldImplementGenericInterface : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S3909\";\n        private const string MessageFormat = \"Refactor this collection to implement '{0}'.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        private static readonly Dictionary<KnownType, string> NonGenericToGenericMapping = new()\n        {\n            { KnownType.System_Collections_ICollection, \"System.Collections.Generic.ICollection<T>\" },\n            { KnownType.System_Collections_IList, \"System.Collections.Generic.IList<T>\" },\n            { KnownType.System_Collections_IEnumerable, \"System.Collections.Generic.IEnumerable<T>\" },\n            { KnownType.System_Collections_CollectionBase, \"System.Collections.ObjectModel.Collection<T>\" }\n        };\n\n        private static readonly ImmutableArray<KnownType> GenericTypes = ImmutableArray.Create(\n            KnownType.System_Collections_Generic_ICollection_T,\n            KnownType.System_Collections_Generic_IList_T,\n            KnownType.System_Collections_Generic_IEnumerable_T,\n            KnownType.System_Collections_ObjectModel_Collection_T);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n                {\n                    var typeDeclaration = (BaseTypeDeclarationSyntax)c.Node;\n                    var implementedTypes = typeDeclaration.BaseList?.Types;\n                    if (implementedTypes is null || c.IsRedundantPositionalRecordContext())\n                    {\n                        return;\n                    }\n\n                    var containingType = (INamedTypeSymbol)c.ContainingSymbol;\n                    var typeSymbols = containingType.Interfaces.Concat([containingType.BaseType]).WhereNotNull().ToImmutableArray();\n                    if (typeSymbols.Any(x => x.OriginalDefinition.IsAny(GenericTypes)))\n                    {\n                        return;\n                    }\n                    foreach (var typeSymbol in typeSymbols)\n                    {\n                        if (SuggestGenericCollectionType(typeSymbol) is { } suggestedGenericType)\n                        {\n                            c.ReportIssue(Rule, typeDeclaration.Identifier, suggestedGenericType);\n                        }\n                    }\n                },\n                SyntaxKind.ClassDeclaration,\n                SyntaxKind.StructDeclaration,\n                SyntaxKindEx.RecordDeclaration,\n                SyntaxKindEx.RecordStructDeclaration);\n\n        private static string SuggestGenericCollectionType(ITypeSymbol typeSymbol) =>\n            NonGenericToGenericMapping.FirstOrDefault(pair => pair.Key.Matches(typeSymbol)).Value;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/CommentKeyword.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class CommentKeyword : CommentKeywordBase\n    {\n        protected override ILanguageFacade Language => CSharpFacade.Instance;\n\n        protected override bool IsComment(SyntaxTrivia trivia) => trivia.IsComment();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/CommentedOutCode.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text.RegularExpressions;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class CommentedOutCode : SonarDiagnosticAnalyzer\n{\n    internal const string DiagnosticId = \"S125\";\n    internal const string MessageFormat = \"Remove this commented out code.\";\n    private const int CommentMarkLength = 2;\n\n    private static readonly string[] CodeEndings = [\"{\", \";}\", \"{}\"];\n    private static readonly string[] CodeParts = [\"++\", \"catch(\", \"switch(\", \"try{\", \"else{\"];\n    private static readonly string[] CodePartsWithRelationalOperator = [\"for(\", \"if(\", \"while(\"];\n    private static readonly string[] RelationalOperators = [\"<\", \">\", \"<=\", \">=\", \"==\", \"!=\"];\n\n    // Groups 1 and 2 capture the first two words for keyword detection.\n    private static readonly Regex SentencePattern =\n        new(\n            @\"^\\s*(?:[*\\-]|->|=>)?\\s*(\\w+)[.,?:!']*\\s+(\\w+)[.,?:!']*\\s+(?:\\w+[.,?:!']*\\s+)*\\w+[.,?:!']*$\",\n            RegexOptions.None,\n            Constants.DefaultRegexTimeout);\n\n    private static readonly HashSet<string> CodeKeywords =\n    [\n        \"abstract\", \"as\", \"async\", \"await\", \"base\", \"bool\", \"break\", \"byte\", \"catch\", \"char\",\n        \"checked\", \"class\", \"const\", \"continue\", \"decimal\", \"default\", \"delegate\", \"do\", \"double\",\n        \"else\", \"enum\", \"event\", \"explicit\", \"extern\", \"false\", \"finally\", \"fixed\", \"float\", \"for\",\n        \"foreach\", \"goto\", \"if\", \"implicit\", \"in\", \"int\", \"interface\", \"internal\", \"is\", \"lock\",\n        \"long\", \"namespace\", \"new\", \"null\", \"object\", \"operator\", \"out\", \"override\", \"params\",\n        \"private\", \"protected\", \"public\", \"readonly\", \"ref\", \"return\", \"sbyte\", \"sealed\", \"short\",\n        \"sizeof\", \"stackalloc\", \"static\", \"string\", \"struct\", \"switch\", \"this\", \"throw\", \"true\",\n        \"try\", \"typeof\", \"uint\", \"ulong\", \"unchecked\", \"unsafe\", \"using\", \"virtual\", \"void\",\n        \"volatile\", \"while\", \"yield\",\n    ];\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    internal static bool IsCode(string line)\n    {\n        var checkedLine = line.Replace(\" \", string.Empty).Replace(\"\\t\", string.Empty);\n\n        if (checkedLine.Contains(\"License\") || checkedLine.Contains(\"c++\") || checkedLine.Contains(\"C++\"))\n        {\n            return false;\n        }\n\n        return EndsWithCode(checkedLine, line)\n            || ContainsCodeParts(checkedLine)\n            || ContainsMultipleLogicalOperators(checkedLine)\n            || ContainsCodePartsWithRelationalOperator(checkedLine);\n    }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterTreeAction(c =>\n            {\n                foreach (var token in c.Tree.GetRoot().DescendantTokens())\n                {\n                    CheckTrivia(c, token.LeadingTrivia);\n                    CheckTrivia(c, token.TrailingTrivia);\n                }\n            });\n\n    private static void CheckTrivia(SonarSyntaxTreeReportingContext context, SyntaxTriviaList trivia)\n    {\n        var shouldReport = true;\n        foreach (var trivium in trivia)\n        {\n            // comment start is checked because of  https://github.com/dotnet/roslyn/issues/10003\n            if (trivium.IsKind(SyntaxKind.MultiLineCommentTrivia) && !trivium.ToFullString().TrimStart().StartsWith(\"/**\", StringComparison.Ordinal))\n            {\n                CheckMultilineComment(context, trivium);\n                shouldReport = true;\n            }\n            else if (shouldReport\n                && trivium.IsKind(SyntaxKind.SingleLineCommentTrivia)\n                && !trivium.ToFullString().TrimStart().StartsWith(\"///\", StringComparison.Ordinal)\n                && IsCode(trivium.ToString().Substring(CommentMarkLength)))\n            {\n                context.ReportIssue(Rule, trivium.GetLocation());\n                shouldReport = false;\n            }\n        }\n    }\n\n    private static void CheckMultilineComment(SonarSyntaxTreeReportingContext context, SyntaxTrivia trivia)\n    {\n        var triviaLines = TriviaContent().Split(Constants.LineTerminators, StringSplitOptions.None);\n\n        for (var triviaLineNumber = 0; triviaLineNumber < triviaLines.Length; triviaLineNumber++)\n        {\n            if (IsCode(triviaLines[triviaLineNumber]))\n            {\n                var triviaStartingLineNumber = trivia.GetLocation().StartLine();\n                var lineNumber = triviaStartingLineNumber + triviaLineNumber;\n                var lineSpan = context.Tree.GetText().Lines[lineNumber].Span;\n                var commentLineSpan = lineSpan.Intersection(trivia.GetLocation().SourceSpan);\n                var location = Location.Create(context.Tree, commentLineSpan ?? lineSpan);\n                context.ReportIssue(Rule, location);\n                return;\n            }\n        }\n\n        string TriviaContent()\n        {\n            var content = trivia.ToString().Substring(CommentMarkLength);\n            return content.EndsWith(\"*/\", StringComparison.Ordinal) ? content.Substring(0, content.Length - CommentMarkLength) : content;\n        }\n    }\n\n    private static bool ContainsMultipleLogicalOperators(string checkedLine)\n    {\n        const int lengthOfOperator = 2;\n        const int operatorCountLimit = 3;\n        var lineLengthWithoutLogicalOperators = checkedLine.Replace(\"&&\", string.Empty).Replace(\"||\", string.Empty).Length;\n\n        return checkedLine.Length - lineLengthWithoutLogicalOperators >= operatorCountLimit * lengthOfOperator;\n    }\n\n    private static bool ContainsCodeParts(string checkedLine) =>\n        CodeParts.Any(checkedLine.Contains);\n\n    private static bool ContainsCodePartsWithRelationalOperator(string checkedLine)\n    {\n        return CodePartsWithRelationalOperator.Any(ContainsRelationalOperator);\n\n        bool ContainsRelationalOperator(string codePart)\n        {\n            var index = checkedLine.IndexOf(codePart, StringComparison.Ordinal);\n            return index >= 0 && RelationalOperators.Any(x => checkedLine.IndexOf(x, index, StringComparison.Ordinal) >= 0);\n        }\n    }\n\n    private static bool EndsWithCode(string checkedLine, string originalLine) =>\n        checkedLine == \"}\"\n        || CodeEndings.Any(x => checkedLine.EndsWith(x, StringComparison.Ordinal))\n        || (checkedLine.EndsWith(\";\", StringComparison.Ordinal) && !LooksLikeSentence(originalLine.Trim().TrimEnd(';')));\n\n    private static bool LooksLikeSentence(string trimmedLine) =>\n        SentencePattern.SafeMatch(trimmedLine) is { Success: true } match\n        && !(CodeKeywords.Contains(match.Groups[1].Value) && CodeKeywords.Contains(match.Groups[2].Value));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/CommentedOutCodeCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[ExportCodeFixProvider(LanguageNames.CSharp)]\npublic sealed class CommentedOutCodeCodeFix : SonarCodeFix\n{\n    public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(CommentedOutCode.DiagnosticId);\n\n    public override FixAllProvider GetFixAllProvider() => null;\n\n    protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n    {\n        var diagnostic = context.Diagnostics.First();\n        var comment = root.FindTrivia(diagnostic.Location.SourceSpan.Start, findInsideTrivia: true);\n\n        if (comment.IsKind(SyntaxKind.SingleLineCommentTrivia) || IsCode(comment))\n        {\n            context.RegisterCodeFix(\n                CommentedOutCode.MessageFormat,\n                c => new Context(comment).ChangeDocument(context.Document, root),\n                context.Diagnostics);\n        }\n        return Task.CompletedTask;\n    }\n\n    private static bool IsCode(SyntaxTrivia trivia) =>\n        trivia.LineNumbers().Count() == 1\n        || Array.TrueForAll(Lines(trivia), IsCode);\n\n    private static bool IsCode(string line)\n    {\n        var trimmed = line.Trim();\n        return trimmed == \"/*\"\n            || trimmed == \"*/\"\n            || trimmed == \"*\"\n            || string.IsNullOrEmpty(trimmed)\n            || CommentedOutCode.IsCode(line);\n    }\n\n    private static string[] Lines(SyntaxTrivia trivia) =>\n        trivia.ToFullString().Split(Constants.LineTerminators, StringSplitOptions.None);\n\n    private sealed class Context\n    {\n        private bool IsTrailing { get; }\n        private SyntaxTrivia Comment { get; }\n        private List<SyntaxTrivia> Leading { get; }\n        private List<SyntaxTrivia> Trailing { get; }\n        private SyntaxToken Token => Comment.Token;\n\n        public Context(SyntaxTrivia comment)\n        {\n            Comment = comment;\n            Leading = Token.LeadingTrivia.ToList();\n            Trailing = Token.TrailingTrivia.ToList();\n            IsTrailing = Trailing.Remove(comment);\n\n            if (!IsTrailing)\n            {\n                Leading.Remove(comment);\n            }\n        }\n\n        public Task<Document> ChangeDocument(Document document, SyntaxNode root) =>\n            Task.FromResult(document.WithSyntaxRoot(root.ReplaceToken(Token, NewToken())));\n\n        private SyntaxToken NewToken() =>\n            IsTrailing ? NewTrailing() : NewLeading();\n\n        private SyntaxToken NewTrailing()\n        {\n            var trailing = ShareLine(Token, Comment)\n                 ? Trailing.Where(KeepTrailing).ToList()\n                 : Trailing;\n\n            // this can happen for multi line comments within an expression. Like:\n            // int /* commented code */ MethodCall()\n            if (trailing.Count == 0 && ShareLine(Token.GetNextToken(), Comment))\n            {\n                trailing.Add(SyntaxFactory.Space);\n            }\n\n            return Token\n                .WithLeadingTrivia(Leading)\n                .WithTrailingTrivia(trailing);\n        }\n\n        private bool KeepTrailing(SyntaxTrivia trivia) =>\n             trivia.IsKind(SyntaxKind.EndOfLineTrivia) || !ShareLine(trivia, Comment);\n\n        private SyntaxToken NewLeading() =>\n            Token\n                .WithLeadingTrivia(Leading.Where(t => !ShareLine(t, Comment)))\n                .WithTrailingTrivia(Trailing);\n\n        private static bool ShareLine(SyntaxToken token, SyntaxTrivia trivia) =>\n            ShareLine(token.LineNumbers(), trivia.LineNumbers());\n\n        private static bool ShareLine(SyntaxTrivia l, SyntaxTrivia r) =>\n            ShareLine(l.LineNumbers(), r.LineNumbers());\n\n        private static bool ShareLine(IEnumerable<int> l, IEnumerable<int> r) =>\n            l.Intersect(r).Any();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/CommentsShouldNotBeEmpty.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class CommentsShouldNotBeEmpty : CommentsShouldNotBeEmptyBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override bool IsValidTriviaType(SyntaxTrivia trivia) =>\n        trivia.IsComment();\n\n    protected override string GetCommentText(SyntaxTrivia trivia) =>\n        trivia.Kind() switch\n        {\n            SyntaxKind.SingleLineCommentTrivia => GetSingleLineText(trivia),\n            SyntaxKind.MultiLineCommentTrivia => GetMultiLineText(trivia),\n            SyntaxKind.SingleLineDocumentationCommentTrivia => GetSingleLineDocumentationText(trivia),\n            SyntaxKind.MultiLineDocumentationCommentTrivia => GetMultiLineDocumentationText(trivia),\n        };\n\n    // //\n    private static string GetSingleLineText(SyntaxTrivia trivia) =>\n        trivia.ToString().Trim().Substring(2);\n\n    // ///\n    private static string GetSingleLineDocumentationText(SyntaxTrivia trivia)\n    {\n        var stringBuilder = new StringBuilder();\n        foreach (var line in trivia.ToFullString().Split(Constants.LineTerminators, StringSplitOptions.None))\n        {\n            var trimmedLine = line.TrimStart(null);\n            trimmedLine = trimmedLine.StartsWith(\"///\")\n                ? trimmedLine.Substring(3).Trim()\n                : trimmedLine.TrimEnd(null);\n            stringBuilder.Append(trimmedLine);\n        }\n        return stringBuilder.ToString();\n    }\n\n    // /* */\n    private static string GetMultiLineText(SyntaxTrivia trivia) =>\n        ParseMultiLine(trivia.ToString(), 2); // Length of \"/*\"\n\n    // /** */\n    private static string GetMultiLineDocumentationText(SyntaxTrivia trivia) =>\n        ParseMultiLine(trivia.ToFullString(), 3); // Length of \"/**\"\n\n    private static string ParseMultiLine(string commentText, int initialTrimSize)\n    {\n        commentText = commentText.Trim().Substring(initialTrimSize);\n        if (commentText.EndsWith(\"*/\", StringComparison.Ordinal)) // Might be unclosed, still reported\n        {\n            commentText = commentText.Substring(0, commentText.Length - 2);\n        }\n\n        var stringBuilder = new StringBuilder();\n        foreach (var line in commentText.Split(Constants.LineTerminators, StringSplitOptions.None))\n        {\n            var trimmedLine = line.TrimStart(null);\n            if (trimmedLine.StartsWith(\"*\", StringComparison.Ordinal))\n            {\n                trimmedLine = trimmedLine.TrimStart('*');\n            }\n\n            stringBuilder.Append(trimmedLine.Trim());\n        }\n        return stringBuilder.ToString();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ComparableInterfaceImplementation.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ComparableInterfaceImplementation : SonarDiagnosticAnalyzer\n{\n    internal const string DiagnosticId = \"S1210\";\n    private const string MessageFormat = \"When implementing {0}, you should also override {1}.\";\n    private const string ObjectEquals = nameof(object.Equals);\n\n    private static readonly ImmutableArray<KnownType> ComparableInterfaces =\n        ImmutableArray.Create(\n            KnownType.System_IComparable,\n            KnownType.System_IComparable_T);\n\n    private static readonly ComparisonKind[] ComparisonKinds =\n        Enum.GetValues(typeof(ComparisonKind)).Cast<ComparisonKind>()\n            .Where(x => x != ComparisonKind.None)\n            .OrderBy(x => x)\n            .ToArray();\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            c =>\n            {\n                var classDeclaration = (TypeDeclarationSyntax)c.Node;\n                if (c.Model.GetDeclaredSymbol(classDeclaration) is { } classSymbol\n                    && !classSymbol.BaseType.GetSelfAndBaseTypes().Any(t => t.ImplementsAny(ComparableInterfaces))\n                    && !(classSymbol.ContainingType is not null && classSymbol.GetEffectiveAccessibility() is Accessibility.Private or Accessibility.ProtectedAndInternal)\n                    && ImplementedComparableInterfaces(classSymbol) is var implementedComparableInterfaces\n                    && implementedComparableInterfaces.Any()\n                    && MembersToOverride(classSymbol.GetMembers().OfType<IMethodSymbol>()).ToList() is { } membersToOverride\n                    && membersToOverride.Any())\n                {\n                    c.ReportIssue(\n                        Rule,\n                        classDeclaration.Identifier,\n                        string.Join(\" or \", implementedComparableInterfaces),\n                        membersToOverride.JoinAnd());\n                }\n            },\n            SyntaxKind.ClassDeclaration,\n            SyntaxKind.StructDeclaration,\n            SyntaxKindEx.RecordDeclaration,\n            SyntaxKindEx.RecordStructDeclaration);\n\n    private static IEnumerable<string> ImplementedComparableInterfaces(INamedTypeSymbol classSymbol) =>\n        classSymbol.Interfaces\n            .Where(x => x.OriginalDefinition.IsAny(ComparableInterfaces))\n            .Select(x => x.OriginalDefinition.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat))\n            .ToList();\n\n    private static IEnumerable<string> MembersToOverride(IEnumerable<IMethodSymbol> methods)\n    {\n        if (!methods.Any(KnownMethods.IsObjectEquals))\n        {\n            yield return ObjectEquals;\n        }\n\n        var overridenOperators = methods\n            .Where(x => x.MethodKind == MethodKind.UserDefinedOperator)\n            .Select(x => x.ComparisonKind());\n\n        foreach (var comparisonKind in ComparisonKinds.Except(overridenOperators))\n        {\n            yield return comparisonKind.ToDisplayString(AnalyzerLanguage.CSharp);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/CompareNaN.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class CompareNaN : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S2688\";\n        private const string MessageFormat = \"{0}\";\n        private const string MessageFormatEquality = \"Use {0}.IsNaN() instead.\";\n        private const string MessageFormatComparison = \"Do not compare a number with {0}.NaN.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        private static readonly Dictionary<KnownType, string> KnownTypeAliasMap = new()\n        {\n            { KnownType.System_Double, \"double\" },\n            { KnownType.System_Single, \"float\" },\n        };\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var binaryExpressionSyntax = (BinaryExpressionSyntax)c.Node;\n\n                    if (TryGetFloatingPointType(binaryExpressionSyntax.Left, c.Model, out var floatingPointType)\n                        || TryGetFloatingPointType(binaryExpressionSyntax.Right, c.Model, out floatingPointType))\n                    {\n                        var messageFormat = c.Node.Kind() is SyntaxKind.EqualsExpression or SyntaxKind.NotEqualsExpression\n                            ? MessageFormatEquality\n                            : MessageFormatComparison;\n\n                        c.ReportIssue(\n                            Rule,\n                            binaryExpressionSyntax,\n                            string.Format(messageFormat, KnownTypeAliasMap[floatingPointType]));\n                    }\n                },\n                SyntaxKind.GreaterThanExpression,\n                SyntaxKind.GreaterThanOrEqualExpression,\n                SyntaxKind.LessThanExpression,\n                SyntaxKind.LessThanOrEqualExpression,\n                SyntaxKind.EqualsExpression,\n                SyntaxKind.NotEqualsExpression);\n\n        private static bool TryGetFloatingPointType(SyntaxNode expression, SemanticModel semanticModel, out KnownType floatingPointType)\n        {\n            floatingPointType = null;\n\n            if (expression is not MemberAccessExpressionSyntax memberAccess)\n            {\n                return false;\n            }\n\n            var fieldSymbol = semanticModel.GetSymbolInfo(memberAccess).Symbol as IFieldSymbol;\n            if (fieldSymbol?.Name != nameof(double.NaN))\n            {\n                return false;\n            }\n\n            floatingPointType = KnownType.FloatingPointNumbers.FirstOrDefault(fieldSymbol.Type.Is);\n\n            return floatingPointType != null;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ConditionalSimplification.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ConditionalSimplification : SonarDiagnosticAnalyzer\n{\n    internal const string SimplifiedOperatorKey = \"SimplifiedOperator\";\n    internal const string IsCoalesceAssignmentSupportedKey = \"IsNullCoalesceAssignmentSupported\";\n    internal const string DiagnosticId = \"S3240\";\n    private const string MessageFormat = \"Use the '{0}' operator here.\";\n    private const string MessageMultipleNegation = \"Simplify negation here.\";\n    private const string CoalesceAssignmentOp = \"??=\";\n    private const string CoalesceOp = \"??\";\n    private const string TernaryOp = \"?:\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n    private static readonly DiagnosticDescriptor RuleMultipleNegation = DescriptorFactory.Create(DiagnosticId, MessageMultipleNegation);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule, RuleMultipleNegation);\n\n    internal static bool IsCoalesceAssignmentCandidate(SyntaxNode conditional, ExpressionSyntax comparedToNull) =>\n        conditional?.GetFirstNonParenthesizedParent() is AssignmentExpressionSyntax parentAssignment\n        && CSharpEquivalenceChecker.AreEquivalent(parentAssignment.Left, comparedToNull);\n\n    internal static StatementSyntax ExtractSingleStatement(StatementSyntax statement)\n    {\n        if (statement is BlockSyntax block)\n        {\n            return block.Statements.Count == 1 ? block.Statements.First() : null;\n        }\n        return statement;\n    }\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(CheckConditionalExpression, SyntaxKind.ConditionalExpression);\n        context.RegisterNodeAction(CheckIfStatement, SyntaxKind.IfStatement);\n        context.RegisterNodeAction(CheckCoalesceExpression, SyntaxKind.CoalesceExpression);\n        context.RegisterNodeAction(CheckNotPattern, SyntaxKindEx.NotPattern);\n    }\n\n    private static void CheckNotPattern(SonarSyntaxNodeReportingContext context)\n    {\n        var wrapper = (UnaryPatternSyntaxWrapper)context.Node;\n        if (wrapper.Pattern.IsNot()\n            && GetNegationRoot(context.Node) is var negationRoot\n            && negationRoot == context.Node)\n        {\n            context.ReportIssue(RuleMultipleNegation, negationRoot);\n        }\n\n        static SyntaxNode GetNegationRoot(SyntaxNode node)\n        {\n            while (node.Parent.Kind() == SyntaxKindEx.NotPattern)\n            {\n                node = node.Parent;\n            }\n            return node;\n        }\n    }\n\n    private static void CheckCoalesceExpression(SonarSyntaxNodeReportingContext context)\n    {\n        if (context.Node.GetFirstNonParenthesizedParent() is AssignmentExpressionSyntax assignment\n            && !assignment.Parent.IsKind(SyntaxKind.ObjectInitializerExpression)\n            && context.Compilation.IsCoalesceAssignmentSupported())\n        {\n            var left = ((BinaryExpressionSyntax)context.Node).Left.RemoveParentheses();\n            if (CSharpEquivalenceChecker.AreEquivalent(assignment.Left.RemoveParentheses(), left))\n            {\n                context.ReportIssue(Rule, assignment.GetLocation(), BuildCodeFixProperties(context), CoalesceAssignmentOp);\n            }\n        }\n    }\n\n    private static void CheckIfStatement(SonarSyntaxNodeReportingContext context)\n    {\n        var ifStatement = (IfStatementSyntax)context.Node;\n        if (ifStatement.Parent is ElseClauseSyntax)\n        {\n            return;\n        }\n\n        var whenTrue = ExtractSingleStatement(ifStatement.Statement);\n        var whenFalse = ExtractSingleStatement(ifStatement.Else?.Statement);\n        if (whenTrue is null\n            || (ifStatement.Else is not null && whenFalse is null)\n            || (whenFalse is not null && CSharpEquivalenceChecker.AreEquivalent(whenTrue, whenFalse)))\n        {\n            // Equivalence handled by S1871, <see cref=\"ConditionalStructureSameImplementation\"/>\n            return;\n        }\n\n        var possiblyCoalescing = ifStatement.Condition.TryGetExpressionComparedToNull(out var comparedToNull, out var comparedIsNullInTrue)\n                                 && comparedToNull.CanBeNull(context.Model);\n\n        if (CanBeSimplified(context, whenTrue, whenFalse, possiblyCoalescing ? comparedToNull : null, context.Model, comparedIsNullInTrue, out var simplifiedOperator))\n        {\n            context.ReportIssue(Rule, ifStatement.IfKeyword, BuildCodeFixProperties(context, simplifiedOperator), simplifiedOperator);\n        }\n    }\n\n    private static void CheckConditionalExpression(SonarSyntaxNodeReportingContext context)\n    {\n        var conditional = (ConditionalExpressionSyntax)context.Node;\n        var condition = conditional.Condition.RemoveParentheses();\n        var whenTrue = conditional.WhenTrue.RemoveParentheses();\n        var whenFalse = conditional.WhenFalse.RemoveParentheses();\n\n        if (CSharpEquivalenceChecker.AreEquivalent(whenTrue, whenFalse))\n        {\n            // handled by S2758, <see cref=\"TernaryOperatorPointless\"/>\n            return;\n        }\n\n        if (condition.TryGetExpressionComparedToNull(out var comparedToNull, out var comparedIsNullInTrue)\n            && comparedToNull.CanBeNull(context.Model)\n            && CanExpressionBeCoalescing(whenTrue, whenFalse, comparedToNull, context.Model, comparedIsNullInTrue))\n        {\n            if (context.Compilation.IsCoalesceAssignmentSupported() && IsCoalesceAssignmentCandidate(conditional, comparedToNull))\n            {\n                context.ReportIssue(Rule, conditional.GetFirstNonParenthesizedParent(), BuildCodeFixProperties(context), CoalesceAssignmentOp);\n            }\n            else\n            {\n                context.ReportIssue(Rule, conditional, BuildCodeFixProperties(context), CoalesceOp);\n            }\n        }\n    }\n\n    private static bool AreTypesCompatible(ExpressionSyntax first, ExpressionSyntax second, SemanticModel model, ITypeSymbol targetType = null)\n    {\n        if (first is AnonymousFunctionExpressionSyntax || second is AnonymousFunctionExpressionSyntax)\n        {\n            return false;\n        }\n\n        var firstType = model.GetTypeInfo(first).Type;\n        var secondType = model.GetTypeInfo(second).Type;\n\n        if (firstType is IErrorTypeSymbol || secondType is IErrorTypeSymbol)\n        {\n            return false;\n        }\n\n        if (IsNullAndValueType(firstType, secondType) || IsNullAndValueType(secondType, firstType))\n        {\n            return false;\n        }\n\n        if (firstType is null || secondType is null)\n        {\n            return true;\n        }\n\n        if (targetType is not null && model.Compilation.IsTargetTypeConditionalSupported())\n        {\n            return firstType.DerivesFrom(targetType) && secondType.DerivesFrom(targetType);\n        }\n\n        return firstType.Equals(secondType);\n    }\n\n    private static bool IsNullAndValueType(ITypeSymbol typeNull, ITypeSymbol typeValue) =>\n        typeNull is null && typeValue is { IsValueType: true };\n\n    private static bool CanBeSimplified(SonarSyntaxNodeReportingContext context,\n                                        StatementSyntax statement1,\n                                        StatementSyntax statement2,\n                                        SyntaxNode comparedToNull,\n                                        SemanticModel model,\n                                        bool comparedIsNullInTrue,\n                                        out string simplifiedOperator)\n    {\n        simplifiedOperator = TernaryOp;\n\n        if (statement1 is ReturnStatementSyntax return1 && statement2 is ReturnStatementSyntax return2)\n        {\n            var retExpr1 = return1.Expression.RemoveParentheses();\n            var retExpr2 = return2.Expression.RemoveParentheses();\n\n            if (IsConditionalStructure(retExpr1)\n                || IsConditionalStructure(retExpr2)\n                || !AreTypesCompatible(return1.Expression, return2.Expression, model))\n            {\n                return false;\n            }\n            if (comparedToNull is not null && CanExpressionBeCoalescing(retExpr1, retExpr2, comparedToNull, model, comparedIsNullInTrue))\n            {\n                simplifiedOperator = CoalesceOp;\n            }\n            return true;\n        }\n\n        var expressionStatement2 = statement2 as ExpressionStatementSyntax;\n        if ((statement1 is not ExpressionStatementSyntax) || (statement2 is not null && expressionStatement2 is null))\n        {\n            return false;\n        }\n\n        var expression1 = ((ExpressionStatementSyntax)statement1).Expression.RemoveParentheses();\n        if (statement2 is null)\n        {\n            simplifiedOperator = context.Compilation.IsCoalesceAssignmentSupported() ? CoalesceAssignmentOp : CoalesceOp;\n            return expression1 is AssignmentExpressionSyntax assignment\n                && comparedIsNullInTrue\n                && comparedToNull is not null\n                && CSharpEquivalenceChecker.AreEquivalent(assignment.Left, comparedToNull);\n        }\n\n        if (IsConditionalStructure(statement1) || IsConditionalStructure(statement2))\n        {\n            return false;\n        }\n\n        var expression2 = expressionStatement2.Expression.RemoveParentheses();\n        if (AreCandidateAssignments(expression1, expression2, comparedToNull, model, comparedIsNullInTrue, out simplifiedOperator))\n        {\n            return true;\n        }\n        else if (comparedToNull is not null && CanExpressionBeCoalescing(expression1, expression2, comparedToNull, model, comparedIsNullInTrue))\n        {\n            simplifiedOperator = CoalesceOp;\n            return true;\n        }\n        else\n        {\n            return AreCandidateInvocations(expression1, expression2, null, model, comparedIsNullInTrue: false);\n        }\n    }\n\n    private static bool AreCandidateAssignments(ExpressionSyntax expression1,\n                                                ExpressionSyntax expression2,\n                                                SyntaxNode compared,\n                                                SemanticModel model,\n                                                bool comparedIsNullInTrue,\n                                                out string simplifiedOperator)\n    {\n        simplifiedOperator = TernaryOp;\n        var assignment1 = expression1 as AssignmentExpressionSyntax;\n        var assignment2 = expression2 as AssignmentExpressionSyntax;\n        var canBeSimplified = assignment1 is not null\n                              && assignment2 is not null\n                              && CSharpEquivalenceChecker.AreEquivalent(assignment1.Left, assignment2.Left)\n                              && assignment1.Kind() == assignment2.Kind();\n\n        if (!canBeSimplified || !AreTypesCompatible(assignment1.Right, assignment2.Right, model, model.GetTypeInfo(assignment1.Left).Type))\n        {\n            return false;\n        }\n\n        if (compared is not null && CanExpressionBeCoalescing(assignment1.Right, assignment2.Right, compared, model, comparedIsNullInTrue))\n        {\n            simplifiedOperator = CoalesceOp;\n        }\n\n        return true;\n    }\n\n    private static bool AreCandidateInvocations(ExpressionSyntax firstExpression,\n                                                ExpressionSyntax secondExpression,\n                                                SyntaxNode comparedToNull,\n                                                SemanticModel model,\n                                                bool comparedIsNullInTrue)\n    {\n        if (firstExpression is not InvocationExpressionSyntax firstInvocation\n            || secondExpression is not InvocationExpressionSyntax secondInvocation\n            || firstInvocation.ArgumentList.Arguments.Count != secondInvocation.ArgumentList.Arguments.Count\n            || !CSharpEquivalenceChecker.AreEquivalent(firstInvocation.Expression, secondInvocation.Expression)\n            || model.GetSymbolInfo(firstInvocation).Symbol is not { } firstSymbol\n            || model.GetSymbolInfo(secondInvocation).Symbol is not { } secondSymbol\n            || !firstSymbol.Equals(secondSymbol))\n        {\n            return false;\n        }\n\n        var numberOfDifferences = 0;\n        var numberOfComparisonsToCondition = 0;\n        for (var i = 0; i < firstInvocation.ArgumentList.Arguments.Count; i++)\n        {\n            var arg1 = firstInvocation.ArgumentList.Arguments[i].Expression.RemoveParentheses();\n            var arg2 = secondInvocation.ArgumentList.Arguments[i].Expression.RemoveParentheses();\n            if (!CSharpEquivalenceChecker.AreEquivalent(arg1, arg2))\n            {\n                numberOfDifferences++;\n                if (comparedToNull is not null)\n                {\n                    var arg1IsComparedToNull = CSharpEquivalenceChecker.AreEquivalent(arg1, comparedToNull);\n                    var arg2IsComparedToNull = CSharpEquivalenceChecker.AreEquivalent(arg2, comparedToNull);\n                    if (arg1IsComparedToNull && !comparedIsNullInTrue)\n                    {\n                        numberOfComparisonsToCondition++;\n                    }\n                    if (arg2IsComparedToNull && comparedIsNullInTrue)\n                    {\n                        numberOfComparisonsToCondition++;\n                    }\n                }\n                if (!AreTypesCompatible(arg1, arg2, model))\n                {\n                    return false;\n                }\n            }\n            else\n            {\n                if (comparedToNull is not null && CSharpEquivalenceChecker.AreEquivalent(arg1, comparedToNull))\n                {\n                    return false;\n                }\n            }\n        }\n        return numberOfDifferences == 1 && (comparedToNull is null || numberOfComparisonsToCondition is 1);\n    }\n\n    private static bool CanExpressionBeCoalescing(ExpressionSyntax whenTrue, ExpressionSyntax whenFalse, SyntaxNode comparedToNull, SemanticModel model, bool comparedIsNullInTrue)\n    {\n        if (CSharpEquivalenceChecker.AreEquivalent(whenTrue, comparedToNull))\n        {\n            return !comparedIsNullInTrue;\n        }\n        else if (CSharpEquivalenceChecker.AreEquivalent(whenFalse, comparedToNull))\n        {\n            return comparedIsNullInTrue;\n        }\n        else\n        {\n            return AreCandidateInvocations(whenTrue, whenFalse, comparedToNull, model, comparedIsNullInTrue);\n        }\n    }\n\n    private static ImmutableDictionary<string, string> BuildCodeFixProperties(SonarSyntaxNodeReportingContext c, string simplifiedOperator = null)\n    {\n        var ret = new Dictionary<string, string> { { IsCoalesceAssignmentSupportedKey, c.Compilation.IsCoalesceAssignmentSupported().ToString() } };\n        if (simplifiedOperator is not null)\n        {\n            ret.Add(SimplifiedOperatorKey, simplifiedOperator);\n        }\n        return ret.ToImmutableDictionary();\n    }\n\n    private static bool IsConditionalStructure(SyntaxNode node) =>\n        node.DescendantNodesAndSelf().Any(x => x.Kind() is SyntaxKind.ConditionalExpression or SyntaxKindEx.SwitchExpression);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ConditionalSimplificationCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Formatting;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class ConditionalSimplificationCodeFix : SonarCodeFix\n    {\n        private const string Title = \"Simplify condition\";\n\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(ConditionalSimplification.DiagnosticId);\n\n        protected override async Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var oldNode = root.FindNode(diagnostic.Location.SourceSpan);\n            if (oldNode is GlobalStatementSyntax globalStatementSyntax)\n            {\n                oldNode = globalStatementSyntax.Statement;\n            }\n\n            var semanticModel = await context.Document.GetSemanticModelAsync(context.Cancel).ConfigureAwait(false);\n            var newNode = Simplify(diagnostic, semanticModel, oldNode);\n            if (newNode != null)\n            {\n                context.RegisterCodeFix(\n                    Title,\n                    c =>\n                    {\n                        var replacement = newNode.WithTriviaFrom(oldNode).WithAdditionalAnnotations(Formatter.Annotation);\n\n                        var newRoot = root.ReplaceNode(oldNode, replacement);\n\n                        return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                    },\n                    context.Diagnostics);\n            }\n        }\n\n        private static SyntaxNode Simplify(Diagnostic diagnostic, SemanticModel semanticModel, SyntaxNode oldNode)\n        {\n            ExpressionSyntax compared;\n            switch (oldNode)\n            {\n                case ConditionalExpressionSyntax conditional:\n                    var condition = conditional.Condition.RemoveParentheses();\n                    var whenTrue = conditional.WhenTrue.RemoveParentheses();\n                    var whenFalse = conditional.WhenFalse.RemoveParentheses();\n                    condition.TryGetExpressionComparedToNull(out compared, out _);\n                    return SimplifyCoalesceExpression(new ComparedContext(diagnostic, semanticModel, compared), whenTrue, whenFalse);\n\n                case IfStatementSyntax ifStatement:\n                    var ifPart = ConditionalSimplification.ExtractSingleStatement(ifStatement.Statement);\n                    var elsePart = ConditionalSimplification.ExtractSingleStatement(ifStatement.Else?.Statement);\n                    ifStatement.Condition.TryGetExpressionComparedToNull(out compared, out var _);\n                    return SimplifyIfStatement(new ComparedContext(diagnostic, semanticModel, compared), ifPart, elsePart, ifStatement.Condition.RemoveParentheses());\n\n                case AssignmentExpressionSyntax assignment:\n                    var context = new ComparedContext(diagnostic, semanticModel, null);\n                    var right = assignment.Right.RemoveParentheses();\n                    if (right is BinaryExpressionSyntax binaryExpression && binaryExpression.Kind() == SyntaxKind.CoalesceExpression)\n                    {\n                        return CoalesceAssignmentExpression(context, assignment.Left, binaryExpression.Right);\n                    }\n                    else if (right is ConditionalExpressionSyntax conditional)\n                    {\n                        conditional.Condition.TryGetExpressionComparedToNull(out compared, out var comparedIsNullInTrue);\n                        if (context.IsCoalesceAssignmentSupported && ConditionalSimplification.IsCoalesceAssignmentCandidate(conditional, compared))\n                        {\n                            return CoalesceAssignmentExpression(context,\n                                                                ((AssignmentExpressionSyntax)conditional.GetFirstNonParenthesizedParent()).Left,\n                                                                (comparedIsNullInTrue ? conditional.WhenTrue : conditional.WhenFalse).RemoveParentheses());\n                        }\n                    }\n                    break;\n\n                case var s when UnaryPatternSyntaxWrapper.IsInstance(s):\n                    return ReduceDoubleNegation(s);\n            }\n\n            return null;\n        }\n\n        private static SyntaxNode ReduceDoubleNegation(SyntaxNode node)\n        {\n            if (!UnaryPatternSyntaxWrapper.IsInstance(node))\n            {\n                return node;\n            }\n\n            var parent = (UnaryPatternSyntaxWrapper)node;\n            if (parent.IsNot() && parent.Pattern.IsNot())\n            {\n                return ReduceDoubleNegation(((UnaryPatternSyntaxWrapper)parent.Pattern).Pattern);\n            }\n\n            return node;\n        }\n\n        private static StatementSyntax SimplifyIfStatement(ComparedContext context, StatementSyntax statement1, StatementSyntax statement2, ExpressionSyntax condition)\n        {\n            if (statement1 is ReturnStatementSyntax return1 && statement2 is ReturnStatementSyntax return2)\n            {\n                var retExpr1 = return1.Expression.RemoveParentheses();\n                var retExpr2 = return2.Expression.RemoveParentheses();\n                var createdExpression = context.SimplifiedOperator switch\n                {\n                    \"?:\" => ConditionalExpression(condition, retExpr1, retExpr2),\n                    \"??\" => SimplifyCoalesceExpression(context, retExpr1, retExpr2),\n                    _ => throw new System.InvalidOperationException(\"Unexpected simplifiedOperator: \" + context.SimplifiedOperator)\n                };\n                return SyntaxFactory.ReturnStatement(createdExpression);\n            }\n            var expression = SimplifyIfExpression(context, statement1 as ExpressionStatementSyntax, statement2 as ExpressionStatementSyntax, condition);\n            return expression == null ? null : SyntaxFactory.ExpressionStatement(expression);\n        }\n\n        private static ExpressionSyntax SimplifyIfExpression(ComparedContext context, ExpressionStatementSyntax statement1, ExpressionStatementSyntax statement2, ExpressionSyntax condition)\n        {\n            bool isCoalescing;\n            var expression1 = statement1.Expression.RemoveParentheses();\n            switch (context.SimplifiedOperator)\n            {\n                case \"?:\":\n                    isCoalescing = false;\n                    break;\n                case \"??\":\n                    if (statement2 == null)\n                    {\n                        return CoalesceAssignmentExpression(context, expression1);\n                    }\n                    isCoalescing = true;\n                    break;\n                case \"??=\":\n                    return CoalesceAssignmentExpression(context, expression1);\n                default:\n                    throw new System.InvalidOperationException(\"Unexpected simplifiedOperator: \" + context.SimplifiedOperator);\n            }\n            var expression2 = statement2.Expression.RemoveParentheses();\n            return SimplifyAssignmentExpression(context, expression1, expression2, condition, isCoalescing)\n                ?? SimplifyInvocationExpression(context, expression1, expression2, condition, isCoalescing);\n        }\n\n        private static ExpressionSyntax SimplifyAssignmentExpression(ComparedContext context, ExpressionSyntax expression1, ExpressionSyntax expression2, ExpressionSyntax condition, bool isCoalescing)\n        {\n            if (expression1 is AssignmentExpressionSyntax assignment1\n                && expression2 is AssignmentExpressionSyntax assignment2\n                && assignment1.Kind() == assignment2.Kind()\n                && CSharpEquivalenceChecker.AreEquivalent(assignment1.Left, assignment2.Left))\n            {\n                var createdExpression = isCoalescing\n                    ? SimplifyCoalesceExpression(context, assignment1.Right, assignment2.Right)\n                    : ConditionalExpression(condition, assignment1.Right, assignment2.Right);\n                return SyntaxFactory.AssignmentExpression(assignment1.Kind(), assignment1.Left, createdExpression);\n            }\n            return null;\n        }\n\n        private static ExpressionSyntax SimplifyCoalesceExpression(ComparedContext context, ExpressionSyntax whenTrue, ExpressionSyntax whenFalse)\n        {\n            if (CSharpEquivalenceChecker.AreEquivalent(whenTrue, context.Compared))\n            {\n                return CoalesceExpression(context.Compared, whenFalse);\n            }\n            else if (CSharpEquivalenceChecker.AreEquivalent(whenFalse, context.Compared))\n            {\n                return CoalesceExpression(context.Compared, whenTrue);\n            }\n            return SimplifyInvocationExpression(context, whenTrue, whenFalse, null, isCoalescing: true);\n        }\n\n        private static ExpressionSyntax CoalesceAssignmentExpression(ComparedContext context, ExpressionSyntax assignmentExpression) =>\n            assignmentExpression is AssignmentExpressionSyntax originalAssignment\n                ? CoalesceAssignmentExpression(context, originalAssignment.Left, originalAssignment.Right)\n                : null;\n\n        private static ExpressionSyntax CoalesceAssignmentExpression(ComparedContext context, ExpressionSyntax left, ExpressionSyntax right)\n        {\n            if (context.IsCoalesceAssignmentSupported)\n            {\n                return SyntaxFactory.AssignmentExpression(SyntaxKindEx.CoalesceAssignmentExpression, left, right);\n            }\n            return SyntaxFactory.AssignmentExpression(SyntaxKind.SimpleAssignmentExpression, left, CoalesceExpression(left, right));\n        }\n\n        private static ExpressionSyntax CoalesceExpression(ExpressionSyntax left, ExpressionSyntax right) =>\n            SyntaxFactory.BinaryExpression(SyntaxKind.CoalesceExpression, left, right);\n\n        private static ConditionalExpressionSyntax ConditionalExpression(ExpressionSyntax condition, ExpressionSyntax truePart, ExpressionSyntax falsePart) =>\n            SyntaxFactory.ConditionalExpression(condition, truePart, falsePart);\n\n        private static ExpressionSyntax SimplifyInvocationExpression(ComparedContext context, ExpressionSyntax expression1, ExpressionSyntax expression2, ExpressionSyntax condition, bool isCoalescing)\n        {\n            if (expression1 is InvocationExpressionSyntax methodCall1\n                && expression2 is InvocationExpressionSyntax methodCall2\n                && context.SemanticModel.GetSymbolInfo(methodCall1).Symbol is IMethodSymbol methodSymbol1\n                && context.SemanticModel.GetSymbolInfo(methodCall2).Symbol is IMethodSymbol methodSymbol2\n                && methodSymbol1.Equals(methodSymbol2))\n            {\n                return methodCall1.WithArgumentList(SimplifyInvocationArguments(context, methodCall1, methodCall2, condition, isCoalescing));\n            }\n            return null;\n        }\n\n        private static ArgumentListSyntax SimplifyInvocationArguments(ComparedContext context, InvocationExpressionSyntax methodCall1, InvocationExpressionSyntax methodCall2, ExpressionSyntax condition, bool isCoalescing)\n        {\n            var newArgumentList = SyntaxFactory.ArgumentList();\n            for (var i = 0; i < methodCall1.ArgumentList.Arguments.Count; i++)\n            {\n                var arg1 = methodCall1.ArgumentList.Arguments[i];\n                var arg2 = methodCall2.ArgumentList.Arguments[i];\n                var expr1 = arg1.Expression.RemoveParentheses();\n                var expr2 = arg2.Expression.RemoveParentheses();\n                if (CSharpEquivalenceChecker.AreEquivalent(expr1, expr2))\n                {\n                    newArgumentList = newArgumentList.AddArguments(arg1.WithExpression(expr1));\n                }\n                else\n                {\n                    ExpressionSyntax createdExpression;\n                    if (isCoalescing)\n                    {\n                        var arg1Compared = CSharpEquivalenceChecker.AreEquivalent(expr1, context.Compared);\n                        createdExpression = SyntaxFactory.BinaryExpression(SyntaxKind.CoalesceExpression, context.Compared, arg1Compared ? expr2 : expr1);\n                    }\n                    else\n                    {\n                        createdExpression = SyntaxFactory.ConditionalExpression(condition, expr1, expr2);\n                    }\n                    newArgumentList = newArgumentList.AddArguments(SyntaxFactory.Argument(arg1.NameColon, arg1.RefOrOutKeyword, createdExpression));\n                }\n            }\n            return newArgumentList;\n        }\n\n        private class ComparedContext\n        {\n            public readonly ExpressionSyntax Compared;\n            public readonly SemanticModel SemanticModel;\n            public readonly bool IsCoalesceAssignmentSupported;\n\n            /// <summary>\n            /// Value is set only for IfStatement checks.\n            /// </summary>\n            public readonly string SimplifiedOperator;\n\n            public ComparedContext(Diagnostic diagnostic, SemanticModel semanticModel, ExpressionSyntax compared)\n            {\n                Compared = compared;\n                SemanticModel = semanticModel;\n                IsCoalesceAssignmentSupported = bool.Parse(diagnostic.Properties[ConditionalSimplification.IsCoalesceAssignmentSupportedKey]);\n                diagnostic.Properties.TryGetValue(ConditionalSimplification.SimplifiedOperatorKey, out SimplifiedOperator);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ConditionalStructureSameCondition.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class ConditionalStructureSameCondition : ConditionalStructureSameConditionBase\n    {\n        protected override ILanguageFacade Language => CSharpFacade.Instance;\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n                {\n                    var ifStatement = (IfStatementSyntax)c.Node;\n                    var currentCondition = ifStatement.Condition;\n                    if (ifStatement.PrecedingConditionsInConditionChain().FirstOrDefault(x => CSharpEquivalenceChecker.AreEquivalent(currentCondition, x)) is { } precedingCondition)\n                    {\n                        c.ReportIssue(rule, currentCondition, [precedingCondition.ToSecondaryLocation()], precedingCondition.LineNumberToReport().ToString());\n                    }\n                },\n                SyntaxKind.IfStatement);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ConditionalStructureSameImplementation.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ConditionalStructureSameImplementation : ConditionalStructureSameImplementationBase\n{\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    private static readonly ISet<SyntaxKind> IgnoredStatementsInSwitch = new HashSet<SyntaxKind>\n    {\n        SyntaxKind.BreakStatement,\n        SyntaxKind.ReturnStatement,\n        SyntaxKind.ThrowStatement,\n    };\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(\n            c =>\n            {\n                var ifStatement = (IfStatementSyntax)c.Node;\n                var precedingStatements = ifStatement.PrecedingStatementsInConditionChain().ToList();\n                var hasElse = HasLeafElseClause(ifStatement);\n\n                CheckStatement(c, ifStatement.Statement, precedingStatements, c.Model, hasElse, \"branch\");\n\n                if (ifStatement.Else is not null)\n                {\n                    CheckStatement(c, ifStatement.Else.Statement, [.. precedingStatements, ifStatement.Statement], c.Model, hasElse, \"branch\");\n                }\n            },\n            SyntaxKind.IfStatement);\n\n        context.RegisterNodeAction(\n            c =>\n            {\n                var switchSection = (SwitchSectionSyntax)c.Node;\n                var precedingSections = switchSection.PrecedingSections().ToList();\n\n                CheckStatement(c, switchSection, precedingSections, c.Model, HasDefaultClause((SwitchStatementSyntax)switchSection.Parent), \"case\");\n            },\n            SyntaxKind.SwitchSection);\n    }\n\n    private static bool HasDefaultClause(SwitchStatementSyntax switchStatement) =>\n        switchStatement.Sections.SelectMany(x => x.Labels).Any(x => x.IsKind(SyntaxKind.DefaultSwitchLabel));\n\n    private static bool HasLeafElseClause(IfStatementSyntax ifStatement)\n    {\n        while (ifStatement.Else?.Statement is IfStatementSyntax elseIfStatement)\n        {\n            ifStatement = elseIfStatement;\n        }\n        return ifStatement.Else is not null;\n    }\n\n    private static void CheckStatement(SonarSyntaxNodeReportingContext context, SyntaxNode node, IReadOnlyList<SyntaxNode> precedingBranches, SemanticModel model, bool hasElse, string discriminator)\n    {\n        var numberOfStatements = StatementsCount(node);\n        if (!hasElse && numberOfStatements == 1)\n        {\n            if (precedingBranches.Any() && precedingBranches.All(x => AreEquivalentStatements(node, x, model)))\n            {\n                ReportSyntaxNode(context, node, precedingBranches[precedingBranches.Count - 1], discriminator);\n            }\n        }\n        else if (numberOfStatements > 1 && precedingBranches.FirstOrDefault(x => AreEquivalentStatements(node, x, model)) is { } equivalentStatement)\n        {\n            ReportSyntaxNode(context, node, equivalentStatement, discriminator);\n        }\n    }\n\n    private static bool AreEquivalentStatements(SyntaxNode node, SyntaxNode otherNode, SemanticModel model) =>\n        new EquivalentNodeCompare(node, otherNode) switch\n        {\n            (SwitchSectionSyntax { Statements: var statements }, SwitchSectionSyntax { Statements: var otherStatements }) =>\n                CSharpEquivalenceChecker.AreEquivalent(statements, otherStatements) && HaveTheSameInvocations(statements, otherStatements, model),\n            (BlockSyntax refBlock, BlockSyntax otherBlock) =>\n                CSharpEquivalenceChecker.AreEquivalent(refBlock, otherBlock) && HaveTheSameInvocations(refBlock, otherBlock, model),\n            _ => false, // Should not happen\n        };\n\n    private static int StatementsCount(SyntaxNode node)\n    {\n        // Get all child statements from the node, in case of a switch section, we need to handle the case where the statements are wrapped in a block\n        var statements = node is SwitchSectionSyntax switchSection\n            ? switchSection.Statements.OfType<BlockSyntax>().SelectMany(x => x.Statements)\n                .Union(switchSection.Statements.Where(x => !x.IsKind(SyntaxKind.Block)))\n            : node.ChildNodes();\n\n        return statements.Count(IsApprovedStatement);\n    }\n\n    private static void ReportSyntaxNode(SonarSyntaxNodeReportingContext context, SyntaxNode node, SyntaxNode precedingNode, string errorMessageDiscriminator) =>\n        context.ReportIssue(Rule, node, [precedingNode.ToSecondaryLocation()], precedingNode.LineNumberToReport().ToString(), errorMessageDiscriminator);\n\n    private static bool IsApprovedStatement(SyntaxNode statement) =>\n        !statement.IsAnyKind(IgnoredStatementsInSwitch);\n\n    private static bool HaveTheSameInvocations(SyntaxList<SyntaxNode> first, SyntaxList<SyntaxNode> second, SemanticModel model)\n    {\n        var referenceInvocations = first.SelectMany(x => x.DescendantNodes().OfType<InvocationExpressionSyntax>()).ToArray();\n        var candidateInvocations = second.SelectMany(x => x.DescendantNodes().OfType<InvocationExpressionSyntax>()).ToArray();\n        return HaveTheSameInvocations(referenceInvocations, candidateInvocations, model);\n    }\n\n    private static bool HaveTheSameInvocations(SyntaxNode first, SyntaxNode second, SemanticModel model)\n    {\n        var referenceInvocations = first.DescendantNodes().OfType<InvocationExpressionSyntax>().ToArray();\n        var candidateInvocations = second.DescendantNodes().OfType<InvocationExpressionSyntax>().ToArray();\n        return HaveTheSameInvocations(referenceInvocations, candidateInvocations, model);\n    }\n\n    private static bool HaveTheSameInvocations(InvocationExpressionSyntax[] referenceInvocations, InvocationExpressionSyntax[] candidateInvocations, SemanticModel model)\n    {\n        if (referenceInvocations.Length != candidateInvocations.Length)\n        {\n            return false;\n        }\n\n        for (var i = 0; i < referenceInvocations.Length; i++)\n        {\n            if (!referenceInvocations[i].IsEqualTo(candidateInvocations[i], model))\n            {\n                return false;\n            }\n        }\n        return true;\n    }\n\n    private readonly record struct EquivalentNodeCompare(SyntaxNode RefNode, SyntaxNode OtherNode);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ConditionalsShouldStartOnNewLine.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class ConditionalsShouldStartOnNewLine : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S3972\";\n        private const string MessageFormat = \"Move this 'if' to a new line or add the missing 'else'.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(c =>\n            {\n                var ifKeyword = ((IfStatementSyntax)c.Node).IfKeyword;\n\n                if (TryGetPreviousTokenInSameLine(ifKeyword, out var previousTokenInSameLine) &&\n                    previousTokenInSameLine.IsKind(SyntaxKind.CloseBraceToken))\n                {\n                    c.ReportIssue(rule, ifKeyword, [previousTokenInSameLine.ToSecondaryLocation()]);\n                }\n            },\n            SyntaxKind.IfStatement);\n        }\n\n        private static bool TryGetPreviousTokenInSameLine(SyntaxToken token, out SyntaxToken previousToken)\n        {\n            previousToken = token.GetPreviousToken();\n            return previousToken.Line() == token.Line();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ConditionalsWithSameCondition.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class ConditionalsWithSameCondition : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S2760\";\n        private const string MessageFormat = \"This condition was just checked on line {0}.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c => CheckMatchingExpressionsInSucceedingStatements<IfStatementSyntax>(c, x => x.Condition),\n                SyntaxKind.IfStatement);\n\n            context.RegisterNodeAction(\n                c => CheckMatchingExpressionsInSucceedingStatements<SwitchStatementSyntax>(c, x => x.Expression),\n                SyntaxKind.SwitchStatement);\n        }\n\n        private static void CheckMatchingExpressionsInSucceedingStatements<T>(SonarSyntaxNodeReportingContext context, Func<T, ExpressionSyntax> expression) where T : StatementSyntax\n        {\n            var currentStatement = (T)context.Node;\n            if (currentStatement is { PrecedingStatement: T previousStatement })\n            {\n                var currentExpression = expression(currentStatement);\n                var previousExpression = expression(previousStatement);\n                if (CSharpEquivalenceChecker.AreEquivalent(currentExpression, previousExpression)\n                    && !ContainsPossibleUpdate(previousStatement, currentExpression, context.Model))\n                {\n                    context.ReportIssue(Rule, currentExpression, previousExpression.LineNumberToReport().ToString());\n                }\n            }\n        }\n\n        private static bool ContainsPossibleUpdate(StatementSyntax statement, ExpressionSyntax expression, SemanticModel semanticModel)\n        {\n            var checkedSymbols = expression.DescendantNodesAndSelf().OfType<IdentifierNameSyntax>().Select(x => semanticModel.GetSymbolInfo(x).Symbol).WhereNotNull().ToHashSet();\n            var checkedSymbolNames = checkedSymbols.Select(x => x.Name).ToArray();\n            var statementDescendents = statement.DescendantNodesAndSelf().ToArray();\n            return statementDescendents.OfType<AssignmentExpressionSyntax>().Any(x => HasCheckedSymbol(x.Left))\n                || statementDescendents.OfType<PostfixUnaryExpressionSyntax>().Any(x => HasCheckedSymbol(x.Operand))\n                || statementDescendents.OfType<PrefixUnaryExpressionSyntax>().Any(x => HasCheckedSymbol(x.Operand));\n\n            bool HasCheckedSymbol(SyntaxNode node) =>\n                checkedSymbolNames.Any(node.ToStringContains)\n                && semanticModel.GetSymbolInfo(node).Symbol is { } symbol\n                && checkedSymbols.Contains(symbol);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ConstructorArgumentValueShouldExist.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ConstructorArgumentValueShouldExist : ConstructorArgumentValueShouldExistBase<SyntaxKind, AttributeSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override SyntaxNode GetFirstAttributeArgument(AttributeSyntax attributeSyntax) =>\n        attributeSyntax.ArgumentList?.Arguments.FirstOrDefault();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ConstructorOverridableCall.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ConstructorOverridableCall : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S1699\";\n    private const string MessageFormat = \"Remove this call from a constructor to the overridable '{0}' method.\";\n\n    private static readonly DiagnosticDescriptor Rule =\n        DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterSymbolStartAction(c =>\n        {\n            if (c.Symbol is IMethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.IsSealed: false } constructor\n                && !constructor.ContainingType.DerivesFrom(KnownType.Nancy_NancyModule))\n            {\n                c.RegisterSyntaxNodeAction(cc => CheckOverridableCallInConstructor(cc, constructor), SyntaxKind.InvocationExpression);\n            }\n        }, SymbolKind.Method);\n\n    private static void CheckOverridableCallInConstructor(SonarSyntaxNodeReportingContext context, IMethodSymbol constructor)\n    {\n        var invocationExpression = (InvocationExpressionSyntax)context.Node;\n\n        if (invocationExpression.EnclosingScope().Kind() is not SyntaxKind.ThisConstructorInitializer and not SyntaxKind.BaseConstructorInitializer\n            && invocationExpression.Expression is IdentifierNameSyntax or MemberAccessExpressionSyntax { Expression: ThisExpressionSyntax }\n            && context.Model.GetEnclosingSymbol(invocationExpression.SpanStart).Equals(constructor)\n            && context.Model.GetSymbolInfo(invocationExpression.Expression).Symbol is IMethodSymbol methodSymbol\n            && IsMethodOverridable(methodSymbol))\n        {\n            context.ReportIssue(Rule, invocationExpression.Expression, methodSymbol.Name);\n        }\n    }\n\n    private static bool IsMethodOverridable(IMethodSymbol methodSymbol) =>\n        methodSymbol.IsVirtual\n        || methodSymbol.IsAbstract\n        || (methodSymbol.IsOverride && !methodSymbol.IsSealed);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ConsumeValueTaskCorrectly.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ConsumeValueTaskCorrectly : SonarDiagnosticAnalyzer\n{\n    internal const string DiagnosticId = \"S5034\";\n    internal const string MessageFormat = \"{0}\";\n\n    // 'await', 'AsTask', 'Result' and '.GetAwaiter().GetResult()' should be called only once on a ValueTask\n    private const string ConsumeOnlyOnceMessage = \"Refactor this 'ValueTask' usage to consume it only once.\";\n    private const string SecondaryConsumeOnlyOnceMessage = \"The 'ValueTask' is consumed here again\";\n    // 'Result' and '.GetAwaiter().GetResult()' should be consumed inside an 'if (valueTask.IsCompletedSuccessfully)'\n    private const string ConsumeOnlyIfCompletedMessage = \"Refactor this 'ValueTask' usage to consume the result only if the operation has completed successfully.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    private static readonly ImmutableArray<KnownType> ValueTaskTypes =\n        new[]\n        {\n            KnownType.System_Runtime_CompilerServices_ValueTaskAwaiter,\n            KnownType.System_Runtime_CompilerServices_ValueTaskAwaiter_TResult,\n            KnownType.System_Threading_Tasks_ValueTask,\n            KnownType.System_Threading_Tasks_ValueTask_TResult\n        }.ToImmutableArray();\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var walker = new ConsumeValueTaskWalker(c.Model);\n                walker.SafeVisit(c.Node);\n\n                foreach (var syntaxNodes in walker.SymbolUsages.Values)\n                {\n                    if (syntaxNodes.Count > 1)\n                    {\n                        c.ReportIssue(Rule, syntaxNodes[0], syntaxNodes.Skip(1).ToSecondaryLocations(SecondaryConsumeOnlyOnceMessage), ConsumeOnlyOnceMessage);\n                    }\n                }\n\n                foreach (var node in walker.ConsumedButNotCompleted)\n                {\n                    c.ReportIssue(Rule, node, ConsumeOnlyIfCompletedMessage);\n                }\n            },\n            // when visiting a method or another member with logic inside, lambdas and local functions will be visited as well\n            SyntaxKind.ConstructorDeclaration,\n            SyntaxKind.ConversionOperatorDeclaration,\n            SyntaxKind.OperatorDeclaration,\n            SyntaxKind.PropertyDeclaration,\n            SyntaxKind.DestructorDeclaration,\n            SyntaxKind.MethodDeclaration);\n\n    private sealed class ConsumeValueTaskWalker : SafeCSharpSyntaxWalker\n    {\n        private readonly SemanticModel model;\n\n        // The key is the 'ValueTask' variable symbol, the value is a list of nodes where it is consumed\n        public IDictionary<ISymbol, IList<SyntaxNode>> SymbolUsages { get; }\n\n        // A list of 'ValueTask' nodes on which '.Result' or '.GetAwaiter().GetResult()' has been invoked when the operation has not yet completed\n        public IList<SyntaxNode> ConsumedButNotCompleted { get; }\n\n        // List of 'ValueTask' symbols which have been accessed for 'IsCompletedSuccessfully'\n        public ISet<ISymbol> VerifiedForSuccessfulCompletion { get; }\n\n        public ConsumeValueTaskWalker(SemanticModel model)\n        {\n            this.model = model;\n            SymbolUsages = new Dictionary<ISymbol, IList<SyntaxNode>>();\n            ConsumedButNotCompleted = new List<SyntaxNode>();\n            VerifiedForSuccessfulCompletion = new HashSet<ISymbol>();\n        }\n\n        /**\n         * Check if 'await' is done on a 'ValueTask'\n         */\n        public override void VisitAwaitExpression(AwaitExpressionSyntax node)\n        {\n            if (node.Expression is IdentifierNameSyntax identifierName &&\n                model.GetSymbolInfo(identifierName).Symbol is ISymbol symbol &&\n                symbol.GetSymbolType().OriginalDefinition.IsAny(ValueTaskTypes))\n            {\n                AddToSymbolUsages(symbol, identifierName);\n            }\n\n            base.VisitAwaitExpression(node);\n        }\n\n        /**\n         * Check if it's the wanted method on a ValueTask\n         * - we treat AsTask() like await - always add it to the list\n         * - for GetAwaiter().GetResult() - ignore the call if it's called inside an 'if (valueTask.IsCompletedSuccessfully)'\n         */\n        public override void VisitInvocationExpression(InvocationExpressionSyntax node)\n        {\n            if (node.Expression is MemberAccessExpressionSyntax memberAccess)\n            {\n                if (node.IsMethodInvocation(ValueTaskTypes, \"AsTask\", model) &&\n                    GetLeftMostIdentifier(memberAccess) is IdentifierNameSyntax identifier1)\n                {\n                    AddToSymbolUsages(this.model.GetSymbolInfo(identifier1).Symbol, identifier1);\n                }\n\n                if (node.IsMethodInvocation(ValueTaskTypes, \"GetResult\", model) &&\n                    GetLeftMostIdentifier(memberAccess) is IdentifierNameSyntax identifier2 &&\n                    model.GetSymbolInfo(identifier2).Symbol is ISymbol symbol2 &&\n                    !VerifiedForSuccessfulCompletion.Contains(symbol2))\n                {\n                    AddToSymbolUsages(symbol2, identifier2);\n                    ConsumedButNotCompleted.Add(identifier2);\n                }\n            }\n\n            base.VisitInvocationExpression(node);\n        }\n\n        /**\n         * Check if \".Result\" is accessed on a 'ValueTask'\n         * - ignore the call if it's called inside an 'if (valueTask.IsCompletedSuccessfully)'\n         */\n        public override void VisitMemberAccessExpression(MemberAccessExpressionSyntax node)\n        {\n            if (node.IsPropertyInvocation(ValueTaskTypes, \"Result\", model) &&\n                GetLeftMostIdentifier(node) is IdentifierNameSyntax identifierName &&\n                this.model.GetSymbolInfo(identifierName).Symbol is ISymbol symbol &&\n                !VerifiedForSuccessfulCompletion.Contains(symbol))\n            {\n                AddToSymbolUsages(symbol, identifierName);\n                ConsumedButNotCompleted.Add(identifierName);\n            }\n\n            base.VisitMemberAccessExpression(node);\n        }\n\n        public override void VisitIfStatement(IfStatementSyntax node)\n        {\n            var valueTaskMemberAccess = node.Condition.DescendantNodesAndSelf().FirstOrDefault(n =>\n                n is MemberAccessExpressionSyntax memberAccess &&\n                memberAccess.IsPropertyInvocation(ValueTaskTypes, \"IsCompletedSuccessfully\", model));\n            if (valueTaskMemberAccess is MemberAccessExpressionSyntax member &&\n                GetLeftMostIdentifier(member) is IdentifierNameSyntax identifierName &&\n                this.model.GetSymbolInfo(identifierName).Symbol is ISymbol symbol &&\n                !VerifiedForSuccessfulCompletion.Contains(symbol))\n            {\n                VerifiedForSuccessfulCompletion.Add(symbol);\n            }\n            base.VisitIfStatement(node);\n        }\n\n        private SyntaxNode GetLeftMostIdentifier(MemberAccessExpressionSyntax memberAccess)\n        {\n            if (memberAccess.Expression is InvocationExpressionSyntax invocation &&\n                invocation.Expression is MemberAccessExpressionSyntax innerMemberAccess &&\n                innerMemberAccess.Expression is IdentifierNameSyntax leftMostIdentifier)\n            {\n                return leftMostIdentifier;\n            }\n            else if (memberAccess.Expression is IdentifierNameSyntax identifierName)\n            {\n                return identifierName;\n            }\n            else if (memberAccess.Expression is MemberAccessExpressionSyntax leftMemberAccess &&\n                leftMemberAccess.Name is IdentifierNameSyntax name)\n            {\n                // gets 'task' from 'this.Task.Result' or 'Foo.Task.Result'\n                return name;\n            }\n            return memberAccess.Expression;\n        }\n\n        private void AddToSymbolUsages(ISymbol symbol, SyntaxNode node)\n        {\n            if (SymbolUsages.TryGetValue(symbol, out var syntaxNodes))\n            {\n                syntaxNodes.Add(node);\n            }\n            else\n            {\n                SymbolUsages.Add(symbol, [node]);\n            }\n        }\n\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ControlCharacterInString.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ControlCharacterInString : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S2479\";\n    private const string MessageFormat = \"Replace the control character at position {0} by its escape sequence '{1}'.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    private static readonly IDictionary<char, string> EscapedControlCharacters = new Dictionary<char, string>\n    {\n        {'\\u0000', \"\\\\0\"},\n        {'\\u0001', \"\\\\u0001\"},\n        {'\\u0002', \"\\\\u0002\"},\n        {'\\u0003', \"\\\\u0003\"},\n        {'\\u0004', \"\\\\u0004\"},\n        {'\\u0005', \"\\\\u0005\"},\n        {'\\u0006', \"\\\\u0006\"},\n        {'\\u0007', \"\\\\a\"},\n        {'\\u0008', \"\\\\b\"},\n        {'\\u0009', \"\\\\t\"},\n        {'\\u000A', \"\\\\n\"},\n        {'\\u000B', \"\\\\v\"},\n        {'\\u000C', \"\\\\f\"},\n        {'\\u000D', \"\\\\r\"},\n        {'\\u000E', \"\\\\u000E\"},\n        {'\\u000F', \"\\\\u000F\"},\n        {'\\u0010', \"\\\\u0010\"},\n        {'\\u0011', \"\\\\u0011\"},\n        {'\\u0012', \"\\\\u0012\"},\n        {'\\u0013', \"\\\\u0013\"},\n        {'\\u0014', \"\\\\u0014\"},\n        {'\\u0015', \"\\\\u0015\"},\n        {'\\u0016', \"\\\\u0016\"},\n        {'\\u0017', \"\\\\u0017\"},\n        {'\\u0018', \"\\\\u0018\"},\n        {'\\u0019', \"\\\\u0019\"},\n        {'\\u001A', \"\\\\u001A\"},\n        {'\\u001B', \"\\\\u001B\"},\n        {'\\u001C', \"\\\\u001C\"},\n        {'\\u001D', \"\\\\u001D\"},\n        {'\\u001E', \"\\\\u001E\"},\n        {'\\u001F', \"\\\\u001F\"},\n        {'\\u007F', \"\\\\u007F\"},\n        {'\\u1680', \"\\\\u1680\"},\n        {'\\u2000', \"\\\\u2000\"},\n        {'\\u2001', \"\\\\u2001\"},\n        {'\\u2002', \"\\\\u2002\"},\n        {'\\u2003', \"\\\\u2003\"},\n        {'\\u2004', \"\\\\u2004\"},\n        {'\\u2005', \"\\\\u2005\"},\n        {'\\u2006', \"\\\\u2006\"},\n        {'\\u2007', \"\\\\u2007\"},\n        {'\\u2008', \"\\\\u2008\"},\n        {'\\u2009', \"\\\\u2009\"},\n        {'\\u200A', \"\\\\u200A\"},\n        {'\\u200B', \"\\\\u200B\"},\n        {'\\u200C', \"\\\\u200C\"},\n        {'\\u200D', \"\\\\u200D\"},\n        {'\\u2028', \"\\\\u2028\"},\n        {'\\u2029', \"\\\\u2029\"},\n        {'\\u202F', \"\\\\u202F\"},\n        {'\\u205F', \"\\\\u205F\"},\n        {'\\u2060', \"\\\\u2060\"},\n        {'\\u3000', \"\\\\u3000\"},\n        {'\\uFEFF', \"\\\\uFEFF\"},\n    };\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(\n            c => CheckControlCharacter(c, ((LiteralExpressionSyntax)c.Node).Token.Text, 0),\n            SyntaxKind.StringLiteralExpression,\n            SyntaxKindEx.Utf8StringLiteralExpression);\n\n        context.RegisterNodeAction(\n            c => CheckControlCharacter(c, ((InterpolatedStringTextSyntax)c.Node).TextToken.Text, 1),\n            SyntaxKind.InterpolatedStringText);\n    }\n\n    private static void CheckControlCharacter(SonarSyntaxNodeReportingContext c, string text, int displayPosIncrement)\n    {\n        if (IsInescapableString(c.Node) || IsInescepableInterpolatedString(c.Node.Parent) || IsInescapableUtf8String(c.Node))\n        {\n            return;\n        }\n\n        for (var charPos = 0; charPos < text.Length; charPos++)\n        {\n            if (EscapedControlCharacters.TryGetValue(text[charPos], out var escapeSequence))\n            {\n                c.ReportIssue(Rule, c.Node, (displayPosIncrement + charPos).ToString(), escapeSequence);\n                return;\n            }\n        }\n    }\n\n    private static bool IsInescapableString(SyntaxNode node) =>\n        node.GetFirstToken() is var token\n        && (token.IsVerbatimStringLiteral()\n            || token.Kind() is SyntaxKindEx.SingleLineRawStringLiteralToken or SyntaxKindEx.MultiLineRawStringLiteralToken);\n\n    private static bool IsInescepableInterpolatedString(SyntaxNode node) =>\n        node.GetFirstToken().Kind() is SyntaxKind.InterpolatedVerbatimStringStartToken\n                                        or SyntaxKindEx.InterpolatedSingleLineRawStringStartToken\n                                        or SyntaxKindEx.InterpolatedMultiLineRawStringStartToken;\n\n    private static bool IsInescapableUtf8String(SyntaxNode node) =>\n        node.GetFirstToken().Kind() is SyntaxKindEx.Utf8SingleLineRawStringLiteralToken or SyntaxKindEx.Utf8MultiLineRawStringLiteralToken;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/CryptographicKeyShouldNotBeTooShort.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Security.Cryptography;\nusing System.Text.RegularExpressions;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class CryptographicKeyShouldNotBeTooShort : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S4426\";\n        private const string MessageFormat = \"Use a key length of at least {0} bits for {1} cipher algorithm.{2}\";\n        private const string UselessAssignmentInfo = \" This assignment does not update the underlying key size.\";\n\n        private const int MinimalCommonKeyLength = 2048;\n        private const int MinimalEllipticCurveKeyLength = 224;\n        private readonly Regex namedEllipticCurve = new(\"^(secp|sect|prime|c2tnb|c2pnb|brainpoolP|B-|K-|P-)(?<KeyLength>\\\\d+)\",\n            RegexOptions.Compiled | RegexOptions.IgnoreCase, Constants.DefaultRegexTimeout);\n\n        private static readonly ImmutableArray<KnownType> BouncyCastleCurveClasses =\n            ImmutableArray.Create(\n                KnownType.Org_BouncyCastle_Asn1_Nist_NistNamedCurves,\n                KnownType.Org_BouncyCastle_Asn1_Sec_SecNamedCurves,\n                KnownType.Org_BouncyCastle_Asn1_TeleTrust_TeleTrusTNamedCurves,\n                KnownType.Org_BouncyCastle_Asn1_X9_ECNamedCurveTable,\n                KnownType.Org_BouncyCastle_Asn1_X9_X962NamedCurves);\n\n        private static readonly ImmutableArray<KnownType> SystemSecurityCryptographyDsaRsa =\n            ImmutableArray.Create(\n                KnownType.System_Security_Cryptography_DSA,\n                KnownType.System_Security_Cryptography_RSA);\n\n        private static readonly ImmutableArray<KnownType> SystemSecurityCryptographyCurveClasses =\n            ImmutableArray.Create(\n                KnownType.System_Security_Cryptography_ECDiffieHellman,\n                KnownType.System_Security_Cryptography_ECDsa,\n                KnownType.System_Security_Cryptography_ECAlgorythm);\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var invocation = (InvocationExpressionSyntax)c.Node;\n                    var containingType = new Lazy<ITypeSymbol>(() => c.Model.GetSymbolInfo(invocation).Symbol?.ContainingType);\n\n                    switch (GetMethodName(invocation))\n                    {\n                        case \"Create\":\n                            CheckAlgorithmCreation(c, containingType.Value, invocation);\n                            break;\n                        case \"GenerateKey\":\n                            CheckSystemSecurityEllipticCurve(c, containingType.Value, invocation, invocation.ArgumentList);\n                            break;\n                        case \"GetByName\":\n                            CheckBouncyCastleEllipticCurve(c, containingType.Value, invocation);\n                            break;\n                        case \"Init\":\n                            CheckBouncyCastleParametersGenerators(c, containingType.Value, invocation);\n                            break;\n                        default:\n                            // Current method is not related to any cryptographic method of interest\n                            break;\n                    }\n                },\n                SyntaxKind.InvocationExpression);\n\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var objectCreation = ObjectCreationFactory.Create(c.Node);\n                    var containingType = objectCreation.TypeSymbol(c.Model);\n                    CheckSystemSecurityEllipticCurve(c, containingType, objectCreation.Expression, objectCreation.ArgumentList);\n                    CheckSystemSecurityCryptographyAlgorithms(c, containingType, objectCreation);\n                    CheckBouncyCastleKeyGenerationParameters(c, containingType, objectCreation);\n                },\n                SyntaxKind.ObjectCreationExpression, SyntaxKindEx.ImplicitObjectCreationExpression);\n\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var assignment = (AssignmentExpressionSyntax)c.Node;\n                    if (GetPropertyName(assignment.Left) == nameof(AsymmetricAlgorithm.KeySize)\n                        && assignment.Left is MemberAccessExpressionSyntax { Expression: { } expression }\n                        && c.Model.GetTypeInfo(expression).Type is ITypeSymbol containingType)\n                    {\n                        // Using the KeySize setter on DSACryptoServiceProvider/RSACryptoServiceProvider does not actually change the underlying key size\n                        // https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.dsacryptoserviceprovider.keysize\n                        // https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.rsacryptoserviceprovider.keysize\n                        if (containingType.IsAny(KnownType.System_Security_Cryptography_DSACryptoServiceProvider, KnownType.System_Security_Cryptography_RSACryptoServiceProvider))\n                        {\n                            c.ReportIssue(Rule, assignment, MinimalCommonKeyLength.ToString(), CipherName(containingType), UselessAssignmentInfo);\n                        }\n                        else\n                        {\n                            CheckGenericDsaRsaCryptographyAlgorithms(c, containingType, assignment, assignment.Right);\n                        }\n                    }\n                },\n                SyntaxKind.SimpleAssignmentExpression);\n        }\n\n        private void CheckAlgorithmCreation(SonarSyntaxNodeReportingContext c, ITypeSymbol containingType, InvocationExpressionSyntax invocation)\n        {\n            var firstParam = invocation.ArgumentList.Get(0);\n            if (firstParam == null || containingType == null)\n            {\n                return;\n            }\n\n            if (containingType.IsAny(SystemSecurityCryptographyDsaRsa) && IsInvalidCommonKeyLength(c, firstParam))\n            {\n                c.ReportIssue(Rule, invocation, MinimalCommonKeyLength.ToString(), CipherName(containingType), string.Empty);\n            }\n            else\n            {\n                CheckSystemSecurityEllipticCurve(c, containingType, invocation, invocation.ArgumentList);\n            }\n        }\n\n        private void CheckBouncyCastleEllipticCurve(SonarSyntaxNodeReportingContext c, ITypeSymbol containingType, InvocationExpressionSyntax invocation)\n        {\n            var firstParam = invocation.ArgumentList.Get(0);\n            if (firstParam == null || containingType == null || !containingType.IsAny(BouncyCastleCurveClasses))\n            {\n                return;\n            }\n\n            if (firstParam.FindStringConstant(c.Model) is { } curveId)\n            {\n                CheckCurveNameKeyLength(c, invocation, curveId);\n            }\n        }\n\n        private void CheckSystemSecurityEllipticCurve(SonarSyntaxNodeReportingContext c, ITypeSymbol containingType, SyntaxNode syntaxElement, ArgumentListSyntax argumentList)\n        {\n            var firstParam = argumentList.Get(0);\n            if (firstParam == null || containingType == null || !containingType.DerivesFromAny(SystemSecurityCryptographyCurveClasses))\n            {\n                return;\n            }\n\n            if (c.Model.GetSymbolInfo(firstParam).Symbol is { } paramSymbol)\n            {\n                CheckCurveNameKeyLength(c, syntaxElement, paramSymbol.Name);\n            }\n        }\n\n        private void CheckCurveNameKeyLength(SonarSyntaxNodeReportingContext c, SyntaxNode syntaxElement, string curveName)\n        {\n            var match = namedEllipticCurve.SafeMatch(curveName);\n            if (match.Success && int.TryParse(match.Groups[\"KeyLength\"].Value, out var keyLength) && keyLength < MinimalEllipticCurveKeyLength)\n            {\n                c.ReportIssue(Rule, syntaxElement, MinimalEllipticCurveKeyLength.ToString(), \"EC\", string.Empty);\n            }\n        }\n\n        private static void CheckSystemSecurityCryptographyAlgorithms(SonarSyntaxNodeReportingContext c, ITypeSymbol containingType, IObjectCreation objectCreation)\n        {\n            // DSACryptoServiceProvider is always noncompliant as it has a max key size of 1024\n            // RSACryptoServiceProvider() and RSACryptoServiceProvider(System.Security.Cryptography.CspParameters) constructors are noncompliants as they have a default key size of 1024\n            if (containingType.Is(KnownType.System_Security_Cryptography_DSACryptoServiceProvider)\n                || (containingType.Is(KnownType.System_Security_Cryptography_RSACryptoServiceProvider) && HasDefaultSize(c, objectCreation.ArgumentList)))\n            {\n                c.ReportIssue(Rule, objectCreation.Expression, MinimalCommonKeyLength.ToString(), CipherName(containingType), string.Empty);\n            }\n            else\n            {\n                var firstParam = objectCreation.ArgumentList.Get(0);\n                CheckGenericDsaRsaCryptographyAlgorithms(c, containingType, objectCreation.Expression, firstParam);\n            }\n        }\n\n        private static bool HasDefaultSize(SonarSyntaxNodeReportingContext c, ArgumentListSyntax argumentList) =>\n            argumentList == null\n            || argumentList.Arguments.Count == 0\n            || (argumentList.Arguments.Count == 1\n                && c.Model.GetTypeInfo(argumentList.Arguments[0].Expression).Type is ITypeSymbol type\n                && type.Is(KnownType.System_Security_Cryptography_CspParameters));\n\n        private static void CheckGenericDsaRsaCryptographyAlgorithms(SonarSyntaxNodeReportingContext c, ITypeSymbol containingType, SyntaxNode syntaxElement, SyntaxNode keyLengthSyntax)\n        {\n            if (containingType.DerivesFromAny(SystemSecurityCryptographyDsaRsa) && keyLengthSyntax != null && IsInvalidCommonKeyLength(c, keyLengthSyntax))\n            {\n                c.ReportIssue(Rule, syntaxElement, MinimalCommonKeyLength.ToString(), CipherName(containingType), string.Empty);\n            }\n        }\n\n        private static void CheckBouncyCastleParametersGenerators(SonarSyntaxNodeReportingContext c, ITypeSymbol containingType, InvocationExpressionSyntax invocation)\n        {\n            if (invocation.ArgumentList.Get(0) is { } firstParam\n                && containingType != null\n                && containingType.IsAny(KnownType.Org_BouncyCastle_Crypto_Generators_DHParametersGenerator, KnownType.Org_BouncyCastle_Crypto_Generators_DsaParametersGenerator)\n                && IsInvalidCommonKeyLength(c, firstParam))\n            {\n                var cipherAlgorithmName = containingType.Is(KnownType.Org_BouncyCastle_Crypto_Generators_DHParametersGenerator) ? \"DH\" : \"DSA\";\n                c.ReportIssue(Rule, invocation, MinimalCommonKeyLength.ToString(), cipherAlgorithmName, string.Empty);\n            }\n        }\n\n        private static void CheckBouncyCastleKeyGenerationParameters(SonarSyntaxNodeReportingContext c, ITypeSymbol containingType, IObjectCreation objectCreation)\n        {\n            if (objectCreation.ArgumentList.Get(2) is { } keyLengthParam\n                && containingType.Is(KnownType.Org_BouncyCastle_Crypto_Parameters_RsaKeyGenerationParameters)\n                && IsInvalidCommonKeyLength(c, keyLengthParam))\n            {\n                c.ReportIssue(Rule, objectCreation.Expression, MinimalCommonKeyLength.ToString(), \"RSA\", string.Empty);\n            }\n        }\n\n        private static bool IsInvalidCommonKeyLength(SonarSyntaxNodeReportingContext c, SyntaxNode keyLengthSyntax) =>\n            keyLengthSyntax.FindConstantValue(c.Model) is int keyLength && keyLength < MinimalCommonKeyLength;\n\n        private static string GetMethodName(InvocationExpressionSyntax invocationExpression) =>\n            invocationExpression.Expression.GetIdentifier()?.ValueText;\n\n        private static string GetPropertyName(ExpressionSyntax expression) =>\n            expression.GetIdentifier() is { } nameSyntax ? nameSyntax.ValueText : null;\n\n        private static string CipherName(ITypeSymbol containingType) =>\n            containingType.Is(KnownType.System_Security_Cryptography_DSA) || containingType.DerivesFrom(KnownType.System_Security_Cryptography_DSA) ? \"DSA\" : \"RSA\";\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DangerousGetHandleShouldNotBeCalled.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class DangerousGetHandleShouldNotBeCalled : DangerousGetHandleShouldNotBeCalledBase<SyntaxKind, InvocationExpressionSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DatabasePasswordsShouldBeSecure.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\nusing System.Text.RegularExpressions;\nusing System.Xml.Linq;\nusing System.Xml.XPath;\nusing SonarAnalyzer.Core.Json;\nusing SonarAnalyzer.Core.Json.Parsing;\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class DatabasePasswordsShouldBeSecure : TrackerHotspotDiagnosticAnalyzer<SyntaxKind>\n    {\n        private const string DiagnosticId = \"S2115\";\n        private const string MessageFormat = \"Use a secure password when connecting to this database.\";\n\n        private static readonly Regex Sanitizers = new(@\"((integrated[_\\s]security)|(trusted[_\\s]connection))=(sspi|yes|true)\",\n            RegexOptions.Compiled | RegexOptions.IgnoreCase, Constants.DefaultRegexTimeout);\n\n        private static readonly MemberDescriptor[] TrackedInvocations =\n        {\n            new MemberDescriptor(KnownType.Microsoft_EntityFrameworkCore_DbContextOptionsBuilder, \"UseSqlServer\"),\n            new MemberDescriptor(KnownType.Microsoft_EntityFrameworkCore_SqlServerDbContextOptionsExtensions, \"UseSqlServer\"),\n            new MemberDescriptor(KnownType.Microsoft_EntityFrameworkCore_DbContextOptionsBuilder, \"UseMySQL\"),\n            new MemberDescriptor(KnownType.Microsoft_EntityFrameworkCore_MySQLDbContextOptionsExtensions, \"UseMySQL\"),\n            new MemberDescriptor(KnownType.Microsoft_EntityFrameworkCore_DbContextOptionsBuilder, \"UseSqlite\"),\n            new MemberDescriptor(KnownType.Microsoft_EntityFrameworkCore_SqliteDbContextOptionsBuilderExtensions, \"UseSqlite\"),\n            new MemberDescriptor(KnownType.Microsoft_EntityFrameworkCore_DbContextOptionsBuilder, \"UseOracle\"),\n            new MemberDescriptor(KnownType.Microsoft_EntityFrameworkCore_OracleDbContextOptionsExtensions, \"UseOracle\"),\n            // for UseNpgsql,the namespaces are different in .NET Core 3.1 and .NET 5\n            new MemberDescriptor(KnownType.Microsoft_EntityFrameworkCore_DbContextOptionsBuilder, \"UseNpgsql\"),\n            new MemberDescriptor(KnownType.Microsoft_EntityFrameworkCore_NpgsqlDbContextOptionsExtensions, \"UseNpgsql\"),\n            new MemberDescriptor(KnownType.Microsoft_EntityFrameworkCore_NpgsqlDbContextOptionsBuilderExtensions, \"UseNpgsql\"),\n        };\n\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n        public DatabasePasswordsShouldBeSecure()\n            : base(AnalyzerConfiguration.AlwaysEnabled, DiagnosticId, MessageFormat) { }\n\n        protected override void Initialize(TrackerInput input)\n        {\n            var inv = Language.Tracker.Invocation;\n            inv.Track(input, inv.MatchMethod(TrackedInvocations), HasEmptyPasswordArgument());\n        }\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            base.Initialize(context);\n            context.RegisterCompilationAction(CheckWebConfig);\n            context.RegisterCompilationAction(CheckAppSettings);\n        }\n\n        private void CheckWebConfig(SonarCompilationReportingContext c)\n        {\n            foreach (var fullPath in c.WebConfigFiles())\n            {\n                var webConfig = File.ReadAllText(fullPath);\n                if (webConfig.Contains(\"<connectionStrings>\") && webConfig.ParseXDocument() is { } doc)\n                {\n                    ReportEmptyPassword(c, doc, fullPath);\n                }\n            }\n        }\n\n        private void CheckAppSettings(SonarCompilationReportingContext c)\n        {\n            foreach (var fullPath in c.AppSettingsFiles())\n            {\n                CheckAppSettingJson(c, fullPath);\n            }\n        }\n\n        private void CheckAppSettingJson(SonarCompilationReportingContext c, string fullPath)\n        {\n            var appSettings = File.ReadAllText(fullPath);\n            if (appSettings.Contains(\"\\\"ConnectionStrings\\\"\") && JsonNode.FromString(appSettings) is { } json)\n            {\n                ReportEmptyPassword(c, json, fullPath);\n            }\n        }\n\n        private void ReportEmptyPassword(SonarCompilationReportingContext c, XDocument doc, string webConfigPath)\n        {\n            foreach (var addAttribute in doc.XPathSelectElements(\"configuration/connectionStrings/add\"))\n            {\n                if (addAttribute.Attribute(\"connectionString\") is { } connectionString\n                    && IsVulnerable(connectionString.Value)\n                    && !HasSanitizers(connectionString.Value)\n                    && connectionString.CreateLocation(webConfigPath) is { } location)\n                {\n                    c.ReportIssue(Rule, location);\n                }\n            }\n        }\n\n        private void ReportEmptyPassword(SonarCompilationReportingContext c, JsonNode doc, string appSettingsPath)\n        {\n            if (doc.TryGetPropertyNode(\"ConnectionStrings\", out var connectionStrings) && connectionStrings.Kind == Kind.Object)\n            {\n                foreach (var key in connectionStrings.Keys)\n                {\n                    if (connectionStrings[key] is { Kind: Kind.Value, Value: string value } connectionStringNode && IsVulnerable(value))\n                    {\n                        c.ReportIssue(Rule, connectionStringNode.ToLocation(appSettingsPath));\n                    }\n                }\n            }\n        }\n\n        private static TrackerBase<SyntaxKind, InvocationContext>.Condition HasEmptyPasswordArgument() =>\n            context =>\n            {\n                var argumentList = ((InvocationExpressionSyntax)context.Node).ArgumentList.Arguments;\n                return ConnectionStringArgument(argumentList)?.Expression switch\n                {\n                    LiteralExpressionSyntax literal => IsVulnerable(literal.Token.ValueText) && !HasSanitizers(literal.Token.ValueText),\n                    InterpolatedStringExpressionSyntax interpolatedString => HasEmptyPasswordAndNoSanitizers(interpolatedString),\n                    BinaryExpressionSyntax binaryExpression => HasEmptyPasswordAndNoSanitizers(binaryExpression),\n                    _ => false\n                };\n            };\n\n        // First search a named argument, then search literals, then fallback on the first argument (for constant propagation check).\n        // This is an easy way to support explicit extension method invocation.\n        private static ArgumentSyntax ConnectionStringArgument(SeparatedSyntaxList<ArgumentSyntax> argumentList) =>\n            // Where(cond).First() is more efficient than First(cond)\n            argumentList.Where(a => a.NameColon?.Name.Identifier.ValueText == \"connectionString\").FirstOrDefault()\n                ?? argumentList.Where(x => x.Expression.Kind() is\n                    SyntaxKind.StringLiteralExpression or SyntaxKind.InterpolatedStringExpression or SyntaxKind.AddExpression)\n                    .FirstOrDefault()\n                ?? argumentList.FirstOrDefault();\n\n        // For both interpolated strings and concatenation chain, it's easier to search in the string representation of the tree, rather than doing string searches for each individual\n        // string token inside.\n        private static bool HasEmptyPasswordAndNoSanitizers(ExpressionSyntax expression)\n        {\n            var toString = expression.ToString();\n            return IsVulnerable(toString) && !HasSanitizers(toString);\n        }\n\n        private static bool IsVulnerable(string connectionString) =>\n            connectionString.EndsWith(\"Password=\")\n            || connectionString.Contains(\"Password=;\")\n            // this is an edge case, for a string interpolation or concatenation the toString() will contain the ending \"\n            // we prefer to keep it like this for the simplicity of the implementation\n            || connectionString.EndsWith(\"Password=\\\"\")\n            // raw string literals\n            || connectionString.EndsWith(\"Password=\\\"\\\"\\\"\");\n\n        private static bool HasSanitizers(string connectionString) =>\n            Sanitizers.SafeIsMatch(connectionString);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DateAndTimeShouldNotBeUsedasTypeForPrimaryKey.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class DateAndTimeShouldNotBeUsedAsTypeForPrimaryKey : DateAndTimeShouldNotBeUsedasTypeForPrimaryKeyBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override IEnumerable<SyntaxNode> TypeNodesOfTemporalKeyProperties(SonarSyntaxNodeReportingContext context)\n    {\n        var classDeclaration = (ClassDeclarationSyntax)context.Node;\n        if (classDeclaration.Modifiers.Any(x => x.IsKind(SyntaxKind.StaticKeyword)))\n        {\n            return Enumerable.Empty<SyntaxNode>();\n        }\n\n        var className = classDeclaration.Identifier.ValueText;\n        return classDeclaration.Members\n            .OfType<PropertyDeclarationSyntax>()\n            .Where(x => IsCandidateProperty(x)\n                        && IsTemporalType(x.Type.GetName())\n                        && IsKeyProperty(x, className))\n            .Select(x => x.Type);\n    }\n\n    private static bool IsCandidateProperty(PropertyDeclarationSyntax property) =>\n        property.Modifiers.Any(x => x.IsKind(SyntaxKind.PublicKeyword))\n        && !property.Modifiers.Any(x => x.IsKind(SyntaxKind.StaticKeyword))\n        && property.AccessorList is { } accessorList\n        && accessorList.Accessors.Any(x => x.Keyword.IsKind(SyntaxKind.GetKeyword))\n        && accessorList.Accessors.Any(x => x.Keyword.IsKind(SyntaxKind.SetKeyword));\n\n    private bool IsKeyProperty(PropertyDeclarationSyntax property, string className)\n    {\n        var propertyName = property.Identifier.ValueText;\n        return IsKeyPropertyBasedOnName(propertyName, className)\n            || HasKeyAttribute(property);\n    }\n\n    private bool HasKeyAttribute(PropertyDeclarationSyntax property) =>\n        property.AttributeLists\n            .SelectMany(x => x.Attributes)\n            .Any(x => MatchesAttributeName(x.GetName(), KeyAttributeTypeNames));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DateTimeFormatShouldNotBeHardcoded.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class DateTimeFormatShouldNotBeHardcoded : DateTimeFormatShouldNotBeHardcodedBase<SyntaxKind, InvocationExpressionSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override Location HardCodedArgumentLocation(InvocationExpressionSyntax invocation) =>\n        invocation.ArgumentList.Arguments[0].Expression.GetLocation();\n\n    protected override bool HasInvalidFirstArgument(InvocationExpressionSyntax invocation, SemanticModel semanticModel) =>\n        invocation.ArgumentList is { }\n        && invocation.ArgumentList.Arguments.Any()\n        && GetFormatArgumentExpression(invocation.ArgumentList) is { } argumentExpression\n        && argumentExpression.FindConstantValue(semanticModel) is string { Length: > 1 };\n\n    private static ExpressionSyntax GetFormatArgumentExpression(ArgumentListSyntax argumentList) =>\n        (argumentList.GetArgumentByName(\"format\") ?? argumentList.Arguments[0]).Expression;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DeadStores.RoslynCfg.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CFG.LiveVariableAnalysis;\nusing SonarAnalyzer.CFG.Roslyn;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    public partial class DeadStores : SonarDiagnosticAnalyzer\n    {\n        private class RoslynChecker : CheckerBase<ControlFlowGraph, BasicBlock>\n        {\n            private readonly RoslynLiveVariableAnalysis lva;\n\n            public RoslynChecker(SonarSyntaxNodeReportingContext context, RoslynLiveVariableAnalysis lva) : base(context, lva) =>\n                this.lva = lva;\n\n            protected override State CreateState(BasicBlock block) =>\n                new RoslynState(this, block);\n\n            private class RoslynState : State\n            {\n                private readonly RoslynChecker owner;\n\n                public RoslynState(RoslynChecker owner, BasicBlock block) : base(owner, block) =>\n                    this.owner = owner;\n\n                public override void AnalyzeBlock()\n                {\n                    foreach (var operation in block.OperationsAndBranchValue.ToReversedExecutionOrder().Select(x => x.Instance))\n                    {\n                        switch (operation.Kind)\n                        {\n                            case OperationKindEx.LocalReference:\n                                ProcessParameterOrLocalReference(ILocalReferenceOperationWrapper.FromOperation(operation));\n                                break;\n                            case OperationKindEx.ParameterReference:\n                                ProcessParameterOrLocalReference(IParameterReferenceOperationWrapper.FromOperation(operation));\n                                break;\n                            case OperationKindEx.SimpleAssignment:\n                                ProcessSimpleAssignment(ISimpleAssignmentOperationWrapper.FromOperation(operation));\n                                break;\n                            case OperationKindEx.CompoundAssignment:\n                                ProcessCompoundAssignment(ICompoundAssignmentOperationWrapper.FromOperation(operation));\n                                break;\n                            case OperationKindEx.DeconstructionAssignment:\n                                ProcessDeconstructionAssignment(IDeconstructionAssignmentOperationWrapper.FromOperation(operation));\n                                break;\n                            case OperationKindEx.Increment:\n                            case OperationKindEx.Decrement:\n                                ProcessIncrementOrDecrement(IIncrementOrDecrementOperationWrapper.FromOperation(operation));\n                                break;\n                        }\n                    }\n                }\n\n                private void ProcessParameterOrLocalReference(IOperationWrapper reference)\n                {\n                    var symbols = owner.lva.ParameterOrLocalSymbols(reference.WrappedOperation).Where(x => IsSymbolRelevant(x));\n                    if (reference.IsOutArgument())\n                    {\n                        liveOut.ExceptWith(symbols);\n                    }\n                    else if (!reference.IsAssignmentTarget() && !reference.IsCompoundAssignmentTarget())\n                    {\n                        liveOut.UnionWith(symbols);\n                    }\n                }\n\n                private void ProcessSimpleAssignment(ISimpleAssignmentOperationWrapper assignment)\n                {\n                    var targets = ProcessAssignment(assignment, assignment.Target, assignment.Value);\n                    liveOut.ExceptWith(targets);\n                }\n\n                private void ProcessCompoundAssignment(ICompoundAssignmentOperationWrapper assignment) =>\n                    ProcessAssignment(assignment, assignment.Target);\n\n                private void ProcessIncrementOrDecrement(IIncrementOrDecrementOperationWrapper incrementOrDecrement) =>\n                    ProcessAssignment(incrementOrDecrement, incrementOrDecrement.Target);\n\n                private void ProcessDeconstructionAssignment(IDeconstructionAssignmentOperationWrapper deconstructionAssignment)\n                {\n                    if (ITupleOperationWrapper.IsInstance(deconstructionAssignment.Target))\n                    {\n                        foreach (var tupleElement in ITupleOperationWrapper.FromOperation(deconstructionAssignment.Target).AllElements())\n                        {\n                            var targets = ProcessAssignment(deconstructionAssignment, tupleElement);\n                            liveOut.ExceptWith(targets);\n                        }\n                    }\n                }\n\n                private ISymbol[] ProcessAssignment(IOperationWrapper operation, IOperation target, IOperation value = null)\n                {\n                    var targets = owner.lva.ParameterOrLocalSymbols(target).Where(IsSymbolRelevant).ToArray();\n                    foreach (var localTarget in targets)\n                    {\n                        if (TargetRefKind(localTarget) == RefKind.None\n                            && !IsConst(localTarget)\n                            && !liveOut.Contains(localTarget)\n                            && !IsAllowedInitialization(localTarget)\n                            && !ICaughtExceptionOperationWrapper.IsInstance(value)\n                            && !target.Syntax.Parent.IsKind(SyntaxKind.ForEachStatement)\n                            && !IsMuted(target.Syntax, localTarget))\n                        {\n                            ReportIssue(operation.WrappedOperation.Syntax.GetLocation(), localTarget);\n                        }\n                    }\n                    return targets;\n\n                    static bool IsConst(ISymbol localTarget) =>\n                        localTarget is ILocalSymbol local && local.IsConst;\n\n                    static RefKind TargetRefKind(ISymbol localTarget) =>\n                        // Only ILocalSymbol and IParameterSymbol can be returned by ParameterOrLocalSymbol\n                        localTarget is ILocalSymbol local ? local.RefKind() : ((IParameterSymbol)localTarget).RefKind;\n\n                    bool IsAllowedInitialization(ISymbol localTarget) =>\n                        operation.WrappedOperation.Syntax is VariableDeclaratorSyntax variableDeclarator\n                        && variableDeclarator.Initializer != null\n                        // Avoid collision with S1481: Unused is allowed. Used only in local function is also unused in current CFG.\n                        && (IsAllowedInitializationValue(variableDeclarator.Initializer.Value, value == null ? default : value.ConstantValue) || IsUnusedInCurrentCfg(localTarget, target));\n                }\n\n                private bool IsUnusedInCurrentCfg(ISymbol symbol, IOperation exceptTarget)\n                {\n                    return !owner.lva.Cfg.Blocks.SelectMany(x => x.OperationsAndBranchValue).ToExecutionOrder().Any(IsUsed);\n\n                    bool IsUsed(IOperationWrapperSonar wrapper) =>\n                        wrapper.Instance != exceptTarget\n                        && wrapper.Instance.Kind == OperationKindEx.LocalReference\n                        && ILocalReferenceOperationWrapper.FromOperation(wrapper.Instance).Local.Equals(symbol);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DeadStores.SonarCfg.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Text;\nusing SonarAnalyzer.CFG.Sonar;\nusing SonarAnalyzer.CSharp.Core.LiveVariableAnalysis;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    public partial class DeadStores : SonarDiagnosticAnalyzer\n    {\n        private class SonarChecker : CheckerBase<IControlFlowGraph, Block>\n        {\n            private readonly SyntaxNode node;\n\n            public SonarChecker(SonarSyntaxNodeReportingContext context, SonarCSharpLiveVariableAnalysis lva, SyntaxNode node) : base(context, lva) =>\n                this.node = node;\n\n            protected override State CreateState(Block block) =>\n                new SonarState(this, block, node);\n\n            private class SonarState : State\n            {\n                private readonly ISet<SyntaxNode> assignmentLhs = new HashSet<SyntaxNode>();\n                private readonly SyntaxNode node;\n\n                public SonarState(SonarChecker owner, Block block, SyntaxNode node) : base(owner, block) =>\n                    this.node = node;\n\n                public override void AnalyzeBlock()\n                {\n                    foreach (var instruction in block.Instructions.Reverse())\n                    {\n                        switch (instruction.Kind())\n                        {\n                            case SyntaxKind.IdentifierName:\n                                ProcessIdentifier(instruction);\n                                break;\n\n                            case SyntaxKind.AddAssignmentExpression:\n                            case SyntaxKind.SubtractAssignmentExpression:\n                            case SyntaxKind.MultiplyAssignmentExpression:\n                            case SyntaxKind.DivideAssignmentExpression:\n                            case SyntaxKind.ModuloAssignmentExpression:\n                            case SyntaxKind.AndAssignmentExpression:\n                            case SyntaxKind.ExclusiveOrAssignmentExpression:\n                            case SyntaxKind.OrAssignmentExpression:\n                            case SyntaxKind.LeftShiftAssignmentExpression:\n                            case SyntaxKind.RightShiftAssignmentExpression:\n                            case SyntaxKindEx.CoalesceAssignmentExpression:\n                                ProcessOpAssignment(instruction);\n                                break;\n\n                            case SyntaxKind.SimpleAssignmentExpression:\n                                ProcessSimpleAssignment(instruction);\n                                break;\n\n                            case SyntaxKind.VariableDeclarator:\n                                ProcessVariableDeclarator(instruction);\n                                break;\n\n                            case SyntaxKind.PreIncrementExpression:\n                            case SyntaxKind.PreDecrementExpression:\n                                ProcessPrefixExpression(instruction);\n                                break;\n\n                            case SyntaxKind.PostIncrementExpression:\n                            case SyntaxKind.PostDecrementExpression:\n                                ProcessPostfixExpression(instruction);\n                                break;\n                        }\n                    }\n                }\n\n                private void ProcessIdentifier(SyntaxNode instruction)\n                {\n                    var identifier = (IdentifierNameSyntax)instruction;\n                    var symbol = Model.GetSymbolInfo(identifier).Symbol;\n                    if (IsSymbolRelevant(symbol)\n                        && !identifier.GetSelfOrTopParenthesizedExpression().IsInNameOfArgument(Model)\n                        && IsLocal(symbol))\n                    {\n                        if (SonarCSharpLiveVariableAnalysis.IsOutArgument(identifier))\n                        {\n                            liveOut.Remove(symbol);\n                        }\n                        else if (!assignmentLhs.Contains(identifier))\n                        {\n                            liveOut.Add(symbol);\n                        }\n                    }\n                }\n\n                private void ProcessOpAssignment(SyntaxNode instruction)\n                {\n                    var assignment = (AssignmentExpressionSyntax)instruction;\n                    var left = assignment.Left.RemoveParentheses();\n                    if (IdentifierRelevantSymbol(left) is { } symbol)\n                    {\n                        ReportOnAssignment(assignment, left, symbol);\n                    }\n                }\n\n                private void ProcessSimpleAssignment(SyntaxNode instruction)\n                {\n                    var assignment = (AssignmentExpressionSyntax)instruction;\n                    var left = assignment.Left.RemoveParentheses();\n                    if (IdentifierRelevantSymbol(left) is { } symbol)\n                    {\n                        ReportOnAssignment(assignment, left, symbol);\n                        liveOut.Remove(symbol);\n                    }\n                }\n\n                private void ProcessVariableDeclarator(SyntaxNode instruction)\n                {\n                    var declarator = (VariableDeclaratorSyntax)instruction;\n                    if (Model.GetDeclaredSymbol(declarator) is ILocalSymbol symbol && IsSymbolRelevant(symbol))\n                    {\n                        if (declarator.Initializer != null\n                            && !IsAllowedInitializationValue(declarator.Initializer.Value)\n                            && !symbol.IsConst\n                            && symbol.RefKind() == RefKind.None\n                            && !liveOut.Contains(symbol)\n                            && !IsUnusedLocal(symbol)\n                            && !IsMuted(declarator, symbol))\n                        {\n                            var location = GetFirstLineLocationFromToken(declarator.Initializer.EqualsToken, declarator.Initializer);\n                            ReportIssue(location, symbol);\n                        }\n                        liveOut.Remove(symbol);\n                    }\n                }\n\n                private bool IsUnusedLocal(ISymbol declaredSymbol) =>\n                    node.DescendantNodes()\n                        .OfType<IdentifierNameSyntax>()\n                        .SelectMany(x => Model.GetSymbolInfo(x).AllSymbols())\n                        .All(x => !x.Equals(declaredSymbol));\n\n                private void ProcessPrefixExpression(SyntaxNode instruction)\n                {\n                    var prefixExpression = (PrefixUnaryExpressionSyntax)instruction;\n                    var parent = prefixExpression.GetSelfOrTopParenthesizedExpression();\n                    var operand = prefixExpression.Operand.RemoveParentheses();\n                    if (parent.Parent is ExpressionStatementSyntax\n                        && IdentifierRelevantSymbol(operand) is { } symbol\n                        && IsLocal(symbol)\n                        && !liveOut.Contains(symbol)\n                        && !IsMuted(operand))\n                    {\n                        ReportIssue(prefixExpression.GetLocation(), symbol);\n                    }\n                }\n\n                private void ProcessPostfixExpression(SyntaxNode instruction)\n                {\n                    var postfixExpression = (PostfixUnaryExpressionSyntax)instruction;\n                    var operand = postfixExpression.Operand.RemoveParentheses();\n                    if (IdentifierRelevantSymbol(operand) is { } symbol\n                        && IsLocal(symbol)\n                        && !liveOut.Contains(symbol)\n                        && !IsMuted(operand))\n                    {\n                        ReportIssue(postfixExpression.GetLocation(), symbol);\n                    }\n                }\n\n                private void ReportOnAssignment(AssignmentExpressionSyntax assignment, ExpressionSyntax left, ISymbol symbol)\n                {\n                    if (IsLocal(symbol)\n                        && !liveOut.Contains(symbol)\n                        && !IsMuted(left))\n                    {\n                        var location = GetFirstLineLocationFromToken(assignment.OperatorToken, assignment.Right);\n                        ReportIssue(location, symbol);\n                    }\n\n                    assignmentLhs.Add(left);\n                }\n\n                private bool IsMuted(SyntaxNode node) =>\n                    new MutedSyntaxWalker(Model, node).IsMuted();\n\n                private static Location GetFirstLineLocationFromToken(SyntaxToken issueStartToken, SyntaxNode wholeIssue)\n                {\n                    var line = wholeIssue.SyntaxTree.GetText().Lines[issueStartToken.GetLocation().StartLine()];\n                    var rightSingleLine = line.Span.Intersection(TextSpan.FromBounds(issueStartToken.SpanStart, wholeIssue.Span.End));\n                    return Location.Create(wholeIssue.SyntaxTree, TextSpan.FromBounds(issueStartToken.SpanStart, rightSingleLine.HasValue ? rightSingleLine.Value.End : issueStartToken.Span.End));\n                }\n\n                private ISymbol IdentifierRelevantSymbol(SyntaxNode node) =>\n                    node.IsKind(SyntaxKind.IdentifierName)\n                    && Model.GetSymbolInfo(node).Symbol is { } symbol\n                    && IsSymbolRelevant(symbol)\n                    ? symbol\n                    : null;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DeadStores.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CFG.LiveVariableAnalysis;\nusing SonarAnalyzer.CFG.Sonar;\nusing SonarAnalyzer.CSharp.Core.LiveVariableAnalysis;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed partial class DeadStores : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S1854\";\n    private const string MessageFormat = \"Remove this useless assignment to local variable '{0}'.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n    private static readonly string[] AllowedNumericValues = [\"-1\", \"0\", \"1\"];\n    private static readonly string[] AllowedStringValues = [string.Empty];\n\n    private static readonly TypeSpecificDefaultValue[] TypeSpecificDefaultValues =\n    [\n        new(KnownType.System_IntPtr, nameof(IntPtr.Zero)),\n        new(KnownType.System_UIntPtr, nameof(UIntPtr.Zero)),\n        new(KnownType.System_Guid, nameof(Guid.Empty)),\n    ];\n    private readonly bool useSonarCfg;\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    public DeadStores() : this(AnalyzerConfiguration.AlwaysEnabled) { }\n\n    internal /* for testing */ DeadStores(IAnalyzerConfiguration configuration) =>\n        useSonarCfg = configuration.UseSonarCfg();\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        // No need to check for ExpressionBody as it can't contain variable assignment\n        context.RegisterNodeAction(\n            c => CheckForDeadStores(c, c.Model.GetDeclaredSymbol(c.Node)),\n            SyntaxKind.AddAccessorDeclaration,\n            SyntaxKind.ConstructorDeclaration,\n            SyntaxKind.ConversionOperatorDeclaration,\n            SyntaxKind.DestructorDeclaration,\n            SyntaxKind.GetAccessorDeclaration,\n            SyntaxKind.MethodDeclaration,\n            SyntaxKind.OperatorDeclaration,\n            SyntaxKind.RemoveAccessorDeclaration,\n            SyntaxKind.SetAccessorDeclaration,\n            SyntaxKindEx.CoalesceAssignmentExpression,\n            SyntaxKindEx.InitAccessorDeclaration,\n            SyntaxKindEx.LocalFunctionStatement);\n\n        context.RegisterNodeAction(\n            c => CheckForDeadStores(c, c.Model.GetSymbolInfo(c.Node).Symbol),\n            SyntaxKind.AnonymousMethodExpression,\n            SyntaxKind.ParenthesizedLambdaExpression,\n            SyntaxKind.SimpleLambdaExpression);\n    }\n\n    private void CheckForDeadStores(SonarSyntaxNodeReportingContext context, ISymbol symbol)\n    {\n        if (symbol is not null)\n        {\n            if (useSonarCfg)\n            {\n                // Tuple expressions are not supported. See https://github.com/SonarSource/sonar-dotnet/issues/3094\n                if (!context.Node.DescendantNodes().AnyOfKind(SyntaxKindEx.TupleExpression) && CSharpControlFlowGraph.TryGet(context.Node, context.Model, out var cfg))\n                {\n                    var lva = new SonarCSharpLiveVariableAnalysis(cfg, symbol, context.Model, context.Cancel);\n                    var checker = new SonarChecker(context, lva, context.Node);\n                    checker.Analyze(cfg.Blocks);\n                }\n            }\n            else if (context.Node.CreateCfg(context.Model, context.Cancel) is { } cfg)\n            {\n                var lva = new RoslynLiveVariableAnalysis(cfg, CSharpSyntaxClassifier.Instance, context.Cancel);\n                var checker = new RoslynChecker(context, lva);\n                checker.Analyze(cfg.Blocks);\n            }\n        }\n    }\n\n    private abstract class CheckerBase<TCfg, TBlock>\n    {\n        private readonly LiveVariableAnalysisBase<TCfg, TBlock> lva;\n        private readonly SonarSyntaxNodeReportingContext context;\n        private readonly ISet<ISymbol> capturedVariables;\n\n        protected abstract State CreateState(TBlock block);\n\n        protected CheckerBase(SonarSyntaxNodeReportingContext context, LiveVariableAnalysisBase<TCfg, TBlock> lva)\n        {\n            this.context = context;\n            this.lva = lva;\n            capturedVariables = lva.CapturedVariables.ToHashSet();\n        }\n\n        public void Analyze(IEnumerable<TBlock> blocks)\n        {\n            foreach (var block in blocks)\n            {\n                var state = CreateState(block);\n                state.AnalyzeBlock();\n            }\n        }\n\n        protected bool IsLocal(ISymbol symbol) =>\n            lva.IsLocal(symbol);\n\n        protected abstract class State\n        {\n            protected readonly TBlock block;\n            protected readonly ISet<ISymbol> liveOut;\n            private readonly CheckerBase<TCfg, TBlock> owner;\n\n            public abstract void AnalyzeBlock();\n\n            protected SemanticModel Model => owner.context.Model;\n\n            protected State(CheckerBase<TCfg, TBlock> owner, TBlock block)\n            {\n                this.owner = owner;\n                this.block = block;\n                liveOut = new HashSet<ISymbol>(owner.lva.LiveOut(block));\n            }\n\n            protected void ReportIssue(Location location, ISymbol symbol) =>\n                owner.context.ReportIssue(Rule, location, symbol.Name);\n\n            protected bool IsSymbolRelevant(ISymbol symbol) =>\n                symbol is not null && !owner.capturedVariables.Contains(symbol);\n\n            protected bool IsLocal(ISymbol symbol) =>\n                owner.IsLocal(symbol);\n\n            protected bool IsAllowedInitializationValue(ExpressionSyntax value, Optional<object> constantValue = default) =>\n                (constantValue.HasValue && IsAllowedInitializationConstant(constantValue.Value, value.IsKind(SyntaxKind.IdentifierName)))\n                || value?.Kind() is SyntaxKind.DefaultExpression or SyntaxKind.TrueLiteralExpression or SyntaxKind.FalseLiteralExpression\n                || value.IsNullLiteral()\n                || value.IsDefaultLiteral()\n                || IsAllowedNumericInitialization(value)\n                || IsAllowedUnaryNumericInitialization(value)\n                || IsAllowedStringInitialization(value)\n                || IsTypeSpecificDefaultValue(value);\n\n            protected bool IsMuted(SyntaxNode node, ISymbol symbol) =>\n                new MutedSyntaxWalker(Model, node, symbol).IsMuted();\n\n            private static bool IsAllowedInitializationConstant(object constant, bool isIdentifier) =>\n                constant is null || (isIdentifier && IsAllowedInitializationConstantIdentifier(constant));\n\n            private static bool IsAllowedInitializationConstantIdentifier(object constant) =>\n                constant is string str ? AllowedStringValues.Contains(str) : AllowedNumericValues.Contains(constant.ToString());\n\n            private static bool IsAllowedNumericInitialization(ExpressionSyntax expression) =>\n                expression.IsKind(SyntaxKind.NumericLiteralExpression) && AllowedNumericValues.Contains(((LiteralExpressionSyntax)expression).Token.ValueText);  // -1, 0 or 1\n\n            private static bool IsAllowedUnaryNumericInitialization(ExpressionSyntax expression) =>\n                expression?.Kind() is SyntaxKind.UnaryPlusExpression or SyntaxKind.UnaryMinusExpression\n                && IsAllowedNumericInitialization(((PrefixUnaryExpressionSyntax)expression).Operand);\n\n            private bool IsAllowedStringInitialization(ExpressionSyntax expression) =>\n                (expression.IsKind(SyntaxKind.StringLiteralExpression) && AllowedStringValues.Contains(((LiteralExpressionSyntax)expression).Token.ValueText))\n                || (expression.IsKind(SyntaxKind.InterpolatedStringExpression) && ((InterpolatedStringExpressionSyntax)expression).Contents.Count == 0)\n                || expression.IsStringEmpty(Model);\n\n            private bool IsTypeSpecificDefaultValue(ExpressionSyntax expression) =>\n                expression is MemberAccessExpressionSyntax { } memberAccess\n                && Model.GetSymbolInfo(memberAccess.Name).Symbol is IFieldSymbol { IsStatic: true } field\n                && TypeSpecificDefaultValues.Any(x => x.Name == field.Name && field.ContainingType.Is(x.Type));\n        }\n    }\n\n    private sealed record TypeSpecificDefaultValue(KnownType Type, string Name);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DebugAssertHasNoSideEffects.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class DebugAssertHasNoSideEffects : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S3346\";\n        private const string MessageFormat = \"Expressions used in 'Debug.Assert' should not produce side effects.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        private static readonly ISet<string> sideEffectWords = new HashSet<string>\n        {\n            \"REMOVE\", \"DELETE\", \"PUT\", \"SET\", \"ADD\", \"POP\", \"UPDATE\", \"RETAIN\",\n            \"INSERT\", \"PUSH\", \"APPEND\", \"CLEAR\", \"DEQUEUE\", \"ENQUEUE\", \"DISPOSE\"\n        };\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n                {\n                    var invokedMethodSyntax = c.Node as InvocationExpressionSyntax;\n\n                    if (IsDebugAssert(c, invokedMethodSyntax)\n                        && ContainsCallsWithSideEffects(invokedMethodSyntax))\n                    {\n                        c.ReportIssue(rule, invokedMethodSyntax.ArgumentList);\n                    }\n                },\n                SyntaxKind.InvocationExpression);\n\n        private static string GetIdentifierName(InvocationExpressionSyntax invocation)\n        {\n\n            if (invocation.Expression is MemberAccessExpressionSyntax memberAccess)\n            {\n                return memberAccess.Name?.Identifier.ValueText;\n            }\n\n            var memberBinding = invocation.Expression as MemberBindingExpressionSyntax;\n            return memberBinding?.Name?.Identifier.ValueText;\n        }\n\n        private static bool IsDebugAssert(SonarSyntaxNodeReportingContext context, InvocationExpressionSyntax invocation) =>\n            invocation.Expression is MemberAccessExpressionSyntax memberAccess\n            && memberAccess.Name.Identifier.ValueText == nameof(System.Diagnostics.Debug.Assert)\n            && context.Model.GetSymbolInfo(invocation).Symbol is IMethodSymbol symbol\n            && symbol.IsDebugAssert();\n\n        private static bool ContainsCallsWithSideEffects(InvocationExpressionSyntax invocation) =>\n            invocation.DescendantNodes()\n                .OfType<InvocationExpressionSyntax>()\n                .Select(GetIdentifierName)\n                .Any(name => !string.IsNullOrEmpty(name)\n                        && name != \"SetEquals\"\n                        && sideEffectWords.Contains(name.SplitCamelCaseToWords().First()));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DebuggerDisplayUsesExistingMembers.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Shared.Extensions;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class DebuggerDisplayUsesExistingMembers : DebuggerDisplayUsesExistingMembersBase<AttributeArgumentSyntax, SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override SyntaxNode AttributeTarget(AttributeArgumentSyntax attribute) =>\n        attribute.GetAncestor<AttributeListSyntax>()?.Parent;\n\n    protected override ImmutableArray<SyntaxNode> ResolvableIdentifiers(SyntaxNode expression)\n    {\n        return expression.DescendantNodesAndSelf().Any(x => x.Kind() is SyntaxKindEx.SingleVariableDesignation)\n            ? ImmutableArray<SyntaxNode>.Empty // A variable was declared inside the expression. This would result in FPs and needs more advanced handling.\n            : MostLeftIdentifier(expression);\n\n        static ImmutableArray<SyntaxNode> MostLeftIdentifier(SyntaxNode node) =>\n            node is ExpressionSyntax expression\n            ? expression.ExtractMemberIdentifier().Select(x => x.LeftMostInMemberAccess()).OfType<IdentifierNameSyntax>().ToImmutableArray<SyntaxNode>()\n            : ImmutableArray<SyntaxNode>.Empty;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DeclareEventHandlersCorrectly.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class DeclareEventHandlersCorrectly : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S3906\";\n        private const string MessageFormat = \"Change the signature of that event handler to match the specified signature.\";\n        private const int SenderArgumentPosition = 0;\n        private const int EventArgsPosition = 1;\n        private const int DelegateEventHandlerArgCount = 2;\n\n        private static readonly DiagnosticDescriptor Rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n               c => AnalyzeEventType(c, ((EventFieldDeclarationSyntax)c.Node).Declaration.Type, c.ContainingSymbol),\n               SyntaxKind.EventFieldDeclaration);\n\n            context.RegisterNodeAction(\n               c => AnalyzeEventType(c, ((EventDeclarationSyntax)c.Node).Type, c.ContainingSymbol),\n               SyntaxKind.EventDeclaration);\n        }\n\n        private static void AnalyzeEventType(SonarSyntaxNodeReportingContext analysisContext, TypeSyntax typeSyntax, ISymbol eventSymbol)\n        {\n            if (!eventSymbol.IsOverride\n                && eventSymbol.InterfaceMembers().IsEmpty()\n                && analysisContext.Model.GetSymbolInfo(typeSyntax).Symbol is INamedTypeSymbol eventHandlerType\n                && eventHandlerType.DelegateInvokeMethod is { } methodSymbol\n                && !IsCorrectEventHandlerSignature(methodSymbol))\n            {\n                analysisContext.ReportIssue(Rule, typeSyntax);\n            }\n        }\n\n        private static bool IsCorrectEventHandlerSignature(IMethodSymbol methodSymbol) =>\n            methodSymbol is\n            {\n                ReturnsVoid: true,\n                Parameters: { Length: DelegateEventHandlerArgCount } parameters,\n            }\n            && parameters[SenderArgumentPosition] is\n            {\n                Name: \"sender\",\n                Type: { } senderType,\n            }\n            && senderType.Is(KnownType.System_Object)\n            && parameters[EventArgsPosition] is\n            {\n                Name: \"e\",\n                Type: { } eventArgsType,\n            }\n            && IsDerivedFromEventArgs(eventArgsType);\n\n        private static bool IsDerivedFromEventArgs(ITypeSymbol type) =>\n            type.DerivesFrom(KnownType.System_EventArgs)\n            || (type is ITypeParameterSymbol typeParameterSymbol\n                && typeParameterSymbol.ConstraintTypes.Any(IsDerivedFromEventArgs));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DeclareTypesInNamespaces.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class DeclareTypesInNamespaces : DeclareTypesInNamespacesBase<SyntaxKind>\n    {\n        private static readonly HashSet<SyntaxKind> InnerTypeKinds =\n            [\n                SyntaxKind.ClassDeclaration,\n                SyntaxKind.StructDeclaration,\n                SyntaxKind.NamespaceDeclaration,\n                SyntaxKind.InterfaceDeclaration,\n                SyntaxKindEx.RecordDeclaration,\n                SyntaxKindEx.RecordStructDeclaration,\n                SyntaxKindEx.FileScopedNamespaceDeclaration\n            ];\n\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n        protected override SyntaxKind[] SyntaxKinds { get; } =\n        {\n            SyntaxKind.ClassDeclaration,\n            SyntaxKind.StructDeclaration,\n            SyntaxKind.EnumDeclaration,\n            SyntaxKind.InterfaceDeclaration,\n            SyntaxKindEx.RecordDeclaration,\n            SyntaxKindEx.RecordStructDeclaration,\n        };\n\n        protected override SyntaxToken GetTypeIdentifier(SyntaxNode declaration) =>\n            ((BaseTypeDeclarationSyntax)declaration).Identifier;\n\n        protected override bool IsInnerTypeOrWithinNamespace(SyntaxNode declaration, SemanticModel semanticModel) =>\n            declaration.Parent.IsAnyKind(InnerTypeKinds);\n\n        protected override bool IsException(SyntaxNode node) =>\n            IsTopLevelStatementPartialProgramClass(node);\n\n        private static bool IsTopLevelStatementPartialProgramClass(SyntaxNode declaration) =>\n            declaration is ClassDeclarationSyntax { Identifier.Text: \"Program\" } classDeclaration\n            && classDeclaration.Modifiers.Any(SyntaxKind.PartialKeyword)\n            && declaration.Parent is CompilationUnitSyntax compilationUnit\n            && compilationUnit.IsTopLevelMain();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DefaultSectionShouldBeFirstOrLast.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class DefaultSectionShouldBeFirstOrLast : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S4524\";\n        private const string MessageFormat = \"Move this 'default:' case to the beginning or end of this 'switch' statement.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var switchSyntax = (SwitchStatementSyntax)c.Node;\n                    var defaultLabelSectionIndex = switchSyntax.GetDefaultLabelSectionIndex();\n\n                    if (defaultLabelSectionIndex > 0 &&                                 // default is not first...\n                        defaultLabelSectionIndex != (switchSyntax.Sections.Count -1))   // nor last\n                    {\n                        var defaultLabelLocation = switchSyntax.Sections[defaultLabelSectionIndex]\n                            .Labels\n                            .First(label => label.IsKind(SyntaxKind.DefaultSwitchLabel))\n                            .GetLocation();\n                        c.ReportIssue(rule, defaultLabelLocation);\n                    }\n                },\n                SyntaxKind.SwitchStatement);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DelegateSubtraction.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class DelegateSubtraction : SonarDiagnosticAnalyzer\n{\n    internal const string DiagnosticId = \"S3172\";\n    private const string MessageFormat = \"Review this subtraction of a chain of delegates: it may not work as you expect.\";\n\n    private static readonly DiagnosticDescriptor Rule =\n        DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(\n            c =>\n            {\n                var assignment = (AssignmentExpressionSyntax)c.Node;\n                if (!ExpressionIsSimple(assignment.Right) && IsDelegateSubtraction(assignment, c.Model))\n                {\n                    c.ReportIssue(Rule, assignment);\n                }\n            },\n            SyntaxKind.SubtractAssignmentExpression);\n\n        context.RegisterNodeAction(\n            c =>\n            {\n                var binary = (BinaryExpressionSyntax)c.Node;\n                if (IsTopLevelSubtraction(binary)\n                    && !BinaryIsValidSubstraction(binary)\n                    && IsDelegateSubtraction(binary, c.Model))\n                {\n                    c.ReportIssue(Rule, binary);\n                }\n            },\n            SyntaxKind.SubtractExpression);\n    }\n\n    private static bool BinaryIsValidSubstraction(BinaryExpressionSyntax subtraction)\n    {\n        var currentSubtraction = subtraction;\n\n        while (currentSubtraction is not null && currentSubtraction.IsKind(SyntaxKind.SubtractExpression))\n        {\n            if (!ExpressionIsSimple(currentSubtraction.Right))\n            {\n                return false;\n            }\n\n            currentSubtraction = currentSubtraction.Left as BinaryExpressionSyntax;\n        }\n        return true;\n    }\n\n    private static bool IsTopLevelSubtraction(BinaryExpressionSyntax subtraction) =>\n        subtraction.Parent is not BinaryExpressionSyntax parent || !parent.IsKind(SyntaxKind.SubtractExpression);\n\n    private static bool IsDelegateSubtraction(SyntaxNode node, SemanticModel semanticModel) =>\n        semanticModel.GetSymbolInfo(node).Symbol is IMethodSymbol subtractMethod\n        && subtractMethod.ReceiverType.Is(TypeKind.Delegate);\n\n    private static bool ExpressionIsSimple(ExpressionSyntax expression) =>\n        expression.RemoveParentheses() is IdentifierNameSyntax or MemberAccessExpressionSyntax;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DisposableMemberInNonDisposableClass.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class DisposableMemberInNonDisposableClass : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S2931\";\n        private const string MessageFormat = \"Implement 'IDisposable' in this class and use the 'Dispose' method to call 'Dispose' on {0}.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterSymbolAction(\n                c =>\n                {\n                    var namedType = (INamedTypeSymbol)c.Symbol;\n                    if (ShouldExclude(namedType))\n                    {\n                        return;\n                    }\n\n                    var message = GetMessage(c, namedType);\n                    if (string.IsNullOrEmpty(message))\n                    {\n                        return;\n                    }\n\n                    var typeDeclarations = new CSharpRemovableDeclarationCollector(namedType, c.Compilation).TypeDeclarations;\n                    foreach (var classDeclaration in typeDeclarations)\n                    {\n                        c.ReportIssue(Rule, classDeclaration.Node.Identifier, message);\n                    }\n                },\n                SymbolKind.NamedType);\n\n        private static bool ShouldExclude(ITypeSymbol typeSymbol) =>\n            !typeSymbol.IsClass()\n            || typeSymbol.Implements(KnownType.System_IDisposable)\n            || typeSymbol.Implements(KnownType.System_IAsyncDisposable);\n\n        private static string GetMessage(SonarSymbolReportingContext context, INamespaceOrTypeSymbol namedType)\n        {\n            var disposableFields = namedType.GetMembers()\n                                            .OfType<IFieldSymbol>()\n                                            .Where(fs => fs.IsNonStaticNonPublicDisposableField(context.Compilation.GetLanguageVersion()))\n                                            .ToHashSet();\n\n            if (disposableFields.Count == 0)\n            {\n                return string.Empty;\n            }\n\n            var otherInitializationsOfFields = namedType.GetMembers()\n                                                        .OfType<IMethodSymbol>()\n                                                        .SelectMany(m => GetAssignmentsToFieldsIn(m, context.Compilation))\n                                                        .Where(f => disposableFields.Contains(f));\n\n            return disposableFields.Where(IsOwnerSinceDeclaration)\n                                   .Union(otherInitializationsOfFields)\n                                   .Distinct()\n                                   .Select(symbol => $\"'{symbol.Name}'\")\n                                   .OrderBy(name => name)\n                                   .JoinAnd();\n        }\n\n        private static IEnumerable<IFieldSymbol> GetAssignmentsToFieldsIn(ISymbol m, Compilation compilation)\n        {\n            if (m.DeclaringSyntaxReferences.Length != 1\n                || !(m.DeclaringSyntaxReferences[0].GetSyntax() is BaseMethodDeclarationSyntax method)\n                || !method.HasBodyOrExpressionBody())\n            {\n                return Enumerable.Empty<IFieldSymbol>();\n            }\n\n            return method.GetBodyDescendantNodes()\n                         .OfType<AssignmentExpressionSyntax>()\n                         .Where(n => n.IsKind(SyntaxKind.SimpleAssignmentExpression) && n.Right is ObjectCreationExpressionSyntax)\n                         .Select(n => compilation.GetSemanticModel(method.SyntaxTree).GetSymbolInfo(n.Left).Symbol)\n                         .OfType<IFieldSymbol>();\n        }\n\n        private static bool IsOwnerSinceDeclaration(ISymbol symbol) =>\n            symbol.DeclaringSyntaxReferences.SingleOrDefault()?.GetSyntax() is VariableDeclaratorSyntax varDeclarator\n            && varDeclarator.Initializer?.Value is ObjectCreationExpressionSyntax;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DisposableNotDisposed.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class DisposableNotDisposed : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S2930\";\n        private const string MessageFormat = \"Dispose '{0}' when it is no longer needed.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        private static readonly ImmutableArray<KnownType> TrackedTypes =\n            ImmutableArray.Create(\n                KnownType.FluentAssertions_Execution_AssertionScope,\n                KnownType.System_Drawing_Image,\n                KnownType.System_Drawing_Bitmap,\n                KnownType.System_IO_FileStream,\n                KnownType.System_IO_StreamReader,\n                KnownType.System_IO_StreamWriter,\n                KnownType.System_Net_WebClient,\n                KnownType.System_Net_Sockets_TcpClient,\n                KnownType.System_Net_Sockets_UdpClient,\n                KnownType.System_Threading_CancellationTokenSource);\n\n        private static readonly ImmutableArray<KnownType> DisposableTypes = ImmutableArray.Create(KnownType.System_IDisposable, KnownType.System_IAsyncDisposable);\n\n        private static readonly ISet<string> DisposeMethods = new HashSet<string> { \"Dispose\", \"DisposeAsync\", \"Close\" };\n\n        private static readonly ISet<string> FactoryMethods = new HashSet<string>\n        {\n            \"System.IO.File.Create\",\n            \"System.IO.File.Open\",\n            \"System.Drawing.Image.FromFile\",\n            \"System.Drawing.Image.FromStream\",\n            \"System.Threading.CancellationTokenSource.CreateLinkedTokenSource\"\n        };\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterSymbolAction(\n                c =>\n                {\n                    var namedType = (INamedTypeSymbol)c.Symbol;\n                    if (namedType.ContainingType != null || !namedType.IsClassOrStruct())\n                    {\n                        return;\n                    }\n\n                    var typesDeclarationsAndSemanticModels = namedType.DeclaringSyntaxReferences\n                                                                            .Select(x => CreateNodeAndModel(c, x))\n                                                                            .ToList();\n\n                    var disposableObjects = new HashSet<NodeAndSymbol>();\n                    foreach (var typeDeclarationAndSemanticModel in typesDeclarationsAndSemanticModels)\n                    {\n                        TrackInitializedLocalsAndPrivateFields(\n                            namedType,\n                            typeDeclarationAndSemanticModel.Node,\n                            typeDeclarationAndSemanticModel.Model,\n                            disposableObjects);\n\n                        TrackAssignmentsToLocalsAndPrivateFields(\n                            namedType,\n                            typeDeclarationAndSemanticModel.Node,\n                            typeDeclarationAndSemanticModel.Model,\n                            disposableObjects);\n                    }\n\n                    if (disposableObjects.Any())\n                    {\n                        var possiblyDisposed = new HashSet<ISymbol>();\n                        foreach (var typeDeclarationAndSemanticModel in typesDeclarationsAndSemanticModels)\n                        {\n                            ExcludeDisposedAndClosedLocalsAndPrivateFields(\n                                typeDeclarationAndSemanticModel.Node,\n                                typeDeclarationAndSemanticModel.Model,\n                                possiblyDisposed);\n                            ExcludeReturnedPassedAndAliasedLocalsAndPrivateFields(\n                                typeDeclarationAndSemanticModel.Node,\n                                typeDeclarationAndSemanticModel.Model,\n                                possiblyDisposed);\n                        }\n\n                        foreach (var disposable in disposableObjects.Where(x => !possiblyDisposed.Contains(x.Symbol)))\n                        {\n                            c.ReportIssue(Rule, disposable.Node, disposable.Symbol.Name);\n                        }\n                    }\n                },\n                SymbolKind.NamedType);\n\n        private static NodeAndModel<SyntaxNode> CreateNodeAndModel(SonarSymbolReportingContext c, SyntaxReference syntaxReference) =>\n            new(syntaxReference.GetSyntax(), c.Compilation.GetSemanticModel(syntaxReference.SyntaxTree));\n\n        private static void TrackInitializedLocalsAndPrivateFields(INamedTypeSymbol namedType,\n                                                                   SyntaxNode typeDeclaration,\n                                                                   SemanticModel semanticModel,\n                                                                   ISet<NodeAndSymbol> disposableObjects)\n        {\n            var descendantNodes = GetDescendantNodes(namedType, typeDeclaration).ToList();\n            var localVariableDeclarations = descendantNodes.OfType<LocalDeclarationStatementSyntax>()\n                                                           .Where(x => !x.UsingKeyword.IsKind(SyntaxKind.UsingKeyword))\n                                                           .Select(x => x.Declaration);\n\n            var fieldVariableDeclarations = descendantNodes.OfType<FieldDeclarationSyntax>()\n                                                           .Where(x => !x.Modifiers.Any() || x.Modifiers.Any(SyntaxKind.PrivateKeyword))\n                                                           .Select(x => x.Declaration);\n\n            foreach (var declaration in localVariableDeclarations.Concat(fieldVariableDeclarations))\n            {\n                var trackedVariables = declaration.Variables.Where(x => x.Initializer != null && IsInstantiation(x.Initializer.Value, semanticModel));\n                foreach (var variableNode in trackedVariables)\n                {\n                    disposableObjects.Add(new NodeAndSymbol(variableNode, semanticModel.GetDeclaredSymbol(variableNode)));\n                }\n            }\n        }\n\n        private static void TrackAssignmentsToLocalsAndPrivateFields(INamedTypeSymbol namedType,\n                                                                     SyntaxNode typeDeclaration,\n                                                                     SemanticModel semanticModel,\n                                                                     ISet<NodeAndSymbol> disposableObjects)\n        {\n            var simpleAssignments = GetDescendantNodes(namedType, typeDeclaration).Where(n => n.IsKind(SyntaxKind.SimpleAssignmentExpression))\n                                                                                  .Cast<AssignmentExpressionSyntax>();\n\n            foreach (var simpleAssignment in simpleAssignments)\n            {\n                if (!IsNodeInsideUsingStatement(simpleAssignment)\n                    && IsInstantiation(simpleAssignment.Right, semanticModel)\n                    && semanticModel.GetSymbolInfo(simpleAssignment.Left).Symbol is { } referencedSymbol\n                    && IsLocalOrPrivateField(referencedSymbol))\n                {\n                    disposableObjects.Add(new NodeAndSymbol(simpleAssignment, referencedSymbol));\n                }\n            }\n        }\n\n        private static bool IsNodeInsideUsingStatement(SyntaxNode node)\n        {\n            var ancestors = node.AncestorsAndSelf().ToArray();\n\n            var isPartOfUsingStatement = ancestors\n                .OfType<UsingStatementSyntax>()\n                .Any(x => (x.Expression is not null && x.Expression.DescendantNodesAndSelf().Contains(node))\n                       || (x.Declaration is not null && x.Declaration.DescendantNodesAndSelf().Contains(node)));\n\n            var isPartOfUsingDeclaration = ancestors\n                .OfType<LocalDeclarationStatementSyntax>()\n                .Any(x => x.UsingKeyword != default);\n\n            return isPartOfUsingStatement || isPartOfUsingDeclaration;\n        }\n\n        private static IEnumerable<SyntaxNode> GetDescendantNodes(INamedTypeSymbol namedType, SyntaxNode typeDeclaration) =>\n            namedType.IsTopLevelProgram()\n                ? typeDeclaration.ChildNodes().OfType<GlobalStatementSyntax>().Select(x => x.ChildNodes().First())\n                : typeDeclaration.DescendantNodes();\n\n        private static bool IsLocalOrPrivateField(ISymbol symbol) =>\n            symbol.Kind == SymbolKind.Local\n            || (symbol.Kind == SymbolKind.Field && symbol.DeclaredAccessibility == Accessibility.Private);\n\n        private static void ExcludeDisposedAndClosedLocalsAndPrivateFields(SyntaxNode typeDeclaration, SemanticModel semanticModel, ISet<ISymbol> possiblyDisposed)\n        {\n            var invocationsAndConditionalAccesses = typeDeclaration.DescendantNodes().Where(x => x.Kind() is SyntaxKind.InvocationExpression or SyntaxKind.ConditionalAccessExpression);\n            foreach (var invocationOrConditionalAccess in invocationsAndConditionalAccesses)\n            {\n                SimpleNameSyntax name;\n                ExpressionSyntax expression;\n                if (invocationOrConditionalAccess is InvocationExpressionSyntax invocation)\n                {\n                    var memberAccessNode = invocation.Expression as MemberAccessExpressionSyntax;\n                    name = memberAccessNode?.Name;\n                    expression = memberAccessNode?.Expression;\n                }\n                else if (invocationOrConditionalAccess is ConditionalAccessExpressionSyntax conditionalAccess)\n                {\n                    name = ((conditionalAccess.WhenNotNull as InvocationExpressionSyntax)?.Expression as MemberBindingExpressionSyntax)?.Name;\n                    expression = conditionalAccess.Expression;\n                }\n                else\n                {\n                    throw new NotSupportedException(\"Syntax node should be either an invocation or a conditional access expression\");\n                }\n\n                if (name != null\n                    && (DisposeMethods.Contains(name.Identifier.Text) || IsNodeInsideUsingStatement(expression))\n                    && semanticModel.GetSymbolInfo(expression).Symbol is { } referencedSymbol\n                    && IsLocalOrPrivateField(referencedSymbol))\n                {\n                    possiblyDisposed.Add(referencedSymbol);\n                }\n            }\n        }\n\n        private static void ExcludeReturnedPassedAndAliasedLocalsAndPrivateFields(SyntaxNode typeDeclaration, SemanticModel semanticModel, ISet<ISymbol> possiblyDisposed)\n        {\n            var identifiersAndSimpleMemberAccesses = typeDeclaration\n                .DescendantNodes()\n                .Where(n => n.IsKind(SyntaxKind.IdentifierName) || n.IsKind(SyntaxKind.SimpleMemberAccessExpression));\n\n            foreach (var identifierOrSimpleMemberAccess in identifiersAndSimpleMemberAccesses)\n            {\n                ExpressionSyntax expression;\n                if (identifierOrSimpleMemberAccess.IsKind(SyntaxKind.IdentifierName))\n                {\n                    expression = (IdentifierNameSyntax)identifierOrSimpleMemberAccess;\n                }\n                else if (identifierOrSimpleMemberAccess.IsKind(SyntaxKind.SimpleMemberAccessExpression))\n                {\n                    var memberAccess = (MemberAccessExpressionSyntax)identifierOrSimpleMemberAccess;\n                    if (memberAccess.Expression.IsKind(SyntaxKind.ThisExpression))\n                    {\n                        expression = memberAccess;\n                    }\n                    else\n                    {\n                        continue;\n                    }\n                }\n                else\n                {\n                    throw new NotSupportedException(\"Syntax node should be either an identifier or a simple member access expression\");\n                }\n\n                if (IsStandaloneExpression(expression)\n                    && semanticModel.GetSymbolInfo(identifierOrSimpleMemberAccess).Symbol is { } referencedSymbol\n                    && IsLocalOrPrivateField(referencedSymbol))\n                {\n                    possiblyDisposed.Add(referencedSymbol);\n                }\n            }\n        }\n\n        private static bool IsStandaloneExpression(ExpressionSyntax expression) =>\n            !(expression.Parent is ExpressionSyntax)\n            || (expression.Parent is AssignmentExpressionSyntax parentAsAssignment && ReferenceEquals(expression, parentAsAssignment.Right));\n\n        private static bool IsInstantiation(ExpressionSyntax expression, SemanticModel model) =>\n            IsNewTrackedTypeObjectCreation(expression, model)\n            || IsDisposableRefStructCreation(expression, model)\n            || IsFactoryMethodInvocation(expression, model);\n\n        private static bool IsNewTrackedTypeObjectCreation(ExpressionSyntax expression, SemanticModel model) =>\n            expression?.Kind() is SyntaxKind.ObjectCreationExpression or SyntaxKindEx.ImplicitObjectCreationExpression\n            && model.GetTypeInfo(expression).Type is var type\n            && type.IsAny(TrackedTypes)\n            && model.GetSymbolInfo(expression).Symbol is IMethodSymbol constructor\n            && !constructor.Parameters.Any(x => x.Type.ImplementsAny(DisposableTypes));\n\n        private static bool IsDisposableRefStructCreation(ExpressionSyntax expression, SemanticModel model) =>\n            expression?.Kind() is SyntaxKind.ObjectCreationExpression or SyntaxKindEx.ImplicitObjectCreationExpression\n            && model.GetTypeInfo(expression).Type is var type\n            && type.IsRefStruct()\n            && type.GetMembers().OfType<IMethodSymbol>().Any(x => x.Name == \"Dispose\");\n\n        private static bool IsFactoryMethodInvocation(ExpressionSyntax expression, SemanticModel model) =>\n            expression is InvocationExpressionSyntax invocation\n            && model.GetSymbolInfo(invocation).Symbol is IMethodSymbol methodSymbol\n            && FactoryMethods.Contains(methodSymbol.ContainingType.ToDisplayString() + \".\" + methodSymbol.Name);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DisposableReturnedFromUsing.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class DisposableReturnedFromUsing : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S2997\";\n        private const string MessageFormat = \"Remove the 'using' statement; it will cause automatic disposal of {0}.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var usingStatement = (UsingStatementSyntax) c.Node;\n                    var declaration = usingStatement.Declaration;\n                    var symbolsDeclaredInUsing = new HashSet<ISymbol>();\n                    if (declaration != null)\n                    {\n                        symbolsDeclaredInUsing =\n                            declaration.Variables.Select(syntax => c.Model.GetDeclaredSymbol(syntax))\n                                .WhereNotNull()\n                                .ToHashSet();\n                    }\n                    else if (usingStatement.Expression is AssignmentExpressionSyntax assignment)\n                    {\n                        if (!(assignment.Left is IdentifierNameSyntax identifierName))\n                        {\n                            return;\n                        }\n                        var symbol = c.Model.GetSymbolInfo(identifierName).Symbol;\n                        if (symbol == null)\n                        {\n                            return;\n                        }\n                        symbolsDeclaredInUsing = new HashSet<ISymbol> { symbol };\n                    }\n\n                    CheckReturns(c, usingStatement.UsingKeyword, usingStatement.Statement, symbolsDeclaredInUsing);\n                },\n                SyntaxKind.UsingStatement);\n\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var localDeclarationStatement = (LocalDeclarationStatementSyntax)c.Node;\n                    var usingKeyword = localDeclarationStatement.UsingKeyword;\n                    if (!usingKeyword.IsKind(SyntaxKind.UsingKeyword))\n                    {\n                        return;\n                    }\n\n                    var declaredSymbols = localDeclarationStatement.Declaration.Variables\n                                .Select(syntax => c.Model.GetDeclaredSymbol(syntax))\n                                .WhereNotNull()\n                                .ToHashSet();\n\n                    CheckReturns(c, usingKeyword, localDeclarationStatement.Parent, declaredSymbols);\n                },\n                SyntaxKind.LocalDeclarationStatement);\n        }\n\n        private static void CheckReturns(SonarSyntaxNodeReportingContext c, SyntaxToken usingKeyword, SyntaxNode body, HashSet<ISymbol> declaredSymbols)\n        {\n            if (declaredSymbols.Count == 0)\n            {\n                return;\n            }\n\n            var returnedSymbols = GetReturnedSymbols(body, c.Model);\n            returnedSymbols.IntersectWith(declaredSymbols);\n\n            if (returnedSymbols.Any())\n            {\n                c.ReportIssue(rule, usingKeyword, returnedSymbols.Select(s => $\"'{s.Name}'\").OrderBy(s => s).JoinAnd());\n            }\n        }\n\n        private static ISet<ISymbol> GetReturnedSymbols(SyntaxNode body, SemanticModel semanticModel)\n        {\n            var enclosingSymbol = semanticModel.GetEnclosingSymbol(body.SpanStart);\n\n            return body.DescendantNodesAndSelf()\n                .OfType<ReturnStatementSyntax>()\n                .Where(ret => semanticModel.GetEnclosingSymbol(ret.SpanStart).Equals(enclosingSymbol))\n                .Select(ret => ret.Expression)\n                .OfType<IdentifierNameSyntax>()\n                .Select(identifier => semanticModel.GetSymbolInfo(identifier).Symbol)\n                .WhereNotNull()\n                .ToHashSet();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DisposableTypesNeedFinalizers.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class DisposableTypesNeedFinalizers : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S4002\";\n        private const string MessageFormat = \"Implement a finalizer that calls your 'Dispose' method.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        private static readonly ImmutableArray<KnownType> NativeHandles = ImmutableArray.Create(\n            KnownType.System_IntPtr,\n            KnownType.System_UIntPtr,\n            KnownType.System_Runtime_InteropServices_HandleRef);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n            {\n                var declaration = (TypeDeclarationSyntax)c.Node;\n                if (!c.IsRedundantPositionalRecordContext()\n                    && ((ITypeSymbol)c.ContainingSymbol).Implements(KnownType.System_IDisposable)\n                    && HasNativeHandleFields(declaration, c.Model)\n                    && !HasFinalizer(declaration))\n                {\n                    c.ReportIssue(Rule, declaration.Identifier);\n                }\n            },\n            SyntaxKind.ClassDeclaration,\n            SyntaxKindEx.RecordDeclaration);\n\n        private static bool HasNativeHandleFields(TypeDeclarationSyntax classDeclaration, SemanticModel semanticModel) =>\n            classDeclaration.Members\n                .OfType<FieldDeclarationSyntax>()\n                .Select(m => semanticModel.GetDeclaredSymbol(m.Declaration.Variables.FirstOrDefault())?.GetSymbolType())\n                .Any(si => si.IsAny(NativeHandles));\n\n        private static bool HasFinalizer(TypeDeclarationSyntax classDeclaration) =>\n            classDeclaration.Members.OfType<DestructorDeclarationSyntax>().Any();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DisposeFromDispose.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class DisposeFromDispose : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S2952\";\n        private const string MessageFormat = \"Move this 'Dispose' call into this class' own 'Dispose' method.\";\n\n        private const string DisposeMethodName = nameof(IDisposable.Dispose);\n        private const string DisposeMethodExplicitName = \"System.IDisposable.Dispose\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n            {\n                var invocation = (InvocationExpressionSyntax)c.Node;\n                var languageVersion = c.Compilation.GetLanguageVersion();\n                if (InvocationTargetAndName(invocation, out var fieldCandidate, out var name)\n                    && c.Model.GetSymbolInfo(fieldCandidate).Symbol is IFieldSymbol invocationTarget\n                    && invocationTarget.IsNonStaticNonPublicDisposableField(languageVersion)\n                    && IsDisposeMethodCalled(invocation, c.Model, languageVersion)\n                    && IsDisposableClassOrStruct(invocationTarget.ContainingType, languageVersion)\n                    && !IsCalledInsideDispose(invocation, c.Model)\n                    && FieldDeclaredInType(c.Model, invocation, invocationTarget)\n                    && !FieldDisposedInDispose(c.Model, invocationTarget))\n                {\n                    c.ReportIssue(Rule, name);\n                }\n            },\n            SyntaxKind.InvocationExpression);\n\n        private static bool FieldDisposedInDispose(SemanticModel model, IFieldSymbol invocationTarget) =>\n            invocationTarget.ContainingSymbol is ITypeSymbol container\n            && container.FindImplementationForInterfaceMember(IDisposableDisposeMethodSymbol(model.Compilation)) is IMethodSymbol dispose\n            && FieldIsDisposedIn(model, invocationTarget, dispose);\n\n        private static bool FieldIsDisposedIn(SemanticModel model, IFieldSymbol invocationTarget, IMethodSymbol dispose) =>\n            (dispose.PartialImplementationPart ?? dispose).DeclaringSyntaxReferences\n            .SelectMany(x => x.GetSyntax()\n                .DescendantNodesAndSelf(x =>\n                    !(x.Kind() is\n                        SyntaxKindEx.LocalFunctionStatement or\n                        SyntaxKind.ParenthesizedLambdaExpression or\n                        SyntaxKind.SimpleLambdaExpression or\n                        SyntaxKind.AnonymousMethodExpression))\n            .OfType<InvocationExpressionSyntax>())\n            .Any(x => InvocationTargetAndName(x, out var target, out var name)\n                && name.NameIs(DisposeMethodName)\n                && x.EnsureCorrectSemanticModelOrDefault(model) is { } correctModel\n                && correctModel.GetSymbolInfo(target).Symbol is IFieldSymbol field\n                && field.Equals(invocationTarget)\n                && correctModel.GetSymbolInfo(name).Symbol is IMethodSymbol invokedDispose\n                && invokedDispose.Equals(field.Type.FindImplementationForInterfaceMember(IDisposableDisposeMethodSymbol(correctModel.Compilation))));\n\n        private static bool FieldDeclaredInType(SemanticModel model, InvocationExpressionSyntax invocation, IFieldSymbol invocationTarget) =>\n            invocation.GetTopMostContainingMethod() is { } containingMethod\n            && containingMethod.EnsureCorrectSemanticModelOrDefault(model) is { } correctModel\n            && (correctModel.GetDeclaredSymbol(containingMethod)?.ContainingSymbol?.Equals(invocationTarget.ContainingType) ?? true);\n\n        private static bool InvocationTargetAndName(InvocationExpressionSyntax invocation, out ExpressionSyntax target, out SimpleNameSyntax name)\n        {\n            switch (invocation.Expression)\n            {\n                case MemberAccessExpressionSyntax memberAccess:\n                    name = memberAccess.Name;\n                    target = memberAccess.Expression;\n                    return true;\n                case MemberBindingExpressionSyntax memberBinding:\n                    name = memberBinding.Name;\n                    target = memberBinding.GetParentConditionalAccessExpression().Expression;\n                    return true;\n                default:\n                    target = null;\n                    name = null;\n                    return false;\n            }\n        }\n\n        /// <summary>\n        /// Classes and structs are disposable if they implement the IDisposable interface.\n        /// Starting C# 8, \"ref structs\" (which cannot implement an interface) can also be disposable.\n        /// </summary>\n        private static bool IsDisposableClassOrStruct(INamedTypeSymbol type, LanguageVersion languageVersion) =>\n            ImplementsDisposable(type) || type.IsDisposableRefStruct(languageVersion);\n\n        private static bool IsCalledInsideDispose(InvocationExpressionSyntax invocation, SemanticModel semanticModel) =>\n            semanticModel.GetEnclosingSymbol(invocation.SpanStart) is IMethodSymbol enclosingMethodSymbol\n            && IsMethodMatchingDisposeMethodName(enclosingMethodSymbol);\n\n        /// <summary>\n        /// Verifies that the invocation is calling the correct Dispose() method on an disposable object.\n        /// </summary>\n        /// <remarks>\n        /// Disposable ref structs do not implement the IDisposable interface and are supported starting C# 8.\n        /// </remarks>\n        private static bool IsDisposeMethodCalled(InvocationExpressionSyntax invocation, SemanticModel semanticModel, LanguageVersion languageVersion) =>\n            semanticModel.GetSymbolInfo(invocation).Symbol is IMethodSymbol methodSymbol\n            && KnownMethods.IsIDisposableDispose(methodSymbol)\n            && IDisposableDisposeMethodSymbol(semanticModel.Compilation) is { } disposeMethodSignature\n            && (methodSymbol.Equals(methodSymbol.ContainingType.FindImplementationForInterfaceMember(disposeMethodSignature))\n                || methodSymbol.ContainingType.IsDisposableRefStruct(languageVersion));\n\n        private static IMethodSymbol IDisposableDisposeMethodSymbol(Compilation compilation)\n            => compilation.SpecialTypeMethod(SpecialType.System_IDisposable, DisposeMethodName);\n\n        private static bool IsMethodMatchingDisposeMethodName(IMethodSymbol enclosingMethodSymbol) =>\n            enclosingMethodSymbol.Name == DisposeMethodName\n            || (enclosingMethodSymbol.ExplicitInterfaceImplementations.Any() && enclosingMethodSymbol.Name == DisposeMethodExplicitName);\n\n        private static bool ImplementsDisposable(INamedTypeSymbol containingType) =>\n            containingType.Implements(KnownType.System_IDisposable);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DisposeNotImplementingDispose.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class DisposeNotImplementingDispose : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S2953\";\n    private const string MessageFormat = \"Either implement 'IDisposable.Dispose', or totally rename this method to prevent confusion.\";\n    private const string DisposeMethodName = \"Dispose\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterSymbolAction(\n            c =>\n            {\n                var declaredSymbol = (INamedTypeSymbol)c.Symbol;\n\n                // ref structs and static classes cannot inherit from the IDisposable interface\n                if (declaredSymbol.IsRefStruct() || declaredSymbol.IsStatic || declaredSymbol.IsExtension)\n                {\n                    return;\n                }\n\n                var disposeMethod = c.Compilation.SpecialTypeMethod(SpecialType.System_IDisposable, \"Dispose\");\n                if (disposeMethod is null)\n                {\n                    return;\n                }\n\n                var mightImplementDispose = new HashSet<IMethodSymbol>();\n                var namedDispose = new HashSet<IMethodSymbol>();\n\n                var methods = declaredSymbol.GetMembers(DisposeMethodName).OfType<IMethodSymbol>();\n                foreach (var method in methods)\n                {\n                    CollectMethodsNamedAndImplementingDispose(method, disposeMethod, namedDispose, mightImplementDispose);\n                }\n\n                var disposeMethodsCalledFromDispose = new HashSet<IMethodSymbol>();\n                CollectInvocationsFromDisposeImplementation(disposeMethod, c.Compilation, mightImplementDispose, disposeMethodsCalledFromDispose);\n\n                ReportDisposeMethods(c, namedDispose.Except(mightImplementDispose).Where(m => !disposeMethodsCalledFromDispose.Contains(m)));\n            },\n            SymbolKind.NamedType);\n\n    private static void CollectInvocationsFromDisposeImplementation(IMethodSymbol disposeMethod,\n                                                                    Compilation compilation,\n                                                                    HashSet<IMethodSymbol> mightImplementDispose,\n                                                                    HashSet<IMethodSymbol> disposeMethodsCalledFromDispose)\n    {\n        foreach (var method in mightImplementDispose\n            .Where(x => MethodIsDisposeImplementation(x, disposeMethod)))\n        {\n            var methodDeclarations = method.DeclaringSyntaxReferences\n                .Select(x => new NodeAndModel<MethodDeclarationSyntax>(x.GetSyntax() as MethodDeclarationSyntax, compilation.GetSemanticModel(x.SyntaxTree)))\n                .Where(x => x.Node is not null);\n\n            var methodDeclaration = methodDeclarations.FirstOrDefault(x => x.Node.HasBodyOrExpressionBody());\n            if (methodDeclaration == default)\n            {\n                continue;\n            }\n\n            var invocations = methodDeclaration.Node.DescendantNodes().OfType<InvocationExpressionSyntax>();\n            foreach (var invocation in invocations)\n            {\n                CollectDisposeMethodsCalledFromDispose(invocation, methodDeclaration.Model, disposeMethodsCalledFromDispose);\n            }\n        }\n    }\n\n    private static void CollectDisposeMethodsCalledFromDispose(InvocationExpressionSyntax invocationExpression,\n                                                               SemanticModel model,\n                                                               HashSet<IMethodSymbol> disposeMethodsCalledFromDispose)\n    {\n        if (!invocationExpression.IsOnThis())\n        {\n            return;\n        }\n\n        if (model.GetSymbolInfo(invocationExpression).Symbol is not IMethodSymbol invokedMethod || invokedMethod.Name != DisposeMethodName)\n        {\n            return;\n        }\n\n        disposeMethodsCalledFromDispose.Add(invokedMethod);\n    }\n\n    private static void ReportDisposeMethods(SonarSymbolReportingContext context, IEnumerable<IMethodSymbol> disposeMethods)\n    {\n        foreach (var disposeMethod in disposeMethods)\n        {\n            foreach (var location in disposeMethod.Locations)\n            {\n                context.ReportIssue(Rule, location, disposeMethod.PartialImplementationPart?.Locations.ToSecondary() ?? []);\n            }\n        }\n    }\n\n    private static void CollectMethodsNamedAndImplementingDispose(IMethodSymbol methodSymbol,\n                                                                  IMethodSymbol disposeMethod,\n                                                                  HashSet<IMethodSymbol> namedDispose,\n                                                                  HashSet<IMethodSymbol> mightImplementDispose)\n    {\n        if (methodSymbol.Name != DisposeMethodName)\n        {\n            return;\n        }\n\n        namedDispose.Add(methodSymbol);\n\n        if (methodSymbol.IsOverride\n            || MethodIsDisposeImplementation(methodSymbol, disposeMethod)\n            || MethodMightImplementDispose(methodSymbol))\n        {\n            mightImplementDispose.Add(methodSymbol);\n        }\n    }\n\n    private static bool MethodIsDisposeImplementation(IMethodSymbol methodSymbol, IMethodSymbol disposeMethod) =>\n        methodSymbol.Equals(methodSymbol.ContainingType.FindImplementationForInterfaceMember(disposeMethod));\n\n    private static bool MethodMightImplementDispose(IMethodSymbol declaredMethodSymbol)\n    {\n        var containingType = declaredMethodSymbol.ContainingType;\n\n        if (containingType.BaseType is { Kind: SymbolKind.ErrorType })\n        {\n            return true;\n        }\n\n        var interfaces = containingType.AllInterfaces;\n        foreach (var @interface in interfaces)\n        {\n            if (@interface.Kind == SymbolKind.ErrorType)\n            {\n                return true;\n            }\n\n            var interfaceMethods = @interface.GetMembers().OfType<IMethodSymbol>();\n            if (interfaceMethods.Any(x => declaredMethodSymbol.Equals(containingType.FindImplementationForInterfaceMember(x))))\n            {\n                return true;\n            }\n        }\n        return false;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DoNotCallAssemblyGetExecutingAssemblyMethod.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class DoNotCallAssemblyGetExecutingAssemblyMethod : DoNotCallMethodsCSharpBase\n    {\n        private const string DiagnosticId = \"S3902\";\n\n        protected override string MessageFormat => \"Replace this call to 'Assembly.GetExecutingAssembly()' with 'Type.Assembly'.\";\n\n        protected override IEnumerable<MemberDescriptor> CheckedMethods { get; } = new List<MemberDescriptor>\n        {\n            new(KnownType.System_Reflection_Assembly, \"GetExecutingAssembly\")\n        };\n\n        public DoNotCallAssemblyGetExecutingAssemblyMethod() : base(DiagnosticId) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DoNotCallAssemblyLoadInvalidMethods.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class DoNotCallAssemblyLoadInvalidMethods : DoNotCallMethodsCSharpBase\n{\n    private const string DiagnosticId = \"S3885\";\n\n    private static readonly HashSet<SyntaxKind> EventHandlerSyntaxes =\n    [\n        SyntaxKind.MethodDeclaration,\n        SyntaxKind.ParenthesizedLambdaExpression,\n        SyntaxKind.AnonymousMethodExpression,\n        SyntaxKindEx.LocalFunctionStatement\n    ];\n\n    protected override string MessageFormat => \"Replace this call to '{0}' with 'Assembly.Load'.\";\n\n    protected override IEnumerable<MemberDescriptor> CheckedMethods { get; } = new List<MemberDescriptor>\n    {\n        new(KnownType.System_Reflection_Assembly, \"LoadFrom\"),\n        new(KnownType.System_Reflection_Assembly, \"LoadFile\"),\n        new(KnownType.System_Reflection_Assembly, \"LoadWithPartialName\")\n    };\n\n    public DoNotCallAssemblyLoadInvalidMethods() : base(DiagnosticId) { }\n\n    protected override bool IsInValidContext(InvocationExpressionSyntax invocationSyntax, SemanticModel semanticModel) =>\n        !IsInResolutionHandler(invocationSyntax, semanticModel);\n\n    // Checks if the invocation is inside an event handler for the AppDomain.AssemblyResolve event.\n    // This check creates FN for the other Resolution events:\n    // AppDomain.TypeResolve, AppDomain.ResourceResolve, AppDomain.ReflectionOnlyAssemblyResolve.\n    // https://learn.microsoft.com/en-us/dotnet/api/system.resolveeventargs\n    private static bool IsInResolutionHandler(InvocationExpressionSyntax invocationSyntax, SemanticModel model) =>\n        invocationSyntax\n            .AncestorsAndSelf()\n            .Any(x => x.IsAnyKind(EventHandlerSyntaxes)\n                        && (model.GetSymbolInfo(x).Symbol ?? model.GetDeclaredSymbol(x)) is IMethodSymbol methodSymbol\n                        && methodSymbol.IsEventHandler()\n                        && methodSymbol.Parameters[1].Type.Is(KnownType.System_ResolveEventArgs));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DoNotCallExitMethods.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class DoNotCallExitMethods : DoNotCallMethodsCSharpBase\n    {\n        private const string DiagnosticId = \"S1147\";\n        protected override string MessageFormat => \"Remove this call to '{0}' or ensure it is really required.\";\n\n        protected override IEnumerable<MemberDescriptor> CheckedMethods { get; } = new List<MemberDescriptor>\n        {\n            new(KnownType.System_Environment, \"Exit\"),\n            new(KnownType.System_Windows_Forms_Application, \"Exit\")\n        };\n\n        public DoNotCallExitMethods() : base(DiagnosticId) { }\n\n        protected override bool IsInValidContext(InvocationExpressionSyntax invocationSyntax, SemanticModel semanticModel) =>\n            // Do not report if call is inside Main or is a TopLevelStatement.\n            invocationSyntax.Ancestors().OfType<GlobalStatementSyntax>().Any()\n                ? invocationSyntax.Ancestors()\n                      .Any(x => x?.Kind() is\n                        SyntaxKindEx.LocalFunctionStatement\n                        or SyntaxKind.ParenthesizedLambdaExpression\n                        or SyntaxKind.SimpleLambdaExpression\n                        or SyntaxKind.AnonymousMethodExpression)\n                : !invocationSyntax.Ancestors().OfType<BaseMethodDeclarationSyntax>().Where(x => x.GetIdentifierOrDefault()?.ValueText == \"Main\")\n                      .Select(m => semanticModel.GetDeclaredSymbol(m))\n                      .Select(s => s.IsMainMethod())\n                      .FirstOrDefault();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DoNotCallGCCollectMethod.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class DoNotCallGCCollectMethod : DoNotCallMethodsCSharpBase\n{\n    private const string DiagnosticId = \"S1215\";\n\n    protected override string MessageFormat => \"Refactor the code to remove this use of '{0}'.\";\n\n    protected override IEnumerable<MemberDescriptor> CheckedMethods { get; } =\n    [\n        new(KnownType.System_GC, nameof(GC.Collect)),\n        new(KnownType.System_GC, nameof(GC.GetTotalMemory)),\n    ];\n\n    public DoNotCallGCCollectMethod() : base(DiagnosticId) { }\n\n    protected override bool ShouldReportOnMethodCall(InvocationExpressionSyntax invocation, SemanticModel semanticModel, MemberDescriptor memberDescriptor) =>\n        !IsGetTotalMemoryFalse(memberDescriptor, invocation); // Do not report on GC.TotalMemory(false)\n\n    private static bool IsGetTotalMemoryFalse(MemberDescriptor memberDescriptor, InvocationExpressionSyntax invocation) =>\n        memberDescriptor.Name is nameof(GC.GetTotalMemory)\n        && invocation.ArgumentList.Arguments.FirstOrDefault() is { } argument\n        && argument.Expression.IsKind(SyntaxKind.FalseLiteralExpression);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DoNotCallGCSuppressFinalize.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class DoNotCallGCSuppressFinalize : DoNotCallMethodsCSharpBase\n    {\n        private const string DiagnosticId = \"S3971\";\n\n        protected override string MessageFormat => \"Do not call 'GC.SuppressFinalize'.\";\n\n        protected override IEnumerable<MemberDescriptor> CheckedMethods { get; } = new List<MemberDescriptor>\n        {\n            new(KnownType.System_GC, \"SuppressFinalize\")\n        };\n\n        public DoNotCallGCSuppressFinalize() : base(DiagnosticId) { }\n\n        protected override bool ShouldReportOnMethodCall(InvocationExpressionSyntax invocation, SemanticModel semanticModel, MemberDescriptor memberDescriptor)\n        {\n            if (invocation.FirstAncestorOrSelf<MethodDeclarationSyntax>() is not { } methodDeclaration\n                || (methodDeclaration.Identifier.ValueText != \"Dispose\"\n                    && methodDeclaration.Identifier.ValueText != \"DisposeAsync\"))\n            {\n                // We want to report on all calls not made from a method\n                return true;\n            }\n\n            return semanticModel.GetDeclaredSymbol(methodDeclaration) is var methodSymbol\n                   && !methodSymbol.IsIDisposableDispose()\n                   && !methodSymbol.IsIAsyncDisposableDisposeAsync();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DoNotCallMethodsCsharpBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\npublic abstract class DoNotCallMethodsCSharpBase : DoNotCallMethodsBase<SyntaxKind, InvocationExpressionSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected DoNotCallMethodsCSharpBase(string diagnosticId) : base(diagnosticId) { }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DoNotCatchNullReferenceException.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class DoNotCatchNullReferenceException : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S1696\";\n        private const string MessageFormat = \"Do not catch NullReferenceException; test for null instead.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var catchClause = (CatchClauseSyntax)c.Node;\n                    if (IsCatchingNullReferenceException(catchClause.Declaration, c.Model))\n                    {\n                        c.ReportIssue(rule, catchClause.Declaration.Type);\n                        return;\n                    }\n\n                    if (HasIsNullReferenceExceptionFilter(catchClause.Filter, c.Model, out var locationToReportOn))\n                    {\n                        c.ReportIssue(rule, locationToReportOn);\n                    }\n                },\n                SyntaxKind.CatchClause);\n        }\n\n        private static bool IsCatchingNullReferenceException(CatchDeclarationSyntax catchDeclaration,\n            SemanticModel semanticModel)\n        {\n            var caughtTypeSyntax = catchDeclaration?.Type;\n            return caughtTypeSyntax != null &&\n                   semanticModel.GetTypeInfo(caughtTypeSyntax).Type.Is(KnownType.System_NullReferenceException);\n        }\n\n        private static bool HasIsNullReferenceExceptionFilter(CatchFilterClauseSyntax catchFilterClause,\n            SemanticModel semanticModel, out Location location)\n        {\n            var whenExpression = catchFilterClause?.FilterExpression.RemoveParentheses();\n\n            var rightSideOfIsExpression = whenExpression != null && whenExpression.IsKind(SyntaxKind.IsExpression)\n                ? ((BinaryExpressionSyntax)whenExpression).Right\n                : null;\n\n            if (rightSideOfIsExpression != null &&\n                semanticModel.GetTypeInfo(rightSideOfIsExpression).Type.Is(KnownType.System_NullReferenceException))\n            {\n                location = rightSideOfIsExpression.GetLocation();\n                return true;\n            }\n\n            location = null;\n            return false;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DoNotCatchSystemException.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class DoNotCatchSystemException : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S2221\";\n        private const string MessageFormat = \"Catch a list of specific exception subtype or use exception filters instead.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n                {\n                    var catchClause = (CatchClauseSyntax)c.Node;\n\n                    if (c.AzureFunctionMethod() is null\n                        && IsCatchClauseEmptyOrNotPattern(catchClause)\n                        && IsSystemException(catchClause.Declaration, c.Model)\n                        && !IsThrowTheLastStatementInTheBlock(catchClause.Block))\n                    {\n                        c.ReportIssue(Rule, GetLocation(catchClause));\n                    }\n                },\n                SyntaxKind.CatchClause);\n\n        private static bool IsCatchClauseEmptyOrNotPattern(CatchClauseSyntax catchClause) =>\n            catchClause.Filter?.FilterExpression == null\n             || (catchClause.Filter.FilterExpression.IsKind(SyntaxKindEx.IsPatternExpression)\n                 && (IsPatternExpressionSyntaxWrapper)catchClause.Filter.FilterExpression is var patternExpression\n                 && patternExpression.SyntaxNode.DescendantNodes().AnyOfKind(SyntaxKindEx.NotPattern));\n\n        private static bool IsSystemException(CatchDeclarationSyntax catchDeclaration, SemanticModel semanticModel)\n        {\n            var caughtTypeSyntax = catchDeclaration?.Type;\n            return caughtTypeSyntax == null || semanticModel.GetTypeInfo(caughtTypeSyntax).Type.Is(KnownType.System_Exception);\n        }\n\n        private static bool IsThrowTheLastStatementInTheBlock(BlockSyntax block)\n        {\n            var lastStatement = block?.DescendantNodes()?.LastOrDefault();\n            return lastStatement != null && lastStatement.AncestorsAndSelf().TakeWhile(x => !Equals(x, block)).Any(x => x is ThrowStatementSyntax);\n        }\n\n        private static Location GetLocation(CatchClauseSyntax catchClause) =>\n            catchClause.Declaration?.Type != null\n                ? catchClause.Declaration.Type.GetLocation()\n                : catchClause.CatchKeyword.GetLocation();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DoNotCheckZeroSizeCollection.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Comparison = SonarAnalyzer.Core.Syntax.Utilities.ComparisonKind;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class DoNotCheckZeroSizeCollection : DoNotCheckZeroSizeCollectionBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n        protected override string IEnumerableTString => \"IEnumerable<T>\";\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            base.Initialize(context);\n            context.RegisterNodeAction(AnalyzeIsPatternExpression, SyntaxKindEx.IsPatternExpression);\n            context.RegisterNodeAction(AnalyzeSwitchExpression, SyntaxKindEx.SwitchExpression);\n            context.RegisterNodeAction(AnalyzeSwitchStatement, SyntaxKind.SwitchStatement);\n            context.RegisterNodeAction(AnalyzePropertyPatternClause, SyntaxKindEx.PropertyPatternClause);\n        }\n\n        private void AnalyzePropertyPatternClause(SonarSyntaxNodeReportingContext c)\n        {\n            var propertyPatternClause = (PropertyPatternClauseSyntaxWrapper)c.Node;\n\n            foreach (var subPattern in propertyPatternClause.Subpatterns)\n            {\n                if (subPattern.ExpressionColon.SyntaxNode is NameColonSyntax nameColon)\n                {\n                    CheckPatternCondition(c, nameColon.Name, subPattern.Pattern.SyntaxNode.RemoveParentheses());\n                }\n                else if (ExpressionColonSyntaxWrapper.IsInstance(subPattern.ExpressionColon.SyntaxNode)\n                         && (ExpressionColonSyntaxWrapper)subPattern.ExpressionColon.SyntaxNode is var expressionColon)\n                {\n                    CheckPatternCondition(c, expressionColon.Expression, subPattern.Pattern.SyntaxNode.RemoveParentheses());\n                }\n            }\n        }\n\n        private void AnalyzePatterns(SonarSyntaxNodeReportingContext c, ExpressionSyntax expression, SyntaxNode pattern)\n        {\n            foreach (var pair in expression.MapToPattern(pattern))\n            {\n                CheckPatternCondition(c, pair.Key, pair.Value);\n            }\n        }\n\n        private void AnalyzeIsPatternExpression(SonarSyntaxNodeReportingContext c)\n        {\n            var isPatternExpression = (IsPatternExpressionSyntaxWrapper)c.Node;\n            AnalyzePatterns(c, isPatternExpression.Expression, isPatternExpression.Pattern);\n        }\n\n        private void AnalyzeSwitchExpression(SonarSyntaxNodeReportingContext c)\n        {\n            var switchExpression = (SwitchExpressionSyntaxWrapper)c.Node;\n\n            foreach (var arm in switchExpression.Arms)\n            {\n                AnalyzePatterns(c, switchExpression.GoverningExpression, arm.Pattern.SyntaxNode);\n            }\n        }\n\n        private void AnalyzeSwitchStatement(SonarSyntaxNodeReportingContext c)\n        {\n            var switchStatement = (SwitchStatementSyntax)c.Node;\n            foreach (var section in switchStatement.Sections)\n            {\n                foreach (var label in section.Labels)\n                {\n                    AnalyzePatterns(c, switchStatement.Expression, label);\n                }\n            }\n        }\n\n        private void CheckPatternCondition(SonarSyntaxNodeReportingContext context, SyntaxNode expression, SyntaxNode pattern)\n        {\n            if (pattern.DescendantNodesAndSelf().FirstOrDefault(x => x.IsKind(SyntaxKindEx.RelationalPattern)) is { } relationalPatternNode\n                && ((RelationalPatternSyntaxWrapper)relationalPatternNode) is var relationalPattern\n                && relationalPattern.OperatorToken.ToComparisonKind() is { } comparison\n                && comparison != Comparison.None\n                && Language.ExpressionNumericConverter.ConstantIntValue(context.Model, relationalPattern.Expression) is { } constant)\n            {\n                CheckExpression(context, relationalPattern.SyntaxNode, expression, constant, comparison);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DoNotCopyArraysInProperties.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class DoNotCopyArraysInProperties : SonarDiagnosticAnalyzer\n{\n    internal const string DiagnosticId = \"S2365\";\n    private const string MessageFormat = \"Refactor '{0}' into a method, properties should not copy collections.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    private static readonly ImmutableArray<KnownType> CopyingCollectionTypes = ImmutableArray.Create(\n        KnownType.System_Collections_Generic_Dictionary_TKey_TValue,\n        KnownType.System_Collections_Generic_HashSet_T,\n        KnownType.System_Collections_Generic_LinkedList_T,\n        KnownType.System_Collections_Generic_List_T,\n        KnownType.System_Collections_Generic_Queue_T,\n        KnownType.System_Collections_Generic_SortedDictionary_TKey_TValue,\n        KnownType.System_Collections_Generic_SortedList_TKey_TValue,\n        KnownType.System_Collections_Generic_SortedSet_T,\n        KnownType.System_Collections_Generic_Stack_T);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            c =>\n            {\n                var property = (PropertyDeclarationSyntax)c.Node;\n                var body = PropertyBody(property);\n                if (body is null)\n                {\n                    return;\n                }\n\n                var walker = new PropertyWalker(c.Model, body is ArrowExpressionClauseSyntax);\n                walker.SafeVisit(body);\n                foreach (var location in walker.Locations)\n                {\n                    c.ReportIssue(Rule, location, property.Identifier.Text);\n                }\n            },\n            SyntaxKind.PropertyDeclaration);\n\n    private static SyntaxNode PropertyBody(PropertyDeclarationSyntax property) =>\n        property.ExpressionBody\n        ?? property.AccessorList\n            .Accessors\n            .Where(x => x.IsKind(SyntaxKind.GetAccessorDeclaration))\n            .Select(x => (SyntaxNode)x.Body ?? x.ExpressionBody)\n            .FirstOrDefault();\n\n    private sealed class PropertyWalker : SafeCSharpSyntaxWalker\n    {\n        private readonly SemanticModel model;\n        private readonly List<Location> locations = [];\n        private bool inGetterReturn;\n\n        public IEnumerable<Location> Locations => locations;\n\n        public PropertyWalker(SemanticModel model, bool isArrowExpression)\n        {\n            this.model = model;\n            inGetterReturn = isArrowExpression;\n        }\n\n        public override void VisitInvocationExpression(InvocationExpressionSyntax node)\n        {\n            if (inGetterReturn\n                && model.GetSymbolInfo(node).Symbol is IMethodSymbol invokedSymbol\n                && (invokedSymbol.IsArrayClone()\n                    || invokedSymbol.IsEnumerableToList()\n                    || invokedSymbol.IsEnumerableToArray()))\n            {\n                locations.Add(node.Expression.GetLocation());\n            }\n        }\n\n        public override void VisitObjectCreationExpression(ObjectCreationExpressionSyntax node)\n        {\n            if (inGetterReturn && IsObjectCreationCopyingCollection(node))\n            {\n                locations.Add(node.GetLocation());\n            }\n        }\n\n        public override void Visit(SyntaxNode node)\n        {\n            if (inGetterReturn\n                && node.IsKind(SyntaxKindEx.ImplicitObjectCreationExpression)\n                && IsObjectCreationCopyingCollection(node))\n            {\n                locations.Add(node.GetLocation());\n            }\n            if (node.IsKind(SyntaxKindEx.LocalFunctionStatement))\n            {\n                return; // Filter local function\n            }\n            base.Visit(node);\n        }\n\n        public override void VisitReturnStatement(ReturnStatementSyntax node)\n        {\n            inGetterReturn = true;\n            base.VisitReturnStatement(node);\n            inGetterReturn = false;\n        }\n\n        public override void VisitSimpleLambdaExpression(SimpleLambdaExpressionSyntax node)\n        {\n            // Filter Lambda\n        }\n\n        public override void VisitParenthesizedLambdaExpression(ParenthesizedLambdaExpressionSyntax node)\n        {\n            // Filter Lambda\n        }\n\n        public override void VisitAnonymousMethodExpression(AnonymousMethodExpressionSyntax node)\n        {\n            // Filter Anonymous Method\n        }\n\n        public override void VisitAssignmentExpression(AssignmentExpressionSyntax node)\n        {\n            // Filter lazy initialization\n        }\n\n        private bool IsObjectCreationCopyingCollection(SyntaxNode node) =>\n            model.GetSymbolInfo(node).Symbol is IMethodSymbol { MethodKind: MethodKind.Constructor, Parameters.Length: > 0 } constructor\n            && constructor.ContainingType.OriginalDefinition.IsAny(CopyingCollectionTypes)\n            && constructor.Parameters[0] is var firstParameter\n            && !firstParameter.Type.Is(KnownType.System_String)\n            && firstParameter.Type.DerivesOrImplements(KnownType.System_Collections_IEnumerable);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DoNotDecreaseMemberVisibility.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class DoNotDecreaseMemberVisibility : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S4015\";\n    private const string MessageFormat = \"This member hides '{0}'. Make it non-private or seal the class.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var classDeclaration = (TypeDeclarationSyntax)c.Node;\n                if (classDeclaration.Identifier.IsMissing\n                    || c.IsRedundantPositionalRecordContext()\n                    || !(c.ContainingSymbol is ITypeSymbol { IsSealed: false } classSymbol))\n                {\n                    return;\n                }\n\n                var issueReporter = new IssueReporter(classSymbol, c);\n                foreach (var member in classDeclaration.Members)\n                {\n                    issueReporter.ReportIssue(member);\n                }\n            },\n            SyntaxKind.ClassDeclaration,\n            SyntaxKindEx.RecordDeclaration);\n\n    private sealed class IssueReporter\n    {\n        private readonly IList<IMethodSymbol> allBaseClassMethods;\n        private readonly IList<IPropertySymbol> allBaseClassProperties;\n        private readonly IList<IEventSymbol> allBaseClassEvents;\n\n        private readonly SonarSyntaxNodeReportingContext context;\n\n        public IssueReporter(ITypeSymbol classSymbol, SonarSyntaxNodeReportingContext context)\n        {\n            this.context = context;\n            var allBaseClassMembers = classSymbol.BaseType\n                    .GetSelfAndBaseTypes()\n                    .SelectMany(x => x.GetMembers())\n                    .Where(x => IsSymbolVisibleFromNamespace(x, classSymbol.ContainingNamespace))\n                    .ToList();\n\n            allBaseClassMethods = allBaseClassMembers.OfType<IMethodSymbol>().ToList();\n            allBaseClassProperties = allBaseClassMembers.OfType<IPropertySymbol>().ToList();\n            allBaseClassEvents = allBaseClassMembers.OfType<IEventSymbol>().ToList();\n        }\n\n        public void ReportIssue(MemberDeclarationSyntax memberDeclaration)\n        {\n            switch (context.Model.GetDeclaredSymbol(memberDeclaration))\n            {\n                case IMethodSymbol methodSymbol:\n                    ReportMethodIssue(memberDeclaration, methodSymbol);\n                    break;\n                case IPropertySymbol propertySymbol:\n                    ReportPropertyIssue(memberDeclaration, propertySymbol);\n                    break;\n                case IEventSymbol eventSymbol:\n                    ReportEventIssue(memberDeclaration, eventSymbol);\n                    break;\n            }\n        }\n\n        private void ReportMethodIssue(MemberDeclarationSyntax memberDeclaration, IMethodSymbol methodSymbol)\n        {\n            if (memberDeclaration is MethodDeclarationSyntax methodDeclaration\n                && !methodDeclaration.Modifiers.Any(SyntaxKind.NewKeyword)\n                && allBaseClassMethods.FirstOrDefault(x =>\n                    IsDecreasingAccess(x.DeclaredAccessibility, methodSymbol.DeclaredAccessibility, false)\n                    && IsMatchingSignature(x, methodSymbol)) is { } hidingMethod)\n            {\n                context.ReportIssue(Rule, methodDeclaration.Identifier, hidingMethod.ToDisplayString());\n            }\n        }\n\n        private void ReportPropertyIssue(MemberDeclarationSyntax memberDeclaration, IPropertySymbol propertySymbol)\n        {\n            if (memberDeclaration is BasePropertyDeclarationSyntax basePropertyDeclaration\n                && !basePropertyDeclaration.Modifiers.Any(SyntaxKind.NewKeyword)\n                && allBaseClassProperties.FirstOrDefault(x => IsDecreasingPropertyAccess(x, propertySymbol, propertySymbol.IsOverride)) is { } hidingProperty)\n            {\n                context.ReportIssue(Rule, GetPropertyToken(basePropertyDeclaration), hidingProperty.ToDisplayString());\n            }\n        }\n\n        private void ReportEventIssue(MemberDeclarationSyntax memberDeclaration, IEventSymbol eventSymbol)\n        {\n            if (memberDeclaration is EventDeclarationSyntax eventDeclaration\n                && !eventDeclaration.Modifiers.Any(SyntaxKind.NewKeyword)\n                && allBaseClassEvents.FirstOrDefault(x => IsDecreasingAccess(x.DeclaredAccessibility, eventSymbol.DeclaredAccessibility, false)\n                    && x.Name == eventSymbol.Name) is { } hidingEvent)\n            {\n                context.ReportIssue(Rule, eventDeclaration.Identifier, hidingEvent.ToDisplayString());\n            }\n        }\n\n        private static SyntaxToken GetPropertyToken(BasePropertyDeclarationSyntax propertyLike) =>\n            propertyLike switch\n            {\n                PropertyDeclarationSyntax property => property.Identifier,\n                IndexerDeclarationSyntax indexer => indexer.ThisKeyword,\n                _ => propertyLike.GetFirstToken()\n            };\n\n        private static bool IsSymbolVisibleFromNamespace(ISymbol symbol, INamespaceSymbol ns) =>\n            symbol.DeclaredAccessibility != Accessibility.Private\n            && (symbol.DeclaredAccessibility != Accessibility.Internal || ns.Equals(symbol.ContainingNamespace));\n\n        private static bool IsDecreasingPropertyAccess(IPropertySymbol baseProperty, IPropertySymbol propertySymbol, bool isOverride)\n        {\n            if (baseProperty.Name != propertySymbol.Name\n                || !AreParameterTypesEqual(baseProperty.Parameters, propertySymbol.Parameters))\n            {\n                return false;\n            }\n\n            var baseGetAccess = GetEffectiveDeclaredAccess(baseProperty.GetMethod, baseProperty.DeclaredAccessibility);\n            var baseSetAccess = GetEffectiveDeclaredAccess(baseProperty.SetMethod, baseProperty.DeclaredAccessibility);\n\n            var propertyGetAccess = GetEffectiveDeclaredAccess(propertySymbol.GetMethod, baseProperty.DeclaredAccessibility);\n            var propertySetAccess = GetEffectiveDeclaredAccess(propertySymbol.SetMethod, baseProperty.DeclaredAccessibility);\n\n            return IsDecreasingAccess(baseGetAccess, propertyGetAccess, isOverride)\n                   || IsDecreasingAccess(baseSetAccess, propertySetAccess, isOverride);\n        }\n\n        private static Accessibility GetEffectiveDeclaredAccess(ISymbol symbol, Accessibility defaultAccessibility)\n        {\n            if (symbol is null)\n            {\n                return Accessibility.NotApplicable;\n            }\n\n            return symbol.DeclaredAccessibility == Accessibility.NotApplicable\n                ? defaultAccessibility\n                : symbol.DeclaredAccessibility;\n        }\n\n        private static bool IsMatchingSignature(IMethodSymbol baseMethod, IMethodSymbol methodSymbol) =>\n            baseMethod.Name == methodSymbol.Name\n            && baseMethod.TypeParameters.Length == methodSymbol.TypeParameters.Length\n            && AreParameterTypesEqual(baseMethod.Parameters, methodSymbol.Parameters);\n\n        private static bool AreParameterTypesEqual(IEnumerable<IParameterSymbol> first, IEnumerable<IParameterSymbol> second) =>\n            first.Equals(second, AreParameterTypesEqual);\n\n        private static bool AreParameterTypesEqual(IParameterSymbol first, IParameterSymbol second)\n        {\n            if (first.RefKind != second.RefKind)\n            {\n                return false;\n            }\n\n            return first.Type.TypeKind == TypeKind.TypeParameter\n                ? second.Type.TypeKind == TypeKind.TypeParameter\n                : Equals(first.Type.OriginalDefinition, second.Type.OriginalDefinition);\n        }\n\n        private static bool IsDecreasingAccess(Accessibility baseAccess, Accessibility memberAccess, bool isOverride)\n        {\n            if (memberAccess == Accessibility.NotApplicable && isOverride)\n            {\n                return false;\n            }\n\n            return (baseAccess != Accessibility.NotApplicable && memberAccess == Accessibility.Private)\n                   || (baseAccess == Accessibility.Public && memberAccess != Accessibility.Public);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DoNotExposeListT.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class DoNotExposeListT : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S3956\";\n        private const string MessageFormat = \"Refactor this {0} to use a generic collection designed for inheritance.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var baseMethodDeclaration = (BaseMethodDeclarationSyntax)c.Node;\n                    var methodSymbol = c.Model.GetDeclaredSymbol(baseMethodDeclaration);\n\n                    if (methodSymbol == null\n                        || !methodSymbol.IsPubliclyAccessible()\n                        || methodSymbol.IsOverride\n                        || !IsOrdinaryMethodOrConstructor(methodSymbol))\n                    {\n                        return;\n                    }\n\n                    var methodType = methodSymbol.IsConstructor() ? \"constructor\" : \"method\";\n\n                    if (baseMethodDeclaration is MethodDeclarationSyntax methodDeclaration)\n                    {\n                        ReportIfListT(c, methodDeclaration.ReturnType, methodType);\n                    }\n\n                    baseMethodDeclaration\n                        .ParameterList?\n                        .Parameters\n                        .ToList()\n                        .ForEach(p => ReportIfListT(c, p.Type, methodType));\n                },\n                SyntaxKind.MethodDeclaration,\n                SyntaxKind.ConstructorDeclaration);\n\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var propertyDeclaration = (PropertyDeclarationSyntax)c.Node;\n                    var propertySymbol = c.Model.GetDeclaredSymbol(propertyDeclaration);\n\n                    if (propertySymbol != null\n                        && propertySymbol.IsPubliclyAccessible()\n                        && !propertySymbol.IsOverride\n                        && !HasXmlElementAttribute(propertySymbol))\n                    {\n                        ReportIfListT(c, propertyDeclaration.Type, \"property\");\n                    }\n                },\n                SyntaxKind.PropertyDeclaration);\n\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var fieldDeclaration = (FieldDeclarationSyntax)c.Node;\n\n                    var variableDeclaration = fieldDeclaration.Declaration?.Variables.FirstOrDefault();\n                    if (variableDeclaration == null)\n                    {\n                        return;\n                    }\n\n                    var fieldSymbol = c.Model.GetDeclaredSymbol(variableDeclaration);\n\n                    if (fieldSymbol != null\n                        && fieldSymbol.IsPubliclyAccessible()\n                        && !HasXmlElementAttribute(fieldSymbol))\n                    {\n                        ReportIfListT(c, fieldDeclaration.Declaration.Type, \"field\");\n                    }\n                },\n                SyntaxKind.FieldDeclaration);\n        }\n\n        private static void ReportIfListT(SonarSyntaxNodeReportingContext context, TypeSyntax typeSyntax, string memberType)\n        {\n            if (typeSyntax != null && typeSyntax.IsKnownType(KnownType.System_Collections_Generic_List_T, context.Model))\n            {\n                context.ReportIssue(Rule, typeSyntax, memberType);\n            }\n        }\n\n        private static bool IsOrdinaryMethodOrConstructor(IMethodSymbol method) =>\n            method.MethodKind == MethodKind.Ordinary || method.MethodKind == MethodKind.Constructor;\n\n        private static bool HasXmlElementAttribute(ISymbol symbol) =>\n            symbol.GetAttributes(KnownType.System_Xml_Serialization_XmlElementAttribute).Any();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DoNotHardcodeCredentials.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class DoNotHardcodeCredentials : DoNotHardcodeCredentialsBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override void InitializeActions(SonarParametrizedAnalysisContext context) =>\n        context.RegisterCompilationStartAction(\n            c =>\n            {\n                c.RegisterNodeAction(\n                    new VariableDeclarationBannedWordsFinder(this).AnalysisAction(),\n                    SyntaxKind.VariableDeclarator);\n\n                c.RegisterNodeAction(\n                    new AssignmentExpressionBannedWordsFinder(this).AnalysisAction(),\n                    SyntaxKind.SimpleAssignmentExpression);\n\n                c.RegisterNodeAction(\n                    new StringLiteralBannedWordsFinder(this).AnalysisAction(),\n                    SyntaxKind.StringLiteralExpression);\n\n                c.RegisterNodeAction(\n                    new AddExpressionBannedWordsFinder(this).AnalysisAction(),\n                    SyntaxKind.AddExpression);\n\n                c.RegisterNodeAction(\n                    new InterpolatedStringBannedWordsFinder(this).AnalysisAction(),\n                    SyntaxKind.InterpolatedStringExpression);\n\n                c.RegisterNodeAction(\n                    new InvocationBannedWordsFinder(this).AnalysisAction(),\n                    SyntaxKind.InvocationExpression);\n            });\n\n    protected override bool IsSecureStringAppendCharFromConstant(SyntaxNode argumentNode, SemanticModel model) =>\n        argumentNode is ArgumentSyntax { Expression: { } argumentExpression }\n        && argumentExpression switch\n        {\n            ElementAccessExpressionSyntax { Expression: { } accessed } => accessed.FindConstantValue(model) is string, // AppendChar(\"AP@ssw0rd\"[i])\n            LiteralExpressionSyntax { RawKind: (int)SyntaxKind.CharacterLiteralExpression } => true, // AppendChar('P')\n            IdentifierNameSyntax identifier when model.GetSymbolInfo(identifier) is { Symbol: ILocalSymbol { } local } // foreach (var c in someConstString) AppendChar(c)\n                && local.DeclaringSyntaxReferences.Length == 1\n                && local.DeclaringSyntaxReferences[0].GetSyntax() is ForEachStatementSyntax { Expression: { } forEachExpression }\n                && forEachExpression.FindConstantValue(model) is string => true,\n            _ => false,\n        };\n\n    private sealed class VariableDeclarationBannedWordsFinder : CredentialWordsFinderBase<VariableDeclaratorSyntax>\n    {\n        public VariableDeclarationBannedWordsFinder(DoNotHardcodeCredentials analyzer) : base(analyzer) { }\n\n        protected override string AssignedValue(VariableDeclaratorSyntax syntaxNode, SemanticModel model) =>\n            FindStringLiteralInVariableDeclaration(syntaxNode.Initializer.Value)?.StringValue(model);\n\n        protected override string VariableName(VariableDeclaratorSyntax syntaxNode) =>\n            syntaxNode.Identifier.ValueText;\n\n        protected override bool ShouldHandle(VariableDeclaratorSyntax syntaxNode, SemanticModel model) =>\n            FindStringLiteralInVariableDeclaration(syntaxNode.Initializer?.Value) is not null\n            && (syntaxNode.IsDeclarationKnownType(KnownType.System_String, model)\n                || syntaxNode.IsDeclarationKnownType(KnownType.System_ReadOnlySpan_T, model) // \"utf8\"u8\n                || syntaxNode.IsDeclarationKnownType(KnownType.System_Byte_Array, model));   // \"utf8\"u8.ToArray()\n\n        private static LiteralExpressionSyntax FindStringLiteralInVariableDeclaration(ExpressionSyntax expression) =>\n            expression switch\n            {\n                LiteralExpressionSyntax literal => literal,\n                InvocationExpressionSyntax\n                {\n                    Expression: MemberAccessExpressionSyntax\n                    {\n                        Expression: LiteralExpressionSyntax { RawKind: (int)SyntaxKindEx.Utf8StringLiteralExpression } literal\n                    }\n                } invocation when invocation.NameIs(\"ToArray\") => literal, // \"utf8\"u8.ToArray()\n                _ => null\n            };\n    }\n\n    private sealed class AssignmentExpressionBannedWordsFinder : CredentialWordsFinderBase<AssignmentExpressionSyntax>\n    {\n        public AssignmentExpressionBannedWordsFinder(DoNotHardcodeCredentials analyzer) : base(analyzer) { }\n\n        protected override string AssignedValue(AssignmentExpressionSyntax syntaxNode, SemanticModel model) =>\n            syntaxNode.Right.StringValue(model);\n\n        protected override string VariableName(AssignmentExpressionSyntax syntaxNode) =>\n            (syntaxNode.Left as IdentifierNameSyntax)?.Identifier.ValueText;\n\n        protected override bool ShouldHandle(AssignmentExpressionSyntax syntaxNode, SemanticModel model) =>\n            syntaxNode.IsKind(SyntaxKind.SimpleAssignmentExpression)\n            && syntaxNode.Left.IsKnownType(KnownType.System_String, model)\n            && syntaxNode.Right.IsKind(SyntaxKind.StringLiteralExpression);\n    }\n\n    /// <summary>\n    /// This finder checks all string literal in the code, except VariableDeclarator, SimpleAssignmentExpression and string.Format invocation.\n    /// These two have their own finders with precise logic and variable name checking.\n    /// This class inspects all other standalone string literals for values considered as hardcoded passwords (in connection strings)\n    /// based on same rules as in VariableDeclarationBannedWordsFinder and AssignmentExpressionBannedWordsFinder.\n    /// </summary>\n    private sealed class StringLiteralBannedWordsFinder : CredentialWordsFinderBase<LiteralExpressionSyntax>\n    {\n        public StringLiteralBannedWordsFinder(DoNotHardcodeCredentials analyzer) : base(analyzer) { }\n\n        protected override string AssignedValue(LiteralExpressionSyntax syntaxNode, SemanticModel model) =>\n            syntaxNode.StringValue(model);\n\n        // We don't have a variable for cases that this finder should handle.  Cases with variable name are\n        // handled by VariableDeclarationBannedWordsFinder and AssignmentExpressionBannedWordsFinder\n        // Returning null is safe here, it will not be considered as a value.\n        protected override string VariableName(LiteralExpressionSyntax syntaxNode) =>\n            null;\n\n        protected override bool ShouldHandle(LiteralExpressionSyntax syntaxNode, SemanticModel model) =>\n            syntaxNode.IsKind(SyntaxKind.StringLiteralExpression) && ShouldHandle(syntaxNode.GetTopMostContainingMethod(), syntaxNode, model);\n\n        private static bool ShouldHandle(SyntaxNode method, SyntaxNode current, SemanticModel model)\n        {\n            // We don't want to handle VariableDeclarator and SimpleAssignmentExpression,\n            // they are implemented by other finders with better and more precise logic.\n            while (current is not null && current != method)\n            {\n                switch (current.Kind())\n                {\n                    case SyntaxKind.VariableDeclarator:\n                    case SyntaxKind.SimpleAssignmentExpression:\n                        return false;\n\n                    // Direct return from nested syntaxes that must be handled by this finder\n                    // before search reaches top level VariableDeclarator or SimpleAssignmentExpression.\n                    case SyntaxKind.InvocationExpression:\n                    case SyntaxKind.AddExpression: // String concatenation is not supported by other finders\n                        return true;\n\n                    // Handle all arguments except those inside string.Format. InvocationBannedWordsFinder takes care of them.\n                    case SyntaxKind.Argument:\n                        return !(current.Parent.Parent is InvocationExpressionSyntax invocation && invocation.IsMethodInvocation(KnownType.System_String, \"Format\", model));\n\n                    default:\n                        current = current.Parent;\n                        break;\n                }\n            }\n            // We want to handle all other literals (property initializers, return statement and return values from lambdas, arrow functions, ...)\n            return true;\n        }\n    }\n\n    private sealed class AddExpressionBannedWordsFinder : CredentialWordsFinderBase<BinaryExpressionSyntax>\n    {\n        public AddExpressionBannedWordsFinder(DoNotHardcodeCredentials analyzer) : base(analyzer) { }\n\n        protected override string AssignedValue(BinaryExpressionSyntax syntaxNode, SemanticModel model)\n        {\n            var left = syntaxNode.Left is BinaryExpressionSyntax precedingAdd && precedingAdd.IsKind(SyntaxKind.AddExpression) ? precedingAdd.Right : syntaxNode.Left;\n            return left.FindStringConstant(model) is { } leftString\n                && syntaxNode.Right.FindStringConstant(model) is { } rightString\n                    ? leftString + rightString\n                    : null;\n        }\n\n        protected override string VariableName(BinaryExpressionSyntax syntaxNode) => null;\n\n        protected override bool ShouldHandle(BinaryExpressionSyntax syntaxNode, SemanticModel model) => true;\n    }\n\n    private sealed class InterpolatedStringBannedWordsFinder : CredentialWordsFinderBase<InterpolatedStringExpressionSyntax>\n    {\n        public InterpolatedStringBannedWordsFinder(DoNotHardcodeCredentials analyzer) : base(analyzer) { }\n\n        protected override string AssignedValue(InterpolatedStringExpressionSyntax syntaxNode, SemanticModel model) =>\n            syntaxNode.Contents.JoinStr(null, x => x switch\n            {\n                InterpolationSyntax interpolation => interpolation.Expression.FindStringConstant(model),\n                InterpolatedStringTextSyntax text => text.TextToken.ToString(),\n                _ => null\n            } ?? KeywordSeparator.ToString()); // Unknown elements resolved to separator to terminate the keyword-value sequence\n\n        protected override string VariableName(InterpolatedStringExpressionSyntax syntaxNode) => null;\n\n        protected override bool ShouldHandle(InterpolatedStringExpressionSyntax syntaxNode, SemanticModel model) => true;\n    }\n\n    private sealed class InvocationBannedWordsFinder : CredentialWordsFinderBase<InvocationExpressionSyntax>\n    {\n        public InvocationBannedWordsFinder(DoNotHardcodeCredentials analyzer) : base(analyzer) { }\n\n        protected override string AssignedValue(InvocationExpressionSyntax syntaxNode, SemanticModel model)\n        {\n            var allArgs = syntaxNode.ArgumentList.Arguments.Select(x => x.Expression.FindStringConstant(model) ?? KeywordSeparator.ToString());\n            try\n            {\n                return string.Format(allArgs.First(), allArgs.Skip(1).ToArray());\n            }\n            catch (FormatException)\n            {\n                return null;\n            }\n        }\n\n        protected override string VariableName(InvocationExpressionSyntax syntaxNode) => null;\n\n        protected override bool ShouldHandle(InvocationExpressionSyntax syntaxNode, SemanticModel model) =>\n            syntaxNode.IsMethodInvocation(KnownType.System_String, \"Format\", model)\n            && model.GetSymbolInfo(syntaxNode).Symbol is IMethodSymbol symbol\n            && symbol.Parameters.First().Type.Is(KnownType.System_String);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DoNotHardcodeSecrets.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class DoNotHardcodeSecrets : DoNotHardcodeSecretsBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override void RegisterNodeActions(SonarCompilationStartAnalysisContext context)\n    {\n        context.RegisterNodeAction(\n            ReportIssues,\n            SyntaxKind.AddAssignmentExpression,\n            SyntaxKind.SimpleAssignmentExpression,\n            SyntaxKind.VariableDeclarator,\n            SyntaxKind.PropertyDeclaration,\n            SyntaxKind.GetAccessorDeclaration,\n            SyntaxKind.SetAccessorDeclaration,\n            SyntaxKind.EqualsExpression);\n\n        context.RegisterNodeAction(c =>\n            {\n                var invocationExpression = (InvocationExpressionSyntax)c.Node;\n\n                if (invocationExpression.Expression is MemberAccessExpressionSyntax memberAccessExpression\n                    && memberAccessExpression.Name.Identifier.ValueText == EqualsName\n                    && invocationExpression.ArgumentList?.Arguments.FirstOrDefault() is { } firstArgument\n                    && memberAccessExpression.IsMemberAccessOnKnownType(EqualsName, KnownType.System_String, c.Model))\n                {\n                    ReportIssuesForEquals(c, memberAccessExpression, IdentifierAndValue(memberAccessExpression.Expression, firstArgument));\n                }\n            },\n            SyntaxKind.InvocationExpression);\n    }\n\n    protected override SyntaxNode IdentifierRoot(SyntaxNode node) =>\n        node switch\n        {\n            AccessorDeclarationSyntax accessor => accessor.Parent.Parent,\n            AssignmentExpressionSyntax assignment when assignment.Left.IsKind(SyntaxKindEx.FieldExpression) => assignment.Ancestors().OfType<PropertyDeclarationSyntax>().FirstOrDefault(),\n            AssignmentExpressionSyntax assignment => assignment.Left,\n            BinaryExpressionSyntax { Left: IdentifierNameSyntax left } => left,\n            BinaryExpressionSyntax { Right: IdentifierNameSyntax right } => right,\n            _ => node\n        };\n\n    protected override SyntaxNode RightHandSide(SyntaxNode node) =>\n        node switch\n        {\n            AssignmentExpressionSyntax assignment => assignment.Right,\n            VariableDeclaratorSyntax variable => variable.Initializer?.Value,\n            PropertyDeclarationSyntax property => property.Initializer?.Value,\n            AccessorDeclarationSyntax accessor => accessor.ExpressionBody?.Expression,\n            BinaryExpressionSyntax { Left: IdentifierNameSyntax } binary => binary.Right,\n            BinaryExpressionSyntax { Right: IdentifierNameSyntax } binary => binary.Left,\n            _ => null\n        };\n\n    private static IdentifierValuePair IdentifierAndValue(ExpressionSyntax expression, ArgumentSyntax argument) =>\n        expression switch\n        {\n            MemberAccessExpressionSyntax or IdentifierNameSyntax or InvocationExpressionSyntax => new(expression.GetIdentifier(), argument.Expression),\n            LiteralExpressionSyntax literal => new(argument.Expression.GetIdentifier(), literal),\n            _ => null,\n        };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DoNotHideBaseClassMethods.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class DoNotHideBaseClassMethods : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S4019\";\n        private const string MessageFormat = \"Remove or rename that method because it hides '{0}'.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n                {\n                    var declarationSyntax = (TypeDeclarationSyntax)c.Node;\n                    if (declarationSyntax.Identifier.IsMissing\n                        || c.IsRedundantPositionalRecordContext()\n                        || !(c.Model.GetDeclaredSymbol(declarationSyntax) is { } declaredSymbol))\n                    {\n                        return;\n                    }\n\n                    var issueReporter = new IssueReporter(declaredSymbol, c);\n                    foreach (var member in declarationSyntax.Members)\n                    {\n                        issueReporter.ReportIssue(member);\n                    }\n                },\n                SyntaxKind.ClassDeclaration,\n                SyntaxKindEx.RecordDeclaration);\n\n        private sealed class IssueReporter\n        {\n            private enum Match\n            {\n                Different,\n                Identical,\n                WeaklyDerived\n            }\n\n            private readonly IList<IMethodSymbol> allBaseTypeMethods;\n            private readonly SonarSyntaxNodeReportingContext context;\n\n            public IssueReporter(ITypeSymbol typeSymbol, SonarSyntaxNodeReportingContext context)\n            {\n                this.context = context;\n                allBaseTypeMethods = GetAllBaseMethods(typeSymbol);\n            }\n\n            public void ReportIssue(MemberDeclarationSyntax memberDeclaration)\n            {\n                if (memberDeclaration is MethodDeclarationSyntax { Identifier: { } identifier }\n                    && context.Model.GetDeclaredSymbol(memberDeclaration) is IMethodSymbol methodSymbol\n                    && FindBaseMethodHiddenByMethod(methodSymbol) is { } baseMethodHidden)\n                {\n                    context.ReportIssue(Rule, identifier, baseMethodHidden.ToDisplayString());\n                }\n            }\n\n            private static List<IMethodSymbol> GetAllBaseMethods(ITypeSymbol typeSymbol) =>\n                typeSymbol.BaseType\n                    .GetSelfAndBaseTypes()\n                    .SelectMany(t => t.GetMembers())\n                    .OfType<IMethodSymbol>()\n                    .Where(m => IsSymbolVisibleFromNamespace(m, typeSymbol.ContainingNamespace))\n                    .Where(m => m.Parameters.Length > 0)\n                    .Where(m => !string.IsNullOrEmpty(m.Name))\n                    .ToList();\n\n            private static bool IsSymbolVisibleFromNamespace(ISymbol symbol, INamespaceSymbol ns) =>\n                symbol.DeclaredAccessibility != Accessibility.Private\n                && (symbol.DeclaredAccessibility != Accessibility.Internal || ns.Equals(symbol.ContainingNamespace));\n\n            private IMethodSymbol FindBaseMethodHiddenByMethod(IMethodSymbol methodSymbol)\n            {\n                var baseMemberCandidates = allBaseTypeMethods.Where(m => m.Name == methodSymbol.Name);\n\n                IMethodSymbol hiddenBaseMethodCandidate = null;\n\n                var hasBaseMethodWithSameSignature = baseMemberCandidates.Any(baseMember =>\n                    {\n                        var result = ComputeSignatureMatch(baseMember, methodSymbol);\n                        if (result == Match.WeaklyDerived)\n                        {\n                            hiddenBaseMethodCandidate ??= baseMember;\n                        }\n\n                        return result == Match.Identical;\n                    });\n\n                return hasBaseMethodWithSameSignature ? null : hiddenBaseMethodCandidate;\n            }\n\n            private static Match ComputeSignatureMatch(IMethodSymbol baseMethodSymbol, IMethodSymbol methodSymbol)\n            {\n                var baseMethodParams = baseMethodSymbol.Parameters;\n                var methodParams = methodSymbol.Parameters;\n\n                if (baseMethodParams.Length != methodParams.Length)\n                {\n                    return Match.Different;\n                }\n\n                var signatureMatch = Match.Identical;\n                for (var i = 0; i < methodParams.Length; i++)\n                {\n                    var match = ComputeParameterMatch(baseMethodParams[i], methodParams[i]);\n\n                    if (match == Match.Different)\n                    {\n                        return Match.Different;\n                    }\n\n                    if (match == Match.WeaklyDerived)\n                    {\n                        signatureMatch = Match.WeaklyDerived;\n                    }\n                }\n\n                return signatureMatch;\n            }\n\n            private static Match ComputeParameterMatch(IParameterSymbol baseParam, IParameterSymbol methodParam)\n            {\n                if (baseParam.Type.Is(TypeKind.TypeParameter))\n                {\n                    return methodParam.Type.TypeKind == TypeKind.TypeParameter ? Match.Identical : Match.Different;\n                }\n\n                if (Equals(baseParam.Type.OriginalDefinition, methodParam.Type.OriginalDefinition))\n                {\n                    return Match.Identical;\n                }\n\n                return baseParam.Type.DerivesOrImplements(methodParam.Type) ? Match.WeaklyDerived : Match.Different;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DoNotInstantiateSharedClasses.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class DoNotInstantiateSharedClasses : DoNotInstantiateSharedClassesBase\n    {\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var creationSyntax = (ObjectCreationExpressionSyntax)c.Node;\n\n                    var createdType = c.Model.GetTypeInfo(creationSyntax).Type;\n                    if (createdType != null &&\n                        createdType.GetAttributes(KnownType.System_ComponentModel_Composition_PartCreationPolicyAttribute).Any(IsShared))\n                    {\n                        c.ReportIssue(rule, creationSyntax);\n                    }\n                },\n                SyntaxKind.ObjectCreationExpression);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DoNotLockOnSharedResource.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class DoNotLockOnSharedResource : DoNotLockOnSharedResourceBase\n    {\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var lockStatement = (LockStatementSyntax)c.Node;\n\n                    if (IsLockOnThis(lockStatement.Expression) ||\n                        IsLockOnStringLiteral(lockStatement.Expression) ||\n                        IsLockOnForbiddenKnownType(lockStatement.Expression, c.Model))\n                    {\n                        c.ReportIssue(rule, lockStatement.Expression);\n                    }\n                },\n                SyntaxKind.LockStatement);\n        }\n\n        private static bool IsLockOnThis(ExpressionSyntax expression) =>\n            expression.IsKind(SyntaxKind.ThisExpression);\n\n        private static bool IsLockOnStringLiteral(ExpressionSyntax expression) =>\n            expression.IsKind(SyntaxKind.StringLiteralExpression);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DoNotLockWeakIdentityObjects.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class DoNotLockWeakIdentityObjects : DoNotLockWeakIdentityObjectsBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n        protected override SyntaxKind SyntaxKind { get; } = SyntaxKind.LockStatement;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DoNotMarkEnumsWithFlags.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Numerics;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class DoNotMarkEnumsWithFlags : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S4070\";\n    private const string MessageFormat = \"Remove the 'FlagsAttribute' from this enum.\";\n    private const string SecondaryMessage = \"Enum value is not a power of two.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            c =>\n            {\n                var enumDeclaration = (EnumDeclarationSyntax)c.Node;\n                var enumSymbol = c.Model.GetDeclaredSymbol(enumDeclaration);\n\n                if (!enumDeclaration.HasFlagsAttribute(c.Model)\n                    || enumDeclaration.Identifier.IsMissing\n                    || enumSymbol is null)\n                {\n                    return;\n                }\n\n                var membersWithValues = enumSymbol.GetMembers()\n                    .OfType<IFieldSymbol>()\n                    .Select(member => new { Member = member, Value = GetEnumValueOrDefault(member) })\n                    .OrderByDescending(tuple => tuple.Value)\n                    .ToList();\n\n                var allValues = membersWithValues.Select(x => x.Value)\n                    .OfType<BigInteger>()\n                    .Distinct()\n                    .ToList();\n\n                var invalidMembers = membersWithValues.Where(tuple => !IsValidFlagValue(tuple.Value, allValues))\n                    .Select(tuple => tuple.Member.GetFirstSyntaxRef()?.ToSecondaryLocation(SecondaryMessage))\n                    .WhereNotNull()\n                    .ToList();\n\n                if (invalidMembers.Count > 0)\n                {\n                    c.ReportIssue(Rule, enumDeclaration.Identifier, invalidMembers);\n                }\n            }, SyntaxKind.EnumDeclaration);\n\n    private static BigInteger? GetEnumValueOrDefault(IFieldSymbol enumMember) =>\n        enumMember.HasConstantValue\n            ? enumMember.ConstantValue switch // BigInteger is used here to support enums with base type of ulong. Direct cast is used to avoid string conversion.\n            {\n                byte x => (BigInteger)x,\n                sbyte x => (BigInteger)x,\n                short x => (BigInteger)x,\n                ushort x => (BigInteger)x,\n                int x => (BigInteger)x,\n                uint x => (BigInteger)x,\n                long x => (BigInteger)x,\n                ulong x => (BigInteger)x,\n                _ => null\n            }\n            : null;\n\n    private static bool IsValidFlagValue(BigInteger? enumValue, IEnumerable<BigInteger> allValues) =>\n        enumValue.HasValue\n        && (IsZeroOrPowerOfTwo(enumValue.Value)\n            || IsCombinationOfOtherValues(enumValue.Value, allValues));\n\n    private static bool IsZeroOrPowerOfTwo(BigInteger value) =>\n        value.IsZero\n        || BigInteger.Abs(value).IsPowerOfTwo;\n\n    private static bool IsCombinationOfOtherValues(BigInteger value, IEnumerable<BigInteger> otherValues)\n    {\n        var currentValue = value;\n        foreach (var otherValue in otherValues.SkipWhile(x => value <= x))\n        {\n            if (otherValue <= currentValue)\n            {\n                currentValue ^= otherValue;\n                if (currentValue == 0)\n                {\n                    return true;\n                }\n            }\n        }\n\n        return currentValue == 0;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DoNotNestTernaryOperators.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class DoNotNestTernaryOperators : DoNotNestTernaryOperatorsBase\n    {\n        private const string MessageFormat = \"Extract this nested ternary operation into an independent statement.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n                {\n                    if (c.Node.Ancestors()\n                        .TakeWhile(x => !(x?.Kind() is SyntaxKind.ParenthesizedLambdaExpression or SyntaxKind.SimpleLambdaExpression))\n                        .OfType<ConditionalExpressionSyntax>()\n                        .Any())\n                    {\n                        c.ReportIssue(Rule, c.Node);\n                    }\n                },\n                SyntaxKind.ConditionalExpression);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DoNotNestTypesInArguments.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class DoNotNestTypesInArguments : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S4017\";\n    private const string MessageFormat = \"Refactor this method to remove the nested type argument.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                IEnumerable<ParameterSyntax> parameters = c.Node switch\n                {\n                    BaseMethodDeclarationSyntax { ParameterList.Parameters.Count: > 0 } method\n                        when !ImplementsAbstractClassOrInterface(c, method) => method.ParameterList.Parameters,\n                    { } node when node.IsKind(SyntaxKindEx.LocalFunctionStatement) => ((LocalFunctionStatementSyntaxWrapper)node).ParameterList.Parameters,\n                    _ => null\n                };\n\n                if (parameters is not null)\n                {\n                    CheckArguments(c, parameters);\n                }\n            },\n            SyntaxKind.MethodDeclaration,\n            SyntaxKind.ConversionOperatorDeclaration,\n            SyntaxKindEx.LocalFunctionStatement);\n\n    private static bool ImplementsAbstractClassOrInterface(SonarSyntaxNodeReportingContext context, BaseMethodDeclarationSyntax method) =>\n        context.Model.GetDeclaredSymbol(method) is { } symbol\n        && (symbol.GetOverriddenMember() is { IsAbstract: true } || symbol.InterfaceMembers().Any());\n\n    private static bool MaxDepthReached(SyntaxNode parameterSyntax, SemanticModel model)\n    {\n        var walker = new GenericWalker(2, model);\n        walker.SafeVisit(parameterSyntax);\n        return walker.IsMaxDepthReached;\n    }\n\n    private static void CheckArguments(SonarSyntaxNodeReportingContext context, IEnumerable<ParameterSyntax> arguments)\n    {\n        foreach (var argument in arguments.Where(x => MaxDepthReached(x, context.Model)))\n        {\n            context.ReportIssue(Rule, argument);\n        }\n    }\n\n    private sealed class GenericWalker : SafeCSharpSyntaxWalker\n    {\n        private static readonly ImmutableArray<KnownType> IgnoredTypes =\n            KnownType.SystemFuncVariants\n                .Union(KnownType.SystemActionVariants)\n                .Union([KnownType.System_Linq_Expressions_Expression_T])\n                .ToImmutableArray();\n\n        private readonly int maxDepth;\n        private readonly SemanticModel model;\n\n        private int depth;\n\n        public bool IsMaxDepthReached { get; private set; }\n\n        public GenericWalker(int maxDepth, SemanticModel model)\n        {\n            this.maxDepth = maxDepth;\n            this.model = model;\n        }\n\n        public override void VisitGenericName(GenericNameSyntax node)\n        {\n            if (model.GetSymbolInfo(node).Symbol is not INamedTypeSymbol symbol)\n            {\n                return;\n            }\n\n            if (symbol.ConstructedFrom.IsAny(IgnoredTypes))\n            {\n                base.VisitGenericName(node);\n                return;\n            }\n\n            if (depth == maxDepth - 1)\n            {\n                IsMaxDepthReached = true;\n                return;\n            }\n\n            depth++;\n            base.VisitGenericName(node);\n            depth--;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DoNotOverloadOperatorEqual.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class DoNotOverloadOperatorEqual : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S3875\";\n        private const string MessageFormat = \"Remove this overload of 'operator =='.\";\n\n        private static readonly ImmutableArray<KnownType> InterfacesRelyingOnOperatorEqualOverload =\n            ImmutableArray.Create(\n                KnownType.System_IComparable,\n                KnownType.System_IComparable_T,\n                KnownType.System_IEquatable_T,\n                KnownType.System_Numerics_IEqualityOperators_TSelf_TOther_TResult);\n\n        private static readonly DiagnosticDescriptor Rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(CheckForIssue, SyntaxKind.OperatorDeclaration);\n\n        private static void CheckForIssue(SonarSyntaxNodeReportingContext analysisContext)\n        {\n            var declaration = (OperatorDeclarationSyntax)analysisContext.Node;\n\n            if (declaration.OperatorToken.IsKind(SyntaxKind.EqualsEqualsToken)\n               && declaration.Parent is ClassDeclarationSyntax classDeclaration\n               && !classDeclaration.ChildNodes()\n                      .OfType<OperatorDeclarationSyntax>()\n                      .Any(op => op.OperatorToken.IsKind(SyntaxKind.PlusToken)\n                                 || op.OperatorToken.IsKind(SyntaxKind.MinusToken))\n               && analysisContext.Model.GetDeclaredSymbol(classDeclaration) is { } namedTypeSymbol\n               && !namedTypeSymbol.ImplementsAny(InterfacesRelyingOnOperatorEqualOverload))\n            {\n                analysisContext.ReportIssue(Rule, declaration.OperatorToken);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DoNotOverwriteCollectionElements.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class DoNotOverwriteCollectionElements : DoNotOverwriteCollectionElementsBase<SyntaxKind, ExpressionStatementSyntax>\n{\n    private static readonly HashSet<SyntaxKind> IdentifierOrLiteral =\n    [\n        SyntaxKind.IdentifierName,\n        SyntaxKind.StringLiteralExpression,\n        SyntaxKind.NumericLiteralExpression,\n        SyntaxKind.CharacterLiteralExpression,\n        SyntaxKind.NullLiteralExpression,\n        SyntaxKind.TrueLiteralExpression,\n        SyntaxKind.FalseLiteralExpression\n    ];\n\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            AnalysisAction,\n            SyntaxKind.ExpressionStatement);\n\n    protected override SyntaxNode GetCollectionIdentifier(ExpressionStatementSyntax statement)\n    {\n        var assignmentOrInvocation = GetAssignmentOrInvocation(statement);\n\n        switch (assignmentOrInvocation?.Kind())\n        {\n            case SyntaxKind.InvocationExpression:\n                return GetInvokedMethodContainer((InvocationExpressionSyntax)assignmentOrInvocation)\n                    .RemoveParentheses();\n\n            case SyntaxKind.SimpleAssignmentExpression:\n                var assignment = (AssignmentExpressionSyntax)assignmentOrInvocation;\n                var elementAccess = assignment.Left as ElementAccessExpressionSyntax;\n                return GetIdentifier(elementAccess?.Expression.RemoveParentheses())\n                    .RemoveParentheses();\n\n            default:\n                return null;\n        }\n    }\n\n    protected override SyntaxNode GetIndexOrKey(ExpressionStatementSyntax statement) =>\n        GetIndexOrKeyArgument(statement)?.Expression.RemoveParentheses();\n\n    protected override bool IsIdentifierOrLiteral(SyntaxNode node) =>\n        node.IsAnyKind(IdentifierOrLiteral);\n\n    private static SyntaxNode GetAssignmentOrInvocation(StatementSyntax statement)\n    {\n        if (!(statement is ExpressionStatementSyntax expressionStatement))\n        {\n            return null;\n        }\n\n        var expression = expressionStatement.Expression;\n\n        return expression.IsKind(SyntaxKind.ConditionalAccessExpression)\n            ? ((ConditionalAccessExpressionSyntax)expression).WhenNotNull\n            : expression;\n    }\n\n    private static ArgumentSyntax GetIndexOrKeyArgument(StatementSyntax statement)\n    {\n        var assignmentOrInvocation = GetAssignmentOrInvocation(statement);\n\n        switch (assignmentOrInvocation?.Kind())\n        {\n            case SyntaxKind.InvocationExpression:\n                var invocation = (InvocationExpressionSyntax)assignmentOrInvocation;\n                return invocation.ArgumentList.Arguments.ElementAtOrDefault(0);\n\n            case SyntaxKind.SimpleAssignmentExpression:\n                var assignment = (AssignmentExpressionSyntax)assignmentOrInvocation;\n                return assignment.Left is ElementAccessExpressionSyntax elementAccess\n                    ? elementAccess.ArgumentList.Arguments.ElementAtOrDefault(0)\n                    : null;\n\n            default:\n                return null;\n        }\n    }\n\n    private static SyntaxNode GetInvokedMethodContainer(InvocationExpressionSyntax invocation)\n    {\n        var expression = invocation.Expression.RemoveParentheses();\n        switch (expression.Kind())\n        {\n            case SyntaxKind.SimpleMemberAccessExpression:\n                // a.Add(x)\n                // InvocationExpression | a.Add(x)\n                //   Expression: SimpleMemberAccess\n                //                 Name: Add\n                //                 Expression: a  // we need this\n                var memberAccess = (MemberAccessExpressionSyntax)expression;\n                return memberAccess.Name.ToString() == \"Add\" && invocation.ArgumentList?.Arguments.Count != 1 // #2674 Do not raise on ICollection.Add(item)\n                    ? memberAccess.Expression\n                    : null; // Ignore invocations that are on methods different than Add\n            case SyntaxKind.MemberBindingExpression:\n                // a?.Add(x)\n                // ConditionalExpression | a?.Add(x)\n                //   Expression: a // <-- we need this\n                //   WhenTrue: InvocationExpression | ?.Add(x)\n                //               Expression: MemberBinding   // <-- we are here\n                //                              Identifier: Add\n                var conditional = expression.Parent.Parent as ConditionalAccessExpressionSyntax;\n                return conditional?.Expression;\n            default:\n                return null;\n        }\n    }\n\n    private static SyntaxNode GetIdentifier(ExpressionSyntax expression)\n    {\n        switch (expression?.Kind())\n        {\n            case SyntaxKind.SimpleMemberAccessExpression:\n                // a.b[index]\n                // ElementAccess    // <-- we are here\n                //   Arguments: index\n                //   Expression: SimpleMemberAccess\n                //                 Expression: a\n                //                 Name: b\n                // We need a.b\n                return expression;\n            case SyntaxKind.IdentifierName:\n                // a[index]\n                // ElementAccess    // <-- we are here\n                //   Arguments: index\n                //   Expression: IdentifierName\n                //                 Name: a  // <-- we need this\n                return expression;\n            default:\n                return null;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DoNotShiftByZeroOrIntSize.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class DoNotShiftByZeroOrIntSize : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S2183\";\n        private const string MessageFormatUseLargerTypeOrPromote = \"Either promote shift target to a larger integer type or shift by {0} instead.\";\n        private const string MessageFormatShiftTooLarge = \"Correct this shift; shift by {0} instead.\";\n        private const string MessageFormatRightShiftTooLarge = \"Correct this shift; '{0}' is larger than the type size.\";\n        private const string MessageFormatUselessShift = \"Remove this useless shift by {0}.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, \"{0}\");\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        private static readonly ImmutableDictionary<KnownType, int> MapKnownTypesToIntegerBitSize\n            = new Dictionary<KnownType, int>\n            {\n                [KnownType.System_Int64] = 64,\n                [KnownType.System_UInt64] = 64,\n\n                [KnownType.System_Int32] = 32,\n                [KnownType.System_UInt32] = 32,\n\n                [KnownType.System_Int16] = 32,\n                [KnownType.System_UInt16] = 32,\n\n                [KnownType.System_Byte] = 32,\n                [KnownType.System_SByte] = 32\n            }.ToImmutableDictionary();\n\n        private enum Shift\n        {\n            Left,\n            Right\n        }\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var shiftInstances = ((MemberDeclarationSyntax)c.Node)\n                        .DescendantNodes()\n                        .Select(n => FindShiftInstance(n, c.Model))\n                        .WhereNotNull();\n\n                    var zeroShiftIssues = new List<ShiftInstance>();\n                    var linesWithShiftOperations = new HashSet<int>();\n\n                    foreach (var shift in shiftInstances)\n                    {\n                        if (shift.IsLiteralZero)\n                        {\n                            zeroShiftIssues.Add(shift);\n                            continue;\n                        }\n\n                        linesWithShiftOperations.Add(shift.Line);\n                        if (shift.Node is not null)\n                        {\n                            c.ReportIssue(Rule, shift.Node, shift.Description);\n                        }\n                    }\n\n                    foreach (var shift in zeroShiftIssues.Where(x => !ContainsShiftExpressionWithinTwoLines(linesWithShiftOperations, x.Line)))\n                    {\n                        c.ReportIssue(Rule, shift.Node, shift.Description);\n                    }\n                },\n                SyntaxKind.MethodDeclaration,\n                SyntaxKind.PropertyDeclaration);\n\n        private static bool ContainsShiftExpressionWithinTwoLines(HashSet<int> linesWithShiftOperations, int lineNumber) =>\n            linesWithShiftOperations.Contains(lineNumber - 2)\n            || linesWithShiftOperations.Contains(lineNumber - 1)\n            || linesWithShiftOperations.Contains(lineNumber)\n            || linesWithShiftOperations.Contains(lineNumber + 1)\n            || linesWithShiftOperations.Contains(lineNumber + 2);\n\n        private static Tuple<Shift, ExpressionSyntax> GetRhsArgumentOfShiftNode(SyntaxNode node)\n        {\n            var binaryExpression = node as BinaryExpressionSyntax;\n            if (binaryExpression?.OperatorToken.IsKind(SyntaxKind.LessThanLessThanToken) ?? false)\n            {\n                return new Tuple<Shift, ExpressionSyntax>(Shift.Left, binaryExpression.Right);\n            }\n\n            if (binaryExpression?.OperatorToken.IsAnyKind(SyntaxKind.GreaterThanGreaterThanToken, SyntaxKindEx.GreaterThanGreaterThanGreaterThanToken) ?? false)\n            {\n                return new Tuple<Shift, ExpressionSyntax>(Shift.Right, binaryExpression.Right);\n            }\n\n            var assignmentExpession = node as AssignmentExpressionSyntax;\n            if (assignmentExpession?.OperatorToken.IsKind(SyntaxKind.LessThanLessThanEqualsToken) ?? false)\n            {\n                return new Tuple<Shift, ExpressionSyntax>(Shift.Left, assignmentExpession.Right);\n            }\n\n            if (assignmentExpession?.OperatorToken.IsAnyKind(SyntaxKind.GreaterThanGreaterThanEqualsToken, SyntaxKindEx.GreaterThanGreaterThanGreaterThanEqualsToken) ?? false)\n            {\n                return new Tuple<Shift, ExpressionSyntax>(Shift.Right, assignmentExpession.Right);\n            }\n\n            return null;\n        }\n\n        private static bool TryGetConstantValue(ExpressionSyntax expression, out int value)\n        {\n            value = 0;\n            return expression.RemoveParentheses() is LiteralExpressionSyntax literalExpression\n                && int.TryParse(literalExpression.Token.ValueText, out value);\n        }\n\n        private static ShiftInstance FindShiftInstance(SyntaxNode node, SemanticModel semanticModel)\n        {\n            var tuple = GetRhsArgumentOfShiftNode(node);\n            if (tuple == null)\n            {\n                return null;\n            }\n\n            if (!TryGetConstantValue(tuple.Item2, out var shiftByCount)\n                || semanticModel.GetTypeInfo(node).ConvertedType is not { } typeSymbol\n                || (FindTypeSizeOrDefault(typeSymbol) is var variableBitLength && variableBitLength == 0))\n            {\n                return new ShiftInstance(node);\n            }\n\n            var issueDescription = FindProblemDescription(variableBitLength, shiftByCount, tuple.Item1, out var isLiteralZero);\n            return issueDescription == null ? new ShiftInstance(node) : new ShiftInstance(issueDescription, isLiteralZero, node);\n        }\n\n        private static int FindTypeSizeOrDefault(ITypeSymbol typeSymbol) =>\n            MapKnownTypesToIntegerBitSize\n                .Where(kv => typeSymbol.Is(kv.Key))\n                .Select(kv => kv.Value)\n                .FirstOrDefault();\n\n        private static string FindProblemDescription(int typeSizeInBits, int shiftBy, Shift shiftDirection, out bool isLiteralZero)\n        {\n            if (shiftBy == 0)\n            {\n                isLiteralZero = true;\n                return string.Format(MessageFormatUselessShift, 0);\n            }\n\n            isLiteralZero = false;\n\n            if (shiftBy < typeSizeInBits)\n            {\n                return null;\n            }\n\n            if (shiftDirection == Shift.Right)\n            {\n                return string.Format(MessageFormatRightShiftTooLarge, shiftBy);\n            }\n\n            var shiftSuggestion = shiftBy % typeSizeInBits;\n\n            if (typeSizeInBits == 64)\n            {\n                return shiftSuggestion == 0\n                    ? string.Format(MessageFormatUselessShift, shiftBy)\n                    : string.Format(MessageFormatShiftTooLarge, shiftSuggestion);\n            }\n\n            if (shiftSuggestion == 0)\n            {\n                return string.Format(MessageFormatUseLargerTypeOrPromote,\n                    \"less than \" + typeSizeInBits);\n            }\n\n            return string.Format(MessageFormatUseLargerTypeOrPromote, shiftSuggestion);\n        }\n\n        private sealed class ShiftInstance\n        {\n            public string Description { get; }\n            public SyntaxNode Node { get; }\n            public bool IsLiteralZero { get; }\n            public int Line { get; }\n\n            public ShiftInstance(SyntaxNode node) =>\n                Line = node.LineNumberToReport();\n\n            public ShiftInstance(string description, bool isLiteralZero, SyntaxNode node)\n                : this(node)\n            {\n                Description = description;\n                IsLiteralZero = isLiteralZero;\n                Node = node;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DoNotTestThisWithIsOperator.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class DoNotTestThisWithIsOperator : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S3060\";\n        private const string MessageFormat = \"Offload the code that's conditional on this type test to the appropriate subclass and remove the condition.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(AnalyzeIsExpression, SyntaxKind.IsExpression);\n            context.RegisterNodeAction(AnalyzeIsPatternExpression, SyntaxKindEx.IsPatternExpression);\n            context.RegisterNodeAction(AnalyzeSwitchExpression, SyntaxKindEx.SwitchExpression);\n            context.RegisterNodeAction(AnalyzeSwitchStatement, SyntaxKind.SwitchStatement);\n        }\n\n        private static void AnalyzeIsExpression(SonarSyntaxNodeReportingContext context)\n        {\n            if (IsThisExpressionSyntax(((BinaryExpressionSyntax)context.Node).Left))\n            {\n                ReportDiagnostic(context, context.Node);\n            }\n        }\n\n        private static void AnalyzeIsPatternExpression(SonarSyntaxNodeReportingContext context)\n        {\n            if (IsThisExpressionSyntax(((IsPatternExpressionSyntaxWrapper)context.Node).Expression) && ContainsTypeCheckInPattern(context.Node))\n            {\n                ReportDiagnostic(context, context.Node);\n            }\n        }\n\n        private static void AnalyzeSwitchStatement(SonarSyntaxNodeReportingContext context)\n        {\n            var switchStatement = (SwitchStatementSyntax)context.Node;\n            if (IsThisExpressionSyntax(switchStatement.Expression))\n            {\n                ReportDiagnostic(context, switchStatement.Expression, CollectSecondaryLocations(switchStatement));\n            }\n        }\n\n        private static void AnalyzeSwitchExpression(SonarSyntaxNodeReportingContext context)\n        {\n            var switchExpression = (SwitchExpressionSyntaxWrapper)context.Node;\n            if (IsThisExpressionSyntax(switchExpression.GoverningExpression))\n            {\n                 ReportDiagnostic(context, switchExpression.GoverningExpression, CollectSecondaryLocations(switchExpression));\n            }\n        }\n\n        private static IList<SecondaryLocation> CollectSecondaryLocations(SwitchStatementSyntax switchStatement) =>\n            switchStatement.Sections\n                .SelectMany(section => section.Labels\n                    .Where(label => ContainsTypeCheckInPattern(label) || ContainsTypeCheckInCaseSwitchLabel(label))\n                    .Select(label => new SecondaryLocation(TypeMatchLocation(label), string.Empty)))\n                .ToList();\n\n        private static IList<SecondaryLocation> CollectSecondaryLocations(SwitchExpressionSyntaxWrapper switchExpression) =>\n            switchExpression.Arms.Where(arm => ContainsTypeCheckInPattern(arm.Pattern.SyntaxNode))\n                .Select(arm => new SecondaryLocation(arm.Pattern.SyntaxNode.GetLocation(), string.Empty))\n                .ToList();\n\n        private static bool ContainsTypeCheckInCaseSwitchLabel(SwitchLabelSyntax switchLabel) =>\n            switchLabel is CaseSwitchLabelSyntax caseSwitchLabel && caseSwitchLabel.Value.IsKind(SyntaxKind.IdentifierName);\n\n        private static bool ContainsTypeCheckInPattern(SyntaxNode node) =>\n            node.DescendantNodesAndSelf()\n                .Any(x =>\n                    x.Kind() is SyntaxKindEx.ConstantPattern or SyntaxKindEx.DeclarationPattern or SyntaxKindEx.RecursivePattern or SyntaxKindEx.ListPattern\n                    && IsTypeCheckOnThis(x));\n\n        private static bool IsTypeCheckOnThis(SyntaxNode pattern)\n        {\n            if (ConstantPatternSyntaxWrapper.IsInstance(pattern))\n            {\n                return ((ConstantPatternSyntaxWrapper)pattern).Expression.IsKind(SyntaxKind.IdentifierName) && IsNotInSubPattern(pattern);\n            }\n            else if (DeclarationPatternSyntaxWrapper.IsInstance(pattern))\n            {\n                return IsNotInSubPattern(pattern);\n            }\n            else if (RecursivePatternSyntaxWrapper.IsInstance(pattern))\n            {\n                return ((RecursivePatternSyntaxWrapper)pattern).Type != null && IsNotInSubPattern(pattern);\n            }\n            else if (ListPatternSyntaxWrapper.IsInstance(pattern))\n            {\n                return IsNotInSubPattern(pattern);\n            }\n            else\n            {\n                return false;\n            }\n        }\n\n        private static bool IsNotInSubPattern(SyntaxNode node) =>\n            !node.FirstAncestorOrSelf<SyntaxNode>(x => x?.Kind() is\n                SyntaxKindEx.IsPatternExpression or\n                SyntaxKindEx.SwitchExpression or\n                SyntaxKind.SwitchStatement or\n                SyntaxKindEx.Subpattern)\n            .IsKind(SyntaxKindEx.Subpattern);\n\n        private static void ReportDiagnostic(SonarSyntaxNodeReportingContext context, SyntaxNode node) =>\n            context.ReportIssue(Rule, node);\n\n        private static void ReportDiagnostic(SonarSyntaxNodeReportingContext context, SyntaxNode node, IList<SecondaryLocation> secondaryLocations)\n        {\n            if (secondaryLocations.Any())\n            {\n                context.ReportIssue(Rule, node, secondaryLocations);\n            }\n        }\n\n        private static Location TypeMatchLocation(SwitchLabelSyntax label)\n        {\n            if (label is CaseSwitchLabelSyntax caseSwitchLabel)\n            {\n                return caseSwitchLabel.Value.GetLocation();\n            }\n            else if (CasePatternSwitchLabelSyntaxWrapper.IsInstance(label))\n            {\n                return ((CasePatternSwitchLabelSyntaxWrapper)label).Pattern.SyntaxNode.GetLocation();\n            }\n            else\n            {\n                return Location.None;\n            }\n        }\n\n        private static bool IsThisExpressionSyntax(SyntaxNode syntaxNode) =>\n            syntaxNode.RemoveParentheses() is ThisExpressionSyntax;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DoNotThrowFromDestructors.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class DoNotThrowFromDestructors : DoNotThrowFromDestructorsBase\n    {\n        private const string MessageFormat = \"Remove this 'throw' statement.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    if (c.Node.FirstAncestorOrSelf<BaseMethodDeclarationSyntax>() is DestructorDeclarationSyntax)\n                    {\n                        c.ReportIssue(rule, c.Node);\n                    }\n                },\n                SyntaxKind.ThrowStatement,\n                SyntaxKindEx.ThrowExpression);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DoNotUseCollectionInItsOwnMethodCalls.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class DoNotUseCollectionInItsOwnMethodCalls : SonarDiagnosticAnalyzer\n{\n    internal const string DiagnosticId = \"S2114\";\n    private const string MessageFormat = \"Change one instance of '{0}' to a different value; {1}\";\n    private const string AlwaysEmptyCollectionMessage = \"This operation always produces an empty collection.\";\n    private const string AlwaysSameCollectionMessage = \"This operation always produces the same collection.\";\n    private const string AlwaysTrueMessage = \"Comparing to itself always returns true.\";\n    private const string AlwaysFalseMessage = \"Comparing to itself always returns false.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    private static readonly ISet<string> TrackedMethodNames = new HashSet<string>\n    {\n        nameof(Enumerable.Except),\n        nameof(ISet<object>.ExceptWith),\n        nameof(Enumerable.Intersect),\n        nameof(ISet<object>.IntersectWith),\n        nameof(ISet<object>.IsSubsetOf),\n        nameof(ISet<object>.IsSupersetOf),\n        nameof(ISet<object>.IsProperSubsetOf),\n        nameof(ISet<object>.IsProperSupersetOf),\n        nameof(ISet<object>.Overlaps),\n        nameof(Enumerable.SequenceEqual),\n        nameof(ISet<object>.SetEquals),\n        nameof(ISet<object>.SymmetricExceptWith),\n        nameof(Enumerable.Union),\n        nameof(ISet<object>.UnionWith)\n    };\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            c =>\n            {\n                var invocation = (InvocationExpressionSyntax)c.Node;\n                if (invocation.GetMethodCallIdentifier() is { } identifier\n                    && TrackedMethodNames.Any(x => identifier.ValueText.EndsWith(x, StringComparison.Ordinal))\n                    && OperandsToCheckIfTrackedMethod(invocation, c.Model) is { } operands\n                    && CSharpEquivalenceChecker.AreEquivalent(operands.Left, operands.Right))\n                {\n                    c.ReportIssue(Rule, operands.Left, [operands.Right.ToSecondaryLocation()], operands.Right.ToString(), operands.ErrorMessage);\n                }\n            },\n            SyntaxKind.InvocationExpression);\n\n    private static OperandsToCheck? OperandsToCheckIfTrackedMethod(InvocationExpressionSyntax invocation, SemanticModel model)\n    {\n        var methodSymbol = model.GetSymbolInfo(invocation).Symbol as IMethodSymbol;\n        if (ProcessIssueMessage(methodSymbol) is { } message)\n        {\n            if (methodSymbol is { IsExtensionMethod: true, MethodKind: MethodKind.Ordinary } && invocation is { ArgumentList.Arguments: { Count: >= 2 } extensionArgs })\n            {\n                return new(extensionArgs[0].Expression, extensionArgs[1].Expression, message);\n            }\n            else if (invocation is { Expression: MemberAccessExpressionSyntax { Expression: { } invokingExpression }, ArgumentList.Arguments: { Count: >= 1 } memberArgs })\n            {\n                return new(invokingExpression, memberArgs[0].Expression, message);\n            }\n        }\n        return null;\n    }\n\n    private static string ProcessIssueMessage(IMethodSymbol methodSymbol)\n    {\n        if (methodSymbol.IsEnumerableIntersect()\n            || methodSymbol.IsEnumerableUnion()\n            || IsAnySetMethod(methodSymbol, nameof(ISet<object>.UnionWith), nameof(ISet<object>.IntersectWith)))\n        {\n            return AlwaysSameCollectionMessage;\n        }\n        else if (methodSymbol.IsEnumerableSequenceEqual()\n            || IsAnySetMethod(methodSymbol, nameof(ISet<object>.IsSubsetOf), nameof(ISet<object>.IsSupersetOf), nameof(ISet<object>.Overlaps), nameof(ISet<object>.SetEquals)))\n        {\n            return AlwaysTrueMessage;\n        }\n        else if (methodSymbol.IsEnumerableExcept()\n            || IsAnySetMethod(methodSymbol, nameof(ISet<object>.ExceptWith), nameof(ISet<object>.SymmetricExceptWith)))\n        {\n            return AlwaysEmptyCollectionMessage;\n        }\n        else if (IsAnySetMethod(methodSymbol, nameof(ISet<object>.IsProperSubsetOf), nameof(ISet<object>.IsProperSupersetOf), nameof(ISet<object>.IsProperSupersetOf)))\n        {\n            return AlwaysFalseMessage;\n        }\n        return null;\n    }\n\n    private static bool IsAnySetMethod(IMethodSymbol methodSymbol, params string[] methodNames) =>\n        methodSymbol is { MethodKind: MethodKind.Ordinary, Parameters.Length: 1 }\n        && methodNames.Contains(methodSymbol.Name, StringComparer.Ordinal)\n        && methodSymbol.ContainingType.Implements(KnownType.System_Collections_Generic_ISet_T);\n\n    private readonly record struct OperandsToCheck\n    {\n        public ExpressionSyntax Left { get; }\n\n        public ExpressionSyntax Right { get; }\n\n        public string ErrorMessage { get; }\n\n        public OperandsToCheck(ExpressionSyntax left, ExpressionSyntax right, string errorMessage)\n        {\n            Left = left.RemoveParentheses();\n            Right = right.RemoveParentheses();\n            ErrorMessage = errorMessage;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DoNotUseDateTimeNow.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class DoNotUseDateTimeNow : DoNotUseDateTimeNowBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override bool IsInsideNameOf(SyntaxNode node) =>\n        node.Ancestors()\n            .OfType<InvocationExpressionSyntax>()\n            .Any(x => x.Expression is IdentifierNameSyntax { Identifier.ValueText: \"nameof\" });\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DoNotUseLiteralBoolInAssertions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class DoNotUseLiteralBoolInAssertions : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S2701\";\n        private const string MessageFormat = \"Remove or correct this assertion.\";\n\n        private static readonly Dictionary<KnownType, HashSet<string>> TrackedTypeAndMethods =\n            new()\n            {\n                [KnownType.Xunit_Assert] =\n                [\n                    // \"True\" and \"False\" are not here because there was no Assert.Fail in Xunit until 2020 and Assert.True(false) and Assert.False(true) were some ways to simulate it.\n                    \"Equal\", \"NotEqual\", \"Same\", \"NotSame\", \"StrictEqual\", \"NotStrictEqual\", \"Equivalent\"\n                ],\n\n                [KnownType.Microsoft_VisualStudio_TestTools_UnitTesting_Assert] =\n                [\n                    \"AreEqual\", \"AreNotEqual\", \"AreSame\", \"IsFalse\", \"IsTrue\"\n                ],\n\n                [KnownType.NUnit_Framework_Assert] =\n                [\n                    \"AreEqual\", \"AreNotEqual\", \"AreNotSame\", \"AreSame\", \"False\",\n                    \"IsFalse\", \"IsTrue\", \"That\", \"True\"\n                ],\n\n                [KnownType.NUnit_Framework_Legacy_ClassicAssert] =\n                [\n                    \"AreEqual\", \"AreNotEqual\", \"AreNotSame\", \"AreSame\", \"False\",\n                    \"IsFalse\", \"IsTrue\", \"True\"\n                ],\n\n                [KnownType.System_Diagnostics_Debug] =\n                [\n                    \"Assert\"\n                ]\n            };\n\n        private static readonly ISet<SyntaxKind> BoolLiterals =\n            new HashSet<SyntaxKind>\n            {\n                SyntaxKind.TrueLiteralExpression,\n                SyntaxKind.FalseLiteralExpression\n            };\n\n        private static readonly DiagnosticDescriptor Rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var invocation = (InvocationExpressionSyntax)c.Node;\n                    if (invocation.ArgumentList != null\n                        && IsFirstOrSecondArgumentABoolLiteral(invocation.ArgumentList.Arguments)\n                        && c.Model.GetSymbolOrCandidateSymbol(invocation) is IMethodSymbol methodSymbol\n                        && IsTrackedMethod(methodSymbol)\n                        && !IsWorkingWithNullableType(methodSymbol, invocation.ArgumentList.Arguments, c.Model))\n                    {\n                        c.ReportIssue(Rule, invocation);\n                    }\n                },\n                SyntaxKind.InvocationExpression);\n\n        private static bool IsWorkingWithNullableType(IMethodSymbol methodSymbol, SeparatedSyntaxList<ArgumentSyntax> arguments, SemanticModel semanticModel)\n        {\n            if (methodSymbol.TypeArguments.Length == 1) // We usually expect all comparison test methods to have one generic argument\n            {\n                // Since we already know we are comparing with bool, no need to check Nullable<bool>, Nullable<T> is enough\n                return methodSymbol.TypeArguments[0].OriginalDefinition.Is(KnownType.System_Nullable_T);\n            }\n            else if (methodSymbol.TypeArguments.Length == 0) // But they can also work with Object (NUnit...)\n            {\n                if (arguments.Count != 2)\n                {\n                    return false;\n                }\n                var nonBoolLiteral = IsBooleanLiteral(arguments[0]) ? arguments[1] : arguments[0];\n                var nonBoolType = semanticModel.GetTypeInfo(nonBoolLiteral.Expression);\n                return nonBoolType.Type?.OriginalDefinition.Is(KnownType.System_Nullable_T) ?? false;\n            }\n            else\n            {\n                // Other case, not handled\n                return false;\n            }\n        }\n\n        private static bool IsFirstOrSecondArgumentABoolLiteral(SeparatedSyntaxList<ArgumentSyntax> arguments) =>\n            arguments.Count switch\n            {\n                0 => false,\n                1 => IsBooleanLiteral(arguments[0]),\n                _ => IsBooleanLiteral(arguments[0]) || IsBooleanLiteral(arguments[1]),\n            };\n\n        private static bool IsBooleanLiteral(ArgumentSyntax argument) =>\n            argument.Expression.IsAnyKind(BoolLiterals);\n\n        private static bool IsTrackedMethod(ISymbol methodSymbol) =>\n            TrackedTypeAndMethods\n                .Where(kvp => methodSymbol.ContainingType.Is(kvp.Key))\n                .Any(kvp => kvp.Value.Contains(methodSymbol.Name));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DoNotUseOutRefParameters.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class DoNotUseOutRefParameters : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S3874\";\n        private const string MessageFormat = \"Consider refactoring this method in order to remove the need for this '{0}' modifier.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var parameter = (ParameterSyntax)c.Node;\n\n                    if (!parameter.Modifiers.Any(IsRefOrOut)\n                        || (parameter is { Parent: ParameterListSyntax { Parent: MethodDeclarationSyntax method } } && method.IsDeconstructor()))\n                    {\n                        return;\n                    }\n\n                    var modifier = parameter.Modifiers.First(IsRefOrOut);\n\n                    var parameterSymbol = c.Model.GetDeclaredSymbol(parameter);\n\n                    if (parameterSymbol?.ContainingSymbol is not IMethodSymbol containingMethod\n                        || containingMethod.IsOverride\n                        || !containingMethod.IsPubliclyAccessible()\n                        || IsTryPattern(containingMethod, modifier)\n                        || containingMethod.InterfaceMembers().Any())\n                    {\n                        return;\n                    }\n\n                    c.ReportIssue(Rule, modifier, modifier.ValueText);\n                },\n                SyntaxKind.Parameter);\n\n        private static bool IsTryPattern(IMethodSymbol method, SyntaxToken modifier) =>\n            method.Name.StartsWith(\"Try\", StringComparison.Ordinal)\n            && method.ReturnType.Is(KnownType.System_Boolean)\n            && modifier.IsKind(SyntaxKind.OutKeyword);\n\n        private static bool IsRefOrOut(SyntaxToken token) =>\n            token.IsKind(SyntaxKind.RefKeyword)\n            || token.IsKind(SyntaxKind.OutKeyword);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DoNotWriteToStandardOutput.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class DoNotWriteToStandardOutput : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S106\";\n    private const string MessageFormat = \"Remove this logging statement.\";\n\n    private static readonly string[] BannedConsoleMembers = [\"WriteLine\", \"Write\"];\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    protected static DiagnosticDescriptor Rule =>\n        DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    protected sealed override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var invocation = (InvocationExpressionSyntax)c.Node;\n                if (c.Compilation.Options.OutputKind != OutputKind.ConsoleApplication\n                    && c.Model.GetSymbolInfo(invocation.Expression).Symbol is IMethodSymbol method\n                    && method.IsAny(KnownType.System_Console, BannedConsoleMembers)\n                    && !c.Node.IsInDebugBlock()\n                    && !invocation.IsInConditionalDebug(c.Model))\n                {\n                    c.ReportIssue(Rule, invocation.Expression);\n                }\n            },\n            SyntaxKind.InvocationExpression);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DontMixIncrementOrDecrementWithOtherOperators.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class DontMixIncrementOrDecrementWithOtherOperators : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S881\";\n        private const string MessageFormat = \"Extract this {0} operation into a dedicated statement.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        private static readonly ISet<SyntaxKind> arithmeticOperator =\n            new HashSet<SyntaxKind>\n            {\n                SyntaxKind.AddExpression,\n                SyntaxKind.SubtractExpression,\n                SyntaxKind.MultiplyExpression,\n                SyntaxKind.DivideExpression,\n                SyntaxKind.ModuloExpression\n            };\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var operatorToken = (c.Node as PrefixUnaryExpressionSyntax)?.OperatorToken\n                            ?? (c.Node as PostfixUnaryExpressionSyntax)?.OperatorToken;\n\n                    if (operatorToken != null &&\n                        c.Node.Ancestors().FirstOrDefault(node => node.IsAnyKind(arithmeticOperator)) is BinaryExpressionSyntax)\n                    {\n                        c.ReportIssue(rule, operatorToken.Value, operatorToken.Value.IsKind(SyntaxKind.PlusPlusToken) ? \"increment\" : \"decrement\");\n                    }\n                },\n                SyntaxKind.PreDecrementExpression,\n                SyntaxKind.PreIncrementExpression,\n                SyntaxKind.PostDecrementExpression,\n                SyntaxKind.PostIncrementExpression);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DontUseTraceSwitchLevels.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class DontUseTraceSwitchLevels : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S6675\";\n    private const string MessageFormat = \"'Trace.{0}' should not be used with 'TraceSwitch' levels.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    private static readonly ImmutableArray<string> TraceSwitchProperties = ImmutableArray.Create(\n        \"Level\",\n        \"TraceError\",\n        \"TraceInfo\",\n        \"TraceVerbose\",\n        \"TraceWarning\");\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var invocation = (InvocationExpressionSyntax)c.Node;\n                if (invocation.GetName() is \"WriteIf\" or \"WriteLineIf\"\n                    && invocation.ArgumentList.Arguments.Count > 1\n                    && c.Model.GetSymbolInfo(invocation).Symbol is IMethodSymbol methodSymbol\n                    && methodSymbol.ContainingType.Is(KnownType.System_Diagnostics_Trace)\n                    && UsesTraceSwitchAsCondition(c.Model, methodSymbol, invocation) is { } traceSwitchProperty)\n                {\n                    c.ReportIssue(Rule, traceSwitchProperty, invocation.GetName());\n                }\n            },\n            SyntaxKind.InvocationExpression);\n\n    private static SyntaxNode UsesTraceSwitchAsCondition(SemanticModel model, IMethodSymbol methodSymbol, InvocationExpressionSyntax invocation)\n    {\n        var lookup = new CSharpMethodParameterLookup(invocation.ArgumentList, methodSymbol);\n        lookup.TryGetSyntax(\"condition\", out var expressions);\n        var conditionArgument = expressions[0];\n        return conditionArgument.DescendantNodesAndSelf().FirstOrDefault(x => x is MemberAccessExpressionSyntax memberAccess\n            && TraceSwitchProperties.Contains(memberAccess.GetName())\n            && model.GetTypeInfo(memberAccess.Expression).Type.DerivesFrom(KnownType.System_Diagnostics_TraceSwitch));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/DontUseTraceWrite.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class DontUseTraceWrite : DoNotCallMethodsBase<SyntaxKind, InvocationExpressionSyntax>\n{\n    private const string DiagnosticId = \"S6670\";\n\n    protected override string MessageFormat => \"Avoid using {0}, use instead methods that specify the trace event type.\";\n\n    protected override IEnumerable<MemberDescriptor> CheckedMethods => [\n        new(KnownType.System_Diagnostics_Trace, \"Write\"),\n        new(KnownType.System_Diagnostics_Trace, \"WriteLine\")\n    ];\n\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override bool ShouldReportOnMethodCall(InvocationExpressionSyntax invocation, SemanticModel semanticModel, MemberDescriptor memberDescriptor)\n    {\n        var methodSymbol = (IMethodSymbol)semanticModel.GetSymbolInfo(invocation).Symbol;\n        return !methodSymbol.Parameters.Any(x => x.Name == \"category\");\n    }\n\n    public DontUseTraceWrite() : base(DiagnosticId) { }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/EmptyMethod.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class EmptyMethod : EmptyMethodBase<SyntaxKind>\n    {\n        internal static readonly HashSet<SyntaxKind> SupportedSyntaxKinds =\n        [\n            SyntaxKind.MethodDeclaration,\n            SyntaxKindEx.LocalFunctionStatement,\n            SyntaxKind.SetAccessorDeclaration,\n            SyntaxKindEx.InitAccessorDeclaration\n        ];\n\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n        protected override HashSet<SyntaxKind> SyntaxKinds => SupportedSyntaxKinds;\n\n        protected override void CheckMethod(SonarSyntaxNodeReportingContext context)\n        {\n            // No need to check for ExpressionBody as arrowed methods can't be empty\n            if (context.Node.GetBody() is { } body\n                && body.IsEmpty()\n                && !ShouldBeExcluded(context, context.Node, context.Node.GetModifiers()))\n            {\n                context.ReportIssue(Rule, ReportingToken(context.Node));\n            }\n        }\n\n        private static bool ShouldBeExcluded(SonarSyntaxNodeReportingContext context, SyntaxNode node, SyntaxTokenList modifiers) =>\n            modifiers.Any(SyntaxKind.VirtualKeyword) // This quick check only works for methods, for accessors we need to check the symbol\n            || (context.Model.GetDeclaredSymbol(node) is IMethodSymbol symbol\n                && (symbol is { IsVirtual: true }\n                    || symbol is { IsOverride: true, OverriddenMethod.IsAbstract: true }\n                    || !symbol.ExplicitOrImplicitInterfaceImplementations().IsEmpty))\n            || (modifiers.Any(SyntaxKind.OverrideKeyword) && context.IsTestProject());\n\n        private static SyntaxToken ReportingToken(SyntaxNode node) =>\n            node switch\n            {\n                MethodDeclarationSyntax method => method.Identifier,\n                AccessorDeclarationSyntax accessor => accessor.Keyword,\n                _ => ((LocalFunctionStatementSyntaxWrapper)node).Identifier\n            };\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/EmptyMethodCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Formatting;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class EmptyMethodCodeFix : SonarCodeFix\n    {\n        internal const string TitleThrow = \"Throw NotSupportedException\";\n        internal const string TitleComment = \"Add comment\";\n\n        private const string LiteralNotSupportedException = \"NotSupportedException\";\n        private const string LiteralSystem = \"System\";\n\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(EmptyMethod.DiagnosticId);\n\n        protected override async Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            if (root.FindNode(context.Diagnostics.First().Location.SourceSpan, getInnermostNodeForTie: true)\n                .FirstAncestorOrSelf<SyntaxNode>(x => x.IsAnyKind(EmptyMethod.SupportedSyntaxKinds))\n                .GetBody() is { CloseBraceToken.IsMissing: false, OpenBraceToken.IsMissing: false } body)\n            {\n                await RegisterCodeFixesForMethodsAsync(context, root, body).ConfigureAwait(false);\n            }\n        }\n\n        private static async Task RegisterCodeFixesForMethodsAsync(SonarCodeFixContext context, SyntaxNode root, BlockSyntax methodBody)\n        {\n            context.RegisterCodeFix(\n                TitleComment,\n                c =>\n                {\n                    var newMethodBody = methodBody;\n                    newMethodBody = newMethodBody\n                        .WithOpenBraceToken(newMethodBody.OpenBraceToken\n                            .WithTrailingTrivia(SyntaxFactory.TriviaList()\n                                .Add(SyntaxFactory.EndOfLine(Environment.NewLine))));\n\n                    newMethodBody = newMethodBody\n                        .WithCloseBraceToken(newMethodBody.CloseBraceToken\n                            .WithLeadingTrivia(SyntaxFactory.TriviaList()\n                                .Add(SyntaxFactory.Comment(\"// Method intentionally left empty.\"))\n                                .Add(SyntaxFactory.EndOfLine(Environment.NewLine))));\n\n                    var newRoot = methodBody.Parent is AccessorDeclarationSyntax accessor\n                        ? root.ReplaceNode(\n                            accessor,\n                            accessor.WithBody(newMethodBody.WithTriviaFrom(accessor.Body)).WithAdditionalAnnotations(Formatter.Annotation))\n                        : root.ReplaceNode(\n                            methodBody,\n                            newMethodBody.WithTriviaFrom(methodBody).WithAdditionalAnnotations(Formatter.Annotation));\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n\n            var semanticModel = await context.Document.GetSemanticModelAsync(context.Cancel).ConfigureAwait(false);\n\n            var systemNeedsToBeAdded = NamespaceNeedsToBeAdded(methodBody, semanticModel);\n\n            var memberAccessRoot = systemNeedsToBeAdded\n                ? (NameSyntax)SyntaxFactory.QualifiedName(\n                        SyntaxFactory.IdentifierName(LiteralSystem),\n                        SyntaxFactory.IdentifierName(LiteralNotSupportedException))\n                : SyntaxFactory.IdentifierName(LiteralNotSupportedException);\n\n            context.RegisterCodeFix(\n                TitleThrow,\n                c =>\n                {\n                    var newRoot = root.ReplaceNode(methodBody,\n                        methodBody.WithStatements(\n                            SyntaxFactory.List(\n                                new StatementSyntax[]\n                                {\n                                    SyntaxFactory.ThrowStatement(\n                                        SyntaxFactory.ObjectCreationExpression(\n                                            memberAccessRoot,\n                                            SyntaxFactory.ArgumentList(),\n                                            null))\n                                }))\n                                .WithTriviaFrom(methodBody)\n                                .WithAdditionalAnnotations(Formatter.Annotation));\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n        }\n\n        private static bool NamespaceNeedsToBeAdded(BlockSyntax methodBody, SemanticModel semanticModel) =>\n            semanticModel.LookupNamespacesAndTypes(methodBody.CloseBraceToken.SpanStart)\n                .All(x => x is not INamedTypeSymbol { IsType: true, Name: LiteralNotSupportedException, ContainingNamespace.Name: LiteralSystem });\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/EmptyNamespace.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class EmptyNamespace : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S3261\";\n        private const string MessageFormat = \"Remove this empty namespace.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var namespaceDeclaration = (BaseNamespaceDeclarationSyntaxWrapper)c.Node;\n                    if (!namespaceDeclaration.Members.Any())\n                    {\n                        c.ReportIssue(Rule, namespaceDeclaration.SyntaxNode);\n                    }\n                },\n                SyntaxKind.NamespaceDeclaration,\n                SyntaxKindEx.FileScopedNamespaceDeclaration);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/EmptyNamespaceCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class EmptyNamespaceCodeFix : SonarCodeFix\n    {\n        internal const string Title = \"Remove empty namespace\";\n        public override ImmutableArray<string> FixableDiagnosticIds =>\n            ImmutableArray.Create(EmptyNamespace.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n\n            var syntaxNode = root.FindNode(diagnosticSpan);\n\n            if (!BaseNamespaceDeclarationSyntaxWrapper.IsInstance(syntaxNode))\n            {\n                return Task.CompletedTask;\n            }\n\n            context.RegisterCodeFix(\n                Title,\n                c =>\n                {\n                    var newRoot = root.RemoveNode(syntaxNode, SyntaxRemoveOptions.KeepNoTrivia);\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n\n            return Task.CompletedTask;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/EmptyNestedBlock.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class EmptyNestedBlock : EmptyNestedBlockBase<SyntaxKind>\n    {\n        private static readonly HashSet<SyntaxKind> AllowedContainerKinds =\n        [\n            SyntaxKind.ConstructorDeclaration,\n            SyntaxKind.DestructorDeclaration,\n            SyntaxKind.MethodDeclaration,\n            SyntaxKind.SimpleLambdaExpression,\n            SyntaxKind.ParenthesizedLambdaExpression,\n            SyntaxKind.AnonymousMethodExpression\n        ];\n\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n        protected override SyntaxKind[] SyntaxKinds { get; } =\n        [\n                SyntaxKind.Block,\n                SyntaxKind.SwitchStatement\n        ];\n\n        protected override IEnumerable<SyntaxNode> EmptyBlocks(SyntaxNode node) =>\n            (node is SwitchStatementSyntax switchNode && IsEmpty(switchNode))\n                || (node is BlockSyntax blockNode && IsNestedAndEmpty(blockNode))\n                    ? [node]\n                    : Enumerable.Empty<SyntaxNode>();\n\n        private static bool IsEmpty(SwitchStatementSyntax node) =>\n            !node.Sections.Any();\n\n        private static bool IsNestedAndEmpty(BlockSyntax node) =>\n            IsNested(node) && node.IsEmpty();\n\n        private static bool IsNested(BlockSyntax node) =>\n            !node.Parent.IsAnyKind(AllowedContainerKinds);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/EmptyStatement.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class EmptyStatement : SonarDiagnosticAnalyzer\n{\n    internal const string DiagnosticId = \"S1116\";\n    private const string MessageFormat = \"Remove this empty statement.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            c =>\n            {\n                if (c.Node.Parent is not (WhileStatementSyntax or ForStatementSyntax or DoStatementSyntax)) // loops are excluded to reduce noise\n                {\n                    c.ReportIssue(Rule, c.Node);\n                }\n            },\n            SyntaxKind.EmptyStatement);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/EmptyStatementCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class EmptyStatementCodeFix : SonarCodeFix\n    {\n        internal const string Title = \"Remove empty statement\";\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(EmptyStatement.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            var syntaxNode = root.FindNode(diagnosticSpan);\n\n            if (!IsInBlock(syntaxNode))\n            {\n                return Task.CompletedTask;\n            }\n\n            context.RegisterCodeFix(\n                Title,\n                c =>\n                {\n                    var newRoot = RemoveUnusedCode(root, syntaxNode);\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n\n            return Task.CompletedTask;\n        }\n\n        private static bool IsInBlock(SyntaxNode node)\n        {\n            return node.Parent is BlockSyntax;\n        }\n\n        internal static SyntaxNode RemoveUnusedCode(SyntaxNode root, SyntaxNode syntaxNode)\n        {\n            return root.RemoveNode(syntaxNode, SyntaxRemoveOptions.KeepNoTrivia | SyntaxRemoveOptions.KeepEndOfLine);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/EncryptionAlgorithmsShouldBeSecure.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class EncryptionAlgorithmsShouldBeSecure : EncryptionAlgorithmsShouldBeSecureBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n        public EncryptionAlgorithmsShouldBeSecure() : base(AnalyzerConfiguration.AlwaysEnabled) { }\n\n        protected override TrackerBase<SyntaxKind, PropertyAccessContext>.Condition IsInsideObjectInitializer() =>\n            context => context.Node.FirstAncestorOrSelf<InitializerExpressionSyntax>() != null;\n\n        protected override TrackerBase<SyntaxKind, InvocationContext>.Condition HasPkcs1PaddingArgument() =>\n            context =>\n            {\n                var argumentList = ((InvocationExpressionSyntax)context.Node).ArgumentList;\n                var values = argumentList.ArgumentValuesForParameter(context.Model, \"padding\");\n                return values.Length == 1\n                    && values[0] is ExpressionSyntax valueSyntax\n                    && context.Model.GetSymbolInfo(valueSyntax).Symbol is ISymbol symbol\n                    && symbol.Name == \"Pkcs1\";\n            };\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/EnumNameHasEnumSuffix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class EnumNameHasEnumSuffix : EnumNameHasEnumSuffixBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language { get; } = CSharpFacade.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/EnumNameShouldFollowRegex.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class EnumNameShouldFollowRegex : EnumNameShouldFollowRegexBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language { get; } = CSharpFacade.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/EnumStorageNeedsToBeInt32.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class EnumStorageNeedsToBeInt32 : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S4022\";\n        private const string MessageFormat = \"Change this enum storage to 'Int32'.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var enumDeclaration = (EnumDeclarationSyntax)c.Node;\n                    var enumBaseType = enumDeclaration?.BaseList?.Types.FirstOrDefault()?.Type;\n\n                    if (enumDeclaration != null &&\n                        !IsDefaultOrLarger(enumBaseType, c.Model))\n                    {\n                        c.ReportIssue(rule, enumDeclaration.Identifier);\n                    }\n                },\n                SyntaxKind.EnumDeclaration);\n        }\n\n        private static bool IsDefaultOrLarger(SyntaxNode syntaxNode, SemanticModel semanticModel)\n        {\n            if (syntaxNode == null)\n            {\n                return true;\n            }\n\n            var symbolType = semanticModel.GetSymbolInfo(syntaxNode).Symbol.GetSymbolType();\n            return symbolType.IsAny(KnownType.System_Int32, KnownType.System_UInt32, KnownType.System_Int64, KnownType.System_UInt64);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/EnumerableSumInUnchecked.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class EnumerableSumInUnchecked : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S2291\";\n        private const string MessageFormat = \"Refactor this code to handle 'OverflowException'.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var invocation = (InvocationExpressionSyntax)c.Node;\n                    var expression = invocation.Expression;\n                    if (expression is MemberAccessExpressionSyntax memberAccess &&\n                        memberAccess.Name.Identifier.ValueText == \"Sum\" &&\n                        IsSumInsideUnchecked(invocation) &&\n                        c.Model.GetSymbolInfo(invocation).Symbol is IMethodSymbol methodSymbol &&\n                        IsSumOnInteger(methodSymbol))\n                    {\n                        c.ReportIssue(rule, memberAccess.Name);\n                    }\n                },\n                SyntaxKind.InvocationExpression);\n        }\n\n        private static bool IsSumInsideUnchecked(InvocationExpressionSyntax invocation)\n        {\n            SyntaxNode current = invocation;\n            var parent = current.Parent;\n            while (parent != null)\n            {\n                if (parent is TryStatementSyntax tryStatement &&\n                    tryStatement.Block == current)\n                {\n                    return false;\n                }\n\n                if (IsUncheckedExpression(parent) ||\n                    IsUncheckedStatement(parent))\n                {\n                    return true;\n                }\n\n                current = parent;\n                parent = parent.Parent;\n            }\n            return false;\n        }\n\n        private static bool IsUncheckedExpression(SyntaxNode node)\n        {\n            return node is CheckedExpressionSyntax uncheckedExpression &&\n                uncheckedExpression.IsKind(SyntaxKind.UncheckedExpression);\n        }\n\n        private static bool IsUncheckedStatement(SyntaxNode node)\n        {\n            return node is CheckedStatementSyntax uncheckedExpression &&\n                uncheckedExpression.IsKind(SyntaxKind.UncheckedStatement);\n        }\n\n        private static bool IsSumOnInteger(IMethodSymbol methodSymbol)\n        {\n            return methodSymbol != null &&\n                methodSymbol.Name == \"Sum\" &&\n                methodSymbol.IsExtensionOn(KnownType.System_Collections_Generic_IEnumerable_T) &&\n                IsReturnTypeCandidate(methodSymbol);\n        }\n\n        private static bool IsReturnTypeCandidate(IMethodSymbol methodSymbol)\n        {\n            var returnType = methodSymbol.ReturnType;\n            if (returnType.OriginalDefinition.Is(KnownType.System_Nullable_T))\n            {\n                var nullableType = (INamedTypeSymbol)returnType;\n                if (nullableType.TypeArguments.Length != 1)\n                {\n                    return false;\n                }\n                returnType = nullableType.TypeArguments[0];\n            }\n\n            return returnType.IsAny(DisallowedTypes);\n        }\n\n        private static readonly ImmutableArray<KnownType> DisallowedTypes =\n            ImmutableArray.Create(\n                KnownType.System_Int64,\n                KnownType.System_Int32,\n                KnownType.System_Decimal\n            );\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/EnumsShouldNotBeNamedReserved.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class EnumsShouldNotBeNamedReserved : SonarDiagnosticAnalyzer\n{\n    internal const string DiagnosticId = \"S4016\";\n    private const string MessageFormat = \"Remove or rename this enum member.\";\n\n    private static readonly DiagnosticDescriptor Rule =\n        DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context)\n        => context.RegisterNodeAction(c =>\n            {\n                if (c.Node is EnumMemberDeclarationSyntax enumMemberDeclaration\n                    && enumMemberDeclaration.Identifier.ValueText\n                        .SplitCamelCaseToWords()\n                        .Any(w => w == \"RESERVED\"))\n                {\n                    c.ReportIssue(Rule, enumMemberDeclaration);\n                }\n            },\n            SyntaxKind.EnumMemberDeclaration);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/EqualityOnFloatingPoint.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class EqualityOnFloatingPoint : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S1244\";\n    private const string MessageFormat = \"Do not check floating point {0} with exact values, use {1} instead.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n    private static readonly Dictionary<string, string> SpecialMembers = new()\n    {\n        { nameof(double.NaN), nameof(double.IsNaN) },\n        { nameof(double.PositiveInfinity), nameof(double.IsPositiveInfinity) },\n        { nameof(double.NegativeInfinity), nameof(double.IsNegativeInfinity) },\n    };\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(\n            CheckEquality,\n            SyntaxKind.EqualsExpression,\n            SyntaxKind.NotEqualsExpression);\n\n        context.RegisterNodeAction(\n            CheckLogicalExpression,\n            SyntaxKind.LogicalAndExpression,\n            SyntaxKind.LogicalOrExpression);\n    }\n\n    private static void CheckLogicalExpression(SonarSyntaxNodeReportingContext context)\n    {\n        var binaryExpression = (BinaryExpressionSyntax)context.Node;\n\n        if (TryGetBinaryExpression(binaryExpression.Left) is { } left\n            && TryGetBinaryExpression(binaryExpression.Right) is { } right\n            && CSharpEquivalenceChecker.AreEquivalent(right.Right, left.Right)\n            && CSharpEquivalenceChecker.AreEquivalent(right.Left, left.Left)\n            && IsIndirectEquality(context.Model, binaryExpression, left, right) is var isEquality\n            && IsIndirectInequality(context.Model, binaryExpression, left, right) is var isInequality\n            && (isEquality || isInequality))\n        {\n            context.ReportIssue(Rule, binaryExpression, MessageEqualityPart(isEquality), \"a range\");\n        }\n    }\n\n    private static string MessageEqualityPart(bool isEquality) =>\n        isEquality ? \"equality\" : \"inequality\";\n\n    private static void CheckEquality(SonarSyntaxNodeReportingContext context)\n    {\n        var equals = (BinaryExpressionSyntax)context.Node;\n        if (context.Model.GetSymbolInfo(equals).Symbol is IMethodSymbol { ContainingType: { } container } method\n            && IsFloatingPointType(container)\n            && (method.IsOperatorEquals() || method.IsOperatorNotEquals()))\n        {\n            var messageEqualityPart = MessageEqualityPart(equals.IsKind(SyntaxKind.EqualsExpression));\n            var proposed = ProposedMessageForMemberAccess(context, equals.Right)\n                ?? ProposedMessageForMemberAccess(context, equals.Left)\n                ?? ProposedMessageForIdentifier(context, equals.Right)\n                ?? ProposedMessageForIdentifier(context, equals.Left)\n                ?? \"a range\";\n            context.ReportIssue(Rule, equals.OperatorToken, messageEqualityPart, proposed);\n        }\n    }\n\n    private static string ProposedMessageForMemberAccess(SonarSyntaxNodeReportingContext context, ExpressionSyntax expression) =>\n        expression is MemberAccessExpressionSyntax memberAccess\n        && SpecialMembers.TryGetValue(memberAccess.GetName(), out var proposedMethod)\n        && context.Model.GetTypeInfo(memberAccess).ConvertedType is { } type\n        && IsFloatingPointType(type)\n            ? $\"'{type.ToMinimalDisplayString(context.Model, memberAccess.SpanStart)}.{proposedMethod}()'\"\n            : null;\n\n    private static string ProposedMessageForIdentifier(SonarSyntaxNodeReportingContext context, ExpressionSyntax expression) =>\n        expression is IdentifierNameSyntax identifier\n        && SpecialMembers.TryGetValue(identifier.GetName(), out var proposedMethod)\n        && context.Model.GetSymbolInfo(identifier).Symbol is { ContainingType: { } type }\n        && IsFloatingPointType(type)\n            ? $\"'{proposedMethod}()'\"\n            : null;\n\n    // Returns true for the floating point types that suffer from equivalence problems. All .NET floating point types have this problem except `decimal.`\n    // - Reason for excluding `decimal`: the documentation for the `decimal.Equals()` method does not have a \"Precision in Comparisons\" section as the other .NET floating point types.\n    // - Power-2-based types like `double` implement `IFloatingPointIeee754`, but power-10-based `decimal` implements `IFloatingPoint`.\n    // - `IFloatingPointIeee754` defines `Epsilon` which indicates problems with equivalence checking.\n    private static bool IsFloatingPointType(ITypeSymbol type) =>\n        type.IsAny(KnownType.FloatingPointNumbers)\n        || (type.Is(KnownType.System_Numerics_IEqualityOperators_TSelf_TOther_TResult) // The operator originates from a virtual static member\n            && type is INamedTypeSymbol { TypeArguments: { } typeArguments }           // Arguments of TSelf, TOther, TResult\n            && typeArguments.Any(IsFloatingPointType))\n        || (type is ITypeParameterSymbol { ConstraintTypes: { } constraintTypes }      // constraints of TSelf or of TSelf, TOther, TResult from IEqualityOperators\n            && constraintTypes.Any(x => x.DerivesOrImplements(KnownType.System_Numerics_IFloatingPointIeee754_TSelf)));\n\n    private static BinaryExpressionSyntax TryGetBinaryExpression(ExpressionSyntax expression) =>\n        expression.RemoveParentheses() as BinaryExpressionSyntax;\n\n    private static bool IsIndirectInequality(SemanticModel semanticModel, BinaryExpressionSyntax binaryExpression, BinaryExpressionSyntax left, BinaryExpressionSyntax right) =>\n        binaryExpression.IsKind(SyntaxKind.LogicalOrExpression)\n        && IsOperatorPair(left, right, SyntaxKind.GreaterThanToken, SyntaxKind.LessThanToken)\n        && HasFloatingType(semanticModel, right);\n\n    private static bool IsIndirectEquality(SemanticModel semanticModel, BinaryExpressionSyntax binaryExpression, BinaryExpressionSyntax left, BinaryExpressionSyntax right) =>\n        binaryExpression.IsKind(SyntaxKind.LogicalAndExpression)\n        && IsOperatorPair(left, right, SyntaxKind.GreaterThanEqualsToken, SyntaxKind.LessThanEqualsToken)\n        && HasFloatingType(semanticModel, right);\n\n    private static bool HasFloatingType(SemanticModel semanticModel, BinaryExpressionSyntax binary) =>\n        IsExpressionFloatingType(semanticModel, binary.Right) || IsExpressionFloatingType(semanticModel, binary.Left);\n\n    private static bool IsExpressionFloatingType(SemanticModel semanticModel, ExpressionSyntax expression) =>\n        IsFloatingPointType(semanticModel.GetTypeInfo(expression).Type);\n\n    private static bool IsOperatorPair(BinaryExpressionSyntax left, BinaryExpressionSyntax right, SyntaxKind first, SyntaxKind second) =>\n        (left.OperatorToken.IsKind(first) && right.OperatorToken.IsKind(second))\n        || (left.OperatorToken.IsKind(second) && right.OperatorToken.IsKind(first));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/EqualityOnModulus.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class EqualityOnModulus : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S2197\";\n        private const string MessageFormat = \"The result of this modulus operation may not be {0}.\";\n\n        private const string CountName = nameof(Enumerable.Count);\n        private const string LongCountName = nameof(Enumerable.LongCount);\n        private const string LengthName = \"Length\"; // Represents Array.Length and String.Length\n        private const string LongLengthName = nameof(Array.LongLength);\n        private const string ListCapacityName = nameof(List<object>.Capacity);\n\n        private static readonly string[] CollectionSizePropertyOrMethodNames = { CountName, LongCountName, LengthName, LongLengthName, ListCapacityName };\n\n        private static readonly CSharpExpressionNumericConverter ExpressionNumericConverter = new();\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(VisitEquality, SyntaxKind.EqualsExpression, SyntaxKind.NotEqualsExpression);\n\n        private static void VisitEquality(SonarSyntaxNodeReportingContext c)\n        {\n            var equalsExpression = (BinaryExpressionSyntax)c.Node;\n\n            if ((CheckExpression(equalsExpression.Left, equalsExpression.Right, c.Model)\n                ?? CheckExpression(equalsExpression.Right, equalsExpression.Left, c.Model)) is { } constantValue)\n            {\n                c.ReportIssue(Rule, equalsExpression, constantValue < 0 ? \"negative\" : \"positive\");\n            }\n        }\n\n        private static int? CheckExpression(SyntaxNode node, ExpressionSyntax expression, SemanticModel model) =>\n            ExpressionNumericConverter.ConstantIntValue(node) is { } constantValue\n            && constantValue != 0\n            && expression.RemoveParentheses() is BinaryExpressionSyntax binary\n            && binary.IsKind(SyntaxKind.ModuloExpression)\n            && !ExpressionIsAlwaysPositive(binary, model)\n                ? constantValue\n                : null;\n\n        private static bool ExpressionIsAlwaysPositive(BinaryExpressionSyntax binaryExpression, SemanticModel semantic)\n        {\n            var type = semantic.GetTypeInfo(binaryExpression).Type;\n            if (type.IsAny(KnownType.UnsignedIntegers) || type.Is(KnownType.System_UIntPtr))\n            {\n                return true;\n            }\n\n            var leftExpression = binaryExpression.Left;\n            var leftExpressionStringForm = leftExpression.ToString();\n            return CollectionSizePropertyOrMethodNames.Any(x => leftExpressionStringForm.Contains(x))\n                   && semantic.GetSymbolInfo(leftExpression).Symbol is { } symbol\n                   && IsCollectionSize(symbol);\n        }\n\n        private static bool IsCollectionSize(ISymbol symbol) =>\n            IsEnumerableCountMethod(symbol)\n            || (symbol is IPropertySymbol propertySymbol\n                && (IsLengthProperty(propertySymbol)\n                    || IsCollectionCountProperty(propertySymbol)\n                    || IsListCapacityProperty(propertySymbol)));\n\n        private static bool IsEnumerableCountMethod(ISymbol symbol) =>\n            (CountName.Equals(symbol.Name) || LongCountName.Equals(symbol.Name))\n            && symbol is IMethodSymbol methodSymbol\n            && methodSymbol.IsExtensionMethod\n            && methodSymbol.ReceiverType is not null\n            && methodSymbol.IsExtensionOn(KnownType.System_Collections_Generic_IEnumerable_T);\n\n        private static bool IsLengthProperty(IPropertySymbol propertySymbol) =>\n            (LengthName.Equals(propertySymbol.Name) || LongLengthName.Equals(propertySymbol.Name))\n            && propertySymbol.ContainingType.IsAny(KnownType.System_Array, KnownType.System_String);\n\n        private static bool IsCollectionCountProperty(IPropertySymbol propertySymbol) =>\n            CountName.Equals(propertySymbol.Name)\n            && (propertySymbol.ContainingType.Implements(KnownType.System_Collections_Generic_ICollection_T)\n                || propertySymbol.ContainingType.Implements(KnownType.System_Collections_Generic_IReadOnlyCollection_T));\n\n        private static bool IsListCapacityProperty(IPropertySymbol propertySymbol) =>\n            ListCapacityName.Equals(propertySymbol.Name)\n            && propertySymbol.ContainingType.Implements(KnownType.System_Collections_Generic_IList_T);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/EquatableClassShouldBeSealed.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class EquatableClassShouldBeSealed : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S4035\";\n        private const string MessageFormat = \"Seal class '{0}' or implement 'IEqualityComparer<T>' instead.\";\n        private const string EqualsMethodName = nameof(object.Equals);\n\n        private static readonly DiagnosticDescriptor Rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var classDeclaration = (ClassDeclarationSyntax)c.Node;\n                    var classSymbol = c.Model.GetDeclaredSymbol(classDeclaration);\n\n                    if (classSymbol != null\n                        && !classSymbol.IsSealed\n                        && !classSymbol.IsStatic\n                        && classSymbol.IsPubliclyAccessible()\n                        && !classDeclaration.Identifier.IsMissing\n                        && HasAnyInvalidIEquatableEqualsMethod(classSymbol))\n                    {\n                        c.ReportIssue(Rule, classDeclaration.Identifier, classDeclaration.Identifier.ValueText);\n                    }\n                },\n                SyntaxKind.ClassDeclaration);\n\n        private static bool HasAnyInvalidIEquatableEqualsMethod(INamedTypeSymbol classSymbol)\n        {\n            var equatableInterfacesByTypeName = classSymbol.Interfaces\n                .Where(IsCompilableIEquatableTSymbol)\n                .ToDictionary(nts => nts.TypeArguments[0].Name, nts => nts);\n\n            var equalsMethodsByTypeName = classSymbol.GetMembers(EqualsMethodName)\n                .OfType<IMethodSymbol>()\n                .Where(IsIEquatableEqualsMethodCandidate)\n                .ToDictionary(ms => ms.Parameters[0].Type.Name, ms => ms);\n\n            // Checks whether any IEquatable<T> has no implementation OR a non-virtual non-abstract implementation\n            var hasAnyConcreteImplementation = equatableInterfacesByTypeName\n                .Select(iequatable => equalsMethodsByTypeName.GetValueOrDefault(iequatable.Key))\n                .Any(associatedMethod => associatedMethod == null || !(associatedMethod.IsVirtual || associatedMethod.IsAbstract));\n            if (hasAnyConcreteImplementation)\n            {\n                return true;\n            }\n\n            // For all Equals(T) not a IEquatable<T> implementation checks if any is non-virtual\n            var unprocessedTypeNames = equalsMethodsByTypeName.Keys.Except(equatableInterfacesByTypeName.Keys);\n            return unprocessedTypeNames.Any(typeName => !equalsMethodsByTypeName[typeName].IsVirtual);\n        }\n\n        private static bool IsCompilableIEquatableTSymbol(INamedTypeSymbol namedTypeSymbol) =>\n            namedTypeSymbol.ConstructedFrom.Is(KnownType.System_IEquatable_T)\n            && namedTypeSymbol.TypeArguments.Length == 1;\n\n        private static bool IsIEquatableEqualsMethodCandidate(IMethodSymbol methodSymbol) =>\n            methodSymbol.MethodKind == MethodKind.Ordinary\n            && methodSymbol.Name == EqualsMethodName\n            && methodSymbol.IsPubliclyAccessible()\n            && !methodSymbol.IsOverride\n            && methodSymbol.ReturnType.Is(KnownType.System_Boolean)\n            && methodSymbol.Parameters.Length == 1;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/EscapeLambdaParameterTypeNamedScoped.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class EscapeLambdaParameterTypeNamedScoped : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S8381\";\n    private const string MessageFormat = \"'scoped' should be escaped when used as a type name in lambda parameters\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(compilationStart =>\n            {\n                if (!compilationStart.Compilation.IsAtLeastLanguageVersion(LanguageVersionEx.CSharp14))\n                {\n                    compilationStart.RegisterNodeAction(c =>\n                        {\n                            foreach (var parameter in ((ParenthesizedLambdaExpressionSyntax)c.Node).ParameterList.Parameters)\n                            {\n                                CheckParameter(c, parameter);\n                            }\n                        },\n                        SyntaxKind.ParenthesizedLambdaExpression);\n                }\n            });\n\n    private static void CheckParameter(SonarSyntaxNodeReportingContext c, ParameterSyntax parameter)\n    {\n        if (parameter.Type?.Unwrap() is SimpleNameSyntax { Identifier: { } id } && IsScopedToken(id))\n        {\n            c.ReportIssue(Rule, id);\n        }\n        else if (parameter.Type is null && IsScopedToken(parameter.Identifier))\n        {\n            c.ReportIssue(Rule, parameter.Identifier);\n        }\n    }\n\n    private static bool IsScopedToken(SyntaxToken token) =>\n        token.ValueText == \"scoped\" && !token.Text.StartsWith(\"@\", StringComparison.Ordinal);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/EventHandlerDelegateShouldHaveProperArguments.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class EventHandlerDelegateShouldHaveProperArguments : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S4220\";\n        private const string MessageFormat = \"{0}\";\n        private const string NullEventArgsMessage = \"Use 'EventArgs.Empty' instead of null as the event args of \" +\n            \"this event invocation.\";\n        private const string NullSenderMessage = \"Make the sender on this event invocation not null.\";\n        private const string NonNullSenderMessage = \"Make the sender on this static event invocation null.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        private static readonly ImmutableArray<KnownType> EventHandlerTypes =\n            ImmutableArray.Create(\n                KnownType.System_EventHandler,\n                KnownType.System_EventHandler_TEventArgs\n            );\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(c =>\n                {\n                    var invocation = (InvocationExpressionSyntax)c.Node;\n                    if (invocation.ArgumentList == null ||\n                        invocation.ArgumentList.Arguments.Count != 2)\n                    {\n                        return;\n                    }\n\n                    if (!(c.Model.GetSymbolInfo(invocation).Symbol is IMethodSymbol methodSymbol) ||\n                        methodSymbol.MethodKind != MethodKind.DelegateInvoke ||\n                        !methodSymbol.ContainingType.ConstructedFrom.IsAny(EventHandlerTypes))\n                    {\n                        return;\n                    }\n\n                    var isSecondParameterNull = invocation.ArgumentList.Arguments[1].Expression\n                        .RemoveParentheses()\n                        .IsNullLiteral();\n                    if (isSecondParameterNull)\n                    {\n                        c.ReportIssue(rule, invocation, NullEventArgsMessage);\n                    }\n\n                    var eventSymbol = GetEventSymbol(invocation.Expression, c.Model);\n                    if (eventSymbol == null)\n                    {\n                        return;\n                    }\n\n                    var isFirstParameterNull = invocation.ArgumentList.Arguments[0].Expression\n                        .RemoveParentheses()\n                        .IsNullLiteral();\n                    if (isFirstParameterNull && !eventSymbol.IsStatic)\n                    {\n                        c.ReportIssue(rule, invocation, NullSenderMessage);\n                    }\n                    else if (!isFirstParameterNull && eventSymbol.IsStatic)\n                    {\n                        c.ReportIssue(rule, invocation, NonNullSenderMessage);\n                    }\n                },\n                SyntaxKind.InvocationExpression);\n        }\n\n        private static IEventSymbol GetEventSymbol(ExpressionSyntax expression, SemanticModel model)\n        {\n            if (expression == null)\n            {\n                return null;\n            }\n\n            if (expression.IsKind(SyntaxKind.IdentifierName))\n            {\n                return model.GetSymbolInfo(expression).Symbol as IEventSymbol;\n            }\n\n            if (expression is MemberAccessExpressionSyntax simpleMemberAccess)\n            {\n                return GetEventSymbol(simpleMemberAccess.Expression, model);\n            }\n\n            if (expression is MemberBindingExpressionSyntax)\n            {\n                var conditionalExpression = expression.FirstAncestorOrSelf<ConditionalAccessExpressionSyntax>();\n                var isSelf = expression == conditionalExpression?.Expression;\n\n                if (isSelf)\n                {\n                    return null;\n                }\n\n                return GetEventSymbol(conditionalExpression?.Expression, model);\n            }\n\n            return null;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ExceptionRethrow.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class ExceptionRethrow : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S3445\";\n        private const string MessageFormat = \"Consider using 'throw;' to preserve the stack trace.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var catchClause = (CatchClauseSyntax)c.Node;\n                    if (catchClause.Declaration == null ||\n                        catchClause.Declaration.Identifier.IsKind(SyntaxKind.None))\n                    {\n                        return;\n                    }\n\n                    var exceptionIdentifier = c.Model.GetDeclaredSymbol(catchClause.Declaration);\n                    if (exceptionIdentifier == null)\n                    {\n                        return;\n                    }\n\n                    var throws = catchClause.DescendantNodes(n =>\n                            n == catchClause ||\n                            !n.IsKind(SyntaxKind.CatchClause))\n                        .OfType<ThrowStatementSyntax>()\n                        .Where(t => t.Expression != null);\n\n                    foreach (var @throw in throws)\n                    {\n                        var thrown = c.Model.GetSymbolInfo(@throw.Expression).Symbol as ILocalSymbol;\n                        if (Equals(thrown, exceptionIdentifier))\n                        {\n                            c.ReportIssue(rule, @throw);\n                        }\n                    }\n                },\n                SyntaxKind.CatchClause);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ExceptionRethrowCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class ExceptionRethrowCodeFix : SonarCodeFix\n    {\n        internal const string Title = \"Change to 'throw;'\";\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(ExceptionRethrow.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n\n            if (!(root.FindNode(diagnosticSpan) is ThrowStatementSyntax throwStatement))\n            {\n                return Task.CompletedTask;\n            }\n\n            context.RegisterCodeFix(\n                Title,\n                c =>\n                {\n                    var newRoot = root.ReplaceNode(\n                        throwStatement,\n                        SyntaxFactory.ThrowStatement().WithTriviaFrom(throwStatement));\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n\n            return Task.CompletedTask;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ExceptionShouldNotBeThrownFromUnexpectedMethods.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ExceptionShouldNotBeThrownFromUnexpectedMethods : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S3877\";\n    private const string MessageFormat = \"Remove this 'throw' {0}.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    private static readonly ImmutableArray<KnownType> DefaultAllowedExceptions = ImmutableArray.Create(KnownType.System_NotImplementedException);\n\n    private static readonly ImmutableArray<KnownType> EventAccessorAllowedExceptions = ImmutableArray.Create(\n        KnownType.System_NotImplementedException,\n        KnownType.System_InvalidOperationException,\n        KnownType.System_NotSupportedException,\n        KnownType.System_ArgumentException);\n\n    private static readonly HashSet<SyntaxKind> TrackedOperators =\n    [\n        SyntaxKind.EqualsEqualsToken,\n        SyntaxKind.ExclamationEqualsToken,\n        SyntaxKind.LessThanToken,\n        SyntaxKind.GreaterThanToken,\n        SyntaxKind.LessThanEqualsToken,\n        SyntaxKind.GreaterThanEqualsToken\n    ];\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(\n            c => CheckForIssue<MethodDeclarationSyntax>(c, mds => IsTrackedMethod(mds, c.Model), DefaultAllowedExceptions),\n            SyntaxKind.MethodDeclaration);\n\n        context.RegisterNodeAction(\n            c => CheckForIssue<ConstructorDeclarationSyntax>(c, cds => cds.Modifiers.Any(SyntaxKind.StaticKeyword), DefaultAllowedExceptions),\n            SyntaxKind.ConstructorDeclaration);\n\n        context.RegisterNodeAction(\n            c => CheckForIssue<OperatorDeclarationSyntax>(c, IsTrackedOperator, DefaultAllowedExceptions),\n            SyntaxKind.OperatorDeclaration);\n\n        context.RegisterNodeAction(\n            c => CheckForIssue<AccessorDeclarationSyntax>(c, x => true, EventAccessorAllowedExceptions),\n            SyntaxKind.AddAccessorDeclaration,\n            SyntaxKind.RemoveAccessorDeclaration);\n\n        context.RegisterNodeAction(\n            c => CheckForIssue<ConversionOperatorDeclarationSyntax>(c, cods => cods.ImplicitOrExplicitKeyword.IsKind(SyntaxKind.ImplicitKeyword), DefaultAllowedExceptions),\n            SyntaxKind.ConversionOperatorDeclaration);\n    }\n\n    private static void CheckForIssue<TSyntax>(SonarSyntaxNodeReportingContext analysisContext, Func<TSyntax, bool> isTrackedSyntax, ImmutableArray<KnownType> allowedThrowTypes)\n        where TSyntax : SyntaxNode\n    {\n        var syntax = (TSyntax)analysisContext.Node;\n        if (isTrackedSyntax(syntax))\n        {\n            ReportOnInvalidThrow(analysisContext, syntax, allowedThrowTypes);\n        }\n    }\n\n    private static bool IsTrackedOperator(OperatorDeclarationSyntax declaration) =>\n        TrackedOperators.Contains(declaration.OperatorToken.Kind());\n\n    private static bool IsTrackedMethod(MethodDeclarationSyntax declaration, SemanticModel model) =>\n        HasTrackedMethodOrAttributeName(declaration)\n        && model.GetDeclaredSymbol(declaration) is { } methodSymbol\n        && HasTrackedMethodOrAttributeType(methodSymbol);\n\n    private static bool HasTrackedMethodOrAttributeName(MethodDeclarationSyntax declaration)\n    {\n        var name = declaration.Identifier.ValueText;\n        return name == \"Equals\"\n            || name == \"GetHashCode\"\n            || name == \"ToString\"\n            || name == \"Dispose\"\n            || name == \"Equals\"\n            || CanBeModuleInitializer();\n\n        bool CanBeModuleInitializer() =>\n            declaration.AttributeLists.SelectMany(x => x.Attributes).Any(x => x.ArgumentList is null && x.Name.ToStringContains(\"ModuleInitializer\"));\n    }\n\n    private static bool HasTrackedMethodOrAttributeType(IMethodSymbol method) =>\n        method.IsObjectEquals()\n        || method.IsObjectGetHashCode()\n        || method.IsObjectToString()\n        || method.IsIDisposableDispose()\n        || method.IsImplementingInterfaceMember(KnownType.System_IEquatable_T, \"Equals\")\n        || IsModuleInitializer(method);\n\n    private static bool IsModuleInitializer(IMethodSymbol method) =>\n        method.AnyAttributeDerivesFrom(KnownType.System_Runtime_CompilerServices_ModuleInitializerAttribute);\n\n    private static void ReportOnInvalidThrow(SonarSyntaxNodeReportingContext context, SyntaxNode node, ImmutableArray<KnownType> allowedTypes)\n    {\n        if (node.ArrowExpressionBody() is { } expressionBody\n            && GetLocationToReport(\n                expressionBody.Expression.DescendantNodesAndSelf().Where(ThrowExpressionSyntaxWrapper.IsInstance).Select(x => (ThrowExpressionSyntaxWrapper)x),\n                x => x.Node,\n                x => x.Expression) is { } throwExpressionLocation)\n        {\n            context.ReportIssue(Rule, throwExpressionLocation, \"expression\");\n        }\n        else if (GetLocationToReport(\n                    node.DescendantNodes().OfType<ThrowStatementSyntax>().Where(x => x.Expression is not null),\n                    x => x,\n                    x => x.Expression) is { } throwStatementLocation)\n        {\n            context.ReportIssue(Rule, throwStatementLocation, \"statement\");\n        }\n\n        // `throwNodes` is an enumeration of either throw expressions or throw statements\n        // Because of the ShimLayer ThrowExpression implementation, we need to provide extra boilerplate as the wrappers to extract the node and the expression.\n        // The location is returned only if an issue should be reported. Otherwise, null is returned.\n        Location GetLocationToReport<TThrow>(IEnumerable<TThrow> throwNodes, Func<TThrow, SyntaxNode> getNode, Func<TThrow, ExpressionSyntax> getExpression) =>\n            throwNodes.Select(x => new NodeAndSymbol(getNode(x), context.Model.GetSymbolInfo(getExpression(x)).Symbol))\n                .FirstOrDefault(x => x.Symbol is not null && ShouldReport(x.Symbol.ContainingType, allowedTypes))\n                .Node?.GetLocation();\n    }\n\n    private static bool ShouldReport(INamedTypeSymbol exceptionType, ImmutableArray<KnownType> allowedTypes) =>\n        !exceptionType.IsAny(allowedTypes) && !exceptionType.DerivesFromAny(allowedTypes);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ExceptionsNeedStandardConstructors.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class ExceptionsNeedStandardConstructors : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S4027\";\n        private const string MessageFormat = \"Implement the missing constructors for this exception.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(c =>\n            {\n                var classDeclaration = c.Node as ClassDeclarationSyntax;\n                var classSymbol = c.Model.GetDeclaredSymbol(classDeclaration);\n\n                if (!classDeclaration.Identifier.IsMissing &&\n                    classSymbol.DerivesFrom(KnownType.System_Exception) &&\n                    !HasStandardConstructors(classSymbol))\n                {\n                    c.ReportIssue(rule, classDeclaration.Identifier);\n                }\n            },\n            SyntaxKind.ClassDeclaration);\n        }\n\n        private static bool HasStandardConstructors(INamedTypeSymbol classSymbol)\n        {\n            var ctors = classSymbol.Constructors;\n\n            return HasConstructor(ctors, Accessibility.Public) &&\n                   HasConstructor(ctors, Accessibility.Public, KnownType.System_String) &&\n                   HasConstructor(ctors, Accessibility.Public, KnownType.System_String, KnownType.System_Exception);\n        }\n\n        private static bool HasConstructor(ImmutableArray<IMethodSymbol> constructors,\n            Accessibility accessibility, params KnownType[] expectedParameterTypes)\n        {\n            return constructors.Any(c => IsMatchingConstructor(c, accessibility, expectedParameterTypes));\n        }\n\n        private static bool IsMatchingConstructor(IMethodSymbol constructor, Accessibility accessibility,\n            KnownType[] expectedParameterTypes)\n        {\n            return constructor.DeclaredAccessibility == accessibility &&\n                SonarAnalyzer.Core.Extensions.IEnumerableExtensions.Equals(constructor.Parameters, expectedParameterTypes, (p1, p2) => p1.Type.Is(p2));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ExceptionsShouldBeLogged.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Walkers;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ExceptionsShouldBeLogged : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S6667\";\n    private const string MessageFormat = \"Logging in a catch clause should pass the caught exception as a parameter.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n    private static readonly KnownAssembly[] SupportedLoggingFrameworks =\n    [\n        KnownAssembly.MicrosoftExtensionsLoggingAbstractions,\n        KnownAssembly.CastleCore,\n        KnownAssembly.CommonLoggingCore,\n        KnownAssembly.Log4Net,\n        KnownAssembly.NLog\n    ];\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(cc =>\n            {\n                if (cc.Compilation.ReferencesAny(SupportedLoggingFrameworks))\n                {\n                    cc.RegisterNodeAction(c =>\n                        {\n                            var catchClauseSyntax = (CatchClauseSyntax)c.Node;\n                            var walker = new CatchLoggingInvocationWalker(c.Model);\n                            if (walker.SafeVisit(catchClauseSyntax) && !walker.IsExceptionLogged &&\n                                walker.LoggingInvocationsWithoutException.Any())\n                            {\n                                var primaryLocation = walker.LoggingInvocationsWithoutException[0].GetLocation();\n                                var secondaryLocations = walker.LoggingInvocationsWithoutException.Skip(1).ToSecondaryLocations(MessageFormat);\n                                c.ReportIssue(Rule, primaryLocation, secondaryLocations);\n                            }\n                        },\n                        SyntaxKind.CatchClause);\n                }\n            });\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ExceptionsShouldBeLoggedOrThrown.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Walkers;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ExceptionsShouldBeLoggedOrThrown : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S2139\";\n    private const string MessageFormat = \"Either log this exception and handle it, or rethrow it with some contextual information.\";\n    private const string LoggingStatementMessage = \"Logging statement.\";\n    private const string ThrownExceptionMessage = \"Thrown exception.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n    private static readonly KnownAssembly[] SupportedLoggingFrameworks = [\n        KnownAssembly.MicrosoftExtensionsLoggingAbstractions,\n        KnownAssembly.Log4Net,\n        KnownAssembly.NLog,\n        KnownAssembly.CastleCore,\n        KnownAssembly.CommonLoggingCore,\n        KnownAssembly.Serilog];\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(cc =>\n            {\n                if (cc.Compilation.ReferencesAny(SupportedLoggingFrameworks))\n                {\n                     cc.RegisterNodeAction(c =>\n                         {\n                             var catchClauseSyntax = (CatchClauseSyntax)c.Node;\n                             var walker = new LoggingInvocationWalker(c.Model);\n                             if (catchClauseSyntax.Declaration?.Identifier is { } exceptionIdentifier // there is an exception to log\n                                 && catchClauseSyntax.DescendantNodes().Any(x => x.Kind() is SyntaxKind.ThrowStatement or SyntaxKindEx.ThrowExpression) // and a throw statement (preliminary check)\n                                 && walker.SafeVisit(catchClauseSyntax)\n                                 && walker.IsExceptionLogged\n                                 && walker.ThrowNode is { } throwStatement)\n                             {\n                                 var secondaryLocations = new List<SecondaryLocation>\n                                 {\n                                     new(walker.LoggingInvocationWithException.GetLocation(), LoggingStatementMessage),\n                                     new(throwStatement.GetLocation(), ThrownExceptionMessage)\n                                 };\n                                 c.ReportIssue(Rule, exceptionIdentifier, secondaryLocations);\n                             }\n                         },\n                         SyntaxKind.CatchClause);\n                }\n            });\n\n    private sealed class LoggingInvocationWalker(SemanticModel model) : CatchLoggingInvocationWalker(model)\n    {\n        public SyntaxNode ThrowNode { get; private set; }\n\n        public override void VisitIfStatement(IfStatementSyntax node)\n        {\n            // Skip processing to avoid false positives.\n        }\n\n        public override void VisitSwitchStatement(SwitchStatementSyntax node)\n        {\n            // Skip processing to avoid false positives.\n        }\n\n        public override void VisitConditionalExpression(ConditionalExpressionSyntax node)\n        {\n            // Skip processing to avoid false positives.\n        }\n\n        public override void Visit(SyntaxNode node)\n        {\n            if (node.IsKind(SyntaxKind.CoalesceExpression))\n            {\n                return;\n            }\n            base.Visit(node);\n        }\n\n        public override void VisitThrowStatement(ThrowStatementSyntax node)\n        {\n            if (ThrowNode == null\n                && RethrowsCaughtException(node.Expression))\n            {\n                ThrowNode = node;\n            }\n            base.VisitThrowStatement(node);\n        }\n\n        private bool RethrowsCaughtException(ExpressionSyntax expression) =>\n            expression is null || Equals(Model.GetSymbolInfo(expression).Symbol, CaughtException);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ExceptionsShouldBePublic.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ExceptionsShouldBePublic : ExceptionsShouldBePublicBase<SyntaxKind>\n{\n    protected override string MessageFormat => \"Make this exception 'public'.\";\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ExceptionsShouldBeUsed.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class ExceptionsShouldBeUsed : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S3984\";\n        private const string MessageFormat = \"Throw this exception or remove this useless statement.\";\n\n        private static readonly DiagnosticDescriptor Rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n            {\n                var objectCreation = (ObjectCreationExpressionSyntax)c.Node;\n                var parent = objectCreation.GetFirstNonParenthesizedParent();\n                if (parent.IsKind(SyntaxKind.ExpressionStatement)\n                    && c.Model.GetSymbolInfo(objectCreation.Type).Symbol is INamedTypeSymbol createdObjectType\n                    && createdObjectType.DerivesFrom(KnownType.System_Exception))\n                {\n                    c.ReportIssue(Rule, objectCreation);\n                }\n            },\n            SyntaxKind.ObjectCreationExpression);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ExcludeFromCodeCoverageAttributesNeedJustification.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ExcludeFromCodeCoverageAttributesNeedJustification : ExcludeFromCodeCoverageAttributesNeedJustificationBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override SyntaxNode GetJustificationExpression(SyntaxNode node) =>\n        node is AttributeSyntax { ArgumentList.Arguments: { Count: 1 } arguments }\n            && arguments[0] is { NameEquals.Name.Identifier.ValueText: JustificationPropertyName, Expression: { } expression }\n                ? expression\n                : null;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ExpectedExceptionAttributeShouldNotBeUsed.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class ExpectedExceptionAttributeShouldNotBeUsed : ExpectedExceptionAttributeShouldNotBeUsedBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n        protected override SyntaxNode FindExpectedExceptionAttribute(SyntaxNode node) =>\n            ((MethodDeclarationSyntax)node).AttributeLists.SelectMany(x => x.Attributes).FirstOrDefault(x => x.GetName() is \"ExpectedException\" or \"ExpectedExceptionAttribute\");\n\n        protected override bool HasMultiLineBody(SyntaxNode node)\n        {\n            var declaration = (MethodDeclarationSyntax)node;\n            return declaration.ExpressionBody is null\n                && declaration.Body?.Statements.Count > 1;\n        }\n\n        protected override bool AssertInCatchFinallyBlock(SyntaxNode node)\n        {\n            var walker = new CatchFinallyAssertion();\n            foreach (var x in node.DescendantNodes().Where(x => x.Kind() is SyntaxKind.CatchClause or SyntaxKind.FinallyClause))\n            {\n                if (!walker.HasAssertion)\n                {\n                    walker.SafeVisit(x);\n                }\n            }\n            return walker.HasAssertion;\n        }\n\n        private sealed class CatchFinallyAssertion : SafeCSharpSyntaxWalker\n        {\n            public bool HasAssertion { get; set; }\n\n            public override void VisitInvocationExpression(InvocationExpressionSyntax node) =>\n                HasAssertion = HasAssertion || node.Expression.ToString().SplitCamelCaseToWords().Intersect(KnownMethods.AssertionMethodParts).Any();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ExpressionComplexity.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ExpressionComplexity : ExpressionComplexityBase<SyntaxKind>\n{\n    protected override ILanguageFacade Language { get; } = CSharpFacade.Instance;\n\n    protected override HashSet<SyntaxKind> TransparentKinds { get; } =\n        [\n            // Binary\n            SyntaxKind.CoalesceExpression,\n            SyntaxKind.BitwiseOrExpression,\n            SyntaxKind.ExclusiveOrExpression,\n            SyntaxKind.BitwiseAndExpression,\n            SyntaxKind.EqualsExpression,\n            SyntaxKind.NotEqualsExpression,\n            SyntaxKind.LessThanExpression,\n            SyntaxKind.LessThanOrEqualExpression,\n            SyntaxKind.GreaterThanExpression,\n            SyntaxKind.GreaterThanOrEqualExpression,\n            SyntaxKind.LeftShiftExpression,\n            SyntaxKind.RightShiftExpression,\n            SyntaxKindEx.UnsignedRightShiftExpression,\n            SyntaxKind.AddExpression,\n            SyntaxKind.SubtractExpression,\n            SyntaxKind.MultiplyExpression,\n            SyntaxKind.DivideExpression,\n            SyntaxKind.ModuloExpression,\n\n            // Unary\n            SyntaxKind.ParenthesizedExpression,\n            SyntaxKind.LogicalNotExpression,\n            SyntaxKindEx.ParenthesizedPattern,\n            SyntaxKindEx.NotPattern,\n        ];\n\n    protected override HashSet<SyntaxKind> ComplexityIncreasingKinds { get; } =\n        [\n            SyntaxKind.ConditionalExpression,\n            SyntaxKind.LogicalAndExpression,\n            SyntaxKind.LogicalOrExpression,\n            SyntaxKindEx.CoalesceAssignmentExpression,\n            SyntaxKindEx.AndPattern,\n            SyntaxKindEx.OrPattern\n        ];\n\n    protected override SyntaxNode[] ExpressionChildren(SyntaxNode node) =>\n        node.IsAnyKind(TransparentKinds) || node.IsAnyKind(ComplexityIncreasingKinds)\n            ? node switch\n            {\n                ConditionalExpressionSyntax conditional => [conditional.Condition, conditional.WhenTrue, conditional.WhenFalse],\n                BinaryExpressionSyntax binary => [binary.Left, binary.Right],\n                { RawKind: (int)SyntaxKindEx.AndPattern or (int)SyntaxKindEx.OrPattern } pattern when (BinaryPatternSyntaxWrapper)pattern is var patternWrapper =>\n                    [patternWrapper.Left.Node, patternWrapper.Right.Node],\n                AssignmentExpressionSyntax assigment => [assigment.Left, assigment.Right],\n                ParenthesizedExpressionSyntax { Expression: { } expression } => [expression],\n                PrefixUnaryExpressionSyntax { Operand: { } operand } => [operand],\n                { RawKind: (int)SyntaxKindEx.ParenthesizedPattern } parenthesized when (ParenthesizedPatternSyntaxWrapper)parenthesized is var parenthesizedWrapped =>\n                    [parenthesizedWrapped.Pattern.Node],\n                { RawKind: (int)SyntaxKindEx.NotPattern } negated when (UnaryPatternSyntaxWrapper)negated is var negatedWrapper =>\n                    [negatedWrapper.Pattern.Node],\n                _ => [],\n            }\n            : [];\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ExtensionMethodShouldBeInSeparateNamespace.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class ExtensionMethodShouldBeInSeparateNamespace : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S4226\";\n        private const string MessageFormat = \"Either move this extension to another namespace or move the method inside the class itself.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var methodDeclaration = (MethodDeclarationSyntax)c.Node;\n\n                    if (methodDeclaration.IsExtensionMethod()\n                        && c.Model.GetDeclaredSymbol(methodDeclaration) is { IsExtensionMethod: true, Parameters: { Length: > 0 } } methodSymbol\n                        && methodSymbol.Parameters[0].Type.Kind != SymbolKind.ErrorType\n                        && methodSymbol.Parameters[0].Type.IsClass()\n                        && methodSymbol.ContainingNamespace.Equals(methodSymbol.Parameters[0].Type.ContainingNamespace)\n                        && !methodSymbol.Parameters[0].Type.HasAttribute(KnownType.System_CodeDom_Compiler_GeneratedCodeAttribute))\n                    {\n                        c.ReportIssue(Rule, methodDeclaration.Identifier);\n                    }\n                },\n                SyntaxKind.MethodDeclaration);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ExtensionMethodShouldNotExtendObject.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ExtensionMethodShouldNotExtendObject : ExtensionMethodShouldNotExtendObjectBase<SyntaxKind, MethodDeclarationSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override bool IsExtensionMethod(MethodDeclarationSyntax declaration, SemanticModel semanticModel) =>\n        declaration.IsExtensionMethod();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/FieldShadowsParentField.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class FieldShadowsParentField : FieldShadowsParentFieldBase<SyntaxKind, VariableDeclaratorSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n                {\n                    var fieldDeclaration = (FieldDeclarationSyntax)c.Node;\n                    if (!fieldDeclaration.Modifiers.Any(x => x.IsKind(SyntaxKind.NewKeyword)))\n                    {\n                        foreach (var diagnostics in fieldDeclaration.Declaration.Variables.SelectMany(x => CheckFields(c.Model, x)))\n                        {\n                            c.ReportIssue(diagnostics);\n                        }\n                    }\n                },\n                SyntaxKind.FieldDeclaration);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/FieldShouldBeReadonly.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing FieldTuple = SonarAnalyzer.Core.Common.NodeSymbolAndModel<Microsoft.CodeAnalysis.CSharp.Syntax.VariableDeclaratorSyntax, Microsoft.CodeAnalysis.IFieldSymbol>;\nusing TypeDeclarationTuple = SonarAnalyzer.Core.Common.NodeAndModel<Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax>;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class FieldShouldBeReadonly : SonarDiagnosticAnalyzer\n{\n    internal const string DiagnosticId = \"S2933\";\n    private const string MessageFormat = \"Make '{0}' 'readonly'.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    private static readonly ISet<SyntaxKind> AssignmentKinds = new HashSet<SyntaxKind>\n    {\n        SyntaxKind.SimpleAssignmentExpression,\n        SyntaxKind.AddAssignmentExpression,\n        SyntaxKind.SubtractAssignmentExpression,\n        SyntaxKind.MultiplyAssignmentExpression,\n        SyntaxKind.DivideAssignmentExpression,\n        SyntaxKind.ModuloAssignmentExpression,\n        SyntaxKind.AndAssignmentExpression,\n        SyntaxKind.ExclusiveOrAssignmentExpression,\n        SyntaxKind.OrAssignmentExpression,\n        SyntaxKind.LeftShiftAssignmentExpression,\n        SyntaxKind.RightShiftAssignmentExpression,\n        SyntaxKindEx.CoalesceAssignmentExpression,\n        SyntaxKindEx.UnsignedRightShiftAssignmentExpression\n    };\n\n    private static readonly ISet<SyntaxKind> PrefixUnaryKinds = new HashSet<SyntaxKind>\n    {\n        SyntaxKind.PreDecrementExpression,\n        SyntaxKind.PreIncrementExpression\n    };\n\n    private static readonly ISet<SyntaxKind> PostfixUnaryKinds = new HashSet<SyntaxKind>\n    {\n        SyntaxKind.PostDecrementExpression,\n        SyntaxKind.PostIncrementExpression\n    };\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterSymbolAction(\n            c =>\n            {\n                var declaredSymbol = (INamedTypeSymbol)c.Symbol;\n                if (!declaredSymbol.IsClassOrStruct()\n                    // Serializable classes are ignored because the serialized fields\n                    // cannot be readonly. [Nonserialized] fields could be readonly,\n                    // but all fields with attribute are ignored in the ReadonlyFieldCollector.\n                    || declaredSymbol.HasAttribute(KnownType.System_SerializableAttribute)\n                    // Partial classes are not processed.\n                    // See https://github.com/dotnet/roslyn/issues/3748\n                    || declaredSymbol.DeclaringSyntaxReferences.Length > 1)\n                {\n                    return;\n                }\n\n                var partialDeclarations = declaredSymbol.DeclaringSyntaxReferences\n                    .Select(reference => reference.GetSyntax())\n                    .OfType<TypeDeclarationSyntax>()\n                    .Select(x => new TypeDeclarationTuple(x, c.Compilation.GetSemanticModel(x.SyntaxTree)))\n                    .Where(x => x.Model is not null);\n\n                var fieldCollector = new ReadonlyFieldCollector(partialDeclarations);\n\n                if (!fieldCollector.HasAssignmentToThis)\n                {\n                    foreach (var field in fieldCollector.NonCompliantFields)\n                    {\n                        var identifier = field.Node.Identifier;\n                        c.ReportIssue(Rule, identifier, identifier.ValueText);\n                    }\n                }\n            },\n            SymbolKind.NamedType);\n\n    private sealed class ReadonlyFieldCollector\n    {\n        private readonly ISet<IFieldSymbol> assignedAsReadonly;\n        private readonly ISet<IFieldSymbol> excludedFields;\n        private readonly List<FieldTuple> allFields = [];\n\n        public bool HasAssignmentToThis { get; private set; }\n\n        public IEnumerable<FieldTuple> NonCompliantFields\n        {\n            get\n            {\n                var reportedFields = new HashSet<IFieldSymbol>(assignedAsReadonly.Except(excludedFields));\n                return allFields.Where(x => reportedFields.Contains(x.Symbol));\n            }\n        }\n\n        public ReadonlyFieldCollector(IEnumerable<TypeDeclarationTuple> partialTypeDeclarations)\n        {\n            excludedFields = new HashSet<IFieldSymbol>();\n            assignedAsReadonly = new HashSet<IFieldSymbol>();\n\n            foreach (var partialTypeDeclaration in partialTypeDeclarations)\n            {\n                var p = new PartialTypeDeclarationProcessor(partialTypeDeclaration, this);\n                p.CollectFields();\n                allFields.AddRange(p.AllFields);\n            }\n\n            foreach (var attributedField in allFields.Where(ShouldBeExcluded))\n            {\n                excludedFields.Add(attributedField.Symbol);\n            }\n\n            static bool ShouldBeExcluded(FieldTuple fieldTuple) =>\n                fieldTuple.Symbol.GetAttributes().Any()\n                || (fieldTuple.Symbol.Type.IsStruct() && fieldTuple.Symbol.Type.SpecialType == SpecialType.None);\n        }\n\n        private sealed class PartialTypeDeclarationProcessor\n        {\n            private readonly TypeDeclarationTuple partialTypeDeclaration;\n            private readonly ReadonlyFieldCollector readonlyFieldCollector;\n\n            public IEnumerable<FieldTuple> AllFields { get; }\n\n            public PartialTypeDeclarationProcessor(TypeDeclarationTuple partialTypeDeclaration, ReadonlyFieldCollector readonlyFieldCollector)\n            {\n                this.partialTypeDeclaration = partialTypeDeclaration;\n                this.readonlyFieldCollector = readonlyFieldCollector;\n\n                AllFields = partialTypeDeclaration.Node.ChildNodes()\n                    .OfType<FieldDeclarationSyntax>()\n                    .SelectMany(GetAllFields);\n            }\n\n            public void CollectFields()\n            {\n                CollectFieldsFromDeclarations();\n                CollectFieldsFromAssignments();\n                if (!readonlyFieldCollector.HasAssignmentToThis)\n                {\n                    CollectFieldsFromPrefixUnaryExpressions();\n                    CollectFieldsFromPostfixUnaryExpressions();\n                    CollectFieldsFromArguments();\n                }\n            }\n\n            private IEnumerable<FieldTuple> GetAllFields(FieldDeclarationSyntax fieldDeclaration) =>\n                fieldDeclaration.Declaration.Variables\n                    .Select(x => new FieldTuple(x, partialTypeDeclaration.Model.GetDeclaredSymbol(x) as IFieldSymbol, partialTypeDeclaration.Model));\n\n            private void CollectFieldsFromDeclarations()\n            {\n                var fieldDeclarations = AllFields.Where(x =>\n                    IsFieldRelevant(x.Symbol)\n                    && x.Node.Initializer is not null);\n\n                foreach (var field in fieldDeclarations)\n                {\n                    readonlyFieldCollector.assignedAsReadonly.Add(field.Symbol);\n                }\n            }\n\n            private void CollectFieldsFromArguments()\n            {\n                var arguments = partialTypeDeclaration.Node.DescendantNodes()\n                    .OfType<ArgumentSyntax>()\n                    .Where(x => !x.RefOrOutKeyword.IsKind(SyntaxKind.None));\n\n                foreach (var argument in arguments)\n                {\n                    // ref/out should be handled the same way as all other field assignments:\n                    ProcessExpression(argument.Expression);\n                }\n            }\n\n            private void CollectFieldsFromPostfixUnaryExpressions()\n            {\n                var postfixUnaries = partialTypeDeclaration.Node.DescendantNodes()\n                    .OfType<PostfixUnaryExpressionSyntax>()\n                    .Where(x => PostfixUnaryKinds.Contains(x.Kind()));\n\n                foreach (var postfixUnary in postfixUnaries)\n                {\n                    ProcessExpression(postfixUnary.Operand);\n                }\n            }\n\n            private void CollectFieldsFromPrefixUnaryExpressions()\n            {\n                var prefixUnaries = partialTypeDeclaration.Node.DescendantNodes()\n                    .OfType<PrefixUnaryExpressionSyntax>()\n                    .Where(x => PrefixUnaryKinds.Contains(x.Kind()));\n\n                foreach (var prefixUnary in prefixUnaries)\n                {\n                    ProcessExpression(prefixUnary.Operand);\n                }\n            }\n\n            private void CollectFieldsFromAssignments()\n            {\n                var assignments = partialTypeDeclaration.Node.DescendantNodes()\n                    .OfType<AssignmentExpressionSyntax>()\n                    .Where(x => AssignmentKinds.Contains(x.Kind()));\n\n                foreach (var leftSide in assignments.Select(x => x.Left))\n                {\n                    if (leftSide.Kind() is SyntaxKind.ThisExpression\n                        && leftSide.EnclosingScope().Kind() is not SyntaxKind.ConstructorDeclaration\n                        && leftSide.Ancestors().OfType<TypeDeclarationSyntax>().First().Equals(partialTypeDeclaration.Node))\n                    {\n                        readonlyFieldCollector.HasAssignmentToThis = true;\n                        return;\n                    }\n                    var leftSideExpressions = TupleExpressionsOrSelf(leftSide);\n                    foreach (var leftSideExpression in leftSideExpressions)\n                    {\n                        ProcessExpression(leftSideExpression);\n                    }\n                }\n            }\n\n            private void ProcessExpression(ExpressionSyntax expression)\n            {\n                ProcessAssignedExpression(expression);\n                ProcessAssignedTopMemberAccessExpression(expression);\n            }\n\n            private void ProcessAssignedTopMemberAccessExpression(ExpressionSyntax expression)\n            {\n                var topExpression = GetTopMemberAccessIfNested(expression);\n                if (topExpression is null)\n                {\n                    return;\n                }\n\n                var fieldSymbol = partialTypeDeclaration.Model.GetSymbolInfo(topExpression).Symbol as IFieldSymbol;\n                if (fieldSymbol?.Type is null\n                    || !fieldSymbol.Type.IsValueType)\n                {\n                    return;\n                }\n\n                ProcessExpressionOnField(topExpression, fieldSymbol);\n            }\n\n            private static ExpressionSyntax GetTopMemberAccessIfNested(ExpressionSyntax expression, bool isNestedMemberAccess = false)\n            {\n                // If expression is (this.a.b).c, we need to return this.a\n                var noParens = expression.RemoveParentheses();\n\n                if (noParens is NameSyntax)\n                {\n                    return isNestedMemberAccess ? noParens : null;\n                }\n\n                if (noParens is not MemberAccessExpressionSyntax memberAccess)\n                {\n                    return null;\n                }\n\n                if (memberAccess.Expression.RemoveParentheses().IsKind(SyntaxKind.ThisExpression))\n                {\n                    return isNestedMemberAccess ? memberAccess : null;\n                }\n\n                return GetTopMemberAccessIfNested(memberAccess.Expression, true);\n            }\n\n            private void ProcessAssignedExpression(ExpressionSyntax expression)\n            {\n                var fieldSymbol = partialTypeDeclaration.Model.GetSymbolInfo(expression).Symbol as IFieldSymbol;\n                ProcessExpressionOnField(expression, fieldSymbol);\n            }\n\n            private void ProcessExpressionOnField(ExpressionSyntax expression, IFieldSymbol fieldSymbol)\n            {\n                if (!IsFieldRelevant(fieldSymbol))\n                {\n                    return;\n                }\n\n                if (!expression.RemoveParentheses().IsOnThis())\n                {\n                    readonlyFieldCollector.excludedFields.Add(fieldSymbol);\n                    return;\n                }\n\n                if (partialTypeDeclaration.Model.GetEnclosingSymbol(expression.SpanStart) is not IMethodSymbol methodSymbol)\n                {\n                    readonlyFieldCollector.excludedFields.Add(fieldSymbol);\n                    return;\n                }\n\n                if (methodSymbol.MethodKind == MethodKind.Constructor\n                    && methodSymbol.ContainingType.Equals(fieldSymbol.ContainingType))\n                {\n                    readonlyFieldCollector.assignedAsReadonly.Add(fieldSymbol);\n                }\n                else\n                {\n                    readonlyFieldCollector.excludedFields.Add(fieldSymbol);\n                }\n            }\n\n            private static bool IsFieldRelevant(IFieldSymbol fieldSymbol) =>\n                fieldSymbol is { IsStatic: false, IsConst: false, IsReadOnly: false, DeclaredAccessibility: Accessibility.Private };\n\n            private static IEnumerable<ExpressionSyntax> TupleExpressionsOrSelf(ExpressionSyntax expression)\n            {\n                if (TupleExpressionSyntaxWrapper.IsInstance(expression))\n                {\n                    var assignments = new List<ExpressionSyntax>();\n                    foreach (var argument in ((TupleExpressionSyntaxWrapper)expression).Arguments)\n                    {\n                        assignments.Add(argument.Expression);\n                    }\n                    return assignments;\n                }\n                else\n                {\n                    return [expression];\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/FieldShouldBeReadonlyCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class FieldShouldBeReadonlyCodeFix : SonarCodeFix\n    {\n        private const string Title = \"Add 'readonly' keyword\";\n\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(FieldShouldBeReadonly.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            var syntaxNode = root.FindNode(diagnosticSpan);\n\n            var variableDeclarator = syntaxNode.FirstAncestorOrSelf<VariableDeclaratorSyntax>();\n            if (variableDeclarator?.Parent is not VariableDeclarationSyntax variableDeclaration)\n            {\n                return Task.CompletedTask;\n            }\n\n            if (variableDeclaration.Variables.Count == 1)\n            {\n                if (variableDeclaration.Parent is not FieldDeclarationSyntax fieldDeclaration)\n                {\n                    return Task.CompletedTask;\n                }\n\n                context.RegisterCodeFix(\n                    Title,\n                    c =>\n                    {\n                        var readonlyToken = SyntaxFactory.Token(SyntaxKind.ReadOnlyKeyword);\n                        var newFieldDeclaration = HasAnyAccessibilityModifier(fieldDeclaration)\n                            ? fieldDeclaration.AddModifiers(readonlyToken)\n                            : fieldDeclaration.WithoutLeadingTrivia()\n                                    .AddModifiers(readonlyToken.WithLeadingTrivia(fieldDeclaration.GetLeadingTrivia()));\n\n                        var newRoot = root.ReplaceNode(fieldDeclaration, newFieldDeclaration);\n                        return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                    },\n                    context.Diagnostics);\n            }\n\n            return Task.CompletedTask;\n        }\n\n        private static bool HasAnyAccessibilityModifier(FieldDeclarationSyntax fieldDeclaration) =>\n            fieldDeclaration.Modifiers.Any(modifier => modifier.IsAnyKind(SyntaxKind.PrivateKeyword, SyntaxKind.PublicKeyword, SyntaxKind.InternalKeyword, SyntaxKind.ProtectedKeyword));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/FieldShouldNotBePublic.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class FieldShouldNotBePublic : FieldShouldNotBePublicBase<SyntaxKind, FieldDeclarationSyntax, VariableDeclaratorSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n        protected override IEnumerable<VariableDeclaratorSyntax> Variables(FieldDeclarationSyntax fieldDeclaration) =>\n            fieldDeclaration.Declaration.Variables;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/FieldsShouldBeEncapsulatedInProperties.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class FieldsShouldBeEncapsulatedInProperties : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S1104\";\n    private const string MessageFormat = \"Make this field 'private' and encapsulate it in a 'public' property.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    private static readonly ISet<SyntaxKind> ValidModifiers = new HashSet<SyntaxKind>\n    {\n        SyntaxKind.PrivateKeyword,\n        SyntaxKind.ProtectedKeyword,\n        SyntaxKind.InternalKeyword,\n        SyntaxKind.ReadOnlyKeyword,\n        SyntaxKind.ConstKeyword\n    };\n\n    private static readonly ImmutableArray<KnownType> IgnoredTypes = ImmutableArray.Create(\n        KnownType.UnityEngine_MonoBehaviour,\n        KnownType.UnityEngine_ScriptableObject);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            c =>\n            {\n                var fieldDeclaration = (FieldDeclarationSyntax)c.Node;\n                if (fieldDeclaration.Modifiers.Any(m => ValidModifiers.Contains(m.Kind())))\n                {\n                    return;\n                }\n\n                var firstVariable = fieldDeclaration.Declaration.Variables[0];\n                var symbol = c.Model.GetDeclaredSymbol(firstVariable);\n                var parentSymbol = c.Model.GetDeclaredSymbol(fieldDeclaration.Parent);\n                if (symbol.ContainingType.DerivesFromAny(IgnoredTypes)\n                    || parentSymbol.HasAttribute(KnownType.System_Runtime_InteropServices_StructLayoutAttribute)\n                    || Serializable(symbol, parentSymbol))\n                {\n                    return;\n                }\n\n                if (symbol.GetEffectiveAccessibility() == Accessibility.Public)\n                {\n                    c.ReportIssue(Rule, firstVariable);\n                }\n            },\n            SyntaxKind.FieldDeclaration);\n\n    private static bool Serializable(ISymbol symbol, ISymbol parentSymbol) =>\n        parentSymbol.HasAttribute(KnownType.System_SerializableAttribute)\n        && !symbol.HasAttribute(KnownType.System_NonSerializedAttribute);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/FileLines.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class FileLines : FileLinesBase\n    {\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat, false);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override GeneratedCodeRecognizer GeneratedCodeRecognizer => CSharpGeneratedCodeRecognizer.Instance;\n\n        protected override bool IsEndOfFileToken(SyntaxToken token) => token.IsKind(SyntaxKind.EndOfFileToken);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/FileShouldEndWithEmptyNewLine.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class FileShouldEndWithEmptyNewLine : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S113\";\n        private const string MessageFormat = \"Add a new line at the end of the file '{0}'.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterTreeAction(stac =>\n                {\n                    var lastToken = stac.Tree.GetRoot().GetLastToken();\n\n                    if (lastToken == default(SyntaxToken))\n                    {\n                        return;\n                    }\n\n                    var isFileEndingWithNewLine = lastToken.TrailingTrivia.LastOrDefault().IsKind(SyntaxKind.EndOfLineTrivia);\n                    if (!isFileEndingWithNewLine)\n                    {\n                        stac.ReportIssue(Rule, lastToken, Path.GetFileName(stac.Tree.FilePath));\n                    }\n                });\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/FinalizerShouldNotBeEmpty.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class FinalizerShouldNotBeEmpty : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S3880\";\n        private const string MessageFormat = \"Remove this empty finalizer.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var destructorDeclaration = (DestructorDeclarationSyntax)c.Node;\n                    if (destructorDeclaration.Body?.Statements.Count == 0\n                        && destructorDeclaration.ExpressionBody() == null)\n                    {\n                        c.ReportIssue(Rule, destructorDeclaration);\n                    }\n                },\n                SyntaxKind.DestructorDeclaration);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/FindInsteadOfFirstOrDefault.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class FindInsteadOfFirstOrDefault : FindInsteadOfFirstOrDefaultBase<SyntaxKind, InvocationExpressionSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/FlagsEnumWithoutInitializer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class FlagsEnumWithoutInitializer : FlagsEnumWithoutInitializerBase<SyntaxKind, EnumMemberDeclarationSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language { get; } = CSharpFacade.Instance;\n\n        protected override bool IsInitialized(EnumMemberDeclarationSyntax member) =>\n            member.EqualsValue != null;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/FlagsEnumZeroMember.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class FlagsEnumZeroMember : FlagsEnumZeroMemberBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language { get; } = CSharpFacade.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ForLoopConditionAlwaysFalse.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class ForLoopConditionAlwaysFalse : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S2252\";\n        private const string MessageFormat = \"This loop will never execute.\";\n\n        private static readonly CSharpExpressionNumericConverter ExpressionNumericConverter = new();\n\n        private static readonly ISet<SyntaxKind> ConditionsToCheck = new HashSet<SyntaxKind>\n        {\n            SyntaxKind.GreaterThanExpression,\n            SyntaxKind.GreaterThanOrEqualExpression,\n            SyntaxKind.LessThanExpression,\n            SyntaxKind.LessThanOrEqualExpression,\n            SyntaxKind.EqualsExpression,\n            SyntaxKind.NotEqualsExpression\n        };\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var forNode = (ForStatementSyntax)c.Node;\n                    if (forNode.Condition is not null && (IsAlwaysFalseCondition(forNode.Condition) || IsConditionFalseAtInitialization(forNode)))\n                    {\n                        c.ReportIssue(Rule, forNode.Condition);\n                    }\n                },\n                SyntaxKind.ForStatement);\n\n        private bool IsAlwaysFalseCondition(ExpressionSyntax condition) =>\n            condition.IsKind(SyntaxKind.FalseLiteralExpression)\n            || (IsLogicalNot(condition, out var logicalNode)\n                && IsAlwaysTrueCondition(logicalNode.Operand.RemoveParentheses()));\n\n        private bool IsAlwaysTrueCondition(ExpressionSyntax condition) =>\n            condition.IsKind(SyntaxKind.TrueLiteralExpression)\n            || (IsLogicalNot(condition, out var logicalNode)\n                && IsAlwaysFalseCondition(logicalNode.Operand.RemoveParentheses()));\n\n        private static bool IsConditionFalseAtInitialization(ForStatementSyntax forNode)\n        {\n            var condition = forNode.Condition;\n            if (!ConditionsToCheck.Contains(condition.Kind()))\n            {\n                return false;\n            }\n\n            var loopVariableDeclarationMapping = VariableDeclarationMapping(forNode.Declaration);\n            var loopInitializerMapping = LoopInitializerMapping(forNode.Initializers);\n\n            var variableNameToDecimalMapping = loopVariableDeclarationMapping\n                .Union(loopInitializerMapping)\n                .ToDictionary(d => d.Key, d => d.Value);\n\n            var binaryCondition = (BinaryExpressionSyntax)condition;\n            if (DecimalValue(variableNameToDecimalMapping, binaryCondition.Left) is { } leftValue\n                && DecimalValue(variableNameToDecimalMapping, binaryCondition.Right) is { } rightValue)\n            {\n                return !ConditionIsTrue(condition.Kind(), leftValue, rightValue);\n            }\n            return false;\n        }\n\n        private static bool ConditionIsTrue(SyntaxKind syntaxKind, decimal leftValue, decimal rightValue) =>\n            syntaxKind switch\n            {\n                SyntaxKind.GreaterThanExpression => leftValue > rightValue,\n                SyntaxKind.GreaterThanOrEqualExpression => leftValue >= rightValue,\n                SyntaxKind.LessThanExpression => leftValue < rightValue,\n                SyntaxKind.LessThanOrEqualExpression => leftValue <= rightValue,\n                SyntaxKind.EqualsExpression => leftValue == rightValue,\n                SyntaxKind.NotEqualsExpression => leftValue != rightValue,\n                _ => true\n            };\n\n        private static bool IsLogicalNot(ExpressionSyntax expression, out PrefixUnaryExpressionSyntax logicalNot)\n        {\n            var prefixUnaryExpression = expression.RemoveParentheses() as PrefixUnaryExpressionSyntax;\n            logicalNot = prefixUnaryExpression;\n            return prefixUnaryExpression is not null && prefixUnaryExpression.OperatorToken.IsKind(SyntaxKind.ExclamationToken);\n        }\n\n        private static decimal? DecimalValue(IDictionary<string, decimal> variableNameToDecimalValue, ExpressionSyntax expression) =>\n            ExpressionNumericConverter.ConstantDecimalValue(expression) is { } parsedValue\n                || (expression is SimpleNameSyntax simpleName && variableNameToDecimalValue.TryGetValue(simpleName.Identifier.ValueText, out parsedValue))\n                    ? parsedValue\n                    : (decimal?)null;\n\n        /// <summary>\n        /// Retrieves the mapping of variable names to their decimal value from the variable declaration part of a for loop.\n        /// This will find the mapping for such cases:\n        /// <code>\n        /// for (var i = 0;;) {}\n        /// </code>\n        /// </summary>\n        private static IDictionary<string, decimal> VariableDeclarationMapping(VariableDeclarationSyntax variableDeclarationSyntax)\n        {\n            var loopInitializerValues = new Dictionary<string, decimal>();\n            if (variableDeclarationSyntax is not null)\n            {\n                foreach (var variableDeclaration in variableDeclarationSyntax.Variables)\n                {\n                    if (variableDeclaration.Initializer is { } initializer\n                        && ExpressionNumericConverter.ConstantDecimalValue(initializer.Value) is { } decimalValue)\n                    {\n                        loopInitializerValues.Add(variableDeclaration.Identifier.ValueText, decimalValue);\n                    }\n                }\n            }\n            return loopInitializerValues;\n        }\n\n        /// <summary>\n        /// Retrieves the mapping of variable names to their decimal value from the initializer part of a for loop.\n        /// This will find the mapping for such cases:\n        /// <code>\n        /// int i;\n        /// for (i = 0;;) {}\n        /// </code>\n        /// </summary>\n        private static IDictionary<string, decimal> LoopInitializerMapping(IEnumerable<ExpressionSyntax> initializers)\n        {\n            var loopInitializerValues = new Dictionary<string, decimal>();\n            if (initializers is not null)\n            {\n                foreach (var initializer in initializers)\n                {\n                    if (initializer.IsKind(SyntaxKind.SimpleAssignmentExpression)\n                        && initializer is AssignmentExpressionSyntax { Left: SimpleNameSyntax simpleName } assignment\n                        && ExpressionNumericConverter.ConstantDecimalValue(assignment.Right) is { } decimalValue)\n                    {\n                        loopInitializerValues.Add(simpleName.Identifier.ValueText, decimalValue);\n                    }\n                }\n            }\n            return loopInitializerValues;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ForLoopCounterChanged.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ForLoopCounterChanged : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S127\";\n    private const string MessageFormat = \"Do not update the stop condition variable '{0}' in the body of the for loop.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    private static readonly IImmutableList<SideEffectExpression> SideEffectExpressions = ImmutableArray.Create(\n        new SideEffectExpression\n        {\n            Kinds = ImmutableHashSet.Create(SyntaxKind.PreIncrementExpression, SyntaxKind.PreDecrementExpression),\n            AffectedExpressions = x => ImmutableArray.Create<SyntaxNode>(((PrefixUnaryExpressionSyntax)x).Operand)\n        },\n        new SideEffectExpression\n        {\n            Kinds = ImmutableHashSet.Create(SyntaxKind.PostIncrementExpression, SyntaxKind.PostDecrementExpression),\n            AffectedExpressions = x => ImmutableArray.Create<SyntaxNode>(((PostfixUnaryExpressionSyntax)x).Operand)\n        },\n        new SideEffectExpression\n        {\n            Kinds = ImmutableHashSet.Create(\n                SyntaxKind.SimpleAssignmentExpression,\n                SyntaxKind.AddAssignmentExpression,\n                SyntaxKind.SubtractAssignmentExpression,\n                SyntaxKind.MultiplyAssignmentExpression,\n                SyntaxKind.DivideAssignmentExpression,\n                SyntaxKind.ModuloAssignmentExpression,\n                SyntaxKind.AndAssignmentExpression,\n                SyntaxKind.ExclusiveOrAssignmentExpression,\n                SyntaxKind.OrAssignmentExpression,\n                SyntaxKind.LeftShiftAssignmentExpression,\n                SyntaxKind.RightShiftAssignmentExpression,\n                SyntaxKindEx.UnsignedRightShiftAssignmentExpression),\n            AffectedExpressions = x => ((AssignmentExpressionSyntax)x).AssignmentTargets()\n        });\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            c =>\n            {\n                var forNode = (ForStatementSyntax)c.Node;\n                var loopCounters = LoopCounters(forNode, c.Model).ToList();\n                foreach (var affectedExpression in ComputeAffectedExpressions(forNode.Statement))\n                {\n                    if (c.Model.GetSymbolInfo(affectedExpression).Symbol is { } symbol\n                        && loopCounters.Contains(symbol))\n                    {\n                        c.ReportIssue(Rule, affectedExpression, symbol.Name);\n                    }\n                }\n            },\n            SyntaxKind.ForStatement);\n\n    private static IEnumerable<ISymbol> LoopCounters(ForStatementSyntax node, SemanticModel model)\n    {\n        if (node.Condition is null || node.Incrementors.Count == 0)\n        {\n            return [];\n        }\n\n        var conditionSymbols = node.Condition.DescendantNodesAndSelf()\n            .OfType<IdentifierNameSyntax>()\n            .Select(x => model.GetSymbolInfo(x).Symbol)\n            .Where(x => x is ILocalSymbol or IParameterSymbol)\n            .WhereNotNull()\n            .ToHashSet();\n\n        return node.Incrementors\n            .SelectMany(x => x.DescendantNodesAndSelf().OfType<IdentifierNameSyntax>())\n            .Select(x => model.GetSymbolInfo(x).Symbol)\n            .Where(x => x is ILocalSymbol or IParameterSymbol)\n            .WhereNotNull()\n            .Where(conditionSymbols.Contains)\n            .Distinct();\n    }\n\n    private static SyntaxNode[] ComputeAffectedExpressions(SyntaxNode node) =>\n        (from descendantNode in node.DescendantNodesAndSelf()\n         from sideEffect in SideEffectExpressions\n         where descendantNode.IsAnyKind(sideEffect.Kinds)\n         from expression in sideEffect.AffectedExpressions(descendantNode)\n         select expression).ToArray();\n\n    private readonly record struct SideEffectExpression(ImmutableHashSet<SyntaxKind> Kinds, Func<SyntaxNode, ImmutableArray<SyntaxNode>> AffectedExpressions);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ForLoopCounterCondition.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Globalization;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class ForLoopCounterCondition : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S1994\";\n        private const string MessageFormat = \"{0}\";\n        private const string MessageFormatNotEmpty = \"This loop's stop condition tests {0} but the incrementer updates {1}.\";\n        private const string MessageFormatEmpty = \"This loop's stop incrementer updates {0} but the stop condition doesn't test any variables.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var forNode = (ForStatementSyntax)c.Node;\n\n                    var incrementedSymbols = GetIncrementorSymbols(forNode, c.Model).ToList();\n                    if (!incrementedSymbols.Any())\n                    {\n                        return;\n                    }\n\n                    var conditionSymbols = GetReadSymbolsCondition(forNode, c.Model).ToList();\n                    if (conditionSymbols.Intersect(incrementedSymbols).Any())\n                    {\n                        return;\n                    }\n\n                    var incrementedVariables = incrementedSymbols.Select(s => $\"'{s.Name}'\").OrderBy(s => s).JoinAnd();\n                    if (conditionSymbols.Any())\n                    {\n                        var conditionVariables = conditionSymbols.Select(s => $\"'{s.Name}'\").OrderBy(s => s).JoinAnd();\n                        c.ReportIssue(Rule, forNode.Condition, string.Format(CultureInfo.InvariantCulture, MessageFormatNotEmpty, conditionVariables, incrementedVariables));\n                    }\n                    else\n                    {\n                        c.ReportIssue(Rule, forNode.ForKeyword, string.Format(CultureInfo.InvariantCulture, MessageFormatEmpty, incrementedVariables));\n                    }\n                },\n                SyntaxKind.ForStatement);\n\n        private static IEnumerable<ISymbol> GetIncrementorSymbols(ForStatementSyntax forNode,\n                                                                  SemanticModel semanticModel)\n        {\n            var accessedSymbols = new List<ISymbol>();\n            foreach (var dataFlowAnalysis in forNode.Incrementors\n                .Select(semanticModel.AnalyzeDataFlow)\n                .Where(dataFlowAnalysis => dataFlowAnalysis.Succeeded))\n            {\n                accessedSymbols.AddRange(dataFlowAnalysis.WrittenInside);\n                accessedSymbols.AddRange(dataFlowAnalysis.ReadInside);\n            }\n\n            return accessedSymbols.Distinct();\n        }\n\n        private static IEnumerable<ISymbol> GetReadSymbolsCondition(ForStatementSyntax forNode, SemanticModel semanticModel)\n        {\n            if (forNode.Condition == null)\n            {\n                return Array.Empty<ISymbol>();\n            }\n\n            var dataFlowAnalysis = semanticModel.AnalyzeDataFlow(forNode.Condition);\n\n            return dataFlowAnalysis.Succeeded\n                ? dataFlowAnalysis.ReadInside.Distinct()\n                : Array.Empty<ISymbol>();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ForLoopIncrementSign.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class ForLoopIncrementSign : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S2251\";\n        private const string MessageFormat = \"'{0}' is {1}remented and will never reach 'stop condition'.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(rule);\n\n        private enum ArithmeticOperation\n        {\n            None,\n            Addition,\n            Substraction\n        }\n\n        private enum Condition\n        {\n            None,\n            Less,\n            Greater\n        }\n\n        private readonly Dictionary<SyntaxKind, ArithmeticOperation> incrementorToOperation = new Dictionary<SyntaxKind, ArithmeticOperation>\n        {\n            { SyntaxKind.PreDecrementExpression, ArithmeticOperation.Substraction },\n            { SyntaxKind.PreIncrementExpression, ArithmeticOperation.Addition },\n            { SyntaxKind.PostDecrementExpression, ArithmeticOperation.Substraction },\n            { SyntaxKind.PostIncrementExpression, ArithmeticOperation.Addition },\n            { SyntaxKind.SubtractAssignmentExpression, ArithmeticOperation.Substraction },\n            { SyntaxKind.AddAssignmentExpression, ArithmeticOperation.Addition },\n            { SyntaxKind.AddExpression, ArithmeticOperation.Addition },\n            { SyntaxKind.SubtractExpression, ArithmeticOperation.Substraction }\n        };\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(c =>\n                {\n                    var forNode = (ForStatementSyntax)c.Node;\n\n                    var conditionSyntax = forNode.Condition;\n                    if (!(conditionSyntax is BinaryExpressionSyntax binaryCondition))\n                    {\n                        return;\n                    }\n\n                    if (forNode.Incrementors.Count != 1)\n                    {\n                        return;\n                    }\n\n                    var incrementor = forNode.Incrementors[0];\n\n                    var incrementorData = GetIncrementData(incrementor);\n                    if (incrementorData.Operation == ArithmeticOperation.None)\n                    {\n                        return;\n                    }\n\n                    var condition = GetCondition(binaryCondition, incrementorData.IdentifierName);\n                    if (condition == Condition.None)\n                    {\n                        return;\n                    }\n\n                    if (incrementorData.Operation == ArithmeticOperation.Addition &&\n                        condition == Condition.Greater)\n                    {\n                        c.ReportIssue(rule, forNode.Incrementors.First(), [forNode.Condition.ToSecondaryLocation()], incrementorData.IdentifierName, \"inc\");\n                    }\n                    else if (incrementorData.Operation == ArithmeticOperation.Substraction &&\n                             condition == Condition.Less)\n                    {\n                        c.ReportIssue(rule, forNode.Incrementors.First(), [forNode.Condition.ToSecondaryLocation()], incrementorData.IdentifierName, \"dec\");\n                    }\n                },\n                SyntaxKind.ForStatement);\n        }\n\n        private IncrementData GetIncrementData(ExpressionSyntax incrementor)\n        {\n            var identifierName = string.Empty;\n            var opp = ArithmeticOperation.None;\n\n            var incrementorKind = incrementor.Kind();\n\n            switch (incrementorKind)\n            {\n                case SyntaxKind.PreDecrementExpression:\n                case SyntaxKind.PreIncrementExpression:\n                case SyntaxKind.PostDecrementExpression:\n                case SyntaxKind.PostIncrementExpression:\n                    if (GetUnnaryExpressionOperand(incrementor) is IdentifierNameSyntax operand)\n                    {\n                        identifierName = operand.Identifier.ValueText;\n                        opp =  incrementorToOperation.GetValueOrDefault(incrementorKind, ArithmeticOperation.None);\n                    }\n                    break;\n\n                case SyntaxKind.SubtractAssignmentExpression:\n                case SyntaxKind.AddAssignmentExpression:\n                    if (incrementor is AssignmentExpressionSyntax add &&\n                        add.Left is IdentifierNameSyntax leftId &&\n                        add.Right.IsKind(SyntaxKind.NumericLiteralExpression))\n                    {\n                        identifierName = leftId.Identifier.ValueText;\n                        opp = incrementorToOperation.GetValueOrDefault(incrementorKind, ArithmeticOperation.None);\n                    }\n                    break;\n\n                case SyntaxKind.SimpleAssignmentExpression:\n                    if (incrementor is AssignmentExpressionSyntax simpleAssignment &&\n                        simpleAssignment.Left is IdentifierNameSyntax simpleAssignmentId &&\n                        simpleAssignment.Right is BinaryExpressionSyntax right &&\n                        IsVariableAndLiteralBinaryExpression(right, simpleAssignmentId.Identifier.ValueText))\n                    {\n                        identifierName = simpleAssignmentId.Identifier.ValueText;\n                        opp = incrementorToOperation.GetValueOrDefault(right.Kind(), ArithmeticOperation.None);\n                    }\n                    break;\n\n                default:\n                    break;\n            }\n\n            return new IncrementData(identifierName, opp);\n        }\n\n        private Condition GetCondition(BinaryExpressionSyntax conditionSyntax, string identifierName)\n        {\n            // Since the incremented variable can be on any side of the condition (i < 10 or 10 > i),\n            // both sides of the binary expression need to be considered.\n\n            if (IsIdentifier(conditionSyntax.Left, identifierName))\n            {\n                if (conditionSyntax.Kind() is SyntaxKind.LessThanExpression or SyntaxKind.LessThanOrEqualExpression)\n                {\n                    return Condition.Less;\n                }\n                else if (conditionSyntax.Kind() is SyntaxKind.GreaterThanExpression or SyntaxKind.GreaterThanOrEqualExpression)\n                {\n                    return Condition.Greater;\n                }\n            }\n            else if (IsIdentifier(conditionSyntax.Right, identifierName))\n            {\n                if (conditionSyntax.Kind() is SyntaxKind.LessThanExpression or SyntaxKind.LessThanOrEqualExpression)\n                {\n                    return Condition.Greater;\n                }\n                else if (conditionSyntax.Kind() is SyntaxKind.GreaterThanExpression or SyntaxKind.GreaterThanOrEqualExpression)\n                {\n                    return Condition.Less;\n                }\n            }\n\n            return Condition.None;\n        }\n\n        private bool IsVariableAndLiteralBinaryExpression(BinaryExpressionSyntax binaryExpression, string identifierName) =>\n            (IsIdentifier(binaryExpression.Left, identifierName) && binaryExpression.Right.IsKind(SyntaxKind.NumericLiteralExpression)) ||\n            (binaryExpression.Left.IsKind(SyntaxKind.NumericLiteralExpression) && IsIdentifier(binaryExpression.Right, identifierName));\n\n        private bool IsIdentifier(SyntaxNode node, string identifierName) =>\n            node is IdentifierNameSyntax identifier &&\n            identifier.NameIs(identifierName);\n\n        private ExpressionSyntax GetUnnaryExpressionOperand(ExpressionSyntax syntax)\n        {\n            switch (syntax.Kind())\n            {\n                case SyntaxKind.PreIncrementExpression:\n                case SyntaxKind.PreDecrementExpression:\n                    var prefix = (PrefixUnaryExpressionSyntax)syntax;\n                    return prefix.Operand;\n\n                case SyntaxKind.PostIncrementExpression:\n                case SyntaxKind.PostDecrementExpression:\n                    var postfix = (PostfixUnaryExpressionSyntax)syntax;\n                    return postfix.Operand;\n\n                default:\n                    break;\n            }\n\n            return default(IdentifierNameSyntax);\n        }\n\n        private class IncrementData\n        {\n            public string IdentifierName { get; }\n\n            public ArithmeticOperation Operation { get; }\n\n            public IncrementData(string identifierName, ArithmeticOperation operation)\n            {\n                IdentifierName = identifierName;\n                Operation = operation;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ForeachLoopExplicitConversion.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class ForeachLoopExplicitConversion : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S3217\";\n        private const string MessageFormat = \"Either change the type of '{0}' to '{1}' or iterate on a generic collection of type '{2}'.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var foreachStatement = (ForEachStatementSyntax)c.Node;\n                    var foreachInfo = c.Model.GetForEachStatementInfo(foreachStatement);\n\n                    if (foreachInfo.Equals(default(ForEachStatementInfo))\n                        || foreachInfo.ElementConversion.IsImplicit\n                        || foreachInfo.ElementConversion.IsUserDefined\n                        || !foreachInfo.ElementConversion.Exists\n                        || foreachInfo.ElementType.Is(KnownType.System_Object))\n                    {\n                        return;\n                    }\n\n                    c.ReportIssue(\n                        Rule,\n                        foreachStatement.Type,\n                        foreachStatement.Identifier.ValueText,\n                        foreachInfo.ElementType.ToMinimalDisplayString(c.Model, foreachStatement.Type.SpanStart),\n                        foreachStatement.Type.ToString());\n                },\n                SyntaxKind.ForEachStatement);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ForeachLoopExplicitConversionCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Formatting;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class ForeachLoopExplicitConversionCodeFix : SonarCodeFix\n    {\n        private const string Title = \"Filter collection for the expected type\";\n        public override ImmutableArray<string> FixableDiagnosticIds { get; } =\n            ImmutableArray.Create(ForeachLoopExplicitConversion.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            var foreachSyntax = root.FindNode(diagnosticSpan).FirstAncestorOrSelf<ForEachStatementSyntax>();\n            if (foreachSyntax == null)\n            {\n                return Task.CompletedTask;\n            }\n\n            var semanticModel = context.Document.GetSemanticModelAsync(context.Cancel).ConfigureAwait(false).GetAwaiter().GetResult();\n            var enumerableHelperType = semanticModel.Compilation.GetTypeByMetadataName(KnownType.System_Linq_Enumerable);\n\n            if (enumerableHelperType != null)\n            {\n                context.RegisterCodeFix(\n                    Title,\n                    c =>\n                    {\n                        var newRoot = CalculateNewRoot(root, foreachSyntax, semanticModel);\n                        return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                    },\n                    context.Diagnostics);\n            }\n\n            return Task.CompletedTask;\n        }\n\n        private static SyntaxNode CalculateNewRoot(SyntaxNode root, ForEachStatementSyntax foreachSyntax, SemanticModel semanticModel)\n        {\n            var collection = foreachSyntax.Expression;\n            var typeName = foreachSyntax.Type.ToString();\n            var invocationToAdd = GetOfTypeInvocation(typeName, collection);\n            var namedTypes = semanticModel.LookupNamespacesAndTypes(foreachSyntax.SpanStart).OfType<INamedTypeSymbol>();\n            var isUsingAlreadyThere = namedTypes.Any(KnownType.System_Linq_Enumerable.Matches);\n\n            if (isUsingAlreadyThere)\n            {\n                return root\n                    .ReplaceNode(collection, invocationToAdd)\n                    .WithAdditionalAnnotations(Formatter.Annotation);\n            }\n\n            var usingDirectiveToAdd = SyntaxFactory.UsingDirective(\n                SyntaxFactory.QualifiedName(\n                    SyntaxFactory.IdentifierName(\"System\"),\n                    SyntaxFactory.IdentifierName(\"Linq\")));\n\n            var annotation = new SyntaxAnnotation(\"CollectionToChange\");\n            var newRoot = root.ReplaceNode(\n                collection,\n                collection.WithAdditionalAnnotations(annotation));\n\n            var node = newRoot.GetAnnotatedNodes(annotation).First();\n\n            var closestNamespaceWithUsing = node.AncestorsAndSelf()\n                .FirstOrDefault(x => BaseNamespaceDeclarationSyntaxWrapper.IsInstance(x)\n                                     && ((BaseNamespaceDeclarationSyntaxWrapper)x).Usings.Count > 0);\n\n            if (closestNamespaceWithUsing != null)\n            {\n                var namespaceDeclarationWrapper = (BaseNamespaceDeclarationSyntaxWrapper)closestNamespaceWithUsing;\n                var namespaceWithAdditionalUsing = namespaceDeclarationWrapper.WithUsings(namespaceDeclarationWrapper.Usings.Add(usingDirectiveToAdd));\n\n                newRoot = newRoot.ReplaceNode(\n                    namespaceDeclarationWrapper,\n                    namespaceWithAdditionalUsing.SyntaxNode.WithAdditionalAnnotations(Formatter.Annotation));\n            }\n            else\n            {\n                var compilationUnit = node.FirstAncestorOrSelf<CompilationUnitSyntax>();\n                newRoot = compilationUnit.AddUsings(usingDirectiveToAdd);\n            }\n\n            node = newRoot.GetAnnotatedNodes(annotation).First();\n            return newRoot\n                .ReplaceNode(node, invocationToAdd)\n                .WithAdditionalAnnotations(Formatter.Annotation);\n        }\n\n        private static InvocationExpressionSyntax GetOfTypeInvocation(string typeName, ExpressionSyntax collection)\n        {\n            return SyntaxFactory.InvocationExpression(\n                SyntaxFactory.MemberAccessExpression(\n                    SyntaxKind.SimpleMemberAccessExpression,\n                    collection,\n                    SyntaxFactory.GenericName(\n                        SyntaxFactory.Identifier(\"OfType\"),\n                        SyntaxFactory.TypeArgumentList(\n                            SyntaxFactory.SeparatedList<TypeSyntax>().Add(\n                                SyntaxFactory.IdentifierName(typeName))))));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/FrameworkTypeNaming.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class FrameworkTypeNaming : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S3376\";\n        private const string MessageFormat = \"Make this class name end with '{0}'.\";\n        private const int SelfAndBaseTypesCount = 2;\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var classDeclaration = (ClassDeclarationSyntax)c.Node;\n                    var symbol = c.Model.GetDeclaredSymbol(classDeclaration);\n                    if (symbol == null)\n                    {\n                        return;\n                    }\n\n                    var baseTypes = symbol.BaseType.GetSelfAndBaseTypes().ToList();\n                    if (baseTypes.Count < SelfAndBaseTypesCount || !baseTypes.Last().Is(KnownType.System_Object))\n                    {\n                        return;\n                    }\n\n                    var baseTypeKey = FrameworkTypesWithEnding.Keys\n                                                              .FirstOrDefault(ft => baseTypes[baseTypes.Count - SelfAndBaseTypesCount].ToDisplayString().Equals(ft, System.StringComparison.Ordinal));\n\n                    if (baseTypeKey == null)\n                    {\n                        return;\n                    }\n\n                    var baseTypeName = FrameworkTypesWithEnding[baseTypeKey];\n\n                    if (symbol.Name.EndsWith(baseTypeName, System.StringComparison.Ordinal)\n                        || !baseTypes[0].Name.EndsWith(baseTypeName, System.StringComparison.Ordinal))\n                    {\n                        return;\n                    }\n\n                    c.ReportIssue(Rule, classDeclaration.Identifier, baseTypeName);\n                },\n                SyntaxKind.ClassDeclaration);\n\n        private static readonly Dictionary<string, string> FrameworkTypesWithEnding = new Dictionary<string, string>\n        {\n            { \"System.Exception\", \"Exception\" },\n            { \"System.EventArgs\", \"EventArgs\" },\n            { \"System.Attribute\", \"Attribute\" }\n        };\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/FunctionComplexity.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Text;\nusing SonarAnalyzer.CSharp.Metrics;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public class FunctionComplexity : ParametrizedDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S1541\";\n        private const string MessageFormat = \"The Cyclomatic Complexity of this {2} is {1} which is greater than {0} authorized.\";\n        private const int DefaultValueMaximum = 10;\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat, isEnabledByDefault: false);\n\n        [RuleParameter(\"maximumFunctionComplexityThreshold\", PropertyType.Integer, \"The maximum authorized complexity.\", DefaultValueMaximum)]\n        public int Maximum { get; set; } = DefaultValueMaximum;\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarParametrizedAnalysisContext context)\n        {\n            context.RegisterNodeAction(c =>\n                {\n                    if (c.IsTopLevelMain)\n                    {\n                        CheckComplexity<CompilationUnitSyntax>(c, m => Location.Create(c.Node.SyntaxTree, TextSpan.FromBounds(0, 0)), \"top-level file\", true);\n                    }\n                },\n                SyntaxKind.CompilationUnit);\n\n            context.RegisterNodeAction(\n                c => CheckComplexity<MethodDeclarationSyntax>(c, m => m.Identifier.GetLocation(), \"method\"),\n                SyntaxKind.MethodDeclaration);\n\n            context.RegisterNodeAction(\n                c => CheckComplexity<PropertyDeclarationSyntax>(c, p => p.Identifier.GetLocation(), p => p.ExpressionBody, \"property\"),\n                SyntaxKind.PropertyDeclaration);\n\n            context.RegisterNodeAction(\n                c => CheckComplexity<OperatorDeclarationSyntax>(c, o => o.OperatorKeyword.GetLocation(), \"operator\"),\n                SyntaxKind.OperatorDeclaration);\n\n            context.RegisterNodeAction(\n                c => CheckComplexity<ConstructorDeclarationSyntax>(c, co => co.Identifier.GetLocation(), \"constructor\"),\n                SyntaxKind.ConstructorDeclaration);\n\n            context.RegisterNodeAction(\n                c => CheckComplexity<DestructorDeclarationSyntax>(c, d => d.Identifier.GetLocation(), \"destructor\"),\n                SyntaxKind.DestructorDeclaration);\n\n            context.RegisterNodeAction(c =>\n            {\n                if (((LocalFunctionStatementSyntaxWrapper)c.Node).Modifiers.Any(SyntaxKind.StaticKeyword))\n                {\n                    CheckComplexity<SyntaxNode>(c, d => ((LocalFunctionStatementSyntaxWrapper)d).Identifier.GetLocation(), \"static local function\");\n                }\n            },\n            SyntaxKindEx.LocalFunctionStatement);\n\n            context.RegisterNodeAction(\n                c => CheckComplexity<AccessorDeclarationSyntax>(c, a => a.Keyword.GetLocation(), \"accessor\"),\n                SyntaxKind.GetAccessorDeclaration,\n                SyntaxKind.SetAccessorDeclaration,\n                SyntaxKind.AddAccessorDeclaration,\n                SyntaxKind.RemoveAccessorDeclaration,\n                SyntaxKindEx.InitAccessorDeclaration);\n        }\n\n        private void CheckComplexity<TSyntax>(SonarSyntaxNodeReportingContext context, Func<TSyntax, Location> getLocation, string declarationType, bool onlyGlobalStatements = false)\n            where TSyntax : SyntaxNode =>\n            CheckComplexity(context, getLocation, n => n, declarationType, onlyGlobalStatements);\n\n        private void CheckComplexity<TSyntax>(\n            SonarSyntaxNodeReportingContext context,\n            Func<TSyntax, Location> getLocation,\n            Func<TSyntax, SyntaxNode> getNodeToCheck,\n            string declarationType,\n            bool onlyGlobalStatements = false)\n            where TSyntax : SyntaxNode\n        {\n            var node = (TSyntax)context.Node;\n\n            var nodeToCheck = getNodeToCheck(node);\n            if (nodeToCheck == null)\n            {\n                return;\n            }\n\n            var complexityMetric = CSharpCyclomaticComplexityMetric.GetComplexity(nodeToCheck, onlyGlobalStatements);\n            if (complexityMetric.Complexity > Maximum)\n            {\n                context.ReportIssue(Rule, getLocation(node), complexityMetric.Locations, Maximum.ToString(), complexityMetric.Complexity.ToString(), declarationType);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/FunctionNestingDepth.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public class FunctionNestingDepth : FunctionNestingDepthBase\n    {\n        protected override ILanguageFacade Language => CSharpFacade.Instance;\n\n        protected override void Initialize(SonarParametrizedAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n            {\n                var walker = new NestingDepthWalker(Maximum, token => c.ReportIssue(rule, token, Maximum.ToString()));\n                walker.SafeVisit(c.Node);\n            },\n            SyntaxKind.MethodDeclaration,\n            SyntaxKind.OperatorDeclaration,\n            SyntaxKind.ConstructorDeclaration,\n            SyntaxKind.DestructorDeclaration,\n            SyntaxKind.GetAccessorDeclaration,\n            SyntaxKind.SetAccessorDeclaration,\n            SyntaxKindEx.InitAccessorDeclaration,\n            SyntaxKind.AddAccessorDeclaration,\n            SyntaxKind.RemoveAccessorDeclaration,\n            SyntaxKind.GlobalStatement);\n\n        private sealed class NestingDepthWalker : SafeCSharpSyntaxWalker\n        {\n            private readonly NestingDepthCounter counter;\n\n            public NestingDepthWalker(int maximumNestingDepth, Action<SyntaxToken> actionMaximumExceeded) =>\n                counter = new NestingDepthCounter(maximumNestingDepth, actionMaximumExceeded);\n\n            public override void VisitIfStatement(IfStatementSyntax node)\n            {\n                var isPartOfChainedElseIfClause = node.Parent != null && node.Parent.IsKind(SyntaxKind.ElseClause);\n                if (isPartOfChainedElseIfClause)\n                {\n                    base.VisitIfStatement(node);\n                }\n                else\n                {\n                    counter.CheckNesting(node.IfKeyword, () => base.VisitIfStatement(node));\n                }\n            }\n\n            public override void VisitForStatement(ForStatementSyntax node) =>\n                counter.CheckNesting(node.ForKeyword, () => base.VisitForStatement(node));\n\n            public override void VisitForEachStatement(ForEachStatementSyntax node) =>\n                counter.CheckNesting(node.ForEachKeyword, () => base.VisitForEachStatement(node));\n\n            public override void VisitWhileStatement(WhileStatementSyntax node) =>\n                counter.CheckNesting(node.WhileKeyword, () => base.VisitWhileStatement(node));\n\n            public override void VisitDoStatement(DoStatementSyntax node) =>\n                counter.CheckNesting(node.DoKeyword, () => base.VisitDoStatement(node));\n\n            public override void VisitSwitchStatement(SwitchStatementSyntax node) =>\n                counter.CheckNesting(node.SwitchKeyword, () => base.VisitSwitchStatement(node));\n\n            public override void VisitTryStatement(TryStatementSyntax node) =>\n                counter.CheckNesting(node.TryKeyword, () => base.VisitTryStatement(node));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/GenericInheritanceShouldNotBeRecursive.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class GenericInheritanceShouldNotBeRecursive : GenericInheritanceShouldNotBeRecursiveBase<SyntaxKind, TypeDeclarationSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n        protected override SyntaxKind[] SyntaxKinds { get; } =\n        {\n            SyntaxKind.ClassDeclaration,\n            SyntaxKind.InterfaceDeclaration,\n            SyntaxKindEx.RecordDeclaration,\n        };\n\n        protected override SyntaxToken GetKeyword(TypeDeclarationSyntax declaration) =>\n            declaration.Keyword;\n\n        protected override Location GetLocation(TypeDeclarationSyntax declaration) =>\n            declaration.Identifier.GetLocation();\n\n        protected override INamedTypeSymbol GetNamedTypeSymbol(TypeDeclarationSyntax declaration, SemanticModel semanticModel) =>\n            semanticModel.GetDeclaredSymbol(declaration);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/GenericLoggerInjectionShouldMatchEnclosingType.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class GenericLoggerInjectionShouldMatchEnclosingType : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S6672\";\n    private const string MessageFormat = \"Update this logger to use its enclosing type.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(cc =>\n        {\n            if (cc.Compilation.References(KnownAssembly.MicrosoftExtensionsLoggingAbstractions))\n            {\n                cc.RegisterNodeAction(c =>\n                {\n                    var constructor = (ConstructorDeclarationSyntax)c.Node;\n                    foreach (var invalidType in InvalidTypeParameters(constructor, c.Model))\n                    {\n                        c.ReportIssue(Rule, invalidType);\n                    }\n                },\n                SyntaxKind.ConstructorDeclaration);\n            }\n        });\n\n    // Returns T for [Constructor(ILogger<T> logger)] where T is not Constructor\n    private static IEnumerable<TypeSyntax> InvalidTypeParameters(ConstructorDeclarationSyntax constructor, SemanticModel model)\n    {\n        var genericParameters = constructor.ParameterList.Parameters\n            .Where(x => x.Type is GenericNameSyntax generic\n                        && generic.TypeArgumentList.Arguments.Count == 1)\n            .Select(x => (GenericNameSyntax)x.Type)\n            .ToArray();\n\n        if (genericParameters.Length == 0)\n        {\n            yield break;\n        }\n\n        var constructorType = model.GetDeclaredSymbol(constructor)?.ContainingType;\n        foreach (var generic in genericParameters)\n        {\n            var genericArgument = generic.TypeArgumentList.Arguments[0];\n            if (IsGenericLogger(model.GetTypeInfo(generic).Type)                             // ILogger<T>\n                && !model.GetTypeInfo(genericArgument).Type.Equals(constructorType))         // T\n            {\n                yield return genericArgument;\n            }\n        }\n    }\n\n    private static bool IsGenericLogger(ITypeSymbol type) =>\n        type.Is(KnownType.Microsoft_Extensions_Logging_ILogger_TCategoryName)\n        || type.Implements(KnownType.Microsoft_Extensions_Logging_ILogger_TCategoryName);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/GenericReadonlyFieldPropertyAssignment.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class GenericReadonlyFieldPropertyAssignment : SonarDiagnosticAnalyzer\n{\n    internal const string DiagnosticId = \"S2934\";\n    private const string MessageFormat = \"Restrict '{0}' to be a reference type or remove this assignment of '{1}'; it is useless if '{0}' is a value type.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(c =>\n            {\n                var assignment = (AssignmentExpressionSyntax)c.Node;\n                var expression = assignment.Left;\n\n                ProcessPropertyChange(c, c.Model, expression);\n            },\n            SyntaxKind.SimpleAssignmentExpression,\n            SyntaxKind.AddAssignmentExpression,\n            SyntaxKind.SubtractAssignmentExpression,\n            SyntaxKind.MultiplyAssignmentExpression,\n            SyntaxKind.DivideAssignmentExpression,\n            SyntaxKind.ModuloAssignmentExpression,\n            SyntaxKind.AndAssignmentExpression,\n            SyntaxKind.ExclusiveOrAssignmentExpression,\n            SyntaxKind.OrAssignmentExpression,\n            SyntaxKind.LeftShiftAssignmentExpression,\n            SyntaxKind.RightShiftAssignmentExpression,\n            SyntaxKindEx.CoalesceAssignmentExpression,\n            SyntaxKindEx.UnsignedRightShiftAssignmentExpression);\n\n        context.RegisterNodeAction(c =>\n            {\n                var unary = (PrefixUnaryExpressionSyntax)c.Node;\n                ProcessPropertyChange(c, c.Model, unary.Operand);\n            },\n            SyntaxKind.PreDecrementExpression,\n            SyntaxKind.PreIncrementExpression);\n\n        context.RegisterNodeAction(c =>\n            {\n                var unary = (PostfixUnaryExpressionSyntax)c.Node;\n                ProcessPropertyChange(c, c.Model, unary.Operand);\n            },\n            SyntaxKind.PostDecrementExpression,\n            SyntaxKind.PostIncrementExpression);\n    }\n\n    private static void ProcessPropertyChange(SonarSyntaxNodeReportingContext context, SemanticModel semanticModel, ExpressionSyntax expression)\n    {\n        if (TupleExpressionSyntaxWrapper.IsInstance(expression))\n        {\n            foreach (var tupleArgument in ((TupleExpressionSyntaxWrapper)expression).Arguments)\n            {\n                ProcessPropertyChange(context, semanticModel, tupleArgument.Expression);\n            }\n        }\n        else if (SymbolFromMemberAccess(expression) is IFieldSymbol fieldSymbol\n            && IsFieldReadonlyAndPossiblyValueType(fieldSymbol)\n            && !IsInsideConstructorDeclaration(expression, fieldSymbol.ContainingType, semanticModel)\n            && semanticModel.GetSymbolInfo(expression).Symbol is IPropertySymbol propertySymbol)\n        {\n            context.ReportIssue(Rule, expression, fieldSymbol.Name, propertySymbol.Name);\n        }\n\n        ISymbol SymbolFromMemberAccess(ExpressionSyntax expression)\n        {\n            var targetExpression = expression switch\n            {\n                MemberAccessExpressionSyntax memberAccess => memberAccess.Expression,\n                MemberBindingExpressionSyntax memberBinding when memberBinding.Parent?.Parent is ConditionalAccessExpressionSyntax conditionalAccess =>\n                    conditionalAccess.Expression,\n                _ => null\n            };\n            return targetExpression is null ? null : semanticModel.GetSymbolInfo(targetExpression).Symbol;\n        }\n    }\n\n    private static bool IsFieldReadonlyAndPossiblyValueType(IFieldSymbol fieldSymbol) =>\n        fieldSymbol is { IsReadOnly: true }\n        && GenericParameterMightBeValueType(fieldSymbol.Type as ITypeParameterSymbol);\n\n    private static bool IsInsideConstructorDeclaration(ExpressionSyntax expression, INamedTypeSymbol currentType, SemanticModel semanticModel) =>\n        semanticModel.GetEnclosingSymbol(expression.SpanStart) is IMethodSymbol { MethodKind: MethodKind.Constructor } constructorSymbol\n        && constructorSymbol.ContainingType.Equals(currentType);\n\n    private static bool GenericParameterMightBeValueType(ITypeParameterSymbol typeParameterSymbol) =>\n        typeParameterSymbol is\n        {\n            HasReferenceTypeConstraint: false,\n            HasValueTypeConstraint: false, // CS1648 is raised, if constrained by 'struct'.\n            ConstraintTypes: { } constraintTypes\n        }\n        && constraintTypes.All(MightBeValueType);\n\n    private static bool MightBeValueType(ITypeSymbol type) =>\n        type.IsInterface()\n        || GenericParameterMightBeValueType(type as ITypeParameterSymbol);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/GenericReadonlyFieldPropertyAssignmentCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Formatting;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[ExportCodeFixProvider(LanguageNames.CSharp)]\npublic sealed class GenericReadonlyFieldPropertyAssignmentCodeFix : SonarCodeFix\n{\n    internal const string TitleRemove = \"Remove assignment\";\n    internal const string TitleAddClassConstraint = \"Add reference type constraint\";\n    private static readonly SyntaxAnnotation Annotation = new(nameof(GenericReadonlyFieldPropertyAssignmentCodeFix));\n\n    public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(GenericReadonlyFieldPropertyAssignment.DiagnosticId);\n\n    protected override async Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n    {\n        var diagnostic = context.Diagnostics.First();\n        var diagnosticSpan = diagnostic.Location.SourceSpan;\n        var node = root.FindNode(diagnosticSpan, getInnermostNodeForTie: true);\n        var memberExpression = node switch\n        {\n            MemberAccessExpressionSyntax memberAccess => memberAccess.Expression,\n            MemberBindingExpressionSyntax { Parent.Parent: ConditionalAccessExpressionSyntax conditionalAccess } => conditionalAccess.Expression,\n            _ => null\n        };\n        if (memberExpression is null)\n        {\n            return;\n        }\n\n        var model = await context.Document.GetSemanticModelAsync(context.Cancel).ConfigureAwait(false);\n        var fieldSymbol = (IFieldSymbol)model.GetSymbolInfo(memberExpression).Symbol;\n        var typeParameterSymbol = (ITypeParameterSymbol)fieldSymbol.Type;\n        var genericType = typeParameterSymbol.ContainingType;\n\n        var classDeclarationTasks = genericType.DeclaringSyntaxReferences\n            .Select(x => x.GetSyntaxAsync(context.Cancel))\n            .ToList();\n\n        var taskResults = await Task.WhenAll(classDeclarationTasks).ConfigureAwait(false);\n\n        var classDeclarations = taskResults.OfType<ClassDeclarationSyntax>().ToList();\n\n        if (classDeclarations.Any())\n        {\n            context.RegisterCodeFix(\n                TitleAddClassConstraint,\n                async x =>\n                {\n                    var currentSolution = context.Document.Project.Solution;\n                    var mapping = DocumentIdClassDeclarationMapping(classDeclarations, currentSolution);\n\n                    foreach (var classes in mapping)\n                    {\n                        var document = currentSolution.GetDocument(classes.Key);\n                        var docRoot = await document.GetSyntaxRootAsync(context.Cancel).ConfigureAwait(false);\n                        var newDocRoot = NewDocumentRoot(docRoot, typeParameterSymbol, classes);\n                        currentSolution = currentSolution.WithDocumentSyntaxRoot(classes.Key, newDocRoot);\n                    }\n\n                    return currentSolution;\n                },\n                context.Diagnostics);\n        }\n\n        if (node is { Parent: ExpressionSyntax { Parent: StatementSyntax statement } })\n        {\n            context.RegisterCodeFix(\n                TitleRemove,\n                x =>\n                {\n                    var newRoot = root.RemoveNode(statement, SyntaxRemoveOptions.KeepNoTrivia);\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n        }\n    }\n\n    private static MultiValueDictionary<DocumentId, ClassDeclarationSyntax> DocumentIdClassDeclarationMapping(IEnumerable<ClassDeclarationSyntax> classDeclarations, Solution currentSolution)\n    {\n        var mapping = new MultiValueDictionary<DocumentId, ClassDeclarationSyntax>();\n        foreach (var classDeclaration in classDeclarations)\n        {\n            var documentId = currentSolution.GetDocument(classDeclaration.SyntaxTree).Id;\n            mapping.AddWithKey(documentId, classDeclaration);\n        }\n\n        return mapping;\n    }\n\n    private static SyntaxNode NewDocumentRoot(SyntaxNode docRoot, ITypeParameterSymbol typeParameterSymbol, KeyValuePair<DocumentId, ICollection<ClassDeclarationSyntax>> classes)\n    {\n        var newDocRoot = docRoot.ReplaceNodes(classes.Value, (_, rewritten) => rewritten.WithAdditionalAnnotations(Annotation));\n        var annotatedNodes = newDocRoot.GetAnnotatedNodes(Annotation).ToList();\n        while (annotatedNodes.Any())\n        {\n            var classDeclaration = (ClassDeclarationSyntax)annotatedNodes[0];\n            var constraintClauses = NewConstraintClause(classDeclaration.ConstraintClauses, typeParameterSymbol.Name);\n            newDocRoot = newDocRoot.ReplaceNode(classDeclaration, classDeclaration.WithConstraintClauses(constraintClauses).WithoutAnnotations(Annotation));\n            annotatedNodes = newDocRoot.GetAnnotatedNodes(Annotation).ToList();\n        }\n\n        return newDocRoot;\n    }\n\n    private static SyntaxList<TypeParameterConstraintClauseSyntax> NewConstraintClause(SyntaxList<TypeParameterConstraintClauseSyntax> constraintClauses, string typeParameterName)\n    {\n        var constraintList = SyntaxFactory.List<TypeParameterConstraintClauseSyntax>();\n        foreach (var constraint in constraintClauses)\n        {\n            var currentConstraint = constraint;\n            if (currentConstraint.Name.Identifier.ValueText == typeParameterName && !currentConstraint.Constraints.AnyOfKind(SyntaxKind.ClassConstraint))\n            {\n                currentConstraint = currentConstraint\n                    .WithConstraints(currentConstraint.Constraints.Insert(0, SyntaxFactory.ClassOrStructConstraint(SyntaxKind.ClassConstraint)))\n                    .WithAdditionalAnnotations(Formatter.Annotation);\n            }\n            constraintList = constraintList.Add(currentConstraint);\n        }\n        return constraintList;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/GenericTypeParameterEmptinessChecking.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class GenericTypeParameterEmptinessChecking : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S2955\";\n        private const string MessageFormat = \"Use a comparison to 'default({0})' instead or add a constraint to '{0}' so that it can't be a value type.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var equalsExpression = (BinaryExpressionSyntax)c.Node;\n\n                    var leftIsNull = CSharpEquivalenceChecker.AreEquivalent(equalsExpression.Left, SyntaxConstants.NullLiteralExpression);\n                    var rightIsNull = CSharpEquivalenceChecker.AreEquivalent(equalsExpression.Right, SyntaxConstants.NullLiteralExpression);\n\n                    if (!(leftIsNull ^ rightIsNull))\n                    {\n                        return;\n                    }\n\n                    var expressionToTypeCheck = leftIsNull ? equalsExpression.Right : equalsExpression.Left;\n                    if (c.Model.GetTypeInfo(expressionToTypeCheck).Type is ITypeParameterSymbol { HasReferenceTypeConstraint: false } typeInfo\n                        && !typeInfo.ConstraintTypes.OfType<IErrorTypeSymbol>().Any()\n                        && !typeInfo.ConstraintTypes.Any(typeSymbol => typeSymbol.IsReferenceType && typeSymbol.IsClass()))\n                    {\n                        var expressionToReportOn = leftIsNull ? equalsExpression.Left : equalsExpression.Right;\n\n                        c.ReportIssue(Rule, expressionToReportOn, typeInfo.Name);\n                    }\n                },\n                SyntaxKind.EqualsExpression,\n                SyntaxKind.NotEqualsExpression);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/GenericTypeParameterEmptinessCheckingCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class GenericTypeParameterEmptinessCheckingCodeFix : SonarCodeFix\n    {\n        internal const string Title = \"Change null checking\";\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(GenericTypeParameterEmptinessChecking.DiagnosticId);\n\n        protected override async Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            var syntaxNode = root.FindNode(diagnosticSpan);\n            var binary = (BinaryExpressionSyntax)syntaxNode.Parent;\n            var otherNode = binary.Left == syntaxNode\n                ? binary.Right\n                : binary.Left;\n\n            var semanticModel = await context.Document.GetSemanticModelAsync(context.Cancel).ConfigureAwait(false);\n            var typeSymbol = (ITypeParameterSymbol)semanticModel.GetTypeInfo(otherNode).Type;\n            var defaultExpression = SyntaxFactory.DefaultExpression(SyntaxFactory.ParseTypeName(typeSymbol.Name));\n\n            ExpressionSyntax newNode = SyntaxFactory.InvocationExpression(\n                SyntaxFactory.MemberAccessExpression(\n                    SyntaxKind.SimpleMemberAccessExpression,\n                    SyntaxFactory.PredefinedType(SyntaxFactory.Token(SyntaxKind.ObjectKeyword)),\n                    SyntaxFactory.IdentifierName(\"Equals\")),\n                SyntaxFactory.ArgumentList(\n                    SyntaxFactory.SeparatedList(new[]\n                    {\n                        SyntaxFactory.Argument(otherNode),\n                        SyntaxFactory.Argument(defaultExpression)\n                    })));\n\n            if (binary.IsKind(SyntaxKind.NotEqualsExpression))\n            {\n                newNode = SyntaxFactory.PrefixUnaryExpression(SyntaxKind.LogicalNotExpression, newNode);\n            }\n\n            context.RegisterCodeFix(\n                Title,\n                c =>\n                {\n                    var newRoot = root.ReplaceNode(binary, newNode.WithTriviaFrom(binary));\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/GenericTypeParameterInOut.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class GenericTypeParameterInOut : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S3246\";\n        private const string MessageFormat = \"Add the '{0}' keyword to parameter '{1}' to make it '{2}'.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(c => CheckInterfaceVariance(c, (InterfaceDeclarationSyntax)c.Node), SyntaxKind.InterfaceDeclaration);\n            context.RegisterNodeAction(c => CheckDelegateVariance(c, (DelegateDeclarationSyntax)c.Node), SyntaxKind.DelegateDeclaration);\n        }\n\n        #region Top level\n\n        private static void CheckInterfaceVariance(SonarSyntaxNodeReportingContext context, InterfaceDeclarationSyntax declaration)\n        {\n            var interfaceType = context.Model.GetDeclaredSymbol(declaration);\n            if (interfaceType == null)\n            {\n                return;\n            }\n\n            foreach (var typeParameter in interfaceType.TypeParameters\n                .Where(typeParameter => typeParameter.Variance == VarianceKind.None))\n            {\n                var canBeIn = CheckTypeParameter(typeParameter, VarianceKind.In, interfaceType);\n                var canBeOut = CheckTypeParameter(typeParameter, VarianceKind.Out, interfaceType);\n\n                if (canBeIn ^ canBeOut)\n                {\n                    ReportIssue(context, typeParameter, canBeIn ? VarianceKind.In : VarianceKind.Out);\n                }\n            }\n        }\n        private static void CheckDelegateVariance(SonarSyntaxNodeReportingContext context, DelegateDeclarationSyntax declaration)\n        {\n            var declaredSymbol = context.Model.GetDeclaredSymbol(declaration);\n            if (declaredSymbol == null)\n            {\n                return;\n            }\n\n            var returnType = context.Model.GetTypeInfo(declaration.ReturnType).Type;\n            if (returnType == null)\n            {\n                return;\n            }\n\n            var parameterSymbols = declaration.ParameterList == null\n                ? ImmutableArray<IParameterSymbol>.Empty\n                : declaration.ParameterList.Parameters\n                    .Select(p => context.Model.GetDeclaredSymbol(p))\n                    .ToImmutableArray();\n            if (parameterSymbols.Any(parameter => parameter == null))\n            {\n                return;\n            }\n\n            foreach (var typeParameter in declaredSymbol.TypeParameters\n                .Where(typeParameter => typeParameter.Variance == VarianceKind.None))\n            {\n                var canBeIn = CheckTypeParameter(typeParameter, VarianceKind.In, returnType, parameterSymbols);\n                var canBeOut = CheckTypeParameter(typeParameter, VarianceKind.Out, returnType, parameterSymbols);\n\n                if (canBeIn ^ canBeOut)\n                {\n                    ReportIssue(context, typeParameter, canBeIn ? VarianceKind.In : VarianceKind.Out);\n                }\n            }\n        }\n\n        #endregion\n\n        #region Top level per type parameter\n\n        private static bool CheckTypeParameter(ITypeParameterSymbol typeParameter,\n                                               VarianceKind variance,\n                                               ITypeSymbol returnType,\n                                               ImmutableArray<IParameterSymbol> parameters)\n        {\n            var canBe = CheckTypeParameterConstraintsInSymbol(typeParameter, variance);\n            if (!canBe)\n            {\n                return false;\n            }\n\n            canBe = CanTypeParameterBeVariant(typeParameter, variance, returnType,\n                true, false);\n\n            if (!canBe)\n            {\n                return false;\n            }\n\n            canBe = CheckTypeParameterInParameters(typeParameter, variance, parameters);\n            return canBe;\n        }\n\n        private static bool CheckTypeParameter(ITypeParameterSymbol typeParameter, VarianceKind variance, ITypeSymbol interfaceType)\n        {\n            if (typeParameter.Variance != VarianceKind.None)\n            {\n                return false;\n            }\n\n            foreach (var baseInterface in interfaceType.AllInterfaces)\n            {\n                var canBeVariant = CanTypeParameterBeVariant(\n                    typeParameter, variance,\n                    baseInterface,\n                    true,\n                    false);\n\n                if (!canBeVariant)\n                {\n                    return false;\n                }\n            }\n\n            foreach (var member in interfaceType.GetMembers())\n            {\n                bool canBeVariant;\n\n                if (member.Kind == SymbolKind.Method)\n                {\n                    canBeVariant = CheckTypeParameterInMethod(typeParameter, variance, (IMethodSymbol)member);\n                    if (!canBeVariant)\n                    {\n                        return false;\n                    }\n                }\n                else if (member.Kind == SymbolKind.Event)\n                {\n                    canBeVariant = CheckTypeParameterInEvent(typeParameter, variance, (IEventSymbol)member);\n                    if (!canBeVariant)\n                    {\n                        return false;\n                    }\n                }\n            }\n\n            return true;\n        }\n\n        #endregion\n\n        private static void ReportIssue(SonarSyntaxNodeReportingContext context, ITypeParameterSymbol typeParameter, VarianceKind variance)\n        {\n            if (!typeParameter.DeclaringSyntaxReferences.Any())\n            {\n                return;\n            }\n\n            var location = typeParameter.DeclaringSyntaxReferences.First().GetSyntax().GetLocation();\n\n            if (variance == VarianceKind.In)\n            {\n                context.ReportIssue(Rule, location, \"in\", typeParameter.Name, \"contravariant\");\n                return;\n            }\n\n            if (variance == VarianceKind.Out)\n            {\n                context.ReportIssue(Rule, location, \"out\", typeParameter.Name, \"covariant\");\n            }\n        }\n\n        #region Check type parameters method/event/parameters\n\n        private static bool CheckTypeParameterInMethod(ITypeParameterSymbol typeParameter, VarianceKind variance, IMethodSymbol method)\n        {\n            var canBe = CheckTypeParameterConstraintsInSymbol(typeParameter, variance);\n            if (!canBe)\n            {\n                return false;\n            }\n\n\n            canBe = CanTypeParameterBeVariant(\n                typeParameter, variance,\n                method.ReturnType,\n                true,\n                false);\n\n            if (!canBe)\n            {\n                return false;\n            }\n\n            return CheckTypeParameterInParameters(typeParameter, variance, method.Parameters);\n        }\n\n        private static bool CheckTypeParameterInEvent(ITypeParameterSymbol typeParameter, VarianceKind variance, IEventSymbol @event) =>\n            CanTypeParameterBeVariant(typeParameter, variance, @event.Type, false, true);\n\n        private static bool CheckTypeParameterInParameters(ITypeParameterSymbol typeParameter, VarianceKind variance, ImmutableArray<IParameterSymbol> parameters)\n        {\n            foreach (var param in parameters)\n            {\n                var canBe = CanTypeParameterBeVariant(typeParameter, variance, param.Type, param.RefKind != RefKind.None, true);\n                if (!canBe)\n                {\n                    return false;\n                }\n            }\n            return true;\n        }\n\n        private static bool CheckTypeParameterConstraintsInSymbol(ITypeParameterSymbol typeParameter, VarianceKind variance)\n        {\n            foreach (var constraintType in typeParameter.ConstraintTypes)\n            {\n                var canBe = CanTypeParameterBeVariant(typeParameter, variance, constraintType, false, true);\n                if (!canBe)\n                {\n                    return false;\n                }\n            }\n            return true;\n        }\n\n        #endregion\n\n        #region Check type parameter variance low level\n\n        private static bool CanTypeParameterBeVariant(ITypeParameterSymbol parameter,\n                                                      VarianceKind variance,\n                                                      ITypeSymbol type,\n                                                      bool requireOutputSafety,\n                                                      bool requireInputSafety)\n        {\n            switch (type.Kind)\n            {\n                case SymbolKind.TypeParameter:\n                    var typeParam = (ITypeParameterSymbol)type;\n                    if (!typeParam.Equals(parameter))\n                    {\n                        return true;\n                    }\n\n                    return !((requireInputSafety && requireOutputSafety && variance != VarianceKind.None) ||\n                        (requireOutputSafety && variance == VarianceKind.In) ||\n                        (requireInputSafety && variance == VarianceKind.Out));\n                case SymbolKind.ArrayType:\n                    return CanTypeParameterBeVariant(parameter, variance, ((IArrayTypeSymbol)type).ElementType, requireOutputSafety, requireInputSafety);\n                case SymbolKind.ErrorType:\n                case SymbolKind.NamedType:\n                    return CanTypeParameterBeVariant(parameter, variance, (INamedTypeSymbol)type, requireOutputSafety, requireInputSafety);\n                default:\n                    return true;\n            }\n        }\n\n        private static bool CanTypeParameterBeVariant(ITypeParameterSymbol parameter,\n                                                      VarianceKind variance,\n                                                      INamedTypeSymbol namedType,\n                                                      bool requireOutputSafety,\n                                                      bool requireInputSafety)\n        {\n            switch (namedType.TypeKind)\n            {\n                case TypeKind.Class:\n                case TypeKind.Struct:\n                case TypeKind.Enum:\n                case TypeKind.Interface:\n                case TypeKind.Delegate:\n                case TypeKind.Error:\n                    break;\n                default:\n                    return true;\n            }\n\n            if (namedType.IsTupleType())\n            {\n                return false;\n            }\n\n            var currentNamedType = namedType;\n            while (currentNamedType != null)\n            {\n                for (var i = 0; i < currentNamedType.Arity; i++)\n                {\n                    var typeParam = currentNamedType.TypeParameters[i];\n                    var typeArg = currentNamedType.TypeArguments[i];\n\n                    if (!typeArg.Equals(parameter))\n                    {\n                        return false;\n                    }\n\n                    bool requireOut;\n                    bool requireIn;\n\n                    switch (typeParam.Variance)\n                    {\n                        case VarianceKind.Out:\n                            requireOut = requireOutputSafety;\n                            requireIn = requireInputSafety;\n                            break;\n                        case VarianceKind.In:\n                            requireOut = requireInputSafety;\n                            requireIn = requireOutputSafety;\n                            break;\n                        case VarianceKind.None:\n                            requireIn = true;\n                            requireOut = true;\n                            break;\n                        default:\n                            throw new NotSupportedException();\n                    }\n\n                    if (!CanTypeParameterBeVariant(parameter, variance, typeArg, requireOut, requireIn))\n                    {\n                        return false;\n                    }\n                }\n\n                currentNamedType = currentNamedType.ContainingType;\n            }\n\n            return true;\n        }\n\n        #endregion\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/GenericTypeParameterUnused.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class GenericTypeParameterUnused : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S2326\";\n        private const string MessageFormat = \"'{0}' is not used in the {1}.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        private static readonly SyntaxKind[] MethodModifiersToSkip =\n        {\n            SyntaxKind.AbstractKeyword,\n            SyntaxKind.VirtualKeyword,\n            SyntaxKind.OverrideKeyword\n        };\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(c =>\n                {\n                    if (c.Model.GetDeclaredSymbol(c.Node) is { } declarationSymbol)\n                    {\n                        CheckGenericTypeParameters(c, declarationSymbol);\n                    }\n                },\n                SyntaxKind.MethodDeclaration,\n                SyntaxKindEx.LocalFunctionStatement);\n\n            context.RegisterNodeAction(c =>\n                 {\n                     if (!c.IsRedundantPositionalRecordContext())\n                     {\n                         CheckGenericTypeParameters(c, c.ContainingSymbol);\n                     }\n                 },\n                 SyntaxKind.ClassDeclaration,\n                 SyntaxKind.InterfaceDeclaration,\n                 SyntaxKindEx.RecordDeclaration,\n                 SyntaxKindEx.RecordStructDeclaration,\n                 SyntaxKind.StructDeclaration);\n        }\n\n        private static void CheckGenericTypeParameters(SonarSyntaxNodeReportingContext c, ISymbol symbol)\n        {\n            var info = CreateParametersInfo(c);\n            if (info?.Parameters is null || info.Parameters.Parameters.Count == 0)\n            {\n                return;\n            }\n            var typeParameterNames = info.Parameters.Parameters.Select(x => x.Identifier.Text).ToArray();\n            var usedTypeParameters = GetUsedTypeParameters(c, symbol.DeclaringSyntaxReferences.Select(x => x.GetSyntax()), typeParameterNames).ToHashSet();\n            foreach (var typeParameter in typeParameterNames.Where(x => !usedTypeParameters.Contains(x)))\n            {\n                c.ReportIssue(Rule, info.Parameters.Parameters.First(x => x.Identifier.Text == typeParameter), typeParameter, info.ContainerName);\n            }\n        }\n\n        private static ParametersInfo CreateParametersInfo(SonarSyntaxNodeReportingContext c) =>\n            c.Node switch\n            {\n                InterfaceDeclarationSyntax interfaceDeclaration => new ParametersInfo(interfaceDeclaration.TypeParameterList, \"interface\"),\n                ClassDeclarationSyntax classDeclaration => new ParametersInfo(classDeclaration.TypeParameterList, \"class\"),\n                StructDeclarationSyntax structDeclaration => new ParametersInfo(structDeclaration.TypeParameterList, \"struct\"),\n                MethodDeclarationSyntax methodDeclaration when IsMethodCandidate(methodDeclaration, c.Model) => new ParametersInfo(methodDeclaration.TypeParameterList, \"method\"),\n                var wrapper when LocalFunctionStatementSyntaxWrapper.IsInstance(wrapper) => new ParametersInfo(((LocalFunctionStatementSyntaxWrapper)c.Node).TypeParameterList, \"local function\"),\n                var wrapper when RecordDeclarationSyntaxWrapper.IsInstance(wrapper) => new ParametersInfo(((RecordDeclarationSyntaxWrapper)c.Node).TypeParameterList, \"record\"),\n                _ => null\n            };\n\n        private static bool IsMethodCandidate(MethodDeclarationSyntax methodDeclaration, SemanticModel semanticModel) =>\n            !methodDeclaration.Modifiers.Any(x => MethodModifiersToSkip.Contains(x.Kind()))\n            && methodDeclaration.ExplicitInterfaceSpecifier is null\n            && methodDeclaration.HasBodyOrExpressionBody()\n            && semanticModel.GetDeclaredSymbol(methodDeclaration) is { } methodSymbol\n            && methodSymbol.IsChangeable();\n\n        private static List<string> GetUsedTypeParameters(SonarSyntaxNodeReportingContext context, IEnumerable<SyntaxNode> declarations, string[] typeParameterNames) =>\n            declarations.SelectMany(x => x.DescendantNodes())\n                .OfType<IdentifierNameSyntax>()\n                .Where(x => x.Parent is not TypeParameterConstraintClauseSyntax && typeParameterNames.Contains(x.Identifier.ValueText))\n                .Select(x => x.EnsureCorrectSemanticModelOrDefault(context.Model)?.GetSymbolInfo(x).Symbol)\n                .Where(x => x is { Kind: SymbolKind.TypeParameter })\n                .Select(x => x.Name)\n                .ToList();\n\n        private sealed record ParametersInfo(TypeParameterListSyntax Parameters, string ContainerName);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/GenericTypeParametersRequired.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class GenericTypeParametersRequired : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S4018\";\n        private const string MessageFormat = \"Refactor this method to use all type parameters in the parameter list to enable type inference.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n                {\n                    var methodDeclaration = (MethodDeclarationSyntax)c.Node;\n\n                    var typeParameters = methodDeclaration\n                            .TypeParameterList\n                            ?.Parameters\n                            .Select(p => c.Model.GetDeclaredSymbol(p));\n\n                    if (typeParameters == null)\n                    {\n                        return;\n                    }\n\n                    var argumentTypes = methodDeclaration\n                            .ParameterList\n                            .Parameters\n                            .Select(p => c.Model.GetDeclaredSymbol(p)?.Type);\n\n                    var typeParametersInArguments = new HashSet<ITypeParameterSymbol>();\n                    foreach (var argumentType in argumentTypes)\n                    {\n                        AddTypeParameters(argumentType, typeParametersInArguments);\n                    }\n\n                    if (typeParameters.Except(typeParametersInArguments).Any())\n                    {\n                        c.ReportIssue(Rule, methodDeclaration.Identifier);\n                    }\n                },\n                SyntaxKind.MethodDeclaration);\n\n        private static void AddTypeParameters(ITypeSymbol argumentSymbol, ISet<ITypeParameterSymbol> set)\n        {\n            var localArgumentSymbol = argumentSymbol;\n\n            if (localArgumentSymbol is IArrayTypeSymbol arrayTypeSymbol)\n            {\n                localArgumentSymbol = arrayTypeSymbol.ElementType;\n            }\n\n            if (localArgumentSymbol.Is(TypeKind.TypeParameter))\n            {\n                set.Add(localArgumentSymbol as ITypeParameterSymbol);\n            }\n\n            if (localArgumentSymbol is INamedTypeSymbol namedSymbol)\n            {\n                foreach (var typeParam in namedSymbol.TypeArguments)\n                {\n                    AddTypeParameters(typeParam, set);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/GetHashCodeEqualsOverride.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class GetHashCodeEqualsOverride : SonarDiagnosticAnalyzer\n    {\n        internal const string EqualsName = \"Equals\";\n\n        private const string DiagnosticId = \"S3249\";\n        private const string MessageFormat = \"Remove this 'base' call to 'object.{0}', which is directly based on the object reference.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        private static readonly ISet<string> MethodNames = new HashSet<string> { \"GetHashCode\", EqualsName };\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterCodeBlockStartAction(\n                cb =>\n                {\n                    if (!(cb.CodeBlock is MethodDeclarationSyntax methodDeclaration))\n                    {\n                        return;\n                    }\n\n                    if (methodDeclaration.AttributeLists.Any()\n                        || !(cb.OwningSymbol is IMethodSymbol methodSymbol)\n                        || !MethodIsRelevant(methodSymbol, MethodNames)\n                        // this rule should not apply for records since Equals and GetHashCode are value-based\n                        || RecordDeclarationSyntaxWrapper.IsInstance(methodDeclaration.Ancestors().FirstOrDefault(node => node is TypeDeclarationSyntax)))\n                    {\n                        return;\n                    }\n\n                    var locations = new List<Location>();\n\n                    cb.RegisterNodeAction(\n                        c =>\n                        {\n                            if (TryGetLocationFromInvocationInsideMethod(c, methodSymbol, out var location))\n                            {\n                                locations.Add(location);\n                            }\n                        },\n                        SyntaxKind.InvocationExpression);\n\n                    cb.RegisterCodeBlockEndAction(\n                        c =>\n                        {\n                            if (!locations.Any())\n                            {\n                                return;\n                            }\n\n                            var firstPosition = locations.Select(loc => loc.SourceSpan.Start).Min();\n                            var location = locations.First(loc => loc.SourceSpan.Start == firstPosition);\n                            c.ReportIssue(Rule, location, methodSymbol.Name);\n                        });\n                });\n\n        internal static bool IsEqualsCallInGuardCondition(InvocationExpressionSyntax invocation, IMethodSymbol invokedMethod) =>\n            invokedMethod.Name == EqualsName\n            && invocation.Parent is IfStatementSyntax ifStatement\n            && ifStatement.Condition == invocation\n            && IfStatementWithSingleReturnTrue(ifStatement);\n\n        internal static bool MethodIsRelevant(ISymbol symbol, ISet<string> methodNames) =>\n            methodNames.Contains(symbol.Name) && symbol.IsOverride;\n\n        private static bool TryGetLocationFromInvocationInsideMethod(SonarSyntaxNodeReportingContext context, ISymbol symbol, out Location location)\n        {\n            location = null;\n            var invocation = (InvocationExpressionSyntax)context.Node;\n            if (!(context.Model.GetSymbolInfo(invocation).Symbol is IMethodSymbol invokedMethod)\n                || invokedMethod.Name != symbol.Name\n                || !invocation.IsOnBase())\n            {\n                return false;\n            }\n\n            if (invokedMethod.IsInType(KnownType.System_Object)\n                && !IsEqualsCallInGuardCondition(invocation, invokedMethod))\n            {\n                location = invocation.GetLocation();\n                return true;\n            }\n\n            return false;\n        }\n\n        private static bool IfStatementWithSingleReturnTrue(IfStatementSyntax ifStatement)\n        {\n            var statement = ifStatement.Statement;\n            var returnStatement = statement as ReturnStatementSyntax;\n            if (statement is BlockSyntax block)\n            {\n                if (!block.Statements.Any())\n                {\n                    return false;\n                }\n\n                returnStatement = block.Statements.First() as ReturnStatementSyntax;\n            }\n\n            return returnStatement?.Expression != null\n                   && CSharpEquivalenceChecker.AreEquivalent(returnStatement.Expression, SyntaxConstants.TrueLiteralExpression);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/GetHashCodeMutable.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class GetHashCodeMutable : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S2328\";\n        private const string IssueMessage = \"Refactor 'GetHashCode' to not reference mutable fields.\";\n        private const string SecondaryMessageFormat = \"Remove this use of '{0}' or make it 'readonly'.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, IssueMessage);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var methodSyntax = (MethodDeclarationSyntax)c.Node;\n                    var methodSymbol = c.Model.GetDeclaredSymbol(methodSyntax);\n\n                    if (methodSymbol.ContainingType.IsValueType || !methodSymbol.IsObjectGetHashCode())\n                    {\n                        return;\n                    }\n\n                    ImmutableArray<ISymbol> baseMembers;\n                    try\n                    {\n                        baseMembers = c.Model.LookupBaseMembers(methodSyntax.SpanStart);\n                    }\n                    catch (ArgumentException)\n                    {\n                        // this is expected on invalid code\n                        return;\n                    }\n\n                    var fieldsOfClass = baseMembers\n                                        .Concat(methodSymbol.ContainingType.GetMembers())\n                                        .Select(symbol => symbol as IFieldSymbol)\n                                        .WhereNotNull()\n                                        .ToHashSet();\n\n                    var identifiers = methodSyntax.DescendantNodes().OfType<IdentifierNameSyntax>();\n\n                    var secondaryLocations = GetAllFirstMutableFieldsUsed(c, fieldsOfClass, identifiers).Select(CreateSecondaryLocation).ToArray();\n                    if (secondaryLocations.Any())\n                    {\n                        c.ReportIssue(Rule, methodSyntax.Identifier, secondaryLocations);\n                    }\n                },\n                SyntaxKind.MethodDeclaration);\n\n        private static SecondaryLocation CreateSecondaryLocation(SimpleNameSyntax identifierSyntax) =>\n            new(identifierSyntax.GetLocation(), string.Format(SecondaryMessageFormat, identifierSyntax.Identifier.Text));\n\n        private static IEnumerable<IdentifierNameSyntax> GetAllFirstMutableFieldsUsed(SonarSyntaxNodeReportingContext context,\n                                                                                      ICollection<IFieldSymbol> fieldsOfClass,\n                                                                                      IEnumerable<IdentifierNameSyntax> identifiers)\n        {\n            var syntaxNodes = new Dictionary<IFieldSymbol, List<IdentifierNameSyntax>>();\n\n            foreach (var identifier in identifiers)\n            {\n                if (context.Model.GetSymbolInfo(identifier).Symbol is not IFieldSymbol identifierSymbol)\n                {\n                    continue;\n                }\n                if (!syntaxNodes.ContainsKey(identifierSymbol))\n                {\n                    if (!IsFieldRelevant(identifierSymbol, fieldsOfClass))\n                    {\n                        continue;\n                    }\n                    syntaxNodes.Add(identifierSymbol, []);\n                }\n\n                syntaxNodes[identifierSymbol].Add(identifier);\n            }\n\n            return syntaxNodes.Values\n                .Select(identifierReferences => identifierReferences.OrderBy(id => id.SpanStart).FirstOrDefault())\n                .WhereNotNull();\n        }\n\n        private static bool IsFieldRelevant(IFieldSymbol fieldSymbol, ICollection<IFieldSymbol> fieldsOfClass) =>\n            fieldSymbol is { IsConst: false, IsReadOnly: false }\n            && fieldsOfClass.Contains(fieldSymbol);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/GetHashCodeMutableCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Editing;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class GetHashCodeMutableCodeFix : SonarCodeFix\n    {\n        internal const string Title = \"Make field 'readonly'\";\n\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(GetHashCodeMutable.DiagnosticId);\n\n        protected  override async Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n\n            var identifiersToFix = diagnostic.AdditionalLocations\n                .Select(location => location.SourceSpan)\n                .Select(diagnosticSpan => root.FindNode(diagnosticSpan, getInnermostNodeForTie: true) as IdentifierNameSyntax)\n                .WhereNotNull()\n                .ToList();\n\n            if (identifiersToFix.Count == 0)\n            {\n                return;\n            }\n\n            var semanticModel = await context.Document\n                .GetSemanticModelAsync(context.Cancel)\n                .ConfigureAwait(false);\n            var allFieldDeclarationTasks = identifiersToFix.Select(identifier =>\n                GetFieldDeclarationSyntaxAsync(semanticModel, identifier, context.Cancel));\n            var allFieldDeclarations = await Task.WhenAll(allFieldDeclarationTasks).ConfigureAwait(false);\n            allFieldDeclarations = allFieldDeclarations.WhereNotNull().ToArray();\n\n            context.RegisterCodeFix(\n                Title,\n                c => AddReadonlyToFieldDeclarationsAsync(context.Document, c, allFieldDeclarations),\n                context.Diagnostics);\n        }\n\n        private static async Task<FieldDeclarationSyntax> GetFieldDeclarationSyntaxAsync(SemanticModel semanticModel, IdentifierNameSyntax identifierName, CancellationToken cancel)\n        {\n            if (!(semanticModel.GetSymbolInfo(identifierName).Symbol is IFieldSymbol fieldSymbol) ||\n                !fieldSymbol.DeclaringSyntaxReferences.Any())\n            {\n                return null;\n            }\n\n            var reference = await fieldSymbol.DeclaringSyntaxReferences.First()\n                .GetSyntaxAsync(cancel)\n                .ConfigureAwait(false);\n            var fieldDeclaration = (FieldDeclarationSyntax)reference.Parent.Parent;\n\n            if (fieldDeclaration.Declaration.Variables.Count != 1)\n            {\n                return null;\n            }\n\n            return fieldDeclaration;\n        }\n\n        private static async Task<Document> AddReadonlyToFieldDeclarationsAsync(Document document, CancellationToken cancel, IEnumerable<FieldDeclarationSyntax> fieldDeclarations)\n        {\n            var editor = await DocumentEditor.CreateAsync(document, cancel);\n\n            foreach (var fieldDeclaration in fieldDeclarations)\n            {\n                var readonlyToken = SyntaxFactory.Token(SyntaxKind.ReadOnlyKeyword).WithTrailingTrivia(SyntaxFactory.Space);\n                var newFieldDeclaration = fieldDeclaration.AddModifiers(readonlyToken);\n                editor.ReplaceNode(fieldDeclaration, newFieldDeclaration);\n            }\n\n            return editor.GetChangedDocument();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/GetTypeWithIsAssignableFrom.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class GetTypeWithIsAssignableFrom : SonarDiagnosticAnalyzer\n{\n    internal const string DiagnosticId = \"S2219\";\n    internal const string UseIsOperatorKey = \"UseIsOperator\";\n    internal const string ShouldRemoveGetTypeKey = \"ShouldRemoveGetType\";\n    private const string MessageFormat = \"Use {0} instead.\";\n    private const string MessageIsOperator = \"the 'is' operator\";\n    private const string MessageIsInstanceOfType = \"the 'IsInstanceOfType()' method\";\n    private const string MessageNullCheck = \"a 'null' check\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(c =>\n            {\n                var invocation = (InvocationExpressionSyntax)c.Node;\n                if (invocation.Expression is MemberAccessExpressionSyntax memberAccess\n                    && invocation.HasExactlyNArguments(1)\n                    && memberAccess.Name.Identifier.ValueText is var methodName\n                    && (methodName == \"IsInstanceOfType\" || methodName == \"IsAssignableFrom\")\n                    && c.Model.GetSymbolInfo(invocation).Symbol is IMethodSymbol methodSymbol\n                    && methodSymbol.IsInType(KnownType.System_Type))\n                {\n                    CheckForIsAssignableFrom(c, memberAccess, methodSymbol, invocation.ArgumentList.Arguments.First().Expression);\n                    CheckForIsInstanceOfType(c, memberAccess, methodSymbol);\n                }\n            },\n            SyntaxKind.InvocationExpression);\n\n        context.RegisterNodeAction(\n            c =>\n            {\n                var binary = (BinaryExpressionSyntax)c.Node;\n                CheckGetTypeAndTypeOfEquality(c, binary.Left, binary.Right);\n                CheckGetTypeAndTypeOfEquality(c, binary.Right, binary.Left);\n\n                CheckAsOperatorComparedToNull(c, binary.Left, binary.Right);\n                CheckAsOperatorComparedToNull(c, binary.Right, binary.Left);\n            },\n            SyntaxKind.EqualsExpression,\n            SyntaxKind.NotEqualsExpression);\n\n        context.RegisterNodeAction(c =>\n            {\n                var isExpression = (BinaryExpressionSyntax)c.Node;\n                if (c.Model.GetTypeInfo(isExpression.Left).Type is var objectToCast\n                    && objectToCast.IsClass()\n                    && c.Model.GetSymbolInfo(isExpression.Right).Symbol is INamedTypeSymbol namedSymbol\n                    && namedSymbol.GetSymbolType() is var typeCastTo\n                    && typeCastTo.IsClass()\n                    && !typeCastTo.Is(KnownType.System_Object)\n                    && objectToCast.DerivesOrImplements(typeCastTo))\n                {\n                    ReportDiagnostic(c, MessageNullCheck);\n                }\n            },\n            SyntaxKind.IsExpression);\n\n        context.RegisterNodeAction(c =>\n            {\n                var isPattern = (IsPatternExpressionSyntaxWrapper)c.Node;\n                if (ConstantPatternExpression(isPattern.Pattern) is { } constantExpression)\n                {\n                    CheckAsOperatorComparedToNull(c, isPattern.Expression, constantExpression);\n                }\n            },\n            SyntaxKindEx.IsPatternExpression);\n    }\n\n    private static void CheckAsOperatorComparedToNull(SonarSyntaxNodeReportingContext context, ExpressionSyntax sideA, ExpressionSyntax sideB)\n    {\n        if (sideA.RemoveParentheses().IsKind(SyntaxKind.AsExpression) && sideB.RemoveParentheses().IsKind(SyntaxKind.NullLiteralExpression))\n        {\n            ReportDiagnostic(context, MessageIsOperator);\n        }\n    }\n\n    private static void CheckGetTypeAndTypeOfEquality(SonarSyntaxNodeReportingContext context, ExpressionSyntax sideA, ExpressionSyntax sideB)\n    {\n        if (sideA.ToStringContains(\"GetType\")\n            && sideB is TypeOfExpressionSyntax sideBTypeOf\n            && (sideA as InvocationExpressionSyntax).IsGetTypeCall(context.Model)\n            && context.Model.GetTypeInfo(sideBTypeOf.Type).Type is { } typeSymbol // Can be null for empty identifier from 'typeof' unfinished syntax\n            && typeSymbol.IsSealed\n            && !typeSymbol.OriginalDefinition.Is(KnownType.System_Nullable_T))\n        {\n            ReportDiagnostic(context, MessageIsOperator);\n        }\n    }\n\n    private static void CheckForIsInstanceOfType(SonarSyntaxNodeReportingContext context, MemberAccessExpressionSyntax memberAccess, IMethodSymbol methodSymbol)\n    {\n        if (methodSymbol.Name == nameof(Type.IsInstanceOfType)\n            && memberAccess.Expression is TypeOfExpressionSyntax typeOf\n            && !IsUnboundedGenericType(typeOf))\n        {\n            ReportDiagnostic(context, MessageIsOperator, useIsOperator: true);\n        }\n    }\n\n    private static void CheckForIsAssignableFrom(SonarSyntaxNodeReportingContext context, MemberAccessExpressionSyntax memberAccess, IMethodSymbol methodSymbol, ExpressionSyntax argument)\n    {\n        if (methodSymbol.Name == nameof(Type.IsAssignableFrom) && (argument as InvocationExpressionSyntax).IsGetTypeCall(context.Model))\n        {\n            if (memberAccess.Expression is TypeOfExpressionSyntax typeOf)\n            {\n                if (!IsUnboundedGenericType(typeOf))\n                {\n                    ReportDiagnostic(context, MessageIsOperator, useIsOperator: true, shouldRemoveGetType: true);\n                }\n            }\n            else\n            {\n                ReportDiagnostic(context, MessageIsInstanceOfType, shouldRemoveGetType: true);\n            }\n        }\n    }\n\n    private static bool IsUnboundedGenericType(TypeOfExpressionSyntax typeOf) =>\n        typeOf.Type switch\n        {\n            GenericNameSyntax { IsUnboundGenericName: true } => true,\n            QualifiedNameSyntax { Right: GenericNameSyntax { IsUnboundGenericName: true } } => true,\n            _ => false,\n        };\n\n    private static ExpressionSyntax ConstantPatternExpression(SyntaxNode node) =>\n        node.Kind() switch\n        {\n            SyntaxKindEx.ConstantPattern => ((ConstantPatternSyntaxWrapper)node).Expression,\n            SyntaxKindEx.NotPattern => ConstantPatternExpression(((UnaryPatternSyntaxWrapper)node).Pattern),\n            _ => null\n        };\n\n    private static void ReportDiagnostic(SonarSyntaxNodeReportingContext context, string messageArg, bool useIsOperator = false, bool shouldRemoveGetType = false)\n    {\n        var properties = ImmutableDictionary<string, string>.Empty\n            .Add(UseIsOperatorKey, useIsOperator.ToString())\n            .Add(ShouldRemoveGetTypeKey, shouldRemoveGetType.ToString());\n        context.ReportIssue(Rule, context.Node, properties, messageArg);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/GetTypeWithIsAssignableFromCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Formatting;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class GetTypeWithIsAssignableFromCodeFix : SonarCodeFix\n    {\n        private const string Title = \"Simplify type checking\";\n\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(GetTypeWithIsAssignableFrom.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var node = root.FindNode(diagnostic.Location.SourceSpan, getInnermostNodeForTie: true);\n            if (NewRoot(root, diagnostic, node) is { } newRoot)\n            {\n                context.RegisterCodeFix(Title, c => Task.FromResult(context.Document.WithSyntaxRoot(newRoot)), context.Diagnostics);\n            }\n\n            return Task.CompletedTask;\n        }\n\n        private static SyntaxNode NewRoot(SyntaxNode root, Diagnostic diagnostic, SyntaxNode node) =>\n            node switch {\n                InvocationExpressionSyntax invocation => ChangeInvocation(root, diagnostic, invocation),\n                BinaryExpressionSyntax binary => ChangeBinary(root, binary),\n                var _ when node.IsKind(SyntaxKindEx.IsPatternExpression) => ChangeIsPattern(root, (IsPatternExpressionSyntaxWrapper)node),\n                _ => null\n            };\n\n        private static SyntaxNode ChangeInvocation(SyntaxNode root, Diagnostic diagnostic, InvocationExpressionSyntax invocation)\n        {\n            var useIsOperator = bool.Parse(diagnostic.Properties[GetTypeWithIsAssignableFrom.UseIsOperatorKey]);\n            var shouldRemoveGetType = bool.Parse(diagnostic.Properties[GetTypeWithIsAssignableFrom.ShouldRemoveGetTypeKey]);\n            var newNode = RefactoredExpression(invocation, useIsOperator, shouldRemoveGetType);\n            return root.ReplaceNode(invocation, newNode.WithAdditionalAnnotations(Formatter.Annotation));\n        }\n\n        private static SyntaxNode ChangeBinary(SyntaxNode root, BinaryExpressionSyntax binary)\n        {\n            if (binary.IsKind(SyntaxKind.IsExpression))\n            {\n                return ChangeIsExpressionToNullCheck(root, binary);\n            }\n            else if (RefactoredExpression(binary) is { } expression)\n            {\n                return root.ReplaceNode(binary, expression.WithAdditionalAnnotations(Formatter.Annotation));\n            }\n            else\n            {\n                return null;\n            }\n        }\n\n        private static SyntaxNode ChangeIsPattern(SyntaxNode root, IsPatternExpressionSyntaxWrapper isPattern)\n        {\n            if (isPattern.Expression is BinaryExpressionSyntax binary)\n            {\n                var negationRequired = true;\n                var current = isPattern.Pattern;\n                while (current.SyntaxNode.IsKind(SyntaxKindEx.NotPattern))\n                {\n                    negationRequired = !negationRequired;\n                    current = ((UnaryPatternSyntaxWrapper)current).Pattern;\n                }\n                var newExpression = NegatedExpression(negationRequired, isPattern.SyntaxNode.Parent, GetIsExpression(binary));\n                return root.ReplaceNode(isPattern, newExpression.WithAdditionalAnnotations(Formatter.Annotation));\n            }\n            else\n            {\n                return null;\n            }\n        }\n\n        private static SyntaxNode ChangeIsExpressionToNullCheck(SyntaxNode root, BinaryExpressionSyntax binary)\n        {\n            var newNullCheck = NullCheck(binary);\n            var newExpression = RefactoredExpression(newNullCheck) ?? newNullCheck; // Try to improve nested cases\n            return root.ReplaceNode(binary, ExpressionWithParensIfNeeded(newExpression, binary.Parent).WithAdditionalAnnotations(Formatter.Annotation));\n        }\n\n        private static BinaryExpressionSyntax NullCheck(BinaryExpressionSyntax binary) =>\n            SyntaxFactory.BinaryExpression(SyntaxKind.NotEqualsExpression, binary.Left.RemoveParentheses(), SyntaxConstants.NullLiteralExpression);\n\n        private static ExpressionSyntax RefactoredExpression(BinaryExpressionSyntax binary)\n        {\n            ExpressionSyntax newExpression;\n            var negationRequired = binary.IsKind(SyntaxKind.NotEqualsExpression);\n\n            if (TryGetTypeOfComparison(binary, out var typeofExpression, out var getTypeSide))\n            {\n                newExpression = CreateIsExpression(typeofExpression, getTypeSide, shouldRemoveGetType: true);\n            }\n            else if (AsOperatorComparisonToNull(binary) is { } asExpression)\n            {\n                newExpression = GetIsExpression(asExpression);\n                negationRequired = !negationRequired;\n            }\n            else\n            {\n                return null;\n            }\n\n            return NegatedExpression(negationRequired, binary.Parent, newExpression);\n        }\n\n        private static ExpressionSyntax RefactoredExpression(InvocationExpressionSyntax invocation, bool useIsOperator, bool shouldRemoveGetType)\n        {\n            var typeInstance = ((MemberAccessExpressionSyntax)invocation.Expression).Expression;\n            var getTypeCallInArgument = invocation.ArgumentList.Arguments.First();\n            return useIsOperator\n                ? ExpressionWithParensIfNeeded(CreateIsExpression(typeInstance, getTypeCallInArgument.Expression, shouldRemoveGetType), invocation.Parent)\n                : IsInstanceOfTypeCall(invocation, typeInstance, getTypeCallInArgument);\n        }\n\n        private static ExpressionSyntax NegatedExpression(bool negationRequired, SyntaxNode parent, ExpressionSyntax expression) =>\n            negationRequired\n                ? SyntaxFactory.PrefixUnaryExpression(SyntaxKind.LogicalNotExpression, SyntaxFactory.ParenthesizedExpression(expression))\n                : ExpressionWithParensIfNeeded(expression, parent);\n\n        private static ExpressionSyntax GetIsExpression(BinaryExpressionSyntax asExpression) =>\n            SyntaxFactory.BinaryExpression(SyntaxKind.IsExpression, asExpression.Left, asExpression.Right).WithAdditionalAnnotations(Formatter.Annotation);\n\n        private static BinaryExpressionSyntax AsOperatorComparisonToNull(BinaryExpressionSyntax binary)\n        {\n            var left = binary.Left.RemoveParentheses();\n            return left.IsKind(SyntaxKind.AsExpression)\n                ? left as BinaryExpressionSyntax\n                : binary.Right.RemoveParentheses() as BinaryExpressionSyntax;\n        }\n\n        private static bool TryGetTypeOfComparison(BinaryExpressionSyntax binary, out TypeOfExpressionSyntax typeofExpression, out ExpressionSyntax getTypeSide)\n        {\n            typeofExpression = binary.Left as TypeOfExpressionSyntax;\n            getTypeSide = binary.Right;\n            if (typeofExpression == null)\n            {\n                typeofExpression = binary.Right as TypeOfExpressionSyntax;\n                getTypeSide = binary.Left;\n            }\n            return typeofExpression != null;\n        }\n\n        private static InvocationExpressionSyntax IsInstanceOfTypeCall(InvocationExpressionSyntax invocation, ExpressionSyntax typeInstance, ArgumentSyntax getTypeCallInArgument) =>\n            SyntaxFactory.InvocationExpression(\n                SyntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, typeInstance, SyntaxFactory.IdentifierName(\"IsInstanceOfType\")).WithTriviaFrom(invocation.Expression),\n                SyntaxFactory.ArgumentList(SyntaxFactory.SeparatedList(new[] { SyntaxFactory.Argument(ExpressionFromGetType(getTypeCallInArgument.Expression)).WithTriviaFrom(getTypeCallInArgument) }))\n                                           .WithTriviaFrom(invocation.ArgumentList))\n                .WithTriviaFrom(invocation);\n\n        private static ExpressionSyntax ExpressionWithParensIfNeeded(ExpressionSyntax expression, SyntaxNode parent) =>\n            (parent is ExpressionSyntax && !(parent is AssignmentExpressionSyntax) && !(parent is ParenthesizedExpressionSyntax))\n                ? SyntaxFactory.ParenthesizedExpression(expression)\n                : expression;\n\n        private static ExpressionSyntax CreateIsExpression(ExpressionSyntax typeInstance, ExpressionSyntax getTypeCall, bool shouldRemoveGetType) =>\n            SyntaxFactory.BinaryExpression(SyntaxKind.IsExpression, shouldRemoveGetType ? ExpressionFromGetType(getTypeCall) : getTypeCall, ((TypeOfExpressionSyntax)typeInstance).Type);\n\n        private static ExpressionSyntax ExpressionFromGetType(ExpressionSyntax getTypeCall) =>\n            ((MemberAccessExpressionSyntax)((InvocationExpressionSyntax)getTypeCall).Expression).Expression;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/GotoStatement.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class GotoStatement : GotoStatementBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n        protected override SyntaxKind[] GotoSyntaxKinds => new[]\n        {\n            SyntaxKind.GotoStatement,\n            SyntaxKind.GotoCaseStatement,\n            SyntaxKind.GotoDefaultStatement\n        };\n\n        protected override string GoToLabel => \"goto\";\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/GuardConditionOnEqualsOverride.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class GuardConditionOnEqualsOverride : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S3397\";\n        private const string MessageFormat = \"Change this guard condition to call 'object.ReferenceEquals'.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        private static readonly ISet<string> MethodNames = new HashSet<string> { GetHashCodeEqualsOverride.EqualsName };\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterCodeBlockStartAction(\n                cb =>\n                {\n                    if (!(cb.OwningSymbol is IMethodSymbol methodSymbol)\n                        || !(cb.CodeBlock is MethodDeclarationSyntax)\n                        || !GetHashCodeEqualsOverride.MethodIsRelevant(methodSymbol, MethodNames))\n                    {\n                        return;\n                    }\n\n                    cb.RegisterNodeAction(c => CheckInvocationInsideMethod(c, methodSymbol), SyntaxKind.InvocationExpression);\n                });\n\n        private static void CheckInvocationInsideMethod(SonarSyntaxNodeReportingContext context, ISymbol symbol)\n        {\n            var invocation = (InvocationExpressionSyntax)context.Node;\n            if (!(context.Model.GetSymbolInfo(invocation).Symbol is IMethodSymbol invokedMethod)\n                || invokedMethod.Name != symbol.Name\n                || !invocation.IsOnBase())\n            {\n                return;\n            }\n\n            if (!invokedMethod.ContainingType.Is(KnownType.System_Object)\n                && GetHashCodeEqualsOverride.IsEqualsCallInGuardCondition(invocation, invokedMethod))\n            {\n                context.ReportIssue(Rule, invocation);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/Hotspots/ClearTextProtocolsAreSensitive.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text.RegularExpressions;\nusing SonarAnalyzer.CSharp.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class ClearTextProtocolsAreSensitive : HotspotDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S5332\";\n        private const string MessageFormat = \"Using {0} protocol is insecure. Use {1} instead.\";\n        private const string EnableSslMessage = \"EnableSsl should be set to true.\";\n\n        private const string TelnetKey = \"telnet\";\n        private const string EnableSslName = \"EnableSsl\";\n\n        private static readonly DiagnosticDescriptor DefaultRule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        private static readonly DiagnosticDescriptor EnableSslRule = DescriptorFactory.Create(DiagnosticId, EnableSslMessage);\n\n        private static readonly Dictionary<string, string> RecommendedProtocols = new()\n        {\n            {\"telnet\", \"ssh\"},\n            {\"ftp\", \"sftp, scp or ftps\"},\n            {\"http\", \"https\"},\n            {\"clear-text SMTP\", \"SMTP over SSL/TLS or SMTP with STARTTLS\" }\n        };\n\n        private static readonly string[] CommonlyUsedXmlDomains =\n        {\n            \"www.w3.org\",\n            \"xml.apache.org\",\n            \"maven.apache.org\",\n            \"schemas.xmlsoap.org\",\n            \"schemas.openxmlformats.org\",\n            \"rdfs.org\",\n            \"purl.org\",\n            \"xmlns.com\",\n            \"schemas.google.com\",\n            \"schemas.microsoft.com\",\n            \"collations.microsoft.com\",\n            \"a9.com\",\n            \"ns.adobe.com\",\n            \"ltsc.ieee.org\",\n            \"docbook.org\",\n            \"graphml.graphdrawing.org\",\n            \"json-schema.org\",\n            \"www.sitemaps.org\",\n            \"exslt.org\",\n            \"docs.oasis-open.org\",\n            \"ws-i.org\",\n            \"schemas.android.com\",\n            \"www.omg.org\",\n            \"www.opengis.net\",\n            \"www.itunes.com\",\n        };\n\n        private static readonly string[] CommonlyUsedExampleDomains = { \"example.com\", \"example.org\", \"test.com\" };\n        private static readonly string[] LocalhostAddresses = { \"localhost\", \"127.0.0.1\", \"::1\" };\n        private static readonly KnownType[] AttributesWithNamespaceParameter = new[]\n        {\n            KnownType.System_Windows_Markup_XmlnsPrefixAttribute,\n            KnownType.System_Windows_Markup_XmlnsDefinitionAttribute,\n            KnownType.System_Windows_Markup_XmlnsCompatibleWithAttribute,\n        };\n\n        private static readonly CSharpObjectInitializationTracker ObjectInitializationTracker =\n            new(constantValue => constantValue is bool value && value,\n                                                  ImmutableArray.Create(KnownType.System_Net_Mail_SmtpClient, KnownType.System_Net_FtpWebRequest),\n                                                  propertyName => propertyName == EnableSslName);\n\n        private static readonly TimeSpan RegexTimeout = TimeSpan.FromMilliseconds(250);\n        private static readonly Regex HttpRegex;\n        private static readonly Regex FtpRegex;\n        private static readonly Regex TelnetRegex;\n        private static readonly Regex TelnetRegexForIdentifier;\n        private static readonly Regex ValidServerRegex;\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics =>\n            ImmutableArray.Create(DefaultRule, EnableSslRule);\n\n        public ClearTextProtocolsAreSensitive() : this(AnalyzerConfiguration.Hotspot) { }\n\n        public ClearTextProtocolsAreSensitive(IAnalyzerConfiguration analyzerConfiguration) : base(analyzerConfiguration) { }\n\n        static ClearTextProtocolsAreSensitive()\n        {\n            const string allSubdomainsPattern = @\"([^/?#]+\\.)?\";\n\n            var domainsList = LocalhostAddresses\n                .Concat(CommonlyUsedXmlDomains)\n                .Select(Regex.Escape)\n                .Concat(CommonlyUsedExampleDomains.Select(x => allSubdomainsPattern + Regex.Escape(x)));\n\n            var validServerPattern = domainsList.JoinStr(\"|\");\n\n            HttpRegex = CompileRegex(@$\"^http:\\/\\/(?!{validServerPattern}).\");\n            FtpRegex = CompileRegex(@$\"^ftp:\\/\\/.*@(?!{validServerPattern})\");\n            TelnetRegex = CompileRegex(@$\"^telnet:\\/\\/.*@(?!{validServerPattern})\");\n            TelnetRegexForIdentifier = CompileRegex(@\"Telnet(?![a-z])\", false);\n            ValidServerRegex = CompileRegex($\"^({validServerPattern})$\");\n        }\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterCompilationStartAction(c =>\n            {\n                if (!IsEnabled(c.Options))\n                {\n                    return;\n                }\n\n                c.RegisterNodeAction(\n                    VisitStringExpressions,\n                    SyntaxKind.StringLiteralExpression,\n                    SyntaxKind.InterpolatedStringExpression,\n                    SyntaxKindEx.Utf8StringLiteralExpression);\n\n                c.RegisterNodeAction(VisitObjectCreation, SyntaxKind.ObjectCreationExpression, SyntaxKindEx.ImplicitObjectCreationExpression);\n                c.RegisterNodeAction(VisitInvocationExpression, SyntaxKind.InvocationExpression);\n                c.RegisterNodeAction(VisitAssignments, SyntaxKind.SimpleAssignmentExpression);\n            });\n\n        private static void VisitObjectCreation(SonarSyntaxNodeReportingContext context)\n        {\n            var objectCreation = ObjectCreationFactory.Create(context.Node);\n\n            if (!IsServerSafe(objectCreation, context.Model) && ObjectInitializationTracker.ShouldBeReported(objectCreation, context.Model, false))\n            {\n                context.ReportIssue(EnableSslRule, objectCreation.Expression);\n            }\n            else if (objectCreation.TypeAsString(context.Model) is { } typeAsString && TelnetRegexForIdentifier.SafeIsMatch(typeAsString))\n            {\n                context.ReportIssue(DefaultRule, objectCreation.Expression, TelnetKey, RecommendedProtocols[TelnetKey]);\n            }\n        }\n\n        private static void VisitInvocationExpression(SonarSyntaxNodeReportingContext context)\n        {\n            var invocation = (InvocationExpressionSyntax)context.Node;\n            if (TelnetRegexForIdentifier.SafeIsMatch(invocation.Expression.ToString()))\n            {\n                context.ReportIssue(DefaultRule, invocation, TelnetKey, RecommendedProtocols[TelnetKey]);\n            }\n        }\n\n        private static void VisitAssignments(SonarSyntaxNodeReportingContext context)\n        {\n            var assignment = (AssignmentExpressionSyntax)context.Node;\n            if (assignment.Left is MemberAccessExpressionSyntax memberAccess\n                && memberAccess.IsMemberAccessOnKnownType(EnableSslName, KnownType.System_Net_FtpWebRequest, context.Model)\n                && assignment.Right.FindConstantValue(context.Model) is bool enableSslValue\n                && !enableSslValue)\n            {\n                context.ReportIssue(EnableSslRule, assignment);\n            }\n        }\n\n        private static void VisitStringExpressions(SonarSyntaxNodeReportingContext c)\n        {\n            if (GetUnsafeProtocol(c.Node, c.Model) is { } unsafeProtocol)\n            {\n                c.ReportIssue(DefaultRule, c.Node, unsafeProtocol, RecommendedProtocols[unsafeProtocol]);\n            }\n        }\n\n        private static bool IsServerSafe(IObjectCreation objectCreation, SemanticModel semanticModel) =>\n            objectCreation.ArgumentList?.Arguments.Count > 0\n            && ValidServerRegex.SafeIsMatch(GetText(objectCreation.ArgumentList.Arguments[0].Expression, semanticModel));\n\n        private static string GetUnsafeProtocol(SyntaxNode node, SemanticModel semanticModel)\n        {\n            var text = GetText(node, semanticModel);\n            if (HttpRegex.SafeIsMatch(text) && !IsNamespace(semanticModel, node.Parent))\n            {\n                return \"http\";\n            }\n            else if (FtpRegex.SafeIsMatch(text))\n            {\n                return \"ftp\";\n            }\n            else if (TelnetRegex.SafeIsMatch(text))\n            {\n                return \"telnet\";\n            }\n            else\n            {\n                return null;\n            }\n        }\n\n        private static string GetText(SyntaxNode node, SemanticModel model)\n        {\n            if (node is InterpolatedStringExpressionSyntax interpolatedStringExpression)\n            {\n                return interpolatedStringExpression.InterpolatedTextValue(model) ?? interpolatedStringExpression.ContentsText();\n            }\n            else\n            {\n                return node is LiteralExpressionSyntax literalExpression ? literalExpression.Token.ValueText : string.Empty;\n            }\n        }\n\n        private static bool IsNamespace(SemanticModel model, SyntaxNode node) =>\n            node switch\n            {\n                AttributeArgumentSyntax attributeArgument when attributeArgument.NameEquals is { } nameEquals && TokenContainsNamespace(nameEquals.Name.Identifier) => true,\n                AttributeArgumentSyntax { Parent.Parent: AttributeSyntax attribute } => IsAttributeWithNamespaceParameter(model, attribute),\n                EqualsValueClauseSyntax equalsValueClause =>\n                    (equalsValueClause.Parent is VariableDeclaratorSyntax variableDeclarator && TokenContainsNamespace(variableDeclarator.Identifier))\n                    || (equalsValueClause.Parent is ParameterSyntax parameter && TokenContainsNamespace(parameter.Identifier)),\n                AssignmentExpressionSyntax assignmentExpression =>\n                    assignmentExpression.Left.RemoveParentheses() is IdentifierNameSyntax identifierName && TokenContainsNamespace(identifierName.Identifier),\n                ArgumentSyntax { Parent: ArgumentListSyntax { Parent: { } invocationOrCreation } } argument =>\n                    CSharpFacade.Instance.MethodParameterLookup(invocationOrCreation, model).TryGetSymbol(argument, out var symbol)\n                        && symbol switch\n                        {\n                            { Name: \"ns\", ContainingNamespace: { } ns } when ns.Is(\"System.Xml.Serialization\") => true,\n                            { Name: \"ns\" or \"uri\" or \"namespaceURI\", ContainingNamespace: { } ns } when ns.Is(\"System.Xml\") => true,\n                            { Name: \"xmlNamespace\", ContainingType.Name: \"XmlnsDictionary\", ContainingNamespace: { } ns } when ns.Is(\"System.Windows.Markup\") => true,\n                            { Name: \"namespaceName\", ContainingSymbol.Name: \"Get\", ContainingType.Name: \"XNamespace\", ContainingNamespace: { } ns } when ns.Is(\"System.Xml.Linq\") => true,\n                            _ => false,\n                        },\n                _ => false\n            };\n\n        private static bool IsAttributeWithNamespaceParameter(SemanticModel model, AttributeSyntax attribute) =>\n            model.GetSymbolInfo(attribute).Symbol is IMethodSymbol { ContainingType: { } attributeSymbol } && Array.Exists(AttributesWithNamespaceParameter, x => x.Matches(attributeSymbol));\n\n        private static bool TokenContainsNamespace(SyntaxToken token) =>\n            token.Text.IndexOf(\"Namespace\", StringComparison.OrdinalIgnoreCase) != -1;\n\n        private static Regex CompileRegex(string pattern, bool ignoreCase = true) =>\n            new(pattern, ignoreCase\n                          ? RegexOptions.Compiled | RegexOptions.IgnoreCase\n                          : RegexOptions.Compiled, RegexTimeout);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/Hotspots/CommandPath.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class CommandPath : CommandPathBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n        public CommandPath() : this(AnalyzerConfiguration.Hotspot) { }\n\n        internal /*for testing*/ CommandPath(IAnalyzerConfiguration configuration) : base(configuration) { }\n\n        protected override string FirstArgument(InvocationContext context) =>\n            ((InvocationExpressionSyntax)context.Node).ArgumentList.Get(0).FindStringConstant(context.Model);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/Hotspots/ConfiguringLoggers.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class ConfiguringLoggers : ConfiguringLoggersBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n        public ConfiguringLoggers() : this(AnalyzerConfiguration.Hotspot) { }\n\n        // Set internal for testing\n        internal ConfiguringLoggers(IAnalyzerConfiguration configuration) : base(configuration) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/Hotspots/CookieShouldBeHttpOnly.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\nusing SonarAnalyzer.CSharp.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class CookieShouldBeHttpOnly : ObjectShouldBeInitializedCorrectlyBase\n    {\n        private const string DiagnosticId = \"S3330\";\n        private const string MessageFormat = \"Make sure creating this cookie without the \\\"HttpOnly\\\" flag is safe.\";\n\n        private static readonly ImmutableArray<KnownType> TrackedTypes =\n            ImmutableArray.Create(\n                KnownType.System_Web_HttpCookie,\n                KnownType.Microsoft_AspNetCore_Http_CookieOptions);\n\n        protected override CSharpObjectInitializationTracker ObjectInitializationTracker { get; } = new(\n            isAllowedConstantValue: constantValue => constantValue is true,\n            trackedTypes: TrackedTypes,\n            isTrackedPropertyName: propertyName => propertyName == \"HttpOnly\");\n\n        public CookieShouldBeHttpOnly() : this(AnalyzerConfiguration.Hotspot) { }\n\n        internal CookieShouldBeHttpOnly(IAnalyzerConfiguration analyzerConfiguration) : base(analyzerConfiguration, DiagnosticId, MessageFormat) { }\n\n        protected override bool IsDefaultConstructorSafe(SonarCompilationStartAnalysisContext context) =>\n            IsWebConfigCookieSet(context, \"httpOnlyCookies\");\n\n        protected override void Initialize(TrackerInput input)\n        {\n            var t = CSharpFacade.Instance.Tracker.ObjectCreation;\n            t.Track(input,\n                t.MatchConstructor(KnownType.Nancy_Cookies_NancyCookie),\n                t.ExceptWhen(t.ArgumentIsBoolConstant(\"httpOnly\", true)));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/Hotspots/CookieShouldBeSecure.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\nusing SonarAnalyzer.CSharp.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class CookieShouldBeSecure : ObjectShouldBeInitializedCorrectlyBase\n    {\n        private const string DiagnosticId = \"S2092\";\n        private const string MessageFormat = \"Make sure creating this cookie without setting the 'Secure' property is safe here.\";\n\n        private static readonly ImmutableArray<KnownType> TrackedTypes =\n            ImmutableArray.Create(\n                KnownType.System_Web_HttpCookie,\n                KnownType.Microsoft_AspNetCore_Http_CookieOptions);\n\n        protected override CSharpObjectInitializationTracker ObjectInitializationTracker { get; } = new(\n            isAllowedConstantValue: constantValue => constantValue is true,\n            trackedTypes: TrackedTypes,\n            isTrackedPropertyName: propertyName => propertyName == \"Secure\");\n\n        public CookieShouldBeSecure() : this(AnalyzerConfiguration.Hotspot) { }\n\n        internal CookieShouldBeSecure(IAnalyzerConfiguration configuration) : base(configuration, DiagnosticId, MessageFormat) { }\n\n        protected override bool IsDefaultConstructorSafe(SonarCompilationStartAnalysisContext context) =>\n            IsWebConfigCookieSet(context, \"requireSSL\");\n\n        protected override void Initialize(TrackerInput input)\n        {\n            var t = CSharpFacade.Instance.Tracker.ObjectCreation;\n            t.Track(input,\n                t.MatchConstructor(KnownType.Nancy_Cookies_NancyCookie),\n                t.ExceptWhen(t.ArgumentIsBoolConstant(\"secure\", true)));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/Hotspots/CreatingHashAlgorithms.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class CreatingHashAlgorithms : CreatingHashAlgorithmsBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    public CreatingHashAlgorithms() : this(AnalyzerConfiguration.Hotspot) { }\n\n    internal /*for testing*/ CreatingHashAlgorithms(IAnalyzerConfiguration configuration) : base(configuration) { }\n\n    protected override bool IsUnsafeAlgorithm(SyntaxNode argumentNode, SemanticModel model) =>\n        argumentNode as ArgumentSyntax is { } argument\n        && argument.Expression as MemberAccessExpressionSyntax is { } memberAccess\n        && memberAccess.Name.ToString() is \"SHA1\" or \"MD5\"\n        && model.GetSymbolInfo(memberAccess.Expression).Symbol.GetSymbolType().Is(KnownType.System_Security_Cryptography_HashAlgorithmName);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/Hotspots/DeliveringDebugFeaturesInProduction.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class DeliveringDebugFeaturesInProduction : DeliveringDebugFeaturesInProductionBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n        public DeliveringDebugFeaturesInProduction() : this(AnalyzerConfiguration.Hotspot) { }\n\n        internal /*for testing*/ DeliveringDebugFeaturesInProduction(IAnalyzerConfiguration configuration) : base(configuration) { }\n\n        // For simplicity we will avoid creating noise if the validation is invoked in the same method (https://github.com/SonarSource/sonar-dotnet/issues/5032)\n        protected override bool IsDevelopmentCheckInvoked(SyntaxNode node, SemanticModel semanticModel) =>\n            node.EnclosingScope()\n                .DescendantNodes()\n                .Any(x => IsDevelopmentCheck(x, semanticModel));\n\n        protected override bool IsInDevelopmentContext(SyntaxNode node) =>\n            node.Ancestors()\n                .OfType<ClassDeclarationSyntax>()\n                .Any(x => x.Identifier.Text == StartupDevelopment);\n\n        private bool IsDevelopmentCheck(SyntaxNode node, SemanticModel semanticModel) =>\n            node is InvocationExpressionSyntax condition\n            && IsValidationMethod(semanticModel, condition, condition.Expression.GetIdentifier()?.ValueText);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/Hotspots/DisablingCsrfProtection.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class DisablingCsrfProtection : HotspotDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S4502\";\n        private const string MessageFormat = \"Make sure disabling CSRF protection is safe here.\";\n        private const SyntaxKind ImplicitObjectCreationExpression = (SyntaxKind)8659;\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n        public DisablingCsrfProtection() : base(AnalyzerConfiguration.Hotspot) { }\n\n        public DisablingCsrfProtection(IAnalyzerConfiguration configuration) : base(configuration) { }\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n             context.RegisterCompilationStartAction(\n                c =>\n                {\n                    if (!IsEnabled(c.Options))\n                    {\n                        return;\n                    }\n\n                    c.RegisterNodeAction(\n                        CheckIgnoreAntiforgeryTokenAttribute,\n                        SyntaxKind.Attribute,\n                        SyntaxKind.ObjectCreationExpression,\n                        ImplicitObjectCreationExpression);\n                });\n\n        private static void CheckIgnoreAntiforgeryTokenAttribute(SonarSyntaxNodeReportingContext c)\n        {\n            var shouldReport = c.Node switch\n            {\n                AttributeSyntax attributeSyntax => attributeSyntax.IsKnownType(KnownType.Microsoft_AspNetCore_Mvc_IgnoreAntiforgeryTokenAttribute, c.Model),\n                ObjectCreationExpressionSyntax objectCreation => objectCreation.IsKnownType(KnownType.Microsoft_AspNetCore_Mvc_IgnoreAntiforgeryTokenAttribute, c.Model),\n                _ => c.Node.IsKnownType(KnownType.Microsoft_AspNetCore_Mvc_IgnoreAntiforgeryTokenAttribute, c.Model)\n            };\n\n            if (shouldReport)\n            {\n                ReportDiagnostic(c);\n            }\n        }\n\n        private static void ReportDiagnostic(SonarSyntaxNodeReportingContext context) =>\n            context.ReportIssue(Rule, context.Node);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/Hotspots/DisablingRequestValidation.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class DisablingRequestValidation : DisablingRequestValidationBase\n    {\n        protected override ILanguageFacade Language => CSharpFacade.Instance;\n\n        public DisablingRequestValidation() : this(AnalyzerConfiguration.Hotspot) { }\n\n        public DisablingRequestValidation(IAnalyzerConfiguration analyzerConfiguration) : base(analyzerConfiguration) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/Hotspots/DoNotUseRandom.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class DoNotUseRandom : HotspotDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S2245\";\n        private const string MessageFormat = \"Make sure that using this pseudorandom number generator is safe here.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        public DoNotUseRandom() : base(AnalyzerConfiguration.Hotspot) { }\n\n        public DoNotUseRandom(IAnalyzerConfiguration analyzerConfiguration) : base(analyzerConfiguration) { }\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterCompilationStartAction(\n                ccc =>\n                {\n                    if (!IsEnabled(ccc.Options))\n                    {\n                        return;\n                    }\n\n                    ccc.RegisterNodeAction(\n                        c =>\n                        {\n                            var objectCreationSyntax = (ObjectCreationExpressionSyntax)c.Node;\n                            var argumentsCount = objectCreationSyntax.ArgumentList?.Arguments.Count;\n\n                            if (argumentsCount <= 1 // Random has two ctors - with zero and one parameter\n                                && c.Model.GetSymbolInfo(objectCreationSyntax).Symbol is IMethodSymbol methodSymbol\n                                && methodSymbol.ContainingType.Is(KnownType.System_Random))\n                            {\n                                c.ReportIssue(Rule, objectCreationSyntax);\n                            }\n                        },\n                        SyntaxKind.ObjectCreationExpression);\n                });\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/Hotspots/ExecutingSqlQueries.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ExecutingSqlQueries : ExecutingSqlQueriesBase<SyntaxKind, ExpressionSyntax, IdentifierNameSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language { get; } = CSharpFacade.Instance;\n\n    public ExecutingSqlQueries() : this(AnalyzerConfiguration.Hotspot) { }\n\n    internal /*for testing*/ ExecutingSqlQueries(IAnalyzerConfiguration configuration) : base(configuration) { }\n\n    protected override ExpressionSyntax GetArgumentAtIndex(InvocationContext context, int index) =>\n        context.Node is InvocationExpressionSyntax invocation\n            ? invocation.ArgumentList.Get(index)\n            : null;\n\n    protected override ExpressionSyntax GetArgumentAtIndex(ObjectCreationContext context, int index) =>\n        ObjectCreationFactory.Create(context.Node).ArgumentList.Get(index);\n\n    protected override ExpressionSyntax GetSetValue(PropertyAccessContext context) =>\n        context.Node is MemberAccessExpressionSyntax setter && setter.IsLeftSideOfAssignment()\n            ? ((AssignmentExpressionSyntax)setter.GetSelfOrTopParenthesizedExpression().Parent).Right.RemoveParentheses()\n            : null;\n\n    protected override bool IsTracked(ExpressionSyntax expression, SyntaxBaseContext context) =>\n        IsSensitiveExpression(expression, context.Model) || IsTrackedVariableDeclaration(expression, context);\n\n    protected override bool IsSensitiveExpression(ExpressionSyntax expression, SemanticModel semanticModel) =>\n        expression is not null\n        && (IsConcatenation(expression, semanticModel)\n        || expression.IsKind(SyntaxKind.InterpolatedStringExpression)\n        || (expression is InvocationExpressionSyntax invocation && IsInvocationOfInterest(invocation, semanticModel)));\n\n    protected override Location SecondaryLocationForExpression(ExpressionSyntax node, string identifierNameToFind, out string identifierNameFound)\n    {\n        identifierNameFound = identifierNameToFind;\n\n        if (node is null)\n        {\n            return Location.None;\n        }\n\n        if (node.Parent is EqualsValueClauseSyntax {Parent: VariableDeclaratorSyntax declarationSyntax})\n        {\n            return declarationSyntax.Identifier.GetLocation();\n        }\n\n        return node.Parent is AssignmentExpressionSyntax assignment ? assignment.Left.GetLocation() : Location.None;\n    }\n\n    private static bool IsInvocationOfInterest(InvocationExpressionSyntax invocation, SemanticModel model) =>\n        (invocation.IsMethodInvocation(KnownType.System_String, \"Format\", model) || invocation.IsMethodInvocation(KnownType.System_String, \"Concat\", model))\n        && !AllConstants(invocation.ArgumentList.Arguments.ToList(), model);\n\n    private static bool IsConcatenation(ExpressionSyntax expression, SemanticModel model) =>\n        expression.IsKind(SyntaxKind.AddExpression)\n        && expression is BinaryExpressionSyntax concatenation\n        && !IsConcatenationOfConstants(concatenation, model);\n\n    private static bool AllConstants(IEnumerable<ArgumentSyntax> arguments, SemanticModel model) =>\n        arguments.All(x => x.Expression.HasConstantValue(model));\n\n    private static bool IsConcatenationOfConstants(BinaryExpressionSyntax binaryExpression, SemanticModel model)\n    {\n        System.Diagnostics.Debug.Assert(binaryExpression.IsKind(SyntaxKind.AddExpression), \"Binary expression should be of syntax kind add expression.\");\n        if ((model.GetTypeInfo(binaryExpression).Type is not null) && binaryExpression.Right.HasConstantValue(model))\n        {\n            var nestedLeft = binaryExpression.Left;\n            var nestedBinary = nestedLeft as BinaryExpressionSyntax;\n            while (nestedBinary is not null)\n            {\n                if (nestedBinary.Right.HasConstantValue(model)\n                    && (nestedBinary.IsKind(SyntaxKind.AddExpression) || nestedBinary.HasConstantValue(model)))\n                {\n                    nestedLeft = nestedBinary.Left;\n                    nestedBinary = nestedLeft as BinaryExpressionSyntax;\n                }\n                else\n                {\n                    return false;\n                }\n            }\n            return nestedLeft.HasConstantValue(model);\n        }\n        return false;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/Hotspots/ExpandingArchives.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class ExpandingArchives : ExpandingArchivesBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n        public ExpandingArchives() : this(AnalyzerConfiguration.Hotspot) { }\n\n        internal /*for testing*/ ExpandingArchives(IAnalyzerConfiguration configuration) : base(configuration) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/Hotspots/HardcodedIpAddress.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class HardcodedIpAddress : HardcodedIpAddressBase<SyntaxKind, LiteralExpressionSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n        public HardcodedIpAddress() : this(AnalyzerConfiguration.Hotspot) { }\n\n        public HardcodedIpAddress(IAnalyzerConfiguration analyzerConfiguration) : base(analyzerConfiguration) { }\n\n        protected override bool HasAttributes(SyntaxNode literalExpression) =>\n            literalExpression.HasAncestor(SyntaxKind.Attribute);\n\n        protected override string GetAssignedVariableName(SyntaxNode stringLiteral) =>\n            stringLiteral.FirstAncestorOrSelf<SyntaxNode>(IsVariableIdentifier)?.ToString();\n\n        private static bool IsVariableIdentifier(SyntaxNode syntaxNode) =>\n            syntaxNode is StatementSyntax\n            || syntaxNode is VariableDeclaratorSyntax\n            || syntaxNode is ParameterSyntax;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/Hotspots/InsecureDeserialization.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class InsecureDeserialization : HotspotDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S5766\";\n        private const string MessageFormat = \"Make sure not performing data validation after deserialization is safe here.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n        public InsecureDeserialization() : this(AnalyzerConfiguration.Hotspot) { }\n        public InsecureDeserialization(IAnalyzerConfiguration analyzerConfiguration) : base(analyzerConfiguration) { }\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n            {\n                var declaration = (TypeDeclarationSyntax)c.Node;\n                if (!c.IsRedundantPositionalRecordContext()\n                    && IsEnabled(c.Options)\n                    && HasConstructorsWithParameters(declaration) // If there are no constructors, or if these don't have parameters, there is no validation done and the type is considered safe.\n                    && c.Model.GetDeclaredSymbol(declaration) is { } typeSymbol\n                    && HasSerializableAttribute(typeSymbol))\n                {\n                    ReportOnInsecureDeserializations(c, declaration, typeSymbol);\n                }\n            },\n            SyntaxKind.ClassDeclaration,\n            SyntaxKindEx.RecordDeclaration,\n            SyntaxKindEx.RecordStructDeclaration,\n            SyntaxKind.StructDeclaration);\n\n        private static void ReportOnInsecureDeserializations(SonarSyntaxNodeReportingContext context, TypeDeclarationSyntax declaration, ITypeSymbol typeSymbol)\n        {\n            var implementsISerializable = ImplementsISerializable(typeSymbol);\n            var implementsIDeserializationCallback = ImplementsIDeserializationCallback(typeSymbol);\n\n            var walker = new ConstructorDeclarationWalker(context.Model);\n            walker.SafeVisit(declaration);\n\n            if (!implementsISerializable && !implementsIDeserializationCallback)\n            {\n                foreach (var constructor in walker.GetConstructorsInfo(x => x.HasConditionalConstructs))\n                {\n                    ReportIssue(context, constructor);\n                }\n            }\n\n            if (implementsISerializable && !walker.HasDeserializationCtorWithConditionalStatements())\n            {\n                foreach (var constructor in walker.GetConstructorsInfo(x => !x.IsDeserializationConstructor && x.HasConditionalConstructs))\n                {\n                    ReportIssue(context, constructor);\n                }\n            }\n\n            if (implementsIDeserializationCallback && !OnDeserializationHasConditions(declaration, context.Model))\n            {\n                foreach (var constructor in walker.GetConstructorsInfo(x => x.HasConditionalConstructs))\n                {\n                    ReportIssue(context, constructor);\n                }\n            }\n\n            static void ReportIssue(SonarSyntaxNodeReportingContext context, ConstructorInfo constructor) =>\n                context.ReportIssue(Rule, constructor.GetReportLocation());\n        }\n\n        private static bool OnDeserializationHasConditions(TypeDeclarationSyntax typeDeclaration, SemanticModel semanticModel) =>\n            typeDeclaration\n                .Members\n                .OfType<MethodDeclarationSyntax>()\n                .FirstOrDefault(methodDeclaration => IsOnDeserialization(methodDeclaration, semanticModel))\n                .ContainsConditionalConstructs();\n\n        private static bool IsOnDeserialization(MethodDeclarationSyntax methodDeclaration, SemanticModel semanticModel) =>\n            methodDeclaration.Identifier.Text == nameof(System.Runtime.Serialization.IDeserializationCallback.OnDeserialization)\n            && methodDeclaration.ParameterList.Parameters.Count == 1\n            && methodDeclaration.ParameterList.Parameters[0].IsDeclarationKnownType(KnownType.System_Object, semanticModel);\n\n        private static bool HasConstructorsWithParameters(TypeDeclarationSyntax typeDeclaration) =>\n            typeDeclaration\n                .Members\n                .OfType<ConstructorDeclarationSyntax>()\n                .Any(constructorDeclaration => constructorDeclaration.ParameterList.Parameters.Count > 0);\n\n        private static bool HasSerializableAttribute(ISymbol symbol) =>\n            symbol.HasAttribute(KnownType.System_SerializableAttribute);\n\n        private static bool ImplementsISerializable(ITypeSymbol symbol) =>\n            symbol.Implements(KnownType.System_Runtime_Serialization_ISerializable);\n\n        private static bool ImplementsIDeserializationCallback(ITypeSymbol symbol) =>\n            symbol.Implements(KnownType.System_Runtime_Serialization_IDeserializationCallback);\n\n        /// <summary>\n        /// This walker is responsible to visit all constructor declarations and check if parameters are used in a\n        /// conditional structure or not.\n        /// </summary>\n        private sealed class ConstructorDeclarationWalker : SafeCSharpSyntaxWalker\n        {\n            private readonly SemanticModel semanticModel;\n            private readonly List<ConstructorInfo> constructorsInfo = new();\n\n            private bool visitedFirstLevel;\n\n            public ConstructorDeclarationWalker(SemanticModel semanticModel)\n            {\n                this.semanticModel = semanticModel;\n            }\n\n            public IEnumerable<ConstructorInfo> GetConstructorsInfo(Func<ConstructorInfo, bool> predicate) =>\n                constructorsInfo.Where(predicate);\n\n            public bool HasDeserializationCtorWithConditionalStatements() =>\n                GetDeserializationConstructor() is { HasConditionalConstructs: true };\n\n            public override void VisitConstructorDeclaration(ConstructorDeclarationSyntax node)\n            {\n                var isDeserializationCtor = IsDeserializationConstructor(node);\n\n                var hasConditionalStatements = isDeserializationCtor\n                    ? node.ContainsConditionalConstructs()\n                    : HasParametersUsedInConditionalConstructs(node);\n\n                constructorsInfo.Add(new ConstructorInfo(node, hasConditionalStatements, isDeserializationCtor));\n\n                base.VisitConstructorDeclaration(node);\n            }\n\n            public override void VisitClassDeclaration(ClassDeclarationSyntax node)\n            {\n                if (visitedFirstLevel)\n                {\n                    // Skip nested visits. The rule will be triggered for them also.\n                    return;\n                }\n\n                visitedFirstLevel = true;\n                base.VisitClassDeclaration(node);\n            }\n\n            public override void Visit(SyntaxNode node)\n            {\n                if (node.Kind() is SyntaxKindEx.RecordDeclaration or SyntaxKindEx.RecordStructDeclaration)\n                {\n                    if (visitedFirstLevel)\n                    {\n                        // Skip nested visits. The rule will be triggered for them also.\n                        return;\n                    }\n\n                    visitedFirstLevel = true;\n                }\n\n                base.Visit(node);\n            }\n\n            private bool HasParametersUsedInConditionalConstructs(BaseMethodDeclarationSyntax declaration)\n            {\n                var symbols = GetConstructorParameterSymbols(declaration, semanticModel);\n\n                var conditionalsWalker = new ConditionalsWalker(semanticModel, symbols);\n                conditionalsWalker.SafeVisit(declaration);\n\n                return conditionalsWalker.HasParametersUsedInConditionalConstructs;\n            }\n\n            private ConstructorInfo GetDeserializationConstructor() =>\n                constructorsInfo.SingleOrDefault(info => info.IsDeserializationConstructor);\n\n            private bool IsDeserializationConstructor(BaseMethodDeclarationSyntax declaration) =>\n                // A deserialization ctor has the following parameters: (SerializationInfo information, StreamingContext context)\n                // See https://docs.microsoft.com/en-us/dotnet/api/system.runtime.serialization.iserializable?view=netcore-3.1#remarks\n                declaration.ParameterList.Parameters.Count == 2\n                && declaration.ParameterList.Parameters[0].IsDeclarationKnownType(KnownType.System_Runtime_Serialization_SerializationInfo, semanticModel)\n                && declaration.ParameterList.Parameters[1].IsDeclarationKnownType(KnownType.System_Runtime_Serialization_StreamingContext, semanticModel);\n\n            private static ImmutableArray<ISymbol> GetConstructorParameterSymbols(BaseMethodDeclarationSyntax node, SemanticModel semanticModel) =>\n                node.ParameterList.Parameters\n                    .Select(syntax => (ISymbol)semanticModel.GetDeclaredSymbol(syntax))\n                    .ToImmutableArray();\n        }\n\n        /// <summary>\n        /// This walker is responsible to visit all conditional structures and check if a list of parameters\n        /// are used or not.\n        /// </summary>\n        private sealed class ConditionalsWalker : SafeCSharpSyntaxWalker\n        {\n            private readonly SemanticModel semanticModel;\n            private readonly ISet<string> parameterNames;\n\n            public ConditionalsWalker(SemanticModel semanticModel, ImmutableArray<ISymbol> parameters)\n            {\n                this.semanticModel = semanticModel;\n\n                parameterNames = parameters.Select(parameter => parameter.Name).ToHashSet();\n            }\n\n            public bool HasParametersUsedInConditionalConstructs { get; private set; }\n\n            public override void VisitIfStatement(IfStatementSyntax node)\n            {\n                UpdateParameterValidationStatus(node.Condition);\n\n                base.VisitIfStatement(node);\n            }\n\n            public override void VisitConditionalExpression(ConditionalExpressionSyntax node)\n            {\n                UpdateParameterValidationStatus(node.Condition);\n\n                base.VisitConditionalExpression(node);\n            }\n\n            public override void VisitSwitchStatement(SwitchStatementSyntax node)\n            {\n                UpdateParameterValidationStatus(node.Expression);\n\n                base.VisitSwitchStatement(node);\n            }\n\n            public override void VisitBinaryExpression(BinaryExpressionSyntax node)\n            {\n                if (node.IsKind(SyntaxKind.CoalesceExpression))\n                {\n                    UpdateParameterValidationStatus(node.Left);\n                }\n\n                base.VisitBinaryExpression(node);\n            }\n\n            public override void VisitAssignmentExpression(AssignmentExpressionSyntax node)\n            {\n                if (node.IsKind(SyntaxKindEx.CoalesceAssignmentExpression))\n                {\n                    UpdateParameterValidationStatus(node.Left);\n                }\n\n                base.VisitAssignmentExpression(node);\n            }\n\n            public override void Visit(SyntaxNode node)\n            {\n                if (node.IsKind(SyntaxKindEx.SwitchExpression))\n                {\n                    UpdateParameterValidationStatus(((SwitchExpressionSyntaxWrapper)node).GoverningExpression);\n                }\n\n                if (node.IsKind(SyntaxKindEx.SwitchExpressionArm))\n                {\n                    var arm = (SwitchExpressionArmSyntaxWrapper)node;\n\n                    if (arm.Pattern.SyntaxNode != null)\n                    {\n                        UpdateParameterValidationStatus(arm.Pattern);\n                    }\n\n                    if (arm.WhenClause.SyntaxNode != null)\n                    {\n                        UpdateParameterValidationStatus(arm.WhenClause);\n                    }\n                }\n\n                base.Visit(node);\n            }\n\n            private void UpdateParameterValidationStatus(SyntaxNode node) =>\n                HasParametersUsedInConditionalConstructs |= node\n                    .DescendantNodesAndSelf()\n                    .OfType<IdentifierNameSyntax>()\n                    .Where(identifier => parameterNames.Contains(identifier.Identifier.Text))\n                    .Select(identifier => semanticModel.GetSymbolInfo(identifier).Symbol)\n                    .Any(symbol => symbol != null);\n        }\n\n        private sealed class ConstructorInfo\n        {\n            private readonly ConstructorDeclarationSyntax declarationSyntax;\n\n            public ConstructorInfo(ConstructorDeclarationSyntax declaration,\n                bool hasConditionalConstructs,\n                bool isDeserializationConstructor)\n            {\n                declarationSyntax = declaration;\n                HasConditionalConstructs = hasConditionalConstructs;\n                IsDeserializationConstructor = isDeserializationConstructor;\n            }\n\n            public bool HasConditionalConstructs { get; }\n\n            public bool IsDeserializationConstructor { get; }\n\n            public Location GetReportLocation() =>\n                declarationSyntax.Identifier.GetLocation();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/Hotspots/PermissiveCors.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class PermissiveCors : TrackerHotspotDiagnosticAnalyzer<SyntaxKind>\n    {\n        private const string DiagnosticId = \"S5122\";\n        private const string MessageFormat = \"Make sure this permissive CORS policy is safe here.\";\n        private const string AccessControlAllowOriginHeader = \"Access-Control-Allow-Origin\";\n        private const string AccessControlAllowOriginPropertyName = \"AccessControlAllowOrigin\";\n        private const string StarConstant = \"*\";\n\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n        public PermissiveCors() : base(AnalyzerConfiguration.Hotspot, DiagnosticId, MessageFormat) { }\n\n        public PermissiveCors(IAnalyzerConfiguration configuration) : base(configuration, DiagnosticId, MessageFormat) { }\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            base.Initialize(context);\n\n            context.RegisterCompilationStartAction(c =>\n            {\n                if (IsEnabled(c.Options))\n                {\n                    c.RegisterNodeAction(VisitAttribute, SyntaxKind.Attribute);\n                }\n            });\n        }\n\n        protected override void Initialize(TrackerInput input)\n        {\n            SetupInvocationTracker(Language.Tracker.Invocation, input);\n            SetupObjectCreationTracker(Language.Tracker.ObjectCreation, input);\n        }\n\n        private static void SetupInvocationTracker(InvocationTracker<SyntaxKind> tracker, TrackerInput input)\n        {\n            const int parameterCount = 2;\n\n            tracker.Track(\n                input,\n                tracker.MatchMethod(new MemberDescriptor(KnownType.System_Collections_Generic_IDictionary_TKey_TValue, \"Add\")),\n                tracker.MethodHasParameters(parameterCount),\n                c => IsFirstArgumentAccessControlAllowOrigin((InvocationExpressionSyntax)c.Node, c.Model)\n                    && IsSecondArgumentStarString((InvocationExpressionSyntax)c.Node, c.Model),\n                tracker.IsIHeadersDictionary());\n\n            tracker.Track(\n                input,\n                tracker.MatchMethod(new MemberDescriptor(KnownType.Microsoft_AspNetCore_Http_HeaderDictionaryExtensions, \"Append\"),\n                                    new MemberDescriptor(KnownType.System_Web_HttpResponse, \"AppendHeader\"),\n                                    new MemberDescriptor(KnownType.System_Web_HttpResponseBase, \"AddHeader\"),\n                                    new MemberDescriptor(KnownType.System_Collections_Specialized_NameValueCollection, \"Add\"),\n                                    new MemberDescriptor(KnownType.System_Net_Http_Headers_HttpHeaders, \"Add\")),\n                tracker.MethodHasParameters(parameterCount),\n                c => IsFirstArgumentAccessControlAllowOrigin((InvocationExpressionSyntax)c.Node, c.Model)\n                    && IsSecondArgumentStarString((InvocationExpressionSyntax)c.Node, c.Model));\n\n            tracker.Track(\n                input,\n                tracker.MatchMethod(new MemberDescriptor(KnownType.Microsoft_AspNetCore_Cors_Infrastructure_CorsPolicyBuilder, \"WithOrigins\")),\n                c => ContainsStar(((InvocationExpressionSyntax)c.Node).ArgumentList.Arguments.Select(a => a.Expression), c.Model));\n\n            tracker.Track(\n                input,\n                tracker.MatchMethod(new MemberDescriptor(KnownType.Microsoft_AspNetCore_Cors_Infrastructure_CorsPolicyBuilder, \"AllowAnyOrigin\")));\n        }\n\n        private static void SetupObjectCreationTracker(ObjectCreationTracker<SyntaxKind> tracker, TrackerInput input) =>\n            tracker.Track(\n                input,\n                tracker.MatchConstructor(KnownType.Microsoft_AspNetCore_Cors_Infrastructure_CorsPolicyBuilder),\n                c => ContainsStar(ObjectCreationFactory.Create(c.Node), c.Model));\n\n        private void VisitAttribute(SonarSyntaxNodeReportingContext context)\n        {\n            var attribute = (AttributeSyntax)context.Node;\n            if (attribute.IsKnownType(KnownType.System_Web_Http_Cors_EnableCorsAttribute, context.Model)\n                && IsStar(attribute.ArgumentList.Arguments[0].Expression, context.Model))\n            {\n                context.ReportIssue(Rule, attribute);\n            }\n        }\n\n        private static bool IsFirstArgumentAccessControlAllowOrigin(InvocationExpressionSyntax invocation, SemanticModel semanticModel) =>\n            invocation.ArgumentList.Arguments.First().Expression switch\n            {\n                InterpolatedStringExpressionSyntax interpolation => interpolation.FindStringConstant(semanticModel) == AccessControlAllowOriginHeader,\n                LiteralExpressionSyntax literal => literal.Token.ValueText == AccessControlAllowOriginHeader,\n                MemberAccessExpressionSyntax memberAccess => IsAccessControlAllowOriginProperty(memberAccess, semanticModel),\n                _ => false\n            };\n\n        private static bool IsAccessControlAllowOriginProperty(MemberAccessExpressionSyntax memberAccess, SemanticModel semanticModel) =>\n            memberAccess.Name.Identifier.Text == AccessControlAllowOriginPropertyName\n            && memberAccess.Expression.IsKnownType(KnownType.Microsoft_Net_Http_Headers_HeaderNames, semanticModel);\n\n        private static bool IsSecondArgumentStarString(InvocationExpressionSyntax invocation, SemanticModel semanticModel) =>\n            IsStar(invocation.ArgumentList.Arguments[1].Expression, semanticModel);\n\n        private static bool IsStar(ExpressionSyntax expressionSyntax, SemanticModel model) =>\n            expressionSyntax switch\n            {\n                InterpolatedStringExpressionSyntax interpolation => interpolation.FindStringConstant(model) == StarConstant,\n                LiteralExpressionSyntax literal => ContainsStar(model.GetConstantValue(literal)),\n                IdentifierNameSyntax identifier => ContainsStar(model.GetConstantValue(identifier)),\n                ImplicitArrayCreationExpressionSyntax arrayCreation => ContainsStar(arrayCreation.Initializer.Expressions, model),\n                { } objectCreation when objectCreation.Kind() is SyntaxKind.ObjectCreationExpression or SyntaxKindEx.ImplicitObjectCreationExpression =>\n                    ContainsStar(ObjectCreationFactory.Create(objectCreation), model),\n                _ => false\n            };\n\n        private static bool ContainsStar(IEnumerable<ExpressionSyntax> expressions, SemanticModel semanticModel) =>\n            expressions.Any(expression => ContainsStar(semanticModel.GetConstantValue(expression)));\n\n        private static bool ContainsStar(Optional<object> constantValue) =>\n            constantValue is {HasValue: true, Value: StarConstant};\n\n        private static bool ContainsStar(IObjectCreation objectCreation, SemanticModel semanticModel) =>\n            objectCreation.ArgumentList is { } argumentList\n            && (objectCreation.IsKnownType(KnownType.Microsoft_Extensions_Primitives_StringValues, semanticModel)\n                || objectCreation.IsKnownType(KnownType.Microsoft_AspNetCore_Cors_Infrastructure_CorsPolicyBuilder, semanticModel))\n            && argumentList.Arguments.Any(argument => IsStar(argument.Expression, semanticModel));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/Hotspots/PubliclyWritableDirectories.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class PubliclyWritableDirectories : PubliclyWritableDirectoriesBase<SyntaxKind, InvocationExpressionSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n        public PubliclyWritableDirectories() : this(AnalyzerConfiguration.Hotspot) { }\n\n        internal PubliclyWritableDirectories(IAnalyzerConfiguration configuration) : base(configuration) { }\n\n        private protected override bool IsGetTempPathAssignment(InvocationExpressionSyntax invocationExpression, KnownType type, string methodName, SemanticModel semanticModel) =>\n            invocationExpression.IsMethodInvocation(type, methodName, semanticModel)\n            && invocationExpression.Parent?.Kind() is\n                SyntaxKind.EqualsValueClause or SyntaxKind.SimpleAssignmentExpression or SyntaxKind.ArrowExpressionClause or SyntaxKind.ReturnStatement;\n\n        private protected override bool IsInsecureEnvironmentVariableRetrieval(InvocationExpressionSyntax invocation, KnownType type, string methodName, SemanticModel semanticModel) =>\n            invocation.IsMethodInvocation(type, methodName, semanticModel)\n            && invocation.ArgumentList?.Arguments.FirstOrDefault() is { } firstArgument\n            && InsecureEnvironmentVariables.Any(x => x.Equals(firstArgument.Expression?.StringValue(semanticModel), StringComparison.OrdinalIgnoreCase));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/Hotspots/RequestsWithExcessiveLength.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class RequestsWithExcessiveLength : RequestsWithExcessiveLengthBase<SyntaxKind, AttributeSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n        public RequestsWithExcessiveLength() : this(SonarAnalyzer.Core.Common.AnalyzerConfiguration.Hotspot) { }\n\n        internal RequestsWithExcessiveLength(IAnalyzerConfiguration analyzerConfiguration) : base(analyzerConfiguration) { }\n\n        protected override void Initialize(SonarParametrizedAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var methodDeclaration = (MethodDeclarationSyntax)c.Node;\n                    var body = methodDeclaration.GetBodyOrExpressionBody();\n\n                    if (body is not null\n                        && body.DescendantNodes()\n                               .OfType<InvocationExpressionSyntax>()\n                               .Any(x => x.IsMethodInvocation(KnownType.Microsoft_AspNetCore_Components_Forms_IBrowserFile, \"OpenReadStream\", c.Model)))\n                    {\n                        var walker = new StreamReadSizeCheck(c.Model, FileUploadSizeLimit);\n                        if (walker.SafeVisit(body))\n                        {\n                            foreach (var location in walker.Locations)\n                            {\n                                c.ReportIssue(Rule, location);\n                            }\n                        }\n                    }\n                }, SyntaxKind.MethodDeclaration);\n\n            base.Initialize(context);\n        }\n\n        protected override AttributeSyntax IsInvalidRequestFormLimits(AttributeSyntax attribute, SemanticModel semanticModel) =>\n            IsRequestFormLimits(attribute.Name.ToString())\n            && attribute.ArgumentList?.Arguments.FirstOrDefault(arg => IsMultipartBodyLengthLimit(arg)) is { } firstArgument\n            && semanticModel.GetConstantValue(firstArgument.Expression) is { HasValue: true } constantValue\n            && constantValue.Value is int intValue\n            && intValue > FileUploadSizeLimit\n            && attribute.IsKnownType(KnownType.Microsoft_AspNetCore_Mvc_RequestFormLimitsAttribute, semanticModel)\n                ? attribute\n                : null;\n\n        protected override AttributeSyntax IsInvalidRequestSizeLimit(AttributeSyntax attribute, SemanticModel semanticModel) =>\n            IsRequestSizeLimit(attribute.Name.ToString())\n            && attribute.ArgumentList?.Arguments.FirstOrDefault() is { } firstArgument\n            && semanticModel.GetConstantValue(firstArgument.Expression) is { HasValue: true } constantValue\n            && constantValue.Value is int intValue\n            && intValue > FileUploadSizeLimit\n            && attribute.IsKnownType(KnownType.Microsoft_AspNetCore_Mvc_RequestSizeLimitAttribute, semanticModel)\n                ? attribute\n                : null;\n\n        protected override SyntaxNode GetMethodLocalFunctionOrClassDeclaration(AttributeSyntax attribute) =>\n            attribute.FirstAncestorOrSelf<SyntaxNode>(node => node is MemberDeclarationSyntax || LocalFunctionStatementSyntaxWrapper.IsInstance(node));\n\n        protected override string AttributeName(AttributeSyntax attribute) =>\n            attribute.Name.ToString();\n\n        private static bool IsMultipartBodyLengthLimit(AttributeArgumentSyntax argument) =>\n            argument.NameEquals is { } nameEquals\n            && nameEquals.Name.Identifier.ValueText.Equals(MultipartBodyLengthLimit);\n\n        private sealed class StreamReadSizeCheck(SemanticModel model, int fileUploadSizeLimit) : SafeCSharpSyntaxWalker\n        {\n            private const int GetMultipleFilesMaximumFileCount = 10; // Default value for `maximumFileCount` in `InputFileChangeEventArgs.GetMultipleFiles` is 10\n            private int numberOfFiles = 1;\n\n            public List<Location> Locations { get; } = new();\n\n            public override void VisitInvocationExpression(InvocationExpressionSyntax node)\n            {\n                if (node.IsMethodInvocation(KnownType.Microsoft_AspNetCore_Components_Forms_InputFileChangeEventArgs, \"GetMultipleFiles\", model))\n                {\n                    numberOfFiles = node.ArgumentList.Arguments.FirstOrDefault() is { } firstArgument\n                                    && model.GetConstantValue(firstArgument.Expression) is { HasValue: true } constantValue\n                                    && Convert.ToInt32(constantValue.Value) is var count\n                                        ? count\n                                        : GetMultipleFilesMaximumFileCount;\n                }\n                if (node.IsMethodInvocation(KnownType.Microsoft_AspNetCore_Components_Forms_IBrowserFile, \"OpenReadStream\", model))\n                {\n                    var size = OpenReadStreamInvocationSize(node, model);\n                    if (numberOfFiles * size > fileUploadSizeLimit)\n                    {\n                        Locations.Add(node.GetLocation());\n                    }\n                }\n\n                base.VisitInvocationExpression(node);\n            }\n\n            private static long OpenReadStreamInvocationSize(InvocationExpressionSyntax invocation, SemanticModel model) =>\n                invocation.ArgumentList.Arguments.FirstOrDefault() is { } firstArgument\n                && model.GetConstantValue(firstArgument.Expression) is { HasValue: true } constantValue\n                && Convert.ToInt64(constantValue.Value) is var size\n                    ? size\n                    : 500 * 1024; // Default `maxAllowedSize` in `IBrowserFile.OpenReadStream` is 500 KB\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/Hotspots/SpecifyTimeoutOnRegex.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class SpecifyTimeoutOnRegex : SpecifyTimeoutOnRegexBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    public SpecifyTimeoutOnRegex() : this(AnalyzerConfiguration.Hotspot) { }\n\n    internal /*for testing*/ SpecifyTimeoutOnRegex(IAnalyzerConfiguration config) : base(config) { }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/Hotspots/UnsafeCodeBlocks.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class UnsafeCodeBlocks : HotspotDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S6640\";\n    private const string MessageFormat = \"\"\"Make sure that using \"unsafe\" is safe here.\"\"\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public UnsafeCodeBlocks() : this(AnalyzerConfiguration.Hotspot) { }\n\n    public UnsafeCodeBlocks(IAnalyzerConfiguration configuration) : base(configuration) { }\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(\n            c => Report(c, ((UnsafeStatementSyntax)c.Node).UnsafeKeyword),\n            SyntaxKind.UnsafeStatement);\n        context.RegisterNodeAction(\n            c => ReportIfUnsafe(c, ((BaseTypeDeclarationSyntax)c.Node).Modifiers),\n            SyntaxKind.ClassDeclaration, SyntaxKind.InterfaceDeclaration, SyntaxKind.StructDeclaration, SyntaxKindEx.RecordDeclaration, SyntaxKindEx.RecordStructDeclaration);\n        context.RegisterNodeAction(\n            c => ReportIfUnsafe(c, ((BaseMethodDeclarationSyntax)c.Node).Modifiers),\n            SyntaxKind.MethodDeclaration, SyntaxKind.ConstructorDeclaration, SyntaxKind.DestructorDeclaration, SyntaxKind.OperatorDeclaration);\n        context.RegisterNodeAction(\n            c => ReportIfUnsafe(c, ((LocalFunctionStatementSyntaxWrapper)c.Node).Modifiers),\n            SyntaxKindEx.LocalFunctionStatement);\n        context.RegisterNodeAction(\n            c => ReportIfUnsafe(c, ((BaseFieldDeclarationSyntax)c.Node).Modifiers),\n            SyntaxKind.FieldDeclaration, SyntaxKind.EventFieldDeclaration);\n        context.RegisterNodeAction(\n            c => ReportIfUnsafe(c, ((BasePropertyDeclarationSyntax)c.Node).Modifiers),\n            SyntaxKind.PropertyDeclaration, SyntaxKind.IndexerDeclaration);\n        context.RegisterNodeAction(\n            c => ReportIfUnsafe(c, ((DelegateDeclarationSyntax)c.Node).Modifiers),\n            SyntaxKind.DelegateDeclaration);\n    }\n\n    private void ReportIfUnsafe(SonarSyntaxNodeReportingContext context, SyntaxTokenList modifiers)\n    {\n        if (modifiers.Find(SyntaxKind.UnsafeKeyword) is { } unsafeModifier)\n        {\n            Report(context, unsafeModifier);\n        }\n    }\n\n    private void Report(SonarSyntaxNodeReportingContext context, SyntaxToken token)\n    {\n        if (IsEnabled(context.Options))\n        {\n            context.ReportIssue(Rule, token);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/Hotspots/UsingNonstandardCryptography.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class UsingNonstandardCryptography : UsingNonstandardCryptographyBase<SyntaxKind, TypeDeclarationSyntax>\n    {\n        protected override ILanguageFacade Language => CSharpFacade.Instance;\n\n        protected override SyntaxKind[] SyntaxKinds { get; } =\n        {\n            SyntaxKind.ClassDeclaration,\n            SyntaxKind.InterfaceDeclaration,\n            SyntaxKindEx.RecordDeclaration,\n            SyntaxKindEx.RecordStructDeclaration,\n            SyntaxKind.StructDeclaration\n        };\n\n        public UsingNonstandardCryptography() : this(AnalyzerConfiguration.Hotspot) { }\n\n        public UsingNonstandardCryptography(IAnalyzerConfiguration analyzerConfiguration) : base(analyzerConfiguration) { }\n\n        protected override INamedTypeSymbol DeclaredSymbol(TypeDeclarationSyntax typeDeclarationSyntax, SemanticModel semanticModel) =>\n            semanticModel.GetDeclaredSymbol(typeDeclarationSyntax);\n\n        protected override Location Location(TypeDeclarationSyntax typeDeclarationSyntax) =>\n            typeDeclarationSyntax.Identifier.GetLocation();\n\n        protected override bool DerivesOrImplementsAny(TypeDeclarationSyntax typeDeclarationSyntax) =>\n            typeDeclarationSyntax.BaseList != null && typeDeclarationSyntax.BaseList.Types.Any();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/IdentifiersNamedExtensionShouldBeEscaped.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class IdentifiersNamedExtensionShouldBeEscaped : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S8368\";\n    private const string MessageFormat = \"'extension' is a contextual keyword in C# 14. Rename it or escape it as '@extension' to avoid ambiguity.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(compilationStart =>\n            {\n                if (compilationStart.Compilation.IsAtLeastLanguageVersion(LanguageVersionEx.CSharp14))\n                {\n                    return;\n                }\n\n                compilationStart.RegisterNodeAction(\n                    c =>\n                    {\n                        if (c.Node.GetIdentifier() is { } id && IsExtensionToken(id))\n                        {\n                            c.ReportIssue(Rule, id);\n                        }\n                    },\n                    SyntaxKind.ClassDeclaration,\n                    SyntaxKind.StructDeclaration,\n                    SyntaxKind.InterfaceDeclaration,\n                    SyntaxKind.EnumDeclaration,\n                    SyntaxKind.DelegateDeclaration,\n                    SyntaxKind.TypeParameter,\n                    SyntaxKind.ConstructorDeclaration,\n                    SyntaxKind.UsingDirective,\n                    SyntaxKindEx.RecordDeclaration,\n                    SyntaxKindEx.RecordStructDeclaration);\n\n                compilationStart.RegisterNodeAction(c =>\n                    {\n                        if (c.Node.TypeSyntax()?.Unwrap() is { } type and not (QualifiedNameSyntax or AliasQualifiedNameSyntax)\n                            && type.GetIdentifier() is { } id\n                            && IsExtensionToken(id))\n                        {\n                            c.ReportIssue(Rule, id);\n                        }\n                    },\n                    SyntaxKind.FieldDeclaration,\n                    SyntaxKind.IndexerDeclaration,\n                    SyntaxKind.MethodDeclaration,\n                    SyntaxKind.OperatorDeclaration,\n                    SyntaxKind.PropertyDeclaration);\n            });\n\n    private static bool IsExtensionToken(SyntaxToken token) =>\n        token.ValueText == \"extension\" && !token.Text.StartsWith(\"@\", StringComparison.Ordinal);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/IdentifiersNamedFieldShouldBeEscaped.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class IdentifiersNamedFieldShouldBeEscaped : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S8367\";\n    private const string MessageFormat = \"'field' is a contextual keyword in C# 14. Rename it, escape it as '@field', or qualify member access as 'this.field' to avoid ambiguity.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(compilationStart =>\n            {\n                if (!compilationStart.Compilation.IsAtLeastLanguageVersion(LanguageVersionEx.CSharp14))\n                {\n                    compilationStart.RegisterCodeBlockStartAction<SyntaxKind>(CSharpGeneratedCodeRecognizer.Instance, cb =>\n                        {\n                            if ((cb.CodeBlock is AccessorDeclarationSyntax { Parent.Parent: PropertyDeclarationSyntax } accessor\n                                    && accessor.Kind() is SyntaxKind.GetAccessorDeclaration or SyntaxKind.SetAccessorDeclaration or SyntaxKindEx.InitAccessorDeclaration)\n                                || cb.CodeBlock is ArrowExpressionClauseSyntax { Parent: PropertyDeclarationSyntax })\n                            {\n                                RegisterForPropertyBody(cb);\n                            }\n                        });\n                }\n            });\n\n    private static void RegisterForPropertyBody(SonarCodeBlockStartAnalysisContext<SyntaxKind> cb)\n    {\n        // Report local variable declarations, local functions, loop variables, catch variables, LINQ range variables, pattern/deconstruction variables, and parameters named 'field'.\n        cb.RegisterNodeAction(\n            c =>\n            {\n                if (c.Node.GetIdentifier() is { } identifier && IsFieldToken(identifier))\n                {\n                    c.ReportIssue(Rule, identifier);\n                }\n            },\n            SyntaxKind.VariableDeclarator,\n            SyntaxKind.ForEachStatement,\n            SyntaxKind.CatchDeclaration,\n            SyntaxKind.FromClause,\n            SyntaxKind.LetClause,\n            SyntaxKind.JoinClause,\n            SyntaxKind.JoinIntoClause,\n            SyntaxKind.QueryContinuation,\n            SyntaxKindEx.SingleVariableDesignation,\n            SyntaxKindEx.LocalFunctionStatement,\n            SyntaxKind.Parameter);\n\n        // Report unqualified references to a named symbol 'field' (class members, types, namespaces, …).\n        // Exclude locally-declared symbols (locals, parameters, range variables) — reported at their declaration site above.\n        cb.RegisterNodeAction(\n            c =>\n            {\n                if (c.Node is IdentifierNameSyntax { Identifier: var identifier, Parent: { } parent } identifierName\n                    && IsFieldToken(identifier)\n                    && parent is not MemberBindingExpressionSyntax\n                    && !(parent is MemberAccessExpressionSyntax mae && mae.Name == identifierName)\n                    && c.Model.GetSymbolInfo(identifierName).Symbol is not (null or ILocalSymbol or IParameterSymbol or IRangeVariableSymbol))\n                {\n                    c.ReportIssue(Rule, identifier);\n                }\n            },\n            SyntaxKind.IdentifierName);\n    }\n\n    private static bool IsFieldToken(SyntaxToken token) =>\n        token.ValueText == \"field\" && !token.Text.StartsWith(\"@\", StringComparison.Ordinal);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/IfChainWithoutElse.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class IfChainWithoutElse : IfChainWithoutElseBase<SyntaxKind, IfStatementSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n        protected override SyntaxKind SyntaxKind => SyntaxKind.IfStatement;\n        protected override string ElseClause => \"else\";\n\n        protected override bool IsElseIfWithoutElse(IfStatementSyntax ifSyntax) =>\n           ifSyntax.Parent.IsKind(SyntaxKind.ElseClause)\n           && (ifSyntax.Else == null || IsEmptyBlock(ifSyntax.Else));\n\n        protected override Location IssueLocation(SonarSyntaxNodeReportingContext context, IfStatementSyntax ifSyntax)\n        {\n            var parentElse = (ElseClauseSyntax)ifSyntax.Parent;\n            var diff = ifSyntax.IfKeyword.Span.End - parentElse.ElseKeyword.SpanStart;\n            return Location.Create(context.Node.SyntaxTree, new TextSpan(parentElse.ElseKeyword.SpanStart, diff));\n        }\n\n        private static bool IsEmptyBlock(ElseClauseSyntax elseClause) =>\n            elseClause.Statement is BlockSyntax blockSyntax\n            && !(blockSyntax.Statements.Count > 0 || blockSyntax.DescendantTrivia().Any(x => x.IsComment() || x.IsKind(SyntaxKind.DisabledTextTrivia)));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/IfCollapsible.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class IfCollapsible : IfCollapsibleBase\n{\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            c =>\n            {\n                var ifStatement = (IfStatementSyntax)c.Node;\n\n                if (ifStatement.Else is not null)\n                {\n                    return;\n                }\n\n                var parentIfStatement = ParentIfStatement(ifStatement);\n                if (parentIfStatement is { Else: null }\n                    && !ContainsDynamicReference(ifStatement, c.Model))\n                {\n                    c.ReportIssue(Rule, ifStatement.IfKeyword, [parentIfStatement.IfKeyword.ToSecondaryLocation(SecondaryMessage)]);\n                }\n            },\n            SyntaxKind.IfStatement);\n\n    private static bool ContainsDynamicReference(IfStatementSyntax ifStatement, SemanticModel model) =>\n        ifStatement.Condition.DescendantNodes().Any(x => x is ExpressionSyntax && x.IsDynamic(model));\n\n    private static IfStatementSyntax ParentIfStatement(IfStatementSyntax ifStatement)\n    {\n        var parent = ifStatement.Parent;\n\n        while (parent.IsKind(SyntaxKind.Block))\n        {\n            var block = (BlockSyntax)parent;\n\n            if (block.Statements.Count != 1)\n            {\n                return null;\n            }\n\n            parent = parent.Parent;\n        }\n\n        return parent as IfStatementSyntax;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ImplementIDisposableCorrectly.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class ImplementIDisposableCorrectly : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S3881\";\n        private const string MessageFormat = \"Fix this implementation of 'IDisposable' to conform to the dispose pattern.\";\n\n        private static readonly ISet<SyntaxKind> NotAllowedDisposeModifiers = new HashSet<SyntaxKind>\n        {\n            SyntaxKind.VirtualKeyword,\n            SyntaxKind.AbstractKeyword\n        };\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n                {\n                    if (c.IsRedundantPositionalRecordContext())\n                    {\n                        return;\n                    }\n\n                    var typeDeclarationSyntax = (TypeDeclarationSyntax)c.Node;\n                    var declarationIdentifier = typeDeclarationSyntax.Identifier;\n                    var checker = new DisposableChecker(typeDeclarationSyntax.BaseList,\n                                                        declarationIdentifier,\n                                                        c.Model.GetDeclaredSymbol(typeDeclarationSyntax),\n                                                        c.Node.GetDeclarationTypeName(),\n                                                        c.Model);\n\n                    var locations = checker.GetIssueLocations(typeDeclarationSyntax);\n                    if (locations.Any())\n                    {\n                        c.ReportIssue(Rule, declarationIdentifier, locations);\n                    }\n                },\n                SyntaxKind.ClassDeclaration,\n                SyntaxKindEx.RecordDeclaration);\n\n        private sealed class DisposableChecker\n        {\n            private readonly SemanticModel semanticModel;\n            private readonly List<SecondaryLocation> secondaryLocations = new List<SecondaryLocation>();\n            private readonly BaseListSyntax baseTypes;\n            private readonly SyntaxToken typeIdentifier;\n            private readonly INamedTypeSymbol typeSymbol;\n            private readonly string nodeType;\n\n            public DisposableChecker(BaseListSyntax baseTypes, SyntaxToken typeIdentifier, INamedTypeSymbol typeSymbol, string nodeType, SemanticModel semanticModel)\n            {\n                this.baseTypes = baseTypes;\n                this.typeIdentifier = typeIdentifier;\n                this.typeSymbol = typeSymbol;\n                this.nodeType = nodeType;\n                this.semanticModel = semanticModel;\n            }\n\n            public List<SecondaryLocation> GetIssueLocations(TypeDeclarationSyntax typeDeclarationSyntax)\n            {\n                if (typeSymbol == null || typeSymbol.IsSealed)\n                {\n                    return new List<SecondaryLocation>();\n                }\n\n                if (typeSymbol.BaseType.Implements(KnownType.System_IDisposable))\n                {\n                    var iDisposableInterfaceSyntax = baseTypes?.Types.FirstOrDefault(IsOrImplementsIDisposable);\n                    if (iDisposableInterfaceSyntax != null)\n                    {\n                        AddSecondaryLocation(iDisposableInterfaceSyntax.GetLocation(),\n                                             $\"Remove 'IDisposable' from the list of interfaces implemented by '{typeSymbol.Name}'\"\n                                             + $\" and override the base {nodeType} 'Dispose' implementation instead.\");\n                    }\n\n                    if (HasVirtualDisposeBool(typeSymbol.BaseType))\n                    {\n                        VerifyDisposeOverrideCallsBase(FindMethodImplementationOrAbstractDeclaration(typeSymbol, IsDisposeBool, typeDeclarationSyntax)\n                                                       .OfType<MethodDeclarationSyntax>()\n                                                       .FirstOrDefault());\n                    }\n\n                    return secondaryLocations;\n                }\n\n                if (typeSymbol.Implements(KnownType.System_IDisposable))\n                {\n                    if (!FindMethodDeclarations(typeSymbol, IsDisposeBool).Any())\n                    {\n                        AddSecondaryLocation(typeIdentifier.GetLocation(),\n                                             $\"Provide 'protected' overridable implementation of 'Dispose(bool)' on \"\n                                             + $\"'{typeSymbol.Name}' or mark the type as 'sealed'.\");\n                    }\n\n                    var destructor = FindMethodImplementationOrAbstractDeclaration(typeSymbol, x => x.IsDestructor(), typeDeclarationSyntax)\n                        .OfType<DestructorDeclarationSyntax>()\n                        .FirstOrDefault();\n\n                    VerifyDestructor(destructor);\n\n                    var disposeMethod = FindMethodImplementationOrAbstractDeclaration(typeSymbol, KnownMethods.IsIDisposableDispose, typeDeclarationSyntax)\n                                        .OfType<MethodDeclarationSyntax>()\n                                        .FirstOrDefault();\n\n                    VerifyDispose(disposeMethod, typeSymbol.IsSealed);\n                }\n\n                return secondaryLocations;\n            }\n\n            private void AddSecondaryLocation(Location location, string message) =>\n                secondaryLocations.Add(new SecondaryLocation(location, message));\n\n            private void VerifyDestructor(DestructorDeclarationSyntax destructorSyntax)\n            {\n                if (!destructorSyntax.HasBodyOrExpressionBody())\n                {\n                    return;\n                }\n\n                if (!HasStatementsCount(destructorSyntax, 1) || !CallsVirtualDispose(destructorSyntax, argumentValue: a => IsLiteralArgument(a, SyntaxKind.FalseKeyword)))\n                {\n                    AddSecondaryLocation(destructorSyntax.Identifier.GetLocation(),\n                                         $\"Modify '{typeSymbol.Name}.~{typeSymbol.Name}()' so that it calls 'Dispose(false)' and \"\n                                         + \"then returns.\");\n                }\n            }\n\n            private void VerifyDisposeOverrideCallsBase(MethodDeclarationSyntax disposeMethod)\n            {\n                if (!disposeMethod.HasBodyOrExpressionBody())\n                {\n                    return;\n                }\n\n                var parameterName = disposeMethod.ParameterList.Parameters.Single().Identifier.Text;\n\n                if (!CallsVirtualDispose(disposeMethod, argumentValue: a => a is { Expression: IdentifierNameSyntax { Identifier.Text: { } text } } && text == parameterName))\n                {\n                    AddSecondaryLocation(disposeMethod.Identifier.GetLocation(), $\"Modify 'Dispose({parameterName})' so that it calls 'base.Dispose({parameterName})'.\");\n                }\n            }\n\n            private void VerifyDispose(MethodDeclarationSyntax disposeMethod, bool isSealedClass)\n            {\n                if (disposeMethod == null)\n                {\n                    return;\n                }\n\n                if (disposeMethod.HasBodyOrExpressionBody() && !isSealedClass)\n                {\n                    var missingVirtualDispose = !CallsVirtualDispose(disposeMethod, argumentValue: a => IsLiteralArgument(a, SyntaxKind.TrueKeyword));\n                    var missingSuppressFinalize = !CallsSuppressFinalize(disposeMethod);\n                    string remediation = null;\n\n                    if (missingVirtualDispose && missingSuppressFinalize)\n                    {\n                        remediation = \"should call 'Dispose(true)' and 'GC.SuppressFinalize(this)'.\";\n                    }\n                    else if (missingVirtualDispose)\n                    {\n                        remediation = \"should also call 'Dispose(true)'.\";\n                    }\n                    else if (missingSuppressFinalize)\n                    {\n                        remediation = \"should also call 'GC.SuppressFinalize(this)'.\";\n                    }\n                    else if (!HasStatementsCount(disposeMethod, 2))\n                    {\n                        remediation = \"should call 'Dispose(true)', 'GC.SuppressFinalize(this)' and nothing else.\";\n                    }\n\n                    if (remediation != null)\n                    {\n                        AddSecondaryLocation(disposeMethod.Identifier.GetLocation(), $\"'{typeSymbol.Name}.Dispose()' {remediation}\");\n                    }\n                }\n\n                // Because of partial classes we cannot always rely on the current semantic model.\n                // See issue: https://github.com/SonarSource/sonar-dotnet/issues/690\n                var disposeMethodSymbol = disposeMethod.SyntaxTree.SemanticModelOrDefault(semanticModel)?.GetDeclaredSymbol(disposeMethod);\n                if (disposeMethodSymbol == null)\n                {\n                    return;\n                }\n\n                if (disposeMethodSymbol.IsAbstract || disposeMethodSymbol.IsVirtual)\n                {\n                    var modifier = disposeMethod.Modifiers\n                                                .FirstOrDefault(m => m.IsAnyKind(NotAllowedDisposeModifiers));\n\n                    AddSecondaryLocation(modifier.GetLocation(), $\"'{typeSymbol.Name}.Dispose()' should not be 'virtual' or 'abstract'.\");\n                }\n\n                if (disposeMethodSymbol.ExplicitInterfaceImplementations.Any())\n                {\n                    AddSecondaryLocation(disposeMethod.Identifier.GetLocation(), $\"'{typeSymbol.Name}.Dispose()' should be 'public'.\");\n                }\n            }\n\n            private bool IsOrImplementsIDisposable(BaseTypeSyntax baseType) =>\n                (semanticModel.GetSymbolInfo(baseType.Type).Symbol as INamedTypeSymbol).Is(KnownType.System_IDisposable);\n\n            private bool CallsSuppressFinalize(BaseMethodDeclarationSyntax methodDeclaration) =>\n                methodDeclaration.ContainsMethodInvocation(semanticModel,\n                    method => method.Expression.NameIs(nameof(GC.SuppressFinalize))\n                        && method is { ArgumentList.Arguments: { Count: 1 } arguments }\n                        && arguments[0] is { Expression: ThisExpressionSyntax },\n                    KnownMethods.IsGcSuppressFinalize);\n\n            private bool CallsVirtualDispose(BaseMethodDeclarationSyntax methodDeclaration, Func<ArgumentSyntax, bool> argumentValue) =>\n                methodDeclaration.ContainsMethodInvocation(semanticModel,\n                    method => method.Expression.NameIs(nameof(IDisposable.Dispose))\n                        && method is { ArgumentList.Arguments: { Count: 1 } arguments }\n                        && arguments[0] is var argument\n                        && argumentValue(argument),\n                    IsDisposeBool);\n\n            private static bool IsDisposeBool(IMethodSymbol method) =>\n                method.Name == nameof(IDisposable.Dispose)\n                && (method.IsVirtual || method.IsAbstract || method.IsOverride)\n                && method.DeclaredAccessibility == Accessibility.Protected\n                && method.Parameters.Length == 1\n                && method.Parameters.Any(p => p.Type.Is(KnownType.System_Boolean));\n\n            private static bool HasStatementsCount(BaseMethodDeclarationSyntax methodDeclaration, int expectedStatementsCount) =>\n                methodDeclaration.Body?.Statements.Count == expectedStatementsCount\n                || (methodDeclaration.ExpressionBody() != null && expectedStatementsCount == 1); // Expression body has only one statement\n\n            private static IEnumerable<SyntaxNode> FindMethodDeclarations(INamedTypeSymbol typeSymbol, Func<IMethodSymbol, bool> predicate) =>\n                typeSymbol.GetMembers().OfType<IMethodSymbol>().Where(predicate).Select(x => x.ImplementationSyntax());\n\n            private static IEnumerable<SyntaxNode> FindMethodImplementationOrAbstractDeclaration(INamedTypeSymbol typeSymbol,\n                                                                                                 Func<IMethodSymbol, bool> predicate,\n                                                                                                 TypeDeclarationSyntax typeDeclarationSyntax) =>\n                FindMethodDeclarations(typeSymbol, predicate)\n                    .OfType<BaseMethodDeclarationSyntax>()\n                    // We want to skip the partial method declarations when reporting secondary issues since the messages are relevant only for implementation part.\n                    // We do want to include abstract methods though since the implementation is in another type which could be defined in a different assembly than the one analyzed.\n                    .Where(x => typeDeclarationSyntax.Contains(x) && (x.HasBodyOrExpressionBody() || x.Modifiers.AnyOfKind(SyntaxKind.AbstractKeyword)));\n\n            private static bool HasVirtualDisposeBool(ITypeSymbol typeSymbol) =>\n                typeSymbol.GetSelfAndBaseTypes()\n                          .SelectMany(type => type.GetMembers())\n                          .OfType<IMethodSymbol>()\n                          .Where(IsDisposeBool)\n                          .Any(symbol => !symbol.IsAbstract);\n\n            private static bool IsLiteralArgument(ArgumentSyntax argument, SyntaxKind literalTokenKind) =>\n                argument is { Expression: LiteralExpressionSyntax { Token: var token } } && token.IsKind(literalTokenKind);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ImplementISerializableCorrectly.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Runtime.Serialization;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public class ImplementISerializableCorrectly : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S3925\";\n        private const string MessageFormat = \"Update this implementation of 'ISerializable' to conform to the recommended serialization pattern. {0}\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n                {\n                    if (c.IsRedundantPositionalRecordContext())\n                    {\n                        return;\n                    }\n\n                    var typeDeclarationSyntax = (TypeDeclarationSyntax)c.Node;\n                    var typeSymbol = (INamedTypeSymbol)c.ContainingSymbol;\n                    if (!ImplementsISerializable(typeSymbol) || !OptsInForSerialization(typeSymbol))\n                    {\n                        return;\n                    }\n\n                    var getObjectData = typeSymbol.GetMembers().OfType<IMethodSymbol>().FirstOrDefault(KnownMethods.IsGetObjectData);\n                    var implementationErrors = new List<SecondaryLocation>();\n                    implementationErrors.AddRange(CheckSerializableAttribute(typeDeclarationSyntax.Keyword, typeSymbol));\n                    implementationErrors.AddRange(CheckConstructor(typeDeclarationSyntax, typeSymbol));\n                    implementationErrors.AddRange(CheckGetObjectDataAccessibility(typeDeclarationSyntax, typeSymbol, getObjectData));\n                    implementationErrors.AddRange(CheckGetObjectData(typeDeclarationSyntax, typeSymbol, getObjectData));\n                    if (implementationErrors.Any())\n                    {\n                        c.ReportIssue(Rule, typeDeclarationSyntax.Identifier, implementationErrors, implementationErrors.JoinStr(\" \", x => x.Message));\n                    }\n                },\n                SyntaxKind.ClassDeclaration,\n                SyntaxKindEx.RecordDeclaration,\n                SyntaxKindEx.RecordStructDeclaration,\n                SyntaxKind.StructDeclaration);\n\n        private static IEnumerable<SecondaryLocation> CheckSerializableAttribute(SyntaxToken typeKeyword, INamedTypeSymbol typeSymbol)\n        {\n            if (!typeSymbol.IsAbstract && !HasSerializableAttribute(typeSymbol))\n            {\n                yield return new(typeKeyword.GetLocation(), $\"Add 'System.SerializableAttribute' attribute on '{typeSymbol.Name}' because it implements 'ISerializable'.\");\n            }\n        }\n\n        // Symbol should be checked for null in the caller.\n        private static IEnumerable<TSyntax> DeclarationOrImplementation<TSyntax>(TypeDeclarationSyntax typeDeclaration, IMethodSymbol symbol) =>\n            symbol.PartialImplementationPart is not null\n            && symbol.PartialImplementationPart.DeclaringSyntaxReferences.First().GetSyntax() is var partialImplementation\n            && typeDeclaration.DescendantNodes().Any(x => x.Equals(partialImplementation))\n                ? new[] { partialImplementation }.Cast<TSyntax>()\n                : symbol.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).Cast<TSyntax>();\n\n        private static IEnumerable<SecondaryLocation> CheckGetObjectData(TypeDeclarationSyntax typeDeclaration, INamedTypeSymbol typeSymbol, IMethodSymbol getObjectData)\n        {\n            if (!ImplementsISerializable(typeSymbol.BaseType))\n            {\n                yield break;\n            }\n\n            if (getObjectData == null)\n            {\n                var serializableFields = GetSerializableFieldNames(typeSymbol).ToList();\n                if (serializableFields.Any())\n                {\n                    yield return new(typeDeclaration.Keyword.GetLocation(), $\"Override 'GetObjectData(SerializationInfo, StreamingContext)' and serialize '{serializableFields.JoinAnd()}'.\");\n                }\n            }\n            else if (getObjectData.IsOverride && !IsCallingBase(getObjectData))\n            {\n                foreach (var declaration in DeclarationOrImplementation<MethodDeclarationSyntax>(typeDeclaration, getObjectData))\n                {\n                    yield return new(declaration.Identifier.GetLocation(), \"Invoke 'base.GetObjectData(SerializationInfo, StreamingContext)' in 'GetObjectData'.\");\n                }\n            }\n        }\n\n        private static IEnumerable<SecondaryLocation> CheckGetObjectDataAccessibility(TypeDeclarationSyntax typeDeclaration, INamedTypeSymbol typeSymbol, IMethodSymbol getObjectData)\n        {\n            if (getObjectData == null || typeSymbol.IsSealed || IsPublicVirtual(getObjectData) || IsExplicitImplementation(getObjectData))\n            {\n                yield break;\n            }\n            foreach (var declaration in DeclarationOrImplementation<MethodDeclarationSyntax>(typeDeclaration, getObjectData))\n            {\n                yield return new(declaration.Identifier.GetLocation(), $\"Make 'GetObjectData' 'public' and 'virtual', or seal '{typeSymbol.Name}'.\");\n            }\n        }\n\n        private static IEnumerable<string> GetSerializableFieldNames(INamedTypeSymbol typeSymbol) =>\n            typeSymbol.GetMembers().OfType<IFieldSymbol>()\n                .Where(x => !x.IsStatic && ImplementsISerializable(x.Type))\n                .Select(x => x.Name);\n\n        private static IEnumerable<SecondaryLocation> CheckConstructor(TypeDeclarationSyntax typeDeclaration, INamedTypeSymbol typeSymbol)\n        {\n            var accessibility = typeSymbol.IsSealed ? SyntaxConstants.Private : SyntaxConstants.Protected;\n            if (typeSymbol.Constructors.FirstOrDefault(KnownMethods.IsSerializationConstructor) is { } serializationConstructor)\n            {\n                var constructorSyntax = DeclarationOrImplementation<ConstructorDeclarationSyntax>(typeDeclaration, serializationConstructor).First();\n\n                if ((typeSymbol.IsSealed && serializationConstructor.DeclaredAccessibility != Accessibility.Private)\n                    || (!typeSymbol.IsSealed && serializationConstructor.DeclaredAccessibility != Accessibility.Protected))\n                {\n                    yield return new(constructorSyntax.Identifier.GetLocation(), $\"Make the serialization constructor '{accessibility}'.\");\n                }\n\n                if (ImplementsISerializable(typeSymbol.BaseType) && !IsCallingBaseConstructor(serializationConstructor))\n                {\n                    yield return new(constructorSyntax.Identifier.GetLocation(), $\"Call 'base(SerializationInfo, StreamingContext)' on the serialization constructor.\");\n                }\n            }\n            else\n            {\n                yield return new(typeDeclaration.Keyword.GetLocation(), $\"Add a '{accessibility}' constructor '{typeSymbol.Name}(SerializationInfo, StreamingContext)'.\");\n            }\n        }\n\n        private static bool IsCallingBase(IMethodSymbol methodSymbol) =>\n            methodSymbol.ImplementationSyntax() is { } methodDeclaration\n            && methodDeclaration.DescendantNodes()\n                .OfType<InvocationExpressionSyntax>()\n                .Select(x => x.Expression)\n                .OfType<MemberAccessExpressionSyntax>()\n                .Any(x => x.IsKind(SyntaxKind.SimpleMemberAccessExpression) && x.Expression.IsKind(SyntaxKind.BaseExpression) && x.Name.Identifier.ValueText == nameof(ISerializable.GetObjectData));\n\n        private static bool IsCallingBaseConstructor(IMethodSymbol constructorSymbol) =>\n            constructorSymbol.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax() is ConstructorDeclarationSyntax { Initializer: { ThisOrBaseKeyword: { RawKind: (int)SyntaxKind.BaseKeyword } } };\n\n        private static bool ImplementsISerializable(ITypeSymbol typeSymbol) =>\n            typeSymbol != null\n            && typeSymbol.IsPubliclyAccessible()\n            && typeSymbol.Implements(KnownType.System_Runtime_Serialization_ISerializable);\n\n        private static bool OptsInForSerialization(INamedTypeSymbol typeSymbol) =>\n            typeSymbol.IsSerializable // [Serializable] is present at the types declaration\n            || typeSymbol.Interfaces.Any(x => x.Is(KnownType.System_Runtime_Serialization_ISerializable)) // ISerializable is listed in the types declaration base type list\n            || typeSymbol.Constructors.Any(KnownMethods.IsSerializationConstructor); // A serialization constructor is defined\n\n        private static bool HasSerializableAttribute(ISymbol symbol) =>\n            symbol.HasAttribute(KnownType.System_SerializableAttribute);\n\n        private static bool IsPublicVirtual(IMethodSymbol methodSymbol) =>\n            methodSymbol.DeclaredAccessibility == Accessibility.Public\n            && (methodSymbol.IsVirtual || methodSymbol.IsOverride);\n\n        private static bool IsExplicitImplementation(IMethodSymbol methodSymbol) =>\n            methodSymbol.ExplicitInterfaceImplementations.Any(KnownMethods.IsGetObjectData);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ImplementSerializationMethodsCorrectly.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class ImplementSerializationMethodsCorrectly : ImplementSerializationMethodsCorrectlyBase\n    {\n        private const string ProblemStatic = \"non-static\";\n        private const string ProblemReturnVoidText = \"return 'void'\";\n\n        protected override ILanguageFacade Language => CSharpFacade.Instance;\n        protected override string MethodStaticMessage => ProblemStatic;\n        protected override string MethodReturnTypeShouldBeVoidMessage => ProblemReturnVoidText;\n\n        protected override Location GetIdentifierLocation(IMethodSymbol methodSymbol) =>\n            methodSymbol.DeclaringSyntaxReferences.Select(x => x.GetSyntax())\n                .OfType<MethodDeclarationSyntax>()\n                .FirstOrDefault()\n                ?.Identifier\n                .GetLocation();\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(c =>\n                {\n                    var wrapper = (LocalFunctionStatementSyntaxWrapper)c.Node;\n                    var attributes = GetSerializationAttributes(wrapper.AttributeLists, c.Model);\n                    ReportOnAttributes(c, attributes, \"local functions\");\n                },\n                SyntaxKindEx.LocalFunctionStatement);\n\n            context.RegisterNodeAction(c =>\n                {\n                    var lambda = (ParenthesizedLambdaExpressionSyntax)c.Node;\n                    var attributes = GetSerializationAttributes(lambda.AttributeLists, c.Model);\n                    ReportOnAttributes(c, attributes, \"lambdas\");\n                },\n                SyntaxKind.ParenthesizedLambdaExpression);\n\n            base.Initialize(context);\n        }\n\n        private void ReportOnAttributes(SonarSyntaxNodeReportingContext context, IEnumerable<AttributeSyntax> attributes, string memberType)\n        {\n            foreach (var attribute in attributes)\n            {\n                context.ReportIssue(AttributeNotConsideredRule, attribute, memberType);\n            }\n        }\n\n        private static IEnumerable<AttributeSyntax> GetSerializationAttributes(SyntaxList<AttributeListSyntax> attributeList, SemanticModel model) =>\n            attributeList.SelectMany(x => x.Attributes)\n                         .Where(attribute => attribute.IsKnownType(KnownType.System_Runtime_Serialization_OnSerializingAttribute, model)\n                                             || attribute.IsKnownType(KnownType.System_Runtime_Serialization_OnSerializedAttribute, model)\n                                             || attribute.IsKnownType(KnownType.System_Runtime_Serialization_OnDeserializingAttribute, model)\n                                             || attribute.IsKnownType(KnownType.System_Runtime_Serialization_OnDeserializedAttribute, model));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/IndentSingleLineFollowingConditional.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    // Note: this rule only covers the indentation of the first line after a conditional.\n    // Rule 2681 covers the misleading indentation of other lines of multiline blocks (https://jira.sonarsource.com/browse/RSPEC-2681)\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class IndentSingleLineFollowingConditional : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S3973\";\n        private const string MessageFormat = \"Use curly braces or indentation to denote the code conditionally executed by this '{0}'\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(CheckWhile, SyntaxKind.WhileStatement);\n            context.RegisterNodeAction(CheckDo, SyntaxKind.DoStatement);\n            context.RegisterNodeAction(CheckFor, SyntaxKind.ForStatement);\n            context.RegisterNodeAction(CheckForEach, SyntaxKind.ForEachStatement);\n            context.RegisterNodeAction(CheckIf, SyntaxKind.IfStatement);\n            context.RegisterNodeAction(CheckElse, SyntaxKind.ElseClause);\n        }\n\n        private static void CheckWhile(SonarSyntaxNodeReportingContext context)\n        {\n            var whileStatement = (WhileStatementSyntax)context.Node;\n            if (!IsStatementIndentationOk(whileStatement, whileStatement.Statement))\n            {\n                // Squiggle - \"while (condition1 && condition2)\"\n                var primaryLocation = whileStatement.WhileKeyword.CreateLocation(whileStatement.CloseParenToken);\n                ReportIssue(context, primaryLocation, whileStatement.Statement, \"while\");\n            }\n        }\n\n        private static void CheckDo(SonarSyntaxNodeReportingContext context)\n        {\n            var doStatement = (DoStatementSyntax)context.Node;\n            if (!IsStatementIndentationOk(doStatement, doStatement.Statement))\n            {\n                // Just highlight the \"do\" keyword\n                ReportIssue(context, doStatement.DoKeyword.GetLocation(), doStatement.Statement, \"do\");\n            }\n        }\n\n        private static void CheckFor(SonarSyntaxNodeReportingContext context)\n        {\n            var forStatement = (ForStatementSyntax)context.Node;\n            if (!IsStatementIndentationOk(forStatement, forStatement.Statement))\n            {\n                // Squiggle - \"for (...)\"\n                var primaryLocation = forStatement.ForKeyword.CreateLocation(forStatement.CloseParenToken);\n                ReportIssue(context, primaryLocation, forStatement.Statement, \"for\");\n            }\n        }\n\n        private static void CheckForEach(SonarSyntaxNodeReportingContext context)\n        {\n            var forEachStatement = (ForEachStatementSyntax)context.Node;\n            if (!IsStatementIndentationOk(forEachStatement, forEachStatement.Statement))\n            {\n                // Squiggle - \"foreach (...)\"\n                var primaryLocation = forEachStatement.ForEachKeyword.CreateLocation(forEachStatement.CloseParenToken);\n                ReportIssue(context, primaryLocation, forEachStatement.Statement, \"foreach\");\n            }\n        }\n\n        private static void CheckIf(SonarSyntaxNodeReportingContext context)\n        {\n            var ifStatement = (IfStatementSyntax)context.Node;\n\n            // Special case for \"else if\" on the same line.\n            // In that case, we'll check that the statement is more indented then the \"else\", not the \"if\".\n            // Highlighting: \"if (...)\", or  \"else if (...)\" as appropriate\n            SyntaxNode controlNode;\n            SyntaxToken startToken;\n            string conditionLabelText;\n            if (ifStatement.Parent is ElseClauseSyntax elseClause\n                && ifStatement.LineNumberToReport() == elseClause.LineNumberToReport())\n            {\n                controlNode = elseClause;\n                startToken = elseClause.ElseKeyword;\n                conditionLabelText = \"else if\";\n            }\n            else\n            {\n                controlNode = ifStatement;\n                startToken = ifStatement.IfKeyword;\n                conditionLabelText = \"if\";\n            }\n\n            if (!IsStatementIndentationOk(controlNode, ifStatement.Statement))\n            {\n                var primaryLocation = startToken.CreateLocation(ifStatement.CloseParenToken);\n                ReportIssue(context, primaryLocation, ifStatement.Statement, conditionLabelText);\n            }\n        }\n\n        private static void CheckElse(SonarSyntaxNodeReportingContext context)\n        {\n            var elseClause = (ElseClauseSyntax)context.Node;\n            if (!IsStatementIndentationOk(elseClause, elseClause.Statement))\n            {\n                // Just highlight the \"else\" keyword\n                ReportIssue(context, elseClause.ElseKeyword.GetLocation(), elseClause.Statement, \"else\");\n            }\n        }\n\n        private static bool IsStatementIndentationOk(SyntaxNode controlNode, SyntaxNode conditionallyExecutedNode) =>\n            conditionallyExecutedNode is BlockSyntax ||\n            VisualIndentComparer.IsSecondIndentLonger(controlNode, conditionallyExecutedNode);\n\n        private static void ReportIssue(SonarSyntaxNodeReportingContext context, Location primaryLocation, SyntaxNode secondaryLocationNode, string conditionLabelText) =>\n               context.ReportIssue(Rule, primaryLocation, [GetFirstLineOfNode(secondaryLocationNode).ToSecondary()], conditionLabelText);\n\n        private static Location GetFirstLineOfNode(SyntaxNode node)\n        {\n            var lineNumber = node.GetLocation().StartLine();\n            var wholeLineSpan = node.SyntaxTree.GetText().Lines[lineNumber].Span;\n            var secondaryLocationSpan = wholeLineSpan.Intersection(node.GetLocation().SourceSpan);\n\n            return Location.Create(node.SyntaxTree, secondaryLocationSpan ?? wholeLineSpan);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/IndexOfCheckAgainstZero.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class IndexOfCheckAgainstZero : IndexOfCheckAgainstZeroBase<SyntaxKind, BinaryExpressionSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n        protected override SyntaxKind LessThanExpression => SyntaxKind.LessThanExpression;\n        protected override SyntaxKind GreaterThanExpression => SyntaxKind.GreaterThanExpression;\n\n        protected override SyntaxNode Left(BinaryExpressionSyntax binaryExpression) =>\n            binaryExpression.Left;\n\n        protected override SyntaxToken OperatorToken(BinaryExpressionSyntax binaryExpression) =>\n            binaryExpression.OperatorToken;\n\n        protected override SyntaxNode Right(BinaryExpressionSyntax binaryExpression) =>\n            binaryExpression.Right;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/InfiniteRecursion.RoslynCfg.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CFG.Roslyn;\nusing CfgAllPathValidator = SonarAnalyzer.CFG.Roslyn.CfgAllPathValidator;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\npublic partial class InfiniteRecursion\n{\n    private sealed class RoslynChecker : IChecker\n    {\n        public void CheckForNoExitProperty(SonarSyntaxNodeReportingContext c, PropertyDeclarationSyntax property, IPropertySymbol propertySymbol) =>\n            CheckForNoExit(c,\n                propertySymbol,\n                \"property's recursion\",\n                \"property accessor's recursion\");\n\n        public void CheckForNoExitIndexer(SonarSyntaxNodeReportingContext c, IndexerDeclarationSyntax indexer, IPropertySymbol propertySymbol) =>\n            CheckForNoExit(c,\n                propertySymbol,\n                \"indexer's recursion\",\n                \"indexer accessor's recursion\");\n\n        public void CheckForNoExitEvent(SonarSyntaxNodeReportingContext c, EventDeclarationSyntax eventDeclaration, IEventSymbol eventSymbol)\n        {\n            if (eventDeclaration.AccessorList is not null)\n            {\n                foreach (var accessor in eventDeclaration.AccessorList.Accessors.Where(x => x.HasBodyOrExpressionBody()))\n                {\n                    var cfg = ControlFlowGraph.Create(accessor, c.Model, c.Cancel);\n                    var context = new RecursionContext<ControlFlowGraph>(c, cfg, eventSymbol, accessor.Keyword.GetLocation(), \"event accessor's recursion\");\n                    var walker = new RecursionSearcher(context);\n                    walker.CheckPaths();\n                }\n            }\n        }\n\n        public void CheckForNoExitMethod(SonarSyntaxNodeReportingContext c, SyntaxNode body, SyntaxToken identifier, IMethodSymbol symbol)\n        {\n            if (body.CreateCfg(c.Model, c.Cancel) is { } cfg)\n            {\n                var context = new RecursionContext<ControlFlowGraph>(c, cfg, symbol, identifier.GetLocation(), \"method's recursion\");\n                var walker = new RecursionSearcher(context);\n                walker.CheckPaths();\n            }\n        }\n\n        private static void CheckForNoExit(SonarSyntaxNodeReportingContext c,\n                                   IPropertySymbol propertySymbol,\n                                   string arrowExpressionMessageArg,\n                                   string accessorMessageArg)\n        {\n            ArrowExpressionClauseSyntax expressionBody = null;\n            AccessorListSyntax accessorList = null;\n            Location location = null;\n\n            if (c.Node is PropertyDeclarationSyntax propertyDeclaration)\n            {\n                expressionBody = propertyDeclaration.ExpressionBody;\n                accessorList = propertyDeclaration.AccessorList;\n                location = propertyDeclaration.Identifier.GetLocation();\n            }\n            else\n            {\n                var indexerDeclaration = (IndexerDeclarationSyntax)c.Node;\n                expressionBody = indexerDeclaration.ExpressionBody;\n                accessorList = indexerDeclaration.AccessorList;\n                location = indexerDeclaration.ThisKeyword.GetLocation();\n            }\n\n            if (expressionBody?.Expression is not null)\n            {\n                var cfg = ControlFlowGraph.Create(expressionBody, c.Model, c.Cancel);\n                var walker = new RecursionSearcher(new RecursionContext<ControlFlowGraph>(c, cfg, propertySymbol, location, arrowExpressionMessageArg));\n                walker.CheckPaths();\n            }\n            else if (accessorList is not null)\n            {\n                foreach (var accessor in accessorList.Accessors.Where(x => x.HasBodyOrExpressionBody()))\n                {\n                    var cfg = ControlFlowGraph.Create(accessor, c.Model, c.Cancel);\n                    var context = new RecursionContext<ControlFlowGraph>(c, cfg, propertySymbol, accessor.Keyword.GetLocation(), accessorMessageArg);\n                    var walker = new RecursionSearcher(context, !accessor.Keyword.IsAnyKind(SyntaxKind.SetKeyword, SyntaxKindEx.InitKeyword));\n                    walker.CheckPaths();\n                }\n            }\n        }\n\n        private sealed class RecursionSearcher : CfgAllPathValidator\n        {\n            private readonly RecursionContext<ControlFlowGraph> context;\n            private readonly bool isGetAccesor;\n\n            public RecursionSearcher(RecursionContext<ControlFlowGraph> context, bool isGetAccesor = true)\n                : base(context.ControlFlowGraph)\n            {\n                this.context = context;\n                this.isGetAccesor = isGetAccesor;\n            }\n\n            public void CheckPaths()\n            {\n                if (!CfgCanExit() || CheckAllPaths())\n                {\n                    context.ReportIssue();\n                }\n            }\n\n            protected override bool IsValid(BasicBlock block)\n            {\n                if (block.OperationsAndBranchValue.ToReversedExecutionOrder().FirstOrDefault(x => context.AnalyzedSymbol.Equals(MemberSymbol(x.Instance))) is { Instance: { } } operation)\n                {\n                    var isWrite = operation.Parent is { Kind: OperationKindEx.SimpleAssignment } parent && ISimpleAssignmentOperationWrapper.FromOperation(parent).Target == operation.Instance;\n                    return isGetAccesor ^ isWrite;\n                }\n\n                return false;\n\n                static ISymbol MemberSymbol(IOperation operation) =>\n                    operation.Kind switch\n                    {\n                        OperationKindEx.PropertyReference\n                            when IPropertyReferenceOperationWrapper.FromOperation(operation) is var propertyReference && InstanceReferencesThis(propertyReference.Instance) =>\n                            propertyReference.Property,\n                        OperationKindEx.Invocation\n                            when IInvocationOperationWrapper.FromOperation(operation) is var invocation && (!invocation.IsVirtual || InstanceReferencesThis(invocation.Instance)) =>\n                            invocation.TargetMethod,\n                        OperationKindEx.Binary => IBinaryOperationWrapper.FromOperation(operation).OperatorMethod,\n                        OperationKindEx.Decrement => IIncrementOrDecrementOperationWrapper.FromOperation(operation).OperatorMethod,\n                        OperationKindEx.Increment => IIncrementOrDecrementOperationWrapper.FromOperation(operation).OperatorMethod,\n                        OperationKindEx.Unary => IUnaryOperationWrapper.FromOperation(operation).OperatorMethod,\n                        OperationKindEx.Conversion => IConversionOperationWrapper.FromOperation(operation).OperatorMethod,\n                        OperationKindEx.EventReference => IEventReferenceOperationWrapper.FromOperation(operation).Member,\n                        _ => null\n                    };\n\n                static bool InstanceReferencesThis(IOperation instance) =>\n                    instance is null || instance.IsAnyKind(OperationKindEx.FlowCaptureReference, OperationKindEx.InstanceReference);\n            }\n\n            protected override bool IsInvalid(BasicBlock block) => false;\n\n            private bool CfgCanExit() =>\n                context.ControlFlowGraph.ExitBlock.IsReachable\n                || context.ControlFlowGraph.Blocks.Any(x => x.FallThroughSuccessor?.Semantics == ControlFlowBranchSemantics.Throw && x.IsReachable);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/InfiniteRecursion.SonarCfg.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CFG.Sonar;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    public partial class InfiniteRecursion\n    {\n        public class SonarChecker : IChecker\n        {\n            public void CheckForNoExitProperty(SonarSyntaxNodeReportingContext c, PropertyDeclarationSyntax property, IPropertySymbol propertySymbol)\n            {\n                IControlFlowGraph cfg;\n                if (property.ExpressionBody?.Expression != null)\n                {\n                    if (CSharpControlFlowGraph.TryGet(property, c.Model, out cfg))\n                    {\n                        var walker = new RecursionSearcherForProperty(\n                            new RecursionContext<IControlFlowGraph>(c, cfg, propertySymbol, property.Identifier.GetLocation(), \"property's recursion\"),\n                            isSetAccessor: false);\n                        walker.CheckPaths();\n                    }\n\n                    return;\n                }\n\n                var accessors = property.AccessorList?.Accessors.Where(a => a.HasBodyOrExpressionBody());\n                if (accessors != null)\n                {\n                    foreach (var accessor in accessors)\n                    {\n                        if (CSharpControlFlowGraph.TryGet(accessor, c.Model, out cfg))\n                        {\n                            var walker = new RecursionSearcherForProperty(\n                                new RecursionContext<IControlFlowGraph>(c, cfg, propertySymbol, accessor.Keyword.GetLocation(), \"property accessor's recursion\"),\n                                isSetAccessor: accessor.Keyword.IsKind(SyntaxKind.SetKeyword));\n                            walker.CheckPaths();\n\n                            CheckInfiniteJumpLoop(c, accessor, cfg, \"property accessor\");\n                        }\n                    }\n                }\n            }\n\n            public void CheckForNoExitIndexer(SonarSyntaxNodeReportingContext c, IndexerDeclarationSyntax indexer, IPropertySymbol propertySymbol)\n            {\n                // SonarCFG is out of support\n            }\n\n            public void CheckForNoExitEvent(SonarSyntaxNodeReportingContext c, EventDeclarationSyntax eventDeclaration, IEventSymbol eventSymbol)\n            {\n                // SonarCFG is out of support\n            }\n\n            public void CheckForNoExitMethod(SonarSyntaxNodeReportingContext c, SyntaxNode body, SyntaxToken identifier, IMethodSymbol symbol)\n            {\n                if (CSharpControlFlowGraph.TryGet(body, c.Model, out var cfg))\n                {\n                    var walker = new RecursionSearcherForMethod(new RecursionContext<IControlFlowGraph>(c, cfg, symbol, identifier.GetLocation(), \"method's recursion\"));\n                    walker.CheckPaths();\n                    CheckInfiniteJumpLoop(c, body, cfg, \"method\");\n                }\n            }\n\n            private static void CheckInfiniteJumpLoop(SonarSyntaxNodeReportingContext context, SyntaxNode body, IControlFlowGraph cfg, string declarationType)\n            {\n                if (body is null)\n                {\n                    return;\n                }\n\n                var reachableFromBlock = cfg.Blocks.Except(new[] { cfg.ExitBlock }).ToDictionary(\n                    b => b,\n                    b => b.AllSuccessorBlocks);\n\n                var alreadyProcessed = new HashSet<Block>();\n\n                foreach (var reachable in reachableFromBlock)\n                {\n                    if (!reachable.Key.AllPredecessorBlocks.Contains(cfg.EntryBlock)\n                        || alreadyProcessed.Contains(reachable.Key)\n                        || reachable.Value.Contains(cfg.ExitBlock))\n                    {\n                        continue;\n                    }\n\n                    alreadyProcessed.UnionWith(reachable.Value);\n                    alreadyProcessed.Add(reachable.Key);\n\n                    var reportOnOptions = reachable.Value.OfType<JumpBlock>()\n                                                   .Where(jb => jb.JumpNode is GotoStatementSyntax)\n                                                   .ToList();\n\n                    if (!reportOnOptions.Any())\n                    {\n                        continue;\n                    }\n\n                    // Calculate stable report location:\n                    var lastJumpLocation = reportOnOptions.Max(b => b.JumpNode.SpanStart);\n                    var reportOn = reportOnOptions.First(b => b.JumpNode.SpanStart == lastJumpLocation);\n\n                    context.ReportIssue(Rule, reportOn.JumpNode, declarationType);\n                }\n            }\n\n            private class RecursionSearcherForMethod : RecursionSearcher\n            {\n                public RecursionSearcherForMethod(RecursionContext<IControlFlowGraph> context)\n                    : base(context)\n                {\n                }\n\n                protected override bool HasReferenceToDeclaringSymbol(Block block) =>\n                    block.Instructions.Any(x =>\n                        x is InvocationExpressionSyntax invocation\n                        && IsInstructionOnThisAndMatchesDeclaringSymbol(invocation.Expression, context.AnalyzedSymbol, context.Model));\n            }\n\n            private class RecursionSearcherForProperty : RecursionSearcher\n            {\n                private readonly bool isSet;\n\n                public RecursionSearcherForProperty(RecursionContext<IControlFlowGraph> context, bool isSetAccessor)\n                    : base(context) =>\n                    isSet = isSetAccessor;\n\n                private static readonly ISet<Type> TypesForReference = new HashSet<Type> { typeof(IdentifierNameSyntax), typeof(MemberAccessExpressionSyntax) };\n\n                protected override bool HasReferenceToDeclaringSymbol(Block block) =>\n                    block.Instructions.Any(x =>\n                        TypesForReference.Contains(x.GetType())\n                        && MatchesAccessor(x)\n                        && IsInstructionOnThisAndMatchesDeclaringSymbol(x, context.AnalyzedSymbol, context.Model));\n\n                private bool MatchesAccessor(SyntaxNode node)\n                {\n                    var propertyAccess = ((ExpressionSyntax)node).GetSelfOrTopParenthesizedExpression();\n                    var isNodeASet = propertyAccess.Parent is AssignmentExpressionSyntax assignment && assignment.Left == propertyAccess;\n                    return isNodeASet == isSet;\n                }\n            }\n\n            private abstract class RecursionSearcher : CfgAllPathValidator\n            {\n                protected readonly RecursionContext<IControlFlowGraph> context;\n\n                protected abstract bool HasReferenceToDeclaringSymbol(Block block);\n\n                protected RecursionSearcher(RecursionContext<IControlFlowGraph> context)\n                    : base(context.ControlFlowGraph) =>\n                    this.context = context;\n\n                public void CheckPaths()\n                {\n                    if (CheckAllPaths())\n                    {\n                        context.ReportIssue();\n                    }\n                }\n\n                protected override bool IsBlockValid(Block block) =>\n                    HasReferenceToDeclaringSymbol(block);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/InfiniteRecursion.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic partial class InfiniteRecursion : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S2190\";\n    private const string MessageFormat = \"Add a way to break out of this {0}.\";\n\n    private readonly IChecker checker;\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n    private static DiagnosticDescriptor Rule => DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public InfiniteRecursion() : this(AnalyzerConfiguration.AlwaysEnabled) { }\n\n    internal /* for testing */ InfiniteRecursion(IAnalyzerConfiguration configuration) =>\n        checker = configuration.UseSonarCfg() ? new SonarChecker() : new RoslynChecker();\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(\n            c =>\n            {\n                var method = (MethodDeclarationSyntax)c.Node;\n                CheckForNoExitMethod(c, method.Identifier);\n            },\n            SyntaxKind.MethodDeclaration);\n\n        context.RegisterNodeAction(\n            c =>\n            {\n                var function = (LocalFunctionStatementSyntaxWrapper)c.Node;\n                CheckForNoExitMethod(c, function.Identifier);\n            },\n            SyntaxKindEx.LocalFunctionStatement);\n\n        context.RegisterNodeAction(\n            c =>\n            {\n                var @operator = (OperatorDeclarationSyntax)c.Node;\n                CheckForNoExitMethod(c, @operator.OperatorToken);\n            },\n            SyntaxKind.OperatorDeclaration);\n\n        context.RegisterNodeAction(\n            c =>\n            {\n                var conversionOperator = (ConversionOperatorDeclarationSyntax)c.Node;\n                CheckForNoExitMethod(c, conversionOperator.OperatorKeyword);\n            },\n            SyntaxKind.ConversionOperatorDeclaration);\n\n        context.RegisterNodeAction(\n            c =>\n            {\n                var property = (PropertyDeclarationSyntax)c.Node;\n                checker.CheckForNoExitProperty(c, property, c.Model.GetDeclaredSymbol(property));\n            },\n            SyntaxKind.PropertyDeclaration);\n\n        context.RegisterNodeAction(\n            c =>\n            {\n                var indexer = (IndexerDeclarationSyntax)c.Node;\n                checker.CheckForNoExitIndexer(c, indexer, c.Model.GetDeclaredSymbol(indexer));\n            },\n            SyntaxKind.IndexerDeclaration);\n\n        context.RegisterNodeAction(\n            c =>\n            {\n                var eventDeclaration = (EventDeclarationSyntax)c.Node;\n                checker.CheckForNoExitEvent(c, eventDeclaration, c.Model.GetDeclaredSymbol(eventDeclaration));\n            },\n            SyntaxKind.EventDeclaration);\n    }\n\n    private void CheckForNoExitMethod(SonarSyntaxNodeReportingContext c, SyntaxToken identifier)\n    {\n        if (c.Model.GetDeclaredSymbol(c.Node) is IMethodSymbol symbol)\n        {\n            checker.CheckForNoExitMethod(c, c.Node, identifier, symbol);\n        }\n    }\n\n    private static bool IsInstructionOnThisAndMatchesDeclaringSymbol(SyntaxNode node, ISymbol declaringSymbol, SemanticModel semanticModel)\n    {\n        var name = node is MemberAccessExpressionSyntax memberAccess && memberAccess.Expression.IsKind(SyntaxKind.ThisExpression)\n            ? memberAccess.Name\n            : node as NameSyntax;\n\n        return name is not null\n               && semanticModel.GetSymbolInfo(name).Symbol is { } assignedSymbol\n               && declaringSymbol.Equals(assignedSymbol);\n    }\n\n    private sealed class RecursionContext<TControlFlowGraph>\n    {\n        private readonly SonarSyntaxNodeReportingContext analysisContext;\n        private readonly string messageArg;\n        private readonly Location issueLocation;\n\n        public TControlFlowGraph ControlFlowGraph { get; }\n        public ISymbol AnalyzedSymbol { get; }\n        public SemanticModel Model => analysisContext.Model;\n\n        public RecursionContext(SonarSyntaxNodeReportingContext analysisContext,\n                                TControlFlowGraph controlFlowGraph,\n                                ISymbol analyzedSymbol,\n                                Location issueLocation,\n                                string messageArg)\n        {\n            this.analysisContext = analysisContext;\n            this.messageArg = messageArg;\n            this.issueLocation = issueLocation;\n            ControlFlowGraph = controlFlowGraph;\n            AnalyzedSymbol = analyzedSymbol;\n        }\n\n        public void ReportIssue() =>\n            analysisContext.ReportIssue(Rule, issueLocation, messageArg);\n    }\n\n    private interface IChecker\n    {\n        void CheckForNoExitProperty(SonarSyntaxNodeReportingContext c, PropertyDeclarationSyntax property, IPropertySymbol propertySymbol);\n\n        void CheckForNoExitIndexer(SonarSyntaxNodeReportingContext c, IndexerDeclarationSyntax indexer, IPropertySymbol propertySymbol);\n\n        void CheckForNoExitEvent(SonarSyntaxNodeReportingContext c, EventDeclarationSyntax eventDeclaration, IEventSymbol eventSymbol);\n\n        void CheckForNoExitMethod(SonarSyntaxNodeReportingContext c, SyntaxNode body, SyntaxToken identifier, IMethodSymbol symbol);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/InheritedCollidingInterfaceMembers.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class InheritedCollidingInterfaceMembers : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S3444\";\n    private const string MessageFormat = \"Rename or add member{1} {0} to this interface to resolve ambiguities.\";\n    private const string SecondaryMessageFormat = \"This member collides with '{0}'\";\n    private const int MaxMemberDisplayCount = 2;\n    private const int MinBaseListTypes = 2;\n\n    private static readonly ISet<SymbolDisplayPartKind> PartKindsToStartWith = new HashSet<SymbolDisplayPartKind>\n    {\n        SymbolDisplayPartKind.MethodName,\n        SymbolDisplayPartKind.PropertyName,\n        SymbolDisplayPartKind.EventName\n    };\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            c =>\n            {\n                var interfaceDeclaration = (InterfaceDeclarationSyntax)c.Node;\n                if (interfaceDeclaration.BaseList is null || interfaceDeclaration.BaseList.Types.Count < MinBaseListTypes)\n                {\n                    return;\n                }\n\n                var interfaceSymbol = c.Model.GetDeclaredSymbol(interfaceDeclaration);\n                if (interfaceSymbol is null)\n                {\n                    return;\n                }\n\n                var collidingMembers = GetCollidingMembers(interfaceSymbol).Take(MaxMemberDisplayCount + 1).ToList();\n                if (collidingMembers.Any())\n                {\n                    var membersText = GetIssueMessageText(collidingMembers, c.Model, interfaceDeclaration.SpanStart);\n                    var pluralize = collidingMembers.Count > 1 ? \"s\" : string.Empty;\n                    c.ReportIssue(Rule, interfaceDeclaration.Identifier, SecondaryLocations(collidingMembers, c.Model), membersText, pluralize);\n                }\n            },\n            SyntaxKind.InterfaceDeclaration);\n\n    private static IEnumerable<SecondaryLocation> SecondaryLocations(List<CollidingMember> collidingMembers, SemanticModel model)\n    {\n        return collidingMembers\n            .SelectMany(x => x.Member.Locations.Select(l => new { Location = l, x.CollideWith, CollideWithSymbolName = CollideWithSymbolName(x) }))\n            .Where(x => x.Location.IsInSource)\n            .Select(x => x.Location.ToSecondary(x.CollideWithSymbolName is { Length: > 0 } ? SecondaryMessageFormat : null, x.CollideWithSymbolName));\n\n        string CollideWithSymbolName(CollidingMember collidingMember)\n        {\n            return collidingMember.CollideWith.Locations.FirstOrDefault() is { } location\n                && location.SourceTree.SemanticModelOrDefault(model) is { } semanticModel\n                ? GetMemberDisplayName(collidingMember.CollideWith, location.SourceSpan.Start, semanticModel, [SymbolDisplayPartKind.ClassName, SymbolDisplayPartKind.InterfaceName])\n                : string.Empty;\n        }\n    }\n\n    private static IEnumerable<CollidingMember> GetCollidingMembers(ITypeSymbol interfaceSymbol)\n    {\n        var implementedInterfaces = interfaceSymbol.Interfaces;\n\n        var membersFromDerivedInterface = interfaceSymbol.GetMembers().OfType<IMethodSymbol>().ToList();\n\n        for (var i = 0; i < implementedInterfaces.Length; i++)\n        {\n            var notRedefinedMembersFromInterface = implementedInterfaces[i]\n                .GetMembers()\n                .OfType<IMethodSymbol>()\n                .Where(x => x.DeclaredAccessibility != Accessibility.Private\n                    && !membersFromDerivedInterface.Any(redefinedMember => AreCollidingMethods(x, redefinedMember)));\n\n            var collidingMembers = notRedefinedMembersFromInterface.SelectMany(x => GetCollidingMembersForMember(x, implementedInterfaces.Skip(i + 1)));\n\n            foreach (var collidingMember in collidingMembers)\n            {\n                yield return collidingMember;\n            }\n\n            IEnumerable<CollidingMember> GetCollidingMembersForMember(IMethodSymbol member, IEnumerable<INamedTypeSymbol> interfaces) =>\n                interfaces.SelectMany(x => GetCollidingMembersForMemberAndInterface(member, x));\n\n            IEnumerable<CollidingMember> GetCollidingMembersForMemberAndInterface(IMethodSymbol member, INamedTypeSymbol interfaceToCheck) =>\n                interfaceToCheck\n                    .GetMembers(member.Name)\n                    .OfType<IMethodSymbol>()\n                    .Where(IsNotEventRemoveAccessor)\n                    .Where(x => AreCollidingMethods(member, x))\n                    .Select(x => new CollidingMember(x, member));\n        }\n    }\n\n    private static bool IsNotEventRemoveAccessor(IMethodSymbol methodSymbol) =>\n        // we only want to report on events once, so we are not collecting the \"remove\" accessors,\n        // and handle the \"add\" accessor reporting separately in <see cref=\"GetMemberDisplayName\"/>\n        methodSymbol.MethodKind != MethodKind.EventRemove;\n\n    private static string GetIssueMessageText(IEnumerable<CollidingMember> collidingMembers, SemanticModel model, int spanStart)\n    {\n        var names = collidingMembers.Take(MaxMemberDisplayCount)\n            .Select(x => $\"'{GetMemberDisplayName(x.Member, spanStart, model)}'\")\n            .Distinct()\n            .ToList();\n\n        return names.Count switch\n        {\n            1 => names[0],\n            2 => $\"{names[0]} and {names[1]}\",\n            _ => names.JoinStr(\", \") + \", ...\"\n        };\n    }\n\n    private static string GetMemberDisplayName(IMethodSymbol method, int spanStart, SemanticModel model, HashSet<SymbolDisplayPartKind> additionalPartKindsToStartWith = null)\n    {\n        if (method.AssociatedSymbol is IPropertySymbol { IsIndexer: true } property)\n        {\n            var text = property.ToMinimalDisplayString(model, spanStart, SymbolDisplayFormat.CSharpShortErrorMessageFormat);\n            return $\"{text}\";\n        }\n\n        var parts = method.ToMinimalDisplayParts(model, spanStart, SymbolDisplayFormat.CSharpShortErrorMessageFormat)\n            .SkipWhile(x => (additionalPartKindsToStartWith is null || !additionalPartKindsToStartWith.Contains(x.Kind)) && !PartKindsToStartWith.Contains(x.Kind))\n            .ToList();\n\n        if (method.MethodKind == MethodKind.EventAdd)\n        {\n            parts = parts.Take(parts.Count - 2).ToList();\n        }\n\n        return $\"{string.Join(string.Empty, parts)}\";\n    }\n\n    private static bool AreCollidingMethods(IMethodSymbol methodSymbol1, IMethodSymbol methodSymbol2)\n    {\n        if (methodSymbol1.Name != methodSymbol2.Name\n            || methodSymbol1.MethodKind != methodSymbol2.MethodKind\n            || methodSymbol1.Parameters.Length != methodSymbol2.Parameters.Length\n            || methodSymbol1.Arity != methodSymbol2.Arity)\n        {\n            return false;\n        }\n\n        for (var i = 0; i < methodSymbol1.Parameters.Length; i++)\n        {\n            var param1 = methodSymbol1.Parameters[i];\n            var param2 = methodSymbol2.Parameters[i];\n\n            if (param1.RefKind != param2.RefKind\n                || !Equals(param1.Type, param2.Type))\n            {\n                return false;\n            }\n        }\n\n        return true;\n    }\n\n    private sealed record CollidingMember(IMethodSymbol Member, IMethodSymbol CollideWith);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/InitializeStaticFieldsInline.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class InitializeStaticFieldsInline : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S3963\";\n    private const string MessageFormat = \"Initialize all 'static fields' inline and remove the 'static constructor'.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var constructor = (ConstructorDeclarationSyntax)c.Node;\n                if (!constructor.Modifiers.Any(SyntaxKind.StaticKeyword)\n                    || (constructor.Body is null && constructor.ExpressionBody() is null))\n                {\n                    return;\n                }\n                if (c.Model.GetDeclaredSymbol(constructor).ContainingType is { } currentType)\n                {\n                    var bodyDescendantNodes = constructor.Body?.DescendantNodes().ToArray()\n                                              ?? constructor.ExpressionBody()?.DescendantNodes().ToArray()\n                                              ?? [];\n\n                    var assignedFieldCount = bodyDescendantNodes\n                        .OfType<AssignmentExpressionSyntax>()\n                        .SelectMany(x => FieldSymbolsFromLeftSide(x, c.Model, currentType))\n                        .Select(x => x.Name)\n                        .Distinct()\n                        .Count();\n                    var hasIfOrSwitch = Array.Exists(bodyDescendantNodes, x => x.Kind() is SyntaxKind.IfStatement or SyntaxKind.SwitchStatement);\n                    if (((hasIfOrSwitch && assignedFieldCount == 1) || (!hasIfOrSwitch && assignedFieldCount > 0))\n                        && !HasTupleAssignmentForMultipleFields(bodyDescendantNodes, c.Model, currentType))\n                    {\n                        c.ReportIssue(Rule, constructor.Identifier);\n                    }\n                }\n            },\n            SyntaxKind.ConstructorDeclaration);\n\n    private static bool HasTupleAssignmentForMultipleFields(SyntaxNode[] nodes, SemanticModel model, INamedTypeSymbol currentType) =>\n        nodes.OfType<AssignmentExpressionSyntax>()\n            .Where(x => x.Left.Kind() is SyntaxKindEx.TupleExpression)\n            .Select(x => FieldSymbolsFromLeftSide(x, model, currentType))\n            .Any(x => x.Count() > 1); // if more than one field is assigned in a tuple then we assume that the static constructor is needed\n\n    private static IEnumerable<ISymbol> FieldSymbolsFromLeftSide(AssignmentExpressionSyntax assignment, SemanticModel model, INamedTypeSymbol currentType) =>\n        ExtractSymbols(assignment.Left, model)\n            .OfType<IFieldSymbol>()\n            .Distinct()\n            .Where(x => x.ContainingType.Equals(currentType));\n\n    private static ISymbol[] ExtractSymbols(SyntaxNode node, SemanticModel model) =>\n        TupleExpressionSyntaxWrapper.IsInstance(node)\n            ? ((TupleExpressionSyntaxWrapper)node).Arguments\n                .SelectMany(x => ExtractSymbols(x.Expression, model))\n                .ToArray()\n            : [model.GetSymbolInfo(node).Symbol];\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/InsecureContentSecurityPolicy.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class InsecureContentSecurityPolicy : TrackerHotspotDiagnosticAnalyzer<SyntaxKind>\n{\n    private const string DiagnosticId = \"S7039\";\n    private const string MessageFormat = \"Content Security Policies should be restrictive to mitigate the risk of content injection attacks.\";\n\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    public InsecureContentSecurityPolicy() : base(AnalyzerConfiguration.AlwaysEnabled, DiagnosticId, MessageFormat) { }\n\n    public InsecureContentSecurityPolicy(IAnalyzerConfiguration configuration) : base(configuration, DiagnosticId, MessageFormat) { }\n\n    protected override void Initialize(TrackerInput input)\n    {\n        var propertyTracker = Language.Tracker.PropertyAccess;\n        propertyTracker.Track(\n            input,\n            propertyTracker.MatchProperty(new MemberDescriptor(KnownType.Microsoft_AspNetCore_Http_IHeaderDictionary, \"ContentSecurityPolicy\")),\n            x => IsInsecureContentSecurityPolicyValue((string)propertyTracker.AssignedValue(x)));\n\n        var elementAccessTracker = Language.Tracker.ElementAccess;\n        elementAccessTracker.Track(\n            input,\n            elementAccessTracker.MatchProperty(new MemberDescriptor(KnownType.Microsoft_AspNetCore_Http_HttpResponse, \"Headers\")),\n            elementAccessTracker.ArgumentAtIndexEquals(0, \"Content-Security-Policy\"),\n            x => IsInsecureContentSecurityPolicyValue((string)elementAccessTracker.AssignedValue(x)));\n\n        var invocationTracker = Language.Tracker.Invocation;\n        invocationTracker.Track(\n            input,\n            invocationTracker.MatchMethod(\n                new MemberDescriptor(KnownType.System_Collections_Generic_IDictionary_TKey_TValue, \"Add\"),\n                new MemberDescriptor(KnownType.Microsoft_AspNetCore_Http_HeaderDictionaryExtensions, \"Append\")),\n            invocationTracker.ArgumentAtIndexIsAny(0, \"Content-Security-Policy\"),\n            invocationTracker.ArgumentAtIndexIs(1, IsInsecureValue));\n    }\n\n    private static bool IsInsecureValue(SyntaxNode argumentNode, SemanticModel model) =>\n        IsInsecureContentSecurityPolicyValue(((ArgumentSyntax)argumentNode).Expression, model);\n\n    private static bool IsInsecureContentSecurityPolicyValue(SyntaxNode node, SemanticModel model) =>\n        node switch\n        {\n            LiteralExpressionSyntax literal => IsInsecureContentSecurityPolicyValue(literal.Token.ValueText),\n            InterpolatedStringExpressionSyntax interpolatedString => interpolatedString.InterpolatedTextValue(model) is { } value && IsInsecureContentSecurityPolicyValue(value),\n            _ when node.FindConstantValue(model) is string constantValue => IsInsecureContentSecurityPolicyValue(constantValue),\n            _ => false,\n        };\n\n    private static bool IsInsecureContentSecurityPolicyValue(string value) =>\n        value is not null\n        && (value.Contains('*')\n            || value.Contains(\"'unsafe-inline'\")\n            || value.Contains(\"'unsafe-hashes'\")\n            || value.Contains(\"'unsafe-eval'\"));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/InsecureEncryptionAlgorithm.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class InsecureEncryptionAlgorithm : InsecureEncryptionAlgorithmBase<SyntaxKind, InvocationExpressionSyntax, ArgumentListSyntax, ArgumentSyntax>\n    {\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n        protected override ArgumentListSyntax ArgumentList(InvocationExpressionSyntax invocationExpression) =>\n            invocationExpression.ArgumentList;\n\n        protected override SeparatedSyntaxList<ArgumentSyntax> Arguments(ArgumentListSyntax argumentList) =>\n            argumentList.Arguments;\n\n        protected override bool IsStringLiteralArgument(ArgumentSyntax argument) =>\n            argument.Expression.IsKind(SyntaxKind.StringLiteralExpression);\n\n        protected override SyntaxNode Expression(ArgumentSyntax argument) =>\n            argument.Expression;\n\n        protected override Location Location(SyntaxNode objectCreation) =>\n            objectCreation is ObjectCreationExpressionSyntax objectCreationExpression\n                ? objectCreationExpression.Type.GetLocation()\n                : objectCreation.GetLocation();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/InsecureTemporaryFilesCreation.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class InsecureTemporaryFilesCreation : InsecureTemporaryFilesCreationBase<MemberAccessExpressionSyntax, SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language { get; } = CSharpFacade.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/InsteadOfAny.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class InsteadOfAny : InsteadOfAnyBase<SyntaxKind, InvocationExpressionSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override bool IsSimpleEqualityCheck(InvocationExpressionSyntax node, SemanticModel model) =>\n        GetArgumentExpression(node, 0) is SimpleLambdaExpressionSyntax lambda\n        && lambda.Parameter.Identifier.ValueText is var lambdaVariableName\n        && lambda.Body switch\n        {\n            BinaryExpressionSyntax binary when binary.OperatorToken.IsKind(SyntaxKind.EqualsEqualsToken) =>\n                HasValidBinaryOperands(lambdaVariableName, binary.Left, binary.Right, model),\n            InvocationExpressionSyntax invocation =>\n                HasValidInvocationOperands(invocation, lambdaVariableName, model),\n            _ => false\n        };\n\n    private bool HasValidBinaryOperands(string lambdaVariableName, SyntaxNode first, SyntaxNode second, SemanticModel model) =>\n        (AreValidOperands(lambdaVariableName, first, second) && IsNullOrValueTypeOrString(second, model))\n        || (AreValidOperands(lambdaVariableName, second, first) && IsNullOrValueTypeOrString(first, model));\n\n    private static bool IsNullOrValueTypeOrString(SyntaxNode node, SemanticModel model) =>\n        node.IsKind(SyntaxKind.NullLiteralExpression) || IsValueTypeOrString(node, model);\n\n    protected override bool AreValidOperands(string lambdaVariable, SyntaxNode first, SyntaxNode second) =>\n        first is IdentifierNameSyntax && IsNameEqualTo(first, lambdaVariable)\n        && second switch\n        {\n            LiteralExpressionSyntax => true,\n            IdentifierNameSyntax => !IsNameEqualTo(first, second.GetName()),\n            _ => false,\n        };\n\n    protected override SyntaxNode GetArgumentExpression(InvocationExpressionSyntax invocation, int index) =>\n        invocation.ArgumentList.Arguments[index].Expression;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/InterfaceMethodsShouldBeCallableByChildTypes.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class InterfaceMethodsShouldBeCallableByChildTypes : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S4039\";\n        private const string MessageFormat = \"Make '{0}' sealed, change to a non-explicit declaration or provide a \" +\n            \"new method exposing the functionality of '{1}'.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c => ReportOnIssue<MethodDeclarationSyntax>(c, m => m.ExplicitInterfaceSpecifier, m => m.Identifier, AreMethodsEquivalent),\n                SyntaxKind.MethodDeclaration);\n\n            context.RegisterNodeAction(\n                c => ReportOnIssue<PropertyDeclarationSyntax>(c, m => m.ExplicitInterfaceSpecifier, m => m.Identifier, ArePropertiesEquivalent),\n                SyntaxKind.PropertyDeclaration);\n\n            context.RegisterNodeAction(\n                c => ReportOnIssue<EventDeclarationSyntax>(c, m => m.ExplicitInterfaceSpecifier, m => m.Identifier, AreEventsEquivalent),\n                SyntaxKind.EventDeclaration);\n        }\n\n        private static void ReportOnIssue<TMemberSyntax>(SonarSyntaxNodeReportingContext analysisContext,\n                                                         Func<TMemberSyntax, ExplicitInterfaceSpecifierSyntax> getExplicitInterfaceSpecifier,\n                                                         Func<TMemberSyntax, SyntaxToken> getIdentifierName,\n                                                         Func<TMemberSyntax, TMemberSyntax, bool> areMembersEquivalent)\n            where TMemberSyntax : MemberDeclarationSyntax\n        {\n            var memberDeclaration = (TMemberSyntax)analysisContext.Node;\n\n            var explicitInterfaceSpecifier = getExplicitInterfaceSpecifier(memberDeclaration);\n            if (explicitInterfaceSpecifier == null)\n            {\n                return;\n            }\n\n            var declaration = (TypeDeclarationSyntax)memberDeclaration.FirstAncestorOrSelf<SyntaxNode>(node => node is TypeDeclarationSyntax);\n            if (declaration == null\n                || declaration.Identifier.IsMissing\n                || !IsDeclarationTracked(declaration, analysisContext.Model))\n            {\n                return;\n            }\n\n            var hasPublicEquivalentMethod = declaration.Members\n                                                       .OfType<TMemberSyntax>()\n                                                       .Any(member => areMembersEquivalent(member, memberDeclaration));\n            if (!hasPublicEquivalentMethod)\n            {\n                var identifierName = getIdentifierName(memberDeclaration);\n\n                analysisContext.ReportIssue(Rule, identifierName, declaration.Identifier.ValueText, string.Concat(explicitInterfaceSpecifier.Name, \".\", identifierName.ValueText));\n            }\n        }\n\n        private static bool IsDeclarationTracked(BaseTypeDeclarationSyntax declaration, SemanticModel semanticModel)\n        {\n            var symbol = semanticModel.GetDeclaredSymbol(declaration);\n\n            return symbol is { IsSealed: false }\n                   && symbol.IsPubliclyAccessible();\n        }\n\n        private static bool AreMethodsEquivalent(MethodDeclarationSyntax currentMethod, MethodDeclarationSyntax targetedMethod) =>\n            currentMethod != targetedMethod\n            && currentMethod.Modifiers.Any(IsPublicOrProtected)\n            && (currentMethod.Identifier.ValueText == targetedMethod.Identifier.ValueText\n                || (targetedMethod.Identifier.ValueText == nameof(IDisposable.Dispose) && currentMethod.Identifier.ValueText == \"Close\")); // Allows to replace IDisposable.Dispose() with Close()\n\n        private static bool ArePropertiesEquivalent(PropertyDeclarationSyntax currentProperty, PropertyDeclarationSyntax targetedProperty) =>\n            currentProperty != targetedProperty\n            && currentProperty.Identifier.ValueText == targetedProperty.Identifier.ValueText\n            && currentProperty.Modifiers.Any(IsPublicOrProtected);\n\n        private static bool AreEventsEquivalent(EventDeclarationSyntax currentEvent, EventDeclarationSyntax targetedEvent) =>\n            currentEvent != targetedEvent\n            && currentEvent.Identifier.ValueText == targetedEvent.Identifier.ValueText\n            && currentEvent.Modifiers.Any(IsPublicOrProtected);\n\n        private static bool IsPublicOrProtected(SyntaxToken modifier) =>\n            modifier.IsKind(SyntaxKind.PublicKeyword)\n            || modifier.IsKind(SyntaxKind.ProtectedKeyword);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/InterfacesShouldNotBeEmpty.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class InterfacesShouldNotBeEmpty : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S4023\";\n        private const string MessageFormat = \"Remove this interface or add members to it.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var interfaceDeclaration = (InterfaceDeclarationSyntax)c.Node;\n                    if (interfaceDeclaration.Identifier.IsMissing\n                        || interfaceDeclaration.Members.Count > 0)\n                    {\n                        return;\n                    }\n\n                    var interfaceSymbol = c.Model.GetDeclaredSymbol(interfaceDeclaration);\n                    if (interfaceSymbol is { DeclaredAccessibility: Accessibility.Public }\n                        && !IsAggregatingOtherInterfaces(interfaceSymbol)\n                        && !IsSpecializedGeneric(interfaceSymbol)\n                        && !HasEnhancingAttribute(interfaceSymbol))\n                    {\n                        c.ReportIssue(Rule, interfaceDeclaration.Identifier);\n                    }\n                },\n                SyntaxKind.InterfaceDeclaration);\n\n        private static bool IsAggregatingOtherInterfaces(ITypeSymbol interfaceSymbol) =>\n            interfaceSymbol.Interfaces.Length > 1;\n\n        private static bool IsSpecializedGeneric(INamedTypeSymbol interfaceSymbol) =>\n            IsImplementingInterface(interfaceSymbol) && (IsBoundGeneric(interfaceSymbol) || IsConstraintGeneric(interfaceSymbol));\n\n        private static bool IsConstraintGeneric(INamedTypeSymbol interfaceSymbol) =>\n            interfaceSymbol.TypeParameters.Any(x => x.HasAnyConstraint());\n\n        private static bool IsBoundGeneric(INamedTypeSymbol interfaceSymbol) =>\n            interfaceSymbol.Interfaces.Any(i => i.TypeArguments.Any(a => a is INamedTypeSymbol { IsUnboundGenericType: false }));\n\n        private static bool HasEnhancingAttribute(INamedTypeSymbol interfaceSymbol) =>\n            IsImplementingInterface(interfaceSymbol) // Attributes on interfaces without base interfaces do not make sense.\n                                                     // Implementing types do not get the attribute applied even with AttributeUsageAttribute.Inherited = true\n            && interfaceSymbol.GetAttributes().Any();\n\n        private static bool IsImplementingInterface(INamedTypeSymbol interfaceSymbol) =>\n            !interfaceSymbol.Interfaces.IsEmpty;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/InvalidCastToInterface.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class InvalidCastToInterface : InvalidCastToInterfaceBase<SyntaxKind>\n{\n    public static readonly DiagnosticDescriptor S1944 = DescriptorFactory.Create(DiagnosticId, MessageFormat);  // This indirection is needed only because of the old SE engine, see base class.\n\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n    protected override DiagnosticDescriptor Rule => S1944;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/InvocationResolvesToOverrideWithParams.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class InvocationResolvesToOverrideWithParams : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S3220\";\n    private const string MessageFormat = \"Review this call, which partially matches an overload without 'params'. The partial match is '{0}'.\";\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            c =>\n            {\n                var node = c.Node;\n                var argumentList = (node as InvocationExpressionSyntax)?.ArgumentList\n                                    ?? ((ObjectCreationExpressionSyntax)node).ArgumentList;\n                CheckCall(c, node, argumentList);\n            },\n            SyntaxKind.InvocationExpression,\n            SyntaxKind.ObjectCreationExpression);\n\n    private static void CheckCall(SonarSyntaxNodeReportingContext context, SyntaxNode node, ArgumentListSyntax argumentList)\n    {\n        if (argumentList is { Arguments.Count: > 0 }\n            && context.Model.GetSymbolInfo(node).Symbol is IMethodSymbol method\n            && method.Parameters.LastOrDefault() is { IsParams: true }\n            && !IsInvocationWithExplicitArray(argumentList, method, context.Model)\n            && ArgumentTypes(context, argumentList) is var argumentTypes\n            && Array.TrueForAll(argumentTypes, x => x is not IErrorTypeSymbol)\n            && OtherOverloadsOf(method).FirstOrDefault(IsPossibleMatch) is { } otherMethod\n            && method.IsGenericMethod == otherMethod.IsGenericMethod)\n        {\n            context.ReportIssue(Rule, node, otherMethod.ToMinimalDisplayString(context.Model, node.SpanStart));\n        }\n\n        bool IsPossibleMatch(IMethodSymbol method) =>\n            ArgumentsMatchParameters(argumentList, argumentTypes, method, context.Model)\n            && MethodAccessibleWithinType(method, context.ContainingSymbol.ContainingType);\n    }\n\n    private static ITypeSymbol[] ArgumentTypes(SonarSyntaxNodeReportingContext context, ArgumentListSyntax argumentList) =>\n        argumentList.Arguments\n            .Select(x => context.Model.GetTypeInfo(x.Expression))\n            .Select(x => x.Type ?? x.ConvertedType) // Action and Func won't always resolve properly with Type\n            .ToArray();\n\n    private static IEnumerable<IMethodSymbol> OtherOverloadsOf(IMethodSymbol method) =>\n        method.ContainingType\n            .GetMembers(method.Name)\n            .OfType<IMethodSymbol>()\n            .Where(x => !x.IsVararg && x.MethodKind == method.MethodKind && !x.Equals(method) && x.Parameters.Any() && !x.Parameters.Last().IsParams);\n\n    private static bool IsInvocationWithExplicitArray(ArgumentListSyntax argumentList, IMethodSymbol invokedMethodSymbol, SemanticModel semanticModel)\n    {\n        var lookup = new CSharpMethodParameterLookup(argumentList, invokedMethodSymbol);\n        var parameters = argumentList.Arguments.Select(Valid).ToArray();\n        return Array.TrueForAll(parameters, x => x is not null) && parameters.Count(x => x.IsParams) == 1;\n\n        IParameterSymbol Valid(ArgumentSyntax argument) =>\n            lookup.TryGetSymbol(argument, out var parameter)\n            && (!parameter.IsParams || semanticModel.GetTypeInfo(argument.Expression).Type is IArrayTypeSymbol)\n                ? parameter\n                : null;\n    }\n\n    private static bool ArgumentsMatchParameters(ArgumentListSyntax argumentList, ITypeSymbol[] argumentTypes, IMethodSymbol possibleOtherMethod, SemanticModel semanticModel)\n    {\n        var lookup = new CSharpMethodParameterLookup(argumentList, possibleOtherMethod);\n        var parameters = argumentList.Arguments.Select((argument, index) => Valid(argument, argumentTypes[index])).ToArray();\n        return Array.TrueForAll(parameters, x => x is not null) && possibleOtherMethod.Parameters.Except(parameters).All(x => x.HasExplicitDefaultValue);\n\n        IParameterSymbol Valid(ArgumentSyntax argument, ITypeSymbol type) =>\n            lookup.TryGetSymbol(argument, out var parameter)\n            && ((type is INamedTypeSymbol && semanticModel.ClassifyConversion(argument.Expression, parameter.Type).IsImplicit)\n                || (type is not INamedTypeSymbol && parameter.Type.IsReferenceType))\n                ? parameter\n                : null;\n    }\n\n    private static bool MethodAccessibleWithinType(IMethodSymbol method, ITypeSymbol type) =>\n        IsInTypeOrNested(method, type) || method.DeclaredAccessibility switch\n        {\n            Accessibility.Private => false,\n            // ProtectedAndInternal corresponds to `private protected`.\n            Accessibility.ProtectedAndInternal => type.DerivesFrom(method.ContainingType) && method.IsInSameAssembly(type),\n            // ProtectedOrInternal corresponds to `protected internal`.\n            Accessibility.ProtectedOrInternal => type.DerivesFrom(method.ContainingType) || method.IsInSameAssembly(type),\n            Accessibility.Protected => type.DerivesFrom(method.ContainingType),\n            Accessibility.Internal => method.IsInSameAssembly(type),\n            Accessibility.Public => true,\n            _ => false,\n        };\n\n    private static bool IsInTypeOrNested(IMethodSymbol method, ITypeSymbol type) =>\n        type is not null && (method.IsInType(type) || IsInTypeOrNested(method, type.ContainingType));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/IssueSuppression.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class IssueSuppression : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S1309\";\n        private const string MessageFormat = \"Do not suppress issues.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var attribute = (AttributeSyntax)c.Node;\n\n                    if (!(c.Model.GetSymbolInfo(attribute).Symbol is IMethodSymbol attributeConstructor) ||\n                        !attributeConstructor.ContainingType.Is(KnownType.System_Diagnostics_CodeAnalysis_SuppressMessageAttribute))\n                    {\n                        return;\n                    }\n\n                    if (!(attribute.Name is IdentifierNameSyntax identifier))\n                    {\n                        identifier = (attribute.Name as QualifiedNameSyntax)?.Right as IdentifierNameSyntax;\n                    }\n\n                    if (identifier != null)\n                    {\n                        c.ReportIssue(Rule, identifier);\n                    }\n                },\n                SyntaxKind.Attribute);\n\n            context.RegisterTreeAction(\n                c =>\n                {\n                    foreach (var token in c.Tree.GetRoot().DescendantTokens())\n                    {\n                        CheckTrivias(c, token.LeadingTrivia);\n                        CheckTrivias(c, token.TrailingTrivia);\n                    }\n                });\n        }\n\n        private static void CheckTrivias(SonarSyntaxTreeReportingContext c, SyntaxTriviaList triviaList)\n        {\n            var pragmaWarnings = triviaList\n                .Where(t => t.HasStructure)\n                .Select(t => t.GetStructure())\n                .OfType<PragmaWarningDirectiveTriviaSyntax>()\n                .Where(t => t.DisableOrRestoreKeyword.IsKind(SyntaxKind.DisableKeyword));\n\n            foreach (var pragmaWarning in pragmaWarnings)\n            {\n                c.ReportIssue(Rule, pragmaWarning.CreateLocation(pragmaWarning.DisableOrRestoreKeyword));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/JSInvokableMethodsShouldBePublic.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class JSInvokableMethodsShouldBePublic : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S6798\";\n    private const string MessageFormat = \"Methods marked as 'JSInvokable' should be 'public'.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(c =>\n        {\n            if (c.Compilation.GetTypeByMetadataName(KnownType.Microsoft_JSInterop_JSInvokable) is not null)\n            {\n                c.RegisterNodeAction(CheckMethod, SyntaxKind.MethodDeclaration);\n            }\n        });\n\n    private static void CheckMethod(SonarSyntaxNodeReportingContext context)\n    {\n        var method = (MethodDeclarationSyntax)context.Node;\n        if (!method.Modifiers.AnyOfKind(SyntaxKind.PublicKeyword)\n            && method.AttributeLists.SelectMany(x => x.Attributes).Any(x => x.IsKnownType(KnownType.Microsoft_JSInterop_JSInvokable, context.Model)))\n        {\n            context.ReportIssue(Rule, method.Identifier);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/JwtSigned.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\nusing SonarAnalyzer.CSharp.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class JwtSigned : JwtSignedBase<SyntaxKind, InvocationExpressionSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n        public JwtSigned() : base(AnalyzerConfiguration.AlwaysEnabled) { }\n\n        protected override BuilderPatternCondition<SyntaxKind, InvocationExpressionSyntax> CreateBuilderPatternCondition() =>\n            new CSharpBuilderPatternCondition(JwtBuilderConstructorIsSafe, JwtBuilderDescriptors(\n                invocation =>\n                    invocation.ArgumentList?.Arguments.Count != 1\n                    || !invocation.ArgumentList.Arguments.Single().Expression.RemoveParentheses().IsKind(SyntaxKind.FalseLiteralExpression)));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/LdapConnectionShouldBeSecure.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class LdapConnectionShouldBeSecure : ObjectShouldBeInitializedCorrectlyBase\n{\n    private const string DiagnosticId = \"S4433\";\n    private const string MessageFormat = \"Set the 'AuthenticationType' property of this DirectoryEntry to 'AuthenticationTypes.Secure'.\";\n\n    private const int AuthenticationTypesNone = 0;\n    private const int AuthenticationTypesAnonymous = 16;\n\n    protected override CSharpObjectInitializationTracker ObjectInitializationTracker { get; } = new CSharpObjectInitializationTracker(\n        isAllowedConstantValue: x => x is int integerValue && !IsUnsafe(integerValue),\n        trackedTypes: ImmutableArray.Create(KnownType.System_DirectoryServices_DirectoryEntry),\n        isTrackedPropertyName: x => x == \"AuthenticationType\",\n        isAllowedObject: IsAllowedObject,\n        trackedConstructorArgumentIndex: 3);\n\n    public LdapConnectionShouldBeSecure() : base(AnalyzerConfiguration.AlwaysEnabled, DiagnosticId, MessageFormat) { }\n\n    private static bool IsAllowedObject(ISymbol authTypeSymbol, SyntaxNode authTypeExpression, SemanticModel model) =>\n        authTypeSymbol.GetSymbolType().Is(KnownType.System_DirectoryServices_AuthenticationTypes)\n        && !(authTypeExpression.FindConstantValue(model) is int authType && IsUnsafe(authType));\n\n    private static bool IsUnsafe(int authType) =>\n        authType is AuthenticationTypesNone or AuthenticationTypesAnonymous;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/LineLength.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class LineLength : LineLengthBase\n    {\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat, false);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override GeneratedCodeRecognizer GeneratedCodeRecognizer =>\n            CSharpGeneratedCodeRecognizer.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/LinkedListPropertiesInsteadOfMethods.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class LinkedListPropertiesInsteadOfMethods : LinkedListPropertiesInsteadOfMethodsBase<SyntaxKind, InvocationExpressionSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override bool IsRelevantCallAndType(InvocationExpressionSyntax invocation, SemanticModel model) =>\n        invocation.HasExactlyNArguments(0)\n        && invocation.Operands() is { Left: { } left, Right: { } right }\n        && IsRelevantType(right, model)\n        && IsCorrectType(left, model);\n\n    private static bool IsCorrectType(SyntaxNode left, SemanticModel model) =>\n        model.GetTypeInfo(left).Type is { } type && type.DerivesFrom(KnownType.System_Collections_Generic_LinkedList_T);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/LinkedListPropertiesInsteadOfMethodsCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class LinkedListPropertiesInsteadOfMethodsCodeFix : SonarCodeFix\n    {\n        private const string Title = \"Replace extension method call with property\";\n\n        public override ImmutableArray<string> FixableDiagnosticIds { get; } =\n            ImmutableArray.Create(LinkedListPropertiesInsteadOfMethods.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            var identifierSyntax = (IdentifierNameSyntax)root.FindNode(diagnosticSpan, getInnermostNodeForTie: true);\n\n            if (identifierSyntax is { Parent: ExpressionSyntax { Parent: InvocationExpressionSyntax invocationExpression } expression })\n            {\n                var newMember = SyntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, expression, SyntaxFactory.IdentifierName(\"Value\"));\n                context.RegisterCodeFix(\n                    Title,\n                    _ =>\n                    {\n                        var newRoot = root.ReplaceNode(invocationExpression, newMember);\n                        return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                    },\n                    context.Diagnostics);\n            }\n            return Task.CompletedTask;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/LiteralSuffixUpperCase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class LiteralSuffixUpperCase : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S818\";\n        private const string MessageFormat = \"Upper case this literal suffix.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                static c =>\n                {\n                    var literal = (LiteralExpressionSyntax)c.Node;\n                    var text = literal.Token.Text;\n\n                    if (text[text.Length - 1] == 'l' && !ShouldIgnore(text))\n                    {\n                        c.ReportIssue(Rule, Location.Create(literal.SyntaxTree, new TextSpan(literal.Span.End - 1, 1)));\n                    }\n                },\n                SyntaxKind.NumericLiteralExpression);\n\n        // We know that @text is a number that ends with 'l'. Being a number, it has at least one digit (thus 2 characters).\n        // If it has 3 characters or more, it could be `2ul` or `2Ul` and we ignore this, because 'l' is easier to read.\n        private static bool ShouldIgnore(string text) =>\n            text.Length > 2 && text[text.Length - 2] is 'U' or 'u';\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/LiteralSuffixUpperCaseCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class LiteralSuffixUpperCaseCodeFix : SonarCodeFix\n    {\n        private const string Title = \"Make literal suffix upper case\";\n        private const string LowercaseEllSuffix = \"CS0078\";     // The 'l' suffix is easily confused with the digit '1' -- use 'L' for clarity: 25l -> 25L\n\n        public override ImmutableArray<string> FixableDiagnosticIds\n        {\n            get\n            {\n                return ImmutableArray.Create(LiteralSuffixUpperCase.DiagnosticId, LowercaseEllSuffix);\n            }\n        }\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            if (!(root.FindNode(diagnosticSpan, getInnermostNodeForTie: true) is LiteralExpressionSyntax literal))\n            {\n                return Task.CompletedTask;\n            }\n\n            var newLiteral = SyntaxFactory.Literal(\n                literal.Token.Text.ToUpperInvariant(),\n                (long)literal.Token.Value);\n\n            if (!newLiteral.IsKind(SyntaxKind.None))\n            {\n                context.RegisterCodeFix(\n                    Title,\n                    c =>\n                    {\n                        var newRoot = root.ReplaceNode(literal,\n                            literal.WithToken(newLiteral).WithTriviaFrom(literal));\n                        return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                    },\n                    context.Diagnostics);\n            }\n\n            return Task.CompletedTask;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/LiteralsShouldNotBePassedAsLocalizedParameters.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class LiteralsShouldNotBePassedAsLocalizedParameters : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S4055\";\n        private const string MessageFormat = \"Replace this string literal with a string retrieved through an instance of the 'ResourceManager' class.\";\n\n        private static readonly HashSet<string> LocalizableSymbolNames = new(StringComparer.OrdinalIgnoreCase)\n        {\n            \"TEXT\",\n            \"CAPTION\",\n            \"MESSAGE\"\n        };\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(AnalyzeInvocations, SyntaxKind.InvocationExpression);\n            context.RegisterNodeAction(AnalyzeAssignments, SyntaxKind.SimpleAssignmentExpression);\n        }\n\n        private static void AnalyzeInvocations(SonarSyntaxNodeReportingContext context)\n        {\n            var invocationSyntax = (InvocationExpressionSyntax)context.Node;\n            if (!(context.Model.GetSymbolInfo(invocationSyntax).Symbol is IMethodSymbol methodSymbol) || invocationSyntax.ArgumentList is null)\n            {\n                return;\n            }\n\n            // Calling to/from debug-only code\n            if (methodSymbol.IsDiagnosticDebugMethod()\n                || methodSymbol.IsConditionalDebugMethod()\n                || invocationSyntax.IsInConditionalDebug(context.Model))\n            {\n                return;\n            }\n\n            if (methodSymbol.IsConsoleWrite() || methodSymbol.IsConsoleWriteLine())\n            {\n                var firstArgument = invocationSyntax.ArgumentList.Arguments.FirstOrDefault();\n                if (IsStringLiteral(firstArgument?.Expression, context.Model))\n                {\n                    context.ReportIssue(Rule, firstArgument);\n                }\n                return;\n            }\n\n            var nonCompliantParameters = methodSymbol.Parameters\n                .Merge(invocationSyntax.ArgumentList.Arguments, (parameter, syntax) => new { parameter, syntax })\n                .Where(x => IsLocalizableStringLiteral(x.parameter, x.syntax, context.Model));\n\n            foreach (var nonCompliantParameter in nonCompliantParameters)\n            {\n                context.ReportIssue(Rule, nonCompliantParameter.syntax);\n            }\n        }\n\n        private static void AnalyzeAssignments(SonarSyntaxNodeReportingContext context)\n        {\n            var assignmentSyntax = (AssignmentExpressionSyntax)context.Node;\n            if (assignmentSyntax.IsInConditionalDebug(context.Model))\n            {\n                return;\n            }\n\n            var assignmentMappings = assignmentSyntax.MapAssignmentArguments();\n            foreach (var assignmentMapping in assignmentMappings)\n            {\n                if (context.Model.GetSymbolInfo(assignmentMapping.Left).Symbol is IPropertySymbol propertySymbol\n                    && IsLocalizable(propertySymbol)\n                    && IsStringLiteral(assignmentMapping.Right, context.Model))\n                {\n                    context.ReportIssue(Rule, assignmentMapping.Right);\n                }\n            }\n        }\n\n        private static bool IsStringLiteral(SyntaxNode expression, SemanticModel model) =>\n            expression is not null && model.GetConstantValue(expression) is { HasValue: true, Value: string _ };\n\n        private static bool IsLocalizable(ISymbol symbol) =>\n            symbol?.Name is not null\n            && symbol.GetAttributes(KnownType.System_ComponentModel_LocalizableAttribute) is var localizableAttributes\n            && IsLocalizable(symbol.Name, new List<AttributeData>(localizableAttributes));\n\n        private static bool IsLocalizable(string symbolName, IReadOnlyCollection<AttributeData> localizableAttributes) =>\n            localizableAttributes.Any(x => HasConstructorWitValue(x, true))\n            || (symbolName.SplitCamelCaseToWords().Any(LocalizableSymbolNames.Contains)\n               && (!localizableAttributes.Any(x => HasConstructorWitValue(x, false))));\n\n        private static bool IsLocalizableStringLiteral(ISymbol symbol, ArgumentSyntax argumentSyntax, SemanticModel model) =>\n            symbol is not null\n            && argumentSyntax is not null\n            && IsLocalizable(symbol)\n            && IsStringLiteral(argumentSyntax.Expression, model);\n\n        private static bool HasConstructorWitValue(AttributeData attribute, bool expectedValue) =>\n            attribute.ConstructorArguments.Any(x => x.Value is bool boolValue && boolValue == expectedValue);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/LockedFieldShouldBeReadonly.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class LockedFieldShouldBeReadonly : SonarDiagnosticAnalyzer\n{\n    private const string LockedFieldDiagnosticId = \"S2445\";\n    private const string LocalVariableDiagnosticId = \"S6507\";\n    private const string MessageFormat = \"Do not lock on {0}, use a readonly field instead.\";\n\n    private static readonly DiagnosticDescriptor LockedFieldRule = DescriptorFactory.Create(LockedFieldDiagnosticId, MessageFormat);\n    private static readonly DiagnosticDescriptor LocalVariableRule = DescriptorFactory.Create(LocalVariableDiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(LockedFieldRule, LocalVariableRule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(CheckLockStatement, SyntaxKind.LockStatement);\n\n    private static void CheckLockStatement(SonarSyntaxNodeReportingContext context)\n    {\n        var expression = ((LockStatementSyntax)context.Node).Expression?.RemoveParentheses();\n        if (IsCreation(expression))\n        {\n            context.ReportIssue(LockedFieldRule, expression, \"a new instance because is a no-op\");\n        }\n        else\n        {\n            var lazySymbol = new Lazy<ISymbol>(() => context.Model.GetSymbolInfo(expression).Symbol);\n            if (IsOfTypeString(expression, lazySymbol))\n            {\n                context.ReportIssue(LockedFieldRule, expression, \"strings as they can be interned\");\n            }\n            else if (expression is IdentifierNameSyntax && lazySymbol.Value is ILocalSymbol localSymbol)\n            {\n                context.ReportIssue(LocalVariableRule, expression, $\"local variable '{localSymbol.Name}'\");\n            }\n            else if (FieldWritable(expression, lazySymbol) is { } field)\n            {\n                context.ReportIssue(LockedFieldRule, expression, $\"writable field '{field.Name}'\");\n            }\n        }\n    }\n\n    private static bool IsCreation(ExpressionSyntax expression) =>\n        expression?.Kind() is\n            SyntaxKind.ObjectCreationExpression or\n            SyntaxKind.AnonymousObjectCreationExpression or\n            SyntaxKind.ArrayCreationExpression or\n            SyntaxKind.ImplicitArrayCreationExpression or\n            SyntaxKind.QueryExpression;\n\n    private static bool IsOfTypeString(ExpressionSyntax expression, Lazy<ISymbol> lazySymbol) =>\n        expression?.Kind() is SyntaxKind.StringLiteralExpression or SyntaxKind.InterpolatedStringExpression\n        || lazySymbol.Value.GetSymbolType().Is(KnownType.System_String);\n\n    private static IFieldSymbol FieldWritable(ExpressionSyntax expression, Lazy<ISymbol> lazySymbol) =>\n        expression?.Kind() is SyntaxKind.IdentifierName or SyntaxKind.SimpleMemberAccessExpression\n        && lazySymbol.Value is IFieldSymbol lockedField && !lockedField.IsReadOnly\n            ? lockedField\n            : null;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/LoggerFieldsShouldBePrivateStaticReadonly.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class LoggerFieldsShouldBePrivateStaticReadonly : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S1312\";\n    private const string MessageFormat = \"Make the logger '{0}' private static readonly.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    private static readonly KnownAssembly[] LoggingFrameworks =\n        [\n            KnownAssembly.MicrosoftExtensionsLoggingAbstractions,\n            KnownAssembly.NLog,\n            KnownAssembly.Serilog,\n            KnownAssembly.Log4Net,\n            KnownAssembly.CastleCore,\n        ];\n\n    private static readonly ImmutableArray<KnownType> Loggers = ImmutableArray.Create(\n        KnownType.Microsoft_Extensions_Logging_ILogger,\n        KnownType.Microsoft_Extensions_Logging_ILogger_TCategoryName,\n        KnownType.NLog_ILogger,\n        KnownType.NLog_ILoggerBase,\n        KnownType.NLog_Logger,\n        KnownType.Serilog_ILogger,\n        KnownType.log4net_ILog,\n        KnownType.log4net_Core_ILogger,\n        KnownType.Castle_Core_Logging_ILogger);\n\n    private static readonly HashSet<SyntaxKind> InvalidAccessModifiers =\n        [\n            SyntaxKind.ProtectedKeyword,\n            SyntaxKind.InternalKeyword,\n            SyntaxKind.PublicKeyword\n        ];\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(cc =>\n        {\n            if (cc.Compilation.ReferencesAny(LoggingFrameworks))\n            {\n                cc.RegisterNodeAction(c =>\n                {\n                    foreach (var invalid in InvalidFields((FieldDeclarationSyntax)c.Node, c.Model))\n                    {\n                        c.ReportIssue(Rule, invalid, invalid.ValueText);\n                    }\n                },\n                SyntaxKind.FieldDeclaration);\n            }\n        });\n\n    private static IEnumerable<SyntaxToken> InvalidFields(BaseFieldDeclarationSyntax field, SemanticModel model)\n    {\n        if (field.Modifiers.Any(x => x.IsKind(SyntaxKind.StaticKeyword))\n            && field.Modifiers.Any(x => x.IsKind(SyntaxKind.ReadOnlyKeyword))\n            && field.Modifiers.All(x => !x.IsAnyKind(InvalidAccessModifiers)))\n        {\n            yield break;\n        }\n\n        foreach (var variable in field.Declaration.Variables.Where(ShouldRaise))\n        {\n            yield return variable.Identifier;\n        }\n\n        bool ShouldRaise(VariableDeclaratorSyntax variable) =>\n            model.GetDeclaredSymbol(variable) is { } symbol\n            && !symbol.ContainingType.IsInterface() // exclude default interface implementation fields\n            && symbol.GetSymbolType().DerivesOrImplementsAny(Loggers);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/LoggerMembersNamesShouldComply.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text.RegularExpressions;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class LoggerMembersNamesShouldComply : ParametrizedDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S6669\";\n    private const string MessageFormat = \"Rename this {0} '{1}' to match the regular expression '{2}'.\";\n    private const string DefaultFormat = \"^_?[Ll]og(ger)?$\"; // unused unless the user changes the regex\n\n    private static readonly ImmutableHashSet<string> DefaultAllowedNames = ImmutableHashSet.Create(\n        \"log\",\n        \"Log\",\n        \"_log\",\n        \"_Log\",\n        \"logger\",\n        \"Logger\",\n        \"_logger\",\n        \"_Logger\",\n        \"instance\",\n        \"Instance\"); // \"Instance\" is a common name for singleton pattern\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat, isEnabledByDefault: false);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics =>\n        ImmutableArray.Create(Rule);\n\n    [RuleParameter(\"format\", PropertyType.RegularExpression, \"Regular expression used to check the field or property names against\", DefaultFormat)]\n    public string Format { get; set; } = DefaultFormat;\n\n    private bool UsesDefaultFormat => Format == DefaultFormat;\n\n    private Regex NameRegex { get; set; }\n\n    private static readonly ImmutableArray<KnownType> Loggers = ImmutableArray.Create(\n        KnownType.Microsoft_Extensions_Logging_ILogger,\n        KnownType.Microsoft_Extensions_Logging_ILogger_TCategoryName,\n        KnownType.Serilog_ILogger,\n        KnownType.NLog_ILogger,\n        KnownType.NLog_ILoggerBase,\n        KnownType.NLog_Logger,\n        KnownType.log4net_ILog,\n        KnownType.log4net_Core_ILogger,\n        KnownType.Castle_Core_Logging_ILogger);\n\n    private static readonly KnownAssembly[] Assemblies =\n    [\n        KnownAssembly.MicrosoftExtensionsLoggingAbstractions,\n        KnownAssembly.Serilog,\n        KnownAssembly.NLog,\n        KnownAssembly.Log4Net,\n        KnownAssembly.CastleCore\n    ];\n\n    protected override void Initialize(SonarParametrizedAnalysisContext context) =>\n        context.RegisterCompilationStartAction(cc =>\n        {\n            if (cc.Compilation.ReferencesAny(Assemblies))\n            {\n                NameRegex = UsesDefaultFormat ? null : new(Format, RegexOptions.Compiled, Constants.DefaultRegexTimeout);\n\n                cc.RegisterNodeAction(c =>\n                {\n                    foreach (var memberData in Declarations(c.Node))\n                    {\n                        if (!MatchesFormat(memberData.Name)\n                            && c.Model.GetDeclaredSymbol(memberData.Member).GetSymbolType() is { } type\n                            && type.DerivesOrImplementsAny(Loggers))\n                        {\n                            c.ReportIssue(Rule, memberData.Location, memberData.MemberType, memberData.Name, Format);\n                        }\n                    }\n                },\n                SyntaxKind.FieldDeclaration,\n                SyntaxKind.PropertyDeclaration);\n            }\n        });\n\n    private bool MatchesFormat(string name) =>\n        UsesDefaultFormat\n        ? DefaultAllowedNames.Contains(name) // for performance, if the user doesn't change the regex, we can use a hashtable lookup\n        : NameRegex.SafeIsMatch(name);\n\n    private static IEnumerable<MemberData> Declarations(SyntaxNode node)\n    {\n        if (node is FieldDeclarationSyntax field)\n        {\n            // can be multiple variables in a single declaration\n            foreach (var variable in field.Declaration.Variables)\n            {\n                yield return new(variable, variable.Identifier.GetLocation(), variable.Identifier.ValueText, false);\n            }\n        }\n        else if (node is PropertyDeclarationSyntax property)\n        {\n            yield return new(property, property.Identifier.GetLocation(), property.Identifier.ValueText, true);\n        }\n    }\n\n    private readonly record struct MemberData(SyntaxNode Member, Location Location, string Name, bool IsProperty)\n    {\n        public readonly string MemberType => IsProperty ? \"property\" : \"field\";\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/LoggersShouldBeNamedForEnclosingType.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class LoggersShouldBeNamedForEnclosingType : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S3416\";\n    private const string MessageFormat = \"Update this logger to use its enclosing type.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    private static readonly KnownAssembly[] SupportedFrameworks =\n        [\n            KnownAssembly.MicrosoftExtensionsLoggingAbstractions,\n            KnownAssembly.NLog,\n            KnownAssembly.Log4Net,\n        ];\n\n    private static readonly ImmutableArray<KnownType> Loggers = ImmutableArray.Create(\n        KnownType.Microsoft_Extensions_Logging_ILogger,\n        KnownType.Microsoft_Extensions_Logging_ILogger_TCategoryName,\n        KnownType.NLog_Logger,\n        KnownType.NLog_ILogger,\n        KnownType.NLog_ILoggerBase,\n        KnownType.log4net_ILog);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(cc =>\n        {\n            if (cc.Compilation.ReferencesAny(SupportedFrameworks))\n            {\n                cc.RegisterNodeAction(Process, SyntaxKind.InvocationExpression);\n            }\n        });\n\n    private static void Process(SonarSyntaxNodeReportingContext context)\n    {\n        var invocation = (InvocationExpressionSyntax)context.Node;\n\n        if (invocation.GetName() is \"GetLogger\" or \"CreateLogger\"\n            && EnclosingTypeNode(invocation) is { } enclosingType // filter out top-level statements, choose new() first and then enclosing type\n            && ExtractArgument(invocation) is { } argument\n            && context.Model.GetSymbolInfo(invocation).Symbol is IMethodSymbol method\n            && IsValidMethod(method)\n            && !MatchesEnclosingType(argument, enclosingType, context.Model))\n        {\n            context.ReportIssue(Rule, argument);\n        }\n    }\n\n    private static SyntaxNode EnclosingTypeNode(InvocationExpressionSyntax invocation)\n    {\n        var ancestors = invocation.Ancestors();\n        return (SyntaxNode)ancestors.OfType<ObjectCreationExpressionSyntax>().FirstOrDefault() // prioritize new() over enclosing type\n                    ?? ancestors.OfType<TypeDeclarationSyntax>().FirstOrDefault();\n    }\n\n    // Extracts T for generic argument, nameof or typeof expressions\n    private static SyntaxNode ExtractArgument(InvocationExpressionSyntax invocation)\n    {\n        // CreateLogger<T>\n        if (ExtractGeneric(invocation) is { } generic)\n        {\n            return generic;\n        }\n        else if (invocation.ArgumentList?.Arguments.Count == 1)\n        {\n            return invocation.ArgumentList.Arguments[0].Expression switch\n            {\n                TypeOfExpressionSyntax typeOf => typeOf.Type,                                   // CreateLogger(typeof(T))\n                MemberAccessExpressionSyntax memberAccess => ExtractTypeOfName(memberAccess),   // CreateLogger(typeof(T).Name)\n                InvocationExpressionSyntax innerInvocation => ExtractNameOf(innerInvocation),   // CreateLogger(nameof(T))\n                _ => null\n            };\n        }\n        else\n        {\n            return null;\n        }\n    }\n\n    private static bool IsValidMethod(IMethodSymbol method)\n    {\n        return Matches(KnownType.Microsoft_Extensions_Logging_ILoggerFactory, true)\n            || Matches(KnownType.Microsoft_Extensions_Logging_LoggerFactoryExtensions, false)\n            || Matches(KnownType.NLog_LogManager, false)\n            || Matches(KnownType.NLog_LogFactory, true)\n            || Matches(KnownType.log4net_LogManager, false)\n            || MatchesGeneric();\n\n        bool Matches(KnownType containingType, bool checkDerived) =>\n            method.HasContainingType(containingType, checkDerived)\n            && method.Parameters.Length == 1\n            && method.Parameters[0].Type.IsAny(KnownType.System_String, KnownType.System_Type);\n\n        bool MatchesGeneric() =>\n            method.ContainingType.Is(KnownType.Microsoft_Extensions_Logging_LoggerFactoryExtensions)\n            && method.TypeParameters.Length == 1;\n    }\n\n    private static bool MatchesEnclosingType(SyntaxNode argument, SyntaxNode enclosingNode, SemanticModel model) =>\n        model.GetTypeInfo(argument).Type is { } argumentType\n        && EnclosingTypeSymbol(model, enclosingNode) is { } enclosingType\n        && (enclosingType.Equals(argumentType)\n            || argumentType.TypeKind is TypeKind.TypeParameter  // Do not raise on CreateLogger<T> if T is not concrete\n            || enclosingType.DerivesOrImplementsAny(Loggers));  // Do not raise on Decorator pattern\n\n    private static ITypeSymbol EnclosingTypeSymbol(SemanticModel model, SyntaxNode enclosingNode) =>\n        (model.GetDeclaredSymbol(enclosingNode) ?? model.GetSymbolInfo(enclosingNode).Symbol).GetSymbolType();\n\n    private static SyntaxNode ExtractGeneric(InvocationExpressionSyntax invocation)\n    {\n        var genericName = invocation.Expression switch\n        {\n            GenericNameSyntax g => g, // CreateLogger<T>\n            MemberAccessExpressionSyntax memberAccess => memberAccess.Name as GenericNameSyntax, // A..B.CreateLogger<T>\n            _ => null\n        };\n\n        return genericName?.TypeArgumentList?.Arguments.Count == 1\n            ? genericName.TypeArgumentList.Arguments[0]\n            : null;\n    }\n\n    private static SyntaxNode ExtractTypeOfName(MemberAccessExpressionSyntax memberAccess) =>\n        memberAccess.Expression is TypeOfExpressionSyntax typeOf\n        && memberAccess.GetName() is \"Name\" or \"FullName\" or \"AssemblyQualifiedName\"\n            ? typeOf.Type\n            : null;\n\n    private static SyntaxNode ExtractNameOf(InvocationExpressionSyntax invocation) =>\n        invocation.NameIs(\"nameof\") && invocation.ArgumentList?.Arguments.Count == 1\n            ? invocation.ArgumentList?.Arguments[0].Expression\n            : null;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/LoggingArgumentsShouldBePassedCorrectly.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing static Roslyn.Utilities.SonarAnalyzer.Shared.LoggingFrameworkMethods;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class LoggingArgumentsShouldBePassedCorrectly : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S6668\";\n    private const string MessageFormat = \"Logging arguments should be passed to the correct parameter.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    private static readonly ImmutableArray<KnownType> MicrosoftLoggingExtensionsInvalidTypes =\n        ImmutableArray.Create(KnownType.System_Exception, KnownType.Microsoft_Extensions_Logging_LogLevel, KnownType.Microsoft_Extensions_Logging_EventId);\n    private static readonly ImmutableArray<KnownType> CastleCoreInvalidTypes = ImmutableArray.Create(KnownType.System_Exception);\n    private static readonly ImmutableArray<KnownType> NLogAndSerilogInvalidTypes = ImmutableArray.Create(KnownType.System_Exception, KnownType.Serilog_Events_LogEventLevel, KnownType.NLog_LogLevel);\n    private static readonly HashSet<string> LoggingMethodNames = MicrosoftExtensionsLogging\n        .Concat(NLogLoggingMethods)\n        .Concat(Serilog)\n        .Concat(CastleCoreOrCommonCore)\n        .ToHashSet();\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var invocation = (InvocationExpressionSyntax)c.Node;\n                if (!LoggingMethodNames.Contains(invocation.GetName())\n                    || c.Model.GetSymbolInfo(invocation).Symbol is not IMethodSymbol invocationSymbol)\n                {\n                    return;\n                }\n                if (invocationSymbol.HasContainingType(KnownType.Microsoft_Extensions_Logging_LoggerExtensions, false))\n                {\n                    CheckInvalidParams(invocation, invocationSymbol, c, Filter(invocationSymbol, MicrosoftLoggingExtensionsInvalidTypes));\n                }\n                else if (invocationSymbol.HasContainingType(KnownType.Castle_Core_Logging_ILogger, true))\n                {\n                    CheckInvalidParams(invocation, invocationSymbol, c, Filter(invocationSymbol, CastleCoreInvalidTypes));\n                }\n                else if (invocationSymbol.HasContainingType(KnownType.Serilog_ILogger, true)\n                         || invocationSymbol.HasContainingType(KnownType.Serilog_Log, false)\n                         || invocationSymbol.HasContainingType(KnownType.NLog_ILoggerBase, true)\n                         || invocationSymbol.HasContainingType(KnownType.NLog_ILoggerExtensions, false))\n                {\n                    var knownTypes = Filter(invocationSymbol, NLogAndSerilogInvalidTypes);\n                    CheckInvalidParams(invocation, invocationSymbol, c, knownTypes);\n                    CheckInvalidTypeParams(invocation, invocationSymbol, c, knownTypes);\n                }\n            },\n            SyntaxKind.InvocationExpression);\n\n    private static void CheckInvalidParams(InvocationExpressionSyntax invocation, IMethodSymbol invocationSymbol, SonarSyntaxNodeReportingContext c, ImmutableArray<KnownType> knownTypes)\n    {\n        var paramsParameter = invocationSymbol.Parameters.FirstOrDefault(x => x.IsParams);\n        if (paramsParameter is null || knownTypes.IsEmpty)\n        {\n            return;\n        }\n\n        var paramsIndex = invocationSymbol.Parameters.IndexOf(paramsParameter);\n        var invalidArguments = invocation.ArgumentList.Arguments\n            .Where(x => x.GetArgumentIndex() >= paramsIndex && IsInvalidArgument(x, c.Model, knownTypes))\n            .ToSecondaryLocations()\n            .ToArray();\n        if (invalidArguments.Length > 0)\n        {\n            c.ReportIssue(Rule, invocation.Expression, invalidArguments);\n        }\n    }\n\n    private static void CheckInvalidTypeParams(InvocationExpressionSyntax invocation, IMethodSymbol methodSymbol, SonarSyntaxNodeReportingContext c, ImmutableArray<KnownType> knownTypes)\n    {\n        if (!knownTypes.IsEmpty && !IsNLogIgnoredOverload(methodSymbol) && methodSymbol.TypeArguments.Any(x => x.DerivesFromAny(knownTypes)))\n        {\n            var typeParameterNames = methodSymbol.TypeParameters.Select(x => x.MetadataName).ToArray();\n            var positions = methodSymbol.ConstructedFrom.Parameters.Where(x => typeParameterNames.Contains(x.Type.MetadataName)).Select(x => methodSymbol.ConstructedFrom.Parameters.IndexOf(x));\n            var invalidArguments = InvalidArguments(invocation, c.Model, positions, knownTypes).ToSecondaryLocations();\n            c.ReportIssue(Rule, invocation.Expression, invalidArguments);\n        }\n    }\n\n    private static bool IsNLogIgnoredOverload(IMethodSymbol methodSymbol) =>\n        // These overloads are ignored since they will try to convert the T value to an exception.\n        MatchesParams(methodSymbol, KnownType.System_Exception)\n        || MatchesParams(methodSymbol, KnownType.System_IFormatProvider, KnownType.System_Exception)\n        || MatchesParams(methodSymbol, KnownType.NLog_ILogger, KnownType.System_Exception)\n        || MatchesParams(methodSymbol, KnownType.NLog_ILogger, KnownType.System_IFormatProvider, KnownType.System_Exception)\n        || MatchesParams(methodSymbol, KnownType.NLog_LogLevel, KnownType.System_Exception)\n        || MatchesParams(methodSymbol, KnownType.NLog_LogLevel, KnownType.System_IFormatProvider, KnownType.System_Exception);\n\n    private static bool MatchesParams(IMethodSymbol methodSymbol, params KnownType[] knownTypes) =>\n        methodSymbol.Parameters.Length == knownTypes.Length\n        && !methodSymbol.Parameters.Where((x, index) => !x.Type.DerivesFrom(knownTypes[index])).Any();\n\n    private static IEnumerable<ArgumentSyntax> InvalidArguments(InvocationExpressionSyntax invocation, SemanticModel model, IEnumerable<int> positionsToCheck, ImmutableArray<KnownType> knownTypes) =>\n        positionsToCheck\n            .Select(x => invocation.ArgumentList.Arguments[x])\n            .Where(x => IsInvalidArgument(x, model, knownTypes));\n\n    private static bool IsInvalidArgument(ArgumentSyntax argumentSyntax, SemanticModel model, ImmutableArray<KnownType> knownTypes) =>\n        model.GetTypeInfo(argumentSyntax.Expression).Type?.DerivesFromAny(knownTypes) is true;\n\n    // This method filters out the types that the method accepts strongly:\n    // logger.Debug(exception, \"template\", exception)\n    //              ^^^^^^^^^ valid\n    //                                     ^^^^^^^^^ do not raise\n    private static ImmutableArray<KnownType> Filter(IMethodSymbol methodSymbol, ImmutableArray<KnownType> knownTypes) =>\n        knownTypes.Where(knownType => !methodSymbol.ConstructedFrom.Parameters.Any(x => x.Type.DerivesFrom(knownType))).ToImmutableArray();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/LoopsAndLinq.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Roslyn.Utilities;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class LoopsAndLinq : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S3267\";\n    private const string MessageFormat = \"{0}\";\n    private const string WhereMessageFormat = @\"Loops should be simplified using the \"\"Where\"\" LINQ method\";\n    private const string SelectMessageFormat = \"Loop should be simplified by calling Select({0} => {0}.{1}))\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var forEachStatementSyntax = (ForEachStatementSyntax)c.Node;\n                if (!IsOrImplementsIEnumerable(c.Model, forEachStatementSyntax)\n                    || IsInPerformanceSensitiveContext(forEachStatementSyntax, c.Model))\n                {\n                    return;\n                }\n\n                if (CanBeSimplifiedUsingWhere(forEachStatementSyntax.Statement, c, out var ifConditionLocation))\n                {\n                    c.ReportIssue(Rule, forEachStatementSyntax.Expression, [ifConditionLocation], WhereMessageFormat);\n                }\n                else\n                {\n                    CheckIfCanBeSimplifiedUsingSelect(c, forEachStatementSyntax);\n                }\n            },\n            SyntaxKind.ForEachStatement);\n\n    private static bool IsInPerformanceSensitiveContext(ForEachStatementSyntax node, SemanticModel model) =>\n        node.PerformanceSensitiveAttribute(model) is { } attribute\n        // If AllowGenericEnumeration property is configured to true, in the context of the rule, we are not in a performance sensitive context\n        && (!attribute.TryGetAttributeValue<bool>(nameof(PerformanceSensitiveAttribute.AllowGenericEnumeration), out var allow) || allow);\n\n    private static bool CanBeSimplifiedUsingWhere(SyntaxNode statement, SonarSyntaxNodeReportingContext context, out SecondaryLocation ifConditionLocation)\n    {\n        if (IfStatement(statement) is { } ifStatementSyntax\n            && CanIfStatementBeMoved(ifStatementSyntax)\n            && !ContainsRefStructReference(ifStatementSyntax, context.Model))\n        {\n            ifConditionLocation = ifStatementSyntax.Condition.ToSecondaryLocation();\n            // If the 'if' block contains a single return or assignment with a break,\n            // we cannot simplify the loop using LINQ if the return or assignment is a nullable conversion.\n            // also see https://sonarsource.atlassian.net/browse/NET-1222\n            return SingleReturnOrBreakingAssignment(ifStatementSyntax) is not { } returnOrAssignment\n                || !RequiresNullableConversion(returnOrAssignment, context);\n        }\n\n        ifConditionLocation = null;\n        return false;\n    }\n\n    private static bool ContainsRefStructReference(IfStatementSyntax ifStatement, SemanticModel model) =>\n        ifStatement.DescendantNodes()\n            .OfType<IdentifierNameSyntax>()\n            .Any(x => model.GetTypeInfo(x).Type?.IsRefStruct() == true);\n\n    private static bool RequiresNullableConversion(SyntaxNode returnOrAssignment, SonarSyntaxNodeReportingContext context)\n    {\n        var expression = returnOrAssignment switch\n        {\n            ReturnStatementSyntax returnStatement => returnStatement.Expression,\n            AssignmentExpressionSyntax assignment => assignment.Right,\n            _ => throw new InvalidOperationException(\"Unreachable\")\n        };\n\n        // expression can be null if the return statement is empty\n        return expression is not null\n            && context.Model.GetTypeInfo(expression) is { Type: { } type, ConvertedType: { } convertedType }\n            && context.Compilation.ClassifyConversion(type, convertedType).IsNullable;\n    }\n\n    private static SyntaxNode SingleReturnOrBreakingAssignment(IfStatementSyntax ifStatementSyntax)\n    {\n        // Check if the first statement of the block is a return\n        if (ifStatementSyntax.Statement is { FirstNonBlockStatement: ReturnStatementSyntax returnStatement })\n        {\n            return returnStatement;\n        }\n\n        // Check if the statement is a block with a single assignment followed by a break\n        if (ifStatementSyntax.Statement is BlockSyntax { Statements: { Count: 2 } statements }\n            && statements[0] is ExpressionStatementSyntax { Expression: AssignmentExpressionSyntax assignment }\n            && statements[1] is BreakStatementSyntax)\n        {\n            return assignment;\n        }\n        return null;\n    }\n\n    private static IfStatementSyntax IfStatement(SyntaxNode node) =>\n        node switch\n        {\n            IfStatementSyntax ifStatementSyntax => ifStatementSyntax,\n            BlockSyntax blockSyntax when blockSyntax.ChildNodes().Count() == 1 => IfStatement(blockSyntax.ChildNodes().Single()),\n            _ => null\n        };\n\n    private static bool CanIfStatementBeMoved(IfStatementSyntax ifStatementSyntax) =>\n        ifStatementSyntax.Else is null && IsValidCondition(ifStatementSyntax.Condition);\n\n    private static bool IsValidCondition(ExpressionSyntax condition) =>\n        condition switch\n        {\n            _ when condition.Kind() is SyntaxKind.IsExpression or SyntaxKindEx.IsPatternExpression => IsValidIsPattern(condition),\n            InvocationExpressionSyntax invocation => IsValidInvocation(invocation),\n            BinaryExpressionSyntax binary => IsValidBinaryExpression(binary),\n            PrefixUnaryExpressionSyntax unary => IsValidCondition(unary.Operand),\n            IdentifierNameSyntax => true,\n            LiteralExpressionSyntax => true,\n            _ => false\n        };\n\n    private static bool IsValidBinaryExpression(BinaryExpressionSyntax expression) =>\n        IsValidCondition(expression.Left) && IsValidCondition(expression.Right);\n\n    private static bool IsValidInvocation(InvocationExpressionSyntax invocationExpressionSyntax) =>\n        !invocationExpressionSyntax.DescendantNodes()\n            .OfType<ArgumentSyntax>()\n            .Any(x => x.RefOrOutKeyword.Kind() is SyntaxKind.OutKeyword or SyntaxKind.RefKeyword);\n\n    private static bool IsValidIsPattern(SyntaxNode isPattern) =>\n        !isPattern.DescendantNodes()\n            .Any(x => x.Kind() is SyntaxKindEx.VarPattern\n                                    or SyntaxKindEx.SingleVariableDesignation\n                                    or SyntaxKindEx.ParenthesizedVariableDesignation);\n\n    /// <remarks>\n    /// There are multiple scenarios where the code can be simplified using LINQ.\n    /// For simplicity, we consider that Select() can be used\n    /// only when a single property from the foreach variable is used.\n    /// We skip checking method invocations since depending on the method being called, moving it can make the code harder to read.\n    /// The issue is raised if:\n    ///  - the property is used more than once\n    ///  - the property is the right side of a variable declaration.\n    /// </remarks>\n    private static void CheckIfCanBeSimplifiedUsingSelect(SonarSyntaxNodeReportingContext c, ForEachStatementSyntax forEachStatementSyntax)\n    {\n        var declaredSymbol = new Lazy<ILocalSymbol>(() => c.Model.GetDeclaredSymbol(forEachStatementSyntax));\n\n        var accessedProperties = new Dictionary<ISymbol, UsageStats>();\n\n        foreach (var identifierSyntax in GetStatementIdentifiers(forEachStatementSyntax))\n        {\n            if (identifierSyntax.Parent is MemberAccessExpressionSyntax { Parent: not InvocationExpressionSyntax } memberAccessExpressionSyntax\n                && IsNotLeftSideOfAssignment(memberAccessExpressionSyntax)\n                && c.Model.GetSymbolInfo(identifierSyntax).Symbol is { } identifierSymbol\n                && identifierSymbol.Equals(declaredSymbol.Value)\n                && c.Model.GetSymbolInfo(memberAccessExpressionSyntax.Name).Symbol is { } symbol\n                && !symbol.GetSymbolType().IsRefStruct())\n            {\n                var usageStats = accessedProperties.GetOrAdd(symbol, _ => new UsageStats());\n\n                usageStats.IsInVarDeclarator = memberAccessExpressionSyntax.Parent is EqualsValueClauseSyntax { Parent: VariableDeclaratorSyntax };\n                usageStats.Count++;\n            }\n            else\n            {\n                return;\n            }\n        }\n\n        if (accessedProperties.Count == 1\n            && accessedProperties.First().Value is var stats\n            && (stats.IsInVarDeclarator || stats.Count > 1))\n        {\n            c.ReportIssue(Rule, forEachStatementSyntax.Expression, string.Format(SelectMessageFormat, forEachStatementSyntax.Identifier.ValueText, accessedProperties.Single().Key.Name));\n        }\n\n        static IEnumerable<IdentifierNameSyntax> GetStatementIdentifiers(ForEachStatementSyntax forEachStatementSyntax) =>\n            forEachStatementSyntax.Statement\n                .DescendantNodes()\n                .OfType<IdentifierNameSyntax>()\n                .Where(x => x.Identifier.ValueText == forEachStatementSyntax.Identifier.ValueText);\n\n        static bool IsNotLeftSideOfAssignment(MemberAccessExpressionSyntax memberAccess) =>\n            !(memberAccess.Parent is AssignmentExpressionSyntax assignment && assignment.Left == memberAccess);\n    }\n\n    private static bool IsOrImplementsIEnumerable(SemanticModel model, ForEachStatementSyntax forEachStatementSyntax) =>\n        model.GetTypeInfo(forEachStatementSyntax.Expression).Type is var expressionType\n        && (expressionType.Is(KnownType.System_Collections_Generic_IEnumerable_T)\n            || expressionType.Implements(KnownType.System_Collections_Generic_IEnumerable_T)\n            || expressionType.Is(KnownType.System_Collections_Generic_IAsyncEnumerable_T)\n            || expressionType.Implements(KnownType.System_Collections_Generic_IAsyncEnumerable_T));\n\n    private sealed class UsageStats\n    {\n        public int Count { get; set; }\n\n        public bool IsInVarDeclarator { get; set; }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/LooseFilePermissions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class LooseFilePermissions : LooseFilePermissionsBase<SyntaxKind, MemberAccessExpressionSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override void VisitInvocations(SonarSyntaxNodeReportingContext context)\n    {\n        var invocation = (InvocationExpressionSyntax)context.Node;\n        if ((IsSetAccessRule(invocation, context.Model) || IsAddAccessRule(invocation, context.Model))\n            && (ObjectCreation(invocation, context.Model) is { } objectCreation))\n        {\n            var invocationLocation = invocation.GetLocation();\n            var secondaryLocation = objectCreation.Expression.GetLocation();\n            context.ReportIssue(rule, invocationLocation, invocationLocation.StartLine() == secondaryLocation.StartLine() ? [] : [secondaryLocation.ToSecondary(MessageFormat)]);\n        }\n    }\n\n    private static IObjectCreation ObjectCreation(InvocationExpressionSyntax invocation, SemanticModel model)\n    {\n        if (VulnerableFileSystemAccessRule(invocation.DescendantNodes()) is { } accessRuleSyntaxNode)\n        {\n            return accessRuleSyntaxNode;\n        }\n        else if (invocation.GetArgumentSymbolsOfKnownType(KnownType.System_Security_AccessControl_FileSystemAccessRule, model).FirstOrDefault() is { } accessRuleSymbol\n            && accessRuleSymbol is not IMethodSymbol)\n        {\n            return VulnerableFileSystemAccessRule(accessRuleSymbol.LocationNodes(invocation));\n        }\n        else\n        {\n            return null;\n        }\n\n        IObjectCreation VulnerableFileSystemAccessRule(IEnumerable<SyntaxNode> nodes) =>\n            FilterObjectCreations(nodes).FirstOrDefault(x => IsFileSystemAccessRuleForEveryoneWithAllow(x, model));\n    }\n\n    private static bool IsFileSystemAccessRuleForEveryoneWithAllow(IObjectCreation objectCreation, SemanticModel model) =>\n        objectCreation.IsKnownType(KnownType.System_Security_AccessControl_FileSystemAccessRule, model)\n        && objectCreation.ArgumentList is { } argumentList\n        && IsEveryone(argumentList.Arguments.First().Expression, model)\n        && model.GetConstantValue(argumentList.Arguments.Last().Expression) is { HasValue: true, Value: 0 };\n\n    private static bool IsEveryone(SyntaxNode node, SemanticModel model) =>\n        model.GetConstantValue(node) is { HasValue: true, Value: Everyone }\n        || FilterObjectCreations(node.DescendantNodesAndSelf()).Any(x => IsNTAccountWithEveryone(x, model) || IsSecurityIdentifierWithEveryone(x, model));\n\n    private static bool IsNTAccountWithEveryone(IObjectCreation objectCreation, SemanticModel model) =>\n        objectCreation.IsKnownType(KnownType.System_Security_Principal_NTAccount, model)\n        && objectCreation.ArgumentList is { } argumentList\n        && model.GetConstantValue(argumentList.Arguments.Last().Expression) is { HasValue: true, Value: Everyone };\n\n    private static bool IsSecurityIdentifierWithEveryone(IObjectCreation objectCreation, SemanticModel model) =>\n        objectCreation.IsKnownType(KnownType.System_Security_Principal_SecurityIdentifier, model)\n        && objectCreation.ArgumentList is { } argumentList\n        && model.GetConstantValue(argumentList.Arguments.First().Expression) is { HasValue: true, Value: 1 };\n\n    private static IEnumerable<IObjectCreation> FilterObjectCreations(IEnumerable<SyntaxNode> nodes) =>\n        nodes.Where(x => x.Kind() is SyntaxKind.ObjectCreationExpression or SyntaxKindEx.ImplicitObjectCreationExpression).Select(ObjectCreationFactory.Create);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/LossOfFractionInDivision.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class LossOfFractionInDivision : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S2184\";\n        private const string MessageFormat = \"Cast one of the operands of this division to '{0}'.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var division = (BinaryExpressionSyntax)c.Node;\n\n                    if (c.Model.GetSymbolInfo(division).Symbol as IMethodSymbol is not { } symbol\n                        || !symbol.ContainingType.IsAny(KnownType.IntegralNumbersIncludingNative))\n                    {\n                        return;\n                    }\n\n                    if (DivisionIsInAssignmentAndTypeIsNonIntegral(division, c.Model, out var divisionResultType)\n                        || DivisionIsArgumentAndTypeIsNonIntegral(division, c.Model, out divisionResultType)\n                        || DivisionIsInReturnAndTypeIsNonIntegral(division, c.Model, out divisionResultType))\n                    {\n                        c.ReportIssue(Rule, division, divisionResultType.ToMinimalDisplayString(c.Model, division.SpanStart));\n                    }\n                },\n                SyntaxKind.DivideExpression);\n\n        private static bool DivisionIsInReturnAndTypeIsNonIntegral(SyntaxNode division, SemanticModel semanticModel, out ITypeSymbol divisionResultType)\n        {\n            if (division.Parent is ReturnStatementSyntax\n                || division.Parent is LambdaExpressionSyntax)\n            {\n                divisionResultType = (semanticModel.GetEnclosingSymbol(division.SpanStart) as IMethodSymbol)?.ReturnType;\n                return divisionResultType.IsAny(KnownType.NonIntegralNumbers);\n            }\n\n            divisionResultType = null;\n            return false;\n        }\n\n        private static bool DivisionIsArgumentAndTypeIsNonIntegral(SyntaxNode division, SemanticModel semanticModel, out ITypeSymbol divisionResultType)\n        {\n            if (division.Parent is not ArgumentSyntax argument)\n            {\n                divisionResultType = null;\n                return false;\n            }\n\n            if (argument.Parent.Parent is not InvocationExpressionSyntax invocation)\n            {\n                divisionResultType = null;\n                return false;\n            }\n\n            var lookup = new CSharpMethodParameterLookup(invocation, semanticModel);\n            if (!lookup.TryGetSymbol(argument, out var parameter))\n            {\n                divisionResultType = null;\n                return false;\n            }\n\n            divisionResultType = parameter.Type;\n            return divisionResultType.IsAny(KnownType.NonIntegralNumbers);\n        }\n\n        private static bool DivisionIsInAssignmentAndTypeIsNonIntegral(SyntaxNode division, SemanticModel semanticModel, out ITypeSymbol divisionResultType)\n        {\n            if (division.Parent is AssignmentExpressionSyntax assignment)\n            {\n                divisionResultType = semanticModel.GetTypeInfo(assignment.Left).Type;\n                return divisionResultType.IsAny(KnownType.NonIntegralNumbers);\n            }\n            if (division is { Parent: EqualsValueClauseSyntax { Parent: VariableDeclaratorSyntax { Parent: VariableDeclarationSyntax variableDecl } } })\n            {\n                divisionResultType = semanticModel.GetTypeInfo(variableDecl.Type).Type;\n                return divisionResultType.IsAny(KnownType.NonIntegralNumbers);\n            }\n            if (DivisionIsInTupleTypeIsNonIntegral(division, semanticModel, out divisionResultType))\n            {\n                return divisionResultType.IsAny(KnownType.NonIntegralNumbers);\n            }\n\n            divisionResultType = null;\n            return false;\n        }\n\n        private static bool DivisionIsInTupleTypeIsNonIntegral(SyntaxNode division, SemanticModel semanticModel, out ITypeSymbol divisionResultType)\n        {\n            var outerTuple = GetMostOuterTuple(division);\n            if (outerTuple is { Parent: AssignmentExpressionSyntax assignmentSyntax }\n                && assignmentSyntax.MapAssignmentArguments() is { } assignmentMappings)\n            {\n                var divisionResult = assignmentMappings.FirstOrDefault(x => x.Right.Equals(division)).Left;\n                if (divisionResult is { })\n                {\n                    divisionResultType = semanticModel.GetTypeInfo(divisionResult).Type;\n                    return divisionResultType.IsAny(KnownType.NonIntegralNumbers);\n                }\n            }\n            // var (a, b) = (1, 1 / 3)\n            else if (outerTuple is { Parent: EqualsValueClauseSyntax { Parent: VariableDeclaratorSyntax { Parent: VariableDeclarationSyntax variableDeclaration } } })\n            {\n                var tupleArguments = ((TupleExpressionSyntaxWrapper)outerTuple).AllArguments();\n                var declarationType = semanticModel.GetTypeInfo(variableDeclaration.Type).Type;\n                var flattenTupleTypes = AllTupleElements(declarationType);\n                var divisionArgumentIndex = DivisionArgumentIndex(tupleArguments, division);\n                if (divisionArgumentIndex != -1)\n                {\n                    divisionResultType = flattenTupleTypes[divisionArgumentIndex];\n                    return divisionResultType.IsAny(KnownType.NonIntegralNumbers);\n                }\n            }\n            divisionResultType = null;\n            return false;\n\n            static SyntaxNode GetMostOuterTuple(SyntaxNode node) =>\n                node.Ancestors()\n                    .TakeWhile(x => TupleExpressionSyntaxWrapper.IsInstance(x) || x.IsKind(SyntaxKind.Argument))\n                    .LastOrDefault(x => TupleExpressionSyntaxWrapper.IsInstance(x));\n\n            static int DivisionArgumentIndex(ImmutableArray<ArgumentSyntax> arguments, SyntaxNode division) =>\n                arguments.IndexOf(x => x.Expression.Equals(division));\n\n            static List<ITypeSymbol> AllTupleElements(ITypeSymbol typeSymbol)\n            {\n                List<ITypeSymbol> flattenTupleTypes = new();\n                CollectTupleTypes(flattenTupleTypes, typeSymbol);\n                return flattenTupleTypes;\n\n                static void CollectTupleTypes(List<ITypeSymbol> symbolList, ITypeSymbol tupleTypeSymbol)\n                {\n                    if (tupleTypeSymbol.IsTupleType())\n                    {\n                        var elements = ((INamedTypeSymbol)tupleTypeSymbol).TupleElements;\n                        foreach (var element in elements)\n                        {\n                            CollectTupleTypes(symbolList, element.Type);\n                        }\n                    }\n                    else\n                    {\n                        symbolList.Add(tupleTypeSymbol.GetSymbolType());\n                    }\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MagicNumberShouldNotBeUsed.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class MagicNumberShouldNotBeUsed : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S109\";\n        private const string MessageFormat = \"Assign this magic number '{0}' to a well-named variable or constant, and use that instead.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        private static readonly ISet<string> NotConsideredAsMagicNumbers = new HashSet<string> { \"-1\", \"0\", \"1\" };\n        private static readonly string[] AcceptedCollectionMembersForSingleDigitComparison = { \"Size\", \"Count\", \"Length\" };\n\n        private static readonly HashSet<SyntaxKind> AllowedSingleDigitComparisons =\n            [\n                SyntaxKind.EqualsExpression,\n                SyntaxKind.NotEqualsExpression,\n                SyntaxKind.LessThanOrEqualExpression,\n                SyntaxKind.LessThanExpression,\n                SyntaxKind.GreaterThanExpression,\n                SyntaxKind.GreaterThanOrEqualExpression\n            ];\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var literalExpression = (LiteralExpressionSyntax)c.Node;\n\n                    if (!IsExceptionToTheRule(literalExpression))\n                    {\n                        c.ReportIssue(Rule, literalExpression, literalExpression.Token.ValueText);\n                    }\n                },\n                SyntaxKind.NumericLiteralExpression);\n\n        private static bool IsExceptionToTheRule(LiteralExpressionSyntax literalExpression) =>\n            NotConsideredAsMagicNumbers.Contains(literalExpression.Token.ValueText)\n            || literalExpression.FirstAncestorOrSelf<VariableDeclarationSyntax>() != null\n            || literalExpression.FirstAncestorOrSelf<ParameterSyntax>() != null\n            || literalExpression.FirstAncestorOrSelf<EnumMemberDeclarationSyntax>() != null\n            || literalExpression.FirstAncestorOrSelf<MethodDeclarationSyntax>()?.Identifier.ValueText == nameof(object.GetHashCode)\n            || literalExpression.FirstAncestorOrSelf<PragmaWarningDirectiveTriviaSyntax>() != null\n            || IsInsideProperty(literalExpression)\n            || IsSingleDigitInToleratedComparisons(literalExpression)\n            || IsToleratedArgument(literalExpression);\n\n        // Inside property we consider magic numbers as exceptions in the following cases:\n        //   - A {get; set;} = MAGIC_NUMBER\n        //   - A { get { return MAGIC_NUMBER; } }\n        private static bool IsInsideProperty(SyntaxNode node)\n        {\n            if (node.FirstAncestorOrSelf<PropertyDeclarationSyntax>() == null)\n            {\n                return false;\n            }\n            var parent = node.Parent;\n            return parent is ReturnStatementSyntax || parent is EqualsValueClauseSyntax;\n        }\n\n        private static bool IsSingleDigitInToleratedComparisons(LiteralExpressionSyntax literalExpression) =>\n            literalExpression.Parent is BinaryExpressionSyntax binaryExpression\n            && IsSingleDigit(literalExpression.Token.ValueText)\n            && binaryExpression.IsAnyKind(AllowedSingleDigitComparisons)\n            && IsComparingCollectionSize(binaryExpression);\n\n        private static bool IsToleratedArgument(LiteralExpressionSyntax literalExpression) =>\n            IsToleratedMethodArgument(literalExpression)\n            || IsSingleOrNamedAttributeArgument(literalExpression);\n\n        // Named argument or constructor argument.\n        private static bool IsToleratedMethodArgument(LiteralExpressionSyntax literalExpression) =>\n            literalExpression.Parent is ArgumentSyntax arg\n            && (arg.NameColon is not null || arg.Parent.Parent is ObjectCreationExpressionSyntax || LooksLikeTimeApi(arg.Parent.Parent));\n\n        private static bool LooksLikeTimeApi(SyntaxNode node) =>\n            node is InvocationExpressionSyntax invocationExpression\n            && invocationExpression.Expression.GetIdentifier() is { } identifier\n            && identifier.ValueText.StartsWith(\"From\");\n\n        private static bool IsSingleOrNamedAttributeArgument(LiteralExpressionSyntax literalExpression) =>\n            literalExpression.Parent is AttributeArgumentSyntax arg\n            && (arg.NameColon is not null\n                || arg.NameEquals is not null\n                || (arg.Parent is AttributeArgumentListSyntax argList && argList.Arguments.Count == 1));\n\n        private static bool IsSingleDigit(string text) => byte.TryParse(text, out var result) && result <= 9;\n\n        // We allow single-digit comparisons when checking the size of a collection, which is usually done to access the first elements.\n        private static bool IsComparingCollectionSize(BinaryExpressionSyntax binaryComparisonToLiteral)\n        {\n            var comparedToLiteral = binaryComparisonToLiteral.Left is LiteralExpressionSyntax ? binaryComparisonToLiteral.Right : binaryComparisonToLiteral.Left;\n            return GetMemberName(comparedToLiteral) is { } name\n                && AcceptedCollectionMembersForSingleDigitComparison.Contains(name);\n\n            // we also allow LINQ Count() - the implementation is kept simple to avoid expensive SemanticModel calls\n            static string GetMemberName(SyntaxNode node) =>\n                node switch\n                {\n                    MemberAccessExpressionSyntax memberAccess => memberAccess.Name.Identifier.ValueText,\n                    InvocationExpressionSyntax invocationExpressionSyntax => GetMemberName(invocationExpressionSyntax.Expression),\n                    _ => null\n                };\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MarkAssemblyWithAssemblyVersionAttribute.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class MarkAssemblyWithAssemblyVersionAttribute : MarkAssemblyWithAssemblyVersionAttributeBase\n    {\n        protected override ILanguageFacade Language => CSharpFacade.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MarkAssemblyWithClsCompliantAttribute.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class MarkAssemblyWithClsCompliantAttribute : MarkAssemblyWithClsCompliantAttributeBase\n    {\n        protected override ILanguageFacade Language => CSharpFacade.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MarkAssemblyWithComVisibleAttribute.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class MarkAssemblyWithComVisibleAttribute : MarkAssemblyWithComVisibleAttributeBase\n    {\n        protected override ILanguageFacade Language => CSharpFacade.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MarkAssemblyWithNeutralResourcesLanguageAttribute.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class MarkAssemblyWithNeutralResourcesLanguageAttribute : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S4026\";\n        private const string MessageFormat = \"Provide a 'System.Resources.NeutralResourcesLanguageAttribute' attribute for assembly '{0}'.\";\n        private const string StronglyTypedResourceBuilder = \"System.Resources.Tools.StronglyTypedResourceBuilder\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat, isCompilationEnd: true);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterCompilationStartAction(c =>\n                {\n                    var hasResx = false;\n                    c.RegisterNodeActionInAllFiles(cc =>\n                        hasResx = hasResx || IsResxGeneratedFile(cc.Model, (ClassDeclarationSyntax)cc.Node),\n                        SyntaxKind.ClassDeclaration);\n\n                    c.RegisterCompilationEndAction(cc =>\n                        {\n                            if (hasResx && !HasNeutralResourcesLanguageAttribute(cc.Compilation.Assembly))\n                            {\n                                cc.ReportIssue(Rule, (Location)null, cc.Compilation.AssemblyName);\n                            }\n                        });\n                });\n\n        private static bool IsDesignerFile(SyntaxTree tree) =>\n            tree.FilePath?.IndexOf(\".Designer.\", StringComparison.OrdinalIgnoreCase) > 0;\n\n        private static bool HasGeneratedCodeAttributeWithStronglyTypedResourceBuilderValue(SemanticModel semanticModel, ClassDeclarationSyntax classSyntax) =>\n            classSyntax.AttributeLists\n                .GetAttributes(KnownType.System_CodeDom_Compiler_GeneratedCodeAttribute, semanticModel)\n                .Where(x => x.ArgumentList.Arguments.Count > 0)\n                .Select(x => semanticModel.GetConstantValue(x.ArgumentList.Arguments[0].Expression))\n                .Any(constant => string.Equals(constant.Value as string, StronglyTypedResourceBuilder, StringComparison.OrdinalIgnoreCase));\n\n        private static bool IsResxGeneratedFile(SemanticModel semanticModel, ClassDeclarationSyntax classSyntax) =>\n            IsDesignerFile(semanticModel.SyntaxTree) && HasGeneratedCodeAttributeWithStronglyTypedResourceBuilderValue(semanticModel, classSyntax);\n\n        private static bool HasNeutralResourcesLanguageAttribute(IAssemblySymbol assemblySymbol) =>\n            assemblySymbol.GetAttributes(KnownType.System_Resources_NeutralResourcesLanguageAttribute)\n                .Any(attribute => attribute.ConstructorArguments.Any(arg => arg.Type.Is(KnownType.System_String) && !string.IsNullOrWhiteSpace((string)arg.Value)));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MarkWindowsFormsMainWithStaThread.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class MarkWindowsFormsMainWithStaThread : MarkWindowsFormsMainWithStaThreadBase<SyntaxKind, MethodDeclarationSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n        protected override SyntaxKind[] SyntaxKinds { get; } =\n        {\n            SyntaxKind.MethodDeclaration\n        };\n\n        protected override Location GetLocation(MethodDeclarationSyntax method) =>\n            method.FindIdentifierLocation();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MemberInitializedToDefault.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class MemberInitializedToDefault : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S3052\";\n        private const string MessageFormat = \"Remove this initialization to '{0}', the compiler will do that for you.\";\n        private const string Zero = \"Zero\";\n\n        private static readonly CSharpExpressionNumericConverter ExpressionNumericConverter = new CSharpExpressionNumericConverter();\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(CheckField, SyntaxKind.FieldDeclaration);\n            context.RegisterNodeAction(CheckEvent, SyntaxKind.EventFieldDeclaration);\n            context.RegisterNodeAction(CheckAutoProperty, SyntaxKind.PropertyDeclaration);\n        }\n\n        private static void CheckAutoProperty(SonarSyntaxNodeReportingContext context)\n        {\n            var propertyDeclaration = (PropertyDeclarationSyntax)context.Node;\n\n            if (propertyDeclaration.Initializer == null\n                || !propertyDeclaration.IsAutoProperty())\n            {\n                return;\n            }\n\n            var propertySymbol = context.Model.GetDeclaredSymbol(propertyDeclaration);\n\n            if (propertySymbol != null\n                && IsDefaultValueInitializer(propertyDeclaration.Initializer, propertySymbol.Type))\n            {\n                context.ReportIssue(Rule, propertyDeclaration.Initializer, propertySymbol.Name);\n            }\n        }\n\n        private static void CheckEvent(SonarSyntaxNodeReportingContext context)\n        {\n            var field = (EventFieldDeclarationSyntax)context.Node;\n\n            foreach (var eventDeclaration in field.Declaration.Variables.Where(v => v.Initializer != null))\n            {\n                if (!(context.Model.GetDeclaredSymbol(eventDeclaration) is IEventSymbol eventSymbol))\n                {\n                    continue;\n                }\n\n                if (IsDefaultValueInitializer(eventDeclaration.Initializer, eventSymbol.Type))\n                {\n                    context.ReportIssue(Rule, eventDeclaration.Initializer, eventSymbol.Name);\n                    return;\n                }\n            }\n        }\n\n        private static void CheckField(SonarSyntaxNodeReportingContext context)\n        {\n            var field = (FieldDeclarationSyntax)context.Node;\n\n            foreach (var variableDeclarator in field.Declaration.Variables.Where(v => v.Initializer != null))\n            {\n                if (context.Model.GetDeclaredSymbol(variableDeclarator) is IFieldSymbol {IsConst: false} fieldSymbol\n                    && IsDefaultValueInitializer(variableDeclarator.Initializer, fieldSymbol.Type))\n                {\n                    context.ReportIssue(Rule, variableDeclarator.Initializer, fieldSymbol.Name);\n                }\n            }\n        }\n\n        internal static bool IsDefaultValueInitializer(EqualsValueClauseSyntax initializer, ITypeSymbol type) =>\n            IsDefaultExpressionInitializer(initializer)\n            || IsReferenceTypeNullInitializer(initializer, type)\n            || IsValueTypeDefaultValueInitializer(initializer, type);\n\n        private static bool IsDefaultExpressionInitializer(EqualsValueClauseSyntax initializer) =>\n            initializer.Value is DefaultExpressionSyntax;\n\n        private static bool IsReferenceTypeNullInitializer(EqualsValueClauseSyntax initializer, ITypeSymbol type) =>\n            type.IsReferenceType\n            && CSharpEquivalenceChecker.AreEquivalent(SyntaxConstants.NullLiteralExpression, initializer.Value);\n\n        private static bool IsValueTypeDefaultValueInitializer(EqualsValueClauseSyntax initializer, ITypeSymbol type)\n        {\n            if (!type.IsValueType)\n            {\n                return false;\n            }\n\n            switch (type.SpecialType)\n            {\n                case SpecialType.System_Boolean:\n                    return CSharpEquivalenceChecker.AreEquivalent(initializer.Value, SyntaxConstants.FalseLiteralExpression);\n                case SpecialType.System_Decimal:\n                case SpecialType.System_Double:\n                case SpecialType.System_Single:\n                    return ExpressionNumericConverter.ConstantDoubleValue(initializer.Value) is { } constantValue && Math.Abs(constantValue - default(double)) < double.Epsilon;\n                case SpecialType.System_Char:\n                case SpecialType.System_Byte:\n                case SpecialType.System_Int16:\n                case SpecialType.System_Int32:\n                case SpecialType.System_Int64:\n                case SpecialType.System_SByte:\n                case SpecialType.System_UInt16:\n                case SpecialType.System_UInt32:\n                case SpecialType.System_UInt64:\n                case SpecialType.System_IntPtr:\n                case SpecialType.System_UIntPtr:\n                    {\n                        if (initializer.Value is MemberAccessExpressionSyntax memberAccess && memberAccess.Name.Identifier.Text == Zero)\n                        {\n                            return true;\n                        }\n                        else if (ObjectCreationFactory.TryCreate(initializer.Value) is { } objectCreation)\n                        {\n                            var argCount = objectCreation.ArgumentList?.Arguments.Count;\n                            if (argCount is null || argCount == 0)\n                            {\n                                return true;\n                            }\n\n                            return ExpressionNumericConverter.ConstantIntValue(objectCreation.ArgumentList.Arguments.First().Expression) is 0;\n                        }\n                        else\n                        {\n                            return ExpressionNumericConverter.ConstantIntValue(initializer.Value) is 0;\n                        }\n                    }\n                default:\n                    return false;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MemberInitializedToDefaultCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Formatting;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class MemberInitializedToDefaultCodeFix : SonarCodeFix\n    {\n        private const string Title = \"Remove redundant initializer\";\n\n        public override ImmutableArray<string> FixableDiagnosticIds =>\n            ImmutableArray.Create(MemberInitializedToDefault.DiagnosticId, MemberInitializerRedundant.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n\n            if (!(root.FindNode(diagnosticSpan) is EqualsValueClauseSyntax initializer))\n            {\n                return Task.CompletedTask;\n            }\n\n            context.RegisterCodeFix(\n                Title,\n                c =>\n                {\n                    var parent = initializer.Parent;\n\n                    SyntaxNode newParent;\n\n                    if (!(parent is PropertyDeclarationSyntax propDecl))\n                    {\n                        newParent = parent.RemoveNode(initializer, SyntaxRemoveOptions.KeepNoTrivia);\n                    }\n                    else\n                    {\n                        var newPropDecl = propDecl\n                            .WithInitializer(null)\n                            .WithSemicolonToken(SyntaxFactory.Token(SyntaxKind.None))\n                            .WithTriviaFrom(propDecl);\n\n                        newParent = newPropDecl;\n                    }\n\n                    var newRoot = root.ReplaceNode(\n                        parent,\n                        newParent.WithAdditionalAnnotations(Formatter.Annotation));\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n\n            return Task.CompletedTask;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MemberInitializerRedundant.RoslynCfg.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CFG.Roslyn;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    public sealed partial class MemberInitializerRedundant\n    {\n        private class RoslynChecker : CfgAllPathValidator\n        {\n            private readonly ISymbol memberToCheck;\n            private readonly CancellationToken cancel;\n            private readonly ControlFlowGraph cfg;\n\n            public RoslynChecker(ControlFlowGraph cfg, ISymbol memberToCheck, CancellationToken cancel) : base(cfg)\n            {\n                this.cfg = cfg;\n                this.memberToCheck = memberToCheck;\n                this.cancel = cancel;\n            }\n\n            // Returns true if the block contains assignment before access\n            protected override bool IsValid(BasicBlock block) =>\n                ProcessBlock(block, cfg, false);\n\n            // Returns true if the block contains access before assignment\n            protected override bool IsInvalid(BasicBlock block) =>\n                ProcessBlock(block, cfg, true);\n\n            private bool ProcessBlock(BasicBlock block, ControlFlowGraph controlFlowGraph, bool checkReadBeforeWrite)\n            {\n                foreach (var operation in block.OperationsAndBranchValue.Reverse().ToReversedExecutionOrder())\n                {\n                    if (checkReadBeforeWrite && operation.Instance.Kind == OperationKindEx.FlowAnonymousFunction)\n                    {\n                        var anonymousFunction = IFlowAnonymousFunctionOperationWrapper.FromOperation(operation.Instance);\n                        var anonymousFunctionCfg = controlFlowGraph.GetAnonymousFunctionControlFlowGraph(anonymousFunction, cancel);\n                        if (anonymousFunctionCfg.Blocks.Any(x => ProcessBlock(x, anonymousFunctionCfg, checkReadBeforeWrite)))\n                        {\n                            return true;\n                        }\n                    }\n                    else if (memberToCheck.Equals(MemberSymbol(operation.Instance)))\n                    {\n                        return IsReadOrWrite(operation, checkReadBeforeWrite);\n                    }\n                }\n                return false;\n            }\n\n            private bool IsReadOrWrite(IOperationWrapperSonar child, bool checkReadBeforeWrite)\n            {\n                if (child.Instance.IsOutArgumentReference())\n                {\n                    // it is out argument - that means that this is write\n                    return !checkReadBeforeWrite;\n                }\n\n                var isWrite = child.Parent is { Kind: OperationKindEx.SimpleAssignment } parent && ISimpleAssignmentOperationWrapper.FromOperation(parent).Target == child.Instance;\n                return checkReadBeforeWrite ^ isWrite;\n            }\n\n            private static ISymbol MemberSymbol(IOperation operation) =>\n                operation.Kind switch\n                {\n                    OperationKindEx.FieldReference when IFieldReferenceOperationWrapper.FromOperation(operation) is var fieldReference && InstanceReferencesThis(fieldReference.Instance) =>\n                        fieldReference.Field,\n                    OperationKindEx.PropertyReference when IPropertyReferenceOperationWrapper.FromOperation(operation) is var propertyReference && InstanceReferencesThis(propertyReference.Instance) =>\n                        propertyReference.Property,\n                    OperationKindEx.EventReference when IEventReferenceOperationWrapper.FromOperation(operation) is var eventReference && InstanceReferencesThis(eventReference.Instance) =>\n                        eventReference.Member,\n                    _ => null\n                };\n\n            private static bool InstanceReferencesThis(IOperation instance) =>\n                instance == null || instance.IsAnyKind(OperationKindEx.FlowCaptureReference, OperationKindEx.InstanceReference);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MemberInitializerRedundant.SonarCfg.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CFG.Sonar;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    public sealed partial class MemberInitializerRedundant\n    {\n        private class SonarChecker : CfgAllPathValidator\n        {\n            private readonly RedundancyChecker redundancyChecker;\n\n            public SonarChecker(IControlFlowGraph cfg, ISymbol memberToCheck, SemanticModel semanticModel) : base(cfg) =>\n                redundancyChecker = new RedundancyChecker(memberToCheck, semanticModel);\n\n            // Returns true if the block contains assignment before access\n            protected override bool IsBlockValid(Block block)\n            {\n                foreach (var instruction in block.Instructions)\n                {\n                    switch (instruction.Kind())\n                    {\n                        case SyntaxKind.IdentifierName:\n                        case SyntaxKind.SimpleMemberAccessExpression:\n                            {\n                                if (RedundancyChecker.PossibleMemberAccessParent(instruction) is { } memberAccess\n                                    && redundancyChecker.TryGetReadWriteFromMemberAccess(memberAccess, out var isRead))\n                                {\n                                    return !isRead;\n                                }\n                            }\n                            break;\n                        case SyntaxKind.SimpleAssignmentExpression:\n                            {\n                                var assignment = (AssignmentExpressionSyntax)instruction;\n                                if (redundancyChecker.IsMatchingMember(assignment.Left.RemoveParentheses()))\n                                {\n                                    return true;\n                                }\n                            }\n                            break;\n                    }\n                }\n\n                return false;\n            }\n\n            // Returns true if the block contains access before assignment\n            protected override bool IsBlockInvalid(Block block)\n            {\n                foreach (var instruction in block.Instructions)\n                {\n                    switch (instruction.Kind())\n                    {\n                        case SyntaxKind.IdentifierName:\n                        case SyntaxKind.SimpleMemberAccessExpression:\n                            {\n                                var memberAccess = RedundancyChecker.PossibleMemberAccessParent(instruction);\n                                if (memberAccess != null && redundancyChecker.TryGetReadWriteFromMemberAccess(memberAccess, out var isRead))\n                                {\n                                    return isRead;\n                                }\n                            }\n                            break;\n                        case SyntaxKind.SimpleAssignmentExpression:\n                            {\n                                var assignment = (AssignmentExpressionSyntax)instruction;\n                                if (redundancyChecker.IsMatchingMember(assignment.Left))\n                                {\n                                    return false;\n                                }\n                            }\n                            break;\n\n                        case SyntaxKind.AnonymousMethodExpression:\n                        case SyntaxKind.ParenthesizedLambdaExpression:\n                        case SyntaxKind.SimpleLambdaExpression:\n                        case SyntaxKind.QueryExpression:\n                            {\n                                if (redundancyChecker.IsMemberUsedInsideLambda(instruction))\n                                {\n                                    return true;\n                                }\n                            }\n                            break;\n                    }\n                }\n                return false;\n            }\n\n            private class RedundancyChecker\n            {\n                private readonly ISymbol memberToCheck;\n                private readonly SemanticModel semanticModel;\n\n                public RedundancyChecker(ISymbol memberToCheck, SemanticModel semanticModel)\n                {\n                    this.memberToCheck = memberToCheck;\n                    this.semanticModel = semanticModel;\n                }\n\n                public bool IsMemberUsedInsideLambda(SyntaxNode instruction) =>\n                    instruction.DescendantNodes()\n                        .OfType<IdentifierNameSyntax>()\n                        .Select(PossibleMemberAccessParent)\n                        .Any(IsMatchingMember);\n\n                public bool IsMatchingMember(ExpressionSyntax expression)\n                {\n                    return ExtractIdentifier(expression) is { } identifier\n                           && semanticModel.GetSymbolInfo(identifier).Symbol is { } assignedSymbol\n                           && memberToCheck.Equals(assignedSymbol);\n\n                    IdentifierNameSyntax ExtractIdentifier(ExpressionSyntax expressionSyntax)\n                    {\n                        if (expressionSyntax.IsKind(SyntaxKind.IdentifierName))\n                        {\n                            return (IdentifierNameSyntax)expressionSyntax;\n                        }\n                        else if (expressionSyntax is MemberAccessExpressionSyntax memberAccess && memberAccess.Expression.IsKind(SyntaxKind.ThisExpression))\n                        {\n                            return memberAccess.Name as IdentifierNameSyntax;\n                        }\n                        else if (expressionSyntax is ConditionalAccessExpressionSyntax conditionalAccess && conditionalAccess.Expression.IsKind(SyntaxKind.ThisExpression))\n                        {\n                            return (conditionalAccess.WhenNotNull as MemberBindingExpressionSyntax)?.Name as IdentifierNameSyntax;\n                        }\n                        else\n                        {\n                            return null;\n                        }\n                    }\n                }\n\n                public static ExpressionSyntax PossibleMemberAccessParent(SyntaxNode node) =>\n                    node is MemberAccessExpressionSyntax memberAccess\n                        ? memberAccess\n                        : PossibleMemberAccessParent(node as IdentifierNameSyntax);\n\n                private static ExpressionSyntax PossibleMemberAccessParent(IdentifierNameSyntax identifier)\n                {\n                    if (identifier.Parent is MemberAccessExpressionSyntax memberAccess)\n                    {\n                        return memberAccess;\n                    }\n\n                    if (identifier.Parent is MemberBindingExpressionSyntax memberBinding)\n                    {\n                        return (ExpressionSyntax)memberBinding.Parent;\n                    }\n\n                    return identifier;\n                }\n\n                public bool TryGetReadWriteFromMemberAccess(ExpressionSyntax expression, out bool isRead)\n                {\n                    isRead = false;\n\n                    var parenthesized = expression.GetSelfOrTopParenthesizedExpression();\n\n                    if (!IsMatchingMember(expression))\n                    {\n                        return false;\n                    }\n\n                    if (IsOutArgument(parenthesized))\n                    {\n                        isRead = false;\n                        return true;\n                    }\n\n                    if (IsReadAccess(parenthesized, this.semanticModel))\n                    {\n                        isRead = true;\n                        return true;\n                    }\n\n                    return false;\n                }\n\n                private static bool IsBeingAssigned(ExpressionSyntax expression) =>\n                    expression.Parent is AssignmentExpressionSyntax assignment\n                    && assignment.IsKind(SyntaxKind.SimpleAssignmentExpression)\n                    && assignment.Left == expression;\n\n                private static bool IsOutArgument(ExpressionSyntax parenthesized) =>\n                    parenthesized.Parent is ArgumentSyntax argument\n                    && argument.RefOrOutKeyword.IsKind(SyntaxKind.OutKeyword);\n\n                private static bool IsReadAccess(ExpressionSyntax parenthesized, SemanticModel semanticModel) =>\n                    !IsBeingAssigned(parenthesized)\n                    && !parenthesized.IsInNameOfArgument(semanticModel);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MemberInitializerRedundant.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CFG.Roslyn;\nusing SonarAnalyzer.CFG.Sonar;\nusing SymbolWithInitializer = System.Collections.Generic.KeyValuePair<Microsoft.CodeAnalysis.ISymbol, Microsoft.CodeAnalysis.CSharp.Syntax.EqualsValueClauseSyntax>;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed partial class MemberInitializerRedundant : SonarDiagnosticAnalyzer\n{\n    internal const string DiagnosticId = \"S3604\";\n    private const string InstanceMemberMessage = \"Remove the member initializer, all constructors set an initial value for the member.\";\n    private const string StaticMemberMessage = \"Remove the static member initializer, a static constructor or module initializer sets an initial value for the member.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, \"{0}\");\n\n    private readonly bool useSonarCfg;\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    public MemberInitializerRedundant() : this(AnalyzerConfiguration.AlwaysEnabled) { }\n\n    internal MemberInitializerRedundant(IAnalyzerConfiguration configuration) =>\n        useSonarCfg = configuration.UseSonarCfg();\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            c =>\n            {\n                var declaration = (TypeDeclarationSyntax)c.Node;\n                if (c.Model.GetDeclaredSymbol(declaration)?.GetMembers() is { Length: > 0 } members)\n                {\n                    // structs cannot initialize fields/properties at declaration time\n                    // interfaces cannot have instance fields and instance properties cannot have initializers\n                    if (declaration is ClassDeclarationSyntax)\n                    {\n                        CheckInstanceMembers(c, declaration, members);\n                    }\n                    CheckStaticMembers(c, declaration, members);\n                }\n            },\n            // For record support, see details in https://github.com/SonarSource/sonar-dotnet/pull/4756\n            // it is difficult to work with instance record constructors w/o raising FPs\n            SyntaxKind.ClassDeclaration,\n            SyntaxKind.StructDeclaration,\n            SyntaxKind.InterfaceDeclaration);\n\n    private void CheckInstanceMembers(SonarSyntaxNodeReportingContext c, TypeDeclarationSyntax declaration, IEnumerable<ISymbol> typeMembers)\n    {\n        var constructors = typeMembers.OfType<IMethodSymbol>().Where(x => x is { MethodKind: MethodKind.Constructor, IsStatic: false }).ToList();\n        if (constructors.Exists(x => x.IsImplicitlyDeclared || x.IsPrimaryConstructor))\n        {\n            // Implicit parameterless constructors and primary constructors can be considered as having an\n            // empty body and they do not initialize any members. If any of these is present, the rule does not apply.\n            return;\n        }\n\n        // only retrieve the member symbols (an expensive call) if there are explicit class initializers\n        var initializedMembers = InitializedMembers(c.Model, declaration, IsNotStaticOrConst);\n        if (initializedMembers.Count == 0)\n        {\n            return;\n        }\n\n        var constructorDeclarations = ConstructorDeclarations<ConstructorDeclarationSyntax>(c, constructors);\n        foreach (var kvp in initializedMembers)\n        {\n            // the instance member should be initialized in ALL instance constructors\n            // otherwise, initializing it inline makes sense and the rule should not report\n            if (constructorDeclarations.TrueForAll(x =>\n                    // Calls another ctor, which is also checked:\n                    x is { Node.Initializer.ThisOrBaseKeyword.RawKind: (int)SyntaxKind.ThisKeyword }\n                    || IsSymbolFirstSetInCfg(kvp.Key, x.Node, x.Model, c.Cancel)))\n            {\n                c.ReportIssue(Rule, kvp.Value, InstanceMemberMessage);\n            }\n        }\n    }\n\n    private void CheckStaticMembers(SonarSyntaxNodeReportingContext c, TypeDeclarationSyntax declaration, IEnumerable<ISymbol> typeMembers)\n    {\n        var typeInitializers = typeMembers.OfType<IMethodSymbol>().Where(x => x.MethodKind == MethodKind.StaticConstructor || x.IsModuleInitializer()).ToList();\n        if (typeInitializers.Count == 0)\n        {\n            return;\n        }\n\n        // only retrieve the member symbols (an expensive call) if there are explicit class initializers\n        var initializedMembers = InitializedMembers(c.Model, declaration, IsStatic);\n        if (initializedMembers.Count == 0)\n        {\n            return;\n        }\n\n        var initializerDeclarations = ConstructorDeclarations<BaseMethodDeclarationSyntax>(c, typeInitializers);\n        foreach (var memberSymbol in initializedMembers.Keys)\n        {\n            // there can be only one static constructor\n            // all module initializers are executed when the type is created, so it is enough if ANY initializes the member\n            if (initializerDeclarations.Any(x => IsSymbolFirstSetInCfg(memberSymbol, x.Node, x.Model, c.Cancel)))\n            {\n                c.ReportIssue(Rule, initializedMembers[memberSymbol], StaticMemberMessage);\n            }\n        }\n    }\n\n    /// <summary>\n    /// Returns true if the member is overwritten without being read in the instance constructor.\n    /// Returns false if the member is not set in the constructor, or if it is read before being set.\n    /// </summary>\n    private bool IsSymbolFirstSetInCfg(ISymbol classMember, BaseMethodDeclarationSyntax constructorOrInitializer, SemanticModel model, CancellationToken cancel)\n    {\n        if (useSonarCfg)\n        {\n            if (!CSharpControlFlowGraph.TryGet(constructorOrInitializer, model, out var cfg))\n            {\n                return false;\n            }\n\n            var checker = new SonarChecker(cfg, classMember, model);\n            return checker.CheckAllPaths();\n        }\n        else if (ControlFlowGraph.Create(constructorOrInitializer, model, cancel) is { } cfg)\n        {\n            var checker = new RoslynChecker(cfg, classMember, cancel);\n            return checker.CheckAllPaths();\n        }\n        else\n        {\n            return false;\n        }\n    }\n\n    private static bool IsNotStaticOrConst(SyntaxTokenList tokenList) =>\n        !tokenList.Any(x => x.Kind() is SyntaxKind.StaticKeyword or SyntaxKind.ConstKeyword);\n\n    private static bool IsStatic(SyntaxTokenList tokenList) =>\n        tokenList.Any(x => x.IsKind(SyntaxKind.StaticKeyword));\n\n    // Retrieves the class members which are initialized - instance or static ones, depending on the given modifiers.\n    private static Dictionary<ISymbol, EqualsValueClauseSyntax> InitializedMembers(SemanticModel model,\n                                                                                   TypeDeclarationSyntax declaration,\n                                                                                   Func<SyntaxTokenList, bool> filterModifiers)\n    {\n        var candidateFields = InitializedFieldLikeDeclarations<FieldDeclarationSyntax, IFieldSymbol>(declaration, filterModifiers, model, x => x.Type);\n        var candidateEvents = InitializedFieldLikeDeclarations<EventFieldDeclarationSyntax, IEventSymbol>(declaration, filterModifiers, model, x => x.Type);\n        var candidateProperties = InitializedPropertyDeclarations(declaration, filterModifiers, model);\n        var allMembers = candidateFields.Select(x => new SymbolWithInitializer(x.Symbol, x.Initializer))\n            .Concat(candidateEvents.Select(x => new SymbolWithInitializer(x.Symbol, x.Initializer)))\n            .Concat(candidateProperties.Select(x => new SymbolWithInitializer(x.Symbol, x.Initializer)))\n            .ToDictionary(x => x.Key, x => x.Value);\n        return allMembers;\n    }\n\n    private static List<NodeSymbolAndModel<TSyntax, IMethodSymbol>> ConstructorDeclarations<TSyntax>(SonarSyntaxNodeReportingContext context, List<IMethodSymbol> constructorSymbols)\n        where TSyntax : SyntaxNode =>\n        constructorSymbols.SelectMany(x =>\n            x.DeclaringSyntaxReferences\n                .Select(x => x.GetSyntax())\n                .OfType<TSyntax>()\n                .Select(declarationNode => new { declarationNode, constructorSymbol = x }))\n            .Select(x => new { x.declarationNode, x.constructorSymbol, model = x.declarationNode.EnsureCorrectSemanticModelOrDefault(context.Model) })\n            .Where(x => x.model is not null)\n            .Select(x => new NodeSymbolAndModel<TSyntax, IMethodSymbol>(x.declarationNode, x.constructorSymbol, x.model))\n            .ToList();\n\n    private static IEnumerable<DeclarationTuple<IPropertySymbol>> InitializedPropertyDeclarations(TypeDeclarationSyntax declaration,\n                                                                                                  Func<SyntaxTokenList, bool> filterModifiers,\n                                                                                                  SemanticModel model) =>\n        declaration.Members\n            .OfType<PropertyDeclarationSyntax>()\n            .Where(x => filterModifiers(x.Modifiers) && x.Initializer is not null && x.IsAutoProperty())\n            .Select(x => new DeclarationTuple<IPropertySymbol>(x.Initializer, model.GetDeclaredSymbol(x)))\n            .Where(x => x.Symbol is not null && !MemberInitializedToDefault.IsDefaultValueInitializer(x.Initializer, x.Symbol.Type));\n\n    private static IEnumerable<DeclarationTuple<TSymbol>> InitializedFieldLikeDeclarations<TDeclarationType, TSymbol>(TypeDeclarationSyntax declaration,\n                                                                                                                      Func<SyntaxTokenList, bool> filterModifiers,\n                                                                                                                      SemanticModel model,\n                                                                                                                      Func<TSymbol, ITypeSymbol> typeSelector)\n        where TDeclarationType : BaseFieldDeclarationSyntax\n        where TSymbol : class, ISymbol =>\n        declaration.Members\n            .OfType<TDeclarationType>()\n            .Where(x => filterModifiers(x.Modifiers))\n            .SelectMany(x => x.Declaration.Variables\n                                .Where(v => v.Initializer is not null)\n                                .Select(v => new DeclarationTuple<TSymbol>(v.Initializer, model.GetDeclaredSymbol(v) as TSymbol)))\n            .Where(x => x.Symbol is not null && !MemberInitializedToDefault.IsDefaultValueInitializer(x.Initializer, typeSelector(x.Symbol)));\n\n    private sealed class DeclarationTuple<TSymbol>\n        where TSymbol : ISymbol\n    {\n        public EqualsValueClauseSyntax Initializer { get; }\n        public TSymbol Symbol { get; }\n\n        public DeclarationTuple(EqualsValueClauseSyntax initializer, TSymbol symbol)\n        {\n            Initializer = initializer;\n            Symbol = symbol;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MemberOverrideCallsBaseMember.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class MemberOverrideCallsBaseMember : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S1185\";\n        private const string MessageFormat = \"Remove this {1} '{0}' to simply inherit its behavior.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        private static readonly string[] IgnoredMethodNames = { \"Equals\", \"GetHashCode\" };\n        private static readonly string[] IgnoredRecordMethodNames = { \"ToString\", \"PrintMembers\" };\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var method = (MethodDeclarationSyntax)c.Node;\n                    if (IsMethodCandidate(method, c.Model))\n                    {\n                        c.ReportIssue(Rule, method, method.Identifier.ValueText, \"method\");\n                    }\n                },\n                SyntaxKind.MethodDeclaration);\n\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var property = (PropertyDeclarationSyntax)c.Node;\n                    if (IsPropertyCandidate(property, c.Model))\n                    {\n                        c.ReportIssue(Rule, property, property.Identifier.ValueText, \"property\");\n                    }\n                },\n                SyntaxKind.PropertyDeclaration);\n        }\n\n        private static bool IsPropertyCandidate(PropertyDeclarationSyntax propertySyntax, SemanticModel semanticModel)\n        {\n            if (HasDocumentationComment(propertySyntax))\n            {\n                return false;\n            }\n\n            var propertySymbol = semanticModel.GetDeclaredSymbol(propertySyntax);\n            if (propertySymbol == null\n                || !propertySymbol.IsOverride\n                || propertySymbol.IsSealed\n                || propertySymbol.OverriddenProperty == null\n                || (propertySymbol.GetMethod != null && propertySymbol.OverriddenProperty.GetMethod == null)\n                || (propertySymbol.SetMethod != null && propertySymbol.OverriddenProperty.SetMethod == null)\n                || propertySymbol.IsAnyAttributeInOverridingChain())\n            {\n                return false;\n            }\n\n            return CheckGetAccessorIfAny(propertySyntax, propertySymbol, semanticModel)\n                   && CheckSetAccessorIfAny(propertySyntax, propertySymbol, semanticModel);\n        }\n\n        private static bool CheckGetAccessorIfAny(PropertyDeclarationSyntax propertySyntax, IPropertySymbol propertySymbol, SemanticModel semanticModel)\n        {\n            var getAccessor = propertySyntax.AccessorList?.Accessors.FirstOrDefault(a => a.IsKind(SyntaxKind.GetAccessorDeclaration));\n            if (getAccessor == null && propertySyntax.ExpressionBody == null)\n            {\n                // no getter\n                return true;\n            }\n\n            var expression = propertySyntax.ExpressionBody?.Expression\n                ?? getAccessor?.ExpressionBody?.Expression\n                ?? GetSingleStatementExpression(getAccessor?.Body, isVoid: false);\n\n            return expression is MemberAccessExpressionSyntax memberAccess\n                   && memberAccess.Expression is BaseExpressionSyntax\n                   && IsBaseProperty(propertySymbol, semanticModel, memberAccess);\n        }\n\n        private static bool IsBaseProperty(IPropertySymbol propertySymbol, SemanticModel semanticModel, MemberAccessExpressionSyntax memberAccess) =>\n            semanticModel.GetSymbolInfo(memberAccess).Symbol is IPropertySymbol invokedPropertySymbol\n            && invokedPropertySymbol.Equals(propertySymbol.OverriddenProperty);\n\n        private static bool CheckSetAccessorIfAny(PropertyDeclarationSyntax propertySyntax, IPropertySymbol propertySymbol, SemanticModel semanticModel)\n        {\n            var setAccessor = propertySyntax.AccessorList?.Accessors.FirstOrDefault(x => x.Kind() is SyntaxKind.SetAccessorDeclaration or SyntaxKindEx.InitAccessorDeclaration);\n            if (setAccessor is null)\n            {\n                return true;\n            }\n\n            var expression = setAccessor?.ExpressionBody?.Expression ?? GetSingleStatementExpression(setAccessor?.Body, isVoid: true);\n\n            return expression is AssignmentExpressionSyntax expressionToCheck\n                   && expressionToCheck.IsKind(SyntaxKind.SimpleAssignmentExpression)\n                   && expressionToCheck.Left is MemberAccessExpressionSyntax memberAccess\n                   && memberAccess.Expression is BaseExpressionSyntax\n                   && expressionToCheck.Right is IdentifierNameSyntax { Identifier: { ValueText: \"value\" } }\n                   && semanticModel.GetSymbolInfo(expressionToCheck.Right).Symbol is IParameterSymbol { IsImplicitlyDeclared: true }\n                   && IsBaseProperty(propertySymbol, semanticModel, memberAccess);\n        }\n\n        private static bool IsMethodCandidate(MethodDeclarationSyntax methodSyntax, SemanticModel semanticModel)\n        {\n            if (HasDocumentationComment(methodSyntax))\n            {\n                return false;\n            }\n\n            var methodSymbol = semanticModel.GetDeclaredSymbol(methodSyntax);\n            if (IsMethodSymbolExcluded(methodSymbol))\n            {\n                return false;\n            }\n\n            var expression = methodSyntax.ExpressionBody?.Expression ?? GetSingleStatementExpression(methodSyntax.Body, isVoid: methodSymbol.ReturnsVoid);\n            var invocationExpression = expression as InvocationExpressionSyntax;\n\n            return invocationExpression?.Expression is MemberAccessExpressionSyntax memberAccess\n                   && memberAccess.Expression is BaseExpressionSyntax\n                   && semanticModel.GetSymbolInfo(invocationExpression).Symbol is IMethodSymbol invokedMethod\n                   && invokedMethod.Equals(methodSymbol.OverriddenMethod)\n                   && AreArgumentsMatchParameters(methodSymbol, semanticModel, invocationExpression, invokedMethod);\n        }\n\n        private static bool IsMethodSymbolExcluded(IMethodSymbol methodSymbol) =>\n            methodSymbol == null\n            || !methodSymbol.IsOverride\n            || methodSymbol.IsSealed\n            || methodSymbol.OverriddenMethod == null\n            || IgnoredMethodNames.Contains(methodSymbol.Name)\n            || methodSymbol.Parameters.Any(p => p.HasExplicitDefaultValue)\n            || methodSymbol.OverriddenMethod.Parameters.Any(p => p.HasExplicitDefaultValue)\n            || methodSymbol.IsAnyAttributeInOverridingChain()\n            || IsRecordCompilerGenerated(methodSymbol);\n\n        private static bool IsRecordCompilerGenerated(IMethodSymbol methodSymbol) =>\n            IgnoredRecordMethodNames.Contains(methodSymbol.Name)\n            && methodSymbol.ContainingSymbol is ITypeSymbol type\n            && type.IsRecord();\n\n        private static bool HasDocumentationComment(SyntaxNode node) =>\n            node.GetLeadingTrivia()\n                .Any(t => t.Kind() is SyntaxKind.SingleLineDocumentationCommentTrivia or SyntaxKind.MultiLineDocumentationCommentTrivia);\n\n        private static bool AreArgumentsMatchParameters(IMethodSymbol methodSymbol, SemanticModel semanticModel, InvocationExpressionSyntax expressionToCheck, IMethodSymbol invokedMethod)\n        {\n            if (!invokedMethod.Parameters.Any())\n            {\n                return true;\n            }\n\n            if (expressionToCheck.ArgumentList == null || invokedMethod.Parameters.Length != expressionToCheck.ArgumentList.Arguments.Count)\n            {\n                return false;\n            }\n\n            var argumentExpressions = expressionToCheck.ArgumentList.Arguments.Select(a => a.Expression as IdentifierNameSyntax).ToList();\n            for (var i = 0; i < argumentExpressions.Count; i++)\n            {\n                if (argumentExpressions[i] == null\n                    || !(semanticModel.GetSymbolInfo(argumentExpressions[i]).Symbol is IParameterSymbol parameterSymbol)\n                    || !parameterSymbol.Equals(methodSymbol.Parameters[i])\n                    || parameterSymbol.Name != methodSymbol.OverriddenMethod.Parameters[i].Name)\n                {\n                    return false;\n                }\n            }\n\n            return true;\n        }\n\n        private static ExpressionSyntax GetSingleStatementExpression(BlockSyntax block, bool isVoid)\n        {\n            if (block == null || block.Statements.Count != 1)\n            {\n                return null;\n            }\n            return isVoid\n                ? (block.Statements[0] as ExpressionStatementSyntax)?.Expression\n                : (block.Statements[0] as ReturnStatementSyntax)?.Expression;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MemberOverrideCallsBaseMemberCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class MemberOverrideCallsBaseMemberCodeFix : SonarCodeFix\n    {\n        private const string Title = \"Remove redundant override\";\n        public override ImmutableArray<string> FixableDiagnosticIds =>\n            ImmutableArray.Create(MemberOverrideCallsBaseMember.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnosticSpan = context.Diagnostics.First().Location.SourceSpan;\n\n            if (!(root.FindNode(diagnosticSpan) is MemberDeclarationSyntax member))\n            {\n                return Task.CompletedTask;\n            }\n\n            context.RegisterCodeFix(\n                Title,\n                c =>\n                {\n                    var newRoot = root.RemoveNode(member, SyntaxRemoveOptions.KeepNoTrivia);\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n\n            return Task.CompletedTask;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MemberShadowsOuterStaticMember.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class MemberShadowsOuterStaticMember : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S3218\";\n        private const string MessageFormat = \"Rename this {0} to not shadow the outer class' member with the same name.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterSymbolAction(c =>\n                {\n                    var innerClassSymbol = (INamedTypeSymbol)c.Symbol;\n                    var containerClassSymbol = innerClassSymbol.ContainingType;\n\n                    if (!IsValidType(innerClassSymbol)\n                        || !IsValidType(containerClassSymbol)\n                        || (innerClassSymbol.GetMembers().Where(x => !x.IsImplicitlyDeclared && !IsStaticAndVirtualOrAbstract(x)).ToList() is var members\n                            && !members.Any()))\n                    {\n                        return;\n                    }\n\n                    var selfAndOuterNamedTypes = SelfAndOuterNamedTypes(containerClassSymbol);\n\n                    foreach (var innerMember in members)\n                    {\n                        var outerMembersOfSameName = selfAndOuterNamedTypes.SelectMany(x => x.GetMembers(innerMember.Name)).ToList();\n\n                        switch (innerMember)\n                        {\n                            case IPropertySymbol:\n                            case IFieldSymbol:\n                            case IEventSymbol:\n                            case IMethodSymbol { MethodKind: MethodKind.DeclareMethod or MethodKind.Ordinary }:\n                                CheckMember(c, outerMembersOfSameName, innerMember);\n                                break;\n                            case INamedTypeSymbol namedType:\n                                CheckNamedType(c, outerMembersOfSameName, namedType);\n                                break;\n                        }\n                    }\n                },\n                SymbolKind.NamedType);\n\n        private static void CheckNamedType(SonarSymbolReportingContext context, IReadOnlyList<ISymbol> outerMembersOfSameName, INamedTypeSymbol namedType)\n        {\n            if (outerMembersOfSameName.Any(x => x is INamedTypeSymbol { TypeKind: TypeKind.Class or TypeKind.Struct or TypeKind.Delegate or TypeKind.Enum or TypeKind.Interface }))\n            {\n                foreach (var identifier in namedType.DeclaringReferenceIdentifiers)\n                {\n                    context.ReportIssue(Rule, identifier, namedType.GetClassification());\n                }\n            }\n        }\n\n        private static void CheckMember(SonarSymbolReportingContext context, IReadOnlyList<ISymbol> outerMembersOfSameName, ISymbol member)\n        {\n            if (outerMembersOfSameName.Any(x => (x.IsStatic && !x.IsAbstract && !x.IsVirtual) || x is IFieldSymbol { IsConst: true })\n                && member.FirstDeclaringReferenceIdentifier?.GetLocation() is { Kind: LocationKind.SourceFile } location)\n            {\n                context.ReportIssue(Rule, location, member.GetClassification());\n            }\n        }\n\n        private static IReadOnlyList<INamedTypeSymbol> SelfAndOuterNamedTypes(INamedTypeSymbol symbol)\n        {\n            var namedTypes = new List<INamedTypeSymbol>();\n            var current = symbol;\n            while (current is not null)\n            {\n                namedTypes.Add(current);\n                current = current.ContainingType;\n            }\n            return namedTypes;\n        }\n\n        private static bool IsValidType(INamedTypeSymbol symbol)\n            => symbol.IsClassOrStruct() || symbol.IsInterface();\n\n        private static bool IsStaticAndVirtualOrAbstract(ISymbol symbol)\n            => symbol.IsStatic && (symbol.IsVirtual || symbol.IsAbstract);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MemberShouldBeStatic.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class MemberShouldBeStatic : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S2325\";\n    private const string MessageFormat = \"Make '{0}' a static {1}.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    private static readonly ImmutableHashSet<string> MethodNameWhitelist = ImmutableHashSet.Create(\n        \"Application_AuthenticateRequest\",\n        \"Application_BeginRequest\",\n        \"Application_End\",\n        \"Application_EndRequest\",\n        \"Application_Error\",\n        \"Application_Init\",\n        \"Application_Start\",\n        \"Session_End\",\n        \"Session_Start\");\n\n    private static readonly ImmutableHashSet<SymbolKind> InstanceSymbolKinds = ImmutableHashSet.Create(\n        SymbolKind.Field,\n        SymbolKind.Property,\n        SymbolKind.Event,\n        SymbolKind.Method);\n\n    private static readonly ImmutableArray<KnownType> WebControllerTypes = ImmutableArray.Create(\n        KnownType.System_Web_Mvc_Controller,\n        KnownType.System_Web_Http_ApiController,\n        KnownType.Microsoft_AspNetCore_Mvc_Controller,\n        KnownType.System_Web_HttpApplication);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(\n            c => CheckIssue<PropertyDeclarationSyntax>(c, PropertyDescendants, d => d.Identifier, \"property\"),\n            SyntaxKind.PropertyDeclaration);\n\n        context.RegisterNodeAction(\n            c => CheckIssue<MethodDeclarationSyntax>(c, MethodDescendants, d => d.Identifier, \"method\"),\n            SyntaxKind.MethodDeclaration);\n    }\n\n    private static IEnumerable<SyntaxNode> PropertyDescendants(PropertyDeclarationSyntax propertyDeclaration) =>\n        propertyDeclaration.ExpressionBody is null\n            ? propertyDeclaration.AccessorList.Accessors.SelectMany(x => x.DescendantNodes())\n            : propertyDeclaration.ExpressionBody.DescendantNodes();\n\n    private static IEnumerable<SyntaxNode> MethodDescendants(MethodDeclarationSyntax methodDeclaration) =>\n        methodDeclaration.ExpressionBody is null\n            ? methodDeclaration.Body?.DescendantNodes()\n            : methodDeclaration.ExpressionBody.DescendantNodes();\n\n    private static void CheckIssue<TDeclarationSyntax>(SonarSyntaxNodeReportingContext context,\n                                                       Func<TDeclarationSyntax, IEnumerable<SyntaxNode>> getDescendants,\n                                                       Func<TDeclarationSyntax, SyntaxToken> getIdentifier,\n                                                       string memberKind)\n        where TDeclarationSyntax : MemberDeclarationSyntax\n    {\n        var declaration = (TDeclarationSyntax)context.Node;\n        if (IsEmptyMethod(declaration) || CSharpFacade.Instance.Syntax.ModifierKinds(declaration).Contains(SyntaxKind.PartialKeyword))\n        {\n            return;\n        }\n\n        if (context.Model.GetDeclaredSymbol(declaration) is not { } methodOrPropertySymbol\n            || IsStaticVirtualAbstractOrOverride()\n            || MethodNameWhitelist.Contains(methodOrPropertySymbol.Name)\n            || IsOverrideInterfaceOrNew()\n            || IsExcludedByEnclosingType()\n            || methodOrPropertySymbol.GetAttributes().Any(IsIgnoredAttribute)\n            || IsAutoProperty(methodOrPropertySymbol)\n            || IsPublicControllerMethod(methodOrPropertySymbol)\n            || IsWindowsDesktopEventHandler(methodOrPropertySymbol))\n        {\n            return;\n        }\n\n        var descendants = getDescendants(declaration);\n        if (descendants is null || HasInstanceReferences(descendants, context.Model))\n        {\n            return;\n        }\n        var identifier = getIdentifier(declaration);\n        context.ReportIssue(Rule, identifier, identifier.Text, memberKind);\n\n        bool IsStaticVirtualAbstractOrOverride() =>\n            methodOrPropertySymbol.IsStatic || methodOrPropertySymbol.IsVirtual || methodOrPropertySymbol.IsAbstract || methodOrPropertySymbol.IsOverride;\n\n        bool IsOverrideInterfaceOrNew() =>\n            methodOrPropertySymbol.InterfaceMembers().Any()\n            || IsNewMethod(methodOrPropertySymbol)\n            || IsNewProperty(methodOrPropertySymbol);\n\n        bool IsExcludedByEnclosingType() =>\n            methodOrPropertySymbol.ContainingType.IsInterface()\n            // Any generic type in nesting chain with member accessible from outside (through the whole nesting chain) is excluded.\n            || (methodOrPropertySymbol.ContainingType.IsGenericType && methodOrPropertySymbol.GetEffectiveAccessibility().IsAccessibleOutsideTheType())\n            // Any nested private generic type with member accessible from outside that type (not the whole nesting chain) is also excluded.\n            || (methodOrPropertySymbol.ContainingType.TypeArguments.Any() && methodOrPropertySymbol.DeclaredAccessibility.IsAccessibleOutsideTheType());\n    }\n\n    private static bool IsIgnoredAttribute(AttributeData attribute) =>\n        !attribute.AttributeClass.Is(KnownType.System_Diagnostics_CodeAnalysis_SuppressMessageAttribute);\n\n    private static bool IsEmptyMethod(MemberDeclarationSyntax node) =>\n        node is MethodDeclarationSyntax { Body.Statements.Count: 0, ExpressionBody: null };\n\n    private static bool IsNewMethod(ISymbol symbol) =>\n        symbol.DeclaringSyntaxReferences\n            .Select(x => x.GetSyntax())\n            .OfType<MethodDeclarationSyntax>()\n            .Any(x => x.Modifiers.Any(SyntaxKind.NewKeyword));\n\n    private static bool IsNewProperty(ISymbol symbol) =>\n        symbol.DeclaringSyntaxReferences\n            .Select(x => x.GetSyntax())\n            .OfType<PropertyDeclarationSyntax>()\n            .Any(x => x.Modifiers.Any(SyntaxKind.NewKeyword));\n\n    private static bool IsAutoProperty(ISymbol symbol) =>\n        symbol.DeclaringSyntaxReferences\n            .Select(x => x.GetSyntax())\n            .OfType<PropertyDeclarationSyntax>()\n            .Any(x => x.AccessorList is not null && x.AccessorList.Accessors.All(a => a.Body is null && a.ExpressionBody is null));\n\n    private static bool IsPublicControllerMethod(ISymbol symbol) =>\n        symbol is IMethodSymbol methodSymbol\n        && methodSymbol.GetEffectiveAccessibility() == Accessibility.Public\n        && methodSymbol.ContainingType.DerivesFromAny(WebControllerTypes);\n\n    private static bool IsWindowsDesktopEventHandler(ISymbol symbol) =>\n        symbol is IMethodSymbol { Parameters.Length: 2 } methodSymbol\n        && methodSymbol.Parameters[0].Type.Is(KnownType.System_Object)\n        && methodSymbol.Parameters[1].Type.DerivesFrom(KnownType.System_EventArgs)\n        && (IsContainingTypeWindowsForm(methodSymbol)\n            || IsContainingTypeWpf(methodSymbol));\n\n    private static bool IsContainingTypeWindowsForm(IMethodSymbol methodSymbol) =>\n        methodSymbol.ContainingType.Implements(KnownType.System_Windows_Forms_IContainerControl);\n\n    private static bool IsContainingTypeWpf(IMethodSymbol methodSymbol) =>\n        methodSymbol.ContainingType.DerivesFrom(KnownType.System_Windows_FrameworkElement);\n\n    private static bool HasInstanceReferences(IEnumerable<SyntaxNode> nodes, SemanticModel model) =>\n        nodes.OfType<ExpressionSyntax>()\n            .Where(IsLeftmostIdentifierName)\n            .Where(x => !x.IsInNameOfArgument(model))\n            .Any(x => IsInstanceMember(x, model));\n\n    private static bool IsLeftmostIdentifierName(ExpressionSyntax node)\n    {\n        if (node is InstanceExpressionSyntax || node.IsKind(SyntaxKindEx.FieldExpression))\n        {\n            return true;\n        }\n        if (node is not SimpleNameSyntax)\n        {\n            return false;\n        }\n\n        var memberAccess = node.Parent as MemberAccessExpressionSyntax;\n        var conditional = node.Parent as ConditionalAccessExpressionSyntax;\n        var memberBinding = node.Parent as MemberBindingExpressionSyntax;\n\n        return (memberAccess is null && conditional is null && memberBinding is null)\n            || memberAccess?.Expression == node\n            || conditional?.Expression == node;\n    }\n\n    private static bool IsInstanceMember(ExpressionSyntax node, SemanticModel model)\n    {\n        if (node is InstanceExpressionSyntax || node.IsKind(SyntaxKindEx.FieldExpression))\n        {\n            return true;\n        }\n        // For ctor(foo: bar), 'IsConstructorParameter(foo)' returns true. This check prevents that case.\n        else if (node.Parent is NameColonSyntax)\n        {\n            return false;\n        }\n        return model.GetSymbolInfo(node).Symbol is { IsStatic: false } symbol\n            && (InstanceSymbolKinds.Contains(symbol.Kind) || IsConstructorParameter(symbol) || IsExtensionParameter(symbol));\n\n        // Checking for primary constructor parameters\n        static bool IsConstructorParameter(ISymbol symbol) =>\n            symbol is IParameterSymbol { ContainingSymbol: IMethodSymbol { MethodKind: MethodKind.Constructor } };\n\n        static bool IsExtensionParameter(ISymbol symbol) =>\n            symbol is IParameterSymbol { ContainingSymbol: ITypeSymbol { TypeKind: TypeKindEx.Extension } };\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MemberShouldNotHaveConflictingTransparencyAttributes.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class MemberShouldNotHaveConflictingTransparencyAttributes : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S4211\";\n        private const string MessageFormat = \"Change or remove this attribute to be consistent with its container.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n        protected override bool EnableConcurrentExecution => false;\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterCompilationStartAction(\n                csac =>\n                {\n                    var nodesWithSecuritySafeCritical = new Dictionary<SyntaxNode, AttributeSyntax>();\n                    var nodesWithSecurityCritical = new Dictionary<SyntaxNode, AttributeSyntax>();\n\n                    csac.RegisterNodeAction(snac => CollectSecurityAttributes(snac, nodesWithSecuritySafeCritical, nodesWithSecurityCritical), SyntaxKind.Attribute);\n\n                    csac.RegisterCompilationEndAction(cac => ReportOnConflictingTransparencyAttributes(cac, nodesWithSecuritySafeCritical, nodesWithSecurityCritical));\n                });\n\n        private static void CollectSecurityAttributes(SonarSyntaxNodeReportingContext syntaxNodeAnalysisContext,\n                                                      Dictionary<SyntaxNode, AttributeSyntax> nodesWithSecuritySafeCritical,\n                                                      Dictionary<SyntaxNode, AttributeSyntax> nodesWithSecurityCritical)\n        {\n            var attribute = (AttributeSyntax)syntaxNodeAnalysisContext.Node;\n            if (!(syntaxNodeAnalysisContext.Model.GetSymbolInfo(attribute).Symbol is IMethodSymbol attributeConstructor))\n            {\n                return;\n            }\n\n            if (attributeConstructor.ContainingType.Is(KnownType.System_Security_SecuritySafeCriticalAttribute))\n            {\n                nodesWithSecuritySafeCritical.Add(attribute.Parent.Parent, attribute);\n            }\n            else if (attributeConstructor.ContainingType.Is(KnownType.System_Security_SecurityCriticalAttribute))\n            {\n                nodesWithSecurityCritical.Add(attribute.Parent.Parent, attribute);\n            }\n            else\n            {\n                // nothing\n            }\n        }\n\n        private static void ReportOnConflictingTransparencyAttributes(SonarCompilationReportingContext compilationContext,\n                                                                      Dictionary<SyntaxNode, AttributeSyntax> nodesWithSecuritySafeCritical,\n                                                                      Dictionary<SyntaxNode, AttributeSyntax> nodesWithSecurityCritical)\n        {\n            var assemblySecurityCriticalAttribute = compilationContext.Compilation.Assembly\n                                                                      .GetAttributes(KnownType.System_Security_SecurityCriticalAttribute)\n                                                                      .FirstOrDefault();\n\n            if (assemblySecurityCriticalAttribute is not null)\n            {\n                var assemblySecurityLocation = assemblySecurityCriticalAttribute.ApplicationSyntaxReference.GetSyntax().ToSecondaryLocation();\n\n                // All parts declaring the 'SecuritySafeCriticalAttribute' are incorrect since the assembly\n                // itself is marked as 'SecurityCritical'.\n                foreach (var item in nodesWithSecuritySafeCritical)\n                {\n                    compilationContext.ReportIssue(Rule, item.Value.GetLocation(), [assemblySecurityLocation]);\n                }\n            }\n            else\n            {\n                foreach (var item in nodesWithSecuritySafeCritical)\n                {\n                    var current = item.Key.Parent;\n                    while (current is not null)\n                    {\n                        if (nodesWithSecurityCritical.ContainsKey(current))\n                        {\n                            compilationContext.ReportIssue(Rule, item.Value.GetLocation(), [nodesWithSecurityCritical[current].ToSecondaryLocation()]);\n                            break;\n                        }\n\n                        current = current.Parent;\n                    }\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MessageTemplates/IMessageTemplateCheck.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Core.RegularExpressions;\n\nnamespace SonarAnalyzer.CSharp.Rules.MessageTemplates;\n\npublic interface IMessageTemplateCheck\n{\n    DiagnosticDescriptor Rule { get; }\n\n    void Execute(SonarSyntaxNodeReportingContext context, InvocationExpressionSyntax invocation, ArgumentSyntax templateArgument, MessageTemplatesParser.Placeholder[] placeholders);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MessageTemplates/LoggingTemplatePlaceHoldersShouldBeInOrder.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text;\nusing SonarAnalyzer.CSharp.Core.RegularExpressions;\n\nnamespace SonarAnalyzer.CSharp.Rules.MessageTemplates;\n\npublic sealed class LoggingTemplatePlaceHoldersShouldBeInOrder : IMessageTemplateCheck\n{\n    private const string DiagnosticId = \"S6673\";\n    private const string MessageFormat = \"Template placeholders should be in the right order: placeholder '{0}' does not match with argument '{1}'.\";\n    private const string SecondaryMessageFormat = \"The argument should be '{0}' to match placeholder '{1}'.\";\n\n    internal static readonly DiagnosticDescriptor S6673 = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public DiagnosticDescriptor Rule => S6673;\n\n    public void Execute(SonarSyntaxNodeReportingContext context, InvocationExpressionSyntax invocation, ArgumentSyntax templateArgument, MessageTemplatesParser.Placeholder[] placeholders)\n    {\n        var methodSymbol = (IMethodSymbol)context.Model.GetSymbolInfo(invocation).Symbol;\n        var placeholderValues = PlaceholderValues(invocation, methodSymbol).ToImmutableArray();\n        for (var i = 0; i < placeholders.Length; i++)\n        {\n            var placeholder = placeholders[i];\n            if (placeholder.Name != \"_\"\n                && !int.TryParse(placeholder.Name, out _)\n                && Array.FindIndex(placeholders, x => x.Name == placeholder.Name) == i // don't raise for duplicate placeholders\n                && OutOfOrderPlaceholderValue(placeholder, i, placeholderValues, out var betterFitArgument) is { } outOfOrderArgument)\n            {\n                var templateStart = templateArgument.Expression.GetLocation().SourceSpan.Start;\n                var primaryLocation = Location.Create(context.Tree, new(templateStart + placeholder.Start, placeholder.Length));\n                context.ReportIssue(Rule, primaryLocation, SecondaryLocations(outOfOrderArgument, betterFitArgument, placeholder), placeholder.Name, outOfOrderArgument.ToString());\n                return; // only raise on the first out-of-order placeholder to make the rule less noisy\n            }\n        }\n    }\n\n    private static IEnumerable<SecondaryLocation> SecondaryLocations(SyntaxNode node, SyntaxNode betterFitArgument, MessageTemplatesParser.Placeholder placeholder) =>\n        [node.ToSecondaryLocation(SecondaryMessageFormat, BetterFitName(betterFitArgument), placeholder.Name)];\n\n    private static string BetterFitName(SyntaxNode node) =>\n        node is MemberAccessExpressionSyntax or CastExpressionSyntax ? node.ToString() : node.GetName();\n\n    private static IEnumerable<SyntaxNode> PlaceholderValues(InvocationExpressionSyntax invocation, IMethodSymbol methodSymbol)\n    {\n        var parameters = methodSymbol.Parameters.Where(x => x.Name == \"args\"\n            || x.Name.StartsWith(\"argument\")\n            || x.Name.StartsWith(\"propertyValue\"))\n            .ToArray();\n        if (parameters.Length == 0)\n        {\n            yield break;\n        }\n        var parameterLookup = CSharpFacade.Instance.MethodParameterLookup(invocation, methodSymbol);\n        foreach (var parameter in parameters)\n        {\n            if (parameterLookup.TryGetSyntax(parameter, out var expressions))\n            {\n                foreach (var item in expressions)\n                {\n                    yield return item;\n                }\n            }\n        }\n    }\n\n    private static SyntaxNode OutOfOrderPlaceholderValue(\n        MessageTemplatesParser.Placeholder placeholder,\n        int placeholderIndex,\n        ImmutableArray<SyntaxNode> placeholderValues,\n        out SyntaxNode betterFitArgument)\n    {\n        betterFitArgument = null;\n        if (placeholderIndex < placeholderValues.Length && MatchesName(placeholder.Name, placeholderValues[placeholderIndex], isStrict: false) is not false)\n        {\n            return null;\n        }\n        else\n        {\n            for (var i = 0; i < placeholderValues.Length; i++)\n            {\n                if (i != placeholderIndex && placeholderIndex < placeholderValues.Length && MatchesName(placeholder.Name, placeholderValues[i], isStrict: true) is true)\n                {\n                    betterFitArgument = placeholderValues.Skip(i).FirstOrDefault(x => MatchesName(placeholder.Name, x, isStrict: true) is true);\n                    return placeholderValues[placeholderIndex];\n                }\n            }\n        }\n        return null;\n    }\n\n    private static bool? MatchesName(string placeholderName, SyntaxNode placeholderValue, bool isStrict) =>\n        placeholderValue switch\n        {\n            MemberAccessExpressionSyntax memberAccess => MatchesName(placeholderName, memberAccess.Name, isStrict),\n            CastExpressionSyntax cast => MatchesName(placeholderName, cast.Expression, isStrict),\n            NameSyntax name => SimpleStringMatches(placeholderName, name.GetName(), isStrict),\n            _ => null\n        };\n\n    private static bool SimpleStringMatches(string placeholderName, string argumentName, bool isStrict)\n    {\n        if (isStrict)\n        {\n            return OnlyLetters(placeholderName).Equals(OnlyLetters(argumentName), StringComparison.OrdinalIgnoreCase);\n        }\n        else\n        {\n            var placeholderComponents = SplitByCamelCase(placeholderName);\n            var argumentComponents = SplitByCamelCase(argumentName);\n            return placeholderComponents.Intersect(argumentComponents, StringComparer.OrdinalIgnoreCase).Any();\n        }\n    }\n\n    private static IEnumerable<string> SplitByCamelCase(string text)\n    {\n        var builder = new StringBuilder(text.Length);\n        foreach (var ch in text)\n        {\n            if (char.IsUpper(ch) && builder.Length > 0)\n            {\n                yield return builder.ToString();\n                builder.Clear();\n            }\n            if (char.IsLetter(ch))\n            {\n                builder.Append(ch);\n            }\n        }\n        if (builder.Length > 0)\n        {\n            yield return builder.ToString();\n        }\n    }\n\n    private static string OnlyLetters(string text) =>\n        new(text.Where(char.IsLetter).ToArray());\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MessageTemplates/MessageTemplateAnalyzer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Core.RegularExpressions;\nusing SonarAnalyzer.CSharp.Rules.MessageTemplates;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class MessageTemplateAnalyzer : SonarDiagnosticAnalyzer\n{\n    private static readonly ImmutableHashSet<IMessageTemplateCheck> Checks = ImmutableHashSet.Create<IMessageTemplateCheck>(\n        new LoggingTemplatePlaceHoldersShouldBeInOrder(),\n        new NamedPlaceholdersShouldBeUnique(),\n        new UsePascalCaseForNamedPlaceHolders());\n\n    private static readonly HashSet<SyntaxKind> StringExpressionSyntaxKinds =\n    [\n        SyntaxKind.StringLiteralExpression,\n        SyntaxKind.AddExpression,\n        SyntaxKind.InterpolatedStringExpression,\n        SyntaxKind.InterpolatedStringText\n    ];\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => Checks.Select(x => x.Rule).ToImmutableArray();\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(cc =>\n            {\n                if (cc.Compilation.ReferencesAny(KnownAssembly.MicrosoftExtensionsLoggingAbstractions, KnownAssembly.Serilog, KnownAssembly.NLog))\n                {\n                    cc.RegisterNodeAction(c =>\n                        {\n                            var invocation = (InvocationExpressionSyntax)c.Node;\n                            var enabledChecks = Checks.Where(x => x.Rule.IsEnabled(c)).ToArray();\n                            if (enabledChecks.Length > 0\n                                && MessageTemplateExtractor.TemplateArgument(invocation, c.Model) is { } argument\n                                && HasValidExpression(argument)\n                                && MessageTemplatesParser.Parse(argument.Expression) is { Success: true } result)\n                            {\n                                foreach (var check in enabledChecks)\n                                {\n                                    check.Execute(c, invocation, argument, result.Placeholders);\n                                }\n                            }\n                        },\n                        SyntaxKind.InvocationExpression);\n                }\n            });\n\n    // Allow:\n    // \"regular string\"\n    // \"concatenated \" + \"string\"\n    // condition ? \"ternary\" : \"scenarios\"\n    // $\"interpolated {string}\"\n    // Do not allow:\n    // \"complex\" + $\"interpolated {scenarios}\"\n    // condition ? \"complex : $\"interpolated {scenarios}\"\n    private static bool HasValidExpression(ArgumentSyntax argument) =>\n        argument.Expression.IsKind(SyntaxKind.InterpolatedStringExpression)\n        || argument.Expression.DescendantNodes().All(x => x.IsAnyKind(StringExpressionSyntaxKinds));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MessageTemplates/MessageTemplateExtractor.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing static Roslyn.Utilities.SonarAnalyzer.Shared.LoggingFrameworkMethods;\n\nnamespace SonarAnalyzer.CSharp.Rules.MessageTemplates;\n\ninternal static class MessageTemplateExtractor\n{\n    public static ArgumentSyntax TemplateArgument(InvocationExpressionSyntax invocation, SemanticModel model) =>\n       TemplateArgument(invocation, model, KnownType.Microsoft_Extensions_Logging_LoggerExtensions, MicrosoftExtensionsLogging, \"message\")\n       ?? TemplateArgument(invocation, model, KnownType.Serilog_Log, Serilog, \"messageTemplate\")\n       ?? TemplateArgument(invocation, model, KnownType.Serilog_ILogger, Serilog, \"messageTemplate\", checkDerivedTypes: true)\n       ?? TemplateArgument(invocation, model, KnownType.NLog_ILoggerExtensions, NLogLoggingMethods, \"message\")\n       ?? TemplateArgument(invocation, model, KnownType.NLog_ILogger, NLogLoggingMethods, \"message\", checkDerivedTypes: true)\n       ?? TemplateArgument(invocation, model, KnownType.NLog_ILoggerBase, NLogILoggerBase, \"message\", checkDerivedTypes: true);\n\n    private static ArgumentSyntax TemplateArgument(InvocationExpressionSyntax invocation,\n                                                   SemanticModel model,\n                                                   KnownType type,\n                                                   ICollection<string> methods,\n                                                   string template,\n                                                   bool checkDerivedTypes = false) =>\n        methods.Contains(invocation.GetIdentifier().ToString())\n        && model.GetSymbolInfo(invocation).Symbol is IMethodSymbol method\n        && method.HasContainingType(type, checkDerivedTypes)\n        && CSharpFacade.Instance.MethodParameterLookup(invocation, method) is { } lookup\n        && lookup.TryGetSyntax(template, out var argumentsFound) // Fetch Argument.Expression with IParameterSymbol.Name == templateName\n        && argumentsFound.Length == 1\n            ? (ArgumentSyntax)argumentsFound[0].Parent\n            : null;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MessageTemplates/MessageTemplatesShouldBeCorrect.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text.RegularExpressions;\nusing SonarAnalyzer.CSharp.Core.RegularExpressions;\nusing SonarAnalyzer.CSharp.Rules.MessageTemplates;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class MessageTemplatesShouldBeCorrect : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S6674\";\n    private const string MessageFormat = \"Log message template {0}.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(cc =>\n        {\n            if (cc.Compilation.ReferencesAny(KnownAssembly.MicrosoftExtensionsLoggingAbstractions, KnownAssembly.Serilog, KnownAssembly.NLog))\n            {\n                cc.RegisterNodeAction(c =>\n                {\n                    var invocation = (InvocationExpressionSyntax)c.Node;\n                    if (MessageTemplateExtractor.TemplateArgument(invocation, c.Model) is { } argument\n                        && argument.Expression.IsKind(SyntaxKind.StringLiteralExpression)\n                        && TemplateValidator.ContainsErrors(argument.Expression.ToString(), out var errors))\n                    {\n                        var templateStart = argument.Expression.GetLocation().SourceSpan.Start;\n                        foreach (var error in errors)\n                        {\n                            var location = Location.Create(c.Tree, new(templateStart + error.Start, error.Length));\n                            c.ReportIssue(Rule, location, error.Message);\n                        }\n                    }\n                },\n                SyntaxKind.InvocationExpression);\n            }\n        });\n\n    private static class TemplateValidator\n    {\n        private const int EmptyPlaceholderSize = 2; // \"{}\"\n\n        private const string TextPattern = @\"([^\\{]|\\{\\{|\\}\\})+\";\n        private const string HolePattern = @\"{(?<Placeholder>[^\\}]*)}\";\n        private const string TemplatePattern = $\"^({TextPattern}|{HolePattern})*$\";\n        // This is similar to the regex used for MessageTemplatesAnalyzer, but it is far more permissive.\n        // The goal is to manually parse the placeholders, so that we can report more specific issues than just \"malformed template\".\n        private static readonly Regex TemplateRegex = new(TemplatePattern, RegexOptions.Compiled, TimeSpan.FromMilliseconds(300));\n        private static readonly Regex PlaceholderNameRegex = new(\"^[0-9a-zA-Z_]+$\", RegexOptions.Compiled, Constants.DefaultRegexTimeout);\n        private static readonly Regex PlaceholderAlignmentRegex = new(\"^-?[0-9]+$\", RegexOptions.Compiled, Constants.DefaultRegexTimeout);\n\n        public static bool ContainsErrors(string template, out List<ParsingError> errors)\n        {\n            var result = MessageTemplatesParser.Parse(template, TemplateRegex);\n            errors = result.Success\n                ? result.Placeholders.Select(ParsePlaceholder).Where(x => x is not null).ToList()\n                : [new(\"should be syntactically correct\", 0, template.Length)];\n            return errors.Count > 0;\n        }\n\n        private static ParsingError ParsePlaceholder(MessageTemplatesParser.Placeholder placeholder)\n        {\n            if (placeholder.Length == 0)\n            {\n                return new(\"should not contain empty placeholder\", placeholder.Start - 1, EmptyPlaceholderSize);\n            }\n            var parts = Split(placeholder.Name);\n            return \"🔥\" switch\n            {\n                _ when !PlaceholderNameRegex.SafeIsMatch(parts.Name) =>\n                    new($\"placeholder '{parts.Name}' should only contain letters, numbers, and underscore\", placeholder),\n\n                _ when parts.Alignment is not null && !PlaceholderAlignmentRegex.SafeIsMatch(parts.Alignment) =>\n                    new($\"placeholder '{parts.Name}' should have numeric alignment instead of '{parts.Alignment}'\", placeholder),\n\n                _ when parts.Format == string.Empty =>\n                    new($\"placeholder '{parts.Name}' should not have empty format\", placeholder),\n\n                _ => null,\n            };\n        }\n\n        // pattern is: name[,alignment][:format]\n        private static Parts Split(string placeholder)\n        {\n            string alignment = null;\n            string format = null;\n\n            var formatIndex = placeholder.IndexOf(':');\n            var alignmentIndex = placeholder.IndexOf(',');\n            if (formatIndex >= 0 && alignmentIndex > formatIndex)\n            {\n                // example {name:format,alignment}\n                //               ^^^^^^^^^^^^^^^^ all of this is format, need to reset alignment\n                alignmentIndex = -1;\n            }\n\n            if (formatIndex == -1)\n            {\n                formatIndex = placeholder.Length;\n            }\n            else\n            {\n                format = placeholder.Substring(formatIndex + 1);\n            }\n            if (alignmentIndex == -1)\n            {\n                alignmentIndex = formatIndex;\n            }\n            else\n            {\n                alignment = placeholder.Substring(alignmentIndex + 1, formatIndex - alignmentIndex - 1);\n            }\n\n            var start = placeholder[0] is '@' or '$' ? 1 : 0; // skip prefix\n            var name = placeholder.Substring(start, alignmentIndex - start);\n            return new(name, alignment, format);\n        }\n\n        private sealed record Parts(string Name, string Alignment, string Format);\n\n        public sealed record ParsingError(string Message, int Start, int Length)\n        {\n            public ParsingError(string message, MessageTemplatesParser.Placeholder placeholder)\n                : this(message, placeholder.Start, placeholder.Length)\n            { }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MessageTemplates/NamedPlaceholdersShouldBeUnique.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Core.RegularExpressions;\n\nnamespace SonarAnalyzer.CSharp.Rules.MessageTemplates;\n\npublic sealed class NamedPlaceholdersShouldBeUnique : IMessageTemplateCheck\n{\n    private const string DiagnosticId = \"S6677\";\n    private const string MessageFormat = \"Message template placeholder '{0}' is not unique.\";\n\n    internal static readonly DiagnosticDescriptor S6677 = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public DiagnosticDescriptor Rule => S6677;\n\n    public void Execute(SonarSyntaxNodeReportingContext context, InvocationExpressionSyntax invocation, ArgumentSyntax templateArgument, MessageTemplatesParser.Placeholder[] placeholders)\n    {\n        var duplicatedGroups = placeholders\n            .Where(x => x.Name != \"_\" && !int.TryParse(x.Name, out _)) // exclude wildcard \"_\" and index placeholders like {42}\n            .GroupBy(x => x.Name)\n            .Where(x => x.Count() > 1);\n\n        foreach (var group in duplicatedGroups)\n        {\n            var templateStart = templateArgument.Expression.GetLocation().SourceSpan.Start;\n            var locations = group.Select(x => Location.Create(context.Tree, new(templateStart + x.Start, x.Length)));\n            context.ReportIssue(Rule, locations.First(), locations.Skip(1).ToSecondary(MessageFormat, group.First().Name), group.First().Name);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MessageTemplates/UsePascalCaseForNamedPlaceHolders.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing static SonarAnalyzer.CSharp.Core.RegularExpressions.MessageTemplatesParser;\n\nnamespace SonarAnalyzer.CSharp.Rules.MessageTemplates;\n\npublic sealed class UsePascalCaseForNamedPlaceHolders : IMessageTemplateCheck\n{\n    private const string DiagnosticId = \"S6678\";\n    private const string MessageFormat = \"Use PascalCase for named placeholders.\";\n\n    internal static readonly DiagnosticDescriptor S6678 = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public DiagnosticDescriptor Rule => S6678;\n\n    public void Execute(SonarSyntaxNodeReportingContext context, InvocationExpressionSyntax invocation, ArgumentSyntax templateArgument, Placeholder[] placeholders)\n    {\n        var nonPascalCasePlaceholders = placeholders.Where(x => char.IsLower(x.Name[0])).ToArray();\n        if (nonPascalCasePlaceholders.Length > 0)\n        {\n            context.ReportIssue(Rule, templateArgument, nonPascalCasePlaceholders.Select(CreateLocation));\n        }\n\n        SecondaryLocation CreateLocation(Placeholder placeholder) =>\n            Location.Create(context.Tree, new(templateArgument.Expression.GetLocation().SourceSpan.Start + placeholder.Start, placeholder.Length)).ToSecondary();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MethodOverloadOptionalParameter.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class MethodOverloadOptionalParameter : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S3427\";\n        private const string MessageFormat =\n            \"This method signature overlaps the one defined on line {0}{1}, the default parameter value {2}.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterSymbolAction(\n                c =>\n                {\n                    if (c.Symbol is not IMethodSymbol methodSymbol\n                        || ShouldSkip(methodSymbol))\n                    {\n                        return;\n                    }\n\n                    foreach (var info in GetParameterHidingInfo(methodSymbol))\n                    {\n                        ReportIssue(c, info);\n                    }\n                },\n                SymbolKind.Method);\n\n        private static void ReportIssue(SonarSymbolReportingContext c, ParameterHidingMethodInfo hidingInfo)\n        {\n            var syntax = hidingInfo.ParameterToReportOn.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax();\n            if (syntax == null || hidingInfo.HidingMethod.ImplementationSyntax() is not { } hidingMethodSyntax)\n            {\n                return;\n            }\n\n            var defaultCanBeUsed = IsMoreParameterAvailableInConflicting(hidingInfo) || !MethodsUsingSameParameterNames(hidingInfo);\n            var isOtherFile = syntax.SyntaxTree.FilePath != hidingMethodSyntax.SyntaxTree.FilePath;\n\n            c.ReportIssue(\n                Rule,\n                syntax,\n                (hidingMethodSyntax.GetLocation().GetMappedLineSpan().StartLinePosition.Line + 1).ToString(),\n                isOtherFile\n                    ? $\" in file '{new FileInfo(hidingMethodSyntax.SyntaxTree.FilePath).Name}'\"\n                    : string.Empty,\n                defaultCanBeUsed\n                    ? \"can only be used with named arguments\"\n                    : \"can't be used\");\n        }\n\n        private static List<ParameterHidingMethodInfo> GetParameterHidingInfo(IMethodSymbol methodSymbol) =>\n            methodSymbol.ContainingType\n                        .GetMembers(methodSymbol.Name)\n                        .OfType<IMethodSymbol>()\n                        .Where(m => m.TypeParameters.Length == methodSymbol.TypeParameters.Length)\n                        .Where(m => m.Parameters.Length < methodSymbol.Parameters.Length)\n                        .Where(m => !m.Parameters.Any(p => p.IsParams))\n                        .Where(candidateHidingMethod => IsMethodHidingOriginal(candidateHidingMethod, methodSymbol))\n                        .Where(candidateHidingMethod => methodSymbol.Parameters[candidateHidingMethod.Parameters.Length].IsOptional)\n                        .Select(candidateHidingMethod => new ParameterHidingMethodInfo\n                                                         {\n                                                             ParameterToReportOn = methodSymbol.Parameters[candidateHidingMethod.Parameters.Length],\n                                                             HiddenMethod = methodSymbol,\n                                                             HidingMethod = candidateHidingMethod\n                                                         })\n                        .ToList();\n\n        private static bool MethodsUsingSameParameterNames(ParameterHidingMethodInfo hidingInfo)\n        {\n            for (var i = 0; i < hidingInfo.HidingMethod.Parameters.Length; i++)\n            {\n                if (hidingInfo.HidingMethod.Parameters[i].Name != hidingInfo.HiddenMethod.Parameters[i].Name)\n                {\n                    return false;\n                }\n            }\n\n            return true;\n        }\n\n        private static bool IsMoreParameterAvailableInConflicting(ParameterHidingMethodInfo hidingInfo) =>\n            hidingInfo.HiddenMethod.Parameters.IndexOf(hidingInfo.ParameterToReportOn) < hidingInfo.HiddenMethod.Parameters.Length - 1;\n\n        private static bool IsMethodHidingOriginal(IMethodSymbol candidateHidingMethod, IMethodSymbol method) =>\n            candidateHidingMethod.Parameters\n                                 .Zip(method.Parameters, (param1, param2) => new { param1, param2 })\n                                 .All(p => AreTypesEqual(p.param1.Type, p.param2.Type)\n                                           && p.param1.IsOptional == p.param2.IsOptional);\n\n        private static bool AreTypesEqual(ITypeSymbol t1, ITypeSymbol t2) =>\n            Equals(t1, t2)\n            || (t1.Is(TypeKind.TypeParameter) && t2.Is(TypeKind.TypeParameter))\n            || AreGenericInstancesTypesEqual(t1, t2);\n\n        private static bool AreGenericInstancesTypesEqual(ITypeSymbol t1, ITypeSymbol t2)\n        {\n            if (!t1.OriginalDefinition.Equals(t2.OriginalDefinition))\n            {\n                return false;\n            }\n            if (t1 is INamedTypeSymbol named1 && t2 is INamedTypeSymbol named2)\n            {\n                return named1.TypeArguments.SequenceEqual(named2.TypeArguments, AreTypesEqual);\n            }\n            return false;\n        }\n\n        private static bool ShouldSkip(IMethodSymbol methodSymbol) =>\n            methodSymbol.InterfaceMembers().Any()\n            || methodSymbol.GetOverriddenMember() is not null\n            || !methodSymbol.Parameters.Any(p => p.IsOptional);\n\n        private sealed class ParameterHidingMethodInfo\n        {\n            public IParameterSymbol ParameterToReportOn { get; init; }\n            public IMethodSymbol HidingMethod { get; init; }\n            public IMethodSymbol HiddenMethod { get; init; }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MethodOverloadsShouldBeGrouped.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class MethodOverloadsShouldBeGrouped : MethodOverloadsShouldBeGroupedBase<SyntaxKind, MemberDeclarationSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override SyntaxKind[] SyntaxKinds { get; } =\n    [\n        SyntaxKind.ClassDeclaration,\n        SyntaxKind.InterfaceDeclaration,\n        SyntaxKind.StructDeclaration,\n        SyntaxKindEx.RecordDeclaration,\n        SyntaxKindEx.RecordStructDeclaration,\n        SyntaxKindEx.ExtensionBlockDeclaration\n    ];\n\n    protected override MemberInfo CreateMemberInfo(SonarSyntaxNodeReportingContext c, MemberDeclarationSyntax member) =>\n        member switch\n        {\n            ConstructorDeclarationSyntax constructor => new MemberInfo(c, member, constructor.Identifier, constructor.IsStatic(), false, true),\n            MethodDeclarationSyntax { ExplicitInterfaceSpecifier: { } } => null, // Skip explicit interface implementations\n            MethodDeclarationSyntax method => new MemberInfo(c, member, method.Identifier, method.IsStatic(), method.Modifiers.Any(SyntaxKind.AbstractKeyword), true),\n            _ => null,\n        };\n\n    protected override IEnumerable<MemberDeclarationSyntax> MemberDeclarations(SyntaxNode node) =>\n        ((TypeDeclarationSyntax)node).Members;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MethodOverrideAddsParams.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class MethodOverrideAddsParams : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S3600\";\n        private const string MessageFormat = \"'params' should be removed from this override.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var method = (MethodDeclarationSyntax)c.Node;\n                    var methodSymbol = c.Model.GetDeclaredSymbol(method);\n\n                    if (methodSymbol is not { IsOverride: true }\n                        || methodSymbol.OverriddenMethod == null)\n                    {\n                        return;\n                    }\n\n                    var lastParameter = method.ParameterList.Parameters.LastOrDefault();\n                    if (lastParameter == null)\n                    {\n                        return;\n                    }\n\n                    var paramsKeyword = lastParameter.Modifiers.FirstOrDefault(modifier => modifier.IsKind(SyntaxKind.ParamsKeyword));\n                    if (paramsKeyword != default\n                        && IsNotSemanticallyParams(lastParameter, c.Model))\n                    {\n                        c.ReportIssue(Rule, paramsKeyword);\n                    }\n                },\n                SyntaxKind.MethodDeclaration);\n\n        private static bool IsNotSemanticallyParams(ParameterSyntax parameter, SemanticModel semanticModel) =>\n            semanticModel.GetDeclaredSymbol(parameter) is { IsParams: false };\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MethodOverrideAddsParamsCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class MethodOverrideAddsParamsCodeFix : SonarCodeFix\n    {\n        private const string Title = \"Remove the 'params' modifier\";\n\n        public override ImmutableArray<string> FixableDiagnosticIds =>\n            ImmutableArray.Create(MethodOverrideAddsParams.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            var paramsToken = root.FindToken(diagnosticSpan.Start);\n\n            if (!paramsToken.IsKind(SyntaxKind.ParamsKeyword))\n            {\n                return Task.CompletedTask;\n            }\n\n            context.RegisterCodeFix(\n                Title,\n                c =>\n                {\n                    var node = paramsToken.Parent;\n                    var newNode = node.ReplaceToken(\n                        paramsToken,\n                        SyntaxFactory.Token(SyntaxKind.None));\n\n                    newNode = newNode.WithTriviaFrom(node);\n\n                    var newRoot = root.ReplaceNode(node, newNode);\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n\n            return Task.CompletedTask;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MethodOverrideChangedDefaultValue.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class MethodOverrideChangedDefaultValue : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S1006\";\n        private const string MessageFormat = \"{0} the default parameter value {1}.\";\n        internal const string MessageAdd = \"defined in the overridden method\";\n        internal const string MessageRemove = \"to match the signature of overridden method\";\n        internal const string MessageUseSame = \"defined in the overridden method\";\n        internal const string MessageRemoveExplicit = \"from this explicit interface implementation\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var method = (MethodDeclarationSyntax)c.Node;\n                    var methodSymbol = c.Model.GetDeclaredSymbol(method);\n\n                    var overriddenMember = methodSymbol.GetOverriddenMember() ?? methodSymbol.InterfaceMembers().FirstOrDefault();\n                    if (methodSymbol == null ||\n                        overriddenMember == null)\n                    {\n                        return;\n                    }\n\n                    for (var i = 0; i < methodSymbol.Parameters.Length; i++)\n                    {\n                        var overridingParameter = methodSymbol.Parameters[i];\n                        var overriddenParameter = overriddenMember.Parameters[i];\n\n                        var parameterSyntax = method.ParameterList.Parameters[i];\n\n                        ReportParameterIfNeeded(c, overridingParameter, overriddenParameter, parameterSyntax, methodSymbol.ExplicitInterfaceImplementations.Any());\n                    }\n                },\n                SyntaxKind.MethodDeclaration);\n        }\n\n        private static void ReportParameterIfNeeded(SonarSyntaxNodeReportingContext context, IParameterSymbol overridingParameter, IParameterSymbol overriddenParameter,\n            ParameterSyntax parameterSyntax, bool isExplicitImplementation)\n        {\n            if (isExplicitImplementation)\n            {\n                if (overridingParameter.HasExplicitDefaultValue)\n                {\n                    context.ReportIssue(rule, parameterSyntax.Default, \"Remove\", MessageRemoveExplicit);\n                }\n\n                return;\n            }\n\n            if (overridingParameter.HasExplicitDefaultValue &&\n                !overriddenParameter.HasExplicitDefaultValue)\n            {\n                context.ReportIssue(rule, parameterSyntax.Default, \"Remove\", MessageRemove);\n                return;\n            }\n\n            if (!overridingParameter.HasExplicitDefaultValue &&\n                overriddenParameter.HasExplicitDefaultValue)\n            {\n                context.ReportIssue(rule, parameterSyntax.Identifier, \"Add\", MessageAdd);\n                return;\n            }\n\n            if (overridingParameter.HasExplicitDefaultValue &&\n                overriddenParameter.HasExplicitDefaultValue &&\n                !Equals(overridingParameter.ExplicitDefaultValue, overriddenParameter.ExplicitDefaultValue))\n            {\n                context.ReportIssue(rule, parameterSyntax.Default.Value, \"Use\", MessageUseSame);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MethodOverrideChangedDefaultValueCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Formatting;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class MethodOverrideChangedDefaultValueCodeFix : SonarCodeFix\n    {\n        internal const string TitleGeneral = \"Synchronize default parameter value\";\n        internal const string TitleExplicitInterface = \"Remove default parameter value from explicit interface implementation\";\n\n        public override ImmutableArray<string> FixableDiagnosticIds =>\n            ImmutableArray.Create(MethodOverrideChangedDefaultValue.DiagnosticId);\n\n        protected override async Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            var syntaxNode = root.FindNode(diagnosticSpan);\n            var parameter = syntaxNode?.FirstAncestorOrSelf<ParameterSyntax>();\n            if (parameter == null)\n            {\n                return;\n            }\n\n            var semanticModel = await context.Document.GetSemanticModelAsync(context.Cancel).ConfigureAwait(false);\n            var parameterSymbol = semanticModel.GetDeclaredSymbol(parameter);\n            if (!(parameterSymbol?.ContainingSymbol is IMethodSymbol methodSymbol))\n            {\n                return;\n            }\n\n            ParameterSyntax newParameter;\n            string title;\n\n            if (methodSymbol.ExplicitInterfaceImplementations.Any())\n            {\n                newParameter = parameter.WithDefault(null);\n                title = TitleExplicitInterface;\n            }\n            else\n            {\n                var index = methodSymbol.Parameters.IndexOf(parameterSymbol);\n                var overriddenMember = methodSymbol.GetOverriddenMember() ?? methodSymbol.InterfaceMembers().FirstOrDefault();\n                if (index == -1 ||\n                    overriddenMember == null)\n                {\n                    return;\n                }\n\n                var overriddenParameter = overriddenMember.Parameters[index];\n\n                if (!TryGetNewParameterSyntax(parameter, overriddenParameter, out newParameter))\n                {\n                    return;\n                }\n                title = TitleGeneral;\n            }\n\n            RegisterCodeFix(context, root, parameter, newParameter, title);\n        }\n\n        private static void RegisterCodeFix(SonarCodeFixContext context, SyntaxNode root, ParameterSyntax parameter, ParameterSyntax newParameter, string codeFixTitle) =>\n            context.RegisterCodeFix(\n                codeFixTitle,\n                c =>\n                {\n                    var newRoot = root.ReplaceNode(\n                        parameter,\n                        newParameter.WithTriviaFrom(parameter));\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n\n        private static bool TryGetNewParameterSyntax(ParameterSyntax parameter, IParameterSymbol overriddenParameter, out ParameterSyntax newParameterSyntax)\n        {\n            if (!overriddenParameter.HasExplicitDefaultValue)\n            {\n                newParameterSyntax = parameter.WithDefault(null).WithAdditionalAnnotations(Formatter.Annotation);\n                return true;\n            }\n\n            var defaultSyntax = (overriddenParameter.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax() as ParameterSyntax)?.Default;\n            if (defaultSyntax != null)\n            {\n                newParameterSyntax = parameter.WithDefault(defaultSyntax.WithoutTrivia().WithAdditionalAnnotations(Formatter.Annotation));\n                return true;\n            }\n\n            newParameterSyntax = null;\n            return false;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MethodOverrideNoParams.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class MethodOverrideNoParams : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S3262\";\n        private const string MessageFormat = \"'params' should not be removed from an override.\";\n\n        private static readonly DiagnosticDescriptor Rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var method = (MethodDeclarationSyntax)c.Node;\n                    var methodSymbol = c.Model.GetDeclaredSymbol(method);\n\n                    if (methodSymbol is not null\n                        && methodSymbol.IsOverride\n                        && methodSymbol.OverriddenMethod is not null\n                        && methodSymbol.OverriddenMethod.Parameters.Any(p => p.IsParams)\n                        && !method.ParameterList.Parameters.Last().Modifiers.Any(SyntaxKind.ParamsKeyword))\n                    {\n                        c.ReportIssue(Rule, method.ParameterList.Parameters.Last());\n                    }\n                },\n                SyntaxKind.MethodDeclaration);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MethodOverrideNoParamsCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class MethodOverrideNoParamsCodeFix : SonarCodeFix\n    {\n        internal const string Title = \"Add the 'params' modifier\";\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(MethodOverrideNoParams.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            var parameter = (ParameterSyntax)root.FindNode(diagnosticSpan);\n\n            context.RegisterCodeFix(\n                Title,\n                c =>\n                {\n                    var newParameter = parameter.WithModifiers(\n                        parameter.Modifiers.Add(\n                            SyntaxFactory.Token(SyntaxKind.ParamsKeyword)));\n                    var newRoot = root.ReplaceNode(\n                        parameter,\n                        newParameter.WithTriviaFrom(parameter));\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n\n            return Task.CompletedTask;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MethodParameterMissingOptional.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class MethodParameterMissingOptional : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S3450\";\n        private const string MessageFormat = \"Add the 'Optional' attribute to this parameter.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var parameter = (ParameterSyntax)c.Node;\n                    if (!parameter.AttributeLists.Any())\n                    {\n                        return;\n                    }\n\n                    var attributes = AttributeSyntaxSymbolMapping.GetAttributesForParameter(parameter, c.Model).ToList();\n\n                    var defaultParameterValueAttribute = attributes.FirstOrDefault(a => a.Symbol.IsInType(KnownType.System_Runtime_InteropServices_DefaultParameterValueAttribute));\n                    if (defaultParameterValueAttribute == null)\n                    {\n                        return;\n                    }\n\n                    var optionalAttribute = attributes.FirstOrDefault(a => a.Symbol.IsInType(KnownType.System_Runtime_InteropServices_OptionalAttribute));\n                    if (optionalAttribute == null)\n                    {\n                        c.ReportIssue(Rule, defaultParameterValueAttribute.Node);\n                    }\n                },\n                SyntaxKind.Parameter);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MethodParameterMissingOptionalCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Formatting;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class MethodParameterMissingOptionalCodeFix : SonarCodeFix\n    {\n        private const string Title = \"Add missing 'Optional' attribute\";\n\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(MethodParameterMissingOptional.DiagnosticId);\n\n        protected override async Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            var attribute = root.FindNode(diagnosticSpan, getInnermostNodeForTie: true) as AttributeSyntax;\n            var attributeList = attribute?.Parent as AttributeListSyntax;\n            if (attribute == null ||\n                attributeList == null)\n            {\n                return;\n            }\n\n            var semanticModel = await context.Document.GetSemanticModelAsync().ConfigureAwait(false);\n            var optionalAttribute = semanticModel?.Compilation.GetTypeByMetadataName(KnownType.System_Runtime_InteropServices_OptionalAttribute);\n            if (optionalAttribute == null)\n            {\n                return;\n            }\n\n            context.RegisterCodeFix(\n                Title,\n                _ =>\n                {\n                    var newRoot = root.ReplaceNode(attributeList, GetNewAttributeList(attributeList, optionalAttribute, semanticModel));\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n        }\n\n        private static AttributeListSyntax GetNewAttributeList(AttributeListSyntax attributeList, ISymbol optionalAttribute, SemanticModel semanticModel)\n        {\n            var attributeName = optionalAttribute.ToMinimalDisplayString(semanticModel, attributeList.SpanStart);\n            attributeName = attributeName.Remove(attributeName.IndexOf(\"Attribute\", System.StringComparison.Ordinal));\n\n            return attributeList\n                .AddAttributes(SyntaxFactory.Attribute(SyntaxFactory.ParseName(attributeName)))\n                .WithAdditionalAnnotations(Formatter.Annotation);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MethodParameterUnused.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CFG.LiveVariableAnalysis;\nusing SonarAnalyzer.CFG.Roslyn;\nusing SonarAnalyzer.CFG.Sonar;\nusing SonarAnalyzer.CSharp.Core.LiveVariableAnalysis;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class MethodParameterUnused : MethodParameterUnusedBase\n{\n    internal const string IsRemovableKey = \"IsRemovable\";\n    private const string MessageUnused = \"unused method parameter '{0}'\";\n    private const string MessageDead = \"parameter '{0}', whose value is ignored in the method\";\n    private const string MessageFormat = \"Remove this {0}.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n    private readonly bool useSonarCfg;\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    public MethodParameterUnused() : this(AnalyzerConfiguration.AlwaysEnabled) { }\n\n    internal /* for testing */ MethodParameterUnused(IAnalyzerConfiguration configuration) =>\n        useSonarCfg = configuration.UseSonarCfg();\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var declaration = CreateContext(c);\n                if ((declaration.Body is null && declaration.ExpressionBody is null)\n                    || declaration.Body?.Statements.Count == 0  // Don't report on empty methods\n                    || declaration.Modifiers.AnyOfKind(SyntaxKind.PartialKeyword)\n                    || declaration.Symbol is null\n                    || !declaration.Symbol.ContainingType.IsClassOrStruct()\n                    || declaration.Symbol.IsMainMethod()\n                    || OnlyThrowsNotImplementedException(declaration))\n                {\n                    return;\n                }\n\n                ReportUnusedParametersOnMethod(declaration);\n            },\n            SyntaxKind.MethodDeclaration,\n            SyntaxKind.ConstructorDeclaration,\n            SyntaxKindEx.LocalFunctionStatement);\n\n    private static MethodContext CreateContext(SonarSyntaxNodeReportingContext c)\n    {\n        if (c.Node is BaseMethodDeclarationSyntax method)\n        {\n            return new MethodContext(c, method);\n        }\n        else if (c.Node.IsKind(SyntaxKindEx.LocalFunctionStatement))\n        {\n            return new MethodContext(c, (LocalFunctionStatementSyntaxWrapper)c.Node);\n        }\n        else\n        {\n            throw new InvalidOperationException(\"Unexpected Node: \" + c.Node);\n        }\n    }\n\n    private static bool OnlyThrowsNotImplementedException(MethodContext declaration)\n    {\n        if (declaration.Body is not null && declaration.Body.Statements.Count != 1)\n        {\n            return false;\n        }\n\n        var throwExpressions = Enumerable.Empty<ExpressionSyntax>();\n        if (declaration.ExpressionBody is not null)\n        {\n            if (ThrowExpressionSyntaxWrapper.IsInstance(declaration.ExpressionBody.Expression))\n            {\n                throwExpressions = [((ThrowExpressionSyntaxWrapper)declaration.ExpressionBody.Expression).Expression];\n            }\n        }\n        else\n        {\n            throwExpressions = declaration.Body.Statements.OfType<ThrowStatementSyntax>().Select(x => x.Expression);\n        }\n\n        return throwExpressions\n            .OfType<ObjectCreationExpressionSyntax>()\n            .Select(x => declaration.Context.Model.GetSymbolInfo(x).Symbol)\n            .OfType<IMethodSymbol>()\n            .Any(x => x is not null && x.ContainingType.Is(KnownType.System_NotImplementedException));\n    }\n\n    private void ReportUnusedParametersOnMethod(MethodContext declaration)\n    {\n        if (!MethodCanBeSafelyChanged(declaration.Symbol))\n        {\n            return;\n        }\n\n        var unusedParameters = GetUnusedParameters(declaration);\n        if (unusedParameters.Any()\n            && !IsUsedAsEventHandlerFunctionOrAction(declaration)\n            && !IsCandidateSerializableConstructor(unusedParameters, declaration.Symbol))\n        {\n            ReportOnUnusedParameters(declaration, unusedParameters, MessageUnused);\n        }\n\n        ReportOnDeadParametersAtEntry(declaration, unusedParameters);\n    }\n\n    private void ReportOnDeadParametersAtEntry(MethodContext declaration, IImmutableList<IParameterSymbol> noReportOnParameters)\n    {\n        if (declaration.Context.Node.IsKind(SyntaxKind.ConstructorDeclaration))\n        {\n            return;\n        }\n\n        var excludedParameters = noReportOnParameters;\n        if (declaration.Symbol.IsExtensionMethod)\n        {\n            excludedParameters = excludedParameters.Add(declaration.Symbol.Parameters.First());\n        }\n        excludedParameters = excludedParameters.AddRange(declaration.Symbol.Parameters.Where(x => x.RefKind != RefKind.None));\n\n        var candidateParameters = declaration.Symbol.Parameters.Except(excludedParameters);\n        if (candidateParameters.Any() && ComputeLva(declaration) is { } lva)\n        {\n            ReportOnUnusedParameters(declaration, candidateParameters.Except(lva.LiveInEntryBlock).Except(lva.CapturedVariables), MessageDead, isRemovable: false);\n        }\n    }\n\n    private LvaResult ComputeLva(MethodContext declaration)\n    {\n        if (useSonarCfg)\n        {\n            return CSharpControlFlowGraph.TryGet(declaration.Context.Node, declaration.Context.Model, out var cfg)\n                ? new LvaResult(declaration, cfg)\n                : null;\n        }\n        else\n        {\n            return declaration.Context.Node.CreateCfg(declaration.Context.Model, declaration.Context.Cancel) is { } cfg\n                ? new LvaResult(cfg, declaration.Context.Cancel)\n                : null;\n        }\n    }\n\n    private static void ReportOnUnusedParameters(MethodContext declaration, IEnumerable<ISymbol> parametersToReportOn, string messagePattern, bool isRemovable = true)\n    {\n        if (declaration.ParameterList is null)\n        {\n            return;\n        }\n\n        var parameters = declaration.ParameterList.Parameters\n            .Select(x => new NodeAndSymbol(x, declaration.Context.Model.GetDeclaredSymbol(x)))\n            .Where(x => x.Symbol is not null);\n\n        foreach (var parameter in parameters.Where(x => parametersToReportOn.Contains(x.Symbol)))\n        {\n            declaration.Context.ReportIssue(\n                Rule,\n                parameter.Node,\n                ImmutableDictionary<string, string>.Empty.Add(IsRemovableKey, isRemovable.ToString()),\n                string.Format(messagePattern, parameter.Symbol.Name));\n        }\n    }\n\n    private static bool MethodCanBeSafelyChanged(IMethodSymbol methodSymbol) =>\n        methodSymbol.GetEffectiveAccessibility() == Accessibility.Private\n        && !methodSymbol.GetAttributes().Any()\n        && methodSymbol.IsChangeable()\n        && !methodSymbol.IsEventHandler();\n\n    private static IImmutableList<IParameterSymbol> GetUnusedParameters(MethodContext declaration)\n    {\n        var usedParameters = new HashSet<IParameterSymbol>();\n        var bodies = declaration.Context.Node.IsKind(SyntaxKind.ConstructorDeclaration)\n            ? new SyntaxNode[] { declaration.Body, declaration.ExpressionBody, ((ConstructorDeclarationSyntax)declaration.Context.Node).Initializer }\n            : new SyntaxNode[] { declaration.Body, declaration.ExpressionBody };\n\n        foreach (var body in bodies.WhereNotNull())\n        {\n            usedParameters.UnionWith(GetUsedParameters(declaration.Symbol.Parameters, body, declaration.Context.Model));\n        }\n\n        var unusedParameter = declaration.Symbol.Parameters.Except(usedParameters);\n        if (declaration.Symbol.IsExtensionMethod)\n        {\n            unusedParameter = unusedParameter.Except([declaration.Symbol.Parameters.First()]);\n        }\n\n        return unusedParameter.Except(usedParameters).ToImmutableArray();\n    }\n\n    private static ISet<IParameterSymbol> GetUsedParameters(ImmutableArray<IParameterSymbol> parameters, SyntaxNode body, SemanticModel model) =>\n        body.DescendantNodes()\n            .Where(x => x.IsKind(SyntaxKind.IdentifierName))\n            .Select(x => model.GetSymbolInfo(x).Symbol as IParameterSymbol)\n            .Where(x => x is not null && parameters.Contains(x))\n            .ToHashSet();\n\n    private static bool IsUsedAsEventHandlerFunctionOrAction(MethodContext declaration) =>\n        declaration.Symbol.ContainingType.DeclaringSyntaxReferences.Select(x => x.GetSyntax())\n            .Any(x => IsMethodUsedAsEventHandlerFunctionOrActionWithinNode(declaration.Symbol, x, x.EnsureCorrectSemanticModelOrDefault(declaration.Context.Model)));\n\n    private static bool IsMethodUsedAsEventHandlerFunctionOrActionWithinNode(IMethodSymbol methodSymbol, SyntaxNode typeDeclaration, SemanticModel model) =>\n        typeDeclaration.DescendantNodes()\n            .OfType<ExpressionSyntax>()\n            .Any(x => IsMethodUsedAsEventHandlerFunctionOrActionInExpression(methodSymbol, x, model));\n\n    private static bool IsMethodUsedAsEventHandlerFunctionOrActionInExpression(IMethodSymbol methodSymbol, ExpressionSyntax expression, SemanticModel model) =>\n        !expression.IsKind(SyntaxKind.InvocationExpression)\n        && model is not null\n        && IsStandaloneExpression(expression)\n        && methodSymbol.Equals(model.GetSymbolInfo(expression).Symbol?.OriginalDefinition);\n\n    private static bool IsStandaloneExpression(ExpressionSyntax expression)\n    {\n        var parentAsAssignment = expression.Parent as AssignmentExpressionSyntax;\n\n        return expression.Parent is not ExpressionSyntax\n            || (parentAsAssignment is not null && ReferenceEquals(expression, parentAsAssignment.Right));\n    }\n\n    private static bool IsCandidateSerializableConstructor(IImmutableList<IParameterSymbol> unusedParameters, IMethodSymbol methodSymbol) =>\n        unusedParameters.Count == 1\n        && methodSymbol.MethodKind == MethodKind.Constructor\n        && methodSymbol.Parameters.Length == 2\n        && methodSymbol.Parameters.All(x => !x.IsOptional)\n        && unusedParameters[0].Equals(methodSymbol.Parameters[1])\n        && methodSymbol.ContainingType.Implements(KnownType.System_Runtime_Serialization_ISerializable)\n        && methodSymbol.Parameters[0].IsType(KnownType.System_Runtime_Serialization_SerializationInfo)\n        && methodSymbol.Parameters[1].IsType(KnownType.System_Runtime_Serialization_StreamingContext);\n\n    private sealed class MethodContext\n    {\n        public readonly SonarSyntaxNodeReportingContext Context;\n        public readonly IMethodSymbol Symbol;\n        public readonly SyntaxTokenList Modifiers;\n        public readonly ParameterListSyntax ParameterList;\n        public readonly BlockSyntax Body;\n        public readonly ArrowExpressionClauseSyntax ExpressionBody;\n\n        public MethodContext(SonarSyntaxNodeReportingContext context, BaseMethodDeclarationSyntax declaration)\n            : this(context, declaration.Modifiers, declaration.ParameterList, declaration.Body, declaration.ExpressionBody()) { }\n\n        public MethodContext(SonarSyntaxNodeReportingContext context, LocalFunctionStatementSyntaxWrapper declaration)\n            : this(context, declaration.Modifiers, declaration.ParameterList, declaration.Body, declaration.ExpressionBody) { }\n\n        public MethodContext(SonarSyntaxNodeReportingContext context, SyntaxTokenList modifiers, ParameterListSyntax parameterList, BlockSyntax body, ArrowExpressionClauseSyntax expressionBody)\n        {\n            Context = context;\n            Symbol = context.Model.GetDeclaredSymbol(context.Node) as IMethodSymbol;\n            Modifiers = modifiers;\n            ParameterList = parameterList;\n            Body = body;\n            ExpressionBody = expressionBody;\n        }\n    }\n\n    private sealed class LvaResult\n    {\n        public readonly IReadOnlyCollection<ISymbol> LiveInEntryBlock;\n        public readonly IReadOnlyCollection<ISymbol> CapturedVariables;\n\n        public LvaResult(MethodContext declaration, IControlFlowGraph cfg)\n        {\n            var lva = new SonarCSharpLiveVariableAnalysis(cfg, declaration.Symbol, declaration.Context.Model, declaration.Context.Cancel);\n            LiveInEntryBlock = lva.LiveIn(cfg.EntryBlock).OfType<IParameterSymbol>().ToImmutableArray();\n            CapturedVariables = lva.CapturedVariables;\n        }\n\n        public LvaResult(ControlFlowGraph cfg, CancellationToken cancel)\n        {\n            var lva = new RoslynLiveVariableAnalysis(cfg, CSharpSyntaxClassifier.Instance, cancel);\n            LiveInEntryBlock = lva.LiveIn(cfg.EntryBlock).OfType<IParameterSymbol>().ToImmutableArray();\n            CapturedVariables = lva.CapturedVariables;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MethodParameterUnusedCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class MethodParameterUnusedCodeFix : SonarCodeFix\n    {\n        private const string Title = \"Remove unused parameter\";\n\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(MethodParameterUnused.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            var parameter = root.FindNode(diagnosticSpan, getInnermostNodeForTie: true) as ParameterSyntax;\n\n            if (!bool.Parse(diagnostic.Properties[MethodParameterUnused.IsRemovableKey]))\n            {\n                return Task.CompletedTask;\n            }\n\n            context.RegisterCodeFix(\n                Title,\n                c =>\n                {\n                    var newRoot = root.RemoveNode(\n                        parameter,\n                        SyntaxRemoveOptions.KeepLeadingTrivia | SyntaxRemoveOptions.AddElasticMarker);\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n\n            return Task.CompletedTask;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MethodShouldBeNamedAccordingToSynchronicity.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class MethodShouldBeNamedAccordingToSynchronicity : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S4261\";\n        private const string MessageFormat = \"{0}\";\n        private const string AddAsyncSuffixMessage = \"Add the 'Async' suffix to the name of this method.\";\n        private const string RemoveAsyncSuffixMessage = \"Remove the 'Async' suffix to the name of this method.\";\n\n        private static readonly ImmutableArray<KnownType> AsyncReturnTypes =\n            ImmutableArray.Create(\n                KnownType.System_Threading_Tasks_Task,\n                KnownType.System_Threading_Tasks_Task_T,\n                KnownType.System_Threading_Tasks_ValueTask, // NetCore 2.2+\n                KnownType.System_Threading_Tasks_ValueTask_TResult);\n\n        private static readonly ImmutableArray<KnownType> AsyncReturnInterfaces =\n            ImmutableArray.Create(KnownType.System_Collections_Generic_IAsyncEnumerable_T);\n\n        private static readonly DiagnosticDescriptor Rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var methodDeclaration = (MethodDeclarationSyntax)c.Node;\n                    if (methodDeclaration.Identifier.IsMissing)\n                    {\n                        return;\n                    }\n\n                    var methodSymbol = c.Model.GetDeclaredSymbol(methodDeclaration);\n                    if (methodSymbol == null\n                        || methodSymbol.IsMainMethod()\n                        || methodSymbol.InterfaceMembers().Any()\n                        || methodSymbol.GetOverriddenMember() != null\n                        || methodSymbol.IsTestMethod()\n                        || methodSymbol.IsControllerActionMethod()\n                        || IsSignalRHubMethod(methodSymbol))\n                    {\n                        return;\n                    }\n\n                    var hasAsyncReturnType = HasAsyncReturnType(methodSymbol);\n                    var hasAsyncSuffix = HasAsyncSuffix(methodDeclaration);\n\n                    if (hasAsyncSuffix && !hasAsyncReturnType)\n                    {\n                        c.ReportIssue(Rule, methodDeclaration.Identifier, RemoveAsyncSuffixMessage);\n                    }\n                    else if (!hasAsyncSuffix && hasAsyncReturnType)\n                    {\n                        c.ReportIssue(Rule, methodDeclaration.Identifier, AddAsyncSuffixMessage);\n                    }\n                },\n                SyntaxKind.MethodDeclaration);\n\n        private static bool HasAsyncReturnType(IMethodSymbol methodSymbol) =>\n            methodSymbol.ReturnType is ITypeParameterSymbol typeParameter\n                ? typeParameter.ConstraintTypes.Any(IsAsyncType)\n                : (methodSymbol.ReturnType as INamedTypeSymbol)?.ConstructedFrom is { } returnSymbol\n                  && !returnSymbol.Is(KnownType.Void)\n                  && IsAsyncType(returnSymbol);\n\n        private static bool IsAsyncType(ITypeSymbol typeSymbol) =>\n            typeSymbol.DerivesFromAny(AsyncReturnTypes)\n            || typeSymbol.IsAny(AsyncReturnInterfaces)\n            || typeSymbol.ImplementsAny(AsyncReturnInterfaces);\n\n        private static bool HasAsyncSuffix(MethodDeclarationSyntax methodDeclaration) =>\n            methodDeclaration.Identifier.ValueText.EndsWith(\"async\", StringComparison.OrdinalIgnoreCase);\n\n        private static bool IsSignalRHubMethod(ISymbol methodSymbol) =>\n            methodSymbol.GetEffectiveAccessibility() == Accessibility.Public\n            && IsSignalRHubMethod(methodSymbol.ContainingType);\n\n        private static bool IsSignalRHubMethod(ITypeSymbol typeSymbol) =>\n            typeSymbol.DerivesFrom(KnownType.Microsoft_AspNet_SignalR_Hub);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MethodShouldNotOnlyReturnConstant.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class MethodShouldNotOnlyReturnConstant : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S3400\";\n    private const string MessageFormat = \"Remove this method and declare a constant for this value.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            c =>\n            {\n                var method = (MethodDeclarationSyntax)c.Node;\n                if (method.ParameterList?.Parameters.Count is 0\n                    && !IsVirtual(method)\n                    && IsConstantExpression(SingleExpressionOrDefault(method), c.Model)\n                    && !ContainsConditionalCompilation((SyntaxNode)method.ExpressionBody ?? method.Body)\n                    && c.Model.GetDeclaredSymbol(method) is { } methodSymbol\n                    && !methodSymbol.ContainingType.IsInterface()\n                    && methodSymbol.InterfaceMembers().IsEmpty()\n                    && methodSymbol.GetOverriddenMember() is null)\n                {\n                    c.ReportIssue(Rule, method.Identifier);\n                }\n            },\n            SyntaxKind.MethodDeclaration);\n\n    private static bool IsVirtual(BaseMethodDeclarationSyntax methodDeclaration) =>\n        methodDeclaration.Modifiers.Any(x => x.IsKind(SyntaxKind.VirtualKeyword));\n\n    private static ExpressionSyntax SingleExpressionOrDefault(MethodDeclarationSyntax method) =>\n        method switch\n        {\n            { ExpressionBody: { } body } => body.Expression,\n            { Body.Statements: { Count: 1 } statements } when statements.Single() is ReturnStatementSyntax returnStatement => returnStatement.Expression,\n            _ => null\n        };\n\n    private static bool IsConstantExpression(ExpressionSyntax expression, SemanticModel model) =>\n        expression.RemoveParentheses() is LiteralExpressionSyntax literal\n        && !literal.IsNullLiteral()\n        && model.GetConstantValue(literal).HasValue;\n\n    private static bool ContainsConditionalCompilation(SyntaxNode node) =>\n        node.DescendantNodes(descendIntoTrivia: true).Any(x => x.IsKind(SyntaxKind.IfDirectiveTrivia));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MethodsShouldNotHaveIdenticalImplementations.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class MethodsShouldNotHaveIdenticalImplementations : MethodsShouldNotHaveIdenticalImplementationsBase<SyntaxKind, IMethodDeclaration>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override SyntaxKind[] SyntaxKinds =>\n    [\n        SyntaxKind.ClassDeclaration,\n        SyntaxKindEx.RecordDeclaration,\n        SyntaxKind.StructDeclaration,\n        SyntaxKindEx.RecordStructDeclaration,\n        SyntaxKind.InterfaceDeclaration,\n        SyntaxKind.CompilationUnit\n    ];\n\n    protected override IEnumerable<IMethodDeclaration> GetMethodDeclarations(SyntaxNode node) =>\n        node.IsKind(SyntaxKind.CompilationUnit)\n            ? ((CompilationUnitSyntax)node).GetMethodDeclarations()\n            : ((TypeDeclarationSyntax)node).GetMethodDeclarations();\n\n    protected override bool AreDuplicates(SemanticModel model, IMethodDeclaration firstMethod, IMethodDeclaration secondMethod) =>\n        firstMethod is { Body.Statements.Count: > 1 }\n        && firstMethod.Identifier.ValueText != secondMethod.Identifier.ValueText\n        && HaveSameParameters(firstMethod.ParameterList?.Parameters, secondMethod.ParameterList?.Parameters)\n        && HaveSameTypeParameters(model, firstMethod.TypeParameterList?.Parameters, secondMethod.TypeParameterList?.Parameters)\n        && AreTheSameType(model, firstMethod.ReturnType, secondMethod.ReturnType)\n        && firstMethod.Body.IsEquivalentTo(secondMethod.Body, false);\n\n    protected override SyntaxToken GetMethodIdentifier(IMethodDeclaration method) =>\n        method.Identifier;\n\n    protected override bool IsExcludedFromBeingExamined(SonarSyntaxNodeReportingContext context) =>\n        base.IsExcludedFromBeingExamined(context)\n        && !context.IsTopLevelMain;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MethodsShouldNotHaveTooManyLines.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class MethodsShouldNotHaveTooManyLines\n        : MethodsShouldNotHaveTooManyLinesBase<SyntaxKind, BaseMethodDeclarationSyntax>\n    {\n        private const string LocalFunctionMessageFormat = \"{0} local function has {1} lines, which is greater than the {2} lines authorized.\";\n\n        private static readonly DiagnosticDescriptor DefaultRule = DescriptorFactory.Create(DiagnosticId, MessageFormat, false);\n        private static readonly DiagnosticDescriptor LocalFunctionRule = DescriptorFactory.Create(DiagnosticId, LocalFunctionMessageFormat, false);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(DefaultRule, LocalFunctionRule);\n\n        protected override GeneratedCodeRecognizer GeneratedCodeRecognizer =>\n            CSharpGeneratedCodeRecognizer.Instance;\n\n        protected override SyntaxKind[] SyntaxKinds { get; } =\n            {\n                SyntaxKind.MethodDeclaration,\n                SyntaxKind.ConstructorDeclaration,\n                SyntaxKind.DestructorDeclaration\n            };\n\n        protected override string MethodKeyword => \"methods\";\n\n        protected override void Initialize(SonarParametrizedAnalysisContext context)\n        {\n            context.RegisterNodeAction(c =>\n                {\n                    var localFunctionStatement = (LocalFunctionStatementSyntaxWrapper)c.Node;\n                    if (localFunctionStatement.IsTopLevel()\n                        || localFunctionStatement.Modifiers.Any(SyntaxKind.StaticKeyword))\n                    {\n                        var wrapper = (LocalFunctionStatementSyntaxWrapper)c.Node;\n                        var linesCount = CountLines(wrapper);\n                        if (linesCount > Max)\n                        {\n                            var modifierPrefix = wrapper.Modifiers.Any(SyntaxKind.StaticKeyword) ? \"This static\" : \"This\";\n                            c.ReportIssue(LocalFunctionRule, wrapper.Identifier, modifierPrefix, linesCount.ToString(), Max.ToString(), MethodKeyword);\n                        }\n                    }\n                },\n                SyntaxKindEx.LocalFunctionStatement);\n\n            base.Initialize(context);\n        }\n\n        protected override IEnumerable<SyntaxToken> GetMethodTokens(BaseMethodDeclarationSyntax baseMethodDeclaration) =>\n            baseMethodDeclaration.ExpressionBody()?.Expression?.DescendantTokens()\n                ?? baseMethodDeclaration.Body?.Statements.Where(s => !IsStaticLocalFunction(s)).SelectMany(s => s.DescendantTokens())\n                ?? Enumerable.Empty<SyntaxToken>();\n\n        protected override SyntaxToken? GetMethodIdentifierToken(BaseMethodDeclarationSyntax baseMethodDeclaration) =>\n            baseMethodDeclaration.GetIdentifierOrDefault();\n\n        protected override string GetMethodKindAndName(SyntaxToken identifierToken)\n        {\n            var identifierName = identifierToken.ValueText;\n            if (string.IsNullOrEmpty(identifierName))\n            {\n                return \"method\";\n            }\n\n            var declaration = identifierToken.Parent;\n            if (declaration.IsKind(SyntaxKind.ConstructorDeclaration))\n            {\n                return $\"constructor '{identifierName}'\";\n            }\n\n            if (declaration.IsKind(SyntaxKind.DestructorDeclaration))\n            {\n                return $\"finalizer '~{identifierName}'\";\n            }\n\n            if (declaration is MethodDeclarationSyntax)\n            {\n                return $\"method '{identifierName}'\";\n            }\n\n            return \"method\";\n        }\n\n        private static IEnumerable<SyntaxToken> GetMethodTokens(LocalFunctionStatementSyntaxWrapper wrapper) =>\n            wrapper.ExpressionBody?.Expression.DescendantTokens()\n            ?? wrapper.Body?.Statements.SelectMany(s => s.DescendantTokens())\n            ?? Enumerable.Empty<SyntaxToken>();\n\n        private static long CountLines(LocalFunctionStatementSyntaxWrapper wrapper) =>\n            GetMethodTokens(wrapper).SelectMany(x => x.LineNumbers())\n                                    .Distinct()\n                                    .LongCount();\n\n        private static bool IsStaticLocalFunction(SyntaxNode node) =>\n            node.IsKind(SyntaxKindEx.LocalFunctionStatement)\n            && ((LocalFunctionStatementSyntaxWrapper)node).Modifiers.Any(SyntaxKind.StaticKeyword);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MethodsShouldUseBaseTypes.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class MethodsShouldUseBaseTypes : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S3242\";\n        private const string MessageFormat = \"Consider using more general type '{0}' instead of '{1}'.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c => FindViolations((BaseMethodDeclarationSyntax)c.Node, c.Model).ForEach(d => c.ReportIssue(d)),\n                SyntaxKind.MethodDeclaration);\n\n        private static List<Diagnostic> FindViolations(BaseMethodDeclarationSyntax methodDeclaration, SemanticModel semanticModel)\n        {\n            if (semanticModel.GetDeclaredSymbol(methodDeclaration) is not { } methodSymbol\n                || methodSymbol.Parameters.Length == 0\n                || methodSymbol.IsOverride\n                || methodSymbol.IsVirtual\n                || methodSymbol.IsControllerActionMethod()\n                || methodSymbol.InterfaceMembers().Any()\n                || methodSymbol.IsEventHandler())\n            {\n                return Enumerable.Empty<Diagnostic>().ToList();\n            }\n\n            var methodAccessibility = methodSymbol.GetEffectiveAccessibility();\n            // The GroupBy is useless in most of the cases but safe-guard in case of 2+ parameters with same name (invalid code).\n            // In this case we analyze only the first parameter (a new analysis will be triggered after fixing the names).\n            var parametersToCheck = methodSymbol.Parameters\n                .Where(IsTrackedParameter)\n                .GroupBy(p => p.Name)\n                .ToDictionary(p => p.Key, p => new ParameterData(p.First(), methodAccessibility));\n\n            var parameterUsesInMethod = methodDeclaration\n                .DescendantNodes()\n                .OfType<IdentifierNameSyntax>()\n                .Where(id => parametersToCheck.Values.Any(p => p.MatchesIdentifier(id, semanticModel)));\n\n            foreach (var identifierReference in parameterUsesInMethod)\n            {\n                var key = identifierReference.Identifier.ValueText ?? string.Empty;\n                if (!parametersToCheck.TryGetValue(key, out var paramData) || !paramData.ShouldReportOn)\n                {\n                    continue;\n                }\n\n                if (identifierReference.Parent is EqualsValueClauseSyntax or AssignmentExpressionSyntax)\n                {\n                    paramData.ShouldReportOn = false;\n                    continue;\n                }\n\n                var symbolUsedAs = FindParameterUseAsType(identifierReference, semanticModel);\n                if (symbolUsedAs != null\n                    && !IsNestedGeneric(symbolUsedAs)) // In order to avoid triggering \"S4017: Refactor this method to remove the nested type argument.\"\n                {\n                    paramData.AddUsage(symbolUsedAs);\n                }\n            }\n\n            return parametersToCheck.Values\n                .Select(p => p.GetRuleViolation())\n                .WhereNotNull()\n                .ToList();\n        }\n\n        private static bool IsNestedGeneric(ISymbol symbol) =>\n            symbol is INamedTypeSymbol { IsGenericType: true } namedTypeSymbol\n            && namedTypeSymbol.TypeArguments.Any(argument => argument is INamedTypeSymbol { IsGenericType: true });\n\n        private static bool IsTrackedParameter(IParameterSymbol parameterSymbol)\n        {\n            var type = parameterSymbol.Type;\n\n            return !type.DerivesFrom(KnownType.System_Array)\n                   && !type.IsValueType\n                   && !type.Is(KnownType.System_String);\n        }\n\n        private static SyntaxNode GetFirstNonParenthesizedParent(SyntaxNode node) =>\n            node is ExpressionSyntax expression ? expression.GetFirstNonParenthesizedParent() : node;\n\n        private static ITypeSymbol FindParameterUseAsType(SyntaxNode identifier, SemanticModel semanticModel)\n        {\n            var callSite = semanticModel.GetEnclosingSymbol(identifier.SpanStart)?.ContainingAssembly;\n            var identifierParent = GetFirstNonParenthesizedParent(identifier);\n\n            return identifierParent switch\n                   {\n                       ConditionalAccessExpressionSyntax conditionalAccess => HandleConditionalAccess(conditionalAccess, identifier, semanticModel, callSite),\n                       MemberAccessExpressionSyntax => GetFirstNonParenthesizedParent(identifierParent) is InvocationExpressionSyntax invocationExpression\n                                                           ? HandleInvocation(identifier, semanticModel.GetSymbolInfo(invocationExpression).Symbol, semanticModel, callSite)\n                                                           : HandlePropertyOrField(identifier, semanticModel.GetSymbolInfo(identifierParent).Symbol, callSite),\n                       ArgumentSyntax => semanticModel.GetTypeInfo(identifier).ConvertedType,\n                       ElementAccessExpressionSyntax => HandlePropertyOrField(identifier, semanticModel.GetSymbolInfo(identifierParent).Symbol, callSite),\n                       _ => null\n                   };\n        }\n\n        private static ITypeSymbol HandleConditionalAccess(ConditionalAccessExpressionSyntax conditionalAccess, SyntaxNode identifier, SemanticModel semanticModel, IAssemblySymbol callSite)\n        {\n            var conditionalAccessExpression = conditionalAccess.WhenNotNull is ConditionalAccessExpressionSyntax subsequentConditionalAccess\n                ? subsequentConditionalAccess.Expression\n                : conditionalAccess.WhenNotNull;\n\n            return conditionalAccessExpression switch\n                   {\n                       MemberBindingExpressionSyntax { Name: { } } binding => HandlePropertyOrField(identifier, semanticModel.GetSymbolInfo(binding.Name).Symbol, callSite),\n                       InvocationExpressionSyntax { Expression: MemberBindingExpressionSyntax memberBinding } => HandleInvocation(identifier, semanticModel.GetSymbolInfo(memberBinding).Symbol,\n                           semanticModel, callSite),\n                       _ => null\n                   };\n        }\n\n        private static ITypeSymbol HandlePropertyOrField(SyntaxNode identifier, ISymbol symbol, IAssemblySymbol callSite)\n        {\n            if (symbol is not IPropertySymbol propertySymbol)\n            {\n                return FindOriginatingSymbol(symbol, callSite);\n            }\n\n            var parent = GetFirstNonParenthesizedParent(identifier);\n            var grandParent = GetFirstNonParenthesizedParent(parent);\n\n            var propertyAccessor = grandParent is AssignmentExpressionSyntax\n                    ? propertySymbol.SetMethod\n                    : propertySymbol.GetMethod;\n\n            return FindOriginatingSymbol(propertyAccessor, callSite);\n        }\n\n        private static ITypeSymbol HandleInvocation(SyntaxNode invokedOn, ISymbol invocationSymbol, SemanticModel semanticModel, IAssemblySymbol callSite)\n        {\n            if (invocationSymbol is not IMethodSymbol methodSymbol)\n            {\n                return null;\n            }\n\n            return methodSymbol.IsExtensionMethod\n                ? semanticModel.GetTypeInfo(invokedOn).ConvertedType\n                : FindOriginatingSymbol(invocationSymbol, callSite);\n        }\n\n        private static INamedTypeSymbol FindOriginatingSymbol(ISymbol accessedMember, ISymbol usageSite)\n        {\n            if (accessedMember == null)\n            {\n                return null;\n            }\n\n            var originatingInterface = accessedMember.InterfaceMembers().FirstOrDefault()?.ContainingType;\n            if (originatingInterface != null && IsNotInternalOrSameAssembly(originatingInterface) && !originatingInterface.Is(KnownType.System_Runtime_InteropServices_Exception))\n            {\n                return originatingInterface;\n            }\n\n            var originatingType = accessedMember.GetOverriddenMember()?.ContainingType;\n            return originatingType != null && IsNotInternalOrSameAssembly(originatingType)\n                ? originatingType\n                : accessedMember.ContainingType;\n\n            // Do not suggest internal types that are declared in an assembly different than\n            // the one that's declaring the parameter. Such types should not be suggested at\n            // all if there is no InternalsVisibleTo attribute present in the compilation.\n            // Since the check for the attribute must be done in CompilationEnd thus making\n            // the rule unusable in Visual Studio, we will not suggest such classes and will\n            // generate some False Negatives.\n            bool IsNotInternalOrSameAssembly(ISymbol namedTypeSymbol) =>\n                namedTypeSymbol.ContainingAssembly.Equals(usageSite)\n                || namedTypeSymbol.GetEffectiveAccessibility() != Accessibility.Internal;\n        }\n\n        private sealed class ParameterData\n        {\n            public bool ShouldReportOn { get; set; } = true;\n\n            private readonly IParameterSymbol parameterSymbol;\n            private readonly Accessibility methodAccessibility;\n            private readonly Dictionary<ITypeSymbol, int> usedAs = new();\n\n            public ParameterData(IParameterSymbol parameterSymbol, Accessibility methodAccessibility)\n            {\n                this.parameterSymbol = parameterSymbol;\n                this.methodAccessibility = methodAccessibility;\n            }\n\n            public void AddUsage(ITypeSymbol symbolUsedAs)\n            {\n                if (usedAs.ContainsKey(symbolUsedAs))\n                {\n                    usedAs[symbolUsedAs]++;\n                }\n                else\n                {\n                    usedAs[symbolUsedAs] = 1;\n                }\n            }\n\n            public bool MatchesIdentifier(ExpressionSyntax identifier, SemanticModel semanticModel)\n            {\n                var symbol = semanticModel.GetSymbolInfo(identifier).Symbol;\n                return Equals(parameterSymbol, symbol);\n            }\n\n            public Diagnostic GetRuleViolation()\n            {\n                if (!ShouldReportOn)\n                {\n                    return null;\n                }\n\n                var mostGeneralType = FindMostGeneralType();\n\n                return Equals(mostGeneralType, parameterSymbol.Type) || IsIgnoredBaseType(mostGeneralType.GetSymbolType())\n                    ? null\n                    : Diagnostic.Create(Rule, parameterSymbol.Locations.First(), mostGeneralType.ToDisplayString(), parameterSymbol.Type.ToDisplayString());\n            }\n\n            private static bool IsIgnoredBaseType(ITypeSymbol typeSymbol) =>\n                typeSymbol.IsAny(KnownType.System_Object, KnownType.System_ValueType, KnownType.System_Enum)\n                || typeSymbol.Name.StartsWith(\"_\", StringComparison.Ordinal)\n                || IsCollectionOfKeyValuePair(typeSymbol);\n\n            private static bool IsCollectionOfKeyValuePair(ITypeSymbol typeSymbol) =>\n                typeSymbol is INamedTypeSymbol namedType\n                && namedType.TypeArguments.FirstOrDefault() is INamedTypeSymbol firstGenericType\n                && namedType.ConstructedFrom.Is(KnownType.System_Collections_Generic_ICollection_T)\n                && firstGenericType.ConstructedFrom.Is(KnownType.System_Collections_Generic_KeyValuePair_TKey_TValue);\n\n            private ISymbol FindMostGeneralType()\n            {\n                var mostGeneralType = parameterSymbol.Type;\n\n                var multipleEnumerableCalls = usedAs.Where(HasMultipleUseOfIEnumerable).ToList();\n                foreach (var v in multipleEnumerableCalls)\n                {\n                    usedAs.Remove(v.Key);\n                }\n\n                if (usedAs.Count == 0)\n                {\n                    return mostGeneralType;\n                }\n\n                mostGeneralType = FindMostGeneralAccessibleClassOrSelf(mostGeneralType);\n                mostGeneralType = FindMostGeneralAccessibleInterfaceOrSelf(mostGeneralType);\n                return mostGeneralType;\n\n                static bool HasMultipleUseOfIEnumerable(KeyValuePair<ITypeSymbol, int> kvp) =>\n                    kvp.Value > 1\n                    && (kvp.Key.OriginalDefinition.Is(KnownType.System_Collections_Generic_IEnumerable_T) || kvp.Key.Is(KnownType.System_Collections_IEnumerable));\n\n                ITypeSymbol FindMostGeneralAccessibleClassOrSelf(ITypeSymbol typeSymbol)\n                {\n                    var currentSymbol = typeSymbol.BaseType;\n\n                    while (currentSymbol != null)\n                    {\n                        if (DerivesOrImplementsAll(currentSymbol))\n                        {\n                            typeSymbol = currentSymbol;\n                        }\n\n                        currentSymbol = currentSymbol?.BaseType;\n                    }\n\n                    return typeSymbol;\n                }\n\n                ITypeSymbol FindMostGeneralAccessibleInterfaceOrSelf(ITypeSymbol typeSymbol) =>\n                    typeSymbol.Interfaces.FirstOrDefault(DerivesOrImplementsAll) is { } @interface\n                        ? FindMostGeneralAccessibleInterfaceOrSelf(@interface)\n                        : typeSymbol;\n            }\n\n            private bool DerivesOrImplementsAll(ITypeSymbol type)\n            {\n                return usedAs.Keys.All(type.DerivesOrImplements)\n                       && IsConsistentAccessibility(type.GetEffectiveAccessibility());\n\n                bool IsConsistentAccessibility(Accessibility baseTypeAccessibility) =>\n                    methodAccessibility switch\n                    {\n                        Accessibility.Private => true,\n                        // ProtectedAndInternal corresponds to `private protected`.\n                        Accessibility.ProtectedAndInternal => baseTypeAccessibility is not Accessibility.Private,\n                        // ProtectedOrInternal corresponds to `protected internal`.\n                        Accessibility.ProtectedOrInternal => baseTypeAccessibility is Accessibility.Public or Accessibility.Internal or Accessibility.ProtectedOrInternal,\n                        Accessibility.Protected => baseTypeAccessibility == Accessibility.Public || baseTypeAccessibility == methodAccessibility,\n                        Accessibility.Internal => baseTypeAccessibility == Accessibility.Public || baseTypeAccessibility == methodAccessibility,\n                        Accessibility.Public => baseTypeAccessibility == Accessibility.Public,\n                        _ => false\n                    };\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MultilineBlocksWithoutBrace.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class MultilineBlocksWithoutBrace : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S2681\";\n    private const string MessageFormat = \"This line will not be executed {0}; only the first line of this {2}-line block will be. The rest will execute {1}.\";\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(\n            c => CheckLoop(c, ((WhileStatementSyntax)c.Node).Statement),\n            SyntaxKind.WhileStatement);\n\n        context.RegisterNodeAction(\n            c => CheckLoop(c, ((ForStatementSyntax)c.Node).Statement),\n            SyntaxKind.ForStatement);\n\n        context.RegisterNodeAction(\n            c => CheckLoop(c, ((ForEachStatementSyntax)c.Node).Statement),\n            SyntaxKind.ForEachStatement);\n\n        context.RegisterNodeAction(\n            c => CheckIf(c, (IfStatementSyntax)c.Node),\n            SyntaxKind.IfStatement);\n    }\n\n    private static void CheckLoop(SonarSyntaxNodeReportingContext context, StatementSyntax statement)\n    {\n        if (!IsNestedStatement(statement))\n        {\n            CheckStatement(context, statement, \"in a loop\", \"only once\");\n        }\n    }\n\n    private static void CheckIf(SonarSyntaxNodeReportingContext context, IfStatementSyntax ifStatement)\n    {\n        if (!ifStatement.PrecedingIfsInConditionChain().Any()\n            && !IsNestedStatement(ifStatement.Statement)\n            && LastStatementInIfChain(ifStatement) is { } lastStatementInIfChain\n            && !IsStatementCandidateLoop(lastStatementInIfChain))\n        {\n            CheckStatement(context, lastStatementInIfChain, \"conditionally\", \"unconditionally\");\n        }\n    }\n\n    private static StatementSyntax LastStatementInIfChain(IfStatementSyntax ifStatement)\n    {\n        var statement = ifStatement.Statement;\n\n        while (ifStatement is { })\n        {\n            if (ifStatement.Else is null)\n            {\n                return ifStatement.Statement;\n            }\n            statement = ifStatement.Else.Statement;\n            ifStatement = statement as IfStatementSyntax;\n        }\n        return statement;\n    }\n\n    private static void CheckStatement(SonarSyntaxNodeReportingContext context, StatementSyntax first, string executed, string execute)\n    {\n        if (IsNotEmpty(first)\n            && SecondStatement(context.Node, first) is { } second\n            && IsNotEmpty(second)\n            && MisleadingtIndenting(first, second))\n        {\n            var secondLine = StartPosition(second).Line;\n            var lineSpan = context.Node.SyntaxTree.GetText().Lines[secondLine].Span;\n            var location = Location.Create(context.Node.SyntaxTree, TextSpan.FromBounds(second.SpanStart, lineSpan.End));\n            var blockSize = secondLine - StartPosition(first).Line + 1;\n            context.ReportIssue(Rule, location, [first.ToSecondaryLocation()], executed, execute, blockSize.ToString());\n        }\n    }\n\n    private static bool IsNotEmpty(SyntaxNode node) =>\n        node is not EmptyStatementSyntax;\n\n    private static bool MisleadingtIndenting(SyntaxNode first, SyntaxNode second)\n    {\n        var firstPosition = StartPosition(first);\n        var secondPosition = StartPosition(second);\n        var ancestor = first.AncestorsAndSelf().Select(x => StartPosition(x)).Last(x => x.Line == firstPosition.Line);\n\n        // If the first node is not at the same line as its parent\n        return firstPosition.Character == ancestor.Character\n            ? secondPosition.Character >= firstPosition.Character\n            : secondPosition.Character > ancestor.Character;\n    }\n\n    private static LinePosition StartPosition(SyntaxNode node) =>\n        node.GetLocation().GetLineSpan().StartLinePosition;\n\n    private static SyntaxNode SecondStatement(SyntaxNode root, SyntaxNode first) =>\n        !first.IsKind(SyntaxKind.Block)\n        // This algorithm to get the next statement can sometimes return a parent statement (for example a BlockSyntax)\n        // so we need to filter this case by returning if the nextStatement happens to be one ancestor of statement.\n        && root.GetLastToken().GetNextToken().Parent is { } second\n        && !first.Ancestors().Contains(second)\n        && second is not ElseClauseSyntax\n        ? second\n        : null;\n\n    private static bool IsNestedStatement(StatementSyntax statement) =>\n        statement?.Kind() is SyntaxKind.IfStatement or SyntaxKind.ForStatement or SyntaxKind.ForEachStatement or SyntaxKind.WhileStatement;\n\n    private static bool IsStatementCandidateLoop(StatementSyntax statement) =>\n        statement?.Kind() is SyntaxKind.ForEachStatement or SyntaxKind.ForStatement or SyntaxKind.WhileStatement;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MultipleVariableDeclaration.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class MultipleVariableDeclaration : MultipleVariableDeclarationBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language { get; } = CSharpFacade.Instance;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MultipleVariableDeclarationCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[ExportCodeFixProvider(LanguageNames.CSharp)]\npublic class MultipleVariableDeclarationCodeFix : MultipleVariableDeclarationCodeFixBase\n{\n    protected override SyntaxNode CalculateNewRoot(SyntaxNode root, SyntaxNode node) =>\n        node is VariableDeclaratorSyntax { Parent: VariableDeclarationSyntax declaration }\n            ? root.ReplaceNode(declaration.Parent, CreateNewNodes(declaration))\n            : root;\n\n    private static IEnumerable<SyntaxNode> CreateNewNodes(VariableDeclarationSyntax declaration)\n    {\n        var newDeclarations = declaration.Variables.Select(x => CreateNewDeclaration(x, declaration));\n        return declaration.Parent switch\n               {\n                   FieldDeclarationSyntax fieldDeclaration => newDeclarations.Select(x => SyntaxFactory.FieldDeclaration(fieldDeclaration.AttributeLists, fieldDeclaration.Modifiers, x)),\n                   LocalDeclarationStatementSyntax localDeclaration => newDeclarations.Select(x => SyntaxFactory.LocalDeclarationStatement(localDeclaration.Modifiers, x)),\n                   _ => new[] { declaration.Parent }\n               };\n    }\n\n    private static VariableDeclarationSyntax CreateNewDeclaration(VariableDeclaratorSyntax variable, VariableDeclarationSyntax declaration) =>\n        SyntaxFactory.VariableDeclaration(\n            declaration.Type.WithoutTrailingTrivia(),\n            SyntaxFactory.SeparatedList(new[] { variable.WithLeadingTrivia(GetLeadingTriviaFor(variable)) }));\n\n    private static IEnumerable<SyntaxTrivia> GetLeadingTriviaFor(VariableDeclaratorSyntax variable) =>\n        variable.GetFirstToken().GetPreviousToken().TrailingTrivia.Concat(variable.GetLeadingTrivia());\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MutableFieldsShouldNotBe.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\npublic abstract class MutableFieldsShouldNotBe : SonarDiagnosticAnalyzer\n{\n    private static readonly ImmutableArray<KnownType> MutableBaseTypes =\n        ImmutableArray.Create(\n            KnownType.System_Collections_Generic_ICollection_T,\n            KnownType.System_Array);\n\n    private static readonly ImmutableArray<KnownType> ImmutableBaseTypes =\n        ImmutableArray.Create(\n            KnownType.System_Collections_ObjectModel_ReadOnlyCollection_T,\n            KnownType.System_Collections_ObjectModel_ReadOnlyDictionary_TKey_TValue,\n            KnownType.System_Collections_ObjectModel_ReadOnlySet_T,\n            KnownType.System_Collections_Frozen_FrozenDictionary_TKey_TValue,\n            KnownType.System_Collections_Frozen_FrozenSet_T,\n            KnownType.System_Collections_Immutable_ImmutableArray_T,\n            KnownType.System_Collections_Immutable_IImmutableDictionary_TKey_TValue,\n            KnownType.System_Collections_Immutable_IImmutableList_T,\n            KnownType.System_Collections_Immutable_IImmutableSet_T,\n            KnownType.System_Collections_Immutable_IImmutableStack_T,\n            KnownType.System_Collections_Immutable_IImmutableQueue_T);\n\n    private readonly DiagnosticDescriptor rule;\n\n    protected abstract ISet<SyntaxKind> InvalidModifiers { get; }\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(rule);\n\n    protected MutableFieldsShouldNotBe(string diagnosticId, string messageFormat) =>\n         rule = DescriptorFactory.Create(diagnosticId, messageFormat);\n\n    protected sealed override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n        {\n            if (c.IsRedundantPositionalRecordContext())\n            {\n                return;\n            }\n            var typeDeclaration = (TypeDeclarationSyntax)c.Node;\n            var fieldDeclarations = typeDeclaration.Members.OfType<FieldDeclarationSyntax>();\n            var assignmentsImmutability = FieldAssignmentImmutability(typeDeclaration, fieldDeclarations, c.Model);\n\n            foreach (var fieldDeclaration in fieldDeclarations)\n            {\n                if (HasAllInvalidModifiers(fieldDeclaration)\n                    && fieldDeclaration.Declaration.Variables.Count > 0\n                    && c.Model.GetDeclaredSymbol(fieldDeclaration.Declaration.Variables[0]) is IFieldSymbol { Type: not null } fieldSymbol\n                    && fieldSymbol.GetEffectiveAccessibility() == Accessibility.Public\n                    && !IsImmutableOrValidMutableType(fieldSymbol.Type)\n                    // The field seems to be violating the rule but we should exclude the cases where the field is read-only\n                    // and all initializations to this field are immutable\n                    && CollectInvalidFieldVariables(fieldDeclaration, assignmentsImmutability, c.Model).ToList() is { Count: > 0 } incorrectFieldVariables)\n                {\n                    var pluralizeSuffix = incorrectFieldVariables.Count > 1 ? \"s\" : string.Empty;\n                    c.ReportIssue(rule, fieldDeclaration.Declaration.Type, pluralizeSuffix, incorrectFieldVariables.ToSentence(quoteWords: true));\n                }\n            }\n        },\n        SyntaxKind.ClassDeclaration, SyntaxKind.StructDeclaration, SyntaxKindEx.RecordDeclaration, SyntaxKindEx.RecordStructDeclaration);\n\n    private bool HasAllInvalidModifiers(FieldDeclarationSyntax fieldDeclaration) =>\n        fieldDeclaration.Modifiers.Count(m => InvalidModifiers.Contains(m.Kind())) == InvalidModifiers.Count;\n\n    private static Dictionary<string, bool?> FieldAssignmentImmutability(TypeDeclarationSyntax typeDeclaration, IEnumerable<FieldDeclarationSyntax> fieldDeclarations, SemanticModel semanticModel)\n    {\n        var variableNames = fieldDeclarations.SelectMany(x => x.Declaration.Variables)\n            .Select(x => x.Identifier.ValueText)\n            .ToHashSet();\n\n        var ctorAssignments = typeDeclaration.Members.OfType<ConstructorDeclarationSyntax>()\n            .SelectMany(x => x.DescendantNodes())\n            .OfType<AssignmentExpressionSyntax>();\n\n        var variableToImmutability = variableNames.ToDictionary(x => x, x => (bool?)null);\n\n        foreach (var assignment in ctorAssignments)\n        {\n            if (assignment.Left is not IdentifierNameSyntax identifierName\n                || !variableNames.Contains(identifierName.Identifier.ValueText)\n                || variableToImmutability[identifierName.Identifier.ValueText] == false)\n            {\n                continue;\n            }\n\n            variableToImmutability[identifierName.Identifier.ValueText] = IsImmutableOrValidMutableType(semanticModel.GetTypeInfo(assignment.Right).Type, assignment.Right);\n        }\n\n        return variableToImmutability;\n    }\n\n    private static IEnumerable<string> CollectInvalidFieldVariables(FieldDeclarationSyntax fieldDeclaration, Dictionary<string, bool?> assignmentsInCtors, SemanticModel semanticModel) =>\n        fieldDeclaration.Modifiers.Any(SyntaxKind.ReadOnlyKeyword)\n        ? CollectReadonlyInvalidFieldVariables(fieldDeclaration, assignmentsInCtors, semanticModel)\n        : fieldDeclaration.Declaration.Variables.Select(x => x.Identifier.ValueText);\n\n    private static IEnumerable<string> CollectReadonlyInvalidFieldVariables(FieldDeclarationSyntax fieldDeclaration, Dictionary<string, bool?> assignmentsInCtors, SemanticModel semanticModel)\n    {\n        foreach (var variable in fieldDeclaration.Declaration.Variables)\n        {\n            var onlyInitializedWithImmutablesInCtor = assignmentsInCtors[variable.Identifier.ValueText];\n\n            if (onlyInitializedWithImmutablesInCtor == false)\n            {\n                yield return variable.Identifier.ValueText;\n            }\n\n            if (variable.Initializer is null\n                || semanticModel.GetSymbolInfo(variable.Initializer.Value).Symbol is not IMethodSymbol methodSymbol)\n            {\n                continue;\n            }\n\n            var typeSymbol = methodSymbol.MethodKind == MethodKind.Constructor\n                ? methodSymbol.ContainingType\n                : methodSymbol.ReturnType;\n\n            if (!IsImmutableOrValidMutableType(typeSymbol, variable.Initializer.Value))\n            {\n                yield return variable.Identifier.ValueText;\n            }\n        }\n    }\n\n    private static bool IsImmutableOrValidMutableType(ITypeSymbol typeSymbol, ExpressionSyntax value = null)\n    {\n        if (value.IsNullLiteral())\n        {\n            return true;\n        }\n\n        if (typeSymbol is INamedTypeSymbol namedTypeSymbol)\n        {\n            typeSymbol = namedTypeSymbol.ConstructedFrom;\n        }\n\n        return !typeSymbol.DerivesOrImplementsAny(MutableBaseTypes)\n               || typeSymbol.DerivesOrImplementsAny(ImmutableBaseTypes);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MutableFieldsShouldNotBePublicReadonly.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class MutableFieldsShouldNotBePublicReadonly : MutableFieldsShouldNotBe\n{\n    private const string DiagnosticId = \"S3887\";\n    private const string MessageFormat = \"Use an immutable collection or reduce the accessibility of the non-private readonly field{0} {1}.\";\n\n    protected override ISet<SyntaxKind> InvalidModifiers { get; } = new HashSet<SyntaxKind>\n    {\n        SyntaxKind.PublicKeyword,\n        SyntaxKind.ReadOnlyKeyword\n    };\n\n    public MutableFieldsShouldNotBePublicReadonly() : base(DiagnosticId, MessageFormat) { }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/MutableFieldsShouldNotBePublicStatic.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class MutableFieldsShouldNotBePublicStatic : MutableFieldsShouldNotBe\n{\n    private const string DiagnosticId = \"S2386\";\n    private const string MessageFormat = \"Use an immutable collection or reduce the accessibility of the public static field{0} {1}.\";\n\n    protected override ISet<SyntaxKind> InvalidModifiers { get; } = new HashSet<SyntaxKind>\n    {\n        SyntaxKind.PublicKeyword,\n        SyntaxKind.StaticKeyword\n    };\n\n    public MutableFieldsShouldNotBePublicStatic() : base(DiagnosticId, MessageFormat) { }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/NameOfShouldBeUsed.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class NameOfShouldBeUsed : NameOfShouldBeUsedBase<BaseMethodDeclarationSyntax, SyntaxKind, ThrowStatementSyntax>\n    {\n        private static readonly HashSet<SyntaxKind> StringTokenTypes = new HashSet<SyntaxKind>\n        {\n            SyntaxKind.InterpolatedStringTextToken,\n            SyntaxKind.StringLiteralToken,\n            SyntaxKindEx.SingleLineRawStringLiteralToken,\n            SyntaxKindEx.MultiLineRawStringLiteralToken\n        };\n\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n        protected override string NameOf => \"nameof\";\n\n        protected override BaseMethodDeclarationSyntax MethodSyntax(SyntaxNode node) =>\n             (BaseMethodDeclarationSyntax)node;\n\n        protected override bool IsStringLiteral(SyntaxToken t) =>\n            t.IsAnyKind(StringTokenTypes);\n\n        protected override IEnumerable<string> GetParameterNames(BaseMethodDeclarationSyntax method)\n        {\n            var paramGroups = method.ParameterList?.Parameters.GroupBy(p => p.Identifier.ValueText);\n            return paramGroups == null || paramGroups.Any(g => g.Count() != 1)\n                ? Enumerable.Empty<string>()\n                : paramGroups.Select(g => g.First().Identifier.ValueText);\n        }\n\n        protected override bool LeastLanguageVersionMatches(SonarSyntaxNodeReportingContext context) =>\n            context.Compilation.IsAtLeastLanguageVersion(LanguageVersion.CSharp6);\n\n        protected override bool IsArgumentExceptionCallingNameOf(SyntaxNode node, IEnumerable<string> arguments) =>\n            ((ThrowStatementSyntax)node).Expression is ObjectCreationExpressionSyntax objectCreation\n            && ArgumentExceptionNameOfPosition(objectCreation.Type.ToString()) is var idx\n            && objectCreation.ArgumentList?.Arguments is { } creationArguments\n            && creationArguments.Count >= idx + 1\n            && creationArguments[idx].Expression is InvocationExpressionSyntax invocation\n            && invocation.Expression.ToString() == \"nameof\"\n            && invocation.ArgumentList.Arguments.Count == 1\n            && arguments.Contains(invocation.ArgumentList.Arguments[0].Expression.ToString());\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/NativeMethodsShouldBeWrapped.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class NativeMethodsShouldBeWrapped : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S4200\";\n        private const string MessageFormat = \"{0}\";\n        private const string MakeThisMethodPrivateMessage = \"Make this native method private and provide a wrapper.\";\n        private const string MakeThisWrapperLessTrivialMessage = \"Make this wrapper for native method '{0}' less trivial.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterSymbolAction(ReportPublicExternalMethods, SymbolKind.Method);\n            context.RegisterNodeAction(ReportTrivialWrappers, SyntaxKind.MethodDeclaration);\n        }\n\n        private static void ReportPublicExternalMethods(SonarSymbolReportingContext c)\n        {\n            var methodSymbol = (IMethodSymbol)c.Symbol;\n            if (IsExternMethod(methodSymbol)\n                && methodSymbol.IsPubliclyAccessible())\n            {\n                foreach (var methodDeclaration in methodSymbol.DeclaringSyntaxReferences\n                    .Where(x => !x.SyntaxTree.IsConsideredGenerated(CSharpGeneratedCodeRecognizer.Instance, c.IsRazorAnalysisEnabled()))\n                    .Select(x => x.GetSyntax())\n                    .OfType<MethodDeclarationSyntax>())\n                {\n                    c.ReportIssue(Rule, methodDeclaration.Identifier, MakeThisMethodPrivateMessage);\n                }\n            }\n        }\n\n        private static bool IsExternMethod(IMethodSymbol methodSymbol) =>\n            methodSymbol.IsExtern || methodSymbol.HasAttribute(KnownType.System_Runtime_InteropServices_LibraryImportAttribute);\n\n        private static void ReportTrivialWrappers(SonarSyntaxNodeReportingContext c)\n        {\n            var methodDeclaration = (MethodDeclarationSyntax)c.Node;\n\n            if (methodDeclaration.ParameterList.Parameters.Count == 0)\n            {\n                return;\n            }\n\n            var descendants = GetBodyDescendants(methodDeclaration);\n\n            if (HasAtLeastTwo(descendants.OfType<StatementSyntax>())\n                || HasAtLeastTwo(descendants.OfType<InvocationExpressionSyntax>()))\n            {\n                return;\n            }\n\n            var methodSymbol = c.Model.GetDeclaredSymbol(methodDeclaration);\n            if (methodSymbol == null\n                || (methodSymbol.IsExtern && methodDeclaration.ParameterList == null))\n            {\n                return;\n            }\n\n            var externalMethodSymbols = GetExternalMethods(methodSymbol);\n\n            descendants.OfType<InvocationExpressionSyntax>()\n                .Where(ParametersMatchContainingMethodDeclaration)\n                .Select(i => c.Model.GetSymbolInfo(i).Symbol)\n                .OfType<IMethodSymbol>()\n                .Where(externalMethodSymbols.Contains)\n                .ToList()\n                .ForEach(Report);\n\n            void Report(IMethodSymbol externMethod) =>\n                c.ReportIssue(Rule, methodDeclaration.Identifier, string.Format(MakeThisWrapperLessTrivialMessage, externMethod.Name));\n\n            bool ParametersMatchContainingMethodDeclaration(InvocationExpressionSyntax invocation) =>\n                invocation.ArgumentList.Arguments.All(IsDeclaredParameterOrLiteral);\n\n            bool IsDeclaredParameterOrLiteral(ArgumentSyntax a) =>\n                a.Expression is LiteralExpressionSyntax\n                || (a.Expression is IdentifierNameSyntax i\n                    && methodDeclaration.ParameterList.Parameters.Any(p => p.Identifier.Text == i.Identifier.Text));\n        }\n\n        private static ISet<IMethodSymbol> GetExternalMethods(IMethodSymbol methodSymbol) =>\n            methodSymbol.ContainingType.GetMembers()\n                .OfType<IMethodSymbol>()\n                .Where(IsExternMethod)\n                .ToHashSet();\n\n        private static IEnumerable<SyntaxNode> GetBodyDescendants(MethodDeclarationSyntax methodDeclaration) =>\n            methodDeclaration.Body?.DescendantNodes()\n            ?? methodDeclaration.ExpressionBody?.DescendantNodes()\n            ?? Enumerable.Empty<SyntaxNode>();\n\n        private static bool HasAtLeastTwo<T>(IEnumerable<T> collection) =>\n            collection.Take(2).Count() == 2;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/NestedCodeBlock.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class NestedCodeBlock : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S1199\";\n        private const string MessageFormat = \"Extract this nested code block into a separate method.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n                {\n                    var block = (BlockSyntax)c.Node;\n                    if (block.Parent?.Kind() is SyntaxKind.Block or SyntaxKind.GlobalStatement)\n                    {\n                        c.ReportIssue(Rule, block.OpenBraceToken);\n                    }\n                },\n                SyntaxKind.Block);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/NoExceptionsInFinally.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class NoExceptionsInFinally : NoExceptionsInFinallyBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c => new ThrowInFinallyWalker(c, Rule).SafeVisit(((FinallyClauseSyntax)c.Node).Block),\n                SyntaxKind.FinallyClause);\n\n        private sealed class ThrowInFinallyWalker : SafeCSharpSyntaxWalker\n        {\n            private readonly SonarSyntaxNodeReportingContext context;\n            private readonly DiagnosticDescriptor rule;\n\n            public ThrowInFinallyWalker(SonarSyntaxNodeReportingContext context, DiagnosticDescriptor rule)\n            {\n                this.context = context;\n                this.rule = rule;\n            }\n\n            public override void VisitThrowStatement(ThrowStatementSyntax node) =>\n                context.ReportIssue(rule, node);\n\n            public override void VisitFinallyClause(FinallyClauseSyntax node)\n            {\n                // Do not call base to force the walker to stop. Another walker will take care of this finally clause.\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/NonAsyncTaskShouldNotReturnNull.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class NonAsyncTaskShouldNotReturnNull : NonAsyncTaskShouldNotReturnNullBase\n    {\n        private const string MessageFormat = \"Do not return null from this method, instead return 'Task.FromResult<T>(null)', \" +\n            \"'Task.CompletedTask' or 'Task.Delay(0)'.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        private static readonly ISet<SyntaxKind> TrackedNullLiteralLocations =\n            new HashSet<SyntaxKind>\n            {\n                SyntaxKind.ArrowExpressionClause,\n                SyntaxKind.ReturnStatement\n            };\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var nullLiteral = (LiteralExpressionSyntax)c.Node;\n\n                    if (!nullLiteral.GetFirstNonParenthesizedParent().IsAnyKind(TrackedNullLiteralLocations))\n                    {\n                        return;\n                    }\n\n                    var enclosingMember = GetEnclosingMember(nullLiteral);\n                    if (enclosingMember != null &&\n                        !enclosingMember.IsKind(SyntaxKind.VariableDeclaration) &&\n                        IsInvalidEnclosingSymbolContext(enclosingMember, c.Model))\n                    {\n                        c.ReportIssue(rule, nullLiteral);\n                    }\n                },\n                SyntaxKind.NullLiteralExpression);\n        }\n\n        private static SyntaxNode GetEnclosingMember(LiteralExpressionSyntax literal)\n        {\n            foreach (var ancestor in literal.Ancestors())\n            {\n                switch (ancestor.Kind())\n                {\n                    case SyntaxKind.ParenthesizedLambdaExpression:\n                    case SyntaxKind.SimpleLambdaExpression:\n                    case SyntaxKind.VariableDeclaration:\n                    case SyntaxKind.PropertyDeclaration:\n                    case SyntaxKind.MethodDeclaration:\n                    case SyntaxKindEx.LocalFunctionStatement:\n                        return ancestor;\n                }\n            }\n\n            return null;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/NonDerivedPrivateClassesShouldBeSealed.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class NonDerivedPrivateClassesShouldBeSealed : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S3260\";\n        private const string MessageFormat = \"{0} {1} which are not derived in the current {2} should be marked as 'sealed'.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n        private static readonly ImmutableHashSet<SyntaxKind> KindsToBeDescended = ImmutableHashSet.Create(\n            SyntaxKind.CompilationUnit,\n            SyntaxKind.NamespaceDeclaration,\n            SyntaxKindEx.FileScopedNamespaceDeclaration,\n            SyntaxKind.InterfaceDeclaration,\n            SyntaxKind.ClassDeclaration,\n            SyntaxKind.StructDeclaration,\n            SyntaxKindEx.RecordDeclaration,\n            SyntaxKindEx.RecordStructDeclaration);\n\n        private static readonly ImmutableHashSet<SyntaxKind> PossiblyVirtualKinds = ImmutableHashSet.Create(\n            SyntaxKind.MethodDeclaration,\n            SyntaxKind.PropertyDeclaration,\n            SyntaxKind.EventDeclaration,\n            SyntaxKind.IndexerDeclaration);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterTreeAction(c =>\n            {\n                var declarations = c.Tree.GetRoot()\n                     .DescendantNodes(x => x.IsAnyKind(KindsToBeDescended))\n                     .Where(x => x.Kind() is SyntaxKind.ClassDeclaration or SyntaxKindEx.RecordDeclaration)\n                     .Select(x => (TypeDeclarationSyntax)x);\n\n                var model = new Lazy<SemanticModel>(() => c.Compilation.GetSemanticModel(c.Tree));\n                var symbols = new Lazy<List<INamedTypeSymbol>>(() => declarations.Select(x => model.Value.GetDeclaredSymbol(x)).ToList());\n\n                foreach (var declaration in declarations)\n                {\n                    if (!IsSealed(declaration)\n                        && !HasVirtualMembers(declaration)\n                        && !IsPossiblyDerived(declaration, model, symbols, out var modifier, out var inheritanceScope))\n                    {\n                        var type = declaration.IsKind(SyntaxKind.ClassDeclaration) ? \"classes\" : \"record classes\";\n                        c.ReportIssue(Rule, declaration.Identifier, modifier, type, inheritanceScope);\n                    }\n                }\n            });\n\n        private static bool HasVirtualMembers(TypeDeclarationSyntax typeDeclaration) =>\n            typeDeclaration.Members\n                .Where(member => member.IsAnyKind(PossiblyVirtualKinds))\n                .Any(member => member.Modifiers.Any(SyntaxKind.VirtualKeyword));\n\n        private static bool IsSealed(TypeDeclarationSyntax typeDeclaration) =>\n            typeDeclaration.Modifiers.Any(SyntaxKind.SealedKeyword)\n            || typeDeclaration.Modifiers.Any(SyntaxKind.StaticKeyword)\n            || typeDeclaration.Modifiers.Any(SyntaxKind.AbstractKeyword);\n\n        private static bool IsPossiblyDerived(\n            TypeDeclarationSyntax declaration,\n            Lazy<SemanticModel> model,\n            Lazy<List<INamedTypeSymbol>> otherSymbols,\n            out string modifierDescription,\n            out string scopeDescription)\n        {\n            if (declaration.Modifiers.Any(SyntaxKind.PrivateKeyword))\n            {\n                modifierDescription = \"Private\";\n                scopeDescription = \"assembly\";\n                var symbol = model.Value.GetDeclaredSymbol(declaration);\n                return symbol.ContainingType.GetAllNamedTypes().Any(other =>\n                    !other.MetadataName.Equals(symbol.MetadataName)\n                    && other.DerivesFrom(symbol));\n            }\n            if (declaration.Modifiers.Any(SyntaxKindEx.FileKeyword))\n            {\n                modifierDescription = \"File-scoped\";\n                scopeDescription = \"file\";\n                var symbol = model.Value.GetDeclaredSymbol(declaration);\n                return otherSymbols.Value.Exists(other =>\n                    !other.MetadataName.Equals(symbol.MetadataName)\n                    && other.DerivesFrom(symbol));\n            }\n\n            modifierDescription = scopeDescription =  string.Empty;\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/NonFlagsEnumInBitwiseOperation.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class NonFlagsEnumInBitwiseOperation : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S3265\";\n\n        private const string MessageFormat = \"{0}\";\n        private const string MessageRemove = \"Remove this bitwise operation; the enum '{0}' is not marked with 'Flags' attribute.\";\n        private const string MessageChangeOrRemove = \"Mark enum '{0}' with 'Flags' attribute or remove this bitwise operation.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c => CheckExpressionWithOperator<BinaryExpressionSyntax>(c, b => b.OperatorToken),\n                SyntaxKind.BitwiseOrExpression,\n                SyntaxKind.BitwiseAndExpression,\n                SyntaxKind.ExclusiveOrExpression);\n\n            context.RegisterNodeAction(\n                c => CheckExpressionWithOperator<AssignmentExpressionSyntax>(c, a => a.OperatorToken),\n                SyntaxKind.AndAssignmentExpression,\n                SyntaxKind.OrAssignmentExpression,\n                SyntaxKind.ExclusiveOrAssignmentExpression);\n        }\n\n        private static void CheckExpressionWithOperator<T>(SonarSyntaxNodeReportingContext context, Func<T, SyntaxToken> operatorSelector)\n            where T : SyntaxNode\n        {\n            if (context.Model.GetSymbolInfo(context.Node).Symbol is not IMethodSymbol { MethodKind: MethodKind.BuiltinOperator, ReturnType.TypeKind: TypeKind.Enum } operation\n                || operation.ReturnType.HasAttribute(KnownType.System_FlagsAttribute)\n                || IsIgnored(operation.ReturnType))\n            {\n                return;\n            }\n\n            var friendlyTypeName = operation.ReturnType.ToMinimalDisplayString(context.Model, context.Node.SpanStart);\n            var messageFormat = operation.ReturnType.DeclaringSyntaxReferences.Any()\n                ? MessageChangeOrRemove\n                : MessageRemove;\n\n            var message = string.Format(messageFormat, friendlyTypeName);\n\n            var op = operatorSelector((T)context.Node);\n            context.ReportIssue(Rule, op, message);\n        }\n\n        private static bool IsIgnored(ITypeSymbol enumType) => // https://stackoverflow.com/questions/38689649/why-is-methodimplattributes-not-marked-with-flagsattribute#comment64809864_38689649\n            enumType.Is(KnownType.System_Reflection_MethodImplAttributes);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/NonFlagsEnumInBitwiseOperationCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class NonFlagsEnumInBitwiseOperationCodeFix : SonarCodeFix\n    {\n        private const string Title = \"Add [Flags] to enum declaration\";\n\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(NonFlagsEnumInBitwiseOperation.DiagnosticId);\n\n        protected override async Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            var node = root.FindNode(diagnosticSpan, getInnermostNodeForTie: true);\n\n            var semanticModel = await context.Document.GetSemanticModelAsync(context.Cancel).ConfigureAwait(false);\n            var operation = semanticModel.GetSymbolInfo(node).Symbol as IMethodSymbol;\n\n            if (!(operation?.ReturnType?.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax(context.Cancel) is EnumDeclarationSyntax enumDeclaration))\n            {\n                return;\n            }\n\n            if (enumDeclaration.AttributeLists.GetAttributes(KnownType.System_FlagsAttribute, semanticModel).Any()) // FixAllProvider already added it from another issue\n            {\n                return;\n            }\n\n            var flagsAttributeType = semanticModel.Compilation.GetTypeByMetadataName(KnownType.System_FlagsAttribute);\n            if (flagsAttributeType == null)\n            {\n                return;\n            }\n\n            var currentSolution = context.Document.Project.Solution;\n            var documentId = currentSolution.GetDocumentId(enumDeclaration.SyntaxTree);\n\n            if (documentId == null)\n            {\n                return;\n            }\n\n            context.RegisterCodeFix(\n                Title,\n                async c =>\n                {\n                    var enumDeclarationRoot = await currentSolution.GetDocument(documentId).GetSyntaxRootAsync(c).ConfigureAwait(false);\n\n                    var flagsAttributeName = flagsAttributeType.ToMinimalDisplayString(semanticModel, enumDeclaration.SpanStart);\n                    flagsAttributeName = flagsAttributeName.Remove(flagsAttributeName.IndexOf(\"Attribute\", System.StringComparison.Ordinal));\n\n                    var attributes = enumDeclaration.AttributeLists.Add(\n                        SyntaxFactory.AttributeList(SyntaxFactory.SeparatedList(new[] {\n                            SyntaxFactory.Attribute(SyntaxFactory.ParseName(flagsAttributeName)) })));\n\n                    var newDeclaration = enumDeclaration.WithAttributeLists(attributes);\n                    var newRoot = enumDeclarationRoot.ReplaceNode(\n                        enumDeclaration,\n                        newDeclaration);\n                    return currentSolution.WithDocumentSyntaxRoot(documentId, newRoot);\n                },\n                context.Diagnostics);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/NormalizeStringsToUppercase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class NormalizeStringsToUppercase : DoNotCallMethodsCSharpBase\n    {\n        private const string DiagnosticId = \"S4040\";\n\n        protected override string MessageFormat => \"Change this normalization to 'ToUpperInvariant()'.\";\n\n        protected override IEnumerable<MemberDescriptor> CheckedMethods { get; } = new List<MemberDescriptor>\n        {\n            new(KnownType.System_Char, \"ToLower\"),\n            new(KnownType.System_String, \"ToLower\"),\n            new(KnownType.System_Char, \"ToLowerInvariant\"),\n            new(KnownType.System_String, \"ToLowerInvariant\"),\n        };\n\n        public NormalizeStringsToUppercase() : base(DiagnosticId) { }\n\n        protected override bool ShouldReportOnMethodCall(InvocationExpressionSyntax invocation, SemanticModel semanticModel, MemberDescriptor memberDescriptor)\n        {\n            var identifier = invocation.GetMethodCallIdentifier().Value.ValueText; // never null when we get here\n            if (identifier == \"ToLowerInvariant\")\n            {\n                return true;\n            }\n\n            // ToLower and ToLowerInvariant are extension methods for string but not for char\n            var isExtensionMethod = memberDescriptor.ContainingType == KnownType.System_String;\n\n            return invocation.ArgumentList != null\n                && invocation.ArgumentList.Arguments.Count == (isExtensionMethod ? 1 : 2)\n                && invocation.ArgumentList.Arguments[isExtensionMethod ? 0 : 1].Expression.ToString() == \"CultureInfo.InvariantCulture\";\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/NotAssignedPrivateMember.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing MemberUsage = SonarAnalyzer.Core.Common.NodeSymbolAndModel<Microsoft.CodeAnalysis.CSharp.Syntax.SimpleNameSyntax, Microsoft.CodeAnalysis.ISymbol>;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class NotAssignedPrivateMember : SonarDiagnosticAnalyzer\n{\n    /*\n     CS0649 reports the same on internal fields. So that's wider in scope, but that's not a live Roslyn analyzer,\n     the issue only shows up at build time and not during editing.\n    */\n\n    private const string DiagnosticId = \"S3459\";\n    private const string MessageFormat = \"Remove unassigned {0} '{1}', or set its value.\";\n    private const Accessibility MaxAccessibility = Accessibility.Private;\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    private static readonly HashSet<SyntaxKind> PreOrPostfixOpSyntaxKinds =\n    [\n        SyntaxKind.PostDecrementExpression,\n        SyntaxKind.PostIncrementExpression,\n        SyntaxKind.PreDecrementExpression,\n        SyntaxKind.PreIncrementExpression,\n    ];\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterSymbolAction(\n            c =>\n            {\n                var namedType = (INamedTypeSymbol)c.Symbol;\n                if (TypeDefinitionShouldBeAnalyzed(namedType))\n                {\n                    var removableDeclarationCollector = new CSharpRemovableDeclarationCollector(namedType, c.Compilation);\n                    var allCandidateMembers = CandidateDeclarations(removableDeclarationCollector);\n                    if (allCandidateMembers.Any())\n                    {\n                        var usedMembers = MemberUsages(removableDeclarationCollector, allCandidateMembers.Select(t => t.Symbol).ToHashSet());\n                        var usedMemberSymbols = usedMembers.Select(x => x.Symbol).ToHashSet();\n                        var unassignedUsedMemberSymbols = allCandidateMembers.Where(x => usedMemberSymbols.Contains(x.Symbol) && !AssignedMemberSymbols(usedMembers).Contains(x.Symbol));\n                        foreach (var candidateMember in unassignedUsedMemberSymbols)\n                        {\n                            c.ReportIssue(\n                                Rule,\n                                candidateMember.Node.GetIdentifier().Value.GetLocation(),\n                                candidateMember.Node is VariableDeclaratorSyntax ? \"field\" : \"auto-property\",\n                                candidateMember.Symbol.Name);\n                        }\n                    }\n                }\n            },\n            SymbolKind.NamedType);\n\n    private static List<NodeSymbolAndModel<SyntaxNode, ISymbol>> CandidateDeclarations(CSharpRemovableDeclarationCollector removableDeclarationCollector)\n    {\n        var candidateFields = removableDeclarationCollector.RemovableFieldLikeDeclarations(new HashSet<SyntaxKind> { SyntaxKind.FieldDeclaration }, MaxAccessibility)\n            .Where(x => !IsInitializedOrFixed((VariableDeclaratorSyntax)x.Node)\n                        && !HasStructLayoutAttribute(x.Symbol.ContainingType));\n        var candidateProperties = removableDeclarationCollector.RemovableDeclarations(new HashSet<SyntaxKind> { SyntaxKind.PropertyDeclaration }, MaxAccessibility)\n            .Where(x => IsAutoPropertyWithNoInitializer((PropertyDeclarationSyntax)x.Node)\n                        && !HasStructLayoutAttribute(x.Symbol.ContainingType));\n        return candidateFields.Concat(candidateProperties).ToList();\n    }\n\n    private static bool TypeDefinitionShouldBeAnalyzed(ITypeSymbol namedType) =>\n        namedType.IsClassOrStruct()\n        && !HasStructLayoutAttribute(namedType)\n        && namedType.ContainingType is null\n        && !namedType.HasAttribute(KnownType.System_SerializableAttribute);\n\n    private static bool HasStructLayoutAttribute(ISymbol namedTypeSymbol) =>\n        namedTypeSymbol.HasAttribute(KnownType.System_Runtime_InteropServices_StructLayoutAttribute);\n\n    private static bool IsInitializedOrFixed(VariableDeclaratorSyntax declarator) =>\n        declarator.Initializer is not null\n        || (declarator.Parent.Parent is BaseFieldDeclarationSyntax fieldDeclaration\n            && fieldDeclaration.Modifiers.Any(SyntaxKind.FixedKeyword));\n\n    private static bool IsAutoPropertyWithNoInitializer(PropertyDeclarationSyntax declaration) =>\n        declaration.Initializer is null\n        && declaration.AccessorList is not null\n        && declaration.AccessorList.Accessors.All(x => x.Body is null && x.ExpressionBody is null);\n\n    private static IList<MemberUsage> MemberUsages(CSharpRemovableDeclarationCollector removableDeclarationCollector, HashSet<ISymbol> declaredPrivateSymbols)\n    {\n        var symbolNames = declaredPrivateSymbols.Select(x => x.Name).ToHashSet();\n        var usages = removableDeclarationCollector.TypeDeclarations\n            .SelectMany(x => x.Node.DescendantNodes().Select(SimpleName).WhereNotNull()\n                                .Where(x => symbolNames.Contains(x.Identifier.ValueText))\n                                .Select(node => new MemberUsage(node, x.Model.GetSymbolInfo(node).Symbol, x.Model)));\n\n        return usages.Where(x => x.Symbol is IFieldSymbol or IPropertySymbol).ToList();\n\n        static SimpleNameSyntax SimpleName(SyntaxNode node) =>\n            node switch\n            {\n                IdentifierNameSyntax identifierName => identifierName,\n                GenericNameSyntax genericName => genericName,\n                _ => null\n            };\n    }\n\n    private static ISet<ISymbol> AssignedMemberSymbols(IList<MemberUsage> memberUsages)\n    {\n        var assignedMembers = new HashSet<ISymbol>();\n\n        foreach (var memberUsage in memberUsages)\n        {\n            var memberSymbol = memberUsage.Symbol;\n            var node = RelevantNode(memberUsage.Node, memberSymbol);\n            var parentNode = node.Parent;\n\n            if (PreOrPostfixOpSyntaxKinds.Contains(parentNode.Kind())\n                || (parentNode is AssignmentExpressionSyntax assignment && assignment.Left == node)\n                || (parentNode is ArgumentSyntax argument && (!argument.RefOrOutKeyword.IsKind(SyntaxKind.None) || TupleExpressionSyntaxWrapper.IsInstance(argument.Parent)))\n                || RefExpressionSyntaxWrapper.IsInstance(parentNode))\n            {\n                assignedMembers.Add(memberSymbol);\n                assignedMembers.Add(memberSymbol.OriginalDefinition);\n            }\n        }\n\n        return assignedMembers;\n    }\n\n    private static SyntaxNode RelevantNode(ExpressionSyntax node, ISymbol memberSymbol)\n    {\n        // Handle \"expr.FieldName\"\n        if (node.Parent is MemberAccessExpressionSyntax simpleMemberAccess && simpleMemberAccess.Name == node)\n        {\n            node = simpleMemberAccess;\n        }\n        // Handle \"expr?.FieldName\"\n        else if (node.Parent is MemberBindingExpressionSyntax memberBinding && memberBinding.Name == node)\n        {\n            node = memberBinding;\n        }\n\n        // Handle \"((expr.FieldName))\"\n        node = node.GetSelfOrTopParenthesizedExpression();\n\n        if (IsValueType(memberSymbol))\n        {\n            // Handle (((exp.FieldName)).Member1).Member2\n            var parentMemberAccess = node.Parent as MemberAccessExpressionSyntax;\n            while (IsParentMemberAccess(parentMemberAccess, node))\n            {\n                node = parentMemberAccess.GetSelfOrTopParenthesizedExpression();\n                parentMemberAccess = node.Parent as MemberAccessExpressionSyntax;\n            }\n\n            node = node.GetSelfOrTopParenthesizedExpression();\n        }\n        return node;\n    }\n\n    private static bool IsParentMemberAccess(MemberAccessExpressionSyntax parent, ExpressionSyntax node) =>\n        parent?.Expression == node;\n\n    private static bool IsValueType(ISymbol symbol) =>\n        symbol switch\n        {\n            IFieldSymbol field => field.Type.IsValueType,\n            IPropertySymbol property => property.Type.IsValueType,\n            _ => false\n        };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/NumberPatternShouldBeRegular.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class NumberPatternShouldBeRegular : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S3937\";\n        private const string MessageFormat = \"Review this number; its irregular pattern indicates an error.\";\n\n        private const char Underscore = '_';\n        private const char Dot = '.';\n        private const int NotFound = -1;\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    if (!c.Compilation.IsAtLeastLanguageVersion(LanguageVersionEx.CSharp7))\n                    {\n                        return;\n                    }\n\n                    var literal = (LiteralExpressionSyntax)c.Node;\n\n                    if (HasIrregularPattern(literal.Token.Text))\n                    {\n                        c.ReportIssue(rule, literal);\n                    }\n                },\n                SyntaxKind.NumericLiteralExpression);\n        }\n\n        /// <remarks>internal for test purposes.</remarks>\n        internal static bool HasIrregularPattern(string numericToken)\n        {\n            var split = StripNumericPreAndSuffix(numericToken).Split(Dot);\n\n            // ignore multiple dots.\n            if (split.Length > 2)\n            {\n                return false;\n            }\n\n            var groupLengthsLeftFromDot = split[0].Split(Underscore).Select(g => g.Length).ToArray();\n\n            if (HasIrregularGroupLengths(groupLengthsLeftFromDot))\n            {\n                return true;\n            }\n\n            // no dot, so done.\n            if (split.Length == 1)\n            {\n                return false;\n            }\n\n            // reverse, as for right from the dot, the last (instead of the first)\n            // group length is allowed to be shorter than the group length.\n            var groupLengthsRightFromDot = split[1].Split(Underscore).Select(g => g.Length).Reverse().ToArray();\n\n            return HasIrregularGroupLengths(groupLengthsRightFromDot);\n        }\n\n        private static string StripNumericPreAndSuffix(string numericToken)\n        {\n            var length = numericToken.Length;\n\n            // hexadecimal and binary prefixes (0xFFFF_23_AB, 0b1110_1101)\n            if (numericToken.StartsWith(\"0x\", StringComparison.InvariantCultureIgnoreCase) ||\n                numericToken.StartsWith(\"0b\", StringComparison.InvariantCultureIgnoreCase))\n            {\n                return numericToken.Substring(2, length - 2);\n            }\n\n            // Scientific notation (1.23E8)\n            var exponentMarker = numericToken.IndexOf(\"E\", StringComparison.InvariantCultureIgnoreCase);\n            if (exponentMarker != NotFound)\n            {\n                return numericToken.Substring(0, exponentMarker);\n            }\n\n            // UL and LU suffix.\n            if (numericToken.EndsWith(\"UL\", StringComparison.OrdinalIgnoreCase) ||\n                numericToken.EndsWith(\"LU\", StringComparison.OrdinalIgnoreCase))\n            {\n                return numericToken.Substring(0, length - 2);\n            }\n            // single suffixes\n            if (\"LDFUMldfum\".IndexOf(numericToken[numericToken.Length - 1]) != NotFound)\n            {\n                return numericToken.Substring(0, length - 1);\n            }\n\n            return numericToken;\n        }\n\n        private static bool HasIrregularGroupLengths(int[] groupLengths)\n        {\n            if (groupLengths.Length < 2)\n            {\n                return false;\n            }\n\n            // the first group is allowed to contain less digits that the other ones,\n            // so take the expected length from the second group.\n            var groupLength = groupLengths[1];\n\n            // we consider groups of 1 digit irregular.\n            // first should not be bigger.\n            if (groupLength < 2 || groupLengths[0] > groupLength)\n            {\n                return true;\n            }\n\n            return groupLengths.Skip(1).Any(l => l != groupLength);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ObjectCreatedDropped.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ObjectCreatedDropped : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S1848\";\n    private const string MessageFormat = \"Either remove this useless object instantiation of class '{0}' or use it.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var creation = (ObjectCreationExpressionSyntax)c.Node;\n                if (creation.Parent is ExpressionStatementSyntax)\n                {\n                    c.ReportIssue(Rule, creation, creation.Type.ToString());\n                }\n            },\n            SyntaxKind.ObjectCreationExpression);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ObjectShouldBeInitializedCorrectlyBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\nusing System.Xml.XPath;\nusing SonarAnalyzer.Core.Trackers;\nusing SonarAnalyzer.CSharp.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    public abstract class ObjectShouldBeInitializedCorrectlyBase : TrackerHotspotDiagnosticAnalyzer<SyntaxKind>\n    {\n        protected abstract CSharpObjectInitializationTracker ObjectInitializationTracker { get; }\n\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n        protected ObjectShouldBeInitializedCorrectlyBase(IAnalyzerConfiguration configuration, string diagnosticId, string messageFormat)\n            : base(configuration, diagnosticId, messageFormat) { }\n\n        protected virtual bool IsDefaultConstructorSafe(SonarCompilationStartAnalysisContext context) => false;\n\n        protected override void Initialize(TrackerInput input)\n        {\n            // This should be overriden by inheriting class that uses trackers\n        }\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            base.Initialize(context);\n            context.RegisterCompilationStartAction(\n                compilationStartContext =>\n                {\n                    if (!IsEnabled(compilationStartContext.Options))\n                    {\n                        return;\n                    }\n\n                    var isDefaultConstructorSafe = IsDefaultConstructorSafe(compilationStartContext);\n\n                    compilationStartContext.RegisterNodeAction(\n                        c =>\n                        {\n                            var objectCreation = ObjectCreationFactory.Create(c.Node);\n                            if (ObjectInitializationTracker.ShouldBeReported(objectCreation, c.Model, isDefaultConstructorSafe ))\n                            {\n                                c.ReportIssue(SupportedDiagnostics[0], objectCreation.Expression);\n                            }\n                        },\n                        SyntaxKind.ObjectCreationExpression, SyntaxKindEx.ImplicitObjectCreationExpression);\n\n                    compilationStartContext.RegisterNodeAction(\n                        c =>\n                        {\n                            var assignment = (AssignmentExpressionSyntax)c.Node;\n                            if (ObjectInitializationTracker.ShouldBeReported(assignment, c.Model))\n                            {\n                                c.ReportIssue(SupportedDiagnostics[0], assignment);\n                            }\n                        },\n                        SyntaxKind.SimpleAssignmentExpression);\n                });\n        }\n\n        protected static bool IsWebConfigCookieSet(SonarCompilationStartAnalysisContext context, string attribute)\n        {\n            foreach (var fullPath in context.ProjectConfiguration().FilesToAnalyze.FindFiles(\"web.config\"))\n            {\n                var webConfig = File.ReadAllText(fullPath);\n                if (webConfig.Contains(\"<system.web>\") && webConfig.ParseXDocument() is { } doc\n                    && doc.XPathSelectElements(\"configuration/system.web/httpCookies\").Any(x => x.GetAttributeIfBoolValueIs(attribute, true) != null))\n                {\n                    return true;\n                }\n            }\n\n            return false;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ObsoleteAttributes.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ObsoleteAttributes : ObsoleteAttributesBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override SyntaxNode GetExplanationExpression(SyntaxNode node) =>\n        node is AttributeSyntax { ArgumentList.Arguments: { Count: >= 1 } arguments }\n            && arguments[0] is { Expression: { } expression }\n                ? expression\n                : null;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/OperatorOverloadsShouldHaveNamedAlternatives.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class OperatorOverloadsShouldHaveNamedAlternatives : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S4069\";\n        private const string MessageFormat = \"Implement alternative method '{0}' for the operator '{1}'.\";\n\n        private static readonly Dictionary<string, string> operatorAlternatives = new Dictionary<string, string>\n        {\n            [\"op_Addition\"] = \"Add\",\n            [\"op_BitwiseAnd\"] = \"BitwiseAnd\",\n            [\"op_BitwiseOr\"] = \"BitwiseOr\",\n            [\"op_Division\"] = \"Divide\",\n            [\"op_ExclusiveOr\"] = \"Xor\",\n            [\"op_Equality\"] = \"Equals\",\n            [\"op_Inequality\"] = \"Equals\",\n            [\"op_GreaterThan\"] = \"Compare\",\n            [\"op_LessThan\"] = \"Compare\",\n            [\"op_GreaterThanOrEqual\"] = \"Compare\",\n            [\"op_LessThanOrEqual\"] = \"Compare\",\n            [\"op_Decrement\"] = \"Decrement\",\n            [\"op_Increment\"] = \"Increment\",\n            [\"op_LeftShift\"] = \"LeftShift\",\n            [\"op_RightShift\"] = \"RightShift\",\n            [\"op_LogicalNot\"] = \"LogicalNot\",\n            [\"op_Modulus\"] = \"Mod\",\n            [\"op_Multiply\"] = \"Multiply\",\n            [\"op_OnesComplement\"] = \"OnesComplement\",\n            [\"op_Subtraction\"] = \"Subtract\",\n            [\"op_UnaryNegation\"] = \"Negate\",\n            [\"op_UnaryPlus\"] = \"Plus\"\n        };\n\n        private static readonly Dictionary<string, string> otherOperatorAlternatives = new Dictionary<string, string>\n        {\n            [\"op_GreaterThan\"] = \"CompareTo\",\n            [\"op_LessThan\"] = \"CompareTo\",\n            [\"op_GreaterThanOrEqual\"] = \"CompareTo\",\n            [\"op_LessThanOrEqual\"] = \"CompareTo\",\n        };\n\n        private static readonly Dictionary<string, string> operatorNames = new Dictionary<string, string>\n        {\n            [\"op_Addition\"] = \"+\",\n            [\"op_BitwiseAnd\"] = \"&\",\n            [\"op_BitwiseOr\"] = \"|\",\n            [\"op_Division\"] = \"/\",\n            [\"op_ExclusiveOr\"] = \"^\",\n            [\"op_Equality\"] = \"==\",\n            [\"op_Inequality\"] = \"!=\",\n            [\"op_GreaterThan\"] = \">\",\n            [\"op_LessThan\"] = \"<\",\n            [\"op_GreaterThanOrEqual\"] = \">=\",\n            [\"op_LessThanOrEqual\"] = \"<=\",\n            [\"op_Decrement\"] = \"--\",\n            [\"op_Increment\"] = \"++\",\n            [\"op_LeftShift\"] = \"<<\",\n            [\"op_RightShift\"] = \">>\",\n            [\"op_LogicalNot\"] = \"!\",\n            [\"op_Modulus\"] = \"%\",\n            [\"op_Multiply\"] = \"*\",\n            [\"op_OnesComplement\"] = \"~\",\n            [\"op_Subtraction\"] = \"-\",\n            [\"op_UnaryNegation\"] = \"-\",\n            [\"op_UnaryPlus\"] = \"+\"\n        };\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(c =>\n            {\n                var operatorDeclaration = (OperatorDeclarationSyntax)c.Node;\n                var operatorSymbol = c.Model.GetDeclaredSymbol(operatorDeclaration);\n                if (operatorSymbol == null ||\n                    operatorSymbol.MethodKind != MethodKind.UserDefinedOperator)\n                {\n                    return;\n                }\n\n                var operatorName = operatorNames.GetValueOrDefault(operatorSymbol.Name);\n                if (operatorName != null &&\n                    !HasAlternativeMethod(operatorSymbol, out var operatorAlternativeMethodName))\n                {\n                    c.ReportIssue(rule, operatorDeclaration.OperatorToken, operatorAlternativeMethodName, operatorName);\n                }\n            },\n            SyntaxKind.OperatorDeclaration);\n        }\n\n        /// <summary>\n        /// Checks if the class containing the given operator overload contains a method with an alternative name for\n        /// the operator. Will return false if no methods with alternative name are present, or when the operator has\n        /// no alternative names.\n        /// </summary>\n        /// <returns>\n        /// True when the class contains at least one alternative method for the given operator, otherwise false. The\n        /// <see cref=\"operatorAlternativeMethodName\" /> returns the name of the method to be added as an alternative to\n        /// the operator of it does not exist.\n        /// </returns>\n        private static bool HasAlternativeMethod(IMethodSymbol operatorSymbol, out string operatorAlternativeMethodName)\n        {\n            operatorAlternativeMethodName = operatorAlternatives.GetValueOrDefault(operatorSymbol.Name);\n            if (operatorAlternativeMethodName == null ||\n                HasMethodWithName(operatorAlternativeMethodName))\n            {\n                return true;\n            }\n\n            // Suggest only the \"main\" alternatives, the \"other\" alternatives are to loosen the rule\n            var otherOperatorAlternativeMethodName = otherOperatorAlternatives.GetValueOrDefault(operatorSymbol.Name);\n\n            return otherOperatorAlternativeMethodName != null &&\n                HasMethodWithName(otherOperatorAlternativeMethodName);\n\n            bool HasMethodWithName(string name) =>\n                operatorSymbol.ContainingType\n                    .GetMembers(name)\n                    .OfType<IMethodSymbol>()\n                    .Any();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/OperatorsShouldBeOverloadedConsistently.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class OperatorsShouldBeOverloadedConsistently : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S4050\";\n    private const string MessageFormat = \"Provide an implementation for: {0}.\";\n\n    private static readonly DiagnosticDescriptor Rule =\n        DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var classDeclaration = (ClassDeclarationSyntax)c.Node;\n                var classSymbol = (INamedTypeSymbol)c.ContainingSymbol;\n\n                if (classDeclaration.Identifier.IsMissing\n                    || !classSymbol.IsPubliclyAccessible())\n                {\n                    return;\n                }\n\n                var missingMethods = FindMissingMethods(classSymbol).ToList();\n                if (missingMethods.Count > 0)\n                {\n                    c.ReportIssue(Rule, classDeclaration.Identifier, missingMethods.ToSentence(quoteWords: true));\n                }\n            },\n            // This rule is not applicable for records, as for records it is not possible to override the == operator.\n            SyntaxKind.ClassDeclaration);\n\n    private static IEnumerable<string> FindMissingMethods(INamedTypeSymbol classSymbol)\n    {\n        var implementedMethods = GetImplementedMethods(classSymbol).ToHashSet();\n        var requiredMethods = new HashSet<string>();\n\n        if (implementedMethods.Contains(MethodName.OperatorPlus)\n            || implementedMethods.Contains(MethodName.OperatorMinus)\n            || implementedMethods.Contains(MethodName.OperatorMultiply)\n            || implementedMethods.Contains(MethodName.OperatorDivide)\n            || implementedMethods.Contains(MethodName.OperatorRemainder))\n        {\n            requiredMethods.Add(MethodName.OperatorEquals);\n            requiredMethods.Add(MethodName.OperatorNotEquals);\n            requiredMethods.Add(MethodName.ObjectEquals);\n            requiredMethods.Add(MethodName.ObjectGetHashCode);\n        }\n\n        if (implementedMethods.Contains(MethodName.OperatorEquals))\n        {\n            requiredMethods.Add(MethodName.ObjectEquals);\n            requiredMethods.Add(MethodName.ObjectGetHashCode);\n        }\n\n        if (implementedMethods.Contains(MethodName.OperatorNotEquals))\n        {\n            requiredMethods.Add(MethodName.ObjectEquals);\n            requiredMethods.Add(MethodName.ObjectGetHashCode);\n        }\n\n        return requiredMethods.Except(implementedMethods);\n    }\n\n    private static IEnumerable<string> GetImplementedMethods(INamedTypeSymbol classSymbol)\n    {\n        foreach (var member in classSymbol.GetMembers().OfType<IMethodSymbol>().Where(x => !x.IsConstructor()))\n        {\n            if (ImplementedOperator(member) is { } name)\n            {\n                yield return name;\n            }\n            else if (KnownMethods.IsObjectEquals(member))\n            {\n                yield return MethodName.ObjectEquals;\n            }\n            else if (KnownMethods.IsObjectGetHashCode(member))\n            {\n                yield return MethodName.ObjectGetHashCode;\n            }\n        }\n    }\n\n    private static string ImplementedOperator(IMethodSymbol member) =>\n        member switch\n        {\n            { MethodKind: not MethodKind.UserDefinedOperator } => null,\n            _ when KnownMethods.IsOperatorBinaryPlus(member) => MethodName.OperatorPlus,\n            _ when KnownMethods.IsOperatorBinaryMinus(member) => MethodName.OperatorMinus,\n            _ when KnownMethods.IsOperatorBinaryMultiply(member) => MethodName.OperatorMultiply,\n            _ when KnownMethods.IsOperatorBinaryDivide(member) => MethodName.OperatorDivide,\n            _ when KnownMethods.IsOperatorBinaryModulus(member) => MethodName.OperatorRemainder,\n            _ when KnownMethods.IsOperatorEquals(member) => MethodName.OperatorEquals,\n            _ when KnownMethods.IsOperatorNotEquals(member) => MethodName.OperatorNotEquals,\n            _ => null\n        };\n\n    private static class MethodName\n    {\n        public const string OperatorPlus = \"operator+\";\n        public const string OperatorMinus = \"operator-\";\n        public const string OperatorMultiply = \"operator*\";\n        public const string OperatorDivide = \"operator/\";\n        public const string OperatorRemainder = \"operator%\";\n        public const string OperatorEquals = \"operator==\";\n        public const string OperatorNotEquals = \"operator!=\";\n\n        public const string ObjectEquals = \"Object.Equals\";\n        public const string ObjectGetHashCode = \"Object.GetHashCode\";\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/OptionalParameter.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class OptionalParameter : OptionalParameterBase<SyntaxKind, BaseMethodDeclarationSyntax, ParameterSyntax>\n    {\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        private static readonly ImmutableArray<SyntaxKind> kindsOfInterest = ImmutableArray.Create(SyntaxKind.MethodDeclaration, SyntaxKind.ConstructorDeclaration);\n        public override ImmutableArray<SyntaxKind> SyntaxKindsOfInterest => kindsOfInterest;\n\n        protected override IEnumerable<ParameterSyntax> GetParameters(BaseMethodDeclarationSyntax method) =>\n            method.ParameterList?.Parameters ?? Enumerable.Empty<ParameterSyntax>();\n\n        protected override bool IsOptional(ParameterSyntax parameter) =>\n            parameter.Default != null && parameter.Default.Value != null;\n\n        protected override Location GetReportLocation(ParameterSyntax parameter) =>\n            parameter.Default.GetLocation();\n\n        protected override GeneratedCodeRecognizer GeneratedCodeRecognizer => CSharpGeneratedCodeRecognizer.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/OptionalParameterNotPassedToBaseCall.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class OptionalParameterNotPassedToBaseCall : OptionalParameterNotPassedToBaseCallBase<InvocationExpressionSyntax>\n    {\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override DiagnosticDescriptor Rule => rule;\n\n        protected override int GetArgumentCount(InvocationExpressionSyntax invocation) =>\n            invocation.ArgumentList == null ? 0 : invocation.ArgumentList.Arguments.Count;\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var invocation = (InvocationExpressionSyntax)c.Node;\n                    if (!invocation.IsOnBase())\n                    {\n                        return;\n                    }\n\n                    ReportOptionalParameterNotPassedToBase(c, invocation);\n                },\n                SyntaxKind.InvocationExpression);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/OptionalParameterWithDefaultValue.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class OptionalParameterWithDefaultValue : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S3451\";\n        private const string MessageFormat = \"Use '[DefaultParameterValue]' instead.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var parameter = (ParameterSyntax)c.Node;\n                    if (!parameter.AttributeLists.Any())\n                    {\n                        return;\n                    }\n\n                    var attributes = AttributeSyntaxSymbolMapping.GetAttributesForParameter(parameter, c.Model).ToList();\n\n                    var hasNoOptional = attributes.All(attr => !attr.Symbol.IsInType(KnownType.System_Runtime_InteropServices_OptionalAttribute));\n                    if (hasNoOptional)\n                    {\n                        return;\n                    }\n\n                    var hasDefaultParameterValue = attributes.Any(attr => attr.Symbol.IsInType(KnownType.System_Runtime_InteropServices_DefaultParameterValueAttribute));\n                    if (hasDefaultParameterValue)\n                    {\n                        return;\n                    }\n\n                    var defaultValueAttribute = attributes.FirstOrDefault(a => a.Symbol.IsInType(KnownType.System_ComponentModel_DefaultValueAttribute));\n                    if (defaultValueAttribute != null)\n                    {\n                        c.ReportIssue(Rule, defaultValueAttribute.Node);\n                    }\n                },\n                SyntaxKind.Parameter);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/OptionalParameterWithDefaultValueCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class OptionalParameterWithDefaultValueCodeFix : SonarCodeFix\n    {\n        private const string Title = \"Change to '[DefaultParameterValue]'\";\n        public override ImmutableArray<string> FixableDiagnosticIds =>\n            ImmutableArray.Create(OptionalParameterWithDefaultValue.DiagnosticId);\n\n        protected override async Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            var attribute = root.FindNode(diagnosticSpan) as AttributeSyntax;\n\n            if (attribute?.ArgumentList == null ||\n                attribute.ArgumentList.Arguments.Count != 1)\n            {\n                return;\n            }\n\n            var semanticModel = await context.Document.GetSemanticModelAsync().ConfigureAwait(false);\n\n            var defaultParameterValueAttributeType = semanticModel?.Compilation.GetTypeByMetadataName(KnownType.System_Runtime_InteropServices_DefaultParameterValueAttribute);\n            if (defaultParameterValueAttributeType == null)\n            {\n                return;\n            }\n\n            context.RegisterCodeFix(\n                Title,\n                _ =>\n                {\n                    var attributeName = defaultParameterValueAttributeType.ToMinimalDisplayString(semanticModel, attribute.SpanStart);\n                    attributeName = attributeName.Remove(attributeName.IndexOf(\"Attribute\", System.StringComparison.Ordinal));\n\n                    var newAttribute = attribute.WithName(SyntaxFactory.ParseName(attributeName));\n                    var newRoot = root.ReplaceNode(attribute, newAttribute);\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/OptionalRefOutParameter.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class OptionalRefOutParameter : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S3447\";\n        private const string MessageFormat = \"Remove the 'Optional' attribute, it cannot be used with '{0}'.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var parameter = (ParameterSyntax)c.Node;\n                    if (!parameter.AttributeLists.Any()\n                        || !parameter.Modifiers.Any(m => m.IsKind(SyntaxKind.RefKeyword) || m.IsKind(SyntaxKind.OutKeyword)))\n                    {\n                        return;\n                    }\n\n                    var optionalAttribute = AttributeSyntaxSymbolMapping.GetAttributesForParameter(parameter, c.Model)\n                        .FirstOrDefault(a => a.Symbol.IsInType(KnownType.System_Runtime_InteropServices_OptionalAttribute));\n\n                    if (optionalAttribute != null)\n                    {\n                        var refKind = parameter.Modifiers.Any(SyntaxKind.OutKeyword) ? \"out\" : \"ref\";\n                        c.ReportIssue(Rule, optionalAttribute.Node, refKind);\n                    }\n                },\n                SyntaxKind.Parameter);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/OptionalRefOutParameterCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class OptionalRefOutParameterCodeFix : SonarCodeFix\n    {\n        internal const string Title = \"Remove 'Optional' attribute\";\n        public override ImmutableArray<string> FixableDiagnosticIds =>\n            ImmutableArray.Create(OptionalRefOutParameter.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            var nodeToRemove = root.FindNode(diagnosticSpan);\n\n            if (nodeToRemove.Parent is AttributeListSyntax attributeList && attributeList.Attributes.Count == 1)\n            {\n                nodeToRemove = attributeList;\n            }\n\n            context.RegisterCodeFix(\n                Title,\n                c =>\n                {\n                    var newRoot = root.RemoveNode(nodeToRemove, SyntaxRemoveOptions.KeepNoTrivia);\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n\n            return Task.CompletedTask;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/OrderByRepeated.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class OrderByRepeated : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S3169\";\n        private const string MessageFormat = \"Use 'ThenBy' instead.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var outerInvocation = (InvocationExpressionSyntax)c.Node;\n                    if (outerInvocation.Expression is MemberAccessExpressionSyntax memberAccess &&\n                        memberAccess.Expression is InvocationExpressionSyntax innerInvocation &&\n                        IsMethodOrderByExtension(outerInvocation, c.Model) &&\n                        IsOrderByOrThenBy(innerInvocation, c.Model))\n                    {\n                        c.ReportIssue(rule, memberAccess.Name);\n                    }\n\n                    static bool IsOrderByOrThenBy(InvocationExpressionSyntax invocation, SemanticModel semanticModel) =>\n                        IsMethodOrderByExtension(invocation, semanticModel) || IsMethodThenByExtension(invocation, semanticModel);\n                },\n                SyntaxKind.InvocationExpression);\n        }\n        private static bool IsMethodOrderByExtension(InvocationExpressionSyntax invocation, SemanticModel semanticModel) =>\n            invocation.Expression.ToStringContains(\"OrderBy\") &&\n            semanticModel.GetSymbolInfo(invocation).Symbol is IMethodSymbol methodSymbol &&\n               methodSymbol.Name == \"OrderBy\" &&\n               methodSymbol.MethodKind == MethodKind.ReducedExtension &&\n               methodSymbol.IsExtensionOn(KnownType.System_Collections_Generic_IEnumerable_T);\n\n        private static bool IsMethodThenByExtension(InvocationExpressionSyntax invocation, SemanticModel semanticModel) =>\n            invocation.Expression.ToStringContains(\"ThenBy\") &&\n            semanticModel.GetSymbolInfo(invocation).Symbol is IMethodSymbol methodSymbol &&\n               methodSymbol.Name == \"ThenBy\" &&\n               methodSymbol.MethodKind == MethodKind.ReducedExtension &&\n               MethodIsOnIOrderedEnumerable(methodSymbol);\n\n        private static bool MethodIsOnIOrderedEnumerable(IMethodSymbol methodSymbol) =>\n            methodSymbol.ReceiverType is INamedTypeSymbol receiverType &&\n               receiverType.ConstructedFrom.ContainingNamespace.ToString() == \"System.Linq\" &&\n               receiverType.ConstructedFrom.MetadataName == \"IOrderedEnumerable`1\";\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/OrderByRepeatedCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class OrderByRepeatedCodeFix : SonarCodeFix\n    {\n        internal const string Title = \"Change 'OrderBy' to 'ThenBy'\";\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(OrderByRepeated.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            var syntaxNode = root.FindNode(diagnosticSpan);\n\n            context.RegisterCodeFix(\n                Title,\n                c => ChangeToThenByAsync(context.Document, syntaxNode, c),\n                context.Diagnostics);\n\n            return Task.CompletedTask;\n        }\n\n        private static async Task<Document> ChangeToThenByAsync(Document document, SyntaxNode syntaxNode, CancellationToken cancel)\n        {\n            var root = await document.GetSyntaxRootAsync(cancel).ConfigureAwait(false);\n            var newRoot = root.ReplaceNode(syntaxNode,\n                SyntaxFactory.IdentifierName(\"ThenBy\"));\n            return document.WithSyntaxRoot(newRoot);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/OverrideGetHashCodeOnOverridingEquals.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class OverrideGetHashCodeOnOverridingEquals : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S1206\";\n        private const string MessageFormat = \"This {0} overrides '{1}' and should therefore also override '{2}'.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var declaration = (TypeDeclarationSyntax)c.Node;\n                    var typeSymbol = c.Model.GetDeclaredSymbol(declaration);\n                    if (typeSymbol == null)\n                    {\n                        return;\n                    }\n\n                    var overridenMethods = typeSymbol.GetMembers()\n                        .OfType<IMethodSymbol>()\n                        .Where(method => method.IsObjectEquals() || method.IsObjectGetHashCode())\n                        .Select(method => method.Name)\n                        .ToList();\n                    if (overridenMethods.Count == 0 || overridenMethods.Count == 2)\n                    {\n                        return;\n                    }\n\n                    c.ReportIssue(rule, declaration.Identifier, declaration.Keyword.ValueText, overridenMethods[0], GetMissingMethodName(overridenMethods[0]));\n                },\n                SyntaxKind.ClassDeclaration,\n                SyntaxKind.StructDeclaration);\n        }\n\n        private static string GetMissingMethodName(string overridenMethodName)\n        {\n            return overridenMethodName == nameof(object.Equals)\n                ? nameof(object.GetHashCode)\n                : nameof(object.Equals);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/PInvokesShouldNotBeVisible.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class PInvokesShouldNotBeVisible : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S4214\";\n        private const string MessageFormat = \"Make this 'P/Invoke' method private or internal.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var methodDeclaration = (MethodDeclarationSyntax)c.Node;\n                    var methodSymbol = c.Model.GetDeclaredSymbol(methodDeclaration);\n\n                    if (methodSymbol != null &&\n                        methodSymbol.IsExtern &&\n                        methodSymbol.IsStatic &&\n                        methodSymbol.IsPubliclyAccessible() &&\n                        methodSymbol.HasAttribute(KnownType.System_Runtime_InteropServices_DllImportAttribute))\n                    {\n                        c.ReportIssue(rule, methodDeclaration.Identifier);\n                    }\n                },\n                SyntaxKind.MethodDeclaration);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ParameterAssignedTo.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class ParameterAssignedTo : ParameterAssignedToBase<SyntaxKind, IdentifierNameSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n        protected override bool IsAssignmentToCatchVariable(ISymbol symbol, SyntaxNode node) =>\n            symbol is ILocalSymbol localSymbol\n            && localSymbol.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).Any(x => x.Parent is CatchClauseSyntax catchClause && catchClause.Declaration == x);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ParameterNameMatchesOriginal.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class ParameterNameMatchesOriginal : ParameterNameMatchesOriginalBase<SyntaxKind, MethodDeclarationSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n        protected override SyntaxKind[] SyntaxKinds { get; } = new[] { SyntaxKind.MethodDeclaration };\n\n        protected override IEnumerable<SyntaxToken> ParameterIdentifiers(MethodDeclarationSyntax method) =>\n            method.ParameterList.Parameters.Select(x => x.Identifier);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ParameterNamesShouldNotDuplicateMethodNames.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class ParameterNamesShouldNotDuplicateMethodNames : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S3872\";\n        private const string MessageFormat = \"Rename the parameter '{0}' so that it does not duplicate the method name.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(c =>\n            {\n                var method = (MethodDeclarationSyntax)c.Node;\n                CheckMethodParameters(c, method.Identifier, method.ParameterList);\n            },\n            SyntaxKind.MethodDeclaration);\n\n            context.RegisterNodeAction(c =>\n            {\n                var localFunction = (LocalFunctionStatementSyntaxWrapper)c.Node;\n                CheckMethodParameters(c, localFunction.Identifier, localFunction.ParameterList);\n            },\n            SyntaxKindEx.LocalFunctionStatement);\n        }\n\n        private static void CheckMethodParameters(SonarSyntaxNodeReportingContext context, SyntaxToken identifier, ParameterListSyntax parameterList)\n        {\n            var methodName = identifier.ToString();\n            foreach (var parameter in parameterList.Parameters.Select(p => p.Identifier))\n            {\n                var parameterName = parameter.ToString();\n                if (string.Equals(parameterName, methodName, StringComparison.OrdinalIgnoreCase))\n                {\n                    context.ReportIssue(rule, parameter, [identifier.ToSecondaryLocation()], parameterName);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ParameterTypeShouldMatchRouteTypeConstraint.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ParameterTypeShouldMatchRouteTypeConstraint : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S6800\";\n    private const string MessageFormat = \"{0}\";\n    private const string ImplicitStringPrimaryMessageFormat = \"Parameter type '{0}' does not match route parameter implicit type constraint 'string' in route '{1}'.\";\n    private const string PrimaryMessageFormat = \"Parameter type '{0}' does not match route parameter type constraint '{1}' in route '{2}'.\";\n    private const string MessageWithSecondaryLocationFormat = \"Parameter type '{0}' does not match route parameter type constraint.\";\n    private const string SecondaryMessageFormat = \"This route parameter has a '{0}' type constraint.\";\n    private const string ImplicitStringSecondaryMessage = \"This route parameter has an implicit 'string' type constraint.\";\n\n    private const string ImplicitStringConstraint = \"string\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    // https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/routing?view=aspnetcore-7.0#route-constraints\n    private static readonly Dictionary<string, SupportedType> ConstraintMapping = new(StringComparer.InvariantCultureIgnoreCase)\n    {\n        { \"bool\", new SupportedType(KnownType.System_Boolean) },\n        { \"datetime\", new SupportedType(KnownType.System_DateTime) },\n        { \"decimal\", new SupportedType(KnownType.System_Decimal) },\n        { \"double\", new SupportedType(KnownType.System_Double) },\n        { \"float\", new SupportedType(KnownType.System_Single) },\n        { \"guid\", new SupportedType(KnownType.System_Guid) },\n        { \"int\", new SupportedType(KnownType.System_Int32) },\n        { \"long\", new SupportedType(KnownType.System_Int64) },\n        // Implicit string constraint\n        { ImplicitStringConstraint, new SupportedType(KnownType.System_String) }\n    };\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(cc =>\n        {\n            // If we are not in a Blazor project, we don't need to go further.\n            if (cc.Compilation.GetTypeByMetadataName(KnownType.Microsoft_AspNetCore_Components_RouteAttribute) is null)\n            {\n                return;\n            }\n\n            cc.RegisterSymbolAction(c =>\n                {\n                    foreach (var property in GetPropertyTypeMismatches((INamedTypeSymbol)c.Symbol, c.Compilation))\n                    {\n                        c.ReportIssue(Rule, property.Type.GetLocation(), property.ToSecondaryLocations(), property.ToPrimaryMessage());\n                    }\n                },\n                SymbolKind.NamedType);\n        });\n\n    private static IReadOnlyList<PropertyTypeMismatch> GetPropertyTypeMismatches(INamedTypeSymbol classSymbol, Compilation compilation)\n    {\n        var routeParams = GetRouteParametersWithValidConstraint(classSymbol);\n\n        if (routeParams.Count == 0)\n        {\n            return Array.Empty<PropertyTypeMismatch>();\n        }\n\n        return classSymbol\n            .GetMembers()\n            .Where(IsPropertyWithParameterAttributeInRoute)\n            .SelectMany(property => routeParams[property.Name].Select(routeParam => new { RouteParam = routeParam, Property = property }))\n            .Where(x => !IsTypeMatchRouteConstraint(x.Property.GetSymbolType(), x.RouteParam.Constraint, compilation))\n            .SelectMany(x => x.Property.DeclaringSyntaxReferences\n                .Where(r => r.GetSyntax() is PropertyDeclarationSyntax)\n                .Select(r => new PropertyTypeMismatch(((PropertyDeclarationSyntax)r.GetSyntax()).Type, x.RouteParam.Constraint, x.RouteParam.FromRoute, x.RouteParam.RouteParamLocation)))\n            .ToList();\n\n        bool IsPropertyWithParameterAttributeInRoute(ISymbol member) =>\n            member.Kind is SymbolKind.Property && member.HasAttribute(KnownType.Microsoft_AspNetCore_Components_ParameterAttribute) && routeParams.ContainsKey(member.Name);\n    }\n\n    private static bool IsTypeMatchRouteConstraint(ITypeSymbol type, string routeConstraintType, Compilation compilation)\n    {\n        if (type.IsNullableValueType())\n        {\n            type = ((INamedTypeSymbol)type).TypeArguments[0];\n        }\n\n        return ConstraintMapping.ContainsKey(routeConstraintType) && ConstraintMapping[routeConstraintType].Matches(type, compilation);\n    }\n\n    private static Dictionary<string, List<RouteParameter>> GetRouteParametersWithValidConstraint(INamedTypeSymbol classDeclaration)\n    {\n        var routeParameters = new Dictionary<string, List<RouteParameter>>(StringComparer.InvariantCultureIgnoreCase);\n\n        var routeAttributeDataList = classDeclaration.GetAttributes()\n            .Where(x => KnownType.Microsoft_AspNetCore_Components_RouteAttribute.Matches(x.AttributeClass));\n\n        foreach (var routeAttributeData in routeAttributeDataList)\n        {\n            var routeNode = routeAttributeData.ApplicationSyntaxReference.GetSyntax() as AttributeSyntax;\n\n            if (!routeAttributeData.TryGetAttributeValue<string>(\"template\", out var route) || routeNode is null)\n            {\n                continue;\n            }\n\n            var routeParams = route\n                .Split('/')\n                .Where(segment => segment.StartsWith(\"{\") && segment.EndsWith(\"}\"))\n                .Select(x => new { Param = x, Parts = x.TrimStart('{').TrimEnd('}', '?').Split(':') })\n                .Where(x => x.Parts.Length == 1 || (x.Parts.Length == 2 && ConstraintMapping.ContainsKey(x.Parts[1])));\n\n            foreach (var routeParam in routeParams)\n            {\n                routeParameters\n                    .GetOrAdd(routeParam.Parts[0], _ => new List<RouteParameter>(1))\n                    .Add(new(routeParam.Parts.Length == 2 ? routeParam.Parts[1] : ImplicitStringConstraint,\n                        route,\n                        CalculateRouteParamLocation(routeNode.GetLocation(), routeNode, routeParam.Param)));\n            }\n        }\n\n        return routeParameters;\n    }\n\n    private static Location CalculateRouteParamLocation(Location attributeLocation, AttributeSyntax routeNode, string routeParam)\n    {\n        if (GeneratedCodeRecognizer.IsRazorGeneratedFile(attributeLocation.SourceTree))\n        {\n            return null;\n        }\n\n        return routeNode.ArgumentList.Arguments[0].Expression.RemoveParentheses() switch\n        {\n            var expression when expression.ToString() is var route && route.IndexOf(routeParam, StringComparison.InvariantCulture) is >= 0 and var index =>\n                CreateLocationFromRoute(expression.GetLocation(), index, routeParam.Length),\n            var expression => expression.GetLocation()\n        };\n\n        Location CreateLocationFromRoute(Location routeLocation, int index, int lenght) =>\n            Location.Create(routeLocation.SourceTree, new TextSpan(routeLocation.SourceSpan.Start + index, lenght));\n    }\n\n    private sealed class PropertyTypeMismatch\n    {\n        public TypeSyntax Type { get; }\n        public string ConstraintType { get; }\n        public string Route { get; }\n        public Location RouteParamLocation { get; }\n\n        private bool IsImplicitStringConstraint => ConstraintType.Equals(\"string\", StringComparison.OrdinalIgnoreCase);\n        private bool CanReportSecondaryLocation => RouteParamLocation is not null;\n\n        public PropertyTypeMismatch(TypeSyntax type, string constraintType, string route, Location routeParamLocation)\n        {\n            Type = type;\n            ConstraintType = constraintType;\n            Route = route;\n            RouteParamLocation = routeParamLocation;\n        }\n\n        public string ToPrimaryMessage()\n        {\n            if (CanReportSecondaryLocation)\n            {\n                return string.Format(MessageWithSecondaryLocationFormat, GetTypeName(Type));\n            }\n            else if (IsImplicitStringConstraint)\n            {\n                return string.Format(ImplicitStringPrimaryMessageFormat, GetTypeName(Type), Route);\n            }\n            else\n            {\n                return string.Format(PrimaryMessageFormat, GetTypeName(Type), ConstraintType.ToLower(), Route);\n            }\n        }\n\n        private static string GetTypeName(TypeSyntax type) =>\n            type switch\n            {\n                ArrayTypeSyntax _ => type.ToString(),\n                PointerTypeSyntax _ => type.ToString(),\n                _ => type.GetName()\n            };\n\n        public IEnumerable<SecondaryLocation> ToSecondaryLocations() =>\n            CanReportSecondaryLocation ? [new(RouteParamLocation, ToSecondaryMessage())] : [];\n\n        private string ToSecondaryMessage() =>\n            IsImplicitStringConstraint ? ImplicitStringSecondaryMessage : string.Format(SecondaryMessageFormat, ConstraintType.ToLower());\n    }\n\n    private readonly record struct RouteParameter(string Constraint, string FromRoute, Location RouteParamLocation);\n\n    private readonly record struct SupportedType(KnownType ConstraintKnownType)\n    {\n        public bool Matches(ITypeSymbol propertyType, Compilation compilation)\n        {\n            if (propertyType.Is(ConstraintKnownType))\n            {\n                return true;\n            }\n\n            var constraintTypeSymbol = compilation.GetTypeByMetadataName(ConstraintKnownType);\n\n            var conversion = compilation.ClassifyConversion(constraintTypeSymbol, propertyType);\n\n            return conversion.IsBoxing || conversion.IsEnumeration;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ParameterValidationInAsyncShouldBeWrapped.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Walkers;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ParameterValidationInAsyncShouldBeWrapped : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S4457\";\n    private const string MessageFormat = \"Split this method into two, one handling parameters check and the other handling the asynchronous code.\";\n    private const string SecondaryLocationMessage = \"This ArgumentException will be raised only after observing the task.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            c =>\n            {\n                var method = (MethodDeclarationSyntax)c.Node;\n                if (!method.Modifiers.Any(SyntaxKind.AsyncKeyword)\n                    || method.HasReturnTypeVoid()\n                    || (method.Identifier.ValueText == \"Main\" && c.Model.GetDeclaredSymbol(method).IsMainMethod()))\n                {\n                    return;\n                }\n\n                var walker = new ParameterValidationInAsyncWalker(c.Model);\n                walker.SafeVisit(method);\n                if (walker.ArgumentExceptionLocations.Any())\n                {\n                    c.ReportIssue(Rule, method.Identifier, walker.ArgumentExceptionLocations);\n                }\n            },\n            SyntaxKind.MethodDeclaration);\n\n    private sealed class ParameterValidationInAsyncWalker : ParameterValidationInMethodWalker\n    {\n        protected override string SecondaryMessage => SecondaryLocationMessage;\n\n        public ParameterValidationInAsyncWalker(SemanticModel model)\n            : base(model)\n        {\n        }\n\n        public override void VisitAwaitExpression(AwaitExpressionSyntax node) =>\n            keepWalking = false;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ParameterValidationInYieldShouldBeWrapped.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Walkers;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ParameterValidationInYieldShouldBeWrapped : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S4456\";\n    private const string MessageFormat = \"Split this method into two, one handling parameters check and the other handling the iterator.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            c =>\n            {\n                var methodDeclaration = (MethodDeclarationSyntax)c.Node;\n\n                var walker = new ParameterValidationInYieldWalker(c.Model);\n                walker.SafeVisit(methodDeclaration);\n\n                if (walker.HasYieldStatement &&\n                    walker.ArgumentExceptionLocations.Any())\n                {\n                    c.ReportIssue(Rule, methodDeclaration.Identifier, walker.ArgumentExceptionLocations);\n                }\n            },\n            SyntaxKind.MethodDeclaration);\n\n    private sealed class ParameterValidationInYieldWalker : ParameterValidationInMethodWalker\n    {\n        public bool HasYieldStatement { get; private set; }\n\n        public ParameterValidationInYieldWalker(SemanticModel model)\n            : base(model)\n        {\n        }\n\n        public override void VisitYieldStatement(YieldStatementSyntax node)\n        {\n            HasYieldStatement = true;\n            base.VisitYieldStatement(node);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ParametersCorrectOrder.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class ParametersCorrectOrder : ParametersCorrectOrderBase<SyntaxKind>\n    {\n        protected override SyntaxKind[] InvocationKinds => new[]\n            {\n                SyntaxKind.InvocationExpression,\n                SyntaxKind.ObjectCreationExpression,\n                SyntaxKind.ThisConstructorInitializer,\n                SyntaxKind.BaseConstructorInitializer,\n                SyntaxKindEx.PrimaryConstructorBaseType,\n                SyntaxKindEx.ImplicitObjectCreationExpression,\n            };\n\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/PartCreationPolicyShouldBeUsedWithExportAttribute.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class PartCreationPolicyShouldBeUsedWithExportAttribute\n        : PartCreationPolicyShouldBeUsedWithExportAttributeBase<AttributeSyntax, TypeDeclarationSyntax>\n    {\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override TypeDeclarationSyntax GetTypeDeclaration(AttributeSyntax attribute)\n        {\n            var declaration = attribute.FirstAncestorOrSelf<MemberDeclarationSyntax>();\n            if (declaration is ClassDeclarationSyntax classDeclaration)\n            {\n                return classDeclaration;\n            }\n            else if (RecordDeclarationSyntaxWrapper.IsInstance(declaration))\n            {\n                return (RecordDeclarationSyntaxWrapper)declaration;\n            }\n            else\n            {\n                return null;\n            }\n        }\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(AnalyzeNode, SyntaxKind.Attribute);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/PartialMethodNoImplementation.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class PartialMethodNoImplementation : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S3251\";\n        private const string MessageFormat = \"Supply an implementation for {0} partial method{1}.\";\n        private const string MessageAdditional = \", otherwise this call will be ignored\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(CheckForCandidatePartialDeclaration, SyntaxKind.MethodDeclaration);\n            context.RegisterNodeAction(CheckForCandidatePartialInvocation, SyntaxKind.InvocationExpression);\n        }\n\n        private static void CheckForCandidatePartialDeclaration(SonarSyntaxNodeReportingContext context)\n        {\n            var declaration = (MethodDeclarationSyntax)context.Node;\n            var partialKeyword = declaration.Modifiers.FirstOrDefault(m => m.IsKind(SyntaxKind.PartialKeyword));\n\n            if (partialKeyword != default\n                && !declaration.HasBodyOrExpressionBody()\n                && !declaration.Modifiers.Any(HasAccessModifier)\n                && context.Model.GetDeclaredSymbol(declaration) is { } methodSymbol\n                && methodSymbol.PartialImplementationPart == null)\n            {\n                context.ReportIssue(Rule, partialKeyword, \"this\", string.Empty);\n            }\n        }\n\n        private static void CheckForCandidatePartialInvocation(SonarSyntaxNodeReportingContext context)\n        {\n            var invocation = (InvocationExpressionSyntax)context.Node;\n\n            if (invocation.Parent is StatementSyntax statement\n                && context.Model.GetSymbolInfo(invocation).Symbol is IMethodSymbol methodSymbol\n                && methodSymbol.PartialImplementationPart == null\n                && PartialMethodsWithoutAccessModifier(methodSymbol).Any())\n            {\n                context.ReportIssue(Rule, statement, \"the\", MessageAdditional);\n            }\n        }\n\n        // from the method symbol it's not possible to tell if it's a partial method or not.\n        // https://github.com/dotnet/roslyn/issues/48\n        private static IEnumerable<MethodDeclarationSyntax> PartialMethodsWithoutAccessModifier(IMethodSymbol methodSymbol) =>\n            methodSymbol.DeclaringSyntaxReferences\n                .Select(r => r.GetSyntax())\n                .OfType<MethodDeclarationSyntax>()\n                .Where(method => method.Modifiers.Any(SyntaxKind.PartialKeyword)\n                                 && !method.Modifiers.Any(HasAccessModifier)\n                                 && method.Body == null\n                                 && method.ExpressionBody == null);\n\n        private static bool HasAccessModifier(SyntaxToken token) =>\n            token.IsAnyKind(SyntaxKind.PublicKeyword, SyntaxKind.InternalKeyword, SyntaxKind.ProtectedKeyword, SyntaxKind.PrivateKeyword);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/PasswordsShouldBeStoredCorrectly.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class PasswordsShouldBeStoredCorrectly : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S5344\";\n    private const string MessageFormat = \"{0}\";\n    private const string UseMoreIterationsMessageFormat = \"Use at least 100,000 iterations here.\";\n    private const int IterationCountThreshold = 100_000;\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        AspNetCore(context);\n        AspNetFramework(context);\n        Rfc2898DeriveBytes(context);\n        BouncyCastle(context);\n    }\n\n    private static void AspNetCore(SonarAnalysisContext context)\n    {\n        var propertyTracker = CSharpFacade.Instance.Tracker.PropertyAccess;\n        Track(\n            propertyTracker,\n            context,\n            UseMoreIterationsMessageFormat,\n            propertyTracker.MatchSetter(),\n            propertyTracker.MatchProperty(new MemberDescriptor(KnownType.Microsoft_AspNetCore_Identity_PasswordHasherOptions, \"IterationCount\")),\n            x => HasFewIterations(x, propertyTracker));\n        Track(\n            propertyTracker,\n            context,\n            \"Identity v2 uses only 1000 iterations. Consider changing to identity V3.\",\n            propertyTracker.MatchSetter(),\n            propertyTracker.MatchProperty(new MemberDescriptor(KnownType.Microsoft_AspNetCore_Identity_PasswordHasherOptions, \"CompatibilityMode\")),\n            x => propertyTracker.AssignedValue(x) is 0); // PasswordHasherCompatibilityMode.IdentityV2 results to 0\n\n        var argumentTracker = CSharpFacade.Instance.Tracker.Argument;\n        Track(\n            argumentTracker,\n            context,\n            UseMoreIterationsMessageFormat,\n            argumentTracker.MatchArgument(ArgumentDescriptor.MethodInvocation(KnownType.Microsoft_AspNetCore_Cryptography_KeyDerivation_KeyDerivation, \"Pbkdf2\", \"iterationCount\", 3)),\n            x => ArgumentLessThan(x, IterationCountThreshold));\n    }\n\n    private static void AspNetFramework(SonarAnalysisContext context)\n    {\n        var tracker = CSharpFacade.Instance.Tracker.ObjectCreation;\n        Track(\n            tracker,\n            context,\n            \"PasswordHasher does not support state-of-the-art parameters. Use Rfc2898DeriveBytes instead.\",\n            tracker.WhenDerivesFrom(KnownType.Microsoft_AspNet_Identity_PasswordHasherOptions));\n    }\n\n    private static void Rfc2898DeriveBytes(SonarAnalysisContext context)\n    {\n        // Raise when hashAlgorithm is present\n        var argumentTracker = CSharpFacade.Instance.Tracker.Argument;\n        // Exclude the constructors that have a hashAlgorithm parameter\n        var constructorArgument = ArgumentDescriptor.ConstructorInvocation(\n                        ctor => ctor.ContainingType.Is(KnownType.System_Security_Cryptography_Rfc2898DeriveBytes) && ctor.Parameters.Any(x => x.Name == \"hashAlgorithm\"),\n                        (methodName, comparison) => string.Compare(methodName, \"Rfc2898DeriveBytes\", comparison) == 0,\n                        null,\n                        x => x.Name == \"iterations\",\n                        null,\n                        null);\n        var invocationArgument = ArgumentDescriptor.MethodInvocation(KnownType.System_Security_Cryptography_Rfc2898DeriveBytes, \"Pbkdf2\", \"iterations\", x => x is 2 or 3);\n        Track(\n            argumentTracker,\n            context,\n            UseMoreIterationsMessageFormat,\n            argumentTracker.Or(\n                argumentTracker.MatchArgument(constructorArgument),\n                argumentTracker.MatchArgument(invocationArgument)),\n            x => ArgumentLessThan(x, IterationCountThreshold));\n\n        // Raise when hashAlgorithm is NOT present\n        var objectCreationTracker = CSharpFacade.Instance.Tracker.ObjectCreation;\n        Track(\n            objectCreationTracker,\n            context,\n            \"Use at least 100,000 iterations and a state-of-the-art digest algorithm here.\",\n            objectCreationTracker.MatchConstructor(KnownType.System_Security_Cryptography_Rfc2898DeriveBytes),\n            x => x.InvokedConstructorSymbol.Value.Parameters.All(x => x.Name != \"hashAlgorithm\"));\n\n        var propertyTracker = CSharpFacade.Instance.Tracker.PropertyAccess;\n        Track(\n            propertyTracker,\n            context,\n            UseMoreIterationsMessageFormat,\n            propertyTracker.MatchSetter(),\n            propertyTracker.MatchProperty(new MemberDescriptor(KnownType.System_Security_Cryptography_Rfc2898DeriveBytes, \"IterationCount\")),\n            x => HasFewIterations(x, propertyTracker));\n    }\n\n    private static void BouncyCastle(SonarAnalysisContext context)\n    {\n        var tracker = CSharpFacade.Instance.Tracker.Argument;\n\n        Track(\n            tracker,\n            context,\n            \"Use a cost factor of at least 12 here.\",\n            tracker.Or(\n                tracker.MatchArgument(\n                    ArgumentDescriptor.MethodInvocation(KnownType.Org_BouncyCastle_Crypto_Generators_OpenBsdBCrypt, \"Generate\", \"cost\", x => x is 2 or 3)),\n                tracker.MatchArgument(\n                    ArgumentDescriptor.MethodInvocation(KnownType.Org_BouncyCastle_Crypto_Generators_BCrypt, \"Generate\", \"cost\", 2))),\n            x => ArgumentLessThan(x, 12));\n\n        Track(\n            tracker,\n            context,\n            UseMoreIterationsMessageFormat,\n            tracker.MatchArgument(\n                ArgumentDescriptor.MethodInvocation(KnownType.Org_BouncyCastle_Crypto_PbeParametersGenerator, \"Init\", \"iterationCount\", 2)),\n            x => ArgumentLessThan(x, IterationCountThreshold));\n\n        TrackSCrypt(\"N\", 2, \"Use a cost factor of at least 2 ^ 12 for N here.\", 1 << 12);\n        TrackSCrypt(\"r\", 3, \"Use a memory factor of at least 8 for r here.\", 8);\n        TrackSCrypt(\"dkLen\", 5, \"Use an output length of at least 32 for dkLen here.\", 32);\n\n        void TrackSCrypt(string argumentName, int argumentPosition, string diagnosticMessage, int threshold) =>\n            Track(\n                tracker,\n                context,\n                diagnosticMessage,\n                tracker.MatchArgument(ArgumentDescriptor.MethodInvocation(\n                    KnownType.Org_BouncyCastle_Crypto_Generators_SCrypt, \"Generate\", argumentName, argumentPosition)),\n                x => ArgumentLessThan(x, threshold));\n    }\n\n    private static bool HasFewIterations(PropertyAccessContext context, PropertyAccessTracker<SyntaxKind> tracker) =>\n        tracker.AssignedValue(context) is < IterationCountThreshold;\n\n    private static bool ArgumentLessThan(ArgumentContext context, int threshold) =>\n        context.Model.GetConstantValue(((ArgumentSyntax)context.Node).Expression) is { HasValue: true, Value: int value }\n        && value < threshold;\n\n    private static void Track<TContext>(SyntaxTrackerBase<SyntaxKind, TContext> tracker,\n                                        SonarAnalysisContext context,\n                                        string message,\n                                        params SyntaxTrackerBase<SyntaxKind, TContext>.Condition[] conditions) where TContext : SyntaxBaseContext =>\n        tracker.Track(new(context, AnalyzerConfiguration.AlwaysEnabled, Rule), [message], conditions);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/PointersShouldBePrivate.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class PointersShouldBePrivate : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S4000\";\n        private const string MessageFormat = \"Make '{0}' 'private' or 'protected readonly'.\";\n\n        private static readonly DiagnosticDescriptor Rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n            {\n                var fieldDeclaration = (FieldDeclarationSyntax)c.Node;\n\n                if (fieldDeclaration.Declaration == null)\n                {\n                    return;\n                }\n\n                foreach (var variable in fieldDeclaration.Declaration.Variables)\n                {\n                    if (SymbolIfPointerType(fieldDeclaration.Declaration, variable, c.Model) is { } variableSymbol\n                        && variableSymbol.GetEffectiveAccessibility() is var accessibility\n                        && accessibility != Accessibility.Private\n                        && accessibility != Accessibility.Internal\n                        && !variableSymbol.IsReadOnly)\n                    {\n                        c.ReportIssue(Rule, variable, variableSymbol.Name);\n                    }\n                }\n            },\n            SyntaxKind.FieldDeclaration);\n\n        private static IFieldSymbol SymbolIfPointerType(VariableDeclarationSyntax variableDeclaration, VariableDeclaratorSyntax variableDeclarator, SemanticModel semanticModel)\n        {\n            if (variableDeclaration.Type.IsKind(SyntaxKind.PointerType)\n                || IsUnmanagedFunctionPointer(variableDeclaration))\n            {\n                return (IFieldSymbol)semanticModel.GetDeclaredSymbol(variableDeclarator);\n            }\n            else\n            {\n                return IsPointerStructure(variableDeclaration)\n                       && ((IFieldSymbol)semanticModel.GetDeclaredSymbol(variableDeclarator)) is { } variableSymbol\n                       && variableSymbol.Type.IsAny(KnownType.PointerTypes)\n                    ? variableSymbol\n                    : null;\n            }\n        }\n\n        private static bool IsPointerStructure(VariableDeclarationSyntax variableDeclaration) =>\n            variableDeclaration.Type is IdentifierNameSyntax identifierName\n                ? IsNameOfPointerStruct(identifierName.Identifier.ValueText)\n                : variableDeclaration.Type is QualifiedNameSyntax qualifiedName\n                  && qualifiedName.Right is IdentifierNameSyntax identifierNameSyntax\n                  && IsNameOfPointerStruct(identifierNameSyntax.Identifier.ValueText);\n\n        private static bool IsNameOfPointerStruct(string typeName) =>\n            typeName.Equals(\"IntPtr\") || typeName.Equals(\"UIntPtr\");\n\n        private static bool IsUnmanagedFunctionPointer(VariableDeclarationSyntax variableDeclaration) =>\n            variableDeclaration.Type.IsKind(SyntaxKindEx.FunctionPointerType)\n            && (FunctionPointerTypeSyntaxWrapper)variableDeclaration.Type is var functionPointerType\n            && functionPointerType.CallingConvention.SyntaxNode != null\n            && !functionPointerType.CallingConvention.ManagedOrUnmanagedKeyword.IsKind(SyntaxKindEx.ManagedKeyword);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/PreferGuidEmpty.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class PreferGuidEmpty : PreferGuidEmptyBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/PreferGuidEmptyCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Formatting;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class PreferGuidEmptyCodeFix : SonarCodeFix\n    {\n        internal const string Title = \"Use Guid.Empty instead\";\n\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(PreferGuidEmpty.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var toReplace = ToReplace(root, context);\n            var replacement = Replacement(root, toReplace);\n\n            context.RegisterCodeFix(\n               Title,\n               token => Task.FromResult(context.Document.WithSyntaxRoot(replacement)),\n               context.Diagnostics);\n            return Task.CompletedTask;\n        }\n\n        private static SyntaxNode ToReplace(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var replacement = root.FindNode(context.Diagnostics.First().Location.SourceSpan);\n            return replacement is ArgumentSyntax argument\n                ? argument.Expression\n                : replacement;\n        }\n\n        private static SyntaxNode Replacement(SyntaxNode root, SyntaxNode toReplace) =>\n            root.ReplaceNode(toReplace, SyntaxFactory.IdentifierName(\"Guid.Empty\")).WithAdditionalAnnotations(Formatter.Annotation);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/PreferJaggedArraysOverMultidimensional.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class PreferJaggedArraysOverMultidimensional : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S3967\";\n        private const string MessageFormat = \"Change this multidimensional array to a jagged array.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c => AnalyzeNode<VariableDeclarationSyntax>(c,\n                    (semanticModel, variable) => semanticModel.GetDeclaredSymbol(variable.Variables[0]).GetSymbolType(),\n                    variable => variable.Variables[0].Identifier.GetLocation()),\n                SyntaxKind.VariableDeclaration);\n\n            context.RegisterNodeAction(\n                c => AnalyzeNode<ParameterSyntax>(c,\n                    (semanticModel, parameter) => semanticModel.GetDeclaredSymbol(parameter)?.Type,\n                    parameter => parameter.Identifier.GetLocation()),\n                SyntaxKind.Parameter);\n\n            context.RegisterNodeAction(\n                c => AnalyzeNode<MethodDeclarationSyntax>(c,\n                    (semanticModel, method) => semanticModel.GetDeclaredSymbol(method)?.ReturnType,\n                    method => method.Identifier.GetLocation()),\n                SyntaxKind.MethodDeclaration);\n\n            context.RegisterNodeAction(\n                c => AnalyzeNode<PropertyDeclarationSyntax>(c,\n                    (semanticModel, property) => semanticModel.GetDeclaredSymbol(property)?.Type,\n                    property => property.Identifier.GetLocation()),\n                SyntaxKind.PropertyDeclaration);\n        }\n\n        private static void AnalyzeNode<TSyntax>(SonarSyntaxNodeReportingContext context,\n            Func<SemanticModel, TSyntax, ITypeSymbol> getTypeSymbol, Func<TSyntax, Location> getLocation)\n            where TSyntax : SyntaxNode\n        {\n            var syntax = (TSyntax)context.Node;\n            var typeSymbol = getTypeSymbol(context.Model, syntax);\n            if (typeSymbol == null)\n            {\n                return;\n            }\n\n            if (IsMultiDimensionalArray(typeSymbol))\n            {\n                context.ReportIssue(rule, getLocation(syntax));\n            }\n        }\n\n        private static bool IsMultiDimensionalArray(ITypeSymbol type)\n        {\n            var currentType = type;\n            while (currentType.TypeKind == TypeKind.Array)\n            {\n                var arrayType = (IArrayTypeSymbol)currentType;\n\n                if (arrayType.Rank > 1)\n                {\n                    return true;\n                }\n\n                currentType = arrayType.ElementType;\n            }\n\n            return false;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/PrivateFieldUsedAsLocalVariable.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class PrivateFieldUsedAsLocalVariable : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S1450\";\n    private const string MessageFormat = \"Remove the field '{0}' and declare it as a local variable in the relevant methods.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    private static readonly ISet<SyntaxKind> NonPrivateModifiers = new HashSet<SyntaxKind>\n    {\n        SyntaxKind.PublicKeyword,\n        SyntaxKind.ProtectedKeyword,\n        SyntaxKind.InternalKeyword,\n    };\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var typeDeclaration = (TypeDeclarationSyntax)c.Node;\n                if (c.IsRedundantPositionalRecordContext() || typeDeclaration.Modifiers.Any(SyntaxKind.PartialKeyword))\n                {\n                    return;\n                }\n\n                var methodNames = typeDeclaration.Members.OfType<MethodDeclarationSyntax>().Select(x => x.Identifier.ValueText).ToHashSet();\n                var privateFields = GetPrivateFields(c.Model, typeDeclaration);\n                var collector = new FieldAccessCollector(c.Model, privateFields, methodNames);\n                if (!collector.SafeVisit(typeDeclaration))\n                {\n                    // We couldn't finish the exploration so we cannot take any decision\n                    return;\n                }\n\n                foreach (var fieldSymbol in privateFields.Keys.Where(collector.IsRemovableField))\n                {\n                    c.ReportIssue(Rule, privateFields[fieldSymbol], fieldSymbol.Name);\n                }\n            },\n            SyntaxKind.ClassDeclaration,\n            SyntaxKind.StructDeclaration,\n            SyntaxKindEx.RecordDeclaration,\n            SyntaxKindEx.RecordStructDeclaration);\n\n    private static IDictionary<IFieldSymbol, VariableDeclaratorSyntax> GetPrivateFields(SemanticModel model, TypeDeclarationSyntax typeDeclaration)\n    {\n        return typeDeclaration.Members\n            .OfType<FieldDeclarationSyntax>()\n            .Where(IsPrivate)\n            .Where(HasNoAttributes)\n            .SelectMany(x => x.Declaration.Variables)\n            .ToDictionary(\n                x => (IFieldSymbol)model.GetDeclaredSymbol(x),\n                x => x);\n\n        bool IsPrivate(FieldDeclarationSyntax fieldDeclaration) =>\n            !fieldDeclaration.Modifiers.Select(x => x.Kind()).Any(NonPrivateModifiers.Contains);\n\n        bool HasNoAttributes(FieldDeclarationSyntax fieldDeclaration) =>\n            fieldDeclaration.AttributeLists.Count == 0;\n    }\n\n    private sealed class FieldAccessCollector : SafeCSharpSyntaxWalker\n    {\n        // Contains statements that READ field values. First grouped by field symbol (that is read),\n        // then by method/property/ctor symbol (that contains the statements)\n        private readonly Dictionary<IFieldSymbol, Lookup<ISymbol, SyntaxNode>> readsByField = new();\n\n        // Contains statements that WRITE field values. First grouped by field symbol (that is written),\n        // then by method/property/ctor symbol (that contains the statements)\n        private readonly Dictionary<IFieldSymbol, Lookup<ISymbol, SyntaxNode>> writesByField = new();\n\n        // Contains all method/property invocations grouped by the statement that contains them.\n        private readonly Lookup<SyntaxNode, ISymbol> invocations = new();\n\n        private readonly SemanticModel model;\n        private readonly IDictionary<IFieldSymbol, VariableDeclaratorSyntax> privateFields;\n\n        private readonly HashSet<string> methodNames;\n\n        public FieldAccessCollector(SemanticModel model, IDictionary<IFieldSymbol, VariableDeclaratorSyntax> privateFields, HashSet<string> methodNames)\n        {\n            this.model = model;\n            this.privateFields = privateFields;\n            this.methodNames = methodNames;\n        }\n\n        public bool IsRemovableField(IFieldSymbol fieldSymbol)\n        {\n            var writesByEnclosingSymbol = writesByField.GetValueOrDefault(fieldSymbol);\n            var readsByEnclosingSymbol = readsByField.GetValueOrDefault(fieldSymbol);\n\n            // No methods overwrite the field value\n            if (writesByEnclosingSymbol is null)\n            {\n                return false;\n            }\n\n            // A field is removable when no method reads it, or all methods that read it, overwrite it before reading\n            // However, as S4487 reports on fields that are written but not read, we only raise on the latter case\n            return readsByEnclosingSymbol?.Keys.All(ValueOverwrittenBeforeReading) ?? false;\n\n            bool ValueOverwrittenBeforeReading(ISymbol enclosingSymbol)\n            {\n                var writeStatements = writesByEnclosingSymbol.GetValueOrDefault(enclosingSymbol);\n                var readStatements = readsByEnclosingSymbol.GetValueOrDefault(enclosingSymbol);\n\n                // Note that Enumerable.All() will return true if readStatements is empty. The collection\n                // will be empty if the field is read only in property/field initializers or returned from\n                // expression-bodied methods.\n                return writeStatements is not null && (readStatements?.All(IsPrecededWithWrite) ?? false);\n\n                // Returns true when readStatement is preceded with a statement that overwrites fieldSymbol,\n                // or false when readStatement is preceded with an invocation of a method or property that\n                // overwrites fieldSymbol.\n                bool IsPrecededWithWrite(SyntaxNode readStatementOrArrowExpression)\n                {\n                    if (readStatementOrArrowExpression is StatementSyntax readStatement)\n                    {\n                        foreach (var statement in readStatement.GetPreviousStatements())\n                        {\n                            // When the readStatement is preceded with a write statement (that is also not a read statement)\n                            // we want to report this field.\n                            if (IsOverwritingValue(statement))\n                            {\n                                return true;\n                            }\n\n                            // When the readStatement is preceded with an invocation that has side effects, e.g. writes the field\n                            // we don't want to report this field because it could be difficult or impossible to change the code.\n                            if (IsInvocationWithSideEffects(statement))\n                            {\n                                return false;\n                            }\n                        }\n                    }\n                    // ArrowExpressionClauseSyntax cannot be preceded by anything...\n                    return false;\n                }\n\n                bool IsOverwritingValue(StatementSyntax statement) =>\n                    writeStatements.Contains(statement)\n                    && !readStatements.Contains(statement);\n\n                bool IsInvocationWithSideEffects(StatementSyntax statement) =>\n                    invocations.TryGetValue(statement, out var invocationsInStatement)\n                    && invocationsInStatement.Any(writesByEnclosingSymbol.ContainsKey);\n            }\n        }\n\n        public override void VisitIdentifierName(IdentifierNameSyntax node)\n        {\n            if (privateFields.Keys.Any(x => x.Name == node.Identifier.ValueText)\n                || (node.Parent is not InvocationExpressionSyntax\n                    && methodNames.Contains(node.Identifier.ValueText)))\n            {\n                var memberReference = GetTopmostSyntaxWithTheSameSymbol(node);\n                if (memberReference.Symbol is IFieldSymbol fieldSymbol && privateFields.ContainsKey(fieldSymbol))\n                {\n                    ClassifyFieldReference(model.GetEnclosingSymbol(memberReference.Node.SpanStart), memberReference);\n                }\n                else if (memberReference.Symbol is IMethodSymbol && GetParentPseudoStatement(memberReference) is { } pseudoStatement)\n                {\n                    // Adding method group to the invocation list\n                    invocations.GetOrAdd(pseudoStatement, _ => new HashSet<ISymbol>()).Add(memberReference.Symbol);\n                }\n            }\n\n            base.VisitIdentifierName(node);\n        }\n\n        public override void VisitInvocationExpression(InvocationExpressionSyntax node)\n        {\n            if (node.GetMethodCallIdentifier() is { } methodCallIdentifier\n                && methodNames.Contains(methodCallIdentifier.ValueText)\n                && GetTopmostSyntaxWithTheSameSymbol(node) is var memberReference\n                && memberReference.Symbol is IMethodSymbol\n                && GetParentPseudoStatement(memberReference) is { } pseudoStatement)\n            {\n                invocations.GetOrAdd(pseudoStatement, _ => new HashSet<ISymbol>())\n                    .Add(memberReference.Symbol);\n            }\n            base.VisitInvocationExpression(node);\n        }\n\n        // A PseudoStatement is a Statement or an ArrowExpressionClauseSyntax (which denotes an expression-bodied member).\n        private static SyntaxNode GetParentPseudoStatement(NodeAndSymbol memberReference) =>\n            memberReference.Node.Ancestors().FirstOrDefault(x => x is StatementSyntax or ArrowExpressionClauseSyntax);\n\n        /// <summary>\n        /// Stores the statement that contains the provided field reference in one of the \"reads\" or \"writes\" collections,\n        /// first grouped by field symbol, then by containing method.\n        /// </summary>\n        private void ClassifyFieldReference(ISymbol enclosingSymbol, NodeAndSymbol fieldReference)\n        {\n            // It is important to create the field access HashSet regardless of the statement (see the local var below)\n            // being null or not, because the rule will not be able to detect field reads from inline property\n            // or field initializers.\n            var fieldAccessInMethod = (IsWrite(fieldReference) ? writesByField : readsByField)\n                .GetOrAdd((IFieldSymbol)fieldReference.Symbol, _ => new Lookup<ISymbol, SyntaxNode>())\n                .GetOrAdd(enclosingSymbol, _ => new HashSet<SyntaxNode>());\n\n            var pseudoStatement = GetParentPseudoStatement(fieldReference);\n            if (pseudoStatement is not null)\n            {\n                fieldAccessInMethod.Add(pseudoStatement);\n            }\n        }\n\n        private static bool IsWrite(NodeAndSymbol fieldReference)\n        {\n            // If the field is not static and is not from the current instance we\n            // consider the reference as read.\n            if (!fieldReference.Symbol.IsStatic && !(fieldReference.Node as ExpressionSyntax).RemoveParentheses().IsOnThis())\n            {\n                return false;\n            }\n\n            return IsLeftSideOfAssignment(fieldReference.Node)\n                   || IsOutArgument(fieldReference.Node);\n\n            bool IsOutArgument(SyntaxNode node) =>\n                node.Parent is ArgumentSyntax argument\n                && argument.RefOrOutKeyword.IsKind(SyntaxKind.OutKeyword);\n\n            bool IsLeftSideOfAssignment(SyntaxNode node) =>\n                node.Parent.IsKind(SyntaxKind.SimpleAssignmentExpression)\n                && node.Parent is AssignmentExpressionSyntax assignmentExpression\n                && assignmentExpression.Left == node;\n        }\n\n        private NodeAndSymbol GetTopmostSyntaxWithTheSameSymbol(SyntaxNode node) =>\n            // All of the cases below could be parts of invocation or other expressions\n            node.Parent switch\n            {\n                // this.identifier or a.identifier or ((a)).identifier, but not identifier.other\n                MemberAccessExpressionSyntax memberAccess when memberAccess.Name == node =>\n                    new NodeAndSymbol(memberAccess.GetSelfOrTopParenthesizedExpression(), model.GetSymbolInfo(memberAccess).Symbol),\n                // this?.identifier or a?.identifier or ((a))?.identifier, but not identifier?.other\n                MemberBindingExpressionSyntax memberBinding when memberBinding.Name == node =>\n                    new NodeAndSymbol(memberBinding.Parent.GetSelfOrTopParenthesizedExpression(), model.GetSymbolInfo(memberBinding).Symbol),\n                // identifier or ((identifier))\n                _ => new NodeAndSymbol(node.GetSelfOrTopParenthesizedExpression(), model.GetSymbolInfo(node).Symbol)\n            };\n    }\n\n    private sealed class Lookup<TKey, TElement> : Dictionary<TKey, HashSet<TElement>> { }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/PrivateStaticMethodUsedOnlyByNestedClass.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class PrivateStaticMethodUsedOnlyByNestedClass : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S3398\";\n    private const string MessageFormat = \"Move this method inside '{0}'.\";\n\n    private static readonly SyntaxKind[] AnalyzedSyntaxKinds =\n    [\n        SyntaxKind.ClassDeclaration,\n        SyntaxKind.StructDeclaration,\n        SyntaxKind.InterfaceDeclaration,\n        SyntaxKindEx.RecordDeclaration,\n        SyntaxKindEx.RecordStructDeclaration\n    ];\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var outerType = (TypeDeclarationSyntax)c.Node;\n\n                if (!IsPartial(outerType)\n                    && HasNestedTypeDeclarations(outerType)\n                    && PrivateStaticMethodsOf(outerType) is { Length: > 0 } candidates)\n                {\n                    var methodReferences = TypesWhichUseTheMethods(candidates, outerType, c.Model);\n\n                    foreach (var reference in methodReferences)\n                    {\n                        var typeToMoveInto = LowestCommonAncestorOrSelf(reference.Types);\n                        if (typeToMoveInto != outerType)\n                        {\n                            var nestedTypeName = typeToMoveInto.Identifier.ValueText;\n                            c.ReportIssue(Rule, reference.Method.Identifier, nestedTypeName);\n                        }\n                    }\n                }\n            },\n            AnalyzedSyntaxKinds);\n\n    private static bool IsPartial(TypeDeclarationSyntax type) =>\n        type.Modifiers.Any(x => x.IsKind(SyntaxKind.PartialKeyword));\n\n    private static bool HasNestedTypeDeclarations(TypeDeclarationSyntax type) =>\n        type.Members\n            .OfType<TypeDeclarationSyntax>()\n            .Any();\n\n    private static MethodDeclarationSyntax[] PrivateStaticMethodsOf(TypeDeclarationSyntax type) =>\n        type.Members\n            .OfType<MethodDeclarationSyntax>()\n            .Where(x => IsPrivateAndStatic(x, type))\n            .ToArray();\n\n    private static bool IsPrivateAndStatic(MethodDeclarationSyntax method, TypeDeclarationSyntax containingType)\n    {\n        return method.Modifiers.Any(x => x.IsKind(SyntaxKind.StaticKeyword))\n            && (IsExplicitlyPrivate() || IsImplicityPrivate());\n\n        bool IsExplicitlyPrivate() =>\n            method.Modifiers.Any(SyntaxKind.PrivateKeyword) && !method.Modifiers.Any(SyntaxKind.ProtectedKeyword);\n\n        // The default accessibility for record class members is private, but for record structs (like all structs) it's internal.\n        bool IsImplicityPrivate() =>\n            !method.Modifiers.Any(x => x.Kind() is SyntaxKind.PublicKeyword or SyntaxKind.ProtectedKeyword or SyntaxKind.InternalKeyword)\n            && IsClassOrRecordClassOrInterfaceDeclaration(containingType);\n\n        static bool IsClassOrRecordClassOrInterfaceDeclaration(TypeDeclarationSyntax type) =>\n            type is ClassDeclarationSyntax or InterfaceDeclarationSyntax\n            || (RecordDeclarationSyntaxWrapper.IsInstance(type) && !((RecordDeclarationSyntaxWrapper)type).ClassOrStructKeyword.IsKind(SyntaxKind.StructKeyword));\n    }\n\n    private static TypeDeclarationSyntax LowestCommonAncestorOrSelf(IEnumerable<TypeDeclarationSyntax> declaredTypes)\n    {\n        var typeHierarchyFromTopToBottom = declaredTypes.Select(PathFromTop);\n        var minPathLength = typeHierarchyFromTopToBottom.Min(x => x.Length);\n        var firstPath = typeHierarchyFromTopToBottom.First();\n\n        var lastCommonPathIndex = 0;\n        for (var i = 0; i < minPathLength; i++)\n        {\n            var isPartOfCommonPath = typeHierarchyFromTopToBottom.All(x => x[i] == firstPath[i]);\n            if (isPartOfCommonPath)\n            {\n                lastCommonPathIndex = i;\n            }\n            else\n            {\n                break;\n            }\n        }\n\n        return firstPath[lastCommonPathIndex];\n\n        static TypeDeclarationSyntax[] PathFromTop(SyntaxNode node) =>\n            node.AncestorsAndSelf()\n                .OfType<TypeDeclarationSyntax>()\n                .Where(x => x.Kind() is not SyntaxKindEx.ExtensionBlockDeclaration)\n                .Distinct()\n                .Reverse()\n                .ToArray();\n    }\n\n    private static IEnumerable<MethodUsedByTypes> TypesWhichUseTheMethods(\n        IEnumerable<MethodDeclarationSyntax> methods, TypeDeclarationSyntax outerType, SemanticModel model)\n    {\n        var collector = new PotentialMethodReferenceCollector(methods);\n        collector.SafeVisit(outerType);\n\n        return collector.PotentialMethodReferences\n            .Where(x => !OnlyUsedByOuterType(x))\n            .Select(DeclaredTypesWhichActuallyUseTheMethod)\n            .Where(x => x.Types.Any())\n            .ToArray();\n\n        MethodUsedByTypes DeclaredTypesWhichActuallyUseTheMethod(MethodWithPotentialReferences m)\n        {\n            var methodSymbol = model.GetDeclaredSymbol(m.Method);\n\n            var typesWhichUseTheMethod = m.PotentialReferences\n                .Where(x =>\n                    !IsRecursiveMethodCall(x, m.Method)\n                    && model.GetSymbolOrCandidateSymbol(x) is IMethodSymbol { } methodReference\n                    && (methodReference.Equals(methodSymbol) || methodReference.ConstructedFrom.Equals(methodSymbol)))\n                .Select(ContainingTypeDeclaration)\n                .Distinct()\n                .ToArray();\n\n            return new MethodUsedByTypes(m.Method, typesWhichUseTheMethod);\n        }\n\n        bool IsRecursiveMethodCall(IdentifierNameSyntax methodCall, MethodDeclarationSyntax methodDeclaration) =>\n            methodCall.Ancestors().OfType<MethodDeclarationSyntax>().FirstOrDefault() == methodDeclaration;\n\n        bool OnlyUsedByOuterType(MethodWithPotentialReferences m) =>\n            m.PotentialReferences.All(x => ContainingTypeDeclaration(x) == outerType);\n\n        static TypeDeclarationSyntax ContainingTypeDeclaration(IdentifierNameSyntax identifier) =>\n            identifier\n                .Ancestors()\n                .OfType<TypeDeclarationSyntax>()\n                .First();\n    }\n\n    private sealed record MethodWithPotentialReferences(MethodDeclarationSyntax Method, IdentifierNameSyntax[] PotentialReferences);\n\n    private sealed record MethodUsedByTypes(MethodDeclarationSyntax Method, TypeDeclarationSyntax[] Types);\n\n    /// <summary>\n    /// Collects all the potential references to a set of methods inside the given syntax node.\n    /// The collector looks for identifiers which match any of the methods' names, but does not try to resolve them to symbols with the semantic model.\n    /// Performance gains: by only using the syntax tree to find matches we can eliminate certain methods (which are only used by the type which has declared it)\n    /// without using the more costly symbolic lookup.\n    /// </summary>\n    private sealed class PotentialMethodReferenceCollector : SafeCSharpSyntaxWalker\n    {\n        private readonly ISet<MethodDeclarationSyntax> methodsToFind;\n        private readonly Dictionary<MethodDeclarationSyntax, List<IdentifierNameSyntax>> potentialMethodReferences;\n\n        public IEnumerable<MethodWithPotentialReferences> PotentialMethodReferences => potentialMethodReferences.Select(x => new MethodWithPotentialReferences(x.Key, x.Value.ToArray()));\n\n        public PotentialMethodReferenceCollector(IEnumerable<MethodDeclarationSyntax> methodsToFind)\n        {\n            this.methodsToFind = new HashSet<MethodDeclarationSyntax>(methodsToFind);\n            potentialMethodReferences = [];\n        }\n\n        public override void VisitIdentifierName(IdentifierNameSyntax node)\n        {\n            if (methodsToFind.FirstOrDefault(x => x.Identifier.ValueText == node.Identifier.ValueText) is { } method)\n            {\n                var referenceList = potentialMethodReferences.GetOrAdd(method, _ => []);\n                referenceList.Add(node);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/PropertiesAccessCorrectField.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class PropertiesAccessCorrectField : PropertiesAccessCorrectFieldBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override IEnumerable<FieldData> FindFieldAssignments(IPropertySymbol property, Compilation compilation)\n    {\n        if (property.SetMethod.GetFirstSyntaxRef() is not AccessorDeclarationSyntax setter)\n        {\n            return [];\n        }\n\n        // we only keep information for the first location of the symbol\n        var assignments = new Dictionary<IFieldSymbol, FieldData>();\n        FillAssignments(assignments, compilation, setter, true);\n\n        // If there're no candidate variables, we'll try to inspect one local method invocation with value as argument\n        if (assignments.Count == 0\n            && (setter.ExpressionBody?.Expression ?? SingleInvocation(setter.Body)) is { } expression\n            && FindInvokedMethod(compilation, property.ContainingType, expression) is MethodDeclarationSyntax invokedMethod)\n        {\n            FillAssignments(assignments, compilation, invokedMethod, false);\n        }\n\n        return assignments.Values;\n    }\n\n    protected override IEnumerable<FieldData> FindFieldReads(IPropertySymbol property, Compilation compilation)\n    {\n        // We don't handle properties with multiple returns that return different fields\n        if (property.GetMethod.GetFirstSyntaxRef() is not AccessorDeclarationSyntax getter)\n        {\n            return [];\n        }\n\n        var reads = new Dictionary<IFieldSymbol, FieldData>();\n        FillReads(getter, true);\n\n        // If there're no candidate variables, we'll try inspect one return of local method invocation\n        if (reads.Count == 0\n            && (getter.ExpressionBody?.Expression ?? SingleReturn(getter.Body)) is InvocationExpressionSyntax returnExpression\n            && FindInvokedMethod(compilation, property.ContainingType, returnExpression) is MethodDeclarationSyntax invokedMethod)\n        {\n            FillReads(invokedMethod, false);\n        }\n        return reads.Values;\n\n        void FillReads(SyntaxNode root, bool useFieldLocation)\n        {\n            var notAssigned = root.DescendantNodes().OfType<ExpressionSyntax>().Where(x => !IsLeftSideOfAssignment(x));\n            foreach (var expression in notAssigned)\n            {\n                var readField = ExtractFieldFromExpression(AccessorKind.Getter, expression, compilation, useFieldLocation);\n                // we only keep information for the first location of the symbol\n                if (readField.HasValue && !reads.ContainsKey(readField.Value.Field))\n                {\n                    reads.Add(readField.Value.Field, readField.Value);\n                }\n            }\n        }\n    }\n\n    protected override bool ShouldIgnoreAccessor(IMethodSymbol accessorMethod, Compilation compilation)\n    {\n        if (accessorMethod.GetFirstSyntaxRef() is not AccessorDeclarationSyntax accessor\n            || ((SyntaxNode)accessor.Body ?? accessor).ContainsGetOrSetOnDependencyProperty(compilation)\n            || AccessesSelfBaseProperty(accessorMethod, accessor, compilation))\n        {\n            return true;\n        }\n\n        // Special case: ignore the accessor if the only statement/expression is a throw.\n        if (accessor.Body is null)\n        {\n            // Expression-bodied syntax\n            return accessor.ExpressionBody is { } arrowClause && ThrowExpressionSyntaxWrapper.IsInstance(arrowClause.Expression);\n        }\n\n        // Statement-bodied syntax\n        return accessor.Body.DescendantNodes().Count(x => x is StatementSyntax) == 1 && accessor.Body.DescendantNodes().Count(x => x is ThrowStatementSyntax) == 1;\n    }\n\n    protected override bool ImplementsExplicitGetterOrSetter(IPropertySymbol property) =>\n        HasExplicitAccessor(property.SetMethod)\n        || HasExplicitAccessor(property.GetMethod);\n\n    private static void FillAssignments(IDictionary<IFieldSymbol, FieldData> assignments, Compilation compilation, SyntaxNode root, bool useFieldLocation)\n    {\n        foreach (var node in root.DescendantNodes())\n        {\n            FieldData? foundField = null;\n            if (node is AssignmentExpressionSyntax assignment)\n            {\n                foundField = assignment.Left.DescendantNodesAndSelf().OfType<ExpressionSyntax>()\n                    .Select(x => ExtractFieldFromExpression(AccessorKind.Setter, x, compilation, useFieldLocation))\n                    .FirstOrDefault(x => x is not null);\n            }\n            else if (node is ArgumentSyntax argument && argument.RefOrOutKeyword.Kind() is SyntaxKind.RefKeyword or SyntaxKind.OutKeyword)\n            {\n                foundField = ExtractFieldFromExpression(AccessorKind.Setter, argument.Expression, compilation, useFieldLocation);\n            }\n            if (foundField.HasValue && !assignments.ContainsKey(foundField.Value.Field))\n            {\n                assignments.Add(foundField.Value.Field, foundField.Value);\n            }\n        }\n    }\n\n    private static ExpressionSyntax SingleReturn(SyntaxNode body)\n    {\n        if (body is null)\n        {\n            return null;\n        }\n\n        var returns = body.DescendantNodes().OfType<ReturnStatementSyntax>().ToArray();\n        return returns.Length == 1 ? returns.Single().Expression : null;\n    }\n\n    private static ExpressionSyntax SingleInvocation(SyntaxNode body)\n    {\n        if (body is null)\n        {\n            return null;\n        }\n\n        var expressions = body.DescendantNodes().OfType<InvocationExpressionSyntax>().Select(x => x.Expression).ToArray();\n        if (expressions.Length == 1)\n        {\n            var expr = expressions.Single();\n            if (expr is IdentifierNameSyntax or MemberAccessExpressionSyntax { Expression: ThisExpressionSyntax })\n            {\n                return expr;\n            }\n        }\n        return null;\n    }\n\n    private static FieldData? ExtractFieldFromExpression(AccessorKind accessorKind, ExpressionSyntax expression, Compilation compilation, bool useFieldLocation)\n    {\n        var model = compilation.GetSemanticModel(expression.SyntaxTree);\n        if (model is null)\n        {\n            return null;\n        }\n\n        var strippedExpression = expression.RemoveParentheses();\n\n        // Check for direct field access: \"foo\"\n        if (strippedExpression is IdentifierNameSyntax\n            && model.GetSymbolInfo(strippedExpression).Symbol is IFieldSymbol directAccessField)\n        {\n            return new FieldData(accessorKind, directAccessField, strippedExpression, useFieldLocation);\n        }\n        // Check for \"this.foo\"\n        else if (strippedExpression is MemberAccessExpressionSyntax { Expression: ThisExpressionSyntax } member && model.GetSymbolInfo(strippedExpression).Symbol is IFieldSymbol fieldAccessedWithThis)\n        {\n            return new FieldData(accessorKind, fieldAccessedWithThis, member.Name, useFieldLocation);\n        }\n        else if (strippedExpression is AssignmentExpressionSyntax assignmentExpression\n            && assignmentExpression.Parent is ReturnStatementSyntax\n            && model.GetSymbolInfo(assignmentExpression.Left).Symbol is IFieldSymbol fieldAssignedFromExpression)\n        {\n            return new FieldData(accessorKind, fieldAssignedFromExpression, assignmentExpression.Left, useFieldLocation);\n        }\n\n        return null;\n    }\n\n    private static bool IsLeftSideOfAssignment(ExpressionSyntax expression)\n    {\n        var strippedExpression = expression.RemoveParentheses();\n        return strippedExpression.IsLeftSideOfAssignment()\n            || (strippedExpression.Parent is ExpressionSyntax parent && parent.IsLeftSideOfAssignment()); // for this.field\n    }\n\n    private static bool HasExplicitAccessor(ISymbol symbol) =>\n        symbol.GetFirstSyntaxRef() is AccessorDeclarationSyntax accessor\n        && accessor.DescendantNodes().Any();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/PropertiesShouldBePreferred.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Collections;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class PropertiesShouldBePreferred : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S4049\";\n        private const string MessageFormat = \"Consider making method '{0}' a property.\";\n\n        private static readonly DiagnosticDescriptor Rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n                {\n                    if (c.IsRedundantPositionalRecordContext()\n                        || c.Model.GetDeclaredSymbol(c.Node) is not INamedTypeSymbol typeSymbol)\n                    {\n                        return;\n                    }\n\n                    var propertyCandidates = typeSymbol\n                        .GetMembers()\n                        .OfType<IMethodSymbol>()\n                        .Where(x => HasCandidateName(x) && HasCandidateReturnType(x) && HasCandidateSignature(x) && UsageAttributesAllowProperties(x) && !x.IsGenericMethod);\n\n                    foreach (var candidate in propertyCandidates)\n                    {\n                        c.ReportIssue(Rule, candidate.Locations.FirstOrDefault(), candidate.Name);\n                    }\n                },\n                SyntaxKind.ClassDeclaration,\n                SyntaxKind.InterfaceDeclaration,\n                SyntaxKind.StructDeclaration,\n                SyntaxKindEx.RecordDeclaration,\n                SyntaxKindEx.RecordStructDeclaration);\n\n        private static bool HasCandidateSignature(IMethodSymbol method) =>\n            method.IsPubliclyAccessible()\n            && method.Parameters.Length == 0\n            && !method.IsConstructor()\n            && !method.IsOverride\n            && method.MethodKind != MethodKind.PropertyGet\n            && method.InterfaceMembers().IsEmpty();\n\n        private static bool HasCandidateReturnType(IMethodSymbol method) =>\n            !method.ReturnsVoid\n            && !method.IsAsync\n            && !method.ReturnType.Is(TypeKind.Array)\n            && !method.ReturnType.OriginalDefinition.IsAny(KnownType.SystemTasks);\n\n        private static bool HasCandidateName(IMethodSymbol method)\n        {\n            if (method.Name is nameof(IEnumerable.GetEnumerator) or nameof(Task.GetAwaiter))\n            {\n                return false;\n            }\n            var nameParts = method.Name.SplitCamelCaseToWords().ToList();\n            return nameParts.Count > 1 && nameParts[0] == \"GET\";\n        }\n\n        private static bool UsageAttributesAllowProperties(IMethodSymbol method) =>\n            method.GetAttributes()\n                .Select(attribute => attribute.AttributeClass)\n                .SelectMany(cls => cls.GetAttributes(KnownType.System_AttributeUsageAttribute))\n                .Select(attr => attr.ConstructorArguments[0].Value)\n                .Cast<AttributeTargets>()\n                .All(targets => targets.HasFlag(AttributeTargets.Property));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/PropertyGetterWithThrow.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class PropertyGetterWithThrow : PropertyGetterWithThrowBase<SyntaxKind, AccessorDeclarationSyntax>\n    {\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override SyntaxKind ThrowSyntaxKind => SyntaxKind.ThrowStatement;\n\n        protected override bool IsGetter(AccessorDeclarationSyntax propertyGetter) =>\n            propertyGetter.IsKind(SyntaxKind.GetAccessorDeclaration);\n        protected override bool IsIndexer(AccessorDeclarationSyntax propertyGetter) =>\n            propertyGetter.Parent.Parent is IndexerDeclarationSyntax;\n\n        protected override SyntaxNode GetThrowExpression(SyntaxNode syntaxNode) =>\n            ((ThrowStatementSyntax)syntaxNode).Expression;\n\n        protected override GeneratedCodeRecognizer GeneratedCodeRecognizer =>\n            CSharpGeneratedCodeRecognizer.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/PropertyNamesShouldNotMatchGetMethods.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class PropertyNamesShouldNotMatchGetMethods : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S4059\";\n    private const string MessageFormat = \"Change either the name of property '{0}' or the name of method '{1}' to make them distinguishable.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterSymbolAction(c => // Invoked twice for partial properties: once for the property declaration and one for the implementation\n        {\n            var propertySymbol = (IPropertySymbol)c.Symbol;\n            if (!propertySymbol.IsPubliclyAccessible() || propertySymbol.IsOverride)\n            {\n                return;\n            }\n            var methods =  propertySymbol.ContainingType.GetMembers().OfType<IMethodSymbol>().Where(x => x.IsPubliclyAccessible()).ToArray();\n            if (Array.Find(methods, x => AreCollidingNames(propertySymbol.Name, x.Name)) is { } collidingMethod)\n            {\n                // When dealing with partial properties, IsPartialDefinition is true only for the declaration, we use this to avoid reporting the secondary location twice\n                List<SecondaryLocation> secondaryLocation = propertySymbol.IsPartialDefinition() ? [] : [new(collidingMethod.Locations.First(), string.Empty)];\n                c.ReportIssue(Rule, propertySymbol.Locations.First(), secondaryLocation, propertySymbol.Name, collidingMethod.Name);\n            }\n        }, SymbolKind.Property);\n\n    private static bool AreCollidingNames(string propertyName, string methodName) =>\n        methodName.Equals(propertyName, StringComparison.OrdinalIgnoreCase) || methodName.Equals(\"Get\" + propertyName, StringComparison.OrdinalIgnoreCase);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/PropertyToAutoProperty.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class PropertyToAutoProperty : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S2292\";\n    private const string MessageFormat = \"Make this an auto-implemented property and remove its backing field.\";\n    private const int AccessorCount = 2;\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            c =>\n            {\n                var propertyDeclaration = (PropertyDeclarationSyntax)c.Node;\n\n                if ((propertyDeclaration.AccessorList?.Accessors is { Count: AccessorCount } accessors\n                        && !HasDifferentModifiers(accessors)\n                        && !HasAttributes(accessors)\n                        && !propertyDeclaration.Modifiers.Any(SyntaxKind.PartialKeyword)\n                        && accessors.FirstOrDefault(x => x.IsKind(SyntaxKind.GetAccessorDeclaration)) is { } getter\n                        && accessors.FirstOrDefault(x => x.Kind() is SyntaxKind.SetAccessorDeclaration or SyntaxKindEx.InitAccessorDeclaration) is { } setter\n                        && FieldFromGetter(getter, c.Model) is { } getterField\n                        && FieldFromSetter(setter, c.Model) is { } setterField\n                        && getterField.Equals(setterField)\n                        && !getterField.GetAttributes().Any()\n                        && !getterField.IsVolatile\n                        && c.Model.GetDeclaredSymbol(propertyDeclaration) is { } propertySymbol\n                        && getterField.IsStatic == propertySymbol.IsStatic\n                        && getterField.Type.Equals(propertySymbol.Type))\n                    || (propertyDeclaration.ExpressionBody is ArrowExpressionClauseSyntax expression && expression.Expression.IsKind(SyntaxKindEx.FieldExpression)))\n                {\n                    c.ReportIssue(Rule, propertyDeclaration.Identifier);\n                }\n            },\n            SyntaxKind.PropertyDeclaration);\n\n    private static bool HasAttributes(SyntaxList<AccessorDeclarationSyntax> accessors) =>\n        accessors.Any(x => x.AttributeLists.Any());\n\n    private static bool HasDifferentModifiers(SyntaxList<AccessorDeclarationSyntax> accessors)\n    {\n        var modifiers = ModifierKinds(accessors.First()).ToHashSet();\n        return accessors.Skip(1).Any(x => !modifiers.SetEquals(ModifierKinds(x)));\n    }\n\n    private static IEnumerable<SyntaxKind> ModifierKinds(AccessorDeclarationSyntax accessor) =>\n        accessor.Modifiers.Select(x => x.Kind());\n\n    private static IFieldSymbol FieldFromSetter(AccessorDeclarationSyntax setter, SemanticModel model)\n    {\n        var assignment = AssignmentFromBody(setter.Body) ?? AssignmentFromExpressionBody(setter.ExpressionBody);\n\n        return assignment is { RawKind: (int)SyntaxKind.SimpleAssignmentExpression, Right: { } right }\n            && model.GetSymbolInfo(right).Symbol is IParameterSymbol { Name: \"value\", IsImplicitlyDeclared: true }\n                ? FieldSymbol(assignment.Left, model.GetDeclaredSymbol(setter).ContainingType, model)\n                : null;\n\n        AssignmentExpressionSyntax AssignmentFromBody(BlockSyntax body) =>\n            body?.Statements.Count == 1 && body.Statements[0] is ExpressionStatementSyntax statement\n                ? statement.Expression as AssignmentExpressionSyntax\n                : null;\n\n        AssignmentExpressionSyntax AssignmentFromExpressionBody(ArrowExpressionClauseSyntax expressionBody) =>\n            expressionBody?.ChildNodes().Count() == 1\n                ? expressionBody.ChildNodes().Single() as AssignmentExpressionSyntax\n                : null;\n    }\n\n    private static IFieldSymbol FieldSymbol(ExpressionSyntax expression, INamedTypeSymbol declaringType, SemanticModel model) =>\n        expression switch\n        {\n            IdentifierNameSyntax => model.GetSymbolInfo(expression).Symbol as IFieldSymbol,\n            MemberAccessExpressionSyntax { RawKind: (int)SyntaxKind.SimpleMemberAccessExpression, Expression: ThisExpressionSyntax } => model.GetSymbolInfo(expression).Symbol as IFieldSymbol,\n            MemberAccessExpressionSyntax { RawKind: (int)SyntaxKind.SimpleMemberAccessExpression, Expression: IdentifierNameSyntax identifier }\n                when model.GetSymbolInfo(identifier).Symbol is INamedTypeSymbol type && type.Equals(declaringType) => model.GetSymbolInfo(expression).Symbol as IFieldSymbol,\n            { RawKind: (int)SyntaxKindEx.FieldExpression } => model.GetSymbolInfo(expression).Symbol as IFieldSymbol,\n            _ => null\n        };\n\n    private static IFieldSymbol FieldFromGetter(AccessorDeclarationSyntax getter, SemanticModel model)\n    {\n        var returnedExpression = ReturnExpression(getter.Body) ?? getter.ExpressionBody?.Expression;\n\n        return returnedExpression is null\n            ? null\n            : FieldSymbol(returnedExpression, model.GetDeclaredSymbol(getter).ContainingType, model);\n\n        static ExpressionSyntax ReturnExpression(BlockSyntax body) =>\n            body is not null && body.Statements.Count == 1 && body.Statements[0] is ReturnStatementSyntax returnStatement\n                ? returnStatement.Expression\n                : null;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/PropertyWriteOnly.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class PropertyWriteOnly : PropertyWriteOnlyBase<SyntaxKind, PropertyDeclarationSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n        protected override SyntaxKind SyntaxKind => SyntaxKind.PropertyDeclaration;\n\n        protected override bool IsWriteOnlyProperty(PropertyDeclarationSyntax prop)\n        {\n            var accessors = prop.AccessorList;\n            return accessors is {Accessors: {Count: 1}}\n                   && accessors.Accessors.First().Kind() is SyntaxKind.SetAccessorDeclaration or SyntaxKindEx.InitAccessorDeclaration\n                   && !prop.Modifiers.Any(SyntaxKind.OverrideKeyword); // the get may be in the base class\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ProvideDeserializationMethodsForOptionalFields.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class ProvideDeserializationMethodsForOptionalFields : ProvideDeserializationMethodsForOptionalFieldsBase\n    {\n        protected override ILanguageFacade Language => CSharpFacade.Instance;\n\n        protected override Location GetNamedTypeIdentifierLocation(SyntaxNode node) =>\n            ((TypeDeclarationSyntax)node).Identifier.GetLocation();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/PublicConstantField.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class PublicConstantField : PublicConstantFieldBase<SyntaxKind, FieldDeclarationSyntax, VariableDeclaratorSyntax>\n    {\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        public override SyntaxKind FieldDeclarationKind => SyntaxKind.FieldDeclaration;\n        public override string MessageArgument => \"'static' read-only\";\n\n        protected override Location GetReportLocation(VariableDeclaratorSyntax node) =>\n            node.Identifier.GetLocation();\n\n        protected override IEnumerable<VariableDeclaratorSyntax> GetVariables(FieldDeclarationSyntax node) =>\n            node.Declaration.Variables;\n\n        protected override GeneratedCodeRecognizer GeneratedCodeRecognizer => CSharpGeneratedCodeRecognizer.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/PublicMethodWithMultidimensionalArray.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class PublicMethodWithMultidimensionalArray : PublicMethodWithMultidimensionalArrayBase<SyntaxKind>\n{\n    private static readonly ImmutableArray<SyntaxKind> KindsOfInterest = ImmutableArray.Create(\n        SyntaxKind.MethodDeclaration,\n        SyntaxKind.ConstructorDeclaration,\n        SyntaxKind.ClassDeclaration,\n        SyntaxKind.StructDeclaration,\n        SyntaxKindEx.RecordDeclaration,\n        SyntaxKindEx.RecordStructDeclaration);\n\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n    protected override ImmutableArray<SyntaxKind> SyntaxKindsOfInterest => KindsOfInterest;\n\n    protected override Location GetIssueLocation(SyntaxNode node) =>\n        Language.Syntax.NodeIdentifier(node)?.GetLocation();\n\n    protected override string GetType(SyntaxNode node) =>\n        node is MethodDeclarationSyntax ? \"method\" : \"constructor\";\n\n    protected override IMethodSymbol MethodSymbolOfNode(SemanticModel semanticModel, SyntaxNode node) =>\n        node is TypeDeclarationSyntax typeDeclaration\n            ? typeDeclaration.PrimaryConstructor(semanticModel)\n            : base.MethodSymbolOfNode(semanticModel, node);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/PureAttributeOnVoidMethod.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class PureAttributeOnVoidMethod : PureAttributeOnVoidMethodBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        base.Initialize(context);\n        context.RegisterNodeAction(\n            c =>\n            {\n                var localFunction = (LocalFunctionStatementSyntaxWrapper)c.Node;\n                if (localFunction.AttributeLists.SelectMany(x => x.Attributes).Any(IsPureAttribute)\n                    && InvalidPureDataAttributeUsage((IMethodSymbol)c.Model.GetDeclaredSymbol(c.Node)) is { } pureAttribute)\n                {\n                    c.ReportIssue(Rule, pureAttribute.ApplicationSyntaxReference.GetSyntax());\n                }\n            },\n            SyntaxKindEx.LocalFunctionStatement);\n    }\n\n    private static bool IsPureAttribute(AttributeSyntax attribute) =>\n        attribute.Name.GetIdentifier() is { ValueText: \"Pure\" or \"PureAttribute\" };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/RedundancyInConstructorDestructorDeclaration.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class RedundancyInConstructorDestructorDeclaration : SonarDiagnosticAnalyzer\n{\n    internal const string DiagnosticId = \"S3253\";\n    private const string MessageFormat = \"Remove this redundant {0}.\";\n\n    private static readonly SyntaxKind[] TypesWithPrimaryConstructorDeclarations =\n    [\n        SyntaxKind.ClassDeclaration,\n        SyntaxKind.StructDeclaration,\n        SyntaxKindEx.RecordDeclaration,\n        SyntaxKindEx.RecordStructDeclaration\n    ];\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(CheckConstructorDeclaration, SyntaxKind.ConstructorDeclaration);\n        context.RegisterNodeAction(CheckDestructorDeclaration, SyntaxKind.DestructorDeclaration);\n        context.RegisterNodeAction(CheckTypesWithPrimaryConstructor, TypesWithPrimaryConstructorDeclarations);\n    }\n\n    private static void CheckTypesWithPrimaryConstructor(SonarSyntaxNodeReportingContext context)\n    {\n        var typeDeclaration = (TypeDeclarationSyntax)context.Node;\n        if (!IsInheritingFromTypeWithValueInPrimaryConstructor(typeDeclaration)\n            && typeDeclaration.ParameterList() is { Parameters.Count: 0 } parameterList\n            && !IsStructWithInitializedFieldOrProperty(typeDeclaration, context.Model))\n        {\n            context.ReportIssue(Rule, parameterList, \"primary constructor\");\n        }\n\n        static bool IsInheritingFromTypeWithValueInPrimaryConstructor(TypeDeclarationSyntax node) =>\n            node.BaseList is { } baseList\n            && baseList.DescendantNodes().OfType<ArgumentSyntax>().Any();\n    }\n\n    private static void CheckDestructorDeclaration(SonarSyntaxNodeReportingContext context)\n    {\n        var destructorDeclaration = (DestructorDeclarationSyntax)context.Node;\n\n        if (destructorDeclaration.Body is { Statements.Count: 0 })\n        {\n            context.ReportIssue(Rule, destructorDeclaration, \"destructor\");\n        }\n    }\n\n    private static void CheckConstructorDeclaration(SonarSyntaxNodeReportingContext context)\n    {\n        var constructorDeclaration = (ConstructorDeclarationSyntax)context.Node;\n\n        if (IsConstructorRedundant(constructorDeclaration, context.Model))\n        {\n            context.ReportIssue(Rule, constructorDeclaration, \"constructor\");\n            return;\n        }\n\n        var initializer = constructorDeclaration.Initializer;\n        if (initializer is not null && IsInitializerRedundant(initializer))\n        {\n            context.ReportIssue(Rule, initializer, \"'base()' call\");\n        }\n    }\n\n    private static bool IsInitializerRedundant(ConstructorInitializerSyntax initializer) =>\n        initializer.IsKind(SyntaxKind.BaseConstructorInitializer)\n        && initializer.ArgumentList is not null\n        && !initializer.ArgumentList.Arguments.Any();\n\n    private static bool IsConstructorRedundant(ConstructorDeclarationSyntax constructorDeclaration, SemanticModel model) =>\n        constructorDeclaration is { ParameterList.Parameters.Count: 0, Body.Statements.Count: 0, Parent: BaseTypeDeclarationSyntax typeDeclaration }\n        && !IsStructWithInitializedFieldOrProperty(typeDeclaration, model)\n        && (IsSinglePublicConstructor(constructorDeclaration, model)\n            || constructorDeclaration.Modifiers.Any(SyntaxKind.StaticKeyword));\n\n    private static bool IsStructWithInitializedFieldOrProperty(BaseTypeDeclarationSyntax typeDeclaration, SemanticModel model) =>\n        typeDeclaration.Kind() is SyntaxKind.StructDeclaration or SyntaxKindEx.RecordStructDeclaration\n        && model.GetDeclaredSymbol(typeDeclaration) is { } typeSymbol\n        && typeSymbol.GetMembers().Any(x => x.Kind is SymbolKind.Field or SymbolKind.Property && x.DeclaringSyntaxReferences.Any(x => x.GetSyntax().GetInitializer() is not null));\n\n    private static bool IsSinglePublicConstructor(ConstructorDeclarationSyntax constructorDeclaration, SemanticModel model) =>\n        constructorDeclaration.Modifiers.Any(SyntaxKind.PublicKeyword)\n        && IsInitializerEmptyOrRedundant(constructorDeclaration.Initializer)\n        && constructorDeclaration is { Parent: BaseTypeDeclarationSyntax typeDeclaration }\n        && TypeHasExactlyOneConstructor(typeDeclaration, model);\n\n    private static bool IsInitializerEmptyOrRedundant(ConstructorInitializerSyntax initializer) =>\n        initializer is null || (initializer.ArgumentList.Arguments.Count == 0 && initializer.ThisOrBaseKeyword.IsKind(SyntaxKind.BaseKeyword));\n\n    private static bool TypeHasExactlyOneConstructor(BaseTypeDeclarationSyntax containingTypeDeclaration, SemanticModel model) =>\n        model.GetDeclaredSymbol(containingTypeDeclaration) is { } typeSymbol\n        && typeSymbol.GetMembers(\".ctor\").OfType<IMethodSymbol>().Count(x => x is { MethodKind: MethodKind.Constructor, IsImplicitlyDeclared: false, IsStatic: false }) == 1;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/RedundancyInConstructorDestructorDeclarationCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class RedundancyInConstructorDestructorDeclarationCodeFix : SonarCodeFix\n    {\n        internal const string TitleRemoveBaseCall = \"Remove 'base()' call\";\n        internal const string TitleRemoveConstructor = \"Remove constructor\";\n        internal const string TitleRemoveDestructor = \"Remove destructor\";\n\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(RedundancyInConstructorDestructorDeclaration.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            var syntaxNode = root.FindNode(diagnosticSpan);\n            if (syntaxNode is ConstructorInitializerSyntax initializer)\n            {\n                RegisterActionForBaseCall(context, root, initializer);\n                return Task.CompletedTask;\n            }\n\n            var method = syntaxNode.FirstAncestorOrSelf<BaseMethodDeclarationSyntax>();\n\n            if (method is ConstructorDeclarationSyntax)\n            {\n                RegisterActionForConstructor(context, root, method);\n                return Task.CompletedTask;\n            }\n\n            if (method is DestructorDeclarationSyntax)\n            {\n                RegisterActionForDestructor(context, root, method);\n            }\n\n            return Task.CompletedTask;\n        }\n\n        private static void RegisterActionForDestructor(SonarCodeFixContext context, SyntaxNode root, SyntaxNode method) =>\n            context.RegisterCodeFix(TitleRemoveDestructor,\n                                    c =>\n                                    {\n                                        var newRoot = root.RemoveNode(method, SyntaxRemoveOptions.KeepNoTrivia);\n                                        return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                                    },\n                                    context.Diagnostics);\n\n        private static void RegisterActionForConstructor(SonarCodeFixContext context, SyntaxNode root, SyntaxNode method) =>\n            context.RegisterCodeFix(TitleRemoveConstructor,\n                                    c =>\n                                    {\n                                        var newRoot = root.RemoveNode(method, SyntaxRemoveOptions.KeepNoTrivia);\n                                        return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                                    },\n                                    context.Diagnostics);\n\n        private static void RegisterActionForBaseCall(SonarCodeFixContext context, SyntaxNode root, SyntaxNode initializer)\n        {\n            if (!(initializer.Parent is ConstructorDeclarationSyntax constructor))\n            {\n                return;\n            }\n\n            context.RegisterCodeFix(TitleRemoveBaseCall,\n                                    c =>\n                                    {\n                                        var newRoot = RemoveInitializer(root, constructor);\n                                        return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                                    },\n                                    context.Diagnostics);\n        }\n\n        private static SyntaxNode RemoveInitializer(SyntaxNode root, ConstructorDeclarationSyntax constructor)\n        {\n            var annotation = new SyntaxAnnotation();\n            var ctor = constructor;\n            var newRoot = root;\n            newRoot = newRoot.ReplaceNode(ctor, ctor.WithAdditionalAnnotations(annotation));\n            ctor = GetConstructor(newRoot, annotation);\n            var initializer = ctor.Initializer;\n\n            if (RedundantInheritanceListCodeFix.HasLineEnding(constructor.ParameterList))\n            {\n                newRoot = newRoot.RemoveNode(initializer, SyntaxRemoveOptions.KeepNoTrivia);\n                ctor = GetConstructor(newRoot, annotation);\n\n                if (ctor.Body is {HasLeadingTrivia: true})\n                {\n                    var lastTrivia = ctor.Body.GetLeadingTrivia().Last();\n                    var newBody = lastTrivia.IsKind(SyntaxKind.EndOfLineTrivia)\n                        ? ctor.Body.WithoutLeadingTrivia()\n                        : ctor.Body.WithLeadingTrivia(lastTrivia);\n\n                    newRoot = newRoot.ReplaceNode(ctor.Body, newBody);\n                }\n            }\n            else\n            {\n                var trailingTrivia = SyntaxFactory.TriviaList();\n                if (initializer.HasTrailingTrivia)\n                {\n                    trailingTrivia = initializer.GetTrailingTrivia();\n                }\n                newRoot = newRoot.RemoveNode(initializer, SyntaxRemoveOptions.KeepNoTrivia);\n                ctor = GetConstructor(newRoot, annotation);\n\n                if (ctor.Body is {HasLeadingTrivia: true})\n                {\n                    var lastTrivia = ctor.Body.GetLeadingTrivia().Last();\n                    newRoot = newRoot.ReplaceNode(ctor.Body, ctor.Body.WithLeadingTrivia(trailingTrivia.Add(lastTrivia)));\n                }\n                else\n                {\n                    if (initializer.HasTrailingTrivia)\n                    {\n                        newRoot = newRoot.ReplaceNode(ctor.ParameterList, ctor.ParameterList.WithTrailingTrivia(trailingTrivia));\n                    }\n                }\n            }\n\n            ctor = GetConstructor(newRoot, annotation);\n            return newRoot.ReplaceNode(ctor, ctor.WithoutAnnotations(annotation));\n        }\n\n        private static ConstructorDeclarationSyntax GetConstructor(SyntaxNode newRoot, SyntaxAnnotation annotation) =>\n            (ConstructorDeclarationSyntax)newRoot.GetAnnotatedNodes(annotation).First();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/RedundantArgument.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class RedundantArgument : SonarDiagnosticAnalyzer\n{\n    internal const string DiagnosticId = \"S3254\";\n    private const string MessageFormat = \"Remove this default value assigned to parameter '{0}'.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    internal static bool ArgumentHasDefaultValue(NodeAndSymbol<ArgumentSyntax, IParameterSymbol> argumentMapping, SemanticModel model) =>\n        argumentMapping.Symbol.HasExplicitDefaultValue\n        && model.GetConstantValue(argumentMapping.Node.Expression) is { HasValue: true } argumentValue\n        && Equals(argumentValue.Value, argumentMapping.Symbol.ExplicitDefaultValue);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            c =>\n            {\n                if (c.Node.ArgumentList() is { Arguments.Count: > 0 } argumentList\n                    && !c.IsRedundantPrimaryConstructorBaseTypeContext()\n                    && !c.IsInExpressionTree() // Can't use optional arguments in expression trees (CS0584), so skip those\n                    && new CSharpMethodParameterLookup(argumentList, c.Model) is { MethodSymbol: not null } methodParameterLookup)\n                {\n                    ProcessArgumentMappings(c, methodParameterLookup);\n                }\n            },\n            SyntaxKind.InvocationExpression,\n            SyntaxKind.ObjectCreationExpression,\n            SyntaxKindEx.ImplicitObjectCreationExpression,\n            SyntaxKind.BaseConstructorInitializer,\n            SyntaxKind.ThisConstructorInitializer,\n            SyntaxKindEx.PrimaryConstructorBaseType);\n\n    private static void ProcessArgumentMappings(SonarSyntaxNodeReportingContext c, CSharpMethodParameterLookup methodParameterLookup)\n    {\n        foreach (var argumentMapping in methodParameterLookup.GetAllArgumentParameterMappings().Reverse().Where(x => x.Symbol.HasExplicitDefaultValue))\n        {\n            if (ArgumentHasDefaultValue(argumentMapping, c.Model))\n            {\n                c.ReportIssue(Rule, argumentMapping.Node, argumentMapping.Symbol.Name);\n            }\n            else if (argumentMapping.Node.NameColon is null)\n            {\n                break;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/RedundantArgumentCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Text;\nusing NodeAndSymbol = SonarAnalyzer.Core.Common.NodeAndSymbol<Microsoft.CodeAnalysis.CSharp.Syntax.ArgumentSyntax, Microsoft.CodeAnalysis.IParameterSymbol>;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class RedundantArgumentCodeFix : SonarCodeFix\n    {\n        internal const string TitleRemove = \"Remove redundant arguments\";\n        internal const string TitleRemoveWithNameAdditions = \"Remove redundant arguments with adding named arguments\";\n\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(RedundantArgument.DiagnosticId);\n\n        protected override async Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var invocation = GetInvocation(root, diagnostic.Location.SourceSpan);\n            if (invocation == null)\n            {\n                return;\n            }\n\n            var semanticModel = await context.Document.GetSemanticModelAsync(context.Cancel).ConfigureAwait(false);\n            var methodParameterLookup = new CSharpMethodParameterLookup(invocation, semanticModel);\n            var argumentMappings = methodParameterLookup.GetAllArgumentParameterMappings().ToList();\n\n            var methodSymbol = methodParameterLookup.MethodSymbol;\n            if (methodSymbol == null)\n            {\n                return;\n            }\n\n            var argumentsWithDefaultValues = new List<ArgumentSyntax>();\n            var argumentsCanBeRemovedWithoutNamed = new List<ArgumentSyntax>();\n            var canBeRemovedWithoutNamed = true;\n\n            var reversedMappings = new List<NodeAndSymbol>(argumentMappings);\n            reversedMappings.Reverse();\n            foreach (var argumentMapping in reversedMappings)\n            {\n                var argument = argumentMapping.Node;\n\n                if (RedundantArgument.ArgumentHasDefaultValue(argumentMapping, semanticModel))\n                {\n                    argumentsWithDefaultValues.Add(argument);\n\n                    if (canBeRemovedWithoutNamed)\n                    {\n                        argumentsCanBeRemovedWithoutNamed.Add(argument);\n                    }\n                }\n                else\n                {\n                    if (argument.NameColon == null)\n                    {\n                        canBeRemovedWithoutNamed = false;\n                    }\n                }\n            }\n\n            if (argumentsCanBeRemovedWithoutNamed.Any())\n            {\n                context.RegisterCodeFix(\n                    TitleRemove,\n                    c => RemoveArgumentsAsync(context.Document, argumentsCanBeRemovedWithoutNamed, c),\n                    context.Diagnostics);\n            }\n\n            var cannotBeRemoved = argumentsWithDefaultValues.Except(argumentsCanBeRemovedWithoutNamed);\n            if (cannotBeRemoved.Any())\n            {\n                context.RegisterCodeFix(\n                    TitleRemoveWithNameAdditions,\n                    c => RemoveArgumentsAndAddNecessaryNamesAsync(context.Document, invocation.ArgumentList, argumentMappings, argumentsWithDefaultValues, semanticModel, c),\n                    context.Diagnostics);\n            }\n        }\n\n        private static async Task<Document> RemoveArgumentsAndAddNecessaryNamesAsync(Document document,\n                                                                                     ArgumentListSyntax argumentList,\n                                                                                     IEnumerable<NodeAndSymbol> argumentMappings,\n                                                                                     List<ArgumentSyntax> argumentsToRemove,\n                                                                                     SemanticModel semanticModel,\n                                                                                     CancellationToken cancel)\n        {\n            var root = await document.GetSyntaxRootAsync(cancel).ConfigureAwait(false);\n            var newArgumentList = SyntaxFactory.ArgumentList();\n            var alreadyRemovedOne = false;\n\n            foreach (var argumentMapping in argumentMappings\n                .Where(argumentMapping => !argumentMapping.Symbol.IsParams))\n            {\n                var argument = argumentMapping.Node;\n                if (argumentsToRemove.Contains(argument))\n                {\n                    alreadyRemovedOne = true;\n                    continue;\n                }\n\n                newArgumentList = AddArgument(newArgumentList, argumentMapping.Symbol.Name, argument, alreadyRemovedOne);\n            }\n\n            var paramsArguments = argumentMappings\n                .Where(mapping => mapping.Symbol.IsParams)\n                .ToList();\n\n            if (paramsArguments.Any())\n            {\n                newArgumentList = AddParamsArguments(semanticModel, paramsArguments, newArgumentList);\n            }\n\n            var newRoot = root.ReplaceNode(argumentList, newArgumentList);\n            return document.WithSyntaxRoot(newRoot);\n        }\n\n        private static ArgumentListSyntax AddArgument(ArgumentListSyntax argumentList, string parameterName,\n            ArgumentSyntax argument, bool alreadyRemovedOne)\n        {\n            return alreadyRemovedOne\n                ? argumentList.AddArguments(\n                    SyntaxFactory.Argument(\n                        SyntaxFactory.NameColon(SyntaxFactory.IdentifierName(parameterName)),\n                        argument.RefOrOutKeyword,\n                        argument.Expression))\n                : argumentList.AddArguments(argument);\n        }\n\n        private static ArgumentListSyntax AddParamsArguments(SemanticModel semanticModel, IEnumerable<NodeAndSymbol> paramsArguments, ArgumentListSyntax argumentList)\n        {\n            var firstParamsMapping = paramsArguments.First();\n            var firstParamsArgument = firstParamsMapping.Node;\n            var paramsParameter = firstParamsMapping.Symbol;\n\n            if (firstParamsArgument.NameColon != null)\n            {\n                return argumentList.AddArguments(firstParamsArgument);\n            }\n\n            if (paramsArguments.Count() == 1 &&\n                paramsParameter.Type.Equals(\n                    semanticModel.GetTypeInfo(firstParamsArgument.Expression).Type))\n            {\n                return argumentList.AddArguments(\n                    SyntaxFactory.Argument(\n                        SyntaxFactory.NameColon(\n                            SyntaxFactory.IdentifierName(paramsParameter.Name)),\n                        firstParamsArgument.RefOrOutKeyword,\n                        firstParamsArgument.Expression));\n            }\n\n            return argumentList.AddArguments(\n                SyntaxFactory.Argument(\n                    SyntaxFactory.NameColon(\n                        SyntaxFactory.IdentifierName(paramsParameter.Name)),\n                    SyntaxFactory.Token(SyntaxKind.None),\n                    SyntaxFactory.ImplicitArrayCreationExpression(\n                        SyntaxFactory.InitializerExpression(\n                            SyntaxKind.ArrayInitializerExpression,\n                            SyntaxFactory.SeparatedList(paramsArguments.Select(arg => arg.Node.Expression))))));\n        }\n\n        private static async Task<Document> RemoveArgumentsAsync(Document document, IEnumerable<ArgumentSyntax> arguments, CancellationToken cancel)\n        {\n            var root = await document.GetSyntaxRootAsync(cancel).ConfigureAwait(false);\n            var newRoot = root.RemoveNodes(arguments, SyntaxRemoveOptions.KeepNoTrivia | SyntaxRemoveOptions.AddElasticMarker);\n            return document.WithSyntaxRoot(newRoot);\n        }\n\n        private static InvocationExpressionSyntax GetInvocation(SyntaxNode root, TextSpan diagnosticSpan)\n        {\n            var argumentSyntax = root.FindNode(diagnosticSpan) as ArgumentSyntax;\n\n            return argumentSyntax?.FirstAncestorOrSelf<InvocationExpressionSyntax>();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/RedundantCast.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class RedundantCast : SonarDiagnosticAnalyzer\n{\n    internal const string DiagnosticId = \"S1905\";\n    private const string MessageFormat = \"Remove this unnecessary cast to '{0}'.\";\n\n    private static readonly DiagnosticDescriptor Rule =\n        DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    private static readonly ISet<string> CastIEnumerableMethods = new HashSet<string> { \"Cast\", \"OfType\" };\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(\n            c =>\n            {\n                var castExpression = (CastExpressionSyntax)c.Node;\n                CheckCastExpression(c, castExpression.Expression, castExpression.Type, castExpression.Type.GetLocation());\n            },\n            SyntaxKind.CastExpression);\n\n        context.RegisterNodeAction(\n            c =>\n            {\n                var castExpression = (BinaryExpressionSyntax)c.Node;\n                CheckCastExpression(c, castExpression.Left, castExpression.Right,\n                    castExpression.OperatorToken.CreateLocation(castExpression.Right));\n            },\n            SyntaxKind.AsExpression);\n\n        context.RegisterNodeAction(\n            CheckExtensionMethodInvocation,\n            SyntaxKind.InvocationExpression);\n    }\n\n    private static void CheckCastExpression(SonarSyntaxNodeReportingContext context, ExpressionSyntax expression, ExpressionSyntax type, Location location)\n    {\n        if (!expression.IsDefaultLiteral()\n            && expression.RemoveParentheses().Kind() is not (SyntaxKind.StackAllocArrayCreationExpression or SyntaxKindEx.ImplicitStackAllocArrayCreationExpression)\n            && context.Model.GetTypeInfo(expression) is { Type: { } expressionType } expressionTypeInfo\n            && context.Model.GetTypeInfo(type) is { Type: { } castType }\n            && expressionType.Equals(castType)\n            && FlowStateEquals(context.Model, expressionTypeInfo, type, castType))\n        {\n            ReportIssue(context, expression, castType, location);\n        }\n    }\n\n    private static bool FlowStateEquals(SemanticModel model, TypeInfo expressionTypeInfo, ExpressionSyntax castTypeExpression, ITypeSymbol castType)\n    {\n        // The Nullability() annotation of the castType symbol is always \"None\". We need to look at the syntax to determine the nullability.\n        var castingToNullable = castTypeExpression.IsKind(SyntaxKind.NullableType)\n            || castType.IsNullableValueType(); // Nullable<int> is considered the same as int? checked via SyntaxKind.NullableType above.\n        var outerNullability = expressionTypeInfo.Nullability().FlowState switch\n        {\n            NullableFlowState.None => true,\n            NullableFlowState.MaybeNull => castingToNullable, // false when (string)maybeNull which is a narrowing cast and therefore not redundant\n            NullableFlowState.NotNull => !castingToNullable,  // false when (string?)nonNull which is a widening cast but not redundant in cases like tuples (a: (string?)\"\", b: \"\")\n            _ => true,\n        };\n        return outerNullability && InnerNullabilityEquals(model, expressionTypeInfo.Type, castType);\n\n        // The nullable annotations of the type arguments also needs to be identical: IEnumerable<string?> is not the same as IEnumerable<string>.\n        // We recursively check the type arguments for ? annotations.\n        static bool InnerNullabilityEquals(SemanticModel model, ITypeSymbol expressionTypeSymbol, ITypeSymbol castTypeSymbol)\n        {\n            var expressionTypeArguments = (expressionTypeSymbol as INamedTypeSymbol)?.TypeArguments ?? ImmutableArray<ITypeSymbol>.Empty;\n            // In opposition to the outer Nullability(), the inner nullability is present on the cast symbol. Therefore we can use the symbols nullability for this check.\n            var castTypeArguments = (castTypeSymbol as INamedTypeSymbol)?.TypeArguments ?? ImmutableArray<ITypeSymbol>.Empty;\n            Debug.Assert(expressionTypeArguments.Length == castTypeArguments.Length, \"Always true, because otherwise the expressionType.Equals(castType) check in CheckCastExpression is false.\");\n            foreach (var typeArgumentPair in expressionTypeArguments.Zip(castTypeArguments, Pair.From))\n            {\n                var typeArgumentNullablityMatch = typeArgumentPair.Left.NullableAnnotation() == typeArgumentPair.Right.NullableAnnotation();\n                if (!typeArgumentNullablityMatch || !InnerNullabilityEquals(model, typeArgumentPair.Left, typeArgumentPair.Right))\n                {\n                    return false;\n                }\n            }\n            return true;\n        }\n    }\n\n    private static void CheckExtensionMethodInvocation(SonarSyntaxNodeReportingContext context)\n    {\n        var invocation = (InvocationExpressionSyntax)context.Node;\n        if (GetEnumerableExtensionSymbol(invocation, context.Model) is { } methodSymbol)\n        {\n            var returnType = methodSymbol.ReturnType;\n            if (GetGenericTypeArgument(returnType) is { } castType)\n            {\n                if (methodSymbol.Name == \"OfType\" && CanHaveNullValue(castType))\n                {\n                    // OfType() filters 'null' values from enumerables\n                    return;\n                }\n\n                var elementType = GetElementType(invocation, methodSymbol, context.Model);\n                if (elementType != null && elementType.Equals(castType) && elementType.NullableAnnotation() == castType.NullableAnnotation())\n                {\n                    var methodCalledAsStatic = methodSymbol.MethodKind == MethodKind.Ordinary;\n                    ReportIssue(context, invocation, returnType, GetReportLocation(invocation, methodCalledAsStatic));\n                }\n            }\n        }\n    }\n\n    private static void ReportIssue(SonarSyntaxNodeReportingContext context, ExpressionSyntax expression, ITypeSymbol castType, Location location) =>\n        context.ReportIssue(Rule, location, castType.ToMinimalDisplayString(context.Model, expression.SpanStart));\n\n    /// If the invocation one of the <see cref=\"CastIEnumerableMethods\"/> extensions, returns the method symbol.\n    private static IMethodSymbol GetEnumerableExtensionSymbol(InvocationExpressionSyntax invocation, SemanticModel semanticModel) =>\n        invocation.GetMethodCallIdentifier() is { } methodName\n        && CastIEnumerableMethods.Contains(methodName.ValueText)\n        && semanticModel.GetSymbolInfo(invocation).Symbol is IMethodSymbol methodSymbol\n        && methodSymbol.IsExtensionOn(KnownType.System_Collections_IEnumerable)\n            ? methodSymbol\n            : null;\n\n    private static ITypeSymbol GetGenericTypeArgument(ITypeSymbol type) =>\n        type is INamedTypeSymbol returnType && returnType.Is(KnownType.System_Collections_Generic_IEnumerable_T)\n            ? returnType.TypeArguments.Single()\n            : null;\n\n    private static bool CanHaveNullValue(ITypeSymbol type) =>\n        type.IsReferenceType || type.Is(KnownType.System_Nullable_T);\n\n    private static Location GetReportLocation(InvocationExpressionSyntax invocation, bool methodCalledAsStatic) =>\n        methodCalledAsStatic is false && invocation.Expression is MemberAccessExpressionSyntax memberAccess\n            ? memberAccess.OperatorToken.CreateLocation(invocation)\n            : invocation.Expression.GetLocation();\n\n    private static ITypeSymbol GetElementType(InvocationExpressionSyntax invocation, IMethodSymbol methodSymbol, SemanticModel semanticModel)\n    {\n        return semanticModel.GetTypeInfo(CollectionExpression(invocation, methodSymbol)).Type switch\n        {\n            INamedTypeSymbol { TypeArguments: { Length: 1 } typeArguments } => typeArguments.First(),\n            IArrayTypeSymbol { Rank: 1 } arrayType => arrayType.ElementType,    // casting is necessary for multidimensional arrays\n            _ => null\n        };\n\n        static ExpressionSyntax CollectionExpression(InvocationExpressionSyntax invocation, IMethodSymbol methodSymbol) =>\n            methodSymbol.MethodKind is MethodKind.ReducedExtension\n                ? ReducedExtensionExpression(invocation)\n                : invocation.ArgumentList.Arguments.FirstOrDefault()?.Expression;\n\n        static ExpressionSyntax ReducedExtensionExpression(InvocationExpressionSyntax invocation) =>\n            invocation.Expression is MemberAccessExpressionSyntax { Expression: { } memberAccessExpression }\n                ? memberAccessExpression\n                : invocation.GetParentConditionalAccessExpression()?.Expression;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/RedundantCastCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class RedundantCastCodeFix : SonarCodeFix\n    {\n        internal const string Title = \"Remove redundant cast\";\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(RedundantCast.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            var syntaxNode = root.FindNode(diagnosticSpan, getInnermostNodeForTie: true);\n\n            if (syntaxNode.Parent is CastExpressionSyntax castExpression)\n            {\n                //this is handled by IDE0004 code fix.\n                return Task.CompletedTask;\n            }\n\n            var castInvocation = syntaxNode as InvocationExpressionSyntax;\n            var memberAccess = syntaxNode as MemberAccessExpressionSyntax;\n            if (castInvocation != null ||\n                memberAccess != null)\n            {\n                context.RegisterCodeFix(\n                    Title,\n                    c =>\n                    {\n                        var newRoot = RemoveCall(root, castInvocation, memberAccess);\n                        return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                    },\n                    context.Diagnostics);\n            }\n\n            if (syntaxNode is BinaryExpressionSyntax asExpression)\n            {\n                context.RegisterCodeFix(\n                    Title,\n                    c =>\n                    {\n                        var newRoot = root.ReplaceNode(\n                            asExpression,\n                            asExpression.Left.WithTriviaFrom(asExpression));\n                        return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                    },\n                    context.Diagnostics);\n            }\n\n            return Task.CompletedTask;\n        }\n\n        private static SyntaxNode RemoveCall(SyntaxNode root,\n            InvocationExpressionSyntax castInvocation, MemberAccessExpressionSyntax memberAccess)\n        {\n            return castInvocation != null\n                ? RemoveExtensionMethodCall(root, castInvocation)\n                : RemoveStaticMemberCall(root, memberAccess);\n        }\n\n        private static SyntaxNode RemoveStaticMemberCall(SyntaxNode root,\n            MemberAccessExpressionSyntax memberAccess)\n        {\n            var invocation = (InvocationExpressionSyntax)memberAccess.Parent;\n            return root.ReplaceNode(invocation, invocation.ArgumentList.Arguments.First().Expression);\n        }\n\n        private static SyntaxNode RemoveExtensionMethodCall(SyntaxNode root, InvocationExpressionSyntax invocation)\n        {\n            var memberAccess = (MemberAccessExpressionSyntax)invocation.Expression;\n            return root.ReplaceNode(invocation, memberAccess.Expression);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/RedundantConditionalAroundAssignment.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class RedundantConditionalAroundAssignment : SonarDiagnosticAnalyzer\n{\n    internal const string DiagnosticId = \"S3440\";\n    private const string MessageFormat = \"Remove this useless conditional.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(UselessConditionIfStatement, SyntaxKind.IfStatement);\n        context.RegisterNodeAction(UselessConditionSwitchExpression, SyntaxKindEx.SwitchExpression);\n    }\n\n    private static void UselessConditionIfStatement(SonarSyntaxNodeReportingContext c)\n    {\n        var ifStatement = (IfStatementSyntax)c.Node;\n\n        if (ifStatement.Else is not null\n            || ifStatement.Parent is ElseClauseSyntax\n            || ifStatement.FirstAncestorOrSelf<AccessorDeclarationSyntax>()?.Kind() is SyntaxKind.SetAccessorDeclaration or SyntaxKindEx.InitAccessorDeclaration\n            || !TryGetNotEqualsCondition(ifStatement, out var condition)\n            || !TryGetSingleAssignment(ifStatement, out var assignment))\n        {\n            return;\n        }\n\n        var expression1Condition = condition.Left?.RemoveParentheses();\n        var expression2Condition = condition.Right?.RemoveParentheses();\n        var expression1Assignment = assignment.Left?.RemoveParentheses();\n        var expression2Assignment = assignment.Right?.RemoveParentheses();\n\n        if (!AreMatchingExpressions(expression1Condition, expression2Condition, expression2Assignment, expression1Assignment)\n            && !AreMatchingExpressions(expression1Condition, expression2Condition, expression1Assignment, expression2Assignment))\n        {\n            return;\n        }\n\n        if (c.Model.GetSymbolInfo(assignment.Left).Symbol is not IPropertySymbol)\n        {\n            c.ReportIssue(Rule, condition);\n        }\n    }\n\n    private static void UselessConditionSwitchExpression(SonarSyntaxNodeReportingContext c)\n    {\n        var switchExpression = (SwitchExpressionSyntaxWrapper)c.Node;\n\n        if (switchExpression.SyntaxNode.GetFirstNonParenthesizedParent() is not AssignmentExpressionSyntax)\n        {\n            return;\n        }\n\n        var hasDiscard = switchExpression.Arms.Any(x => DiscardPatternSyntaxWrapper.IsInstance(x.Pattern));\n        foreach (var switchArm in switchExpression.Arms)\n        {\n            var condition = switchArm.Pattern.SyntaxNode;\n            var constantPattern = condition.DescendantNodesAndSelf().FirstOrDefault(x => x.IsKind(SyntaxKindEx.ConstantPattern));\n            var expression = switchArm.Expression;\n            if ((constantPattern is not null\n                && !(condition.IsKind(SyntaxKindEx.NotPattern) && (switchArm.WhenClause.SyntaxNode is not null || switchExpression.Arms.Count != 1))\n                && CSharpEquivalenceChecker.AreEquivalent(expression, ((ConstantPatternSyntaxWrapper)constantPattern).Expression) && !hasDiscard)\n                || (condition.IsKind(SyntaxKindEx.DiscardPattern) && switchExpression.Arms.Count == 1))\n            {\n                c.ReportIssue(Rule, condition);\n            }\n        }\n    }\n\n    private static bool TryGetNotEqualsCondition(IfStatementSyntax ifStatement, out BinaryExpressionSyntax condition)\n    {\n        condition = ifStatement.Condition?.RemoveParentheses() as BinaryExpressionSyntax;\n        return condition is not null && condition.IsKind(SyntaxKind.NotEqualsExpression);\n    }\n\n    private static bool TryGetSingleAssignment(IfStatementSyntax ifStatement, out AssignmentExpressionSyntax assignment)\n    {\n        var statement = ifStatement.Statement;\n\n        if (statement is not BlockSyntax block || block.Statements.Count != 1)\n        {\n            assignment = null;\n            return false;\n        }\n\n        statement = block.Statements.First();\n        assignment = (statement as ExpressionStatementSyntax)?.Expression as AssignmentExpressionSyntax;\n\n        return assignment is not null && assignment.IsKind(SyntaxKind.SimpleAssignmentExpression);\n    }\n\n    private static bool AreMatchingExpressions(SyntaxNode condition1, SyntaxNode condition2, SyntaxNode assignment1, SyntaxNode assignment2) =>\n        CSharpEquivalenceChecker.AreEquivalent(condition1, assignment1) && CSharpEquivalenceChecker.AreEquivalent(condition2, assignment2);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/RedundantConditionalAroundAssignmentCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[ExportCodeFixProvider(LanguageNames.CSharp)]\npublic sealed class RedundantConditionalAroundAssignmentCodeFix : SonarCodeFix\n{\n    private const string Title = \"Remove redundant conditional\";\n\n    public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(RedundantConditionalAroundAssignment.DiagnosticId);\n\n    protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n    {\n        var diagnostic = context.Diagnostics.First();\n        var diagnosticSpan = diagnostic.Location.SourceSpan;\n        var condition = root.FindNode(diagnosticSpan) as ExpressionSyntax;\n        var ifStatement = condition?.FirstAncestorOrSelf<IfStatementSyntax>();\n\n        if (ifStatement is not null)\n        {\n            return HandleIfStatement(root, context, ifStatement);\n        }\n\n        var switchExpression = root.FindNode(diagnosticSpan).FirstAncestorOrSelf<SyntaxNode>(x => x.IsKind(SyntaxKindEx.SwitchExpression));\n        if (switchExpression is not null)\n        {\n            return HandleSwitchExpression(root, context, switchExpression);\n        }\n        else\n        {\n            return Task.CompletedTask;\n        }\n    }\n\n    private static Task HandleIfStatement(SyntaxNode root, SonarCodeFixContext context, IfStatementSyntax ifStatement)\n    {\n        var statement = ifStatement.Statement;\n        if (statement is BlockSyntax block)\n        {\n            statement = block.Statements.FirstOrDefault();\n        }\n\n        if (statement is null)\n        {\n            return Task.CompletedTask;\n        }\n\n        context.RegisterCodeFix(\n            Title,\n            c =>\n            {\n                var newRoot = root.ReplaceNode(\n                    ifStatement,\n                    statement.WithTriviaFrom(ifStatement));\n                return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n            },\n            context.Diagnostics);\n\n        return Task.CompletedTask;\n    }\n\n    private static Task HandleSwitchExpression(SyntaxNode root, SonarCodeFixContext context, SyntaxNode switchExpression)\n    {\n        var switchArm = ((SwitchExpressionSyntaxWrapper)switchExpression).Arms.FirstOrDefault();\n        if (switchArm.SyntaxNode is null || switchArm.SyntaxNode.Parent.ChildNodes().Count(x => x.IsKind(SyntaxKindEx.SwitchExpressionArm)) != 1)\n        {\n            return Task.CompletedTask;\n        }\n\n        context.RegisterCodeFix(\n            Title,\n            c =>\n            {\n                var newRoot = root.ReplaceNode(\n                    switchExpression,\n                    switchArm.Expression.WithTriviaFrom(switchExpression));\n                return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n            },\n            context.Diagnostics);\n\n        return Task.CompletedTask;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/RedundantDeclaration.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class RedundantDeclaration : SonarDiagnosticAnalyzer\n{\n    internal const string DiagnosticId = \"S3257\";\n    internal const string DiagnosticTypeKey = \"diagnosticType\";\n    internal const string ParameterNameKey = \"ParameterNameKey\";\n\n    private const string MessageFormat = \"Remove the {0}; it is redundant.\";\n    private const string UseDiscardMessageFormat = \"'{0}' is not used. Use discard parameter instead.\";\n\n    internal enum RedundancyType\n    {\n        LambdaParameterType,\n        ArraySize,\n        ArrayType,\n        ExplicitDelegate,\n        ExplicitNullable,\n        ObjectInitializer,\n        DelegateParameterList\n    }\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n    private static readonly DiagnosticDescriptor DiscardRule = DescriptorFactory.Create(DiagnosticId, UseDiscardMessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule, DiscardRule);\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(\n            c =>\n            {\n                ReportOnExplicitDelegateCreation(c);\n                ReportRedundantNullableConstructorCall(c);\n                ReportOnRedundantObjectInitializer(c);\n            },\n            SyntaxKind.ObjectCreationExpression,\n            SyntaxKindEx.ImplicitObjectCreationExpression);\n\n        context.RegisterNodeAction(ReportOnRedundantParameterList, SyntaxKind.AnonymousMethodExpression);\n        context.RegisterNodeAction(ReportRedundancyInArrayCreation, SyntaxKind.ArrayCreationExpression);\n        context.RegisterNodeAction(VisitParenthesizedLambdaExpression, SyntaxKind.ParenthesizedLambdaExpression);\n    }\n\n    #region Type specification in lambda\n\n    private static readonly ISet<SyntaxKind> RefOutKeywords = new HashSet<SyntaxKind>\n    {\n        SyntaxKind.RefKeyword,\n        SyntaxKind.OutKeyword\n    };\n\n    private static void VisitParenthesizedLambdaExpression(SonarSyntaxNodeReportingContext context)\n    {\n        var lambda = (ParenthesizedLambdaExpressionSyntax)context.Node;\n\n        CheckUnusedParameters(context, lambda);\n        CheckTypeSpecifications(context, lambda);\n    }\n\n    private static void CheckTypeSpecifications(SonarSyntaxNodeReportingContext context, ParenthesizedLambdaExpressionSyntax lambda)\n    {\n        if (!IsParameterListModifiable(lambda))\n        {\n            return;\n        }\n\n        if (!(context.Model.GetSymbolInfo(lambda).Symbol is IMethodSymbol symbol))\n        {\n            return;\n        }\n\n        var newParameterList = SyntaxFactory.ParameterList(SyntaxFactory.SeparatedList(lambda.ParameterList.Parameters.Select(x => SyntaxFactory.Parameter(x.Identifier))));\n        if (lambda.ChangeSyntaxElement(lambda.WithParameterList(newParameterList), context.Model, out var newSemanticModel) is { } newLambda\n            && newSemanticModel.GetSymbolInfo(newLambda) is { Symbol: IMethodSymbol newSymbol }\n            && ParameterTypesMatch(symbol, newSymbol))\n        {\n            foreach (var parameter in lambda.ParameterList.Parameters)\n            {\n                context.ReportIssue(\n                    Rule,\n                    parameter.Type,\n                    ImmutableDictionary<string, string>.Empty.Add(DiagnosticTypeKey, nameof(RedundancyType.LambdaParameterType)),\n                    \"type specification\");\n            }\n        }\n    }\n\n    private static void CheckUnusedParameters(SonarSyntaxNodeReportingContext context, ParenthesizedLambdaExpressionSyntax lambda)\n    {\n        if (context.Compilation.IsLambdaDiscardParameterSupported())\n        {\n            var usedIdentifiers = UsedIdentifiers(lambda).ToList();\n            foreach (var parameter in lambda.ParameterList.Parameters)\n            {\n                var parameterName = parameter.Identifier.Text;\n\n                if (parameterName != SyntaxConstants.Discard && !usedIdentifiers.Contains(parameterName))\n                {\n                    context.ReportIssue(\n                        DiscardRule,\n                        parameter,\n                        ImmutableDictionary<string, string>.Empty.Add(DiagnosticTypeKey, nameof(RedundancyType.LambdaParameterType)).Add(ParameterNameKey, parameterName),\n                        parameterName);\n                }\n            }\n        }\n    }\n\n    private static IEnumerable<string> UsedIdentifiers(ParenthesizedLambdaExpressionSyntax lambda) =>\n        lambda.Body.DescendantNodesAndSelf().OfType<IdentifierNameSyntax>().Select(x => x.Identifier.Text);\n\n    private static bool IsParameterListModifiable(ParenthesizedLambdaExpressionSyntax lambda) =>\n        lambda is { ParameterList.Parameters: { Count: > 0 } parameters }\n        && parameters.All(x => x.Type is not null && x.Modifiers.All(m => !RefOutKeywords.Contains(m.Kind())));\n\n    private static bool ParameterTypesMatch(IMethodSymbol method1, IMethodSymbol method2)\n    {\n        for (var i = 0; i < method1.Parameters.Length; i++)\n        {\n            if (!method1.Parameters[i].Type.Equals(method2.Parameters[i].Type))\n            {\n                return false;\n            }\n        }\n        return true;\n    }\n\n    #endregion\n\n    #region Nullable constructor call\n\n    private static void ReportRedundantNullableConstructorCall(SonarSyntaxNodeReportingContext context)\n    {\n        var objectCreation = ObjectCreationFactory.Create(context.Node);\n        if (!IsNullableCreation(objectCreation, context.Model))\n        {\n            return;\n        }\n\n        if (IsInNotVarDeclaration(objectCreation.Expression)\n            || IsInAssignmentOrReturnValue(objectCreation.Expression)\n            || IsInArgumentAndCanBeChanged(objectCreation, context.Model))\n        {\n            ReportIssueOnRedundantObjectCreation(context, objectCreation.Expression, \"explicit nullable type creation\", RedundancyType.ExplicitNullable);\n        }\n    }\n\n    private static bool IsNullableCreation(IObjectCreation objectCreation, SemanticModel model) =>\n        objectCreation.ArgumentList is { Arguments.Count: 1 } && objectCreation.TypeSymbol(model).OriginalDefinition.Is(KnownType.System_Nullable_T);\n\n    private static bool IsInAssignmentOrReturnValue(SyntaxNode objectCreation) =>\n        objectCreation.GetFirstNonParenthesizedParent() switch\n        {\n            AssignmentExpressionSyntax _ => true,\n            ReturnStatementSyntax _ => true,\n            LambdaExpressionSyntax _ => true,\n            _ => false\n        };\n\n    private static bool IsInNotVarDeclaration(SyntaxNode objectCreation)\n    {\n        var variableDeclaration = objectCreation.GetSelfOrTopParenthesizedExpression()\n            .Parent?.Parent?.Parent as VariableDeclarationSyntax;\n\n        return variableDeclaration is { Type.IsVar: false };\n    }\n\n    #endregion\n\n    #region Array (creation, size, type)\n\n    private static void ReportRedundancyInArrayCreation(SonarSyntaxNodeReportingContext context)\n    {\n        var array = (ArrayCreationExpressionSyntax)context.Node;\n        ReportRedundantArraySizeSpecifier(context, array);\n        ReportRedundantArrayTypeSpecifier(context, array);\n    }\n\n    private static void ReportRedundantArraySizeSpecifier(SonarSyntaxNodeReportingContext context, ArrayCreationExpressionSyntax array)\n    {\n        if (array.Initializer is null || array.Type is null)\n        {\n            return;\n        }\n        var rankSpecifier = array.Type.RankSpecifiers.FirstOrDefault();\n        if (rankSpecifier is null || rankSpecifier.Sizes.Any(SyntaxKind.OmittedArraySizeExpression))\n        {\n            return;\n        }\n\n        foreach (var size in rankSpecifier.Sizes)\n        {\n            context.ReportIssue(\n                Rule,\n                size,\n                ImmutableDictionary<string, string>.Empty.Add(DiagnosticTypeKey, nameof(RedundancyType.ArraySize)),\n                \"array size specification\");\n        }\n    }\n\n    private static void ReportRedundantArrayTypeSpecifier(SonarSyntaxNodeReportingContext context, ArrayCreationExpressionSyntax array)\n    {\n        if (array.Initializer is null\n            || !array.Initializer.Expressions.Any()\n            || array.Initializer.Expressions.All(ImplicitObjectCreationExpressionSyntaxWrapper.IsInstance)\n            || array.Type is null\n            || array.Type.RankSpecifiers.Count > 1)\n        {\n            return;\n        }\n\n        var rankSpecifier = array.Type.RankSpecifiers.FirstOrDefault();\n        if (rankSpecifier is null\n            || rankSpecifier.Sizes.Any(x => !x.IsKind(SyntaxKind.OmittedArraySizeExpression)))\n        {\n            return;\n        }\n\n        if (context.Model.GetTypeInfo(array.Type).Type is not IArrayTypeSymbol { ElementType: { TypeKind: not TypeKind.Error } arrayElementType })\n        {\n            return;\n        }\n\n        var canBeSimplified = array.Initializer.Expressions\n            .Select(x => context.Model.GetTypeInfo(x).Type)\n            .All(arrayElementType.Equals);\n\n        if (canBeSimplified)\n        {\n            var location = Location.Create(array.SyntaxTree, TextSpan.FromBounds(array.Type.ElementType.SpanStart, array.Type.RankSpecifiers.Last().SpanStart));\n            context.ReportIssue(Rule, location, ImmutableDictionary<string, string>.Empty.Add(DiagnosticTypeKey, nameof(RedundancyType.ArrayType)), \"array type\");\n        }\n    }\n\n    #endregion\n\n    #region Object initializer\n\n    private static void ReportOnRedundantObjectInitializer(SonarSyntaxNodeReportingContext context)\n    {\n        var objectCreation = ObjectCreationFactory.Create(context.Node);\n\n        if (objectCreation.ArgumentList is not null && objectCreation.Initializer is not null && !objectCreation.Initializer.Expressions.Any())\n        {\n            context.ReportIssue(Rule, objectCreation.Initializer, ImmutableDictionary<string, string>.Empty.Add(DiagnosticTypeKey, nameof(RedundancyType.ObjectInitializer)), \"initializer\");\n        }\n    }\n\n    #endregion\n\n    #region Explicit delegate creation\n\n    private static void ReportOnExplicitDelegateCreation(SonarSyntaxNodeReportingContext context)\n    {\n        var objectCreation = ObjectCreationFactory.Create(context.Node);\n        var argumentExpression = objectCreation.ArgumentList?.Arguments.FirstOrDefault()?.Expression;\n        if (argumentExpression is null)\n        {\n            return;\n        }\n\n        if (!IsDelegateCreation(objectCreation, context.Model))\n        {\n            return;\n        }\n\n        if (IsInDeclarationNotVarNotDelegate(objectCreation.Expression, context.Model)\n            || IsAssignmentNotDelegate(objectCreation.Expression, context.Model)\n            || IsReturnValueNotDelegate(objectCreation.Expression, context.Model)\n            || IsInArgumentAndCanBeChanged(\n                objectCreation,\n                context.Model,\n                x => x.ArgumentList.Arguments.Any(a => a.Expression.IsDynamic(context.Model))))\n        {\n            ReportIssueOnRedundantObjectCreation(context, objectCreation.Expression, \"explicit delegate creation\", RedundancyType.ExplicitDelegate);\n        }\n    }\n\n    private static bool IsInDeclarationNotVarNotDelegate(SyntaxNode objectCreation, SemanticModel model)\n    {\n        var variableDeclaration = objectCreation.GetSelfOrTopParenthesizedExpression()\n            .Parent?.Parent?.Parent as VariableDeclarationSyntax;\n\n        var type = variableDeclaration?.Type;\n\n        if (type is null || type.IsVar)\n        {\n            return false;\n        }\n\n        var typeInformation = model.GetTypeInfo(type).Type;\n\n        return !typeInformation.Is(KnownType.System_Delegate);\n    }\n\n    private static bool IsDelegateCreation(IObjectCreation objectCreation, SemanticModel model) =>\n        objectCreation.TypeSymbol(model) is INamedTypeSymbol { TypeKind: TypeKind.Delegate };\n\n    private static bool IsReturnValueNotDelegate(SyntaxNode objectCreation, SemanticModel model)\n    {\n        var parent = objectCreation.GetFirstNonParenthesizedParent();\n\n        if (parent is not ReturnStatementSyntax and not LambdaExpressionSyntax)\n        {\n            return false;\n        }\n\n        if (model.GetEnclosingSymbol(objectCreation.SpanStart) is not IMethodSymbol enclosing)\n        {\n            return false;\n        }\n\n        return enclosing.ReturnType is not null && !enclosing.ReturnType.Is(KnownType.System_Delegate);\n    }\n\n    private static bool IsAssignmentNotDelegate(SyntaxNode objectCreation, SemanticModel model)\n    {\n        var parent = objectCreation.GetFirstNonParenthesizedParent();\n        if (!(parent is AssignmentExpressionSyntax assignment))\n        {\n            return false;\n        }\n\n        var typeInformation = model.GetTypeInfo(assignment.Left).Type;\n\n        return !typeInformation.Is(KnownType.System_Delegate);\n    }\n\n    #endregion\n\n    #region Parameter list\n\n    private static void ReportOnRedundantParameterList(SonarSyntaxNodeReportingContext context)\n    {\n        var anonymousMethod = (AnonymousMethodExpressionSyntax)context.Node;\n        if (anonymousMethod.ParameterList is null)\n        {\n            return;\n        }\n\n        if (context.Model.GetSymbolInfo(anonymousMethod).Symbol is not IMethodSymbol methodSymbol)\n        {\n            return;\n        }\n\n        var parameterNames = methodSymbol.Parameters.Select(x => x.Name).ToHashSet();\n\n        var usedParameters = anonymousMethod.Body.DescendantNodes()\n            .OfType<IdentifierNameSyntax>()\n            .Where(x => parameterNames.Contains(x.Identifier.ValueText))\n            .Select(x => context.Model.GetSymbolInfo(x).Symbol as IParameterSymbol)\n            .WhereNotNull()\n            .ToHashSet();\n\n        if (!usedParameters.Intersect(methodSymbol.Parameters).Any())\n        {\n            context.ReportIssue(Rule, anonymousMethod.ParameterList, ImmutableDictionary<string, string>.Empty.Add(DiagnosticTypeKey, nameof(RedundancyType.DelegateParameterList)), \"parameter list\");\n        }\n    }\n\n    #endregion\n\n    private static bool IsInArgumentAndCanBeChanged(IObjectCreation objectCreation, SemanticModel model, Func<InvocationExpressionSyntax, bool> additionalFilter = null)\n    {\n        if (!(objectCreation.Expression.GetFirstNonParenthesizedParent() is ArgumentSyntax { Parent: ArgumentListSyntax { Parent: InvocationExpressionSyntax invocation } } argument))\n        {\n            return false;\n        }\n\n        if (additionalFilter is not null && additionalFilter(invocation))\n        {\n            return false;\n        }\n\n        // In C# 10 and later, the natural type of a lambda expression is Func<T> or Action<T>,\n        // which are implicit convertable to Delegate. In earlier versions\n        // CS1660: Cannot convert lambda expression to type 'Delegate' because it is not a delegate type\n        // is raised.\n        // https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-10.0/lambda-improvements#natural-function-type\n        // If the user specified another delegate type than Action<T> or Func<T>, like EventHandler, we\n        // assume that the called method explicitly requires the more specific concrete delegate type.\n        if (model.GetTypeInfo(objectCreation.Expression) is { Type: { } from, ConvertedType: { } convertedTo }\n            && convertedTo.Is(KnownType.System_Delegate)\n            && (model.SyntaxTree.Options is CSharpParseOptions { LanguageVersion: < LanguageVersionEx.CSharp10 }\n                || !(from.IsAny(KnownType.SystemFuncVariants) || from.IsAny(KnownType.SystemActionVariants))))\n        {\n            return false;\n        }\n\n        var methodSymbol = model.GetSymbolInfo(invocation).Symbol;\n        if (methodSymbol is null)\n        {\n            return false;\n        }\n        var newArgument = argument.WithExpression(objectCreation.ArgumentList.Arguments.First().Expression);\n        var newInvocation = invocation.WithArgumentList(invocation.ArgumentList.ReplaceNode(argument, newArgument));\n        var overloadResolution = model.GetSpeculativeSymbolInfo(invocation.SpanStart, newInvocation, SpeculativeBindingOption.BindAsExpression);\n        // The speculative binding is sometimes unable to do proper overload resolution and returns candidate overloads.\n        // This is good enough for us as long as the original method is part of that list. Note: Any attempts with ChangeSyntaxElement and\n        // TryGetSpeculativeSemanticModel failed to produce better results.\n        return overloadResolution.AllSymbols().Any(x => x.Equals(methodSymbol));\n    }\n\n    private static void ReportIssueOnRedundantObjectCreation(SonarSyntaxNodeReportingContext context, SyntaxNode node, string message, RedundancyType redundancyType)\n    {\n        var location = node is ObjectCreationExpressionSyntax objectCreation\n            ? objectCreation.CreateLocation(objectCreation.Type)\n            : node.GetLocation();\n        context.ReportIssue(Rule, location, ImmutableDictionary<string, string>.Empty.Add(DiagnosticTypeKey, redundancyType.ToString()), message);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/RedundantDeclarationCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Formatting;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class RedundantDeclarationCodeFix : SonarCodeFix\n    {\n        internal const string TitleRedundantArraySize = \"Remove redundant array size\";\n        internal const string TitleRedundantArrayType = \"Remove redundant array type\";\n        internal const string TitleRedundantLambdaParameterType = \"Remove redundant type declaration\";\n        internal const string TitleRedundantExplicitDelegate = \"Remove redundant explicit delegate creation\";\n        internal const string TitleRedundantExplicitNullable = \"Remove redundant explicit nullable creation\";\n        internal const string TitleRedundantObjectInitializer = \"Remove redundant object initializer\";\n        internal const string TitleRedundantDelegateParameterList = \"Remove redundant parameter list\";\n        internal const string TitleRedundantParameterName = \"Use discard parameter\";\n\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(RedundantDeclaration.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            var syntaxNode = root.FindNode(diagnosticSpan, getInnermostNodeForTie: true);\n\n            if (!Enum.TryParse(diagnostic.Properties[RedundantDeclaration.DiagnosticTypeKey], out RedundantDeclaration.RedundancyType diagnosticType))\n            {\n                return Task.CompletedTask;\n            }\n\n            RegisterAction(syntaxNode, root, diagnosticType, context.Document, diagnostic.Properties, context);\n\n            return Task.CompletedTask;\n        }\n\n        private static void RegisterRedundantLambdaParameterAction(SyntaxNode syntaxNode,\n                                                                   SyntaxNode root,\n                                                                   Document document,\n                                                                   ImmutableDictionary<string, string> properties,\n                                                                   SonarCodeFixContext context)\n        {\n            var parentExpression = syntaxNode.Parent?.Parent;\n            if (parentExpression is ParenthesizedLambdaExpressionSyntax lambdaExpressionSyntax)\n            {\n                context.RegisterCodeFix(\n                    TitleRedundantParameterName,\n                    c =>\n                    {\n                        var parameterName = properties[RedundantDeclaration.ParameterNameKey];\n                        var parameter = lambdaExpressionSyntax.ParameterList.Parameters.Single(parameter => parameter.Identifier.Text == parameterName);\n                        var newRoot = root.ReplaceNode(parameter, SyntaxFactory.Parameter(SyntaxFactory.Identifier(SyntaxConstants.Discard)));\n\n                        return Task.FromResult(document.WithSyntaxRoot(newRoot));\n                    },\n                    context.Diagnostics);\n            }\n            else if (parentExpression is ParameterListSyntax parameterList)\n            {\n                context.RegisterCodeFix(\n                    TitleRedundantLambdaParameterType,\n                    c =>\n                    {\n                        var newParameterList = parameterList.WithParameters(SyntaxFactory.SeparatedList(parameterList.Parameters.Select(p => SyntaxFactory.Parameter(p.Identifier).WithTriviaFrom(p))));\n                        var newRoot = root.ReplaceNode(parameterList, newParameterList);\n\n                        return Task.FromResult(document.WithSyntaxRoot(newRoot));\n                    },\n                    context.Diagnostics);\n            }\n        }\n\n        private static void RegisterRedundantArraySizeAction(SyntaxNode syntaxNode, SyntaxNode root, Document document, SonarCodeFixContext context)\n        {\n            if (syntaxNode.Parent is not ArrayRankSpecifierSyntax arrayRank)\n            {\n                return;\n            }\n\n            context.RegisterCodeFix(\n                TitleRedundantArraySize,\n                c =>\n                {\n                    var newArrayRankSpecifier = arrayRank.WithSizes(\n                        SyntaxFactory.SeparatedList<ExpressionSyntax>(arrayRank.Sizes.Select(s =>\n                            SyntaxFactory.OmittedArraySizeExpression())));\n                    var newRoot = root.ReplaceNode(arrayRank, newArrayRankSpecifier);\n                    return Task.FromResult(document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n        }\n\n        private static void RegisterRedundantArrayTypeAction(SyntaxNode syntaxNode, SyntaxNode root, Document document, SonarCodeFixContext context)\n        {\n            var arrayTypeSyntax = syntaxNode as ArrayTypeSyntax ?? syntaxNode.Parent as ArrayTypeSyntax;\n\n            if (arrayTypeSyntax?.Parent is not ArrayCreationExpressionSyntax arrayCreation)\n            {\n                return;\n            }\n\n            context.RegisterCodeFix(\n                TitleRedundantArrayType,\n                c =>\n                {\n                    var implicitArrayCreation = SyntaxFactory.ImplicitArrayCreationExpression(arrayCreation.Initializer);\n                    var newRoot = root.ReplaceNode(arrayCreation, implicitArrayCreation);\n                    return Task.FromResult(document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n        }\n\n        private static void RegisterRedundantExplicitObjectCreationAction(SyntaxNode syntaxNode,\n                                                                         SyntaxNode root,\n                                                                         Document document,\n                                                                         RedundantDeclaration.RedundancyType diagnosticType,\n                                                                         SonarCodeFixContext context)\n        {\n            var title = diagnosticType == RedundantDeclaration.RedundancyType.ExplicitDelegate\n                ? TitleRedundantExplicitDelegate\n                : TitleRedundantExplicitNullable;\n\n            if (syntaxNode is not ObjectCreationExpressionSyntax objectCreation)\n            {\n                return;\n            }\n\n            var newExpression = objectCreation.ArgumentList?.Arguments.FirstOrDefault()?.Expression;\n            if (newExpression == null)\n            {\n                return;\n            }\n\n            context.RegisterCodeFix(\n                title,\n                c =>\n                {\n                    newExpression = newExpression.WithTriviaFrom(objectCreation);\n                    var newRoot = root.ReplaceNode(objectCreation, newExpression);\n                    return Task.FromResult(document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n        }\n\n        private static void RegisterRedundantObjectInitializerAction(SyntaxNode syntaxNode, SyntaxNode root, Document document, SonarCodeFixContext context)\n        {\n            if (syntaxNode.Parent is not ObjectCreationExpressionSyntax objectCreation)\n            {\n                return;\n            }\n\n            context.RegisterCodeFix(\n                TitleRedundantObjectInitializer,\n                c =>\n                {\n                    var newObjectCreation = objectCreation.WithInitializer(null).WithAdditionalAnnotations(Formatter.Annotation);\n                    var newRoot = root.ReplaceNode(objectCreation, newObjectCreation);\n                    return Task.FromResult(document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n        }\n\n        private static void RegisterRedundantParameterTypeAction(SyntaxNode syntaxNode, SyntaxNode root, Document document, SonarCodeFixContext context)\n        {\n            if (syntaxNode.Parent is not AnonymousMethodExpressionSyntax anonymousMethod)\n            {\n                return;\n            }\n\n            context.RegisterCodeFix(\n                TitleRedundantDelegateParameterList,\n                c =>\n                {\n                    var newAnonymousMethod = anonymousMethod.WithParameterList(null);\n                    var newRoot = root.ReplaceNode(anonymousMethod, newAnonymousMethod);\n                    return Task.FromResult(document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n        }\n\n        private static void RegisterAction(SyntaxNode syntaxNode,\n                                         SyntaxNode root,\n                                         RedundantDeclaration.RedundancyType diagnosticType,\n                                         Document document,\n                                         ImmutableDictionary<string, string> properties,\n                                         SonarCodeFixContext context)\n        {\n            switch (diagnosticType)\n            {\n                case RedundantDeclaration.RedundancyType.LambdaParameterType:\n                    RegisterRedundantLambdaParameterAction(syntaxNode, root, document, properties, context);\n                    break;\n                case RedundantDeclaration.RedundancyType.ArraySize:\n                    RegisterRedundantArraySizeAction(syntaxNode, root, document, context);\n                    break;\n                case RedundantDeclaration.RedundancyType.ArrayType:\n                    RegisterRedundantArrayTypeAction(syntaxNode, root, document, context);\n                    break;\n                case RedundantDeclaration.RedundancyType.ExplicitDelegate:\n                case RedundantDeclaration.RedundancyType.ExplicitNullable:\n                    RegisterRedundantExplicitObjectCreationAction(syntaxNode, root, document, diagnosticType, context);\n                    break;\n                case RedundantDeclaration.RedundancyType.ObjectInitializer:\n                    RegisterRedundantObjectInitializerAction(syntaxNode, root, document, context);\n                    break;\n                case RedundantDeclaration.RedundancyType.DelegateParameterList:\n                    RegisterRedundantParameterTypeAction(syntaxNode, root, document, context);\n                    break;\n                default:\n                    throw new NotSupportedException();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/RedundantInheritanceList.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class RedundantInheritanceList : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S1939\";\n        internal const string RedundantIndexKey = \"redundantIndex\";\n        private const string MessageEnum = \"'int' should not be explicitly used as the underlying type.\";\n        private const string MessageObjectBase = \"'Object' should not be explicitly extended.\";\n        private const string MessageAlreadyImplements = \"'{0}' implements '{1}' so '{1}' can be removed from the inheritance list.\";\n        private const string MessageFormat = \"{0}\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n            {\n                if (c.IsRedundantPositionalRecordContext() || c.Node is not BaseTypeDeclarationSyntax { BaseList: { Types: { Count: > 0 } } })\n                {\n                    return;\n                }\n                switch (c.Node)\n                {\n                    case EnumDeclarationSyntax enumDeclaration:\n                        ReportRedundantBaseType(c, enumDeclaration, KnownType.System_Int32, MessageEnum);\n                        break;\n                    case InterfaceDeclarationSyntax interfaceDeclaration:\n                        ReportRedundantInterfaces(c, interfaceDeclaration);\n                        break;\n                    case TypeDeclarationSyntax nonInterfaceDeclaration:\n                        ReportRedundantBaseType(c, nonInterfaceDeclaration, KnownType.System_Object, MessageObjectBase);\n                        ReportRedundantInterfaces(c, nonInterfaceDeclaration);\n                        break;\n                }\n            },\n            SyntaxKind.EnumDeclaration,\n            SyntaxKind.InterfaceDeclaration,\n            SyntaxKind.ClassDeclaration,\n            SyntaxKind.StructDeclaration,\n            SyntaxKindEx.RecordDeclaration,\n            SyntaxKindEx.RecordStructDeclaration);\n\n        private static void ReportRedundantBaseType(SonarSyntaxNodeReportingContext context, BaseTypeDeclarationSyntax typeDeclaration, KnownType redundantType, string message)\n        {\n            var baseTypeSyntax = typeDeclaration.BaseList.Types.First().Type;\n            if (context.Model.GetSymbolInfo(baseTypeSyntax).Symbol is ITypeSymbol baseTypeSymbol\n                && baseTypeSymbol.Is(redundantType))\n            {\n                var location = GetLocationWithToken(baseTypeSyntax, typeDeclaration.BaseList.Types);\n                context.ReportIssue(Rule, location, DiagnosticsProperties(0), message);\n            }\n        }\n\n        private static void ReportRedundantInterfaces(SonarSyntaxNodeReportingContext context, BaseTypeDeclarationSyntax typeDeclaration)\n        {\n            var declaredType = context.Model.GetDeclaredSymbol(typeDeclaration);\n            if (declaredType is null)\n            {\n                return;\n            }\n\n            var baseList = typeDeclaration.BaseList;\n            var interfaceTypesWithAllInterfaces = GetImplementedInterfaceMappings(baseList, context.Model);\n\n            for (var i = 0; i < baseList.Types.Count; i++)\n            {\n                var baseType = baseList.Types[i];\n                if (context.Model.GetSymbolInfo(baseType.Type).Symbol is INamedTypeSymbol interfaceType\n                    && interfaceType.IsInterface()\n                    && CollidingDeclaration(declaredType, interfaceType, interfaceTypesWithAllInterfaces) is { } collidingDeclaration)\n                {\n                    var location = GetLocationWithToken(baseType.Type, baseList.Types);\n                    var message = string.Format(MessageAlreadyImplements,\n                        collidingDeclaration.ToMinimalDisplayString(context.Model, baseType.Type.SpanStart),\n                        interfaceType.ToMinimalDisplayString(context.Model, baseType.Type.SpanStart));\n\n                    context.ReportIssue(Rule, location, DiagnosticsProperties(i), message);\n                }\n            }\n        }\n\n        private static MultiValueDictionary<INamedTypeSymbol, INamedTypeSymbol> GetImplementedInterfaceMappings(BaseListSyntax baseList, SemanticModel semanticModel) =>\n            baseList.Types\n                    .Select(baseType => semanticModel.GetSymbolInfo(baseType.Type).Symbol as INamedTypeSymbol)\n                    .WhereNotNull()\n                    .Distinct()\n                    .ToMultiValueDictionary(x => x.AllInterfaces);\n\n        private static INamedTypeSymbol CollidingDeclaration(INamedTypeSymbol declaredType, INamedTypeSymbol interfaceType, MultiValueDictionary<INamedTypeSymbol, INamedTypeSymbol> interfaceMappings)\n        {\n            var collisionMapping = interfaceMappings.FirstOrDefault(x => x.Key.IsInterface() && x.Value.Contains(interfaceType));\n            if (collisionMapping.Key is not null)\n            {\n                return collisionMapping.Key;\n            }\n\n            var baseClassMapping = interfaceMappings.FirstOrDefault(x => x.Key.IsClass());\n            if (baseClassMapping.Key is null)\n            {\n                return null;\n            }\n\n            var canBeRemoved = CanInterfaceBeRemovedBasedOnMembers(declaredType, interfaceType);\n            return canBeRemoved ? baseClassMapping.Key : null;\n        }\n\n        private static bool CanInterfaceBeRemovedBasedOnMembers(INamedTypeSymbol declaredType, INamedTypeSymbol interfaceType)\n        {\n            var allMembersOfInterface = AllInterfacesAndSelf(interfaceType).SelectMany(x => x.GetMembers()).ToImmutableArray();\n\n            if (!allMembersOfInterface.Any())\n            {\n                return false;\n            }\n\n            foreach (var interfaceMember in allMembersOfInterface)\n            {\n                if (declaredType.FindImplementationForInterfaceMember(interfaceMember) is { } classMember\n                    && (classMember.ContainingType.Equals(declaredType)\n                        || !classMember.ContainingType.Interfaces.Any(x => AllInterfacesAndSelf(x).Contains(interfaceType))))\n                {\n                    return false;\n                }\n            }\n            return true;\n\n            static IEnumerable<INamedTypeSymbol> AllInterfacesAndSelf(INamedTypeSymbol interfaceType) =>\n                interfaceType.AllInterfaces.Concat(new[] { interfaceType });\n        }\n\n        private static Location GetLocationWithToken(TypeSyntax type, SeparatedSyntaxList<BaseTypeSyntax> baseTypes)\n        {\n            var span = baseTypes.Count == 1 || baseTypes.First().Type != type\n                ? TextSpan.FromBounds(type.GetFirstToken().GetPreviousToken().Span.Start, type.Span.End)\n                : TextSpan.FromBounds(type.SpanStart, type.GetLastToken().GetNextToken().Span.End);\n\n            return Location.Create(type.SyntaxTree, span);\n        }\n\n        private static ImmutableDictionary<string, string> DiagnosticsProperties(int redundantIndex) =>\n            ImmutableDictionary.Create<string, string>().Add(RedundantIndexKey, redundantIndex.ToString());\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/RedundantInheritanceListCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Formatting;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class RedundantInheritanceListCodeFix : SonarCodeFix\n    {\n        private const string Title = \"Remove redundant declaration\";\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(RedundantInheritanceList.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            var baseList = (BaseListSyntax)root.FindNode(diagnosticSpan);\n            var redundantIndex = int.Parse(diagnostic.Properties[RedundantInheritanceList.RedundantIndexKey]);\n\n            context.RegisterCodeFix(\n                Title,\n                c =>\n                {\n                    var newRoot = RemoveDeclaration(root, baseList, redundantIndex);\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n\n            return Task.CompletedTask;\n        }\n\n        internal static bool HasLineEnding(SyntaxNode node) =>\n            node.HasTrailingTrivia\n            && node.GetTrailingTrivia().Last().IsKind(SyntaxKind.EndOfLineTrivia);\n\n        private static bool HasLineEnding(SyntaxToken token) =>\n            token.HasTrailingTrivia\n            && token.TrailingTrivia.Last().IsKind(SyntaxKind.EndOfLineTrivia);\n\n        private static SyntaxNode RemoveDeclaration(SyntaxNode root, BaseListSyntax baseList, int redundantIndex)\n        {\n            var newBaseList = baseList.RemoveNode(baseList.Types[redundantIndex], SyntaxRemoveOptions.KeepNoTrivia)\n                                      .WithAdditionalAnnotations(Formatter.Annotation);\n\n            if (newBaseList.Types.Count != 0)\n            {\n                return root.ReplaceNode(baseList, newBaseList);\n            }\n\n            var baseTypeHadLineEnding = HasLineEnding(baseList.Types[redundantIndex]);\n            var colonHadLineEnding = HasLineEnding(baseList.ColonToken);\n            var typeNameHadLineEnding = HasLineEnding(((BaseTypeDeclarationSyntax)baseList.Parent).Identifier);\n\n            var annotation = new SyntaxAnnotation();\n            var newRoot = root.ReplaceNode(baseList.Parent, baseList.Parent.WithAdditionalAnnotations(annotation));\n            var declaration = (BaseTypeDeclarationSyntax)newRoot.GetAnnotatedNodes(annotation).First();\n\n            newRoot = newRoot.RemoveNode(declaration.BaseList, SyntaxRemoveOptions.KeepNoTrivia);\n            declaration = (BaseTypeDeclarationSyntax)newRoot.GetAnnotatedNodes(annotation).First();\n\n            var needsNewLine = !typeNameHadLineEnding && (colonHadLineEnding || baseTypeHadLineEnding);\n\n            if (needsNewLine)\n            {\n                var trivia = SyntaxFactory.TriviaList();\n                if (declaration.Identifier.HasTrailingTrivia)\n                {\n                    trivia = declaration.Identifier.TrailingTrivia;\n                }\n\n                trivia = colonHadLineEnding\n                    ? trivia.Add(baseList.ColonToken.TrailingTrivia.Last())\n                    : trivia.AddRange(baseList.Types[redundantIndex].GetTrailingTrivia());\n\n                newRoot = newRoot.ReplaceToken(declaration.Identifier, declaration.Identifier.WithTrailingTrivia(trivia));\n            }\n\n            declaration = (BaseTypeDeclarationSyntax)newRoot.GetAnnotatedNodes(annotation).First();\n            return newRoot.ReplaceNode(declaration, declaration.WithoutAnnotations(annotation));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/RedundantJumpStatement.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CFG.Sonar;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class RedundantJumpStatement : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S3626\";\n    private const string MessageFormat = \"Remove this redundant jump.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            CheckForRedundantJumps,\n            SyntaxKind.MethodDeclaration,\n            SyntaxKind.ConstructorDeclaration,\n            SyntaxKind.DestructorDeclaration,\n            SyntaxKind.ConversionOperatorDeclaration,\n            SyntaxKind.OperatorDeclaration,\n            SyntaxKindEx.LocalFunctionStatement,\n            SyntaxKind.GetAccessorDeclaration,\n            SyntaxKind.SetAccessorDeclaration,\n            SyntaxKindEx.InitAccessorDeclaration,\n            SyntaxKind.AddAccessorDeclaration,\n            SyntaxKind.RemoveAccessorDeclaration,\n            SyntaxKind.AnonymousMethodExpression,\n            SyntaxKind.SimpleLambdaExpression,\n            SyntaxKind.ParenthesizedLambdaExpression);\n\n    private static void CheckForRedundantJumps(SonarSyntaxNodeReportingContext context)\n    {\n        if (!CSharpControlFlowGraph.TryGet(context.Node, context.Model, out var cfg))\n        {\n            return;\n        }\n\n        var yieldStatementCount = context.Node.DescendantNodes().OfType<YieldStatementSyntax>().Count();\n\n        var removableJumps = cfg.Blocks.OfType<JumpBlock>().Where(x => IsJumpRemovable(x, yieldStatementCount));\n\n        foreach (var jumpBlock in removableJumps)\n        {\n            context.ReportIssue(Rule, jumpBlock.JumpNode);\n        }\n    }\n\n    private static bool IsJumpRemovable(JumpBlock jumpBlock, int yieldStatementCount) =>\n        !IsInsideSwitch(jumpBlock)\n        && !IsReturnWithExpression(jumpBlock)\n        && !IsThrow(jumpBlock)\n        && !IsYieldReturn(jumpBlock)\n        && !IsOnlyYieldBreak(jumpBlock, yieldStatementCount)\n        && !IsValidJumpInsideTryCatch(jumpBlock)\n        && !IsReturnWithFollowingLocalFunction(jumpBlock)\n        && jumpBlock.SuccessorBlock == jumpBlock.WouldBeSuccessor;\n\n    private static bool IsValidJumpInsideTryCatch(JumpBlock jumpBlock) =>\n        jumpBlock.WouldBeSuccessor is BranchBlock branchBlock\n        && branchBlock.BranchingNode is FinallyClauseSyntax\n        && branchBlock.AllSuccessorBlocks.Count > 1;\n\n    private static bool IsInsideSwitch(JumpBlock jumpBlock) =>\n        // Not reporting inside switch, as the jumps might not be removable\n        jumpBlock.JumpNode.AncestorsAndSelf().OfType<SwitchStatementSyntax>().Any();\n\n    private static bool IsYieldReturn(JumpBlock jumpBlock) =>\n        // yield return cannot be redundant\n        jumpBlock.JumpNode is YieldStatementSyntax yieldStatement\n        && yieldStatement.IsKind(SyntaxKind.YieldReturnStatement);\n\n    private static bool IsOnlyYieldBreak(JumpBlock jumpBlock, int yieldStatementCount) =>\n        jumpBlock.JumpNode is YieldStatementSyntax yieldStatement\n        && yieldStatement.IsKind(SyntaxKind.YieldBreakStatement)\n        && yieldStatementCount == 1;\n\n    private static bool IsThrow(JumpBlock jumpBlock) =>\n        jumpBlock.JumpNode.Kind() is SyntaxKind.ThrowStatement or SyntaxKindEx.ThrowExpression;\n\n    private static bool IsReturnWithExpression(JumpBlock jumpBlock) =>\n        jumpBlock.JumpNode is ReturnStatementSyntax { Expression: not null };\n\n    private static bool IsReturnWithFollowingLocalFunction(JumpBlock jumpBlock) =>\n        jumpBlock.JumpNode.Parent.ChildNodes().Reverse().TakeWhile(x => x != jumpBlock.JumpNode).Any(x => x.IsKind(SyntaxKindEx.LocalFunctionStatement));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/RedundantModifier.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class RedundantModifier : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S2333\";\n        private const string MessageFormat = \"'{0}' is {1} in this context.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        private static readonly ISet<SyntaxKind> UnsafeConstructKinds = new HashSet<SyntaxKind>\n        {\n            SyntaxKind.AddressOfExpression,\n            SyntaxKind.PointerIndirectionExpression,\n            SyntaxKind.SizeOfExpression,\n            SyntaxKind.PointerType,\n            SyntaxKind.FixedStatement,\n            SyntaxKind.StackAllocArrayCreationExpression\n        };\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                CheckSealedMemberInSealedClass,\n                SyntaxKind.EventDeclaration,\n                SyntaxKind.EventFieldDeclaration,\n                SyntaxKind.IndexerDeclaration,\n                SyntaxKind.MethodDeclaration,\n                SyntaxKind.PropertyDeclaration);\n\n            context.RegisterNodeAction(\n                CheckTypeDeclarationForRedundantPartial,\n                SyntaxKind.ClassDeclaration,\n                SyntaxKind.InterfaceDeclaration,\n                SyntaxKindEx.RecordDeclaration,\n                SyntaxKindEx.RecordStructDeclaration,\n                SyntaxKind.StructDeclaration);\n\n            context.RegisterNodeAction(\n                CheckForUnnecessaryUnsafeBlocks,\n                SyntaxKind.ClassDeclaration,\n                SyntaxKind.InterfaceDeclaration,\n                SyntaxKindEx.RecordDeclaration,\n                SyntaxKindEx.RecordStructDeclaration,\n                SyntaxKind.StructDeclaration);\n\n            context.RegisterNodeAction(c =>\n                {\n                    if (CheckedWalker.IsTopLevel(c.Node))\n                    {\n                        new CheckedWalker(c).SafeVisit(c.Node);\n                    }\n                },\n                SyntaxKind.CheckedExpression,\n                SyntaxKind.CheckedStatement,\n                SyntaxKind.UncheckedExpression,\n                SyntaxKind.UncheckedStatement);\n        }\n\n        private static void CheckForUnnecessaryUnsafeBlocks(SonarSyntaxNodeReportingContext context)\n        {\n            var typeDeclaration = (TypeDeclarationSyntax)context.Node;\n            if (typeDeclaration.Parent is TypeDeclarationSyntax || context.IsRedundantPositionalRecordContext())\n            {\n                // only process top level type declarations\n                return;\n            }\n\n            CheckForUnnecessaryUnsafeBlocksBelow(context, typeDeclaration);\n        }\n\n        private static void CheckForUnnecessaryUnsafeBlocksBelow(SonarSyntaxNodeReportingContext context, TypeDeclarationSyntax typeDeclaration)\n        {\n            var unsafeKeyword = FindUnsafeKeyword(typeDeclaration);\n            if (unsafeKeyword == default)\n            {\n                foreach (var member in typeDeclaration.Members)\n                {\n                    CheckForUnnecessaryUnsafeBlocksInMember(context, member);\n                }\n            }\n            else\n            {\n                MarkAllUnsafeBlockInside(context, typeDeclaration);\n                if (!HasUnsafeConstructInside(typeDeclaration, context.Model))\n                {\n                    ReportOnUnsafeBlock(context, unsafeKeyword.GetLocation());\n                }\n            }\n        }\n\n        private static void CheckForUnnecessaryUnsafeBlocksInMember(SonarSyntaxNodeReportingContext context, MemberDeclarationSyntax member)\n        {\n            var unsafeKeyword = FindUnsafeKeyword(member);\n            if (unsafeKeyword != default)\n            {\n                MarkAllUnsafeBlockInside(context, member);\n                if (!HasUnsafeConstructInside(member, context.Model))\n                {\n                    ReportOnUnsafeBlock(context, unsafeKeyword.GetLocation());\n                }\n            }\n            else if (member is TypeDeclarationSyntax nestedTypeDeclaration)\n            {\n                CheckForUnnecessaryUnsafeBlocksBelow(context, nestedTypeDeclaration);\n            }\n            else\n            {\n                var topLevelUnsafeBlocks = member.DescendantNodes(n => !n.IsKind(SyntaxKind.UnsafeStatement)).OfType<UnsafeStatementSyntax>();\n                foreach (var topLevelUnsafeBlock in topLevelUnsafeBlocks)\n                {\n                    MarkAllUnsafeBlockInside(context, topLevelUnsafeBlock);\n                    if (!HasUnsafeConstructInside(member, context.Model))\n                    {\n                        ReportOnUnsafeBlock(context, topLevelUnsafeBlock.UnsafeKeyword.GetLocation());\n                    }\n                }\n            }\n        }\n\n        private static bool HasUnsafeConstructInside(SyntaxNode container, SemanticModel semanticModel) =>\n            ContainsUnsafeConstruct(container)\n            || ContainsFixedDeclaration(container)\n            || ContainsUnsafeTypedIdentifier(container, semanticModel)\n            || ContainsUnsafeInvocationReturnValue(container, semanticModel)\n            || ContainsUnsafeParameter(container, semanticModel);\n\n        private static bool ContainsUnsafeParameter(SyntaxNode container, SemanticModel semanticModel) =>\n            container.DescendantNodes()\n                .OfType<ParameterSyntax>()\n                .Any(x => IsUnsafe(semanticModel.GetDeclaredSymbol(x)?.Type));\n\n        private static bool ContainsUnsafeInvocationReturnValue(SyntaxNode container, SemanticModel semanticModel) =>\n            container.DescendantNodes()\n                .OfType<InvocationExpressionSyntax>()\n                .Any(x => semanticModel.GetSymbolInfo(x).Symbol is IMethodSymbol method && IsUnsafe(method.ReturnType));\n\n        private static bool ContainsUnsafeTypedIdentifier(SyntaxNode container, SemanticModel semanticModel) =>\n            container.DescendantNodes()\n                .OfType<IdentifierNameSyntax>()\n                .Any(x => IsUnsafe(semanticModel.GetTypeInfo(x).Type));\n\n        private static bool ContainsFixedDeclaration(SyntaxNode container) =>\n            container.DescendantNodes()\n                .OfType<FieldDeclarationSyntax>()\n                .Any(x => x.Modifiers.Any(SyntaxKind.FixedKeyword));\n\n        private static bool ContainsUnsafeConstruct(SyntaxNode container) =>\n            container.DescendantNodes().Any(x => UnsafeConstructKinds.Contains(x.Kind()));\n\n        private static bool IsUnsafe(ITypeSymbol type) =>\n            type != null\n            && (type.TypeKind == TypeKind.Pointer\n                || (type.TypeKind == TypeKind.Array && IsUnsafe(((IArrayTypeSymbol)type).ElementType)));\n\n        private static void MarkAllUnsafeBlockInside(SonarSyntaxNodeReportingContext context, SyntaxNode container)\n        {\n            foreach (var @unsafe in container.DescendantNodes().SelectMany(x => x.ChildTokens()).Where(x => x.IsKind(SyntaxKind.UnsafeKeyword)))\n            {\n                ReportOnUnsafeBlock(context, @unsafe.GetLocation());\n            }\n        }\n\n        private static void ReportOnUnsafeBlock(SonarSyntaxNodeReportingContext context, Location issueLocation) =>\n            context.ReportIssue(Rule, issueLocation, \"unsafe\", \"redundant\");\n\n        private static SyntaxToken FindUnsafeKeyword(MemberDeclarationSyntax memberDeclaration) =>\n            Modifiers(memberDeclaration).FirstOrDefault(x => x.IsKind(SyntaxKind.UnsafeKeyword));\n\n        private static void CheckTypeDeclarationForRedundantPartial(SonarSyntaxNodeReportingContext context)\n        {\n            var typeDeclaration = (TypeDeclarationSyntax)context.Node;\n            if (!context.IsRedundantPositionalRecordContext()\n                && typeDeclaration.Modifiers.Any(SyntaxKind.PartialKeyword)\n                && context.Model.GetDeclaredSymbol(typeDeclaration) is { DeclaringSyntaxReferences.Length: <= 1 })\n            {\n                var keyword = typeDeclaration.Modifiers.First(m => m.IsKind(SyntaxKind.PartialKeyword));\n                context.ReportIssue(Rule, keyword, \"partial\", \"gratuitous\");\n            }\n        }\n\n        private static SyntaxTokenList Modifiers(MemberDeclarationSyntax memberDeclaration) =>\n            memberDeclaration switch\n            {\n                BasePropertyDeclarationSyntax propertyDeclaration => propertyDeclaration.Modifiers,\n                BaseMethodDeclarationSyntax methodDeclaration => methodDeclaration.Modifiers,\n                BaseFieldDeclarationSyntax fieldDeclaration => fieldDeclaration.Modifiers,\n                DelegateDeclarationSyntax delegateDeclaration => delegateDeclaration.Modifiers,\n                TypeDeclarationSyntax typeDeclaration => typeDeclaration.Modifiers,\n                _ => default\n            };\n\n        private static void CheckSealedMemberInSealedClass(SonarSyntaxNodeReportingContext context)\n        {\n            if (Modifiers((MemberDeclarationSyntax)context.Node) is var modifiers\n                && modifiers.Any(SyntaxKind.SealedKeyword)\n                && context.ContainingSymbol.ContainingType is { IsSealed: true })\n            {\n                var keyword = modifiers.First(m => m.IsKind(SyntaxKind.SealedKeyword));\n                context.ReportIssue(Rule, keyword, \"sealed\", \"redundant\");\n            }\n        }\n\n        private sealed class CheckedWalker : SafeCSharpSyntaxWalker\n        {\n            private static readonly ISet<SyntaxKind> BinaryOperationsForChecked = new HashSet<SyntaxKind>\n            {\n                SyntaxKind.AddExpression,\n                SyntaxKind.SubtractExpression,\n                SyntaxKind.MultiplyExpression,\n                SyntaxKind.DivideExpression\n            };\n\n            private static readonly ISet<SyntaxKind> AssignmentsForChecked = new HashSet<SyntaxKind>\n            {\n                SyntaxKind.AddAssignmentExpression,\n                SyntaxKind.SubtractAssignmentExpression,\n                SyntaxKind.MultiplyAssignmentExpression,\n                SyntaxKind.DivideAssignmentExpression\n            };\n\n            private static readonly ISet<SyntaxKind> UnaryOperationsForChecked = new HashSet<SyntaxKind>\n            {\n                SyntaxKind.UnaryMinusExpression,\n                SyntaxKind.PostDecrementExpression,\n                SyntaxKind.PostIncrementExpression,\n                SyntaxKind.PreDecrementExpression,\n                SyntaxKind.PreIncrementExpression\n            };\n\n            private readonly SonarSyntaxNodeReportingContext context;\n            private bool isCurrentContextChecked;\n            private bool currentContextHasIntegralOperation;\n\n            public CheckedWalker(SonarSyntaxNodeReportingContext context)\n            {\n                this.context = context;\n                isCurrentContextChecked = context.Node switch\n                {\n                    CheckedStatementSyntax statement => statement.IsKind(SyntaxKind.CheckedStatement),\n                    CheckedExpressionSyntax expression => expression.IsKind(SyntaxKind.CheckedExpression),\n                    _ => false\n                };\n            }\n\n            public override void VisitCheckedExpression(CheckedExpressionSyntax node) =>\n                VisitChecked(node, SyntaxKind.CheckedExpression, node.Keyword, base.VisitCheckedExpression);\n\n            public override void VisitCheckedStatement(CheckedStatementSyntax node) =>\n                VisitChecked(node, SyntaxKind.CheckedStatement, node.Keyword, base.VisitCheckedStatement);\n\n            public override void VisitAssignmentExpression(AssignmentExpressionSyntax node)\n            {\n                base.VisitAssignmentExpression(node);\n                if (AssignmentsForChecked.Contains(node.Kind()))\n                {\n                    SetHasIntegralOperation(node);\n                }\n            }\n\n            public override void VisitBinaryExpression(BinaryExpressionSyntax node)\n            {\n                base.VisitBinaryExpression(node);\n                if (BinaryOperationsForChecked.Contains(node.Kind()))\n                {\n                    SetHasIntegralOperation(node);\n                }\n            }\n\n            public override void VisitPrefixUnaryExpression(PrefixUnaryExpressionSyntax node)\n            {\n                base.VisitPrefixUnaryExpression(node);\n                if (UnaryOperationsForChecked.Contains(node.Kind()))\n                {\n                    SetHasIntegralOperation(node);\n                }\n            }\n\n            public override void VisitCastExpression(CastExpressionSyntax node)\n            {\n                base.VisitCastExpression(node);\n                SetHasIntegralOperation(node);\n            }\n\n            public static bool IsTopLevel(SyntaxNode node) =>\n                !node.HasAncestor(SyntaxKind.CheckedStatement, SyntaxKind.CheckedExpression);\n\n            private void VisitChecked<T>(T node, SyntaxKind checkedKind, SyntaxToken tokenToReport, Action<T> baseCall)\n                where T : SyntaxNode\n            {\n                var isThisNodeChecked = node.IsKind(checkedKind);\n                var originalIsCurrentContextChecked = isCurrentContextChecked;\n                var originalContextHasIntegralOperation = currentContextHasIntegralOperation;\n                isCurrentContextChecked = isThisNodeChecked;\n                currentContextHasIntegralOperation = false;\n\n                baseCall(node);\n\n                var isSimplyRedundant = IsCurrentNodeEmbeddedInsideSameChecked(node, isThisNodeChecked, originalIsCurrentContextChecked);\n                if (isSimplyRedundant || !currentContextHasIntegralOperation)\n                {\n                    var keywordToReport = isThisNodeChecked ? \"checked\" : \"unchecked\";\n                    context.ReportIssue(Rule, tokenToReport, keywordToReport, \"redundant\");\n                }\n                isCurrentContextChecked = originalIsCurrentContextChecked;\n                currentContextHasIntegralOperation = originalContextHasIntegralOperation || (currentContextHasIntegralOperation && isSimplyRedundant);\n            }\n\n            private bool IsCurrentNodeEmbeddedInsideSameChecked(SyntaxNode node, bool isThisNodeChecked, bool isCurrentContextChecked) =>\n                isThisNodeChecked == isCurrentContextChecked && node != context.Node;\n\n            private void SetHasIntegralOperation(CastExpressionSyntax node)\n            {\n                if (!currentContextHasIntegralOperation)\n                {\n                    var expressionType = context.Model.GetTypeInfo(node.Expression).Type;\n                    var castedToType = context.Model.GetTypeInfo(node.Type).Type;\n                    currentContextHasIntegralOperation = castedToType is not null && expressionType is not null && castedToType.IsAny(KnownType.IntegralNumbers);\n                }\n            }\n\n            private void SetHasIntegralOperation(ExpressionSyntax node) =>\n                currentContextHasIntegralOperation = currentContextHasIntegralOperation\n                    || (context.Model.GetSymbolInfo(node).Symbol is IMethodSymbol methodSymbol && methodSymbol.ReceiverType.IsAny(KnownType.IntegralNumbers));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/RedundantModifierCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Formatting;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class RedundantModifierCodeFix : SonarCodeFix\n    {\n        internal const string TitleUnsafe = \"Remove redundant 'unsafe' modifier\";\n        internal const string TitleChecked = \"Remove redundant 'checked' and 'unchecked' modifier\";\n        internal const string TitlePartial = \"Remove redundant 'partial' modifier\";\n        internal const string TitleSealed = \"Remove redundant 'sealed' modifier\";\n\n        private static readonly SyntaxKind[] SimpleTokenKinds =\n        {\n            SyntaxKind.PartialKeyword,\n            SyntaxKind.SealedKeyword\n        };\n\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(RedundantModifier.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            var token = root.FindToken(diagnosticSpan.Start);\n\n            if (token.IsKind(SyntaxKind.UnsafeKeyword))\n            {\n                context.RegisterCodeFix(TitleUnsafe, c => ReplaceRoot(context, RemoveRedundantUnsafe(root, token)), context.Diagnostics);\n            }\n            else if (SimpleTokenKinds.Contains(token.Kind()))\n            {\n                var title = token.IsKind(SyntaxKind.PartialKeyword) ? TitlePartial : TitleSealed;\n                context.RegisterCodeFix(title, c => ReplaceRoot(context, RemoveRedundantToken(root, token)), context.Diagnostics);\n            }\n            else if (token.Parent is CheckedStatementSyntax checkedStatement)\n            {\n                context.RegisterCodeFix(TitleChecked, c => ReplaceRoot(context, RemoveRedundantCheckedStatement(root, checkedStatement)), context.Diagnostics);\n            }\n            else if (token.Parent is CheckedExpressionSyntax checkedExpression)\n            {\n                context.RegisterCodeFix(TitleChecked, c => ReplaceRoot(context, RemoveRedundantCheckedExpression(root, checkedExpression)), context.Diagnostics);\n            }\n            return Task.CompletedTask;\n        }\n\n        private static Task<Document> ReplaceRoot(SonarCodeFixContext context, SyntaxNode newRoot) =>\n            Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n\n        private static SyntaxNode RemoveRedundantUnsafe(SyntaxNode root, SyntaxToken token)\n        {\n            if (token.Parent is UnsafeStatementSyntax unsafeStatement)\n            {\n                return unsafeStatement.Parent is BlockSyntax parentBlock && parentBlock.Statements.Count == 1\n                    ? root.ReplaceNode(parentBlock, parentBlock.WithStatements(unsafeStatement.Block.Statements).WithAdditionalAnnotations(Formatter.Annotation))\n                    : root.ReplaceNode(unsafeStatement, unsafeStatement.Block.WithAdditionalAnnotations(Formatter.Annotation));\n            }\n            else\n            {\n                return RemoveRedundantToken(root, token);\n            }\n        }\n\n        private static SyntaxNode RemoveRedundantToken(SyntaxNode root, SyntaxToken token)\n        {\n            var oldParent = token.Parent;\n            var newParent = oldParent.ReplaceToken(token, SyntaxFactory.Token(SyntaxKind.None));\n            return root.ReplaceNode(oldParent, newParent.WithLeadingTrivia(oldParent.GetLeadingTrivia()));\n        }\n\n        private static SyntaxNode RemoveRedundantCheckedStatement(SyntaxNode root, CheckedStatementSyntax checkedStatement) =>\n            root.ReplaceNode(checkedStatement, SyntaxFactory.Block(checkedStatement.Block.Statements).WithTriviaFrom(checkedStatement));\n\n        private static SyntaxNode RemoveRedundantCheckedExpression(SyntaxNode root, CheckedExpressionSyntax checkedExpression) =>\n            root.ReplaceNode(checkedExpression, checkedExpression.Expression.WithTriviaFrom(checkedExpression));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/RedundantNullCheck.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class RedundantNullCheck : RedundantNullCheckBase<BinaryExpressionSyntax>\n    {\n        private const string MessageFormat = \"Remove this unnecessary null check; 'is' returns false for nulls.\";\n        private const string MessageFormatForPatterns = \"Remove this unnecessary null check; it is already done by the pattern match.\";\n\n        private static readonly DiagnosticDescriptor RuleForIs = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        private static readonly DiagnosticDescriptor RuleForPatternSyntax = DescriptorFactory.Create(DiagnosticId, MessageFormatForPatterns);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(RuleForIs, RuleForPatternSyntax);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(CheckAndExpression, SyntaxKind.LogicalAndExpression);\n            context.RegisterNodeAction(CheckOrExpression, SyntaxKind.LogicalOrExpression);\n            context.RegisterNodeAction(CheckAndPattern, SyntaxKindEx.AndPattern);\n            context.RegisterNodeAction(CheckOrPattern, SyntaxKindEx.OrPattern);\n        }\n\n        protected override SyntaxNode GetLeftNode(BinaryExpressionSyntax binaryExpression) => binaryExpression.Left.RemoveParentheses();\n\n        protected override SyntaxNode GetRightNode(BinaryExpressionSyntax binaryExpression) => binaryExpression.Right.RemoveParentheses();\n\n        protected override SyntaxNode GetNullCheckVariable(SyntaxNode node) => GetNullCheckVariable(node, true);\n\n        protected override SyntaxNode GetNonNullCheckVariable(SyntaxNode node) => GetNullCheckVariable(node, false);\n\n        protected override SyntaxNode GetIsOperatorCheckVariable(SyntaxNode node)\n        {\n            var innerExpression = node.RemoveParentheses();\n            if (innerExpression is BinaryExpressionSyntax binaryExpression && binaryExpression.IsKind(SyntaxKind.IsExpression))\n            {\n                return GetLeftNode(binaryExpression);\n            }\n            else if (innerExpression.IsKind(SyntaxKindEx.IsPatternExpression))\n            {\n                var isPatternExpression = (IsPatternExpressionSyntaxWrapper)innerExpression.RemoveParentheses();\n                if (IsAffirmativePatternMatch(isPatternExpression))\n                {\n                    return isPatternExpression.Expression.RemoveParentheses();\n                }\n            }\n            return null;\n\n            // Verifies the given pattern is like \"foo is Bar\" - where Bar can be various Patterns, except 'null'.\n            static bool IsAffirmativePatternMatch(IsPatternExpressionSyntaxWrapper isPatternWrapper) =>\n                !isPatternWrapper.IsNull() && !isPatternWrapper.IsNot();\n        }\n\n        protected override SyntaxNode GetInvertedIsOperatorCheckVariable(SyntaxNode node)\n        {\n            var innerExpression = node.RemoveParentheses();\n            if (innerExpression is PrefixUnaryExpressionSyntax prefixUnary && prefixUnary.IsKind(SyntaxKind.LogicalNotExpression))\n            {\n                return GetIsOperatorCheckVariable(prefixUnary.Operand);\n            }\n            else if (innerExpression.IsKind(SyntaxKindEx.IsPatternExpression))\n            {\n                var isPatternExpression = (IsPatternExpressionSyntaxWrapper)innerExpression.RemoveParentheses();\n                if (IsNegativePatternMatch(isPatternExpression))\n                {\n                    return isPatternExpression.Expression.RemoveParentheses();\n                }\n            }\n            return null;\n\n            // Verifies the pattern is like \"foo is not Bar\" - where Bar can be various Patterns, except 'null'.\n            static bool IsNegativePatternMatch(IsPatternExpressionSyntaxWrapper patternSyntaxWrapper) =>\n                patternSyntaxWrapper.IsNot() && !patternSyntaxWrapper.IsNotNull();\n        }\n\n        protected override bool AreEquivalent(SyntaxNode node1, SyntaxNode node2) => CSharpEquivalenceChecker.AreEquivalent(node1, node2);\n\n        private static void CheckAndPattern(SonarSyntaxNodeReportingContext context)\n        {\n            var binaryPatternNode = (BinaryPatternSyntaxWrapper)context.Node;\n            var left = binaryPatternNode.Left.SyntaxNode.RemoveParentheses();\n            var right = binaryPatternNode.Right.SyntaxNode.RemoveParentheses();\n\n            if (IsNotNullPattern(left) && IsAffirmativePatternMatch(right))\n            {\n                context.ReportIssue(RuleForPatternSyntax, left);\n            }\n            else if (IsNotNullPattern(right) && IsAffirmativePatternMatch(left))\n            {\n                context.ReportIssue(RuleForPatternSyntax, right);\n            }\n\n            static bool IsNotNullPattern(SyntaxNode node) =>\n                UnaryPatternSyntaxWrapper.IsInstance(node)\n                && ((UnaryPatternSyntaxWrapper)node) is var unaryPatternSyntaxWrapper\n                && unaryPatternSyntaxWrapper.IsNotNull();\n\n            // Verifies the given pattern is an affirmative pattern - constant pattern (except 'null'), Declaration pattern, Recursive pattern.\n            // The PatternSyntax appears e.g. in switch arms and is different from IsPatternSyntax.\n            static bool IsAffirmativePatternMatch(SyntaxNode node) =>\n                PatternSyntaxWrapper.IsInstance(node)\n                && ((PatternSyntaxWrapper)node) is var isPatternWrapper\n                && !isPatternWrapper.IsNot()\n                && !isPatternWrapper.IsNull();\n        }\n\n        private static void CheckOrPattern(SonarSyntaxNodeReportingContext context)\n        {\n            var binaryPatternNode = (BinaryPatternSyntaxWrapper)context.Node;\n            var left = binaryPatternNode.Left.SyntaxNode.RemoveParentheses();\n            var right = binaryPatternNode.Right.SyntaxNode.RemoveParentheses();\n            if (PatternSyntaxWrapper.IsInstance(left) && PatternSyntaxWrapper.IsInstance(right))\n            {\n                var leftPattern = (PatternSyntaxWrapper)left;\n                var rightPattern = (PatternSyntaxWrapper)right;\n                if (leftPattern.IsNull() && IsNegativePatternMatch(rightPattern))\n                {\n                    context.ReportIssue(RuleForPatternSyntax, left);\n                }\n                else if (rightPattern.IsNull() && IsNegativePatternMatch(leftPattern))\n                {\n                    context.ReportIssue(RuleForPatternSyntax, right);\n                }\n            }\n\n            // Verifies that it's like a negative pattern except 'not null' e.g. 'not Apple', 'not (5 or 6)'.\n            // The PatternSyntax appears e.g. in switch arms and is different from IsPatternSyntax.\n            static bool IsNegativePatternMatch(PatternSyntaxWrapper node) =>\n                node.IsNot()\n                && ((UnaryPatternSyntaxWrapper)node) is var unaryPatternSyntaxWrapper\n                && !unaryPatternSyntaxWrapper.Pattern.IsNull();\n        }\n\n        /// <summary>\n        /// Retrieves the variable that gets null-checked only if the null-check respects the expectation of the caller (it is either an affirmative or a negative check).\n        /// For example:\n        /// - if the node is \"foo is null\" / \"foo == null\" and expectedAffirmative is \"true\", the method will return \"foo\".\n        /// - if the node is \"foo is null\" / \"foo == null\" and expectedAffirmative is \"false\", the method will return null.\n        /// - if the node is \"foo is not null\" / \"foo != null\" / \"!(foo is null)\" and expectedAffirmative is \"true\", the method will return null.\n        /// - if the node is \"foo is not null\" / \"foo != null\" / \"!(foo is null)\" and expectedAffirmative is \"false\", the method will return \"foo\".\n        /// </summary>\n        private static SyntaxNode GetNullCheckVariable(SyntaxNode node, bool expectedAffirmative)\n        {\n            var innerExpression = node.RemoveParentheses();\n            if (innerExpression is PrefixUnaryExpressionSyntax prefixUnary && prefixUnary.IsKind(SyntaxKind.LogicalNotExpression))\n            {\n                innerExpression = prefixUnary.Operand;\n                expectedAffirmative = !expectedAffirmative;\n            }\n            if (((ExpressionSyntax)innerExpression).TryGetExpressionComparedToNull(out var compared, out var actualAffirmative)\n                && actualAffirmative == expectedAffirmative)\n            {\n                return compared;\n            }\n            return null;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/RedundantNullCheckCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class RedundantNullCheckCodeFix : SonarCodeFix\n    {\n        internal const string Title = \"Remove this unnecessary null check\";\n\n        public override ImmutableArray<string> FixableDiagnosticIds { get; } = ImmutableArray.Create(RedundantNullCheck.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            var diagnosticNode = root.FindNode(diagnosticSpan, getInnermostNodeForTie: true);\n\n            if (diagnosticNode is BinaryExpressionSyntax nullCheckNode)\n            {\n                RegisterBinaryExpressionCodeFix(context, root, nullCheckNode);\n            }\n            else if (diagnosticNode is PrefixUnaryExpressionSyntax prefixUnary && prefixUnary.IsKind(SyntaxKind.LogicalNotExpression))\n            {\n                RegisterBinaryExpressionCodeFix(context, root, prefixUnary);\n            }\n            else if (IsPatternExpressionSyntaxWrapper.IsInstance(diagnosticNode))\n            {\n                var isPatternExpression = (IsPatternExpressionSyntaxWrapper)diagnosticNode.RemoveParentheses();\n                RegisterBinaryExpressionCodeFix(context, root, isPatternExpression.SyntaxNode);\n            }\n            else if (PatternSyntaxWrapper.IsInstance(diagnosticNode))\n            {\n                RegisterBinaryPatternCodeFix(context, root, ((PatternSyntaxWrapper)diagnosticNode).SyntaxNode);\n            }\n            else if (diagnosticNode.IsNullLiteral() && diagnosticNode.Parent.IsKind(SyntaxKindEx.ConstantPattern))\n            {\n                RegisterBinaryPatternCodeFix(context, root, diagnosticNode.Parent);\n            }\n\n            return Task.CompletedTask;\n        }\n\n        private static void RegisterBinaryExpressionCodeFix(SonarCodeFixContext context, SyntaxNode root, SyntaxNode mustBeReplaced) =>\n            context.RegisterCodeFix(\n                Title,\n                c =>\n                {\n                    var binaryExpression = mustBeReplaced.Parent.FirstAncestorOrSelf<BinaryExpressionSyntax>();\n                    var newRoot = root;\n                    if (binaryExpression != null)\n                    {\n                        newRoot = ReplaceNode(root, binaryExpression, binaryExpression.Left, binaryExpression.Right, mustBeReplaced);\n                    }\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n\n        private static void RegisterBinaryPatternCodeFix(SonarCodeFixContext context, SyntaxNode root, SyntaxNode mustBeReplaced) =>\n            context.RegisterCodeFix(\n                Title,\n                c =>\n                {\n                    var binaryExpression = mustBeReplaced.Parent.FirstAncestorOrSelf<SyntaxNode>(n => BinaryPatternSyntaxWrapper.IsInstance(n));\n                    var newRoot = root;\n                    if (binaryExpression != null)\n                    {\n                        var binaryPatternNode = (BinaryPatternSyntaxWrapper)binaryExpression;\n                        newRoot = ReplaceNode(root, binaryExpression, binaryPatternNode.Left.SyntaxNode, binaryPatternNode.Right.SyntaxNode, mustBeReplaced);\n                    }\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n\n        private static SyntaxNode ReplaceNode(SyntaxNode root, SyntaxNode binaryExpression, SyntaxNode binaryLeft, SyntaxNode binaryRight, SyntaxNode mustBeReplaced) =>\n            binaryLeft.RemoveParentheses() == mustBeReplaced\n                ? root.ReplaceNode(binaryExpression, binaryRight.WithTriviaFrom(binaryExpression))\n                : root.ReplaceNode(binaryExpression, binaryLeft.WithTriviaFrom(binaryExpression));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/RedundantNullableTypeComparison.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class RedundantNullableTypeComparison : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S3610\";\n        private const string MessageFormat = \"Remove this redundant type comparison.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var binary = (BinaryExpressionSyntax)c.Node;\n                    CheckGetTypeAndTypeOfEquality(c, binary.Left, binary.Right, binary.GetLocation());\n                    CheckGetTypeAndTypeOfEquality(c, binary.Right, binary.Left, binary.GetLocation());\n                },\n                SyntaxKind.EqualsExpression,\n                SyntaxKind.NotEqualsExpression);\n        }\n\n        private static void CheckGetTypeAndTypeOfEquality(SonarSyntaxNodeReportingContext context, ExpressionSyntax sideA, ExpressionSyntax sideB, Location location)\n        {\n            if (!(sideA as InvocationExpressionSyntax).IsGetTypeCall(context.Model))\n            {\n                return;\n            }\n\n            var typeSyntax = (sideB as TypeOfExpressionSyntax)?.Type;\n            if (typeSyntax == null)\n            {\n                return;\n            }\n\n            var typeSymbol = context.Model.GetTypeInfo(typeSyntax).Type;\n            if (typeSymbol != null &&\n                typeSymbol.OriginalDefinition.Is(KnownType.System_Nullable_T))\n            {\n                context.ReportIssue(rule, location);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/RedundantParentheses.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class RedundantParentheses : RedundantParenthesesBase<ParenthesizedExpressionSyntax, SyntaxKind>\n    {\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override GeneratedCodeRecognizer GeneratedCodeRecognizer => CSharpGeneratedCodeRecognizer.Instance;\n        protected override SyntaxKind ParenthesizedExpressionSyntaxKind { get; } = SyntaxKind.ParenthesizedExpression;\n\n        protected override SyntaxNode GetExpression(ParenthesizedExpressionSyntax parenthesizedExpression) =>\n            parenthesizedExpression.Expression;\n        protected override SyntaxToken GetOpenParenToken(ParenthesizedExpressionSyntax parenthesizedExpression) =>\n            parenthesizedExpression.OpenParenToken;\n        protected override SyntaxToken GetCloseParenToken(ParenthesizedExpressionSyntax parenthesizedExpression) =>\n            parenthesizedExpression.CloseParenToken;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/RedundantParenthesesCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class RedundantParenthesesCodeFix : SonarCodeFix\n    {\n        internal const string Title = \"Remove redundant parentheses\";\n        public override ImmutableArray<string> FixableDiagnosticIds =>\n            ImmutableArray.Create(RedundantParentheses.DiagnosticId, RedundantParenthesesObjectsCreation.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            var syntaxNode = root.FindNode(diagnosticSpan);\n\n            if (syntaxNode is ArgumentListSyntax ||\n                syntaxNode is AttributeArgumentListSyntax)\n            {\n                context.RegisterCodeFix(\n                    Title,\n                    c =>\n                    {\n                        var newRoot = root.RemoveNode(syntaxNode, SyntaxRemoveOptions.KeepExteriorTrivia | SyntaxRemoveOptions.KeepEndOfLine);\n                        return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                    },\n                    context.Diagnostics);\n            }\n            else\n            {\n                // Do nothing, we don't want to mess the code if we don't find what we expect\n            }\n\n            return Task.CompletedTask;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/RedundantParenthesesObjectsCreation.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class RedundantParenthesesObjectsCreation : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S3235\";\n        private const string MessageFormat = \"Remove these redundant parentheses.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var argumentList = (AttributeArgumentListSyntax)c.Node;\n                    if (!argumentList.Arguments.Any())\n                    {\n                        c.ReportIssue(rule, argumentList);\n                    }\n                },\n                SyntaxKind.AttributeArgumentList);\n\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var objectCreation = (ObjectCreationExpressionSyntax)c.Node;\n                    var argumentList = objectCreation.ArgumentList;\n                    if (argumentList != null &&\n                        objectCreation.Initializer != null &&\n                        !argumentList.Arguments.Any())\n                    {\n                        c.ReportIssue(rule, argumentList);\n                    }\n                },\n                SyntaxKind.ObjectCreationExpression);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/RedundantPropertyNamesInAnonymousClass.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class RedundantPropertyNamesInAnonymousClass : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S3441\";\n        private const string MessageFormat = \"Remove the redundant '{0} ='.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var anonymousObjectCreation = (AnonymousObjectCreationExpressionSyntax)c.Node;\n\n                    foreach (var initializer in GetRedundantInitializers(anonymousObjectCreation.Initializers))\n                    {\n                        c.ReportIssue(rule, initializer.NameEquals, initializer.NameEquals.Name.Identifier.ValueText);\n                    }\n                },\n                SyntaxKind.AnonymousObjectCreationExpression);\n        }\n\n        private static IEnumerable<AnonymousObjectMemberDeclaratorSyntax> GetRedundantInitializers(\n            IEnumerable<AnonymousObjectMemberDeclaratorSyntax> initializers)\n        {\n            var initializersToReportOn = new List<AnonymousObjectMemberDeclaratorSyntax>();\n\n            foreach (var initializer in initializers.Where(initializer => initializer.NameEquals != null))\n            {\n                if (initializer.Expression is IdentifierNameSyntax identifier &&\n                    identifier.Identifier.ValueText == initializer.NameEquals.Name.Identifier.ValueText)\n                {\n                    initializersToReportOn.Add(initializer);\n                }\n            }\n\n            return initializersToReportOn;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/RedundantPropertyNamesInAnonymousClassCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class RedundantPropertyNamesInAnonymousClassCodeFix : SonarCodeFix\n    {\n        internal const string Title = \"Remove redundant explicit property names\";\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(RedundantPropertyNamesInAnonymousClass.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            var nameEquals = root.FindNode(diagnosticSpan) as NameEqualsSyntax;\n            if (!(nameEquals?.Parent?.Parent is AnonymousObjectCreationExpressionSyntax anonymousObjectCreation))\n            {\n                return Task.CompletedTask;\n            }\n\n            context.RegisterCodeFix(\n                Title,\n                c =>\n                {\n                    var newInitializersWithSeparators = anonymousObjectCreation.Initializers.GetWithSeparators()\n                        .Select(item => GetNewSyntaxListItem(item));\n                    var newAnonymousObjectCreation = anonymousObjectCreation\n                        .WithInitializers(SyntaxFactory.SeparatedList<AnonymousObjectMemberDeclaratorSyntax>(newInitializersWithSeparators))\n                        .WithTriviaFrom(anonymousObjectCreation);\n\n                    var newRoot = root.ReplaceNode(\n                        anonymousObjectCreation,\n                        newAnonymousObjectCreation);\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n\n            return Task.CompletedTask;\n        }\n\n        private static SyntaxNodeOrToken GetNewSyntaxListItem(SyntaxNodeOrToken item)\n        {\n            if (!item.IsNode)\n            {\n                return item;\n            }\n\n            var member = (AnonymousObjectMemberDeclaratorSyntax)item.AsNode();\n            if (member.Expression is IdentifierNameSyntax identifier &&\n                identifier.Identifier.ValueText == member.NameEquals.Name.Identifier.ValueText)\n            {\n                return SyntaxFactory.AnonymousObjectMemberDeclarator(member.Expression).WithTriviaFrom(member);\n            }\n\n            return item;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/RedundantToArrayCall.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class RedundantToArrayCall : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S3456\";\n        private const string MessageFormat = \"Remove this redundant '{0}' call.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var memberAccess = GetRedundantMemberAccess(c, \"ToCharArray\", KnownType.System_String)\n                        ?? GetRedundantMemberAccess(c, \"ToArray\", KnownType.System_ReadOnlySpan_T);\n\n                    if (memberAccess is not null)\n                    {\n                        c.ReportIssue(Rule, memberAccess.Name, memberAccess.Name.Identifier.ValueText);\n                    }\n                },\n                SyntaxKind.InvocationExpression);\n\n        private static MemberAccessExpressionSyntax GetRedundantMemberAccess(SonarSyntaxNodeReportingContext context, string targetMethodName, KnownType targetKnownType)\n        {\n            var invocation = (InvocationExpressionSyntax)context.Node;\n\n            if ((invocation.Parent is ElementAccessExpressionSyntax || invocation.Parent is ForEachStatementSyntax)\n                && invocation.Expression is MemberAccessExpressionSyntax memberAccess\n                && IsTargetMethod(memberAccess))\n            {\n                return memberAccess;\n            }\n\n            return null;\n\n            bool IsTargetMethod(MemberAccessExpressionSyntax memberAccess) =>\n                memberAccess.Name.Identifier.ValueText == targetMethodName\n                && context.Model.GetSymbolInfo(invocation).Symbol is IMethodSymbol methodSymbol\n                && methodSymbol.IsInType(targetKnownType)\n                && methodSymbol.Parameters.Length == 0;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/RedundantToArrayCallCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class RedundantToArrayCallCodeFix : SonarCodeFix\n    {\n        private const string Title = \"Remove redundant 'ToArray' call\";\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(RedundantToArrayCall.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            var simpleNameSyntax = root.FindNode(diagnosticSpan) as SimpleNameSyntax;\n            var memberAccessExpressionSyntax = simpleNameSyntax?.Parent as MemberAccessExpressionSyntax;\n\n            if (memberAccessExpressionSyntax?.Parent is not InvocationExpressionSyntax invocationExpressionSyntax)\n            {\n                return Task.CompletedTask;\n            }\n\n            context.RegisterCodeFix(\n                Title,\n                c =>\n                {\n                    var newRoot = root.ReplaceNode(invocationExpressionSyntax, memberAccessExpressionSyntax.Expression);\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n\n            return Task.CompletedTask;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/RedundantToStringCall.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class RedundantToStringCall : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S1858\";\n        private const string MessageFormat = \"There's no need to call 'ToString()'{0}.\";\n        internal const string MessageCallOnString = \" on a string\";\n        internal const string MessageCompiler = \", the compiler will do it for you\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        private const string additionOperatorName = \"op_Addition\";\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            CheckToStringInvocationsOnStringAndInStringFormat(context);\n            CheckSidesOfAddExpressionsForToStringCall(context);\n            CheckRightSideOfAddAssignmentsForToStringCall(context);\n        }\n\n        private static void CheckRightSideOfAddAssignmentsForToStringCall(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var assignment = (AssignmentExpressionSyntax)c.Node;\n                    var operation = c.Model.GetSymbolInfo(assignment).Symbol as IMethodSymbol;\n                    if (!IsOperationAddOnString(operation))\n                    {\n                        return;\n                    }\n\n                    CheckRightExpressionForRemovableToStringCall(c, assignment);\n                },\n                SyntaxKind.AddAssignmentExpression);\n        }\n\n        private static void CheckSidesOfAddExpressionsForToStringCall(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var binary = (BinaryExpressionSyntax)c.Node;\n                    var operation = c.Model.GetSymbolInfo(binary).Symbol as IMethodSymbol;\n                    if (!IsOperationAddOnString(operation))\n                    {\n                        return;\n                    }\n\n                    CheckLeftExpressionForRemovableToStringCall(c, binary);\n                    CheckRightExpressionForRemovableToStringCall(c, binary);\n                },\n                SyntaxKind.AddExpression);\n        }\n\n        private static void CheckToStringInvocationsOnStringAndInStringFormat(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var invocation = (InvocationExpressionSyntax)c.Node;\n                    if (!IsArgumentlessToStringCallNotOnBaseExpression(invocation, c.Model, out var location, out var methodSymbol))\n                    {\n                        return;\n                    }\n\n                    if (methodSymbol.IsInType(KnownType.System_String))\n                    {\n                        c.ReportIssue(rule, location, MessageCallOnString);\n                        return;\n                    }\n\n                    if (!TryGetExpressionTypeOfOwner(invocation, c.Model, out var subExpressionType) ||\n                        subExpressionType.IsValueType)\n                    {\n                        return;\n                    }\n\n                    var stringFormatArgument = invocation?.Parent as ArgumentSyntax;\n                    if (!(stringFormatArgument?.Parent?.Parent is InvocationExpressionSyntax stringFormatInvocation) ||\n                        !IsStringFormatCall(c.Model.GetSymbolInfo(stringFormatInvocation).Symbol as IMethodSymbol))\n                    {\n                        return;\n                    }\n\n                    var parameterLookup = new CSharpMethodParameterLookup(stringFormatInvocation, c.Model);\n                    if (parameterLookup.TryGetSymbol(stringFormatArgument, out var argParameter) &&\n                        argParameter.Name.StartsWith(\"arg\", StringComparison.Ordinal))\n                    {\n                        c.ReportIssue(rule, location, MessageCompiler);\n                    }\n                },\n                SyntaxKind.InvocationExpression);\n        }\n\n        private static void CheckLeftExpressionForRemovableToStringCall(SonarSyntaxNodeReportingContext context,\n            BinaryExpressionSyntax binary)\n        {\n            CheckExpressionForRemovableToStringCall(context, binary.Left, binary.Right, 0);\n        }\n        private static void CheckRightExpressionForRemovableToStringCall(SonarSyntaxNodeReportingContext context,\n            BinaryExpressionSyntax binary)\n        {\n            CheckExpressionForRemovableToStringCall(context, binary.Right, binary.Left, 1);\n        }\n        private static void CheckRightExpressionForRemovableToStringCall(SonarSyntaxNodeReportingContext context,\n            AssignmentExpressionSyntax assignment)\n        {\n            CheckExpressionForRemovableToStringCall(context, assignment.Right, assignment.Left, 1);\n        }\n\n        private static void CheckExpressionForRemovableToStringCall(SonarSyntaxNodeReportingContext context,\n            ExpressionSyntax expressionWithToStringCall, ExpressionSyntax otherOperandOfAddition, int checkedSideIndex)\n        {\n            if (!IsArgumentlessToStringCallNotOnBaseExpression(expressionWithToStringCall, context.Model, out var location, out var methodSymbol) ||\n                methodSymbol.IsInType(KnownType.System_String))\n            {\n                return;\n            }\n\n            var sideBType = context.Model.GetTypeInfo(otherOperandOfAddition).Type;\n            if (!sideBType.Is(KnownType.System_String))\n            {\n                return;\n            }\n\n            if (!TryGetExpressionTypeOfOwner((InvocationExpressionSyntax)expressionWithToStringCall, context.Model, out var subExpressionType) ||\n                subExpressionType.IsValueType)\n            {\n                return;\n            }\n\n            var stringParameterIndex = (checkedSideIndex + 1) % 2;\n            if (!DoesCollidingAdditionExist(subExpressionType, stringParameterIndex))\n            {\n                context.ReportIssue(rule, location, MessageCompiler);\n            }\n        }\n\n        private static bool TryGetExpressionTypeOfOwner(InvocationExpressionSyntax invocation, SemanticModel semanticModel,\n            out ITypeSymbol subExpressionType)\n        {\n            subExpressionType = null;\n\n            var subExpression = (invocation.Expression as MemberAccessExpressionSyntax)?.Expression;\n            if (subExpression == null)\n            {\n                return false;\n            }\n\n            subExpressionType = semanticModel.GetTypeInfo(subExpression).Type;\n            return subExpressionType != null;\n        }\n\n        private static bool DoesCollidingAdditionExist(ITypeSymbol subExpressionType, int stringParameterIndex)\n        {\n            return subExpressionType.GetMembers(additionOperatorName)\n                .OfType<IMethodSymbol>()\n                .Where(method =>\n                    method.MethodKind == MethodKind.BuiltinOperator ||\n                    method.MethodKind == MethodKind.UserDefinedOperator)\n                .Any(method =>\n                    method.Parameters.Length == 2 &&\n                    method.Parameters[stringParameterIndex].IsType(KnownType.System_String));\n        }\n\n        private static bool IsStringFormatCall(IMethodSymbol stringFormatSymbol)\n        {\n            return stringFormatSymbol != null &&\n                stringFormatSymbol.Name == \"Format\" &&\n                (stringFormatSymbol.ContainingType == null || stringFormatSymbol.IsInType(KnownType.System_String));\n        }\n\n        private static bool IsOperationAddOnString(IMethodSymbol operation)\n        {\n            return operation != null &&\n                operation.Name == additionOperatorName &&\n                operation.IsInType(KnownType.System_String);\n        }\n\n        private static bool IsArgumentlessToStringCallNotOnBaseExpression(ExpressionSyntax expression, SemanticModel semanticModel,\n            out Location location, out IMethodSymbol methodSymbol)\n        {\n            location = null;\n            methodSymbol = null;\n            if (!(expression is InvocationExpressionSyntax invocation) ||\n                invocation.ArgumentList.CloseParenToken.IsMissing)\n            {\n                return false;\n            }\n\n            if (!(invocation.Expression is MemberAccessExpressionSyntax memberAccess) ||\n                memberAccess.Expression is BaseExpressionSyntax)\n            {\n                return false;\n            }\n\n            methodSymbol = semanticModel.GetSymbolInfo(invocation).Symbol as IMethodSymbol;\n            if (!IsParameterlessToString(methodSymbol))\n            {\n                return false;\n            }\n\n            location = memberAccess.OperatorToken.CreateLocation(invocation);\n            return true;\n        }\n\n        private static bool IsParameterlessToString(IMethodSymbol methodSymbol)\n        {\n            return methodSymbol != null &&\n                methodSymbol.Name == \"ToString\" &&\n                !methodSymbol.Parameters.Any();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/RedundantToStringCallCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class RedundantToStringCallCodeFix : SonarCodeFix\n    {\n        internal const string Title = \"Remove redundant 'ToString' call\";\n        public override ImmutableArray<string> FixableDiagnosticIds =>\n            ImmutableArray.Create(RedundantToStringCall.DiagnosticId);\n\n        public override FixAllProvider GetFixAllProvider() =>\n            null;   // This CodeFix doesn't support FixAll (yet), because removing one .ToString() can invalidate other diagnostic in the same expression\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            var invocation = root.FindNode(diagnosticSpan, getInnermostNodeForTie: true) as InvocationExpressionSyntax;\n            if (!(invocation?.Expression is MemberAccessExpressionSyntax memberAccess))\n            {\n                return Task.CompletedTask;\n            }\n\n            context.RegisterCodeFix(\n                Title,\n                c =>\n                {\n                    var newRoot = root.ReplaceNode(invocation, memberAccess.Expression.WithTriviaFrom(invocation));\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n\n            return Task.CompletedTask;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ReferenceEqualityCheckWhenEqualsExists.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class ReferenceEqualityCheckWhenEqualsExists : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S1698\";\n        private const string MessageFormat = \"Consider using 'Equals' if value comparison was intended.\";\n        private const string EqualsName = nameof(Equals);\n\n        private static readonly DiagnosticDescriptor Rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        private static readonly ImmutableArray<KnownType> AllowedTypes =\n            ImmutableArray.Create(\n                KnownType.System_Type,\n                KnownType.System_Reflection_Assembly,\n                KnownType.System_Reflection_MemberInfo,\n                KnownType.System_Reflection_Module,\n                KnownType.System_Data_Common_CommandTrees_DbExpression,\n                KnownType.System_Object);\n\n        private static readonly ImmutableArray<KnownType> AllowedTypesWithAllDerived =\n            ImmutableArray.Create(KnownType.System_Windows_DependencyObject);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterCompilationStartAction(\n                compilationStartContext =>\n                {\n                    var allInterfacesWithImplementationsOverriddenEquals =\n                        compilationStartContext.Compilation.GlobalNamespace\n                            .GetAllNamedTypes()\n                            .Where(t => t.AllInterfaces.Any() && HasEqualsOverride(t))\n                            .SelectMany(t => t.AllInterfaces)\n                            .ToHashSet();\n\n                    compilationStartContext.RegisterNodeAction(\n                        c =>\n                        {\n                            var binary = (BinaryExpressionSyntax)c.Node;\n                            if (!IsBinaryCandidateForReporting(binary, c.Model))\n                            {\n                                return;\n                            }\n\n                            var typeLeft = c.Model.GetTypeInfo(binary.Left).Type;\n                            var typeRight = c.Model.GetTypeInfo(binary.Right).Type;\n                            if (IsAllowedTypeOrNull(typeLeft) || IsAllowedTypeOrNull(typeRight))\n                            {\n                                return;\n                            }\n\n                            if (MightOverrideEquals(typeLeft, allInterfacesWithImplementationsOverriddenEquals) ||\n                                MightOverrideEquals(typeRight, allInterfacesWithImplementationsOverriddenEquals))\n                            {\n                                c.ReportIssue(Rule, binary.OperatorToken);\n                            }\n                        },\n                        SyntaxKind.EqualsExpression,\n                        SyntaxKind.NotEqualsExpression);\n                });\n\n        private static bool MightOverrideEquals(ITypeSymbol type, ISet<INamedTypeSymbol> allInterfacesWithImplementationsOverriddenEquals) =>\n            HasEqualsOverride(type)\n            || allInterfacesWithImplementationsOverriddenEquals.Contains(type)\n            || HasTypeConstraintsWhichMightOverrideEquals(type, allInterfacesWithImplementationsOverriddenEquals);\n\n        private static bool HasTypeConstraintsWhichMightOverrideEquals(ITypeSymbol type, ISet<INamedTypeSymbol> allInterfacesWithImplementationsOverriddenEquals) =>\n            type is ITypeParameterSymbol genericParameter\n            && genericParameter.ConstraintTypes.Any(x => MightOverrideEquals(x, allInterfacesWithImplementationsOverriddenEquals));\n\n        private static bool IsAllowedTypeOrNull(ITypeSymbol type) =>\n            type is null || type.IsAny(AllowedTypes) || HasAllowedBaseType(type);\n\n        private static bool HasAllowedBaseType(ITypeSymbol type) =>\n            type.GetSelfAndBaseTypes().Any(t => t.IsAny(AllowedTypesWithAllDerived));\n\n        private static bool IsBinaryCandidateForReporting(BinaryExpressionSyntax binary, SemanticModel semanticModel) =>\n            semanticModel.GetSymbolInfo(binary).Symbol is IMethodSymbol equalitySymbol\n            && equalitySymbol.IsInType(KnownType.System_Object)\n            && !IsInEqualsOverride(semanticModel.GetEnclosingSymbol(binary.SpanStart) as IMethodSymbol);\n\n        private static bool HasEqualsOverride(ITypeSymbol type) =>\n            GetEqualsOverrides(type).Any(x => x.OverriddenMethod.IsInType(KnownType.System_Object));\n\n        private static IEnumerable<IMethodSymbol> GetEqualsOverrides(ITypeSymbol type)\n        {\n            var candidateEqualsMethods = new HashSet<IMethodSymbol>();\n\n            foreach (var currentType in type.GetSelfAndBaseTypes().TakeWhile(tp => !tp.Is(KnownType.System_Object)))\n            {\n                candidateEqualsMethods.UnionWith(currentType\n                    .GetMembers(EqualsName)\n                    .OfType<IMethodSymbol>()\n                    .Where(method => method.IsOverride && method.OverriddenMethod != null));\n            }\n\n            return candidateEqualsMethods;\n        }\n\n        private static bool IsInEqualsOverride(IMethodSymbol method)\n        {\n            var currentMethod = method;\n            while (currentMethod != null)\n            {\n                if (currentMethod.Name == EqualsName &&\n                    currentMethod.IsInType(KnownType.System_Object))\n                {\n                    return true;\n                }\n                currentMethod = currentMethod.OverriddenMethod;\n            }\n            return false;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ReferenceEqualsOnValueType.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class ReferenceEqualsOnValueType : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S2995\";\n        private const string MessageFormat = \"Use a different kind of comparison for these value types.\";\n\n        private const string ReferenceEqualsName = \"ReferenceEquals\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var invocation = (InvocationExpressionSyntax) c.Node;\n\n                    var methodSymbol = c.Model.GetSymbolInfo(invocation).Symbol as IMethodSymbol;\n                    if (methodSymbol.IsInType(KnownType.System_Object) &&\n                        methodSymbol.Name == ReferenceEqualsName &&\n                        AnyArgumentIsValueType(invocation.ArgumentList, c.Model))\n                    {\n                        c.ReportIssue(rule, invocation.Expression);\n                    }\n                },\n                SyntaxKind.InvocationExpression);\n        }\n\n        private static bool AnyArgumentIsValueType(ArgumentListSyntax argumentList, SemanticModel semanticModel)\n        {\n            return argumentList.Arguments.Any(argument =>\n            {\n                var type = semanticModel.GetTypeInfo(argument.Expression).Type;\n                return type != null && type.IsValueType;\n            });\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/RegularExpressions/RegexMustHaveValidSyntax.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class RegexMustHaveValidSyntax : RegexMustHaveValidSyntaxBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/RequireAttributeUsageAttribute.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class RequireAttributeUsageAttribute : SonarDiagnosticAnalyzer\n{\n    internal const string DiagnosticId = \"S3993\";\n    private const string MessageFormat = \"Specify AttributeUsage on '{0}'{1}.\";\n\n    private static readonly DiagnosticDescriptor Rule =\n        DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n        {\n            var classDeclaration = (ClassDeclarationSyntax)c.Node;\n\n            if (c.Model.GetDeclaredSymbol(classDeclaration) is { IsAbstract: false } classSymbol\n                && classSymbol.DerivesFrom(KnownType.System_Attribute)\n                && !classSymbol.HasAttribute(KnownType.System_AttributeUsageAttribute))\n            {\n                var additionalText = InheritsAttributeUsage(classSymbol)\n                    ? \" to improve readability, even though it inherits it from its base type\"\n                    : string.Empty;\n\n                c.ReportIssue(Rule, classDeclaration.Identifier, classSymbol.Name, additionalText);\n            }\n        },\n        SyntaxKind.ClassDeclaration);\n\n    private static bool InheritsAttributeUsage(INamedTypeSymbol classSymbol) =>\n        classSymbol.GetSelfAndBaseTypes()\n            // System.Attribute already has AttributeUsage, we don't want to report it\n            .TakeWhile(x => !x.Is(KnownType.System_Attribute))\n            .Any(x => x.HasAttribute(KnownType.System_AttributeUsageAttribute));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ReturnEmptyCollectionInsteadOfNull.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ReturnEmptyCollectionInsteadOfNull : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S1168\";\n    private const string MessageFormat = \"Return an empty collection instead of null.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    private static readonly ImmutableArray<KnownType> CollectionTypes = ImmutableArray.Create(\n        KnownType.System_Collections_IEnumerable,\n        KnownType.System_Array);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            ReportIfReturnsNullOrDefault,\n            SyntaxKind.MethodDeclaration,\n            SyntaxKindEx.LocalFunctionStatement,\n            SyntaxKind.PropertyDeclaration,\n            SyntaxKind.OperatorDeclaration,\n            SyntaxKind.IndexerDeclaration,\n            SyntaxKind.ConversionOperatorDeclaration);\n\n    private static void ReportIfReturnsNullOrDefault(SonarSyntaxNodeReportingContext context)\n    {\n        if (ExpressionBody(context.Node) is { } expressionBody)\n        {\n            var nullOrDefaultLiterals = NullOrDefaultExpressions(expressionBody.Expression)\n                .Select(x => x.GetLocation())\n                .ToList();\n\n            ReportIfAny(nullOrDefaultLiterals);\n        }\n        else if (Body(context.Node) is { } body)\n        {\n            var nullOrDefaultLiterals = ReturnNullOrDefaultExpressions(body)\n                .Select(x => x.GetLocation())\n                .ToList();\n\n            ReportIfAny(nullOrDefaultLiterals);\n        }\n\n        void ReportIfAny(List<Location> nullOrDefaultLiterals)\n        {\n            if (nullOrDefaultLiterals.Count > 0 && IsReturningCollection(context))\n            {\n                context.ReportIssue(Rule, nullOrDefaultLiterals[0], nullOrDefaultLiterals.Skip(1).ToSecondary(MessageFormat));\n            }\n        }\n    }\n\n    private static BlockSyntax Body(SyntaxNode node) =>\n        node is BasePropertyDeclarationSyntax property ? GetAccessor(property)?.Body : node.GetBody();\n\n    private static bool IsReturningCollection(SonarSyntaxNodeReportingContext context) =>\n        DeclaredType(context) is { } type\n        && !type.Is(KnownType.System_String)\n        && !type.DerivesFrom(KnownType.System_Xml_XmlNode)\n        && type.DerivesOrImplementsAny(CollectionTypes)\n        && type.NullableAnnotation() != NullableAnnotation.Annotated;\n\n    private static ITypeSymbol DeclaredType(SonarSyntaxNodeReportingContext context)\n    {\n        var symbol = context.Model.GetDeclaredSymbol(context.Node);\n        return symbol is IPropertySymbol property ? property.Type : ((IMethodSymbol)symbol).ReturnType;\n    }\n\n    private static ArrowExpressionClauseSyntax ExpressionBody(SyntaxNode node) =>\n        node switch\n        {\n            BaseMethodDeclarationSyntax method => method.ExpressionBody(),\n            BasePropertyDeclarationSyntax property => property.ArrowExpressionBody() ?? GetAccessor(property)?.ExpressionBody,\n            _ => ((LocalFunctionStatementSyntaxWrapper)node).ExpressionBody,\n        };\n\n    private static AccessorDeclarationSyntax GetAccessor(BasePropertyDeclarationSyntax property) =>\n        property.AccessorList.Accessors.FirstOrDefault(x => x.IsKind(SyntaxKind.GetAccessorDeclaration));\n\n    private static IEnumerable<SyntaxNode> ReturnNullOrDefaultExpressions(SyntaxNode methodBlock) =>\n        methodBlock.DescendantNodes(x =>\n            !(x.Kind() is SyntaxKindEx.LocalFunctionStatement\n                or SyntaxKind.SimpleLambdaExpression\n                or SyntaxKind.ParenthesizedLambdaExpression))\n            .OfType<ReturnStatementSyntax>()\n            .SelectMany(x => NullOrDefaultExpressions(x.Expression));\n\n    private static IEnumerable<SyntaxNode> NullOrDefaultExpressions(SyntaxNode node)\n    {\n        node = node.RemoveParentheses();\n        if (node.IsNullLiteral() || node?.Kind() is SyntaxKindEx.DefaultLiteralExpression or SyntaxKind.DefaultExpression)\n        {\n            yield return node;\n            yield break;\n        }\n        if (node is ConditionalExpressionSyntax c)\n        {\n            foreach (var innerNode in NullOrDefaultExpressions(c.WhenTrue))\n            {\n                yield return innerNode;\n            }\n            foreach (var innerNode in NullOrDefaultExpressions(c.WhenFalse))\n            {\n                yield return innerNode;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ReturnTypeNamedPartialShouldBeEscaped.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ReturnTypeNamedPartialShouldBeEscaped : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S8380\";\n    private const string MessageFormat = \"Return types named 'partial' should be escaped with '@'\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(compilationStart =>\n            {\n                if (!compilationStart.Compilation.IsAtLeastLanguageVersion(LanguageVersionEx.CSharp14))\n                {\n                    compilationStart.RegisterNodeAction(c =>\n                        {\n                            if (!IsGenericMethod(c.Node)\n                                && c.Node.TypeSyntax() is { } returnType\n                                && (returnType.Kind() == SyntaxKindEx.RefType ? ((RefTypeSyntaxWrapper)returnType).Type : returnType) is { } unWrapped\n                                && unWrapped is NameSyntax { Arity: 0 } name\n                                && name.GetIdentifier() is { Text: \"partial\" } identifier)\n                            {\n                                c.ReportIssue(Rule, identifier);\n                            }\n                        },\n                        SyntaxKind.MethodDeclaration,\n                        SyntaxKind.DelegateDeclaration,\n                        SyntaxKindEx.LocalFunctionStatement);\n                }\n            });\n\n    private static bool IsGenericMethod(SyntaxNode node) =>\n        node is MethodDeclarationSyntax { Arity: > 0 }\n        || node is DelegateDeclarationSyntax { Arity: > 0 }\n        || (node.IsKind(SyntaxKindEx.LocalFunctionStatement) && (LocalFunctionStatementSyntaxWrapper)node is { TypeParameterList.Parameters.Count: > 0 });\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ReturnValueIgnored.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ReturnValueIgnored : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S2201\";\n    private const string MessageFormat = \"Use the return value of method '{0}'.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    private static readonly ImmutableArray<KnownType> ImmutableKnownTypes =\n        ImmutableArray.Create(\n            KnownType.System_Object,\n            KnownType.System_Int16,\n            KnownType.System_Int32,\n            KnownType.System_Int64,\n            KnownType.System_UInt16,\n            KnownType.System_UInt32,\n            KnownType.System_UInt64,\n            KnownType.System_IntPtr,\n            KnownType.System_UIntPtr,\n            KnownType.System_Char,\n            KnownType.System_Byte,\n            KnownType.System_SByte,\n            KnownType.System_Single,\n            KnownType.System_Double,\n            KnownType.System_Decimal,\n            KnownType.System_Boolean,\n            KnownType.System_String,\n            KnownType.System_Collections_Frozen_FrozenSet,\n            KnownType.System_Collections_Immutable_ImmutableArray,\n            KnownType.System_Collections_Immutable_ImmutableArray_T,\n            KnownType.System_Collections_Immutable_ImmutableDictionary,\n            KnownType.System_Collections_Immutable_ImmutableDictionary_TKey_TValue,\n            KnownType.System_Collections_Immutable_ImmutableHashSet,\n            KnownType.System_Collections_Immutable_ImmutableHashSet_T,\n            KnownType.System_Collections_Immutable_ImmutableList,\n            KnownType.System_Collections_Immutable_ImmutableList_T,\n            KnownType.System_Collections_Immutable_ImmutableQueue,\n            KnownType.System_Collections_Immutable_ImmutableQueue_T,\n            KnownType.System_Collections_Immutable_ImmutableSortedDictionary,\n            KnownType.System_Collections_Immutable_ImmutableSortedDictionary_TKey_TValue,\n            KnownType.System_Collections_Immutable_ImmutableSortedSet,\n            KnownType.System_Collections_Immutable_ImmutableSortedSet_T,\n            KnownType.System_Collections_Immutable_ImmutableStack,\n            KnownType.System_Collections_Immutable_ImmutableStack_T);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(\n            c =>\n            {\n                var expressionStatement = (ExpressionStatementSyntax)c.Node;\n                CheckExpressionForPureMethod(c, expressionStatement.Expression);\n            },\n            SyntaxKind.ExpressionStatement);\n\n        context.RegisterNodeAction(\n            c =>\n            {\n                var lambda = (LambdaExpressionSyntax)c.Node;\n\n                if (c.Model.GetSymbolInfo(lambda).Symbol is not IMethodSymbol { ReturnsVoid: true } symbol)\n                {\n                    return;\n                }\n\n                var expression = lambda.Body as ExpressionSyntax;\n                CheckExpressionForPureMethod(c, expression);\n            },\n            SyntaxKind.ParenthesizedLambdaExpression,\n            SyntaxKind.SimpleLambdaExpression);\n    }\n\n    private static void CheckExpressionForPureMethod(SonarSyntaxNodeReportingContext context, ExpressionSyntax expression)\n    {\n        if (expression is InvocationExpressionSyntax invocation\n            && context.Model.GetSymbolInfo(invocation).Symbol is IMethodSymbol { ReturnsVoid: false } invokedMethodSymbol\n            && invokedMethodSymbol.Parameters.All(p => p.RefKind == RefKind.None)\n            && IsSideEffectFreeOrPure(invokedMethodSymbol))\n        {\n            context.ReportIssue(Rule, expression, invokedMethodSymbol.Name);\n        }\n    }\n\n    private static bool IsSideEffectFreeOrPure(IMethodSymbol invokedMethodSymbol)\n    {\n        var constructedFrom = invokedMethodSymbol.ContainingType.ConstructedFrom;\n\n        return IsLinqMethod(invokedMethodSymbol)\n            || HasOnlySideEffectFreeMethods(constructedFrom)\n            || IsPureMethod(invokedMethodSymbol, constructedFrom);\n    }\n\n    private static bool IsPureMethod(IMethodSymbol invokedMethodSymbol, INamedTypeSymbol containingType) =>\n        invokedMethodSymbol.HasAttribute(KnownType.System_Diagnostics_Contracts_PureAttribute)\n        || containingType.HasAttribute(KnownType.System_Diagnostics_Contracts_PureAttribute);\n\n    private static bool HasOnlySideEffectFreeMethods(INamedTypeSymbol containingType) =>\n        containingType.IsAny(ImmutableKnownTypes);\n\n    private static bool IsLinqMethod(IMethodSymbol methodSymbol) =>\n        methodSymbol.ContainingType.Is(KnownType.System_Linq_Enumerable)\n        || methodSymbol.ContainingType.Is(KnownType.System_Linq_ImmutableArrayExtensions);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ReuseClientBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\npublic abstract class ReuseClientBase : SonarDiagnosticAnalyzer\n{\n    private static readonly HashSet<SyntaxKind> ConditionalKinds =\n        [\n            SyntaxKind.IfStatement,\n            SyntaxKind.SwitchStatement,\n            SyntaxKindEx.SwitchExpression,\n            SyntaxKind.ConditionalExpression,\n            SyntaxKindEx.CoalesceAssignmentExpression\n        ];\n\n    protected abstract ImmutableArray<KnownType> ReusableClients { get; }\n\n    protected static bool IsAssignedForReuse(SonarSyntaxNodeReportingContext context) =>\n        !IsInVariableDeclaration(context.Node)\n        && (IsInConditionalCode(context.Node) || IsInFieldOrPropertyInitializer(context.Node) || IsAssignedToStaticFieldOrProperty(context));\n\n    protected bool IsReusableClient(SonarSyntaxNodeReportingContext context)\n    {\n        var objectCreation = ObjectCreationFactory.Create(context.Node);\n        return ReusableClients.Any(x => objectCreation.IsKnownType(x, context.Model));\n    }\n\n    private static bool IsInVariableDeclaration(SyntaxNode node) =>\n        node.Parent is EqualsValueClauseSyntax { Parent: VariableDeclaratorSyntax { Parent: VariableDeclarationSyntax { Parent: LocalDeclarationStatementSyntax or UsingStatementSyntax } } };\n\n    private static bool IsInFieldOrPropertyInitializer(SyntaxNode node) =>\n        node.HasAncestor(SyntaxKind.FieldDeclaration, SyntaxKind.PropertyDeclaration)\n        && !node.HasAncestor(SyntaxKind.GetAccessorDeclaration, SyntaxKind.SetAccessorDeclaration)\n        && !node.Parent.IsKind(SyntaxKind.ArrowExpressionClause);\n\n    private static bool IsInConditionalCode(SyntaxNode node) =>\n        node.HasAncestor(ConditionalKinds);\n\n    private static bool IsAssignedToStaticFieldOrProperty(SonarSyntaxNodeReportingContext context) =>\n        context.Node.Parent.WalkUpParentheses() is AssignmentExpressionSyntax assignment\n        && context.Model.GetSymbolInfo(assignment.Left, context.Cancel).Symbol is { IsStatic: true, Kind: SymbolKind.Field or SymbolKind.Property };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ReversedOperators.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class ReversedOperators : ReversedOperatorsBase<PrefixUnaryExpressionSyntax>\n    {\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                GetAnalysisAction(Rule),\n                SyntaxKind.UnaryMinusExpression,\n                SyntaxKind.UnaryPlusExpression,\n                SyntaxKind.LogicalNotExpression);\n\n        protected override SyntaxToken GetOperatorToken(PrefixUnaryExpressionSyntax e) => e.OperatorToken;\n\n        protected override bool IsEqualsToken(SyntaxToken token) => token.IsKind(SyntaxKind.EqualsToken);\n\n        protected override bool IsMinusToken(SyntaxToken token) => token.IsKind(SyntaxKind.MinusToken);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/RightCurlyBraceStartsLine.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class RightCurlyBraceStartsLine : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S1109\";\n        private const string MessageFormat = \"Move this closing curly brace to the next line.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterTreeAction(\n                c =>\n                {\n                    var root = c.Tree.GetRoot();\n                    foreach (var closeBraceToken in GetDescendantCloseBraceTokens(root)\n                        .Where(closeBraceToken =>\n                            !StartsLine(closeBraceToken) &&\n                            !IsOnSameLineAsOpenBrace(closeBraceToken) &&\n                            !IsInitializer(closeBraceToken.Parent)))\n                    {\n                        c.ReportIssue(rule, closeBraceToken);\n                    }\n                });\n        }\n\n        private static bool StartsLine(SyntaxToken token)\n        {\n            return token.GetPreviousToken().GetLocation().EndLine() != token.GetLocation().StartLine();\n        }\n\n        private static bool IsOnSameLineAsOpenBrace(SyntaxToken closeBraceToken)\n        {\n            var openBraceToken = closeBraceToken.Parent.ChildTokens().Single(token => token.IsKind(SyntaxKind.OpenBraceToken));\n            return openBraceToken.GetLocation().StartLine() == closeBraceToken.GetLocation().StartLine();\n        }\n\n        private static bool IsInitializer(SyntaxNode node)\n        {\n            return node.IsKind(SyntaxKind.ArrayInitializerExpression) ||\n                node.IsKind(SyntaxKind.CollectionInitializerExpression) ||\n                node.IsKind(SyntaxKind.AnonymousObjectCreationExpression) ||\n                node.IsKind(SyntaxKind.ObjectInitializerExpression);\n        }\n\n        private static IEnumerable<SyntaxToken> GetDescendantCloseBraceTokens(SyntaxNode node)\n        {\n            return node.DescendantTokens().Where(token => token.IsKind(SyntaxKind.CloseBraceToken));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/SecurityPInvokeMethodShouldNotBeCalled.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class SecurityPInvokeMethodShouldNotBeCalled : SecurityPInvokeMethodShouldNotBeCalledBase<SyntaxKind, InvocationExpressionSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n        protected override IMethodSymbol MethodSymbolForInvalidInvocation(SyntaxNode syntaxNode, SemanticModel semanticModel) =>\n            syntaxNode is IdentifierNameSyntax identifierName\n            && InvalidMethods.Contains(identifierName.Identifier.ValueText)\n            && semanticModel.GetSymbolInfo(syntaxNode).Symbol is IMethodSymbol methodSymbol\n                ? methodSymbol\n                : null;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/SelfAssignment.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class SelfAssignment : SelfAssignmentBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n                {\n                    var expression = (AssignmentExpressionSyntax)c.Node;\n\n                    if (expression.Parent is InitializerExpressionSyntax)\n                    {\n                        return;\n                    }\n\n                    foreach (var assigment in expression.MapAssignmentArguments().Where(x => CSharpEquivalenceChecker.AreEquivalent(x.Left, x.Right)))\n                    {\n                        c.ReportIssue(Rule, assigment.Left, [assigment.Right.ToSecondaryLocation()]);\n                    }\n                },\n                SyntaxKind.SimpleAssignmentExpression,\n                SyntaxKindEx.CoalesceAssignmentExpression);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/SerializationConstructorsShouldBeSecured.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [Obsolete(\"This rule has been deprecated since 9.14\")]\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class SerializationConstructorsShouldBeSecured : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S4212\";\n        private const string MessageFormat = \"Secure this serialization constructor.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        private static readonly AttributeComparer attributeComparer = new AttributeComparer();\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(FindPossibleViolations, SyntaxKind.ConstructorDeclaration);\n        }\n\n        private static void FindPossibleViolations(SonarSyntaxNodeReportingContext c)\n        {\n            var constructorSyntax = (ConstructorDeclarationSyntax)c.Node;\n            var reportLocation = constructorSyntax?.Identifier.GetLocation();\n            if (reportLocation == null)\n            {\n                return;\n            }\n\n            var serializationConstructor = c.Model.GetDeclaredSymbol(constructorSyntax);\n            if (!serializationConstructor.IsSerializationConstructor())\n            {\n                return;\n            }\n\n            var classSymbol = serializationConstructor.ContainingType;\n            if (!classSymbol.Implements(KnownType.System_Runtime_Serialization_ISerializable))\n            {\n                return;\n            }\n\n            var isAssemblyIsPartiallyTrusted = c.Model.Compilation.Assembly\n                .HasAttribute(KnownType.System_Security_AllowPartiallyTrustedCallersAttribute);\n            if (!isAssemblyIsPartiallyTrusted)\n            {\n                return;\n            }\n\n            var serializationConstructorAttributes = GetCASAttributes(serializationConstructor).ToHashSet();\n\n            bool isConstructorMissingAttributes = classSymbol.Constructors\n                .SelectMany(m => GetCASAttributes(m))\n                .Any(attr => !serializationConstructorAttributes.Contains(attr, attributeComparer));\n\n            if (isConstructorMissingAttributes)\n            {\n                c.ReportIssue(rule, reportLocation);\n            }\n        }\n\n        private static IEnumerable<AttributeData> GetCASAttributes(IMethodSymbol methodSymbol)\n        {\n            return methodSymbol.GetAttributes().Where(IsCASAttribute);\n\n            bool IsCASAttribute(AttributeData data) =>\n                data?.AttributeClass.DerivesFrom(KnownType.System_Security_Permissions_CodeAccessSecurityAttribute)\n                    ?? false;\n        }\n\n        private class AttributeComparer : IEqualityComparer<AttributeData>\n        {\n            public bool Equals(AttributeData x, AttributeData y)\n            {\n                return Equals(x.AttributeConstructor, y.AttributeConstructor) &&\n                    Enumerable.SequenceEqual(x.ConstructorArguments, y.ConstructorArguments) &&\n                    AreNamedArgumentsEqual(x.NamedArguments, y.NamedArguments);\n            }\n\n            private bool AreNamedArgumentsEqual(\n                IEnumerable<KeyValuePair<string, TypedConstant>> argumentsX,\n                IEnumerable<KeyValuePair<string, TypedConstant>> argumentsY)\n            {\n                var dictX = argumentsX.ToDictionary(p => p.Key, p => p.Value);\n                var dictY = argumentsY.ToDictionary(p => p.Key, p => p.Value);\n\n                if (dictX.Count != dictY.Count)\n                {\n                    return false;\n                }\n\n                foreach (var key in dictX.Keys)\n                {\n                    if (!dictX.TryGetValue(key, out TypedConstant itemX) ||\n                        !dictY.TryGetValue(key, out TypedConstant itemY) ||\n                        !Equals(itemX, itemY))\n                    {\n                        return false;\n                    }\n                }\n\n                return true;\n            }\n\n            public int GetHashCode(AttributeData obj) => 1;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/SetLocaleForDataTypes.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class SetLocaleForDataTypes : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S4057\";\n        private const string MessageFormat = \"Set the locale for this '{0}'.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        private static readonly ImmutableArray<KnownType> CheckedTypes = ImmutableArray.Create(\n            KnownType.System_Data_DataTable,\n            KnownType.System_Data_DataSet);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n        protected override bool EnableConcurrentExecution => false;\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterCompilationStartAction(\n                compilationStartContext =>\n                {\n                    var symbolsWhereTypeIsCreated = new Dictionary<ISymbol, SyntaxNode>();\n                    var symbolsWhereLocaleIsSet = new HashSet<ISymbol>();\n\n                    compilationStartContext.RegisterNodeAction(\n                        c => ProcessObjectCreations(c, symbolsWhereTypeIsCreated),\n                        SyntaxKind.ObjectCreationExpression,\n                        SyntaxKindEx.ImplicitObjectCreationExpression);\n                    compilationStartContext.RegisterNodeAction(c => ProcessSimpleAssignments(c, symbolsWhereLocaleIsSet), SyntaxKind.SimpleAssignmentExpression);\n                    compilationStartContext.RegisterCompilationEndAction(c => ProcessCollectedSymbols(c, symbolsWhereTypeIsCreated, symbolsWhereLocaleIsSet));\n                });\n\n        private static void ProcessObjectCreations(SonarSyntaxNodeReportingContext c, IDictionary<ISymbol, SyntaxNode> symbolsWhereTypeIsCreated)\n        {\n            if (GetSymbolFromConstructorInvocation(c.Node, c.Model) is ITypeSymbol objectType\n                && objectType.IsAny(CheckedTypes)\n                && GetAssignmentTargetVariable(c.Node) is { } variableSyntax)\n            {\n                if (DeclarationExpressionSyntaxWrapper.IsInstance(variableSyntax))\n                {\n                    variableSyntax = ((DeclarationExpressionSyntaxWrapper)variableSyntax).Designation;\n                }\n\n                var variableSymbol = variableSyntax is IdentifierNameSyntax\n                    ? c.Model.GetSymbolInfo(variableSyntax).Symbol\n                    : c.Model.GetDeclaredSymbol(variableSyntax);\n\n                if (variableSymbol != null && !symbolsWhereTypeIsCreated.ContainsKey(variableSymbol))\n                {\n                    symbolsWhereTypeIsCreated.Add(variableSymbol, c.Node);\n                }\n            }\n        }\n\n        private static void ProcessSimpleAssignments(SonarSyntaxNodeReportingContext c, ISet<ISymbol> symbolsWhereLocaleIsSet)\n        {\n            var assignmentExpression = (AssignmentExpressionSyntax)c.Node;\n            var variableSymbols = assignmentExpression.AssignmentTargets()\n                .Where(x => c.Model.GetSymbolInfo(x).Symbol is IPropertySymbol propertySymbol\n                            && propertySymbol.Name == \"Locale\"\n                            && propertySymbol.ContainingType.IsAny(CheckedTypes))\n                .Select(x => GetAccessedVariable(x, c.Model))\n                .WhereNotNull();\n            symbolsWhereLocaleIsSet.UnionWith(variableSymbols);\n        }\n\n        private static void ProcessCollectedSymbols(SonarCompilationReportingContext c, IDictionary<ISymbol, SyntaxNode> symbolsWhereTypeIsCreated, ISet<ISymbol> symbolsWhereLocaleIsSet)\n        {\n            foreach (var invalidCreation in symbolsWhereTypeIsCreated.Where(x => !symbolsWhereLocaleIsSet.Contains(x.Key)))\n            {\n                if (invalidCreation.Key.GetSymbolType() is { } type)\n                {\n                    c.ReportIssue(Rule, invalidCreation.Value.GetLocation(), type.Name);\n                }\n            }\n        }\n\n        private static ISymbol GetSymbolFromConstructorInvocation(SyntaxNode constructorCall, SemanticModel semanticModel) =>\n            constructorCall is ObjectCreationExpressionSyntax objectCreation\n                ? semanticModel.GetSymbolInfo(objectCreation.Type).Symbol\n                : semanticModel.GetSymbolInfo(constructorCall).Symbol?.ContainingType;\n\n        private static SyntaxNode GetAssignmentTargetVariable(SyntaxNode objectCreation) =>\n            objectCreation.GetFirstNonParenthesizedParent() switch\n            {\n                AssignmentExpressionSyntax assignment => assignment.Left,\n                EqualsValueClauseSyntax { Parent: VariableDeclaratorSyntax declarator } => declarator,\n                ArgumentSyntax argument => argument.FindAssignmentComplement(),\n                _ => null,\n            };\n\n        private static ISymbol GetAccessedVariable(SyntaxNode node, SemanticModel model) =>\n            node.RemoveParentheses() switch\n            {\n                IdentifierNameSyntax\n                {\n                    Parent: AssignmentExpressionSyntax\n                    {\n                        Parent: InitializerExpressionSyntax\n                        {\n                            Parent: { RawKind: (int)SyntaxKind.ObjectCreationExpression or (int)SyntaxKindEx.ImplicitObjectCreationExpression } objectCreation\n                        }\n                    }\n                } => GetAssignmentTargetSymbol(objectCreation, model), // Locale is assigned in an object initializer. Find the target of the object creation.\n                MemberAccessExpressionSyntax memberAccessExpression => model.GetSymbolInfo(memberAccessExpression.Expression).Symbol,\n                _ => null,\n            };\n\n        private static ISymbol GetAssignmentTargetSymbol(SyntaxNode objectCreation, SemanticModel model)\n        {\n            var leftSideOfParentAssignment = objectCreation.GetFirstNonParenthesizedParent() switch\n            {\n                // var dt = new DataTable { Locale = l }\n                EqualsValueClauseSyntax { Parent: VariableDeclaratorSyntax declarator } => declarator,\n                // dt = new DataTable { Locale = l }\n                AssignmentExpressionSyntax assignment => assignment.Left,\n                // var (dt, _) = (new DataTable { Locale = l }, 42)\n                ArgumentSyntax argumentSyntax => argumentSyntax.FindAssignmentComplement(),\n                _ => null,\n            };\n\n            return leftSideOfParentAssignment switch\n            {\n                null => null,\n                IdentifierNameSyntax => model.GetSymbolInfo(leftSideOfParentAssignment).Symbol,\n                _ when DeclarationExpressionSyntaxWrapper.IsInstance(leftSideOfParentAssignment) => model.GetSymbolInfo(leftSideOfParentAssignment).Symbol,\n                _ => model.GetDeclaredSymbol(leftSideOfParentAssignment),\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/SetPropertiesInsteadOfMethods.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class SetPropertiesInsteadOfMethods : SetPropertiesInsteadOfMethodsBase<SyntaxKind, InvocationExpressionSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override bool HasCorrectArgumentCount(InvocationExpressionSyntax invocation) =>\n        invocation.HasExactlyNArguments(0);\n\n    protected override bool TryGetOperands(InvocationExpressionSyntax invocation, out SyntaxNode typeNode, out SyntaxNode methodNode)\n    {\n        if (invocation.Operands() is { Left: { } left, Right: { } right })\n        {\n            typeNode = left;\n            methodNode = right;\n            return true;\n        }\n        else\n        {\n            typeNode = null;\n            methodNode = null;\n            return false;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ShiftDynamicNotInteger.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ShiftDynamicNotInteger : ShiftDynamicNotIntegerBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override bool ShouldRaise(SemanticModel model, SyntaxNode left, SyntaxNode right) =>\n        left.IsDynamic(model) && !IsConvertibleToInt(right, model);\n\n    protected override bool CanBeConvertedTo(SyntaxNode expression, ITypeSymbol type, SemanticModel model) =>\n        model.ClassifyConversion(expression as ExpressionSyntax, type) is { Exists: true } and ({ IsIdentity: true } or { IsImplicit: true });\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ShouldImplementExportedInterfaces.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class ShouldImplementExportedInterfaces : ShouldImplementExportedInterfacesBase<AttributeArgumentSyntax, AttributeSyntax, SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n        protected override SeparatedSyntaxList<AttributeArgumentSyntax>? GetAttributeArguments(AttributeSyntax attributeSyntax) =>\n            attributeSyntax.ArgumentList?.Arguments;\n\n        protected override SyntaxNode GetAttributeName(AttributeSyntax attributeSyntax) =>\n            attributeSyntax.Name;\n\n        protected override bool IsClassOrRecordSyntax(SyntaxNode syntaxNode) =>\n            syntaxNode?.Kind() is SyntaxKind.ClassDeclaration or SyntaxKindEx.RecordDeclaration;\n\n        protected override SyntaxNode GetTypeOfOrGetTypeExpression(SyntaxNode expressionSyntax) =>\n            (expressionSyntax as TypeOfExpressionSyntax)?.Type;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/SingleStatementPerLine.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class SingleStatementPerLine : SingleStatementPerLineBase<SyntaxKind, StatementSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n        protected override GeneratedCodeRecognizer GeneratedCodeRecognizer => CSharpGeneratedCodeRecognizer.Instance;\n\n        protected override bool StatementShouldBeExcluded(StatementSyntax statement) =>\n            StatementIsBlock(statement) || StatementIsSingleInLambda(statement);\n\n        private static bool StatementIsSingleInLambda(StatementSyntax st) =>\n            !st.DescendantNodes().OfType<StatementSyntax>().Any()\n            && st.Parent is BlockSyntax parentBlock\n            && parentBlock.Statements.Count <= 1\n            && parentBlock.Parent is AnonymousFunctionExpressionSyntax;\n\n        private static bool StatementIsBlock(StatementSyntax st) =>\n            st is BlockSyntax;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/SpecifyIFormatProviderOrCultureInfo.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class SpecifyIFormatProviderOrCultureInfo : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S4056\";\n    private const string MessageFormat = \"Use the overload that takes a 'CultureInfo' or 'IFormatProvider' parameter.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    private static readonly ImmutableArray<KnownType> FormatAndCultureType =\n        ImmutableArray.Create(\n            KnownType.System_IFormatProvider,\n            KnownType.System_Globalization_CultureInfo);\n\n    private static readonly ImmutableArray<KnownType> FormattableTypes =\n        ImmutableArray.Create(\n            KnownType.System_String,\n            KnownType.System_Object);\n\n    private static readonly IReadOnlyCollection<MemberDescriptor> IgnoredMethods =\n    [\n        new(KnownType.System_Activator, \"CreateInstance\"),\n        new(KnownType.System_Resources_ResourceManager, \"GetObject\"),\n        new(KnownType.System_Resources_ResourceManager, \"GetString\"),\n        // Those methods take a IFormatProvider parameter, but it is not used in the implementation.\n        // https://github.com/dotnet/runtime/blob/c0c7f02be7285a1ef0d3022b8c2f38be4025545f/src/libraries/System.Private.CoreLib/src/System/Guid.cs#L1825\n        new(KnownType.System_Guid, \"Parse\"),\n        // https://github.com/dotnet/runtime/blob/c0c7f02be7285a1ef0d3022b8c2f38be4025545f/src/libraries/System.Private.CoreLib/src/System/Guid.cs#L1838\n        new(KnownType.System_Guid, \"TryParse\"),\n        // These methods take a IFormatProvider parameter and use it.\n        // Controversial: There are edge cases like culture \"fa-AF\" where the 0x2212 (MINUS SIGN) is used instead of the usual 0x002D (HYPHEN-MINUS)\n        new(KnownType.System_Int16, \"Parse\"),\n        new(KnownType.System_Int16, \"TryParse\"),\n        new(KnownType.System_Int32, \"Parse\"),\n        new(KnownType.System_Int32, \"TryParse\"),\n        new(KnownType.System_Int64, \"Parse\"),\n        new(KnownType.System_Int64, \"TryParse\"),\n        new(KnownType.System_Int128, \"Parse\"),\n        new(KnownType.System_Int128, \"TryParse\"),\n    ];\n\n    private static IReadOnlyCollection<MemberDescriptor> WhitelistedMethods =\n    [\n        new(KnownType.System_Char, \"ToUpper\"),\n        new(KnownType.System_Char, \"ToLower\"),\n    ];\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    public static bool HasAnyFormatOrCultureParameter(ISymbol method) =>\n        method.GetParameters().Any(x => x.Type.IsAny(FormatAndCultureType));\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            c =>\n            {\n                var invocation = (InvocationExpressionSyntax)c.Node;\n                if (invocation.Expression is not null\n                    && c.Model.GetSymbolInfo(invocation.Expression).Symbol is IMethodSymbol methodSymbol\n                    && !IsIgnored(methodSymbol)\n                    && CanPotentiallyRaise(methodSymbol)\n                    && invocation.HasOverloadWithType(c.Model, FormatAndCultureType))\n                {\n                    c.ReportIssue(Rule, invocation, invocation.Expression.ToString());\n                }\n            },\n            SyntaxKind.InvocationExpression);\n\n    private static bool CanPotentiallyRaise(IMethodSymbol methodSymbol) =>\n        ReturnsOrAcceptsFormattableType(methodSymbol)\n        || WhitelistedMethods.Any(x => Matches(x, methodSymbol));\n\n    private static bool IsIgnored(IMethodSymbol methodSymbol) =>\n        SpecifyStringComparison.HasAnyStringComparisonParameter(methodSymbol)\n        || HasAnyFormatOrCultureParameter(methodSymbol)\n        || IgnoredMethods.Any(x => Matches(x, methodSymbol));\n\n    private static bool ReturnsOrAcceptsFormattableType(IMethodSymbol methodSymbol) =>\n        methodSymbol.ReturnType.IsAny(FormattableTypes)\n        || methodSymbol.GetParameters().Any(x => x.Type.IsAny(FormattableTypes));\n\n    private static bool Matches(MemberDescriptor memberDescriptor, IMethodSymbol methodSymbol) =>\n        methodSymbol is not null\n        && methodSymbol.ContainingType.Is(memberDescriptor.ContainingType)\n        && methodSymbol.Name == memberDescriptor.Name;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/SpecifyStringComparison.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class SpecifyStringComparison : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S4058\";\n        private const string MessageFormat = \"Change this call to '{0}' to an overload that accepts a \" +\n            \"'StringComparison' as a parameter.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        private static readonly ImmutableArray<KnownType> stringComparisonType = ImmutableArray.Create(KnownType.System_StringComparison);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var invocation = (InvocationExpressionSyntax)c.Node;\n\n                    if (invocation.Expression != null &&\n                        IsInvalidCall(invocation.Expression, c.Model) &&\n                        SonarAnalyzer.CSharp.Syntax.Extensions.InvocationExpressionSyntaxExtensions.HasOverloadWithType(invocation, c.Model, stringComparisonType))\n                    {\n                        c.ReportIssue(rule, invocation, invocation.Expression.ToString());\n                    }\n                }, SyntaxKind.InvocationExpression);\n        }\n\n        private static bool IsInvalidCall(ExpressionSyntax expression, SemanticModel semanticModel)\n        {\n\n            return semanticModel.GetSymbolInfo(expression).Symbol is IMethodSymbol methodSymbol &&\n                !HasAnyStringComparisonParameter(methodSymbol) &&\n                methodSymbol.GetParameters().Any(parameter => parameter.Type.Is(KnownType.System_String)) &&\n                !SpecifyIFormatProviderOrCultureInfo.HasAnyFormatOrCultureParameter(methodSymbol);\n        }\n\n        public static bool HasAnyStringComparisonParameter(IMethodSymbol method)\n        {\n            return method.GetParameters()\n                .Any(parameter => parameter.Type.Is(KnownType.System_StringComparison));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/SqlKeywordsDelimitedBySpace.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class SqlKeywordsDelimitedBySpace : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S2857\";\n        private const string MessageFormat = \"Add a space before '{0}'.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        private static readonly NameSyntax[] SqlNamespaces =\n            [\n                BuildQualifiedNameSyntax(\"System\", \"Data\"),\n                BuildQualifiedNameSyntax(\"Microsoft\", \"EntityFrameworkCore\"),\n                BuildQualifiedNameSyntax(\"ServiceStack\", \"OrmLite\"),\n                BuildQualifiedNameSyntax(\"System\", \"Data\", \"SqlClient\"),\n                BuildQualifiedNameSyntax(\"System\", \"Data\", \"SQLite\"),\n                BuildQualifiedNameSyntax(\"System\", \"Data\", \"SqlServerCe\"),\n                BuildQualifiedNameSyntax(\"System\", \"Data\", \"Entity\"),\n                BuildQualifiedNameSyntax(\"System\", \"Data\", \"Odbc\"),\n                BuildQualifiedNameSyntax(\"System\", \"Data\", \"OracleClient\"),\n                BuildQualifiedNameSyntax(\"Microsoft\", \"Data\", \"SqlClient\"),\n                BuildQualifiedNameSyntax(\"Microsoft\", \"Data\", \"Sqlite\"),\n                SyntaxFactory.IdentifierName(\"Dapper\"),\n                SyntaxFactory.IdentifierName(\"NHibernate\"),\n                SyntaxFactory.IdentifierName(\"PetaPoco\")\n            ];\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        // The '@' symbol is used for named parameters.\n        // The '{' and '}' symbols are used in string interpolations.\n        // The '[' and ']' symbols are used to escape keywords, reserved words or special characters in SQL queries.\n        //\n        // We ignore other non-alphanumeric characters (e.g. '>','=') to avoid false positives.\n        private static readonly ISet<char> InvalidCharacters = new HashSet<char>\n        {\n            '@', '{', '}', '[', ']'\n        };\n\n        // We are interested in SQL keywords that start a query (so without \"FROM\", for example)\n        private static readonly IList<string> SqlStartQueryKeywords = new List<string>\n        {\n            \"ALTER\",\n            \"BULK INSERT\",\n            \"CREATE\",\n            \"DELETE\",\n            \"DROP\",\n            \"EXEC\",\n            \"EXECUTE\",\n            \"GRANT\",\n            \"INSERT\",\n            \"MERGE\",\n            \"READTEXT\",\n            \"SELECT\",\n            \"TRUNCATE\",\n            \"UPDATE\",\n            \"UPDATETEXT\",\n            \"WRITETEXT\"\n        };\n\n        private static readonly int SqlKeywordMinSize = SqlStartQueryKeywords\n            .Select(s => s.Length)\n            .OrderBy(i => i)\n            .First();\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var namespaceDeclaration = (BaseNamespaceDeclarationSyntaxWrapper)c.Node;\n                    if (namespaceDeclaration.SyntaxNode.Parent is CompilationUnitSyntax compilationUnit\n                        && (HasSqlNamespace(compilationUnit.Usings) || HasSqlNamespace(namespaceDeclaration.Usings)))\n                    {\n                        var visitor = new StringConcatenationWalker(c);\n                        foreach (var member in namespaceDeclaration.Members)\n                        {\n                            visitor.SafeVisit(member);\n                        }\n                    }\n                },\n                SyntaxKind.NamespaceDeclaration,\n                SyntaxKindEx.FileScopedNamespaceDeclaration);\n\n        private static bool HasSqlNamespace(SyntaxList<UsingDirectiveSyntax> usings) =>\n            usings.Select(x => x.Name)\n                .Any(x => SqlNamespaces.Any(usingsNamespace => SyntaxFactory.AreEquivalent(x, usingsNamespace)));\n\n        // creates a QualifiedNameSyntax \"a.b\"\n        private static QualifiedNameSyntax BuildQualifiedNameSyntax(string a, string b) =>\n            SyntaxFactory.QualifiedName(\n                SyntaxFactory.IdentifierName(a),\n                SyntaxFactory.IdentifierName(b));\n\n        // creates a QualifiedNameSyntax \"a.b.c\"\n        private static QualifiedNameSyntax BuildQualifiedNameSyntax(string a, string b, string c) =>\n            SyntaxFactory.QualifiedName(\n                SyntaxFactory.QualifiedName(\n                    SyntaxFactory.IdentifierName(a),\n                    SyntaxFactory.IdentifierName(b)),\n                SyntaxFactory.IdentifierName(c));\n\n        private sealed class StringConcatenationWalker : SafeCSharpSyntaxWalker\n        {\n            private readonly SonarSyntaxNodeReportingContext context;\n\n            public StringConcatenationWalker(SonarSyntaxNodeReportingContext context) =>\n                this.context = context;\n\n            public override void VisitInterpolatedStringExpression(InterpolatedStringExpressionSyntax node)\n            {\n                if (TryGetConstantValues(node, out var stringParts)\n                    && stringParts.Count > 0\n                    && StartsWithSqlKeyword(stringParts[0].Text.Trim()))\n                {\n                    RaiseIssueIfNotDelimited(stringParts);\n                }\n                base.VisitInterpolatedStringExpression(node);\n            }\n\n            // The assumption is that in a chain of concatenations \"a\" + \"b\" + \"c\"\n            // the AST form is\n            //        +\n            //       / \\\n            //      +  \"c\"\n            //     / \\\n            //   \"a\" \"b\"\n            // So we start from the lower-left node which should contain the SQL start keyword\n            public override void VisitBinaryExpression(BinaryExpressionSyntax node)\n            {\n                if (node.IsKind(SyntaxKind.AddExpression)\n                    // we do the analysis only if it's a SQL keyword on the left\n                    && TryGetStringWrapper(node.Left, out var leftSide)\n                    && TryGetStringWrapper(node.Right, out var rightSide)\n                    && StartsWithSqlKeyword(leftSide.Text.Trim()))\n                {\n                    var strings = new List<StringWrapper> { leftSide, rightSide };\n                    if (TryExtractNestedStrings(node, strings))\n                    {\n                        RaiseIssueIfNotDelimited(strings);\n                    }\n                }\n                Visit(node.Left);\n                Visit(node.Right);\n            }\n\n            private void RaiseIssueIfNotDelimited(List<StringWrapper> stringWrappers)\n            {\n                for (var i = 0; i < stringWrappers.Count - 1; i++)\n                {\n                    var firstStringText = stringWrappers[i].Text;\n                    var secondString = stringWrappers[i + 1];\n                    var secondStringText = secondString.Text;\n                    if (firstStringText.Length > 0\n                        && secondStringText.Length > 0\n                        && IsInvalidCombination(firstStringText.Last(), secondStringText.First()))\n                    {\n                        var word = secondStringText.Split(' ').FirstOrDefault();\n                        context.ReportIssue(Rule, secondString.Node, word);\n                    }\n                }\n            }\n\n            private bool TryGetStringWrapper(ExpressionSyntax expression, out StringWrapper stringWrapper)\n            {\n                if (expression is LiteralExpressionSyntax literal && literal.IsKind(SyntaxKind.StringLiteralExpression))\n                {\n                    stringWrapper = new StringWrapper(literal, literal.Token.ValueText);\n                    return true;\n                }\n                else if (expression is InterpolatedStringExpressionSyntax interpolatedString)\n                {\n                    stringWrapper = new StringWrapper(interpolatedString, interpolatedString.ContentsText());\n                    return true;\n                }\n                // if this is a nested binary, we skip it so that we can raise when we visit it.\n                // Otherwise, FindConstantValue will merge it into one value.\n                else if (expression.RemoveParentheses() is not BinaryExpressionSyntax\n                    && expression.FindConstantValue(context.Model) is string constantValue)\n                {\n                    stringWrapper = new StringWrapper(expression, constantValue);\n                    return true;\n                }\n                else\n                {\n                    stringWrapper = null;\n                    return false;\n                }\n            }\n\n            /**\n             * Returns\n             * - true if all the found elements have constant string value.\n             * - false if, inside the chain of binary expressions, some element's value cannot be computed or\n             * some binary expressions are not additions.\n             */\n            private bool TryExtractNestedStrings(BinaryExpressionSyntax node, List<StringWrapper> strings)\n            {\n                // this is the left-most node of a concatenation chain\n                // collect all string literals\n                var parent = node.Parent;\n                while (parent is BinaryExpressionSyntax concatenation)\n                {\n                    if (concatenation.IsKind(SyntaxKind.AddExpression)\n                        && TryGetStringWrapper(concatenation.Right, out var stringWrapper))\n                    {\n                        strings.Add(stringWrapper);\n                    }\n                    else\n                    {\n                        // we are in a binary expression, but it's not only of constants or concatenations\n                        return false;\n                    }\n                    parent = parent.Parent;\n                }\n                return true;\n            }\n\n            private bool TryGetConstantValues(InterpolatedStringExpressionSyntax interpolatedStringExpression, out List<StringWrapper> parts)\n            {\n                parts = [];\n                foreach (var content in interpolatedStringExpression.Contents)\n                {\n                    if (content is InterpolationSyntax interpolation\n                        && interpolation.Expression.FindConstantValue(context.Model) is string constantValue)\n                    {\n                        parts.Add(new StringWrapper(content, constantValue));\n                    }\n                    else if (content is InterpolatedStringTextSyntax interpolatedText)\n                    {\n                        parts.Add(new StringWrapper(interpolatedText, interpolatedText.TextToken.Text));\n                    }\n                    else\n                    {\n                        parts = null;\n                        return false;\n                    }\n                }\n                return true;\n            }\n\n            private static bool StartsWithSqlKeyword(string firstString) =>\n                firstString.Length >= SqlKeywordMinSize\n                && SqlStartQueryKeywords.Any(x => firstString.StartsWith(x, StringComparison.OrdinalIgnoreCase));\n\n            private static bool IsInvalidCombination(char first, char second)\n            {\n                // Concatenation of a named parameter with or without string interpolation.\n                if (first == '@' && (char.IsLetterOrDigit(second) || second == '{'))\n                {\n                    return false;\n                }\n\n                return IsAlphaNumericOrInvalidCharacters(first) && IsAlphaNumericOrInvalidCharacters(second);\n\n                static bool IsAlphaNumericOrInvalidCharacters(char c) =>\n                    char.IsLetterOrDigit(c) || InvalidCharacters.Contains(c);\n            }\n        }\n\n        private sealed class StringWrapper\n        {\n            public SyntaxNode Node { get; }\n            public string Text { get; }\n\n            internal StringWrapper(SyntaxNode node, string text)\n            {\n                Node = node;\n                Text = text;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/StaticFieldInGenericClass.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class StaticFieldInGenericClass : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S2743\";\n    private const string MessageFormat = \"A static field in a generic type is not shared among instances of different close constructed types.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var typeDeclaration = (TypeDeclarationSyntax)c.Node;\n                var typeParameterNames = CollectTypeParameterNames(typeDeclaration);\n                if (c.IsRedundantPositionalRecordContext()\n                    || typeParameterNames.Length == 0\n                    || BaseTypeHasGenericTypeArgument(typeDeclaration, typeParameterNames))\n                {\n                    return;\n                }\n                var variables = typeDeclaration.Members\n                    .OfType<FieldDeclarationSyntax>()\n                    .Where(x => x.Modifiers.Any(SyntaxKind.StaticKeyword) && !HasGenericType(c, x.Declaration.Type, typeParameterNames))\n                    .SelectMany(x => x.Declaration.Variables);\n                foreach (var variable in variables)\n                {\n                    CheckMember(c, variable, variable.Identifier.GetLocation(), typeParameterNames);\n                }\n                foreach (var property in typeDeclaration.Members.OfType<PropertyDeclarationSyntax>().Where(x => x.Modifiers.Any(SyntaxKind.StaticKeyword) && x.ExpressionBody is null))\n                {\n                    CheckMember(c, property, property.Identifier.GetLocation(), typeParameterNames);\n                }\n            },\n            SyntaxKind.ClassDeclaration,\n            SyntaxKind.InterfaceDeclaration,\n            SyntaxKindEx.RecordDeclaration,\n            SyntaxKindEx.RecordStructDeclaration,\n            SyntaxKind.StructDeclaration);\n\n    private static void CheckMember(SonarSyntaxNodeReportingContext context, SyntaxNode root, Location location, string[] typeParameterNames)\n    {\n        if (!HasGenericType(context, root, typeParameterNames))\n        {\n            context.ReportIssue(Rule, location);\n        }\n    }\n\n    private static string[] CollectTypeParameterNames(SyntaxNode current)\n    {\n        var names = new HashSet<string>();\n        while (current is not null)\n        {\n            if (current is TypeDeclarationSyntax { TypeParameterList: not null } typeDeclaration)\n            {\n                names.AddRange(typeDeclaration.TypeParameterList.Parameters.Select(x => x.Identifier.ValueText));\n            }\n            current = current.Parent;\n        }\n        return names.ToArray();\n    }\n\n    private static bool HasGenericType(SonarSyntaxNodeReportingContext context, SyntaxNode root, string[] typeParameterNames) =>\n        root.DescendantNodesAndSelf()\n            .OfType<IdentifierNameSyntax>()\n            .Any(x => typeParameterNames.Contains(x.Identifier.Value) && context.Model.GetSymbolInfo(x).Symbol is { Kind: SymbolKind.TypeParameter });\n\n    private static bool BaseTypeHasGenericTypeArgument(TypeDeclarationSyntax typeDeclaration, string[] typeParameterNames) =>\n        typeDeclaration.BaseList is { } baseList && baseList.Types.Any(x => x.Type is GenericNameSyntax genericType && HasGenericTypeArgument(genericType, typeParameterNames));\n\n    private static bool HasGenericTypeArgument(GenericNameSyntax genericType, string[] typeParameterNames) =>\n        genericType.TypeArgumentList.Arguments.OfType<SimpleNameSyntax>().Any(x => typeParameterNames.Contains(x.Identifier.ValueText));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/StaticFieldInitializerOrder.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class StaticFieldInitializerOrder : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S3263\";\n        private const string MessageFormat = \"Move this field's initializer into a static constructor.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        private static readonly HashSet<SyntaxKind> EnclosingTypes =\n            [\n                SyntaxKind.ClassDeclaration,\n                SyntaxKind.InterfaceDeclaration,\n                SyntaxKind.StructDeclaration,\n                SyntaxKindEx.RecordDeclaration,\n                SyntaxKindEx.RecordStructDeclaration,\n            ];\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n                {\n                    var fieldDeclaration = (FieldDeclarationSyntax)c.Node;\n                    if (!fieldDeclaration.Modifiers.Any(SyntaxKind.StaticKeyword))\n                    {\n                        return;\n                    }\n                    var variables = fieldDeclaration.Declaration.Variables.Where(x => x.Initializer != null).ToArray();\n                    if (variables.Length == 0)\n                    {\n                        return;\n                    }\n                    var containingType = c.Model.GetDeclaredSymbol(variables[0]).ContainingType;\n                    var typeDeclaration = fieldDeclaration.FirstAncestorOrSelf<TypeDeclarationSyntax>(x => x.IsAnyKind(EnclosingTypes));\n\n                    foreach (var variable in variables)\n                    {\n                        if (IdentifierFields(variable, containingType, c.Model)\n                                .Select(x => new IdentifierTypeDeclarationMapping(x, GetTypeDeclaration(x)))\n                                .Any(x => x.TypeDeclaration is not null && (x.TypeDeclaration != typeDeclaration || x.Field.DeclaringSyntaxReferences.First().Span.Start > variable.SpanStart)))\n                        {\n                            c.ReportIssue(Rule, variable.Initializer);\n                        }\n                    }\n                },\n                SyntaxKind.FieldDeclaration);\n\n        private static IEnumerable<IFieldSymbol> IdentifierFields(VariableDeclaratorSyntax variable, INamedTypeSymbol containingType, SemanticModel semanticModel)\n        {\n            foreach (var identifier in variable.Initializer.DescendantNodes().OfType<IdentifierNameSyntax>())\n            {\n                if (containingType.MemberNames.Contains(identifier.Identifier.ValueText)\n                    && semanticModel.GetSymbolInfo(identifier).Symbol is IFieldSymbol { IsConst: false, IsStatic: true } field\n                    && containingType.Equals(field.ContainingType)\n                    && semanticModel.GetEnclosingSymbol(identifier.SpanStart) is IFieldSymbol enclosingSymbol\n                    && enclosingSymbol.ContainingType.Equals(field.ContainingType))\n                {\n                    yield return field;\n                }\n            }\n        }\n\n        private static TypeDeclarationSyntax GetTypeDeclaration(IFieldSymbol field) =>\n            field.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax().FirstAncestorOrSelf<TypeDeclarationSyntax>();\n\n        private sealed record IdentifierTypeDeclarationMapping(IFieldSymbol Field, TypeDeclarationSyntax TypeDeclaration);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/StaticFieldVisible.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class StaticFieldVisible : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S2223\";\n        private const string MessageFormat = \"Change the visibility of '{0}' or make it 'const' or 'readonly'.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    foreach (var diagnostic in GetDiagnostics(c.Model, (FieldDeclarationSyntax)c.Node))\n                    {\n                        c.ReportIssue(diagnostic);\n                    }\n                },\n                SyntaxKind.FieldDeclaration);\n\n        private static IEnumerable<Diagnostic> GetDiagnostics(SemanticModel model, FieldDeclarationSyntax declaration) =>\n            FieldIsRelevant(declaration)\n                ? declaration.Declaration.Variables\n                    .Where(x => !FieldIsThreadSafe(model.GetDeclaredSymbol(x) as IFieldSymbol))\n                    .Select(x => Diagnostic.Create(Rule, x.Identifier.GetLocation(), x.Identifier.ValueText))\n                : Enumerable.Empty<Diagnostic>();\n\n        private static bool FieldIsRelevant(FieldDeclarationSyntax node) =>\n            node.Modifiers.Count > 1\n            && node.Modifiers.Any(SyntaxKind.StaticKeyword)\n            && !node.Modifiers.Any(SyntaxKind.VolatileKeyword)\n            && (!node.Modifiers.Any(SyntaxKind.PrivateKeyword) || node.Modifiers.Any(SyntaxKind.ProtectedKeyword))\n            && !node.Modifiers.Any(SyntaxKind.ReadOnlyKeyword);\n\n        private static bool FieldIsThreadSafe(IFieldSymbol fieldSymbol) =>\n            fieldSymbol.GetAttributes().Any(x => x.AttributeClass.Is(KnownType.System_ThreadStaticAttribute));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/StaticFieldWrittenFrom.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    public abstract class StaticFieldWrittenFrom : SonarDiagnosticAnalyzer\n    {\n        protected abstract DiagnosticDescriptor Rule { get; }\n        protected override bool EnableConcurrentExecution => false;\n        protected abstract bool IsValidCodeBlockContext(SyntaxNode node, ISymbol owningSymbol);\n        protected abstract string GetDiagnosticMessageArgument(SyntaxNode node, ISymbol owningSymbol, IFieldSymbol field);\n\n        public sealed override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n        protected sealed override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterCodeBlockStartAction(cbc =>\n                {\n                    if (!IsValidCodeBlockContext(cbc.CodeBlock, cbc.OwningSymbol))\n                    {\n                        return;\n                    }\n\n                    var locationsForFields = new MultiValueDictionary<IFieldSymbol, Location>();\n\n                    cbc.RegisterNodeAction(c =>\n                        {\n                            var assignment = (AssignmentExpressionSyntax)c.Node;\n\n                            foreach (var target in assignment.AssignmentTargets())\n                            {\n                                if (GetStaticFieldSymbol(c.Model, target) is { } fieldSymbol)\n                                {\n                                    locationsForFields.Add(fieldSymbol, target.CreateLocation(to: assignment.OperatorToken));\n                                }\n                            }\n                        },\n                        SyntaxKind.SimpleAssignmentExpression,\n                        SyntaxKind.AddAssignmentExpression,\n                        SyntaxKind.SubtractAssignmentExpression,\n                        SyntaxKind.MultiplyAssignmentExpression,\n                        SyntaxKind.DivideAssignmentExpression,\n                        SyntaxKind.ModuloAssignmentExpression,\n                        SyntaxKind.AndAssignmentExpression,\n                        SyntaxKind.ExclusiveOrAssignmentExpression,\n                        SyntaxKind.OrAssignmentExpression,\n                        SyntaxKind.LeftShiftAssignmentExpression,\n                        SyntaxKind.RightShiftAssignmentExpression,\n                        SyntaxKindEx.CoalesceAssignmentExpression,\n                        SyntaxKindEx.UnsignedRightShiftAssignmentExpression);\n\n                    cbc.RegisterNodeAction(c =>\n                        {\n                            var unary = (PrefixUnaryExpressionSyntax)c.Node;\n                            CollectLocationOfStaticField(c.Model, locationsForFields, unary.Operand);\n                        },\n                        SyntaxKind.PreDecrementExpression,\n                        SyntaxKind.PreIncrementExpression);\n\n                    cbc.RegisterNodeAction(c =>\n                        {\n                            var unary = (PostfixUnaryExpressionSyntax)c.Node;\n                            CollectLocationOfStaticField(c.Model, locationsForFields, unary.Operand);\n                        },\n                        SyntaxKind.PostDecrementExpression,\n                        SyntaxKind.PostIncrementExpression);\n\n                    cbc.RegisterCodeBlockEndAction(c =>\n                    {\n                        foreach (var fieldWithLocations in locationsForFields)\n                        {\n                            var firstPosition = fieldWithLocations.Value.Select(x => x.SourceSpan.Start).Min();\n                            var location = fieldWithLocations.Value.First(x => x.SourceSpan.Start == firstPosition);\n                            var message = GetDiagnosticMessageArgument(c.CodeBlock, c.OwningSymbol, fieldWithLocations.Key);\n                            var secondaryLocations = fieldWithLocations.Key.DeclaringSyntaxReferences.Select(x => x.GetSyntax().ToSecondaryLocation());\n                            c.ReportIssue(Rule, location, secondaryLocations, message);\n                        }\n                    });\n                });\n\n        private static void CollectLocationOfStaticField(SemanticModel semanticModel, MultiValueDictionary<IFieldSymbol, Location> locationsForFields, ExpressionSyntax expression)\n        {\n            if (GetStaticFieldSymbol(semanticModel, expression) is { } fieldSymbol)\n            {\n                locationsForFields.Add(fieldSymbol, expression.GetLocation());\n            }\n        }\n\n        private static IFieldSymbol GetStaticFieldSymbol(SemanticModel semanticModel, SyntaxNode node) =>\n            semanticModel.GetSymbolInfo(node) is { Symbol: IFieldSymbol { IsStatic: true } fieldSymbol }\n                ? fieldSymbol\n                : null;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/StaticFieldWrittenFromInstanceConstructor.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class StaticFieldWrittenFromInstanceConstructor : StaticFieldWrittenFrom\n    {\n        private const string DiagnosticId = \"S3010\";\n        private const string MessageFormat = \"Remove this assignment of '{0}' or initialize it statically.\";\n\n        protected override DiagnosticDescriptor Rule =>\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        protected override bool IsValidCodeBlockContext(SyntaxNode node, ISymbol owningSymbol) =>\n            node is ConstructorDeclarationSyntax declaration\n            && !declaration.Modifiers.Any(SyntaxKind.StaticKeyword);\n\n        protected override string GetDiagnosticMessageArgument(SyntaxNode node, ISymbol owningSymbol, IFieldSymbol field) =>\n            field.Name;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/StaticFieldWrittenFromInstanceMember.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class StaticFieldWrittenFromInstanceMember : StaticFieldWrittenFrom\n{\n    private const string DiagnosticId = \"S2696\";\n    private const string MessageFormat = \"{0}\";\n    private const string MessageFormatMultipleOptions = \"Make the enclosing instance {0} 'static' or remove this set on the 'static' field.\";\n    private const string MessageFormatRemoveSet = \"Remove this set, which updates a 'static' field from an instance {0}.\";\n\n    protected override DiagnosticDescriptor Rule => DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    protected override bool IsValidCodeBlockContext(SyntaxNode node, ISymbol owningSymbol) =>\n        owningSymbol is { IsStatic: false }\n        && owningSymbol is not IMethodSymbol { IsExtension: true }\n        && node is MethodDeclarationSyntax or AccessorDeclarationSyntax;\n\n    protected override string GetDiagnosticMessageArgument(SyntaxNode node, ISymbol owningSymbol, IFieldSymbol field)\n    {\n        var messageFormat = owningSymbol.IsChangeable()\n            ? MessageFormatMultipleOptions\n            : MessageFormatRemoveSet;\n        var declarationType = DeclarationType(node);\n\n        return string.Format(messageFormat, declarationType);\n    }\n\n    private static string DeclarationType(SyntaxNode declaration) =>\n        declaration switch\n        {\n            MethodDeclarationSyntax => \"method\",\n            AccessorDeclarationSyntax => \"property\",\n            _ => throw new NotSupportedException($\"Not expected syntax kind {declaration.RawKind}.\")\n        };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/StaticSealedClassProtectedMembers.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class StaticSealedClassProtectedMembers : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S2156\";\n        private const string MessageFormat = \"Remove this 'protected' modifier.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(c =>\n            {\n                ReportDiagnostics(c, c.Node, ((BaseMethodDeclarationSyntax)c.Node).Modifiers);\n            },\n            SyntaxKind.MethodDeclaration,\n            SyntaxKind.ConstructorDeclaration);\n\n            context.RegisterNodeAction(c =>\n            {\n                ReportDiagnostics(c, c.Node, ((BasePropertyDeclarationSyntax)c.Node).Modifiers);\n            },\n            SyntaxKind.PropertyDeclaration,\n            SyntaxKind.IndexerDeclaration,\n            SyntaxKind.EventDeclaration);\n\n            context.RegisterNodeAction(c =>\n            {\n                var fieldDeclaration = (BaseFieldDeclarationSyntax)c.Node;\n\n                ReportDiagnostics(c, fieldDeclaration.Declaration.Variables.FirstOrDefault(), fieldDeclaration.Modifiers);\n            },\n            SyntaxKind.FieldDeclaration,\n            SyntaxKind.EventFieldDeclaration);\n        }\n\n        private static void ReportDiagnostics(SonarSyntaxNodeReportingContext context, SyntaxNode declaration, IEnumerable<SyntaxToken> modifiers)\n        {\n            var symbol = context.Model.GetDeclaredSymbol(declaration);\n            if (symbol == null || symbol.IsOverride || !symbol.ContainingType.IsSealed)\n            {\n                return;\n            }\n\n            modifiers\n                .Where(m => m.IsKind(SyntaxKind.ProtectedKeyword))\n                .Select(m => Diagnostic.Create(rule, m.GetLocation()))\n                .ToList()\n                .ForEach(d => context.ReportIssue(d));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/StreamReadStatement.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class StreamReadStatement : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S2674\";\n    private const string MessageFormat = \"Check the return value of the '{0}' call to see how many bytes were read.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    private static readonly ISet<string> ReadMethodNames = new HashSet<string>(StringComparer.Ordinal)\n    {\n        nameof(Stream.Read),\n        nameof(Stream.ReadAsync),\n        \"ReadAtLeast\", // Net7: https://learn.microsoft.com/dotnet/api/system.io.stream.readatleast#applies-to\n        \"ReadAtLeastAsync\",\n    };\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var statement = (ExpressionStatementSyntax)c.Node;\n                var expression = statement.Expression switch\n                {\n                    AwaitExpressionSyntax awaitExpression => awaitExpression.AwaitedExpressionWithoutConfigureAwait(),\n                    var x => x,\n                };\n                expression = expression.RemoveConditionalAccess();\n                if (expression is InvocationExpressionSyntax invocation\n                    && invocation.GetMethodCallIdentifier() is { } methodIdentifier\n                    && ReadMethodNames.Contains(methodIdentifier.Text)\n                    && c.Model.GetSymbolInfo(expression).Symbol is IMethodSymbol method\n                    && (method.ContainingType.Is(KnownType.System_IO_Stream)\n                        || (method.IsOverride && method.ContainingType.DerivesOrImplements(KnownType.System_IO_Stream))))\n                {\n                    c.ReportIssue(Rule, expression, method.Name);\n                }\n            },\n            SyntaxKind.ExpressionStatement);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/StringConcatenationInLoop.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class StringConcatenationInLoop : StringConcatenationInLoopBase<SyntaxKind, AssignmentExpressionSyntax, BinaryExpressionSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override SyntaxKind[] CompoundAssignmentKinds { get; } = [SyntaxKind.AddAssignmentExpression];\n\n    protected override ISet<SyntaxKind> ExpressionConcatenationKinds { get; } = new HashSet<SyntaxKind>\n    {\n        SyntaxKind.AddExpression\n    };\n\n    protected override ISet<SyntaxKind> LoopKinds { get; } = new HashSet<SyntaxKind>\n    {\n        SyntaxKind.WhileStatement,\n        SyntaxKind.DoStatement,\n        SyntaxKind.ForStatement,\n        SyntaxKind.ForEachStatement\n    };\n\n    protected override SyntaxNode LeftMostExpression(SyntaxNode expression) =>\n        expression is ElementAccessExpressionSyntax\n            ? null\n            : ((ExpressionSyntax)expression).LeftMostInMemberAccess();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/StringFormatValidator.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class StringFormatValidator : SonarDiagnosticAnalyzer\n    {\n        private const string BugDiagnosticId = \"S2275\";\n        private const string CodeSmellDiagnosticId = \"S3457\";\n        private const string MessageFormat = \"{0}\";\n\n        // This is the value as defined in .Net Framework\n        private const int MaxValueForArgumentIndexAndAlignment = 1_000_000;\n\n        private static readonly DiagnosticDescriptor BugRule = DescriptorFactory.Create(BugDiagnosticId, MessageFormat);\n        private static readonly DiagnosticDescriptor CodeSmellRule = DescriptorFactory.Create(CodeSmellDiagnosticId, MessageFormat);\n\n        private static readonly HashSet<MemberDescriptor> HandledFormatMethods = new HashSet<MemberDescriptor>\n        {\n            new MemberDescriptor(KnownType.System_String, \"Format\"),\n            new MemberDescriptor(KnownType.System_Console, \"Write\"),\n            new MemberDescriptor(KnownType.System_Console, \"WriteLine\"),\n            new MemberDescriptor(KnownType.System_Text_StringBuilder, \"AppendFormat\"),\n            new MemberDescriptor(KnownType.System_IO_TextWriter, \"Write\"),\n            new MemberDescriptor(KnownType.System_IO_TextWriter, \"WriteLine\"),\n            new MemberDescriptor(KnownType.System_IO_StreamWriter, \"Write\"),\n            new MemberDescriptor(KnownType.System_IO_StreamWriter, \"WriteLine\"),\n            new MemberDescriptor(KnownType.System_Diagnostics_Debug, \"WriteLine\"),\n            new MemberDescriptor(KnownType.System_Diagnostics_Trace, \"TraceError\"),\n            new MemberDescriptor(KnownType.System_Diagnostics_Trace, \"TraceInformation\"),\n            new MemberDescriptor(KnownType.System_Diagnostics_Trace, \"TraceWarning\"),\n            new MemberDescriptor(KnownType.System_Diagnostics_TraceSource, \"TraceInformation\")\n        };\n\n        private static readonly HashSet<ValidationFailure> BugRelatedFailures = new HashSet<ValidationFailure>\n        {\n            ValidationFailure.UnknownError,\n            ValidationFailure.NullFormatString,\n            ValidationFailure.InvalidCharacterAfterOpenCurlyBrace,\n            ValidationFailure.UnbalancedCurlyBraceCount,\n            ValidationFailure.FormatItemMalformed,\n            ValidationFailure.FormatItemIndexBiggerThanArgsCount,\n            ValidationFailure.FormatItemIndexBiggerThanMaxValue,\n            ValidationFailure.FormatItemAlignmentBiggerThanMaxValue\n        };\n\n        private static readonly HashSet<ValidationFailure> CodeSmellRelatedFailures = new HashSet<ValidationFailure>\n        {\n            ValidationFailure.SimpleString,\n            ValidationFailure.MissingFormatItemIndex,\n            ValidationFailure.UnusedFormatArguments\n        };\n\n        // pattern is: index[,alignment][:formatString]\n        private static readonly Regex StringFormatItemRegex = new Regex(@\"^(?<Index>\\d+)(\\s*,\\s*(?<Alignment>-?\\d+)\\s*)?(:(?<Format>.+))?$\", RegexOptions.Compiled, Constants.DefaultRegexTimeout);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(BugRule, CodeSmellRule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(CheckForFormatStringIssues, SyntaxKind.InvocationExpression);\n\n        private static void CheckForFormatStringIssues(SonarSyntaxNodeReportingContext analysisContext)\n        {\n            var invocation = (InvocationExpressionSyntax)analysisContext.Node;\n\n            if (!(analysisContext.Model.GetSymbolInfo(invocation).Symbol is IMethodSymbol methodSymbol)\n                || !methodSymbol.Parameters.Any()\n                || methodSymbol.Parameters.All(x => x.Name != \"format\"))\n            {\n                return;\n            }\n\n            var currentMethodSignature = HandledFormatMethods\n                .Where(hfm => methodSymbol.ContainingType.Is(hfm.ContainingType))\n                .FirstOrDefault(method => method.Name == methodSymbol.Name);\n            if (currentMethodSignature == null)\n            {\n                return;\n            }\n\n            var formatArgumentIndex = methodSymbol.Parameters[0].IsType(KnownType.System_IFormatProvider) ? 1 : 0;\n            var formatStringExpression = invocation.ArgumentList.Arguments[formatArgumentIndex].Expression;\n            var failure = formatStringExpression.IsNullLiteral()\n                ? new ValidationFailureWithAdditionalData(ValidationFailure.NullFormatString)\n                : TryParseAndValidate(formatStringExpression.FindStringConstant(analysisContext.Model), invocation.ArgumentList, formatArgumentIndex, analysisContext.Model);\n            if (failure == null || CanIgnoreFailure(failure, currentMethodSignature.Name, invocation.ArgumentList.Arguments.Count))\n            {\n                return;\n            }\n\n            if (BugRelatedFailures.Contains(failure.Failure))\n            {\n                analysisContext.ReportIssue(BugRule, invocation.Expression, failure.ToString());\n            }\n\n            if (CodeSmellRelatedFailures.Contains(failure.Failure))\n            {\n                analysisContext.ReportIssue(CodeSmellRule, invocation.Expression, failure.ToString());\n            }\n        }\n\n        private static bool CanIgnoreFailure(ValidationFailureWithAdditionalData failure, string methodName, int argumentsCount)\n        {\n            if (methodName.EndsWith(\"Format\") || failure.Failure == ValidationFailure.UnusedFormatArguments || failure.Failure == ValidationFailure.FormatItemIndexBiggerThanArgsCount)\n            {\n                return false;\n            }\n\n            // All methods in HandledFormatMethods that do not end on Format have an overload\n            // with only one argument and the rule should not raise an issue\n            return argumentsCount == 1;\n        }\n\n        private static ValidationFailureWithAdditionalData TryParseAndValidate(string formatStringText, ArgumentListSyntax argumentList, int formatArgumentIndex, SemanticModel semanticModel) =>\n            formatStringText == null\n                ? null\n                : ExtractFormatItems(formatStringText, out var formatStringItems) ?? TryValidateFormatString(formatStringItems, argumentList, formatArgumentIndex, semanticModel);\n\n        private static ValidationFailureWithAdditionalData ExtractFormatItems(string formatString, out List<FormatStringItem> formatStringItems)\n        {\n            formatStringItems = new List<FormatStringItem>();\n            var curlyBraceCount = 0;\n            StringBuilder currentFormatItemBuilder = null;\n            var isEscapingOpenCurlyBrace = false;\n            var isEscapingCloseCurlyBrace = false;\n            for (var i = 0; i < formatString.Length; i++)\n            {\n                var currentChar = formatString[i];\n                var previousChar = i > 0 ? formatString[i - 1] : '\\0';\n\n                if (currentChar == '{')\n                {\n                    if (previousChar == '{' && !isEscapingOpenCurlyBrace)\n                    {\n                        curlyBraceCount--;\n                        isEscapingOpenCurlyBrace = true;\n                        currentFormatItemBuilder = null;\n                        continue;\n                    }\n\n                    curlyBraceCount++;\n                    isEscapingOpenCurlyBrace = false;\n                    currentFormatItemBuilder ??= new StringBuilder();\n                    continue;\n                }\n\n                if (previousChar == '{' && !char.IsDigit(currentChar) && currentFormatItemBuilder != null)\n                {\n                    return new ValidationFailureWithAdditionalData(ValidationFailure.InvalidCharacterAfterOpenCurlyBrace);\n                }\n\n                if (currentChar == '}')\n                {\n                    isEscapingCloseCurlyBrace = previousChar == '}' && !isEscapingCloseCurlyBrace;\n                    curlyBraceCount = isEscapingCloseCurlyBrace\n                        ? curlyBraceCount + 1\n                        : curlyBraceCount - 1;\n\n                    if (currentFormatItemBuilder != null)\n                    {\n                        if (TryParseItem(currentFormatItemBuilder.ToString(), out var formatStringItem) is { } failure)\n                        {\n                            return new ValidationFailureWithAdditionalData(failure);\n                        }\n\n                        formatStringItems.Add(formatStringItem);\n                        currentFormatItemBuilder = null;\n                    }\n                    continue;\n                }\n\n                currentFormatItemBuilder?.Append(currentChar);\n            }\n\n            return curlyBraceCount == 0 ? null : new ValidationFailureWithAdditionalData(ValidationFailure.UnbalancedCurlyBraceCount);\n        }\n\n        private static ValidationFailure TryParseItem(string formatItem, out FormatStringItem formatStringItem)\n        {\n            formatStringItem = null;\n            var matchResult = StringFormatItemRegex.SafeMatch(formatItem);\n            if (!matchResult.Success)\n            {\n                return ValidationFailure.FormatItemMalformed;\n            }\n\n            var index = int.Parse(matchResult.Groups[\"Index\"].Value);\n            var alignment = matchResult.Groups[\"Alignment\"].Success ? (int?)int.Parse(matchResult.Groups[\"Alignment\"].Value) : null;\n            formatStringItem = new FormatStringItem(index, alignment);\n            return null;\n        }\n\n        private static ValidationFailureWithAdditionalData TryValidateFormatString(ICollection<FormatStringItem> formatStringItems,\n                                                                                   ArgumentListSyntax argumentList,\n                                                                                   int formatArgumentIndex,\n                                                                                   SemanticModel semanticModel)\n        {\n            if (formatStringItems.Any(x => x.Index > MaxValueForArgumentIndexAndAlignment))\n            {\n                return new ValidationFailureWithAdditionalData(ValidationFailure.FormatItemIndexBiggerThanMaxValue);\n            }\n            if (formatStringItems.Any(x => x.Alignment > MaxValueForArgumentIndexAndAlignment))\n            {\n                return new ValidationFailureWithAdditionalData(ValidationFailure.FormatItemAlignmentBiggerThanMaxValue);\n            }\n\n            var formatArguments = argumentList.Arguments\n                .Skip(formatArgumentIndex + 1)\n                .Select(arg => FormatStringArgument.Create(arg.Expression, semanticModel))\n                .ToList();\n            var maxFormatItemIndex = formatStringItems.Max(item => (int?)item.Index);\n\n            var realArgumentsCount = formatArguments.Count;\n            if (formatArguments.Count == 1 && formatArguments[0].TypeSymbol.Is(TypeKind.Array))\n            {\n                realArgumentsCount = formatArguments[0].ArraySize;\n                if (realArgumentsCount == -1)\n                {\n                    // can't statically check the override that supplies args in an array variable\n                    return null;\n                }\n            }\n\n            return IsSimpleString(formatStringItems.Count, realArgumentsCount)\n                ?? HasFormatItemIndexTooBig(maxFormatItemIndex, realArgumentsCount)\n                ?? HasMissingFormatItemIndex(formatStringItems, maxFormatItemIndex)\n                ?? HasUnusedArguments(formatArguments, maxFormatItemIndex);\n        }\n\n        private static ValidationFailureWithAdditionalData HasFormatItemIndexTooBig(int? maxFormatItemIndex, int argumentsCount) =>\n            maxFormatItemIndex.HasValue && maxFormatItemIndex.Value + 1 > argumentsCount\n                ? new ValidationFailureWithAdditionalData(ValidationFailure.FormatItemIndexBiggerThanArgsCount)\n                : null;\n\n        private static ValidationFailureWithAdditionalData IsSimpleString(int formatStringItemsCount, int argumentsCount) =>\n            formatStringItemsCount == 0 && argumentsCount == 0\n                ? new ValidationFailureWithAdditionalData(ValidationFailure.SimpleString)\n                : null;\n\n        private static ValidationFailureWithAdditionalData HasMissingFormatItemIndex(IEnumerable<FormatStringItem> formatStringItems, int? maxFormatItemIndex)\n        {\n            if (!maxFormatItemIndex.HasValue)\n            {\n                return null;\n            }\n\n            var missingFormatItemIndexes = Enumerable.Range(0, maxFormatItemIndex.Value + 1)\n                .Except(formatStringItems.Select(item => item.Index))\n                .Select(i => i.ToString())\n                .ToList();\n            if (missingFormatItemIndexes.Count > 0)\n            {\n                return new ValidationFailureWithAdditionalData(ValidationFailure.MissingFormatItemIndex, missingFormatItemIndexes);\n            }\n\n            return null;\n        }\n\n        private static ValidationFailureWithAdditionalData HasUnusedArguments(List<FormatStringArgument> formatArguments, int? maxFormatItemIndex)\n        {\n            var unusedArgumentNames = formatArguments.Skip((maxFormatItemIndex ?? -1) + 1)\n                .Select(arg => arg.Name)\n                .ToList();\n            if (unusedArgumentNames.Count > 0)\n            {\n                return new ValidationFailureWithAdditionalData(ValidationFailure.UnusedFormatArguments, unusedArgumentNames);\n            }\n\n            return null;\n        }\n\n        public class ValidationFailure\n        {\n            public static readonly ValidationFailure NullFormatString = new ValidationFailure(\"Invalid string format, the format string cannot be null.\");\n            public static readonly ValidationFailure InvalidCharacterAfterOpenCurlyBrace = new ValidationFailure(\"Invalid string format, opening curly brace can only be followed by a digit or an opening curly brace.\");\n            public static readonly ValidationFailure UnbalancedCurlyBraceCount = new ValidationFailure(\"Invalid string format, unbalanced curly brace count.\");\n            public static readonly ValidationFailure FormatItemMalformed = new ValidationFailure(\"Invalid string format, all format items should comply with the following pattern '{index[,alignment][:formatString]}'.\");\n            public static readonly ValidationFailure FormatItemIndexBiggerThanArgsCount = new ValidationFailure(\"Invalid string format, the highest string format item index should not be greater than the arguments count.\");\n            public static readonly ValidationFailure FormatItemIndexBiggerThanMaxValue = new ValidationFailure($\"Invalid string format, the string format item index should not be greater than {MaxValueForArgumentIndexAndAlignment}.\");\n            public static readonly ValidationFailure FormatItemAlignmentBiggerThanMaxValue = new ValidationFailure($\"Invalid string format, the string format item alignment should not be greater than {MaxValueForArgumentIndexAndAlignment}.\");\n            public static readonly ValidationFailure SimpleString = new ValidationFailure(\"Remove this formatting call and simply use the input string.\");\n            public static readonly ValidationFailure UnknownError = new ValidationFailure(\"Invalid string format, the format string is invalid and is likely to throw at runtime.\");\n            public static readonly ValidationFailure MissingFormatItemIndex = new ValidationFailure(\"The format string might be wrong, the following item indexes are missing: \");\n            public static readonly ValidationFailure UnusedFormatArguments = new ValidationFailure(\"The format string might be wrong, the following arguments are unused: \");\n\n            public string Message { get; }\n\n            private ValidationFailure(string message) =>\n                Message = message;\n        }\n\n        private class ValidationFailureWithAdditionalData\n        {\n            public ValidationFailure Failure { get; }\n            private IEnumerable<string> AdditionalData { get; }\n\n            public ValidationFailureWithAdditionalData(ValidationFailure failure, IEnumerable<string> additionalData = null)\n            {\n                Failure = failure;\n                AdditionalData = additionalData;\n            }\n\n            public override string ToString() =>\n                AdditionalData == null ? Failure.Message : string.Concat(Failure.Message, AdditionalData.ToSentence(quoteWords: true), \".\");\n        }\n\n        private sealed class FormatStringItem\n        {\n            public int Index { get; }\n            public int? Alignment { get; }\n\n            public FormatStringItem(int index, int? alignment)\n            {\n                Index = index;\n                Alignment = alignment;\n            }\n        }\n\n        private sealed class FormatStringArgument\n        {\n            public string Name { get; }\n            public ITypeSymbol TypeSymbol { get; }\n            public int ArraySize { get; }\n\n            private FormatStringArgument(string name, ITypeSymbol typeSymbol, int arraySize = -1)\n            {\n                Name = name;\n                TypeSymbol = typeSymbol;\n                ArraySize = arraySize;\n            }\n\n            public static FormatStringArgument Create(ExpressionSyntax expression, SemanticModel semanticModel)\n            {\n                var type = semanticModel.GetTypeInfo(expression).Type;\n                var arraySize = -1;\n                if (type != null && type.Is(TypeKind.Array))\n                {\n                    if (expression is ImplicitArrayCreationExpressionSyntax implicitArray)\n                    {\n                        arraySize = implicitArray.Initializer.Expressions.Count;\n                    }\n\n                    if (expression is ArrayCreationExpressionSyntax array && array.Initializer != null)\n                    {\n                        arraySize = array.Initializer.Expressions.Count;\n                    }\n                }\n\n                return new FormatStringArgument(expression.ToString(), type, arraySize);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/StringLiteralShouldNotBeDuplicated.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class StringLiteralShouldNotBeDuplicated : StringLiteralShouldNotBeDuplicatedBase<SyntaxKind, LiteralExpressionSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n        protected override SyntaxKind[] SyntaxKinds { get; } =\n        {\n            SyntaxKind.ClassDeclaration,\n            SyntaxKind.StructDeclaration,\n            SyntaxKindEx.RecordDeclaration,\n            SyntaxKindEx.RecordStructDeclaration,\n            SyntaxKind.CompilationUnit\n        };\n\n        private HashSet<SyntaxKind> TypeDeclarationSyntaxKinds { get; } =\n        [\n            SyntaxKind.ClassDeclaration,\n            SyntaxKind.StructDeclaration,\n            SyntaxKindEx.RecordDeclaration,\n            SyntaxKindEx.RecordStructDeclaration\n        ];\n\n        protected override bool IsMatchingMethodParameterName(LiteralExpressionSyntax literalExpression) =>\n            literalExpression.FirstAncestorOrSelf<BaseMethodDeclarationSyntax>()\n                ?.ParameterList\n                ?.Parameters\n                .Any(p => p.Identifier.ValueText == literalExpression.Token.ValueText)\n            ?? false;\n\n        protected override bool IsInnerInstance(SonarSyntaxNodeReportingContext context) =>\n            context.Node.Ancestors().Any(x =>\n                x.IsAnyKind(TypeDeclarationSyntaxKinds)\n                || (x.IsKind(SyntaxKind.CompilationUnit) && x.ChildNodes().Any(y => y.IsKind(SyntaxKind.GlobalStatement))));\n\n        protected override IEnumerable<LiteralExpressionSyntax> FindLiteralExpressions(SyntaxNode node) =>\n            node.DescendantNodes(x => !x.IsKind(SyntaxKind.AttributeList))\n                .Where(x => x.IsKind(SyntaxKind.StringLiteralExpression))\n                .Cast<LiteralExpressionSyntax>();\n\n        protected override SyntaxToken LiteralToken(LiteralExpressionSyntax literal) =>\n            literal.Token;\n\n        protected override bool IsNamedTypeOrTopLevelMain(SonarSyntaxNodeReportingContext context) =>\n            IsNamedType(context) || context.IsTopLevelMain;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/StringOffsetMethods.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class StringOffsetMethods : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S4635\";\n        private const string MessageFormat = \"Replace '{0}' with the overload that accepts a startIndex parameter.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(rule);\n\n        private readonly string[] methodsToCheck = new string[]\n        {\n            \"IndexOf\",\n            \"IndexOfAny\",\n            \"LastIndexOf\",\n            \"LastIndexOfAny\"\n        };\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(analysisContext =>\n                {\n                    var invocationExpression = (InvocationExpressionSyntax)analysisContext.Node;\n                    var semanticModel = analysisContext.Model;\n\n                    if (IsTargetMethodInvocation(invocationExpression, semanticModel) &&\n                        HasSubstringMethodInvocationChild(invocationExpression, semanticModel))\n                    {\n                        var memberAccess = (MemberAccessExpressionSyntax)invocationExpression.Expression;\n\n                        analysisContext.ReportIssue(rule, invocationExpression, memberAccess.Name.ToString());\n                    }\n                },\n                SyntaxKind.InvocationExpression);\n        }\n\n        private bool IsTargetMethodInvocation(InvocationExpressionSyntax invocationExpression, SemanticModel semanticModel) =>\n            methodsToCheck.Any(methodName => invocationExpression.IsMethodInvocation(KnownType.System_String, methodName, semanticModel));\n\n        private bool HasSubstringMethodInvocationChild(InvocationExpressionSyntax invocationExpression, SemanticModel semanticModel) =>\n            invocationExpression.Expression is MemberAccessExpressionSyntax memberAccessExpression &&\n            memberAccessExpression.Expression is InvocationExpressionSyntax childInvocationExpression &&\n            childInvocationExpression.IsMethodInvocation(KnownType.System_String, \"Substring\", semanticModel);\n\n    }\n}\n\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/StringOperationWithoutCulture.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class StringOperationWithoutCulture : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S1449\";\n        private const string MessageFormat = \"{0}\";\n        internal const string MessageDefineLocale = \"Define the locale to be used in this string operation.\";\n        internal const string MessageChangeCompareTo = \"Use 'CompareOrdinal' or 'Compare' with the locale specified instead of 'CompareTo'.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                ReportOnViolation,\n                SyntaxKind.InvocationExpression);\n        }\n\n        private static void ReportOnViolation(SonarSyntaxNodeReportingContext context)\n        {\n            var invocation = (InvocationExpressionSyntax)context.Node;\n\n            if (!(invocation.Expression is MemberAccessExpressionSyntax memberAccess))\n            {\n                return;\n            }\n\n            if (!(context.Model.GetSymbolInfo(invocation).Symbol is IMethodSymbol calledMethod))\n            {\n                return;\n            }\n\n            if (context.IsInExpressionTree())\n            {\n                return; // We cannot specify the culture in an expression tree\n            }\n\n            if (calledMethod.IsInType(KnownType.System_String) &&\n                CommonCultureSpecificMethodNames.Contains(calledMethod.Name) &&\n                !calledMethod.Parameters.Any(param => param.Type.IsAny(StringCultureSpecifierNames)))\n            {\n                context.ReportIssue(rule, memberAccess.Name, MessageDefineLocale);\n                return;\n            }\n\n            if (calledMethod.IsInType(KnownType.System_String) &&\n                IndexLookupMethodNames.Contains(calledMethod.Name) &&\n                calledMethod.Parameters.Any(param => param.Type.SpecialType == SpecialType.System_String) &&\n                !calledMethod.Parameters.Any(param => param.Type.IsAny(StringCultureSpecifierNames)))\n            {\n                context.ReportIssue(rule, memberAccess.Name, MessageDefineLocale);\n                return;\n            }\n\n            if (IsMethodOnNonIntegralOrDateTime(calledMethod) &&\n                calledMethod.Name == ToStringMethodName &&\n                calledMethod.Parameters.Length == 0)\n            {\n                context.ReportIssue(rule, memberAccess.Name, MessageDefineLocale);\n                return;\n            }\n\n            if (calledMethod.IsInType(KnownType.System_String) &&\n                calledMethod.Name == CompareToMethodName)\n            {\n                context.ReportIssue(rule, memberAccess.Name, MessageChangeCompareTo);\n            }\n        }\n\n        private static bool IsMethodOnNonIntegralOrDateTime(IMethodSymbol methodSymbol)\n        {\n            return methodSymbol.IsInType(KnownType.NonIntegralNumbers) ||\n                methodSymbol.IsInType(KnownType.System_DateTime);\n        }\n\n        private static readonly ISet<string> CommonCultureSpecificMethodNames = new HashSet<string> { \"ToLower\", \"ToUpper\", \"Compare\" };\n\n        private static readonly ISet<string> IndexLookupMethodNames = new HashSet<string> { \"IndexOf\", \"LastIndexOf\" };\n\n        private const string CompareToMethodName = \"CompareTo\";\n        private const string ToStringMethodName = \"ToString\";\n\n        private static readonly ImmutableArray<KnownType> StringCultureSpecifierNames =\n            ImmutableArray.Create(\n                KnownType.System_Globalization_CultureInfo,\n                KnownType.System_Globalization_CompareOptions,\n                KnownType.System_StringComparison\n            );\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/StringOrIntegralTypesForIndexers.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class StringOrIntegralTypesForIndexers : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S3876\";\n        private const string MessageFormat = \"Use string, integral, index or range type here, or refactor this indexer into a method.\";\n\n        private static readonly ImmutableArray<KnownType> AllowedIndexerTypes =\n            new[] { KnownType.System_Object, KnownType.System_String, KnownType.System_Index, KnownType.System_Range }\n            .Concat(KnownType.IntegralNumbers)\n            .ToImmutableArray();\n\n        private static readonly DiagnosticDescriptor Rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n            {\n                var indexerDeclaration = (IndexerDeclarationSyntax)c.Node;\n                if (indexerDeclaration.ParameterList.Parameters.Count != 1)\n                {\n                    return;\n                }\n\n                var parameter = indexerDeclaration.ParameterList.Parameters.First();\n\n                var parameterSymbol = c.Model.GetDeclaredSymbol(parameter);\n                if (parameterSymbol.Type == null\n                    || parameterSymbol.Type.TypeKind == TypeKind.Dynamic\n                    || parameterSymbol.Type.IsAny(AllowedIndexerTypes)\n                    || parameterSymbol.IsParams\n                    || IsGenericTypeParameter(parameterSymbol))\n                {\n                    return;\n                }\n\n                c.ReportIssue(Rule, parameter.Type);\n            },\n            SyntaxKind.IndexerDeclaration);\n\n        private static bool IsGenericTypeParameter(IParameterSymbol parameterSymbol) =>\n            parameterSymbol.ContainingType.ConstructedFrom.TypeParameters.Any(parameterSymbol.Type.Equals);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/SuppressFinalizeUseless.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class SuppressFinalizeUseless : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S3234\";\n        private const string MessageFormat = \"Remove this useless call to 'GC.SuppressFinalize'.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var invocation = (InvocationExpressionSyntax)c.Node;\n                    var suppressFinalizeSymbol = c.Model.GetSymbolInfo(invocation.Expression).Symbol as IMethodSymbol;\n\n                    if (suppressFinalizeSymbol?.Name != \"SuppressFinalize\" ||\n                        !invocation.HasExactlyNArguments(1) ||\n                        !suppressFinalizeSymbol.IsInType(KnownType.System_GC))\n                    {\n                        return;\n                    }\n\n                    var argument = invocation.ArgumentList.Arguments.First();\n                    var argumentType = c.Model.GetTypeInfo(argument.Expression).Type as INamedTypeSymbol;\n\n                    if (!argumentType.IsClass() ||\n                        !argumentType.IsSealed)\n                    {\n                        return;\n                    }\n\n                    var hasFinalizer = argumentType.GetSelfAndBaseTypes()\n                        .Where(type => !type.Is(KnownType.System_Object))\n                        .SelectMany(type => type.GetMembers())\n                        .OfType<IMethodSymbol>()\n                        .Any(methodSymbol => methodSymbol.MethodKind == MethodKind.Destructor);\n\n                    if (!hasFinalizer)\n                    {\n                        c.ReportIssue(rule, invocation);\n                    }\n                },\n                SyntaxKind.InvocationExpression);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/SuppressFinalizeUselessCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class SuppressFinalizeUselessCodeFix : SonarCodeFix\n    {\n        internal const string Title = \"Remove useless 'SuppressFinalize' call\";\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(SuppressFinalizeUseless.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            var syntaxNode = root.FindNode(diagnosticSpan);\n\n            if (syntaxNode.Parent is ExpressionStatementSyntax)\n            {\n                context.RegisterCodeFix(\n                    Title,\n                    c =>\n                    {\n                        var newRoot = root.RemoveNode(syntaxNode.Parent, SyntaxRemoveOptions.KeepNoTrivia);\n                        return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                    },\n                    context.Diagnostics);\n            }\n\n            return Task.CompletedTask;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/SwaggerActionReturnType.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class SwaggerActionReturnType : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S6968\";\n    private const string MessageFormat = \"{0}\";\n    private const string NoAttributeMessageFormat = \"Annotate this method with ProducesResponseType containing the return type for successful responses.\";\n    private const string NoTypeMessageFormat = \"Use the ProducesResponseType overload containing the return type for successful responses.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n    private static readonly ImmutableArray<KnownType> ControllerActionReturnTypes = ImmutableArray.Create(\n        KnownType.Microsoft_AspNetCore_Mvc_IActionResult,\n        KnownType.Microsoft_AspNetCore_Http_IResult);\n    private static readonly ImmutableArray<KnownType> ProducesAttributes = ImmutableArray.Create(\n        KnownType.Microsoft_AspNetCore_Mvc_ProducesAttribute,\n        KnownType.Microsoft_AspNetCore_Mvc_ProducesResponseTypeAttribute);\n    private static HashSet<string> ActionResultMethods =>\n    [\n        \"Ok\",\n        \"Created\",\n        \"CreatedAtAction\",\n        \"CreatedAtRoute\",\n        \"Accepted\",\n        \"AcceptedAtAction\",\n        \"AcceptedAtRoute\"\n    ];\n    private static HashSet<string> ResultMethods =>\n    [\n        \"Ok\",\n        \"Created\",\n        \"CreatedAtRoute\",\n        \"Accepted\",\n        \"AcceptedAtRoute\"\n    ];\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(compilationStart =>\n        {\n            if (!compilationStart.Compilation.Assembly.HasAttribute(KnownType.Microsoft_AspNetCore_Mvc_ApiConventionTypeAttribute)\n                && compilationStart.Compilation.ReferencesAll(KnownAssembly.MicrosoftAspNetCoreMvcCore, KnownAssembly.SwashbuckleAspNetCoreSwagger))\n            {\n                compilationStart.RegisterSymbolStartAction(symbolStart =>\n                {\n                    if (IsControllerCandidate(symbolStart.Symbol))\n                    {\n                        symbolStart.RegisterSyntaxNodeAction(nodeContext =>\n                        {\n                            var methodDeclaration = (MethodDeclarationSyntax)nodeContext.Node;\n                            if (InvalidMethod(methodDeclaration, nodeContext) is { } method)\n                            {\n                                nodeContext.ReportIssue(Rule, methodDeclaration.Identifier, method.ResponseInvocations.ToSecondaryLocations(), GetMessage(method.Symbol));\n                            }\n                        }, SyntaxKind.MethodDeclaration);\n                    }\n                }, SymbolKind.NamedType);\n            }\n        });\n\n    private static InvalidMethodResult InvalidMethod(BaseMethodDeclarationSyntax methodDeclaration, SonarSyntaxNodeReportingContext nodeContext)\n    {\n        var responseInvocations = FindSuccessResponses(methodDeclaration, nodeContext.Model);\n        return responseInvocations.Length == 0\n               || nodeContext.Model.GetDeclaredSymbol(methodDeclaration, nodeContext.Cancel) is not { } method\n               || !method.IsControllerActionMethod()\n               || !method.ReturnType.DerivesOrImplementsAny(ControllerActionReturnTypes)\n               || method.GetAttributesWithInherited().Any(x => x.AttributeClass.DerivesFrom(KnownType.Microsoft_AspNetCore_Mvc_ApiConventionMethodAttribute)\n                                                               || HasApiExplorerSettingsWithIgnoreApiTrue(x)\n                                                               || HasProducesAttributesWithReturnType(x))\n                   ? null\n                   : new InvalidMethodResult(method, responseInvocations);\n    }\n\n    private static SyntaxNode[] FindSuccessResponses(SyntaxNode node, SemanticModel model)\n    {\n        return ActionResultInvocations().Concat(ObjectCreationInvocations()).Concat(ResultMethodsInvocations()).ToArray();\n\n        IEnumerable<SyntaxNode> ActionResultInvocations() =>\n            node.DescendantNodes()\n                .OfType<InvocationExpressionSyntax>()\n                .Where(x => ActionResultMethods.Contains(x.GetName())\n                            && x.ArgumentList.Arguments.Count > 0\n                            && model.GetSymbolInfo(x.Expression).Symbol is { } symbol\n                            && symbol.IsInType(KnownType.Microsoft_AspNetCore_Mvc_ControllerBase)\n                            && symbol.GetParameters().Any(parameter => parameter.HasAttribute(KnownType.Microsoft_AspNetCore_Mvc_Infrastructure_ActionResultObjectValueAttribute)));\n\n        IEnumerable<SyntaxNode> ObjectCreationInvocations() =>\n            node.DescendantNodes()\n                .OfType<ObjectCreationExpressionSyntax>()\n                .Where(x => x.GetName() == \"ObjectResult\"\n                            && x.ArgumentList?.Arguments.Count > 0\n                            && model.GetSymbolInfo(x.Type).Symbol.GetSymbolType().Is(KnownType.Microsoft_AspNetCore_Mvc_ObjectResult));\n\n        IEnumerable<SyntaxNode> ResultMethodsInvocations() =>\n            node.DescendantNodes()\n                .OfType<InvocationExpressionSyntax>()\n                .Where(x => ResultMethods.Contains(x.GetName())\n                            && x.ArgumentList.Arguments.Count > 0\n                            && model.GetSymbolInfo(x).Symbol.IsInType(KnownType.Microsoft_AspNetCore_Http_Results));\n    }\n\n    private static bool IsControllerCandidate(ISymbol symbol)\n    {\n        var hasApiControllerAttribute = false;\n        foreach (var attribute in symbol.GetAttributesWithInherited())\n        {\n            if (attribute.AttributeClass.DerivesFrom(KnownType.Microsoft_AspNetCore_Mvc_ApiConventionTypeAttribute)\n                || HasProducesAttributesWithReturnType(attribute)\n                || HasApiExplorerSettingsWithIgnoreApiTrue(attribute))\n            {\n                return false;\n            }\n            hasApiControllerAttribute = hasApiControllerAttribute || attribute.AttributeClass.DerivesFrom(KnownType.Microsoft_AspNetCore_Mvc_ApiControllerAttribute);\n        }\n        return hasApiControllerAttribute;\n    }\n\n    private static string GetMessage(ISymbol symbol) =>\n        symbol.GetAttributesWithInherited().Any(x => x.AttributeClass.DerivesFrom(KnownType.Microsoft_AspNetCore_Mvc_ProducesResponseTypeAttribute))\n            ? NoTypeMessageFormat\n            : NoAttributeMessageFormat;\n\n    private static bool HasProducesAttributesWithReturnType(AttributeData attribute) =>\n        attribute.AttributeClass.DerivesFrom(KnownType.Microsoft_AspNetCore_Mvc_ProducesResponseTypeAttribute_T)\n        || attribute.AttributeClass.DerivesFrom(KnownType.Microsoft_AspNetCore_Mvc_ProducesAttribute_T)\n        || (attribute.AttributeClass.DerivesFromAny(ProducesAttributes) && ContainsReturnType(attribute));\n\n    private static bool HasApiExplorerSettingsWithIgnoreApiTrue(AttributeData attribute) =>\n        attribute.AttributeClass.DerivesFrom(KnownType.Microsoft_AspNetCore_Mvc_ApiExplorerSettingsAttribute)\n        && attribute.NamedArguments.FirstOrDefault(x => x.Key == \"IgnoreApi\").Value.Value is true;\n\n    private static bool ContainsReturnType(AttributeData attribute) =>\n        !attribute.ConstructorArguments.FirstOrDefault(x => x.Type.Is(KnownType.System_Type)).IsNull\n        || attribute.NamedArguments.FirstOrDefault(x => x.Key == \"Type\").Value.Value is not null;\n\n    private sealed record InvalidMethodResult(IMethodSymbol Symbol, SyntaxNode[] ResponseInvocations);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/SwitchCaseFallsThroughToDefault.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class SwitchCaseFallsThroughToDefault : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S3458\";\n        private const string MessageFormat = \"Remove this empty 'case' clause.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var section = (SwitchSectionSyntax)c.Node;\n\n                    if (section.Statements.Count == 1 ||\n                        !section.Labels.Any(SyntaxKind.DefaultSwitchLabel))\n                    {\n                        return;\n                    }\n\n                    foreach (var label in section.Labels.Where(label => !label.IsKind(SyntaxKind.DefaultSwitchLabel)))\n                    {\n                        c.ReportIssue(rule, label);\n                    }\n                },\n                SyntaxKind.SwitchSection);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/SwitchCaseFallsThroughToDefaultCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class SwitchCaseFallsThroughToDefaultCodeFix : SonarCodeFix\n    {\n        internal const string Title = \"Remove useless 'case'\";\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(SwitchCaseFallsThroughToDefault.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n\n            if (!(root.FindNode(diagnosticSpan) is CaseSwitchLabelSyntax syntaxNode))\n            {\n                return Task.CompletedTask;\n            }\n\n            context.RegisterCodeFix(\n                Title,\n                c =>\n                {\n                    var newRoot = root.RemoveNode(syntaxNode, SyntaxRemoveOptions.KeepNoTrivia);\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n\n            return Task.CompletedTask;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/SwitchCasesMinimumThree.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class SwitchCasesMinimumThree : SwitchCasesMinimumThreeBase\n    {\n        private enum SwitchExpressionType\n        {\n            SingleReturnValue,\n            TwoReturnValues,\n            ManyReturnValues\n        }\n\n        private const string SwitchStatementMessage = \"Replace this 'switch' statement with 'if' statements to increase readability.\";\n\n        private const string TwoReturnValueSwitchExpressionMessage = \"Replace this 'switch' expression with a ternary conditional operator to increase readability.\";\n\n        private const string SingleReturnValueSwitchExpressionMessage = \"Remove this 'switch' expression to increase readability.\";\n\n        private static readonly DiagnosticDescriptor rule = DescriptorFactory.Create(DiagnosticId, \"{0}\");\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var switchNode = (SwitchStatementSyntax)c.Node;\n                    if (!HasAtLeastThreeLabels(switchNode))\n                    {\n                        c.ReportIssue(rule, switchNode.SwitchKeyword, SwitchStatementMessage);\n                    }\n                },\n                SyntaxKind.SwitchStatement);\n\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var switchNode = (SwitchExpressionSyntaxWrapper)c.Node;\n                    var message = EvaluateType(switchNode) switch\n                    {\n                        SwitchExpressionType.SingleReturnValue => SingleReturnValueSwitchExpressionMessage,\n                        SwitchExpressionType.TwoReturnValues => TwoReturnValueSwitchExpressionMessage,\n                        _ => string.Empty\n                    };\n                    if (message != string.Empty)\n                    {\n                        c.ReportIssue(rule, switchNode.SwitchKeyword, message);\n                    }\n                },\n                SyntaxKindEx.SwitchExpression);\n        }\n\n        private static bool HasAtLeastThreeLabels(SwitchStatementSyntax node) =>\n            node.Sections.Sum(section => section.Labels.Count) >= 3;\n\n        private static SwitchExpressionType EvaluateType(SwitchExpressionSyntaxWrapper switchExpression)\n        {\n            var numberOfArms = switchExpression.Arms.Count;\n            if (numberOfArms > 2)\n            {\n                return SwitchExpressionType.ManyReturnValues;\n            }\n            var hasDiscardValue = switchExpression.HasDiscardPattern();\n            if (numberOfArms == 2)\n            {\n                return hasDiscardValue ? SwitchExpressionType.TwoReturnValues : SwitchExpressionType.ManyReturnValues;\n            }\n            if (numberOfArms == 1)\n            {\n                return hasDiscardValue ? SwitchExpressionType.SingleReturnValue : SwitchExpressionType.TwoReturnValues;\n            }\n            return SwitchExpressionType.SingleReturnValue;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/SwitchDefaultClauseEmpty.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class SwitchDefaultClauseEmpty : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S3532\";\n        private const string MessageFormat = \"Remove this empty 'default' clause.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var section = (SwitchSectionSyntax)c.Node;\n\n                    if (!section.Labels.Any(SyntaxKind.DefaultSwitchLabel) ||\n                        section.Statements.Count != 1)\n                    {\n                        return;\n                    }\n\n                    if (section.Statements[0].IsKind(SyntaxKind.BreakStatement) &&\n                        !HasAnyComment(section))\n                    {\n                        c.ReportIssue(rule, section);\n                    }\n                },\n                SyntaxKind.SwitchSection);\n        }\n\n        private static bool HasAnyComment(SwitchSectionSyntax section) =>\n            section.Labels.Last()\n                .GetTrailingTrivia()                                // handle comments after last label, which will normally be default:\n                .Union(section.Statements[0].GetLeadingTrivia())    // handle comments before break\n                .Union(section.Statements[0].GetTrailingTrivia())   // handle comments after break\n                .Any(trivia =>\n                    trivia.IsKind(SyntaxKind.SingleLineCommentTrivia) ||\n                    trivia.IsKind(SyntaxKind.MultiLineCommentTrivia));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/SwitchDefaultClauseEmptyCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class SwitchDefaultClauseEmptyCodeFix : SonarCodeFix\n    {\n        internal const string Title = \"Remove empty 'default' clause\";\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(SwitchDefaultClauseEmpty.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            if (!(root.FindNode(diagnosticSpan) is SwitchSectionSyntax syntaxNode))\n            {\n                return Task.CompletedTask;\n            }\n\n            context.RegisterCodeFix(\n                Title,\n                c =>\n                {\n                    var newRoot = root.RemoveNode(syntaxNode, SyntaxRemoveOptions.KeepNoTrivia);\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n\n            return Task.CompletedTask;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/SwitchSectionShouldNotHaveTooManyStatements.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class SwitchSectionShouldNotHaveTooManyStatements : SwitchSectionShouldNotHaveTooManyStatementsBase\n    {\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat,\n                isEnabledByDefault: false);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarParametrizedAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var switchSection = (SwitchSectionSyntax)c.Node;\n\n                    if (switchSection.IsMissing ||\n                        switchSection.Labels.Count <= 0)\n                    {\n                        return;\n                    }\n\n                    var statementsCount = switchSection.Statements.SelectMany(GetSubStatements).Count();\n                    if (statementsCount > Threshold)\n                    {\n                        c.ReportIssue(rule, switchSection.Labels.First(), \"switch section\", statementsCount.ToString(), Threshold.ToString(), \"method\");\n                    }\n                },\n                SyntaxKind.SwitchSection);\n        }\n\n        private IEnumerable<StatementSyntax> GetSubStatements(StatementSyntax statement) =>\n            statement.DescendantNodesAndSelf()\n                .OfType<StatementSyntax>()\n                .Where(s => !(s is BlockSyntax));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/SwitchShouldNotBeNested.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class SwitchShouldNotBeNested : SwitchShouldNotBeNestedBase\n    {\n        private const string MessageFormat = \"Refactor the code to eliminate this nested 'switch'.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var switchStatement = (SwitchStatementSyntax)c.Node;\n                    if (switchStatement.Parent?.FirstAncestorOrSelf<SwitchStatementSyntax>() != null)\n                    {\n                        c.ReportIssue(rule, switchStatement.SwitchKeyword);\n                    }\n                },\n                SyntaxKind.SwitchStatement);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/SwitchWithoutDefault.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public class SwitchWithoutDefault : SwitchWithoutDefaultBase<SyntaxKind>\n    {\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        private static readonly ImmutableArray<SyntaxKind> kindsOfInterest = ImmutableArray.Create(SyntaxKind.SwitchStatement);\n        public override ImmutableArray<SyntaxKind> SyntaxKindsOfInterest => kindsOfInterest;\n\n        protected override bool TryGetDiagnostic(SyntaxNode node, out Diagnostic diagnostic)\n        {\n            diagnostic = null;\n            var switchNode = (SwitchStatementSyntax)node;\n            if(!switchNode.HasDefaultLabel())\n            {\n                diagnostic = Diagnostic.Create(rule, switchNode.SwitchKeyword.GetLocation(), \"default\", \"switch\");\n                return true;\n            }\n\n            return false;\n        }\n\n        protected override GeneratedCodeRecognizer GeneratedCodeRecognizer => CSharpGeneratedCodeRecognizer.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/TabCharacter.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class TabCharacter : TabCharacterBase\n    {\n        private const string DiagnosticId = \"S105\";\n        private const string MessageFormat = \"Replace all tab characters in this file by sequences of white-spaces.\";\n\n        internal static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override GeneratedCodeRecognizer GeneratedCodeRecognizer => CSharpGeneratedCodeRecognizer.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/TaskConfigureAwait.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class TaskConfigureAwait : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S3216\";\n        private const string MessageFormat = \"Add '.ConfigureAwait(false)' to this call to allow execution to continue in any thread.\";\n\n        private static readonly DiagnosticDescriptor rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    if (c.Compilation.Options.OutputKind != OutputKind.DynamicallyLinkedLibrary\n                        || !c.Compilation.IsNetFrameworkTarget())\n                    {\n                        // This rule only makes sense in libraries under .NET Framework\n                        return;\n                    }\n\n                    if (((AwaitExpressionSyntax)c.Node).Expression is { } expression\n                        && c.Model.GetTypeInfo(expression).Type is { } type\n                        && type.DerivesFrom(KnownType.System_Threading_Tasks_Task))\n                    {\n                        c.ReportIssue(rule, expression);\n                    }\n                },\n                SyntaxKind.AwaitExpression);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/TestClassShouldHaveTestMethod.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class TestClassShouldHaveTestMethod : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S2187\";\n    private const string MessageFormat = \"Add some tests to this {0}.\";\n\n    private static readonly ImmutableArray<KnownType> HandledSetupAndCleanUpAttributes =\n        ImmutableArray.Create(\n            // Only applies to MSTest.\n            // NUnit has equivalent attributes, but they can only be applied to classes\n            // marked with [SetupFixture], which cannot contain tests.\n            KnownType.Microsoft_VisualStudio_TestTools_UnitTesting_AssemblyInitializeAttribute,\n            KnownType.Microsoft_VisualStudio_TestTools_UnitTesting_AssemblyCleanupAttribute);\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var typeDeclaration = (TypeDeclarationSyntax)c.Node;\n                if (!c.IsRedundantPositionalRecordContext()\n                    && !typeDeclaration.Identifier.IsMissing\n                    && c.Model.GetDeclaredSymbol(typeDeclaration) is { } typeSymbol\n                    && IsViolatingRule(typeSymbol)\n                    && !IsExceptionToTheRule(typeSymbol))\n                {\n                    c.ReportIssue(Rule, typeDeclaration.Identifier, typeDeclaration.GetDeclarationTypeName());\n                }\n            },\n            SyntaxKind.ClassDeclaration,\n            SyntaxKindEx.RecordDeclaration);\n\n    private static bool HasAnyTestMethod(INamespaceOrTypeSymbol symbol) =>\n        symbol.GetMembers().OfType<IMethodSymbol>().Any(m => m.IsTestMethod());\n\n    private static bool IsViolatingRule(INamedTypeSymbol symbol) =>\n        symbol.IsTestClass()\n        && !HasAnyTestMethod(symbol);\n\n    private static bool IsExceptionToTheRule(ITypeSymbol symbol) =>\n        symbol.IsAbstract\n        || symbol.GetSelfAndBaseTypes().Any(HasAnyTestMethod)\n        || HasSetupOrCleanupAttributes(symbol);\n\n    private static bool HasSetupOrCleanupAttributes(INamespaceOrTypeSymbol symbol) =>\n        symbol.GetMembers().OfType<IMethodSymbol>().Any(m => m.GetAttributes(HandledSetupAndCleanUpAttributes).Any());\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/TestMethodShouldContainAssertion.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class TestMethodShouldContainAssertion : SonarDiagnosticAnalyzer\n{\n    internal const string DiagnosticId = \"S2699\";\n    private const string MessageFormat = \"Add at least one assertion to this test case.\";\n    private const string CustomAssertionAttributeName = \"AssertionMethodAttribute\";\n    private const int MaxInvocationDepth = 2; // Consider BFS instead of DFS if this gets increased\n\n    private static readonly Dictionary<string, KnownType[]> KnownAssertions = new()\n    {\n        {\"DidNotReceive\", [KnownType.NSubstitute_SubstituteExtensions] },\n        {\"DidNotReceiveWithAnyArgs\", [KnownType.NSubstitute_SubstituteExtensions] },\n        {\"Received\", [KnownType.NSubstitute_SubstituteExtensions, KnownType.NSubstitute_ReceivedExtensions_ReceivedExtensions] },\n        {\"ReceivedWithAnyArgs\", [KnownType.NSubstitute_SubstituteExtensions, KnownType.NSubstitute_ReceivedExtensions_ReceivedExtensions] },\n        {\"InOrder\", [KnownType.NSubstitute_Received] },\n    };\n\n    /// The assertions in the Shouldly, Moq and FsCheck libraries are supported by <see cref=\"UnitTestHelper.KnownAssertionMethodParts\"/>\n    /// - All assertions in Shouldly contain \"Should\" in their name.\n    /// - All assertions in Moq contain \"Verify\" in their name.\n    private static readonly ImmutableArray<KnownType> KnownAssertionTypes = ImmutableArray.Create(\n        KnownType.Microsoft_VisualStudio_TestTools_UnitTesting_Assert,\n        KnownType.NFluent_Check,\n        KnownType.NUnit_Framework_Assert,\n        KnownType.NUnit_Framework_Legacy_ClassicAssert,\n        KnownType.Xunit_Assert);\n\n    private static readonly ImmutableArray<KnownType> KnownAssertionExceptionTypes = ImmutableArray.Create(\n        KnownType.Microsoft_VisualStudio_TestTools_UnitTesting_AssertFailedException,\n        KnownType.NFluent_FluentCheckException,\n        KnownType.NFluent_Kernel_FluentCheckException,\n        KnownType.NUnit_Framework_AssertionException,\n        KnownType.Xunit_Sdk_AssertException,\n        KnownType.Xunit_Sdk_XunitException);\n\n    private static readonly ImmutableArray<KnownType> FsCheckPropertyAttributes = ImmutableArray.Create(\n        KnownType.FsCheck_Xunit_PropertyAttribute,\n        KnownType.FsCheck_NUnit_PropertyAttribute);\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            c =>\n            {\n                var declaration = MethodDeclarationFactory.Create(c.Node);\n                if (!declaration.Identifier.IsMissing\n                    && declaration.HasImplementation\n                    && c.Model.GetDeclaredSymbol(c.Node) is IMethodSymbol method\n                    && method.IsTestMethod()\n                    && !method.HasExpectedExceptionAttribute()\n                    && !method.HasAssertionInAttribute()\n                    && !method.IsIgnoredTestMethod()\n                    && !method.HasAnyAttribute(FsCheckPropertyAttributes)\n                    && !ContainsAssertion(c.Node, c.Model, new HashSet<IMethodSymbol>(), 0))\n                {\n                    c.ReportIssue(Rule, declaration.Identifier);\n                }\n            },\n            SyntaxKind.MethodDeclaration,\n            SyntaxKindEx.LocalFunctionStatement);\n\n    private static bool ContainsAssertion(SyntaxNode methodDeclaration, SemanticModel model, ISet<IMethodSymbol> visitedSymbols, int level)\n    {\n        var currentModel = methodDeclaration.EnsureCorrectSemanticModelOrDefault(model);\n        if (currentModel is null)\n        {\n            return false;\n        }\n\n        var descendantNodes = methodDeclaration.DescendantNodes();\n        var invocations = descendantNodes.OfType<InvocationExpressionSyntax>().ToArray();\n        if (Array.Exists(invocations, IsAssertion)\n            || descendantNodes.OfType<ThrowStatementSyntax>().Any(x => x.Expression is not null && currentModel.GetTypeInfo(x.Expression).Type.DerivesFromAny(KnownAssertionExceptionTypes)))\n        {\n            return true;\n        }\n\n        var invokedSymbols = invocations.Select(x => currentModel.GetSymbolInfo(x).Symbol).OfType<IMethodSymbol>();\n        if (invokedSymbols.Any(x => IsKnownAssertion(x) || IsCustomAssertion(x)))\n        {\n            return true;\n        }\n\n        if (level == MaxInvocationDepth)\n        {\n            return false;\n        }\n\n        foreach (var symbol in invokedSymbols.Where(x => !visitedSymbols.Contains(x)))\n        {\n            visitedSymbols.Add(symbol);\n            if (symbol.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).OfType<MethodDeclarationSyntax>().Any(x => ContainsAssertion(x, currentModel, visitedSymbols, level + 1)))\n            {\n                return true;\n            }\n        }\n\n        return false;\n    }\n\n    private static bool IsAssertion(InvocationExpressionSyntax invocation) =>\n        invocation.Expression\n            .ToString()\n            .SplitCamelCaseToWords()\n            .Intersect(KnownMethods.AssertionMethodParts)\n            .Any();\n\n    private static bool IsKnownAssertion(ISymbol methodSymbol) =>\n        (KnownAssertions.GetValueOrDefault(methodSymbol.Name) is { } types && Array.Exists(types, x => methodSymbol.ContainingType.ConstructedFrom.Is(x)))\n        || methodSymbol.ContainingType.DerivesFromAny(KnownAssertionTypes);\n\n    private static bool IsCustomAssertion(ISymbol methodSymbol) =>\n        methodSymbol.GetAttributesWithInherited().Any(x => x.AttributeClass.Name == CustomAssertionAttributeName);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/TestMethodShouldHaveCorrectSignature.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class TestMethodShouldHaveCorrectSignature : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S3433\";\n        private const string MessageFormat = \"Make this test method {0}.\";\n        private const string MakePublicMessage = \"'public'\";\n        private const string MakeNonAsyncOrTaskMessage = \"non-'async' or return 'Task'\";\n        private const string MakeNotGenericMessage = \"non-generic\";\n        private const string MakeMethodNotLocalFunction = \"a public method instead of a local function\";\n\n        /// <summary>\n        /// Validation method. Checks the supplied method and returns the error message,\n        /// or null if there is no issue.\n        /// </summary>\n        private delegate string SignatureValidator(SyntaxNode methodNode, IMethodSymbol methodSymbol);\n\n        private static readonly SignatureValidator NullValidator = (node, symbol) => null;\n\n        // We currently support three test framework, each of which supports multiple test method attribute markers, and each of which\n        // has differing constraints (public/private, generic/non-generic).\n        // Rather than writing lots of conditional code, we're using a simple table-driven approach.\n        // Currently we use the same validation method for all method types, but we could have a\n        // different validation method for each type in future if necessary.\n        private static readonly Dictionary<KnownType, SignatureValidator> AttributeToConstraintsMap = new()\n        {\n            // MSTest\n            {\n                KnownType.Microsoft_VisualStudio_TestTools_UnitTesting_TestMethodAttribute,\n                (node, symbol) => GetFaultMessage(node, symbol, publicOnly: true, allowGenerics: false)\n            },\n            {\n                KnownType.Microsoft_VisualStudio_TestTools_UnitTesting_DataTestMethodAttribute,\n                (node, symbol) => GetFaultMessage(node, symbol, publicOnly: true, allowGenerics: false)\n            },\n\n            // NUnit\n            {\n                KnownType.NUnit_Framework_TestAttribute,\n                (node, symbol) => GetFaultMessage(node, symbol, publicOnly: true, allowGenerics: false)\n            },\n            {\n                KnownType.NUnit_Framework_TestCaseAttribute,\n                (node, symbol) => GetFaultMessage(node, symbol, publicOnly: true, allowGenerics: true)\n            },\n            {\n                KnownType.NUnit_Framework_TestCaseSourceAttribute,\n                (node, symbol) => GetFaultMessage(node, symbol, publicOnly: true, allowGenerics: true)\n            },\n            {\n                KnownType.NUnit_Framework_TheoryAttribute,\n                (node, symbol) => GetFaultMessage(node, symbol, publicOnly: true, allowGenerics: false)\n            },\n\n            // XUnit - note that local functions can be test methods, thus we skip checking the syntax node\n            {\n                KnownType.Xunit_FactAttribute,\n                (_, symbol) => GetFaultMessage(symbol, publicOnly: false, allowGenerics: false, allowAsyncVoid: true)\n            },\n            {\n                KnownType.Xunit_TheoryAttribute,\n                (_, symbol) => GetFaultMessage(symbol, publicOnly: false, allowGenerics: true, allowAsyncVoid: true)\n            },\n            {\n                KnownType.LegacyXunit_TheoryAttribute,\n                (_, symbol) => GetFaultMessage(symbol, publicOnly: false, allowGenerics: true, allowAsyncVoid: true)\n            }\n        };\n\n        private static readonly DiagnosticDescriptor Rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(AnalyzeMethod, SyntaxKind.MethodDeclaration, SyntaxKindEx.LocalFunctionStatement);\n\n        private static void AnalyzeMethod(SonarSyntaxNodeReportingContext c)\n        {\n            if (HasAttributes(c.Node) && c.Model.GetDeclaredSymbol(c.Node) is IMethodSymbol methodSymbol)\n            {\n                var validator = GetValidator(methodSymbol);\n                var message = validator(c.Node, methodSymbol);\n                if (message != null)\n                {\n                    c.ReportIssue(Rule, methodSymbol.Locations.First(), message);\n                }\n            }\n        }\n\n        private static bool HasAttributes(SyntaxNode node) =>\n            node is MethodDeclarationSyntax methodDeclaration\n                ? methodDeclaration.AttributeLists.Count > 0\n                : ((LocalFunctionStatementSyntaxWrapper)node).AttributeLists.Count > 0;\n\n        private static SignatureValidator GetValidator(IMethodSymbol method) =>\n            // Find the first matching attribute type in the table\n            method.FindFirstTestMethodType() is { } attributeKnownType\n                ? AttributeToConstraintsMap.GetValueOrDefault(attributeKnownType)\n                : NullValidator;\n\n        private static string GetFaultMessage(SyntaxNode methodNode, IMethodSymbol methodSymbol, bool publicOnly, bool allowGenerics, bool allowAsyncVoid = false) =>\n            LocalFunctionStatementSyntaxWrapper.IsInstance(methodNode)\n                ? MakeMethodNotLocalFunction\n                : GetFaultMessage(methodSymbol, publicOnly, allowGenerics, allowAsyncVoid);\n\n        private static string GetFaultMessage(IMethodSymbol methodSymbol, bool publicOnly, bool allowGenerics, bool allowAsyncVoid) =>\n            GetFaultMessageParts(methodSymbol, publicOnly, allowGenerics, allowAsyncVoid).ToSentence();\n\n        private static IEnumerable<string> GetFaultMessageParts(IMethodSymbol methodSymbol, bool publicOnly, bool allowGenerics, bool allowAsyncVoid)\n        {\n            if (methodSymbol.DeclaredAccessibility != Accessibility.Public && publicOnly)\n            {\n                yield return MakePublicMessage;\n            }\n\n            if (methodSymbol.IsGenericMethod && !allowGenerics)\n            {\n                yield return MakeNotGenericMessage;\n            }\n\n            // Invariant - applies to all test methods\n            if (methodSymbol.IsAsync && methodSymbol.ReturnsVoid && !allowAsyncVoid)\n            {\n                yield return MakeNonAsyncOrTaskMessage;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/TestMethodShouldNotBeIgnored.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class TestMethodShouldNotBeIgnored : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S1607\";\n        private const string MessageFormat = \"Either remove this 'Ignore' attribute or add an explanation about why this test is ignored.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        private static readonly ImmutableArray<KnownType> TrackedTestIdentifierAttributes =\n            // xUnit has it's own \"ignore\" mechanism (by providing a (Skip = \"reason\") string in the attribute, so there is always an explanation for the test being skipped).\n            KnownType.TestMethodAttributesOfMSTest\n            .Concat(KnownType.TestMethodAttributesOfNUnit)\n            .Append(KnownType.Microsoft_VisualStudio_TestTools_UnitTesting_TestClassAttribute)\n            .ToImmutableArray();\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var attribute = (AttributeSyntax)c.Node;\n                    if (HasReasonPhrase(attribute)\n                        || HasTrailingComment(attribute)\n                        || !IsKnownIgnoreAttribute(attribute, c.Model)\n                        || attribute.Parent?.Parent is not { } attributeTarget)\n                    {\n                        return;\n                    }\n\n                    var attributes = GetAllAttributes(attributeTarget, c.Model);\n\n                    if (attributes.Any(IsTestOrTestClassAttribute)\n                        && !attributes.Any(IsWorkItemAttribute))\n                    {\n                        c.ReportIssue(Rule, attribute);\n                    }\n                },\n                SyntaxKind.Attribute);\n\n        private static IEnumerable<AttributeData> GetAllAttributes(SyntaxNode syntaxNode, SemanticModel semanticModel) =>\n            semanticModel.GetDeclaredSymbol(syntaxNode) is { } testMethodOrClass\n                ? testMethodOrClass.GetAttributes()\n                : Enumerable.Empty<AttributeData>();\n\n        private static bool HasReasonPhrase(AttributeSyntax ignoreAttributeSyntax) =>\n            ignoreAttributeSyntax.ArgumentList?.Arguments.Count > 0; // Any ctor argument counts are reason phrase\n\n        private static bool HasTrailingComment(SyntaxNode ignoreAttributeSyntax) =>\n            ignoreAttributeSyntax.Parent\n                .GetTrailingTrivia()\n                .Any(SyntaxKind.SingleLineCommentTrivia);\n\n        private static bool IsWorkItemAttribute(AttributeData a) =>\n            a.AttributeClass.Is(KnownType.Microsoft_VisualStudio_TestTools_UnitTesting_WorkItemAttribute);\n\n        private static bool IsKnownIgnoreAttribute(AttributeSyntax attributeSyntax, SemanticModel semanticModel)\n        {\n            var symbolInfo = semanticModel.GetSymbolInfo(attributeSyntax);\n\n            var attributeConstructor = symbolInfo.Symbol ?? symbolInfo.CandidateSymbols.FirstOrDefault();\n\n            return attributeConstructor is not null && attributeConstructor.ContainingType.DerivesFromAny(KnownType.IgnoreAttributes);\n        }\n\n        private static bool IsTestOrTestClassAttribute(AttributeData a) =>\n            a.AttributeClass.DerivesFromAny(TrackedTestIdentifierAttributes);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/TestsShouldNotUseThreadSleep.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class TestsShouldNotUseThreadSleep : TestsShouldNotUseThreadSleepBase<MethodDeclarationSyntax, SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override SyntaxNode MethodDeclaration(MethodDeclarationSyntax method) => method;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ThisShouldNotBeExposedFromConstructors.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class ThisShouldNotBeExposedFromConstructors : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S3366\";\n        private const string MessageFormat = \"Make sure the use of 'this' doesn't expose partially-constructed instances of this class in multi-threaded environments.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterCodeBlockStartAction(\n                cbc =>\n                {\n                    if (!IsInstanceConstructor(cbc.CodeBlock))\n                    {\n                        return;\n                    }\n\n                    cbc.RegisterNodeAction(\n                        c =>\n                        {\n                            var invocation = (InvocationExpressionSyntax)c.Node;\n                            if (invocation.ArgumentList == null)\n                            {\n                                return;\n                            }\n\n                            var thisExpression = invocation.ArgumentList.Arguments\n                                .Select(a => a.Expression)\n                                .FirstOrDefault(IsThisExpression);\n\n                            if (thisExpression != null &&\n                                !IsClassMember(invocation.Expression) &&\n                                c.Model.GetSymbolInfo(invocation.Expression).Symbol is IMethodSymbol)\n                            {\n                                c.ReportIssue(rule, thisExpression);\n                            }\n                        },\n                        SyntaxKind.InvocationExpression);\n                    cbc.RegisterNodeAction(\n                        c =>\n                        {\n                            var assignment = (AssignmentExpressionSyntax)c.Node;\n\n                            var right = assignment.Right.RemoveParentheses();\n\n                            if (IsThisExpression(right) &&\n                                !IsClassMember(assignment.Left) &&\n                                c.Model.GetSymbolInfo(assignment.Left).Symbol is IPropertySymbol)\n                            {\n                                c.ReportIssue(rule, right);\n                            }\n                        },\n                        SyntaxKind.SimpleAssignmentExpression);\n                });\n        }\n\n        private bool IsClassMember(ExpressionSyntax expression) =>\n            expression is IdentifierNameSyntax ||\n            (expression is MemberAccessExpressionSyntax memberAccess && IsThisExpression(memberAccess.Expression));\n\n        private static bool IsThisExpression(ExpressionSyntax expression) =>\n            expression != null &&\n            expression.RemoveParentheses().IsKind(SyntaxKind.ThisExpression);\n\n        private static bool IsInstanceConstructor(SyntaxNode node)\n        {\n            bool IsStaticKeyword(SyntaxToken token) => token.IsKind(SyntaxKind.StaticKeyword);\n\n            return node is ConstructorDeclarationSyntax ctor\n                && !ctor.Modifiers.Any(IsStaticKeyword);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ThreadResumeOrSuspendShouldNotBeCalled.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class ThreadResumeOrSuspendShouldNotBeCalled : ThreadResumeOrSuspendShouldNotBeCalledBase<SyntaxKind, InvocationExpressionSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ThreadStaticNonStaticField.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class ThreadStaticNonStaticField : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S3005\";\n        private const string MessageFormat = \"Remove the 'ThreadStatic' attribute from this definition.\";\n\n        private static readonly DiagnosticDescriptor Rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    if ((FieldDeclarationSyntax)c.Node is var fieldDeclaration\n                        && !fieldDeclaration.Modifiers.Any(SyntaxKind.StaticKeyword)\n                        && fieldDeclaration.AttributeLists.GetAttributes(KnownType.System_ThreadStaticAttribute, c.Model).FirstOrDefault() is { } threadStaticAttribute)\n                    {\n                        c.ReportIssue(Rule, threadStaticAttribute.Name);\n                    }\n                },\n                SyntaxKind.FieldDeclaration);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ThreadStaticNonStaticFieldCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class ThreadStaticNonStaticFieldCodeFix : SonarCodeFix\n    {\n        internal const string Title = \"Remove 'ThreadStatic' attribute\";\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(ThreadStaticNonStaticField.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            var nodeToRemove = root.FindNode(diagnosticSpan);\n\n            if (nodeToRemove.Parent is AttributeListSyntax attributeList && attributeList.Attributes.Count == 1)\n            {\n                nodeToRemove = attributeList;\n            }\n\n            context.RegisterCodeFix(\n                Title,\n                c =>\n                {\n                    var newRoot = root.RemoveNode(nodeToRemove, SyntaxRemoveOptions.KeepNoTrivia);\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n\n            return Task.CompletedTask;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ThreadStaticWithInitializer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class ThreadStaticWithInitializer : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S2996\";\n        private const string MessageFormat = \"Remove this initialization of '{0}' or make it lazy.\";\n\n        private static readonly DiagnosticDescriptor Rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var fieldDeclaration = (FieldDeclarationSyntax)c.Node;\n\n                    if (!fieldDeclaration.Modifiers.Any(SyntaxKind.StaticKeyword)\n                        || !HasThreadStaticAttribute(fieldDeclaration.AttributeLists, c.Model))\n                    {\n                        return;\n                    }\n\n                    foreach (var variableDeclaratorSyntax in fieldDeclaration.Declaration.Variables.Where(variableDeclaratorSyntax => variableDeclaratorSyntax.Initializer != null))\n                    {\n                        c.ReportIssue(Rule, variableDeclaratorSyntax.Initializer, variableDeclaratorSyntax.Identifier.ValueText);\n                    }\n                },\n                SyntaxKind.FieldDeclaration);\n        private static bool HasThreadStaticAttribute(SyntaxList<AttributeListSyntax> attributeLists, SemanticModel semanticModel) =>\n            attributeLists.Any()\n            && attributeLists.Any(attributeList => attributeList.Attributes.Any(attribute => attribute.IsKnownType(KnownType.System_ThreadStaticAttribute, semanticModel)));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ThrowReservedExceptions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ThrowReservedExceptions : ThrowReservedExceptionsBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(c => Process(c, ((ThrowStatementSyntax)c.Node).Expression), SyntaxKind.ThrowStatement);\n        context.RegisterNodeAction(c => Process(c, ((ThrowExpressionSyntaxWrapper)c.Node).Expression), SyntaxKindEx.ThrowExpression);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ToStringShouldNotReturnNull.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ToStringShouldNotReturnNull : ToStringShouldNotReturnNullBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override SyntaxKind MethodKind => SyntaxKind.MethodDeclaration;\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        base.Initialize(context);\n\n        context.RegisterNodeAction(\n            c => ToStringReturnsNull(c, ((MethodDeclarationSyntax)c.Node).ExpressionBody),\n            SyntaxKind.MethodDeclaration);\n    }\n\n    protected override IEnumerable<SyntaxNode> Conditionals(SyntaxNode expression) =>\n        expression is ConditionalExpressionSyntax conditional\n            ? [conditional.WhenTrue, conditional.WhenFalse]\n            : [];\n\n    protected override bool IsLocalOrLambda(SyntaxNode node) =>\n        node?.Kind() is SyntaxKind.ParenthesizedLambdaExpression or SyntaxKind.SimpleLambdaExpression or SyntaxKindEx.LocalFunctionStatement;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/TooManyGenericParameters.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public class TooManyGenericParameters : ParametrizedDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S2436\";\n        private const string MessageFormat = \"Reduce the number of generic parameters in the '{0}' {1} to no more than the {2} authorized.\";\n        private const int DefaultMaxNumberOfGenericParametersInClass = 2;\n        private const int DefaultMaxNumberOfGenericParametersInMethod = 3;\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat, isEnabledByDefault: false);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        [RuleParameter(\"max\", PropertyType.Integer, \"Maximum authorized number of generic parameters.\", DefaultMaxNumberOfGenericParametersInClass)]\n        public int MaxNumberOfGenericParametersInClass { get; set; } = DefaultMaxNumberOfGenericParametersInClass;\n\n        [RuleParameter(\"maxMethod\", PropertyType.Integer, \"Maximum authorized number of generic parameters for methods.\", DefaultMaxNumberOfGenericParametersInMethod)]\n        public int MaxNumberOfGenericParametersInMethod { get; set; } = DefaultMaxNumberOfGenericParametersInMethod;\n\n        protected override void Initialize(SonarParametrizedAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var typeDeclaration = (TypeDeclarationSyntax)c.Node;\n\n                    if (c.IsRedundantPositionalRecordContext()\n                        || typeDeclaration.TypeParameterList == null\n                        || typeDeclaration.TypeParameterList.Parameters.Count <= MaxNumberOfGenericParametersInClass)\n                    {\n                        return;\n                    }\n\n                    c.ReportIssue(Rule, typeDeclaration.Identifier, typeDeclaration.Identifier.ValueText, typeDeclaration.GetDeclarationTypeName(), MaxNumberOfGenericParametersInClass.ToString());\n                },\n                SyntaxKind.ClassDeclaration,\n                SyntaxKind.StructDeclaration,\n                SyntaxKind.InterfaceDeclaration,\n                SyntaxKindEx.RecordDeclaration,\n                SyntaxKindEx.RecordStructDeclaration);\n\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var methodDeclaration = MethodDeclarationFactory.Create(c.Node);\n                    if (methodDeclaration.TypeParameterList == null\n                        || methodDeclaration.TypeParameterList.Parameters.Count <= MaxNumberOfGenericParametersInMethod)\n                    {\n                        return;\n                    }\n\n                    c.ReportIssue(\n                        Rule,\n                        methodDeclaration.Identifier,\n                        new[] { EnclosingTypeName(c.Node), methodDeclaration.Identifier.ValueText }.JoinNonEmpty(\".\"),\n                        \"method\",\n                        MaxNumberOfGenericParametersInMethod.ToString());\n                },\n                SyntaxKind.MethodDeclaration,\n                SyntaxKindEx.LocalFunctionStatement);\n        }\n\n        private static string EnclosingTypeName(SyntaxNode node) =>\n            node.Ancestors().OfType<BaseTypeDeclarationSyntax>().FirstOrDefault()?.Identifier.ValueText;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/TooManyLabelsInSwitch.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class TooManyLabelsInSwitch : TooManyLabelsInSwitchBase<SyntaxKind, SwitchStatementSyntax>\n{\n    private static readonly ISet<SyntaxKind> IgnoredStatementsInSwitch = new HashSet<SyntaxKind> { SyntaxKind.BreakStatement, SyntaxKind.ReturnStatement, SyntaxKind.ThrowStatement };\n\n    private static readonly ISet<SyntaxKind> TransparentSyntax = new HashSet<SyntaxKind>\n    {\n        SyntaxKind.Block,\n        SyntaxKind.CatchClause,\n        SyntaxKind.CheckedStatement,\n        SyntaxKind.DoStatement,\n        SyntaxKind.FinallyClause,\n        SyntaxKind.FixedStatement,\n        SyntaxKind.ForEachStatement,\n        SyntaxKindEx.ForEachVariableStatement,\n        SyntaxKind.ForStatement,\n        SyntaxKind.IfStatement,\n        SyntaxKind.LockStatement,\n        SyntaxKind.SwitchStatement,\n        SyntaxKind.TryStatement,\n        SyntaxKind.UncheckedStatement,\n        SyntaxKind.UnsafeStatement,\n        SyntaxKind.UsingStatement,\n        SyntaxKind.WhileStatement\n    };\n\n    protected override DiagnosticDescriptor Rule { get; } =\n        DescriptorFactory.Create(DiagnosticId, string.Format(MessageFormat, \"switch\", \"case\"),\n            isEnabledByDefault: false);\n\n    protected override SyntaxKind[] SyntaxKinds { get; } = [SyntaxKind.SwitchStatement];\n\n    protected override GeneratedCodeRecognizer GeneratedCodeRecognizer =>\n        CSharpGeneratedCodeRecognizer.Instance;\n\n    protected override SyntaxNode GetExpression(SwitchStatementSyntax statement) =>\n        statement.Expression;\n\n    protected override int GetSectionsCount(SwitchStatementSyntax statement) =>\n        statement.Sections.Count;\n\n    protected override bool AllSectionsAreOneLiners(SwitchStatementSyntax statement) =>\n        statement.Sections.All(HasOneLine);\n\n    protected override Location GetKeywordLocation(SwitchStatementSyntax statement) =>\n        statement.SwitchKeyword.GetLocation();\n\n    private static bool HasOneLine(SwitchSectionSyntax switchSection) =>\n        switchSection.Statements\n            .SelectMany(x => x.DescendantNodesAndSelf(descendIntoChildren: c => c.IsAnyKind(TransparentSyntax)))\n            .Count(x => !x.IsAnyKind(IgnoredStatementsInSwitch)) is 0 or 1;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/TooManyLoggingCalls.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class TooManyLoggingCalls : ParametrizedDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S6664\";\n    private const string MessageFormat = \"Reduce the number of {0} logging calls within this code block from {1} to the {2} allowed.\";\n\n    public static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat, isEnabledByDefault: false);\n\n    private static readonly KnownAssembly[] SupportedLoggingLibraries =\n    [\n        KnownAssembly.MicrosoftExtensionsLoggingAbstractions,\n        KnownAssembly.NLog,\n        KnownAssembly.Serilog,\n        KnownAssembly.Log4Net,\n        KnownAssembly.CastleCore\n    ];\n\n    private static readonly ImmutableArray<KnownType> LoggerTypes = ImmutableArray.Create(\n        KnownType.Microsoft_Extensions_Logging_ILogger,\n        KnownType.Microsoft_Extensions_Logging_LoggerExtensions,\n        KnownType.NLog_ILogger,\n        KnownType.NLog_ILoggerBase,\n        KnownType.NLog_ILoggerExtensions,\n        KnownType.Serilog_ILogger,\n        KnownType.Serilog_Log,\n        KnownType.log4net_ILog,\n        KnownType.log4net_Util_ILogExtensions,\n        KnownType.Castle_Core_Logging_ILogger);\n\n    private static readonly ImmutableArray<LoggingCategory> LoggingCategories = ImmutableArray.Create<LoggingCategory>(\n        new(CategoryNames.Debug, ImmutableHashSet.Create(\"ConditionalDebug\", \"ConditionalTrace\", \"Debug\", \"DebugFormat\", \"LogDebug\", \"LogTrace\", \"Trace\", \"TraceFormat\", \"Verbose\")),\n        new(CategoryNames.Error, ImmutableHashSet.Create(\"Error\", \"ErrorFormat\", \"Fatal\", \"FatalFormat\", \"LogCritical\", \"LogError\")),\n        new(CategoryNames.Information, ImmutableHashSet.Create(\"Info\", \"InfoFormat\", \"Information\", \"LogInformation\")),\n        new(CategoryNames.Warning, ImmutableHashSet.Create(\"LogWarning\", \"Warn\", \"WarnFormat\", \"Warning\")));\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    [RuleParameter(\"debugThreshold\", PropertyType.Integer, \"The maximum number of DEBUG, TRACE and VERBOSE statements allowed in the same code block.\", DefaultThresholds.Debug)]\n    public int DebugThreshold { get; set; } = DefaultThresholds.Debug;\n\n    [RuleParameter(\"errorThreshold\", PropertyType.Integer, \"The maximum number of ERROR and FATAL statements allowed in the same code block.\", DefaultThresholds.Error)]\n    public int ErrorThreshold { get; set; } = DefaultThresholds.Error;\n\n    [RuleParameter(\"informationThreshold\", PropertyType.Integer, \"The maximum number of INFORMATION statements allowed in the same code block.\", DefaultThresholds.Information)]\n    public int InformationThreshold { get; set; } = DefaultThresholds.Information;\n\n    [RuleParameter(\"warningThreshold\", PropertyType.Integer, \"The maximum number of WARNING statements allowed in the same code block.\", DefaultThresholds.Warning)]\n    public int WarningThreshold { get; set; } = DefaultThresholds.Warning;\n\n    protected override void Initialize(SonarParametrizedAnalysisContext context) =>\n        context.RegisterCompilationStartAction(cc =>\n        {\n            if (cc.Compilation.ReferencesAny(SupportedLoggingLibraries))\n            {\n                cc.RegisterNodeAction(Process, SyntaxKind.Block, SyntaxKind.CompilationUnit);\n            }\n        });\n\n    private void Process(SonarSyntaxNodeReportingContext context)\n    {\n        var node = context.Node;\n        if (IsBlockNodeSupported(node))\n        {\n            var logCallCollector = new LoggingCallCollector(context.Model, node);\n            logCallCollector.Visit(node);\n            foreach (var group in logCallCollector.GroupedLoggingInvocations)\n            {\n                var threshold = Threshold(group.Key);\n                var invocations = group.Value;\n                if (invocations.Count > threshold)\n                {\n                    var primaryLocation = invocations[0].GetLocation();\n                    string[] messageParams = [group.Key, invocations.Count.ToString(), threshold.ToString()];\n                    var secondaryLocations = invocations.Skip(1).ToSecondaryLocations(MessageFormat, messageParams);\n                    context.ReportIssue(Rule, primaryLocation, secondaryLocations, messageParams);\n                }\n            }\n        }\n    }\n\n    private int Threshold(string category)\n    {\n        var threshold = category switch\n        {\n            CategoryNames.Debug => DebugThreshold,\n            CategoryNames.Error => ErrorThreshold,\n            CategoryNames.Warning => WarningThreshold,\n            _ => InformationThreshold\n        };\n        return Math.Max(threshold, 0);\n    }\n\n    private static bool IsBlockNodeSupported(SyntaxNode node) =>\n        node.Kind() == SyntaxKind.Block\n        || (node.Kind() == SyntaxKind.CompilationUnit && node.ChildNodes().OfType<GlobalStatementSyntax>().Any());  // for top-level statements\n\n    private sealed class LoggingCallCollector : SafeCSharpSyntaxWalker\n    {\n        private readonly SemanticModel model;\n        private readonly SyntaxNode currentBlock;\n\n        public Dictionary<string, List<InvocationExpressionSyntax>> GroupedLoggingInvocations { get; } = [];\n\n        public LoggingCallCollector(SemanticModel model, SyntaxNode currentBlock)\n        {\n            this.model = model;\n            this.currentBlock = currentBlock;\n        }\n\n        public override void VisitBlock(BlockSyntax node)\n        {\n            if (currentBlock == node) // Don't visit nested blocks, that will be done by additional LoggingCallCollector instances.\n            {\n                base.VisitBlock(node);\n            }\n        }\n\n        public override void VisitInvocationExpression(InvocationExpressionSyntax node)\n        {\n            if (IsLoggerMethod(node.GetName())\n                && model.GetSymbolInfo(node).Symbol is IMethodSymbol methodSymbol\n                && methodSymbol.ContainingType.DerivesOrImplementsAny(LoggerTypes)\n                && LoggingCategoryName(node, methodSymbol) is { } loggingCategory)\n            {\n                if (GroupedLoggingInvocations.TryGetValue(loggingCategory, out var invocationList))\n                {\n                    invocationList.Add(node);\n                }\n                else\n                {\n                    GroupedLoggingInvocations.Add(loggingCategory, [node]);\n                }\n            }\n        }\n\n        public override void VisitIfStatement(IfStatementSyntax node)\n        {\n            // Skip syntax node to avoid FPs\n        }\n\n        public override void VisitParenthesizedLambdaExpression(ParenthesizedLambdaExpressionSyntax node)\n        {\n            // Skip syntax node to avoid FPs when the lambda body is a single instruction rather than a block\n        }\n\n        public override void VisitSimpleLambdaExpression(SimpleLambdaExpressionSyntax node)\n        {\n            // Skip syntax node to avoid FPs when the lambda body is a single instruction rather than a block\n        }\n\n        public override void VisitSwitchStatement(SwitchStatementSyntax node)\n        {\n            // Skip syntax node to avoid FPs\n        }\n\n        private static bool IsLoggerMethod(string methodName) =>\n            methodName is \"Log\" or \"Write\"\n            || LoggingCategories.Any(x => x.LoggingMethods.Contains(methodName));\n\n        private static string LoggingCategoryName(InvocationExpressionSyntax invocation, IMethodSymbol methodSymbol) =>\n            LoggingCategories.FirstOrDefault(x => x.LoggingMethods.Contains(invocation.GetName()))?.CategoryName\n                ?? CategoryNameForLogLevel(invocation, methodSymbol);\n\n        private static string CategoryNameForLogLevel(InvocationExpressionSyntax invocation, IMethodSymbol methodSymbol) =>\n                LogLevelArgumentName(invocation, methodSymbol) is { } logLevel\n                    ? logLevel switch\n                    {\n                        \"Debug\" or \"Trace\" or \"Verbose\" => CategoryNames.Debug,\n                        \"Critical\" or \"Error\" or \"Fatal\" => CategoryNames.Error,\n                        \"Information\" => CategoryNames.Information,\n                        \"Warning\" => CategoryNames.Warning,\n                        _ => null\n                    }\n                    : null;\n\n        private static string LogLevelArgumentName(InvocationExpressionSyntax invocation, IMethodSymbol methodSymbol)\n        {\n            var lookup = new CSharpMethodParameterLookup(invocation.ArgumentList, methodSymbol);\n            return lookup.TryGetSyntax(\"logLevel\", out var arguments) || lookup.TryGetSyntax(\"level\", out arguments)\n                ? arguments[0].GetName()\n                : null;\n        }\n    }\n\n    private sealed record LoggingCategory(string CategoryName, ImmutableHashSet<string> LoggingMethods);\n\n    private static class DefaultThresholds\n    {\n        public const int Debug = 4;\n        public const int Information = 2;\n        public const int Warning = 1;\n        public const int Error = 1;\n    }\n\n    private static class CategoryNames\n    {\n        public const string Debug = \"Debug\";\n        public const string Information = \"Information\";\n        public const string Warning = \"Warning\";\n        public const string Error = \"Error\";\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/TooManyParameters.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public class TooManyParameters : TooManyParametersBase<SyntaxKind, ParameterListSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n        private static readonly ImmutableDictionary<SyntaxKind, string> NodeToDeclarationName = new Dictionary<SyntaxKind, string>\n        {\n            { SyntaxKind.ConstructorDeclaration, \"Constructor\" },\n            { SyntaxKind.StructDeclaration, \"Constructor\" },\n            { SyntaxKind.ClassDeclaration, \"Constructor\" },\n            { SyntaxKind.MethodDeclaration, \"Method\" },\n            { SyntaxKind.DelegateDeclaration, \"Delegate\" },\n            { SyntaxKind.AnonymousMethodExpression, \"Delegate\" },\n            { SyntaxKind.ParenthesizedLambdaExpression, \"Lambda\" },\n            { SyntaxKind.SimpleLambdaExpression, \"Lambda\" },\n            { SyntaxKindEx.LocalFunctionStatement, \"Local function\" }\n        }.ToImmutableDictionary();\n\n        protected override string UserFriendlyNameForNode(SyntaxNode node) =>\n            NodeToDeclarationName[node.Kind()];\n\n        protected override int CountParameters(ParameterListSyntax parameterList) =>\n            parameterList.Parameters.Count;\n\n        protected override bool CanBeChanged(SyntaxNode node, SemanticModel semanticModel) =>\n            NodeToDeclarationName.ContainsKey(node.Kind()) && VerifyCanBeChangedBySymbol(node, semanticModel);\n\n        protected override int BaseParameterCount(SyntaxNode node) =>\n            node switch\n            {\n                ConstructorDeclarationSyntax ctorDeclaration => ctorDeclaration.Initializer?.ArgumentList?.Arguments.Count ?? 0,\n                ClassDeclarationSyntax classDeclaration => RetrieveBasePrimaryConstructorArguments(classDeclaration),\n                _ => 0,\n            };\n\n        protected override bool IsExtern(SyntaxNode node) =>\n            node is BaseMethodDeclarationSyntax { } methodDeclaration && methodDeclaration.IsExtern();\n\n        private static int RetrieveBasePrimaryConstructorArguments(ClassDeclarationSyntax node)\n        {\n            var type = node.BaseList?.Types.FirstOrDefault();\n            return PrimaryConstructorBaseTypeSyntaxWrapper.IsInstance(type)\n                ? ((PrimaryConstructorBaseTypeSyntaxWrapper)type).ArgumentList.Arguments.Count\n                : 0;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/TrackNotImplementedException.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class TrackNotImplementedException : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S3717\";\n        private const string MessageFormat = \"Implement this method or throw 'NotSupportedException' instead.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var throwStatement = (ThrowStatementSyntax)c.Node;\n                    if (throwStatement.Expression == null)\n                    {\n                        return;\n                    }\n\n                    ReportDiagnostic(c, throwStatement.Expression, throwStatement);\n                },\n                SyntaxKind.ThrowStatement);\n\n            context.RegisterNodeAction(\n                 c =>\n                 {\n                     var throwExpression = (ThrowExpressionSyntaxWrapper)c.Node;\n                     ReportDiagnostic(c, throwExpression.Expression, throwExpression);\n                 },\n                 SyntaxKindEx.ThrowExpression);\n        }\n\n        private static void ReportDiagnostic(SonarSyntaxNodeReportingContext c, ExpressionSyntax newExceptionExpression, SyntaxNode throwExpression)\n        {\n            if (c.Model.GetTypeInfo(newExceptionExpression).Type.Is(KnownType.System_NotImplementedException))\n            {\n                c.ReportIssue(rule, throwExpression);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/TryStatementsWithIdenticalCatchShouldBeMerged.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class TryStatementsWithIdenticalCatchShouldBeMerged : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S2327\";\n        private const string MessageFormat = \"Combine this 'try' with the one starting on line {0}.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(c =>\n            {\n                var tryStatement = (TryStatementSyntax)c.Node;\n\n                var mergeableTry = tryStatement.GetPreviousStatementsCurrentBlock()\n                    .OfType<TryStatementSyntax>()\n                    .FirstOrDefault(t => SameCatches(t.Catches) && SameFinally(t));\n\n                if (mergeableTry != null)\n                {\n                    c.ReportIssue(rule, tryStatement, messageArgs: mergeableTry.LineNumberToReport().ToString());\n                }\n\n                bool SameCatches(IReadOnlyCollection<CatchClauseSyntax> other) =>\n                    tryStatement.Catches.Count == other.Count &&\n                    tryStatement.Catches.All(x => other.Any(o => o.IsEquivalentTo(x)));\n\n                bool SameFinally(TryStatementSyntax other) =>\n                    tryStatement.Finally == null && other.Finally == null ||\n                    tryStatement.Finally != null && other.Finally != null && tryStatement.Finally.IsEquivalentTo(other.Finally);\n\n            },\n            SyntaxKind.TryStatement);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/TypeExaminationOnSystemType.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class TypeExaminationOnSystemType : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S3443\";\n        private const string MessageFormat = \"{0}\";\n        private const string MessageGetType = \"Remove this use of 'GetType' on a 'System.Type'.\";\n        private const string MessageIsInstanceOfType = \"Pass an argument that is not a 'System.Type' or consider using 'IsAssignableFrom'.\";\n        private const string MessageIsInstanceOfTypeWithGetType = \"Consider removing the 'GetType' call, it's suspicious in an 'IsInstanceOfType' call.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n               {\n                   var invocation = (InvocationExpressionSyntax)c.Node;\n\n                   if (invocation.Expression.ToStringContainsEitherOr(nameof(Type.IsInstanceOfType), nameof(Type.GetType))\n                       && c.Model.GetSymbolInfo(invocation).Symbol is IMethodSymbol methodSymbol)\n                   {\n                       CheckGetTypeCallOnType(c, invocation, methodSymbol);\n                       CheckIsInstanceOfTypeCallWithTypeArgument(c, invocation, methodSymbol);\n                   }\n               },\n               SyntaxKind.InvocationExpression);\n\n        private static void CheckIsInstanceOfTypeCallWithTypeArgument(SonarSyntaxNodeReportingContext context, InvocationExpressionSyntax invocation, ISymbol methodSymbol)\n        {\n            if (methodSymbol.Name != nameof(Type.IsInstanceOfType) || !methodSymbol.ContainingType.Is(KnownType.System_Type))\n            {\n                return;\n            }\n\n            var argument = invocation.ArgumentList.Arguments.First().Expression;\n\n            var typeInfo = context.Model.GetTypeInfo(argument).Type;\n            if (!typeInfo.Is(KnownType.System_Type))\n            {\n                return;\n            }\n\n            var invocationInArgument = argument as InvocationExpressionSyntax;\n            var message = invocationInArgument.IsGetTypeCall(context.Model)\n                ? MessageIsInstanceOfTypeWithGetType\n                : MessageIsInstanceOfType;\n\n            context.ReportIssue(Rule, argument, message);\n        }\n\n        private static void CheckGetTypeCallOnType(SonarSyntaxNodeReportingContext context, InvocationExpressionSyntax invocation, IMethodSymbol invokedMethod)\n        {\n            if (!(invocation.Expression is MemberAccessExpressionSyntax memberCall)\n                || IsException(memberCall, context.Model)\n                || !invokedMethod.IsGetTypeCall())\n            {\n                return;\n            }\n\n            var expressionType = context.Model.GetTypeInfo(memberCall.Expression).Type;\n            if (!expressionType.Is(KnownType.System_Type))\n            {\n                return;\n            }\n\n            context.ReportIssue(Rule, memberCall.OperatorToken.CreateLocation(invocation), MessageGetType);\n        }\n\n        private static bool IsException(MemberAccessExpressionSyntax memberAccess, SemanticModel semanticModel) =>\n            memberAccess.Expression is TypeOfExpressionSyntax typeOf\n            && typeOf.Type.IsKnownType(KnownType.System_Type, semanticModel);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/TypeMemberVisibility.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class TypeMemberVisibility : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S3059\";\n        private const string MessageFormat = \"Types should not have members with visibility set higher than the type's visibility\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        private static readonly HashSet<SyntaxKind> TypeKinds =\n        [\n            SyntaxKind.ClassDeclaration,\n            SyntaxKind.EnumDeclaration,\n            SyntaxKindEx.RecordDeclaration,\n            SyntaxKindEx.RecordStructDeclaration,\n            SyntaxKind.StructDeclaration,\n        ];\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n                {\n                    if (c.IsRedundantPositionalRecordContext())\n                    {\n                        return;\n                    }\n                    var typeDeclaration = (BaseTypeDeclarationSyntax)c.Node;\n                    var secondaryLocations = GetInvalidMemberLocations(c.Model, typeDeclaration);\n                    if (secondaryLocations.Any())\n                    {\n                        c.ReportIssue(Rule, typeDeclaration.Identifier, secondaryLocations);\n                    }\n                },\n                [.. TypeKinds]);\n\n        private static SecondaryLocation[] GetInvalidMemberLocations(SemanticModel semanticModel, BaseTypeDeclarationSyntax type)\n        {\n            var parentType = GetParentType(type);\n            if (parentType is null && type.Modifiers.AnyOfKind(SyntaxKind.InternalKeyword))\n            {\n                return type.DescendantNodes()\n                           .OfType<MemberDeclarationSyntax>()\n                           .Where(x => x.Modifiers.AnyOfKind(SyntaxKind.PublicKeyword)\n                                       && !x.Modifiers.AnyOfKind(SyntaxKind.OverrideKeyword) // Overridden member need to keep the visibility of the base declaration\n                                       && !(x.Kind() is SyntaxKind.OperatorDeclaration or SyntaxKind.ConversionOperatorDeclaration) // Operators must be public\n                                       && !IsInterfaceImplementation(semanticModel, x))\n                           .Select(x => x.Modifiers.Single(modifier => modifier.IsKind(SyntaxKind.PublicKeyword)).ToSecondaryLocation())\n                           .ToArray();\n            }\n\n            return [];\n        }\n\n        private static bool IsInterfaceImplementation(SemanticModel semanticModel, MemberDeclarationSyntax declaration) =>\n            semanticModel.GetDeclaredSymbol(declaration)?.InterfaceMembers().Any() is true;\n\n        private static BaseTypeDeclarationSyntax GetParentType(SyntaxNode node) =>\n            (BaseTypeDeclarationSyntax)node.Ancestors().FirstOrDefault(x => x.IsAnyKind(TypeKinds));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/TypeNamesShouldNotMatchNamespaces.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class TypeNamesShouldNotMatchNamespaces : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S4041\";\n        private const string MessageFormat = \"Change the name of type '{0}' to be different from an existing framework namespace.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        // Based on https://msdn.microsoft.com/en-us/library/gg145045%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396\n        private static readonly ISet<string> FrameworkNamespaces = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase)\n            {\n                \"Accessibility\", \"Activities\", \"AddIn\", \"Build\", \"CodeDom\", \"Collections\",\n                \"Componentmodel\", \"Configuration\", \"CSharp\", \"CustomMarshalers\", \"Data\",\n                \"Dataflow\", \"Deployment\", \"Device\", \"Diagnostics\", \"DirectoryServices\",\n                \"Drawing\", \"Dynamic\", \"EnterpriseServices\", \"Globalization\", \"IdentityModel\",\n                \"InteropServices\", \"IO\", \"JScript\", \"Linq\", \"Location\", \"Management\", \"Media\",\n                \"Messaging\", \"Microsoft\", \"Net\", \"Numerics\", \"Printing\", \"Reflection\", \"Resources\",\n                \"Runtime\", \"Security\", \"Server\", \"ServiceModel\", \"ServiceProcess\", \"Speech\",\n                \"SqlServer\", \"System\", \"Tasks\", \"Text\", \"Threading\", \"Timers\", \"Transactions\",\n                \"UIAutomationClientsideProviders\", \"VisualBasic\", \"VisualC\", \"Web\", \"Win32\",\n                \"Windows\", \"Workflow\", \"Xaml\", \"XamlGeneratedNamespace\", \"Xml\"\n            };\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n            {\n                if (!c.IsRedundantPositionalRecordContext()\n                    && c.Node.GetIdentifier() is { } identifier\n                    && FrameworkNamespaces.Contains(identifier.ValueText)\n                    && c.Model.GetDeclaredSymbol(c.Node)?.DeclaredAccessibility == Accessibility.Public)\n                {\n                    c.ReportIssue(Rule, identifier, identifier.ValueText);\n                }\n            },\n            SyntaxKind.ClassDeclaration,\n            SyntaxKind.DelegateDeclaration,\n            SyntaxKind.EnumDeclaration,\n            SyntaxKind.InterfaceDeclaration,\n            SyntaxKindEx.RecordDeclaration,\n            SyntaxKindEx.RecordStructDeclaration,\n            SyntaxKind.StructDeclaration);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/TypesShouldNotExtendOutdatedBaseTypes.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class TypesShouldNotExtendOutdatedBaseTypes : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S4052\";\n    private const string MessageFormat = \"Refactor this type not to derive from an outdated type '{0}'.\";\n\n    private static readonly DiagnosticDescriptor Rule =\n        DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    private static readonly ImmutableArray<KnownType> OutdatedTypes =\n        ImmutableArray.Create(\n            KnownType.System_ApplicationException,\n            KnownType.System_Xml_XmlDocument,\n            KnownType.System_Collections_CollectionBase,\n            KnownType.System_Collections_DictionaryBase,\n            KnownType.System_Collections_Queue,\n            KnownType.System_Collections_ReadOnlyCollectionBase,\n            KnownType.System_Collections_SortedList,\n            KnownType.System_Collections_Stack);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n        {\n            var classDeclaration = (ClassDeclarationSyntax)c.Node;\n            var classSymbol = (INamedTypeSymbol)c.ContainingSymbol;\n\n            if (!classDeclaration.Identifier.IsMissing\n                && classSymbol.BaseType.IsAny(OutdatedTypes))\n            {\n                c.ReportIssue(Rule, classDeclaration.Identifier, messageArgs: classSymbol.BaseType.ToDisplayString());\n            }\n        },\n        // The rule is not applicable for records as at the current moment all the outdated types are classes and records cannot inherit classes.\n        SyntaxKind.ClassDeclaration);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UnaryPrefixOperatorRepeated.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class UnaryPrefixOperatorRepeated :\n        UnaryPrefixOperatorRepeatedBase<SyntaxKind, PrefixUnaryExpressionSyntax>\n    {\n        protected override DiagnosticDescriptor Rule { get; } =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        protected override ISet<SyntaxKind> SyntaxKinds { get; } = new HashSet<SyntaxKind>\n        {\n            SyntaxKind.LogicalNotExpression,\n            SyntaxKind.BitwiseNotExpression,\n        };\n\n        protected override GeneratedCodeRecognizer GeneratedCodeRecognizer { get; } =\n            CSharpGeneratedCodeRecognizer.Instance;\n\n        protected override SyntaxNode GetOperand(PrefixUnaryExpressionSyntax unarySyntax) =>\n            unarySyntax.Operand;\n\n        protected override SyntaxToken GetOperatorToken(PrefixUnaryExpressionSyntax unarySyntax) =>\n            unarySyntax.OperatorToken;\n\n        protected override bool SameOperators(PrefixUnaryExpressionSyntax expression1, PrefixUnaryExpressionSyntax expression2) =>\n            expression1.OperatorToken.IsKind(expression2.OperatorToken.Kind());\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UnaryPrefixOperatorRepeatedCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Formatting;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class UnaryPrefixOperatorRepeatedCodeFix : SonarCodeFix\n    {\n        internal const string Title = \"Remove repeated prefix operator(s)\";\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(UnaryPrefixOperatorRepeated.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n\n            if (!(root.FindNode(diagnosticSpan, getInnermostNodeForTie: true) is PrefixUnaryExpressionSyntax prefix))\n            {\n                return Task.CompletedTask;\n            }\n\n            context.RegisterCodeFix(\n                Title,\n                c =>\n                {\n                    GetExpression(prefix, out var expression, out var count);\n\n                    if (count%2 == 1)\n                    {\n                        expression = SyntaxFactory.PrefixUnaryExpression(\n                            prefix.Kind(),\n                            expression);\n                    }\n\n                    var newRoot = root.ReplaceNode(prefix, expression\n                        .WithAdditionalAnnotations(Formatter.Annotation));\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n\n            return Task.CompletedTask;\n        }\n\n        private static void GetExpression(PrefixUnaryExpressionSyntax prefix, out ExpressionSyntax expression, out uint count)\n        {\n            count = 0;\n            var currentUnary = prefix;\n            do\n            {\n                count++;\n                expression = currentUnary.Operand;\n                currentUnary = currentUnary.Operand as PrefixUnaryExpressionSyntax;\n            }\n            while (currentUnary != null);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UnchangedLocalVariablesShouldBeConst.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class UnchangedLocalVariablesShouldBeConst : SonarDiagnosticAnalyzer\n{\n    internal const string DiagnosticId = \"S3353\";\n    private const string MessageFormat = \"Add the 'const' modifier to '{0}'{1}.\"; // {1} is a placeholder for optional MessageFormatVarHint\n    private const string MessageFormatVarHint = \", and replace 'var' with '{0}'\";\n\n    private enum DeclarationType\n    {\n        CannotBeConst,\n        Value,\n        Reference,\n        String\n    }\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var localDeclaration = (LocalDeclarationStatementSyntax)c.Node;\n                if (localDeclaration.Modifiers.Any(SyntaxKind.ConstKeyword))\n                {\n                    return;\n                }\n\n                var declaredType = FindDeclarationType(localDeclaration, c.Model);\n                if (declaredType == DeclarationType.CannotBeConst)\n                {\n                    return;\n                }\n\n                localDeclaration.Declaration?.Variables\n                    .Where(v => v is { Identifier: { } }\n                        // constant string interpolation is only valid in C# 10 and above\n                        && (c.Model.Compilation.IsAtLeastLanguageVersion(LanguageVersionEx.CSharp10) || !ContainsInterpolation(v))\n                        && IsInitializedWithCompatibleConstant(v, c.Model, declaredType)\n                        && !HasMutableUsagesInMethod(c.Model, v))\n                    .ToList()\n                    .ForEach(x => Report(c, x));\n            },\n            SyntaxKind.LocalDeclarationStatement);\n\n    private static DeclarationType FindDeclarationType(LocalDeclarationStatementSyntax localDeclaration, SemanticModel model)\n    {\n        var declaredTypeSyntax = localDeclaration.Declaration?.Type;\n        if (declaredTypeSyntax is null)\n        {\n            return DeclarationType.CannotBeConst;\n        }\n\n        var declaredType = model.GetTypeInfo(declaredTypeSyntax).Type;\n        if (declaredType is null)\n        {\n            return DeclarationType.CannotBeConst;\n        }\n        else if (declaredType.Is(KnownType.System_String))\n        {\n            return DeclarationType.String;\n        }\n        else if (declaredType.OriginalDefinition?.DerivesFrom(KnownType.System_Nullable_T) ?? false)\n        {\n            // Defining nullable as const raises error CS0283.\n            return DeclarationType.CannotBeConst;\n        }\n        else if (declaredType.IsStruct() && declaredType.SpecialType == SpecialType.None && declaredType.GetMembers(\"op_Implicit\").Any(x => !x.IsImplicitlyDeclared))\n        {\n            // Struct with explicitly declared \"implicit operator\"\n            return DeclarationType.CannotBeConst;\n        }\n        else\n        {\n            return declaredType.IsValueType ? DeclarationType.Value : DeclarationType.Reference;\n        }\n    }\n\n    private static bool IsInitializedWithCompatibleConstant(VariableDeclaratorSyntax variableDeclarator, SemanticModel model, DeclarationType declarationType) =>\n        variableDeclarator is { Initializer.Value: { } initializer }\n            && model.GetConstantValue(initializer) switch\n            {\n                { HasValue: false } => false,\n                { Value: string } => declarationType == DeclarationType.String,\n                { Value: ValueType } => declarationType == DeclarationType.Value,\n                _ => declarationType is DeclarationType.Reference or DeclarationType.String,\n            };\n\n    private static bool HasMutableUsagesInMethod(SemanticModel model, VariableDeclaratorSyntax variable)\n    {\n        var parentSyntax = variable.Ancestors().FirstOrDefault(IsMethodLike);\n        if (parentSyntax is null)\n        {\n            return false;\n        }\n        else if (parentSyntax is GlobalStatementSyntax)\n        {\n            // If the variable is declared in a top level statement we should search inside the compilation unit.\n            parentSyntax = parentSyntax.Parent;\n        }\n\n        var variableSymbol = model.GetDeclaredSymbol(variable);\n        return variableSymbol is not null\n            && parentSyntax.DescendantNodes()\n                .OfType<IdentifierNameSyntax>()\n                .Where(x => x.GetName().Equals(variableSymbol.Name) && variableSymbol.Equals(model.GetSymbolInfo(x).Symbol))\n                .Any(x => IsMutatingUse(model, x));\n\n        static bool IsMethodLike(SyntaxNode arg) =>\n            arg is BaseMethodDeclarationSyntax\n                or AccessorDeclarationSyntax\n                or LambdaExpressionSyntax\n                or AnonymousFunctionExpressionSyntax\n                or GlobalStatementSyntax\n            || LocalFunctionStatementSyntaxWrapper.IsInstance(arg);\n    }\n\n    private static bool IsMutatingUse(SemanticModel model, IdentifierNameSyntax identifier) =>\n        identifier.Parent switch\n        {\n            AssignmentExpressionSyntax { Left: { } left } => identifier.Equals(left),\n            ArgumentSyntax argumentSyntax => argumentSyntax.IsInTupleAssignmentTarget() || !argumentSyntax.RefOrOutKeyword.IsKind(SyntaxKind.None),\n            PostfixUnaryExpressionSyntax => true,\n            PrefixUnaryExpressionSyntax => true,\n            { } refExpression when RefExpressionSyntaxWrapper.IsInstance(refExpression) => !IsAssignedToRefReadonly(identifier),\n            _ => IsUsedAsLambdaExpression(model, identifier),\n        };\n\n    private static bool IsUsedAsLambdaExpression(SemanticModel model, IdentifierNameSyntax identifier)\n    {\n        if (identifier.FirstAncestorOrSelf<LambdaExpressionSyntax>().GetSelfOrTopParenthesizedExpression() is { } lambda)\n        {\n            if (lambda.Parent is ArgumentSyntax argument\n                && argument.FirstAncestorOrSelf<InvocationExpressionSyntax>() is { } invocation)\n            {\n                var lookup = new CSharpMethodParameterLookup(invocation, model);\n                return lookup.TryGetSymbol(argument, out var parameter) && parameter.IsType(KnownType.System_Linq_Expressions_Expression_T);\n            }\n            else if (lambda.Parent is AssignmentExpressionSyntax assignment)\n            {\n                // Lambda cannot be on the left side, we don't need to check it\n                return assignment.Left.IsKnownType(KnownType.System_Linq_Expressions_Expression_T, model);\n            }\n        }\n        return false;\n    }\n\n    private static bool ContainsInterpolation(VariableDeclaratorSyntax declaratorSyntax) =>\n        declaratorSyntax is { Initializer.Value: { } initializer }\n            && initializer.DescendantNodesAndSelf().Any(x => x.IsKind(SyntaxKind.Interpolation));\n\n    private static void Report(SonarSyntaxNodeReportingContext c, VariableDeclaratorSyntax declaratorSyntax) =>\n        c.ReportIssue(\n            Rule,\n            declaratorSyntax.Identifier,\n            declaratorSyntax.Identifier.ValueText,\n            AdditionalMessageHints(c.Model, declaratorSyntax));\n\n    private static string AdditionalMessageHints(SemanticModel model, VariableDeclaratorSyntax declaratorSyntax) =>\n        declaratorSyntax is { Parent: VariableDeclarationSyntax { Type: { IsVar: true } typeSyntax } }\n            ? string.Format(MessageFormatVarHint, model.GetTypeInfo(typeSyntax).Type.ToMinimalDisplayString(model, typeSyntax.SpanStart))\n            : string.Empty;\n\n    private static bool IsAssignedToRefReadonly(IdentifierNameSyntax identifier) =>\n        identifier.Ancestors().OfType<VariableDeclaratorSyntax>().FirstOrDefault() is { Parent: VariableDeclarationSyntax { Type: var type } }\n        && RefTypeSyntaxWrapper.IsInstance(type)\n        && ((RefTypeSyntaxWrapper)type).ReadOnlyKeyword.IsKind(SyntaxKind.ReadOnlyKeyword);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UnchangedLocalVariablesShouldBeConstCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[ExportCodeFixProvider(LanguageNames.CSharp)]\npublic sealed class UnchangedLocalVariablesShouldBeConstCodeFix : SonarCodeFix\n{\n    private const string Title = \"Convert to constant.\";\n\n    public override ImmutableArray<string> FixableDiagnosticIds =>\n        ImmutableArray.Create(UnchangedLocalVariablesShouldBeConst.DiagnosticId);\n\n    protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n    {\n        if (VariableDeclaration(root, context) is\n            {\n                Parent: LocalDeclarationStatementSyntax oldNode,\n                Variables.Count: 1, // It is not guaranteed that all should be const.\n            } variable)\n        {\n            context.RegisterCodeFix(\n                Title,\n                c => ChangeDocument(context.Document, root, variable, oldNode, c),\n                context.Diagnostics);\n        }\n\n        return Task.CompletedTask;\n    }\n\n    public static async Task<Document> ChangeDocument(\n        Document document,\n        SyntaxNode root,\n        VariableDeclarationSyntax variable,\n        LocalDeclarationStatementSyntax oldNode,\n        CancellationToken cancel)\n    {\n        var declaration = variable.Type.IsVar\n            ? WithExplictType(variable, await document.GetSemanticModelAsync(cancel).ConfigureAwait(false))\n            : variable;\n\n        var newNode = root.ReplaceNode(oldNode, ConstantDeclaration(declaration));\n\n        return document.WithSyntaxRoot(newNode);\n    }\n\n    private static VariableDeclarationSyntax VariableDeclaration(SyntaxNode root, SonarCodeFixContext context) =>\n        root.FindNode(context.Diagnostics.First().Location.SourceSpan)?.Parent as VariableDeclarationSyntax;\n\n    private static LocalDeclarationStatementSyntax ConstantDeclaration(VariableDeclarationSyntax declaration)\n    {\n        var prefix = TokenList(Token(SyntaxKind.ConstKeyword));\n        return LocalDeclarationStatement(prefix, declaration);\n    }\n\n    private static VariableDeclarationSyntax WithExplictType(VariableDeclarationSyntax declaration, SemanticModel semanticModel)\n    {\n        var typeSymbol = semanticModel.GetTypeInfo(declaration.Type).Type;\n        var type = typeSymbol is IErrorTypeSymbol\n            ? declaration.Type\n            : IdentifierName(typeSymbol.ToMinimalDisplayString(semanticModel, declaration.GetLocation().SourceSpan.Start));\n        return declaration.ReplaceNode(declaration.Type, type);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UnconditionalJumpStatement.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class UnconditionalJumpStatement : UnconditionalJumpStatementBase<StatementSyntax, SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n        protected override ISet<SyntaxKind> LoopStatements { get; } = new HashSet<SyntaxKind>\n        {\n            SyntaxKind.ForEachStatement,\n            SyntaxKind.ForStatement,\n            SyntaxKind.WhileStatement,\n            SyntaxKind.DoStatement\n        };\n\n        protected override LoopWalkerBase<StatementSyntax, SyntaxKind> GetWalker(SonarSyntaxNodeReportingContext context)\n            => new LoopWalker(context, LoopStatements);\n\n        private class LoopWalker : LoopWalkerBase<StatementSyntax, SyntaxKind>\n        {\n            protected override ISet<SyntaxKind> StatementsThatCanThrow { get; } = new HashSet<SyntaxKind>\n            {\n                SyntaxKind.InvocationExpression,\n                SyntaxKind.ObjectCreationExpression,\n                SyntaxKind.SimpleMemberAccessExpression,\n                SyntaxKind.PointerMemberAccessExpression,\n                SyntaxKind.ElementAccessExpression\n            };\n\n            protected override ISet<SyntaxKind> LambdaSyntaxes { get; } = new HashSet<SyntaxKind>\n            {\n                SyntaxKind.ParenthesizedLambdaExpression,\n                SyntaxKind.SimpleLambdaExpression,\n                SyntaxKind.AnonymousMethodExpression\n            };\n\n            protected override ISet<SyntaxKind> LocalFunctionSyntaxes { get; } = new HashSet<SyntaxKind> { SyntaxKindEx.LocalFunctionStatement };\n\n            protected override ISet<SyntaxKind> ConditionalStatements { get; } = new HashSet<SyntaxKind>\n            {\n                SyntaxKind.IfStatement,\n                SyntaxKind.SwitchStatement,\n                SyntaxKind.CatchClause\n            };\n\n            protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n            public LoopWalker(SonarSyntaxNodeReportingContext context, ISet<SyntaxKind> loopStatements) : base(context, loopStatements) { }\n\n            public override void Visit()\n            {\n                var csWalker = new CsLoopwalker(this);\n                csWalker.SafeVisit(rootExpression);\n            }\n\n            protected override bool IsPropertyAccess(StatementSyntax node) =>\n                node.DescendantNodes().OfType<IdentifierNameSyntax>().Any(x => semanticModel.GetSymbolInfo(x).Symbol is { } symbol && symbol.Kind == SymbolKind.Property);\n\n            protected override bool TryGetTryAncestorStatements(StatementSyntax node, List<SyntaxNode> ancestors, out IEnumerable<StatementSyntax> tryAncestorStatements)\n            {\n                var tryAncestor = (TryStatementSyntax)ancestors.FirstOrDefault(n => n.IsKind(SyntaxKind.TryStatement));\n\n                if (tryAncestor == null || tryAncestor.Catches.Count == 0)\n                {\n                    tryAncestorStatements = null;\n                    return false;\n                }\n\n                tryAncestorStatements = tryAncestor.Block.Statements;\n                return true;\n            }\n\n            private sealed class CsLoopwalker : SafeCSharpSyntaxWalker\n            {\n                private readonly LoopWalker walker;\n\n                public CsLoopwalker(LoopWalker loopWalker)\n                {\n                    walker = loopWalker;\n                }\n\n                public override void VisitContinueStatement(ContinueStatementSyntax node)\n                {\n                    base.VisitContinueStatement(node);\n                    walker.StoreVisitData(node, walker.ConditionalContinues, walker.UnconditionalContinues);\n                }\n\n                public override void VisitBreakStatement(BreakStatementSyntax node)\n                {\n                    base.VisitBreakStatement(node);\n                    walker.StoreVisitData(node, walker.ConditionalTerminates, walker.UnconditionalTerminates);\n                }\n\n                public override void VisitReturnStatement(ReturnStatementSyntax node)\n                {\n                    base.VisitReturnStatement(node);\n                    walker.StoreVisitData(node, walker.ConditionalTerminates, walker.UnconditionalTerminates);\n                }\n\n                public override void VisitThrowStatement(ThrowStatementSyntax node)\n                {\n                    base.VisitThrowStatement(node);\n                    walker.StoreVisitData(node, walker.ConditionalTerminates, walker.UnconditionalTerminates);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UninvokedEventDeclaration.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class UninvokedEventDeclaration : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S3264\";\n    private const string MessageFormat = \"Remove the unused event '{0}' or invoke it.\";\n\n    private static readonly Accessibility MaxAccessibility = Accessibility.Public;\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n    private static readonly HashSet<SyntaxKind> EventSyntax = [SyntaxKind.EventFieldDeclaration];\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterSymbolAction(RaiseOnUninvokedEventDeclaration, SymbolKind.NamedType);\n\n    private static void RaiseOnUninvokedEventDeclaration(SonarSymbolReportingContext context)\n    {\n        var namedType = (INamedTypeSymbol)context.Symbol;\n        if (namedType.IsClassOrStruct() && namedType.ContainingType is null)\n        {\n            var removableDeclarationCollector = new CSharpRemovableDeclarationCollector(namedType, context.Compilation);\n            var removableEventFields = removableDeclarationCollector.RemovableFieldLikeDeclarations(EventSyntax, MaxAccessibility).Where(x => !IsInPartialEventField(x.Node)).ToArray();\n            if (removableEventFields.Any())\n            {\n                var usedSymbols = InvokedEventSymbols(removableDeclarationCollector).Concat(PossiblyCopiedSymbols(removableDeclarationCollector)).ToHashSet();\n                foreach (var field in removableEventFields.Where(x => !usedSymbols.Contains(x.Symbol)))\n                {\n                    context.ReportIssue(Rule, Location(field.Node), field.Symbol.Name);\n                }\n            }\n        }\n\n        static Location Location(SyntaxNode node) =>\n            node is VariableDeclaratorSyntax variableDeclarator\n                ? variableDeclarator.Identifier.GetLocation()\n                : ((EventDeclarationSyntax)node).Identifier.GetLocation();\n\n        static bool IsInPartialEventField(SyntaxNode node) =>\n            node.Ancestors().OfType<EventFieldDeclarationSyntax>().FirstOrDefault() is { } eventField && eventField.Modifiers.Any(SyntaxKind.PartialKeyword);\n    }\n\n    private static IEnumerable<ISymbol> InvokedEventSymbols(CSharpRemovableDeclarationCollector removableDeclarationCollector)\n    {\n        var delegateInvocations = removableDeclarationCollector.TypeDeclarations\n            .SelectMany(x => x.Node.DescendantNodes().OfType<InvocationExpressionSyntax>()\n                                .Select(invocation => new NodeSymbolAndModel<InvocationExpressionSyntax, IMethodSymbol>(invocation, (IMethodSymbol)x.Model.GetSymbolInfo(invocation).Symbol, x.Model)))\n            .Where(x => x.Symbol is not null && IsDelegateInvocation(x.Symbol));\n\n        var invokedEventSymbols = delegateInvocations\n            .Select(x => new NodeAndModel<ExpressionSyntax>(EventExpressionFromInvocation(x.Node, x.Symbol), x.Model))\n            .Select(x => new NodeSymbolAndModel<ExpressionSyntax, IEventSymbol>(x.Node, x.Model.GetSymbolInfo(x.Node).Symbol as IEventSymbol, x.Model))\n            .Where(x => x.Symbol is not null)\n            .Select(x => x.Symbol.OriginalDefinition);\n\n        return invokedEventSymbols;\n    }\n\n    private static IEnumerable<ISymbol> PossiblyCopiedSymbols(CSharpRemovableDeclarationCollector removableDeclarationCollector)\n    {\n        var usedSymbols = new List<ISymbol>();\n        foreach (var typeDeclaration in removableDeclarationCollector.TypeDeclarations)\n        {\n            foreach (var node in typeDeclaration.Node.DescendantNodes().Select(Expression).WhereNotNull())\n            {\n                if (typeDeclaration.Model.GetSymbolInfo(node).Symbol is IEventSymbol symbol)\n                {\n                    usedSymbols.Add(symbol.OriginalDefinition);\n                }\n            }\n        }\n        return usedSymbols;\n\n        static SyntaxNode Expression(SyntaxNode node) =>\n            node switch\n            {\n                ArgumentSyntax arg => arg.Expression,\n                EqualsValueClauseSyntax equalsClause => equalsClause.Value,\n                AssignmentExpressionSyntax assignment => assignment.Right,\n                _ => null\n            };\n    }\n\n    private static ExpressionSyntax EventExpressionFromInvocation(InvocationExpressionSyntax invocation, IMethodSymbol symbol)\n    {\n        var expression = invocation.Expression switch\n        {\n            MemberAccessExpressionSyntax memberAccess => new NodeAndName(memberAccess.Expression, memberAccess.Name),\n            MemberBindingExpressionSyntax memberBinding => new NodeAndName((invocation.Parent as ConditionalAccessExpressionSyntax)?.Expression, memberBinding.Name),\n            _ => default\n        };\n        return expression.Node is not null && IsExplicitDelegateInvocation(symbol, expression.Name)\n            ? expression.Node\n            : invocation.Expression;\n    }\n\n    private static bool IsExplicitDelegateInvocation(IMethodSymbol symbol, SimpleNameSyntax invokedMethodName) =>\n        IsDynamicInvoke(symbol)\n        || IsBeginInvoke(symbol)\n        || (symbol.MethodKind == MethodKind.DelegateInvoke && invokedMethodName.Identifier.ValueText == \"Invoke\");\n\n    private static bool IsDelegateInvocation(IMethodSymbol symbol) =>\n        symbol.MethodKind == MethodKind.DelegateInvoke\n        || IsInvoke(symbol)\n        || IsDynamicInvoke(symbol)\n        || IsBeginInvoke(symbol);\n\n    private static bool IsInvoke(IMethodSymbol symbol) =>\n        symbol.MethodKind == MethodKind.Ordinary\n        && symbol.Name == nameof(EventHandler.Invoke);\n\n    private static bool IsDynamicInvoke(IMethodSymbol symbol) =>\n        symbol.MethodKind == MethodKind.Ordinary\n        && symbol.Name == nameof(Delegate.DynamicInvoke)\n        && symbol.ReceiverType.OriginalDefinition.Is(KnownType.System_Delegate);\n\n    private static bool IsBeginInvoke(IMethodSymbol symbol) =>\n        symbol.MethodKind == MethodKind.Ordinary\n        && symbol.Name == nameof(EventHandler.BeginInvoke);\n}\n\nfile record struct NodeAndName(ExpressionSyntax Node, SimpleNameSyntax Name);\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UnnecessaryBitwiseOperation.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class UnnecessaryBitwiseOperation : UnnecessaryBitwiseOperationBase\n    {\n        protected override ILanguageFacade Language => CSharpFacade.Instance;\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c => CheckBinary(c, -1),\n                SyntaxKind.BitwiseAndExpression);\n\n            context.RegisterNodeAction(\n                c => CheckBinary(c, 0),\n                SyntaxKind.BitwiseOrExpression,\n                SyntaxKind.ExclusiveOrExpression);\n\n            context.RegisterNodeAction(\n                c => CheckAssignment(c, -1),\n                SyntaxKind.AndAssignmentExpression);\n\n            context.RegisterNodeAction(\n                c => CheckAssignment(c, 0),\n                SyntaxKind.OrAssignmentExpression,\n                SyntaxKind.ExclusiveOrAssignmentExpression);\n        }\n\n        private void CheckAssignment(SonarSyntaxNodeReportingContext context, int constValueToLookFor)\n        {\n            var assignment = (AssignmentExpressionSyntax)context.Node;\n            if (FindIntConstant(context.Model, assignment.Right) is { } constValue\n                && constValue == constValueToLookFor)\n            {\n                var location = assignment.Parent is StatementSyntax\n                    ? assignment.Parent.GetLocation()\n                    : assignment.OperatorToken.CreateLocation(assignment.Right);\n                context.ReportIssue(Rule, location);\n            }\n        }\n\n        private void CheckBinary(SonarSyntaxNodeReportingContext context, int constValueToLookFor)\n        {\n            var binary = (BinaryExpressionSyntax)context.Node;\n            CheckBinary(context, binary.Left, binary.OperatorToken, binary.Right, constValueToLookFor);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UnnecessaryBitwiseOperationCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Formatting;\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class UnnecessaryBitwiseOperationCodeFix : UnnecessaryBitwiseOperationCodeFixBase\n    {\n        protected override Func<SyntaxNode> CreateNewRoot(SyntaxNode root, TextSpan diagnosticSpan, bool isReportingOnLeft) =>\n            root.FindNode(diagnosticSpan, getInnermostNodeForTie: true) switch\n            {\n                StatementSyntax statement => () => root.RemoveNode(statement, SyntaxRemoveOptions.KeepNoTrivia),\n                AssignmentExpressionSyntax assignment => () => root.ReplaceNode(assignment, assignment.Left.WithAdditionalAnnotations(Formatter.Annotation)),\n                BinaryExpressionSyntax binary => () => root.ReplaceNode(binary, (isReportingOnLeft ? binary.Right : binary.Left).WithAdditionalAnnotations(Formatter.Annotation)),\n                _ => null\n            };\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UnnecessaryMathematicalComparison.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class UnnecessaryMathematicalComparison : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S2198\";\n        private const string MathComparisonMessage = \"Comparison to this constant is useless; the constant is outside the range of type '{0}'\";\n\n        private static readonly DiagnosticDescriptor MathComparisonRule = DescriptorFactory.Create(DiagnosticId, MathComparisonMessage);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(MathComparisonRule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                CheckComparisonOutOfRange,\n                CSharpFacade.Instance.SyntaxKind.ComparisonKinds);\n\n        private static void CheckComparisonOutOfRange(SonarSyntaxNodeReportingContext context)\n        {\n            if (TryGetConstantValue(context.Model, (BinaryExpressionSyntax)context.Node, out var constant, out var other)\n               && context.Model.GetTypeInfo(other).Type is { } typeSymbolOfOther\n               && TryGetRange(typeSymbolOfOther) is { } range\n               && range.IsOutOfRange(constant))\n            {\n                var typeName = typeSymbolOfOther.ToMinimalDisplayString(context.Model, other.GetLocation().SourceSpan.Start);\n                context.ReportIssue(MathComparisonRule, other.Parent, typeName);\n            }\n        }\n\n        private static bool TryGetConstantValue(SemanticModel model, BinaryExpressionSyntax binary, out double constant, out SyntaxNode other)\n        {\n            var optionalLeft = model.GetConstantValue(binary.Left);\n            var optionalRight = model.GetConstantValue(binary.Right);\n\n            if (optionalLeft.HasValue ^ optionalRight.HasValue)\n            {\n                if (optionalLeft.HasValue && Conversions.ToDouble(optionalLeft.Value) is { } left)\n                {\n                    constant = left;\n                    other = binary.Right;\n                    return true;\n                }\n                else if (optionalRight.HasValue && Conversions.ToDouble(optionalRight.Value) is { } right)\n                {\n                    constant = right;\n                    other = binary.Left;\n                    return true;\n                }\n            }\n            constant = default;\n            other = null;\n            return false;\n        }\n\n        private static ValuesRange? TryGetRange(ITypeSymbol typeSymbol) =>\n            typeSymbol switch\n            {\n                _ when typeSymbol.Is(KnownType.System_Char) => new(char.MinValue, char.MaxValue),\n                _ when typeSymbol.Is(KnownType.System_Single) => new(float.MinValue, float.MaxValue),\n                _ when typeSymbol.Is(KnownType.System_Int64) => new(long.MinValue, long.MaxValue),\n                _ when typeSymbol.Is(KnownType.System_UInt64) => new(ulong.MinValue, ulong.MaxValue),\n                _ => null,\n            };\n\n        private readonly record struct ValuesRange(double Min, double Max)\n        {\n            public bool IsOutOfRange(double value) =>\n               value < Min || value > Max;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UnnecessaryUsings.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class UnnecessaryUsings : SonarDiagnosticAnalyzer\n{\n    internal const string DiagnosticId = \"S1128\";\n    private const string MessageFormat = \"Remove this unnecessary 'using'.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    private static readonly HashSet<string> IgnoredRazorFiles = new(StringComparer.OrdinalIgnoreCase)\n    {\n        \"_Imports.razor\",\n        \"_ViewImports.cshtml\"\n    };\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            c =>\n            {\n                // When using top level statements, we are called twice for the same compilation unit. The second call has the containing symbol kind equal to `Method`.\n                if (c.ContainingSymbol.Kind == SymbolKind.Method)\n                {\n                    return;\n                }\n\n                var compilationUnit = (CompilationUnitSyntax)c.Node;\n                var simpleNamespaces = compilationUnit.Usings.Where(usingDirective => usingDirective.Alias is null).ToList();\n                var globalUsingDirectives = simpleNamespaces.Select(x => new EquivalentNameSyntax(x.Name)).ToImmutableHashSet();\n\n                var visitor = new CSharpRemovableUsingWalker(c, globalUsingDirectives, null);\n                VisitContent(visitor, compilationUnit.Members);\n                foreach (var attribute in compilationUnit.AttributeLists)\n                {\n                    visitor.SafeVisit(attribute);\n                }\n\n                CheckUnnecessaryUsings(c, simpleNamespaces, visitor.NecessaryNamespaces);\n            },\n            SyntaxKind.CompilationUnit);\n\n    private static void VisitContent(ISafeSyntaxWalker visitor, SyntaxList<MemberDeclarationSyntax> members)\n    {\n        foreach (var member in members)\n        {\n            visitor.SafeVisit(member);\n        }\n    }\n\n    private static void CheckUnnecessaryUsings(SonarSyntaxNodeReportingContext context, IEnumerable<UsingDirectiveSyntax> usingDirectives, ISet<INamespaceSymbol> necessaryNamespaces)\n    {\n        foreach (var usingDirective in usingDirectives)\n        {\n            // This will create some FNs but will kill noise from FPs.\n            // For more info see issues:\n            //  - https://github.com/SonarSource/sonar-dotnet/issues/5946\n            //  - https://github.com/SonarSource/sonar-dotnet/issues/7959\n            if (usingDirective.GetFirstToken().IsKind(SyntaxKind.GlobalKeyword)\n                || (GeneratedCodeRecognizer.IsRazorGeneratedFile(usingDirective.SyntaxTree) && IgnoredRazorFiles.Contains(Path.GetFileName(usingDirective.GetLocation().GetMappedLineSpan().Path))))\n            {\n                continue;\n            }\n            if (context.Model.GetSymbolInfo(usingDirective.Name).Symbol is INamespaceSymbol namespaceSymbol && !necessaryNamespaces.Contains(namespaceSymbol))\n            {\n                context.ReportIssue(Rule, usingDirective);\n            }\n        }\n    }\n\n    private sealed class CSharpRemovableUsingWalker : SafeCSharpSyntaxWalker\n    {\n        public readonly HashSet<INamespaceSymbol> NecessaryNamespaces = new(NamespaceComparer.Instance);\n\n        private readonly SonarSyntaxNodeReportingContext context;\n        private readonly IImmutableSet<EquivalentNameSyntax> usingDirectivesFromParent;\n        private readonly HashSet<INamespaceSymbol> currentNamespaceAndAncestors = new(NamespaceComparer.Instance);\n        private bool linqQueryVisited;\n\n        public CSharpRemovableUsingWalker(SonarSyntaxNodeReportingContext context, IImmutableSet<EquivalentNameSyntax> usingDirectivesFromParent, INamespaceSymbol currentNamespace)\n            : base(SyntaxWalkerDepth.StructuredTrivia)\n        {\n            this.context = context;\n            this.usingDirectivesFromParent = usingDirectivesFromParent;\n            for (var ancestor = currentNamespace; ancestor is not null; ancestor = ancestor.ContainingNamespace)\n            {\n                currentNamespaceAndAncestors.Add(ancestor);\n            }\n        }\n\n        public override void VisitNamespaceDeclaration(NamespaceDeclarationSyntax node) =>\n            VisitNamespace(node.Usings, node.Name, node.Members);\n\n        public override void VisitInitializerExpression(InitializerExpressionSyntax node)\n        {\n            if (node.IsKind(SyntaxKind.CollectionInitializerExpression))\n            {\n                foreach (var addExpression in node.Expressions)\n                {\n                    VisitSymbol(context.Model.GetCollectionInitializerSymbolInfo(addExpression).Symbol);\n                }\n            }\n            base.VisitInitializerExpression(node);\n        }\n\n        public override void VisitIdentifierName(IdentifierNameSyntax node)\n        {\n            VisitNameNode(node);\n            base.VisitIdentifierName(node);\n        }\n\n        public override void VisitGenericName(GenericNameSyntax node)\n        {\n            VisitNameNode(node);\n            base.VisitGenericName(node);\n        }\n\n        public override void VisitAwaitExpression(AwaitExpressionSyntax node)\n        {\n            VisitSymbol(context.Model.GetAwaitExpressionInfo(node).GetAwaiterMethod);\n            base.VisitAwaitExpression(node);\n        }\n\n        /// <summary>\n        /// LINQ Query Syntax do not use symbols from the 'System.Linq' namespace directly, but the using directive is\n        /// still necessary to use the Query Syntax form.\n        /// </summary>\n        public override void VisitQueryExpression(QueryExpressionSyntax node)\n        {\n            if (!linqQueryVisited && TryGetSystemLinkNamespace(out var systemLinqNamespaceSymbol))\n            {\n                NecessaryNamespaces.Add(systemLinqNamespaceSymbol);\n            }\n            linqQueryVisited = true;\n            base.VisitQueryExpression(node);\n        }\n\n        public override void Visit(SyntaxNode node)\n        {\n            if (node.IsKind(SyntaxKindEx.FileScopedNamespaceDeclaration))\n            {\n                var fileScopedNamespace = (FileScopedNamespaceDeclarationSyntaxWrapper)node;\n                VisitNamespace(fileScopedNamespace.Usings, fileScopedNamespace.Name, fileScopedNamespace.Members);\n                return; // VisitNamespace processes the members\n            }\n            if (node.IsKind(SyntaxKindEx.ParenthesizedVariableDesignation)) // Tuple deconstruction declaration\n            {\n                NecessaryNamespaces.Add(context.Compilation.GetSpecialType(SpecialType.System_Object).ContainingNamespace);\n            }\n            base.Visit(node);\n        }\n\n        private void VisitNamespace(SyntaxList<UsingDirectiveSyntax> usings, NameSyntax name, SyntaxList<MemberDeclarationSyntax> members)\n        {\n            var simpleNamespaces = usings.Where(x => x.Alias is null).ToList();\n            var newUsingDirectives = new HashSet<EquivalentNameSyntax>();\n            newUsingDirectives.UnionWith(usingDirectivesFromParent);\n            newUsingDirectives.UnionWith(simpleNamespaces.Select(x => new EquivalentNameSyntax(x.Name)));\n\n            // We visit the namespace declaration with the updated set of parent 'usings', this is needed in case of nested namespaces\n            var visitingNamespace = context.Model.GetSymbolInfo(name).Symbol as INamespaceSymbol;\n            var visitor = new CSharpRemovableUsingWalker(context, newUsingDirectives.ToImmutableHashSet(), visitingNamespace);\n\n            VisitContent(visitor, members);\n            CheckUnnecessaryUsings(context, simpleNamespaces, visitor.NecessaryNamespaces);\n\n            NecessaryNamespaces.UnionWith(visitor.NecessaryNamespaces);\n        }\n\n        private bool TryGetSystemLinkNamespace(out INamespaceSymbol systemLinqNamespace)\n        {\n            foreach (var usingDirective in usingDirectivesFromParent)\n            {\n                if (context.Model.GetSymbolInfo(usingDirective.Name).Symbol is INamespaceSymbol namespaceSymbol && namespaceSymbol.ToDisplayString() == \"System.Linq\")\n                {\n                    systemLinqNamespace = namespaceSymbol;\n                    return true;\n                }\n            }\n            systemLinqNamespace = null;\n            return false;\n        }\n\n        /// <summary>\n        /// We check the symbol of each name node found in the code. If the containing namespace of the symbol is\n        /// neither the current namespace or one of its parent, it is then added to the necessary namespace set, as\n        /// importing that namespace is indeed necessary.\n        /// </summary>\n        private void VisitNameNode(ExpressionSyntax node) =>\n            VisitSymbol(context.Model.GetSymbolInfo(node).Symbol);\n\n        private void VisitSymbol(ISymbol symbol)\n        {\n            if (symbol is not null\n                && symbol.ContainingNamespace is INamespaceSymbol namespaceSymbol\n                && (currentNamespaceAndAncestors.IsEmpty() || !currentNamespaceAndAncestors.Contains(namespaceSymbol)))\n            {\n                NecessaryNamespaces.Add(namespaceSymbol);\n            }\n        }\n    }\n}\n\ninternal sealed class EquivalentNameSyntax : IEquatable<EquivalentNameSyntax>\n{\n    public NameSyntax Name { get; }\n\n    public EquivalentNameSyntax(NameSyntax name) =>\n        Name = name;\n\n    public override int GetHashCode() =>\n        Name.ToString().GetHashCode();\n\n    public override bool Equals(object obj) =>\n        obj is EquivalentNameSyntax equivalentName && Equals(equivalentName);\n\n    public bool Equals(EquivalentNameSyntax other) =>\n        other is not null && CSharpEquivalenceChecker.AreEquivalent(Name, other.Name);\n}\n\ninternal sealed class NamespaceComparer : IEqualityComparer<INamespaceSymbol>\n{\n    public static readonly NamespaceComparer Instance = new();\n\n    private NamespaceComparer() { }\n\n    public bool Equals(INamespaceSymbol x, INamespaceSymbol y) =>\n        x.IsSameNamespace(y);\n\n    public int GetHashCode(INamespaceSymbol obj) =>\n        obj.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat).GetHashCode();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UnnecessaryUsingsCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class UnnecessaryUsingsCodeFix : SonarCodeFix\n    {\n        internal const string Title = \"Remove this unnecessary 'using'.\";\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(UnnecessaryUsings.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n\n            if (!(root.FindNode(diagnosticSpan) is UsingDirectiveSyntax syntaxNode))\n            {\n                return Task.CompletedTask;\n            }\n\n            context.RegisterCodeFix(\n                Title,\n                c =>\n                {\n                    var newRoot = root.RemoveNode(syntaxNode, SyntaxRemoveOptions.KeepNoTrivia);\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n\n            return Task.CompletedTask;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UnusedPrivateMember.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class UnusedPrivateMember : SonarDiagnosticAnalyzer\n{\n    internal const string S1144DiagnosticId = \"S1144\";\n    private const string S1144MessageFormat = \"Remove the unused {0} {1} '{2}'.\";\n    private const string S1144MessageFormatForPublicCtor = \"Remove unused constructor of {0} type '{1}'.\";\n\n    private const string S4487DiagnosticId = \"S4487\";\n    private const string S4487MessageFormat = \"Remove this unread {0} field '{1}' or refactor the code to use its value.\";\n\n    private static readonly DiagnosticDescriptor RuleS1144 = DescriptorFactory.Create(S1144DiagnosticId, S1144MessageFormat);\n    private static readonly DiagnosticDescriptor RuleS1144ForPublicCtor = DescriptorFactory.Create(S1144DiagnosticId, S1144MessageFormatForPublicCtor);\n    private static readonly DiagnosticDescriptor RuleS4487 = DescriptorFactory.Create(S4487DiagnosticId, S4487MessageFormat);\n\n    private static readonly ImmutableArray<KnownType> IgnoredTypes = ImmutableArray.Create(\n        KnownType.UnityEditor_AssetModificationProcessor,\n        KnownType.UnityEditor_AssetPostprocessor,\n        KnownType.UnityEngine_MonoBehaviour,\n        KnownType.UnityEngine_ScriptableObject,\n        KnownType.Microsoft_EntityFrameworkCore_Migrations_Migration);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(RuleS1144, RuleS4487);\n    protected override bool EnableConcurrentExecution => false;\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(\n            c =>\n            {\n                // Collect potentially removable internal types from the project to evaluate when\n                // the compilation is over, depending on whether InternalsVisibleTo attribute is present\n                // or not.\n                var removableInternalTypes = new HashSet<ISymbol>();\n\n                c.RegisterSymbolAction(x => NamedSymbolAction(x, removableInternalTypes), SymbolKind.NamedType);\n                c.RegisterCompilationEndAction(\n                    cc =>\n                    {\n                        var foundInternalsVisibleTo = cc.Compilation.Assembly.HasAttribute(KnownType.System_Runtime_CompilerServices_InternalsVisibleToAttribute);\n                        if (foundInternalsVisibleTo || removableInternalTypes.Count == 0)\n                        {\n                            return;\n                        }\n\n                        var usageCollector = new SymbolUsageCollector(cc.Compilation, removableInternalTypes);\n                        foreach (var syntaxTree in cc.Compilation.SyntaxTrees.Where(tree => !tree.IsConsideredGenerated(CSharpGeneratedCodeRecognizer.Instance, cc.IsRazorAnalysisEnabled())))\n                        {\n                            usageCollector.SafeVisit(syntaxTree.GetRoot());\n                        }\n                        ReportUnusedPrivateMembers(cc, usageCollector, removableInternalTypes, SyntaxConstants.Internal, new());\n                    });\n            });\n\n    private static void NamedSymbolAction(SonarSymbolReportingContext context, HashSet<ISymbol> removableInternalTypes)\n    {\n        var namedType = (INamedTypeSymbol)context.Symbol;\n        var privateSymbols = new HashSet<ISymbol>();\n        var fieldLikeSymbols = new BidirectionalDictionary<ISymbol, SyntaxNode>();\n        if (GatherSymbols(namedType, context.Compilation, privateSymbols, removableInternalTypes, fieldLikeSymbols, context)\n            && privateSymbols.Any()\n            && new SymbolUsageCollector(context.Compilation, AssociatedSymbols(privateSymbols)) is var usageCollector\n            && VisitDeclaringReferences(namedType, usageCollector, context, includeGeneratedFile: true))\n        {\n            ReportUnusedPrivateMembers(context, usageCollector, privateSymbols, SyntaxConstants.Private, fieldLikeSymbols);\n            ReportUsedButUnreadFields(context, usageCollector, privateSymbols);\n        }\n    }\n\n    private static IEnumerable<ISymbol> AssociatedSymbols(IEnumerable<ISymbol> privateSymbols) =>\n        privateSymbols.Select(x => x is IMethodSymbol { AssociatedSymbol: IPropertySymbol property } ? property : x);\n\n    private static bool GatherSymbols(INamedTypeSymbol namedType,\n                                      Compilation compilation,\n                                      HashSet<ISymbol> privateSymbols,\n                                      HashSet<ISymbol> internalSymbols,\n                                      BidirectionalDictionary<ISymbol, SyntaxNode> fieldLikeSymbols,\n                                      SonarSymbolReportingContext context)\n    {\n        if (namedType.ContainingType is not null\n            // We skip top level statements since they cannot have fields. Other declared types are analyzed separately.\n            || namedType.IsTopLevelProgram()\n            || namedType.DerivesFromAny(IgnoredTypes)\n            // Collect symbols of private members that could potentially be removed\n            || RetrieveRemovableSymbols(namedType, compilation, context) is not { } removableSymbolsCollector)\n        {\n            return false;\n        }\n\n        CopyRetrievedSymbols(removableSymbolsCollector, privateSymbols, internalSymbols, fieldLikeSymbols);\n\n        // Collect symbols of private members that could potentially be removed for the nested classes\n        foreach (var declaration in PrivateNestedMembersFromNonGeneratedCode(namedType, context))\n        {\n            if (compilation.GetSemanticModel(declaration.SyntaxTree) is { } semanticModel\n                && semanticModel.GetDeclaredSymbol(declaration) is { } declarationSymbol)\n            {\n                var symbolsCollector = RetrieveRemovableSymbols(declarationSymbol, compilation, context);\n                CopyRetrievedSymbols(symbolsCollector, privateSymbols, internalSymbols, fieldLikeSymbols);\n            }\n        }\n\n        return true;\n\n        static IEnumerable<BaseTypeDeclarationSyntax> PrivateNestedMembersFromNonGeneratedCode(INamedTypeSymbol namedType, SonarSymbolReportingContext context) =>\n            namedType.DeclaringSyntaxReferences\n                .Where(x => !x.SyntaxTree.IsConsideredGenerated(CSharpGeneratedCodeRecognizer.Instance, context.IsRazorAnalysisEnabled()))\n                .SelectMany(x => x.GetSyntax().ChildNodes().OfType<BaseTypeDeclarationSyntax>());\n    }\n\n    private static void ReportUnusedPrivateMembers<TContext>(TContext context,\n                                                             SymbolUsageCollector usageCollector,\n                                                             ISet<ISymbol> removableSymbols,\n                                                             string accessibility,\n                                                             BidirectionalDictionary<ISymbol, SyntaxNode> fieldLikeSymbols) where TContext : ICompilationReport\n    {\n        var unusedSymbols = UnusedSymbols(usageCollector, removableSymbols);\n\n        var propertiesWithUnusedAccessor = removableSymbols\n            .Intersect(usageCollector.UsedSymbols)\n            .OfType<IPropertySymbol>()\n            .Where(usageCollector.PropertyAccess.ContainsKey)\n            .Where(x => !IsMentionedInDebuggerDisplay(x, usageCollector));\n        foreach (var property in propertiesWithUnusedAccessor)\n        {\n            ReportProperty(context, property, usageCollector.PropertyAccess);\n        }\n        ReportDiagnosticsForMembers(context, unusedSymbols, accessibility, fieldLikeSymbols);\n    }\n\n    private static bool IsUsedWithReflection(ISymbol symbol, HashSet<ISymbol> symbolsUsedWithReflection)\n    {\n        var currentSymbol = symbol;\n        while (currentSymbol is not null)\n        {\n            if (symbolsUsedWithReflection.Contains(currentSymbol))\n            {\n                return true;\n            }\n            currentSymbol = currentSymbol.ContainingSymbol;\n        }\n        return false;\n    }\n\n    private static bool IsMentionedInDebuggerDisplay(ISymbol symbol, SymbolUsageCollector usageCollector) =>\n            usageCollector.DebuggerDisplayValues.Any(x => x.Contains(symbol.Name) || (symbol is IPropertySymbol { IsIndexer: true } && x.Contains(\"this[\")));\n\n    private static void ReportUsedButUnreadFields(SonarSymbolReportingContext context, SymbolUsageCollector usageCollector, IEnumerable<ISymbol> removableSymbols)\n    {\n        var unusedSymbols = UnusedSymbols(usageCollector, removableSymbols);\n\n        var usedButUnreadFields = usageCollector.FieldSymbolUsages.Values\n            .Where(x => x.Symbol.DeclaredAccessibility == Accessibility.Private || x.Symbol.ContainingType?.DeclaredAccessibility == Accessibility.Private)\n            .Where(x => x.Symbol.Kind is SymbolKind.Field or SymbolKind.Event)\n            .Where(x => !unusedSymbols.Contains(x.Symbol)\n                        && !IsMentionedInDebuggerDisplay(x.Symbol, usageCollector)\n                        && !IsUsedWithReflection(x.Symbol, usageCollector.TypesUsedWithReflection))\n            .Where(x => x.Declaration is not null && !x.Readings.Any());\n\n        foreach (var usage in usedButUnreadFields)\n        {\n            context.ReportIssue(RuleS4487, usage.Declaration.GetLocation(), FieldAccessibilityForMessage(usage.Symbol), usage.Symbol.Name);\n        }\n    }\n\n    private static HashSet<ISymbol> UnusedSymbols(SymbolUsageCollector usageCollector, IEnumerable<ISymbol> removableSymbols) =>\n        removableSymbols\n            .Except(usageCollector.UsedSymbols)\n            .Where(x => !IsMentionedInDebuggerDisplay(x, usageCollector)\n                        && !IsAccessorUsed(x, usageCollector)\n                        && !IsDeconstructMethod(x)\n                        && !usageCollector.PrivateAttributes.Contains(x)\n                        && !IsUsedWithReflection(x, usageCollector.TypesUsedWithReflection))\n            .ToHashSet();\n\n    private static bool IsDeconstructMethod(ISymbol symbol) =>\n        symbol is IMethodSymbol { Name: \"Deconstruct\", Parameters.Length: > 0 } method\n        && method.ReturnType.Is(KnownType.Void)\n        && method.Parameters.All(x => x.RefKind == RefKind.Out);\n\n    private static bool IsAccessorUsed(ISymbol symbol, SymbolUsageCollector usageCollector) =>\n        symbol is IMethodSymbol { AssociatedSymbol: IPropertySymbol property } accessor\n        && usageCollector.PropertyAccess.TryGetValue(property, out var access)\n        && ((access.HasFlag(AccessorAccess.Get) && accessor.MethodKind == MethodKind.PropertyGet)\n            || (access.HasFlag(AccessorAccess.Set) && accessor.MethodKind == MethodKind.PropertySet));\n\n    private static string FieldAccessibilityForMessage(ISymbol symbol) =>\n        symbol.DeclaredAccessibility == Accessibility.Private ? SyntaxConstants.Private : \"private class\";\n\n    private static void ReportDiagnosticsForMembers<TContext>(TContext context,\n                                                              ICollection<ISymbol> unusedSymbols,\n                                                              string accessibility,\n                                                              BidirectionalDictionary<ISymbol, SyntaxNode> fieldLikeSymbols) where TContext : ICompilationReport\n    {\n        var alreadyReportedFieldLikeSymbols = new HashSet<ISymbol>();\n        var unusedSymbolSyntaxPairs = unusedSymbols.SelectMany(x => x.DeclaringSyntaxReferences.Select(syntax => new NodeAndSymbol(syntax.GetSyntax(), x)));\n\n        foreach (var unused in unusedSymbolSyntaxPairs)\n        {\n            var syntaxForLocation = unused.Node;\n\n            var isFieldOrEvent = unused.Symbol.Kind is SymbolKind.Field or SymbolKind.Event;\n            if (isFieldOrEvent && unused.Node.IsKind(SyntaxKind.VariableDeclarator))\n            {\n                if (alreadyReportedFieldLikeSymbols.Contains(unused.Symbol))\n                {\n                    continue;\n                }\n\n                var declarations = GetSiblingDeclarators(unused.Node).Select(fieldLikeSymbols.GetByB).ToList();\n                if (declarations.TrueForAll(unusedSymbols.Contains))\n                {\n                    syntaxForLocation = unused.Node.Parent.Parent;\n                    alreadyReportedFieldLikeSymbols.UnionWith(declarations);\n                }\n            }\n\n            if (unused.Symbol.IsConstructor() && !syntaxForLocation.GetModifiers().Any(SyntaxKind.PrivateKeyword))\n            {\n                context.ReportIssue(RuleS1144ForPublicCtor, syntaxForLocation, accessibility, unused.Symbol.ContainingType.Name);\n            }\n            else\n            {\n                context.ReportIssue(RuleS1144, IdentifierLocation(syntaxForLocation), accessibility, unused.Symbol.GetClassification(), MemberName(unused.Symbol));\n            }\n        }\n\n        static IEnumerable<VariableDeclaratorSyntax> GetSiblingDeclarators(SyntaxNode variableDeclarator) =>\n            variableDeclarator.Parent.Parent switch\n            {\n                FieldDeclarationSyntax fieldDeclaration => fieldDeclaration.Declaration.Variables,\n                EventFieldDeclarationSyntax eventDeclaration => eventDeclaration.Declaration.Variables,\n                _ => [],\n            };\n\n        static Location IdentifierLocation(SyntaxNode node) =>\n            node.GetIdentifier() is { } identifier\n                ? identifier.GetLocation()\n                : node.GetLocation();\n\n        static string MemberName(ISymbol symbol) =>\n            symbol.IsConstructor() ? symbol.ContainingType.Name : symbol.Name;\n    }\n\n    private static void ReportProperty<TContext>(TContext context,\n                                                 IPropertySymbol property,\n                                                 IReadOnlyDictionary<IPropertySymbol, AccessorAccess> propertyAccessorAccess) where TContext : ICompilationReport\n    {\n        var access = propertyAccessorAccess[property];\n        if (access == AccessorAccess.Get\n            && property.SetMethod is not null\n            && GetAccessorSyntax(property.SetMethod) is { } setter)\n        {\n            context.ReportIssue(RuleS1144, setter.Keyword.GetLocation(), SyntaxConstants.Private, \"set accessor in property\", property.Name);\n        }\n        else if (access == AccessorAccess.Set\n            && property.GetMethod is not null\n            && GetAccessorSyntax(property.GetMethod) is { } getter\n            && getter.HasBodyOrExpressionBody())\n        {\n            context.ReportIssue(RuleS1144, getter.Keyword.GetLocation(), SyntaxConstants.Private, \"get accessor in property\", property.Name);\n        }\n\n        static AccessorDeclarationSyntax GetAccessorSyntax(ISymbol symbol) =>\n            symbol?.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax() as AccessorDeclarationSyntax;\n    }\n\n    private static bool VisitDeclaringReferences(ISymbol symbol, ISafeSyntaxWalker visitor, SonarSymbolReportingContext context, bool includeGeneratedFile)\n    {\n        var syntaxReferencesToVisit = includeGeneratedFile\n            ? symbol.DeclaringSyntaxReferences\n            : symbol.DeclaringSyntaxReferences.Where(x => !IsGenerated(x));\n\n        return syntaxReferencesToVisit.All(x => visitor.SafeVisit(x.GetSyntax()));\n\n        bool IsGenerated(SyntaxReference syntaxReference) =>\n            syntaxReference.SyntaxTree.IsConsideredGenerated(CSharpGeneratedCodeRecognizer.Instance, context.IsRazorAnalysisEnabled());\n    }\n\n    private static CSharpRemovableSymbolWalker RetrieveRemovableSymbols(INamedTypeSymbol namedType, Compilation compilation, SonarSymbolReportingContext context)\n    {\n        var removableSymbolsCollector = new CSharpRemovableSymbolWalker(compilation.GetSemanticModel, namedType.DeclaredAccessibility);\n        return VisitDeclaringReferences(namedType, removableSymbolsCollector, context, includeGeneratedFile: false)\n            ? removableSymbolsCollector\n            : null;\n    }\n\n    private static void CopyRetrievedSymbols(CSharpRemovableSymbolWalker removableSymbolCollector,\n                                             HashSet<ISymbol> privateSymbols,\n                                             HashSet<ISymbol> internalSymbols,\n                                             BidirectionalDictionary<ISymbol, SyntaxNode> fieldLikeSymbols)\n    {\n        privateSymbols.AddRange(removableSymbolCollector.PrivateSymbols);\n\n        // Keep the removable internal types for when the compilation ends\n        internalSymbols.AddRange(removableSymbolCollector.InternalSymbols);\n\n        foreach (var pair in removableSymbolCollector.FieldLikeSymbols.Where(x => !fieldLikeSymbols.ContainsKeyByA(x.Key)))\n        {\n            fieldLikeSymbols.Add(pair.Key, pair.Value);\n        }\n    }\n\n    /// <summary>\n    /// Collects private or internal member symbols that could potentially be removed if they are not used.\n    /// Members that are overridden, overridable, have specific use, etc. are not removable.\n    /// </summary>\n    private sealed class CSharpRemovableSymbolWalker : SafeCSharpSyntaxWalker\n    {\n        private readonly Func<SyntaxNode, SemanticModel> getSemanticModel;\n        private readonly Accessibility containingTypeAccessibility;\n\n        public Dictionary<ISymbol, SyntaxNode> FieldLikeSymbols { get; } = [];\n        public HashSet<ISymbol> InternalSymbols { get; } = [];\n        public HashSet<ISymbol> PrivateSymbols { get; } = [];\n\n        public CSharpRemovableSymbolWalker(Func<SyntaxTree, bool, SemanticModel> getSemanticModel, Accessibility containingTypeAccessibility)\n        {\n            this.getSemanticModel = x => getSemanticModel(x.SyntaxTree, false);\n            this.containingTypeAccessibility = containingTypeAccessibility;\n        }\n\n        // This override is needed because VisitRecordDeclaration and LocalFunctionStatementSyntax are not available due to the Roslyn version.\n        public override void Visit(SyntaxNode node)\n        {\n            if (node.Kind() is SyntaxKindEx.RecordDeclaration or SyntaxKindEx.RecordStructDeclaration)\n            {\n                VisitBaseTypeDeclaration(node);\n            }\n\n            if (node.IsKind(SyntaxKindEx.LocalFunctionStatement))\n            {\n                ConditionalStore((IMethodSymbol)DeclaredSymbol(node), IsRemovableMethod);\n            }\n\n            base.Visit(node);\n        }\n\n        public override void VisitClassDeclaration(ClassDeclarationSyntax node)\n        {\n            VisitBaseTypeDeclaration(node);\n            base.VisitClassDeclaration(node);\n        }\n\n        public override void VisitConstructorDeclaration(ConstructorDeclarationSyntax node)\n        {\n            if (!IsEmptyConstructor(node)\n                && IsPrivateOrInPrivateType(node.Modifiers))\n            {\n                ConditionalStore((IMethodSymbol)DeclaredSymbol(node), IsRemovableMethod);\n            }\n\n            base.VisitConstructorDeclaration(node);\n        }\n\n        public override void VisitDelegateDeclaration(DelegateDeclarationSyntax node)\n        {\n            if (IsPrivateOrInPrivateType(node.Modifiers, true))\n            {\n                ConditionalStore(DeclaredSymbol(node), IsRemovableType);\n            }\n\n            base.VisitDelegateDeclaration(node);\n        }\n\n        public override void VisitEnumDeclaration(EnumDeclarationSyntax node)\n        {\n            VisitBaseTypeDeclaration(node);\n            base.VisitEnumDeclaration(node);\n        }\n\n        public override void VisitEventDeclaration(EventDeclarationSyntax node)\n        {\n            if (IsPrivateOrInPrivateType(node.Modifiers))\n            {\n                var symbol = (IEventSymbol)DeclaredSymbol(node);\n                ConditionalStore(symbol.PartialDefinitionPart ?? symbol, IsRemovableMember);\n            }\n\n            base.VisitEventDeclaration(node);\n        }\n\n        public override void VisitEventFieldDeclaration(EventFieldDeclarationSyntax node)\n        {\n            if (IsPrivateOrInPrivateType(node.Modifiers))\n            {\n                StoreRemovableVariableDeclarations(node);\n            }\n\n            base.VisitEventFieldDeclaration(node);\n        }\n\n        public override void VisitFieldDeclaration(FieldDeclarationSyntax node)\n        {\n            if (IsPrivateOrInPrivateType(node.Modifiers))\n            {\n                StoreRemovableVariableDeclarations(node);\n            }\n\n            base.VisitFieldDeclaration(node);\n        }\n\n        public override void VisitIndexerDeclaration(IndexerDeclarationSyntax node)\n        {\n            if (IsPrivateOrInPrivateType(node.Modifiers))\n            {\n                ConditionalStore(DeclaredSymbol(node), IsRemovableMember);\n            }\n\n            base.VisitIndexerDeclaration(node);\n        }\n\n        public override void VisitInterfaceDeclaration(InterfaceDeclarationSyntax node)\n        {\n            VisitBaseTypeDeclaration(node);\n            base.VisitInterfaceDeclaration(node);\n        }\n\n        public override void VisitMethodDeclaration(MethodDeclarationSyntax node)\n        {\n            if (IsPrivateOrInPrivateType(node.Modifiers))\n            {\n                var symbol = (IMethodSymbol)DeclaredSymbol(node);\n                ConditionalStore(symbol.AssociatedExtensionImplementation ?? symbol.PartialDefinitionPart ?? symbol, IsRemovableMethod);\n            }\n\n            base.VisitMethodDeclaration(node);\n        }\n\n        public override void VisitAccessorDeclaration(AccessorDeclarationSyntax node)\n        {\n            if (node.Modifiers.Any(SyntaxKind.PrivateKeyword))\n            {\n                ConditionalStore(DeclaredSymbol(node), IsRemovable);\n            }\n\n            base.VisitAccessorDeclaration(node);\n        }\n\n        public override void VisitPropertyDeclaration(PropertyDeclarationSyntax node)\n        {\n            if (IsPrivateOrInPrivateType(node.Modifiers))\n            {\n                ConditionalStore(DeclaredSymbol(node), IsRemovableMember);\n            }\n\n            base.VisitPropertyDeclaration(node);\n        }\n\n        public override void VisitStructDeclaration(StructDeclarationSyntax node)\n        {\n            VisitBaseTypeDeclaration(node);\n            base.VisitStructDeclaration(node);\n        }\n\n        private void ConditionalStore<TSymbol>(TSymbol symbol, Func<TSymbol, bool> condition)\n            where TSymbol : ISymbol\n        {\n            if (condition(symbol))\n            {\n                if (symbol.GetEffectiveAccessibility() == Accessibility.Private)\n                {\n                    PrivateSymbols.Add(symbol);\n                }\n                else if (symbol is INamedTypeSymbol)\n                {\n                    InternalSymbols.Add(symbol);\n                }\n            }\n        }\n\n        private ISymbol DeclaredSymbol(SyntaxNode node) =>\n            getSemanticModel(node).GetDeclaredSymbol(node);\n\n        private void StoreRemovableVariableDeclarations(BaseFieldDeclarationSyntax node)\n        {\n            foreach (var variable in node.Declaration.Variables)\n            {\n                var symbol = DeclaredSymbol(variable);\n                if (IsRemovableMember(symbol))\n                {\n                    PrivateSymbols.Add(symbol);\n                    FieldLikeSymbols.Add(symbol, variable);\n                }\n            }\n        }\n\n        private static bool IsEmptyConstructor(BaseMethodDeclarationSyntax constructorDeclaration) =>\n            !constructorDeclaration.HasBodyOrExpressionBody()\n            || constructorDeclaration.Body is { Statements.Count: 0 };\n\n        private static bool IsRemovableMethod(IMethodSymbol methodSymbol) =>\n            IsRemovableMember(methodSymbol)\n            && (methodSymbol.MethodKind is MethodKind.Ordinary or MethodKind.Constructor or MethodKindEx.LocalFunction)\n            && !methodSymbol.IsMainMethod()\n            && !methodSymbol.IsEventHandler() // Event handlers could be added in XAML and no method reference will be generated in the .g.cs file.\n            && !methodSymbol.IsSerializationConstructor()\n            && !methodSymbol.IsRecordPrintMembers()\n            && !methodSymbol.IsMefConstructor();\n\n        private static bool IsRemovable(ISymbol symbol) =>\n            symbol is { IsImplicitlyDeclared: false, IsVirtual: false }\n            && !HasAttributes(symbol)\n            && !symbol.IsSerializableMember()\n            && !symbol.ContainingType.IsInterface()\n            && !(symbol.Kind is SymbolKind.Field && symbol.ContainingType.HasAttribute(KnownType.System_Runtime_InteropServices_StructLayoutAttribute))\n            && symbol.InterfaceMembers().IsEmpty()\n            && symbol.GetOverriddenMember() is null;\n\n        private static bool HasAttributes(ISymbol symbol)\n        {\n            var attributes = symbol.GetAttributes().AsEnumerable();\n            if (symbol is IMethodSymbol { MethodKind: MethodKind.PropertyGet or MethodKind.PropertySet, AssociatedSymbol: { } property })\n            {\n                attributes = attributes.Union(property.GetAttributes());\n            }\n            return attributes.Any(x => !x.AttributeClass.Is(KnownType.System_NonSerializedAttribute));\n        }\n\n        private static bool IsRemovableMember(ISymbol symbol) =>\n            symbol.GetEffectiveAccessibility() == Accessibility.Private\n            && IsRemovable(symbol);\n\n        private static bool IsRemovableType(ISymbol typeSymbol) =>\n            typeSymbol.GetEffectiveAccessibility() is var accessibility\n            && typeSymbol.ContainingType is not null\n            && (accessibility is Accessibility.Private or Accessibility.Internal)\n            && IsRemovable(typeSymbol)\n            && !(typeSymbol is INamedTypeSymbol namedType && namedType.IsMefExportedType());\n\n        private void VisitBaseTypeDeclaration(SyntaxNode node)\n        {\n            if (IsPrivateOrInPrivateType(((BaseTypeDeclarationSyntax)node).Modifiers, true))\n            {\n                ConditionalStore(DeclaredSymbol(node), IsRemovableType);\n            }\n        }\n\n        private bool IsPrivateOrInPrivateType(SyntaxTokenList modifiers, bool checkInternal = false) =>\n            containingTypeAccessibility == Accessibility.Private\n            || (checkInternal && containingTypeAccessibility == Accessibility.Internal)\n            || !modifiers.Any(x => x.Kind() is SyntaxKind.PrivateKeyword or SyntaxKind.PublicKeyword or SyntaxKind.InternalKeyword or SyntaxKind.ProtectedKeyword)\n            || modifiers.Any(SyntaxKind.PrivateKeyword);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UnusedPrivateMemberCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public class UnusedPrivateMemberCodeFix : SonarCodeFix\n    {\n        internal const string Title = \"Remove unused member\";\n        // We only want to fix S1144 and not S4487 because for S4487 the field is written so we don't know the fix\n        public sealed override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(UnusedPrivateMember.S1144DiagnosticId);\n\n        protected sealed override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First(diag => diag.Id == UnusedPrivateMember.S1144DiagnosticId);\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            var syntax = root.FindNode(diagnosticSpan);\n\n            context.RegisterCodeFix(\n                Title,\n                c =>\n                {\n                    var newRoot = root.RemoveNode(syntax, SyntaxRemoveOptions.KeepNoTrivia);\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n\n            return Task.CompletedTask;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UnusedReturnValue.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing NodeSymbolAndModel = SonarAnalyzer.Core.Common.NodeSymbolAndModel<Microsoft.CodeAnalysis.CSharp.Syntax.InvocationExpressionSyntax, Microsoft.CodeAnalysis.IMethodSymbol>;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class UnusedReturnValue : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S3241\";\n        private const string MessageFormat = \"Change return type to 'void'; not a single caller uses the returned value.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterSymbolAction(AnalyzeNamedTypes, SymbolKind.NamedType);\n            context.RegisterNodeAction(AnalyzeLocalFunctionStatements, SyntaxKindEx.LocalFunctionStatement);\n        }\n\n        private static void AnalyzeNamedTypes(SonarSymbolReportingContext context)\n        {\n            var namedType = (INamedTypeSymbol)context.Symbol;\n            if (!namedType.IsClassOrStruct() || namedType.ContainingType != null)\n            {\n                return;\n            }\n\n            var removableDeclarationCollector = new CSharpRemovableDeclarationCollector(namedType, context.Compilation);\n\n            var declaredPrivateMethodsWithReturn = CollectRemovableMethods(removableDeclarationCollector).ToList();\n            if (!declaredPrivateMethodsWithReturn.Any())\n            {\n                return;\n            }\n\n            var invocations = removableDeclarationCollector.TypeDeclarations.SelectMany(FilterInvocations).ToList();\n\n            foreach (var declaredPrivateMethodWithReturn in declaredPrivateMethodsWithReturn)\n            {\n                var matchingInvocations = invocations\n                    .Where(invocation => invocation.Symbol.OriginalDefinition.Equals(declaredPrivateMethodWithReturn.Symbol))\n                    .ToList();\n\n                // Method invocation is noncompliant when there is at least 1 invocation of the method, and no invocation is using the return value. The case of 0 invocation is handled by S1144.\n                if (matchingInvocations.Any() && !matchingInvocations.Any(IsReturnValueUsed))\n                {\n                    context.ReportIssue(Rule, declaredPrivateMethodWithReturn.Node.ReturnType);\n                }\n            }\n        }\n\n        private static void AnalyzeLocalFunctionStatements(SonarSyntaxNodeReportingContext context)\n        {\n            var localFunctionSyntax = (LocalFunctionStatementSyntaxWrapper)context.Node;\n            var topMostContainingMethod = localFunctionSyntax.IsTopLevel()\n                                              ? context.Node.Parent.Parent // .Parent.Parent is the CompilationUnit\n                                              : context.Node.GetTopMostContainingMethod();\n\n            if (topMostContainingMethod == null)\n            {\n                return;\n            }\n\n            var localFunctionSymbol = (IMethodSymbol)context.Model.GetDeclaredSymbol(localFunctionSyntax);\n            if (localFunctionSymbol.ReturnsVoid || localFunctionSymbol.IsAsync)\n            {\n                return;\n            }\n\n            var matchingInvocations = GetLocalMatchingInvocations(topMostContainingMethod, localFunctionSymbol, context.Model).ToList();\n            // Method invocation is noncompliant when there is at least 1 invocation of the method, and no invocation is using the return value. The case of 0 invocation is handled by S1144.\n            if (matchingInvocations.Any() && !matchingInvocations.Any(IsReturnValueUsed))\n            {\n                context.ReportIssue(Rule, localFunctionSyntax.ReturnType);\n            }\n        }\n\n        private static bool IsReturnValueUsed(NodeSymbolAndModel matchingInvocation) =>\n            !IsExpressionStatement(matchingInvocation.Node.Parent)\n            && !IsActionLambda(matchingInvocation.Node.Parent, matchingInvocation.Model);\n\n        private static bool IsActionLambda(SyntaxNode node, SemanticModel semanticModel) =>\n            node is LambdaExpressionSyntax lambda\n            && semanticModel.GetSymbolInfo(lambda).Symbol is IMethodSymbol { ReturnsVoid: true };\n\n        private static bool IsExpressionStatement(SyntaxNode node) =>\n            node is ExpressionStatementSyntax;\n\n        private static IEnumerable<NodeSymbolAndModel> GetLocalMatchingInvocations(SyntaxNode containingMethod, IMethodSymbol invocationSymbol, SemanticModel semanticModel) =>\n            containingMethod.DescendantNodes()\n                .OfType<InvocationExpressionSyntax>()\n                .Where(x => semanticModel.GetSymbolInfo(x.Expression).Symbol is IMethodSymbol methodSymbol && invocationSymbol.Equals(methodSymbol))\n                .Select(x => new NodeSymbolAndModel(x, invocationSymbol, semanticModel))\n                .ToList();\n\n        private static IEnumerable<NodeSymbolAndModel> FilterInvocations(NodeAndModel<BaseTypeDeclarationSyntax> container) =>\n            container.Node.DescendantNodes()\n                .OfType<InvocationExpressionSyntax>()\n                .Select(x => new NodeSymbolAndModel(x, container.Model.GetSymbolInfo(x).Symbol as IMethodSymbol, container.Model))\n                .Where(x => x.Symbol != null);\n\n        private static IEnumerable<NodeSymbolAndModel<MethodDeclarationSyntax, IMethodSymbol>> CollectRemovableMethods(CSharpRemovableDeclarationCollector removableDeclarationCollector) =>\n                removableDeclarationCollector.TypeDeclarations\n                    .SelectMany(container => container.Node.DescendantNodes(CSharpRemovableDeclarationCollector.IsNodeContainerTypeDeclaration)\n                        .OfType<MethodDeclarationSyntax>()\n                        .Select(x => new NodeSymbolAndModel<MethodDeclarationSyntax, IMethodSymbol>(x, container.Model.GetDeclaredSymbol(x), container.Model)))\n                        .Where(x => x.Symbol is { ReturnsVoid: false, IsAsync: false } && CSharpRemovableDeclarationCollector.IsRemovable(x.Symbol, Accessibility.Private));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UnusedStringBuilder.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class UnusedStringBuilder : UnusedStringBuilderBase<SyntaxKind, VariableDeclaratorSyntax, IdentifierNameSyntax>\n{\n    private static readonly HashSet<SyntaxKind> SkipChildren =\n    [\n        SyntaxKind.ClassDeclaration,\n        SyntaxKind.StructDeclaration,\n        SyntaxKind.EnumDeclaration,\n        SyntaxKind.InterfaceDeclaration,\n        SyntaxKind.UsingDirective,\n        SyntaxKindEx.RecordDeclaration,\n        SyntaxKindEx.RecordStructDeclaration\n    ];\n\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override SyntaxNode Scope(VariableDeclaratorSyntax declarator) =>\n        declarator switch\n        {\n            { Parent: VariableDeclarationSyntax { Parent: LocalDeclarationStatementSyntax { Parent: BlockSyntax block } } } => block,\n            { Parent: VariableDeclarationSyntax { Parent: LocalDeclarationStatementSyntax { Parent: GlobalStatementSyntax { Parent: CompilationUnitSyntax compilationUnit } } } } => compilationUnit,\n            _ => null,\n        };\n\n    protected override ILocalSymbol RetrieveStringBuilderObject(SemanticModel model, VariableDeclaratorSyntax declarator) =>\n        declarator is\n        {\n            Parent.Parent: LocalDeclarationStatementSyntax,\n            Initializer.Value: { } expression,\n        }\n        && IsStringBuilderObjectCreation(expression, model)\n            ? model.GetDeclaredSymbol(declarator) as ILocalSymbol\n            : null;\n\n    protected override SyntaxNode StringBuilderReadExpression(SemanticModel model, SyntaxNode node) =>\n        node switch\n        {\n            InvocationExpressionSyntax invocation when IsAccessInvocation(invocation.Expression.GetName()) => invocation.Expression,\n            ReturnStatementSyntax returnStatement => returnStatement.Expression,\n            InterpolationSyntax interpolation => interpolation.Expression,\n            ElementAccessExpressionSyntax elementAccess => elementAccess.Expression,\n            ArgumentSyntax argument => argument.Expression,\n            MemberAccessExpressionSyntax memberAccess when IsAccessExpression(memberAccess.Name.GetName()) => memberAccess.Expression,\n            VariableDeclaratorSyntax { Initializer.Value: IdentifierNameSyntax identifier } => identifier,\n            VariableDeclaratorSyntax { Initializer.Value: ConditionalAccessExpressionSyntax { Expression: IdentifierNameSyntax identifier } } => identifier,\n            AssignmentExpressionSyntax { Right: IdentifierNameSyntax identifier } => identifier,\n            BinaryExpressionSyntax { RawKind: (int)SyntaxKind.AddExpression } => node,\n            _ => null,\n        };\n\n    protected override bool DescendIntoChildren(SyntaxNode node) =>\n        !(node.IsAnyKind(SkipChildren)\n            || (node.IsKind(SyntaxKindEx.LocalFunctionStatement) && ((LocalFunctionStatementSyntaxWrapper)node).Modifiers.Any(SyntaxKind.StaticKeyword)));\n\n    private static bool IsStringBuilderObjectCreation(ExpressionSyntax expression, SemanticModel model) =>\n        ObjectCreationFactory.TryCreate(expression) is { } creation\n        && creation.IsKnownType(KnownType.System_Text_StringBuilder, model);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UriShouldNotBeHardcoded.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class UriShouldNotBeHardcoded : UriShouldNotBeHardcodedBase<SyntaxKind, LiteralExpressionSyntax, ArgumentSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n    protected override GeneratedCodeRecognizer GeneratedCodeRecognizer => CSharpGeneratedCodeRecognizer.Instance;\n    protected override SyntaxKind[] StringConcatenateExpressions => [SyntaxKind.AddExpression];\n    protected override SyntaxKind[] InvocationOrObjectCreationKind => [SyntaxKind.InvocationExpression, SyntaxKind.ObjectCreationExpression];\n\n    protected override SyntaxNode GetRelevantAncestor(SyntaxNode node) =>\n        node switch\n        {\n            _ when node.FirstAncestorOrSelf<AssignmentExpressionSyntax>() is { } propertyAssignment => propertyAssignment.Left,\n            _ when node.FirstAncestorOrSelf<ParameterSyntax>() is { } parameterSyntax => parameterSyntax,\n            _ when node.FirstAncestorOrSelf<VariableDeclaratorSyntax>() is { } variableDeclaratorSyntax => variableDeclaratorSyntax,\n            _ => null\n        };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UseAwaitableMethod.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Shared.Extensions;\nusing WellKnownExtensionMethodContainer = SonarAnalyzer.Core.Common.MultiValueDictionary<Microsoft.CodeAnalysis.ITypeSymbol, Microsoft.CodeAnalysis.INamedTypeSymbol>;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class UseAwaitableMethod : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S6966\";\n    private const string MessageFormat = \"Await {0} instead.\";\n    private static readonly string[] ExcludedMethodNames = [\"Add\", \"AddRange\"];\n    private static readonly ImmutableArray<KnownType> ExcludedTypes = ImmutableArray.Create(KnownType.System_Xml_XmlWriter, KnownType.System_Xml_XmlReader);\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(compilationStart =>\n        {\n            // Not every async method is defined in the same class/interface as its non-async counterpart.\n            // For example the EntityFrameworkQueryableExtensions.AnyAsync() method provides an async version of the Enumerable.Any() method for IQueryable types.\n            // WellKnownExtensionMethodContainer stores where to look for the async versions of certain methods from a type, e.g. async versions of methods from\n            // System.Linq.Enumerable can be found in Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.\n            var wellKnownExtensionMethodContainer = BuildWellKnownExtensionMethodContainers(compilationStart.Compilation);\n            var exclusions = BuildExclusions(compilationStart.Compilation);\n            compilationStart.RegisterCodeBlockStartAction<SyntaxKind>(CSharpGeneratedCodeRecognizer.Instance, codeBlockStart =>\n            {\n                if (IsAsyncCodeBlock(codeBlockStart.CodeBlock))\n                {\n                    codeBlockStart.RegisterNodeAction(nodeContext =>\n                    {\n                        var invocationExpression = (InvocationExpressionSyntax)nodeContext.Node;\n\n                        var awaitableAlternatives = FindAwaitableAlternatives(wellKnownExtensionMethodContainer, exclusions, invocationExpression,\n                            nodeContext.Model, nodeContext.ContainingSymbol, nodeContext.Cancel);\n                        if (awaitableAlternatives.FirstOrDefault() is { Name: { } alternative })\n                        {\n                            nodeContext.ReportIssue(Rule, invocationExpression, alternative);\n                        }\n                    }, SyntaxKind.InvocationExpression);\n                }\n            });\n        });\n\n    private static WellKnownExtensionMethodContainer BuildWellKnownExtensionMethodContainers(Compilation compilation)\n    {\n        var wellKnownExtensionMethodContainer = new WellKnownExtensionMethodContainer();\n        var queryable = compilation.GetTypeByMetadataName(KnownType.System_Linq_Queryable);\n        var enumerable = compilation.GetTypeByMetadataName(KnownType.System_Linq_Enumerable);\n        if (queryable is not null && enumerable is not null)\n        {\n            if (compilation.GetTypeByMetadataName(KnownType.Microsoft_EntityFrameworkCore_EntityFrameworkQueryableExtensions) is { } entityFrameworkQueryableExtensions)\n            {\n                wellKnownExtensionMethodContainer.Add(queryable, entityFrameworkQueryableExtensions);\n                wellKnownExtensionMethodContainer.Add(enumerable, entityFrameworkQueryableExtensions);\n            }\n            if (compilation.GetTypeByMetadataName(KnownType.Microsoft_EntityFrameworkCore_RelationalQueryableExtensions) is { } relationalQueryableExtensions)\n            {\n                wellKnownExtensionMethodContainer.Add(queryable, relationalQueryableExtensions);\n                wellKnownExtensionMethodContainer.Add(enumerable, relationalQueryableExtensions);\n            }\n        }\n        if (compilation.GetTypeByMetadataName(KnownType.System_Net_Sockets_Socket) is { } socket\n            && compilation.GetTypeByMetadataName(KnownType.System_Net_Sockets_SocketTaskExtensions) is { } socketTaskExtensions)\n        {\n            wellKnownExtensionMethodContainer.Add(socket, socketTaskExtensions);\n        }\n        return wellKnownExtensionMethodContainer;\n    }\n\n    private static ImmutableArray<Func<IMethodSymbol, bool>> BuildExclusions(Compilation compilation)\n    {\n        var exclusions = ImmutableArray.CreateBuilder<Func<IMethodSymbol, bool>>();\n        if (compilation.GetTypeByMetadataName(KnownType.Microsoft_EntityFrameworkCore_DbSet_TEntity) is not null)\n        {\n            exclusions.Add(x => x.IsAny(KnownType.Microsoft_EntityFrameworkCore_DbSet_TEntity, ExcludedMethodNames)); // https://github.com/SonarSource/sonar-dotnet/issues/9269\n            exclusions.Add(x => x.IsAny(KnownType.Microsoft_EntityFrameworkCore_DbContext, ExcludedMethodNames));     // https://github.com/SonarSource/sonar-dotnet/issues/9269\n            // https://github.com/SonarSource/sonar-dotnet/issues/9590\n            exclusions.Add(x => x.IsImplementingInterfaceMember(KnownType.Microsoft_EntityFrameworkCore_IDbContextFactory_TContext, \"CreateDbContext\"));\n        }\n        if (compilation.GetTypeByMetadataName(KnownType.FluentValidation_IValidator) is not null)\n        {\n            exclusions.Add(x => x.IsImplementingInterfaceMember(KnownType.FluentValidation_IValidator, \"Validate\"));   // https://github.com/SonarSource/sonar-dotnet/issues/9339\n            exclusions.Add(x => x.IsImplementingInterfaceMember(KnownType.FluentValidation_IValidator_T, \"Validate\")); // https://github.com/SonarSource/sonar-dotnet/issues/9339\n        }\n        if (compilation.GetTypeByMetadataName(KnownType.MongoDB_Driver_IMongoCollectionExtensions) is not null)\n        {\n            exclusions.Add(x => x.Is(KnownType.MongoDB_Driver_IMongoCollectionExtensions, \"Find\")); // https://github.com/SonarSource/sonar-dotnet/issues/9265\n        }\n        return exclusions.ToImmutableArray();\n    }\n\n    private static ImmutableArray<ISymbol> FindAwaitableAlternatives(WellKnownExtensionMethodContainer wellKnownExtensionMethodContainer, ImmutableArray<Func<IMethodSymbol, bool>> exclusions,\n        InvocationExpressionSyntax invocationExpression, SemanticModel model, ISymbol containingSymbol, CancellationToken cancel)\n    {\n        var awaitableRoot = GetAwaitableRootOfInvocation(invocationExpression);\n        if (awaitableRoot is not { Parent: AwaitExpressionSyntax } // Invocation result is already awaited.\n            && invocationExpression.EnclosingScope() is { } scope\n            && IsAsyncCodeBlock(scope)\n            && model.GetSymbolInfo(invocationExpression, cancel).Symbol is IMethodSymbol { MethodKind: not MethodKind.DelegateInvoke } methodSymbol\n            && !(methodSymbol.IsAwaitableNonDynamic()  // The invoked method returns something awaitable (but it isn't awaited).\n                || methodSymbol.ContainingType.DerivesFromAny(ExcludedTypes))\n            && !exclusions.Any(x => x(methodSymbol)))\n        {\n            // Perf: Before doing (expensive) speculative re-binding in SpeculativeBindCandidates, we check if there is an \"..Async()\" alternative in scope.\n            var invokedType = invocationExpression.Expression.GetLeftOfDot() is { } expression && model.GetTypeInfo(expression) is { Type: { } type }\n                ? type // A dotted expression: Lookup the type, left of the dot (this may be different from methodSymbol.ContainingType)\n                : containingSymbol.ContainingType; // If not dotted, than the scope is the current type. Local function support is missing here.\n            var members = GetMethodSymbolsInScope($\"{methodSymbol.Name}Async\", wellKnownExtensionMethodContainer, invokedType, methodSymbol.ContainingType);\n            var awaitableCandidates = members.Where(x => x.IsAwaitableNonDynamic());\n            // Get the method alternatives and exclude candidates that would resolve to the containing method (endless loop)\n            var awaitableAlternatives = SpeculativeBindCandidates(model, awaitableRoot, invocationExpression, awaitableCandidates)\n                .Where(x => !containingSymbol.Equals(x))\n                .ToImmutableArray();\n            return awaitableAlternatives;\n        }\n        return ImmutableArray<ISymbol>.Empty;\n    }\n\n    private static IEnumerable<IMethodSymbol> GetMethodSymbolsInScope(string methodName, WellKnownExtensionMethodContainer wellKnownExtensionMethodContainer,\n        ITypeSymbol invokedType, ITypeSymbol methodContainer) =>\n        ((ITypeSymbol[])[.. invokedType.GetSelfAndBaseTypes(), .. WellKnownExtensionMethodContainer(wellKnownExtensionMethodContainer, methodContainer), methodContainer])\n            .Distinct()\n            .SelectMany(x => x.GetMembers(methodName))\n            .OfType<IMethodSymbol>()\n            .Where(x => !x.HasAttribute(KnownType.System_ObsoleteAttribute));\n\n    private static IEnumerable<INamedTypeSymbol> WellKnownExtensionMethodContainer(WellKnownExtensionMethodContainer lookup, ITypeSymbol invokedType) =>\n        lookup.TryGetValue(invokedType, out var extensionMethodContainer)\n            ? extensionMethodContainer\n            : [];\n\n    private static IEnumerable<ISymbol> SpeculativeBindCandidates(SemanticModel model, SyntaxNode awaitableRoot,\n        InvocationExpressionSyntax invocationExpression, IEnumerable<IMethodSymbol> awaitableCandidates) =>\n        awaitableCandidates\n            .Select(x => x.Name)\n            .Distinct()\n            .Select(x => SpeculativeBindCandidate(model, x, awaitableRoot, invocationExpression))\n            .WhereNotNull();\n\n    private static IMethodSymbol SpeculativeBindCandidate(SemanticModel model, string candidateName, SyntaxNode awaitableRoot,\n        InvocationExpressionSyntax invocationExpression)\n    {\n        var invocationIdentifierName = invocationExpression.GetMethodCallIdentifier()?.Parent;\n        if (invocationIdentifierName is null)\n        {\n            return null;\n        }\n        var invocationReplaced = ReplaceInvocation(awaitableRoot, invocationExpression, invocationIdentifierName, candidateName);\n        var speculativeSymbolInfo = model.GetSpeculativeSymbolInfo(invocationReplaced.SpanStart, invocationReplaced, SpeculativeBindingOption.BindAsExpression);\n        var speculativeSymbol = speculativeSymbolInfo.Symbol as IMethodSymbol;\n        return speculativeSymbol;\n    }\n\n    private static SyntaxNode ReplaceInvocation(SyntaxNode awaitableRoot, InvocationExpressionSyntax invocationExpression, SyntaxNode invocationIdentifierName, string candidateName)\n    {\n        var root = invocationExpression.SyntaxTree.GetRoot();\n        var invocationAnnotation = new SyntaxAnnotation();\n        var replace = root.ReplaceNodes([awaitableRoot, invocationIdentifierName, invocationExpression], (original, newNode) =>\n        {\n            var result = newNode;\n            if (original == invocationIdentifierName)\n            {\n                var newIdentifierToken = SyntaxFactory.Identifier(candidateName);\n                var simpleName = invocationIdentifierName switch\n                {\n                    IdentifierNameSyntax => (SimpleNameSyntax)SyntaxFactory.IdentifierName(newIdentifierToken),\n                    GenericNameSyntax { TypeArgumentList: { } typeArguments } => SyntaxFactory.GenericName(newIdentifierToken, typeArguments),\n                    _ => null,\n                };\n                result = simpleName is null ? newNode : simpleName.WithTriviaFrom(invocationIdentifierName);\n            }\n            if (original == invocationExpression)\n            {\n                result = result.WithAdditionalAnnotations(invocationAnnotation);\n            }\n            if (original == awaitableRoot && result is ExpressionSyntax resultExpression)\n            {\n                result = SyntaxFactory.ParenthesizedExpression(\n                    SyntaxFactory.AwaitExpression(resultExpression.WithoutTrivia().WithLeadingTrivia(SyntaxFactory.ElasticSpace))).WithTriviaFrom(resultExpression);\n            }\n            return result;\n        });\n        return replace.GetAnnotatedNodes(invocationAnnotation).First();\n    }\n\n    private static ExpressionSyntax GetAwaitableRootOfInvocation(ExpressionSyntax expression) =>\n        expression switch\n        {\n            { Parent: ConditionalAccessExpressionSyntax conditional } => conditional.GetRootConditionalAccessExpression(),\n            { Parent: MemberAccessExpressionSyntax memberAccess } => memberAccess.GetRootConditionalAccessExpression() ?? GetAwaitableRootOfInvocation(memberAccess),\n            { Parent: PostfixUnaryExpressionSyntax { RawKind: (int)SyntaxKindEx.SuppressNullableWarningExpression } parent } => GetAwaitableRootOfInvocation(parent),\n            { Parent: ParenthesizedExpressionSyntax parent } => GetAwaitableRootOfInvocation(parent),\n            { } self => self,\n        };\n\n    private static bool IsAsyncCodeBlock(SyntaxNode codeBlock) =>\n        codeBlock switch\n        {\n            CompilationUnitSyntax => true,\n            BaseMethodDeclarationSyntax { Modifiers: { } modifiers } => modifiers.AnyOfKind(SyntaxKind.AsyncKeyword),\n            AnonymousFunctionExpressionSyntax { AsyncKeyword: { } asyncKeyword } => asyncKeyword.IsKind(SyntaxKind.AsyncKeyword),\n            var localFunction when LocalFunctionStatementSyntaxWrapper.IsInstance(localFunction) => ((LocalFunctionStatementSyntaxWrapper)localFunction).Modifiers.AnyOfKind(SyntaxKind.AsyncKeyword),\n            _ => false,\n        };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UseCharOverloadOfStringMethods.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class UseCharOverloadOfStringMethods : UseCharOverloadOfStringMethodsBase<SyntaxKind, InvocationExpressionSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override bool HasCorrectArguments(InvocationExpressionSyntax invocation) =>\n        invocation.HasExactlyNArguments(1)\n        && invocation.ArgumentList.Arguments[0].Expression is { } literal\n        && literal.IsKind(SyntaxKind.StringLiteralExpression)\n        && ((LiteralExpressionSyntax)literal).Token.ValueText.Length == 1;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UseCharOverloadOfStringMethodsCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[ExportCodeFixProvider(LanguageNames.CSharp)]\npublic sealed class UseCharOverloadOfStringMethodsCodeFix : SonarCodeFix\n{\n    private const string Title = \"Convert to char.\";\n    public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(UseCharOverloadOfStringMethods.DiagnosticId);\n\n    protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n    {\n        var diagnostic = context.Diagnostics.First();\n        if (root.FindNode(diagnostic.Location.SourceSpan) is { Parent: { Parent: InvocationExpressionSyntax invocation } }\n            && invocation.ArgumentList.Arguments[0].Expression is LiteralExpressionSyntax node)\n        {\n            context.RegisterCodeFix(\n                Title,\n                c => Task.FromResult(context.Document.WithSyntaxRoot(root.ReplaceNode(node, Convert(node)))),\n                context.Diagnostics);\n        }\n        return Task.CompletedTask;\n    }\n\n    private static LiteralExpressionSyntax Convert(LiteralExpressionSyntax node) =>\n        LiteralExpression(SyntaxKind.CharacterLiteralExpression, Literal(node.Token.ValueText[0]));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UseConstantLoggingTemplate.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class UseConstantLoggingTemplate : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S2629\";\n    private const string MessageFormat = \"{0}\";\n    private const string OnUsingStringInterpolation = \"Don't use string interpolation in logging message templates.\";\n    private const string OnUsingStringFormat = \"Don't use String.Format in logging message templates.\";\n    private const string OnUsingStringConcatenation = \"Don't use string concatenation in logging message templates.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    private static readonly ImmutableDictionary<SyntaxKind, string> Messages = new Dictionary<SyntaxKind, string>\n    {\n        {SyntaxKind.AddExpression, OnUsingStringConcatenation},\n        {SyntaxKind.InterpolatedStringExpression, OnUsingStringInterpolation},\n        {SyntaxKind.InvocationExpression, OnUsingStringFormat},\n    }.ToImmutableDictionary();\n\n    private static readonly ImmutableArray<KnownType> LoggerTypes = ImmutableArray.Create(\n        KnownType.Castle_Core_Logging_ILogger,\n        KnownType.log4net_ILog,\n        KnownType.log4net_Util_ILogExtensions,\n        KnownType.Microsoft_Extensions_Logging_LoggerExtensions,\n        KnownType.NLog_ILogger,\n        KnownType.NLog_ILoggerBase,\n        KnownType.NLog_ILoggerExtensions,\n        KnownType.Serilog_ILogger,\n        KnownType.Serilog_Log);\n\n    private static readonly ImmutableHashSet<string> LoggerMethodNames = ImmutableHashSet.Create(\n        \"ConditionalDebug\",\n        \"ConditionalTrace\",\n        \"Debug\",\n        \"DebugFormat\",\n        \"Error\",\n        \"ErrorFormat\",\n        \"Fatal\",\n        \"FatalFormat\",\n        \"Info\",\n        \"InfoFormat\",\n        \"Information\",\n        \"Log\",\n        \"LogCritical\",\n        \"LogDebug\",\n        \"LogError\",\n        \"LogFormat\",\n        \"LogInformation\",\n        \"LogTrace\",\n        \"LogWarning\",\n        \"Trace\",\n        \"TraceFormat\",\n        \"Verbose\",\n        \"Warn\",\n        \"WarnFormat\",\n        \"Warning\");\n\n    private static readonly ImmutableHashSet<string> LogMessageParameterNames = ImmutableHashSet.Create(\n        \"format\",\n        \"message\",\n        \"messageTemplate\");\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n        {\n            var invocation = (InvocationExpressionSyntax)c.Node;\n            if (LoggerMethodNames.Contains(invocation.GetName())\n                && c.Model.GetSymbolInfo(invocation).Symbol is IMethodSymbol method\n                && !IsLog4NetExceptionMethod(method)\n                && LoggerTypes.Any(x => x.Matches(method.ContainingType))\n                && method.Parameters.FirstOrDefault(x => LogMessageParameterNames.Contains(x.Name)) is { } messageParameter\n                && ArgumentValue(invocation, method, messageParameter) is { } argumentValue\n                && InvalidSyntaxNode(argumentValue, c.Model) is { } invalidNode)\n            {\n                c.ReportIssue(Rule, invalidNode, Messages[invalidNode.Kind()]);\n            }\n        },\n        SyntaxKind.InvocationExpression);\n\n    private static CSharpSyntaxNode ArgumentValue(InvocationExpressionSyntax invocation, IMethodSymbol method, IParameterSymbol parameter)\n    {\n        if (invocation.ArgumentList.Arguments.FirstOrDefault(x => x.NameColon?.GetName() == parameter.Name) is { } argument)\n        {\n            return argument.Expression;\n        }\n        else\n        {\n            var paramIndex = method.Parameters.IndexOf(parameter);\n            return invocation.ArgumentList.Arguments[paramIndex].Expression;\n        }\n    }\n\n    private static bool IsLog4NetExceptionMethod(IMethodSymbol method) =>\n        method.ContainingType.Is(KnownType.log4net_ILog) && method.Parameters.Any(x => x.Type.Is(KnownType.System_Exception));\n\n    private static SyntaxNode InvalidSyntaxNode(SyntaxNode messageArgument, SemanticModel model) =>\n        messageArgument.DescendantNodesAndSelf().FirstOrDefault(x =>\n            (x as InterpolatedStringExpressionSyntax is { } interpolatedString && !interpolatedString.HasConstantValue(model))\n            || (x is BinaryExpressionSyntax { RawKind: (int)SyntaxKind.AddExpression } concatenation && !AllMembersAreConstantStrings(concatenation, model))\n            || IsStringFormatInvocation(x, model));\n\n    private static bool AllMembersAreConstantStrings(BinaryExpressionSyntax addExpression, SemanticModel model) =>\n        IsConstantStringOrConcatenation(addExpression.Left, model) && IsConstantStringOrConcatenation(addExpression.Right, model);\n\n    private static bool IsConstantStringOrConcatenation(SyntaxNode node, SemanticModel model) =>\n        node.Kind() == SyntaxKind.StringLiteralExpression\n        || (node as InterpolatedStringExpressionSyntax is { } interpolatedString && interpolatedString.HasConstantValue(model))\n        || (node.Kind() == SyntaxKind.IdentifierName && model.GetSymbolInfo(node).Symbol is IFieldSymbol { HasConstantValue: true } or ILocalSymbol { HasConstantValue: true})\n        || (node is BinaryExpressionSyntax { RawKind: (int)SyntaxKind.AddExpression } concatenation\n            && AllMembersAreConstantStrings(concatenation, model));\n\n    private static bool IsStringFormatInvocation(SyntaxNode node, SemanticModel model) =>\n        node is InvocationExpressionSyntax invocation\n        && node.GetName() == \"Format\"\n        && model.GetSymbolInfo(invocation).Symbol is IMethodSymbol method\n        && KnownType.System_String.Matches(method.ContainingType);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UseConstantsWhereAppropriate.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class UseConstantsWhereAppropriate : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S3962\";\n        private const string MessageFormat = \"Replace this 'static readonly' declaration with 'const'.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        private static readonly ImmutableArray<KnownType> RelevantTypes =\n            ImmutableArray.Create(\n                KnownType.System_Boolean,\n                KnownType.System_Byte,\n                KnownType.System_SByte,\n                KnownType.System_Char,\n                KnownType.System_Decimal,\n                KnownType.System_Double,\n                KnownType.System_Single,\n                KnownType.System_Int32,\n                KnownType.System_UInt32,\n                KnownType.System_Int64,\n                KnownType.System_UInt64,\n                KnownType.System_Int16,\n                KnownType.System_UInt16,\n                KnownType.System_String\n            );\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var fieldDeclaration = (FieldDeclarationSyntax)c.Node;\n                    var firstVariableWithInitialization = fieldDeclaration.Declaration.Variables\n                        .FirstOrDefault(v => v.Initializer != null);\n                    if (firstVariableWithInitialization == null)\n                    {\n                        return;\n                    }\n\n                    var fieldSymbol = c.Model.GetDeclaredSymbol(firstVariableWithInitialization)\n                        as IFieldSymbol;\n                    if (!IsFieldRelevant(fieldSymbol))\n                    {\n                        return;\n                    }\n\n                    var constValue = c.Model.GetConstantValue(\n                        firstVariableWithInitialization.Initializer.Value);\n                    if (!constValue.HasValue)\n                    {\n                        return;\n                    }\n\n                    c.ReportIssue(rule, firstVariableWithInitialization.Identifier);\n                },\n                SyntaxKind.FieldDeclaration);\n        }\n\n        private static bool IsFieldRelevant(IFieldSymbol fieldSymbol)\n        {\n            return fieldSymbol != null &&\n                   fieldSymbol.IsStatic &&\n                   fieldSymbol.IsReadOnly &&\n                   !fieldSymbol.IsPubliclyAccessible() &&\n                   fieldSymbol.Type.IsAny(RelevantTypes);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UseCurlyBraces.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class UseCurlyBraces : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S121\";\n        private const string MessageFormat = \"Add curly braces around the nested statement(s) in this '{0}' block.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        private sealed class CheckedKind\n        {\n            public SyntaxKind Kind { get; set; }\n            public string Value { get; set; }\n            public Func<SyntaxNode, bool> Validator { get; set; }\n            public Func<SyntaxNode, Location> IssueReportLocation { get; set; }\n        }\n\n        private static readonly ImmutableList<CheckedKind> CheckedKinds = ImmutableList.Create(\n            new CheckedKind\n            {\n                Kind = SyntaxKind.IfStatement,\n                Value = \"if\",\n                Validator = node => ((IfStatementSyntax)node).Statement.IsKind(SyntaxKind.Block),\n                IssueReportLocation = node => ((IfStatementSyntax)node).IfKeyword.GetLocation()\n            },\n            new CheckedKind\n            {\n                Kind = SyntaxKind.ElseClause,\n                Value = \"else\",\n                Validator =\n                    node =>\n                    {\n                        var statement = ((ElseClauseSyntax)node).Statement;\n                        return statement.IsKind(SyntaxKind.IfStatement) || statement.IsKind(SyntaxKind.Block);\n                    },\n                IssueReportLocation = node => ((ElseClauseSyntax)node).ElseKeyword.GetLocation()\n            },\n            new CheckedKind\n            {\n                Kind = SyntaxKind.ForStatement,\n                Value = \"for\",\n                Validator = node => ((ForStatementSyntax)node).Statement.IsKind(SyntaxKind.Block),\n                IssueReportLocation = node => ((ForStatementSyntax)node).ForKeyword.GetLocation()\n            },\n            new CheckedKind\n            {\n                Kind = SyntaxKind.ForEachStatement,\n                Value = \"foreach\",\n                Validator = node => ((ForEachStatementSyntax)node).Statement.IsKind(SyntaxKind.Block),\n                IssueReportLocation = node => ((ForEachStatementSyntax)node).ForEachKeyword.GetLocation()\n            },\n            new CheckedKind\n            {\n                Kind = SyntaxKind.DoStatement,\n                Value = \"do\",\n                Validator = node => ((DoStatementSyntax)node).Statement.IsKind(SyntaxKind.Block),\n                IssueReportLocation = node => ((DoStatementSyntax)node).DoKeyword.GetLocation()\n            },\n            new CheckedKind\n            {\n                Kind = SyntaxKind.WhileStatement,\n                Value = \"while\",\n                Validator = node => ((WhileStatementSyntax)node).Statement.IsKind(SyntaxKind.Block),\n                IssueReportLocation = node => ((WhileStatementSyntax)node).WhileKeyword.GetLocation()\n            });\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var checkedKind = CheckedKinds.Single(e => c.Node.IsKind(e.Kind));\n\n                    if (!checkedKind.Validator(c.Node))\n                    {\n                        c.ReportIssue(rule, checkedKind.IssueReportLocation(c.Node), checkedKind.Value);\n                    }\n                },\n                CheckedKinds.Select(e => e.Kind).ToArray());\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UseDateTimeOffsetInsteadOfDateTime.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class UseDateTimeOffsetInsteadOfDateTime : UseDateTimeOffsetInsteadOfDateTimeBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override string[] ValidNames { get; } = new[] { \"DateTime\" };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UseFindSystemTimeZoneById.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class UseFindSystemTimeZoneById : UseFindSystemTimeZoneByIdBase<SyntaxKind, InvocationExpressionSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UseGenericEventHandlerInstances.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class UseGenericEventHandlerInstances : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S3908\";\n        private const string MessageFormat = \"Refactor this delegate to use 'System.EventHandler<TEventArgs>'.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        private static readonly ImmutableArray<KnownType> allowedTypes =\n            ImmutableArray.Create(\n                KnownType.System_EventHandler,\n                KnownType.System_EventHandler_TEventArgs\n            );\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n               c =>\n               {\n                   var eventField = (EventFieldDeclarationSyntax)c.Node;\n                   var eventFirstVariable = eventField.Declaration.Variables.FirstOrDefault();\n\n                   if (eventFirstVariable != null)\n                   {\n                       AnalyzeEventType(c, eventFirstVariable, eventField.Declaration.Type.GetLocation);\n                   }\n               }, SyntaxKind.EventFieldDeclaration);\n\n            context.RegisterNodeAction(\n               c =>\n               {\n                   var eventDeclaration = (EventDeclarationSyntax)c.Node;\n                   AnalyzeEventType(c, eventDeclaration, eventDeclaration.Type.GetLocation);\n               }, SyntaxKind.EventDeclaration);\n        }\n\n        private static void AnalyzeEventType(SonarSyntaxNodeReportingContext analysisContext, SyntaxNode eventNode,\n            Func<Location> getLocationToReportOn)\n        {\n\n            if (analysisContext.Model.GetDeclaredSymbol(eventNode) is IEventSymbol eventSymbol &&\n                !eventSymbol.IsOverride &&\n                eventSymbol.InterfaceMembers().IsEmpty() &&\n                (eventSymbol.Type as INamedTypeSymbol)?.ConstructedFrom.IsAny(allowedTypes) == false)\n            {\n                analysisContext.ReportIssue(rule, getLocationToReportOn());\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UseGenericWithRefParameters.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class UseGenericWithRefParameters : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S4047\";\n    private const string MessageFormat = \"Make this method generic and replace the 'object' parameter with a type parameter.\";\n    private const string SecondaryMessage = \"Replace this parameter with a type parameter.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var methodDeclaration = (MethodDeclarationSyntax)c.Node;\n                var methodSymbol = c.Model.GetDeclaredSymbol(methodDeclaration);\n\n                if (methodSymbol is null ||\n                    methodDeclaration.Identifier.IsMissing)\n                {\n                    return;\n                }\n\n                var refObjectParameters = methodSymbol\n                    .GetParameters()\n                    .Where(IsRefObject)\n                    .ToList();\n\n                if (refObjectParameters.Count > 0)\n                {\n                    var parameterLocations = refObjectParameters.Select(p => p.Locations.FirstOrDefault()?.ToSecondary(SecondaryMessage)).WhereNotNull();\n                    c.ReportIssue(Rule, methodDeclaration.Identifier, parameterLocations);\n                }\n            },\n            SyntaxKind.MethodDeclaration);\n\n    private static bool IsRefObject(IParameterSymbol parameter) =>\n        parameter.RefKind == RefKind.Ref &&\n        parameter.Type.Is(KnownType.System_Object);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UseIFormatProviderForParsingDateAndTime.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class UseIFormatProviderForParsingDateAndTime : UseIFormatProviderForParsingDateAndTimeBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UseIndexingInsteadOfLinqMethods.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class UseIndexingInsteadOfLinqMethods : UseIndexingInsteadOfLinqMethodsBase<SyntaxKind, InvocationExpressionSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override int GetArgumentCount(InvocationExpressionSyntax invocation) =>\n        invocation.ArgumentList.Arguments.Count;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UseLambdaParameterInConcurrentDictionary.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class UseLambdaParameterInConcurrentDictionary : UseLambdaParameterInConcurrentDictionaryBase<SyntaxKind, InvocationExpressionSyntax, ArgumentSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override SeparatedSyntaxList<ArgumentSyntax> GetArguments(InvocationExpressionSyntax invocation) =>\n         invocation.ArgumentList.Arguments;\n\n    protected override bool IsLambdaAndContainsIdentifier(ArgumentSyntax argument, string keyName) =>\n        argument.Expression switch\n        {\n            SimpleLambdaExpressionSyntax simpleLambda =>\n                !simpleLambda.Parameter.GetName().Equals(keyName)\n                && IsContainingValidIdentifier(simpleLambda.Body, keyName),\n            ParenthesizedLambdaExpressionSyntax parentesizedLambda =>\n                !parentesizedLambda.ParameterList.Parameters.Any(x => x.GetName().Equals(keyName))\n                && IsContainingValidIdentifier(parentesizedLambda.Body, keyName),\n            AnonymousMethodExpressionSyntax anonymousMethod =>\n                !anonymousMethod.ParameterList.Parameters.Any(x => x.GetName().Equals(keyName))\n                && IsContainingValidIdentifier(anonymousMethod.Block, keyName),\n            _ => false\n        };\n\n    protected override bool TryGetKeyName(ArgumentSyntax argument, out string keyName)\n    {\n        keyName = string.Empty;\n        if (argument.Expression is IdentifierNameSyntax identifier)\n        {\n            keyName = identifier.GetName();\n            return true;\n        }\n        return false;\n    }\n\n    private bool IsContainingValidIdentifier(SyntaxNode node, string keyName) =>\n        node.DescendantNodesAndSelf().OfType<IdentifierNameSyntax>().Any(p => p.GetName().Equals(keyName) && !IsContainedInNameOfInvocation(p));\n\n    private bool IsContainedInNameOfInvocation(IdentifierNameSyntax identifier) =>\n        identifier.Parent is ArgumentSyntax { Parent: ArgumentListSyntax { Parent: InvocationExpressionSyntax { Expression: IdentifierNameSyntax expression } } }\n        && expression.NameIs(\"nameof\");\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UseNumericLiteralSeparator.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class UseNumericLiteralSeparator : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S2148\";\n        private const string MessageFormat = \"Add underscores to this numeric value for readability.\";\n\n        private const int BinaryMinimumDigits = 9 + 2; // +2 for 0b\n        private const int HexadecimalMinimumDigits = 9 + 2; // +2 for 0x\n        private const int DecimalMinimumDigits = 6;\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    if (!c.Compilation.IsAtLeastLanguageVersion(LanguageVersionEx.CSharp7))\n                    {\n                        return;\n                    }\n\n                    var numericLiteral = (LiteralExpressionSyntax)c.Node;\n\n                    if (numericLiteral.Token.Text.IndexOf('_') < 0 &&\n                        ShouldHaveSeparator(numericLiteral))\n                    {\n                        c.ReportIssue(rule, numericLiteral);\n                    }\n                },\n                SyntaxKind.NumericLiteralExpression);\n        }\n\n        private static bool ShouldHaveSeparator(LiteralExpressionSyntax numericLiteral)\n        {\n            if (numericLiteral.Token.Text.StartsWith(\"0x\"))\n            {\n                return numericLiteral.Token.Text.Length > HexadecimalMinimumDigits;\n            }\n\n            if (numericLiteral.Token.Text.StartsWith(\"0b\"))\n            {\n                return numericLiteral.Token.Text.Length > BinaryMinimumDigits;\n            }\n\n            var indexOfDot = numericLiteral.Token.Text.IndexOf('.');\n            var beforeDotPartLength = indexOfDot < 0\n                ? numericLiteral.Token.Text.Length\n                : numericLiteral.Token.Text.Remove(indexOfDot).Length;\n\n            return beforeDotPartLength > DecimalMinimumDigits;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UseParamsForVariableArguments.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class UseParamsForVariableArguments : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S4061\";\n        private const string MessageFormat = \"Use the 'params' keyword instead of '__arglist'.\";\n\n        private static readonly DiagnosticDescriptor Rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    if (c.Node.ParameterList() is { Parameters: { Count: > 0 and var count } parameters }\n                        && parameters[count - 1].Identifier.IsKind(SyntaxKind.ArgListKeyword)\n                        && CheckModifiers(c.Node)\n                        && c.Node.GetIdentifier() is { IsMissing: false } identifier\n                        && MethodSymbol(c.Node, c.Model) is { } methodSymbol\n                        && !methodSymbol.IsOverride\n                        && methodSymbol.IsPubliclyAccessible()\n                        && methodSymbol.InterfaceMembers().IsEmpty())\n                    {\n                        c.ReportIssue(Rule, identifier);\n                    }\n                },\n                SyntaxKind.MethodDeclaration,\n                SyntaxKind.ConstructorDeclaration,\n                SyntaxKind.ClassDeclaration,\n                SyntaxKind.StructDeclaration,\n                SyntaxKindEx.RecordDeclaration,\n                SyntaxKindEx.RecordStructDeclaration);\n\n        private static IMethodSymbol MethodSymbol(SyntaxNode node, SemanticModel semanticModel) =>\n            node is TypeDeclarationSyntax type\n                ? type.PrimaryConstructor(semanticModel)\n                : semanticModel.GetDeclaredSymbol(node) as IMethodSymbol;\n\n        private static bool CheckModifiers(SyntaxNode node) =>\n            node is not BaseMethodDeclarationSyntax method\n            || !method.Modifiers.Any(SyntaxKind.ExternKeyword);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UseShortCircuitingOperator.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class UseShortCircuitingOperator : UseShortCircuitingOperatorBase<SyntaxKind, BinaryExpressionSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n        protected override string GetSuggestedOpName(BinaryExpressionSyntax node) =>\n            OperatorNames[ShortCircuitingAlternative[node.Kind()]];\n\n        protected override string GetCurrentOpName(BinaryExpressionSyntax node) =>\n            OperatorNames[node.Kind()];\n\n        protected override SyntaxToken GetOperator(BinaryExpressionSyntax expression) =>\n            expression.OperatorToken;\n\n        internal static readonly IDictionary<SyntaxKind, SyntaxKind> ShortCircuitingAlternative = new Dictionary<SyntaxKind, SyntaxKind>\n        {\n            { SyntaxKind.BitwiseAndExpression, SyntaxKind.LogicalAndExpression },\n            { SyntaxKind.BitwiseOrExpression, SyntaxKind.LogicalOrExpression }\n        }.ToImmutableDictionary();\n\n        private static readonly IDictionary<SyntaxKind, string> OperatorNames = new Dictionary<SyntaxKind, string>\n        {\n            { SyntaxKind.BitwiseAndExpression, \"&\" },\n            { SyntaxKind.BitwiseOrExpression, \"|\" },\n            { SyntaxKind.LogicalAndExpression, \"&&\" },\n            { SyntaxKind.LogicalOrExpression, \"||\" },\n        }.ToImmutableDictionary();\n\n        protected override ImmutableArray<SyntaxKind> SyntaxKindsOfInterest => ImmutableArray.Create<SyntaxKind>(\n            SyntaxKind.BitwiseAndExpression,\n            SyntaxKind.BitwiseOrExpression);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UseShortCircuitingOperatorCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public class UseShortCircuitingOperatorCodeFix : UseShortCircuitingOperatorCodeFixBase<SyntaxKind, BinaryExpressionSyntax>\n    {\n        internal override bool IsCandidateExpression(BinaryExpressionSyntax expression)\n        {\n            return UseShortCircuitingOperator.ShortCircuitingAlternative.ContainsKey(expression.Kind());\n        }\n\n        protected override BinaryExpressionSyntax GetShortCircuitingExpressionNode(BinaryExpressionSyntax expression)\n        {\n            var alternativeKind = expression.IsKind(SyntaxKind.BitwiseAndExpression)\n                ? SyntaxKind.LogicalAndExpression\n                : SyntaxKind.LogicalOrExpression;\n\n            return SyntaxFactory.BinaryExpression(alternativeKind, expression.Left, expression.Right);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UseStringCreate.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class UseStringCreate : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S6618\";\n    private const string MessageFormat = \"\"\"Use \"string.Create\" instead of \"FormattableString\".\"\"\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    private ImmutableArray<string> methodNames = ImmutableArray.Create(\n        \"CurrentCulture\",\n        \"Invariant\");\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(c =>\n        {\n            // The string.Create method with IFormatProvider parameter is only available from .NET 6.0\n            if (!c.Compilation.IsMemberAvailable<IMethodSymbol>(\n                KnownType.System_String,\n                \"Create\",\n                method => method.Parameters.Any(x => KnownType.System_IFormatProvider.Matches(x.Type))))\n            {\n                return;\n            }\n\n            c.RegisterNodeAction(c =>\n            {\n                var node = (InvocationExpressionSyntax)c.Node;\n\n                if (methodNames.Any(x => NameIsEqual(node, x))\n                    && node.Operands().Left is { } left\n                    && NameIsEqual(left, nameof(FormattableString))\n                    && node.HasExactlyNArguments(1)\n                    && node.ArgumentList.Arguments[0].Expression is InterpolatedStringExpressionSyntax\n                    && c.Model.GetTypeInfo(left).Type.Is(KnownType.System_FormattableString))\n                {\n                    c.ReportIssue(Rule, node.GetIdentifier()?.GetLocation());\n                }\n            },\n            SyntaxKind.InvocationExpression);\n        });\n\n    private static bool NameIsEqual(SyntaxNode node, string name) =>\n        node.GetName().Equals(name, StringComparison.Ordinal);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UseStringIsNullOrEmpty.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class UseStringIsNullOrEmpty : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S3256\";\n        private const string MessageFormat =\n            \"Use 'string.IsNullOrEmpty()' instead of comparing to empty string.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        private const string EqualsName = nameof(string.Equals);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var invocationExpression = (InvocationExpressionSyntax)c.Node;\n\n                    if (invocationExpression.Expression is MemberAccessExpressionSyntax memberAccessExpression\n                        && memberAccessExpression.Name.Identifier.ValueText == EqualsName\n                        && invocationExpression.ArgumentList?.Arguments.FirstOrDefault() is { } firstArgument\n                        && memberAccessExpression.IsMemberAccessOnKnownType(EqualsName, KnownType.System_String, c.Model))\n                    {\n                        // x.Equals(value), where x is string.Empty, \"\" or const \"\", and value is some string\n                        if (IsStringIdentifier(firstArgument.Expression, c.Model)\n                            && IsConstantEmptyString(memberAccessExpression.Expression, c.Model))\n                        {\n                            c.ReportIssue(rule, invocationExpression, MessageFormat);\n                            return;\n                        }\n\n                        // value.Equals(x), where x is string.Empty, \"\" or const \"\", and value is some string\n                        if (IsStringIdentifier(memberAccessExpression.Expression, c.Model)\n                            && IsConstantEmptyString(firstArgument.Expression, c.Model))\n                        {\n                            c.ReportIssue(rule, invocationExpression, MessageFormat);\n                        }\n                    }\n                },\n                SyntaxKind.InvocationExpression);\n        }\n\n        private static bool IsStringIdentifier(ExpressionSyntax expression, SemanticModel semanticModel)\n        {\n            if (!(expression is IdentifierNameSyntax identifierNameExpression))\n            {\n                return false;\n            }\n\n            var expressionType = semanticModel.GetTypeInfo(identifierNameExpression).Type;\n\n            return expressionType != null && expressionType.Is(KnownType.System_String);\n        }\n\n        private static bool IsConstantEmptyString(ExpressionSyntax expression, SemanticModel semanticModel) =>\n            IsStringEmptyLiteral(expression)\n            || IsStringEmptyConst(expression, semanticModel)\n            || expression.IsStringEmpty(semanticModel);\n\n        private static bool IsStringEmptyConst(ExpressionSyntax expression, SemanticModel semanticModel)\n        {\n            var constValue = semanticModel.GetConstantValue(expression);\n            return constValue.HasValue\n                && constValue.Value is string stringConstValue && stringConstValue == string.Empty;\n        }\n\n        private static bool IsStringEmptyLiteral(ExpressionSyntax expression)\n        {\n            var literalExpression = expression as LiteralExpressionSyntax;\n            return literalExpression?.Token.ValueText == string.Empty;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UseTestableTimeProvider.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class UseTestableTimeProvider : UseTestableTimeProviderBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override bool Ignore(SyntaxNode ancestor, SemanticModel semanticModel) =>\n        ancestor is XmlCrefAttributeSyntax\n        || (ancestor is InvocationExpressionSyntax invocation && invocation.IsNameof(semanticModel));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UseTrueForAll.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class UseTrueForAll : UseTrueForAllBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UseUnixEpoch.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class UseUnixEpoch : UseUnixEpochBase<SyntaxKind, LiteralExpressionSyntax, MemberAccessExpressionSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override bool IsDateTimeKindUtc(MemberAccessExpressionSyntax memberAccess) =>\n        memberAccess.NameIs(\"Utc\") && memberAccess.Expression.NameIs(\"DateTimeKind\");\n\n    protected override bool IsGregorianCalendar(SyntaxNode node) =>\n        node is ObjectCreationExpressionSyntax objectCreation && objectCreation.Type.NameIs(\"GregorianCalendar\");\n\n    protected override bool IsZeroTimeOffset(SyntaxNode node) =>\n        node switch\n        {\n            MemberAccessExpressionSyntax memberAccess => memberAccess.NameIs(\"Zero\") && memberAccess.Expression.NameIs(\"TimeSpan\"),\n            ObjectCreationExpressionSyntax objectCreation => objectCreation.Type.NameIs(\"TimeSpan\")\n                                                             && objectCreation?.ArgumentList != null && objectCreation.ArgumentList.Arguments.Count is 1\n                                                             && objectCreation.ArgumentList.Arguments[0].Expression is LiteralExpressionSyntax literal\n                                                             && IsValueEqualTo(literal, 0),\n            _ => false\n        };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UseUnixEpochCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class UseUnixEpochCodeFix : UseUnixEpochCodeFixBase<SyntaxKind>\n    {\n        protected override SyntaxNode ReplaceConstructorWithField(SyntaxNode root, SyntaxNode node, SonarCodeFixContext context)\n        {\n            ExpressionSyntax typeNode;\n            if (node.IsKind(SyntaxKindEx.ImplicitObjectCreationExpression))\n            {\n                var semanticModel = context.Document.GetSemanticModelAsync(context.Cancel).ConfigureAwait(false).GetAwaiter().GetResult();\n                typeNode = SyntaxFactory.IdentifierName(semanticModel.GetTypeInfo(node).Type.Name);\n            }\n            else\n            {\n                typeNode = ((ObjectCreationExpressionSyntax)node).Type;\n            }\n\n            var leadingTrivia = node.GetLeadingTrivia();\n            var trailingTrivia = node.GetTrailingTrivia();\n            return root.ReplaceNode(node,\n                SyntaxFactory.MemberAccessExpression(\n                    SyntaxKind.SimpleMemberAccessExpression,\n                    typeNode,\n                    SyntaxFactory.IdentifierName(\"UnixEpoch\")).WithLeadingTrivia(leadingTrivia).WithTrailingTrivia(trailingTrivia));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UseUriInsteadOfString.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class UseUriInsteadOfString : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticIdRuleS3994 = \"S3994\";\n    private const string DiagnosticIdRuleS3995 = \"S3995\";\n    private const string DiagnosticIdRuleS3996 = \"S3996\";\n    private const string DiagnosticIdRuleS3997 = \"S3997\";\n    private const string DiagnosticIdRuleS4005 = \"S4005\";\n    private const string MessageFormatRuleS3994 = \"Either change this parameter type to 'System.Uri' or provide an overload which takes a 'System.Uri' parameter.\";\n    private const string MessageFormatRuleS3995 = \"Change this return type to 'System.Uri'.\";\n    private const string MessageFormatRuleS3996 = \"Change the '{0}' property type to 'System.Uri'.\";\n    private const string MessageFormatRuleS3997 = \"Refactor this method so it invokes the overload accepting a 'System.Uri' parameter.\";\n    private const string MessageFormatRuleS4005 = \"Call the overload that takes a 'System.Uri' as an argument instead.\";\n\n    private static readonly DiagnosticDescriptor RuleS3994 = DescriptorFactory.Create(DiagnosticIdRuleS3994, MessageFormatRuleS3994);\n    private static readonly DiagnosticDescriptor RuleS3995 = DescriptorFactory.Create(DiagnosticIdRuleS3995, MessageFormatRuleS3995);\n    private static readonly DiagnosticDescriptor RuleS3996 = DescriptorFactory.Create(DiagnosticIdRuleS3996, MessageFormatRuleS3996);\n    private static readonly DiagnosticDescriptor RuleS3997 = DescriptorFactory.Create(DiagnosticIdRuleS3997, MessageFormatRuleS3997);\n    private static readonly DiagnosticDescriptor RuleS4005 = DescriptorFactory.Create(DiagnosticIdRuleS4005, MessageFormatRuleS4005);\n    private static readonly ISet<string> UrlNameVariants = new HashSet<string> { \"URI\", \"URL\", \"URN\" };\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(RuleS3994, RuleS3995, RuleS3996, RuleS3997, RuleS4005);\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(VerifyMethodDeclaration, SyntaxKind.MethodDeclaration, SyntaxKind.ConstructorDeclaration);\n\n        context.RegisterNodeAction(VerifyPropertyDeclaration, SyntaxKind.PropertyDeclaration);\n\n        context.RegisterNodeAction(\n            VerifyInvocationAndCreation,\n            SyntaxKind.InvocationExpression,\n            SyntaxKind.ObjectCreationExpression,\n            SyntaxKindEx.ImplicitObjectCreationExpression);\n\n        context.RegisterNodeAction(\n            VerifyRecordDeclaration,\n            SyntaxKindEx.RecordDeclaration,\n            SyntaxKindEx.RecordStructDeclaration);\n    }\n\n    private static void VerifyMethodDeclaration(SonarSyntaxNodeReportingContext context)\n    {\n        var methodDeclaration = (BaseMethodDeclarationSyntax)context.Node;\n        var methodSymbol = context.Model.GetDeclaredSymbol(methodDeclaration);\n        if (methodSymbol is null || methodSymbol.IsOverride)\n        {\n            return;\n        }\n\n        VerifyReturnType(context, methodDeclaration, methodSymbol);\n        var stringUrlParams = StringUrlParamIndexes(methodSymbol);\n        if (!stringUrlParams.Any())\n        {\n            return;\n        }\n\n        var methodOverloads = FindOverloadsThatUseUriTypeInPlaceOfString(methodSymbol, stringUrlParams).ToHashSet();\n        if (methodOverloads.Any())\n        {\n            if (!methodDeclaration.IsKind(SyntaxKind.ConstructorDeclaration)\n                && !methodDeclaration.ContainsMethodInvocation(context.Model, x => true, x => methodOverloads.Contains(x)))\n            {\n                context.ReportIssue(RuleS3997, methodDeclaration.FindIdentifierLocation());\n            }\n        }\n        else\n        {\n            foreach (var paramIdx in stringUrlParams)\n            {\n                context.ReportIssue(RuleS3994, methodDeclaration.ParameterList.Parameters[paramIdx].Type);\n            }\n        }\n    }\n\n    private static void VerifyPropertyDeclaration(SonarSyntaxNodeReportingContext context)\n    {\n        var propertyDeclaration = (PropertyDeclarationSyntax)context.Node;\n        var propertySymbol = context.Model.GetDeclaredSymbol(propertyDeclaration);\n        if (propertySymbol.Type.Is(KnownType.System_String)\n            && !propertySymbol.IsOverride\n            && NameContainsUri(propertySymbol.Name))\n        {\n            context.ReportIssue(RuleS3996, propertyDeclaration.Type, propertyDeclaration.GetName());\n        }\n    }\n\n    private static void VerifyRecordDeclaration(SonarSyntaxNodeReportingContext context)\n    {\n        var declaration = (RecordDeclarationSyntaxWrapper)context.Node;\n        if (!context.IsRedundantPositionalRecordContext() && StringUriParams(declaration.ParameterList, context.Model) is { } stringUriParams)\n        {\n            foreach (var param in stringUriParams)\n            {\n                context.ReportIssue(RuleS3996, param, param.GetName());\n            }\n        }\n    }\n\n    private static IEnumerable<ParameterSyntax> StringUriParams(BaseParameterListSyntax parameterList, SemanticModel model) =>\n        parameterList?.Parameters.Where(x => NameContainsUri(x.Identifier.Text) && model.GetDeclaredSymbol(x).IsType(KnownType.System_String));\n\n    private static void VerifyInvocationAndCreation(SonarSyntaxNodeReportingContext context)\n    {\n        if (context.Model.GetSymbolInfo(context.Node).Symbol is IMethodSymbol invokedMethodSymbol\n            && !invokedMethodSymbol.IsInType(KnownType.System_Uri)\n            && StringUrlParamIndexes(invokedMethodSymbol) is { Count: not 0 } stringUrlParams\n            && FindOverloadsThatUseUriTypeInPlaceOfString(invokedMethodSymbol, stringUrlParams).Any())\n        {\n            context.ReportIssue(RuleS4005, context.Node);\n        }\n    }\n\n    private static void VerifyReturnType(SonarSyntaxNodeReportingContext context, BaseMethodDeclarationSyntax methodDeclaration, IMethodSymbol methodSymbol)\n    {\n        if ((methodDeclaration as MethodDeclarationSyntax)?.ReturnType?.GetLocation() is { } returnTypeLocation\n            && methodSymbol.ReturnType.Is(KnownType.System_String)\n            && NameContainsUri(methodSymbol.Name))\n        {\n            context.ReportIssue(RuleS3995, returnTypeLocation);\n        }\n    }\n\n    private static IEnumerable<IMethodSymbol> FindOverloadsThatUseUriTypeInPlaceOfString(IMethodSymbol originalMethodSymbol, ISet<int> paramIdx)\n    {\n        if (paramIdx.Any())\n        {\n            foreach (var methodSymbol in OtherMethodOverrides(originalMethodSymbol))\n            {\n                if (methodSymbol.Parameters.Where((x, index) => UsesUriInPlaceOfStringUri(x, originalMethodSymbol.Parameters[index], paramIdx.Contains(index))).Any())\n                {\n                    yield return methodSymbol;\n                }\n            }\n        }\n    }\n\n    private static ISet<int> StringUrlParamIndexes(IMethodSymbol methodSymbol)\n    {\n        var ret = new HashSet<int>();\n        for (var i = 0; i < methodSymbol.Parameters.Length; i++)\n        {\n            var parameter = methodSymbol.Parameters[i];\n            if (parameter.Type.Is(KnownType.System_String) && NameContainsUri(parameter.Name))\n            {\n                ret.Add(i);\n            }\n        }\n        return ret;\n    }\n\n    private static IEnumerable<IMethodSymbol> OtherMethodOverrides(IMethodSymbol methodSymbol) =>\n        methodSymbol.ContainingType\n            .GetMembers(methodSymbol.Name)\n            .OfType<IMethodSymbol>()\n            .Where(x => x.Parameters.Length == methodSymbol.Parameters.Length && !x.Equals(methodSymbol));\n\n    private static bool UsesUriInPlaceOfStringUri(IParameterSymbol paramSymbol, IParameterSymbol originalParamSymbol, bool isStringUri) =>\n        isStringUri\n            ? paramSymbol.Type.Is(KnownType.System_Uri)\n            : Equals(paramSymbol, originalParamSymbol);\n\n    private static bool NameContainsUri(string name)\n    {\n        var wordsInName = name.SplitCamelCaseToWords();\n        return UrlNameVariants.Overlaps(wordsInName);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UseValueParameter.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class UseValueParameter : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S3237\";\n        private const string MessageFormat = \"Use the 'value' contextual keyword in this {0} accessor declaration.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var accessor = (AccessorDeclarationSyntax)c.Node;\n\n                    if ((accessor.Body == null && accessor.ExpressionBody == null)\n                        || OnlyThrows(accessor)\n                        || accessor.DescendantNodes().OfType<IdentifierNameSyntax>().Any(x => IsAccessorValue(x, c.Model)))\n                    {\n                        return;\n                    }\n\n                    var interfaceMember = c.Model.GetDeclaredSymbol(accessor).InterfaceMembers();\n                    if (interfaceMember.Any() && accessor.Body?.Statements.Count == 0) // No need to check ExpressionBody, it can't be empty\n                    {\n                        return;\n                    }\n\n                    c.ReportIssue(Rule, accessor.Keyword, GetAccessorType(accessor));\n                },\n                SyntaxKind.SetAccessorDeclaration,\n                SyntaxKindEx.InitAccessorDeclaration,\n                SyntaxKind.RemoveAccessorDeclaration,\n                SyntaxKind.AddAccessorDeclaration);\n\n        private static bool OnlyThrows(AccessorDeclarationSyntax accessor) =>\n            (accessor.Body?.Statements.Count == 1 && accessor.Body.Statements[0] is ThrowStatementSyntax)\n            || ThrowExpressionSyntaxWrapper.IsInstance(accessor.ExpressionBody?.Expression);\n\n        private static bool IsAccessorValue(IdentifierNameSyntax identifier, SemanticModel semanticModel)\n        {\n            if (identifier.Identifier.ValueText != \"value\")\n            {\n                return false;\n            }\n\n            return semanticModel.GetSymbolInfo(identifier).Symbol is IParameterSymbol { IsImplicitlyDeclared: true };\n        }\n\n        private static string GetAccessorType(AccessorDeclarationSyntax accessorDeclaration) =>\n            accessorDeclaration.Parent.Parent switch\n            {\n                IndexerDeclarationSyntax _ => \"indexer set\",\n                PropertyDeclarationSyntax _ => GetPropertyAccessorKind(accessorDeclaration),\n                EventDeclarationSyntax _ => \"event\",\n                _ => null\n            };\n\n        private static string GetPropertyAccessorKind(AccessorDeclarationSyntax accessorDeclaration) =>\n            accessorDeclaration.IsKind(SyntaxKind.SetAccessorDeclaration) ? \"property set\" : \"property init\";\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UseWhereBeforeOrderBy.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class UseWhereBeforeOrderBy : UseWhereBeforeOrderByBase<SyntaxKind, InvocationExpressionSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/UseWhileLoopInstead.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class UseWhileLoopInstead : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S1264\";\n    private const string MessageFormat = \"Replace this 'for' loop with a 'while' loop.\";\n\n    private static readonly DiagnosticDescriptor rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            c =>\n            {\n                var forStatement = (ForStatementSyntax)c.Node;\n\n                if (forStatement.Declaration is null &&\n                    forStatement.Incrementors.Count == 0)\n                {\n                    c.ReportIssue(rule, forStatement.ForKeyword);\n                }\n            },\n            SyntaxKind.ForStatement);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/Utilities/AnalysisWarningAnalyzer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class AnalysisWarningAnalyzer : AnalysisWarningAnalyzerBase { }\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/Utilities/CopyPasteTokenAnalyzer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public class CopyPasteTokenAnalyzer : CopyPasteTokenAnalyzerBase<SyntaxKind>\n    {\n        private static readonly HashSet<SyntaxKind> StringKinds =\n            [\n                SyntaxKind.StringLiteralToken,\n                SyntaxKind.InterpolatedStringTextToken,\n                SyntaxKindEx.SingleLineRawStringLiteralToken,\n                SyntaxKindEx.MultiLineRawStringLiteralToken,\n                SyntaxKindEx.Utf8StringLiteralToken,\n                SyntaxKindEx.Utf8SingleLineRawStringLiteralToken,\n                SyntaxKindEx.Utf8MultiLineRawStringLiteralToken\n            ];\n\n        protected override ILanguageFacade<SyntaxKind> Language { get; } = CSharpFacade.Instance;\n\n        protected override bool IsUsingDirective(SyntaxNode node) =>\n            node is UsingDirectiveSyntax;\n\n        protected override string GetCpdValue(SyntaxToken token)\n        {\n            if (token.IsKind(SyntaxKind.NumericLiteralToken))\n            {\n                return \"$num\";\n            }\n            else if (token.IsAnyKind(StringKinds))\n            {\n                return \"$str\";\n            }\n            else if (token.IsKind(SyntaxKind.CharacterLiteralToken))\n            {\n                return \"$char\";\n            }\n            else\n            {\n                return token.Text;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/Utilities/FileMetadataAnalyzer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public class FileMetadataAnalyzer : FileMetadataAnalyzerBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language { get; } = CSharpFacade.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/Utilities/LogAnalyzer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public class LogAnalyzer : LogAnalyzerBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language { get; } = CSharpFacade.Instance;\n\n        protected override string LanguageVersion(Compilation compilation) =>\n            ((CSharpCompilation)compilation).LanguageVersion.ToString();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/Utilities/MetricsAnalyzer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Metrics;\nusing SonarAnalyzer.CSharp.Metrics;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public class MetricsAnalyzer : MetricsAnalyzerBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language { get; } = CSharpFacade.Instance;\n\n        protected override MetricsBase GetMetrics(SyntaxTree syntaxTree, SemanticModel semanticModel) =>\n            new CSharpMetrics(syntaxTree, semanticModel);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/Utilities/SymbolReferenceAnalyzer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class SymbolReferenceAnalyzer : SymbolReferenceAnalyzerBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language { get; } = CSharpFacade.Instance;\n\n    protected override SyntaxNode GetBindableParent(SyntaxToken token) =>\n        token.GetBindableParent();\n\n    protected override ReferenceInfo[] CreateDeclarationReferenceInfo(SyntaxNode node, SemanticModel model) =>\n        node switch\n        {\n            BaseTypeDeclarationSyntax typeDeclaration => [CreateDeclarationReferenceInfo(node, typeDeclaration.Identifier, model)],\n            VariableDeclarationSyntax variableDeclaration => CreateDeclarationReferenceInfo(variableDeclaration, model),\n            MethodDeclarationSyntax methodDeclaration => [CreateDeclarationReferenceInfo(node, methodDeclaration.Identifier, model)],\n            ParameterSyntax parameterSyntax => [CreateDeclarationReferenceInfo(node, parameterSyntax.Identifier, model)],\n            LocalDeclarationStatementSyntax localDeclarationStatement => CreateDeclarationReferenceInfo(localDeclarationStatement.Declaration, model),\n            PropertyDeclarationSyntax propertyDeclaration => [CreateDeclarationReferenceInfo(node, propertyDeclaration.Identifier, model)],\n            TypeParameterSyntax typeParameterSyntax => [CreateDeclarationReferenceInfo(node, typeParameterSyntax.Identifier, model)],\n            var localFunction when LocalFunctionStatementSyntaxWrapper.IsInstance(localFunction) =>\n                [CreateDeclarationReferenceInfo(node, ((LocalFunctionStatementSyntaxWrapper)localFunction).Identifier, model)],\n            var singleVariableDesignation when SingleVariableDesignationSyntaxWrapper.IsInstance(singleVariableDesignation) =>\n                [CreateDeclarationReferenceInfo(node, ((SingleVariableDesignationSyntaxWrapper)singleVariableDesignation).Identifier, model)],\n            _ => null\n        };\n\n    protected override IList<SyntaxNode> GetDeclarations(SyntaxNode node)\n    {\n        var walker = new DeclarationsFinder();\n        walker.SafeVisit(node);\n        return walker.Declarations;\n    }\n\n    private static ReferenceInfo[] CreateDeclarationReferenceInfo(VariableDeclarationSyntax declaration, SemanticModel model) =>\n        declaration.Variables.Select(x => CreateDeclarationReferenceInfo(x, x.Identifier, model)).ToArray();\n\n    private static ReferenceInfo CreateDeclarationReferenceInfo(SyntaxNode node, SyntaxToken identifier, SemanticModel model) =>\n        new(node, identifier, model.GetDeclaredSymbol(node), true);\n\n    private sealed class DeclarationsFinder : SafeCSharpSyntaxWalker\n    {\n        public readonly List<SyntaxNode> Declarations = [];\n\n        private readonly ISet<ushort> declarationKinds = new HashSet<SyntaxKind>\n        {\n            SyntaxKind.ClassDeclaration,\n            SyntaxKind.DelegateDeclaration,\n            SyntaxKind.EnumDeclaration,\n            SyntaxKind.EventDeclaration,\n            SyntaxKind.InterfaceDeclaration,\n            SyntaxKind.LocalDeclarationStatement,\n            SyntaxKind.MethodDeclaration,\n            SyntaxKind.Parameter,\n            SyntaxKind.PropertyDeclaration,\n            SyntaxKind.StructDeclaration,\n            SyntaxKind.TypeParameter,\n            SyntaxKind.VariableDeclaration,\n            SyntaxKindEx.LocalFunctionStatement,\n            SyntaxKindEx.RecordDeclaration,\n            SyntaxKindEx.RecordStructDeclaration,\n            SyntaxKindEx.SingleVariableDesignation\n        }.Cast<ushort>().ToHashSet();\n\n        public override void Visit(SyntaxNode node)\n        {\n            if (declarationKinds.Contains((ushort)node.RawKind))\n            {\n                Declarations.Add(node);\n            }\n            base.Visit(node);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/Utilities/TelemetryAnalyzer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class TelemetryAnalyzer : TelemetryAnalyzerBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language { get; } = CSharpFacade.Instance;\n\n    protected override string LanguageVersion(Compilation compilation) =>\n        ((CSharpCompilation)compilation).LanguageVersion.ToString();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/Utilities/TestMethodDeclarationsAnalyzer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class TestMethodDeclarationsAnalyzer : TestMethodDeclarationsAnalyzerBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language { get; } = CSharpFacade.Instance;\n\n    protected override IEnumerable<SyntaxNode> GetMethodDeclarations(SyntaxNode node) =>\n        node.DescendantNodes().OfType<MethodDeclarationSyntax>();\n\n    protected override IEnumerable<SyntaxNode> GetTypeDeclarations(SyntaxNode node) =>\n        node.DescendantNodes().OfType<TypeDeclarationSyntax>();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/Utilities/TokenTypeAnalyzer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Roslyn.Utilities;\nusing SonarAnalyzer.Protobuf;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public class TokenTypeAnalyzer : TokenTypeAnalyzerBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language { get; } = CSharpFacade.Instance;\n\n        protected override TokenClassifierBase GetTokenClassifier(SemanticModel semanticModel, bool skipIdentifierTokens) =>\n            new TokenClassifier(semanticModel, skipIdentifierTokens);\n\n        protected override TriviaClassifierBase GetTriviaClassifier() =>\n            new TriviaClassifier();\n\n        internal sealed class TokenClassifier : TokenClassifierBase\n        {\n            private static readonly SyntaxKind[] StringLiteralTokens =\n            {\n                SyntaxKind.StringLiteralToken,\n                SyntaxKind.CharacterLiteralToken,\n                SyntaxKindEx.SingleLineRawStringLiteralToken,\n                SyntaxKindEx.MultiLineRawStringLiteralToken,\n                SyntaxKindEx.Utf8StringLiteralToken,\n                SyntaxKindEx.Utf8SingleLineRawStringLiteralToken,\n                SyntaxKindEx.Utf8MultiLineRawStringLiteralToken,\n                SyntaxKind.InterpolatedStringStartToken,\n                SyntaxKind.InterpolatedVerbatimStringStartToken,\n                SyntaxKindEx.InterpolatedSingleLineRawStringStartToken,\n                SyntaxKindEx.InterpolatedMultiLineRawStringStartToken,\n                SyntaxKind.InterpolatedStringTextToken,\n                SyntaxKind.InterpolatedStringEndToken,\n                SyntaxKindEx.InterpolatedRawStringEndToken,\n            };\n\n            public TokenClassifier(SemanticModel semanticModel, bool skipIdentifiers) : base(semanticModel, skipIdentifiers) { }\n\n            protected override SyntaxNode GetBindableParent(SyntaxToken token) =>\n                token.GetBindableParent();\n\n            protected override bool IsIdentifier(SyntaxToken token) =>\n                token.IsKind(SyntaxKind.IdentifierToken);\n\n            protected override bool IsKeyword(SyntaxToken token) =>\n                SyntaxFacts.IsKeywordKind(token.Kind());\n\n            protected override bool IsNumericLiteral(SyntaxToken token) =>\n                token.IsKind(SyntaxKind.NumericLiteralToken);\n\n            protected override bool IsStringLiteral(SyntaxToken token) =>\n                token.IsAnyKind(StringLiteralTokens);\n\n            [PerformanceSensitive(\"https://github.com/SonarSource/sonar-dotnet/issues/7805\", AllowCaptures = false, AllowGenericEnumeration = false, AllowImplicitBoxing = false)]\n            protected override TokenTypeInfo.Types.TokenInfo ClassifyIdentifier(SyntaxToken token) =>\n                // Based on <Kind Name=\"IdentifierToken\"/> in SonarAnalyzer.CFG/ShimLayer\\Syntax.xml\n                // order by https://docs.google.com/spreadsheets/d/1hb6Oz8NE1y4kfv57npSrGEzMd7tm9gYQtI1dABOneMk\n                token.Parent switch\n                {\n                    SimpleNameSyntax x when token == x.Identifier && ClassifySimpleName(x) is { } tokenType => TokenInfo(token, tokenType),\n                    VariableDeclaratorSyntax x when token == x.Identifier => null,\n                    ParameterSyntax x when token == x.Identifier => null,\n                    MethodDeclarationSyntax x when token == x.Identifier => null,\n                    PropertyDeclarationSyntax x when token == x.Identifier => null,\n                    TypeParameterSyntax x when token == x.Identifier => TokenInfo(token, TokenType.TypeName),\n                    BaseTypeDeclarationSyntax x when token == x.Identifier => TokenInfo(token, TokenType.TypeName),\n                    ConstructorDeclarationSyntax x when token == x.Identifier => TokenInfo(token, TokenType.TypeName),\n                    FromClauseSyntax x when token == x.Identifier => null,\n                    LetClauseSyntax x when token == x.Identifier => null,\n                    JoinClauseSyntax x when token == x.Identifier => null,\n                    JoinIntoClauseSyntax x when token == x.Identifier => null,\n                    QueryContinuationSyntax x when token == x.Identifier => null,\n                    LabeledStatementSyntax x when token == x.Identifier => null,\n                    ForEachStatementSyntax x when token == x.Identifier => null,\n                    CatchDeclarationSyntax x when token == x.Identifier => null,\n                    ExternAliasDirectiveSyntax x when token == x.Identifier => null,\n                    EnumMemberDeclarationSyntax x when token == x.Identifier => null,\n                    EventDeclarationSyntax x when token == x.Identifier => null,\n                    AccessorDeclarationSyntax x when token == x.Keyword => null,\n                    DelegateDeclarationSyntax x when token == x.Identifier => TokenInfo(token, TokenType.TypeName),\n                    DestructorDeclarationSyntax x when token == x.Identifier => TokenInfo(token, TokenType.TypeName),\n                    AttributeTargetSpecifierSyntax x when token == x.Identifier => TokenInfo(token, TokenType.Keyword), // for unknown target specifier [unknown: Obsolete]\n                    // Wrapper checks. HotPath: Make sure to test for SyntaxKind to avoid Wrapper.IsInstance calls\n                    // which are slow and allocating. Check the documentation for associated SyntaxKinds and that the\n                    // node class is sealed.\n                    { RawKind: (int)SyntaxKindEx.FunctionPointerUnmanagedCallingConvention } x when token == ((FunctionPointerUnmanagedCallingConventionSyntaxWrapper)x).Name => null,\n                    { RawKind: (int)SyntaxKindEx.TupleElement } x when token == ((TupleElementSyntaxWrapper)x).Identifier => null,\n                    { RawKind: (int)SyntaxKindEx.LocalFunctionStatement } x when token == ((LocalFunctionStatementSyntaxWrapper)x).Identifier => null,\n                    { RawKind: (int)SyntaxKindEx.SingleVariableDesignation } x when token == ((SingleVariableDesignationSyntaxWrapper)x).Identifier => null,\n                    _ => base.ClassifyIdentifier(token),\n                };\n\n            [PerformanceSensitive(\"https://github.com/SonarSource/sonar-dotnet/issues/7805\", AllowCaptures = false, AllowGenericEnumeration = false, AllowImplicitBoxing = false)]\n            private TokenType? ClassifySimpleName(SimpleNameSyntax x) =>\n                IsInTypeContext(x)\n                    ? ClassifySimpleNameType(x)\n                    : ClassifySimpleNameExpression(x);\n\n            [PerformanceSensitive(\"https://github.com/SonarSource/sonar-dotnet/issues/7805\", AllowCaptures = false, AllowGenericEnumeration = false, AllowImplicitBoxing = false)]\n            private TokenType? ClassifySimpleNameExpression(SimpleNameSyntax name) =>\n                name.Parent is MemberAccessExpressionSyntax\n                    ? ClassifyMemberAccess(name)\n                    : ClassifySimpleNameExpressionSpecialContext(name, name);\n\n            /// <summary>\n            /// The <paramref name=\"name\"/> is likely not referring a type, but there are some <paramref name=\"context\"/> and\n            /// special cases where it still might bind to a type or is treated as a keyword. The <paramref name=\"context\"/>\n            /// is the member access of the <paramref name=\"name\"/>. e.g. for A.B.C <paramref name=\"name\"/> may\n            /// refer to \"B\" and <paramref name=\"context\"/> would be the parent member access expression A.B and recursively A.B.C.\n            /// </summary>\n            [PerformanceSensitive(\"https://github.com/SonarSource/sonar-dotnet/issues/7805\", AllowCaptures = false, AllowGenericEnumeration = false, AllowImplicitBoxing = false)]\n            private TokenType? ClassifySimpleNameExpressionSpecialContext(SyntaxNode context, SimpleNameSyntax name) =>\n                context.Parent switch\n                {\n                    // some identifier can be bound to a type or a constant:\n                    CaseSwitchLabelSyntax => ClassifyIdentifierByModel(name), // case i:\n                    { } parent when NameIsRightOfIsExpression(name, parent) => ClassifyIdentifierByModel(name), // is i\n                    { RawKind: (int)SyntaxKindEx.ConstantPattern } => ClassifyIdentifierByModel(name), // is { X: i }\n                    // nameof(i) can be bound to a type or a member\n                    ArgumentSyntax x when IsNameOf(x) => IsValueParameterOfSetter(name) ? TokenType.Keyword : ClassifyIdentifierByModel(name),\n                    // walk up memberaccess to detect cases like above\n                    MemberAccessExpressionSyntax x => ClassifySimpleNameExpressionSpecialContext(x, name),\n                    _ => ClassifySimpleNameExpressionSpecialNames(name)\n                };\n\n            private bool IsNameOf(ArgumentSyntax argument)\n                => argument is\n                {\n                    Parent: ArgumentListSyntax\n                    {\n                        Arguments.Count: 1,\n                        Parent: InvocationExpressionSyntax { Expression: IdentifierNameSyntax { Identifier.Text: \"nameof\" } }\n                    }\n                };\n\n            private bool NameIsRightOfIsExpression(NameSyntax name, SyntaxNode binary)\n                => binary is BinaryExpressionSyntax { RawKind: (int)SyntaxKind.IsExpression, Right: { } x } && x == name;\n\n            /// <summary>\n            /// Some expression identifier are classified differently, like \"value\" in a setter.\n            /// </summary>\n            private TokenType ClassifySimpleNameExpressionSpecialNames(SimpleNameSyntax name) =>\n                // \"value\" in a setter is a classified as keyword\n                IsValueParameterOfSetter(name)\n                    ? TokenType.Keyword\n                    : TokenType.UnknownTokentype;\n\n            private bool IsValueParameterOfSetter(SimpleNameSyntax simpleName)\n                => simpleName is IdentifierNameSyntax { Identifier.Text: \"value\" }\n                    && IsLeftMostMemberAccess(simpleName)\n                    && SemanticModel.GetSymbolInfo(simpleName).Symbol is IParameterSymbol\n                    {\n                        ContainingSymbol: IMethodSymbol\n                        {\n                            MethodKind: MethodKind.PropertySet or MethodKind.EventAdd or MethodKind.EventRemove\n                        }\n                    };\n\n            private static bool IsLeftMostMemberAccess(SimpleNameSyntax simpleName)\n                => simpleName is { Parent: not MemberAccessExpressionSyntax }\n                    || (simpleName is { Parent: MemberAccessExpressionSyntax { Expression: { } expression } } && expression == simpleName);\n\n            [PerformanceSensitive(\"https://github.com/SonarSource/sonar-dotnet/issues/7805\", AllowCaptures = false, AllowGenericEnumeration = false, AllowImplicitBoxing = false)]\n            private TokenType? ClassifyMemberAccess(SimpleNameSyntax name) =>\n                name switch\n                {\n                    {\n                        Parent: MemberAccessExpressionSyntax // Most right hand side of a member access?\n                        {\n                            Parent: not MemberAccessExpressionSyntax, // Topmost in a memberaccess tree\n                            Name: { } parentName // Right hand side\n                        } parent\n                    } when parentName == name => ClassifySimpleNameExpressionSpecialContext(parent, name),\n                    _ when IsValueParameterOfSetter(name) => TokenType.Keyword,\n                    // 'name' can not be a nested type, if there is an expression to the left of the member access,\n                    // that can not bind to a type. The only things that can bind to a type are SimpleNames (Identifier or GenericName)\n                    // or pre-defined types. None of the pre-defined types have a nested type, so we can exclude these as well.\n                    { Parent: MemberAccessExpressionSyntax x } when AnyMemberAccessLeftIsNotAType(x) => TokenType.UnknownTokentype,\n                    // The left side of a pointer member access must be a pointer and can not be a type\n                    { Parent: MemberAccessExpressionSyntax { RawKind: (int)SyntaxKind.PointerMemberAccessExpression } } => TokenType.UnknownTokentype,\n                    _ => ClassifyIdentifierByModel(name),\n                };\n\n            private static bool AnyMemberAccessLeftIsNotAType(MemberAccessExpressionSyntax memberAccess) =>\n                memberAccess switch\n                {\n                    { Expression: not SimpleNameSyntax and not MemberAccessExpressionSyntax and not AliasQualifiedNameSyntax } => true,\n                    { Expression: MemberAccessExpressionSyntax left } => AnyMemberAccessLeftIsNotAType(left),\n                    // Heuristic: any MemberAccess that starts with a lowercase on the most left hand side, is assumed to start\n                    // as an expression (e.g. s.Length). Rational: It is (almost) granted that Types (including enums) start\n                    // with an uppercase in C#. Any identifier, that starts with a lower case is assumed to refer a local, a parameter,\n                    // or a field.\n                    { Expression: SimpleNameSyntax { Identifier.ValueText: { Length: >= 1 } mostLeftIdentifier } } => char.IsLower(mostLeftIdentifier[0]),\n                    _ => false,\n                };\n\n            private TokenType ClassifyIdentifierByModel(SimpleNameSyntax name) =>\n                SemanticModel.GetSymbolInfo(name).Symbol is INamedTypeSymbol or ITypeParameterSymbol\n                    ? TokenType.TypeName\n                    : TokenType.UnknownTokentype;\n\n            private TokenType ClassifyAliasDeclarationByModel(UsingDirectiveSyntax usingDirective) =>\n                SemanticModel.GetDeclaredSymbol(usingDirective) is { Target: INamedTypeSymbol }\n                    ? TokenType.TypeName\n                    : TokenType.UnknownTokentype;\n\n            [PerformanceSensitive(\"https://github.com/SonarSource/sonar-dotnet/issues/7805\", AllowCaptures = false, AllowGenericEnumeration = false, AllowImplicitBoxing = false)]\n            private TokenType? ClassifySimpleNameType(SimpleNameSyntax name) =>\n                name is GenericNameSyntax\n                    ? TokenType.TypeName\n                    : ClassifySimpleNameTypeSpecialContext(name, name);\n\n            [PerformanceSensitive(\"https://github.com/SonarSource/sonar-dotnet/issues/7805\", AllowCaptures = false, AllowGenericEnumeration = false, AllowImplicitBoxing = false)]\n            private TokenType? ClassifySimpleNameTypeSpecialContext(SyntaxNode context, SimpleNameSyntax name) =>\n                context.Parent switch\n                {\n                    // namespace X; or namespace X { } -> always unknown\n                    NamespaceDeclarationSyntax or { RawKind: (int)SyntaxKindEx.FileScopedNamespaceDeclaration } => TokenType.UnknownTokentype,\n                    // using System; -> normal using\n                    UsingDirectiveSyntax { Alias: null, StaticKeyword.RawKind: (int)SyntaxKind.None } => TokenType.UnknownTokentype,\n                    // using Alias = System; -> \"System\" can be a type or a namespace\n                    UsingDirectiveSyntax { Alias: not null } => ClassifyIdentifierByModel(name),\n                    // using Alias = System; -> \"Alias\" can be a type or a namespace\n                    NameEqualsSyntax { Parent: UsingDirectiveSyntax { Alias.Name: { } aliasName } usingDirective } when aliasName == name => ClassifyAliasDeclarationByModel(usingDirective),\n                    // using static System.Math; -> most right hand side must be a type\n                    UsingDirectiveSyntax\n                    {\n                        StaticKeyword.RawKind: (int)SyntaxKind.StaticKeyword, Name: QualifiedNameSyntax { Right: SimpleNameSyntax x }\n                    } => x == name ? TokenType.TypeName : ClassifyIdentifierByModel(name),\n                    // Walk up classified names (to detect namespace and using context)\n                    QualifiedNameSyntax parent => ClassifySimpleNameTypeSpecialContext(parent, name),\n                    AliasQualifiedNameSyntax parent => ClassifySimpleNameTypeSpecialContext(parent, name),\n                    // We are in a \"normal\" type context like a declaration\n                    _ => ClassifySimpleNameTypeInTypeContext(name),\n                };\n\n            [PerformanceSensitive(\"https://github.com/SonarSource/sonar-dotnet/issues/7805\", AllowCaptures = false, AllowGenericEnumeration = false, AllowImplicitBoxing = false)]\n            private TokenType ClassifySimpleNameTypeInTypeContext(SimpleNameSyntax name) =>\n                name switch\n                {\n                    // unqualified types called \"var\" or \"dynamic\" are classified as keywords.\n                    { Parent: not QualifiedNameSyntax and not AliasQualifiedNameSyntax } => name is { Identifier.Text: \"var\" or \"dynamic\" }\n                        ? TokenType.Keyword\n                        : TokenType.TypeName,\n                    { Parent: QualifiedNameSyntax { Parent: { } parentOfTopMostQualifiedName, Right: { } right } topMostQualifiedName } when\n                        right == name // On the right hand side?\n                        && parentOfTopMostQualifiedName is not QualifiedNameSyntax // Is this the most right hand side?\n\n                        // This is a type, except on the right side of \"is\" where it might also be a constant like Int32.MaxValue\n                        && !NameIsRightOfIsExpression(topMostQualifiedName, parentOfTopMostQualifiedName) => TokenType.TypeName,\n                    // Name is directly after alias global::SomeType\n                    { Parent: AliasQualifiedNameSyntax { Name: { } x, Parent: not (QualifiedNameSyntax or MemberAccessExpressionSyntax) } } when name == x => TokenType.TypeName,\n                    // We are somewhere in a qualified name. It probably is a namespace but could also be the outer type of a nested type.\n                    _ => ClassifyIdentifierByModel(name),\n                };\n\n            [PerformanceSensitive(\"https://github.com/SonarSource/sonar-dotnet/issues/7805\", AllowCaptures = false, AllowGenericEnumeration = false, AllowImplicitBoxing = false)]\n            private static bool IsInTypeContext(SimpleNameSyntax name) =>\n                // Based on Syntax.xml search for Type=\"TypeSyntax\" and Type=\"NameSyntax\"\n                // order by https://docs.google.com/spreadsheets/d/1hb6Oz8NE1y4kfv57npSrGEzMd7tm9gYQtI1dABOneMk\n                // Important: \"False\" is the default (meaning \"expression\" context). The \"true\" returning path must be complete to avoid missclassifications.\n                // HotPath: Some \"false\" returning checks are included for the most common expression context kinds.\n                name.Parent switch\n                {\n                    MemberAccessExpressionSyntax x when x.Expression == name || x.Name == name => false, // Performance optimization\n                    ArgumentSyntax x when x.Expression == name => false, // Performance optimization\n                    InvocationExpressionSyntax x when x.Expression == name => false, // Performance optimization\n                    EqualsValueClauseSyntax x when x.Value == name => false, // Performance optimization\n                    AssignmentExpressionSyntax x when x.Right == name || x.Left == name => false, // Performance optimization\n                    VariableDeclarationSyntax x => x.Type == name,\n                    QualifiedNameSyntax => true,\n                    ParameterSyntax x => x.Type == name,\n                    NullableTypeSyntax x => x.ElementType == name,\n                    NamespaceDeclarationSyntax x => x.Name == name,\n                    AliasQualifiedNameSyntax x => x.Name == name,\n                    BaseTypeSyntax x => x.Type == name,\n                    TypeArgumentListSyntax => true,\n                    ObjectCreationExpressionSyntax x => x.Type == name,\n                    BinaryExpressionSyntax { RawKind: (int)SyntaxKind.AsExpression } x => x.Right == name,\n                    ArrayTypeSyntax x => x.ElementType == name,\n                    RefValueExpressionSyntax x => x.Type == name,\n                    DefaultExpressionSyntax x => x.Type == name,\n                    TypeOfExpressionSyntax x => x.Type == name,\n                    SizeOfExpressionSyntax x => x.Type == name,\n                    CastExpressionSyntax x => x.Type == name,\n                    StackAllocArrayCreationExpressionSyntax x => x.Type == name,\n                    FromClauseSyntax x => x.Type == name,\n                    JoinClauseSyntax x => x.Type == name,\n                    ForEachStatementSyntax x => x.Type == name,\n                    CatchDeclarationSyntax x => x.Type == name,\n                    DelegateDeclarationSyntax x => x.ReturnType == name,\n                    TypeConstraintSyntax x => x.Type == name,\n                    TypeParameterConstraintClauseSyntax x => x.Name == name,\n                    MethodDeclarationSyntax x => x.ReturnType == name,\n                    OperatorDeclarationSyntax x => x.ReturnType == name,\n                    ConversionOperatorDeclarationSyntax x => x.Type == name,\n                    BasePropertyDeclarationSyntax x => x.Type == name,\n                    PointerTypeSyntax x => x.ElementType == name,\n                    AttributeSyntax x => x.Name == name,\n                    ExplicitInterfaceSpecifierSyntax x => x.Name == name,\n                    UsingDirectiveSyntax x => x.Name == name,\n                    NameEqualsSyntax { Parent: UsingDirectiveSyntax { Alias.Name: { } x } } => x == name,\n                    // Wrapper. HotPath: Use SyntaxKind checks instead of Wrapper.IsInstance (slow and allocating).\n                    // Make sure to check the associated syntax kinds in the documentation and/or that the types are sealed.\n                    { RawKind: (int)SyntaxKindEx.FunctionPointerParameter } x => ((FunctionPointerParameterSyntaxWrapper)x).Type == name,\n                    { RawKind: (int)SyntaxKindEx.DeclarationPattern } x => ((DeclarationPatternSyntaxWrapper)x).Type == name,\n                    { RawKind: (int)SyntaxKindEx.RecursivePattern } x => ((RecursivePatternSyntaxWrapper)x).Type == name,\n                    { RawKind: (int)SyntaxKindEx.TypePattern } x => ((TypePatternSyntaxWrapper)x).Type == name,\n                    { RawKind: (int)SyntaxKindEx.LocalFunctionStatement } x => ((LocalFunctionStatementSyntaxWrapper)x).ReturnType == name,\n                    { RawKind: (int)SyntaxKindEx.DeclarationExpression } x => ((DeclarationExpressionSyntaxWrapper)x).Type == name,\n                    { RawKind: (int)SyntaxKind.ParenthesizedLambdaExpression } x => ((ParenthesizedLambdaExpressionSyntax)x).ReturnType == name,\n                    { RawKind: (int)SyntaxKindEx.FileScopedNamespaceDeclaration } x => ((FileScopedNamespaceDeclarationSyntaxWrapper)x).Name == name,\n                    { RawKind: (int)SyntaxKindEx.TupleElement } x => ((TupleElementSyntaxWrapper)x).Type == name,\n                    { RawKind: (int)SyntaxKindEx.RefType } x => ((RefTypeSyntaxWrapper)x).Type == name,\n                    { RawKind: (int)SyntaxKindEx.ScopedType } x => ((ScopedTypeSyntaxWrapper)x).Type == name,\n                    _ => false,\n                };\n        }\n\n        internal sealed class TriviaClassifier : TriviaClassifierBase\n        {\n            private static readonly HashSet<SyntaxKind> RegularCommentToken =\n                [\n                    SyntaxKind.SingleLineCommentTrivia,\n                    SyntaxKind.MultiLineCommentTrivia,\n                ];\n\n            private static readonly HashSet<SyntaxKind> DocCommentToken =\n                [\n                    SyntaxKind.SingleLineDocumentationCommentTrivia,\n                    SyntaxKind.MultiLineDocumentationCommentTrivia,\n                ];\n\n            protected override bool IsRegularComment(SyntaxTrivia trivia) =>\n                trivia.IsAnyKind(RegularCommentToken);\n\n            protected override bool IsDocComment(SyntaxTrivia trivia) =>\n                trivia.IsAnyKind(DocCommentToken);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ValueTypeShouldImplementIEquatable.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ValueTypeShouldImplementIEquatable : ValueTypeShouldImplementIEquatableBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/ValuesUselesslyIncremented.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class ValuesUselesslyIncremented : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S2123\";\n        private const string MessageFormat = \"Remove this {0} or correct the code not to waste it.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var increment = (PostfixUnaryExpressionSyntax)c.Node;\n                    var symbol = c.Model.GetSymbolInfo(increment.Operand).Symbol;\n\n                    if (symbol is ILocalSymbol || symbol is IParameterSymbol { RefKind: RefKind.None })\n                    {\n                        VisitParent(c, increment);\n                    }\n                },\n                SyntaxKind.PostIncrementExpression,\n                SyntaxKind.PostDecrementExpression);\n\n        private static void VisitParent(SonarSyntaxNodeReportingContext context, PostfixUnaryExpressionSyntax increment)\n        {\n            switch (increment.Parent)\n            {\n                case ReturnStatementSyntax:\n                case ArrowExpressionClauseSyntax:\n                case CastExpressionSyntax castExpressionSyntax\n                    when castExpressionSyntax.Parent?.Kind() is SyntaxKind.ReturnStatement or SyntaxKind.ArrowExpressionClause:\n                case ArgumentSyntax argumentInAssignment\n                    when argumentInAssignment.FindAssignmentComplement() is { } assignmentTarget\n                         && CSharpEquivalenceChecker.AreEquivalent(assignmentTarget, increment.Operand):\n                case ArgumentSyntax argumentInReturn\n                    when argumentInReturn.OutermostTuple() is { SyntaxNode.Parent: ReturnStatementSyntax or ArrowExpressionClauseSyntax }:\n                case AssignmentExpressionSyntax assignment\n                    when assignment.IsKind(SyntaxKind.SimpleAssignmentExpression)\n                         && assignment.Right == increment\n                         && CSharpEquivalenceChecker.AreEquivalent(assignment.Left, increment.Operand):\n\n                    var operatorText = increment.OperatorToken.IsKind(SyntaxKind.PlusPlusToken)\n                        ? \"increment\"\n                        : \"decrement\";\n\n                    context.ReportIssue(Rule, increment, operatorText);\n                    return;\n                default:\n                    return;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/VariableShadowsField.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class VariableShadowsField : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S1117\";\n        private const string MessageFormat = \"Rename '{0}' which hides the {1} with the same name.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(c => Process(c, GetDeclarationOrDesignation(c.Node)),\n                SyntaxKind.LocalDeclarationStatement,\n                SyntaxKind.ForStatement,\n                SyntaxKind.UsingStatement,\n                SyntaxKind.FixedStatement,\n                SyntaxKindEx.DeclarationExpression,\n                SyntaxKindEx.RecursivePattern,\n                SyntaxKindEx.VarPattern,\n                SyntaxKindEx.DeclarationPattern,\n                SyntaxKindEx.ListPattern,\n                SyntaxKind.ForEachStatement);\n\n        private static SyntaxNode GetDeclarationOrDesignation(SyntaxNode node) =>\n            node switch\n            {\n                LocalDeclarationStatementSyntax localDeclaration => localDeclaration.Declaration,\n                ForStatementSyntax forStatement => forStatement.Declaration,\n                UsingStatementSyntax usingStatement => usingStatement.Declaration,\n                FixedStatementSyntax fixedStatement => fixedStatement.Declaration,\n                ForEachStatementSyntax forEachStatement => forEachStatement,\n                _ when DeclarationExpressionSyntaxWrapper.IsInstance(node) => ((DeclarationExpressionSyntaxWrapper)node).Designation,\n                _ when RecursivePatternSyntaxWrapper.IsInstance(node) => ((RecursivePatternSyntaxWrapper)node).Designation,\n                _ when VarPatternSyntaxWrapper.IsInstance(node) => ((VarPatternSyntaxWrapper)node).Designation,\n                _ when DeclarationPatternSyntaxWrapper.IsInstance(node) => ((DeclarationPatternSyntaxWrapper)node).Designation,\n                _ when ListPatternSyntaxWrapper.IsInstance(node) => ((ListPatternSyntaxWrapper)node).Designation,\n                _ => null\n            };\n\n        private static void Process(SonarSyntaxNodeReportingContext context, SyntaxNode node)\n        {\n            if (ExtractIdentifiers(node) is { Count: > 0 } identifiers\n                && GetContextSymbols(context) is var members)\n            {\n                foreach (var identifier in identifiers)\n                {\n                    ReportOnVariableMatchingField(context, members, identifier);\n                }\n            }\n        }\n\n        private static List<SyntaxToken> ExtractIdentifiers(SyntaxNode node) =>\n            node switch\n            {\n                VariableDeclarationSyntax variableDeclaration => variableDeclaration.Variables.Select(x => x.Identifier).ToList(),\n                ForEachStatementSyntax foreachStatement => new() { foreachStatement.Identifier },\n                _ when VariableDesignationSyntaxWrapper.IsInstance(node) => ((VariableDesignationSyntaxWrapper)node).AllVariables().Select(x => x.Identifier).ToList(),\n                _ => new()\n            };\n\n        private static List<ISymbol> GetContextSymbols(SonarSyntaxNodeReportingContext context)\n        {\n            var members = context.ContainingSymbol.ContainingType.GetMembers();\n            var primaryConstructorParameters = members.OfType<IMethodSymbol>().FirstOrDefault(x => x.IsPrimaryConstructor)?.Parameters;\n            var fieldsAndProperties = members.Where(x => x is IPropertySymbol or IFieldSymbol).ToList();\n            return primaryConstructorParameters is null ? fieldsAndProperties : fieldsAndProperties.Concat(primaryConstructorParameters).ToList();\n        }\n\n        private static void ReportOnVariableMatchingField(SonarSyntaxNodeReportingContext context, IEnumerable<ISymbol> members, SyntaxToken identifier)\n        {\n            if (members.FirstOrDefault(x => x.Name == identifier.ValueText\n                && (x.IsStatic || !identifier.Parent.EnclosingScope().GetModifiers().Any(x => x.Kind() == SyntaxKind.StaticKeyword))) is { } matchingMember)\n            {\n                context.ReportIssue(Rule, identifier, identifier.Text, GetSymbolName(matchingMember));\n            }\n        }\n\n        private static string GetSymbolName(ISymbol symbol) =>\n            symbol switch\n            {\n                IFieldSymbol => \"field\",\n                IPropertySymbol => \"property\",\n                IParameterSymbol => \"primary constructor parameter\",\n                _ => string.Empty\n            };\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/VariableUnused.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class VariableUnused : VariableUnusedBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language { get; } = CSharpFacade.Instance;\n\n    protected override bool IsExcludedDeclaration(SyntaxNode node) =>\n        node is ForEachStatementSyntax\n        || node is VariableDeclaratorSyntax { Parent.Parent: UsingStatementSyntax or ForStatementSyntax }\n        || (node is VariableDeclaratorSyntax { Parent.Parent: LocalDeclarationStatementSyntax lds } && lds.UsingKeyword.IsKind(SyntaxKind.UsingKeyword));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/VirtualEventField.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class VirtualEventField : SonarDiagnosticAnalyzer\n    {\n        private const string MessageFormat = \"Remove this 'virtual' modifier of {0}.\";\n\n        internal const string DiagnosticId = \"S2290\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var eventField = (EventFieldDeclarationSyntax)c.Node;\n\n                    if (eventField.Modifiers.Any(SyntaxKind.VirtualKeyword))\n                    {\n                        var virt = eventField.Modifiers.First(modifier => modifier.IsKind(SyntaxKind.VirtualKeyword));\n                        var names = string.Join(\", \", eventField.Declaration.Variables.Select(syntax => $\"'{syntax.Identifier.ValueText}'\").OrderBy(s => s).JoinAnd());\n                        c.ReportIssue(Rule, virt, names);\n                    }\n                },\n                SyntaxKind.EventFieldDeclaration);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/VirtualEventFieldCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    public sealed class VirtualEventFieldCodeFix : SonarCodeFix\n    {\n        internal const string Title = \"Remove 'virtual' keyword\";\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(VirtualEventField.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            var token = root.FindToken(diagnosticSpan.Start);\n\n            context.RegisterCodeFix(\n                Title,\n                c =>\n                {\n                    var newRoot = root.ReplaceToken(token, SyntaxFactory.Token(SyntaxKind.None));\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n\n            return Task.CompletedTask;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/WcfMissingContractAttribute.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class WcfMissingContractAttribute : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S3597\";\n        private const string MessageFormat = \"Add the '{0}' attribute to {1}.\";\n        private const string MessageOperation = \"the methods of this {0}\";\n        private const string MessageService = \" this {0}\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterSymbolAction(\n                c =>\n                {\n                    var namedType = (INamedTypeSymbol)c.Symbol;\n                    if (namedType.Is(TypeKind.Struct))\n                    {\n                        return;\n                    }\n\n                    var hasServiceContract = namedType.HasAttribute(KnownType.System_ServiceModel_ServiceContractAttribute);\n                    var hasAnyMethodWithOperationContract = HasAnyMethodWithOperationContract(namedType);\n\n                    if (!(hasServiceContract ^ hasAnyMethodWithOperationContract))\n                    {\n                        return;\n                    }\n\n                    var declarationSyntax = GetTypeDeclaration(c, namedType);\n                    if (declarationSyntax == null)\n                    {\n                        return;\n                    }\n\n                    string message;\n                    string attributeToAdd;\n\n                    if (hasServiceContract)\n                    {\n                        message = MessageOperation;\n                        attributeToAdd = \"OperationContract\";\n                    }\n                    else\n                    {\n                        message = MessageService;\n                        attributeToAdd = \"ServiceContract\";\n                    }\n\n                    var classOrInterface = namedType.IsClass() ? \"class\" : \"interface\";\n                    message = string.Format(message, classOrInterface);\n\n                    c.ReportIssue(Rule, declarationSyntax.Identifier, attributeToAdd, message);\n                },\n                SymbolKind.NamedType);\n\n        private static bool HasAnyMethodWithOperationContract(INamespaceOrTypeSymbol namedType) =>\n            namedType.GetMembers()\n                     .OfType<IMethodSymbol>()\n                     .Any(m => m.HasAttribute(KnownType.System_ServiceModel_OperationContractAttribute));\n\n        private static TypeDeclarationSyntax GetTypeDeclaration(SonarSymbolReportingContext context, ISymbol namedType) =>\n            namedType.DeclaringSyntaxReferences\n                     .Where(x => context.ShouldAnalyzeTree(x.SyntaxTree, CSharpGeneratedCodeRecognizer.Instance))\n                     .Select(x => x.GetSyntax() as TypeDeclarationSyntax)\n                     .FirstOrDefault(x => x is not null);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/WcfNonVoidOneWay.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class WcfNonVoidOneWay : WcfNonVoidOneWayBase<MethodDeclarationSyntax, SyntaxKind>\n    {\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override GeneratedCodeRecognizer GeneratedCodeRecognizer =>\n            CSharpGeneratedCodeRecognizer.Instance;\n\n        protected override SyntaxKind MethodDeclarationKind =>\n            SyntaxKind.MethodDeclaration;\n\n        protected override Location GetReturnTypeLocation(MethodDeclarationSyntax method) =>\n            method.ReturnType.GetLocation();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/WeakSslTlsProtocols.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class WeakSslTlsProtocols : WeakSslTlsProtocolsBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/XMLSignatureCheck.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class XmlSignatureCheck : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S6377\";\n    private const string MessageFormat = \"Change this code to only accept signatures computed from a trusted party.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        var tracker = CSharpFacade.Instance.Tracker.Invocation;\n        tracker.Track(\n            new TrackerInput(context, AnalyzerConfiguration.AlwaysEnabled, Rule),\n            tracker.Or(\n                tracker.And(\n                    tracker.MethodHasParameters(0),\n                    tracker.MatchMethod(new MemberDescriptor(KnownType.System_Security_Cryptography_Xml_SignedXml, \"CheckSignature\"))),\n                tracker.MatchMethod(new MemberDescriptor(KnownType.System_Security_Cryptography_Xml_SignedXml, \"CheckSignatureReturningKey\"))));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/XXE/XmlReaderSettingsValidator.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Xml;\n\nnamespace SonarAnalyzer.CSharp.Rules.XXE\n{\n    /// <summary>\n    /// This class is responsible to check if a XmlReaderSettings node is vulnerable to XXE attacks.\n    ///\n    /// By default the XmlReaderSettings is safe:\n    ///  - before .Net 4.5.2 it has ProhibitDtd set to true (even if the internal XmlResolver is not secure)\n    ///  - starting with .Net 4.5.2 XmlResolver is set to null, ProhibitDtd set to true and DtdProcessing set to ignore\n    ///\n    /// If the properties are modified, in order to be secure, we have to check that either ProhibitDtd is set to true, DtdProcessing set to Ignore or\n    /// the internal XmlResolver is secure.\n    /// </summary>\n    internal class XmlReaderSettingsValidator\n    {\n        private readonly SemanticModel semanticModel;\n        private readonly bool isXmlResolverSafeByDefault;\n\n        public XmlReaderSettingsValidator(SemanticModel semanticModel, NetFrameworkVersion version)\n        {\n            this.semanticModel = semanticModel;\n            isXmlResolverSafeByDefault = IsXmlResolverPropertySafeByDefault(version);\n        }\n\n        /// <summary>\n        /// Gets the assignment locations of XmlReaderSettings properties which are unsafe and are used in invocations afterwards (e.g. XmlReader.Create).\n        /// </summary>\n        /// <param name=\"invocation\">A method invocation syntax node (e.g. XmlReader.Create).</param>\n        /// <param name=\"settings\">The symbol of the XmlReaderSettings node received as parameter. This is used to check\n        /// if certain properties (ProhibitDtd, DtdProcessing or XmlUrlResolver) were modified for the given symbol.</param>\n        /// <returns>The list of unsafe assignment locations.</returns>\n        public IList<SecondaryLocation> GetUnsafeAssignmentLocations(InvocationExpressionSyntax invocation, ISymbol settings, string message)\n        {\n            var unsafeAssignmentLocations = new List<SecondaryLocation>();\n            // By default ProhibitDtd is 'true' and DtdProcessing is 'ignore'\n            var unsafeDtdProcessing = false;\n            var unsafeResolver = isXmlResolverSafeByDefault;\n\n            var objectCreation = GetObjectCreation(settings, invocation, semanticModel);\n            var objectCreationAssignments = objectCreation?.InitializerExpressions.OfType<AssignmentExpressionSyntax>()\n                ?? Enumerable.Empty<AssignmentExpressionSyntax>();\n\n            var propertyAssignments = GetAssignments(invocation.FirstAncestorOrSelf<MethodDeclarationSyntax>())\n                .Where(assignment => IsMemberAccessOnSymbol(assignment.Left, settings, semanticModel));\n\n            foreach (var assignment in objectCreationAssignments.Union(propertyAssignments))\n            {\n                var name = assignment.Left.GetName();\n\n                if (name == \"ProhibitDtd\" || name == \"DtdProcessing\")\n                {\n                    unsafeDtdProcessing = IsXmlResolverDtdProcessingUnsafe(assignment, semanticModel);\n                    if (unsafeDtdProcessing)\n                    {\n                        unsafeAssignmentLocations.Add(assignment.ToSecondaryLocation(message));\n                    }\n                }\n                else if (name == \"XmlResolver\")\n                {\n                    unsafeResolver = IsXmlResolverAssignmentUnsafe(assignment, semanticModel);\n                    if (unsafeResolver)\n                    {\n                        unsafeAssignmentLocations.Add(assignment.ToSecondaryLocation(message));\n                    }\n                }\n            }\n\n            return unsafeDtdProcessing && unsafeResolver ? unsafeAssignmentLocations : [];\n        }\n\n        private static bool IsMemberAccessOnSymbol(ExpressionSyntax expression, ISymbol symbol, SemanticModel semanticModel) =>\n            expression is MemberAccessExpressionSyntax memberAccess\n            && semanticModel.GetTypeInfo(memberAccess.Expression).Type.Is(KnownType.System_Xml_XmlReaderSettings)\n            && symbol.Equals(semanticModel.GetSymbolInfo(memberAccess.Expression).Symbol);\n\n        private static IEnumerable<AssignmentExpressionSyntax> GetAssignments(SyntaxNode node) =>\n            node == null\n                ? Enumerable.Empty<AssignmentExpressionSyntax>()\n                : node.DescendantNodes().OfType<AssignmentExpressionSyntax>();\n\n        private static bool IsXmlResolverPropertySafeByDefault(NetFrameworkVersion version) =>\n            version == NetFrameworkVersion.Probably35 || version == NetFrameworkVersion.Between4And451;\n\n        private static IObjectCreation GetObjectCreation(ISymbol symbol, InvocationExpressionSyntax invocation, SemanticModel semanticModel) =>\n            // First we search for object creations at the syntax level to see if the object is created inline\n            // and if not we look for the identifier declaration.\n            invocation.DescendantNodes()\n                      .Union(symbol.LocationNodes(invocation))\n                      .Where(x => x?.Kind() is SyntaxKind.ObjectCreationExpression or SyntaxKindEx.ImplicitObjectCreationExpression)\n                      .Select(ObjectCreationFactory.Create)\n                      .FirstOrDefault(objectCreation => IsXmlReaderSettingsCreationWithInitializer(objectCreation, semanticModel));\n\n        private static bool IsXmlReaderSettingsCreationWithInitializer(IObjectCreation objectCreation, SemanticModel semanticModel) =>\n            objectCreation.Initializer != null && objectCreation.TypeSymbol(semanticModel).Is(KnownType.System_Xml_XmlReaderSettings);\n\n        private static bool IsXmlResolverDtdProcessingUnsafe(AssignmentExpressionSyntax assignment, SemanticModel semanticModel) =>\n            semanticModel.GetConstantValue(assignment.Right).Value switch\n            {\n                false => true, // If ProhibitDtd is set to false the settings will be unsafe (parsing is allowed)\n                (int)DtdProcessing.Parse => true,\n                _ => false\n            };\n\n        private static bool IsXmlResolverAssignmentUnsafe(AssignmentExpressionSyntax assignment, SemanticModel semanticModel)\n        {\n            if (assignment.Right.IsKind(SyntaxKind.NullLiteralExpression))\n            {\n                return false;\n            }\n\n            var type = semanticModel.GetTypeInfo(assignment.Right).Type;\n            return type.IsAny(KnownType.System_Xml_XmlUrlResolver, KnownType.System_Xml_Resolvers_XmlPreloadedResolver);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Rules/XmlExternalEntityShouldNotBeParsed.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Xml;\nusing SonarAnalyzer.CSharp.Core.Trackers;\nusing SonarAnalyzer.CSharp.Rules.XXE;\n\nnamespace SonarAnalyzer.CSharp.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    public sealed class XmlExternalEntityShouldNotBeParsed : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S2755\";\n        private const string MessageFormat = \"Disable access to external entities in XML parsing.\";\n        private const string SecondaryMessage = \"This value enables external entities in XML parsing.\";\n\n        private static readonly DiagnosticDescriptor Rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n        // For the XXE rule we actually need to know about .NET 4.5.2,\n        // but it is good enough given the other .NET 4.x do not have support anymore\n        private readonly NetFrameworkVersionProvider versionProvider;\n\n        public XmlExternalEntityShouldNotBeParsed() : this(new NetFrameworkVersionProvider()) { }\n\n        internal /*for testing*/ XmlExternalEntityShouldNotBeParsed(NetFrameworkVersionProvider netFrameworkVersionProvider) =>\n            versionProvider = netFrameworkVersionProvider;\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterCompilationStartAction(\n                ccc =>\n                {\n                    ccc.RegisterNodeAction(\n                        c =>\n                        {\n                            var objectCreation = ObjectCreationFactory.Create(c.Node);\n                            var netFrameworkVersion = versionProvider.Version(c.Compilation);\n                            var constructorIsSafe = ConstructorIsSafe(netFrameworkVersion);\n                            var trackers = TrackerFactory.Create();\n                            if (trackers.XmlDocumentTracker.ShouldBeReported(objectCreation, c.Model, constructorIsSafe)\n                               || trackers.XmlTextReaderTracker.ShouldBeReported(objectCreation, c.Model, constructorIsSafe))\n                            {\n                                c.ReportIssue(Rule, objectCreation.Expression);\n                            }\n\n                            VerifyXPathDocumentConstructor(c, objectCreation);\n                        },\n                        SyntaxKind.ObjectCreationExpression, SyntaxKindEx.ImplicitObjectCreationExpression);\n\n                    ccc.RegisterNodeAction(\n                        c =>\n                        {\n                            var assignment = (AssignmentExpressionSyntax)c.Node;\n\n                            var trackers = TrackerFactory.Create();\n                            if (trackers.XmlDocumentTracker.ShouldBeReported(assignment, c.Model)\n                               || trackers.XmlTextReaderTracker.ShouldBeReported(assignment, c.Model))\n                            {\n                                c.ReportIssue(Rule, assignment);\n                            }\n                        },\n                        SyntaxKind.SimpleAssignmentExpression);\n\n                    ccc.RegisterNodeAction(VerifyXmlReaderInvocations, SyntaxKind.InvocationExpression);\n                });\n\n        private void VerifyXmlReaderInvocations(SonarSyntaxNodeReportingContext context)\n        {\n            var invocation = (InvocationExpressionSyntax)context.Node;\n            if (!invocation.IsMemberAccessOnKnownType(\"Create\", KnownType.System_Xml_XmlReader, context.Model))\n            {\n                return;\n            }\n\n            var settings = invocation.GetArgumentSymbolsOfKnownType(KnownType.System_Xml_XmlReaderSettings, context.Model).FirstOrDefault();\n            if (settings == null)\n            {\n                return; // safe by default\n            }\n\n            var xmlReaderSettingsValidator = new XmlReaderSettingsValidator(context.Model, versionProvider.Version(context.Compilation));\n            if (xmlReaderSettingsValidator.GetUnsafeAssignmentLocations(invocation, settings, SecondaryMessage) is { } secondaryLocations && secondaryLocations.Any())\n            {\n                context.ReportIssue(Rule, invocation, secondaryLocations);\n            }\n        }\n\n        private void VerifyXPathDocumentConstructor(SonarSyntaxNodeReportingContext context, IObjectCreation objectCreation)\n        {\n            if (!context.Model.GetTypeInfo(objectCreation.Expression).Type.Is(KnownType.System_Xml_XPath_XPathDocument)\n                // If a XmlReader is provided in the constructor, XPathDocument will be as safe as the received reader.\n                // In this case we don't raise a warning since the XmlReader has it's own checks.\n                || objectCreation.ArgumentList.Arguments.GetArgumentsOfKnownType(KnownType.System_Xml_XmlReader, context.Model).Any())\n            {\n                return;\n            }\n\n            if (!IsXPathDocumentSecureByDefault(versionProvider.Version(context.Compilation)))\n            {\n                context.ReportIssue(Rule, objectCreation.Expression);\n            }\n        }\n\n        private static bool IsXPathDocumentSecureByDefault(NetFrameworkVersion version) =>\n            // XPathDocument is secure by default starting with .Net 4.5.2\n            version == NetFrameworkVersion.After452 || version == NetFrameworkVersion.Unknown;\n\n        // The XmlDocument and XmlTextReader constructors were made safe-by-default in .NET 4.5.2\n        private static bool ConstructorIsSafe(NetFrameworkVersion version) =>\n            version switch\n            {\n                NetFrameworkVersion.After452 => true,\n                NetFrameworkVersion.Between4And451 => false,\n                NetFrameworkVersion.Probably35 => false,\n                _ => true\n            };\n\n        private static class TrackerFactory\n        {\n            private static ImmutableArray<KnownType> UnsafeXmlResolvers { get; } = ImmutableArray.Create(\n                KnownType.System_Xml_XmlUrlResolver,\n                KnownType.System_Xml_Resolvers_XmlPreloadedResolver\n            );\n\n            private static readonly ImmutableArray<KnownType> XmlDocumentTrackedTypes = ImmutableArray.Create(\n                KnownType.System_Xml_XmlDocument,\n                KnownType.System_Xml_XmlDataDocument,\n                KnownType.System_Configuration_ConfigXmlDocument,\n                KnownType.Microsoft_Web_XmlTransform_XmlFileInfoDocument,\n                KnownType.Microsoft_Web_XmlTransform_XmlTransformableDocument\n            );\n\n            private static readonly ISet<string> XmlTextReaderTrackedProperties = ImmutableHashSet.Create(\n                \"XmlResolver\", // should be null\n                \"DtdProcessing\", // should not be Parse\n                \"ProhibitDtd\" // should be true in .NET 3.5\n            );\n\n            public static TrackersHolder Create()\n            {\n                var xmlDocumentTracker = new CSharpObjectInitializationTracker(\n                    // we do not expect any constant values for XmlResolver\n                    isAllowedConstantValue: constantValue => false,\n                    trackedTypes: XmlDocumentTrackedTypes,\n                    isTrackedPropertyName: propertyName => propertyName == \"XmlResolver\",\n                    isAllowedObject: (symbol, _, __) => IsAllowedObject(symbol)\n                );\n\n                var xmlTextReaderTracker = new CSharpObjectInitializationTracker(\n                    isAllowedConstantValue: IsAllowedValueForXmlTextReader,\n                    trackedTypes: ImmutableArray.Create(KnownType.System_Xml_XmlTextReader),\n                    isTrackedPropertyName: XmlTextReaderTrackedProperties.Contains,\n                    isAllowedObject: (symbol, _, __) => IsAllowedObject(symbol)\n                );\n\n                return new TrackersHolder(xmlDocumentTracker, xmlTextReaderTracker);\n            }\n\n            private static bool IsAllowedValueForXmlTextReader(object constantValue)\n            {\n                if (constantValue == null)\n                {\n                    return true;\n                }\n                if (constantValue is int integerValue)\n                {\n                    return integerValue != (int)DtdProcessing.Parse;\n                }\n                // treat the ProhibitDtd property\n                return constantValue is bool value && value;\n            }\n\n            private static bool IsUnsafeXmlResolverConstructor(ISymbol symbol) =>\n                symbol.Kind == SymbolKind.Method\n                && symbol.ContainingType.GetSymbolType().IsAny(UnsafeXmlResolvers);\n\n            private static bool IsAllowedObject(ISymbol symbol) =>\n                !IsUnsafeXmlResolverConstructor(symbol)\n                && !symbol.GetSymbolType().IsAny(UnsafeXmlResolvers)\n                && !IsUnsafeXmlResolverReturnType(symbol);\n\n            private static bool IsUnsafeXmlResolverReturnType(ISymbol symbol) =>\n                symbol is IMethodSymbol methodSymbol\n                && methodSymbol.ReturnType.IsAny(UnsafeXmlResolvers);\n        }\n\n        private readonly struct TrackersHolder\n        {\n            internal readonly CSharpObjectInitializationTracker XmlDocumentTracker;\n            internal readonly CSharpObjectInitializationTracker XmlTextReaderTracker;\n\n            internal TrackersHolder(CSharpObjectInitializationTracker xmlDocumentTracker, CSharpObjectInitializationTracker xmlTextReaderTracker)\n            {\n                XmlDocumentTracker = xmlDocumentTracker;\n                XmlTextReaderTracker = xmlTextReaderTracker;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/SonarAnalyzer.CSharp.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFramework>netstandard2.0</TargetFramework>\n    <!-- .NET Standard target does not copy referenced DLLs into bin folder, so we need to enable it explicitly. -->\n    <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>\n    <!-- Avoid CS0436. see also https://github.com/dotnet/roslyn-analyzers/blob/main/src/PerformanceSensitiveAnalyzers/PerformanceSensitiveAnalyzers.md -->\n    <GeneratePerformanceSensitiveAttribute>false</GeneratePerformanceSensitiveAttribute>\n    <!-- Title for DLL file properties -->\n    <AssemblyTitle>SonarAnalyzer C#</AssemblyTitle>\n  </PropertyGroup>\n\n  <!-- Warning: when adding a package reference, we must make sure this package is available on oldest supported .NET version (currently netstandard2.0) or packaged with the analyzer.\n       For instance, System.ValueTuple is not available in 4.6.1 and must be added to the final packaging if we add it here -->\n  <ItemGroup>\n    <PackageReference Include=\"Microsoft.CodeAnalysis.CSharp.Workspaces\" Version=\"1.3.2\" />\n    <PackageReference Include=\"System.Collections.Immutable\" Version=\"1.1.37\">\n      <!-- Downgrade System.Collections.Immutable to support VS2015 Update 3 -->\n      <NoWarn>NU1605, NU1701</NoWarn>\n    </PackageReference>\n  </ItemGroup>\n\n  <ItemGroup>\n    <!-- We need to update NuGet and JAR packaging after changing references -->\n    <ProjectReference Include=\"..\\SonarAnalyzer.Core\\SonarAnalyzer.Core.csproj\" />\n    <ProjectReference Include=\"..\\SonarAnalyzer.CSharp.Core\\SonarAnalyzer.CSharp.Core.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Using Include=\"Microsoft.CodeAnalysis\" />\n    <Using Include=\"Microsoft.CodeAnalysis.CodeFixes\" />\n    <Using Include=\"Microsoft.CodeAnalysis.CSharp\" />\n    <Using Include=\"Microsoft.CodeAnalysis.CSharp.Syntax\" />\n    <Using Include=\"Microsoft.CodeAnalysis.CSharp.Extensions\" />\n    <Using Include=\"Microsoft.CodeAnalysis.Diagnostics\" />\n    <Using Include=\"SonarAnalyzer.CFG.Extensions\" />\n    <Using Include=\"SonarAnalyzer.Core.AnalysisContext\" />\n    <Using Include=\"SonarAnalyzer.Core.Analyzers\" />\n    <Using Include=\"SonarAnalyzer.Core.Common\" />\n    <Using Include=\"SonarAnalyzer.Core.Extensions\" />\n    <Using Include=\"SonarAnalyzer.Core.Facade\" />\n    <Using Include=\"SonarAnalyzer.Core.Rules\" />\n    <Using Include=\"SonarAnalyzer.Core.Semantics\" />\n    <Using Include=\"SonarAnalyzer.Core.Semantics.Extensions\" />\n    <Using Include=\"SonarAnalyzer.Core.Syntax.Extensions\" />\n    <Using Include=\"SonarAnalyzer.Core.Syntax.Utilities\" />\n    <Using Include=\"SonarAnalyzer.CSharp.Core.Common\" />\n    <Using Include=\"SonarAnalyzer.CSharp.Core.Extensions\" />\n    <Using Include=\"SonarAnalyzer.CSharp.Core.Facade\" />\n    <Using Include=\"SonarAnalyzer.CSharp.Core.Syntax.Extensions\" />\n    <Using Include=\"SonarAnalyzer.CSharp.Core.Syntax.Utilities\" />\n    <Using Include=\"SonarAnalyzer.CSharp.Core.Wrappers\" />\n    <Using Include=\"SonarAnalyzer.CSharp.Syntax.Extensions\" />\n    <Using Include=\"SonarAnalyzer.CSharp.Syntax.Utilities\" />\n    <Using Include=\"SonarAnalyzer.ShimLayer\" />\n    <Using Include=\"StyleCop.Analyzers.Lightup\" />\n  </ItemGroup>\n\n  <Target Name=\"CopyBinaries\" AfterTargets=\"Build\">\n    <ItemGroup>\n      <BinariesToCopy Include=\"$(OutputPath)Google.Protobuf.dll\" />\n      <BinariesToCopy Include=\"$(OutputPath)SonarAnalyzer.CFG.dll\" />\n      <BinariesToCopy Include=\"$(OutputPath)SonarAnalyzer.Core.dll\" />\n      <BinariesToCopy Include=\"$(OutputPath)SonarAnalyzer.CSharp.Core.dll\" />\n      <BinariesToCopy Include=\"$(OutputPath)SonarAnalyzer.ShimLayer.dll\" />\n      <BinariesToCopy Include=\"$(OutputPath)SonarAnalyzer.ShimLayer.Lightup.dll\" />\n      <BinariesToCopy Include=\"$(OutputPath)SonarAnalyzer.CSharp.dll\" />\n    </ItemGroup>\n    <Copy SourceFiles=\"@(BinariesToCopy)\" DestinationFolder=\"$(BinariesFolder)\" />\n  </Target>\n\n</Project>\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Syntax/Extensions/ExpressionSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Syntax.Extensions;\n\ninternal static class ExpressionSyntaxExtensions\n{\n    /// <summary>\n    /// Maps the tuple arguments of <paramref name=\"expression\"/> to the positional sub-pattern of <paramref name=\"pattern\"/>.\n    /// For a pattern like: <code>(x, y) is (1, 2)</code>x is mapped to numeric literal 1 and y is mapped to 2.\n    /// </summary>\n    /// <param name=\"expression\">A tuple expression.</param>\n    /// <param name=\"pattern\">A pattern that can be matched to the tuple <paramref name=\"expression\"/>.</param>\n    /// <param name=\"objectToPatternMap\">The mapping between the tuple arguments and the positional sub-patterns.</param>\n    public static Dictionary<ExpressionSyntax, SyntaxNode> MapToPattern(this ExpressionSyntax expression, SyntaxNode pattern)\n    {\n        var map = new Dictionary<ExpressionSyntax, SyntaxNode>();\n        FillPatternMap(map, expression, pattern);\n        return map;\n    }\n\n    private static void FillPatternMap(Dictionary<ExpressionSyntax, SyntaxNode> map, ExpressionSyntax expression, SyntaxNode pattern)\n    {\n        expression = expression.RemoveParentheses();\n        pattern = pattern.RemoveParentheses();\n\n        if (TupleExpressionSyntaxWrapper.IsInstance(expression)\n            && (TupleExpressionSyntaxWrapper)expression is var tupleExpression\n            && RecursivePatternSyntaxWrapper.IsInstance(pattern)\n            && (RecursivePatternSyntaxWrapper)pattern is var recursivePattern\n            && recursivePattern.PositionalPatternClause.SyntaxNode is not null\n            && recursivePattern.PositionalPatternClause.Subpatterns.Count == tupleExpression.Arguments.Count)\n        {\n            for (var i = 0; i < tupleExpression.Arguments.Count; i++)\n            {\n                FillPatternMap(map, tupleExpression.Arguments[i].Expression, recursivePattern.PositionalPatternClause.Subpatterns[i].Pattern);\n            }\n        }\n        else\n        {\n            map.Add(expression, pattern);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Syntax/Extensions/IMethodSymbolExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Syntax.Extensions;\n\ninternal static class IMethodSymbolExtensions\n{\n    public static bool IsConditionalDebugMethod(this IMethodSymbol method)\n    {\n        if (method is null)\n        {\n            return false;\n        }\n\n        // Conditional attribute can be applied to a class, but it does nothing unless\n        // the class is an attribute class. So we only need to worry about whether the\n        // conditional attribute is on the method.\n        return method.GetAttributes(KnownType.System_Diagnostics_ConditionalAttribute)\n            .Any(x => x.ConstructorArguments.Any(constructorArg => constructorArg.Type.Is(KnownType.System_String) && (string)constructorArg.Value == \"DEBUG\"));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Syntax/Extensions/IfStatementSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Syntax.Extensions;\n\ninternal static class IfStatementSyntaxExtensions\n{\n    public static IList<IfStatementSyntax> PrecedingIfsInConditionChain(this IfStatementSyntax ifStatement)\n    {\n        var ifStatements = new List<IfStatementSyntax>();\n        while (PrecedingIf(ifStatement) is { } precedingIf)\n        {\n            ifStatements.Add(precedingIf);\n            ifStatement = precedingIf;\n        }\n        ifStatements.Reverse();\n        return ifStatements;\n\n        static IfStatementSyntax PrecedingIf(IfStatementSyntax ifStatement) =>\n            ifStatement.Parent switch\n            {\n                ElseClauseSyntax { Parent: IfStatementSyntax parentIf } => parentIf,\n                BlockSyntax { Parent: ElseClauseSyntax { Parent: IfStatementSyntax parentIf } } block when block.Statements[0] == ifStatement => parentIf,\n                _ => null,\n            };\n    }\n\n    public static IEnumerable<StatementSyntax> PrecedingStatementsInConditionChain(this IfStatementSyntax ifStatement) =>\n        ifStatement.PrecedingIfsInConditionChain().Select(x => x.Statement);\n\n    public static IEnumerable<ExpressionSyntax> PrecedingConditionsInConditionChain(this IfStatementSyntax ifStatement) =>\n        ifStatement.PrecedingIfsInConditionChain().Select(x => x.Condition);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Syntax/Extensions/InvocationExpressionSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Syntax.Extensions;\n\ninternal static class InvocationExpressionSyntaxExtensions\n{\n    public static bool HasOverloadWithType(this InvocationExpressionSyntax invocation, SemanticModel model, ImmutableArray<KnownType> types) =>\n        model.GetMemberGroup(invocation.Expression)\n            .OfType<IMethodSymbol>()\n            .Where(x => !x.HasAttribute(KnownType.System_ObsoleteAttribute))\n            .Where(x => IsCompatibleOverload(invocation, x))\n            .Any(x => SameParametersExceptWantedType(x, InvocationParameters(invocation, model), types));\n\n    // must have same number of arguments + 1 (the argument that should be added) OR is params argument\n    private static bool IsCompatibleOverload(InvocationExpressionSyntax invocation, IMethodSymbol m)\n    {\n        var parameters = m.GetParameters().ToArray();\n        return parameters.Length - invocation.ArgumentList.Arguments.Count == 1\n            || (parameters.Length != 0 && parameters[parameters.Length - 1].IsParams);\n    }\n\n    private static IMethodSymbol InvocationParameters(InvocationExpressionSyntax invocation, SemanticModel model) =>\n        model.GetSymbolInfo(invocation.Expression).Symbol as IMethodSymbol;\n\n    private static bool SameParametersExceptWantedType(IMethodSymbol possibleOverload, IMethodSymbol invocationMethodSymbol, ImmutableArray<KnownType> types)\n    {\n        var withTypeParam = possibleOverload.IsGenericMethod && invocationMethodSymbol.IsGenericMethod\n            // attempt to create the possibleOverload method symbol with same type arguments as the invocation method\n            ? ConstructTypedPossibleOverload(possibleOverload, invocationMethodSymbol)\n            : possibleOverload;\n        var invocationParameters = invocationMethodSymbol.GetParameters().ToArray();\n        var parametersWithoutWantedType = withTypeParam.GetParameters().Where(x => !x.Type.IsAny(types)).ToArray();\n        if (parametersWithoutWantedType.Length == possibleOverload.GetParameters().Count())\n        {\n            return false;\n        }\n\n        if (parametersWithoutWantedType.Length > 0\n            && parametersWithoutWantedType.Length <= invocationParameters.Length\n            && parametersWithoutWantedType[parametersWithoutWantedType.Length - 1].IsParams)\n        {\n            // check whether has a parameter array argument which matches the invocationParameters\n            return VerifyCompatibility(invocationParameters, parametersWithoutWantedType, parametersWithoutWantedType[parametersWithoutWantedType.Length - 1]);\n        }\n        else if (invocationParameters.Length == parametersWithoutWantedType.Length)\n        {\n            // parameters must have the same type\n            return invocationParameters.Select((x, index) => x.Type.DerivesOrImplements(parametersWithoutWantedType[index].Type)).All(x => x);\n        }\n        else\n        {\n            return false;\n        }\n    }\n\n    private static IMethodSymbol ConstructTypedPossibleOverload(IMethodSymbol possibleOverload, IMethodSymbol invocationMethodSymbol) =>\n        possibleOverload.TypeParameters.Length == invocationMethodSymbol.TypeArguments.Length\n            ? possibleOverload.ConstructedFrom.Construct(invocationMethodSymbol.TypeArguments.ToArray())\n            : possibleOverload;\n\n    /**\n     * Verifies the compatibility between the invocation parameters and the parameters of a possible overload that\n     * has the last parameter of 'params' type (variable length parameter).\n     */\n    private static bool VerifyCompatibility(IParameterSymbol[] invocationParameters, IParameterSymbol[] overloadCandidateParameters, IParameterSymbol paramsParameter)\n    {\n        if (paramsParameter.Type is not IArrayTypeSymbol)\n        {\n            return false;\n        }\n        var i = 0;\n        // check parameters before the last parameter\n        for (; i < overloadCandidateParameters.Length - 1; i++)\n        {\n            if (!invocationParameters[i].Type.DerivesOrImplements(overloadCandidateParameters[i].Type))\n            {\n                return false;\n            }\n        }\n        // make sure the rest of the invocation parameters match with the 'params' type\n        var paramsType = ParamsElementType(paramsParameter.Type);\n        for (; i < invocationParameters.Length - 1; i++)\n        {\n            if (!invocationParameters[i].Type.DerivesOrImplements(paramsType))\n            {\n                return false;\n            }\n        }\n\n        var lastInvocationParameter = invocationParameters[invocationParameters.Length - 1];\n        return lastInvocationParameter.IsParams\n            ? ParamsElementType(lastInvocationParameter.Type).DerivesOrImplements(paramsType)\n            : lastInvocationParameter.Type.DerivesOrImplements(paramsType);\n\n        static ITypeSymbol ParamsElementType(ITypeSymbol type) =>\n            type is IArrayTypeSymbol symbol ? symbol.ElementType : null;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Syntax/Extensions/SwitchSectionSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Syntax.Extensions;\n\ninternal static class SwitchSectionSyntaxExtensions\n{\n    public static IEnumerable<SwitchSectionSyntax> PrecedingSections(this SwitchSectionSyntax caseStatement)\n    {\n        if (caseStatement is null)\n        {\n            return [];\n        }\n        else\n        {\n            var switchStatement = (SwitchStatementSyntax)caseStatement.Parent;\n            var currentSectionIndex = switchStatement.Sections.IndexOf(caseStatement);\n            return switchStatement.Sections.Take(currentSectionIndex);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Syntax/Extensions/SyntaxNodeExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Syntax.Extensions;\n\ninternal static class SyntaxNodeExtensions\n{\n    public static bool IsInDebugBlock(this SyntaxNode node) =>\n        node.ActiveConditionalCompilationSections().Contains(\"DEBUG\");\n\n    public static bool IsInConditionalDebug(this SyntaxNode node, SemanticModel model)\n    {\n        var method = node.FirstAncestorOrSelf<MethodDeclarationSyntax>() is { } containingMethod\n            ? model.GetDeclaredSymbol(containingMethod)\n            : null;\n        return method.IsConditionalDebugMethod();\n    }\n\n    /// <summary>\n    /// Returns a list of the names of #if [NAME] sections that the specified\n    /// node is contained in.\n    /// </summary>\n    /// <remarks>\n    /// Note: currently we only handle directives with simple identifiers e.g. #if FOO, #elif FOO\n    /// We don't handle logical operators e.g. #if !DEBUG, and we don't handle cases like\n    /// #if !DEBUG ... #else... :DEBUG must be true in the else case.\n    /// </remarks>\n    public static IEnumerable<string> ActiveConditionalCompilationSections(this SyntaxNode node)\n    {\n        var directives = CollectPrecedingDirectiveSyntax(node);\n        if (directives.Count == 0)\n        {\n            return [];\n        }\n\n        var activeDirectives = new Stack<BranchingDirectiveTriviaSyntax>();\n        foreach (var directive in directives)\n        {\n            switch (directive.RawKind)\n            {\n                case (int)SyntaxKind.IfDirectiveTrivia:\n                    activeDirectives.Push((BranchingDirectiveTriviaSyntax)directive);\n                    break;\n                case (int)SyntaxKind.ElseDirectiveTrivia:\n                case (int)SyntaxKind.ElifDirectiveTrivia:\n                    // If we hit an if or elif then that effective acts as an \"end\" for the previous if/elif block -> pop it\n                    SafePop(activeDirectives);\n                    activeDirectives.Push((BranchingDirectiveTriviaSyntax)directive);\n                    break;\n                case (int)SyntaxKind.EndIfDirectiveTrivia:\n                    SafePop(activeDirectives);\n                    break;\n                default:\n                    Debug.Fail($\"Unexpected token type: {directive.Kind()}\");\n                    break;\n            }\n        }\n        Debug.Assert(activeDirectives.All(x => x.IsActive), \"Not all of the collected directives were active\");\n        Debug.Assert(activeDirectives.All(x => x.BranchTaken), \"Not all of the collected directives were for the branch that was taken\");\n        return activeDirectives.Select(FindDirectiveName).WhereNotNull().ToHashSet();\n    }\n\n    private static string FindDirectiveName(BranchingDirectiveTriviaSyntax directiveTriviaSyntax) =>\n        directiveTriviaSyntax is ConditionalDirectiveTriviaSyntax conditionalDirective && conditionalDirective.Condition is IdentifierNameSyntax identifierName\n            ? identifierName.Identifier.ValueText\n            : null;\n\n    private static void SafePop(Stack<BranchingDirectiveTriviaSyntax> stack)\n    {\n        if (stack.Count > 0)    // This should never be empty\n        {\n            stack.Pop();\n        }\n    }\n\n    private static IList<DirectiveTriviaSyntax> CollectPrecedingDirectiveSyntax(SyntaxNode node)\n    {\n        var walker = new BranchingDirectiveCollector(node);\n        return walker.SafeVisit(node.SyntaxTree.GetRoot()) ? walker.CollectedDirectives : [];\n    }\n\n    /// <summary>\n    /// Collects all of the #if, #else, #elsif and #endif directives occuring in the\n    /// syntax tree up to the specified node\n    /// </summary>\n    private sealed class BranchingDirectiveCollector : SafeCSharpSyntaxWalker\n    {\n        private readonly SyntaxNode terminatingNode;\n        private bool found;\n\n        public List<DirectiveTriviaSyntax> CollectedDirectives { get; } = new();\n\n        public BranchingDirectiveCollector(SyntaxNode terminatingNode) : base(SyntaxWalkerDepth.StructuredTrivia) =>\n            this.terminatingNode = terminatingNode;\n\n        public override void Visit(SyntaxNode node)\n        {\n            // Stop traversing once we've walked down to the terminating node\n            if (found)\n            {\n                return;\n            }\n\n            if (node == terminatingNode)\n            {\n                VisitTerminatingNodeLeadingTrivia();\n                found = true;\n            }\n            else\n            {\n                base.Visit(node);\n            }\n        }\n\n        public override void VisitIfDirectiveTrivia(IfDirectiveTriviaSyntax node)\n        {\n            AddDirective(node);\n            base.VisitIfDirectiveTrivia(node);\n        }\n\n        public override void VisitElseDirectiveTrivia(ElseDirectiveTriviaSyntax node)\n        {\n            AddDirective(node);\n            base.VisitElseDirectiveTrivia(node);\n        }\n\n        public override void VisitElifDirectiveTrivia(ElifDirectiveTriviaSyntax node)\n        {\n            AddDirective(node);\n            base.VisitElifDirectiveTrivia(node);\n        }\n\n        public override void VisitEndIfDirectiveTrivia(EndIfDirectiveTriviaSyntax node)\n        {\n            AddDirective(node);\n            base.VisitEndIfDirectiveTrivia(node);\n        }\n\n        private void AddDirective(DirectiveTriviaSyntax node)\n        {\n            if (node.IsActive)\n            {\n                CollectedDirectives.Add(node);\n            }\n        }\n\n        private void VisitTerminatingNodeLeadingTrivia()\n        {\n            // Special case: the leading trivia of the terminating node could contain directives. However, we won't have processed\n            // these yet, as they are treated as children of the node even though they appear before it in the text\n            if (terminatingNode.HasLeadingTrivia)\n            {\n                VisitLeadingTrivia(terminatingNode.GetFirstToken(includeZeroWidth: true));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Syntax/Utilities/AttributeSyntaxSymbolMapping.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Syntax.Utilities;\n\ninternal class AttributeSyntaxSymbolMapping\n{\n    public AttributeSyntax Node { get; }\n    public IMethodSymbol Symbol { get; }\n\n    private AttributeSyntaxSymbolMapping(AttributeSyntax node, IMethodSymbol symbol)\n    {\n        Node = node;\n        Symbol = symbol;\n    }\n\n    public static IEnumerable<AttributeSyntaxSymbolMapping> GetAttributesForParameter(ParameterSyntax parameter, SemanticModel model) =>\n        parameter.AttributeLists\n            .SelectMany(x => x.Attributes)\n            .Select(x => new AttributeSyntaxSymbolMapping(x, model.GetSymbolInfo(x).Symbol as IMethodSymbol))\n            .Where(x => x.Symbol is not null);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Syntax/Utilities/SymbolUsage.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Syntax.Utilities;\n\ninternal class SymbolUsage\n{\n    public ISymbol Symbol { get; }\n    public SyntaxNode Declaration { get; set; }\n    public SyntaxNode Initializer { get; set; }\n    public HashSet<SyntaxNode> Readings { get; } = new();\n    public HashSet<SyntaxNode> Writings { get; } = new();\n\n    public SymbolUsage(ISymbol symbol) =>\n        Symbol = symbol;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Syntax/Utilities/SymbolUsageCollector.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Syntax.Utilities;\n\n/// <summary>\n/// Collects all symbol usages from a class declaration. Ignores symbols whose names are not present\n/// in the knownSymbolNames collection for performance reasons.\n/// </summary>\ninternal class SymbolUsageCollector : SafeCSharpSyntaxWalker\n{\n    [Flags]\n    private enum SymbolAccess\n    {\n        None = 0,\n        Read = 1,\n        Write = 2,\n        ReadWrite = Read | Write\n    }\n\n    private static readonly ISet<SyntaxKind> IncrementKinds = new HashSet<SyntaxKind>\n    {\n        SyntaxKind.PostIncrementExpression,\n        SyntaxKind.PreIncrementExpression,\n        SyntaxKind.PostDecrementExpression,\n        SyntaxKind.PreDecrementExpression\n    };\n\n    private readonly Compilation compilation;\n    private readonly HashSet<string> knownSymbolNames;\n    private SemanticModel model;\n\n    public ISet<ISymbol> UsedSymbols { get; } = new HashSet<ISymbol>();\n    public IDictionary<ISymbol, SymbolUsage> FieldSymbolUsages { get; } = new Dictionary<ISymbol, SymbolUsage>();\n    public HashSet<string> DebuggerDisplayValues { get; } = [];\n    public Dictionary<IPropertySymbol, AccessorAccess> PropertyAccess { get; } = [];\n    public HashSet<ISymbol> PrivateAttributes { get; } = [];\n    public HashSet<ISymbol> TypesUsedWithReflection { get; } = [];\n\n    public SymbolUsageCollector(Compilation compilation, IEnumerable<ISymbol> knownSymbols)\n    {\n        this.compilation = compilation;\n        knownSymbolNames = knownSymbols.Select(Name).ToHashSet();\n    }\n\n    public override void Visit(SyntaxNode node)\n    {\n        model = node.EnsureCorrectSemanticModelOrDefault(model ?? compilation.GetSemanticModel(node.SyntaxTree));\n        if (model is not null)\n        {\n            if (node.IsKind(SyntaxKindEx.ImplicitObjectCreationExpression)\n                && knownSymbolNames.Contains(ObjectCreationFactory.Create(node).TypeAsString(model)))\n            {\n                UsedSymbols.UnionWith(Symbols(node));\n            }\n            else if (node.IsKind(SyntaxKindEx.LocalFunctionStatement)\n                && (LocalFunctionStatementSyntaxWrapper)node is { AttributeLists.Count: > 0 }\n                && model.GetDeclaredSymbol(node) is IMethodSymbol localFunctionSymbol)\n            {\n                UsedSymbols.UnionWith(localFunctionSymbol.GetAttributes().Where(x => knownSymbolNames.Contains(x.AttributeClass.Name)).Select(x => x.AttributeClass));\n            }\n            else if (node.IsKind(SyntaxKindEx.PrimaryConstructorBaseType) && knownSymbolNames.Contains(((PrimaryConstructorBaseTypeSyntaxWrapper)node).Type.GetName()))\n            {\n                UsedSymbols.UnionWith(Symbols(node));\n            }\n            base.Visit(node);\n        }\n    }\n\n    // TupleExpression \"(a, b) = qix\"\n    // ParenthesizedVariableDesignation \"var (a, b) = quix\" inside a DeclarationExpression\n    public override void VisitAssignmentExpression(AssignmentExpressionSyntax node)\n    {\n        var leftTupleCount = GetTupleCount(node.Left);\n        if (leftTupleCount != 0)\n        {\n            var assignmentRight = node.Right;\n            var namedTypeSymbol = model.GetSymbolInfo(assignmentRight).Symbol?.GetSymbolType();\n            if (namedTypeSymbol is not null)\n            {\n                var deconstructors = namedTypeSymbol.GetMembers(\"Deconstruct\");\n                if (deconstructors.Length == 1)\n                {\n                    UsedSymbols.Add(deconstructors.First());\n                }\n                else if (deconstructors.Length > 1 && FindDeconstructor(deconstructors, leftTupleCount) is { } deconstructor)\n                {\n                    UsedSymbols.Add(deconstructor);\n                }\n            }\n        }\n        base.VisitAssignmentExpression(node);\n\n        static int GetTupleCount(ExpressionSyntax assignmentLeft)\n        {\n            var result = 0;\n            if (TupleExpressionSyntaxWrapper.IsInstance(assignmentLeft))\n            {\n                result = ((TupleExpressionSyntaxWrapper)assignmentLeft).Arguments.Count;\n            }\n            else if (DeclarationExpressionSyntaxWrapper.IsInstance(assignmentLeft)\n                && (DeclarationExpressionSyntaxWrapper)assignmentLeft is { } leftDeclaration\n                && ParenthesizedVariableDesignationSyntaxWrapper.IsInstance(leftDeclaration.Designation))\n            {\n                result = ((ParenthesizedVariableDesignationSyntaxWrapper)leftDeclaration.Designation).Variables.Count;\n            }\n            return result;\n        }\n\n        static ISymbol FindDeconstructor(IEnumerable<ISymbol> deconstructors, int numberOfArguments) =>\n            deconstructors.FirstOrDefault(x => x.GetParameters().Count() == numberOfArguments && x.DeclaredAccessibility.IsAccessibleOutsideTheType());\n    }\n\n    public override void VisitAttribute(AttributeSyntax node)\n    {\n        // Some members that seem unused might be dynamically accessed through reflection.\n        // The DynamicallyAccessedMembersAttribute was introduced to inform tools about such uses.\n        // The attribute is not available on NetFramework and we want to enable this mechanism for these users.\n        // Therefore, we only check the name, but not the namespace and let the users define their own custom version.\n        // https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.dynamicallyaccessedmembersattribute\n        const string DynamicallyAccessedMembers = \"DynamicallyAccessedMembers\";\n        if (node.GetName() is DynamicallyAccessedMembers or $\"{DynamicallyAccessedMembers}Attribute\"\n            && node is { Parent: AttributeListSyntax { Parent: BaseTypeDeclarationSyntax typeDeclaration } }\n            && model.GetDeclaredSymbol(typeDeclaration) is { } typeSymbol)\n        {\n            TypesUsedWithReflection.Add(typeSymbol);\n        }\n        else if (model.GetSymbolInfo(node).Symbol is IMethodSymbol { MethodKind: MethodKind.Constructor, ContainingType: ITypeSymbol attribute })\n        {\n            if (attribute.Is(KnownType.System_Diagnostics_DebuggerDisplayAttribute)\n                && node.ArgumentList is not null)\n            {\n                var arguments = node.ArgumentList.Arguments\n                    .Where(IsValueNameOrType)\n                    .Select(x => model.GetConstantValue(x.Expression))\n                    .Where(x => x.HasValue)\n                    .Select(x => x.Value)\n                    .OfType<string>();\n\n                DebuggerDisplayValues.UnionWith(arguments);\n            }\n            else if (attribute.GetEffectiveAccessibility() == Accessibility.Private)\n            {\n                PrivateAttributes.Add(attribute);\n            }\n        }\n\n        base.VisitAttribute(node);\n\n        static bool IsValueNameOrType(AttributeArgumentSyntax a) =>\n            a.NameColon is null  // Value\n            || a.NameColon.Name.Identifier.ValueText == \"Value\"\n            || a.NameColon.Name.Identifier.ValueText == \"Name\"\n            || a.NameColon.Name.Identifier.ValueText == \"Type\";\n    }\n\n    public override void VisitIdentifierName(IdentifierNameSyntax node)\n    {\n        if (IsKnownIdentifier(node.Identifier))\n        {\n            var symbols = Symbols(node);\n            TryStoreFieldAccess(node, symbols);\n            UsedSymbols.UnionWith(symbols);\n            TryStorePropertyAccess(node, symbols);\n        }\n        base.VisitIdentifierName(node);\n    }\n\n    public override void VisitObjectCreationExpression(ObjectCreationExpressionSyntax node)\n    {\n        if (knownSymbolNames.Contains(node.Type.GetName()))\n        {\n            UsedSymbols.UnionWith(Symbols(node));\n        }\n        base.VisitObjectCreationExpression(node);\n    }\n\n    public override void VisitGenericName(GenericNameSyntax node)\n    {\n        if (IsKnownIdentifier(node.Identifier))\n        {\n            UsedSymbols.UnionWith(Symbols(node));\n        }\n        base.VisitGenericName(node);\n    }\n\n    public override void VisitElementAccessExpression(ElementAccessExpressionSyntax node)\n    {\n        if (node.Expression.IsKind(SyntaxKind.ThisExpression)\n            || knownSymbolNames.Contains(node.Expression.GetIdentifier()?.ValueText)\n            || knownSymbolNames.Contains(model.GetTypeInfo(node.Expression).Type?.Name))\n        {\n            var symbols = Symbols(node);\n            UsedSymbols.UnionWith(symbols);\n            TryStorePropertyAccess(node, symbols);\n        }\n        base.VisitElementAccessExpression(node);\n    }\n\n    public override void VisitConstructorInitializer(ConstructorInitializerSyntax node)\n    {\n        // In this case (\":base()\") we cannot check at the syntax level if the constructor name is in the list\n        // of known names so we have to check for symbols.\n        UsedSymbols.UnionWith(Symbols(node));\n        base.VisitConstructorInitializer(node);\n    }\n\n    public override void VisitInitializerExpression(InitializerExpressionSyntax node)\n    {\n        // Collection initializers implicitly call Add() methods that don't appear in the syntax tree.\n        if (node.IsKind(SyntaxKind.CollectionInitializerExpression) && knownSymbolNames.Contains(\"Add\"))\n        {\n            UsedSymbols.UnionWith(node.Expressions.SelectMany(x => ResolveSymbols(model.GetCollectionInitializerSymbolInfo(x))));\n        }\n        base.VisitInitializerExpression(node);\n    }\n\n    public override void VisitConstructorDeclaration(ConstructorDeclarationSyntax node)\n    {\n        // We are visiting a ctor with no initializer and the compiler will automatically\n        // call the default constructor of the type if declared, or the base type if the\n        // current type does not declare a default constructor.\n        if (node.Initializer is null && IsKnownIdentifier(node.Identifier))\n        {\n            var constructor = model.GetDeclaredSymbol(node);\n            var implicitlyCalledConstructor = ImplicitlyCalledConstructor(constructor);\n            if (implicitlyCalledConstructor is not null)\n            {\n                UsedSymbols.Add(implicitlyCalledConstructor);\n            }\n        }\n        base.VisitConstructorDeclaration(node);\n    }\n\n    public override void VisitVariableDeclarator(VariableDeclaratorSyntax node)\n    {\n        if (IsKnownIdentifier(node.Identifier))\n        {\n            var usage = FieldSymbolUsage(model.GetDeclaredSymbol(node));\n            usage.Declaration = node;\n            if (node.Initializer is not null)\n            {\n                usage.Initializer = node;\n            }\n        }\n        base.VisitVariableDeclarator(node);\n    }\n\n    public override void VisitPropertyDeclaration(PropertyDeclarationSyntax node)\n    {\n        if (node.Initializer is not null && IsKnownIdentifier(node.Identifier))\n        {\n            var symbol = model.GetDeclaredSymbol(node);\n            UsedSymbols.Add(symbol);\n            StorePropertyAccess(symbol, AccessorAccess.Set);\n        }\n        base.VisitPropertyDeclaration(node);\n    }\n\n    private SymbolAccess ParentAccessType(SyntaxNode node) =>\n        node.Parent switch\n        {\n            // (node)\n            ParenthesizedExpressionSyntax parenthesizedExpression => ParentAccessType(parenthesizedExpression),\n            // node;\n            ExpressionStatementSyntax => SymbolAccess.None,\n            // node(_) : <unexpected>\n            InvocationExpressionSyntax invocation => node == invocation.Expression ? SymbolAccess.Read : SymbolAccess.None,\n            // _.node : node._\n            MemberAccessExpressionSyntax memberAccess => node == memberAccess.Name ? ParentAccessType(memberAccess) : SymbolAccess.Read,\n            // _?.node : node?._\n            MemberBindingExpressionSyntax memberBinding => node == memberBinding.Name ? ParentAccessType(memberBinding) : SymbolAccess.Read,\n            // node ??= _ : _ ??= node\n            AssignmentExpressionSyntax assignment when assignment.IsKind(SyntaxKindEx.CoalesceAssignmentExpression) =>\n                node == assignment.Left ? SymbolAccess.ReadWrite : SymbolAccess.Read,\n            // Ignoring distinction assignmentExpression.IsKind(SyntaxKind.SimpleAssignmentExpression) between\n            // \"node = _\" and \"node += _\" both are considered as Write and rely on the parent to know if its read.\n            //  node = _ : _ = node\n            AssignmentExpressionSyntax assignment => node == assignment.Left ? SymbolAccess.Write | ParentAccessType(assignment) : SymbolAccess.Read,\n            // Invocation(node), Invocation(out node), Invocation(ref node)\n            ArgumentSyntax argument => ArgumentAccessType(argument),\n            // node++\n            ExpressionSyntax expressionSyntax when expressionSyntax.IsAnyKind(IncrementKinds) => SymbolAccess.Write | ParentAccessType(expressionSyntax),\n            // => node\n            ArrowExpressionClauseSyntax arrowExpressionClause when arrowExpressionClause.Parent is MethodDeclarationSyntax arrowMethod =>\n                    arrowMethod.ReturnType is not null && arrowMethod.ReturnType.IsKnownType(KnownType.Void, model)\n                        ? SymbolAccess.None\n                        : SymbolAccess.Read,\n            _ => SymbolAccess.Read\n        };\n\n    private static SymbolAccess ArgumentAccessType(ArgumentSyntax argument) =>\n        argument.RefOrOutKeyword.Kind() switch\n        {\n            // out Type node : out node\n            SyntaxKind.OutKeyword => SymbolAccess.Write,\n            // ref node\n            SyntaxKind.RefKeyword => SymbolAccess.ReadWrite,\n            _ => SymbolAccess.Read\n        };\n\n    /// <summary>\n    /// Given a node, it tries to get the symbol or the candidate symbols (if the compiler cannot find the symbol,\n    /// .e.g when the code cannot compile).\n    /// </summary>\n    /// <returns>List of symbols.</returns>\n    private ImmutableArray<ISymbol> Symbols<TSyntaxNode>(TSyntaxNode node) where TSyntaxNode : SyntaxNode =>\n        ResolveSymbols(model.GetSymbolInfo(node)).ToImmutableArray();\n\n    private static IEnumerable<ISymbol> ResolveSymbols(SymbolInfo symbolInfo) =>\n        new[] { symbolInfo.Symbol }\n            .Concat(symbolInfo.CandidateSymbols)\n            .Select(OriginalDefinition)\n            .WhereNotNull();\n\n    private static ISymbol OriginalDefinition(ISymbol candidateSymbol) =>\n        candidateSymbol is IMethodSymbol methodSymbol && methodSymbol.MethodKind == MethodKind.ReducedExtension\n            ? methodSymbol.ReducedFrom?.OriginalDefinition\n            : candidateSymbol?.OriginalDefinition;\n\n    private void TryStorePropertyAccess(ExpressionSyntax node, IEnumerable<ISymbol> identifierSymbols)\n    {\n        var propertySymbols = identifierSymbols.OfType<IPropertySymbol>().ToList();\n        if (propertySymbols.Any())\n        {\n            var access = EvaluatePropertyAccesses(node);\n            foreach (var propertySymbol in propertySymbols)\n            {\n                StorePropertyAccess(propertySymbol, access);\n            }\n        }\n    }\n\n    private void StorePropertyAccess(IPropertySymbol propertySymbol, AccessorAccess access)\n    {\n        if (PropertyAccess.ContainsKey(propertySymbol))\n        {\n            PropertyAccess[propertySymbol] |= access;\n        }\n        else\n        {\n            PropertyAccess[propertySymbol] = access;\n        }\n    }\n\n    private AccessorAccess EvaluatePropertyAccesses(ExpressionSyntax node)\n    {\n        var topmostSyntax = TopmostSyntaxWithTheSameSymbol(node);\n        if (topmostSyntax.Parent is AssignmentExpressionSyntax assignmentExpression)\n        {\n            if (assignmentExpression.IsKind(SyntaxKind.SimpleAssignmentExpression))\n            {\n                // Prop = value --> set\n                // value = Prop --> get\n                return assignmentExpression.Left == topmostSyntax ? AccessorAccess.Set : AccessorAccess.Get;\n            }\n            else\n            {\n                // Prop += value --> get/set\n                return AccessorAccess.Both;\n            }\n        }\n        else if (topmostSyntax.Parent is ArgumentSyntax argument && argument.IsInTupleAssignmentTarget())\n        {\n            return AccessorAccess.Set;\n        }\n        else if (node.IsInNameOfArgument(model))\n        {\n            // nameof(Prop) --> get/set\n            return AccessorAccess.Both;\n        }\n        else\n        {\n            // Prop++ --> get/set\n            return topmostSyntax.Parent.IsAnyKind(IncrementKinds) ? AccessorAccess.Both : AccessorAccess.Get;\n        }\n    }\n\n    private bool IsKnownIdentifier(SyntaxToken identifier) =>\n        knownSymbolNames.Contains(identifier.ValueText);\n\n    private void TryStoreFieldAccess(IdentifierNameSyntax node, IEnumerable<ISymbol> symbols)\n    {\n        var access = ParentAccessType(node);\n        var fieldSymbolUsagesList = FieldSymbolUsagesList(symbols);\n        if (HasFlag(access, SymbolAccess.Read))\n        {\n            foreach (var symbolUsage in fieldSymbolUsagesList)\n            {\n                symbolUsage.Readings.Add(node);\n            }\n        }\n\n        if (HasFlag(access, SymbolAccess.Write))\n        {\n            foreach (var symbolUsage in fieldSymbolUsagesList)\n            {\n                symbolUsage.Writings.Add(node);\n            }\n        }\n\n        static bool HasFlag(SymbolAccess symbolAccess, SymbolAccess flag) => (symbolAccess & flag) != 0;\n    }\n\n    private List<SymbolUsage> FieldSymbolUsagesList(IEnumerable<ISymbol> symbols) =>\n        symbols.Select(FieldSymbolUsage).ToList();\n\n    private SymbolUsage FieldSymbolUsage(ISymbol symbol) =>\n        FieldSymbolUsages.GetOrAdd(symbol, x => new SymbolUsage(x));\n\n    private static SyntaxNode TopmostSyntaxWithTheSameSymbol(SyntaxNode identifier) =>\n        // All of the cases below could be parts of invocation or other expressions\n        identifier.Parent switch\n        {\n            // this.identifier or a.identifier or ((a)).identifier, but not identifier.other\n            MemberAccessExpressionSyntax memberAccess when memberAccess.Name == identifier => memberAccess.GetSelfOrTopParenthesizedExpression(),\n            // this?.identifier or a?.identifier or ((a))?.identifier, but not identifier?.other\n            MemberBindingExpressionSyntax memberBinding when memberBinding.Name == identifier => memberBinding.Parent.GetSelfOrTopParenthesizedExpression(),\n            // identifier or ((identifier))\n            _ => identifier.GetSelfOrTopParenthesizedExpression()\n        };\n\n    private static IMethodSymbol ImplicitlyCalledConstructor(IMethodSymbol constructor) =>\n        // In case there is no other explicitly called constructor in a constructor declaration\n        // the compiler will automatically put a call to the current class' default constructor,\n        // or if the declaration is the default constructor or there is no default constructor,\n        // the compiler will put a call the base class' default constructor.\n        IsDefaultConstructor(constructor)\n            ? DefaultConstructor(constructor.ContainingType.BaseType)\n            : DefaultConstructor(constructor.ContainingType) ?? DefaultConstructor(constructor.ContainingType.BaseType);\n\n    private static IMethodSymbol DefaultConstructor(INamedTypeSymbol namedType) =>\n        // See https://github.com/SonarSource/sonar-dotnet/issues/3155\n        namedType?.InstanceConstructors.FirstOrDefault(IsDefaultConstructor);\n\n    private static bool IsDefaultConstructor(IMethodSymbol constructor) =>\n        constructor.Parameters.Length == 0;\n\n    private static string Name(ISymbol symbol) =>\n        symbol.IsConstructor() ? symbol.ContainingType.Name : symbol.Name;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Walkers/CatchLoggingInvocationWalker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing static Roslyn.Utilities.SonarAnalyzer.Shared.LoggingFrameworkMethods;\n\nnamespace SonarAnalyzer.CSharp.Walkers;\n\n// The walker is used to:\n// - visit the catch clause (all the nested catch clauses are skipped; they will be visited independently)\n// - save the declared exception\n// - save the logging invocation that uses the exception\n// - find all the logging invocations and check if the exception is logged\n// - if the exception is logged, it will stop looking for the other invocations and set IsExceptionLogged to true\n// - if the exception is not logged, it will visit all the invocations\npublic class CatchLoggingInvocationWalker(SemanticModel model) : SafeCSharpSyntaxWalker\n{\n    internal readonly SemanticModel Model = model;\n\n    private bool isFirstCatchClauseVisited;\n    private bool hasWhenFilterWithDeclarations;\n\n    internal ISymbol CaughtException;\n\n    public bool IsExceptionLogged { get; private set; }\n    public InvocationExpressionSyntax LoggingInvocationWithException { get; private set; }\n    public IList<InvocationExpressionSyntax> LoggingInvocationsWithoutException { get; } = new List<InvocationExpressionSyntax>();\n\n    private static readonly ImmutableArray<LoggingInvocationDescriptor> LoggingInvocationDescriptors = ImmutableArray.Create(\n        new LoggingInvocationDescriptor(MicrosoftExtensionsLogging, KnownType.Microsoft_Extensions_Logging_LoggerExtensions, false),\n        new LoggingInvocationDescriptor(CastleCoreOrCommonCore, KnownType.Castle_Core_Logging_ILogger, true),\n        new LoggingInvocationDescriptor(CastleCoreOrCommonCore, KnownType.Common_Logging_ILog, true),\n        new LoggingInvocationDescriptor(Log4NetILog, KnownType.log4net_ILog, true),\n        new LoggingInvocationDescriptor(Log4NetILogExtensions, KnownType.log4net_Util_ILogExtensions, false),\n        new LoggingInvocationDescriptor(NLogLoggingMethods, KnownType.NLog_ILogger, true),\n        new LoggingInvocationDescriptor(NLogLoggingMethods, KnownType.NLog_ILoggerExtensions, false),\n        new LoggingInvocationDescriptor(NLogILoggerBase, KnownType.NLog_ILoggerBase, true),\n        new LoggingInvocationDescriptor(Serilog, KnownType.Serilog_ILogger, true),\n        new LoggingInvocationDescriptor(Serilog, KnownType.Serilog_Log, false));\n\n    public override void VisitCatchClause(CatchClauseSyntax node)\n    {\n        // We want to look for logging invocations only in the main catch clause.\n        if (isFirstCatchClauseVisited)\n        {\n            return;\n        }\n\n        isFirstCatchClauseVisited = true;\n        hasWhenFilterWithDeclarations = node.Filter != null && node.Filter.DescendantNodes().Any(DeclarationPatternSyntaxWrapper.IsInstance);\n        if (node.Declaration != null && !node.Declaration.Identifier.IsKind(SyntaxKind.None))\n        {\n            CaughtException = Model.GetDeclaredSymbol(node.Declaration);\n        }\n        base.VisitCatchClause(node);\n    }\n\n    public override void VisitInvocationExpression(InvocationExpressionSyntax node)\n    {\n        if (!IsExceptionLogged && IsLoggingInvocation(node, Model))\n        {\n            if (GetArgumentSymbolDerivedFromException(node, Model) is { } currentException\n                && (hasWhenFilterWithDeclarations || currentException.Equals(CaughtException)))\n            {\n                IsExceptionLogged = true;\n                LoggingInvocationWithException = node;\n                return;\n            }\n            else\n            {\n                LoggingInvocationsWithoutException.Add(node);\n            }\n        }\n        base.VisitInvocationExpression(node);\n    }\n\n    public override void VisitParenthesizedLambdaExpression(ParenthesizedLambdaExpressionSyntax node)\n    {\n        // Skip processing to avoid false positives.\n    }\n\n    public override void VisitSimpleLambdaExpression(SimpleLambdaExpressionSyntax node)\n    {\n        // Skip processing to avoid false positives.\n    }\n\n    private static ISymbol GetArgumentSymbolDerivedFromException(InvocationExpressionSyntax invocation, SemanticModel semanticModel) =>\n        invocation.ArgumentList.Arguments\n            .Where(x => semanticModel.GetTypeInfo(x.Expression).Type.DerivesFrom(KnownType.System_Exception))\n            .Select(x => x.Expression is MemberAccessExpressionSyntax memberAccess && memberAccess.NameIs(\"InnerException\")\n                ? semanticModel.GetSymbolInfo(memberAccess.Expression).Symbol\n                : semanticModel.GetSymbolInfo(x.Expression).Symbol)\n            .FirstOrDefault();\n\n    private static bool IsLoggingInvocation(InvocationExpressionSyntax invocation, SemanticModel model) =>\n        LoggingInvocationDescriptors.Any(x => IsLoggingInvocation(invocation, model, x.MethodNames, x.ContainingType, x.CheckDerivedTypes));\n\n    private static bool IsLoggingInvocation(InvocationExpressionSyntax invocation, SemanticModel model, ICollection<string> methodNames, KnownType containingType, bool checkDerivedTypes) =>\n        methodNames.Contains(invocation.GetIdentifier().ToString())\n        && model.GetSymbolInfo(invocation).Symbol is { } invocationSymbol\n        && invocationSymbol.HasContainingType(containingType, checkDerivedTypes);\n\n    private record struct LoggingInvocationDescriptor(HashSet<string> MethodNames, KnownType ContainingType, bool CheckDerivedTypes);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/Walkers/ParameterValidationInMethodWalker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Walkers;\n\ninternal class ParameterValidationInMethodWalker : SafeCSharpSyntaxWalker\n{\n    private static readonly ISet<SyntaxKind> SubMethodEquivalents =\n        new HashSet<SyntaxKind>\n        {\n            SyntaxKindEx.LocalFunctionStatement,        // Local function\n            SyntaxKind.SimpleLambdaExpression,          // Action\n            SyntaxKind.ParenthesizedLambdaExpression    // Func\n        };\n\n    private readonly SemanticModel model;\n    private readonly List<SecondaryLocation> argumentExceptionLocations = new();\n\n    protected bool keepWalking = true;\n\n    public IEnumerable<SecondaryLocation> ArgumentExceptionLocations => argumentExceptionLocations;\n\n    protected virtual string SecondaryMessage => null;\n\n    public ParameterValidationInMethodWalker(SemanticModel model) =>\n        this.model = model;\n\n    public override void Visit(SyntaxNode node)\n    {\n        if (keepWalking\n            && !node.IsAnyKind(SubMethodEquivalents))  // Don't explore deeper if this node is equivalent to a method declaration\n        {\n            base.Visit(node);\n        }\n    }\n\n    public override void VisitThrowStatement(ThrowStatementSyntax node)\n    {\n        // When throw is like `throw new XXX` where XXX derives from ArgumentException, save location\n        if (node.Expression is not null\n            && model.GetTypeInfo(node.Expression) is var typeInfo\n            && typeInfo.Type.DerivesFrom(KnownType.System_ArgumentException))\n        {\n            argumentExceptionLocations.Add(node.Expression.ToSecondaryLocation(SecondaryMessage));\n        }\n\n        // there is no need to visit children\n    }\n\n    public override void VisitInvocationExpression(InvocationExpressionSyntax node)\n    {\n        if (node.IsMemberAccessOnKnownType(\"ThrowIfNull\", KnownType.System_ArgumentNullException, model))\n        {\n            // \"ThrowIfNull\" returns void so it cannot be an argument. We can stop.\n            argumentExceptionLocations.Add(node.ToSecondaryLocation(SecondaryMessage));\n        }\n        else\n        {\n            // Need to check the children of this node because of the pattern (await SomeTask()).Invocation()\n            base.VisitInvocationExpression(node);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/packages.lock.json",
    "content": "{\n  \"version\": 1,\n  \"dependencies\": {\n    \".NETStandard,Version=v2.0\": {\n      \"Microsoft.CodeAnalysis.CSharp.Workspaces\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.3.2, )\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"MwGmrrPx3okEJuCogSn4TM3yTtJUDdmTt8RXpnjVo0dPund0YSAq4bHQQ9bxgArbrrapcopJmkb7UOLAvanXkg==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp\": \"[1.3.2]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2]\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[3.3.1, )\",\n        \"resolved\": \"3.3.1\",\n        \"contentHash\": \"eT+kgNCDdTRbQ5WF6BGx1HI3D5jYfHteza/koefhWC2vNZGxObA74XxwWfg40dy3uUv7dn3OGKLK5GUPLroVog==\"\n      },\n      \"NETStandard.Library\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[2.0.3, )\",\n        \"resolved\": \"2.0.3\",\n        \"contentHash\": \"st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.1.0\"\n        }\n      },\n      \"SonarAnalyzer.CSharp.Styling\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[10.21.0.135717, )\",\n        \"resolved\": \"10.21.0.135717\",\n        \"contentHash\": \"hl264jF539oB7m2jED5QGM345eFSiDAdoJc8TH0HM6L7ZeqT5TDqZDQeZ8IDP02dVIpH/Fhhn+HsGfEcj8ohyQ==\"\n      },\n      \"StyleCop.Analyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.2.0-beta.556, )\",\n        \"resolved\": \"1.2.0-beta.556\",\n        \"contentHash\": \"llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==\",\n        \"dependencies\": {\n          \"StyleCop.Analyzers.Unstable\": \"1.2.0.556\"\n        }\n      },\n      \"System.Collections.Immutable\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.1.37, )\",\n        \"resolved\": \"1.1.37\",\n        \"contentHash\": \"fTpqwZYBzoklTT+XjTRK8KxvmrGkYHzBiylCcKyQcxiOM8k+QvhNBxRvFHDWzy4OEP5f8/9n+xQ9mEgEXY+muA==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.0\",\n          \"System.Diagnostics.Debug\": \"4.0.0\",\n          \"System.Globalization\": \"4.0.0\",\n          \"System.Linq\": \"4.0.0\",\n          \"System.Resources.ResourceManager\": \"4.0.0\",\n          \"System.Runtime\": \"4.0.0\",\n          \"System.Runtime.Extensions\": \"4.0.0\",\n          \"System.Threading\": \"4.0.0\"\n        }\n      },\n      \"Google.Protobuf\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"3.6.1\",\n        \"contentHash\": \"741fGeDQjixBJaU2j+0CbrmZXsNJkTn/hWbOh4fLVXndHsCclJmWznCPWrJmPoZKvajBvAz3e8ECJOUvRtwjNQ==\",\n        \"dependencies\": {\n          \"NETStandard.Library\": \"1.6.1\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.1.0\",\n        \"contentHash\": \"HS3iRWZKcUw/8eZ/08GXKY2Bn7xNzQPzf8gRPHGSowX7u7XXu9i9YEaBeBNKUXWfI7qjvT2zXtLUvbN0hds8vg==\"\n      },\n      \"Microsoft.CodeAnalysis.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"lOinFNbjpCvkeYQHutjKi+CfsjoKu88wAFT6hAumSR/XJSJmmVGvmnbzCWW8kUJnDVrw1RrcqS8BzgPMj263og==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"1.1.0\",\n          \"System.AppContext\": \"4.1.0\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.Collections.Concurrent\": \"4.0.12\",\n          \"System.Collections.Immutable\": \"1.2.0\",\n          \"System.Console\": \"4.0.0\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Diagnostics.FileVersionInfo\": \"4.0.0\",\n          \"System.Diagnostics.StackTrace\": \"4.0.1\",\n          \"System.Diagnostics.Tools\": \"4.0.1\",\n          \"System.Dynamic.Runtime\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Linq.Expressions\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Metadata\": \"1.3.0\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Runtime.Numerics\": \"4.0.1\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.X509Certificates\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Text.Encoding.CodePages\": \"4.0.1\",\n          \"System.Text.Encoding.Extensions\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\",\n          \"System.Threading.Tasks.Parallel\": \"4.0.1\",\n          \"System.Threading.Thread\": \"4.0.0\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\",\n          \"System.Xml.XDocument\": \"4.0.11\",\n          \"System.Xml.XPath.XDocument\": \"4.0.1\",\n          \"System.Xml.XmlDocument\": \"4.0.1\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"GrYMp6ScZDOMR0fNn/Ce6SegNVFw1G/QRT/8FiKv7lAP+V6lEZx9e42n0FvFUgjjcKgcEJOI4muU6i+3LSvOBA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Common\": \"[1.3.2]\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Workspaces.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"kvdo+rkImlx5MuBgkayl4OV3Mg8/qirUdYgCIfQ9EqN15QasJFlQXmDAtCGqpkK9sYLLO/VK+y+4mvKjfh/FOA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Common\": \"[1.3.2]\",\n          \"Microsoft.Composition\": \"1.0.27\"\n        }\n      },\n      \"Microsoft.Composition\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.27\",\n        \"contentHash\": \"pwu80Ohe7SBzZ6i69LVdzowp6V+LaVRzd5F7A6QlD42vQkX0oT7KXKWWPlM/S00w1gnMQMRnEdbtOV12z6rXdQ==\"\n      },\n      \"Microsoft.NETCore.Platforms\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.1.0\",\n        \"contentHash\": \"kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==\"\n      },\n      \"Microsoft.NETCore.Targets\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.1\",\n        \"contentHash\": \"rkn+fKobF/cbWfnnfBOQHKVKIOpxMZBvlSHkqDWgBpwGDcLRduvs3D9OLGeV6GWGvVwNlVi2CBbTjuPmtHvyNw==\"\n      },\n      \"runtime.native.System\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"QfS/nQI7k/BLgmLrw7qm7YBoULEvgWnPI+cYsbfCVFTW8Aj+i8JhccxcFMu1RWms0YZzF+UHguNBK4Qn89e2Sg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\"\n        }\n      },\n      \"runtime.native.System.Net.Http\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"Nh0UPZx2Vifh8r+J+H2jxifZUD3sBrmolgiFWJd2yiNrxO0xTa6bAw3YwRn1VOiSen/tUXMS31ttNItCZ6lKuA==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\"\n        }\n      },\n      \"runtime.native.System.Security.Cryptography\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"2CQK0jmO6Eu7ZeMgD+LOFbNJSXHFVQbCJJkEyEwowh1SCgYnrn9W9RykMfpeeVGw7h4IBvYikzpGUlmZTUafJw==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\"\n        }\n      },\n      \"StyleCop.Analyzers.Unstable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.2.0.556\",\n        \"contentHash\": \"zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==\"\n      },\n      \"System.AppContext\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"3QjO4jNV7PdKkmQAVp9atA+usVnKRwI3Kx1nMwJ93T0LcQfx7pKAYk0nKz5wn1oP5iqlhZuy6RXOFdhr7rDwow==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Collections\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"YUJGz6eFKqS0V//mLt25vFGrrCvOnsXjlvFQs+KimpwNxug9x0Pzy4PlFMU3Q2IzqAa9G2L4LsK3+9vCBK7oTg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Collections.Concurrent\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.12\",\n        \"contentHash\": \"2gBcbb3drMLgxlI0fBfxMA31ec6AEyYCHygGse4vxceJan8mRIWeKJ24BFzN7+bi/NFTgdIgufzb94LWO5EERQ==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Diagnostics.Tracing\": \"4.1.0\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Console\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"qSKUSOIiYA/a0g5XXdxFcUFmv1hNICBD7QZ0QhGYVipPIhvpiydY8VZqr1thmCXvmn8aipMg64zuanB4eotK9A==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\"\n        }\n      },\n      \"System.Diagnostics.Debug\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"w5U95fVKHY4G8ASs/K5iK3J5LY+/dLFd4vKejsnI/ZhBsWS9hQakfx3Zr7lRWKg4tAw9r4iktyvsTagWkqYCiw==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Diagnostics.FileVersionInfo\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"qjF74OTAU+mRhLaL4YSfiWy3vj6T3AOz8AW37l5zCwfbBfj0k7E94XnEsRaf2TnhE/7QaV6Hvqakoy2LoV8MVg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Reflection.Metadata\": \"1.3.0\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.InteropServices\": \"4.1.0\"\n        }\n      },\n      \"System.Diagnostics.StackTrace\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"6i2EbRq0lgGfiZ+FDf0gVaw9qeEU+7IS2+wbZJmFVpvVzVOgZEt0ScZtyenuBvs6iDYbGiF51bMAa0oDP/tujQ==\",\n        \"dependencies\": {\n          \"System.Collections.Immutable\": \"1.2.0\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Metadata\": \"1.3.0\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\"\n        }\n      },\n      \"System.Diagnostics.Tools\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"xBfJ8pnd4C17dWaC9FM6aShzbJcRNMChUMD42I6772KGGrqaFdumwhn9OdM68erj1ueNo3xdQ1EwiFjK5k8p0g==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Diagnostics.Tracing\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"vDN1PoMZCkkdNjvZLql592oYJZgS7URcJzJ7bxeBgGtx5UtR5leNm49VmfHGqIffX4FKacHbI3H6UyNSHQknBg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Dynamic.Runtime\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"db34f6LHYM0U0JpE+sOmjar27BnqTVkbLJhgfwMpTdgTigG/Hna3m2MYVwnFzGGKnEJk2UXFuoVTr8WUbU91/A==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Linq.Expressions\": \"4.1.0\",\n          \"System.ObjectModel\": \"4.0.12\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Emit\": \"4.0.1\",\n          \"System.Reflection.Emit.ILGeneration\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Reflection.TypeExtensions\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Globalization\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"B95h0YLEL2oSnwF/XjqSWKnwKOy/01VWkNlsCeMTFJLLabflpGV26nK164eRs5GiaRSBGpOxQ3pKoSnnyZN5pg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Globalization.Calendars\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"L1c6IqeQ88vuzC1P81JeHmHA8mxq8a18NUBNXnIY/BVb+TCyAaGIFbhpZt60h9FJNmisymoQkHEFSE9Vslja1Q==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.IO\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"3KlTJceQc3gnGIaHZ7UBZO26SHL1SHE4ddrmiwumFnId+CEHP+O8r386tZKaE6zlk5/mF8vifMBzHj9SaXN+mQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.IO.FileSystem\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"IBErlVq5jOggAD69bg1t0pJcHaDbJbWNUZTPI96fkYWzwYbN6D9wRHMULLDd9dHsl7C2YsxXL31LMfPI1SWt8w==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.IO.FileSystem.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"kWkKD203JJKxJeE74p8aF8y4Qc9r9WQx4C0cHzHPrY3fv/L/IhWnyCHaFJ3H1QPOH6A93whlQ2vG5nHlBDvzWQ==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Linq\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"bQ0iYFOQI0nuTnt+NQADns6ucV4DUvMdwN6CbkB1yj8i7arTGiTN5eok1kQwdnnNWSDZfIUySQY+J3d5KjWn0g==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\"\n        }\n      },\n      \"System.Linq.Expressions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"I+y02iqkgmCAyfbqOmSDOgqdZQ5tTj80Akm5BPSS8EeB0VGWdy6X1KCoYe8Pk6pwDoAKZUOdLVxnTJcExiv5zw==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.ObjectModel\": \"4.0.12\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Emit\": \"4.0.1\",\n          \"System.Reflection.Emit.ILGeneration\": \"4.0.1\",\n          \"System.Reflection.Emit.Lightweight\": \"4.0.1\",\n          \"System.Reflection.Extensions\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Reflection.TypeExtensions\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.ObjectModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.12\",\n        \"contentHash\": \"tAgJM1xt3ytyMoW4qn4wIqgJYm7L7TShRZG4+Q4Qsi2PCcj96pXN7nRywS9KkB3p/xDUjc2HSwP9SROyPYDYKQ==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Reflection\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"JCKANJ0TI7kzoQzuwB/OoJANy1Lg338B6+JVacPl4TpUwi3cReg3nMLplMq2uqYfHFQpKIlHAUVAJlImZz/4ng==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Emit\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"P2wqAj72fFjpP6wb9nSfDqNBMab+2ovzSDzUZK7MVIm54tBJEPr9jWfSjjoTpPwj1LeKcmX3vr0ttyjSSFM47g==\",\n        \"dependencies\": {\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Emit.ILGeneration\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Emit.ILGeneration\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"Ov6dU8Bu15Bc7zuqttgHF12J5lwSWyTf1S+FJouUXVMSqImLZzYaQ+vRr1rQ0OZ0HqsrwWl4dsKHELckQkVpgA==\",\n        \"dependencies\": {\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Emit.Lightweight\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"sSzHHXueZ5Uh0OLpUQprhr+ZYJrLPA2Cmr4gn0wj9+FftNKXx8RIMKvO9qnjk2ebPYUjZ+F2ulGdPOsvj+MEjA==\",\n        \"dependencies\": {\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Emit.ILGeneration\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"GYrtRsZcMuHF3sbmRHfMYpvxZoIN2bQGrYGerUiWLEkqdEUQZhH3TRSaC/oI4wO0II1RKBPlpIa1TOMxIcOOzQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Metadata\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.0\",\n        \"contentHash\": \"jMSCxA4LSyKBGRDm/WtfkO03FkcgRzHxwvQRib1bm2GZ8ifKM1MX1al6breGCEQK280mdl9uQS7JNPXRYk90jw==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Collections.Immutable\": \"1.2.0\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Extensions\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Text.Encoding.Extensions\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Reflection.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"4inTox4wTBaDhB7V3mPvp9XlCbeGYWVEM9/fXALd52vNEAVisc1BoVWQPuUuD0Ga//dNbA/WeMy9u9mzLxGTHQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.TypeExtensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"tsQ/ptQ3H5FYfON8lL4MxRk/8kFyE0A+tGPXmVP967cT/gzLHYxIejIYSxp4JmIeFHVP78g/F2FE1mUUTbDtrg==\",\n        \"dependencies\": {\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Resources.ResourceManager\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"TxwVeUNoTgUOdQ09gfTjvW411MF+w9MBYL7AtNVc+HtBCFlutPLhUCdZjNkjbhj3bNQWMdHboF0KIWEOjJssbA==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Runtime\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"v6c/4Yaa9uWsq+JMhnOFewrYkgdNHNG2eMKuNqRn8P733rNXeRCGvV5FkkjBXn2dbVkPXOsO0xjsEeM1q2zC0g==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\"\n        }\n      },\n      \"System.Runtime.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"CUOHjTT/vgP0qGW22U4/hDlOqXmcPq5YicBaXdUR2UiUoLwBT+olO6we4DVbq57jeX5uXH2uerVZhf0qGj+sVQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Runtime.Handles\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"nCJvEKguXEvk2ymk1gqj625vVnlK3/xdGzx0vOKicQkoquaTBJTP13AIYkocSUwHCLNBwUbXTqTWGDxBTWpt7g==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Runtime.InteropServices\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"16eu3kjHS633yYdkjwShDHZLRNMKVi/s0bY8ODiqJ2RfMhDMAwxZaUaWVnZ2P71kr/or+X9o/xFWtNqz8ivieQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\"\n        }\n      },\n      \"System.Runtime.Numerics\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"+XbKFuzdmLP3d1o9pdHu2nxjNr2OEPqGzKeegPLCUMM71a0t50A/rOcIRmGs9wR7a8KuHX6hYs/7/TymIGLNqg==\",\n        \"dependencies\": {\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\"\n        }\n      },\n      \"System.Security.Cryptography.Algorithms\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.2.0\",\n        \"contentHash\": \"8JQFxbLVdrtIOKMDN38Fn0GWnqYZw/oMlwOUG/qz1jqChvyZlnUmu+0s7wLx7JYua/nAXoESpHA3iw11QFWhXg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Runtime.Numerics\": \"4.0.1\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"runtime.native.System.Security.Cryptography\": \"4.0.0\"\n        }\n      },\n      \"System.Security.Cryptography.Cng\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.2.0\",\n        \"contentHash\": \"cUJ2h+ZvONDe28Szw3st5dOHdjndhJzQ2WObDEXAWRPEQBtVItVoxbXM/OEsTthl3cNn2dk2k0I3y45igCQcLw==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\"\n        }\n      },\n      \"System.Security.Cryptography.Csp\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"/i1Usuo4PgAqgbPNC0NjbO3jPW//BoBlTpcWFD1EHVbidH21y4c1ap5bbEMSGAXjAShhMH4abi/K8fILrnu4BQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Security.Cryptography.Encoding\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"FbKgE5MbxSQMPcSVRgwM6bXN3GtyAh04NkV8E5zKCBE26X0vYW0UtTa2FIgkH33WVqBVxRgxljlVYumWtU+HcQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.Collections.Concurrent\": \"4.0.12\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"runtime.native.System.Security.Cryptography\": \"4.0.0\"\n        }\n      },\n      \"System.Security.Cryptography.OpenSsl\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"HUG/zNUJwEiLkoURDixzkzZdB5yGA5pQhDP93ArOpDPQMteURIGERRNzzoJlmTreLBWr5lkFSjjMSk8ySEpQMw==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Runtime.Numerics\": \"4.0.1\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"runtime.native.System.Security.Cryptography\": \"4.0.0\"\n        }\n      },\n      \"System.Security.Cryptography.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"Wkd7QryWYjkQclX0bngpntW5HSlMzeJU24UaLJQ7YTfI8ydAVAaU2J+HXLLABOVJlKTVvAeL0Aj39VeTe7L+oA==\",\n        \"dependencies\": {\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Security.Cryptography.X509Certificates\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"4HEfsQIKAhA1+ApNn729Gi09zh+lYWwyIuViihoMDWp1vQnEkL2ct7mAbhBlLYm+x/L4Rr/pyGge1lIY635e0w==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Globalization.Calendars\": \"4.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Runtime.Numerics\": \"4.0.1\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Cng\": \"4.2.0\",\n          \"System.Security.Cryptography.Csp\": \"4.0.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.OpenSsl\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\",\n          \"runtime.native.System\": \"4.0.0\",\n          \"runtime.native.System.Net.Http\": \"4.0.1\",\n          \"runtime.native.System.Security.Cryptography\": \"4.0.0\"\n        }\n      },\n      \"System.Text.Encoding\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"U3gGeMlDZXxCEiY4DwVLSacg+DFWCvoiX+JThA/rvw37Sqrku7sEFeVBBBMBnfB6FeZHsyDx85HlKL19x0HtZA==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Text.Encoding.CodePages\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"h4z6rrA/hxWf4655D18IIZ0eaLRa3tQC/j+e26W+VinIHY0l07iEXaAvO0YSYq3MvCjMYy8Zs5AdC1sxNQOB7Q==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Text.Encoding.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"jtbiTDtvfLYgXn8PTfWI+SiBs51rrmO4AAckx4KR6vFK9Wzf6tI8kcRdsYQNwriUeQ1+CtQbM1W4cMbLXnj/OQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\"\n        }\n      },\n      \"System.Text.RegularExpressions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"i88YCXpRTjCnoSQZtdlHkAOx4KNNik4hMy83n0+Ftlb7jvV6ZiZWMpnEZHhjBp6hQVh8gWd/iKNPzlPF7iyA2g==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Threading\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"N+3xqIcg3VDKyjwwCGaZ9HawG9aC6cSDI+s7ROma310GQo8vilFZa86hqKppwTHleR/G0sfOzhvgnUxWCR/DrQ==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Threading.Tasks\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"k1S4Gc6IGwtHGT8188RSeGaX86Qw/wnrgNLshJvsdNUOPP9etMmo8S07c+UlOAx4K/xLuN9ivA1bD0LVurtIxQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Threading.Tasks.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"pH4FZDsZQ/WmgJtN4LWYmRdJAEeVkyriSwrv2Teoe5FOU0Yxlb6II6GL8dBPOfRmutHGATduj3ooMt7dJ2+i+w==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Threading.Tasks.Parallel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"7Pc9t25bcynT9FpMvkUw4ZjYwUiGup/5cJFW72/5MgCG+np2cfVUMdh29u8d7onxX7d8PS3J+wL73zQRqkdrSA==\",\n        \"dependencies\": {\n          \"System.Collections.Concurrent\": \"4.0.12\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Diagnostics.Tracing\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Threading.Thread\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"gIdJqDXlOr5W9zeqFErLw3dsOsiShSCYtF9SEHitACycmvNvY8odf9kiKvp6V7aibc8C4HzzNBkWXjyfn7plbQ==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Xml.ReaderWriter\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"ZIiLPsf67YZ9zgr31vzrFaYQqxRPX9cVHjtPSnmx4eN6lbS/yEyYNr2vs1doGDEscF0tjCZFsk9yUg1sC9e8tg==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Text.Encoding.Extensions\": \"4.0.11\",\n          \"System.Text.RegularExpressions\": \"4.1.0\",\n          \"System.Threading.Tasks\": \"4.0.11\",\n          \"System.Threading.Tasks.Extensions\": \"4.0.0\"\n        }\n      },\n      \"System.Xml.XDocument\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"Mk2mKmPi0nWaoiYeotq1dgeNK1fqWh61+EK+w4Wu8SWuTYLzpUnschb59bJtGywaPq7SmTuPf44wrXRwbIrukg==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Diagnostics.Tools\": \"4.0.1\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\"\n        }\n      },\n      \"System.Xml.XmlDocument\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"2eZu6IP+etFVBBFUFzw2w6J21DqIN5eL9Y8r8JfJWUmV28Z5P0SNU01oCisVHQgHsDhHPnmq2s1hJrJCFZWloQ==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\"\n        }\n      },\n      \"System.Xml.XPath\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"UWd1H+1IJ9Wlq5nognZ/XJdyj8qPE4XufBUkAW59ijsCPjZkZe0MUzKKJFBr+ZWBe5Wq1u1d5f2CYgE93uH7DA==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\"\n        }\n      },\n      \"System.Xml.XPath.XDocument\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"FLhdYJx4331oGovQypQ8JIw2kEmNzCsjVOVYY/16kZTUoquZG85oVn7yUhBE2OZt1yGPSXAL0HTEfzjlbNpM7Q==\",\n        \"dependencies\": {\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\",\n          \"System.Xml.XDocument\": \"4.0.11\",\n          \"System.Xml.XPath\": \"4.0.1\"\n        }\n      },\n      \"sonaranalyzer.cfg\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer.Lightup\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.core\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Google.Protobuf\": \"[3.6.1, )\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.CFG\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.csharp.core\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.CFG\": \"[10.26.0, )\",\n          \"SonarAnalyzer.Core\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer.lightup\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp/sonarpedia.json",
    "content": "{\n  \"rules-metadata-path\": \"../../rspec/cs/\",\n  \"languages\": [\n    \"CSH\"\n  ],\n  \"latest-update\": \"2026-04-27T06:50:49.973042900Z\",\n  \"options\": {\n    \"no-language-in-filenames\": true\n  }\n}"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Common/DescriptorFactory.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Core.Rspec;\n\nnamespace SonarAnalyzer.CSharp.Core.Common;\n\npublic static class DescriptorFactory\n{\n    public static DiagnosticDescriptor Create(string id, string messageFormat, bool? isEnabledByDefault = null, bool fadeOutCode = false, bool isCompilationEnd = false) =>\n        // RuleCatalog class is created from SonarAnalyzer.SourceGenerator\n        DiagnosticDescriptorFactory.Create(AnalyzerLanguage.CSharp, RuleCatalog.Rules[id], messageFormat, isEnabledByDefault, fadeOutCode, isCompilationEnd);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Common/SyntaxConstants.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Common;\n\npublic static class SyntaxConstants\n{\n    public const string Discard = \"_\";\n    public const string Private = \"private\";\n    public const string Protected = \"protected\";\n    public const string Internal = \"internal\";\n    public const string NameOfKeywordText = \"nameof\";\n\n    public static readonly ExpressionSyntax NullLiteralExpression = SyntaxFactory.LiteralExpression(SyntaxKind.NullLiteralExpression);\n    public static readonly ExpressionSyntax FalseLiteralExpression = SyntaxFactory.LiteralExpression(SyntaxKind.FalseLiteralExpression);\n    public static readonly ExpressionSyntax TrueLiteralExpression = SyntaxFactory.LiteralExpression(SyntaxKind.TrueLiteralExpression);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Extensions/CSharpCompilationExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Extensions;\n\npublic static class CSharpCompilationExtensions\n{\n    public static bool IsCoalesceAssignmentSupported(this Compilation compilation) =>\n        compilation.IsAtLeastLanguageVersion(LanguageVersionEx.CSharp8);\n\n    public static bool IsTargetTypeConditionalSupported(this Compilation compilation) =>\n        compilation.IsAtLeastLanguageVersion(LanguageVersionEx.CSharp9);\n\n    public static bool IsLambdaDiscardParameterSupported(this Compilation compilation) =>\n        compilation.IsAtLeastLanguageVersion(LanguageVersionEx.CSharp9);\n\n    public static bool IsAtLeastLanguageVersion(this Compilation compilation, LanguageVersion languageVersion) =>\n        compilation.GetLanguageVersion().IsAtLeast(languageVersion);\n\n    public static LanguageVersion GetLanguageVersion(this Compilation compilation) =>\n        ((CSharpCompilation)compilation).LanguageVersion;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Extensions/IAnalyzerConfigurationExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Extensions;\n\npublic static class IAnalyzerConfigurationExtensions\n{\n    public static bool UseSonarCfg(this IAnalyzerConfiguration configuration) =>\n        configuration.ForceSonarCfg || !CFG.Roslyn.ControlFlowGraph.IsAvailable;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Extensions/ICompilationReportExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Extensions;\n\n// Don't change the this parameter to (this IAnalysisContext context) because it would cause boxing\npublic static class ICompilationReportExtensions\n{\n    extension<TContext>(TContext context) where TContext : ICompilationReport\n    {\n        public void ReportIssue(DiagnosticDescriptor rule, SyntaxNode locationSyntax, params string[] messageArgs) =>\n            context.ReportIssue(CSharpGeneratedCodeRecognizer.Instance, rule, locationSyntax, messageArgs);\n\n        public void ReportIssue(DiagnosticDescriptor rule, SyntaxToken locationToken, params string[] messageArgs) =>\n            context.ReportIssue(CSharpGeneratedCodeRecognizer.Instance, rule, locationToken, messageArgs);\n\n        public void ReportIssue(DiagnosticDescriptor rule, Location location, params string[] messageArgs) =>\n            context.ReportIssue(CSharpGeneratedCodeRecognizer.Instance, rule, location, messageArgs);\n\n        public void ReportIssue(DiagnosticDescriptor rule, Location primaryLocation, IEnumerable<SecondaryLocation> secondaryLocations, params string[] messageArgs) =>\n            context.ReportIssue(CSharpGeneratedCodeRecognizer.Instance, rule, primaryLocation, secondaryLocations, messageArgs);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Extensions/IFieldSymbolExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Extensions;\n\npublic static class IFieldSymbolExtensions\n{\n    public static bool IsNonStaticNonPublicDisposableField(this IFieldSymbol fieldSymbol, LanguageVersion languageVersion) =>\n        fieldSymbol != null\n        && !fieldSymbol.IsStatic\n        && (fieldSymbol.DeclaredAccessibility == Accessibility.Protected || fieldSymbol.DeclaredAccessibility == Accessibility.Private)\n        && IsDisposable(fieldSymbol, languageVersion);\n\n    private static bool IsDisposable(this IFieldSymbol fieldSymbol, LanguageVersion languageVersion) =>\n        fieldSymbol.Type.Is(KnownType.System_IDisposable)\n        || fieldSymbol.Type.Implements(KnownType.System_IDisposable)\n        || fieldSymbol.Type.Is(KnownType.System_IAsyncDisposable)\n        || fieldSymbol.Type.Implements(KnownType.System_IAsyncDisposable)\n        || fieldSymbol.Type.IsDisposableRefStruct(languageVersion);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Extensions/ILocalSymbolExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Extensions;\n\npublic static class ILocalSymbolExtensions\n{\n    private static readonly Func<ILocalSymbol, RefKind> RefKindAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ILocalSymbol, RefKind>(typeof(ILocalSymbol), nameof(RefKind));\n\n    public static RefKind RefKind(this ILocalSymbol symbol) =>\n        RefKindAccessor(symbol);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Extensions/IMethodSymbolExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Extensions;\n\npublic static class IMethodSymbolExtensions\n{\n    public static bool IsModuleInitializer(this IMethodSymbol methodSymbol) =>\n        methodSymbol.AnyAttributeDerivesFrom(KnownType.System_Runtime_CompilerServices_ModuleInitializerAttribute);\n\n    public static bool IsGetTypeCall(this IMethodSymbol invokedMethod) =>\n        invokedMethod.Name == nameof(Type.GetType)\n        && !invokedMethod.IsStatic\n        && invokedMethod.ContainingType is not null\n        && IsObjectOrType(invokedMethod.ContainingType);\n\n    public static SyntaxNode ImplementationSyntax(this IMethodSymbol method) =>\n        (method.PartialImplementationPart ?? method).DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax();\n\n    private static bool IsObjectOrType(ITypeSymbol namedType) =>\n        namedType.SpecialType == SpecialType.System_Object\n        || namedType.Is(KnownType.System_Type);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Extensions/ISymbolExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Extensions;\n\npublic static class ISymbolExtensions\n{\n    private static readonly SyntaxKind[] DeclarationsTypesWithPrimaryConstructor =\n    {\n        SyntaxKind.ClassDeclaration,\n        SyntaxKind.StructDeclaration,\n        SyntaxKindEx.RecordDeclaration,\n        SyntaxKindEx.RecordStructDeclaration\n    };\n\n    extension(ISymbol symbol)\n    {\n        public SyntaxToken? FirstDeclaringReferenceIdentifier =>\n            symbol.DeclaringReferenceIdentifiers.FirstOrDefault();\n\n        public ImmutableArray<SyntaxToken> DeclaringReferenceIdentifiers =>\n            symbol.DeclaringSyntaxReferences\n               .Select(x => x.GetSyntax().GetIdentifier())\n               .WhereNotNull()\n               .ToImmutableArray();\n\n        public bool IsPrimaryConstructor =>\n            symbol.IsConstructor()\n            && symbol.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax() is { } syntax\n            && DeclarationsTypesWithPrimaryConstructor.Contains(syntax.Kind());\n\n        public IEnumerable<SyntaxNode> LocationNodes(SyntaxNode node) =>\n            symbol.Locations.SelectMany(location => GetDescendantNodes(location, node));\n    }\n\n    private static IEnumerable<SyntaxNode> GetDescendantNodes(Location location, SyntaxNode invocation)\n    {\n        var locationRootNode = location.SourceTree?.GetRoot();\n        var invocationRootNode = invocation.SyntaxTree.GetRoot();\n\n        // We don't look for descendants when the location is outside the current context root\n        if (locationRootNode != null && locationRootNode != invocationRootNode)\n        {\n            return Enumerable.Empty<SyntaxNode>();\n        }\n\n        // To optimise, we search first for the class constructor, then for the method declaration.\n        // If these cannot be found (e.g. fields), we get the root of the syntax tree and search from there.\n        var root = locationRootNode?.FindNode(location.SourceSpan)\n                   ?? invocation.FirstAncestorOrSelf<MethodDeclarationSyntax>()\n                   ?? invocationRootNode;\n\n        return root.DescendantNodes();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Extensions/ITupleOperationWrapperExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Extensions;\n\npublic static class ITupleOperationWrapperExtensions\n{\n    public static ImmutableArray<IOperation> AllElements(this ITupleOperationWrapper tuple)\n    {\n        var arrayBuilder = ImmutableArray.CreateBuilder<IOperation>();\n        CollectTupleElements(tuple);\n        return arrayBuilder.ToImmutableArray();\n\n        void CollectTupleElements(ITupleOperationWrapper tuple)\n        {\n            foreach (var element in tuple.Elements)\n            {\n                if (ITupleOperationWrapper.IsInstance(element))\n                {\n                    CollectTupleElements(ITupleOperationWrapper.FromOperation(element));\n                }\n                else\n                {\n                    arrayBuilder.Add(element);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Extensions/ITypeSymbolExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Extensions;\n\npublic static class ITypeSymbolExtensions\n{\n    public static bool IsDisposableRefStruct(this ITypeSymbol symbol, LanguageVersion languageVersion) =>\n        languageVersion.IsAtLeast(LanguageVersionEx.CSharp8)\n        && IsRefStruct(symbol)\n        && symbol.GetMembers(nameof(IDisposable.Dispose)).Any(x => x.DeclaredAccessibility == Accessibility.Public && KnownMethods.IsIDisposableDispose(x as IMethodSymbol));\n\n    public static bool IsRefStruct(this ITypeSymbol symbol) =>\n        symbol is not null\n        && symbol.IsStruct()\n        && symbol.IsRefLikeType();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Extensions/LanguageVersionExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Extensions;\n\ninternal static class LanguageVersionExtensions\n{\n    internal static bool IsAtLeast(this LanguageVersion left, LanguageVersion right) =>\n        left.CompareTo(right) >= 0;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Extensions/SonarAnalysisContextExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Extensions;\n\npublic static class SonarAnalysisContextExtensions\n{\n    extension(SonarAnalysisContext context)\n    {\n        public void RegisterNodeAction(Action<SonarSyntaxNodeReportingContext> action, params SyntaxKind[] syntaxKinds) =>\n            context.RegisterNodeAction(CSharpGeneratedCodeRecognizer.Instance, action, syntaxKinds);\n\n        public void RegisterTreeAction(Action<SonarSyntaxTreeReportingContext> action) =>\n            context.RegisterTreeAction(CSharpGeneratedCodeRecognizer.Instance, action);\n\n        public void RegisterSemanticModelAction(Action<SonarSemanticModelReportingContext> action) =>\n            context.RegisterSemanticModelAction(CSharpGeneratedCodeRecognizer.Instance, action);\n\n        public void RegisterCodeBlockStartAction(Action<SonarCodeBlockStartAnalysisContext<SyntaxKind>> action) =>\n            context.RegisterCodeBlockStartAction(CSharpGeneratedCodeRecognizer.Instance, action);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Extensions/SonarCompilationStartAnalysisContextExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Extensions;\n\npublic static class SonarCompilationStartAnalysisContextExtensions\n{\n    extension(SonarCompilationStartAnalysisContext context)\n    {\n        public void RegisterNodeAction(Action<SonarSyntaxNodeReportingContext> action, params SyntaxKind[] syntaxKinds) =>\n            context.RegisterNodeAction(CSharpGeneratedCodeRecognizer.Instance, action, syntaxKinds);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Extensions/SonarParametrizedAnalysisContextExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Extensions;\n\npublic static class SonarParametrizedAnalysisContextExtensions\n{\n    extension(SonarParametrizedAnalysisContext context)\n    {\n        public void RegisterTreeAction(Action<SonarSyntaxTreeReportingContext> action) =>\n            context.RegisterTreeAction(CSharpGeneratedCodeRecognizer.Instance, action);\n\n        public void RegisterSemanticModelAction(Action<SonarSemanticModelReportingContext> action) =>\n            context.RegisterSemanticModelAction(CSharpGeneratedCodeRecognizer.Instance, action);\n\n        public void RegisterNodeAction(Action<SonarSyntaxNodeReportingContext> action, params SyntaxKind[] syntaxKinds) =>\n            context.RegisterNodeAction(CSharpGeneratedCodeRecognizer.Instance, action, syntaxKinds);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Extensions/SonarSyntaxNodeReportingContextExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Extensions;\n\npublic static class SonarSyntaxNodeReportingContextExtensions\n{\n    extension(SonarSyntaxNodeReportingContext context)\n    {\n        public bool IsTopLevelMain =>\n            context.Node is CompilationUnitSyntax compilationUnitSyntax\n            && compilationUnitSyntax.IsTopLevelMain()\n            && context.ContainingSymbol.IsGlobalNamespace(); // Needed to avoid the duplicate calls from Roslyn 4.0.0\n\n        public bool IsInExpressionTree() =>\n            context.Node.IsInExpressionTree(context.Model);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Facade/CSharpFacade.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\nusing SonarAnalyzer.CSharp.Core.Facade.Implementation;\nusing SonarAnalyzer.CSharp.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Core.Facade;\n\npublic sealed class CSharpFacade : ILanguageFacade<SyntaxKind>\n{\n    private static readonly Lazy<CSharpFacade> Singleton = new(() => new CSharpFacade());\n    private static readonly Lazy<AssignmentFinder> AssignmentFinderLazy = new(() => new CSharpAssignmentFinder());\n    private static readonly Lazy<IExpressionNumericConverter> ExpressionNumericConverterLazy = new(() => new CSharpExpressionNumericConverter());\n    private static readonly Lazy<SyntaxFacade<SyntaxKind>> SyntaxLazy = new(() => new CSharpSyntaxFacade());\n    private static readonly Lazy<ISyntaxKindFacade<SyntaxKind>> SyntaxKindLazy = new(() => new CSharpSyntaxKindFacade());\n    private static readonly Lazy<ITrackerFacade<SyntaxKind>> TrackerLazy = new(() => new CSharpTrackerFacade());\n\n    public static CSharpFacade Instance => Singleton.Value;\n\n    public AssignmentFinder AssignmentFinder => AssignmentFinderLazy.Value;\n    public StringComparison NameComparison => StringComparison.Ordinal;\n    public StringComparer NameComparer => StringComparer.Ordinal;\n    public GeneratedCodeRecognizer GeneratedCodeRecognizer => CSharpGeneratedCodeRecognizer.Instance;\n    public IExpressionNumericConverter ExpressionNumericConverter => ExpressionNumericConverterLazy.Value;\n    public SyntaxFacade<SyntaxKind> Syntax => SyntaxLazy.Value;\n    public ISyntaxKindFacade<SyntaxKind> SyntaxKind => SyntaxKindLazy.Value;\n    public ITrackerFacade<SyntaxKind> Tracker => TrackerLazy.Value;\n\n    private CSharpFacade() { }\n\n    public DiagnosticDescriptor CreateDescriptor(string id, string messageFormat, bool? isEnabledByDefault = null, bool fadeOutCode = false) =>\n        DescriptorFactory.Create(id, messageFormat, isEnabledByDefault, fadeOutCode);\n\n    public object FindConstantValue(SemanticModel model, SyntaxNode node) =>\n        node.FindConstantValue(model);\n\n    public IMethodParameterLookup MethodParameterLookup(SyntaxNode invocation, IMethodSymbol methodSymbol) =>\n        invocation switch\n        {\n            null => null,\n            AttributeSyntax x => new CSharpAttributeParameterLookup(x, methodSymbol),\n            _ => new CSharpMethodParameterLookup(invocation.ArgumentList(), methodSymbol),\n        };\n\n    public IMethodParameterLookup MethodParameterLookup(SyntaxNode invocation, SemanticModel model) =>\n        invocation?.ArgumentList() is { } argumentList\n            ? new CSharpMethodParameterLookup(argumentList, model)\n            : null;\n\n    public string GetName(SyntaxNode expression) =>\n        expression.GetName();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Facade/Implementation/CSharpSyntaxFacade.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing ComparisonKindEnum = SonarAnalyzer.Core.Syntax.Utilities.ComparisonKind;\n\nnamespace SonarAnalyzer.CSharp.Core.Facade.Implementation;\n\ninternal sealed class CSharpSyntaxFacade : SyntaxFacade<SyntaxKind>\n{\n    public override bool AreEquivalent(SyntaxNode firstNode, SyntaxNode secondNode) =>\n        SyntaxFactory.AreEquivalent(firstNode, secondNode);\n\n    public override IEnumerable<SyntaxNode> ArgumentExpressions(SyntaxNode node) =>\n        ArgumentList(node)?.OfType<ArgumentSyntax>().Select(x => x.Expression) ?? Enumerable.Empty<SyntaxNode>();\n\n    public override IReadOnlyList<SyntaxNode> ArgumentList(SyntaxNode node) =>\n        node.ArgumentList()?.Arguments;\n\n    public override int? ArgumentIndex(SyntaxNode argument) =>\n        Cast<ArgumentSyntax>(argument).GetArgumentIndex();\n\n    public override SyntaxToken? ArgumentNameColon(SyntaxNode argument) =>\n        (argument as ArgumentSyntax)?.NameColon?.Name.Identifier;\n\n    public override SyntaxNode AssignmentLeft(SyntaxNode assignment) =>\n        Cast<AssignmentExpressionSyntax>(assignment).Left;\n\n    public override SyntaxNode AssignmentRight(SyntaxNode assignment) =>\n        Cast<AssignmentExpressionSyntax>(assignment).Right;\n\n    public override ImmutableArray<SyntaxNode> AssignmentTargets(SyntaxNode assignment) =>\n        Cast<AssignmentExpressionSyntax>(assignment).AssignmentTargets();\n\n    public override SyntaxNode BinaryExpressionLeft(SyntaxNode binary) =>\n        Cast<BinaryExpressionSyntax>(binary).Left;\n\n    public override SyntaxNode BinaryExpressionRight(SyntaxNode binary) =>\n        Cast<BinaryExpressionSyntax>(binary).Right;\n\n    public override SyntaxNode CastType(SyntaxNode cast) =>\n        Cast<CastExpressionSyntax>(cast).Type;\n\n    public override SyntaxNode CastExpression(SyntaxNode cast) =>\n        Cast<CastExpressionSyntax>(cast).Expression;\n\n    public override ComparisonKind ComparisonKind(SyntaxNode node) =>\n        node is BinaryExpressionSyntax { OperatorToken: var token }\n            ? token.ToComparisonKind()\n            : ComparisonKindEnum.None;\n\n    public override IEnumerable<SyntaxNode> EnumMembers(SyntaxNode @enum) =>\n        @enum is null ? Enumerable.Empty<SyntaxNode>() : Cast<EnumDeclarationSyntax>(@enum).Members;\n\n    public override ImmutableArray<SyntaxToken> FieldDeclarationIdentifiers(SyntaxNode node) =>\n        Cast<FieldDeclarationSyntax>(node).Declaration.Variables.Select(x => x.Identifier).ToImmutableArray();\n\n    public override bool HasExactlyNArguments(SyntaxNode invocation, int count) =>\n        Cast<InvocationExpressionSyntax>(invocation).HasExactlyNArguments(count);\n\n    public override SyntaxToken? InvocationIdentifier(SyntaxNode invocation) =>\n        invocation is null ? null : Cast<InvocationExpressionSyntax>(invocation).GetMethodCallIdentifier();\n\n    public override bool IsAnyKind(SyntaxNode node, ISet<SyntaxKind> syntaxKinds) => node.IsAnyKind(syntaxKinds);\n\n    [Obsolete(\"Either use '.Kind() is A or B' or the overload with the ISet instead.\")]\n    public override bool IsAnyKind(SyntaxNode node, params SyntaxKind[] syntaxKinds) => node.IsAnyKind(syntaxKinds);\n\n    public override bool IsAnyKind(SyntaxTrivia trivia, ISet<SyntaxKind> syntaxKinds) => trivia.IsAnyKind(syntaxKinds);\n\n    public override bool IsInExpressionTree(SemanticModel model, SyntaxNode node) =>\n        node.IsInExpressionTree(model);\n\n    public override bool IsKind(SyntaxNode node, SyntaxKind kind) => node.IsKind(kind);\n\n    public override bool IsKind(SyntaxToken token, SyntaxKind kind) => token.IsKind(kind);\n\n    public override bool IsKind(SyntaxTrivia trivia, SyntaxKind kind) => trivia.IsKind(kind);\n\n    public override bool IsKnownAttributeType(SemanticModel model, SyntaxNode attribute, KnownType knownType) =>\n        AttributeSyntaxExtensions.IsKnownType(Cast<AttributeSyntax>(attribute), knownType, model);\n\n    public override bool IsMemberAccessOnKnownType(SyntaxNode memberAccess, string name, KnownType knownType, SemanticModel model) =>\n        Cast<MemberAccessExpressionSyntax>(memberAccess).IsMemberAccessOnKnownType(name, knownType, model);\n\n    public override bool IsNullLiteral(SyntaxNode node) =>\n        node.IsNullLiteral();\n\n    public override bool IsPartOfBinaryNegationOrCondition(SyntaxNode node) =>\n        node.IsPartOfBinaryNegationOrCondition();\n\n    public override bool IsStatic(SyntaxNode node) =>\n        Cast<BaseMethodDeclarationSyntax>(node).IsStatic();\n\n    /// <inheritdoc cref=\"Microsoft.CodeAnalysis.CSharp.Extensions.ExpressionSyntaxExtensions.IsWrittenTo(ExpressionSyntax, SemanticModel, CancellationToken)\"/>\n    public override bool IsWrittenTo(SyntaxNode expression, SemanticModel model, CancellationToken cancel) =>\n        Cast<ExpressionSyntax>(expression).IsWrittenTo(model, cancel);\n\n    public override SyntaxKind Kind(SyntaxNode node) => node.Kind();\n\n    public override string LiteralText(SyntaxNode literal) =>\n        Cast<LiteralExpressionSyntax>(literal).Token.ValueText;\n\n    public override ImmutableArray<SyntaxToken> LocalDeclarationIdentifiers(SyntaxNode node) =>\n        Cast<LocalDeclarationStatementSyntax>(node).Declaration.Variables.Select(x => x.Identifier).ToImmutableArray();\n\n    public override SyntaxKind[] ModifierKinds(SyntaxNode node) =>\n        (node switch\n        {\n            TypeDeclarationSyntax x => x.Modifiers,\n            BaseMethodDeclarationSyntax x => x.Modifiers,\n            _ => [],\n        }).Select(x => x.Kind()).ToArray();\n\n    public override SyntaxNode NodeExpression(SyntaxNode node) =>\n        node switch\n        {\n            ArrowExpressionClauseSyntax x => x.Expression,\n            ArgumentSyntax x => x.Expression,\n            AttributeArgumentSyntax x => x.Expression,\n            InterpolationSyntax x => x.Expression,\n            InvocationExpressionSyntax x => x.Expression,\n            LockStatementSyntax x => x.Expression,\n            ReturnStatementSyntax x => x.Expression,\n            MemberAccessExpressionSyntax x => x.Expression,\n            null => null,\n            _ => throw InvalidOperation(node, nameof(NodeExpression))\n        };\n\n    public override SyntaxToken? NodeIdentifier(SyntaxNode node) =>\n        node.GetIdentifier();\n\n    public override SyntaxToken? ObjectCreationTypeIdentifier(SyntaxNode objectCreation) =>\n        objectCreation is null ? null : Cast<ObjectCreationExpressionSyntax>(objectCreation).GetObjectCreationTypeIdentifier();\n\n    public override SyntaxNode RemoveConditionalAccess(SyntaxNode node) =>\n        node is ExpressionSyntax expression\n            ? expression.RemoveConditionalAccess()\n            : node;\n\n    public override SyntaxNode RemoveParentheses(SyntaxNode node) =>\n        node.RemoveParentheses();\n\n    public override string StringValue(SyntaxNode node, SemanticModel model) =>\n        node.StringValue(model);\n\n    public override string InterpolatedTextValue(SyntaxNode node, SemanticModel model) =>\n        Cast<InterpolatedStringExpressionSyntax>(node).InterpolatedTextValue(model);\n\n    public override Pair<SyntaxNode, SyntaxNode> Operands(SyntaxNode invocation) =>\n        Cast<InvocationExpressionSyntax>(invocation).Operands();\n\n    public override SyntaxNode ParseExpression(string expression) =>\n        SyntaxFactory.ParseExpression(expression);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Facade/Implementation/CSharpSyntaxKindFacade.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Facade.Implementation;\n\ninternal sealed class CSharpSyntaxKindFacade : ISyntaxKindFacade<SyntaxKind>\n{\n    public SyntaxKind Attribute => SyntaxKind.Attribute;\n    public SyntaxKind AttributeArgument => SyntaxKind.AttributeArgument;\n    public SyntaxKind[] CastExpressions => new[] {SyntaxKind.CastExpression };\n    public SyntaxKind ClassDeclaration => SyntaxKind.ClassDeclaration;\n    public SyntaxKind[] ClassAndRecordDeclarations => new[]\n    {\n        SyntaxKind.ClassDeclaration,\n        SyntaxKindEx.RecordDeclaration,\n    };\n    public SyntaxKind[] ClassAndModuleDeclarations => new[] { SyntaxKind.ClassDeclaration };\n    public SyntaxKind[] ComparisonKinds => new[]\n    {\n        SyntaxKind.GreaterThanExpression,\n        SyntaxKind.GreaterThanOrEqualExpression,\n        SyntaxKind.LessThanExpression,\n        SyntaxKind.LessThanOrEqualExpression,\n        SyntaxKind.EqualsExpression,\n        SyntaxKind.NotEqualsExpression,\n    };\n    public SyntaxKind ConstructorDeclaration => SyntaxKind.ConstructorDeclaration;\n    public SyntaxKind[] DefaultExpressions => new[] { SyntaxKind.DefaultExpression, SyntaxKindEx.DefaultLiteralExpression };\n    public SyntaxKind EnumDeclaration => SyntaxKind.EnumDeclaration;\n    public SyntaxKind EndOfLineTrivia => SyntaxKind.EndOfLineTrivia;\n    public SyntaxKind FieldDeclaration => SyntaxKind.FieldDeclaration;\n    public SyntaxKind IdentifierName => SyntaxKind.IdentifierName;\n    public SyntaxKind IdentifierToken => SyntaxKind.IdentifierToken;\n    public SyntaxKind InvocationExpression => SyntaxKind.InvocationExpression;\n    public SyntaxKind InterpolatedStringExpression => SyntaxKind.InterpolatedStringExpression;\n    public SyntaxKind LeftShiftAssignmentStatement => SyntaxKind.LeftShiftAssignmentExpression;\n    public SyntaxKind LeftShiftExpression => SyntaxKind.LeftShiftExpression;\n    public SyntaxKind LocalDeclaration => SyntaxKind.LocalDeclarationStatement;\n    public SyntaxKind[] MethodDeclarations => new[] { SyntaxKind.MethodDeclaration };\n    public SyntaxKind[] ObjectCreationExpressions => new[] { SyntaxKind.ObjectCreationExpression, SyntaxKindEx.ImplicitObjectCreationExpression };\n    public SyntaxKind Parameter => SyntaxKind.Parameter;\n    public SyntaxKind ParameterList => SyntaxKind.ParameterList;\n    public SyntaxKind RefKeyword => SyntaxKind.RefKeyword;\n    public SyntaxKind ReturnStatement => SyntaxKind.ReturnStatement;\n    public SyntaxKind RightShiftAssignmentStatement => SyntaxKind.RightShiftAssignmentExpression;\n    public SyntaxKind RightShiftExpression => SyntaxKind.RightShiftExpression;\n    public SyntaxKind SimpleAssignment => SyntaxKind.SimpleAssignmentExpression;\n    public SyntaxKind SimpleCommentTrivia => SyntaxKind.SingleLineCommentTrivia;\n    public SyntaxKind SimpleMemberAccessExpression => SyntaxKind.SimpleMemberAccessExpression;\n    public SyntaxKind[] StringLiteralExpressions => new[] { SyntaxKind.StringLiteralExpression, SyntaxKindEx.Utf8StringLiteralExpression };\n    public SyntaxKind StructDeclaration => SyntaxKind.StructDeclaration;\n    public SyntaxKind SubtractExpression => SyntaxKind.SubtractExpression;\n    public SyntaxKind[] TypeDeclaration => new[]\n    {\n        SyntaxKind.ClassDeclaration,\n        SyntaxKind.StructDeclaration,\n        SyntaxKind.InterfaceDeclaration,\n        SyntaxKind.EnumDeclaration,\n        SyntaxKindEx.RecordDeclaration,\n        SyntaxKindEx.RecordStructDeclaration,\n    };\n    public SyntaxKind VariableDeclarator => SyntaxKind.VariableDeclarator;\n\n    public SyntaxKind[] LocalDeclarationKinds =>\n    [\n        SyntaxKind.VariableDeclarator,\n        SyntaxKindEx.SingleVariableDesignation, // x is T y, out var x, var (a,b)=..., patterns\n        SyntaxKind.CatchDeclaration,            // catch (Exception e)\n        SyntaxKind.ForEachStatement,            // foreach (var x in ...)\n        SyntaxKind.FromClause,                  // from x in ...\n        SyntaxKind.JoinClause,                  // join x in coll on a equals b\n        SyntaxKind.JoinIntoClause,              // join ... into x\n        SyntaxKind.LetClause,                   // let x = ...\n        SyntaxKind.QueryContinuation,           // ... into x select\n    ];\n    public SyntaxKind WhitespaceTrivia => SyntaxKind.WhitespaceTrivia;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Facade/Implementation/CSharpTrackerFacade.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\nusing SonarAnalyzer.CSharp.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Core.Facade.Implementation;\n\ninternal sealed class CSharpTrackerFacade : ITrackerFacade<SyntaxKind>\n{\n    public ArgumentTracker<SyntaxKind> Argument { get; } = new CSharpArgumentTracker();\n    public BaseTypeTracker<SyntaxKind> BaseType { get; } = new CSharpBaseTypeTracker();\n    public ElementAccessTracker<SyntaxKind> ElementAccess { get; } = new CSharpElementAccessTracker();\n    public FieldAccessTracker<SyntaxKind> FieldAccess { get; } = new CSharpFieldAccessTracker();\n    public InvocationTracker<SyntaxKind> Invocation { get; } = new CSharpInvocationTracker();\n    public MethodDeclarationTracker<SyntaxKind> MethodDeclaration { get; } = new CSharpMethodDeclarationTracker();\n    public ObjectCreationTracker<SyntaxKind> ObjectCreation { get; } = new CSharpObjectCreationTracker();\n    public PropertyAccessTracker<SyntaxKind> PropertyAccess { get; } = new CSharpPropertyAccessTracker();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/LiveVariableAnalysis/SonarCSharpLiveVariableAnalysis.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CFG.LiveVariableAnalysis;\nusing SonarAnalyzer.CFG.Sonar;\n\nnamespace SonarAnalyzer.CSharp.Core.LiveVariableAnalysis;\n\npublic sealed class SonarCSharpLiveVariableAnalysis : LiveVariableAnalysisBase<IControlFlowGraph, Block>\n{\n    private readonly SemanticModel model;\n\n    protected override Block ExitBlock => Cfg.ExitBlock;\n\n    public SonarCSharpLiveVariableAnalysis(IControlFlowGraph controlFlowGraph, ISymbol originalDeclaration, SemanticModel model, CancellationToken cancel)\n        : base(controlFlowGraph, originalDeclaration, cancel)\n    {\n        this.model = model;\n        Analyze();\n    }\n\n    public override bool IsLocal(ISymbol symbol)\n    {\n        return IsLocalOrParameterSymbol()\n            && symbol.ContainingSymbol is not null\n            && symbol.ContainingSymbol.Equals(originalDeclaration);\n\n        bool IsLocalOrParameterSymbol() =>\n            (symbol is ILocalSymbol local && local.RefKind() == RefKind.None)\n            || (symbol is IParameterSymbol parameter && parameter.RefKind == RefKind.None);\n    }\n\n    public static bool IsOutArgument(IdentifierNameSyntax identifier) =>\n        identifier.GetFirstNonParenthesizedParent() is ArgumentSyntax argument && argument.RefOrOutKeyword.IsKind(SyntaxKind.OutKeyword);\n\n    protected override IEnumerable<Block> ReversedBlocks() =>\n        Cfg.Blocks.Reverse();\n\n    protected override IEnumerable<Block> Successors(Block block) =>\n        block.SuccessorBlocks;\n\n    protected override IEnumerable<Block> Predecessors(Block block) =>\n        block.PredecessorBlocks;\n\n    protected override State ProcessBlock(Block block)\n    {\n        var ret = new SonarState(this, model);\n        ret.ProcessBlock(block);\n        return ret;\n    }\n\n    private sealed class SonarState : State\n    {\n        private readonly SonarCSharpLiveVariableAnalysis owner;\n        private readonly SemanticModel model;\n\n        public ISet<SyntaxNode> AssignmentLhs { get; } = new HashSet<SyntaxNode>();\n\n        public SonarState(SonarCSharpLiveVariableAnalysis owner, SemanticModel model)\n        {\n            this.owner = owner;\n            this.model = model;\n        }\n\n        public void ProcessBlock(Block block)\n        {\n            foreach (var instruction in block.Instructions.Reverse())\n            {\n                switch (instruction.Kind())\n                {\n                    case SyntaxKind.IdentifierName:\n                        ProcessIdentifier((IdentifierNameSyntax)instruction);\n                        break;\n\n                    case SyntaxKind.GenericName:\n                        ProcessGenericName((GenericNameSyntax)instruction);\n                        break;\n\n                    case SyntaxKind.SimpleAssignmentExpression:\n                        ProcessSimpleAssignment((AssignmentExpressionSyntax)instruction);\n                        break;\n\n                    case SyntaxKind.VariableDeclarator:\n                        ProcessVariableDeclarator((VariableDeclaratorSyntax)instruction);\n                        break;\n                    case SyntaxKind.AnonymousMethodExpression:\n                    case SyntaxKind.ParenthesizedLambdaExpression:\n                    case SyntaxKind.SimpleLambdaExpression:\n                    case SyntaxKind.QueryExpression:\n                        CollectAllCapturedLocal(instruction);\n                        break;\n                }\n            }\n\n            if (block.Instructions.Any())\n            {\n                return;\n            }\n\n            // Variable declaration in a foreach statement is not a VariableDeclarator, so handling it separately:\n            if (block is BinaryBranchBlock foreachBlock && foreachBlock.BranchingNode.IsKind(SyntaxKind.ForEachStatement))\n            {\n                var foreachNode = (ForEachStatementSyntax)foreachBlock.BranchingNode;\n                ProcessVariableInForeach(foreachNode);\n            }\n\n            // Keep alive the variables declared and used in the using statement until the UsingFinalizerBlock\n            if (block is UsingEndBlock usingFinalizerBlock)\n            {\n                var disposableSymbols = usingFinalizerBlock.Identifiers\n                    .Select(x => model.GetDeclaredSymbol(x.Parent) ?? model.GetSymbolInfo(x.Parent).Symbol)\n                    .WhereNotNull();\n                foreach (var disposableSymbol in disposableSymbols)\n                {\n                    UsedBeforeAssigned.Add(disposableSymbol);\n                }\n            }\n        }\n\n        private void ProcessVariableInForeach(ForEachStatementSyntax foreachNode)\n        {\n            if (model.GetDeclaredSymbol(foreachNode) is { } symbol)\n            {\n                Assigned.Add(symbol);\n                UsedBeforeAssigned.Remove(symbol);\n            }\n        }\n\n        private void ProcessVariableDeclarator(VariableDeclaratorSyntax instruction)\n        {\n            if (model.GetDeclaredSymbol(instruction) is { } symbol)\n            {\n                Assigned.Add(symbol);\n                UsedBeforeAssigned.Remove(symbol);\n            }\n        }\n\n        private void ProcessSimpleAssignment(AssignmentExpressionSyntax assignment)\n        {\n            var left = assignment.Left.RemoveParentheses();\n            if (left.IsKind(SyntaxKind.IdentifierName)\n                && model.GetSymbolInfo(left).Symbol is { } symbol\n                && owner.IsLocal(symbol))\n            {\n                AssignmentLhs.Add(left);\n                Assigned.Add(symbol);\n                UsedBeforeAssigned.Remove(symbol);\n            }\n        }\n\n        private void ProcessIdentifier(IdentifierNameSyntax identifier)\n        {\n            if (!identifier.GetSelfOrTopParenthesizedExpression().IsInNameOfArgument(model)\n                && model.GetSymbolInfo(identifier).Symbol is { } symbol)\n            {\n                if (owner.IsLocal(symbol))\n                {\n                    if (IsOutArgument(identifier))\n                    {\n                        Assigned.Add(symbol);\n                        UsedBeforeAssigned.Remove(symbol);\n                    }\n                    else if (!AssignmentLhs.Contains(identifier))\n                    {\n                        UsedBeforeAssigned.Add(symbol);\n                    }\n                }\n\n                if (symbol is IMethodSymbol { MethodKind: MethodKindEx.LocalFunction })\n                {\n                    ProcessLocalFunction(symbol);\n                }\n            }\n        }\n\n        private void ProcessGenericName(GenericNameSyntax genericName)\n        {\n            if (!genericName.GetSelfOrTopParenthesizedExpression().IsInNameOfArgument(model)\n                && model.GetSymbolInfo(genericName).Symbol is IMethodSymbol { MethodKind: MethodKindEx.LocalFunction } method)\n            {\n                ProcessLocalFunction(method);\n            }\n        }\n\n        private void ProcessLocalFunction(ISymbol symbol)\n        {\n            if (!ProcessedLocalFunctions.Contains(symbol)\n                && symbol.DeclaringSyntaxReferences.Length == 1\n                && symbol.DeclaringSyntaxReferences.Single().GetSyntax() is { } node\n                && LocalFunctionStatementSyntaxWrapper.IsInstance(node)\n                && CSharpControlFlowGraph.TryGet((LocalFunctionStatementSyntaxWrapper)node, model, out var cfg))\n            {\n                ProcessedLocalFunctions.Add(symbol);\n                foreach (var block in cfg.Blocks.Reverse())\n                {\n                    ProcessBlock(block);\n                }\n            }\n        }\n\n        private void CollectAllCapturedLocal(SyntaxNode instruction)\n        {\n            var allCapturedSymbols = instruction.DescendantNodes()\n                .OfType<IdentifierNameSyntax>()\n                .Select(x => model.GetSymbolInfo(x).Symbol)\n                .Where(owner.IsLocal);\n\n            // Collect captured locals\n            // Read and write both affects liveness\n            Captured.UnionWith(allCapturedSymbols);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Properties/AssemblyInfo.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Runtime.CompilerServices;\n\n[assembly: InternalsVisibleTo(\"SonarAnalyzer.Test\")]\n[assembly: InternalsVisibleTo(\"SonarAnalyzer.CSharp.Core.Test\")]\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/RegularExpressions/MessageTemplatesParser.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text.RegularExpressions;\n\nnamespace SonarAnalyzer.CSharp.Core.RegularExpressions;\n\n/// <summary>\n/// Grammar can be found <a href=\"https://github.com/messagetemplates/grammar\"> here</a>.\n/// </summary>\npublic static class MessageTemplatesParser\n{\n    private const string NamePattern = \"[0-9a-zA-Z_]+\";\n    private const string PlaceholderPattern = $\"(?<Placeholder>{NamePattern})\";\n    private const string AlignmentPattern = \"(,-?[0-9]+)?\";\n    private const string FormatPattern = @\"(:[^}]+)?\";\n\n    private const string HolePattern = \"{\" + \"[@$]?\" + PlaceholderPattern + AlignmentPattern + FormatPattern + \"}\";\n    private const string TextPattern = @\"([^{]|{{|}})+\";\n    private const string TemplatePattern = $\"^({TextPattern}|{HolePattern})*$\";\n\n    internal static readonly Regex TemplateRegex = new(TemplatePattern, RegexOptions.Compiled, TimeSpan.FromMilliseconds(300));\n    internal static readonly Regex InterpolatedTemplateRegex = new(TemplatePattern.Replace(\"{\", \"{{\").Replace(\"}\", \"}}\"), RegexOptions.Compiled, TimeSpan.FromMilliseconds(300));\n\n    /// <summary>\n    /// Matches and extracts placeholders from a template string.\n    /// For more info, see <a href=\"https://messagetemplates.org/\">Message Templates</a>.\n    /// </summary>\n    public static ParseResult Parse(ExpressionSyntax template)\n    {\n        var regex = TemplateRegex;\n        var text = template.ToString();\n        if (template is InterpolatedStringExpressionSyntax interpolated)\n        {\n            // We cannot use SyntaxNodeExtensionsCSharp.StringValue() because it changes the length of the string.\n            // It would be nice to use CSharpVirtualCharService but it's not accessible. Maybe we can shim it in the future.\n            // https://github.com/dotnet/roslyn/blob/cd87803005347358c60e6d4ddb45be037cc300c8/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/EmbeddedLanguages/VirtualChars/CSharpVirtualCharService.cs\n            // Instead we use custom logic:\n            text = interpolated.StringStartToken\n                + string.Join(string.Empty, interpolated.Contents.Select(ReplaceInterpolation))\n                + interpolated.StringEndToken;\n            if (interpolated.StringStartToken.Text is @\"$\"\"\" or @\"@$\"\"\" or @\"$@\"\"\")\n            {\n                regex = InterpolatedTemplateRegex;\n            }\n        }\n        return Parse(text, regex);\n\n        static string ReplaceInterpolation(InterpolatedStringContentSyntax x) => x switch\n        {\n            InterpolatedStringTextSyntax textSyntax => textSyntax.ToString(),\n            // replace interpolation without changing length to preserve locations\n            InterpolationSyntax interpolation => new string(' ', interpolation.ToString().Length)\n            // no default case, InterpolatedStringContentSyntax has only two implementations\n        };\n    }\n\n    public static ParseResult Parse(string template, Regex regex)\n    {\n        if (regex.SafeMatch(template) is { Success: true } match)\n        {\n            var placeholders = match.Groups[\"Placeholder\"].Captures\n                .OfType<Capture>()\n                .Select(x => new Placeholder(x.Value, x.Index, x.Length))\n                .ToArray();\n            return new(true, placeholders);\n        }\n        else\n        {\n            return new(false);\n        }\n    }\n\n    public record ParseResult(bool Success, Placeholder[] Placeholders = null);\n\n    public record Placeholder(string Name, int Start, int Length);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/SonarAnalyzer.CSharp.Core.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFramework>netstandard2.0</TargetFramework>\n    <DefineConstants>$(DefineConstants);CS</DefineConstants>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Microsoft.Composition\" Version=\"1.0.27\">\n      <!-- This package is a dependency of Microsoft.CodeAnalysis.CSharp.Workspaces. It is safe to use since it's compatible with .Net Portable runtime -->\n      <NoWarn>NU1701</NoWarn>\n    </PackageReference>\n    <PackageReference Include=\"Microsoft.CodeAnalysis.Workspaces.Common\" Version=\"1.3.2\" />\n    <PackageReference Include=\"System.Collections.Immutable\" Version=\"1.1.37\">\n      <!-- Downgrade System.Collections.Immutable to support VS2015 Update 3 -->\n      <NoWarn>NU1605, NU1701</NoWarn>\n    </PackageReference>\n  </ItemGroup>\n\n  <Import Project=\"..\\SonarAnalyzer.Shared\\SonarAnalyzer.Shared.projitems\" Label=\"Shared\" />\n\n  <ItemGroup>\n    <!-- We need to update NuGet and JAR packaging after changing references -->\n    <ProjectReference Include=\"..\\SonarAnalyzer.CFG\\SonarAnalyzer.CFG.csproj\" />\n    <ProjectReference Include=\"..\\SonarAnalyzer.Core\\SonarAnalyzer.Core.csproj\" />\n    <ProjectReference Include=\"..\\SonarAnalyzer.SourceGenerators\\SonarAnalyzer.SourceGenerators.csproj\" SetTargetFramework=\"TargetFramework=netstandard2.0\" OutputItemType=\"Analyzer\" ReferenceOutputAssembly=\"false\" />\n  </ItemGroup>\n\n  <PropertyGroup>\n    <RSpecLanguage>cs</RSpecLanguage>\n  </PropertyGroup>\n  <Import Project=\"../RuleCatalog.targets\" />\n\n  <ItemGroup>\n    <Using Include=\"Microsoft.CodeAnalysis\" />\n    <Using Include=\"Microsoft.CodeAnalysis.CSharp\" />\n    <Using Include=\"Microsoft.CodeAnalysis.CSharp.Syntax\" />\n    <Using Include=\"Microsoft.CodeAnalysis.CSharp.Extensions\" />\n    <Using Include=\"Microsoft.CodeAnalysis.Diagnostics\" />\n    <Using Include=\"SonarAnalyzer.Core.AnalysisContext\" />\n    <Using Include=\"SonarAnalyzer.Core.Analyzers\" />\n    <Using Include=\"SonarAnalyzer.Core.Common\" />\n    <Using Include=\"SonarAnalyzer.Core.Extensions\" />\n    <Using Include=\"SonarAnalyzer.Core.Facade\" />\n    <Using Include=\"SonarAnalyzer.Core.Semantics\" />\n    <Using Include=\"SonarAnalyzer.Core.Semantics.Extensions\" />\n    <Using Include=\"SonarAnalyzer.Core.Syntax.Utilities\" />\n    <Using Include=\"SonarAnalyzer.CSharp.Core.Common\" />\n    <Using Include=\"SonarAnalyzer.CSharp.Core.Extensions\" />\n    <Using Include=\"SonarAnalyzer.CSharp.Core.Facade\" />\n    <Using Include=\"SonarAnalyzer.CSharp.Core.Syntax.Extensions\" />\n    <Using Include=\"SonarAnalyzer.CSharp.Core.Syntax.Utilities\" />\n    <Using Include=\"SonarAnalyzer.Core.Syntax.Extensions\" />\n    <Using Include=\"SonarAnalyzer.Core.Syntax.Utilities\" />\n    <Using Include=\"SonarAnalyzer.CSharp.Core.Wrappers\" />\n    <Using Include=\"SonarAnalyzer.ShimLayer\" />\n    <Using Include=\"StyleCop.Analyzers.Lightup\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Extensions/AccessorDeclarationSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Extensions;\n\npublic static class AccessorDeclarationSyntaxExtensions\n{\n    public static bool HasBodyOrExpressionBody(this AccessorDeclarationSyntax node) =>\n        node.Body is not null || node.ExpressionBody is not null;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Extensions/ArgumentListSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Extensions;\n\npublic static class ArgumentListSyntaxExtensions\n{\n    public static ExpressionSyntax Get(this ArgumentListSyntax argumentList, int index) =>\n        argumentList != null && argumentList.Arguments.Count > index\n            ? argumentList.Arguments[index].Expression.RemoveParentheses()\n            : null;\n\n    /// <summary>\n    /// Returns argument expressions for given parameter.\n    ///\n    /// There can be zero, one or more results based on parameter type (Optional or ParamArray/params).\n    /// </summary>\n    public static ImmutableArray<SyntaxNode> ArgumentValuesForParameter(this ArgumentListSyntax argumentList, SemanticModel model, string parameterName) =>\n        argumentList is not null && new CSharpMethodParameterLookup(argumentList, model).TryGetSyntax(parameterName, out var expressions)\n            ? expressions\n            : ImmutableArray<SyntaxNode>.Empty;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Extensions/ArgumentSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Extensions;\n\npublic static class ArgumentSyntaxExtensions\n{\n    public static int? GetArgumentIndex(this ArgumentSyntax argument) =>\n        (argument.Parent as ArgumentListSyntax)?.Arguments.IndexOf(argument);\n\n    public static IEnumerable<ArgumentSyntax> GetArgumentsOfKnownType(this SeparatedSyntaxList<ArgumentSyntax> syntaxList, KnownType knownType, SemanticModel semanticModel) =>\n        syntaxList\n            .Where(argument => semanticModel.GetTypeInfo(argument.Expression).Type.Is(knownType));\n\n    public static IEnumerable<ISymbol> GetSymbolsOfKnownType(this SeparatedSyntaxList<ArgumentSyntax> syntaxList, KnownType knownType, SemanticModel semanticModel) =>\n        syntaxList\n            .GetArgumentsOfKnownType(knownType, semanticModel)\n            .Select(argument => semanticModel.GetSymbolInfo(argument.Expression).Symbol);\n\n    public static bool NameIs(this ArgumentSyntax argument, string name) =>\n        argument.NameColon?.Name.Identifier.Text == name;\n\n    // (arg, b) = something\n    public static bool IsInTupleAssignmentTarget(this ArgumentSyntax argument) =>\n        argument.OutermostTuple() is { SyntaxNode: { } tupleExpression }\n        && tupleExpression.Parent is AssignmentExpressionSyntax assignment\n        && assignment.Left == tupleExpression;\n\n    public static TupleExpressionSyntaxWrapper? OutermostTuple(this ArgumentSyntax argument) =>\n        argument.Ancestors()\n            .TakeWhile(x => x?.Kind() is SyntaxKind.Argument or SyntaxKindEx.TupleExpression)\n            .LastOrDefault(x => x.IsKind(SyntaxKindEx.TupleExpression)) is { } outerTuple\n            && TupleExpressionSyntaxWrapper.IsInstance(outerTuple)\n                ? (TupleExpressionSyntaxWrapper)outerTuple\n                : null;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Extensions/AssignmentExpressionSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Extensions;\n\npublic static class AssignmentExpressionSyntaxExtensions\n{\n    public readonly record struct AssignmentMapping(SyntaxNode Left, SyntaxNode Right);\n\n    /// <summary>\n    /// Maps the left and the right side arguments of an <paramref name=\"assignment\"/>. If both sides are tuples, the tuple elements are mapped.\n    /// <code>\n    /// (var x, var y) = (1, 2);                 // [x←1, y←2]\n    /// var (x, y) = (1, 2);                     // [x←1, y←2]\n    /// (var x, (var y, var z)) = (1, (2, 3));   // [x←1, y←2, z←3]\n    /// var x = 1;                               // [x←1]\n    /// (var x, var y) = M();                    // [(x,y)←M()]\n    /// </code>\n    /// </summary>\n    public static ImmutableArray<AssignmentMapping> MapAssignmentArguments(this AssignmentExpressionSyntax assignment)\n    {\n        // (var x, var y) = (1, 2)\n        if (TupleExpressionSyntaxWrapper.IsInstance(assignment.Left)\n            && TupleExpressionSyntaxWrapper.IsInstance(assignment.Right))\n        {\n            var left = (TupleExpressionSyntaxWrapper)assignment.Left;\n            var right = (TupleExpressionSyntaxWrapper)assignment.Right;\n            var arrayBuilder = ImmutableArray.CreateBuilder<AssignmentMapping>(left.Arguments.Count);\n            if (MapTupleElements(arrayBuilder, left, right) is NestingMatch.Handled)\n            {\n                return arrayBuilder.ToImmutableArray();\n            }\n        }\n        // var (x, y) = (1, 2)\n        else if (DeclarationExpressionSyntaxWrapper.IsInstance(assignment.Left)\n                 && (DeclarationExpressionSyntaxWrapper)assignment.Left is { Designation: { } leftDesignation }\n                 && ParenthesizedVariableDesignationSyntaxWrapper.IsInstance(leftDesignation)\n                 && TupleExpressionSyntaxWrapper.IsInstance(assignment.Right))\n        {\n            var left = (ParenthesizedVariableDesignationSyntaxWrapper)leftDesignation;\n            var right = (TupleExpressionSyntaxWrapper)assignment.Right;\n            var arrayBuilder = ImmutableArray.CreateBuilder<AssignmentMapping>(left.Variables.Count);\n            if (MapDesignationElements(arrayBuilder, left, right) is NestingMatch.Handled)\n            {\n                return arrayBuilder.ToImmutableArray();\n            }\n        }\n\n        return ImmutableArray.Create(new AssignmentMapping(assignment.Left, assignment.Right));\n    }\n\n    /// <summary>\n    /// Returns a list of nodes, that represent the target (left side) of an assignment. In case of tuple deconstructions, this can be more than one target.\n    /// Nested tuple elements and any declaration expressions are flattened.\n    /// <code>\n    /// (var a, var b)        = x; // [a, b]\n    /// var (a, b)            = x; // [a, b]\n    /// var (a, _)            = x; // [a]       ← The _ here is always a discard\n    /// (var a, _)            = x; // [a, _]    ← The _ here could reference a local\n    /// (var a, var (b, c))   = x; // [a, b, c]\n    /// (var a, (int, int) b) = x; // [a, b]\n    /// </code>\n    /// </summary>\n    public static ImmutableArray<SyntaxNode> AssignmentTargets(this AssignmentExpressionSyntax assignment)\n    {\n        var left = assignment.Left;\n        if (TupleExpressionSyntaxWrapper.IsInstance(left))\n        {\n            var tuple = (TupleExpressionSyntaxWrapper)left;\n            var argumentExpressions = tuple.AllArguments().Select(x => (SyntaxNode)x.Expression);\n            var designationsExpanded = argumentExpressions.SelectMany(x => x.IsKind(SyntaxKindEx.DeclarationExpression)\n                    ? ((DeclarationExpressionSyntaxWrapper)x).Designation.AllVariables().Select(x => (SyntaxNode)x)\n                    : new[] { x });\n            return designationsExpanded.ToImmutableArray();\n        }\n        else if (DeclarationExpressionSyntaxWrapper.IsInstance(left))\n        {\n            var declaration = (DeclarationExpressionSyntaxWrapper)left;\n            return declaration.Designation.AllVariables().Select(x => (SyntaxNode)x).ToImmutableArray();\n        }\n        else\n        {\n            return ImmutableArray.Create<SyntaxNode>(left);\n        }\n    }\n\n    private static NestingMatch MapTupleElements(ImmutableArray<AssignmentMapping>.Builder arrayBuilder, TupleExpressionSyntaxWrapper left, TupleExpressionSyntaxWrapper right)\n    {\n        if (left.Arguments.Count != right.Arguments.Count)\n        {\n            return NestingMatch.Failed;\n        }\n\n        var leftEnumerator = left.Arguments.GetEnumerator();\n        var rightEnumerator = right.Arguments.GetEnumerator();\n        while (leftEnumerator.MoveNext() && rightEnumerator.MoveNext())\n        {\n            var leftArgumentExpression = leftEnumerator.Current.Expression;\n            var rightArgumentExpression = rightEnumerator.Current.Expression;\n            switch (HandleTupleNesting(arrayBuilder, leftArgumentExpression, rightArgumentExpression))\n            {\n                case NestingMatch.Handled:\n                    break; // the switch\n                case NestingMatch.Failed:\n                    return NestingMatch.Failed;\n                case NestingMatch.Leaf:\n                    arrayBuilder.Add(new AssignmentMapping(leftArgumentExpression, rightArgumentExpression));\n                    break; // the switch\n            }\n        }\n\n        return NestingMatch.Handled;\n    }\n\n    private static NestingMatch MapDesignationElements(ImmutableArray<AssignmentMapping>.Builder arrayBuilder,\n                                                       ParenthesizedVariableDesignationSyntaxWrapper left,\n                                                       TupleExpressionSyntaxWrapper right)\n    {\n        if (left.Variables.Count != right.Arguments.Count)\n        {\n            return NestingMatch.Failed;\n        }\n\n        var leftEnumerator = left.Variables.GetEnumerator();\n        var rightEnumerator = right.Arguments.GetEnumerator();\n        while (leftEnumerator.MoveNext() && rightEnumerator.MoveNext())\n        {\n            var leftVar = leftEnumerator.Current;\n            var rightExpression = rightEnumerator.Current.Expression;\n            switch (HandleDesignationNesting(arrayBuilder, leftVar, rightExpression))\n            {\n                case NestingMatch.Handled:\n                    break; // the switch\n                case NestingMatch.Failed:\n                    return NestingMatch.Failed;\n                case NestingMatch.Leaf:\n                    arrayBuilder.Add(new AssignmentMapping(leftVar.SyntaxNode, rightExpression));\n                    break; // the switch\n            }\n        }\n\n        return NestingMatch.Handled;\n    }\n\n    private static NestingMatch HandleTupleNesting(ImmutableArray<AssignmentMapping>.Builder arrayBuilder, ExpressionSyntax leftExpression, ExpressionSyntax rightExpression) =>\n        true switch\n        {\n            _ when TupleExpressionSyntaxWrapper.IsInstance(leftExpression) && TupleExpressionSyntaxWrapper.IsInstance(rightExpression) =>\n                MapTupleElements(arrayBuilder, (TupleExpressionSyntaxWrapper)leftExpression, (TupleExpressionSyntaxWrapper)rightExpression),\n            _ when DeclarationExpressionSyntaxWrapper.IsInstance(leftExpression)\n                && (DeclarationExpressionSyntaxWrapper)leftExpression is { Designation: { } leftDesignation } =>\n                HandleDesignationNesting(arrayBuilder, leftDesignation, rightExpression),\n            _ => NestingMatch.Leaf,\n        };\n\n    private static NestingMatch HandleDesignationNesting(ImmutableArray<AssignmentMapping>.Builder arrayBuilder, VariableDesignationSyntaxWrapper leftVar, ExpressionSyntax rightExpression) =>\n        true switch\n        {\n            _ when ParenthesizedVariableDesignationSyntaxWrapper.IsInstance(leftVar) && TupleExpressionSyntaxWrapper.IsInstance(rightExpression) =>\n                MapDesignationElements(arrayBuilder, (ParenthesizedVariableDesignationSyntaxWrapper)leftVar, (TupleExpressionSyntaxWrapper)rightExpression),\n            _ => NestingMatch.Leaf,\n        };\n\n    private enum NestingMatch\n    {\n        Handled,\n        Failed,\n        Leaf\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Extensions/AttributeListSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Extensions;\n\npublic static class AttributeListSyntaxExtensions\n{\n    public static IEnumerable<AttributeSyntax> GetAttributes(this SyntaxList<AttributeListSyntax> attributeLists, KnownType attributeKnownType, SemanticModel semanticModel) =>\n        attributeLists.SelectMany(x => x.Attributes).Where(x => x.IsKnownType(attributeKnownType, semanticModel));\n\n    public static IEnumerable<AttributeSyntax> GetAttributes(this SyntaxList<AttributeListSyntax> attributeLists, ImmutableArray<KnownType> attributeKnownTypes, SemanticModel semanticModel) =>\n        attributeLists.SelectMany(list => list.Attributes).Where(x => x.IsKnownType(attributeKnownTypes, semanticModel));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Extensions/AttributeSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Extensions;\n\ninternal static class AttributeSyntaxExtensions\n{\n    private const int AttributeLength = 9;\n\n    public static bool IsKnownType(this AttributeSyntax attribute, ImmutableArray<KnownType> attributeKnownTypes, SemanticModel semanticModel)\n    {\n        for (var i = 0; i < attributeKnownTypes.Length; i++)\n        {\n            if (IsKnownType(attribute, attributeKnownTypes[i], semanticModel))\n            {\n                return true;\n            }\n        }\n        return false;\n    }\n\n    public static bool IsKnownType(this AttributeSyntax attribute, KnownType knownType, SemanticModel semanticModel) =>\n        attribute.Name.GetName().Contains(GetShortNameWithoutAttributeSuffix(knownType))\n        && ((SyntaxNode)attribute).IsKnownType(knownType, semanticModel);\n\n    private static string GetShortNameWithoutAttributeSuffix(KnownType knownType) =>\n        knownType.TypeName == nameof(Attribute)\n        || !knownType.TypeName.EndsWith(nameof(Attribute))\n            ? knownType.TypeName\n            : knownType.TypeName.Remove(knownType.TypeName.Length - AttributeLength);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Extensions/AwaitExpressionSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Extensions;\n\npublic static class AwaitExpressionSyntaxExtensions\n{\n    public static ExpressionSyntax AwaitedExpressionWithoutConfigureAwait(this AwaitExpressionSyntax awaitExpression) =>\n        awaitExpression.Expression?.RemoveParentheses() switch\n        {\n            InvocationExpressionSyntax\n            {\n                Expression: MemberAccessExpressionSyntax\n                {\n                    Name.Identifier.Text: nameof(Task.ConfigureAwait),\n                    Expression: { } configuredExpression\n                }\n            } => configuredExpression,\n            var x => x,\n        };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Extensions/BaseArgumentListSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Extensions;\n\npublic static class BaseArgumentListSyntaxExtensions\n{\n    public static ArgumentSyntax GetArgumentByName(this BaseArgumentListSyntax list, string name) =>\n        list.Arguments.FirstOrDefault(argument => argument.NameIs(name));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Extensions/BaseMethodDeclarationSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Extensions;\n\npublic static class BaseMethodDeclarationSyntaxExtensions\n{\n    public static IEnumerable<SyntaxNode> GetBodyDescendantNodes(this BaseMethodDeclarationSyntax method) =>\n        (method ?? throw new ArgumentNullException(nameof(method))).Body == null\n            ? method.ExpressionBody().DescendantNodes()\n            : method.Body.DescendantNodes();\n\n    public static bool IsStatic(this BaseMethodDeclarationSyntax methodDeclaration) =>\n        methodDeclaration.Modifiers.Any(SyntaxKind.StaticKeyword);\n\n    public static bool IsExtern(this BaseMethodDeclarationSyntax methodDeclaration) =>\n        methodDeclaration.Modifiers.Any(SyntaxKind.ExternKeyword);\n\n    public static bool HasBodyOrExpressionBody(this BaseMethodDeclarationSyntax node) =>\n        node.GetBodyOrExpressionBody() is not null;\n\n    public static SyntaxNode GetBodyOrExpressionBody(this BaseMethodDeclarationSyntax node) =>\n        (node?.Body as SyntaxNode) ?? node?.ExpressionBody()?.Expression;\n\n    public static bool ContainsMethodInvocation(this BaseMethodDeclarationSyntax methodDeclarationBase, SemanticModel semanticModel, Func<InvocationExpressionSyntax, bool> syntaxPredicate, Func<IMethodSymbol, bool> symbolPredicate)\n    {\n        var childNodes = methodDeclarationBase?.Body?.DescendantNodes()\n            ?? methodDeclarationBase?.ExpressionBody()?.DescendantNodes()\n            ?? Enumerable.Empty<SyntaxNode>();\n\n        // See issue: https://github.com/SonarSource/sonar-dotnet/issues/416\n        // Where clause excludes nodes that are not defined on the same SyntaxTree as the SemanticModel\n        // (because of partial definition).\n        // More details: https://github.com/dotnet/roslyn/issues/18730\n        return childNodes\n            .OfType<InvocationExpressionSyntax>()\n            .Where(syntaxPredicate)\n            .Select(x => x.Expression.SyntaxTree.SemanticModelOrDefault(semanticModel)?.GetSymbolInfo(x.Expression).Symbol)\n            .OfType<IMethodSymbol>()\n            .Any(symbolPredicate);\n    }\n\n    public static SyntaxToken? GetIdentifierOrDefault(this BaseMethodDeclarationSyntax methodDeclaration) =>\n        methodDeclaration switch\n        {\n            ConstructorDeclarationSyntax constructor => (SyntaxToken?)constructor.Identifier,\n            DestructorDeclarationSyntax destructor => (SyntaxToken?)destructor.Identifier,\n            MethodDeclarationSyntax method => (SyntaxToken?)method.Identifier,\n            _ => null,\n        };\n\n    public static Location FindIdentifierLocation(this BaseMethodDeclarationSyntax methodDeclaration) =>\n        GetIdentifierOrDefault(methodDeclaration)?.GetLocation();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Extensions/BlockSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Extensions;\n\npublic static class BlockSyntaxExtensions\n{\n    public static bool IsEmpty(this BlockSyntax block, bool treatCommentsAsContent = true, bool treatConditionalCompilationAsContent = true)\n    {\n        _ = block ?? throw new ArgumentNullException(nameof(block));\n        return !IsNotEmpty();\n\n        bool IsNotEmpty() =>\n            block.Statements.Any()\n            || ((treatCommentsAsContent || treatConditionalCompilationAsContent)\n                && (TriviaContainsCommentOrConditionalCompilation(block.OpenBraceToken.TrailingTrivia)\n                    || TriviaContainsCommentOrConditionalCompilation(block.CloseBraceToken.LeadingTrivia)));\n\n        bool TriviaContainsCommentOrConditionalCompilation(SyntaxTriviaList triviaList) =>\n            triviaList.Any(x =>\n                (treatCommentsAsContent && x.Kind() is SyntaxKind.SingleLineCommentTrivia or SyntaxKind.MultiLineCommentTrivia)\n                 || (treatConditionalCompilationAsContent && x.IsKind(SyntaxKind.DisabledTextTrivia)));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Extensions/CompilationUnitSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Extensions;\n\npublic static class CompilationUnitSyntaxExtensions\n{\n    public static IEnumerable<SyntaxNode> GetTopLevelMainBody(this CompilationUnitSyntax compilationUnit) =>\n        compilationUnit.ChildNodes()\n                       .SkipWhile(x => x.Kind() is SyntaxKind.UsingDirective or SyntaxKind.NamespaceDeclaration)\n                       .TakeWhile(x => x.IsKind(SyntaxKind.GlobalStatement));\n\n    public static IEnumerable<IMethodDeclaration> GetMethodDeclarations(this CompilationUnitSyntax compilationUnitSyntax) =>\n        compilationUnitSyntax.GetTopLevelMainBody()\n                             .Select(x => x.ChildNodes().FirstOrDefault(y => y.IsKind(SyntaxKindEx.LocalFunctionStatement)))\n                             .Where(x => x != null)\n                             .Select(x => MethodDeclarationFactory.Create(x));\n\n    public static bool IsTopLevelMain(this CompilationUnitSyntax compilationUnit) =>\n        compilationUnit.Members.Any(x => x.IsKind(SyntaxKind.GlobalStatement));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Extensions/ExpressionSyntaxExtensions.Roslyn.cs",
    "content": "﻿// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// See the LICENSE file in the project root for more information.\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace Microsoft.CodeAnalysis.CSharp.Extensions;\n\n// Copied from Roslyn\n// https://github.com/dotnet/roslyn/blob/575bc42589145ba18b4f1cc2267d02695f861d8f/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/ExpressionSyntaxExtensions.cs\n[ExcludeFromCodeCoverage]\npublic static class ExpressionSyntaxExtensions\n{\n    /// <summary>\n    /// Returns <see langword=\"true\"/> if <paramref name=\"expression\"/> represents a node where a value is written to, like on the left side of an assignment expression. This method\n    /// also returns <see langword=\"true\"/> for potentially writeable expressions, like <see langword=\"ref\"/> parameters.\n    /// See also <seealso cref=\"IsOnlyWrittenTo(ExpressionSyntax)\"/>.\n    /// </summary>\n    /// <remarks>\n    /// Copied from <seealso href=\"https://github.com/dotnet/roslyn/blob/575bc42589145ba18b4f1cc2267d02695f861d8f/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/ExpressionSyntaxExtensions.cs#L319\"/>\n    /// </remarks>\n    public static bool IsWrittenTo(\n        this ExpressionSyntax expression,\n        SemanticModel semanticModel,\n        CancellationToken cancellationToken)\n    {\n        if (expression == null)\n            return false;\n\n        expression = GetExpressionToAnalyzeForWrites(expression);\n\n        if (expression.IsOnlyWrittenTo())\n            return true;\n\n        if (expression.IsInRefContext(out var refParent))\n        {\n            // most cases of `ref x` will count as a potential write of `x`.  An important exception is:\n            // `ref readonly y = ref x`.  In that case, because 'y' can't be written to, this would not\n            // be a write of 'x'.\n            if (refParent.Parent is EqualsValueClauseSyntax { Parent: VariableDeclaratorSyntax { Parent: VariableDeclarationSyntax { Type: { } variableDeclarationType } } })\n            {\n                if (ScopedTypeSyntaxWrapper.IsInstance(variableDeclarationType) && (ScopedTypeSyntaxWrapper)variableDeclarationType is { } scopedType)\n                {\n                    variableDeclarationType = scopedType.Type;\n                }\n\n                if (RefTypeSyntaxWrapper.IsInstance(variableDeclarationType) && ((RefTypeSyntaxWrapper)variableDeclarationType).ReadOnlyKeyword != default)\n                {\n                    return false;\n                }\n            }\n\n            return true;\n        }\n\n        // Similar to `ref x`, `&x` allows reads and write of the value, meaning `x` may be (but is not definitely)\n        // written to.\n        if (expression.Parent.IsKind(SyntaxKind.AddressOfExpression))\n            return true;\n\n        // We're written if we're used in a ++, or -- expression.\n        if (expression.IsOperandOfIncrementOrDecrementExpression())\n            return true;\n\n        if (expression.IsLeftSideOfAnyAssignExpression())\n            return true;\n\n        // An extension method invocation with a ref-this parameter can write to an expression.\n        if (expression.Parent is MemberAccessExpressionSyntax memberAccess &&\n            expression == memberAccess.Expression)\n        {\n            var symbol = semanticModel.GetSymbolInfo(memberAccess, cancellationToken).Symbol;\n            if (symbol is IMethodSymbol\n                {\n                    MethodKind: MethodKind.ReducedExtension,\n                    ReducedFrom.Parameters: { Length: > 0 } parameters,\n                } && parameters[0].RefKind == RefKind.Ref)\n            {\n                return true;\n            }\n        }\n\n        return false;\n    }\n\n    // Copy of\n    // https://github.com/dotnet/roslyn/blob/575bc42589145ba18b4f1cc2267d02695f861d8f/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/ExpressionSyntaxExtensions.cs#L221\n    private static ExpressionSyntax GetExpressionToAnalyzeForWrites(ExpressionSyntax? expression)\n    {\n        if (expression.IsRightSideOfDotOrArrow())\n        {\n            expression = (ExpressionSyntax)expression.Parent;\n        }\n\n        expression = (ExpressionSyntax)expression.WalkUpParentheses();\n\n        return expression;\n    }\n\n    // Copy of\n    // https://github.com/dotnet/roslyn/blob/575bc42589145ba18b4f1cc2267d02695f861d8f/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/ExpressionSyntaxExtensions.cs#L63\n    public static bool IsRightSideOfDotOrArrow(this ExpressionSyntax name)\n        => IsAnyMemberAccessExpressionName(name) || IsRightSideOfQualifiedName(name);\n\n    // Copy of\n    // https://github.com/dotnet/roslyn/blob/575bc42589145ba18b4f1cc2267d02695f861d8f/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/ExpressionSyntaxExtensions.cs#L41\n    public static bool IsAnyMemberAccessExpressionName(this ExpressionSyntax expression)\n    {\n        if (expression == null)\n            return false;\n\n        return expression == (expression.Parent as MemberAccessExpressionSyntax)?.Name ||\n            expression.IsMemberBindingExpressionName();\n    }\n\n    // Copy of\n    // https://github.com/dotnet/roslyn/blob/575bc42589145ba18b4f1cc2267d02695f861d8f/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/ExpressionSyntaxExtensions.cs#L50\n    public static bool IsMemberBindingExpressionName(this ExpressionSyntax expression)\n        => expression?.Parent is MemberBindingExpressionSyntax memberBinding &&\n           memberBinding.Name == expression;\n\n    // Copy of\n    // https://github.com/dotnet/roslyn/blob/575bc42589145ba18b4f1cc2267d02695f861d8f/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/ExpressionSyntaxExtensions.cs#L54\n    public static bool IsRightSideOfQualifiedName(this ExpressionSyntax expression)\n        => expression?.Parent is QualifiedNameSyntax qualifiedName && qualifiedName.Right == expression;\n\n    // Copy of\n    // https://github.com/dotnet/roslyn/blob/575bc42589145ba18b4f1cc2267d02695f861d8f/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/ExpressionSyntaxExtensions.cs#L233\n    public static bool IsOnlyWrittenTo(this ExpressionSyntax expression)\n    {\n        expression = GetExpressionToAnalyzeForWrites(expression);\n\n        if (expression != null)\n        {\n            if (expression.IsInOutContext())\n            {\n                return true;\n            }\n\n            if (expression.Parent != null)\n            {\n                if (expression.IsLeftSideOfAssignExpression())\n                {\n                    return true;\n                }\n\n                if (expression.IsAttributeNamedArgumentIdentifier())\n                {\n                    return true;\n                }\n            }\n\n            if (IsExpressionOfArgumentInDeconstruction(expression))\n            {\n                return true;\n            }\n        }\n\n        return false;\n    }\n\n    /// <summary>\n    /// If this declaration or identifier is part of a deconstruction, find the deconstruction.\n    /// If found, returns either an assignment expression or a foreach variable statement.\n    /// Returns null otherwise.\n    ///\n    /// copied from SyntaxExtensions.GetContainingDeconstruction.\n    /// </summary>\n    /// <remarks>\n    /// Copied from <seealso href=\"https://github.com/dotnet/roslyn/blob/575bc42589145ba18b4f1cc2267d02695f861d8f/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/ExpressionSyntaxExtensions.cs#L273\"/>\n    /// </remarks>\n    private static bool IsExpressionOfArgumentInDeconstruction(ExpressionSyntax expr)\n    {\n        if (!expr.IsParentKind(SyntaxKind.Argument))\n        {\n            return false;\n        }\n\n        while (true)\n        {\n            var parent = expr.Parent;\n            if (parent == null)\n            {\n                return false;\n            }\n\n            switch (parent.Kind())\n            {\n                case SyntaxKind.Argument:\n                    if (parent.Parent?.Kind() == SyntaxKindEx.TupleExpression)\n                    {\n                        expr = (ExpressionSyntax)parent.Parent;\n                        continue;\n                    }\n\n                    return false;\n                case SyntaxKind.SimpleAssignmentExpression:\n                    if (((AssignmentExpressionSyntax)parent).Left == expr)\n                    {\n                        return true;\n                    }\n\n                    return false;\n                case SyntaxKindEx.ForEachVariableStatement:\n                    if (((ForEachVariableStatementSyntaxWrapper)parent).Variable == expr)\n                    {\n                        return true;\n                    }\n\n                    return false;\n\n                default:\n                    return false;\n            }\n        }\n    }\n\n    // https://github.com/dotnet/roslyn/blob/575bc42589145ba18b4f1cc2267d02695f861d8f/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/ExpressionSyntaxExtensions.cs#L190\n    public static bool IsInOutContext(this ExpressionSyntax expression)\n        => expression?.Parent is ArgumentSyntax { RefOrOutKeyword: SyntaxToken { RawKind: (int)SyntaxKind.OutKeyword } } argument &&\n           argument.Expression == expression;\n\n    // https://github.com/dotnet/roslyn/blob/575bc42589145ba18b4f1cc2267d02695f861d8f/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/ExpressionSyntaxExtensions.cs#L383\n    public static bool IsAttributeNamedArgumentIdentifier(this ExpressionSyntax expression)\n    {\n        var nameEquals = expression?.Parent as NameEqualsSyntax;\n        return nameEquals.IsParentKind(SyntaxKind.AttributeArgument);\n    }\n\n    // https://github.com/dotnet/roslyn/blob/575bc42589145ba18b4f1cc2267d02695f861d8f/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/ExpressionSyntaxExtensions.cs#L194\n    public static bool IsInRefContext(this ExpressionSyntax expression)\n        => IsInRefContext(expression, out _);\n\n    /// <summary>\n    /// Returns true if this expression is in some <c>ref</c> keyword context.  If <see langword=\"true\"/> then\n    /// <paramref name=\"refParent\"/> will be the node containing the <see langword=\"ref\"/> keyword.\n    /// </summary>\n    /// <remarks>\n    /// Copied from <seealso href=\"https://github.com/dotnet/roslyn/blob/575bc42589145ba18b4f1cc2267d02695f861d8f/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/ExpressionSyntaxExtensions.cs#L201\"/>\n    /// </remarks>\n    public static bool IsInRefContext(this ExpressionSyntax expression, out SyntaxNode refParent)\n    {\n        while (expression?.Parent is ParenthesizedExpressionSyntax or PostfixUnaryExpressionSyntax { RawKind: (int)SyntaxKindEx.SuppressNullableWarningExpression })\n            expression = (ExpressionSyntax)expression.Parent;\n\n        if (expression?.Parent switch\n        {\n            ArgumentSyntax { RefOrOutKeyword.RawKind: (int)SyntaxKind.RefKeyword } => true,\n            var x when RefExpressionSyntaxWrapper.IsInstance(x) => true,\n            _ => false,\n        })\n        {\n            refParent = expression.Parent;\n            return true;\n        }\n\n        refParent = null;\n        return false;\n    }\n\n    // https://github.com/dotnet/roslyn/blob/575bc42589145ba18b4f1cc2267d02695f861d8f/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/ExpressionSyntaxExtensions.cs#L389\n    public static bool IsOperandOfIncrementOrDecrementExpression(this ExpressionSyntax expression)\n    {\n        if (expression?.Parent is SyntaxNode parent)\n        {\n            switch (parent.Kind())\n            {\n                case SyntaxKind.PostIncrementExpression:\n                case SyntaxKind.PreIncrementExpression:\n                case SyntaxKind.PostDecrementExpression:\n                case SyntaxKind.PreDecrementExpression:\n                    return true;\n            }\n        }\n\n        return false;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Extensions/ExpressionSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CFG.Extensions;\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Extensions;\n\npublic static class ExpressionSyntaxExtensions\n{\n    private static readonly HashSet<SyntaxKind> LiteralSyntaxKinds =\n        [\n            SyntaxKind.CharacterLiteralExpression,\n            SyntaxKind.FalseLiteralExpression,\n            SyntaxKind.NullLiteralExpression,\n            SyntaxKind.NumericLiteralExpression,\n            SyntaxKind.StringLiteralExpression,\n            SyntaxKind.TrueLiteralExpression\n        ];\n\n    private static readonly HashSet<SyntaxKind> EqualsOrNotEquals =\n        [\n            SyntaxKind.EqualsExpression,\n            SyntaxKind.NotEqualsExpression\n        ];\n\n    public static ExpressionSyntax RemoveParentheses(this ExpressionSyntax expression) =>\n        (ExpressionSyntax)((SyntaxNode)expression).RemoveParentheses();\n\n    public static bool CanBeNull(this ExpressionSyntax expression, SemanticModel semanticModel) =>\n        semanticModel.GetTypeInfo(expression).Type is { } expressionType\n        && (expressionType.IsReferenceType || expressionType.Is(KnownType.System_Nullable_T));\n\n    public static ExpressionSyntax RemoveConditionalAccess(this ExpressionSyntax node)\n    {\n        var whenNotNull = node.RemoveParentheses();\n        while (whenNotNull is ConditionalAccessExpressionSyntax conditionalAccess)\n        {\n            whenNotNull = conditionalAccess.WhenNotNull.RemoveParentheses();\n        }\n        return whenNotNull;\n    }\n\n    /// <summary>\n    /// Given an expression:\n    /// - verify if it contains a comparison against the 'null' literal.\n    /// - if it does contain a comparison, extract the expression which is compared against 'null' and whether the comparison is affirmative or negative.\n    /// </summary>\n    /// <remarks>\n    /// The caller is expected to verify unary negative expression before. For example, for \"!(x == null)\", the caller should extract what is inside the parenthesis.\n    /// </remarks>\n    /// <param name=\"expression\">Expression expected to contain a comparison to null.</param>\n    /// <param name=\"compared\">The variable/expression which gets compared to null.</param>\n    /// <param name=\"isAffirmative\">True if the check is affirmative (\"== null\", \"is null\"), false if negative (\"!= null\", \"is not null\")</param>\n    /// <returns>True if the expression contains a comparison to null.</returns>\n    public static bool TryGetExpressionComparedToNull(this ExpressionSyntax expression, out ExpressionSyntax compared, out bool isAffirmative)\n    {\n        compared = null;\n        isAffirmative = false;\n        if (expression.RemoveParentheses() is BinaryExpressionSyntax binary && EqualsOrNotEquals.Contains(binary.Kind()))\n        {\n            isAffirmative = binary.IsKind(SyntaxKind.EqualsExpression);\n            var binaryLeft = binary.Left.RemoveParentheses();\n            var binaryRight = binary.Right.RemoveParentheses();\n            if (CSharpEquivalenceChecker.AreEquivalent(binaryLeft, SyntaxConstants.NullLiteralExpression))\n            {\n                compared = binaryRight;\n                return true;\n            }\n            else if (CSharpEquivalenceChecker.AreEquivalent(binaryRight, SyntaxConstants.NullLiteralExpression))\n            {\n                compared = binaryLeft;\n                return true;\n            }\n        }\n\n        if (IsPatternExpressionSyntaxWrapper.IsInstance(expression.RemoveParentheses()))\n        {\n            var isPatternWrapper = (IsPatternExpressionSyntaxWrapper)expression.RemoveParentheses();\n            if (isPatternWrapper.IsNotNull())\n            {\n                isAffirmative = false;\n                compared = isPatternWrapper.Expression;\n                return true;\n            }\n            else if (isPatternWrapper.IsNull())\n            {\n                isAffirmative = true;\n                compared = isPatternWrapper.Expression;\n                return true;\n            }\n        }\n\n        return false;\n    }\n\n    /// <summary>\n    /// Returns the expression, representing the left side of the dot. This is useful for finding the expression of an invoked expression. <br/>\n    /// For the expression of the invocation <c>M()</c> in the expression <c>this.A.B.M()</c> the member access <c>this.A.B</c> is returned and <br/>\n    /// for <c>this.A?.B?.M()</c> the member binding <c>.B</c> is returned.\n    /// </summary>\n    /// <param name=\"expression\">The expression to start the search of. Should be an MemberAccess or a MemberBinding.</param>\n    /// <returns>The expression left of the dot or question mark dot.</returns>\n    public static ExpressionSyntax GetLeftOfDot(this ExpressionSyntax expression) =>\n        expression switch\n        {\n            MemberAccessExpressionSyntax memberAccessExpression => memberAccessExpression.Expression,\n            MemberBindingExpressionSyntax memberBindingExpression => memberBindingExpression.GetParentConditionalAccessExpression()?.Expression,\n            _ => null,\n        };\n\n    public static ExpressionSyntax GetSelfOrTopParenthesizedExpression(this ExpressionSyntax node) =>\n         (ExpressionSyntax)SyntaxNodeExtensionsCSharp.GetSelfOrTopParenthesizedExpression((SyntaxNode)node);\n\n    public static bool IsOnThis(this ExpressionSyntax expression) =>\n        IsOn(expression, SyntaxKind.ThisExpression);\n\n    public static bool IsInNameOfArgument(this ExpressionSyntax expression, SemanticModel semanticModel)\n    {\n        var parentInvocation = expression.FirstAncestorOrSelf<InvocationExpressionSyntax>();\n        return parentInvocation is not null && parentInvocation.IsNameof(semanticModel);\n    }\n\n    public static bool IsStringEmpty(this ExpressionSyntax expression, SemanticModel semanticModel)\n    {\n        if (!expression.IsKind(SyntaxKind.SimpleMemberAccessExpression) &&\n            !expression.IsKind(SyntaxKind.PointerMemberAccessExpression))\n        {\n            return false;\n        }\n\n        var nameSymbolInfo = semanticModel.GetSymbolInfo(((MemberAccessExpressionSyntax)expression).Name);\n\n        return nameSymbolInfo.Symbol is not null &&\n               nameSymbolInfo.Symbol.IsInType(KnownType.System_String) &&\n               nameSymbolInfo.Symbol.Name == nameof(string.Empty);\n    }\n\n    public static bool HasConstantValue(this ExpressionSyntax expression, SemanticModel semanticModel) =>\n        expression.RemoveParentheses().IsAnyKind(LiteralSyntaxKinds) || expression.FindConstantValue(semanticModel) is not null;\n\n    public static bool IsLeftSideOfAssignment(this ExpressionSyntax expression)\n    {\n        var topParenthesizedExpression = expression.GetSelfOrTopParenthesizedExpression();\n        return topParenthesizedExpression.Parent.IsKind(SyntaxKind.SimpleAssignmentExpression)\n               && topParenthesizedExpression.Parent is AssignmentExpressionSyntax assignment\n               && assignment.Left == topParenthesizedExpression;\n    }\n\n    /// <summary>\n    /// Extracts all <see cref=\"SyntaxNode\"/> that can be bound to fields, methods, parameters, locals and so on from the <paramref name=\"expression\"/>.\n    /// <list type=\"table\">\n    /// <item><c>a + b</c> returns <c>[IdentifierName(a), IdentifierName(b)]</c></item>\n    /// <item><c>a.b</c> returns <c>[MemberAccess(a, b)]</c></item>\n    /// <item><c>a is b</c> returns <c>[IdentifierName(a)]</c></item>. Note: <c>b</c> can bind to a type or a constant member. The constant member bind is ignored.\n    /// <item><c>(b)a</c> returns <c>[IdentifierName(a)]</c></item>. Note: b can only bind to a type and is not returned.\n    /// <item><c>a is { b.c: d e }</c> returns <c>[IdentifierName(a)]</c></item> Patterns are not visited.\n    /// <item><c>a switch { b c => d }</c> returns <c>[IdentifierName(a), IdentifierName(d)]</c></item> Patterns are not visited.\n    /// </list>\n    /// </summary>\n    public static IReadOnlyCollection<ExpressionSyntax> ExtractMemberIdentifier(this ExpressionSyntax expression) =>\n        expression switch\n        {\n            IdentifierNameSyntax identifier => [identifier], // {Prop} -> Prop\n            MemberAccessExpressionSyntax memberAccess => [memberAccess], // {Prop.Something} -> Prop.Something\n            InvocationExpressionSyntax { ArgumentList.Arguments: { } arguments } invocation =>\n                [invocation, .. arguments.SelectMany(x => ExtractMemberIdentifier(x.Expression))], // {Method(a)} -> Method(), a\n            ElementAccessExpressionSyntax { ArgumentList.Arguments: { } arguments } elementAccess => [elementAccess, .. arguments.SelectMany(x => ExtractMemberIdentifier(x.Expression))],\n            ConditionalAccessExpressionSyntax conditional => [conditional.GetRootConditionalAccessExpression()],\n            AwaitExpressionSyntax { Expression: { } awaited } => ExtractMemberIdentifier(awaited), // {await Prop} _> Prop\n            PrefixUnaryExpressionSyntax { Operand: { } operand } => ExtractMemberIdentifier(operand), // {++Prop} -> Prop\n            PostfixUnaryExpressionSyntax { Operand: { } operand } => ExtractMemberIdentifier(operand), // {Prop++} -> Prop\n            CastExpressionSyntax { Expression: { } operand } => ExtractMemberIdentifier(operand), // {(Type)Prop} -> Prop\n            BinaryExpressionSyntax { RawKind: (int)SyntaxKind.AsExpression or (int)SyntaxKind.IsExpression, Left: { } left } =>\n                ExtractMemberIdentifier(left), // {Prop as Type} or {Prop is Type} -> Prop, {Prop is Constant} is ignored\n            BinaryExpressionSyntax { Left: { } left, Right: { } right } => [.. ExtractMemberIdentifier(left), .. ExtractMemberIdentifier(right)], // {Prop1 + Prop2} -> Prop1, Prop2\n            ParenthesizedExpressionSyntax { Expression: { } parenthesized } => ExtractMemberIdentifier(parenthesized), // {(Prop)} -> Prop\n            InterpolatedStringExpressionSyntax { Contents: { } contents } => [.. contents.OfType<InterpolationSyntax>().SelectMany(x => ExtractMemberIdentifier(x.Expression))],\n            // {Cond ? WhenTrue : WhenFalse} -> Cond, WhenTrue, WhenFalse\n            ConditionalExpressionSyntax { Condition: { } condition, WhenTrue: { } whenTrue, WhenFalse: { } whenFalse } =>\n                [.. ExtractMemberIdentifier(condition), .. ExtractMemberIdentifier(whenTrue), .. ExtractMemberIdentifier(whenFalse)],\n            // {Prop switch { Arm1 => InArm1, _ => InDefault }} -> Prop, InArm1, InDefault\n            { } switchExpression when SwitchExpressionSyntaxWrapper.IsInstance(switchExpression) && (SwitchExpressionSyntaxWrapper)switchExpression is { } wrapped =>\n                [.. ExtractMemberIdentifier(wrapped.GoverningExpression), .. wrapped.Arms.SelectMany(x => ExtractMemberIdentifier(x.Expression))],\n            { } isPattern when IsPatternExpressionSyntaxWrapper.IsInstance(isPattern) && (IsPatternExpressionSyntaxWrapper)isPattern is { } wrapped =>\n                ExtractMemberIdentifier(wrapped.Expression),\n            _ => [],\n        };\n\n    /// <summary>\n    /// On member access like operations, like <c>a.b</c>, c>a.b()</c>, or <c>a[b]</c>, the most left hand\n    /// member (<c>a</c>) is returned. <see langword=\"this\"/> is skipped, so <c>this.a</c> returns <c>a</c>.\n    /// </summary>\n    public static ExpressionSyntax LeftMostInMemberAccess(this ExpressionSyntax expression) =>\n        expression switch\n        {\n            IdentifierNameSyntax identifier => identifier, // Prop\n            MemberAccessExpressionSyntax { Expression: IdentifierNameSyntax identifier } => identifier, // Prop.Something -> Prop\n            MemberAccessExpressionSyntax { Expression: ThisExpressionSyntax, Name: IdentifierNameSyntax identifier } => identifier, // this.Prop -> Prop\n            MemberAccessExpressionSyntax { Expression: PredefinedTypeSyntax predefinedType } => predefinedType, // int.MaxValue -> int\n            MemberAccessExpressionSyntax { Expression: { } left } => LeftMostInMemberAccess(left), // Prop.Something.Something -> Prop\n            MemberBindingExpressionSyntax memberBindingExpression => memberBindingExpression.GetRootConditionalAccessExpression()?.Expression.LeftMostInMemberAccess(), // C#14 a?.b -> a\n            InvocationExpressionSyntax { Expression: { } left } => LeftMostInMemberAccess(left), // Method() -> Method, also this.Method() and Method().Something\n            ElementAccessExpressionSyntax { Expression: { } left } => LeftMostInMemberAccess(left), // a[b] -> a\n            ConditionalAccessExpressionSyntax conditional => LeftMostInMemberAccess(conditional.GetRootConditionalAccessExpression().Expression), // a?.b -> a\n            ParenthesizedExpressionSyntax { Expression: { } inner } => LeftMostInMemberAccess(inner), // (a.b).c -> a\n            PostfixUnaryExpressionSyntax { RawKind: (int)SyntaxKindEx.SuppressNullableWarningExpression } nullSuppression => LeftMostInMemberAccess(nullSuppression.Operand), // a! -> a\n            ExpressionSyntax { RawKind: (int)SyntaxKindEx.FieldExpression } fieldExpression => fieldExpression, // C#14 field keyword\n            _ => null,\n        };\n\n    /// <summary>\n    /// Returns <see langword=\"true\"/> if the expression is a default literal or a null supressed default literal, i.e. <c>default</c> or <c>default!</c>.\n    /// It returns <see langword=\"false\"/> for other expressions, including <c>default(object)</c> or <c>default(object)!</c>.\n    /// </summary>\n    /// <param name=\"expression\">The potential default literal.</param>\n    /// <returns>Returns <see langword=\"true\"/> if the expressions is a default literal or a supressed null literal.</returns>\n    public static bool IsDefaultLiteral(this ExpressionSyntax expression) =>\n        expression?.RemoveParentheses() is { } innerExpression\n        && (innerExpression.IsKind(SyntaxKindEx.DefaultLiteralExpression)\n            || (innerExpression is PostfixUnaryExpressionSyntax { RawKind: (int)SyntaxKindEx.SuppressNullableWarningExpression, Operand: { } supressionOperand }\n                && supressionOperand.RemoveParentheses() is { RawKind: (int)SyntaxKindEx.DefaultLiteralExpression }));\n\n    private static bool IsOn(this ExpressionSyntax expression, SyntaxKind onKind) =>\n        expression switch\n        {\n            InvocationExpressionSyntax invocation => IsOn(invocation.Expression, onKind),\n            // Following statement is a simplification as we don't check where the method is defined (so this could be this or base)\n            AliasQualifiedNameSyntax or GenericNameSyntax or IdentifierNameSyntax or QualifiedNameSyntax => true,\n            MemberAccessExpressionSyntax memberAccess => memberAccess.Expression.RemoveParentheses().IsKind(onKind),\n            ConditionalAccessExpressionSyntax conditionalAccess => conditionalAccess.Expression.RemoveParentheses().IsKind(onKind),\n            _ => false,\n        };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Extensions/InterpolatedStringExpressionSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Extensions;\n\npublic static class InterpolatedStringExpressionSyntaxExtensions\n{\n    public static string ContentsText(this InterpolatedStringExpressionSyntax interpolatedStringExpression) =>\n        interpolatedStringExpression.Contents.JoinStr(null, x => x.ToString());\n\n    public static string InterpolatedTextValue(this InterpolatedStringExpressionSyntax interpolatedStringExpression, SemanticModel model) =>\n        CSharpStringInterpolationConstantValueResolver.Instance.InterpolatedTextValue(interpolatedStringExpression, model);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Extensions/InvocationExpressionSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Extensions;\n\npublic static class InvocationExpressionSyntaxExtensions\n{\n    public static bool IsMemberAccessOnKnownType(this InvocationExpressionSyntax invocation, string identifierName, KnownType knownType, SemanticModel model) =>\n        invocation.Expression is MemberAccessExpressionSyntax memberAccess\n        && memberAccess.IsMemberAccessOnKnownType(identifierName, knownType, model);\n\n    public static IEnumerable<ISymbol> GetArgumentSymbolsOfKnownType(this InvocationExpressionSyntax invocation, KnownType knownType, SemanticModel model) =>\n        invocation.ArgumentList.Arguments.GetSymbolsOfKnownType(knownType, model);\n\n    public static bool HasExactlyNArguments(this InvocationExpressionSyntax invocation, int count) =>\n        invocation is not null && invocation.ArgumentList.Arguments.Count == count;\n\n    public static bool IsGetTypeCall(this InvocationExpressionSyntax invocation, SemanticModel model) =>\n        invocation is not null\n        && model.GetSymbolInfo(invocation).Symbol is IMethodSymbol methodSymbol && methodSymbol.IsGetTypeCall();\n\n    public static bool IsOnBase(this InvocationExpressionSyntax invocation) =>\n        (invocation.Expression as MemberAccessExpressionSyntax)?.Expression is BaseExpressionSyntax;\n\n    public static bool IsEqualTo(this InvocationExpressionSyntax first, InvocationExpressionSyntax second, SemanticModel model) =>\n        Pair.From(model.GetSymbolInfo(first).Symbol, model.GetSymbolInfo(second).Symbol) switch\n        {\n            // the nameof(someVariable) is considered an Invocation Expression, but it is not a method call, and GetSymbolInfo returns null for it.\n            (null, null) when first.GetName() == \"nameof\" && second.GetName() == \"nameof\" => model.GetConstantValue(first).Equals(model.GetConstantValue(second)),\n            ({ } firstSymbol, { } secondSymbol) => firstSymbol.Equals(secondSymbol),\n            _ => false\n        };\n\n    public static Pair<SyntaxNode, SyntaxNode> Operands(this InvocationExpressionSyntax invocation) =>\n        invocation switch\n        {\n            { Expression: MemberAccessExpressionSyntax access } => new Pair<SyntaxNode, SyntaxNode>(access.Expression, access.Name),\n            { Expression: MemberBindingExpressionSyntax binding } => new(invocation.GetParentConditionalAccessExpression()?.Expression, binding.Name),\n            _ => default\n        };\n\n    public static SyntaxToken? GetMethodCallIdentifier(this InvocationExpressionSyntax invocation) =>\n        invocation?.Expression.GetIdentifier();\n\n    public static bool IsNameof(this InvocationExpressionSyntax expression, SemanticModel semanticModel) =>\n        expression is not null &&\n        expression.Expression is IdentifierNameSyntax identifierNameSyntax &&\n        identifierNameSyntax.Identifier.ValueText == Common.SyntaxConstants.NameOfKeywordText &&\n        semanticModel.GetSymbolInfo(expression).Symbol?.Kind != SymbolKind.Method;\n\n    public static bool IsMethodInvocation(this InvocationExpressionSyntax invocation, KnownType type, string methodName, SemanticModel semanticModel) =>\n        invocation.Expression.NameIs(methodName) &&\n        semanticModel.GetSymbolInfo(invocation).Symbol is IMethodSymbol methodSymbol &&\n        methodSymbol.IsInType(type);\n\n    public static bool IsMethodInvocation(this InvocationExpressionSyntax invocation, ImmutableArray<KnownType> types, string methodName, SemanticModel semanticModel) =>\n        invocation.Expression.NameIs(methodName) &&\n        semanticModel.GetSymbolInfo(invocation).Symbol is IMethodSymbol methodSymbol &&\n        methodSymbol.IsInType(types);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Extensions/LocalFunctionStatementSyntaxWrapperExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Extensions;\n\npublic static class LocalFunctionStatementSyntaxWrapperExtensions\n{\n    public static bool IsTopLevel(this LocalFunctionStatementSyntaxWrapper localFunction) =>\n        localFunction is { SyntaxNode.Parent: GlobalStatementSyntax { Parent: CompilationUnitSyntax } };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Extensions/MemberAccessExpressionSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Extensions;\n\npublic static class MemberAccessExpressionSyntaxExtensions\n{\n    public static bool IsMemberAccessOnKnownType(this MemberAccessExpressionSyntax memberAccess, string name, KnownType knownType, SemanticModel semanticModel) =>\n        memberAccess.NameIs(name)\n        && semanticModel.GetSymbolInfo(memberAccess).Symbol is {} symbol\n        && symbol.ContainingType.DerivesFrom(knownType);\n\n    public static bool IsPropertyInvocation(this MemberAccessExpressionSyntax expression, ImmutableArray<KnownType> types, string propertyName, SemanticModel semanticModel) =>\n        expression.NameIs(propertyName) &&\n        semanticModel.GetSymbolInfo(expression).Symbol is IPropertySymbol propertySymbol &&\n        propertySymbol.IsInType(types);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Extensions/MethodDeclarationSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Extensions;\n\npublic static class MethodDeclarationSyntaxExtensions\n{\n    /// <summary>\n    /// Returns true if the method throws exceptions or returns null.\n    /// </summary>\n    public static bool ThrowsOrReturnsNull(this MethodDeclarationSyntax syntaxNode) =>\n        syntaxNode.DescendantNodes().OfType<ThrowStatementSyntax>().Any() ||\n        syntaxNode.DescendantNodes().OfType<ExpressionSyntax>().Any(expression => expression.IsKind(SyntaxKindEx.ThrowExpression)) ||\n        syntaxNode.DescendantNodes().OfType<ReturnStatementSyntax>().Any(returnStatement => returnStatement.Expression.IsKind(SyntaxKind.NullLiteralExpression)) ||\n        // For simplicity this returns true for any method witch contains a NullLiteralExpression but this could be a source of FNs\n        syntaxNode.DescendantNodes().OfType<ExpressionSyntax>().Any(expression => expression.IsKind(SyntaxKind.NullLiteralExpression));\n\n    public static bool IsExtensionMethod(this BaseMethodDeclarationSyntax methodDeclaration) =>\n        methodDeclaration.ParameterList.Parameters.Count > 0\n        && methodDeclaration.ParameterList.Parameters[0].Modifiers.Any(s => s.IsKind(SyntaxKind.ThisKeyword));\n\n    public static bool HasReturnTypeVoid(this MethodDeclarationSyntax methodDeclaration) =>\n        methodDeclaration.ReturnType is PredefinedTypeSyntax { Keyword: { RawKind: (int)SyntaxKind.VoidKeyword } };\n\n    public static bool IsDeconstructor(this MethodDeclarationSyntax methodDeclaration)\n    {\n        return  methodDeclaration.HasReturnTypeVoid()\n                && (methodDeclaration.IsExtensionMethod() || !methodDeclaration.Modifiers.Any(SyntaxKind.StaticKeyword))\n                && methodDeclaration.Identifier.Value.Equals(\"Deconstruct\")\n                && AllParametersHaveModifierOut(methodDeclaration);\n\n        static bool AllParametersHaveModifierOut(MethodDeclarationSyntax methodDeclaration) =>\n            (methodDeclaration.IsExtensionMethod()\n             ? methodDeclaration.ParameterList.Parameters.Skip(1)\n             : methodDeclaration.ParameterList.Parameters)\n            .All(x => x.Modifiers.Any(y => y.IsKind(SyntaxKind.OutKeyword)));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Extensions/ObjectCreationExpressionSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Extensions;\n\npublic static class ObjectCreationExpressionSyntaxExtensions\n{\n    public static bool IsKnownType(this ObjectCreationExpressionSyntax objectCreation, KnownType knownType, SemanticModel semanticModel) =>\n        objectCreation.Type.GetName().EndsWith(knownType.TypeName)\n        && ((SyntaxNode)objectCreation).IsKnownType(knownType, semanticModel);\n\n    public static SyntaxToken? GetObjectCreationTypeIdentifier(this ObjectCreationExpressionSyntax objectCreation) =>\n        objectCreation?.Type.GetIdentifier();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Extensions/ParameterSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Extensions;\n\npublic static class ParameterSyntaxExtensions\n{\n    /// <summary>\n    /// Returns true if the parameter is of type string. For performance reasons the check is done at the syntax level.\n    /// </summary>\n    public static bool IsString(this ParameterSyntax parameterSyntax) =>\n        IsString(parameterSyntax.Type.ToString());\n\n    private static bool IsString(string parameterTypeName) =>\n        parameterTypeName == \"string\" ||\n        parameterTypeName == \"String\" ||\n        parameterTypeName == \"System.String\";\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Extensions/PropertyDeclarationSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Extensions;\n\npublic static class PropertyDeclarationSyntaxExtensions\n{\n    public static bool IsAutoProperty(this PropertyDeclarationSyntax propertyDeclaration) =>\n        propertyDeclaration.AccessorList != null\n        && propertyDeclaration.AccessorList.Accessors\n                              .All(accessor => accessor.Body == null && accessor.ExpressionBody == null);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Extensions/StatementSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Extensions;\n\npublic static class StatementSyntaxExtensions\n{\n    extension(StatementSyntax statement)\n    {\n        /// <summary>\n        /// Returns the statement before the statement given as input.\n        /// </summary>\n        public StatementSyntax PrecedingStatement =>\n            statement.SiblingStatements()\n                .OfType<StatementSyntax>()\n                .TakeWhile(x => x != statement)\n                .LastOrDefault();\n\n        /// <summary>\n        /// Returns the statement after the statement given as input.\n        /// </summary>\n        public StatementSyntax FollowingStatement =>\n            statement.SiblingStatements()\n                .OfType<StatementSyntax>()\n                .SkipWhile(x => x != statement)\n                .Skip(1)\n                .FirstOrDefault();\n\n        public StatementSyntax FirstNonBlockStatement\n        {\n            get\n            {\n                var current = statement;\n                while (current is BlockSyntax { } block)\n                {\n                    current = block.Statements.FirstOrDefault();\n                }\n                return current;\n            }\n        }\n\n        private IEnumerable<SyntaxNode> SiblingStatements() =>\n            statement.Parent is GlobalStatementSyntax\n                ? statement.SyntaxTree\n                    .GetCompilationUnitRoot()\n                    .ChildNodes()\n                    .OfType<GlobalStatementSyntax>()\n                    .Select(x => x.Statement)\n                : statement.Parent.ChildNodes();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Extensions/SwitchExpressionSyntaxWrapperExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Extensions;\n\npublic static class SwitchExpressionSyntaxWrapperExtensions\n{\n    public static bool HasDiscardPattern(this SwitchExpressionSyntaxWrapper switchExpression) =>\n        switchExpression.Arms.Any(arm => DiscardPatternSyntaxWrapper.IsInstance(arm.Pattern.SyntaxNode));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Extensions/SwitchStatementSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Extensions;\n\npublic static class SwitchStatementSyntaxExtensions\n{\n    public static bool HasDefaultLabel(this SwitchStatementSyntax node) =>\n        GetDefaultLabelSectionIndex(node) >= 0;\n\n    public static int GetDefaultLabelSectionIndex(this SwitchStatementSyntax node) =>\n        node.Sections.IndexOf(x => x.Labels.AnyOfKind(SyntaxKind.DefaultSwitchLabel));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Extensions/SyntaxNodeExtensions.Roslyn.cs",
    "content": "﻿// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// See the LICENSE file in the project root for more information.\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace Microsoft.CodeAnalysis.CSharp.Extensions;\n\n[ExcludeFromCodeCoverage]\npublic static class SyntaxNodeExtensions\n{\n    /// <summary>\n    /// Returns the left hand side of a conditional access expression. Returns c in case like a?.b?[0].c?.d.e?.f if d is passed.\n    /// </summary>\n    /// <remarks>Copied from <seealso href=\"https://github.com/dotnet/roslyn/blob/18f20b489/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/SyntaxNodeExtensions.cs#L188\">\n    /// Roslyn SyntaxNodeExtensions</seealso></remarks>\n    public static ConditionalAccessExpressionSyntax GetParentConditionalAccessExpression(this SyntaxNode node)\n    {\n        // Walk upwards based on the grammar/parser rules around ?. expressions (can be seen in\n        // LanguageParser.ParseConsequenceSyntax).\n\n        // These are the parts of the expression that the ?... expression can end with.  Specifically:\n        //\n        //  1.      x?.y.M()            // invocation\n        //  2.      x?.y[...];          // element access\n        //  3.      x?.y.z              // member access\n        //  4.      x?.y                // member binding\n        //  5.      x?[y]               // element binding\n        var current = node;\n\n        if ((current.IsParentKind(SyntaxKind.SimpleMemberAccessExpression, out MemberAccessExpressionSyntax memberAccess) && memberAccess.Name == current) ||\n            (current.IsParentKind(SyntaxKind.MemberBindingExpression, out MemberBindingExpressionSyntax memberBinding) && memberBinding.Name == current))\n        {\n            current = current.Parent;\n        }\n\n        // Effectively, if we're on the RHS of the ? we have to walk up the RHS spine first until we hit the first\n        // conditional access.\n        while ((current.Kind() is SyntaxKind.InvocationExpression\n            or SyntaxKind.ElementAccessExpression\n            or SyntaxKind.SimpleMemberAccessExpression\n            or SyntaxKind.MemberBindingExpression\n            or SyntaxKind.ElementBindingExpression\n            // Optional exclamations might follow the conditional operation. For example: a.b?.$$c!!!!()\n            or SyntaxKindEx.SuppressNullableWarningExpression) &&\n            current.Parent is not ConditionalAccessExpressionSyntax)\n        {\n            current = current.Parent;\n        }\n\n        // Two cases we have to care about:\n        //\n        //      1. a?.b.$$c.d        and\n        //      2. a?.b.$$c.d?.e...\n        //\n        // Note that `a?.b.$$c.d?.e.f?.g.h.i` falls into the same bucket as two.  i.e. the parts after `.e` are\n        // lower in the tree and are not seen as we walk upwards.\n        //\n        //\n        // To get the root ?. (the one after the `a`) we have to potentially consume the first ?. on the RHS of the\n        // right spine (i.e. the one after `d`).  Once we do this, we then see if that itself is on the RHS of a\n        // another conditional, and if so we hten return the one on the left.  i.e. for '2' this goes in this direction:\n        //\n        //      a?.b.$$c.d?.e           // it will do:\n        //           ----->\n        //       <---------\n        //\n        // Note that this only one CAE consumption on both sides.  GetRootConditionalAccessExpression can be used to\n        // get the root parent in a case like:\n        //\n        //      x?.y?.z?.a?.b.$$c.d?.e.f?.g.h.i         // it will do:\n        //                    ----->\n        //                <---------\n        //             <---\n        //          <---\n        //       <---\n        if (current.IsParentKind(SyntaxKind.ConditionalAccessExpression, out ConditionalAccessExpressionSyntax conditional) &&\n            conditional.Expression == current)\n        {\n            current = conditional;\n        }\n\n        if (current.IsParentKind(SyntaxKind.ConditionalAccessExpression, out conditional) &&\n            conditional.WhenNotNull == current)\n        {\n            current = conditional;\n        }\n\n        return current as ConditionalAccessExpressionSyntax;\n    }\n\n    /// <summary>\n    /// Call on the `.y` part of a `x?.y` to get the entire `x?.y` conditional access expression.  This also works\n    /// when there are multiple chained conditional accesses.  For example, calling this on '.y' or '.z' in\n    /// `x?.y?.z` will both return the full `x?.y?.z` node.  This can be used to effectively get 'out' of the RHS of\n    /// a conditional access, and commonly represents the full standalone expression that can be operated on\n    /// atomically.\n    /// </summary>\n    /// <remarks>Copied from Roslyn SyntaxNodeExtensions.</remarks>\n    public static ConditionalAccessExpressionSyntax GetRootConditionalAccessExpression(this SyntaxNode node)\n    {\n        // Once we've walked up the entire RHS, now we continually walk up the conditional accesses until we're at\n        // the root. For example, if we have `a?.b` and we're on the `.b`, this will give `a?.b`.  Similarly with\n        // `a?.b?.c` if we're on either `.b` or `.c` this will result in `a?.b?.c` (i.e. the root of this CAE\n        // sequence).\n        var current = node.GetParentConditionalAccessExpression();\n        while (current.IsParentKind(SyntaxKind.ConditionalAccessExpression, out ConditionalAccessExpressionSyntax conditional) &&\n            conditional.WhenNotNull == current)\n        {\n            current = conditional;\n        }\n\n        return current;\n    }\n\n    // Copy of\n    // https://github.com/dotnet/roslyn/blob/575bc42589145ba18b4f1cc2267d02695f861d8f/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/SyntaxNodeExtensions.cs#L347\n    public static bool IsLeftSideOfAssignExpression(this SyntaxNode node)\n        => node?.Parent is AssignmentExpressionSyntax { RawKind: (int)SyntaxKind.SimpleAssignmentExpression } assignment &&\n           assignment.Left == node;\n\n    // Copy of\n    // https://github.com/dotnet/roslyn/blob/575bc42589145ba18b4f1cc2267d02695f861d8f/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/SyntaxNodeExtensions.cs#L43C1-L45C1\n    public static bool IsParentKind(this SyntaxNode node, SyntaxKind kind)\n        => Microsoft.CodeAnalysis.CSharpExtensions.IsKind(node?.Parent, kind);\n\n    // Copy of\n    // https://github.com/dotnet/roslyn/blob/575bc42589145ba18b4f1cc2267d02695f861d8f/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/SyntaxNodeExtensions.cs#L46\n    public static bool IsParentKind<T>(this SyntaxNode node, SyntaxKind kind, out T result) where T : SyntaxNode\n    {\n        if (node?.Parent?.IsKind(kind) is true && node.Parent is T t)\n        {\n            result = t;\n            return true;\n        }\n        result = null;\n        return false;\n    }\n\n    // Copy of\n    // https://github.com/dotnet/roslyn/blob/575bc42589145ba18b4f1cc2267d02695f861d8f/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/SyntaxNodeExtensions.cs#L351\n    public static bool IsLeftSideOfAnyAssignExpression(this SyntaxNode node)\n    {\n        return node?.Parent != null &&\n            node.Parent.IsAnyAssignExpression() &&\n            ((AssignmentExpressionSyntax)node.Parent).Left == node;\n    }\n\n    // Copy of\n    // https://github.com/dotnet/roslyn/blob/575bc42589145ba18b4f1cc2267d02695f861d8f/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/SyntaxNodeExtensions.cs#L323\n    public static bool IsAnyAssignExpression(this SyntaxNode node)\n        => SyntaxFacts.IsAssignmentExpression(node.Kind());\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Extensions/SyntaxNodeExtensionsCSharp.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CFG.Roslyn;\nusing SonarAnalyzer.CSharp.Core.Trackers;\n\n#pragma warning disable T0046 // Move Extensions to dedicated class\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Extensions;\n\npublic static class SyntaxNodeExtensionsCSharp\n{\n    private static readonly ControlFlowGraphCache CfgCache = new();\n\n    private static readonly HashSet<SyntaxKind> PerformanceSensitiveSyntaxes =\n    [\n        SyntaxKind.MethodDeclaration,\n        SyntaxKind.ConstructorDeclaration,\n        SyntaxKind.ParenthesizedLambdaExpression,\n        SyntaxKind.PropertyDeclaration,\n        SyntaxKindEx.LocalFunctionStatement\n    ];\n\n    private static readonly HashSet<SyntaxKind> EnclosingScopeSyntaxKinds =\n        [\n            SyntaxKind.AddAccessorDeclaration,\n            SyntaxKind.AnonymousMethodExpression,\n            SyntaxKind.BaseConstructorInitializer,\n            SyntaxKind.CompilationUnit,\n            SyntaxKind.ConstructorDeclaration,\n            SyntaxKind.ConversionOperatorDeclaration,\n            SyntaxKind.DestructorDeclaration,\n            SyntaxKind.EnumMemberDeclaration,\n            SyntaxKind.FieldDeclaration,\n            SyntaxKind.GetAccessorDeclaration,\n            SyntaxKind.GroupClause,\n            SyntaxKindEx.InitAccessorDeclaration,\n            SyntaxKind.JoinClause,\n            SyntaxKind.LetClause,\n            SyntaxKindEx.LocalFunctionStatement,\n            SyntaxKind.MethodDeclaration,\n            SyntaxKind.OrderByClause,\n            SyntaxKind.OperatorDeclaration,\n            SyntaxKind.Parameter,\n            SyntaxKind.ParenthesizedLambdaExpression,\n            SyntaxKindEx.PrimaryConstructorBaseType,\n            SyntaxKind.PropertyDeclaration,\n            SyntaxKind.RemoveAccessorDeclaration,\n            SyntaxKind.QueryContinuation,\n            SyntaxKind.SelectClause,\n            SyntaxKind.SetAccessorDeclaration,\n            SyntaxKind.SimpleLambdaExpression,\n            SyntaxKind.ThisConstructorInitializer,\n            SyntaxKind.WhereClause\n       ];\n\n    private static readonly SyntaxKind[] NegationOrConditionEnclosingSyntaxKinds = [\n        SyntaxKind.AnonymousMethodExpression,\n        SyntaxKind.BitwiseNotExpression,\n        SyntaxKind.ConditionalExpression,\n        SyntaxKind.IfStatement,\n        SyntaxKind.MethodDeclaration,\n        SyntaxKind.ParenthesizedLambdaExpression,\n        SyntaxKind.SimpleLambdaExpression,\n        SyntaxKind.WhileStatement];\n\n    public static ControlFlowGraph CreateCfg(this SyntaxNode node, SemanticModel model, CancellationToken cancel) =>\n        CfgCache.FindOrCreate(node, model, cancel);\n\n    public static bool ContainsConditionalConstructs(this SyntaxNode node) =>\n        node is not null && node.DescendantNodes().Any(x => x.Kind() is SyntaxKind.IfStatement\n                or SyntaxKind.ConditionalExpression\n                or SyntaxKind.CoalesceExpression\n                or SyntaxKind.SwitchStatement\n                or SyntaxKindEx.SwitchExpression\n                or SyntaxKindEx.CoalesceAssignmentExpression);\n\n    public static object FindConstantValue(this SyntaxNode node, SemanticModel semanticModel) =>\n        new CSharpConstantValueFinder(semanticModel).FindConstant(node);\n\n    public static string FindStringConstant(this SyntaxNode node, SemanticModel semanticModel) =>\n        FindConstantValue(node, semanticModel) as string;\n\n    public static bool IsPartOfBinaryNegationOrCondition(this SyntaxNode node)\n    {\n        if (node.Parent is not MemberAccessExpressionSyntax)\n        {\n            return false;\n        }\n\n        var topNode = node.Parent.GetSelfOrTopParenthesizedExpression();\n        if (topNode.Parent?.IsKind(SyntaxKind.BitwiseNotExpression) ?? false)\n        {\n            return true;\n        }\n\n        var current = topNode;\n        while (current.Parent is not null && !NegationOrConditionEnclosingSyntaxKinds.Contains(current.Parent.Kind()))\n        {\n            current = current.Parent;\n        }\n\n        return current.Parent switch\n        {\n            IfStatementSyntax ifStatement => ifStatement.Condition == current,\n            WhileStatementSyntax whileStatement => whileStatement.Condition == current,\n            ConditionalExpressionSyntax condExpr => condExpr.Condition == current,\n            _ => false\n        };\n    }\n\n    public static string GetDeclarationTypeName(this SyntaxNode node) =>\n        node.Kind() switch\n        {\n            SyntaxKind.ClassDeclaration => \"class\",\n            SyntaxKind.ConstructorDeclaration => \"constructor\",\n            SyntaxKind.DelegateDeclaration => \"delegate\",\n            SyntaxKind.DestructorDeclaration => \"destructor\",\n            SyntaxKind.EnumDeclaration => \"enum\",\n            SyntaxKind.EnumMemberDeclaration => \"enum\",\n            SyntaxKind.EventDeclaration => \"event\",\n            SyntaxKind.EventFieldDeclaration => \"event\",\n            SyntaxKind.FieldDeclaration => \"field\",\n            SyntaxKind.IndexerDeclaration => \"indexer\",\n            SyntaxKind.InterfaceDeclaration => \"interface\",\n            SyntaxKindEx.LocalFunctionStatement => \"local function\",\n            SyntaxKind.MethodDeclaration => \"method\",\n            SyntaxKind.PropertyDeclaration => \"property\",\n            SyntaxKindEx.RecordDeclaration => \"record\",\n            SyntaxKindEx.RecordStructDeclaration => \"record struct\",\n            SyntaxKind.StructDeclaration => \"struct\",\n#if DEBUG\n            _ => throw new UnexpectedValueException(\"node.Kind()\", node.Kind().ToString())\n#else\n            _ => \"type\"\n#endif\n        };\n\n    /// <summary>\n    /// Returns the <see cref=\"TypeSyntax\"/> that <paramref name=\"node\"/> directly owns, or that can be reached\n    /// via a single unambiguous property path (e.g. <c>CatchClauseSyntax → Declaration → Type</c>).\n    /// Does not unwrap nullable, array, pointer, or alias layers.\n    /// Returns <see langword=\"null\"/> if the node has no associated type.\n    /// </summary>\n    public static TypeSyntax TypeSyntax(this SyntaxNode node) =>\n        node switch\n        {\n            // Member declarations and function return types\n            BaseFieldDeclarationSyntax { Declaration: { } x } => x.TypeSyntax(),\n            BasePropertyDeclarationSyntax x => x.Type,\n            ConversionOperatorDeclarationSyntax x => x.Type,\n            DelegateDeclarationSyntax x => x.ReturnType,\n            { RawKind: (int)SyntaxKindEx.LocalFunctionStatement } x => ((LocalFunctionStatementSyntaxWrapper)x).ReturnType,\n            MethodDeclarationSyntax x => x.ReturnType,\n            OperatorDeclarationSyntax x => x.ReturnType,\n            ParenthesizedLambdaExpressionSyntax x => x.ReturnType,\n            SimpleLambdaExpressionSyntax x => x.Parameter.TypeSyntax(),\n            // Named typed slots\n            CatchDeclarationSyntax x => x.Type,\n            ParameterSyntax x => x.Type,\n            VariableDeclarationSyntax x => x.Type,\n            // Statements with a typed declaration\n            CatchClauseSyntax { Declaration: { } x } => x.TypeSyntax(),\n            FixedStatementSyntax { Declaration: { } x } => x.TypeSyntax(),\n            ForEachStatementSyntax x => x.Type,\n            ForStatementSyntax { Declaration: { } x } => x.TypeSyntax(),\n            LocalDeclarationStatementSyntax { Declaration: { } x } => x.TypeSyntax(),\n            UsingStatementSyntax { Declaration: { } x } => x.TypeSyntax(),\n            // Expressions with a type operand\n            BinaryExpressionSyntax { RawKind: (int)SyntaxKind.IsExpression or (int)SyntaxKind.AsExpression, Right: TypeSyntax x } => x,\n            CastExpressionSyntax x => x.Type,\n            DefaultExpressionSyntax x => x.Type,\n            ObjectCreationExpressionSyntax x => x.Type,\n            RefValueExpressionSyntax x => x.Type,\n            SizeOfExpressionSyntax x => x.Type,\n            StackAllocArrayCreationExpressionSyntax x => x.Type,\n            TypeOfExpressionSyntax x => x.Type,\n            // Type-referencing constructs\n            AttributeSyntax x => x.Name,\n            BaseTypeSyntax x => x.Type,\n            TypeConstraintSyntax x => x.Type,\n            UsingDirectiveSyntax x => x.NamespaceOrType,\n            // Query clauses\n            FromClauseSyntax x => x.Type,\n            JoinClauseSyntax x => x.Type,\n            // Wrapper types (shim layer — C# 9+ nodes)\n            { RawKind: (int)SyntaxKindEx.DeclarationExpression } x => ((DeclarationExpressionSyntaxWrapper)x).Type,\n            { RawKind: (int)SyntaxKindEx.DeclarationPattern } x => ((DeclarationPatternSyntaxWrapper)x).Type,\n            { RawKind: (int)SyntaxKindEx.FunctionPointerParameter } x => ((FunctionPointerParameterSyntaxWrapper)x).Type,\n            { RawKind: (int)SyntaxKindEx.RecursivePattern } x => ((RecursivePatternSyntaxWrapper)x).Type,\n            { RawKind: (int)SyntaxKindEx.RefType } x => ((RefTypeSyntaxWrapper)x).Type,\n            { RawKind: (int)SyntaxKindEx.ScopedType } x => ((ScopedTypeSyntaxWrapper)x).Type,\n            { RawKind: (int)SyntaxKindEx.TupleElement } x => ((TupleElementSyntaxWrapper)x).Type,\n            { RawKind: (int)SyntaxKindEx.TypePattern } x => ((TypePatternSyntaxWrapper)x).Type,\n            // Identity / fallback\n            TypeSyntax x => x,\n            _ => null\n        };\n\n    // Extracts the expression body from an arrow-bodied syntax node.\n    public static ArrowExpressionClauseSyntax ArrowExpressionBody(this SyntaxNode node) =>\n        node switch\n        {\n            MethodDeclarationSyntax a => a.ExpressionBody,\n            ConstructorDeclarationSyntax b => b.ExpressionBody(),\n            OperatorDeclarationSyntax c => c.ExpressionBody,\n            AccessorDeclarationSyntax d => d.ExpressionBody,\n            ConversionOperatorDeclarationSyntax e => e.ExpressionBody,\n            IndexerDeclarationSyntax f => f.ExpressionBody,\n            PropertyDeclarationSyntax g => g.ExpressionBody,\n            _ => null\n        };\n\n    public static SyntaxNode RemoveParentheses(this SyntaxNode expression)\n    {\n        var current = expression;\n        while (current is { } && current.Kind() is SyntaxKind.ParenthesizedExpression or SyntaxKindEx.ParenthesizedPattern)\n        {\n            current = current.IsKind(SyntaxKindEx.ParenthesizedPattern)\n                ? ((ParenthesizedPatternSyntaxWrapper)current).Pattern\n                : ((ParenthesizedExpressionSyntax)current).Expression;\n        }\n        return current;\n    }\n\n    public static SyntaxNode WalkUpParentheses(this SyntaxNode node)\n    {\n        while (node is not null && node.IsKind(SyntaxKind.ParenthesizedExpression))\n        {\n            node = node.Parent;\n        }\n        return node;\n    }\n\n    public static SyntaxToken? GetIdentifier(this SyntaxNode node) =>\n        node switch\n        {\n            AliasQualifiedNameSyntax { Name.Identifier: var identifier } => identifier,\n            ArgumentSyntax { NameColon.Name.Identifier: var identifier } => identifier,\n            ArrayTypeSyntax { ElementType: { } elementType } => GetIdentifier(elementType),\n            AttributeArgumentSyntax { NameColon.Name.Identifier: var identifier } => identifier,\n            AttributeArgumentSyntax { NameEquals.Name.Identifier: var identifier } => identifier,\n            AttributeSyntax { Name: { } name } => GetIdentifier(name),\n            BaseTypeDeclarationSyntax { Identifier: var identifier } => identifier,\n            CatchDeclarationSyntax { Identifier: var identifier } => identifier,\n            ConditionalAccessExpressionSyntax { WhenNotNull: var rightSide } => GetIdentifier(rightSide),\n            ConstructorDeclarationSyntax { Identifier: var identifier } => identifier,\n            ConstructorInitializerSyntax { ThisOrBaseKeyword: var keyword } => keyword,\n            ConversionOperatorDeclarationSyntax { Type: { } type } => GetIdentifier(type),\n            DelegateDeclarationSyntax { Identifier: var identifier } => identifier,\n            DestructorDeclarationSyntax { Identifier: var identifier } => identifier,\n            EnumMemberDeclarationSyntax { Identifier: var identifier } => identifier,\n            EventDeclarationSyntax { Identifier: var identifier } => identifier,\n            ForEachStatementSyntax { Identifier: var identifier } => identifier,\n            FromClauseSyntax { Identifier: var identifier } => identifier,\n            IndexerDeclarationSyntax { ThisKeyword: var thisKeyword } => thisKeyword,\n            InvocationExpressionSyntax\n            {\n                Expression: not InvocationExpressionSyntax // We don't want to recurse into nested invocations like: fun()()\n            } invocation => GetIdentifier(invocation.Expression),\n            JoinClauseSyntax { Identifier: var identifier } => identifier,\n            JoinIntoClauseSyntax { Identifier: var identifier } => identifier,\n            LetClauseSyntax { Identifier: var identifier } => identifier,\n            MemberAccessExpressionSyntax { Name.Identifier: var identifier } => identifier,\n            MemberBindingExpressionSyntax { Name.Identifier: var identifier } => identifier,\n            MethodDeclarationSyntax { Identifier: var identifier } => identifier,\n            NameColonSyntax nameColon => nameColon.Name.Identifier,\n            NamespaceDeclarationSyntax { Name: { } name } => GetIdentifier(name),\n            NullableTypeSyntax { ElementType: { } elementType } => GetIdentifier(elementType),\n            ObjectCreationExpressionSyntax { Type: var type } => GetIdentifier(type),\n            OperatorDeclarationSyntax { OperatorToken: var operatorToken } => operatorToken,\n            ParameterSyntax { Identifier: var identifier } => identifier,\n            ParenthesizedExpressionSyntax { Expression: { } expression } => GetIdentifier(expression),\n            PropertyDeclarationSyntax { Identifier: var identifier } => identifier,\n            PointerTypeSyntax { ElementType: { } elementType } => GetIdentifier(elementType),\n            PredefinedTypeSyntax { Keyword: var keyword } => keyword,\n            QualifiedNameSyntax { Right.Identifier: var identifier } => identifier,\n            QueryContinuationSyntax { Identifier: var identifier } => identifier,\n            SimpleBaseTypeSyntax { Type: { } type } => GetIdentifier(type),\n            SimpleNameSyntax { Identifier: var identifier } => identifier,\n            TypeParameterConstraintClauseSyntax { Name.Identifier: var identifier } => identifier,\n            TypeParameterSyntax { Identifier: var identifier } => identifier,\n            PrefixUnaryExpressionSyntax { Operand: { } operand } => GetIdentifier(operand),\n            PostfixUnaryExpressionSyntax { Operand: { } operand } => GetIdentifier(operand),\n            UsingDirectiveSyntax { Alias.Name: { } name } => GetIdentifier(name),\n            VariableDeclaratorSyntax { Identifier: var identifier } => identifier,\n            { } fileScoped when FileScopedNamespaceDeclarationSyntaxWrapper.IsInstance(fileScoped)\n                && ((FileScopedNamespaceDeclarationSyntaxWrapper)fileScoped).Name is { } name => GetIdentifier(name),\n            { } localFunction when LocalFunctionStatementSyntaxWrapper.IsInstance(localFunction) => ((LocalFunctionStatementSyntaxWrapper)localFunction).Identifier,\n            { } singleVar when SingleVariableDesignationSyntaxWrapper.IsInstance(singleVar) => ((SingleVariableDesignationSyntaxWrapper)singleVar).Identifier,\n            { } implicitNew when ImplicitObjectCreationExpressionSyntaxWrapper.IsInstance(implicitNew) => ((ImplicitObjectCreationExpressionSyntaxWrapper)implicitNew).NewKeyword,\n            { } primary when PrimaryConstructorBaseTypeSyntaxWrapper.IsInstance(primary)\n                && ((PrimaryConstructorBaseTypeSyntaxWrapper)primary).Type is { } type => GetIdentifier(type),\n            { } refType when RefTypeSyntaxWrapper.IsInstance(refType) => GetIdentifier(((RefTypeSyntaxWrapper)refType).Type),\n            { } subPattern when SubpatternSyntaxWrapper.IsInstance(subPattern) && ((SubpatternSyntaxWrapper)subPattern).ExpressionColon is { SyntaxNode: not null } expressionColon =>\n                GetIdentifier(expressionColon.Expression),\n            _ => null\n        };\n\n    /// <summary>\n    /// Finds the syntactic complementing <see cref=\"SyntaxNode\"/> of an assignment with tuples.\n    /// <code>\n    /// var (a, b) = (1, 2);      // if node is \"a\", \"1\" is returned and vice versa.\n    /// (var a, var b) = (1, 2);  // if node is \"2\", \"var b\" is returned and vice versa.\n    /// a = 1;                    // if node is \"a\", \"1\" is returned and vice versa.\n    /// t = (1, 2);               // if node is \"t\", \"(1, 2)\" is returned, if node is \"1\", \"null\" is returned.\n    /// </code>\n    /// <paramref name=\"node\"/> must be an <see cref=\"ArgumentSyntax\"/> of a tuple or some variable designation of a <see cref=\"SyntaxKindEx.DeclarationExpression\"/>.\n    /// </summary>\n    /// <returns>\n    /// The <see cref=\"SyntaxNode\"/> on the other side of the assignment or <see langword=\"null\"/> if <paramref name=\"node\"/> is not\n    /// a direct child of the assignment, not part of a tuple, not part of a designation, or no corresponding <see cref=\"SyntaxNode\"/>\n    /// can be found on the other side.\n    /// </returns>\n    public static SyntaxNode FindAssignmentComplement(this SyntaxNode node)\n    {\n        if (node is { Parent: AssignmentExpressionSyntax assigment })\n        {\n            return OtherSideOfAssignment(node, assigment);\n        }\n        // can be either outermost tuple, or DeclarationExpression if 'node' is SingleVariableDesignationExpression\n        var outermostParenthesesExpression = node.AncestorsAndSelf()\n            .TakeWhile(x => x?.Kind() is\n                SyntaxKind.Argument or\n                SyntaxKindEx.TupleExpression or\n                SyntaxKindEx.SingleVariableDesignation or\n                SyntaxKindEx.ParenthesizedVariableDesignation or\n                SyntaxKindEx.DiscardDesignation or\n                SyntaxKindEx.DeclarationExpression)\n            .LastOrDefault(x => x.Kind() is SyntaxKindEx.DeclarationExpression or SyntaxKindEx.TupleExpression);\n        if ((TupleExpressionSyntaxWrapper.IsInstance(outermostParenthesesExpression) || DeclarationExpressionSyntaxWrapper.IsInstance(outermostParenthesesExpression))\n            && outermostParenthesesExpression.Parent is AssignmentExpressionSyntax assignment)\n        {\n            var otherSide = OtherSideOfAssignment(outermostParenthesesExpression, assignment);\n            if (TupleExpressionSyntaxWrapper.IsInstance(otherSide) || DeclarationExpressionSyntaxWrapper.IsInstance(otherSide))\n            {\n                var stackFromNodeToOutermost = GetNestingPathFromNodeToOutermost(node);\n                return FindMatchingNestedNode(stackFromNodeToOutermost, otherSide);\n            }\n            else\n            {\n                return null;\n            }\n        }\n\n        return null;\n\n        static ExpressionSyntax OtherSideOfAssignment(SyntaxNode oneSide, AssignmentExpressionSyntax assignment) =>\n            assignment switch\n            {\n                { Left: { } left, Right: { } right } when left.Equals(oneSide) => right,\n                { Left: { } left, Right: { } right } when right.Equals(oneSide) => left,\n                _ => null,\n            };\n\n        static Stack<PathPosition> GetNestingPathFromNodeToOutermost(SyntaxNode node)\n        {\n            Stack<PathPosition> pathFromNodeToTheTop = new();\n            while (TupleExpressionSyntaxWrapper.IsInstance(node?.Parent)\n                || ParenthesizedVariableDesignationSyntaxWrapper.IsInstance(node?.Parent)\n                || DeclarationExpressionSyntaxWrapper.IsInstance(node?.Parent))\n            {\n                if (DeclarationExpressionSyntaxWrapper.IsInstance(node?.Parent) && node is { Parent.Parent: ArgumentSyntax { } argument })\n                {\n                    node = argument;\n                }\n                node = node switch\n                {\n                    ArgumentSyntax tupleArgument when TupleExpressionSyntaxWrapper.IsInstance(node.Parent) =>\n                        PushPathPositionForTuple(pathFromNodeToTheTop, (TupleExpressionSyntaxWrapper)node.Parent, tupleArgument),\n                    _ when VariableDesignationSyntaxWrapper.IsInstance(node) && ParenthesizedVariableDesignationSyntaxWrapper.IsInstance(node.Parent) =>\n                        PushPathPositionForParenthesizedDesignation(pathFromNodeToTheTop, (ParenthesizedVariableDesignationSyntaxWrapper)node.Parent, (VariableDesignationSyntaxWrapper)node),\n                    _ => null,\n                };\n            }\n            return pathFromNodeToTheTop;\n        }\n\n        static SyntaxNode FindMatchingNestedNode(Stack<PathPosition> pathFromOutermostToGivenNode, SyntaxNode outermostParenthesesToMatch)\n        {\n            var matchedNestedNode = outermostParenthesesToMatch;\n            while (matchedNestedNode is not null && pathFromOutermostToGivenNode.Count > 0)\n            {\n                if (DeclarationExpressionSyntaxWrapper.IsInstance(matchedNestedNode))\n                {\n                    matchedNestedNode = ((DeclarationExpressionSyntaxWrapper)matchedNestedNode).Designation;\n                }\n                var expectedPathPosition = pathFromOutermostToGivenNode.Pop();\n                matchedNestedNode = matchedNestedNode switch\n                {\n                    _ when TupleExpressionSyntaxWrapper.IsInstance(matchedNestedNode) => StepDownInTuple((TupleExpressionSyntaxWrapper)matchedNestedNode, expectedPathPosition),\n                    _ when ParenthesizedVariableDesignationSyntaxWrapper.IsInstance(matchedNestedNode) =>\n                        StepDownInParenthesizedVariableDesignation((ParenthesizedVariableDesignationSyntaxWrapper)matchedNestedNode, expectedPathPosition),\n                    _ => null,\n                };\n            }\n            return matchedNestedNode;\n        }\n\n        static SyntaxNode PushPathPositionForTuple(Stack<PathPosition> pathPositions, TupleExpressionSyntaxWrapper tuple, ArgumentSyntax argument)\n        {\n            pathPositions.Push(new(tuple.Arguments.IndexOf(argument), tuple.Arguments.Count));\n            return tuple.SyntaxNode.Parent;\n        }\n\n        static SyntaxNode PushPathPositionForParenthesizedDesignation(Stack<PathPosition> pathPositions,\n                                                                     ParenthesizedVariableDesignationSyntaxWrapper parenthesizedDesignation,\n                                                                     VariableDesignationSyntaxWrapper variable)\n        {\n            pathPositions.Push(new(parenthesizedDesignation.Variables.IndexOf(variable), parenthesizedDesignation.Variables.Count));\n            return parenthesizedDesignation.SyntaxNode;\n        }\n\n        static SyntaxNode StepDownInParenthesizedVariableDesignation(ParenthesizedVariableDesignationSyntaxWrapper parenthesizedVariableDesignation, PathPosition expectedPathPosition) =>\n            parenthesizedVariableDesignation.Variables.Count == expectedPathPosition.TupleLength\n                ? (SyntaxNode)parenthesizedVariableDesignation.Variables[expectedPathPosition.Index]\n                : null;\n\n        static SyntaxNode StepDownInTuple(TupleExpressionSyntaxWrapper tupleExpression, PathPosition expectedPathPosition) =>\n            tupleExpression.Arguments.Count == expectedPathPosition.TupleLength\n                ? (SyntaxNode)tupleExpression.Arguments[expectedPathPosition.Index].Expression\n                : null;\n    }\n\n    // This is a refactored version of internal Roslyn SyntaxNodeExtensions.IsInExpressionTree\n    public static bool IsInExpressionTree(this SyntaxNode node, SemanticModel model)\n    {\n        return node.AncestorsAndSelf().Any(x => IsExpressionLambda(x) || IsExpressionSelectOrOrder(x) || IsExpressionQuery(x));\n\n        bool IsExpressionLambda(SyntaxNode node) =>\n            node is LambdaExpressionSyntax && model.GetTypeInfo(node).ConvertedType.DerivesFrom(KnownType.System_Linq_Expressions_Expression);\n\n        bool IsExpressionSelectOrOrder(SyntaxNode node) =>\n            node is SelectOrGroupClauseSyntax or OrderingSyntax && TakesExpressionTree(model.GetSymbolInfo(node));\n\n        bool IsExpressionQuery(SyntaxNode node) =>\n            node is QueryClauseSyntax queryClause\n            && model.GetQueryClauseInfo(queryClause) is var info\n            && (TakesExpressionTree(info.CastInfo) || TakesExpressionTree(info.OperationInfo));\n\n        static bool TakesExpressionTree(SymbolInfo info)\n        {\n            var symbols = info.Symbol is null ? info.CandidateSymbols : ImmutableArray.Create(info.Symbol);\n            return symbols.Any(x => x is IMethodSymbol method && method.Parameters.Length > 0 && method.Parameters[0].Type.DerivesFrom(KnownType.System_Linq_Expressions_Expression));\n        }\n    }\n\n    // based on Type=\"BaseArgumentListSyntax\" in https://github.com/dotnet/roslyn/blob/main/src/Compilers/CSharp/Portable/Syntax/Syntax.xml\n    public static BaseArgumentListSyntax ArgumentList(this SyntaxNode node) =>\n        node switch\n        {\n            ObjectCreationExpressionSyntax creation => creation.ArgumentList,\n            InvocationExpressionSyntax invocation => invocation.ArgumentList,\n            ConstructorInitializerSyntax constructorInitializer => constructorInitializer.ArgumentList,\n            ElementAccessExpressionSyntax x => x.ArgumentList,\n            ElementBindingExpressionSyntax x => x.ArgumentList,\n            null => null,\n            _ when PrimaryConstructorBaseTypeSyntaxWrapper.IsInstance(node) => ((PrimaryConstructorBaseTypeSyntaxWrapper)node).ArgumentList,\n            _ when ImplicitObjectCreationExpressionSyntaxWrapper.IsInstance(node) => ((ImplicitObjectCreationExpressionSyntaxWrapper)node).ArgumentList,\n            _ => throw new InvalidOperationException($\"The {nameof(node)} of kind {node.Kind()} does not have an {nameof(ArgumentList)}.\"),\n        };\n\n    public static ParameterListSyntax ParameterList(this SyntaxNode node) =>\n        node switch\n        {\n            BaseMethodDeclarationSyntax method => method.ParameterList,\n            TypeDeclarationSyntax type => type.ParameterList(),\n            { RawKind: (int)SyntaxKindEx.LocalFunctionStatement } localFunction => ((LocalFunctionStatementSyntaxWrapper)localFunction).ParameterList,\n            ParenthesizedLambdaExpressionSyntax lambda => lambda.ParameterList,\n            AnonymousMethodExpressionSyntax anonymous => anonymous.ParameterList,\n            DelegateDeclarationSyntax delegateDeclaration => delegateDeclaration.ParameterList,\n            _ => default,\n        };\n\n    public static BlockSyntax GetBody(this SyntaxNode node) =>\n        node switch\n        {\n            BaseMethodDeclarationSyntax method => method.Body,\n            AccessorDeclarationSyntax accessor => accessor.Body,\n            _ when LocalFunctionStatementSyntaxWrapper.IsInstance(node) => ((LocalFunctionStatementSyntaxWrapper)node).Body,\n            _ => null,\n        };\n\n    public static SyntaxNode GetInitializer(this SyntaxNode node) =>\n        node switch\n        {\n            VariableDeclaratorSyntax { Initializer: { } initializer } => initializer,\n            PropertyDeclarationSyntax { Initializer: { } initializer } => initializer,\n            _ => null\n        };\n\n    public static SyntaxTokenList GetModifiers(this SyntaxNode node) =>\n        node switch\n        {\n            AccessorDeclarationSyntax accessor => accessor.Modifiers,\n            MemberDeclarationSyntax member => member.Modifiers,\n            _ => default,\n        };\n\n    public static bool IsTrue(this SyntaxNode node) =>\n        node switch\n        {\n            { RawKind: (int)SyntaxKind.TrueLiteralExpression } => true, // true\n            { RawKind: (int)SyntaxKind.LogicalNotExpression } => IsFalse(((PrefixUnaryExpressionSyntax)node).Operand), // !false\n            { RawKind: (int)SyntaxKindEx.ConstantPattern } => IsTrue(((ConstantPatternSyntaxWrapper)node).Expression), // is true\n            { RawKind: (int)SyntaxKindEx.NotPattern } => IsFalse(((UnaryPatternSyntaxWrapper)node).Pattern), // is not false\n            { RawKind: (int)SyntaxKind.ParenthesizedExpression } => IsTrue(((ParenthesizedExpressionSyntax)node).Expression), // (true)\n            { RawKind: (int)SyntaxKindEx.ParenthesizedPattern } => IsTrue(((ParenthesizedPatternSyntaxWrapper)node).Pattern), // is (true)\n            { RawKind: (int)SyntaxKindEx.SuppressNullableWarningExpression } => IsTrue(((PostfixUnaryExpressionSyntax)node).Operand), // true!\n            _ => false,\n        };\n\n    public static bool IsFalse(this SyntaxNode node) =>\n        node switch\n        {\n            { RawKind: (int)SyntaxKind.FalseLiteralExpression } => true, // false\n            { RawKind: (int)SyntaxKind.LogicalNotExpression } => IsTrue(((PrefixUnaryExpressionSyntax)node).Operand), // !true\n            { RawKind: (int)SyntaxKindEx.ConstantPattern } => IsFalse(((ConstantPatternSyntaxWrapper)node).Expression), // is false\n            { RawKind: (int)SyntaxKindEx.NotPattern } => IsTrue(((UnaryPatternSyntaxWrapper)node).Pattern), // is not true\n            { RawKind: (int)SyntaxKind.ParenthesizedExpression } => IsFalse(((ParenthesizedExpressionSyntax)node).Expression), // (false)\n            { RawKind: (int)SyntaxKindEx.ParenthesizedPattern } => IsFalse(((ParenthesizedPatternSyntaxWrapper)node).Pattern), // is (false)\n            { RawKind: (int)SyntaxKindEx.SuppressNullableWarningExpression } => IsFalse(((PostfixUnaryExpressionSyntax)node).Operand), // false!\n            _ => false,\n        };\n\n    public static bool IsDynamic(this SyntaxNode node, SemanticModel model) =>\n        model.GetTypeInfo(node) is { Type.Kind: SymbolKind.DynamicType };\n\n    public static SyntaxNode EnclosingScope(this SyntaxNode node) =>\n        node.AncestorsAndSelf().FirstOrDefault(x => x.IsAnyKind(EnclosingScopeSyntaxKinds));\n\n    public static SyntaxNode GetTopMostContainingMethod(this SyntaxNode node) =>\n        node.AncestorsAndSelf().LastOrDefault(x => x is BaseMethodDeclarationSyntax || x is PropertyDeclarationSyntax);\n\n    public static SyntaxNode GetSelfOrTopParenthesizedExpression(this SyntaxNode node)\n    {\n        var current = node;\n        while (current?.Parent?.IsKind(SyntaxKind.ParenthesizedExpression) ?? false)\n        {\n            current = current.Parent;\n        }\n        return current;\n    }\n\n    public static SyntaxNode GetFirstNonParenthesizedParent(this SyntaxNode node) =>\n        node.GetSelfOrTopParenthesizedExpression().Parent;\n\n    public static bool HasAncestor(this SyntaxNode node, SyntaxKind syntaxKind) =>\n        node.Ancestors().Any(x => x.IsKind(syntaxKind));\n\n    public static bool HasAncestor(this SyntaxNode node, SyntaxKind kind1, SyntaxKind kind2) =>\n        node.Ancestors().Any(x => x.IsKind(kind1) || x.IsKind(kind2));\n\n    public static bool HasAncestor(this SyntaxNode node, ISet<SyntaxKind> syntaxKinds) =>\n        node.Ancestors().Any(x => x.IsAnyKind(syntaxKinds));\n\n    public static bool IsNullLiteral(this SyntaxNode node) =>\n        node is not null && node.IsKind(SyntaxKind.NullLiteralExpression);\n\n    [Obsolete(\"Either use '.Kind() is A or B' or the overload with the ISet instead.\")]\n    public static bool IsAnyKind(this SyntaxNode node, params SyntaxKind[] syntaxKinds) =>\n        node is not null && syntaxKinds.Contains((SyntaxKind)node.RawKind);\n\n    public static bool IsAnyKind(this SyntaxNode node, ISet<SyntaxKind> syntaxKinds) =>\n        node is not null && syntaxKinds.Contains((SyntaxKind)node.RawKind);\n\n    public static string GetName(this SyntaxNode node) =>\n        node.GetIdentifier()?.ValueText ?? string.Empty;\n\n    public static bool NameIs(this SyntaxNode node, string name) =>\n        node.GetName().Equals(name, StringComparison.Ordinal);\n\n    public static bool NameIs(this SyntaxNode node, string name, params string[] orNames) =>\n        node.GetName() is { } nodeName\n        && (nodeName.Equals(name, StringComparison.Ordinal)\n            || Array.Exists(orNames, x => nodeName.Equals(x, StringComparison.Ordinal)));\n\n    public static string StringValue(this SyntaxNode node, SemanticModel model) =>\n        node switch\n        {\n            LiteralExpressionSyntax literal when literal.Kind() is SyntaxKind.StringLiteralExpression or SyntaxKindEx.Utf8StringLiteralExpression => literal.Token.ValueText,\n            InterpolatedStringExpressionSyntax expression => expression.InterpolatedTextValue(model) ?? expression.ContentsText(),\n            _ => null\n        };\n\n    public static bool AnyOfKind(this IEnumerable<SyntaxNode> nodes, SyntaxKind kind) =>\n        nodes.Any(x => x.RawKind == (int)kind);\n\n    public static AttributeData PerformanceSensitiveAttribute(this SyntaxNode node, SemanticModel model) =>\n        node?\n            .AncestorsAndSelf()\n            .Where(x => x.IsAnyKind(PerformanceSensitiveSyntaxes) || x is VariableDeclaratorSyntax { Parent: VariableDeclarationSyntax { Parent: FieldDeclarationSyntax } })\n            .Select(x => (model.GetSymbolInfo(x).Symbol ?? model.GetDeclaredSymbol(x))?.GetAttributes().FirstOrDefault(y => y.HasName(nameof(PerformanceSensitiveAttribute))))\n            .FirstOrDefault(x => x is not null);\n\n    /// <summary>\n    /// Replaces the syntax element <paramref name=\"originalNode\"/> with <paramref name=\"newNode\"/> and returns a speculative semantic model.\n    /// This model can then be used to analyze the new syntax element within the context of the new tree. Use the <paramref name=\"newModel\"/>\n    /// and the returned <typeparamref name=\"T\"/> for semantic queries.\n    /// </summary>\n    /// <typeparam name=\"T\">The node type to replace.</typeparam>\n    /// <param name=\"originalNode\">The node of the tree associated with the <paramref name=\"originalModel\"/>.</param>\n    /// <param name=\"newNode\">The replacement, constructed via <see cref=\"SyntaxFactory\"/> or similar methods.</param>\n    /// <param name=\"originalModel\">The <see cref=\"SemanticModel\"/> of the <paramref name=\"originalNode\"/>.</param>\n    /// <param name=\"newModel\">The speculative semantic model of the tree with the replacement.</param>\n    /// <returns>The <paramref name=\"newNode\"/> inside the tree with the replacement. Use this node along with <paramref name=\"newModel\"/> to\n    /// query for semantic information inside the replacement node.</returns>\n    public static T ChangeSyntaxElement<T>(this T originalNode, T newNode, SemanticModel originalModel, out SemanticModel newModel)\n        where T : SyntaxNode\n    {\n        newModel = null;\n        if (originalNode.AncestorsAndSelf().FirstOrDefault(x => x is BaseMethodDeclarationSyntax\n            or AccessorDeclarationSyntax\n            or EqualsValueClauseSyntax { Parent: VariableDeclaratorSyntax { Parent: VariableDeclarationSyntax { Parent: FieldDeclarationSyntax } } }\n            or EqualsValueClauseSyntax { Parent: PropertyDeclarationSyntax }\n            or EqualsValueClauseSyntax { Parent: ParameterSyntax }\n            or ArrowExpressionClauseSyntax\n            or ConstructorInitializerSyntax\n            or AttributeSyntax) is { } enclosingNode)\n        {\n            var annotation = new SyntaxAnnotation();\n            var annotated = newNode.WithAdditionalAnnotations(annotation);\n            var replaced = enclosingNode.ReplaceNode(originalNode, annotated);\n            if (replaced switch\n            {\n                BaseMethodDeclarationSyntax baseMethod => originalModel.TryGetSpeculativeSemanticModelForMethodBody(originalNode.SpanStart, baseMethod, out newModel),\n                AccessorDeclarationSyntax accessor => originalModel.TryGetSpeculativeSemanticModelForMethodBody(originalNode.SpanStart, accessor, out newModel),\n                EqualsValueClauseSyntax field => originalModel.TryGetSpeculativeSemanticModel(originalNode.SpanStart, field, out newModel),\n                ArrowExpressionClauseSyntax arrow => originalModel.TryGetSpeculativeSemanticModel(originalNode.SpanStart, arrow, out newModel),\n                ConstructorInitializerSyntax initializer => originalModel.TryGetSpeculativeSemanticModel(originalNode.SpanStart, initializer, out newModel),\n                AttributeSyntax attribute => originalModel.TryGetSpeculativeSemanticModel(originalNode.SpanStart, attribute, out newModel),\n                _ => throw new NotSupportedException(\"Unreachable case. Make sure to handle all node kinds from the ancestors if.\"),\n            })\n            {\n                return replaced.GetAnnotatedNodes(annotation).FirstOrDefault() as T;\n            }\n        }\n        return null;\n    }\n\n    private readonly record struct PathPosition(int Index, int TupleLength);\n\n    private sealed class ControlFlowGraphCache : ControlFlowGraphCacheBase\n    {\n        protected override bool IsLocalFunction(SyntaxNode node) =>\n            node.IsKind(SyntaxKindEx.LocalFunctionStatement);\n\n        protected override bool HasNestedCfg(SyntaxNode node) =>\n            node.Kind() is SyntaxKindEx.LocalFunctionStatement\n                or SyntaxKind.SimpleLambdaExpression\n                or SyntaxKind.AnonymousMethodExpression\n                or SyntaxKind.ParenthesizedLambdaExpression;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Extensions/SyntaxTokenExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Extensions;\n\npublic static class SyntaxTokenExtensions\n{\n    [Obsolete(\"Either use '.Kind() is A or B' or the overload with the ISet instead.\")]\n    public static bool IsAnyKind(this SyntaxToken token, params SyntaxKind[] syntaxKinds) =>\n        syntaxKinds.Contains((SyntaxKind)token.RawKind);\n\n    public static bool IsAnyKind(this SyntaxToken token, ISet<SyntaxKind> syntaxKinds) =>\n        syntaxKinds.Contains((SyntaxKind)token.RawKind);\n\n    public static bool AnyOfKind(this IEnumerable<SyntaxToken> tokens, SyntaxKind kind) =>\n        tokens.Any(x => x.RawKind == (int)kind);\n\n    public static ComparisonKind ToComparisonKind(this SyntaxToken token) =>\n        token.Kind() switch\n        {\n            SyntaxKind.EqualsEqualsToken => ComparisonKind.Equals,\n            SyntaxKind.ExclamationEqualsToken => ComparisonKind.NotEquals,\n            SyntaxKind.LessThanToken => ComparisonKind.LessThan,\n            SyntaxKind.LessThanEqualsToken => ComparisonKind.LessThanOrEqual,\n            SyntaxKind.GreaterThanToken => ComparisonKind.GreaterThan,\n            SyntaxKind.GreaterThanEqualsToken => ComparisonKind.GreaterThanOrEqual,\n            _ => ComparisonKind.None,\n        };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Extensions/SyntaxTokenListExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Extensions;\n\npublic static class SyntaxTokenListExtensions\n{\n    public static SyntaxToken? Find(this SyntaxTokenList tokenList, SyntaxKind kind) =>\n        tokenList.IndexOf(kind) is var index and >= 0\n        ? tokenList[index] : null;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Extensions/SyntaxTriviaExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Extensions;\n\npublic static class SyntaxTriviaExtensions\n{\n    private static readonly HashSet<SyntaxKind> CommentKinds =\n        [\n            SyntaxKind.SingleLineCommentTrivia,\n            SyntaxKind.MultiLineCommentTrivia,\n            SyntaxKind.SingleLineDocumentationCommentTrivia,\n            SyntaxKind.MultiLineDocumentationCommentTrivia\n        ];\n\n    public static bool IsAnyKind(this SyntaxTrivia syntaxTravia, ISet<SyntaxKind> syntaxKinds) =>\n        syntaxKinds.Contains((SyntaxKind)syntaxTravia.RawKind);\n\n    public static bool IsComment(this SyntaxTrivia trivia) =>\n        trivia.IsAnyKind(CommentKinds);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Extensions/TupleExpressionSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Extensions;\n\npublic static class TupleExpressionSyntaxExtensions\n{\n    public static ImmutableArray<ArgumentSyntax> AllArguments(this TupleExpressionSyntaxWrapper tupleExpression)\n    {\n        var builder = ImmutableArray.CreateBuilder<ArgumentSyntax>(tupleExpression.Arguments.Count);\n        CollectTupleElements(tupleExpression.Arguments);\n        return builder.ToImmutableArray();\n\n        void CollectTupleElements(SeparatedSyntaxList<ArgumentSyntax> arguments)\n        {\n            foreach (var argument in arguments)\n            {\n                if (TupleExpressionSyntaxWrapper.IsInstance(argument.Expression))\n                {\n                    CollectTupleElements(((TupleExpressionSyntaxWrapper)argument.Expression).Arguments);\n                }\n                else\n                {\n                    builder.Add(argument);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Extensions/TypeDeclarationSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Extensions;\n\npublic static class TypeDeclarationSyntaxExtensions\n{\n    /// <summary>\n    /// Returns a union of all the methods and local functions from a given type declaration.\n    /// </summary>\n    public static IEnumerable<IMethodDeclaration> GetMethodDeclarations(this TypeDeclarationSyntax typeDeclaration) =>\n        typeDeclaration.Members\n                       .OfType<MethodDeclarationSyntax>()\n                       .SelectMany(method => GetLocalFunctions(method).Union(new List<IMethodDeclaration> { MethodDeclarationFactory.Create(method) }));\n\n    private static IEnumerable<IMethodDeclaration> GetLocalFunctions(MethodDeclarationSyntax methodDeclaration) =>\n        methodDeclaration.DescendantNodes()\n                         .Where(member => member.IsKind(SyntaxKindEx.LocalFunctionStatement))\n                         .Select(member => MethodDeclarationFactory.Create(member));\n\n    public static IMethodSymbol PrimaryConstructor(this TypeDeclarationSyntax typeDeclaration, SemanticModel semanticModel)\n    {\n        if (ParameterList(typeDeclaration) is { } parameterList)\n        {\n            return parameterList is { Parameters: { Count: > 0 } parameters } && parameters[0] is { Identifier.RawKind: not (int)SyntaxKind.ArgListKeyword } parameter0\n                ? semanticModel.GetDeclaredSymbol(parameter0)?.ContainingSymbol as IMethodSymbol\n                : semanticModel.GetDeclaredSymbol(typeDeclaration).GetMembers(\".ctor\").OfType<IMethodSymbol>().FirstOrDefault(m => m is\n                {\n                    MethodKind: MethodKind.Constructor,\n                    Parameters.Length: 0,\n                });\n        }\n\n        return null;\n    }\n\n    public static ParameterListSyntax ParameterList(this TypeDeclarationSyntax typeDeclaration) =>\n        // In earlier versions, the ParameterList was only available on the derived RecordDeclarationSyntax (starting from version 3.7)\n        // To work with version 3.7 to version 4.6 we need to special case the record declaration and access\n        // the parameter list from the derived RecordDeclarationSyntax.\n        typeDeclaration.Kind() switch\n        {\n            SyntaxKind.ClassDeclaration => ClassDeclarationSyntaxShimExtensions.get_ParameterList((ClassDeclarationSyntax)typeDeclaration),\n            SyntaxKind.StructDeclaration => StructDeclarationSyntaxShimExtensions.get_ParameterList((StructDeclarationSyntax)typeDeclaration),\n            SyntaxKindEx.RecordDeclaration or SyntaxKindEx.RecordStructDeclaration => ((RecordDeclarationSyntaxWrapper)typeDeclaration).ParameterList,\n            SyntaxKindEx.ExtensionBlockDeclaration => ((ExtensionBlockDeclarationSyntaxWrapper)typeDeclaration).ParameterList,\n            _ => TypeDeclarationSyntaxShimExtensions.get_ParameterList(typeDeclaration),\n        };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Extensions/TypeSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Extensions;\n\npublic static class TypeSyntaxExtensions\n{\n    /// <summary>\n    /// Recursively unwraps array, pointer, nullable, ref, and scoped type modifiers,\n    /// returning the innermost base <see cref=\"TypeSyntax\"/>.\n    /// Types that are returned as-is include <see cref=\"IdentifierNameSyntax\"/>,\n    /// <see cref=\"QualifiedNameSyntax\"/>, <see cref=\"AliasQualifiedNameSyntax\"/>,\n    /// <see cref=\"GenericNameSyntax\"/>, and <see cref=\"PredefinedTypeSyntax\"/>.\n    /// </summary>\n    public static TypeSyntax Unwrap(this TypeSyntax type) =>\n        type switch\n        {\n            ArrayTypeSyntax x => x.ElementType.Unwrap(),\n            NullableTypeSyntax x => x.ElementType.Unwrap(),\n            PointerTypeSyntax x => x.ElementType.Unwrap(),\n            { RawKind: (int)SyntaxKindEx.RefType } x => ((RefTypeSyntaxWrapper)x).Type.Unwrap(),\n            { RawKind: (int)SyntaxKindEx.ScopedType } x => ((ScopedTypeSyntaxWrapper)x).Type.Unwrap(),\n            _ => type\n        };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Extensions/VariableDesignationSyntaxWrapperExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Extensions;\n\npublic static class VariableDesignationSyntaxWrapperExtensions\n{\n    /// <summary>\n    /// Returns all <see cref=\"SingleVariableDesignationSyntaxWrapper\"/> of the designation. Nested designations are flattened and\n    /// only identifiers are included in the result (discards are skipped). For a designation like <c>(a, (_, b))</c>\n    /// the method returns <c>[a, b]</c>.\n    /// </summary>\n    public static ImmutableArray<SingleVariableDesignationSyntaxWrapper> AllVariables(this VariableDesignationSyntaxWrapper variableDesignation)\n    {\n        var builder = ImmutableArray.CreateBuilder<SingleVariableDesignationSyntaxWrapper>();\n        CollectVariables(variableDesignation);\n        return builder.ToImmutableArray();\n\n        void CollectVariables(VariableDesignationSyntaxWrapper variableDesignation)\n        {\n            if (ParenthesizedVariableDesignationSyntaxWrapper.IsInstance(variableDesignation))\n            {\n                foreach (var variable in ((ParenthesizedVariableDesignationSyntaxWrapper)variableDesignation).Variables)\n                {\n                    CollectVariables(variable);\n                }\n            }\n            else if (SingleVariableDesignationSyntaxWrapper.IsInstance(variableDesignation))\n            {\n                builder.Add((SingleVariableDesignationSyntaxWrapper)variableDesignation);\n            }\n            // DiscardDesignationSyntaxWrapper is skipped\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Utilities/CSharpAttributeParameterLookup.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Utilities;\n\ninternal class CSharpAttributeParameterLookup(AttributeSyntax attribute, IMethodSymbol methodSymbol) :\n    MethodParameterLookupBase<AttributeArgumentSyntax>(attribute.ArgumentList?.Arguments ?? default, methodSymbol)\n{\n    protected override SyntaxNode Expression(AttributeArgumentSyntax argument) =>\n        argument.Expression;\n\n    protected override SyntaxToken? GetNameColonIdentifier(AttributeArgumentSyntax argument) =>\n        argument.NameColon?.Name.Identifier;\n\n    protected override SyntaxToken? GetNameEqualsIdentifier(AttributeArgumentSyntax argument) =>\n        argument.NameEquals?.Name.Identifier;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Utilities/CSharpEquivalenceChecker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Utilities;\n\npublic static class CSharpEquivalenceChecker\n{\n    public static bool AreEquivalent(SyntaxNode node1, SyntaxNode node2) =>\n        EquivalenceChecker.AreEquivalent(node1, node2, NodeComparator);\n\n    public static bool AreEquivalent(SyntaxList<SyntaxNode> nodeList1, SyntaxList<SyntaxNode> nodeList2) =>\n        EquivalenceChecker.AreEquivalent(nodeList1, nodeList2, NodeComparator);\n\n    private static bool NodeComparator(SyntaxNode node1, SyntaxNode node2) =>\n        NullCheckState(node1, true) is { } nullCheck1\n        && NullCheckState(node2, true) is { } nullCheck2\n        && nullCheck1.IsPositive == nullCheck2.IsPositive\n            ? SyntaxFactory.AreEquivalent(nullCheck1.Expression, nullCheck2.Expression)\n            : SyntaxFactory.AreEquivalent(node1, node2);\n\n    /// <param name=\"isPositive\">Flag indicating that current chain of null checks is positive '== null'. It's flipped for each `!` operator. '!(x != null)' is equal to 'x == null'.</param>\n    private static NullCheck NullCheckState(SyntaxNode node, bool isPositive)\n    {\n        if (node is PrefixUnaryExpressionSyntax unary && unary.IsKind(SyntaxKind.LogicalNotExpression))\n        {\n            return NullCheckState(unary.Operand.RemoveParentheses(), !isPositive);\n        }\n        else if (node is BinaryExpressionSyntax binary && binary.Kind() is SyntaxKind.EqualsExpression or SyntaxKind.NotEqualsExpression)\n        {\n            if (binary.IsKind(SyntaxKind.NotEqualsExpression))\n            {\n                isPositive = !isPositive;\n            }\n            return NullCheckExpression(binary) is { } expression ? new NullCheck(expression, isPositive) : null;\n        }\n        else if (node.IsKind(SyntaxKindEx.IsPatternExpression))\n        {\n            var isPattern = (IsPatternExpressionSyntaxWrapper)node;\n            return NullCheckPattern(isPattern.Expression, isPattern.Pattern.SyntaxNode, isPositive);\n        }\n        else\n        {\n            return null;\n        }\n    }\n\n    private static SyntaxNode NullCheckExpression(BinaryExpressionSyntax binary)\n    {\n        if (binary.Left.IsKind(SyntaxKind.NullLiteralExpression))\n        {\n            return binary.Right;\n        }\n        else if (binary.Right.IsKind(SyntaxKind.NullLiteralExpression))\n        {\n            return binary.Left;\n        }\n        else\n        {\n            return null;\n        }\n    }\n\n    /// <param name=\"isPositive\">Flag indicating that current chain of null checks is positive 'is null'. It's flipped for each `not` operator. 'is not not null' is equal to 'is null'.</param>\n    private static NullCheck NullCheckPattern(SyntaxNode expression, SyntaxNode pattern, bool isPositive)\n    {\n        if (pattern.IsKind(SyntaxKindEx.ConstantPattern) && ((ConstantPatternSyntaxWrapper)pattern).Expression.IsKind(SyntaxKind.NullLiteralExpression))\n        {\n            return new NullCheck(expression, isPositive);\n        }\n        else if (pattern.IsKind(SyntaxKindEx.NotPattern))\n        {\n            return NullCheckPattern(expression, ((UnaryPatternSyntaxWrapper)pattern).Pattern.SyntaxNode, !isPositive);\n        }\n        else\n        {\n            return null;\n        }\n    }\n\n    private class NullCheck\n    {\n        public readonly SyntaxNode Expression;\n        public readonly bool IsPositive;\n\n        public NullCheck(SyntaxNode expression, bool isPositive)\n        {\n            Expression = expression;\n            IsPositive = isPositive;\n        }\n    }\n}\n\npublic class CSharpSyntaxNodeEqualityComparer<T> : IEqualityComparer<T>, IEqualityComparer<SyntaxList<T>>\n    where T : SyntaxNode\n{\n    public bool Equals(T x, T y) =>\n        CSharpEquivalenceChecker.AreEquivalent(x, y);\n\n    public bool Equals(SyntaxList<T> x, SyntaxList<T> y) =>\n        CSharpEquivalenceChecker.AreEquivalent(x, y);\n\n    public int GetHashCode(T obj) =>\n        obj.GetType().FullName.GetHashCode();\n\n    public int GetHashCode(SyntaxList<T> obj) =>\n        (obj.Count + obj.Select(x => x.GetType().FullName).Distinct().JoinStr(\", \")).GetHashCode();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Utilities/CSharpExpressionNumericConverter.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Utilities;\n\npublic class CSharpExpressionNumericConverter : ExpressionNumericConverterBase<LiteralExpressionSyntax, PrefixUnaryExpressionSyntax>\n{\n    private static readonly ISet<SyntaxKind> SupportedOperatorTokens = new HashSet<SyntaxKind>\n    {\n        SyntaxKind.MinusToken,\n        SyntaxKind.PlusToken\n    };\n\n    protected override object TokenValue(LiteralExpressionSyntax literalExpression) =>\n        literalExpression.Token.Value;\n\n    protected override SyntaxNode Operand(PrefixUnaryExpressionSyntax unaryExpression) =>\n        unaryExpression.Operand;\n\n    protected override bool IsSupportedOperator(PrefixUnaryExpressionSyntax unaryExpression) =>\n        SupportedOperatorTokens.Contains(unaryExpression.OperatorToken.Kind());\n\n    protected override bool IsMinusOperator(PrefixUnaryExpressionSyntax unaryExpression) =>\n        unaryExpression.OperatorToken.IsKind(SyntaxKind.MinusToken);\n\n    protected override SyntaxNode RemoveParentheses(SyntaxNode expression) =>\n        expression.RemoveParentheses();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Utilities/CSharpGeneratedCodeRecognizer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Utilities;\n\npublic class CSharpGeneratedCodeRecognizer : GeneratedCodeRecognizer\n{\n    #region Singleton implementation\n\n    private CSharpGeneratedCodeRecognizer()\n    {\n    }\n\n    private static readonly Lazy<CSharpGeneratedCodeRecognizer> Lazy =\n        new Lazy<CSharpGeneratedCodeRecognizer>(() => new CSharpGeneratedCodeRecognizer());\n\n    public static CSharpGeneratedCodeRecognizer Instance => Lazy.Value;\n\n    #endregion Singleton implementation\n\n    protected override bool IsTriviaComment(SyntaxTrivia trivia) =>\n        trivia.IsKind(SyntaxKind.SingleLineCommentTrivia) ||\n        trivia.IsKind(SyntaxKind.MultiLineCommentTrivia);\n\n    protected override string GetAttributeName(SyntaxNode node) =>\n        node.IsKind(SyntaxKind.Attribute)\n            ? ((AttributeSyntax)node).Name.ToString()\n            : string.Empty;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Utilities/CSharpMethodParameterLookup.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Utilities;\n\npublic class CSharpMethodParameterLookup : MethodParameterLookupBase<ArgumentSyntax>\n{\n    public CSharpMethodParameterLookup(InvocationExpressionSyntax invocation, SemanticModel semanticModel)\n        : this(invocation.ArgumentList, semanticModel) { }\n\n    public CSharpMethodParameterLookup(InvocationExpressionSyntax invocation, IMethodSymbol methodSymbol)\n        : this(invocation.ArgumentList, methodSymbol) { }\n\n    public CSharpMethodParameterLookup(BaseArgumentListSyntax argumentList, SemanticModel semanticModel)\n        : base(argumentList.Arguments, semanticModel.GetSymbolInfo(argumentList.Parent)) { }\n\n    public CSharpMethodParameterLookup(BaseArgumentListSyntax argumentList, IMethodSymbol methodSymbol)\n        : base(argumentList.Arguments, methodSymbol) { }\n\n    protected override SyntaxNode Expression(ArgumentSyntax argument) =>\n        argument.Expression;\n\n    protected override SyntaxToken? GetNameColonIdentifier(ArgumentSyntax argument) =>\n        argument.NameColon?.Name.Identifier;\n\n    protected override SyntaxToken? GetNameEqualsIdentifier(ArgumentSyntax argument) =>\n        null;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Utilities/CSharpRemovableDeclarationCollector.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Utilities;\n\npublic class CSharpRemovableDeclarationCollector : RemovableDeclarationCollectorBase<BaseTypeDeclarationSyntax, BaseTypeDeclarationSyntax, SyntaxKind>\n{\n    public CSharpRemovableDeclarationCollector(INamedTypeSymbol namedType, Compilation compilation) : base(namedType, compilation) { }\n\n    public override IEnumerable<NodeSymbolAndModel<SyntaxNode, ISymbol>> RemovableFieldLikeDeclarations(ISet<SyntaxKind> kinds, Accessibility maxAccessibility)\n    {\n        var fieldLikeNodes = TypeDeclarations.SelectMany(x => MatchingDeclarations(x, kinds).Select(node => new NodeAndModel<BaseFieldDeclarationSyntax>((BaseFieldDeclarationSyntax)node, x.Model)));\n        return fieldLikeNodes.SelectMany(x => x.Node.Declaration.Variables.Select(variable => CreateNodeSymbolAndModel(variable, x.Model)).Where(tuple => IsRemovable(tuple.Symbol, maxAccessibility)));\n    }\n\n    public override BaseTypeDeclarationSyntax OwnerOfSubnodes(BaseTypeDeclarationSyntax node) =>\n        node;\n\n    public static bool IsNodeContainerTypeDeclaration(SyntaxNode node) =>\n        IsNodeStructOrClassOrRecordDeclaration(node) || node.IsKind(SyntaxKind.InterfaceDeclaration);\n\n    protected override IEnumerable<SyntaxNode> MatchingDeclarations(NodeAndModel<BaseTypeDeclarationSyntax> container, ISet<SyntaxKind> kinds) =>\n        container.Node.DescendantNodes(IsNodeContainerTypeDeclaration).Where(x => kinds.Contains(x.Kind()));\n\n    private static bool IsNodeStructOrClassOrRecordDeclaration(SyntaxNode node) =>\n        node?.Kind() is SyntaxKind.ClassDeclaration or SyntaxKind.StructDeclaration or SyntaxKindEx.RecordDeclaration or SyntaxKindEx.RecordStructDeclaration;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Utilities/CSharpStringInterpolationConstantValueResolver.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Utilities;\n\npublic class CSharpStringInterpolationConstantValueResolver : StringInterpolationConstantValueResolver<SyntaxKind,\n                                                                                                       InterpolatedStringExpressionSyntax,\n                                                                                                       InterpolatedStringContentSyntax,\n                                                                                                       InterpolationSyntax,\n                                                                                                       InterpolatedStringTextSyntax>\n{\n    private static readonly Lazy<CSharpStringInterpolationConstantValueResolver> Singleton = new(() => new CSharpStringInterpolationConstantValueResolver());\n\n    public static CSharpStringInterpolationConstantValueResolver Instance => Singleton.Value;\n\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override IEnumerable<InterpolatedStringContentSyntax> Contents(InterpolatedStringExpressionSyntax interpolatedStringExpression) =>\n        interpolatedStringExpression.Contents;\n\n    protected override SyntaxToken TextToken(InterpolatedStringTextSyntax interpolatedStringText) =>\n        interpolatedStringText.TextToken;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Utilities/CSharpSyntaxClassifier.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CFG.Syntax.Utilities;\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Utilities;\n\npublic sealed class CSharpSyntaxClassifier : SyntaxClassifierBase\n{\n    private static CSharpSyntaxClassifier instance;\n\n    public static CSharpSyntaxClassifier Instance => instance ??= new();\n\n    private CSharpSyntaxClassifier() { }\n\n    public override SyntaxNode MemberAccessExpression(SyntaxNode node) =>\n        (node as MemberAccessExpressionSyntax)?.Expression;\n\n    protected override bool IsStatement(SyntaxNode node) =>\n            node is StatementSyntax;\n\n    protected override SyntaxNode ParentLoopCondition(SyntaxNode node) =>\n        node.Parent switch\n        {\n            DoStatementSyntax doStatement => doStatement.Condition,\n            ForStatementSyntax forStatement => forStatement.Condition,\n            ForEachStatementSyntax forEachStatement => forEachStatement.Expression,\n            WhileStatementSyntax whileStatement => whileStatement.Condition,\n            _ when node.Parent.IsKind(SyntaxKindEx.ForEachVariableStatement) => ((ForEachVariableStatementSyntaxWrapper)node.Parent).Expression,\n            _ => null\n        };\n\n    protected override bool IsCfgBoundary(SyntaxNode node) =>\n        node is LambdaExpressionSyntax || node.IsKind(SyntaxKindEx.LocalFunctionStatement);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Utilities/MutedSyntaxWalker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Utilities;\n\n/// <summary>\n/// This class find syntax cases that are not properly supported by current CFG/SE/LVA and we mute all issues related to these scenarios.\n/// </summary>\npublic class MutedSyntaxWalker : CSharpSyntaxWalker\n{\n    // All kinds that SonarAnalysisContextExtensions.RegisterExplodedGraphBasedAnalysis registers for\n    private static readonly HashSet<SyntaxKind> RootKinds =\n        [\n            SyntaxKind.AddAccessorDeclaration,\n            SyntaxKind.AnonymousMethodExpression,\n            SyntaxKind.ConstructorDeclaration,\n            SyntaxKind.ConversionOperatorDeclaration,\n            SyntaxKind.DestructorDeclaration,\n            SyntaxKind.GetAccessorDeclaration,\n            SyntaxKindEx.InitAccessorDeclaration,\n            SyntaxKind.MethodDeclaration,\n            SyntaxKind.OperatorDeclaration,\n            SyntaxKind.ParenthesizedLambdaExpression,\n            SyntaxKind.PropertyDeclaration,\n            SyntaxKind.RemoveAccessorDeclaration,\n            SyntaxKind.SetAccessorDeclaration,\n            SyntaxKind.SimpleLambdaExpression\n        ];\n\n    private readonly SemanticModel model;\n    private readonly SyntaxNode root;\n    private readonly ISymbol[] symbols;\n    private bool isMuted;\n\n    public MutedSyntaxWalker(SemanticModel model, SyntaxNode node)\n        : this(model, node, node.DescendantNodesAndSelf().OfType<IdentifierNameSyntax>().Select(x => model.GetSymbolInfo(x).Symbol).WhereNotNull().ToArray()) { }\n\n    public MutedSyntaxWalker(SemanticModel model, SyntaxNode node, params ISymbol[] symbols)\n    {\n        this.model = model;\n        this.symbols = symbols;\n        root = node.Ancestors().FirstOrDefault(x => x.IsAnyKind(RootKinds));\n    }\n\n    public bool IsMuted()\n    {\n        if (symbols.Any() && root is not null)\n        {\n            Visit(root);\n        }\n        return isMuted;\n    }\n\n    public override void Visit(SyntaxNode node)\n    {\n        if (!isMuted)   // Performance optimization, we can stop visiting once we know the answer\n        {\n            base.Visit(node);\n        }\n    }\n\n    public override void VisitIdentifierName(IdentifierNameSyntax node)\n    {\n        if (Array.Find(symbols, x => node.NameIs(x.Name) && x.Equals(model.GetSymbolInfo(node).Symbol)) is { } symbol)\n        {\n            isMuted = IsInTupleAssignmentTarget() || IsUsedInLocalFunction(symbol) || IsInUnsupportedExpression();\n        }\n        base.VisitIdentifierName(node);\n\n        bool IsInTupleAssignmentTarget() =>\n            node.Parent is ArgumentSyntax argument && argument.IsInTupleAssignmentTarget();\n\n        bool IsUsedInLocalFunction(ISymbol symbol) =>\n            // We don't mute it if it's declared and used in local function\n            !(symbol.ContainingSymbol is IMethodSymbol containingSymbol && containingSymbol.MethodKind == MethodKindEx.LocalFunction)\n            && node.HasAncestor(SyntaxKindEx.LocalFunctionStatement);\n\n        bool IsInUnsupportedExpression() =>\n            node.FirstAncestorOrSelf<SyntaxNode>(x => x?.Kind() is SyntaxKindEx.IndexExpression or SyntaxKindEx.RangeExpression) is not null;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Syntax/Utilities/SafeCSharpSyntaxWalker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Utilities;\n\npublic class SafeCSharpSyntaxWalker : CSharpSyntaxWalker, ISafeSyntaxWalker\n{\n    protected SafeCSharpSyntaxWalker() { }\n\n    protected SafeCSharpSyntaxWalker(SyntaxWalkerDepth depth) : base(depth) { }\n\n    public bool SafeVisit(SyntaxNode syntaxNode)\n    {\n        try\n        {\n            Visit(syntaxNode);\n            return true;\n        }\n        catch (InsufficientExecutionStackException)\n        {\n            // Roslyn walker overflows the stack when the depth of the call is around 2050.\n            // See https://github.com/SonarSource/sonar-dotnet/issues/2115\n            return false;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Trackers/CSharpArgumentTracker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Core.Trackers;\n\ninternal sealed class CSharpArgumentTracker : ArgumentTracker<SyntaxKind>\n{\n    protected override SyntaxKind[] TrackedSyntaxKinds =>\n        [\n            SyntaxKind.AttributeArgument,\n            SyntaxKind.Argument,\n        ];\n\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override IReadOnlyCollection<SyntaxNode> ArgumentList(SyntaxNode argumentNode) =>\n        argumentNode switch\n        {\n            AttributeArgumentSyntax { Parent: AttributeArgumentListSyntax { Arguments: { } list } } => list,\n            ArgumentSyntax { Parent: BaseArgumentListSyntax { Arguments: { } list } } => list,\n            _ => null,\n        };\n\n    protected override int? Position(SyntaxNode argumentNode) =>\n        argumentNode is ArgumentSyntax { NameColon: not null }\n            or AttributeArgumentSyntax { NameColon: not null }\n            or AttributeArgumentSyntax { NameEquals: not null }\n            ? null\n            : ArgumentList(argumentNode).IndexOf(x => x == argumentNode);\n\n    protected override RefKind? ArgumentRefKind(SyntaxNode argumentNode) =>\n        argumentNode switch\n        {\n            ArgumentSyntax { RefOrOutKeyword: { } refOrOut } => refOrOut.Kind() switch\n                                                                {\n                                                                    SyntaxKind.OutKeyword => RefKind.Out,\n                                                                    SyntaxKind.RefKeyword => RefKind.Ref,\n                                                                    SyntaxKind.InKeyword => RefKindEx.In,\n                                                                    _ => RefKind.None\n                                                                },\n            AttributeArgumentSyntax => null, // RefKind is not supported for attributes and there is no way to specify such a constraint for Attributes in ArgumentDescriptor.\n            _ => null,\n        };\n\n    protected override bool InvocationMatchesMemberKind(SyntaxNode invokedExpression, MemberKind memberKind) =>\n        memberKind switch\n        {\n            MemberKind.Method => invokedExpression is InvocationExpressionSyntax,\n            MemberKind.Constructor => invokedExpression is ObjectCreationExpressionSyntax\n                or ConstructorInitializerSyntax\n                || ImplicitObjectCreationExpressionSyntaxWrapper.IsInstance(invokedExpression),\n            MemberKind.Indexer => invokedExpression is ElementAccessExpressionSyntax or ElementBindingExpressionSyntax,\n            MemberKind.Attribute => invokedExpression is AttributeSyntax,\n            _ => false,\n        };\n\n    protected override bool InvokedMemberMatches(SemanticModel model, SyntaxNode invokedExpression, MemberKind memberKind, Func<string, bool> invokedMemberNameConstraint) =>\n        memberKind switch\n        {\n            MemberKind.Method => invokedMemberNameConstraint(invokedExpression.GetName()),\n            MemberKind.Constructor => invokedExpression switch\n            {\n                ObjectCreationExpressionSyntax { Type: { } typeName } => invokedMemberNameConstraint(typeName.GetName()),\n                ConstructorInitializerSyntax x => FindClassNameFromConstructorInitializerSyntax(x) is not string name || invokedMemberNameConstraint(name),\n                { } x when ImplicitObjectCreationExpressionSyntaxWrapper.IsInstance(x) => invokedMemberNameConstraint(model.GetSymbolInfo(x).Symbol?.ContainingType?.Name),\n                _ => false,\n            },\n            MemberKind.Indexer => invokedExpression switch\n            {\n                ElementAccessExpressionSyntax { Expression: { } accessedExpression } => invokedMemberNameConstraint(accessedExpression.GetName()),\n                ElementBindingExpressionSyntax binding => binding.GetParentConditionalAccessExpression() is { Expression: { } accessedExpression }\n                                                          && invokedMemberNameConstraint(accessedExpression.GetName()),\n                _ => false,\n            },\n            MemberKind.Attribute => invokedExpression is AttributeSyntax { Name: { } typeName } && invokedMemberNameConstraint(typeName.GetName()),\n            _ => false,\n        };\n\n    private static string FindClassNameFromConstructorInitializerSyntax(ConstructorInitializerSyntax initializerSyntax) =>\n        initializerSyntax.ThisOrBaseKeyword.Kind() switch\n        {\n            SyntaxKind.ThisKeyword => initializerSyntax is { Parent: ConstructorDeclarationSyntax { Identifier.ValueText: { } typeName } } ? typeName : null,\n            SyntaxKind.BaseKeyword => initializerSyntax is { Parent: ConstructorDeclarationSyntax { Parent: BaseTypeDeclarationSyntax { BaseList.Types: { Count: > 0 } baseListTypes } } }\n                ? baseListTypes.First().GetName() // Get the class name of the called constructor from the base types list of the type declaration\n                : null,\n            _ => null,\n        };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Trackers/CSharpAssignmentFinder.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Core.Trackers;\n\npublic class CSharpAssignmentFinder : AssignmentFinder\n{\n    protected override SyntaxNode GetTopMostContainingMethod(SyntaxNode node) =>\n        node.GetTopMostContainingMethod();\n\n    /// <param name=\"anyAssignmentKind\">'true' will find any AssignmentExpressionSyntax like =, +=, -=, &=. 'false' will find only '=' SimpleAssignmentExpression.</param>\n    protected override bool IsAssignmentToIdentifier(SyntaxNode node, string identifierName, bool anyAssignmentKind, out SyntaxNode rightExpression)\n    {\n        if (node.IsKind(SyntaxKind.GlobalStatement))\n        {\n            node = ((GlobalStatementSyntax)node).Statement;\n        }\n\n        if (node is ExpressionStatementSyntax statement)\n        {\n            node = statement.Expression;\n        }\n        if ((anyAssignmentKind || node.IsKind(SyntaxKind.SimpleAssignmentExpression))\n            && IdentifierMutation(node, identifierName) is { } mutation)\n        {\n            rightExpression = mutation;\n            return true;\n        }\n        rightExpression = null;\n        return false;\n    }\n\n    protected override bool IsIdentifierDeclaration(SyntaxNode node, string identifierName, out SyntaxNode initializer)\n    {\n        if (node.IsKind(SyntaxKind.GlobalStatement))\n        {\n            node = ((GlobalStatementSyntax)node).Statement;\n        }\n\n        if (node is LocalDeclarationStatementSyntax declarationStatement\n            && declarationStatement.Declaration.Variables.SingleOrDefault(x => x.Identifier.ValueText == identifierName) is { } declaration)\n        {\n            initializer = declaration.Initializer?.Value;\n            return true;\n        }\n\n        initializer = null;\n        return false;\n    }\n\n    protected override bool IsLoop(SyntaxNode node) =>\n        node?.Kind() is SyntaxKind.ForStatement or SyntaxKind.ForEachStatement or SyntaxKind.WhileStatement or SyntaxKind.DoStatement;\n\n    /// <summary>\n    /// If <paramref name=\"identifierName\"/> is mutated inside <paramref name=\"mutation\"/> then\n    /// the expression representing the new value is returned. The returned expression might be\n    /// the reference to the identifier itself, e.g. in a case like <c>i++;</c>.\n    /// </summary>\n    private static SyntaxNode IdentifierMutation(SyntaxNode mutation, string identifierName) =>\n        mutation switch\n        {\n            AssignmentExpressionSyntax assignment\n                when assignment.MapAssignmentArguments().FirstOrDefault(x => x.Left.NameIs(identifierName)) is { Right: { } right } => right,\n            PostfixUnaryExpressionSyntax\n            {\n                RawKind: (int)SyntaxKind.PostIncrementExpression or (int)SyntaxKind.PostDecrementExpression,\n                Operand: { } operand,\n            } when operand.NameIs(identifierName) => operand,\n            PrefixUnaryExpressionSyntax\n            {\n                RawKind: (int)SyntaxKind.PreIncrementExpression or (int)SyntaxKind.PreDecrementExpression or (int)SyntaxKind.AddressOfExpression,\n                Operand: { } operand,\n            } when operand.NameIs(identifierName) => operand,\n            // Passing by ref or out is likely mutating the argument so we assume it is assigned a value in the called method.\n            ArgumentSyntax\n            {\n                RefOrOutKeyword.RawKind: (int)SyntaxKind.RefKeyword or (int)SyntaxKind.OutKeyword,\n                Expression: { } argumentExpression\n            } when argumentExpression.NameIs(identifierName) => argumentExpression,\n            _ => null,\n        };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Trackers/CSharpBaseTypeTracker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Core.Trackers;\n\npublic class CSharpBaseTypeTracker : BaseTypeTracker<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n    protected override SyntaxKind[] TrackedSyntaxKinds { get; } = new[] { SyntaxKind.BaseList };\n\n    protected override IEnumerable<SyntaxNode> GetBaseTypeNodes(SyntaxNode contextNode) =>\n        ((BaseListSyntax)contextNode)?.Types.Select(t => t.Type).ToArray();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Trackers/CSharpBuilderPatternCondition.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Core.Trackers;\n\npublic class CSharpBuilderPatternCondition : BuilderPatternCondition<SyntaxKind, InvocationExpressionSyntax>\n{\n    public CSharpBuilderPatternCondition(bool constructorIsSafe, params BuilderPatternDescriptor<SyntaxKind, InvocationExpressionSyntax>[] descriptors)\n        : base(constructorIsSafe, descriptors, new CSharpAssignmentFinder()) { }\n\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    protected override SyntaxNode GetExpression(InvocationExpressionSyntax node) =>\n        node.Expression;\n\n    protected override string GetIdentifierName(InvocationExpressionSyntax node) =>\n        node.Expression.GetName();\n\n    protected override bool IsMemberAccess(SyntaxNode node, out SyntaxNode memberAccessExpression)\n    {\n        if (node is MemberAccessExpressionSyntax memberAccess)\n        {\n            memberAccessExpression = memberAccess.Expression;\n            return true;\n        }\n        memberAccessExpression = null;\n        return false;\n    }\n\n    protected override bool IsObjectCreation(SyntaxNode node) =>\n        node?.Kind() is SyntaxKind.ObjectCreationExpression or SyntaxKindEx.ImplicitObjectCreationExpression;\n\n    protected override bool IsIdentifier(SyntaxNode node, out string identifierName)\n    {\n        if (node is IdentifierNameSyntax identifier)\n        {\n            identifierName = identifier.Identifier.ValueText;\n            return true;\n        }\n        identifierName = null;\n        return false;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Trackers/CSharpConstantValueFinder.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Core.Trackers;\n\npublic class CSharpConstantValueFinder : ConstantValueFinder<IdentifierNameSyntax, VariableDeclaratorSyntax>\n{\n    public CSharpConstantValueFinder(SemanticModel semanticModel) : base(semanticModel, new CSharpAssignmentFinder(), (int)SyntaxKind.NullLiteralExpression) { }\n\n    protected override string IdentifierName(IdentifierNameSyntax node) =>\n        node.Identifier.ValueText;\n\n    protected override SyntaxNode InitializerValue(VariableDeclaratorSyntax node) =>\n        node.Initializer?.Value;\n\n    protected override VariableDeclaratorSyntax VariableDeclarator(SyntaxNode node) =>\n        node as VariableDeclaratorSyntax;\n\n    protected override bool IsPtrZero(SyntaxNode node) =>\n        node is MemberAccessExpressionSyntax memberAccess\n        && memberAccess.IsPtrZero(Model);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Trackers/CSharpElementAccessTracker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Core.Trackers;\n\npublic class CSharpElementAccessTracker : ElementAccessTracker<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n    protected override SyntaxKind[] TrackedSyntaxKinds { get; } = [SyntaxKind.ElementAccessExpression, SyntaxKind.ElementBindingExpression];\n\n    public override object AssignedValue(ElementAccessContext context) =>\n        context.Node.Ancestors().FirstOrDefault(x => x.IsKind(SyntaxKind.SimpleAssignmentExpression)) is AssignmentExpressionSyntax assignment\n            ? assignment.Right.FindConstantValue(context.Model)\n            : null;\n\n    public override Condition ArgumentAtIndexEquals(int index, string value)\n    {\n        return context => ArgumentList(context.Node) is { } arguments\n                            && index < arguments.Count\n                            && arguments[index].Expression.FindStringConstant(context.Model) == value;\n\n        static SeparatedSyntaxList<ArgumentSyntax>? ArgumentList(SyntaxNode node) => node switch\n        {\n            ElementAccessExpressionSyntax elementAccess => elementAccess.ArgumentList.Arguments,\n            ElementBindingExpressionSyntax elementBinding => elementBinding.ArgumentList.Arguments,\n            _ => null\n        };\n    }\n\n    public override Condition MatchSetter() =>\n        context => ((ExpressionSyntax)context.Node).IsLeftSideOfAssignment();\n\n    public override Condition MatchProperty(MemberDescriptor member) =>\n        context => context.Node switch\n        {\n            ElementAccessExpressionSyntax { Expression: MemberAccessExpressionSyntax { RawKind: (int)SyntaxKind.SimpleMemberAccessExpression } memberAccessExpression } =>\n                member.IsMatch(memberAccessExpression.Name.Identifier.ValueText, context.Model.GetTypeInfo(memberAccessExpression.Expression).Type, Language.NameComparison),\n            ElementAccessExpressionSyntax { Expression: MemberBindingExpressionSyntax memberBindingExpression } =>\n                member.IsMatch(memberBindingExpression.Name.Identifier.ValueText, context.Model.GetSymbolInfo(memberBindingExpression).Symbol?.ContainingType, Language.NameComparison),\n            ElementBindingExpressionSyntax { Parent.Parent: ConditionalAccessExpressionSyntax { Expression: MemberAccessExpressionSyntax memberAccessExpression } } =>\n                member.IsMatch(memberAccessExpression.Name.Identifier.ValueText, context.Model.GetTypeInfo(memberAccessExpression.Expression).Type, Language.NameComparison),\n            _ => false\n        };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Trackers/CSharpFieldAccessTracker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Core.Trackers;\n\npublic class CSharpFieldAccessTracker : FieldAccessTracker<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n    protected override SyntaxKind[] TrackedSyntaxKinds { get; } =\n        new[]\n        {\n            SyntaxKind.SimpleMemberAccessExpression,\n            SyntaxKind.MemberBindingExpression,\n            SyntaxKind.IdentifierName\n        };\n\n    public override Condition WhenRead() =>\n        context => !((ExpressionSyntax)context.Node).IsLeftSideOfAssignment();\n\n    public override Condition MatchSet() =>\n        context => ((ExpressionSyntax)context.Node).IsLeftSideOfAssignment();\n\n    public override Condition AssignedValueIsConstant() =>\n        context =>\n        {\n            var assignment = (AssignmentExpressionSyntax)context.Node.Ancestors().FirstOrDefault(ancestor => ancestor.IsKind(SyntaxKind.SimpleAssignmentExpression));\n            return assignment != null && assignment.Right.HasConstantValue(context.Model);\n        };\n\n    protected override bool IsIdentifierWithinMemberAccess(SyntaxNode expression) =>\n        expression.IsKind(SyntaxKind.IdentifierName)\n        && expression.Parent.IsKind(SyntaxKind.SimpleMemberAccessExpression);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Trackers/CSharpInvocationTracker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Core.Trackers;\n\npublic class CSharpInvocationTracker : InvocationTracker<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n    protected override SyntaxKind[] TrackedSyntaxKinds { get; } = new[] { SyntaxKind.InvocationExpression };\n\n    public override Condition ArgumentAtIndexIsStringConstant(int index) =>\n        ArgumentAtIndexConformsTo(index, (argument, model) =>\n            argument.Expression.FindStringConstant(model) is not null);\n\n    public override Condition ArgumentAtIndexIsAny(int index, params string[] values) =>\n        ArgumentAtIndexConformsTo(index, (argument, model) =>\n            values.Contains(argument.Expression.FindStringConstant(model)));\n\n    public override Condition ArgumentAtIndexIs(int index, Func<SyntaxNode, SemanticModel, bool> predicate) =>\n        ArgumentAtIndexConformsTo(index, (argument, model) =>\n            predicate(argument, model));\n\n    public override Condition MatchProperty(MemberDescriptor member) =>\n        context => ((InvocationExpressionSyntax)context.Node).Expression is MemberAccessExpressionSyntax methodMemberAccess\n                   && methodMemberAccess.IsKind(SyntaxKind.SimpleMemberAccessExpression)\n                   && methodMemberAccess.Expression is MemberAccessExpressionSyntax propertyMemberAccess\n                   && propertyMemberAccess.IsKind(SyntaxKind.SimpleMemberAccessExpression)\n                   && context.Model.GetTypeInfo(propertyMemberAccess.Expression) is TypeInfo enclosingClassType\n                   && member.IsMatch(propertyMemberAccess.Name.Identifier.ValueText, enclosingClassType.Type, Language.NameComparison);\n\n    public override object ConstArgumentForParameter(InvocationContext context, string parameterName)\n    {\n        var argumentList = ((InvocationExpressionSyntax)context.Node).ArgumentList;\n        var values = argumentList.ArgumentValuesForParameter(context.Model, parameterName);\n        return values.Length == 1 && values[0] is ExpressionSyntax valueSyntax\n            ? valueSyntax.FindConstantValue(context.Model)\n            : null;\n    }\n\n    protected override SyntaxToken? ExpectedExpressionIdentifier(SyntaxNode expression) =>\n        ((ExpressionSyntax)expression).GetIdentifier();\n\n    private static Condition ArgumentAtIndexConformsTo(int index, Func<ArgumentSyntax, SemanticModel, bool> predicate) =>\n        context => context.Node is InvocationExpressionSyntax { ArgumentList.Arguments: { } arguments }\n            && index < arguments.Count\n            && arguments[index] is { } argument\n            && predicate(argument, context.Model);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Trackers/CSharpMethodDeclarationTracker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Core.Trackers;\n\npublic class CSharpMethodDeclarationTracker : MethodDeclarationTracker<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    public override Condition ParameterAtIndexIsUsed(int index) =>\n        context =>\n        {\n            var parameterSymbol = context.MethodSymbol.Parameters.ElementAtOrDefault(0);\n            if (parameterSymbol == null)\n            {\n                return false;\n            }\n\n            var methodInfo = GetMethodInfo(context);\n            if (methodInfo?.DescendantNodes == null)\n            {\n                return false;\n            }\n\n            return methodInfo.DescendantNodes.Any(\n                node =>\n                    node.IsKind(SyntaxKind.IdentifierName)\n                    && ((IdentifierNameSyntax)node).Identifier.ValueText == parameterSymbol.Name\n                    && parameterSymbol.Equals(methodInfo.SemanticModel.GetSymbolInfo(node).Symbol));\n        };\n\n    private static MethodInfo GetMethodInfo(MethodDeclarationContext context)\n    {\n        if (context.MethodSymbol.IsTopLevelMain())\n        {\n            var declaration = context.MethodSymbol\n                                     .DeclaringSyntaxReferences\n                                     .Select(r => r.GetSyntax())\n                                     .OfType<CompilationUnitSyntax>()\n                                     .First();\n\n            return new MethodInfo(context.GetSemanticModel(declaration), declaration.GetTopLevelMainBody().SelectMany(x => x.DescendantNodes()));\n        }\n        else\n        {\n            var declaration = context.MethodSymbol\n                                     .DeclaringSyntaxReferences\n                                     .Select(r => r.GetSyntax())\n                                     .OfType<BaseMethodDeclarationSyntax>()\n                                     .FirstOrDefault(declaration => declaration.HasBodyOrExpressionBody());\n            if (declaration == null)\n            {\n                return null;\n            }\n\n            return new MethodInfo(\n                context.GetSemanticModel(declaration),\n                declaration.Body?.DescendantNodes() ?? declaration.ExpressionBody()?.DescendantNodes() ?? Enumerable.Empty<SyntaxNode>());\n        }\n    }\n\n    protected override SyntaxToken? GetMethodIdentifier(SyntaxNode methodDeclaration) =>\n        methodDeclaration switch\n        {\n            MethodDeclarationSyntax method => method.Identifier,\n            ConstructorDeclarationSyntax constructor => constructor.Identifier,\n            DestructorDeclarationSyntax destructor => destructor.Identifier,\n            OperatorDeclarationSyntax op => op.OperatorToken,\n            _ => methodDeclaration?.Parent.Parent switch // Accessors\n            {\n                EventDeclarationSyntax e => e.Identifier,\n                PropertyDeclarationSyntax p => p.Identifier,\n                IndexerDeclarationSyntax i => i.ThisKeyword,\n                _ => null\n            }\n        };\n\n    private sealed class MethodInfo\n    {\n        public SemanticModel SemanticModel { get; }\n\n        public IEnumerable<SyntaxNode> DescendantNodes { get; }\n\n        public MethodInfo(SemanticModel model, IEnumerable<SyntaxNode> descendantNodes)\n        {\n            SemanticModel = model;\n            DescendantNodes = descendantNodes;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Trackers/CSharpObjectCreationTracker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Core.Trackers;\n\npublic class CSharpObjectCreationTracker : ObjectCreationTracker<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n\n    public override Condition ArgumentAtIndexIsConst(int index) =>\n        context => ObjectCreationFactory.Create(context.Node).ArgumentList is { } argumentList\n                   && argumentList.Arguments.Count > index\n                   && argumentList.Arguments[index].Expression.HasConstantValue(context.Model);\n\n    public override object ConstArgumentForParameter(ObjectCreationContext context, string parameterName) =>\n        ObjectCreationFactory.TryCreate(context.Node, out var objectCreation)\n        && objectCreation.ArgumentList.ArgumentValuesForParameter(context.Model, parameterName) is { Length: 1 } values\n        && values[0] is ExpressionSyntax valueSyntax\n            ? valueSyntax.FindConstantValue(context.Model)\n            : null;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Trackers/CSharpObjectInitializationTracker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Trackers;\n\n/// <summary>\n/// Verifies the initialization of an object, whether one or more properties have been correctly set when the object was initialized.\n/// </summary>\n/// A correct initialization could consist of:\n/// - EITHER invoking the constructor with specific parameters\n/// - OR invoking the constructor and then setting some specific properties on the created object\npublic class CSharpObjectInitializationTracker\n{\n    /// <summary>\n    /// By default, the constructor arguments are ignored.\n    /// </summary>\n    private const int DefaultTrackedConstructorArgumentIndex = -1;\n\n    private static readonly Func<ISymbol, SyntaxNode, SemanticModel, bool> DefaultIsAllowedObject = (s, node, model) => false;\n\n    /// <summary>\n    /// Given the value of a literal (e.g. enum or boolean), returns true if it is an allowed value.\n    /// </summary>\n    private readonly Predicate<object> isAllowedConstantValue;\n\n    /// <summary>\n    /// Given the symbol of an object, the expression used to populate the value and the semantic model, returns true if it is allowed.\n    /// </summary>\n    private readonly Func<ISymbol, SyntaxNode, SemanticModel, bool> isAllowedObject;\n\n    /// <summary>\n    /// Given the name of a property, returns true if it is of interest for the rule verdict.\n    /// </summary>\n    private readonly Predicate<string> isTrackedPropertyName;\n\n    /// <summary>\n    /// An array of types for which this class tracks initializations.\n    /// </summary>\n    private readonly ImmutableArray<KnownType> trackedTypes;\n\n    /// <summary>\n    /// The index of a constructor argument that corresponds to a tracked property. It should be -1 if it should be ignored.\n    /// </summary>\n    private readonly int trackedConstructorArgumentIndex;\n\n    public CSharpObjectInitializationTracker(Predicate<object> isAllowedConstantValue,\n                                             ImmutableArray<KnownType> trackedTypes,\n                                             Predicate<string> isTrackedPropertyName,\n                                             Func<ISymbol, SyntaxNode, SemanticModel, bool> isAllowedObject = null,\n                                             int trackedConstructorArgumentIndex = DefaultTrackedConstructorArgumentIndex)\n    {\n        this.isAllowedConstantValue = isAllowedConstantValue;\n        this.trackedTypes = trackedTypes;\n        this.isTrackedPropertyName = isTrackedPropertyName;\n        this.isAllowedObject = isAllowedObject ?? DefaultIsAllowedObject;\n        this.trackedConstructorArgumentIndex = trackedConstructorArgumentIndex;\n    }\n\n    public bool ShouldBeReported(IObjectCreation objectCreation, SemanticModel model, bool isDefaultConstructorSafe) =>\n        IsTrackedType(objectCreation.Expression, model)\n        && !ObjectCreatedWithAllowedValue(objectCreation, model, isDefaultConstructorSafe)\n        && !IsLaterAssignedWithAllowedValue(objectCreation, model);\n\n    public bool ShouldBeReported(AssignmentExpressionSyntax assignment, SemanticModel model)\n    {\n        var assignmentMap = assignment.MapAssignmentArguments();\n\n        // Ignore assignments within object initializers, they are reported in the ObjectCreationExpression handler\n        return assignment.FirstAncestorOrSelf<InitializerExpressionSyntax>() is null\n            && assignmentMap.Any(x => IsTrackedPropertyName(x.Left)\n                                        && IsPropertyOnTrackedType(x.Left, model)\n                                        && !IsAllowedValue(x.Right, model));\n    }\n\n    /// <summary>\n    /// Tests if the provided <paramref name=\"constantValue\"/> is equal to an allowed constant (literal) value.\n    /// </summary>\n    private bool IsAllowedConstantValue(object constantValue) =>\n        isAllowedConstantValue(constantValue);\n\n    private bool IsTrackedType(ExpressionSyntax expression, SemanticModel model) =>\n        model.GetTypeInfo(expression).Type.IsAny(trackedTypes);\n\n    /// <summary>\n    /// Tests if the expression is an allowed value. The implementation of checks is provided by the derived class.\n    /// </summary>\n    /// <returns>True if the expression is an allowed value, otherwise false.</returns>\n    private bool IsAllowedValue(SyntaxNode expression, SemanticModel model)\n    {\n        if (expression is null)\n        {\n            return false;\n        }\n        else if (expression.IsKind(SyntaxKind.NullLiteralExpression))\n        {\n            return true;\n        }\n        else if (expression.FindConstantValue(model) is { } constantValue)\n        {\n            return IsAllowedConstantValue(constantValue);\n        }\n        else if (model.GetSymbolInfo(expression).Symbol is { } symbol)\n        {\n            return isAllowedObject(symbol, expression, model);\n        }\n        else\n        {\n            return false;\n        }\n    }\n\n    /// <summary>\n    /// Verifies that the properties are assigned with allowed values. Otherwise, verifies the constructor invocation.\n    /// </summary>\n    /// There are multiple ways of verifying:\n    /// - implicit constructor with property setting\n    /// var x = new X { Prop = new Y() };\n    /// - constructor with passing a list of arguments, where we care about a specific argument\n    /// <remarks>\n    /// Currently we do not handle the situation with default and named arguments.\n    /// </remarks>\n    private bool ObjectCreatedWithAllowedValue(IObjectCreation objectCreation, SemanticModel model, bool isDefaultConstructorSafe)\n    {\n        var trackedPropertyAssignments = InitializerExpressions(objectCreation.Initializer)\n            .OfType<AssignmentExpressionSyntax>()\n            .Where(x => IsTrackedPropertyName(x.Left))\n            .ToList();\n        if (trackedPropertyAssignments.Any())\n        {\n            return trackedPropertyAssignments.All(x => IsAllowedValue(x.Right, model));\n        }\n        else if (trackedConstructorArgumentIndex != -1)\n        {\n            var argumentList = objectCreation.ArgumentList;\n            return argumentList is null\n                || argumentList.Arguments.Count != trackedConstructorArgumentIndex + 1\n                || IsAllowedValue(argumentList.Arguments[trackedConstructorArgumentIndex].Expression, model);\n        }\n        else\n        {\n            // if no tracked properties are being explicitly set or passed as arguments, check if the default constructor is safe\n            return isDefaultConstructorSafe;\n        }\n    }\n\n    /// <summary>\n    /// Returns true if <paramref name=\"propertyName\"/> is the name of a tracked property.\n    /// </summary>\n    private bool IsTrackedPropertyName(string propertyName) =>\n        isTrackedPropertyName(propertyName);\n\n    /// <summary>\n    /// Returns true if the <paramref name=\"expression\"/> has the name of a tracked property.\n    /// </summary>\n    private bool IsTrackedPropertyName(SyntaxNode expression)\n    {\n        var identifier = (expression as MemberAccessExpressionSyntax)?.Name?.Identifier\n            ?? (expression as IdentifierNameSyntax)?.Identifier\n            ?? (expression as MemberBindingExpressionSyntax)?.Name.Identifier;\n        return identifier.HasValue && IsTrackedPropertyName(identifier.Value.ValueText);\n    }\n\n    /// <summary>\n    /// Returns true if the provided expression is a member of a tracked type.\n    /// </summary>\n    private bool IsPropertyOnTrackedType(SyntaxNode expression, SemanticModel model)\n    {\n        var targetExpression = expression switch\n        {\n            MemberAccessExpressionSyntax memberAccess => memberAccess.Expression,\n            ConditionalAccessExpressionSyntax conditionalAccess => conditionalAccess.Expression,\n            MemberBindingExpressionSyntax memberBinding => (memberBinding.Parent.Parent as ConditionalAccessExpressionSyntax)?.Expression,\n            _ => null\n        };\n        return targetExpression is not null && IsTrackedType(targetExpression, model);\n    }\n\n    private bool IsLaterAssignedWithAllowedValue(IObjectCreation objectCreation, SemanticModel model)\n    {\n        var statement = objectCreation.Expression.FirstAncestorOrSelf<StatementSyntax>();\n        if (statement is null)\n        {\n            return false;\n        }\n\n        var variableSymbol = AssignedVariableSymbol(objectCreation, model);\n        var nextStatements = NextStatements(statement);\n        var innerStatements = InnerStatements(statement);\n\n        return variableSymbol is not null\n            && nextStatements.Union(innerStatements)\n                .OfType<ExpressionStatementSyntax>()\n                .Select(x => x.Expression)\n                .OfType<AssignmentExpressionSyntax>()\n                .Any(TrackedPropertySetWithAllowedValue);\n\n        bool TrackedPropertySetWithAllowedValue(AssignmentExpressionSyntax assignment)\n        {\n            var assignmentMap = assignment.MapAssignmentArguments();\n            return assignmentMap.Any(x => IsTrackedPropertyName(x.Left)\n                                            && variableSymbol.Equals(AssignedVariableSymbol(x.Left, model))\n                                            && IsAllowedValue(x.Right, model));\n        }\n    }\n\n    private static IEnumerable<ExpressionSyntax> InitializerExpressions(InitializerExpressionSyntax initializer) =>\n        initializer?.Expressions ?? Enumerable.Empty<ExpressionSyntax>();\n\n    private static ISymbol AssignedVariableSymbol(IObjectCreation objectCreation, SemanticModel model)\n    {\n        if (objectCreation.Expression.FirstAncestorOrSelf<AssignmentExpressionSyntax>()?.Left is { } variable)\n        {\n            return model.GetSymbolInfo(variable).Symbol;\n        }\n\n        return objectCreation.Expression.FirstAncestorOrSelf<VariableDeclaratorSyntax>() is { }  identifier\n            ? model.GetDeclaredSymbol(identifier)\n            : null;\n    }\n\n    private static ISymbol AssignedVariableSymbol(SyntaxNode node, SemanticModel model)\n    {\n        var identifier = node is MemberAccessExpressionSyntax memberAccess ? memberAccess.Expression : node as IdentifierNameSyntax;\n        return model.GetSymbolInfo(identifier).Symbol;\n    }\n\n    private static IEnumerable<StatementSyntax> NextStatements(StatementSyntax statement) =>\n        statement.Parent.ChildNodes().OfType<StatementSyntax>().SkipWhile(x => x != statement).Skip(1);\n\n    private static IEnumerable<StatementSyntax> InnerStatements(StatementSyntax statement) =>\n        statement.DescendantNodes().OfType<StatementSyntax>();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Trackers/CSharpPropertyAccessTracker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Core.Trackers;\n\npublic class CSharpPropertyAccessTracker : PropertyAccessTracker<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\n    protected override SyntaxKind[] TrackedSyntaxKinds { get; } =\n        new[]\n        {\n            SyntaxKind.SimpleMemberAccessExpression,\n            SyntaxKind.MemberBindingExpression,\n            SyntaxKind.IdentifierName\n        };\n\n    public override object AssignedValue(PropertyAccessContext context) =>\n        context.Node.Ancestors().FirstOrDefault(ancestor => ancestor.IsKind(SyntaxKind.SimpleAssignmentExpression)) is AssignmentExpressionSyntax assignment\n            ? assignment.Right.FindConstantValue(context.Model)\n            : null;\n\n    public override Condition MatchGetter() =>\n        context => !((ExpressionSyntax)context.Node).IsLeftSideOfAssignment();\n\n    public override Condition MatchSetter() =>\n        context => ((ExpressionSyntax)context.Node).IsLeftSideOfAssignment();\n\n    public override Condition AssignedValueIsConstant() =>\n        context => AssignedValue(context) != null;\n\n    protected override bool IsIdentifierWithinMemberAccess(SyntaxNode expression) =>\n        expression.IsKind(SyntaxKind.IdentifierName) && IsSimpleMemberWithinMemberAccess(expression.Parent);\n\n    private static bool IsSimpleMemberWithinMemberAccess(SyntaxNode node) =>\n        node.IsKind(SyntaxKind.SimpleMemberAccessExpression)\n        || (node.IsKind(SyntaxKind.MemberBindingExpression)\n            && node.Parent.IsKind(SyntaxKind.SimpleAssignmentExpression)\n            && node.Parent.Parent.IsKind(SyntaxKind.ConditionalAccessExpression));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Wrappers/IMethodDeclaration.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Wrappers;\n\npublic interface IMethodDeclaration\n{\n    BlockSyntax Body { get; }\n\n    ArrowExpressionClauseSyntax ExpressionBody { get; }\n\n    SyntaxToken Identifier { get; }\n\n    ParameterListSyntax ParameterList { get; }\n\n    public TypeParameterListSyntax TypeParameterList { get; }\n\n    bool HasImplementation { get; }\n\n    bool IsLocal { get; }\n\n    TypeSyntax ReturnType { get; }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Wrappers/MethodDeclarationFactory.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Wrappers;\n\npublic static class MethodDeclarationFactory\n{\n    public static IMethodDeclaration Create(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            throw new ArgumentNullException(nameof(node));\n        }\n        else if (LocalFunctionStatementSyntaxWrapper.IsInstance(node))\n        {\n            return new LocalFunctionStatementAdapter((LocalFunctionStatementSyntaxWrapper)node);\n        }\n        else if (node is MethodDeclarationSyntax method)\n        {\n            return new MethodDeclarationSyntaxAdapter(method);\n        }\n        else\n        {\n            throw new InvalidOperationException(\"Unexpected type: \" + node.GetType().Name);\n        }\n    }\n\n    private sealed class LocalFunctionStatementAdapter : IMethodDeclaration\n    {\n        private readonly LocalFunctionStatementSyntaxWrapper syntaxWrapper;\n\n        public BlockSyntax Body => syntaxWrapper.Body;\n        public ArrowExpressionClauseSyntax ExpressionBody => syntaxWrapper.ExpressionBody;\n        public SyntaxToken Identifier => syntaxWrapper.Identifier;\n        public ParameterListSyntax ParameterList => syntaxWrapper.ParameterList;\n        public TypeParameterListSyntax TypeParameterList => syntaxWrapper.TypeParameterList;\n        public bool HasImplementation => Body is not null || ExpressionBody is not null;\n        public bool IsLocal => true;\n        public TypeSyntax ReturnType => syntaxWrapper.ReturnType;\n\n        public LocalFunctionStatementAdapter(LocalFunctionStatementSyntaxWrapper syntaxWrapper) =>\n            this.syntaxWrapper = syntaxWrapper;\n    }\n\n    private sealed class MethodDeclarationSyntaxAdapter : IMethodDeclaration\n    {\n        private readonly MethodDeclarationSyntax declarationSyntax;\n\n        public BlockSyntax Body => declarationSyntax.Body;\n        public ArrowExpressionClauseSyntax ExpressionBody => declarationSyntax.ExpressionBody;\n        public SyntaxToken Identifier => declarationSyntax.Identifier;\n        public ParameterListSyntax ParameterList => declarationSyntax.ParameterList;\n        public TypeParameterListSyntax TypeParameterList => declarationSyntax.TypeParameterList;\n        public bool HasImplementation => Body is not null || ExpressionBody is not null;\n        public bool IsLocal => false;\n        public TypeSyntax ReturnType => declarationSyntax.ReturnType;\n\n        public MethodDeclarationSyntaxAdapter(MethodDeclarationSyntax declarationSyntax) =>\n            this.declarationSyntax = declarationSyntax;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/Wrappers/ObjectCreationFactory.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Wrappers;\n\npublic interface IObjectCreation\n{\n    InitializerExpressionSyntax Initializer { get; }\n    ArgumentListSyntax ArgumentList { get; }\n    ExpressionSyntax Expression { get; }\n    IEnumerable<ExpressionSyntax> InitializerExpressions { get; }\n\n    bool IsKnownType(KnownType knownType, SemanticModel semanticModel);\n    string TypeAsString(SemanticModel semanticModel);\n    ITypeSymbol TypeSymbol(SemanticModel semanticModel);\n    IMethodSymbol MethodSymbol(SemanticModel semanticModel);\n}\n\npublic class ObjectCreationFactory\n{\n    public static IObjectCreation Create(SyntaxNode node) =>\n        node switch\n        {\n            null => throw new ArgumentNullException(nameof(node)),\n            ObjectCreationExpressionSyntax objectCreation => new ObjectCreation(objectCreation),\n            { } when ImplicitObjectCreationExpressionSyntaxWrapper.IsInstance(node) => new ImplicitObjectCreation((ImplicitObjectCreationExpressionSyntaxWrapper)node),\n            _ => throw new InvalidOperationException(\"Unexpected type: \" + node.GetType().Name)\n        };\n\n    public static IObjectCreation TryCreate(SyntaxNode node) =>\n         node?.Kind() is SyntaxKind.ObjectCreationExpression or SyntaxKindEx.ImplicitObjectCreationExpression\n             ? Create(node)\n             : null;\n\n    public static bool TryCreate(SyntaxNode node, out IObjectCreation objectCreation)\n    {\n        objectCreation = TryCreate(node);\n        return objectCreation is not null;\n    }\n\n    private sealed class ObjectCreation : IObjectCreation\n    {\n        private readonly ObjectCreationExpressionSyntax objectCreation;\n\n        public InitializerExpressionSyntax Initializer => objectCreation.Initializer;\n        public ArgumentListSyntax ArgumentList => objectCreation.ArgumentList;\n        public ExpressionSyntax Expression => objectCreation;\n        public IEnumerable<ExpressionSyntax> InitializerExpressions => objectCreation.Initializer?.Expressions;\n\n        public ObjectCreation(ObjectCreationExpressionSyntax objectCreationExpressionSyntax) =>\n            objectCreation = objectCreationExpressionSyntax;\n\n        public bool IsKnownType(KnownType knownType, SemanticModel semanticModel) =>\n            objectCreation.Type.GetName().EndsWith(knownType.TypeName) && objectCreation.IsKnownType(knownType, semanticModel);\n\n        public string TypeAsString(SemanticModel semanticModel) =>\n            objectCreation.Type.ToString();\n\n        public ITypeSymbol TypeSymbol(SemanticModel semanticModel) =>\n            semanticModel.GetTypeInfo(objectCreation).Type;\n\n        public IMethodSymbol MethodSymbol(SemanticModel semanticModel) =>\n            semanticModel.GetSymbolInfo(objectCreation).Symbol as IMethodSymbol;\n    }\n\n    private sealed class ImplicitObjectCreation : IObjectCreation\n    {\n        private readonly ImplicitObjectCreationExpressionSyntaxWrapper objectCreation;\n\n        public InitializerExpressionSyntax Initializer => objectCreation.Initializer;\n        public ArgumentListSyntax ArgumentList => objectCreation.ArgumentList;\n        public ExpressionSyntax Expression => objectCreation.SyntaxNode;\n        public IEnumerable<ExpressionSyntax> InitializerExpressions => objectCreation.Initializer?.Expressions;\n\n        public ImplicitObjectCreation(ImplicitObjectCreationExpressionSyntaxWrapper wrapper) =>\n            objectCreation = wrapper;\n\n        public bool IsKnownType(KnownType knownType, SemanticModel semanticModel) =>\n            semanticModel.GetTypeInfo(objectCreation).Type.Is(knownType);\n\n        // Return null if TypeSymbol returns null to avoid AD0001 due to this issue: https://github.com/dotnet/roslyn/issues/70041\n        public string TypeAsString(SemanticModel semanticModel)\n        {\n            var typeSymbol = TypeSymbol(semanticModel);\n            return typeSymbol is INamedTypeSymbol { OriginalDefinition.SpecialType: SpecialType.System_Nullable_T } namedTypeSymbol\n                ? namedTypeSymbol.TypeArguments[0].Name\n                : typeSymbol?.Name;\n        }\n\n        public ITypeSymbol TypeSymbol(SemanticModel semanticModel) =>\n            semanticModel.GetTypeInfo(objectCreation).ConvertedType;\n\n        public IMethodSymbol MethodSymbol(SemanticModel semanticModel) =>\n            semanticModel.GetSymbolInfo(objectCreation).Symbol as IMethodSymbol;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Core/packages.lock.json",
    "content": "{\n  \"version\": 1,\n  \"dependencies\": {\n    \".NETStandard,Version=v2.0\": {\n      \"Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[3.3.1, )\",\n        \"resolved\": \"3.3.1\",\n        \"contentHash\": \"eT+kgNCDdTRbQ5WF6BGx1HI3D5jYfHteza/koefhWC2vNZGxObA74XxwWfg40dy3uUv7dn3OGKLK5GUPLroVog==\"\n      },\n      \"Microsoft.CodeAnalysis.Workspaces.Common\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.3.2, )\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"kvdo+rkImlx5MuBgkayl4OV3Mg8/qirUdYgCIfQ9EqN15QasJFlQXmDAtCGqpkK9sYLLO/VK+y+4mvKjfh/FOA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Common\": \"[1.3.2]\",\n          \"Microsoft.Composition\": \"1.0.27\"\n        }\n      },\n      \"Microsoft.Composition\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.0.27, )\",\n        \"resolved\": \"1.0.27\",\n        \"contentHash\": \"pwu80Ohe7SBzZ6i69LVdzowp6V+LaVRzd5F7A6QlD42vQkX0oT7KXKWWPlM/S00w1gnMQMRnEdbtOV12z6rXdQ==\"\n      },\n      \"NETStandard.Library\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[2.0.3, )\",\n        \"resolved\": \"2.0.3\",\n        \"contentHash\": \"st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.1.0\"\n        }\n      },\n      \"SonarAnalyzer.CSharp.Styling\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[10.21.0.135717, )\",\n        \"resolved\": \"10.21.0.135717\",\n        \"contentHash\": \"hl264jF539oB7m2jED5QGM345eFSiDAdoJc8TH0HM6L7ZeqT5TDqZDQeZ8IDP02dVIpH/Fhhn+HsGfEcj8ohyQ==\"\n      },\n      \"StyleCop.Analyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.2.0-beta.556, )\",\n        \"resolved\": \"1.2.0-beta.556\",\n        \"contentHash\": \"llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==\",\n        \"dependencies\": {\n          \"StyleCop.Analyzers.Unstable\": \"1.2.0.556\"\n        }\n      },\n      \"System.Collections.Immutable\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.1.37, )\",\n        \"resolved\": \"1.1.37\",\n        \"contentHash\": \"fTpqwZYBzoklTT+XjTRK8KxvmrGkYHzBiylCcKyQcxiOM8k+QvhNBxRvFHDWzy4OEP5f8/9n+xQ9mEgEXY+muA==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.0\",\n          \"System.Diagnostics.Debug\": \"4.0.0\",\n          \"System.Globalization\": \"4.0.0\",\n          \"System.Linq\": \"4.0.0\",\n          \"System.Resources.ResourceManager\": \"4.0.0\",\n          \"System.Runtime\": \"4.0.0\",\n          \"System.Runtime.Extensions\": \"4.0.0\",\n          \"System.Threading\": \"4.0.0\"\n        }\n      },\n      \"Google.Protobuf\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"3.6.1\",\n        \"contentHash\": \"741fGeDQjixBJaU2j+0CbrmZXsNJkTn/hWbOh4fLVXndHsCclJmWznCPWrJmPoZKvajBvAz3e8ECJOUvRtwjNQ==\",\n        \"dependencies\": {\n          \"NETStandard.Library\": \"1.6.1\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.1.0\",\n        \"contentHash\": \"HS3iRWZKcUw/8eZ/08GXKY2Bn7xNzQPzf8gRPHGSowX7u7XXu9i9YEaBeBNKUXWfI7qjvT2zXtLUvbN0hds8vg==\"\n      },\n      \"Microsoft.CodeAnalysis.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"lOinFNbjpCvkeYQHutjKi+CfsjoKu88wAFT6hAumSR/XJSJmmVGvmnbzCWW8kUJnDVrw1RrcqS8BzgPMj263og==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"1.1.0\",\n          \"System.AppContext\": \"4.1.0\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.Collections.Concurrent\": \"4.0.12\",\n          \"System.Collections.Immutable\": \"1.2.0\",\n          \"System.Console\": \"4.0.0\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Diagnostics.FileVersionInfo\": \"4.0.0\",\n          \"System.Diagnostics.StackTrace\": \"4.0.1\",\n          \"System.Diagnostics.Tools\": \"4.0.1\",\n          \"System.Dynamic.Runtime\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Linq.Expressions\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Metadata\": \"1.3.0\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Runtime.Numerics\": \"4.0.1\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.X509Certificates\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Text.Encoding.CodePages\": \"4.0.1\",\n          \"System.Text.Encoding.Extensions\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\",\n          \"System.Threading.Tasks.Parallel\": \"4.0.1\",\n          \"System.Threading.Thread\": \"4.0.0\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\",\n          \"System.Xml.XDocument\": \"4.0.11\",\n          \"System.Xml.XPath.XDocument\": \"4.0.1\",\n          \"System.Xml.XmlDocument\": \"4.0.1\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"GrYMp6ScZDOMR0fNn/Ce6SegNVFw1G/QRT/8FiKv7lAP+V6lEZx9e42n0FvFUgjjcKgcEJOI4muU6i+3LSvOBA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Common\": \"[1.3.2]\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp.Workspaces\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"MwGmrrPx3okEJuCogSn4TM3yTtJUDdmTt8RXpnjVo0dPund0YSAq4bHQQ9bxgArbrrapcopJmkb7UOLAvanXkg==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp\": \"[1.3.2]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2]\"\n        }\n      },\n      \"Microsoft.NETCore.Platforms\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.1.0\",\n        \"contentHash\": \"kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==\"\n      },\n      \"Microsoft.NETCore.Targets\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.1\",\n        \"contentHash\": \"rkn+fKobF/cbWfnnfBOQHKVKIOpxMZBvlSHkqDWgBpwGDcLRduvs3D9OLGeV6GWGvVwNlVi2CBbTjuPmtHvyNw==\"\n      },\n      \"runtime.native.System\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"QfS/nQI7k/BLgmLrw7qm7YBoULEvgWnPI+cYsbfCVFTW8Aj+i8JhccxcFMu1RWms0YZzF+UHguNBK4Qn89e2Sg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\"\n        }\n      },\n      \"runtime.native.System.Net.Http\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"Nh0UPZx2Vifh8r+J+H2jxifZUD3sBrmolgiFWJd2yiNrxO0xTa6bAw3YwRn1VOiSen/tUXMS31ttNItCZ6lKuA==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\"\n        }\n      },\n      \"runtime.native.System.Security.Cryptography\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"2CQK0jmO6Eu7ZeMgD+LOFbNJSXHFVQbCJJkEyEwowh1SCgYnrn9W9RykMfpeeVGw7h4IBvYikzpGUlmZTUafJw==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\"\n        }\n      },\n      \"StyleCop.Analyzers.Unstable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.2.0.556\",\n        \"contentHash\": \"zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==\"\n      },\n      \"System.AppContext\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"3QjO4jNV7PdKkmQAVp9atA+usVnKRwI3Kx1nMwJ93T0LcQfx7pKAYk0nKz5wn1oP5iqlhZuy6RXOFdhr7rDwow==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Collections\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"YUJGz6eFKqS0V//mLt25vFGrrCvOnsXjlvFQs+KimpwNxug9x0Pzy4PlFMU3Q2IzqAa9G2L4LsK3+9vCBK7oTg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Collections.Concurrent\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.12\",\n        \"contentHash\": \"2gBcbb3drMLgxlI0fBfxMA31ec6AEyYCHygGse4vxceJan8mRIWeKJ24BFzN7+bi/NFTgdIgufzb94LWO5EERQ==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Diagnostics.Tracing\": \"4.1.0\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Console\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"qSKUSOIiYA/a0g5XXdxFcUFmv1hNICBD7QZ0QhGYVipPIhvpiydY8VZqr1thmCXvmn8aipMg64zuanB4eotK9A==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\"\n        }\n      },\n      \"System.Diagnostics.Debug\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"w5U95fVKHY4G8ASs/K5iK3J5LY+/dLFd4vKejsnI/ZhBsWS9hQakfx3Zr7lRWKg4tAw9r4iktyvsTagWkqYCiw==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Diagnostics.FileVersionInfo\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"qjF74OTAU+mRhLaL4YSfiWy3vj6T3AOz8AW37l5zCwfbBfj0k7E94XnEsRaf2TnhE/7QaV6Hvqakoy2LoV8MVg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Reflection.Metadata\": \"1.3.0\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.InteropServices\": \"4.1.0\"\n        }\n      },\n      \"System.Diagnostics.StackTrace\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"6i2EbRq0lgGfiZ+FDf0gVaw9qeEU+7IS2+wbZJmFVpvVzVOgZEt0ScZtyenuBvs6iDYbGiF51bMAa0oDP/tujQ==\",\n        \"dependencies\": {\n          \"System.Collections.Immutable\": \"1.2.0\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Metadata\": \"1.3.0\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\"\n        }\n      },\n      \"System.Diagnostics.Tools\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"xBfJ8pnd4C17dWaC9FM6aShzbJcRNMChUMD42I6772KGGrqaFdumwhn9OdM68erj1ueNo3xdQ1EwiFjK5k8p0g==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Diagnostics.Tracing\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"vDN1PoMZCkkdNjvZLql592oYJZgS7URcJzJ7bxeBgGtx5UtR5leNm49VmfHGqIffX4FKacHbI3H6UyNSHQknBg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Dynamic.Runtime\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"db34f6LHYM0U0JpE+sOmjar27BnqTVkbLJhgfwMpTdgTigG/Hna3m2MYVwnFzGGKnEJk2UXFuoVTr8WUbU91/A==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Linq.Expressions\": \"4.1.0\",\n          \"System.ObjectModel\": \"4.0.12\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Emit\": \"4.0.1\",\n          \"System.Reflection.Emit.ILGeneration\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Reflection.TypeExtensions\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Globalization\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"B95h0YLEL2oSnwF/XjqSWKnwKOy/01VWkNlsCeMTFJLLabflpGV26nK164eRs5GiaRSBGpOxQ3pKoSnnyZN5pg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Globalization.Calendars\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"L1c6IqeQ88vuzC1P81JeHmHA8mxq8a18NUBNXnIY/BVb+TCyAaGIFbhpZt60h9FJNmisymoQkHEFSE9Vslja1Q==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.IO\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"3KlTJceQc3gnGIaHZ7UBZO26SHL1SHE4ddrmiwumFnId+CEHP+O8r386tZKaE6zlk5/mF8vifMBzHj9SaXN+mQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.IO.FileSystem\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"IBErlVq5jOggAD69bg1t0pJcHaDbJbWNUZTPI96fkYWzwYbN6D9wRHMULLDd9dHsl7C2YsxXL31LMfPI1SWt8w==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.IO.FileSystem.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"kWkKD203JJKxJeE74p8aF8y4Qc9r9WQx4C0cHzHPrY3fv/L/IhWnyCHaFJ3H1QPOH6A93whlQ2vG5nHlBDvzWQ==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Linq\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"bQ0iYFOQI0nuTnt+NQADns6ucV4DUvMdwN6CbkB1yj8i7arTGiTN5eok1kQwdnnNWSDZfIUySQY+J3d5KjWn0g==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\"\n        }\n      },\n      \"System.Linq.Expressions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"I+y02iqkgmCAyfbqOmSDOgqdZQ5tTj80Akm5BPSS8EeB0VGWdy6X1KCoYe8Pk6pwDoAKZUOdLVxnTJcExiv5zw==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.ObjectModel\": \"4.0.12\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Emit\": \"4.0.1\",\n          \"System.Reflection.Emit.ILGeneration\": \"4.0.1\",\n          \"System.Reflection.Emit.Lightweight\": \"4.0.1\",\n          \"System.Reflection.Extensions\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Reflection.TypeExtensions\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.ObjectModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.12\",\n        \"contentHash\": \"tAgJM1xt3ytyMoW4qn4wIqgJYm7L7TShRZG4+Q4Qsi2PCcj96pXN7nRywS9KkB3p/xDUjc2HSwP9SROyPYDYKQ==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Reflection\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"JCKANJ0TI7kzoQzuwB/OoJANy1Lg338B6+JVacPl4TpUwi3cReg3nMLplMq2uqYfHFQpKIlHAUVAJlImZz/4ng==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Emit\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"P2wqAj72fFjpP6wb9nSfDqNBMab+2ovzSDzUZK7MVIm54tBJEPr9jWfSjjoTpPwj1LeKcmX3vr0ttyjSSFM47g==\",\n        \"dependencies\": {\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Emit.ILGeneration\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Emit.ILGeneration\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"Ov6dU8Bu15Bc7zuqttgHF12J5lwSWyTf1S+FJouUXVMSqImLZzYaQ+vRr1rQ0OZ0HqsrwWl4dsKHELckQkVpgA==\",\n        \"dependencies\": {\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Emit.Lightweight\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"sSzHHXueZ5Uh0OLpUQprhr+ZYJrLPA2Cmr4gn0wj9+FftNKXx8RIMKvO9qnjk2ebPYUjZ+F2ulGdPOsvj+MEjA==\",\n        \"dependencies\": {\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Emit.ILGeneration\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"GYrtRsZcMuHF3sbmRHfMYpvxZoIN2bQGrYGerUiWLEkqdEUQZhH3TRSaC/oI4wO0II1RKBPlpIa1TOMxIcOOzQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Metadata\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.0\",\n        \"contentHash\": \"jMSCxA4LSyKBGRDm/WtfkO03FkcgRzHxwvQRib1bm2GZ8ifKM1MX1al6breGCEQK280mdl9uQS7JNPXRYk90jw==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Collections.Immutable\": \"1.2.0\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Extensions\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Text.Encoding.Extensions\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Reflection.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"4inTox4wTBaDhB7V3mPvp9XlCbeGYWVEM9/fXALd52vNEAVisc1BoVWQPuUuD0Ga//dNbA/WeMy9u9mzLxGTHQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.TypeExtensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"tsQ/ptQ3H5FYfON8lL4MxRk/8kFyE0A+tGPXmVP967cT/gzLHYxIejIYSxp4JmIeFHVP78g/F2FE1mUUTbDtrg==\",\n        \"dependencies\": {\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Resources.ResourceManager\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"TxwVeUNoTgUOdQ09gfTjvW411MF+w9MBYL7AtNVc+HtBCFlutPLhUCdZjNkjbhj3bNQWMdHboF0KIWEOjJssbA==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Runtime\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"v6c/4Yaa9uWsq+JMhnOFewrYkgdNHNG2eMKuNqRn8P733rNXeRCGvV5FkkjBXn2dbVkPXOsO0xjsEeM1q2zC0g==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\"\n        }\n      },\n      \"System.Runtime.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"CUOHjTT/vgP0qGW22U4/hDlOqXmcPq5YicBaXdUR2UiUoLwBT+olO6we4DVbq57jeX5uXH2uerVZhf0qGj+sVQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Runtime.Handles\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"nCJvEKguXEvk2ymk1gqj625vVnlK3/xdGzx0vOKicQkoquaTBJTP13AIYkocSUwHCLNBwUbXTqTWGDxBTWpt7g==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Runtime.InteropServices\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"16eu3kjHS633yYdkjwShDHZLRNMKVi/s0bY8ODiqJ2RfMhDMAwxZaUaWVnZ2P71kr/or+X9o/xFWtNqz8ivieQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\"\n        }\n      },\n      \"System.Runtime.Numerics\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"+XbKFuzdmLP3d1o9pdHu2nxjNr2OEPqGzKeegPLCUMM71a0t50A/rOcIRmGs9wR7a8KuHX6hYs/7/TymIGLNqg==\",\n        \"dependencies\": {\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\"\n        }\n      },\n      \"System.Security.Cryptography.Algorithms\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.2.0\",\n        \"contentHash\": \"8JQFxbLVdrtIOKMDN38Fn0GWnqYZw/oMlwOUG/qz1jqChvyZlnUmu+0s7wLx7JYua/nAXoESpHA3iw11QFWhXg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Runtime.Numerics\": \"4.0.1\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"runtime.native.System.Security.Cryptography\": \"4.0.0\"\n        }\n      },\n      \"System.Security.Cryptography.Cng\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.2.0\",\n        \"contentHash\": \"cUJ2h+ZvONDe28Szw3st5dOHdjndhJzQ2WObDEXAWRPEQBtVItVoxbXM/OEsTthl3cNn2dk2k0I3y45igCQcLw==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\"\n        }\n      },\n      \"System.Security.Cryptography.Csp\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"/i1Usuo4PgAqgbPNC0NjbO3jPW//BoBlTpcWFD1EHVbidH21y4c1ap5bbEMSGAXjAShhMH4abi/K8fILrnu4BQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Security.Cryptography.Encoding\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"FbKgE5MbxSQMPcSVRgwM6bXN3GtyAh04NkV8E5zKCBE26X0vYW0UtTa2FIgkH33WVqBVxRgxljlVYumWtU+HcQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.Collections.Concurrent\": \"4.0.12\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"runtime.native.System.Security.Cryptography\": \"4.0.0\"\n        }\n      },\n      \"System.Security.Cryptography.OpenSsl\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"HUG/zNUJwEiLkoURDixzkzZdB5yGA5pQhDP93ArOpDPQMteURIGERRNzzoJlmTreLBWr5lkFSjjMSk8ySEpQMw==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Runtime.Numerics\": \"4.0.1\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"runtime.native.System.Security.Cryptography\": \"4.0.0\"\n        }\n      },\n      \"System.Security.Cryptography.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"Wkd7QryWYjkQclX0bngpntW5HSlMzeJU24UaLJQ7YTfI8ydAVAaU2J+HXLLABOVJlKTVvAeL0Aj39VeTe7L+oA==\",\n        \"dependencies\": {\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Security.Cryptography.X509Certificates\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"4HEfsQIKAhA1+ApNn729Gi09zh+lYWwyIuViihoMDWp1vQnEkL2ct7mAbhBlLYm+x/L4Rr/pyGge1lIY635e0w==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Globalization.Calendars\": \"4.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Runtime.Numerics\": \"4.0.1\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Cng\": \"4.2.0\",\n          \"System.Security.Cryptography.Csp\": \"4.0.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.OpenSsl\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\",\n          \"runtime.native.System\": \"4.0.0\",\n          \"runtime.native.System.Net.Http\": \"4.0.1\",\n          \"runtime.native.System.Security.Cryptography\": \"4.0.0\"\n        }\n      },\n      \"System.Text.Encoding\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"U3gGeMlDZXxCEiY4DwVLSacg+DFWCvoiX+JThA/rvw37Sqrku7sEFeVBBBMBnfB6FeZHsyDx85HlKL19x0HtZA==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Text.Encoding.CodePages\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"h4z6rrA/hxWf4655D18IIZ0eaLRa3tQC/j+e26W+VinIHY0l07iEXaAvO0YSYq3MvCjMYy8Zs5AdC1sxNQOB7Q==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Text.Encoding.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"jtbiTDtvfLYgXn8PTfWI+SiBs51rrmO4AAckx4KR6vFK9Wzf6tI8kcRdsYQNwriUeQ1+CtQbM1W4cMbLXnj/OQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\"\n        }\n      },\n      \"System.Text.RegularExpressions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"i88YCXpRTjCnoSQZtdlHkAOx4KNNik4hMy83n0+Ftlb7jvV6ZiZWMpnEZHhjBp6hQVh8gWd/iKNPzlPF7iyA2g==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Threading\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"N+3xqIcg3VDKyjwwCGaZ9HawG9aC6cSDI+s7ROma310GQo8vilFZa86hqKppwTHleR/G0sfOzhvgnUxWCR/DrQ==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Threading.Tasks\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"k1S4Gc6IGwtHGT8188RSeGaX86Qw/wnrgNLshJvsdNUOPP9etMmo8S07c+UlOAx4K/xLuN9ivA1bD0LVurtIxQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Threading.Tasks.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"pH4FZDsZQ/WmgJtN4LWYmRdJAEeVkyriSwrv2Teoe5FOU0Yxlb6II6GL8dBPOfRmutHGATduj3ooMt7dJ2+i+w==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Threading.Tasks.Parallel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"7Pc9t25bcynT9FpMvkUw4ZjYwUiGup/5cJFW72/5MgCG+np2cfVUMdh29u8d7onxX7d8PS3J+wL73zQRqkdrSA==\",\n        \"dependencies\": {\n          \"System.Collections.Concurrent\": \"4.0.12\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Diagnostics.Tracing\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Threading.Thread\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"gIdJqDXlOr5W9zeqFErLw3dsOsiShSCYtF9SEHitACycmvNvY8odf9kiKvp6V7aibc8C4HzzNBkWXjyfn7plbQ==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Xml.ReaderWriter\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"ZIiLPsf67YZ9zgr31vzrFaYQqxRPX9cVHjtPSnmx4eN6lbS/yEyYNr2vs1doGDEscF0tjCZFsk9yUg1sC9e8tg==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Text.Encoding.Extensions\": \"4.0.11\",\n          \"System.Text.RegularExpressions\": \"4.1.0\",\n          \"System.Threading.Tasks\": \"4.0.11\",\n          \"System.Threading.Tasks.Extensions\": \"4.0.0\"\n        }\n      },\n      \"System.Xml.XDocument\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"Mk2mKmPi0nWaoiYeotq1dgeNK1fqWh61+EK+w4Wu8SWuTYLzpUnschb59bJtGywaPq7SmTuPf44wrXRwbIrukg==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Diagnostics.Tools\": \"4.0.1\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\"\n        }\n      },\n      \"System.Xml.XmlDocument\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"2eZu6IP+etFVBBFUFzw2w6J21DqIN5eL9Y8r8JfJWUmV28Z5P0SNU01oCisVHQgHsDhHPnmq2s1hJrJCFZWloQ==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\"\n        }\n      },\n      \"System.Xml.XPath\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"UWd1H+1IJ9Wlq5nognZ/XJdyj8qPE4XufBUkAW59ijsCPjZkZe0MUzKKJFBr+ZWBe5Wq1u1d5f2CYgE93uH7DA==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\"\n        }\n      },\n      \"System.Xml.XPath.XDocument\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"FLhdYJx4331oGovQypQ8JIw2kEmNzCsjVOVYY/16kZTUoquZG85oVn7yUhBE2OZt1yGPSXAL0HTEfzjlbNpM7Q==\",\n        \"dependencies\": {\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\",\n          \"System.Xml.XDocument\": \"4.0.11\",\n          \"System.Xml.XPath\": \"4.0.1\"\n        }\n      },\n      \"sonaranalyzer.cfg\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer.Lightup\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.core\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Google.Protobuf\": \"[3.6.1, )\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.CFG\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer.lightup\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Common/DescriptorFactory.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Analyzers;\n\nnamespace SonarAnalyzer.CSharp.Styling.Common;\n\ninternal static class DescriptorFactory\n{\n    public static DiagnosticDescriptor Create(string id, string messageFormat, SourceScope scope = SourceScope.All, bool isCompilationEnd = false) =>\n        DiagnosticDescriptorFactory.Create(\n            AnalyzerLanguage.CSharp,\n            new RuleDescriptor(id, $\"Internal Styling Rule {id}\", \"CODE_SMELL\", \"Major\", null, scope, true, null),\n            messageFormat,\n            true,\n            false,\n            isCompilationEnd);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Common/OrderDescriptor.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Common;\n\ninternal sealed record OrderDescriptor(int Value, string Description);\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Common/StylingAnalyzer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Analyzers;\n\nnamespace SonarAnalyzer.CSharp.Styling.Common;\n\npublic abstract class StylingAnalyzer : SonarDiagnosticAnalyzer\n{\n    public sealed override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    protected DiagnosticDescriptor Rule { get; }\n\n    protected StylingAnalyzer(string id, string messageFormat, SourceScope scope = SourceScope.All) =>\n       Rule = DescriptorFactory.Create(id, messageFormat, scope);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Extensions/LambdaExpressionSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Extensions;\n\npublic static class LambdaExpressionSyntaxExtensions\n{\n    public static bool IsAnalysisContextAction(this LambdaExpressionSyntax node, SemanticModel model) =>\n        model.GetSymbolInfo(node).Symbol is IMethodSymbol { ReturnsVoid: true } symbol\n        && IsAnalysisContextName(symbol.Parameters.Single().Type.Name);\n\n    private static bool IsAnalysisContextName(string name) =>\n        name.EndsWith(\"AnalysisContext\") || (name.StartsWith(\"Sonar\") && name.EndsWith(\"ReportingContext\"));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Extensions/MemberDeclarationSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Extensions;\n\ninternal static class MemberDeclarationSyntaxExtensions\n{\n    public static OrderDescriptor ComputeOrder(this MemberDeclarationSyntax member)\n    {\n        if (member.Modifiers.Any(SyntaxKind.ProtectedKeyword))  // protected, protected internal or private protected\n        {\n            return new(3, \"protected\");\n        }\n        else if (member.Modifiers.Any(SyntaxKind.PublicKeyword))\n        {\n            return new(1, \"public\");\n        }\n        else if (member.Modifiers.Any(SyntaxKind.InternalKeyword))\n        {\n            return new(2, \"internal\");\n        }\n        else // private or unspecified\n        {\n            return new(4, \"private\");\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Extensions/SyntaxNodeExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Extensions;\n\ninternal static class SyntaxNodeExtensions\n{\n    public static bool HasSameStartLineAs(this SyntaxNode first, SyntaxNode second) =>\n        first.GetLocation().StartLine() == second.GetLocation().StartLine();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/AllArgumentsOnSameLine.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class AllArgumentsOnSameLine : StylingAnalyzer\n{\n    public AllArgumentsOnSameLine() : base(\"T0028\", \"All arguments should be on the same line or on separate lines.\") { }\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(c => Verify(c, ((BaseArgumentListSyntax)c.Node).Arguments), SyntaxKind.ArgumentList);\n        context.RegisterNodeAction(c => Verify(c, ((BracketedArgumentListSyntax)c.Node).Arguments), SyntaxKind.BracketedArgumentList);\n        context.RegisterNodeAction(c => Verify(c, ((TypeArgumentListSyntax)c.Node).Arguments), SyntaxKind.TypeArgumentList);\n        context.RegisterNodeAction(c => Verify(c, ((AttributeArgumentListSyntax)c.Node).Arguments), SyntaxKind.AttributeArgumentList);\n    }\n\n    private void Verify(SonarSyntaxNodeReportingContext context, IEnumerable<SyntaxNode> arguments)\n    {\n        var args = arguments.ToArray();\n        if (args.Length < 2)\n        {\n            return;\n        }\n        var multiline = args[0].GetLocation().StartLine() != args.Last().GetLocation().StartLine();\n        foreach (var arg in args)\n        {\n            if (IsOnNewLine(arg) != multiline && arg.ChildNodes().All(x => !IsIgnored(context.Model, x)))\n            {\n                context.ReportIssue(Rule, arg);\n            }\n        }\n    }\n\n    private static bool IsOnNewLine(SyntaxNode node) =>\n        node.GetLocation().StartLine() != node.GetFirstToken().GetPreviousToken().GetLocation().StartLine();\n\n    private static bool IsIgnored(SemanticModel model, SyntaxNode node) =>\n        node switch\n        {\n            LambdaExpressionSyntax lambda => lambda.IsAnalysisContextAction(model),\n            InterpolatedStringExpressionSyntax interpolated => interpolated.StringStartToken.Line() != interpolated.StringEndToken.Line()\n                                                                && interpolated.StringEndToken.IsKind(SyntaxKind.InterpolatedRawStringEndToken),\n            LiteralExpressionSyntax literal => literal.GetFirstToken().IsKind(SyntaxKind.MultiLineRawStringLiteralToken),\n            _ => false\n        };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/AllParametersBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\npublic abstract class AllParametersBase : StylingAnalyzer\n{\n    protected abstract void Verify(SonarSyntaxNodeReportingContext context, SyntaxNode[] parameters);\n\n    protected AllParametersBase(string id, string messageFormat) : base(id, messageFormat) { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            c => Verify(c, Parameters(c.Node).ToArray()),\n            SyntaxKind.ParameterList,\n            SyntaxKind.BracketedParameterList,\n            SyntaxKind.TypeParameterList,\n            SyntaxKind.FunctionPointerParameterList);\n\n    private static IEnumerable<SyntaxNode> Parameters(SyntaxNode node) =>\n        node switch\n        {\n            FunctionPointerParameterListSyntax list => list.Parameters,\n            TypeParameterListSyntax list => list.Parameters,\n            BaseParameterListSyntax list => list.Parameters,\n            _ => throw new UnexpectedValueException(nameof(node), node?.GetType().ToString())\n        };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/AllParametersOnSameColumn.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class AllParametersOnSameColumn : AllParametersBase\n{\n    public AllParametersOnSameColumn() : base(\"T0022\", \"Parameters should start on the same column.\") { }\n\n    protected override void Verify(SonarSyntaxNodeReportingContext context, SyntaxNode[] parameters)\n    {\n        foreach (var parameter in parameters.Skip(1))\n        {\n            if (!parameters[0].HasSameStartLineAs(parameter) && !IsSameColumn(parameters[0], parameter))\n            {\n                context.ReportIssue(Rule, parameter);\n            }\n        }\n    }\n\n    private static bool IsSameColumn(SyntaxNode first, SyntaxNode second) =>\n        first.GetLocation().StartColumn() == second.GetLocation().StartColumn();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/AllParametersOnSameLine.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class AllParametersOnSameLine : AllParametersBase\n{\n    public AllParametersOnSameLine() : base(\"T0023\", \"Parameters should be on the same line or all on separate lines.\") { }\n\n    protected override void Verify(SonarSyntaxNodeReportingContext context, SyntaxNode[] parameters)\n    {\n        if (parameters.Length < 3)\n        {\n            return;\n        }\n\n        var isSameLine = parameters[0].HasSameStartLineAs(parameters[1]);\n        for (var i = 2; i < parameters.Length; i++)\n        {\n            if (isSameLine != parameters[i - 1].HasSameStartLineAs(parameters[i]))\n            {\n                context.ReportIssue(Rule, parameters[i]);\n                return;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/ArrowLocation.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ArrowLocation : StylingAnalyzer\n{\n    public ArrowLocation() : base(\"T0002\", \"Place the arrow at the end of the previous line.\") { }\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(c => Verify(c, ((LambdaExpressionSyntax)c.Node).ArrowToken), SyntaxKind.SimpleLambdaExpression);\n        context.RegisterNodeAction(c => Verify(c, ((LambdaExpressionSyntax)c.Node).ArrowToken), SyntaxKind.ParenthesizedLambdaExpression);\n        context.RegisterNodeAction(c => Verify(c, ((ArrowExpressionClauseSyntax)c.Node).ArrowToken), SyntaxKind.ArrowExpressionClause);\n        context.RegisterNodeAction(c => Verify(c, ((SwitchExpressionArmSyntax)c.Node).EqualsGreaterThanToken), SyntaxKind.SwitchExpressionArm);\n    }\n\n    private void Verify(SonarSyntaxNodeReportingContext context, SyntaxToken arrowToken)\n    {\n        if (!arrowToken.IsMissing && arrowToken.IsFirstTokenOnLine())\n        {\n            context.ReportIssue(Rule, arrowToken);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/AvoidArrangeActAssertComment.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text.RegularExpressions;\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class AvoidArrangeActAssertComment : StylingAnalyzer\n{\n    private static readonly Regex WordRegex = new(@\"\\b(\\w+)\\b\", RegexOptions.None, Constants.DefaultRegexTimeout);\n    private static readonly HashSet<string> ForbiddenComments = [\"Arrange\", \"Act\", \"Assert\"];\n\n    public AvoidArrangeActAssertComment() : base(\"T0044\", \"Remove this Arrange, Act, Assert comment.\", SourceScope.Tests) { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var comments = c.Node\n                    .DescendantTrivia()\n                    .Where(x => x.IsComment() && !ExtractWords(x).Except(ForbiddenComments, StringComparer.OrdinalIgnoreCase).Any());\n\n                foreach (var comment in comments)\n                {\n                    c.ReportIssue(Rule, comment.GetLocation());\n                }\n            },\n            SyntaxKind.MethodDeclaration);\n\n    private static string[] ExtractWords(SyntaxTrivia comment) =>\n        WordRegex.SafeMatches(comment.ToString())\n            .Cast<Match>()\n            .Where(x => x.Success)\n            .Select(x => x.Groups[1].Value)\n            .ToArray();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/AvoidDeconstruction.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Core.Syntax.Utilities;\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class AvoidDeconstruction : StylingAnalyzer\n{\n    private const string DiscardMessage = \"It's pointless.\";\n    private const string VariableMessage = \"Reference the member from the instance instead.\";\n\n    public AvoidDeconstruction() : base(\"T0035\", \"Don't use this deconstruction. {0}\") { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var varPattern = (VarPatternSyntax)c.Node;\n                if (varPattern.Parent is not IsPatternExpressionSyntax and not SwitchExpressionArmSyntax)\n                {\n                    if (varPattern.Designation is DiscardDesignationSyntax)\n                    {\n                        c.ReportIssue(Rule, c.Node, DiscardMessage);\n                    }\n                    else if (varPattern.Designation is SingleVariableDesignationSyntax variable && !IsUsedEnough(c, variable))\n                    {\n                        c.ReportIssue(Rule, c.Node, VariableMessage);\n                    }\n                }\n            },\n            SyntaxKind.VarPattern);\n\n    private static bool IsUsedEnough(SonarSyntaxNodeReportingContext context, SingleVariableDesignationSyntax variable)\n    {\n        if (context.Node.Ancestors().FirstOrDefault(x => x is BlockSyntax or ArrowExpressionClauseSyntax or LambdaExpressionSyntax) is { } root\n            && context.Model.GetDeclaredSymbol(variable) is { } symbol)\n        {\n            var walker = new IdentifierWalker(context.Model, symbol);\n            walker.SafeVisit(root);\n            return walker.IsUsedEnough;\n        }\n        else\n        {\n            return false;\n        }\n    }\n}\n\nfile sealed class IdentifierWalker : SafeCSharpSyntaxWalker\n{\n    private const int MinUsageCount = 3;\n\n    private readonly SemanticModel model;\n    private readonly ISymbol symbol;\n    private int usageCount;\n\n    public bool IsUsedEnough => usageCount >= MinUsageCount;\n\n    public IdentifierWalker(SemanticModel model, ISymbol symbol)\n    {\n        this.model = model;\n        this.symbol = symbol;\n    }\n\n    public override void Visit(SyntaxNode node)\n    {\n        if (!IsUsedEnough)  // Performance: Stop searching once we know the answer\n        {\n            base.Visit(node);\n        }\n    }\n\n    public override void VisitIdentifierName(IdentifierNameSyntax node)\n    {\n        if (node.Identifier.ValueText == symbol.Name\n            && model.GetSymbolInfo(node).Symbol is { } nodeSymbol\n            && symbol.Equals(nodeSymbol, SymbolEqualityComparer.Default))\n        {\n            usageCount++;\n        }\n        base.VisitIdentifierName(node);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/AvoidGet.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class AvoidGet : StylingAnalyzer\n{\n    public AvoidGet() : base(\"T0000\", \"Do not use 'Get' prefix. Just don't.\") { }\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(c => Process(c, ((MethodDeclarationSyntax)c.Node).Identifier), SyntaxKind.MethodDeclaration);\n        context.RegisterNodeAction(c => Process(c, ((LocalFunctionStatementSyntax)c.Node).Identifier), SyntaxKind.LocalFunctionStatement);\n    }\n\n    private void Process(SonarSyntaxNodeReportingContext context, SyntaxToken identifier)\n    {\n        if (HasGetPrefix(identifier.ValueText) && !IgnoreMethod((IMethodSymbol)context.ContainingSymbol))\n        {\n            context.ReportIssue(Rule, identifier);\n        }\n    }\n\n    private static bool HasGetPrefix(string name) =>\n        name.Length > 4 && name.StartsWith(\"Get\") && !char.IsLower(name[3]);\n\n    private static bool IgnoreMethod(IMethodSymbol method) =>\n        method.ReturnsVoid\n        || method.IsOverride\n        || method.ExplicitOrImplicitInterfaceImplementations().Any();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/AvoidListForEach.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class AvoidListForEach : StylingAnalyzer\n{\n    public AvoidListForEach() : base(\"T0011\", \"Use 'foreach' iteration instead of 'List.ForEach'.\") { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var name = ((MemberAccessExpressionSyntax)c.Node).Name;\n                if (name.Identifier.ValueText == nameof(List<int>.ForEach)\n                    && c.Model.GetSymbolInfo(name).Symbol is IMethodSymbol method\n                    && method.Is(KnownType.System_Collections_Generic_List_T, nameof(List<int>.ForEach)))\n                {\n                    c.ReportIssue(Rule, name);\n                }\n            },\n            SyntaxKind.SimpleMemberAccessExpression);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/AvoidNullable.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class AvoidNullable : StylingAnalyzer\n{\n    public AvoidNullable() : base(\"T0036\", \"Do not use nullable context.\") { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                if (((NullableDirectiveTriviaSyntax)c.Node).SettingToken.IsKind(SyntaxKind.EnableKeyword))\n                {\n                    c.ReportIssue(Rule, c.Node);\n                }\n            },\n            SyntaxKind.NullableDirectiveTrivia);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/AvoidPrimaryConstructor.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class AvoidPrimaryConstructor : StylingAnalyzer\n{\n    public AvoidPrimaryConstructor() : base(\"T0043\", \"Do not use primary constructors.\") { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n        {\n            if (c.Node.Parent is ClassDeclarationSyntax or StructDeclarationSyntax)\n            {\n                c.ReportIssue(Rule, c.Node);\n            }\n        }, SyntaxKind.ParameterList);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/AvoidUnusedInterpolation.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class AvoidUnusedInterpolation : StylingAnalyzer\n{\n    private const string ReduceMessage = \"Reduce the number of $ in this string.\";\n    private const string RemoveMessage = \"Remove unused interpolation from this string.\";\n\n    public AvoidUnusedInterpolation() : base(\"T0040\", \"{0}\") { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var interpolated = (InterpolatedStringExpressionSyntax)c.Node;\n                if (interpolated.Contents.OfType<InterpolationSyntax>().IsEmpty())\n                {\n                    c.ReportIssue(Rule, interpolated.StringStartToken, RemoveMessage);\n                }\n                else if (DollarCount(interpolated) > CurlyBraceCount(interpolated) + 1)\n                {\n                    c.ReportIssue(Rule, interpolated.StringStartToken, ReduceMessage);\n                }\n            }, SyntaxKind.InterpolatedStringExpression);\n\n    private static int DollarCount(InterpolatedStringExpressionSyntax interpolated) =>\n        interpolated.StringStartToken.ValueText.Count(x => x == '$');\n\n    private static int CurlyBraceCount(InterpolatedStringExpressionSyntax interpolated)\n    {\n        var max = 0;\n        foreach (var text in interpolated.Contents.OfType<InterpolatedStringTextSyntax>())\n        {\n            max = Math.Max(max, CurlyBraceCount(text.TextToken.ValueText));\n        }\n        return max;\n    }\n\n    private static int CurlyBraceCount(string text)\n    {\n        var max = 0;\n        var i = 0;\n        while (i < text.Length)\n        {\n            max = Math.Max(max, Count('{'));\n            max = Math.Max(max, Count('}'));\n            if (i < text.Length && text[i] != '{')\n            {\n                i++;\n            }\n        }\n        return max;\n\n        int Count(char c)\n        {\n            var count = 0;\n            while (i < text.Length && text[i] == c)\n            {\n                count++;\n                i++;\n            }\n            return count;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/AvoidValueTuple.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class AvoidValueTuple : StylingAnalyzer\n{\n    public AvoidValueTuple() : base(\"T0003\", \"Do not use ValueTuple in the production code due to missing System.ValueTuple.dll.\", SourceScope.Main) { }    // It's not a problem in UTs\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c => c.ReportIssue(Rule, c.Node), SyntaxKind.TupleType, SyntaxKind.TupleExpression);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/AvoidVarPattern.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class AvoidVarPattern : StylingAnalyzer\n{\n    public AvoidVarPattern() : base(\"T0034\", \"Avoid embedding this var pattern. Declare it in var statement instead.\") { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                if (c.Node.Parent is IsPatternExpressionSyntax && CanBeExtracted(c.Node.Parent))\n                {\n                    c.ReportIssue(Rule, c.Node);\n                }\n            },\n            SyntaxKind.VarPattern);\n\n    private static bool CanBeExtracted(SyntaxNode node)\n    {\n        if (node.Parent is BinaryExpressionSyntax { Parent: not BinaryExpressionSyntax } binaryLast && binaryLast.Right == node)\n        {\n            node = node.Parent;\n        }\n        else\n        {\n            while (node.Parent is BinaryExpressionSyntax binaryFirst && binaryFirst.Left == node)\n            {\n                node = node.Parent;\n            }\n        }\n        return node.Parent is IfStatementSyntax { Parent: not ElseClauseSyntax } or WhileStatementSyntax or ForStatementSyntax;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/FieldOrdering.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class FieldOrdering : StylingAnalyzer\n{\n    public FieldOrdering() : base(\"T0013\", \"Move this static field above the {0} instance ones.\") { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            ValidateMembers,\n            SyntaxKind.ClassDeclaration,\n            SyntaxKind.RecordDeclaration,\n            SyntaxKind.RecordStructDeclaration,\n            SyntaxKind.StructDeclaration);\n\n    private void ValidateMembers(SonarSyntaxNodeReportingContext context)\n    {\n        var fields = ((TypeDeclarationSyntax)context.Node).Members.OfType<FieldDeclarationSyntax>().Where(x => !x.Modifiers.Any(SyntaxKind.ConstKeyword));\n        foreach (var visibilityGroup in fields.GroupBy(x => x.ComputeOrder()))\n        {\n            ValidateMembers(context, visibilityGroup.Key, visibilityGroup);\n        }\n    }\n\n    private void ValidateMembers(SonarSyntaxNodeReportingContext context, OrderDescriptor order, IEnumerable<FieldDeclarationSyntax> members)\n    {\n        var hasInstance = false;\n        foreach (var member in members)\n        {\n            if (member.Modifiers.Any(SyntaxKind.StaticKeyword))\n            {\n                if (hasInstance)\n                {\n                    context.ReportIssue(Rule, member.Declaration, order.Description);\n                }\n            }\n            else\n            {\n                hasInstance = true;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/FileScopeNamespace.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class FileScopeNamespace : StylingAnalyzer\n{\n    public FileScopeNamespace() : base(\"T0001\", \"Use file-scoped namespace.\") { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            c => c.ReportIssue(Rule, ((NamespaceDeclarationSyntax)c.Node).Name),\n            SyntaxKind.NamespaceDeclaration);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/HelperInTypeName.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class HelperInTypeName : StylingAnalyzer\n{\n    public HelperInTypeName() : base(\"T0006\", \"Do not use 'Helper' in type names.\") { }\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(c =>\n            {\n                if (c.Node.GetIdentifier() is { } identifier && identifier.ValueText.Contains(\"Helper\"))\n                {\n                    c.ReportIssue(Rule, identifier);\n                }\n            },\n            SyntaxKind.UsingDirective,\n            SyntaxKind.ClassDeclaration,\n            SyntaxKind.RecordStructDeclaration,\n            SyntaxKind.EnumDeclaration,\n            SyntaxKind.StructDeclaration,\n            SyntaxKind.RecordDeclaration,\n            SyntaxKind.InterfaceDeclaration);\n\n        context.RegisterNodeAction(c =>\n            {\n                var name = c.Node switch\n                {\n                    NamespaceDeclarationSyntax ns => ns.Name,\n                    FileScopedNamespaceDeclarationSyntax ns => ns.Name\n                };\n                if (name.ToString().Contains(\"Helper\"))\n                {\n                    c.ReportIssue(Rule, name);\n                }\n            },\n            SyntaxKind.NamespaceDeclaration,\n            SyntaxKind.FileScopedNamespaceDeclaration);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/IndentArgument.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class IndentArgument : IndentBase\n{\n    public IndentArgument() : base(\"T0029\", \"argument\") { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                if (ExpectedPosition(c.Node) is { } expected)\n                {\n                    Verify(c, expected, c.Node.GetFirstToken(), c.Node);\n                    if (c.Node is ArgumentSyntax argument\n                        && argument.Expression is LambdaExpressionSyntax lambda\n                        && (lambda.Body ?? lambda.ExpressionBody) is { } expressionOrBody)\n                    {\n                        Verify(c, expected, expressionOrBody.GetFirstToken(), expressionOrBody);\n                    }\n                }\n            },\n            SyntaxKind.Argument,\n            SyntaxKind.ExpressionElement);\n\n    protected override SyntaxNode NodeRoot(SyntaxNode node, SyntaxNode current) =>\n        current switch\n        {\n            ForStatementSyntax => node.Ancestors().OfType<InvocationExpressionSyntax>().FirstOrDefault(),\n            InvocationExpressionSyntax { Expression: MemberAccessExpressionSyntax memberAccess } when FirstMemberOnLine(memberAccess) is { } member => member,\n            ObjectCreationExpressionSyntax or BaseObjectCreationExpressionSyntax when current.GetFirstToken().IsFirstTokenOnLine() => current,\n            CollectionExpressionSyntax when node is ExpressionElementSyntax && !current.GetFirstToken().IsFirstTokenOnLine() && FirstMemberOnLine(current) is { } member => member,\n            { Parent: ConditionalExpressionSyntax ternary } when ternary.WhenTrue == current || ternary.WhenFalse == current => current,\n            _ => base.NodeRoot(node, current),\n        };\n\n    private static SyntaxNode FirstMemberOnLine(SyntaxNode node) =>\n        node switch\n        {\n            ArgumentSyntax { Parent.Parent: { } grandParent } => FirstMemberOnLine(grandParent),\n            CollectionExpressionSyntax { Parent: { } parent } => FirstMemberOnLine(parent),\n            InvocationExpressionSyntax { Expression: { } expression } => FirstMemberOnLine(expression),\n            MemberAccessExpressionSyntax { Name: { } name } memberAccess when memberAccess.OperatorToken.IsFirstTokenOnLine() => name,\n            MemberAccessExpressionSyntax { Expression: { } expression } => FirstMemberOnLine(expression),\n            _ => null,\n        };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/IndentBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\npublic abstract class IndentBase : StylingAnalyzer\n{\n    protected IndentBase(string id, string expressionName) : base(id, $$\"\"\"Indent this {{expressionName}} at line position {0}.\"\"\") { }\n\n    protected void Verify(SonarSyntaxNodeReportingContext context, int expected, SyntaxToken token, SyntaxNode reportingLocationExpression = null)\n    {\n        if (token.IsFirstTokenOnLine() // Raise only when the line starts with this token to avoid collisions with T0024, T0027, etc.\n            && token.GetLocation().GetLineSpan().StartLinePosition.Character != expected)\n        {\n            context.ReportIssue(Rule, Location.Create(token.SyntaxTree, TextSpan.FromBounds(token.SpanStart, (reportingLocationExpression?.Span ?? token.Span).End)), (expected + 1).ToString());\n        }\n    }\n\n    protected virtual int Offset(SyntaxNode node, SyntaxNode root) =>\n        4;\n\n    protected int? ExpectedPosition(SyntaxNode node) =>\n        StatementRoot(node) is { } root\n            ? ExpectedPosition(root.GetLocation().GetLineSpan().StartLinePosition.Character, Offset(node, root))\n            : null;\n\n    protected static int ExpectedPosition(int character, int offset) =>\n        (character + offset) / 4 * 4;   // Nearest next tab distance\n\n    protected virtual SyntaxNode NodeRoot(SyntaxNode node, SyntaxNode current)\n    {\n        if (current is ForStatementSyntax)\n        {\n            return node;    // Root from the original node itself (ternary, binary, ...)\n        }\n        else if (current is StatementSyntax or AssignmentExpressionSyntax or SwitchExpressionArmSyntax\n            || current is ExpressionSyntax { Parent: IfStatementSyntax or WhileStatementSyntax }\n            || current.Parent is ArrowExpressionClauseSyntax or LambdaExpressionSyntax\n            || (current is InvocationExpressionSyntax or CollectionExpressionSyntax && current.GetFirstToken().IsFirstTokenOnLine()))\n        {\n            return current;\n        }\n        else\n        {\n            return null;\n        }\n    }\n\n    protected virtual bool IsIgnored(SyntaxNode node) =>\n        false;\n\n    private SyntaxNode StatementRoot(SyntaxNode node)\n    {\n        var current = node;\n        while (current is not null)\n        {\n            if (IsIgnored(current))\n            {\n                return null;\n            }\n            else if (NodeRoot(node, current) is { } result)\n            {\n                return result;\n            }\n            else\n            {\n                current = current.Parent;\n            }\n        }\n        return null;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/IndentInvocation.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class IndentInvocation : IndentBase\n{\n    public IndentInvocation() : base(\"T0026\", \"member access\") { }\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(c =>\n            {\n                var memberAccess = (MemberAccessExpressionSyntax)c.Node;\n                if (ExpectedPosition(memberAccess) is { } expected)\n                {\n                    Verify(c, expected, memberAccess.OperatorToken, memberAccess.Name);\n                }\n            },\n            SyntaxKind.SimpleMemberAccessExpression);\n        context.RegisterNodeAction(c =>\n            {\n                var memberBinding = (MemberBindingExpressionSyntax)c.Node;\n                if (ExpectedPosition(memberBinding) is { } expected)\n                {\n                    Verify(c, expected, memberBinding.OperatorToken, memberBinding.Name);\n                }\n            },\n            SyntaxKind.MemberBindingExpression);\n    }\n\n    protected override SyntaxNode NodeRoot(SyntaxNode node, SyntaxNode current)\n    {\n        if (current is InvocationExpressionSyntax { Parent: ConditionalAccessExpressionSyntax })\n        {\n            return null;\n        }\n        else if (current.Parent is ConditionalExpressionSyntax ternary && (ternary.WhenTrue == current || ternary.WhenFalse == current))\n        {\n            return current;\n        }\n        else if (current is BinaryExpressionSyntax binary && binary.OperatorToken.IsFirstTokenOnLine())\n        {\n            return binary;\n        }\n        else\n        {\n            return base.NodeRoot(node, current);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/IndentOperator.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class IndentOperator : IndentBase\n{\n    public IndentOperator() : base(\"T0019\", \"operator\") { }\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(c =>\n            {\n                var binary = (BinaryExpressionSyntax)c.Node;\n                if (ExpectedPosition(binary) is { } expected)\n                {\n                    Verify(c, expected, binary.OperatorToken, binary.Right);\n                }\n            },\n            SyntaxKind.LogicalAndExpression,\n            SyntaxKind.LogicalOrExpression,\n            SyntaxKind.BitwiseAndExpression,\n            SyntaxKind.BitwiseOrExpression,\n            SyntaxKind.ExclusiveOrExpression,\n            SyntaxKind.CoalesceExpression,\n            SyntaxKind.AddExpression,\n            SyntaxKind.LeftShiftExpression,\n            SyntaxKind.RightShiftExpression,\n            SyntaxKind.UnsignedRightShiftExpression,\n            SyntaxKind.SubtractExpression,\n            SyntaxKind.MultiplyExpression,\n            SyntaxKind.DivideExpression,\n            SyntaxKind.ModuloExpression,\n            SyntaxKind.EqualsExpression,\n            SyntaxKind.NotEqualsExpression,\n            SyntaxKind.GreaterThanExpression,\n            SyntaxKind.GreaterThanOrEqualExpression,\n            SyntaxKind.LessThanExpression,\n            SyntaxKind.LessThanOrEqualExpression,\n            SyntaxKind.AsExpression,\n            SyntaxKind.IsExpression);\n        context.RegisterNodeAction(c =>\n            {\n                var binary = (BinaryPatternSyntax)c.Node;\n                if (ExpectedPosition(binary) is { } expected)\n                {\n                    Verify(c, expected, binary.OperatorToken, binary.Right);\n                }\n            },\n            SyntaxKind.AndPattern,\n            SyntaxKind.OrPattern);\n        context.RegisterNodeAction(c =>\n            {\n                var isPattern = (IsPatternExpressionSyntax)c.Node;\n                if (ExpectedPosition(isPattern) is { } expected)\n                {\n                    Verify(c, expected, isPattern.IsKeyword);\n                }\n            },\n            SyntaxKind.IsPatternExpression);\n        context.RegisterNodeAction(c =>\n            {\n                var range = (RangeExpressionSyntax)c.Node;\n                if (ExpectedPosition(range) is { } expected)\n                {\n                    Verify(c, expected, range.OperatorToken, range.RightOperand);\n                }\n            },\n            SyntaxKind.RangeExpression);\n    }\n\n    protected override int Offset(SyntaxNode node, SyntaxNode root) =>\n        CoalesceRoot(node) == root\n            ? 3     // When rooted from the same expression, align itself to the same expression from the previous line\n            : 4;    // Otherwise force one tab, like in the base class\n\n    protected override SyntaxNode NodeRoot(SyntaxNode node, SyntaxNode current)\n    {\n        if (current is ArrowExpressionClauseSyntax { Parent: AccessorDeclarationSyntax })\n        {\n            return current.Parent;\n        }\n        else if (current is ArrowExpressionClauseSyntax or LambdaExpressionSyntax or ConditionalExpressionSyntax { Parent: not ReturnStatementSyntax } or ForStatementSyntax)\n        {\n            return CoalesceRoot(node);\n        }\n        else if (current is IfStatementSyntax { Parent: ElseClauseSyntax })\n        {\n            return null;\n        }\n        else if (current is ElseClauseSyntax)\n        {\n            return current;\n        }\n        else if (current is StatementSyntax or AssignmentExpressionSyntax or SwitchExpressionArmSyntax\n            || (current is InvocationExpressionSyntax or CollectionExpressionSyntax && current.GetFirstToken().IsFirstTokenOnLine()))\n        {\n            return current;\n        }\n        else if (current is ParenthesizedExpressionSyntax)\n        {\n            return current.GetSelfOrTopParenthesizedExpression();\n        }\n        else\n        {\n            return null;\n        }\n    }\n\n    private static SyntaxNode CoalesceRoot(SyntaxNode node)\n    {\n        // Coalesce expressions have right-associative tree, so the trick of returning \"node\" itself as the starting point doesn't work. We need to find the first in 'first ?? node ?? last'\n        while (node.Parent.IsKind(SyntaxKind.CoalesceExpression))\n        {\n            node = node.Parent;\n        }\n        return node;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/IndentRawString.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class IndentRawString : IndentBase\n{\n    public IndentRawString() : base(\"T0042\", \"raw string literal\") { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var token = c.Node.GetLastToken();\n                if (token.Kind() is SyntaxKind.MultiLineRawStringLiteralToken or SyntaxKind.InterpolatedRawStringEndToken or SyntaxKind.Utf8MultiLineRawStringLiteralToken\n                    && c.Node.GetLocation() is var location\n                    && location.StartLine() != location.EndLine()\n                    && ExpectedPosition(c.Node) is { } expected)\n                {\n                    var line = c.Node.SyntaxTree.GetText().Lines[token.GetLocation().GetLineSpan().EndLinePosition.Line];\n                    var actual = line.ToString().IndexOf(@\"\"\"\");\n\n                    if (actual != expected) // This does not support TAB characters\n                    {\n                        c.ReportIssue(Rule, Location.Create(token.SyntaxTree, new TextSpan(line.Start + actual, 3)), (expected + 1).ToString());\n                    }\n                }\n            },\n            SyntaxKind.StringLiteralExpression,\n            SyntaxKind.InterpolatedStringExpression,\n            SyntaxKind.Utf8StringLiteralExpression);\n\n    protected override bool IsIgnored(SyntaxNode node) =>\n        node is LambdaExpressionSyntax or IfStatementSyntax or WhileStatementSyntax or ForStatementSyntax;\n\n    protected override SyntaxNode NodeRoot(SyntaxNode node, SyntaxNode current)\n    {\n        if (current is StatementSyntax\n            or ObjectCreationExpressionSyntax { Parent: ArrowExpressionClauseSyntax }\n            or ImplicitObjectCreationExpressionSyntax { Parent: ArrowExpressionClauseSyntax }\n            or AssignmentExpressionSyntax\n            or SwitchExpressionArmSyntax)\n        {\n            return current;\n        }\n        else if (current is MemberAccessExpressionSyntax memberAccessOnRawString && memberAccessOnRawString.Expression == node)\n        {\n            return null;    // We don't want anything, when the invocation is on the raw string itself\n        }\n        else if (current is InvocationExpressionSyntax { Expression: MemberAccessExpressionSyntax invokedMemberAccessOnRawString } && invokedMemberAccessOnRawString.Expression == node)\n        {\n            return null;    // We don't want anything, when the invocation is on the raw string itself\n        }\n        else if (current is InvocationExpressionSyntax { Expression: MemberAccessExpressionSyntax memberAccess } && memberAccess.OperatorToken.IsFirstTokenOnLine())\n        {\n            return memberAccess.Name;   // Off by one due to the dot\n        }\n        else if (current is ArrowExpressionClauseSyntax)\n        {\n            return current.Parent;\n        }\n        else if (current.Parent is ConditionalExpressionSyntax ternary && (ternary.WhenTrue == current || ternary.WhenFalse == current))\n        {\n            return current; // This assumes that the '? \"\"\"' or ': \"\"\"' is positioned correctly, and indents from that\n        }\n        else if (current is not ArgumentSyntax and not ExpressionElementSyntax and not LiteralExpressionSyntax and not InterpolatedStringExpressionSyntax\n            && current.GetFirstToken().IsFirstTokenOnLine())\n        {\n            return current;\n        }\n        else\n        {\n            return null;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/IndentTernary.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class IndentTernary : IndentBase\n{\n    public IndentTernary() : base(\"T0025\", \"ternary\") { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var ternary = (ConditionalExpressionSyntax)c.Node;\n                if (ExpectedPosition(ternary) is { } expected)\n                {\n                    Verify(c, expected, ternary.QuestionToken, ternary.WhenTrue);\n                    Verify(c, expected, ternary.ColonToken, ternary.WhenFalse);\n                }\n            },\n            SyntaxKind.ConditionalExpression);\n\n    protected override SyntaxNode NodeRoot(SyntaxNode node, SyntaxNode current) =>\n        current == node && current.GetFirstToken().IsFirstTokenOnLine()\n            ? current\n            : base.NodeRoot(node, current);\n\n    private int? ExpectedPosition(ConditionalExpressionSyntax ternary)\n    {\n        if (ternary.Condition is BinaryExpressionSyntax binary && binary.OperatorToken.IsFirstTokenOnLine())\n        {\n            return ExpectedPosition(binary.OperatorToken.GetLocation().GetLineSpan().StartLinePosition.Character, 4);\n        }\n        else if (ternary.Condition.GetLocation() is var location && location.StartLine() != location.EndLine())\n        {\n            return null;    // Unexpected multiline condition => not known, not supported to avoid FPs\n        }\n        else\n        {\n            return base.ExpectedPosition(ternary);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/InitializerLine.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class InitializerLine : StylingAnalyzer\n{\n    private const int MaxLineLength = 200;  // According to S103\n\n    public InitializerLine() : base(\"T0030\", \"Move this {0} to the previous line.\") { }\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(c =>\n            {\n                foreach (var declarator in ((FieldDeclarationSyntax)c.Node).Declaration.Variables.Where(x => x.Initializer is not null))\n                {\n                    Verify(c, declarator.Initializer.Value, declarator.GetLocation().StartLine(), \"initializer\");\n                }\n            },\n            SyntaxKind.FieldDeclaration);\n        context.RegisterNodeAction(c =>\n            {\n                var property = (PropertyDeclarationSyntax)c.Node;\n                if (property.Initializer is not null)\n                {\n                    Verify(c, property.Initializer.Value, property.Identifier.GetLocation().StartLine(), \"initializer\");\n                }\n                if (property.ExpressionBody is not null)\n                {\n                    Verify(c, property.ExpressionBody.Expression, property.Identifier.GetLocation().StartLine(), \"expression\");\n                }\n            },\n            SyntaxKind.PropertyDeclaration);\n        context.RegisterNodeAction(c =>\n            {\n                var accessor = (AccessorDeclarationSyntax)c.Node;\n                if (accessor.ExpressionBody is not null)\n                {\n                    Verify(c, accessor.ExpressionBody.Expression, accessor.Keyword.GetLocation().StartLine(), \"expression\");\n                }\n            },\n            SyntaxKind.AddAccessorDeclaration,\n            SyntaxKind.GetAccessorDeclaration,\n            SyntaxKind.InitAccessorDeclaration,\n            SyntaxKind.RemoveAccessorDeclaration,\n            SyntaxKind.SetAccessorDeclaration);\n    }\n\n    private void Verify(SonarSyntaxNodeReportingContext context, ExpressionSyntax value, int expectedLine, string message)\n    {\n        if (MissplacedLocation(value, expectedLine) is { } location\n            && context.Node.SyntaxTree.GetText().Lines[expectedLine].Span.Length + location.SourceSpan.Length + 1 < MaxLineLength)\n        {\n            context.ReportIssue(Rule, location, message);\n        }\n    }\n\n    private static Location MissplacedLocation(ExpressionSyntax value, int expectedLine)\n    {\n        var valueLocation = value.GetLocation();\n        if (valueLocation.StartLine() == expectedLine)\n        {\n            return null;\n        }\n        else if (value is ObjectCreationExpressionSyntax objectCreation)\n        {\n            return Location.Create(value.SyntaxTree, TextSpan.FromBounds(objectCreation.NewKeyword.SpanStart, objectCreation.ArgumentList?.Span.End ?? objectCreation.Type.Span.End));\n        }\n        else if (value is ImplicitObjectCreationExpressionSyntax implicitObjectCreation)\n        {\n            return Location.Create(value.SyntaxTree, TextSpan.FromBounds(implicitObjectCreation.NewKeyword.SpanStart, implicitObjectCreation.ArgumentList.Span.End));\n        }\n        else if (valueLocation.StartLine() != valueLocation.EndLine())\n        {\n            return null;\n        }\n        else\n        {\n            return value.GetLocation();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/LambdaParameterName.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class LambdaParameterName : StylingAnalyzer\n{\n    public LambdaParameterName() : base(\"T0010\", \"Use 'x' for the lambda parameter name.\") { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                if (c.Node is SimpleLambdaExpressionSyntax { Parameter: { Identifier.ValueText: not (\"x\" or \"_\") } parameter, Parent: { } parent } lambda\n                    && parent.FirstAncestorOrSelf<LambdaExpressionSyntax>() is null\n                    && !lambda.IsAnalysisContextAction(c.Model)\n                    && !MatchesDelegateParameterName(c.Model, lambda))\n                {\n                    c.ReportIssue(Rule, parameter);\n                }\n            },\n            SyntaxKind.SimpleLambdaExpression);\n\n    private static bool MatchesDelegateParameterName(SemanticModel model, SimpleLambdaExpressionSyntax lambda) =>\n        model.GetTypeInfo(lambda).ConvertedType is INamedTypeSymbol\n        {\n            TypeKind: TypeKind.Delegate,\n            DelegateInvokeMethod.Parameters: { Length: 1 } parameters\n        } delegateType\n        && !IsFuncOrAction(delegateType)\n        && parameters[0] is { Name: { } parameterName }\n        && parameterName == lambda.Parameter.Identifier.ValueText;\n\n    private static bool IsFuncOrAction(INamedTypeSymbol delegateType) =>\n        delegateType.IsAny(KnownType.System_Func_T_TResult, KnownType.System_Action_T);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/LocalFunctionLocation.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class LocalFunctionLocation : StylingAnalyzer\n{\n    public LocalFunctionLocation() : base(\"T0015\", \"This local function should be at the end of the method.\") { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var function = (LocalFunctionStatementSyntax)c.Node;\n                if (!IsInTopLevelBlock(function) || !IsLastStatement(function))\n                {\n                    c.ReportIssue(Rule, function.Identifier);\n                }\n            },\n            SyntaxKind.LocalFunctionStatement);\n\n    private static bool IsInTopLevelBlock(LocalFunctionStatementSyntax function) =>\n        function.Parent is GlobalStatementSyntax or BlockSyntax\n        {\n            Parent: BaseMethodDeclarationSyntax\n                    or BasePropertyDeclarationSyntax\n                    or AccessorDeclarationSyntax\n        };\n\n    private static bool IsLastStatement(LocalFunctionStatementSyntax function) =>\n        function is { FollowingStatement: null or LocalFunctionStatementSyntax };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/MemberAccessLine.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class MemberAccessLine : StylingAnalyzer\n{\n    public MemberAccessLine() : base(\"T0027\", \"Move this member access to the next line.\") { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var memberAccess = (MemberAccessExpressionSyntax)c.Node;\n                if (!memberAccess.HasSameStartLineAs(memberAccess.Name)\n                    && memberAccess.OperatorToken.GetPreviousToken().GetLocation().EndLine() == memberAccess.Name.GetLocation().StartLine()\n                    && FindStartLineMemberAccess(memberAccess) is { } startLineMemberAccess\n                    && !IsIgnored(startLineMemberAccess, memberAccess))\n                {\n                    c.ReportIssue(Rule, Location.Create(c.Tree, TextSpan.FromBounds(memberAccess.OperatorToken.SpanStart, memberAccess.Span.End)));\n                }\n            },\n            SyntaxKind.SimpleMemberAccessExpression);\n\n    private static MemberAccessExpressionSyntax FindStartLineMemberAccess(SyntaxNode node) =>\n        node switch\n        {\n            MemberAccessExpressionSyntax memberAccess when memberAccess.OperatorToken.Line() != memberAccess.OperatorToken.GetPreviousToken().Line() => memberAccess,\n            MemberAccessExpressionSyntax memberAccess => FindStartLineMemberAccess(memberAccess.Expression),\n            InvocationExpressionSyntax invocation => FindStartLineMemberAccess(invocation.Expression),\n            ElementAccessExpressionSyntax elementAccess => FindStartLineMemberAccess(elementAccess.Expression),\n            _ => null\n        };\n\n    private static bool IsIgnored(MemberAccessExpressionSyntax startLine, MemberAccessExpressionSyntax current) =>\n        (startLine.Name is IdentifierNameSyntax { Identifier.ValueText: \"And\" or \"Which\" or \"Subject\" } && startLine.OperatorToken.IsFirstTokenOnLine())\n        || (current.Expression is InvocationExpressionSyntax invocation && invocation.NameIs(\"Should\"));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/MemberVisibilityOrdering.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class MemberVisibilityOrdering : StylingAnalyzer\n{\n    public MemberVisibilityOrdering() : base(\"T0009\", \"Move this {0} {1} above the {2} ones.\") { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            ValidateMembers,\n            SyntaxKind.ClassDeclaration,\n            SyntaxKind.RecordDeclaration,\n            SyntaxKind.RecordStructDeclaration,\n            SyntaxKind.StructDeclaration,\n            SyntaxKind.ExtensionBlockDeclaration);\n\n    private void ValidateMembers(SonarSyntaxNodeReportingContext context)\n    {\n        var type = (TypeDeclarationSyntax)context.Node;\n        var members = new Dictionary<string, List<MemberInfo>>();\n        foreach (var member in type.Members)\n        {\n            if (Category(member) is { } category && ReportingLocation(member) is { } location)\n            {\n                members.GetOrAdd(category, x => []).Add(new(location, member.ComputeOrder()));\n            }\n        }\n        foreach (var category in members.Keys)\n        {\n            OrderDescriptor maxOrder = null;\n            SecondaryLocation secondary = null;\n            foreach (var member in members[category])\n            {\n                if (member.Order.Value < maxOrder?.Value)\n                {\n                    context.ReportIssue(Rule, member.Location, [secondary], member.Order.Description, category, maxOrder.Description);\n                }\n                if (maxOrder is null || member.Order.Value > maxOrder.Value)\n                {\n                    maxOrder = member.Order;\n                    secondary = member.Location.ToSecondary();\n                }\n            }\n        }\n    }\n\n    private static string Category(MemberDeclarationSyntax member) =>\n        member switch\n        {\n            _ when member.Modifiers.Any(SyntaxKind.AbstractKeyword) => \"Abstract Member\",\n            FieldDeclarationSyntax when member.Modifiers.Any(SyntaxKind.ConstKeyword) => \"Constant\",\n            EnumDeclarationSyntax => \"Enum\",\n            FieldDeclarationSyntax => \"Field\",\n            DelegateDeclarationSyntax => \"Delegate\",\n            EventFieldDeclarationSyntax => \"Event\",\n            PropertyDeclarationSyntax => \"Property\",\n            IndexerDeclarationSyntax => \"Indexer\",\n            ConstructorDeclarationSyntax => \"Constructor\",\n            MethodDeclarationSyntax => \"Method\",\n            _ => null\n        };\n\n    private static Location ReportingLocation(SyntaxNode node) =>\n        node switch\n        {\n            EventFieldDeclarationSyntax eventField => eventField.Declaration.GetLocation(),\n            FieldDeclarationSyntax field => field.Declaration.GetLocation(),\n            _ => node.GetIdentifier()?.GetLocation()\n        };\n\n    private sealed record MemberInfo(Location Location, OrderDescriptor Order);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/MethodExpressionBodyLine.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class MethodExpressionBodyLine : StylingAnalyzer\n{\n    public MethodExpressionBodyLine() : base(\"T0032\", \"Move this expression body to the next line.\") { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var method = (BaseMethodDeclarationSyntax)c.Node;\n                if (method.ExpressionBody?.Expression is { } expression\n                    && method.GetLocation().StartLine() == expression.GetLocation().StartLine()\n                    && expression.DescendantTokens().Skip(1).Any()\n                    && !IsStubThrow((IMethodSymbol)c.ContainingSymbol, expression))\n                {\n                    c.ReportIssue(Rule, expression);\n                }\n            },\n            SyntaxKind.ConstructorDeclaration,\n            SyntaxKind.ConversionOperatorDeclaration,\n            SyntaxKind.DestructorDeclaration,\n            SyntaxKind.MethodDeclaration,\n            SyntaxKind.OperatorDeclaration);\n\n    private static bool IsStubThrow(IMethodSymbol method, ExpressionSyntax expression) =>\n        expression is ThrowExpressionSyntax\n        {\n            Expression: ObjectCreationExpressionSyntax { Type: IdentifierNameSyntax { Identifier.ValueText: nameof(NotImplementedException) or nameof(NotSupportedException) } }\n        }\n        && (method.IsOverride || method.ExplicitOrImplicitInterfaceImplementations().Any());\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/MoveMethodToDedicatedExtensionClass.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class MoveMethodToDedicatedExtensionClass : StylingAnalyzer\n{\n    public MoveMethodToDedicatedExtensionClass() : base(\"T0046\", \"Move this extension method to the {0} class.\") { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var method = (IMethodSymbol)c.ContainingSymbol;\n                if (method.IsExtension && ExpectedContainingType(method) is { } expected)\n                {\n                    c.ReportIssue(Rule, ((MethodDeclarationSyntax)c.Node).Identifier, expected);\n                }\n            },\n            SyntaxKind.MethodDeclaration);\n\n    private static string ExpectedContainingType(IMethodSymbol method)\n    {\n        var parameter = method.AssociatedExtensionImplementation is null\n            ? method.Parameters[0].Type\n            : method.ContainingType.ExtensionParameter.Type;\n\n        var expectedPrefixes = parameter switch\n        {\n            ITypeParameterSymbol typeParameter => typeParameter.ConstraintTypes.Where(x => x.IsType).Select(x => x.Name),\n            INamedTypeSymbol namedType => ValidTypeArguments(namedType).Select(x => x.Name),\n            _ => [parameter.Name]\n        };\n\n        var containingType = method.AssociatedExtensionImplementation is null\n            ? method.ContainingType\n            : method.ContainingType.ContainingType;\n\n        if (!expectedPrefixes.Any() || expectedPrefixes.All(string.IsNullOrWhiteSpace))\n        {\n            return \"ObjectExtensions\";\n        }\n        else if (expectedPrefixes.Any(x => containingType.Name.Equals($\"{x}Extensions\")))\n        {\n            return null;\n        }\n        else\n        {\n            return expectedPrefixes.Select(x => $\"{x}Extensions\").JoinOr();\n        }\n    }\n\n    private static IEnumerable<INamedTypeSymbol> ValidTypeArguments(INamedTypeSymbol namedType)\n    {\n        var validTypes = new HashSet<INamedTypeSymbol>(SymbolEqualityComparer.Default)\n        {\n            namedType\n        };\n        foreach (var type in namedType.TypeArguments.OfType<INamedTypeSymbol>())\n        {\n            validTypes.AddRange(ValidTypeArguments(type));\n        }\n        return validTypes;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/NamespaceName.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class NamespaceName : StylingAnalyzer\n{\n    public NamespaceName() : base(\"T0037\", \"Use {0} namespace.\", SourceScope.Tests) { }     // IDE0030 is aligning namespace with folder for most of the cases\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var declaration = (FileScopedNamespaceDeclarationSyntax)c.Node;\n                var removableUsing = declaration.Name.ToString().Replace(\".Test.\", \".\");\n                if (c.Tree.GetRoot().ChildNodes().OfType<UsingDirectiveSyntax>().Any(x => x.Name.ToString() == removableUsing))\n                {\n                    c.ReportIssue(Rule, declaration.Name, removableUsing + \".Test\");\n                }\n            },\n            SyntaxKind.FileScopedNamespaceDeclaration);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/NullPatternMatching.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class NullPatternMatching : StylingAnalyzer\n{\n    public NullPatternMatching() : base(\"T0007\", \"Use 'is {0}null' pattern matching.\") { }\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(c => Validate(c, null), SyntaxKind.EqualsExpression);\n        context.RegisterNodeAction(c => Validate(c, \"not \"), SyntaxKind.NotEqualsExpression);\n        context.RegisterNodeAction(c =>\n            {\n                if (((RecursivePatternSyntax)c.Node) is { Designation: null, PropertyPatternClause.Subpatterns.Count: 0 })\n                {\n                    c.ReportIssue(Rule, c.Node, \"not \");\n                }\n            },\n            SyntaxKind.RecursivePattern);\n    }\n\n    private void Validate(SonarSyntaxNodeReportingContext context, string messageInfix)\n    {\n        var binary = (BinaryExpressionSyntax)context.Node;\n        if ((binary.Left.IsKind(SyntaxKind.NullLiteralExpression) || binary.Right.IsKind(SyntaxKind.NullLiteralExpression))\n            && !context.IsInExpressionTree())\n        {\n            context.ReportIssue(Rule, binary, messageInfix);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/OperatorLocation.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class OperatorLocation : StylingAnalyzer\n{\n    public OperatorLocation() : base(\"T0018\", \"The '{0}' operator should not be at the end of the line.\") { }\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(c => Validate(c, ((BinaryExpressionSyntax)c.Node).OperatorToken),\n            SyntaxKind.LogicalAndExpression,\n            SyntaxKind.LogicalOrExpression,\n            SyntaxKind.BitwiseAndExpression,\n            SyntaxKind.BitwiseOrExpression,\n            SyntaxKind.ExclusiveOrExpression,\n            SyntaxKind.CoalesceExpression,\n            SyntaxKind.AddExpression,\n            SyntaxKind.LeftShiftExpression,\n            SyntaxKind.RightShiftExpression,\n            SyntaxKind.UnsignedRightShiftExpression,\n            SyntaxKind.SubtractExpression,\n            SyntaxKind.MultiplyExpression,\n            SyntaxKind.DivideExpression,\n            SyntaxKind.ModuloExpression,\n            SyntaxKind.EqualsExpression,\n            SyntaxKind.NotEqualsExpression,\n            SyntaxKind.GreaterThanExpression,\n            SyntaxKind.GreaterThanOrEqualExpression,\n            SyntaxKind.LessThanExpression,\n            SyntaxKind.LessThanOrEqualExpression,\n            SyntaxKind.AsExpression,\n            SyntaxKind.IsExpression);\n        context.RegisterNodeAction(c => Validate(c, ((BinaryPatternSyntax)c.Node).OperatorToken),\n            SyntaxKind.AndPattern,\n            SyntaxKind.OrPattern);\n        context.RegisterNodeAction(c => Validate(c, ((IsPatternExpressionSyntax)c.Node).IsKeyword),\n            SyntaxKind.IsPatternExpression);\n        context.RegisterNodeAction(c => Validate(c, ((RangeExpressionSyntax)c.Node).OperatorToken),\n            SyntaxKind.RangeExpression);\n        context.RegisterNodeAction(c =>\n            {\n                var conditional = (ConditionalExpressionSyntax)c.Node;\n                Validate(c, conditional.QuestionToken);\n                Validate(c, conditional.ColonToken);\n            },\n            SyntaxKind.ConditionalExpression);\n        context.RegisterNodeAction(c => Validate(c, ((MemberAccessExpressionSyntax)c.Node).OperatorToken),\n            SyntaxKind.SimpleMemberAccessExpression);\n        context.RegisterNodeAction(c => Validate(c, ((MemberBindingExpressionSyntax)c.Node).OperatorToken),\n            SyntaxKind.MemberBindingExpression);\n        context.RegisterNodeAction(c => Validate(c, ((QualifiedNameSyntax)c.Node).DotToken),\n            SyntaxKind.QualifiedName);\n    }\n\n    private void Validate(SonarSyntaxNodeReportingContext context, SyntaxToken token)\n    {\n        if (token.GetLocation().StartLine() != token.GetNextToken().GetLocation().StartLine())\n        {\n            context.ReportIssue(Rule, token, token.ToString());\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/PropertyOrdering.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class PropertyOrdering : StylingAnalyzer\n{\n    public PropertyOrdering() : base(\"T0014\", \"Move this static property above the {0} instance ones.\") { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            ValidateMembers,\n            SyntaxKind.ClassDeclaration,\n            SyntaxKind.RecordDeclaration,\n            SyntaxKind.RecordStructDeclaration,\n            SyntaxKind.StructDeclaration);\n\n    private void ValidateMembers(SonarSyntaxNodeReportingContext context)\n    {\n        foreach (var visibilityGroup in ((TypeDeclarationSyntax)context.Node).Members.OfType<PropertyDeclarationSyntax>().GroupBy(x => x.ComputeOrder()))\n        {\n            ValidateMembers(context, visibilityGroup.Key, visibilityGroup);\n        }\n    }\n\n    private void ValidateMembers(SonarSyntaxNodeReportingContext context, OrderDescriptor order, IEnumerable<PropertyDeclarationSyntax> members)\n    {\n        var hasInstance = false;\n        foreach (var member in members)\n        {\n            if (member.Modifiers.Any(SyntaxKind.StaticKeyword))\n            {\n                if (hasInstance)\n                {\n                    context.ReportIssue(Rule, member.Identifier, order.Description);\n                }\n            }\n            else\n            {\n                hasInstance = true;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/ProtectedFieldsCase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ProtectedFieldsCase : StylingAnalyzer\n{\n    public ProtectedFieldsCase() : base(\"T0039\", \"Protected field should start with lower case letter.\") { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var field = (FieldDeclarationSyntax)c.Node;\n                if (field.Modifiers.Count == 2\n                    && field.Modifiers.Any(SyntaxKind.ReadOnlyKeyword)\n                    && field.Modifiers.Any(SyntaxKind.ProtectedKeyword))\n                {\n                    foreach (var variable in field.Declaration.Variables.Where(x => char.IsUpper(x.Identifier.ValueText[0])))\n                    {\n                        c.ReportIssue(Rule, variable.Identifier);\n                    }\n                }\n            },\n            SyntaxKind.FieldDeclaration);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/SeparateDeclarations.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class SeparateDeclarations : StylingAnalyzer\n{\n    public SeparateDeclarations() : base(\"T0016\", \"Add an empty line before this declaration.\") { }\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(\n            ValidateSeparatedMember,\n            SyntaxKind.ClassDeclaration,\n            SyntaxKind.ConstructorDeclaration,\n            SyntaxKind.ConversionOperatorDeclaration,\n            SyntaxKind.DestructorDeclaration,\n            SyntaxKind.EnumDeclaration,\n            SyntaxKind.MethodDeclaration,\n            SyntaxKind.NamespaceDeclaration,\n            SyntaxKind.OperatorDeclaration,\n            SyntaxKind.RecordDeclaration,\n            SyntaxKind.RecordStructDeclaration,\n            SyntaxKind.StructDeclaration);\n        context.RegisterNodeAction(\n            ValidatePossibleSingleLineMember,\n            SyntaxKind.EventDeclaration,\n            SyntaxKind.EventFieldDeclaration,\n            SyntaxKind.DelegateDeclaration,\n            SyntaxKind.FieldDeclaration,\n            SyntaxKind.IndexerDeclaration,\n            SyntaxKind.PropertyDeclaration);\n    }\n\n    private void ValidatePossibleSingleLineMember(SonarSyntaxNodeReportingContext context)\n    {\n        var firstToken = context.Node.GetFirstToken();\n        if (firstToken.Line() != context.Node.GetLastToken().Line()\n            || IsStandaloneCloseBrace(firstToken.GetPreviousToken())\n            || PreviousDeclarationKind() != context.Node.Kind())\n        {\n            ValidateSeparatedMember(context);\n        }\n\n        SyntaxKind PreviousDeclarationKind() =>\n            context.Node.Parent.ChildNodes().TakeWhile(x => x != context.Node).LastOrDefault() is { } preceding\n                ? preceding.Kind()\n                : SyntaxKind.None;\n\n        static bool IsStandaloneCloseBrace(SyntaxToken token) =>\n            token.IsKind(SyntaxKind.CloseBraceToken) && token.Line() != token.GetPreviousToken().Line();\n    }\n\n    private void ValidateSeparatedMember(SonarSyntaxNodeReportingContext context)\n    {\n        var firstToken = context.Node.GetFirstToken();\n        if (!context.Node.Parent.IsKind(SyntaxKind.InterfaceDeclaration)\n            && !context.Node.GetModifiers().Any(SyntaxKind.AbstractKeyword)\n            && !firstToken.GetPreviousToken().IsKind(SyntaxKind.OpenBraceToken)\n            && !ContainsEmptyLine(firstToken.LeadingTrivia))\n        {\n            var firstComment = firstToken.LeadingTrivia.FirstOrDefault(x => x.IsComment());\n            context.ReportIssue(Rule, firstComment == default ? firstToken.GetLocation() : firstComment.GetLocation());\n        }\n    }\n\n    private static bool ContainsEmptyLine(SyntaxTriviaList trivia)\n    {\n        var previousLine = -1;\n        foreach (var trivium in trivia.Where(x => !x.IsKind(SyntaxKind.WhitespaceTrivia)))\n        {\n            if (trivium.IsKind(SyntaxKind.EndOfLineTrivia))\n            {\n                if (previousLine != trivium.GetLocation().StartLine())\n                {\n                    return true;\n                }\n            }\n            else\n            {\n                previousLine = trivium.GetLocation().EndLine();\n            }\n        }\n        return false;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/TermaryLine.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class TernaryLine : StylingAnalyzer\n{\n    public TernaryLine() : base(\"T0024\", \"Place branches of the multiline ternary on a separate line.\") { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var ternary = (ConditionalExpressionSyntax)c.Node;\n                var location = ternary.GetLocation();\n                if (location.StartLine() != location.EndLine())\n                {\n                    Verify(c, ternary.QuestionToken, ternary.WhenTrue);\n                    Verify(c, ternary.ColonToken, ternary.WhenFalse);\n                }\n            },\n            SyntaxKind.ConditionalExpression);\n\n    private void Verify(SonarSyntaxNodeReportingContext context, SyntaxToken token, ExpressionSyntax expression)\n    {\n        if (!token.IsFirstTokenOnLine())\n        {\n            context.ReportIssue(Rule, Location.Create(expression.SyntaxTree, TextSpan.FromBounds(token.SpanStart, expression.Span.End)));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/TypeMemberOrdering.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class TypeMemberOrdering : StylingAnalyzer\n{\n    private const string NestedTypes = \"Nested Types\";\n\n    private static readonly MemberKind Constant = new(1, \"Constants\");\n    private static readonly MemberKind AbstractMember = new(10, \"Abstract Members\");\n    private static readonly MemberKind AbstractType = new(40, \"Abstract Types\");\n\n    private static readonly Dictionary<SyntaxKind, MemberKind> MemberKinds = new()\n        {\n            // Order 1: Constants are FieldDeclaration and are handled separately in the code\n            {SyntaxKind.EnumDeclaration, new(2, \"Enums\") },\n            {SyntaxKind.FieldDeclaration, new(3, \"Fields\") },\n            // Order 10: Abstract members are handled separately in the code\n            {SyntaxKind.DelegateDeclaration, new(20, \"Delegates\") },\n            {SyntaxKind.EventFieldDeclaration, new(21, \"Events\") },\n            {SyntaxKind.PropertyDeclaration, new(22, \"Properties\") },\n            {SyntaxKind.IndexerDeclaration, new(23, \"Indexers\") },\n            {SyntaxKind.ConstructorDeclaration, new(24, \"Constructors\") },\n            {SyntaxKind.DestructorDeclaration, new(25, \"Destructor\") },\n            {SyntaxKind.MethodDeclaration, new(30, \"Methods\") },\n            {SyntaxKind.ConversionOperatorDeclaration, new(31, \"Operators\") },\n            {SyntaxKind.OperatorDeclaration, new(31, \"Operators\") },\n            // Order 40: Abstract types are handled separtely in the code\n            {SyntaxKind.ClassDeclaration, new(40, NestedTypes) },\n            {SyntaxKind.InterfaceDeclaration, new(40, NestedTypes) },\n            {SyntaxKind.RecordDeclaration, new(40, NestedTypes) },\n            {SyntaxKind.StructDeclaration, new(40, NestedTypes) },\n        };\n\n    public TypeMemberOrdering() : base(\"T0008\", \"Move {0} {1}.\") { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            ValidateMembers,\n            SyntaxKind.ClassDeclaration,\n            SyntaxKind.InterfaceDeclaration,\n            SyntaxKind.RecordDeclaration,\n            SyntaxKind.RecordStructDeclaration,\n            SyntaxKind.StructDeclaration,\n            SyntaxKind.ExtensionBlockDeclaration);\n\n    private void ValidateMembers(SonarSyntaxNodeReportingContext context)\n    {\n        var secondaries = new Dictionary<MemberKind, SecondaryLocation>();\n        var type = (TypeDeclarationSyntax)context.Node;\n        var members = new List<MemberInfo>();\n        foreach (var member in type.Members)\n        {\n            if (ReportingLocation(member) is { } location && Kind(member) is { } kind)\n            {\n                members.Add(new(member, location, kind.Order, kind.Description));\n                if (!secondaries.ContainsKey(kind))\n                {\n                    secondaries.Add(kind, location.ToSecondary(\"Move the declaration before this one.\"));\n                }\n            }\n        }\n        var maxOrder = 0;\n        var availableKinds = members.GroupBy(x => x.Order).OrderBy(x => x.Key).Select(x => new MemberKind(x.Key, x.First().Description)).ToArray();\n        foreach (var member in members)\n        {\n            if (member.Order < maxOrder)\n            {\n                var before = availableKinds.First(x => x.Order > member.Order);\n                context.ReportIssue(Rule, member.Location, [secondaries[before]], member.Description, ExpectedLocation(availableKinds, member.Order, before));\n            }\n            maxOrder = Math.Max(maxOrder, member.Order);\n        }\n    }\n\n    private static MemberKind Kind(MemberDeclarationSyntax member)\n    {\n        if (member.IsKind(SyntaxKind.FieldDeclaration) && member.Modifiers.Any(SyntaxKind.ConstKeyword))\n        {\n            return Constant;\n        }\n        else if (member.Modifiers.Any(SyntaxKind.AbstractKeyword))\n        {\n            return member is BaseTypeDeclarationSyntax ? AbstractType : AbstractMember;\n        }\n        else if (MemberKinds.TryGetValue(member.Kind(), out var kind))\n        {\n            return kind;\n        }\n        else\n        {\n            return null;\n        }\n    }\n\n    private static Location ReportingLocation(SyntaxNode node) =>\n        node switch\n        {\n            EventFieldDeclarationSyntax eventField => eventField.Declaration.GetLocation(),\n            FieldDeclarationSyntax field => field.Declaration.GetLocation(),\n            _ => node.GetIdentifier()?.GetLocation()\n        };\n\n    private static string ExpectedLocation(MemberKind[] availableKinds, int order, MemberKind before)\n    {\n        var after = availableKinds.LastOrDefault(x => x.Order < order) is { } previous ? $\"after {previous.Description}, \" : null;\n        return $\"{after}before {before.Description}\";\n    }\n\n    private sealed record MemberInfo(MemberDeclarationSyntax Member, Location Location, int Order, string Description);\n\n    private sealed record MemberKind(int Order, string Description);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/UseDifferentMember.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class UseDifferentMember : StylingAnalyzer\n{\n    public UseDifferentMember() : base(\"T0047\", \"Use '{0}' instead of '{1}'.{2}\") { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var identifier = (IdentifierNameSyntax)c.Node;\n                if (identifier.Identifier.Text is nameof(IMethodSymbol.IsExtensionMethod)\n                    && c.Model.GetSymbolInfo(identifier) is { Symbol: IPropertySymbol property }\n                    && property.IsInType(KnownType.Microsoft_CodeAnalysis_IMethodSymbol))\n                {\n                    c.ReportIssue(Rule, c.Node, \"IsExtension\", nameof(IMethodSymbol.IsExtensionMethod), \" It also covers extension methods defined in extension blocks.\");\n                }\n            },\n            SyntaxKind.IdentifierName);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/UseField.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing static Microsoft.CodeAnalysis.Accessibility;\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class UseField : StylingAnalyzer\n{\n    public UseField() : base(\"T0038\", \"Use field instead of this {0} auto-property.\") { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var property = (PropertyDeclarationSyntax)c.Node;\n                if (c.ContainingSymbol is IPropertySymbol { DeclaredAccessibility: Private or Protected or ProtectedAndInternal, IsAbstract: false, IsVirtual: false, IsOverride: false }\n                    && property.AccessorList is { } accessors\n                    && accessors.Accessors.All(x => x.Body is null && x.ExpressionBody is null))\n                {\n                    c.ReportIssue(Rule, property, property.Modifiers.Where(x => x.Kind() is SyntaxKind.PrivateKeyword or SyntaxKind.ProtectedKeyword).JoinStr(\" \", x => x.ValueText));\n                }\n            }, SyntaxKind.PropertyDeclaration);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/UseInnermostRegistrationContext.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class UseInnermostRegistrationContext : StylingAnalyzer\n{\n    public UseInnermostRegistrationContext() : base(\"T0005\", \"Use inner-most registration context '{0}' instead of '{1}'.\") { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(compilationStart =>\n        {\n            const string contextNameSpace = \"SonarAnalyzer.Core.AnalysisContext.\";\n            var allContextTypes = new[]\n            {\n                nameof(SonarAnalysisContext),\n                nameof(SonarCompilationStartAnalysisContext),\n                $\"{nameof(SonarCodeBlockStartAnalysisContext<int>)}`1\",\n                nameof(SonarSymbolStartAnalysisContext),\n                nameof(SonarParametrizedAnalysisContext),\n                nameof(IReport),\n            }.Select(x => compilationStart.Compilation.GetTypeByMetadataName($\"{contextNameSpace}{x}\")).WhereNotNull().ToImmutableArray();\n            if (allContextTypes.IsEmpty)\n            {\n                return;\n            }\n            var registrationContextTypes = allContextTypes.Where(x => x.Name != nameof(IReport)).ToImmutableArray();\n            compilationStart.RegisterNodeAction(c =>\n            {\n                if (c.Node is ParameterSyntax outterParameter\n                    && outterParameter.GetName() is { } outterParameterName\n                    && RegistrationContextParameterSymbol(c.Model, registrationContextTypes, outterParameter) is { } outterParameterSymbol)\n                {\n                    // Find all inner registrations by looking for other parameters of a context type (IReport or one of the registration context types)\n                    // Inside the scopes of such parameters, outterParameter isn't allowed to be used.\n                    var innerContextParameters = outterParameter.Parent.EnclosingScope()\n                        .DescendantNodes(x => !(outterParameter.Parent is ParameterListSyntax && x == outterParameter.Parent)) // Don't consider other parameters of the same method as inner parameters\n                        .OfType<ParameterSyntax>()\n                        .Where(x => x != outterParameter) // SimpleLambda parameter are not excluded by the DescendantNodes filter above\n                        .Select(x => new NodeAndSymbol(x, RegistrationOrReportingContextParameterSymbol(c.Model, allContextTypes, x)))\n                        .Where(x => x.Symbol is not null)\n                        .ToImmutableArray();\n                    var violationNodes = ViolationsInInnerScopes(c.Model, outterParameterSymbol, innerContextParameters);\n                    foreach (var violation in violationNodes)\n                    {\n                        c.ReportIssue(Rule, violation.Node, violation.Symbol.Name, outterParameterName);\n                    }\n                }\n            }, SyntaxKind.Parameter);\n        });\n\n    private static IEnumerable<NodeAndSymbol> ViolationsInInnerScopes(SemanticModel model, IParameterSymbol outterParameterSymbol, ImmutableArray<NodeAndSymbol> innerContextParameters)\n    {\n        Dictionary<SyntaxNode, ISymbol> violations = [];\n        foreach (var innerContextParameter in innerContextParameters)\n        {\n            var innerScope = innerContextParameter.Node.Parent.EnclosingScope(); // outterParameter should not be used inside these scopes\n            foreach (var node in innerScope.DescendantNodes().OfType<IdentifierNameSyntax>().Where(x =>\n                x.GetName() == outterParameterSymbol.Name\n                && model.GetSymbolInfo(x).Symbol is IParameterSymbol usedParameter\n                && SymbolEqualityComparer.Default.Equals(usedParameter, outterParameterSymbol)))\n            {\n                // There might be mutiple inner context parameters we pass until we find a violation,\n                // but only the last one we have seen is the most inner one. The dictionaries add or\n                // replace logic solves this for us.\n                violations[node] = innerContextParameter.Symbol;\n            }\n        }\n        return violations.Select(x => new NodeAndSymbol(x.Key, x.Value));\n    }\n\n    private static IParameterSymbol RegistrationContextParameterSymbol(SemanticModel model, ImmutableArray<INamedTypeSymbol> registrationContextTypes, ParameterSyntax parameter)\n    {\n        // Syntax based check to exclude parameters with a Type node that are known to be not registration context types\n        if (parameter.Type is { } type\n            && type.GetName() is { } typeName\n            && !registrationContextTypes.Any(x => x.Name == typeName))\n        {\n            return null;\n        }\n        return model.GetDeclaredSymbol(parameter) is IParameterSymbol parameterSymbol\n            && IsRegistrationParameter(registrationContextTypes, parameterSymbol)\n            ? parameterSymbol\n            : null;\n    }\n\n    private static bool IsRegistrationParameter(ImmutableArray<INamedTypeSymbol> registrationContextTypes, IParameterSymbol parameterSymbol) =>\n        registrationContextTypes.Any(parameterSymbol.Type.DerivesFrom);\n\n    private static IParameterSymbol RegistrationOrReportingContextParameterSymbol(SemanticModel model,\n                                                                                  ImmutableArray<INamedTypeSymbol> allContextTypes,\n                                                                                  ParameterSyntax parameter) =>\n        model.GetDeclaredSymbol(parameter) is IParameterSymbol parameterSymbol\n            && allContextTypes.Any(parameterSymbol.Type.DerivesOrImplements)\n            ? parameterSymbol\n            : null;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/UseLinqExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class UseLinqExtensions : StylingAnalyzer\n{\n    public UseLinqExtensions() : base(\"T0021\", \"Use IEnumerable extensions instead of the query syntax.\") { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            c => c.ReportIssue(Rule, c.Node),\n            SyntaxKind.QueryExpression);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/UseNullInsteadOfDefault.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class UseNullInsteadOfDefault : StylingAnalyzer\n{\n    public UseNullInsteadOfDefault() : base(\"T0012\", \"Use 'null' instead of 'default' for reference types.\") { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                if (IsReferenceType(c.Node, c.Model))\n                {\n                    c.ReportIssue(Rule, c.Node);\n                }\n            },\n            SyntaxKind.DefaultLiteralExpression, SyntaxKind.DefaultExpression);\n\n    private static bool IsReferenceType(SyntaxNode node, SemanticModel model)\n    {\n        var type = model.GetTypeInfo(node).Type;\n        return (type.IsReferenceType && type is not IErrorTypeSymbol) || type.Is(KnownType.System_Nullable_T);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/UsePositiveLogic.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class UsePositiveLogic : StylingAnalyzer\n{\n    public UsePositiveLogic() : base(\"T0033\", \"Swap the branches and use positive condition.\") { }\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(c =>\n            {\n                var ifStatement = (IfStatementSyntax)c.Node;\n                if (ifStatement.Else is { Statement: not IfStatementSyntax })\n                {\n                    Validate(c, ifStatement.Condition);\n                }\n            },\n            SyntaxKind.IfStatement);\n\n        context.RegisterNodeAction(c =>\n            Validate(c, ((ConditionalExpressionSyntax)c.Node).Condition),\n            SyntaxKind.ConditionalExpression);\n    }\n\n    private void Validate(SonarSyntaxNodeReportingContext context, ExpressionSyntax expression)\n    {\n        if (IsNegative(expression, null))\n        {\n            context.ReportIssue(Rule, expression);\n        }\n    }\n\n    private static bool IsNegative(ExpressionSyntax expression, Operator outerAndOr) =>\n        expression switch\n        {\n            PrefixUnaryExpressionSyntax prefix => prefix.IsKind(SyntaxKind.LogicalNotExpression),\n            BinaryExpressionSyntax binary => IsNegative(binary, outerAndOr),\n            ParenthesizedExpressionSyntax parenthesized => IsNegative(parenthesized.Expression, outerAndOr),\n            IsPatternExpressionSyntax isPattern => IsNegative(isPattern.Pattern, outerAndOr),\n            _ => false\n        };\n\n    private static bool IsNegative(BinaryExpressionSyntax binary, Operator outerAndOr) =>\n        binary.IsKind(SyntaxKind.NotEqualsExpression)\n        || (CheckAndOr(binary, outerAndOr) is { } currentandOr && IsNegative(binary.Left, currentandOr) && IsNegative(binary.Right, currentandOr));\n\n    private static bool IsNegative(PatternSyntax pattern, Operator outerAndOr) =>\n        pattern is UnaryPatternSyntax { RawKind: (int)SyntaxKind.NotPattern }\n        || (pattern is BinaryPatternSyntax { } binary && CheckAndOr(binary, outerAndOr) is { } currentAndOr && IsNegative(binary.Left, currentAndOr) && IsNegative(binary.Right, currentAndOr));\n\n    private static Operator CheckAndOr(SyntaxNode node, Operator outerAndOr) =>\n        (outerAndOr ?? Operator.From((SyntaxKind)node.RawKind)) is { } currentAndOr && currentAndOr.IsMatch((SyntaxKind)node.RawKind)\n            ? currentAndOr\n            : null;\n\n    private sealed class Operator\n    {\n        private static readonly Operator And = new(SyntaxKind.LogicalAndExpression, SyntaxKind.AndPattern);\n        private static readonly Operator Or = new(SyntaxKind.LogicalOrExpression, SyntaxKind.OrPattern);\n\n        private readonly SyntaxKind logical;\n        private readonly SyntaxKind pattern;\n\n        private Operator(SyntaxKind logical, SyntaxKind pattern)\n        {\n            this.logical = logical;\n            this.pattern = pattern;\n        }\n\n        public static Operator From(SyntaxKind kind)\n        {\n            if (kind == And.logical || kind == And.pattern)\n            {\n                return And;\n            }\n            else if (kind == Or.logical || kind == Or.pattern)\n            {\n                return Or;\n            }\n            else\n            {\n                return null;\n            }\n        }\n\n        public bool IsMatch(SyntaxKind kind) =>\n            kind == logical || kind == pattern;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/UseRawString.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class UseRawString : StylingAnalyzer\n{\n    public UseRawString() : base(\"T0041\", \"Use raw string literal for multiline strings.\") { }\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(c =>\n            {\n                var location = c.Node.GetLocation();\n                if (location.StartLine() != location.EndLine()\n                    && c.Node.GetFirstToken().Kind() is not SyntaxKind.MultiLineRawStringLiteralToken and not SyntaxKind.InterpolatedMultiLineRawStringStartToken)\n                {\n                    c.ReportIssue(Rule, c.Node);\n                }\n            },\n            SyntaxKind.StringLiteralExpression,\n            SyntaxKind.InterpolatedStringExpression);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/UseRegexSafeIsMatch.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class UseRegexSafeIsMatch : StylingAnalyzer\n{\n    public UseRegexSafeIsMatch() : base(\"T0004\", \"Use '{0}{1}' instead.\") { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(c =>\n        {\n            var regexExtensions = c.Compilation.GetSymbolsWithName(\"RegexExtensions\", SymbolFilter.Type).OfType<INamedTypeSymbol>().ToArray();\n            Verify(c, \"IsMatch\", \"SafeIsMatch\", regexExtensions);\n            Verify(c, \"Match\", \"SafeMatch\", regexExtensions);\n            Verify(c, \"Matches\", \"SafeMatches\", regexExtensions);\n        });\n\n    private void Verify(\n        SonarCompilationStartAnalysisContext context,\n        string methodName,\n        string replacementName,\n        IEnumerable<INamedTypeSymbol> regexExtensions)\n    {\n        if (regexExtensions.Any(x => x.GetMembers(replacementName).Any()))\n        {\n            context.RegisterNodeAction(c =>\n            {\n                var memberAccess = (MemberAccessExpressionSyntax)c.Node;\n                if (memberAccess.NameIs(methodName)\n                    && c.Model.GetSymbolInfo(memberAccess).Symbol is IMethodSymbol method\n                    && method.ContainingType.Is(KnownType.System_Text_RegularExpressions_Regex))\n                {\n                    c.ReportIssue(\n                        Rule,\n                        method.IsStatic ? memberAccess.Expression : memberAccess.Name,\n                        method.IsStatic ? \"SafeRegex.\" : \"Safe\",\n                        method.Name);\n                }\n            },\n            SyntaxKind.SimpleMemberAccessExpression);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/UseShortName.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class UseShortName : StylingAnalyzer\n{\n    private static readonly RenameInfo[] RenameCandidates =\n        [\n            new(\"CancellationToken\", \"cancellationToken\", \"cancel\"),\n            new(\"CancellationToken\", \"CancellationToken\", \"Cancel\"),\n            new(\"DiagnosticDescriptor\", \"diagnosticDescriptor\", \"descriptor\"),\n            new(\"DiagnosticDescriptor\", \"DiagnosticDescriptor\", \"Descriptor\"),\n            new(\"SyntaxNode\", \"syntaxNode\", \"node\"),\n            new(\"SyntaxNode\", \"SyntaxNode\", \"Node\"),\n            new(\"SyntaxToken\", \"syntaxToken\", \"token\"),\n            new(\"SyntaxToken\", \"SyntaxToken\", \"Token\"),\n            new(\"SyntaxTree\", \"syntaxTree\", \"tree\"),\n            new(\"SyntaxTree\", \"SyntaxTree\", \"Tree\"),\n            new(\"SyntaxTrivia\", \"syntaxTrivia\", \"trivia\"),\n            new(\"SyntaxTrivia\", \"SyntaxTrivia\", \"Trivia\"),\n            new(\"SemanticModel\", \"semanticModel\", \"model\"),\n            new(\"SemanticModel\", \"SemanticModel\", \"Model\")\n        ];\n\n    public UseShortName() : base(\"T0017\", \"Use short name '{0}'.\") { }\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(c => ValidateDeclaration(c, ((VariableDeclaratorSyntax)c.Node).Identifier), SyntaxKind.VariableDeclarator);\n        context.RegisterNodeAction(c => ValidateDeclaration(c, ((PropertyDeclarationSyntax)c.Node).Identifier), SyntaxKind.PropertyDeclaration);\n        context.RegisterNodeAction(c =>\n            {\n                if (!FollowsPredefinedName(c.ContainingSymbol))\n                {\n                    ValidateDeclaration(c, ((ParameterSyntax)c.Node).Identifier);\n                }\n            },\n            SyntaxKind.Parameter);\n    }\n\n    private void ValidateDeclaration(SonarSyntaxNodeReportingContext context, SyntaxToken identifier)\n    {\n        if (FindRename(identifier.ValueText) is { } name\n            && context.Model.GetDeclaredSymbol(context.Node).GetSymbolType() is { } type\n            && type.Name == name.TypeName)\n        {\n            context.ReportIssue(Rule, identifier, identifier.ValueText.Replace(name.UsedName, name.SuggestedName));\n        }\n    }\n\n    private static RenameInfo FindRename(string name) =>\n        Array.Find(RenameCandidates, x => name.Contains(x.UsedName));\n\n    private static bool FollowsPredefinedName(ISymbol symbol) =>\n        symbol is IMethodSymbol method\n        && (symbol.IsOverride || symbol.InterfaceMembers().Any() || method.PartialDefinitionPart is not null);\n\n    private sealed record RenameInfo(string TypeName, string UsedName, string SuggestedName);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/Rules/UseVar.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class UseVar : StylingAnalyzer\n{\n    public UseVar() : base(\"T0045\", \"Use var.\") { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                if (c.Node is VariableDeclarationSyntax { Type: not IdentifierNameSyntax { Identifier.ValueText: \"var\" }, Variables.Count: 1, Parent: LocalDeclarationStatementSyntax } declaration\n                    && declaration.Variables[0] is { Initializer.Value: ImplicitObjectCreationExpressionSyntax or IdentifierNameSyntax or InvocationExpressionSyntax or MemberAccessExpressionSyntax })\n                {\n                    c.ReportIssue(Rule, declaration.Type);\n                }\n            },\n            SyntaxKind.VariableDeclaration);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/SonarAnalyzer.CSharp.Styling.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <!-- SonarScanner for .NET would remove the analyzer if the DLL name starts with SonarAnalyzer. See GetAnalyzerSettings S4NET task. -->\n    <AssemblyName>Internal.SonarAnalyzer.CSharp.Styling</AssemblyName>\n    <TargetFramework>netstandard2.0</TargetFramework>\n    <!-- .NET Standard target does not copy referenced DLLs into bin folder, so we need to enable it explicitly. -->\n    <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>\n    <!-- Title for DLL file properties -->\n    <AssemblyTitle>Internal Sonar styling analyzer for C#</AssemblyTitle>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <!--This roslyn should only be updated ~ a year after it is released as updating it too fast will mean that any Sonar CI that is not on the latest roslyn will ignore this dll-->\n    <PackageReference Include=\"Microsoft.CodeAnalysis.CSharp.Workspaces\" Version=\"5.0.0\" />\n    <!-- Fody with ILMerge are buggy. Consult SONARSEC-4584 if you see TypeInitializationException, TypeLoadException, or similar at ITs runtime locally -->\n    <PackageReference Include=\"Fody\" Version=\"6.9.3\" PrivateAssets=\"All\" />\n    <PackageReference Include=\"ILMerge.Fody\" Version=\"1.24.0\" PrivateAssets=\"All\" />\n  </ItemGroup>\n\n  <PropertyGroup>\n    <WeaverConfiguration>\n      <Weavers>\n        <ILMerge IncludeAssemblies=\"Google.Protobuf|SonarAnalyzer.*\" />\n      </Weavers>\n    </WeaverConfiguration>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <!-- We need to update NuGet packaging after changing references -->\n    <ProjectReference Include=\"..\\SonarAnalyzer.Core\\SonarAnalyzer.Core.csproj\" />\n    <ProjectReference Include=\"..\\SonarAnalyzer.CSharp.Core\\SonarAnalyzer.CSharp.Core.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Using Include=\"Microsoft.CodeAnalysis\" />\n    <Using Include=\"Microsoft.CodeAnalysis.CSharp\" />\n    <Using Include=\"Microsoft.CodeAnalysis.CSharp.Syntax\" />\n    <Using Include=\"Microsoft.CodeAnalysis.Diagnostics\" />\n    <Using Include=\"SonarAnalyzer.Core.AnalysisContext\" />\n    <Using Include=\"SonarAnalyzer.Core.Common\" />\n    <Using Include=\"SonarAnalyzer.Core.Extensions\" />\n    <Using Include=\"SonarAnalyzer.Core.Semantics\" />\n    <Using Include=\"SonarAnalyzer.Core.Semantics.Extensions\" />\n    <Using Include=\"SonarAnalyzer.Core.Syntax.Extensions\" />\n    <Using Include=\"SonarAnalyzer.CSharp.Core.Extensions\" />\n    <Using Include=\"SonarAnalyzer.CSharp.Core.Syntax.Extensions\" />\n    <Using Include=\"SonarAnalyzer.CSharp.Styling.Common\" />\n    <Using Include=\"SonarAnalyzer.CSharp.Styling.Extensions\" />\n    <Using Include=\"StyleCop.Analyzers.Lightup\" />\n  </ItemGroup>\n\n  <Target Name=\"CopyBinaries\" AfterTargets=\"Build\">\n    <Copy SourceFiles=\"$(OutputPath)$(TargetFileName)\" DestinationFolder=\"$(BinariesFolder)\" />\n  </Target>\n</Project>\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.CSharp.Styling/packages.lock.json",
    "content": "{\n  \"version\": 1,\n  \"dependencies\": {\n    \".NETStandard,Version=v2.0\": {\n      \"Fody\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[6.9.3, )\",\n        \"resolved\": \"6.9.3\",\n        \"contentHash\": \"1CUGgFdyECDKgi5HaUBhdv6k+VG9Iy4OCforGfHyar3xQXAJypZkzymgKtWj/4SPd6nSG0Qi7NH71qHrDSZLaA==\"\n      },\n      \"ILMerge.Fody\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.24.0, )\",\n        \"resolved\": \"1.24.0\",\n        \"contentHash\": \"Jg13T22kxyVUCP1lAfjSDKkL01XzMIM+GWd5kv9Hohi/9L2dhHZK55KQe2Yu/sHoQsYvRToeCDuIBKrNOJza7A==\",\n        \"dependencies\": {\n          \"Fody\": \"6.6.4\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp.Workspaces\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[5.0.0, )\",\n        \"resolved\": \"5.0.0\",\n        \"contentHash\": \"Al/Q8B+yO8odSqGVpSvrShMFDvlQdIBU//F3E6Rb0YdiLSALE9wh/pvozPNnfmh5HDnvU+mkmSjpz4hQO++jaA==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.Bcl.AsyncInterfaces\": \"9.0.0\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"3.11.0\",\n          \"Microsoft.CodeAnalysis.CSharp\": \"[5.0.0]\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.0.0]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.0.0]\",\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Composition\": \"9.0.0\",\n          \"System.IO.Pipelines\": \"9.0.0\",\n          \"System.Memory\": \"4.6.0\",\n          \"System.Numerics.Vectors\": \"4.6.0\",\n          \"System.Reflection.Metadata\": \"9.0.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\",\n          \"System.Text.Encoding.CodePages\": \"8.0.0\",\n          \"System.Threading.Channels\": \"8.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.6.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[3.3.1, )\",\n        \"resolved\": \"3.3.1\",\n        \"contentHash\": \"eT+kgNCDdTRbQ5WF6BGx1HI3D5jYfHteza/koefhWC2vNZGxObA74XxwWfg40dy3uUv7dn3OGKLK5GUPLroVog==\"\n      },\n      \"NETStandard.Library\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[2.0.3, )\",\n        \"resolved\": \"2.0.3\",\n        \"contentHash\": \"st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.1.0\"\n        }\n      },\n      \"SonarAnalyzer.CSharp.Styling\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[10.21.0.135717, )\",\n        \"resolved\": \"10.21.0.135717\",\n        \"contentHash\": \"hl264jF539oB7m2jED5QGM345eFSiDAdoJc8TH0HM6L7ZeqT5TDqZDQeZ8IDP02dVIpH/Fhhn+HsGfEcj8ohyQ==\"\n      },\n      \"StyleCop.Analyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.2.0-beta.556, )\",\n        \"resolved\": \"1.2.0-beta.556\",\n        \"contentHash\": \"llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==\",\n        \"dependencies\": {\n          \"StyleCop.Analyzers.Unstable\": \"1.2.0.556\"\n        }\n      },\n      \"Google.Protobuf\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"3.6.1\",\n        \"contentHash\": \"741fGeDQjixBJaU2j+0CbrmZXsNJkTn/hWbOh4fLVXndHsCclJmWznCPWrJmPoZKvajBvAz3e8ECJOUvRtwjNQ==\",\n        \"dependencies\": {\n          \"NETStandard.Library\": \"1.6.1\"\n        }\n      },\n      \"Humanizer.Core\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.14.1\",\n        \"contentHash\": \"lQKvtaTDOXnoVJ20ibTuSIOf2i0uO0MPbDhd1jm238I+U/2ZnRENj0cktKZhtchBMtCUSRQ5v4xBCUbKNmyVMw==\"\n      },\n      \"Microsoft.Bcl.AsyncInterfaces\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"owmu2Cr3IQ8yQiBleBHlGk8dSQ12oaF2e7TpzwJKEl4m84kkZJjEY1n33L67Y3zM5jPOjmmbdHjbfiL0RqcMRQ==\",\n        \"dependencies\": {\n          \"System.Threading.Tasks.Extensions\": \"4.5.4\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"3.11.0\",\n        \"contentHash\": \"v/EW3UE8/lbEYHoC2Qq7AR/DnmvpgdtAMndfQNmpuIMx/Mto8L5JnuCfdBYtgvalQOtfNCnxFejxuRrryvUTsg==\"\n      },\n      \"Microsoft.CodeAnalysis.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.0.0\",\n        \"contentHash\": \"ZXRAdvH6GiDeHRyd3q/km8Z44RoM6FBWHd+gen/la81mVnAdHTEsEkO5J0TCNXBymAcx5UYKt5TvgKBhaLJEow==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"3.11.0\",\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Memory\": \"4.6.0\",\n          \"System.Numerics.Vectors\": \"4.6.0\",\n          \"System.Reflection.Metadata\": \"9.0.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\",\n          \"System.Text.Encoding.CodePages\": \"8.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.6.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.0.0\",\n        \"contentHash\": \"5DSyJ9bk+ATuDy7fp2Zt0mJStDVKbBoiz1DyfAwSa+k4H4IwykAUcV3URelw5b8/iVbfSaOwkwmPUZH6opZKCw==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"3.11.0\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.0.0]\",\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Memory\": \"4.6.0\",\n          \"System.Numerics.Vectors\": \"4.6.0\",\n          \"System.Reflection.Metadata\": \"9.0.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\",\n          \"System.Text.Encoding.CodePages\": \"8.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.6.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Workspaces.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.0.0\",\n        \"contentHash\": \"ZbUmIvT6lqTNKiv06Jl5wf0MTMi1vQ1oH7ou4CLcs2C/no/L7EhP3T8y3XXvn9VbqMcJaJnEsNA1jwYUMgc5jg==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.Bcl.AsyncInterfaces\": \"9.0.0\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"3.11.0\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.0.0]\",\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Composition\": \"9.0.0\",\n          \"System.IO.Pipelines\": \"9.0.0\",\n          \"System.Memory\": \"4.6.0\",\n          \"System.Numerics.Vectors\": \"4.6.0\",\n          \"System.Reflection.Metadata\": \"9.0.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\",\n          \"System.Text.Encoding.CodePages\": \"8.0.0\",\n          \"System.Threading.Channels\": \"8.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.6.0\"\n        }\n      },\n      \"Microsoft.Composition\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.27\",\n        \"contentHash\": \"pwu80Ohe7SBzZ6i69LVdzowp6V+LaVRzd5F7A6QlD42vQkX0oT7KXKWWPlM/S00w1gnMQMRnEdbtOV12z6rXdQ==\"\n      },\n      \"Microsoft.NETCore.Platforms\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.1.0\",\n        \"contentHash\": \"kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==\"\n      },\n      \"StyleCop.Analyzers.Unstable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.2.0.556\",\n        \"contentHash\": \"zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==\"\n      },\n      \"System.Buffers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.6.0\",\n        \"contentHash\": \"lN6tZi7Q46zFzAbRYXTIvfXcyvQQgxnY7Xm6C6xQ9784dEL1amjM6S6Iw4ZpsvesAKnRVsM4scrDQaDqSClkjA==\"\n      },\n      \"System.Collections.Immutable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"QhkXUl2gNrQtvPmtBTQHb0YsUrDiDQ2QS09YbtTTiSjGcf7NBqtYbrG/BE06zcBPCKEwQGzIv13IVdXNOSub2w==\",\n        \"dependencies\": {\n          \"System.Memory\": \"4.5.5\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.0.0\"\n        }\n      },\n      \"System.Composition\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"3Djj70fFTraOarSKmRnmRy/zm4YurICm+kiCtI0dYRqGJnLX6nJ+G3WYuFJ173cAPax/gh96REcbNiVqcrypFQ==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\",\n          \"System.Composition.Convention\": \"9.0.0\",\n          \"System.Composition.Hosting\": \"9.0.0\",\n          \"System.Composition.Runtime\": \"9.0.0\",\n          \"System.Composition.TypedParts\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.AttributedModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"iri00l/zIX9g4lHMY+Nz0qV1n40+jFYAmgsaiNn16xvt2RDwlqByNG4wgblagnDYxm3YSQQ0jLlC/7Xlk9CzyA==\"\n      },\n      \"System.Composition.Convention\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"+vuqVP6xpi582XIjJi6OCsIxuoTZfR0M7WWufk3uGDeCl3wGW6KnpylUJ3iiXdPByPE0vR5TjJgR6hDLez4FQg==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.Hosting\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"OFqSeFeJYr7kHxDfaViGM1ymk7d4JxK//VSoNF9Ux0gpqkLsauDZpu89kTHHNdCWfSljbFcvAafGyBoY094btQ==\",\n        \"dependencies\": {\n          \"System.Composition.Runtime\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.Runtime\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"w1HOlQY1zsOWYussjFGZCEYF2UZXgvoYnS94NIu2CBnAGMbXFAX8PY8c92KwUItPmowal68jnVLBCzdrWLeEKA==\"\n      },\n      \"System.Composition.TypedParts\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"aRZlojCCGEHDKqh43jaDgaVpYETsgd7Nx4g1zwLKMtv4iTo0627715ajEFNpEEBTgLmvZuv8K0EVxc3sM4NWJA==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\",\n          \"System.Composition.Hosting\": \"9.0.0\",\n          \"System.Composition.Runtime\": \"9.0.0\"\n        }\n      },\n      \"System.IO.Pipelines\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"eA3cinogwaNB4jdjQHOP3Z3EuyiDII7MT35jgtnsA4vkn0LUrrSHsU0nzHTzFzmaFYeKV7MYyMxOocFzsBHpTw==\",\n        \"dependencies\": {\n          \"System.Buffers\": \"4.5.1\",\n          \"System.Memory\": \"4.5.5\",\n          \"System.Threading.Tasks.Extensions\": \"4.5.4\"\n        }\n      },\n      \"System.Memory\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.6.0\",\n        \"contentHash\": \"OEkbBQoklHngJ8UD8ez2AERSk2g+/qpAaSWWCBFbpH727HxDq5ydVkuncBaKcKfwRqXGWx64dS6G1SUScMsitg==\",\n        \"dependencies\": {\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Numerics.Vectors\": \"4.6.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\"\n        }\n      },\n      \"System.Numerics.Vectors\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.6.0\",\n        \"contentHash\": \"t+SoieZsRuEyiw/J+qXUbolyO219tKQQI0+2/YI+Qv7YdGValA6WiuokrNKqjrTNsy5ABWU11bdKOzUdheteXg==\"\n      },\n      \"System.Reflection.Metadata\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"ANiqLu3DxW9kol/hMmTWbt3414t9ftdIuiIU7j80okq2YzAueo120M442xk1kDJWtmZTqWQn7wHDvMRipVOEOQ==\",\n        \"dependencies\": {\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Memory\": \"4.5.5\"\n        }\n      },\n      \"System.Runtime.CompilerServices.Unsafe\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.1.0\",\n        \"contentHash\": \"5o/HZxx6RVqYlhKSq8/zronDkALJZUT2Vz0hx43f0gwe8mwlM0y2nYlqdBwLMzr262Bwvpikeb/yEwkAa5PADg==\"\n      },\n      \"System.Text.Encoding.CodePages\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"OZIsVplFGaVY90G2SbpgU7EnCoOO5pw1t4ic21dBF3/1omrJFpAGoNAVpPyMVOC90/hvgkGG3VFqR13YgZMQfg==\",\n        \"dependencies\": {\n          \"System.Memory\": \"4.5.5\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.0.0\"\n        }\n      },\n      \"System.Threading.Channels\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"CMaFr7v+57RW7uZfZkPExsPB6ljwzhjACWW1gfU35Y56rk72B/Wu+sTqxVmGSk4SFUlPc3cjeKND0zktziyjBA==\",\n        \"dependencies\": {\n          \"System.Threading.Tasks.Extensions\": \"4.5.4\"\n        }\n      },\n      \"System.Threading.Tasks.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.6.0\",\n        \"contentHash\": \"I5G6Y8jb0xRtGUC9Lahy7FUvlYlnGMMkbuKAQBy8Jb7Y6Yn8OlBEiUOY0PqZ0hy6Ua8poVA1ui1tAIiXNxGdsg==\",\n        \"dependencies\": {\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\"\n        }\n      },\n      \"sonaranalyzer.cfg\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer.Lightup\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.core\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Google.Protobuf\": \"[3.6.1, )\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.CFG\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.csharp.core\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.CFG\": \"[10.26.0, )\",\n          \"SonarAnalyzer.Core\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer.lightup\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/AnalysisContext/IAnalysisContext.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.AnalysisContext;\n\npublic interface IAnalysisContext\n{\n    Compilation Compilation { get; }\n    AnalyzerOptions Options { get; }\n    SonarAnalysisContext AnalysisContext { get; }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/AnalysisContext/IReport.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.AnalysisContext;\n\npublic interface IReport\n{\n    ReportingContext CreateReportingContext(Diagnostic diagnostic);\n}\n\n/// <summary>\n/// Interface for reporting contexts that are executed on a known Tree. The decisions about generated code and unchanged files are taken during action registration.\n/// </summary>\npublic interface ITreeReport : IReport\n{\n    SyntaxTree Tree { get; }\n\n    void ReportIssue(DiagnosticDescriptor rule,\n                     Location primaryLocation,\n                     IEnumerable<SecondaryLocation> secondaryLocations = null,\n                     ImmutableDictionary<string, string> properties = null,\n                     params string[] messageArgs);\n\n    [Obsolete(\"Use another overload of ReportIssue, without calling Diagnostic.Create\")]\n    void ReportIssue(Diagnostic diagnostic);\n}\n\n/// <summary>\n/// Base class for reporting contexts that are common for the entire compilation. Specific tree is not known before the action is executed.\n/// </summary>\npublic interface ICompilationReport : IReport\n{\n    void ReportIssue(GeneratedCodeRecognizer generatedCodeRecognizer,\n                     DiagnosticDescriptor rule,\n                     Location primaryLocation,\n                     IEnumerable<SecondaryLocation> secondaryLocations = null,\n                     params string[] messageArgs);\n\n    [Obsolete(\"Use another overload of ReportIssue, without calling Diagnostic.Create\")]\n    void ReportIssue(GeneratedCodeRecognizer generatedCodeRecognizer, Diagnostic diagnostic);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/AnalysisContext/IReportingContext.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.AnalysisContext;\n\npublic interface IReportingContext\n{\n    SyntaxTree Tree { get; }\n    Diagnostic Diagnostic { get; }\n\n    void ReportDiagnostic(Diagnostic diagnostic);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/AnalysisContext/IssueReporter.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text.RegularExpressions;\nusing SonarAnalyzer.CFG.Common;\n\nnamespace SonarAnalyzer.Core.AnalysisContext;\n\npublic static class IssueReporter\n{\n    private static readonly ImmutableHashSet<string> ExcludedFromDesignTimeRuleIds = ImmutableHashSet.Create(\n        \"S108\",\n        \"S1481\",\n        \"S927\",\n        \"S4487\",\n        \"S2696\",\n        \"S2259\",\n        \"S1144\",\n        \"S2325\",\n        \"S1117\",\n        \"S1481\",\n        \"S1871\");\n\n    private static readonly Regex VbNetErrorPattern = new Regex(@\"\\s+error(\\s+\\S+)?\\s*:\",\n        RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant,\n        Constants.DefaultRegexTimeout);\n\n    // Minimum supported version for Razor IDE is Visual Studio 17.9/Roslyn 4.9.2\n    // https://learn.microsoft.com/en-us/visualstudio/extensibility/roslyn-version-support?view=vs-2022\n    private static Version minimumDesignTimeRoslynVersion = new(\"4.9.2\");\n\n    public static void ReportIssueCore(Compilation compilation,\n                                       Func<DiagnosticDescriptor, bool> hasMatchingScope,\n                                       Func<Diagnostic, ReportingContext> createReportingContext,\n                                       DiagnosticDescriptor rule,\n                                       Location primaryLocation,\n                                       IEnumerable<SecondaryLocation> secondaryLocations = null,\n                                       ImmutableDictionary<string, string> properties = null,\n                                       params string[] messageArgs)\n    {\n        _ = rule ?? throw new ArgumentNullException(nameof(rule));\n        secondaryLocations ??= [];\n        properties ??= ImmutableDictionary<string, string>.Empty;\n        secondaryLocations = secondaryLocations.Where(x => x.Location.IsValid(compilation)).ToArray();\n        properties = properties.AddRange(secondaryLocations.Select((x, index) => new KeyValuePair<string, string>(index.ToString(), x.Message)));\n        var diagnostic = Diagnostic.Create(rule, primaryLocation, secondaryLocations.Select(x => x.Location), properties, messageArgs);\n        ReportIssueCore(hasMatchingScope, createReportingContext, diagnostic);\n    }\n\n    [Obsolete(\"Use another overload of ReportIssue, without calling Diagnostic.Create\")]\n    public static void ReportIssueCore(Func<DiagnosticDescriptor, bool> hasMatchingScope, Func<Diagnostic, ReportingContext> createReportingContext, Diagnostic diagnostic)\n    {\n        if (ShouldRaiseOnRazorFile(ref diagnostic)\n            && hasMatchingScope(diagnostic.Descriptor)\n            && SonarAnalysisContext.LegacyIsRegisteredActionEnabled(diagnostic.Descriptor, diagnostic.Location?.SourceTree))\n        {\n            var reportingContext = createReportingContext(diagnostic);\n            if (!diagnostic.Location.IsValid(reportingContext.Compilation))\n            {\n                Debug.Fail(\"Primary location should be part of the compilation. An AD0001 is raised if this is not the case.\");\n                return;\n            }\n            // This is the current way SonarLint will handle how and what to report.\n            if (SonarAnalysisContext.ReportDiagnostic is not null)\n            {\n                Debug.Assert(SonarAnalysisContext.ShouldDiagnosticBeReported is null, \"Not expecting SonarLint to set both the old and the new delegates.\");\n                SonarAnalysisContext.ReportDiagnostic(reportingContext);\n                return;\n            }\n            // Standalone NuGet, Scanner run and SonarLint < 4.0 used with latest NuGet\n            if (!IsTriggeringVbcError(reportingContext.Diagnostic) && (SonarAnalysisContext.ShouldDiagnosticBeReported?.Invoke(reportingContext.Tree, reportingContext.Diagnostic) ?? true))\n            {\n                reportingContext.ReportDiagnostic(reportingContext.Diagnostic);\n            }\n        }\n    }\n\n    internal static void SetMinimumDesignTimeRoslynVersion(Version version) =>\n     minimumDesignTimeRoslynVersion = version;\n\n    internal static Version GetMinimumDesignTimeRoslynVersion() =>\n        minimumDesignTimeRoslynVersion;\n\n    internal static bool IsTextMatchingVbcErrorPattern(string text) =>\n        text is not null && VbNetErrorPattern.SafeIsMatch(text);\n\n    private static bool ShouldRaiseOnRazorFile(ref Diagnostic diagnostic)\n    {\n        // On build time, if the diagnostic has a mapped location, we do the mapping ourselves and raise there.\n        if (GeneratedCodeRecognizer.IsBuildTimeRazorGeneratedFile(diagnostic.Location.SourceTree))\n        {\n            if (diagnostic.Location.GetMappedLineSpan().HasMappedPath)\n            {\n                // we want to map the locations of razor files exclusively during compile time, and not design time (IDE).\n                // The reason is that for IDE, the correct way to raise issues is directly on the generated files.\n                // source: https://github.com/dotnet/razor/issues/9308#issuecomment-1883869224\n                diagnostic = MapDiagnostic(diagnostic);\n                return true;\n            }\n            else\n            {\n                return false;\n            }\n        }\n        // On design time, we only raise on generated .ide.g.cs files if the diagnostic has a mapped location.\n        else if (GeneratedCodeRecognizer.IsDesignTimeRazorGeneratedFile(diagnostic.Location.SourceTree))\n        {\n            return diagnostic.Location.GetMappedLineSpan().HasMappedPath\n                && !ExcludedFromDesignTimeRuleIds.Contains(diagnostic.Id)\n                && !RoslynVersion.IsVersionLessThan(minimumDesignTimeRoslynVersion);\n        }\n        // If it is not a build/design-time generated file, it is a normal file.\n        else\n        {\n            return true;\n        }\n    }\n\n    private static Diagnostic MapDiagnostic(Diagnostic diagnostic)\n    {\n        var mappedLocation = diagnostic.Location.EnsureMappedLocation();\n\n        var descriptor = new DiagnosticDescriptor(\n            diagnostic.Descriptor.Id,\n            diagnostic.Descriptor.Title,\n            diagnostic.GetMessage(),\n            diagnostic.Descriptor.Category,\n            diagnostic.Descriptor.DefaultSeverity,\n            diagnostic.Descriptor.IsEnabledByDefault,\n            diagnostic.Descriptor.Description,\n            diagnostic.Descriptor.HelpLinkUri,\n            diagnostic.Descriptor.CustomTags.ToArray());\n\n        return Diagnostic.Create(descriptor,\n            mappedLocation,\n            diagnostic.AdditionalLocations.Select(x => x.EnsureMappedLocation()).ToImmutableList(),\n            diagnostic.Properties);\n    }\n\n    /// <summary>\n    /// VB.Net Complier (VBC) post-process issues and will fail if the line contains the <see cref=\"VbNetErrorPattern\"/>.\n    /// </summary>\n    /// <remarks>\n    /// This helper method is intended to be used only while waiting for the bug to be fixed on Microsoft side.\n    /// <see href=\"https://github.com/dotnet/roslyn/issues/5724\"/>.\n    /// </remarks>\n    /// <param name=\"diagnostic\">\n    /// The diagnostic to test.\n    /// </param>\n    /// <returns>\n    /// Returns <c>true</c> when reporting the diagnostic will trigger a VBC post-process error and <c>false</c> otherwise.\n    /// </returns>\n    private static bool IsTriggeringVbcError(Diagnostic diagnostic)\n    {\n        if (diagnostic.Location is null || diagnostic.Location.SourceTree?.GetRoot().Language != LanguageNames.VisualBasic)\n        {\n            return false;\n        }\n\n        var text = diagnostic.Location.SourceTree.GetText();\n        var lineNumber = diagnostic.Location.LineNumberToReport();\n\n        return IsTextMatchingVbcErrorPattern(text.Lines[lineNumber - 1].ToString());\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/AnalysisContext/ReportingContext.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.AnalysisContext;\n\npublic class ReportingContext : IReportingContext\n{\n    private readonly Action<Diagnostic> roslynReportDiagnostic;\n\n    public SyntaxTree Tree { get; }\n    public Diagnostic Diagnostic { get; }\n    public Compilation Compilation { get; }\n\n    public ReportingContext(SonarSyntaxNodeReportingContext context, Diagnostic diagnostic)\n        : this(diagnostic, context.Context.ReportDiagnostic, context.Compilation, context.Tree) { }\n\n    public ReportingContext(SonarSyntaxTreeReportingContext context, Diagnostic diagnostic)\n        : this(diagnostic, context.Context.ReportDiagnostic, context.Compilation, context.Tree) { }\n\n    public ReportingContext(SonarCompilationReportingContext context, Diagnostic diagnostic)\n        : this(diagnostic, context.Context.ReportDiagnostic, context.Compilation, diagnostic.Location?.SourceTree) { }\n\n    public ReportingContext(SonarSymbolReportingContext context, Diagnostic diagnostic)\n        : this(diagnostic, context.Context.ReportDiagnostic, context.Compilation, diagnostic.Location?.SourceTree) { }\n\n    public ReportingContext(SonarCodeBlockReportingContext context, Diagnostic diagnostic)\n        : this(diagnostic, context.Context.ReportDiagnostic, context.Compilation, context.Tree) { }\n\n    public ReportingContext(SonarSemanticModelReportingContext context, Diagnostic diagnostic)\n        : this(diagnostic, context.Context.ReportDiagnostic, context.Compilation, context.Tree) { }\n\n    internal ReportingContext(Diagnostic diagnostic, Action<Diagnostic> roslynReportDiagnostic, Compilation compilation, SyntaxTree tree)\n    {\n        Diagnostic = diagnostic;\n        this.roslynReportDiagnostic = roslynReportDiagnostic;\n        Compilation = compilation;\n        Tree = tree;\n    }\n\n    public void ReportDiagnostic(Diagnostic diagnostic) =>\n        roslynReportDiagnostic(diagnostic);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/AnalysisContext/ShouldAnalyzeTreeCache.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Roslyn.Utilities;\n\nnamespace SonarAnalyzer.Core.AnalysisContext;\n\ninternal class ShouldAnalyzeTreeCache\n{\n    private enum ShouldAnalyzeTree\n    {\n        NotComputed,\n        True,\n        False\n    }\n\n    private readonly HashSet<string> rulesDisabledForRazor =\n    [\n        \"S103\",\n        \"S104\",\n        \"S109\",\n        \"S113\",\n        \"S1147\",\n        \"S1192\",\n        \"S1451\",\n    ];\n\n    private SyntaxTree Tree { get; }\n    private bool IsRazorFile { get; }\n    private ShouldAnalyzeTree ShouldAnalyzeTreeResult { get; set; }\n\n    public ShouldAnalyzeTreeCache(SyntaxTree tree)\n    {\n        Tree = tree;\n        IsRazorFile = GeneratedCodeRecognizer.IsRazorGeneratedFile(tree);\n    }\n\n    /// <summary>\n    /// For each action registered on context we need to do some pre-processing before actually calling the rule.\n    /// SonarAnalysisContext.Execute ensures that the rule does apply to the current scope (main vs test source), so we do not need to check this here.\n    /// We call an external delegate (set by legacy SonarLint for VS) to ensure the rule should be run (usually\n    /// the decision is made on based on whether the project contains the analyzer as NuGet).\n    /// We also make sure that Razor files are not analyzed by rules that are not supported for Razor.\n    /// </summary>\n    [PerformanceSensitive(\"\")]\n    internal bool ShouldAnalyze<TSonarContext>(TSonarContext context, GeneratedCodeRecognizer generatedCodeRecognizer) where TSonarContext : IAnalysisContext\n    {\n        if (ShouldAnalyzeTreeResult == ShouldAnalyzeTree.NotComputed)\n        {\n            // We assume that we can ignore the generatedCodeRecognizer in the future. We only use it for the very first time we do the computation\n            // and assume all other generatedCodeRecognizer we could see here are returning the same result.\n            // We do not care about race conditions when setting ShouldAnalyzeTreeResult because\n            // we will set from NotComputed to True or False. Any concurrency happening here is safe.\n            ShouldAnalyzeTreeResult = context.ShouldAnalyzeTree(Tree, generatedCodeRecognizer)\n                ? ShouldAnalyzeTree.True\n                : ShouldAnalyzeTree.False;\n        }\n        var supportedDiagnostics = context.AnalysisContext.SupportedDiagnostics;\n        return ShouldAnalyzeTreeResult == ShouldAnalyzeTree.True\n            && LegacyIsRegisteredActionEnabled(supportedDiagnostics)\n            && ShouldAnalyzeRazorFile(supportedDiagnostics);\n    }\n\n    [PerformanceSensitive(\"\")]\n    private bool LegacyIsRegisteredActionEnabled(ImmutableArray<DiagnosticDescriptor> supportedDiagnostics) =>\n        SonarAnalysisContext.ShouldExecuteRegisteredAction is null // Box supportedDiagnostics only, if really needed\n        || SonarAnalysisContext.LegacyIsRegisteredActionEnabled(supportedDiagnostics, Tree); // We can not change the signature for compatibility reasons\n\n    [PerformanceSensitive(\"\")]\n    private bool ShouldAnalyzeRazorFile(ImmutableArray<DiagnosticDescriptor> supportedDiagnostics) =>\n        !IsRazorFile\n            || !supportedDiagnostics.Any(x => (x.CustomTags.Count() == 1 && x.CustomTags.Contains(DiagnosticDescriptorFactory.TestSourceScopeTag))\n                || rulesDisabledForRazor.Contains(x.Id));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/AnalysisContext/SonarAnalysisContext.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Text;\nusing RoslynAnalysisContext = Microsoft.CodeAnalysis.Diagnostics.AnalysisContext;\n\nnamespace SonarAnalyzer.Core.AnalysisContext;\n\npublic class SonarAnalysisContext\n{\n    private readonly RoslynAnalysisContext analysisContext;\n\n    /// <summary>\n    /// This delegate is called on all specific contexts, after the registration to the <see cref=\"RoslynAnalysisContext\"/>, to\n    /// control whether or not the action should be executed.\n    /// </summary>\n    /// <remarks>\n    /// This delegate is set by old SonarLint (from v4.0 to v5.5) when the project has the NuGet package installed to avoid\n    /// duplicated analysis and issues. When both the NuGet and the VSIX are available, NuGet will take precedence and VSIX\n    /// will be inhibited.\n    /// This delegate was removed from SonarLint v6.0.\n    /// </remarks>\n    public static Func<IEnumerable<DiagnosticDescriptor>, SyntaxTree, bool> ShouldExecuteRegisteredAction { get; set; }\n\n    /// <summary>\n    /// This delegates control whether or not a diagnostic should be reported to Roslyn.\n    /// </summary>\n    /// <remarks>\n    /// Currently this delegate is set by SonarLint (older than v4.0) to provide a suppression mechanism (i.e. specific issues turned off on the bound SonarQube).\n    /// </remarks>\n    public static Func<SyntaxTree, Diagnostic, bool> ShouldDiagnosticBeReported { get; set; }\n\n    /// <summary>\n    /// This delegate is used to supersede the default reporting action.\n    /// When this delegate is set, the delegate set for <see cref=\"ShouldDiagnosticBeReported\"/> is ignored.\n    /// </summary>\n    /// <remarks>\n    /// Currently this delegate is set by SonarLint (4.0+) to control how the diagnostic should be reported to Roslyn (including not being reported).\n    /// </remarks>\n    public static Action<IReportingContext> ReportDiagnostic { get; set; }\n\n    internal ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; }\n\n    internal SonarAnalysisContext(RoslynAnalysisContext analysisContext, ImmutableArray<DiagnosticDescriptor> supportedDiagnostics)\n    {\n        this.analysisContext = analysisContext ?? throw new ArgumentNullException(nameof(analysisContext));\n        SupportedDiagnostics = supportedDiagnostics;\n    }\n\n    private protected SonarAnalysisContext(SonarAnalysisContext context) : this(context.analysisContext, context.SupportedDiagnostics) { }\n\n    public bool TryGetValue<TValue>(SourceText text, SourceTextValueProvider<TValue> valueProvider, out TValue value) =>\n        analysisContext.TryGetValue(text, valueProvider, out value);\n\n    public void RegisterCodeBlockStartAction<TSyntaxKind>(GeneratedCodeRecognizer generatedCodeRecognizer, Action<SonarCodeBlockStartAnalysisContext<TSyntaxKind>> action)\n        where TSyntaxKind : struct =>\n        RegisterCompilationStartAction(\n            x => x.RegisterCodeBlockStartAction(generatedCodeRecognizer, action));\n\n    public void RegisterCompilationAction(Action<SonarCompilationReportingContext> action) =>\n        analysisContext.RegisterCompilationAction(\n            x => Execute(new(this, x), action));\n\n    public virtual void RegisterCompilationStartAction(Action<SonarCompilationStartAnalysisContext> action) =>\n        analysisContext.RegisterCompilationStartAction(\n            x => Execute(new(this, x), action));\n\n    public void RegisterSymbolAction(Action<SonarSymbolReportingContext> action, params SymbolKind[] symbolKinds) =>\n        RegisterCompilationStartAction(\n            x => x.RegisterSymbolAction(action, symbolKinds));\n\n    public void RegisterSymbolStartAction(Action<SonarSymbolStartAnalysisContext> action, SymbolKind symbolKind) =>\n        RegisterCompilationStartAction(\n            x => x.RegisterSymbolStartAction(action, symbolKind));\n\n    public void RegisterNodeAction<TSyntaxKind>(GeneratedCodeRecognizer generatedCodeRecognizer, Action<SonarSyntaxNodeReportingContext> action, params TSyntaxKind[] syntaxKinds)\n        where TSyntaxKind : struct =>\n        RegisterCompilationStartAction(\n            x => x.RegisterNodeAction(generatedCodeRecognizer, action, syntaxKinds));\n\n    public void RegisterSemanticModelAction(GeneratedCodeRecognizer generatedCodeRecognizer, Action<SonarSemanticModelReportingContext> action) =>\n        RegisterCompilationStartAction(\n            x => x.RegisterSemanticModelAction(generatedCodeRecognizer, action));\n\n    public void RegisterTreeAction(GeneratedCodeRecognizer generatedCodeRecognizer, Action<SonarSyntaxTreeReportingContext> action) =>\n        RegisterCompilationStartAction(\n            x => x.RegisterTreeAction(generatedCodeRecognizer, action));\n\n    /// <summary>\n    /// Register action for a SyntaxNode that is executed unconditionally:\n    /// <list type=\"bullet\">\n    /// <item>For all non-generated code.</item>\n    /// <item>For all generated code.</item>\n    /// <item>For all unchanged files under PR analysis.</item>\n    /// </list>\n    /// This should NOT be used for actions that report issues.\n    /// </summary>\n    public void RegisterNodeActionInAllFiles<TSyntaxKind>(Action<SonarSyntaxNodeReportingContext> action, params TSyntaxKind[] syntaxKinds) where TSyntaxKind : struct =>\n        analysisContext.RegisterSyntaxNodeAction(x => action(new(this, x)), syntaxKinds);\n\n    /// <summary>\n    /// Legacy API for backward compatibility with SonarLint v4.0 - v5.5. See <see cref=\"ShouldExecuteRegisteredAction\"/>.\n    /// </summary>\n    internal static bool LegacyIsRegisteredActionEnabled(IEnumerable<DiagnosticDescriptor> diagnostics, SyntaxTree tree) =>\n        ShouldExecuteRegisteredAction is null || tree is null || ShouldExecuteRegisteredAction(diagnostics, tree);\n\n    /// <summary>\n    /// Legacy API for backward compatibility with SonarLint v4.0 - v5.5. See <see cref=\"ShouldExecuteRegisteredAction\"/>.\n    /// </summary>\n    internal static bool LegacyIsRegisteredActionEnabled(DiagnosticDescriptor diagnostic, SyntaxTree tree) =>\n        ShouldExecuteRegisteredAction is null || tree is null || ShouldExecuteRegisteredAction(new[] { diagnostic }, tree);\n\n    private void Execute<TSonarContext>(TSonarContext context, Action<TSonarContext> action)\n        where TSonarContext : IAnalysisContext // Generic specialization: The JIT emmits a specialized version of Execute() for each struct TSonarContext, which means it gets called without boxing.\n    {\n        // For each action registered on context we need to do some pre-processing before actually calling the rule.\n        // We need to ensure the rule does apply to the current scope (main vs test source).\n        // Further checks are done in SonarCompilationStartAnalysisContext for registrations that have a syntax tree.\n        if (context.HasMatchingScope(SupportedDiagnostics))\n        {\n            action(context);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/AnalysisContext/SonarAnalysisContextBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.AnalysisContext;\n\npublic abstract class SonarAnalysisContextBase<TContext> : IAnalysisContext\n{\n    public abstract Compilation Compilation { get; }\n    public abstract AnalyzerOptions Options { get; }\n    public abstract CancellationToken Cancel { get; }\n\n    public SonarAnalysisContext AnalysisContext { get; }\n    public TContext Context { get; }\n\n    protected SonarAnalysisContextBase(SonarAnalysisContext analysisContext, TContext context)\n    {\n        AnalysisContext = analysisContext ?? throw new ArgumentNullException(nameof(analysisContext));\n        Context = context;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/AnalysisContext/SonarCodeBlockReportingContext.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.AnalysisContext;\n\npublic readonly record struct SonarCodeBlockReportingContext(SonarAnalysisContext AnalysisContext, CodeBlockAnalysisContext Context) : ITreeReport, IAnalysisContext\n{\n    public SyntaxTree Tree => Context.CodeBlock.SyntaxTree;\n    public Compilation Compilation => Context.SemanticModel.Compilation;\n    public AnalyzerOptions Options => Context.Options;\n    public CancellationToken Cancel => Context.CancellationToken;\n    public SyntaxNode CodeBlock => Context.CodeBlock;\n    public ISymbol OwningSymbol => Context.OwningSymbol;\n    public SemanticModel Model => Context.SemanticModel;\n\n    public ReportingContext CreateReportingContext(Diagnostic diagnostic) =>\n        new(this, diagnostic);\n\n    public void ReportIssue(DiagnosticDescriptor rule,\n                            Location primaryLocation,\n                            IEnumerable<SecondaryLocation> secondaryLocations = null,\n                            ImmutableDictionary<string, string> properties = null,\n                            params string[] messageArgs)\n    {\n        var @this = this;\n        IssueReporter.ReportIssueCore(\n            Compilation,\n            x => @this.HasMatchingScope(x),\n            CreateReportingContext,\n            rule,\n            primaryLocation,\n            secondaryLocations,\n            properties,\n            messageArgs);\n    }\n\n    [Obsolete(\"Use another overload of ReportIssue, without calling Diagnostic.Create\")]\n    public void ReportIssue(Diagnostic diagnostic)\n    {\n        var @this = this;\n        IssueReporter.ReportIssueCore(\n            x => @this.HasMatchingScope(x),\n            CreateReportingContext,\n            diagnostic);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/AnalysisContext/SonarCodeBlockStartAnalysisContext.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.AnalysisContext;\n\npublic sealed class SonarCodeBlockStartAnalysisContext<TSyntaxKind> : SonarAnalysisContextBase<CodeBlockStartAnalysisContext<TSyntaxKind>> where TSyntaxKind : struct\n{\n    public override Compilation Compilation => Context.SemanticModel.Compilation;\n    public override AnalyzerOptions Options => Context.Options;\n    public override CancellationToken Cancel => Context.CancellationToken;\n    public SyntaxNode CodeBlock => Context.CodeBlock;\n    public ISymbol OwningSymbol => Context.OwningSymbol;\n    public SemanticModel Model => Context.SemanticModel;\n\n    internal SonarCodeBlockStartAnalysisContext(SonarAnalysisContext analysisContext, CodeBlockStartAnalysisContext<TSyntaxKind> context) : base(analysisContext, context) { }\n\n    public void RegisterNodeAction(Action<SonarSyntaxNodeReportingContext> action, params TSyntaxKind[] symbolKinds) =>\n        Context.RegisterSyntaxNodeAction(x => action(new(AnalysisContext, x)), symbolKinds);\n\n    public void RegisterCodeBlockEndAction(Action<SonarCodeBlockReportingContext> action) =>\n        Context.RegisterCodeBlockEndAction(x => action(new(AnalysisContext, x)));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/AnalysisContext/SonarCodeFixContext.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.Core.AnalysisContext;\n\npublic readonly struct SonarCodeFixContext\n{\n    private readonly CodeFixContext context;\n\n    public readonly CancellationToken Cancel => context.CancellationToken;\n    public readonly Document Document => context.Document;\n    public readonly ImmutableArray<Diagnostic> Diagnostics => context.Diagnostics;\n    public readonly TextSpan Span => context.Span;\n\n    public SonarCodeFixContext(CodeFixContext context) =>\n        this.context = context;\n\n    public void RegisterCodeFix(string title, Func<CancellationToken, Task<Document>> createChangedDocument, ImmutableArray<Diagnostic> diagnostics) =>\n        context.RegisterCodeFix(CodeAction.Create(title, createChangedDocument, title), diagnostics);\n\n    public void RegisterCodeFix(string title, Func<CancellationToken, Task<Solution>> createChangedDocument, ImmutableArray<Diagnostic> diagnostics) =>\n        context.RegisterCodeFix(CodeAction.Create(title, createChangedDocument, title), diagnostics);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/AnalysisContext/SonarCompilationReportingContext.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\nusing System.Text.RegularExpressions;\n\nnamespace SonarAnalyzer.Core.AnalysisContext;\n\npublic readonly record struct SonarCompilationReportingContext(SonarAnalysisContext AnalysisContext, CompilationAnalysisContext Context) : ICompilationReport, IAnalysisContext\n{\n    // https://learn.microsoft.com/en-us/aspnet/core/fundamentals/environments#development-and-launchsettingsjson\n    private const string LaunchSettingsFileName = \"launchSettings.json\";\n\n    private static readonly TimeSpan FileNameTimeout = TimeSpan.FromMilliseconds(100);\n    private static readonly Regex WebConfigRegex = new(@\"[\\\\\\/]web\\.([^\\\\\\/]+\\.)?config$\", RegexOptions.IgnoreCase, FileNameTimeout);\n    private static readonly Regex AppSettingsRegex = new(@\"[\\\\\\/]appsettings\\.([^\\\\\\/]+\\.)?json$\", RegexOptions.IgnoreCase, FileNameTimeout);\n\n    public Compilation Compilation => Context.Compilation;\n    public AnalyzerOptions Options => Context.Options;\n    public CancellationToken Cancel => Context.CancellationToken;\n\n    public IEnumerable<string> WebConfigFiles()\n    {\n        return this.ProjectConfiguration().FilesToAnalyze.FindFiles(WebConfigRegex).Where(ShouldProcess);\n\n        static bool ShouldProcess(string path) =>\n            !Path.GetFileName(path).Equals(\"web.debug.config\", StringComparison.OrdinalIgnoreCase);\n    }\n\n    public IEnumerable<string> AppSettingsFiles()\n    {\n        return this.ProjectConfiguration().FilesToAnalyze.FindFiles(AppSettingsRegex).Where(ShouldProcess);\n\n        static bool ShouldProcess(string path) =>\n            !Path.GetFileName(path).Equals(\"appsettings.development.json\", StringComparison.OrdinalIgnoreCase);\n    }\n\n    public IEnumerable<string> LaunchSettingsFiles() =>\n        this.ProjectConfiguration().FilesToAnalyze.FindFiles(LaunchSettingsFileName);\n\n    public ReportingContext CreateReportingContext(Diagnostic diagnostic) =>\n        new(this, diagnostic);\n\n    public void ReportIssue(GeneratedCodeRecognizer generatedCodeRecognizer,\n                        DiagnosticDescriptor rule,\n                        Location primaryLocation,\n                        IEnumerable<SecondaryLocation> secondaryLocations = null,\n                        params string[] messageArgs)\n    {\n        if (this.ShouldAnalyzeTree(primaryLocation?.SourceTree, generatedCodeRecognizer))\n        {\n            var @this = this;\n            secondaryLocations = secondaryLocations?.Where(x => x.Location.IsValid(@this.Compilation)).ToArray();\n            IssueReporter.ReportIssueCore(\n                Compilation,\n                x => @this.HasMatchingScope(x),\n                CreateReportingContext,\n                rule,\n                primaryLocation,\n                secondaryLocations,\n                ImmutableDictionary<string, string>.Empty,\n                messageArgs);\n        }\n    }\n\n    [Obsolete(\"Use another overload of ReportIssue, without calling Diagnostic.Create\")]\n    public void ReportIssue(GeneratedCodeRecognizer generatedCodeRecognizer, Diagnostic diagnostic)\n    {\n        if (this.ShouldAnalyzeTree(diagnostic.Location.SourceTree, generatedCodeRecognizer))\n        {\n            var @this = this;\n            IssueReporter.ReportIssueCore(\n                x => @this.HasMatchingScope(x),\n                CreateReportingContext,\n                diagnostic);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/AnalysisContext/SonarCompilationStartAnalysisContext.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Text;\nusing Roslyn.Utilities;\nusing SonarAnalyzer.ShimLayer.AnalysisContext;\n\nnamespace SonarAnalyzer.Core.AnalysisContext;\n\npublic sealed class SonarCompilationStartAnalysisContext : SonarAnalysisContextBase<CompilationStartAnalysisContext>\n{\n    private static readonly SyntaxTreeValueProvider<ShouldAnalyzeTreeCache> ShouldAnalyzeValueProvider = new(x => new ShouldAnalyzeTreeCache(x));\n\n    public override Compilation Compilation => Context.Compilation;\n    public override AnalyzerOptions Options => Context.Options;\n    public override CancellationToken Cancel => Context.CancellationToken;\n    internal SonarCompilationStartAnalysisContext(SonarAnalysisContext analysisContext, CompilationStartAnalysisContext context) : base(analysisContext, context) { }\n\n    /// <inheritdoc cref=\"CompilationStartAnalysisContext.TryGetValue{TValue}(SourceText, SourceTextValueProvider{TValue}, out TValue)\"/>\n    public bool TryGetValue<TValue>(SourceText text, SourceTextValueProvider<TValue> valueProvider, out TValue value) =>\n        Context.TryGetValue(text, valueProvider, out value);\n\n    /// <inheritdoc cref=\"CompilationStartAnalysisContext.TryGetValue{TValue}(SyntaxTree, SyntaxTreeValueProvider{TValue}, out TValue)\"/>\n    public bool TryGetValue<TValue>(SyntaxTree tree, SyntaxTreeValueProvider<TValue> valueProvider, out TValue value) =>\n        Context.TryGetValue(tree, valueProvider, out value);\n\n    public void RegisterCodeBlockStartAction<TSyntaxKind>(GeneratedCodeRecognizer generatedCodeRecognizer, Action<SonarCodeBlockStartAnalysisContext<TSyntaxKind>> action)\n        where TSyntaxKind : struct =>\n        Context.RegisterCodeBlockStartAction<TSyntaxKind>(x => Execute(new(AnalysisContext, x), action, x.CodeBlock.SyntaxTree, generatedCodeRecognizer));\n\n    public void RegisterSymbolAction(Action<SonarSymbolReportingContext> action, params SymbolKind[] symbolKinds) =>\n        Context.RegisterSymbolAction(x => action(new(AnalysisContext, x)), symbolKinds);\n\n    public void RegisterSymbolStartAction(Action<SonarSymbolStartAnalysisContext> action, SymbolKind symbolKind) =>\n        Context.RegisterSymbolStartAction(x => action(new(AnalysisContext, x)), symbolKind);\n\n    public void RegisterCompilationEndAction(Action<SonarCompilationReportingContext> action) =>\n        Context.RegisterCompilationEndAction(x => action(new(AnalysisContext, x)));\n\n    public void RegisterSemanticModelActionInAllFiles(Action<SonarSemanticModelReportingContext> action) =>\n        Context.RegisterSemanticModelAction(x => action(new(AnalysisContext, x)));\n\n    public void RegisterSemanticModelAction(GeneratedCodeRecognizer generatedCodeRecognizer, Action<SonarSemanticModelReportingContext> action) =>\n        Context.RegisterSemanticModelAction(x => Execute(new(AnalysisContext, x), action, x.SemanticModel.SyntaxTree, generatedCodeRecognizer));\n\n    public void RegisterTreeAction(GeneratedCodeRecognizer generatedCodeRecognizer, Action<SonarSyntaxTreeReportingContext> action) =>\n        Context.RegisterSyntaxTreeAction(x => Execute(new(AnalysisContext, x, Context.Compilation), action, x.Tree, generatedCodeRecognizer));\n\n    /// <inheritdoc cref=\"SonarAnalysisContext.RegisterNodeActionInAllFiles{TSyntaxKind}(Action{SonarSyntaxNodeReportingContext}, TSyntaxKind[])\"/>\n    public void RegisterNodeActionInAllFiles<TSyntaxKind>(Action<SonarSyntaxNodeReportingContext> action, params TSyntaxKind[] syntaxKinds) where TSyntaxKind : struct =>\n        Context.RegisterSyntaxNodeAction(x => action(new(AnalysisContext, x)), syntaxKinds);\n\n#pragma warning disable HAA0303, HAA0302, HAA0301, HAA0502\n\n    [PerformanceSensitive(\"https://github.com/SonarSource/sonar-dotnet/issues/8406\", AllowCaptures = false, AllowGenericEnumeration = false, AllowImplicitBoxing = false)]\n    public void RegisterNodeAction<TSyntaxKind>(GeneratedCodeRecognizer generatedCodeRecognizer, Action<SonarSyntaxNodeReportingContext> action, params TSyntaxKind[] syntaxKinds)\n        where TSyntaxKind : struct =>\n        Context.RegisterSyntaxNodeAction(\n            x => Execute(\n                    new(AnalysisContext, x), // Critical hot-path: The newed SonarSyntaxNodeReportingContext is a struct and we need to ensure it is not boxed.\n                                             // This is achieved by generic specialization of \"Execute\" and under test by the SonarSyntaxNodeReportingContextMemoryTest UTs.\n                    action,\n                    x.Node.SyntaxTree,\n                    generatedCodeRecognizer),\n            syntaxKinds);\n\n    private void Execute<TSonarContext>(TSonarContext context, Action<TSonarContext> action, SyntaxTree sourceTree, GeneratedCodeRecognizer generatedCodeRecognizer = null)\n        where TSonarContext : IAnalysisContext // Generic specialization: The JIT emmits a specialized version of Execute() for each struct TSonarContext, which means it gets called without boxing.\n    {\n        Debug.Assert(context.HasMatchingScope(AnalysisContext.SupportedDiagnostics), \"SonarAnalysisContext.Execute does this check. It should never be needed here.\");\n        if (!TryGetValue(sourceTree, ShouldAnalyzeValueProvider, out var shouldAnalyzeTree))\n        {\n            shouldAnalyzeTree = new ShouldAnalyzeTreeCache(sourceTree);\n        }\n        if (shouldAnalyzeTree.ShouldAnalyze(context, generatedCodeRecognizer))\n        {\n            action(context);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/AnalysisContext/SonarParametrizedAnalysisContext.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.AnalysisContext;\n\npublic sealed class SonarParametrizedAnalysisContext : SonarAnalysisContext\n{\n    private readonly List<Action<SonarCompilationStartAnalysisContext>> postponedActions = new();\n\n    internal SonarParametrizedAnalysisContext(SonarAnalysisContext context) : base(context) { }\n\n    /// <summary>\n    /// Register CompilationStart action that will be executed once rule parameters are set.\n    /// </summary>\n    public override void RegisterCompilationStartAction(Action<SonarCompilationStartAnalysisContext> action) =>\n        postponedActions.Add(action);\n\n    /// <summary>\n    /// Execution of postponed registration actions. This should be called once all rule parameters are set.\n    /// </summary>\n    public void ExecutePostponedActions(SonarCompilationStartAnalysisContext context)\n    {\n        foreach (var action in postponedActions)\n        {\n            action(context);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/AnalysisContext/SonarSemanticModelReportingContext.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.AnalysisContext;\n\npublic readonly record struct SonarSemanticModelReportingContext(SonarAnalysisContext AnalysisContext, SemanticModelAnalysisContext Context) : ITreeReport, IAnalysisContext\n{\n    public SyntaxTree Tree => Model.SyntaxTree;\n    public Compilation Compilation => Context.SemanticModel.Compilation;\n    public AnalyzerOptions Options => Context.Options;\n    public CancellationToken Cancel => Context.CancellationToken;\n    public SemanticModel Model => Context.SemanticModel;\n\n    public ReportingContext CreateReportingContext(Diagnostic diagnostic) =>\n        new(this, diagnostic);\n\n    public void ReportIssue(DiagnosticDescriptor rule,\n                            Location primaryLocation,\n                            IEnumerable<SecondaryLocation> secondaryLocations = null,\n                            ImmutableDictionary<string, string> properties = null,\n                            params string[] messageArgs)\n    {\n        var @this = this;\n        IssueReporter.ReportIssueCore(\n            Compilation,\n            x => @this.HasMatchingScope(x),\n            CreateReportingContext,\n            rule,\n            primaryLocation,\n            secondaryLocations,\n            properties,\n            messageArgs);\n    }\n\n    [Obsolete(\"Use another overload of ReportIssue, without calling Diagnostic.Create\")]\n    public void ReportIssue(Diagnostic diagnostic)\n    {\n        var @this = this;\n        IssueReporter.ReportIssueCore(\n            x => @this.HasMatchingScope(x),\n            CreateReportingContext,\n            diagnostic);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/AnalysisContext/SonarSymbolReportingContext.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.AnalysisContext;\n\npublic readonly record struct SonarSymbolReportingContext(SonarAnalysisContext AnalysisContext, SymbolAnalysisContext Context) : ICompilationReport, IAnalysisContext\n{\n    public Compilation Compilation => Context.Compilation;\n    public AnalyzerOptions Options => Context.Options;\n    public CancellationToken Cancel => Context.CancellationToken;\n    public ISymbol Symbol => Context.Symbol;\n\n    public ReportingContext CreateReportingContext(Diagnostic diagnostic) =>\n       new(this, diagnostic);\n\n    public void ReportIssue(GeneratedCodeRecognizer generatedCodeRecognizer,\n                        DiagnosticDescriptor rule,\n                        Location primaryLocation,\n                        IEnumerable<SecondaryLocation> secondaryLocations = null,\n                        params string[] messageArgs)\n    {\n        if (this.ShouldAnalyzeTree(primaryLocation?.SourceTree, generatedCodeRecognizer))\n        {\n            var @this = this;\n            secondaryLocations = secondaryLocations?.Where(x => x.Location.IsValid(@this.Compilation)).ToArray();\n            IssueReporter.ReportIssueCore(\n                Compilation,\n                x => @this.HasMatchingScope(x),\n                CreateReportingContext,\n                rule,\n                primaryLocation,\n                secondaryLocations,\n                ImmutableDictionary<string, string>.Empty,\n                messageArgs);\n        }\n    }\n\n    [Obsolete(\"Use another overload of ReportIssue, without calling Diagnostic.Create\")]\n    public void ReportIssue(GeneratedCodeRecognizer generatedCodeRecognizer, Diagnostic diagnostic)\n    {\n        if (this.ShouldAnalyzeTree(diagnostic.Location.SourceTree, generatedCodeRecognizer))\n        {\n            var @this = this;\n            IssueReporter.ReportIssueCore(\n                x => @this.HasMatchingScope(x),\n                CreateReportingContext,\n                diagnostic);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/AnalysisContext/SonarSymbolStartAnalysisContext.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.ShimLayer.AnalysisContext;\n\nnamespace SonarAnalyzer.Core.AnalysisContext;\n\npublic sealed class SonarSymbolStartAnalysisContext : SonarAnalysisContextBase<SymbolStartAnalysisContextWrapper>\n{\n    public override Compilation Compilation => Context.Compilation;\n    public override AnalyzerOptions Options => Context.Options;\n    public override CancellationToken Cancel => Context.CancellationToken;\n    public ISymbol Symbol => Context.Symbol;\n\n    internal SonarSymbolStartAnalysisContext(SonarAnalysisContext analysisContext, SymbolStartAnalysisContextWrapper context) : base(analysisContext, context) { }\n\n    public void RegisterCodeBlockAction(Action<SonarCodeBlockReportingContext> action) =>\n        Context.RegisterCodeBlockAction(x => action(new(AnalysisContext, x)));\n\n    public void RegisterCodeBlockStartAction<TLanguageKindEnum>(Action<SonarCodeBlockStartAnalysisContext<TLanguageKindEnum>> action) where TLanguageKindEnum : struct =>\n        Context.RegisterCodeBlockStartAction<TLanguageKindEnum>(x => action(new(AnalysisContext, x)));\n\n    public void RegisterOperationAction(Action<OperationAnalysisContext> action, ImmutableArray<OperationKind> operationKinds) =>\n        // https://github.com/SonarSource/sonar-dotnet/issues/8878\n        throw new NotImplementedException(\"SonarOperationAnalysisContext wrapper type not implemented.\");\n\n    public void RegisterOperationBlockAction(Action<OperationBlockAnalysisContext> action) =>\n        // https://github.com/SonarSource/sonar-dotnet/issues/8878\n        throw new NotImplementedException(\"SonarOperationBlockAnalysisContext wrapper type not implemented.\");\n\n    public void RegisterOperationBlockStartAction(Action<OperationBlockStartAnalysisContext> action) =>\n        // https://github.com/SonarSource/sonar-dotnet/issues/8878\n        throw new NotImplementedException(\"SonarOperationBlockStartAnalysisContext wrapper type not implemented.\");\n\n    public void RegisterSymbolEndAction(Action<SonarSymbolReportingContext> action) =>\n        Context.RegisterSymbolEndAction(x => action(new(AnalysisContext, x)));\n\n    public void RegisterSyntaxNodeAction<TLanguageKindEnum>(Action<SonarSyntaxNodeReportingContext> action, params TLanguageKindEnum[] syntaxKinds) where TLanguageKindEnum : struct =>\n        Context.RegisterSyntaxNodeAction(x => action(new(AnalysisContext, x)), syntaxKinds);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/AnalysisContext/SonarSyntaxNodeReportingContext.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.AnalysisContext;\n\n// Performance note: this struct is used in the Roslyn analysis context and should be as lightweight as possible. It should not be boxed on the hot-path in the\n// registration (e.g. in SonarCompilationStartAnalysisContext.RegisterNodeAction) which is called for all matching syntax kinds of all syntax trees.\n// It is okay to box during issue reporting because reporting is rare in comparission.\npublic readonly record struct SonarSyntaxNodeReportingContext(SonarAnalysisContext AnalysisContext, SyntaxNodeAnalysisContext Context) : ITreeReport, IAnalysisContext\n{\n    public SyntaxTree Tree => Context.Node.SyntaxTree;\n    public Compilation Compilation => Context.Compilation;\n    public AnalyzerOptions Options => Context.Options;\n    public CancellationToken Cancel => Context.CancellationToken;\n    public SyntaxNode Node => Context.Node;\n    public SemanticModel Model => Context.SemanticModel;\n    public ISymbol ContainingSymbol => Context.ContainingSymbol;\n\n    /// <summary>\n    /// Roslyn invokes the analyzer twice for positional records. The first invocation is for the class declaration and the second for the ctor represented by the positional parameter list.\n    /// This behavior has been fixed since the Roslyn version 4.2.0 but we still need this for the proper support of Roslyn 4.0.0.\n    /// </summary>\n    /// <returns>\n    /// Returns <see langword=\"true\"/> for the invocation on the class declaration and <see langword=\"false\"/> for the ctor invocation.\n    /// </returns>\n    /// <example>\n    /// record R(int i);\n    /// </example>\n    /// <seealso href=\"https://github.com/dotnet/roslyn/issues/53136\"/>\n    public bool IsRedundantPositionalRecordContext() =>\n        Context.ContainingSymbol.Kind == SymbolKind.Method;\n\n    /// <summary>\n    /// Roslyn invokes the analyzer twice for PrimaryConstructorBaseType. The ContainingSymbol is first the type and second the constructor. This check filters can be used to filter\n    /// the first invocation. See also <seealso href=\"https://github.com/dotnet/roslyn/issues/70488\">#Roslyn/70488</seealso>.\n    /// </summary>\n    /// <returns>\n    /// Returns <see langword=\"true\"/> for the invocation with PrimaryConstructorBaseType and ContainingSymbol being <see cref=\"SymbolKind.NamedType\"/> and\n    /// <see langword=\"false\"/> for everything else.\n    /// </returns>\n    public bool IsRedundantPrimaryConstructorBaseTypeContext() =>\n        Context is\n        {\n            Node.RawKind: (int)SyntaxKindEx.PrimaryConstructorBaseType,\n            Compilation.Language: LanguageNames.CSharp,\n            ContainingSymbol.Kind: SymbolKind.NamedType,\n        };\n\n    public bool IsAzureFunction() =>\n        AzureFunctionMethod() is not null;\n\n    public IMethodSymbol AzureFunctionMethod() =>\n        Context.ContainingSymbol is IMethodSymbol method && method.HasAttribute(KnownType.Microsoft_Azure_WebJobs_FunctionNameAttribute)\n            ? method\n            : null;\n\n    public bool IsRazorAnalysisEnabled() =>\n        AnalysisContext.IsRazorAnalysisEnabled(Options, Compilation);\n\n    public ReportingContext CreateReportingContext(Diagnostic diagnostic) =>\n        new(this, diagnostic);\n\n    public void ReportIssue(DiagnosticDescriptor rule,\n                            Location primaryLocation,\n                            IEnumerable<SecondaryLocation> secondaryLocations = null,\n                            ImmutableDictionary<string, string> properties = null,\n                            params string[] messageArgs)\n    {\n        var @this = this; // This boxes this struct in the capture below, but that is okay because reporting is rare and not on the hot-path.\n        IssueReporter.ReportIssueCore(\n            Compilation,\n            x => @this.HasMatchingScope(x),\n            CreateReportingContext,\n            rule,\n            primaryLocation,\n            secondaryLocations,\n            properties,\n            messageArgs);\n    }\n\n    [Obsolete(\"Use another overload of ReportIssue, without calling Diagnostic.Create\")]\n    public void ReportIssue(Diagnostic diagnostic)\n    {\n        var @this = this;\n        IssueReporter.ReportIssueCore(\n            x => @this.HasMatchingScope(x),\n            CreateReportingContext,\n            diagnostic);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/AnalysisContext/SonarSyntaxTreeReportingContext.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.AnalysisContext;\n\n// SyntaxTreeAnalysisContext doesn't hold a Compilation reference, we need to provide it from CompilationStart context via constructor\npublic readonly record struct SonarSyntaxTreeReportingContext(SonarAnalysisContext AnalysisContext, SyntaxTreeAnalysisContext Context, Compilation Compilation) : ITreeReport, IAnalysisContext\n{\n    public SyntaxTree Tree => Context.Tree;\n    public AnalyzerOptions Options => Context.Options;\n    public CancellationToken Cancel => Context.CancellationToken;\n\n    public ReportingContext CreateReportingContext(Diagnostic diagnostic) =>\n        new(this, diagnostic);\n\n    public void ReportIssue(DiagnosticDescriptor rule,\n                            Location primaryLocation,\n                            IEnumerable<SecondaryLocation> secondaryLocations = null,\n                            ImmutableDictionary<string, string> properties = null,\n                            params string[] messageArgs)\n    {\n        var @this = this;\n        IssueReporter.ReportIssueCore(\n            Compilation,\n            x => @this.HasMatchingScope(x),\n            CreateReportingContext,\n            rule,\n            primaryLocation,\n            secondaryLocations,\n            properties,\n            messageArgs);\n    }\n\n    [Obsolete(\"Use another overload of ReportIssue, without calling Diagnostic.Create\")]\n    public void ReportIssue(Diagnostic diagnostic)\n    {\n        var @this = this;\n        IssueReporter.ReportIssueCore(\n            x => @this.HasMatchingScope(x),\n            CreateReportingContext,\n            diagnostic);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Analyzers/DiagnosticDescriptorFactory.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Analyzers;\n\npublic static class DiagnosticDescriptorFactory\n{\n    public static readonly string SonarWayTag = \"SonarWay\";\n    public static readonly string UtilityTag = \"Utility\";\n    public static readonly string MainSourceScopeTag = \"MainSourceScope\";\n    public static readonly string TestSourceScopeTag = \"TestSourceScope\";\n\n    /// <summary>\n    /// Indicates that the diagnostic is a compilation end diagnostic reported from a compilation end action.\n    /// </summary>\n    /// <remarks>\n    /// See also:\n    /// <list type=\"table\">\n    /// <item>\n    /// <see href=\"https://github.com/dotnet/roslyn/blob/371953b0685063eae905ac3afa12028d73ecbfa8/src/Compilers/Core/Portable/Diagnostic/WellKnownDiagnosticTags.cs#L64-L68\">WellKnownDiagnosticTags.cs</see>\n    /// </item>\n    /// <item>\n    /// <see href=\"https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/Microsoft.CodeAnalysis.Analyzers.md#rs1037-add-compilationend-custom-tag-to-compilation-end-diagnostic-descriptor\">RS1037</see>\n    /// </item>\n    /// </list>\n    /// </remarks>\n    public static readonly string CompilationEnd = nameof(CompilationEnd);\n\n    public static DiagnosticDescriptor CreateUtility(string diagnosticId, string title) =>\n        new(diagnosticId,\n            title,\n            string.Empty,\n            string.Empty,\n            DiagnosticSeverity.Warning,\n            isEnabledByDefault: true,\n            customTags: BuildUtilityTags());\n\n    public static DiagnosticDescriptor Create(AnalyzerLanguage language, RuleDescriptor rule, string messageFormat, bool? isEnabledByDefault, bool fadeOutCode, bool isCompilationEnd) =>\n        new(rule.Id,\n            rule.Title,\n            messageFormat,\n            rule.Category,\n            fadeOutCode ? DiagnosticSeverity.Info : DiagnosticSeverity.Warning,\n            rule.IsHotspot || (isEnabledByDefault ?? rule.SonarWay),\n            rule.Description,\n            null,\n            BuildTags(language, rule, fadeOutCode, isCompilationEnd));\n\n    private static string[] BuildTags(AnalyzerLanguage language, RuleDescriptor rule, bool fadeOutCode, bool isCompilationEnd)\n    {\n        var tags = new List<string> { language.LanguageName };\n        tags.AddRange(rule.Scope.ToTags());\n        Add(rule.SonarWay, SonarWayTag);\n        Add(fadeOutCode, WellKnownDiagnosticTags.Unnecessary);\n        Add(isCompilationEnd, CompilationEnd);\n        return tags.ToArray();\n\n        void Add(bool condition, string tag)\n        {\n            if (condition)\n            {\n                tags.Add(tag);\n            }\n        }\n    }\n\n    private static IEnumerable<string> ToTags(this SourceScope sourceScope) =>\n        sourceScope switch\n        {\n            SourceScope.Main => new[] { MainSourceScopeTag },\n            SourceScope.Tests => new[] { TestSourceScopeTag },\n            SourceScope.All => new[] { MainSourceScopeTag, TestSourceScopeTag },\n            _ => throw new NotSupportedException($\"{sourceScope} is not supported 'SourceScope' value.\"),\n        };\n\n    private static string[] BuildUtilityTags() =>\n        SourceScope.All.ToTags().Concat(new[] { UtilityTag })\n#if !DEBUG\n            // Allow to configure the analyzers in debug mode only. This allows to run test selectively (for example to test only one rule)\n            .Union(new[] { WellKnownDiagnosticTags.NotConfigurable })\n#endif\n            .ToArray();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Analyzers/HotspotDiagnosticAnalyzer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Analyzers;\n\npublic abstract class HotspotDiagnosticAnalyzer : SonarDiagnosticAnalyzer\n{\n    protected IAnalyzerConfiguration Configuration { get; }\n\n    protected HotspotDiagnosticAnalyzer(IAnalyzerConfiguration configuration) =>\n        Configuration = configuration;\n\n    protected bool IsEnabled(AnalyzerOptions options)\n    {\n        Configuration.Initialize(options);\n        return SupportedDiagnostics.Any(x => Configuration.IsEnabled(x.Id));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Analyzers/ParametrizedDiagnosticAnalyzer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Configuration;\n\nnamespace SonarAnalyzer.Core.Analyzers;\n\npublic abstract class ParametrizedDiagnosticAnalyzer : SonarDiagnosticAnalyzer\n{\n    protected abstract void Initialize(SonarParametrizedAnalysisContext context);\n\n    protected sealed override void Initialize(SonarAnalysisContext context)\n    {\n        var parameterContext = new SonarParametrizedAnalysisContext(context);\n        Initialize(parameterContext);\n\n        context.RegisterCompilationStartAction(\n            c =>\n            {\n                ParameterLoader.SetParameterValues(this, c.SonarLintXml());\n                parameterContext.ExecutePostponedActions(c);\n            });\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Analyzers/SonarCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CodeFixes;\n\nnamespace SonarAnalyzer.Core.Analyzers;\n\npublic abstract class SonarCodeFix : CodeFixProvider\n{\n    protected abstract Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context);\n\n    public override FixAllProvider GetFixAllProvider() =>\n        DocumentBasedFixAllProvider.Instance;\n\n    public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n    {\n        if (context.Document.SupportsSyntaxTree)\n        {\n            var syntaxRoot = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n            /// This only disables code-fixes when different versions are loaded\n            /// In case of analyzers, <see cref=\"SonarAnalysisContext.LegacyIsRegisteredActionEnabled\"/> is sufficient, because Roslyn only\n            /// creates a single instance from each assembly-version, so we can disable the VSIX analyzers\n            /// In case of code fix providers Roslyn creates multiple instances of the code fix providers. Which means that\n            /// we can only disable one of them if they are created from different assembly-versions.\n            /// If the VSIX and the NuGet has the same version, then code fixes show up multiple times, this ticket will fix this problem: https://github.com/dotnet/roslyn/issues/4030\n            if (SonarAnalysisContext.LegacyIsRegisteredActionEnabled([], syntaxRoot.SyntaxTree))\n            {\n                await RegisterCodeFixesAsync(syntaxRoot, new(context)).ConfigureAwait(false);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Analyzers/SonarDiagnosticAnalyzer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing RoslynAnalysisContext = Microsoft.CodeAnalysis.Diagnostics.AnalysisContext;\n\nnamespace SonarAnalyzer.Core.Analyzers;\n\n#pragma warning disable T0038 // Use field instead of protected auto-property. We want these class to provide uniform experience.\n\npublic abstract class SonarDiagnosticAnalyzer : DiagnosticAnalyzer\n{\n    public static readonly string EnableConcurrentExecutionVariable = \"SONAR_DOTNET_ENABLE_CONCURRENT_EXECUTION\";\n\n    protected abstract void Initialize(SonarAnalysisContext context);\n\n    protected virtual bool EnableConcurrentExecution => IsConcurrentExecutionEnabled();\n\n    public sealed override void Initialize(RoslynAnalysisContext context)\n    {\n        // The default values are Analyze | ReportDiagnostics. We do this call to make sure it will be still enabled even if the default values changed. (Needed for the razor analysis)\n        context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics);\n        if (EnableConcurrentExecution)\n        {\n            context.EnableConcurrentExecution();\n        }\n        Initialize(new SonarAnalysisContext(context, SupportedDiagnostics));\n    }\n\n    protected static bool IsConcurrentExecutionEnabled()\n    {\n        var value = Environment.GetEnvironmentVariable(EnableConcurrentExecutionVariable);\n        return value is null || !bool.TryParse(value, out var result) || result;\n    }\n}\n\npublic abstract class SonarDiagnosticAnalyzer<TSyntaxKind> : SonarDiagnosticAnalyzer\n    where TSyntaxKind : struct\n{\n    protected abstract string MessageFormat { get; }\n    protected abstract ILanguageFacade<TSyntaxKind> Language { get; }\n\n    public sealed override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n    protected DiagnosticDescriptor Rule { get; }\n\n    protected SonarDiagnosticAnalyzer(string diagnosticId) =>\n       Rule = Language.CreateDescriptor(diagnosticId, MessageFormat);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Analyzers/TrackerHotspotDiagnosticAnalyzer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.Core.Analyzers;\n\npublic abstract class TrackerHotspotDiagnosticAnalyzer<TSyntaxKind> : HotspotDiagnosticAnalyzer where TSyntaxKind : struct\n{\n    protected abstract ILanguageFacade<TSyntaxKind> Language { get; }\n    protected abstract void Initialize(TrackerInput input);\n\n    public sealed override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n    protected DiagnosticDescriptor Rule { get; }\n\n    protected TrackerHotspotDiagnosticAnalyzer(IAnalyzerConfiguration configuration, string diagnosticId, string messageFormat) : base(configuration) =>\n        Rule = Language.CreateDescriptor(diagnosticId, messageFormat);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        Initialize(new TrackerInput(context, Configuration, Rule));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Common/AnalyzerAdditionalFile.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.Core.Common;\n\npublic sealed class AnalyzerAdditionalFile : AdditionalText\n{\n    public AnalyzerAdditionalFile(string path)\n    {\n        Path = path;\n    }\n\n    public override string Path { get; }\n\n    public override SourceText GetText(CancellationToken cancel = default) =>\n        SourceText.From(File.ReadAllText(Path));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Common/AnalyzerConfiguration.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Common;\n\npublic class AnalyzerConfiguration\n{\n    /// <summary>\n    /// Hotspot rules are not configurable (from ruleset) to prevent them from appearing in SonarLint.\n    /// They are enabled by default and we check if SonarLint.xml contains the rule key on CompilationStart\n    /// to determine whether to run the analysis or not.\n    /// SonarLint.xml is added by both SonarScanner for .NET and by SonarLint, however there are differences:\n    /// - SonarLint only uses it to pass parameters to rules\n    /// - SonarScanner uses it to pass parameters and to enable security hotspots (which should only run in batch mode)\n    /// </summary>\n    public static IAnalyzerConfiguration Hotspot { get; } = new HotspotConfiguration(new RuleLoader());\n\n    public static IAnalyzerConfiguration AlwaysEnabled { get; } = new AlwaysEnabledConfiguration(false);\n\n    public static IAnalyzerConfiguration AlwaysEnabledWithSonarCfg { get; } = new AlwaysEnabledConfiguration(true);\n\n    private class AlwaysEnabledConfiguration : IAnalyzerConfiguration\n    {\n        public bool ForceSonarCfg { get; }\n\n        public AlwaysEnabledConfiguration(bool forceSonarCfg) =>\n            ForceSonarCfg = forceSonarCfg;\n\n        public void Initialize(AnalyzerOptions options)\n        {\n            // Ignore options because we always return true for IsEnabled\n        }\n\n        public bool IsEnabled(string ruleKey) => true;\n    }\n\n    /// <summary>\n    /// Singleton to hold the configuration for hotspot rules.\n    /// </summary>\n    internal /* for tests */ class HotspotConfiguration : IAnalyzerConfiguration\n    {\n        private readonly IRuleLoader ruleLoader;\n\n        // Hotspot configuration is cached at the assembly level and the MsBuild process\n        // can reuse the already loaded assembly when multiple projects are analyzed one after the other.\n        // Due to this we have to check the current configuration path to see if a reload is needed.\n        private string loadedSonarLintXmlPath;\n        private bool isInitialized;\n        private ISet<string> enabledRules = new HashSet<string>();\n\n        /// <summary>\n        /// There could be many rules that check if they are enabled simultaneously and since\n        /// the XML loading is an IO operation (e.g. slow) we lock until it completes to prevent\n        /// rules from wrongly deciding that they are disabled while the XML is loaded.\n        /// </summary>\n        private static readonly object IsInitializedGate = new object();\n\n        public bool ForceSonarCfg => false;\n\n        public HotspotConfiguration(IRuleLoader ruleLoader) => this.ruleLoader = ruleLoader;\n\n        public bool IsEnabled(string ruleKey) =>\n            // Initialize can be called multiple times, and the `enabledRules` can change between initializations,\n            // so here we have a race condition when a second initialization happens.\n            // We would need to lock here as well, or even better, make IsEnabled and Initialize atomic.\n            // https://github.com/SonarSource/sonar-dotnet/issues/4139\n            isInitialized\n                ? enabledRules.Contains(ruleKey)\n                : throw new InvalidOperationException(\"Call Initialize() before calling IsEnabled().\");\n\n        public void Initialize(AnalyzerOptions options)\n        {\n            var currentSonarLintXmlFile = options.SonarLintXml();\n            if (isInitialized && loadedSonarLintXmlPath == currentSonarLintXmlFile?.Path)\n            {\n                return;\n            }\n\n            lock (IsInitializedGate)\n            {\n                if (isInitialized && loadedSonarLintXmlPath == currentSonarLintXmlFile?.Path)\n                {\n                    return;\n                }\n\n                loadedSonarLintXmlPath = currentSonarLintXmlFile?.Path;\n\n                if (loadedSonarLintXmlPath == null)\n                {\n                    isInitialized = true;\n                    return;\n                }\n\n                // we assume the returned set is not null\n                var sonarLintXml = currentSonarLintXmlFile.GetText().ToString();\n                enabledRules = ruleLoader.GetEnabledRules(sonarLintXml);\n                isInitialized = true;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Common/AnalyzerLanguage.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\n\nnamespace SonarAnalyzer.Core.Common;\n\npublic sealed class AnalyzerLanguage\n{\n    public static readonly AnalyzerLanguage CSharp = new(LanguageNames.CSharp, \".cs\");\n    public static readonly AnalyzerLanguage VisualBasic = new(LanguageNames.VisualBasic, \".vb\");\n\n    public string LanguageName { get; }\n    public string FileExtension { get; }\n\n    private AnalyzerLanguage(string languageName, string fileExtension)\n    {\n        LanguageName = languageName;\n        FileExtension = fileExtension;\n    }\n\n    public override string ToString() =>\n        LanguageName;\n\n    public static AnalyzerLanguage FromName(string name) =>\n        name switch\n        {\n            LanguageNames.CSharp => CSharp,\n            LanguageNames.VisualBasic => VisualBasic,\n            _ => throw new NotSupportedException(\"Unsupported language name: \" + name)\n        };\n\n    public static AnalyzerLanguage FromPath(string path)\n    {\n        var comparer = StringComparer.OrdinalIgnoreCase;\n        return Path.GetExtension(path) switch\n        {\n            { } ext when comparer.Equals(ext, \".cs\") || comparer.Equals(ext, \".razor\") || comparer.Equals(ext, \".cshtml\") => CSharp,\n            { } ext when comparer.Equals(ext, \".vb\") => VisualBasic,\n            _ => throw new NotSupportedException(\"Unsupported file extension: \" + Path.GetExtension(path))\n        };\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Common/BidirectionalDictionary.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Common;\n\ninternal class BidirectionalDictionary<TA, TB>\n{\n    private readonly IDictionary<TA, TB> aToB = new Dictionary<TA, TB>();\n    private readonly IDictionary<TB, TA> bToA = new Dictionary<TB, TA>();\n\n    public ICollection<TA> AKeys => aToB.Keys;\n\n    public ICollection<TB> BKeys => bToA.Keys;\n\n    public void Add(TA a, TB b)\n    {\n        if (aToB.ContainsKey(a) || bToA.ContainsKey(b))\n        {\n            throw new ArgumentException(\"An element with the same key already exists in the BidirectionalDictionary.\");\n        }\n\n        aToB.Add(a, b);\n        bToA.Add(b, a);\n    }\n\n    public TB GetByA(TA a) => aToB[a];\n\n    public TA GetByB(TB b) => bToA[b];\n\n    public bool ContainsKeyByA(TA a) =>\n        aToB.ContainsKey(a);\n\n    public bool ContainsKeyByB(TB b) =>\n        bToA.ContainsKey(b);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Common/Constants.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Common;\n\npublic static class Constants\n{\n    internal static readonly string[] LineTerminators = { \"\\r\\n\", \"\\n\", \"\\r\" };\n\n    public static TimeSpan DefaultRegexTimeout => TimeSpan.FromMilliseconds(100);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Common/Conversions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Common;\n\npublic static class Conversions\n{\n    public static int? ToInt(object value) =>\n        ConvertWith(value, Convert.ToInt32);\n\n    public static double? ToDouble(object value)\n    {\n        if (value is char)  // 'char' needs to roundtrip char -> int -> double, can't go char -> double\n        {\n            value = Convert.ToInt32(value);\n        }\n        return ConvertWith(value, Convert.ToDouble) is { } doubleValue && !double.IsInfinity(doubleValue)\n            ? doubleValue\n            : null;\n    }\n\n    public static T? ConvertWith<T>(object value, Func<object, T> converter) where T : struct\n    {\n        try\n        {\n            return converter(value);\n        }\n        catch (Exception ex) when (ex is FormatException || ex is OverflowException || ex is InvalidCastException)\n        {\n            return null;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Common/DisjointSets.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Common;\n\n/// <summary>\n/// Data structure for working with disjoint sets of strings, to perform union-find operations with equality semantics:\n/// i.e. reflexivity, symmetry and transitivity.\n///\n/// See https://en.wikipedia.org/wiki/Disjoint-set_data_structure for an introduction to the data structure and\n/// https://www.geeksforgeeks.org/introduction-to-disjoint-set-data-structure-or-union-find-algorithm/ for examples of\n/// its use.\n///\n/// An example of use is to build undirected connected components of dependencies, where each node is the identifier.\n///\n/// Uses a dictionary of strings as a backing store. The dictionary represents a forest of trees, where each node is\n/// a string and each tree is a set of nodes.\n/// </summary>\npublic class DisjointSets\n{\n    private readonly Dictionary<string, string> parents;\n\n    public DisjointSets(IEnumerable<string> elements) =>\n        parents = elements.ToDictionary(x => x, x => x);\n\n    public void Union(string from, string to) =>\n        parents[FindRoot(from)] = FindRoot(to);\n\n    public string FindRoot(string element) =>\n        parents[element] is var root && root != element ? FindRoot(root) : root;\n\n    // Set elements are sorted in ascending order. Sets are sorted in ascending order by their first element.\n    public List<List<string>> GetAllSets() =>\n        [.. parents.GroupBy(x => FindRoot(x.Key), x => x.Key).Select(x => x.OrderBy(x => x).ToList()).OrderBy(x => x[0])];\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Common/DocumentBasedFixAllProvider.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\n\nnamespace SonarAnalyzer.Core.Common;\n\npublic class DocumentBasedFixAllProvider : FixAllProvider\n{\n    #region Singleton implementation\n\n    private DocumentBasedFixAllProvider()\n    {\n    }\n\n    private static readonly Lazy<DocumentBasedFixAllProvider> Lazy = new(() => new DocumentBasedFixAllProvider());\n    public static DocumentBasedFixAllProvider Instance => Lazy.Value;\n\n    #endregion Singleton implementation\n\n    private const string TitleSolutionPattern = \"Fix all '{0}' in Solution\";\n    private const string TitleScopePattern = \"Fix all '{0}' in '{1}'\";\n    private const string TitleFixAll = \"Fix all '{0}'\";\n\n    private static string GetFixAllTitle(FixAllContext fixAllContext)\n    {\n        var diagnosticIds = fixAllContext.DiagnosticIds;\n        var diagnosticId = string.Join(\",\", diagnosticIds.ToArray());\n\n        switch (fixAllContext.Scope)\n        {\n            case FixAllScope.Document:\n                return string.Format(TitleScopePattern, diagnosticId, fixAllContext.Document.Name);\n\n            case FixAllScope.Project:\n                return string.Format(TitleScopePattern, diagnosticId, fixAllContext.Project.Name);\n\n            case FixAllScope.Solution:\n                return string.Format(TitleSolutionPattern, diagnosticId);\n\n            default:\n                return TitleFixAll;\n        }\n    }\n\n    public override Task<CodeAction> GetFixAsync(FixAllContext fixAllContext)\n    {\n        var title = GetFixAllTitle(fixAllContext);\n\n        switch (fixAllContext.Scope)\n        {\n            case FixAllScope.Document:\n                return Task.FromResult(CodeAction.Create(title,\n                    async ct => fixAllContext.Document.WithSyntaxRoot(\n                        await GetFixedDocumentAsync(fixAllContext, fixAllContext.Document).ConfigureAwait(false))));\n\n            case FixAllScope.Project:\n                return Task.FromResult(CodeAction.Create(title,\n                    ct => GetFixedProjectAsync(fixAllContext, fixAllContext.Project)));\n\n            case FixAllScope.Solution:\n                return Task.FromResult(CodeAction.Create(title,\n                    ct => GetFixedSolutionAsync(fixAllContext)));\n\n            default:\n                return Task.FromResult<CodeAction>(null);\n        }\n    }\n\n    private static async Task<Solution> GetFixedSolutionAsync(FixAllContext fixAllContext)\n    {\n        var newSolution = fixAllContext.Solution;\n        foreach (var projectId in newSolution.ProjectIds)\n        {\n            newSolution = await GetFixedProjectAsync(fixAllContext, newSolution.GetProject(projectId))\n                .ConfigureAwait(false);\n        }\n        return newSolution;\n    }\n\n    private static async Task<Solution> GetFixedProjectAsync(FixAllContext fixAllContext, Project project)\n    {\n        var solution = project.Solution;\n        var newDocuments = project.Documents.ToDictionary(d => d.Id, d => GetFixedDocumentAsync(fixAllContext, d));\n        await Task.WhenAll(newDocuments.Values).ConfigureAwait(false);\n        foreach (var newDoc in newDocuments)\n        {\n            solution = solution.WithDocumentSyntaxRoot(newDoc.Key, newDoc.Value.Result);\n        }\n        return solution;\n    }\n\n    private static async Task<SyntaxNode> GetFixedDocumentAsync(FixAllContext fixAllContext, Document document)\n    {\n        var annotationKind = Guid.NewGuid().ToString();\n\n        var diagnostics = await fixAllContext.GetDocumentDiagnosticsAsync(document).ConfigureAwait(false);\n        var root = await document.GetSyntaxRootAsync(fixAllContext.CancellationToken).ConfigureAwait(false);\n        var elementDiagnosticPairs = diagnostics\n            .Select(d => new KeyValuePair<SyntaxNodeOrToken, Diagnostic>(GetReportedElement(d, root), d))\n            .Where(n => !n.Key.IsMissing)\n            .GroupBy(n => n.Key)\n            .ToDictionary(g => g.Key, g => g.First().Value);\n        diagnostics = elementDiagnosticPairs.Values.ToImmutableArray(); // Continue with unique winners\n\n        var diagnosticAnnotationPairs = new BidirectionalDictionary<Diagnostic, SyntaxAnnotation>();\n        CreateAnnotationForDiagnostics(diagnostics, annotationKind, diagnosticAnnotationPairs);\n        root = GetRootWithAnnotatedElements(root, elementDiagnosticPairs, diagnosticAnnotationPairs);\n\n        var currentDocument = document.WithSyntaxRoot(root);\n        var annotatedElements = root.GetAnnotatedNodesAndTokens(annotationKind).ToList();\n\n        while (annotatedElements.Any())\n        {\n            var element = annotatedElements.First();\n            var annotation = element.GetAnnotations(annotationKind).First();\n            var diagnostic = diagnosticAnnotationPairs.GetByB(annotation);\n            var location = root.GetAnnotatedNodesAndTokens(annotation).FirstOrDefault().GetLocation();\n            if (location == null)\n            {\n                // annotation is already removed from the tree\n                continue;\n            }\n\n            var newDiagnostic = Diagnostic.Create(\n                diagnostic.Descriptor,\n                location,\n                diagnostic.AdditionalLocations,\n                diagnostic.Properties);\n\n            var fixes = new List<CodeAction>();\n            var context = new CodeFixContext(currentDocument, newDiagnostic, (a, d) =>\n            {\n                lock (fixes)\n                {\n                    fixes.Add(a);\n                }\n            }, fixAllContext.CancellationToken);\n            await fixAllContext.CodeFixProvider.RegisterCodeFixesAsync(context).ConfigureAwait(false);\n\n            var action = fixes.FirstOrDefault(fix => fix.EquivalenceKey == fixAllContext.CodeActionEquivalenceKey);\n            if (action != null)\n            {\n                var operations = await action.GetOperationsAsync(fixAllContext.CancellationToken).ConfigureAwait(false);\n                var solution = operations.OfType<ApplyChangesOperation>().Single().ChangedSolution;\n                currentDocument = solution.GetDocument(document.Id);\n                root = await currentDocument.GetSyntaxRootAsync(fixAllContext.CancellationToken).ConfigureAwait(false);\n            }\n            root = RemoveAnnotationIfExists(root, annotation);\n            currentDocument = document.WithSyntaxRoot(root);\n            annotatedElements = root.GetAnnotatedNodesAndTokens(annotationKind).ToList();\n        }\n\n        return await currentDocument.GetSyntaxRootAsync(fixAllContext.CancellationToken).ConfigureAwait(false);\n    }\n\n    private static SyntaxNodeOrToken GetReportedElement(Diagnostic diagnostic, SyntaxNode root)\n    {\n        var token = root.FindToken(diagnostic.Location.SourceSpan.Start);\n        var exactMatch = token.Span == diagnostic.Location.SourceSpan;\n        return exactMatch\n            ? (SyntaxNodeOrToken)token\n            : root.FindNode(diagnostic.Location.SourceSpan, getInnermostNodeForTie: true);\n    }\n\n    private static SyntaxNode RemoveAnnotationIfExists(SyntaxNode root, SyntaxAnnotation annotation)\n    {\n        var element = root.GetAnnotatedNodesAndTokens(annotation).FirstOrDefault();\n        if (element == default)\n        {\n            return root;\n        }\n\n        if (element.IsNode)\n        {\n            var node = element.AsNode();\n            return root.ReplaceNode(\n                node,\n                node.WithoutAnnotations(annotation));\n        }\n\n        var token = element.AsToken();\n        return root.ReplaceToken(\n            token,\n            token.WithoutAnnotations(annotation));\n    }\n\n    private static SyntaxNode GetRootWithAnnotatedElements(SyntaxNode root,\n        Dictionary<SyntaxNodeOrToken, Diagnostic> elementDiagnosticPairs,\n        BidirectionalDictionary<Diagnostic, SyntaxAnnotation> diagnosticAnnotationPairs)\n    {\n        var nodes = elementDiagnosticPairs.Keys.Where(k => k.IsNode).Select(k => k.AsNode());\n        var tokens = elementDiagnosticPairs.Keys.Where(k => k.IsToken).Select(k => k.AsToken());\n\n        return root.ReplaceSyntax(\n            nodes,\n            (original, rewritten) =>\n            {\n                var annotation = diagnosticAnnotationPairs.GetByA(elementDiagnosticPairs[original]);\n                return rewritten.WithAdditionalAnnotations(annotation);\n            },\n            tokens,\n            (original, rewritten) =>\n            {\n                var annotation = diagnosticAnnotationPairs.GetByA(elementDiagnosticPairs[original]);\n                return rewritten.WithAdditionalAnnotations(annotation);\n            },\n            null, null);\n    }\n\n    private static void CreateAnnotationForDiagnostics(System.Collections.Immutable.ImmutableArray<Diagnostic> diagnostics,\n        string annotationKind,\n        BidirectionalDictionary<Diagnostic, SyntaxAnnotation> diagnosticAnnotationPairs)\n    {\n        foreach (var diagnostic in diagnostics)\n        {\n            diagnosticAnnotationPairs.Add(diagnostic, new SyntaxAnnotation(annotationKind));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Common/HashCode.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Runtime.CompilerServices;\nusing Roslyn.Utilities;\n\nnamespace SonarAnalyzer.Core.Common;\n\npublic static class HashCode    // Replacement for System.HashCode that is available from .NET Standard 2.1\n{\n    private const uint Seed = 374761393U;\n    private const uint PreMultiplier = 3266489917U;\n    private const uint PostMultiplier = 668265263U;\n    private const int RotateOffset = 17;\n    private const int IntSeed = 393241;\n\n    [PerformanceSensitive(\"https://github.com/SonarSource/sonar-dotnet/pull/7012\", AllowCaptures = false, AllowGenericEnumeration = false, AllowImplicitBoxing = false)]\n    public static int DictionaryContentHash<TKey, TValue>(ImmutableDictionary<TKey, TValue> dictionary)\n    {\n        // Performance: Make sure this method is allocation free:\n        // * Don't use IDictionary<TKey, TValue> as parameter, because we will not get the struct ImmutableDictionary.Enumerator but the boxed version of it\n        // * Don't use Linq for the same reason.\n        if (dictionary.IsEmpty)\n        {\n            return 0;\n        }\n\n        var seed = IntSeed;\n        foreach (var kvp in dictionary)\n        {\n            seed ^= Combine(kvp.Key, kvp.Value);\n        }\n        return seed;\n    }\n\n    /// <summary>\n    /// Calculates a hash for the enumerable based on the content. The same values in a different order produce the same hash-code.\n    /// </summary>\n    public static int EnumerableUnorderedContentHash<TValue>(IEnumerable<TValue> enumerable) =>\n        enumerable.Aggregate(IntSeed, (seed, x) => seed ^ (x?.GetHashCode() ?? 0));\n\n    /// <summary>\n    /// Calculates a hash for the enumerable based on the content. The same values in a different order produce different hash-codes.\n    /// </summary>\n    public static int EnumerableOrderedContentHash<TValue>(IEnumerable<TValue> enumerable) =>\n        enumerable.Aggregate(IntSeed, Combine);\n\n    public static int Combine<T1, T2>(T1 a, T2 b) =>\n        (int)Seed.AddHash(a?.GetHashCode()).AddHash(b?.GetHashCode());\n\n    public static int Combine<T1, T2, T3>(T1 a, T2 b, T3 c) =>\n        (int)Combine(a, b).AddHash(c?.GetHashCode());\n\n    public static int Combine<T1, T2, T3, T4>(T1 a, T2 b, T3 c, T4 d) =>\n        (int)Combine(a, b, c).AddHash(d?.GetHashCode());\n\n    public static int Combine<T1, T2, T3, T4, T5>(T1 a, T2 b, T3 c, T4 d, T5 e) =>\n        (int)Combine(a, b, c, d).AddHash(e?.GetHashCode());\n\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    private static uint AddHash(this int hash, int? value) =>\n        ((uint)hash).AddHash(value);\n\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    private static uint AddHash(this uint hash, int? value) =>\n        RotateLeft(hash + (uint)(value ?? 0) * PreMultiplier) * PostMultiplier;\n\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    private static uint RotateLeft(uint value) =>\n        (value << RotateOffset) | (value >> (sizeof(int) - RotateOffset));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Common/IAnalyzerConfiguration.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Common;\n\npublic interface IAnalyzerConfiguration\n{\n    // Force the use of Sonar Cfg in rules that support both Roslyn and Sonar CFGs\n    bool ForceSonarCfg { get; }\n\n    bool IsEnabled(string ruleKey);\n\n    void Initialize(AnalyzerOptions options);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Common/IRuleLoader.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Common;\n\npublic interface IRuleLoader\n{\n    ISet<string> GetEnabledRules(string content);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Common/ISafeSyntaxWalker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Common;\n\npublic interface ISafeSyntaxWalker\n{\n    public bool SafeVisit(SyntaxNode syntaxNode);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Common/IsExternalInit.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.ComponentModel;\n\nnamespace System.Runtime.CompilerServices;\n\n// This empty class needs to exist when C# 9 init-only setters are used in project targeting .NET Framework.\n// https://docs.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.isexternalinit?view=net-6.0\n// It is used only by compiler to track metadata. It does not affect MSIL, CLR nor runtime.\n// https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-9.0/init#metadata-encoding\n[EditorBrowsable(EditorBrowsableState.Never)]\npublic static class IsExternalInit { }\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Common/MultiValueDictionary.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Common;\n\npublic sealed class MultiValueDictionary<TKey, TValue> : Dictionary<TKey, ICollection<TValue>>\n{\n    public static MultiValueDictionary<TKey, TValue> Create<TUnderlying>()\n        where TUnderlying : ICollection<TValue>, new() =>\n        new MultiValueDictionary<TKey, TValue>\n        {\n            UnderlyingCollectionFactory = () => new TUnderlying()\n        };\n\n    private Func<ICollection<TValue>> UnderlyingCollectionFactory { get; set; } = () => new List<TValue>();\n\n    public void Add(TKey key, TValue value) =>\n        AddWithKey(key, value);\n\n    public void AddWithKey(TKey key, TValue value)\n    {\n        if (!TryGetValue(key, out var values))\n        {\n            values = UnderlyingCollectionFactory();\n            Add(key, values);\n        }\n        values.Add(value);\n    }\n\n    public void AddRangeWithKey(TKey key, IEnumerable<TValue> addedValues)\n    {\n        if (!TryGetValue(key, out var values))\n        {\n            values = UnderlyingCollectionFactory();\n            Add(key, values);\n        }\n        foreach (var addedValue in addedValues)\n        {\n            values.Add(addedValue);\n        }\n    }\n}\n\n#region Extensions\n\npublic static class MultiValueDictionaryExtensions\n{\n    public static MultiValueDictionary<TSource, TElement> ToMultiValueDictionary<TSource, TElement>(this IEnumerable<TSource> source, Func<TSource, ICollection<TElement>> elementSelector) =>\n        source.ToMultiValueDictionary(x => x, elementSelector);\n\n    public static MultiValueDictionary<TKey, TElement> ToMultiValueDictionary<TSource, TKey, TElement>(this IEnumerable<TSource> source,\n                                                                                                       Func<TSource, TKey> keySelector,\n                                                                                                       Func<TSource, ICollection<TElement>> elementSelector)\n    {\n        var dictionary = new MultiValueDictionary<TKey, TElement>();\n        foreach (var item in source)\n        {\n            dictionary.Add(keySelector(item), elementSelector(item));\n        }\n        return dictionary;\n    }\n}\n\n#endregion Extensions\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Common/NaturalLanguageDetector.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Globalization;\nusing System.Text;\nusing System.Text.RegularExpressions;\n\nnamespace SonarAnalyzer.Core.Common;\n\n// Java implementation: https://github.com/SonarSource/sonar-java/blob/master/java-checks/src/main/java/org/sonar/java/checks/helpers/LatinAlphabetLanguagesHelper.java\npublic static class NaturalLanguageDetector\n{\n    private static readonly double[] WordFirstLetterFrequency = [2.6590433d, 1.2620203d, 1.5564419d, 0.9035879d, 0.7042806d, 1.1847413d, 0.4955763d, 0.9510469d, 1.7106735d,\n    0.2684641d,\n    0.2196475d, 0.7503985d, 1.087598d, 0.6504237d, 1.7798191d, 1.2322421d, 0.0468438d, 0.9674179d, 1.8778546d, 3.5174797d, 0.4200321d, 0.2624742d, 1.2915608d, 0.0095785d,\n    0.1583926d, 0.0323609d];\n\n    private static readonly double[] WordLastLetterFrequency = [0.5738782d, 0.0514104d, 0.2813366d, 2.509574d, 4.8288358d, 1.0461689d, 0.7732504d, 0.7288072d, 0.1805434d,\n    0.0053191d, 0.2896774d,\n    0.9860451d, 0.5045335d, 2.8780559d, 1.0164436d, 0.183349d, 0.0039651d, 1.6346942d, 3.5859066d, 1.9681061d, 0.0870041d, 0.0362143d, 0.207057d, 0.0560339d, 1.5560091d,\n    0.0277812d];\n\n    private static readonly double[][] CharacterPairFrequency = [\n    [0.0929348d, 1.3457961d, 2.7854923d, 2.5539888d, 0.2209547d, 0.6705441d, 1.8441841d, 0.2415183d, 2.1081316d, 0.1513539d, 0.7217594d, 8.0951704d, 3.0899456d, 14.1108051d,\n      0.0792523d, 1.3738109d, 0.0387682d, 8.5247815d, 6.357247d, 8.850255d, 1.0730911d, 1.0915589d, 0.4722228d, 0.1239866d, 1.5762482d, 0.218569d],\n    [1.9067869d, 0.1279563d, 0.0739743d, 0.0265155d, 3.4357286d, 0.0049029d, 0.005839d, 0.0312368d, 0.956677d, 0.0743913d, 0.0039669d, 1.3367944d, 0.0346314d, 0.0176708d,\n      1.5688768d, 0.0101957d, 0.0006587d, 1.1051669d, 0.3112683d, 0.0468363d, 1.321757d, 0.0127821d, 0.0117435d, 0.0007594d, 1.2868484d, 0.0017814d],\n    [4.0719631d, 0.0205519d, 0.4552517d, 0.0478322d, 4.0359256d, 0.0136253d, 0.0141062d, 4.2610277d, 1.9324629d, 0.0027702d, 1.1371642d, 1.4239825d, 0.0214459d, 0.0160944d,\n      5.2439283d, 0.0142073d, 0.0346805d, 1.0777674d, 0.2821967d, 2.8990383d, 1.0071517d, 0.0049062d, 0.0070608d, 0.0009994d, 0.2640629d, 0.0263652d],\n    [1.4407028d, 0.0366525d, 0.0727675d, 0.3063419d, 5.3874701d, 0.0432824d, 0.1899634d, 0.0710289d, 3.8700951d, 0.0319036d, 0.0064268d, 0.1858389d, 0.1456839d, 0.0833305d,\n      1.2408384d, 0.0215672d, 0.0132501d, 0.6165595d, 0.7798563d, 0.0405733d, 1.0407546d, 0.1140672d, 0.1005016d, 0.0014863d, 0.2886946d, 0.0112261d],\n    [4.4101634d, 0.5402931d, 3.1511903d, 8.335849d, 2.1665083d, 1.0040715d, 0.9092963d, 0.1880728d, 1.0110292d, 0.0358556d, 0.188317d, 3.8583031d, 2.2997606d, 8.5360484d,\n      0.7791784d, 1.1289852d, 0.2515411d, 14.4775826d, 8.3971751d, 2.7876921d, 0.3437904d, 1.4431433d, 0.9862942d, 1.1282521d, 0.8072609d, 0.0804047d],\n    [0.9463967d, 0.0087502d, 0.0314099d, 0.0487887d, 1.5768827d, 0.7325095d, 0.0113305d, 0.0027475d, 2.0741465d, 0.0032058d, 0.0049733d, 0.4309108d, 0.0223647d, 0.0049622d,\n      3.2088246d, 0.0047891d, 0.0004224d, 1.5815529d, 0.0435306d, 0.5887487d, 0.4870926d, 0.0019864d, 0.0038661d, 0.0018069d, 0.0444506d, 0.0011643d],\n    [1.4170025d, 0.0481224d, 0.0082768d, 0.0816686d, 3.0209535d, 0.0149393d, 0.1457067d, 1.2637355d, 1.121449d, 0.0042659d, 0.006808d, 0.5162312d, 0.0464436d, 0.4306755d,\n      0.8720109d, 0.0092219d, 0.0014534d, 1.302087d, 0.3605589d, 0.1215897d, 0.9230535d, 0.003158d, 0.0317547d, 0.0021631d, 0.2001351d, 0.0043706d],\n    [4.3917104d, 0.0536482d, 0.0181969d, 0.0394497d, 16.2490394d, 0.0149868d, 0.0059029d, 0.0085796d, 4.4951994d, 0.0023695d, 0.012801d, 0.1408159d, 0.1344758d, 0.270349d,\n      3.0645262d, 0.0150515d, 0.0061781d, 0.5387961d, 0.2133521d, 0.6162165d, 0.5563874d, 0.0095012d, 0.0915231d, 0.0005191d, 0.3276425d, 0.0056028d],\n    [3.0618075d, 0.5378794d, 5.3672662d, 1.7146727d, 2.6249932d, 0.9268649d, 1.6588638d, 0.0298823d, 0.1653869d, 0.0423041d, 0.4355309d, 3.3780001d, 1.6210354d, 16.2047698d,\n      5.3259079d, 0.8335975d, 0.06607d, 2.5575842d, 7.7396368d, 6.8953537d, 0.1660788d, 1.8670839d, 0.0228681d, 0.1719965d, 0.0319517d, 0.3727173d],\n    [0.5384459d, 0.0018035d, 0.0037464d, 0.0049227d, 0.3791862d, 0.0016495d, 0.0030904d, 0.0047405d, 0.1010139d, 0.0030284d, 0.0051238d, 0.0023837d, 0.0052344d, 0.0054429d,\n      0.5759392d, 0.0419588d, 0.0001699d, 0.0199578d, 0.0076412d, 0.0024995d, 0.511387d, 0.0018288d, 0.0015663d, 0.0003011d, 0.0024199d, 0.0015624d],\n    [0.4584126d, 0.0151268d, 0.0066457d, 0.0105469d, 1.4778732d, 0.0156612d, 0.0235217d, 0.0926333d, 0.9247234d, 0.0043772d, 0.028332d, 0.1271601d, 0.0365927d, 0.2679984d,\n      0.2570398d, 0.0171023d, 0.0008536d, 0.0805852d, 0.6105992d, 0.0285942d, 0.115693d, 0.007477d, 0.0280535d, 0.0013893d, 0.1124803d, 0.0013102d],\n    [4.548621d, 0.2915819d, 0.089763d, 1.4893018d, 6.3515348d, 0.2311593d, 0.0921435d, 0.0322694d, 5.0245197d, 0.0092016d, 0.1856222d, 3.8105199d, 0.4655274d, 0.0369741d,\n      2.6739741d, 0.153297d, 0.0018632d, 0.0689171d, 1.1608595d, 0.8001751d, 0.9675034d, 0.2130048d, 0.102301d, 0.0016705d, 2.2223913d, 0.0112197d],\n    [4.4732575d, 0.9971554d, 0.0892385d, 0.0154109d, 5.1403143d, 0.0175541d, 0.0107624d, 0.0132742d, 2.3275322d, 0.0027971d, 0.0088211d, 0.0391983d, 0.8021489d, 0.0887556d,\n      2.0619624d, 1.4747935d, 0.0008712d, 0.0401555d, 0.5991706d, 0.0220131d, 0.881698d, 0.0076061d, 0.0126008d, 0.0026432d, 0.3033358d, 0.0023306d],\n    [3.6077607d, 0.0975166d, 2.589403d, 7.9063088d, 4.6470058d, 0.3556239d, 6.2425962d, 0.1073503d, 3.0557149d, 0.0788384d, 0.6186266d, 0.3370293d, 0.17844d, 0.8651743d,\n      2.8184623d, 0.0480307d, 0.0223127d, 0.102047d, 3.1470283d, 6.0322931d, 0.6582686d, 0.2595533d, 0.0651263d, 0.0103653d, 0.6055506d, 0.0792284d],\n    [0.5652844d, 0.5958594d, 1.2994182d, 1.1115993d, 0.2776038d, 6.3941577d, 0.7715881d, 0.2678748d, 0.5253778d, 0.0947828d, 0.4635273d, 2.920816d, 3.7278997d, 11.6017554d,\n      1.4753292d, 1.8177215d, 0.0118906d, 8.8419322d, 1.7595924d, 2.4753308d, 4.5261994d, 1.4178813d, 1.8557399d, 0.1644457d, 0.2754933d, 0.0487071d],\n    [2.5624505d, 0.0202675d, 0.0204994d, 0.022034d, 2.9595845d, 0.015402d, 0.0525791d, 0.7732213d, 1.0678211d, 0.0022877d, 0.0096737d, 1.8234707d, 0.0814874d, 0.0208135d,\n      2.2662701d, 0.7738026d, 0.0008108d, 2.6371155d, 0.3885394d, 0.5976453d, 0.7912125d, 0.0032943d, 0.0076619d, 0.0009594d, 0.0841922d, 0.0031912d],\n    [0.0116363d, 0.0014528d, 0.00085d, 0.0004046d, 0.0011631d, 0.0009863d, 0.0001834d, 0.0003922d, 0.0148139d, 0.0001364d, 0.0001327d, 0.0016952d, 0.0008495d, 0.0003971d,\n      0.0012619d, 0.0004823d, 0.0007202d, 0.0008395d, 0.0016322d, 0.0009446d, 0.781532d, 0.0008461d, 0.0007344d, 0.0002711d, 0.0001503d, 0.0001024d],\n    [5.2664628d, 0.2722724d, 1.0315216d, 1.5041745d, 11.4452395d, 0.2187558d, 0.8034347d, 0.1197433d, 5.9004085d, 0.0136782d, 0.7869179d, 0.7888557d, 1.1905663d, 1.5408916d,\n      5.2636683d, 0.2840431d, 0.0162732d, 0.8714239d, 3.073065d, 3.0935018d, 1.0043785d, 0.4845634d, 0.1116324d, 0.0059307d, 1.9104828d, 0.0298333d],\n    [1.3958189d, 0.1084548d, 1.3997172d, 0.0477502d, 5.5977636d, 0.0961754d, 0.0285751d, 2.4672552d, 3.9516833d, 0.0077479d, 0.339737d, 0.4491616d, 0.3986528d, 0.1207062d,\n      2.8901855d, 1.1973049d, 0.080366d, 0.0717654d, 2.3862707d, 7.8045342d, 1.7449085d, 0.0408148d, 0.1931512d, 0.0020589d, 0.350114d, 0.0198438d],\n    [4.0046636d, 0.2315084d, 0.6360105d, 0.0243227d, 8.9176277d, 0.0526605d, 0.0200005d, 18.3086482d, 7.9891653d, 0.0062372d, 0.0151697d, 0.6619201d, 0.1460394d, 0.0806787d,\n      6.2468781d, 0.0274042d, 0.0007526d, 2.9306096d, 2.1799955d, 1.1239766d, 1.616373d, 0.1039086d, 0.5300224d, 0.003287d, 1.5511418d, 0.0753694d],\n    [1.0405339d, 0.7757457d, 1.0559389d, 0.6735502d, 1.0636866d, 0.1190306d, 0.7986363d, 0.0290528d, 0.7019287d, 0.0192097d, 0.1602448d, 1.8289351d, 1.1563737d, 3.2297811d,\n      0.0582932d, 0.8142665d, 0.0061515d, 3.2935746d, 3.1995976d, 2.5388821d, 0.0101856d, 0.0400647d, 0.0116986d, 0.0440218d, 0.0426452d, 0.0412904d],\n    [0.9870774d, 0.0037721d, 0.006448d, 0.017297d, 4.6552622d, 0.0133728d, 0.0130077d, 0.0038715d, 2.1772529d, 0.0008623d, 0.0029271d, 0.0134182d, 0.0028136d, 0.0068546d,\n      0.5066435d, 0.0041575d, 0.0002258d, 0.0206034d, 0.0273123d, 0.0044648d, 0.0203117d, 0.002107d, 0.0015298d, 0.0005471d, 0.0621332d, 0.0006573d],\n    [2.9790214d, 0.0193429d, 0.0157836d, 0.018724d, 1.8652788d, 0.0161439d, 0.004503d, 1.5224859d, 2.2852698d, 0.0017198d, 0.0207637d, 0.0770983d, 0.0136184d, 0.6167433d,\n      1.3048155d, 0.018365d, 0.0009061d, 0.2921267d, 0.250538d, 0.0269223d, 0.0164429d, 0.0029288d, 0.0208577d, 0.0010678d, 0.0402552d, 0.0011097d],\n    [0.1665908d, 0.0055061d, 0.086935d, 0.0017397d, 0.1209231d, 0.0230238d, 0.0004892d, 0.0240804d, 0.2232723d, 0.0004185d, 0.0003742d, 0.006829d, 0.0051386d, 0.0011599d,\n      0.0317656d, 0.2459899d, 0.0005172d, 0.0012081d, 0.0033771d, 0.3847311d, 0.0254768d, 0.0063257d, 0.0036148d, 0.0100832d, 0.0172085d, 0.0002967d],\n    [0.3162593d, 0.054578d, 0.1219273d, 0.0766018d, 0.7890763d, 0.0112568d, 0.021848d, 0.0089087d, 0.1617439d, 0.0032816d, 0.0146214d, 0.2275842d, 0.1906941d, 0.1630151d,\n      0.6414934d, 0.1588797d, 0.0004128d, 0.1039721d, 0.4814257d, 0.1023695d, 0.0593967d, 0.0103587d, 0.0387865d, 0.0029518d, 0.005733d, 0.0142095d],\n    [0.2393676d, 0.0081167d, 0.0035083d, 0.0052527d, 0.3775166d, 0.0012409d, 0.0050274d, 0.0330923d, 0.1787957d, 0.0006392d, 0.006042d, 0.0129057d, 0.0072316d, 0.0071939d,\n      0.1036998d, 0.0025679d, 0.0009882d, 0.0047487d, 0.0052224d, 0.005546d, 0.0411031d, 0.0031899d, 0.0047273d, 0.0007615d, 0.0223349d, 0.0495398d],\n  ];\n\n    private static readonly Regex Pattern = new(\"[a-z]+|[A-Z][a-z]+|[A-Za-z]+\", RegexOptions.None, Constants.DefaultRegexTimeout);\n\n    /**\n     * @param text to analyze\n     * @return 1.0 in average for random string, and above if it looks like language (ex: could be compared using > 1.5d)\n     */\n    public static double HumanLanguageScore(string text)\n    {\n        if (string.IsNullOrEmpty(text))\n        {\n            return 0.0d;\n        }\n        text = StripAccents(text);\n        var totalScore = 0.0d;\n        var totalWeight = 0.0d;\n        var camelCaseSeparator = 0;\n        var lastFindingEnd = -1;\n        var allWorldLength = 0;\n        var matches = Pattern.SafeMatches(text);\n\n        foreach (Match match in matches)\n        {\n            if (match.Index == lastFindingEnd)\n            {\n                camelCaseSeparator++;\n            }\n            var word = match.Value.ToUpperInvariant();\n            allWorldLength += word.Length;\n            double weight = word.Length;\n            totalScore += WordScore(word) * weight;\n            totalWeight += weight;\n            lastFindingEnd = match.Index + word.Length;\n        }\n        if (totalWeight < 0.01d)\n        {\n            return 1.0d;\n        }\n        var separatorCount = text.Length - allWorldLength + camelCaseSeparator;\n        var expectedSeparatorCount = text.Length / 6;\n        var unexpectedSeparatorCount = Math.Abs(separatorCount - expectedSeparatorCount);\n        return (((totalScore / totalWeight) * allWorldLength) + (0.1d * unexpectedSeparatorCount)) / (allWorldLength + unexpectedSeparatorCount);\n    }\n\n    private static int Index(char ch) =>\n        ch - 'A';\n\n    private static double WordScore(string word)\n    {\n        if (word.Length == 1)\n        {\n            // returning the one letter statistics gave too high a score to 'a',\n            // so we decided to just always return a constant\n            return 0.1d;\n        }\n\n        var firstCharScore = WordFirstLetterFrequency[Index(word[0])];\n        var lastCharScore = WordLastLetterFrequency[Index(word[word.Length - 1])];\n        var pairsScore = word.Zip(word.Skip(1), (a, b) => CharacterPairFrequency[Index(a)][Index(b)]).Sum();\n\n        return (firstCharScore + lastCharScore + pairsScore) / (word.Length + 1);\n    }\n\n    private static string StripAccents(string input) =>\n        string.Concat(input.Normalize(NormalizationForm.FormD).Where(x => CharUnicodeInfo.GetUnicodeCategory(x) != UnicodeCategory.NonSpacingMark));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Common/NodeAndModel.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Common;\n\npublic readonly record struct NodeAndModel<TSyntax>(TSyntax Node, SemanticModel Model) where TSyntax : SyntaxNode;\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Common/NodeAndSymbol.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Common;\n\npublic readonly record struct NodeAndSymbol<TSyntaxNode, TSymbol>(TSyntaxNode Node, TSymbol Symbol)\n    where TSyntaxNode : SyntaxNode\n    where TSymbol : ISymbol;\n\npublic readonly record struct NodeAndSymbol(SyntaxNode Node, ISymbol Symbol);\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Common/NodeSymbolAndModel.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Common;\n\npublic readonly record struct NodeSymbolAndModel<TSyntax, TSymbol>(TSyntax Node, TSymbol Symbol, SemanticModel Model)\n    where TSyntax : SyntaxNode\n    where TSymbol : ISymbol;\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Common/Pair.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Common;\n\npublic readonly record struct Pair<TLeft, TRight>(TLeft Left, TRight Right);\n\npublic static class Pair\n{\n    public static Pair<TLeft, TRight> From<TLeft, TRight>(TLeft left, TRight right) =>\n        new(left, right);\n\n    public static void Swap<T>(ref T left, ref T right)\n    {\n        var tmp = left;\n        left = right;\n        right = tmp;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Common/PropertyType.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Common;\n\n/// <summary>\n/// sonar-plugin-api / RuleParamType also supports lists with single/multi selection.\n/// We don't have a way how to annotate those on .NET side.\n/// See sonar-plugin-api / RuleParamTypeTest.java for format an usages.\n/// </summary>\npublic enum PropertyType\n{\n    String,\n    Text,\n    Boolean,\n    Integer,\n    Float,\n    RegularExpression,  // This will be translated to String by RuleParamType.parse() on the API side\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Common/RuleDescriptor.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Common;\n\npublic record RuleDescriptor(string Id, string Title, string Type, string DefaultSeverity, string Status, SourceScope Scope, bool SonarWay, string Description)\n{\n    public string Category =>\n        $\"{DefaultSeverity} {ReadableType}\";\n\n    private string ReadableType =>\n        Type switch\n        {\n            \"BUG\" => \"Bug\",\n            \"CODE_SMELL\" => \"Code Smell\",\n            \"VULNERABILITY\" => \"Vulnerability\",\n            \"SECURITY_HOTSPOT\" => \"Security Hotspot\",\n            _ => throw new UnexpectedValueException(nameof(Type), Type)\n        };\n\n    public bool IsHotspot => Type == \"SECURITY_HOTSPOT\";\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Common/RuleLoader.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Xml.Linq;\n\nnamespace SonarAnalyzer.Core.Common;\n\npublic class RuleLoader : IRuleLoader\n{\n    public ISet<string> GetEnabledRules(string content) =>\n        XDocument.Parse(content)\n            .Descendants(\"Rule\")\n            .Select(r => r.Element(\"Key\")?.Value)\n            .WhereNotNull()\n            .ToHashSet();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Common/RuleParameterAttribute.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Globalization;\n\nnamespace SonarAnalyzer.Core.Common;\n\n[AttributeUsage(AttributeTargets.Property)]\npublic sealed class RuleParameterAttribute : Attribute\n{\n    public string Key { get; }\n    public string Description { get; }\n    public PropertyType Type { get; }\n    public string DefaultValue { get; }\n\n    public RuleParameterAttribute(string key, PropertyType type, string description, string defaultValue)\n    {\n        Key = key;\n        Description = description;\n        Type = type;\n        DefaultValue = defaultValue;\n    }\n\n    public RuleParameterAttribute(string key, PropertyType type, string description, int defaultValue)\n        : this(key, type, description, defaultValue.ToString(CultureInfo.InvariantCulture))\n    {\n    }\n\n    public RuleParameterAttribute(string key, PropertyType type, string description, double defaultValue)\n        : this(key, type, description, defaultValue.ToString(CultureInfo.InvariantCulture))\n    {\n    }\n\n    public RuleParameterAttribute(string key, PropertyType type, string description)\n        : this(key, type, description, null)\n    {\n    }\n\n    public RuleParameterAttribute(string key, PropertyType type)\n        : this(key, type, null, null)\n    {\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Common/SecondaryLocation.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Common;\n\npublic record SecondaryLocation(Location Location, string Message);\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Common/ShannonEntropy.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Common;\n\npublic static class ShannonEntropy\n{\n    // See https://en.wikipedia.org/wiki/Entropy_(information_theory) for more details.\n    public static double Calculate(string input)\n    {\n        if (string.IsNullOrEmpty(input))\n        {\n            return 0;\n        }\n\n        var length = input.Length;\n        return input\n            .GroupBy(x => x)\n            .ToDictionary(x => x.Key, x => x.Count())\n            .Values\n            .Select(x => (double)x / length)\n            .Select(probability => -probability * Math.Log(probability, 2))\n            .Sum();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Common/SourceScope.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Common;\n\npublic enum SourceScope\n{\n    Main,\n    Tests,\n    All\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Common/TokenAndModel.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Common;\n\npublic readonly record struct TokenAndModel(SyntaxToken Token, SemanticModel Model);\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Common/TopLevelStatements.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Common;\n\npublic static class TopLevelStatements\n{\n    public const string MainMethodImplicitName = \"<Main>$\";\n\n    public static readonly ImmutableHashSet<string> ProgramClassImplicitName = ImmutableHashSet.Create(\"Program\", \"<Program>$\");\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Common/UnexpectedLanguageException.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Common;\n\npublic sealed class UnexpectedLanguageException : Exception\n{\n    public UnexpectedLanguageException(AnalyzerLanguage language) : this(language.LanguageName) { }\n\n    public UnexpectedLanguageException(string language) : base($\"Unexpected language: {language}\") { }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Common/UnexpectedValueException.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Common;\n\npublic sealed class UnexpectedValueException : Exception\n{\n    public UnexpectedValueException(string name, object value) : base($\"Unexpected {name} value: {value}\") { }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Configuration/AnalysisConfig.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Xml.Linq;\n\nnamespace SonarAnalyzer.Core.Configuration;\n\n/// <summary>\n/// Data class to describe an analysis configuration.\n/// </summary>\n/// <remarks>\n/// This class is the counterpart of SonarScanner.MSBuild.Common.AnalysisConfig.\n/// This class should not be used directly in this codebase. To get configuration properties, use <see cref=\"AnalysisConfigReader\"/>.\n/// </remarks>\ninternal sealed class AnalysisConfig\n{\n    public static readonly AnalysisConfig Empty = new();\n\n    public string SonarQubeVersion { get; }\n    public ConfigSetting[] AdditionalConfig { get; }\n\n    public AnalysisConfig(XDocument document)\n    {\n        var xmlns = XNamespace.Get(\"http://www.sonarsource.com/msbuild/integration/2015/1\");\n        if (document.Root.Name != xmlns + \"AnalysisConfig\")\n        {\n            throw new InvalidOperationException(\"Unexpected Root node: \" + document.Root.Name);\n        }\n        SonarQubeVersion = document.Root.Element(xmlns + \"SonarQubeVersion\")?.Value ?? string.Empty;\n        AdditionalConfig = document.Root.Element(xmlns + \"AdditionalConfig\")?.Elements(xmlns + \"ConfigSetting\").Select(x => new ConfigSetting(x)).ToArray() ?? [];\n    }\n\n    private AnalysisConfig()\n    {\n        SonarQubeVersion = string.Empty;\n        AdditionalConfig = [];\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Configuration/AnalysisConfigReader.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\nusing System.Xml.Linq;\n\nnamespace SonarAnalyzer.Core.Configuration;\n\n/// <summary>\n/// This class reads and encapsulates <see cref=\"AnalysisConfig\"/>, exposing only the configuration our analyzers need.\n/// </summary>\npublic class AnalysisConfigReader\n{\n    private readonly AnalysisConfig analysisConfig;\n\n    public bool IsCloud => analysisConfig.SonarQubeVersion.StartsWith(\"8.0.0\");    // This analyzer will never be backported to Server 8.0, so we don't care about release version\n\n    public AnalysisConfigReader(string analysisConfigPath)\n    {\n        if (File.Exists(analysisConfigPath))\n        {\n            try\n            {\n                analysisConfig = new(XDocument.Load(analysisConfigPath));\n            }\n            catch (Exception e)\n            {\n                throw new InvalidOperationException($\"File '{analysisConfigPath}' could not be parsed.\", e);\n            }\n        }\n        else\n        {\n            analysisConfig = AnalysisConfig.Empty;\n        }\n    }\n\n    public string[] UnchangedFiles() =>\n        ConfigValue(\"UnchangedFilesPath\") is { } unchangedFilesPath\n            ? File.ReadAllLines(unchangedFilesPath)\n            : [];\n\n    private string ConfigValue(string id) =>\n        analysisConfig.AdditionalConfig.FirstOrDefault(x => x.Id == id)?.Value;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Configuration/ConfigSetting.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Xml.Linq;\n\nnamespace SonarAnalyzer.Core.Configuration;\n\n/// <summary>\n/// Data class to describe an analysis setting.\n/// </summary>\n/// <remarks>\n/// This class is the counterpart of SonarScanner.MSBuild.Common.ConfigSetting.\n/// </remarks>\ninternal sealed record ConfigSetting(string Id, string Value)\n{\n    public ConfigSetting(XElement element) : this(element.Attribute(\"Id\").Value, element.Attribute(\"Value\")?.Value) { }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Configuration/FilesToAnalyzeProvider.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\nusing System.Text.RegularExpressions;\n\nnamespace SonarAnalyzer.Core.Configuration;\n\npublic class FilesToAnalyzeProvider\n{\n    private readonly IEnumerable<string> allFiles;\n\n    public FilesToAnalyzeProvider(string filePath) =>\n        allFiles = ReadLines(filePath);\n\n    public IEnumerable<string> FindFiles(string fileName, bool onlyExistingFiles = true) =>\n        allFiles.Where(x => FilterByFileName(x, fileName) && (!onlyExistingFiles || File.Exists(x)));\n\n    public IEnumerable<string> FindFiles(Regex fullPathRegex, bool onlyExistingFiles = true) =>\n        allFiles.Where(x => fullPathRegex.SafeIsMatch(x) && (!onlyExistingFiles || File.Exists(x)));\n\n    private static IEnumerable<string> ReadLines(string filePath)\n    {\n        if (string.IsNullOrWhiteSpace(filePath) || !File.Exists(filePath))\n        {\n            return Enumerable.Empty<string>();\n        }\n\n        try\n        {\n            return File.ReadAllLines(filePath);\n        }\n        catch\n        {\n            // cannot log exception\n            return Enumerable.Empty<string>();\n        }\n    }\n\n    private static bool FilterByFileName(string fullPath, string fileName)\n    {\n        try\n        {\n            return Path.GetFileName(fullPath).Equals(fileName, StringComparison.OrdinalIgnoreCase);\n        }\n        catch (ArgumentException)\n        {\n            return false;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Configuration/ParameterLoader.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Globalization;\nusing System.Reflection;\n\nnamespace SonarAnalyzer.Core.Configuration;\n\ninternal static class ParameterLoader\n{\n    /**\n     * At each compilation, parse the configuration file and set the rule parameters on\n     *\n     * There is no caching mechanism because inside the IDE, the configuration file can change when the user:\n     * - changes something inside the configuration file\n     * - loads a different solution in the IDE\n     *\n     * If caching needs to be done in the future, it should take into account:\n     * - diffing the contents of the configuration file\n     * - associating the file with a unique identifier for the build project\n     */\n    internal static void SetParameterValues(ParametrizedDiagnosticAnalyzer parameteredAnalyzer, SonarLintXmlReader sonarLintXml)\n    {\n        if (!sonarLintXml.ParametrizedRules.Any())\n        {\n            return;\n        }\n\n        var propertyParameterPairs = parameteredAnalyzer.GetType()\n            .GetRuntimeProperties()\n            .Select(x => new { Property = x, Descriptor = x.GetCustomAttributes<RuleParameterAttribute>().SingleOrDefault() })\n            .Where(x => x.Descriptor is not null);\n\n        var ids = new HashSet<string>(parameteredAnalyzer.SupportedDiagnostics.Select(x => x.Id));\n        foreach (var propertyParameterPair in propertyParameterPairs)\n        {\n            var parameter = sonarLintXml.ParametrizedRules.FirstOrDefault(x => ids.Contains(x.Key));\n            var parameterValue = parameter?.Parameters.FirstOrDefault(x => x.Key == propertyParameterPair.Descriptor.Key);\n            if (TryConvertToParameterType(parameterValue?.Value, propertyParameterPair.Descriptor.Type, out var value))\n            {\n                propertyParameterPair.Property.SetValue(parameteredAnalyzer, value);\n            }\n        }\n    }\n\n    private static bool TryConvertToParameterType(string parameter, PropertyType type, out object result)\n    {\n        if (parameter is null)\n        {\n            result = null;\n            return false;\n        }\n        switch (type)\n        {\n            case PropertyType.Text:\n            case PropertyType.String:\n                result = parameter;\n                return true;\n\n            case PropertyType.Integer when int.TryParse(parameter, NumberStyles.None, CultureInfo.InvariantCulture, out var parsedInt):\n                result = parsedInt;\n                return true;\n\n            case PropertyType.Boolean when bool.TryParse(parameter, out var parsedBool):\n                result = parsedBool;\n                return true;\n\n            default:\n                result = null;\n                return false;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Configuration/ProjectConfig.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Xml.Linq;\n\nnamespace SonarAnalyzer.Core.Configuration;\n\n/// <summary>\n/// Data class to describe a single project configuration for our analyzers.\n/// </summary>\n/// <remarks>\n/// This class is the counterpart of SonarScanner.MSBuild.Common.ProjectConfig, and is used for easy deserialization.\n/// This class should not be used directly in this codebase. To get configuration properties, use <see cref=\"ProjectConfigReader\"/>.\n/// </remarks>\ninternal class ProjectConfig\n{\n    public static readonly ProjectConfig Empty = new(nameof(Configuration.ProjectType.Unknown));\n\n    /// <summary>\n    /// Full path to the SonarQubeAnalysisConfig.xml file.\n    /// </summary>\n    public string AnalysisConfigPath { get; set; }\n\n    /// <summary>\n    /// The full name and path of the project file.\n    /// </summary>\n    public string ProjectPath { get; set; }\n\n    /// <summary>\n    /// The full name and path of the text file containing all files to analyze.\n    /// </summary>\n    public string FilesToAnalyzePath { get; set; }\n\n    /// <summary>\n    /// Root of the project-specific output directory. Analyzer should write protobuf and other files there.\n    /// </summary>\n    public string OutPath { get; set; }\n\n    /// <summary>\n    /// The kind of the project.\n    /// </summary>\n    public string ProjectType { get; set; }\n\n    /// <summary>\n    /// MSBuild target framework for the current build.\n    /// </summary>\n    public string TargetFramework { get; set; }\n\n    public ProjectConfig(XDocument document)\n    {\n        var xmlns = XNamespace.Get(\"http://www.sonarsource.com/msbuild/analyzer/2021/1\");\n        if (document.Root.Name != xmlns + \"SonarProjectConfig\")\n        {\n            throw new InvalidOperationException(\"Unexpected Root: \" + document.Root.Name);\n        }\n        AnalysisConfigPath = Read(nameof(AnalysisConfigPath));\n        ProjectPath = Read(nameof(ProjectPath));\n        FilesToAnalyzePath = Read(nameof(FilesToAnalyzePath));\n        OutPath = Read(nameof(OutPath));\n        ProjectType = Read(nameof(ProjectType));\n        TargetFramework = Read(nameof(TargetFramework));\n\n        string Read(string name) =>\n            document.Root.Element(xmlns + name)?.Value;\n    }\n\n    private ProjectConfig(string projectType) =>\n        ProjectType = projectType;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Configuration/ProjectConfigReader.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Xml.Linq;\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.Core.Configuration;\n\n/// <summary>\n/// This class reads and encapsulates <see cref=\"ProjectConfig\"/>, exposing only the configuration our analyzers need.\n/// </summary>\npublic class ProjectConfigReader\n{\n    public static readonly ProjectConfigReader Empty = new(null);\n\n    private readonly ProjectConfig projectConfig;\n    private readonly Lazy<ProjectType> projectType;\n    private readonly Lazy<FilesToAnalyzeProvider> filesToAnalyze;\n    private readonly Lazy<AnalysisConfigReader> analysisConfig;\n\n    public bool IsScannerRun => !string.IsNullOrEmpty(projectConfig.OutPath);\n    public string AnalysisConfigPath => projectConfig.AnalysisConfigPath;\n    public string FilesToAnalyzePath => projectConfig.FilesToAnalyzePath;\n    public string OutPath => projectConfig.OutPath;\n    public string ProjectPath => projectConfig.ProjectPath;\n    public string TargetFramework => projectConfig.TargetFramework;\n    public ProjectType ProjectType => projectType.Value;\n    public FilesToAnalyzeProvider FilesToAnalyze => filesToAnalyze.Value;\n    public AnalysisConfigReader AnalysisConfig => analysisConfig.Value;\n\n    public ProjectConfigReader(SourceText sonarProjectConfig)\n    {\n        projectConfig = sonarProjectConfig is null ? ProjectConfig.Empty : ReadContent(sonarProjectConfig);\n        projectType = new Lazy<ProjectType>(ParseProjectType);\n        filesToAnalyze = new Lazy<FilesToAnalyzeProvider>(() => new FilesToAnalyzeProvider(FilesToAnalyzePath));\n        analysisConfig = new(() => new(AnalysisConfigPath));\n    }\n\n    private static ProjectConfig ReadContent(SourceText sonarProjectConfig)\n    {\n        try\n        {\n            return new(XDocument.Parse(sonarProjectConfig.ToString()));\n        }\n        catch (Exception e)\n        {\n            throw new InvalidOperationException($\"{nameof(sonarProjectConfig)} could not be parsed.\", e);\n        }\n    }\n\n    private ProjectType ParseProjectType() =>\n        Enum.TryParse<ProjectType>(projectConfig.ProjectType, out var result) ? result : ProjectType.Product;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Configuration/ProjectType.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Configuration;\n\n/// <summary>\n/// Possible types of project. Note that we expect only the string format to be passed from the Scanner.\n/// </summary>\npublic enum ProjectType\n{\n    Unknown,\n    Product,\n    Test\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Configuration/ProjectTypeCache.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Runtime.CompilerServices;\n\nnamespace SonarAnalyzer.Core.Configuration;\n\ninternal static class ProjectTypeCache\n{\n    // This list is duplicated in sonar-scanner-msbuild and sonar-security and should be manually synchronized after each change.\n    public /* for testing */ static readonly ISet<string> TestAssemblyNames = new HashSet<string>\n    {\n        \"dotMemory.Unit\",\n        \"Microsoft.VisualStudio.TestPlatform.TestFramework\", // Name inside https://nuget.info/packages/MSTest.TestFramework/3.11.0\n        \"Microsoft.VisualStudio.QualityTools.UnitTestFramework\",\n        \"MSTest.TestFramework\",                              // Name inside https://nuget.info/packages/MSTest.TestFramework/4.0.0\n        \"Machine.Specifications\",\n        \"nunit.framework\",\n        \"nunitlite\",\n        \"TechTalk.SpecFlow\",\n        \"xunit\", // Legacy Xunit (v1.x)\n        \"xunit.core\",\n        \"xunit.v3.core\",\n        // Assertion\n        \"FluentAssertions\",\n        \"Shouldly\",\n        // Mock\n        \"FakeItEasy\",\n        \"Moq\",\n        \"NSubstitute\",\n        \"Rhino.Mocks\",\n        \"Telerik.JustMock\"\n    };\n\n    private static readonly ConditionalWeakTable<Compilation, IsTestWrapper> Cache = new ConditionalWeakTable<Compilation, IsTestWrapper>();\n\n    // Should only be used by SonarAnalysisContext\n    public static bool IsTest(this Compilation compilation) =>\n        // We can't detect references => it's MAIN\n        compilation is not null && Cache.GetValue(compilation, x => new IsTestWrapper(x)).Value;\n\n    private sealed class IsTestWrapper\n    {\n        public readonly bool Value;\n\n        public IsTestWrapper(Compilation compilation) =>\n            Value = compilation.ReferencedAssemblyNames.Any(x => TestAssemblyNames.Contains(x.Name));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Configuration/SonarLintXml.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Xml.Serialization;\n\nnamespace SonarAnalyzer.Core.Configuration;\n\n/// <summary>\n/// Data class to represent the SonarLint.xml for our analyzers.\n/// </summary>\n/// <remarks>\n/// This class should not be used in this codebase. To get SonarLint.xml properties, use <see cref=\"SonarLintXmlReader\"/>.\n/// </remarks>\n[XmlRoot(ElementName = \"AnalysisInput\")]\npublic class SonarLintXml\n{\n    public static readonly SonarLintXml Empty = new();\n\n    [XmlArray(\"Settings\")]\n    [XmlArrayItem(\"Setting\")]\n    public List<SonarLintXmlKeyValuePair> Settings { get; set; }\n\n    [XmlArray(\"Rules\")]\n    [XmlArrayItem(\"Rule\")]\n    public List<SonarLintXmlRule> Rules { get; set; }\n}\n\npublic class SonarLintXmlRule\n{\n    [XmlElement(\"Key\")]\n    public string Key { get; set; }\n\n    [XmlArray(\"Parameters\")]\n    [XmlArrayItem(\"Parameter\")]\n    public List<SonarLintXmlKeyValuePair> Parameters { get; set; }\n}\n\npublic class SonarLintXmlKeyValuePair\n{\n    public string Key { get; set; }\n    public string Value { get; set; }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Configuration/SonarLintXmlReader.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\nusing System.Xml.Serialization;\nusing Microsoft.CodeAnalysis.Text;\nusing SonarAnalyzer.Core.RegularExpressions;\n\nnamespace SonarAnalyzer.Core.Configuration;\n\npublic class SonarLintXmlReader\n{\n    public static readonly SonarLintXmlReader Empty = new(null);\n    private readonly bool ignoreHeaderCommentsCS;\n    private readonly bool ignoreHeaderCommentsVB;\n    private readonly bool analyzeGeneratedCodeCS;\n    private readonly bool analyzeGeneratedCodeVB;\n    private readonly bool analyzeRazorCodeCS;\n\n    public string[] Exclusions { get; }\n    public string[] Inclusions { get; }\n    public string[] GlobalExclusions { get; }\n    public string[] TestExclusions { get; }\n    public string[] TestInclusions { get; }\n    public string[] GlobalTestExclusions { get; }\n    public List<SonarLintXmlRule> ParametrizedRules { get; }\n\n    public SonarLintXmlReader(SourceText sonarLintXmlText)\n    {\n        var sonarLintXml = sonarLintXmlText is null ? SonarLintXml.Empty : ParseContent(sonarLintXmlText);\n        var settings = sonarLintXml.Settings?.GroupBy(x => x.Key).ToDictionary(x => x.Key, x => x.First().Value) ?? new Dictionary<string, string>();\n        Exclusions = ReadArray(\"sonar.exclusions\");\n        Inclusions = ReadArray(\"sonar.inclusions\");\n        GlobalExclusions = ReadArray(\"sonar.global.exclusions\");\n        TestExclusions = ReadArray(\"sonar.test.exclusions\");\n        TestInclusions = ReadArray(\"sonar.test.inclusions\");\n        GlobalTestExclusions = ReadArray(\"sonar.global.test.exclusions\");\n        ParametrizedRules = ReadRuleParameters();\n        ignoreHeaderCommentsCS = ReadBoolean(\"sonar.cs.ignoreHeaderComments\");\n        ignoreHeaderCommentsVB = ReadBoolean(\"sonar.vbnet.ignoreHeaderComments\");\n        analyzeGeneratedCodeCS = ReadBoolean(\"sonar.cs.analyzeGeneratedCode\");\n        analyzeGeneratedCodeVB = ReadBoolean(\"sonar.vbnet.analyzeGeneratedCode\");\n        analyzeRazorCodeCS = ReadBoolean(\"sonar.cs.analyzeRazorCode\", true);\n\n        string[] ReadArray(string key) =>\n            settings.GetValueOrDefault(key) is { } value && !string.IsNullOrEmpty(value)\n                ? value.Split(',')\n                : Array.Empty<string>();\n\n        bool ReadBoolean(string key, bool defaultValue = false) =>\n            settings.TryGetValue(key, out var value)\n                ? bool.TryParse(value, out var boolValue) && boolValue\n                : defaultValue;\n\n        List<SonarLintXmlRule> ReadRuleParameters() =>\n            sonarLintXml.Rules?.Where(x => x.Parameters.Any()).ToList() ?? new();\n    }\n\n    public bool IgnoreHeaderComments(string language) =>\n    language switch\n    {\n        LanguageNames.CSharp => ignoreHeaderCommentsCS,\n        LanguageNames.VisualBasic => ignoreHeaderCommentsVB,\n        _ => throw new UnexpectedLanguageException(language)\n    };\n\n    public bool AnalyzeGeneratedCode(string language) =>\n        language switch\n        {\n            LanguageNames.CSharp => analyzeGeneratedCodeCS,\n            LanguageNames.VisualBasic => analyzeGeneratedCodeVB,\n            _ => throw new UnexpectedLanguageException(language)\n        };\n\n    public bool AnalyzeRazorCode(string language) =>\n        language switch\n        {\n            LanguageNames.CSharp => analyzeRazorCodeCS,\n            LanguageNames.VisualBasic => false,\n            _ => throw new UnexpectedLanguageException(language)\n        };\n\n    public bool IsFileIncluded(string filePath, bool isTestProject) =>\n        isTestProject\n            ? IsFileIncluded(TestInclusions, TestExclusions, GlobalTestExclusions, filePath)\n            : IsFileIncluded(Inclusions, Exclusions, GlobalExclusions, filePath);\n\n    private static bool IsFileIncluded(string[] inclusions, string[] exclusions, string[] globalExclusions, string filePath) =>\n        IsIncluded(inclusions, filePath)\n        && !IsExcluded(exclusions, filePath)\n        && !IsExcluded(globalExclusions, filePath);\n\n    private static bool IsIncluded(string[] inclusions, string filePath) =>\n        inclusions.Length == 0 || inclusions.Any(x => WildcardPatternMatcher.IsMatch(x, filePath, true));\n\n    private static bool IsExcluded(string[] exclusions, string filePath) =>\n        exclusions.Any(x => WildcardPatternMatcher.IsMatch(x, filePath, false));\n\n    private static SonarLintXml ParseContent(SourceText sonarLintXml)\n    {\n        try\n        {\n            var serializer = new XmlSerializer(typeof(SonarLintXml));\n            using var sr = new StringReader(sonarLintXml.ToString());\n            return (SonarLintXml)serializer.Deserialize(sr);\n        }\n        catch\n        {\n            return SonarLintXml.Empty;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Extensions/AnalyzerOptionsExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\nusing Roslyn.Utilities;\nusing SonarAnalyzer.Core.Configuration;\n\nnamespace SonarAnalyzer.Core.Extensions;\n\npublic static class AnalyzerOptionsExtensions\n{\n    private static readonly SourceTextValueProvider<SonarLintXmlReader> SonarLintXmlProvider = new(x => new SonarLintXmlReader(x));\n\n    public static SonarLintXmlReader SonarLintXml(this AnalyzerOptions options, SonarAnalysisContext context)\n    {\n        if (options.SonarLintXml() is { } sonarLintXml)\n        {\n            return sonarLintXml.GetText() is { } sourceText\n                && context.TryGetValue(sourceText, SonarLintXmlProvider, out var sonarLintXmlReader)\n                ? sonarLintXmlReader\n                : throw new InvalidOperationException($\"File '{Path.GetFileName(sonarLintXml.Path)}' has been added as an AdditionalFile but could not be read and parsed.\");\n        }\n        else\n        {\n            return SonarLintXmlReader.Empty;\n        }\n    }\n\n    public static AdditionalText SonarLintXml(this AnalyzerOptions options) =>\n        options.AdditionalFile(\"SonarLint.xml\");\n\n    public static AdditionalText SonarProjectConfig(this AnalyzerOptions options) =>\n        options.AdditionalFile(\"SonarProjectConfig.xml\");\n\n    public static AdditionalText ProjectOutFolderPath(this AnalyzerOptions options) =>\n        options.AdditionalFile(\"ProjectOutFolderPath.txt\");\n\n    [PerformanceSensitive(\"https://github.com/SonarSource/sonar-dotnet/issues/7440\", AllowCaptures = false, AllowGenericEnumeration = false, AllowImplicitBoxing = false)]\n    private static AdditionalText AdditionalFile(this AnalyzerOptions options, string fileName)\n    {\n        // HotPath: This code path needs to be allocation free. Don't use Linq.\n        foreach (var additionalText in options.AdditionalFiles) // Uses the struct enumerator of ImmutableArray\n        {\n            // Don't use Path.GetFilename. It allocates a string.\n            if (additionalText.Path is { } path\n                && path.EndsWith(fileName, StringComparison.OrdinalIgnoreCase))\n            {\n                // The character before the filename (if there is a character) must be a directory separator\n                var separatorPosition = path.Length - fileName.Length - 1;\n                if (separatorPosition < 0 || IsDirectorySeparator(path[separatorPosition]))\n                {\n                    return additionalText;\n                }\n            }\n        }\n        return null;\n\n        static bool IsDirectorySeparator(char c) =>\n            c == Path.DirectorySeparatorChar || c == Path.AltDirectorySeparatorChar;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Extensions/CompilationExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Extensions;\n\ninternal static class CompilationExtensions\n{\n    public static INamedTypeSymbol GetTypeByMetadataName(this Compilation compilation, KnownType knownType) =>\n        compilation.GetTypeByMetadataName(knownType.MetadataName);\n\n    public static IMethodSymbol SpecialTypeMethod(this Compilation compilation, SpecialType type, string methodName) =>\n        (IMethodSymbol)compilation.GetSpecialType(type).GetMembers(methodName).SingleOrDefault();\n\n    public static bool IsNetFrameworkTarget(this Compilation compilation) =>\n        // There's no direct way of checking compilation target framework yet (09/2020).\n        // See https://github.com/dotnet/roslyn/issues/3798\n        compilation.ObjectType.ContainingAssembly.Name == \"mscorlib\";\n\n    public static bool ReferencesAny(this Compilation compilation, params KnownAssembly[] assemblies) =>\n        assemblies.Any()\n            ? Array.Exists(assemblies, x => compilation.References(x))\n            : throw new ArgumentException(\"Assemblies argument needs to be non-empty\");\n\n    public static bool ReferencesAll(this Compilation compilation, params KnownAssembly[] assemblies) =>\n        Array.TrueForAll(assemblies, x => compilation.References(x));\n\n    public static bool References(this Compilation compilation, KnownAssembly assembly) =>\n        assembly.IsReferencedBy(compilation);\n\n    public static bool IsMemberAvailable<TMemberType>(this Compilation compilation, KnownType type, string memberName, Func<TMemberType, bool> memberCheck = null)\n        where TMemberType : ISymbol\n    {\n        var containingType = compilation.GetTypeByMetadataName(type);\n        if (containingType is null)\n        {\n            return false;\n        }\n        var memberSymbols = containingType.GetMembers(memberName).OfType<TMemberType>();\n        return memberCheck is null\n            ? memberSymbols.Any()\n            : memberSymbols.Any(memberCheck);\n    }\n\n    public static bool ReferencesNetCoreControllers(this Compilation compilation) =>\n        compilation.GetTypeByMetadataName(KnownType.Microsoft_AspNetCore_Mvc_Controller) is not null\n        || compilation.GetTypeByMetadataName(KnownType.Microsoft_AspNetCore_Mvc_ControllerBase) is not null;\n\n    public static bool ReferencesNetFrameworkControllers(this Compilation compilation) =>\n        compilation.GetTypeByMetadataName(KnownType.System_Web_Mvc_Controller) is not null;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Extensions/DiagnosticDescriptorExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Extensions;\n\npublic static class DiagnosticDescriptorExtensions\n{\n    public static bool IsEnabled(this DiagnosticDescriptor descriptor, SonarSyntaxNodeReportingContext context)\n    {\n        if (context.HasMatchingScope(descriptor))\n        {\n            // Roslyn calls an analyzer if any of the diagnostics is active. We need to remove deactivated rules from execution to improve overall performance.\n            // This is a reproduction of Roslyn activation logic:\n            // https://github.com/dotnet/roslyn/blob/0368609e1467563247e9b5e4e3fe8bff533d59b6/src/Compilers/Core/Portable/DiagnosticAnalyzer/AnalyzerDriver.cs#L1316-L1327\n            var options = CompilationOptionsWrapper.FromObject(context.Compilation.Options).SyntaxTreeOptionsProvider;\n            var severity = options.Instance is not null\n                            && (options.TryGetDiagnosticValue(context.Tree, descriptor.Id, default, out var severityFromOptions)\n                                || options.TryGetGlobalDiagnosticValue(descriptor.Id, default, out severityFromOptions))\n                                ? severityFromOptions                                               // .editorconfig for a specific tree\n                                : descriptor.GetEffectiveSeverity(context.Compilation.Options);     // RuleSet file or .globalconfig\n            return severity switch\n            {\n                ReportDiagnostic.Default => descriptor.IsEnabledByDefault,\n                ReportDiagnostic.Suppress => false,\n                _ => true\n            };\n        }\n        else\n        {\n            return false;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Extensions/DictionaryExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Extensions;\n\npublic static class DictionaryExtensions\n{\n    public static TValue GetValueOrDefault<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key) =>\n        dictionary.GetValueOrDefault(key, default);\n\n    public static TValue GetValueOrDefault<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key, TValue defaultValue) =>\n        dictionary.TryGetValue(key, out var result) ? result : defaultValue;\n\n    public static TValue GetOrAdd<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key, Func<TKey, TValue> factory)\n    {\n        if (!dictionary.TryGetValue(key, out var value))\n        {\n            value = factory(key);\n            dictionary.Add(key, value);\n        }\n        return value;\n    }\n\n    public static bool DictionaryEquals<TKey, TValue>(this IDictionary<TKey, TValue> dict1, IDictionary<TKey, TValue> dict2) =>\n        dict1 == dict2\n        || (EqualityComparer<TValue>.Default is var valueComparer\n            && dict1 is not null\n            && dict2 is not null\n            && dict1.Count == dict2.Count\n            && dict1.All(x => dict2.TryGetValue(x.Key, out var value2) && valueComparer.Equals(x.Value, value2)));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Extensions/HashSetExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Extensions;\n\npublic static class HashSetExtensions\n{\n    public static void AddRange<T>(this HashSet<T> hashset, IEnumerable<T> values)\n    {\n        foreach (var value in values)\n        {\n            hashset.Add(value);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Extensions/IAnalysisContextExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Collections.Concurrent;\nusing System.Runtime.CompilerServices;\nusing Roslyn.Utilities;\nusing SonarAnalyzer.Core.Configuration;\nusing static SonarAnalyzer.Core.Analyzers.DiagnosticDescriptorFactory;\n\nnamespace SonarAnalyzer.Core.Extensions;\n\npublic static class IAnalysisContextExtensions\n{\n    private const string RazorGeneratedFileSuffix = \"_razor.g.cs\";\n\n    private static readonly ConditionalWeakTable<Compilation, ImmutableHashSet<string>> UnchangedFilesCache = new();\n    private static readonly ConditionalWeakTable<Compilation, ConcurrentDictionary<string, bool>> FileInclusionCache = new();\n\n    /// <summary>\n    /// Reads the properties from the SonarLint.xml file and caches the result for the scope of this analysis.\n    /// </summary>\n    public static SonarLintXmlReader SonarLintXml<T>(this T context) where T : IAnalysisContext => // Don't change to (this IAnalysisContext context) because this would cause boxing\n        context.Options.SonarLintXml(context.AnalysisContext);\n\n    public static bool IsRazorAnalysisEnabled<T>(this T context) where T : IAnalysisContext => // Don't change to (this IAnalysisContext context) because this would cause boxing\n        context.AnalysisContext.IsRazorAnalysisEnabled(context.Options, context.Compilation);\n\n    public static bool IsTestProject<T>(this T context) where T : IAnalysisContext\n    {\n        var projectType = context.ProjectConfiguration().ProjectType;\n        return projectType == ProjectType.Unknown\n            ? context.Compilation.IsTest()              // SonarLint, NuGet or Scanner <= 5.0\n            : projectType == ProjectType.Test;          // Scanner >= 5.1 does authoritative decision that we follow\n    }\n\n    /// <summary>\n    /// Reads configuration from SonarProjectConfig.xml file and caches the result for scope of this analysis.\n    /// </summary>\n    public static ProjectConfigReader ProjectConfiguration<T>(this T context) where T : IAnalysisContext => // Don't change to (this IAnalysisContext context) because this would cause boxing\n        context.AnalysisContext.ProjectConfiguration(context.Options);\n\n    public static bool HasMatchingScope<T>(this T context, ImmutableArray<DiagnosticDescriptor> descriptors)\n        where T : IAnalysisContext // Don't change to (this IAnalysisContext context) because this would cause boxing\n    {\n        // Performance: Don't use descriptors.Any(HasMatchingScope), the delegate creation allocates too much memory. https://github.com/SonarSource/sonar-dotnet/issues/7438\n        foreach (var descriptor in descriptors)\n        {\n            if (context.HasMatchingScope(descriptor))\n            {\n                return true;\n            }\n        }\n        return false;\n    }\n\n    public static bool HasMatchingScope<T>(this T context, DiagnosticDescriptor descriptor)\n        where T : IAnalysisContext // Don't change to (this IAnalysisContext context) because this would cause boxing\n    {\n        // MMF-2297: Test Code as 1st Class Citizen is not ready on server side yet.\n        // ScannerRun: Only utility rules and rules with TEST-ONLY scope are executed for test projects for now.\n        // SonarLint & Standalone NuGet & Internal styling rules Txxxx: Respect the scope as before.\n        return context.IsTestProject()\n            ? ContainsTag(TestSourceScopeTag) && !(descriptor.Id.StartsWith(\"S\") && context.ProjectConfiguration().IsScannerRun && ContainsTag(MainSourceScopeTag) && !ContainsTag(UtilityTag))\n            : ContainsTag(MainSourceScopeTag);\n\n        bool ContainsTag(string tag) =>\n            descriptor.CustomTags.Contains(tag);\n    }\n\n    /// <param name=\"tree\">Tree to decide on. Can be null for Symbol-based and Compilation-based scenarios. And we want to analyze those too.</param>\n    /// <param name=\"generatedCodeRecognizer\">When set, generated trees are analyzed only when language-specific 'analyzeGeneratedCode' configuration property is also set.</param>\n    public static bool ShouldAnalyzeTree<T>(this T context, SyntaxTree tree, GeneratedCodeRecognizer generatedCodeRecognizer)\n        where T : IAnalysisContext => // Don't change to (this IAnalysisContext context) because this would cause boxing\n        context.SonarLintXml() is var sonarLintXml\n        && (generatedCodeRecognizer is null\n            || sonarLintXml.AnalyzeGeneratedCode(context.Compilation.Language)\n            || !tree.IsConsideredGenerated(generatedCodeRecognizer, context.IsRazorAnalysisEnabled()))\n        && (tree is null || (!context.IsUnchanged(tree) && !context.IsExcluded(sonarLintXml, tree.FilePath)));\n\n    [PerformanceSensitive(\"https://github.com/SonarSource/sonar-dotnet/issues/7439\", AllowCaptures = true, AllowGenericEnumeration = false, AllowImplicitBoxing = false)]\n    public static bool IsUnchanged<T>(this T context, SyntaxTree tree) where T : IAnalysisContext // Don't change to (this IAnalysisContext context) because this would cause boxing\n    {\n        // Hot path: Use TryGetValue to prevent the allocation of the GetValue factory delegate in the common case\n        var unchangedFiles = UnchangedFilesCache.TryGetValue(context.Compilation, out var unchangedFilesFromCache)\n            ? unchangedFilesFromCache\n            : UnchangedFilesCache.GetValue(context.Compilation, _ => CreateUnchangedFilesHashSet(context.ProjectConfiguration()));\n        return unchangedFiles.Contains(MapFilePath(tree));\n    }\n\n    [PerformanceSensitive(\"https://github.com/SonarSource/sonar-dotnet/issues/7439\", AllowCaptures = false, AllowGenericEnumeration = false, AllowImplicitBoxing = false)]\n    private static bool IsExcluded<T>(this T context, SonarLintXmlReader sonarLintXml, string filePath)\n        where T : IAnalysisContext // Don't change to (this IAnalysisContext context) because this would cause boxing\n    {\n        // If ProjectType is not 'Unknown' it means we are in S4NET context and all files are analyzed.\n        // If ProjectType is 'Unknown' then we are in SonarLint or NuGet context and we need to check if the file has been excluded from analysis through SonarLint.xml.\n        if (context.ProjectConfiguration().ProjectType == ProjectType.Unknown)\n        {\n            var fileInclusionCache = FileInclusionCache.GetOrCreateValue(context.Compilation);\n            // Hot path: Don't use GetOrAdd with the value factory parameter. It allocates a delegate which causes GC pressure.\n            var isIncluded = fileInclusionCache.TryGetValue(filePath, out var result)\n                ? result\n                : fileInclusionCache.GetOrAdd(filePath, sonarLintXml.IsFileIncluded(filePath, context.IsTestProject()));\n            return !isIncluded;\n        }\n        return false;\n    }\n\n    private static ImmutableHashSet<string> CreateUnchangedFilesHashSet(ProjectConfigReader config) =>\n        ImmutableHashSet.Create(StringComparer.OrdinalIgnoreCase, config.AnalysisConfig?.UnchangedFiles() ?? []);\n\n    private static string MapFilePath(SyntaxTree tree) =>\n        // Currently only .razor file hashes are stored in the cache.\n        //\n        // For a file like `Pages\\Component.razor`, the compiler generated path has the following pattern:\n        // Microsoft.NET.Sdk.Razor.SourceGenerators\\Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator\\Pages_Component_razor.g.cs\n        // In order to avoid rebuilding the original file path we have to read it from the pragma directive.\n        //\n        // This should be updated for .cshtml files as well once https://github.com/SonarSource/sonar-dotnet/issues/8032 is done.\n        tree.FilePath.EndsWith(RazorGeneratedFileSuffix, StringComparison.OrdinalIgnoreCase)\n            ? tree.GetOriginalFilePath()\n            : tree.FilePath;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Extensions/ICompilationReportExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.AnalysisContext;\n\n// Don't change the this parameter to (this IAnalysisContext context) because it would cause boxing\npublic static class ICompilationReportExtensions\n{\n    public static void ReportIssue<T>(this T context, GeneratedCodeRecognizer generatedCodeRecognizer,\n                            DiagnosticDescriptor rule,\n                            SyntaxNode locationSyntax,\n                            params string[] messageArgs) where T : ICompilationReport =>\n        context.ReportIssue(generatedCodeRecognizer, rule, locationSyntax.GetLocation(), messageArgs);\n\n    public static void ReportIssue<T>(this T context, GeneratedCodeRecognizer generatedCodeRecognizer,\n                            DiagnosticDescriptor rule,\n                            SyntaxToken locationToken,\n                            params string[] messageArgs) where T : ICompilationReport =>\n        context.ReportIssue(generatedCodeRecognizer, rule, locationToken.GetLocation(), messageArgs);\n\n    public static void ReportIssue<T>(this T context, GeneratedCodeRecognizer generatedCodeRecognizer,\n                            DiagnosticDescriptor rule,\n                            Location location,\n                            params string[] messageArgs) where T : ICompilationReport =>\n        context.ReportIssue(generatedCodeRecognizer, rule, location, [], messageArgs);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Extensions/IEnumerableExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text;\n\nnamespace SonarAnalyzer.Core.Extensions;\n\npublic static class IEnumerableExtensions\n{\n    public static HashSet<T> ToHashSet<T>(this IEnumerable<T> enumerable, IEqualityComparer<T> equalityComparer = null)\n    {\n        enumerable ??= [];\n        return equalityComparer is null\n            ? new(enumerable)\n            : new(enumerable, equalityComparer);\n    }\n\n    /// <summary>\n    /// Compares each element between two collections. The elements needs in the same order to be considered equal.\n    /// </summary>\n    public static bool Equals<T, V>(this IEnumerable<T> first, IEnumerable<V> second, Func<T, V, bool> predicate)\n    {\n        var enum1 = first.GetEnumerator();\n        var enum2 = second.GetEnumerator();\n        var enum1HasNext = enum1.MoveNext();\n        var enum2HasNext = enum2.MoveNext();\n\n        while (enum1HasNext && enum2HasNext)\n        {\n            if (!predicate(enum1.Current, enum2.Current))\n            {\n                return false;\n            }\n\n            enum1HasNext = enum1.MoveNext();\n            enum2HasNext = enum2.MoveNext();\n        }\n\n        return enum1HasNext == enum2HasNext;\n    }\n\n    public static IEnumerable<T> WhereNotNull<T>(this IEnumerable<T> enumerable) where T : class =>\n        enumerable.Where(x => x is not null);\n\n    public static IEnumerable<T> WhereNotNull<T>(this IEnumerable<T?> enumerable) where T : struct =>\n        enumerable.Where(x => x.HasValue).Select(x => x.Value);\n\n    public static bool IsEmpty<T>(this IEnumerable<T> enumerable) =>\n        !enumerable.Any();\n\n    /// <summary>\n    /// Applies a specified function to the corresponding elements of two sequences,\n    /// producing a sequence of the results. If the collections have different length\n    /// default(T) will be passed in the operation function for the corresponding items that\n    /// do not exist.\n    /// </summary>\n    /// <typeparam name=\"TFirst\">The type of the elements of the first input sequence.</typeparam>\n    /// <typeparam name=\"TSecond\">The type of the elements of the second input sequence.</typeparam>\n    /// <typeparam name=\"TResult\">The type of the elements of the result sequence.</typeparam>\n    /// <param name=\"first\">The first sequence to merge.</param>\n    /// <param name=\"second\">The second sequence to merge.</param>\n    /// <param name=\"operation\">A function that specifies how to merge the elements from the two sequences.</param>\n    /// <returns>An System.Collections.Generic.IEnumerable`1 that contains merged elements of\n    /// two input sequences.</returns>\n    public static IEnumerable<TResult> Merge<TFirst, TSecond, TResult>(this IEnumerable<TFirst> first, IEnumerable<TSecond> second, Func<TFirst, TSecond, TResult> operation)\n    {\n        using var iter1 = first.GetEnumerator();\n        using var iter2 = second.GetEnumerator();\n        while (iter1.MoveNext())\n        {\n            yield return operation(iter1.Current, iter2.MoveNext() ? iter2.Current : default);\n        }\n\n        while (iter2.MoveNext())\n        {\n            yield return operation(default, iter2.Current);\n        }\n    }\n\n    public static int IndexOf<T>(this IEnumerable<T> enumerable, Func<T, bool> predicate) =>\n        enumerable.Select((item, index) => new { item, index }).FirstOrDefault(x => predicate(x.item))?.index ?? -1;\n\n    /// <summary>\n    /// This is <see cref=\"string.Join\"/> as extension. It concatenates the members of the collection using the specified <paramref name=\"separator\"/> between each member.\n    /// <paramref name=\"selector\"/> is used to convert <typeparamref name=\"T\"/> to <see cref=\"string\"/> for concatenation.\n    /// </summary>\n    public static string JoinStr<T>(this IEnumerable<T> enumerable, string separator, Func<T, string> selector) =>\n        string.Join(separator, enumerable.Select(x => selector(x)));\n\n    /// <summary>\n    /// This is <see cref=\"string.Join\"/> as extension. It concatenates the members of the collection using the specified <paramref name=\"separator\"/> between each member.\n    /// <paramref name=\"selector\"/> is used to convert <typeparamref name=\"T\"/> to <see cref=\"int\"/> for concatenation.\n    /// </summary>\n    public static string JoinStr<T>(this IEnumerable<T> enumerable, string separator, Func<T, int> selector) =>\n        string.Join(separator, enumerable.Select(x => selector(x)));\n\n    /// <summary>\n    /// This is <see cref=\"string.Join\"/> as extension. It concatenates the members of the collection using the specified <paramref name=\"separator\"/> between each member.\n    /// </summary>\n    public static string JoinStr(this IEnumerable<string> enumerable, string separator) =>\n        JoinStr(enumerable, separator, x => x);\n\n    /// <summary>\n    /// This is <see cref=\"string.Join\"/> as extension. It concatenates the members of the collection using the specified <paramref name=\"separator\"/> between each member.\n    /// </summary>\n    public static string JoinStr(this IEnumerable<int> enumerable, string separator) =>\n        JoinStr(enumerable, separator, x => x);\n\n    /// <summary>\n    /// Concatenates the members of a <see cref=\"string\"/> collection using the specified <paramref name=\"separator\"/> between each member.\n    /// Any whitespace or null member of the collection will be ignored.\n    /// </summary>\n    public static string JoinNonEmpty(this IEnumerable<string> enumerable, string separator) =>\n        string.Join(separator, enumerable.Where(x => !string.IsNullOrWhiteSpace(x)));\n\n    /// <summary>\n    /// Concatenates the members of <paramref name=\"values\"/> using \"and\" as the last separator and using a\n    /// <see href=\"https://en.wikipedia.org/wiki/Serial_comma\">serial comma</see>.\n    /// <list type=\"table\">\n    /// <item><c>[a, b, c] => \"a, b, and c\"</c></item>\n    /// <item><c>[a, b] => \"a and b\"</c></item>\n    /// <item><c>[a] => \"a\"</c></item>\n    /// <item><c>[] or null => \"\"</c></item>\n    /// </list>\n    /// </summary>\n    public static string JoinAnd<T>(this IEnumerable<T> values) =>\n        values.JoinWith(\"and\");\n\n    /// <summary>\n    /// Concatenates the members of <paramref name=\"values\"/> using \"or\" as the last separator and using a\n    /// <see href=\"https://en.wikipedia.org/wiki/Serial_comma\">serial comma</see>.\n    /// <list type=\"table\">\n    /// <item><c>[a, b, c] => \"a, b, or c\"</c></item>\n    /// <item><c>[a, b] => \"a or b\"</c></item>\n    /// <item><c>[a] => \"a\"</c></item>\n    /// <item><c>[] or null => \"\"</c></item>\n    /// </list>\n    /// </summary>\n    public static string JoinOr<T>(this IEnumerable<T> values) =>\n        values.JoinWith(\"or\");\n\n    public static IEnumerable<SecondaryLocation> ToSecondary(this IEnumerable<Location> locations, string message = null, params string[] messageArgs) =>\n        locations.Select(x => x.ToSecondary(message, messageArgs));\n\n    public static IEnumerable<SecondaryLocation> ToSecondaryLocations(this IEnumerable<SyntaxNode> nodes, string message = null, params string[] messageArgs) =>\n        nodes.Select(x => x.ToSecondaryLocation(message, messageArgs));\n\n    public static IEnumerable<SecondaryLocation> ToSecondaryLocations(this IEnumerable<SyntaxToken> nodes, string message = null, params string[] messageArgs) =>\n        nodes.Select(x => x.ToSecondaryLocation(message, messageArgs));\n\n    public static string ToSentence(this IEnumerable<string> words, bool quoteWords = false)\n    {\n        var wordCollection = words as ICollection<string> ?? words.ToList();\n        var singleQuoteOrBlank = quoteWords ? \"'\" : string.Empty;\n\n        return wordCollection.Count switch\n        {\n            0 => null,\n            1 => string.Concat(singleQuoteOrBlank, wordCollection.First(), singleQuoteOrBlank),\n            _ => new StringBuilder(singleQuoteOrBlank)\n                    .Append(string.Join($\"{singleQuoteOrBlank}, {singleQuoteOrBlank}\", wordCollection.Take(wordCollection.Count - 1)))\n                    .Append(singleQuoteOrBlank)\n                    .Append(\" and \")\n                    .Append(singleQuoteOrBlank)\n                    .Append(wordCollection.Last())\n                    .Append(singleQuoteOrBlank)\n                    .ToString(),\n        };\n    }\n\n    private static string JoinWith<T>(this IEnumerable<T> values, string with) =>\n        values?.Select(x => x?.ToString()).Where(x => !string.IsNullOrWhiteSpace(x)).ToList() switch\n        {\n            { Count: > 2 } serial => $\"{serial.Take(serial.Count - 1).JoinStr(\", \")}, {with} {serial[serial.Count - 1]}\",\n            { Count: 2 } pair => $\"{pair[0]} {with} {pair[1]}\",\n            { Count: 1 } single => single[0],\n            _ => string.Empty,\n        };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Extensions/ITreeReportExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Extensions;\n\n// Don't change the this parameter to (this IAnalysisContext context) because it would cause boxing\npublic static class ITreeReportExtensions\n{\n    public static void ReportIssue<T>(this T context,\n                                      DiagnosticDescriptor rule,\n                                      SyntaxNode locationSyntax,\n                                      params string[] messageArgs) where T : ITreeReport =>\n        context.ReportIssue(rule, locationSyntax.GetLocation(), messageArgs);\n\n    public static void ReportIssue<T>(this T context,\n                                      DiagnosticDescriptor rule,\n                                      SyntaxNode locationSyntax,\n                                      ImmutableDictionary<string, string> properties,\n                                      params string[] messageArgs) where T : ITreeReport =>\n        context.ReportIssue(rule, locationSyntax.GetLocation(), properties, messageArgs);\n\n    public static void ReportIssue<T>(this T context,\n                                      DiagnosticDescriptor rule,\n                                      SyntaxNode primaryLocationSyntax,\n                                      IEnumerable<SecondaryLocation> secondaryLocations,\n                                      params string[] messageArgs) where T : ITreeReport =>\n        context.ReportIssue(rule, primaryLocationSyntax.GetLocation(), secondaryLocations, messageArgs);\n\n    public static void ReportIssue<T>(this T context,\n                                      DiagnosticDescriptor rule,\n                                      SyntaxToken locationToken,\n                                      params string[] messageArgs) where T : ITreeReport =>\n        context.ReportIssue(rule, locationToken.GetLocation(), messageArgs);\n\n    public static void ReportIssue<T>(this T context,\n                                      DiagnosticDescriptor rule,\n                                      SyntaxToken locationToken,\n                                      ImmutableDictionary<string, string> properties,\n                                      params string[] messageArgs) where T : ITreeReport =>\n        context.ReportIssue(rule, locationToken.GetLocation(), properties, messageArgs);\n\n    public static void ReportIssue<T>(this T context,\n                                      DiagnosticDescriptor rule,\n                                      SyntaxToken primaryLocationToken,\n                                      IEnumerable<SecondaryLocation> secondaryLocations,\n                                      params string[] messageArgs) where T : ITreeReport =>\n        context.ReportIssue(rule, primaryLocationToken.GetLocation(), secondaryLocations, messageArgs);\n\n    public static void ReportIssue<T>(this T context,\n                                      DiagnosticDescriptor rule,\n                                      Location location,\n                                      params string[] messageArgs) where T : ITreeReport =>\n        context.ReportIssue(rule, location, [], ImmutableDictionary<string, string>.Empty, messageArgs);\n\n    public static void ReportIssue<T>(this T context,\n                                      DiagnosticDescriptor rule,\n                                      Location location,\n                                      ImmutableDictionary<string, string> properties,\n                                      params string[] messageArgs) where T : ITreeReport =>\n        context.ReportIssue(rule, location, [], properties, messageArgs);\n\n    public static void ReportIssue<T>(this T context,\n                                      DiagnosticDescriptor rule,\n                                      Location primaryLocation,\n                                      IEnumerable<SecondaryLocation> secondaryLocations,\n                                      params string[] messageArgs) where T : ITreeReport =>\n        context.ReportIssue(rule, primaryLocation, secondaryLocations, ImmutableDictionary<string, string>.Empty, messageArgs);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Extensions/IXmlLineInfoExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Xml;\nusing System.Xml.Linq;\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.Core.Extensions;\n\ninternal static class IXmlLineInfoExtensions\n{\n    public static Location CreateLocation(this IXmlLineInfo startPos, string path, XName name, XElement closestElement)\n    {\n        // IXmlLineInfo is 1-based, whereas Roslyn is zero-based\n        if (startPos.HasLineInfo())\n        {\n            var prefix = closestElement.GetPrefixOfNamespace(name.Namespace);\n            var length = name.LocalName.Length;\n            if (prefix is not null)\n            {\n                length += prefix.Length + 1; // prefix:LocalName - +1 for ':'\n            }\n            var start = new LinePosition(startPos.LineNumber - 1, startPos.LinePosition - 1);\n            var end = new LinePosition(startPos.LineNumber - 1, startPos.LinePosition - 1 + length);\n            // We cannot properly compute the TextSpan as we only have the line information.\n            // It should not break the analysis nor the reporting as we still have the LinePositionSpan.\n            // Manual test has shown that the Sarif contains the correct information with only the LinePositionSpan.\n            return Location.Create(path, new TextSpan(start.Line, length), new LinePositionSpan(start, end));\n        }\n        else\n        {\n            return null;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Extensions/RegexExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text.RegularExpressions;\n\nnamespace SonarAnalyzer.Core.Extensions;\n\npublic static class RegexExtensions\n{\n    private static readonly MatchCollection EmptyMatchCollection = Regex.Matches(string.Empty, \"a\", RegexOptions.None, Constants.DefaultRegexTimeout);\n\n    /// <summary>\n    /// Matches the input to the regex. Returns <see cref=\"Match.Empty\" /> in case of an <see cref=\"RegexMatchTimeoutException\" />.\n    /// </summary>\n    public static Match SafeMatch(this Regex regex, string input)\n    {\n        try\n        {\n            return regex.Match(input);\n        }\n        catch (RegexMatchTimeoutException)\n        {\n            return Match.Empty;\n        }\n    }\n\n    /// <summary>\n    /// Matches the input to the regex. Returns <see langword=\"false\" /> in case of an <see cref=\"RegexMatchTimeoutException\" />.\n    /// </summary>\n    public static bool SafeIsMatch(this Regex regex, string input) =>\n        regex.SafeIsMatch(input, false);\n\n    /// <summary>\n    /// Matches the input to the regex. Returns <paramref name=\"timeoutFallback\"/> in case of an <see cref=\"RegexMatchTimeoutException\" />.\n    /// </summary>\n    public static bool SafeIsMatch(this Regex regex, string input, bool timeoutFallback)\n    {\n        try\n        {\n            return regex.IsMatch(input);\n        }\n        catch (RegexMatchTimeoutException)\n        {\n            return timeoutFallback;\n        }\n    }\n\n    /// <summary>\n    /// Matches the input to the regex. Returns an empty <see cref=\"MatchCollection\" /> in case of an <see cref=\"RegexMatchTimeoutException\" />.\n    /// </summary>\n    public static MatchCollection SafeMatches(this Regex regex, string input)\n    {\n        try\n        {\n            var res = regex.Matches(input);\n            _ = res.Count; // MatchCollection is lazy. Accessing \"Count\" executes the regex and caches the result\n            return res;\n        }\n        catch (RegexMatchTimeoutException)\n        {\n            return EmptyMatchCollection;\n        }\n    }\n\n    /// <summary>\n    /// Replaces <paramref name=\"input\"/> with <paramref name=\"replacement\"/> in <paramref name=\"regex\"/>.\n    /// Returns the original <paramref name=\"input\"/> in case of an <see cref=\"RegexMatchTimeoutException\" />.\n    /// </summary>\n    public static string SafeReplace(this Regex regex, string input, string replacement)\n    {\n        try\n        {\n            return regex.Replace(input, replacement);\n        }\n        catch (RegexMatchTimeoutException)\n        {\n            return input;\n        }\n    }\n}\n\npublic static class SafeRegex\n{\n    /// <summary>\n    /// Matches the input to the regex. Returns <paramref name=\"timeoutFallback\" /> (false by default) in case of an <see cref=\"RegexMatchTimeoutException\" />.\n    /// </summary>\n    public static bool IsMatch(string input, string pattern, bool timeoutFallback = false) =>\n        IsMatch(input, pattern, RegexOptions.None, timeoutFallback);\n\n    /// <inheritdoc cref=\"IsMatch(string, string, bool)\"/>\n    public static bool IsMatch(string input, string pattern, RegexOptions options, bool timeoutFallback = false) =>\n        IsMatch(input, pattern, options, Constants.DefaultRegexTimeout, timeoutFallback);\n\n    /// <inheritdoc cref=\"IsMatch(string, string, bool)\"/>\n    public static bool IsMatch(string input, string pattern, RegexOptions options, TimeSpan matchTimeout, bool timeoutFallback = false)\n    {\n        try\n        {\n            return Regex.IsMatch(input, pattern, options, matchTimeout);\n        }\n        catch (RegexMatchTimeoutException)\n        {\n            return timeoutFallback;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Extensions/SonarAnalysisContextExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\nusing SonarAnalyzer.Core.Configuration;\n\nnamespace SonarAnalyzer.Core.Extensions;\n\npublic static class SonarAnalysisContextExtensions\n{\n    private static readonly SourceTextValueProvider<ProjectConfigReader> ProjectConfigProvider = new(x => new ProjectConfigReader(x));\n\n    public static ProjectConfigReader ProjectConfiguration(this SonarAnalysisContext context, AnalyzerOptions options)\n    {\n        if (options.SonarProjectConfig() is { } sonarProjectConfig)\n        {\n            return sonarProjectConfig.GetText() is { } sourceText\n                // TryGetValue catches all exceptions from SourceTextValueProvider and returns false when exception is thrown\n                && context.TryGetValue(sourceText, ProjectConfigProvider, out var cachedProjectConfigReader)\n                ? cachedProjectConfigReader\n                : throw new InvalidOperationException($\"File '{Path.GetFileName(sonarProjectConfig.Path)}' has been added as an AdditionalFile but could not be read and parsed.\");\n        }\n        else\n        {\n            return ProjectConfigReader.Empty;\n        }\n    }\n\n    public static bool IsRazorAnalysisEnabled(this SonarAnalysisContext context, AnalyzerOptions options, Compilation compilation) =>\n        options.SonarLintXml(context).AnalyzeRazorCode(compilation.Language);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Extensions/StackExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Extensions;\n\npublic static class StackExtensions\n{\n    public static bool TryPop<T>(this Stack<T> stack, out T result)\n    {\n        if (stack.Count > 0)\n        {\n            result = stack.Pop();\n            return true;\n        }\n        result = default;\n        return false;\n    }\n\n    public static void Push<T>(this Stack<T> stack, IEnumerable<T> items)\n    {\n        foreach (var item in items)\n        {\n            stack.Push(item);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Extensions/StringExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Xml.Linq;\n\nnamespace SonarAnalyzer.Core.Extensions;\n\npublic static class StringExtensions\n{\n    public static XDocument ParseXDocument(this string text)\n    {\n        try\n        {\n            return XDocument.Parse(text, LoadOptions.SetLineInfo);\n        }\n        catch\n        {\n            return null;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Extensions/XAttributeExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Xml.Linq;\n\nnamespace SonarAnalyzer.Core.Extensions;\n\npublic static class XAttributeExtensions\n{\n    public static Location CreateLocation(this XAttribute attribute, string path) =>\n        attribute.CreateLocation(path, attribute.Name, attribute.Parent);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Extensions/XElementExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Xml.Linq;\n\nnamespace SonarAnalyzer.Core.Extensions;\n\npublic static class XElementExtensions\n{\n    public static XAttribute GetAttributeIfBoolValueIs(this XElement element, string attributeName, bool value) =>\n        element.Attribute(attributeName) is { } attribute\n            && attribute.Value.Equals(value.ToString(), StringComparison.OrdinalIgnoreCase)\n            ? attribute\n            : null;\n\n    public static Location CreateLocation(this XElement element, string path) =>\n        element.CreateLocation(path, element.Name, element);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Facade/ILanguageFacade.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.Core.Facade;\n\npublic interface ILanguageFacade\n{\n    AssignmentFinder AssignmentFinder { get; }\n    StringComparison NameComparison { get; }\n    StringComparer NameComparer { get; }\n    GeneratedCodeRecognizer GeneratedCodeRecognizer { get; }\n    IExpressionNumericConverter ExpressionNumericConverter { get; }\n\n    DiagnosticDescriptor CreateDescriptor(string id, string messageFormat, bool? isEnabledByDefault = null, bool fadeOutCode = false);\n    object FindConstantValue(SemanticModel model, SyntaxNode node);\n    IMethodParameterLookup MethodParameterLookup(SyntaxNode invocation, IMethodSymbol methodSymbol);\n    IMethodParameterLookup MethodParameterLookup(SyntaxNode invocation, SemanticModel model);\n    string GetName(SyntaxNode expression);\n}\n\npublic interface ILanguageFacade<TSyntaxKind> : ILanguageFacade where TSyntaxKind : struct\n{\n    SyntaxFacade<TSyntaxKind> Syntax { get; }\n    ISyntaxKindFacade<TSyntaxKind> SyntaxKind { get; }\n    ITrackerFacade<TSyntaxKind> Tracker { get; }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Facade/ISyntaxKindFacade.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Facade;\n\npublic interface ISyntaxKindFacade<out TSyntaxKind> where TSyntaxKind : struct\n{\n    abstract TSyntaxKind Attribute { get; }\n    abstract TSyntaxKind AttributeArgument { get; }\n    abstract TSyntaxKind[] CastExpressions { get; }\n    abstract TSyntaxKind ClassDeclaration { get; }\n    abstract TSyntaxKind[] ClassAndRecordDeclarations { get; }\n    abstract TSyntaxKind[] ClassAndModuleDeclarations { get; }\n    abstract TSyntaxKind[] ComparisonKinds { get; }\n    abstract TSyntaxKind ConstructorDeclaration { get; }\n    abstract TSyntaxKind[] DefaultExpressions { get; }\n    abstract TSyntaxKind EndOfLineTrivia { get; }\n    abstract TSyntaxKind EnumDeclaration { get; }\n    abstract TSyntaxKind FieldDeclaration { get; }\n    abstract TSyntaxKind IdentifierName { get; }\n    abstract TSyntaxKind IdentifierToken { get; }\n    abstract TSyntaxKind InvocationExpression { get; }\n    abstract TSyntaxKind InterpolatedStringExpression { get; }\n    abstract TSyntaxKind LeftShiftAssignmentStatement { get; }\n    abstract TSyntaxKind LeftShiftExpression { get; }\n    abstract TSyntaxKind LocalDeclaration { get; }\n    abstract TSyntaxKind[] MethodDeclarations { get; }\n    abstract TSyntaxKind[] ObjectCreationExpressions { get; }\n    abstract TSyntaxKind Parameter { get; }\n    abstract TSyntaxKind RefKeyword { get; }\n    abstract TSyntaxKind RightShiftExpression { get; }\n    abstract TSyntaxKind RightShiftAssignmentStatement { get; }\n    abstract TSyntaxKind ParameterList { get; }\n    abstract TSyntaxKind ReturnStatement { get; }\n    abstract TSyntaxKind SimpleAssignment { get; }\n    abstract TSyntaxKind SimpleCommentTrivia { get; }\n    abstract TSyntaxKind SimpleMemberAccessExpression { get; }\n    abstract TSyntaxKind[] StringLiteralExpressions { get; }\n    abstract TSyntaxKind StructDeclaration { get; }\n    abstract TSyntaxKind SubtractExpression { get; }\n    abstract TSyntaxKind[] TypeDeclaration { get; }\n    abstract TSyntaxKind VariableDeclarator { get; }\n    abstract TSyntaxKind[] LocalDeclarationKinds { get; }\n    abstract TSyntaxKind WhitespaceTrivia { get; }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Facade/ITrackerFacade.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.Core.Facade;\n\npublic interface ITrackerFacade<TSyntaxKind> where TSyntaxKind : struct\n{\n    ArgumentTracker<TSyntaxKind> Argument { get; }\n    BaseTypeTracker<TSyntaxKind> BaseType { get; }\n    ElementAccessTracker<TSyntaxKind> ElementAccess { get; }\n    FieldAccessTracker<TSyntaxKind> FieldAccess { get; }\n    InvocationTracker<TSyntaxKind> Invocation { get; }\n    MethodDeclarationTracker<TSyntaxKind> MethodDeclaration { get; }\n    ObjectCreationTracker<TSyntaxKind> ObjectCreation { get; }\n    PropertyAccessTracker<TSyntaxKind> PropertyAccess { get; }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Facade/SyntaxFacade.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Facade;\n\npublic abstract class SyntaxFacade<TSyntaxKind> where TSyntaxKind : struct\n{\n    public abstract bool AreEquivalent(SyntaxNode firstNode, SyntaxNode secondNode);\n    public abstract IEnumerable<SyntaxNode> ArgumentExpressions(SyntaxNode node);\n    public abstract int? ArgumentIndex(SyntaxNode argument);\n    public abstract IReadOnlyList<SyntaxNode> ArgumentList(SyntaxNode node);\n    public abstract SyntaxToken? ArgumentNameColon(SyntaxNode argument);\n    public abstract SyntaxNode AssignmentLeft(SyntaxNode assignment);\n    public abstract SyntaxNode AssignmentRight(SyntaxNode assignment);\n    public abstract ImmutableArray<SyntaxNode> AssignmentTargets(SyntaxNode assignment);\n    public abstract SyntaxNode BinaryExpressionLeft(SyntaxNode binary);\n    public abstract SyntaxNode BinaryExpressionRight(SyntaxNode binary);\n    public abstract SyntaxNode CastType(SyntaxNode cast);\n    public abstract SyntaxNode CastExpression(SyntaxNode cast);\n    public abstract ComparisonKind ComparisonKind(SyntaxNode node);\n    public abstract IEnumerable<SyntaxNode> EnumMembers(SyntaxNode @enum);\n    public abstract ImmutableArray<SyntaxToken> FieldDeclarationIdentifiers(SyntaxNode node);\n    public abstract bool HasExactlyNArguments(SyntaxNode invocation, int count);\n    public abstract SyntaxToken? InvocationIdentifier(SyntaxNode invocation);\n    public abstract bool IsAnyKind(SyntaxNode node, ISet<TSyntaxKind> syntaxKinds);\n    [Obsolete(\"Either use '.Kind() is A or B' or the overload with the ISet instead.\")]\n    public abstract bool IsAnyKind(SyntaxNode node, params TSyntaxKind[] syntaxKinds);\n    public abstract bool IsAnyKind(SyntaxTrivia trivia, ISet<TSyntaxKind> syntaxKinds);\n    public abstract bool IsInExpressionTree(SemanticModel model, SyntaxNode node);\n    public abstract bool IsKind(SyntaxNode node, TSyntaxKind kind);\n    public abstract bool IsKind(SyntaxToken token, TSyntaxKind kind);\n    public abstract bool IsKind(SyntaxTrivia trivia, TSyntaxKind kind);\n    public abstract bool IsKnownAttributeType(SemanticModel model, SyntaxNode attribute, KnownType knownType);\n    public abstract bool IsMemberAccessOnKnownType(SyntaxNode memberAccess, string name, KnownType knownType, SemanticModel model);\n    public abstract bool IsNullLiteral(SyntaxNode node);\n    public abstract bool IsPartOfBinaryNegationOrCondition(SyntaxNode node);\n    public abstract bool IsStatic(SyntaxNode node);\n    public abstract bool IsWrittenTo(SyntaxNode expression, SemanticModel model, CancellationToken cancel);\n    public abstract TSyntaxKind Kind(SyntaxNode node);\n    public abstract string LiteralText(SyntaxNode literal);\n    public abstract ImmutableArray<SyntaxToken> LocalDeclarationIdentifiers(SyntaxNode node);\n    public abstract TSyntaxKind[] ModifierKinds(SyntaxNode node);\n    public abstract SyntaxNode NodeExpression(SyntaxNode node);\n    public abstract SyntaxToken? NodeIdentifier(SyntaxNode node);\n    public abstract SyntaxToken? ObjectCreationTypeIdentifier(SyntaxNode objectCreation);\n    public abstract SyntaxNode RemoveConditionalAccess(SyntaxNode node);\n    public abstract SyntaxNode RemoveParentheses(SyntaxNode node);\n    public abstract string StringValue(SyntaxNode node, SemanticModel model);\n    public abstract string InterpolatedTextValue(SyntaxNode node, SemanticModel model);\n    public abstract Pair<SyntaxNode, SyntaxNode> Operands(SyntaxNode invocation);\n    public abstract SyntaxNode ParseExpression(string expression);\n\n    protected static T Cast<T>(SyntaxNode node) where T : SyntaxNode =>\n        node as T ?? throw new InvalidCastException($\"A {node.GetType().Name} node can not be cast to a {typeof(T).Name} node.\");\n\n    protected static Exception InvalidOperation(SyntaxNode node, string method) =>\n        new InvalidOperationException($\"{method} can not be performed on a {node.GetType().Name} node.\");\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Json/JsonException.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Diagnostics.CodeAnalysis;\nusing System.Runtime.Serialization;\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.Core.Json;\n\n[Serializable]\npublic sealed class JsonException : Exception\n{\n    public JsonException(string message, LinePosition position) : base($\"{message} at line {position.Line + 1} position {position.Character + 1}\") { }\n\n    [ExcludeFromCodeCoverage]\n    private JsonException(SerializationInfo info, StreamingContext context) : base(info, context) { }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Json/JsonNode.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Collections;\nusing Microsoft.CodeAnalysis.Text;\nusing SonarAnalyzer.Core.Json.Parsing;\n\nnamespace SonarAnalyzer.Core.Json;\n\npublic sealed class JsonNode : IEnumerable<JsonNode>\n{\n    public Kind Kind { get; }\n\n    private readonly List<JsonNode> list;\n    private readonly Dictionary<string, JsonNode> map;\n    private readonly object value;\n\n    public LinePosition Start { get; }\n    public LinePosition End { get; private set; }\n    public JsonNode this[int index] => Kind == Kind.List ? list[index] : throw InvalidKind();\n    public JsonNode this[string key] => Kind == Kind.Object ? map[key] : throw InvalidKind();\n    public IEnumerable<string> Keys => Kind == Kind.Object ? map.Keys : throw InvalidKind();\n    public object Value => Kind == Kind.Value ? value : throw InvalidKind();\n    public int Count => Kind switch\n    {\n        Kind.Object => map.Count,\n        Kind.List => list.Count,\n        _ => throw InvalidKind()\n    };\n\n    public JsonNode(LinePosition start, LinePosition end, object value)\n    {\n        Kind = Kind.Value;\n        Start = start;\n        End = end;\n        this.value = value;\n    }\n\n    public JsonNode(LinePosition start, Kind kind)\n    {\n        Kind = kind;\n        Start = start;\n        switch (kind)\n        {\n            case Kind.List:\n                list = new List<JsonNode>();\n                break;\n            case Kind.Object:\n                map = new Dictionary<string, JsonNode>();\n                break;\n            default:\n                throw InvalidKind();\n        }\n    }\n\n    public static JsonNode FromString(string json)\n    {\n        try\n        {\n            return new SyntaxAnalyzer(json).Parse();\n        }\n        catch (JsonException)\n        {\n            return null;    // Malformed Json\n        }\n    }\n\n    public Location ToLocation(string path)\n    {\n        var length = Value.ToString().Length;\n        var start = new LinePosition(Start.Line, Start.Character + 1);\n        var end = new LinePosition(End.Line, End.Character - 1);\n        return Location.Create(path, new TextSpan(start.Line, length), new LinePositionSpan(start, end));\n    }\n\n    public void UpdateEnd(LinePosition end) =>\n        End = NotInitializedEnd()\n            ? end\n            : throw new InvalidOperationException(\"End position is already set\");\n\n    public void Add(JsonNode value)\n    {\n        if (Kind == Kind.List)\n        {\n            list.Add(value);\n        }\n        else\n        {\n            throw InvalidKind();\n        }\n    }\n\n    public void Add(string key, JsonNode value) =>\n        map[key] = Kind == Kind.Object ? value : throw InvalidKind();\n\n    public bool ContainsKey(string key) =>\n        Kind == Kind.Object ? map.ContainsKey(key) : throw InvalidKind();\n\n    public bool TryGetPropertyNode(string key, out JsonNode node) =>\n        map.TryGetValue(key, out node);\n\n    public IEnumerator<JsonNode> GetEnumerator() =>\n        Kind == Kind.List ? list.GetEnumerator() : throw InvalidKind();\n\n    IEnumerator IEnumerable.GetEnumerator() =>\n        GetEnumerator();\n\n    private InvalidOperationException InvalidKind() =>\n        new($\"Operation is not valid. Json kind is {Kind}\");\n\n    private bool NotInitializedEnd() =>\n        End == LinePosition.Zero;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Json/JsonSerializer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Globalization;\nusing System.Text;\n\nnamespace SonarAnalyzer.Core.Json;\n\npublic static class JsonSerializer\n{\n    public static string Serialize(object value) =>\n        SerializeLines(\"{\", \"}\", value.GetType().GetProperties().Where(x => x.GetIndexParameters().Length == 0).Select(x => $\"\"\"  \"{SerializeKey(x.Name)}\": {SerializeValue(x.GetValue(value))}\"\"\"));\n\n    private static string SerializeKey(string key) =>\n        char.ToLowerInvariant(key[0]) + key.Substring(1);\n\n    private static string SerializeValue(object original) =>\n        original switch\n        {\n            null => \"null\",\n            bool value => value.ToString().ToLower(),\n            sbyte value => value.ToString(),\n            byte value => value.ToString(),\n            short value => value.ToString(),\n            ushort value => value.ToString(),\n            int value => value.ToString(),\n            uint value => value.ToString(),\n            long value => value.ToString(),\n            ulong value => value.ToString(),\n            float value => value.ToString(CultureInfo.InvariantCulture),\n            double value => value.ToString(CultureInfo.InvariantCulture),\n            decimal value => value.ToString(CultureInfo.InvariantCulture),\n            string value => SerializeValue(value),\n            Enum => SerializeValue(original.ToString()),\n            IEnumerable<string> values => $\"[{values.JoinStr(\", \", SerializeValue)}]\",\n            IEnumerable<KeyValuePair<string, object>> values => SerializePairs(values, SerializeValue),\n            IEnumerable<KeyValuePair<string, string>> values => SerializePairs(values, SerializeValue),\n            _ => throw new NotSupportedException($\"Unexpected type: {original.GetType().Name}\")\n        };\n\n    private static string SerializeValue(string value)\n    {\n        var sb = new StringBuilder();\n        sb.Append(@\"\"\"\");\n        foreach (var ch in value)\n        {\n            sb.Append(ch switch\n            {\n                '\\\\' => @\"\\\\\",\n                '\\\"' => @\"\\\"\"\",\n                '\\n' => @\"\\n\",\n                '\\r' => @\"\\r\",\n                '\\t' => @\"\\t\",\n                '\\b' => @\"\\b\",\n                '\\f' => @\"\\f\",\n                _ => ch\n            });\n        }\n        sb.Append(@\"\"\"\");\n        return sb.ToString();\n    }\n\n    private static string SerializePairs<TValue>(IEnumerable<KeyValuePair<string, TValue>> pairs, Func<TValue, string> serializeValue) =>\n        SerializeLines(\"[\", \"  ]\", pairs.Select(x => $$\"\"\"    { \"key\": {{SerializeValue(x.Key)}}, \"value\": {{serializeValue(x.Value)}} }\"\"\"));\n\n    private static string SerializeLines(string prefix, string suffix, IEnumerable<string> lines)\n    {\n        var sb = new StringBuilder();\n        sb.AppendLine(prefix);\n        sb.AppendLine(lines.JoinStr($\",{Environment.NewLine}\"));\n        sb.Append(suffix);\n        return sb.ToString();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Json/JsonWalker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Json.Parsing;\n\nnamespace SonarAnalyzer.Core.Json;\n\npublic class JsonWalker\n{\n    protected JsonWalker() { }\n\n    public virtual void Visit(JsonNode node)\n    {\n        switch (node.Kind)\n        {\n            case Kind.Object:\n                VisitObject(node);\n                break;\n            case Kind.List:\n                VisitList(node);\n                break;\n            case Kind.Value:\n                VisitValue(node);\n                break;\n        }\n    }\n\n    protected virtual void VisitObject(JsonNode node)\n    {\n        foreach (var key in node.Keys)\n        {\n            VisitObject(key, node[key]);\n        }\n    }\n\n    protected virtual void VisitObject(string key, JsonNode value) =>\n        Visit(value);\n\n    protected virtual void VisitList(JsonNode node)\n    {\n        foreach (var item in node)\n        {\n            Visit(item);\n        }\n    }\n\n    protected virtual void VisitValue(JsonNode node)\n    {\n        // Override me\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Json/Parsing/Kind.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Json.Parsing;\n\npublic enum Kind\n{\n    Unknown,\n    Object,\n    List,\n    Value\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Json/Parsing/LexicalAnalyzer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Globalization;\nusing System.Text;\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.Core.Json.Parsing;\n\ninternal class LexicalAnalyzer\n{\n    private readonly List<string> lines = new();\n    private int line;\n    private int column = -1;\n\n    public object Value { get; private set; }\n    public LinePosition LastStart { get; private set; }\n    private char CurrentChar => lines[line][column];\n    private bool ReachedEndOfInput => line > lines.Count - 1 || (line == lines.Count - 1 && column >= lines[line].Length);\n\n    public LexicalAnalyzer(string source)\n    {\n        var sb = new StringBuilder();\n        foreach (var c in source.Replace(\"\\r\\n\", \"\\n\"))\n        {\n            if (c is '\\n' or '\\r' || char.GetUnicodeCategory(c) is UnicodeCategory.LineSeparator or UnicodeCategory.ParagraphSeparator)\n            {\n                lines.Add(sb.ToString());\n                sb.Clear();\n            }\n            else\n            {\n                sb.Append(c);\n            }\n        }\n        lines.Add(sb.ToString());\n    }\n\n    public LinePosition CurrentPosition(int increment) =>\n        new(line, column + increment);\n\n    public Symbol NextSymbol()\n    {\n        Value = null;\n        NextPosition(false);\n        SkipWhitespaceAndComments();\n        if (ReachedEndOfInput)\n        {\n            return Symbol.EndOfInput;\n        }\n        LastStart = CurrentPosition(0);\n        switch (CurrentChar)\n        {\n            case '{':\n                return Symbol.OpenCurlyBracket;\n            case '}':\n                return Symbol.CloseCurlyBracket;\n            case '[':\n                return Symbol.OpenSquareBracket;\n            case ']':\n                return Symbol.CloseSquareBracket;\n            case ',':\n                return Symbol.Comma;\n            case ':':\n                return Symbol.Colon;\n            case '\"':\n                Value = ReadStringValue();\n                return Symbol.Value;\n            case (>= '0' and <= '9') or '-':\n                Value = ReadNumberValue();\n                return Symbol.Value;\n            case 'n':\n                ReadKeyword(\"null\");\n                Value = null;\n                return Symbol.Value;\n            case 't':\n                ReadKeyword(\"true\");\n                Value = true;\n                return Symbol.Value;\n            case 'f':\n                ReadKeyword(\"false\");\n                Value = false;\n                return Symbol.Value;\n            default:\n                throw new JsonException($\"Unexpected character '{CurrentChar}'\", LastStart);\n        }\n    }\n\n    private void NextPosition(bool throwIfReachedEndOfInput = true)\n    {\n        if (line < lines.Count && column < lines[line].Length - 1)\n        {\n            column++;\n        }\n        else\n        {\n            SeekToNextLine(throwIfReachedEndOfInput);\n        }\n    }\n\n    private void SeekToNextLine(bool throwIfReachedEndOfInput)\n    {\n        do\n        {\n            line++;\n        }\n        while (line < lines.Count && lines[line].Length == 0);\n        column = 0;\n        if (throwIfReachedEndOfInput && ReachedEndOfInput)\n        {\n            throw new JsonException(\"Unexpected EOI\", LastStart);\n        }\n    }\n\n    private void SkipWhitespaceAndComments()\n    {\n        var isInMultiLineComment = false;\n        while (!ReachedEndOfInput)\n        {\n            if (char.IsWhiteSpace(CurrentChar))\n            {\n                NextPosition(false);\n            }\n            else if (IsSingleLineComment())\n            {\n                // We just need to read starting from the next line\n                SeekToNextLine(false);\n            }\n            else if (IsEndOfMultiLineComment())\n            {\n                isInMultiLineComment = false;\n                NextPosition(false); // Skip *\n                NextPosition(false); // Skip /\n            }\n            else if (IsMultiLineComment())\n            {\n                if (!isInMultiLineComment)\n                {\n                    // need to skip /* part of the comment\n                    NextPosition(false); // Skip /\n                    NextPosition(false); // Skip *\n                }\n                isInMultiLineComment = true;\n                NextPosition(); // we still want to fail on non-closed comments\n            }\n            else\n            {\n                return;\n            }\n        }\n\n        char? NextCharSameLine() =>\n            (column + 1 < lines[line].Length) ? lines[line][column + 1] : (char?)null;\n\n        bool IsSingleLineComment() =>\n            CurrentChar == '/' && NextCharSameLine() == '/';\n\n        bool IsMultiLineComment() =>\n            isInMultiLineComment || (CurrentChar == '/' && NextCharSameLine() == '*');\n\n        bool IsEndOfMultiLineComment() =>\n            isInMultiLineComment && CurrentChar == '*' && NextCharSameLine() == '/';\n    }\n\n    private void ReadKeyword(string keyword)\n    {\n        for (var i = 0; i < keyword.Length; i++)\n        {\n            if (lines[line][column + i] != keyword[i])\n            {\n                throw new JsonException($\"Unexpected character '{lines[line][column + i]}'. Keyword '{keyword}' was expected\", LastStart);\n            }\n        }\n        column += keyword.Length - 1;\n    }\n\n    private string ReadStringValue()\n    {\n        const int UnicodeEscapeLength = 4;\n        var sb = new StringBuilder();\n        NextPosition();  // Skip quote\n        while (CurrentChar != '\"')\n        {\n            if (CurrentChar == '\\\\')\n            {\n                NextPosition();\n                switch (CurrentChar)\n                {\n                    case '\"':\n                        sb.Append('\"');\n                        break;\n                    case '\\\\':\n                        sb.Append('\\\\');\n                        break;\n                    case '/':\n                        sb.Append('/');\n                        break;\n                    case 'b':\n                        sb.Append('\\b');\n                        break;\n                    case 'f':\n                        sb.Append('\\f');\n                        break;\n                    case 'n':\n                        sb.Append('\\n');\n                        break;\n                    case 'r':\n                        sb.Append('\\r');\n                        break;\n                    case 't':\n                        sb.Append('\\t');\n                        break;\n                    case 'u':\n                        if (column + UnicodeEscapeLength >= lines[line].Length)\n                        {\n                            throw new JsonException(@\"Unexpected EOI, \\uXXXX escape expected\", LastStart);\n                        }\n                        sb.Append(char.ConvertFromUtf32(int.Parse(lines[line].Substring(column + 1, UnicodeEscapeLength), NumberStyles.HexNumber)));\n                        column += UnicodeEscapeLength;\n                        break;\n                    default:\n                        throw new JsonException($@\"Unexpected escape sequence \\{CurrentChar}\", LastStart);\n                }\n            }\n            else\n            {\n                sb.Append(CurrentChar);\n            }\n            NextPosition();\n        }\n        return sb.ToString();\n    }\n\n    private object ReadNumberValue()\n    {\n        StringBuilder @decimal = null;\n        StringBuilder exponent = null;\n        StringBuilder integral = new();\n        StringBuilder current = integral;\n        while (!ReachedEndOfInput)\n        {\n            switch (CurrentChar)\n            {\n                case '-':\n                    if (current.Length == 0)\n                    {\n                        current.Append('-');\n                    }\n                    else\n                    {\n                        throw new JsonException(\"Unexpected Number format: Unexpected '-'\", LastStart);\n                    }\n                    break;\n                case (>= '0' and <= '9'):\n                    current.Append(CurrentChar);\n                    break;\n                case '.':\n                    if (current == integral && current.ToString().TrimStart('-').Any())\n                    {\n                        @decimal = new StringBuilder();\n                        current = @decimal;\n                    }\n                    else\n                    {\n                        throw new JsonException(\"Unexpected Number format: Unexpected '.'\", LastStart);\n                    }\n                    break;\n                case '+':\n                    if (current != exponent || current.Length != 0)\n                    {\n                        throw new JsonException(\"Unexpected Number format\", LastStart);\n                    }\n                    break;\n                case 'e' or 'E':\n                    exponent = new StringBuilder();\n                    current = exponent;\n                    break;\n                default:\n                    // Remain on the last digit, position cannot be zero here, since we at least read one digit character\n                    column--;\n                    return BuildResult();\n            }\n            NextPosition(false);\n        }\n        return BuildResult();\n\n        object BuildResult()\n        {\n            var baseValue = @decimal == null\n                ? (object)double.Parse(integral.ToString(), CultureInfo.InvariantCulture)\n                : decimal.Parse(integral + CultureInfo.InvariantCulture.NumberFormat.NumberDecimalSeparator + @decimal, CultureInfo.InvariantCulture);\n\n            if (exponent == null)   // Integer or Decimal\n            {\n                return baseValue;\n            }\n            else if (exponent.Length == 0 || exponent.ToString() == \"-\")\n            {\n                throw new JsonException($\"Unexpected Number exponent format: {exponent}\", LastStart);\n            }\n            else\n            {\n                return Convert.ToDouble(baseValue) * Math.Pow(10, int.Parse(exponent.ToString()));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Json/Parsing/Symbol.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Json.Parsing;\n\ninternal enum Symbol\n{\n    Unknown,\n    EndOfInput,\n    // Special\n    OpenCurlyBracket,\n    CloseCurlyBracket,\n    OpenSquareBracket,\n    CloseSquareBracket,\n    Comma,\n    Colon,\n    // Terms\n    Value   // String, Number (Integer, Decimal, Double), Null, True, False\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Json/Parsing/SyntaxAnalyzer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.Core.Json.Parsing;\n\ninternal class SyntaxAnalyzer\n{\n    // Parse   -> { ParseObject | [ ParseList\n\n    // ParseObject -> } | ObjectKeyValue ObjectRest\n    // ObjectRest -> , ObjectKeyValue ObjectRest | }\n    // ObjectKeyValue -> String : ParseValue\n\n    // ParseList -> ] | ParseValue ArrayRest\n    // ArrayRest -> , ParseValue ] | ]\n\n    // ParseValue -> { ParseObject | [ ParseList | Symbol.Value (Where .Value is true | false | null | String | Number)\n    private readonly LexicalAnalyzer lexer;\n    private Symbol symbol;\n\n    public SyntaxAnalyzer(string source) =>\n        lexer = new LexicalAnalyzer(source);\n\n    public JsonNode Parse() =>\n        ReadNext() switch\n        {\n            Symbol.OpenCurlyBracket => ParseObject(),\n            Symbol.OpenSquareBracket => ParseList(),\n            _ => throw Unexpected(\"{ or [\")\n        };\n\n    private Symbol ReadNext() =>\n        symbol = lexer.NextSymbol();\n\n    private JsonNode ParseObject()\n    {\n        var ret = new JsonNode(lexer.LastStart, Kind.Object);\n        if (ReadNext() != Symbol.CloseCurlyBracket)  // Could be empty object {}\n        {\n            ObjectKeyValue(ret);\n            while (ReadNext() == Symbol.Comma)\n            {\n                ReadNext();\n                ObjectKeyValue(ret);\n            }\n            if (symbol != Symbol.CloseCurlyBracket)\n            {\n                throw Unexpected(\"}\");\n            }\n        }\n        ret.UpdateEnd(new LinePosition(lexer.LastStart.Line, lexer.LastStart.Character + 1));\n        return ret;\n    }\n\n    private void ObjectKeyValue(JsonNode target)\n    {\n        if (symbol == Symbol.Value && lexer.Value is string key)\n        {\n            if (ReadNext() != Symbol.Colon)\n            {\n                throw Unexpected(\":\");\n            }\n            ReadNext(); // Prepare before reading Value\n            target.Add(key, ParseValue());\n        }\n        else\n        {\n            throw Unexpected(\"String Value\");\n        }\n    }\n\n    private JsonNode ParseList()\n    {\n        var ret = new JsonNode(lexer.LastStart, Kind.List);\n        if (ReadNext() != Symbol.CloseSquareBracket)    // Could be empty array []\n        {\n            ret.Add(ParseValue());\n            while (ReadNext() == Symbol.Comma)\n            {\n                ReadNext();\n                ret.Add(ParseValue());\n            }\n            if (symbol != Symbol.CloseSquareBracket)\n            {\n                throw Unexpected(\"]\");\n            }\n        }\n        ret.UpdateEnd(new LinePosition(lexer.LastStart.Line, lexer.LastStart.Character + 1));\n        return ret;\n    }\n\n    private JsonNode ParseValue() =>\n        // Symbol is already read\n        symbol switch\n        {\n            Symbol.OpenCurlyBracket => ParseObject(),\n            Symbol.OpenSquareBracket => ParseList(),\n            Symbol.Value => new JsonNode(lexer.LastStart, lexer.CurrentPosition(1), lexer.Value),\n            _ => throw Unexpected(\"{, [ or Value (true, false, null, String, Number)\")\n        };\n\n    private JsonException Unexpected(string expected) =>\n        new JsonException($\"{expected} expected, but {symbol} found\", lexer.LastStart);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Metrics/CognitiveComplexity.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Metrics;\n\npublic class CognitiveComplexity\n{\n    public int Complexity { get; }\n    public ImmutableArray<SecondaryLocation> Locations { get; }\n\n    public CognitiveComplexity(int complexity, ImmutableArray<SecondaryLocation> locations)\n    {\n        Complexity = complexity;\n        Locations = locations;\n    }\n}\n\npublic class CognitiveComplexityWalkerState<TMethodSyntax>\n    where TMethodSyntax : SyntaxNode\n{\n    public TMethodSyntax CurrentMethod { get; set; }\n\n    public IList<SecondaryLocation> IncrementLocations { get; } = new List<SecondaryLocation>();\n\n    // used to track logical operations inside parentheses\n    public IList<SyntaxNode> LogicalOperationsToIgnore { get; } = new List<SyntaxNode>();\n\n    public bool HasDirectRecursiveCall { get; set; }\n\n    public int NestingLevel { get; set; }\n\n    public int Complexity { get; set; }\n\n    public void VisitWithNesting<TSyntaxNode>(TSyntaxNode node, Action<TSyntaxNode> visit)\n    {\n        NestingLevel++;\n        visit(node);\n        NestingLevel--;\n    }\n\n    public void IncreaseComplexityByOne(SyntaxToken token) =>\n        IncreaseComplexity(token, 1, \"+1\");\n\n    public void IncreaseComplexityByNestingPlusOne(SyntaxToken token)\n    {\n        var increment = NestingLevel + 1;\n        var message = increment == 1\n            ? \"+1\"\n            : $\"+{increment} (incl {increment - 1} for nesting)\";\n        IncreaseComplexity(token, increment, message);\n    }\n\n    public void IncreaseComplexity(SyntaxToken token, int increment, string message)\n    {\n        Complexity += increment;\n        IncrementLocations.Add(new SecondaryLocation(token.GetLocation(), message));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Metrics/FileComments.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Metrics;\n\npublic class FileComments\n{\n    public ISet<int> NoSonar { get; }\n    public ISet<int> NonBlank { get; }\n\n    public FileComments(ISet<int> noSonar, ISet<int> nonBlank)\n    {\n        NoSonar = noSonar;\n        NonBlank = nonBlank;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Metrics/MetricsBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Metrics;\n\npublic abstract class MetricsBase\n{\n    protected const string InitializationErrorTextPattern = \"The input tree is not of the expected language.\";\n\n    private readonly SyntaxTree tree;\n    private readonly string filePath;\n\n    public abstract ImmutableArray<int> ExecutableLines { get; }\n    public abstract int ComputeCyclomaticComplexity(SyntaxNode node);\n    protected abstract bool IsEndOfFile(SyntaxToken token);\n    protected abstract int ComputeCognitiveComplexity(SyntaxNode node);\n    protected abstract bool IsNoneToken(SyntaxToken token);\n    protected abstract bool IsCommentTrivia(SyntaxTrivia trivia);\n    protected abstract bool IsClass(SyntaxNode node);\n    protected abstract bool IsStatement(SyntaxNode node);\n    protected abstract bool IsFunction(SyntaxNode node);\n\n    public ISet<int> CodeLines =>\n        tree.GetRoot()\n            .DescendantTokens()\n            .Select(GetMappedLineSpan)\n            .Where(x => x is not null)\n            .SelectMany(\n                x =>\n                {\n                    var start = x.Value.StartLinePosition.LineNumberToReport();\n                    var end = x.Value.EndLinePosition.LineNumberToReport();\n                    return Enumerable.Range(start, end - start + 1);\n                })\n            .ToHashSet();\n\n    protected MetricsBase(SyntaxTree tree)\n    {\n        this.tree = tree;\n        filePath = tree.GetRoot().GetMappedFilePathFromRoot();\n    }\n\n    public FileComments GetComments(bool ignoreHeaderComments)\n    {\n        var noSonar = new HashSet<int>();\n        var nonBlank = new HashSet<int>();\n\n        foreach (var trivia in tree.GetRoot().DescendantTrivia())\n        {\n            if (!IsCommentTrivia(trivia)\n                || ignoreHeaderComments && IsNoneToken(trivia.Token.GetPreviousToken()))\n            {\n                continue;\n            }\n\n            var mappedSpan = tree.GetMappedLineSpan(trivia.FullSpan);\n            if (!IsInSameFile(mappedSpan))\n            {\n                continue;\n            }\n\n            var lineNumber = mappedSpan.StartLinePosition.Line + 1;\n            var triviaLines = trivia.ToFullString().Split(Constants.LineTerminators, StringSplitOptions.None);\n\n            foreach (var line in triviaLines)\n            {\n                CategorizeLines(line, lineNumber, noSonar, nonBlank);\n\n                lineNumber++;\n            }\n        }\n\n        return new FileComments(noSonar.ToHashSet(), nonBlank.ToHashSet());\n    }\n\n    public int ClassCount =>\n        ClassNodes.Count();\n\n    public int StatementCount =>\n        tree.GetRoot().DescendantNodes().Count(IsStatement);\n\n    public int FunctionCount =>\n        FunctionNodes.Count();\n\n    public int Complexity =>\n        ComputeCyclomaticComplexity(tree.GetRoot());\n\n    public int CognitiveComplexity =>\n        ComputeCognitiveComplexity(tree.GetRoot());\n\n    protected bool IsInSameFile(FileLinePositionSpan span) =>\n        // Syntax tree can contain elements from external files (e.g. razor imports files)\n        // We need to make sure that we don't count these elements.\n        string.Equals(filePath, span.Path, StringComparison.OrdinalIgnoreCase);\n\n    private IEnumerable<SyntaxNode> ClassNodes =>\n        tree.GetRoot().DescendantNodes().Where(IsClass);\n\n    private IEnumerable<SyntaxNode> FunctionNodes =>\n        tree.GetRoot().DescendantNodes().Where(IsFunction);\n\n    private FileLinePositionSpan? GetMappedLineSpan(SyntaxToken token) =>\n        !IsEndOfFile(token)\n        && token.GetLocation().GetMappedLineSpan() is { IsValid: true } mappedLineSpan\n        && (!GeneratedCodeRecognizer.IsRazor(token.SyntaxTree) || mappedLineSpan.HasMappedPath)\n        && IsInSameFile(mappedLineSpan)\n            ? mappedLineSpan\n            : null;\n\n    private static void CategorizeLines(string line, int lineNumber, ISet<int> noSonar, ISet<int> nonBlank)\n    {\n        if (line.Contains(\"NOSONAR\"))\n        {\n            nonBlank.Remove(lineNumber);\n            noSonar.Add(lineNumber);\n        }\n        else\n        {\n            if (HasValidCommentContent(line)\n                && !noSonar.Contains(lineNumber))\n            {\n                nonBlank.Add(lineNumber);\n            }\n        }\n    }\n\n    private static bool HasValidCommentContent(string content) =>\n        content.Any(char.IsLetter) || content.Any(char.IsDigit);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Properties/AssemblyInfo.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Runtime.CompilerServices;\n\n[assembly: InternalsVisibleTo(\"SonarAnalyzer.Core.Test\")]\n[assembly: InternalsVisibleTo(\"SonarAnalyzer.CSharp\")]\n[assembly: InternalsVisibleTo(\"SonarAnalyzer.CSharp.Core.Test\")]\n[assembly: InternalsVisibleTo(\"SonarAnalyzer.Test\")]\n[assembly: InternalsVisibleTo(\"SonarAnalyzer.TestFramework\")]\n[assembly: InternalsVisibleTo(\"SonarAnalyzer.VisualBasic\")]\n[assembly: InternalsVisibleTo(\"SonarAnalyzer.VisualBasic.Core.Test\")]\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Protobuf/AnalyzerReport.proto",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nsyntax = \"proto3\";\npackage sonaranalyzer;\n\noption csharp_namespace = \"SonarAnalyzer.Protobuf\";\noption java_package = \"org.sonarsource.dotnet.protobuf\";\noption java_outer_classname = \"SonarAnalyzer\";\n\noption optimize_for = SPEED;\n\n// Naming convention:\n// we use singular for repeated field names, because that works better in Java, and we don't care in C#\n\n// Lines start at 1 and line offsets start at 0\nmessage TextRange {\n  int32 start_line = 1;\n  // End line (inclusive)\n  int32 end_line = 2;\n  int32 start_offset = 3;\n  int32 end_offset = 4;\n}\n\nenum TokenType {\n  UNKNOWN_TOKENTYPE = 0;\n  TYPE_NAME = 1;\n  NUMERIC_LITERAL = 2;\n  STRING_LITERAL = 3;\n  KEYWORD = 4;\n  COMMENT = 5;\n}\n\n// Used for code coloring\nmessage TokenTypeInfo {\n  string file_path = 1;\n\n  message TokenInfo {\n    TokenType token_type = 1;\n    TextRange text_range = 2;\n  }\n\n  repeated TokenInfo token_info = 2;\n}\n\n// Used for symbol reference highlighting\nmessage SymbolReferenceInfo {\n  string file_path = 1;\n\n  message SymbolReference {\n    TextRange declaration = 1;\n    repeated TextRange reference = 2;\n  }\n\n  repeated SymbolReference reference = 2;\n}\n\n// Used for copy-paste detection\nmessage CopyPasteTokenInfo {\n  string file_path = 1;\n\n  message TokenInfo {\n    string token_value = 1;\n    TextRange text_range = 2;\n  }\n\n  repeated TokenInfo token_info = 2;\n}\n\n// Metrics reporting\nmessage MetricsInfo {\n  string file_path = 1;\n\n  int32 class_count = 2;\n  int32 statement_count = 3;\n  int32 function_count = 4;\n\n  int32 complexity = 7;\n\n  repeated int32 no_sonar_comment = 12;\n  repeated int32 non_blank_comment = 13;\n  repeated int32 code_line = 14;\n\n  int32 cognitive_complexity = 15;\n  repeated int32 executable_lines = 16;\n}\n\nmessage FileMetadataInfo {\n  string file_path = 1;\n  bool is_generated = 2;\n  string encoding = 3;\n}\n\nmessage MethodDeclarationsInfo {\n  string file_path = 1;\n  string assembly_name = 2;\n  repeated MethodDeclarationInfo method_declarations = 3;\n}\n\nmessage MethodDeclarationInfo {\n  string type_name = 1;\n  string method_name = 2;\n}\n\n// Logging\nenum LogSeverity {\n  UNKNOWN_SEVERITY = 0;\n  DEBUG = 1;\n  INFO = 2;\n  WARNING = 3;\n}\n\nmessage LogInfo {\n    LogSeverity severity = 1;\n    string text = 2;\n}\n\nmessage Telemetry {\n  string projectFullPath = 10;          // From ProjectInfo.xml FullPath\n  string languageVersion = 30;          // From CSharpParseOptions.LanguageVersion\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/RegularExpressions/NamingPatterns.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text.RegularExpressions;\n\nnamespace SonarAnalyzer.Core.RegularExpressions;\n\npublic static class NamingPatterns\n{\n    public const string PascalCasingInternalPattern = \"([A-Z]{1,3}[a-z0-9]+)*\" + MaxTwoLongIdPattern;\n    public const string PascalCasingPattern = \"^\" + PascalCasingInternalPattern + \"$\";\n    public const string CamelCasingPattern = \"^\" + CamelCasingInternalPattern + \"$\";\n    public const string CamelCasingPatternWithOptionalPrefixes = \"^(s_|_)?\" + CamelCasingInternalPattern + \"$\";\n    private const string CamelCasingInternalPattern = \"[a-z][a-z0-9]*\" + PascalCasingInternalPattern;\n    private const string MaxTwoLongIdPattern = \"([A-Z]{2})?\";\n\n    internal static bool IsRegexMatch(string name, string pattern, bool timeoutFallback = false) =>\n        SafeRegex.IsMatch(name, pattern, RegexOptions.CultureInvariant | RegexOptions.Compiled, timeoutFallback);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/RegularExpressions/RegexContext.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text.RegularExpressions;\n\nnamespace SonarAnalyzer.Core.RegularExpressions;\n\ninternal sealed class RegexContext\n{\n    private static readonly RegexOptions ValidationMask = (RegexOptions)int.MaxValue ^ RegexOptions.Compiled;\n\n    private static readonly string[] MatchMethods = new[]\n    {\n        nameof(Regex.IsMatch),\n        nameof(Regex.Match),\n        nameof(Regex.Matches),\n        nameof(Regex.Replace),\n        nameof(Regex.Split),\n        \"EnumerateSplits\",  // https://learn.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.regex.enumeratesplits?view=net-9.0\n        \"EnumerateMatches\", // https://learn.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.regex.enumeratematches?view=net-9.0\n    };\n\n    public SyntaxNode PatternNode { get; }\n    public string Pattern { get; }\n    public SyntaxNode OptionsNode { get; }\n    public RegexOptions? Options { get; }\n    public Regex Regex { get; }\n    public Exception ParseError { get; }\n\n    public RegexContext(SyntaxNode patternNode, string pattern, SyntaxNode optionsNode, RegexOptions? options)\n    {\n        PatternNode = patternNode;\n        Pattern = pattern;\n        OptionsNode = optionsNode;\n        Options = options;\n\n        if (!string.IsNullOrEmpty(pattern))\n        {\n            try\n            {\n                Regex = new(Pattern, options.GetValueOrDefault() & ValidationMask, Constants.DefaultRegexTimeout);\n            }\n            catch (Exception ex)\n            {\n                ParseError = ex;\n            }\n        }\n    }\n\n    public static RegexContext FromAttribute<TSyntaxKind>(ILanguageFacade<TSyntaxKind> language, SemanticModel model, SyntaxNode node) where TSyntaxKind : struct\n    {\n        if (model.GetSymbolInfo(node).Symbol is IMethodSymbol method\n            && method.IsInType(KnownType.System_ComponentModel_DataAnnotations_RegularExpressionAttribute))\n        {\n            var parameters = language.MethodParameterLookup(node, method);\n            var pattern = TryGetNonParamsSyntax(method, parameters, \"pattern\");\n            return new RegexContext(pattern, language.FindConstantValue(model, pattern) as string, null, null);\n        }\n        else\n        {\n            return null;\n        }\n    }\n\n    public static RegexContext FromCtor<TSyntaxKind>(ILanguageFacade<TSyntaxKind> language, SemanticModel model, SyntaxNode node) where TSyntaxKind : struct =>\n        model.GetSymbolInfo(node).Symbol is IMethodSymbol method\n        && method.IsConstructor()\n        && method.ContainingType.Is(KnownType.System_Text_RegularExpressions_Regex)\n            ? FromMethod(language, model, node, method)\n            : null;\n\n    public static RegexContext FromMethod<TSyntaxKind>(ILanguageFacade<TSyntaxKind> language, SemanticModel model, SyntaxNode node) where TSyntaxKind : struct =>\n        language.Syntax.NodeIdentifier(node).GetValueOrDefault().Text is { } name\n        && MatchMethods.Any(x => name.Equals(x, language.NameComparison))\n        && model.GetSymbolInfo(node).Symbol is IMethodSymbol { IsStatic: true } method\n        && method.ContainingType.Is(KnownType.System_Text_RegularExpressions_Regex)\n            ? FromMethod(language, model, node, method)\n            : null;\n\n    private static RegexContext FromMethod<TSyntaxKind>(ILanguageFacade<TSyntaxKind> language, SemanticModel model, SyntaxNode node, IMethodSymbol method) where TSyntaxKind : struct\n    {\n        var parameters = language.MethodParameterLookup(node, method);\n        var pattern = TryGetNonParamsSyntax(method, parameters, \"pattern\");\n        var options = TryGetNonParamsSyntax(method, parameters, \"options\");\n\n        return new RegexContext(\n            pattern,\n            language.FindConstantValue(model, pattern) as string,\n            options,\n            language.FindConstantValue(model, options) is RegexOptions value ? value : null);\n    }\n\n    private static SyntaxNode TryGetNonParamsSyntax(IMethodSymbol method, IMethodParameterLookup parameters, string paramName) =>\n        method.Parameters.SingleOrDefault(x => x.Name == paramName) is { } param\n        && parameters.TryGetNonParamsSyntax(param, out var node)\n            ? node\n            : null;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/RegularExpressions/WildcardPatternMatcher.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Collections.Concurrent;\nusing System.IO;\nusing System.Text;\nusing System.Text.RegularExpressions;\n\nnamespace SonarAnalyzer.Core.RegularExpressions;\n\ninternal static class WildcardPatternMatcher\n{\n    private static readonly ConcurrentDictionary<string, Regex> Cache = new();\n\n    public static bool IsMatch(string pattern, string input, bool timeoutFallbackResult) =>\n        !(string.IsNullOrWhiteSpace(pattern) || string.IsNullOrWhiteSpace(input))\n        && Cache.GetOrAdd(pattern, _ => new Regex(ToRegex(pattern), RegexOptions.None, Constants.DefaultRegexTimeout)) is var regex\n        && regex.SafeIsMatch(input.Trim('/'), timeoutFallbackResult);\n\n    /// <summary>\n    /// Copied from https://github.com/SonarSource/sonar-plugin-api/blob/a9bd7ff48f0f77811ed909070030678c443c975a/sonar-plugin-api/src/main/java/org/sonar/api/utils/WildcardPattern.java.\n    /// </summary>\n    private static string ToRegex(string wildcardPattern)\n    {\n        var escapedDirectorySeparator = Regex.Escape(Path.DirectorySeparatorChar.ToString());\n        var sb = new StringBuilder(\"^\", wildcardPattern.Length);\n        var i = IsSlash(wildcardPattern[0]) ? 1 : 0;\n        while (i < wildcardPattern.Length)\n        {\n            var ch = wildcardPattern[i];\n            if (ch == '*')\n            {\n                if (i + 1 < wildcardPattern.Length && wildcardPattern[i + 1] == '*')\n                {\n                    // Double asterisk - Zero or more directories\n                    if (i + 2 < wildcardPattern.Length && IsSlash(wildcardPattern[i + 2]))\n                    {\n                        sb.Append($\"(.*{escapedDirectorySeparator}|)\");\n                        i += 2;\n                    }\n                    else\n                    {\n                        sb.Append(\".*\");\n                        i += 1;\n                    }\n                }\n                else\n                {\n                    // Single asterisk - Zero or more characters excluding directory separator\n                    sb.Append($\"[^{escapedDirectorySeparator}]*?\");\n                }\n            }\n            else if (ch == '?')\n            {\n                // Any single character excluding directory separator\n                sb.Append($\"[^{escapedDirectorySeparator}]\");\n            }\n            else if (IsSlash(ch))\n            {\n                sb.Append(escapedDirectorySeparator);\n            }\n            else\n            {\n                sb.Append(Regex.Escape(ch.ToString()));\n            }\n            i++;\n        }\n        return sb.Append('$').ToString();\n    }\n\n    private static bool IsSlash(char ch) =>\n        ch == '/' || ch == '\\\\';\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/AllBranchesShouldNotHaveSameImplementationBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class AllBranchesShouldNotHaveSameImplementationBase : SonarDiagnosticAnalyzer\n    {\n        protected const string StatementsMessage =\n            \"Remove this conditional structure or edit its code blocks so that they're not all the same.\";\n\n        protected const string TernaryMessage =\n            \"This conditional operation returns the same value whether the condition is \\\"true\\\" or \\\"false\\\".\";\n\n        internal const string DiagnosticId = \"S3923\";\n        internal const string MessageFormat = \"{0}\";\n\n        protected abstract class IfStatementAnalyzerBase<TElseSyntax, TIfSyntax>\n            where TElseSyntax : SyntaxNode\n            where TIfSyntax : SyntaxNode\n        {\n            protected abstract IEnumerable<SyntaxNode> GetStatements(TElseSyntax elseSyntax);\n\n            protected abstract IEnumerable<IEnumerable<SyntaxNode>> GetIfBlocksStatements(TElseSyntax elseSyntax,\n                out TIfSyntax topLevelIf);\n\n            protected abstract bool IsLastElseInChain(TElseSyntax elseSyntax);\n\n            protected abstract Location GetLocation(TIfSyntax topLevelIf);\n\n            public Action<SonarSyntaxNodeReportingContext> GetAnalysisAction(DiagnosticDescriptor rule) =>\n                context =>\n                {\n                    var elseSyntax = (TElseSyntax)context.Node;\n\n                    if (!IsLastElseInChain(elseSyntax))\n                    {\n                        return;\n                    }\n\n                    var ifBlocksStatements = GetIfBlocksStatements(elseSyntax, out var topLevelIf);\n\n                    var elseStatements = GetStatements(elseSyntax);\n\n                    if (ifBlocksStatements.All(ifStatements => AreEquivalent(ifStatements, elseStatements)))\n                    {\n                        context.ReportIssue(rule, GetLocation(topLevelIf), StatementsMessage);\n                    }\n                };\n\n            private static bool AreEquivalent(IEnumerable<SyntaxNode> nodes1, IEnumerable<SyntaxNode> nodes2) =>\n                nodes1.Equals(nodes2, (x, y) => x.IsEquivalentTo(y, topLevel: false));\n        }\n\n        protected abstract class TernaryStatementAnalyzerBase<TTernaryStatement>\n            where TTernaryStatement : SyntaxNode\n        {\n            protected abstract SyntaxNode GetWhenTrue(TTernaryStatement ternaryStatement);\n\n            protected abstract SyntaxNode GetWhenFalse(TTernaryStatement ternaryStatement);\n\n            protected abstract Location GetLocation(TTernaryStatement ternaryStatement);\n\n            public Action<SonarSyntaxNodeReportingContext> GetAnalysisAction(DiagnosticDescriptor rule) =>\n                context =>\n                {\n                    var ternaryStatement = (TTernaryStatement)context.Node;\n\n                    var whenTrue = GetWhenTrue(ternaryStatement);\n                    var whenFalse = GetWhenFalse(ternaryStatement);\n\n                    if (whenTrue.IsEquivalentTo(whenFalse, topLevel: false))\n                    {\n                        context.ReportIssue(rule, GetLocation(ternaryStatement), TernaryMessage);\n                    }\n                };\n        }\n\n        protected abstract class SwitchStatementAnalyzerBase<TSwitchStatement, TSwitchSection>\n            where TSwitchStatement : SyntaxNode\n            where TSwitchSection : SyntaxNode\n        {\n            protected abstract IEnumerable<TSwitchSection> GetSections(TSwitchStatement switchStatement);\n\n            protected abstract bool HasDefaultLabel(TSwitchStatement switchStatement);\n\n            protected abstract bool AreEquivalent(TSwitchSection section1, TSwitchSection section2);\n\n            protected abstract Location GetLocation(TSwitchStatement switchStatement);\n\n            public Action<SonarSyntaxNodeReportingContext> GetAnalysisAction(DiagnosticDescriptor rule) =>\n                context =>\n                {\n                    var switchStatement = (TSwitchStatement)context.Node;\n\n                    var sections = GetSections(switchStatement).ToList();\n\n                    if (sections.Count >= 2 &&\n                        HasDefaultLabel(switchStatement) &&\n                        sections.Skip(1).All(section => AreEquivalent(section, sections[0])))\n                    {\n                        context.ReportIssue(rule, GetLocation(switchStatement), StatementsMessage);\n                    }\n                };\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/AlwaysSetDateTimeKindBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class AlwaysSetDateTimeKindBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n{\n    private const string DiagnosticId = \"S6562\";\n\n    protected abstract TSyntaxKind ObjectCreationExpression { get; }\n    protected abstract string[] ValidNames { get; }\n\n    protected override string MessageFormat => \"Provide the \\\"DateTimeKind\\\" when creating this object.\";\n\n    protected AlwaysSetDateTimeKindBase() : base(DiagnosticId) { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(Language.GeneratedCodeRecognizer, c =>\n        {\n            if (Language.Syntax.ObjectCreationTypeIdentifier(c.Node) is { IsMissing: false } identifier\n                && Array.Exists(ValidNames, x => x.Equals(identifier.ValueText, Language.NameComparison))\n                && IsDateTimeConstructorWithoutKindParameter(c.Node, c.Model))\n            {\n                c.ReportIssue(Rule, c.Node);\n            }\n        },\n        ObjectCreationExpression);\n\n    protected static bool IsDateTimeConstructorWithoutKindParameter(SyntaxNode objectCreation, SemanticModel semanticModel) =>\n        semanticModel.GetSymbolInfo(objectCreation).Symbol is IMethodSymbol ctor\n        && ctor.IsInType(KnownType.System_DateTime)\n        && !ctor.Parameters.Any(x => x.IsType(KnownType.System_DateTimeKind));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/ArrayPassedAsParamsBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class ArrayPassedAsParamsBase<TSyntaxKind, TArgumentNode> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n    where TArgumentNode : SyntaxNode\n{\n    private const string DiagnosticId = \"S3878\";\n\n    protected abstract TSyntaxKind[] ExpressionKinds { get; }\n    protected abstract TArgumentNode LastArgumentIfArrayCreation(SyntaxNode expression);\n    protected abstract ITypeSymbol ArrayElementType(TArgumentNode argument, SemanticModel model);\n\n    protected override string MessageFormat => \"Remove this array creation and simply pass the elements.\";\n\n    protected ArrayPassedAsParamsBase() : base(DiagnosticId) {}\n\n    protected sealed override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(Language.GeneratedCodeRecognizer, c =>\n        {\n            if (LastArgumentIfArrayCreation(c.Node) is { } lastArgument\n                && c.Model.GetSymbolInfo(c.Node).Symbol is IMethodSymbol methodSymbol\n                && Language.MethodParameterLookup(c.Node, methodSymbol) is { } parameterLookup\n                && parameterLookup.TryGetSymbol(lastArgument, out var param)\n                && param is { IsParams: true }\n                && !IsArrayOfCandidateTypes(lastArgument, parameterLookup, param, c.Model)\n                && !IsJaggedArrayParam(param))\n            {\n                c.ReportIssue(Rule, lastArgument.GetLocation());\n            }\n        }, ExpressionKinds);\n\n    private static bool IsJaggedArrayParam(IParameterSymbol param) =>\n        param.Type is IArrayTypeSymbol { ElementType: IArrayTypeSymbol };\n\n    private bool IsArrayOfCandidateTypes(TArgumentNode lastArgument, IMethodParameterLookup parameterLookup, IParameterSymbol param, SemanticModel model)\n    {\n        return param.Type is IArrayTypeSymbol array\n            && (array.ElementType.Is(KnownType.System_Array)\n               || (array.ElementType.Is(KnownType.System_Object) && !ParamArgumentsAreReferenceTypeArrays(lastArgument, parameterLookup, model)));\n\n        bool ParamArgumentsAreReferenceTypeArrays(TArgumentNode lastArgument, IMethodParameterLookup parameterLookup, SemanticModel model) =>\n            ArrayElementType(lastArgument, model) is { IsReferenceType: true } elementType\n            && !elementType.Is(KnownType.System_Object)\n            && parameterLookup.TryGetSyntax(param, out var arguments)\n            && arguments.Length is 1;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/AspNet/BackslashShouldBeAvoidedInAspNetRoutesBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class BackslashShouldBeAvoidedInAspNetRoutesBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n{\n    private const string DiagnosticId = \"S6930\";\n\n    protected abstract TSyntaxKind[] SyntaxKinds { get; }\n    protected abstract bool IsNamedAttributeArgument(SyntaxNode node);\n\n    protected override string MessageFormat => @\"Replace '\\' with '/'.\";\n\n    protected BackslashShouldBeAvoidedInAspNetRoutesBase() : base(DiagnosticId) { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(compilationStartContext =>\n        {\n            if (compilationStartContext.Compilation.ReferencesNetCoreControllers()\n                || compilationStartContext.Compilation.ReferencesNetFrameworkControllers())\n            {\n                compilationStartContext.RegisterNodeAction(Language.GeneratedCodeRecognizer, Check, SyntaxKinds);\n            }\n        });\n\n    protected void Check(SonarSyntaxNodeReportingContext c)\n    {\n        if (!IsNamedAttributeArgument(c.Node)\n            && Language.Syntax.NodeExpression(c.Node) is { } expression\n            && Language.FindConstantValue(c.Model, expression) is string constantRouteTemplate\n            && ContainsBackslash(constantRouteTemplate)\n            && IsRouteTemplate(c.Model, c.Node))\n        {\n            c.ReportIssue(Rule, expression);\n        }\n    }\n\n    private bool IsRouteTemplate(SemanticModel model, SyntaxNode node) =>\n        node.Parent.Parent is var invocation // can be a method invocation or a tuple expression\n        && model.GetSymbolInfo(invocation).Symbol is IMethodSymbol methodSymbol\n        && Language.MethodParameterLookup(invocation, methodSymbol) is { } parameterLookup\n        && parameterLookup.TryGetSymbol(node, out var parameter)\n        && (HasStringSyntaxAttributeOfTypeRoute(parameter) || IsRouteTemplateBeforeAspNet6(parameter, methodSymbol));\n\n    private static bool HasStringSyntaxAttributeOfTypeRoute(IParameterSymbol parameter) =>\n        parameter.GetAttributes(KnownType.System_Diagnostics_CodeAnalysis_StringSyntaxAttribute).FirstOrDefault() is { } syntaxAttribute\n        && syntaxAttribute.TryGetAttributeValue<string>(\"syntax\", out var syntaxParameter)\n        && string.Equals(syntaxParameter, \"Route\", StringComparison.Ordinal);\n\n    private static bool IsRouteTemplateBeforeAspNet6(IParameterSymbol parameter, IMethodSymbol method) =>\n        // Remark: route templates cannot be specified via HttpXAttribute in ASP.NET 4.x\n        (method.ContainingType.IsAny(KnownType.RouteAttributes)\n            || method.ContainingType.DerivesFrom(KnownType.Microsoft_AspNetCore_Mvc_Routing_HttpMethodAttribute))\n        && method.IsConstructor() && parameter.Name == \"template\";\n\n    private static bool ContainsBackslash(string value)\n    {\n        var firstBackslashIndex = value.IndexOf('\\\\');\n        if (firstBackslashIndex < 0)\n        {\n            return false;\n        }\n\n        var firstRegexIndex = value.IndexOf(\"regex\", StringComparison.Ordinal);\n        return firstRegexIndex < 0 || firstBackslashIndex < firstRegexIndex;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/AspNet/RouteTemplateShouldNotStartWithSlashBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Collections.Concurrent;\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class RouteTemplateShouldNotStartWithSlashBase<TSyntaxKind>() : SonarDiagnosticAnalyzer<TSyntaxKind>(DiagnosticId)\n    where TSyntaxKind : struct\n{\n    private const string DiagnosticId = \"S6931\";\n    private const string MessageOnlyActions = \"Change the paths of the actions of this controller to be relative and adapt the controller route accordingly.\";\n    private const string MessageActionsAndController = \"Change the paths of the actions of this controller to be relative and add a controller route with the common prefix.\";\n    private const string SecondaryMessageOnlyActions = \"Change this path to be relative to the controller route defined on class level.\";\n    private const string SecondaryMessageActionsAndController = \"Add a controller route with a common prefix and change this path to be relative it.\";\n\n    protected override string MessageFormat => \"{0}\";\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(compilationStartContext =>\n        {\n            if (!compilationStartContext.Compilation.ReferencesNetCoreControllers()\n                && !compilationStartContext.Compilation.ReferencesNetFrameworkControllers())\n            {\n                return;\n            }\n\n            compilationStartContext.RegisterSymbolStartAction(symbolStartContext =>\n            {\n                var symbol = (INamedTypeSymbol)symbolStartContext.Symbol;\n                if (symbol.IsControllerType())\n                {\n                    var controllerActionInfo = new ConcurrentStack<ActionParametersInfo>();\n                    symbolStartContext.RegisterSyntaxNodeAction(nodeContext =>\n                    {\n                        if (nodeContext.Model.GetDeclaredSymbol(nodeContext.Node) is IMethodSymbol methodSymbol && methodSymbol.IsControllerActionMethod())\n                        {\n                            controllerActionInfo.Push(new ActionParametersInfo(RouteAttributeTemplateArguments(methodSymbol.GetAttributes())));\n                        }\n                    }, Language.SyntaxKind.MethodDeclarations);\n\n                    symbolStartContext.RegisterSymbolEndAction(symbolEndContext =>\n                        ReportIssues(symbolEndContext, symbol, controllerActionInfo));\n                }\n            }, SymbolKind.NamedType);\n        });\n\n    private void ReportIssues(SonarSymbolReportingContext context, INamedTypeSymbol controllerSymbol, ConcurrentStack<ActionParametersInfo> actions)\n    {\n        // If one of the following conditions is true, the rule won't raise an issue\n        // 1. The controller does not have any actions defined\n        // 2. At least one action is not annotated with a route attribute or is annotated with a parameterless attribute\n        // 3. There is at least one action with a route template that does not start with '/'\n        if (!actions.Any() || actions.Any(x => !x.RouteParameters.Any() || x.RouteParameters.Values.Any(x => !x.StartsWith(\"/\") && !x.StartsWith(\"~/\"))))\n        {\n            return;\n        }\n\n        var issueMessage = controllerSymbol.GetAttributes().Any(x => x.AttributeClass.IsAny(KnownType.RouteAttributes) || x.AttributeClass.Is(KnownType.System_Web_Mvc_RoutePrefixAttribute))\n            ? MessageOnlyActions\n            : MessageActionsAndController;\n\n        var secondaryIssueMessage = issueMessage == MessageOnlyActions\n            ? SecondaryMessageOnlyActions\n            : SecondaryMessageActionsAndController;\n\n        var secondaryLocations = actions.SelectMany(x => x.RouteParameters.Keys.ToSecondary(secondaryIssueMessage));\n        foreach (var identifier in controllerSymbol.DeclaringSyntaxReferences.Select(x => Language.Syntax.NodeIdentifier(x.GetSyntax())).WhereNotNull())\n        {\n            context.ReportIssue(Language.GeneratedCodeRecognizer, Rule, identifier.GetLocation(), secondaryLocations, issueMessage);\n        }\n    }\n\n    private static Dictionary<Location, string> RouteAttributeTemplateArguments(ImmutableArray<AttributeData> attributes)\n    {\n        var templates = new Dictionary<Location, string>();\n        foreach (var attribute in attributes)\n        {\n            if (attribute.GetAttributeRouteTemplate() is { } templateParameter)\n            {\n                templates.Add(attribute.ApplicationSyntaxReference.GetSyntax().GetLocation(), templateParameter);\n            }\n        }\n        return templates;\n    }\n\n    private readonly record struct ActionParametersInfo(Dictionary<Location, string> RouteParameters);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/AvoidDateTimeNowForBenchmarkingBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class AvoidDateTimeNowForBenchmarkingBase<TMemberAccess, TInvocationExpression, TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TMemberAccess : SyntaxNode\n    where TInvocationExpression : SyntaxNode\n    where TSyntaxKind : struct\n{\n    private const string DiagnosticId = \"S6561\";\n    protected override string MessageFormat => \"Avoid using \\\"DateTime.Now\\\" for benchmarking or timespan calculation operations.\";\n\n    protected abstract bool ContainsDateTimeArgument(TInvocationExpression invocation, SemanticModel model);\n\n    protected AvoidDateTimeNowForBenchmarkingBase() : base(DiagnosticId) { }\n\n    protected sealed override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(Language.GeneratedCodeRecognizer, CheckBinaryExpression, Language.SyntaxKind.SubtractExpression);\n        context.RegisterNodeAction(Language.GeneratedCodeRecognizer, CheckInvocation, Language.SyntaxKind.InvocationExpression);\n    }\n\n    private void CheckBinaryExpression(SonarSyntaxNodeReportingContext context)\n    {\n        if (Language.Syntax.BinaryExpressionLeft(context.Node) is TMemberAccess memberAccess\n            && IsDateTimeNow(memberAccess, context.Model)\n            && Language.Syntax.BinaryExpressionRight(context.Node) is var right\n            && context.Model.GetTypeInfo(right).Type.Is(KnownType.System_DateTime))\n        {\n            context.ReportIssue(Rule, context.Node);\n        }\n    }\n\n    private void CheckInvocation(SonarSyntaxNodeReportingContext context)\n    {\n        var invocation = (TInvocationExpression)context.Node;\n\n        if (Language.Syntax.NodeExpression(invocation) is TMemberAccess subtract\n            && Language.Syntax.NodeExpression(subtract) is TMemberAccess now\n            && Language.Syntax.IsMemberAccessOnKnownType(subtract, \"Subtract\", KnownType.System_DateTime, context.Model)\n            && IsDateTimeNow(now, context.Model)\n            && Language.Syntax.HasExactlyNArguments(invocation, 1)\n            && ContainsDateTimeArgument(invocation, context.Model))\n        {\n            context.ReportIssue(Rule, subtract);\n        }\n    }\n\n    private bool IsDateTimeNow(TMemberAccess node, SemanticModel model) =>\n        Language.Syntax.IsMemberAccessOnKnownType(node, \"Now\", KnownType.System_DateTime, model);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/AvoidUnsealedAttributesBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class AvoidUnsealedAttributesBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n{\n    private const string DiagnosticId = \"S4060\";\n\n    protected override string MessageFormat => \"Seal this attribute or make it abstract.\";\n\n    protected AvoidUnsealedAttributesBase() : base(DiagnosticId) { }\n\n    protected sealed override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            Language.GeneratedCodeRecognizer,\n            c =>\n            {\n                if (Language.Syntax.NodeIdentifier(c.Node) is { IsMissing: false } identifier\n                    && c.Model.GetDeclaredSymbol(c.Node) is INamedTypeSymbol { IsAbstract: false, IsSealed: false } symbol\n                    && symbol.DerivesFrom(KnownType.System_Attribute)\n                    && symbol.IsPubliclyAccessible())\n                {\n                    c.ReportIssue(Rule, identifier);\n                }\n            },\n            Language.SyntaxKind.ClassDeclaration);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/BeginInvokePairedWithEndInvokeBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class BeginInvokePairedWithEndInvokeBase<TSyntaxKind, TInvocationExpressionSyntax> : SonarDiagnosticAnalyzer<TSyntaxKind>\n        where TSyntaxKind : struct\n        where TInvocationExpressionSyntax : SyntaxNode\n    {\n        protected const string DiagnosticId = \"S4583\";\n        protected const string EndInvoke = \"EndInvoke\";\n        private const string BeginInvoke = \"BeginInvoke\";\n\n        protected abstract TSyntaxKind InvocationExpressionKind { get; }\n        protected abstract ISet<TSyntaxKind> ParentDeclarationKinds { get; }\n        protected abstract string CallbackParameterName { get; }\n        protected abstract void VisitInvocation(EndInvokeContext context);\n\n        protected override string MessageFormat => \"Pair this \\\"BeginInvoke\\\" with an \\\"EndInvoke\\\".\";\n\n        /// <returns>\n        /// - true if callback code has been resolved and does not contain \"EndInvoke\".\n        /// - false if callback code contains \"EndInvoke\" or callback code has not been resolved.\n        /// </returns>\n        protected abstract bool IsInvalidCallback(SyntaxNode callbackArg, SemanticModel semanticModel);\n\n        protected BeginInvokePairedWithEndInvokeBase() : base(DiagnosticId) { }\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(Language.GeneratedCodeRecognizer, c =>\n            {\n                var invocation = (TInvocationExpressionSyntax)c.Node;\n                if (Language.Syntax.NodeExpression(invocation) is { } expression\n                    && expression.ToStringContains(BeginInvoke)\n                    && c.Model.GetSymbolInfo(invocation).Symbol is IMethodSymbol methodSymbol\n                    && methodSymbol.Name == BeginInvoke\n                    && IsDelegate(methodSymbol)\n                    && methodSymbol.Parameters.SingleOrDefault(x => x.Name == CallbackParameterName) is { } parameter\n                    && Language.MethodParameterLookup(invocation, methodSymbol).TryGetNonParamsSyntax(parameter, out var callbackArg)\n                    && IsInvalidCallback(callbackArg, c.Model)\n                    && !ParentMethodContainsEndInvoke(invocation, c.Model))\n                {\n                    c.ReportIssue(Rule, Language.Syntax.InvocationIdentifier(invocation).Value);\n                }\n            }, InvocationExpressionKind);\n\n        protected static bool IsDelegate(IMethodSymbol methodSymbol) =>\n            methodSymbol.ReceiverType.Is(TypeKind.Delegate);\n\n        protected bool IsParentDeclarationWithEndInvoke(SyntaxNode node, SemanticModel semanticModel)\n        {\n            if (IsParentDeclaration(node))\n            {\n                var context = new EndInvokeContext(this, semanticModel, node);\n                VisitInvocation(context);\n                return context.ContainsEndInvoke;\n            }\n            else\n            {\n                return false;\n            }\n        }\n\n        private bool ParentMethodContainsEndInvoke(SyntaxNode node, SemanticModel model) =>\n            node.AncestorsAndSelf().FirstOrDefault(IsParentDeclaration) is { } parentContext\n               && IsParentDeclarationWithEndInvoke(parentContext, model);\n\n        private bool IsParentDeclaration(SyntaxNode node)\n            => node is not null && ParentDeclarationKinds.Contains(Language.Syntax.Kind(node));\n\n        protected class EndInvokeContext\n        {\n            private readonly BeginInvokePairedWithEndInvokeBase<TSyntaxKind, TInvocationExpressionSyntax> rule;\n            private readonly SemanticModel semanticModel;\n\n            public SyntaxNode Root { get; }\n            public bool ContainsEndInvoke { get; private set; }\n\n            public EndInvokeContext(BeginInvokePairedWithEndInvokeBase<TSyntaxKind, TInvocationExpressionSyntax> rule, SemanticModel semanticModel, SyntaxNode root)\n            {\n                this.rule = rule;\n                this.semanticModel = semanticModel;\n                Root = root;\n            }\n\n            public bool Visit(SyntaxNode node) =>\n                !ContainsEndInvoke;  // Stop visiting once we found it\n\n            public bool VisitInvocationExpression(SyntaxNode node)\n            {\n                if (rule.Language.Syntax.NodeExpression(node).ToStringContains(EndInvoke)\n                    && semanticModel.GetSymbolInfo(node).Symbol is IMethodSymbol methodSymbol\n                    && methodSymbol.Name == EndInvoke\n                    && IsDelegate(methodSymbol))\n                {\n                    ContainsEndInvoke = true;\n                    return false;   // Stop visiting\n                }\n                return true;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/BinaryOperationWithIdenticalExpressionsBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class BinaryOperationWithIdenticalExpressionsBase : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S1764\";\n\n        protected const string OperatorMessageFormat = \"Correct one of the identical expressions on both sides of operator '{0}'.\";\n        protected const string EqualsMessage = \"Change one instance of '{0}' to a different value; comparing '{0}' to itself always returns true.\";\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/BooleanCheckInvertedBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class BooleanCheckInvertedBase<TBinaryExpression> : SonarDiagnosticAnalyzer where TBinaryExpression : SyntaxNode\n{\n    internal const string DiagnosticId = \"S1940\";\n    protected const string MessageFormat = \"Use the opposite operator ('{0}') instead.\";\n\n    protected abstract SyntaxNode LogicalNotNode(TBinaryExpression expression);\n\n    protected abstract string SuggestedReplacement(TBinaryExpression expression);\n\n    protected abstract bool IsUnsafeInversionOperation(TBinaryExpression expression, SemanticModel model);\n\n    protected Action<SonarSyntaxNodeReportingContext> AnalysisAction(DiagnosticDescriptor rule) =>\n        c =>\n        {\n            var expression = (TBinaryExpression)c.Node;\n\n            if (IsUserDefinedOperator(expression, c.Model) || IsUnsafeInversionOperation(expression, c.Model))\n            {\n                return;\n            }\n\n            if (LogicalNotNode(expression) is { } logicalNot)\n            {\n                c.ReportIssue(rule, logicalNot, SuggestedReplacement(expression));\n            }\n        };\n\n    protected static bool IsNullable(SyntaxNode expression, SemanticModel model) =>\n        model.GetSymbolInfo(expression).Symbol.GetSymbolType() is INamedTypeSymbol symbolType\n        && symbolType.ConstructedFrom.Is(KnownType.System_Nullable_T);\n\n    protected static bool IsFloatingPoint(SyntaxNode expression, SemanticModel model) =>\n        model.GetTypeInfo(expression).Type.IsAny(KnownType.FloatingPointNumbers);\n\n    private static bool IsUserDefinedOperator(TBinaryExpression expression, SemanticModel model) =>\n        model.GetEnclosingSymbol(expression.SpanStart) is IMethodSymbol enclosingSymbol\n        && enclosingSymbol.MethodKind == MethodKind.UserDefinedOperator;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/BooleanLiteralUnnecessaryBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class BooleanLiteralUnnecessaryBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n        where TSyntaxKind : struct\n    {\n        internal const string DiagnosticId = \"S1125\";\n\n        private ImmutableArray<INamedTypeSymbol> systemBooleanInterfaces;\n\n        protected enum ErrorLocation\n        {\n            // The BooleanLiteral node is highlighted\n            BoolLiteral,\n\n            // The BooleanLiteral node and the operator are highlighted together\n            BoolLiteralAndOperator,\n\n            // Inside a binary expression, the expression that is not a boolean literal is highlighted\n            // e.g. for 'foo() && True', 'foo()' will be highlighted\n            NonBoolLiteralExpression\n        }\n\n        protected delegate bool IsBooleanLiteralKind(SyntaxNode node);\n\n        protected abstract SyntaxNode GetLeftNode(SyntaxNode node);\n        protected abstract SyntaxNode GetRightNode(SyntaxNode node);\n        protected abstract SyntaxToken? GetOperatorToken(SyntaxNode node);\n        protected abstract bool IsTrue(SyntaxNode syntaxNode);\n        protected abstract bool IsFalse(SyntaxNode syntaxNode);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterCompilationStartAction(x =>\n            {\n                systemBooleanInterfaces = x.Compilation.GetTypeByMetadataName(KnownType.System_Boolean).Interfaces;\n            });\n\n        // For C# 7 syntax\n        protected virtual bool IsInsideTernaryWithThrowExpression(SyntaxNode syntaxNode) => false;\n\n        protected override string MessageFormat => \"Remove the unnecessary Boolean literal(s).\";\n\n        protected BooleanLiteralUnnecessaryBase() : base(DiagnosticId) { }\n\n        // LogicalAnd (C#) / AndAlso (VB)\n        protected void CheckAndExpression(SonarSyntaxNodeReportingContext context)\n        {\n            if (IsInsideTernaryWithThrowExpression(context.Node) || CheckForNullabilityAndBooleanConstantsReport(context, context.Node, reportOnTrue: true))\n            {\n                return;\n            }\n\n            // When we have 'EXPR And True', the true literal is the redundant part\n            CheckForBooleanConstantOnLeft(context, context.Node, IsTrue, ErrorLocation.BoolLiteralAndOperator);\n            CheckForBooleanConstantOnRight(context, context.Node, IsTrue, ErrorLocation.BoolLiteralAndOperator);\n\n            // 'EXPR And False' is always False, thus EXPR is the redundant part\n            CheckForBooleanConstantOnLeft(context, context.Node, IsFalse, ErrorLocation.NonBoolLiteralExpression);\n            CheckForBooleanConstantOnRight(context, context.Node, IsFalse, ErrorLocation.NonBoolLiteralExpression);\n        }\n\n        // LogicalOr (C#) / OrElse (VB)\n        protected void CheckOrExpression(SonarSyntaxNodeReportingContext context)\n        {\n            if (IsInsideTernaryWithThrowExpression(context.Node) || CheckForNullabilityAndBooleanConstantsReport(context, context.Node, reportOnTrue: false))\n            {\n                return;\n            }\n\n            // When we have 'EXPR Or False', the false literal is the redundant part\n            CheckForBooleanConstantOnLeft(context, context.Node, IsFalse, ErrorLocation.BoolLiteralAndOperator);\n            CheckForBooleanConstantOnRight(context, context.Node, IsFalse, ErrorLocation.BoolLiteralAndOperator);\n\n            // 'EXPR Or True' is always True, thus EXPR is the redundant part\n            CheckForBooleanConstantOnLeft(context, context.Node, IsTrue, ErrorLocation.NonBoolLiteralExpression);\n            CheckForBooleanConstantOnRight(context, context.Node, IsTrue, ErrorLocation.NonBoolLiteralExpression);\n        }\n\n        protected void CheckEquals(SonarSyntaxNodeReportingContext context)\n        {\n            if (IsInsideTernaryWithThrowExpression(context.Node) || CheckForNullabilityAndBooleanConstantsReport(context, context.Node, reportOnTrue: true))\n            {\n                return;\n            }\n\n            CheckForBooleanConstantOnLeft(context, context.Node, IsTrue, ErrorLocation.BoolLiteralAndOperator);\n            CheckForBooleanConstantOnLeft(context, context.Node, IsFalse, ErrorLocation.BoolLiteralAndOperator);\n\n            CheckForBooleanConstantOnRight(context, context.Node, IsTrue, ErrorLocation.BoolLiteralAndOperator);\n            CheckForBooleanConstantOnRight(context, context.Node, IsFalse, ErrorLocation.BoolLiteralAndOperator);\n        }\n\n        protected void CheckNotEquals(SonarSyntaxNodeReportingContext context)\n        {\n            if (IsInsideTernaryWithThrowExpression(context.Node) || CheckForNullabilityAndBooleanConstantsReport(context, context.Node, reportOnTrue: false))\n            {\n                return;\n            }\n\n            CheckForBooleanConstantOnLeft(context, context.Node, IsFalse, ErrorLocation.BoolLiteralAndOperator);\n            CheckForBooleanConstantOnLeft(context, context.Node, IsTrue, ErrorLocation.BoolLiteral);\n\n            CheckForBooleanConstantOnRight(context, context.Node, IsFalse, ErrorLocation.BoolLiteralAndOperator);\n            CheckForBooleanConstantOnRight(context, context.Node, IsTrue, ErrorLocation.BoolLiteral);\n        }\n\n        protected void CheckTernaryExpressionBranches(SonarSyntaxNodeReportingContext context, SyntaxNode thenBranch, SyntaxNode elseBranch)\n        {\n            var thenNoParantheses = Language.Syntax.RemoveParentheses(thenBranch);\n            var elseNoParantheses = Language.Syntax.RemoveParentheses(elseBranch);\n\n            var thenIsBooleanLiteral = IsTrue(thenNoParantheses) || IsFalse(thenNoParantheses);\n            var elseIsBooleanLiteral = IsTrue(elseNoParantheses) || IsFalse(elseNoParantheses);\n\n            var bothSideBool = thenIsBooleanLiteral && elseIsBooleanLiteral;\n            var bothSideTrue = IsTrue(thenNoParantheses) && IsTrue(elseNoParantheses);\n            var bothSideFalse = IsFalse(thenNoParantheses) && IsFalse(elseNoParantheses);\n\n            if (bothSideBool && !bothSideFalse && !bothSideTrue)\n            {\n                context.ReportIssue(SupportedDiagnostics[0], thenBranch.CreateLocation(elseBranch));\n            }\n            if (thenIsBooleanLiteral ^ elseIsBooleanLiteral)\n            {\n                // one side is boolean literal, the other is NOT boolean literal\n                var booleanLiteralSide = thenIsBooleanLiteral ? thenBranch : elseBranch;\n\n                context.ReportIssue(SupportedDiagnostics[0], booleanLiteralSide);\n            }\n        }\n\n        protected bool CheckForNullabilityAndBooleanConstantsReport(SonarSyntaxNodeReportingContext context, SyntaxNode node, bool reportOnTrue)\n        {\n            var left = Language.Syntax.RemoveParentheses(GetLeftNode(node));\n            var right = Language.Syntax.RemoveParentheses(GetRightNode(node));\n\n            if (right is null // Avoids DeclarationPattern or RecursivePattern\n                || TypeShouldBeIgnored(left, context.Model)\n                || TypeShouldBeIgnored(right, context.Model))\n            {\n                return true;\n            }\n\n            var leftIsTrue = IsTrue(left);\n            var leftIsFalse = IsFalse(left);\n            var rightIsTrue = IsTrue(right);\n            var rightIsFalse = IsFalse(right);\n\n            if ((leftIsTrue || leftIsFalse) && (rightIsTrue || rightIsFalse))\n            {\n                var bothAreSame = (leftIsTrue && rightIsTrue) || (leftIsFalse && rightIsFalse);\n                var errorLocation = bothAreSame\n                    ? CalculateExtendedLocation(node, false)\n                    : CalculateExtendedLocation(node, reportOnTrue == leftIsTrue);\n\n                context.ReportIssue(SupportedDiagnostics[0], errorLocation);\n                return true;\n            }\n            return false;\n        }\n\n        protected void CheckForBooleanConstant(SonarSyntaxNodeReportingContext context,\n                                             SyntaxNode node,\n                                             IsBooleanLiteralKind isBooleanLiteralKind,\n                                             ErrorLocation errorLocation,\n                                             bool isLeftSide)\n        {\n            if (isBooleanLiteralKind(node) && GetLocation() is { } location)\n            {\n                context.ReportIssue(SupportedDiagnostics[0], location);\n            }\n\n            Location GetLocation() =>\n                errorLocation switch\n                {\n                    ErrorLocation.BoolLiteral => node.GetLocation(),\n                    ErrorLocation.BoolLiteralAndOperator => CalculateExtendedLocation(node.Parent, isLeftSide),\n                    ErrorLocation.NonBoolLiteralExpression => CalculateExtendedLocation(node.Parent, !isLeftSide),\n                    _ => null,\n                };\n        }\n\n        private void CheckForBooleanConstantOnLeft(SonarSyntaxNodeReportingContext context, SyntaxNode node, IsBooleanLiteralKind isBooleanLiteralKind, ErrorLocation errorLocation) =>\n            CheckForBooleanConstant(context, GetLeftNode(node), isBooleanLiteralKind, errorLocation, isLeftSide: true);\n\n        private void CheckForBooleanConstantOnRight(SonarSyntaxNodeReportingContext context, SyntaxNode node, IsBooleanLiteralKind isBooleanLiteralKind, ErrorLocation errorLocation) =>\n            CheckForBooleanConstant(context, GetRightNode(node), isBooleanLiteralKind, errorLocation, isLeftSide: false);\n\n        private Location CalculateExtendedLocation(SyntaxNode parent, bool isLeftSide)\n        {\n            if (GetOperatorToken(parent) is not { } token)\n            {\n                return null;\n            }\n\n            return isLeftSide ? parent.CreateLocation(token) : token.CreateLocation(parent);\n        }\n\n        private bool TypeShouldBeIgnored(SyntaxNode node, SemanticModel model)\n        {\n            var type = model.GetTypeInfo(node).Type;\n            return type.IsNullableBoolean()\n                || type is ITypeParameterSymbol\n                || type.Is(KnownType.System_Object)\n                || systemBooleanInterfaces.Any(x => x.Equals(type));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/BypassingAccessibilityBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class BypassingAccessibilityBase<TSyntaxKind> : TrackerHotspotDiagnosticAnalyzer<TSyntaxKind>\n        where TSyntaxKind : struct\n    {\n        protected const string DiagnosticId = \"S3011\";\n        protected const string MessageFormat = \"Make sure that this accessibility bypass is safe here.\";\n\n        protected BypassingAccessibilityBase(IAnalyzerConfiguration configuration)\n            : base(configuration, DiagnosticId, MessageFormat) { }\n\n        protected override void Initialize(TrackerInput input)\n        {\n            var t = Language.Tracker.FieldAccess;\n            t.Track(input,\n                t.WhenRead(),\n                t.MatchField(new MemberDescriptor(KnownType.System_Reflection_BindingFlags, \"NonPublic\")));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/CatchRethrowBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class CatchRethrowBase<TSyntaxKind, TCatchClause> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n    where TCatchClause : SyntaxNode\n{\n    internal const string DiagnosticId = \"S2737\";\n\n    protected abstract TCatchClause[] AllCatches(SyntaxNode node);\n    protected abstract SyntaxNode DeclarationType(TCatchClause catchClause);\n    protected abstract bool HasFilter(TCatchClause catchClause);\n    protected abstract bool ContainsOnlyThrow(TCatchClause currentCatch);\n\n    protected override string MessageFormat => \"Add logic to this catch clause or eliminate it and rethrow the exception automatically.\";\n\n    protected CatchRethrowBase() : base(DiagnosticId) { }\n\n    protected void RaiseOnInvalidCatch(SonarSyntaxNodeReportingContext context)\n    {\n        var catches = AllCatches(context.Node);\n        var caughtExceptionTypes = new Lazy<INamedTypeSymbol[]>(() => ComputeExceptionTypes(catches, context.Model));\n        var redundantCatches = new HashSet<TCatchClause>();\n        // We handle differently redundant catch clauses (just throw inside) that are followed by a non-redundant catch clause, because if they are removed, the method behavior will change.\n        var followingCatchesOnlyThrow = true;\n\n        for (var i = catches.Length - 1; i >= 0; i--)\n        {\n            var currentCatch = catches[i];\n            if (ContainsOnlyThrow(currentCatch))\n            {\n                if (!HasFilter(currentCatch)\n                    // Make sure we report only catch clauses that will not change the method behavior if removed.\n                    && (followingCatchesOnlyThrow || IsRedundantToFollowingCatches(i, catches, caughtExceptionTypes.Value, redundantCatches)))\n                {\n                    redundantCatches.Add(currentCatch);\n                }\n            }\n            else\n            {\n                followingCatchesOnlyThrow = false;\n            }\n        }\n\n        foreach (var redundantCatch in redundantCatches)\n        {\n            context.ReportIssue(Rule, redundantCatch);\n        }\n    }\n\n    private static bool IsRedundantToFollowingCatches(int catchIndex, TCatchClause[] catches, INamedTypeSymbol[] caughtExceptionTypes, ISet<TCatchClause> redundantCatches)\n    {\n        var currentType = caughtExceptionTypes[catchIndex];\n        for (var i = catchIndex + 1; i < caughtExceptionTypes.Length; i++)\n        {\n            var nextCatchType = caughtExceptionTypes[i];\n            if (nextCatchType is null || currentType.DerivesOrImplements(nextCatchType))\n            {\n                return redundantCatches.Contains(catches[i]);\n            }\n        }\n        return true;\n    }\n\n    private INamedTypeSymbol[] ComputeExceptionTypes(IEnumerable<TCatchClause> catches, SemanticModel model) =>\n        catches.Select(x => DeclarationType(x) is { } declarationType ? model.GetTypeInfo(declarationType).Type as INamedTypeSymbol : null).ToArray();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/CertificateValidationCheckBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class CertificateValidationCheckBase<\n    TSyntaxKind,\n    TArgumentSyntax,\n    TExpressionSyntax,\n    TIdentifierNameSyntax,\n    TAssignmentExpressionSyntax,\n    TInvocationExpressionSyntax,\n    TParameterSyntax,\n    TVariableSyntax,\n    TLambdaSyntax,\n    TMemberAccessSyntax\n    > : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n    where TArgumentSyntax : SyntaxNode\n    where TExpressionSyntax : SyntaxNode\n    where TIdentifierNameSyntax : SyntaxNode\n    where TAssignmentExpressionSyntax : SyntaxNode\n    where TInvocationExpressionSyntax : SyntaxNode\n    where TParameterSyntax : SyntaxNode\n    where TVariableSyntax : SyntaxNode\n    where TLambdaSyntax : SyntaxNode\n    where TMemberAccessSyntax : SyntaxNode\n{\n    private const string SecondaryMessage = \"This function trusts all certificates.\";\n    private const string DiagnosticId = \"S4830\";\n\n    internal /* for testing */ abstract MethodParameterLookupBase<TArgumentSyntax> CreateParameterLookup(SyntaxNode argumentListNode, IMethodSymbol method);\n    protected abstract HashSet<TSyntaxKind> MethodDeclarationKinds { get; }\n    protected abstract HashSet<TSyntaxKind> TypeDeclarationKinds { get; }\n    protected abstract Location ExpressionLocation(SyntaxNode expression);\n    protected abstract void SplitAssignment(TAssignmentExpressionSyntax assignment, out TIdentifierNameSyntax leftIdentifier, out TExpressionSyntax right);\n    protected abstract IEqualityComparer<TExpressionSyntax> CreateNodeEqualityComparer();\n    protected abstract TExpressionSyntax[] FindReturnAndThrowExpressions(InspectionContext c, SyntaxNode block);\n    protected abstract bool IsTrueLiteral(TExpressionSyntax expression);\n    protected abstract TExpressionSyntax VariableInitializer(TVariableSyntax variable);\n    protected abstract ImmutableArray<Location> LambdaLocations(InspectionContext c, TLambdaSyntax lambda);\n    protected abstract SyntaxNode LocalVariableScope(TVariableSyntax variable);\n    protected abstract SyntaxNode ExtractArgumentExpressionNode(SyntaxNode expression);\n    protected abstract SyntaxNode SyntaxFromReference(SyntaxReference reference);\n\n    protected override string MessageFormat => \"Enable server certificate validation on this SSL/TLS connection\";\n\n    protected CertificateValidationCheckBase() : base(DiagnosticId) { }\n\n    protected void CheckAssignmentSyntax(SonarSyntaxNodeReportingContext c)\n    {\n        SplitAssignment((TAssignmentExpressionSyntax)c.Node, out var leftIdentifier, out var right);\n        if (leftIdentifier is not null && right is not null\n            && c.Model.GetSymbolInfo(leftIdentifier).Symbol is IPropertySymbol left\n            && IsValidationDelegateType(left.Type))\n        {\n            TryReportLocations(new InspectionContext(c), leftIdentifier.GetLocation(), right);\n        }\n    }\n\n    protected void CheckConstructorParameterSyntax(SonarSyntaxNodeReportingContext c)\n    {\n        if (c.Model.GetSymbolInfo(c.Node).Symbol is IMethodSymbol ctor)\n        {\n            MethodParameterLookupBase<TArgumentSyntax> methodParamLookup = null;       // Cache, there might be more of them\n            // Validation for TryGetNonParamsSyntax, ParamArray/params and therefore array arguments are not inspected\n            foreach (var param in ctor.Parameters.Where(x => !x.IsParams && IsValidationDelegateType(x.Type)))\n            {\n                methodParamLookup ??= CreateParameterLookup(c.Node, ctor);\n                if (methodParamLookup.TryGetNonParamsSyntax(param, out var expression))\n                {\n                    TryReportLocations(new InspectionContext(c), ExpressionLocation(expression), expression);\n                }\n            }\n        }\n    }\n\n    protected ImmutableArray<Location> ParamLocations(InspectionContext c, TParameterSyntax param)\n    {\n        var containingMethodDeclaration = param.FirstAncestorOrSelf((SyntaxNode x) => Language.Syntax.IsAnyKind(x, MethodDeclarationKinds));\n        if (containingMethodDeclaration is null || !c.VisitedMethods.Add(containingMethodDeclaration))\n        {\n            return ImmutableArray<Location>.Empty;\n        }\n        // Validation for TryGetNonParamsSyntax, ParamArray/params and therefore array arguments are not inspected\n        var paramSymbol = containingMethodDeclaration.EnsureCorrectSemanticModelOrDefault(c.Context.Model)?.GetDeclaredSymbol(containingMethodDeclaration) is IMethodSymbol containingMethod\n                            && Language.Syntax.NodeIdentifier(param)?.ValueText is { } identText\n                                ? containingMethod.Parameters.Single(x => x.Name == identText)\n                                : null;\n        if (paramSymbol is null || paramSymbol.IsParams)\n        {\n            return ImmutableArray<Location>.Empty;\n        }\n        var methodSymbol = paramSymbol.ContainingSymbol as IMethodSymbol;\n        return FindInvocationList(c.Context, FindRootTypeDeclaration(param), methodSymbol)\n            .SelectMany(x => CreateParameterLookup(x, methodSymbol).TryGetNonParamsSyntax(paramSymbol, out var expr) && expr is not null\n                                ? CallStackSublocations(c, expr)\n                                : Enumerable.Empty<Location>())\n            .ToImmutableArray();\n    }\n\n    protected ImmutableArray<Location> BlockLocations(InspectionContext c, SyntaxNode block)\n    {\n        var ret = ImmutableArray.CreateBuilder<Location>();\n        if (block is not null)\n        {\n            var returnExpressions = FindReturnAndThrowExpressions(c, block);\n            // There must be at least one return, that does not return true to be compliant. There can be NULL from standalone Throw statement.\n            if (returnExpressions.All(IsTrueLiteral))\n            {\n                ret.AddRange(returnExpressions.Select(x => x.GetLocation()));\n            }\n        }\n        return ret.ToImmutable();\n    }\n\n    protected virtual SyntaxNode FindRootTypeDeclaration(SyntaxNode node)\n    {\n        SyntaxNode candidate;\n        var current = node.FirstAncestorOrSelf<SyntaxNode>(IsTypeDeclaration);\n        while (current is not null && (candidate = current.Parent.FirstAncestorOrSelf<SyntaxNode>(IsTypeDeclaration)) is not null)  // Search for parent of nested type\n        {\n            current = candidate;\n        }\n        return current;\n    }\n\n    private bool IsTypeDeclaration(SyntaxNode node) =>\n        Language.Syntax.IsAnyKind(node, TypeDeclarationKinds);\n\n    private void TryReportLocations(InspectionContext c, Location primaryLocation, SyntaxNode expression)\n    {\n        var locations = ArgumentLocations(c, expression);\n        if (!locations.IsEmpty)\n        {\n            // Report both, assignment as well as all implementation occurrences\n            c.Context.ReportIssue(Rule, primaryLocation, locations.ToSecondary(SecondaryMessage));\n        }\n    }\n\n    private static bool IsValidationDelegateType(ITypeSymbol type)\n    {\n        if (type.Is(KnownType.System_Net_Security_RemoteCertificateValidationCallback))\n        {\n            return true;\n        }\n        if (type is INamedTypeSymbol namedSymbol && type.OriginalDefinition.Is(KnownType.System_Func_T1_T2_T3_T4_TResult))\n        {\n            // HttpClientHandler.ServerCertificateCustomValidationCallback uses Func<HttpRequestMessage, X509Certificate2, X509Chain, SslPolicyErrors, bool>\n            // We're actually looking for Func<Any Sender, X509Certificate2, X509Chain, SslPolicyErrors, bool>\n            var parameters = namedSymbol.DelegateInvokeMethod.Parameters;\n            return parameters.Length == 4   // And it should! T1, T2, T3, T4\n                && parameters[0].Type.IsClassOrStruct() // We don't care about common (Object) nor specific (HttpRequestMessage) type of Sender\n                && parameters[1].Type.Is(KnownType.System_Security_Cryptography_X509Certificates_X509Certificate2)\n                && parameters[2].Type.Is(KnownType.System_Security_Cryptography_X509Certificates_X509Chain)\n                && parameters[3].Type.Is(KnownType.System_Net_Security_SslPolicyErrors)\n                && namedSymbol.DelegateInvokeMethod.ReturnType.Is(KnownType.System_Boolean);\n        }\n        return false;\n    }\n\n    private ImmutableArray<Location> ArgumentLocations(InspectionContext c, SyntaxNode expression)\n    {\n        switch (ExtractArgumentExpressionNode(expression))\n        {\n            case TIdentifierNameSyntax identifier:\n                if (SymbolFromCorrectModel(identifier, c.Context.Model) is { DeclaringSyntaxReferences.Length: 1 } identSymbol)\n                {\n                    return IdentifierLocations(c, SyntaxFromReference(identSymbol.DeclaringSyntaxReferences.Single()));\n                }\n                break;\n            case TLambdaSyntax lambda:\n                return LambdaLocations(c, lambda);\n            case TInvocationExpressionSyntax invocation:\n                return VisitInvocation(invocation, c);\n            case TMemberAccessSyntax memberAccess:\n                if (SymbolFromCorrectModel(memberAccess, c.Context.Model) is { } maSymbol\n                    && maSymbol.IsInType(KnownType.System_Net_Http_HttpClientHandler)\n                    && maSymbol.Name == \"DangerousAcceptAnyServerCertificateValidator\")\n                {\n                    return new[] { memberAccess.GetLocation() }.ToImmutableArray();\n                }\n                break;\n        }\n        return ImmutableArray<Location>.Empty;\n    }\n\n    private ImmutableArray<Location> VisitInvocation(TInvocationExpressionSyntax invocation, InspectionContext c)\n    {\n        if (SymbolFromCorrectModel(invocation, c.Context.Model) is IMethodSymbol invSymbol\n            && (invSymbol.PartialImplementationPart?.DeclaringSyntaxReferences ?? invSymbol.DeclaringSyntaxReferences).SingleOrDefault() is { } reference)\n        {\n            var syntax = SyntaxFromReference(reference);\n            c.VisitedMethods.Add(syntax);\n            return InvocationLocations(c, syntax);\n        }\n        return ImmutableArray<Location>.Empty;\n    }\n\n    private ImmutableArray<Location> IdentifierLocations(InspectionContext c, SyntaxNode syntax) =>\n        syntax switch\n        {\n            TParameterSyntax parameter => ParamLocations(c, parameter), // Value arrived as a parameter\n            TVariableSyntax variable => VariableLocations(c, variable), // Value passed as variable\n            _ => Language.Syntax.IsAnyKind(syntax, MethodDeclarationKinds)\n                ? BlockLocations(c, syntax)                             // Direct delegate name\n                : ImmutableArray<Location>.Empty,\n        };\n\n    private ImmutableArray<Location> VariableLocations(InspectionContext c, TVariableSyntax variable)\n    {\n        var allAssignedExpressions = new List<TExpressionSyntax>();\n        var parentScope = LocalVariableScope(variable);\n        if (parentScope is not null)\n        {\n            var identText = Language.Syntax.NodeIdentifier(variable)?.ValueText;\n            allAssignedExpressions.AddRange(parentScope.DescendantNodes().OfType<TAssignmentExpressionSyntax>()\n                .Select(x =>\n                    {\n                        SplitAssignment(x, out var leftIdentifier, out var right);\n                        return new { leftIdentifier, right };\n                    })\n                .Where(x => x.leftIdentifier is not null && Language.Syntax.NodeIdentifier(x.leftIdentifier) is { } identifier && identifier.ValueText == identText)\n                .Select(x => x.right));\n        }\n        var initializer = VariableInitializer(variable);\n        if (initializer is not null)       // Declarator initializer is counted as (default) assignment as well\n        {\n            allAssignedExpressions.Add(initializer);\n        }\n        return MultiExpressionSublocations(c, allAssignedExpressions);\n    }\n\n    private ImmutableArray<Location> InvocationLocations(InspectionContext c, SyntaxNode method)\n    {\n        // Ignore all return statements with recursive call. Result depends on returns that could return compliant validator.\n        var returnExpressionSublocationsList = FindReturnAndThrowExpressions(c, method).Where(x => !IsVisited(c, x));\n        return MultiExpressionSublocations(c, returnExpressionSublocationsList);\n    }\n\n    private bool IsVisited(InspectionContext c, SyntaxNode expression) =>\n        expression is TInvocationExpressionSyntax invocation\n        && SymbolFromCorrectModel(invocation, c.Context.Model) is { } symbol\n        && symbol.DeclaringSyntaxReferences.Select(SyntaxFromReference).Any(c.VisitedMethods.Contains);\n\n    private ImmutableArray<Location> MultiExpressionSublocations(InspectionContext c, IEnumerable<TExpressionSyntax> expressions)\n    {\n        var exprSublocationsList = expressions.Distinct(CreateNodeEqualityComparer())\n            .Select(x => CallStackSublocations(c, x))\n            .ToArray();\n        // If there's at least one concurrent expression, that returns compliant delegate, then there's some logic and this scope is compliant\n        if (exprSublocationsList.Any(x => x.IsEmpty))\n        {\n            return ImmutableArray<Location>.Empty;\n        }\n        return exprSublocationsList.SelectMany(x => x).ToImmutableArray();      // Else every return statement is noncompliant\n    }\n\n    private ImmutableArray<Location> CallStackSublocations(InspectionContext c, SyntaxNode expression)\n    {\n        var lst = ArgumentLocations(c, expression);\n        if (!lst.IsEmpty)        // There's noncompliant issue in this chain\n        {\n            var loc = expression.GetLocation();\n            if (!lst.Any(x => x.SourceSpan.IntersectsWith(loc.SourceSpan)))\n            {\n                // Add 2nd, 3rd, 4th etc //Secondary marker. If it is not marked already from direct Delegate name or direct Lambda occurrence\n                return lst.Concat([loc]).ToImmutableArray();\n            }\n        }\n        return lst;\n    }\n\n    private ImmutableArray<TInvocationExpressionSyntax> FindInvocationList(SonarSyntaxNodeReportingContext c, SyntaxNode root, IMethodSymbol method)\n    {\n        if (root is null || method is null)\n        {\n            return ImmutableArray<TInvocationExpressionSyntax>.Empty;\n        }\n        var ret = ImmutableArray.CreateBuilder<TInvocationExpressionSyntax>();\n        foreach (var invocation in root.DescendantNodesAndSelf().OfType<TInvocationExpressionSyntax>())\n        {\n            if (Language.Syntax.InvocationIdentifier(invocation) is { } invocationIdentifier\n                && invocationIdentifier.ValueText.Equals(method.Name, Language.NameComparison)\n                && SymbolFromCorrectModel(invocation, c.Model) is { } symbol\n                && symbol.Equals(method))\n            {\n                ret.Add(invocation);\n            }\n        }\n        return ret.ToImmutable();\n    }\n\n    private static ISymbol SymbolFromCorrectModel(SyntaxNode node, SemanticModel model) =>\n        node.EnsureCorrectSemanticModelOrDefault(model) is { } correctModel\n        && correctModel.GetSymbolInfo(node).Symbol is { } symbol\n            ? symbol\n            : null;\n\n    protected readonly struct InspectionContext\n    {\n        public readonly SonarSyntaxNodeReportingContext Context;\n        public readonly HashSet<SyntaxNode> VisitedMethods;\n\n        public InspectionContext(SonarSyntaxNodeReportingContext context)\n        {\n            Context = context;\n            VisitedMethods = [];\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/CheckFileLicenseBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text.RegularExpressions;\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class CheckFileLicenseBase : ParametrizedDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S1451\";\n        internal const string HeaderFormatPropertyKey = nameof(HeaderFormat);\n        internal const string IsRegularExpressionPropertyKey = nameof(IsRegularExpression);\n        protected const string HeaderFormatRuleParameterKey = \"headerFormat\";\n        private const string IsRegularExpressionRuleParameterKey = \"isRegularExpression\";\n        private const string IsRegularExpressionDefaultValue = \"false\";\n        private const string MessageFormat = \"Add or update the header of this file.\";\n\n        private readonly DiagnosticDescriptor rule;\n\n        protected abstract ILanguageFacade Language { get; }\n        public abstract string HeaderFormat { get; set; }\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(rule);\n\n        [RuleParameter(IsRegularExpressionRuleParameterKey, PropertyType.Boolean, \"Whether the headerFormat is a regular expression.\", IsRegularExpressionDefaultValue)]\n        public bool IsRegularExpression { get; set; } = bool.Parse(IsRegularExpressionDefaultValue);\n\n        protected CheckFileLicenseBase() =>\n            rule = Language.CreateDescriptor(DiagnosticId, MessageFormat, isEnabledByDefault: false);\n\n        protected override void Initialize(SonarParametrizedAnalysisContext context) =>\n            context.RegisterTreeAction(Language.GeneratedCodeRecognizer, c =>\n                {\n                    if (HeaderFormat == null)\n                    {\n                        return;\n                    }\n\n                    if (IsRegularExpression && !IsRegexPatternValid(HeaderFormat))\n                    {\n                        throw new InvalidOperationException($\"Invalid regular expression: {HeaderFormat}\");\n                    }\n\n                    var firstNode = c.Tree.GetRoot().ChildTokens().FirstOrDefault().Parent;\n                    if (!HasValidLicenseHeader(firstNode))\n                    {\n                        var properties = CreateDiagnosticProperties();\n                        c.ReportIssue(rule, Location.Create(c.Tree, TextSpan.FromBounds(0, 0)), properties);\n                    }\n                });\n\n        private static bool IsRegexPatternValid(string pattern)\n        {\n            try\n            {\n                Regex.Match(string.Empty, pattern, RegexOptions.None, Constants.DefaultRegexTimeout);\n                return true;\n            }\n            catch (ArgumentException)\n            {\n                return false;\n            }\n        }\n\n        private bool HasValidLicenseHeader(SyntaxNode node)\n        {\n            if (node == null || !node.HasLeadingTrivia)\n            {\n                return false;\n            }\n\n            var trivias = node.GetLeadingTrivia();\n            var header = trivias.ToString();\n            return header != null && AreHeadersEqual(header);\n        }\n\n        private bool AreHeadersEqual(string currentHeader)\n        {\n            var unixEndingHeader = currentHeader.Replace(\"\\r\\n\", \"\\n\");\n            var unixEndingHeaderFormat = HeaderFormat.Replace(\"\\r\\n\", \"\\n\").Replace(\"\\\\r\\\\n\", \"\\n\");\n            if (!IsRegularExpression && !unixEndingHeaderFormat.EndsWith(\"\\n\"))\n            {\n                // In standard text mode, we want to be sure that the matched header is on its own line, with nothing else on the same line.\n                unixEndingHeaderFormat += \"\\n\";\n            }\n            return IsRegularExpression\n                ? SafeRegex.IsMatch(unixEndingHeader, unixEndingHeaderFormat, RegexOptions.Singleline)\n                : unixEndingHeader.StartsWith(unixEndingHeaderFormat, StringComparison.Ordinal);\n        }\n\n        private ImmutableDictionary<string, string> CreateDiagnosticProperties() =>\n            ImmutableDictionary<string, string>.Empty\n                .Add(HeaderFormatPropertyKey, HeaderFormat)\n                .Add(IsRegularExpressionPropertyKey, IsRegularExpression.ToString());\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/ClassNamedExceptionBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class ClassNamedExceptionBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n{\n    private const string DiagnosticId = \"S2166\";\n\n    protected override string MessageFormat => \"Rename this class to remove \\\"Exception\\\" or correct its inheritance.\";\n\n    protected ClassNamedExceptionBase() : base(DiagnosticId) { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            Language.GeneratedCodeRecognizer,\n            c =>\n            {\n                if (Language.Syntax.NodeIdentifier(c.Node) is { IsMissing: false } classIdentifier\n                    && classIdentifier.ValueText.EndsWith(\"Exception\", StringComparison.InvariantCultureIgnoreCase)\n                    && c.Model.GetDeclaredSymbol(c.Node) is INamedTypeSymbol { } classSymbol\n                    && !classSymbol.DerivesFrom(KnownType.System_Exception)\n                    && !classSymbol.Implements(KnownType.System_Runtime_InteropServices_Exception))\n                {\n                    c.ReportIssue(Rule, classIdentifier);\n                }\n            },\n            Language.SyntaxKind.ClassAndModuleDeclarations);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/ClassNotInstantiatableBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class ClassNotInstantiatableBase<TBaseTypeSyntax, TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n        where TBaseTypeSyntax : SyntaxNode\n        where TSyntaxKind : struct\n    {\n        protected const string DiagnosticId = \"S3453\";\n\n        protected abstract IEnumerable<ConstructorContext> CollectRemovableDeclarations(INamedTypeSymbol namedType, Compilation compilation, string messageArg);\n\n        protected override string MessageFormat => \"This {0} can't be instantiated; make {1} 'public'.\";\n\n        protected ClassNotInstantiatableBase() : base(DiagnosticId) { }\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterSymbolAction(CheckClassWithOnlyUnusedPrivateConstructors, SymbolKind.NamedType);\n\n        private bool IsClassTypeDeclaration(SyntaxNode node) =>\n            Language.Syntax.IsAnyKind(node, Language.SyntaxKind.ClassAndRecordDeclarations);\n\n        private bool IsAnyConstructorCalled(INamedTypeSymbol namedType, IEnumerable<ConstructorContext> typeDeclarations) =>\n            typeDeclarations\n                .Select(typeDeclaration => new\n                {\n                    typeDeclaration.NodeAndModel.Model,\n                    DescendantNodes = typeDeclaration.NodeAndModel.Node.DescendantNodes().ToList()\n                })\n                .Any(descendants =>\n                    IsAnyConstructorToCurrentType(descendants.DescendantNodes, namedType, descendants.Model)\n                    || IsAnyNestedTypeExtendingCurrentType(descendants.DescendantNodes, namedType, descendants.Model));\n\n        private void CheckClassWithOnlyUnusedPrivateConstructors(SonarSymbolReportingContext context)\n        {\n            var namedType = (INamedTypeSymbol)context.Symbol;\n            if (!IsNonStaticClassWithNoAttributes(namedType) || DerivesFromSafeHandle(namedType))\n            {\n                return;\n            }\n\n            var members = namedType.GetMembers();\n            var constructors = GetConstructors(members).Where(x => !x.IsImplicitlyDeclared).ToList();\n\n            if (!HasOnlyCandidateConstructors(constructors) || HasOnlyStaticMembers(members.Except(constructors).ToList()))\n            {\n                return;\n            }\n\n            var messageArg = constructors.Count > 1 ? \"at least one of its constructors\" : \"its constructor\";\n            var removableDeclarationsAndErrors = CollectRemovableDeclarations(namedType, context.Compilation, messageArg).ToList();\n\n            if (!IsAnyConstructorCalled(namedType, removableDeclarationsAndErrors))\n            {\n                foreach (var typeDeclaration in removableDeclarationsAndErrors)\n                {\n                    context.ReportIssue(Language.GeneratedCodeRecognizer, typeDeclaration.Diagnostic);\n                }\n            }\n        }\n\n        private bool IsAnyNestedTypeExtendingCurrentType(IEnumerable<SyntaxNode> descendantNodes, INamedTypeSymbol namedType, SemanticModel semanticModel) =>\n            descendantNodes\n                .Where(IsClassTypeDeclaration)\n                .Select(x => (semanticModel.GetDeclaredSymbol(x) as ITypeSymbol)?.BaseType)\n                .WhereNotNull()\n                .Any(baseType => baseType.OriginalDefinition.DerivesFrom(namedType));\n\n        private bool IsAnyConstructorToCurrentType(IEnumerable<SyntaxNode> descendantNodes, INamedTypeSymbol namedType, SemanticModel semanticModel) =>\n            descendantNodes\n                .Where(x => Language.Syntax.IsAnyKind(x, Language.SyntaxKind.ObjectCreationExpressions))\n                .Select(ctor => semanticModel.GetSymbolInfo(ctor).Symbol as IMethodSymbol)\n                .WhereNotNull()\n                .Any(ctor => Equals(ctor.ContainingType.OriginalDefinition, namedType));\n\n        private static bool HasNonPrivateConstructor(IEnumerable<IMethodSymbol> constructors) =>\n            constructors.Any(method => method.DeclaredAccessibility != Accessibility.Private);\n\n        private static IEnumerable<IMethodSymbol> GetConstructors(IEnumerable<ISymbol> members) =>\n            members\n                .OfType<IMethodSymbol>()\n                .Where(method => method.MethodKind == MethodKind.Constructor);\n\n        private static bool HasOnlyStaticMembers(ICollection<ISymbol> members) =>\n            members.Any()\n            && members.All(member => member.IsStatic);\n\n        private static bool IsNonStaticClassWithNoAttributes(INamedTypeSymbol namedType) =>\n            namedType.IsClass()\n            && !namedType.IsStatic\n            && !namedType.GetAttributes().Any();\n\n        private static bool HasOnlyCandidateConstructors(ICollection<IMethodSymbol> constructors) =>\n            constructors.Any()\n            && !HasNonPrivateConstructor(constructors)\n            && constructors.All(c => !c.GetAttributes().Any());\n\n        private static bool DerivesFromSafeHandle(ITypeSymbol typeSymbol) =>\n            typeSymbol.DerivesFrom(KnownType.System_Runtime_InteropServices_SafeHandle);\n\n        protected class ConstructorContext\n        {\n            public NodeAndModel<TBaseTypeSyntax> NodeAndModel { get; }\n            public Diagnostic Diagnostic { get; }\n\n            public ConstructorContext(NodeAndModel<TBaseTypeSyntax> nodeAndModel, Diagnostic diagnostic)\n            {\n                NodeAndModel = nodeAndModel;\n                Diagnostic = diagnostic;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/ClassShouldNotBeEmptyBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class ClassShouldNotBeEmptyBase<TSyntaxKind, TDeclarationSyntax> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n    where TDeclarationSyntax : SyntaxNode\n{\n    private const string DiagnosticId = \"S2094\";\n\n    private static readonly ImmutableArray<KnownType> BaseClassesToIgnore = ImmutableArray.Create(\n        KnownType.Microsoft_AspNetCore_Mvc_RazorPages_PageModel,\n        KnownType.System_Attribute,\n        KnownType.System_Exception);\n\n    private static readonly IEnumerable<string> IgnoredNames = [\"AssemblyDoc\", \"NamespaceDoc\"]; // https://github.com/Doraku/DefaultDocumentation\n\n    private static readonly IEnumerable<string> IgnoredSuffixes = [\"Command\", \"Event\", \"Message\", \"Query\"];\n\n    protected abstract bool IsEmptyAndNotPartial(SyntaxNode node);\n    protected abstract TDeclarationSyntax GetIfHasDeclaredBaseClassOrInterface(SyntaxNode node);\n    protected abstract bool HasInterfaceOrGenericBaseClass(TDeclarationSyntax declaration);\n    protected abstract bool HasAnyAttribute(SyntaxNode node);\n    protected abstract string DeclarationTypeKeyword(SyntaxNode node);\n    protected abstract bool HasConditionalCompilationDirectives(SyntaxNode node);\n\n    protected override string MessageFormat => \"Remove this empty {0}, write its code or make it an \\\"interface\\\".\";\n\n    protected ClassShouldNotBeEmptyBase() : base(DiagnosticId) { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            Language.GeneratedCodeRecognizer,\n            c =>\n            {\n                if (Language.Syntax.NodeIdentifier(c.Node) is { IsMissing: false } identifier\n                    && IsEmptyAndNotPartial(c.Node)\n                    && !HasAnyAttribute(c.Node)\n                    && !HasConditionalCompilationDirectives(c.Node)\n                    && !ShouldIgnoreBecauseOfName(identifier)\n                    && !ShouldIgnoreBecauseOfBaseClassOrInterface(c.Node, c.Model))\n                {\n                    c.ReportIssue(Rule, identifier, DeclarationTypeKeyword(c.Node));\n                }\n            },\n            Language.SyntaxKind.ClassAndRecordDeclarations);\n\n    private static bool ShouldIgnoreBecauseOfName(SyntaxToken identifier) =>\n        IgnoredNames.Contains(identifier.ValueText)\n        || IgnoredSuffixes.Any(identifier.ValueText.EndsWith);\n\n    private bool ShouldIgnoreBecauseOfBaseClassOrInterface(SyntaxNode node, SemanticModel model) =>\n        GetIfHasDeclaredBaseClassOrInterface(node) is { } declaration\n        && (HasInterfaceOrGenericBaseClass(declaration) || ShouldIgnoreType(declaration, model) || HasNonPublicDefaultConstructor(declaration, model));\n\n    private static bool ShouldIgnoreType(TDeclarationSyntax node, SemanticModel model) =>\n        model.GetDeclaredSymbol(node) is INamedTypeSymbol classSymbol\n            && (classSymbol.BaseType is { IsAbstract: true }\n            || classSymbol.DerivesFromAny(BaseClassesToIgnore)\n            || classSymbol.Interfaces.Any(x => !x.Is(KnownType.System_IEquatable_T))); // every record type implicitly implements System.IEquatable<T>\n\n    private static bool HasNonPublicDefaultConstructor(TDeclarationSyntax declaration, SemanticModel model) =>\n        model.GetDeclaredSymbol(declaration) is INamedTypeSymbol classSymbol\n        && classSymbol.BaseType.Constructors.FirstOrDefault(x => x.Parameters.Length == 0) is { } constructor\n        && (constructor.GetEffectiveAccessibility() < classSymbol.DeclaredAccessibility\n            // GetEffectiveAccessibility is not handling Protected\n            || (constructor.DeclaredAccessibility == Accessibility.Protected && classSymbol.DeclaredAccessibility > Accessibility.Protected)\n            || (constructor.GetEffectiveAccessibility() == Accessibility.Internal && classSymbol.DeclaredAccessibility == Accessibility.Protected));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/CognitiveComplexityBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Metrics;\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class CognitiveComplexityBase<TSyntaxKind> : ParametrizedDiagnosticAnalyzer\n        where TSyntaxKind : struct\n    {\n        protected const string DiagnosticId = \"S3776\";\n        private const string MessageFormat = \"Refactor this {0} to reduce its Cognitive Complexity from {1} to the {2} allowed.\";\n        private const int DefaultThreshold = 15;\n        private const int DefaultPropertyThreshold = 3;\n\n        private readonly DiagnosticDescriptor rule;\n\n        protected abstract ILanguageFacade<TSyntaxKind> Language { get; }\n\n        [RuleParameter(\"threshold\", PropertyType.Integer, \"The maximum authorized complexity.\", DefaultThreshold)]\n        public int Threshold { get; set; } = DefaultThreshold;\n\n        [RuleParameter(\"propertyThreshold\", PropertyType.Integer, \"The maximum authorized complexity in a property.\", DefaultPropertyThreshold)]\n        public int PropertyThreshold { get; set; } = DefaultPropertyThreshold;\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(rule);\n\n        protected CognitiveComplexityBase() =>\n            rule = Language.CreateDescriptor(DiagnosticId, MessageFormat, isEnabledByDefault: false);\n\n        protected void CheckComplexity<TSyntax>(SonarSyntaxNodeReportingContext context,\n                                                Func<TSyntax, SyntaxNode> nodeSelector,\n                                                Func<TSyntax, Location> getLocationToReport,\n                                                Func<SyntaxNode, CognitiveComplexity> getComplexity,\n                                                string declarationType,\n                                                int threshold)\n            where TSyntax : SyntaxNode\n        {\n            var syntax = (TSyntax)context.Node;\n            var nodeToAnalyze = nodeSelector(syntax);\n            if (nodeToAnalyze == null)\n            {\n                return;\n            }\n\n            var metric = getComplexity(nodeToAnalyze);\n\n            if (metric.Complexity > Threshold)\n            {\n                context.ReportIssue(rule, getLocationToReport(syntax), metric.Locations, declarationType, metric.Complexity.ToString(), threshold.ToString());\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/CollectionEmptinessCheckingBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class CollectionEmptinessCheckingBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n        where TSyntaxKind : struct\n    {\n        internal const string DiagnosticId = \"S1155\";\n\n        protected CollectionEmptinessCheckingBase() : base(DiagnosticId) { }\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(Language.GeneratedCodeRecognizer,\n                c =>\n                {\n                    var binaryLeft = Language.Syntax.BinaryExpressionLeft(c.Node);\n                    var binaryRight = Language.Syntax.BinaryExpressionRight(c.Node);\n\n                    if (Language.ExpressionNumericConverter.ConstantIntValue(binaryLeft) is { } left)\n                    {\n                        CheckExpression(c, binaryRight, left, Language.Syntax.ComparisonKind(c.Node).Mirror());\n                    }\n                    else if (Language.ExpressionNumericConverter.ConstantIntValue(binaryRight) is { } right)\n                    {\n                        CheckExpression(c, binaryLeft, right, Language.Syntax.ComparisonKind(c.Node));\n                    }\n                },\n                Language.SyntaxKind.ComparisonKinds);\n\n        private void CheckExpression(SonarSyntaxNodeReportingContext context, SyntaxNode expression, int constant, ComparisonKind comparison)\n        {\n            if (comparison.Compare(constant).IsEmptyOrNotEmpty()\n                && TryGetCountCall(expression, context.Model, out var location, out var typeArgument))\n            {\n                context.ReportIssue(Rule, location, typeArgument);\n            }\n        }\n\n        private bool TryGetCountCall(SyntaxNode expression, SemanticModel model, out Location countLocation, out string typeArgument)\n        {\n            if (Language.Syntax.NodeIdentifier(expression) is { } identifier\n                && identifier.ValueText == nameof(Enumerable.Count)\n                && model.GetSymbolInfo(identifier.Parent.Parent).Symbol is IMethodSymbol methodSymbol\n                && methodSymbol.IsExtensionOn(KnownType.System_Collections_Generic_IEnumerable_T)\n                && methodSymbol.ReceiverType is INamedTypeSymbol receiverType)\n            {\n                countLocation = identifier.Parent.GetLocation();\n                typeArgument = (methodSymbol.TypeArguments.Any()\n                    ? methodSymbol.TypeArguments\n                    : receiverType.TypeArguments).Single().ToDisplayString();\n                return true;\n            }\n            else\n            {\n                countLocation = null;\n                typeArgument = null;\n                return false;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/CommentKeywordBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class CommentKeywordBase : SonarDiagnosticAnalyzer\n    {\n        private const string ToDoKeyword = \"TODO\";\n        protected const string ToDoDiagnosticId = \"S1135\";\n        protected const string ToDoMessageFormat = \"Complete the task associated to this '\" + ToDoKeyword + \"' comment.\";\n\n        private const string FixMeKeyword = \"FIXME\";\n        protected const string FixMeDiagnosticId = \"S1134\";\n        protected const string FixMeMessageFormat = \"Take the required action to fix the issue indicated by this '\" + FixMeKeyword + \"' comment.\";\n\n        private readonly DiagnosticDescriptor toDoRule;\n        private readonly DiagnosticDescriptor fixMeRule;\n\n        protected abstract ILanguageFacade Language { get; }\n        protected abstract bool IsComment(SyntaxTrivia trivia);\n\n        public sealed override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; }\n\n        protected CommentKeywordBase()\n        {\n            toDoRule = Language.CreateDescriptor(ToDoDiagnosticId, ToDoMessageFormat);\n            fixMeRule = Language.CreateDescriptor(FixMeDiagnosticId, FixMeMessageFormat);\n            SupportedDiagnostics = ImmutableArray.Create(toDoRule, fixMeRule);\n        }\n\n        protected sealed override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterTreeAction(\n                Language.GeneratedCodeRecognizer,\n                c =>\n                {\n                    var comments = c.Tree.GetRoot().DescendantTrivia()\n                        .Where(trivia => IsComment(trivia));\n\n                    foreach (var comment in comments)\n                    {\n                        foreach (var location in GetKeywordLocations(c.Tree, comment, ToDoKeyword))\n                        {\n                            c.ReportIssue(toDoRule, location);\n                        }\n\n                        foreach (var location in GetKeywordLocations(c.Tree, comment, FixMeKeyword))\n                        {\n                            c.ReportIssue(fixMeRule, location);\n                        }\n                    }\n                });\n\n        private static IEnumerable<Location> GetKeywordLocations(SyntaxTree tree, SyntaxTrivia comment, string word)\n        {\n            var text = comment.ToString();\n\n            return AllIndexesOf(text, word)\n                .Where(i => IsWordAt(text, i, word.Length))\n                .Select(\n                    i =>\n                    {\n                        var startLocation = comment.SpanStart + i;\n                        var location = Location.Create(tree, TextSpan.FromBounds(startLocation, startLocation + word.Length));\n\n                        return location;\n                    });\n        }\n\n        private static IEnumerable<int> AllIndexesOf(string text, string value, StringComparison comparisonType = StringComparison.OrdinalIgnoreCase)\n        {\n            var index = 0;\n            while ((index = text.IndexOf(value, index, text.Length - index, comparisonType)) != -1)\n            {\n                yield return index;\n                index += value.Length;\n            }\n        }\n\n        private static bool IsWordAt(string text, int index, int count)\n        {\n            var leftBoundary = true;\n            if (index > 0)\n            {\n                leftBoundary = !char.IsLetterOrDigit(text[index - 1]);\n            }\n\n            var rightBoundary = true;\n            var rightOffset = index + count;\n            if (rightOffset < text.Length)\n            {\n                rightBoundary = !char.IsLetterOrDigit(text[rightOffset]);\n            }\n\n            return leftBoundary && rightBoundary;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/CommentsShouldNotBeEmptyBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class CommentsShouldNotBeEmptyBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n{\n    private const string DiagnosticId = \"S4663\";\n\n    protected abstract string GetCommentText(SyntaxTrivia trivia);\n    protected abstract bool IsValidTriviaType(SyntaxTrivia trivia);\n\n    protected override string MessageFormat => \"Remove this empty comment\";\n\n    protected CommentsShouldNotBeEmptyBase() : base(DiagnosticId) { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterTreeAction(Language.GeneratedCodeRecognizer, c =>\n        {\n            foreach (var token in c.Tree.GetRoot().DescendantTokens())\n            {\n                // Hotpath: Don't allocate the trivia enumerable if not needed\n                if (token.HasLeadingTrivia)\n                {\n                    CheckTrivia(c, token.LeadingTrivia);\n                }\n\n                if (token.HasTrailingTrivia)\n                {\n                    CheckTrivia(c, token.TrailingTrivia);\n                }\n            }\n        });\n\n    private void CheckTrivia(SonarSyntaxTreeReportingContext context, IEnumerable<SyntaxTrivia> trivia)\n    {\n        var partitions = PartitionComments(trivia);\n        if (partitions is null)\n        {\n            return;\n        }\n\n        foreach (var partition in partitions.Where(trivia => trivia.Any() && trivia.All(x => string.IsNullOrWhiteSpace(GetCommentText(x)))))\n        {\n            var location = partition.First().GetLocation();\n            var secondary = partition.Skip(1).Select(x => x.GetLocation().ToSecondary(MessageFormat));\n            context.ReportIssue(Rule, location, secondary);\n        }\n    }\n\n    private List<List<SyntaxTrivia>> PartitionComments(IEnumerable<SyntaxTrivia> trivia)\n    {\n        // Hotpath: avoid unnecessary allocations\n        List<List<SyntaxTrivia>> partitions = null;\n        List<SyntaxTrivia> current = null;\n        var firstEndOfLineFound = false;\n\n        foreach (var trivium in trivia)\n        {\n            if (IsSimpleComment(trivium))\n            {\n                AddTriviaToPartition(ref current, trivium, ref firstEndOfLineFound);\n            }\n            // This is for the case, of two different comment types, for example:\n            // //\n            // ///\n            else if (IsValidTriviaType(trivium)) // valid but not \"//\", because of the upper if\n            {\n                CloseCurrentPartition(ref current, ref partitions, ref firstEndOfLineFound);\n                // all comments except single-line comments are parsed as a block already.\n                AddTriviaToPartition(ref current, trivium, ref firstEndOfLineFound);\n                CloseCurrentPartition(ref current, ref partitions, ref firstEndOfLineFound);\n            }\n            // This handles an empty line, for example:\n            // // some comment \\n <- EOL found, firstEndOfLineFound set to true\n            // //  \\n <- EOL is set to false at CommentTrivia, set to true after it\n            // // some other comment <- EOL is set to false at CommentTrivia, set to true after it\n            // \\n <- EOL found, is already true, closes current partition\n            else if (IsEndOfLine(trivium))\n            {\n                if (firstEndOfLineFound)\n                {\n                    CloseCurrentPartition(ref current, ref partitions, ref firstEndOfLineFound);\n                }\n                else\n                {\n                    firstEndOfLineFound = true;\n                }\n            }\n            else if (!IsWhitespace(trivium))\n            {\n                CloseCurrentPartition(ref current, ref partitions, ref firstEndOfLineFound);\n            }\n        }\n\n        CloseCurrentPartition(ref current, ref partitions, ref firstEndOfLineFound);\n        return partitions;\n\n        // Hotpath: Don't capture variables\n        static void AddTriviaToPartition(ref List<SyntaxTrivia> current, SyntaxTrivia trivia, ref bool firstEndOfLineFound)\n        {\n            current ??= new();\n            current.Add(trivia);\n            firstEndOfLineFound = false;\n        }\n\n        static void CloseCurrentPartition(ref List<SyntaxTrivia> current, ref List<List<SyntaxTrivia>> partitions, ref bool firstEndOfLineFound)\n        {\n            if (current is { Count: > 0 })\n            {\n                partitions ??= new();\n                partitions.Add(current);\n                current = null;\n            }\n\n            firstEndOfLineFound = false;\n        }\n    }\n\n    private bool IsSimpleComment(SyntaxTrivia trivia) =>\n        Language.Syntax.IsKind(trivia, Language.SyntaxKind.SimpleCommentTrivia);\n\n    private bool IsEndOfLine(SyntaxTrivia trivia) =>\n        Language.Syntax.IsKind(trivia, Language.SyntaxKind.EndOfLineTrivia);\n\n    private bool IsWhitespace(SyntaxTrivia trivia) =>\n        Language.Syntax.IsKind(trivia, Language.SyntaxKind.WhitespaceTrivia);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/ConditionalStructureSameConditionBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class ConditionalStructureSameConditionBase : SonarDiagnosticAnalyzer\n    {\n        protected const string DiagnosticId = \"S1862\";\n        protected const string MessageFormat = \"This branch duplicates the one on line {0}.\";\n\n        protected readonly DiagnosticDescriptor rule;\n\n        protected abstract ILanguageFacade Language { get; }\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(rule);\n\n        protected ConditionalStructureSameConditionBase() =>\n            rule = Language.CreateDescriptor(DiagnosticId, MessageFormat);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/ConditionalStructureSameImplementationBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class ConditionalStructureSameImplementationBase : SonarDiagnosticAnalyzer\n{\n    internal const string DiagnosticId = \"S1871\";\n    internal const string MessageFormat = \"Either merge this {1} with the identical one on line {0} or change one of the implementations.\";\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/ConstructorArgumentValueShouldExistBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class ConstructorArgumentValueShouldExistBase<TSyntaxKind, TAttribute> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n    where TAttribute : SyntaxNode\n{\n    private const string DiagnosticId = \"S4260\";\n\n    protected abstract SyntaxNode GetFirstAttributeArgument(TAttribute attributeSyntax);\n\n    protected override string MessageFormat => \"Change this 'ConstructorArgumentAttribute' value to match one of the existing constructors arguments.\";\n\n    protected ConstructorArgumentValueShouldExistBase() : base(DiagnosticId) { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(Language.GeneratedCodeRecognizer,\n            c =>\n            {\n                var attribute = (TAttribute)c.Node;\n                if (Language.Syntax.IsKnownAttributeType(c.Model, c.Node, KnownType.System_Windows_Markup_ConstructorArgumentAttribute)\n                    && GetFirstAttributeArgument(attribute) is { } firstAttribute\n                    && c.Model.GetConstantValue(Language.Syntax.NodeExpression(firstAttribute)) is { HasValue: true, Value: string constructorParameterName }\n                    && c.ContainingSymbol is IPropertySymbol { ContainingType: { } containingType }\n                    && !GetConstructorParameterNames(containingType).Contains(constructorParameterName))\n                {\n                    c.ReportIssue(Rule, firstAttribute.GetLocation());\n                }\n            }, Language.SyntaxKind.Attribute);\n\n    private static IEnumerable<string> GetConstructorParameterNames(INamedTypeSymbol containingSymbol) =>\n        containingSymbol?.Constructors.SelectMany(x => x.Parameters).Select(x => x.Name) ?? [];\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/DangerousGetHandleShouldNotBeCalledBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class DangerousGetHandleShouldNotBeCalledBase<TSyntaxKind, TInvocation> : DoNotCallMethodsBase<TSyntaxKind, TInvocation>\n        where TSyntaxKind : struct\n        where TInvocation : SyntaxNode\n    {\n        private const string DiagnosticId = \"S3869\";\n\n        protected override string MessageFormat => \"Refactor the code to remove this use of '{0}'.\";\n\n        protected override IEnumerable<MemberDescriptor> CheckedMethods { get; } = new List<MemberDescriptor>\n        {\n            new(KnownType.System_Runtime_InteropServices_SafeHandle, \"DangerousGetHandle\")\n        };\n\n        protected DangerousGetHandleShouldNotBeCalledBase() : base(DiagnosticId) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/DateAndTimeShouldNotBeUsedasTypeForPrimaryKeyBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class DateAndTimeShouldNotBeUsedasTypeForPrimaryKeyBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n{\n    private const string DiagnosticId = \"S3363\";\n\n    protected static readonly string[] KeyAttributeTypeNames = TypeNamesForAttribute(KnownType.System_ComponentModel_DataAnnotations_KeyAttribute);\n    protected static readonly KnownType[] TemporalTypes = new[]\n    {\n        KnownType.System_DateOnly,\n        KnownType.System_DateTime,\n        KnownType.System_DateTimeOffset,\n        KnownType.System_TimeOnly,\n        KnownType.System_TimeSpan\n    };\n\n    protected abstract IEnumerable<SyntaxNode> TypeNodesOfTemporalKeyProperties(SonarSyntaxNodeReportingContext context);\n\n    protected override string MessageFormat => \"'{0}' should not be used as a type for primary keys\";\n\n    protected DateAndTimeShouldNotBeUsedasTypeForPrimaryKeyBase() : base(DiagnosticId) { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(startContext =>\n        {\n            if (ShouldRegisterAction(startContext.Compilation))\n            {\n                startContext.RegisterNodeAction(Language.GeneratedCodeRecognizer, nodeContext =>\n                {\n                    foreach (var propertyType in TypeNodesOfTemporalKeyProperties(nodeContext))\n                    {\n                        nodeContext.ReportIssue(Rule, propertyType, Language.Syntax.NodeIdentifier(propertyType)?.ValueText);\n                    }\n                }, Language.SyntaxKind.ClassDeclaration);\n            }\n        });\n\n    protected static bool IsKeyPropertyBasedOnName(string propertyName, string className) =>\n        propertyName.Equals(\"Id\", StringComparison.InvariantCultureIgnoreCase)\n        || propertyName.Equals($\"{className}Id\", StringComparison.InvariantCultureIgnoreCase);\n\n    protected virtual bool IsTemporalType(string propertyTypeName) =>\n        Array.Exists(TemporalTypes, x => propertyTypeName.Equals(x.TypeName, Language.NameComparison)\n                                         || propertyTypeName.Equals(x.FullName, Language.NameComparison));\n\n    protected bool MatchesAttributeName(string attributeName, string[] candidates) =>\n        Array.Exists(candidates, x => attributeName.Equals(x, Language.NameComparison));\n\n    private static bool ShouldRegisterAction(Compilation compilation) =>\n        compilation.GetTypeByMetadataName(KnownType.Microsoft_EntityFrameworkCore_DbContext) is not null\n        || compilation.GetTypeByMetadataName(KnownType.Microsoft_EntityFramework_DbContext) is not null;\n\n    private static string[] TypeNamesForAttribute(KnownType attributeType) => new[]\n    {\n        attributeType.TypeName,\n        attributeType.FullName,\n        RemoveFromEnd(attributeType.TypeName, \"Attribute\"),\n        RemoveFromEnd(attributeType.FullName, \"Attribute\"),\n    };\n\n    private static string RemoveFromEnd(string text, string subtextFromEnd) =>\n        text.Substring(0, text.LastIndexOf(subtextFromEnd));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/DateTimeFormatShouldNotBeHardcodedBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class DateTimeFormatShouldNotBeHardcodedBase<TSyntaxKind, TInvocation> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n    where TInvocation : SyntaxNode\n{\n    private const string DiagnosticId = \"S6585\";\n\n    protected abstract Location HardCodedArgumentLocation(TInvocation invocation);\n    protected abstract bool HasInvalidFirstArgument(TInvocation invocation, SemanticModel semanticModel);\n\n    protected override string MessageFormat => \"Do not hardcode the format specifier.\";\n\n    protected IEnumerable<KnownType> CheckedTypes { get; } = new List<KnownType>\n        {\n            KnownType.System_DateTime,\n            KnownType.System_DateTimeOffset,\n            KnownType.System_DateOnly,\n            KnownType.System_TimeOnly,\n            KnownType.System_TimeSpan,\n        };\n\n    protected DateTimeFormatShouldNotBeHardcodedBase() : base(DiagnosticId) { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(Language.GeneratedCodeRecognizer, AnalyzeInvocation, Language.SyntaxKind.InvocationExpression);\n\n    private void AnalyzeInvocation(SonarSyntaxNodeReportingContext analysisContext)\n    {\n        if ((TInvocation)analysisContext.Node is var invocation\n            && Language.Syntax.InvocationIdentifier(invocation) is { } identifier\n            && identifier.ValueText.Equals(\"ToString\", Language.NameComparison)\n            && HasInvalidFirstArgument(invocation, analysisContext.Model) // Standard date and time format strings are 1 char long and they are allowed\n            && analysisContext.Model.GetSymbolInfo(identifier.Parent).Symbol is { } methodCallSymbol\n            && CheckedTypes.Any(x => methodCallSymbol.ContainingType.ConstructedFrom.Is(x)))\n        {\n            analysisContext.ReportIssue(SupportedDiagnostics[0], HardCodedArgumentLocation(invocation));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/DebuggerDisplayUsesExistingMembersBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text.RegularExpressions;\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class DebuggerDisplayUsesExistingMembersBase<TAttributeArgumentSyntax, TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TAttributeArgumentSyntax : SyntaxNode\n    where TSyntaxKind : struct\n{\n    private const string DiagnosticId = \"S4545\";\n\n    private static readonly ArgumentDescriptor ConstructorDescriptor = ArgumentDescriptor.AttributeArgument(KnownType.System_Diagnostics_DebuggerDisplayAttribute, \"value\", 0);\n    private static readonly ArgumentDescriptor NameDescriptor = ArgumentDescriptor.AttributeProperty(KnownType.System_Diagnostics_DebuggerDisplayAttribute, nameof(DebuggerDisplayAttribute.Name));\n    private static readonly ArgumentDescriptor TypeDescriptor = ArgumentDescriptor.AttributeProperty(KnownType.System_Diagnostics_DebuggerDisplayAttribute, nameof(DebuggerDisplayAttribute.Type));\n\n    // Source of the regex: https://stackoverflow.com/questions/546433/regular-expression-to-match-balanced-parentheses#comment120990638_35271017\n    private static readonly Regex EvaluatedExpressionRegex = new(@\"\\{(?>\\{(?<c>)|[^{}]+|\\}(?<-c>))*(?(c)(?!))\\}\", RegexOptions.None, Constants.DefaultRegexTimeout);\n    // Remove the \"nq\" (no quotes) modifier, others like \"d\" or \"raw\" are undocumented. We allow any word here.\n    private static readonly Regex RemoveNqModifierRegex = new(@\"\\s*,\\s*[a-zA-Z]*\\s*$\", RegexOptions.None, Constants.DefaultRegexTimeout);\n    protected abstract SyntaxNode AttributeTarget(TAttributeArgumentSyntax attribute);\n    protected abstract ImmutableArray<SyntaxNode> ResolvableIdentifiers(SyntaxNode expression);\n\n    protected override string MessageFormat => \"{0}\";\n\n    protected DebuggerDisplayUsesExistingMembersBase() : base(DiagnosticId) { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            Language.GeneratedCodeRecognizer,\n            c =>\n            {\n                var attributeArgument = (TAttributeArgumentSyntax)c.Node;\n                var trackingContext = new ArgumentContext(attributeArgument, c.Model);\n                var argumentMatcher = Language.Tracker.Argument;\n                if (argumentMatcher.Or(\n                        argumentMatcher.MatchArgument(ConstructorDescriptor),\n                        argumentMatcher.MatchArgument(NameDescriptor),\n                        argumentMatcher.MatchArgument(TypeDescriptor))(trackingContext)\n                    && Language.Syntax.NodeExpression(attributeArgument) is { } formatString\n                    && Language.FindConstantValue(c.Model, formatString) is string formatStringText\n                    && FirstInvalidExpression(c, formatStringText, attributeArgument) is { } firstInvalidMember)\n                {\n                    c.ReportIssue(Rule, formatString, firstInvalidMember);\n                }\n            },\n            Language.SyntaxKind.AttributeArgument);\n\n    private string FirstInvalidExpression(SonarSyntaxNodeReportingContext context, string formatString, TAttributeArgumentSyntax attributeSyntax)\n    {\n        return AttributeTarget(attributeSyntax) is { } targetSyntax\n            && context.Model.GetDeclaredSymbol(targetSyntax) is { } targetSymbol\n            && TypeContainingReferencedMembers(targetSymbol) is { } typeSymbol\n                ? FirstInvalidMemberName(typeSymbol)\n                : null;\n\n        string FirstInvalidMemberName(ITypeSymbol typeSymbol)\n        {\n            var allMembers = typeSymbol\n                .GetSelfAndBaseTypes()\n                .SelectMany(x => x.GetMembers())\n                .Concat(typeSymbol.ContainingNamespace.GetAllNamedTypes()\n                .Where(x => x.IsStatic)\n                .SelectMany(x => x.GetMembers().Prepend(x)))\n                .Select(ResolveName)\n                .WhereNotNull()\n                .ToHashSet(Language.NameComparer);\n\n            foreach (Match match in EvaluatedExpressionRegex.SafeMatches(formatString))\n            {\n                if (match is { Success: true }\n                    && ParseExpression(match.Value) is { } parsedExpression\n                    && CheckParsedExpression(allMembers, parsedExpression, match.Value) is { } message)\n                {\n                    return message;\n                }\n            }\n            return null;\n        }\n\n        string CheckParsedExpression(HashSet<string> allMembers, SyntaxNode parsedExpression, string evaluatedExpression)\n        {\n            if (parsedExpression.ContainsDiagnostics\n                && parsedExpression.GetDiagnostics() is { } diagnostics\n                && diagnostics.FirstOrDefault(x => x.Severity == DiagnosticSeverity.Error) is { } firstError)\n            {\n                return $\"\"\"'{evaluatedExpression}' is not a valid expression. {firstError.Id}: {firstError.GetMessage()}.\"\"\";\n            }\n            if (ResolvableIdentifiers(parsedExpression).Select(Language.GetName).ToImmutableHashSet(Language.NameComparer) is { } resolvableNames\n                && resolvableNames.Except(allMembers) is { Count: > 0 } unresolvableNames)\n            {\n                return $\"\"\"'{unresolvableNames.First()}' doesn't exist in this context.\"\"\";\n            }\n            return null;\n        }\n\n        SyntaxNode ParseExpression(string evaluatedExpression)\n        {\n            var removeBraces = evaluatedExpression.TrimStart('{').TrimEnd('}').Trim();\n            var sanitizedExpression = RemoveNqModifierRegex.SafeReplace(removeBraces, string.Empty);\n            return Language.Syntax.ParseExpression(sanitizedExpression);\n        }\n\n        static ITypeSymbol TypeContainingReferencedMembers(ISymbol symbol) =>\n            symbol is ITypeSymbol typeSymbol ? typeSymbol : symbol.ContainingType;\n\n        string ResolveName(ISymbol symbol) =>\n            symbol switch\n            {\n                IMethodSymbol { IsStatic: true, IsExtension: true } extension =>\n                    extension.Parameters.FirstOrDefault() is { } targetType && typeSymbol.DerivesOrImplements(targetType.Type) ? symbol.Name : null,\n                IMethodSymbol { IsStatic: true, IsImplicitlyDeclared: true } extensionProp =>\n                    extensionProp.Name.StartsWith(\"get_\") && extensionProp.Parameters.FirstOrDefault() is { } targetType && typeSymbol.DerivesOrImplements(targetType.Type)\n                        ? symbol.Name.Substring(4)\n                        : null,\n                ITypeSymbol { IsStatic: true, ContainingSymbol: INamespaceSymbol } => symbol.Name,\n                ITypeSymbol { IsStatic: true, ContainingSymbol: ITypeSymbol containingSymbol } => containingSymbol.Equals(typeSymbol) ? symbol.Name : OutermostType(symbol).Name,\n                ISymbol { IsStatic: true } => OutermostType(symbol).Name,\n                IMethodSymbol { ReturnsVoid: true } => null,\n                _ => symbol.Name\n            };\n\n        static ISymbol OutermostType(ISymbol symbol)\n        {\n            while (symbol.ContainingSymbol is ITypeSymbol)\n            {\n                symbol = symbol.ContainingSymbol;\n            }\n            return symbol;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/DeclareTypesInNamespacesBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class DeclareTypesInNamespacesBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n        where TSyntaxKind : struct\n    {\n        private const string DiagnosticId = \"S3903\";\n\n        protected abstract TSyntaxKind[] SyntaxKinds { get; }\n        protected abstract bool IsInnerTypeOrWithinNamespace(SyntaxNode declaration, SemanticModel semanticModel);\n        protected abstract SyntaxToken GetTypeIdentifier(SyntaxNode declaration);\n        protected abstract bool IsException(SyntaxNode node);\n\n        protected override string MessageFormat => \"Move '{0}' into a named namespace.\";\n\n        protected DeclareTypesInNamespacesBase() : base(DiagnosticId) { }\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n          context.RegisterNodeAction(Language.GeneratedCodeRecognizer,\n              c =>\n              {\n                  var declaration = c.Node;\n                  if (c.IsRedundantPositionalRecordContext() || IsInnerTypeOrWithinNamespace(declaration, c.Model) || IsException(c.Node))\n                  {\n                      return;\n                  }\n\n                  var identifier = GetTypeIdentifier(declaration);\n                  c.ReportIssue(Rule, identifier.GetLocation(), identifier.ValueText);\n              },\n              SyntaxKinds);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/DoNotCallInsecureSecurityAlgorithmBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class DoNotCallInsecureSecurityAlgorithmBase<TSyntaxKind, TInvocationExpressionSyntax, TArgumentListSyntax, TArgumentSyntax>\n        : SonarDiagnosticAnalyzer\n        where TSyntaxKind : struct\n        where TInvocationExpressionSyntax : SyntaxNode\n        where TArgumentListSyntax : SyntaxNode\n        where TArgumentSyntax : SyntaxNode\n    {\n        protected abstract ISet<string> AlgorithmParameterlessFactoryMethods { get; }\n        protected abstract ISet<string> AlgorithmParameterizedFactoryMethods { get; }\n        protected abstract ISet<string> FactoryParameterNames { get; }\n        protected abstract ILanguageFacade<TSyntaxKind> Language { get; }\n        private protected abstract ImmutableArray<KnownType> AlgorithmTypes { get; }\n\n        protected abstract Location Location(SyntaxNode objectCreation);\n        protected abstract TArgumentListSyntax ArgumentList(TInvocationExpressionSyntax invocationExpression);\n        protected abstract SeparatedSyntaxList<TArgumentSyntax> Arguments(TArgumentListSyntax argumentList);\n        protected abstract bool IsStringLiteralArgument(TArgumentSyntax argument);\n        protected abstract SyntaxNode Expression(TArgumentSyntax argument);\n\n        protected sealed override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(Language.GeneratedCodeRecognizer, CheckObjectCreation, Language.SyntaxKind.ObjectCreationExpressions);\n            context.RegisterNodeAction(Language.GeneratedCodeRecognizer, CheckInvocation, Language.SyntaxKind.InvocationExpression);\n        }\n\n        private void CheckInvocation(SonarSyntaxNodeReportingContext context)\n        {\n            var invocation = (TInvocationExpressionSyntax)context.Node;\n\n            if (Language.Syntax.NodeExpression(invocation) is { } expression\n                && (context.Model.GetSymbolInfo(expression).Symbol is IMethodSymbol methodSymbol)\n                && (methodSymbol.ReturnType.DerivesFromAny(AlgorithmTypes) || IsInsecureBaseAlgorithmCreationFactoryCall(methodSymbol, invocation)))\n            {\n                ReportAllDiagnostics(context, invocation.GetLocation());\n            }\n        }\n\n        private void CheckObjectCreation(SonarSyntaxNodeReportingContext context)\n        {\n            var objectCreation = context.Node;\n\n            var typeInfo = context.Model.GetTypeInfo(objectCreation);\n            if (typeInfo.Type == null || typeInfo.Type is IErrorTypeSymbol)\n            {\n                return;\n            }\n\n            if (typeInfo.Type.DerivesFromAny(AlgorithmTypes))\n            {\n                ReportAllDiagnostics(context, Location(objectCreation));\n            }\n        }\n\n        private bool IsInsecureBaseAlgorithmCreationFactoryCall(IMethodSymbol methodSymbol, TInvocationExpressionSyntax invocationExpression)\n        {\n            var argumentList = ArgumentList(invocationExpression);\n\n            if (argumentList == null || methodSymbol.ContainingType == null)\n            {\n                return false;\n            }\n\n            var methodFullName = $\"{methodSymbol.ContainingType}.{methodSymbol.Name}\";\n\n            if (Arguments(argumentList).Count == 0)\n            {\n                return AlgorithmParameterlessFactoryMethods.Contains(methodFullName);\n            }\n\n            if (Arguments(argumentList).Count > 1 || !IsStringLiteralArgument(Arguments(argumentList).First()))\n            {\n                return false;\n            }\n\n            if (!AlgorithmParameterizedFactoryMethods.Contains(methodFullName))\n            {\n                return false;\n            }\n\n            return FactoryParameterNames.Any(x => x.Equals(Language.Syntax.LiteralText(Expression(Arguments(argumentList).First())), StringComparison.Ordinal));\n        }\n\n        private void ReportAllDiagnostics(SonarSyntaxNodeReportingContext context, Location location)\n        {\n            foreach (var supportedDiagnostic in SupportedDiagnostics)\n            {\n                context.ReportIssue(supportedDiagnostic, location);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/DoNotCallMethodsBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class DoNotCallMethodsBase<TSyntaxKind, TInvocationExpressionSyntax> : SonarDiagnosticAnalyzer<TSyntaxKind>\n        where TSyntaxKind : struct\n        where TInvocationExpressionSyntax : SyntaxNode\n    {\n        protected abstract IEnumerable<MemberDescriptor> CheckedMethods { get; }\n\n        protected virtual bool ShouldReportOnMethodCall(TInvocationExpressionSyntax invocation, SemanticModel semanticModel, MemberDescriptor memberDescriptor) => true;\n\n        protected virtual bool IsInValidContext(TInvocationExpressionSyntax invocationSyntax, SemanticModel semanticModel) => true;\n\n        protected virtual bool ShouldRegisterAction(Compilation compilation) => true;\n\n        protected DoNotCallMethodsBase(string diagnosticId) : base(diagnosticId) { }\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n             context.RegisterCompilationStartAction(c =>\n             {\n                 if (!ShouldRegisterAction(c.Compilation))\n                 {\n                     return;\n                 }\n                 c.RegisterNodeAction(Language.GeneratedCodeRecognizer, AnalyzeInvocation, Language.SyntaxKind.InvocationExpression);\n             });\n\n        private void AnalyzeInvocation(SonarSyntaxNodeReportingContext analysisContext)\n        {\n            if ((TInvocationExpressionSyntax)analysisContext.Node is var invocation\n                && Language.Syntax.InvocationIdentifier(invocation) is { } identifier\n                && CheckedMethods.Where(x => x.Name.Equals(identifier.ValueText)) is var nameMatch\n                && nameMatch.Any()\n                && analysisContext.Model.GetSymbolInfo(identifier.Parent).Symbol is { } methodCallSymbol\n                && nameMatch.FirstOrDefault(x => methodCallSymbol.ContainingType.ConstructedFrom.Is(x.ContainingType)) is { } disallowedMethodSignature\n                && IsInValidContext(invocation, analysisContext.Model)\n                && ShouldReportOnMethodCall(invocation, analysisContext.Model, disallowedMethodSignature))\n            {\n                analysisContext.ReportIssue(SupportedDiagnostics[0], identifier.GetLocation(), disallowedMethodSignature.ToString());\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/DoNotCheckZeroSizeCollectionBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class DoNotCheckZeroSizeCollectionBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n        where TSyntaxKind : struct\n    {\n        protected const string DiagnosticId = \"S3981\";\n        private const string CountName = nameof(Enumerable.Count);\n        private const string LengthName = nameof(Array.Length);\n        private const string LongLengthName = nameof(Array.LongLength);\n\n        protected abstract string IEnumerableTString { get; }\n\n        protected override string MessageFormat => \"The '{0}' of '{1}' always evaluates as '{2}' regardless the size.\";\n\n        protected DoNotCheckZeroSizeCollectionBase() : base(DiagnosticId) { }\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(Language.GeneratedCodeRecognizer,\n                c =>\n                {\n                    var binary = c.Node;\n                    var binaryLeft = Language.Syntax.BinaryExpressionLeft(binary);\n                    var binaryRight = Language.Syntax.BinaryExpressionRight(binary);\n\n                    if (Language.ExpressionNumericConverter.ConstantIntValue(c.Model, binaryLeft) is { } left)\n                    {\n                        CheckExpression(c, binary, binaryRight, left, Language.Syntax.ComparisonKind(binary).Mirror());\n                    }\n                    else if (Language.ExpressionNumericConverter.ConstantIntValue(c.Model, binaryRight) is { } right)\n                    {\n                        CheckExpression(c, binary, binaryLeft, right, Language.Syntax.ComparisonKind(binary));\n                    }\n                },\n                Language.SyntaxKind.ComparisonKinds);\n\n        protected void CheckExpression(SonarSyntaxNodeReportingContext context, SyntaxNode issue, SyntaxNode expression, int constant, ComparisonKind comparison)\n        {\n            expression = Language.Syntax.RemoveConditionalAccess(expression);\n            var result = comparison.Compare(constant);\n            if (result.IsInvalid()\n                && HasCandidateName(Language.Syntax.NodeIdentifier(expression)?.ValueText)\n                && context.Model.GetSymbolInfo(expression).Symbol is ISymbol symbol\n                && CollecionSizeTypeName(symbol) is { } symbolType)\n            {\n                context.ReportIssue(Rule, issue, symbol.Name, symbolType, (result == CountComparisonResult.AlwaysTrue).ToString());\n            }\n        }\n\n        private bool HasCandidateName(string name) =>\n            CountName.Equals(name, Language.NameComparison)\n            || LengthName.Equals(name, Language.NameComparison)\n            || LongLengthName.Equals(name, Language.NameComparison);\n\n        private bool IsEnumerableCountMethod(ISymbol symbol) =>\n            CountName.Equals(symbol.Name, Language.NameComparison)\n            && symbol is IMethodSymbol methodSymbol\n            && methodSymbol.IsExtensionMethod\n            && methodSymbol.ReceiverType is not null\n            && methodSymbol.IsExtensionOn(KnownType.System_Collections_Generic_IEnumerable_T);\n\n        private bool IsArrayLengthProperty(ISymbol symbol) =>\n            (LengthName.Equals(symbol.Name, Language.NameComparison) || LongLengthName.Equals(symbol.Name, Language.NameComparison))\n            && symbol is IPropertySymbol propertySymbol\n            && propertySymbol.ContainingType.Is(KnownType.System_Array);\n\n        private bool IsStringLengthProperty(ISymbol symbol) =>\n            LengthName.Equals(symbol.Name, Language.NameComparison)\n            && symbol is IPropertySymbol propertySymbol\n            && propertySymbol.ContainingType.Is(KnownType.System_String);\n\n        private bool IsCollectionCountProperty(ISymbol symbol) =>\n            CountName.Equals(symbol.Name, Language.NameComparison)\n            && symbol is IPropertySymbol propertySymbol\n            && propertySymbol.ContainingType.DerivesOrImplements(KnownType.System_Collections_Generic_ICollection_T);\n\n        private bool IsReadonlyCollectionCountProperty(ISymbol symbol) =>\n            CountName.Equals(symbol.Name, Language.NameComparison)\n            && symbol is IPropertySymbol propertySymbol\n            && propertySymbol.ContainingType.DerivesOrImplements(KnownType.System_Collections_Generic_IReadOnlyCollection_T);\n\n        private string CollecionSizeTypeName(ISymbol symbol)\n        {\n            if (IsArrayLengthProperty(symbol))\n            {\n                return nameof(Array);\n            }\n            else if (IsStringLengthProperty(symbol))\n            {\n                return nameof(String);\n            }\n            else if (IsEnumerableCountMethod(symbol))\n            {\n                return IEnumerableTString;\n            }\n            else if (IsCollectionCountProperty(symbol))\n            {\n                return nameof(ICollection<object>);\n            }\n            else if (IsReadonlyCollectionCountProperty(symbol))\n            {\n                return nameof(IReadOnlyCollection<object>);\n            }\n            else\n            {\n                return null;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/DoNotHardcodeBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\nusing System.Text.RegularExpressions;\nusing System.Xml.Linq;\nusing SonarAnalyzer.Core.Json;\nusing SonarAnalyzer.Core.Json.Parsing;\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class DoNotHardcodeBase<TSyntaxKind> : ParametrizedDiagnosticAnalyzer where TSyntaxKind : struct\n{\n    protected const char KeywordSeparator = ';';\n\n    protected static readonly TimeSpan RegexTimeout = TimeSpan.FromMilliseconds(250);\n    protected static readonly Regex ValidKeywordPattern = new(@\"^(\\?|:\\w+|\\{\\d+[^}]*\\}|\"\"|')$\", RegexOptions.IgnoreCase | RegexOptions.Compiled, RegexTimeout);\n\n    protected string keyWords;\n    protected DiagnosticDescriptor rule;\n    protected ImmutableList<string> splitKeyWords;\n    protected Regex keyWordPattern;\n\n    protected abstract void ExtractKeyWords(string value);\n    protected abstract string FindIssue(string variableName, string variableValue);\n\n    protected abstract string DiagnosticId { get; }\n    protected abstract ILanguageFacade<TSyntaxKind> Language { get; }\n\n    public string FilterWords\n    {\n        get => keyWords;\n        set => ExtractKeyWords(value);\n    }\n\n    protected static ImmutableList<string> SplitKeyWordsByComma(string keyWords) =>\n        keyWords.ToUpperInvariant()\n            .Split([','], StringSplitOptions.RemoveEmptyEntries)\n            .Select(x => x.Trim())\n            .Where(x => x.Length != 0)\n            .ToImmutableList();\n\n    protected static bool IsValidKeyword(string suffix)\n    {\n        var candidateKeyword = suffix.Split(KeywordSeparator)[0].Trim();\n        return string.IsNullOrWhiteSpace(candidateKeyword) || ValidKeywordPattern.SafeIsMatch(candidateKeyword);\n    }\n\n    protected void CheckWebConfig(SonarCompilationReportingContext context)\n    {\n        foreach (var path in context.WebConfigFiles())\n        {\n            if (File.ReadAllText(path).ParseXDocument() is { } doc)\n            {\n                CheckWebConfig(context, path, doc.Descendants());\n            }\n        }\n    }\n\n    protected void CheckAppSettings(SonarCompilationReportingContext context) =>\n        CheckJsonSettings(context, context.AppSettingsFiles());\n\n    protected void CheckLaunchSettings(SonarCompilationReportingContext context) =>\n        CheckJsonSettings(context, context.LaunchSettingsFiles());\n\n    private void CheckJsonSettings(SonarCompilationReportingContext context, IEnumerable<string> jsonFiles)\n    {\n        foreach (var path in jsonFiles)\n        {\n            if (JsonNode.FromString(File.ReadAllText(path)) is { } json)\n            {\n                var walker = new CredentialWordsJsonWalker(this, context, path);\n                walker.Visit(json);\n            }\n        }\n    }\n\n    private void CheckWebConfig(SonarCompilationReportingContext context, string path, IEnumerable<XElement> elements)\n    {\n        foreach (var element in elements)\n        {\n            if (!element.HasElements && FindIssue(element.Name.LocalName, element.Value) is { } message && element.CreateLocation(path) is { } elementLocation)\n            {\n                context.ReportIssue(Language.GeneratedCodeRecognizer, rule, elementLocation, message);\n            }\n            foreach (var attribute in element.Attributes())\n            {\n                if (FindIssue(attribute.Name.LocalName, attribute.Value) is { } attributeMessage && attribute.CreateLocation(path) is { } attributeLocation)\n                {\n                    context.ReportIssue(Language.GeneratedCodeRecognizer, rule, attributeLocation, attributeMessage);\n                }\n            }\n        }\n    }\n\n    private sealed class CredentialWordsJsonWalker : JsonWalker\n    {\n        private readonly DoNotHardcodeBase<TSyntaxKind> analyzer;\n        private readonly SonarCompilationReportingContext context;\n        private readonly string path;\n\n        public CredentialWordsJsonWalker(DoNotHardcodeBase<TSyntaxKind> analyzer, SonarCompilationReportingContext context, string path)\n        {\n            this.analyzer = analyzer;\n            this.context = context;\n            this.path = path;\n        }\n\n        protected override void VisitObject(string key, JsonNode value)\n        {\n            if (value.Kind == Kind.Value)\n            {\n                CheckKeyValue(key, value);\n            }\n            else\n            {\n                base.VisitObject(key, value);\n            }\n        }\n\n        protected override void VisitValue(JsonNode node) =>\n            CheckKeyValue(null, node);\n\n        private void CheckKeyValue(string key, JsonNode value)\n        {\n            if (value.Value is string str && analyzer.FindIssue(key, str) is { } message)\n            {\n                context.ReportIssue(analyzer.Language.GeneratedCodeRecognizer, analyzer.rule, value.ToLocation(path), message);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/DoNotHardcodeCredentialsBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Security;\nusing System.Text.RegularExpressions;\nusing SonarAnalyzer.CFG.Extensions;\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class DoNotHardcodeCredentialsBase<TSyntaxKind> : DoNotHardcodeBase<TSyntaxKind>\n    where TSyntaxKind : struct\n{\n    private const string MessageFormat = \"{0}\";\n    private const string MessageHardcodedPassword = \"Please review this hard-coded password.\";\n    private const string MessageFormatCredential = @\"\"\"{0}\"\" detected here, make sure this is not a hard-coded credential.\";\n    private const string MessageUriUserInfo = \"Review this hard-coded URI, which may contain a credential.\";\n    private const string DefaultCredentialWords = \"password, passwd, pwd, passphrase\";\n\n    private static readonly Regex UriUserInfoPattern = CreateUriUserInfoPattern();\n\n    protected abstract void InitializeActions(SonarParametrizedAnalysisContext context);\n    protected abstract bool IsSecureStringAppendCharFromConstant(SyntaxNode argumentNode, SemanticModel model);\n\n    [RuleParameter(\"credentialWords\", PropertyType.String, \"Comma separated list of words identifying potential credentials\", DefaultCredentialWords)]\n    public string CredentialWords { get => FilterWords; set => FilterWords = value; }\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(rule);\n    protected override string DiagnosticId => \"S2068\";\n\n    protected DoNotHardcodeCredentialsBase()\n    {\n        rule = Language.CreateDescriptor(DiagnosticId, MessageFormat);\n        CredentialWords = DefaultCredentialWords;   // Property will initialize multiple state variables\n    }\n\n    protected override void ExtractKeyWords(string value)\n    {\n        keyWords = value;\n        splitKeyWords = SplitKeyWordsByComma(keyWords);\n        var credentialWordsPattern = splitKeyWords.Select(Regex.Escape).JoinStr(\"|\");\n        keyWordPattern = new Regex($@\"(?<credential>{credentialWordsPattern})\\s*=\\s*(?<suffix>.+)$\", RegexOptions.IgnoreCase, RegexTimeout);\n    }\n\n    protected sealed override void Initialize(SonarParametrizedAnalysisContext context)\n    {\n        var input = new TrackerInput(context, AnalyzerConfiguration.AlwaysEnabled, rule);\n\n        var oc = Language.Tracker.ObjectCreation;\n        oc.Track(\n            input,\n            [MessageHardcodedPassword],\n            oc.MatchConstructor(KnownType.System_Net_NetworkCredential),\n            oc.ArgumentAtIndexIs(1, KnownType.System_String),\n            oc.ArgumentAtIndexIsConst(1));\n\n        oc.Track(\n            input,\n            [MessageHardcodedPassword],\n            oc.MatchConstructor(KnownType.System_Security_Cryptography_PasswordDeriveBytes),\n            oc.ArgumentAtIndexIs(0, KnownType.System_String),\n            oc.ArgumentAtIndexIsConst(0));\n\n        var pa = Language.Tracker.PropertyAccess;\n        pa.Track(\n            input,\n            [MessageHardcodedPassword],\n            pa.MatchSetter(),\n            pa.AssignedValueIsConstant(),\n            pa.MatchProperty(new MemberDescriptor(KnownType.System_Net_NetworkCredential, \"Password\")));\n\n        var inv = Language.Tracker.Invocation;\n        inv.Track(\n            input,\n            [MessageHardcodedPassword],\n            inv.MatchMethod(new MemberDescriptor(KnownType.System_Security_SecureString, nameof(SecureString.AppendChar))),\n            inv.ArgumentAtIndexIs(0, IsSecureStringAppendCharFromConstant));\n\n        InitializeActions(context);\n        context.RegisterCompilationAction(CheckWebConfig);\n        context.RegisterCompilationAction(CheckAppSettings);\n        context.RegisterCompilationAction(CheckLaunchSettings);\n    }\n\n    protected override string FindIssue(string variableName, string variableValue)\n    {\n        if (string.IsNullOrWhiteSpace(variableValue))\n        {\n            return null;\n        }\n        else if (FindKeyWords(variableName, variableValue) is { } bannedWords and not \"\")\n        {\n            return string.Format(MessageFormatCredential, bannedWords);\n        }\n        else if (ContainsUriUserInfo(variableValue))\n        {\n            return MessageUriUserInfo;\n        }\n        else\n        {\n            return null;\n        }\n    }\n\n    private string FindKeyWords(string variableName, string variableValue)\n    {\n        var credentialWordsFound = variableName\n            .SplitCamelCaseToWords()\n            .Intersect(splitKeyWords)\n            .ToHashSet(StringComparer.OrdinalIgnoreCase);\n\n        if (credentialWordsFound.Any(x => variableValue.IndexOf(x, StringComparison.InvariantCultureIgnoreCase) >= 0))\n        {\n            // See https://github.com/SonarSource/sonar-dotnet/issues/2868\n            return null;\n        }\n\n        if (keyWordPattern.SafeMatch(variableValue) is { Success: true } match && !IsValidKeyword(match.Groups[\"suffix\"].Value))\n        {\n            credentialWordsFound.Add(match.Groups[\"credential\"].Value);\n        }\n\n        // Rule was initially implemented with everything lower (which is wrong) so we have to force lower before reporting to avoid new issues to appear on SQ/SC.\n        return credentialWordsFound.Select(x => x.ToLowerInvariant()).JoinAnd();\n    }\n\n    private static Regex CreateUriUserInfoPattern()\n    {\n        const string Rfc3986_Unreserved = \"-._~\";  // Numbers and letters are embedded in regex itself without escaping\n        const string Rfc3986_Pct = \"%\";\n        const string Rfc3986_SubDelims = \"!$&'()*+,;=\";\n        const string UriPasswordSpecialCharacters = Rfc3986_Unreserved + Rfc3986_Pct + Rfc3986_SubDelims;\n        // See https://tools.ietf.org/html/rfc3986 Userinfo can contain groups: unreserved | pct-encoded | sub-delims\n        var loginGroup = CreateUserInfoGroup(\"Login\");\n        var passwordGroup = CreateUserInfoGroup(\"Password\", \":\");   // Additional \":\" to capture passwords containing it\n        return new Regex(@$\"\\w+:\\/\\/{loginGroup}:{passwordGroup}@\", RegexOptions.Compiled, RegexTimeout);\n\n        static string CreateUserInfoGroup(string name, string additionalCharacters = null) =>\n            $@\"(?<{name}>[\\w\\d{Regex.Escape(UriPasswordSpecialCharacters)}{additionalCharacters}]+)\";\n    }\n\n    private static bool ContainsUriUserInfo(string variableValue)\n    {\n        var match = UriUserInfoPattern.SafeMatch(variableValue);\n        return match.Success\n            && match.Groups[\"Password\"].Value is { } password\n            && !string.Equals(match.Groups[\"Login\"].Value, password, StringComparison.OrdinalIgnoreCase)\n            && password != KeywordSeparator.ToString()\n            && !ValidKeywordPattern.SafeIsMatch(password);\n    }\n\n    protected abstract class CredentialWordsFinderBase<TSyntaxNode>\n        where TSyntaxNode : SyntaxNode\n    {\n        private readonly DoNotHardcodeCredentialsBase<TSyntaxKind> analyzer;\n\n        protected abstract bool ShouldHandle(TSyntaxNode syntaxNode, SemanticModel model);\n        protected abstract string VariableName(TSyntaxNode syntaxNode);\n        protected abstract string AssignedValue(TSyntaxNode syntaxNode, SemanticModel model);\n\n        protected CredentialWordsFinderBase(DoNotHardcodeCredentialsBase<TSyntaxKind> analyzer) =>\n            this.analyzer = analyzer;\n\n        public Action<SonarSyntaxNodeReportingContext> AnalysisAction() =>\n            context =>\n            {\n                var declarator = (TSyntaxNode)context.Node;\n                if (ShouldHandle(declarator, context.Model)\n                    && AssignedValue(declarator, context.Model) is { } variableValue\n                    && analyzer.FindIssue(VariableName(declarator), variableValue) is { } message)\n                {\n                    context.ReportIssue(analyzer.rule, declarator, message);\n                }\n            };\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/DoNotHardcodeSecretsBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text.RegularExpressions;\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class DoNotHardcodeSecretsBase<TSyntaxKind> : DoNotHardcodeBase<TSyntaxKind>\n    where TSyntaxKind : struct\n{\n    protected const string MessageFormat = @\"\"\"{0}\"\" detected here, make sure this is not a hard-coded secret.\";\n    protected const string DefaultSecretWords = @\"api[_\\-]?key, auth, credential, secret, token\";\n    protected const double DefaultRandomnessSensibility = 3;\n    protected const double LanguageScoreIncrement = 0.3;\n    protected const string EqualsName = nameof(string.Equals);\n\n    // https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/generics/generic_high_entropy_secret#:~:text=Follow%20this%20regular%20expression\n    protected static readonly Regex ValidationPattern = new(@\"^[a-zA-Z0-9_.+/~$-]([a-zA-Z0-9_.+\\/=~$-]|\\\\(?![ntr\"\"])){14,1022}[a-zA-Z0-9_.+/=~$-]$\", RegexOptions.None, Constants.DefaultRegexTimeout);\n    protected static readonly Regex BanList = new(@\"public[_.-]?key|document_?key|client[_.-]?id|localhost|127\\.0\\.0\\.1|test|xsrf|csrf\", RegexOptions.IgnoreCase, Constants.DefaultRegexTimeout);\n\n    protected Regex keyWordInVariablePattern;\n\n    protected abstract void RegisterNodeActions(SonarCompilationStartAnalysisContext context);\n    protected abstract SyntaxNode IdentifierRoot(SyntaxNode node);\n    protected abstract SyntaxNode RightHandSide(SyntaxNode node);\n\n    [RuleParameter(\"secretWords\", PropertyType.String, \"Comma separated list of words identifying potential secret\", DefaultSecretWords)]\n    public string SecretWords { get => FilterWords; set => FilterWords = value; }\n\n    [RuleParameter(\"randomnessSensibility\", PropertyType.Float, \"Allows to tune the Randomness Sensibility (from 0 to 10)\", DefaultRandomnessSensibility)]\n    public double RandomnessSensibility { get; set; } = DefaultRandomnessSensibility;\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(rule);\n    protected override string DiagnosticId => \"S6418\";\n\n    protected double MaxLanguageScore => (10 - RandomnessSensibility) * LanguageScoreIncrement;\n\n    protected DoNotHardcodeSecretsBase()\n    {\n        rule = Language.CreateDescriptor(DiagnosticId, MessageFormat);\n        SecretWords = DefaultSecretWords;\n    }\n\n    protected override void Initialize(SonarParametrizedAnalysisContext context)\n    {\n        context.RegisterCompilationStartAction(RegisterNodeActions);\n        context.RegisterCompilationAction(CheckWebConfig);\n        context.RegisterCompilationAction(CheckAppSettings);\n        context.RegisterCompilationAction(CheckLaunchSettings);\n    }\n\n    protected override void ExtractKeyWords(string value)\n    {\n        keyWords = value;\n        splitKeyWords = SplitKeyWordsByComma(keyWords);\n        keyWordPattern = new Regex(splitKeyWords.JoinStr(\"|\"), RegexOptions.IgnoreCase, RegexTimeout);\n        keyWordInVariablePattern = new Regex($@\"(?<secret>\\b\\w*?({keyWordPattern}))\\s*[:=]\\s*(?<suffix>[^\"\";$]+)\", RegexOptions.IgnoreCase, RegexTimeout);\n    }\n\n    protected override string FindIssue(string variableName, string variableValue)\n    {\n        if (ShouldRaiseBinary(variableName, variableValue))\n        {\n            return variableName;\n        }\n        else if (FindLiteralIssue(variableValue) is { } message)\n        {\n            return message;\n        }\n        else\n        {\n            return null;\n        }\n    }\n\n    protected void ReportIssues(SonarSyntaxNodeReportingContext context)\n    {\n        var node = context.Node;\n        if (Language.Syntax.NodeIdentifier(IdentifierRoot(node)) is { } identifier\n            && RightHandSide(node) is { } rhs\n            && Language.FindConstantValue(context.Model, rhs) is string secret)\n        {\n            if (ShouldRaiseBinary(identifier.ValueText, secret))\n            {\n                context.ReportIssue(rule, rhs, identifier.ValueText);\n            }\n            else if (FindLiteralIssue(secret) is { } message)\n            {\n                context.ReportIssue(rule, rhs, message);\n            }\n        }\n    }\n\n    protected void ReportIssuesForEquals(SonarSyntaxNodeReportingContext context, SyntaxNode memberAccessExpression, IdentifierValuePair identifierAndValue)\n    {\n        if (identifierAndValue is { Identifier: { } identifier, Value: { } value }\n            && Language.FindConstantValue(context.Model, value) is string secret\n            && ShouldRaiseBinary(identifier.ValueText, secret))\n        {\n            context.ReportIssue(rule, memberAccessExpression, identifier.ValueText);\n        }\n    }\n\n    private string FindLiteralIssue(string secret)\n    {\n        var variableMatch = keyWordInVariablePattern.SafeMatches(secret);\n        var keyWordsFound = new List<string>();\n        foreach (Match match in variableMatch)\n        {\n            if (match.Success\n                && !IsValidKeyword(match.Groups[\"suffix\"].Value)\n                && ShouldRaiseBinary(match.Groups[\"secret\"].Value, match.Groups[\"suffix\"].Value))\n            {\n                keyWordsFound.Add(match.Groups[\"secret\"].Value);\n            }\n        }\n        return keyWordsFound.Count > 0 ? keyWordsFound.JoinAnd() : null;\n    }\n\n    private bool ShouldRaiseBinary(string left, string right) =>\n        !string.IsNullOrEmpty(left)\n        && keyWordPattern.SafeMatch(left) is { Success: true } keyWord\n        && !BanList.SafeIsMatch(left)\n        && right.IndexOf(keyWord.Value, StringComparison.InvariantCultureIgnoreCase) < 0\n        && IsToken(right);\n\n    private bool IsToken(string value) =>\n        ShannonEntropy.Calculate(value) > RandomnessSensibility\n        && ValidationPattern.SafeIsMatch(value)\n        && MaxLanguageScore > NaturalLanguageDetector.HumanLanguageScore(value);\n\n    protected sealed record IdentifierValuePair(SyntaxToken? Identifier, SyntaxNode Value);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/DoNotInstantiateSharedClassesBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class DoNotInstantiateSharedClassesBase : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S4277\";\n        protected const string MessageFormat = \"Refactor this code so that it doesn't invoke the constructor of this class.\";\n\n        protected static bool IsShared(AttributeData data)\n        {\n            // This is equivalent to System.ComponentModel.Composition.CreationPolicy.Shared,\n            // but we do not want dependency on System.ComponentModel.Composition just for that.\n            const int CreationPolicy_Shared = 1;\n\n            return data.ConstructorArguments.Any(arg =>\n                    arg.Type.Is(KnownType.System_ComponentModel_Composition_CreationPolicy) &&\n                    Equals(arg.Value, CreationPolicy_Shared));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/DoNotLockOnSharedResourceBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class DoNotLockOnSharedResourceBase : SonarDiagnosticAnalyzer\n    {\n        protected const string DiagnosticId = \"S2551\";\n        protected const string MessageFormat = \"Lock on a dedicated object instance instead.\";\n\n        private static readonly ImmutableArray<KnownType> _invalidLockTypes =\n           ImmutableArray.Create(\n               KnownType.System_String,\n               KnownType.System_Type\n           );\n\n        protected static bool IsLockOnForbiddenKnownType(SyntaxNode expression, SemanticModel semanticModel) =>\n            semanticModel.GetTypeInfo(expression).Type.IsAny(_invalidLockTypes);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/DoNotLockWeakIdentityObjectsBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class DoNotLockWeakIdentityObjectsBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n        where TSyntaxKind : struct\n    {\n        protected const string DiagnosticId = \"S3998\";\n\n        private readonly ImmutableArray<KnownType> weakIdentityTypes =\n            ImmutableArray.Create(\n                KnownType.System_MarshalByRefObject,\n                KnownType.System_ExecutionEngineException,\n                KnownType.System_OutOfMemoryException,\n                KnownType.System_StackOverflowException,\n                KnownType.System_String,\n                KnownType.System_IO_FileStream,\n                KnownType.System_Reflection_MemberInfo,\n                KnownType.System_Reflection_ParameterInfo,\n                KnownType.System_Threading_Thread\n            );\n\n        protected abstract TSyntaxKind SyntaxKind { get; }\n\n        protected override string MessageFormat => \"Replace this lock on '{0}' with a lock against an object that cannot be accessed across application domain boundaries.\";\n\n        protected DoNotLockWeakIdentityObjectsBase() : base(DiagnosticId) { }\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(Language.GeneratedCodeRecognizer, c =>\n            {\n                var lockExpression = Language.Syntax.NodeExpression(c.Node);\n                if (c.Model.GetSymbolInfo(lockExpression).Symbol?.GetSymbolType() is { } lockExpressionType && lockExpressionType.DerivesFromAny(weakIdentityTypes))\n                {\n                    c.ReportIssue(Rule, lockExpression, lockExpressionType.Name);\n                }\n            }, SyntaxKind);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/DoNotNestTernaryOperatorsBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class DoNotNestTernaryOperatorsBase : SonarDiagnosticAnalyzer\n    {\n        protected const string DiagnosticId = \"S3358\";\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/DoNotOverwriteCollectionElementsBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class DoNotOverwriteCollectionElementsBase<TSyntaxKind, TStatementSyntax> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n    where TStatementSyntax : SyntaxNode\n{\n    protected const string DiagnosticId = \"S4143\";\n\n    /// <summary>\n    /// Returns the index or key from the provided InvocationExpression or SimpleAssignmentExpression.\n    /// Returns null if the provided SyntaxNode is not an InvocationExpression or SimpleAssignmentExpression.\n    /// </summary>\n    protected abstract SyntaxNode GetIndexOrKey(TStatementSyntax statement);\n\n    /// <summary>\n    /// Returns the identifier of a collection that is modified in the provided InvocationExpression\n    /// or SimpleAssignmentExpression. Returns null if the provided SyntaxNode is not an\n    /// InvocationExpression or SimpleAssignmentExpression.\n    /// </summary>\n    protected abstract SyntaxNode GetCollectionIdentifier(TStatementSyntax statement);\n\n    /// <summary>\n    /// Returns a value specifying whether the provided SyntaxNode is an identifier or\n    /// a literal (string, numeric, bool, etc.).\n    /// </summary>\n    protected abstract bool IsIdentifierOrLiteral(SyntaxNode node);\n\n    protected override string MessageFormat => \"Verify this is the index/key that was intended; \" +\n        \"a value has already been set for it.\";\n\n    private static string SecondaryMessage => \"The index/key set here gets set again later.\";\n\n    protected DoNotOverwriteCollectionElementsBase() : base(DiagnosticId) { }\n\n    protected void AnalysisAction(SonarSyntaxNodeReportingContext context)\n    {\n        var statement = (TStatementSyntax)context.Node;\n        var collectionIdentifier = GetCollectionIdentifier(statement);\n        var indexOrKey = GetIndexOrKey(statement);\n\n        if (collectionIdentifier is null\n            || indexOrKey is null\n            || !IsIdentifierOrLiteral(indexOrKey)\n            || !IsDictionaryOrCollection(collectionIdentifier, context.Model))\n        {\n            return;\n        }\n\n        var previousSet = GetPreviousStatements(statement)\n            .TakeWhile(IsSameCollection(collectionIdentifier))\n            .FirstOrDefault(IsSameIndexOrKey(indexOrKey));\n\n        if (previousSet is not null)\n        {\n            context.ReportIssue(Rule, context.Node, [previousSet.ToSecondaryLocation(SecondaryMessage)]);\n        }\n    }\n\n    private Func<TStatementSyntax, bool> IsSameCollection(SyntaxNode collectionIdentifier) =>\n        x =>\n            GetCollectionIdentifier(x) is { } identifier &&\n            identifier.ToString() == collectionIdentifier.ToString();\n\n    private Func<TStatementSyntax, bool> IsSameIndexOrKey(SyntaxNode indexOrKey) =>\n        x => GetIndexOrKey(x)?.ToString() == indexOrKey.ToString();\n\n    private static bool IsDictionaryOrCollection(SyntaxNode identifier, SemanticModel model)\n    {\n        var identifierType = model.GetTypeInfo(identifier).Type;\n        return identifierType.DerivesOrImplements(KnownType.System_Collections_Generic_IDictionary_TKey_TValue)\n            || identifierType.DerivesOrImplements(KnownType.System_Collections_Generic_ICollection_T);\n    }\n\n    /// <summary>\n    /// Returns all statements before the specified statement within the containing method.\n    /// This method recursively traverses all parent blocks of the provided statement.\n    /// </summary>\n    private static IEnumerable<TStatementSyntax> GetPreviousStatements(TStatementSyntax statement)\n    {\n        var previousStatements = statement.Parent.ChildNodes()\n            .OfType<TStatementSyntax>()\n            .TakeWhile(x => x != statement)\n            .Reverse();\n\n        return statement.Parent is TStatementSyntax parentStatement\n            ? previousStatements.Union(GetPreviousStatements(parentStatement))\n            : previousStatements;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/DoNotThrowFromDestructorsBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class DoNotThrowFromDestructorsBase : SonarDiagnosticAnalyzer\n    {\n        protected const string DiagnosticId = \"S1048\";\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/DoNotUseDateTimeNowBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class DoNotUseDateTimeNowBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n{\n    private const string DiagnosticId = \"S6563\";\n\n    private static readonly MemberDescriptor DateTimeNow = new(KnownType.System_DateTime, nameof(DateTime.Now));\n    private static readonly MemberDescriptor DateTimeToday = new(KnownType.System_DateTime, nameof(DateTime.Today));\n    private static readonly MemberDescriptor DateTimeOffsetNow = new(KnownType.System_DateTimeOffset, nameof(DateTimeOffset.Now));\n    private static readonly MemberDescriptor DateTimeOffsetDate = new(KnownType.System_DateTimeOffset, nameof(DateTimeOffset.Date));\n    private static readonly MemberDescriptor DateTimeOffsetDateTime = new(KnownType.System_DateTimeOffset, nameof(DateTimeOffset.DateTime));\n\n    protected override string MessageFormat => \"Use UTC when recording DateTime instants\";\n\n    protected abstract bool IsInsideNameOf(SyntaxNode node);\n\n    protected DoNotUseDateTimeNowBase() : base(DiagnosticId) { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(Language.GeneratedCodeRecognizer, c =>\n        {\n            if ((IsDateTimeNowOrToday(c.Node, c.Model) || IsDateTimeOffsetNowDateTime(c.Node, c.Model))\n                && !IsInsideNameOf(c.Node))\n                {\n                    c.ReportIssue(Rule, c.Node);\n                }\n        }, Language.SyntaxKind.SimpleMemberAccessExpression);\n\n    private bool IsDateTimeNowOrToday(SyntaxNode node, SemanticModel semanticModel) =>\n        MatchesAnyProperty(node, semanticModel, DateTimeNow, DateTimeToday);\n\n    private bool IsDateTimeOffsetNowDateTime(SyntaxNode node, SemanticModel semanticModel) =>\n        MatchesAnyProperty(node, semanticModel, DateTimeOffsetDateTime, DateTimeOffsetDate)\n        && MatchesAnyProperty(Language.Syntax.NodeExpression(node), semanticModel, DateTimeOffsetNow);\n\n    private bool MatchesAnyProperty(SyntaxNode node, SemanticModel semanticModel, params MemberDescriptor[] members) =>\n        Language.Syntax.NodeIdentifier(node) is { IsMissing: false } identifier\n        && Array.Exists(members, x => MemberDescriptor.MatchesAny(identifier.ValueText, new Lazy<ISymbol>(() => semanticModel.GetSymbolInfo(node).Symbol), false, Language.NameComparison, members));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/EmptyMethodBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class EmptyMethodBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n        where TSyntaxKind : struct\n    {\n        internal const string DiagnosticId = \"S1186\";\n\n        protected abstract HashSet<TSyntaxKind> SyntaxKinds { get; }\n        protected abstract void CheckMethod(SonarSyntaxNodeReportingContext context);\n\n        protected override string MessageFormat => \"Add a nested comment explaining why this method is empty, throw a 'NotSupportedException' or complete the implementation.\";\n\n        protected EmptyMethodBase() : base(DiagnosticId) { }\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(Language.GeneratedCodeRecognizer, CheckMethod, SyntaxKinds.ToArray());\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/EmptyNestedBlockBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class EmptyNestedBlockBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n        where TSyntaxKind : struct\n    {\n        protected const string DiagnosticId = \"S108\";\n\n        protected abstract TSyntaxKind[] SyntaxKinds { get; }\n\n        protected abstract IEnumerable<SyntaxNode> EmptyBlocks(SyntaxNode node);\n\n        protected override string MessageFormat => \"Either remove or fill this block of code.\";\n\n        protected EmptyNestedBlockBase() : base(DiagnosticId) { }\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                Language.GeneratedCodeRecognizer,\n                c =>\n                {\n                    foreach (var node in EmptyBlocks(c.Node))\n                    {\n                        c.ReportIssue(Rule, node);\n                    }\n                },\n                SyntaxKinds);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/EncryptionAlgorithmsShouldBeSecureBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class EncryptionAlgorithmsShouldBeSecureBase<TSyntaxKind> : TrackerHotspotDiagnosticAnalyzer<TSyntaxKind>\n        where TSyntaxKind : struct\n    {\n        protected const string DiagnosticId = \"S5542\";\n        private const string MessageFormat = \"Use secure mode and padding scheme.\";\n\n        protected abstract TrackerBase<TSyntaxKind, PropertyAccessContext>.Condition IsInsideObjectInitializer();\n        protected abstract TrackerBase<TSyntaxKind, InvocationContext>.Condition HasPkcs1PaddingArgument();\n\n        protected EncryptionAlgorithmsShouldBeSecureBase(IAnalyzerConfiguration configuration)\n            : base(configuration, DiagnosticId, MessageFormat) { }\n\n        protected override void Initialize(TrackerInput input)\n        {\n            var inv = Language.Tracker.Invocation;\n            inv.Track(input,\n                inv.MatchMethod(\n                    new MemberDescriptor(KnownType.System_Security_Cryptography_RSA, \"Encrypt\"),\n                    new MemberDescriptor(KnownType.System_Security_Cryptography_RSA, \"TryEncrypt\")),\n                inv.Or(\n                    inv.ArgumentIsBoolConstant(\"fOAEP\", false),\n                    HasPkcs1PaddingArgument()));\n\n            // There exist no GCM mode with AesManaged, so any mode we set will be insecure. We do not raise\n            // when inside an ObjectInitializerExpression, as the issue is already raised on the constructor\n            var pa = Language.Tracker.PropertyAccess;\n            pa.Track(input,\n                pa.MatchProperty(new MemberDescriptor(KnownType.System_Security_Cryptography_AesManaged, \"Mode\")),\n                pa.MatchSetter(),\n                pa.ExceptWhen(IsInsideObjectInitializer()));\n\n            var oc = Language.Tracker.ObjectCreation;\n            oc.Track(input, oc.MatchConstructor(KnownType.System_Security_Cryptography_AesManaged));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/EnumNameHasEnumSuffixBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class EnumNameHasEnumSuffixBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n        where TSyntaxKind : struct\n    {\n        protected const string DiagnosticId = \"S2344\";\n        private readonly IEnumerable<string> nameEndings = ImmutableArray.Create(\"enum\", \"flags\");\n\n        protected override string MessageFormat => \"Rename this enumeration to remove the '{0}' suffix.\";\n\n        protected EnumNameHasEnumSuffixBase() : base(DiagnosticId) { }\n\n        protected sealed override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(Language.GeneratedCodeRecognizer, c =>\n                {\n                    if (Language.Syntax.NodeIdentifier(c.Node) is { } identifier\n                        && nameEndings.FirstOrDefault(ending => identifier.ValueText.EndsWith(ending, System.StringComparison.OrdinalIgnoreCase)) is { } nameEnding)\n                    {\n                        c.ReportIssue(Rule, identifier, identifier.ValueText.Substring(identifier.ValueText.Length - nameEnding.Length));\n                    }\n                },\n                Language.SyntaxKind.EnumDeclaration);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/EnumNameShouldFollowRegexBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.RegularExpressions;\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class EnumNameShouldFollowRegexBase<TSyntaxKind> : ParametrizedDiagnosticAnalyzer\n    where TSyntaxKind : struct\n{\n    protected const string DiagnosticId = \"S2342\";\n    private const string MessageFormat = \"Rename the enumeration '{0}' to match the regular expression: '{1}'.\";\n    private const string DefaultEnumNamePattern = NamingPatterns.PascalCasingPattern;\n    private const string DefaultFlagsEnumNamePattern = \"^\" + NamingPatterns.PascalCasingInternalPattern + \"s$\";\n\n    private readonly DiagnosticDescriptor rule;\n\n    protected abstract ILanguageFacade<TSyntaxKind> Language { get; }\n\n    [RuleParameter(\"format\", PropertyType.String, \"Regular expression used to check the enumeration type names against.\", DefaultEnumNamePattern)]\n    public string EnumNamePattern { get; set; } = DefaultEnumNamePattern;\n\n    [RuleParameter(\"flagsAttributeFormat\", PropertyType.String, \"Regular expression used to check the flags enumeration type names against.\", DefaultFlagsEnumNamePattern)]\n    public string FlagsEnumNamePattern { get; set; } = DefaultFlagsEnumNamePattern;\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(rule);\n\n    protected EnumNameShouldFollowRegexBase() =>\n        rule = Language.CreateDescriptor(DiagnosticId, MessageFormat, isEnabledByDefault: false);\n\n    protected sealed override void Initialize(SonarParametrizedAnalysisContext context) =>\n        context.RegisterNodeAction(Language.GeneratedCodeRecognizer, c =>\n            {\n                var pattern = c.Node.HasFlagsAttribute(c.Model) ? FlagsEnumNamePattern : EnumNamePattern;\n                if (Language.Syntax.NodeIdentifier(c.Node) is { } identifier && !NamingPatterns.IsRegexMatch(identifier.ValueText, pattern, true))\n                {\n                    c.ReportIssue(SupportedDiagnostics[0], identifier, identifier.ValueText, pattern);\n                }\n            },\n            Language.SyntaxKind.EnumDeclaration);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/ExceptionsShouldBePublicBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class ExceptionsShouldBePublicBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n{\n    private const string DiagnosticId = \"S3871\";\n\n    private static readonly KnownType[] BaseTypes = new[]\n    {\n        KnownType.System_Exception,\n        KnownType.System_ApplicationException,\n        KnownType.System_SystemException\n    };\n\n    protected ExceptionsShouldBePublicBase() : base(DiagnosticId) { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            Language.GeneratedCodeRecognizer,\n            c =>\n            {\n                if (c.Model.GetDeclaredSymbol(c.Node) is INamedTypeSymbol classSymbol\n                    && classSymbol.GetEffectiveAccessibility() != Accessibility.Public\n                    && classSymbol.BaseType.IsAny(BaseTypes))\n                {\n                    c.ReportIssue(Rule, Language.Syntax.NodeIdentifier(c.Node).Value);\n                }\n            },\n            Language.SyntaxKind.ClassAndRecordDeclarations);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/ExcludeFromCodeCoverageAttributesNeedJustificationBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class ExcludeFromCodeCoverageAttributesNeedJustificationBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n{\n    private const string DiagnosticId = \"S6513\";\n\n    protected const string JustificationPropertyName = \"Justification\";\n\n    protected override string MessageFormat => \"Add a justification.\";\n\n    protected abstract SyntaxNode GetJustificationExpression(SyntaxNode node);\n\n    protected ExcludeFromCodeCoverageAttributesNeedJustificationBase() : base(DiagnosticId) { }\n\n    protected sealed override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            Language.GeneratedCodeRecognizer,\n            c =>\n            {\n                if (NoJustification(c.Node, c.Model)\n                    && c.Model.GetSymbolInfo(c.Node).Symbol is IMethodSymbol attribute\n                    && attribute.IsInType(KnownType.System_Diagnostics_CodeAnalysis_ExcludeFromCodeCoverageAttribute)\n                    && HasJustificationProperty(attribute.ContainingType))\n                {\n                    c.ReportIssue(Rule, c.Node);\n                }\n            },\n            Language.SyntaxKind.Attribute);\n\n    private bool NoJustification(SyntaxNode node, SemanticModel model) =>\n        GetJustificationExpression(node) is not { } justification\n        || string.IsNullOrWhiteSpace(Language.FindConstantValue(model, justification) as string);\n\n    /// <summary>\"Justification\" was added in .Net 5, while ExcludeFromCodeCoverage in netstandard2.0.</summary>\n    private static bool HasJustificationProperty(INamedTypeSymbol symbol) =>\n        symbol.MemberNames.Contains(JustificationPropertyName);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/ExpectedExceptionAttributeShouldNotBeUsedBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class ExpectedExceptionAttributeShouldNotBeUsedBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n        where TSyntaxKind : struct\n    {\n        internal const string DiagnosticId = \"S3431\";\n\n        protected abstract SyntaxNode FindExpectedExceptionAttribute(SyntaxNode node);\n        protected abstract bool HasMultiLineBody(SyntaxNode node);\n        protected abstract bool AssertInCatchFinallyBlock(SyntaxNode node);\n\n        protected override string MessageFormat => \"Replace the 'ExpectedException' attribute with a throw assertion or a try/catch block.\";\n\n        protected ExpectedExceptionAttributeShouldNotBeUsedBase() : base(DiagnosticId) { }\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterCompilationStartAction(c =>\n            {\n                if (!ContainExpectedExceptionType(c.Compilation))\n                {\n                    return;\n                }\n\n                c.RegisterNodeAction(Language.GeneratedCodeRecognizer, cc =>\n                    {\n                        if (FindExpectedExceptionAttribute(cc.Node) is {} attribute\n                            && HasMultiLineBody(cc.Node)\n                            && !AssertInCatchFinallyBlock(cc.Node))\n                        {\n                            cc.ReportIssue(Rule, attribute);\n                        }\n                    },\n                    Language.SyntaxKind.MethodDeclarations);\n            });\n\n        private static bool ContainExpectedExceptionType(Compilation compilation) =>\n            compilation.GetTypeByMetadataName(KnownType.Microsoft_VisualStudio_TestTools_UnitTesting_ExpectedExceptionAttribute) is not null\n            || compilation.GetTypeByMetadataName(KnownType.NUnit_Framework_ExpectedExceptionAttribute) is not null;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/ExpressionComplexityBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class ExpressionComplexityBase<TSyntaxKind> : ParametrizedDiagnosticAnalyzer\n    where TSyntaxKind : struct, Enum\n{\n    protected const string DiagnosticId = \"S1067\";\n    private const string MessageFormat = \"Reduce the number of conditional operators ({1}) used in the expression (maximum allowed {0}).\";\n    private const int DefaultValueMaximum = 3;\n\n    private readonly DiagnosticDescriptor rule;\n\n    protected abstract ILanguageFacade Language { get; }\n    protected abstract HashSet<TSyntaxKind> ComplexityIncreasingKinds { get; }\n    protected abstract HashSet<TSyntaxKind> TransparentKinds { get; }\n    protected abstract SyntaxNode[] ExpressionChildren(SyntaxNode node);\n\n    [RuleParameter(\"max\", PropertyType.Integer, \"Maximum number of allowed conditional operators in an expression\", DefaultValueMaximum)]\n    public int Maximum { get; set; } = DefaultValueMaximum;\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(rule);\n\n    protected ExpressionComplexityBase() =>\n        rule = Language.CreateDescriptor(DiagnosticId, MessageFormat, isEnabledByDefault: false);\n\n    protected sealed override void Initialize(SonarParametrizedAnalysisContext context) =>\n        context.RegisterNodeAction(\n            Language.GeneratedCodeRecognizer, c =>\n            {\n                if (IsRoot(c.Node) && !IsEqualsMethod(c.ContainingSymbol))\n                {\n                    var complexity = CalculateComplexity(c.Node);\n                    if (complexity > Maximum)\n                    {\n                        c.ReportIssue(rule, c.Node, Maximum.ToString(), complexity.ToString());\n                    }\n                }\n            },\n            ComplexityIncreasingKinds.Concat(TransparentKinds).ToArray());\n\n    private static bool IsEqualsMethod(ISymbol symbol) =>\n        symbol is IMethodSymbol method\n        && (method.IsObjectEquals()\n            || method.IsImplementingInterfaceMember(KnownType.System_IEquatable_T, nameof(IEquatable<>.Equals)));\n\n    private bool IsRoot(SyntaxNode node) =>\n        node?.Parent is null\n        || (node.Parent.Kind<TSyntaxKind>() is var parentKind && !ComplexityIncreasingKinds.Contains(parentKind) && !TransparentKinds.Contains(parentKind));\n\n    private int CalculateComplexity(SyntaxNode node)\n    {\n        var complexity = 0;\n        var stack = new Stack<SyntaxNode>();\n\n        stack.Push(node);\n        while (stack.TryPop(out var current))\n        {\n            if (ComplexityIncreasingKinds.Contains(current.Kind<TSyntaxKind>()))\n            {\n                complexity++;\n            }\n            stack.Push(ExpressionChildren(current));\n        }\n\n        return complexity;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/ExtensionMethodShouldNotExtendObjectBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class ExtensionMethodShouldNotExtendObjectBase<TSyntaxKind, TMethodDeclaration> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n    where TMethodDeclaration : SyntaxNode\n{\n    private const string DiagnosticId = \"S4225\";\n\n    protected override string MessageFormat => \"Refactor this extension to extend a more concrete type.\";\n\n    protected abstract bool IsExtensionMethod(TMethodDeclaration declaration, SemanticModel semanticModel);\n\n    protected ExtensionMethodShouldNotExtendObjectBase() : base(DiagnosticId) { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            Language.GeneratedCodeRecognizer,\n            c =>\n            {\n                if (IsExtensionMethod((TMethodDeclaration)c.Node, c.Model)\n                    && c.Model.GetDeclaredSymbol(c.Node) is IMethodSymbol method\n                    && method.IsExtensionMethod\n                    && method.Parameters.Length > 0\n                    && method.Parameters[0].Type.Is(KnownType.System_Object))\n                {\n                    c.ReportIssue(Rule, Language.Syntax.NodeIdentifier(c.Node).Value);\n                }\n            },\n            Language.SyntaxKind.MethodDeclarations);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/FieldShadowsParentFieldBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\n[Obsolete(\"This rule has been deprecated since 9.32\")]\npublic abstract class FieldShadowsParentFieldBase<TSyntaxKind, TVariableDeclaratorSyntax> : SonarDiagnosticAnalyzer\n    where TSyntaxKind : struct\n    where TVariableDeclaratorSyntax : SyntaxNode\n{\n    private const string S2387DiagnosticId = \"S2387\";\n    private const string S2387MessageFormat = \"'{0}' is the name of a field in '{1}'.\";\n    private const string S4025DiagnosticId = \"S4025\";\n    private const string S4025MessageFormat = \"Rename this field; it may be confused with '{0}' in '{1}'.\";\n\n    private readonly DiagnosticDescriptor s2387;\n    private readonly DiagnosticDescriptor s4025;\n\n    protected abstract ILanguageFacade<TSyntaxKind> Language { get; }\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(s2387, s4025);\n\n    protected FieldShadowsParentFieldBase()\n    {\n        s2387 = Language.CreateDescriptor(S2387DiagnosticId, S2387MessageFormat);\n        s4025 = Language.CreateDescriptor(S4025DiagnosticId, S4025MessageFormat);\n    }\n\n    protected IEnumerable<Diagnostic> CheckFields(SemanticModel model, TVariableDeclaratorSyntax variableDeclarator)\n    {\n        if (model.GetDeclaredSymbol(variableDeclarator) is IFieldSymbol fieldSymbol)\n        {\n            var fieldName = fieldSymbol.Name;\n            foreach (var baseType in fieldSymbol.ContainingType.BaseType.GetSelfAndBaseTypes())\n            {\n                var similarFields = baseType.GetMembers().OfType<IFieldSymbol>().Where(IsMatch).ToList();\n                if (similarFields.Any(x => x.Name == fieldName))\n                {\n                    yield return Diagnostic.Create(s2387, Language.Syntax.NodeIdentifier(variableDeclarator).Value.GetLocation(), fieldName, baseType.Name);\n                }\n                else if (similarFields.Any())\n                {\n                    yield return Diagnostic.Create(s4025, Language.Syntax.NodeIdentifier(variableDeclarator).Value.GetLocation(), similarFields.First().Name, baseType.Name);\n                }\n            }\n\n            bool IsMatch(IFieldSymbol field) =>\n                field.DeclaredAccessibility != Accessibility.Private\n                && !field.IsStatic\n                && field.Name.Equals(fieldName, StringComparison.OrdinalIgnoreCase);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/FieldShouldNotBePublicBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class FieldShouldNotBePublicBase<TSyntaxKind, TFieldDeclarationSyntax, TVariableSyntax> : SonarDiagnosticAnalyzer<TSyntaxKind>\n        where TSyntaxKind : struct\n        where TFieldDeclarationSyntax : SyntaxNode\n        where TVariableSyntax : SyntaxNode\n    {\n        private const string DiagnosticId = \"S2357\";\n\n        protected abstract IEnumerable<TVariableSyntax> Variables(TFieldDeclarationSyntax fieldDeclaration);\n\n        protected override string MessageFormat => \"Make '{0}' private.\";\n\n        protected FieldShouldNotBePublicBase() : base(DiagnosticId) { }\n\n        protected static bool FieldIsRelevant(IFieldSymbol fieldSymbol) =>\n            fieldSymbol is { IsStatic: false, IsConst: false }\n            && fieldSymbol.GetEffectiveAccessibility() == Accessibility.Public\n            && fieldSymbol.ContainingType.IsClass();\n\n        protected sealed override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                Language.GeneratedCodeRecognizer,\n                c =>\n                {\n                    var fieldDeclaration = (TFieldDeclarationSyntax)c.Node;\n                    var variables = Variables(fieldDeclaration);\n\n                    foreach (var variable in variables.Select(x => new Pair(x, c.Model.GetDeclaredSymbol(x) as IFieldSymbol)).Where(x => FieldIsRelevant(x.Symbol)))\n                    {\n                        var identifier = Language.Syntax.NodeIdentifier(variable.Node);\n                        c.ReportIssue(Rule, identifier.Value, identifier.Value.ValueText);\n                    }\n                },\n                Language.SyntaxKind.FieldDeclaration);\n\n        private sealed record Pair(TVariableSyntax Node, IFieldSymbol Symbol);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/FileLinesBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class FileLinesBase : ParametrizedDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S104\";\n        internal const string MessageFormat = \"This file has {1} lines, which is greater than {0} authorized. Split it into \" +\n            \"smaller files.\";\n\n        private const int DefaultValueMaximum = 1000;\n\n        [RuleParameter(\"maximumFileLocThreshold\", PropertyType.Integer, \"Maximum authorized lines in a file.\",\n            DefaultValueMaximum)]\n        public int Maximum { get; set; } = DefaultValueMaximum;\n\n        protected override void Initialize(SonarParametrizedAnalysisContext context)\n        {\n            context.RegisterTreeAction(\n                GeneratedCodeRecognizer,\n                stac =>\n                {\n                    var linesCount = stac.Tree\n                        .GetRoot()\n                        .DescendantTokens()\n                        .Where(token => !IsEndOfFileToken(token))\n                        .SelectMany(token => token.LineNumbers(isZeroBasedCount: false))\n                        .Distinct()\n                        .LongCount();\n\n                    if (linesCount > Maximum)\n                    {\n                        stac.ReportIssue(SupportedDiagnostics[0], Location.Create(stac.Tree, TextSpan.FromBounds(0, 0)), Maximum.ToString(), linesCount.ToString());\n                    }\n                });\n        }\n\n        protected abstract GeneratedCodeRecognizer GeneratedCodeRecognizer { get; }\n        protected abstract bool IsEndOfFileToken(SyntaxToken token);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/FindInsteadOfFirstOrDefaultBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class FindInsteadOfFirstOrDefaultBase<TSyntaxKind, TInvocationExpression> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n    where TInvocationExpression : SyntaxNode\n{\n    private const string DiagnosticId = \"S6602\";\n    private const int NumberOfArgument = 1;\n    private const string GenericMessage = @\"\"\"Find\"\" method should be used instead of the \"\"FirstOrDefault\"\" extension method.\";\n    private const string ArrayMessage = @\"\"\"Array.Find\"\" static method should be used instead of the \"\"FirstOrDefault\"\" extension method.\";\n\n    protected override string MessageFormat => \"{0}\";\n\n    private static readonly ImmutableArray<KnownType> ListTypes = ImmutableArray.Create(\n        KnownType.System_Collections_Generic_List_T,\n        KnownType.System_Collections_Immutable_ImmutableList_T);\n\n    protected FindInsteadOfFirstOrDefaultBase() : base(DiagnosticId) { }\n\n    protected sealed override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(Language.GeneratedCodeRecognizer, c =>\n            {\n                var invocation = (TInvocationExpression)c.Node;\n\n                if (Language.GetName(invocation).Equals(nameof(Enumerable.FirstOrDefault), Language.NameComparison)\n                    && Language.Syntax.HasExactlyNArguments(invocation, NumberOfArgument)\n                    && Language.Syntax.Operands(invocation) is { Left: { } left, Right: { } right }\n                    && IsCorrectCall(right, c.Model)\n                    && IsCorrectType(left, c.Model, out var isArray)\n                    && !Language.Syntax.IsInExpressionTree(c.Model, invocation))\n                {\n                    c.ReportIssue(Rule, Language.Syntax.NodeIdentifier(invocation)?.GetLocation(), isArray ? ArrayMessage : GenericMessage);\n                }\n            },\n            Language.SyntaxKind.InvocationExpression);\n\n    private static bool IsCorrectCall(SyntaxNode right, SemanticModel model) =>\n        model.GetSymbolInfo(right).Symbol is IMethodSymbol method\n        && method.IsExtensionOn(KnownType.System_Collections_Generic_IEnumerable_T)\n        && method.Parameters.Length == NumberOfArgument\n        && method.Parameters[0].IsType(KnownType.System_Func_T_TResult);\n\n    private static bool IsCorrectType(SyntaxNode left, SemanticModel model, out bool isArray)\n    {\n        var type = model.GetTypeInfo(left).Type;\n        isArray = type.DerivesFrom(KnownType.System_Array);\n        return isArray || type.DerivesFromAny(ListTypes);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/FlagsEnumWithoutInitializerBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class FlagsEnumWithoutInitializerBase<TSyntaxKind, TEnumMemberDeclarationSyntax> : SonarDiagnosticAnalyzer<TSyntaxKind>\n        where TSyntaxKind : struct\n        where TEnumMemberDeclarationSyntax : SyntaxNode\n    {\n        protected const string DiagnosticId = \"S2345\";\n        private const int AllowedEmptyMemberCount = 3;\n\n        protected abstract bool IsInitialized(TEnumMemberDeclarationSyntax member);\n\n        protected override string MessageFormat => \"Initialize all the members of this 'Flags' enumeration.\";\n\n        protected FlagsEnumWithoutInitializerBase() : base(DiagnosticId) { }\n\n        protected sealed override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(Language.GeneratedCodeRecognizer, c =>\n                {\n                    if (c.Node.HasFlagsAttribute(c.Model) && !AreAllRequiredMembersInitialized(c.Node) && Language.Syntax.NodeIdentifier(c.Node) is { } identifier)\n                    {\n                        c.ReportIssue(Rule, identifier);\n                    }\n                },\n                Language.SyntaxKind.EnumDeclaration);\n\n        private bool AreAllRequiredMembersInitialized(SyntaxNode declaration)\n        {\n            var members = Language.Syntax.EnumMembers(declaration).Cast<TEnumMemberDeclarationSyntax>().ToList();\n            var firstNonInitialized = members.FirstOrDefault(m => !IsInitialized(m));\n            if (firstNonInitialized == null)\n            {\n                // All members initialized\n                return true;\n            }\n\n            var firstInitialized = members.FirstOrDefault(m => IsInitialized(m));\n            if (firstInitialized == null)\n            {\n                // No members initialized\n                return members.Count <= AllowedEmptyMemberCount;\n            }\n\n            var firstInitializedIndex = members.IndexOf(firstInitialized);\n            if (firstInitializedIndex >= AllowedEmptyMemberCount || members.IndexOf(firstNonInitialized) > firstInitializedIndex)\n            {\n                // Have first uninitialized member after the first initialized member, or\n                // Have too many uninitialized in the beginning\n                return false;\n            }\n            return members.Skip(firstInitializedIndex).All(m => IsInitialized(m));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/FlagsEnumZeroMemberBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class FlagsEnumZeroMemberBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n        where TSyntaxKind : struct\n    {\n        protected const string DiagnosticId = \"S2346\";\n        protected override string MessageFormat => \"Rename '{0}' to 'None'.\";\n\n        protected FlagsEnumZeroMemberBase() : base(DiagnosticId) { }\n\n        protected sealed override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(Language.GeneratedCodeRecognizer, c =>\n                {\n                    if (c.Node.HasFlagsAttribute(c.Model)\n                        && ZeroMember(c.Node, c.Model) is { } zeroMember\n                        && Language.Syntax.NodeIdentifier(zeroMember) is { } identifier\n                        && identifier.ValueText != \"None\")\n                    {\n                        c.ReportIssue(Rule, zeroMember, identifier.ValueText);\n                    }\n                },\n                Language.SyntaxKind.EnumDeclaration);\n\n        private SyntaxNode ZeroMember(SyntaxNode node, SemanticModel semanticModel)\n        {\n            foreach (var item in Language.Syntax.EnumMembers(node))\n            {\n                if (semanticModel.GetDeclaredSymbol(item) is IFieldSymbol symbol && symbol.ConstantValue is { } constValue)\n                {\n                    try\n                    {\n                        if (Convert.ToInt64(constValue) == 0)\n                        {\n                            return item;\n                        }\n                    }\n                    catch (OverflowException)\n                    {\n                        return null;\n                    }\n                }\n            }\n            return null;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/FunctionComplexityBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class FunctionComplexityBase : ParametrizedDiagnosticAnalyzer\n    {\n        protected const string DiagnosticId = \"S1541\";\n        protected const string MessageFormat = \"The Cyclomatic Complexity of this {2} is {1} which is greater than {0} authorized.\";\n\n        protected const int DefaultValueMaximum = 10;\n\n        [RuleParameter(\"maximumFunctionComplexityThreshold\", PropertyType.Integer, \"The maximum authorized complexity.\", DefaultValueMaximum)]\n        public int Maximum { get; set; } = DefaultValueMaximum;\n\n        protected abstract GeneratedCodeRecognizer GeneratedCodeRecognizer { get; }\n\n        protected abstract override void Initialize(SonarParametrizedAnalysisContext context);\n\n        protected void CheckComplexity<TSyntax>(SonarSyntaxNodeReportingContext context, Func<TSyntax, SyntaxNode> nodeSelector, Func<TSyntax, Location> location,\n            string declarationType)\n            where TSyntax : SyntaxNode\n        {\n            var syntax = (TSyntax)context.Node;\n            var nodeToAnalyze = nodeSelector(syntax);\n            if (nodeToAnalyze == null)\n            {\n                return;\n            }\n\n            var complexity = GetComplexity(nodeToAnalyze, context.Model);\n            if (complexity > Maximum)\n            {\n                context.ReportIssue(SupportedDiagnostics[0], location(syntax), Maximum.ToString(), complexity.ToString(), declarationType);\n            }\n        }\n\n        protected void CheckComplexity<TSyntax>(SonarSyntaxNodeReportingContext context, Func<TSyntax, Location> location,\n            string declarationType)\n            where TSyntax : SyntaxNode\n        {\n            CheckComplexity(context, t => t, location, declarationType);\n        }\n\n        protected abstract int GetComplexity(SyntaxNode node, SemanticModel semanticModel);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/FunctionNestingDepthBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class FunctionNestingDepthBase : ParametrizedDiagnosticAnalyzer\n    {\n        protected const string DiagnosticId = \"S134\";\n        private const string MessageFormat = \"Refactor this code to not nest more than {0} control flow statements.\";\n        private const int DefaultValueMaximum = 3;\n\n        protected readonly DiagnosticDescriptor rule;\n\n        protected abstract ILanguageFacade Language { get; }\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(rule);\n\n        [RuleParameter(\"maximumNestingLevel\", PropertyType.Integer, \"Maximum allowed control flow statement nesting depth.\", DefaultValueMaximum)]\n        public int Maximum { get; set; } = DefaultValueMaximum;\n\n        protected FunctionNestingDepthBase() =>\n            rule = Language.CreateDescriptor(DiagnosticId, MessageFormat, isEnabledByDefault: false);\n\n        protected class NestingDepthCounter\n        {\n            private readonly int maximumNestingDepth;\n            private readonly Action<SyntaxToken> actionMaximumExceeded;\n            private int currentDepth;\n\n            public NestingDepthCounter(int maximumNestingDepth, Action<SyntaxToken> actionMaximumExceeded)\n            {\n                this.maximumNestingDepth = maximumNestingDepth;\n                this.actionMaximumExceeded = actionMaximumExceeded;\n            }\n\n            public void CheckNesting(SyntaxToken keyword, Action visitAction)\n            {\n                currentDepth++;\n                if (currentDepth <= maximumNestingDepth)\n                {\n                    visitAction();\n                }\n                else\n                {\n                    actionMaximumExceeded(keyword);\n                }\n                currentDepth--;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/GenericInheritanceShouldNotBeRecursiveBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class GenericInheritanceShouldNotBeRecursiveBase<TSyntaxKind, TDeclaration> : SonarDiagnosticAnalyzer<TSyntaxKind>\n        where TSyntaxKind : struct\n        where TDeclaration : SyntaxNode\n    {\n        protected const string DiagnosticId = \"S3464\";\n\n        protected abstract TSyntaxKind[] SyntaxKinds { get; }\n\n        protected abstract INamedTypeSymbol GetNamedTypeSymbol(TDeclaration declaration, SemanticModel semanticModel);\n        protected abstract Location GetLocation(TDeclaration declaration);\n        protected abstract SyntaxToken GetKeyword(TDeclaration declaration);\n\n        protected override string MessageFormat => \"Refactor this {0} so that the generic inheritance chain is not recursive.\";\n\n        protected GenericInheritanceShouldNotBeRecursiveBase() : base(DiagnosticId) { }\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(Language.GeneratedCodeRecognizer,\n                c =>\n                {\n                    var declaration = (TDeclaration)c.Node;\n\n                    if (!c.IsRedundantPositionalRecordContext()\n                        && IsRecursiveInheritance(GetNamedTypeSymbol(declaration, c.Model)))\n                    {\n                        c.ReportIssue(Rule, GetLocation(declaration), GetKeyword(declaration).ValueText);\n                    }\n                },\n                SyntaxKinds);\n\n        private static IEnumerable<INamedTypeSymbol> GetBaseTypes(INamedTypeSymbol typeSymbol)\n        {\n            var interfaces = typeSymbol.Interfaces.Where(IsGenericType);\n            return typeSymbol.IsClass()\n                ? interfaces.Concat(new[] { typeSymbol.BaseType })\n                : interfaces;\n        }\n\n        private static bool HasRecursiveGenericSubstitution(INamedTypeSymbol typeSymbol, INamedTypeSymbol declaredType)\n        {\n            bool IsSameAsDeclaredType(INamedTypeSymbol type) =>\n                type.OriginalDefinition.Equals(declaredType) && HasSubstitutedTypeArguments(type);\n\n            bool ContainsRecursiveGenericSubstitution(IEnumerable<ITypeSymbol> types) =>\n                types.OfType<INamedTypeSymbol>()\n                    .Any(type => IsSameAsDeclaredType(type) || ContainsRecursiveGenericSubstitution(type.TypeArguments));\n\n            return ContainsRecursiveGenericSubstitution(typeSymbol.TypeArguments);\n        }\n\n        private static bool IsGenericType(INamedTypeSymbol type) =>\n            type != null && type.IsGenericType;\n\n        private static bool HasSubstitutedTypeArguments(INamedTypeSymbol type) =>\n            type.TypeArguments.OfType<INamedTypeSymbol>().Any();\n\n        private static bool IsRecursiveInheritance(INamedTypeSymbol typeSymbol)\n        {\n            if (!IsGenericType(typeSymbol))\n            {\n                return false;\n            }\n\n            var baseTypes = GetBaseTypes(typeSymbol);\n\n            return baseTypes.Any(t => IsGenericType(t) && HasRecursiveGenericSubstitution(t, typeSymbol));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/GotoStatementBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class GotoStatementBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n        where TSyntaxKind : struct\n    {\n        private const string DiagnosticId = \"S907\";\n\n        protected override string MessageFormat => $\"Remove this use of '{GoToLabel}'.\";\n\n        protected abstract TSyntaxKind[] GotoSyntaxKinds { get; }\n        protected abstract string GoToLabel { get; }\n\n        protected GotoStatementBase() : base(DiagnosticId) { }\n\n        protected sealed override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                Language.GeneratedCodeRecognizer,\n                c => c.ReportIssue(Rule, c.Node.GetFirstToken()),\n                GotoSyntaxKinds);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/Hotspots/CommandPathBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text.RegularExpressions;\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class CommandPathBase<TSyntaxKind> : TrackerHotspotDiagnosticAnalyzer<TSyntaxKind>\n        where TSyntaxKind : struct\n    {\n        protected const string DiagnosticId = \"S4036\";\n        private const string MessageFormat = \"\"\"Make sure the \"PATH\" variable only contains fixed, unwriteable directories.\"\"\";\n\n        private readonly Regex validPath = new Regex(@\"^(\\.{0,2}[\\\\/]|\\w+:)\", RegexOptions.None, Constants.DefaultRegexTimeout);\n\n        protected abstract string FirstArgument(InvocationContext context);\n\n        protected CommandPathBase(IAnalyzerConfiguration configuration) : base(configuration, DiagnosticId, MessageFormat) { }\n\n        protected override void Initialize(TrackerInput input)\n        {\n            var inv = Language.Tracker.Invocation;\n            inv.Track(input,\n                inv.MatchMethod(new MemberDescriptor(KnownType.System_Diagnostics_Process, \"Start\")),\n                c => IsInvalid(FirstArgument(c)));\n\n            var pa = Language.Tracker.PropertyAccess;\n            pa.Track(input,\n                pa.MatchProperty(new MemberDescriptor(KnownType.System_Diagnostics_ProcessStartInfo, \"FileName\")),\n                pa.MatchSetter(),\n                c => IsInvalid((string)pa.AssignedValue(c)));\n\n            var oc = Language.Tracker.ObjectCreation;\n            oc.Track(input,\n                oc.MatchConstructor(KnownType.System_Diagnostics_ProcessStartInfo),\n                c => oc.ConstArgumentForParameter(c, \"fileName\") is string value && IsInvalid(value));\n        }\n\n        private bool IsInvalid(string path) =>\n            !string.IsNullOrEmpty(path) && !validPath.SafeIsMatch(path);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/Hotspots/ConfiguringLoggersBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    [Obsolete(\"This rule has been deprecated since 9.16\")]\n    public abstract class ConfiguringLoggersBase<TSyntaxKind> : TrackerHotspotDiagnosticAnalyzer<TSyntaxKind>\n        where TSyntaxKind : struct\n    {\n        protected const string DiagnosticId = \"S4792\";\n        protected const string MessageFormat = \"Make sure that this logger's configuration is safe.\";\n\n        protected ConfiguringLoggersBase(IAnalyzerConfiguration configuration) : base(configuration, DiagnosticId, MessageFormat) { }\n\n        protected override void Initialize(TrackerInput input)\n        {\n            var inv = Language.Tracker.Invocation;\n            var pa = Language.Tracker.PropertyAccess;\n            var oc = Language.Tracker.ObjectCreation;\n            // ASP.NET Core\n            inv.Track(\n                input,\n                inv.MatchMethod(\n                    new MemberDescriptor(KnownType.Microsoft_AspNetCore_Hosting_WebHostBuilderExtensions, \"ConfigureLogging\"),\n                    new MemberDescriptor(KnownType.Microsoft_Extensions_DependencyInjection_LoggingServiceCollectionExtensions, \"AddLogging\"),\n                    new MemberDescriptor(KnownType.Microsoft_Extensions_Logging_ConsoleLoggerExtensions, \"AddConsole\"),\n                    new MemberDescriptor(KnownType.Microsoft_Extensions_Logging_DebugLoggerFactoryExtensions, \"AddDebug\"),\n                    new MemberDescriptor(KnownType.Microsoft_Extensions_Logging_EventLoggerFactoryExtensions, \"AddEventLog\"),\n                    new MemberDescriptor(KnownType.Microsoft_Extensions_Logging_EventLoggerFactoryExtensions, \"AddEventSourceLogger\"),\n                    new MemberDescriptor(KnownType.Microsoft_Extensions_Logging_EventSourceLoggerFactoryExtensions, \"AddEventSourceLogger\"),\n                    new MemberDescriptor(KnownType.Microsoft_Extensions_Logging_AzureAppServicesLoggerFactoryExtensions, \"AddAzureWebAppDiagnostics\")),\n                inv.MethodIsExtension());\n\n            oc.Track(input, oc.WhenImplements(KnownType.Microsoft_Extensions_Logging_ILoggerFactory));\n\n            // log4net\n            inv.Track(\n                input,\n                inv.MatchMethod(\n                    new MemberDescriptor(KnownType.log4net_Config_XmlConfigurator, \"Configure\"),\n                    new MemberDescriptor(KnownType.log4net_Config_XmlConfigurator, \"ConfigureAndWatch\"),\n                    new MemberDescriptor(KnownType.log4net_Config_DOMConfigurator, \"Configure\"),\n                    new MemberDescriptor(KnownType.log4net_Config_DOMConfigurator, \"ConfigureAndWatch\"),\n                    new MemberDescriptor(KnownType.log4net_Config_BasicConfigurator, \"Configure\")));\n\n            // NLog\n            pa.Track(\n                input,\n                pa.MatchSetter(),\n                pa.MatchProperty(new MemberDescriptor(KnownType.NLog_LogManager, \"Configuration\")));\n\n            // Serilog\n            oc.Track(\n                input,\n                oc.WhenDerivesFrom(KnownType.Serilog_LoggerConfiguration));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/Hotspots/CreatingHashAlgorithmsBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class CreatingHashAlgorithmsBase<TSyntaxKind> : TrackerHotspotDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n{\n    protected const string DiagnosticId = \"S4790\";\n    protected const string MessageFormat = \"Make sure this weak hash algorithm is not used in a sensitive context here.\";\n\n    private const string CreateMethodName = \"Create\";\n    private const string HashDataName = \"HashData\";\n    private const string HashDataAsyncName = \"HashDataAsync\";\n    private const string TryHashDataName = \"TryHashData\";\n\n    private readonly KnownType[] algorithmTypes =\n    [\n        KnownType.System_Security_Cryptography_DSA,\n        KnownType.System_Security_Cryptography_HMACMD5,\n        KnownType.System_Security_Cryptography_HMACRIPEMD160,\n        KnownType.System_Security_Cryptography_HMACSHA1,\n        KnownType.System_Security_Cryptography_MD5,\n        KnownType.System_Security_Cryptography_RIPEMD160,\n        KnownType.System_Security_Cryptography_SHA1\n    ];\n\n    private readonly string[] unsafeAlgorithms =\n    [\n        \"DSA\",\n        \"System.Security.Cryptography.DSA\",\n        \"HMACMD5\",\n        \"System.Security.Cryptography.HMACMD5\",\n        \"HMACRIPEMD160\",\n        \"System.Security.Cryptography.HMACRIPEMD160\",\n        \"HMACSHA1\",\n        \"System.Security.Cryptography.HMACSHA1\",\n        \"MD5\",\n        \"System.Security.Cryptography.MD5\",\n        \"RIPEMD160\",\n        \"System.Security.Cryptography.RIPEMD160\",\n        \"SHA1\",\n        \"System.Security.Cryptography.SHA1\",\n    ];\n\n    protected abstract bool IsUnsafeAlgorithm(SyntaxNode argumentNode, SemanticModel model);\n\n    protected CreatingHashAlgorithmsBase(IAnalyzerConfiguration configuration)\n        : base(configuration, DiagnosticId, MessageFormat) { }\n\n    protected override void Initialize(TrackerInput input)\n    {\n        var oc = Language.Tracker.ObjectCreation;\n        oc.Track(input, oc.WhenDerivesOrImplementsAny(algorithmTypes));\n\n        var tracker = Language.Tracker.Invocation;\n        tracker.Track(\n            input,\n            tracker.MatchMethod(\n                new MemberDescriptor(KnownType.System_Security_Cryptography_DSA,       CreateMethodName),\n                new MemberDescriptor(KnownType.System_Security_Cryptography_HMAC,      CreateMethodName),\n                new MemberDescriptor(KnownType.System_Security_Cryptography_MD5,       CreateMethodName),\n                new MemberDescriptor(KnownType.System_Security_Cryptography_RIPEMD160, CreateMethodName),\n                new MemberDescriptor(KnownType.System_Security_Cryptography_SHA1,      CreateMethodName)),\n            tracker.MethodHasParameters(0));\n\n        tracker.Track(\n            input,\n            tracker.MatchMethod(\n                new MemberDescriptor(KnownType.System_Security_Cryptography_AsymmetricAlgorithm, CreateMethodName),\n                new MemberDescriptor(KnownType.System_Security_Cryptography_CryptoConfig,        \"CreateFromName\"),\n                new MemberDescriptor(KnownType.System_Security_Cryptography_DSA,                 CreateMethodName),\n                new MemberDescriptor(KnownType.System_Security_Cryptography_HashAlgorithm,       CreateMethodName),\n                new MemberDescriptor(KnownType.System_Security_Cryptography_HMAC,                CreateMethodName),\n                new MemberDescriptor(KnownType.System_Security_Cryptography_KeyedHashAlgorithm,  CreateMethodName),\n                new MemberDescriptor(KnownType.System_Security_Cryptography_MD5,                 CreateMethodName),\n                new MemberDescriptor(KnownType.System_Security_Cryptography_RIPEMD160,           CreateMethodName),\n                new MemberDescriptor(KnownType.System_Security_Cryptography_SHA1,                CreateMethodName)),\n            tracker.ArgumentAtIndexIsAny(0, unsafeAlgorithms));\n\n        tracker.Track(\n            input,\n            tracker.MatchMethod(\n                new MemberDescriptor(KnownType.System_Security_Cryptography_MD5,  HashDataName),\n                new MemberDescriptor(KnownType.System_Security_Cryptography_MD5,  TryHashDataName),\n                new MemberDescriptor(KnownType.System_Security_Cryptography_MD5,  HashDataAsyncName),\n                new MemberDescriptor(KnownType.System_Security_Cryptography_SHA1, HashDataName),\n                new MemberDescriptor(KnownType.System_Security_Cryptography_SHA1, TryHashDataName),\n                new MemberDescriptor(KnownType.System_Security_Cryptography_SHA1, HashDataAsyncName)));\n\n        tracker.Track(\n            input,\n            tracker.MatchMethod(\n                new MemberDescriptor(KnownType.System_Security_Cryptography_CryptographicOperations, HashDataName),\n                new MemberDescriptor(KnownType.System_Security_Cryptography_CryptographicOperations, HashDataAsyncName),\n                new MemberDescriptor(KnownType.System_Security_Cryptography_CryptographicOperations, TryHashDataName),\n                new MemberDescriptor(KnownType.System_Security_Cryptography_CryptographicOperations, \"HmacData\"),\n                new MemberDescriptor(KnownType.System_Security_Cryptography_CryptographicOperations, \"HmacDataAsync\"),\n                new MemberDescriptor(KnownType.System_Security_Cryptography_CryptographicOperations, \"TryHmacData\")),\n            tracker.ArgumentAtIndexIs(0, IsUnsafeAlgorithm));\n\n        tracker.Track(\n            input,\n            tracker.MatchMethod(\n                new MemberDescriptor(KnownType.System_Security_Cryptography_DSA, HashDataName)),\n            tracker.ArgumentAtIndexIs(1, IsUnsafeAlgorithm));\n\n        tracker.Track(\n            input,\n            tracker.MatchMethod(\n                new MemberDescriptor(KnownType.System_Security_Cryptography_DSA, TryHashDataName)),\n            tracker.ArgumentAtIndexIs(2, IsUnsafeAlgorithm));\n\n        tracker.Track(\n            input,\n            tracker.MatchMethod(new MemberDescriptor(KnownType.System_Security_Cryptography_DSA, HashDataName)),\n            tracker.ArgumentAtIndexIs(3, IsUnsafeAlgorithm));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/Hotspots/DeliveringDebugFeaturesInProductionBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class DeliveringDebugFeaturesInProductionBase<TSyntaxKind> : TrackerHotspotDiagnosticAnalyzer<TSyntaxKind>\n        where TSyntaxKind : struct\n    {\n        private const string DiagnosticId = \"S4507\";\n        protected const string StartupDevelopment = \"StartupDevelopment\";\n        private const string MessageFormat = \"Make sure this debug feature is deactivated before delivering the code in production.\";\n\n        private readonly ImmutableArray<MemberDescriptor> isDevelopmentMethods = ImmutableArray.Create(\n            new MemberDescriptor(KnownType.Microsoft_AspNetCore_Hosting_HostingEnvironmentExtensions, \"IsDevelopment\"),\n            new MemberDescriptor(KnownType.Microsoft_Extensions_Hosting_HostEnvironmentEnvExtensions, \"IsDevelopment\"));\n\n        protected abstract bool IsDevelopmentCheckInvoked(SyntaxNode node, SemanticModel semanticModel);\n\n        protected abstract bool IsInDevelopmentContext(SyntaxNode node);\n\n        protected DeliveringDebugFeaturesInProductionBase(IAnalyzerConfiguration configuration)\n            : base(configuration, DiagnosticId, MessageFormat) { }\n\n        protected override void Initialize(TrackerInput input)\n        {\n            var t = Language.Tracker.Invocation;\n            t.Track(input,\n                    t.MatchMethod(new MemberDescriptor(KnownType.Microsoft_AspNetCore_Builder_DeveloperExceptionPageExtensions, \"UseDeveloperExceptionPage\"),\n                                  new MemberDescriptor(KnownType.Microsoft_AspNetCore_Builder_DatabaseErrorPageExtensions, \"UseDatabaseErrorPage\")),\n                    t.ExceptWhen(c => IsDevelopmentCheckInvoked(c.Node, c.Model)),\n                    t.ExceptWhen(c => IsInDevelopmentContext(c.Node)));\n        }\n\n        protected bool IsValidationMethod(SemanticModel semanticModel, SyntaxNode condition, string methodName) =>\n            new Lazy<IMethodSymbol>(() => semanticModel.GetSymbolInfo(condition).Symbol as IMethodSymbol) is var lazySymbol\n            && isDevelopmentMethods.Any(x => x.IsMatch(methodName, lazySymbol, Language.NameComparison));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/Hotspots/DisablingRequestValidationBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Globalization;\nusing System.IO;\nusing System.Xml.Linq;\nusing System.Xml.XPath;\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class DisablingRequestValidationBase : HotspotDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S5753\";\n        private const string MessageFormat = \"Make sure disabling ASP.NET Request Validation feature is safe here.\";\n        // See https://docs.microsoft.com/en-us/dotnet/api/system.web.configuration.httpruntimesection.requestvalidationmode\n        private const int MinimumAcceptedRequestValidationModeValue = 4;\n\n        private readonly DiagnosticDescriptor rule;\n\n        protected abstract ILanguageFacade Language { get; }\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(rule);\n\n        protected DisablingRequestValidationBase(IAnalyzerConfiguration configuration) : base(configuration) =>\n            rule = Language.CreateDescriptor(DiagnosticId, MessageFormat);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterSymbolAction(CheckController,\n                SymbolKind.NamedType,\n                SymbolKind.Method);\n\n            context.RegisterCompilationAction(CheckWebConfig);\n        }\n\n        private void CheckController(SonarSymbolReportingContext context)\n        {\n            if (!IsEnabled(context.Options))\n            {\n                return;\n            }\n            var attributes = context.Symbol.GetAttributes();\n            if (attributes.IsEmpty)\n            {\n                return;\n            }\n\n            var attributeWithFalseParameter = attributes.FirstOrDefault(a =>\n                a.ConstructorArguments.Length == 1\n                && a.ConstructorArguments[0].Kind == TypedConstantKind.Primitive\n                && a.ConstructorArguments[0].Value is bool enableValidationValue\n                && !enableValidationValue\n                && a.AttributeClass.Is(KnownType.System_Web_Mvc_ValidateInputAttribute));\n            if (attributeWithFalseParameter is not null)\n            {\n                context.ReportIssue(Language.GeneratedCodeRecognizer, rule, attributeWithFalseParameter.ApplicationSyntaxReference.GetSyntax());\n            }\n        }\n\n        private void CheckWebConfig(SonarCompilationReportingContext context)\n        {\n            if (!IsEnabled(context.Options))\n            {\n                return;\n            }\n\n            foreach (var fullPath in context.WebConfigFiles())\n            {\n                var webConfig = File.ReadAllText(fullPath);\n                if (webConfig.Contains(\"<system.web>\") && webConfig.ParseXDocument() is { } doc)\n                {\n                    ReportValidateRequest(context, doc, fullPath);\n                    ReportRequestValidationMode(context, doc, fullPath);\n                }\n            }\n        }\n\n        private void ReportValidateRequest(SonarCompilationReportingContext context, XDocument doc, string webConfigPath)\n        {\n            foreach (var pages in doc.XPathSelectElements(\"configuration/system.web/pages\"))\n            {\n                if (pages.GetAttributeIfBoolValueIs(\"validateRequest\", false) is { } validateRequest\n                    && validateRequest.CreateLocation(webConfigPath) is { } location)\n                {\n                    context.ReportIssue(Language.GeneratedCodeRecognizer, rule, location);\n                }\n            }\n        }\n\n        private void ReportRequestValidationMode(SonarCompilationReportingContext context, XDocument doc, string webConfigPath)\n        {\n            foreach (var httpRuntime in doc.XPathSelectElements(\"configuration/system.web/httpRuntime\"))\n            {\n                if (httpRuntime.Attribute(\"requestValidationMode\") is { } requestValidationMode\n                    && decimal.TryParse(requestValidationMode.Value, NumberStyles.Number, CultureInfo.InvariantCulture, out var value)\n                    && value < MinimumAcceptedRequestValidationModeValue\n                    && requestValidationMode.CreateLocation(webConfigPath) is { } location)\n                {\n                    context.ReportIssue(Language.GeneratedCodeRecognizer, rule, location);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/Hotspots/ExecutingSqlQueriesBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class ExecutingSqlQueriesBase<TSyntaxKind, TExpressionSyntax, TIdentifierNameSyntax> : TrackerHotspotDiagnosticAnalyzer<TSyntaxKind>\n        where TSyntaxKind : struct\n        where TExpressionSyntax : SyntaxNode\n        where TIdentifierNameSyntax : SyntaxNode\n    {\n        private const string DiagnosticId = \"S2077\";\n        private const string AssignmentWithFormattingMessage = \"SQL Query is dynamically formatted and assigned to {0}.\";\n        private const string AssignmentMessage = \"SQL query is assigned to {0}.\";\n        private const string MessageFormat = \"Make sure using a dynamically formatted SQL query is safe here.\";\n        private const int FirstArgumentIndex = 0;\n        private const int SecondArgumentIndex = 1;\n\n        private readonly KnownType[] constructorsForFirstArgument =\n            {\n                KnownType.System_Data_Odbc_OdbcCommand,\n                KnownType.System_Data_Odbc_OdbcDataAdapter,\n                KnownType.System_Data_SqlClient_SqlCommand,\n                KnownType.System_Data_SqlClient_SqlDataAdapter,\n                KnownType.System_Data_Sqlite_SqliteCommand,\n                KnownType.System_Data_Sqlite_SQLiteDataAdapter,\n                KnownType.System_Data_SqlServerCe_SqlCeCommand,\n                KnownType.System_Data_SqlServerCe_SqlCeDataAdapter,\n                KnownType.System_Data_OracleClient_OracleCommand,\n                KnownType.System_Data_OracleClient_OracleDataAdapter,\n                KnownType.MySql_Data_MySqlClient_MySqlCommand,\n                KnownType.MySql_Data_MySqlClient_MySqlDataAdapter,\n                KnownType.MySql_Data_MySqlClient_MySqlScript,\n                KnownType.Microsoft_Data_Sqlite_SqliteCommand,\n                KnownType.Mono_Data_Sqlite_SqliteCommand,\n                KnownType.Mono_Data_Sqlite_SqliteDataAdapter,\n                KnownType.Microsoft_EntityFrameworkCore_RawSqlString,\n                KnownType.Dapper_CommandDefinition,\n                KnownType.Microsoft_Azure_Cosmos_QueryDefinition,\n                KnownType.Microsoft_Data_SqlClient_SqlCommand,\n                KnownType.Microsoft_Data_SqlClient_SqlDataAdapter,\n                KnownType.NHibernate_Engine_NamedQueryDefinition,\n                KnownType.NHibernate_Engine_NamedSQLQueryDefinition,\n                KnownType.NHibernate_Impl_QueryImpl,\n                KnownType.Oracle_ManagedDataAccess_Client_OracleCommand,\n                KnownType.Oracle_ManagedDataAccess_Client_OracleDataAdapter\n            };\n\n        private readonly KnownType[] constructorsForSecondArgument =\n            {\n                KnownType.MySql_Data_MySqlClient_MySqlScript\n            };\n\n        private readonly MemberDescriptor[] invocationsForFirstTwoArguments =\n            {\n                new(KnownType.Microsoft_EntityFrameworkCore_RelationalDatabaseFacadeExtensions, \"ExecuteSqlCommandAsync\"),\n                new(KnownType.Microsoft_EntityFrameworkCore_RelationalDatabaseFacadeExtensions, \"ExecuteSqlCommand\"),\n                new(KnownType.Microsoft_EntityFrameworkCore_RelationalQueryableExtensions, \"FromSql\")\n            };\n\n        private readonly MemberDescriptor[] invocationsForFirstTwoArgumentsAfterV2 =\n            {\n                new(KnownType.Microsoft_EntityFrameworkCore_RelationalDatabaseFacadeExtensions, \"ExecuteSqlRaw\"),\n                new(KnownType.Microsoft_EntityFrameworkCore_RelationalDatabaseFacadeExtensions, \"ExecuteSqlRawAsync\"),\n                new(KnownType.Microsoft_EntityFrameworkCore_RelationalQueryableExtensions, \"FromSqlRaw\"),\n                new(KnownType.Dapper_SqlMapper, \"Execute\"),\n                new(KnownType.Dapper_SqlMapper, \"ExecuteAsync\"),\n                new(KnownType.Dapper_SqlMapper, \"ExecuteReader\"),\n                new(KnownType.Dapper_SqlMapper, \"ExecuteReaderAsync\"),\n                new(KnownType.Dapper_SqlMapper, \"ExecuteScalar\"),\n                new(KnownType.Dapper_SqlMapper, \"ExecuteScalarAsync\"),\n                new(KnownType.Dapper_SqlMapper, \"Query\"),\n                new(KnownType.Dapper_SqlMapper, \"QueryAsync\"),\n                new(KnownType.Dapper_SqlMapper, \"QueryFirst\"),\n                new(KnownType.Dapper_SqlMapper, \"QueryFirstAsync\"),\n                new(KnownType.Dapper_SqlMapper, \"QueryFirstOrDefault\"),\n                new(KnownType.Dapper_SqlMapper, \"QueryFirstOrDefaultAsync\"),\n                new(KnownType.Dapper_SqlMapper, \"QueryMultiple\"),\n                new(KnownType.Dapper_SqlMapper, \"QueryMultipleAsync\"),\n                new(KnownType.Dapper_SqlMapper, \"QuerySingle\"),\n                new(KnownType.Dapper_SqlMapper, \"QuerySingleAsync\"),\n                new(KnownType.Dapper_SqlMapper, \"QuerySingleOrDefault\"),\n                new(KnownType.Dapper_SqlMapper, \"QuerySingleOrDefaultAsync\"),\n                new(KnownType.System_Data_Entity_Database, \"SqlQuery\"),\n                new(KnownType.System_Data_Entity_Database, \"ExecuteSqlCommand\"),\n                new(KnownType.System_Data_Entity_Database, \"ExecuteSqlCommandAsync\"),\n                new(KnownType.ServiceStack_OrmLite_OrmLiteReadApi, \"Select\"),\n                new(KnownType.ServiceStack_OrmLite_OrmLiteReadApi, \"SelectLazy\"),\n                new(KnownType.ServiceStack_OrmLite_OrmLiteReadApi, \"SelectNonDefaults\"),\n                new(KnownType.ServiceStack_OrmLite_OrmLiteReadApi, \"Single\"),\n                new(KnownType.ServiceStack_OrmLite_OrmLiteReadApi, \"Scalar\"),\n                new(KnownType.ServiceStack_OrmLite_OrmLiteReadApi, \"Column\"),\n                new(KnownType.ServiceStack_OrmLite_OrmLiteReadApi, \"ColumnLazy\"),\n                new(KnownType.ServiceStack_OrmLite_OrmLiteReadApi, \"ColumnDistinct\"),\n                new(KnownType.ServiceStack_OrmLite_OrmLiteReadApi, \"Lookup\"),\n                new(KnownType.ServiceStack_OrmLite_OrmLiteReadApi, \"Dictionary\"),\n                new(KnownType.ServiceStack_OrmLite_OrmLiteReadApi, \"Exists\"),\n                new(KnownType.ServiceStack_OrmLite_OrmLiteReadApi, \"SqlList\"),\n                new(KnownType.ServiceStack_OrmLite_OrmLiteReadApi, \"SqlColumn\"),\n                new(KnownType.ServiceStack_OrmLite_OrmLiteReadApi, \"SqlScalar\"),\n                new(KnownType.ServiceStack_OrmLite_OrmLiteReadApi, \"ExecuteNonQuery\"),\n                new(KnownType.ServiceStack_OrmLite_OrmLiteReadApiAsync, \"SelectAsync\"),\n                new(KnownType.ServiceStack_OrmLite_OrmLiteReadApiAsync, \"SelectNonDefaultsAsync\"),\n                new(KnownType.ServiceStack_OrmLite_OrmLiteReadApiAsync, \"ScalarAsync\"),\n                new(KnownType.ServiceStack_OrmLite_OrmLiteReadApiAsync, \"SingleAsync\"),\n                new(KnownType.ServiceStack_OrmLite_OrmLiteReadApiAsync, \"ColumnAsync\"),\n                new(KnownType.ServiceStack_OrmLite_OrmLiteReadApiAsync, \"ColumnDistinctAsync\"),\n                new(KnownType.ServiceStack_OrmLite_OrmLiteReadApiAsync, \"LookupAsync\"),\n                new(KnownType.ServiceStack_OrmLite_OrmLiteReadApiAsync, \"DictionaryAsync\"),\n                new(KnownType.ServiceStack_OrmLite_OrmLiteReadApiAsync, \"ExistsAsync\"),\n                new(KnownType.ServiceStack_OrmLite_OrmLiteReadApiAsync, \"SqlListAsync\"),\n                new(KnownType.ServiceStack_OrmLite_OrmLiteReadApiAsync, \"SqlColumnAsync\"),\n                new(KnownType.ServiceStack_OrmLite_OrmLiteReadApiAsync, \"SqlScalarAsync\"),\n                new(KnownType.ServiceStack_OrmLite_OrmLiteReadApiAsync, \"ExecuteNonQueryAsync\")\n            };\n\n        private readonly MemberDescriptor[] invocationsForFirstArgument =\n            {\n                new(KnownType.System_Data_Sqlite_SqliteCommand, \"Execute\"),\n                new(KnownType.System_Data_Entity_DbSet, \"SqlQuery\"),\n                new(KnownType.System_Data_Entity_DbSet_TEntity, \"SqlQuery\"),\n                new(KnownType.NHibernate_ISession, \"CreateQuery\"),\n                new(KnownType.NHibernate_ISession, \"CreateSQLQuery\"),\n                new(KnownType.NHibernate_ISession, \"Delete\"),\n                new(KnownType.NHibernate_ISession, \"DeleteAsync\"),\n                new(KnownType.NHibernate_ISession, \"GetNamedQuery\"),\n                new(KnownType.NHibernate_Impl_AbstractSessionImpl, \"CreateQuery\"),\n                new(KnownType.NHibernate_Impl_AbstractSessionImpl, \"CreateSQLQuery\"),\n                new(KnownType.NHibernate_Impl_AbstractSessionImpl, \"GetNamedQuery\"),\n                new(KnownType.NHibernate_Impl_AbstractSessionImpl, \"GetNamedSQLQuery\"),\n                new(KnownType.Microsoft_Azure_Cosmos_Container, \"GetItemQueryIterator\"),\n                new(KnownType.Microsoft_Azure_Cosmos_Container, \"GetItemQueryStreamIterator\")\n            };\n\n        private readonly MemberDescriptor[] invocationsForSecondArgument =\n            {\n                new(KnownType.MySql_Data_MySqlClient_MySqlHelper, \"ExecuteDataRow\"),\n                new(KnownType.MySql_Data_MySqlClient_MySqlHelper, \"ExecuteDataRowAsync\"),\n                new(KnownType.MySql_Data_MySqlClient_MySqlHelper, \"ExecuteDataset\"),\n                new(KnownType.MySql_Data_MySqlClient_MySqlHelper, \"ExecuteDatasetAsync\"),\n                new(KnownType.MySql_Data_MySqlClient_MySqlHelper, \"ExecuteNonQuery\"),\n                new(KnownType.MySql_Data_MySqlClient_MySqlHelper, \"ExecuteNonQueryAsync\"),\n                new(KnownType.MySql_Data_MySqlClient_MySqlHelper, \"ExecuteReader\"),\n                new(KnownType.MySql_Data_MySqlClient_MySqlHelper, \"ExecuteReaderAsync\"),\n                new(KnownType.MySql_Data_MySqlClient_MySqlHelper, \"ExecuteScalar\"),\n                new(KnownType.MySql_Data_MySqlClient_MySqlHelper, \"ExecuteScalarAsync\"),\n                new(KnownType.MySql_Data_MySqlClient_MySqlHelper, \"UpdateDataSet\"),\n                new(KnownType.MySql_Data_MySqlClient_MySqlHelper, \"UpdateDataSetAsync\"),\n                new(KnownType.NHibernate_ISession, \"CreateFilter\"),\n                new(KnownType.NHibernate_ISession, \"CreateFilterAsync\")\n            };\n\n        private readonly MemberDescriptor[] properties =\n            {\n                new(KnownType.System_Data_IDbCommand, \"CommandText\"), // Also covers SqlCommand and OracleCommand\n                new(KnownType.NHibernate_Cfg_Loquacious_NamedQueryDefinitionBuilder, \"Query\")\n            };\n\n        protected abstract TExpressionSyntax GetArgumentAtIndex(InvocationContext context, int index);\n        protected abstract TExpressionSyntax GetArgumentAtIndex(ObjectCreationContext context, int index);\n        protected abstract TExpressionSyntax GetSetValue(PropertyAccessContext context);\n        protected abstract bool IsTracked(TExpressionSyntax expression, SyntaxBaseContext context);\n        protected abstract bool IsSensitiveExpression(TExpressionSyntax expression, SemanticModel semanticModel);\n        protected abstract Location SecondaryLocationForExpression(TExpressionSyntax node, string identifierNameToFind, out string identifierNameFound);\n\n        protected ExecutingSqlQueriesBase(IAnalyzerConfiguration configuration) : base(configuration, DiagnosticId, MessageFormat) { }\n\n        protected override void Initialize(TrackerInput input)\n        {\n            var inv = Language.Tracker.Invocation;\n            inv.Track(input,\n                inv.MatchMethod(invocationsForFirstTwoArguments),\n                inv.And(MethodHasRawSqlQueryParameter(), inv.Or(ArgumentAtIndexIsTracked(0), ArgumentAtIndexIsTracked(1))),\n                inv.ExceptWhen(inv.ArgumentAtIndexIsStringConstant(0)));\n\n            inv.Track(input,\n                inv.MatchMethod(invocationsForFirstTwoArgumentsAfterV2),\n                inv.Or(ArgumentAtIndexIsTracked(0), ArgumentAtIndexIsTracked(1)),\n                inv.ExceptWhen(inv.ArgumentAtIndexIsStringConstant(0)));\n\n            TrackInvocations(input, invocationsForFirstArgument, FirstArgumentIndex);\n            TrackInvocations(input, invocationsForSecondArgument, SecondArgumentIndex);\n\n            var pa = Language.Tracker.PropertyAccess;\n            pa.Track(input,\n                pa.MatchProperty(true, properties),\n                pa.MatchSetter(),\n                c => IsTracked(GetSetValue(c), c),\n                pa.ExceptWhen(pa.AssignedValueIsConstant()));\n\n            TrackObjectCreation(input, constructorsForFirstArgument, FirstArgumentIndex);\n            TrackObjectCreation(input, constructorsForSecondArgument, SecondArgumentIndex);\n        }\n\n        protected bool IsTrackedVariableDeclaration(TExpressionSyntax expression, SyntaxBaseContext context)\n        {\n            var node = expression;\n            while (node is TIdentifierNameSyntax identifierNameSyntax)\n            {\n                var identifierName = Language.Syntax.NodeIdentifier(identifierNameSyntax).Value.ValueText;\n                node = Language.AssignmentFinder.FindLinearPrecedingAssignmentExpression(identifierName, node) as TExpressionSyntax;\n\n                var location = SecondaryLocationForExpression(node, identifierName, out var foundName);\n                if (IsSensitiveExpression(node, context.Model))\n                {\n                    context.AddSecondaryLocation(location, AssignmentWithFormattingMessage, foundName);\n                    return true;\n                }\n                else\n                {\n                    context.AddSecondaryLocation(location, AssignmentMessage, foundName);\n                }\n            }\n            return false;\n        }\n\n        private void TrackObjectCreation(TrackerInput input, KnownType[] objectCreationTypes, int argumentIndex)\n        {\n            var t = Language.Tracker.ObjectCreation;\n            t.Track(input,\n                t.MatchConstructor(objectCreationTypes),\n                t.ArgumentAtIndexIs(argumentIndex, KnownType.System_String),\n                c => IsTracked(GetArgumentAtIndex(c, argumentIndex), c),\n                t.ExceptWhen(t.ArgumentAtIndexIsConst(argumentIndex)));\n        }\n\n        private void TrackInvocations(TrackerInput input, MemberDescriptor[] invocationsDescriptors, int argumentIndex)\n        {\n            var t = Language.Tracker.Invocation;\n            t.Track(input,\n                t.MatchMethod(invocationsDescriptors),\n                ArgumentAtIndexIsTracked(argumentIndex),\n                t.ExceptWhen(t.ArgumentAtIndexIsStringConstant(argumentIndex)));\n        }\n\n        private TrackerBase<TSyntaxKind, InvocationContext>.Condition MethodHasRawSqlQueryParameter() =>\n            context =>\n            {\n                return Language.Syntax.NodeExpression(context.Node) is { } invocationExpression\n                       && context.Model.GetSymbolInfo(invocationExpression).Symbol is IMethodSymbol methodSymbol\n                       && (ParameterIsRawString(methodSymbol, 0) || ParameterIsRawString(methodSymbol, 1));\n\n                static bool ParameterIsRawString(IMethodSymbol method, int index) =>\n                    method.Parameters.Length > index && method.Parameters[index].IsType(KnownType.Microsoft_EntityFrameworkCore_RawSqlString);\n            };\n\n        private TrackerBase<TSyntaxKind, InvocationContext>.Condition ArgumentAtIndexIsTracked(int index) =>\n            context => IsTracked(GetArgumentAtIndex(context, index), context);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/Hotspots/ExpandingArchivesBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class ExpandingArchivesBase<TSyntaxKind> : TrackerHotspotDiagnosticAnalyzer<TSyntaxKind>\n        where TSyntaxKind : struct\n    {\n        protected const string DiagnosticId = \"S5042\";\n        protected const string MessageFormat = \"Make sure that decompressing this archive file is safe.\";\n\n        protected ExpandingArchivesBase(IAnalyzerConfiguration configuration) : base(configuration, DiagnosticId, MessageFormat) { }\n\n        protected override void Initialize(TrackerInput input)\n        {\n            var t = Language.Tracker.Invocation;\n            t.Track(input,\n                t.MatchMethod(\n                    new MemberDescriptor(KnownType.System_IO_Compression_ZipFileExtensions, \"ExtractToFile\"),\n                    new MemberDescriptor(KnownType.System_IO_Compression_ZipFileExtensions, \"ExtractToDirectory\"),\n                    new MemberDescriptor(KnownType.System_IO_Compression_ZipFile, \"ExtractToDirectory\")));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/Hotspots/HardcodedIpAddressBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Net;\nusing System.Net.Sockets;\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class HardcodedIpAddressBase<TSyntaxKind, TLiteralExpression> : HotspotDiagnosticAnalyzer\n        where TSyntaxKind : struct\n        where TLiteralExpression : SyntaxNode\n    {\n        private const string DiagnosticId = \"S1313\";\n        private const string MessageFormat = \"Make sure using this hardcoded IP address '{0}' is safe here.\";\n        private const int IPv4AddressParts = 4;\n        private const string IPv4Broadcast = \"255.255.255.255\";\n        private const string OIDPrefix = \"2.5.\";\n\n        private readonly string[] ignoredVariableNames =\n        {\n            \"VERSION\",\n            \"ASSEMBLY\",\n        };\n\n        // https://datatracker.ietf.org/doc/html/rfc5737#section-3\n        private readonly byte[][] interNetworkDocumentationRanges =\n        {\n            new byte[] { 192, 0, 2 },\n            new byte[] { 198, 51, 100 },\n            new byte[] { 203, 0, 113 }\n        };\n\n        // https://datatracker.ietf.org/doc/html/rfc3849#section-2\n        private readonly byte[] interNetwork6DocumentationRange = { 0x20, 0x01, 0x0d, 0xb8 }; // 2001:0DB8::/32\n\n        protected abstract ILanguageFacade<TSyntaxKind> Language { get; }\n\n        protected abstract string GetAssignedVariableName(SyntaxNode stringLiteral);\n        protected abstract bool HasAttributes(SyntaxNode literalExpression);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n        protected DiagnosticDescriptor Rule { get; init; }\n\n        protected HardcodedIpAddressBase(IAnalyzerConfiguration analyzerConfiguration) : base(analyzerConfiguration) =>\n            Rule = Language.CreateDescriptor(DiagnosticId, MessageFormat);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(Language.GeneratedCodeRecognizer, CheckForHardcodedIpAddressesInStringLiteral, Language.SyntaxKind.StringLiteralExpressions);\n            context.RegisterNodeAction(Language.GeneratedCodeRecognizer, CheckForHardcodedIpAddressesInStringInterpolation, Language.SyntaxKind.InterpolatedStringExpression);\n        }\n\n        protected bool IsHardcodedIp(string literalValue, SyntaxNode node) =>\n            literalValue != IPv4Broadcast\n            && !IsObjectIdentifier(literalValue)\n            && IsRoutableNonLoopbackIPAddress(literalValue, out var address)\n            && (address.AddressFamily != AddressFamily.InterNetwork\n                || literalValue.Count(x => x == '.') == IPv4AddressParts - 1)\n            && !IsInDocumentationBlock(address)\n            && !IsIgnoredVariableName(node)\n            && !HasAttributes(node);\n\n        private void CheckForHardcodedIpAddressesInStringLiteral(SonarSyntaxNodeReportingContext context)\n        {\n            if (IsEnabled(context.Options)\n                && (TLiteralExpression)context.Node is var stringLiteral\n                && Language.Syntax.LiteralText(stringLiteral) is var literalValue\n                && IsHardcodedIp(literalValue, stringLiteral))\n            {\n                context.ReportIssue(Rule, stringLiteral, literalValue);\n            }\n        }\n\n        private void CheckForHardcodedIpAddressesInStringInterpolation(SonarSyntaxNodeReportingContext context)\n        {\n            if (IsEnabled(context.Options)\n                && Language.Syntax.InterpolatedTextValue(context.Node, context.Model) is { } stringContent\n                && IsHardcodedIp(stringContent, context.Node))\n            {\n                context.ReportIssue(Rule, context.Node, stringContent);\n            }\n        }\n\n        private static bool IsRoutableNonLoopbackIPAddress(string literalValue, out IPAddress ipAddress) =>\n            IPAddress.TryParse(literalValue, out ipAddress)\n            && !IPAddress.IsLoopback(ipAddress)\n            && !(ipAddress.IsIPv4MappedToIPv6 && IPAddress.IsLoopback(ipAddress.MapToIPv4()))\n            && !ipAddress.GetAddressBytes().All(x => x == 0); // Nonroutable 0.0.0.0 or 0::0\n\n        private bool IsInDocumentationBlock(IPAddress address)\n        {\n            var ip = address.GetAddressBytes();\n            return address.AddressFamily switch\n            {\n                AddressFamily.InterNetwork => interNetworkDocumentationRanges.Any(x => SequenceStartsWith(ip, x)),\n                AddressFamily.InterNetworkV6 => SequenceStartsWith(ip, interNetwork6DocumentationRange),\n                _ => false,\n            };\n\n            static bool SequenceStartsWith(byte[] sequence, byte[] startsWith) =>\n                sequence.Take(startsWith.Length).SequenceEqual(startsWith);\n        }\n\n        private static bool IsObjectIdentifier(string literalValue) =>\n            literalValue.StartsWith(OIDPrefix);   // Looks like OID\n\n        private bool IsIgnoredVariableName(SyntaxNode node) =>\n            GetAssignedVariableName(node) is { } variableName\n            && ignoredVariableNames.Any(x => variableName.IndexOf(x, StringComparison.InvariantCultureIgnoreCase) >= 0);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/Hotspots/PubliclyWritableDirectoriesBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text.RegularExpressions;\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class PubliclyWritableDirectoriesBase<TSyntaxKind, TInvocationExpression> : HotspotDiagnosticAnalyzer\n        where TSyntaxKind : struct\n        where TInvocationExpression : SyntaxNode\n    {\n        protected const string DiagnosticId = \"S5443\";\n        private const string MessageFormat = \"Make sure publicly writable directories are used safely here.\";\n        private const RegexOptions WindowsAndUnixOptions = RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant;\n\n        protected static string[] InsecureEnvironmentVariables { get; }\n\n        private static readonly Regex UserProfile;\n        private static readonly Regex LinuxDirectories;\n        private static readonly Regex MacDirectories;\n        private static readonly Regex WindowsDirectories;\n        private static readonly Regex EnvironmentVariables;\n\n        static PubliclyWritableDirectoriesBase()\n        {\n            var insecureEnvironmentVariables = new[] { \"tmp\", \"temp\", \"tmpdir\" };\n            InsecureEnvironmentVariables = insecureEnvironmentVariables;\n            UserProfile = new(\"\"\"^%USERPROFILE%[\\\\\\/]AppData[\\\\\\/]Local[\\\\\\/]Temp\"\"\", WindowsAndUnixOptions, Constants.DefaultRegexTimeout);\n            LinuxDirectories = new($@\"^({LinuxDirs().JoinStr(\"|\", Regex.Escape)})(\\/|$)\", RegexOptions.Compiled, Constants.DefaultRegexTimeout);\n            MacDirectories = new($@\"^({MacDirs().JoinStr(\"|\", Regex.Escape)})(\\/|$)\", WindowsAndUnixOptions, Constants.DefaultRegexTimeout);\n            WindowsDirectories = new(\"\"\"^([a-z]:[\\\\\\/]?|[\\\\\\/][\\\\\\/][^\\\\\\/]+[\\\\\\/]|[\\\\\\/])(windows[\\\\\\/])?te?mp([\\\\\\/]|$)\"\"\", WindowsAndUnixOptions, Constants.DefaultRegexTimeout);\n            EnvironmentVariables = new($@\"^%({insecureEnvironmentVariables.JoinStr(\"|\")})%([\\\\\\/]|$)\", WindowsAndUnixOptions, Constants.DefaultRegexTimeout);\n        }\n\n        private readonly DiagnosticDescriptor rule;\n\n        protected abstract ILanguageFacade<TSyntaxKind> Language { get; }\n\n        private protected abstract bool IsGetTempPathAssignment(TInvocationExpression invocationExpression, KnownType type, string methodName, SemanticModel semanticModel);\n        private protected abstract bool IsInsecureEnvironmentVariableRetrieval(TInvocationExpression invocation, KnownType type, string methodName, SemanticModel semanticModel);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(rule);\n\n        protected PubliclyWritableDirectoriesBase(IAnalyzerConfiguration configuration) : base(configuration)\n        {\n            rule = Language.CreateDescriptor(DiagnosticId, MessageFormat);\n        }\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            var kinds = Language.SyntaxKind.StringLiteralExpressions.ToList();\n            kinds.Add(Language.SyntaxKind.InterpolatedStringExpression);\n\n            context.RegisterNodeAction(\n                Language.GeneratedCodeRecognizer,\n                c =>\n                {\n                    if (IsEnabled(c.Options)\n                        && Language.Syntax.StringValue(c.Node, c.Model) is { } stringValue\n                        && IsSensitiveDirectoryUsage(stringValue))\n                    {\n                        c.ReportIssue(rule, c.Node);\n                    }\n                },\n                kinds.ToArray());\n\n            context.RegisterNodeAction(\n                Language.GeneratedCodeRecognizer,\n                c =>\n                {\n                    if (IsEnabled(c.Options)\n                        && c.Node is TInvocationExpression invocation\n                        && (IsGetTempPathAssignment(invocation, KnownType.System_IO_Path, \"GetTempPath\", c.Model)\n                            || IsInsecureEnvironmentVariableRetrieval(invocation, KnownType.System_Environment, \"GetEnvironmentVariable\", c.Model)))\n                    {\n                        c.ReportIssue(rule, c.Node);\n                    }\n                },\n                Language.SyntaxKind.InvocationExpression);\n        }\n\n        private static bool IsSensitiveDirectoryUsage(string directory) =>\n            WindowsDirectories.SafeIsMatch(directory)\n                || MacDirectories.SafeIsMatch(directory)\n                || LinuxDirectories.SafeIsMatch(directory)\n                || EnvironmentVariables.SafeIsMatch(directory)\n                || UserProfile.SafeIsMatch(directory);\n\n        private static string[] LinuxDirs() => new[]\n            {\n                \"/dev/mqueue\",\n                \"/run/lock\",\n                \"/var/run/lock\",\n            };\n\n        private static string[] MacDirs() => new[]\n            {\n                \"/var/tmp\",\n                \"/usr/tmp\",\n                \"/dev/shm\",\n                \"/library/caches\",\n                \"/users/shared\",\n                \"/private/tmp\",\n                \"/private/var/tmp\",\n            };\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/Hotspots/RequestsWithExcessiveLengthBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\nusing System.Xml.Linq;\nusing System.Xml.XPath;\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class RequestsWithExcessiveLengthBase<TSyntaxKind, TAttributeSyntax> : ParametrizedDiagnosticAnalyzer\n        where TSyntaxKind : struct\n        where TAttributeSyntax : SyntaxNode\n    {\n        protected const string MultipartBodyLengthLimit = \"MultipartBodyLengthLimit\";\n        private const string DiagnosticId = \"S5693\";\n        private const string RequestSizeLimit = \"RequestSizeLimit\";\n        private const string RequestSizeLimitAttribute = RequestSizeLimit + Attribute;\n        private const string DisableRequestSizeLimit = \"DisableRequestSizeLimit\";\n        private const string DisableRequestSizeLimitAttribute = DisableRequestSizeLimit + Attribute;\n        private const string RequestFormLimits = \"RequestFormLimits\";\n        private const string RequestFormLimitsAttribute = RequestFormLimits + Attribute;\n        private const string MessageFormat = \"Make sure the content length limit is safe here.\";\n        private const string Attribute = \"Attribute\";\n        private const int DefaultFileUploadSizeLimit = 8_388_608;   // 8 MB (in bytes)\n        private const int OneKilobyte = 1024; // 1 KB = 1024 bytes\n\n        protected readonly DiagnosticDescriptor Rule;\n        protected readonly IAnalyzerConfiguration AnalyzerConfiguration;\n\n        protected abstract ILanguageFacade<TSyntaxKind> Language { get; }\n\n        protected abstract TAttributeSyntax IsInvalidRequestFormLimits(TAttributeSyntax attribute, SemanticModel semanticModel);\n        protected abstract TAttributeSyntax IsInvalidRequestSizeLimit(TAttributeSyntax attribute, SemanticModel semanticModel);\n        protected abstract SyntaxNode GetMethodLocalFunctionOrClassDeclaration(TAttributeSyntax attribute);\n        protected abstract string AttributeName(TAttributeSyntax attribute);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n        [RuleParameter(\"fileUploadSizeLimit\", PropertyType.Integer, \"The maximum size of HTTP requests handling file uploads (in bytes).\", DefaultFileUploadSizeLimit)]\n        public int FileUploadSizeLimit { get; set; } = DefaultFileUploadSizeLimit;\n        protected override bool EnableConcurrentExecution => false;\n\n        protected RequestsWithExcessiveLengthBase(IAnalyzerConfiguration analyzerConfiguration)\n        {\n            AnalyzerConfiguration = analyzerConfiguration;\n            Rule = Language.CreateDescriptor(DiagnosticId, MessageFormat);\n        }\n\n        protected override void Initialize(SonarParametrizedAnalysisContext context)\n        {\n            context.RegisterCompilationStartAction(\n                c =>\n                {\n                    var attributesOverTheLimit = new Dictionary<SyntaxNode, Attributes>();\n\n                    c.RegisterNodeAction(\n                        Language.GeneratedCodeRecognizer,\n                        cc => CollectAttributesOverTheLimit(cc, attributesOverTheLimit),\n                        Language.SyntaxKind.Attribute);\n\n                    c.RegisterCompilationEndAction(cc => ReportOnCollectedAttributes(cc, attributesOverTheLimit));\n                });\n            context.RegisterCompilationAction(CheckWebConfig);\n        }\n\n        protected bool IsRequestFormLimits(string attributeName) =>\n            attributeName.Equals(RequestFormLimits, Language.NameComparison)\n            || attributeName.Equals(RequestFormLimitsAttribute, Language.NameComparison);\n\n        protected bool IsRequestSizeLimit(string attributeName) =>\n            attributeName.Equals(RequestSizeLimit, Language.NameComparison)\n            || attributeName.Equals(RequestSizeLimitAttribute, Language.NameComparison);\n\n        private void CollectAttributesOverTheLimit(SonarSyntaxNodeReportingContext context, IDictionary<SyntaxNode, Attributes> attributesOverTheLimit)\n        {\n            if (!IsEnabled(context.Options))\n            {\n                return;\n            }\n\n            var attribute = (TAttributeSyntax)context.Node;\n\n            if (IsDisableRequestSizeLimit(AttributeName(attribute))\n                && attribute.IsKnownType(KnownType.Microsoft_AspNetCore_Mvc_DisableRequestSizeLimitAttribute, context.Model))\n            {\n                context.ReportIssue(Rule, attribute);\n                return;\n            }\n\n            var requestSizeLimit = IsInvalidRequestSizeLimit(attribute, context.Model);\n            var requestFormLimits = IsInvalidRequestFormLimits(attribute, context.Model);\n\n            if ((requestSizeLimit != null || requestFormLimits != null)\n                && GetMethodLocalFunctionOrClassDeclaration(attribute) is { } declaration)\n            {\n                attributesOverTheLimit[declaration] = attributesOverTheLimit.TryGetValue(declaration, out var existingAttribute)\n                    ? new Attributes(requestFormLimits, requestSizeLimit, existingAttribute)\n                    : new Attributes(requestFormLimits, requestSizeLimit);\n            }\n        }\n\n        private void ReportOnCollectedAttributes(SonarCompilationReportingContext context, IDictionary<SyntaxNode, Attributes> attributesOverTheLimit)\n        {\n            foreach (var invalidAttributes in attributesOverTheLimit.Values)\n            {\n                context.ReportIssue(\n                    Language.GeneratedCodeRecognizer,\n                    Rule,\n                    invalidAttributes.MainAttribute.GetLocation(),\n                    invalidAttributes.SecondaryAttribute is null ? [] : [invalidAttributes.SecondaryAttribute.ToSecondaryLocation(MessageFormat)]);\n            }\n        }\n\n        private bool IsDisableRequestSizeLimit(string attributeName) =>\n            attributeName.Equals(DisableRequestSizeLimit, Language.NameComparison)\n            || attributeName.Equals(DisableRequestSizeLimitAttribute, Language.NameComparison);\n\n        private bool IsEnabled(AnalyzerOptions options)\n        {\n            AnalyzerConfiguration.Initialize(options);\n            return SupportedDiagnostics.Any(x => AnalyzerConfiguration.IsEnabled(x.Id));\n        }\n\n        private void CheckWebConfig(SonarCompilationReportingContext c)\n        {\n            foreach (var fullPath in c.WebConfigFiles())\n            {\n                var webConfig = File.ReadAllText(fullPath);\n                if (webConfig.Contains(\"<system.web\") && webConfig.ParseXDocument() is { } doc)\n                {\n                    ReportRequestLengthViolation(c, doc, fullPath);\n                }\n            }\n        }\n\n        private void ReportRequestLengthViolation(SonarCompilationReportingContext c, XDocument doc, string webConfigPath)\n        {\n            foreach (var httpRuntime in doc.XPathSelectElements(\"configuration/system.web/httpRuntime\"))\n            {\n                if (httpRuntime.Attribute(\"maxRequestLength\") is { } maxRequestLength\n                    && IsVulnerable(maxRequestLength.Value, FileUploadSizeLimit / OneKilobyte)\n                    && maxRequestLength.CreateLocation(webConfigPath) is { } location)\n                {\n                    c.ReportIssue(Language.GeneratedCodeRecognizer, Rule, location);\n                }\n            }\n            foreach (var requestLimit in doc.XPathSelectElements(\"configuration/system.webServer/security/requestFiltering/requestLimits\"))\n            {\n                if (requestLimit.Attribute(\"maxAllowedContentLength\") is { } maxAllowedContentLength\n                    && IsVulnerable(maxAllowedContentLength.Value, FileUploadSizeLimit)\n                    && maxAllowedContentLength.CreateLocation(webConfigPath) is { } location)\n                {\n                    c.ReportIssue(Language.GeneratedCodeRecognizer, Rule, location);\n                }\n            }\n        }\n\n        private static bool IsVulnerable(string value, int limit) =>\n            int.TryParse(value, out var val) && val > limit;\n\n        // This struct is used as the same attributes can not be applied multiple times to the same declaration.\n        private readonly struct Attributes\n        {\n            private readonly TAttributeSyntax requestForm;\n            private readonly TAttributeSyntax requestSize;\n\n            public SyntaxNode MainAttribute =>\n                requestForm ?? requestSize;\n\n            public SyntaxNode SecondaryAttribute =>\n                requestForm != null && requestSize != null ? requestSize : null;\n\n            public Attributes(TAttributeSyntax requestForm, TAttributeSyntax requestSize)\n            {\n                this.requestForm = requestForm;\n                this.requestSize = requestSize;\n            }\n\n            public Attributes(TAttributeSyntax requestForm, TAttributeSyntax requestSize, Attributes oldAttributes)\n            {\n                this.requestForm = requestForm ?? oldAttributes.requestForm;\n                this.requestSize = requestSize ?? oldAttributes.requestSize;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/Hotspots/SpecifyTimeoutOnRegexBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text.RegularExpressions;\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class SpecifyTimeoutOnRegexBase<TSyntaxKind> : HotspotDiagnosticAnalyzer\n        where TSyntaxKind : struct\n{\n    private const string DiagnosticId = \"S6444\";\n\n    // NonBacktracking was added in .NET 7\n    // See: https://docs.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.regexoptions?view=net-7.0\n    private const int NonBacktracking = 1024;\n\n    private readonly string[] matchMethods =\n    {\n        nameof(Regex.IsMatch),\n        nameof(Regex.Match),\n        nameof(Regex.Matches),\n        nameof(Regex.Replace),\n        nameof(Regex.Split),\n        \"EnumerateSplits\",  // https://learn.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.regex.enumeratesplits?view=net-9.0\n        \"EnumerateMatches\", // https://learn.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.regex.enumeratematches?view=net-9.0\n    };\n\n    protected abstract ILanguageFacade<TSyntaxKind> Language { get; }\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    protected virtual string MessageFormat => \"Pass a timeout to limit the execution time.\";\n\n    private DiagnosticDescriptor Rule => Language.CreateDescriptor(DiagnosticId, MessageFormat);\n\n    protected SpecifyTimeoutOnRegexBase(IAnalyzerConfiguration config) : base(config) { }\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(\n            Language.GeneratedCodeRecognizer,\n            c =>\n            {\n                if (!IsEnabled(c.Options))\n                {\n                    return;\n                }\n\n                if (IsCandidateCtor(c.Node)\n                    && RegexMethodLacksTimeout(c.Node, c.Model))\n                {\n                    c.ReportIssue(Rule, c.Node);\n                }\n            },\n            Language.SyntaxKind.ObjectCreationExpressions);\n\n        context.RegisterNodeAction(\n            Language.GeneratedCodeRecognizer,\n            c =>\n            {\n                if (!IsEnabled(c.Options))\n                {\n                    return;\n                }\n\n                if (IsRegexMatchMethod(Language.Syntax.NodeIdentifier(c.Node).GetValueOrDefault().Text)\n                    && RegexMethodLacksTimeout(c.Node, c.Model))\n                {\n                    c.ReportIssue(Rule, c.Node);\n                }\n            },\n            Language.SyntaxKind.InvocationExpression);\n    }\n\n    private bool RegexMethodLacksTimeout(SyntaxNode node, SemanticModel model) =>\n        model.GetSymbolInfo(node).Symbol is IMethodSymbol method\n        && method.ContainingType.Is(KnownType.System_Text_RegularExpressions_Regex)\n        && (method.IsStatic || method.IsConstructor())\n        && !ContainsMatchTimeout(method)\n        && !NoBacktracking(method, node, model);\n\n    private static bool ContainsMatchTimeout(IMethodSymbol method) =>\n        method.Parameters.Any(x => x.Name == \"matchTimeout\");\n\n    private bool NoBacktracking(IMethodSymbol method, SyntaxNode node, SemanticModel model) =>\n        method.Parameters.SingleOrDefault(x => x.Name == \"options\") is { } parameter\n        && Language.MethodParameterLookup(node, method).TryGetNonParamsSyntax(parameter, out var expression)\n        && Language.FindConstantValue(model, expression) is int options\n        && (options & NonBacktracking) == NonBacktracking;\n\n    private bool IsCandidateCtor(SyntaxNode ctorNode) =>\n        Language.Syntax.ArgumentExpressions(ctorNode).Count() < 3;\n\n    private bool IsRegexMatchMethod(string name) =>\n        matchMethods.Any(x => x.Equals(name, Language.NameComparison));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/Hotspots/UsingNonstandardCryptographyBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class UsingNonstandardCryptographyBase<TSyntaxKind, TTypeDeclarationSyntax> : HotspotDiagnosticAnalyzer\n        where TTypeDeclarationSyntax : SyntaxNode\n        where TSyntaxKind : struct\n    {\n        private const string DiagnosticId = \"S2257\";\n        private const string MessageFormat = \"Make sure using a non-standard cryptographic algorithm is safe here.\";\n\n        private readonly ImmutableArray<KnownType> nonInheritableClassesAndInterfaces = ImmutableArray.Create(\n            KnownType.System_Security_Cryptography_AsymmetricAlgorithm,\n            KnownType.System_Security_Cryptography_AsymmetricKeyExchangeDeformatter,\n            KnownType.System_Security_Cryptography_AsymmetricKeyExchangeFormatter,\n            KnownType.System_Security_Cryptography_AsymmetricSignatureDeformatter,\n            KnownType.System_Security_Cryptography_AsymmetricSignatureFormatter,\n            KnownType.System_Security_Cryptography_DeriveBytes,\n            KnownType.System_Security_Cryptography_HashAlgorithm,\n            KnownType.System_Security_Cryptography_ICryptoTransform,\n            KnownType.System_Security_Cryptography_SymmetricAlgorithm);\n        private readonly DiagnosticDescriptor rule;\n\n        protected abstract ILanguageFacade Language { get; }\n        protected abstract TSyntaxKind[] SyntaxKinds { get; }\n        protected abstract Location Location(TTypeDeclarationSyntax typeDeclarationSyntax);\n        protected abstract bool DerivesOrImplementsAny(TTypeDeclarationSyntax typeDeclarationSyntax);\n        protected abstract INamedTypeSymbol DeclaredSymbol(TTypeDeclarationSyntax typeDeclarationSyntax, SemanticModel semanticModel);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(rule);\n\n        protected UsingNonstandardCryptographyBase(IAnalyzerConfiguration analyzerConfiguration) : base(analyzerConfiguration) =>\n            rule = Language.CreateDescriptor(DiagnosticId, MessageFormat);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(Language.GeneratedCodeRecognizer, c =>\n                {\n                    var declaration = (TTypeDeclarationSyntax)c.Node;\n                    if (!c.IsRedundantPositionalRecordContext()\n                        && IsEnabled(c.Options)\n                        && DerivesOrImplementsAny(declaration)\n                        && DeclaredSymbol(declaration, c.Model).DerivesOrImplementsAny(nonInheritableClassesAndInterfaces))\n                    {\n                        c.ReportIssue(rule, Location(declaration));\n                    }\n                },\n                SyntaxKinds);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/IfChainWithoutElseBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class IfChainWithoutElseBase<TSyntaxKind, TIfSyntax> : SonarDiagnosticAnalyzer<TSyntaxKind>\n        where TSyntaxKind : struct\n        where TIfSyntax : SyntaxNode\n    {\n        protected const string DiagnosticId = \"S126\";\n\n        protected abstract TSyntaxKind SyntaxKind { get; }\n        protected abstract string ElseClause { get; }\n\n        protected abstract bool IsElseIfWithoutElse(TIfSyntax ifSyntax);\n        protected abstract Location IssueLocation(SonarSyntaxNodeReportingContext context, TIfSyntax ifSyntax);\n\n        protected override string MessageFormat => \"Add the missing '{0}' clause with either the appropriate action or a suitable comment as to why no action is taken.\";\n\n        protected IfChainWithoutElseBase() : base(DiagnosticId) { }\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(Language.GeneratedCodeRecognizer,\n                c =>\n                {\n                    var ifNode = (TIfSyntax)c.Node;\n                    if (!IsElseIfWithoutElse(ifNode))\n                    {\n                        return;\n                    }\n\n                    c.ReportIssue(Rule, IssueLocation(c, ifNode), ElseClause);\n                },\n                SyntaxKind);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/IfCollapsibleBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class IfCollapsibleBase : SonarDiagnosticAnalyzer\n{\n    protected const string DiagnosticId = \"S1066\";\n    protected const string MessageFormat = \"Merge this if statement with the enclosing one.\";\n    protected const string SecondaryMessage = \"Merge this if statement with its nested one.\";\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/ImplementSerializationMethodsCorrectlyBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class ImplementSerializationMethodsCorrectlyBase : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S3927\";\n        private const string MessageFormat = \"Make this method {0}.\";\n        private const string AttributeNotConsideredMessageFormat = \"Serialization attributes on {0} are not considered.\";\n        private const string ProblemParameterText = \"have a single parameter of type 'StreamingContext'\";\n        private const string ProblemGenericParameterText = \"have no type parameters\";\n        private const string ProblemPublicText = \"non-public\";\n        private readonly DiagnosticDescriptor rule;\n\n        private static readonly ImmutableArray<KnownType> SerializationAttributes =\n            ImmutableArray.Create(KnownType.System_Runtime_Serialization_OnSerializingAttribute,\n                                  KnownType.System_Runtime_Serialization_OnSerializedAttribute,\n                                  KnownType.System_Runtime_Serialization_OnDeserializingAttribute,\n                                  KnownType.System_Runtime_Serialization_OnDeserializedAttribute);\n\n        protected abstract ILanguageFacade Language { get; }\n        protected abstract string MethodStaticMessage { get; }\n        protected abstract string MethodReturnTypeShouldBeVoidMessage { get; }\n        protected abstract Location GetIdentifierLocation(IMethodSymbol methodSymbol);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(rule, AttributeNotConsideredRule);\n\n        protected DiagnosticDescriptor AttributeNotConsideredRule { get; init; }\n\n        protected ImplementSerializationMethodsCorrectlyBase()\n        {\n            rule = Language.CreateDescriptor(DiagnosticId, MessageFormat);\n            AttributeNotConsideredRule = Language.CreateDescriptor(DiagnosticId, AttributeNotConsideredMessageFormat);\n        }\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterSymbolAction(c =>\n                {\n                    var methodSymbol = (IMethodSymbol)c.Symbol;\n                    if (!methodSymbol.ContainingType.IsInterface()\n                        && methodSymbol.GetAttributes(SerializationAttributes).Any()\n                        && !HiddenByEditorBrowsableAttribute(methodSymbol)\n                        && FindIssues(methodSymbol) is var issues\n                        && issues.Any()\n                        && GetIdentifierLocation(methodSymbol) is { } location)\n                    {\n                        c.ReportIssue(Language.GeneratedCodeRecognizer, rule, location, issues.ToSentence());\n                    }\n                },\n                SymbolKind.Method);\n\n        private static bool HiddenByEditorBrowsableAttribute(IMethodSymbol methodSymbol) =>\n            methodSymbol.GetAttributes(KnownType.System_ComponentModel_EditorBrowsableAttribute)\n                .Any(x => x.ConstructorArguments.Any(a => (int)a.Value == 1));\n\n        private IEnumerable<string> FindIssues(IMethodSymbol methodSymbol)\n        {\n            var ret = new List<string>();\n            Evaluate(ProblemPublicText, methodSymbol.DeclaredAccessibility == Accessibility.Public);\n            Evaluate(MethodStaticMessage, methodSymbol.IsStatic);\n            Evaluate(MethodReturnTypeShouldBeVoidMessage, !methodSymbol.ReturnsVoid);\n            Evaluate(ProblemGenericParameterText, !methodSymbol.TypeParameters.IsEmpty);\n            Evaluate(ProblemParameterText, methodSymbol.Parameters.Length != 1 || !methodSymbol.Parameters.First().IsType(KnownType.System_Runtime_Serialization_StreamingContext));\n            return ret;\n\n            void Evaluate(string message, bool condition)\n            {\n                if (condition)\n                {\n                    ret.Add(message);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/IndexOfCheckAgainstZeroBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class IndexOfCheckAgainstZeroBase<TSyntaxKind, TBinaryExpressionSyntax> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n    where TBinaryExpressionSyntax : SyntaxNode\n{\n    protected const string DiagnosticId = \"S2692\";\n\n    private static readonly string[] TrackedMethods =\n        [\n            \"IndexOf\",\n            \"IndexOfAny\",\n            \"LastIndexOf\",\n            \"LastIndexOfAny\"\n        ];\n\n    private static readonly ImmutableArray<KnownType> CheckedTypes =\n        ImmutableArray.Create(\n            KnownType.System_MemoryExtensions,  // Span and ReadOnlySpan TrackedMethods are located here\n            KnownType.System_Array,\n            KnownType.System_Collections_Generic_IList_T,\n            KnownType.System_String,\n            KnownType.System_Collections_IList);\n\n    protected abstract TSyntaxKind LessThanExpression { get; }\n    protected abstract TSyntaxKind GreaterThanExpression { get; }\n\n    protected abstract SyntaxNode Left(TBinaryExpressionSyntax binaryExpression);\n    protected abstract SyntaxNode Right(TBinaryExpressionSyntax binaryExpression);\n    protected abstract SyntaxToken OperatorToken(TBinaryExpressionSyntax binaryExpression);\n\n    protected override string MessageFormat => \"0 is a valid index, but this check ignores it.\";\n\n    protected IndexOfCheckAgainstZeroBase() : base(DiagnosticId) { }\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(\n            Language.GeneratedCodeRecognizer,\n            c =>\n            {\n                var lessThan = (TBinaryExpressionSyntax)c.Node;\n                if (IsInvalidComparison(Left(lessThan), Right(lessThan), c.Model))\n                {\n                    c.ReportIssue(Rule, Left(lessThan).CreateLocation(OperatorToken(lessThan)));\n                }\n            },\n            LessThanExpression);\n\n        context.RegisterNodeAction(\n            Language.GeneratedCodeRecognizer,\n            c =>\n            {\n                var greaterThan = (TBinaryExpressionSyntax)c.Node;\n                if (IsInvalidComparison(Right(greaterThan), Left(greaterThan), c.Model))\n                {\n                    c.ReportIssue(Rule, OperatorToken(greaterThan).CreateLocation(Right(greaterThan)));\n                }\n            },\n            GreaterThanExpression);\n    }\n\n    private bool IsInvalidComparison(SyntaxNode constantExpression, SyntaxNode methodInvocationExpression, SemanticModel model) =>\n        Language.ExpressionNumericConverter.ConstantIntValue(constantExpression) is { } constValue\n        && constValue == 0\n        && model.GetSymbolInfo(methodInvocationExpression).Symbol is IMethodSymbol indexOfSymbol\n        && TrackedMethods.Any(x => x.Equals(indexOfSymbol.Name, Language.NameComparison))\n        && indexOfSymbol.ContainingType.DerivesOrImplementsAny(CheckedTypes);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/InsecureEncryptionAlgorithmBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class InsecureEncryptionAlgorithmBase<TSyntaxKind, TInvocationExpressionSyntax, TArgumentListSyntax, TArgumentSyntax>\n        : DoNotCallInsecureSecurityAlgorithmBase<TSyntaxKind, TInvocationExpressionSyntax, TArgumentListSyntax, TArgumentSyntax>\n        where TSyntaxKind : struct\n        where TInvocationExpressionSyntax : SyntaxNode\n        where TArgumentListSyntax : SyntaxNode\n        where TArgumentSyntax : SyntaxNode\n    {\n        protected const string DiagnosticId = \"S5547\";\n        private const string MessageFormat = \"Use a strong cipher algorithm.\";\n\n        protected DiagnosticDescriptor Rule { get; }\n\n        protected override ISet<string> AlgorithmParameterlessFactoryMethods { get; } =\n            new HashSet<string>();\n\n        protected override ISet<string> AlgorithmParameterizedFactoryMethods { get; } =\n            new HashSet<string>\n            {\n                \"System.Security.Cryptography.CryptoConfig.CreateFromName\",\n                \"System.Security.Cryptography.SymmetricAlgorithm.Create\"\n            };\n\n        protected override ISet<string> FactoryParameterNames { get; } =\n            new HashSet<string>\n            {\n                \"DES\",\n                \"3DES\",\n                \"TripleDES\",\n                \"RC2\"\n            };\n\n        private protected override ImmutableArray<KnownType> AlgorithmTypes { get; } =\n            ImmutableArray.Create(\n                KnownType.System_Security_Cryptography_DES,\n                KnownType.System_Security_Cryptography_TripleDES,\n                KnownType.System_Security_Cryptography_RC2,\n                KnownType.Org_BouncyCastle_Crypto_Engines_AesFastEngine\n            );\n\n        protected InsecureEncryptionAlgorithmBase() =>\n            Rule = Language.CreateDescriptor(DiagnosticId, MessageFormat);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/InsecureTemporaryFilesCreationBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class InsecureTemporaryFilesCreationBase<TMemberAccessSyntax, TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n        where TMemberAccessSyntax : SyntaxNode\n        where TSyntaxKind : struct\n    {\n        protected const string DiagnosticId = \"S5445\";\n        private const string VulnerableApiName = \"GetTempFileName\";\n\n        protected override string MessageFormat => \"'Path.GetTempFileName()' is insecure. Use 'Path.GetRandomFileName()' instead.\";\n\n        protected InsecureTemporaryFilesCreationBase() : base(DiagnosticId) { }\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(Language.GeneratedCodeRecognizer, Visit, Language.SyntaxKind.SimpleMemberAccessExpression);\n\n        private void Visit(SonarSyntaxNodeReportingContext context)\n        {\n            var memberAccess = (TMemberAccessSyntax)context.Node;\n            if (Language.Syntax.IsMemberAccessOnKnownType(memberAccess, VulnerableApiName, KnownType.System_IO_Path, context.Model))\n            {\n                context.ReportIssue(Rule, memberAccess);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/InsteadOfAnyBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class InsteadOfAnyBase<TSyntaxKind, TInvocationExpression> : SonarDiagnosticAnalyzer\n    where TSyntaxKind : struct\n    where TInvocationExpression : SyntaxNode\n{\n    private const string ExistsDiagnosticId = \"S6605\";\n    private const string ContainsDiagnosticId = \"S6617\";\n    private const string MessageFormat = \"Collection-specific \\\"{0}\\\" method should be used instead of the \\\"Any\\\" extension.\";\n\n    private readonly DiagnosticDescriptor existsRule;\n    private readonly DiagnosticDescriptor containsRule;\n\n    private static readonly ImmutableArray<KnownType> ExistsTypes = ImmutableArray.Create(\n        KnownType.System_Array,\n        KnownType.System_Collections_Immutable_ImmutableList_T);\n\n    private static readonly ImmutableArray<KnownType> ContainsTypes = ImmutableArray.Create(\n        KnownType.System_Collections_Generic_HashSet_T,\n        KnownType.System_Collections_Generic_SortedSet_T);\n\n    protected abstract ILanguageFacade<TSyntaxKind> Language { get; }\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(existsRule, containsRule);\n\n    protected abstract bool IsSimpleEqualityCheck(TInvocationExpression node, SemanticModel model);\n    protected abstract SyntaxNode GetArgumentExpression(TInvocationExpression invocation, int index);\n    protected abstract bool AreValidOperands(string lambdaVariable, SyntaxNode first, SyntaxNode second);\n\n    protected InsteadOfAnyBase()\n    {\n        existsRule = Language.CreateDescriptor(ExistsDiagnosticId, MessageFormat);\n        containsRule = Language.CreateDescriptor(ContainsDiagnosticId, MessageFormat);\n    }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(Language.GeneratedCodeRecognizer, c =>\n        {\n            var invocation = (TInvocationExpression)c.Node;\n\n            if (IsNameEqualTo(invocation, nameof(Enumerable.Any))\n                && Language.Syntax.HasExactlyNArguments(invocation, 1)\n                && Language.Syntax.Operands(invocation) is { Left: { } left, Right: { } right }\n                && IsCorrectCall(right, c.Model)\n                && c.Model.GetTypeInfo(left).Type is { } type\n                && !Language.Syntax.IsInExpressionTree(c.Model, invocation))\n            {\n                if (ExistsTypes.Any(x => type.DerivesFrom(x)))\n                {\n                    RaiseIssue(c, invocation, existsRule, \"Exists\");\n                }\n                else if (ContainsTypes.Any(x => type.DerivesFrom(x) && IsSimpleEqualityCheck(invocation, c.Model)))\n                {\n                    RaiseIssue(c, invocation, containsRule, \"Contains\");\n                }\n                else if (type.DerivesFrom(KnownType.System_Collections_Generic_List_T))\n                {\n                    if (IsSimpleEqualityCheck(invocation, c.Model))\n                    {\n                        RaiseIssue(c, invocation, containsRule, \"Contains\");\n                    }\n                    else\n                    {\n                        RaiseIssue(c, invocation, existsRule, \"Exists\");\n                    }\n                }\n            }\n        }, Language.SyntaxKind.InvocationExpression);\n\n    protected bool IsNameEqualTo(SyntaxNode node, string name) =>\n        Language.GetName(node).Equals(name, Language.NameComparison);\n\n    protected static bool IsValueTypeOrString(SyntaxNode expression, SemanticModel model) =>\n        model.GetTypeInfo(expression).Type is { } type\n        && (type.IsValueType || type.Is(KnownType.System_String));\n\n    protected bool HasValidInvocationOperands(TInvocationExpression invocation, string lambdaVariableName, SemanticModel model)\n    {\n        if (IsNameEqualTo(invocation, nameof(Equals)))\n        {\n            if (Language.Syntax.HasExactlyNArguments(invocation, 1)) // x.Equals(y)\n            {\n                return Language.Syntax.Operands(invocation).Left is { } left\n                    && HasInvocationValidOperands(left, GetArgumentExpression(invocation, 0))\n                    && IsSystemEquals();\n            }\n            if (Language.Syntax.HasExactlyNArguments(invocation, 2)) // Equals(x,y)\n            {\n                return HasInvocationValidOperands(GetArgumentExpression(invocation, 0), GetArgumentExpression(invocation, 1))\n                    && IsSystemEquals();\n            }\n        }\n        return false;\n\n        bool HasInvocationValidOperands(SyntaxNode first, SyntaxNode second) =>\n            AreValidOperands(lambdaVariableName, first, second) || AreValidOperands(lambdaVariableName, second, first);\n\n        bool IsSystemEquals() =>\n            model.GetSymbolInfo(invocation).Symbol.ContainingNamespace.Name == nameof(System);\n    }\n\n    private static bool IsCorrectCall(SyntaxNode right, SemanticModel model) =>\n        model.GetSymbolInfo(right).Symbol is IMethodSymbol method\n        && method.IsExtensionOn(KnownType.System_Collections_Generic_IEnumerable_T);\n\n    private void RaiseIssue(SonarSyntaxNodeReportingContext c, SyntaxNode invocation, DiagnosticDescriptor rule, string methodName) =>\n        c.ReportIssue(rule, Language.Syntax.NodeIdentifier(invocation)?.GetLocation(), methodName);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/InvalidCastToInterfaceBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing TypeMap = System.Collections.Generic.Dictionary<Microsoft.CodeAnalysis.INamedTypeSymbol, System.Collections.Generic.HashSet<Microsoft.CodeAnalysis.INamedTypeSymbol>>;\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class InvalidCastToInterfaceBase<TSyntaxKind> : SonarDiagnosticAnalyzer\n    where TSyntaxKind : struct\n{\n    protected const string DiagnosticId = \"S1944\";\n    protected const string MessageFormat = \"{0}\";\n    private const string MessageInterface = \"Review this cast; in this project there's no type that implements both '{0}' and '{1}'.\";\n    private const string MessageClass = \"Review this cast; in this project there's no type that extends '{0}' and implements '{1}'.\";\n\n    // Once we remove the old SE engine, this should inherit SonarDiagnosticAnalyzer<TSyntaxKind> to delegate and simplify this scaffolding.\n    public sealed override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n    protected abstract ILanguageFacade<TSyntaxKind> Language { get; }\n    protected abstract DiagnosticDescriptor Rule { get; }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(\n            compilationStartContext =>\n            {\n                var interfaceImplementers = BuildTypeMap(compilationStartContext.Compilation.GlobalNamespace.GetAllNamedTypes());\n                compilationStartContext.RegisterNodeAction(Language.GeneratedCodeRecognizer, c =>\n                    {\n                        var type = Language.Syntax.CastType(c.Node);\n                        var interfaceType = c.Model.GetTypeInfo(type).Type as INamedTypeSymbol;\n                        var expressionType = c.Model.GetTypeInfo(Language.Syntax.CastExpression(c.Node)).Type as INamedTypeSymbol;\n                        if (IsImpossibleCast(interfaceImplementers, interfaceType, expressionType))\n                        {\n                            var location = type.GetLocation();\n                            var interfaceTypeName = interfaceType.ToMinimalDisplayString(c.Model, location.SourceSpan.Start);\n                            var expressionTypeName = expressionType.ToMinimalDisplayString(c.Model, location.SourceSpan.Start);\n                            var message = expressionType.IsInterface() ? MessageInterface : MessageClass;\n                            c.ReportIssue(Rule, location, string.Format(message, expressionTypeName, interfaceTypeName));\n                        }\n                    },\n                    Language.SyntaxKind.CastExpressions);\n            });\n\n    private static TypeMap BuildTypeMap(IEnumerable<INamedTypeSymbol> allTypes)\n    {\n        var ret = new TypeMap();\n        foreach (var type in allTypes)\n        {\n            if (type.IsInterface())\n            {\n                Add(type, type);\n            }\n            foreach (var @interface in type.AllInterfaces)\n            {\n                Add(@interface, type);\n            }\n        }\n        return ret;\n\n        void Add(INamedTypeSymbol key, INamedTypeSymbol value)\n        {\n            if (!ret.TryGetValue(key, out var values))\n            {\n                values = new();\n                ret.Add(key, values);\n            }\n            values.Add(value);\n        }\n    }\n\n    private static bool IsImpossibleCast(TypeMap interfaceImplementers, INamedTypeSymbol interfaceType, INamedTypeSymbol expressionType)\n    {\n        return interfaceType.IsInterface()\n            && ConcreteImplementationExists(interfaceType)\n            && ExpressionTypeIsRelevant()\n            && !expressionType.DerivesOrImplements(interfaceType)\n            && interfaceImplementers.TryGetValue(interfaceType, out var implementers)\n            && !implementers.Any(x => x.DerivesOrImplements(expressionType));\n\n        bool ExpressionTypeIsRelevant() =>\n            expressionType is not null\n            && !expressionType.IsSealed\n            && !expressionType.Is(KnownType.System_Object)\n            && (!expressionType.IsInterface() || ConcreteImplementationExists(expressionType));\n\n        bool ConcreteImplementationExists(INamedTypeSymbol type) =>\n            interfaceImplementers.TryGetValue(type, out var implementers) && implementers.Any(x => x.IsClassOrStruct());\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/JwtSignedBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class JwtSignedBase<TSyntaxKind, TInvocationSyntax> : TrackerHotspotDiagnosticAnalyzer<TSyntaxKind>\n        where TSyntaxKind : struct\n        where TInvocationSyntax : SyntaxNode\n    {\n        protected const string DiagnosticId = \"S5659\";\n        protected const bool JwtBuilderConstructorIsSafe = false;\n        private const string MessageFormat = \"Use only strong cipher algorithms when verifying the signature of this JWT.\";\n        private const int ExtensionStaticCallParameters = 2;\n\n        protected abstract BuilderPatternCondition<TSyntaxKind, TInvocationSyntax> CreateBuilderPatternCondition();\n\n        protected JwtSignedBase(IAnalyzerConfiguration configuration) : base(configuration, DiagnosticId, MessageFormat) { }\n\n        protected override void Initialize(TrackerInput input)\n        {\n            var t = Language.Tracker.Invocation;\n            t.Track(input,\n                t.MatchMethod(\n                    new MemberDescriptor(KnownType.JWT_IJwtDecoder, \"Decode\"),\n                    new MemberDescriptor(KnownType.JWT_IJwtDecoder, \"DecodeToObject\")),\n                t.Or(\n                    t.ArgumentIsBoolConstant(\"verify\", false),\n                    t.MethodHasParameters(1)));\n\n            t.Track(input,\n                t.MatchMethod(\n                    new MemberDescriptor(KnownType.JWT_JwtDecoderExtensions, \"Decode\"),\n                    new MemberDescriptor(KnownType.JWT_JwtDecoderExtensions, \"DecodeToObject\")),\n                t.Or(\n                    t.ArgumentIsBoolConstant(\"verify\", false),\n                    t.MethodHasParameters(1),\n                    t.MethodHasParameters(ExtensionStaticCallParameters)));\n\n            t.Track(input,\n                t.MatchMethod(new MemberDescriptor(KnownType.JWT_Builder_JwtBuilder, \"Decode\")),\n                t.IsInvalidBuilderInitialization(CreateBuilderPatternCondition()));\n        }\n\n        protected BuilderPatternDescriptor<TSyntaxKind, TInvocationSyntax>[] JwtBuilderDescriptors(Func<TInvocationSyntax, bool> singleArgumentIsNotFalseLiteral) =>\n            [\n                new BuilderPatternDescriptor<TSyntaxKind, TInvocationSyntax>(true, Language.Tracker.Invocation.MethodNameIs(\"MustVerifySignature\")),\n                new BuilderPatternDescriptor<TSyntaxKind, TInvocationSyntax>(false, Language.Tracker.Invocation.MethodNameIs(\"DoNotVerifySignature\")),\n                new BuilderPatternDescriptor<TSyntaxKind, TInvocationSyntax>(singleArgumentIsNotFalseLiteral, Language.Tracker.Invocation.MethodNameIs(\"WithVerifySignature\"))\n            ];\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/LineLengthBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class LineLengthBase : ParametrizedDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S103\";\n        internal const string MessageFormat = \"Split this {1} characters long line (which is greater than {0} authorized).\";\n\n        private const int DefaultValueMaximum = 200;\n\n        [RuleParameter(\"maximumLineLength\", PropertyType.Integer, \"The maximum authorized line length.\",\n            DefaultValueMaximum)]\n        public int Maximum { get; set; } = DefaultValueMaximum;\n\n        protected abstract GeneratedCodeRecognizer GeneratedCodeRecognizer { get; }\n\n        protected sealed override void Initialize(SonarParametrizedAnalysisContext context)\n        {\n            context.RegisterTreeAction(\n                GeneratedCodeRecognizer,\n                c =>\n                {\n                    foreach (var line in c.Tree.GetText().Lines\n                        .Where(line => line.Span.Length > Maximum))\n                    {\n                        c.ReportIssue(SupportedDiagnostics[0], c.Tree.GetLocation(line.Span), Maximum.ToString(), line.Span.Length.ToString());\n                    }\n                });\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/LinkedListPropertiesInsteadOfMethodsBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class LinkedListPropertiesInsteadOfMethodsBase<TSyntaxKind, TInvocationExpression> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n    where TInvocationExpression : SyntaxNode\n{\n    internal const string DiagnosticId = \"S6613\";\n\n    protected override string MessageFormat => \"'{0}' property of 'LinkedList' should be used instead of the '{0}()' extension method.\";\n\n    protected abstract bool IsRelevantCallAndType(TInvocationExpression invocation, SemanticModel model);\n\n    protected LinkedListPropertiesInsteadOfMethodsBase() : base(DiagnosticId) { }\n\n    protected sealed override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(Language.GeneratedCodeRecognizer, c =>\n        {\n            var invocation = (TInvocationExpression)c.Node;\n            var methodName = Language.GetName(invocation);\n\n            if (IsFirstOrLast(methodName) && IsRelevantCallAndType(invocation, c.Model))\n            {\n                c.ReportIssue(Rule, Language.Syntax.NodeIdentifier(invocation)?.GetLocation(), methodName);\n            }\n        }, Language.SyntaxKind.InvocationExpression);\n\n    protected static bool IsRelevantType(SyntaxNode right, SemanticModel model) =>\n        model.GetSymbolInfo(right).Symbol is IMethodSymbol method\n        && method.IsExtensionOn(KnownType.System_Collections_Generic_IEnumerable_T);\n\n    private bool IsFirstOrLast(string methodName) =>\n        methodName.Equals(\"First\", Language.NameComparison)\n        || methodName.Equals(\"Last\", Language.NameComparison);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/LooseFilePermissionsBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class LooseFilePermissionsBase<TSyntaxKind, TMemberAccess> : SonarDiagnosticAnalyzer\n    where TSyntaxKind : struct\n    where TMemberAccess : SyntaxNode\n{\n    protected const string DiagnosticId = \"S2612\";\n    protected const string Everyone = \"Everyone\";\n    protected const string MessageFormat = \"Make sure this permission is safe.\";\n\n    protected readonly DiagnosticDescriptor rule;\n\n    protected abstract ILanguageFacade<TSyntaxKind> Language { get; }\n    protected abstract void VisitInvocations(SonarSyntaxNodeReportingContext context);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(rule);\n\n    protected LooseFilePermissionsBase() =>\n        rule = Language.CreateDescriptor(DiagnosticId, MessageFormat);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(c =>\n            {\n                c.RegisterNodeAction(Language.GeneratedCodeRecognizer, VisitInvocations, Language.SyntaxKind.InvocationExpression);\n                c.RegisterNodeAction(Language.GeneratedCodeRecognizer, VisitAssignments, Language.SyntaxKind.IdentifierName);\n            });\n\n    protected void VisitAssignments(SonarSyntaxNodeReportingContext context)\n    {\n        var node = context.Node;\n        if (IsFileAccessPermissions(node, context.Model) && !Language.Syntax.IsPartOfBinaryNegationOrCondition(node))\n        {\n            context.ReportIssue(rule, node);\n        }\n    }\n\n    protected bool IsSetAccessRule(SyntaxNode invocation, SemanticModel model) =>\n        Language.Syntax.NodeExpression(invocation) is TMemberAccess memberAccess\n        && Language.Syntax.IsMemberAccessOnKnownType(memberAccess, \"SetAccessRule\", KnownType.System_Security_AccessControl_FileSystemSecurity, model);\n\n    protected bool IsAddAccessRule(SyntaxNode invocation, SemanticModel model) =>\n        Language.Syntax.NodeExpression(invocation) is TMemberAccess memberAccess\n        && Language.Syntax.IsMemberAccessOnKnownType(memberAccess, \"AddAccessRule\", KnownType.System_Security_AccessControl_FileSystemSecurity, model);\n\n    protected bool IsFileAccessPermissions(SyntaxNode node, SemanticModel model) =>\n        Language.Syntax.NodeIdentifier(node) is { } identifier\n        && LooseFilePermissionsConfig.WeakFileAccessPermissions.Contains(identifier.Text)\n        && node.IsKnownType(KnownType.Mono_Unix_FileAccessPermissions, model);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/LooseFilePermissionsConfig.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic static class LooseFilePermissionsConfig\n{\n    public static readonly ImmutableHashSet<string> WeakFileAccessPermissions =\n        ImmutableHashSet.Create(\"AllPermissions\", \"DefaultPermissions\", \"OtherExecute\", \"OtherWrite\", \"OtherRead\", \"OtherReadWriteExecute\");\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/MarkAssemblyWithAssemblyVersionAttributeBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class MarkAssemblyWithAssemblyVersionAttributeBase() : MarkAssemblyWithAttributeBase(DiagnosticId, MessageFormat)\n    {\n        private const string DiagnosticId = \"S3904\";\n        private const string MessageFormat = \"Provide an 'AssemblyVersion' attribute for assembly '{0}'.\";\n\n        private protected override KnownType AttributeToFind => KnownType.System_Reflection_AssemblyVersionAttribute;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/MarkAssemblyWithAttributeBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class MarkAssemblyWithAttributeBase : SonarDiagnosticAnalyzer\n    {\n        private readonly DiagnosticDescriptor rule;\n\n        protected abstract ILanguageFacade Language { get; }\n        private protected abstract KnownType AttributeToFind { get; }\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(rule);\n\n        protected override bool EnableConcurrentExecution => false;\n\n        protected MarkAssemblyWithAttributeBase(string diagnosticId, string messageFormat) =>\n            rule = Language.CreateDescriptor(diagnosticId, messageFormat);\n\n        protected sealed override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterCompilationStartAction(c =>\n                c.RegisterCompilationEndAction(cc =>\n                    {\n                        if (!cc.Compilation.Assembly.HasAttribute(AttributeToFind) && !cc.Compilation.Assembly.HasAttribute(KnownType.Microsoft_AspNetCore_Razor_Hosting_RazorCompiledItemAttribute))\n                        {\n                            cc.ReportIssue(Language.GeneratedCodeRecognizer, rule, (Location)null, cc.Compilation.AssemblyName);\n                        }\n                    })\n                );\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/MarkAssemblyWithClsCompliantAttributeBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class MarkAssemblyWithClsCompliantAttributeBase() : MarkAssemblyWithAttributeBase(DiagnosticId, MessageFormat)\n    {\n        private const string DiagnosticId = \"S3990\";\n        private const string MessageFormat = \"Provide a 'CLSCompliant' attribute for assembly '{0}'.\";\n\n        private protected override KnownType AttributeToFind => KnownType.System_CLSCompliantAttribute;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/MarkAssemblyWithComVisibleAttributeBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class MarkAssemblyWithComVisibleAttributeBase() : MarkAssemblyWithAttributeBase(DiagnosticId, MessageFormat)\n    {\n        private const string DiagnosticId = \"S3992\";\n        private const string MessageFormat = \"Provide a 'ComVisible' attribute for assembly '{0}'.\";\n\n        private protected override KnownType AttributeToFind => KnownType.System_Runtime_InteropServices_ComVisibleAttribute;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/MarkWindowsFormsMainWithStaThreadBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class MarkWindowsFormsMainWithStaThreadBase<TSyntaxKind, TMethodSyntax> : SonarDiagnosticAnalyzer<TSyntaxKind>\n        where TSyntaxKind : struct\n        where TMethodSyntax : SyntaxNode\n    {\n        private const string DiagnosticId = \"S4210\";\n        private const string AddStaThreadMessage = \"Add the 'STAThread' attribute to this entry point.\";\n        private const string ChangeMtaThreadToStaThreadMessage = \"Change the 'MTAThread' attribute of this entry point to 'STAThread'.\";\n\n        protected abstract TSyntaxKind[] SyntaxKinds { get; }\n\n        protected abstract Location GetLocation(TMethodSyntax method);\n\n        protected override string MessageFormat => \"{0}\";\n\n        protected MarkWindowsFormsMainWithStaThreadBase() : base(DiagnosticId) { }\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(Language.GeneratedCodeRecognizer, Action, SyntaxKinds);\n\n        private void Action(SonarSyntaxNodeReportingContext c)\n        {\n            var methodDeclaration = (TMethodSyntax)c.Node;\n\n            if (c.Model.GetDeclaredSymbol(methodDeclaration) is IMethodSymbol methodSymbol\n                && methodSymbol.IsMainMethod()\n                && !methodSymbol.IsAsync\n                && !methodSymbol.HasAttribute(KnownType.System_STAThreadAttribute)\n                && IsAssemblyReferencingWindowsForms(c.Model.Compilation)\n                && c.Compilation.Options.OutputKind == OutputKind.WindowsApplication)\n            {\n                var message = methodSymbol.HasAttribute(KnownType.System_MTAThreadAttribute)\n                    ? ChangeMtaThreadToStaThreadMessage\n                    : AddStaThreadMessage;\n\n                c.ReportIssue(Rule, GetLocation(methodDeclaration), message);\n            }\n        }\n\n        private static bool IsAssemblyReferencingWindowsForms(Compilation compilation) =>\n            compilation.ReferencedAssemblyNames.Any(r => r.IsStrongName && r.Name == \"System.Windows.Forms\");\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/MethodOverloadsShouldBeGroupedBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class MethodOverloadsShouldBeGroupedBase<TSyntaxKind, TMemberDeclarationSyntax> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n    where TMemberDeclarationSyntax : SyntaxNode\n{\n    protected const string DiagnosticId = \"S4136\";\n\n    protected abstract TSyntaxKind[] SyntaxKinds { get; }\n\n    protected abstract IEnumerable<TMemberDeclarationSyntax> MemberDeclarations(SyntaxNode node);\n    protected abstract MemberInfo CreateMemberInfo(SonarSyntaxNodeReportingContext c, TMemberDeclarationSyntax member);\n\n    protected override string MessageFormat => \"All '{0}' method overloads should be adjacent.\";\n\n    protected MethodOverloadsShouldBeGroupedBase() : base(DiagnosticId) { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            Language.GeneratedCodeRecognizer, c =>\n            {\n                if (c.IsRedundantPositionalRecordContext())\n                {\n                    return;\n                }\n\n                foreach (var misplacedOverload in MisplacedOverloads(c, MemberDeclarations(c.Node)))\n                {\n                    var firstName = misplacedOverload[0].NameSyntax;\n                    var secondaryLocations = misplacedOverload.Skip(1).Select(x => new SecondaryLocation(x.NameSyntax.GetLocation(), \"Non-adjacent overload\")).ToList();\n                    c.ReportIssue(Rule, firstName, secondaryLocations, firstName.ValueText);\n                }\n            },\n            SyntaxKinds);\n\n    protected List<MemberInfo>[] MisplacedOverloads(SonarSyntaxNodeReportingContext c, IEnumerable<TMemberDeclarationSyntax> members)\n    {\n        var misplacedOverloads = new Dictionary<MemberInfo, List<MemberInfo>>();\n        var membersGroupedByInterface = MembersGroupedByInterface(c, members);\n        MemberInfo previous = null;\n        foreach (var member in members)\n        {\n            if (CreateMemberInfo(c, member) is not MemberInfo current)\n            {\n                previous = null;\n                continue;\n            }\n\n            if (misplacedOverloads.TryGetValue(current, out var values))\n            {\n                if (!current.NameEquals(previous) && IsMisplacedCandidate(member, values))\n                {\n                    values.Add(current);\n                }\n            }\n            else\n            {\n                misplacedOverloads.Add(current, [current]);\n            }\n            previous = current;\n        }\n        return misplacedOverloads.Values.Where(x => x.Count > 1).ToArray();\n\n        bool IsMisplacedCandidate(TMemberDeclarationSyntax member, List<MemberInfo> others) =>\n            !membersGroupedByInterface.TryGetValue(member, out var interfaces)\n            || (interfaces.Length == 1 && others.Any(x => FindInterfaces(c.Model, x.Member).Contains(interfaces.Single())));\n    }\n\n    /// <summary>\n    /// Function returns members that are considered to be grouped with another member of the same interface (adjacent members).\n    /// These members are allowed to be grouped by interface and not forced to be grouped by member name.\n    /// Another overload (not related by interface) can be placed somewhere else.\n    ///\n    /// Returned ImmutableArray of interfaces for each member is used to determine whether overloads of the same interface should be grouped by name.\n    /// If all methods of the class implement single interface, we want the overloads to be placed together within interface group.\n    /// </summary>\n    private static Dictionary<TMemberDeclarationSyntax, ImmutableArray<INamedTypeSymbol>> MembersGroupedByInterface(SonarSyntaxNodeReportingContext c, IEnumerable<TMemberDeclarationSyntax> members)\n    {\n        var ret = new Dictionary<TMemberDeclarationSyntax, ImmutableArray<INamedTypeSymbol>>();\n        var previousInterfaces = ImmutableArray<INamedTypeSymbol>.Empty;\n        TMemberDeclarationSyntax previous = null;\n        foreach (var member in members)\n        {\n            var currentInterfaces = FindInterfaces(c.Model, member);\n            if (currentInterfaces.Intersect(previousInterfaces).Any())\n            {\n                ret.Add(member, currentInterfaces);\n                if (previous is not null && !ret.ContainsKey(previous))\n                {\n                    ret.Add(previous, previousInterfaces);\n                }\n            }\n            previousInterfaces = currentInterfaces;\n            previous = member;\n        }\n        return ret;\n    }\n\n    private static ImmutableArray<INamedTypeSymbol> FindInterfaces(SemanticModel model, TMemberDeclarationSyntax member)\n    {\n        var ret = new HashSet<INamedTypeSymbol>();\n        if (model.GetDeclaredSymbol(member) is { } symbol)\n        {\n            ret.AddRange(ExplicitInterfaceImplementations(symbol).Select(x => x.ContainingType));\n            ret.AddRange(symbol.ContainingType.AllInterfaces.Where(IsImplicityImplemented));\n        }\n        return ret.ToImmutableArray();\n\n        bool IsImplicityImplemented(INamedTypeSymbol @interface) =>\n            @interface.GetMembers().Any(x => symbol.ContainingType.FindImplementationForInterfaceMember(x)?.Equals(symbol) == true);\n    }\n\n    private static IEnumerable<ISymbol> ExplicitInterfaceImplementations(ISymbol symbol) =>\n        symbol switch\n        {\n            IEventSymbol @event => @event.ExplicitInterfaceImplementations,\n            IMethodSymbol method => method.ExplicitInterfaceImplementations,\n            IPropertySymbol property => property.ExplicitInterfaceImplementations,\n            _ => []\n        };\n\n    protected class MemberInfo\n    {\n        private readonly string accessibility;\n        private readonly bool isStatic;\n        private readonly bool isAbstract;\n        private readonly bool isCaseSensitive;\n\n        public TMemberDeclarationSyntax Member { get; }\n        public SyntaxToken NameSyntax { get; }\n\n        public MemberInfo(SonarSyntaxNodeReportingContext context, TMemberDeclarationSyntax member, SyntaxToken nameSyntax, bool isStatic, bool isAbstract, bool isCaseSensitive)\n        {\n            Member = member;\n            accessibility = context.Model.GetDeclaredSymbol(member)?.DeclaredAccessibility.ToString();\n            NameSyntax = nameSyntax;\n            this.isStatic = isStatic;\n            this.isAbstract = isAbstract;\n            this.isCaseSensitive = isCaseSensitive;\n        }\n\n        public bool NameEquals(MemberInfo other) =>\n            NameSyntax.ValueText.Equals(other?.NameSyntax.ValueText, isCaseSensitive ? StringComparison.InvariantCulture : StringComparison.InvariantCultureIgnoreCase);\n\n        public override bool Equals(object obj) =>\n            // Groups that should be together are defined by accessibility, abstract, static and member name #4136\n            obj is MemberInfo other\n            && NameEquals(other)\n            && accessibility == other.accessibility\n            && isStatic == other.isStatic\n            && isAbstract == other.isAbstract;\n\n        public override int GetHashCode() =>\n            NameSyntax.ValueText.ToUpperInvariant().GetHashCode();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/MethodParameterUnusedBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class MethodParameterUnusedBase : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S1172\";\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/MethodsShouldNotHaveIdenticalImplementationsBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class MethodsShouldNotHaveIdenticalImplementationsBase<TSyntaxKind, TMethodDeclarationSyntax> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n{\n    private const string DiagnosticId = \"S4144\";\n\n    protected abstract TSyntaxKind[] SyntaxKinds { get; }\n\n    protected abstract IEnumerable<TMethodDeclarationSyntax> GetMethodDeclarations(SyntaxNode node);\n    protected abstract SyntaxToken GetMethodIdentifier(TMethodDeclarationSyntax method);\n    protected abstract bool AreDuplicates(SemanticModel model, TMethodDeclarationSyntax firstMethod, TMethodDeclarationSyntax secondMethod);\n\n    protected override string MessageFormat => \"Update this method so that its implementation is not identical to '{0}'.\";\n\n    protected MethodsShouldNotHaveIdenticalImplementationsBase() : base(DiagnosticId) { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            Language.GeneratedCodeRecognizer, c =>\n            {\n                if (IsExcludedFromBeingExamined(c))\n                {\n                    return;\n                }\n\n                var methodsToHandle = new LinkedList<TMethodDeclarationSyntax>(GetMethodDeclarations(c.Node));\n\n                while (methodsToHandle.Any())\n                {\n                    var method = methodsToHandle.First.Value;\n                    methodsToHandle.RemoveFirst();\n                    var duplicates = methodsToHandle.Where(x => AreDuplicates(c.Model, method, x)).ToList();\n\n                    foreach (var duplicate in duplicates)\n                    {\n                        methodsToHandle.Remove(duplicate);\n                        var identifier = GetMethodIdentifier(method);\n                        var otherIdentifier = GetMethodIdentifier(duplicate);\n                        c.ReportIssue(SupportedDiagnostics[0], otherIdentifier, [identifier.ToSecondaryLocation(MessageFormat, otherIdentifier.ValueText)], identifier.ValueText);\n                    }\n                }\n            },\n            SyntaxKinds);\n\n    protected virtual bool IsExcludedFromBeingExamined(SonarSyntaxNodeReportingContext context) =>\n        context.ContainingSymbol.Kind != SymbolKind.NamedType;\n\n    protected static bool HaveSameParameters<TSyntax>(SeparatedSyntaxList<TSyntax>? leftParameters, SeparatedSyntaxList<TSyntax>? rightParameters)\n        where TSyntax : SyntaxNode =>\n        (leftParameters is null && rightParameters is null) // In VB.Net the parameter list can be omitted\n        || (leftParameters?.Count == rightParameters?.Count && HaveSameParameterLists(leftParameters.Value, rightParameters.Value));\n\n    protected static bool HaveSameTypeParameters<TSyntax>(SemanticModel model, SeparatedSyntaxList<TSyntax>? firstTypeParameterList, SeparatedSyntaxList<TSyntax>? secondTypeParameterList)\n        where TSyntax : SyntaxNode\n    {\n        var firstSymbols = firstTypeParameterList?.Select(x => model.GetDeclaredSymbol(x)).OfType<ITypeParameterSymbol>() ?? [];\n        var secondSymbols = secondTypeParameterList?.Select(x => model.GetDeclaredSymbol(x)).OfType<ITypeParameterSymbol>().ToArray() ?? [];\n        return firstSymbols.All(x => Array.Exists(secondSymbols, secondSymbol => TypeParametersHaveSameNameAndConstraints(x, secondSymbol)));\n    }\n\n    protected static bool AreTheSameType(SemanticModel model, SyntaxNode first, SyntaxNode second) =>\n        (first is null && second is null)\n        || (first is not null && second is not null\n            && AreTheSameTypeSymbols(model.GetTypeInfo(first).Type, model.GetTypeInfo(second).Type));\n\n    private static bool AreTheSameTypeSymbols(ITypeSymbol first, ITypeSymbol second) =>\n        first is not null\n        && second is not null\n        && (first.Equals(second)                                                                    // string == System.String, Task<int> == Task<int>\n            || AreSameNamedTypeParameters(first, second)                                            // T == T (type parameter with same name)\n            || TypesAreSameGenericType(first, second)                                               // List<T> == List<T>, (T,V) == (T,V)\n            || (first is IArrayTypeSymbol firstArray && second is IArrayTypeSymbol secondArray      // T[] == T[]\n                && AreTheSameTypeSymbols(firstArray.ElementType, secondArray.ElementType)));\n\n    private static bool HaveSameParameterLists<TSyntax>(SeparatedSyntaxList<TSyntax> firstParameters,\n                                                        SeparatedSyntaxList<TSyntax> secondParameters) where TSyntax : SyntaxNode =>\n        firstParameters.Equals(secondParameters, (first, second) => first.IsEquivalentTo(second)); // Perf: Syntactic equivalence for all parameters\n\n    private static bool TypeParametersHaveSameNameAndConstraints(ITypeParameterSymbol first, ITypeParameterSymbol second) =>\n        first.Name == second.Name\n        && first.HasConstructorConstraint == second.HasConstructorConstraint\n        && first.HasReferenceTypeConstraint == second.HasReferenceTypeConstraint\n        && first.HasValueTypeConstraint == second.HasValueTypeConstraint\n        && first.HasUnmanagedTypeConstraint() == second.HasUnmanagedTypeConstraint()\n        && first.ConstraintTypes.Length == second.ConstraintTypes.Length\n        && first.ConstraintTypes.All(x => second.ConstraintTypes.Any(y => TypeConstraintsAreSame(x, y)));\n\n    private static bool TypeConstraintsAreSame(ITypeSymbol first, ITypeSymbol second) =>\n        first.Equals(second) // M1<T>(T x) where T: IComparable <-> M2<T>(T x) where T: IComparable\n        || AreSameNamedTypeParameters(first, second) // M1<T1, T2>() where T1: T2 <-> M2<T1, T2>() where T1: T2\n                                                     // T2 of M1 is a different symbol than T2 of M2, but if they have the same name they can be interchanged.\n                                                     // T2 equivalency is checked as well by the TypeConstraintsAreSame call in TypeParametersHaveSameNameAndConstraints.\n        || TypesAreSameGenericType(first, second) // M1<T>(T x) where T: IEquatable<T> <-> M2<T>(T x) where T: IEquatable<T>\n        || (first is IArrayTypeSymbol firstArray && second is IArrayTypeSymbol secondArray // T[] == T[]\n            && TypeConstraintsAreSame(firstArray.ElementType, secondArray.ElementType));\n\n    private static bool TypesAreSameGenericType(ITypeSymbol firstParameterType, ITypeSymbol secondParameterType) =>\n        firstParameterType is INamedTypeSymbol { IsGenericType: true } namedTypeFirst\n        && secondParameterType is INamedTypeSymbol { IsGenericType: true } namedTypeSecond\n        && namedTypeFirst.OriginalDefinition.Equals(namedTypeSecond.OriginalDefinition)\n        && namedTypeFirst.TypeArguments.Length == namedTypeSecond.TypeArguments.Length\n        && namedTypeFirst.TypeArguments.Equals(namedTypeSecond.TypeArguments, TypeConstraintsAreSame);\n\n    private static bool AreSameNamedTypeParameters(ITypeSymbol first, ITypeSymbol second) =>\n        first is ITypeParameterSymbol x && second is ITypeParameterSymbol y && x.Name == y.Name;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/MethodsShouldNotHaveTooManyLinesBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class MethodsShouldNotHaveTooManyLinesBase<TSyntaxKind, TBaseMethodSyntax>\n        : ParametrizedDiagnosticAnalyzer\n        where TSyntaxKind : struct\n        where TBaseMethodSyntax : SyntaxNode\n    {\n        internal const string DiagnosticId = \"S138\";\n        protected const string MessageFormat = \"This {0} has {1} lines, which is greater than the {2} lines authorized. Split it into smaller {3}.\";\n\n        private const int DefaultMaxMethodLines = 80;\n        [RuleParameter(\"max\", PropertyType.Integer, \"Maximum authorized lines of code in a method\", DefaultMaxMethodLines)]\n        public int Max { get; set; } = DefaultMaxMethodLines;\n\n        protected abstract GeneratedCodeRecognizer GeneratedCodeRecognizer { get; }\n        protected abstract TSyntaxKind[] SyntaxKinds { get; }\n        protected abstract string MethodKeyword { get; }\n\n        protected abstract IEnumerable<SyntaxToken> GetMethodTokens(TBaseMethodSyntax baseMethodDeclaration);\n        protected abstract SyntaxToken? GetMethodIdentifierToken(TBaseMethodSyntax baseMethodDeclaration);\n        protected abstract string GetMethodKindAndName(SyntaxToken identifierToken);\n\n        protected override void Initialize(SonarParametrizedAnalysisContext context) =>\n            context.RegisterNodeAction(\n                GeneratedCodeRecognizer,\n                c =>\n                {\n                    if (Max < 2)\n                    {\n                        throw new InvalidOperationException($\"Invalid rule parameter: maximum number of lines = {Max}. Must be at least 2.\");\n                    }\n\n                    var baseMethod = (TBaseMethodSyntax)c.Node;\n                    var linesCount = GetMethodTokens(baseMethod).SelectMany(token => token.LineNumbers())\n                                                                .Distinct()\n                                                                .LongCount();\n\n                    if (linesCount > Max)\n                    {\n                        var identifierToken = GetMethodIdentifierToken(baseMethod);\n\n                        if (!string.IsNullOrEmpty(identifierToken?.ValueText))\n                        {\n                            c.ReportIssue(\n                                SupportedDiagnostics[0],\n                                identifierToken.Value,\n                                GetMethodKindAndName(identifierToken.Value),\n                                linesCount.ToString(),\n                                Max.ToString(),\n                                MethodKeyword);\n                        }\n                    }\n                },\n                SyntaxKinds);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/MultipleVariableDeclarationBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic static class MultipleVariableDeclarationConstants\n{\n    internal const string DiagnosticId = \"S1659\";\n}\n\npublic abstract class MultipleVariableDeclarationBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n{\n    protected override string MessageFormat => \"Declare '{0}' in a separate statement.\";\n\n    protected MultipleVariableDeclarationBase() : base(MultipleVariableDeclarationConstants.DiagnosticId) { }\n\n    protected sealed override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(\n            Language.GeneratedCodeRecognizer,\n            c =>\n            {\n                CheckAndReportVariables(c, Rule, Language.Syntax.LocalDeclarationIdentifiers(c.Node));\n            },\n            Language.SyntaxKind.LocalDeclaration);\n\n        context.RegisterNodeAction(\n            Language.GeneratedCodeRecognizer,\n            c =>\n            {\n                CheckAndReportVariables(c, Rule, Language.Syntax.FieldDeclarationIdentifiers(c.Node));\n            },\n            Language.SyntaxKind.FieldDeclaration);\n    }\n\n    private static void CheckAndReportVariables(SonarSyntaxNodeReportingContext context, DiagnosticDescriptor rule, ICollection<SyntaxToken> variables)\n    {\n        if (variables.Count <= 1)\n        {\n            return;\n        }\n        foreach (var variable in variables.Skip(1))\n        {\n            context.ReportIssue(rule, variable, variable.ValueText);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/MultipleVariableDeclarationCodeFixBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class MultipleVariableDeclarationCodeFixBase : SonarCodeFix\n{\n    internal const string Title = \"Separate declarations\";\n\n    public sealed override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(MultipleVariableDeclarationConstants.DiagnosticId);\n\n    protected sealed override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n    {\n        var diagnostic = context.Diagnostics.First();\n        var diagnosticSpan = diagnostic.Location.SourceSpan;\n        var node = root.FindNode(diagnosticSpan, getInnermostNodeForTie: true);\n        context.RegisterCodeFix(\n            Title,\n            c =>\n            {\n                var newRoot = CalculateNewRoot(root, node);\n                return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n            },\n            context.Diagnostics);\n\n        return Task.CompletedTask;\n    }\n\n    protected abstract SyntaxNode CalculateNewRoot(SyntaxNode root, SyntaxNode node);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/NameOfShouldBeUsedBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class NameOfShouldBeUsedBase<TMethodSyntax, TSyntaxKind, TThrowSyntax> : SonarDiagnosticAnalyzer<TSyntaxKind>\n        where TMethodSyntax : SyntaxNode\n        where TSyntaxKind : struct\n        where TThrowSyntax : SyntaxNode\n    {\n        private const string DiagnosticId = \"S2302\";\n        // when the parameter name is inside a bigger string, we want to avoid common English words like \"a\", \"then\", \"he\", \"of\", \"have\" etc, to avoid false positives\n        private const int MinStringLength = 5;\n        private readonly char[] separators = { ' ', '.', ',', ';', '!', '?' };\n\n        protected abstract string NameOf { get; }\n        protected abstract IEnumerable<string> GetParameterNames(TMethodSyntax method); // Handle parameters with the same name (in the IDE it can happen)\n        protected abstract bool IsStringLiteral(SyntaxToken t);\n        protected abstract bool LeastLanguageVersionMatches(SonarSyntaxNodeReportingContext context);\n        protected abstract bool IsArgumentExceptionCallingNameOf(SyntaxNode node, IEnumerable<string> arguments);\n        protected abstract TMethodSyntax MethodSyntax(SyntaxNode node);\n\n        protected override string MessageFormat => \"Replace the string '{0}' with '{1}({0})'.\";\n\n        protected NameOfShouldBeUsedBase() : base(DiagnosticId) { }\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            var kinds = Language.SyntaxKind.MethodDeclarations.ToList();\n            kinds.Add(Language.SyntaxKind.ConstructorDeclaration);\n            context.RegisterNodeAction(Language.GeneratedCodeRecognizer, ReportIssues, kinds.ToArray());\n        }\n\n        protected int ArgumentExceptionNameOfPosition(string name)\n        {\n            if (name.Equals(\"ArgumentNullException\", Language.NameComparison) || name.Equals(\"ArgumentOutOfRangeException\", Language.NameComparison))\n            {\n                return 0;\n            }\n            else if (name.Equals(\"ArgumentException\", Language.NameComparison))\n            {\n                return 1;\n            }\n            else\n            {\n                return int.MaxValue - 1;\n            }\n        }\n\n        private void ReportIssues(SonarSyntaxNodeReportingContext context)\n        {\n            if (!LeastLanguageVersionMatches(context))\n            {\n                return;\n            }\n\n            var methodSyntax = MethodSyntax(context.Node);\n            var parameterNames = GetParameterNames(methodSyntax);\n            // either no parameters, or duplicated parameters\n            if (!parameterNames.Any())\n            {\n                return;\n            }\n\n            var stringTokensInsideThrowExpressions = methodSyntax\n                .DescendantNodes()\n                .OfType<TThrowSyntax>()\n                .Where(x => !IsArgumentExceptionCallingNameOf(x, parameterNames))\n                .SelectMany(th => th.DescendantTokens())\n                .Where(IsStringLiteral);\n\n            foreach (var stringTokenAndParam in GetStringTokenAndParamNamePairs(stringTokensInsideThrowExpressions, parameterNames))\n            {\n                context.ReportIssue(Rule, stringTokenAndParam.Key, stringTokenAndParam.Value, NameOf);\n            }\n        }\n\n        /// <summary>\n        /// Iterates over the string tokens (either from simple strings or from interpolated strings)\n        /// and returns pairs where\n        /// - the key is the string SyntaxToken which contains the verbatim parameter name\n        /// - the value is the name of the parameter which is present in the string token.\n        /// </summary>\n        private Dictionary<SyntaxToken, string> GetStringTokenAndParamNamePairs(IEnumerable<SyntaxToken> tokens, IEnumerable<string> parameterNames)\n        {\n            var result = new Dictionary<SyntaxToken, string>();\n            foreach (var stringToken in tokens)\n            {\n                var stringTokenText = stringToken.ValueText;\n                foreach (var parameterName in parameterNames)\n                {\n                    if (parameterName.Equals(stringTokenText, Language.NameComparison))\n                    {\n                        // given it's exact equality, there can be only one stringToken key in the dictionary\n                        result.Add(stringToken, parameterName);\n                    }\n                    else if (parameterName.Length > MinStringLength\n                        // we are looking at the words inside the string, so there can be multiple parameters matching inside the token stop after the first one is found\n                        && !result.ContainsKey(stringToken)\n                        && stringTokenText.Split(separators, StringSplitOptions.RemoveEmptyEntries).Any(word => word.Equals(parameterName, Language.NameComparison)))\n                    {\n                        result.Add(stringToken, parameterName);\n                    }\n                }\n            }\n            return result;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/NoExceptionsInFinallyBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class NoExceptionsInFinallyBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n        where TSyntaxKind : struct\n    {\n        protected const string DiagnosticId = \"S1163\";\n\n        protected override string MessageFormat => \"Refactor this code to not throw exceptions in finally blocks.\";\n\n        protected NoExceptionsInFinallyBase() : base(DiagnosticId) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/NonAsyncTaskShouldNotReturnNullBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class NonAsyncTaskShouldNotReturnNullBase : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S4586\";\n\n        private static readonly ImmutableArray<KnownType> TaskTypes =\n            ImmutableArray.Create(\n                KnownType.System_Threading_Tasks_Task,\n                KnownType.System_Threading_Tasks_Task_T\n            );\n\n        protected static bool IsInvalidEnclosingSymbolContext(SyntaxNode enclosingMember, SemanticModel model)\n        {\n            var enclosingMemberSymbol = model.GetDeclaredSymbol(enclosingMember) ?? model.GetSymbolInfo(enclosingMember).Symbol;\n            var enclosingMemberMethodSymbol = enclosingMemberSymbol as IMethodSymbol;\n\n            return enclosingMemberSymbol != null\n                && IsTaskReturnType(enclosingMemberSymbol, enclosingMemberMethodSymbol)\n                && !IsSafeTaskReturnType(enclosingMemberMethodSymbol);\n        }\n\n        private static bool IsTaskReturnType(ISymbol symbol, IMethodSymbol methodSymbol)\n        {\n            return GetReturnType() is INamedTypeSymbol namedTypeSymbol\n                && namedTypeSymbol.ConstructedFrom.DerivesFromAny(TaskTypes);\n\n            ITypeSymbol GetReturnType() =>\n                methodSymbol != null\n                    ? methodSymbol.ReturnType\n                    : symbol.GetSymbolType();\n        }\n\n        private static bool IsSafeTaskReturnType(IMethodSymbol methodSymbol) =>\n            // IMethodSymbol also handles lambdas\n            methodSymbol != null\n            && methodSymbol.IsAsync;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/ObsoleteAttributesBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class ObsoleteAttributesBase<TSyntaxKind> : SonarDiagnosticAnalyzer\n    where TSyntaxKind : struct\n{\n    private const string ExplanationNeededDiagnosticId = \"S1123\";\n    private const string ExplanationNeededMessageFormat = \"Add an explanation.\";\n\n    private const string RemoveDiagnosticId = \"S1133\";\n    private const string RemoveMessageFormat = \"Do not forget to remove this deprecated code someday.\";\n\n    protected abstract ILanguageFacade<TSyntaxKind> Language { get; }\n\n    protected abstract SyntaxNode GetExplanationExpression(SyntaxNode node);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; }\n\n    internal DiagnosticDescriptor ExplanationNeededRule { get; }\n    internal DiagnosticDescriptor RemoveRule { get; }\n\n    protected ObsoleteAttributesBase()\n    {\n        ExplanationNeededRule = Language.CreateDescriptor(ExplanationNeededDiagnosticId, ExplanationNeededMessageFormat);\n        RemoveRule = Language.CreateDescriptor(RemoveDiagnosticId, RemoveMessageFormat);\n        SupportedDiagnostics = ImmutableArray.Create(ExplanationNeededRule, RemoveRule);\n    }\n\n    protected sealed override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            Language.GeneratedCodeRecognizer,\n            c =>\n            {\n                if (c.Model.GetSymbolInfo(c.Node).Symbol is { } attribute\n                    && attribute.IsInType(KnownType.System_ObsoleteAttribute))\n                {\n                    var location = c.Node.GetLocation();\n                    c.ReportIssue(RemoveRule, location);\n\n                    if (NoExplanation(c.Node, c.Model))\n                    {\n                        c.ReportIssue(ExplanationNeededRule, location);\n                    }\n                }\n            },\n            Language.SyntaxKind.Attribute);\n\n    private bool NoExplanation(SyntaxNode node, SemanticModel model) =>\n        GetExplanationExpression(node) is not { } justification\n        || string.IsNullOrWhiteSpace(Language.FindConstantValue(model, justification) as string);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/OptionalParameterBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class OptionalParameterBase : SonarDiagnosticAnalyzer\n    {\n        protected const string DiagnosticId = \"S2360\";\n        protected const string MessageFormat = \"Use the overloading mechanism instead of the optional parameters.\";\n\n        protected abstract GeneratedCodeRecognizer GeneratedCodeRecognizer { get; }\n    }\n\n    public abstract class OptionalParameterBase<TLanguageKindEnum, TMethodSyntax, TParameterSyntax> : OptionalParameterBase\n        where TLanguageKindEnum : struct\n        where TMethodSyntax : SyntaxNode\n        where TParameterSyntax: SyntaxNode\n    {\n        protected sealed override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                GeneratedCodeRecognizer,\n                c =>\n                {\n                    var method = (TMethodSyntax)c.Node;\n                    var symbol = c.Model.GetDeclaredSymbol(method);\n\n                    if (symbol == null ||\n                        !symbol.IsPubliclyAccessible() ||\n                        symbol.InterfaceMembers().Any() ||\n                        symbol.GetOverriddenMember() != null)\n                    {\n                        return;\n                    }\n\n                    var parameters = GetParameters(method);\n\n                    foreach (var parameter in parameters.Where(p => IsOptional(p) && !HasAllowedAttribute(p, c.Model)))\n                    {\n                        var location = GetReportLocation(parameter);\n                        c.ReportIssue(SupportedDiagnostics[0], location);\n                    }\n                },\n                SyntaxKindsOfInterest.ToArray());\n        }\n\n        private static bool HasAllowedAttribute(TParameterSyntax parameterSyntax, SemanticModel semanticModel)\n        {\n            var parameterSymbol = semanticModel.GetDeclaredSymbol(parameterSyntax) as IParameterSymbol;\n\n            return parameterSymbol.GetAttributes(KnownType.CallerInfoAttributes).Any();\n        }\n\n        protected abstract IEnumerable<TParameterSyntax> GetParameters(TMethodSyntax method);\n\n        protected abstract bool IsOptional(TParameterSyntax parameter);\n\n        protected abstract Location GetReportLocation(TParameterSyntax parameter);\n\n        public abstract ImmutableArray<TLanguageKindEnum> SyntaxKindsOfInterest { get; }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/OptionalParameterNotPassedToBaseCallBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class OptionalParameterNotPassedToBaseCallBase<TInvocationExpressionSyntax>\n        : SonarDiagnosticAnalyzer\n        where TInvocationExpressionSyntax : SyntaxNode\n    {\n        protected const string DiagnosticId = \"S3466\";\n        protected const string MessageFormat = \"Pass the missing user-supplied parameter value{0} to this 'base' call.\";\n\n        protected void ReportOptionalParameterNotPassedToBase(SonarSyntaxNodeReportingContext c, TInvocationExpressionSyntax invocation)\n        {\n            if (!(c.Model.GetSymbolInfo(invocation).Symbol is IMethodSymbol calledMethod))\n            {\n                return;\n            }\n\n            int difference = calledMethod.Parameters.Length - GetArgumentCount(invocation);\n\n            if (!calledMethod.IsVirtual ||\n                difference == 0 ||\n                !IsCallInsideOverride(invocation, calledMethod, c.Model))\n            {\n                return;\n            }\n\n            var pluralize = difference > 1\n                ? \"s\"\n                : string.Empty;\n            c.ReportIssue(Rule, invocation, pluralize);\n        }\n\n        protected abstract int GetArgumentCount(TInvocationExpressionSyntax invocation);\n        protected abstract DiagnosticDescriptor Rule { get; }\n\n        protected static bool IsCallInsideOverride(SyntaxNode invocation, IMethodSymbol calledMethod,\n            SemanticModel semanticModel)\n        {\n            return semanticModel.GetEnclosingSymbol(invocation.SpanStart) is IMethodSymbol enclosingSymbol &&\n                enclosingSymbol.IsOverride &&\n                object.Equals(enclosingSymbol.OverriddenMethod, calledMethod);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/ParameterAssignedToBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class ParameterAssignedToBase<TSyntaxKind, TIdentifierNameSyntax> : SonarDiagnosticAnalyzer<TSyntaxKind>\n        where TSyntaxKind : struct\n        where TIdentifierNameSyntax : SyntaxNode\n    {\n        private const string DiagnosticId = \"S1226\";\n\n        protected abstract bool IsAssignmentToCatchVariable(ISymbol symbol, SyntaxNode node);\n\n        protected override string MessageFormat => \"Introduce a new variable instead of reusing the parameter '{0}'.\";\n\n        protected ParameterAssignedToBase() : base(DiagnosticId) { }\n\n        protected sealed override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                Language.GeneratedCodeRecognizer, c =>\n                {\n                    foreach (var target in Language.Syntax.AssignmentTargets(c.Node))\n                    {\n                        if (c.Model.GetSymbolInfo(target).Symbol is { } symbol\n                            && (symbol is IParameterSymbol { RefKind: RefKind.None } || IsAssignmentToCatchVariable(symbol, target))\n                            && !IsReadBefore(c.Model, symbol, c.Node))\n                        {\n                            c.ReportIssue(Rule, target, target.ToString());\n                        }\n                    }\n                },\n                Language.SyntaxKind.SimpleAssignment);\n\n        private bool IsReadBefore(SemanticModel semanticModel, ISymbol parameterSymbol, SyntaxNode assignment)\n        {\n            // Same problem as in VB.NET / IsAssignmentToCatchVariable:\n            // parameterSymbol.DeclaringSyntaxReferences is empty for Catch syntax in VB.NET as well as for indexer syntax for C#\n            // https://github.com/dotnet/roslyn/issues/6209\n            var stopLocation = parameterSymbol.Locations.FirstOrDefault();\n            if (stopLocation == null)\n            {\n                return true; // If we can't find the location, it's going to be FN\n            }\n\n            return GetPreviousNodes(parameterSymbol.Locations.First(), assignment)\n                .Union(Language.Syntax.AssignmentRight(assignment).DescendantNodes())\n                .OfType<TIdentifierNameSyntax>()\n                .Any(x => parameterSymbol.Equals(semanticModel.GetSymbolInfo(x).Symbol));\n        }\n\n        /// <summary>\n        /// Returns all nodes before the specified statement to the declaration of variable/parameter given by stopLocation.\n        /// This method recursively traverses all parent blocks of the provided statement.\n        /// </summary>\n        private static IEnumerable<SyntaxNode> GetPreviousNodes(Location stopLocation, SyntaxNode statement)\n        {\n            // Method declaration or Catch variable declaration, stop here and do not include this statement\n            if (statement == null || statement.GetLocation().SourceSpan.IntersectsWith(stopLocation.SourceSpan))\n            {\n                return Array.Empty<SyntaxNode>();\n            }\n            var previousNodes = statement.Parent.ChildNodes()\n                .TakeWhile(x => x != statement)     // Take all from beginning, including \"catch ex\" on the way, down to current statement\n                .Reverse()                          // Reverse in order to keep the tail\n                .TakeWhile(x => !x.GetLocation().SourceSpan.IntersectsWith(stopLocation.SourceSpan))    // Keep the tail until \"catch ex\" or \"int i\" is found\n                .SelectMany(x => x.DescendantNodes());\n\n            return previousNodes.Union(GetPreviousNodes(stopLocation, statement.Parent));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/ParameterNameMatchesOriginalBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class ParameterNameMatchesOriginalBase<TSyntaxKind, TMethodDeclarationSyntax> : SonarDiagnosticAnalyzer<TSyntaxKind>\n        where TSyntaxKind : struct\n        where TMethodDeclarationSyntax : SyntaxNode\n    {\n        protected const string DiagnosticId = \"S927\";\n\n        protected abstract TSyntaxKind[] SyntaxKinds { get; }\n        protected abstract IEnumerable<SyntaxToken> ParameterIdentifiers(TMethodDeclarationSyntax method);\n\n        protected override string MessageFormat => \"Rename parameter '{0}' to '{1}' to match the {2} declaration.\";\n\n        protected ParameterNameMatchesOriginalBase() : base(DiagnosticId) { }\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(Language.GeneratedCodeRecognizer, c =>\n                {\n                    var methodSyntax = (TMethodDeclarationSyntax)c.Node;\n                    if (c.Model.GetDeclaredSymbol(methodSyntax) is IMethodSymbol methodSymbol && methodSymbol.Parameters.Any())\n                    {\n                        if (methodSymbol.PartialImplementationPart != null)\n                        {\n                            if (methodSymbol.PartialImplementationPart.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax() is TMethodDeclarationSyntax methodImplementationSyntax)\n                            {\n                                VerifyParameters(c, methodImplementationSyntax, methodSymbol.Parameters, \"partial class\");\n                            }\n                        }\n                        else if (methodSymbol.OverriddenMethod != null)\n                        {\n                            VerifyGenericParameters(c, methodSyntax, methodSymbol.Parameters, methodSymbol.OverriddenMethod.OriginalDefinition.Parameters, \"base class\");\n                        }\n                        else if (methodSymbol.InterfaceMembers().FirstOrDefault() is { } interfaceMember)\n                        {\n                            VerifyGenericParameters(c, methodSyntax, methodSymbol.Parameters, interfaceMember.OriginalDefinition.Parameters, \"interface\");\n                        }\n                    }\n                },\n                SyntaxKinds);\n\n        private void VerifyParameters(SonarSyntaxNodeReportingContext context, TMethodDeclarationSyntax methodSyntax, IList<IParameterSymbol> expectedParameters, string expectedLocation)\n        {\n            foreach (var item in ParameterIdentifiers(methodSyntax)\n                                    .Zip(expectedParameters, (actual, expected) => new { actual, expected })\n                                    .Where(x => !x.actual.ValueText.Equals(x.expected.Name, Language.NameComparison)))\n            {\n                context.ReportIssue(Rule, item.actual, item.actual.ValueText, item.expected.Name, expectedLocation);\n            }\n        }\n\n        private void VerifyGenericParameters(SonarSyntaxNodeReportingContext context,\n                                             TMethodDeclarationSyntax methodSyntax,\n                                             IList<IParameterSymbol> actualParameters,\n                                             IList<IParameterSymbol> expectedParameters,\n                                             string expectedLocation)\n        {\n            var parameters = ParameterIdentifiers(methodSyntax).ToList();\n            for (var i = 0; i < parameters.Count; i++)\n            {\n                var parameter = parameters[i];\n                var expectedParameter = expectedParameters[i];\n                if (!parameter.ValueText.Equals(expectedParameter.Name, Language.NameComparison)\n                    && !AreGenericTypeParametersWithDifferentTypes(actualParameters[i].Type, expectedParameter.Type)\n                    && (expectedParameter.Type.Kind != SymbolKind.TypeParameter\n                        || actualParameters[i].Type.Kind == SymbolKind.TypeParameter))\n                {\n                    context.ReportIssue(Rule, parameter, parameter.ValueText, expectedParameter.Name, expectedLocation);\n                }\n            }\n        }\n\n        private static bool AreGenericTypeParametersWithDifferentTypes(ITypeSymbol actualType, ITypeSymbol expectedType) =>\n            actualType is INamedTypeSymbol actualNamedType\n            && expectedType is INamedTypeSymbol expectedNamedType\n            && AreTypeArgumentsDifferent(actualNamedType, expectedNamedType);\n\n        private static bool AreTypeArgumentsDifferent(INamedTypeSymbol namedType, INamedTypeSymbol otherNamedType)\n        {\n            for (var i = 0; i < namedType.TypeArguments.Count(); i++)\n            {\n                if (namedType.TypeArguments[i].TypeKind != otherNamedType.TypeArguments[i].TypeKind)\n                {\n                    return true;\n                }\n            }\n            return false;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/ParametersCorrectOrderBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class ParametersCorrectOrderBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n        where TSyntaxKind : struct\n    {\n        protected const string DiagnosticId = \"S2234\";\n        protected abstract TSyntaxKind[] InvocationKinds { get; }\n        protected override string MessageFormat => \"Parameters to '{0}' have the same names but not the same order as the method arguments.\";\n\n        protected ParametersCorrectOrderBase() : base(DiagnosticId) { }\n\n        protected sealed override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(Language.GeneratedCodeRecognizer,\n                c =>\n                {\n                    const int MinNumberOfNameableArguments = 2;\n                    if (!c.IsRedundantPrimaryConstructorBaseTypeContext()\n                        && Language.Syntax.ArgumentList(c.Node) is { Count: >= MinNumberOfNameableArguments } argumentList  // there must be at least two arguments to be able to swap, and further\n                        && argumentList.Select(ArgumentName).WhereNotNull().Take(MinNumberOfNameableArguments).Count() == MinNumberOfNameableArguments // at least two arguments with a \"name\"\n                        && Language.MethodParameterLookup(c.Node, c.Model) is var methodParameterLookup)\n                    {\n                        foreach (var argument in argumentList)\n                        {\n                            // Example void M(int x, int y) <- p_x and p_y are the parameter\n                            // M(y, x); <- a_y and a_x are the arguments\n                            if (methodParameterLookup.TryGetSymbol(argument, out var parameterSymbol) // argument = a_x and parameterSymbol = p_y\n                                && parameterSymbol is { IsParams: false }\n                                && ArgumentName(argument) is { } argumentName // \"x\"\n                                && !MatchingNames(parameterSymbol, argumentName)  // \"x\" != \"y\"\n                                && Language.Syntax.NodeExpression(argument) is { } argumentExpression\n                                && c.Context.SemanticModel.GetTypeInfo(argumentExpression).ConvertedType is { } argumentType\n                                // is there another parameter that seems to be a better fit (name and type match): p_x\n                                && methodParameterLookup.MethodSymbol.Parameters.FirstOrDefault(p => MatchingNames(p, argumentName)) is { IsParams: false } otherParameter\n                                && argumentType.DerivesOrImplements(otherParameter.Type)\n                                // is there an argument that matches the parameter p_y by name: a_y\n                                && Language.Syntax.ArgumentList(c.Node).FirstOrDefault(x => MatchingNames(parameterSymbol, ArgumentName(x))) is { })\n                            {\n                                var secondaryLocations = methodParameterLookup.MethodSymbol.DeclaringSyntaxReferences\n                                    .Select(x => Language.Syntax.NodeIdentifier(x.GetSyntax())?.ToSecondaryLocation())\n                                    .WhereNotNull();\n                                c.ReportIssue(Rule, PrimaryLocation(c.Node), secondaryLocations, methodParameterLookup.MethodSymbol.Name);\n                                return;\n                            }\n                        }\n                    }\n                }, InvocationKinds);\n\n        protected virtual Location PrimaryLocation(SyntaxNode node) =>\n            Language.Syntax.NodeIdentifier(node)?.GetLocation() ?? node.GetLocation();\n\n        private bool MatchingNames(IParameterSymbol parameter, string argumentName) =>\n            Language.NameComparer.Equals(parameter.Name, argumentName);\n\n        private string ArgumentName(SyntaxNode argument) =>\n            Language.Syntax.NodeIdentifier(Language.Syntax.NodeExpression(argument))?.ValueText;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/PartCreationPolicyShouldBeUsedWithExportAttributeBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class PartCreationPolicyShouldBeUsedWithExportAttributeBase<TAttributeSyntax, TDeclarationSyntax> : SonarDiagnosticAnalyzer\n        where TAttributeSyntax : SyntaxNode\n        where TDeclarationSyntax : SyntaxNode\n    {\n        internal const string DiagnosticId = \"S4428\";\n\n        protected const string MessageFormat = \"Add the 'ExportAttribute' or remove 'PartCreationPolicyAttribute' to/from this type definition.\";\n\n        protected abstract TDeclarationSyntax GetTypeDeclaration(TAttributeSyntax attribute);\n\n        protected void AnalyzeNode(SonarSyntaxNodeReportingContext c)\n        {\n            var attribute = (TAttributeSyntax)c.Node;\n            if (!IsPartCreationPolicyAttribute(attribute))\n            {\n                return;\n            }\n\n            var declaration = GetTypeDeclaration(attribute);\n            if (declaration == null)\n            {\n                return;\n            }\n\n            if (!(c.Model.GetDeclaredSymbol(declaration) is INamedTypeSymbol symbol) || symbol.IsMefExportedType())\n            {\n                return;\n            }\n\n            c.ReportIssue(SupportedDiagnostics[0], attribute);\n\n            bool IsPartCreationPolicyAttribute(TAttributeSyntax attributeSyntax) =>\n                c.Model.GetSymbolInfo(attributeSyntax).Symbol is IMethodSymbol attributeSymbol\n                && attributeSymbol.ContainingType.Is(KnownType.System_ComponentModel_Composition_PartCreationPolicyAttribute);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/PreferGuidEmptyBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class PreferGuidEmptyBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n        where TSyntaxKind : struct\n    {\n        internal const string DiagnosticId = \"S4581\";\n\n        protected override string MessageFormat => \"Use 'Guid.NewGuid()' or 'Guid.Empty' or add arguments to this GUID instantiation.\";\n\n        protected PreferGuidEmptyBase() : base(DiagnosticId) { }\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                Language.GeneratedCodeRecognizer,\n                c =>\n                {\n                    if (IsInvalidCtor(c.Node, c.Model)\n                        && c.Model.GetSymbolInfo(c.Node).Symbol is IMethodSymbol methodSymbol\n                        && methodSymbol.ContainingType.Is(KnownType.System_Guid))\n                    {\n                        c.ReportIssue(Rule, c.Node);\n                    }\n                },\n                Language.SyntaxKind.ObjectCreationExpressions);\n\n            context.RegisterNodeAction(\n                Language.GeneratedCodeRecognizer,\n                c =>\n                {\n                    if (!IsInParameter(c.Node)\n                        && c.Model.GetTypeInfo(c.Node).ConvertedType.Is(KnownType.System_Guid))\n                    {\n                        c.ReportIssue(Rule, c.Node);\n                    }\n                },\n                Language.SyntaxKind.DefaultExpressions);\n        }\n\n        private bool IsInvalidCtor(SyntaxNode ctorNode, SemanticModel semanticModel)\n        {\n            var arguments = Language.Syntax.ArgumentExpressions(ctorNode).ToArray();\n            return arguments.Length == 0 || CreatesEmptyGuid(arguments, semanticModel);\n        }\n\n        private bool IsInParameter(SyntaxNode defaultExpression) =>\n            defaultExpression.Ancestors().Any(x => Language.Syntax.IsKind(x, Language.SyntaxKind.Parameter));\n\n        private static bool CreatesEmptyGuid(SyntaxNode[] arguments, SemanticModel semanticModel) =>\n            arguments.Length == 1\n            && Guid.TryParse(semanticModel.GetConstantValue(arguments[0]).Value as string, out var guid)\n            && guid == Guid.Empty;\n        }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/PropertiesAccessCorrectFieldBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class PropertiesAccessCorrectFieldBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n{\n    private const string DiagnosticId = \"S4275\";\n\n    /**\n     * Assignments can be done either\n     * - directly via an assignment\n     * - indirectly, when passed as 'out' or 'ref' parameter\n     */\n    protected enum AccessorKind\n    {\n        Getter,\n        Setter\n    }\n\n    protected abstract IEnumerable<FieldData> FindFieldAssignments(IPropertySymbol property, Compilation compilation);\n    protected abstract IEnumerable<FieldData> FindFieldReads(IPropertySymbol property, Compilation compilation);\n    protected abstract bool ImplementsExplicitGetterOrSetter(IPropertySymbol property);\n    protected abstract bool ShouldIgnoreAccessor(IMethodSymbol accessorMethod, Compilation compilation);\n\n    protected override string MessageFormat => \"Refactor this {0} so that it actually refers to the field '{1}'.\";\n\n    protected PropertiesAccessCorrectFieldBase() : base(DiagnosticId) { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        // We want to check the fields read and assigned in all properties in this class\n        // so this is a symbol-level rule (also means the callback is called only once\n        // for partial classes)\n        context.RegisterSymbolAction(CheckType, SymbolKind.NamedType);\n\n    protected static bool AccessesSelfBaseProperty(IMethodSymbol accessorMethod, SyntaxNode accessorBody, Compilation compilation) =>\n        accessorMethod.AssociatedSymbol is IPropertySymbol { OverriddenProperty: { } overriddenProperty }\n        && compilation.GetSemanticModel(accessorBody.SyntaxTree) is { } model\n        && accessorBody.DescendantNodes().Any(x => model.GetSymbolInfo(x).Symbol is IPropertySymbol propertyReference && propertyReference.Equals(overriddenProperty));\n\n    protected static SyntaxNode FindInvokedMethod(Compilation compilation, INamedTypeSymbol containingType, SyntaxNode expression) =>\n        compilation.GetSemanticModel(expression.SyntaxTree) is { } semanticModel\n        && semanticModel.GetSymbolInfo(expression).Symbol is { } invocationSymbol\n        && invocationSymbol.ContainingType.Equals(containingType)\n        && invocationSymbol.DeclaringSyntaxReferences.Length == 1\n        && invocationSymbol.DeclaringSyntaxReferences.Single().GetSyntax() is { } invokedMethod\n            ? invokedMethod\n            : null;\n\n    private void CheckType(SonarSymbolReportingContext context)\n    {\n        var symbol = (INamedTypeSymbol)context.Symbol;\n        if (!symbol.TypeKind.Equals(TypeKind.Class)\n            && !symbol.TypeKind.Equals(TypeKind.Structure))\n        {\n            return;\n        }\n\n        var fields = SelfAndBaseTypesFieldSymbols(symbol);\n        if (!fields.Any())\n        {\n            return;\n        }\n\n        var properties = ExplicitlyDeclaredProperties(symbol);\n        if (!properties.Any())\n        {\n            return;\n        }\n\n        var propertyToFieldMatcher = new PropertyToFieldMatcher(fields);\n        var allPropertyData = CollectPropertyData(properties, context.Compilation);\n\n        // Check that if there is a single matching field name it is used by the property\n        foreach (var data in allPropertyData)\n        {\n            var expectedField = propertyToFieldMatcher.SingleMatchingFieldOrNull(data.PropertySymbol);\n            if (expectedField is not null)\n            {\n                if (!data.IgnoreGetter)\n                {\n                    CheckExpectedFieldIsUsed(context, data.PropertySymbol.GetMethod, expectedField, data.ReadFields);\n                }\n                if (!data.IgnoreSetter)\n                {\n                    CheckExpectedFieldIsUsed(context, data.PropertySymbol.SetMethod, expectedField, data.UpdatedFields);\n                }\n            }\n        }\n    }\n\n    private static IEnumerable<IFieldSymbol> SelfAndBaseTypesFieldSymbols(INamedTypeSymbol typeSymbol) =>\n        typeSymbol.GetSelfAndBaseTypes()\n            .SelectMany(x => x.GetMembers().OfType<IFieldSymbol>()\n                                .Where(f => x.Equals(typeSymbol) || f.DeclaredAccessibility != Accessibility.Private));\n\n    private IEnumerable<IPropertySymbol> ExplicitlyDeclaredProperties(INamedTypeSymbol symbol) =>\n        symbol.GetMembers()\n            .Where(x => x.Kind.Equals(SymbolKind.Property))\n            .SelectMany(x => x.AllPartialParts())\n            .OfType<IPropertySymbol>()\n            .Where(ImplementsExplicitGetterOrSetter);\n\n    private void CheckExpectedFieldIsUsed(SonarSymbolReportingContext context, IMethodSymbol methodSymbol, IFieldSymbol expectedField, ImmutableArray<FieldData> actualFields)\n    {\n        var expectedFieldIsUsed = actualFields.Any(x => x.Field.Equals(expectedField));\n        if (!expectedFieldIsUsed || !actualFields.Any())\n        {\n            var locationAndAccessorType = GetLocationAndAccessor(actualFields, methodSymbol);\n            if (locationAndAccessorType.Item1 is not null)\n            {\n                context.ReportIssue(Language.GeneratedCodeRecognizer, Rule, locationAndAccessorType.Item1, locationAndAccessorType.Item2, expectedField.Name);\n            }\n        }\n\n        static Tuple<Location, string> GetLocationAndAccessor(ImmutableArray<FieldData> fields, IMethodSymbol method)\n        {\n            Location location;\n            string accessorType;\n            if (fields.Count(x => x.UseFieldLocation) == 1)\n            {\n                var fieldWithValue = fields.First();\n                location = fieldWithValue.LocationNode.GetLocation();\n                accessorType = fieldWithValue.AccessorKind.Equals(AccessorKind.Getter) ? \"getter\" : \"setter\";\n            }\n            else\n            {\n                Debug.Assert(method is not null, \"Method symbol should not be null at this point\");\n                location = method?.Locations.First();\n                accessorType = method?.MethodKind == MethodKind.PropertyGet ? \"getter\" : \"setter\";\n            }\n            return Tuple.Create(location, accessorType);\n        }\n    }\n\n    private IList<PropertyData> CollectPropertyData(IEnumerable<IPropertySymbol> properties, Compilation compilation)\n    {\n        IList<PropertyData> allPropertyData = [];\n\n        // Collect the list of fields read/written by each property\n        foreach (var property in properties)\n        {\n            var readFields = FindFieldReads(property, compilation);\n            var updatedFields = FindFieldAssignments(property, compilation);\n            var ignoreGetter = ShouldIgnoreAccessor(property.GetMethod, compilation);\n            var ignoreSetter = ShouldIgnoreAccessor(property.SetMethod, compilation);\n            var data = new PropertyData(property, readFields, updatedFields, ignoreGetter, ignoreSetter);\n            allPropertyData.Add(data);\n        }\n        return allPropertyData;\n    }\n\n    private readonly struct PropertyData\n    {\n        public IPropertySymbol PropertySymbol { get; }\n\n        public ImmutableArray<FieldData> ReadFields { get; }\n\n        public ImmutableArray<FieldData> UpdatedFields { get; }\n\n        public bool IgnoreGetter { get; }\n\n        public bool IgnoreSetter { get; }\n\n        public PropertyData(IPropertySymbol propertySymbol, IEnumerable<FieldData> read, IEnumerable<FieldData> updated, bool ignoreGetter, bool ignoreSetter)\n        {\n            PropertySymbol = propertySymbol;\n            ReadFields = read.ToImmutableArray();\n            UpdatedFields = updated.ToImmutableArray();\n            IgnoreGetter = ignoreGetter;\n            IgnoreSetter = ignoreSetter;\n        }\n    }\n\n    protected readonly struct FieldData\n    {\n        public AccessorKind AccessorKind { get; }\n\n        public IFieldSymbol Field { get; }\n\n        public SyntaxNode LocationNode { get; }\n\n        public bool UseFieldLocation { get; }\n\n        public FieldData(AccessorKind accessor, IFieldSymbol field, SyntaxNode locationNode, bool useFieldLocation)\n        {\n            AccessorKind = accessor;\n            Field = field;\n            LocationNode = locationNode;\n            UseFieldLocation = useFieldLocation;\n        }\n    }\n\n    /// <summary>\n    /// The rule decides if a property is returning/settings the expected field.\n    /// We decide what the expected field name should be based on a fuzzy match\n    /// between the field name and the property name.\n    /// This class hides the details of matching logic.\n    /// </summary>\n    private sealed class PropertyToFieldMatcher\n    {\n        private readonly IDictionary<IFieldSymbol, string> fieldToStandardNameMap;\n\n        public PropertyToFieldMatcher(IEnumerable<IFieldSymbol> fields) =>\n            // Calculate and cache the standardised versions of the field names to avoid\n            // calculating them every time\n            fieldToStandardNameMap = fields.ToDictionary(x => x, x => CanonicalName(x.Name));\n\n        public IFieldSymbol SingleMatchingFieldOrNull(IPropertySymbol propertySymbol)\n        {\n            var matchingFields = fieldToStandardNameMap.Keys\n                .Where(x => FieldMatchesTheProperty(x, propertySymbol))\n                .Take(2)\n                .ToList();\n\n            return matchingFields.Count == 1\n                ? matchingFields[0]\n                : null;\n        }\n\n        private static string CanonicalName(string name) =>\n            name.Replace(\"_\", string.Empty);\n\n        private static bool AreCanonicalNamesEqual(string name1, string name2) =>\n            name1.Equals(name2, StringComparison.OrdinalIgnoreCase);\n\n        private bool FieldMatchesTheProperty(IFieldSymbol field, IPropertySymbol property) =>\n            // We're not caching the property name as only expect to be called once per property\n            !field.IsConst\n            && ((property.IsStatic && field.IsStatic) || (!property.IsStatic && !field.IsStatic))\n            && field.Type.Equals(property.Type)\n            && AreCanonicalNamesEqual(fieldToStandardNameMap[field], CanonicalName(property.Name));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/PropertyGetterWithThrowBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class PropertyGetterWithThrowBase : SonarDiagnosticAnalyzer\n    {\n        protected const string DiagnosticId = \"S2372\";\n\n        protected const string MessageFormat = \"Remove the exception throwing from this property getter, or refactor the \" +\n            \"property into a method.\";\n\n        protected abstract GeneratedCodeRecognizer GeneratedCodeRecognizer { get; }\n\n        internal static readonly ImmutableArray<KnownType> AllowedExceptionBaseTypes =\n            ImmutableArray.Create(\n                KnownType.System_NotImplementedException,\n                KnownType.System_NotSupportedException,\n                KnownType.System_InvalidOperationException\n            );\n    }\n\n    public abstract class PropertyGetterWithThrowBase<TLanguageKindEnum, TAccessorSyntax> :\n        PropertyGetterWithThrowBase\n        where TLanguageKindEnum : struct\n        where TAccessorSyntax : SyntaxNode\n    {\n        protected sealed override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterCodeBlockStartAction<TLanguageKindEnum>(\n                GeneratedCodeRecognizer,\n                cbc =>\n                {\n                    if (!(cbc.CodeBlock is TAccessorSyntax propertyGetter) ||\n                        !IsGetter(propertyGetter) ||\n                        IsIndexer(propertyGetter))\n                    {\n                        return;\n                    }\n\n                    cbc.RegisterNodeAction(\n                        c =>\n                        {\n                            var throwExpression = GetThrowExpression(c.Node);\n\n                            // This is the case in rethrow - see ticket #730.\n                            if (throwExpression == null)\n                            {\n                                return;\n                            }\n\n                            var type = c.Model.GetTypeInfo(throwExpression).Type;\n                            if (type == null || type.DerivesFromAny(AllowedExceptionBaseTypes))\n                            {\n                                return;\n                            }\n\n                            c.ReportIssue(SupportedDiagnostics[0], c.Node);\n                        },\n                        ThrowSyntaxKind);\n                });\n        }\n\n        protected abstract bool IsIndexer(TAccessorSyntax propertyGetter);\n\n        protected abstract bool IsGetter(TAccessorSyntax propertyGetter);\n\n        protected abstract TLanguageKindEnum ThrowSyntaxKind { get; }\n\n        protected abstract SyntaxNode GetThrowExpression(SyntaxNode syntaxNode);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/PropertyWriteOnlyBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class PropertyWriteOnlyBase<TSyntaxKind, TPropertyDeclaration> : SonarDiagnosticAnalyzer<TSyntaxKind>\n        where TSyntaxKind : struct\n        where TPropertyDeclaration : SyntaxNode\n    {\n        protected const string DiagnosticId = \"S2376\";\n\n        protected abstract TSyntaxKind SyntaxKind { get; }\n\n        protected abstract bool IsWriteOnlyProperty(TPropertyDeclaration prop);\n\n        protected override string MessageFormat => \"Provide a getter for '{0}' or replace the property with a 'Set{0}' method.\";\n\n        protected PropertyWriteOnlyBase() : base(DiagnosticId) { }\n\n        protected sealed override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                Language.GeneratedCodeRecognizer,\n                c =>\n                {\n                    var prop = (TPropertyDeclaration)c.Node;\n                    if (IsWriteOnlyProperty(prop) && Language.Syntax.NodeIdentifier(prop) is { }  identifier)\n                    {\n                        c.ReportIssue(SupportedDiagnostics[0], identifier, identifier.ValueText);\n                    }\n                },\n                SyntaxKind);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/ProvideDeserializationMethodsForOptionalFieldsBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class ProvideDeserializationMethodsForOptionalFieldsBase : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S3926\";\n        private const string MessageFormat = \"{0}\";\n        private const string BothDeserializationMethodsMissing = \"Add deserialization event handlers.\";\n        private const string OnDeserializedMethodMissing = \"Add the missing 'OnDeserializedAttribute' event handler.\";\n        private const string OnDeserializingMethodMissing = \"Add the missing 'OnDeserializingAttribute' event handler.\";\n\n        private static readonly ImmutableArray<KnownType> AttributesToFind = ImmutableArray.Create(KnownType.System_Runtime_Serialization_OptionalFieldAttribute,\n                                                                                                   KnownType.System_Runtime_Serialization_OnDeserializingAttribute,\n                                                                                                   KnownType.System_Runtime_Serialization_OnDeserializedAttribute);\n\n        private readonly DiagnosticDescriptor rule;\n\n        protected abstract ILanguageFacade Language { get; }\n\n        public sealed override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(rule);\n\n        protected ProvideDeserializationMethodsForOptionalFieldsBase() =>\n            rule = Language.CreateDescriptor(DiagnosticId, MessageFormat);\n\n        protected sealed override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterSymbolAction(\n                c =>\n                {\n                    var symbol = (INamedTypeSymbol)c.Symbol;\n                    if (!symbol.IsClassOrStruct())\n                    {\n                        return;\n                    }\n\n                    var watchedAttributes = symbol.GetMembers()\n                                                  .SelectMany(m => m.GetAttributes(AttributesToFind))\n                                                  .ToList();\n\n                    var errorMessage = GetErrorMessage(watchedAttributes);\n                    var declaringSyntax = symbol.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax();\n\n                    if (errorMessage == null || declaringSyntax == null)\n                    {\n                        return;\n                    }\n\n                    c.ReportIssue(Language.GeneratedCodeRecognizer, SupportedDiagnostics[0], GetNamedTypeIdentifierLocation(declaringSyntax), errorMessage);\n                },\n                SymbolKind.NamedType);\n\n        protected abstract Location GetNamedTypeIdentifierLocation(SyntaxNode node);\n\n        private static string GetErrorMessage(IReadOnlyCollection<AttributeData> attributes)\n        {\n            var hasOptionalFieldAttribute = attributes.Any(attribute =>\n                attribute.AttributeClass.Is(KnownType.System_Runtime_Serialization_OptionalFieldAttribute));\n            var hasOnDeserializingAttribute = attributes.Any(attribute =>\n                attribute.AttributeClass.Is(KnownType.System_Runtime_Serialization_OnDeserializingAttribute));\n            var hasOnDeserializedAttribute = attributes.Any(attribute =>\n                attribute.AttributeClass.Is(KnownType.System_Runtime_Serialization_OnDeserializedAttribute));\n\n            if (!hasOptionalFieldAttribute || (hasOnDeserializingAttribute && hasOnDeserializedAttribute))\n            {\n                return null;\n            }\n\n            if (hasOnDeserializingAttribute)\n            {\n                return OnDeserializedMethodMissing;\n            }\n\n            if (hasOnDeserializedAttribute)\n            {\n                return OnDeserializingMethodMissing;\n            }\n\n            return BothDeserializationMethodsMissing;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/PublicConstantFieldBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class PublicConstantFieldBase : SonarDiagnosticAnalyzer\n    {\n        protected const string DiagnosticId = \"S2339\";\n        protected const string MessageFormat = \"Change this constant to a {0} property.\";\n\n        protected abstract GeneratedCodeRecognizer GeneratedCodeRecognizer { get; }\n    }\n\n    public abstract class PublicConstantFieldBase<TLanguageKindEnum, TFieldDeclarationSyntax, TFieldName>\n        : PublicConstantFieldBase\n        where TLanguageKindEnum : struct\n        where TFieldDeclarationSyntax : SyntaxNode\n        where TFieldName : SyntaxNode\n    {\n        protected sealed override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                GeneratedCodeRecognizer,\n                c =>\n                {\n                    var field = (TFieldDeclarationSyntax)c.Node;\n                    var variables = GetVariables(field).ToList();\n\n                    if (!variables.Any())\n                    {\n                        return;\n                    }\n\n                    var anyVariable = variables.First();\n                    if (!(c.Model.GetDeclaredSymbol(anyVariable) is IFieldSymbol symbol) ||\n                        !symbol.IsConst ||\n                        symbol.GetEffectiveAccessibility() != Accessibility.Public)\n                    {\n                        return;\n                    }\n\n                    foreach (var variable in variables)\n                    {\n                        c.ReportIssue(SupportedDiagnostics[0], GetReportLocation(variable), MessageArgument);\n                    }\n                },\n                FieldDeclarationKind);\n        }\n\n        protected abstract IEnumerable<TFieldName> GetVariables(TFieldDeclarationSyntax node);\n\n        public abstract TLanguageKindEnum FieldDeclarationKind { get; }\n        public abstract string MessageArgument { get; }\n\n        protected abstract Location GetReportLocation(TFieldName node);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/PublicMethodWithMultidimensionalArrayBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class PublicMethodWithMultidimensionalArrayBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n{\n    private const string DiagnosticId = \"S2368\";\n    protected override string MessageFormat => \"Make this {0} private or simplify its parameters to not use multidimensional/jagged arrays.\";\n\n    protected abstract ImmutableArray<TSyntaxKind> SyntaxKindsOfInterest { get; }\n    protected abstract Location GetIssueLocation(SyntaxNode node);\n    protected abstract string GetType(SyntaxNode node);\n\n    protected PublicMethodWithMultidimensionalArrayBase() : base(DiagnosticId) { }\n\n    protected sealed override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(Language.GeneratedCodeRecognizer,\n            c =>\n            {\n                if (MethodSymbolOfNode(c.Model, c.Node) is { } methodSymbol\n                    && methodSymbol.InterfaceMembers().IsEmpty()\n                    && !methodSymbol.IsOverride\n                    && methodSymbol.IsPubliclyAccessible()\n                    && MethodHasMultidimensionalArrayParameters(methodSymbol))\n                {\n                    c.ReportIssue(SupportedDiagnostics[0], GetIssueLocation(c.Node), GetType(c.Node));\n                }\n            },\n            SyntaxKindsOfInterest.ToArray());\n\n    protected virtual IMethodSymbol MethodSymbolOfNode(SemanticModel semanticModel, SyntaxNode node) =>\n        semanticModel.GetDeclaredSymbol(node) as IMethodSymbol;\n\n    private static bool MethodHasMultidimensionalArrayParameters(IMethodSymbol methodSymbol) =>\n        methodSymbol.IsExtensionMethod\n            ? methodSymbol.Parameters.Skip(1).Any(IsMultidimensionalArrayParameter)\n            : methodSymbol.Parameters.Any(IsMultidimensionalArrayParameter); // Perf: Make sure the Any method of ImmutableArray is called when possible. Don't do `Skip(m.IsExtensionMethod ? 0 : 1)`\n\n    private static bool IsMultidimensionalArrayParameter(IParameterSymbol param) =>\n        param.Type is IArrayTypeSymbol arrayType\n        && (arrayType.Rank > 1\n            || IsJaggedArrayParam(param, arrayType));\n\n    private static bool IsJaggedArrayParam(IParameterSymbol param, IArrayTypeSymbol arrayType) =>\n        param.IsParams\n            ? arrayType.ElementType is IArrayTypeSymbol { ElementType: IArrayTypeSymbol }\n            : arrayType.ElementType is IArrayTypeSymbol;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/PureAttributeOnVoidMethodBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class PureAttributeOnVoidMethodBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n{\n    protected const string DiagnosticId = \"S3603\";\n\n    protected override string MessageFormat => \"Remove the 'Pure' attribute or change the method to return a value.\";\n\n    protected PureAttributeOnVoidMethodBase() : base(DiagnosticId) { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterSymbolAction(\n            c =>\n            {\n                if (InvalidPureDataAttributeUsage((IMethodSymbol)c.Symbol) is { } pureAttribute)\n                {\n                    c.ReportIssue(Language.GeneratedCodeRecognizer, Rule, pureAttribute.ApplicationSyntaxReference.GetSyntax());\n                }\n            },\n            SymbolKind.Method);\n\n    protected static AttributeData InvalidPureDataAttributeUsage(IMethodSymbol method) =>\n        method is not null\n        && NoOutParameters(method)\n        && (method.ReturnsVoid || ReturnsTask(method))\n        && PureAttribute(method) is { } pureAttribute\n            ? pureAttribute\n            : null;\n\n    private static bool NoOutParameters(IMethodSymbol method) =>\n        method.Parameters.All(x => x.RefKind is RefKind.None || x.RefKind is RefKindEx.In);\n\n    private static bool ReturnsTask(IMethodSymbol method) =>\n        method.ReturnType.Is(KnownType.System_Threading_Tasks_Task);\n\n    private static AttributeData PureAttribute(IMethodSymbol method) =>\n        method.GetAttributes().FirstOrDefault(x => x.AttributeClass.Is(KnownType.System_Diagnostics_Contracts_PureAttribute));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/RedundantNullCheckBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class RedundantNullCheckBase<TBinaryExpression> : SonarDiagnosticAnalyzer\n        where TBinaryExpression : SyntaxNode\n    {\n        internal const string DiagnosticId = \"S4201\";\n\n        protected abstract SyntaxNode GetLeftNode(TBinaryExpression binaryExpression);\n\n        protected abstract SyntaxNode GetRightNode(TBinaryExpression binaryExpression);\n\n        protected abstract SyntaxNode GetNullCheckVariable(SyntaxNode node);\n\n        protected abstract SyntaxNode GetNonNullCheckVariable(SyntaxNode node);\n\n        protected abstract SyntaxNode GetIsOperatorCheckVariable(SyntaxNode node);\n\n        protected abstract SyntaxNode GetInvertedIsOperatorCheckVariable(SyntaxNode node);\n\n        protected abstract bool AreEquivalent(SyntaxNode node1, SyntaxNode node2);\n\n        // LogicalAnd (C#) / AndAlso (VB)\n        protected void CheckAndExpression(SonarSyntaxNodeReportingContext context)\n        {\n            var binaryExpression = (TBinaryExpression)context.Node;\n            var binaryExpressionLeft = GetLeftNode(binaryExpression);\n            var binaryExpressionRight = GetRightNode(binaryExpression);\n\n            if (GetNonNullCheckVariable(binaryExpressionLeft) is SyntaxNode nonNullCheckVariable1\n                && GetIsOperatorCheckVariable(binaryExpressionRight) is  SyntaxNode isCheckVariable1\n                && AreEquivalent(nonNullCheckVariable1, isCheckVariable1))\n            {\n                context.ReportIssue(SupportedDiagnostics[0], binaryExpressionLeft);\n            }\n            if (GetNonNullCheckVariable(binaryExpressionRight) is SyntaxNode nonNullCheckVariable2\n                && GetIsOperatorCheckVariable(binaryExpressionLeft) is SyntaxNode isCheckVariable2\n                && AreEquivalent(nonNullCheckVariable2, isCheckVariable2))\n            {\n                context.ReportIssue(SupportedDiagnostics[0], binaryExpressionRight);\n            }\n        }\n\n        // LogicalOr (C#) / OrElse (VB)\n        protected void CheckOrExpression(SonarSyntaxNodeReportingContext context)\n        {\n            var binaryExpression = (TBinaryExpression)context.Node;\n            var binaryExpressionLeft = GetLeftNode(binaryExpression);\n            var binaryExpressionRight = GetRightNode(binaryExpression);\n\n            if (GetNullCheckVariable(binaryExpressionLeft) is SyntaxNode nullCheckVariable1\n                && GetInvertedIsOperatorCheckVariable(binaryExpressionRight) is SyntaxNode invertedIsCheckVariable1\n                && AreEquivalent(nullCheckVariable1, invertedIsCheckVariable1))\n            {\n                context.ReportIssue(SupportedDiagnostics[0], binaryExpressionLeft);\n            }\n            if (GetNullCheckVariable(binaryExpressionRight) is SyntaxNode nullCheckVariable2\n                && GetInvertedIsOperatorCheckVariable(binaryExpressionLeft) is SyntaxNode invertedIsCheckVariable2\n                && AreEquivalent(nullCheckVariable2, invertedIsCheckVariable2))\n            {\n                context.ReportIssue(SupportedDiagnostics[0], binaryExpressionRight);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/RedundantParenthesesBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class RedundantParenthesesBase<TParenthesizedExpression, TSyntaxKind>\n    : SonarDiagnosticAnalyzer\n    where TParenthesizedExpression : SyntaxNode\n    where TSyntaxKind : struct\n{\n    internal const string DiagnosticId = \"S1110\";\n    protected const string MessageFormat = \"Remove these redundant parentheses.\";\n    protected const string SecondaryMessage = \"Remove the redundant closing parentheses.\";\n\n    protected abstract GeneratedCodeRecognizer GeneratedCodeRecognizer { get; }\n    protected abstract TSyntaxKind ParenthesizedExpressionSyntaxKind { get; }\n\n    protected abstract SyntaxNode GetExpression(TParenthesizedExpression parenthesizedExpression);\n    protected abstract SyntaxToken GetOpenParenToken(TParenthesizedExpression parenthesizedExpression);\n    protected abstract SyntaxToken GetCloseParenToken(TParenthesizedExpression parenthesizedExpression);\n\n    protected sealed override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(\n            GeneratedCodeRecognizer,\n            c =>\n            {\n                var expression = (TParenthesizedExpression)c.Node;\n\n                if (!(expression.Parent is TParenthesizedExpression) &&\n                    (GetExpression(expression) is TParenthesizedExpression))\n                {\n                    var innermostExpression = GetSelfAndDescendantParenthesizedExpressions(expression)\n                        .Reverse()\n                        .Skip(1)\n                        .First(); // There are always at least two parenthesized expressions\n                    var location = GetOpenParenToken(expression).CreateLocation(GetOpenParenToken(innermostExpression));\n                    var secondaryLocation = GetCloseParenToken(innermostExpression).CreateLocation(GetCloseParenToken(expression)).ToSecondary(SecondaryMessage);\n                    c.ReportIssue(SupportedDiagnostics[0], location, [secondaryLocation]);\n                }\n            },\n            ParenthesizedExpressionSyntaxKind);\n    }\n\n    protected IEnumerable<TParenthesizedExpression> GetSelfAndDescendantParenthesizedExpressions(TParenthesizedExpression expression)\n    {\n        var descendant = expression;\n        while (descendant is not null)\n        {\n            yield return descendant;\n            descendant = GetExpression(descendant) as TParenthesizedExpression;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/RegularExpressions/RegexMustHaveValidSyntaxBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.RegularExpressions;\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class RegexMustHaveValidSyntaxBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n{\n    private const string DiagnosticId = \"S5856\";\n\n    protected sealed override string MessageFormat => \"Fix the syntax error inside this regex: {0}\";\n\n    protected RegexMustHaveValidSyntaxBase() : base(DiagnosticId) { }\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(\n            Language.GeneratedCodeRecognizer,\n            c => Analyze(c, RegexContext.FromCtor(Language, c.Model, c.Node)),\n            Language.SyntaxKind.ObjectCreationExpressions);\n\n        context.RegisterNodeAction(\n            Language.GeneratedCodeRecognizer,\n            c => Analyze(c, RegexContext.FromMethod(Language, c.Model, c.Node)),\n            Language.SyntaxKind.InvocationExpression);\n\n        context.RegisterNodeAction(\n            Language.GeneratedCodeRecognizer,\n            c => Analyze(c, RegexContext.FromAttribute(Language, c.Model, c.Node)),\n            Language.SyntaxKind.Attribute);\n    }\n\n    private void Analyze(SonarSyntaxNodeReportingContext c, RegexContext context)\n    {\n        if (context?.ParseError is { } error)\n        {\n            c.ReportIssue(Rule, context.PatternNode, error.Message);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/ReversedOperatorsBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class ReversedOperatorsBase<TUnaryExpressionSyntax> : SonarDiagnosticAnalyzer\n        where TUnaryExpressionSyntax : SyntaxNode\n    {\n        protected const string DiagnosticId = \"S2757\";\n        protected const string MessageFormat = \"Was '{0}' meant instead?\";\n\n        protected abstract SyntaxToken GetOperatorToken(TUnaryExpressionSyntax e);\n\n        protected abstract bool IsEqualsToken(SyntaxToken token);\n\n        protected abstract bool IsMinusToken(SyntaxToken token);\n\n        private static bool TiedTogether(FileLinePositionSpan left, FileLinePositionSpan right) =>\n            left.EndLinePosition == right.StartLinePosition;\n\n        protected Action<SonarSyntaxNodeReportingContext> GetAnalysisAction(DiagnosticDescriptor rule) =>\n            c =>\n            {\n                var unaryExpression = (TUnaryExpressionSyntax)c.Node;\n\n                var operatorToken = GetOperatorToken(unaryExpression);\n                var equalsToken = operatorToken.GetPreviousToken();\n                if (!IsEqualsToken(equalsToken))\n                {\n                    return;\n                }\n\n                var operandToken = operatorToken.GetNextToken();\n                var operatorLocation = operatorToken.GetLocation();\n\n                var operatorSpan = operatorLocation.GetLineSpan();\n                var equalsSignSpan = equalsToken.GetLocation().GetLineSpan();\n                var operandSpan = operandToken.GetLocation().GetLineSpan();\n\n                if (TiedTogether(equalsSignSpan, operatorSpan) &&\n                    !(IsMinusToken(operatorToken) && TiedTogether(operatorSpan, operandSpan)))\n                {\n                    c.ReportIssue(rule, operatorLocation, $\"{operatorToken.Text}=\");\n                }\n            };\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/SecurityPInvokeMethodShouldNotBeCalledBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    [Obsolete(\"This rule has been deprecated since 9.18\")]\n    public abstract class SecurityPInvokeMethodShouldNotBeCalledBase<TSyntaxKind, TInvocationExpressionSyntax> : SonarDiagnosticAnalyzer<TSyntaxKind>\n        where TSyntaxKind : struct\n        where TInvocationExpressionSyntax : SyntaxNode\n    {\n        protected const string DiagnosticId = \"S3884\";\n        protected const string InteropName = \"ole32\";\n        protected const string InteropDllName = InteropName + \".dll\";\n\n        protected abstract IMethodSymbol MethodSymbolForInvalidInvocation(SyntaxNode syntaxNode, SemanticModel semanticModel);\n\n        protected override string MessageFormat => \"Refactor the code to remove this use of '{0}'.\";\n\n        protected ISet<string> InvalidMethods { get; } = new HashSet<string>\n        {\n            \"CoSetProxyBlanket\",\n            \"CoInitializeSecurity\"\n        };\n\n        protected SecurityPInvokeMethodShouldNotBeCalledBase() : base(DiagnosticId) { }\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(Language.GeneratedCodeRecognizer, CheckForIssue, Language.SyntaxKind.InvocationExpression);\n\n        protected virtual bool IsImportFromInteropDll(IMethodSymbol symbol, SemanticModel semanticModel) =>\n            (symbol.IsExtern\n                ? symbol.GetAttributes(KnownType.System_Runtime_InteropServices_DllImportAttribute)\n                : symbol.GetAttributes(KnownType.System_Runtime_InteropServices_LibraryImportAttribute))\n                    .SelectMany(x => x.ConstructorArguments) // Both attributes have a single constructor which takes a single string \"library\" argument\n                    .Any(x => x.Value is string stringValue && IsInterop(stringValue));\n\n        protected virtual string GetMethodName(ISymbol symbol, SemanticModel semanticModel) =>\n            symbol.Name;\n\n        protected static bool IsInterop(string dllName) =>\n            dllName.Equals(InteropName, StringComparison.OrdinalIgnoreCase)\n            || dllName.Equals(InteropDllName, StringComparison.OrdinalIgnoreCase);\n\n        private void CheckForIssue(SonarSyntaxNodeReportingContext analysisContext)\n        {\n            if (analysisContext.Node is TInvocationExpressionSyntax invocation\n                && Language.Syntax.NodeExpression(invocation) is { } directMethodCall\n                && MethodSymbolForInvalidInvocation(directMethodCall, analysisContext.Model) is IMethodSymbol methodSymbol\n                && methodSymbol.IsStatic\n                && IsImportFromInteropDll(methodSymbol, analysisContext.Model))\n            {\n                analysisContext.ReportIssue(Rule, Language.Syntax.NodeIdentifier(directMethodCall).Value, GetMethodName(methodSymbol, analysisContext.Model));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/SelfAssignmentBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class SelfAssignmentBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n        where TSyntaxKind : struct\n    {\n        private const string DiagnosticId = \"S1656\";\n\n        protected override string MessageFormat => \"Remove or correct this useless self-assignment.\";\n\n        protected SelfAssignmentBase() : base(DiagnosticId) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/SetPropertiesInsteadOfMethodsBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class SetPropertiesInsteadOfMethodsBase<TSyntaxKind, TInvocation> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n    where TInvocation : SyntaxNode\n{\n    private const string DiagnosticId = \"S6609\";\n    protected override string MessageFormat => \"\\\"{0}\\\" property of Set type should be used instead of the \\\"{0}()\\\" extension method.\";\n\n    private static readonly ImmutableArray<KnownType> TargetTypes = ImmutableArray.Create(\n        KnownType.System_Collections_Generic_SortedSet_T,\n        KnownType.System_Collections_Immutable_ImmutableSortedSet_T);\n\n    protected abstract bool HasCorrectArgumentCount(TInvocation invocation);\n    protected abstract bool TryGetOperands(TInvocation invocation, out SyntaxNode typeNode, out SyntaxNode methodNode);\n\n    protected SetPropertiesInsteadOfMethodsBase() : base(DiagnosticId) { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(Language.GeneratedCodeRecognizer, c =>\n        {\n            var invocation = (TInvocation)c.Node;\n            var methodName = Language.GetName(invocation);\n\n            if (HasCorrectName(methodName)\n                && HasCorrectArgumentCount(invocation)\n                && TryGetOperands(invocation, out var typeNode, out var methodNode)\n                && IsCorrectType(typeNode, c.Model)\n                && IsCorrectCall(methodNode, c.Model))\n            {\n                c.ReportIssue(Rule, Language.Syntax.NodeIdentifier(invocation)?.GetLocation(), methodName);\n            }\n        }, Language.SyntaxKind.InvocationExpression);\n\n    private bool HasCorrectName(string methodName) =>\n        methodName.Equals(nameof(Enumerable.Min), Language.NameComparison)\n        || methodName.Equals(nameof(Enumerable.Max), Language.NameComparison);\n\n    private static bool IsCorrectType(SyntaxNode node, SemanticModel model) =>\n        model.GetTypeInfo(node).Type.DerivesFromAny(TargetTypes);\n\n    private static bool IsCorrectCall(SyntaxNode node, SemanticModel model) =>\n        model.GetSymbolInfo(node).Symbol is IMethodSymbol method\n        && method.IsExtensionOn(KnownType.System_Collections_Generic_IEnumerable_T);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/ShiftDynamicNotIntegerBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class ShiftDynamicNotIntegerBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind> where TSyntaxKind : struct\n{\n    private const string DiagnosticId = \"S3449\";\n\n    protected abstract bool CanBeConvertedTo(SyntaxNode expression, ITypeSymbol type, SemanticModel model);\n\n    protected abstract bool ShouldRaise(SemanticModel model, SyntaxNode left, SyntaxNode right);\n\n    protected override string MessageFormat => \"Remove this erroneous shift, it will fail because '{0}' can't be implicitly converted to 'int'.\";\n\n    protected ShiftDynamicNotIntegerBase() : base(DiagnosticId) { }\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(\n            Language.GeneratedCodeRecognizer,\n            c => CheckExpressionWithTwoParts(c, b => Language.Syntax.BinaryExpressionLeft(b), b => Language.Syntax.BinaryExpressionRight(b)),\n            Language.SyntaxKind.LeftShiftExpression,\n            Language.SyntaxKind.RightShiftExpression);\n\n        context.RegisterNodeAction(\n            Language.GeneratedCodeRecognizer,\n            c => CheckExpressionWithTwoParts(c, b => Language.Syntax.AssignmentLeft(b), b => Language.Syntax.AssignmentRight(b)),\n            Language.SyntaxKind.LeftShiftAssignmentStatement,\n            Language.SyntaxKind.RightShiftAssignmentStatement);\n    }\n\n    protected bool IsConvertibleToInt(SyntaxNode expression, SemanticModel model) =>\n        model.Compilation.GetTypeByMetadataName(KnownType.System_Int32) is { } intType\n        && CanBeConvertedTo(expression, intType, model);\n\n    private void CheckExpressionWithTwoParts(SonarSyntaxNodeReportingContext context, Func<SyntaxNode, SyntaxNode> getLeft, Func<SyntaxNode, SyntaxNode> getRight)\n    {\n        var expression = context.Node;\n        var left = getLeft(expression);\n        var right = getRight(expression);\n\n        if (!IsErrorType(right, context.Model, out var typeOfRight)\n            && ShouldRaise(context.Model, left, right))\n        {\n            var typeInMessage = TypeNameForMessage(right, typeOfRight, context.Model);\n            context.ReportIssue(Rule, right, typeInMessage);\n        }\n    }\n\n    private static string TypeNameForMessage(SyntaxNode expression, ITypeSymbol typeOfRight, SemanticModel model) =>\n        model.GetConstantValue(expression) is { HasValue: true, Value: null }\n            ? \"null\"\n            : typeOfRight.ToMinimalDisplayString(model, expression.SpanStart);\n\n    private static bool IsErrorType(SyntaxNode expression, SemanticModel model, out ITypeSymbol type)\n    {\n        type = model.GetTypeInfo(expression).Type;\n        return type.Is(TypeKind.Error);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/ShouldImplementExportedInterfacesBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class ShouldImplementExportedInterfacesBase<TArgumentSyntax, TAttributeSyntax, TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n        where TArgumentSyntax : SyntaxNode\n        where TAttributeSyntax : SyntaxNode\n        where TSyntaxKind : struct\n    {\n        private const string DiagnosticId = \"S4159\";\n        private const string ActionForInterface = \"Implement\";\n        private const string ActionForClass = \"Derive from\";\n\n        private readonly ImmutableArray<KnownType> exportAttributes =\n            ImmutableArray.Create(\n                KnownType.System_ComponentModel_Composition_ExportAttribute,\n                KnownType.System_ComponentModel_Composition_InheritedExportAttribute,\n                KnownType.System_Composition_ExportAttribute);\n\n        protected abstract SeparatedSyntaxList<TArgumentSyntax>? GetAttributeArguments(TAttributeSyntax attributeSyntax);\n        protected abstract SyntaxNode GetAttributeName(TAttributeSyntax attributeSyntax);\n        protected abstract bool IsClassOrRecordSyntax(SyntaxNode syntaxNode);\n        // Retrieve the expression inside of the typeof()/GetType() (e.g. typeof(Foo) => Foo)\n        protected abstract SyntaxNode GetTypeOfOrGetTypeExpression(SyntaxNode expressionSyntax);\n\n        protected override string MessageFormat => \"{0} '{1}' on '{2}' or remove this export attribute.\";\n\n        protected ShouldImplementExportedInterfacesBase() : base(DiagnosticId) { }\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(Language.GeneratedCodeRecognizer,\n                c =>\n                {\n                    var attributeSyntax = (TAttributeSyntax)c.Node;\n                    if (c.Model.GetSymbolInfo(GetAttributeName(attributeSyntax)).Symbol is not IMethodSymbol attributeCtorSymbol\n                        || !attributeCtorSymbol.ContainingType.IsAny(exportAttributes))\n                    {\n                        return;\n                    }\n\n                    var exportedType = GetExportedTypeSymbol(GetAttributeArguments(attributeSyntax), c.Model);\n                    var attributeTargetType = GetAttributeTargetSymbol(attributeSyntax, c.Model);\n                    if (exportedType is null\n                        || attributeTargetType is null\n                        || IsOfExportType(attributeTargetType, exportedType))\n                    {\n                        return;\n                    }\n\n                    var action = exportedType.IsInterface()\n                                     ? ActionForInterface\n                                     : ActionForClass;\n\n                    c.ReportIssue(\n                        Rule,\n                        attributeSyntax,\n                        action,\n                        exportedType.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat),\n                        attributeTargetType.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat));\n                },\n                Language.SyntaxKind.Attribute);\n\n        private static bool IsOfExportType(ITypeSymbol type, INamedTypeSymbol exportedType) =>\n            type is INamedTypeSymbol namedType\n            && namedType.SelfBaseTypesAndInterfaces()\n                .Any(currentType =>\n                         exportedType.IsUnboundGenericType\n                             ? currentType.OriginalDefinition.Equals(exportedType.ConstructedFrom)\n                             : currentType.Equals(exportedType));\n\n        private INamedTypeSymbol GetExportedTypeSymbol(SeparatedSyntaxList<TArgumentSyntax>? attributeArguments, SemanticModel semanticModel)\n        {\n            if (!attributeArguments.HasValue)\n            {\n                return null;\n            }\n\n            var arguments = attributeArguments.Value;\n            if (arguments.Count != 1 && arguments.Count != 2)\n            {\n                return null;\n            }\n\n            var argumentSyntax = GetArgumentFromNamedArgument(arguments)\n                                 ?? GetArgumentFromSingleArgumentAttribute(arguments)\n                                 ?? GetArgumentFromDoubleArgumentAttribute(arguments, semanticModel);\n\n            var typeOfOrGetTypeExpression = Language.Syntax.NodeExpression(argumentSyntax);\n            var exportedTypeSyntax = GetTypeOfOrGetTypeExpression(typeOfOrGetTypeExpression);\n            return exportedTypeSyntax == null\n                       ? null\n                       : semanticModel.GetSymbolInfo(exportedTypeSyntax).Symbol as INamedTypeSymbol;\n        }\n\n        private ITypeSymbol GetAttributeTargetSymbol(SyntaxNode syntaxNode, SemanticModel semanticModel) =>\n            // Parent is AttributeListSyntax, we handle only class attributes\n            !IsClassOrRecordSyntax(syntaxNode.Parent?.Parent) ? null : semanticModel.GetDeclaredSymbol(syntaxNode.Parent.Parent) as ITypeSymbol;\n\n        private TArgumentSyntax GetArgumentFromNamedArgument(IEnumerable<TArgumentSyntax> arguments) =>\n            arguments.FirstOrDefault(x => \"contractType\".Equals(Language.Syntax.NodeIdentifier(x)?.ValueText, Language.NameComparison));\n\n        private TArgumentSyntax GetArgumentFromDoubleArgumentAttribute(SeparatedSyntaxList<TArgumentSyntax> arguments, SemanticModel semanticModel)\n        {\n            if (arguments.Count != 2)\n            {\n                return null;\n            }\n\n            if (Language.Syntax.NodeExpression(arguments[0]) is { } firstArgument && semanticModel.GetConstantValue(firstArgument).Value is string)\n            {\n                // Two arguments, second should be typeof expression\n                return arguments[1];\n            }\n\n            return null;\n        }\n\n        private static TArgumentSyntax GetArgumentFromSingleArgumentAttribute(SeparatedSyntaxList<TArgumentSyntax> arguments) =>\n            arguments.Count == 1 ? arguments[0] : null; // Only one argument, should be typeof expression\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/SingleStatementPerLineBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class SingleStatementPerLineBase<TSyntaxKind, TStatementSyntax> : SonarDiagnosticAnalyzer<TSyntaxKind>\n        where TSyntaxKind : struct\n        where TStatementSyntax : SyntaxNode\n    {\n        protected const string DiagnosticId = \"S122\";\n        protected override string MessageFormat => \"Reformat the code to have only one statement per line.\";\n\n        protected abstract GeneratedCodeRecognizer GeneratedCodeRecognizer { get; }\n        protected abstract bool StatementShouldBeExcluded(TStatementSyntax statement);\n\n        protected SingleStatementPerLineBase() : base(DiagnosticId) { }\n\n        protected sealed override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterTreeAction(\n                GeneratedCodeRecognizer,\n                c =>\n                {\n                    var statements = c.Tree.GetRoot()\n                        .DescendantNodesAndSelf()\n                        .OfType<TStatementSyntax>()\n                        .Where(st => !StatementShouldBeExcluded(st));\n\n                    var statementsByLines = MultiValueDictionary<int, TStatementSyntax>.Create<HashSet<TStatementSyntax>>();\n                    foreach (var statement in statements)\n                    {\n                        AddStatementToLineCache(statement, statementsByLines);\n                    }\n\n                    var lines = c.Tree.GetText().Lines;\n                    foreach (var statementsByLine in statementsByLines.Where(pair => pair.Value.Count > 1))\n                    {\n                        var location = CalculateLocationForLine(lines[statementsByLine.Key], c.Tree, statementsByLine.Value);\n                        c.ReportIssue(SupportedDiagnostics[0], location);\n                    }\n                });\n\n        private static Location CalculateLocationForLine(TextLine line, SyntaxTree tree, ICollection<TStatementSyntax> statements)\n        {\n            var lineSpan = line.Span;\n\n            var min = statements.Min(st => lineSpan.Intersection(st.Span).Value.Start);\n            var max = statements.Max(st => lineSpan.Intersection(st.Span).Value.End);\n\n            return Location.Create(tree, TextSpan.FromBounds(min, max));\n        }\n\n        private void AddStatementToLineCache(TStatementSyntax statement, MultiValueDictionary<int, TStatementSyntax> statementsByLines)\n        {\n            var startLine = statement.GetLocation().StartLine();\n            statementsByLines.AddWithKey(startLine, statement);\n\n            var lastToken = statement.GetLastToken();\n            var tokenBelonsTo = GetContainingStatement(lastToken);\n            if (tokenBelonsTo == statement)\n            {\n                var endLine = statement.GetLocation().EndLine();\n                statementsByLines.AddWithKey(endLine, statement);\n            }\n        }\n\n        private TStatementSyntax GetContainingStatement(SyntaxToken token)\n        {\n            var node = token.Parent;\n            var statement = node as TStatementSyntax;\n            while (node != null\n                && (statement == null || !StatementShouldBeExcluded(statement)))\n            {\n                node = node.Parent;\n                statement = node as TStatementSyntax;\n            }\n            return statement;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/StringConcatenationInLoopBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class StringConcatenationInLoopBase<TSyntaxKind, TAssignmentExpression, TBinaryExpression> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n    where TAssignmentExpression : SyntaxNode\n    where TBinaryExpression : SyntaxNode\n{\n    protected const string DiagnosticId = \"S1643\";\n\n    protected abstract TSyntaxKind[] CompoundAssignmentKinds { get; }\n    protected abstract ISet<TSyntaxKind> ExpressionConcatenationKinds { get; }\n    protected abstract ISet<TSyntaxKind> LoopKinds { get; }\n    protected abstract SyntaxNode LeftMostExpression(SyntaxNode expression);\n\n    protected override string MessageFormat => \"Use a StringBuilder instead.\";\n\n    protected StringConcatenationInLoopBase() : base(DiagnosticId) { }\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(Language.GeneratedCodeRecognizer, CheckSimpleAssignment, Language.SyntaxKind.SimpleAssignment);\n        context.RegisterNodeAction(Language.GeneratedCodeRecognizer, CheckCompoundAssignment, CompoundAssignmentKinds);\n    }\n\n    private void CheckSimpleAssignment(SonarSyntaxNodeReportingContext context)\n    {\n        var assignment = (TAssignmentExpression)context.Node;\n\n        if (Language.Syntax.AssignmentRight(assignment) is TBinaryExpression { } rightExpression\n            && Language.Syntax.IsAnyKind(rightExpression, ExpressionConcatenationKinds)\n            && Language.Syntax.AssignmentLeft(assignment) is var assigned\n            && IsIdentifierOnTheRight(assigned, rightExpression)\n            && IsSystemString(assigned, context.Model)\n            && LeftMostExpression(assigned) is { } expressionToCheck\n            && AreNotDefinedInTheSameLoop(expressionToCheck, assignment, context.Model))\n        {\n            context.ReportIssue(SupportedDiagnostics[0], assignment);\n        }\n    }\n\n    private void CheckCompoundAssignment(SonarSyntaxNodeReportingContext context)\n    {\n        var addAssignment = (TAssignmentExpression)context.Node;\n        if (Language.Syntax.AssignmentLeft(addAssignment) is { } expression\n            && IsSystemString(expression, context.Model)\n            && LeftMostExpression(expression) is { } expressionToCheck\n            && AreNotDefinedInTheSameLoop(expressionToCheck, addAssignment, context.Model))\n        {\n            context.ReportIssue(SupportedDiagnostics[0], addAssignment);\n        }\n    }\n\n    private bool IsIdentifierOnTheRight(SyntaxNode identifier, SyntaxNode expression)\n    {\n        while (expression is TBinaryExpression && Language.Syntax.IsAnyKind(expression, ExpressionConcatenationKinds))\n        {\n            var left = Language.Syntax.BinaryExpressionLeft(expression);\n            var right = Language.Syntax.BinaryExpressionRight(expression);\n\n            if (Language.Syntax.AreEquivalent(left, identifier) || Language.Syntax.AreEquivalent(right, identifier))\n            {\n                return true;\n            }\n            // No need to recurse into the right branch as the only useful concatenation is flat `\"a\" + \"b\" + s`\n            // `\"a\" + (s  + \"b\")` seems not worth to support.\n            expression = left;\n        }\n        return false;\n    }\n\n    private static bool IsSystemString(SyntaxNode node, SemanticModel model) =>\n        node.IsKnownType(KnownType.System_String, model);\n\n    private SyntaxNode NearestLoop(SyntaxNode node) =>\n        node.AncestorsAndSelf().FirstOrDefault(x => Language.Syntax.IsAnyKind(x, LoopKinds));\n\n    private bool AreNotDefinedInTheSameLoop(SyntaxNode expression, SyntaxNode assignment, SemanticModel model) =>\n        NearestLoop(assignment) is { } nearestLoopForConcatenation\n        && !(model.GetSymbolInfo(expression).Symbol is { } symbol\n                && symbol.GetFirstSyntaxRef() is { } declaration\n                && NearestLoop(declaration) is { } nearestLoop\n                && Language.Syntax.AreEquivalent(nearestLoop, nearestLoopForConcatenation));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/StringLiteralShouldNotBeDuplicatedBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class StringLiteralShouldNotBeDuplicatedBase<TSyntaxKind, TLiteralExpressionSyntax> : ParametrizedDiagnosticAnalyzer\n    where TSyntaxKind : struct\n    where TLiteralExpressionSyntax : SyntaxNode\n{\n    private const string DiagnosticId = \"S1192\";\n    private const string MessageFormat = \"Define a constant instead of using this literal '{0}' {1} times.\";\n    private const int MinimumStringLength = 5;\n    private const int ThresholdDefaultValue = 3;\n\n    private readonly DiagnosticDescriptor rule;\n\n    protected abstract ILanguageFacade<TSyntaxKind> Language { get; }\n\n    protected abstract TSyntaxKind[] SyntaxKinds { get; }\n\n    protected abstract bool IsMatchingMethodParameterName(TLiteralExpressionSyntax literalExpression);\n    protected abstract bool IsInnerInstance(SonarSyntaxNodeReportingContext context);\n    protected abstract IEnumerable<TLiteralExpressionSyntax> FindLiteralExpressions(SyntaxNode node);\n    protected abstract SyntaxToken LiteralToken(TLiteralExpressionSyntax literal);\n\n    [RuleParameter(\"threshold\", PropertyType.Integer, \"Number of times a literal must be duplicated to trigger an issue.\", ThresholdDefaultValue)]\n    public int Threshold { get; set; } = ThresholdDefaultValue;\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(rule);\n\n    protected StringLiteralShouldNotBeDuplicatedBase() =>\n        rule = Language.CreateDescriptor(DiagnosticId, MessageFormat, isEnabledByDefault: false);\n\n    protected override void Initialize(SonarParametrizedAnalysisContext context) =>\n        // Ideally we would like to report at assembly/project level for the primary and all string instances for secondary\n        // locations. The problem is that this scenario is not yet supported on SonarQube side.\n        // Hence the decision to do like other languages, at class-level\n        context.RegisterCompilationStartAction(c =>\n            {\n                var usingDapper = c.Compilation.GetTypeByMetadataName(KnownType.Dapper_DynamicParameters) is not null;\n                c.RegisterNodeAction(Language.GeneratedCodeRecognizer, nodeContext => ReportOnViolation(nodeContext, usingDapper), SyntaxKinds);\n            });\n\n    protected virtual bool IsNamedTypeOrTopLevelMain(SonarSyntaxNodeReportingContext context) =>\n        IsNamedType(context);\n\n    protected static bool IsNamedType(SonarSyntaxNodeReportingContext context) =>\n        context.ContainingSymbol.Kind == SymbolKind.NamedType;\n\n    private void ReportOnViolation(SonarSyntaxNodeReportingContext context, bool usingDapper)\n    {\n        if (!IsNamedTypeOrTopLevelMain(context) || IsInnerInstance(context))\n        {\n            return;\n        }\n\n        var stringLiterals = FindLiteralExpressions(context.Node);\n        var duplicateValuesAndPositions = stringLiterals.Select(x => new { literal = x, literalToken = LiteralToken(x) })\n            .Where(x => x.literalToken.ValueText is { Length: >= MinimumStringLength }\n                        && !IsMatchingMethodParameterName(x.literal)\n                        && !IsInEFMigration(x.literal, context.Model)\n                        && !(usingDapper && x.literalToken.ValueText.StartsWith(\"@\")))\n            .GroupBy(x => x.literalToken.ValueText, x => x.literalToken)\n            .Where(x => x.Count() > Threshold);\n\n        // Report duplications\n        foreach (var item in duplicateValuesAndPositions)\n        {\n            var duplicates = item.ToList();\n            var firstToken = duplicates[0];\n            context.ReportIssue(rule, firstToken, duplicates.Skip(1).ToSecondaryLocations(), ExtractStringContent(firstToken), duplicates.Count.ToString());\n        }\n    }\n\n    private static bool IsInEFMigration(SyntaxNode node, SemanticModel model) =>\n        model.GetEnclosingSymbol(node.SpanStart)?.ContainingType is { } typeSymbol\n        && IsEFMigrationType(typeSymbol);\n\n    private static bool IsEFMigrationType(INamedTypeSymbol typeSymbol) =>\n        typeSymbol.DerivesFrom(KnownType.Microsoft_EntityFrameworkCore_Migrations_Migration)\n        || typeSymbol.DerivesFrom(KnownType.System_Data_Entity_Migrations_DbMigration);\n\n    private static string ExtractStringContent(SyntaxToken literalToken) =>\n         // Use literalToken.Text to get the text as written by the developer. The unescaped text (literalToken.ValueText)\n         // might contain control characters that may cause trouble when used as error message (e.g. a null-terminator).\n         // The literalToken.Text contains leading and trailing double quotes that we strip of.\n         literalToken.Text.StartsWith(\"@\\\"\") ? literalToken.Text.Substring(2, literalToken.Text.Length - 3) : literalToken.Text.Substring(1, literalToken.Text.Length - 2);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/SwitchCasesMinimumThreeBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class SwitchCasesMinimumThreeBase : SonarDiagnosticAnalyzer\n    {\n        protected const string DiagnosticId = \"S1301\";\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/SwitchSectionShouldNotHaveTooManyStatementsBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class SwitchSectionShouldNotHaveTooManyStatementsBase : ParametrizedDiagnosticAnalyzer\n    {\n        protected const string DiagnosticId = \"S1151\";\n        protected const string MessageFormat = \"Reduce this {0} number of statements from {1} to at most {2}, for example by extracting code into a {3}.\";\n\n        private const int ThresholdDefaultValue = 8;\n        [RuleParameter(\"max\", PropertyType.Integer, \"Maximum number of statements.\", ThresholdDefaultValue)]\n        public int Threshold { get; set; } = ThresholdDefaultValue;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/SwitchShouldNotBeNestedBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class SwitchShouldNotBeNestedBase : SonarDiagnosticAnalyzer\n    {\n        protected const string DiagnosticId = \"S1821\";\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/SwitchWithoutDefaultBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class SwitchWithoutDefaultBase : SonarDiagnosticAnalyzer\n    {\n        protected const string DiagnosticId = \"S131\";\n        protected const string MessageFormat = \"Add a '{0}' clause to this '{1}' statement.\";\n\n        protected abstract GeneratedCodeRecognizer GeneratedCodeRecognizer { get; }\n    }\n\n    public abstract class SwitchWithoutDefaultBase<TLanguageKindEnum> : SwitchWithoutDefaultBase\n        where TLanguageKindEnum : struct\n    {\n        protected sealed override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                GeneratedCodeRecognizer,\n                c =>\n                {\n                    if (TryGetDiagnostic(c.Node, out var diagnostic))\n                    {\n                        c.ReportIssue(diagnostic);\n                    }\n                },\n                SyntaxKindsOfInterest.ToArray());\n        }\n\n        protected abstract bool TryGetDiagnostic(SyntaxNode node, out Diagnostic diagnostic);\n\n        public abstract ImmutableArray<TLanguageKindEnum> SyntaxKindsOfInterest { get; }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/TabCharacterBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class TabCharacterBase : SonarDiagnosticAnalyzer\n    {\n        protected sealed override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterTreeAction(\n                GeneratedCodeRecognizer,\n                c =>\n                {\n                    var offset = c.Tree.GetText().ToString().IndexOf('\\t');\n                    if (offset < 0)\n                    {\n                        return;\n                    }\n\n                    var location = c.Tree.GetLocation(TextSpan.FromBounds(offset, offset));\n                    c.ReportIssue(SupportedDiagnostics[0], location);\n                });\n        }\n\n        protected abstract GeneratedCodeRecognizer GeneratedCodeRecognizer { get; }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/TestsShouldNotUseThreadSleepBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class TestsShouldNotUseThreadSleepBase<TMethodSyntax, TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TMethodSyntax : SyntaxNode\n    where TSyntaxKind : struct\n{\n    private const string DiagnosticId = \"S2925\";\n\n    protected override string MessageFormat => \"Do not use 'Thread.Sleep()' in a test.\";\n\n    protected abstract SyntaxNode MethodDeclaration(TMethodSyntax method);\n\n    protected TestsShouldNotUseThreadSleepBase() : base(DiagnosticId) { }\n\n    protected sealed override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(Language.GeneratedCodeRecognizer, c =>\n        {\n            if (c.Node.ToStringContains(nameof(Thread.Sleep), Language.NameComparison)\n                && c.Model.GetSymbolInfo(c.Node).Symbol is IMethodSymbol method\n                && method.Is(KnownType.System_Threading_Thread, nameof(Thread.Sleep))\n                && IsInTestMethod(c.Node, c.Model))\n            {\n                c.ReportIssue(Rule, c.Node);\n            }\n        },\n        Language.SyntaxKind.InvocationExpression);\n\n    private bool IsInTestMethod(SyntaxNode node, SemanticModel model) =>\n        node.Ancestors().OfType<TMethodSyntax>().FirstOrDefault() is { } method\n        && model.GetDeclaredSymbol(MethodDeclaration(method)) is IMethodSymbol symbol\n        && symbol.IsTestMethod();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/ThreadResumeOrSuspendShouldNotBeCalledBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class ThreadResumeOrSuspendShouldNotBeCalledBase<TSyntaxKind, TInvocation> : DoNotCallMethodsBase<TSyntaxKind, TInvocation>\n        where TSyntaxKind : struct\n        where TInvocation : SyntaxNode\n    {\n        private const string DiagnosticId = \"S3889\";\n\n        protected override string MessageFormat => \"Refactor the code to remove this use of '{0}'.\";\n\n        protected override IEnumerable<MemberDescriptor> CheckedMethods { get; } = new List<MemberDescriptor>\n        {\n            new(KnownType.System_Threading_Thread, \"Suspend\"),\n            new(KnownType.System_Threading_Thread, \"Resume\")\n        };\n\n        protected ThreadResumeOrSuspendShouldNotBeCalledBase() : base(DiagnosticId) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/ThrowReservedExceptionsBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class ThrowReservedExceptionsBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n{\n    protected const string DiagnosticId = \"S112\";\n\n    private readonly ImmutableArray<KnownType> reservedExceptions = ImmutableArray.Create(\n        KnownType.System_Exception,\n        KnownType.System_ApplicationException,\n        KnownType.System_SystemException,\n        KnownType.System_ExecutionEngineException,\n        KnownType.System_IndexOutOfRangeException,\n        KnownType.System_NullReferenceException,\n        KnownType.System_OutOfMemoryException);\n\n    protected override string MessageFormat => \"'{0}' should not be thrown by user code.\";\n\n    protected ThrowReservedExceptionsBase() : base(DiagnosticId) { }\n\n    protected void Process(SonarSyntaxNodeReportingContext context, SyntaxNode thrownExpression)\n    {\n        if (thrownExpression is not null && Language.Syntax.IsAnyKind(thrownExpression, Language.SyntaxKind.ObjectCreationExpressions))\n        {\n            var expressionType = context.Model.GetTypeInfo(thrownExpression).Type;\n            if (expressionType.IsAny(reservedExceptions))\n            {\n                context.ReportIssue(Rule, thrownExpression, expressionType.ToDisplayString());\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/ToStringShouldNotReturnNullBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class ToStringShouldNotReturnNullBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n        where TSyntaxKind : struct\n{\n    private const string DiagnosticId = \"S2225\";\n    protected abstract TSyntaxKind MethodKind { get; }\n\n    protected abstract bool IsLocalOrLambda(SyntaxNode node);\n\n    protected abstract IEnumerable<SyntaxNode> Conditionals(SyntaxNode expression);\n\n    protected override string MessageFormat => \"Return an empty string instead.\";\n\n    protected ToStringShouldNotReturnNullBase() : base(DiagnosticId) { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            Language.GeneratedCodeRecognizer,\n            c => ToStringReturnsNull(c, c.Node),\n            Language.SyntaxKind.ReturnStatement);\n\n    protected void ToStringReturnsNull(SonarSyntaxNodeReportingContext context, SyntaxNode node)\n    {\n        if (node is not null && ReturnsNull(Language.Syntax.NodeExpression(node)) && WithinToString(node))\n        {\n            context.ReportIssue(Rule, node);\n        }\n    }\n\n    private bool ReturnsNull(SyntaxNode node) =>\n        Language.Syntax.IsNullLiteral(node)\n        || Conditionals(node).Select(Language.Syntax.RemoveParentheses).Any(ReturnsNull);\n\n    private bool WithinToString(SyntaxNode node) =>\n        node.Ancestors()\n            .TakeWhile(x => !IsLocalOrLambda(x))\n            .Any(x => Language.Syntax.IsKind(x, MethodKind)\n                        && nameof(ToString).Equals(Language.Syntax.NodeIdentifier(x)?.ValueText, Language.NameComparison)\n                        && x.Parent?.RawKind is not (int)SyntaxKindEx.ExtensionBlockDeclaration\n                        && !Language.Syntax.IsStatic(x));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/TooManyLabelsInSwitchBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class TooManyLabelsInSwitchBase<TSyntaxKind, TSwitchStatementSyntax> : ParametrizedDiagnosticAnalyzer\n    where TSyntaxKind : struct\n    where TSwitchStatementSyntax : SyntaxNode\n{\n    protected const string MessageFormat = \"Consider reworking this '{0}' to reduce the number of '{1}' clauses to at most {{0}} or have only one statement per '{1}'.\";\n    protected const string DiagnosticId = \"S1479\";\n    private const int DefaultValueMaximum = 30;\n\n    protected abstract DiagnosticDescriptor Rule { get; }\n\n    protected abstract TSyntaxKind[] SyntaxKinds { get; }\n\n    protected abstract GeneratedCodeRecognizer GeneratedCodeRecognizer { get; }\n\n    protected abstract SyntaxNode GetExpression(TSwitchStatementSyntax statement);\n\n    protected abstract int GetSectionsCount(TSwitchStatementSyntax statement);\n\n    protected abstract bool AllSectionsAreOneLiners(TSwitchStatementSyntax statement);\n\n    protected abstract Location GetKeywordLocation(TSwitchStatementSyntax statement);\n\n    [RuleParameter(\"maximum\", PropertyType.Integer, \"Maximum number of case\", DefaultValueMaximum)]\n    public int Maximum { get; set; } = DefaultValueMaximum;\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics =>\n        ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarParametrizedAnalysisContext context) =>\n        context.RegisterNodeAction(\n            GeneratedCodeRecognizer,\n            c =>\n            {\n                var switchNode = (TSwitchStatementSyntax)c.Node;\n\n                if (c.Model.GetTypeInfo(GetExpression(switchNode)).Type is { TypeKind: not TypeKind.Enum }\n                    && GetSectionsCount(switchNode) > Maximum\n                    && !AllSectionsAreOneLiners(switchNode))\n                {\n                    c.ReportIssue(Rule, GetKeywordLocation(switchNode), Maximum.ToString());\n                }\n            },\n            SyntaxKinds);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/TooManyParametersBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class TooManyParametersBase<TSyntaxKind, TParameterListSyntax> : ParametrizedDiagnosticAnalyzer\n        where TSyntaxKind : struct\n        where TParameterListSyntax : SyntaxNode\n    {\n        protected const string DiagnosticId = \"S107\";\n        protected const string MessageFormat = \"{0} has {1} parameters, which is greater than the {2} authorized.\";\n        private const int DefaultValueMaximum = 7;\n\n        private readonly DiagnosticDescriptor rule;\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(rule);\n\n        [RuleParameter(\"max\", PropertyType.Integer, \"Maximum authorized number of parameters\", DefaultValueMaximum)]\n        public int Maximum { get; set; } = DefaultValueMaximum;\n\n        protected abstract ILanguageFacade<TSyntaxKind> Language { get; }\n        protected abstract string UserFriendlyNameForNode(SyntaxNode node);\n        protected abstract int CountParameters(TParameterListSyntax parameterList);\n        protected abstract int BaseParameterCount(SyntaxNode node);\n        protected abstract bool CanBeChanged(SyntaxNode node, SemanticModel semanticModel);\n        protected virtual bool IsExtern(SyntaxNode node) => false;\n\n        protected TooManyParametersBase() =>\n            rule = Language.CreateDescriptor(DiagnosticId, MessageFormat, isEnabledByDefault: false);\n\n        protected override void Initialize(SonarParametrizedAnalysisContext context) =>\n            context.RegisterNodeAction(\n                Language.GeneratedCodeRecognizer,\n                c =>\n                {\n                    var parametersCount = CountParameters((TParameterListSyntax)c.Node);\n                    var baseCount = BaseParameterCount(c.Node.Parent);\n                    if (parametersCount - baseCount > Maximum\n                        && c.Node.Parent is { } parent\n                        && !IsExtern(parent)\n                        && CanBeChanged(parent, c.Model))\n                    {\n                        var valueText = baseCount == 0 ? parametersCount.ToString() : $\"{parametersCount - baseCount} new\";\n                        c.ReportIssue(SupportedDiagnostics[0], c.Node, UserFriendlyNameForNode(c.Node.Parent), valueText, Maximum.ToString());\n                    }\n                },\n                Language.SyntaxKind.ParameterList);\n\n        protected static bool VerifyCanBeChangedBySymbol(SyntaxNode node, SemanticModel semanticModel)\n        {\n            var declaredSymbol = semanticModel.GetDeclaredSymbol(node);\n            var symbol = semanticModel.GetSymbolInfo(node).Symbol;\n            if (declaredSymbol == null && symbol == null)\n            {\n                return false;\n            }\n\n            if (symbol != null)\n            {\n                return true;    // Not a declaration, such as Action\n            }\n\n            if (declaredSymbol.IsStatic)\n            {\n                if ((declaredSymbol.IsExtern && declaredSymbol.HasAttribute(KnownType.System_Runtime_InteropServices_DllImportAttribute))\n                    || declaredSymbol.HasAttribute(KnownType.System_Runtime_InteropServices_LibraryImportAttribute))\n                {\n                    return false;   // P/Invoke method is defined externally.\n                }\n            }\n\n            return declaredSymbol.GetOverriddenMember() is null && declaredSymbol.InterfaceMembers().IsEmpty();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/UnaryPrefixOperatorRepeatedBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class UnaryPrefixOperatorRepeatedBase<TSyntaxKindEnum, TSyntaxNode> : SonarDiagnosticAnalyzer\n        where TSyntaxNode : SyntaxNode\n        where TSyntaxKindEnum : struct\n    {\n        internal const string DiagnosticId = \"S2761\";\n        protected const string MessageFormat = \"Use the '{0}' operator just once or not at all.\";\n\n        protected abstract DiagnosticDescriptor Rule { get; }\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n        protected abstract ISet<TSyntaxKindEnum> SyntaxKinds { get; }\n\n        protected abstract GeneratedCodeRecognizer GeneratedCodeRecognizer { get; }\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                GeneratedCodeRecognizer,\n                c =>\n                {\n                    var topLevelUnary = (TSyntaxNode)c.Node;\n\n                    if (!TopLevelUnaryInChain(topLevelUnary))\n                    {\n                        return;\n                    }\n\n                    var repeatedCount = 0U;\n                    var currentUnary = topLevelUnary;\n                    var lastUnary = currentUnary;\n                    while (currentUnary != null &&\n                           SameOperators(currentUnary, topLevelUnary))\n                    {\n                        lastUnary = currentUnary;\n                        repeatedCount++;\n                        currentUnary = GetOperand(currentUnary) as TSyntaxNode;\n                    }\n\n                    if (repeatedCount < 2)\n                    {\n                        return;\n                    }\n\n                    c.ReportIssue(Rule, topLevelUnary.CreateLocation(GetOperatorToken(lastUnary)), GetOperatorToken(topLevelUnary).ValueText);\n                }, SyntaxKinds.ToArray());\n        }\n\n        private bool TopLevelUnaryInChain(TSyntaxNode unary) =>\n            !(unary.Parent is TSyntaxNode parent) || !SameOperators(parent, unary);\n\n        protected abstract SyntaxNode GetOperand(TSyntaxNode unarySyntax);\n\n        protected abstract SyntaxToken GetOperatorToken(TSyntaxNode unarySyntax);\n\n        protected abstract bool SameOperators(TSyntaxNode expression1, TSyntaxNode expression2);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/UnconditionalJumpStatementBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class UnconditionalJumpStatementBase<TStatementSyntax, TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n        where TStatementSyntax : SyntaxNode\n        where TSyntaxKind : struct\n    {\n        protected const string DiagnosticId = \"S1751\";\n\n        protected abstract ISet<TSyntaxKind> LoopStatements { get; }\n\n        protected abstract LoopWalkerBase<TStatementSyntax, TSyntaxKind> GetWalker(SonarSyntaxNodeReportingContext context);\n\n        protected override string MessageFormat => \"Refactor the containing loop to do more than one iteration.\";\n\n        protected UnconditionalJumpStatementBase() : base(DiagnosticId) { }\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(Language.GeneratedCodeRecognizer,\n                c =>\n                {\n                    var walker = GetWalker(c);\n                    walker.Visit();\n                    foreach (var node in walker.GetRuleViolations())\n                    {\n                        c.ReportIssue(Rule, node);\n                    }\n                },\n                LoopStatements.ToArray());\n    }\n\n    public abstract class LoopWalkerBase<TStatementSyntax, TLanguageKindEnum>\n        where TStatementSyntax : SyntaxNode\n        where TLanguageKindEnum : struct\n    {\n        protected readonly SyntaxNode rootExpression;\n        protected readonly SemanticModel semanticModel;\n\n        private readonly ISet<TLanguageKindEnum> ignoredSyntaxesKind;\n\n        protected abstract ILanguageFacade<TLanguageKindEnum> Language { get; }\n        protected abstract ISet<TLanguageKindEnum> ConditionalStatements { get; }\n        protected abstract ISet<TLanguageKindEnum> StatementsThatCanThrow { get; }\n        protected abstract ISet<TLanguageKindEnum> LambdaSyntaxes { get; }\n        protected abstract ISet<TLanguageKindEnum> LocalFunctionSyntaxes { get; }\n\n        public abstract void Visit();\n        protected abstract bool TryGetTryAncestorStatements(TStatementSyntax node, List<SyntaxNode> ancestors, out IEnumerable<TStatementSyntax> tryAncestorStatements);\n        protected abstract bool IsPropertyAccess(TStatementSyntax node);\n\n        protected List<TStatementSyntax> ConditionalContinues { get; } = new List<TStatementSyntax>();\n        protected List<TStatementSyntax> ConditionalTerminates { get; } = new List<TStatementSyntax>();\n\n        protected List<TStatementSyntax> UnconditionalContinues { get; } = new List<TStatementSyntax>();\n        protected List<TStatementSyntax> UnconditionalTerminates { get; } = new List<TStatementSyntax>();\n\n        protected LoopWalkerBase(SonarSyntaxNodeReportingContext context, ISet<TLanguageKindEnum> loopStatements)\n        {\n            rootExpression = context.Node;\n            semanticModel = context.Model;\n            ignoredSyntaxesKind = LambdaSyntaxes.Union(LocalFunctionSyntaxes).Union(loopStatements).ToHashSet();\n        }\n\n        public List<TStatementSyntax> GetRuleViolations()\n        {\n            var ruleViolations = new List<TStatementSyntax>(UnconditionalContinues);\n            if (!ConditionalContinues.Any())\n            {\n                ruleViolations.AddRange(UnconditionalTerminates);\n            }\n\n            return ruleViolations;\n        }\n\n        protected void StoreVisitData(TStatementSyntax node, List<TStatementSyntax> conditionalCollection, List<TStatementSyntax> unconditionalCollection)\n        {\n            var ancestors = node\n                .Ancestors()\n                .TakeWhile(n => !rootExpression.Equals(n))\n                .ToList();\n\n            if (ancestors.Any(n => Language.Syntax.IsAnyKind(n, ignoredSyntaxesKind)))\n            {\n                return;\n            }\n\n            if (ancestors.Any(n => Language.Syntax.IsAnyKind(n, ConditionalStatements))\n                || IsInTryCatchWithStatementThatCanThrow(node, ancestors))\n            {\n                conditionalCollection.Add(node);\n            }\n            else\n            {\n                unconditionalCollection.Add(node);\n            }\n        }\n\n        private bool IsInTryCatchWithStatementThatCanThrow(TStatementSyntax node, List<SyntaxNode> ancestors)\n        {\n            if (!TryGetTryAncestorStatements(node, ancestors, out var tryAncestorStatements))\n            {\n                return false;\n            }\n\n            if (Language.Syntax.IsKind(node, Language.SyntaxKind.ReturnStatement)\n                && (node.DescendantNodes().Any(n => Language.Syntax.IsAnyKind(n, StatementsThatCanThrow))\n                    || IsPropertyAccess(node)))\n            {\n                return true;\n            }\n\n            return tryAncestorStatements\n                .TakeWhile(statement => !statement.Equals(node))\n                .SelectMany(statement => statement.DescendantNodes())\n                .Any(statement => Language.Syntax.IsAnyKind(statement, StatementsThatCanThrow));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/UnnecessaryBitwiseOperationBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class UnnecessaryBitwiseOperationBase : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S2437\";\n        internal const string IsReportingOnLeftKey = \"IsReportingOnLeft\";\n        private const string MessageFormat = \"Remove this unnecessary bit operation.\";\n\n        protected abstract ILanguageFacade Language { get; }\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n        protected DiagnosticDescriptor Rule { get; }\n\n        protected UnnecessaryBitwiseOperationBase() =>\n            Rule = Language.CreateDescriptor(DiagnosticId, MessageFormat, fadeOutCode: true);\n\n        protected void CheckBinary(SonarSyntaxNodeReportingContext context, SyntaxNode left, SyntaxToken @operator, SyntaxNode right, int constValueToLookFor)\n        {\n            Location location;\n            bool isReportingOnLeftKey;\n            if (FindIntConstant(context.Model, left) is { } valueLeft && valueLeft == constValueToLookFor)\n            {\n                location = left.CreateLocation(@operator);\n                isReportingOnLeftKey = true;\n            }\n            else if (FindIntConstant(context.Model, right) is { } valueRight && valueRight == constValueToLookFor)\n            {\n                location = @operator.CreateLocation(right);\n                isReportingOnLeftKey = false;\n            }\n            else\n            {\n                return;\n            }\n\n            context.ReportIssue(Rule, location, ImmutableDictionary<string, string>.Empty.Add(IsReportingOnLeftKey, isReportingOnLeftKey.ToString()));\n        }\n\n        protected int? FindIntConstant(SemanticModel semanticModel, SyntaxNode node) =>\n            semanticModel.GetSymbolInfo(node).Symbol is var symbol\n            && !IsFieldOrPropertyOutsideSystemNamespace(symbol)\n            && !symbol.GetSymbolType().IsEnum()\n            && Language.FindConstantValue(semanticModel, node) is { } value\n                ? Conversions.ToInt(value)\n                : null;\n\n        private static bool IsFieldOrPropertyOutsideSystemNamespace(ISymbol symbol) =>\n            symbol is { Kind: SymbolKind.Field or SymbolKind.Property }\n            && symbol.ContainingNamespace.Name != nameof(System);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/UnnecessaryBitwiseOperationCodeFixBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class UnnecessaryBitwiseOperationCodeFixBase : SonarCodeFix\n    {\n        internal const string Title = \"Remove bitwise operation\";\n\n        protected abstract Func<SyntaxNode> CreateNewRoot(SyntaxNode root, TextSpan diagnosticSpan, bool isReportingOnLeft);\n\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(UnnecessaryBitwiseOperationBase.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var isReportingOnLeft = diagnostic.Properties.ContainsKey(UnnecessaryBitwiseOperationBase.IsReportingOnLeftKey)\n                && bool.Parse(diagnostic.Properties[UnnecessaryBitwiseOperationBase.IsReportingOnLeftKey]);\n            if (CreateNewRoot(root, diagnostic.Location.SourceSpan, isReportingOnLeft) is { }  createNewRoot)\n            {\n                context.RegisterCodeFix(Title, c => Task.FromResult(context.Document.WithSyntaxRoot(createNewRoot())), context.Diagnostics);\n            }\n            return Task.CompletedTask;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/UnusedStringBuilderBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class UnusedStringBuilderBase<TSyntaxKind, TVariableDeclarator, TIdentifierName> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n    where TVariableDeclarator : SyntaxNode\n    where TIdentifierName : SyntaxNode\n{\n    private const string DiagnosticId = \"S3063\";\n\n    private readonly string[] stringBuilderAccessInvocations = [\"ToString\", \"CopyTo\", \"GetChunks\"];\n    private readonly string[] stringBuilderAccessExpressions = [\"Length\"];\n    protected abstract SyntaxNode Scope(TVariableDeclarator declarator);\n    protected abstract ILocalSymbol RetrieveStringBuilderObject(SemanticModel model, TVariableDeclarator declaration);\n    protected abstract SyntaxNode StringBuilderReadExpression(SemanticModel model, SyntaxNode node);\n    protected abstract bool DescendIntoChildren(SyntaxNode node);\n\n    protected override string MessageFormat => \"\"\"Remove this \"StringBuilder\"; \".ToString()\" is never called.\"\"\";\n\n    protected UnusedStringBuilderBase() : base(DiagnosticId) { }\n\n    internal bool IsAccessInvocation(string invocation) =>\n        stringBuilderAccessInvocations.Any(x => x.Equals(invocation, Language.NameComparison));\n\n    internal bool IsAccessExpression(string expression) =>\n        stringBuilderAccessExpressions.Any(x => x.Equals(expression, Language.NameComparison));\n\n    protected sealed override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            Language.GeneratedCodeRecognizer,\n            c =>\n            {\n                var variableDeclarator = (TVariableDeclarator)c.Node;\n\n                if (RetrieveStringBuilderObject(c.Model, variableDeclarator) is { } symbol\n                    && Scope(variableDeclarator) is { } scope\n                    && !IsStringBuilderAccessed(c.Model, symbol, scope))\n                {\n                    c.ReportIssue(Rule, variableDeclarator);\n                }\n            },\n            Language.SyntaxKind.VariableDeclarator);\n\n    private bool IsSameVariable(SemanticModel model, ILocalSymbol symbol, SyntaxNode identifier) =>\n        Language.GetName(identifier).Equals(symbol.Name, Language.NameComparison) && symbol.Equals(model.GetSymbolInfo(identifier).Symbol);\n\n    private static IEnumerable<TIdentifierName> LocalReferences(SyntaxNode node) =>\n        node.DescendantNodesAndSelf().OfType<TIdentifierName>();\n\n    private bool IsStringBuilderAccessed(SemanticModel model, ILocalSymbol symbol, SyntaxNode scope) =>\n        scope.DescendantNodes(DescendIntoChildren).Any(x => StringBuilderReadExpression(model, x) is { } expression && LocalReferences(expression).Any(x => IsSameVariable(model, symbol, x)));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/UriShouldNotBeHardcodedBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text.RegularExpressions;\nusing SonarAnalyzer.CFG.Extensions;\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class UriShouldNotBeHardcodedBase<TSyntaxKind, TLiteralExpressionSyntax, TArgumentSyntax> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n    where TLiteralExpressionSyntax : SyntaxNode\n    where TArgumentSyntax : SyntaxNode\n{\n    protected const string DiagnosticId = \"S1075\";\n\n    protected const string AbsoluteUriMessage = \"Refactor your code not to use hardcoded absolute paths or URIs.\";\n    protected const string PathDelimiterMessage = \"Remove this hardcoded path-delimiter.\";\n\n    // Simplified implementation of specification listed on\n    // https://en.wikipedia.org/wiki/Uniform_Resource_Identifier\n    private const string UriScheme = \"^[a-zA-Z][a-zA-Z\\\\+\\\\.\\\\-]+://.+\";\n\n    private const string AbsoluteDiskUri = @\"^[A-Za-z]:(/|\\\\)\";\n    private const string AbsoluteMappedDiskUri = @\"^\\\\\\\\\\w[ \\w\\.]*\";\n\n    protected static readonly Regex UriRegex = new($\"{UriScheme}|{AbsoluteDiskUri}|{AbsoluteMappedDiskUri}\", RegexOptions.Compiled, Constants.DefaultRegexTimeout);\n    protected static readonly Regex PathDelimiterRegex = new(@\"^(\\\\|/)$\", RegexOptions.Compiled, Constants.DefaultRegexTimeout);\n\n    protected static readonly ISet<string> CheckedVariableNames =\n        new HashSet<string>\n        {\n            \"FILE\",\n            \"FILES\",\n            \"PATH\",\n            \"PATHS\",\n            \"URI\",\n            \"URIS\",\n            \"URL\",\n            \"URLS\",\n            \"URN\",\n            \"URNS\",\n            \"STREAM\",\n            \"STREAMS\"\n        };\n\n    protected abstract GeneratedCodeRecognizer GeneratedCodeRecognizer { get; }\n    protected abstract TSyntaxKind[] StringConcatenateExpressions { get; }\n    protected abstract TSyntaxKind[] InvocationOrObjectCreationKind { get; }\n\n    protected abstract SyntaxNode GetRelevantAncestor(SyntaxNode node);\n\n    protected override string MessageFormat => \"{0}\";\n\n    protected UriShouldNotBeHardcodedBase() : base(DiagnosticId) { }\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(\n            GeneratedCodeRecognizer,\n            c =>\n            {\n                if (UriRegex.SafeIsMatch(Language.Syntax.LiteralText(c.Node)) && IsInCheckedContext(c.Node, c.Model))\n                {\n                    c.ReportIssue(SupportedDiagnostics[0], c.Node, AbsoluteUriMessage);\n                }\n            },\n            Language.SyntaxKind.StringLiteralExpressions);\n\n        context.RegisterNodeAction(\n            GeneratedCodeRecognizer,\n            c =>\n            {\n                var isInCheckedContext = new Lazy<bool>(() => IsInCheckedContext(c.Node, c.Model));\n\n                var leftNode = Language.Syntax.BinaryExpressionLeft(c.Node);\n                if (IsPathDelimiter(leftNode) && isInCheckedContext.Value)\n                {\n                    c.ReportIssue(SupportedDiagnostics[0], leftNode, PathDelimiterMessage);\n                }\n\n                var rightNode = Language.Syntax.BinaryExpressionRight(c.Node);\n                if (IsPathDelimiter(rightNode) && isInCheckedContext.Value)\n                {\n                    c.ReportIssue(SupportedDiagnostics[0], rightNode, PathDelimiterMessage);\n                }\n            },\n            StringConcatenateExpressions);\n    }\n\n    private bool IsInCheckedContext(SyntaxNode expression, SemanticModel model)\n    {\n        var argument = expression.FirstAncestorOrSelf<TArgumentSyntax>();\n        if (argument is not null)\n        {\n            var argumentIndex = Language.Syntax.ArgumentIndex(argument);\n            if (argumentIndex is null or < 0)\n            {\n                return false;\n            }\n\n            var constructorOrMethod = argument.Ancestors().FirstOrDefault(x => Language.Syntax.IsAnyKind(x, InvocationOrObjectCreationKind));\n            var methodSymbol = constructorOrMethod is not null\n                ? model.GetSymbolInfo(constructorOrMethod).Symbol as IMethodSymbol\n                : null;\n\n            return methodSymbol is not null\n                && argumentIndex.Value < methodSymbol.Parameters.Length\n                && methodSymbol.Parameters[argumentIndex.Value].Name.SplitCamelCaseToWords().Any(CheckedVariableNames.Contains);\n        }\n\n        return GetRelevantAncestor(expression) is { } relevantAncestor && Language.GetName(relevantAncestor).SplitCamelCaseToWords().Any(CheckedVariableNames.Contains);\n    }\n\n    private bool IsPathDelimiter(SyntaxNode expression) =>\n        expression is TLiteralExpressionSyntax && PathDelimiterRegex.SafeIsMatch(Language.Syntax.LiteralText(expression));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/UseCharOverloadOfStringMethodsBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class UseCharOverloadOfStringMethodsBase<TSyntaxKind, TInvocation> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n    where TInvocation : SyntaxNode\n{\n    internal const string DiagnosticId = \"S6610\";\n\n    protected override string MessageFormat => \"\\\"{0}\\\" overloads that take a \\\"char\\\" should be used\";\n\n    protected abstract bool HasCorrectArguments(TInvocation invocation);\n\n    protected UseCharOverloadOfStringMethodsBase() : base(DiagnosticId) { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(start =>\n        {\n            if (!CompilationTargetsValidNetVersion(start.Compilation))\n            {\n                return;\n            }\n\n            start.RegisterNodeAction(Language.GeneratedCodeRecognizer, c =>\n            {\n                var invocation = (TInvocation)c.Node;\n                var methodName = Language.GetName(invocation);\n\n                if (HasCorrectName(methodName)\n                    && HasCorrectArguments(invocation)\n                    && Language.Syntax.Operands(invocation).Left is { } left\n                    && IsCorrectType(left, c.Model))\n                {\n                    c.ReportIssue(Rule, Language.Syntax.NodeIdentifier(invocation)?.GetLocation(), methodName);\n                }\n            }, Language.SyntaxKind.InvocationExpression);\n        });\n\n    // \"char\" overload introduced at .NET Core 2.0/.NET Standard 2.1\n    private static bool CompilationTargetsValidNetVersion(Compilation compilation)\n    {\n        var stringType = compilation.GetTypeByMetadataName(KnownType.System_String);\n        var methods = stringType.GetMembers(nameof(string.StartsWith)).Where(x => x is IMethodSymbol);\n        return methods.Any(x => ((IMethodSymbol)x).Parameters[0].IsType(KnownType.System_Char));\n    }\n\n    private bool HasCorrectName(string methodName) =>\n        methodName.Equals(nameof(string.StartsWith), Language.NameComparison)\n        || methodName.Equals(nameof(string.EndsWith), Language.NameComparison);\n\n    private static bool IsCorrectType(SyntaxNode left, SemanticModel model) =>\n        model.GetTypeInfo(left).Type.Is(KnownType.System_String);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/UseDateTimeOffsetInsteadOfDateTimeBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class UseDateTimeOffsetInsteadOfDateTimeBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n{\n    private const string DiagnosticId = \"S6566\";\n\n    protected override string MessageFormat => \"Prefer using \\\"DateTimeOffset\\\" instead of \\\"DateTime\\\"\";\n\n    private static readonly ImmutableArray<string> TargetMemberAccess = ImmutableArray.Create(\n            nameof(DateTime.MaxValue),\n            nameof(DateTime.MinValue),\n            nameof(DateTime.Now),\n            nameof(DateTime.Today),\n            nameof(DateTime.UtcNow),\n            \"UnixEpoch\");\n\n    protected abstract string[] ValidNames { get; }\n\n    protected UseDateTimeOffsetInsteadOfDateTimeBase() : base(DiagnosticId) { }\n\n    protected sealed override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(\n            Language.GeneratedCodeRecognizer,\n            c =>\n            {\n                if ((c.Node.RawKind == (int)SyntaxKindEx.ImplicitObjectCreationExpression || IsNamedDateTime(GetTypeName(c.Node)))\n                    && IsDateTimeType(c.Node, c.Model))\n                {\n                    c.ReportIssue(Rule, c.Node);\n                }\n            },\n            Language.SyntaxKind.ObjectCreationExpressions);\n\n        context.RegisterNodeAction(\n            Language.GeneratedCodeRecognizer,\n            c =>\n            {\n                if (Language.Syntax.NodeExpression(c.Node) is var expression\n                    && IsNamedDateTime(Language.GetName(expression))\n                    && TargetMemberAccess.Contains(Language.GetName(c.Node))\n                    && IsDateTimeType(expression, c.Model))\n                {\n                    c.ReportIssue(Rule, Language.Syntax.NodeExpression(c.Node));\n                }\n            },\n            Language.SyntaxKind.SimpleMemberAccessExpression);\n    }\n\n    private static bool IsDateTimeType(SyntaxNode node, SemanticModel model) =>\n        model.GetTypeInfo(node).Type.Is(KnownType.System_DateTime);\n\n    private bool IsNamedDateTime(string name) =>\n        Array.Exists(ValidNames, x => x.Equals(name, Language.NameComparison));\n\n    private string GetTypeName(SyntaxNode node) =>\n        Language.Syntax.ObjectCreationTypeIdentifier(node) is { IsMissing: false } identifier\n            ? identifier.ValueText\n            : string.Empty;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/UseFindSystemTimeZoneByIdBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class UseFindSystemTimeZoneByIdBase<TSyntaxKind, TInvocation> : DoNotCallMethodsBase<TSyntaxKind, TInvocation>\n    where TSyntaxKind : struct\n    where TInvocation : SyntaxNode\n{\n    private const string DiagnosticId = \"S6575\";\n\n    protected override string MessageFormat => \"Use \\\"TimeZoneInfo.FindSystemTimeZoneById\\\" directly instead of \\\"{0}\\\"\";\n\n    protected override IEnumerable<MemberDescriptor> CheckedMethods { get; } = new List<MemberDescriptor>\n        {\n            new(KnownType.TimeZoneConverter_TZConvert, \"IanaToWindows\"),\n            new(KnownType.TimeZoneConverter_TZConvert, \"WindowsToIana\"),\n            new(KnownType.TimeZoneConverter_TZConvert, \"TryIanaToWindows\"),\n            new(KnownType.TimeZoneConverter_TZConvert, \"TryWindowsToIana\"),\n        };\n\n    protected UseFindSystemTimeZoneByIdBase() : base(DiagnosticId) { }\n\n    protected override bool ShouldRegisterAction(Compilation compilation) =>\n        compilation.GetTypeByMetadataName(KnownType.System_TimeOnly) is not null\n        && compilation.GetTypeByMetadataName(KnownType.TimeZoneConverter_TZConvert) is not null;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/UseIFormatProviderForParsingDateAndTimeBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class UseIFormatProviderForParsingDateAndTimeBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n{\n    private const string DiagnosticId = \"S6580\";\n\n    private static readonly string[] ParseMethodNames = new[]\n    {\n        nameof(DateTime.Parse),\n        nameof(DateTime.ParseExact),\n        nameof(DateTime.TryParse),\n        nameof(DateTime.TryParseExact)\n    };\n    private static readonly KnownType[] TemporalTypes = new[]\n    {\n        KnownType.System_DateOnly,\n        KnownType.System_DateTime,\n        KnownType.System_DateTimeOffset,\n        KnownType.System_TimeOnly,\n        KnownType.System_TimeSpan\n    };\n\n    protected override string MessageFormat => \"Use a format provider when parsing date and time.\";\n\n    protected UseIFormatProviderForParsingDateAndTimeBase() : base(DiagnosticId) { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(Language.GeneratedCodeRecognizer, c =>\n        {\n            if (Language.Syntax.NodeIdentifier(c.Node) is { IsMissing: false } identifier\n                && Array.Exists(ParseMethodNames, x => identifier.ValueText.Equals(x, Language.NameComparison))\n                && c.Model.GetSymbolInfo(c.Node) is { Symbol: IMethodSymbol methodSymbol }\n                && TemporalTypes.Any(x => x.Matches(methodSymbol.ReceiverType))\n                && NotUsingFormatProvider(methodSymbol, c.Node))\n            {\n                c.ReportIssue(Rule, c.Node);\n            }\n        }, Language.SyntaxKind.InvocationExpression);\n\n    private bool NotUsingFormatProvider(IMethodSymbol methodSymbol, SyntaxNode node)\n    {\n        var parameterLookup = Language.MethodParameterLookup(node, methodSymbol);\n        return (!parameterLookup.TryGetSyntax(\"provider\", out var parameter)\n                && !parameterLookup.TryGetSyntax(\"formatProvider\", out parameter))\n               || Language.Syntax.IsNullLiteral(parameter[0]);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/UseIndexingInsteadOfLinqMethodsBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class UseIndexingInsteadOfLinqMethodsBase<TSyntaxKind, TInvocation> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n    where TInvocation : SyntaxNode\n{\n    private const string DiagnosticId = \"S6608\";\n    protected override string MessageFormat => \"{0} should be used instead of the \\\"Enumerable\\\" extension method \\\"{1}\\\"\";\n\n    private static readonly ImmutableArray<KnownType> TargetInterfaces = ImmutableArray.Create(\n        KnownType.System_Collections_IList,\n        KnownType.System_Collections_Generic_IList_T,\n        KnownType.System_Collections_Generic_IReadOnlyList_T);\n\n    protected abstract int GetArgumentCount(TInvocation invocation);\n\n    protected UseIndexingInsteadOfLinqMethodsBase() : base(DiagnosticId) { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(Language.GeneratedCodeRecognizer, c =>\n        {\n            var invocation = (TInvocation)c.Node;\n\n            if (HasValidSignature(invocation, out var methodName, out var indexDescriptor)\n                && Language.Syntax.Operands(invocation) is { Left: { } left, Right: { } right }\n                && IsCorrectType(left, c.Model)\n                && IsCorrectCall(right, c.Model))\n            {\n                c.ReportIssue(\n                    Rule,\n                    Language.Syntax.NodeIdentifier(invocation)?.GetLocation(),\n                    indexDescriptor is null ? \"Indexing\" : $\"Indexing at {indexDescriptor}\",\n                    methodName);\n            }\n        },\n        Language.SyntaxKind.InvocationExpression);\n\n    private bool HasValidSignature(TInvocation invocation, out string methodName, out string indexDescriptor)\n    {\n        methodName = Language.GetName(invocation);\n        indexDescriptor = null;\n\n        if (methodName.Equals(nameof(Enumerable.First), Language.NameComparison))\n        {\n            indexDescriptor = \"0\";\n            return GetArgumentCount(invocation) == 0;\n        }\n        if (methodName.Equals(nameof(Enumerable.Last), Language.NameComparison))\n        {\n            indexDescriptor = \"Count-1\";\n            return GetArgumentCount(invocation) == 0;\n        }\n        if (methodName.Equals(nameof(Enumerable.ElementAt), Language.NameComparison))\n        {\n            return GetArgumentCount(invocation) == 1;\n        }\n\n        return false;\n    }\n\n    protected static bool IsCorrectType(SyntaxNode left, SemanticModel model) =>\n        model.GetTypeInfo(left).Type is { } type\n        && (type.ImplementsAny(TargetInterfaces) || type.IsAny(TargetInterfaces));\n\n    protected static bool IsCorrectCall(SyntaxNode right, SemanticModel model) =>\n        model.GetSymbolInfo(right).Symbol is IMethodSymbol method\n        && method.IsExtensionOn(KnownType.System_Collections_Generic_IEnumerable_T);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/UseLambdaParameterInConcurrentDictionaryBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class UseLambdaParameterInConcurrentDictionaryBase<TSyntaxKind, TInvocationExpression, TArgumentSyntax> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n    where TInvocationExpression : SyntaxNode\n    where TArgumentSyntax : SyntaxNode\n{\n    private const string DiagnosticId = \"S6612\";\n\n    protected override string MessageFormat => \"Use the lambda parameter instead of capturing the argument '{0}'\";\n\n    protected abstract SeparatedSyntaxList<TArgumentSyntax> GetArguments(TInvocationExpression invocation);\n    protected abstract bool TryGetKeyName(TArgumentSyntax argument, out string keyName);\n    protected abstract bool IsLambdaAndContainsIdentifier(TArgumentSyntax argument, string keyName);\n\n    protected UseLambdaParameterInConcurrentDictionaryBase() : base(DiagnosticId) { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(Language.GeneratedCodeRecognizer, c =>\n        {\n            var invocation = (TInvocationExpression)c.Node;\n\n            if (HasCorrectName(Language.GetName(invocation))\n                && Language.Syntax.Operands(invocation) is { Left: { } left, Right: { } right }\n                && IsCorrectType(left, c.Model)\n                && IsCorrectCall(right, c.Model)\n                && GetArguments(invocation) is { Count: > 1 } arguments\n                && TryGetKeyName(arguments[0], out var keyName))\n            {\n                for (var i = 1; i < arguments.Count; i++)\n                {\n                    if (IsLambdaAndContainsIdentifier(arguments[i], keyName))\n                    {\n                        c.ReportIssue(Rule, arguments[i], keyName);\n                    }\n                }\n            }\n        }, Language.SyntaxKind.InvocationExpression);\n\n    private bool HasCorrectName(string methodName) =>\n        methodName.Equals(\"GetOrAdd\", Language.NameComparison)\n        || methodName.Equals(\"AddOrUpdate\", Language.NameComparison);\n\n    private static bool IsCorrectType(SyntaxNode left, SemanticModel model) =>\n        model.GetTypeInfo(left).Type.DerivesFrom(KnownType.System_Collections_Concurrent_ConcurrentDictionary_TKey_TValue);\n\n    private static bool IsCorrectCall(SyntaxNode right, SemanticModel model) =>\n        model.GetSymbolInfo(right).Symbol is IMethodSymbol method\n        && method.ContainingType.Is(KnownType.System_Collections_Concurrent_ConcurrentDictionary_TKey_TValue);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/UseShortCircuitingOperatorBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class UseShortCircuitingOperatorBase<TSyntaxKind, TBinaryExpression> : SonarDiagnosticAnalyzer<TSyntaxKind>\n        where TSyntaxKind : struct\n        where TBinaryExpression : SyntaxNode\n    {\n        internal const string DiagnosticId = \"S2178\";\n\n        protected abstract string GetSuggestedOpName(TBinaryExpression node);\n        protected abstract string GetCurrentOpName(TBinaryExpression node);\n        protected abstract SyntaxToken GetOperator(TBinaryExpression expression);\n        protected abstract ImmutableArray<TSyntaxKind> SyntaxKindsOfInterest { get; }\n\n        protected override string MessageFormat => \"Correct this '{0}' to '{1}'{2}.\";\n\n        protected UseShortCircuitingOperatorBase() : base(DiagnosticId) { }\n\n        protected sealed override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(Language.GeneratedCodeRecognizer, c =>\n                {\n                    if (c.Node is TBinaryExpression node\n                        && Language.Syntax.BinaryExpressionLeft(node) is { } left\n                        && Language.Syntax.BinaryExpressionRight(node) is { } right\n                        && IsBool(left, c.Model)\n                        && IsBool(right, c.Model))\n                    {\n                        var extractText = c.Model.GetConstantValue(right) is { HasValue: true }\n                            || c.Model.GetSymbolInfo(right).Symbol is ILocalSymbol or IFieldSymbol or IPropertySymbol or IParameterSymbol\n                                ? string.Empty\n                                : \" and extract the right operand to a variable if it should always be evaluated\";\n                        c.ReportIssue(SupportedDiagnostics[0], GetOperator(node), GetCurrentOpName(node), GetSuggestedOpName(node), extractText);\n                    }\n                },\n                SyntaxKindsOfInterest.ToArray());\n\n        private static bool IsBool(SyntaxNode node, SemanticModel semanticModel) =>\n            semanticModel.GetTypeInfo(node).Type.Is(KnownType.System_Boolean);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/UseShortCircuitingOperatorCodeFixBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class UseShortCircuitingOperatorCodeFixBase<TSyntaxKind, TBinaryExpression> : SonarCodeFix where TSyntaxKind : struct\n        where TBinaryExpression : SyntaxNode\n    {\n        internal const string Title = \"Use short-circuiting operators\";\n\n        public override ImmutableArray<string> FixableDiagnosticIds =>  ImmutableArray.Create(UseShortCircuitingOperatorBase<TSyntaxKind, TBinaryExpression>.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            if (root.FindNode(diagnosticSpan, getInnermostNodeForTie: true) is not TBinaryExpression expression ||\n                !IsCandidateExpression(expression))\n            {\n                return Task.CompletedTask;\n            }\n\n            context.RegisterCodeFix(\n                Title,\n                c => ReplaceExpressionAsync(expression, root, context.Document),\n                context.Diagnostics);\n\n            return Task.CompletedTask;\n        }\n\n        internal abstract bool IsCandidateExpression(TBinaryExpression expression);\n\n        private Task<Document> ReplaceExpressionAsync(TBinaryExpression expression,\n            SyntaxNode root, Document document)\n        {\n            var replacement = GetShortCircuitingExpressionNode(expression)\n                .WithTriviaFrom(expression);\n            var newRoot = root.ReplaceNode(expression, replacement);\n            return Task.FromResult(document.WithSyntaxRoot(newRoot));\n        }\n\n        protected abstract TBinaryExpression GetShortCircuitingExpressionNode(TBinaryExpression expression);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/UseTestableTimeProviderBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class UseTestableTimeProviderBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n     where TSyntaxKind : struct\n{\n    private const string DiagnosticId = \"S6354\";\n\n    protected override string MessageFormat => \"Use a testable (date) time provider instead.\";\n\n    private readonly ImmutableArray<KnownType> trackedTypes = ImmutableArray.Create(KnownType.System_DateTime, KnownType.System_DateTimeOffset);\n\n    protected abstract bool Ignore(SyntaxNode ancestor, SemanticModel semanticModel);\n\n    protected UseTestableTimeProviderBase() : base(DiagnosticId) { }\n    protected sealed override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(Language.GeneratedCodeRecognizer, c =>\n        {\n            if (IsDateTimeProviderProperty(Language.Syntax.NodeIdentifier(c.Node).Value.Text)\n                && c.Model.GetSymbolInfo(c.Node).Symbol is IPropertySymbol property\n                && property.IsInType(trackedTypes)\n                && !c.Node.Ancestors().Any(x => Ignore(x, c.Model)))\n            {\n                c.ReportIssue(Rule, c.Node.Parent);\n            }\n        },\n        Language.SyntaxKind.IdentifierName);\n\n    private bool IsDateTimeProviderProperty(string name) =>\n        nameof(DateTime.Now).Equals(name, Language.NameComparison)\n        || nameof(DateTime.UtcNow).Equals(name, Language.NameComparison)\n        || nameof(DateTime.Today).Equals(name, Language.NameComparison);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/UseTrueForAllBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class UseTrueForAllBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind> where TSyntaxKind : struct\n{\n    private const string DiagnosticId = \"S6603\";\n\n    protected override string MessageFormat => \"The collection-specific \\\"TrueForAll\\\" method should be used instead of the \\\"All\\\" extension\";\n\n    private static readonly ImmutableArray<KnownType> TargetTypes = ImmutableArray.Create(\n        KnownType.System_Array,\n        KnownType.System_Collections_Generic_List_T,\n        KnownType.System_Collections_Immutable_ImmutableList_T);\n\n    protected UseTrueForAllBase() : base(DiagnosticId) { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(Language.GeneratedCodeRecognizer, c =>\n        {\n            if (Language.GetName(c.Node).Equals(nameof(Enumerable.All), Language.NameComparison)\n                && Language.Syntax.Operands(c.Node) is { Left: { } left, Right: { } right }\n                && IsCorrectType(left, c.Model)\n                && IsCorrectCall(right, c.Model))\n            {\n                c.ReportIssue(Rule, Language.Syntax.NodeIdentifier(c.Node)?.GetLocation());\n            }\n        },\n        Language.SyntaxKind.InvocationExpression);\n\n    protected static bool IsCorrectType(SyntaxNode left, SemanticModel model) =>\n        model.GetTypeInfo(left).Type.DerivesFromAny(TargetTypes);\n\n    protected static bool IsCorrectCall(SyntaxNode right, SemanticModel model) =>\n        model.GetSymbolInfo(right).Symbol is IMethodSymbol method\n        && method.IsExtensionOn(KnownType.System_Collections_Generic_IEnumerable_T);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/UseUnixEpochBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class UseUnixEpochBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n{\n    internal const string DiagnosticId = \"S6588\";\n\n    protected UseUnixEpochBase() : base(DiagnosticId) { }\n}\n\npublic abstract class UseUnixEpochBase<TSyntaxKind, TLiteralExpression, TMemberAccessExpression> : UseUnixEpochBase<TSyntaxKind>\n    where TSyntaxKind : struct\n    where TLiteralExpression : SyntaxNode\n    where TMemberAccessExpression : SyntaxNode\n{\n    private const long EpochTicks = 621_355_968_000_000_000;\n    private const int EpochYear = 1970;\n    private const int EpochMonth = 1;\n    private const int EpochDay = 1;\n\n    private static readonly ImmutableArray<KnownType> TypesWithUnixEpochField = ImmutableArray.Create(KnownType.System_DateTime, KnownType.System_DateTimeOffset);\n\n    protected override string MessageFormat => \"Use \\\"{0}.UnixEpoch\\\" instead of creating {0} instances that point to the unix epoch time\";\n\n    protected abstract bool IsDateTimeKindUtc(TMemberAccessExpression memberAccess);\n    protected abstract bool IsGregorianCalendar(SyntaxNode node);\n    protected abstract bool IsZeroTimeOffset(SyntaxNode node);\n\n    protected sealed override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(c =>\n        {\n            if (!IsUnixEpochSupported(c.Compilation))\n            {\n                return;\n            }\n\n            c.RegisterNodeAction(\n                Language.GeneratedCodeRecognizer,\n                cc =>\n                {\n                    var arguments = Language.Syntax.ArgumentExpressions(cc.Node);\n                    var literalsArguments = arguments.OfType<TLiteralExpression>();\n\n                    if (literalsArguments.Any(x => IsValueEqualTo(x, EpochYear)\n                        && literalsArguments.Count(x => IsValueEqualTo(x, EpochMonth)) == 2)\n                        && CheckAndGetTypeName(cc.Node, cc.Model) is { } name\n                        && IsEpochCtor(cc.Node, cc.Model))\n                    {\n                        cc.ReportIssue(Rule, cc.Node, name);\n                    }\n                    else if (arguments.Count() == 1\n                        && ((literalsArguments.Count() == 1  && IsValueEqualTo(literalsArguments.First(), EpochTicks))\n                            || (Language.FindConstantValue(cc.Model, arguments.First()) is long ticks && ticks == EpochTicks))\n                        && CheckAndGetTypeName(cc.Node, cc.Model) is { } typeName)\n                    {\n                        cc.ReportIssue(Rule, cc.Node, typeName);\n                    }\n                },\n                Language.SyntaxKind.ObjectCreationExpressions);\n        });\n\n    protected static bool IsValueEqualTo(TLiteralExpression literal, long value) =>\n        long.TryParse(literal.ChildTokens().First().ValueText, out var parsedValue) && parsedValue == value;\n\n    private bool IsEpochCtor(SyntaxNode node, SemanticModel model)\n    {\n        var methodSymbol = (IMethodSymbol)model.GetSymbolInfo(node).Symbol;\n        var lookup = Language.MethodParameterLookup(node, methodSymbol);\n\n        return IsParameterExistingAndLiteralEqualTo(\"year\", EpochYear, lookup)\n            && IsParameterExistingAndLiteralEqualTo(\"month\", EpochMonth, lookup)\n            && IsParameterExistingAndLiteralEqualTo(\"day\", EpochDay, lookup)\n            && IsParameterNonExistingOrLiteralEqualTo(\"hour\", 0, lookup)\n            && IsParameterNonExistingOrLiteralEqualTo(\"minute\", 0, lookup)\n            && IsParameterNonExistingOrLiteralEqualTo(\"second\", 0, lookup)\n            && IsParameterNonExistingOrLiteralEqualTo(\"millisecond\", 0, lookup)\n            && IsParameterNonExistingOrLiteralEqualTo(\"microsecond\", 0, lookup)\n            && IsDateTimeKindNonExistingOrUtc(lookup)\n            && IsCalendarNonExistingOrGregorian(lookup)\n            && IsOffsetNonExistingOrZero(lookup);\n    }\n\n    private static bool IsParameterExistingAndLiteralEqualTo(string parameterName, int value, IMethodParameterLookup lookup) =>\n        lookup.TryGetSyntax(parameterName, out var expressions) && IsLiteralAndEqualTo(expressions[0], value);\n\n    private static bool IsParameterNonExistingOrLiteralEqualTo(string parameterName, int value, IMethodParameterLookup lookup) =>\n        !lookup.TryGetSyntax(parameterName, out var expressions) || IsLiteralAndEqualTo(expressions[0], value);\n\n    private static bool IsLiteralAndEqualTo(SyntaxNode node, int value) =>\n        node is TLiteralExpression literal && IsValueEqualTo(literal, value);\n\n    private static string CheckAndGetTypeName(SyntaxNode node, SemanticModel model) =>\n        model.GetTypeInfo(node).Type is var type && type.IsAny(TypesWithUnixEpochField) ? type.Name : null;\n\n    private bool IsDateTimeKindNonExistingOrUtc(IMethodParameterLookup lookup) =>\n        !lookup.TryGetSyntax(\"kind\", out var expressions)\n        || (expressions[0] is TMemberAccessExpression memberAccess && IsDateTimeKindUtc(memberAccess));\n\n    private bool IsCalendarNonExistingOrGregorian(IMethodParameterLookup lookup) =>\n        !lookup.TryGetSyntax(\"calendar\", out var expressions) || IsGregorianCalendar(expressions[0]);\n\n    private bool IsOffsetNonExistingOrZero(IMethodParameterLookup lookup) =>\n        !lookup.TryGetSyntax(\"offset\", out var expressions) || IsZeroTimeOffset(expressions[0]);\n\n    // DateTime.UnixEpoch introduced at .NET Core 2.1/.NET Standard 2.1\n    private static bool IsUnixEpochSupported(Compilation compilation) =>\n        compilation.GetTypeByMetadataName(KnownType.System_DateTime) is var dateType && dateType.GetMembers(\"UnixEpoch\").Any();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/UseUnixEpochCodeFixBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class UseUnixEpochCodeFixBase<TSyntaxKind> : SonarCodeFix\n        where TSyntaxKind : struct\n    {\n        internal const string Title = \"Use UnixEpoch field\";\n\n        protected abstract SyntaxNode ReplaceConstructorWithField(SyntaxNode root, SyntaxNode node, SonarCodeFixContext context);\n\n        public override ImmutableArray<string> FixableDiagnosticIds =>\n            ImmutableArray.Create(UseUnixEpochBase<TSyntaxKind>.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            var node = root.FindNode(diagnosticSpan, getInnermostNodeForTie: true);\n\n            context.RegisterCodeFix(\n                Title,\n                _ =>\n                {\n                    var newRoot = ReplaceConstructorWithField(root, node, context);\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n\n            return Task.CompletedTask;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/UseWhereBeforeOrderByBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class UseWhereBeforeOrderByBase<TSyntaxKind, TInvocation> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n    where TInvocation : SyntaxNode\n{\n    private const string DiagnosticId = \"S6607\";\n    private const string SecondaryMessage = \"\"\"This \"{0}\" precedes a \"Where\" - you should change the order.\"\"\";\n\n    protected override string MessageFormat => \"\\\"Where\\\" should be used before \\\"{0}\\\"\";\n\n    protected UseWhereBeforeOrderByBase() : base(DiagnosticId) { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(Language.GeneratedCodeRecognizer, c =>\n        {\n            var invocation = (TInvocation)c.Node;\n\n            if (Language.GetName(invocation).Equals(\"Where\", Language.NameComparison)\n                && Language.Syntax.Operands(invocation) is { Left: { } left, Right: { } right }\n                && LeftHasCorrectName(left, out var orderByMethodDescription)\n                && MethodIsLinqExtension(left, c.Model)\n                && MethodIsLinqExtension(right, c.Model)\n                && Language.Syntax.NodeIdentifier(right) is { } rightIdentifier\n                && Language.Syntax.NodeIdentifier(left) is { } leftIdentifier)\n            {\n                c.ReportIssue(Rule, rightIdentifier.GetLocation(), [leftIdentifier.ToSecondaryLocation(SecondaryMessage, orderByMethodDescription)], orderByMethodDescription);\n            }\n        },\n        Language.SyntaxKind.InvocationExpression);\n\n    private bool LeftHasCorrectName(SyntaxNode left, out string methodName)\n    {\n        var leftName = Language.GetName(left);\n        if (leftName.Equals(\"OrderBy\", Language.NameComparison)\n            || leftName.Equals(\"OrderByDescending\", Language.NameComparison))\n        {\n            methodName = leftName;\n            return true;\n        }\n        methodName = null;\n        return false;\n    }\n\n    private static bool MethodIsLinqExtension(SyntaxNode node, SemanticModel model) =>\n        model.GetSymbolInfo(node).Symbol is IMethodSymbol method\n        && method.IsExtensionOn(KnownType.System_Collections_Generic_IEnumerable_T);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/Utilities/AnalysisWarningAnalyzerBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\nusing SonarAnalyzer.CFG.Common;\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class AnalysisWarningAnalyzerBase : UtilityAnalyzerBase\n{\n    private const string DiagnosticId = \"S9999-warning\";\n    private const string Title = \"Analysis Warning generator\";\n\n    protected virtual int VS2017MajorVersion => RoslynVersion.VS2017MajorVersion; // For testing\n    protected virtual int MinimalSupportedRoslynVersion => RoslynVersion.MinimalSupportedMajorVersion; // For testing\n\n    protected AnalysisWarningAnalyzerBase() : base(DiagnosticId, Title) { }\n\n    protected sealed override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationAction(c =>\n            {\n                var parameter = ReadParameters(c);\n                if (!parameter.IsAnalyzerEnabled || parameter.OutPath is null)\n                {\n                    return;\n                }\n\n                var path = Path.GetFullPath(Path.Combine(parameter.OutPath, \"../../AnalysisWarnings.MsBuild.json\"));\n                if (!File.Exists(path))\n                {\n                    // This can be removed after we bump Microsoft.CodeAnalysis references to 2.0 or higher. MsBuild 14 is bound with Roslyn 1.x.\n                    if (RoslynVersion.IsVersionLessThan(VS2017MajorVersion))\n                    {\n                        WriteAllText(path, \"The analysis using MsBuild 14 is no longer supported and the analysis with MsBuild 15 is deprecated. Please update your pipeline to MsBuild 16 or higher.\");\n                    }\n                    // This can be removed after we bump Microsoft.CodeAnalysis references to 3.0 or higher. MsBuild 15 is bound with Roslyn 2.x.\n                    else if (RoslynVersion.IsVersionLessThan(MinimalSupportedRoslynVersion))\n                    {\n                        WriteAllText(path, \"The analysis using MsBuild 15 is deprecated. Please update your pipeline to MsBuild 16 or higher.\");\n                    }\n                }\n            });\n\n    private static void WriteAllText(string path, string text)\n    {\n        try\n        {\n            File.WriteAllText(path, $$\"\"\"[{\"text\": \"{{text}}\"}]\"\"\");\n        }\n        catch\n        {\n            // Nothing to do here. Two compilations running on two different processes are unlikely to lock each other out on a small file write.\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/Utilities/CopyPasteTokenAnalyzerBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Protobuf;\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class CopyPasteTokenAnalyzerBase<TSyntaxKind> : UtilityAnalyzerBase<TSyntaxKind, CopyPasteTokenInfo>\n        where TSyntaxKind : struct\n    {\n        private const string DiagnosticId = \"S9999-cpd\";\n        private const string Title = \"Copy-paste token calculator\";\n\n        protected abstract string GetCpdValue(SyntaxToken token);\n        protected abstract bool IsUsingDirective(SyntaxNode node);\n        protected override UtilityAnalyzerParameters ReadParameters(IAnalysisContext context) =>\n            base.ReadParameters(context) with { AnalyzeTestProjects = false };\n\n        protected sealed override bool AnalyzeUnchangedFiles => true;\n        protected sealed override string FileName => \"token-cpd.pb\";\n\n        protected CopyPasteTokenAnalyzerBase() : base(DiagnosticId, Title) { }\n\n        protected sealed override bool ShouldGenerateMetrics(UtilityAnalyzerParameters parameters, SyntaxTree tree) =>\n            !GeneratedCodeRecognizer.IsRazorGeneratedFile(tree)\n            && base.ShouldGenerateMetrics(parameters, tree);\n\n        protected sealed override CopyPasteTokenInfo CreateMessage(UtilityAnalyzerParameters parameters, SyntaxTree tree, SemanticModel model)\n        {\n            var cpdTokenInfo = new CopyPasteTokenInfo { FilePath = tree.FilePath };\n            foreach (var token in tree.GetRoot().DescendantTokens(n => !IsUsingDirective(n)))\n            {\n                if (GetCpdValue(token) is var value && !string.IsNullOrWhiteSpace(value))\n                {\n                    cpdTokenInfo.TokenInfo.Add(new CopyPasteTokenInfo.Types.TokenInfo { TokenValue = value, TextRange = ToTextRange(Location.Create(tree, token.Span).GetLineSpan()) });\n                }\n            }\n            return cpdTokenInfo;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/Utilities/FileMetadataAnalyzerBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Protobuf;\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class FileMetadataAnalyzerBase<TSyntaxKind> : UtilityAnalyzerBase<TSyntaxKind, FileMetadataInfo>\n        where TSyntaxKind : struct\n    {\n        protected const string DiagnosticId = \"S9999-metadata\";\n        private const string Title = \"File metadata generator\";\n\n        protected sealed override string FileName => \"file-metadata.pb\";\n        protected override UtilityAnalyzerParameters ReadParameters(IAnalysisContext context) =>\n            base.ReadParameters(context) with { AnalyzeGeneratedCode = true };\n\n        protected FileMetadataAnalyzerBase() : base(DiagnosticId, Title) { }\n\n        protected override bool ShouldGenerateMetrics(UtilityAnalyzerParameters parameters, SyntaxTree tree) =>\n            !GeneratedCodeRecognizer.IsRazorGeneratedFile(tree)\n            && base.ShouldGenerateMetrics(parameters, tree);\n\n        protected sealed override FileMetadataInfo CreateMessage(UtilityAnalyzerParameters parameters, SyntaxTree tree, SemanticModel model) =>\n            new()\n            {\n                FilePath = tree.FilePath,\n                IsGenerated = tree.IsGenerated(Language.GeneratedCodeRecognizer),\n                Encoding = tree.Encoding?.WebName.ToLowerInvariant() ?? string.Empty\n            };\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/Utilities/LogAnalyzerBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Protobuf;\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class LogAnalyzerBase<TSyntaxKind> : UtilityAnalyzerBase<TSyntaxKind, LogInfo>\n        where TSyntaxKind : struct\n    {\n        private const string DiagnosticId = \"S9999-log\";\n        private const string Title = \"Log generator\";\n\n        protected abstract string LanguageVersion(Compilation compilation);\n\n        protected sealed override string FileName => \"log.pb\";\n        protected override UtilityAnalyzerParameters ReadParameters(IAnalysisContext context) =>\n            base.ReadParameters(context) with { AnalyzeGeneratedCode = true };\n\n        protected LogAnalyzerBase() : base(DiagnosticId, Title) { }\n\n        protected sealed override IEnumerable<LogInfo> CreateAnalysisMessages(SonarCompilationReportingContext c) =>\n            new[]\n            {\n                new LogInfo { Severity = LogSeverity.Info, Text = \"Roslyn version: \" + typeof(SyntaxNode).Assembly.GetName().Version },\n                new LogInfo { Severity = LogSeverity.Info, Text = \"Language version: \" + LanguageVersion(c.Compilation) },\n                new LogInfo { Severity = LogSeverity.Info, Text = \"Concurrent execution: \" + (IsConcurrentExecutionEnabled() ? \"enabled\" : \"disabled\") }\n            };\n\n        protected sealed override LogInfo CreateMessage(UtilityAnalyzerParameters parameters, SyntaxTree tree, SemanticModel model) =>\n            tree.IsGenerated(Language.GeneratedCodeRecognizer)\n            ? CreateMessage(tree)\n            : null;\n\n        private static LogInfo CreateMessage(SyntaxTree tree) =>\n            GeneratedCodeRecognizer.IsRazorGeneratedFile(tree)\n                ? new LogInfo { Severity = LogSeverity.Debug, Text = $\"File '{tree.FilePath}' was recognized as razor generated\" }\n                : new LogInfo { Severity = LogSeverity.Debug, Text = $\"File '{tree.FilePath}' was recognized as generated\" };\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/Utilities/MethodDeclarationInfoComparer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Protobuf;\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic sealed record MethodDeclarationInfoComparer : IEqualityComparer<MethodDeclarationInfo>\n{\n    public bool Equals(MethodDeclarationInfo first, MethodDeclarationInfo second) =>\n        (first is null && second is null)\n        || (first is not null\n            && second is not null\n            && first.TypeName == second.TypeName\n            && first.MethodName == second.MethodName);\n\n    public int GetHashCode(MethodDeclarationInfo info) =>\n        HashCode.Combine(info.TypeName, info.MethodName);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/Utilities/MetricsAnalyzerBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Metrics;\nusing SonarAnalyzer.Protobuf;\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class MetricsAnalyzerBase<TSyntaxKind> : UtilityAnalyzerBase<TSyntaxKind, MetricsInfo>\n        where TSyntaxKind : struct\n    {\n        private const string DiagnosticId = \"S9999-metrics\";\n        private const string Title = \"Metrics calculator\";\n\n        protected abstract MetricsBase GetMetrics(SyntaxTree syntaxTree, SemanticModel semanticModel);\n\n        protected sealed override string FileName => \"metrics.pb\";\n        protected override UtilityAnalyzerParameters ReadParameters(IAnalysisContext context) =>\n            base.ReadParameters(context) with { AnalyzeTestProjects = false };\n\n        protected MetricsAnalyzerBase() : base(DiagnosticId, Title) { }\n\n        protected sealed override MetricsInfo CreateMessage(UtilityAnalyzerParameters parameters, SyntaxTree tree, SemanticModel model)\n        {\n            var metrics = GetMetrics(tree, model);\n            var complexity = metrics.Complexity;\n            var metricsInfo = new MetricsInfo\n            {\n                FilePath = tree.GetRoot().GetMappedFilePathFromRoot(),\n                ClassCount = metrics.ClassCount,\n                StatementCount = metrics.StatementCount,\n                FunctionCount = metrics.FunctionCount,\n                Complexity = complexity,\n                CognitiveComplexity = metrics.CognitiveComplexity,\n            };\n\n            var comments = metrics.GetComments(parameters.IgnoreHeaderComments);\n            metricsInfo.NoSonarComment.AddRange(comments.NoSonar);\n            metricsInfo.NonBlankComment.AddRange(comments.NonBlank);\n            metricsInfo.CodeLine.AddRange(metrics.CodeLines);\n            metricsInfo.ExecutableLines.AddRange(metrics.ExecutableLines);\n\n            return metricsInfo;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/Utilities/SymbolReferenceAnalyzerBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Protobuf;\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class SymbolReferenceAnalyzerBase<TSyntaxKind> : UtilityAnalyzerBase<TSyntaxKind, SymbolReferenceInfo>\n    where TSyntaxKind : struct\n{\n    private const string DiagnosticId = \"S9999-symbolRef\";\n    private const string Title = \"Symbol reference calculator\";\n    private const int TokenCountThreshold = 40_000;\n\n    protected abstract SyntaxNode GetBindableParent(SyntaxToken token);\n\n    protected abstract ReferenceInfo[] CreateDeclarationReferenceInfo(SyntaxNode node, SemanticModel model);\n\n    protected abstract IList<SyntaxNode> GetDeclarations(SyntaxNode node);\n\n    protected sealed override string FileName => \"symrefs.pb\";\n\n    protected SymbolReferenceAnalyzerBase() : base(DiagnosticId, Title) { }\n\n    protected sealed override SymbolReferenceInfo CreateMessage(UtilityAnalyzerParameters parameters, SyntaxTree tree, SemanticModel model)\n    {\n        var filePath = MapFilePath(tree);\n        var symbolReferenceInfo = new SymbolReferenceInfo { FilePath = filePath };\n        var references = GetReferences(tree.GetRoot(), model);\n        foreach (var symbol in references.Keys)\n        {\n            if (GetSymbolReference(references[symbol], filePath) is { } reference)\n            {\n                symbolReferenceInfo.Reference.Add(reference);\n            }\n        }\n        return symbolReferenceInfo;\n    }\n\n    protected sealed override bool ShouldGenerateMetrics(UtilityAnalyzerParameters parameters, SyntaxTree tree) =>\n        base.ShouldGenerateMetrics(parameters, tree)\n        && !HasTooManyTokens(tree);\n\n    private Dictionary<ISymbol, List<ReferenceInfo>> GetReferences(SyntaxNode root, SemanticModel model)\n    {\n        var references = new Dictionary<ISymbol, List<ReferenceInfo>>();\n        var knownIdentifiers = new HashSet<string>(Language.NameComparer);\n        var knownNodes = new List<SyntaxNode>();\n        var declarations = GetDeclarations(root);\n\n        for (var i = 0; i < declarations.Count; i++)\n        {\n            var declarationReferences = CreateDeclarationReferenceInfo(declarations[i], model);\n            if (declarationReferences is null)\n            {\n                continue;\n            }\n\n            for (var j = 0; j < declarationReferences.Length; j++)\n            {\n                var currentDeclaration = declarationReferences[j];\n                if (currentDeclaration.Symbol is not null)\n                {\n                    references.GetOrAdd(currentDeclaration.Symbol, _ => []).Add(currentDeclaration);\n                    knownNodes.Add(currentDeclaration.Node);\n                    knownIdentifiers.Add(currentDeclaration.Identifier.ValueText);\n                }\n            }\n        }\n\n        foreach (var token in root.DescendantTokens())\n        {\n            if (Language.Syntax.IsKind(token, Language.SyntaxKind.IdentifierToken)\n                && knownIdentifiers.Contains(token.ValueText)\n                && GetBindableParent(token) is { } parent\n                && !knownNodes.Contains(parent)\n                && GetReferenceSymbol(parent, model) is { } symbol)\n            {\n                foreach (var part in symbol.AllPartialParts().Where(references.ContainsKey))\n                {\n                    references[part].Add(new(parent, token, part, false));\n                }\n            }\n        }\n\n        return references;\n    }\n\n    private static ISymbol GetReferenceSymbol(SyntaxNode node, SemanticModel model) =>\n        model.GetSymbolInfo(node).Symbol switch\n        {\n            IMethodSymbol { MethodKind: MethodKind.Constructor, IsImplicitlyDeclared: true } constructor => constructor.ContainingType,\n            var symbol => symbol\n        };\n\n    private static SymbolReferenceInfo.Types.SymbolReference GetSymbolReference(IReadOnlyList<ReferenceInfo> references, string filePath)\n    {\n        var declarationSpan = GetDeclarationSpan(references, filePath);\n        if (!declarationSpan.HasValue)\n        {\n            return null;\n        }\n\n        var symbolReference = new SymbolReferenceInfo.Types.SymbolReference { Declaration = ToTextRange(declarationSpan.Value) };\n        for (var i = 0; i < references.Count; i++)\n        {\n            var reference = references[i];\n            if (!reference.IsDeclaration\n                && reference.Identifier.GetLocation().GetMappedLineSpanIfAvailable() is var mappedLineSpan\n                // Syntax tree can contain elements from external files (e.g. razor imports files)\n                // We need to make sure that we don't count these elements.\n                && string.Equals(mappedLineSpan.Path, filePath, StringComparison.OrdinalIgnoreCase))\n            {\n                symbolReference.Reference.Add(ToTextRange(mappedLineSpan));\n            }\n        }\n        return symbolReference;\n    }\n\n    private static FileLinePositionSpan? GetDeclarationSpan(IReadOnlyList<ReferenceInfo> references, string filePath)\n    {\n        for (var i = 0; i < references.Count; i++)\n        {\n            if (references[i].IsDeclaration\n                && references[i].Identifier.GetLocation().GetMappedLineSpanIfAvailable() is var mappedLineSpan\n                && string.Equals(mappedLineSpan.Path, filePath, StringComparison.OrdinalIgnoreCase))\n            {\n                return mappedLineSpan;\n            }\n        }\n        return null;\n    }\n\n    private static bool HasTooManyTokens(SyntaxTree tree) =>\n        tree.GetRoot().DescendantTokens().Count() > TokenCountThreshold;\n\n    protected sealed record ReferenceInfo(SyntaxNode Node, SyntaxToken Identifier, ISymbol Symbol, bool IsDeclaration);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/Utilities/TelemetryAnalyzerBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\nusing Google.Protobuf;\nusing SonarAnalyzer.Protobuf;\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class TelemetryAnalyzerBase<TSyntaxKind> : UtilityAnalyzerBase\n    where TSyntaxKind : struct\n{\n    private const string DiagnosticId = \"S9999-telemetry\";\n    private const string Title = \"Telemetry generator\";\n    private const string FileName = \"telemetry.pb\";\n\n    protected abstract ILanguageFacade<TSyntaxKind> Language { get; }\n    protected abstract string LanguageVersion(Compilation compilation);\n\n    protected TelemetryAnalyzerBase() : base(DiagnosticId, Title) { }\n\n    protected sealed override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(startContext =>\n        {\n            var parameters = ReadParameters(startContext);\n            if (!parameters.IsAnalyzerEnabled)\n            {\n                return;\n            }\n            startContext.RegisterCompilationEndAction(endContext =>\n            {\n                Directory.CreateDirectory(parameters.OutPath);\n                using var stream = File.Create(Path.Combine(parameters.OutPath, FileName));\n                CreateTelemetry(endContext).WriteDelimitedTo(stream);\n            });\n        });\n\n    private Telemetry CreateTelemetry(SonarCompilationReportingContext c)\n    {\n        var projectConfiguration = c.ProjectConfiguration();\n        return new Telemetry\n        {\n            ProjectFullPath = projectConfiguration.ProjectPath is { } path ? path : string.Empty,\n            LanguageVersion = LanguageVersion(c.Compilation) is { } language ? language : string.Empty,\n        };\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/Utilities/TestMethodDeclarationsAnalyzerBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Protobuf;\n\nnamespace SonarAnalyzer.Core.Rules;\n\n/// <summary>\n/// This class is responsible for exporting the method declarations to a protobuf file which will later be\n/// used in the plugin to map the content of the test reports to the actual files.\n/// </summary>\n/// <typeparam name=\"TSyntaxKind\">Discriminator for C#/VB.NET.</typeparam>\npublic abstract class TestMethodDeclarationsAnalyzerBase<TSyntaxKind>() : UtilityAnalyzerBase<TSyntaxKind, MethodDeclarationsInfo>(DiagnosticId, Title)\n    where TSyntaxKind : struct\n{\n    private const string DiagnosticId = \"S9999-testMethodDeclaration\";\n    private const string Title = \"Test method declarations generator\";\n\n    protected abstract IEnumerable<SyntaxNode> GetTypeDeclarations(SyntaxNode node);\n\n    protected abstract IEnumerable<SyntaxNode> GetMethodDeclarations(SyntaxNode node);\n\n    protected sealed override string FileName => \"test-method-declarations.pb\";\n\n    protected override bool ShouldGenerateMetrics(UtilityAnalyzerParameters parameters, SyntaxTree tree) =>\n        // In this analyzer, we want to always generate the metrics for the test projects (contrary to the base class implementation).\n        parameters.IsTestProject && !Language.GeneratedCodeRecognizer.IsGenerated(tree);\n\n    protected sealed override MethodDeclarationsInfo CreateMessage(UtilityAnalyzerParameters parameters, SyntaxTree tree, SemanticModel model)\n    {\n        // Test method declarations found in the file by starting with the syntax tree.\n        var fileDeclarations = GetMethodDeclarations(tree.GetRoot())\n            .Select(x => GetTestMethodSymbol(x, model))\n            .WhereNotNull()\n            .Select(GetDeclarationInfo);\n\n        // Test method declarations pulled from the base types.\n        var baseTypeDeclarations = GetTypeDeclarations(tree.GetRoot())\n            .Select(x => (ITypeSymbol)model.GetDeclaredSymbol(x))\n            .WhereNotNull()\n            .SelectMany(x => GetAllTestMethods(x, x.BaseType));\n\n        var declarations = new HashSet<MethodDeclarationInfo>(fileDeclarations, new MethodDeclarationInfoComparer());\n        declarations.UnionWith(baseTypeDeclarations);\n        return declarations.Count == 0\n            ? null\n            : new MethodDeclarationsInfo { FilePath = tree.FilePath, AssemblyName = model.Compilation.AssemblyName, MethodDeclarations = { declarations } };\n    }\n\n    private static MethodDeclarationInfo GetDeclarationInfo(IMethodSymbol methodSymbol) =>\n        new()\n        {\n            TypeName = Name(methodSymbol.ContainingType),\n            MethodName = methodSymbol.Name\n        };\n\n    private static MethodDeclarationInfo GetDeclarationInfo(ITypeSymbol derivedType, IMethodSymbol methodSymbol) =>\n        new()\n        {\n            TypeName = Name(derivedType),\n            MethodName = methodSymbol.Name\n        };\n\n    private static string Name(ITypeSymbol typeSymbol)\n    {\n        const string separator = \".\";\n        var nameParts = new Stack<string>();\n        var currentType = typeSymbol;\n        while (currentType is not null)\n        {\n            nameParts.Push(currentType.Name);\n            currentType = currentType.ContainingType;\n        }\n        var currentNamespace = typeSymbol.ContainingNamespace;\n        while (currentNamespace is not null && !currentNamespace.IsGlobalNamespace)\n        {\n            nameParts.Push(currentNamespace.Name);\n            currentNamespace = currentNamespace.ContainingNamespace;\n        }\n        return string.Join(separator, nameParts);\n    }\n\n    private static IEnumerable<MethodDeclarationInfo> GetAllTestMethods(ITypeSymbol derivedType, ITypeSymbol typeSymbol)\n    {\n        if (typeSymbol is null)\n        {\n            return [];\n        }\n        var members = new HashSet<MethodDeclarationInfo>(GetTestMethodSymbols(typeSymbol).Select(x => GetDeclarationInfo(derivedType, x)));\n        var baseType = typeSymbol.BaseType;\n        while (baseType is not null)\n        {\n            members.UnionWith(GetAllTestMethods(derivedType, baseType));\n            baseType = baseType.BaseType;\n        }\n\n        return members;\n    }\n\n    private static IEnumerable<IMethodSymbol> GetTestMethodSymbols(ITypeSymbol typeSymbol) =>\n        typeSymbol.GetMembers().OfType<IMethodSymbol>().Where(IsTestMethod);\n\n    private static IMethodSymbol GetTestMethodSymbol(SyntaxNode methodDeclarationSyntax, SemanticModel model) =>\n        model.GetDeclaredSymbol(methodDeclarationSyntax) is IMethodSymbol methodSymbol && IsTestMethod(methodSymbol)\n            ? methodSymbol\n            : null;\n\n    private static bool IsTestMethod(IMethodSymbol methodSymbol) =>\n        methodSymbol is not null && !methodSymbol.IsImplicitlyDeclared && methodSymbol.IsTestMethod();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/Utilities/TokenTypeAnalyzerBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Text;\nusing SonarAnalyzer.Protobuf;\nusing static SonarAnalyzer.Protobuf.TokenTypeInfo.Types;\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class TokenTypeAnalyzerBase<TSyntaxKind> : UtilityAnalyzerBase<TSyntaxKind, TokenTypeInfo>\n        where TSyntaxKind : struct\n    {\n        private const string DiagnosticId = \"S9999-token-type\";\n        private const string Title = \"Token type calculator\";\n        private const int IdentifierTokenCountThreshold = 4_000;\n\n        protected sealed override string FileName => \"token-type.pb\";\n\n        protected TokenTypeAnalyzerBase() : base(DiagnosticId, Title) { }\n\n        protected abstract TokenClassifierBase GetTokenClassifier(SemanticModel semanticModel, bool skipIdentifierTokens);\n        protected abstract TriviaClassifierBase GetTriviaClassifier();\n\n        protected sealed override bool ShouldGenerateMetrics(UtilityAnalyzerParameters parameters, SyntaxTree tree) =>\n            !GeneratedCodeRecognizer.IsRazorGeneratedFile(tree)\n            && base.ShouldGenerateMetrics(parameters, tree);\n\n        protected sealed override TokenTypeInfo CreateMessage(UtilityAnalyzerParameters parameters, SyntaxTree tree, SemanticModel model)\n        {\n            var tokens = tree.GetRoot().DescendantTokens();\n            var identifierTokenKind = Language.SyntaxKind.IdentifierToken;  // Performance optimization\n            var skipIdentifierTokens = tokens\n                .Where(token => Language.Syntax.IsKind(token, identifierTokenKind))\n                .Skip(IdentifierTokenCountThreshold)\n                .Any();\n\n            var tokenClassifier = GetTokenClassifier(model, skipIdentifierTokens);\n            var triviaClassifier = GetTriviaClassifier();\n            var spans = new List<TokenInfo>();\n            // The second iteration of the tokens is intended since there is no processing done and we want to avoid copying all the tokens to a second collection.\n            foreach (var token in tokens)\n            {\n                if (token.HasLeadingTrivia)\n                {\n                    IterateTrivia(triviaClassifier, spans, token.LeadingTrivia);\n                }\n                if (tokenClassifier.ClassifyToken(token) is { } tokenClassification)\n                {\n                    spans.Add(tokenClassification);\n                }\n                if (token.HasTrailingTrivia)\n                {\n                    IterateTrivia(triviaClassifier, spans, token.TrailingTrivia);\n                }\n            }\n\n            var tokenTypeInfo = new TokenTypeInfo\n            {\n                FilePath = tree.FilePath\n            };\n\n            tokenTypeInfo.TokenInfo.AddRange(spans);\n            return tokenTypeInfo;\n\n            static void IterateTrivia(TriviaClassifierBase triviaClassifier, List<TokenInfo> spans, SyntaxTriviaList triviaList)\n            {\n                foreach (var trivia in triviaList)\n                {\n                    if (triviaClassifier.ClassifyTrivia(trivia) is { } triviaClassification)\n                    {\n                        spans.Add(triviaClassification);\n                    }\n                }\n            }\n        }\n\n        protected internal abstract class TokenClassifierBase\n        {\n            private readonly bool skipIdentifiers;\n            private readonly SemanticModel semanticModel;\n\n            private static readonly ISet<MethodKind> ConstructorKinds = new HashSet<MethodKind>\n            {\n                MethodKind.Constructor,\n                MethodKind.StaticConstructor,\n                MethodKind.SharedConstructor\n            };\n\n            private static readonly ISet<SymbolKind> VarSymbolKinds = new HashSet<SymbolKind>\n            {\n                SymbolKind.NamedType,\n                SymbolKind.TypeParameter,\n                SymbolKind.ArrayType,\n                SymbolKind.PointerType\n            };\n\n            protected abstract SyntaxNode GetBindableParent(SyntaxToken token);\n            protected abstract bool IsKeyword(SyntaxToken token);\n            protected abstract bool IsIdentifier(SyntaxToken token);\n            protected abstract bool IsNumericLiteral(SyntaxToken token);\n            protected abstract bool IsStringLiteral(SyntaxToken token);\n\n            protected SemanticModel SemanticModel => semanticModel ?? throw new InvalidOperationException(\"The code snippet is not supposed to call the semantic model for classification.\");\n\n            protected TokenClassifierBase(SemanticModel semanticModel, bool skipIdentifiers)\n            {\n                this.semanticModel = semanticModel;\n                this.skipIdentifiers = skipIdentifiers;\n            }\n\n            public TokenInfo ClassifyToken(SyntaxToken token) =>\n                token switch\n                {\n                    _ when IsKeyword(token) => TokenInfo(token, TokenType.Keyword),\n                    _ when IsStringLiteral(token) => TokenInfo(token, TokenType.StringLiteral),\n                    _ when IsNumericLiteral(token) => TokenInfo(token, TokenType.NumericLiteral),\n                    _ when IsIdentifier(token) && !skipIdentifiers => ClassifyIdentifier(token),\n                    _ => null,\n                };\n\n            protected static TokenInfo TokenInfo(SyntaxToken token, TokenType tokenType) =>\n                tokenType == TokenType.UnknownTokentype\n                || (string.IsNullOrWhiteSpace(token.Text) && tokenType != TokenType.StringLiteral)\n                    ? null\n                    : new()\n                    {\n                        TokenType = tokenType,\n                        TextRange = ToTextRange(token.GetLocation().GetLineSpan()),\n                    };\n\n            protected virtual TokenInfo ClassifyIdentifier(SyntaxToken token)\n            {\n                if (SemanticModel.GetDeclaredSymbol(token.Parent) is { } declaration)\n                {\n                    return ClassifyIdentifier(token, declaration);\n                }\n                else if (GetBindableParent(token) is { } parent && SemanticModel.GetSymbolInfo(parent).Symbol is { } symbol)\n                {\n                    return ClassifyIdentifier(token, symbol);\n                }\n                else\n                {\n                    return null;\n                }\n            }\n\n            private TokenInfo ClassifyIdentifier(SyntaxToken token, ISymbol symbol) =>\n                symbol switch\n                {\n                    IAliasSymbol alias => ClassifyIdentifier(token, alias.Target),\n                    IMethodSymbol ctorSymbol when ConstructorKinds.Contains(ctorSymbol.MethodKind) => TokenInfo(token, TokenType.TypeName),\n                    _ when token.ValueText == \"var\" && VarSymbolKinds.Contains(symbol.Kind) => TokenInfo(token, TokenType.Keyword),\n                    { Kind: SymbolKind.Parameter, IsImplicitlyDeclared: true } when token.ValueText == \"value\" => TokenInfo(token, TokenType.Keyword),\n                    { Kind: SymbolKind.NamedType or SymbolKind.TypeParameter } => TokenInfo(token, TokenType.TypeName),\n                    { Kind: SymbolKind.DynamicType } => TokenInfo(token, TokenType.Keyword),\n                    _ => null,\n                };\n        }\n\n        protected internal abstract class TriviaClassifierBase\n        {\n            protected abstract bool IsDocComment(SyntaxTrivia trivia);\n            protected abstract bool IsRegularComment(SyntaxTrivia trivia);\n\n            public TokenInfo ClassifyTrivia(SyntaxTrivia trivia) =>\n                trivia switch\n                {\n                    _ when IsRegularComment(trivia) => TokenInfo(trivia.SyntaxTree, TokenType.Comment, trivia.Span),\n                    _ when IsDocComment(trivia) => ClassifyDocComment(trivia),\n                    // Handle preprocessor directives here\n                    _ => null,\n                };\n\n            private TokenInfo TokenInfo(SyntaxTree tree, TokenType tokenType, TextSpan span) =>\n                new()\n                {\n                    TokenType = tokenType,\n                    TextRange = ToTextRange(Location.Create(tree, span).GetLineSpan())\n                };\n\n            private TokenInfo ClassifyDocComment(SyntaxTrivia trivia) =>\n                TokenInfo(trivia.SyntaxTree, TokenType.Comment, trivia.FullSpan);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/Utilities/UtilityAnalyzerBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Collections.Concurrent;\nusing System.IO;\nusing Google.Protobuf;\nusing SonarAnalyzer.Protobuf;\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic readonly record struct UtilityAnalyzerParameters(bool IsAnalyzerEnabled,\n                                                        bool IgnoreHeaderComments,\n                                                        bool AnalyzeGeneratedCode,\n                                                        bool AnalyzeTestProjects,\n                                                        string OutPath,\n                                                        bool IsTestProject,\n                                                        bool IsCloud)\n{\n    public static readonly UtilityAnalyzerParameters Default = new(false, false, false, true, null, false, false);\n}\n\npublic abstract class UtilityAnalyzerBase : SonarDiagnosticAnalyzer\n{\n    protected static readonly ISet<string> FileExtensionWhitelist = new HashSet<string> { \".cs\", \".csx\", \".vb\" };\n    private readonly DiagnosticDescriptor rule;\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(rule);\n\n    protected override bool EnableConcurrentExecution => false;\n\n    protected UtilityAnalyzerBase(string diagnosticId, string title) =>\n        rule = DiagnosticDescriptorFactory.CreateUtility(diagnosticId, title);\n\n    internal static TextRange ToTextRange(FileLinePositionSpan lineSpan) =>\n        new()\n        {\n            StartLine = lineSpan.StartLinePosition.LineNumberToReport(),\n            EndLine = lineSpan.EndLinePosition.LineNumberToReport(),\n            StartOffset = lineSpan.StartLinePosition.Character,\n            EndOffset = lineSpan.EndLinePosition.Character\n        };\n\n    protected virtual UtilityAnalyzerParameters ReadParameters(IAnalysisContext context)\n    {\n        var outPath = context.ProjectConfiguration().OutPath;\n        // For backward compatibility with S4MSB <= 5.0\n        if (outPath is null && context.Options.ProjectOutFolderPath() is { } projectOutFolderAdditionalFile)\n        {\n            outPath = projectOutFolderAdditionalFile.GetText().ToString().TrimEnd();\n        }\n        if (context.Options.SonarLintXml() is not null && !string.IsNullOrEmpty(outPath))\n        {\n            var language = context.Compilation.Language;\n            var sonarLintXml = context.SonarLintXml();\n            return new UtilityAnalyzerParameters(\n                IsAnalyzerEnabled: true,\n                IgnoreHeaderComments: sonarLintXml.IgnoreHeaderComments(language),\n                AnalyzeGeneratedCode: sonarLintXml.AnalyzeGeneratedCode(language),\n                AnalyzeTestProjects: true,\n                OutPath: Path.Combine(outPath, language == LanguageNames.CSharp ? \"output-cs\" : \"output-vbnet\"),\n                IsTestProject: context.IsTestProject(),\n                IsCloud: context.ProjectConfiguration().AnalysisConfig.IsCloud);\n        }\n        return UtilityAnalyzerParameters.Default;\n    }\n}\n\npublic abstract class UtilityAnalyzerBase<TSyntaxKind, TMessage> : UtilityAnalyzerBase\n    where TSyntaxKind : struct\n    where TMessage : class, IMessage, new()\n{\n    protected abstract ILanguageFacade<TSyntaxKind> Language { get; }\n    protected abstract string FileName { get; }\n    protected abstract TMessage CreateMessage(UtilityAnalyzerParameters parameters, SyntaxTree tree, SemanticModel model);\n\n    protected virtual bool AnalyzeUnchangedFiles => false;\n\n    protected UtilityAnalyzerBase(string diagnosticId, string title) : base(diagnosticId, title) { }\n\n    protected virtual IEnumerable<TMessage> CreateAnalysisMessages(SonarCompilationReportingContext c) =>\n        [];\n\n    protected sealed override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(startContext =>\n            {\n                var parameters = ReadParameters(startContext);\n                if (!parameters.IsAnalyzerEnabled)\n                {\n                    return;\n                }\n                var treeMessages = new ConcurrentStack<TMessage>();\n                startContext.RegisterSemanticModelActionInAllFiles(modelContext =>\n                    {\n                        if (ShouldGenerateMetrics(parameters, modelContext))\n                        {\n                            var message = CreateMessage(parameters, modelContext.Tree, modelContext.Model);\n                            treeMessages.Push(message);\n                        }\n                    });\n                startContext.RegisterCompilationEndAction(endContext =>\n                    {\n                        var allMessages = CreateAnalysisMessages(endContext)\n                            .Concat(treeMessages)\n                            .WhereNotNull()\n                            .ToArray();\n                        Directory.CreateDirectory(parameters.OutPath);\n                        using var stream = File.Create(Path.Combine(parameters.OutPath, FileName));\n                        foreach (var message in allMessages)\n                        {\n                            message.WriteDelimitedTo(stream);\n                        }\n                    });\n            });\n\n    protected virtual bool ShouldGenerateMetrics(UtilityAnalyzerParameters parameters, SyntaxTree tree) =>\n        // The results of Metrics and CopyPasteToken analyzers are not needed for Test projects yet the plugin side expects the protobuf files, so we create empty ones.\n        (parameters.AnalyzeTestProjects || !parameters.IsTestProject)\n        && FileExtensionWhitelist.Contains(Path.GetExtension(tree.FilePath))\n        && ShouldGenerateMetricsByType(parameters, tree);\n\n    protected static string MapFilePath(SyntaxTree tree) =>\n        // If the syntax tree is constructed for a razor generated file, we need to provide the original file path.\n        GeneratedCodeRecognizer.IsRazorGeneratedFile(tree) && tree.GetRoot() is var root && root.ContainsDirectives\n            ? root.GetMappedFilePathFromRoot()\n            : tree.FilePath;\n\n    private bool ShouldGenerateMetrics(UtilityAnalyzerParameters parameters, SonarSemanticModelReportingContext context) =>\n        (AnalyzeUnchangedFiles || !context.IsUnchanged(context.Tree))\n        && ShouldGenerateMetrics(parameters, context.Tree);\n\n    private bool ShouldGenerateMetricsByType(UtilityAnalyzerParameters parameters, SyntaxTree tree) =>\n        parameters.AnalyzeGeneratedCode\n            ? !GeneratedCodeRecognizer.IsCshtml(tree) // We cannot upload metrics for .cshtml files. The file is owned by the html plugin.\n            : !tree.IsGenerated(Language.GeneratedCodeRecognizer) || GeneratedCodeRecognizer.IsRazor(tree);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/ValueTypeShouldImplementIEquatableBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class ValueTypeShouldImplementIEquatableBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n{\n    private const string DiagnosticId = \"S3898\";\n\n    protected override string MessageFormat => \"Implement 'IEquatable<T>' in value type '{0}'.\";\n\n    protected ValueTypeShouldImplementIEquatableBase() : base(DiagnosticId) { }\n\n    protected sealed override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            Language.GeneratedCodeRecognizer,\n            c =>\n            {\n                var modifiers = Language.Syntax.ModifierKinds(c.Node);\n                if (!modifiers.Any(x => x.Equals(Language.SyntaxKind.RefKeyword))\n                    && c.Model.GetDeclaredSymbol(c.Node) is INamedTypeSymbol structSymbol\n                    && !structSymbol.Implements(KnownType.System_IEquatable_T))\n                {\n                    var identifier = Language.Syntax.NodeIdentifier(c.Node).Value;\n                    c.ReportIssue(Rule, identifier, identifier.ValueText);\n                }\n            },\n            Language.SyntaxKind.StructDeclaration);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/VariableUnusedBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class VariableUnusedBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n{\n    protected abstract bool IsExcludedDeclaration(SyntaxNode node);\n\n    protected override string MessageFormat => \"Remove the unused local variable '{0}'.\";\n\n    protected VariableUnusedBase() : base(\"S1481\") { }\n\n    protected sealed override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCodeBlockStartAction<TSyntaxKind>(Language.GeneratedCodeRecognizer, cbc =>\n            {\n                // Two-pass approach: in pass 1, declaration nodes populate declaredLocalNames and declaredLocals.\n                // All IdentifierName nodes are buffered into pendingIdentifiers. In pass 2 (the end-of-block\n                // action), GetSymbolInfo is called only on buffered identifiers whose text appears in\n                // declaredLocalNames — avoiding the expensive call for every unrelated identifier in the block.\n                //\n                // Three collections are needed rather than two: declaredLocalNames serves as a cheap text-based\n                // pre-filter while declaredLocals holds the resolved symbols for the unused check. Combining them\n                // into a Dictionary<string, ISymbol> would break shadowing — the same name can map to multiple\n                // symbols (e.g. 'x' in two sequential blocks), so the relationship is one-to-many.\n                var declaredLocalNames = new HashSet<string>(Language.NameComparer);\n                var declaredLocals = new HashSet<ISymbol>();\n                var pendingIdentifiers = new List<SyntaxNode>();\n\n                cbc.RegisterNodeAction(c => CollectDeclaration(c, declaredLocalNames, declaredLocals), Language.SyntaxKind.LocalDeclarationKinds);\n                cbc.RegisterNodeAction(c => pendingIdentifiers.Add(c.Node), Language.SyntaxKind.IdentifierName);\n                cbc.RegisterCodeBlockEndAction(c => ReportUnused(c, declaredLocalNames, declaredLocals, pendingIdentifiers));\n            });\n\n    private void CollectDeclaration(SonarSyntaxNodeReportingContext c, HashSet<string> declaredLocalNames, HashSet<ISymbol> declaredLocals)\n    {\n        if (!IsExcludedDeclaration(c.Node)\n            && c.Model.GetDeclaredSymbol(c.Node) is (ILocalSymbol or IRangeVariableSymbol) and { Name: not \"_\" } symbol)\n        {\n            declaredLocalNames.Add(symbol.Name);\n            declaredLocals.Add(symbol);\n        }\n    }\n\n    private void ReportUnused(SonarCodeBlockReportingContext c, HashSet<string> declaredLocalNames, HashSet<ISymbol> declaredLocals, List<SyntaxNode> pendingIdentifiers)\n    {\n        if (declaredLocalNames.Count == 0)\n        {\n            return;\n        }\n        var usedLocals = new HashSet<ISymbol>();\n        foreach (var id in pendingIdentifiers)\n        {\n            if (Language.Syntax.NodeIdentifier(id) is { ValueText: var idText } && declaredLocalNames.Contains(idText))\n            {\n                usedLocals.UnionWith(c.Model.GetSymbolInfo(id).AllSymbols());\n            }\n        }\n        foreach (var unused in declaredLocals.Except(usedLocals))\n        {\n            c.ReportIssue(Rule, unused.Locations.First(), unused.Name);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/WcfNonVoidOneWayBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules\n{\n    public abstract class WcfNonVoidOneWayBase<TMethodSyntax, TLanguageKind> : SonarDiagnosticAnalyzer\n        where TMethodSyntax : SyntaxNode\n        where TLanguageKind : struct\n    {\n        internal const string DiagnosticId = \"S3598\";\n        protected const string MessageFormat = \"This method can't return any values because it is marked as one-way operation.\";\n\n        protected sealed override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                GeneratedCodeRecognizer,\n                c =>\n                {\n                    var methodDeclaration = (TMethodSyntax)c.Node;\n                    var methodSymbol = c.Model.GetDeclaredSymbol(methodDeclaration) as IMethodSymbol;\n                    if (methodSymbol == null ||\n                        methodSymbol.ReturnsVoid)\n                    {\n                        return;\n                    }\n\n                    var operationContractAttribute = methodSymbol\n                        .GetAttributes(KnownType.System_ServiceModel_OperationContractAttribute)\n                        .FirstOrDefault();\n                    if (operationContractAttribute == null)\n                    {\n                        return;\n                    }\n\n                    var asyncPattern = operationContractAttribute.NamedArguments\n                        .FirstOrDefault(na => \"AsyncPattern\".Equals(na.Key, StringComparison.OrdinalIgnoreCase)) // insensitive for VB.NET\n                        .Value.Value as bool?;\n                    if (asyncPattern.HasValue &&\n                        asyncPattern.Value)\n                    {\n                        return;\n                    }\n\n                    var isOneWay = operationContractAttribute.NamedArguments\n                        .FirstOrDefault(na => \"IsOneWay\".Equals(na.Key, StringComparison.OrdinalIgnoreCase)) // insensitive for VB.NET\n                        .Value.Value as bool?;\n                    if (isOneWay.HasValue &&\n                        isOneWay.Value)\n                    {\n                        c.ReportIssue(SupportedDiagnostics[0], GetReturnTypeLocation(methodDeclaration));\n                    }\n                },\n                MethodDeclarationKind);\n        }\n\n        protected abstract GeneratedCodeRecognizer GeneratedCodeRecognizer { get; }\n        protected abstract TLanguageKind MethodDeclarationKind { get; }\n        protected abstract Location GetReturnTypeLocation(TMethodSyntax method);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Rules/WeakSslTlsProtocolsBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Rules;\n\npublic abstract class WeakSslTlsProtocolsBase<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n{\n    private const string DiagnosticId = \"S4423\";\n\n    private readonly HashSet<string> weakProtocols =\n    [\n        \"Ssl2\",\n        \"Ssl3\",\n        \"Tls\",\n        \"Tls11\",\n        \"Default\",\n    ];\n\n    protected override string MessageFormat => \"Change this code to use a stronger protocol.\";\n\n    protected WeakSslTlsProtocolsBase() : base(DiagnosticId) { }\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            Language.GeneratedCodeRecognizer,\n            c =>\n            {\n                var node = c.Node;\n                if (!Language.Syntax.IsPartOfBinaryNegationOrCondition(node) && IsWeakProtocol(node, c.Model))\n                {\n                    c.ReportIssue(Rule, node);\n                }\n            },\n            Language.SyntaxKind.IdentifierName);\n\n    private bool IsWeakProtocol(SyntaxNode identifierName, SemanticModel model) =>\n        weakProtocols.Contains(Language.Syntax.NodeIdentifier(identifierName).Value.ValueText)\n        && model.GetTypeInfo(identifierName).Type.IsAny(KnownType.System_Net_SecurityProtocolType, KnownType.System_Security_Authentication_SslProtocols);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Semantics/Extensions/IMethodSymbolExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Comparison = SonarAnalyzer.Core.Syntax.Utilities.ComparisonKind;\n\nnamespace SonarAnalyzer.Core.Semantics.Extensions;\n\npublic static class IMethodSymbolExtensions\n{\n    private static readonly ImmutableArray<KnownType> NonActionTypes = ImmutableArray.Create(KnownType.Microsoft_AspNetCore_Mvc_NonActionAttribute, KnownType.System_Web_Mvc_NonActionAttribute);\n\n    private static readonly ImmutableArray<KnownType> KnownTestMethodAttributes = ImmutableArray.Create(\n        [\n            ..KnownType.TestMethodAttributesOfMSTest,\n            ..KnownType.TestMethodAttributesOfNUnit,\n            ..KnownType.TestMethodAttributesOfxUnit,\n        ]);\n\n    private static readonly ImmutableArray<KnownType> NoExpectedResultTestMethodReturnTypes = ImmutableArray.Create(\n            KnownType.Void,\n            KnownType.System_Threading_Tasks_Task);\n\n    private static readonly ImmutableArray<KnownType> KnownTestIgnoreAttributes = ImmutableArray.Create(\n           // Note: XUnit doesn't have a separate \"Ignore\" attribute. It has a \"Skip\" parameter\n           // on the test attribute\n           KnownType.Microsoft_VisualStudio_TestTools_UnitTesting_IgnoreAttribute,\n           KnownType.NUnit_Framework_IgnoreAttribute);\n\n    public static bool IsExtensionOn(this IMethodSymbol methodSymbol, KnownType type)\n    {\n        if (methodSymbol is { IsExtensionMethod: true })\n        {\n            var receiverType = methodSymbol.MethodKind == MethodKind.Ordinary\n                ? methodSymbol.Parameters.First().Type as INamedTypeSymbol\n                : methodSymbol.ReceiverType as INamedTypeSymbol;\n            return receiverType?.ConstructedFrom.Is(type) ?? false;\n        }\n        else\n        {\n            return false;\n        }\n    }\n\n    public static bool IsDestructor(this IMethodSymbol method) =>\n        method.MethodKind == MethodKind.Destructor;\n\n    public static bool IsAnyAttributeInOverridingChain(this IMethodSymbol method) =>\n        method.IsAnyAttributeInOverridingChain(x => x.OverriddenMethod);\n\n    public static bool Is(this IMethodSymbol methodSymbol, KnownType knownType, string name) =>\n        methodSymbol.ContainingType.Is(knownType) && methodSymbol.Name == name;\n\n    public static bool IsAny(this IMethodSymbol methodSymbol, KnownType knownType, params string[] names) =>\n        methodSymbol.ContainingType.Is(knownType) && names.Contains(methodSymbol.Name);\n\n    public static bool IsImplementingInterfaceMember(this IMethodSymbol methodSymbol, KnownType knownInterfaceType, string name) =>\n        (methodSymbol.Name == name && (methodSymbol.Is(knownInterfaceType, name) || methodSymbol.InterfaceMembers().Any(x => x.Is(knownInterfaceType, name))))\n        || methodSymbol.ExplicitInterfaceImplementations.Any(x => x.ContainingType.ConstructedFrom.Is(knownInterfaceType) && x.Name == name);\n\n    /// <summary>\n    /// Returns a value indicating whether the provided method symbol is a ASP.NET MVC\n    /// controller method.\n    /// </summary>\n    public static bool IsControllerActionMethod(this IMethodSymbol methodSymbol) =>\n        methodSymbol is { MethodKind: MethodKind.Ordinary, IsStatic: false }\n        && (methodSymbol.OverriddenMethod is null\n            || !methodSymbol.OverriddenMethod.ContainingType.IsAny(KnownType.Microsoft_AspNetCore_Mvc_ControllerBase, KnownType.Microsoft_AspNetCore_Mvc_Controller))\n        && methodSymbol.GetEffectiveAccessibility() == Accessibility.Public\n        && !methodSymbol.GetAttributes().Any(x => x.AttributeClass.IsAny(NonActionTypes))\n        && methodSymbol.TypeParameters.Length == 0\n        && methodSymbol.Parameters.All(x => x.RefKind == RefKind.None)\n        && methodSymbol.ContainingType.IsControllerType();\n\n    public static Comparison ComparisonKind(this IMethodSymbol method) =>\n        method?.MethodKind == MethodKind.UserDefinedOperator\n            ? ComparisonKind(method.Name)\n            : Comparison.None;\n\n    public static bool IsTestMethod(this IMethodSymbol method) =>\n        method.MethodKind.HasFlag(MethodKindEx.LocalFunction)\n            ? method.IsXunitTestMethod()\n            : method.AnyAttributeDerivesFromOrImplementsAny(KnownTestMethodAttributes);\n\n    public static bool IsIgnoredTestMethod(this IMethodSymbol method) =>\n        method.HasTestIgnoreAttribute()\n        || (method.FindXUnitTestAttribute() is { } testAttribute\n            && (testAttribute.NamedArguments.Any(x => x.Key is \"Skip\" or \"SkipExceptions\" or \"SkipType\" or \"SkipUnless\" or \"SkipWhen\")\n                || (testAttribute.TryGetAttributeValue(\"Explicit\", out bool explicitTest) && explicitTest)));\n\n    public static bool HasExpectedExceptionAttribute(this IMethodSymbol method) =>\n        method.GetAttributes().Any(x =>\n            x.AttributeClass.IsAny(KnownType.ExpectedExceptionAttributes)\n            || x.AttributeClass.DerivesFrom(KnownType.Microsoft_VisualStudio_TestTools_UnitTesting_ExpectedExceptionBaseAttribute));\n\n    public static bool HasAssertionInAttribute(this IMethodSymbol method) =>\n        !NoExpectedResultTestMethodReturnTypes.Any(method.ReturnType.Is)\n        && method.GetAttributes().Any(IsAnyTestCaseAttributeWithExpectedResult);\n\n    public static bool IsMsTestOrNUnitTestIgnored(this IMethodSymbol method) =>\n        method.GetAttributes().Any(x => x.AttributeClass.IsAny(KnownType.IgnoreAttributes));\n\n    /// <summary>\n    /// Returns the <see cref=\"KnownType\"/> that indicates the type of the test method or\n    /// null if the method is not decorated with a known type.\n    /// </summary>\n    /// <remarks>We assume that a test is only marked with a single test attribute e.g.\n    /// not both [Fact] and [Theory]. If there are multiple attributes only one will be\n    /// returned.</remarks>\n    public static KnownType FindFirstTestMethodType(this IMethodSymbol method) =>\n        KnownTestMethodAttributes.FirstOrDefault(x => method.GetAttributes().Any(att => att.AttributeClass.DerivesFrom(x)));\n\n    extension(IMethodSymbol method)\n    {\n        public bool IsExtension => method is { IsExtensionMethod: true } or { AssociatedExtensionImplementation: not null };\n    }\n\n    /// <summary>\n    /// Returns whether the method is a constructor in a MEF-exported type.\n    /// MEF (Managed Extensibility Framework) instantiates types via reflection, so these constructors are not unused.\n    /// </summary>\n    public static bool IsMefConstructor(this IMethodSymbol methodSymbol) =>\n        methodSymbol is { MethodKind: MethodKind.Constructor, ContainingType: INamedTypeSymbol containingType }\n        && containingType.IsMefExportedType();\n\n    private static AttributeData FindXUnitTestAttribute(this IMethodSymbol method) =>\n        method.GetAttributes().FirstOrDefault(x => x.AttributeClass.IsAny(KnownType.TestMethodAttributesOfxUnit));\n\n    private static bool IsAnyTestCaseAttributeWithExpectedResult(AttributeData a) =>\n        IsTestAttributeWithExpectedResult(a)\n        || a.AttributeClass.Is(KnownType.NUnit_Framework_TestCaseSourceAttribute);\n\n    private static bool HasTestIgnoreAttribute(this IMethodSymbol method) =>\n       method.GetAttributes().Any(x => x.AttributeClass.IsAny(KnownTestIgnoreAttributes));\n\n    private static bool IsTestAttributeWithExpectedResult(AttributeData attribute) =>\n        attribute.AttributeClass.IsAny(KnownType.NUnit_Framework_TestCaseAttribute, KnownType.NUnit_Framework_TestAttribute)\n        && attribute.NamedArguments.Any(x => x.Key == \"ExpectedResult\");\n\n    private static bool IsXunitTestMethod(this IMethodSymbol methodSymbol) =>\n        methodSymbol.AnyAttributeDerivesFromAny(KnownType.TestMethodAttributesOfxUnit);\n\n    private static Comparison ComparisonKind(string method) =>\n        method switch\n        {\n            \"op_Equality\" => Comparison.Equals,\n            \"op_Inequality\" => Comparison.NotEquals,\n            \"op_LessThan\" => Comparison.LessThan,\n            \"op_LessThanOrEqual\" => Comparison.LessThanOrEqual,\n            \"op_GreaterThan\" => Comparison.GreaterThan,\n            \"op_GreaterThanOrEqual\" => Comparison.GreaterThanOrEqual,\n            _ => Comparison.None,\n        };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Semantics/Extensions/INamedTypeSymbolExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Semantics.Extensions;\n\npublic static class INamedTypeSymbolExtensions\n{\n    private static readonly ImmutableArray<KnownType> ControllerTypes = ImmutableArray.Create(KnownType.Microsoft_AspNetCore_Mvc_ControllerBase, KnownType.System_Web_Mvc_Controller);\n    private static readonly ImmutableArray<KnownType> ControllerAttributeTypes = ImmutableArray.Create(KnownType.Microsoft_AspNetCore_Mvc_ControllerAttribute);\n\n    private static readonly ImmutableArray<KnownType> KnownTestClassAttributes = ImmutableArray.Create(\n        // xUnit does not have have attributes to identity test classes\n        KnownType.Microsoft_VisualStudio_TestTools_UnitTesting_TestClassAttribute,\n        KnownType.NUnit_Framework_TestFixtureAttribute);\n\n    private static readonly ImmutableArray<KnownType> NonControllerAttributeTypes = ImmutableArray.Create(KnownType.Microsoft_AspNetCore_Mvc_NonControllerAttribute);\n\n    public static bool IsTopLevelProgram(this INamedTypeSymbol symbol) =>\n        TopLevelStatements.ProgramClassImplicitName.Contains(symbol.Name)\n        && symbol.ContainingNamespace.IsGlobalNamespace\n        && symbol.GetMembers(TopLevelStatements.MainMethodImplicitName).Any();\n\n    public static IEnumerable<INamedTypeSymbol> GetAllNamedTypes(this INamedTypeSymbol type)\n    {\n        if (type is null)\n        {\n            yield break;\n        }\n\n        yield return type;\n\n        foreach (var nestedType in type.GetTypeMembers().SelectMany(GetAllNamedTypes))\n        {\n            yield return nestedType;\n        }\n    }\n\n    /// <summary>\n    /// Whether the provided type symbol is a ASP.NET MVC controller.\n    /// </summary>\n    public static bool IsControllerType(this INamedTypeSymbol namedType) =>\n        namedType is not null\n        && namedType.ContainingSymbol is not INamedTypeSymbol\n        && (namedType.DerivesFromAny(ControllerTypes)\n            || namedType.GetAttributes(ControllerAttributeTypes).Any())\n        && !namedType.GetAttributes(NonControllerAttributeTypes).Any();\n\n    /// <summary>\n    /// Whether the provided type symbol is an ASP.NET Core API controller.\n    /// Considers as API controllers also controllers deriving from ControllerBase but not Controller.\n    /// </summary>\n    public static bool IsCoreApiController(this INamedTypeSymbol namedType) =>\n        namedType.IsControllerType()\n        && (namedType.GetAttributesWithInherited().Any(x => x.AttributeClass.DerivesFrom(KnownType.Microsoft_AspNetCore_Mvc_ApiControllerAttribute))\n            || (namedType.DerivesFrom(KnownType.Microsoft_AspNetCore_Mvc_ControllerBase) && !namedType.DerivesFrom(KnownType.Microsoft_AspNetCore_Mvc_Controller)));\n\n    /// <summary>\n    /// Returns whether the class has an attribute that marks the class\n    /// as an MSTest or NUnit test class (xUnit doesn't have any such attributes).\n    /// </summary>\n    public static bool IsTestClass(this INamedTypeSymbol classSymbol) =>\n        classSymbol.AnyAttributeDerivesFromAny(KnownTestClassAttributes);\n\n    /// <summary>\n    /// Returns whether the type is exported via MEF (Managed Extensibility Framework).\n    /// Checks for [Export] attributes on the type itself or [InheritedExport] on base types/interfaces.\n    /// Supports both MEF1 (System.ComponentModel.Composition) and MEF2 (System.Composition).\n    /// </summary>\n    public static bool IsMefExportedType(this INamedTypeSymbol typeSymbol) =>\n        typeSymbol is not null\n        && (typeSymbol.AnyAttributeDerivesFrom(KnownType.System_ComponentModel_Composition_ExportAttribute)\n            || typeSymbol.AnyAttributeDerivesFrom(KnownType.System_Composition_ExportAttribute)\n            || typeSymbol.SelfBaseTypesAndInterfaces().Any(x => x.AnyAttributeDerivesFrom(KnownType.System_ComponentModel_Composition_InheritedExportAttribute)));\n\n    /// <summary>\n    /// Returns the type itself, all base types, and all implemented interfaces.\n    /// This is useful for checking inherited attributes across the full type hierarchy.\n    /// </summary>\n    public static IEnumerable<INamedTypeSymbol> SelfBaseTypesAndInterfaces(this INamedTypeSymbol typeSymbol) =>\n        typeSymbol?.GetSelfAndBaseTypes().Union(typeSymbol.AllInterfaces) ?? [];\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Semantics/Extensions/INamespaceSymbolExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Semantics.Extensions;\n\ninternal static class INamespaceSymbolExtensions\n{\n    /// <summary>\n    /// Checks if the <see cref=\"INamespaceSymbol\"/> fits the <paramref name=\"name\"/>. The format of <paramref name=\"name\"/> is the same as in a <see langword=\"using\"/> directive.\n    /// </summary>\n    /// <param name=\"symbol\">The namespace symbol to test.</param>\n    /// <param name=\"name\">The name in the form <c>System.Collections.Generic</c>.</param>\n    /// <returns>Returns <see langword=\"true\"/> if the namespace symbol refers to the string given.</returns>\n    public static bool Is(this INamespaceSymbol symbol, string name)\n    {\n        _ = name ?? throw new ArgumentNullException(nameof(name));\n        var ns = name.Split(['.'], StringSplitOptions.RemoveEmptyEntries);\n        for (var i = ns.Length - 1; i >= 0; i--)\n        {\n            if (symbol is null || symbol.Name != ns[i])\n            {\n                return false;\n            }\n            else\n            {\n                symbol = symbol.ContainingNamespace;\n            }\n        }\n        return symbol?.IsGlobalNamespace is true;\n    }\n\n    public static IEnumerable<INamedTypeSymbol> GetAllNamedTypes(this INamespaceSymbol @namespace)\n    {\n        if (@namespace is null)\n        {\n            yield break;\n        }\n        foreach (var typeMember in @namespace.GetTypeMembers().SelectMany(x => x.GetAllNamedTypes()))\n        {\n            yield return typeMember;\n        }\n        foreach (var typeMember in @namespace.GetNamespaceMembers().SelectMany(GetAllNamedTypes))\n        {\n            yield return typeMember;\n        }\n    }\n\n    public static bool IsSameNamespace(this INamespaceSymbol namespace1, INamespaceSymbol namespace2) =>\n        (namespace1.IsGlobalNamespace && namespace2.IsGlobalNamespace)\n        || (namespace1.Name.Equals(namespace2.Name)\n            && namespace1.ContainingNamespace is not null\n            && namespace2.ContainingNamespace is not null\n            && namespace1.ContainingNamespace.IsSameNamespace(namespace2.ContainingNamespace));\n\n    public static bool IsSameOrAncestorOf(this INamespaceSymbol thisNamespace, INamespaceSymbol namespaceToCheck) =>\n        thisNamespace.IsSameNamespace(namespaceToCheck)\n        || (namespaceToCheck.ContainingNamespace is not null && thisNamespace.IsSameOrAncestorOf(namespaceToCheck.ContainingNamespace));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Semantics/Extensions/IParameterSymbolExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Semantics.Extensions;\n\npublic static class IParameterSymbolExtensions\n{\n    public static bool IsType(this IParameterSymbol parameter, KnownType type) =>\n        parameter is not null && parameter.Type.Is(type);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Semantics/Extensions/IPropertySymbolExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Semantics.Extensions;\n\npublic static class IPropertySymbolExtensions\n{\n    extension(IPropertySymbol property)\n    {\n        public bool IsExtension => property is { GetMethod.IsExtension: true } or { SetMethod.IsExtension: true };\n\n        public bool IsAnyAttributeInOverridingChain() =>\n            property.IsAnyAttributeInOverridingChain(x => x.OverriddenProperty);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Semantics/Extensions/ISymbolExtensions.Roslyn.cs",
    "content": "﻿// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// See the LICENSE file in the project root for more information.\n\n#nullable enable\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace Microsoft.CodeAnalysis.Shared.Extensions;\n\n// Copied from https://github.com/dotnet/roslyn/blob/ca66296efa86bd8078508fe7b38b91b415364f78/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/ISymbolExtensions.cs\n[ExcludeFromCodeCoverage]\npublic static class ISymbolExtensions\n{\n    /// <summary>\n    /// If the <paramref name=\"symbol\"/> is a method symbol, returns <see langword=\"true\"/> if the method's return type is \"awaitable\", but not if it's <see langword=\"dynamic\"/>.\n    /// If the <paramref name=\"symbol\"/> is a type symbol, returns <see langword=\"true\"/> if that type is \"awaitable\".\n    /// An \"awaitable\" is any type that exposes a GetAwaiter method which returns a valid \"awaiter\". This GetAwaiter method may be an instance method or an extension method.\n    /// </summary>\n    /// <remarks>\n    /// Copied from <seealso href=\"https://github.com/dotnet/roslyn/blob/ca66296efa86bd8078508fe7b38b91b415364f78/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/ISymbolExtensions.cs#L572-L577\"/>.\n    /// SONAR: The code was simplified to improve performance at the cost of precision.\n    /// </remarks>\n    public static bool IsAwaitableNonDynamic(this ISymbol? symbol)\n    {\n        var methodSymbol = symbol as IMethodSymbol;\n        ITypeSymbol? typeSymbol = null;\n\n        if (methodSymbol == null)\n        {\n            typeSymbol = symbol as ITypeSymbol;\n            if (typeSymbol == null)\n            {\n                return false;\n            }\n        }\n        else\n        {\n            if (methodSymbol.ReturnType == null)\n            {\n                return false;\n            }\n        }\n\n        // otherwise: needs valid GetAwaiter\n        // SONAR: Performance: LookupSymbols is slow. We use the less precise GetMembers instead:\n        // Misses extension methods and method from base classes\n        var container = typeSymbol ?? methodSymbol!.ReturnType.OriginalDefinition;\n        var potentialGetAwaiters = container.GetMembers(WellKnownMemberNames.GetAwaiter);\n        var getAwaiters = potentialGetAwaiters.OfType<IMethodSymbol>().Where(x => !x.Parameters.Any());\n        return getAwaiters.Any(VerifyGetAwaiter);\n    }\n\n    // Copied from https://github.com/dotnet/roslyn/blob/ca66296efa86bd8078508fe7b38b91b415364f78/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/ISymbolExtensions.cs#L611\n    private static bool VerifyGetAwaiter(IMethodSymbol getAwaiter)\n    {\n        var returnType = getAwaiter.ReturnType;\n        if (returnType == null)\n        {\n            return false;\n        }\n\n        // bool IsCompleted { get }\n        if (!returnType.GetMembers().OfType<IPropertySymbol>().Any(p => p.Name == WellKnownMemberNames.IsCompleted && p.Type.SpecialType == SpecialType.System_Boolean && p.GetMethod != null))\n        {\n            return false;\n        }\n\n        var methods = returnType.GetMembers().OfType<IMethodSymbol>();\n\n        // NOTE: (vladres) The current version of C# Spec, §7.7.7.3 'Runtime evaluation of await expressions', requires that\n        // NOTE: the interface method INotifyCompletion.OnCompleted or ICriticalNotifyCompletion.UnsafeOnCompleted is invoked\n        // NOTE: (rather than any OnCompleted method conforming to a certain pattern).\n        // NOTE: Should this code be updated to match the spec?\n\n        // void OnCompleted(Action)\n        // Actions are delegates, so we'll just check for delegates.\n        if (!methods.Any(x => x.Name == WellKnownMemberNames.OnCompleted && x.ReturnsVoid && x.Parameters is { Length: 1 } parameter && parameter[0] is { Type.TypeKind: TypeKind.Delegate }))\n            return false;\n\n        // void GetResult() || T GetResult()\n        return methods.Any(m => m.Name == WellKnownMemberNames.GetResult && !m.Parameters.Any());\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Semantics/Extensions/ISymbolExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace SonarAnalyzer.Core.Semantics.Extensions;\n\npublic static class ISymbolExtensions\n{\n    public static bool HasAnyAttribute(this ISymbol symbol, ImmutableArray<KnownType> types) =>\n        symbol.GetAttributes(types).Any();\n\n    public static bool HasAttribute(this ISymbol symbol, KnownType type) =>\n        symbol.GetAttributes(type).Any();\n\n    public static SyntaxNode GetFirstSyntaxRef(this ISymbol symbol) =>\n        symbol?.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax();\n\n    public static bool IsAutoProperty(this ISymbol symbol) =>\n        symbol.Kind == SymbolKind.Property && symbol.ContainingType.GetMembers().OfType<IFieldSymbol>().Any(x => symbol.Equals(x.AssociatedSymbol));\n\n    public static bool IsTopLevelMain(this ISymbol symbol) =>\n        symbol is IMethodSymbol { Name: TopLevelStatements.MainMethodImplicitName };\n\n    public static bool IsGlobalNamespace(this ISymbol symbol) =>\n        symbol is INamespaceSymbol { Name: \"\" };\n\n    public static bool IsInSameAssembly(this ISymbol symbol, ISymbol anotherSymbol) =>\n        symbol.ContainingAssembly.Equals(anotherSymbol.ContainingAssembly);\n\n    public static bool HasNotNullAttribute(this ISymbol parameter) =>\n        parameter.GetAttributes() is { Length: > 0 } attributes && attributes.Any(IsNotNullAttribute);\n\n    // https://github.com/dotnet/roslyn/blob/2a594fa2157a734a988f7b5dbac99484781599bd/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/ISymbolExtensions.cs#L93\n    [ExcludeFromCodeCoverage]\n    public static ImmutableArray<ISymbol> ExplicitOrImplicitInterfaceImplementations(this ISymbol symbol)\n    {\n        if (symbol.Kind is not SymbolKind.Method and not SymbolKind.Property and not SymbolKind.Event)\n        {\n            return ImmutableArray<ISymbol>.Empty;\n        }\n\n        var containingType = symbol.ContainingType;\n        var query = from iface in containingType.AllInterfaces\n                    from interfaceMember in iface.GetMembers()\n                    let impl = containingType.FindImplementationForInterfaceMember(interfaceMember)\n                    where symbol.Equals(impl)\n                    select interfaceMember;\n        return query.ToImmutableArray();\n    }\n\n    public static bool HasContainingType(this ISymbol method, KnownType containingType, bool checkDerivedTypes) =>\n        checkDerivedTypes\n            ? method.ContainingType.DerivesOrImplements(containingType)\n            : method.ContainingType.Is(containingType);\n\n    public static bool IsInType(this ISymbol symbol, KnownType type) =>\n        symbol is not null && symbol.ContainingType.Is(type);\n\n    public static bool IsInType(this ISymbol symbol, ITypeSymbol type) =>\n        symbol?.ContainingType is not null && symbol.ContainingType.Equals(type);\n\n    public static bool IsInType(this ISymbol symbol, ImmutableArray<KnownType> types) =>\n        symbol is not null && symbol.ContainingType.IsAny(types);\n\n    /// <summary>\n    /// Returns all interface members this member implements.\n    /// A single member can implement members from multiple interface.\n    /// </summary>\n    public static IEnumerable<T> InterfaceMembers<T>(this T symbol) where T : class, ISymbol =>\n        symbol switch\n        {\n            null => [],\n            { } when !CanBeInterfaceMember(symbol) => [],\n            _ => symbol.ContainingType\n                .AllInterfaces\n                .SelectMany(x => x.GetMembers())\n                .OfType<T>()\n                .Where(x =>\n                    symbol.GetOverriddenMembersAndSelf().Any(m =>\n                        m.Equals(m.ContainingType.FindImplementationForInterfaceMember(x)))),\n        };\n\n    public static T GetOverriddenMember<T>(this T symbol) where T : class, ISymbol =>\n        symbol is { IsOverride: true }\n            ? symbol.Kind switch\n            {\n                SymbolKind.Method => (T)((IMethodSymbol)symbol).OverriddenMethod,\n                SymbolKind.Property => (T)((IPropertySymbol)symbol).OverriddenProperty,\n                SymbolKind.Event => (T)((IEventSymbol)symbol).OverriddenEvent,\n                _ => throw new ArgumentException($\"Only methods, properties and events can be overridden. {typeof(T).Name} was provided\", nameof(symbol))\n            }\n            : null;\n\n    public static IEnumerable<T> GetOverriddenMembersAndSelf<T>(this T symbol) where T : class, ISymbol\n    {\n        yield return symbol;\n        var overriden = symbol.GetOverriddenMember();\n        while (overriden is not null)\n        {\n            yield return overriden;\n            overriden = overriden.GetOverriddenMember();\n        }\n    }\n\n    public static bool IsChangeable(this ISymbol symbol) =>\n        !symbol.IsAbstract\n        && !symbol.IsVirtual\n        && symbol.InterfaceMembers().IsEmpty()\n        && symbol.GetOverriddenMember() is null;\n\n    public static IEnumerable<IParameterSymbol> GetParameters(this ISymbol symbol) =>\n        symbol.Kind switch\n        {\n            SymbolKind.Method => ((IMethodSymbol)symbol).Parameters,\n            SymbolKind.Property => ((IPropertySymbol)symbol).Parameters,\n            _ => Enumerable.Empty<IParameterSymbol>()\n        };\n\n    public static Accessibility GetEffectiveAccessibility(this ISymbol symbol)\n    {\n        if (symbol is null)\n        {\n            return Accessibility.NotApplicable;\n        }\n\n        var result = symbol.DeclaredAccessibility;\n        if (result == Accessibility.Private)\n        {\n            return Accessibility.Private;\n        }\n\n        for (var container = symbol.ContainingType; container is not null; container = container.ContainingType)\n        {\n            if (container.DeclaredAccessibility == Accessibility.Private)\n            {\n                return Accessibility.Private;\n            }\n            if (container.DeclaredAccessibility == Accessibility.Internal)\n            {\n                result = Accessibility.Internal;\n            }\n        }\n\n        return result;\n    }\n\n    public static bool IsPubliclyAccessible(this ISymbol symbol) =>\n        symbol.GetEffectiveAccessibility() is Accessibility.Public or Accessibility.Protected or Accessibility.ProtectedOrInternal;\n\n    public static bool IsConstructor(this ISymbol symbol) =>\n        symbol.Kind == SymbolKind.Method && symbol.Name == \".ctor\";\n\n    public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, KnownType attributeType) =>\n        symbol?.GetAttributes().Where(x => x.AttributeClass.Is(attributeType)) ?? [];\n\n    public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, ImmutableArray<KnownType> attributeTypes) =>\n        symbol?.GetAttributes().Where(x => x.AttributeClass.IsAny(attributeTypes)) ?? [];\n\n    /// <summary>\n    /// Returns attributes for the symbol by also respecting <see cref=\"AttributeUsageAttribute.Inherited\"/>.\n    /// The returned <see cref=\"AttributeData\"/> is consistent with the results from <see cref=\"MemberInfo.GetCustomAttributes(bool)\"/>.\n    /// </summary>\n    public static IEnumerable<AttributeData> GetAttributesWithInherited(this ISymbol symbol)\n    {\n        foreach (var attribute in symbol.GetAttributes())\n        {\n            yield return attribute;\n        }\n\n        var baseSymbol = BaseSymbol(symbol);\n        while (baseSymbol is not null)\n        {\n            foreach (var attribute in baseSymbol.GetAttributes().Where(x => x.HasAttributeUsageInherited()))\n            {\n                yield return attribute;\n            }\n\n            baseSymbol = BaseSymbol(baseSymbol);\n        }\n\n        static ISymbol BaseSymbol(ISymbol symbol) =>\n            symbol switch\n            {\n                INamedTypeSymbol namedType => namedType.BaseType,\n                IMethodSymbol { OriginalDefinition: { } originalDefinition } method when !method.Equals(originalDefinition) => BaseSymbol(originalDefinition),\n                IMethodSymbol { OverriddenMethod: { } overridenMethod } => overridenMethod,\n                // Support for other kinds of symbols needs to be implemented/tested as needed. A full list can be found here:\n                // https://learn.microsoft.com/dotnet/api/system.attributetargets\n                _ => null,\n            };\n    }\n\n    public static bool AnyAttributeDerivesFrom(this ISymbol symbol, KnownType attributeType) =>\n        symbol?.GetAttributes().Any(x => x.AttributeClass.DerivesFrom(attributeType)) ?? false;\n\n    public static bool AnyAttributeDerivesFromAny(this ISymbol symbol, ImmutableArray<KnownType> attributeTypes) =>\n        symbol?.GetAttributes().Any(x => x.AttributeClass.DerivesFromAny(attributeTypes)) ?? false;\n\n    public static bool AnyAttributeDerivesFromOrImplementsAny(this ISymbol symbol, ImmutableArray<KnownType> attributeTypesOrInterfaces) =>\n        symbol?.GetAttributes().Any(x => x.AttributeClass.DerivesOrImplementsAny(attributeTypesOrInterfaces)) ?? false;\n\n    public static string GetClassification(this ISymbol symbol) =>\n        symbol switch\n        {\n            { Kind: SymbolKind.Alias } => \"alias\",\n            { Kind: SymbolKind.ArrayType } => \"array\",\n            { Kind: SymbolKind.Assembly } => \"assembly\",\n            { Kind: SymbolKindEx.Discard } => \"discard\",\n            { Kind: SymbolKind.DynamicType } => \"dynamic\",\n            { Kind: SymbolKind.ErrorType } => \"error\",\n            { Kind: SymbolKind.Event } => \"event\",\n            { Kind: SymbolKindEx.FunctionPointerType } => \"function pointer\",\n            { Kind: SymbolKind.Field } => \"field\",\n            { Kind: SymbolKind.Label } => \"label\",\n            { Kind: SymbolKind.Local } => \"local\",\n            { Kind: SymbolKind.Namespace } => \"namespace\",\n            { Kind: SymbolKind.NetModule } => \"netmodule\",\n            { Kind: SymbolKind.PointerType } => \"pointer\",\n            { Kind: SymbolKind.Preprocessing } => \"preprocessing\",\n            { Kind: SymbolKind.Parameter } => \"parameter\",\n            { Kind: SymbolKind.RangeVariable } => \"range variable\",\n            { Kind: SymbolKind.Property } => \"property\",\n            { Kind: SymbolKind.TypeParameter } => \"type parameter\",\n            IMethodSymbol methodSymbol => methodSymbol switch\n            {\n                { MethodKind: MethodKind.BuiltinOperator or MethodKind.UserDefinedOperator or MethodKind.Conversion } => \"operator\",\n                { MethodKind: MethodKind.Constructor or MethodKind.StaticConstructor or MethodKind.SharedConstructor } => \"constructor\",\n                { MethodKind: MethodKind.Destructor } => \"destructor\",\n                { MethodKind: MethodKind.PropertyGet } => \"getter\",\n                { MethodKind: MethodKind.PropertySet } => \"setter\",\n                { MethodKind: MethodKindEx.LocalFunction } => \"local function\",\n                _ => \"method\",\n            },\n            INamedTypeSymbol namedTypeSymbol => namedTypeSymbol switch\n            {\n                { TypeKind: TypeKind.Array } => \"array\",\n                { TypeKind: TypeKind.Class } namedType => namedType.IsRecord() ? \"record\" : \"class\",\n                { TypeKind: TypeKind.Dynamic } => \"dynamic\",\n                { TypeKind: TypeKind.Delegate } => \"delegate\",\n                { TypeKind: TypeKind.Enum } => \"enum\",\n                { TypeKind: TypeKind.Error } => \"error\",\n                { TypeKind: TypeKindEx.FunctionPointer } => \"function pointer\",\n                { TypeKind: TypeKind.Interface } => \"interface\",\n                { TypeKind: TypeKind.Module } => \"module\",\n                { TypeKind: TypeKind.Pointer } => \"pointer\",\n                { TypeKind: TypeKind.Struct or TypeKind.Structure } namedType => namedType.IsRecord() ? \"record struct\" : \"struct\",\n                { TypeKind: TypeKind.Submission } => \"submission\",\n                { TypeKind: TypeKind.TypeParameter } => \"type parameter\",\n                { TypeKind: TypeKind.Unknown } => \"unknown\",\n#if DEBUG\n                _ => throw new NotSupportedException($\"symbol is of a not yet supported kind.\"),\n#else\n                _ => \"type\",\n#endif\n            },\n#if DEBUG\n            _ => throw new NotSupportedException($\"symbol is of a not yet supported kind.\"),\n#else\n                _ => \"symbol\",\n#endif\n        };\n\n    public static bool IsSerializableMember(this ISymbol symbol) =>\n        symbol is IFieldSymbol or IPropertySymbol { SetMethod: not null }\n        && symbol.ContainingType.GetAttributes().Any(x => x.AttributeClass.Is(KnownType.System_SerializableAttribute))\n        && !symbol.GetAttributes().Any(x => x.AttributeClass.Is(KnownType.System_NonSerializedAttribute));\n\n    public static bool IsAnyAttributeInOverridingChain<TSymbol>(this TSymbol symbol, Func<TSymbol, TSymbol> overriddenMember)\n        where TSymbol : class, ISymbol\n    {\n        var currentSymbol = symbol;\n        while (currentSymbol is not null)\n        {\n            if (currentSymbol.GetAttributes().Any())\n            {\n                return true;\n            }\n            if (!currentSymbol.IsOverride)\n            {\n                return false;\n            }\n            currentSymbol = overriddenMember(currentSymbol);\n        }\n        return false;\n    }\n\n    /// <summary>\n    /// Retrieves all parts of a symbol. For partial methods or properties, both the definition and implementation parts are included. For other symbols, the symbol itself is returned.\n    /// </summary>\n    public static IEnumerable<ISymbol> AllPartialParts(this ISymbol symbol)\n    {\n        switch (symbol)\n        {\n            case IMethodSymbol method:\n                yield return method;\n                if (method.PartialImplementationPart is { } implementation)\n                {\n                    yield return implementation;\n                }\n                else if (method.PartialDefinitionPart is { } definition)\n                {\n                    yield return definition;\n                }\n                break;\n            case IPropertySymbol property:\n                yield return property;\n                if (property.PartialImplementationPart() is { } propertyImplementation)\n                {\n                    yield return propertyImplementation;\n                }\n                else if (property.PartialDefinitionPart() is { } propertyDefinition)\n                {\n                    yield return propertyDefinition;\n                }\n                break;\n            default:\n                yield return symbol;\n                break;\n        }\n    }\n\n    private static bool CanBeInterfaceMember(ISymbol symbol) =>\n        symbol.Kind == SymbolKind.Method\n        || symbol.Kind == SymbolKind.Property\n        || symbol.Kind == SymbolKind.Event;\n\n    // https://docs.microsoft.com/dotnet/api/microsoft.validatednotnullattribute\n    // https://docs.microsoft.com/dotnet/csharp/language-reference/attributes/nullable-analysis#postconditions-maybenull-and-notnull\n    // https://www.jetbrains.com/help/resharper/Reference__Code_Annotation_Attributes.html#NotNullAttribute\n    private static bool IsNotNullAttribute(AttributeData attribute) =>\n        attribute.HasAnyName(\"ValidatedNotNullAttribute\", \"NotNullAttribute\");\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Semantics/Extensions/ITypeParameterSymbolExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Semantics.Extensions;\n\ninternal static class ITypeParameterSymbolExtensions\n{\n    public static bool HasAnyConstraint(this ITypeParameterSymbol typeParameter) =>\n        typeParameter.HasConstructorConstraint\n        || typeParameter.HasReferenceTypeConstraint\n        || typeParameter.HasValueTypeConstraint\n        || !typeParameter.ConstraintTypes.IsEmpty\n        || typeParameter.HasUnmanagedTypeConstraint();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Semantics/Extensions/ITypeSymbolExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Reflection;\n\nnamespace SonarAnalyzer.Core.Semantics.Extensions;\n\npublic static class ITypeSymbolExtensions\n{\n    private static readonly PropertyInfo ITypeSymbolIsRecord = typeof(ITypeSymbol).GetProperty(\"IsRecord\");\n\n    public static bool IsInterface(this ITypeSymbol self) =>\n        self is { TypeKind: TypeKind.Interface };\n\n    public static bool IsClass(this ITypeSymbol self) =>\n        self is { TypeKind: TypeKind.Class };\n\n    public static bool IsStruct(this ITypeSymbol self) =>\n        self switch\n        {\n            { TypeKind: TypeKind.Struct } => true,\n            ITypeParameterSymbol { IsValueType: true } => true,\n            _ => false,\n        };\n\n    public static bool IsClassOrStruct(this ITypeSymbol self) =>\n        self.IsStruct() || self.IsClass();\n\n    public static bool IsNullableValueType(this ITypeSymbol self) =>\n        self.IsStruct() && self is { SpecialType: SpecialType.System_Nullable_T } or { OriginalDefinition.SpecialType: SpecialType.System_Nullable_T };\n\n    public static bool IsNonNullableValueType(this ITypeSymbol self) =>\n        self.IsStruct() && !self.IsNullableValueType();\n\n    public static bool IsEnum(this ITypeSymbol self) =>\n        self switch\n        {\n            { TypeKind: TypeKind.Enum } => true,\n            ITypeParameterSymbol { HasReferenceTypeConstraint: false, ConstraintTypes: { IsEmpty: false } constraintTypes } => constraintTypes.Any(x => x.SpecialType == SpecialType.System_Enum),\n            _ => false,\n        };\n\n    public static bool CanBeNull(this ITypeSymbol self) =>\n        self is { IsReferenceType: true } || self.IsNullableValueType();\n\n    public static bool Is(this ITypeSymbol self, TypeKind typeKind) =>\n        self?.TypeKind == typeKind;\n\n    public static bool Is(this ITypeSymbol typeSymbol, KnownType type) =>\n        typeSymbol is not null && type.Matches(typeSymbol);\n\n    public static bool IsAny(this ITypeSymbol typeSymbol, params KnownType[] types)\n    {\n        if (typeSymbol is null)\n        {\n            return false;\n        }\n\n        // For is twice as fast as foreach on ImmutableArray so don't use Linq here\n        for (var i = 0; i < types.Length; i++)\n        {\n            if (types[i].Matches(typeSymbol))\n            {\n                return true;\n            }\n        }\n\n        return false;\n    }\n\n    public static bool IsAny(this ITypeSymbol typeSymbol, ImmutableArray<KnownType> types)\n    {\n        if (typeSymbol is null)\n        {\n            return false;\n        }\n\n        // For is twice as fast as foreach on ImmutableArray so don't use Linq here\n        for (var i = 0; i < types.Length; i++)\n        {\n            if (types[i].Matches(typeSymbol))\n            {\n                return true;\n            }\n        }\n\n        return false;\n    }\n\n    public static bool IsNullableOfAny(this ITypeSymbol type, ImmutableArray<KnownType> argumentTypes) =>\n        NullableTypeArgument(type).IsAny(argumentTypes);\n\n    public static bool IsNullableOf(this ITypeSymbol type, KnownType typeArgument) =>\n        NullableTypeArgument(type).Is(typeArgument);\n\n    public static bool IsNullableBoolean(this ITypeSymbol type) =>\n        type.IsNullableOf(KnownType.System_Boolean);\n\n    public static bool Implements(this ITypeSymbol typeSymbol, KnownType type) =>\n        typeSymbol is not null\n        && typeSymbol.AllInterfaces.Any(x => x.ConstructedFrom.Is(type));\n\n    public static bool ImplementsAny(this ITypeSymbol typeSymbol, ImmutableArray<KnownType> types) =>\n        typeSymbol is not null\n        && typeSymbol.AllInterfaces.Any(x => x.ConstructedFrom.IsAny(types));\n\n    public static bool DerivesFrom(this ITypeSymbol typeSymbol, KnownType type)\n    {\n        var currentType = typeSymbol;\n        while (currentType is not null)\n        {\n            if (currentType.Is(type))\n            {\n                return true;\n            }\n            currentType = currentType.BaseType?.ConstructedFrom;\n        }\n\n        return false;\n    }\n\n    public static bool DerivesFrom(this ITypeSymbol typeSymbol, ITypeSymbol type)\n    {\n        var currentType = typeSymbol;\n        while (currentType is not null)\n        {\n            if (currentType.Equals(type) || (currentType is INamedTypeSymbol { ConstructedFrom: { } constructedFrom } && constructedFrom.Equals(type)))\n            {\n                return true;\n            }\n            currentType = currentType.BaseType?.ConstructedFrom;\n        }\n\n        return false;\n    }\n\n    public static bool DerivesFromAny(this ITypeSymbol typeSymbol, ImmutableArray<KnownType> baseTypes)\n    {\n        var currentType = typeSymbol;\n        while (currentType is not null)\n        {\n            if (currentType.IsAny(baseTypes))\n            {\n                return true;\n            }\n            currentType = currentType.BaseType?.ConstructedFrom;\n        }\n\n        return false;\n    }\n\n    public static bool DerivesOrImplements(this ITypeSymbol type, KnownType baseType) =>\n        type.Implements(baseType) || type.DerivesFrom(baseType);\n\n    public static bool DerivesOrImplements(this ITypeSymbol type, ITypeSymbol baseType) =>\n        type.Implements(baseType) || type.DerivesFrom(baseType);\n\n    public static bool DerivesOrImplementsAny(this ITypeSymbol type, ImmutableArray<KnownType> baseTypes) =>\n        type.ImplementsAny(baseTypes) || type.DerivesFromAny(baseTypes);\n\n    public static ITypeSymbol GetSymbolType(this ISymbol symbol) =>\n        symbol switch\n        {\n            ILocalSymbol x => x.Type,\n            IFieldSymbol x => x.Type,\n            IPropertySymbol x => x.Type,\n            IParameterSymbol x => x.Type,\n            IAliasSymbol x => x.Target as ITypeSymbol,\n            IMethodSymbol { MethodKind: MethodKind.Constructor } x => x.ContainingType,\n            IMethodSymbol x => x.ReturnType,\n            ITypeSymbol x => x,\n            _ => null,\n        };\n\n    public static IEnumerable<INamedTypeSymbol> GetSelfAndBaseTypes(this ITypeSymbol type)\n    {\n        if (type is null)\n        {\n            yield break;\n        }\n\n        var currentType = type;\n        while (currentType?.Kind == SymbolKind.NamedType)\n        {\n            yield return (INamedTypeSymbol)currentType;\n            currentType = currentType.BaseType;\n        }\n    }\n\n    public static bool IsRecord(this ITypeSymbol typeSymbol) =>\n        ITypeSymbolIsRecord?.GetValue(typeSymbol) is true;\n\n    private static ITypeSymbol NullableTypeArgument(ITypeSymbol type) =>\n        type is INamedTypeSymbol namedType && namedType.OriginalDefinition.Is(KnownType.System_Nullable_T)\n            ? namedType.TypeArguments[0]\n            : null;\n\n    private static bool Implements(this ITypeSymbol typeSymbol, ISymbol type) =>\n        typeSymbol is not null\n        && typeSymbol.AllInterfaces.Any(x => type.IsDefinition ? x.OriginalDefinition.Equals(type) : x.Equals(type));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Semantics/Extensions/KnownAssemblyExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Semantics.Extensions;\n\ninternal static class KnownAssemblyExtensions\n{\n    internal static Func<AssemblyIdentity, bool> And(this Func<AssemblyIdentity, bool> @this, Func<AssemblyIdentity, bool> predicate) =>\n        x => @this(x) && predicate(x);\n\n    internal static Func<AssemblyIdentity, bool> Or(this Func<AssemblyIdentity, bool> @this, Func<AssemblyIdentity, bool> predicate) =>\n        x => @this(x) || predicate(x);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Semantics/Extensions/SemanticModelExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Semantics.Extensions;\n\npublic static class SemanticModelExtensions\n{\n    public static bool IsExtensionMethod(this SemanticModel model, SyntaxNode expression) =>\n        model.GetSymbolInfo(expression).Symbol is IMethodSymbol memberSymbol && memberSymbol.IsExtensionMethod;\n\n    public static SemanticModel SemanticModelOrDefault(this SyntaxTree tree, SemanticModel model)\n    {\n        // See https://github.com/dotnet/roslyn/issues/18730\n        if (tree == model.SyntaxTree)\n        {\n            return model;\n        }\n\n        return model.Compilation.ContainsSyntaxTree(tree)\n            ? model.Compilation.GetSemanticModel(tree)\n            : null;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Semantics/Extensions/SymbolInfoExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Semantics.Extensions;\n\npublic static class SymbolInfoExtensions\n{\n    /// <summary>\n    /// Returns the <see cref=\"SymbolInfo.Symbol\"/> or if no symbol could be found the <see cref=\"SymbolInfo.CandidateSymbols\"/>.\n    /// </summary>\n    public static IEnumerable<ISymbol> AllSymbols(this SymbolInfo symbolInfo) =>\n        symbolInfo.Symbol is null\n            ? symbolInfo.CandidateSymbols\n            : new[] { symbolInfo.Symbol };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Semantics/KnownAssembly.Predicates.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Semantics;\n\npublic sealed partial class KnownAssembly\n{\n    private const StringComparison AssemblyNameComparison = StringComparison.OrdinalIgnoreCase;\n\n    internal static class Predicates\n    {\n        internal static Func<AssemblyIdentity, bool> NameIs(string name) =>\n            x => x.Name.Equals(name, AssemblyNameComparison);\n\n        internal static Func<AssemblyIdentity, bool> StartsWith(string name) =>\n            x => x.Name.StartsWith(name, AssemblyNameComparison);\n\n        internal static Func<AssemblyIdentity, bool> EndsWith(string name) =>\n            x => x.Name.EndsWith(name, AssemblyNameComparison);\n\n        internal static Func<AssemblyIdentity, bool> Contains(string name) =>\n            x => x.Name.IndexOf(name, 0, AssemblyNameComparison) >= 0;\n\n        internal static Func<AssemblyIdentity, bool> VersionLowerThen(string version) =>\n            VersionLowerThen(Version.Parse(version));\n\n        internal static Func<AssemblyIdentity, bool> VersionLowerThen(Version version) =>\n            x => x.Version < version;\n\n        internal static Func<AssemblyIdentity, bool> VersionGreaterOrEqual(string version) =>\n            VersionGreaterOrEqual(Version.Parse(version));\n\n        internal static Func<AssemblyIdentity, bool> VersionGreaterOrEqual(Version version) =>\n            x => x.Version >= version;\n\n        internal static Func<AssemblyIdentity, bool> VersionBetween(string from, string to) =>\n            VersionBetween(Version.Parse(from), Version.Parse(to));\n\n        internal static Func<AssemblyIdentity, bool> VersionBetween(Version from, Version to) =>\n            x => x.Version >= from && x.Version <= to;\n\n        internal static Func<AssemblyIdentity, bool> OptionalPublicKeyTokenIs(string key) =>\n            x => !x.HasPublicKey || PublicKeyEqualHex(x, key);\n\n        internal static Func<AssemblyIdentity, bool> PublicKeyTokenIs(string key) =>\n            x => x.HasPublicKey && PublicKeyEqualHex(x, key);\n\n        internal static Func<AssemblyIdentity, bool> PublicKeyTokenIsAny(params string[] keys) =>\n            x => x.HasPublicKey && Array.Exists(keys, key => PublicKeyEqualHex(x, key));\n\n        internal static Func<AssemblyIdentity, bool> NameAndPublicKeyIs(string name, string key) =>\n            NameIs(name).And(PublicKeyTokenIs(key));\n\n        private static bool PublicKeyEqualHex(AssemblyIdentity identity, string hexString)\n        {\n            var normalizedHexString = hexString.Replace(\"-\", string.Empty);\n            return ArraysEqual(identity.PublicKeyToken.ToArray(), normalizedHexString) || ArraysEqual(identity.PublicKey.ToArray(), normalizedHexString);\n\n            static bool ArraysEqual(byte[] key, string hexString) =>\n                BitConverter.ToString(key).Replace(\"-\", string.Empty).Equals(hexString, StringComparison.OrdinalIgnoreCase);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Semantics/KnownAssembly.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing static SonarAnalyzer.Core.Semantics.KnownAssembly.Predicates;\n\nnamespace SonarAnalyzer.Core.Semantics;\n\npublic sealed partial class KnownAssembly\n{\n    private readonly Func<IEnumerable<AssemblyIdentity>, bool> predicate;\n\n    public static KnownAssembly XUnit_Assert { get; } = new(And(\n        NameIs(\"xunit.assert\")\n            .Or(NameIs(\"xunit\").And(VersionLowerThen(\"2.0\")))\n            .Or(NameIs(\"xunit.v3.assert\")),\n        PublicKeyTokenIs(\"8d05b1bb7a6fdb6c\")));\n\n    /// <summary>\n    /// Any MSTest framework either referenced via\n    /// <see href=\"https://www.nuget.org/packages/MicrosoftVisualStudioQualityToolsUnitTestFramework\">nuget.org/MicrosoftVisualStudioQualityToolsUnitTestFramework</see> (MSTest V1)\n    /// or <see href=\"https://www.nuget.org/packages/MSTest.TestFramework\">nuget.org/MSTest.TestFramework</see> (MSTest V2).\n    /// </summary>\n    public static KnownAssembly MSTest { get; } =\n        new(And(NameIs(\"Microsoft.VisualStudio.QualityTools.UnitTestFramework\").Or(NameIs(\"Microsoft.VisualStudio.TestPlatform.TestFramework\")),\n                PublicKeyTokenIs(\"b03f5f7f11d50a3a\")));\n\n    public static KnownAssembly NFluent { get; } = new(NameIs(\"NFluent\").And(OptionalPublicKeyTokenIs(\"18828b37b84b1437\")));\n    public static KnownAssembly FluentAssertions { get; } = new(NameAndPublicKeyIs(\"FluentAssertions\", \"33f2691a05b67b6a\"));\n    public static KnownAssembly NSubstitute { get; } = new(NameAndPublicKeyIs(\"NSubstitute\", \"92dd2e9066daa5ca\"));\n    // Logging assemblies\n    public static KnownAssembly MicrosoftExtensionsLoggingAbstractions { get; } = new(NameAndPublicKeyIs(\"Microsoft.Extensions.Logging.Abstractions\", \"adb9793829ddae60\"));\n    public static KnownAssembly Serilog { get; } = new(NameAndPublicKeyIs(\"Serilog\", \"24c2f752a8e58a10\"));\n    public static KnownAssembly MicrosoftAspNetCoreMvcCore { get; } = new(NameAndPublicKeyIs(\"Microsoft.AspNetCore.Mvc.Core\", \"adb9793829ddae60\"));\n    public static KnownAssembly SwashbuckleAspNetCoreSwagger { get; } = new(NameAndPublicKeyIs(\"Swashbuckle.AspNetCore.Swagger\", \"62657d7474907593\"));\n    public static KnownAssembly NLog { get; } = new(NameAndPublicKeyIs(\"NLog\", \"5120e14c03d0593c\"));\n    public static KnownAssembly Log4Net { get; } = new(NameIs(\"log4net\").And(PublicKeyTokenIsAny(\"669e0ddf0bb1aa2a\", \"1b44e1d426115821\")));\n    public static KnownAssembly CommonLoggingCore { get; } = new(NameAndPublicKeyIs(\"Common.Logging.Core\", \"af08829b84f0328e\"));\n    public static KnownAssembly CastleCore { get; } = new(NameAndPublicKeyIs(\"Castle.Core\", \"407dd0808d44fbdc\"));\n\n    internal KnownAssembly(Func<AssemblyIdentity, bool> predicate, params Func<AssemblyIdentity, bool>[] or)\n        : this(predicate is null || Array.Exists(or, x => x is null)\n              ? throw new ArgumentNullException(nameof(predicate), \"All predicates must be non-null.\")\n              : x => x.Any(y => predicate(y) || Array.Exists(or, orPredicate => orPredicate(y))))\n    { }\n\n    internal KnownAssembly(Func<IEnumerable<AssemblyIdentity>, bool> predicate) =>\n        this.predicate = predicate ?? throw new ArgumentNullException(nameof(predicate));\n\n    public bool IsReferencedBy(Compilation compilation) =>\n        predicate(compilation.ReferencedAssemblyNames);\n\n    internal static Func<AssemblyIdentity, bool> And(Func<AssemblyIdentity, bool> left, Func<AssemblyIdentity, bool> right) =>\n        KnownAssemblyExtensions.And(left, right);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Semantics/KnownMethods.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Semantics;\n\npublic static class KnownMethods\n{\n    private const int NumberOfParamsForBinaryOperator = 2;\n\n    /// <summary>\n    /// List of partial names that are assumed to indicate an assertion method.\n    /// </summary>\n    public static readonly ImmutableArray<string> AssertionMethodParts = ImmutableArray.Create(\n            \"ASSERT\",\n            \"CHECK\",\n            \"EXPECT\",\n            \"MUST\",\n            \"SHOULD\",\n            \"VERIFY\",\n            \"VALIDATE\");\n\n    public static bool IsMainMethod(this IMethodSymbol methodSymbol)\n    {\n        // Based on Microsoft definition: https://msdn.microsoft.com/en-us/library/1y814bzs.aspx\n        // Adding support for new async main: https://blogs.msdn.microsoft.com/mazhou/2017/05/30/c-7-series-part-2-async-main\n        return methodSymbol is not null\n            && methodSymbol.IsStatic\n            && methodSymbol.Name.Equals(\"Main\", StringComparison.OrdinalIgnoreCase) // VB.NET is case insensitive\n            && HasMainParameters()\n            && HasMainReturnType();\n\n        bool HasMainParameters() =>\n            methodSymbol.Parameters.Length == 0\n            || (methodSymbol.Parameters.Length == 1 && methodSymbol.Parameters[0].Type.Is(KnownType.System_String_Array));\n\n        bool HasMainReturnType() =>\n            methodSymbol.ReturnsVoid\n            || methodSymbol.ReturnType.IsAny(KnownType.System_Int32, KnownType.System_Threading_Tasks_Task)\n            || (methodSymbol.ReturnType.OriginalDefinition.Is(KnownType.System_Threading_Tasks_Task_T)\n                && ((methodSymbol.ReturnType as INamedTypeSymbol)?.TypeArguments.FirstOrDefault().Is(KnownType.System_Int32) ?? false));\n    }\n\n    public static bool IsObjectEquals(this IMethodSymbol methodSymbol) =>\n        methodSymbol is not null\n            && methodSymbol.MethodKind == MethodKind.Ordinary\n            && methodSymbol.Name == nameof(Equals)\n            && (methodSymbol.IsOverride || methodSymbol.IsInType(KnownType.System_Object))\n            && methodSymbol.Parameters.Length == 1\n            && methodSymbol.Parameters[0].Type.Is(KnownType.System_Object)\n            && methodSymbol.ReturnType.Is(KnownType.System_Boolean);\n\n    public static bool IsStaticObjectEquals(this IMethodSymbol methodSymbol)\n    {\n        return methodSymbol is not null\n            && !methodSymbol.IsOverride\n            && methodSymbol.IsStatic\n            && methodSymbol.MethodKind == MethodKind.Ordinary\n            && methodSymbol.Name == nameof(Equals)\n            && methodSymbol.IsInType(KnownType.System_Object)\n            && HasCorrectParameters()\n            && methodSymbol.ReturnType.Is(KnownType.System_Boolean);\n\n        bool HasCorrectParameters() =>\n            methodSymbol.Parameters.Length == 2\n            && methodSymbol.Parameters[0].Type.Is(KnownType.System_Object)\n            && methodSymbol.Parameters[1].Type.Is(KnownType.System_Object);\n    }\n\n    public static bool IsObjectGetHashCode(this IMethodSymbol methodSymbol) =>\n        methodSymbol is not null\n        && methodSymbol.MethodKind == MethodKind.Ordinary\n        && methodSymbol.Name == nameof(GetHashCode)\n        && (methodSymbol.IsOverride || methodSymbol.IsInType(KnownType.System_Object))\n        && methodSymbol.Parameters.Length == 0\n        && methodSymbol.ReturnType.Is(KnownType.System_Int32);\n\n    public static bool IsObjectToString(this IMethodSymbol methodSymbol) =>\n        methodSymbol is not null\n        && methodSymbol.MethodKind == MethodKind.Ordinary\n        && methodSymbol.Name == nameof(ToString)\n        && (methodSymbol.IsOverride || methodSymbol.IsInType(KnownType.System_Object))\n        && methodSymbol.Parameters.Length == 0\n        && methodSymbol.ReturnType.Is(KnownType.System_String);\n\n    // The Dispose method is either coming from System.IDisposable for classes and records or declared manually for ref struct types:\n    // https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-8.0/using#pattern-based-using\n    public static bool IsIDisposableDispose(this IMethodSymbol methodSymbol) =>\n        methodSymbol is\n        {\n            IsStatic: false,\n            Name: \"Dispose\" or \"System.IDisposable.Dispose\",\n            Arity: 0,\n            ReturnsVoid: true,\n            Parameters.Length: 0\n        }\n        && ((ContainingInterface(methodSymbol) is { } containingInterface && containingInterface.Is(KnownType.System_IDisposable))  // class/record implementing System.IDisposable\n            || (methodSymbol.ContainingType is { IsValueType: true } && methodSymbol.ContainingType.IsRefLikeType()));              // or a ref struct type\n\n    public static bool IsIAsyncDisposableDisposeAsync(this IMethodSymbol methodSymbol) =>\n        methodSymbol is\n        {\n            IsStatic: false,\n            Name: \"DisposeAsync\" or \"System.IAsyncDisposable.DisposeAsync\",\n            Arity: 0,\n            Parameters.Length: 0\n        }\n        && methodSymbol.ReturnType.Is(KnownType.System_Threading_Tasks_ValueTask)\n        && ContainingInterface(methodSymbol) is { } containingInterface\n        && containingInterface.Is(KnownType.System_IAsyncDisposable);\n\n    public static bool IsGetObjectData(this IMethodSymbol methodSymbol)\n    {\n        const string explicitName = \"System.Runtime.Serialization.ISerializable.GetObjectData\";\n        return methodSymbol is not null\n            && (methodSymbol.Name == \"GetObjectData\" || methodSymbol.Name == explicitName)\n            && methodSymbol.Parameters.Length == 2\n            && methodSymbol.Parameters[0].Type.Is(KnownType.System_Runtime_Serialization_SerializationInfo)\n            && methodSymbol.Parameters[1].Type.Is(KnownType.System_Runtime_Serialization_StreamingContext)\n            && methodSymbol.ReturnsVoid;\n    }\n\n    public static bool IsSerializationConstructor(this IMethodSymbol methodSymbol) =>\n        methodSymbol is not null\n        && methodSymbol.MethodKind == MethodKind.Constructor\n        && methodSymbol.Parameters.Length == 2\n        && methodSymbol.Parameters[0].Type.Is(KnownType.System_Runtime_Serialization_SerializationInfo)\n        && methodSymbol.Parameters[1].Type.Is(KnownType.System_Runtime_Serialization_StreamingContext);\n\n    public static bool IsArrayClone(this IMethodSymbol methodSymbol) =>\n        methodSymbol is not null\n        && methodSymbol.MethodKind == MethodKind.Ordinary\n        && methodSymbol.Name == nameof(Array.Clone)\n        && methodSymbol.Parameters.Length == 0\n        && methodSymbol.ContainingType.Is(KnownType.System_Array);\n\n    public static bool IsRecordPrintMembers(this IMethodSymbol methodSymbol) =>\n        methodSymbol is\n        {\n            MethodKind: MethodKind.Ordinary,\n            Name: \"PrintMembers\",\n            ReturnType.SpecialType: SpecialType.System_Boolean,\n            Parameters.Length: 1,\n        }\n        && methodSymbol.Parameters[0].Type.Is(KnownType.System_Text_StringBuilder)\n        && methodSymbol.ContainingType.IsRecord();\n\n    public static bool IsGcSuppressFinalize(this IMethodSymbol methodSymbol) =>\n        methodSymbol is not null\n        && methodSymbol.Name == nameof(GC.SuppressFinalize)\n        && methodSymbol.Parameters.Length == 1\n        && methodSymbol.ContainingType.Is(KnownType.System_GC);\n\n    public static bool IsDebugAssert(this IMethodSymbol methodSymbol) =>\n        methodSymbol is not null\n        && methodSymbol.Name == nameof(Debug.Assert)\n        && methodSymbol.ContainingType.Is(KnownType.System_Diagnostics_Debug);\n\n    public static bool IsDiagnosticDebugMethod(this IMethodSymbol methodSymbol) =>\n        methodSymbol is not null && methodSymbol.ContainingType.Is(KnownType.System_Diagnostics_Debug);\n\n    public static bool IsOperatorBinaryPlus(this IMethodSymbol methodSymbol) =>\n        methodSymbol is { MethodKind: MethodKind.BuiltinOperator or MethodKind.UserDefinedOperator, Name: \"op_Addition\", Parameters.Length: NumberOfParamsForBinaryOperator };\n\n    public static bool IsOperatorBinaryMinus(this IMethodSymbol methodSymbol) =>\n        methodSymbol is { MethodKind: MethodKind.BuiltinOperator or MethodKind.UserDefinedOperator, Name: \"op_Subtraction\", Parameters.Length: NumberOfParamsForBinaryOperator };\n\n    public static bool IsOperatorBinaryMultiply(this IMethodSymbol methodSymbol) =>\n        methodSymbol is { MethodKind: MethodKind.BuiltinOperator or MethodKind.UserDefinedOperator, Name: \"op_Multiply\", Parameters.Length: NumberOfParamsForBinaryOperator };\n\n    public static bool IsOperatorBinaryDivide(this IMethodSymbol methodSymbol) =>\n        methodSymbol is { MethodKind: MethodKind.BuiltinOperator or MethodKind.UserDefinedOperator, Name: \"op_Division\", Parameters.Length: NumberOfParamsForBinaryOperator };\n\n    public static bool IsOperatorBinaryModulus(this IMethodSymbol methodSymbol) =>\n        methodSymbol is { MethodKind: MethodKind.BuiltinOperator or MethodKind.UserDefinedOperator, Name: \"op_Modulus\", Parameters.Length: NumberOfParamsForBinaryOperator };\n\n    public static bool IsOperatorEquals(this IMethodSymbol methodSymbol) =>\n        methodSymbol is { MethodKind: MethodKind.BuiltinOperator or MethodKind.UserDefinedOperator, Name: \"op_Equality\", Parameters.Length: NumberOfParamsForBinaryOperator };\n\n    public static bool IsOperatorNotEquals(this IMethodSymbol methodSymbol) =>\n        methodSymbol is { MethodKind: MethodKind.BuiltinOperator or MethodKind.UserDefinedOperator, Name: \"op_Inequality\", Parameters.Length: NumberOfParamsForBinaryOperator };\n\n    public static bool IsConsoleWriteLine(this IMethodSymbol methodSymbol) =>\n        methodSymbol is not null\n        && methodSymbol.Name == nameof(Console.WriteLine)\n        && methodSymbol.IsInType(KnownType.System_Console);\n\n    public static bool IsConsoleWrite(this IMethodSymbol methodSymbol) =>\n        methodSymbol is not null\n        && methodSymbol.Name == nameof(Console.Write)\n        && methodSymbol.IsInType(KnownType.System_Console);\n\n    public static bool IsEnumerableConcat(this IMethodSymbol methodSymbol) =>\n        methodSymbol.IsEnumerableMethod(nameof(Enumerable.Concat), 2);\n\n    public static bool IsEnumerableCount(this IMethodSymbol methodSymbol) =>\n        methodSymbol.IsEnumerableMethod(nameof(Enumerable.Count), 1, 2);\n\n    public static bool IsEnumerableExcept(this IMethodSymbol methodSymbol) =>\n        methodSymbol.IsEnumerableMethod(nameof(Enumerable.Except), 2, 3);\n\n    public static bool IsEnumerableIntersect(this IMethodSymbol methodSymbol) =>\n        methodSymbol.IsEnumerableMethod(nameof(Enumerable.Intersect), 2, 3);\n\n    public static bool IsEnumerableSequenceEqual(this IMethodSymbol methodSymbol) =>\n        methodSymbol.IsEnumerableMethod(nameof(Enumerable.SequenceEqual), 2, 3);\n\n    public static bool IsEnumerableToList(this IMethodSymbol methodSymbol) =>\n        methodSymbol.IsEnumerableMethod(nameof(Enumerable.ToList), 1);\n\n    public static bool IsEnumerableToArray(this IMethodSymbol methodSymbol) =>\n        methodSymbol.IsEnumerableMethod(nameof(Enumerable.ToArray), 1);\n\n    public static bool IsEnumerableUnion(this IMethodSymbol methodSymbol) =>\n        methodSymbol.IsEnumerableMethod(nameof(Enumerable.Union), 2, 3);\n\n    public static bool IsListAddRange(this IMethodSymbol methodSymbol) =>\n        methodSymbol is not null\n        && methodSymbol.Name == \"AddRange\"\n        && methodSymbol.MethodKind == MethodKind.Ordinary\n        && methodSymbol.Parameters.Length == 1\n        && methodSymbol.ContainingType.ConstructedFrom.Is(KnownType.System_Collections_Generic_List_T);\n\n    public static bool IsEventHandler(this IMethodSymbol methodSymbol) =>\n        methodSymbol is { Parameters.Length: 2 }\n        && (// Inheritance from EventArgs is not enough for UWP or Xamarin as it uses other kind of event args (e.g. ILeavingBackgroundEventArgs)\n            methodSymbol.Parameters[1].Type.Name.EndsWith(\"EventArgs\", StringComparison.Ordinal)\n            || methodSymbol.Parameters[1].Type.DerivesFrom(KnownType.System_EventArgs))\n        && (methodSymbol.ReturnsVoid\n            // The ResolveEventHandler violates the https://learn.microsoft.com/en-us/dotnet/csharp/event-pattern#event-delegate-signatures\n            // The ResolveEventHandler dates back to .Net1.1, is present in most runtimes and needs to be supported as an exception to the rule\n            // https://github.com/SonarSource/sonar-dotnet/issues/8371\n            // https://learn.microsoft.com/dotnet/api/system.resolveeventhandler\n            || methodSymbol.ReturnType.Is(KnownType.System_Reflection_Assembly));\n\n    private static bool IsEnumerableMethod(this IMethodSymbol methodSymbol, string methodName, params int[] parametersCount) =>\n        methodSymbol is not null\n        && methodSymbol.Name == methodName\n        && Array.Exists(parametersCount, methodSymbol.HasExactlyNParameters)\n        && methodSymbol.ContainingType.Is(KnownType.System_Linq_Enumerable);\n\n    private static bool HasExactlyNParameters(this IMethodSymbol methodSymbol, int parametersCount) =>\n        (methodSymbol.MethodKind == MethodKind.Ordinary && methodSymbol.Parameters.Length == parametersCount)\n        || (methodSymbol.MethodKind == MethodKind.ReducedExtension && methodSymbol.Parameters.Length == parametersCount - 1);\n\n    private static INamedTypeSymbol ContainingInterface(IMethodSymbol symbol)\n    {\n        if (symbol.InterfaceMembers().FirstOrDefault() is { } interfaceMember)\n        {\n            return interfaceMember.ContainingType;\n        }\n        else if (symbol.ContainingType.IsInterface())\n        {\n            return symbol.ContainingType;\n        }\n        else\n        {\n            return null;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Semantics/KnownType.Implementation.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text;\n\nnamespace SonarAnalyzer.Core.Semantics;\n\n[DebuggerDisplay(\"{DebuggerDisplay}\")]\npublic sealed partial class KnownType\n{\n    private readonly string[] parts;\n    private readonly string[] genericParameters;\n    private readonly int parentClassCount;\n\n    public string TypeName { get; }\n    public string FullName { get; }\n    public bool IsArray { get; init; }\n    public IReadOnlyList<string> GenericParameters => genericParameters;\n    public string MetadataName => $\"{FullName}{(GenericParameters.Any() ? $\"`{GenericParameters.Count}\" : string.Empty)}\";\n\n    internal string DebuggerDisplay\n    {\n        get\n        {\n            var sb = new StringBuilder(FullName);\n            if (genericParameters.Length > 0)\n            {\n                sb.Append('<').Append(genericParameters.JoinStr(\", \")).Append('>');\n            }\n            if (IsArray)\n            {\n                sb.Append(\"[]\");\n            }\n            return sb.ToString();\n        }\n    }\n\n    public KnownType(string fullName, params string[] genericParameters)\n    {\n        parts = fullName.Split('.', '+');\n        parentClassCount = fullName.Count(x => x == '+');\n        if (parentClassCount > 0 && fullName.LastIndexOf('.') > fullName.LastIndexOf('+'))\n        {\n            throw new ArgumentException($\"Invalid type name '{fullName}'. It should not contain '.' after the nested type '+'.\");\n        }\n        this.genericParameters = genericParameters;\n        FullName = fullName;\n        TypeName = parts[parts.Length - 1];\n    }\n\n    public bool Matches(ITypeSymbol symbol) =>\n        IsMatch(symbol) || IsMatch(symbol.OriginalDefinition);\n\n    private bool IsMatch(ITypeSymbol symbol)\n    {\n        _ = symbol ?? throw new ArgumentNullException(nameof(symbol));\n        if (IsArray)\n        {\n            if (symbol is IArrayTypeSymbol array)\n            {\n                symbol = array.ElementType;\n            }\n            else\n            {\n                return false;\n            }\n        }\n\n        return symbol.Name == TypeName\n            && OuterClassMatches(symbol)\n            && NamespaceMatches(symbol)\n            && GenericParametersMatch(symbol);\n    }\n\n    private bool GenericParametersMatch(ISymbol symbol) =>\n        symbol is INamedTypeSymbol namedType\n            ? namedType.TypeParameters.Select(x => x.Name).SequenceEqual(genericParameters)\n            : genericParameters.Length == 0;\n\n    private bool OuterClassMatches(ISymbol symbol)\n    {\n        var index = parts.Length - 1;\n        while (symbol.ContainingType is not null && index > 0)\n        {\n            index--;    // First visit skips the TypeName itself\n            symbol = symbol.ContainingType;\n            if (symbol.Name != parts[index])\n            {\n                return false;\n            }\n        }\n        return index == parts.Length - 1 - parentClassCount;\n    }\n\n    private bool NamespaceMatches(ISymbol symbol)\n    {\n        var currentNamespace = symbol.ContainingNamespace;\n        var index = parts.Length - parentClassCount - 2;\n        while (currentNamespace is not null && !string.IsNullOrEmpty(currentNamespace.Name) && index >= 0)\n        {\n            if (currentNamespace.Name != parts[index])\n            {\n                return false;\n            }\n\n            currentNamespace = currentNamespace.ContainingNamespace;\n            index--;\n        }\n        return index == -1 && string.IsNullOrEmpty(currentNamespace?.Name);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Semantics/KnownType.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Semantics;\n\npublic sealed partial class KnownType\n{\n#pragma warning disable S103    // Lines should not be too long\n#pragma warning disable SA1310  // FieldNamesMustNotContainUnderscore\n#pragma warning disable SA1311  // Static readonly fields should begin with upper-case letter\n#pragma warning disable SA1307  // Field 'log4net_Config_XmlConfigurator' should begin with upper-case letter\n#pragma warning disable SA1304  // Non-private readonly fields should begin with upper-case letter\n#pragma warning disable T0016   // Empty lines between multiline declarations\n\n    public static readonly KnownType Azure_Messaging_ServiceBus_Administration_ServiceBusAdministrationClient = new(\"Azure.Messaging.ServiceBus.Administration.ServiceBusAdministrationClient\");\n    public static readonly KnownType Azure_Messaging_ServiceBus_ServiceBusClient = new(\"Azure.Messaging.ServiceBus.ServiceBusClient\");\n    public static readonly KnownType Azure_Storage_Blobs_BlobServiceClient = new(\"Azure.Storage.Blobs.BlobServiceClient\");\n    public static readonly KnownType Azure_Storage_Queues_QueueServiceClient = new(\"Azure.Storage.Queues.QueueServiceClient\");\n    public static readonly KnownType Azure_Storage_Files_Shares_ShareServiceClient = new(\"Azure.Storage.Files.Shares.ShareServiceClient\");\n    public static readonly KnownType Azure_Storage_Files_DataLake_DataLakeServiceClient = new(\"Azure.Storage.Files.DataLake.DataLakeServiceClient\");\n    public static readonly KnownType Azure_ResourceManager_ArmClient = new(\"Azure.ResourceManager.ArmClient\");\n    public static readonly KnownType Castle_Core_Logging_ILogger = new(\"Castle.Core.Logging.ILogger\");\n    public static readonly KnownType Common_Logging_ILog = new(\"Common.Logging.ILog\");\n    public static readonly KnownType Dapper_CommandDefinition = new(\"Dapper.CommandDefinition\");\n    public static readonly KnownType Dapper_DynamicParameters = new(\"Dapper.DynamicParameters\");\n    public static readonly KnownType Dapper_SqlMapper = new(\"Dapper.SqlMapper\");\n    public static readonly KnownType FluentAssertions_AssertionExtensions = new(\"FluentAssertions.AssertionExtensions\");\n    public static readonly KnownType FluentAssertions_Execution_AssertionScope = new(\"FluentAssertions.Execution.AssertionScope\");\n    public static readonly KnownType FluentAssertions_Primitives_ReferenceTypeAssertions = new(\"FluentAssertions.Primitives.ReferenceTypeAssertions\", \"TSubject\", \"TAssertions\");\n    public static readonly KnownType FluentValidation_IValidator = new(\"FluentValidation.IValidator\");\n    public static readonly KnownType FluentValidation_IValidator_T = new(\"FluentValidation.IValidator\", \"T\");\n    public static readonly KnownType FsCheck_NUnit_PropertyAttribute = new(\"FsCheck.NUnit.PropertyAttribute\");\n    public static readonly KnownType FsCheck_Xunit_PropertyAttribute = new(\"FsCheck.Xunit.PropertyAttribute\");\n    public static readonly KnownType JWT_Builder_JwtBuilder = new(\"JWT.Builder.JwtBuilder\");\n    public static readonly KnownType JWT_IJwtDecoder = new(\"JWT.IJwtDecoder\");\n    public static readonly KnownType JWT_JwtDecoderExtensions = new(\"JWT.JwtDecoderExtensions\");\n    public static readonly KnownType log4net_Config_BasicConfigurator = new(\"log4net.Config.BasicConfigurator\");\n    public static readonly KnownType log4net_Config_DOMConfigurator = new(\"log4net.Config.DOMConfigurator\");\n    public static readonly KnownType log4net_Config_XmlConfigurator = new(\"log4net.Config.XmlConfigurator\");\n    public static readonly KnownType log4net_Core_ILogger = new(\"log4net.Core.ILogger\");\n    public static readonly KnownType log4net_ILog = new(\"log4net.ILog\");\n    public static readonly KnownType log4net_LogManager = new(\"log4net.LogManager\");\n    public static readonly KnownType log4net_Util_ILogExtensions = new(\"log4net.Util.ILogExtensions\");\n    public static readonly KnownType Microsoft_AspNet_Identity_PasswordHasherOptions = new(\"Microsoft.AspNet.Identity.PasswordHasherOptions\");\n    public static readonly KnownType Microsoft_AspNet_SignalR_Hub = new(\"Microsoft.AspNet.SignalR.Hub\");\n    public static readonly KnownType Microsoft_AspNetCore_Builder_DeveloperExceptionPageExtensions = new(\"Microsoft.AspNetCore.Builder.DeveloperExceptionPageExtensions\");\n    public static readonly KnownType Microsoft_AspNetCore_Builder_DatabaseErrorPageExtensions = new(\"Microsoft.AspNetCore.Builder.DatabaseErrorPageExtensions\");\n    public static readonly KnownType Microsoft_AspNetCore_Components_Forms_IBrowserFile = new(\"Microsoft.AspNetCore.Components.Forms.IBrowserFile\");\n    public static readonly KnownType Microsoft_AspNetCore_Components_Forms_InputFileChangeEventArgs = new(\"Microsoft.AspNetCore.Components.Forms.InputFileChangeEventArgs\");\n    public static readonly KnownType Microsoft_AspNetCore_Components_ParameterAttribute = new(\"Microsoft.AspNetCore.Components.ParameterAttribute\");\n    public static readonly KnownType Microsoft_AspNetCore_Components_Rendering_RenderTreeBuilder = new(\"Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder\");\n    public static readonly KnownType Microsoft_AspNetCore_Components_RouteAttribute = new(\"Microsoft.AspNetCore.Components.RouteAttribute\");\n    public static readonly KnownType Microsoft_AspNetCore_Components_SupplyParameterFromQueryAttribute = new(\"Microsoft.AspNetCore.Components.SupplyParameterFromQueryAttribute\");\n    public static readonly KnownType Microsoft_AspNetCore_Cors_Infrastructure_CorsPolicyBuilder = new(\"Microsoft.AspNetCore.Cors.Infrastructure.CorsPolicyBuilder\");\n    public static readonly KnownType Microsoft_AspNetCore_Cryptography_KeyDerivation_KeyDerivation = new(\"Microsoft.AspNetCore.Cryptography.KeyDerivation.KeyDerivation\");\n    public static readonly KnownType Microsoft_AspNetCore_Hosting_HostingEnvironmentExtensions = new(\"Microsoft.AspNetCore.Hosting.HostingEnvironmentExtensions\");\n    public static readonly KnownType Microsoft_AspNetCore_Hosting_WebHostBuilderExtensions = new(\"Microsoft.AspNetCore.Hosting.WebHostBuilderExtensions\");\n    public static readonly KnownType Microsoft_AspNetCore_Http_CookieOptions = new(\"Microsoft.AspNetCore.Http.CookieOptions\");\n    public static readonly KnownType Microsoft_AspNetCore_Http_HeaderDictionaryExtensions = new(\"Microsoft.AspNetCore.Http.HeaderDictionaryExtensions\");\n    public static readonly KnownType Microsoft_AspNetCore_Http_HttpResponse = new(\"Microsoft.AspNetCore.Http.HttpResponse\");\n    public static readonly KnownType Microsoft_AspNetCore_Http_IFormCollection = new(\"Microsoft.AspNetCore.Http.IFormCollection\");\n    public static readonly KnownType Microsoft_AspNetCore_Http_IFormFile = new(\"Microsoft.AspNetCore.Http.IFormFile\");\n    public static readonly KnownType Microsoft_AspNetCore_Http_IFormFileCollection = new(\"Microsoft.AspNetCore.Http.IFormFileCollection\");\n    public static readonly KnownType Microsoft_AspNetCore_Http_IHeaderDictionary = new(\"Microsoft.AspNetCore.Http.IHeaderDictionary\");\n    public static readonly KnownType Microsoft_AspNetCore_Http_IQueryCollection = new(\"Microsoft.AspNetCore.Http.IQueryCollection\");\n    public static readonly KnownType Microsoft_AspNetCore_Http_IRequestCookieCollection = new(\"Microsoft.AspNetCore.Http.IRequestCookieCollection\");\n    public static readonly KnownType Microsoft_AspNetCore_Http_IResponseCookies = new(\"Microsoft.AspNetCore.Http.IResponseCookies\");\n    public static readonly KnownType Microsoft_AspNetCore_Http_IResult = new(\"Microsoft.AspNetCore.Http.IResult\");\n    public static readonly KnownType Microsoft_AspNetCore_Http_Results = new(\"Microsoft.AspNetCore.Http.Results\");\n    public static readonly KnownType Microsoft_AspNetCore_Identity_PasswordHasherOptions = new(\"Microsoft.AspNetCore.Identity.PasswordHasherOptions\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_AcceptVerbsAttribute = new(\"Microsoft.AspNetCore.Mvc.AcceptVerbsAttribute\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_ApiControllerAttribute = new(\"Microsoft.AspNetCore.Mvc.ApiControllerAttribute\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_ApiConventionMethodAttribute = new(\"Microsoft.AspNetCore.Mvc.ApiConventionMethodAttribute\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_ApiConventionTypeAttribute = new(\"Microsoft.AspNetCore.Mvc.ApiConventionTypeAttribute\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_ApiExplorerSettingsAttribute = new(\"Microsoft.AspNetCore.Mvc.ApiExplorerSettingsAttribute\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_Controller = new(\"Microsoft.AspNetCore.Mvc.Controller\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_ControllerBase = new(\"Microsoft.AspNetCore.Mvc.ControllerBase\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_ControllerAttribute = new(\"Microsoft.AspNetCore.Mvc.ControllerAttribute\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_DisableRequestSizeLimitAttribute = new(\"Microsoft.AspNetCore.Mvc.DisableRequestSizeLimitAttribute\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_Filters_ActionFilterAttribute = new(\"Microsoft.AspNetCore.Mvc.Filters.ActionFilterAttribute\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_Filters_IActionFilter = new(\"Microsoft.AspNetCore.Mvc.Filters.IActionFilter\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_Filters_IAsyncActionFilter = new(\"Microsoft.AspNetCore.Mvc.Filters.IAsyncActionFilter\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_FromServicesAttribute = new(\"Microsoft.AspNetCore.Mvc.FromServicesAttribute\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_HttpDeleteAttribute = new(\"Microsoft.AspNetCore.Mvc.HttpDeleteAttribute\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_HttpGetAttribute = new(\"Microsoft.AspNetCore.Mvc.HttpGetAttribute\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_HttpHeadAttribute = new(\"Microsoft.AspNetCore.Mvc.HttpHeadAttribute\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_HttpOptionsAttribute = new(\"Microsoft.AspNetCore.Mvc.HttpOptionsAttribute\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_HttpPatchAttribute = new(\"Microsoft.AspNetCore.Mvc.HttpPatchAttribute\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_HttpPostAttribute = new(\"Microsoft.AspNetCore.Mvc.HttpPostAttribute\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_HttpPutAttribute = new(\"Microsoft.AspNetCore.Mvc.HttpPutAttribute\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_IActionResult = new(\"Microsoft.AspNetCore.Mvc.IActionResult\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_IgnoreAntiforgeryTokenAttribute = new(\"Microsoft.AspNetCore.Mvc.IgnoreAntiforgeryTokenAttribute\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_Infrastructure_ActionResultObjectValueAttribute = new(\"Microsoft.AspNetCore.Mvc.Infrastructure.ActionResultObjectValueAttribute\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_ModelBinding_BindNeverAttribute = new(\"Microsoft.AspNetCore.Mvc.ModelBinding.BindNeverAttribute\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_ModelBinding_BindRequiredAttribute = new(\"Microsoft.AspNetCore.Mvc.ModelBinding.BindRequiredAttribute\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_ModelBinding_ModelStateDictionary = new(\"Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_ModelBinding_Validation_ValidateNeverAttribute = new(\"Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidateNeverAttribute\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_NonActionAttribute = new(\"Microsoft.AspNetCore.Mvc.NonActionAttribute\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_NonControllerAttribute = new(\"Microsoft.AspNetCore.Mvc.NonControllerAttribute\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_ObjectResult = new(\"Microsoft.AspNetCore.Mvc.ObjectResult\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_ProducesAttribute = new(\"Microsoft.AspNetCore.Mvc.ProducesAttribute\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_ProducesAttribute_T = new(\"Microsoft.AspNetCore.Mvc.ProducesAttribute\", \"T\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_ProducesResponseTypeAttribute = new(\"Microsoft.AspNetCore.Mvc.ProducesResponseTypeAttribute\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_ProducesResponseTypeAttribute_T = new(\"Microsoft.AspNetCore.Mvc.ProducesResponseTypeAttribute\", \"T\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_RazorPages_PageModel = new(\"Microsoft.AspNetCore.Mvc.RazorPages.PageModel\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_RequestFormLimitsAttribute = new(\"Microsoft.AspNetCore.Mvc.RequestFormLimitsAttribute\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_RequestSizeLimitAttribute = new(\"Microsoft.AspNetCore.Mvc.RequestSizeLimitAttribute\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_RouteAttribute = new(\"Microsoft.AspNetCore.Mvc.RouteAttribute\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_Routing_HttpMethodAttribute = new(\"Microsoft.AspNetCore.Mvc.Routing.HttpMethodAttribute\");\n    public static readonly KnownType Microsoft_AspNetCore_Mvc_Routing_IRouteTemplateProvider = new(\"Microsoft.AspNetCore.Mvc.Routing.IRouteTemplateProvider\");\n    public static readonly KnownType Microsoft_AspNetCore_Razor_Hosting_RazorCompiledItemAttribute = new(\"Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute\");\n    public static readonly KnownType Microsoft_AspNetCore_Routing_RouteValueDictionary = new(\"Microsoft.AspNetCore.Routing.RouteValueDictionary\");\n    public static readonly KnownType Microsoft_Azure_Cosmos_CosmosClient = new(\"Microsoft.Azure.Cosmos.CosmosClient\");\n    public static readonly KnownType Microsoft_Azure_Cosmos_Container = new(\"Microsoft.Azure.Cosmos.Container\");\n    public static readonly KnownType Microsoft_Azure_Cosmos_QueryDefinition = new(\"Microsoft.Azure.Cosmos.QueryDefinition\");\n    public static readonly KnownType Microsoft_Azure_Documents_Client_DocumentClient = new(\"Microsoft.Azure.Documents.Client.DocumentClient\");\n    public static readonly KnownType Microsoft_Azure_ServiceBus_Management_ManagementClient = new(\"Microsoft.Azure.ServiceBus.Management.ManagementClient\");\n    public static readonly KnownType Microsoft_Azure_ServiceBus_QueueClient = new(\"Microsoft.Azure.ServiceBus.QueueClient\");\n    public static readonly KnownType Microsoft_Azure_ServiceBus_SessionClient = new(\"Microsoft.Azure.ServiceBus.SessionClient\");\n    public static readonly KnownType Microsoft_Azure_ServiceBus_SubscriptionClient = new(\"Microsoft.Azure.ServiceBus.SubscriptionClient\");\n    public static readonly KnownType Microsoft_Azure_ServiceBus_TopicClient = new(\"Microsoft.Azure.ServiceBus.TopicClient\");\n    public static readonly KnownType Microsoft_Azure_WebJobs_Extensions_DurableTask_IDurableEntityClient = new(\"Microsoft.Azure.WebJobs.Extensions.DurableTask.IDurableEntityClient\");\n    public static readonly KnownType Microsoft_Azure_WebJobs_Extensions_DurableTask_IDurableEntityContext = new(\"Microsoft.Azure.WebJobs.Extensions.DurableTask.IDurableEntityContext\");\n    public static readonly KnownType Microsoft_Azure_WebJobs_Extensions_DurableTask_IDurableOrchestrationContext = new(\"Microsoft.Azure.WebJobs.Extensions.DurableTask.IDurableOrchestrationContext\");\n    public static readonly KnownType Microsoft_Azure_WebJobs_FunctionNameAttribute = new(\"Microsoft.Azure.WebJobs.FunctionNameAttribute\");\n    public static readonly KnownType Microsoft_CodeAnalysis_IMethodSymbol = new(\"Microsoft.CodeAnalysis.IMethodSymbol\");\n    public static readonly KnownType Microsoft_Data_Sqlite_SqliteCommand = new(\"Microsoft.Data.Sqlite.SqliteCommand\");\n    public static readonly KnownType Microsoft_EntityFramework_DbContext = new(\"System.Data.Entity.DbContext\");\n    public static readonly KnownType Microsoft_EntityFrameworkCore_DbContext = new(\"Microsoft.EntityFrameworkCore.DbContext\");\n    public static readonly KnownType Microsoft_EntityFrameworkCore_DbContextOptionsBuilder = new(\"Microsoft.EntityFrameworkCore.DbContextOptionsBuilder\");\n    public static readonly KnownType Microsoft_EntityFrameworkCore_DbSet_TEntity = new(\"Microsoft.EntityFrameworkCore.DbSet\", \"TEntity\");\n    public static readonly KnownType Microsoft_EntityFrameworkCore_EntityFrameworkQueryableExtensions = new(\"Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions\");\n    public static readonly KnownType Microsoft_EntityFrameworkCore_IDbContextFactory_TContext = new(\"Microsoft.EntityFrameworkCore.IDbContextFactory\", \"TContext\");\n    public static readonly KnownType Microsoft_EntityFrameworkCore_Migrations_Migration = new(\"Microsoft.EntityFrameworkCore.Migrations.Migration\");\n    public static readonly KnownType Microsoft_EntityFrameworkCore_MySQLDbContextOptionsExtensions = new(\"Microsoft.EntityFrameworkCore.MySQLDbContextOptionsExtensions\");\n    public static readonly KnownType Microsoft_EntityFrameworkCore_NpgsqlDbContextOptionsExtensions = new(\"Microsoft.EntityFrameworkCore.NpgsqlDbContextOptionsExtensions\");\n    public static readonly KnownType Microsoft_EntityFrameworkCore_NpgsqlDbContextOptionsBuilderExtensions = new(\"Microsoft.EntityFrameworkCore.NpgsqlDbContextOptionsBuilderExtensions\");\n    public static readonly KnownType Microsoft_EntityFrameworkCore_OracleDbContextOptionsExtensions = new(\"Microsoft.EntityFrameworkCore.OracleDbContextOptionsExtensions\");\n    public static readonly KnownType Microsoft_EntityFrameworkCore_RawSqlString = new(\"Microsoft.EntityFrameworkCore.RawSqlString\");\n    public static readonly KnownType Microsoft_EntityFrameworkCore_RelationalDatabaseFacadeExtensions = new(\"Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions\");\n    public static readonly KnownType Microsoft_EntityFrameworkCore_RelationalQueryableExtensions = new(\"Microsoft.EntityFrameworkCore.RelationalQueryableExtensions\");\n    public static readonly KnownType Microsoft_EntityFrameworkCore_SqliteDbContextOptionsBuilderExtensions = new(\"Microsoft.EntityFrameworkCore.SqliteDbContextOptionsBuilderExtensions\");\n    public static readonly KnownType Microsoft_EntityFrameworkCore_SqlServerDbContextOptionsExtensions = new(\"Microsoft.EntityFrameworkCore.SqlServerDbContextOptionsExtensions\");\n    public static readonly KnownType Microsoft_Extensions_DependencyInjection_LoggingServiceCollectionExtensions = new(\"Microsoft.Extensions.DependencyInjection.LoggingServiceCollectionExtensions\");\n    public static readonly KnownType Microsoft_Extensions_Hosting_HostEnvironmentEnvExtensions = new(\"Microsoft.Extensions.Hosting.HostEnvironmentEnvExtensions\");\n    public static readonly KnownType Microsoft_Extensions_Configuration_IConfiguration = new(\"Microsoft.Extensions.Configuration.IConfiguration\");\n    public static readonly KnownType Microsoft_Extensions_Logging_AzureAppServicesLoggerFactoryExtensions = new(\"Microsoft.Extensions.Logging.AzureAppServicesLoggerFactoryExtensions\");\n    public static readonly KnownType Microsoft_Extensions_Logging_ConsoleLoggerExtensions = new(\"Microsoft.Extensions.Logging.ConsoleLoggerExtensions\");\n    public static readonly KnownType Microsoft_Extensions_Logging_DebugLoggerFactoryExtensions = new(\"Microsoft.Extensions.Logging.DebugLoggerFactoryExtensions\");\n    public static readonly KnownType Microsoft_Extensions_Logging_EventLoggerFactoryExtensions = new(\"Microsoft.Extensions.Logging.EventLoggerFactoryExtensions\");\n    public static readonly KnownType Microsoft_Extensions_Logging_EventSourceLoggerFactoryExtensions = new(\"Microsoft.Extensions.Logging.EventSourceLoggerFactoryExtensions\");\n    public static readonly KnownType Microsoft_Extensions_Logging_EventId = new(\"Microsoft.Extensions.Logging.EventId\");\n    public static readonly KnownType Microsoft_Extensions_Logging_ILogger = new(\"Microsoft.Extensions.Logging.ILogger\");\n    public static readonly KnownType Microsoft_Extensions_Logging_ILogger_TCategoryName = new(\"Microsoft.Extensions.Logging.ILogger\", \"TCategoryName\");\n    public static readonly KnownType Microsoft_Extensions_Logging_ILoggerFactory = new(\"Microsoft.Extensions.Logging.ILoggerFactory\");\n    public static readonly KnownType Microsoft_Extensions_Logging_LoggerExtensions = new(\"Microsoft.Extensions.Logging.LoggerExtensions\");\n    public static readonly KnownType Microsoft_Extensions_Logging_LoggerFactoryExtensions = new(\"Microsoft.Extensions.Logging.LoggerFactoryExtensions\");\n    public static readonly KnownType Microsoft_Extensions_Logging_LogLevel = new(\"Microsoft.Extensions.Logging.LogLevel\");\n    public static readonly KnownType Microsoft_Extensions_Primitives_StringValues = new(\"Microsoft.Extensions.Primitives.StringValues\");\n    public static readonly KnownType Microsoft_IdentityModel_Tokens_SymmetricSecurityKey = new(\"Microsoft.IdentityModel.Tokens.SymmetricSecurityKey\");\n    public static readonly KnownType Microsoft_Net_Http_Headers_HeaderNames = new(\"Microsoft.Net.Http.Headers.HeaderNames\");\n    public static readonly KnownType Microsoft_JSInterop_JSInvokable = new(\"Microsoft.JSInterop.JSInvokableAttribute\");\n    public static readonly KnownType Microsoft_VisualBasic_Information = new(\"Microsoft.VisualBasic.Information\");\n    public static readonly KnownType Microsoft_VisualBasic_Interaction = new(\"Microsoft.VisualBasic.Interaction\");\n    public static readonly KnownType Microsoft_VisualStudio_TestTools_UnitTesting_Assert = new(\"Microsoft.VisualStudio.TestTools.UnitTesting.Assert\");\n    public static readonly KnownType Microsoft_VisualStudio_TestTools_UnitTesting_AssertFailedException = new(\"Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException\");\n    public static readonly KnownType Microsoft_VisualStudio_TestTools_UnitTesting_ExpectedExceptionBaseAttribute = new(\"Microsoft.VisualStudio.TestTools.UnitTesting.ExpectedExceptionBaseAttribute\");\n    public static readonly KnownType Microsoft_VisualStudio_TestTools_UnitTesting_ExpectedExceptionAttribute = new(\"Microsoft.VisualStudio.TestTools.UnitTesting.ExpectedExceptionAttribute\");\n    public static readonly KnownType Microsoft_VisualStudio_TestTools_UnitTesting_IgnoreAttribute = new(\"Microsoft.VisualStudio.TestTools.UnitTesting.IgnoreAttribute\");\n    public static readonly KnownType Microsoft_VisualStudio_TestTools_UnitTesting_TestClassAttribute = new(\"Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute\");\n    public static readonly KnownType Microsoft_VisualStudio_TestTools_UnitTesting_TestMethodAttribute = new(\"Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute\");\n    public static readonly KnownType Microsoft_VisualStudio_TestTools_UnitTesting_DataTestMethodAttribute = new(\"Microsoft.VisualStudio.TestTools.UnitTesting.DataTestMethodAttribute\");\n    public static readonly KnownType Microsoft_VisualStudio_TestTools_UnitTesting_WorkItemAttribute = new(\"Microsoft.VisualStudio.TestTools.UnitTesting.WorkItemAttribute\");\n    public static readonly KnownType Microsoft_VisualStudio_TestTools_UnitTesting_AssemblyCleanupAttribute = new(\"Microsoft.VisualStudio.TestTools.UnitTesting.AssemblyCleanupAttribute\");\n    public static readonly KnownType Microsoft_VisualStudio_TestTools_UnitTesting_AssemblyInitializeAttribute = new(\"Microsoft.VisualStudio.TestTools.UnitTesting.AssemblyInitializeAttribute\");\n    public static readonly KnownType Microsoft_VisualStudio_TestTools_UnitTesting_ClassCleanupAttribute = new(\"Microsoft.VisualStudio.TestTools.UnitTesting.ClassCleanupAttribute\");\n    public static readonly KnownType Microsoft_VisualStudio_TestTools_UnitTesting_ClassInitializeAttribute = new(\"Microsoft.VisualStudio.TestTools.UnitTesting.ClassInitializeAttribute\");\n    public static readonly KnownType Microsoft_VisualStudio_TestTools_UnitTesting_TestCleanupAttribute = new(\"Microsoft.VisualStudio.TestTools.UnitTesting.TestCleanupAttribute\");\n    public static readonly KnownType Microsoft_VisualStudio_TestTools_UnitTesting_TestInitializeAttribute = new(\"Microsoft.VisualStudio.TestTools.UnitTesting.TestInitializeAttribute\");\n    public static readonly KnownType Microsoft_Web_XmlTransform_XmlFileInfoDocument = new(\"Microsoft.Web.XmlTransform.XmlFileInfoDocument\");\n    public static readonly KnownType Microsoft_Web_XmlTransform_XmlTransformableDocument = new(\"Microsoft.Web.XmlTransform.XmlTransformableDocument\");\n    public static readonly KnownType MongoDB_Driver_IMongoCollectionExtensions = new(\"MongoDB.Driver.IMongoCollectionExtensions\");\n    public static readonly KnownType Mono_Data_Sqlite_SqliteCommand = new(\"Mono.Data.Sqlite.SqliteCommand\");\n    public static readonly KnownType Mono_Data_Sqlite_SqliteDataAdapter = new(\"Mono.Data.Sqlite.SqliteDataAdapter\");\n    public static readonly KnownType Mono_Unix_FileAccessPermissions = new(\"Mono.Unix.FileAccessPermissions\");\n    public static readonly KnownType MySql_Data_MySqlClient_MySqlDataAdapter = new(\"MySql.Data.MySqlClient.MySqlDataAdapter\");\n    public static readonly KnownType MySql_Data_MySqlClient_MySqlCommand = new(\"MySql.Data.MySqlClient.MySqlCommand\");\n    public static readonly KnownType MySql_Data_MySqlClient_MySqlHelper = new(\"MySql.Data.MySqlClient.MySqlHelper\");\n    public static readonly KnownType MySql_Data_MySqlClient_MySqlScript = new(\"MySql.Data.MySqlClient.MySqlScript\");\n    public static readonly KnownType Nancy_Cookies_NancyCookie = new(\"Nancy.Cookies.NancyCookie\");\n    public static readonly KnownType Nancy_NancyModule = new(\"Nancy.NancyModule\");\n    public static readonly KnownType NFluent_Check = new(\"NFluent.Check\");\n    public static readonly KnownType NFluent_FluentCheckException = new(\"NFluent.FluentCheckException\");\n    public static readonly KnownType NFluent_Kernel_FluentCheckException = new(\"NFluent.Kernel.FluentCheckException\");\n    public static readonly KnownType NHibernate_Cfg_Loquacious_NamedQueryDefinitionBuilder = new(\"NHibernate.Cfg.Loquacious.NamedQueryDefinitionBuilder\");\n    public static readonly KnownType NHibernate_Engine_NamedQueryDefinition = new(\"NHibernate.Engine.NamedQueryDefinition\");\n    public static readonly KnownType NHibernate_Engine_NamedSQLQueryDefinition = new(\"NHibernate.Engine.NamedSQLQueryDefinition\");\n    public static readonly KnownType NHibernate_ISession = new(\"NHibernate.ISession\");\n    public static readonly KnownType NHibernate_Impl_AbstractSessionImpl = new(\"NHibernate.Impl.AbstractSessionImpl\");\n    public static readonly KnownType NHibernate_Impl_QueryImpl = new(\"NHibernate.Impl.QueryImpl\");\n    public static readonly KnownType NLog_ILogger = new(\"NLog.ILogger\");\n    public static readonly KnownType NLog_ILoggerBase = new(\"NLog.ILoggerBase\");\n    public static readonly KnownType NLog_ILoggerExtensions = new(\"NLog.ILoggerExtensions\");\n    public static readonly KnownType NLog_LogLevel = new(\"NLog.LogLevel\");\n    public static readonly KnownType NLog_LogFactory = new(\"NLog.LogFactory\");\n    public static readonly KnownType NLog_LogManager = new(\"NLog.LogManager\");\n    public static readonly KnownType NLog_Logger = new(\"NLog.Logger\");\n    public static readonly KnownType Newtonsoft_Json_JsonPropertyAttribute = new(\"Newtonsoft.Json.JsonPropertyAttribute\");\n    public static readonly KnownType Newtonsoft_Json_JsonRequiredAttribute = new(\"Newtonsoft.Json.JsonRequiredAttribute\");\n    public static readonly KnownType Newtonsoft_Json_JsonIgnoreAttribute = new(\"Newtonsoft.Json.JsonIgnoreAttribute\");\n    public static readonly KnownType NUnit_Framework_Assert = new(\"NUnit.Framework.Assert\");\n    public static readonly KnownType NUnit_Framework_AssertionException = new(\"NUnit.Framework.AssertionException\");\n    public static readonly KnownType NUnit_Framework_Legacy_ClassicAssert = new(\"NUnit.Framework.Legacy.ClassicAssert\");\n    public static readonly KnownType NUnit_Framework_ExpectedExceptionAttribute = new(\"NUnit.Framework.ExpectedExceptionAttribute\");\n    public static readonly KnownType NUnit_Framework_IgnoreAttribute = new(\"NUnit.Framework.IgnoreAttribute\");\n    public static readonly KnownType NUnit_Framework_ITestBuilderInterface = new(\"NUnit.Framework.Interfaces.ITestBuilder\");\n    public static readonly KnownType NUnit_Framework_TestAttribute = new(\"NUnit.Framework.TestAttribute\");\n    public static readonly KnownType NUnit_Framework_TestCaseAttribute = new(\"NUnit.Framework.TestCaseAttribute\");\n    public static readonly KnownType NUnit_Framework_TestCaseSourceAttribute = new(\"NUnit.Framework.TestCaseSourceAttribute\");\n    public static readonly KnownType NUnit_Framework_TestFixtureAttribute = new(\"NUnit.Framework.TestFixtureAttribute\");\n    public static readonly KnownType NUnit_Framework_TheoryAttribute = new(\"NUnit.Framework.TheoryAttribute\");\n    public static readonly KnownType Oracle_ManagedDataAccess_Client_OracleCommand = new(\"Oracle.ManagedDataAccess.Client.OracleCommand\");\n    public static readonly KnownType Oracle_ManagedDataAccess_Client_OracleDataAdapter = new(\"Oracle.ManagedDataAccess.Client.OracleDataAdapter\");\n    public static readonly KnownType Org_BouncyCastle_Asn1_Nist_NistNamedCurves = new(\"Org.BouncyCastle.Asn1.Nist.NistNamedCurves\");\n    public static readonly KnownType Org_BouncyCastle_Asn1_Sec_SecNamedCurves = new(\"Org.BouncyCastle.Asn1.Sec.SecNamedCurves\");\n    public static readonly KnownType Org_BouncyCastle_Asn1_TeleTrust_TeleTrusTNamedCurves = new(\"Org.BouncyCastle.Asn1.TeleTrust.TeleTrusTNamedCurves\");\n    public static readonly KnownType Org_BouncyCastle_Asn1_X9_ECNamedCurveTable = new(\"Org.BouncyCastle.Asn1.X9.ECNamedCurveTable\");\n    public static readonly KnownType Org_BouncyCastle_Asn1_X9_X962NamedCurves = new(\"Org.BouncyCastle.Asn1.X9.X962NamedCurves\");\n    public static readonly KnownType Org_BouncyCastle_Crypto_Engines_AesFastEngine = new(\"Org.BouncyCastle.Crypto.Engines.AesFastEngine\");\n    public static readonly KnownType Org_BouncyCastle_Crypto_Generators_BCrypt = new(\"Org.BouncyCastle.Crypto.Generators.BCrypt\");\n    public static readonly KnownType Org_BouncyCastle_Crypto_Generators_SCrypt = new(\"Org.BouncyCastle.Crypto.Generators.SCrypt\");\n    public static readonly KnownType Org_BouncyCastle_Crypto_Generators_DHParametersGenerator = new(\"Org.BouncyCastle.Crypto.Generators.DHParametersGenerator\");\n    public static readonly KnownType Org_BouncyCastle_Crypto_Generators_OpenBsdBCrypt = new(\"Org.BouncyCastle.Crypto.Generators.OpenBsdBCrypt\");\n    public static readonly KnownType Org_BouncyCastle_Crypto_Generators_DsaParametersGenerator = new(\"Org.BouncyCastle.Crypto.Generators.DsaParametersGenerator\");\n    public static readonly KnownType Org_BouncyCastle_Crypto_Parameters_RsaKeyGenerationParameters = new(\"Org.BouncyCastle.Crypto.Parameters.RsaKeyGenerationParameters\");\n    public static readonly KnownType Org_BouncyCastle_Crypto_PbeParametersGenerator = new(\"Org.BouncyCastle.Crypto.PbeParametersGenerator\");\n    public static readonly KnownType Org_BouncyCastle_Crypto_Prng_DigestRandomGenerator = new(\"Org.BouncyCastle.Crypto.Prng.DigestRandomGenerator\");\n    public static readonly KnownType Org_BouncyCastle_Crypto_Prng_IRandomGenerator = new(\"Org.BouncyCastle.Crypto.Prng.IRandomGenerator\");\n    public static readonly KnownType Org_BouncyCastle_Crypto_Prng_VmpcRandomGenerator = new(\"Org.BouncyCastle.Crypto.Prng.VmpcRandomGenerator\");\n    public static readonly KnownType Org_BouncyCastle_Security_SecureRandom = new(\"Org.BouncyCastle.Security.SecureRandom\");\n    public static readonly KnownType Serilog_Events_LogEventLevel = new(\"Serilog.Events.LogEventLevel\");\n    public static readonly KnownType Serilog_ILogger = new(\"Serilog.ILogger\");\n    public static readonly KnownType Serilog_LoggerConfiguration = new(\"Serilog.LoggerConfiguration\");\n    public static readonly KnownType Serilog_Log = new(\"Serilog.Log\");\n    public static readonly KnownType ServiceStack_OrmLite_OrmLiteReadApi = new(\"ServiceStack.OrmLite.OrmLiteReadApi\");\n    public static readonly KnownType ServiceStack_OrmLite_OrmLiteReadApiAsync = new(\"ServiceStack.OrmLite.OrmLiteReadApiAsync\");\n    public static readonly KnownType System_Action = new(\"System.Action\");\n    public static readonly KnownType System_Action_T = new(\"System.Action\", \"T\");\n    public static readonly KnownType System_Action_T1_T2 = new(\"System.Action\", \"T1\", \"T2\");\n    public static readonly KnownType System_Action_T1_T2_T3 = new(\"System.Action\", \"T1\", \"T2\", \"T3\");\n    public static readonly KnownType System_Action_T1_T2_T3_T4 = new(\"System.Action\", \"T1\", \"T2\", \"T3\", \"T4\");\n    public static readonly KnownType System_Activator = new(\"System.Activator\");\n    public static readonly KnownType System_ApplicationException = new(\"System.ApplicationException\");\n    public static readonly KnownType System_AppDomain = new(\"System.AppDomain\");\n    public static readonly KnownType System_ArgumentException = new(\"System.ArgumentException\");\n    public static readonly KnownType System_ArgumentNullException = new(\"System.ArgumentNullException\");\n    public static readonly KnownType System_ArgumentOutOfRangeException = new(\"System.ArgumentOutOfRangeException\");\n    public static readonly KnownType System_Array = new(\"System.Array\");\n    public static readonly KnownType System_Attribute = new(\"System.Attribute\");\n    public static readonly KnownType System_AttributeUsageAttribute = new(\"System.AttributeUsageAttribute\");\n    public static readonly KnownType System_Boolean = new(\"System.Boolean\");\n    public static readonly KnownType System_Byte = new(\"System.Byte\");\n    public static readonly KnownType System_Byte_Array = new(\"System.Byte\") { IsArray = true };\n    public static readonly KnownType System_Char = new(\"System.Char\");\n    public static readonly KnownType System_Char_Array = new(\"System.Char\") { IsArray = true };\n    public static readonly KnownType System_Convert = new(\"System.Convert\");\n    public static readonly KnownType System_CLSCompliantAttribute = new(\"System.CLSCompliantAttribute\");\n    public static readonly KnownType System_CodeDom_Compiler_GeneratedCodeAttribute = new(\"System.CodeDom.Compiler.GeneratedCodeAttribute\");\n    public static readonly KnownType System_Collections_CollectionBase = new(\"System.Collections.CollectionBase\");\n    public static readonly KnownType System_Collections_Concurrent_BlockingCollection_T = new(\"System.Collections.Concurrent.BlockingCollection\", \"T\");\n    public static readonly KnownType System_Collections_Concurrent_ConcurrentDictionary_TKey_TValue = new(\"System.Collections.Concurrent.ConcurrentDictionary\", \"TKey\", \"TValue\");\n    public static readonly KnownType System_Collections_Concurrent_IProducerConsumerCollection_T = new(\"System.Collections.Concurrent.IProducerConsumerCollection\", \"T\");\n    public static readonly KnownType System_Collections_DictionaryBase = new(\"System.Collections.DictionaryBase\");\n    public static readonly KnownType System_Collections_Frozen_FrozenDictionary = new(\"System.Collections.Frozen.FrozenDictionary\");\n    public static readonly KnownType System_Collections_Frozen_FrozenDictionary_TKey_TValue = new(\"System.Collections.Frozen.FrozenDictionary\", \"TKey\", \"TValue\");\n    public static readonly KnownType System_Collections_Frozen_FrozenSet = new(\"System.Collections.Frozen.FrozenSet\");\n    public static readonly KnownType System_Collections_Frozen_FrozenSet_T = new(\"System.Collections.Frozen.FrozenSet\", \"T\");\n    public static readonly KnownType System_Collections_Generic_CollectionExtensions = new(\"System.Collections.Generic.CollectionExtensions\");\n    public static readonly KnownType System_Collections_Generic_Comparer_T = new(\"System.Collections.Generic.Comparer\", \"T\");\n    public static readonly KnownType System_Collections_Generic_Dictionary_TKey_TValue = new(\"System.Collections.Generic.Dictionary\", \"TKey\", \"TValue\");\n    public static readonly KnownType System_Collections_Generic_HashSet_T = new(\"System.Collections.Generic.HashSet\", \"T\");\n    public static readonly KnownType System_Collections_Generic_IAsyncEnumerable_T = new(\"System.Collections.Generic.IAsyncEnumerable\", \"T\");\n    public static readonly KnownType System_Collections_Generic_ICollection_T = new(\"System.Collections.Generic.ICollection\", \"T\");\n    public static readonly KnownType System_Collections_Generic_IComparer_T = new(\"System.Collections.Generic.IComparer\", \"T\");\n    public static readonly KnownType System_Collections_Generic_IDictionary_TKey_TValue = new(\"System.Collections.Generic.IDictionary\", \"TKey\", \"TValue\");\n    public static readonly KnownType System_Collections_Generic_IEnumerable_T = new(\"System.Collections.Generic.IEnumerable\", \"T\");\n    public static readonly KnownType System_Collections_Generic_IEqualityComparer_T = new(\"System.Collections.Generic.IEqualityComparer\", \"T\");\n    public static readonly KnownType System_Collections_Generic_IList_T = new(\"System.Collections.Generic.IList\", \"T\");\n    public static readonly KnownType System_Collections_Generic_IReadOnlyCollection_T = new(\"System.Collections.Generic.IReadOnlyCollection\", \"T\");\n    public static readonly KnownType System_Collections_Generic_IReadOnlyList_T = new(\"System.Collections.Generic.IReadOnlyList\", \"T\");\n    public static readonly KnownType System_Collections_Generic_ISet_T = new(\"System.Collections.Generic.ISet\", \"T\");\n    public static readonly KnownType System_Collections_Generic_KeyValuePair_TKey_TValue = new(\"System.Collections.Generic.KeyValuePair\", \"TKey\", \"TValue\");\n    public static readonly KnownType System_Collections_Generic_List_T = new(\"System.Collections.Generic.List\", \"T\");\n    public static readonly KnownType System_Collections_Generic_Queue_T = new(\"System.Collections.Generic.Queue\", \"T\");\n    public static readonly KnownType System_Collections_Generic_SortedDictionary_TKey_TValue = new(\"System.Collections.Generic.SortedDictionary\", \"TKey\", \"TValue\");\n    public static readonly KnownType System_Collections_Generic_SortedList_TKey_TValue = new(\"System.Collections.Generic.SortedList\", \"TKey\", \"TValue\");\n    public static readonly KnownType System_Collections_Generic_SortedSet_T = new(\"System.Collections.Generic.SortedSet\", \"T\");\n    public static readonly KnownType System_Collections_Generic_Stack_T = new(\"System.Collections.Generic.Stack\", \"T\");\n    public static readonly KnownType System_Collections_Generic_LinkedList_T = new(\"System.Collections.Generic.LinkedList\", \"T\");\n    public static readonly KnownType System_Collections_Generic_OrderedDictionary_TKey_TValue = new(\"System.Collections.Generic.OrderedDictionary\", \"TKey\", \"TValue\");\n    public static readonly KnownType System_Collections_ICollection = new(\"System.Collections.ICollection\");\n    public static readonly KnownType System_Collections_IEnumerable = new(\"System.Collections.IEnumerable\");\n    public static readonly KnownType System_Collections_IEnumerator = new(\"System.Collections.IEnumerator\");\n    public static readonly KnownType System_Collections_IList = new(\"System.Collections.IList\");\n    public static readonly KnownType System_Collections_Immutable_IImmutableDictionary_TKey_TValue = new(\"System.Collections.Immutable.IImmutableDictionary\", \"TKey\", \"TValue\");\n    public static readonly KnownType System_Collections_Immutable_IImmutableList_T = new(\"System.Collections.Immutable.IImmutableList\", \"T\");\n    public static readonly KnownType System_Collections_Immutable_IImmutableQueue_T = new(\"System.Collections.Immutable.IImmutableQueue\", \"T\");\n    public static readonly KnownType System_Collections_Immutable_IImmutableSet_T = new(\"System.Collections.Immutable.IImmutableSet\", \"T\");\n    public static readonly KnownType System_Collections_Immutable_IImmutableStack_T = new(\"System.Collections.Immutable.IImmutableStack\", \"T\");\n    public static readonly KnownType System_Collections_Immutable_ImmutableArray = new(\"System.Collections.Immutable.ImmutableArray\");\n    public static readonly KnownType System_Collections_Immutable_ImmutableArray_T = new(\"System.Collections.Immutable.ImmutableArray\", \"T\");\n    public static readonly KnownType System_Collections_Immutable_ImmutableArray_T_Builder = new(\"System.Collections.Immutable.ImmutableArray+Builder\");\n    public static readonly KnownType System_Collections_Immutable_ImmutableDictionary = new(\"System.Collections.Immutable.ImmutableDictionary\");\n    public static readonly KnownType System_Collections_Immutable_ImmutableDictionary_TKey_TValue = new(\"System.Collections.Immutable.ImmutableDictionary\", \"TKey\", \"TValue\");\n    public static readonly KnownType System_Collections_Immutable_ImmutableDictionary_TKey_TValue_Builder = new(\"System.Collections.Immutable.ImmutableDictionary+Builder\");\n    public static readonly KnownType System_Collections_Immutable_ImmutableHashSet = new(\"System.Collections.Immutable.ImmutableHashSet\");\n    public static readonly KnownType System_Collections_Immutable_ImmutableHashSet_T = new(\"System.Collections.Immutable.ImmutableHashSet\", \"T\");\n    public static readonly KnownType System_Collections_Immutable_ImmutableHashSet_T_Builder = new(\"System.Collections.Immutable.ImmutableHashSet+Builder\");\n    public static readonly KnownType System_Collections_Immutable_ImmutableList = new(\"System.Collections.Immutable.ImmutableList\");\n    public static readonly KnownType System_Collections_Immutable_ImmutableList_T = new(\"System.Collections.Immutable.ImmutableList\", \"T\");\n    public static readonly KnownType System_Collections_Immutable_ImmutableList_T_Builder = new(\"System.Collections.Immutable.ImmutableList+Builder\");\n    public static readonly KnownType System_Collections_Immutable_ImmutableQueue = new(\"System.Collections.Immutable.ImmutableQueue\");\n    public static readonly KnownType System_Collections_Immutable_ImmutableQueue_T = new(\"System.Collections.Immutable.ImmutableQueue\", \"T\");\n    public static readonly KnownType System_Collections_Immutable_ImmutableSortedDictionary = new(\"System.Collections.Immutable.ImmutableSortedDictionary\");\n    public static readonly KnownType System_Collections_Immutable_ImmutableSortedDictionary_TKey_TValue = new(\"System.Collections.Immutable.ImmutableSortedDictionary\", \"TKey\", \"TValue\");\n    public static readonly KnownType System_Collections_Immutable_ImmutableSortedDictionary_TKey_TValue_Builder = new(\"System.Collections.Immutable.ImmutableSortedDictionary+Builder\");\n    public static readonly KnownType System_Collections_Immutable_ImmutableSortedSet = new(\"System.Collections.Immutable.ImmutableSortedSet\");\n    public static readonly KnownType System_Collections_Immutable_ImmutableSortedSet_T = new(\"System.Collections.Immutable.ImmutableSortedSet\", \"T\");\n    public static readonly KnownType System_Collections_Immutable_ImmutableSortedSet_T_Builder = new(\"System.Collections.Immutable.ImmutableSortedSet+Builder\");\n    public static readonly KnownType System_Collections_Immutable_ImmutableStack = new(\"System.Collections.Immutable.ImmutableStack\");\n    public static readonly KnownType System_Collections_Immutable_ImmutableStack_T = new(\"System.Collections.Immutable.ImmutableStack\", \"T\");\n    public static readonly KnownType System_Collections_ObjectModel_Collection_T = new(\"System.Collections.ObjectModel.Collection\", \"T\");\n    public static readonly KnownType System_Collections_ObjectModel_ObservableCollection_T = new(\"System.Collections.ObjectModel.ObservableCollection\", \"T\");\n    public static readonly KnownType System_Collections_ObjectModel_ReadOnlyCollection_T = new(\"System.Collections.ObjectModel.ReadOnlyCollection\", \"T\");\n    public static readonly KnownType System_Collections_ObjectModel_ReadOnlyDictionary_TKey_TValue = new(\"System.Collections.ObjectModel.ReadOnlyDictionary\", \"TKey\", \"TValue\");\n    public static readonly KnownType System_Collections_ObjectModel_ReadOnlySet_T = new(\"System.Collections.ObjectModel.ReadOnlySet\", \"T\");\n    public static readonly KnownType System_Collections_Queue = new(\"System.Collections.Queue\");\n    public static readonly KnownType System_Collections_ReadOnlyCollectionBase = new(\"System.Collections.ReadOnlyCollectionBase\");\n    public static readonly KnownType System_Collections_SortedList = new(\"System.Collections.SortedList\");\n    public static readonly KnownType System_Collections_Stack = new(\"System.Collections.Stack\");\n    public static readonly KnownType System_Collections_Specialized_NameObjectCollectionBase = new(\"System.Collections.Specialized.NameObjectCollectionBase\");\n    public static readonly KnownType System_Collections_Specialized_NameValueCollection = new(\"System.Collections.Specialized.NameValueCollection\");\n    public static readonly KnownType System_Composition_ExportAttribute = new(\"System.Composition.ExportAttribute\");\n    public static readonly KnownType System_ComponentModel_Composition_CreationPolicy = new(\"System.ComponentModel.Composition.CreationPolicy\");\n    public static readonly KnownType System_ComponentModel_Composition_ExportAttribute = new(\"System.ComponentModel.Composition.ExportAttribute\");\n    public static readonly KnownType System_ComponentModel_Composition_InheritedExportAttribute = new(\"System.ComponentModel.Composition.InheritedExportAttribute\");\n    public static readonly KnownType System_ComponentModel_Composition_PartCreationPolicyAttribute = new(\"System.ComponentModel.Composition.PartCreationPolicyAttribute\");\n    public static readonly KnownType System_ComponentModel_DataAnnotations_KeyAttribute = new(\"System.ComponentModel.DataAnnotations.KeyAttribute\");\n    public static readonly KnownType System_ComponentModel_DataAnnotations_RegularExpressionAttribute = new(\"System.ComponentModel.DataAnnotations.RegularExpressionAttribute\");\n    public static readonly KnownType System_ComponentModel_DataAnnotations_RangeAttribute = new(\"System.ComponentModel.DataAnnotations.RangeAttribute\");\n    public static readonly KnownType System_ComponentModel_DataAnnotations_IValidatableObject = new(\"System.ComponentModel.DataAnnotations.IValidatableObject\");\n    public static readonly KnownType System_ComponentModel_DataAnnotations_RequiredAttribute = new(\"System.ComponentModel.DataAnnotations.RequiredAttribute\");\n    public static readonly KnownType System_ComponentModel_DataAnnotations_ValidationAttribute = new(\"System.ComponentModel.DataAnnotations.ValidationAttribute\");\n    public static readonly KnownType System_ComponentModel_DefaultValueAttribute = new(\"System.ComponentModel.DefaultValueAttribute\");\n    public static readonly KnownType System_ComponentModel_EditorBrowsableAttribute = new(\"System.ComponentModel.EditorBrowsableAttribute\");\n    public static readonly KnownType System_ComponentModel_LocalizableAttribute = new(\"System.ComponentModel.LocalizableAttribute\");\n    public static readonly KnownType System_Configuration_ConfigXmlDocument = new(\"System.Configuration.ConfigXmlDocument\");\n    public static readonly KnownType System_Configuration_ConfigurationManager = new(\"System.Configuration.ConfigurationManager\");\n    public static readonly KnownType System_Console = new(\"System.Console\");\n    public static readonly KnownType System_Data_Common_CommandTrees_DbExpression = new(\"System.Data.Common.CommandTrees.DbExpression\");\n    public static readonly KnownType System_Data_DataSet = new(\"System.Data.DataSet\");\n    public static readonly KnownType System_Data_DataTable = new(\"System.Data.DataTable\");\n    public static readonly KnownType System_Data_Entity_Core_Objects_ObjectQuery = new(\"System.Data.Entity.Core.Objects.ObjectQuery\");\n    public static readonly KnownType System_Data_Entity_Database = new(\"System.Data.Entity.Database\");\n    public static readonly KnownType System_Data_Entity_DbSet = new(\"System.Data.Entity.DbSet\");\n    public static readonly KnownType System_Data_Entity_DbSet_TEntity = new(\"System.Data.Entity.DbSet\", \"TEntity\");\n    public static readonly KnownType System_Data_Entity_Infrastructure_DbQuery = new(\"System.Data.Entity.Infrastructure.DbQuery\");\n    public static readonly KnownType System_Data_Entity_Infrastructure_DbQuery_TResult = new(\"System.Data.Entity.Infrastructure.DbQuery\", \"TResult\");\n    public static readonly KnownType System_Data_Entity_Migrations_DbMigration = new(\"System.Data.Entity.Migrations.DbMigration\");\n    public static readonly KnownType System_Data_IDbCommand = new(\"System.Data.IDbCommand\");\n    public static readonly KnownType System_Data_Linq_ITable = new(\"System.Data.Linq.ITable\");\n    public static readonly KnownType System_Data_Odbc_OdbcCommand = new(\"System.Data.Odbc.OdbcCommand\");\n    public static readonly KnownType System_Data_Odbc_OdbcDataAdapter = new(\"System.Data.Odbc.OdbcDataAdapter\");\n    public static readonly KnownType System_Data_OracleClient_OracleCommand = new(\"System.Data.OracleClient.OracleCommand\");\n    public static readonly KnownType System_Data_OracleClient_OracleDataAdapter = new(\"System.Data.OracleClient.OracleDataAdapter\");\n    public static readonly KnownType System_Data_SqlClient_SqlCommand = new(\"System.Data.SqlClient.SqlCommand\");\n    public static readonly KnownType System_Data_SqlClient_SqlDataAdapter = new(\"System.Data.SqlClient.SqlDataAdapter\");\n    public static readonly KnownType Microsoft_Data_SqlClient_SqlCommand = new(\"Microsoft.Data.SqlClient.SqlCommand\");\n    public static readonly KnownType Microsoft_Data_SqlClient_SqlDataAdapter = new(\"Microsoft.Data.SqlClient.SqlDataAdapter\");\n    public static readonly KnownType System_Data_Sqlite_SqliteCommand = new(\"System.Data.SQLite.SQLiteCommand\");\n    public static readonly KnownType System_Data_Sqlite_SQLiteDataAdapter = new(\"System.Data.SQLite.SQLiteDataAdapter\");\n    public static readonly KnownType System_Data_SqlServerCe_SqlCeCommand = new(\"System.Data.SqlServerCe.SqlCeCommand\");\n    public static readonly KnownType System_Data_SqlServerCe_SqlCeDataAdapter = new(\"System.Data.SqlServerCe.SqlCeDataAdapter\");\n    public static readonly KnownType System_DateOnly = new(\"System.DateOnly\");\n    public static readonly KnownType System_DateTime = new(\"System.DateTime\");\n    public static readonly KnownType System_DateTimeKind = new(\"System.DateTimeKind\");\n    public static readonly KnownType System_DateTimeOffset = new(\"System.DateTimeOffset\");\n    public static readonly KnownType System_Decimal = new(\"System.Decimal\");\n    public static readonly KnownType System_Delegate = new(\"System.Delegate\");\n    public static readonly KnownType System_Diagnostics_CodeAnalysis_DynamicallyAccessedMembersAttribute = new(\"System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute\");\n    public static readonly KnownType System_Diagnostics_CodeAnalysis_ExcludeFromCodeCoverageAttribute = new(\"System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute\");\n    public static readonly KnownType System_Diagnostics_CodeAnalysis_SuppressMessageAttribute = new(\"System.Diagnostics.CodeAnalysis.SuppressMessageAttribute\");\n    public static readonly KnownType System_Diagnostics_CodeAnalysis_StringSyntaxAttribute = new(\"System.Diagnostics.CodeAnalysis.StringSyntaxAttribute\");\n    public static readonly KnownType System_Diagnostics_ConditionalAttribute = new(\"System.Diagnostics.ConditionalAttribute\");\n    public static readonly KnownType System_Diagnostics_Contracts_PureAttribute = new(\"System.Diagnostics.Contracts.PureAttribute\");\n    public static readonly KnownType System_Diagnostics_Debug = new(\"System.Diagnostics.Debug\");\n    public static readonly KnownType System_Diagnostics_Debugger = new(\"System.Diagnostics.Debugger\");\n    public static readonly KnownType System_Diagnostics_DebuggerDisplayAttribute = new(\"System.Diagnostics.DebuggerDisplayAttribute\");\n    public static readonly KnownType System_Diagnostics_Process = new(\"System.Diagnostics.Process\");\n    public static readonly KnownType System_Diagnostics_ProcessStartInfo = new(\"System.Diagnostics.ProcessStartInfo\");\n    public static readonly KnownType System_Diagnostics_Trace = new(\"System.Diagnostics.Trace\");\n    public static readonly KnownType System_Diagnostics_TraceSource = new(\"System.Diagnostics.TraceSource\");\n    public static readonly KnownType System_Diagnostics_TraceSwitch = new(\"System.Diagnostics.TraceSwitch\");\n    public static readonly KnownType System_DirectoryServices_AuthenticationTypes = new(\"System.DirectoryServices.AuthenticationTypes\");\n    public static readonly KnownType System_DirectoryServices_DirectoryEntry = new(\"System.DirectoryServices.DirectoryEntry\");\n    public static readonly KnownType System_Double = new(\"System.Double\");\n    public static readonly KnownType System_Drawing_Bitmap = new(\"System.Drawing.Bitmap\");\n    public static readonly KnownType System_Drawing_Image = new(\"System.Drawing.Image\");\n    public static readonly KnownType System_DuplicateWaitObjectException = new(\"System.DuplicateWaitObjectException\");\n    public static readonly KnownType System_Enum = new(\"System.Enum\");\n    public static readonly KnownType System_Environment = new(\"System.Environment\");\n    public static readonly KnownType System_EventArgs = new(\"System.EventArgs\");\n    public static readonly KnownType System_EventHandler = new(\"System.EventHandler\");\n    public static readonly KnownType System_EventHandler_TEventArgs = new(\"System.EventHandler\", \"TEventArgs\");\n    public static readonly KnownType System_Exception = new(\"System.Exception\");\n    public static readonly KnownType System_ExecutionEngineException = new(\"System.ExecutionEngineException\");\n    public static readonly KnownType System_FlagsAttribute = new(\"System.FlagsAttribute\");\n    public static readonly KnownType System_FormattableString = new(\"System.FormattableString\");\n    public static readonly KnownType System_Func_TResult = new(\"System.Func\", \"TResult\");\n    public static readonly KnownType System_Func_T_TResult = new(\"System.Func\", \"T\", \"TResult\");\n    public static readonly KnownType System_Func_T1_T2_TResult = new(\"System.Func\", \"T1\", \"T2\", \"TResult\");\n    public static readonly KnownType System_Func_T1_T2_T3_TResult = new(\"System.Func\", \"T1\", \"T2\", \"T3\", \"TResult\");\n    public static readonly KnownType System_Func_T1_T2_T3_T4_TResult = new(\"System.Func\", \"T1\", \"T2\", \"T3\", \"T4\", \"TResult\");\n    public static readonly KnownType System_GC = new(\"System.GC\");\n    public static readonly KnownType System_Globalization_CompareOptions = new(\"System.Globalization.CompareOptions\");\n    public static readonly KnownType System_Globalization_CultureInfo = new(\"System.Globalization.CultureInfo\");\n    public static readonly KnownType System_Guid = new(\"System.Guid\");\n    public static readonly KnownType System_Half = new(\"System.Half\");\n    public static readonly KnownType System_IAsyncDisposable = new(\"System.IAsyncDisposable\");\n    public static readonly KnownType System_IComparable = new(\"System.IComparable\");\n    public static readonly KnownType System_IComparable_T = new(\"System.IComparable\", \"T\");\n    public static readonly KnownType System_IdentityModel_Tokens_SecurityTokenHandler = new(\"System.IdentityModel.Tokens.SecurityTokenHandler\");\n    public static readonly KnownType System_IdentityModel_Tokens_SymmetricSecurityKey = new(\"System.IdentityModel.Tokens.SymmetricSecurityKey\");\n    public static readonly KnownType System_IDisposable = new(\"System.IDisposable\");\n    public static readonly KnownType System_IEquatable_T = new(\"System.IEquatable\", \"T\");\n    public static readonly KnownType System_IFormatProvider = new(\"System.IFormatProvider\");\n    public static readonly KnownType System_Index = new(\"System.Index\");\n    public static readonly KnownType System_IndexOutOfRangeException = new(\"System.IndexOutOfRangeException\");\n    public static readonly KnownType System_Int16 = new(\"System.Int16\");\n    public static readonly KnownType System_Int32 = new(\"System.Int32\");\n    public static readonly KnownType System_Int64 = new(\"System.Int64\");\n    public static readonly KnownType System_Int128 = new(\"System.Int128\");\n    public static readonly KnownType System_IntPtr = new(\"System.IntPtr\");\n    public static readonly KnownType System_InvalidOperationException = new(\"System.InvalidOperationException\");\n    public static readonly KnownType System_IO_Compression_ZipFile = new(\"System.IO.Compression.ZipFile\");\n    public static readonly KnownType System_IO_Compression_ZipFileExtensions = new(\"System.IO.Compression.ZipFileExtensions\");\n    public static readonly KnownType System_IO_FileStream = new(\"System.IO.FileStream\");\n    public static readonly KnownType System_IO_Path = new(\"System.IO.Path\");\n    public static readonly KnownType System_IO_Stream = new(\"System.IO.Stream\");\n    public static readonly KnownType System_IO_StreamReader = new(\"System.IO.StreamReader\");\n    public static readonly KnownType System_IO_StreamWriter = new(\"System.IO.StreamWriter\");\n    public static readonly KnownType System_IO_TextWriter = new(\"System.IO.TextWriter\");\n    public static readonly KnownType System_Lazy = new(\"System.Lazy\", \"T\");\n    public static readonly KnownType System_Linq_Enumerable = new(\"System.Linq.Enumerable\");\n    public static readonly KnownType System_Linq_Expressions_Expression = new(\"System.Linq.Expressions.Expression\");\n    public static readonly KnownType System_Linq_Expressions_Expression_T = new(\"System.Linq.Expressions.Expression\", \"TDelegate\");\n    public static readonly KnownType System_Linq_ImmutableArrayExtensions = new(\"System.Linq.ImmutableArrayExtensions\");\n    public static readonly KnownType System_Linq_IQueryable = new(\"System.Linq.IQueryable\", \"T\");\n    public static readonly KnownType System_Linq_Queryable = new(\"System.Linq.Queryable\");\n    public static readonly KnownType System_MarshalByRefObject = new(\"System.MarshalByRefObject\");\n    public static readonly KnownType System_MemoryExtensions = new(\"System.MemoryExtensions\");\n    public static readonly KnownType System_MTAThreadAttribute = new(\"System.MTAThreadAttribute\");\n    public static readonly KnownType System_Net_FtpWebRequest = new(\"System.Net.FtpWebRequest\");\n    public static readonly KnownType System_Net_Http_Headers_HttpHeaders = new(\"System.Net.Http.Headers.HttpHeaders\");\n    public static readonly KnownType System_Net_Http_HttpClient = new(\"System.Net.Http.HttpClient\");\n    public static readonly KnownType System_Net_Http_HttpClientHandler = new(\"System.Net.Http.HttpClientHandler\");\n    public static readonly KnownType System_Net_IPAddress = new(\"System.Net.IPAddress\");\n    public static readonly KnownType System_Net_Mail_SmtpClient = new(\"System.Net.Mail.SmtpClient\");\n    public static readonly KnownType System_Net_NetworkCredential = new(\"System.Net.NetworkCredential\");\n    public static readonly KnownType System_Net_SecurityProtocolType = new(\"System.Net.SecurityProtocolType\");\n    public static readonly KnownType System_Net_Security_RemoteCertificateValidationCallback = new(\"System.Net.Security.RemoteCertificateValidationCallback\");\n    public static readonly KnownType System_Net_Security_SslPolicyErrors = new(\"System.Net.Security.SslPolicyErrors\");\n    public static readonly KnownType System_Net_Sockets_Socket = new(\"System.Net.Sockets.Socket\");\n    public static readonly KnownType System_Net_Sockets_SocketTaskExtensions = new(\"System.Net.Sockets.SocketTaskExtensions\");\n    public static readonly KnownType System_Net_Sockets_TcpClient = new(\"System.Net.Sockets.TcpClient\");\n    public static readonly KnownType System_Net_Sockets_UdpClient = new(\"System.Net.Sockets.UdpClient\");\n    public static readonly KnownType System_Net_WebClient = new(\"System.Net.WebClient\");\n    public static readonly KnownType System_NonSerializedAttribute = new(\"System.NonSerializedAttribute\");\n    public static readonly KnownType System_NotImplementedException = new(\"System.NotImplementedException\");\n    public static readonly KnownType System_NotSupportedException = new(\"System.NotSupportedException\");\n    public static readonly KnownType System_Nullable_T = new(\"System.Nullable\", \"T\");\n    public static readonly KnownType System_NullReferenceException = new(\"System.NullReferenceException\");\n    public static readonly KnownType System_Numerics_IEqualityOperators_TSelf_TOther_TResult = new(\"System.Numerics.IEqualityOperators\", \"TSelf\", \"TOther\", \"TResult\");\n    public static readonly KnownType System_Numerics_IFloatingPointIeee754_TSelf = new(\"System.Numerics.IFloatingPointIeee754\", \"TSelf\");\n    public static readonly KnownType System_Object = new(\"System.Object\");\n    public static readonly KnownType System_Object_Array = new(\"System.Object\") { IsArray = true };\n    public static readonly KnownType System_ObsoleteAttribute = new(\"System.ObsoleteAttribute\");\n    public static readonly KnownType System_OutOfMemoryException = new(\"System.OutOfMemoryException\");\n    public static readonly KnownType System_Random = new(\"System.Random\");\n    public static readonly KnownType System_Range = new(\"System.Range\");\n    public static readonly KnownType System_ReadOnlySpan_T = new(\"System.ReadOnlySpan\", \"T\");\n    public static readonly KnownType System_Reflection_Assembly = new(\"System.Reflection.Assembly\");\n    public static readonly KnownType System_Reflection_AssemblyVersionAttribute = new(\"System.Reflection.AssemblyVersionAttribute\");\n    public static readonly KnownType System_Reflection_BindingFlags = new(\"System.Reflection.BindingFlags\");\n    public static readonly KnownType System_Reflection_MemberInfo = new(\"System.Reflection.MemberInfo\");\n    public static readonly KnownType System_Reflection_Module = new(\"System.Reflection.Module\");\n    public static readonly KnownType System_Reflection_MethodImplAttributes = new(\"System.Reflection.MethodImplAttributes\");\n    public static readonly KnownType System_Reflection_ParameterInfo = new(\"System.Reflection.ParameterInfo\");\n    public static readonly KnownType System_ResolveEventArgs = new(\"System.ResolveEventArgs\");\n    public static readonly KnownType System_Resources_NeutralResourcesLanguageAttribute = new(\"System.Resources.NeutralResourcesLanguageAttribute\");\n    public static readonly KnownType System_Runtime_CompilerServices_ExtensionAttribute = new(\"System.Runtime.CompilerServices.ExtensionAttribute\");\n    public static readonly KnownType System_Runtime_CompilerServices_CallerArgumentExpressionAttribute = new(\"System.Runtime.CompilerServices.CallerArgumentExpressionAttribute\");\n    public static readonly KnownType System_Runtime_CompilerServices_CallerFilePathAttribute = new(\"System.Runtime.CompilerServices.CallerFilePathAttribute\");\n    public static readonly KnownType System_Runtime_CompilerServices_CallerLineNumberAttribute = new(\"System.Runtime.CompilerServices.CallerLineNumberAttribute\");\n    public static readonly KnownType System_Runtime_CompilerServices_CallerMemberNameAttribute = new(\"System.Runtime.CompilerServices.CallerMemberNameAttribute\");\n    public static readonly KnownType System_Runtime_CompilerServices_InternalsVisibleToAttribute = new(\"System.Runtime.CompilerServices.InternalsVisibleToAttribute\");\n    public static readonly KnownType System_Runtime_CompilerServices_ModuleInitializerAttribute = new(\"System.Runtime.CompilerServices.ModuleInitializerAttribute\");\n    public static readonly KnownType System_Runtime_CompilerServices_ValueTaskAwaiter = new(\"System.Runtime.CompilerServices.ValueTaskAwaiter\");\n    public static readonly KnownType System_Runtime_CompilerServices_ValueTaskAwaiter_TResult = new(\"System.Runtime.CompilerServices.ValueTaskAwaiter\", \"TResult\");\n    public static readonly KnownType System_Runtime_CompilerServices_TaskAwaiter = new(\"System.Runtime.CompilerServices.TaskAwaiter\");\n    public static readonly KnownType System_Runtime_CompilerServices_TaskAwaiter_TResult = new(\"System.Runtime.CompilerServices.TaskAwaiter\", \"TResult\");\n    public static readonly KnownType System_Runtime_InteropServices_ComImportAttribute = new(\"System.Runtime.InteropServices.ComImportAttribute\");\n    public static readonly KnownType System_Runtime_InteropServices_ComVisibleAttribute = new(\"System.Runtime.InteropServices.ComVisibleAttribute\");\n    public static readonly KnownType System_Runtime_InteropServices_DefaultParameterValueAttribute = new(\"System.Runtime.InteropServices.DefaultParameterValueAttribute\");\n    public static readonly KnownType System_Runtime_InteropServices_DllImportAttribute = new(\"System.Runtime.InteropServices.DllImportAttribute\");\n    public static readonly KnownType System_Runtime_InteropServices_Exception = new(\"System.Runtime.InteropServices._Exception\");\n    public static readonly KnownType System_Runtime_InteropServices_HandleRef = new(\"System.Runtime.InteropServices.HandleRef\");\n    public static readonly KnownType System_Runtime_InteropServices_InterfaceTypeAttribute = new(\"System.Runtime.InteropServices.InterfaceTypeAttribute\");\n    public static readonly KnownType System_Runtime_InteropServices_LibraryImportAttribute = new(\"System.Runtime.InteropServices.LibraryImportAttribute\");\n    public static readonly KnownType System_Runtime_InteropServices_NFloat = new(\"System.Runtime.InteropServices.NFloat\");\n    public static readonly KnownType System_Runtime_InteropServices_OptionalAttribute = new(\"System.Runtime.InteropServices.OptionalAttribute\");\n    public static readonly KnownType System_Runtime_InteropServices_SafeHandle = new(\"System.Runtime.InteropServices.SafeHandle\");\n    public static readonly KnownType System_Runtime_InteropServices_StructLayoutAttribute = new(\"System.Runtime.InteropServices.StructLayoutAttribute\");\n    public static readonly KnownType System_Runtime_Serialization_DataMemberAttribute = new(\"System.Runtime.Serialization.DataMemberAttribute\");\n    public static readonly KnownType System_Runtime_Serialization_Formatters_Binary_BinaryFormatter = new(\"System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\");\n    public static readonly KnownType System_Runtime_Serialization_Formatters_Soap_SoapFormatter = new(\"System.Runtime.Serialization.Formatters.Soap.SoapFormatter\");\n    public static readonly KnownType System_Runtime_Serialization_ISerializable = new(\"System.Runtime.Serialization.ISerializable\");\n    public static readonly KnownType System_Runtime_Serialization_IDeserializationCallback = new(\"System.Runtime.Serialization.IDeserializationCallback\");\n    public static readonly KnownType System_Runtime_Serialization_NetDataContractSerializer = new(\"System.Runtime.Serialization.NetDataContractSerializer\");\n    public static readonly KnownType System_Runtime_Serialization_OnDeserializedAttribute = new(\"System.Runtime.Serialization.OnDeserializedAttribute\");\n    public static readonly KnownType System_Runtime_Serialization_OnDeserializingAttribute = new(\"System.Runtime.Serialization.OnDeserializingAttribute\");\n    public static readonly KnownType System_Runtime_Serialization_OnSerializedAttribute = new(\"System.Runtime.Serialization.OnSerializedAttribute\");\n    public static readonly KnownType System_Runtime_Serialization_OnSerializingAttribute = new(\"System.Runtime.Serialization.OnSerializingAttribute\");\n    public static readonly KnownType System_Runtime_Serialization_OptionalFieldAttribute = new(\"System.Runtime.Serialization.OptionalFieldAttribute\");\n    public static readonly KnownType System_Runtime_Serialization_SerializationInfo = new(\"System.Runtime.Serialization.SerializationInfo\");\n    public static readonly KnownType System_Runtime_Serialization_StreamingContext = new(\"System.Runtime.Serialization.StreamingContext\");\n    public static readonly KnownType System_SByte = new(\"System.SByte\");\n    public static readonly KnownType System_Security_AccessControl_FileSystemAccessRule = new(\"System.Security.AccessControl.FileSystemAccessRule\");\n    public static readonly KnownType System_Security_AccessControl_FileSystemSecurity = new(\"System.Security.AccessControl.FileSystemSecurity\");\n    public static readonly KnownType System_Security_AllowPartiallyTrustedCallersAttribute = new(\"System.Security.AllowPartiallyTrustedCallersAttribute\");\n    public static readonly KnownType System_Security_Authentication_SslProtocols = new(\"System.Security.Authentication.SslProtocols\");\n    public static readonly KnownType System_Security_Cryptography_AesManaged = new(\"System.Security.Cryptography.AesManaged\");\n    public static readonly KnownType System_Security_Cryptography_AsymmetricAlgorithm = new(\"System.Security.Cryptography.AsymmetricAlgorithm\");\n    public static readonly KnownType System_Security_Cryptography_AsymmetricKeyExchangeDeformatter = new(\"System.Security.Cryptography.AsymmetricKeyExchangeDeformatter\");\n    public static readonly KnownType System_Security_Cryptography_AsymmetricKeyExchangeFormatter = new(\"System.Security.Cryptography.AsymmetricKeyExchangeFormatter\");\n    public static readonly KnownType System_Security_Cryptography_AsymmetricSignatureDeformatter = new(\"System.Security.Cryptography.AsymmetricSignatureDeformatter\");\n    public static readonly KnownType System_Security_Cryptography_AsymmetricSignatureFormatter = new(\"System.Security.Cryptography.AsymmetricSignatureFormatter\");\n    public static readonly KnownType System_Security_Cryptography_CryptoConfig = new(\"System.Security.Cryptography.CryptoConfig\");\n    public static readonly KnownType System_Security_Cryptography_CryptographicOperations = new(\"System.Security.Cryptography.CryptographicOperations\");\n    public static readonly KnownType System_Security_Cryptography_CspParameters = new(\"System.Security.Cryptography.CspParameters\");\n    public static readonly KnownType System_Security_Cryptography_DES = new(\"System.Security.Cryptography.DES\");\n    public static readonly KnownType System_Security_Cryptography_DeriveBytes = new(\"System.Security.Cryptography.DeriveBytes\");\n    public static readonly KnownType System_Security_Cryptography_DSA = new(\"System.Security.Cryptography.DSA\");\n    public static readonly KnownType System_Security_Cryptography_DSACryptoServiceProvider = new(\"System.Security.Cryptography.DSACryptoServiceProvider\");\n    public static readonly KnownType System_Security_Cryptography_ECDiffieHellman = new(\"System.Security.Cryptography.ECDiffieHellman\");\n    public static readonly KnownType System_Security_Cryptography_ECDsa = new(\"System.Security.Cryptography.ECDsa\");\n    public static readonly KnownType System_Security_Cryptography_ECAlgorythm = new(\"System.Security.Cryptography.ECAlgorithm\");\n    public static readonly KnownType System_Security_Cryptography_HashAlgorithm = new(\"System.Security.Cryptography.HashAlgorithm\");\n    public static readonly KnownType System_Security_Cryptography_HashAlgorithmName = new(\"System.Security.Cryptography.HashAlgorithmName\");\n    public static readonly KnownType System_Security_Cryptography_HMAC = new(\"System.Security.Cryptography.HMAC\");\n    public static readonly KnownType System_Security_Cryptography_HMACMD5 = new(\"System.Security.Cryptography.HMACMD5\");\n    public static readonly KnownType System_Security_Cryptography_HMACRIPEMD160 = new(\"System.Security.Cryptography.HMACRIPEMD160\");\n    public static readonly KnownType System_Security_Cryptography_HMACSHA1 = new(\"System.Security.Cryptography.HMACSHA1\");\n    public static readonly KnownType System_Security_Cryptography_ICryptoTransform = new(\"System.Security.Cryptography.ICryptoTransform\");\n    public static readonly KnownType System_Security_Cryptography_KeyedHashAlgorithm = new(\"System.Security.Cryptography.KeyedHashAlgorithm\");\n    public static readonly KnownType System_Security_Cryptography_MD5 = new(\"System.Security.Cryptography.MD5\");\n    public static readonly KnownType System_Security_Cryptography_PasswordDeriveBytes = new(\"System.Security.Cryptography.PasswordDeriveBytes\");\n    public static readonly KnownType System_Security_Cryptography_RC2 = new(\"System.Security.Cryptography.RC2\");\n    public static readonly KnownType System_Security_Cryptography_RandomNumberGenerator = new(\"System.Security.Cryptography.RandomNumberGenerator\");\n    public static readonly KnownType System_Security_Cryptography_Rfc2898DeriveBytes = new(\"System.Security.Cryptography.Rfc2898DeriveBytes\");\n    public static readonly KnownType System_Security_Cryptography_RIPEMD160 = new(\"System.Security.Cryptography.RIPEMD160\");\n    public static readonly KnownType System_Security_Cryptography_RNGCryptoServiceProvider = new(\"System.Security.Cryptography.RNGCryptoServiceProvider\");\n    public static readonly KnownType System_Security_Cryptography_RSA = new(\"System.Security.Cryptography.RSA\");\n    public static readonly KnownType System_Security_Cryptography_RSACryptoServiceProvider = new(\"System.Security.Cryptography.RSACryptoServiceProvider\");\n    public static readonly KnownType System_Security_Cryptography_SHA1 = new(\"System.Security.Cryptography.SHA1\");\n    public static readonly KnownType System_Security_Cryptography_SymmetricAlgorithm = new(\"System.Security.Cryptography.SymmetricAlgorithm\");\n    public static readonly KnownType System_Security_Cryptography_TripleDES = new(\"System.Security.Cryptography.TripleDES\");\n    public static readonly KnownType System_Security_Cryptography_X509Certificates_X509Certificate2 = new(\"System.Security.Cryptography.X509Certificates.X509Certificate2\");\n    public static readonly KnownType System_Security_Cryptography_X509Certificates_X509Chain = new(\"System.Security.Cryptography.X509Certificates.X509Chain\");\n    public static readonly KnownType System_Security_Cryptography_Xml_SignedXml = new(\"System.Security.Cryptography.Xml.SignedXml\");\n    public static readonly KnownType System_Security_Permissions_CodeAccessSecurityAttribute = new(\"System.Security.Permissions.CodeAccessSecurityAttribute\");\n    public static readonly KnownType System_Security_Permissions_PrincipalPermission = new(\"System.Security.Permissions.PrincipalPermission\");\n    public static readonly KnownType System_Security_Permissions_PrincipalPermissionAttribute = new(\"System.Security.Permissions.PrincipalPermissionAttribute\");\n    public static readonly KnownType System_Security_PermissionSet = new(\"System.Security.PermissionSet\");\n    public static readonly KnownType System_Security_Principal_IIdentity = new(\"System.Security.Principal.IIdentity\");\n    public static readonly KnownType System_Security_Principal_IPrincipal = new(\"System.Security.Principal.IPrincipal\");\n    public static readonly KnownType System_Security_Principal_NTAccount = new(\"System.Security.Principal.NTAccount\");\n    public static readonly KnownType System_Security_Principal_SecurityIdentifier = new(\"System.Security.Principal.SecurityIdentifier\");\n    public static readonly KnownType System_Security_Principal_WindowsIdentity = new(\"System.Security.Principal.WindowsIdentity\");\n    public static readonly KnownType System_Security_SecureString = new(\"System.Security.SecureString\");\n    public static readonly KnownType System_Security_SecurityCriticalAttribute = new(\"System.Security.SecurityCriticalAttribute\");\n    public static readonly KnownType System_Security_SecuritySafeCriticalAttribute = new(\"System.Security.SecuritySafeCriticalAttribute\");\n    public static readonly KnownType System_SerializableAttribute = new(\"System.SerializableAttribute\");\n    public static readonly KnownType System_ServiceModel_OperationContractAttribute = new(\"System.ServiceModel.OperationContractAttribute\");\n    public static readonly KnownType System_ServiceModel_ServiceContractAttribute = new(\"System.ServiceModel.ServiceContractAttribute\");\n    public static readonly KnownType System_Single = new(\"System.Single\");\n    public static readonly KnownType System_StackOverflowException = new(\"System.StackOverflowException\");\n    public static readonly KnownType System_STAThreadAttribute = new(\"System.STAThreadAttribute\");\n    public static readonly KnownType System_String = new(\"System.String\");\n    public static readonly KnownType System_String_Array = new(\"System.String\") { IsArray = true };\n    public static readonly KnownType System_StringComparison = new(\"System.StringComparison\");\n    public static readonly KnownType System_SystemException = new(\"System.SystemException\");\n    public static readonly KnownType System_Text_Encoding = new(\"System.Text.Encoding\");\n    public static readonly KnownType System_Text_Json_Serialization_JsonIgnoreAttribute = new(\"System.Text.Json.Serialization.JsonIgnoreAttribute\");\n    public static readonly KnownType System_Text_Json_Serialization_JsonRequiredAttribute = new(\"System.Text.Json.Serialization.JsonRequiredAttribute\");\n    public static readonly KnownType System_Text_RegularExpressions_Regex = new(\"System.Text.RegularExpressions.Regex\");\n    public static readonly KnownType System_Text_RegularExpressions_RegexOptions = new(\"System.Text.RegularExpressions.RegexOptions\");\n    public static readonly KnownType System_Text_StringBuilder = new(\"System.Text.StringBuilder\");\n    public static readonly KnownType System_Threading_CancellationToken = new(\"System.Threading.CancellationToken\");\n    public static readonly KnownType System_Threading_CancellationTokenSource = new(\"System.Threading.CancellationTokenSource\");\n    public static readonly KnownType System_Threading_Lock = new(\"System.Threading.Lock\");\n    public static readonly KnownType System_Threading_Lock_Scope = new(\"System.Threading.Lock+Scope\");\n    public static readonly KnownType System_Threading_Monitor = new(\"System.Threading.Monitor\");\n    public static readonly KnownType System_Threading_Mutex = new(\"System.Threading.Mutex\");\n    public static readonly KnownType System_Threading_ReaderWriterLock = new(\"System.Threading.ReaderWriterLock\");\n    public static readonly KnownType System_Threading_ReaderWriterLockSlim = new(\"System.Threading.ReaderWriterLockSlim\");\n    public static readonly KnownType System_Threading_Semaphore = new(\"System.Threading.Semaphore\");\n    public static readonly KnownType System_Threading_SemaphoreSlim = new(\"System.Threading.SemaphoreSlim\");\n    public static readonly KnownType System_Threading_SpinLock = new(\"System.Threading.SpinLock\");\n    public static readonly KnownType System_Threading_Tasks_Task = new(\"System.Threading.Tasks.Task\");\n    public static readonly KnownType System_Threading_Tasks_Task_T = new(\"System.Threading.Tasks.Task\", \"TResult\");\n    public static readonly KnownType System_Threading_Tasks_TaskFactory = new(\"System.Threading.Tasks.TaskFactory\");\n    public static readonly KnownType System_Threading_Tasks_ValueTask = new(\"System.Threading.Tasks.ValueTask\");\n    public static readonly KnownType System_Threading_Tasks_ValueTask_TResult = new(\"System.Threading.Tasks.ValueTask\", \"TResult\");\n    public static readonly KnownType System_Threading_Thread = new(\"System.Threading.Thread\");\n    public static readonly KnownType System_Threading_WaitHandle = new(\"System.Threading.WaitHandle\");\n    public static readonly KnownType System_ThreadStaticAttribute = new(\"System.ThreadStaticAttribute\");\n    public static readonly KnownType System_TimeOnly = new(\"System.TimeOnly\");\n    public static readonly KnownType System_TimeSpan = new(\"System.TimeSpan\");\n    public static readonly KnownType System_Type = new(\"System.Type\");\n    public static readonly KnownType System_UInt16 = new(\"System.UInt16\");\n    public static readonly KnownType System_UInt32 = new(\"System.UInt32\");\n    public static readonly KnownType System_UInt64 = new(\"System.UInt64\");\n    public static readonly KnownType System_UIntPtr = new(\"System.UIntPtr\");\n    public static readonly KnownType System_Uri = new(\"System.Uri\");\n    public static readonly KnownType System_ValueTuple = new(\"System.ValueTuple\");\n    public static readonly KnownType System_ValueType = new(\"System.ValueType\");\n    public static readonly KnownType System_Web_HttpApplication = new(\"System.Web.HttpApplication\");\n    public static readonly KnownType System_Web_HttpCookie = new(\"System.Web.HttpCookie\");\n    public static readonly KnownType System_Web_HttpContext = new(\"System.Web.HttpContext\");\n    public static readonly KnownType System_Web_HttpResponse = new(\"System.Web.HttpResponse\");\n    public static readonly KnownType System_Web_HttpResponseBase = new(\"System.Web.HttpResponseBase\");\n    public static readonly KnownType System_Web_Http_ApiController = new(\"System.Web.Http.ApiController\");\n    public static readonly KnownType System_Web_Http_Cors_EnableCorsAttribute = new(\"System.Web.Http.Cors.EnableCorsAttribute\");\n    public static readonly KnownType System_Web_Mvc_Controller = new(\"System.Web.Mvc.Controller\");\n    public static readonly KnownType System_Web_Mvc_HttpPostAttribute = new(\"System.Web.Mvc.HttpPostAttribute\");\n    public static readonly KnownType System_Web_Mvc_NonActionAttribute = new(\"System.Web.Mvc.NonActionAttribute\");\n    public static readonly KnownType System_Web_Mvc_RouteAttribute = new(\"System.Web.Mvc.RouteAttribute\");\n    public static readonly KnownType System_Web_Mvc_Routing_IRouteInfoProvider = new(\"System.Web.Mvc.Routing.IRouteInfoProvider\");\n    public static readonly KnownType System_Web_Mvc_RoutePrefixAttribute = new(\"System.Web.Mvc.RoutePrefixAttribute\");\n    public static readonly KnownType System_Web_Mvc_ValidateInputAttribute = new(\"System.Web.Mvc.ValidateInputAttribute\");\n    public static readonly KnownType System_Web_Routing_RouteValueDictionary = new(\"System.Web.Routing.RouteValueDictionary\");\n    public static readonly KnownType System_Web_Script_Serialization_JavaScriptSerializer = new(\"System.Web.Script.Serialization.JavaScriptSerializer\");\n    public static readonly KnownType System_Web_Script_Serialization_JavaScriptTypeResolver = new(\"System.Web.Script.Serialization.JavaScriptTypeResolver\");\n    public static readonly KnownType System_Web_Script_Serialization_SimpleTypeResolver = new(\"System.Web.Script.Serialization.SimpleTypeResolver\");\n    public static readonly KnownType System_Web_UI_LosFormatter = new(\"System.Web.UI.LosFormatter\");\n    public static readonly KnownType System_Windows_DependencyObject = new(\"System.Windows.DependencyObject\");\n    public static readonly KnownType System_Windows_Forms_Application = new(\"System.Windows.Forms.Application\");\n    public static readonly KnownType System_Windows_Forms_IContainerControl = new(\"System.Windows.Forms.IContainerControl\");\n    public static readonly KnownType System_Windows_FrameworkElement = new(\"System.Windows.FrameworkElement\");\n    public static readonly KnownType System_Windows_Markup_ConstructorArgumentAttribute = new(\"System.Windows.Markup.ConstructorArgumentAttribute\");\n    public static readonly KnownType System_Windows_Markup_XmlnsPrefixAttribute = new(\"System.Windows.Markup.XmlnsPrefixAttribute\");\n    public static readonly KnownType System_Windows_Markup_XmlnsDefinitionAttribute = new(\"System.Windows.Markup.XmlnsDefinitionAttribute\");\n    public static readonly KnownType System_Windows_Markup_XmlnsCompatibleWithAttribute = new(\"System.Windows.Markup.XmlnsCompatibleWithAttribute\");\n    public static readonly KnownType System_Xml_Resolvers_XmlPreloadedResolver = new(\"System.Xml.Resolvers.XmlPreloadedResolver\");\n    public static readonly KnownType System_Xml_Serialization_XmlElementAttribute = new(\"System.Xml.Serialization.XmlElementAttribute\");\n    public static readonly KnownType System_Xml_XmlDocument = new(\"System.Xml.XmlDocument\");\n    public static readonly KnownType System_Xml_XmlDataDocument = new(\"System.Xml.XmlDataDocument\");\n    public static readonly KnownType System_Xml_XmlNode = new(\"System.Xml.XmlNode\");\n    public static readonly KnownType System_Xml_XPath_XPathDocument = new(\"System.Xml.XPath.XPathDocument\");\n    public static readonly KnownType System_Xml_XmlReader = new(\"System.Xml.XmlReader\");\n    public static readonly KnownType System_Xml_XmlReaderSettings = new(\"System.Xml.XmlReaderSettings\");\n    public static readonly KnownType System_Xml_XmlUrlResolver = new(\"System.Xml.XmlUrlResolver\");\n    public static readonly KnownType System_Xml_XmlTextReader = new(\"System.Xml.XmlTextReader\");\n    public static readonly KnownType System_Xml_XmlWriter = new(\"System.Xml.XmlWriter\");\n    public static readonly KnownType Void = new(\"System.Void\");\n    public static readonly KnownType NSubstitute_SubstituteExtensions = new(\"NSubstitute.SubstituteExtensions\");\n    public static readonly KnownType NSubstitute_Received = new(\"NSubstitute.Received\");\n    public static readonly KnownType NSubstitute_ReceivedExtensions_ReceivedExtensions = new(\"NSubstitute.ReceivedExtensions.ReceivedExtensions\");\n    public static readonly ImmutableArray<KnownType> SystemActionVariants =\n        ImmutableArray.Create<KnownType>(\n            new(\"System.Action\"),\n            new(\"System.Action\", \"T\"),\n            new(\"System.Action\", \"T1\", \"T2\"),\n            new(\"System.Action\", \"T1\", \"T2\", \"T3\"),\n            new(\"System.Action\", \"T1\", \"T2\", \"T3\", \"T4\"),\n            new(\"System.Action\", \"T1\", \"T2\", \"T3\", \"T4\", \"T5\"),\n            new(\"System.Action\", \"T1\", \"T2\", \"T3\", \"T4\", \"T5\", \"T6\"),\n            new(\"System.Action\", \"T1\", \"T2\", \"T3\", \"T4\", \"T5\", \"T6\", \"T7\"),\n            new(\"System.Action\", \"T1\", \"T2\", \"T3\", \"T4\", \"T5\", \"T6\", \"T7\", \"T8\"),\n            new(\"System.Action\", \"T1\", \"T2\", \"T3\", \"T4\", \"T5\", \"T6\", \"T7\", \"T8\", \"T9\"),\n            new(\"System.Action\", \"T1\", \"T2\", \"T3\", \"T4\", \"T5\", \"T6\", \"T7\", \"T8\", \"T9\", \"T10\"),\n            new(\"System.Action\", \"T1\", \"T2\", \"T3\", \"T4\", \"T5\", \"T6\", \"T7\", \"T8\", \"T9\", \"T10\", \"T11\"),\n            new(\"System.Action\", \"T1\", \"T2\", \"T3\", \"T4\", \"T5\", \"T6\", \"T7\", \"T8\", \"T9\", \"T10\", \"T11\", \"T12\"),\n            new(\"System.Action\", \"T1\", \"T2\", \"T3\", \"T4\", \"T5\", \"T6\", \"T7\", \"T8\", \"T9\", \"T10\", \"T11\", \"T12\", \"T13\"),\n            new(\"System.Action\", \"T1\", \"T2\", \"T3\", \"T4\", \"T5\", \"T6\", \"T7\", \"T8\", \"T9\", \"T10\", \"T11\", \"T12\", \"T13\", \"T14\"),\n            new(\"System.Action\", \"T1\", \"T2\", \"T3\", \"T4\", \"T5\", \"T6\", \"T7\", \"T8\", \"T9\", \"T10\", \"T11\", \"T12\", \"T13\", \"T14\", \"T15\"),\n            new(\"System.Action\", \"T1\", \"T2\", \"T3\", \"T4\", \"T5\", \"T6\", \"T7\", \"T8\", \"T9\", \"T10\", \"T11\", \"T12\", \"T13\", \"T14\", \"T15\", \"T16\"));\n    public static readonly ImmutableArray<KnownType> SystemFuncVariants =\n        ImmutableArray.Create<KnownType>(\n            new(\"System.Func\", \"TResult\"),\n            new(\"System.Func\", \"T\", \"TResult\"),\n            new(\"System.Func\", \"T1\", \"T2\", \"TResult\"),\n            new(\"System.Func\", \"T1\", \"T2\", \"T3\", \"TResult\"),\n            new(\"System.Func\", \"T1\", \"T2\", \"T3\", \"T4\", \"TResult\"),\n            new(\"System.Func\", \"T1\", \"T2\", \"T3\", \"T4\", \"T5\", \"TResult\"),\n            new(\"System.Func\", \"T1\", \"T2\", \"T3\", \"T4\", \"T5\", \"T6\", \"TResult\"),\n            new(\"System.Func\", \"T1\", \"T2\", \"T3\", \"T4\", \"T5\", \"T6\", \"T7\", \"TResult\"),\n            new(\"System.Func\", \"T1\", \"T2\", \"T3\", \"T4\", \"T5\", \"T6\", \"T7\", \"T8\", \"TResult\"),\n            new(\"System.Func\", \"T1\", \"T2\", \"T3\", \"T4\", \"T5\", \"T6\", \"T7\", \"T8\", \"T9\", \"TResult\"),\n            new(\"System.Func\", \"T1\", \"T2\", \"T3\", \"T4\", \"T5\", \"T6\", \"T7\", \"T8\", \"T9\", \"T10\", \"TResult\"),\n            new(\"System.Func\", \"T1\", \"T2\", \"T3\", \"T4\", \"T5\", \"T6\", \"T7\", \"T8\", \"T9\", \"T10\", \"T11\", \"TResult\"),\n            new(\"System.Func\", \"T1\", \"T2\", \"T3\", \"T4\", \"T5\", \"T6\", \"T7\", \"T8\", \"T9\", \"T10\", \"T11\", \"T12\", \"TResult\"),\n            new(\"System.Func\", \"T1\", \"T2\", \"T3\", \"T4\", \"T5\", \"T6\", \"T7\", \"T8\", \"T9\", \"T10\", \"T11\", \"T12\", \"T13\", \"TResult\"),\n            new(\"System.Func\", \"T1\", \"T2\", \"T3\", \"T4\", \"T5\", \"T6\", \"T7\", \"T8\", \"T9\", \"T10\", \"T11\", \"T12\", \"T13\", \"T14\", \"TResult\"),\n            new(\"System.Func\", \"T1\", \"T2\", \"T3\", \"T4\", \"T5\", \"T6\", \"T7\", \"T8\", \"T9\", \"T10\", \"T11\", \"T12\", \"T13\", \"T14\", \"T15\", \"TResult\"),\n            new(\"System.Func\", \"T1\", \"T2\", \"T3\", \"T4\", \"T5\", \"T6\", \"T7\", \"T8\", \"T9\", \"T10\", \"T11\", \"T12\", \"T13\", \"T14\", \"T15\", \"T16\", \"TResult\"));\n    public static readonly ImmutableArray<KnownType> SystemTasks = ImmutableArray.Create(\n            System_Threading_Tasks_Task,\n            System_Threading_Tasks_Task_T,\n            System_Threading_Tasks_ValueTask_TResult);\n    public static readonly KnownType System_Resources_ResourceManager = new(\"System.Resources.ResourceManager\");\n    public static readonly KnownType TimeZoneConverter_TZConvert = new(\"TimeZoneConverter.TZConvert\");\n    public static readonly KnownType UnityEditor_AssetModificationProcessor = new(\"UnityEditor.AssetModificationProcessor\");\n    public static readonly KnownType UnityEditor_AssetPostprocessor = new(\"UnityEditor.AssetPostprocessor\");\n    public static readonly KnownType UnityEngine_MonoBehaviour = new(\"UnityEngine.MonoBehaviour\");\n    public static readonly KnownType UnityEngine_ScriptableObject = new(\"UnityEngine.ScriptableObject\");\n    public static readonly KnownType Xunit_Assert = new(\"Xunit.Assert\");\n    public static readonly KnownType Xunit_Sdk_AssertException = new(\"Xunit.Sdk.AssertException\");\n    public static readonly KnownType Xunit_FactAttribute = new(\"Xunit.FactAttribute\");\n    public static readonly KnownType Xunit_Sdk_XunitException = new(\"Xunit.Sdk.XunitException\");\n    public static readonly KnownType Xunit_TheoryAttribute = new(\"Xunit.TheoryAttribute\");\n    public static readonly KnownType LegacyXunit_TheoryAttribute = new(\"Xunit.Extensions.TheoryAttribute\");\n    public static readonly ImmutableArray<KnownType> CallerInfoAttributes = ImmutableArray.Create(\n            System_Runtime_CompilerServices_CallerArgumentExpressionAttribute,\n            System_Runtime_CompilerServices_CallerFilePathAttribute,\n            System_Runtime_CompilerServices_CallerLineNumberAttribute,\n            System_Runtime_CompilerServices_CallerMemberNameAttribute);\n    public static readonly ImmutableArray<KnownType> DatabaseBaseQueryTypes = ImmutableArray.Create(\n            System_Data_Entity_Infrastructure_DbQuery,\n            System_Data_Entity_Infrastructure_DbQuery_TResult,\n            Microsoft_EntityFrameworkCore_DbSet_TEntity,\n            System_Data_Linq_ITable,\n            System_Data_Entity_Core_Objects_ObjectQuery);\n    public static readonly ImmutableArray<KnownType> FloatingPointNumbers = ImmutableArray.Create(\n            System_Half,\n            System_Single,\n            System_Double,\n            System_Runtime_InteropServices_NFloat);\n    public static readonly ImmutableArray<KnownType> IntegralNumbers = ImmutableArray.Create(\n            System_Int16,\n            System_Int32,\n            System_Int64,\n            System_UInt16,\n            System_UInt32,\n            System_UInt64,\n            System_Char,\n            System_Byte,\n            System_SByte);\n    public static readonly ImmutableArray<KnownType> IntegralNumbersIncludingNative = ImmutableArray.Create(\n            System_Int16,\n            System_Int32,\n            System_Int64,\n            System_UInt16,\n            System_UInt32,\n            System_UInt64,\n            System_Char,\n            System_Byte,\n            System_SByte,\n            System_IntPtr,\n            System_UIntPtr);\n    public static readonly ImmutableArray<KnownType> NonIntegralNumbers = ImmutableArray.Create(\n            System_Single,\n            System_Double,\n            System_Decimal);\n    public static readonly ImmutableArray<KnownType> PointerTypes = ImmutableArray.Create(\n            System_IntPtr,\n            System_UIntPtr);\n    public static readonly ImmutableArray<KnownType> UnsignedIntegers = ImmutableArray.Create(\n            System_UInt64,\n            System_UInt32,\n            System_UInt16);\n    public static readonly ImmutableArray<KnownType> RouteAttributes = ImmutableArray.Create(\n            Microsoft_AspNetCore_Mvc_RouteAttribute,\n            System_Web_Mvc_RouteAttribute);\n    public static readonly ImmutableArray<KnownType> TestMethodAttributesOfMSTest = ImmutableArray.Create(\n            Microsoft_VisualStudio_TestTools_UnitTesting_TestMethodAttribute,\n            Microsoft_VisualStudio_TestTools_UnitTesting_DataTestMethodAttribute);\n    public static readonly ImmutableArray<KnownType> TestMethodAttributesOfNUnit = ImmutableArray.Create(\n            NUnit_Framework_TestAttribute,\n            NUnit_Framework_TestCaseAttribute,\n            NUnit_Framework_TestCaseSourceAttribute,\n            NUnit_Framework_TheoryAttribute,\n            NUnit_Framework_ITestBuilderInterface);\n    public static readonly ImmutableArray<KnownType> TestMethodAttributesOfxUnit = ImmutableArray.Create(\n            Xunit_TheoryAttribute,\n            LegacyXunit_TheoryAttribute,\n            Xunit_FactAttribute);   // In order for the FindFirstTestMethodType to work, FactAttribute should go last as the Theory attribute derives from it.\n    public static readonly ImmutableArray<KnownType> ExpectedExceptionAttributes = ImmutableArray.Create(\n            // Note: XUnit doesn't have a exception attribute\n            Microsoft_VisualStudio_TestTools_UnitTesting_ExpectedExceptionAttribute,\n            NUnit_Framework_ExpectedExceptionAttribute);\n    public static readonly ImmutableArray<KnownType> IgnoreAttributes = ImmutableArray.Create(\n            // Note: XUnit doesn't have a separate \"Ignore\" attribute. It has a \"Skip\" parameter on the test attribute\n            Microsoft_VisualStudio_TestTools_UnitTesting_IgnoreAttribute,\n            NUnit_Framework_IgnoreAttribute);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Semantics/NetFrameworkVersionProvider.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Semantics;\n\npublic enum NetFrameworkVersion\n{\n    // cannot tell\n    Unknown,\n    // probably .NET 3.5\n    Probably35,\n    // between .NET 4.0 (inclusive) and .NET 4.5.1 (inclusive)\n    Between4And451,\n    // after .NET 4.5.2 (inclusive)\n    After452\n}\n\n/// <summary>\n/// This class provides an approximation of the .NET Framework version of the Compilation.\n/// </summary>\n/// <remarks>\n/// This class has been added for the requirements of the S2755 C# implementation, so it is quite limited.\n/// </remarks>\npublic class NetFrameworkVersionProvider\n{\n    public virtual NetFrameworkVersion Version(Compilation compilation)\n    {\n        if (compilation is null)\n        {\n            return NetFrameworkVersion.Unknown;\n        }\n\n        /// See https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/ee471421(v=vs.100)\n        var debuggerSymbol = compilation.GetTypeByMetadataName(KnownType.System_Diagnostics_Debugger);\n        var mscorlibAssembly = debuggerSymbol?.ContainingAssembly;\n        if (mscorlibAssembly is null || !mscorlibAssembly.Identity.Name.Equals(\"mscorlib\", StringComparison.OrdinalIgnoreCase))\n        {\n            return NetFrameworkVersion.Unknown;     // it could be .NET Core or .NET Standard\n        }\n\n        var debuggerConstructorSymbol = debuggerSymbol.GetMembers(\".ctor\").FirstOrDefault();\n        if (debuggerConstructorSymbol is null)\n        {\n            return NetFrameworkVersion.Unknown;     // e.g. .NET Standard or maybe another .NET distribution\n        }\n        else if (!debuggerConstructorSymbol.GetAttributes().Any(x => x.AttributeClass.Name.Equals(\"ObsoleteAttribute\")))\n        {\n            return NetFrameworkVersion.Probably35;  // the constructor was still not deprecated in .NET Framework 3.5\n        }\n        else if (mscorlibAssembly.GetTypeByMetadataName(\"System.IO.UnmanagedMemoryStream\") is { } typeSymbol && !typeSymbol.GetMembers(\"FlushAsync\").IsEmpty)\n        {\n            return NetFrameworkVersion.After452;    // FlushAsync was not present in .NET Framework 4.5.1 and became present in 4.5.2\n        }\n        else\n        {\n            return NetFrameworkVersion.Between4And451;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/SonarAnalyzer.Core.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFramework>netstandard2.0</TargetFramework>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <!-- Do not use a version of Google.Protobuf that depends on System.Memory due to performance problems: https://github.com/dotnet/roslyn/issues/58863 -->\n    <PackageReference Include=\"Google.Protobuf\" Version=\"3.6.1\" />\n    <!-- Grpc.Tools 2.26.0 contains tools/windows_x64/protoc.exe 3.8 which is the latest version compatible with Google.Protobuf 3.6.1 -->\n    <PackageReference Include=\"Grpc.Tools\" Version=\"2.26.0\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"Microsoft.Composition\" Version=\"1.0.27\">\n      <!-- This package is a dependency of Microsoft.CodeAnalysis.CSharp.Workspaces. It is safe to use since it's compatible with .Net Portable runtime -->\n      <NoWarn>NU1701</NoWarn>\n    </PackageReference>\n    <PackageReference Include=\"Microsoft.CodeAnalysis.Workspaces.Common\" Version=\"1.3.2\" />\n    <PackageReference Include=\"System.Collections.Immutable\" Version=\"1.1.37\">\n      <!-- Downgrade System.Collections.Immutable to support VS2015 Update 3 -->\n      <NoWarn>NU1605, NU1701</NoWarn>\n    </PackageReference>\n  </ItemGroup>\n\n  <ItemGroup>\n    <!-- We need to update NuGet and JAR packaging after changing references -->\n    <ProjectReference Include=\"..\\SonarAnalyzer.CFG\\SonarAnalyzer.CFG.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Using Include=\"Microsoft.CodeAnalysis\" />\n    <Using Include=\"Microsoft.CodeAnalysis.Diagnostics\" />\n    <Using Include=\"SonarAnalyzer.Core.AnalysisContext\" />\n    <Using Include=\"SonarAnalyzer.Core.Analyzers\" />\n    <Using Include=\"SonarAnalyzer.Core.Common\" />\n    <Using Include=\"SonarAnalyzer.Core.Extensions\" />\n    <Using Include=\"SonarAnalyzer.Core.Facade\" />\n    <Using Include=\"SonarAnalyzer.Core.Semantics\" />\n    <Using Include=\"SonarAnalyzer.Core.Semantics.Extensions\" />\n    <Using Include=\"SonarAnalyzer.Core.Syntax.Extensions\" />\n    <Using Include=\"SonarAnalyzer.Core.Syntax.Utilities\" />\n    <Using Include=\"SonarAnalyzer.ShimLayer\" />\n    <Using Include=\"StyleCop.Analyzers.Lightup\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Protobuf Include=\"Protobuf/AnalyzerReport.proto\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Syntax/Extensions/AccessibilityExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Syntax.Extensions;\n\npublic static class AccessibilityExtensions\n{\n    /// <summary>\n    /// Beware of Accessibility members:\n    /// ProtectedOrInternal = C# \"protected internal\" or VB.NET \"Protected Friend\" syntax. Accessible from inheriting class OR the same assembly.\n    /// ProtectedAndInternal = C# \"private protected\" or VB.NET \"Private Protected\" syntax. Accessible only from inheriting class in the same assembly.\n    /// </summary>\n    public static bool IsAccessibleOutsideTheType(this Accessibility accessibility) =>\n        accessibility == Accessibility.Public || accessibility == Accessibility.Internal || accessibility == Accessibility.ProtectedOrInternal;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Syntax/Extensions/AttributeDataExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Syntax.Extensions;\n\npublic static class AttributeDataExtensions\n{\n    private static readonly ImmutableArray<KnownType> RouteTemplateProviders = ImmutableArray.Create(\n        KnownType.Microsoft_AspNetCore_Mvc_Routing_IRouteTemplateProvider,\n        KnownType.System_Web_Mvc_Routing_IRouteInfoProvider);\n\n    public static bool HasName(this AttributeData attribute, string name) =>\n        attribute is { AttributeClass.Name: { } attributeClassName } && attributeClassName == name;\n\n    public static bool HasAnyName(this AttributeData attribute, params string[] names) =>\n        names.Any(x => attribute.HasName(x));\n\n    public static string GetAttributeRouteTemplate(this AttributeData attribute) =>\n        attribute.AttributeClass.DerivesOrImplementsAny(RouteTemplateProviders)\n        && attribute.TryGetAttributeValue<string>(\"template\", out var template)\n            ? template\n            : null;\n\n    public static bool TryGetAttributeValue<T>(this AttributeData attribute, string valueName, out T value)\n    {\n        // named arguments take precedence over constructor arguments of the same name. For [Attr(valueName: false, valueName = true)] \"true\" is returned.\n        if (attribute.NamedArguments.IndexOf(x => x.Key.Equals(valueName, StringComparison.OrdinalIgnoreCase)) is var namedAgumentIndex and >= 0)\n        {\n            return TryConvertConstant(attribute.NamedArguments[namedAgumentIndex].Value, out value);\n        }\n        else if (attribute.AttributeConstructor.Parameters.IndexOf(x => x.Name.Equals(valueName, StringComparison.OrdinalIgnoreCase)) is var constructorParameterIndex and >= 0)\n        {\n            return TryConvertConstant(attribute.ConstructorArguments[constructorParameterIndex], out value);\n        }\n        else\n        {\n            value = default;\n            return false;\n        }\n    }\n\n    public static bool HasAttributeUsageInherited(this AttributeData attribute) =>\n        attribute.AttributeClass.GetAttributes()\n            .Where(x => x.AttributeClass.Is(KnownType.System_AttributeUsageAttribute))\n            .SelectMany(x => x.NamedArguments.Where(x => x.Key == nameof(AttributeUsageAttribute.Inherited)))\n            .Where(x => x.Value is { Kind: TypedConstantKind.Primitive, Type.SpecialType: SpecialType.System_Boolean })\n            .Select(x => (bool?)x.Value.Value)\n            .FirstOrDefault() ?? true; // Default value of Inherited is true\n\n    private static bool TryConvertConstant<T>(TypedConstant constant, out T value)\n    {\n        value = default;\n        if (constant.IsNull)\n        {\n            return true;\n        }\n        else if (constant.Value is T result)\n        {\n            value = result;\n            return true;\n        }\n        else if (constant.Value is IConvertible)\n        {\n            try\n            {\n                value = (T)Convert.ChangeType(constant.Value, typeof(T));\n                return true;\n            }\n            catch\n            {\n                return false;\n            }\n        }\n        else\n        {\n            return false;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Syntax/Extensions/BinaryOperatorKindExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Syntax.Extensions;\n\npublic static class BinaryOperatorKindExtensions\n{\n    public static bool IsAnyEquality(this BinaryOperatorKind kind) =>\n        kind.IsEquals() || kind.IsNotEquals();\n\n    public static bool IsEquals(this BinaryOperatorKind kind) =>\n        kind is BinaryOperatorKind.Equals or BinaryOperatorKind.ObjectValueEquals;\n\n    public static bool IsNotEquals(this BinaryOperatorKind kind) =>\n        kind is BinaryOperatorKind.NotEquals or BinaryOperatorKind.ObjectValueNotEquals;\n\n    public static bool IsAnyRelational(this BinaryOperatorKind kind) =>\n        kind is BinaryOperatorKind.GreaterThan or BinaryOperatorKind.GreaterThanOrEqual or BinaryOperatorKind.LessThan or BinaryOperatorKind.LessThanOrEqual;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Syntax/Extensions/ComparisonKindExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Syntax.Extensions;\n\npublic static class ComparisonKindExtensions\n{\n    public static ComparisonKind Mirror(this ComparisonKind comparison) =>\n        comparison switch\n        {\n            ComparisonKind.GreaterThan => ComparisonKind.LessThan,\n            ComparisonKind.GreaterThanOrEqual => ComparisonKind.LessThanOrEqual,\n            ComparisonKind.LessThan => ComparisonKind.GreaterThan,\n            ComparisonKind.LessThanOrEqual => ComparisonKind.GreaterThanOrEqual,\n            _ => comparison,\n        };\n\n    public static string ToDisplayString(this ComparisonKind kind, AnalyzerLanguage language)\n    {\n        if (language != AnalyzerLanguage.CSharp && language != AnalyzerLanguage.VisualBasic)\n        {\n            throw new NotSupportedException($\"Language {language} is not supported.\");\n        }\n        return kind switch\n        {\n            ComparisonKind.Equals when language == AnalyzerLanguage.CSharp => \"==\",\n            ComparisonKind.Equals => \"=\",\n            ComparisonKind.NotEquals when language == AnalyzerLanguage.CSharp => \"!=\",\n            ComparisonKind.NotEquals => \"<>\",\n            ComparisonKind.LessThan => \"<\",\n            ComparisonKind.LessThanOrEqual => \"<=\",\n            ComparisonKind.GreaterThan => \">\",\n            ComparisonKind.GreaterThanOrEqual => \">=\",\n            _ => throw new InvalidOperationException(),\n        };\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Syntax/Extensions/CountComparisonResultExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Syntax.Extensions;\n\npublic static class CountComparisonResultExtensions\n{\n    public static bool IsEmptyOrNotEmpty(this CountComparisonResult comparison) =>\n        comparison == CountComparisonResult.Empty || comparison == CountComparisonResult.NotEmpty;\n\n    public static bool IsInvalid(this CountComparisonResult comparison) =>\n        comparison == CountComparisonResult.AlwaysFalse || comparison == CountComparisonResult.AlwaysTrue;\n\n    public static CountComparisonResult Compare(this ComparisonKind comparison, int count) =>\n        comparison switch\n        {\n            ComparisonKind.Equals => Equals(count),\n            ComparisonKind.NotEquals => NotEquals(count),\n            ComparisonKind.GreaterThanOrEqual => GreaterThanOrEqual(count),\n            ComparisonKind.GreaterThan => GreaterThan(count),\n            ComparisonKind.LessThan => LessThan(count),\n            ComparisonKind.LessThanOrEqual => LessThanOrEqual(count),\n            _ => CountComparisonResult.None,\n        };\n\n    private static CountComparisonResult Equals(int count) =>\n        Check(count, 0, CountComparisonResult.AlwaysFalse, CountComparisonResult.Empty);\n\n    private static CountComparisonResult NotEquals(int count) =>\n        Check(count, 0, CountComparisonResult.AlwaysTrue, CountComparisonResult.NotEmpty);\n\n    private static CountComparisonResult GreaterThan(int count) =>\n        Check(count, 0, CountComparisonResult.AlwaysTrue, CountComparisonResult.NotEmpty);\n\n    private static CountComparisonResult GreaterThanOrEqual(int count) =>\n        Check(count, 1, CountComparisonResult.AlwaysTrue, CountComparisonResult.NotEmpty);\n\n    private static CountComparisonResult LessThan(int count) =>\n        Check(count, 1, CountComparisonResult.AlwaysFalse, CountComparisonResult.Empty);\n\n    private static CountComparisonResult LessThanOrEqual(int count) =>\n        Check(count, 0, CountComparisonResult.AlwaysFalse, CountComparisonResult.Empty);\n\n    private static CountComparisonResult Check(int count, int threshold, CountComparisonResult belowThreshold, CountComparisonResult onThreshold)\n    {\n        if (count == threshold)\n        {\n            return onThreshold;\n        }\n        else\n        {\n            return count < threshold ? belowThreshold : CountComparisonResult.SizeDepedendent;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Syntax/Extensions/FileLinePositionSpanExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Syntax.Extensions;\n\npublic static class FileLinePositionSpanExtensions\n{\n    public static IEnumerable<int> LineNumbers(this FileLinePositionSpan lineSpan, bool isZeroBasedCount = true)\n    {\n        var offset = isZeroBasedCount ? 0 : 1;\n        var start = lineSpan.StartLinePosition.Line + offset;\n        var end = lineSpan.EndLinePosition.Line + offset;\n        return Enumerable.Range(start, end - start + 1);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Syntax/Extensions/LinePositionExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.Core.Syntax.Extensions;\n\npublic static class LinePositionExtensions\n{\n    public static int LineNumberToReport(this LinePosition position) =>\n        position.Line + 1;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Syntax/Extensions/LocationExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Syntax.Extensions;\n\npublic static class LocationExtensions\n{\n    public static FileLinePositionSpan GetMappedLineSpanIfAvailable(this Location location) =>\n        GeneratedCodeRecognizer.IsRazorGeneratedFile(location.SourceTree)\n            ? location.GetMappedLineSpan()\n            : location.GetLineSpan();\n\n    public static Location EnsureMappedLocation(this Location location)\n    {\n        if (location is null || !GeneratedCodeRecognizer.IsRazorGeneratedFile(location.SourceTree))\n        {\n            return location;\n        }\n\n        var lineSpan = location.GetMappedLineSpan();\n\n        return Location.Create(lineSpan.Path, location.SourceSpan, lineSpan.Span);\n    }\n\n    public static int StartLine(this Location location) =>\n        location.GetLineSpan().StartLinePosition.Line;\n\n    public static int StartColumn(this Location location) =>\n        location.GetLineSpan().StartLinePosition.Character;\n\n    public static int EndLine(this Location location) =>\n        location.GetLineSpan().EndLinePosition.Line;\n\n    public static bool IsValid(this Location location, Compilation compilation) =>\n        location.Kind != LocationKind.SourceFile || compilation.ContainsSyntaxTree(location.SourceTree);\n\n    public static SecondaryLocation ToSecondary(this Location location, string message = null, params string[] messageArgs) =>\n        message is not null && messageArgs?.Length > 0\n            ? new(location, string.Format(message, messageArgs))\n            : new(location, message);\n\n    public static int LineNumberToReport(this Location location) =>\n        location.GetMappedLineSpan().StartLinePosition.LineNumberToReport();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Syntax/Extensions/SyntaxNodeExtensions.Roslyn.cs",
    "content": "﻿// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// See the LICENSE file in the project root for more information.\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace Microsoft.CodeAnalysis.Shared.Extensions;\n\n[ExcludeFromCodeCoverage]\npublic static class SyntaxNodeExtensions\n{\n    /// <summary>\n    /// Returns true if is a given token is a child token of a certain type of parent node.\n    /// </summary>\n    /// <typeparam name=\"TParent\">The type of the parent node.</typeparam>\n    /// <param name=\"node\">The node that we are testing.</param>\n    /// <param name=\"childGetter\">A function that, when given the parent node, returns the child token we are interested in.</param>\n    /// <remarks>\n    /// Copied from <seealso href=\"https://github.com/dotnet/roslyn/blob/5a1cc5f83e4baba57f0355a685a5d1f487bfac66/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/SyntaxNodeExtensions.cs#L142\"/>\n    /// </remarks>\n    public static bool IsChildNode<TParent>(this SyntaxNode node, Func<TParent, SyntaxNode> childGetter) where TParent : SyntaxNode\n    {\n        var ancestor = node.GetAncestor<TParent>();\n        if (ancestor == null)\n        {\n            return false;\n        }\n\n        var ancestorNode = childGetter(ancestor);\n\n        return node == ancestorNode;\n    }\n\n    // Copy of\n    // https://github.com/dotnet/roslyn/blob/5a1cc5f83e4baba57f0355a685a5d1f487bfac66/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/SyntaxNodeExtensions.cs#L56\n    public static TNode GetAncestor<TNode>(this SyntaxNode node) where TNode : SyntaxNode\n    {\n        var current = node.Parent;\n        while (current != null)\n        {\n            if (current is TNode tNode)\n            {\n                return tNode;\n            }\n\n            current = current.GetParent(ascendOutOfTrivia: true);\n        }\n\n        return null;\n    }\n\n    // Copy of\n    // https://github.com/dotnet/roslyn/blob/5a1cc5f83e4baba57f0355a685a5d1f487bfac66/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/SyntaxNodeExtensions.cs#L811\n    public static SyntaxNode GetParent(this SyntaxNode node, bool ascendOutOfTrivia)\n    {\n        var parent = node.Parent;\n        if (parent == null && ascendOutOfTrivia)\n        {\n            if (node is IStructuredTriviaSyntax structuredTrivia)\n            {\n                parent = structuredTrivia.ParentTrivia.Token.Parent;\n            }\n        }\n\n        return parent;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Syntax/Extensions/SyntaxNodeExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.Core.Syntax.Extensions;\n\npublic static class SyntaxNodeExtensions\n{\n    public static bool IsKnownType(this SyntaxNode node, KnownType knownType, SemanticModel model)\n    {\n        var type = model.GetSymbolInfo(node).Symbol.GetSymbolType();\n        return type.Is(knownType) || type?.OriginalDefinition?.Is(knownType) == true;\n    }\n\n    public static bool IsDeclarationKnownType(this SyntaxNode node, KnownType knownType, SemanticModel model) =>\n        model.GetDeclaredSymbol(node)?.GetSymbolType().Is(knownType) ?? false;\n\n    public static SemanticModel EnsureCorrectSemanticModelOrDefault(this SyntaxNode node, SemanticModel model) =>\n        node.SyntaxTree.SemanticModelOrDefault(model);\n\n    public static bool ToStringContains(this SyntaxNode node, string s) =>\n        node.ToString().Contains(s);\n\n    public static bool ToStringContains(this SyntaxNode node, string s, StringComparison comparison) =>\n        node.ToString().IndexOf(s, comparison) != -1;\n\n    public static bool ToStringContainsEitherOr(this SyntaxNode node, string a, string b)\n    {\n        var toString = node.ToString();\n        return toString.Contains(a) || toString.Contains(b);\n    }\n\n    public static string GetMappedFilePathFromRoot(this SyntaxNode root)\n    {\n        if (root.DescendantTrivia().FirstOrDefault() is { RawKind: (ushort)Microsoft.CodeAnalysis.CSharp.SyntaxKind.PragmaChecksumDirectiveTrivia } pragmaChecksum)\n        {\n            // The format is: #pragma checksum \"filename\" \"{guid}\" \"checksum bytes\"\n            // See https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/preprocessor-directives#pragma-checksum\n            var content = pragmaChecksum.ToString();\n            var firstIndex = content.IndexOf('\"');\n            var start = firstIndex + 1;\n            var secondIndex = content.IndexOf('\"', start);\n            return content.Substring(start, secondIndex - start);\n        }\n\n        return root.SyntaxTree.FilePath;\n    }\n\n    public static TSyntaxKind Kind<TSyntaxKind>(this SyntaxNode node) where TSyntaxKind : struct, Enum =>\n        node is null ? default : (TSyntaxKind)Enum.ToObject(typeof(TSyntaxKind), node.RawKind);\n\n    public static SecondaryLocation ToSecondaryLocation(this SyntaxNode node, string message = null, params string[] messageArgs) =>\n        message is not null && messageArgs?.Length > 0\n            ? new(node.GetLocation(), string.Format(message, messageArgs))\n            : new(node.GetLocation(), message);\n\n    public static int LineNumberToReport(this SyntaxNode node) =>\n        node.GetLocation().LineNumberToReport();\n\n    public static bool HasFlagsAttribute(this SyntaxNode node, SemanticModel model) =>\n        model.GetDeclaredSymbol(node).HasAttribute(KnownType.System_FlagsAttribute);\n\n    public static Location CreateLocation(this SyntaxNode from, SyntaxNode to) =>\n        Location.Create(from.SyntaxTree, TextSpan.FromBounds(from.SpanStart, to.Span.End));\n\n    public static Location CreateLocation(this SyntaxNode from, SyntaxToken to) =>\n        Location.Create(from.SyntaxTree, TextSpan.FromBounds(from.SpanStart, to.Span.End));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Syntax/Extensions/SyntaxTokenExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.Core.Syntax.Extensions;\n\npublic static class SyntaxTokenExtensions\n{\n    public static int Line(this SyntaxToken token) =>\n        token.GetLocation().StartLine();\n\n    public static SecondaryLocation ToSecondaryLocation(this SyntaxToken token, string message = null, params string[] messageArgs) =>\n        message is not null && messageArgs?.Length > 0\n            ? new(token.GetLocation(), string.Format(message, messageArgs))\n            : new(token.GetLocation(), message);\n\n    public static Location CreateLocation(this SyntaxToken from, SyntaxToken to) =>\n        Location.Create(from.SyntaxTree, TextSpan.FromBounds(from.SpanStart, to.Span.End));\n\n    public static Location CreateLocation(this SyntaxToken from, SyntaxNode to) =>\n        Location.Create(from.SyntaxTree, TextSpan.FromBounds(from.SpanStart, to.Span.End));\n\n    public static IEnumerable<int> LineNumbers(this SyntaxToken token, bool isZeroBasedCount = true) =>\n        token.GetLocation().GetLineSpan().LineNumbers(isZeroBasedCount);\n\n    public static bool IsFirstTokenOnLine(this SyntaxToken token) =>\n        token.Line() != token.GetPreviousToken().Line();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Syntax/Extensions/SyntaxTreeExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Runtime.CompilerServices;\nusing Roslyn.Utilities;\n\nnamespace SonarAnalyzer.Core.Syntax.Extensions;\n\ninternal static class SyntaxTreeExtensions\n{\n    private static readonly ConditionalWeakTable<SyntaxTree, object> GeneratedCodeCache = new();\n\n    [PerformanceSensitive(\"https://github.com/SonarSource/sonar-dotnet/issues/7439\", AllowCaptures = false, AllowGenericEnumeration = false, AllowImplicitBoxing = false)]\n    public static bool IsGenerated(this SyntaxTree tree, GeneratedCodeRecognizer generatedCodeRecognizer)\n    {\n        if (tree is null)\n        {\n            return false;\n        }\n        else\n        {\n            return GeneratedCodeCache.TryGetValue(tree, out var result)\n                ? (bool)result\n                : IsGeneratedGetOrAdd(tree, generatedCodeRecognizer);\n        }\n    }\n\n    public static bool IsConsideredGenerated(this SyntaxTree tree, GeneratedCodeRecognizer generatedCodeRecognizer, bool isRazorAnalysisEnabled) =>\n        isRazorAnalysisEnabled\n            ? tree.IsGenerated(generatedCodeRecognizer) && !GeneratedCodeRecognizer.IsRazorGeneratedFile(tree)\n            : tree.IsGenerated(generatedCodeRecognizer);\n\n    public static string GetOriginalFilePath(this SyntaxTree tree) =>\n        // Currently we support only C# based generated files.\n        tree.GetRoot().DescendantNodes(_ => true, true).OfType<Microsoft.CodeAnalysis.CSharp.Syntax.PragmaChecksumDirectiveTriviaSyntax>().FirstOrDefault() is { } pragmaChecksum\n            ? pragmaChecksum.File.ValueText\n            : tree.FilePath;\n\n    public static bool EndsWith(this SyntaxTree tree, string suffix) =>\n        tree.FilePath.EndsWith(suffix, StringComparison.OrdinalIgnoreCase);\n\n    private static bool IsGeneratedGetOrAdd(SyntaxTree tree, GeneratedCodeRecognizer generatedCodeRecognizer) =>\n        (bool)GeneratedCodeCache.GetValue(tree, x => generatedCodeRecognizer.IsGenerated(x));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Syntax/Extensions/SyntaxTriviaExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Syntax.Extensions;\n\npublic static class SyntaxTriviaExtensions\n{\n    public static IEnumerable<int> LineNumbers(this SyntaxTrivia trivia, bool isZeroBasedCount = true) =>\n        trivia.GetLocation().GetLineSpan().LineNumbers(isZeroBasedCount);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Syntax/Utilities/AccessorAccess.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Syntax.Utilities;\n\n[Flags]\npublic enum AccessorAccess\n{\n    None = 0,\n    Get = 1,\n    Set = 2,\n    Both = Get | Set\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Syntax/Utilities/ComparisonKind.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Syntax.Utilities;\n\npublic enum ComparisonKind\n{\n    None = 0,\n    Equals,\n    NotEquals,\n    LessThan,\n    LessThanOrEqual,\n    GreaterThan,\n    GreaterThanOrEqual,\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Syntax/Utilities/CountComparisionResult.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Syntax.Utilities;\n\npublic enum CountComparisonResult\n{\n    None,\n    SizeDepedendent,\n    Empty,\n    NotEmpty,\n    AlwaysTrue,\n    AlwaysFalse,\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Syntax/Utilities/EquivalenceChecker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Syntax.Utilities;\n\npublic static class EquivalenceChecker\n{\n    public static bool AreEquivalent(SyntaxNode node1, SyntaxNode node2, Func<SyntaxNode, SyntaxNode, bool> nodeComparator) =>\n        node1.Language == node2.Language && nodeComparator(node1, node2);\n\n    public static bool AreEquivalent(SyntaxList<SyntaxNode> nodeList1, SyntaxList<SyntaxNode> nodeList2, Func<SyntaxNode, SyntaxNode, bool> nodeComparator)\n    {\n        if (nodeList1.Count != nodeList2.Count)\n        {\n            return false;\n        }\n\n        for (var i = 0; i < nodeList1.Count; i++)\n        {\n            if (!AreEquivalent(nodeList1[i], nodeList2[i], nodeComparator))\n            {\n                return false;\n            }\n        }\n\n        return true;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Syntax/Utilities/ExpressionNumericConverterBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Syntax.Utilities;\n\npublic abstract class ExpressionNumericConverterBase<TLiteralExpressionSyntax, TUnaryExpressionSyntax> : IExpressionNumericConverter\n    where TLiteralExpressionSyntax : SyntaxNode\n    where TUnaryExpressionSyntax : SyntaxNode\n{\n    protected abstract object TokenValue(TLiteralExpressionSyntax literalExpression);\n    protected abstract SyntaxNode Operand(TUnaryExpressionSyntax unaryExpression);\n    protected abstract bool IsSupportedOperator(TUnaryExpressionSyntax unaryExpression);\n    protected abstract bool IsMinusOperator(TUnaryExpressionSyntax unaryExpression);\n    protected abstract SyntaxNode RemoveParentheses(SyntaxNode expression);\n\n    public int? ConstantIntValue(SemanticModel model, SyntaxNode expression) =>\n        ConstantValue(model, expression, Convert.ToInt32, (multiplier, v) => multiplier * v);\n\n    public int? ConstantIntValue(SyntaxNode expression) =>\n        ConstantValue(null, expression, Convert.ToInt32, (multiplier, v) => multiplier * v);\n\n    public double? ConstantDoubleValue(SyntaxNode expression) =>\n        ConstantValue(null, expression, Convert.ToDouble, (multiplier, v) => multiplier * v);\n\n    public decimal? ConstantDecimalValue(SyntaxNode expression) =>\n        ConstantValue(null, expression, Convert.ToDecimal, (multiplier, v) => multiplier * v);\n\n    private T? ConstantValue<T>(SemanticModel model, SyntaxNode expression, Func<object, T> converter, Func<int, T, T> multiplierCalculator)\n        where T : struct\n    {\n        expression = RemoveParentheses(expression);\n        if (Multiplier(expression, out var internalExpression) is int multiplier\n            && internalExpression is TLiteralExpressionSyntax literalExpression\n            && Conversions.ConvertWith(TokenValue(literalExpression), converter) is { } value)\n        {\n            return multiplierCalculator(multiplier, value);\n        }\n        else if (model?.GetConstantValue(expression) is { HasValue: true } optional && optional.Value is T constantValue)\n        {\n            return constantValue;\n        }\n        else\n        {\n            return null;\n        }\n    }\n\n    private int? Multiplier(SyntaxNode expression, out SyntaxNode internalExpression)\n    {\n        var multiplier = 1;\n        internalExpression = expression;\n        var unary = internalExpression as TUnaryExpressionSyntax;\n        while (unary is not null)\n        {\n            if (!IsSupportedOperator(unary))\n            {\n                return null;\n            }\n\n            if (IsMinusOperator(unary))\n            {\n                multiplier *= -1;\n            }\n\n            internalExpression = Operand(unary);\n            unary = internalExpression as TUnaryExpressionSyntax;\n        }\n        return multiplier;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Syntax/Utilities/GeneratedCodeRecognizer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\nusing System.Text.RegularExpressions;\n\nnamespace SonarAnalyzer.Core.Syntax.Utilities;\n\npublic abstract class GeneratedCodeRecognizer\n{\n    private static readonly ImmutableArray<string> GeneratedFileParts = ImmutableArray.Create(\n        \".g.\",\n        \".generated.\",\n        \".designer.\",\n        \"_generated.\",\n        \"temporarygeneratedfile_\",\n        \".assemblyattributes.vb\"); // The C# version of this file can already be detected because it contains special comments\n\n    private static readonly ImmutableArray<string> AutoGeneratedCommentParts = ImmutableArray.Create(\n        \"<auto-generated\",\n        \"<autogenerated\",\n        \"generated by\");\n\n    private static readonly ImmutableArray<string> GeneratedCodeAttributes = ImmutableArray.Create(\n        \"DebuggerNonUserCode\",\n        \"DebuggerNonUserCodeAttribute\",\n        \"GeneratedCode\",\n        \"GeneratedCodeAttribute\",\n        \"CompilerGenerated\",\n        \"CompilerGeneratedAttribute\");\n\n    private static readonly Regex RazorPattern = new(@\".*razor(?!.cshtml)(\\.[-\\w]*)?(\\.ide)?\\.g\\.cs$\", RegexOptions.Compiled | RegexOptions.IgnoreCase, Constants.DefaultRegexTimeout);\n\n    private static readonly Regex CshtmlPattern = new(@\".*cshtml(?!.razor)(\\.[-\\w]*)?(\\.ide)?\\.g\\.cs$\", RegexOptions.Compiled | RegexOptions.IgnoreCase, Constants.DefaultRegexTimeout);\n\n    protected abstract bool IsTriviaComment(SyntaxTrivia trivia);\n    protected abstract string GetAttributeName(SyntaxNode node);\n\n    public bool IsGenerated(SyntaxTree tree) =>\n         !string.IsNullOrEmpty(tree.FilePath)\n         && (HasGeneratedFileName(tree) || HasGeneratedCommentOrAttribute(tree));\n\n    /// <summary>\n    /// Detects if the file has been generated by the the compiler for Razor.\n    /// </summary>\n    public static bool IsBuildTimeRazorGeneratedFile(SyntaxTree tree) =>\n        tree is not null\n        && (tree.EndsWith(\"razor.g.cs\") || tree.EndsWith(\"cshtml.g.cs\"));\n\n    /// <summary>\n    /// Detects if the file has been generated by the IDE (VS only for now) for Razor.\n    /// </summary>\n    public static bool IsDesignTimeRazorGeneratedFile(SyntaxTree tree) =>\n        tree is not null\n        && tree.EndsWith(\"ide.g.cs\")\n        && IsRazorGeneratedFile(tree);\n\n    public static bool IsRazorGeneratedFile(SyntaxTree tree) =>\n        tree is not null && (IsRazor(tree) || IsCshtml(tree));\n\n    public static bool IsRazor(SyntaxTree tree) =>\n        tree.EndsWith(\".g.cs\")                      // Performance\n        && RazorPattern.SafeIsMatch(tree.FilePath);\n\n    public static bool IsCshtml(SyntaxTree tree) =>\n        tree.EndsWith(\".g.cs\")                      // Performance\n        && CshtmlPattern.SafeIsMatch(tree.FilePath);\n\n    private bool HasGeneratedCommentOrAttribute(SyntaxTree tree)\n    {\n        var root = tree.GetRoot();\n        if (root is null)\n        {\n            return false;\n        }\n        return HasAutoGeneratedComment(root) || HasGeneratedCodeAttribute(root);\n    }\n\n    private bool HasAutoGeneratedComment(SyntaxNode root)\n    {\n        var firstToken = root.GetFirstToken(true);\n\n        if (!firstToken.HasLeadingTrivia)\n        {\n            return false;\n        }\n\n        return firstToken.LeadingTrivia\n            .Where(IsTriviaComment)\n            .Any(x => AutoGeneratedCommentParts.Any(part => x.ToString().IndexOf(part, StringComparison.OrdinalIgnoreCase) >= 0));\n    }\n\n    private bool HasGeneratedCodeAttribute(SyntaxNode root)\n    {\n        var attributeNames = root\n            .DescendantNodesAndSelf()\n            .Select(GetAttributeName)\n            .Where(x => !string.IsNullOrEmpty(x));\n\n        return attributeNames.Any(x => GeneratedCodeAttributes.Any(attribute => x.EndsWith(attribute, StringComparison.Ordinal)));\n    }\n\n    private static bool HasGeneratedFileName(SyntaxTree tree)\n    {\n        var fileName = Path.GetFileName(tree.FilePath);\n        return GeneratedFileParts.Any(x => fileName.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Syntax/Utilities/IExpressionNumericConverter.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Syntax.Utilities;\n\npublic interface IExpressionNumericConverter\n{\n    int? ConstantIntValue(SemanticModel model, SyntaxNode expression);\n    int? ConstantIntValue(SyntaxNode expression);\n    double? ConstantDoubleValue(SyntaxNode expression);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Syntax/Utilities/MethodParameterLookupBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Syntax.Utilities;\n\npublic interface IMethodParameterLookup\n{\n    IMethodSymbol MethodSymbol { get; }\n    bool TryGetSymbol(SyntaxNode argument, out IParameterSymbol parameter);\n    bool TryGetSyntax(IParameterSymbol parameter, out ImmutableArray<SyntaxNode> expressions);\n    bool TryGetSyntax(string parameterName, out ImmutableArray<SyntaxNode> expressions);\n    bool TryGetNonParamsSyntax(IParameterSymbol parameter, out SyntaxNode expression);\n}\n\n// This should come from the Roslyn API (https://github.com/dotnet/roslyn/issues/9)\npublic abstract class MethodParameterLookupBase<TArgumentSyntax> : IMethodParameterLookup\n    where TArgumentSyntax : SyntaxNode\n{\n    private readonly SeparatedSyntaxList<TArgumentSyntax> argumentList;\n\n    protected abstract SyntaxToken? GetNameColonIdentifier(TArgumentSyntax argument);\n    protected abstract SyntaxToken? GetNameEqualsIdentifier(TArgumentSyntax argument);\n    protected abstract SyntaxNode Expression(TArgumentSyntax argument);\n\n    public IMethodSymbol MethodSymbol { get; }\n    private ImmutableArray<IMethodSymbol> MethodSymbolOrCandidates { get; }\n\n    protected MethodParameterLookupBase(SeparatedSyntaxList<TArgumentSyntax> argumentList, SymbolInfo? methodSymbolInfo)\n        : this(argumentList, methodSymbolInfo?.Symbol as IMethodSymbol, methodSymbolInfo?.AllSymbols().OfType<IMethodSymbol>()) { }\n\n    protected MethodParameterLookupBase(SeparatedSyntaxList<TArgumentSyntax> argumentList, IMethodSymbol methodSymbol)\n        : this(argumentList, methodSymbol, [methodSymbol]) { }\n\n    private MethodParameterLookupBase(SeparatedSyntaxList<TArgumentSyntax> argumentList, IMethodSymbol methodSymbol, IEnumerable<IMethodSymbol> methodSymbolOrCandidates)\n    {\n        this.argumentList = argumentList;\n        MethodSymbol = methodSymbol;\n        MethodSymbolOrCandidates = methodSymbolOrCandidates?.ToImmutableArray() ?? ImmutableArray.Create<IMethodSymbol>();\n    }\n\n    /// <summary>\n    /// Method returns array of argument syntaxes that represents all syntaxes passed to the parameter.\n    ///\n    /// There could be multiple syntaxes for ParamArray/params.\n    /// There could be zero or one result for optional parameters.\n    /// There will be single result for normal parameters.\n    /// </summary>\n    public bool TryGetSyntax(IParameterSymbol parameter, out ImmutableArray<SyntaxNode> expressions) =>\n        TryGetSyntax(parameter.Name, out expressions);\n\n    /// <summary>\n    /// Method returns array of argument syntaxes that represents all syntaxes passed to the parameter.\n    ///\n    /// There could be multiple syntaxes for ParamArray/params.\n    /// There could be zero or one result for optional parameters.\n    /// There will be single result for normal parameters.\n    public bool TryGetSyntax(string parameterName, out ImmutableArray<SyntaxNode> expressions)\n    {\n        var candidateArgumentLists = MethodSymbolOrCandidates\n            .Select(x => GetAllArgumentParameterMappings(x).Where(x => x.Symbol.Name == parameterName).Select(x => Expression(x.Node)).ToImmutableArray()).ToImmutableArray();\n        expressions = candidateArgumentLists.Any() && AllArgumentsAreTheSame(candidateArgumentLists)\n            ? candidateArgumentLists[0]\n            : Enumerable.Empty<SyntaxNode>().ToImmutableArray();\n        return !expressions.IsEmpty;\n\n        static bool AllArgumentsAreTheSame(ImmutableArray<ImmutableArray<SyntaxNode>> candidateArgumentLists) =>\n            candidateArgumentLists.Skip(1).All(x => x.SequenceEqual(candidateArgumentLists[0]));\n    }\n\n    /// <summary>\n    /// Method returns zero or one argument syntax that represents syntax passed to the parameter.\n    ///\n    /// Caller must ensure that given parameter is not ParamArray/params.\n    /// </summary>\n    public bool TryGetNonParamsSyntax(IParameterSymbol parameter, out SyntaxNode expression)\n    {\n        if (parameter.IsParams)\n        {\n            throw new InvalidOperationException(\"Cannot call TryGetNonParamsSyntax on ParamArray/params parameters.\");\n        }\n        if (TryGetSyntax(parameter, out var all))\n        {\n            expression = all.Single();\n            return true;\n        }\n        expression = null;\n        return false;\n    }\n\n    public IEnumerable<NodeAndSymbol<TArgumentSyntax, IParameterSymbol>> GetAllArgumentParameterMappings() =>\n        GetAllArgumentParameterMappings(MethodSymbol);\n\n    public bool TryGetSymbol(SyntaxNode argument, out IParameterSymbol parameter) =>\n        TryGetSymbol(argument, MethodSymbol, out parameter);\n\n    private bool TryGetSymbol(SyntaxNode argument, IMethodSymbol methodSymbol, out IParameterSymbol parameter)\n    {\n        parameter = null;\n        var arg = argument as TArgumentSyntax ?? throw new ArgumentException($\"{nameof(argument)} must be of type {typeof(TArgumentSyntax)}\", nameof(argument));\n\n        if (!argumentList.Contains(arg)\n            || methodSymbol is null\n            || methodSymbol.IsVararg)\n        {\n            return false;\n        }\n\n        if (GetNameColonIdentifier(arg) is { } nameColonIdentifier)\n        {\n            parameter = methodSymbol.Parameters.FirstOrDefault(x => x.Name == nameColonIdentifier.ValueText);\n            return parameter is not null;\n        }\n\n        if (GetNameEqualsIdentifier(arg) is { } nameEqualsIdentifier\n            && methodSymbol.ContainingType.GetMembers(nameEqualsIdentifier.ValueText) is { Length: 1 } properties\n            && properties[0] is IPropertySymbol { SetMethod: { } setter } property\n            && property.Name == nameEqualsIdentifier.ValueText\n            && setter.Parameters is { Length: 1 } parameters)\n        {\n            parameter = parameters[0];\n            return parameter is not null;\n        }\n\n        var index = argumentList.IndexOf(arg);\n        if (index >= methodSymbol.Parameters.Length)\n        {\n            var lastParameter = methodSymbol.Parameters.Last();\n            parameter = lastParameter.IsParams ? lastParameter : null;\n            return parameter is not null;\n        }\n        parameter = methodSymbol.Parameters[index];\n        return true;\n    }\n\n    private IEnumerable<NodeAndSymbol<TArgumentSyntax, IParameterSymbol>> GetAllArgumentParameterMappings(IMethodSymbol methodSymbol)\n    {\n        foreach (var argument in argumentList)\n        {\n            if (TryGetSymbol(argument, methodSymbol, out var parameter))\n            {\n                yield return new NodeAndSymbol<TArgumentSyntax, IParameterSymbol>(argument, parameter);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Syntax/Utilities/RemovableDeclarationCollectorBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing NodeSymbolAndModel = SonarAnalyzer.Core.Common.NodeSymbolAndModel<Microsoft.CodeAnalysis.SyntaxNode, Microsoft.CodeAnalysis.ISymbol>;\n\nnamespace SonarAnalyzer.Core.Syntax.Utilities;\n\n// For C#, TOwnerOfSubnodes == TDeclaration == BaseTypeDeclarationSyntax\n// For VB, TOwnerOfSubnodes == TypeBlockSyntax, TDeclaration = TypeStatementSyntax\npublic abstract class RemovableDeclarationCollectorBase<TOwnerOfSubnodes, TDeclaration, TSyntaxKind>\n    where TOwnerOfSubnodes : SyntaxNode\n    where TDeclaration : SyntaxNode\n{\n    private readonly Compilation compilation;\n    private readonly INamedTypeSymbol namedType;\n\n    public abstract IEnumerable<NodeSymbolAndModel> RemovableFieldLikeDeclarations(ISet<TSyntaxKind> kinds, Accessibility maxAccessibility);\n    public abstract TOwnerOfSubnodes OwnerOfSubnodes(TDeclaration node);\n    protected abstract IEnumerable<SyntaxNode> MatchingDeclarations(NodeAndModel<TOwnerOfSubnodes> container, ISet<TSyntaxKind> kinds);\n\n    public IEnumerable<NodeAndModel<TOwnerOfSubnodes>> TypeDeclarations =>\n        field ??= namedType.DeclaringSyntaxReferences\n            .Select(x => x.GetSyntax())\n            .OfType<TDeclaration>()\n            .Select(x => new NodeAndModel<TOwnerOfSubnodes>(OwnerOfSubnodes(x), compilation.GetSemanticModel(x.SyntaxTree)))\n            .Where(x => x.Model is not null);\n\n    protected RemovableDeclarationCollectorBase(INamedTypeSymbol namedType, Compilation compilation)\n    {\n        this.namedType = namedType;\n        this.compilation = compilation;\n    }\n\n    public IEnumerable<NodeSymbolAndModel> RemovableDeclarations(ISet<TSyntaxKind> kinds, Accessibility maxAccessibility) =>\n        TypeDeclarations\n            .SelectMany(x => MatchingDeclarations(x, kinds).Select(declaration => CreateNodeSymbolAndModel(declaration, x.Model)))\n            .Where(x => IsRemovable(x.Symbol, maxAccessibility));\n\n    public static bool IsRemovable(IMethodSymbol methodSymbol, Accessibility maxAccessibility) =>\n        IsRemovable((ISymbol)methodSymbol, maxAccessibility)\n        && (methodSymbol.MethodKind == MethodKind.Ordinary || methodSymbol.MethodKind == MethodKind.Constructor)\n        && !methodSymbol.IsMainMethod()\n        && !methodSymbol.IsEventHandler()\n        && !methodSymbol.IsSerializationConstructor();\n\n    protected static bool IsRemovable(ISymbol symbol, Accessibility maxAccessibility) =>\n        symbol is not null\n        && symbol.GetEffectiveAccessibility() <= maxAccessibility\n        && !symbol.IsImplicitlyDeclared\n        && !symbol.IsAbstract\n        && !symbol.IsVirtual\n        && symbol.GetAttributes().IsEmpty()\n        && !symbol.ContainingType.IsInterface()\n        && symbol.InterfaceMembers().IsEmpty()\n        && symbol.GetOverriddenMember() is null;\n\n    protected static NodeSymbolAndModel CreateNodeSymbolAndModel(SyntaxNode node, SemanticModel model) =>\n        new(node, model.GetDeclaredSymbol(node), model);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Syntax/Utilities/StringInterpolationConstantValueResolver.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text;\n\nnamespace SonarAnalyzer.Core.Syntax.Utilities;\n\npublic abstract class StringInterpolationConstantValueResolver<TSyntaxKind,\n                                                               TInterpolatedStringExpressionSyntax,\n                                                               TInterpolatedStringContentSyntax,\n                                                               TInterpolationSyntax,\n                                                               TInterpolatedStringTextSyntax>\n    where TSyntaxKind : struct\n    where TInterpolatedStringExpressionSyntax : SyntaxNode\n    where TInterpolatedStringContentSyntax : SyntaxNode\n    where TInterpolationSyntax : SyntaxNode\n    where TInterpolatedStringTextSyntax : SyntaxNode\n{\n    protected abstract ILanguageFacade<TSyntaxKind> Language { get; }\n    protected abstract IEnumerable<TInterpolatedStringContentSyntax> Contents(TInterpolatedStringExpressionSyntax interpolatedStringExpression);\n    protected abstract SyntaxToken TextToken(TInterpolatedStringTextSyntax interpolatedStringText);\n\n    public string InterpolatedTextValue(TInterpolatedStringExpressionSyntax interpolatedStringExpression, SemanticModel model)\n    {\n        var resolvedContent = new StringBuilder();\n        foreach (var interpolatedStringContent in Contents(interpolatedStringExpression))\n        {\n            if (interpolatedStringContent is TInterpolationSyntax interpolation)\n            {\n                if (Language.Syntax.NodeExpression(interpolation) is TInterpolatedStringExpressionSyntax nestedInterpolatedString\n                    && InterpolatedTextValue(nestedInterpolatedString, model) is { } innerInterpolatedValue)\n                {\n                    resolvedContent.Append(innerInterpolatedValue);\n                }\n                else if (Language.FindConstantValue(model, Language.Syntax.NodeExpression(interpolation)) is string constantValue)\n                {\n                    resolvedContent.Append(constantValue);\n                }\n                else\n                {\n                    return null;\n                }\n            }\n            else if (interpolatedStringContent is TInterpolatedStringTextSyntax interpolatedText)\n            {\n                resolvedContent.Append(TextToken(interpolatedText).Text);\n            }\n            else\n            {\n                return null;\n            }\n        }\n        return resolvedContent.ToString();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Syntax/Utilities/VisualIndentComparer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Syntax.Utilities;\n\n/// <summary>\n/// Class to determine if visually one line is more indented than another.\n/// </summary>\n/// <remarks>\n/// If the strings contain a mix of tab and non-tab characters then the text that appears most indented will depend on what the tab spacing used by IDE is.\n/// </remarks>\ninternal static class VisualIndentComparer\n{\n    public static bool IsSecondIndentLonger(SyntaxNode node1, SyntaxNode node2)\n    {\n        var node1LinePosition = node1.GetLocation().GetLineSpan().StartLinePosition;\n        var node2LinePosition = node2.GetLocation().GetLineSpan().StartLinePosition;\n\n        var lines = node1.SyntaxTree.GetText().Lines;\n        var indentText1 = lines[node1LinePosition.Line].ToString().Substring(0, node1LinePosition.Character);\n        var indentText2 = lines[node2LinePosition.Line].ToString().Substring(0, node2LinePosition.Character);\n\n        return IsSecondIndentLonger(indentText1, indentText2);\n    }\n\n    /// <summary>\n    /// Returns true if it seems likely that the second indent will appear visually longer than the first. The method will only return false if it there is a high\n    /// degree of confidence that the second input is definitely the same length or shorter (i.e. low number of false positives).\n    /// </summary>\n    public static bool IsSecondIndentLonger(string indent1, string indent2)\n    {\n        var tabCount1 = TabCount(indent1);\n        var tabCount2 = TabCount(indent2);\n\n        // If the number of indent tabs is the same then it's safe just to use the absolute number of charaters\n        if (tabCount1 == tabCount2)\n        {\n            return indent2.Length > indent1.Length;\n        }\n        else if (tabCount1 > tabCount2 && indent1.Length >= indent2.Length)\n        {\n            // More tabs in first and same or more characters overall -> second definitely shorter\n            return false;\n        }\n        else\n        {\n            // The second string has more tabs. If it is also longer overall then we'll return true.\n            // However, if it has more tabs but fewer letters, we're not sure - it depends on what the tab setting is.\n            // Since we're only returning false if we're sure, we'll return true in that case too.\n            return true;\n        }\n    }\n\n    private static int TabCount(string text) =>\n        text.Count(x => x == '\\t');\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Trackers/ArgumentContext.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Trackers;\n\npublic class ArgumentContext : SyntaxBaseContext\n{\n    public IParameterSymbol Parameter { get; internal set; }\n\n    public ArgumentContext(SonarSyntaxNodeReportingContext context) : base(context) { }\n\n    public ArgumentContext(SyntaxNode node, SemanticModel model) : base(node, model) { }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Trackers/ArgumentDescriptor.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Trackers;\n\npublic enum MemberKind\n{\n    Method,\n    Constructor,\n    Indexer,\n    Attribute\n}\n\npublic class ArgumentDescriptor\n{\n    public MemberKind MemberKind { get; }\n    public Func<IReadOnlyCollection<SyntaxNode>, int?, bool> ArgumentListConstraint { get; }\n    public RefKind? RefKind { get; }\n    public Func<IParameterSymbol, bool> ParameterConstraint { get; }\n    public Func<string, StringComparison, bool> InvokedMemberNameConstraint { get; }\n    public Func<SemanticModel, ILanguageFacade, SyntaxNode, bool> InvokedMemberNodeConstraint { get; }\n    public Func<IMethodSymbol, bool> InvokedMemberConstraint { get; }\n\n    private ArgumentDescriptor(MemberKind memberKind,\n                               Func<IMethodSymbol, bool> invokedMemberConstraint,\n                               Func<string, StringComparison, bool> invokedMemberNameConstraint,\n                               Func<SemanticModel, ILanguageFacade, SyntaxNode, bool> invokedMemberNodeConstraint,\n                               Func<IReadOnlyCollection<SyntaxNode>, int?, bool> argumentListConstraint,\n                               Func<IParameterSymbol, bool> parameterConstraint,\n                               RefKind? refKind)\n    {\n        MemberKind = memberKind;\n        ArgumentListConstraint = argumentListConstraint;\n        RefKind = refKind;\n        ParameterConstraint = parameterConstraint;\n        InvokedMemberNameConstraint = invokedMemberNameConstraint;\n        InvokedMemberNodeConstraint = invokedMemberNodeConstraint;\n        InvokedMemberConstraint = invokedMemberConstraint;\n    }\n\n    public static ArgumentDescriptor MethodInvocation(KnownType invokedType, string methodName, string parameterName, int argumentPosition) =>\n        MethodInvocation(invokedType, methodName, parameterName, x => x == argumentPosition);\n\n    public static ArgumentDescriptor MethodInvocation(KnownType invokedType, string methodName, string parameterName, Func<int, bool> argumentPosition) =>\n        MethodInvocation(invokedType, methodName, x => x.Name == parameterName, argumentPosition, null);\n\n    public static ArgumentDescriptor MethodInvocation(KnownType invokedType, string methodName, string parameterName, Func<int, bool> argumentPosition, RefKind refKind) =>\n        MethodInvocation(invokedType, methodName, x => x.Name == parameterName, argumentPosition, refKind);\n\n    public static ArgumentDescriptor MethodInvocation(KnownType invokedType,\n                                                      Func<string, StringComparison, bool> invokedMemberNameConstraint,\n                                                      Func<IParameterSymbol, bool> parameterConstraint,\n                                                      Func<int, bool> argumentPosition,\n                                                      RefKind? refKind) =>\n        MethodInvocation(x => invokedType.Matches(x.ContainingType), invokedMemberNameConstraint, parameterConstraint, argumentPosition, refKind);\n\n    public static ArgumentDescriptor MethodInvocation(Func<IMethodSymbol, bool> invokedMemberConstraint,\n                                                      Func<string, StringComparison, bool> invokedMemberNameConstraint,\n                                                      Func<IParameterSymbol, bool> parameterConstraint,\n                                                      Func<int, bool> argumentPosition,\n                                                      RefKind? refKind) =>\n        MethodInvocation(invokedMemberConstraint,\n            invokedMemberNameConstraint,\n            (_, _, _) => true,\n            parameterConstraint,\n            (_, position) => position is null || argumentPosition is null || argumentPosition(position.Value),\n            refKind);\n\n    public static ArgumentDescriptor MethodInvocation(Func<IMethodSymbol, bool> invokedMemberConstraint,\n                                                      Func<string, StringComparison, bool> invokedMemberNameConstraint,\n                                                      Func<SemanticModel, ILanguageFacade, SyntaxNode, bool> invokedMemberNodeConstraint,\n                                                      Func<IParameterSymbol, bool> parameterConstraint,\n                                                      Func<IReadOnlyCollection<SyntaxNode>, int?, bool> argumentListConstraint,\n                                                      RefKind? refKind) =>\n        new(MemberKind.Method, invokedMemberConstraint, invokedMemberNameConstraint, invokedMemberNodeConstraint, argumentListConstraint, parameterConstraint, refKind);\n\n    public static ArgumentDescriptor ConstructorInvocation(KnownType constructedType, string parameterName, int argumentPosition) =>\n        ConstructorInvocation(\n            x => constructedType.Matches(x.ContainingType),\n            (x, c) => x.Equals(constructedType.TypeName, c),\n            static (_, _, _) => true,\n            x => x.Name == parameterName,\n            (_, x) => x is null || x == argumentPosition,\n            null);\n\n    public static ArgumentDescriptor ConstructorInvocation(Func<IMethodSymbol, bool> invokedMethodSymbol,\n                                                           Func<string, StringComparison, bool> invokedMemberNameConstraint,\n                                                           Func<SemanticModel, ILanguageFacade, SyntaxNode, bool> invokedMemberNodeConstraint,\n                                                           Func<IParameterSymbol, bool> parameterConstraint,\n                                                           Func<IReadOnlyCollection<SyntaxNode>, int?, bool> argumentListConstraint,\n                                                           RefKind? refKind) =>\n        new(MemberKind.Constructor,\n            invokedMemberConstraint: invokedMethodSymbol,\n            invokedMemberNameConstraint,\n            invokedMemberNodeConstraint,\n            argumentListConstraint,\n            parameterConstraint,\n            refKind);\n\n    public static ArgumentDescriptor ElementAccess(KnownType invokedIndexerContainer, Func<IParameterSymbol, bool> parameterConstraint, int argumentPosition) =>\n        ElementAccess(invokedIndexerContainer, null, parameterConstraint, x => x == argumentPosition);\n\n    public static ArgumentDescriptor ElementAccess(KnownType invokedIndexerContainer, string invokedIndexerExpression, Func<IParameterSymbol, bool> parameterConstraint, int argumentPosition) =>\n        ElementAccess(invokedIndexerContainer, invokedIndexerExpression, parameterConstraint, x => x == argumentPosition);\n\n    public static ArgumentDescriptor ElementAccess(KnownType invokedIndexerContainer, Func<IParameterSymbol, bool> parameterConstraint, Func<int, bool> argumentPositionConstraint) =>\n        ElementAccess(invokedIndexerContainer, null, parameterConstraint, argumentPositionConstraint);\n\n    public static ArgumentDescriptor ElementAccess(KnownType invokedIndexerContainer,\n                                                   string invokedIndexerExpression,\n                                                   Func<IParameterSymbol, bool> parameterConstraint,\n                                                   Func<int, bool> argumentPositionConstraint) =>\n\n        ElementAccess(\n            x => x is { ContainingSymbol: INamedTypeSymbol container } && invokedIndexerContainer.Matches(container),\n            (s, c) => invokedIndexerExpression is null || s.Equals(invokedIndexerExpression, c),\n            (_, _, _) => true,\n            parameterConstraint,\n            (_, p) => argumentPositionConstraint is null || p is null || argumentPositionConstraint(p.Value));\n\n    public static ArgumentDescriptor ElementAccess(Func<IMethodSymbol, bool> invokedIndexerPropertyMethod,\n                                                   Func<string, StringComparison, bool> invokedIndexerExpression,\n                                                   Func<SemanticModel, ILanguageFacade, SyntaxNode, bool> invokedIndexerExpressionNodeConstraint,\n                                                   Func<IParameterSymbol, bool> parameterConstraint,\n                                                   Func<IReadOnlyCollection<SyntaxNode>, int?, bool> argumentListConstraint) =>\n        new(MemberKind.Indexer,\n            invokedMemberConstraint: invokedIndexerPropertyMethod,\n            invokedMemberNameConstraint: invokedIndexerExpression,\n            invokedMemberNodeConstraint: invokedIndexerExpressionNodeConstraint,\n            argumentListConstraint: argumentListConstraint,\n            parameterConstraint: parameterConstraint,\n            refKind: null);\n\n    public static ArgumentDescriptor AttributeArgument(KnownType attributeType, string constructorParameterName, int argumentPosition) =>\n        AttributeArgument(\n            x => x is { MethodKind: MethodKind.Constructor, ContainingType: { Name: { } name } type }\n                && attributeType.Matches(type)\n                && AttributeClassNameConstraint(attributeType.TypeName, name, StringComparison.Ordinal),\n            (x, c) => AttributeClassNameConstraint(attributeType.TypeName, x, c),\n            (_, _, _) => true,\n            x => x.Name == constructorParameterName,\n            (_, i) => i is null || i.Value == argumentPosition);\n\n    public static ArgumentDescriptor AttributeArgument(string attributeName, string parameterName, int argumentPosition) =>\n        AttributeArgument(\n            x => x is { MethodKind: MethodKind.Constructor, ContainingType.Name: { } name } && AttributeClassNameConstraint(attributeName, name, StringComparison.Ordinal),\n            (x, c) => AttributeClassNameConstraint(attributeName, x, c),\n            (_, _, _) => true,\n            x => x.Name == parameterName,\n            (_, i) => i is null || i.Value == argumentPosition);\n\n    public static ArgumentDescriptor AttributeArgument(Func<IMethodSymbol, bool> attributeConstructorConstraint,\n                                                       Func<string, StringComparison, bool> attributeNameConstraint,\n                                                       Func<SemanticModel, ILanguageFacade, SyntaxNode, bool> attributeNodeConstraint,\n                                                       Func<IParameterSymbol, bool> parameterConstraint,\n                                                       Func<IReadOnlyCollection<SyntaxNode>, int?, bool> argumentListConstraint) =>\n        new(MemberKind.Attribute,\n            invokedMemberConstraint: attributeConstructorConstraint,\n            invokedMemberNameConstraint: attributeNameConstraint,\n            invokedMemberNodeConstraint: attributeNodeConstraint,\n            argumentListConstraint: argumentListConstraint,\n            parameterConstraint: parameterConstraint,\n            refKind: null);\n\n    public static ArgumentDescriptor AttributeProperty(KnownType attributeType, string propertyName) =>\n        AttributeArgument(\n            attributeConstructorConstraint: x => x is { MethodKind: MethodKind.PropertySet, AssociatedSymbol: { Name: { } name, ContainingType: { } type } }\n                && name == propertyName\n                && attributeType.Matches(type),\n            attributeNameConstraint: (s, c) => AttributeClassNameConstraint(attributeType.TypeName, s, c),\n            (_, _, _) => true,\n            parameterConstraint: _ => true,\n            argumentListConstraint: (_, _) => true);\n\n    public static ArgumentDescriptor AttributeProperty(string attributeName, string propertyName) =>\n        AttributeArgument(\n            attributeConstructorConstraint: x => x is { MethodKind: MethodKind.PropertySet, AssociatedSymbol.Name: { } name } && name == propertyName,\n            attributeNameConstraint: (s, c) => AttributeClassNameConstraint(attributeName, s, c),\n            (_, _, _) => true,\n            parameterConstraint: _ => true,\n            argumentListConstraint: (_, _) => true);\n\n    private static bool AttributeClassNameConstraint(string attributeTypeName, string nodeClassName, StringComparison c) =>\n        nodeClassName.Equals(attributeTypeName, c) || attributeTypeName.Equals($\"{nodeClassName}Attribute\", c);\n\n    private static ArgumentDescriptor MethodInvocation(KnownType invokedType,\n                                                       string methodName,\n                                                       Func<IParameterSymbol, bool> parameterConstraint,\n                                                       Func<int, bool> argumentPosition,\n                                                       RefKind? refKind) =>\n        MethodInvocation(invokedType, (n, c) => n.Equals(methodName, c), parameterConstraint, argumentPosition, refKind);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Trackers/ArgumentTracker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Trackers;\n\npublic abstract class ArgumentTracker<TSyntaxKind> : SyntaxTrackerBase<TSyntaxKind, ArgumentContext>\n    where TSyntaxKind : struct\n{\n    protected abstract RefKind? ArgumentRefKind(SyntaxNode argumentNode);\n    protected abstract IReadOnlyCollection<SyntaxNode> ArgumentList(SyntaxNode argumentNode);\n    protected abstract int? Position(SyntaxNode argumentNode);\n    protected abstract bool InvocationMatchesMemberKind(SyntaxNode invokedExpression, MemberKind memberKind);\n    protected abstract bool InvokedMemberMatches(SemanticModel model, SyntaxNode invokedExpression, MemberKind memberKind, Func<string, bool> invokedMemberNameConstraint);\n\n    public Condition MatchArgument(ArgumentDescriptor descriptor) =>\n        trackingContext =>\n        {\n            if (trackingContext.Node is { } argumentNode\n                && argumentNode is { Parent.Parent: { } invoked }\n                && SyntacticChecks(trackingContext.Model, descriptor, argumentNode, invoked)\n                && (descriptor.InvokedMemberNodeConstraint?.Invoke(trackingContext.Model, Language, invoked) ?? true)\n                && MethodSymbol(trackingContext.Model, invoked) is { } methodSymbol\n                && Language.MethodParameterLookup(invoked, methodSymbol).TryGetSymbol(argumentNode, out var parameter)\n                && ParameterMatches(parameter, descriptor.ParameterConstraint, descriptor.InvokedMemberConstraint))\n            {\n                trackingContext.Parameter = parameter;\n                return true;\n            }\n            return false;\n        };\n\n    protected override ArgumentContext CreateContext(SonarSyntaxNodeReportingContext context) =>\n        new(context);\n\n    private IMethodSymbol MethodSymbol(SemanticModel model, SyntaxNode invoked) =>\n        model.GetSymbolInfo(invoked).Symbol switch\n        {\n            IMethodSymbol x => x,\n            IPropertySymbol propertySymbol => Language.Syntax.IsWrittenTo(invoked, model, CancellationToken.None)\n                ? propertySymbol.SetMethod\n                : propertySymbol.GetMethod,\n            _ => null,\n        };\n\n    // SemanticModel is needed for target-typed-new only.\n    private bool SyntacticChecks(SemanticModel model, ArgumentDescriptor descriptor, SyntaxNode argumentNode, SyntaxNode invokedExpression) =>\n        InvocationMatchesMemberKind(invokedExpression, descriptor.MemberKind)\n        && RefKindMatches(descriptor, argumentNode)\n        && (descriptor.ArgumentListConstraint is null\n            || (ArgumentList(argumentNode) is { } argList && descriptor.ArgumentListConstraint(argList, Position(argumentNode))))\n        && (descriptor.InvokedMemberNameConstraint is null\n            || InvokedMemberMatches(model, invokedExpression, descriptor.MemberKind, x => descriptor.InvokedMemberNameConstraint(x, Language.NameComparison)));\n\n    private bool RefKindMatches(ArgumentDescriptor descriptor, SyntaxNode argumentNode) =>\n        descriptor.RefKind is not { } expectedRefKind // When null: No RefKind constraint was specified\n        || ArgumentRefKind(argumentNode) is not { } actualRefKind // When null: In VB, the argument does not need ref/out keywords on the call side\n        || expectedRefKind == actualRefKind\n        // For parameter ref kind \"in\", on the call side \"in\" is optional or can be \"ref\" instead\n        // For \"ref readonly\" parameters, \"none\", \"in\" and \"ref\" are allowed on the call side\n        || (expectedRefKind is RefKindEx.In && actualRefKind is RefKind.None or RefKind.Ref)\n        || (expectedRefKind is RefKindEx.RefReadOnlyParameter && actualRefKind is RefKind.None or RefKind.Ref or RefKindEx.In);\n\n    private static bool ParameterMatches(IParameterSymbol parameter, Func<IParameterSymbol, bool> parameterConstraint, Func<IMethodSymbol, bool> invokedMemberConstraint)\n    {\n        if (parameter.ContainingSymbol is IMethodSymbol method\n            && method.Parameters.IndexOf(parameter) is >= 0 and int position)\n        {\n            do\n            {\n                if (invokedMemberConstraint?.Invoke(method) is null or true && parameterConstraint?.Invoke(method.Parameters[position]) is null or true)\n                {\n                    return true;\n                }\n            }\n            while ((method = method.OverriddenMethod) is not null);\n        }\n        return false;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Trackers/AssignmentFinder.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Trackers;\n\npublic abstract class AssignmentFinder\n{\n    /// <param name=\"anyAssignmentKind\">'true' will find any AssignmentExpressionSyntax like =, +=, -=, &=. 'false' will find only '=' SimpleAssignmentExpression.</param>\n    protected abstract bool IsAssignmentToIdentifier(SyntaxNode node, string identifierName, bool anyAssignmentKind, out SyntaxNode rightExpression);\n    protected abstract bool IsIdentifierDeclaration(SyntaxNode node, string identifierName, out SyntaxNode initializer);\n    protected abstract bool IsLoop(SyntaxNode node);\n    protected abstract SyntaxNode GetTopMostContainingMethod(SyntaxNode node);\n\n    public SyntaxNode FindLinearPrecedingAssignmentExpression(string identifierName, SyntaxNode current, Func<SyntaxNode> defaultValue = null)\n    {\n        var method = GetTopMostContainingMethod(current);\n        while (current != method && current?.Parent is not null)\n        {\n            if (IsLoop(current) && ContainsNestedAssignmentToIdentifier(current))\n            {\n                return null; // There's assignment inside this loop, value can be altered by each iteration\n            }\n\n            foreach (var statement in current.Parent.ChildNodes().TakeWhile(x => x != current).Reverse())\n            {\n                if (IsAssignmentToIdentifier(statement, identifierName, false, out var right))\n                {\n                    return right;\n                }\n                else if (IsIdentifierDeclaration(statement, identifierName, out var initializer))\n                {\n                    return initializer;\n                }\n                else if (ContainsNestedAssignmentToIdentifier(statement))\n                {\n                    return null; // Assignment inside nested statement (if, try, for, ...)\n                }\n            }\n            current = current.Parent;\n        }\n        return defaultValue?.Invoke();\n\n        bool ContainsNestedAssignmentToIdentifier(SyntaxNode node) =>\n            node.DescendantNodes().Any(x => IsAssignmentToIdentifier(x, identifierName, true, out _));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Trackers/BaseContext.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Trackers;\n\npublic class BaseContext\n{\n    public IList<SecondaryLocation> SecondaryLocations { get; } = new List<SecondaryLocation>();\n\n    public void AddSecondaryLocation(Location location, string message, params string[] formatArgs)\n    {\n        if (location is not null && location != Location.None)\n        {\n            SecondaryLocations.Add(new SecondaryLocation(location, string.Format(message, formatArgs)));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Trackers/BaseTypeContext.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Trackers;\n\n/// <summary>\n/// Syntax and semantic information about an inheritance relationship.\n/// </summary>\npublic class BaseTypeContext : SyntaxBaseContext\n{\n    /// <summary>\n    /// A list of all type syntax nodes for node being analyzed.\n    /// </summary>\n    public IEnumerable<SyntaxNode> AllBaseTypeNodes { get; }\n\n    public BaseTypeContext(SonarSyntaxNodeReportingContext context, IEnumerable<SyntaxNode> allBaseTypeNodes) : base(context) =>\n        AllBaseTypeNodes = allBaseTypeNodes ?? [];\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Trackers/BaseTypeTracker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Trackers;\n\n/// <summary>\n/// Tracker class for rules that check the inheritance tree for e.g. disallowed base classes.\n/// </summary>\n/// <typeparam name=\"TSyntaxKind\">The syntax type.</typeparam>\npublic abstract class BaseTypeTracker<TSyntaxKind> : SyntaxTrackerBase<TSyntaxKind, BaseTypeContext>\n    where TSyntaxKind : struct\n{\n    /// <summary>\n    /// Extract the list of type syntax nodes for the base types/interface types.\n    /// </summary>\n    protected abstract IEnumerable<SyntaxNode> GetBaseTypeNodes(SyntaxNode contextNode);\n\n    internal Condition MatchSubclassesOf(params KnownType[] types)\n    {\n        var immutableTypes = types.ToImmutableArray();\n        return context =>\n        {\n            foreach (var baseTypeNode in context.AllBaseTypeNodes)\n            {\n                if (context.Model.GetTypeInfo(baseTypeNode).Type.DerivesOrImplementsAny(immutableTypes))\n                {\n                    context.PrimaryLocation = baseTypeNode.GetLocation();\n                    return true; // assume there won't be more than one matching node\n                }\n            }\n\n            return false;\n        };\n    }\n\n    protected override BaseTypeContext CreateContext(SonarSyntaxNodeReportingContext context) =>\n        GetBaseTypeNodes(context.Node) is { } baseTypeList\n        && baseTypeList.Any()\n        ? new BaseTypeContext(context, baseTypeList)\n        : null;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Trackers/BuilderPatternCondition.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Trackers;\n\npublic abstract class BuilderPatternCondition<TSyntaxKind, TInvocationSyntax>\n    where TSyntaxKind : struct\n    where TInvocationSyntax : SyntaxNode\n{\n    private readonly bool constructorIsSafe;\n    private readonly BuilderPatternDescriptor<TSyntaxKind, TInvocationSyntax>[] descriptors;\n    private readonly AssignmentFinder assignmentFinder;\n\n    protected abstract ILanguageFacade<TSyntaxKind> Language { get; }\n    protected abstract SyntaxNode GetExpression(TInvocationSyntax node);\n    protected abstract string GetIdentifierName(TInvocationSyntax node);\n    protected abstract bool IsMemberAccess(SyntaxNode node, out SyntaxNode memberAccessExpression);\n    protected abstract bool IsObjectCreation(SyntaxNode node);\n    protected abstract bool IsIdentifier(SyntaxNode node, out string identifierName);\n\n    protected BuilderPatternCondition(bool constructorIsSafe, BuilderPatternDescriptor<TSyntaxKind, TInvocationSyntax>[] descriptors, AssignmentFinder assignmentFinder)\n    {\n        this.constructorIsSafe = constructorIsSafe;\n        this.descriptors = descriptors;\n        this.assignmentFinder = assignmentFinder;\n    }\n\n    public bool IsInvalidBuilderInitialization(InvocationContext context)\n    {\n        var current = context.Node;\n        while (current is not null)\n        {\n            current = Language.Syntax.RemoveParentheses(current);\n            if (current is TInvocationSyntax invocation)\n            {\n                var invocationContext = new InvocationContext(invocation, GetIdentifierName(invocation), context.Model);\n                if (descriptors.FirstOrDefault(x => x.IsMatch(invocationContext)) is { } descriptor)\n                {\n                    return !descriptor.IsValid(invocation);\n                }\n                current = GetExpression(invocation);\n            }\n            else if (IsMemberAccess(current, out var memberAccessExpression))\n            {\n                current = memberAccessExpression;\n            }\n            else if (IsObjectCreation(current))\n            {\n                // We're sure that full invocation chain started here => we've seen all configuration invocations.\n                return !constructorIsSafe;\n            }\n            else if (IsIdentifier(current, out var identifierName))\n            {\n                if (!(context.Model.GetSymbolInfo(current).Symbol is ILocalSymbol))\n                {\n                    return false;\n                }\n                // When tracking reaches the local variable in invocation chain 'variable.MethodA().MethodB()'\n                // we'll try to find preceding assignment to that variable to continue inspection of initialization chain.\n                current = assignmentFinder.FindLinearPrecedingAssignmentExpression(identifierName, current);\n            }\n            else\n            {\n                return false;\n            }\n        }\n        return false;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Trackers/BuilderPatternDescriptor.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Trackers;\n\npublic class BuilderPatternDescriptor<TSyntaxKind, TInvocationSyntax>\n    where TSyntaxKind : struct\n    where TInvocationSyntax : SyntaxNode\n{\n    private readonly TrackerBase<TSyntaxKind, InvocationContext>.Condition[] invocationConditions;\n    private readonly Func<TInvocationSyntax, bool> isValid;\n\n    public BuilderPatternDescriptor(bool isValid, params TrackerBase<TSyntaxKind, InvocationContext>.Condition[] invocationConditions) : this(_ => isValid, invocationConditions) { }\n\n    public BuilderPatternDescriptor(Func<TInvocationSyntax, bool> isValid, params TrackerBase<TSyntaxKind, InvocationContext>.Condition[] invocationConditions)\n    {\n        this.isValid = isValid;\n        this.invocationConditions = invocationConditions;\n    }\n\n    public bool IsMatch(InvocationContext context) =>\n        invocationConditions.All(x => x(context));\n\n    public bool IsValid(TInvocationSyntax invocation) =>\n        isValid(invocation);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Trackers/ConstantValueFinder.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Trackers;\n\npublic abstract class ConstantValueFinder<TIdentifierNameSyntax, TVariableDeclaratorSyntax>\n    where TIdentifierNameSyntax : SyntaxNode\n    where TVariableDeclaratorSyntax : SyntaxNode\n{\n    protected readonly SemanticModel Model;\n\n    private readonly AssignmentFinder assignmentFinder;\n    private readonly int nullLiteralExpressionSyntaxKind;\n\n    protected abstract string IdentifierName(TIdentifierNameSyntax node);\n    protected abstract SyntaxNode InitializerValue(TVariableDeclaratorSyntax node);\n    protected abstract TVariableDeclaratorSyntax VariableDeclarator(SyntaxNode node);\n    protected abstract bool IsPtrZero(SyntaxNode node);\n\n    protected ConstantValueFinder(SemanticModel model, AssignmentFinder assignmentFinder, int nullLiteralExpressionSyntaxKind)\n    {\n        Model = model;\n        this.assignmentFinder = assignmentFinder;\n        this.nullLiteralExpressionSyntaxKind = nullLiteralExpressionSyntaxKind;\n    }\n\n    public object FindConstant(SyntaxNode node) =>\n        FindConstant(node, null);\n\n    private object FindConstant(SyntaxNode node, HashSet<SyntaxNode> visitedVariables)\n    {\n        if (node is null || node.RawKind == nullLiteralExpressionSyntaxKind) // Performance shortcut\n        {\n            return null;\n        }\n\n        if (IsPtrZero(node))\n        {\n            return 0;\n        }\n\n        return node.EnsureCorrectSemanticModelOrDefault(Model) is { } nodeModel\n            ? nodeModel.GetConstantValue(node).Value ?? FindAssignedConstant(node, nodeModel, visitedVariables)\n            : null;\n    }\n\n    private object FindAssignedConstant(SyntaxNode node, SemanticModel model, HashSet<SyntaxNode> visitedVariables)\n    {\n        return node is TIdentifierNameSyntax identifier\n            ? FindConstant(assignmentFinder.FindLinearPrecedingAssignmentExpression(IdentifierName(identifier), node, FindFieldInitializer), visitedVariables)\n            : null;\n\n        SyntaxNode FindFieldInitializer()\n        {\n            if (model.GetSymbolInfo(identifier).Symbol is IFieldSymbol fieldSymbol\n                && VariableDeclarator(fieldSymbol.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax()) is { } variable\n                && (visitedVariables is null || !visitedVariables.Contains(variable)))\n            {\n                visitedVariables ??= new();\n                visitedVariables.Add(variable);\n                return InitializerValue(variable);\n            }\n            else\n            {\n                return null;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Trackers/ElementAccessContext.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Trackers;\n\npublic class ElementAccessContext : SyntaxBaseContext\n{\n    public Lazy<IPropertySymbol> InvokedPropertySymbol { get; }\n\n    public ElementAccessContext(SonarSyntaxNodeReportingContext context) : base(context) =>\n        InvokedPropertySymbol = new Lazy<IPropertySymbol>(() => context.Model.GetSymbolInfo(context.Node).Symbol as IPropertySymbol);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Trackers/ElementAccessTracker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Trackers;\n\npublic abstract class ElementAccessTracker<TSyntaxKind> : SyntaxTrackerBase<TSyntaxKind, ElementAccessContext>\n    where TSyntaxKind : struct\n{\n    public abstract object AssignedValue(ElementAccessContext context);\n    public abstract Condition ArgumentAtIndexEquals(int index, string value);\n    public abstract Condition MatchSetter();\n    public abstract Condition MatchProperty(MemberDescriptor member);\n\n    internal Condition ArgumentAtIndexIs(int index, params KnownType[] types) =>\n        context => context.InvokedPropertySymbol.Value is { } property\n            && property.Parameters.Length > index\n            && property.Parameters[0].Type.DerivesOrImplements(types[index]);\n\n    internal Condition MatchIndexerIn(params KnownType[] types) =>\n        context => context.InvokedPropertySymbol.Value is { } property\n            && property.ContainingType.DerivesOrImplementsAny(types.ToImmutableArray());\n\n    protected override ElementAccessContext CreateContext(SonarSyntaxNodeReportingContext context) =>\n        new(context);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Trackers/FieldAccessContext.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Trackers;\n\npublic class FieldAccessContext : SyntaxBaseContext\n{\n    public string FieldName { get; }\n    public Lazy<IFieldSymbol> InvokedFieldSymbol { get; }\n\n    public FieldAccessContext(SonarSyntaxNodeReportingContext context, string fieldName) : base(context)\n    {\n        FieldName = fieldName;\n        InvokedFieldSymbol = new Lazy<IFieldSymbol>(() => Model.GetSymbolInfo(Node).Symbol as IFieldSymbol);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Trackers/FieldAccessTracker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Trackers;\n\npublic abstract class FieldAccessTracker<TSyntaxKind> : SyntaxTrackerBase<TSyntaxKind, FieldAccessContext>\n    where TSyntaxKind : struct\n{\n    public abstract Condition WhenRead();\n    public abstract Condition MatchSet();\n    public abstract Condition AssignedValueIsConstant();\n    protected abstract bool IsIdentifierWithinMemberAccess(SyntaxNode expression);\n\n    public Condition MatchField(params MemberDescriptor[] fields) =>\n        context => MemberDescriptor.MatchesAny(context.FieldName, context.InvokedFieldSymbol, false, Language.NameComparison, fields);\n\n    protected override FieldAccessContext CreateContext(SonarSyntaxNodeReportingContext context)\n    {\n        // We register for both MemberAccess and IdentifierName and we want to avoid raising two times for the same identifier.\n        if (IsIdentifierWithinMemberAccess(context.Node))\n        {\n            return null;\n        }\n\n        return Language.Syntax.NodeIdentifier(context.Node) is { } fieldIdentifier ? new FieldAccessContext(context, fieldIdentifier.ValueText) : null;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Trackers/InvocationContext.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Trackers;\n\npublic class InvocationContext : SyntaxBaseContext\n{\n    public string MethodName { get; }\n    public Lazy<IMethodSymbol> MethodSymbol { get; }\n\n    public InvocationContext(SonarSyntaxNodeReportingContext context, string methodName) : this(context.Node, methodName, context.Model) { }\n\n    public InvocationContext(SyntaxNode node, string methodName, SemanticModel model) : base(node, model)\n    {\n        MethodName = methodName;\n        MethodSymbol = new Lazy<IMethodSymbol>(() => Model.GetSymbolInfo(Node).Symbol as IMethodSymbol);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Trackers/InvocationTracker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Trackers;\n\npublic abstract class InvocationTracker<TSyntaxKind> : SyntaxTrackerBase<TSyntaxKind, InvocationContext>\n    where TSyntaxKind : struct\n{\n    public abstract Condition ArgumentAtIndexIsStringConstant(int index);\n    public abstract Condition ArgumentAtIndexIsAny(int index, params string[] values);\n    public abstract Condition ArgumentAtIndexIs(int index, Func<SyntaxNode, SemanticModel, bool> predicate);\n    public abstract Condition MatchProperty(MemberDescriptor member);\n    public abstract object ConstArgumentForParameter(InvocationContext context, string parameterName);\n    protected abstract SyntaxToken? ExpectedExpressionIdentifier(SyntaxNode expression);\n\n    public Condition MatchMethod(params MemberDescriptor[] methods) =>\n        context => MemberDescriptor.MatchesAny(context.MethodName, context.MethodSymbol, true, Language.NameComparison, methods);\n\n    public Condition MethodNameIs(string methodName) =>\n        context => context.MethodName == methodName;\n\n    public Condition MethodIsStatic() =>\n        context => context.MethodSymbol.Value is { IsStatic: true };\n\n    public Condition MethodIsExtension() =>\n        context => context.MethodSymbol.Value is { IsExtensionMethod: true };\n\n    public Condition MethodHasParameters(int count) =>\n        context => context.MethodSymbol.Value is { } method\n                    && method.Parameters.Length == count;\n\n    public Condition IsInvalidBuilderInitialization<TInvocationSyntax>(BuilderPatternCondition<TSyntaxKind, TInvocationSyntax> condition) where TInvocationSyntax : SyntaxNode =>\n        condition.IsInvalidBuilderInitialization;\n\n    internal Condition MethodReturnTypeIs(KnownType returnType) =>\n        context => context.MethodSymbol.Value is { } method\n                    && method.ReturnType.DerivesFrom(returnType);\n\n    internal Condition ArgumentIsBoolConstant(string parameterName, bool expectedValue) =>\n        context => ConstArgumentForParameter(context, parameterName) is bool boolValue\n                    && boolValue == expectedValue;\n\n    internal Condition IsIHeadersDictionary() =>\n        context => context.MethodSymbol.Value.ContainingType.TypeArguments is var typeArguments\n                    && typeArguments.Length == 2\n                    && typeArguments[0].Is(KnownType.System_String)\n                    && typeArguments[1].Is(KnownType.Microsoft_Extensions_Primitives_StringValues);\n\n    protected virtual SyntaxNode NodeExpression(SyntaxNode node) =>\n        Language.Syntax.NodeExpression(node);\n\n    protected override InvocationContext CreateContext(SonarSyntaxNodeReportingContext context) =>\n        NodeExpression(context.Node) is { } expression && ExpectedExpressionIdentifier(expression) is { } identifier\n            ? new InvocationContext(context, identifier.ValueText)\n            : null;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Trackers/MemberDescriptor.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Trackers;\n\npublic class MemberDescriptor\n{\n    internal KnownType ContainingType { get; }\n    internal string Name { get; }\n\n    internal MemberDescriptor(KnownType containingType, string name)\n    {\n        ContainingType = containingType;\n        Name = name;\n    }\n\n    public override string ToString() =>\n        $\"{ContainingType.TypeName}.{Name}\";\n\n    public bool IsMatch(string memberName, ITypeSymbol containingType, StringComparison nameComparison) =>\n        HasSameName(memberName, Name, nameComparison)\n        && containingType.Is(ContainingType);\n\n    public bool IsMatch<TSymbolType>(string memberName, Lazy<TSymbolType> memberSymbol, StringComparison nameComparison)\n        where TSymbolType : class, ISymbol =>\n        HasSameName(memberName, Name, nameComparison)\n        && memberSymbol.Value is { } symbol\n        && HasSameContainingType(symbol, checkOverriddenMethods: true);\n\n    public static bool MatchesAny<TSymbolType>(string memberName, Lazy<TSymbolType> memberSymbol, bool checkOverriddenMethods, StringComparison nameComparison, params MemberDescriptor[] members)\n        where TSymbolType : class, ISymbol =>\n        memberName != null\n        // avoid calling the semantic model if no name matches\n        && members.Any(x => memberName.Equals(x.Name, nameComparison))\n        && memberSymbol.Value is { } symbol\n        // we need to check both Name and Type to make sure the right method on the right type is called\n        && members.Any(x => memberName.Equals(x.Name, nameComparison) && x.HasSameContainingType(symbol, checkOverriddenMethods));\n\n    private static bool HasSameName(string name1, string name2, StringComparison comparison) =>\n        name1 != null && name1.Equals(name2, comparison);\n\n    private bool HasSameContainingType<TSymbolType>(TSymbolType memberSymbol, bool checkOverriddenMethods)\n        where TSymbolType : class, ISymbol\n    {\n        var containingType = memberSymbol.ContainingType?.ConstructedFrom;\n        return containingType != null && checkOverriddenMethods ? containingType.DerivesOrImplements(ContainingType) : containingType.Is(ContainingType);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Trackers/MethodDeclarationContext.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Trackers;\n\npublic class MethodDeclarationContext : BaseContext\n{\n    private readonly Compilation compilation;\n\n    public IMethodSymbol MethodSymbol { get; }\n\n    public MethodDeclarationContext(IMethodSymbol methodSymbol, Compilation compilation)\n    {\n        MethodSymbol = methodSymbol;\n        this.compilation = compilation;\n    }\n\n    public SemanticModel GetSemanticModel(SyntaxNode node) =>\n        compilation.GetSemanticModel(node.SyntaxTree);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Trackers/MethodDeclarationTracker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.Core.Trackers;\n\npublic abstract class MethodDeclarationTracker<TSyntaxKind> : TrackerBase<TSyntaxKind, MethodDeclarationContext>\n    where TSyntaxKind : struct\n{\n    public abstract Condition ParameterAtIndexIsUsed(int index);\n    protected abstract SyntaxToken? GetMethodIdentifier(SyntaxNode methodDeclaration);\n\n    public void Track(TrackerInput input, params Condition[] conditions)\n    {\n        input.Context.RegisterCompilationStartAction(c =>\n            {\n                if (input.IsEnabled(c.Options))\n                {\n                    c.RegisterSymbolAction(TrackMethodDeclaration, SymbolKind.Method);\n                }\n            });\n\n        void TrackMethodDeclaration(SonarSymbolReportingContext c)\n        {\n            if (!IsTrackedMethod((IMethodSymbol)c.Symbol, c.Compilation))\n            {\n                return;\n            }\n\n            foreach (var declaration in c.Symbol.DeclaringSyntaxReferences)\n            {\n                if (c.Symbol.IsTopLevelMain())\n                {\n                    c.ReportIssue(Language.GeneratedCodeRecognizer, input.Rule, Location.Create(declaration.SyntaxTree, TextSpan.FromBounds(0, 0)));\n                }\n                else\n                {\n                    var methodIdentifier = GetMethodIdentifier(declaration.GetSyntax());\n                    if (methodIdentifier.HasValue)\n                    {\n                        c.ReportIssue(Language.GeneratedCodeRecognizer, input.Rule, methodIdentifier.Value);\n                    }\n                }\n            }\n        }\n\n        bool IsTrackedMethod(IMethodSymbol methodSymbol, Compilation compilation)\n        {\n            var conditionContext = new MethodDeclarationContext(methodSymbol, compilation);\n            return conditions.All(c => c(conditionContext));\n        }\n    }\n\n    public Condition MatchMethodName(params string[] methodNames) =>\n        context => methodNames.Contains(context.MethodSymbol.Name);\n\n    public Condition IsOrdinaryMethod() =>\n        context => context.MethodSymbol.MethodKind == MethodKind.Ordinary;\n\n    public Condition IsMainMethod() =>\n        context => context.MethodSymbol.IsMainMethod()\n                   || context.MethodSymbol.IsTopLevelMain();\n\n    internal Condition AnyParameterIsOfType(params KnownType[] types)\n    {\n        var typesArray = types.ToImmutableArray();\n        return context =>\n            context.MethodSymbol.Parameters.Length > 0\n            && context.MethodSymbol.Parameters.Any(parameter => parameter.Type.DerivesOrImplementsAny(typesArray));\n    }\n\n    internal Condition DecoratedWithAnyAttribute(params KnownType[] attributeTypes) =>\n        context => context.MethodSymbol.GetAttributes().Any(a => a.AttributeClass.IsAny(attributeTypes));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Trackers/ObjectCreationContext.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Trackers;\n\npublic class ObjectCreationContext : SyntaxBaseContext\n{\n    public Lazy<IMethodSymbol> InvokedConstructorSymbol { get; }\n\n    public ObjectCreationContext(SonarSyntaxNodeReportingContext context) : base(context) =>\n        InvokedConstructorSymbol = new Lazy<IMethodSymbol>(() => context.Model.GetSymbolInfo(context.Node).Symbol as IMethodSymbol);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Trackers/ObjectCreationTracker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Trackers;\n\npublic abstract class ObjectCreationTracker<TSyntaxKind> : SyntaxTrackerBase<TSyntaxKind, ObjectCreationContext>\n    where TSyntaxKind : struct\n{\n    public abstract Condition ArgumentAtIndexIsConst(int index);\n    public abstract object ConstArgumentForParameter(ObjectCreationContext context, string parameterName);\n\n    protected override TSyntaxKind[] TrackedSyntaxKinds => Language.SyntaxKind.ObjectCreationExpressions;\n\n    internal Condition ArgumentIsBoolConstant(string parameterName, bool expectedValue) =>\n        context => ConstArgumentForParameter(context, parameterName) is bool boolValue && boolValue == expectedValue;\n\n    internal Condition ArgumentAtIndexIs(int index, KnownType type) =>\n        context => context.InvokedConstructorSymbol.Value is { } constructor\n            && constructor.Parameters.Length > index\n            && constructor.Parameters[index].Type.Is(type);\n\n    internal Condition WhenDerivesOrImplementsAny(params KnownType[] types) =>\n        context => context.InvokedConstructorSymbol.Value is { } constructor\n            && constructor.IsConstructor()\n            && constructor.ContainingType.DerivesOrImplementsAny(types.ToImmutableArray());\n\n    internal Condition MatchConstructor(params KnownType[] types) =>\n        // We cannot do a syntax check first because a type name can be aliased with\n        // a using Alias = Fully.Qualified.Name and we will generate false negative\n        // for new Alias()\n        context => context.InvokedConstructorSymbol.Value is { } constructor\n            && constructor.IsConstructor()\n            && constructor.ContainingType.IsAny(types);\n\n    internal Condition WhenDerivesFrom(KnownType baseType) =>\n        context => context.InvokedConstructorSymbol.Value is { } constructor\n            && constructor.IsConstructor()\n            && constructor.ContainingType.DerivesFrom(baseType);\n\n    internal Condition WhenImplements(KnownType baseType) =>\n        context => context.InvokedConstructorSymbol.Value is { } constructor\n            && constructor.IsConstructor()\n            && constructor.ContainingType.Implements(baseType);\n\n    protected override ObjectCreationContext CreateContext(SonarSyntaxNodeReportingContext context) =>\n        new ObjectCreationContext(context);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Trackers/PropertyAccessContext.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Trackers;\n\npublic class PropertyAccessContext : SyntaxBaseContext\n{\n    public string PropertyName { get; }\n    public Lazy<IPropertySymbol> PropertySymbol { get; }\n\n    public PropertyAccessContext(SonarSyntaxNodeReportingContext context, string propertyName) : base(context)\n    {\n        PropertyName = propertyName;\n        PropertySymbol = new Lazy<IPropertySymbol>(() => context.Model.GetSymbolInfo(context.Node).Symbol as IPropertySymbol);\n    }\n\n    public PropertyAccessContext(SyntaxNode node, SemanticModel model, string propertyName) : base(node, model)\n    {\n        PropertyName = propertyName;\n        PropertySymbol = new Lazy<IPropertySymbol>(() => model.GetSymbolInfo(node).Symbol as IPropertySymbol);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Trackers/PropertyAccessTracker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Trackers;\n\npublic abstract class PropertyAccessTracker<TSyntaxKind> : SyntaxTrackerBase<TSyntaxKind, PropertyAccessContext>\n    where TSyntaxKind : struct\n{\n    public abstract object AssignedValue(PropertyAccessContext context);\n    public abstract Condition MatchGetter();\n    public abstract Condition MatchSetter();\n    public abstract Condition AssignedValueIsConstant();\n    protected abstract bool IsIdentifierWithinMemberAccess(SyntaxNode expression);\n\n    public Condition MatchProperty(params MemberDescriptor[] properties) =>\n        MatchProperty(false, properties);\n\n    public Condition MatchProperty(bool checkOverridenProperties, params MemberDescriptor[] properties) =>\n        context => MemberDescriptor.MatchesAny(context.PropertyName, context.PropertySymbol, checkOverridenProperties, Language.NameComparison, properties);\n\n    protected override PropertyAccessContext CreateContext(SonarSyntaxNodeReportingContext context)\n    {\n        // We register for both MemberAccess and IdentifierName and we want to\n        // avoid raising two times for the same identifier.\n        if (IsIdentifierWithinMemberAccess(context.Node))\n        {\n            return null;\n        }\n\n        return Language.Syntax.NodeIdentifier(context.Node) is { } propertyIdentifier ? new PropertyAccessContext(context, propertyIdentifier.ValueText) : null;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Trackers/SyntaxBaseContext.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Trackers;\n\npublic class SyntaxBaseContext : BaseContext\n{\n    public SemanticModel Model { get; }\n    public SyntaxNode Node { get; }\n    public Location PrimaryLocation { get; set; }\n\n    public SyntaxBaseContext(SonarSyntaxNodeReportingContext context) : this(context.Node, context.Model) { }\n\n    public SyntaxBaseContext(SyntaxNode node, SemanticModel model)\n    {\n        Model = model;\n        Node = node;\n        PrimaryLocation = Node.GetLocation();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Trackers/SyntaxTrackerBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Trackers;\n\npublic abstract class SyntaxTrackerBase<TSyntaxKind, TContext> : TrackerBase<TSyntaxKind, TContext>\n    where TSyntaxKind : struct\n    where TContext : SyntaxBaseContext\n{\n    protected abstract TSyntaxKind[] TrackedSyntaxKinds { get; }\n    protected abstract TContext CreateContext(SonarSyntaxNodeReportingContext context);\n\n    public void Track(TrackerInput input, params Condition[] conditions) =>\n        Track(input, [], conditions);\n\n    public void Track(TrackerInput input, string[] diagnosticMessageArgs, params Condition[] conditions)\n    {\n        input.Context.RegisterCompilationStartAction(c =>\n          {\n              if (input.IsEnabled(c.Options))\n              {\n                  c.RegisterNodeAction(Language.GeneratedCodeRecognizer, TrackAndReportIfNecessary, TrackedSyntaxKinds);\n              }\n          });\n\n        void TrackAndReportIfNecessary(SonarSyntaxNodeReportingContext c)\n        {\n            if (CreateContext(c) is { } trackingContext\n                && Array.TrueForAll(conditions, x => x(trackingContext))\n                && trackingContext.PrimaryLocation is not null\n                && trackingContext.PrimaryLocation != Location.None)\n            {\n                c.ReportIssue(input.Rule, trackingContext.PrimaryLocation, trackingContext.SecondaryLocations, diagnosticMessageArgs);\n            }\n        }\n    }\n\n    public Condition ExceptWhen(Condition condition) =>\n        x => !condition(x);\n\n    public Condition And(Condition condition1, Condition condition2) =>\n        x => condition1(x) && condition2(x);\n\n    public Condition Or(Condition condition1, Condition condition2) =>\n        x => condition1(x) || condition2(x);\n\n    public Condition Or(Condition condition1, Condition condition2, Condition condition3) =>\n        x => condition1(x) || condition2(x) || condition3(x);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Trackers/TrackerBase.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Trackers;\n\npublic abstract class TrackerBase<TSyntaxKind, TContext>\n    where TSyntaxKind : struct\n    where TContext : BaseContext\n{\n    protected abstract ILanguageFacade<TSyntaxKind> Language { get; }\n\n    public delegate bool Condition(TContext trackingContext);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/Trackers/TrackerInput.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Trackers;\n\npublic class TrackerInput\n{\n    private readonly IAnalyzerConfiguration configuration;\n\n    public DiagnosticDescriptor Rule { get; }\n    public SonarAnalysisContext Context { get; }\n\n    public TrackerInput(SonarAnalysisContext context, IAnalyzerConfiguration configuration, DiagnosticDescriptor rule)\n    {\n        Context = context;\n        this.configuration = configuration;\n        Rule = rule;\n    }\n\n    public bool IsEnabled(AnalyzerOptions options)\n    {\n        configuration.Initialize(options);\n        return configuration.IsEnabled(Rule.Id);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Core/packages.lock.json",
    "content": "{\n  \"version\": 1,\n  \"dependencies\": {\n    \".NETStandard,Version=v2.0\": {\n      \"Google.Protobuf\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[3.6.1, )\",\n        \"resolved\": \"3.6.1\",\n        \"contentHash\": \"741fGeDQjixBJaU2j+0CbrmZXsNJkTn/hWbOh4fLVXndHsCclJmWznCPWrJmPoZKvajBvAz3e8ECJOUvRtwjNQ==\",\n        \"dependencies\": {\n          \"NETStandard.Library\": \"1.6.1\"\n        }\n      },\n      \"Grpc.Tools\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[2.26.0, )\",\n        \"resolved\": \"2.26.0\",\n        \"contentHash\": \"qTsydkJmYauTeKxetCUSJKh25u5Z3oSs7UokdBrpS+tiR8zZmI46mddfj0Bd7GChBvcbnbWtDnZcmEZFzRaF0w==\"\n      },\n      \"Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[3.3.1, )\",\n        \"resolved\": \"3.3.1\",\n        \"contentHash\": \"eT+kgNCDdTRbQ5WF6BGx1HI3D5jYfHteza/koefhWC2vNZGxObA74XxwWfg40dy3uUv7dn3OGKLK5GUPLroVog==\"\n      },\n      \"Microsoft.CodeAnalysis.Workspaces.Common\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.3.2, )\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"kvdo+rkImlx5MuBgkayl4OV3Mg8/qirUdYgCIfQ9EqN15QasJFlQXmDAtCGqpkK9sYLLO/VK+y+4mvKjfh/FOA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Common\": \"[1.3.2]\",\n          \"Microsoft.Composition\": \"1.0.27\"\n        }\n      },\n      \"Microsoft.Composition\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.0.27, )\",\n        \"resolved\": \"1.0.27\",\n        \"contentHash\": \"pwu80Ohe7SBzZ6i69LVdzowp6V+LaVRzd5F7A6QlD42vQkX0oT7KXKWWPlM/S00w1gnMQMRnEdbtOV12z6rXdQ==\"\n      },\n      \"NETStandard.Library\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[2.0.3, )\",\n        \"resolved\": \"2.0.3\",\n        \"contentHash\": \"st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.1.0\"\n        }\n      },\n      \"SonarAnalyzer.CSharp.Styling\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[10.21.0.135717, )\",\n        \"resolved\": \"10.21.0.135717\",\n        \"contentHash\": \"hl264jF539oB7m2jED5QGM345eFSiDAdoJc8TH0HM6L7ZeqT5TDqZDQeZ8IDP02dVIpH/Fhhn+HsGfEcj8ohyQ==\"\n      },\n      \"StyleCop.Analyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.2.0-beta.556, )\",\n        \"resolved\": \"1.2.0-beta.556\",\n        \"contentHash\": \"llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==\",\n        \"dependencies\": {\n          \"StyleCop.Analyzers.Unstable\": \"1.2.0.556\"\n        }\n      },\n      \"System.Collections.Immutable\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.1.37, )\",\n        \"resolved\": \"1.1.37\",\n        \"contentHash\": \"fTpqwZYBzoklTT+XjTRK8KxvmrGkYHzBiylCcKyQcxiOM8k+QvhNBxRvFHDWzy4OEP5f8/9n+xQ9mEgEXY+muA==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.0\",\n          \"System.Diagnostics.Debug\": \"4.0.0\",\n          \"System.Globalization\": \"4.0.0\",\n          \"System.Linq\": \"4.0.0\",\n          \"System.Resources.ResourceManager\": \"4.0.0\",\n          \"System.Runtime\": \"4.0.0\",\n          \"System.Runtime.Extensions\": \"4.0.0\",\n          \"System.Threading\": \"4.0.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.1.0\",\n        \"contentHash\": \"HS3iRWZKcUw/8eZ/08GXKY2Bn7xNzQPzf8gRPHGSowX7u7XXu9i9YEaBeBNKUXWfI7qjvT2zXtLUvbN0hds8vg==\"\n      },\n      \"Microsoft.CodeAnalysis.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"lOinFNbjpCvkeYQHutjKi+CfsjoKu88wAFT6hAumSR/XJSJmmVGvmnbzCWW8kUJnDVrw1RrcqS8BzgPMj263og==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"1.1.0\",\n          \"System.AppContext\": \"4.1.0\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.Collections.Concurrent\": \"4.0.12\",\n          \"System.Collections.Immutable\": \"1.2.0\",\n          \"System.Console\": \"4.0.0\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Diagnostics.FileVersionInfo\": \"4.0.0\",\n          \"System.Diagnostics.StackTrace\": \"4.0.1\",\n          \"System.Diagnostics.Tools\": \"4.0.1\",\n          \"System.Dynamic.Runtime\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Linq.Expressions\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Metadata\": \"1.3.0\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Runtime.Numerics\": \"4.0.1\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.X509Certificates\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Text.Encoding.CodePages\": \"4.0.1\",\n          \"System.Text.Encoding.Extensions\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\",\n          \"System.Threading.Tasks.Parallel\": \"4.0.1\",\n          \"System.Threading.Thread\": \"4.0.0\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\",\n          \"System.Xml.XDocument\": \"4.0.11\",\n          \"System.Xml.XPath.XDocument\": \"4.0.1\",\n          \"System.Xml.XmlDocument\": \"4.0.1\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"GrYMp6ScZDOMR0fNn/Ce6SegNVFw1G/QRT/8FiKv7lAP+V6lEZx9e42n0FvFUgjjcKgcEJOI4muU6i+3LSvOBA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Common\": \"[1.3.2]\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp.Workspaces\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"MwGmrrPx3okEJuCogSn4TM3yTtJUDdmTt8RXpnjVo0dPund0YSAq4bHQQ9bxgArbrrapcopJmkb7UOLAvanXkg==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp\": \"[1.3.2]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2]\"\n        }\n      },\n      \"Microsoft.NETCore.Platforms\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.1.0\",\n        \"contentHash\": \"kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==\"\n      },\n      \"Microsoft.NETCore.Targets\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.1\",\n        \"contentHash\": \"rkn+fKobF/cbWfnnfBOQHKVKIOpxMZBvlSHkqDWgBpwGDcLRduvs3D9OLGeV6GWGvVwNlVi2CBbTjuPmtHvyNw==\"\n      },\n      \"runtime.native.System\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"QfS/nQI7k/BLgmLrw7qm7YBoULEvgWnPI+cYsbfCVFTW8Aj+i8JhccxcFMu1RWms0YZzF+UHguNBK4Qn89e2Sg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\"\n        }\n      },\n      \"runtime.native.System.Net.Http\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"Nh0UPZx2Vifh8r+J+H2jxifZUD3sBrmolgiFWJd2yiNrxO0xTa6bAw3YwRn1VOiSen/tUXMS31ttNItCZ6lKuA==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\"\n        }\n      },\n      \"runtime.native.System.Security.Cryptography\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"2CQK0jmO6Eu7ZeMgD+LOFbNJSXHFVQbCJJkEyEwowh1SCgYnrn9W9RykMfpeeVGw7h4IBvYikzpGUlmZTUafJw==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\"\n        }\n      },\n      \"StyleCop.Analyzers.Unstable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.2.0.556\",\n        \"contentHash\": \"zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==\"\n      },\n      \"System.AppContext\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"3QjO4jNV7PdKkmQAVp9atA+usVnKRwI3Kx1nMwJ93T0LcQfx7pKAYk0nKz5wn1oP5iqlhZuy6RXOFdhr7rDwow==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Collections\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"YUJGz6eFKqS0V//mLt25vFGrrCvOnsXjlvFQs+KimpwNxug9x0Pzy4PlFMU3Q2IzqAa9G2L4LsK3+9vCBK7oTg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Collections.Concurrent\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.12\",\n        \"contentHash\": \"2gBcbb3drMLgxlI0fBfxMA31ec6AEyYCHygGse4vxceJan8mRIWeKJ24BFzN7+bi/NFTgdIgufzb94LWO5EERQ==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Diagnostics.Tracing\": \"4.1.0\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Console\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"qSKUSOIiYA/a0g5XXdxFcUFmv1hNICBD7QZ0QhGYVipPIhvpiydY8VZqr1thmCXvmn8aipMg64zuanB4eotK9A==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\"\n        }\n      },\n      \"System.Diagnostics.Debug\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"w5U95fVKHY4G8ASs/K5iK3J5LY+/dLFd4vKejsnI/ZhBsWS9hQakfx3Zr7lRWKg4tAw9r4iktyvsTagWkqYCiw==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Diagnostics.FileVersionInfo\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"qjF74OTAU+mRhLaL4YSfiWy3vj6T3AOz8AW37l5zCwfbBfj0k7E94XnEsRaf2TnhE/7QaV6Hvqakoy2LoV8MVg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Reflection.Metadata\": \"1.3.0\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.InteropServices\": \"4.1.0\"\n        }\n      },\n      \"System.Diagnostics.StackTrace\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"6i2EbRq0lgGfiZ+FDf0gVaw9qeEU+7IS2+wbZJmFVpvVzVOgZEt0ScZtyenuBvs6iDYbGiF51bMAa0oDP/tujQ==\",\n        \"dependencies\": {\n          \"System.Collections.Immutable\": \"1.2.0\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Metadata\": \"1.3.0\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\"\n        }\n      },\n      \"System.Diagnostics.Tools\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"xBfJ8pnd4C17dWaC9FM6aShzbJcRNMChUMD42I6772KGGrqaFdumwhn9OdM68erj1ueNo3xdQ1EwiFjK5k8p0g==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Diagnostics.Tracing\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"vDN1PoMZCkkdNjvZLql592oYJZgS7URcJzJ7bxeBgGtx5UtR5leNm49VmfHGqIffX4FKacHbI3H6UyNSHQknBg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Dynamic.Runtime\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"db34f6LHYM0U0JpE+sOmjar27BnqTVkbLJhgfwMpTdgTigG/Hna3m2MYVwnFzGGKnEJk2UXFuoVTr8WUbU91/A==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Linq.Expressions\": \"4.1.0\",\n          \"System.ObjectModel\": \"4.0.12\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Emit\": \"4.0.1\",\n          \"System.Reflection.Emit.ILGeneration\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Reflection.TypeExtensions\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Globalization\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"B95h0YLEL2oSnwF/XjqSWKnwKOy/01VWkNlsCeMTFJLLabflpGV26nK164eRs5GiaRSBGpOxQ3pKoSnnyZN5pg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Globalization.Calendars\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"L1c6IqeQ88vuzC1P81JeHmHA8mxq8a18NUBNXnIY/BVb+TCyAaGIFbhpZt60h9FJNmisymoQkHEFSE9Vslja1Q==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.IO\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"3KlTJceQc3gnGIaHZ7UBZO26SHL1SHE4ddrmiwumFnId+CEHP+O8r386tZKaE6zlk5/mF8vifMBzHj9SaXN+mQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.IO.FileSystem\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"IBErlVq5jOggAD69bg1t0pJcHaDbJbWNUZTPI96fkYWzwYbN6D9wRHMULLDd9dHsl7C2YsxXL31LMfPI1SWt8w==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.IO.FileSystem.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"kWkKD203JJKxJeE74p8aF8y4Qc9r9WQx4C0cHzHPrY3fv/L/IhWnyCHaFJ3H1QPOH6A93whlQ2vG5nHlBDvzWQ==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Linq\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"bQ0iYFOQI0nuTnt+NQADns6ucV4DUvMdwN6CbkB1yj8i7arTGiTN5eok1kQwdnnNWSDZfIUySQY+J3d5KjWn0g==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\"\n        }\n      },\n      \"System.Linq.Expressions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"I+y02iqkgmCAyfbqOmSDOgqdZQ5tTj80Akm5BPSS8EeB0VGWdy6X1KCoYe8Pk6pwDoAKZUOdLVxnTJcExiv5zw==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.ObjectModel\": \"4.0.12\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Emit\": \"4.0.1\",\n          \"System.Reflection.Emit.ILGeneration\": \"4.0.1\",\n          \"System.Reflection.Emit.Lightweight\": \"4.0.1\",\n          \"System.Reflection.Extensions\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Reflection.TypeExtensions\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.ObjectModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.12\",\n        \"contentHash\": \"tAgJM1xt3ytyMoW4qn4wIqgJYm7L7TShRZG4+Q4Qsi2PCcj96pXN7nRywS9KkB3p/xDUjc2HSwP9SROyPYDYKQ==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Reflection\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"JCKANJ0TI7kzoQzuwB/OoJANy1Lg338B6+JVacPl4TpUwi3cReg3nMLplMq2uqYfHFQpKIlHAUVAJlImZz/4ng==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Emit\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"P2wqAj72fFjpP6wb9nSfDqNBMab+2ovzSDzUZK7MVIm54tBJEPr9jWfSjjoTpPwj1LeKcmX3vr0ttyjSSFM47g==\",\n        \"dependencies\": {\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Emit.ILGeneration\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Emit.ILGeneration\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"Ov6dU8Bu15Bc7zuqttgHF12J5lwSWyTf1S+FJouUXVMSqImLZzYaQ+vRr1rQ0OZ0HqsrwWl4dsKHELckQkVpgA==\",\n        \"dependencies\": {\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Emit.Lightweight\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"sSzHHXueZ5Uh0OLpUQprhr+ZYJrLPA2Cmr4gn0wj9+FftNKXx8RIMKvO9qnjk2ebPYUjZ+F2ulGdPOsvj+MEjA==\",\n        \"dependencies\": {\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Emit.ILGeneration\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"GYrtRsZcMuHF3sbmRHfMYpvxZoIN2bQGrYGerUiWLEkqdEUQZhH3TRSaC/oI4wO0II1RKBPlpIa1TOMxIcOOzQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Metadata\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.0\",\n        \"contentHash\": \"jMSCxA4LSyKBGRDm/WtfkO03FkcgRzHxwvQRib1bm2GZ8ifKM1MX1al6breGCEQK280mdl9uQS7JNPXRYk90jw==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Collections.Immutable\": \"1.2.0\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Extensions\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Text.Encoding.Extensions\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Reflection.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"4inTox4wTBaDhB7V3mPvp9XlCbeGYWVEM9/fXALd52vNEAVisc1BoVWQPuUuD0Ga//dNbA/WeMy9u9mzLxGTHQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.TypeExtensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"tsQ/ptQ3H5FYfON8lL4MxRk/8kFyE0A+tGPXmVP967cT/gzLHYxIejIYSxp4JmIeFHVP78g/F2FE1mUUTbDtrg==\",\n        \"dependencies\": {\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Resources.ResourceManager\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"TxwVeUNoTgUOdQ09gfTjvW411MF+w9MBYL7AtNVc+HtBCFlutPLhUCdZjNkjbhj3bNQWMdHboF0KIWEOjJssbA==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Runtime\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"v6c/4Yaa9uWsq+JMhnOFewrYkgdNHNG2eMKuNqRn8P733rNXeRCGvV5FkkjBXn2dbVkPXOsO0xjsEeM1q2zC0g==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\"\n        }\n      },\n      \"System.Runtime.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"CUOHjTT/vgP0qGW22U4/hDlOqXmcPq5YicBaXdUR2UiUoLwBT+olO6we4DVbq57jeX5uXH2uerVZhf0qGj+sVQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Runtime.Handles\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"nCJvEKguXEvk2ymk1gqj625vVnlK3/xdGzx0vOKicQkoquaTBJTP13AIYkocSUwHCLNBwUbXTqTWGDxBTWpt7g==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Runtime.InteropServices\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"16eu3kjHS633yYdkjwShDHZLRNMKVi/s0bY8ODiqJ2RfMhDMAwxZaUaWVnZ2P71kr/or+X9o/xFWtNqz8ivieQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\"\n        }\n      },\n      \"System.Runtime.Numerics\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"+XbKFuzdmLP3d1o9pdHu2nxjNr2OEPqGzKeegPLCUMM71a0t50A/rOcIRmGs9wR7a8KuHX6hYs/7/TymIGLNqg==\",\n        \"dependencies\": {\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\"\n        }\n      },\n      \"System.Security.Cryptography.Algorithms\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.2.0\",\n        \"contentHash\": \"8JQFxbLVdrtIOKMDN38Fn0GWnqYZw/oMlwOUG/qz1jqChvyZlnUmu+0s7wLx7JYua/nAXoESpHA3iw11QFWhXg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Runtime.Numerics\": \"4.0.1\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"runtime.native.System.Security.Cryptography\": \"4.0.0\"\n        }\n      },\n      \"System.Security.Cryptography.Cng\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.2.0\",\n        \"contentHash\": \"cUJ2h+ZvONDe28Szw3st5dOHdjndhJzQ2WObDEXAWRPEQBtVItVoxbXM/OEsTthl3cNn2dk2k0I3y45igCQcLw==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\"\n        }\n      },\n      \"System.Security.Cryptography.Csp\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"/i1Usuo4PgAqgbPNC0NjbO3jPW//BoBlTpcWFD1EHVbidH21y4c1ap5bbEMSGAXjAShhMH4abi/K8fILrnu4BQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Security.Cryptography.Encoding\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"FbKgE5MbxSQMPcSVRgwM6bXN3GtyAh04NkV8E5zKCBE26X0vYW0UtTa2FIgkH33WVqBVxRgxljlVYumWtU+HcQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.Collections.Concurrent\": \"4.0.12\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"runtime.native.System.Security.Cryptography\": \"4.0.0\"\n        }\n      },\n      \"System.Security.Cryptography.OpenSsl\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"HUG/zNUJwEiLkoURDixzkzZdB5yGA5pQhDP93ArOpDPQMteURIGERRNzzoJlmTreLBWr5lkFSjjMSk8ySEpQMw==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Runtime.Numerics\": \"4.0.1\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"runtime.native.System.Security.Cryptography\": \"4.0.0\"\n        }\n      },\n      \"System.Security.Cryptography.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"Wkd7QryWYjkQclX0bngpntW5HSlMzeJU24UaLJQ7YTfI8ydAVAaU2J+HXLLABOVJlKTVvAeL0Aj39VeTe7L+oA==\",\n        \"dependencies\": {\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Security.Cryptography.X509Certificates\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"4HEfsQIKAhA1+ApNn729Gi09zh+lYWwyIuViihoMDWp1vQnEkL2ct7mAbhBlLYm+x/L4Rr/pyGge1lIY635e0w==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Globalization.Calendars\": \"4.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Runtime.Numerics\": \"4.0.1\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Cng\": \"4.2.0\",\n          \"System.Security.Cryptography.Csp\": \"4.0.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.OpenSsl\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\",\n          \"runtime.native.System\": \"4.0.0\",\n          \"runtime.native.System.Net.Http\": \"4.0.1\",\n          \"runtime.native.System.Security.Cryptography\": \"4.0.0\"\n        }\n      },\n      \"System.Text.Encoding\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"U3gGeMlDZXxCEiY4DwVLSacg+DFWCvoiX+JThA/rvw37Sqrku7sEFeVBBBMBnfB6FeZHsyDx85HlKL19x0HtZA==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Text.Encoding.CodePages\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"h4z6rrA/hxWf4655D18IIZ0eaLRa3tQC/j+e26W+VinIHY0l07iEXaAvO0YSYq3MvCjMYy8Zs5AdC1sxNQOB7Q==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Text.Encoding.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"jtbiTDtvfLYgXn8PTfWI+SiBs51rrmO4AAckx4KR6vFK9Wzf6tI8kcRdsYQNwriUeQ1+CtQbM1W4cMbLXnj/OQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\"\n        }\n      },\n      \"System.Text.RegularExpressions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"i88YCXpRTjCnoSQZtdlHkAOx4KNNik4hMy83n0+Ftlb7jvV6ZiZWMpnEZHhjBp6hQVh8gWd/iKNPzlPF7iyA2g==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Threading\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"N+3xqIcg3VDKyjwwCGaZ9HawG9aC6cSDI+s7ROma310GQo8vilFZa86hqKppwTHleR/G0sfOzhvgnUxWCR/DrQ==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Threading.Tasks\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"k1S4Gc6IGwtHGT8188RSeGaX86Qw/wnrgNLshJvsdNUOPP9etMmo8S07c+UlOAx4K/xLuN9ivA1bD0LVurtIxQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Threading.Tasks.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"pH4FZDsZQ/WmgJtN4LWYmRdJAEeVkyriSwrv2Teoe5FOU0Yxlb6II6GL8dBPOfRmutHGATduj3ooMt7dJ2+i+w==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Threading.Tasks.Parallel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"7Pc9t25bcynT9FpMvkUw4ZjYwUiGup/5cJFW72/5MgCG+np2cfVUMdh29u8d7onxX7d8PS3J+wL73zQRqkdrSA==\",\n        \"dependencies\": {\n          \"System.Collections.Concurrent\": \"4.0.12\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Diagnostics.Tracing\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Threading.Thread\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"gIdJqDXlOr5W9zeqFErLw3dsOsiShSCYtF9SEHitACycmvNvY8odf9kiKvp6V7aibc8C4HzzNBkWXjyfn7plbQ==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Xml.ReaderWriter\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"ZIiLPsf67YZ9zgr31vzrFaYQqxRPX9cVHjtPSnmx4eN6lbS/yEyYNr2vs1doGDEscF0tjCZFsk9yUg1sC9e8tg==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Text.Encoding.Extensions\": \"4.0.11\",\n          \"System.Text.RegularExpressions\": \"4.1.0\",\n          \"System.Threading.Tasks\": \"4.0.11\",\n          \"System.Threading.Tasks.Extensions\": \"4.0.0\"\n        }\n      },\n      \"System.Xml.XDocument\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"Mk2mKmPi0nWaoiYeotq1dgeNK1fqWh61+EK+w4Wu8SWuTYLzpUnschb59bJtGywaPq7SmTuPf44wrXRwbIrukg==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Diagnostics.Tools\": \"4.0.1\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\"\n        }\n      },\n      \"System.Xml.XmlDocument\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"2eZu6IP+etFVBBFUFzw2w6J21DqIN5eL9Y8r8JfJWUmV28Z5P0SNU01oCisVHQgHsDhHPnmq2s1hJrJCFZWloQ==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\"\n        }\n      },\n      \"System.Xml.XPath\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"UWd1H+1IJ9Wlq5nognZ/XJdyj8qPE4XufBUkAW59ijsCPjZkZe0MUzKKJFBr+ZWBe5Wq1u1d5f2CYgE93uH7DA==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\"\n        }\n      },\n      \"System.Xml.XPath.XDocument\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"FLhdYJx4331oGovQypQ8JIw2kEmNzCsjVOVYY/16kZTUoquZG85oVn7yUhBE2OZt1yGPSXAL0HTEfzjlbNpM7Q==\",\n        \"dependencies\": {\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\",\n          \"System.Xml.XDocument\": \"4.0.11\",\n          \"System.Xml.XPath\": \"4.0.1\"\n        }\n      },\n      \"sonaranalyzer.cfg\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer.Lightup\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer.lightup\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Shared/LoggingFrameworkMethods.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace Roslyn.Utilities.SonarAnalyzer.Shared;\n\npublic static class LoggingFrameworkMethods\n{\n    public static readonly HashSet<string> MicrosoftExtensionsLogging =\n    [\n        \"Log\",\n        \"LogCritical\",\n        \"LogDebug\",\n        \"LogError\",\n        \"LogInformation\",\n        \"LogTrace\",\n        \"LogWarning\"\n    ];\n\n    public static readonly HashSet<string> CastleCoreOrCommonCore =\n    [\n        \"Debug\",\n        \"DebugFormat\",\n        \"Error\",\n        \"ErrorFormat\",\n        \"Fatal\",\n        \"FatalFormat\",\n        \"Info\",\n        \"InfoFormat\",\n        \"Trace\",\n        \"TraceFormat\",\n        \"Warn\",\n        \"WarnFormat\"\n    ];\n\n    public static readonly HashSet<string> Log4NetILog =\n    [\n        \"Debug\",\n        \"Error\",\n        \"Fatal\",\n        \"Info\",\n        \"Warn\"\n    ];\n\n    public static readonly HashSet<string> Log4NetILogExtensions =\n    [\n        \"DebugExt\",\n        \"ErrorExt\",\n        \"FatalExt\",\n        \"InfoExt\",\n        \"WarnExt\"\n    ];\n\n    public static readonly HashSet<string> Serilog =\n    [\n        \"Debug\",\n        \"Error\",\n        \"Information\",\n        \"Fatal\",\n        \"Warning\",\n        \"Write\",\n        \"Verbose\",\n    ];\n\n    public static readonly HashSet<string> NLogLoggingMethods =\n    [\n        \"Debug\",\n        \"ConditionalDebug\",\n        \"Error\",\n        \"Fatal\",\n        \"Info\",\n        \"Trace\",\n        \"ConditionalTrace\",\n        \"Warn\"\n    ];\n\n    public static readonly HashSet<string> NLogILoggerBase = [\"Log\"];\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Shared/SonarAnalyzer.Shared.projitems",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <PropertyGroup>\r\n    <MSBuildAllProjects Condition=\"'$(MSBuildVersion)' == '' Or '$(MSBuildVersion)' &lt; '16.0'\">$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>\r\n    <HasSharedItems>true</HasSharedItems>\r\n    <SharedGUID>892cf3fa-3be2-42e8-a7e6-76ae72864dec</SharedGUID>\r\n  </PropertyGroup>\r\n  <PropertyGroup Label=\"Configuration\">\r\n    <Import_RootNamespace>SonarAnalyzer.Shared</Import_RootNamespace>\r\n  </PropertyGroup>\r\n  <ItemGroup>\r\n    <Compile Include=\"$(MSBuildThisFileDirectory)**\\*.cs\" />\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Shared/SonarAnalyzer.Shared.shproj",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"15.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>892cf3fa-3be2-42e8-a7e6-76ae72864dec</ProjectGuid>\r\n    <MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\r\n  <Import Project=\"$(MSBuildExtensionsPath32)\\Microsoft\\VisualStudio\\v$(VisualStudioVersion)\\CodeSharing\\Microsoft.CodeSharing.Common.Default.props\" />\r\n  <Import Project=\"$(MSBuildExtensionsPath32)\\Microsoft\\VisualStudio\\v$(VisualStudioVersion)\\CodeSharing\\Microsoft.CodeSharing.Common.props\" />\r\n  <PropertyGroup />\r\n  <Import Project=\"SonarAnalyzer.Shared.projitems\" Label=\"Shared\" />\r\n  <Import Project=\"$(MSBuildExtensionsPath32)\\Microsoft\\VisualStudio\\v$(VisualStudioVersion)\\CodeSharing\\Microsoft.CodeSharing.CSharp.targets\" />\r\n</Project>\r\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Shared/Syntax/Extensions/MemberAccessExpressionSyntaxExtensionsShared.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\n#if CS\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Extensions;\n#else\nnamespace SonarAnalyzer.VisualBasic.Core.Syntax.Extensions;\n#endif\n\ninternal static class MemberAccessExpressionSyntaxExtensionsShared\n{\n    public static bool IsPtrZero(this MemberAccessExpressionSyntax memberAccess, SemanticModel model) =>\n        memberAccess.Name.Identifier.Text == nameof(IntPtr.Zero)\n        && memberAccess.EnsureCorrectSemanticModelOrDefault(model) is { } maModel\n        && maModel.GetTypeInfo(memberAccess).Type is var type\n        && type.IsAny(KnownType.System_IntPtr, KnownType.System_UIntPtr);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Shared/Syntax/Extensions/StatementSyntaxExtensionsShared.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\n#if CS\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Extensions;\n#else\nnamespace SonarAnalyzer.VisualBasic.Core.Syntax.Extensions;\n#endif\n\npublic static class StatementSyntaxExtensionsShared\n{\n    /// <summary>\n    /// Returns all statements before the specified statement within the containing method.\n    /// This method recursively traverses all parent blocks of the provided statement.\n    /// </summary>\n    public static IEnumerable<StatementSyntax> GetPreviousStatements(this StatementSyntax statement)\n    {\n        var previousStatements = statement.GetPreviousStatementsCurrentBlock();\n\n        return statement.Parent is StatementSyntax parentStatement\n            ? previousStatements.Union(GetPreviousStatements(parentStatement))\n            : previousStatements;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Shared/Syntax/Extensions/SyntaxNodeExtensionsShared.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\n#if CS\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Extensions;\n#else\nnamespace SonarAnalyzer.VisualBasic.Core.Syntax.Extensions;\n#endif\n\npublic static class SyntaxNodeExtensionsShared\n{\n    public static bool ContainsGetOrSetOnDependencyProperty(this SyntaxNode node, Compilation compilation)\n    {\n        var model = compilation.GetSemanticModel(node.SyntaxTree);\n        // Ignore the accessor if it calls System.Windows.DependencyObject.GetValue or System.Windows.DependencyObject.SetValue\n        return node\n            .DescendantNodes()\n            .OfType<InvocationExpressionSyntax>()\n            .Where(x => x.Expression.NameIs(\"GetValue\") || x.Expression.NameIs(\"SetValue\"))\n            .Any(x => model.GetSymbolInfo(x).Symbol?.ContainingType?.DerivesFrom(KnownType.System_Windows_DependencyObject) is true);\n    }\n\n    public static IEnumerable<StatementSyntax> GetPreviousStatementsCurrentBlock(this SyntaxNode expression)\n    {\n        var statement = expression.FirstAncestorOrSelf<StatementSyntax>();\n        return statement is null ? [] : statement.Parent.ChildNodes().OfType<StatementSyntax>().TakeWhile(x => x != statement).Reverse();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.Shared/Syntax/Extensions/SyntaxTokenExtensionsShared.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\n#if CS\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Extensions;\n#else\nnamespace SonarAnalyzer.VisualBasic.Core.Syntax.Extensions;\n#endif\n\npublic static class SyntaxTokenExtensionsShared\n{\n    // Based on Roslyn: https://github.com/dotnet/roslyn/blob/09903da31892a30f71eab67d2fd83232cfbf0cea/src/Workspaces/CSharp/Portable/LanguageServices/CSharpSyntaxFactsService.cs#L1187-L1254\n    public static SyntaxNode GetBindableParent(this SyntaxToken token)\n    {\n        var node = token.Parent;\n\n        while (node is not null)\n        {\n            var parent = node.Parent;\n\n            switch (parent)\n            {\n                // If this node is on the left side of a member access expression, don't ascend\n                // further or we'll end up binding to something else.\n                case MemberAccessExpressionSyntax memberAccess when memberAccess.Expression == node:\n                    return node;\n\n                // If this node is on the left side of a qualified name, don't ascend\n                // further or we'll end up binding to something else.\n                case QualifiedNameSyntax qualifiedName when qualifiedName.Left == node:\n                    return node;\n\n                // If this node is the type of an object creation expression, return the\n                // object creation expression.\n                case ObjectCreationExpressionSyntax objectCreation when objectCreation.Type == node:\n                    return parent;\n\n                // The inside of an interpolated string is treated as its own token so we\n                // need to force navigation to the parent expression syntax.\n                case InterpolatedStringExpressionSyntax _ when node is InterpolatedStringTextSyntax:\n                    return parent;\n\n                case NameSyntax _:\n                    node = parent;\n                    break;\n\n                // If this node is not parented by a name, we're done.\n                default:\n                    return node;\n            }\n        }\n\n        return null;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer/Common/ISyntaxWrapper.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic interface ISyntaxWrapper<T> where T : SyntaxNode\n{\n    T SyntaxNode { get; }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer/Common/SyntaxNodeTypes.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Reflection;\nusing Microsoft.CodeAnalysis.CSharp;\n\nnamespace SonarAnalyzer.ShimLayer;\n\ninternal static class SyntaxNodeTypes\n{\n    public static Type LatestType(Type wrapper)\n    {\n        return Load(wrapper, nameof(BaseNamespaceDeclarationSyntaxWrapper.WrappedTypeName)) ?? Load(wrapper, nameof(BaseNamespaceDeclarationSyntaxWrapper.FallbackWrappedTypeName));\n\n        static Type Load(Type wrapper, string fieldName) =>\n            wrapper.GetField(fieldName, BindingFlags.Static | BindingFlags.Public) is { } field && field.GetValue(null) is string name\n                ? typeof(CSharpSyntaxNode).Assembly.GetType(name) // This may need to be extended to other assemblies if needed. See TypeLoader.LoadBaseline and .LoadLatest\n                : null;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer/PartialTypes/BaseNamespaceDeclarationSyntaxWrapper.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic partial struct BaseNamespaceDeclarationSyntaxWrapper\n{\n    public const string FallbackWrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.NamespaceDeclarationSyntax\";\n\n    private static Func<MemberDeclarationSyntax, SyntaxList<UsingDirectiveSyntax>, MemberDeclarationSyntax> withUsingsAccessor;\n\n    public BaseNamespaceDeclarationSyntaxWrapper WithUsings(SyntaxList<UsingDirectiveSyntax> usings)    // This should be removed once we Shim methods\n    {\n        withUsingsAccessor ??= LightupHelpers.CreateSyntaxWithPropertyAccessor<MemberDeclarationSyntax, SyntaxList<UsingDirectiveSyntax>>(WrappedType, nameof(Usings));\n        return new BaseNamespaceDeclarationSyntaxWrapper(withUsingsAccessor(Node, usings));\n    }\n\n    public static implicit operator BaseNamespaceDeclarationSyntaxWrapper(NamespaceDeclarationSyntax node) =>\n        new(node);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer/PartialTypes/BaseObjectCreationExpressionSyntaxWrapper.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic partial struct BaseObjectCreationExpressionSyntaxWrapper\n{\n    public const string FallbackWrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.ObjectCreationExpressionSyntax\";\n\n    public static implicit operator BaseObjectCreationExpressionSyntaxWrapper(ObjectCreationExpressionSyntax node) =>\n        new(node);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer/PartialTypes/CommonForEachStatementSyntaxWrapper.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic partial struct CommonForEachStatementSyntaxWrapper\n{\n    public const string FallbackWrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.ForEachStatementSyntax\";\n\n    public static implicit operator CommonForEachStatementSyntaxWrapper(ForEachStatementSyntax node) =>\n        new(node);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer/SonarAnalyzer.ShimLayer.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFramework>netstandard2.0</TargetFramework>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Microsoft.CodeAnalysis.CSharp.Workspaces\" Version=\"1.3.2\" />\n    <PackageReference Include=\"System.Collections.Immutable\" Version=\"1.1.37\">\n      <!-- Downgrade System.Collections.Immutable to support VS2015 Update 3 -->\n      <NoWarn>NU1605, NU1701</NoWarn>\n    </PackageReference>\n    <ProjectReference Include=\"..\\SonarAnalyzer.ShimLayer.Generator\\SonarAnalyzer.ShimLayer.Generator.csproj\" SetTargetFramework=\"TargetFramework=netstandard2.0\" OutputItemType=\"Analyzer\" ReferenceOutputAssembly=\"false\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer/TemporaryLightUp/LightupHelpers.cs",
    "content": "﻿// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.\n// Licensed under the MIT License. See LICENSE in the project root for license information.\n\n#nullable disable\n\nnamespace SonarAnalyzer.ShimLayer\n{\n    using System;\n    using System.Collections.Concurrent;\n    using System.Collections.Immutable;\n    using System.Linq;\n    using System.Linq.Expressions;\n    using System.Reflection;\n    using Microsoft.CodeAnalysis;\n    using Microsoft.CodeAnalysis.CSharp;\n    using Roslyn.Utilities;\n\n    internal static class LightupHelpers\n    {\n        private static readonly ConcurrentDictionary<Type, ConcurrentDictionary<Type, bool>> SupportedObjectWrappers\n            = new ConcurrentDictionary<Type, ConcurrentDictionary<Type, bool>>();\n\n        private static readonly ConcurrentDictionary<Type, ConcurrentDictionary<SyntaxKind, bool>> SupportedSyntaxWrappers\n            = new ConcurrentDictionary<Type, ConcurrentDictionary<SyntaxKind, bool>>();\n\n        private static readonly ConcurrentDictionary<Type, ConcurrentDictionary<OperationKind, bool>> SupportedOperationWrappers\n            = new ConcurrentDictionary<Type, ConcurrentDictionary<OperationKind, bool>>();\n\n        public static bool SupportsCSharp7 { get; }\n            = Enum.GetNames(typeof(LanguageVersion)).Contains(nameof(LanguageVersionEx.CSharp7));\n\n        public static bool SupportsCSharp71 { get; }\n            = Enum.GetNames(typeof(LanguageVersion)).Contains(nameof(LanguageVersionEx.CSharp7_1));\n\n        public static bool SupportsCSharp72 { get; }\n            = Enum.GetNames(typeof(LanguageVersion)).Contains(nameof(LanguageVersionEx.CSharp7_2));\n\n        public static bool SupportsCSharp73 { get; }\n            = Enum.GetNames(typeof(LanguageVersion)).Contains(nameof(LanguageVersionEx.CSharp7_3));\n\n        public static bool SupportsCSharp8 { get; }\n            = Enum.GetNames(typeof(LanguageVersion)).Contains(nameof(LanguageVersionEx.CSharp8));\n\n        public static bool SupportsCSharp9 { get; }\n            = Enum.GetNames(typeof(LanguageVersion)).Contains(nameof(LanguageVersionEx.CSharp9));\n\n        public static bool SupportsCSharp10 { get; }\n            = Enum.GetNames(typeof(LanguageVersion)).Contains(nameof(LanguageVersionEx.CSharp10));\n\n        public static bool SupportsCSharp11 { get; }\n            = Enum.GetNames(typeof(LanguageVersion)).Contains(nameof(LanguageVersionEx.CSharp11));\n\n        public static bool SupportsCSharp12 { get; }\n            = Enum.GetNames(typeof(LanguageVersion)).Contains(nameof(LanguageVersionEx.CSharp12));\n\n        public static bool SupportsIOperation => SupportsCSharp73;\n\n        [PerformanceSensitive(\"https://github.com/SonarSource/sonar-dotnet/issues/8106\", AllowCaptures = false, AllowGenericEnumeration = false, AllowImplicitBoxing = false)] // Sonar\n        internal static bool CanWrapObject(object obj, Type underlyingType)\n        {\n            if (obj == null)\n            {\n                // The wrappers support a null instance\n                return true;\n            }\n\n            if (underlyingType == null)\n            {\n                // The current runtime doesn't define the target type of the conversion, so no instance of it can exist\n                return false;\n            }\n\n            ConcurrentDictionary<Type, bool> wrappedObject = SupportedObjectWrappers.GetOrAdd(underlyingType, static _ => new ConcurrentDictionary<Type, bool>());\n\n            // Avoid creating a delegate and capture class\n            if (!wrappedObject.TryGetValue(obj.GetType(), out var canCast))\n            {\n                canCast = underlyingType.GetTypeInfo().IsAssignableFrom(obj.GetType().GetTypeInfo());\n                wrappedObject.TryAdd(obj.GetType(), canCast);\n            }\n\n            return canCast;\n        }\n\n        [PerformanceSensitive(\"https://github.com/SonarSource/sonar-dotnet/issues/8106\", AllowCaptures = false, AllowGenericEnumeration = false, AllowImplicitBoxing = false)] // Sonar\n        internal static bool CanWrapNode(SyntaxNode node, Type underlyingType)\n        {\n            if (node == null)\n            {\n                // The wrappers support a null instance\n                return true;\n            }\n\n            if (underlyingType == null)\n            {\n                // The current runtime doesn't define the target type of the conversion, so no instance of it can exist\n                return false;\n            }\n\n            ConcurrentDictionary<SyntaxKind, bool> wrappedSyntax = SupportedSyntaxWrappers.GetOrAdd(underlyingType, static _ => new ConcurrentDictionary<SyntaxKind, bool>());\n\n            // Avoid creating a delegate and capture class\n            if (!wrappedSyntax.TryGetValue(node.Kind(), out var canCast))\n            {\n                canCast = underlyingType.GetTypeInfo().IsAssignableFrom(node.GetType().GetTypeInfo());\n                wrappedSyntax.TryAdd(node.Kind(), canCast);\n            }\n\n            return canCast;\n        }\n\n        [PerformanceSensitive(\"https://github.com/SonarSource/sonar-dotnet/issues/8106\", AllowCaptures = false, AllowGenericEnumeration = false, AllowImplicitBoxing = false)] // Sonar\n        internal static bool CanWrapOperation(IOperation operation, Type underlyingType)\n        {\n            if (operation == null)\n            {\n                // The wrappers support a null instance\n                return true;\n            }\n\n            if (underlyingType == null)\n            {\n                // The current runtime doesn't define the target type of the conversion, so no instance of it can exist\n                return false;\n            }\n\n            ConcurrentDictionary<OperationKind, bool> wrappedSyntax = SupportedOperationWrappers.GetOrAdd(underlyingType, static _ => new ConcurrentDictionary<OperationKind, bool>());\n\n            // Avoid creating a delegate and capture class\n            // Sonar: https://learn.microsoft.com/en-us/dotnet/api/microsoft.codeanalysis.operationkind Loop && CaseClause are further differentiated by LoopKind & CaseKind, but are not castable between different Kinds which can result in InvalidCast Exceptions\n            // ToDo: Commented out for now, needs OperationKindEx to be generated\n            if (!wrappedSyntax.TryGetValue(operation.Kind, out var canCast))\n            //if (!wrappedSyntax.TryGetValue(operation.Kind, out var canCast) || operation.Kind is OperationKindEx.Loop or OperationKindEx.CaseClause) // Sonar\n            {\n                canCast = underlyingType.GetTypeInfo().IsAssignableFrom(operation.GetType().GetTypeInfo());\n                wrappedSyntax.TryAdd(operation.Kind, canCast);\n            }\n\n            return canCast;\n        }\n\n        internal static Func<TOperation, TProperty> CreateOperationPropertyAccessor<TOperation, TProperty>(Type type, string propertyName)\n        {\n            TProperty FallbackAccessor(TOperation syntax)\n            {\n                if (syntax == null)\n                {\n                    // Unlike an extension method which would throw ArgumentNullException here, the light-up\n                    // behavior needs to match behavior of the underlying property.\n                    throw new NullReferenceException();\n                }\n\n                return default;\n            }\n\n            if (type == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (!typeof(TOperation).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var property = type.GetTypeInfo().GetDeclaredProperty(propertyName);\n            if (property == null)\n            {\n                return FallbackAccessor;\n            }\n\n            var operationParameter = Expression.Parameter(typeof(TOperation), \"operation\");\n            Expression instance =\n                type.GetTypeInfo().IsAssignableFrom(typeof(TOperation).GetTypeInfo())\n                ? (Expression)operationParameter\n                : Expression.Convert(operationParameter, type);\n\n            // ToDo: Commented out for now\n            //if (property.PropertyType.FullName == \"Microsoft.CodeAnalysis.FlowAnalysis.CaptureId\") // Sonar - begin\n            //{\n            //    var constructor = typeof(CaptureId).GetConstructors().Single();\n\n            //    Expression<Func<TOperation, TProperty>> expression =\n            //        Expression.Lambda<Func<TOperation, TProperty>>(\n            //            Expression.New(constructor, Expression.Convert(Expression.Call(instance, property.GetMethod), typeof(object))),\n            //            operationParameter);\n            //    return expression.Compile();\n            //}\n            //else\n            if (typeof(TProperty).IsEnum && property.PropertyType.IsEnum)\n            {\n                Expression<Func<TOperation, TProperty>> expression =\n                    Expression.Lambda<Func<TOperation, TProperty>>(\n                        Expression.Convert(Expression.Call(instance, property.GetMethod), typeof(TProperty)),\n                        operationParameter);\n                return expression.Compile();\n            }\n            else if (!typeof(TProperty).GetTypeInfo().IsAssignableFrom(property.PropertyType.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n            else\n            {\n                Expression<Func<TOperation, TProperty>> expression =\n                    Expression.Lambda<Func<TOperation, TProperty>>(\n                        Expression.Call(instance, property.GetMethod),\n                        operationParameter);\n                return expression.Compile();\n            } // Sonar - end\n        }\n\n        internal static Func<TOperation, ImmutableArray<IOperation>> CreateOperationListPropertyAccessor<TOperation>(Type type, string propertyName)\n        {\n            ImmutableArray<IOperation> FallbackAccessor(TOperation syntax)\n            {\n                if (syntax == null)\n                {\n                    // Unlike an extension method which would throw ArgumentNullException here, the light-up\n                    // behavior needs to match behavior of the underlying property.\n                    throw new NullReferenceException();\n                }\n\n                return ImmutableArray<IOperation>.Empty;\n            }\n\n            if (type == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (!typeof(TOperation).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var property = type.GetTypeInfo().GetDeclaredProperty(propertyName);\n            if (property == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (property.PropertyType.GetGenericTypeDefinition() != typeof(ImmutableArray<>))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var propertyOperationType = property.PropertyType.GenericTypeArguments[0];\n\n            if (!typeof(IOperation).GetTypeInfo().IsAssignableFrom(propertyOperationType.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var syntaxParameter = Expression.Parameter(typeof(TOperation), \"syntax\");\n            Expression instance =\n                type.GetTypeInfo().IsAssignableFrom(typeof(TOperation).GetTypeInfo())\n                ? (Expression)syntaxParameter\n                : Expression.Convert(syntaxParameter, type);\n            Expression propertyAccess = Expression.Call(instance, property.GetMethod);\n\n            var unboundCastUpMethod = typeof(ImmutableArray<IOperation>).GetTypeInfo().GetDeclaredMethod(nameof(ImmutableArray<IOperation>.CastUp));\n            var boundCastUpMethod = unboundCastUpMethod.MakeGenericMethod(propertyOperationType);\n\n            Expression<Func<TOperation, ImmutableArray<IOperation>>> expression =\n                Expression.Lambda<Func<TOperation, ImmutableArray<IOperation>>>(\n                    Expression.Call(boundCastUpMethod, propertyAccess),\n                    syntaxParameter);\n            return expression.Compile();\n        }\n\n        internal static Func<TProperty> CreateStaticPropertyAccessor<TProperty>(Type type, string propertyName)\n        {\n            static TProperty FallbackAccessor()\n            {\n                return default;\n            }\n\n            if (type == null)\n            {\n                return FallbackAccessor;\n            }\n\n            var property = type.GetTypeInfo().GetDeclaredProperty(propertyName);\n            if (property == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (!typeof(TProperty).GetTypeInfo().IsAssignableFrom(property.PropertyType.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            Expression<Func<TProperty>> expression =\n                Expression.Lambda<Func<TProperty>>(\n                    Expression.Call(null, property.GetMethod));\n            return expression.Compile();\n        }\n\n        public static Func<TSyntax, TProperty> CreateSyntaxPropertyAccessor<TSyntax, TProperty>(Type type, string propertyName)\n        {\n            TProperty FallbackAccessor(TSyntax syntax)\n            {\n                if (syntax == null)\n                {\n                    // Unlike an extension method which would throw ArgumentNullException here, the light-up\n                    // behavior needs to match behavior of the underlying property.\n                    throw new NullReferenceException();\n                }\n\n                return default;\n            }\n\n            if (type == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (!typeof(TSyntax).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var property = type.GetTypeInfo().GetDeclaredProperty(propertyName);\n            if (property == null)\n            {\n                return FallbackAccessor;\n            }\n            var syntaxParameter = Expression.Parameter(typeof(TSyntax), \"syntax\"); // Sonar - begin\n            Expression instance =\n                type.GetTypeInfo().IsAssignableFrom(typeof(TSyntax).GetTypeInfo())\n                ? (Expression)syntaxParameter\n                : Expression.Convert(syntaxParameter, type);\n\n            Expression body = Expression.Call(instance, property.GetMethod);\n\n            if (!typeof(TProperty).GetTypeInfo().IsAssignableFrom(property.PropertyType.GetTypeInfo()))\n            {\n                body = Expression.Convert(body, typeof(TProperty));\n            }\n\n            return Expression.Lambda<Func<TSyntax, TProperty>>(body, syntaxParameter).Compile(); // Sonar - end\n        }\n\n        internal static Func<TSyntax, TArg, TProperty> CreateSyntaxPropertyAccessor<TSyntax, TArg, TProperty>(Type type, Type argumentType, string accessorMethodName)\n        {\n            static TProperty FallbackAccessor(TSyntax syntax, TArg argument)\n            {\n                if (syntax == null)\n                {\n                    // Unlike an extension method which would throw ArgumentNullException here, the light-up\n                    // behavior needs to match behavior of the underlying property.\n                    throw new NullReferenceException();\n                }\n\n                return default;\n            }\n\n            if (type == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (!typeof(TSyntax).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            if (!typeof(TArg).GetTypeInfo().IsAssignableFrom(argumentType.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var methods = type.GetTypeInfo().GetDeclaredMethods(accessorMethodName);\n            MethodInfo method = null;\n            foreach (var candidate in methods)\n            {\n                var parameters = candidate.GetParameters();\n                if (parameters.Length != 1)\n                {\n                    continue;\n                }\n\n                if (Equals(argumentType, parameters[0].ParameterType))\n                {\n                    method = candidate;\n                    break;\n                }\n            }\n\n            if (method == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (!typeof(TProperty).GetTypeInfo().IsAssignableFrom(method.ReturnType.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var syntaxParameter = Expression.Parameter(typeof(TSyntax), \"syntax\");\n            var argParameter = Expression.Parameter(typeof(TArg), \"arg\");\n            Expression instance =\n                type.GetTypeInfo().IsAssignableFrom(typeof(TSyntax).GetTypeInfo())\n                ? (Expression)syntaxParameter\n                : Expression.Convert(syntaxParameter, type);\n            Expression argument =\n                argumentType.GetTypeInfo().IsAssignableFrom(typeof(TArg).GetTypeInfo())\n                ? (Expression)argParameter\n                : Expression.Convert(argParameter, argumentType);\n\n            Expression<Func<TSyntax, TArg, TProperty>> expression =\n                Expression.Lambda<Func<TSyntax, TArg, TProperty>>(\n                    Expression.Call(instance, method, argument),\n                    syntaxParameter,\n                    argParameter);\n            return expression.Compile();\n        }\n\n        internal static TryGetValueAccessor<TSyntax, TKey, TValue> CreateTryGetValueAccessor<TSyntax, TKey, TValue>(Type type, Type keyType, string methodName)\n        {\n            static bool FallbackAccessor(TSyntax syntax, TKey key, out TValue value)\n            {\n                if (syntax == null)\n                {\n                    // Unlike an extension method which would throw ArgumentNullException here, the light-up\n                    // behavior needs to match behavior of the underlying property.\n                    throw new NullReferenceException();\n                }\n\n                value = default;\n                return false;\n            }\n\n            if (type == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (!typeof(TSyntax).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            if (!typeof(TKey).GetTypeInfo().IsAssignableFrom(keyType.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var methods = type.GetTypeInfo().GetDeclaredMethods(methodName);\n            MethodInfo method = null;\n            foreach (var candidate in methods)\n            {\n                var parameters = candidate.GetParameters();\n                if (parameters.Length != 2)\n                {\n                    continue;\n                }\n\n                if (Equals(keyType, parameters[0].ParameterType)\n                    && Equals(typeof(TValue).MakeByRefType(), parameters[1].ParameterType))\n                {\n                    method = candidate;\n                    break;\n                }\n            }\n\n            if (method == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (method.ReturnType != typeof(bool))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var syntaxParameter = Expression.Parameter(typeof(TSyntax), \"syntax\");\n            var keyParameter = Expression.Parameter(typeof(TKey), \"key\");\n            var valueParameter = Expression.Parameter(typeof(TValue).MakeByRefType(), \"value\");\n            Expression instance =\n                type.GetTypeInfo().IsAssignableFrom(typeof(TSyntax).GetTypeInfo())\n                ? (Expression)syntaxParameter\n                : Expression.Convert(syntaxParameter, type);\n            Expression key =\n                keyType.GetTypeInfo().IsAssignableFrom(typeof(TKey).GetTypeInfo())\n                ? (Expression)keyParameter\n                : Expression.Convert(keyParameter, keyType);\n\n            Expression<TryGetValueAccessor<TSyntax, TKey, TValue>> expression =\n                Expression.Lambda<TryGetValueAccessor<TSyntax, TKey, TValue>>(\n                    Expression.Call(instance, method, key, valueParameter),\n                    syntaxParameter,\n                    keyParameter,\n                    valueParameter);\n            return expression.Compile();\n        }\n\n        internal static TryGetValueAccessor<TSender, TFirst, TSecond, TValue> CreateTryGetValueAccessor<TSender, TFirst, TSecond, TValue>(Type type, Type firstType, Type secondType, string methodName) // Sonar\n        {\n            static bool FallbackAccessor(TSender sender, TFirst first, TSecond second, out TValue value)\n            {\n                if (sender == null)\n                {\n                    // Unlike an extension method which would throw ArgumentNullException here, the light-up\n                    // behavior needs to match behavior of the underlying property.\n                    throw new NullReferenceException();\n                }\n\n                value = default;\n                return false;\n            }\n\n            if (type == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (!typeof(TSender).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            if (!typeof(TFirst).GetTypeInfo().IsAssignableFrom(firstType.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            if (!typeof(TSecond).GetTypeInfo().IsAssignableFrom(secondType.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var methods = type.GetTypeInfo().GetDeclaredMethods(methodName);\n            MethodInfo method = null;\n            foreach (var candidate in methods)\n            {\n                var parameters = candidate.GetParameters();\n                if (parameters.Length != 4)\n                {\n                    continue;\n                }\n\n                if (Equals(firstType, parameters[0].ParameterType)\n                    && Equals(secondType, parameters[1].ParameterType)\n                    && Equals(typeof(TValue).MakeByRefType(), parameters[2].ParameterType))\n                {\n                    method = candidate;\n                    break;\n                }\n            }\n\n            if (method == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (method.ReturnType != typeof(bool))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var senderParameter = Expression.Parameter(typeof(TSender), \"sender\");\n            var firstParameter = Expression.Parameter(typeof(TFirst), \"first\");\n            var secondParameter = Expression.Parameter(typeof(TSecond), \"second\");\n            var valueParameter = Expression.Parameter(typeof(TValue).MakeByRefType(), \"value\");\n            Expression instance =\n                type.GetTypeInfo().IsAssignableFrom(typeof(TSender).GetTypeInfo())\n                ? (Expression)senderParameter\n                : Expression.Convert(senderParameter, type);\n            Expression first =\n                firstType.GetTypeInfo().IsAssignableFrom(typeof(TFirst).GetTypeInfo())\n                ? (Expression)firstParameter\n                : Expression.Convert(firstParameter, firstType);\n            Expression second =\n                secondType.GetTypeInfo().IsAssignableFrom(typeof(TSecond).GetTypeInfo())\n                ? (Expression)secondParameter\n                : Expression.Convert(secondParameter, secondType);\n\n            Expression<TryGetValueAccessor<TSender, TFirst, TSecond, TValue>> expression =\n                Expression.Lambda<TryGetValueAccessor<TSender, TFirst, TSecond, TValue>>(\n                    Expression.Call(instance, method, first, second, valueParameter),\n                    senderParameter,\n                    firstParameter,\n                    secondParameter,\n                    valueParameter);\n            return expression.Compile();\n        }\n\n        internal static TryGetValueAccessor<TSender, TFirst, TSecond, TThird, TValue> CreateTryGetValueAccessor<TSender, TFirst, TSecond, TThird, TValue>(Type type, Type firstType, Type secondType, Type thirdType, string methodName) // Sonar\n        {\n            static bool FallbackAccessor(TSender sender, TFirst first, TSecond second, TThird third, out TValue value)\n            {\n                if (sender == null)\n                {\n                    // Unlike an extension method which would throw ArgumentNullException here, the light-up\n                    // behavior needs to match behavior of the underlying property.\n                    throw new NullReferenceException();\n                }\n\n                value = default;\n                return false;\n            }\n\n            if (type == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (!typeof(TSender).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            if (!typeof(TFirst).GetTypeInfo().IsAssignableFrom(firstType.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            if (!typeof(TSecond).GetTypeInfo().IsAssignableFrom(secondType.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            if (!typeof(TThird).GetTypeInfo().IsAssignableFrom(thirdType.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var methods = type.GetTypeInfo().GetDeclaredMethods(methodName);\n            MethodInfo method = null;\n            foreach (var candidate in methods)\n            {\n                var parameters = candidate.GetParameters();\n                if (parameters.Length != 4)\n                {\n                    continue;\n                }\n\n                if (Equals(firstType, parameters[0].ParameterType)\n                    && Equals(secondType, parameters[1].ParameterType)\n                    && Equals(thirdType, parameters[2].ParameterType)\n                    && Equals(typeof(TValue).MakeByRefType(), parameters[3].ParameterType))\n                {\n                    method = candidate;\n                    break;\n                }\n            }\n\n            if (method == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (method.ReturnType != typeof(bool))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var senderParameter = Expression.Parameter(typeof(TSender), \"sender\");\n            var firstParameter = Expression.Parameter(typeof(TFirst), \"first\");\n            var secondParameter = Expression.Parameter(typeof(TSecond), \"second\");\n            var thirdParameter = Expression.Parameter(typeof(TThird), \"third\");\n            var valueParameter = Expression.Parameter(typeof(TValue).MakeByRefType(), \"value\");\n            Expression instance =\n                type.GetTypeInfo().IsAssignableFrom(typeof(TSender).GetTypeInfo())\n                ? (Expression)senderParameter\n                : Expression.Convert(senderParameter, type);\n            Expression first =\n                firstType.GetTypeInfo().IsAssignableFrom(typeof(TFirst).GetTypeInfo())\n                ? (Expression)firstParameter\n                : Expression.Convert(firstParameter, firstType);\n            Expression second =\n                secondType.GetTypeInfo().IsAssignableFrom(typeof(TSecond).GetTypeInfo())\n                ? (Expression)secondParameter\n                : Expression.Convert(secondParameter, secondType);\n            Expression third =\n                thirdType.GetTypeInfo().IsAssignableFrom(typeof(TThird).GetTypeInfo())\n                ? (Expression)thirdParameter\n                : Expression.Convert(thirdParameter, thirdType);\n\n            Expression<TryGetValueAccessor<TSender, TFirst, TSecond, TThird, TValue>> expression =\n                Expression.Lambda<TryGetValueAccessor<TSender, TFirst, TSecond, TThird, TValue>>(\n                    Expression.Call(instance, method, first, second, third, valueParameter),\n                    senderParameter,\n                    firstParameter,\n                    secondParameter,\n                    thirdParameter,\n                    valueParameter);\n            return expression.Compile();\n        }\n\n        internal static Func<TSyntax, SeparatedSyntaxListWrapper<TProperty>> CreateSeparatedSyntaxListPropertyAccessor<TSyntax, TProperty>(Type type, string propertyName)\n        {\n            SeparatedSyntaxListWrapper<TProperty> FallbackAccessor(TSyntax syntax)\n            {\n                if (syntax == null)\n                {\n                    // Unlike an extension method which would throw ArgumentNullException here, the light-up\n                    // behavior needs to match behavior of the underlying property.\n                    throw new NullReferenceException();\n                }\n\n                return SeparatedSyntaxListWrapper<TProperty>.UnsupportedEmpty;\n            }\n\n            if (type == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (!typeof(TSyntax).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var property = type.GetTypeInfo().GetDeclaredProperty(propertyName);\n            if (property == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (property.PropertyType.GetGenericTypeDefinition() != typeof(SeparatedSyntaxList<>))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var propertySyntaxType = property.PropertyType.GenericTypeArguments[0];\n\n            if (!ValidatePropertyType(typeof(TProperty), propertySyntaxType))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var syntaxParameter = Expression.Parameter(typeof(TSyntax), \"syntax\");\n            Expression instance =\n                type.GetTypeInfo().IsAssignableFrom(typeof(TSyntax).GetTypeInfo())\n                ? (Expression)syntaxParameter\n                : Expression.Convert(syntaxParameter, type);\n            Expression propertyAccess = Expression.Call(instance, property.GetMethod);\n\n            var unboundWrapperType = typeof(SeparatedSyntaxListWrapper<>.AutoWrapSeparatedSyntaxList<>);\n            var boundWrapperType = unboundWrapperType.MakeGenericType(typeof(TProperty), propertySyntaxType);\n            var constructorInfo = boundWrapperType.GetTypeInfo().DeclaredConstructors.Single(constructor => constructor.GetParameters().Length == 1);\n\n            Expression<Func<TSyntax, SeparatedSyntaxListWrapper<TProperty>>> expression =\n                Expression.Lambda<Func<TSyntax, SeparatedSyntaxListWrapper<TProperty>>>(\n                    Expression.New(constructorInfo, propertyAccess),\n                    syntaxParameter);\n            return expression.Compile();\n        }\n\n        internal static Func<TSyntax, TProperty, TSyntax> CreateSyntaxWithPropertyAccessor<TSyntax, TProperty>(Type type, string propertyName)\n        {\n            TSyntax FallbackAccessor(TSyntax syntax, TProperty newValue)\n            {\n                if (syntax == null)\n                {\n                    // Unlike an extension method which would throw ArgumentNullException here, the light-up\n                    // behavior needs to match behavior of the underlying property.\n                    throw new NullReferenceException();\n                }\n\n                if (Equals(newValue, default(TProperty)))\n                {\n                    return syntax;\n                }\n\n                throw new NotSupportedException();\n            }\n\n            if (type == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (!typeof(TSyntax).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var property = type.GetTypeInfo().GetDeclaredProperty(propertyName);\n            if (property == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (!typeof(TProperty).GetTypeInfo().IsAssignableFrom(property.PropertyType.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var methodInfo = type.GetTypeInfo().GetDeclaredMethods(\"With\" + propertyName)\n                .SingleOrDefault(m => !m.IsStatic && m.GetParameters().Length == 1 && m.GetParameters()[0].ParameterType.Equals(property.PropertyType));\n            if (methodInfo is null)\n            {\n                return FallbackAccessor;\n            }\n\n            var syntaxParameter = Expression.Parameter(typeof(TSyntax), \"syntax\");\n            var valueParameter = Expression.Parameter(typeof(TProperty), methodInfo.GetParameters()[0].Name);\n            Expression instance =\n                type.GetTypeInfo().IsAssignableFrom(typeof(TSyntax).GetTypeInfo())\n                ? (Expression)syntaxParameter\n                : Expression.Convert(syntaxParameter, type);\n            Expression value =\n                property.PropertyType.GetTypeInfo().IsAssignableFrom(typeof(TProperty).GetTypeInfo())\n                ? (Expression)valueParameter\n                : Expression.Convert(valueParameter, property.PropertyType);\n\n            Expression<Func<TSyntax, TProperty, TSyntax>> expression =\n                Expression.Lambda<Func<TSyntax, TProperty, TSyntax>>(\n                    Expression.Call(instance, methodInfo, value),\n                    syntaxParameter,\n                    valueParameter);\n            return expression.Compile();\n        }\n\n        internal static Func<TSyntax, SeparatedSyntaxListWrapper<TProperty>, TSyntax> CreateSeparatedSyntaxListWithPropertyAccessor<TSyntax, TProperty>(Type type, string propertyName)\n        {\n            TSyntax FallbackAccessor(TSyntax syntax, SeparatedSyntaxListWrapper<TProperty> newValue)\n            {\n                if (syntax == null)\n                {\n                    // Unlike an extension method which would throw ArgumentNullException here, the light-up\n                    // behavior needs to match behavior of the underlying property.\n                    throw new NullReferenceException();\n                }\n\n                if (newValue is null)\n                {\n                    return syntax;\n                }\n\n                throw new NotSupportedException();\n            }\n\n            if (type == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (!typeof(TSyntax).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var property = type.GetTypeInfo().GetDeclaredProperty(propertyName);\n            if (property == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (property.PropertyType.GetGenericTypeDefinition() != typeof(SeparatedSyntaxList<>))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var propertySyntaxType = property.PropertyType.GenericTypeArguments[0];\n\n            if (!ValidatePropertyType(typeof(TProperty), propertySyntaxType))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var methodInfo = type.GetTypeInfo().GetDeclaredMethods(\"With\" + propertyName)\n                .Single(m => !m.IsStatic && m.GetParameters().Length == 1 && m.GetParameters()[0].ParameterType.Equals(property.PropertyType));\n\n            var syntaxParameter = Expression.Parameter(typeof(TSyntax), \"syntax\");\n            var valueParameter = Expression.Parameter(typeof(SeparatedSyntaxListWrapper<TProperty>), methodInfo.GetParameters()[0].Name);\n            Expression instance =\n                type.GetTypeInfo().IsAssignableFrom(typeof(TSyntax).GetTypeInfo())\n                ? (Expression)syntaxParameter\n                : Expression.Convert(syntaxParameter, type);\n\n            var underlyingListProperty = typeof(SeparatedSyntaxListWrapper<TProperty>).GetTypeInfo().GetDeclaredProperty(nameof(SeparatedSyntaxListWrapper<TProperty>.UnderlyingList));\n            Expression value = Expression.Convert(\n                Expression.Call(valueParameter, underlyingListProperty.GetMethod),\n                property.PropertyType);\n\n            Expression<Func<TSyntax, SeparatedSyntaxListWrapper<TProperty>, TSyntax>> expression =\n                Expression.Lambda<Func<TSyntax, SeparatedSyntaxListWrapper<TProperty>, TSyntax>>(\n                    Expression.Call(instance, methodInfo, value),\n                    syntaxParameter,\n                    valueParameter);\n            return expression.Compile();\n        }\n\n        private static bool ValidatePropertyType(Type returnType, Type actualType)\n        {\n            var requiredType = SyntaxNodeTypes.LatestType(returnType) ?? returnType;\n            return requiredType == actualType;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer/TemporaryLightUp/SeparatedSyntaxListWrapper`1.cs",
    "content": "﻿// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.\n// Licensed under the MIT License. See LICENSE in the project root for license information.\n\n#nullable disable\n\nnamespace SonarAnalyzer.ShimLayer\n{\n    using System;\n    using System.Collections;\n    using System.Collections.Generic;\n    using System.Collections.Immutable;\n    using System.ComponentModel;\n    using System.Linq;\n    using Microsoft.CodeAnalysis;\n    using Microsoft.CodeAnalysis.Text;\n\n    public abstract class SeparatedSyntaxListWrapper<TNode> : IEquatable<SeparatedSyntaxListWrapper<TNode>>, IReadOnlyList<TNode>\n    {\n        private static readonly SyntaxWrapper<TNode> SyntaxWrapper = SyntaxWrapper<TNode>.Default;\n\n        public static SeparatedSyntaxListWrapper<TNode> UnsupportedEmpty { get; } =\n            new UnsupportedSyntaxList();\n\n        public abstract int Count\n        {\n            get;\n        }\n\n        public abstract TextSpan FullSpan\n        {\n            get;\n        }\n\n        public abstract int SeparatorCount\n        {\n            get;\n        }\n\n        public abstract TextSpan Span\n        {\n            get;\n        }\n\n        [EditorBrowsable(EditorBrowsableState.Never)]\n        public abstract object UnderlyingList\n        {\n            get;\n        }\n\n        public abstract TNode this[int index]\n        {\n            get;\n        }\n\n        public static bool operator ==(SeparatedSyntaxListWrapper<TNode> left, SeparatedSyntaxListWrapper<TNode> right)\n        {\n            // Currently unused\n            _ = left;\n            _ = right;\n\n            throw new NotImplementedException();\n        }\n\n        public static bool operator !=(SeparatedSyntaxListWrapper<TNode> left, SeparatedSyntaxListWrapper<TNode> right)\n        {\n            // Currently unused\n            _ = left;\n            _ = right;\n\n            throw new NotImplementedException();\n        }\n\n        // Summary:\n        //     Creates a new list with the specified node added to the end.\n        //\n        // Parameters:\n        //   node:\n        //     The node to add.\n        public SeparatedSyntaxListWrapper<TNode> Add(TNode node)\n            => this.Insert(this.Count, node);\n\n        // Summary:\n        //     Creates a new list with the specified nodes added to the end.\n        //\n        // Parameters:\n        //   nodes:\n        //     The nodes to add.\n        public SeparatedSyntaxListWrapper<TNode> AddRange(IEnumerable<TNode> nodes)\n            => this.InsertRange(this.Count, nodes);\n\n        public abstract bool Any();\n\n        public abstract bool Contains(TNode node);\n\n        public bool Equals(SeparatedSyntaxListWrapper<TNode> other)\n        {\n            throw new NotImplementedException();\n        }\n\n        public override bool Equals(object obj)\n        {\n            throw new NotImplementedException();\n        }\n\n        public abstract TNode First();\n\n        public abstract TNode FirstOrDefault();\n\n        public Enumerator GetEnumerator()\n        {\n            return new Enumerator(this);\n        }\n\n        IEnumerator<TNode> IEnumerable<TNode>.GetEnumerator()\n        {\n            return this.GetEnumerator();\n        }\n\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return ((IEnumerable<TNode>)this).GetEnumerator();\n        }\n\n        public override abstract int GetHashCode();\n\n        public abstract SyntaxToken GetSeparator(int index);\n\n        public abstract IEnumerable<SyntaxToken> GetSeparators();\n\n        public abstract SyntaxNodeOrTokenList GetWithSeparators();\n\n        public abstract int IndexOf(Func<TNode, bool> predicate);\n\n        public abstract int IndexOf(TNode node);\n\n        public abstract SeparatedSyntaxListWrapper<TNode> Insert(int index, TNode node);\n\n        public abstract SeparatedSyntaxListWrapper<TNode> InsertRange(int index, IEnumerable<TNode> nodes);\n\n        public abstract TNode Last();\n\n        public abstract int LastIndexOf(Func<TNode, bool> predicate);\n\n        public abstract int LastIndexOf(TNode node);\n\n        public abstract TNode LastOrDefault();\n\n        public abstract SeparatedSyntaxListWrapper<TNode> Remove(TNode node);\n\n        public abstract SeparatedSyntaxListWrapper<TNode> RemoveAt(int index);\n\n        public abstract SeparatedSyntaxListWrapper<TNode> Replace(TNode nodeInList, TNode newNode);\n\n        public abstract SeparatedSyntaxListWrapper<TNode> ReplaceRange(TNode nodeInList, IEnumerable<TNode> newNodes);\n\n        public abstract SeparatedSyntaxListWrapper<TNode> ReplaceSeparator(SyntaxToken separatorToken, SyntaxToken newSeparator);\n\n        public abstract string ToFullString();\n\n        public override abstract string ToString();\n\n        public struct Enumerator : IEnumerator<TNode>\n        {\n            private readonly SeparatedSyntaxListWrapper<TNode> wrapper;\n            private int index;\n            private TNode current;\n\n            public Enumerator(SeparatedSyntaxListWrapper<TNode> wrapper)\n            {\n                this.wrapper = wrapper;\n                this.index = -1;\n                this.current = default;\n            }\n\n            public TNode Current => this.current;\n\n            object IEnumerator.Current => this.Current;\n\n            public override bool Equals(object obj)\n            {\n                Enumerator? otherOpt = obj as Enumerator?;\n                if (!otherOpt.HasValue)\n                {\n                    return false;\n                }\n\n                Enumerator other = otherOpt.GetValueOrDefault();\n                return other.wrapper == this.wrapper\n                    && other.index == this.index;\n            }\n\n            public override int GetHashCode()\n            {\n                if (this.wrapper == null)\n                {\n                    return 0;\n                }\n\n                return this.wrapper.GetHashCode() ^ this.index;\n            }\n\n            public void Dispose()\n            {\n            }\n\n            public bool MoveNext()\n            {\n                if (this.index < -1)\n                {\n                    return false;\n                }\n\n                if (this.index == this.wrapper.Count - 1)\n                {\n                    this.index = int.MinValue;\n                    return false;\n                }\n\n                this.index++;\n                this.current = this.wrapper[this.index];\n                return true;\n            }\n\n            public void Reset()\n            {\n                this.index = -1;\n                this.current = default;\n            }\n        }\n\n        internal sealed class AutoWrapSeparatedSyntaxList<TSyntax> : SeparatedSyntaxListWrapper<TNode>\n            where TSyntax : SyntaxNode\n        {\n            private readonly SeparatedSyntaxList<TSyntax> syntaxList;\n\n            public AutoWrapSeparatedSyntaxList()\n                : this(default)\n            {\n            }\n\n            public AutoWrapSeparatedSyntaxList(SeparatedSyntaxList<TSyntax> syntaxList)\n            {\n                this.syntaxList = syntaxList;\n            }\n\n            public override int Count\n                => this.syntaxList.Count;\n\n            public override TextSpan FullSpan\n                => this.syntaxList.FullSpan;\n\n            public override int SeparatorCount\n                => this.syntaxList.SeparatorCount;\n\n            public override TextSpan Span\n                => this.syntaxList.Span;\n\n            public override object UnderlyingList\n                => this.syntaxList;\n\n            public override TNode this[int index]\n                => SyntaxWrapper.Wrap(this.syntaxList[index]);\n\n            public override bool Any()\n                => this.syntaxList.Any();\n\n            public override bool Contains(TNode node)\n                => this.syntaxList.Contains(SyntaxWrapper.Unwrap(node));\n\n            public override TNode First()\n                => SyntaxWrapper.Wrap(this.syntaxList.First());\n\n            public override TNode FirstOrDefault()\n                => SyntaxWrapper.Wrap(this.syntaxList.FirstOrDefault());\n\n            public override int GetHashCode()\n                => this.syntaxList.GetHashCode();\n\n            public override SyntaxToken GetSeparator(int index)\n                => this.syntaxList.GetSeparator(index);\n\n            public override IEnumerable<SyntaxToken> GetSeparators()\n                => this.syntaxList.GetSeparators();\n\n            public override SyntaxNodeOrTokenList GetWithSeparators()\n                => this.syntaxList.GetWithSeparators();\n\n            public override int IndexOf(TNode node)\n                => this.syntaxList.IndexOf((TSyntax)SyntaxWrapper.Unwrap(node));\n\n            public override int IndexOf(Func<TNode, bool> predicate)\n                => this.syntaxList.IndexOf(node => predicate(SyntaxWrapper.Wrap(node)));\n\n            public override SeparatedSyntaxListWrapper<TNode> Insert(int index, TNode node)\n                => new AutoWrapSeparatedSyntaxList<TSyntax>(this.syntaxList.Insert(index, (TSyntax)SyntaxWrapper.Unwrap(node)));\n\n            public override SeparatedSyntaxListWrapper<TNode> InsertRange(int index, IEnumerable<TNode> nodes)\n                => new AutoWrapSeparatedSyntaxList<TSyntax>(this.syntaxList.InsertRange(index, nodes.Select(node => (TSyntax)SyntaxWrapper.Unwrap(node))));\n\n            public override TNode Last()\n                => SyntaxWrapper.Wrap(this.syntaxList.Last());\n\n            public override int LastIndexOf(TNode node)\n                => this.syntaxList.LastIndexOf((TSyntax)SyntaxWrapper.Unwrap(node));\n\n            public override int LastIndexOf(Func<TNode, bool> predicate)\n                => this.syntaxList.LastIndexOf(node => predicate(SyntaxWrapper.Wrap(node)));\n\n            public override TNode LastOrDefault()\n                => SyntaxWrapper.Wrap(this.syntaxList.LastOrDefault());\n\n            public override SeparatedSyntaxListWrapper<TNode> Remove(TNode node)\n                => new AutoWrapSeparatedSyntaxList<TSyntax>(this.syntaxList.Remove((TSyntax)SyntaxWrapper.Unwrap(node)));\n\n            public override SeparatedSyntaxListWrapper<TNode> RemoveAt(int index)\n                => new AutoWrapSeparatedSyntaxList<TSyntax>(this.syntaxList.RemoveAt(index));\n\n            public override SeparatedSyntaxListWrapper<TNode> Replace(TNode nodeInList, TNode newNode)\n                => new AutoWrapSeparatedSyntaxList<TSyntax>(this.syntaxList.Replace((TSyntax)SyntaxWrapper.Unwrap(nodeInList), (TSyntax)SyntaxWrapper.Unwrap(newNode)));\n\n            public override SeparatedSyntaxListWrapper<TNode> ReplaceRange(TNode nodeInList, IEnumerable<TNode> newNodes)\n                => new AutoWrapSeparatedSyntaxList<TSyntax>(this.syntaxList.ReplaceRange((TSyntax)SyntaxWrapper.Unwrap(nodeInList), newNodes.Select(node => (TSyntax)SyntaxWrapper.Unwrap(node))));\n\n            public override SeparatedSyntaxListWrapper<TNode> ReplaceSeparator(SyntaxToken separatorToken, SyntaxToken newSeparator)\n                => new AutoWrapSeparatedSyntaxList<TSyntax>(this.syntaxList.ReplaceSeparator(separatorToken, newSeparator));\n\n            public override string ToFullString()\n                => this.syntaxList.ToFullString();\n\n            public override string ToString()\n                => this.syntaxList.ToString();\n        }\n\n        private sealed class UnsupportedSyntaxList : SeparatedSyntaxListWrapper<TNode>\n        {\n            private static readonly SeparatedSyntaxList<SyntaxNode> SyntaxList = default;\n\n            public UnsupportedSyntaxList()\n            {\n            }\n\n            public override int Count\n                => 0;\n\n            public override TextSpan FullSpan\n                => SyntaxList.FullSpan;\n\n            public override int SeparatorCount\n                => 0;\n\n            public override TextSpan Span\n                => SyntaxList.Span;\n\n            public override object UnderlyingList\n                => null;\n\n            public override TNode this[int index]\n                => SyntaxWrapper.Wrap(SyntaxList[index]);\n\n            public override bool Any()\n                => false;\n\n            public override bool Contains(TNode node)\n                => false;\n\n            public override TNode First()\n                => SyntaxWrapper.Wrap(SyntaxList.First());\n\n            public override TNode FirstOrDefault()\n                => SyntaxWrapper.Wrap(default);\n\n            public override int GetHashCode()\n                => SyntaxList.GetHashCode();\n\n            public override SyntaxToken GetSeparator(int index)\n                => SyntaxList.GetSeparator(index);\n\n            public override IEnumerable<SyntaxToken> GetSeparators()\n                => SyntaxList.GetSeparators();\n\n            public override SyntaxNodeOrTokenList GetWithSeparators()\n                => SyntaxList.GetWithSeparators();\n\n            public override int IndexOf(TNode node)\n                => SyntaxList.IndexOf(SyntaxWrapper.Unwrap(node));\n\n            public override int IndexOf(Func<TNode, bool> predicate)\n                => SyntaxList.IndexOf(node => predicate(SyntaxWrapper.Wrap(node)));\n\n            public override SeparatedSyntaxListWrapper<TNode> Insert(int index, TNode node)\n            {\n                throw new NotSupportedException();\n            }\n\n            public override SeparatedSyntaxListWrapper<TNode> InsertRange(int index, IEnumerable<TNode> nodes)\n            {\n                throw new NotSupportedException();\n            }\n\n            public override TNode Last()\n                => SyntaxWrapper.Wrap(SyntaxList.Last());\n\n            public override int LastIndexOf(TNode node)\n                => SyntaxList.LastIndexOf(SyntaxWrapper.Unwrap(node));\n\n            public override int LastIndexOf(Func<TNode, bool> predicate)\n                => SyntaxList.LastIndexOf(node => predicate(SyntaxWrapper.Wrap(node)));\n\n            public override TNode LastOrDefault()\n                => SyntaxWrapper.Wrap(default);\n\n            public override SeparatedSyntaxListWrapper<TNode> Remove(TNode node)\n            {\n                throw new NotSupportedException();\n            }\n\n            public override SeparatedSyntaxListWrapper<TNode> RemoveAt(int index)\n            {\n                throw new NotSupportedException();\n            }\n\n            public override SeparatedSyntaxListWrapper<TNode> Replace(TNode nodeInList, TNode newNode)\n            {\n                throw new NotSupportedException();\n            }\n\n            public override SeparatedSyntaxListWrapper<TNode> ReplaceRange(TNode nodeInList, IEnumerable<TNode> newNodes)\n            {\n                throw new NotSupportedException();\n            }\n\n            public override SeparatedSyntaxListWrapper<TNode> ReplaceSeparator(SyntaxToken separatorToken, SyntaxToken newSeparator)\n            {\n                throw new NotSupportedException();\n            }\n\n            public override string ToFullString()\n                => SyntaxList.ToFullString();\n\n            public override string ToString()\n                => SyntaxList.ToString();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer/TemporaryLightUp/SyntaxWrapper`1.cs",
    "content": "﻿// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.\n// Licensed under the MIT License. See LICENSE in the project root for license information.\n\n#nullable disable\n\nnamespace SonarAnalyzer.ShimLayer\n{\n    using System;\n    using System.Linq;\n    using System.Linq.Expressions;\n    using System.Reflection;\n    using Microsoft.CodeAnalysis;\n    using SonarAnalyzer.ShimLayer;\n\n    public abstract class SyntaxWrapper<TNode>\n    {\n        public static SyntaxWrapper<TNode> Default { get; } = FindDefaultSyntaxWrapper();\n\n        public abstract TNode Wrap(SyntaxNode node);\n\n        public abstract SyntaxNode Unwrap(TNode node);\n\n        private static SyntaxWrapper<TNode> FindDefaultSyntaxWrapper()\n        {\n            if (typeof(SyntaxNode).GetTypeInfo().IsAssignableFrom(typeof(TNode).GetTypeInfo()))\n            {\n                return new DirectCastSyntaxWrapper();\n            }\n\n            return new ConversionSyntaxWrapper();\n        }\n\n        private sealed class DirectCastSyntaxWrapper : SyntaxWrapper<TNode>\n        {\n            public override SyntaxNode Unwrap(TNode node)\n            {\n                return (SyntaxNode)(object)node;\n            }\n\n            public override TNode Wrap(SyntaxNode node)\n            {\n                return (TNode)(object)node;\n            }\n        }\n\n        private sealed class ConversionSyntaxWrapper : SyntaxWrapper<TNode>\n        {\n            private readonly Func<TNode, SyntaxNode> unwrapAccessor;\n            private readonly Func<SyntaxNode, TNode> wrapAccessor;\n\n            public ConversionSyntaxWrapper()\n            {\n                this.unwrapAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TNode, SyntaxNode>(typeof(TNode), nameof(ISyntaxWrapper<SyntaxNode>.SyntaxNode));\n\n                var explicitOperator = typeof(TNode).GetTypeInfo().GetDeclaredMethods(\"op_Explicit\")\n                    .Single(m => m.ReturnType == typeof(TNode) && m.GetParameters()[0].ParameterType == typeof(SyntaxNode));\n                var syntaxParameter = Expression.Parameter(typeof(SyntaxNode), \"syntax\");\n                Expression<Func<SyntaxNode, TNode>> wrapAccessorExpression =\n                    Expression.Lambda<Func<SyntaxNode, TNode>>(\n                        Expression.Call(explicitOperator, syntaxParameter),\n                        syntaxParameter);\n\n                this.wrapAccessor = wrapAccessorExpression.Compile();\n            }\n\n            public override SyntaxNode Unwrap(TNode node)\n            {\n                return this.unwrapAccessor(node);\n            }\n\n            public override TNode Wrap(SyntaxNode node)\n            {\n                return this.wrapAccessor(node);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer/TemporaryLightUp/TryGetValueAccessor`3.cs",
    "content": "﻿// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.\n// Licensed under the MIT License. See LICENSE in the project root for license information.\n\n#nullable disable\n\nnamespace SonarAnalyzer.ShimLayer\n{\n    internal delegate bool TryGetValueAccessor<T, TKey, TValue>(T instance, TKey key, out TValue value);\n    internal delegate bool TryGetValueAccessor<T, TFirst, TSecond, TValue>(T instance, TFirst first, TSecond second, out TValue value); // Sonar\n    internal delegate bool TryGetValueAccessor<T, TFirst, TSecond, TThird, TValue>(T instance, TFirst first, TSecond second, TThird third, out TValue value); // Sonar\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer/packages.lock.json",
    "content": "{\n  \"version\": 1,\n  \"dependencies\": {\n    \".NETStandard,Version=v2.0\": {\n      \"Microsoft.CodeAnalysis.CSharp.Workspaces\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.3.2, )\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"MwGmrrPx3okEJuCogSn4TM3yTtJUDdmTt8RXpnjVo0dPund0YSAq4bHQQ9bxgArbrrapcopJmkb7UOLAvanXkg==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp\": \"[1.3.2]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2]\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[3.3.1, )\",\n        \"resolved\": \"3.3.1\",\n        \"contentHash\": \"eT+kgNCDdTRbQ5WF6BGx1HI3D5jYfHteza/koefhWC2vNZGxObA74XxwWfg40dy3uUv7dn3OGKLK5GUPLroVog==\"\n      },\n      \"NETStandard.Library\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[2.0.3, )\",\n        \"resolved\": \"2.0.3\",\n        \"contentHash\": \"st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.1.0\"\n        }\n      },\n      \"SonarAnalyzer.CSharp.Styling\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[10.21.0.135717, )\",\n        \"resolved\": \"10.21.0.135717\",\n        \"contentHash\": \"hl264jF539oB7m2jED5QGM345eFSiDAdoJc8TH0HM6L7ZeqT5TDqZDQeZ8IDP02dVIpH/Fhhn+HsGfEcj8ohyQ==\"\n      },\n      \"StyleCop.Analyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.2.0-beta.556, )\",\n        \"resolved\": \"1.2.0-beta.556\",\n        \"contentHash\": \"llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==\",\n        \"dependencies\": {\n          \"StyleCop.Analyzers.Unstable\": \"1.2.0.556\"\n        }\n      },\n      \"System.Collections.Immutable\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.1.37, )\",\n        \"resolved\": \"1.1.37\",\n        \"contentHash\": \"fTpqwZYBzoklTT+XjTRK8KxvmrGkYHzBiylCcKyQcxiOM8k+QvhNBxRvFHDWzy4OEP5f8/9n+xQ9mEgEXY+muA==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.0\",\n          \"System.Diagnostics.Debug\": \"4.0.0\",\n          \"System.Globalization\": \"4.0.0\",\n          \"System.Linq\": \"4.0.0\",\n          \"System.Resources.ResourceManager\": \"4.0.0\",\n          \"System.Runtime\": \"4.0.0\",\n          \"System.Runtime.Extensions\": \"4.0.0\",\n          \"System.Threading\": \"4.0.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.1.0\",\n        \"contentHash\": \"HS3iRWZKcUw/8eZ/08GXKY2Bn7xNzQPzf8gRPHGSowX7u7XXu9i9YEaBeBNKUXWfI7qjvT2zXtLUvbN0hds8vg==\"\n      },\n      \"Microsoft.CodeAnalysis.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"lOinFNbjpCvkeYQHutjKi+CfsjoKu88wAFT6hAumSR/XJSJmmVGvmnbzCWW8kUJnDVrw1RrcqS8BzgPMj263og==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"1.1.0\",\n          \"System.AppContext\": \"4.1.0\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.Collections.Concurrent\": \"4.0.12\",\n          \"System.Collections.Immutable\": \"1.2.0\",\n          \"System.Console\": \"4.0.0\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Diagnostics.FileVersionInfo\": \"4.0.0\",\n          \"System.Diagnostics.StackTrace\": \"4.0.1\",\n          \"System.Diagnostics.Tools\": \"4.0.1\",\n          \"System.Dynamic.Runtime\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Linq.Expressions\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Metadata\": \"1.3.0\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Runtime.Numerics\": \"4.0.1\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.X509Certificates\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Text.Encoding.CodePages\": \"4.0.1\",\n          \"System.Text.Encoding.Extensions\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\",\n          \"System.Threading.Tasks.Parallel\": \"4.0.1\",\n          \"System.Threading.Thread\": \"4.0.0\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\",\n          \"System.Xml.XDocument\": \"4.0.11\",\n          \"System.Xml.XPath.XDocument\": \"4.0.1\",\n          \"System.Xml.XmlDocument\": \"4.0.1\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"GrYMp6ScZDOMR0fNn/Ce6SegNVFw1G/QRT/8FiKv7lAP+V6lEZx9e42n0FvFUgjjcKgcEJOI4muU6i+3LSvOBA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Common\": \"[1.3.2]\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Workspaces.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"kvdo+rkImlx5MuBgkayl4OV3Mg8/qirUdYgCIfQ9EqN15QasJFlQXmDAtCGqpkK9sYLLO/VK+y+4mvKjfh/FOA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Common\": \"[1.3.2]\",\n          \"Microsoft.Composition\": \"1.0.27\"\n        }\n      },\n      \"Microsoft.Composition\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.27\",\n        \"contentHash\": \"pwu80Ohe7SBzZ6i69LVdzowp6V+LaVRzd5F7A6QlD42vQkX0oT7KXKWWPlM/S00w1gnMQMRnEdbtOV12z6rXdQ==\"\n      },\n      \"Microsoft.NETCore.Platforms\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.1.0\",\n        \"contentHash\": \"kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==\"\n      },\n      \"Microsoft.NETCore.Targets\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.1\",\n        \"contentHash\": \"rkn+fKobF/cbWfnnfBOQHKVKIOpxMZBvlSHkqDWgBpwGDcLRduvs3D9OLGeV6GWGvVwNlVi2CBbTjuPmtHvyNw==\"\n      },\n      \"runtime.native.System\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"QfS/nQI7k/BLgmLrw7qm7YBoULEvgWnPI+cYsbfCVFTW8Aj+i8JhccxcFMu1RWms0YZzF+UHguNBK4Qn89e2Sg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\"\n        }\n      },\n      \"runtime.native.System.Net.Http\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"Nh0UPZx2Vifh8r+J+H2jxifZUD3sBrmolgiFWJd2yiNrxO0xTa6bAw3YwRn1VOiSen/tUXMS31ttNItCZ6lKuA==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\"\n        }\n      },\n      \"runtime.native.System.Security.Cryptography\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"2CQK0jmO6Eu7ZeMgD+LOFbNJSXHFVQbCJJkEyEwowh1SCgYnrn9W9RykMfpeeVGw7h4IBvYikzpGUlmZTUafJw==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\"\n        }\n      },\n      \"StyleCop.Analyzers.Unstable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.2.0.556\",\n        \"contentHash\": \"zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==\"\n      },\n      \"System.AppContext\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"3QjO4jNV7PdKkmQAVp9atA+usVnKRwI3Kx1nMwJ93T0LcQfx7pKAYk0nKz5wn1oP5iqlhZuy6RXOFdhr7rDwow==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Collections\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"YUJGz6eFKqS0V//mLt25vFGrrCvOnsXjlvFQs+KimpwNxug9x0Pzy4PlFMU3Q2IzqAa9G2L4LsK3+9vCBK7oTg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Collections.Concurrent\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.12\",\n        \"contentHash\": \"2gBcbb3drMLgxlI0fBfxMA31ec6AEyYCHygGse4vxceJan8mRIWeKJ24BFzN7+bi/NFTgdIgufzb94LWO5EERQ==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Diagnostics.Tracing\": \"4.1.0\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Console\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"qSKUSOIiYA/a0g5XXdxFcUFmv1hNICBD7QZ0QhGYVipPIhvpiydY8VZqr1thmCXvmn8aipMg64zuanB4eotK9A==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\"\n        }\n      },\n      \"System.Diagnostics.Debug\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"w5U95fVKHY4G8ASs/K5iK3J5LY+/dLFd4vKejsnI/ZhBsWS9hQakfx3Zr7lRWKg4tAw9r4iktyvsTagWkqYCiw==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Diagnostics.FileVersionInfo\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"qjF74OTAU+mRhLaL4YSfiWy3vj6T3AOz8AW37l5zCwfbBfj0k7E94XnEsRaf2TnhE/7QaV6Hvqakoy2LoV8MVg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Reflection.Metadata\": \"1.3.0\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.InteropServices\": \"4.1.0\"\n        }\n      },\n      \"System.Diagnostics.StackTrace\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"6i2EbRq0lgGfiZ+FDf0gVaw9qeEU+7IS2+wbZJmFVpvVzVOgZEt0ScZtyenuBvs6iDYbGiF51bMAa0oDP/tujQ==\",\n        \"dependencies\": {\n          \"System.Collections.Immutable\": \"1.2.0\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Metadata\": \"1.3.0\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\"\n        }\n      },\n      \"System.Diagnostics.Tools\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"xBfJ8pnd4C17dWaC9FM6aShzbJcRNMChUMD42I6772KGGrqaFdumwhn9OdM68erj1ueNo3xdQ1EwiFjK5k8p0g==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Diagnostics.Tracing\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"vDN1PoMZCkkdNjvZLql592oYJZgS7URcJzJ7bxeBgGtx5UtR5leNm49VmfHGqIffX4FKacHbI3H6UyNSHQknBg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Dynamic.Runtime\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"db34f6LHYM0U0JpE+sOmjar27BnqTVkbLJhgfwMpTdgTigG/Hna3m2MYVwnFzGGKnEJk2UXFuoVTr8WUbU91/A==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Linq.Expressions\": \"4.1.0\",\n          \"System.ObjectModel\": \"4.0.12\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Emit\": \"4.0.1\",\n          \"System.Reflection.Emit.ILGeneration\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Reflection.TypeExtensions\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Globalization\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"B95h0YLEL2oSnwF/XjqSWKnwKOy/01VWkNlsCeMTFJLLabflpGV26nK164eRs5GiaRSBGpOxQ3pKoSnnyZN5pg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Globalization.Calendars\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"L1c6IqeQ88vuzC1P81JeHmHA8mxq8a18NUBNXnIY/BVb+TCyAaGIFbhpZt60h9FJNmisymoQkHEFSE9Vslja1Q==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.IO\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"3KlTJceQc3gnGIaHZ7UBZO26SHL1SHE4ddrmiwumFnId+CEHP+O8r386tZKaE6zlk5/mF8vifMBzHj9SaXN+mQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.IO.FileSystem\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"IBErlVq5jOggAD69bg1t0pJcHaDbJbWNUZTPI96fkYWzwYbN6D9wRHMULLDd9dHsl7C2YsxXL31LMfPI1SWt8w==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.IO.FileSystem.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"kWkKD203JJKxJeE74p8aF8y4Qc9r9WQx4C0cHzHPrY3fv/L/IhWnyCHaFJ3H1QPOH6A93whlQ2vG5nHlBDvzWQ==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Linq\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"bQ0iYFOQI0nuTnt+NQADns6ucV4DUvMdwN6CbkB1yj8i7arTGiTN5eok1kQwdnnNWSDZfIUySQY+J3d5KjWn0g==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\"\n        }\n      },\n      \"System.Linq.Expressions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"I+y02iqkgmCAyfbqOmSDOgqdZQ5tTj80Akm5BPSS8EeB0VGWdy6X1KCoYe8Pk6pwDoAKZUOdLVxnTJcExiv5zw==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.ObjectModel\": \"4.0.12\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Emit\": \"4.0.1\",\n          \"System.Reflection.Emit.ILGeneration\": \"4.0.1\",\n          \"System.Reflection.Emit.Lightweight\": \"4.0.1\",\n          \"System.Reflection.Extensions\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Reflection.TypeExtensions\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.ObjectModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.12\",\n        \"contentHash\": \"tAgJM1xt3ytyMoW4qn4wIqgJYm7L7TShRZG4+Q4Qsi2PCcj96pXN7nRywS9KkB3p/xDUjc2HSwP9SROyPYDYKQ==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Reflection\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"JCKANJ0TI7kzoQzuwB/OoJANy1Lg338B6+JVacPl4TpUwi3cReg3nMLplMq2uqYfHFQpKIlHAUVAJlImZz/4ng==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Emit\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"P2wqAj72fFjpP6wb9nSfDqNBMab+2ovzSDzUZK7MVIm54tBJEPr9jWfSjjoTpPwj1LeKcmX3vr0ttyjSSFM47g==\",\n        \"dependencies\": {\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Emit.ILGeneration\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Emit.ILGeneration\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"Ov6dU8Bu15Bc7zuqttgHF12J5lwSWyTf1S+FJouUXVMSqImLZzYaQ+vRr1rQ0OZ0HqsrwWl4dsKHELckQkVpgA==\",\n        \"dependencies\": {\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Emit.Lightweight\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"sSzHHXueZ5Uh0OLpUQprhr+ZYJrLPA2Cmr4gn0wj9+FftNKXx8RIMKvO9qnjk2ebPYUjZ+F2ulGdPOsvj+MEjA==\",\n        \"dependencies\": {\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Emit.ILGeneration\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"GYrtRsZcMuHF3sbmRHfMYpvxZoIN2bQGrYGerUiWLEkqdEUQZhH3TRSaC/oI4wO0II1RKBPlpIa1TOMxIcOOzQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Metadata\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.0\",\n        \"contentHash\": \"jMSCxA4LSyKBGRDm/WtfkO03FkcgRzHxwvQRib1bm2GZ8ifKM1MX1al6breGCEQK280mdl9uQS7JNPXRYk90jw==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Collections.Immutable\": \"1.2.0\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Extensions\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Text.Encoding.Extensions\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Reflection.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"4inTox4wTBaDhB7V3mPvp9XlCbeGYWVEM9/fXALd52vNEAVisc1BoVWQPuUuD0Ga//dNbA/WeMy9u9mzLxGTHQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.TypeExtensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"tsQ/ptQ3H5FYfON8lL4MxRk/8kFyE0A+tGPXmVP967cT/gzLHYxIejIYSxp4JmIeFHVP78g/F2FE1mUUTbDtrg==\",\n        \"dependencies\": {\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Resources.ResourceManager\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"TxwVeUNoTgUOdQ09gfTjvW411MF+w9MBYL7AtNVc+HtBCFlutPLhUCdZjNkjbhj3bNQWMdHboF0KIWEOjJssbA==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Runtime\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"v6c/4Yaa9uWsq+JMhnOFewrYkgdNHNG2eMKuNqRn8P733rNXeRCGvV5FkkjBXn2dbVkPXOsO0xjsEeM1q2zC0g==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\"\n        }\n      },\n      \"System.Runtime.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"CUOHjTT/vgP0qGW22U4/hDlOqXmcPq5YicBaXdUR2UiUoLwBT+olO6we4DVbq57jeX5uXH2uerVZhf0qGj+sVQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Runtime.Handles\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"nCJvEKguXEvk2ymk1gqj625vVnlK3/xdGzx0vOKicQkoquaTBJTP13AIYkocSUwHCLNBwUbXTqTWGDxBTWpt7g==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Runtime.InteropServices\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"16eu3kjHS633yYdkjwShDHZLRNMKVi/s0bY8ODiqJ2RfMhDMAwxZaUaWVnZ2P71kr/or+X9o/xFWtNqz8ivieQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\"\n        }\n      },\n      \"System.Runtime.Numerics\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"+XbKFuzdmLP3d1o9pdHu2nxjNr2OEPqGzKeegPLCUMM71a0t50A/rOcIRmGs9wR7a8KuHX6hYs/7/TymIGLNqg==\",\n        \"dependencies\": {\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\"\n        }\n      },\n      \"System.Security.Cryptography.Algorithms\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.2.0\",\n        \"contentHash\": \"8JQFxbLVdrtIOKMDN38Fn0GWnqYZw/oMlwOUG/qz1jqChvyZlnUmu+0s7wLx7JYua/nAXoESpHA3iw11QFWhXg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Runtime.Numerics\": \"4.0.1\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"runtime.native.System.Security.Cryptography\": \"4.0.0\"\n        }\n      },\n      \"System.Security.Cryptography.Cng\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.2.0\",\n        \"contentHash\": \"cUJ2h+ZvONDe28Szw3st5dOHdjndhJzQ2WObDEXAWRPEQBtVItVoxbXM/OEsTthl3cNn2dk2k0I3y45igCQcLw==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\"\n        }\n      },\n      \"System.Security.Cryptography.Csp\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"/i1Usuo4PgAqgbPNC0NjbO3jPW//BoBlTpcWFD1EHVbidH21y4c1ap5bbEMSGAXjAShhMH4abi/K8fILrnu4BQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Security.Cryptography.Encoding\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"FbKgE5MbxSQMPcSVRgwM6bXN3GtyAh04NkV8E5zKCBE26X0vYW0UtTa2FIgkH33WVqBVxRgxljlVYumWtU+HcQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.Collections.Concurrent\": \"4.0.12\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"runtime.native.System.Security.Cryptography\": \"4.0.0\"\n        }\n      },\n      \"System.Security.Cryptography.OpenSsl\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"HUG/zNUJwEiLkoURDixzkzZdB5yGA5pQhDP93ArOpDPQMteURIGERRNzzoJlmTreLBWr5lkFSjjMSk8ySEpQMw==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Runtime.Numerics\": \"4.0.1\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"runtime.native.System.Security.Cryptography\": \"4.0.0\"\n        }\n      },\n      \"System.Security.Cryptography.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"Wkd7QryWYjkQclX0bngpntW5HSlMzeJU24UaLJQ7YTfI8ydAVAaU2J+HXLLABOVJlKTVvAeL0Aj39VeTe7L+oA==\",\n        \"dependencies\": {\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Security.Cryptography.X509Certificates\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"4HEfsQIKAhA1+ApNn729Gi09zh+lYWwyIuViihoMDWp1vQnEkL2ct7mAbhBlLYm+x/L4Rr/pyGge1lIY635e0w==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Globalization.Calendars\": \"4.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Runtime.Numerics\": \"4.0.1\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Cng\": \"4.2.0\",\n          \"System.Security.Cryptography.Csp\": \"4.0.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.OpenSsl\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\",\n          \"runtime.native.System\": \"4.0.0\",\n          \"runtime.native.System.Net.Http\": \"4.0.1\",\n          \"runtime.native.System.Security.Cryptography\": \"4.0.0\"\n        }\n      },\n      \"System.Text.Encoding\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"U3gGeMlDZXxCEiY4DwVLSacg+DFWCvoiX+JThA/rvw37Sqrku7sEFeVBBBMBnfB6FeZHsyDx85HlKL19x0HtZA==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Text.Encoding.CodePages\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"h4z6rrA/hxWf4655D18IIZ0eaLRa3tQC/j+e26W+VinIHY0l07iEXaAvO0YSYq3MvCjMYy8Zs5AdC1sxNQOB7Q==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Text.Encoding.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"jtbiTDtvfLYgXn8PTfWI+SiBs51rrmO4AAckx4KR6vFK9Wzf6tI8kcRdsYQNwriUeQ1+CtQbM1W4cMbLXnj/OQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\"\n        }\n      },\n      \"System.Text.RegularExpressions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"i88YCXpRTjCnoSQZtdlHkAOx4KNNik4hMy83n0+Ftlb7jvV6ZiZWMpnEZHhjBp6hQVh8gWd/iKNPzlPF7iyA2g==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Threading\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"N+3xqIcg3VDKyjwwCGaZ9HawG9aC6cSDI+s7ROma310GQo8vilFZa86hqKppwTHleR/G0sfOzhvgnUxWCR/DrQ==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Threading.Tasks\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"k1S4Gc6IGwtHGT8188RSeGaX86Qw/wnrgNLshJvsdNUOPP9etMmo8S07c+UlOAx4K/xLuN9ivA1bD0LVurtIxQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Threading.Tasks.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"pH4FZDsZQ/WmgJtN4LWYmRdJAEeVkyriSwrv2Teoe5FOU0Yxlb6II6GL8dBPOfRmutHGATduj3ooMt7dJ2+i+w==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Threading.Tasks.Parallel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"7Pc9t25bcynT9FpMvkUw4ZjYwUiGup/5cJFW72/5MgCG+np2cfVUMdh29u8d7onxX7d8PS3J+wL73zQRqkdrSA==\",\n        \"dependencies\": {\n          \"System.Collections.Concurrent\": \"4.0.12\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Diagnostics.Tracing\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Threading.Thread\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"gIdJqDXlOr5W9zeqFErLw3dsOsiShSCYtF9SEHitACycmvNvY8odf9kiKvp6V7aibc8C4HzzNBkWXjyfn7plbQ==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Xml.ReaderWriter\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"ZIiLPsf67YZ9zgr31vzrFaYQqxRPX9cVHjtPSnmx4eN6lbS/yEyYNr2vs1doGDEscF0tjCZFsk9yUg1sC9e8tg==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Text.Encoding.Extensions\": \"4.0.11\",\n          \"System.Text.RegularExpressions\": \"4.1.0\",\n          \"System.Threading.Tasks\": \"4.0.11\",\n          \"System.Threading.Tasks.Extensions\": \"4.0.0\"\n        }\n      },\n      \"System.Xml.XDocument\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"Mk2mKmPi0nWaoiYeotq1dgeNK1fqWh61+EK+w4Wu8SWuTYLzpUnschb59bJtGywaPq7SmTuPf44wrXRwbIrukg==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Diagnostics.Tools\": \"4.0.1\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\"\n        }\n      },\n      \"System.Xml.XmlDocument\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"2eZu6IP+etFVBBFUFzw2w6J21DqIN5eL9Y8r8JfJWUmV28Z5P0SNU01oCisVHQgHsDhHPnmq2s1hJrJCFZWloQ==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\"\n        }\n      },\n      \"System.Xml.XPath\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"UWd1H+1IJ9Wlq5nognZ/XJdyj8qPE4XufBUkAW59ijsCPjZkZe0MUzKKJFBr+ZWBe5Wq1u1d5f2CYgE93uH7DA==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\"\n        }\n      },\n      \"System.Xml.XPath.XDocument\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"FLhdYJx4331oGovQypQ8JIw2kEmNzCsjVOVYY/16kZTUoquZG85oVn7yUhBE2OZt1yGPSXAL0HTEfzjlbNpM7Q==\",\n        \"dependencies\": {\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\",\n          \"System.Xml.XDocument\": \"4.0.11\",\n          \"System.Xml.XPath\": \"4.0.1\"\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.CodeGeneration/GeneratorSyntaxExtensions.cs",
    "content": "﻿// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.\n// Licensed under the MIT License. See LICENSE in the project root for license information.\n\nnamespace StyleCop.Analyzers.CodeGeneration\n{\n    using Microsoft.CodeAnalysis;\n    using Microsoft.CodeAnalysis.CSharp;\n\n    internal static class GeneratorSyntaxExtensions\n    {\n        public static TSyntax WithLeadingBlankLine<TSyntax>(this TSyntax syntax)\n            where TSyntax : SyntaxNode\n        {\n            return syntax.WithLeadingTrivia(SyntaxFactory.TriviaList(\n                SyntaxFactory.PreprocessingMessage(XmlSyntaxFactory.CrLf)));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.CodeGeneration/LICENSE",
    "content": "MIT License\n\nCopyright (c) Tunnel Vision Laboratories, LLC\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.CodeGeneration/OperationLightupGenerator.cs",
    "content": "﻿// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.\n// Licensed under the MIT License. See LICENSE in the project root for license information.\n\nnamespace StyleCop.Analyzers.CodeGeneration\n{\n    using System;\n    using System.Collections.Generic;\n    using System.Collections.Immutable;\n    using System.Collections.ObjectModel;\n    using System.Globalization;\n    using System.IO;\n    using System.Linq;\n    using System.Text;\n    using System.Xml.Linq;\n    using System.Xml.XPath;\n    using Microsoft.CodeAnalysis;\n    using Microsoft.CodeAnalysis.CSharp;\n    using Microsoft.CodeAnalysis.CSharp.Syntax;\n\n    [Generator]\n    internal sealed class OperationLightupGenerator : IIncrementalGenerator\n    {\n        public void Initialize(IncrementalGeneratorInitializationContext context)\n        {\n            var operationInterfacesFiles = context.AdditionalTextsProvider.Where(static x => Path.GetFileName(x.Path) == \"OperationInterfaces.xml\");\n            context.RegisterSourceOutput(operationInterfacesFiles, this.Execute);\n        }\n\n        private void Execute(SourceProductionContext context, AdditionalText operationInterfacesFile)\n        {\n            var operationInterfacesText = operationInterfacesFile.GetText(context.CancellationToken);\n            if (operationInterfacesText is null)\n            {\n                throw new InvalidOperationException(\"Failed to read OperationInterfaces.xml\");\n            }\n\n            var operationInterfaces = XDocument.Parse(operationInterfacesText.ToString());\n            this.GenerateOperationInterfaces(in context, operationInterfaces);\n        }\n\n        private void GenerateOperationInterfaces(in SourceProductionContext context, XDocument operationInterfaces)\n        {\n            var tree = operationInterfaces.XPathSelectElement(\"/Tree\");\n            if (tree is null)\n            {\n                throw new InvalidOperationException(\"Failed to find the IOperation root.\");\n            }\n\n            var documentData = new DocumentData(operationInterfaces);\n            foreach (var pair in documentData.Interfaces)\n            {\n                this.GenerateOperationInterface(in context, pair.Value);\n            }\n\n            this.GenerateOperationWrapperHelper(in context, documentData.Interfaces.Values.ToImmutableArray());\n            // this.GenerateOperationKindEx(in context, documentData.Interfaces.Values.ToImmutableArray());\n        }\n\n        private void GenerateOperationInterface(in SourceProductionContext context, InterfaceData node)\n        {\n            var members = SyntaxFactory.List<MemberDeclarationSyntax>();\n\n            // internal const string WrappedTypeName = \"Microsoft.CodeAnalysis.Operations.IArgumentOperation\";\n            members = members.Add(SyntaxFactory.FieldDeclaration(\n                attributeLists: default,\n                modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PublicKeyword), SyntaxFactory.Token(SyntaxKind.ConstKeyword)), // Sonar\n                declaration: SyntaxFactory.VariableDeclaration(\n                    type: SyntaxFactory.PredefinedType(SyntaxFactory.Token(SyntaxKind.StringKeyword)),\n                    variables: SyntaxFactory.SingletonSeparatedList(SyntaxFactory.VariableDeclarator(\n                        identifier: SyntaxFactory.Identifier(\"WrappedTypeName\"),\n                        argumentList: null,\n                        initializer: SyntaxFactory.EqualsValueClause(SyntaxFactory.LiteralExpression(SyntaxKind.StringLiteralExpression, SyntaxFactory.Literal($\"{node.Namespace}.{node.InterfaceName}\"))))))));\n\n            if (node.InterfaceName != \"IOperation\")\n            {\n                // private static readonly Type WrappedType;\n                members = members.Add(SyntaxFactory.FieldDeclaration(\n                    attributeLists: default,\n                    modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PrivateKeyword), SyntaxFactory.Token(SyntaxKind.StaticKeyword), SyntaxFactory.Token(SyntaxKind.ReadOnlyKeyword)),\n                    declaration: SyntaxFactory.VariableDeclaration(\n                        type: SyntaxFactory.IdentifierName(\"Type\"),\n                        variables: SyntaxFactory.SingletonSeparatedList(SyntaxFactory.VariableDeclarator(\"WrappedType\")))));\n            }\n\n            foreach (var property in node.Properties)\n            {\n                if (property.IsSkipped || !property.NeedsAccessor)\n                {\n                    continue;\n                }\n\n                // private static readonly Func<IOperation, IMethodSymbol> ConstructorAccessor;\n                members = members.Add(SyntaxFactory.FieldDeclaration(\n                    attributeLists: default,\n                    modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PrivateKeyword), SyntaxFactory.Token(SyntaxKind.StaticKeyword), SyntaxFactory.Token(SyntaxKind.ReadOnlyKeyword)),\n                    declaration: SyntaxFactory.VariableDeclaration(\n                        type: SyntaxFactory.GenericName(\n                            identifier: SyntaxFactory.Identifier(\"Func\"),\n                            typeArgumentList: SyntaxFactory.TypeArgumentList(SyntaxFactory.SeparatedList(\n                                new[]\n                                {\n                                    SyntaxFactory.IdentifierName(\"IOperation\"),\n                                    property.AccessorResultType,\n                                }))),\n                        variables: SyntaxFactory.SingletonSeparatedList(SyntaxFactory.VariableDeclarator(property.AccessorName)))));\n            }\n\n            // private readonly IOperation operation;\n            members = members.Add(SyntaxFactory.FieldDeclaration(\n                attributeLists: default,\n                modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PrivateKeyword), SyntaxFactory.Token(SyntaxKind.ReadOnlyKeyword)),\n                declaration: SyntaxFactory.VariableDeclaration(\n                    type: SyntaxFactory.IdentifierName(\"IOperation\"),\n                    variables: SyntaxFactory.SingletonSeparatedList(SyntaxFactory.VariableDeclarator(\"operation\")))));\n\n            var staticCtorStatements = SyntaxFactory.List<StatementSyntax>();\n\n            if (node.InterfaceName != \"IOperation\")\n            {\n                staticCtorStatements = staticCtorStatements.Add(\n                    SyntaxFactory.ExpressionStatement(SyntaxFactory.AssignmentExpression(\n                        SyntaxKind.SimpleAssignmentExpression,\n                        left: SyntaxFactory.IdentifierName(\"WrappedType\"),\n                        right: SyntaxFactory.InvocationExpression(\n                            expression: SyntaxFactory.MemberAccessExpression(\n                                SyntaxKind.SimpleMemberAccessExpression,\n                                expression: SyntaxFactory.IdentifierName(\"OperationWrapperHelper\"),\n                                name: SyntaxFactory.IdentifierName(\"GetWrappedType\")),\n                            argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Argument(\n                                SyntaxFactory.TypeOfExpression(SyntaxFactory.IdentifierName(node.WrapperName)))))))));\n            }\n\n            foreach (var property in node.Properties)\n            {\n                if (property.IsSkipped || !property.NeedsAccessor)\n                {\n                    continue;\n                }\n\n                SimpleNameSyntax helperName;\n                if (property.IsDerivedOperationArray)\n                {\n                    // CreateOperationListPropertyAccessor<IOperation>\n                    helperName = SyntaxFactory.GenericName(\n                        identifier: SyntaxFactory.Identifier(\"CreateOperationListPropertyAccessor\"),\n                        typeArgumentList: SyntaxFactory.TypeArgumentList(SyntaxFactory.SingletonSeparatedList<TypeSyntax>(SyntaxFactory.IdentifierName(\"IOperation\"))));\n                }\n                else\n                {\n                    // CreateOperationPropertyAccessor<IOperation, IMethodSymbol>\n                    helperName = SyntaxFactory.GenericName(\n                        identifier: SyntaxFactory.Identifier(\"CreateOperationPropertyAccessor\"),\n                        typeArgumentList: SyntaxFactory.TypeArgumentList(SyntaxFactory.SeparatedList(\n                            new[]\n                            {\n                                SyntaxFactory.IdentifierName(\"IOperation\"),\n                                property.AccessorResultType,\n                            })));\n                }\n\n                // ConstructorAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, IMethodSymbol>(WrappedType, nameof(Constructor));\n                ExpressionSyntax wrappedType = node.InterfaceName == \"IOperation\"\n                    ? SyntaxFactory.TypeOfExpression(SyntaxFactory.IdentifierName(\"IOperation\"))\n                    : SyntaxFactory.IdentifierName(\"WrappedType\");\n                staticCtorStatements = staticCtorStatements.Add(SyntaxFactory.ExpressionStatement(SyntaxFactory.AssignmentExpression(\n                    SyntaxKind.SimpleAssignmentExpression,\n                    left: SyntaxFactory.IdentifierName(property.AccessorName),\n                    right: SyntaxFactory.InvocationExpression(\n                        expression: SyntaxFactory.MemberAccessExpression(\n                            SyntaxKind.SimpleMemberAccessExpression,\n                            expression: SyntaxFactory.IdentifierName(\"LightupHelpers\"),\n                            name: helperName),\n                        argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SeparatedList(\n                            new[]\n                            {\n                                SyntaxFactory.Argument(wrappedType),\n                                SyntaxFactory.Argument(SyntaxFactory.InvocationExpression(\n                                    expression: SyntaxFactory.IdentifierName(\"nameof\"),\n                                    argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Argument(SyntaxFactory.IdentifierName(property.Name)))))),\n                            }))))));\n            }\n\n            // static IArgumentOperationWrapper()\n            // {\n            //     WrappedType = OperationWrapperHelper.GetWrappedType(typeof(IObjectCreationOperationWrapper));\n            // }\n            members = members.Add(SyntaxFactory.ConstructorDeclaration(\n                attributeLists: default,\n                modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.StaticKeyword)),\n                identifier: SyntaxFactory.Identifier(node.WrapperName),\n                parameterList: SyntaxFactory.ParameterList(),\n                initializer: null,\n                body: SyntaxFactory.Block(staticCtorStatements),\n                expressionBody: null));\n\n            // private IArgumentOperationWrapper(IOperation operation)\n            // {\n            //     this.operation = operation;\n            // }\n            members = members.Add(SyntaxFactory.ConstructorDeclaration(\n                attributeLists: default,\n                modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PrivateKeyword)),\n                identifier: SyntaxFactory.Identifier(node.WrapperName),\n                parameterList: SyntaxFactory.ParameterList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Parameter(\n                    attributeLists: default,\n                    modifiers: default,\n                    type: SyntaxFactory.IdentifierName(\"IOperation\"),\n                    identifier: SyntaxFactory.Identifier(\"operation\"),\n                    @default: null))),\n                initializer: null,\n                body: SyntaxFactory.Block(\n                    SyntaxFactory.ExpressionStatement(SyntaxFactory.AssignmentExpression(\n                        SyntaxKind.SimpleAssignmentExpression,\n                        left: SyntaxFactory.MemberAccessExpression(\n                            SyntaxKind.SimpleMemberAccessExpression,\n                            expression: SyntaxFactory.ThisExpression(),\n                            name: SyntaxFactory.IdentifierName(\"operation\")),\n                        right: SyntaxFactory.IdentifierName(\"operation\")))),\n                expressionBody: null));\n\n            // public IOperation WrappedOperation => this.operation;\n            members = members.Add(SyntaxFactory.PropertyDeclaration(\n                attributeLists: default,\n                modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PublicKeyword)),\n                type: SyntaxFactory.IdentifierName(\"IOperation\"),\n                explicitInterfaceSpecifier: null,\n                identifier: SyntaxFactory.Identifier(\"WrappedOperation\"),\n                accessorList: null,\n                expressionBody: SyntaxFactory.ArrowExpressionClause(SyntaxFactory.MemberAccessExpression(\n                    SyntaxKind.SimpleMemberAccessExpression,\n                    expression: SyntaxFactory.ThisExpression(),\n                    name: SyntaxFactory.IdentifierName(\"operation\"))),\n                initializer: null,\n                semicolonToken: SyntaxFactory.Token(SyntaxKind.SemicolonToken)));\n\n            if (node.InterfaceName != \"IOperation\")\n            {\n                // public ITypeSymbol Type => this.WrappedOperation.Type;\n                members = members.Add(SyntaxFactory.PropertyDeclaration(\n                    attributeLists: default,\n                    modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PublicKeyword)),\n                    type: SyntaxFactory.IdentifierName(\"ITypeSymbol\"),\n                    explicitInterfaceSpecifier: null,\n                    identifier: SyntaxFactory.Identifier(\"Type\"),\n                    accessorList: null,\n                    expressionBody: SyntaxFactory.ArrowExpressionClause(SyntaxFactory.MemberAccessExpression(\n                        SyntaxKind.SimpleMemberAccessExpression,\n                        expression: SyntaxFactory.MemberAccessExpression(\n                            SyntaxKind.SimpleMemberAccessExpression,\n                            expression: SyntaxFactory.ThisExpression(),\n                            name: SyntaxFactory.IdentifierName(\"WrappedOperation\")),\n                        name: SyntaxFactory.IdentifierName(\"Type\"))),\n                    initializer: null,\n                    semicolonToken: SyntaxFactory.Token(SyntaxKind.SemicolonToken)));\n            }\n\n            foreach (var property in node.Properties)\n            {\n                if (property.IsSkipped)\n                {\n                    // Generate a NotImplementedException for public properties that do not have a supported type\n                    if (property.IsPublicProperty && !property.IsOverride) // Sonar\n                    {\n                        // public object Constructor => throw new NotImplementedException(\"Property 'Type.Property' has unsupported type 'Type'\");\n                        members = members.Add(SyntaxFactory.PropertyDeclaration(\n                            attributeLists: default,\n                            modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PublicKeyword)),\n                            type: SyntaxFactory.PredefinedType(SyntaxFactory.Token(SyntaxKind.ObjectKeyword)),\n                            explicitInterfaceSpecifier: null,\n                            identifier: SyntaxFactory.Identifier(property.Name),\n                            accessorList: null,\n                            expressionBody: SyntaxFactory.ArrowExpressionClause(SyntaxFactory.ThrowExpression(SyntaxFactory.ObjectCreationExpression(\n                                type: SyntaxFactory.IdentifierName(nameof(NotImplementedException)),\n                                argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Argument(\n                                    SyntaxFactory.LiteralExpression(\n                                        SyntaxKind.StringLiteralExpression,\n                                        SyntaxFactory.Literal($\"Property '{node.InterfaceName}.{property.Name}' has unsupported type '{property.Type}'\"))))),\n                                initializer: null))),\n                            initializer: null,\n                            semicolonToken: SyntaxFactory.Token(SyntaxKind.SemicolonToken)));\n                    }\n\n                    continue;\n                }\n\n                var propertyType = property.NeedsWrapper ? SyntaxFactory.IdentifierName(property.WrappedType) : property.AccessorResultType; // Sonar\n\n                // The value is accessed in one of the following ways:\n                //   ConstructorAccessor(this.WrappedOperation)\n                //   this.WrappedOperation.Constructor\n                ExpressionSyntax evaluatedAccessor;\n                if (property.NeedsAccessor)\n                {\n                    evaluatedAccessor = SyntaxFactory.InvocationExpression(\n                        expression: SyntaxFactory.IdentifierName(property.AccessorName),\n                        argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Argument(\n                            expression: SyntaxFactory.MemberAccessExpression(\n                                SyntaxKind.SimpleMemberAccessExpression,\n                                expression: SyntaxFactory.ThisExpression(),\n                                name: SyntaxFactory.IdentifierName(\"WrappedOperation\"))))));\n                }\n                else\n                {\n                    evaluatedAccessor = SyntaxFactory.MemberAccessExpression(\n                        SyntaxKind.SimpleMemberAccessExpression,\n                        expression: SyntaxFactory.MemberAccessExpression(\n                            SyntaxKind.SimpleMemberAccessExpression,\n                            expression: SyntaxFactory.ThisExpression(),\n                            name: SyntaxFactory.IdentifierName(\"WrappedOperation\")),\n                        name: SyntaxFactory.IdentifierName(property.Name));\n                }\n\n                ExpressionSyntax convertedResult;\n                if (property.NeedsWrapper)\n                {\n                    // IObjectOrCollectionInitializerOperationWrapper.FromOperation(...)\n                    convertedResult = SyntaxFactory.InvocationExpression(\n                        expression: SyntaxFactory.MemberAccessExpression(\n                            SyntaxKind.SimpleMemberAccessExpression,\n                            expression: propertyType,\n                            name: SyntaxFactory.IdentifierName(\"FromOperation\")),\n                        argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Argument(evaluatedAccessor))));\n                }\n                else\n                {\n                    convertedResult = evaluatedAccessor;\n                }\n\n                // public IMethodSymbol Constructor => ConstructorAccessor(this.WrappedOperation);\n                members = members.Add(SyntaxFactory.PropertyDeclaration(\n                    attributeLists: default,\n                    modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PublicKeyword)),\n                    type: propertyType,\n                    explicitInterfaceSpecifier: null,\n                    identifier: SyntaxFactory.Identifier(property.Name),\n                    accessorList: null,\n                    expressionBody: SyntaxFactory.ArrowExpressionClause(convertedResult),\n                    initializer: null,\n                    semicolonToken: SyntaxFactory.Token(SyntaxKind.SemicolonToken)));\n            }\n\n            foreach (var baseDefinition in node.InheritedInterfaces)\n            {\n                // For now, don't inherit properties from IOperationWrapper\n                var inheritedProperties = baseDefinition.InterfaceName != \"IOperation\" ? baseDefinition.Properties : ImmutableArray<PropertyData>.Empty;\n                foreach (var property in inheritedProperties)\n                {\n                    if (node.Properties.Any(derivedProperty => derivedProperty.Name == property.Name && derivedProperty.IsNew))\n                    {\n                        continue;\n                    }\n\n                    if (!property.IsPublicProperty)\n                    {\n                        continue;\n                    }\n\n                    var propertyType = property.IsSkipped\n                        ? SyntaxFactory.PredefinedType(SyntaxFactory.Token(SyntaxKind.ObjectKeyword))\n                        : property.NeedsWrapper ? SyntaxFactory.IdentifierName(property.WrappedType) : property.AccessorResultType; // Sonar\n\n                    // public IOperation Instance => ((IMemberReferenceOperationWrapper)this).Instance;\n                    members = members.Add(SyntaxFactory.PropertyDeclaration(\n                        attributeLists: default,\n                        modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PublicKeyword)),\n                        type: propertyType,\n                        explicitInterfaceSpecifier: null,\n                        identifier: SyntaxFactory.Identifier(property.Name),\n                        accessorList: null,\n                        expressionBody: SyntaxFactory.ArrowExpressionClause(SyntaxFactory.MemberAccessExpression(\n                            SyntaxKind.SimpleMemberAccessExpression,\n                            expression: SyntaxFactory.ParenthesizedExpression(SyntaxFactory.CastExpression(\n                                type: SyntaxFactory.IdentifierName(baseDefinition.WrapperName),\n                                expression: SyntaxFactory.ThisExpression())),\n                            name: SyntaxFactory.IdentifierName(property.Name))),\n                        initializer: null,\n                        semicolonToken: SyntaxFactory.Token(SyntaxKind.SemicolonToken)));\n                }\n\n                // public static explicit operator IFieldReferenceOperationWrapper(IMemberReferenceOperationWrapper wrapper)\n                //     => FromOperation(wrapper.WrappedOperation);\n                members = members.Add(SyntaxFactory.ConversionOperatorDeclaration(\n                    attributeLists: default,\n                    modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PublicKeyword), SyntaxFactory.Token(SyntaxKind.StaticKeyword)),\n                    implicitOrExplicitKeyword: SyntaxFactory.Token(SyntaxKind.ExplicitKeyword),\n                    operatorKeyword: SyntaxFactory.Token(SyntaxKind.OperatorKeyword),\n                    type: SyntaxFactory.IdentifierName(node.WrapperName),\n                    parameterList: SyntaxFactory.ParameterList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Parameter(\n                        attributeLists: default,\n                        modifiers: default,\n                        type: SyntaxFactory.IdentifierName(baseDefinition.WrapperName),\n                        identifier: SyntaxFactory.Identifier(\"wrapper\"),\n                        @default: null))),\n                    body: null,\n                    expressionBody: SyntaxFactory.ArrowExpressionClause(SyntaxFactory.InvocationExpression(\n                        expression: SyntaxFactory.IdentifierName(\"FromOperation\"),\n                        argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Argument(\n                            SyntaxFactory.MemberAccessExpression(\n                                SyntaxKind.SimpleMemberAccessExpression,\n                                expression: SyntaxFactory.IdentifierName(\"wrapper\"),\n                                name: SyntaxFactory.IdentifierName(\"WrappedOperation\"))))))),\n                    semicolonToken: SyntaxFactory.Token(SyntaxKind.SemicolonToken)));\n\n                // public static implicit operator IMemberReferenceOperationWrapper(IFieldReferenceOperationWrapper wrapper)\n                //     => IMemberReferenceOperationWrapper.FromUpcast(wrapper.WrappedOperation);\n                members = members.Add(SyntaxFactory.ConversionOperatorDeclaration(\n                    attributeLists: default,\n                    modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PublicKeyword), SyntaxFactory.Token(SyntaxKind.StaticKeyword)),\n                    implicitOrExplicitKeyword: SyntaxFactory.Token(SyntaxKind.ImplicitKeyword),\n                    operatorKeyword: SyntaxFactory.Token(SyntaxKind.OperatorKeyword),\n                    type: SyntaxFactory.IdentifierName(baseDefinition.WrapperName),\n                    parameterList: SyntaxFactory.ParameterList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Parameter(\n                        attributeLists: default,\n                        modifiers: default,\n                        type: SyntaxFactory.IdentifierName(node.WrapperName),\n                        identifier: SyntaxFactory.Identifier(\"wrapper\"),\n                        @default: null))),\n                    body: null,\n                    expressionBody: SyntaxFactory.ArrowExpressionClause(SyntaxFactory.InvocationExpression(\n                        expression: SyntaxFactory.MemberAccessExpression(\n                            SyntaxKind.SimpleMemberAccessExpression,\n                            expression: SyntaxFactory.IdentifierName(baseDefinition.WrapperName),\n                            name: SyntaxFactory.IdentifierName(\"FromUpcast\")),\n                        argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Argument(\n                            SyntaxFactory.MemberAccessExpression(\n                                SyntaxKind.SimpleMemberAccessExpression,\n                                expression: SyntaxFactory.IdentifierName(\"wrapper\"),\n                                name: SyntaxFactory.IdentifierName(\"WrappedOperation\"))))))),\n                    semicolonToken: SyntaxFactory.Token(SyntaxKind.SemicolonToken)));\n            }\n\n            // public static IArgumentOperationWrapper FromOperation(IOperation operation)\n            // {\n            //     if (operation == null)\n            //     {\n            //         return default;\n            //     }\n            //\n            //     if (!IsInstance(operation))\n            //     {\n            //         throw new InvalidCastException($\"Cannot cast '{operation.GetType().FullName}' to '{WrappedTypeName}'\");\n            //     }\n            //\n            //     return new IArgumentOperationWrapper(operation);\n            // }\n            var fromOperationStatements = new List<StatementSyntax>();\n            fromOperationStatements.Add(SyntaxFactory.IfStatement(\n                condition: SyntaxFactory.BinaryExpression(\n                    SyntaxKind.EqualsExpression,\n                    left: SyntaxFactory.IdentifierName(\"operation\"),\n                    right: SyntaxFactory.LiteralExpression(SyntaxKind.NullLiteralExpression)),\n                statement: SyntaxFactory.Block(\n                    SyntaxFactory.ReturnStatement(SyntaxFactory.LiteralExpression(SyntaxKind.DefaultLiteralExpression)))));\n\n            if (node.InterfaceName != \"IOperation\")\n            {\n                fromOperationStatements.Add(SyntaxFactory.IfStatement(\n                    condition: SyntaxFactory.PrefixUnaryExpression(\n                        SyntaxKind.LogicalNotExpression,\n                        operand: SyntaxFactory.InvocationExpression(\n                            expression: SyntaxFactory.IdentifierName(\"IsInstance\"),\n                            argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Argument(SyntaxFactory.IdentifierName(\"operation\")))))),\n                    statement: SyntaxFactory.Block(\n                        SyntaxFactory.ThrowStatement(SyntaxFactory.ObjectCreationExpression(\n                            type: SyntaxFactory.IdentifierName(\"InvalidCastException\"),\n                            argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Argument(\n                                SyntaxFactory.InterpolatedStringExpression(\n                                    SyntaxFactory.Token(SyntaxKind.InterpolatedStringStartToken),\n                                    SyntaxFactory.List(new InterpolatedStringContentSyntax[]\n                                    {\n                                        SyntaxFactory.InterpolatedStringText(SyntaxFactory.Token(\n                                            leading: default,\n                                            SyntaxKind.InterpolatedStringTextToken,\n                                            \"Cannot cast '\",\n                                            \"Cannot cast '\",\n                                            trailing: default)),\n                                        SyntaxFactory.Interpolation(SyntaxFactory.MemberAccessExpression(\n                                            SyntaxKind.SimpleMemberAccessExpression,\n                                            expression: SyntaxFactory.InvocationExpression(\n                                                expression: SyntaxFactory.MemberAccessExpression(\n                                                    SyntaxKind.SimpleMemberAccessExpression,\n                                                    expression: SyntaxFactory.IdentifierName(\"operation\"),\n                                                    name: SyntaxFactory.IdentifierName(\"GetType\")),\n                                                argumentList: SyntaxFactory.ArgumentList()),\n                                            name: SyntaxFactory.IdentifierName(\"FullName\"))),\n                                        SyntaxFactory.InterpolatedStringText(SyntaxFactory.Token(\n                                            leading: default,\n                                            SyntaxKind.InterpolatedStringTextToken,\n                                            \"' to '\",\n                                            \"' to '\",\n                                            trailing: default)),\n                                        SyntaxFactory.Interpolation(SyntaxFactory.IdentifierName(\"WrappedTypeName\")),\n                                        SyntaxFactory.InterpolatedStringText(SyntaxFactory.Token(\n                                            leading: default,\n                                            SyntaxKind.InterpolatedStringTextToken,\n                                            \"'\",\n                                            \"'\",\n                                            trailing: default)),\n                                    }))))),\n                            initializer: null)))));\n            }\n\n            fromOperationStatements.Add(SyntaxFactory.ReturnStatement(SyntaxFactory.ObjectCreationExpression(\n                type: SyntaxFactory.IdentifierName(node.WrapperName),\n                argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Argument(SyntaxFactory.IdentifierName(\"operation\")))),\n                initializer: null)));\n\n            members = members.Add(SyntaxFactory.MethodDeclaration(\n                attributeLists: default,\n                modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PublicKeyword), SyntaxFactory.Token(SyntaxKind.StaticKeyword)),\n                returnType: SyntaxFactory.IdentifierName(node.WrapperName),\n                explicitInterfaceSpecifier: null,\n                identifier: SyntaxFactory.Identifier(\"FromOperation\"),\n                typeParameterList: null,\n                parameterList: SyntaxFactory.ParameterList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Parameter(\n                    attributeLists: default,\n                    modifiers: default,\n                    type: SyntaxFactory.IdentifierName(\"IOperation\"),\n                    identifier: SyntaxFactory.Identifier(\"operation\"),\n                    @default: null))),\n                constraintClauses: default,\n                body: SyntaxFactory.Block(fromOperationStatements),\n                expressionBody: null));\n\n            // public static bool IsInstance(IOperation operation)\n            // {\n            //     return operation != null && LightupHelpers.CanWrapOperation(operation, WrappedType);\n            // }\n            ExpressionSyntax isInstanceExpression = SyntaxFactory.BinaryExpression(\n                SyntaxKind.NotEqualsExpression,\n                left: SyntaxFactory.IdentifierName(\"operation\"),\n                right: SyntaxFactory.LiteralExpression(SyntaxKind.NullLiteralExpression));\n            if (node.InterfaceName != \"IOperation\")\n            {\n                isInstanceExpression = SyntaxFactory.BinaryExpression(\n                    SyntaxKind.LogicalAndExpression,\n                    left: isInstanceExpression,\n                    right: SyntaxFactory.InvocationExpression(\n                        expression: SyntaxFactory.MemberAccessExpression(\n                            SyntaxKind.SimpleMemberAccessExpression,\n                            expression: SyntaxFactory.IdentifierName(\"LightupHelpers\"),\n                            name: SyntaxFactory.IdentifierName(\"CanWrapOperation\")),\n                        argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SeparatedList(\n                            new[]\n                            {\n                                SyntaxFactory.Argument(SyntaxFactory.IdentifierName(\"operation\")),\n                                SyntaxFactory.Argument(SyntaxFactory.IdentifierName(\"WrappedType\")),\n                            }))));\n            }\n\n            members = members.Add(SyntaxFactory.MethodDeclaration(\n                attributeLists: default,\n                modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PublicKeyword), SyntaxFactory.Token(SyntaxKind.StaticKeyword)),\n                returnType: SyntaxFactory.PredefinedType(SyntaxFactory.Token(SyntaxKind.BoolKeyword)),\n                explicitInterfaceSpecifier: null,\n                identifier: SyntaxFactory.Identifier(\"IsInstance\"),\n                typeParameterList: null,\n                parameterList: SyntaxFactory.ParameterList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Parameter(\n                    attributeLists: default,\n                    modifiers: default,\n                    type: SyntaxFactory.IdentifierName(\"IOperation\"),\n                    identifier: SyntaxFactory.Identifier(\"operation\"),\n                    @default: null))),\n                constraintClauses: default,\n                body: SyntaxFactory.Block(SyntaxFactory.ReturnStatement(isInstanceExpression)),\n                expressionBody: null));\n\n            if (node.IsAbstract)\n            {\n                // internal static IMemberReferenceOperationWrapper FromUpcast(IOperation operation)\n                // {\n                //     return new IMemberReferenceOperationWrapper(operation);\n                // }\n                members = members.Add(SyntaxFactory.MethodDeclaration(\n                    attributeLists: default,\n                    modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PublicKeyword), SyntaxFactory.Token(SyntaxKind.StaticKeyword)), // Sonar\n                    returnType: SyntaxFactory.IdentifierName(node.WrapperName),\n                    explicitInterfaceSpecifier: null,\n                    identifier: SyntaxFactory.Identifier(\"FromUpcast\"),\n                    typeParameterList: null,\n                    parameterList: SyntaxFactory.ParameterList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Parameter(\n                        attributeLists: default,\n                        modifiers: default,\n                        type: SyntaxFactory.IdentifierName(\"IOperation\"),\n                        identifier: SyntaxFactory.Identifier(\"operation\"),\n                        @default: null))),\n                    constraintClauses: default,\n                    body: SyntaxFactory.Block(\n                        SyntaxFactory.ReturnStatement(SyntaxFactory.ObjectCreationExpression(\n                            type: SyntaxFactory.IdentifierName(node.WrapperName),\n                            argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Argument(SyntaxFactory.IdentifierName(\"operation\")))),\n                            initializer: null))),\n                    expressionBody: null));\n            }\n\n            var wrapperStruct = SyntaxFactory.StructDeclaration(\n                attributeLists: default,\n                modifiers: SyntaxTokenList.Create(SyntaxFactory.Token(SyntaxKind.PublicKeyword)).Add(SyntaxFactory.Token(SyntaxKind.ReadOnlyKeyword)), // Sonar\n                identifier: SyntaxFactory.Identifier(node.WrapperName),\n                typeParameterList: null,\n                baseList: SyntaxFactory.BaseList(SyntaxFactory.SingletonSeparatedList<BaseTypeSyntax>(SyntaxFactory.SimpleBaseType(SyntaxFactory.IdentifierName(\"IOperationWrapper\")))), // Sonar\n                constraintClauses: default,\n                members: members);\n\n            var usingDirectives = new List<UsingDirectiveSyntax>();\n            usingDirectives.Add(SyntaxFactory.UsingDirective(SyntaxFactory.ParseName(\"System\")));\n            if (node.InterfaceName == \"IOperation\")\n            {\n                usingDirectives.Add(SyntaxFactory.UsingDirective(SyntaxFactory.ParseName(\"System.Collections.Generic\")));\n            }\n\n            usingDirectives.Add(SyntaxFactory.UsingDirective(SyntaxFactory.ParseName(\"System.Collections.Immutable\")));\n            usingDirectives.Add(SyntaxFactory.UsingDirective(SyntaxFactory.ParseName(\"Microsoft.CodeAnalysis\")));\n\n            var wrapperNamespace = SyntaxFactory.NamespaceDeclaration(\n                name: SyntaxFactory.ParseName(\"StyleCop.Analyzers.Lightup\"),\n                externs: default,\n                usings: SyntaxFactory.List(usingDirectives),\n                members: SyntaxFactory.SingletonList<MemberDeclarationSyntax>(wrapperStruct));\n\n            wrapperNamespace = wrapperNamespace\n                .NormalizeWhitespace()\n                .WithLeadingTrivia(\n                    SyntaxFactory.Comment(\"// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.\"),\n                    SyntaxFactory.CarriageReturnLineFeed,\n                    SyntaxFactory.Comment(\"// Licensed under the MIT License. See LICENSE in the project root for license information.\"),\n                    SyntaxFactory.CarriageReturnLineFeed,\n                    SyntaxFactory.CarriageReturnLineFeed)\n                .WithTrailingTrivia(\n                    SyntaxFactory.CarriageReturnLineFeed);\n\n            context.AddSource(node.WrapperName + \".g.cs\", wrapperNamespace.GetText(Encoding.UTF8));\n        }\n\n        private void GenerateOperationWrapperHelper(in SourceProductionContext context, ImmutableArray<InterfaceData> wrapperTypes)\n        {\n            // private static readonly ImmutableDictionary<Type, Type> WrappedTypes;\n            var wrappedTypes = SyntaxFactory.FieldDeclaration(\n                attributeLists: default,\n                modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PrivateKeyword), SyntaxFactory.Token(SyntaxKind.StaticKeyword), SyntaxFactory.Token(SyntaxKind.ReadOnlyKeyword)),\n                declaration: SyntaxFactory.VariableDeclaration(\n                    type: SyntaxFactory.GenericName(\n                        identifier: SyntaxFactory.Identifier(\"ImmutableDictionary\"),\n                        typeArgumentList: SyntaxFactory.TypeArgumentList(\n                            SyntaxFactory.SeparatedList<TypeSyntax>(\n                                new[]\n                                {\n                                    SyntaxFactory.IdentifierName(\"Type\"),\n                                    SyntaxFactory.IdentifierName(\"Type\"),\n                                }))),\n                    variables: SyntaxFactory.SingletonSeparatedList(SyntaxFactory.VariableDeclarator(SyntaxFactory.Identifier(\"WrappedTypes\")))));\n\n            // var codeAnalysisAssembly = typeof(SyntaxNode).GetTypeInfo().Assembly;\n            // var builder = ImmutableDictionary.CreateBuilder<Type, Type>();\n            var staticCtorStatements = SyntaxFactory.List<StatementSyntax>()\n                .Add(SyntaxFactory.LocalDeclarationStatement(SyntaxFactory.VariableDeclaration(\n                    type: SyntaxFactory.IdentifierName(\"var\"),\n                    variables: SyntaxFactory.SingletonSeparatedList(SyntaxFactory.VariableDeclarator(\n                        identifier: SyntaxFactory.Identifier(\"codeAnalysisAssembly\"),\n                        argumentList: null,\n                        initializer: SyntaxFactory.EqualsValueClause(\n                            SyntaxFactory.MemberAccessExpression(\n                                SyntaxKind.SimpleMemberAccessExpression,\n                                expression: SyntaxFactory.InvocationExpression(\n                                    SyntaxFactory.MemberAccessExpression(\n                                        SyntaxKind.SimpleMemberAccessExpression,\n                                        expression: SyntaxFactory.TypeOfExpression(SyntaxFactory.IdentifierName(\"SyntaxNode\")),\n                                        name: SyntaxFactory.IdentifierName(\"GetTypeInfo\"))),\n                                name: SyntaxFactory.IdentifierName(\"Assembly\"))))))))\n                .Add(SyntaxFactory.LocalDeclarationStatement(SyntaxFactory.VariableDeclaration(\n                    type: SyntaxFactory.IdentifierName(\"var\"),\n                    variables: SyntaxFactory.SingletonSeparatedList(SyntaxFactory.VariableDeclarator(\n                        identifier: SyntaxFactory.Identifier(\"builder\"),\n                        argumentList: null,\n                        initializer: SyntaxFactory.EqualsValueClause(\n                            SyntaxFactory.InvocationExpression(\n                                SyntaxFactory.MemberAccessExpression(\n                                    SyntaxKind.SimpleMemberAccessExpression,\n                                    expression: SyntaxFactory.IdentifierName(\"ImmutableDictionary\"),\n                                    name: SyntaxFactory.GenericName(\n                                        identifier: SyntaxFactory.Identifier(\"CreateBuilder\"),\n                                        typeArgumentList: SyntaxFactory.TypeArgumentList(\n                                            SyntaxFactory.SeparatedList<TypeSyntax>(\n                                                new[]\n                                                {\n                                                    SyntaxFactory.IdentifierName(\"Type\"),\n                                                    SyntaxFactory.IdentifierName(\"Type\"),\n                                                })))))))))));\n\n            foreach (var node in wrapperTypes)\n            {\n                // For the base IOperation node:\n                //   builder.Add(typeof(IArgumentOperationWrapper), typeof(IOperation));\n                //\n                // For all other nodes:\n                //   builder.Add(typeof(IArgumentOperationWrapper), codeAnalysisAssembly.GetType(IArgumentOperationWrapper.WrappedTypeName));\n                ArgumentSyntax typeArgument;\n                if (node.InterfaceName == \"IOperation\")\n                {\n                    typeArgument = SyntaxFactory.Argument(SyntaxFactory.TypeOfExpression(SyntaxFactory.IdentifierName(\"IOperation\")));\n                }\n                else\n                {\n                    typeArgument = SyntaxFactory.Argument(\n                        SyntaxFactory.InvocationExpression(\n                            expression: SyntaxFactory.MemberAccessExpression(\n                                SyntaxKind.SimpleMemberAccessExpression,\n                                expression: SyntaxFactory.IdentifierName(\"codeAnalysisAssembly\"),\n                                name: SyntaxFactory.IdentifierName(\"GetType\")),\n                            argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Argument(\n                                SyntaxFactory.MemberAccessExpression(\n                                    SyntaxKind.SimpleMemberAccessExpression,\n                                    expression: SyntaxFactory.IdentifierName(node.WrapperName),\n                                    name: SyntaxFactory.IdentifierName(\"WrappedTypeName\")))))));\n                }\n\n                staticCtorStatements = staticCtorStatements.Add(SyntaxFactory.ExpressionStatement(\n                    SyntaxFactory.InvocationExpression(\n                        expression: SyntaxFactory.MemberAccessExpression(\n                            SyntaxKind.SimpleMemberAccessExpression,\n                            expression: SyntaxFactory.IdentifierName(\"builder\"),\n                            name: SyntaxFactory.IdentifierName(\"Add\")),\n                        argumentList: SyntaxFactory.ArgumentList(\n                            SyntaxFactory.SeparatedList(\n                                new[]\n                                {\n                                    SyntaxFactory.Argument(SyntaxFactory.TypeOfExpression(SyntaxFactory.IdentifierName(node.WrapperName))),\n                                    typeArgument,\n                                })))));\n            }\n\n            // WrappedTypes = builder.ToImmutable();\n            staticCtorStatements = staticCtorStatements.Add(SyntaxFactory.ExpressionStatement(\n                SyntaxFactory.AssignmentExpression(\n                    SyntaxKind.SimpleAssignmentExpression,\n                    left: SyntaxFactory.IdentifierName(\"WrappedTypes\"),\n                    right: SyntaxFactory.InvocationExpression(\n                        SyntaxFactory.MemberAccessExpression(\n                            SyntaxKind.SimpleMemberAccessExpression,\n                            expression: SyntaxFactory.IdentifierName(\"builder\"),\n                            name: SyntaxFactory.IdentifierName(\"ToImmutable\"))))));\n\n            var staticCtor = SyntaxFactory.ConstructorDeclaration(\n                attributeLists: default,\n                modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.StaticKeyword)),\n                identifier: SyntaxFactory.Identifier(\"OperationWrapperHelper\"),\n                parameterList: SyntaxFactory.ParameterList(),\n                initializer: null,\n                body: SyntaxFactory.Block(staticCtorStatements),\n                expressionBody: null);\n\n            // /// <summary>\n            // /// Gets the type that is wrapped by the given wrapper.\n            // /// </summary>\n            // /// <param name=\"wrapperType\">Type of the wrapper for which the wrapped type should be retrieved.</param>\n            // /// <returns>The wrapped type, or null if there is no info.</returns>\n            // internal static Type GetWrappedType(Type wrapperType)\n            // {\n            //     if (WrappedTypes.TryGetValue(wrapperType, out Type wrappedType))\n            //     {\n            //         return wrappedType;\n            //     }\n            //\n            //     return null;\n            // }\n            var getWrappedType = SyntaxFactory.MethodDeclaration(\n                attributeLists: default,\n                modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PublicKeyword), SyntaxFactory.Token(SyntaxKind.StaticKeyword)), // Sonar\n                returnType: SyntaxFactory.IdentifierName(\"Type\"),\n                explicitInterfaceSpecifier: null,\n                identifier: SyntaxFactory.Identifier(\"GetWrappedType\"),\n                typeParameterList: null,\n                parameterList: SyntaxFactory.ParameterList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Parameter(\n                    attributeLists: default,\n                    modifiers: default,\n                    type: SyntaxFactory.IdentifierName(\"Type\"),\n                    identifier: SyntaxFactory.Identifier(\"wrapperType\"),\n                    @default: null))),\n                constraintClauses: default,\n                body: SyntaxFactory.Block(\n                    SyntaxFactory.IfStatement(\n                        condition: SyntaxFactory.InvocationExpression(\n                            expression: SyntaxFactory.MemberAccessExpression(\n                                SyntaxKind.SimpleMemberAccessExpression,\n                                expression: SyntaxFactory.IdentifierName(\"WrappedTypes\"),\n                                name: SyntaxFactory.IdentifierName(\"TryGetValue\")),\n                            argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SeparatedList(\n                                new[]\n                                {\n                                    SyntaxFactory.Argument(SyntaxFactory.IdentifierName(\"wrapperType\")),\n                                    SyntaxFactory.Argument(\n                                        nameColon: null,\n                                        refKindKeyword: SyntaxFactory.Token(SyntaxKind.OutKeyword),\n                                        expression: SyntaxFactory.DeclarationExpression(\n                                            type: SyntaxFactory.IdentifierName(\"Type\"),\n                                            designation: SyntaxFactory.SingleVariableDesignation(SyntaxFactory.Identifier(\"wrappedType\")))),\n                                }))),\n                        statement: SyntaxFactory.Block(\n                            SyntaxFactory.ReturnStatement(SyntaxFactory.IdentifierName(\"wrappedType\")))),\n                    SyntaxFactory.ReturnStatement(SyntaxFactory.LiteralExpression(SyntaxKind.NullLiteralExpression))),\n                expressionBody: null);\n\n            getWrappedType = getWrappedType.WithLeadingTrivia(SyntaxFactory.TriviaList(\n                SyntaxFactory.Trivia(SyntaxFactory.DocumentationComment(\n                    SyntaxFactory.XmlText(\" \"),\n                    SyntaxFactory.XmlSummaryElement(\n                        SyntaxFactory.XmlText(XmlSyntaxFactory.XmlCarriageReturnLineFeedWithContinuation),\n                        SyntaxFactory.XmlText(\" Gets the type that is wrapped by the given wrapper.\"),\n                        SyntaxFactory.XmlText(XmlSyntaxFactory.XmlCarriageReturnLineFeedWithContinuation),\n                        SyntaxFactory.XmlText(\" \")),\n                    SyntaxFactory.XmlText(XmlSyntaxFactory.XmlCarriageReturnLineFeedWithContinuation),\n                    SyntaxFactory.XmlText(\" \"),\n                    SyntaxFactory.XmlParamElement(\n                        \"wrapperType\",\n                        SyntaxFactory.XmlText(\"Type of the wrapper for which the wrapped type should be retrieved.\")),\n                    SyntaxFactory.XmlText(XmlSyntaxFactory.XmlCarriageReturnLineFeedWithContinuation),\n                    SyntaxFactory.XmlText(\" \"),\n                    SyntaxFactory.XmlReturnsElement(\n                        SyntaxFactory.XmlText(\"The wrapped type, or null if there is no info.\")),\n                    SyntaxFactory.XmlText(XmlSyntaxFactory.XmlCarriageReturnLineFeedWithContinuation).WithoutTrailingTrivia()))));\n\n            var wrapperHelperClass = SyntaxFactory.ClassDeclaration(\n                attributeLists: default,\n                modifiers: SyntaxTokenList.Create(SyntaxFactory.Token(SyntaxKind.PublicKeyword)).Add(SyntaxFactory.Token(SyntaxKind.StaticKeyword)), // Sonar\n                identifier: SyntaxFactory.Identifier(\"OperationWrapperHelper\"),\n                typeParameterList: null,\n                baseList: null,\n                constraintClauses: default,\n                members: SyntaxFactory.List<MemberDeclarationSyntax>()\n                    .Add(wrappedTypes)\n                    .Add(staticCtor)\n                    .Add(getWrappedType));\n            var wrapperNamespace = SyntaxFactory.NamespaceDeclaration(\n                name: SyntaxFactory.ParseName(\"StyleCop.Analyzers.Lightup\"),\n                externs: default,\n                usings: SyntaxFactory.List<UsingDirectiveSyntax>()\n                    .Add(SyntaxFactory.UsingDirective(SyntaxFactory.ParseName(\"System\")))\n                    .Add(SyntaxFactory.UsingDirective(SyntaxFactory.ParseName(\"System.Collections.Immutable\")))\n                    .Add(SyntaxFactory.UsingDirective(SyntaxFactory.ParseName(\"System.Reflection\")))\n                    .Add(SyntaxFactory.UsingDirective(SyntaxFactory.ParseName(\"Microsoft.CodeAnalysis\"))),\n                members: SyntaxFactory.SingletonList<MemberDeclarationSyntax>(wrapperHelperClass));\n\n            wrapperNamespace = wrapperNamespace\n                .NormalizeWhitespace()\n                .WithLeadingTrivia(\n                    SyntaxFactory.Comment(\"// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.\"),\n                    SyntaxFactory.CarriageReturnLineFeed,\n                    SyntaxFactory.Comment(\"// Licensed under the MIT License. See LICENSE in the project root for license information.\"),\n                    SyntaxFactory.CarriageReturnLineFeed,\n                    SyntaxFactory.CarriageReturnLineFeed)\n                .WithTrailingTrivia(\n                    SyntaxFactory.CarriageReturnLineFeed);\n\n            context.AddSource(\"OperationWrapperHelper.g.cs\", wrapperNamespace.GetText(Encoding.UTF8));\n        }\n\n        private void GenerateOperationKindEx(in SourceProductionContext context, ImmutableArray<InterfaceData> wrapperTypes)\n        {\n            var operationKinds = wrapperTypes\n                .SelectMany(type => type.OperationKinds)\n                .OrderBy(kind => kind.value)\n                .ToImmutableArray();\n\n            var members = SyntaxFactory.List<MemberDeclarationSyntax>();\n            foreach (var operationKind in operationKinds)\n            {\n                // public const OperationKind FieldReference = (OperationKind)26;\n                members = members.Add(SyntaxFactory.FieldDeclaration(\n                    attributeLists: default,\n                    modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PublicKeyword), SyntaxFactory.Token(SyntaxKind.ConstKeyword)),\n                    declaration: SyntaxFactory.VariableDeclaration(\n                        type: SyntaxFactory.IdentifierName(\"OperationKind\"),\n                        variables: SyntaxFactory.SingletonSeparatedList(SyntaxFactory.VariableDeclarator(\n                            identifier: SyntaxFactory.Identifier(operationKind.name),\n                            argumentList: null,\n                            initializer: SyntaxFactory.EqualsValueClause(SyntaxFactory.CastExpression(\n                                type: SyntaxFactory.IdentifierName(\"OperationKind\"),\n                                expression: SyntaxFactory.LiteralExpression(SyntaxKind.NumericLiteralExpression, SyntaxFactory.Literal($\"0x{operationKind.value:x}\", operationKind.value)))))))));\n            }\n\n            var operationKindExClass = SyntaxFactory.ClassDeclaration(\n                attributeLists: default,\n                modifiers: SyntaxTokenList.Create(SyntaxFactory.Token(SyntaxKind.PublicKeyword)).Add(SyntaxFactory.Token(SyntaxKind.StaticKeyword)), // Sonar\n                identifier: SyntaxFactory.Identifier(\"OperationKindEx\"),\n                typeParameterList: null,\n                baseList: null,\n                constraintClauses: default,\n                members: members);\n            var wrapperNamespace = SyntaxFactory.NamespaceDeclaration(\n                name: SyntaxFactory.ParseName(\"StyleCop.Analyzers.Lightup\"),\n                externs: default,\n                usings: SyntaxFactory.List<UsingDirectiveSyntax>()\n                    .Add(SyntaxFactory.UsingDirective(SyntaxFactory.ParseName(\"Microsoft.CodeAnalysis\"))),\n                members: SyntaxFactory.SingletonList<MemberDeclarationSyntax>(operationKindExClass));\n\n            wrapperNamespace = wrapperNamespace\n                .NormalizeWhitespace()\n                .WithLeadingTrivia(\n                    SyntaxFactory.Comment(\"// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.\"),\n                    SyntaxFactory.CarriageReturnLineFeed,\n                    SyntaxFactory.Comment(\"// Licensed under the MIT License. See LICENSE in the project root for license information.\"),\n                    SyntaxFactory.CarriageReturnLineFeed,\n                    SyntaxFactory.CarriageReturnLineFeed)\n                .WithTrailingTrivia(\n                    SyntaxFactory.CarriageReturnLineFeed);\n\n            context.AddSource(\"OperationKindEx.g.cs\", wrapperNamespace.GetText(Encoding.UTF8));\n        }\n\n        private sealed class DocumentData\n        {\n            public DocumentData(XDocument document)\n            {\n                var operationKinds = GetOperationKinds(document);\n\n                var interfaces = new Dictionary<string, InterfaceData>();\n                foreach (var node in document.XPathSelectElements(\"/Tree/AbstractNode\"))\n                {\n                    if (node.Attribute(\"Internal\")?.Value == \"true\")\n                    {\n                        continue;\n                    }\n\n                    if (!operationKinds.TryGetValue(node.RequiredAttribute(\"Name\").Value, out var kinds))\n                    {\n                        kinds = ImmutableArray<(string name, int value, string? extraDescription)>.Empty;\n                    }\n\n                    var interfaceData = new InterfaceData(this, node, kinds);\n                    interfaces.Add(interfaceData.InterfaceName, interfaceData);\n                }\n\n                foreach (var node in document.XPathSelectElements(\"/Tree/Node\"))\n                {\n                    if (node.Attribute(\"Internal\")?.Value == \"true\")\n                    {\n                        continue;\n                    }\n\n                    if (!operationKinds.TryGetValue(node.RequiredAttribute(\"Name\").Value, out var kinds))\n                    {\n                        kinds = ImmutableArray<(string name, int value, string? extraDescription)>.Empty;\n                    }\n\n                    var interfaceData = new InterfaceData(this, node, kinds);\n                    interfaces.Add(interfaceData.InterfaceName, interfaceData);\n                }\n\n                this.Interfaces = new ReadOnlyDictionary<string, InterfaceData>(interfaces);\n            }\n\n            public ReadOnlyDictionary<string, InterfaceData> Interfaces { get; }\n\n            private static ImmutableDictionary<string, ImmutableArray<(string name, int value, string? extraDescription)>> GetOperationKinds(XDocument document)\n            {\n                var skippedOperationKinds = GetSkippedOperationKinds(document);\n\n                var builder = ImmutableDictionary.CreateBuilder<string, ImmutableArray<(string name, int value, string? extraDescription)>>();\n\n                int operationKind = 0;\n                foreach (var node in document.XPathSelectElements(\"/Tree/AbstractNode|/Tree/Node\"))\n                {\n                    if (node.Attribute(\"Internal\")?.Value == \"true\")\n                    {\n                        continue;\n                    }\n\n                    if (node.XPathSelectElement(\"OperationKind\") is { } explicitKind)\n                    {\n                        if (node.Name == \"AbstractNode\" && explicitKind.Attribute(\"Include\")?.Value != \"true\")\n                        {\n                            continue;\n                        }\n                        else if (explicitKind.Attribute(\"Include\")?.Value == \"false\")\n                        {\n                            // The node is explicitly excluded\n                            continue;\n                        }\n                        else if (explicitKind.XPathSelectElements(\"Entry\").Any())\n                        {\n                            var nodeBuilder = ImmutableArray.CreateBuilder<(string name, int value, string? extraDescription)>();\n                            foreach (var entry in explicitKind.XPathSelectElements(\"Entry\"))\n                            {\n                                if (entry.Attribute(\"EditorBrowsable\")?.Value == \"false\")\n                                {\n                                    // Skip code generation for this operation kind\n                                    continue;\n                                }\n\n                                int parsedValue = ParsePrefixHexValue(entry.RequiredAttribute(\"Value\").Value);\n                                nodeBuilder.Add((entry.RequiredAttribute(\"Name\").Value, parsedValue, entry.Attribute(\"ExtraDescription\")?.Value));\n                            }\n\n                            builder.Add(node.RequiredAttribute(\"Name\").Value, nodeBuilder.ToImmutable());\n                            continue;\n                        }\n                    }\n                    else if (node.Name == \"AbstractNode\")\n                    {\n                        // Abstract nodes without explicit Include=\"true\" are skipped\n                        continue;\n                    }\n\n                    // Implicit operation kind\n                    operationKind++;\n                    while (skippedOperationKinds.Contains(operationKind))\n                    {\n                        operationKind++;\n                    }\n\n                    var nodeName = node.RequiredAttribute(\"Name\").Value;\n                    var kindName = nodeName.Substring(\"I\".Length, nodeName.Length - \"I\".Length - \"Operation\".Length);\n                    builder.Add(nodeName, ImmutableArray.Create((kindName, operationKind, (string?)null)));\n                }\n\n                return builder.ToImmutable();\n            }\n\n            private static ImmutableHashSet<int> GetSkippedOperationKinds(XDocument document)\n            {\n                var builder = ImmutableHashSet.CreateBuilder<int>();\n                foreach (var skippedKind in document.XPathSelectElements(\"/Tree/UnusedOperationKinds/Entry\"))\n                {\n                    builder.Add(ParsePrefixHexValue(skippedKind.RequiredAttribute(\"Value\").Value));\n                }\n\n                foreach (var explicitKind in document.XPathSelectElements(\"/Tree/*/OperationKind/Entry\"))\n                {\n                    builder.Add(ParsePrefixHexValue(explicitKind.RequiredAttribute(\"Value\").Value));\n                }\n\n                return builder.ToImmutable();\n            }\n\n            private static int ParsePrefixHexValue(string value)\n            {\n                if (!value.StartsWith(\"0x\"))\n                {\n                    throw new InvalidOperationException($\"Unexpected number format: '{value}'\");\n                }\n\n                return int.Parse(value.Substring(\"0x\".Length), NumberStyles.AllowHexSpecifier);\n            }\n        }\n\n        private sealed class InterfaceData\n        {\n            private readonly DocumentData documentData;\n\n            public InterfaceData(DocumentData documentData, XElement node, ImmutableArray<(string name, int value, string? extraDescription)> operationKinds)\n            {\n                this.documentData = documentData;\n\n                this.OperationKinds = operationKinds;\n                this.InterfaceName = node.RequiredAttribute(\"Name\").Value;\n\n                if (node.Attribute(\"Namespace\") is { } namespaceNode)\n                {\n                    if (namespaceNode.Value == string.Empty)\n                    {\n                        this.Namespace = \"Microsoft.CodeAnalysis\";\n                    }\n                    else\n                    {\n                        this.Namespace = $\"Microsoft.CodeAnalysis.{namespaceNode.Value}\";\n                    }\n                }\n                else\n                {\n                    this.Namespace = \"Microsoft.CodeAnalysis.Operations\";\n                }\n\n                this.Name = this.InterfaceName.Substring(\"I\".Length, this.InterfaceName.Length - \"I\".Length - \"Operation\".Length);\n                this.WrapperName = this.InterfaceName + \"Wrapper\";\n                this.BaseInterfaceName = node.Attribute(\"Base\")?.Value;\n                this.IsAbstract = node.Name == \"AbstractNode\";\n                this.Properties = node.XPathSelectElements(\"Property\").Select(property => new PropertyData(property)).ToImmutableArray();\n            }\n\n            public ImmutableArray<(string name, int value, string? extraDescription)> OperationKinds { get; }\n\n            public string InterfaceName { get; }\n\n            public string Namespace { get; }\n\n            public string Name { get; }\n\n            public string WrapperName { get; }\n\n            public string? BaseInterfaceName { get; }\n\n            public bool IsAbstract { get; }\n\n            public ImmutableArray<PropertyData> Properties { get; }\n\n            public InterfaceData? BaseInterface\n            {\n                get\n                {\n                    if (this.BaseInterfaceName is not null\n                        && this.documentData.Interfaces.TryGetValue(this.BaseInterfaceName, out var baseInterface))\n                    {\n                        return baseInterface;\n                    }\n\n                    return null;\n                }\n            }\n\n            public IEnumerable<InterfaceData> InheritedInterfaces\n            {\n                get\n                {\n                    var inheritedInterfaces = new List<InterfaceData>();\n                    for (var baseDefinition = this.BaseInterface; baseDefinition is not null; baseDefinition = baseDefinition.BaseInterface)\n                    {\n                        inheritedInterfaces.Add(baseDefinition);\n                    }\n\n                    inheritedInterfaces.Reverse();\n                    return inheritedInterfaces;\n                }\n            }\n        }\n\n        private sealed class PropertyData\n        {\n            public PropertyData(XElement node)\n            {\n                this.Name = node.RequiredAttribute(\"Name\").Value;\n                this.AccessorName = this.Name + \"Accessor\";\n                this.Type = node.RequiredAttribute(\"Type\").Value;\n                this.TypeNonNullable = Type.TrimEnd('?'); // Sonar - When comparing types as strings, the nullable suffix should be ignored.\n                this.WrappedType = TypeNonNullable + \"Wrapper\"; // Sonar\n\n                this.IsNew = node.Attribute(\"New\")?.Value == \"true\";\n                this.IsPublicProperty = node.Attribute(\"Internal\")?.Value != \"true\";\n                this.IsOverride = node.Attribute(\"Override\")?.Value == \"true\"; // Sonar\n\n                this.IsSkipped = this.TypeNonNullable switch // Sonar\n                {\n                    \"ArgumentKind\" => true,\n                    \"BranchKind\" => true,\n                    \"CaseKind\" => true,\n                    \"CommonConversion\" => true,\n                    \"ForEachLoopOperationInfo\" => true,\n                    \"IDiscardSymbol\" => true,\n                    \"InstanceReferenceKind\" => true,\n                    \"InterpolatedStringArgumentPlaceholderKind\" => true,    // Sonar: Skipped because it's not available\n                    \"LoopKind\" => true,\n                    \"PlaceholderKind\" => true,\n                    _ => !this.IsPublicProperty || this.IsOverride, // Sonar\n                };\n\n                this.NeedsAccessor = this.Name switch\n                {\n                    nameof(IOperation.Kind) => false,\n                    nameof(IOperation.Syntax) => false,\n                    nameof(IOperation.Type) => false,\n                    nameof(IOperation.ConstantValue) => false,\n                    _ => true,\n                };\n                this.NeedsWrapper = IsAnyOperation(TypeNonNullable) && TypeNonNullable != \"IOperation\"; // Sonar\n                this.IsDerivedOperationArray = IsAnyOperationArray(TypeNonNullable) && TypeNonNullable != \"ImmutableArray<IOperation>\"; // Sonar\n\n                if (this.IsDerivedOperationArray)\n                {\n                    this.AccessorResultType = SyntaxFactory.GenericName(\n                        identifier: SyntaxFactory.Identifier(\"ImmutableArray\"),\n                        typeArgumentList: SyntaxFactory.TypeArgumentList(SyntaxFactory.SingletonSeparatedList<TypeSyntax>(SyntaxFactory.IdentifierName(\"IOperation\"))));\n                }\n                else if (IsAnyOperation(TypeNonNullable)) // Sonar\n                {\n                    this.AccessorResultType = SyntaxFactory.IdentifierName(\"IOperation\");\n                }\n                else\n                {\n                    this.AccessorResultType = SyntaxFactory.ParseTypeName(this.Type);\n                }\n            }\n\n            public bool IsNew { get; }\n\n            public bool IsPublicProperty { get; }\n\n            public bool IsOverride { get; } // Added by Sonar. Usages are also by Sonar.\n\n            public bool IsSkipped { get; }\n\n            public string Name { get; }\n\n            public string AccessorName { get; }\n\n            public string Type { get; }\n\n            public bool NeedsAccessor { get; }\n\n            public string TypeNonNullable { get; } // Sonar\n\n            public string WrappedType { get; } // Sonar\n\n            public bool NeedsWrapper { get; }\n\n            public bool IsDerivedOperationArray { get; }\n\n            public TypeSyntax AccessorResultType { get; }\n\n            private static bool IsAnyOperation(string type)\n            {\n                return type.StartsWith(\"I\") && type.EndsWith(\"Operation\");\n            }\n\n            private static bool IsAnyOperationArray(string type)\n            {\n                return type.StartsWith(\"ImmutableArray<I\") && type.EndsWith(\"Operation>\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.CodeGeneration/RoslynHashCode.cs",
    "content": "﻿// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.\n// Licensed under the MIT License. See LICENSE in the project root for license information.\n// <auto-generated/>\n\n#nullable enable\n\n// NOTE: This code is derived from an implementation originally in dotnet/runtime:\n// https://github.com/dotnet/runtime/blob/v5.0.3/src/libraries/System.Private.CoreLib/src/System/HashCode.cs\n//\n// See the commentary in https://github.com/dotnet/roslyn/pull/50156 for notes on incorporating changes made to the\n// reference implementation.\n\n/*\n\nThe xxHash32 implementation is based on the code published by Yann Collet:\nhttps://raw.githubusercontent.com/Cyan4973/xxHash/5c174cfa4e45a42f94082dc0d4539b39696afea1/xxhash.c\n\n  xxHash - Fast Hash algorithm\n  Copyright (C) 2012-2016, Yann Collet\n\n  BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)\n\n  Redistribution and use in source and binary forms, with or without\n  modification, are permitted provided that the following conditions are\n  met:\n\n  * Redistributions of source code must retain the above copyright\n  notice, this list of conditions and the following disclaimer.\n  * Redistributions in binary form must reproduce the above\n  copyright notice, this list of conditions and the following disclaimer\n  in the documentation and/or other materials provided with the\n  distribution.\n\n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n  \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n  You can contact the author at :\n  - xxHash homepage: http://www.xxhash.com\n  - xxHash source repository : https://github.com/Cyan4973/xxHash\n\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Runtime.CompilerServices;\nusing System.Security.Cryptography;\n\nnamespace Analyzer.Utilities\n{\n    // xxHash32 is used for the hash code.\n    // https://github.com/Cyan4973/xxHash\n\n    [SuppressMessage(\"Design\", \"CA1066:Implement IEquatable when overriding Object.Equals\", Justification = \"This type is not equatable.\")]\n    [SuppressMessage(\"Performance\", \"CA1815:Override equals and operator equals on value types\", Justification = \"This type is not equatable.\")]\n    [SuppressMessage(\"Usage\", \"CA2231:Overload operator equals on overriding value type Equals\", Justification = \"This type is not equatable.\")]\n    internal struct RoslynHashCode\n    {\n        private static readonly uint s_seed = GenerateGlobalSeed();\n\n        private const uint Prime1 = 2654435761U;\n        private const uint Prime2 = 2246822519U;\n        private const uint Prime3 = 3266489917U;\n        private const uint Prime4 = 668265263U;\n        private const uint Prime5 = 374761393U;\n\n        private uint _v1, _v2, _v3, _v4;\n        private uint _queue1, _queue2, _queue3;\n        private uint _length;\n\n        private static uint GenerateGlobalSeed()\n        {\n            using var randomNumberGenerator = RandomNumberGenerator.Create();\n            var array = new byte[sizeof(uint)];\n            randomNumberGenerator.GetBytes(array);\n            return BitConverter.ToUInt32(array, 0);\n        }\n\n        public static int Combine<T1>(T1 value1)\n        {\n            // Provide a way of diffusing bits from something with a limited\n            // input hash space. For example, many enums only have a few\n            // possible hashes, only using the bottom few bits of the code. Some\n            // collections are built on the assumption that hashes are spread\n            // over a larger space, so diffusing the bits may help the\n            // collection work more efficiently.\n\n            var hc1 = (uint)(value1?.GetHashCode() ?? 0);\n\n            var hash = MixEmptyState();\n            hash += 4;\n\n            hash = QueueRound(hash, hc1);\n\n            hash = MixFinal(hash);\n            return (int)hash;\n        }\n\n        public static int Combine<T1, T2>(T1 value1, T2 value2)\n        {\n            var hc1 = (uint)(value1?.GetHashCode() ?? 0);\n            var hc2 = (uint)(value2?.GetHashCode() ?? 0);\n\n            var hash = MixEmptyState();\n            hash += 8;\n\n            hash = QueueRound(hash, hc1);\n            hash = QueueRound(hash, hc2);\n\n            hash = MixFinal(hash);\n            return (int)hash;\n        }\n\n        public static int Combine<T1, T2, T3>(T1 value1, T2 value2, T3 value3)\n        {\n            var hc1 = (uint)(value1?.GetHashCode() ?? 0);\n            var hc2 = (uint)(value2?.GetHashCode() ?? 0);\n            var hc3 = (uint)(value3?.GetHashCode() ?? 0);\n\n            var hash = MixEmptyState();\n            hash += 12;\n\n            hash = QueueRound(hash, hc1);\n            hash = QueueRound(hash, hc2);\n            hash = QueueRound(hash, hc3);\n\n            hash = MixFinal(hash);\n            return (int)hash;\n        }\n\n        public static int Combine<T1, T2, T3, T4>(T1 value1, T2 value2, T3 value3, T4 value4)\n        {\n            var hc1 = (uint)(value1?.GetHashCode() ?? 0);\n            var hc2 = (uint)(value2?.GetHashCode() ?? 0);\n            var hc3 = (uint)(value3?.GetHashCode() ?? 0);\n            var hc4 = (uint)(value4?.GetHashCode() ?? 0);\n\n            Initialize(out var v1, out var v2, out var v3, out var v4);\n\n            v1 = Round(v1, hc1);\n            v2 = Round(v2, hc2);\n            v3 = Round(v3, hc3);\n            v4 = Round(v4, hc4);\n\n            var hash = MixState(v1, v2, v3, v4);\n            hash += 16;\n\n            hash = MixFinal(hash);\n            return (int)hash;\n        }\n\n        public static int Combine<T1, T2, T3, T4, T5>(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5)\n        {\n            var hc1 = (uint)(value1?.GetHashCode() ?? 0);\n            var hc2 = (uint)(value2?.GetHashCode() ?? 0);\n            var hc3 = (uint)(value3?.GetHashCode() ?? 0);\n            var hc4 = (uint)(value4?.GetHashCode() ?? 0);\n            var hc5 = (uint)(value5?.GetHashCode() ?? 0);\n\n            Initialize(out var v1, out var v2, out var v3, out var v4);\n\n            v1 = Round(v1, hc1);\n            v2 = Round(v2, hc2);\n            v3 = Round(v3, hc3);\n            v4 = Round(v4, hc4);\n\n            var hash = MixState(v1, v2, v3, v4);\n            hash += 20;\n\n            hash = QueueRound(hash, hc5);\n\n            hash = MixFinal(hash);\n            return (int)hash;\n        }\n\n        public static int Combine<T1, T2, T3, T4, T5, T6>(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6)\n        {\n            var hc1 = (uint)(value1?.GetHashCode() ?? 0);\n            var hc2 = (uint)(value2?.GetHashCode() ?? 0);\n            var hc3 = (uint)(value3?.GetHashCode() ?? 0);\n            var hc4 = (uint)(value4?.GetHashCode() ?? 0);\n            var hc5 = (uint)(value5?.GetHashCode() ?? 0);\n            var hc6 = (uint)(value6?.GetHashCode() ?? 0);\n\n            Initialize(out var v1, out var v2, out var v3, out var v4);\n\n            v1 = Round(v1, hc1);\n            v2 = Round(v2, hc2);\n            v3 = Round(v3, hc3);\n            v4 = Round(v4, hc4);\n\n            var hash = MixState(v1, v2, v3, v4);\n            hash += 24;\n\n            hash = QueueRound(hash, hc5);\n            hash = QueueRound(hash, hc6);\n\n            hash = MixFinal(hash);\n            return (int)hash;\n        }\n\n        public static int Combine<T1, T2, T3, T4, T5, T6, T7>(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7)\n        {\n            var hc1 = (uint)(value1?.GetHashCode() ?? 0);\n            var hc2 = (uint)(value2?.GetHashCode() ?? 0);\n            var hc3 = (uint)(value3?.GetHashCode() ?? 0);\n            var hc4 = (uint)(value4?.GetHashCode() ?? 0);\n            var hc5 = (uint)(value5?.GetHashCode() ?? 0);\n            var hc6 = (uint)(value6?.GetHashCode() ?? 0);\n            var hc7 = (uint)(value7?.GetHashCode() ?? 0);\n\n            Initialize(out var v1, out var v2, out var v3, out var v4);\n\n            v1 = Round(v1, hc1);\n            v2 = Round(v2, hc2);\n            v3 = Round(v3, hc3);\n            v4 = Round(v4, hc4);\n\n            var hash = MixState(v1, v2, v3, v4);\n            hash += 28;\n\n            hash = QueueRound(hash, hc5);\n            hash = QueueRound(hash, hc6);\n            hash = QueueRound(hash, hc7);\n\n            hash = MixFinal(hash);\n            return (int)hash;\n        }\n\n        public static int Combine<T1, T2, T3, T4, T5, T6, T7, T8>(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8)\n        {\n            var hc1 = (uint)(value1?.GetHashCode() ?? 0);\n            var hc2 = (uint)(value2?.GetHashCode() ?? 0);\n            var hc3 = (uint)(value3?.GetHashCode() ?? 0);\n            var hc4 = (uint)(value4?.GetHashCode() ?? 0);\n            var hc5 = (uint)(value5?.GetHashCode() ?? 0);\n            var hc6 = (uint)(value6?.GetHashCode() ?? 0);\n            var hc7 = (uint)(value7?.GetHashCode() ?? 0);\n            var hc8 = (uint)(value8?.GetHashCode() ?? 0);\n\n            Initialize(out var v1, out var v2, out var v3, out var v4);\n\n            v1 = Round(v1, hc1);\n            v2 = Round(v2, hc2);\n            v3 = Round(v3, hc3);\n            v4 = Round(v4, hc4);\n\n            v1 = Round(v1, hc5);\n            v2 = Round(v2, hc6);\n            v3 = Round(v3, hc7);\n            v4 = Round(v4, hc8);\n\n            var hash = MixState(v1, v2, v3, v4);\n            hash += 32;\n\n            hash = MixFinal(hash);\n            return (int)hash;\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private static void Initialize(out uint v1, out uint v2, out uint v3, out uint v4)\n        {\n            v1 = s_seed + Prime1 + Prime2;\n            v2 = s_seed + Prime2;\n            v3 = s_seed;\n            v4 = s_seed - Prime1;\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private static uint Round(uint hash, uint input)\n        {\n            return BitOperations.RotateLeft(hash + (input * Prime2), 13) * Prime1;\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private static uint QueueRound(uint hash, uint queuedValue)\n        {\n            return BitOperations.RotateLeft(hash + (queuedValue * Prime3), 17) * Prime4;\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private static uint MixState(uint v1, uint v2, uint v3, uint v4)\n        {\n            return BitOperations.RotateLeft(v1, 1) + BitOperations.RotateLeft(v2, 7) + BitOperations.RotateLeft(v3, 12) + BitOperations.RotateLeft(v4, 18);\n        }\n\n        private static uint MixEmptyState()\n        {\n            return s_seed + Prime5;\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private static uint MixFinal(uint hash)\n        {\n            hash ^= hash >> 15;\n            hash *= Prime2;\n            hash ^= hash >> 13;\n            hash *= Prime3;\n            hash ^= hash >> 16;\n            return hash;\n        }\n\n        public void Add<T>(T value)\n        {\n            Add(value?.GetHashCode() ?? 0);\n        }\n\n        public void Add<T>(T value, IEqualityComparer<T>? comparer)\n        {\n            Add(value is null ? 0 : (comparer?.GetHashCode(value) ?? value.GetHashCode()));\n        }\n\n        private void Add(int value)\n        {\n            // The original xxHash works as follows:\n            // 0. Initialize immediately. We can't do this in a struct (no\n            //    default ctor).\n            // 1. Accumulate blocks of length 16 (4 uints) into 4 accumulators.\n            // 2. Accumulate remaining blocks of length 4 (1 uint) into the\n            //    hash.\n            // 3. Accumulate remaining blocks of length 1 into the hash.\n\n            // There is no need for #3 as this type only accepts ints. _queue1,\n            // _queue2 and _queue3 are basically a buffer so that when\n            // ToHashCode is called we can execute #2 correctly.\n\n            // We need to initialize the xxHash32 state (_v1 to _v4) lazily (see\n            // #0) nd the last place that can be done if you look at the\n            // original code is just before the first block of 16 bytes is mixed\n            // in. The xxHash32 state is never used for streams containing fewer\n            // than 16 bytes.\n\n            // To see what's really going on here, have a look at the Combine\n            // methods.\n\n            var val = (uint)value;\n\n            // Storing the value of _length locally shaves of quite a few bytes\n            // in the resulting machine code.\n            var previousLength = _length++;\n            var position = previousLength % 4;\n\n            // Switch can't be inlined.\n\n            if (position == 0)\n            {\n                _queue1 = val;\n            }\n            else if (position == 1)\n            {\n                _queue2 = val;\n            }\n            else if (position == 2)\n            {\n                _queue3 = val;\n            }\n            else // position == 3\n            {\n                if (previousLength == 3)\n                    Initialize(out _v1, out _v2, out _v3, out _v4);\n\n                _v1 = Round(_v1, _queue1);\n                _v2 = Round(_v2, _queue2);\n                _v3 = Round(_v3, _queue3);\n                _v4 = Round(_v4, val);\n            }\n        }\n\n        public int ToHashCode()\n        {\n            // Storing the value of _length locally shaves of quite a few bytes\n            // in the resulting machine code.\n            var length = _length;\n\n            // position refers to the *next* queue position in this method, so\n            // position == 1 means that _queue1 is populated; _queue2 would have\n            // been populated on the next call to Add.\n            var position = length % 4;\n\n            // If the length is less than 4, _v1 to _v4 don't contain anything\n            // yet. xxHash32 treats this differently.\n\n            var hash = length < 4 ? MixEmptyState() : MixState(_v1, _v2, _v3, _v4);\n\n            // _length is incremented once per Add(Int32) and is therefore 4\n            // times too small (xxHash length is in bytes, not ints).\n\n            hash += length * 4;\n\n            // Mix what remains in the queue\n\n            // Switch can't be inlined right now, so use as few branches as\n            // possible by manually excluding impossible scenarios (position > 1\n            // is always false if position is not > 0).\n            if (position > 0)\n            {\n                hash = QueueRound(hash, _queue1);\n                if (position > 1)\n                {\n                    hash = QueueRound(hash, _queue2);\n                    if (position > 2)\n                        hash = QueueRound(hash, _queue3);\n                }\n            }\n\n            hash = MixFinal(hash);\n            return (int)hash;\n        }\n\n#pragma warning disable CS0809 // Obsolete member overrides non-obsolete member\n#pragma warning disable CA1065 // Do not raise exceptions in unexpected locations\n        // Obsolete member 'memberA' overrides non-obsolete member 'memberB'.\n        // Disallowing GetHashCode and Equals is by design\n\n        // * We decided to not override GetHashCode() to produce the hash code\n        //   as this would be weird, both naming-wise as well as from a\n        //   behavioral standpoint (GetHashCode() should return the object's\n        //   hash code, not the one being computed).\n\n        // * Even though ToHashCode() can be called safely multiple times on\n        //   this implementation, it is not part of the contract. If the\n        //   implementation has to change in the future we don't want to worry\n        //   about people who might have incorrectly used this type.\n\n        [Obsolete(\"HashCode is a mutable struct and should not be compared with other HashCodes. Use ToHashCode to retrieve the computed hash code.\", error: true)]\n        [EditorBrowsable(EditorBrowsableState.Never)]\n        public override int GetHashCode() => throw new NotSupportedException(SR.HashCode_HashCodeNotSupported);\n\n        [Obsolete(\"HashCode is a mutable struct and should not be compared with other HashCodes.\", error: true)]\n        [EditorBrowsable(EditorBrowsableState.Never)]\n        public override bool Equals(object? obj) => throw new NotSupportedException(SR.HashCode_EqualityNotSupported);\n#pragma warning restore CA1065 // Do not raise exceptions in unexpected locations\n#pragma warning restore CS0809 // Obsolete member overrides non-obsolete member\n\n        private static class SR\n        {\n            public static string HashCode_HashCodeNotSupported = \"HashCode is a mutable struct and should not be compared with other HashCodes. Use ToHashCode to retrieve the computed hash code.\";\n            public static string HashCode_EqualityNotSupported = \"HashCode is a mutable struct and should not be compared with other HashCodes.\";\n        }\n\n        private static class BitOperations\n        {\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static uint RotateLeft(uint value, int offset)\n                => (value << offset) | (value >> (32 - offset));\n\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static ulong RotateLeft(ulong value, int offset)\n                => (value << offset) | (value >> (64 - offset));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.CodeGeneration/SonarAnalyzer.ShimLayer.CodeGeneration.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFrameworks>netstandard2.0</TargetFrameworks>\n    <Nullable>enable</Nullable>\n    <SonarQubeExclude>true</SonarQubeExclude>\n    <!-- The scanner removes all the analyzers that have the \"SonarAnalyzer\" prefix -->\n    <AssemblyName>Internal.SonarAnalyzer.ShimLayer.CodeGeneration</AssemblyName>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Microsoft.CodeAnalysis.CSharp\" Version=\"5.0.0\" />\n    <PackageReference Include=\"TunnelVisionLabs.ReferenceAssemblyAnnotator\" Version=\"1.0.0-alpha.160\" PrivateAssets=\"all\" />\n    <PackageDownload Include=\"Microsoft.NETCore.App.Ref\" Version=\"[3.1.0]\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Using Include=\"Microsoft.CodeAnalysis\"/>\n    <Using Include=\"Microsoft.CodeAnalysis.Diagnostics\"/>\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.CodeGeneration/SyntaxLightupGenerator.cs",
    "content": "﻿// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.\n// Licensed under the MIT License. See LICENSE in the project root for license information.\n\nnamespace StyleCop.Analyzers.CodeGeneration\n{\n    using System;\n    using System.Collections.Generic;\n    using System.Collections.Immutable;\n    using System.Diagnostics;\n    using System.Diagnostics.CodeAnalysis;\n    using System.IO;\n    using System.Linq;\n    using System.Text;\n    using System.Xml.Linq;\n    using System.Xml.XPath;\n    using Analyzer.Utilities;\n    using Microsoft.CodeAnalysis;\n    using Microsoft.CodeAnalysis.CSharp;\n    using Microsoft.CodeAnalysis.CSharp.Syntax;\n\n    [Generator]\n    internal sealed class SyntaxLightupGenerator : IIncrementalGenerator\n    {\n        private enum NodeKind\n        {\n            Predefined,\n            Abstract,\n            Concrete,\n        }\n\n        public void Initialize(IncrementalGeneratorInitializationContext context)\n        {\n            var referencedAssemblies = context.CompilationProvider.SelectMany(\n                static (compilation, cancellationToken) =>\n                {\n                    return compilation.SourceModule.ReferencedAssemblySymbols\n                        .Where(reference => reference.Name is \"Microsoft.CodeAnalysis\" or \"Microsoft.CodeAnalysis.CSharp\");\n                });\n\n            var existingTypesInReferences = referencedAssemblies.SelectMany(\n                static (reference, cancellationToken) =>\n                {\n                    var microsoftNamespace = reference.GlobalNamespace.GetNamespaceMembers().SingleOrDefault(symbol => symbol.Name == nameof(Microsoft));\n                    var microsoftCodeAnalysisNamespace = microsoftNamespace?.GetNamespaceMembers().SingleOrDefault(symbol => symbol.Name == nameof(Microsoft.CodeAnalysis));\n                    var microsoftCodeAnalysisCSharpNamespace = microsoftCodeAnalysisNamespace?.GetNamespaceMembers().SingleOrDefault(symbol => symbol.Name == nameof(Microsoft.CodeAnalysis.CSharp));\n                    var microsoftCodeAnalysisCSharpSyntaxNamespace = microsoftCodeAnalysisCSharpNamespace?.GetNamespaceMembers().SingleOrDefault(symbol => symbol.Name == nameof(Microsoft.CodeAnalysis.CSharp.Syntax));\n\n                    var existingTypesBuilder = ImmutableArray.CreateBuilder<ExistingTypeData>();\n                    AddPublicTypesFromNamespace(microsoftNamespace, existingTypesBuilder);\n                    AddPublicTypesFromNamespace(microsoftCodeAnalysisNamespace, existingTypesBuilder);\n                    AddPublicTypesFromNamespace(microsoftCodeAnalysisCSharpNamespace, existingTypesBuilder);\n                    AddPublicTypesFromNamespace(microsoftCodeAnalysisCSharpSyntaxNamespace, existingTypesBuilder);\n\n                    return existingTypesBuilder.ToImmutable();\n\n                    static void AddPublicTypesFromNamespace(INamespaceSymbol? namespaceSymbol, ImmutableArray<ExistingTypeData>.Builder existingTypesBuilder)\n                    {\n                        if (namespaceSymbol is null)\n                        {\n                            return;\n                        }\n\n                        foreach (var type in namespaceSymbol.GetTypeMembers())\n                        {\n                            if (type is not { DeclaredAccessibility: Accessibility.Public })\n                            {\n                                continue;\n                            }\n\n                            existingTypesBuilder.Add(ExistingTypeData.FromNamedType(type, type.ToDisplayString(SymbolDisplayFormat.CSharpErrorMessageFormat)));\n                        }\n                    }\n                });\n\n            var compilationData = existingTypesInReferences.Collect().Select(\n                static (existingTypes, cancellationToken) =>\n                {\n                    return new CompilationData(\n                        ExistingTypesWrapper: new EquatableValue<ImmutableDictionary<string, ExistingTypeData>>(\n                            existingTypes.ToImmutableDictionary(type => type.TypeName),\n                            ImmutableDictionaryEqualityComparer<string, ExistingTypeData>.Default));\n                });\n\n            var syntaxFiles = context.AdditionalTextsProvider.Where(static x => Path.GetFileName(x.Path) == \"Syntax.xml\");\n            context.RegisterSourceOutput(\n                syntaxFiles.Combine(compilationData),\n                (context, value) => this.Execute(in context, value.Right, value.Left));\n        }\n\n        private void Execute(in SourceProductionContext context, CompilationData compilationData, AdditionalText syntaxFile)\n        {\n            var syntaxText = syntaxFile.GetText(context.CancellationToken);\n            if (syntaxText is null)\n            {\n                throw new InvalidOperationException(\"Failed to read Syntax.xml\");\n            }\n\n            var syntaxData = new SyntaxData(compilationData, XDocument.Parse(syntaxText.ToString()));\n            //this.GenerateSyntaxWrappers(in context, syntaxData);\n            this.GenerateSyntaxWrapperHelper(in context, syntaxData.Nodes);\n        }\n\n        private void GenerateSyntaxWrappers(in SourceProductionContext context, SyntaxData syntaxData)\n        {\n            foreach (var node in syntaxData.Nodes)\n            {\n                this.GenerateSyntaxWrapper(in context, syntaxData, node);\n            }\n        }\n\n        private void GenerateSyntaxWrapper(in SourceProductionContext context, SyntaxData syntaxData, NodeData nodeData)\n        {\n            if (nodeData.WrapperName is null)\n            {\n                // No need to generate a wrapper for this type\n                return;\n            }\n\n            var concreteBase = syntaxData.TryGetConcreteBase(nodeData)?.Name ?? nameof(SyntaxNode);\n\n            var members = SyntaxFactory.List<MemberDeclarationSyntax>();\n\n            // internal const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.WhenClauseSyntax\";\n            members = members.Add(SyntaxFactory.FieldDeclaration(\n                attributeLists: default,\n                modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PublicKeyword), SyntaxFactory.Token(SyntaxKind.ConstKeyword)), // Sonar: changed to PublicKeyword\n                declaration: SyntaxFactory.VariableDeclaration(\n                    type: SyntaxFactory.PredefinedType(SyntaxFactory.Token(SyntaxKind.StringKeyword)),\n                    variables: SyntaxFactory.SingletonSeparatedList(SyntaxFactory.VariableDeclarator(\n                        identifier: SyntaxFactory.Identifier(\"WrappedTypeName\"),\n                        argumentList: null,\n                        initializer: SyntaxFactory.EqualsValueClause(SyntaxFactory.LiteralExpression(SyntaxKind.StringLiteralExpression, SyntaxFactory.Literal(\"Microsoft.CodeAnalysis.CSharp.Syntax.\" + nodeData.Name))))))));\n\n            // private static readonly Type WrappedType;\n            members = members.Add(SyntaxFactory.FieldDeclaration(\n                attributeLists: default,\n                modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PrivateKeyword), SyntaxFactory.Token(SyntaxKind.StaticKeyword), SyntaxFactory.Token(SyntaxKind.ReadOnlyKeyword)),\n                declaration: SyntaxFactory.VariableDeclaration(\n                    type: SyntaxFactory.IdentifierName(\"Type\"),\n                    variables: SyntaxFactory.SingletonSeparatedList(SyntaxFactory.VariableDeclarator(\"WrappedType\")))));\n\n            bool first = true;\n            foreach (var field in nodeData.Fields)\n            {\n                if (field.IsSkipped)\n                {\n                    continue;\n                }\n\n                if (field.IsOverride)\n                {\n                    // The 'get' accessor is skipped for override fields\n                    continue;\n                }\n\n                // private static readonly Func<CSharpSyntaxNode, T> FieldAccessor;\n                FieldDeclarationSyntax fieldAccessor = SyntaxFactory.FieldDeclaration(\n                    attributeLists: default,\n                    modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PrivateKeyword), SyntaxFactory.Token(SyntaxKind.StaticKeyword), SyntaxFactory.Token(SyntaxKind.ReadOnlyKeyword)),\n                    declaration: SyntaxFactory.VariableDeclaration(\n                        type: SyntaxFactory.GenericName(\n                            identifier: SyntaxFactory.Identifier(\"Func\"),\n                            typeArgumentList: SyntaxFactory.TypeArgumentList(SyntaxFactory.SeparatedList(\n                                new[]\n                                {\n                                    SyntaxFactory.IdentifierName(concreteBase),\n                                    SyntaxFactory.ParseTypeName(field.GetAccessorResultType(syntaxData)),\n                                }))),\n                        variables: SyntaxFactory.SingletonSeparatedList(SyntaxFactory.VariableDeclarator(field.AccessorName))));\n\n                if (first)\n                {\n                    fieldAccessor = fieldAccessor.WithLeadingBlankLine();\n                    first = false;\n                }\n\n                members = members.Add(fieldAccessor);\n            }\n\n            foreach (var field in nodeData.Fields)\n            {\n                if (field.IsSkipped)\n                {\n                    continue;\n                }\n\n                // private static readonly Func<CSharpSyntaxNode, T, CSharpSyntaxNode> WithFieldAccessor;\n                members = members.Add(SyntaxFactory.FieldDeclaration(\n                    attributeLists: default,\n                    modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PrivateKeyword), SyntaxFactory.Token(SyntaxKind.StaticKeyword), SyntaxFactory.Token(SyntaxKind.ReadOnlyKeyword)),\n                    declaration: SyntaxFactory.VariableDeclaration(\n                        type: SyntaxFactory.GenericName(\n                            identifier: SyntaxFactory.Identifier(\"Func\"),\n                            typeArgumentList: SyntaxFactory.TypeArgumentList(SyntaxFactory.SeparatedList(\n                                new[]\n                                {\n                                    SyntaxFactory.IdentifierName(concreteBase),\n                                    SyntaxFactory.ParseTypeName(field.GetAccessorResultType(syntaxData)),\n                                    SyntaxFactory.IdentifierName(concreteBase),\n                                }))),\n                        variables: SyntaxFactory.SingletonSeparatedList(SyntaxFactory.VariableDeclarator(field.WithAccessorName)))));\n            }\n\n            // private readonly SyntaxNode node;\n            members = members.Add(SyntaxFactory.FieldDeclaration(\n                attributeLists: default,\n                modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PrivateKeyword), SyntaxFactory.Token(SyntaxKind.ReadOnlyKeyword)),\n                declaration: SyntaxFactory.VariableDeclaration(\n                    type: SyntaxFactory.IdentifierName(concreteBase),\n                    variables: SyntaxFactory.SingletonSeparatedList(SyntaxFactory.VariableDeclarator(\"node\")))).WithLeadingBlankLine());\n\n            // WrappedType = SyntaxWrapperHelper.GetWrappedType(typeof(SyntaxWrapper));\n            var staticCtorStatements = SyntaxFactory.SingletonList<StatementSyntax>(\n                SyntaxFactory.ExpressionStatement(SyntaxFactory.AssignmentExpression(\n                    SyntaxKind.SimpleAssignmentExpression,\n                    left: SyntaxFactory.IdentifierName(\"WrappedType\"),\n                    right: SyntaxFactory.InvocationExpression(\n                        expression: SyntaxFactory.MemberAccessExpression(\n                            SyntaxKind.SimpleMemberAccessExpression,\n                            expression: SyntaxFactory.IdentifierName(\"SyntaxWrapperHelper\"),\n                            name: SyntaxFactory.IdentifierName(\"GetWrappedType\")),\n                        argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Argument(\n                            SyntaxFactory.TypeOfExpression(SyntaxFactory.IdentifierName(nodeData.WrapperName)))))))));\n\n            foreach (var field in nodeData.Fields)\n            {\n                if (field.IsSkipped)\n                {\n                    continue;\n                }\n\n                if (field.IsOverride)\n                {\n                    // The 'get' accessor is skipped for override fields\n                    continue;\n                }\n\n                SimpleNameSyntax helperName;\n                if (field.IsWrappedSeparatedSyntaxList(syntaxData, out var elementNode))\n                {\n                    Debug.Assert(elementNode.WrapperName is not null, $\"Assertion failed: {nameof(elementNode)}.{nameof(elementNode.WrapperName)} is not null\");\n\n                    // CreateSeparatedSyntaxListPropertyAccessor<SyntaxNode, T>\n                    helperName = SyntaxFactory.GenericName(\n                        identifier: SyntaxFactory.Identifier(\"CreateSeparatedSyntaxListPropertyAccessor\"),\n                        typeArgumentList: SyntaxFactory.TypeArgumentList(SyntaxFactory.SeparatedList<TypeSyntax>(\n                            new[]\n                            {\n                                SyntaxFactory.IdentifierName(concreteBase),\n                                SyntaxFactory.IdentifierName(elementNode.WrapperName),\n                            })));\n                }\n                else\n                {\n                    // CreateSyntaxPropertyAccessor<SyntaxNode, T>\n                    helperName = SyntaxFactory.GenericName(\n                        identifier: SyntaxFactory.Identifier(\"CreateSyntaxPropertyAccessor\"),\n                        typeArgumentList: SyntaxFactory.TypeArgumentList(SyntaxFactory.SeparatedList(\n                            new[]\n                            {\n                                SyntaxFactory.IdentifierName(concreteBase),\n                                SyntaxFactory.ParseTypeName(field.GetAccessorResultType(syntaxData)),\n                            })));\n                }\n\n                // ReturnTypeAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<StatementSyntax, TypeSyntax>(WrappedType, nameof(ReturnType));\n                staticCtorStatements = staticCtorStatements.Add(SyntaxFactory.ExpressionStatement(SyntaxFactory.AssignmentExpression(\n                    SyntaxKind.SimpleAssignmentExpression,\n                    left: SyntaxFactory.IdentifierName(field.AccessorName),\n                    right: SyntaxFactory.InvocationExpression(\n                        expression: SyntaxFactory.MemberAccessExpression(\n                            SyntaxKind.SimpleMemberAccessExpression,\n                            expression: SyntaxFactory.IdentifierName(\"LightupHelpers\"),\n                            name: helperName),\n                        argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SeparatedList(\n                            new[]\n                            {\n                                SyntaxFactory.Argument(SyntaxFactory.IdentifierName(\"WrappedType\")),\n                                SyntaxFactory.Argument(SyntaxFactory.InvocationExpression(\n                                    expression: SyntaxFactory.IdentifierName(\"nameof\"),\n                                    argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Argument(SyntaxFactory.IdentifierName(field.Name)))))),\n                            }))))));\n            }\n\n            foreach (var field in nodeData.Fields)\n            {\n                if (field.IsSkipped)\n                {\n                    continue;\n                }\n\n                SimpleNameSyntax helperName;\n                if (field.IsWrappedSeparatedSyntaxList(syntaxData, out var elementNode))\n                {\n                    Debug.Assert(elementNode.WrapperName is not null, $\"Assertion failed: {nameof(elementNode)}.{nameof(elementNode.WrapperName)} is not null\");\n\n                    // CreateSeparatedSyntaxListWithPropertyAccessor<SyntaxNode, T>\n                    helperName = SyntaxFactory.GenericName(\n                        identifier: SyntaxFactory.Identifier(\"CreateSeparatedSyntaxListWithPropertyAccessor\"),\n                        typeArgumentList: SyntaxFactory.TypeArgumentList(SyntaxFactory.SeparatedList<TypeSyntax>(\n                            new[]\n                            {\n                                SyntaxFactory.IdentifierName(concreteBase),\n                                SyntaxFactory.IdentifierName(elementNode.WrapperName),\n                            })));\n                }\n                else\n                {\n                    // CreateSyntaxWithPropertyAccessor<SyntaxNode, T>\n                    helperName = SyntaxFactory.GenericName(\n                        identifier: SyntaxFactory.Identifier(\"CreateSyntaxWithPropertyAccessor\"),\n                        typeArgumentList: SyntaxFactory.TypeArgumentList(SyntaxFactory.SeparatedList(\n                            new[]\n                            {\n                                SyntaxFactory.IdentifierName(concreteBase),\n                                SyntaxFactory.ParseTypeName(field.GetAccessorResultType(syntaxData)),\n                            })));\n                }\n\n                // WithReturnTypeAccessor = LightupHelpers.CreateSyntaxWithPropertyAccessor<StatementSyntax, TypeSyntax>(WrappedType, nameof(ReturnType));\n                staticCtorStatements = staticCtorStatements.Add(SyntaxFactory.ExpressionStatement(SyntaxFactory.AssignmentExpression(\n                    SyntaxKind.SimpleAssignmentExpression,\n                    left: SyntaxFactory.IdentifierName(field.WithAccessorName),\n                    right: SyntaxFactory.InvocationExpression(\n                        expression: SyntaxFactory.MemberAccessExpression(\n                            SyntaxKind.SimpleMemberAccessExpression,\n                            expression: SyntaxFactory.IdentifierName(\"LightupHelpers\"),\n                            name: helperName),\n                        argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SeparatedList(\n                            new[]\n                            {\n                                SyntaxFactory.Argument(SyntaxFactory.IdentifierName(\"WrappedType\")),\n                                SyntaxFactory.Argument(SyntaxFactory.InvocationExpression(\n                                    expression: SyntaxFactory.IdentifierName(\"nameof\"),\n                                    argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Argument(SyntaxFactory.IdentifierName(field.Name)))))),\n                            }))))));\n            }\n\n            // static SyntaxWrapper()\n            // {\n            //     WrappedType = SyntaxWrapperHelper.GetWrappedType(typeof(SyntaxWrapper));\n            // }\n            members = members.Add(SyntaxFactory.ConstructorDeclaration(\n                attributeLists: default,\n                modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.StaticKeyword)),\n                identifier: SyntaxFactory.Identifier(nodeData.WrapperName),\n                parameterList: SyntaxFactory.ParameterList(),\n                initializer: null,\n                body: SyntaxFactory.Block(staticCtorStatements),\n                expressionBody: null).WithLeadingBlankLine());\n\n            // private SyntaxNodeWrapper(SyntaxNode node)\n            // {\n            //     this.node = node;\n            // }\n            members = members.Add(SyntaxFactory.ConstructorDeclaration(\n                attributeLists: default,\n                modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PrivateKeyword)),\n                identifier: SyntaxFactory.Identifier(nodeData.WrapperName),\n                parameterList: SyntaxFactory.ParameterList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Parameter(\n                    attributeLists: default,\n                    modifiers: default,\n                    type: SyntaxFactory.IdentifierName(concreteBase),\n                    identifier: SyntaxFactory.Identifier(\"node\"),\n                    @default: null))),\n                initializer: null,\n                body: SyntaxFactory.Block(\n                    SyntaxFactory.ExpressionStatement(SyntaxFactory.AssignmentExpression(\n                        SyntaxKind.SimpleAssignmentExpression,\n                        left: SyntaxFactory.MemberAccessExpression(\n                            SyntaxKind.SimpleMemberAccessExpression,\n                            expression: SyntaxFactory.ThisExpression(),\n                            name: SyntaxFactory.IdentifierName(\"node\")),\n                        right: SyntaxFactory.IdentifierName(\"node\")))),\n                expressionBody: null));\n\n            // public SyntaxNode SyntaxNode => this.node;\n            members = members.Add(SyntaxFactory.PropertyDeclaration(\n                attributeLists: default,\n                modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PublicKeyword)),\n                type: SyntaxFactory.IdentifierName(concreteBase),\n                explicitInterfaceSpecifier: null,\n                identifier: SyntaxFactory.Identifier(\"SyntaxNode\"),\n                accessorList: null,\n                expressionBody: SyntaxFactory.ArrowExpressionClause(SyntaxFactory.MemberAccessExpression(\n                    SyntaxKind.SimpleMemberAccessExpression,\n                    expression: SyntaxFactory.ThisExpression(),\n                    name: SyntaxFactory.IdentifierName(\"node\"))),\n                initializer: null,\n                semicolonToken: SyntaxFactory.Token(SyntaxKind.SemicolonToken)));\n\n            // public T Field\n            // {\n            //     get\n            //     {\n            //         return ...;\n            //     }\n            // }\n            first = true;\n            foreach (var field in nodeData.Fields)\n            {\n                if (field.IsSkipped)\n                {\n                    continue;\n                }\n\n                TypeSyntax propertyType = SyntaxFactory.ParseTypeName(field.GetAccessorResultType(syntaxData));\n                ExpressionSyntax returnExpression;\n                if (field.IsOverride)\n                {\n                    var declaringNode = field.GetDeclaringNode(syntaxData);\n                    if (declaringNode.WrapperName is not null)\n                    {\n                        // ((CommonForEachStatementSyntaxWrapper)this).OpenParenToken\n                        returnExpression = SyntaxFactory.MemberAccessExpression(\n                            SyntaxKind.SimpleMemberAccessExpression,\n                            expression: SyntaxFactory.ParenthesizedExpression(\n                                SyntaxFactory.CastExpression(\n                                    type: SyntaxFactory.IdentifierName(declaringNode.WrapperName ?? declaringNode.Name),\n                                    expression: SyntaxFactory.ThisExpression())),\n                            name: SyntaxFactory.IdentifierName(field.Name));\n                    }\n                    else\n                    {\n                        // this.SyntaxNode.OpenParenToken\n                        returnExpression = SyntaxFactory.MemberAccessExpression(\n                            SyntaxKind.SimpleMemberAccessExpression,\n                            expression: SyntaxFactory.MemberAccessExpression(\n                                SyntaxKind.SimpleMemberAccessExpression,\n                                expression: SyntaxFactory.ThisExpression(),\n                                name: SyntaxFactory.IdentifierName(\"SyntaxNode\")),\n                            name: SyntaxFactory.IdentifierName(field.Name));\n\n                        if (declaringNode.TryGetField(field.Name) is { IsExtensionField: true })\n                        {\n                            // this.SyntaxNode.OpenParenToken()\n                            returnExpression = SyntaxFactory.InvocationExpression(\n                                expression: returnExpression,\n                                argumentList: SyntaxFactory.ArgumentList());\n                        }\n                    }\n                }\n                else if (field.IsWrappedSeparatedSyntaxList(syntaxData, out var elementNode))\n                {\n                    // PatternAccessor(this.SyntaxNode)\n                    returnExpression = SyntaxFactory.InvocationExpression(\n                        expression: SyntaxFactory.IdentifierName(field.AccessorName),\n                        argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Argument(\n                            SyntaxFactory.MemberAccessExpression(\n                                SyntaxKind.SimpleMemberAccessExpression,\n                                expression: SyntaxFactory.ThisExpression(),\n                                name: SyntaxFactory.IdentifierName(\"SyntaxNode\"))))));\n                }\n                else if (syntaxData.TryGetNode(field.Type) is { } fieldNodeType)\n                {\n                    // PatternAccessor(this.SyntaxNode)\n                    returnExpression = SyntaxFactory.InvocationExpression(\n                        expression: SyntaxFactory.IdentifierName(field.AccessorName),\n                        argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Argument(\n                            SyntaxFactory.MemberAccessExpression(\n                                SyntaxKind.SimpleMemberAccessExpression,\n                                expression: SyntaxFactory.ThisExpression(),\n                                name: SyntaxFactory.IdentifierName(\"SyntaxNode\"))))));\n\n                    if (fieldNodeType.WrapperName is not null)\n                    {\n                        // (PatternSyntaxWrapper)...\n                        propertyType = SyntaxFactory.IdentifierName(fieldNodeType.WrapperName);\n                        returnExpression = SyntaxFactory.CastExpression(\n                            type: SyntaxFactory.IdentifierName(fieldNodeType.WrapperName),\n                            expression: returnExpression);\n                    }\n                }\n                else\n                {\n                    // PatternAccessor(this.SyntaxNode)\n                    returnExpression = SyntaxFactory.InvocationExpression(\n                        expression: SyntaxFactory.IdentifierName(field.AccessorName),\n                        argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Argument(\n                            SyntaxFactory.MemberAccessExpression(\n                                SyntaxKind.SimpleMemberAccessExpression,\n                                expression: SyntaxFactory.ThisExpression(),\n                                name: SyntaxFactory.IdentifierName(\"SyntaxNode\"))))));\n                }\n\n                // public T Field\n                // {\n                //     get\n                //     {\n                //         return ...;\n                //     }\n                // }\n                PropertyDeclarationSyntax property = SyntaxFactory.PropertyDeclaration(\n                    attributeLists: default,\n                    modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PublicKeyword)),\n                    type: propertyType,\n                    explicitInterfaceSpecifier: null,\n                    identifier: SyntaxFactory.Identifier(field.Name),\n                    accessorList: SyntaxFactory.AccessorList(SyntaxFactory.SingletonList(SyntaxFactory.AccessorDeclaration(\n                        SyntaxKind.GetAccessorDeclaration,\n                        SyntaxFactory.Block(\n                            SyntaxFactory.ReturnStatement(returnExpression))))),\n                    expressionBody: null,\n                    initializer: null,\n                    semicolonToken: default);\n\n                if (first)\n                {\n                    property = property.WithLeadingBlankLine();\n                    first = false;\n                }\n\n                members = members.Add(property);\n            }\n\n            for (var baseNode = syntaxData.TryGetNode(nodeData.BaseName); baseNode?.WrapperName is not null; baseNode = syntaxData.TryGetNode(baseNode.BaseName))\n            {\n                // public static explicit operator SyntaxWrapper(BaseSyntaxWrapper node)\n                // {\n                //     return (SyntaxWrapper)node.SyntaxNode;\n                // }\n                ConversionOperatorDeclarationSyntax wrapperConversion = SyntaxFactory.ConversionOperatorDeclaration(\n                    attributeLists: default,\n                    modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PublicKeyword), SyntaxFactory.Token(SyntaxKind.StaticKeyword)),\n                    implicitOrExplicitKeyword: SyntaxFactory.Token(SyntaxKind.ExplicitKeyword),\n                    operatorKeyword: SyntaxFactory.Token(SyntaxKind.OperatorKeyword),\n                    type: SyntaxFactory.IdentifierName(nodeData.WrapperName),\n                    parameterList: SyntaxFactory.ParameterList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Parameter(\n                        attributeLists: default,\n                        modifiers: default,\n                        type: SyntaxFactory.IdentifierName(baseNode.WrapperName),\n                        identifier: SyntaxFactory.Identifier(\"node\"),\n                        @default: null))),\n                    body: SyntaxFactory.Block(SyntaxFactory.ReturnStatement(\n                        SyntaxFactory.CastExpression(\n                            type: SyntaxFactory.IdentifierName(nodeData.WrapperName),\n                            expression: SyntaxFactory.MemberAccessExpression(\n                                SyntaxKind.SimpleMemberAccessExpression,\n                                expression: SyntaxFactory.IdentifierName(\"node\"),\n                                name: SyntaxFactory.IdentifierName(\"SyntaxNode\"))))),\n                    expressionBody: null,\n                    semicolonToken: default);\n\n                if (first)\n                {\n                    wrapperConversion = wrapperConversion.WithLeadingBlankLine();\n                    first = false;\n                }\n\n                members = members.Add(wrapperConversion);\n            }\n\n            // public static explicit operator WhenClauseSyntaxWrapper(SyntaxNode node)\n            // {\n            //     if (node == null)\n            //     {\n            //         return default;\n            //     }\n            //\n            //     if (!IsInstance(node))\n            //     {\n            //         throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n            //     }\n            //\n            //     return new WhenClauseSyntaxWrapper((CSharpSyntaxNode)node);\n            // }\n            var nodeConversion = SyntaxFactory.ConversionOperatorDeclaration(\n                attributeLists: default,\n                modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PublicKeyword), SyntaxFactory.Token(SyntaxKind.StaticKeyword)),\n                implicitOrExplicitKeyword: SyntaxFactory.Token(SyntaxKind.ExplicitKeyword),\n                operatorKeyword: SyntaxFactory.Token(SyntaxKind.OperatorKeyword),\n                type: SyntaxFactory.IdentifierName(nodeData.WrapperName),\n                parameterList: SyntaxFactory.ParameterList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Parameter(\n                    attributeLists: default,\n                    modifiers: default,\n                    type: SyntaxFactory.IdentifierName(\"SyntaxNode\"),\n                    identifier: SyntaxFactory.Identifier(\"node\"),\n                    @default: null))),\n                body: SyntaxFactory.Block(\n                    SyntaxFactory.IfStatement(\n                        condition: SyntaxFactory.BinaryExpression(\n                            SyntaxKind.EqualsExpression,\n                            left: SyntaxFactory.IdentifierName(\"node\"),\n                            right: SyntaxFactory.LiteralExpression(SyntaxKind.NullLiteralExpression)),\n                        statement: SyntaxFactory.Block(\n                            SyntaxFactory.ReturnStatement(SyntaxFactory.LiteralExpression(SyntaxKind.DefaultLiteralExpression)))),\n                    SyntaxFactory.IfStatement(\n                        condition: SyntaxFactory.PrefixUnaryExpression(\n                            SyntaxKind.LogicalNotExpression,\n                            operand: SyntaxFactory.InvocationExpression(\n                                expression: SyntaxFactory.IdentifierName(\"IsInstance\"),\n                                argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Argument(SyntaxFactory.IdentifierName(\"node\")))))),\n                        statement: SyntaxFactory.Block(\n                            SyntaxFactory.ThrowStatement(SyntaxFactory.ObjectCreationExpression(\n                                type: SyntaxFactory.IdentifierName(\"InvalidCastException\"),\n                                argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Argument(\n                                    SyntaxFactory.InterpolatedStringExpression(\n                                        SyntaxFactory.Token(SyntaxKind.InterpolatedStringStartToken),\n                                        SyntaxFactory.List(new InterpolatedStringContentSyntax[]\n                                        {\n                                            SyntaxFactory.InterpolatedStringText(SyntaxFactory.Token(\n                                                leading: default,\n                                                SyntaxKind.InterpolatedStringTextToken,\n                                                \"Cannot cast '\",\n                                                \"Cannot cast '\",\n                                                trailing: default)),\n                                            SyntaxFactory.Interpolation(SyntaxFactory.MemberAccessExpression(\n                                                SyntaxKind.SimpleMemberAccessExpression,\n                                                expression: SyntaxFactory.InvocationExpression(\n                                                    expression: SyntaxFactory.MemberAccessExpression(\n                                                        SyntaxKind.SimpleMemberAccessExpression,\n                                                        expression: SyntaxFactory.IdentifierName(\"node\"),\n                                                        name: SyntaxFactory.IdentifierName(\"GetType\")),\n                                                    argumentList: SyntaxFactory.ArgumentList()),\n                                                name: SyntaxFactory.IdentifierName(\"FullName\"))),\n                                            SyntaxFactory.InterpolatedStringText(SyntaxFactory.Token(\n                                                leading: default,\n                                                SyntaxKind.InterpolatedStringTextToken,\n                                                \"' to '\",\n                                                \"' to '\",\n                                                trailing: default)),\n                                            SyntaxFactory.Interpolation(SyntaxFactory.IdentifierName(\"WrappedTypeName\")),\n                                            SyntaxFactory.InterpolatedStringText(SyntaxFactory.Token(\n                                                leading: default,\n                                                SyntaxKind.InterpolatedStringTextToken,\n                                                \"'\",\n                                                \"'\",\n                                                trailing: default)),\n                                        }))))),\n                                initializer: null)))),\n                    SyntaxFactory.ReturnStatement(SyntaxFactory.ObjectCreationExpression(\n                        type: SyntaxFactory.IdentifierName(nodeData.WrapperName),\n                        argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Argument(\n                            SyntaxFactory.CastExpression(\n                                type: SyntaxFactory.IdentifierName(concreteBase),\n                                expression: SyntaxFactory.IdentifierName(\"node\"))))),\n                        initializer: null))),\n                expressionBody: null,\n                semicolonToken: default);\n\n            if (first)\n            {\n                nodeConversion = nodeConversion.WithLeadingBlankLine();\n                first = false;\n            }\n\n            members = members.Add(nodeConversion);\n\n            for (var baseNode = syntaxData.TryGetNode(nodeData.BaseName); baseNode?.WrapperName is not null; baseNode = syntaxData.TryGetNode(baseNode.BaseName))\n            {\n                // public static implicit operator BaseSyntaxWrapper(SyntaxWrapper wrapper)\n                // {\n                //     return BaseSyntaxWrapper.FromUpcast(wrapper.node);\n                // }\n                members = members.Add(SyntaxFactory.ConversionOperatorDeclaration(\n                    attributeLists: default,\n                    modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PublicKeyword), SyntaxFactory.Token(SyntaxKind.StaticKeyword)),\n                    implicitOrExplicitKeyword: SyntaxFactory.Token(SyntaxKind.ImplicitKeyword),\n                    operatorKeyword: SyntaxFactory.Token(SyntaxKind.OperatorKeyword),\n                    type: SyntaxFactory.IdentifierName(baseNode.WrapperName),\n                    parameterList: SyntaxFactory.ParameterList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Parameter(\n                        attributeLists: default,\n                        modifiers: default,\n                        type: SyntaxFactory.IdentifierName(nodeData.WrapperName),\n                        identifier: SyntaxFactory.Identifier(\"wrapper\"),\n                        @default: null))),\n                    body: SyntaxFactory.Block(SyntaxFactory.ReturnStatement(\n                        SyntaxFactory.InvocationExpression(\n                            expression: SyntaxFactory.MemberAccessExpression(\n                                SyntaxKind.SimpleMemberAccessExpression,\n                                expression: SyntaxFactory.IdentifierName(baseNode.WrapperName),\n                                name: SyntaxFactory.IdentifierName(\"FromUpcast\")),\n                            argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Argument(\n                                SyntaxFactory.MemberAccessExpression(\n                                    SyntaxKind.SimpleMemberAccessExpression,\n                                    expression: SyntaxFactory.IdentifierName(\"wrapper\"),\n                                    name: SyntaxFactory.IdentifierName(\"node\")))))))),\n                    expressionBody: null,\n                    semicolonToken: default));\n            }\n\n            // public static implicit operator CSharpSyntaxNode(SyntaxWrapper wrapper)\n            // {\n            //     return wrapper.node;\n            // }\n            members = members.Add(SyntaxFactory.ConversionOperatorDeclaration(\n                attributeLists: default,\n                modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PublicKeyword), SyntaxFactory.Token(SyntaxKind.StaticKeyword)),\n                implicitOrExplicitKeyword: SyntaxFactory.Token(SyntaxKind.ImplicitKeyword),\n                operatorKeyword: SyntaxFactory.Token(SyntaxKind.OperatorKeyword),\n                type: SyntaxFactory.IdentifierName(concreteBase),\n                parameterList: SyntaxFactory.ParameterList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Parameter(\n                    attributeLists: default,\n                    modifiers: default,\n                    type: SyntaxFactory.IdentifierName(nodeData.WrapperName),\n                    identifier: SyntaxFactory.Identifier(\"wrapper\"),\n                    @default: null))),\n                body: SyntaxFactory.Block(SyntaxFactory.ReturnStatement(SyntaxFactory.MemberAccessExpression(\n                    SyntaxKind.SimpleMemberAccessExpression,\n                    expression: SyntaxFactory.IdentifierName(\"wrapper\"),\n                    name: SyntaxFactory.IdentifierName(\"node\")))),\n                expressionBody: null,\n                semicolonToken: default));\n\n            // public static bool IsInstance(SyntaxNode node)\n            // {\n            //     return node != null && LightupHelpers.CanWrapNode(node, WrappedType);\n            // }\n            members = members.Add(SyntaxFactory.MethodDeclaration(\n                attributeLists: default,\n                modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PublicKeyword), SyntaxFactory.Token(SyntaxKind.StaticKeyword)),\n                returnType: SyntaxFactory.PredefinedType(SyntaxFactory.Token(SyntaxKind.BoolKeyword)),\n                explicitInterfaceSpecifier: null,\n                identifier: SyntaxFactory.Identifier(\"IsInstance\"),\n                typeParameterList: null,\n                parameterList: SyntaxFactory.ParameterList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Parameter(\n                    attributeLists: default,\n                    modifiers: default,\n                    type: SyntaxFactory.IdentifierName(\"SyntaxNode\"),\n                    identifier: SyntaxFactory.Identifier(\"node\"),\n                    @default: null))),\n                constraintClauses: default,\n                body: SyntaxFactory.Block(\n                    SyntaxFactory.ReturnStatement(SyntaxFactory.BinaryExpression(\n                        SyntaxKind.LogicalAndExpression,\n                        left: SyntaxFactory.BinaryExpression(\n                            SyntaxKind.NotEqualsExpression,\n                            left: SyntaxFactory.IdentifierName(\"node\"),\n                            right: SyntaxFactory.LiteralExpression(SyntaxKind.NullLiteralExpression)),\n                        right: SyntaxFactory.InvocationExpression(\n                            expression: SyntaxFactory.MemberAccessExpression(\n                                SyntaxKind.SimpleMemberAccessExpression,\n                                expression: SyntaxFactory.IdentifierName(\"LightupHelpers\"),\n                                name: SyntaxFactory.IdentifierName(\"CanWrapNode\")),\n                            argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SeparatedList(\n                                new[]\n                                {\n                                    SyntaxFactory.Argument(SyntaxFactory.IdentifierName(\"node\")),\n                                    SyntaxFactory.Argument(SyntaxFactory.IdentifierName(\"WrappedType\")),\n                                })))))),\n                expressionBody: null));\n\n            foreach (var field in nodeData.Fields)\n            {\n                if (field.IsSkipped)\n                {\n                    continue;\n                }\n\n                string valueName = char.ToLowerInvariant(field.Name[0]) + field.Name.Substring(1);\n\n                ExpressionSyntax convertedValue = SyntaxFactory.IdentifierName(valueName);\n\n                TypeSyntax propertyType = SyntaxFactory.ParseTypeName(field.GetAccessorResultType(syntaxData));\n                if (syntaxData.TryGetNode(field.Type) is { WrapperName: { } wrapperName })\n                {\n                    propertyType = SyntaxFactory.IdentifierName(wrapperName);\n                }\n\n                ExpressionSyntax returnExpression = SyntaxFactory.InvocationExpression(\n                    expression: SyntaxFactory.IdentifierName(field.WithAccessorName),\n                    argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SeparatedList(\n                        new[]\n                        {\n                            SyntaxFactory.Argument(SyntaxFactory.MemberAccessExpression(\n                                SyntaxKind.SimpleMemberAccessExpression,\n                                expression: SyntaxFactory.ThisExpression(),\n                                name: SyntaxFactory.IdentifierName(\"SyntaxNode\"))),\n                            SyntaxFactory.Argument(convertedValue),\n                        })));\n\n                // public SyntaxWrapper WithField(T value)\n                // {\n                //     return new SyntaxWrapper(...);\n                // }\n                members = members.Add(SyntaxFactory.MethodDeclaration(\n                    attributeLists: default,\n                    modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PublicKeyword)),\n                    returnType: SyntaxFactory.IdentifierName(nodeData.WrapperName),\n                    explicitInterfaceSpecifier: null,\n                    identifier: SyntaxFactory.Identifier(\"With\" + field.Name),\n                    typeParameterList: null,\n                    parameterList: SyntaxFactory.ParameterList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Parameter(\n                        attributeLists: default,\n                        modifiers: default,\n                        type: propertyType,\n                        identifier: SyntaxFactory.Identifier(valueName),\n                        @default: null))),\n                    constraintClauses: default,\n                    body: SyntaxFactory.Block(SyntaxFactory.ReturnStatement(\n                        SyntaxFactory.ObjectCreationExpression(\n                            type: SyntaxFactory.IdentifierName(nodeData.WrapperName),\n                            argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Argument(returnExpression))),\n                            initializer: null))),\n                    expressionBody: null,\n                    semicolonToken: default));\n            }\n\n            if (nodeData.Kind == NodeKind.Abstract)\n            {\n                // internal static SyntaxWrapper FromUpcast(CSharpSyntaxNode node)\n                // {\n                //     return new SyntaxWrapper(node);\n                // }\n                members = members.Add(SyntaxFactory.MethodDeclaration(\n                    attributeLists: default,\n                    modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PublicKeyword), SyntaxFactory.Token(SyntaxKind.StaticKeyword)), // Sonar: changed to PublicKeyword\n                    returnType: SyntaxFactory.IdentifierName(nodeData.WrapperName),\n                    explicitInterfaceSpecifier: null,\n                    identifier: SyntaxFactory.Identifier(\"FromUpcast\"),\n                    typeParameterList: null,\n                    parameterList: SyntaxFactory.ParameterList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Parameter(\n                        attributeLists: default,\n                        modifiers: default,\n                        type: SyntaxFactory.IdentifierName(concreteBase),\n                        identifier: SyntaxFactory.Identifier(\"node\"),\n                        @default: null))),\n                    constraintClauses: default,\n                    body: SyntaxFactory.Block(\n                        SyntaxFactory.ReturnStatement(SyntaxFactory.ObjectCreationExpression(\n                            type: SyntaxFactory.IdentifierName(nodeData.WrapperName),\n                            argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Argument(SyntaxFactory.IdentifierName(\"node\")))),\n                            initializer: null))),\n                    expressionBody: null));\n            }\n\n            var wrapperStruct = SyntaxFactory.StructDeclaration(\n                attributeLists: default,\n                modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PublicKeyword), SyntaxFactory.Token(SyntaxKind.ReadOnlyKeyword), SyntaxFactory.Token(SyntaxKind.PartialKeyword)), // Sonar: changed to PublicKeyword\n                identifier: SyntaxFactory.Identifier(nodeData.WrapperName),\n                typeParameterList: null,\n                baseList: SyntaxFactory.BaseList(SyntaxFactory.SingletonSeparatedList<BaseTypeSyntax>(\n                    SyntaxFactory.SimpleBaseType(SyntaxFactory.GenericName(\n                        identifier: SyntaxFactory.Identifier(\"ISyntaxWrapper\"),\n                        typeArgumentList: SyntaxFactory.TypeArgumentList(SyntaxFactory.SingletonSeparatedList<TypeSyntax>(SyntaxFactory.IdentifierName(concreteBase))))))),\n                constraintClauses: default,\n                members: members);\n            var wrapperNamespace = SyntaxFactory.NamespaceDeclaration(\n                name: SyntaxFactory.ParseName(\"StyleCop.Analyzers.Lightup\"),\n                externs: default,\n                usings: SyntaxFactory.List<UsingDirectiveSyntax>()\n                    .Add(SyntaxFactory.UsingDirective(SyntaxFactory.ParseName(\"System\")))\n                    .Add(SyntaxFactory.UsingDirective(SyntaxFactory.ParseName(\"System.Collections.Immutable\")))\n                    .Add(SyntaxFactory.UsingDirective(SyntaxFactory.ParseName(\"Microsoft.CodeAnalysis\")))\n                    .Add(SyntaxFactory.UsingDirective(SyntaxFactory.ParseName(\"Microsoft.CodeAnalysis.CSharp\")))\n                    .Add(SyntaxFactory.UsingDirective(SyntaxFactory.ParseName(\"Microsoft.CodeAnalysis.CSharp.Syntax\"))),\n                members: SyntaxFactory.SingletonList<MemberDeclarationSyntax>(wrapperStruct));\n\n            wrapperNamespace = wrapperNamespace\n                .NormalizeWhitespace()\n                .WithLeadingTrivia(\n                    SyntaxFactory.Comment(\"// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.\"),\n                    SyntaxFactory.CarriageReturnLineFeed,\n                    SyntaxFactory.Comment(\"// Licensed under the MIT License. See LICENSE in the project root for license information.\"),\n                    SyntaxFactory.CarriageReturnLineFeed,\n                    SyntaxFactory.CarriageReturnLineFeed)\n                .WithTrailingTrivia(\n                    SyntaxFactory.CarriageReturnLineFeed);\n\n            context.AddSource(nodeData.WrapperName + \".g.cs\", wrapperNamespace.GetText(Encoding.UTF8));\n        }\n\n        private void GenerateSyntaxWrapperHelper(in SourceProductionContext context, ImmutableArray<NodeData> wrapperTypes)\n        {\n            // private static readonly ImmutableDictionary<Type, Type> WrappedTypes;\n            var wrappedTypes = SyntaxFactory.FieldDeclaration(\n                attributeLists: default,\n                modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PrivateKeyword), SyntaxFactory.Token(SyntaxKind.StaticKeyword), SyntaxFactory.Token(SyntaxKind.ReadOnlyKeyword)),\n                declaration: SyntaxFactory.VariableDeclaration(\n                    type: SyntaxFactory.GenericName(\n                        identifier: SyntaxFactory.Identifier(\"ImmutableDictionary\"),\n                        typeArgumentList: SyntaxFactory.TypeArgumentList(\n                            SyntaxFactory.SeparatedList<TypeSyntax>(\n                                new[]\n                                {\n                                    SyntaxFactory.IdentifierName(\"Type\"),\n                                    SyntaxFactory.IdentifierName(\"Type\"),\n                                }))),\n                    variables: SyntaxFactory.SingletonSeparatedList(SyntaxFactory.VariableDeclarator(SyntaxFactory.Identifier(\"WrappedTypes\")))));\n\n            // var csharpCodeAnalysisAssembly = typeof(CSharpSyntaxNode).GetTypeInfo().Assembly;\n            // var builder = ImmutableDictionary.CreateBuilder<Type, Type>();\n            var staticCtorStatements = SyntaxFactory.List<StatementSyntax>()\n                .Add(SyntaxFactory.LocalDeclarationStatement(SyntaxFactory.VariableDeclaration(\n                    type: SyntaxFactory.IdentifierName(\"var\"),\n                    variables: SyntaxFactory.SingletonSeparatedList(SyntaxFactory.VariableDeclarator(\n                        identifier: SyntaxFactory.Identifier(\"csharpCodeAnalysisAssembly\"),\n                        argumentList: null,\n                        initializer: SyntaxFactory.EqualsValueClause(\n                            SyntaxFactory.MemberAccessExpression(\n                                SyntaxKind.SimpleMemberAccessExpression,\n                                expression: SyntaxFactory.InvocationExpression(\n                                    SyntaxFactory.MemberAccessExpression(\n                                        SyntaxKind.SimpleMemberAccessExpression,\n                                        expression: SyntaxFactory.TypeOfExpression(SyntaxFactory.IdentifierName(\"CSharpSyntaxNode\")),\n                                        name: SyntaxFactory.IdentifierName(\"GetTypeInfo\"))),\n                                name: SyntaxFactory.IdentifierName(\"Assembly\"))))))))\n                .Add(SyntaxFactory.LocalDeclarationStatement(SyntaxFactory.VariableDeclaration(\n                    type: SyntaxFactory.IdentifierName(\"var\"),\n                    variables: SyntaxFactory.SingletonSeparatedList(SyntaxFactory.VariableDeclarator(\n                        identifier: SyntaxFactory.Identifier(\"builder\"),\n                        argumentList: null,\n                        initializer: SyntaxFactory.EqualsValueClause(\n                            SyntaxFactory.InvocationExpression(\n                                SyntaxFactory.MemberAccessExpression(\n                                    SyntaxKind.SimpleMemberAccessExpression,\n                                    expression: SyntaxFactory.IdentifierName(\"ImmutableDictionary\"),\n                                    name: SyntaxFactory.GenericName(\n                                        identifier: SyntaxFactory.Identifier(\"CreateBuilder\"),\n                                        typeArgumentList: SyntaxFactory.TypeArgumentList(\n                                            SyntaxFactory.SeparatedList<TypeSyntax>(\n                                                new[]\n                                                {\n                                                    SyntaxFactory.IdentifierName(\"Type\"),\n                                                    SyntaxFactory.IdentifierName(\"Type\"),\n                                                })))))))))));\n\n            foreach (var node in wrapperTypes.OrderBy(node => node.Name, StringComparer.OrdinalIgnoreCase))\n            {\n                if (node.WrapperName is null || node.Name is\n                    nameof(AnonymousFunctionExpressionSyntax)\n                    or nameof(ClassDeclarationSyntax)\n                    or nameof(LambdaExpressionSyntax)\n                    or nameof(ParenthesizedLambdaExpressionSyntax)\n                    or nameof(SimpleLambdaExpressionSyntax)\n                    or nameof(StructDeclarationSyntax))\n                {\n                    continue;\n                }\n\n                if (node.Name == nameof(CommonForEachStatementSyntax))\n                {\n                    // Prior to C# 7, ForEachStatementSyntax was the base type for all foreach statements. If\n                    // the CommonForEachStatementSyntax type isn't found at runtime, we fall back to using this type instead.\n                    //\n                    // var forEachStatementSyntaxType = csharpCodeAnalysisAssembly.GetType(CommonForEachStatementSyntaxWrapper.WrappedTypeName)\n                    //     ?? csharpCodeAnalysisAssembly.GetType(CommonForEachStatementSyntaxWrapper.FallbackWrappedTypeName);\n                    staticCtorStatements = staticCtorStatements.Add(\n                        SyntaxFactory.LocalDeclarationStatement(SyntaxFactory.VariableDeclaration(\n                            type: SyntaxFactory.IdentifierName(\"var\"),\n                            variables: SyntaxFactory.SingletonSeparatedList(SyntaxFactory.VariableDeclarator(\n                                identifier: SyntaxFactory.Identifier(\"forEachStatementSyntaxType\"),\n                                argumentList: null,\n                                initializer: SyntaxFactory.EqualsValueClause(\n                                    SyntaxFactory.BinaryExpression(\n                                        SyntaxKind.CoalesceExpression,\n                                        left: SyntaxFactory.InvocationExpression(\n                                            expression: SyntaxFactory.MemberAccessExpression(\n                                                SyntaxKind.SimpleMemberAccessExpression,\n                                                expression: SyntaxFactory.IdentifierName(\"csharpCodeAnalysisAssembly\"),\n                                                name: SyntaxFactory.IdentifierName(\"GetType\")),\n                                            argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Argument(\n                                                SyntaxFactory.MemberAccessExpression(\n                                                    SyntaxKind.SimpleMemberAccessExpression,\n                                                    expression: SyntaxFactory.IdentifierName(node.WrapperName),\n                                                    name: SyntaxFactory.IdentifierName(\"WrappedTypeName\")))))),\n                                        right: SyntaxFactory.InvocationExpression(\n                                            expression: SyntaxFactory.MemberAccessExpression(\n                                                SyntaxKind.SimpleMemberAccessExpression,\n                                                expression: SyntaxFactory.IdentifierName(\"csharpCodeAnalysisAssembly\"),\n                                                name: SyntaxFactory.IdentifierName(\"GetType\")),\n                                            argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Argument(\n                                                SyntaxFactory.MemberAccessExpression(\n                                                    SyntaxKind.SimpleMemberAccessExpression,\n                                                    expression: SyntaxFactory.IdentifierName(node.WrapperName),\n                                                    name: SyntaxFactory.IdentifierName(\"FallbackWrappedTypeName\")))))))))))));\n\n                    // builder.Add(typeof(CommonForEachStatementSyntaxWrapper), forEachStatementSyntaxType);\n                    staticCtorStatements = staticCtorStatements.Add(SyntaxFactory.ExpressionStatement(\n                        SyntaxFactory.InvocationExpression(\n                            expression: SyntaxFactory.MemberAccessExpression(\n                                SyntaxKind.SimpleMemberAccessExpression,\n                                expression: SyntaxFactory.IdentifierName(\"builder\"),\n                                name: SyntaxFactory.IdentifierName(\"Add\")),\n                            argumentList: SyntaxFactory.ArgumentList(\n                                SyntaxFactory.SeparatedList(\n                                    new[]\n                                    {\n                                        SyntaxFactory.Argument(SyntaxFactory.TypeOfExpression(SyntaxFactory.IdentifierName(node.WrapperName))),\n                                        SyntaxFactory.Argument(SyntaxFactory.IdentifierName(\"forEachStatementSyntaxType\")),\n                                    })))));\n\n                    continue;\n                }\n\n                if (node.Name == nameof(BaseObjectCreationExpressionSyntax))\n                {\n                    // Prior to C# 9, ObjectCreationExpressionSyntax was the base type for all object creation\n                    // statements. If the BaseObjectCreationExpressionSyntax type isn't found at runtime, we fall back\n                    // to using this type instead.\n                    //\n                    // var objectCreationExpressionSyntaxType = csharpCodeAnalysisAssembly.GetType(BaseObjectCreationExpressionSyntaxWrapper.WrappedTypeName)\n                    //     ?? csharpCodeAnalysisAssembly.GetType(BaseObjectCreationExpressionSyntaxWrapper.FallbackWrappedTypeName);\n                    LocalDeclarationStatementSyntax localStatement =\n                        SyntaxFactory.LocalDeclarationStatement(SyntaxFactory.VariableDeclaration(\n                            type: SyntaxFactory.IdentifierName(\"var\"),\n                            variables: SyntaxFactory.SingletonSeparatedList(SyntaxFactory.VariableDeclarator(\n                                identifier: SyntaxFactory.Identifier(\"objectCreationExpressionSyntaxType\"),\n                                argumentList: null,\n                                initializer: SyntaxFactory.EqualsValueClause(\n                                    SyntaxFactory.BinaryExpression(\n                                        SyntaxKind.CoalesceExpression,\n                                        left: SyntaxFactory.InvocationExpression(\n                                            expression: SyntaxFactory.MemberAccessExpression(\n                                                SyntaxKind.SimpleMemberAccessExpression,\n                                                expression: SyntaxFactory.IdentifierName(\"csharpCodeAnalysisAssembly\"),\n                                                name: SyntaxFactory.IdentifierName(\"GetType\")),\n                                            argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Argument(\n                                                SyntaxFactory.MemberAccessExpression(\n                                                    SyntaxKind.SimpleMemberAccessExpression,\n                                                    expression: SyntaxFactory.IdentifierName(node.WrapperName),\n                                                    name: SyntaxFactory.IdentifierName(\"WrappedTypeName\")))))),\n                                        right: SyntaxFactory.InvocationExpression(\n                                            expression: SyntaxFactory.MemberAccessExpression(\n                                                SyntaxKind.SimpleMemberAccessExpression,\n                                                expression: SyntaxFactory.IdentifierName(\"csharpCodeAnalysisAssembly\"),\n                                                name: SyntaxFactory.IdentifierName(\"GetType\")),\n                                            argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Argument(\n                                                SyntaxFactory.MemberAccessExpression(\n                                                    SyntaxKind.SimpleMemberAccessExpression,\n                                                    expression: SyntaxFactory.IdentifierName(node.WrapperName),\n                                                    name: SyntaxFactory.IdentifierName(\"FallbackWrappedTypeName\"))))))))))));\n\n                    // This is the first line of the statements that initialize 'builder', so start it with a blank line\n                    staticCtorStatements = staticCtorStatements.Add(localStatement.WithLeadingBlankLine());\n\n                    // builder.Add(typeof(BaseObjectCreationExpressionSyntaxWrapper), objectCreationExpressionSyntaxType);\n                    staticCtorStatements = staticCtorStatements.Add(SyntaxFactory.ExpressionStatement(\n                        SyntaxFactory.InvocationExpression(\n                            expression: SyntaxFactory.MemberAccessExpression(\n                                SyntaxKind.SimpleMemberAccessExpression,\n                                expression: SyntaxFactory.IdentifierName(\"builder\"),\n                                name: SyntaxFactory.IdentifierName(\"Add\")),\n                            argumentList: SyntaxFactory.ArgumentList(\n                                SyntaxFactory.SeparatedList(\n                                    new[]\n                                    {\n                                        SyntaxFactory.Argument(SyntaxFactory.TypeOfExpression(SyntaxFactory.IdentifierName(node.WrapperName))),\n                                        SyntaxFactory.Argument(SyntaxFactory.IdentifierName(\"objectCreationExpressionSyntaxType\")),\n                                    })))));\n\n                    continue;\n                }\n\n                if (node.Name == nameof(BaseNamespaceDeclarationSyntax))\n                {\n                    // Prior to C# 10, NamespaceDeclarationSyntax was the base type for all namespace declarations.\n                    // If the BaseNamespaceDeclarationSyntax type isn't found at runtime, we fall back\n                    // to using this type instead.\n                    //\n                    // var baseNamespaceDeclarationSyntaxType = csharpCodeAnalysisAssembly.GetType(BaseNamespaceDeclarationSyntaxWrapper.WrappedTypeName)\n                    //     ?? csharpCodeAnalysisAssembly.GetType(BaseNamespaceDeclarationSyntaxWrapper.WrappedTypeName);\n                    LocalDeclarationStatementSyntax localStatement =\n                        SyntaxFactory.LocalDeclarationStatement(SyntaxFactory.VariableDeclaration(\n                            type: SyntaxFactory.IdentifierName(\"var\"),\n                            variables: SyntaxFactory.SingletonSeparatedList(SyntaxFactory.VariableDeclarator(\n                                identifier: SyntaxFactory.Identifier(\"baseNamespaceDeclarationSyntaxType\"),\n                                argumentList: null,\n                                initializer: SyntaxFactory.EqualsValueClause(\n                                    SyntaxFactory.BinaryExpression(\n                                        SyntaxKind.CoalesceExpression,\n                                        left: SyntaxFactory.InvocationExpression(\n                                            expression: SyntaxFactory.MemberAccessExpression(\n                                                SyntaxKind.SimpleMemberAccessExpression,\n                                                expression: SyntaxFactory.IdentifierName(\"csharpCodeAnalysisAssembly\"),\n                                                name: SyntaxFactory.IdentifierName(\"GetType\")),\n                                            argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Argument(\n                                                SyntaxFactory.MemberAccessExpression(\n                                                    SyntaxKind.SimpleMemberAccessExpression,\n                                                    expression: SyntaxFactory.IdentifierName(node.WrapperName),\n                                                    name: SyntaxFactory.IdentifierName(\"WrappedTypeName\")))))),\n                                        right: SyntaxFactory.InvocationExpression(\n                                            expression: SyntaxFactory.MemberAccessExpression(\n                                                SyntaxKind.SimpleMemberAccessExpression,\n                                                expression: SyntaxFactory.IdentifierName(\"csharpCodeAnalysisAssembly\"),\n                                                name: SyntaxFactory.IdentifierName(\"GetType\")),\n                                            argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Argument(\n                                                SyntaxFactory.MemberAccessExpression(\n                                                    SyntaxKind.SimpleMemberAccessExpression,\n                                                    expression: SyntaxFactory.IdentifierName(node.WrapperName),\n                                                    name: SyntaxFactory.IdentifierName(\"FallbackWrappedTypeName\"))))))))))));\n\n                    // This is the first line of the statements that initialize 'builder', so start it with a blank line\n                    staticCtorStatements = staticCtorStatements.Add(localStatement.WithLeadingBlankLine());\n\n                    // builder.Add(typeof(BaseNamespaceDeclarationSyntaxWrapper), baseNamespaceDeclarationSyntaxType);\n                    staticCtorStatements = staticCtorStatements.Add(SyntaxFactory.ExpressionStatement(\n                        SyntaxFactory.InvocationExpression(\n                            expression: SyntaxFactory.MemberAccessExpression(\n                                SyntaxKind.SimpleMemberAccessExpression,\n                                expression: SyntaxFactory.IdentifierName(\"builder\"),\n                                name: SyntaxFactory.IdentifierName(\"Add\")),\n                            argumentList: SyntaxFactory.ArgumentList(\n                                SyntaxFactory.SeparatedList(\n                                    new[]\n                                    {\n                                        SyntaxFactory.Argument(SyntaxFactory.TypeOfExpression(SyntaxFactory.IdentifierName(node.WrapperName))),\n                                        SyntaxFactory.Argument(SyntaxFactory.IdentifierName(\"baseNamespaceDeclarationSyntaxType\")),\n                                    })))));\n\n                    continue;\n                }\n\n                // builder.Add(typeof(ConstantPatternSyntaxWrapper), csharpCodeAnalysisAssembly.GetType(ConstantPatternSyntaxWrapper.WrappedTypeName));\n                staticCtorStatements = staticCtorStatements.Add(SyntaxFactory.ExpressionStatement(\n                    SyntaxFactory.InvocationExpression(\n                        expression: SyntaxFactory.MemberAccessExpression(\n                            SyntaxKind.SimpleMemberAccessExpression,\n                            expression: SyntaxFactory.IdentifierName(\"builder\"),\n                            name: SyntaxFactory.IdentifierName(\"Add\")),\n                        argumentList: SyntaxFactory.ArgumentList(\n                            SyntaxFactory.SeparatedList(\n                                new[]\n                                {\n                                    SyntaxFactory.Argument(SyntaxFactory.TypeOfExpression(SyntaxFactory.IdentifierName(node.WrapperName))),\n                                    SyntaxFactory.Argument(\n                                        SyntaxFactory.InvocationExpression(\n                                            expression: SyntaxFactory.MemberAccessExpression(\n                                                SyntaxKind.SimpleMemberAccessExpression,\n                                                expression: SyntaxFactory.IdentifierName(\"csharpCodeAnalysisAssembly\"),\n                                                name: SyntaxFactory.IdentifierName(\"GetType\")),\n                                            argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Argument(\n                                                SyntaxFactory.MemberAccessExpression(\n                                                    SyntaxKind.SimpleMemberAccessExpression,\n                                                    expression: SyntaxFactory.IdentifierName(node.WrapperName),\n                                                    name: SyntaxFactory.IdentifierName(\"WrappedTypeName\"))))))),\n                                })))));\n            }\n\n            // WrappedTypes = builder.ToImmutable();\n            staticCtorStatements = staticCtorStatements.Add(SyntaxFactory.ExpressionStatement(\n                SyntaxFactory.AssignmentExpression(\n                    SyntaxKind.SimpleAssignmentExpression,\n                    left: SyntaxFactory.IdentifierName(\"WrappedTypes\"),\n                    right: SyntaxFactory.InvocationExpression(\n                        SyntaxFactory.MemberAccessExpression(\n                            SyntaxKind.SimpleMemberAccessExpression,\n                            expression: SyntaxFactory.IdentifierName(\"builder\"),\n                            name: SyntaxFactory.IdentifierName(\"ToImmutable\"))))).WithLeadingBlankLine());\n\n            var staticCtor = SyntaxFactory.ConstructorDeclaration(\n                attributeLists: default,\n                modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.StaticKeyword)),\n                identifier: SyntaxFactory.Identifier(\"SyntaxWrapperHelper\"),\n                parameterList: SyntaxFactory.ParameterList(),\n                initializer: null,\n                body: SyntaxFactory.Block(staticCtorStatements),\n                expressionBody: null).WithLeadingBlankLine();\n\n            // /// <summary>\n            // /// Gets the type that is wrapped by the given wrapper.\n            // /// </summary>\n            // /// <param name=\"wrapperType\">Type of the wrapper for which the wrapped type should be retrieved.</param>\n            // /// <returns>The wrapped type, or null if there is no info.</returns>\n            // internal static Type GetWrappedType(Type wrapperType)\n            // {\n            //     if (WrappedTypes.TryGetValue(wrapperType, out Type wrappedType))\n            //     {\n            //         return wrappedType;\n            //     }\n            //\n            //     return null;\n            // }\n            var getWrappedType = SyntaxFactory.MethodDeclaration(\n                attributeLists: default,\n                modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PublicKeyword), SyntaxFactory.Token(SyntaxKind.StaticKeyword)), // Sonar: changed to PublicKeyword\n                returnType: SyntaxFactory.IdentifierName(\"Type\"),\n                explicitInterfaceSpecifier: null,\n                identifier: SyntaxFactory.Identifier(\"GetWrappedType\"),\n                typeParameterList: null,\n                parameterList: SyntaxFactory.ParameterList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Parameter(\n                    attributeLists: default,\n                    modifiers: default,\n                    type: SyntaxFactory.IdentifierName(\"Type\"),\n                    identifier: SyntaxFactory.Identifier(\"wrapperType\"),\n                    @default: null))),\n                constraintClauses: default,\n                body: SyntaxFactory.Block(\n                    SyntaxFactory.IfStatement(\n                        condition: SyntaxFactory.InvocationExpression(\n                            expression: SyntaxFactory.MemberAccessExpression(\n                                SyntaxKind.SimpleMemberAccessExpression,\n                                expression: SyntaxFactory.IdentifierName(\"WrappedTypes\"),\n                                name: SyntaxFactory.IdentifierName(\"TryGetValue\")),\n                            argumentList: SyntaxFactory.ArgumentList(SyntaxFactory.SeparatedList(\n                                new[]\n                                {\n                                    SyntaxFactory.Argument(SyntaxFactory.IdentifierName(\"wrapperType\")),\n                                    SyntaxFactory.Argument(\n                                        nameColon: null,\n                                        refKindKeyword: SyntaxFactory.Token(SyntaxKind.OutKeyword),\n                                        expression: SyntaxFactory.DeclarationExpression(\n                                            type: SyntaxFactory.IdentifierName(\"Type\"),\n                                            designation: SyntaxFactory.SingleVariableDesignation(SyntaxFactory.Identifier(\"wrappedType\")))),\n                                }))),\n                        statement: SyntaxFactory.Block(\n                            SyntaxFactory.ReturnStatement(SyntaxFactory.IdentifierName(\"wrappedType\")))),\n                    SyntaxFactory.ReturnStatement(SyntaxFactory.LiteralExpression(SyntaxKind.NullLiteralExpression))),\n                expressionBody: null);\n\n            getWrappedType = getWrappedType.WithLeadingTrivia(SyntaxFactory.TriviaList(\n                SyntaxFactory.Trivia(SyntaxFactory.DocumentationComment(\n                    SyntaxFactory.XmlText(\" \"),\n                    SyntaxFactory.XmlSummaryElement(\n                        SyntaxFactory.XmlText(XmlSyntaxFactory.XmlCarriageReturnLineFeedWithContinuation),\n                        SyntaxFactory.XmlText(\" Gets the type that is wrapped by the given wrapper.\"),\n                        SyntaxFactory.XmlText(XmlSyntaxFactory.XmlCarriageReturnLineFeedWithContinuation),\n                        SyntaxFactory.XmlText(\" \")),\n                    SyntaxFactory.XmlText(XmlSyntaxFactory.XmlCarriageReturnLineFeedWithContinuation),\n                    SyntaxFactory.XmlText(\" \"),\n                    SyntaxFactory.XmlParamElement(\n                        \"wrapperType\",\n                        SyntaxFactory.XmlText(\"Type of the wrapper for which the wrapped type should be retrieved.\")),\n                    SyntaxFactory.XmlText(XmlSyntaxFactory.XmlCarriageReturnLineFeedWithContinuation),\n                    SyntaxFactory.XmlText(\" \"),\n                    SyntaxFactory.XmlReturnsElement(\n                        SyntaxFactory.XmlText(\"The wrapped type, or null if there is no info.\")),\n                    SyntaxFactory.XmlText(XmlSyntaxFactory.XmlCarriageReturnLineFeedWithContinuation).WithoutTrailingTrivia()))));\n\n            var wrapperHelperClass = SyntaxFactory.ClassDeclaration(\n                attributeLists: default,\n                modifiers: SyntaxTokenList.Create(SyntaxFactory.Token(SyntaxKind.PublicKeyword)).Add(SyntaxFactory.Token(SyntaxKind.StaticKeyword)), // Sonar: changed to PublicKeyword\n                identifier: SyntaxFactory.Identifier(\"SyntaxWrapperHelper\"),\n                typeParameterList: null,\n                baseList: null,\n                constraintClauses: default,\n                members: SyntaxFactory.List<MemberDeclarationSyntax>()\n                    .Add(wrappedTypes)\n                    .Add(staticCtor)\n                    .Add(getWrappedType));\n            var wrapperNamespace = SyntaxFactory.NamespaceDeclaration(\n                name: SyntaxFactory.ParseName(\"StyleCop.Analyzers.Lightup\"),\n                externs: default,\n                usings: SyntaxFactory.List<UsingDirectiveSyntax>()\n                    .Add(SyntaxFactory.UsingDirective(SyntaxFactory.ParseName(\"System\")))\n                    .Add(SyntaxFactory.UsingDirective(SyntaxFactory.ParseName(\"System.Collections.Immutable\")))\n                    .Add(SyntaxFactory.UsingDirective(SyntaxFactory.ParseName(\"System.Reflection\")))\n                    .Add(SyntaxFactory.UsingDirective(SyntaxFactory.ParseName(\"Microsoft.CodeAnalysis\")))\n                    .Add(SyntaxFactory.UsingDirective(SyntaxFactory.ParseName(\"Microsoft.CodeAnalysis.CSharp\"))),\n                members: SyntaxFactory.SingletonList<MemberDeclarationSyntax>(wrapperHelperClass));\n\n            wrapperNamespace = wrapperNamespace\n                .NormalizeWhitespace()\n                .WithLeadingTrivia(\n                    SyntaxFactory.Comment(\"// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.\"),\n                    SyntaxFactory.CarriageReturnLineFeed,\n                    SyntaxFactory.Comment(\"// Licensed under the MIT License. See LICENSE in the project root for license information.\"),\n                    SyntaxFactory.CarriageReturnLineFeed,\n                    SyntaxFactory.CarriageReturnLineFeed)\n                .WithTrailingTrivia(\n                    SyntaxFactory.CarriageReturnLineFeed);\n\n            context.AddSource(\"SyntaxWrapperHelper.g.cs\", wrapperNamespace.GetText(Encoding.UTF8));\n        }\n\n        private sealed class SyntaxData\n        {\n            private readonly Dictionary<string, NodeData> nameToNode;\n\n            public SyntaxData(CompilationData compilationData, XDocument document)\n            {\n                var nodesBuilder = ImmutableArray.CreateBuilder<NodeData>();\n                if (document.XPathSelectElement(\"/Tree[@Root='SyntaxNode']\") is { } tree)\n                {\n                    foreach (var element in tree.XPathSelectElements(\"PredefinedNode|AbstractNode|Node\"))\n                    {\n                        nodesBuilder.Add(new NodeData(compilationData, element));\n                    }\n                }\n\n                this.Nodes = nodesBuilder.ToImmutable();\n                this.nameToNode = this.Nodes.ToDictionary(node => node.Name);\n            }\n\n            public ImmutableArray<NodeData> Nodes { get; }\n\n            public NodeData? TryGetConcreteType(NodeData? node)\n            {\n                for (var current = node; current is not null; current = this.TryGetNode(current.BaseName))\n                {\n                    if (current.WrapperName is null)\n                    {\n                        // This is not a wrapper\n                        return current;\n                    }\n                }\n\n                return null;\n            }\n\n            public NodeData? TryGetConcreteBase(NodeData node)\n            {\n                return this.TryGetConcreteType(this.TryGetNode(node.BaseName));\n            }\n\n            public NodeData? TryGetNode(string name)\n            {\n                this.nameToNode.TryGetValue(name, out var node);\n                return node;\n            }\n        }\n\n        private sealed class NodeData\n        {\n            private static readonly ImmutableHashSet<string> ClassesThatShouldBeAlwaysGenerated = ImmutableHashSet.Create<string>( // Sonar\n                nameof(AnonymousFunctionExpressionSyntax),\n                nameof(LambdaExpressionSyntax),\n                nameof(ParenthesizedLambdaExpressionSyntax),\n                nameof(SimpleLambdaExpressionSyntax),\n                // TypeDeclarationSyntaxWrapper causes compatibility problems with ParameterList because the property was first declared in RecordDeclarationSyntax (C#9) and later\n                // moved upwards into TypeDeclarationSyntax (C#12). The forwarding of the accessor in RecordDeclarationSyntax  to the base wrapper does not work for SDK versions\n                // .Net5 to .Net7 as the property is not found in TypeDeclarationSyntax.\n                // Use the `ParameterList(this TypeDeclarationSyntax)` extension method for a unified access instead of adding TypeDeclarationSyntax here.\n                nameof(ClassDeclarationSyntax),\n                nameof(StructDeclarationSyntax));\n\n            public NodeData(CompilationData compilationData, XElement element)\n            {\n                this.Kind = element.Name.LocalName switch\n                {\n                    \"PredefinedNode\" => NodeKind.Predefined,\n                    \"AbstractNode\" => NodeKind.Abstract,\n                    \"Node\" => NodeKind.Concrete,\n                    _ => throw new NotSupportedException($\"Unknown element name '{element.Name}'\"),\n                };\n\n                this.Name = element.RequiredAttribute(\"Name\").Value;\n\n                this.ExistingType = compilationData.ExistingTypes.GetValueOrDefault($\"Microsoft.CodeAnalysis.CSharp.Syntax.{this.Name}\")\n                    ?? compilationData.ExistingTypes.GetValueOrDefault($\"Microsoft.CodeAnalysis.CSharp.{this.Name}\")\n                    ?? compilationData.ExistingTypes.GetValueOrDefault($\"Microsoft.CodeAnalysis.{this.Name}\");\n                if (this.ExistingType is not null && !ClassesThatShouldBeAlwaysGenerated.Contains(this.Name)) // Sonar\n                {\n                    this.WrapperName = null;\n                }\n                else\n                {\n                    this.WrapperName = this.Name + \"Wrapper\";\n                }\n\n                this.BaseName = element.RequiredAttribute(\"Base\").Value;\n                this.Fields = element.XPathSelectElements(\"descendant::Field\").Select(field => new FieldData(this, field)).ToImmutableArray();\n            }\n\n            public NodeKind Kind { get; }\n\n            public string Name { get; }\n\n            public ExistingTypeData? ExistingType { get; }\n\n            public string? WrapperName { get; }\n\n            public string BaseName { get; }\n\n            public ImmutableArray<FieldData> Fields { get; }\n\n            internal FieldData? TryGetField(string name)\n            {\n                return this.Fields.SingleOrDefault(field => field.Name == name);\n            }\n        }\n\n        private sealed class FieldData\n        {\n            private readonly NodeData nodeData;\n\n            public FieldData(NodeData nodeData, XElement element)\n            {\n                this.nodeData = nodeData;\n\n                this.Name = element.RequiredAttribute(\"Name\").Value;\n\n                var type = element.RequiredAttribute(\"Type\").Value;\n                this.Type = type switch\n                {\n                    \"SyntaxList<SyntaxToken>\" => nameof(SyntaxTokenList),\n                    _ => type,\n                };\n\n                this.IsOverride = element.Attribute(\"Override\")?.Value == \"true\";\n\n                this.AccessorName = this.Name + \"Accessor\";\n                this.WithAccessorName = \"With\" + this.Name + \"Accessor\";\n            }\n\n            public bool IsSkipped => false;\n\n            public string Name { get; }\n\n            public string AccessorName { get; }\n\n            public string WithAccessorName { get; }\n\n            public string Type { get; }\n\n            public bool IsOverride { get; }\n\n            /// <summary>\n            /// Gets a value indicating whether this field is implemented as an extension method in the lightup layer.\n            /// </summary>\n            public bool IsExtensionField\n            {\n                get\n                {\n                    return this.nodeData.ExistingType is not null\n                        && !this.nodeData.ExistingType.MemberNames.Contains(this.Name);\n                }\n            }\n\n            public NodeData GetDeclaringNode(SyntaxData syntaxData)\n            {\n                for (var current = this.nodeData; current is not null; current = syntaxData.TryGetNode(current.BaseName))\n                {\n                    var currentField = current.TryGetField(this.Name);\n                    if (currentField is { IsOverride: false })\n                    {\n                        return currentField.nodeData;\n                    }\n                }\n\n                throw new NotSupportedException(\"Unable to find declaring node.\");\n            }\n\n            public bool IsWrappedSeparatedSyntaxList(SyntaxData syntaxData, [NotNullWhen(true)] out NodeData? element)\n            {\n                if (this.Type.StartsWith(\"SeparatedSyntaxList<\") && this.Type.EndsWith(\">\"))\n                {\n                    var elementTypeName = this.Type.Substring(\"SeparatedSyntaxList<\".Length, this.Type.Length - \"SeparatedSyntaxList<\".Length - \">\".Length);\n                    var elementTypeNode = syntaxData.TryGetNode(elementTypeName);\n                    if (elementTypeNode is { WrapperName: not null })\n                    {\n                        element = elementTypeNode;\n                        return true;\n                    }\n                }\n\n                element = null;\n                return false;\n            }\n\n            public string GetAccessorResultType(SyntaxData syntaxData)\n            {\n                var typeNode = syntaxData.TryGetNode(this.Type);\n                if (typeNode is not null)\n                {\n                    return syntaxData.TryGetConcreteType(typeNode)?.Name ?? nameof(SyntaxNode);\n                }\n\n                if (this.IsWrappedSeparatedSyntaxList(syntaxData, out var elementTypeNode))\n                {\n                    return $\"SeparatedSyntaxListWrapper<{elementTypeNode.WrapperName}>\";\n                }\n\n                return this.Type;\n            }\n\n            public string? GetAccessorResultElementType(SyntaxData syntaxData)\n            {\n                if (this.IsWrappedSeparatedSyntaxList(syntaxData, out var elementTypeNode))\n                {\n                    return elementTypeNode.WrapperName;\n                }\n\n                return null;\n            }\n        }\n\n        private sealed record CompilationData\n        {\n            public EquatableValue<ImmutableDictionary<string, ExistingTypeData>> ExistingTypesWrapper { get; } // Sonar\n\n            public ImmutableDictionary<string, ExistingTypeData> ExistingTypes => this.ExistingTypesWrapper.Value;\n\n            public CompilationData(EquatableValue<ImmutableDictionary<string, ExistingTypeData>> ExistingTypesWrapper) // Sonar\n            {\n                this.ExistingTypesWrapper = ExistingTypesWrapper;\n            }\n        }\n\n        private record class ExistingTypeData\n        {\n            public string TypeName { get; } // Sonar\n\n            public EquatableValue<ImmutableArray<string>> MemberNamesWrapper { get; } // Sonar\n\n            public ImmutableArray<string> MemberNames => this.MemberNamesWrapper.Value;\n\n            public ExistingTypeData(string TypeName, EquatableValue<ImmutableArray<string>> MemberNamesWrapper) // Sonar\n            {\n                this.TypeName = TypeName;\n                this.MemberNamesWrapper = MemberNamesWrapper;\n            }\n\n            public static ExistingTypeData FromNamedType(INamedTypeSymbol namedType, string typeName)\n            {\n                var memberNames = ImmutableArray.CreateRange(namedType.GetMembers(), member => member.Name);\n                return new ExistingTypeData(\n                    TypeName: typeName,\n                    MemberNamesWrapper: new EquatableValue<ImmutableArray<string>>(memberNames, ImmutableArrayEqualityComparer<string>.Default));\n            }\n        }\n\n        private sealed class EquatableValue<T> : IEquatable<EquatableValue<T>?>\n        {\n            public EquatableValue(T value, IEqualityComparer<T> comparer)\n            {\n                this.Value = value;\n                this.Comparer = comparer;\n            }\n\n            public T Value { get; }\n\n            public IEqualityComparer<T> Comparer { get; }\n\n            public bool Equals(EquatableValue<T>? other)\n            {\n                if (other is null)\n                {\n                    return false;\n                }\n\n                return this.Comparer.Equals(this.Value, other.Value);\n            }\n        }\n\n        private sealed class ImmutableDictionaryEqualityComparer<TKey, TValue> : IEqualityComparer<ImmutableDictionary<TKey, TValue>?>\n            where TKey : notnull\n        {\n            public static ImmutableDictionaryEqualityComparer<TKey, TValue> Default { get; } = new ImmutableDictionaryEqualityComparer<TKey, TValue>();\n\n            public bool Equals(ImmutableDictionary<TKey, TValue>? x, ImmutableDictionary<TKey, TValue>? y)\n            {\n                if (x == y)\n                {\n                    return true;\n                }\n                else if (x is null || y is null)\n                {\n                    return false;\n                }\n                else if (x.Count != y.Count)\n                {\n                    return false;\n                }\n\n                var keyEqualityComparer = EqualityComparer<TKey>.Default;\n                var valueEqualityComparer = EqualityComparer<TValue>.Default;\n\n                using var first = x.GetEnumerator();\n                using var second = y.GetEnumerator();\n                while (first.MoveNext() && second.MoveNext())\n                {\n                    if (!keyEqualityComparer.Equals(first.Current.Key, second.Current.Key)\n                        || !valueEqualityComparer.Equals(first.Current.Value, second.Current.Value))\n                    {\n                        return false;\n                    }\n                }\n\n                return true;\n            }\n\n            public int GetHashCode(ImmutableDictionary<TKey, TValue>? obj)\n            {\n                if (obj is null)\n                {\n                    return 0;\n                }\n\n                var hashCode = default(RoslynHashCode);\n\n                var keyEqualityComparer = EqualityComparer<TKey>.Default;\n                var valueEqualityComparer = EqualityComparer<TValue>.Default;\n                foreach (var i in obj)\n                {\n                    hashCode.Add(keyEqualityComparer.GetHashCode(i.Key));\n                    hashCode.Add(valueEqualityComparer.GetHashCode(i.Value));\n                }\n\n                return hashCode.ToHashCode();\n            }\n        }\n\n        private sealed class ImmutableArrayEqualityComparer<T> : IEqualityComparer<ImmutableArray<T>>\n        {\n            public static ImmutableArrayEqualityComparer<T> Default { get; } = new ImmutableArrayEqualityComparer<T>();\n\n            public bool Equals(ImmutableArray<T> x, ImmutableArray<T> y)\n            {\n                if (x == y)\n                {\n                    return true;\n                }\n                else if (x == null || y == null)\n                {\n                    return false;\n                }\n                else if (x.Length != y.Length)\n                {\n                    return false;\n                }\n\n                var equalityComparer = EqualityComparer<T>.Default;\n                for (var i = 0; i < x.Length; i++)\n                {\n                    if (!equalityComparer.Equals(x[i], y[i]))\n                    {\n                        return false;\n                    }\n                }\n\n                return true;\n            }\n\n            public int GetHashCode(ImmutableArray<T> obj)\n            {\n                if (obj == null)\n                {\n                    return 0;\n                }\n\n                var hashCode = default(RoslynHashCode);\n\n                var equalityComparer = EqualityComparer<T>.Default;\n                foreach (var i in obj)\n                {\n                    hashCode.Add(equalityComparer.GetHashCode(i));\n                }\n\n                return hashCode.ToHashCode();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.CodeGeneration/XElementExtensions.cs",
    "content": "﻿// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.\n// Licensed under the MIT License. See LICENSE in the project root for license information.\n\nnamespace StyleCop.Analyzers.CodeGeneration\n{\n    using System;\n    using System.Xml.Linq;\n\n    internal static class XElementExtensions\n    {\n        public static XAttribute RequiredAttribute(this XElement element, XName name)\n            => element.Attribute(name) ?? throw new InvalidOperationException($\"Expected attribute '{name}'\");\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.CodeGeneration/XmlSyntaxFactory.cs",
    "content": "﻿// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.\n// Licensed under the MIT License. See LICENSE in the project root for license information.\n\nnamespace StyleCop.Analyzers.CodeGeneration\n{\n    using Microsoft.CodeAnalysis;\n    using Microsoft.CodeAnalysis.CSharp;\n\n    internal static class XmlSyntaxFactory\n    {\n        public const string CrLf = \"\\r\\n\";\n\n        public static SyntaxToken XmlCarriageReturnLineFeedWithContinuation { get; } = SyntaxFactory.XmlTextNewLine(CrLf, continueXmlDocumentationComment: true);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.CodeGeneration/packages.lock.json",
    "content": "{\n  \"version\": 1,\n  \"dependencies\": {\n    \".NETStandard,Version=v2.0\": {\n      \"Microsoft.CodeAnalysis.CSharp\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[5.0.0, )\",\n        \"resolved\": \"5.0.0\",\n        \"contentHash\": \"5DSyJ9bk+ATuDy7fp2Zt0mJStDVKbBoiz1DyfAwSa+k4H4IwykAUcV3URelw5b8/iVbfSaOwkwmPUZH6opZKCw==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"3.11.0\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.0.0]\",\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Memory\": \"4.6.0\",\n          \"System.Numerics.Vectors\": \"4.6.0\",\n          \"System.Reflection.Metadata\": \"9.0.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\",\n          \"System.Text.Encoding.CodePages\": \"8.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.6.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[3.3.1, )\",\n        \"resolved\": \"3.3.1\",\n        \"contentHash\": \"eT+kgNCDdTRbQ5WF6BGx1HI3D5jYfHteza/koefhWC2vNZGxObA74XxwWfg40dy3uUv7dn3OGKLK5GUPLroVog==\"\n      },\n      \"NETStandard.Library\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[2.0.3, )\",\n        \"resolved\": \"2.0.3\",\n        \"contentHash\": \"st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.1.0\"\n        }\n      },\n      \"SonarAnalyzer.CSharp.Styling\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[10.21.0.135717, )\",\n        \"resolved\": \"10.21.0.135717\",\n        \"contentHash\": \"hl264jF539oB7m2jED5QGM345eFSiDAdoJc8TH0HM6L7ZeqT5TDqZDQeZ8IDP02dVIpH/Fhhn+HsGfEcj8ohyQ==\"\n      },\n      \"StyleCop.Analyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.2.0-beta.556, )\",\n        \"resolved\": \"1.2.0-beta.556\",\n        \"contentHash\": \"llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==\",\n        \"dependencies\": {\n          \"StyleCop.Analyzers.Unstable\": \"1.2.0.556\"\n        }\n      },\n      \"TunnelVisionLabs.ReferenceAssemblyAnnotator\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.0.0-alpha.160, )\",\n        \"resolved\": \"1.0.0-alpha.160\",\n        \"contentHash\": \"ktxB8PGoPpIaYKjLk/+P94Fi2Qw2E1Dw7atBQRrKnHA57sk8WwmkI4RJmg6s5ph4k1RIaaAZMus05ah/AikEkA==\"\n      },\n      \"Microsoft.CodeAnalysis.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"3.11.0\",\n        \"contentHash\": \"v/EW3UE8/lbEYHoC2Qq7AR/DnmvpgdtAMndfQNmpuIMx/Mto8L5JnuCfdBYtgvalQOtfNCnxFejxuRrryvUTsg==\"\n      },\n      \"Microsoft.CodeAnalysis.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.0.0\",\n        \"contentHash\": \"ZXRAdvH6GiDeHRyd3q/km8Z44RoM6FBWHd+gen/la81mVnAdHTEsEkO5J0TCNXBymAcx5UYKt5TvgKBhaLJEow==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"3.11.0\",\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Memory\": \"4.6.0\",\n          \"System.Numerics.Vectors\": \"4.6.0\",\n          \"System.Reflection.Metadata\": \"9.0.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\",\n          \"System.Text.Encoding.CodePages\": \"8.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.6.0\"\n        }\n      },\n      \"Microsoft.NETCore.Platforms\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.1.0\",\n        \"contentHash\": \"kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==\"\n      },\n      \"StyleCop.Analyzers.Unstable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.2.0.556\",\n        \"contentHash\": \"zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==\"\n      },\n      \"System.Buffers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.6.0\",\n        \"contentHash\": \"lN6tZi7Q46zFzAbRYXTIvfXcyvQQgxnY7Xm6C6xQ9784dEL1amjM6S6Iw4ZpsvesAKnRVsM4scrDQaDqSClkjA==\"\n      },\n      \"System.Collections.Immutable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"QhkXUl2gNrQtvPmtBTQHb0YsUrDiDQ2QS09YbtTTiSjGcf7NBqtYbrG/BE06zcBPCKEwQGzIv13IVdXNOSub2w==\",\n        \"dependencies\": {\n          \"System.Memory\": \"4.5.5\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.0.0\"\n        }\n      },\n      \"System.Memory\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.6.0\",\n        \"contentHash\": \"OEkbBQoklHngJ8UD8ez2AERSk2g+/qpAaSWWCBFbpH727HxDq5ydVkuncBaKcKfwRqXGWx64dS6G1SUScMsitg==\",\n        \"dependencies\": {\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Numerics.Vectors\": \"4.6.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\"\n        }\n      },\n      \"System.Numerics.Vectors\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.6.0\",\n        \"contentHash\": \"t+SoieZsRuEyiw/J+qXUbolyO219tKQQI0+2/YI+Qv7YdGValA6WiuokrNKqjrTNsy5ABWU11bdKOzUdheteXg==\"\n      },\n      \"System.Reflection.Metadata\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"ANiqLu3DxW9kol/hMmTWbt3414t9ftdIuiIU7j80okq2YzAueo120M442xk1kDJWtmZTqWQn7wHDvMRipVOEOQ==\",\n        \"dependencies\": {\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Memory\": \"4.5.5\"\n        }\n      },\n      \"System.Runtime.CompilerServices.Unsafe\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.1.0\",\n        \"contentHash\": \"5o/HZxx6RVqYlhKSq8/zronDkALJZUT2Vz0hx43f0gwe8mwlM0y2nYlqdBwLMzr262Bwvpikeb/yEwkAa5PADg==\"\n      },\n      \"System.Text.Encoding.CodePages\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"OZIsVplFGaVY90G2SbpgU7EnCoOO5pw1t4ic21dBF3/1omrJFpAGoNAVpPyMVOC90/hvgkGG3VFqR13YgZMQfg==\",\n        \"dependencies\": {\n          \"System.Memory\": \"4.5.5\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.0.0\"\n        }\n      },\n      \"System.Threading.Tasks.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.6.0\",\n        \"contentHash\": \"I5G6Y8jb0xRtGUC9Lahy7FUvlYlnGMMkbuKAQBy8Jb7Y6Yn8OlBEiUOY0PqZ0hy6Ua8poVA1ui1tAIiXNxGdsg==\",\n        \"dependencies\": {\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\"\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Generator/Factory.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text.RegularExpressions;\n\nnamespace SonarAnalyzer.ShimLayer.Generator;\n\npublic static class Factory\n{\n    // Match 3 or more consecutive newlines (with optional whitespace-only lines between them) and replace with exactly 2 newlines.\n    private static readonly Regex ExcessiveNewLines = new(@\"\\n(\\s*\\n){2,}\", RegexOptions.ExplicitCapture, TimeSpan.FromMilliseconds(100));\n\n    public static IEnumerable<GeneratedFile> CreateAllFiles()\n    {\n        using var typeLoader = new TypeLoader();\n        var model = ModelBuilder.Build(typeLoader.LoadLatest(), typeLoader.LoadBaseline());\n        foreach (var strategy in model.ToArray())\n        {\n            if (strategy.Generate(model) is { } content)\n            {\n                var shortened = ExcessiveNewLines.Replace(content, \"\\n\\n\");\n                yield return new($\"{strategy.Latest.Name}.g.cs\", shortened);\n            }\n        }\n    }\n}\n\npublic record GeneratedFile(string Name, string Content);\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Generator/Model/MemberDescriptor.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.ShimLayer.Generator.Model;\n\npublic record MemberDescriptor(MemberInfo Member, bool IsPassthrough);\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Generator/Model/ModelBuilder.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.ShimLayer.Generator.Model;\n\npublic static class ModelBuilder\n{\n    private static readonly TypeDescriptor ObjectTypeDescriptor = new(typeof(object), typeof(object).GetMembers());\n\n    public static StrategyModel Build(TypeDescriptor[] latest, TypeDescriptor[] baseline)\n    {\n        var baselineMap = baseline.ToDictionary(x => x.Type.FullName, x => x);\n        return new(latest.ToDictionary(x => x.Type, x => CreateStrategy(x, baselineMap.TryGetValue(x.Type.FullName, out var baselineType) ? baselineType : null, baselineMap)));\n    }\n\n    private static Strategy CreateStrategy(TypeDescriptor latest, TypeDescriptor baseline, IReadOnlyDictionary<string, TypeDescriptor> baselineMap)\n    {\n        if (IsSkipped(latest.Type))\n        {\n            return new SkipStrategy(latest.Type);\n        }\n        else if (baseline is not null && latest.Members.Select(x => x.ToString()).OrderBy(x => x).SequenceEqual(baseline.Members.Select(x => x.ToString()).OrderBy(x => x)))\n        {\n            return new NoChangeStrategy(latest.Type);\n        }\n        else if (latest.Type.IsEnum)\n        {\n            var fields = CreateEnumFields(latest, baseline);\n            return baseline is null\n                ? new NewEnumStrategy(latest.Type, fields)\n                : new PartialEnumStrategy(latest.Type, fields);\n        }\n        else if (IsAssignableTo(latest.Type, \"Microsoft.CodeAnalysis.SyntaxNode\"))\n        {\n            if (baseline is null)\n            {\n                var commonBase = FindCommonBaseType(latest, baselineMap);\n                return new SyntaxNodeWrapStrategy(latest.Type, commonBase.Type, CreateMembers(latest, commonBase));\n            }\n            else\n            {\n                return new SyntaxNodeExtendStrategy(latest.Type, CreateMembers(latest, baseline));\n            }\n        }\n        else if (IsAssignableTo(latest.Type, \"Microsoft.CodeAnalysis.IOperation\"))\n        {\n            return new IOperationStrategy(latest.Type, CreateMembers(latest, baseline));\n        }\n        // ToDo: TypeStrategy, or ClassStrategy / StructStrategy / InterfaceStrategy?\n        else\n        {\n            // ToDo: Throw NotSupportedException instead of skip, there should be nothing left after explicitly handling all known cases\n            return baseline is null\n                ? new SkipStrategy(latest.Type)\n                : new NoChangeStrategy(latest.Type);\n        }\n    }\n\n    private static TypeDescriptor FindCommonBaseType(TypeDescriptor latest, IReadOnlyDictionary<string, TypeDescriptor> baselineMap)\n    {\n        var current = latest.Type;\n        while (current is not null)\n        {\n            if (baselineMap.TryGetValue(current.FullName, out var baselineType))\n            {\n                return baselineType;\n            }\n            current = current.BaseType;\n        }\n        return ObjectTypeDescriptor;\n    }\n\n    private static bool IsAssignableTo(Type type, string fullName)   // We can't use typeof(Xxx).IsAssignableFrom(type) because it's loaded into a different metadata context\n    {\n        if (type.GetInterface(fullName) is not null)\n        {\n            return true;\n        }\n        while (type is not null)\n        {\n            if (type.FullName == fullName)\n            {\n                return true;\n            }\n            type = type.BaseType;\n        }\n        return false;\n    }\n\n    private static MemberDescriptor[] CreateMembers(TypeDescriptor latestType, TypeDescriptor baselineType)\n    {\n        var baseline = new HashSet<string>(baselineType?.Members.Select(x => x.ToString()) ?? []);\n        return latestType.Members.Where(IsValid).Select(x => new MemberDescriptor(x, baseline.Contains(x.ToString()))).ToArray();\n    }\n\n    private static FieldInfo[] CreateEnumFields(TypeDescriptor latestType, TypeDescriptor baselineType)\n    {\n        // IOperation has changed significantly compared to Roslyn 1.3.2, including changes of values => we need to (re)generate everything\n        var baseline = latestType.Type.Name == nameof(OperationKind) ? [] : new HashSet<string>(baselineType?.Members.OfType<FieldInfo>().Select(x => x.Name) ?? []);\n        return latestType.Members.OfType<FieldInfo>().Where(x => !x.IsSpecialName && !baseline.Contains(x.Name)).ToArray();\n    }\n\n    private static bool IsSkipped(Type type) =>\n        type.IsNested\n        || type.IsGenericType\n        || typeof(Delegate).IsAssignableFrom(type);\n\n    private static bool IsValid(MemberInfo member) =>\n        member switch\n        {\n            MethodInfo method => !method.IsSpecialName && !(method.Name is nameof(GetType) or nameof(Equals) or nameof(GetHashCode) or nameof(ToString)),   // Struct methods that would need override\n            PropertyInfo => true,\n            _ => false\n        };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Generator/Model/StrategyModel.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Collections;\n\nnamespace SonarAnalyzer.ShimLayer.Generator.Model;\n\npublic class StrategyModel : IEnumerable<Strategy>\n{\n    private readonly Dictionary<Type, Strategy> strategies;\n\n    public Strategy this[Type key]\n    {\n        get\n        {\n            if (strategies.TryGetValue(key, out var strategy))\n            {\n                return strategy;\n            }\n            else\n            {\n                Strategy newStrategy = key.Name == \"SeparatedSyntaxList`1\" && this[key.GenericTypeArguments.Single()] is SyntaxNodeWrapStrategy typeArgument\n                    ? new SeparatedSyntaxListStrategy(key, typeArgument)\n                    : new NoChangeStrategy(key);\n                Add(key, newStrategy);\n                return newStrategy;\n            }\n        }\n    }\n\n    public StrategyModel() =>\n        strategies = [];\n\n    public StrategyModel(Dictionary<Type, Strategy> strategies) =>\n        this.strategies = strategies;\n\n    public void Add(Type type, Strategy strategy) =>\n        strategies.Add(type, strategy);\n\n    public IEnumerator<Strategy> GetEnumerator() =>\n        strategies.Values.GetEnumerator();\n\n    IEnumerator IEnumerable.GetEnumerator() =>\n        GetEnumerator();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Generator/Model/TypeDescriptor.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.ShimLayer.Generator.Model;\n\npublic record TypeDescriptor(Type Type, MemberInfo[] Members);\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Generator/Model/TypeLoader.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\nusing Microsoft.CodeAnalysis.CSharp;\n\nnamespace SonarAnalyzer.ShimLayer.Generator.Model;\n\npublic sealed class TypeLoader : IDisposable\n{\n    private readonly MetadataLoadContext metadataContext = new(new CustomAssemblyResolver(), Path.GetFileNameWithoutExtension(typeof(object).Assembly.Location));\n\n    public void Dispose() =>\n        metadataContext.Dispose();\n\n    public TypeDescriptor[] LoadBaseline()\n    {\n        var assembly = typeof(TypeLoader).Assembly;\n        using var common = assembly.GetManifestResourceStream(\"Microsoft.CodeAnalysis.1.3.2.dll\");\n        using var csharp = assembly.GetManifestResourceStream(\"Microsoft.CodeAnalysis.CSharp.1.3.2.dll\");\n        return [\n            .. Load(metadataContext.LoadFromStream(common)),\n            .. Load(metadataContext.LoadFromStream(csharp))\n            ];\n    }\n\n    public TypeDescriptor[] LoadLatest() =>\n        [\n            ..Load(metadataContext.LoadFromAssemblyPath(typeof(SyntaxNode).Assembly.Location)),         // Microsoft.CodeAnalysis\n            ..Load(metadataContext.LoadFromAssemblyPath(typeof(CSharpSyntaxNode).Assembly.Location))    // Microsoft.CodeAnalysis.CSharp\n        ];\n\n    private static TypeDescriptor[] Load(Assembly assembly) =>\n        assembly.GetExportedTypes().Select(x => new TypeDescriptor(x, FindMembers(x).ToArray())).ToArray();\n\n    private static IEnumerable<MemberInfo> FindMembers(Type type)\n    {\n        foreach (var member in type.GetMembers())\n        {\n            yield return member;\n        }\n        if (type.IsInterface)   // Members from inherited interfaces are not present in type.GetMembers()\n        {\n            foreach (var member in type.GetInterfaces().SelectMany(x => x.GetMembers()))\n            {\n                yield return member;\n            }\n        }\n    }\n}\n\nfile sealed class CustomAssemblyResolver : PathAssemblyResolver\n{\n    public CustomAssemblyResolver() : base(Directory.GetFiles(Path.GetDirectoryName(typeof(object).Assembly.Location), \"*.dll\")) { }\n\n    public override Assembly Resolve(MetadataLoadContext context, AssemblyName assemblyName) =>\n        base.Resolve(context, assemblyName)\n        // Microsoft.CodeAnalysis does not resolve automatically\n        ?? context.GetAssemblies().Single(x => x.GetName().Name == assemblyName.Name && x.GetName().Version.Major == assemblyName.Version.Major);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Generator/ShimLayerGenerator.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace SonarAnalyzer.ShimLayer.Generator;\n\n[Generator]\n[ExcludeFromCodeCoverage]\npublic class ShimLayerGenerator : IIncrementalGenerator\n{\n    public void Initialize(IncrementalGeneratorInitializationContext context) =>\n        context.RegisterSourceOutput(\n            context.ParseOptionsProvider.Select((_, _) => context.GetType().Assembly.FullName), // Any simple provider, return Roslyn version\n            (context, _) =>\n            {\n                foreach (var file in Factory.CreateAllFiles())\n                {\n                    context.AddSource(file.Name, file.Content);\n                }\n            });\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Generator/SonarAnalyzer.ShimLayer.Generator.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFramework>netstandard2.0</TargetFramework>\n    <!-- The scanner removes all the analyzers that have the \"SonarAnalyzer\" prefix -->\n    <AssemblyName>Internal.SonarAnalyzer.ShimLayer.Generator</AssemblyName>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Microsoft.CodeAnalysis.CSharp\" Version=\"5.0.0\" PrivateAssets=\"all\" />\n    <PackageReference Include=\"Microsoft.CodeAnalysis.Common\" Version=\"5.0.0\" PrivateAssets=\"all\" />\n    <PackageReference Include=\"System.Reflection.MetadataLoadContext\" Version=\"10.0.5\" GeneratePathProperty=\"true\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Using Include=\"Microsoft.CodeAnalysis\" />\n    <Using Include=\"Microsoft.CodeAnalysis.Diagnostics\" />\n    <Using Include=\"SonarAnalyzer.ShimLayer.Generator.Model\" />\n    <Using Include=\"SonarAnalyzer.ShimLayer.Generator.Strategies\" />\n    <Using Include=\"System.Reflection\" />\n    <Using Include=\"System.Text\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <EmbeddedResource Include=\"$(NuGetPackageRoot)\\Microsoft.CodeAnalysis.CSharp\\1.3.2\\lib\\netstandard1.3\\Microsoft.CodeAnalysis.CSharp.dll\">\n      <LogicalName>Microsoft.CodeAnalysis.CSharp.1.3.2.dll</LogicalName>\n    </EmbeddedResource>\n    <EmbeddedResource Include=\"$(NuGetPackageRoot)\\Microsoft.CodeAnalysis.Common\\1.3.2\\lib\\netstandard1.3\\Microsoft.CodeAnalysis.dll\">\n      <LogicalName>Microsoft.CodeAnalysis.1.3.2.dll</LogicalName>\n    </EmbeddedResource>\n  </ItemGroup>\n\n  <ItemGroup>\n    <Compile Include=\"..\\SonarAnalyzer.Core\\Common\\IsExternalInit.cs\">\n      <Link>IsExternalInit.cs</Link>\n    </Compile>\n  </ItemGroup>\n\n  <PropertyGroup>\n    <GetTargetPathDependsOn>$(GetTargetPathDependsOn);GetDependencyTargetPaths</GetTargetPathDependsOn>\n  </PropertyGroup>\n\n  <Target Name=\"GetDependencyTargetPaths\">\n    <!-- This is needed for the analyzer dependencies to work -->\n    <ItemGroup>\n      <TargetPathWithTargetPlatformMoniker Include=\"$(PKGSystem_Reflection_MetadataLoadContext)\\lib\\netstandard2.0\\System.Reflection.MetadataLoadContext.dll\" IncludeRuntimeDependency=\"false\" />\n    </ItemGroup>\n  </Target>\n\n</Project>\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Generator/Strategies/IOperationStrategy.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.ShimLayer.Generator.Strategies;\n\npublic class IOperationStrategy : Strategy\n{\n    public IReadOnlyList<MemberDescriptor> Members { get; }\n\n    public IOperationStrategy(Type latest, IReadOnlyList<MemberDescriptor> members) : base(latest) =>\n        Members = members;\n\n    public override string Generate(StrategyModel model) =>\n        $\"namespace SonarAnalyzer.ShimLayer; // {Latest.Name}\";   // NET-2729\n\n    public override string ReturnTypeSnippet() =>\n        throw new NotImplementedException();\n\n    public override string ToConversionSnippet(string from) =>\n        throw new NotImplementedException();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Generator/Strategies/NewEnumStrategy.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.ShimLayer.Generator.Strategies;\n\npublic class NewEnumStrategy : Strategy\n{\n    public FieldInfo[] Fields { get; }\n\n    public NewEnumStrategy(Type latest, FieldInfo[] fields) : base(latest) =>\n        Fields = fields;\n\n    public override string Generate(StrategyModel model)\n    {\n        var sb = new StringBuilder();\n        sb.AppendLine(Preamble());\n        sb.AppendLine($\"{SerializeAttributes(Latest.GetCustomAttributesData(), 0)}public enum {Latest.Name} : {Enum.GetUnderlyingType(Latest)}\");\n        sb.AppendLine(\"{\");\n        foreach (var field in Fields)\n        {\n            sb.AppendLine($\"    {field.Name} = {field.GetRawConstantValue()},\");\n        }\n        sb.AppendLine(\"}\");\n        return sb.ToString();\n    }\n\n    public override string ReturnTypeSnippet() =>\n        Latest.Name;\n\n    public override string ToConversionSnippet(string from) =>\n        $\"({Latest.Name}){from}\";\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Generator/Strategies/NoChangeStrategy.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.ShimLayer.Generator.Strategies;\n\npublic class NoChangeStrategy : Strategy\n{\n    private readonly string type;\n\n    public NoChangeStrategy(Type latest) : base(latest) =>\n        type = latest.IsGenericType\n            ? latest.Name.Replace(\"`1\", null) + \"<\" + string.Join(\", \", latest.GetGenericArguments().Select(x => x.Name)) + \">\"\n            : latest.Name;\n\n    public override string Generate(StrategyModel model) => null;\n\n    public override string ReturnTypeSnippet() =>\n        type;\n\n    public override string CompiletimeTypeSnippet() =>\n        type;\n\n    public override string ToConversionSnippet(string from) =>\n        $\"({type}){from}\";\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Generator/Strategies/PartialEnumStrategy.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.ShimLayer.Generator.Strategies;\n\npublic class PartialEnumStrategy : Strategy\n{\n    public FieldInfo[] Fields { get; }\n\n    public PartialEnumStrategy(Type latest, FieldInfo[] fields) : base(latest) =>\n        Fields = fields;\n\n    public override string Generate(StrategyModel model)\n    {\n        var sb = new StringBuilder();\n        sb.Append(Preamble($\"using {Latest.Namespace};\"));\n        sb.AppendLine();\n        sb.AppendLine($\"public static class {Latest.Name}Ex\");\n        sb.AppendLine(\"{\");\n        foreach (var field in Fields)\n        {\n            sb.AppendLine($\"    public const {Latest.Name} {field.Name} = ({Latest.Name}){field.GetRawConstantValue()};\");\n        }\n        sb.AppendLine(\"}\");\n        return sb.ToString();\n    }\n\n    public override string ReturnTypeSnippet() =>\n        Latest.Name;\n\n    public override string ToConversionSnippet(string from) =>\n        $\"({Latest.Name}){from}\";\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Generator/Strategies/SeparatedSyntaxListStrategy.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.ShimLayer.Generator.Strategies;\n\npublic class SeparatedSyntaxListStrategy : Strategy\n{\n    private readonly string type;\n    private readonly Strategy typeArgument;\n\n    public SeparatedSyntaxListStrategy(Type latest, Strategy typeArgument) : base(latest)\n    {\n        type = latest.Name.Replace(\"`1\", \"Wrapper\");\n        this.typeArgument = typeArgument;\n    }\n\n    public override string ReturnTypeSnippet() =>\n        $\"{type}<{typeArgument.ReturnTypeSnippet()}>\";\n\n    public override string ToConversionSnippet(string from) =>\n        from;\n\n    public override string CompiletimeTypeSnippet() =>\n        ReturnTypeSnippet();\n\n    public override string PropertyAccessorInitializerSnippet(string compiletimeType, string propertyName) =>\n        $\"LightupHelpers.CreateSeparatedSyntaxListPropertyAccessor<{compiletimeType}, {typeArgument.ReturnTypeSnippet()}>(WrappedType, nameof({propertyName}))\";\n\n    public override string Generate(StrategyModel model) => null;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Generator/Strategies/SkipStrategy.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.ShimLayer.Generator.Strategies;\n\npublic class SkipStrategy : Strategy\n{\n    public override bool IsSupported => false;\n\n    public SkipStrategy(Type latest) : base(latest) { }\n\n    public override string ReturnTypeSnippet() =>\n        throw new NotSupportedException();\n\n    public override string ToConversionSnippet(string from) =>\n        throw new NotSupportedException();\n\n    public override string Generate(StrategyModel model) => null;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Generator/Strategies/Strategy.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.ShimLayer.Generator.Strategies;\n\npublic abstract class Strategy\n{\n    public abstract string Generate(StrategyModel model);\n    public abstract string ReturnTypeSnippet();\n    public abstract string ToConversionSnippet(string from);\n\n    public virtual bool IsSupported => true;\n\n    public Type Latest { get; }\n\n    protected Strategy(Type latest) =>\n        Latest = latest;\n\n    public virtual string CompiletimeTypeSnippet() =>\n        Latest.Name;\n\n    protected static string JoinLines(IEnumerable<string> lines) =>\n       string.Join(\"\\n\", lines.Where(x => x is not null));\n\n    protected static string Preamble(params IEnumerable<string> additionalUsing) =>\n       $\"\"\"\n       //<auto-generated/>\n       /*\n        * SonarAnalyzer for .NET\n        * Copyright (C) SonarSource Sàrl\n        * mailto:info AT sonarsource DOT com\n        *\n        * You can redistribute and/or modify this program under the terms of\n        * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n        *\n        * This program is distributed in the hope that it will be useful,\n        * but WITHOUT ANY WARRANTY; without even the implied warranty of\n        * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n        * See the Sonar Source-Available License for more details.\n        *\n        * You should have received a copy of the Sonar Source-Available License\n        * along with this program; if not, see https://sonarsource.com/license/ssal/\n        */\n\n       {JoinLines((SortedSet<string>)[\n            \"using Microsoft.CodeAnalysis;\",\n            \"using Microsoft.CodeAnalysis.CSharp;\",\n            \"using Microsoft.CodeAnalysis.CSharp.Syntax;\",\n            \"using Microsoft.CodeAnalysis.Text;\",\n            \"using System;\",\n            \"using System.Collections.Immutable;\",\n            .. additionalUsing])}\n\n       namespace SonarAnalyzer.ShimLayer;\n\n       \"\"\";\n\n    public virtual string PropertyAccessorInitializerSnippet(string compiletimeType, string propertyName) =>\n        $\"\"\"LightupHelpers.CreateSyntaxPropertyAccessor<{compiletimeType}, {CompiletimeTypeSnippet()}>(WrappedType, \"{propertyName}\")\"\"\";\n\n    protected static string SerializeAttributes(IEnumerable<CustomAttributeData> attributes, int indentSize)\n    {\n        var sb = new StringBuilder();\n        var indent = new string(' ', indentSize);\n        foreach (var attribute in attributes.Where(x => x.AttributeType.Name is not \"ExperimentalAttribute\" and not \"NullableAttribute\"))\n        {\n            sb.Append(\"[\").Append(attribute.AttributeType.FullName);\n            if (attribute.ConstructorArguments.Any())\n            {\n                sb.Append(\"(\");\n                sb.Append(string.Join(\", \", attribute.ConstructorArguments.Select(SerializeArgument)));\n                sb.Append(\")\");\n            }\n            sb.AppendLine(\"]\");\n            sb.Append(indent);\n        }\n        return sb.ToString();\n    }\n\n    private static string SerializeArgument(CustomAttributeTypedArgument arg)\n    {\n        if (arg.ArgumentType.Name == nameof(String))\n        {\n            return $@\"\"\"{arg.Value}\"\"\";\n        }\n        else if (arg.ArgumentType.Name == nameof(Boolean))\n        {\n            return arg.Value.ToString().ToLower();\n        }\n        else if (arg.ArgumentType.IsEnum)   // If the Enum is not in Roslyn 1.3.2, or netstandard2.0, consider excluding the entire attribute\n        {\n            return $\"{arg.ArgumentType.FullName}.{Enum.GetName(arg.ArgumentType, arg.Value)}\";\n        }\n        else\n        {\n            return arg.Value?.ToString() ?? \"null\";\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Generator/Strategies/SyntaxNodeExtendStrategy.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.ShimLayer.Generator.Strategies;\n\npublic sealed class SyntaxNodeExtendStrategy : Strategy\n{\n    public IReadOnlyList<MemberInfo> Members { get; }\n\n    public SyntaxNodeExtendStrategy(Type latest, MemberDescriptor[] members) : base(latest) =>\n        Members = members.Where(x => !x.IsPassthrough).Select(x => x.Member).ToArray();\n\n    public override string Generate(StrategyModel model) =>\n        Members.Select(x => GenerateMemberAccessor(x, model)).Where(x => x is not null).ToArray() is { Length: > 0 } accessors\n            ? $$\"\"\"\n                {{Preamble($\"using {Latest.Namespace};\")}}\n                public static partial class {{Latest.Name}}ShimExtensions\n                {\n                    private static readonly Type WrappedType = typeof({{CompiletimeTypeSnippet()}});\n\n                {{JoinLines(accessors)}}\n\n                    extension({{CompiletimeTypeSnippet()}} @this)\n                    {\n                {{JoinLines(Members.Select(x => GenerateMemberExtension(x, model)))}}\n                    }\n                }\n                \"\"\"\n            : null;\n\n    public override string ReturnTypeSnippet() =>\n        Latest.Name;\n\n    public override string ToConversionSnippet(string from) => from;\n\n    private string GenerateMemberAccessor(MemberInfo member, StrategyModel model) =>\n        member switch\n        {\n            PropertyInfo prop when model[prop.PropertyType] is var propertyTypeStrategy => $\"\"\"\n                    private static readonly Func<{CompiletimeTypeSnippet()}, {propertyTypeStrategy.CompiletimeTypeSnippet()}> {prop.Name}Accessor = {propertyTypeStrategy.PropertyAccessorInitializerSnippet(CompiletimeTypeSnippet(), prop.Name)};\n\n                \"\"\",\n            _ => null,\n        };\n\n    private static string GenerateMemberExtension(MemberInfo member, StrategyModel model) =>\n        member switch\n        {\n            PropertyInfo { GetMethod: not null } prop when model[prop.PropertyType] is var propertyTypeStrategy => $\"\"\"\n                        public {propertyTypeStrategy.ReturnTypeSnippet()} {prop.Name} => {propertyTypeStrategy.ToConversionSnippet($\"{prop.Name}Accessor(@this)\")};\n                \"\"\",\n            _ => null,\n        };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Generator/Strategies/SyntaxNodeWrapStrategy.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.ShimLayer.Generator.Strategies;\n\npublic class SyntaxNodeWrapStrategy : Strategy\n{\n    public Type BaseType { get; }\n    public IReadOnlyList<MemberDescriptor> Members { get; }\n\n    public SyntaxNodeWrapStrategy(Type latest, Type baseType, IReadOnlyList<MemberDescriptor> members) : base(latest)\n    {\n        BaseType = baseType;\n        Members = members;\n    }\n\n    public override string ReturnTypeSnippet() =>\n        $\"{Latest.Name}Wrapper\";\n\n    public override string ToConversionSnippet(string from) =>\n        $\"({Latest.Name}Wrapper){from}\";\n\n    public override string CompiletimeTypeSnippet() =>\n        BaseType.Name;\n\n    public override string Generate(StrategyModel model) =>\n        $$\"\"\"\n        {{Preamble()}}\n        public readonly partial struct {{Latest.Name}}Wrapper: ISyntaxWrapper<{{CompiletimeTypeSnippet()}}>\n        {\n            public const string WrappedTypeName = \"{{Latest.FullName}}\";\n            private static readonly Type WrappedType;\n\n            private readonly {{CompiletimeTypeSnippet()}} node;\n\n            static {{Latest.Name}}Wrapper()\n            {\n                WrappedType = SyntaxNodeTypes.LatestType(typeof({{Latest.Name}}Wrapper));\n        {{JoinLines(Members.Where(x => !x.IsPassthrough).Select(x => MemberAccessorInitialization(x.Member, model)))}}\n            }\n\n            private {{Latest.Name}}Wrapper({{CompiletimeTypeSnippet()}} node) =>\n                this.node = node;\n\n            public {{CompiletimeTypeSnippet()}} Node => this.node;\n\n            [Obsolete(\"Use Node instead\")]\n            public {{CompiletimeTypeSnippet()}} SyntaxNode => this.node;\n\n        {{JoinLines(Members.Select(x => MemberDeclaration(x, model)))}}\n\n            public static explicit operator {{Latest.Name}}Wrapper(SyntaxNode node)\n            {\n                if (node is null)\n                {\n                    return default;\n                }\n\n                if (!IsInstance(node))\n                {\n                    throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n                }\n\n                return new {{Latest.Name}}Wrapper(({{CompiletimeTypeSnippet()}})node);\n            }\n\n            public static implicit operator {{CompiletimeTypeSnippet()}}({{Latest.Name}}Wrapper wrapper) =>\n                wrapper.node;\n\n        {{WrapperToWrapperConversions(model)}}\n\n            public static bool IsInstance(SyntaxNode node) =>\n                node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n        }\n        \"\"\";\n\n    private string WrapperToWrapperConversions(StrategyModel model)\n    {\n        StringBuilder sb = null;\n        var baseType = Latest.BaseType;\n        while (baseType is not null && model[baseType] is SyntaxNodeWrapStrategy) // BaseType is also wrapped\n        {\n            sb ??= new StringBuilder();\n            sb.AppendLine($\"\"\"\n                    public static implicit operator {baseType.Name}Wrapper({Latest.Name}Wrapper up) => ({baseType.Name}Wrapper)up.SyntaxNode;\n                    public static explicit operator {Latest.Name}Wrapper({baseType.Name}Wrapper down) => ({Latest.Name}Wrapper)down.SyntaxNode;\n\n                \"\"\");\n            baseType = baseType.BaseType;\n        }\n        return sb?.ToString() ?? string.Empty;\n    }\n\n    private string MemberAccessorInitialization(MemberInfo member, StrategyModel model) =>\n        member is PropertyInfo property && model[property.PropertyType] is { IsSupported: true } propertyTypeStrategy\n            ? $\"\"\"\n                        {member.Name}Accessor = {propertyTypeStrategy.PropertyAccessorInitializerSnippet(CompiletimeTypeSnippet(), member.Name)};\n                \"\"\"\n            : null;\n\n    private string MemberDeclaration(MemberDescriptor member, StrategyModel model)\n    {\n        var attributes = SerializeAttributes(member.Member.GetCustomAttributesData(), 4);\n        return member switch\n        {\n            { IsPassthrough: true, Member: PropertyInfo pi } => $\"\"\"\n                    {attributes}public {model[pi.PropertyType].CompiletimeTypeSnippet()} {member.Member.Name} => this.node.{member.Member.Name};\n                \"\"\",\n            { IsPassthrough: false, Member: PropertyInfo pi } when model[pi.PropertyType] is { IsSupported: true } propertyTypeStrategy => $\"\"\"\n                    private static readonly Func<{BaseType.Name}, {propertyTypeStrategy.CompiletimeTypeSnippet()}> {member.Member.Name}Accessor;\n                    {attributes}public {propertyTypeStrategy.ReturnTypeSnippet()} {member.Member.Name} => {propertyTypeStrategy.ToConversionSnippet($\"{member.Member.Name}Accessor(this.node)\")};\n                \"\"\",\n            _ => null,\n        };\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Generator/packages.lock.json",
    "content": "{\n  \"version\": 1,\n  \"dependencies\": {\n    \".NETStandard,Version=v2.0\": {\n      \"Microsoft.CodeAnalysis.Common\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[5.0.0, )\",\n        \"resolved\": \"5.0.0\",\n        \"contentHash\": \"ZXRAdvH6GiDeHRyd3q/km8Z44RoM6FBWHd+gen/la81mVnAdHTEsEkO5J0TCNXBymAcx5UYKt5TvgKBhaLJEow==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"3.11.0\",\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Memory\": \"4.6.0\",\n          \"System.Numerics.Vectors\": \"4.6.0\",\n          \"System.Reflection.Metadata\": \"9.0.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\",\n          \"System.Text.Encoding.CodePages\": \"8.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.6.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[5.0.0, )\",\n        \"resolved\": \"5.0.0\",\n        \"contentHash\": \"5DSyJ9bk+ATuDy7fp2Zt0mJStDVKbBoiz1DyfAwSa+k4H4IwykAUcV3URelw5b8/iVbfSaOwkwmPUZH6opZKCw==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"3.11.0\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.0.0]\",\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Memory\": \"4.6.0\",\n          \"System.Numerics.Vectors\": \"4.6.0\",\n          \"System.Reflection.Metadata\": \"9.0.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\",\n          \"System.Text.Encoding.CodePages\": \"8.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.6.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[3.3.1, )\",\n        \"resolved\": \"3.3.1\",\n        \"contentHash\": \"eT+kgNCDdTRbQ5WF6BGx1HI3D5jYfHteza/koefhWC2vNZGxObA74XxwWfg40dy3uUv7dn3OGKLK5GUPLroVog==\"\n      },\n      \"NETStandard.Library\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[2.0.3, )\",\n        \"resolved\": \"2.0.3\",\n        \"contentHash\": \"st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.1.0\"\n        }\n      },\n      \"SonarAnalyzer.CSharp.Styling\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[10.21.0.135717, )\",\n        \"resolved\": \"10.21.0.135717\",\n        \"contentHash\": \"hl264jF539oB7m2jED5QGM345eFSiDAdoJc8TH0HM6L7ZeqT5TDqZDQeZ8IDP02dVIpH/Fhhn+HsGfEcj8ohyQ==\"\n      },\n      \"StyleCop.Analyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.2.0-beta.556, )\",\n        \"resolved\": \"1.2.0-beta.556\",\n        \"contentHash\": \"llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==\",\n        \"dependencies\": {\n          \"StyleCop.Analyzers.Unstable\": \"1.2.0.556\"\n        }\n      },\n      \"System.Reflection.MetadataLoadContext\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[10.0.5, )\",\n        \"resolved\": \"10.0.5\",\n        \"contentHash\": \"z9yyFZcuCwtZXrxxDc2nBfB5lTHf96gS/rsD38Lcv6Ok25TOYPjNKlqpTZUqu2HTLPAM4w+/WjGL6gi9cIJO6w==\",\n        \"dependencies\": {\n          \"System.Collections.Immutable\": \"10.0.5\",\n          \"System.Memory\": \"4.6.3\",\n          \"System.Reflection.Metadata\": \"10.0.5\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"3.11.0\",\n        \"contentHash\": \"v/EW3UE8/lbEYHoC2Qq7AR/DnmvpgdtAMndfQNmpuIMx/Mto8L5JnuCfdBYtgvalQOtfNCnxFejxuRrryvUTsg==\"\n      },\n      \"Microsoft.NETCore.Platforms\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.1.0\",\n        \"contentHash\": \"kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==\"\n      },\n      \"StyleCop.Analyzers.Unstable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.2.0.556\",\n        \"contentHash\": \"zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==\"\n      },\n      \"System.Buffers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.6.1\",\n        \"contentHash\": \"N8GXpmiLMtljq7gwvyS+1QvKT/W2J8sNAvx+HVg4NGmsG/H+2k/y9QI23auLJRterrzCiDH+IWAw4V/GPwsMlw==\"\n      },\n      \"System.Collections.Immutable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"10.0.5\",\n        \"contentHash\": \"nozrOKfEgfrvvswkCfxaumY68RA/x1F3ZYwtwRvva8ul91NCnUzb6MKpl5/P7u9v/nIagVL4OXXj8d007tucxw==\",\n        \"dependencies\": {\n          \"System.Memory\": \"4.6.3\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.2\"\n        }\n      },\n      \"System.Memory\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.6.3\",\n        \"contentHash\": \"qdcDOgnFZY40+Q9876JUHnlHu7bosOHX8XISRoH94fwk6hgaeQGSgfZd8srWRZNt5bV9ZW2TljcegDNxsf+96A==\",\n        \"dependencies\": {\n          \"System.Buffers\": \"4.6.1\",\n          \"System.Numerics.Vectors\": \"4.6.1\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.2\"\n        }\n      },\n      \"System.Numerics.Vectors\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.6.1\",\n        \"contentHash\": \"sQxefTnhagrhoq2ReR0D/6K0zJcr9Hrd6kikeXsA1I8kOCboTavcUC4r7TSfpKFeE163uMuxZcyfO1mGO3EN8Q==\"\n      },\n      \"System.Reflection.Metadata\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"10.0.5\",\n        \"contentHash\": \"fEAXJCtauNLYr5ESg3t6HE2Av6urWdJdymxZbuSt/DDqhtNtLtUtXTEpKbp0vkTdyBJwmaha8d2454vSzS/lcQ==\",\n        \"dependencies\": {\n          \"System.Collections.Immutable\": \"10.0.5\"\n        }\n      },\n      \"System.Runtime.CompilerServices.Unsafe\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.1.2\",\n        \"contentHash\": \"2hBr6zdbIBTDE3EhK7NSVNdX58uTK6iHW/P/Axmm9sl1xoGSLqDvMtpecn226TNwHByFokYwJmt/aQQNlO5CRw==\"\n      },\n      \"System.Text.Encoding.CodePages\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"OZIsVplFGaVY90G2SbpgU7EnCoOO5pw1t4ic21dBF3/1omrJFpAGoNAVpPyMVOC90/hvgkGG3VFqR13YgZMQfg==\",\n        \"dependencies\": {\n          \"System.Memory\": \"4.5.5\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.0.0\"\n        }\n      },\n      \"System.Threading.Tasks.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.6.0\",\n        \"contentHash\": \"I5G6Y8jb0xRtGUC9Lahy7FUvlYlnGMMkbuKAQBy8Jb7Y6Yn8OlBEiUOY0PqZ0hy6Ua8poVA1ui1tAIiXNxGdsg==\",\n        \"dependencies\": {\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\"\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/AnalysisContext/CompilationStartAnalysisContextExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Diagnostics.CodeAnalysis;\nusing static System.Linq.Expressions.Expression;\n\nnamespace SonarAnalyzer.ShimLayer.AnalysisContext;\n\npublic static class CompilationStartAnalysisContextExtensions\n{\n    private static readonly Action<CompilationStartAnalysisContext, Action<SymbolStartAnalysisContextWrapper>, SymbolKind> RegisterSymbolStartActionWrapper =\n        CreateRegisterSymbolStartAnalysisWrapper();\n\n    public static void RegisterSymbolStartAction(this CompilationStartAnalysisContext context, Action<SymbolStartAnalysisContextWrapper> action, SymbolKind symbolKind) =>\n        RegisterSymbolStartActionWrapper(context, action, symbolKind);\n\n    // Code is executed in static initializers and is not detected by the coverage tool\n    // See the SonarAnalysisContextTest.SonarCompilationStartAnalysisContext_RegisterSymbolStartAction family of tests to check test coverage manually\n    [ExcludeFromCodeCoverage]\n    private static Action<CompilationStartAnalysisContext, Action<SymbolStartAnalysisContextWrapper>, SymbolKind> CreateRegisterSymbolStartAnalysisWrapper()\n    {\n        if (typeof(CompilationStartAnalysisContext).GetMethod(nameof(RegisterSymbolStartAction)) is not { } registerMethod)\n        {\n            return static (_, _, _) => { };\n        }\n\n        var contextParameter = Parameter(typeof(CompilationStartAnalysisContext));\n        var shimmedActionParameter = Parameter(typeof(Action<SymbolStartAnalysisContextWrapper>));\n        var symbolKindParameter = Parameter(typeof(SymbolKind));\n\n        var roslynSymbolStartAnalysisContextType = typeof(CompilationStartAnalysisContext).Assembly.GetType(\"Microsoft.CodeAnalysis.Diagnostics.SymbolStartAnalysisContext\");\n        var roslynSymbolStartAnalysisActionType = typeof(Action<>).MakeGenericType(roslynSymbolStartAnalysisContextType);\n        var roslynSymbolStartAnalysisContextParameter = Parameter(roslynSymbolStartAnalysisContextType);\n        var sonarSymbolStartAnalysisContextCtor = typeof(SymbolStartAnalysisContextWrapper).GetConstructors().Single();\n\n        // Action<Roslyn.SymbolStartAnalysisContext> registerAction = roslynSymbolStartAnalysisContextParameter =>\n        //    shimmedActionParameter.Invoke(new Sonar.SymbolStartAnalysisContextWrapper(roslynSymbolStartAnalysisContextParameter))\n        var registerAction = Lambda(\n            delegateType: roslynSymbolStartAnalysisActionType,\n            body: Call(shimmedActionParameter, nameof(Action.Invoke), [], New(sonarSymbolStartAnalysisContextCtor, roslynSymbolStartAnalysisContextParameter)),\n            parameters: roslynSymbolStartAnalysisContextParameter);\n\n        // (contextParameter, shimmedActionParameter, symbolKindParameter) => contextParameter.RegisterSymbolStartAction(registerAction, symbolKindParameter)\n        return Lambda<Action<CompilationStartAnalysisContext, Action<SymbolStartAnalysisContextWrapper>, SymbolKind>>(\n            Call(contextParameter, registerMethod, registerAction, symbolKindParameter),\n            contextParameter, shimmedActionParameter, symbolKindParameter).Compile();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/AnalysisContext/SymbolStartAnalysisContextWrapper.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Diagnostics.CodeAnalysis;\nusing static System.Linq.Expressions.Expression;\nusing CS = Microsoft.CodeAnalysis.CSharp;\n\nnamespace SonarAnalyzer.ShimLayer.AnalysisContext;\n\npublic readonly struct SymbolStartAnalysisContextWrapper\n{\n    private const string VBSyntaxKind = \"Microsoft.CodeAnalysis.VisualBasic.SyntaxKind\";\n\n    private static readonly Func<object, CancellationToken> CancellationTokenAccessor;\n    private static readonly Func<object, Compilation> CompilationAccessor;\n    private static readonly Func<object, AnalyzerOptions> OptionsAccessor;\n    private static readonly Func<object, ISymbol> SymbolAccessor;\n\n    private static readonly Action<object, Action<CodeBlockAnalysisContext>> RegisterCodeBlockActionMethod;\n    private static readonly Action<object, Action<CodeBlockStartAnalysisContext<CS.SyntaxKind>>> RegisterCodeBlockStartActionCS;\n    private static readonly Action<object, Action<object>> RegisterCodeBlockStartActionVB;\n    private static readonly Action<object, Action<OperationAnalysisContext>, ImmutableArray<OperationKind>> RegisterOperationActionMethod;\n    private static readonly Action<object, Action<OperationBlockAnalysisContext>> RegisterOperationBlockActionMethod;\n    private static readonly Action<object, Action<OperationBlockStartAnalysisContext>> RegisterOperationBlockStartActionMethod;\n    private static readonly Action<object, Action<SymbolAnalysisContext>> RegisterSymbolEndActionMethod;\n    private static readonly Action<object, Action<SyntaxNodeAnalysisContext>, ImmutableArray<CS.SyntaxKind>> RegisterSyntaxNodeActionCS;\n    private static readonly Action<object, Action<SyntaxNodeAnalysisContext>, object> RegisterSyntaxNodeActionVB;\n\n    public CancellationToken CancellationToken => CancellationTokenAccessor(RoslynSymbolStartAnalysisContext);\n    public Compilation Compilation => CompilationAccessor(RoslynSymbolStartAnalysisContext);\n    public AnalyzerOptions Options => OptionsAccessor(RoslynSymbolStartAnalysisContext);\n    public ISymbol Symbol => SymbolAccessor(RoslynSymbolStartAnalysisContext);\n    private object RoslynSymbolStartAnalysisContext { get; }\n\n    // Code is executed in static initializers and is not detected by the coverage tool\n    // See the RegisterSymbolStartActionWrapperTest family of tests to check test coverage manually\n    [ExcludeFromCodeCoverage]\n    static SymbolStartAnalysisContextWrapper()\n    {\n        var symbolStartAnalysisContextType = LoadSymbolStartAnalysisContextType();\n        var languageKindEnumVBType = LoadLanguageKindEnumVBType();\n        CancellationTokenAccessor = CreatePropertyAccessor<CancellationToken>(nameof(CancellationToken));\n        CompilationAccessor = CreatePropertyAccessor<Compilation>(nameof(Compilation));\n        OptionsAccessor = CreatePropertyAccessor<AnalyzerOptions>(nameof(Options));\n        SymbolAccessor = CreatePropertyAccessor<ISymbol>(nameof(Symbol));\n        RegisterCodeBlockActionMethod = CreateRegistrationMethod<CodeBlockAnalysisContext>(nameof(RegisterCodeBlockAction));\n        RegisterCodeBlockStartActionCS = CreateRegistrationMethod<CodeBlockStartAnalysisContext<CS.SyntaxKind>>(nameof(RegisterCodeBlockStartAction), typeof(CS.SyntaxKind));\n        RegisterCodeBlockStartActionVB = CreateRegistrationMethodCodeBlockStart(languageKindEnumVBType);\n        RegisterOperationActionMethod = CreateRegistrationMethodWithAdditionalParameter<OperationAnalysisContext, ImmutableArray<OperationKind>>(nameof(RegisterOperationAction));\n        RegisterOperationBlockActionMethod = CreateRegistrationMethod<OperationBlockAnalysisContext>(nameof(RegisterOperationBlockAction));\n        RegisterOperationBlockStartActionMethod = CreateRegistrationMethod<OperationBlockStartAnalysisContext>(nameof(RegisterOperationBlockStartAction));\n        RegisterSymbolEndActionMethod = CreateRegistrationMethod<SymbolAnalysisContext>(nameof(RegisterSymbolEndAction));\n        RegisterSyntaxNodeActionCS = CreateRegistrationMethodWithAdditionalParameter<SyntaxNodeAnalysisContext, ImmutableArray<CS.SyntaxKind>>(nameof(RegisterSyntaxNodeAction), typeof(CS.SyntaxKind));\n        RegisterSyntaxNodeActionVB = CreateRegistrationMethodSyntaxNode(languageKindEnumVBType);\n\n        // receiverParameter => ((symbolStartAnalysisContextType)receiverParameter).\"propertyName\"\n        Func<object, TProperty> CreatePropertyAccessor<TProperty>(string propertyName)\n        {\n            if (symbolStartAnalysisContextType is null)\n            {\n                return static _ => default;\n            }\n            var receiverParameter = Parameter(typeof(object));\n            return Lambda<Func<object, TProperty>>(\n                Property(Convert(receiverParameter, symbolStartAnalysisContextType), propertyName),\n                receiverParameter).Compile();\n        }\n\n        // (object receiverParameter, Action<TContext> registerActionParameter) =>\n        //     ((symbolStartAnalysisContextType)receiverParameter).\"registrationMethodName\"<typeArguments>(registerActionParameter)\n        Action<object, Action<TContext>> CreateRegistrationMethod<TContext>(string registrationMethodName, params Type[] typeArguments)\n        {\n            if (symbolStartAnalysisContextType is null)\n            {\n                return static (_, _) => { };\n            }\n            var receiverParameter = Parameter(typeof(object));\n            var registerActionParameter = Parameter(typeof(Action<TContext>));\n            return Lambda<Action<object, Action<TContext>>>(\n                Call(Convert(receiverParameter, symbolStartAnalysisContextType), registrationMethodName, typeArguments, registerActionParameter),\n                receiverParameter,\n                registerActionParameter).Compile();\n        }\n\n        // (object receiverParameter, Action<object> actionObjectParameter) =>\n        //     ((symbolStartAnalysisContextType)receiverParameter).RegisterCodeBlockStartAction<languageKindEnumType>(contextLanguageParameter => actionObjectParameter.Invoke(contextLanguageParameter))\n        Action<object, Action<object>> CreateRegistrationMethodCodeBlockStart(Type languageKindEnumType)\n        {\n            if (symbolStartAnalysisContextType is null || languageKindEnumType is null)\n            {\n                return static (_, _) => { };\n            }\n            var receiverParameter = Parameter(typeof(object));\n            var actionObjectParameter = Parameter(typeof(Action<object>));\n            var contextLanguageType = typeof(CodeBlockStartAnalysisContext<>).MakeGenericType(languageKindEnumType);\n            var actionContextLanguageType = typeof(Action<>).MakeGenericType(contextLanguageType);\n            var contextLanguageParameter = Parameter(contextLanguageType);\n            var registerActionParameter = Parameter(actionContextLanguageType);\n            // Action<CodeBlockStartAnalysisContext<languageKindEnumType>> innerRegistration = contextLanguageParameter => actionObjectParameter.Invoke(contextLanguageParameter)\n            var innerRegistration = Lambda(actionContextLanguageType, Call(actionObjectParameter, nameof(Action.Invoke), [], contextLanguageParameter), contextLanguageParameter);\n            return Lambda<Action<object, Action<object>>>(\n                Call(Convert(receiverParameter, symbolStartAnalysisContextType), nameof(RegisterCodeBlockStartAction), [languageKindEnumType], innerRegistration),\n                receiverParameter,\n                actionObjectParameter).Compile();\n        }\n\n        // (object receiverParameter, Action<TContext> registerActionParameter, TParameter additionalParameter) =>\n        //     ((symbolStartAnalysisContextType)receiverParameter).\"registrationMethodName\"<typeArguments>(registerActionParameter, additionalParameter)\n        Action<object, Action<TContext>, TParameter> CreateRegistrationMethodWithAdditionalParameter<TContext, TParameter>(string registrationMethodName, params Type[] typeArguments)\n        {\n            if (symbolStartAnalysisContextType is null)\n            {\n                return static (_, _, _) => { };\n            }\n            var receiverParameter = Parameter(typeof(object));\n            var registerActionParameter = Parameter(typeof(Action<TContext>));\n            var additionalParameter = Parameter(typeof(TParameter));\n            return Lambda<Action<object, Action<TContext>, TParameter>>(\n                Call(Convert(receiverParameter, symbolStartAnalysisContextType), registrationMethodName, typeArguments, registerActionParameter, additionalParameter),\n                receiverParameter,\n                registerActionParameter,\n                additionalParameter).Compile();\n        }\n\n        // (object receiverParameter, Action<SyntaxNodeAnalysisContext> registerActionParameter, object syntaxKindArrayParameter) =>\n        //     ((symbolStartAnalysisContextType)receiverParameter).RegisterSyntaxNodeAction<languageKindEnumType>(contextParameter => registerActionParameter.Invoke(contextParameter), (languageKindEnumType[])syntaxKindArrayParameter)\n        Action<object, Action<SyntaxNodeAnalysisContext>, object> CreateRegistrationMethodSyntaxNode(Type languageKindEnumType)\n        {\n            if (symbolStartAnalysisContextType is null || languageKindEnumType is null)\n            {\n                return static (_, _, _) => { };\n            }\n            var receiverParameter = Parameter(typeof(object));\n            var registerActionParameter = Parameter(typeof(Action<SyntaxNodeAnalysisContext>));\n            var syntaxKindArrayParameter = Parameter(typeof(object));\n            var syntaxKindArrayType = languageKindEnumType.MakeArrayType();\n            return Lambda<Action<object, Action<SyntaxNodeAnalysisContext>, object>>(\n                Call(Convert(receiverParameter, symbolStartAnalysisContextType), nameof(RegisterSyntaxNodeAction), [languageKindEnumType], registerActionParameter, Convert(syntaxKindArrayParameter, syntaxKindArrayType)),\n                receiverParameter,\n                registerActionParameter,\n                syntaxKindArrayParameter).Compile();\n        }\n\n        static Type LoadSymbolStartAnalysisContextType()\n        {\n            try\n            {\n                return typeof(CompilationStartAnalysisContext).Assembly.GetType(\"Microsoft.CodeAnalysis.Diagnostics.SymbolStartAnalysisContext\", throwOnError: false);\n            }\n            // https://learn.microsoft.com/en-us/dotnet/api/system.reflection.assembly.gettype?view=net-8.0#system-reflection-assembly-gettype(system-string-system-boolean)\n            catch\n            {\n                return null;\n            }\n        }\n\n        static Type LoadLanguageKindEnumVBType()\n        {\n            try\n            {\n                return Type.GetType($\"{VBSyntaxKind}, Microsoft.CodeAnalysis.VisualBasic, Culture=neutral, PublicKeyToken=31bf3856ad364e35\", throwOnError: false);\n            }\n            // https://learn.microsoft.com/en-us/dotnet/api/system.type.gettype?view=net-8.0#system-type-gettype(system-string-system-boolean)\n            catch\n            {\n                return null;\n            }\n        }\n    }\n\n    public SymbolStartAnalysisContextWrapper(object roslynSymbolStartAnalysisContext) =>\n        RoslynSymbolStartAnalysisContext = roslynSymbolStartAnalysisContext;\n\n    public void RegisterCodeBlockAction(Action<CodeBlockAnalysisContext> action) =>\n        RegisterCodeBlockActionMethod(RoslynSymbolStartAnalysisContext, action);\n\n    public void RegisterCodeBlockStartAction<TLanguageKindEnum>(Action<CodeBlockStartAnalysisContext<TLanguageKindEnum>> action) where TLanguageKindEnum : struct\n    {\n        var languageKindType = typeof(TLanguageKindEnum);\n        if (languageKindType == typeof(CS.SyntaxKind))\n        {\n            RegisterCodeBlockStartActionCS(RoslynSymbolStartAnalysisContext, (Action<CodeBlockStartAnalysisContext<CS.SyntaxKind>>)action);\n        }\n        else if (languageKindType.FullName == VBSyntaxKind)\n        {\n            RegisterCodeBlockStartActionVB(RoslynSymbolStartAnalysisContext, x => action((CodeBlockStartAnalysisContext<TLanguageKindEnum>)x));\n        }\n        else\n        {\n            throw new ArgumentException(\"Invalid type parameter.\", nameof(TLanguageKindEnum));\n        }\n    }\n\n    public void RegisterOperationAction(Action<OperationAnalysisContext> action, ImmutableArray<OperationKind> operationKinds) =>\n        RegisterOperationActionMethod(RoslynSymbolStartAnalysisContext, action, operationKinds);\n\n    public void RegisterOperationBlockAction(Action<OperationBlockAnalysisContext> action) =>\n        RegisterOperationBlockActionMethod(RoslynSymbolStartAnalysisContext, action);\n\n    public void RegisterOperationBlockStartAction(Action<OperationBlockStartAnalysisContext> action) =>\n        RegisterOperationBlockStartActionMethod(RoslynSymbolStartAnalysisContext, action);\n\n    public void RegisterSymbolEndAction(Action<SymbolAnalysisContext> action) =>\n        RegisterSymbolEndActionMethod(RoslynSymbolStartAnalysisContext, action);\n\n    public void RegisterSyntaxNodeAction<TLanguageKindEnum>(Action<SyntaxNodeAnalysisContext> action, params TLanguageKindEnum[] syntaxKinds) where TLanguageKindEnum : struct\n    {\n        var languageKindType = typeof(TLanguageKindEnum);\n        if (languageKindType == typeof(CS.SyntaxKind))\n        {\n            RegisterSyntaxNodeActionCS(RoslynSymbolStartAnalysisContext, action, syntaxKinds.Cast<CS.SyntaxKind>().ToImmutableArray());\n        }\n        else if (languageKindType.FullName == VBSyntaxKind)\n        {\n            RegisterSyntaxNodeActionVB(RoslynSymbolStartAnalysisContext, action, syntaxKinds);\n        }\n        else\n        {\n            throw new ArgumentException(\"Invalid type parameter.\", nameof(TLanguageKindEnum));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/AnalyzerConfigOptionsProviderWrapper.cs",
    "content": "﻿// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.\n// Licensed under the MIT License. See LICENSE in the project root for license information.\n\n#nullable disable\n\nnamespace StyleCop.Analyzers.Lightup\n{\n    using System;\n    using Microsoft.CodeAnalysis;\n\n    public readonly struct AnalyzerConfigOptionsProviderWrapper\n    {\n        internal const string WrappedTypeName = \"Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptionsProvider\";\n        private static readonly Type WrappedType;\n\n        private static readonly Func<object, object> GlobalOptionsAccessor;\n        private static readonly Func<object, SyntaxTree, object> GetOptionsSyntaxTreeAccessor;\n        private static readonly Func<object, AdditionalText, object> GetOptionsAdditionalTextAccessor;\n\n        private readonly object node;\n\n        static AnalyzerConfigOptionsProviderWrapper()\n        {\n            WrappedType = WrapperHelper.GetWrappedType(typeof(AnalyzerConfigOptionsProviderWrapper));\n\n            GlobalOptionsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<object, object>(WrappedType, nameof(GlobalOptions));\n            GetOptionsSyntaxTreeAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<object, SyntaxTree, object>(WrappedType, typeof(SyntaxTree), nameof(GetOptions));\n            GetOptionsAdditionalTextAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<object, AdditionalText, object>(WrappedType, typeof(AdditionalText), nameof(GetOptions));\n        }\n\n        private AnalyzerConfigOptionsProviderWrapper(object node)\n        {\n            this.node = node;\n        }\n\n        public AnalyzerConfigOptionsWrapper GlobalOptions\n        {\n            get\n            {\n                if (this.node == null && WrappedType == null)\n                {\n                    // Gracefully fall back to a collection with no values\n                    return AnalyzerConfigOptionsWrapper.FromObject(null);\n                }\n\n                return AnalyzerConfigOptionsWrapper.FromObject(GlobalOptionsAccessor(this.node));\n            }\n        }\n\n        public static AnalyzerConfigOptionsProviderWrapper FromObject(object node)\n        {\n            if (node == null)\n            {\n                return default;\n            }\n\n            if (!IsInstance(node))\n            {\n                throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n            }\n\n            return new AnalyzerConfigOptionsProviderWrapper(node);\n        }\n\n        public static bool IsInstance(object obj)\n        {\n            return obj != null && LightupHelpers.CanWrapObject(obj, WrappedType);\n        }\n\n        public AnalyzerConfigOptionsWrapper GetOptions(SyntaxTree tree)\n        {\n            if (this.node == null && WrappedType == null)\n            {\n                // Gracefully fall back to a collection with no values\n                if (tree == null)\n                {\n                    throw new ArgumentNullException(nameof(tree));\n                }\n\n                return AnalyzerConfigOptionsWrapper.FromObject(null);\n            }\n\n            return AnalyzerConfigOptionsWrapper.FromObject(GetOptionsSyntaxTreeAccessor(this.node, tree));\n        }\n\n        public AnalyzerConfigOptionsWrapper GetOptions(AdditionalText textFile)\n        {\n            if (this.node == null && WrappedType == null)\n            {\n                // Gracefully fall back to a collection with no values\n                if (textFile == null)\n                {\n                    throw new ArgumentNullException(nameof(textFile));\n                }\n\n                return AnalyzerConfigOptionsWrapper.FromObject(null);\n            }\n\n            return AnalyzerConfigOptionsWrapper.FromObject(GetOptionsAdditionalTextAccessor(this.node, textFile));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/AnalyzerConfigOptionsWrapper.cs",
    "content": "﻿// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.\n// Licensed under the MIT License. See LICENSE in the project root for license information.\n\n#nullable disable\n\nnamespace StyleCop.Analyzers.Lightup\n{\n    using System;\n\n    public readonly struct AnalyzerConfigOptionsWrapper\n    {\n        internal const string WrappedTypeName = \"Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions\";\n        private static readonly Type WrappedType;\n\n        private static readonly Func<StringComparer> KeyComparerAccessor;\n        private static readonly TryGetValueAccessor<object, string, string> TryGetValueAccessor;\n\n        private readonly object node;\n\n        static AnalyzerConfigOptionsWrapper()\n        {\n            WrappedType = WrapperHelper.GetWrappedType(typeof(AnalyzerConfigOptionsWrapper));\n\n            KeyComparerAccessor = LightupHelpers.CreateStaticPropertyAccessor<StringComparer>(WrappedType, nameof(KeyComparer));\n            TryGetValueAccessor = LightupHelpers.CreateTryGetValueAccessor<object, string, string>(WrappedType, typeof(string), nameof(TryGetValue));\n        }\n\n        private AnalyzerConfigOptionsWrapper(object node)\n        {\n            this.node = node;\n        }\n\n        public static StringComparer KeyComparer\n        {\n            get\n            {\n                if (WrappedType is null)\n                {\n                    // Gracefully fall back to a collection with no values\n                    return StringComparer.Ordinal;\n                }\n\n                return KeyComparerAccessor();\n            }\n        }\n\n        public static AnalyzerConfigOptionsWrapper FromObject(object node)\n        {\n            if (node == null)\n            {\n                return default;\n            }\n\n            if (!IsInstance(node))\n            {\n                throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n            }\n\n            return new AnalyzerConfigOptionsWrapper(node);\n        }\n\n        public static bool IsInstance(object obj)\n        {\n            return obj != null && LightupHelpers.CanWrapObject(obj, WrappedType);\n        }\n\n        public bool TryGetValue(string key, out string value)\n        {\n            if (this.node is null && WrappedType is null)\n            {\n                // Gracefully fall back to a collection with no values\n                value = null;\n                return false;\n            }\n\n            return TryGetValueAccessor(this.node, key, out value);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/AnalyzerOptionsExtensions.cs",
    "content": "﻿// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.\n// Licensed under the MIT License. See LICENSE in the project root for license information.\n\n#nullable disable\n\nnamespace StyleCop.Analyzers.Lightup\n{\n    using System;\n    using Microsoft.CodeAnalysis.Diagnostics;\n\n    public static class AnalyzerOptionsExtensions\n    {\n        private static readonly Func<AnalyzerOptions, object> AnalyzerConfigOptionsProviderAccessor;\n\n        static AnalyzerOptionsExtensions()\n        {\n            AnalyzerConfigOptionsProviderAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<AnalyzerOptions, object>(typeof(AnalyzerOptions), nameof(AnalyzerConfigOptionsProvider));\n        }\n\n        public static AnalyzerConfigOptionsProviderWrapper AnalyzerConfigOptionsProvider(this AnalyzerOptions options)\n        {\n            return AnalyzerConfigOptionsProviderWrapper.FromObject(AnalyzerConfigOptionsProviderAccessor(options));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/ArgumentSyntaxExtensions.cs",
    "content": "﻿// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.\n// Licensed under the MIT License. See LICENSE in the project root for license information.\n\n#nullable disable\n\nnamespace StyleCop.Analyzers.Lightup\n{\n    using System;\n    using Microsoft.CodeAnalysis;\n    using Microsoft.CodeAnalysis.CSharp.Syntax;\n\n    public static class ArgumentSyntaxExtensions\n    {\n        private static readonly Func<ArgumentSyntax, SyntaxToken> RefKindKeywordAccessor;\n        private static readonly Func<ArgumentSyntax, SyntaxToken, ArgumentSyntax> WithRefKindKeywordAccessor;\n\n        static ArgumentSyntaxExtensions()\n        {\n            RefKindKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ArgumentSyntax, SyntaxToken>(typeof(ArgumentSyntax), nameof(RefKindKeyword));\n            WithRefKindKeywordAccessor = LightupHelpers.CreateSyntaxWithPropertyAccessor<ArgumentSyntax, SyntaxToken>(typeof(ArgumentSyntax), nameof(RefKindKeyword));\n        }\n\n        public static SyntaxToken RefKindKeyword(this ArgumentSyntax syntax)\n        {\n            return RefKindKeywordAccessor(syntax);\n        }\n\n        public static ArgumentSyntax WithRefKindKeyword(this ArgumentSyntax syntax, SyntaxToken refKindKeyword)\n        {\n            return WithRefKindKeywordAccessor(syntax, refKindKeyword);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/BaseMethodDeclarationSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\n\nnamespace StyleCop.Analyzers.Lightup;\n\npublic static class BaseMethodDeclarationSyntaxExtensions\n{\n    public static ArrowExpressionClauseSyntax ExpressionBody(this BaseMethodDeclarationSyntax syntax) =>\n        // Prior to C# 7, the ExpressionBody properties did not have ExpressionBody on BaseMethodDeclarationSyntax but on\n        // some of the derived types only. Therefore we need to special case the derived types here.\n        syntax.Kind() switch\n        {\n            SyntaxKind.MethodDeclaration => ((MethodDeclarationSyntax)syntax).ExpressionBody,\n            SyntaxKind.OperatorDeclaration => ((OperatorDeclarationSyntax)syntax).ExpressionBody,\n            SyntaxKind.ConversionOperatorDeclaration => ((ConversionOperatorDeclarationSyntax)syntax).ExpressionBody,\n            _ => BaseMethodDeclarationSyntaxShimExtensions.get_ExpressionBody(syntax),\n        };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/CSharp7.md",
    "content": "﻿# C# 7 APIs supported via light-up\n\nSee [dotnet/roslyn@c2af711](https://github.com/dotnet/roslyn/commit/c2af71127234e2b6df231fad3b9f7db6cc7cb444).\n\n## Semantics\n\n* [ ] `Microsoft.CodeAnalysis.CommandLineArguments.DisplayVersion.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.CommandLineArguments.EmbeddedFiles.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.CommandLineSourceFile>`\n* [ ] `Microsoft.CodeAnalysis.CommandLineArguments.SourceLink.get -> string`\n* [ ] `Microsoft.CodeAnalysis.Compilation.CreateAnonymousTypeSymbol(System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ITypeSymbol> memberTypes, System.Collections.Immutable.ImmutableArray<string> memberNames, System.Collections.Immutable.ImmutableArray<bool> memberIsReadOnly = default(System.Collections.Immutable.ImmutableArray<bool>), System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Location> memberLocations = default(System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Location>)) -> Microsoft.CodeAnalysis.INamedTypeSymbol`\n* [ ] `Microsoft.CodeAnalysis.Compilation.CreateErrorNamespaceSymbol(Microsoft.CodeAnalysis.INamespaceSymbol container, string name) -> Microsoft.CodeAnalysis.INamespaceSymbol`\n* [ ] `Microsoft.CodeAnalysis.Compilation.CreateTupleTypeSymbol(Microsoft.CodeAnalysis.INamedTypeSymbol underlyingType, System.Collections.Immutable.ImmutableArray<string> elementNames = default(System.Collections.Immutable.ImmutableArray<string>), System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Location> elementLocations = default(System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Location>)) -> Microsoft.CodeAnalysis.INamedTypeSymbol`\n* [ ] `Microsoft.CodeAnalysis.Compilation.CreateTupleTypeSymbol(System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ITypeSymbol> elementTypes, System.Collections.Immutable.ImmutableArray<string> elementNames = default(System.Collections.Immutable.ImmutableArray<string>), System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Location> elementLocations = default(System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Location>)) -> Microsoft.CodeAnalysis.INamedTypeSymbol`\n* [ ] `Microsoft.CodeAnalysis.Compilation.Emit(System.IO.Stream peStream, System.IO.Stream pdbStream = null, System.IO.Stream xmlDocumentationStream = null, System.IO.Stream win32Resources = null, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.ResourceDescription> manifestResources = null, Microsoft.CodeAnalysis.Emit.EmitOptions options = null, Microsoft.CodeAnalysis.IMethodSymbol debugEntryPoint = null, System.IO.Stream sourceLinkStream = null, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.EmbeddedText> embeddedTexts = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.Emit.EmitResult`\n* [ ] `Microsoft.CodeAnalysis.Compilation.Emit(System.IO.Stream peStream, System.IO.Stream pdbStream, System.IO.Stream xmlDocumentationStream, System.IO.Stream win32Resources, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.ResourceDescription> manifestResources, Microsoft.CodeAnalysis.Emit.EmitOptions options, Microsoft.CodeAnalysis.IMethodSymbol debugEntryPoint, System.Threading.CancellationToken cancellationToken) -> Microsoft.CodeAnalysis.Emit.EmitResult`\n* [ ] `Microsoft.CodeAnalysis.Compilation.GetUnreferencedAssemblyIdentities(Microsoft.CodeAnalysis.Diagnostic diagnostic) -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.AssemblyIdentity>`\n* [ ] `Microsoft.CodeAnalysis.CompilationOptions.WithConcurrentBuild(bool concurrent) -> Microsoft.CodeAnalysis.CompilationOptions`\n* [ ] `Microsoft.CodeAnalysis.CompilationOptions.WithCryptoKeyContainer(string cryptoKeyContainer) -> Microsoft.CodeAnalysis.CompilationOptions`\n* [ ] `Microsoft.CodeAnalysis.CompilationOptions.WithCryptoKeyFile(string cryptoKeyFile) -> Microsoft.CodeAnalysis.CompilationOptions`\n* [ ] `Microsoft.CodeAnalysis.CompilationOptions.WithCryptoPublicKey(System.Collections.Immutable.ImmutableArray<byte> cryptoPublicKey) -> Microsoft.CodeAnalysis.CompilationOptions`\n* [ ] `Microsoft.CodeAnalysis.CompilationOptions.WithDelaySign(bool? delaySign) -> Microsoft.CodeAnalysis.CompilationOptions`\n* [ ] `Microsoft.CodeAnalysis.CompilationOptions.WithMainTypeName(string mainTypeName) -> Microsoft.CodeAnalysis.CompilationOptions`\n* [ ] `Microsoft.CodeAnalysis.CompilationOptions.WithModuleName(string moduleName) -> Microsoft.CodeAnalysis.CompilationOptions`\n* [ ] `Microsoft.CodeAnalysis.CompilationOptions.WithOverflowChecks(bool checkOverflow) -> Microsoft.CodeAnalysis.CompilationOptions`\n* [ ] `Microsoft.CodeAnalysis.CompilationOptions.WithScriptClassName(string scriptClassName) -> Microsoft.CodeAnalysis.CompilationOptions`\n* [ ] `Microsoft.CodeAnalysis.DesktopStrongNameProvider.DesktopStrongNameProvider(System.Collections.Immutable.ImmutableArray<string> keyFileSearchPaths = default(System.Collections.Immutable.ImmutableArray<string>), string tempPath = null) -> void`\n* [ ] `Microsoft.CodeAnalysis.DesktopStrongNameProvider.DesktopStrongNameProvider(System.Collections.Immutable.ImmutableArray<string> keyFileSearchPaths) -> void`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.AnalyzerTelemetryInfo() -> void`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.CodeBlockActionsCount.set -> void`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.CodeBlockEndActionsCount.set -> void`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.CodeBlockStartActionsCount.set -> void`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.CompilationActionsCount.set -> void`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.CompilationEndActionsCount.set -> void`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.CompilationStartActionsCount.set -> void`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.ExecutionTime.set -> void`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.OperationActionsCount.get -> int`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.OperationActionsCount.set -> void`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.OperationBlockActionsCount.get -> int`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.OperationBlockActionsCount.set -> void`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.OperationBlockEndActionsCount.get -> int`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.OperationBlockEndActionsCount.set -> void`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.OperationBlockStartActionsCount.get -> int`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.OperationBlockStartActionsCount.set -> void`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.SemanticModelActionsCount.set -> void`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.SymbolActionsCount.set -> void`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.SyntaxNodeActionsCount.set -> void`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.SyntaxTreeActionsCount.set -> void`\n* [ ] `Microsoft.CodeAnalysis.EmbeddedText`\n* [ ] `Microsoft.CodeAnalysis.EmbeddedText.Checksum.get -> System.Collections.Immutable.ImmutableArray<byte>`\n* [ ] `Microsoft.CodeAnalysis.EmbeddedText.ChecksumAlgorithm.get -> Microsoft.CodeAnalysis.Text.SourceHashAlgorithm`\n* [ ] `Microsoft.CodeAnalysis.EmbeddedText.FilePath.get -> string`\n* [ ] `Microsoft.CodeAnalysis.Emit.EmitOptions.EmitOptions(bool metadataOnly = false, Microsoft.CodeAnalysis.Emit.DebugInformationFormat debugInformationFormat = (Microsoft.CodeAnalysis.Emit.DebugInformationFormat)0, string pdbFilePath = null, string outputNameOverride = null, int fileAlignment = 0, ulong baseAddress = 0, bool highEntropyVirtualAddressSpace = false, Microsoft.CodeAnalysis.SubsystemVersion subsystemVersion = default(Microsoft.CodeAnalysis.SubsystemVersion), string runtimeMetadataVersion = null, bool tolerateErrors = false, bool includePrivateMembers = false, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Emit.InstrumentationKind> instrumentationKinds = default(System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Emit.InstrumentationKind>)) -> void`\n* [ ] `Microsoft.CodeAnalysis.Emit.EmitOptions.EmitOptions(bool metadataOnly, Microsoft.CodeAnalysis.Emit.DebugInformationFormat debugInformationFormat, string pdbFilePath, string outputNameOverride, int fileAlignment, ulong baseAddress, bool highEntropyVirtualAddressSpace, Microsoft.CodeAnalysis.SubsystemVersion subsystemVersion, string runtimeMetadataVersion, bool tolerateErrors, bool includePrivateMembers) -> void`\n* [ ] `Microsoft.CodeAnalysis.Emit.EmitOptions.InstrumentationKinds.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Emit.InstrumentationKind>`\n* [ ] `Microsoft.CodeAnalysis.Emit.EmitOptions.WithInstrumentationKinds(System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Emit.InstrumentationKind> instrumentationKinds) -> Microsoft.CodeAnalysis.Emit.EmitOptions`\n* [ ] `Microsoft.CodeAnalysis.Emit.InstrumentationKind`\n* [ ] `Microsoft.CodeAnalysis.Emit.InstrumentationKind.None = 0 -> Microsoft.CodeAnalysis.Emit.InstrumentationKind`\n* [ ] `Microsoft.CodeAnalysis.Emit.InstrumentationKind.TestCoverage = 1 -> Microsoft.CodeAnalysis.Emit.InstrumentationKind`\n* [ ] `Microsoft.CodeAnalysis.IArrayTypeSymbol.IsSZArray.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.IArrayTypeSymbol.LowerBounds.get -> System.Collections.Immutable.ImmutableArray<int>`\n* [ ] `Microsoft.CodeAnalysis.IArrayTypeSymbol.Sizes.get -> System.Collections.Immutable.ImmutableArray<int>`\n* [ ] `Microsoft.CodeAnalysis.IDiscardSymbol`\n* [ ] `Microsoft.CodeAnalysis.IDiscardSymbol.Type.get -> Microsoft.CodeAnalysis.ITypeSymbol`\n* [x] `Microsoft.CodeAnalysis.IFieldSymbol.CorrespondingTupleField.get -> Microsoft.CodeAnalysis.IFieldSymbol`\n* [ ] `Microsoft.CodeAnalysis.ILocalSymbol.IsRef.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.IMethodSymbol.RefCustomModifiers.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.CustomModifier>`\n* [ ] `Microsoft.CodeAnalysis.IMethodSymbol.ReturnsByRef.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.INamedTypeSymbol.GetTypeArgumentCustomModifiers(int ordinal) -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.CustomModifier>`\n* [ ] `Microsoft.CodeAnalysis.INamedTypeSymbol.IsComImport.get -> bool`\n* [x] `Microsoft.CodeAnalysis.INamedTypeSymbol.TupleElements.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.IFieldSymbol>`\n* [x] `Microsoft.CodeAnalysis.INamedTypeSymbol.TupleUnderlyingType.get -> Microsoft.CodeAnalysis.INamedTypeSymbol`\n* [ ] `Microsoft.CodeAnalysis.IParameterSymbol.RefCustomModifiers.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.CustomModifier>`\n* [ ] `Microsoft.CodeAnalysis.IPropertySymbol.RefCustomModifiers.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.CustomModifier>`\n* [ ] `Microsoft.CodeAnalysis.IPropertySymbol.ReturnsByRef.get -> bool`\n* [x] `Microsoft.CodeAnalysis.ITypeSymbol.IsTupleType.get -> bool`\n* [x] `Microsoft.CodeAnalysis.MethodKind.LocalFunction = 17 -> Microsoft.CodeAnalysis.MethodKind`\n* [ ] `Microsoft.CodeAnalysis.PortableExecutableReference.GetMetadataId() -> Microsoft.CodeAnalysis.MetadataId`\n* [ ] `Microsoft.CodeAnalysis.SymbolDisplayFormat.RemoveGenericsOptions(Microsoft.CodeAnalysis.SymbolDisplayGenericsOptions options) -> Microsoft.CodeAnalysis.SymbolDisplayFormat`\n* [ ] `Microsoft.CodeAnalysis.SymbolDisplayFormat.RemoveLocalOptions(Microsoft.CodeAnalysis.SymbolDisplayLocalOptions options) -> Microsoft.CodeAnalysis.SymbolDisplayFormat`\n* [ ] `Microsoft.CodeAnalysis.SymbolDisplayFormat.RemoveMiscellaneousOptions(Microsoft.CodeAnalysis.SymbolDisplayMiscellaneousOptions options) -> Microsoft.CodeAnalysis.SymbolDisplayFormat`\n* [x] `Microsoft.CodeAnalysis.SymbolDisplayLocalOptions.IncludeRef = 4 -> Microsoft.CodeAnalysis.SymbolDisplayLocalOptions`\n* [x] `Microsoft.CodeAnalysis.SymbolDisplayMemberOptions.IncludeRef = 128 -> Microsoft.CodeAnalysis.SymbolDisplayMemberOptions`\n* [x] `Microsoft.CodeAnalysis.SymbolKind.Discard = 19 -> Microsoft.CodeAnalysis.SymbolKind`\n* [ ] `Microsoft.CodeAnalysis.Text.SourceText.CanBeEmbedded.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.Text.SourceText.GetChecksum() -> System.Collections.Immutable.ImmutableArray<byte>`\n* [ ] `abstract Microsoft.CodeAnalysis.CompilationOptions.Language.get -> string`\n* [ ] `abstract Microsoft.CodeAnalysis.ParseOptions.Language.get -> string`\n* [x] ~~`override Microsoft.CodeAnalysis.SyntaxNode.ToString() -> string`~~\n* [ ] `static Microsoft.CodeAnalysis.CaseInsensitiveComparison.StartsWith(string value, string possibleStart) -> bool`\n* [ ] `static Microsoft.CodeAnalysis.EmbeddedText.FromBytes(string filePath, System.ArraySegment<byte> bytes, Microsoft.CodeAnalysis.Text.SourceHashAlgorithm checksumAlgorithm = Microsoft.CodeAnalysis.Text.SourceHashAlgorithm.Sha1) -> Microsoft.CodeAnalysis.EmbeddedText`\n* [ ] `static Microsoft.CodeAnalysis.EmbeddedText.FromSource(string filePath, Microsoft.CodeAnalysis.Text.SourceText text) -> Microsoft.CodeAnalysis.EmbeddedText`\n* [ ] `static Microsoft.CodeAnalysis.EmbeddedText.FromStream(string filePath, System.IO.Stream stream, Microsoft.CodeAnalysis.Text.SourceHashAlgorithm checksumAlgorithm = Microsoft.CodeAnalysis.Text.SourceHashAlgorithm.Sha1) -> Microsoft.CodeAnalysis.EmbeddedText`\n* [ ] `static Microsoft.CodeAnalysis.SeparatedSyntaxList<TNode>.implicit operator Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.SyntaxNode>(Microsoft.CodeAnalysis.SeparatedSyntaxList<TNode> nodes) -> Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.SyntaxNode>`\n* [ ] `static Microsoft.CodeAnalysis.SeparatedSyntaxList<TNode>.implicit operator Microsoft.CodeAnalysis.SeparatedSyntaxList<TNode>(Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.SyntaxNode> nodes) -> Microsoft.CodeAnalysis.SeparatedSyntaxList<TNode>`\n* [ ] `static Microsoft.CodeAnalysis.SyntaxNodeExtensions.WithoutTrivia(this Microsoft.CodeAnalysis.SyntaxToken token) -> Microsoft.CodeAnalysis.SyntaxToken`\n* [ ] `static Microsoft.CodeAnalysis.Text.SourceText.From(System.IO.Stream stream, System.Text.Encoding encoding = null, Microsoft.CodeAnalysis.Text.SourceHashAlgorithm checksumAlgorithm = Microsoft.CodeAnalysis.Text.SourceHashAlgorithm.Sha1, bool throwIfBinaryDetected = false, bool canBeEmbedded = false) -> Microsoft.CodeAnalysis.Text.SourceText`\n* [ ] `static Microsoft.CodeAnalysis.Text.SourceText.From(System.IO.Stream stream, System.Text.Encoding encoding, Microsoft.CodeAnalysis.Text.SourceHashAlgorithm checksumAlgorithm, bool throwIfBinaryDetected) -> Microsoft.CodeAnalysis.Text.SourceText`\n* [ ] `static Microsoft.CodeAnalysis.Text.SourceText.From(System.IO.TextReader reader, int length, System.Text.Encoding encoding = null, Microsoft.CodeAnalysis.Text.SourceHashAlgorithm checksumAlgorithm = Microsoft.CodeAnalysis.Text.SourceHashAlgorithm.Sha1) -> Microsoft.CodeAnalysis.Text.SourceText`\n* [ ] `static Microsoft.CodeAnalysis.Text.SourceText.From(byte[] buffer, int length, System.Text.Encoding encoding = null, Microsoft.CodeAnalysis.Text.SourceHashAlgorithm checksumAlgorithm = Microsoft.CodeAnalysis.Text.SourceHashAlgorithm.Sha1, bool throwIfBinaryDetected = false, bool canBeEmbedded = false) -> Microsoft.CodeAnalysis.Text.SourceText`\n* [ ] `static Microsoft.CodeAnalysis.Text.SourceText.From(byte[] buffer, int length, System.Text.Encoding encoding, Microsoft.CodeAnalysis.Text.SourceHashAlgorithm checksumAlgorithm, bool throwIfBinaryDetected) -> Microsoft.CodeAnalysis.Text.SourceText`\n* [ ] `virtual Microsoft.CodeAnalysis.SymbolVisitor.VisitDiscard(Microsoft.CodeAnalysis.IDiscardSymbol symbol) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.SymbolVisitor<TResult>.VisitDiscard(Microsoft.CodeAnalysis.IDiscardSymbol symbol) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.SyntaxNode.ChildThatContainsPosition(int position) -> Microsoft.CodeAnalysis.SyntaxNodeOrToken`\n* [ ] `virtual Microsoft.CodeAnalysis.SyntaxNode.SerializeTo(System.IO.Stream stream, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.SyntaxNode.ToFullString() -> string`\n* [ ] `virtual Microsoft.CodeAnalysis.SyntaxNode.WriteTo(System.IO.TextWriter writer) -> void`\n\n## Syntax\n\n* [ ] `Microsoft.CodeAnalysis.CSharp.CSharpParseOptions.CSharpParseOptions(Microsoft.CodeAnalysis.CSharp.LanguageVersion languageVersion = Microsoft.CodeAnalysis.CSharp.LanguageVersion.Default, Microsoft.CodeAnalysis.DocumentationMode documentationMode = Microsoft.CodeAnalysis.DocumentationMode.Parse, Microsoft.CodeAnalysis.SourceCodeKind kind = Microsoft.CodeAnalysis.SourceCodeKind.Regular, System.Collections.Generic.IEnumerable<string> preprocessorSymbols = null) -> void`\n* [ ] `Microsoft.CodeAnalysis.CSharp.CSharpParseOptions.SpecifiedLanguageVersion.get -> Microsoft.CodeAnalysis.CSharp.LanguageVersion`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Conversion.IsThrow.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Conversion.IsTupleConversion.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Conversion.IsTupleLiteralConversion.get -> bool`\n* [x] `Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp7 = 7 -> Microsoft.CodeAnalysis.CSharp.LanguageVersion`\n* [x] `Microsoft.CodeAnalysis.CSharp.LanguageVersion.Default = 0 -> Microsoft.CodeAnalysis.CSharp.LanguageVersion`\n* [x] `Microsoft.CodeAnalysis.CSharp.LanguageVersion.Latest = 2147483647 -> Microsoft.CodeAnalysis.CSharp.LanguageVersion`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.AccessorDeclarationSyntax.ExpressionBody.get -> Microsoft.CodeAnalysis.CSharp.Syntax.ArrowExpressionClauseSyntax`\n* [x] ~~`Microsoft.CodeAnalysis.CSharp.Syntax.AccessorDeclarationSyntax.Update(Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> attributeLists, Microsoft.CodeAnalysis.SyntaxTokenList modifiers, Microsoft.CodeAnalysis.SyntaxToken keyword, Microsoft.CodeAnalysis.CSharp.Syntax.BlockSyntax body, Microsoft.CodeAnalysis.CSharp.Syntax.ArrowExpressionClauseSyntax expressionBody, Microsoft.CodeAnalysis.SyntaxToken semicolonToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.AccessorDeclarationSyntax`~~\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.AccessorDeclarationSyntax.WithExpressionBody(Microsoft.CodeAnalysis.CSharp.Syntax.ArrowExpressionClauseSyntax expressionBody) -> Microsoft.CodeAnalysis.CSharp.Syntax.AccessorDeclarationSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.CasePatternSwitchLabelSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.CasePatternSwitchLabelSyntax.Pattern.get -> Microsoft.CodeAnalysis.CSharp.Syntax.PatternSyntax`\n* [x] ~~`Microsoft.CodeAnalysis.CSharp.Syntax.CasePatternSwitchLabelSyntax.Update(Microsoft.CodeAnalysis.SyntaxToken keyword, Microsoft.CodeAnalysis.CSharp.Syntax.PatternSyntax pattern, Microsoft.CodeAnalysis.CSharp.Syntax.WhenClauseSyntax whenClause, Microsoft.CodeAnalysis.SyntaxToken colonToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.CasePatternSwitchLabelSyntax`~~\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.CasePatternSwitchLabelSyntax.WhenClause.get -> Microsoft.CodeAnalysis.CSharp.Syntax.WhenClauseSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.CasePatternSwitchLabelSyntax.WithColonToken(Microsoft.CodeAnalysis.SyntaxToken colonToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.CasePatternSwitchLabelSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.CasePatternSwitchLabelSyntax.WithKeyword(Microsoft.CodeAnalysis.SyntaxToken keyword) -> Microsoft.CodeAnalysis.CSharp.Syntax.CasePatternSwitchLabelSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.CasePatternSwitchLabelSyntax.WithPattern(Microsoft.CodeAnalysis.CSharp.Syntax.PatternSyntax pattern) -> Microsoft.CodeAnalysis.CSharp.Syntax.CasePatternSwitchLabelSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.CasePatternSwitchLabelSyntax.WithWhenClause(Microsoft.CodeAnalysis.CSharp.Syntax.WhenClauseSyntax whenClause) -> Microsoft.CodeAnalysis.CSharp.Syntax.CasePatternSwitchLabelSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.CommonForEachStatementSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ConstantPatternSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ConstantPatternSyntax.Expression.get -> Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax`\n* [x] ~~`Microsoft.CodeAnalysis.CSharp.Syntax.ConstantPatternSyntax.Update(Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax expression) -> Microsoft.CodeAnalysis.CSharp.Syntax.ConstantPatternSyntax`~~\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ConstantPatternSyntax.WithExpression(Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax expression) -> Microsoft.CodeAnalysis.CSharp.Syntax.ConstantPatternSyntax`\n* [x] ~~`Microsoft.CodeAnalysis.CSharp.Syntax.ConstructorDeclarationSyntax.Update(Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> attributeLists, Microsoft.CodeAnalysis.SyntaxTokenList modifiers, Microsoft.CodeAnalysis.SyntaxToken identifier, Microsoft.CodeAnalysis.CSharp.Syntax.ParameterListSyntax parameterList, Microsoft.CodeAnalysis.CSharp.Syntax.ConstructorInitializerSyntax initializer, Microsoft.CodeAnalysis.CSharp.Syntax.BlockSyntax body, Microsoft.CodeAnalysis.CSharp.Syntax.ArrowExpressionClauseSyntax expressionBody, Microsoft.CodeAnalysis.SyntaxToken semicolonToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.ConstructorDeclarationSyntax`~~\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ConstructorDeclarationSyntax.WithExpressionBody(Microsoft.CodeAnalysis.CSharp.Syntax.ArrowExpressionClauseSyntax expressionBody) -> Microsoft.CodeAnalysis.CSharp.Syntax.ConstructorDeclarationSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.DeclarationExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.DeclarationExpressionSyntax.Designation.get -> Microsoft.CodeAnalysis.CSharp.Syntax.VariableDesignationSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.DeclarationExpressionSyntax.Type.get -> Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax`\n* [x] ~~`Microsoft.CodeAnalysis.CSharp.Syntax.DeclarationExpressionSyntax.Update(Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type, Microsoft.CodeAnalysis.CSharp.Syntax.VariableDesignationSyntax designation) -> Microsoft.CodeAnalysis.CSharp.Syntax.DeclarationExpressionSyntax`~~\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.DeclarationExpressionSyntax.WithDesignation(Microsoft.CodeAnalysis.CSharp.Syntax.VariableDesignationSyntax designation) -> Microsoft.CodeAnalysis.CSharp.Syntax.DeclarationExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.DeclarationExpressionSyntax.WithType(Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type) -> Microsoft.CodeAnalysis.CSharp.Syntax.DeclarationExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.DeclarationPatternSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.DeclarationPatternSyntax.Designation.get -> Microsoft.CodeAnalysis.CSharp.Syntax.VariableDesignationSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.DeclarationPatternSyntax.Type.get -> Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax`\n* [x] ~~`Microsoft.CodeAnalysis.CSharp.Syntax.DeclarationPatternSyntax.Update(Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type, Microsoft.CodeAnalysis.CSharp.Syntax.VariableDesignationSyntax designation) -> Microsoft.CodeAnalysis.CSharp.Syntax.DeclarationPatternSyntax`~~\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.DeclarationPatternSyntax.WithDesignation(Microsoft.CodeAnalysis.CSharp.Syntax.VariableDesignationSyntax designation) -> Microsoft.CodeAnalysis.CSharp.Syntax.DeclarationPatternSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.DeclarationPatternSyntax.WithType(Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type) -> Microsoft.CodeAnalysis.CSharp.Syntax.DeclarationPatternSyntax`\n* [x] ~~`Microsoft.CodeAnalysis.CSharp.Syntax.DestructorDeclarationSyntax.Update(Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> attributeLists, Microsoft.CodeAnalysis.SyntaxTokenList modifiers, Microsoft.CodeAnalysis.SyntaxToken tildeToken, Microsoft.CodeAnalysis.SyntaxToken identifier, Microsoft.CodeAnalysis.CSharp.Syntax.ParameterListSyntax parameterList, Microsoft.CodeAnalysis.CSharp.Syntax.BlockSyntax body, Microsoft.CodeAnalysis.CSharp.Syntax.ArrowExpressionClauseSyntax expressionBody, Microsoft.CodeAnalysis.SyntaxToken semicolonToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.DestructorDeclarationSyntax`~~\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.DestructorDeclarationSyntax.WithExpressionBody(Microsoft.CodeAnalysis.CSharp.Syntax.ArrowExpressionClauseSyntax expressionBody) -> Microsoft.CodeAnalysis.CSharp.Syntax.DestructorDeclarationSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.DiscardDesignationSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.DiscardDesignationSyntax.UnderscoreToken.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] ~~`Microsoft.CodeAnalysis.CSharp.Syntax.DiscardDesignationSyntax.Update(Microsoft.CodeAnalysis.SyntaxToken underscoreToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.DiscardDesignationSyntax`~~\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.DiscardDesignationSyntax.WithUnderscoreToken(Microsoft.CodeAnalysis.SyntaxToken underscoreToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.DiscardDesignationSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax`\n* [x] ~~`Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax.Update(Microsoft.CodeAnalysis.SyntaxToken forEachKeyword, Microsoft.CodeAnalysis.SyntaxToken openParenToken, Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax variable, Microsoft.CodeAnalysis.SyntaxToken inKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax expression, Microsoft.CodeAnalysis.SyntaxToken closeParenToken, Microsoft.CodeAnalysis.CSharp.Syntax.StatementSyntax statement) -> Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax`~~\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax.Variable.get -> Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax.WithCloseParenToken(Microsoft.CodeAnalysis.SyntaxToken closeParenToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax.WithExpression(Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax expression) -> Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax.WithForEachKeyword(Microsoft.CodeAnalysis.SyntaxToken forEachKeyword) -> Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax.WithInKeyword(Microsoft.CodeAnalysis.SyntaxToken inKeyword) -> Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax.WithOpenParenToken(Microsoft.CodeAnalysis.SyntaxToken openParenToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax.WithStatement(Microsoft.CodeAnalysis.CSharp.Syntax.StatementSyntax statement) -> Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax.WithVariable(Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax variable) -> Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.IsPatternExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.IsPatternExpressionSyntax.Expression.get -> Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.IsPatternExpressionSyntax.IsKeyword.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.IsPatternExpressionSyntax.Pattern.get -> Microsoft.CodeAnalysis.CSharp.Syntax.PatternSyntax`\n* [x] ~~`Microsoft.CodeAnalysis.CSharp.Syntax.IsPatternExpressionSyntax.Update(Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax expression, Microsoft.CodeAnalysis.SyntaxToken isKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.PatternSyntax pattern) -> Microsoft.CodeAnalysis.CSharp.Syntax.IsPatternExpressionSyntax`~~\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.IsPatternExpressionSyntax.WithExpression(Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax expression) -> Microsoft.CodeAnalysis.CSharp.Syntax.IsPatternExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.IsPatternExpressionSyntax.WithIsKeyword(Microsoft.CodeAnalysis.SyntaxToken isKeyword) -> Microsoft.CodeAnalysis.CSharp.Syntax.IsPatternExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.IsPatternExpressionSyntax.WithPattern(Microsoft.CodeAnalysis.CSharp.Syntax.PatternSyntax pattern) -> Microsoft.CodeAnalysis.CSharp.Syntax.IsPatternExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax.AddBodyStatements(params Microsoft.CodeAnalysis.CSharp.Syntax.StatementSyntax[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax.AddConstraintClauses(params Microsoft.CodeAnalysis.CSharp.Syntax.TypeParameterConstraintClauseSyntax[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax.AddModifiers(params Microsoft.CodeAnalysis.SyntaxToken[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax.AddParameterListParameters(params Microsoft.CodeAnalysis.CSharp.Syntax.ParameterSyntax[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax.AddTypeParameterListParameters(params Microsoft.CodeAnalysis.CSharp.Syntax.TypeParameterSyntax[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax.Body.get -> Microsoft.CodeAnalysis.CSharp.Syntax.BlockSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax.ConstraintClauses.get -> Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.TypeParameterConstraintClauseSyntax>`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax.ExpressionBody.get -> Microsoft.CodeAnalysis.CSharp.Syntax.ArrowExpressionClauseSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax.Identifier.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax.Modifiers.get -> Microsoft.CodeAnalysis.SyntaxTokenList`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax.ParameterList.get -> Microsoft.CodeAnalysis.CSharp.Syntax.ParameterListSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax.ReturnType.get -> Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax.SemicolonToken.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax.TypeParameterList.get -> Microsoft.CodeAnalysis.CSharp.Syntax.TypeParameterListSyntax`\n* [x] ~~`Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax.Update(Microsoft.CodeAnalysis.SyntaxTokenList modifiers, Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax returnType, Microsoft.CodeAnalysis.SyntaxToken identifier, Microsoft.CodeAnalysis.CSharp.Syntax.TypeParameterListSyntax typeParameterList, Microsoft.CodeAnalysis.CSharp.Syntax.ParameterListSyntax parameterList, Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.TypeParameterConstraintClauseSyntax> constraintClauses, Microsoft.CodeAnalysis.CSharp.Syntax.BlockSyntax body, Microsoft.CodeAnalysis.CSharp.Syntax.ArrowExpressionClauseSyntax expressionBody, Microsoft.CodeAnalysis.SyntaxToken semicolonToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax`~~\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax.WithBody(Microsoft.CodeAnalysis.CSharp.Syntax.BlockSyntax body) -> Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax.WithConstraintClauses(Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.TypeParameterConstraintClauseSyntax> constraintClauses) -> Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax.WithExpressionBody(Microsoft.CodeAnalysis.CSharp.Syntax.ArrowExpressionClauseSyntax expressionBody) -> Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax.WithIdentifier(Microsoft.CodeAnalysis.SyntaxToken identifier) -> Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax.WithModifiers(Microsoft.CodeAnalysis.SyntaxTokenList modifiers) -> Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax.WithParameterList(Microsoft.CodeAnalysis.CSharp.Syntax.ParameterListSyntax parameterList) -> Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax.WithReturnType(Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax returnType) -> Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax.WithSemicolonToken(Microsoft.CodeAnalysis.SyntaxToken semicolonToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax.WithTypeParameterList(Microsoft.CodeAnalysis.CSharp.Syntax.TypeParameterListSyntax typeParameterList) -> Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ParenthesizedVariableDesignationSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ParenthesizedVariableDesignationSyntax.AddVariables(params Microsoft.CodeAnalysis.CSharp.Syntax.VariableDesignationSyntax[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.ParenthesizedVariableDesignationSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ParenthesizedVariableDesignationSyntax.CloseParenToken.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ParenthesizedVariableDesignationSyntax.OpenParenToken.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] ~~`Microsoft.CodeAnalysis.CSharp.Syntax.ParenthesizedVariableDesignationSyntax.Update(Microsoft.CodeAnalysis.SyntaxToken openParenToken, Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.VariableDesignationSyntax> variables, Microsoft.CodeAnalysis.SyntaxToken closeParenToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.ParenthesizedVariableDesignationSyntax`~~\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ParenthesizedVariableDesignationSyntax.Variables.get -> Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.VariableDesignationSyntax>`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ParenthesizedVariableDesignationSyntax.WithCloseParenToken(Microsoft.CodeAnalysis.SyntaxToken closeParenToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.ParenthesizedVariableDesignationSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ParenthesizedVariableDesignationSyntax.WithOpenParenToken(Microsoft.CodeAnalysis.SyntaxToken openParenToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.ParenthesizedVariableDesignationSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ParenthesizedVariableDesignationSyntax.WithVariables(Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.VariableDesignationSyntax> variables) -> Microsoft.CodeAnalysis.CSharp.Syntax.ParenthesizedVariableDesignationSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.PatternSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.RefExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.RefExpressionSyntax.Expression.get -> Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.RefExpressionSyntax.RefKeyword.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] ~~`Microsoft.CodeAnalysis.CSharp.Syntax.RefExpressionSyntax.Update(Microsoft.CodeAnalysis.SyntaxToken refKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax expression) -> Microsoft.CodeAnalysis.CSharp.Syntax.RefExpressionSyntax`~~\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.RefExpressionSyntax.WithExpression(Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax expression) -> Microsoft.CodeAnalysis.CSharp.Syntax.RefExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.RefExpressionSyntax.WithRefKeyword(Microsoft.CodeAnalysis.SyntaxToken refKeyword) -> Microsoft.CodeAnalysis.CSharp.Syntax.RefExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.RefTypeSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.RefTypeSyntax.RefKeyword.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.RefTypeSyntax.Type.get -> Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax`\n* [x] ~~`Microsoft.CodeAnalysis.CSharp.Syntax.RefTypeSyntax.Update(Microsoft.CodeAnalysis.SyntaxToken refKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type) -> Microsoft.CodeAnalysis.CSharp.Syntax.RefTypeSyntax`~~\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.RefTypeSyntax.WithRefKeyword(Microsoft.CodeAnalysis.SyntaxToken refKeyword) -> Microsoft.CodeAnalysis.CSharp.Syntax.RefTypeSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.RefTypeSyntax.WithType(Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type) -> Microsoft.CodeAnalysis.CSharp.Syntax.RefTypeSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.SingleVariableDesignationSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.SingleVariableDesignationSyntax.Identifier.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] ~~`Microsoft.CodeAnalysis.CSharp.Syntax.SingleVariableDesignationSyntax.Update(Microsoft.CodeAnalysis.SyntaxToken identifier) -> Microsoft.CodeAnalysis.CSharp.Syntax.SingleVariableDesignationSyntax`~~\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.SingleVariableDesignationSyntax.WithIdentifier(Microsoft.CodeAnalysis.SyntaxToken identifier) -> Microsoft.CodeAnalysis.CSharp.Syntax.SingleVariableDesignationSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ThrowExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ThrowExpressionSyntax.Expression.get -> Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ThrowExpressionSyntax.ThrowKeyword.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] ~~`Microsoft.CodeAnalysis.CSharp.Syntax.ThrowExpressionSyntax.Update(Microsoft.CodeAnalysis.SyntaxToken throwKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax expression) -> Microsoft.CodeAnalysis.CSharp.Syntax.ThrowExpressionSyntax`~~\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ThrowExpressionSyntax.WithExpression(Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax expression) -> Microsoft.CodeAnalysis.CSharp.Syntax.ThrowExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ThrowExpressionSyntax.WithThrowKeyword(Microsoft.CodeAnalysis.SyntaxToken throwKeyword) -> Microsoft.CodeAnalysis.CSharp.Syntax.ThrowExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.TupleElementSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.TupleElementSyntax.Identifier.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.TupleElementSyntax.Type.get -> Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax`\n* [x] ~~`Microsoft.CodeAnalysis.CSharp.Syntax.TupleElementSyntax.Update(Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type, Microsoft.CodeAnalysis.SyntaxToken identifier) -> Microsoft.CodeAnalysis.CSharp.Syntax.TupleElementSyntax`~~\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.TupleElementSyntax.WithIdentifier(Microsoft.CodeAnalysis.SyntaxToken identifier) -> Microsoft.CodeAnalysis.CSharp.Syntax.TupleElementSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.TupleElementSyntax.WithType(Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type) -> Microsoft.CodeAnalysis.CSharp.Syntax.TupleElementSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.TupleExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.TupleExpressionSyntax.AddArguments(params Microsoft.CodeAnalysis.CSharp.Syntax.ArgumentSyntax[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.TupleExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.TupleExpressionSyntax.Arguments.get -> Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.ArgumentSyntax>`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.TupleExpressionSyntax.CloseParenToken.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.TupleExpressionSyntax.OpenParenToken.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] ~~`Microsoft.CodeAnalysis.CSharp.Syntax.TupleExpressionSyntax.Update(Microsoft.CodeAnalysis.SyntaxToken openParenToken, Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.ArgumentSyntax> arguments, Microsoft.CodeAnalysis.SyntaxToken closeParenToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.TupleExpressionSyntax`~~\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.TupleExpressionSyntax.WithArguments(Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.ArgumentSyntax> arguments) -> Microsoft.CodeAnalysis.CSharp.Syntax.TupleExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.TupleExpressionSyntax.WithCloseParenToken(Microsoft.CodeAnalysis.SyntaxToken closeParenToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.TupleExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.TupleExpressionSyntax.WithOpenParenToken(Microsoft.CodeAnalysis.SyntaxToken openParenToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.TupleExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.TupleTypeSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.TupleTypeSyntax.AddElements(params Microsoft.CodeAnalysis.CSharp.Syntax.TupleElementSyntax[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.TupleTypeSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.TupleTypeSyntax.CloseParenToken.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.TupleTypeSyntax.Elements.get -> Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.TupleElementSyntax>`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.TupleTypeSyntax.OpenParenToken.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] ~~`Microsoft.CodeAnalysis.CSharp.Syntax.TupleTypeSyntax.Update(Microsoft.CodeAnalysis.SyntaxToken openParenToken, Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.TupleElementSyntax> elements, Microsoft.CodeAnalysis.SyntaxToken closeParenToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.TupleTypeSyntax`~~\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.TupleTypeSyntax.WithCloseParenToken(Microsoft.CodeAnalysis.SyntaxToken closeParenToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.TupleTypeSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.TupleTypeSyntax.WithElements(Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.TupleElementSyntax> elements) -> Microsoft.CodeAnalysis.CSharp.Syntax.TupleTypeSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.TupleTypeSyntax.WithOpenParenToken(Microsoft.CodeAnalysis.SyntaxToken openParenToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.TupleTypeSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.VariableDesignationSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.WhenClauseSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.WhenClauseSyntax.Condition.get -> Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax`\n* [x] ~~`Microsoft.CodeAnalysis.CSharp.Syntax.WhenClauseSyntax.Update(Microsoft.CodeAnalysis.SyntaxToken whenKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax condition) -> Microsoft.CodeAnalysis.CSharp.Syntax.WhenClauseSyntax`~~\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.WhenClauseSyntax.WhenKeyword.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.WhenClauseSyntax.WithCondition(Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax condition) -> Microsoft.CodeAnalysis.CSharp.Syntax.WhenClauseSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.WhenClauseSyntax.WithWhenKeyword(Microsoft.CodeAnalysis.SyntaxToken whenKeyword) -> Microsoft.CodeAnalysis.CSharp.Syntax.WhenClauseSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.CasePatternSwitchLabel = 9009 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.ConstantPattern = 9002 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.DeclarationExpression = 9040 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.DeclarationPattern = 9000 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.DiscardDesignation = 9014 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.ForEachVariableStatement = 8929 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.IsPatternExpression = 8657 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.LocalFunctionStatement = 8830 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.ParenthesizedVariableDesignation = 8928 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.RefExpression = 9050 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.RefType = 9051 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.SingleVariableDesignation = 8927 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.ThrowExpression = 9052 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.TupleElement = 8925 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.TupleExpression = 8926 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.TupleType = 8924 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.UnderscoreToken = 8491 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.WhenClause = 9013 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `abstract Microsoft.CodeAnalysis.CSharp.Syntax.BaseMethodDeclarationSyntax.ExpressionBody.get -> Microsoft.CodeAnalysis.CSharp.Syntax.ArrowExpressionClauseSyntax`\n* [x] `abstract Microsoft.CodeAnalysis.CSharp.Syntax.CommonForEachStatementSyntax.CloseParenToken.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] `abstract Microsoft.CodeAnalysis.CSharp.Syntax.CommonForEachStatementSyntax.Expression.get -> Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax`\n* [x] `abstract Microsoft.CodeAnalysis.CSharp.Syntax.CommonForEachStatementSyntax.ForEachKeyword.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] `abstract Microsoft.CodeAnalysis.CSharp.Syntax.CommonForEachStatementSyntax.InKeyword.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] `abstract Microsoft.CodeAnalysis.CSharp.Syntax.CommonForEachStatementSyntax.OpenParenToken.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] `abstract Microsoft.CodeAnalysis.CSharp.Syntax.CommonForEachStatementSyntax.Statement.get -> Microsoft.CodeAnalysis.CSharp.Syntax.StatementSyntax`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.CSharpCompilationOptions.Language.get -> string`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.CSharpParseOptions.Language.get -> string`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitCasePatternSwitchLabel(Microsoft.CodeAnalysis.CSharp.Syntax.CasePatternSwitchLabelSyntax node) -> Microsoft.CodeAnalysis.SyntaxNode`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitConstantPattern(Microsoft.CodeAnalysis.CSharp.Syntax.ConstantPatternSyntax node) -> Microsoft.CodeAnalysis.SyntaxNode`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitDeclarationExpression(Microsoft.CodeAnalysis.CSharp.Syntax.DeclarationExpressionSyntax node) -> Microsoft.CodeAnalysis.SyntaxNode`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitDeclarationPattern(Microsoft.CodeAnalysis.CSharp.Syntax.DeclarationPatternSyntax node) -> Microsoft.CodeAnalysis.SyntaxNode`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitDiscardDesignation(Microsoft.CodeAnalysis.CSharp.Syntax.DiscardDesignationSyntax node) -> Microsoft.CodeAnalysis.SyntaxNode`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitForEachVariableStatement(Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax node) -> Microsoft.CodeAnalysis.SyntaxNode`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitIsPatternExpression(Microsoft.CodeAnalysis.CSharp.Syntax.IsPatternExpressionSyntax node) -> Microsoft.CodeAnalysis.SyntaxNode`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitLocalFunctionStatement(Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax node) -> Microsoft.CodeAnalysis.SyntaxNode`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitParenthesizedVariableDesignation(Microsoft.CodeAnalysis.CSharp.Syntax.ParenthesizedVariableDesignationSyntax node) -> Microsoft.CodeAnalysis.SyntaxNode`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitRefExpression(Microsoft.CodeAnalysis.CSharp.Syntax.RefExpressionSyntax node) -> Microsoft.CodeAnalysis.SyntaxNode`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitRefType(Microsoft.CodeAnalysis.CSharp.Syntax.RefTypeSyntax node) -> Microsoft.CodeAnalysis.SyntaxNode`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitSingleVariableDesignation(Microsoft.CodeAnalysis.CSharp.Syntax.SingleVariableDesignationSyntax node) -> Microsoft.CodeAnalysis.SyntaxNode`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitThrowExpression(Microsoft.CodeAnalysis.CSharp.Syntax.ThrowExpressionSyntax node) -> Microsoft.CodeAnalysis.SyntaxNode`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitTupleElement(Microsoft.CodeAnalysis.CSharp.Syntax.TupleElementSyntax node) -> Microsoft.CodeAnalysis.SyntaxNode`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitTupleExpression(Microsoft.CodeAnalysis.CSharp.Syntax.TupleExpressionSyntax node) -> Microsoft.CodeAnalysis.SyntaxNode`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitTupleType(Microsoft.CodeAnalysis.CSharp.Syntax.TupleTypeSyntax node) -> Microsoft.CodeAnalysis.SyntaxNode`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitWhenClause(Microsoft.CodeAnalysis.CSharp.Syntax.WhenClauseSyntax node) -> Microsoft.CodeAnalysis.SyntaxNode`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.CasePatternSwitchLabelSyntax.Accept(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor visitor) -> void`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.CasePatternSwitchLabelSyntax.Accept<TResult>(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult> visitor) -> TResult`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.CasePatternSwitchLabelSyntax.ColonToken.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.CasePatternSwitchLabelSyntax.Keyword.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.ConstantPatternSyntax.Accept(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor visitor) -> void`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.ConstantPatternSyntax.Accept<TResult>(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult> visitor) -> TResult`\n* [x] `override Microsoft.CodeAnalysis.CSharp.Syntax.ConstructorDeclarationSyntax.ExpressionBody.get -> Microsoft.CodeAnalysis.CSharp.Syntax.ArrowExpressionClauseSyntax`\n* [x] `override Microsoft.CodeAnalysis.CSharp.Syntax.ConversionOperatorDeclarationSyntax.ExpressionBody.get -> Microsoft.CodeAnalysis.CSharp.Syntax.ArrowExpressionClauseSyntax`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.DeclarationExpressionSyntax.Accept(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor visitor) -> void`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.DeclarationExpressionSyntax.Accept<TResult>(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult> visitor) -> TResult`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.DeclarationPatternSyntax.Accept(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor visitor) -> void`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.DeclarationPatternSyntax.Accept<TResult>(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult> visitor) -> TResult`\n* [x] `override Microsoft.CodeAnalysis.CSharp.Syntax.DestructorDeclarationSyntax.ExpressionBody.get -> Microsoft.CodeAnalysis.CSharp.Syntax.ArrowExpressionClauseSyntax`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.DiscardDesignationSyntax.Accept(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor visitor) -> void`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.DiscardDesignationSyntax.Accept<TResult>(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult> visitor) -> TResult`\n* [x] `override Microsoft.CodeAnalysis.CSharp.Syntax.ForEachStatementSyntax.CloseParenToken.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] `override Microsoft.CodeAnalysis.CSharp.Syntax.ForEachStatementSyntax.Expression.get -> Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax`\n* [x] `override Microsoft.CodeAnalysis.CSharp.Syntax.ForEachStatementSyntax.ForEachKeyword.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] `override Microsoft.CodeAnalysis.CSharp.Syntax.ForEachStatementSyntax.InKeyword.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] `override Microsoft.CodeAnalysis.CSharp.Syntax.ForEachStatementSyntax.OpenParenToken.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] `override Microsoft.CodeAnalysis.CSharp.Syntax.ForEachStatementSyntax.Statement.get -> Microsoft.CodeAnalysis.CSharp.Syntax.StatementSyntax`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax.Accept(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor visitor) -> void`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax.Accept<TResult>(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult> visitor) -> TResult`\n* [x] `override Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax.CloseParenToken.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] `override Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax.Expression.get -> Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax`\n* [x] `override Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax.ForEachKeyword.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] `override Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax.InKeyword.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] `override Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax.OpenParenToken.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] `override Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax.Statement.get -> Microsoft.CodeAnalysis.CSharp.Syntax.StatementSyntax`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.IsPatternExpressionSyntax.Accept(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor visitor) -> void`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.IsPatternExpressionSyntax.Accept<TResult>(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult> visitor) -> TResult`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax.Accept(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor visitor) -> void`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax.Accept<TResult>(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult> visitor) -> TResult`\n* [x] `override Microsoft.CodeAnalysis.CSharp.Syntax.MethodDeclarationSyntax.ExpressionBody.get -> Microsoft.CodeAnalysis.CSharp.Syntax.ArrowExpressionClauseSyntax`\n* [x] `override Microsoft.CodeAnalysis.CSharp.Syntax.OperatorDeclarationSyntax.ExpressionBody.get -> Microsoft.CodeAnalysis.CSharp.Syntax.ArrowExpressionClauseSyntax`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.ParenthesizedVariableDesignationSyntax.Accept(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor visitor) -> void`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.ParenthesizedVariableDesignationSyntax.Accept<TResult>(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult> visitor) -> TResult`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.RefExpressionSyntax.Accept(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor visitor) -> void`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.RefExpressionSyntax.Accept<TResult>(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult> visitor) -> TResult`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.RefTypeSyntax.Accept(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor visitor) -> void`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.RefTypeSyntax.Accept<TResult>(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult> visitor) -> TResult`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.SingleVariableDesignationSyntax.Accept(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor visitor) -> void`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.SingleVariableDesignationSyntax.Accept<TResult>(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult> visitor) -> TResult`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.ThrowExpressionSyntax.Accept(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor visitor) -> void`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.ThrowExpressionSyntax.Accept<TResult>(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult> visitor) -> TResult`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.TupleElementSyntax.Accept(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor visitor) -> void`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.TupleElementSyntax.Accept<TResult>(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult> visitor) -> TResult`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.TupleExpressionSyntax.Accept(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor visitor) -> void`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.TupleExpressionSyntax.Accept<TResult>(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult> visitor) -> TResult`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.TupleTypeSyntax.Accept(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor visitor) -> void`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.TupleTypeSyntax.Accept<TResult>(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult> visitor) -> TResult`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.WhenClauseSyntax.Accept(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor visitor) -> void`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.WhenClauseSyntax.Accept<TResult>(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult> visitor) -> TResult`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetDeclaredSymbol(this Microsoft.CodeAnalysis.SemanticModel semanticModel, Microsoft.CodeAnalysis.CSharp.Syntax.ArgumentSyntax declaratorSyntax, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.ISymbol`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetDeclaredSymbol(this Microsoft.CodeAnalysis.SemanticModel semanticModel, Microsoft.CodeAnalysis.CSharp.Syntax.SingleVariableDesignationSyntax designationSyntax, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.ISymbol`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetDeclaredSymbol(this Microsoft.CodeAnalysis.SemanticModel semanticModel, Microsoft.CodeAnalysis.CSharp.Syntax.TupleElementSyntax declarationSyntax, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.ISymbol`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetDeclaredSymbol(this Microsoft.CodeAnalysis.SemanticModel semanticModel, Microsoft.CodeAnalysis.CSharp.Syntax.TupleExpressionSyntax declaratorSyntax, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.INamedTypeSymbol`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetForEachStatementInfo(this Microsoft.CodeAnalysis.SemanticModel semanticModel, Microsoft.CodeAnalysis.CSharp.Syntax.CommonForEachStatementSyntax forEachStatement) -> Microsoft.CodeAnalysis.CSharp.ForEachStatementInfo`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.AccessorDeclaration(Microsoft.CodeAnalysis.CSharp.SyntaxKind kind) -> Microsoft.CodeAnalysis.CSharp.Syntax.AccessorDeclarationSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.AccessorDeclaration(Microsoft.CodeAnalysis.CSharp.SyntaxKind kind, Microsoft.CodeAnalysis.CSharp.Syntax.BlockSyntax body) -> Microsoft.CodeAnalysis.CSharp.Syntax.AccessorDeclarationSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.AccessorDeclaration(Microsoft.CodeAnalysis.CSharp.SyntaxKind kind, Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> attributeLists, Microsoft.CodeAnalysis.SyntaxTokenList modifiers, Microsoft.CodeAnalysis.CSharp.Syntax.ArrowExpressionClauseSyntax expressionBody) -> Microsoft.CodeAnalysis.CSharp.Syntax.AccessorDeclarationSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.AccessorDeclaration(Microsoft.CodeAnalysis.CSharp.SyntaxKind kind, Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> attributeLists, Microsoft.CodeAnalysis.SyntaxTokenList modifiers, Microsoft.CodeAnalysis.CSharp.Syntax.BlockSyntax body, Microsoft.CodeAnalysis.CSharp.Syntax.ArrowExpressionClauseSyntax expressionBody) -> Microsoft.CodeAnalysis.CSharp.Syntax.AccessorDeclarationSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.AccessorDeclaration(Microsoft.CodeAnalysis.CSharp.SyntaxKind kind, Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> attributeLists, Microsoft.CodeAnalysis.SyntaxTokenList modifiers, Microsoft.CodeAnalysis.SyntaxToken keyword, Microsoft.CodeAnalysis.CSharp.Syntax.ArrowExpressionClauseSyntax expressionBody, Microsoft.CodeAnalysis.SyntaxToken semicolonToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.AccessorDeclarationSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.AccessorDeclaration(Microsoft.CodeAnalysis.CSharp.SyntaxKind kind, Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> attributeLists, Microsoft.CodeAnalysis.SyntaxTokenList modifiers, Microsoft.CodeAnalysis.SyntaxToken keyword, Microsoft.CodeAnalysis.CSharp.Syntax.BlockSyntax body, Microsoft.CodeAnalysis.CSharp.Syntax.ArrowExpressionClauseSyntax expressionBody, Microsoft.CodeAnalysis.SyntaxToken semicolonToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.AccessorDeclarationSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.CasePatternSwitchLabel(Microsoft.CodeAnalysis.CSharp.Syntax.PatternSyntax pattern, Microsoft.CodeAnalysis.CSharp.Syntax.WhenClauseSyntax whenClause, Microsoft.CodeAnalysis.SyntaxToken colonToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.CasePatternSwitchLabelSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.CasePatternSwitchLabel(Microsoft.CodeAnalysis.CSharp.Syntax.PatternSyntax pattern, Microsoft.CodeAnalysis.SyntaxToken colonToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.CasePatternSwitchLabelSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.CasePatternSwitchLabel(Microsoft.CodeAnalysis.SyntaxToken keyword, Microsoft.CodeAnalysis.CSharp.Syntax.PatternSyntax pattern, Microsoft.CodeAnalysis.CSharp.Syntax.WhenClauseSyntax whenClause, Microsoft.CodeAnalysis.SyntaxToken colonToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.CasePatternSwitchLabelSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.ConstantPattern(Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax expression) -> Microsoft.CodeAnalysis.CSharp.Syntax.ConstantPatternSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.ConstructorDeclaration(Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> attributeLists, Microsoft.CodeAnalysis.SyntaxTokenList modifiers, Microsoft.CodeAnalysis.SyntaxToken identifier, Microsoft.CodeAnalysis.CSharp.Syntax.ParameterListSyntax parameterList, Microsoft.CodeAnalysis.CSharp.Syntax.ConstructorInitializerSyntax initializer, Microsoft.CodeAnalysis.CSharp.Syntax.ArrowExpressionClauseSyntax expressionBody) -> Microsoft.CodeAnalysis.CSharp.Syntax.ConstructorDeclarationSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.ConstructorDeclaration(Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> attributeLists, Microsoft.CodeAnalysis.SyntaxTokenList modifiers, Microsoft.CodeAnalysis.SyntaxToken identifier, Microsoft.CodeAnalysis.CSharp.Syntax.ParameterListSyntax parameterList, Microsoft.CodeAnalysis.CSharp.Syntax.ConstructorInitializerSyntax initializer, Microsoft.CodeAnalysis.CSharp.Syntax.ArrowExpressionClauseSyntax expressionBody, Microsoft.CodeAnalysis.SyntaxToken semicolonToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.ConstructorDeclarationSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.ConstructorDeclaration(Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> attributeLists, Microsoft.CodeAnalysis.SyntaxTokenList modifiers, Microsoft.CodeAnalysis.SyntaxToken identifier, Microsoft.CodeAnalysis.CSharp.Syntax.ParameterListSyntax parameterList, Microsoft.CodeAnalysis.CSharp.Syntax.ConstructorInitializerSyntax initializer, Microsoft.CodeAnalysis.CSharp.Syntax.BlockSyntax body, Microsoft.CodeAnalysis.CSharp.Syntax.ArrowExpressionClauseSyntax expressionBody) -> Microsoft.CodeAnalysis.CSharp.Syntax.ConstructorDeclarationSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.ConstructorDeclaration(Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> attributeLists, Microsoft.CodeAnalysis.SyntaxTokenList modifiers, Microsoft.CodeAnalysis.SyntaxToken identifier, Microsoft.CodeAnalysis.CSharp.Syntax.ParameterListSyntax parameterList, Microsoft.CodeAnalysis.CSharp.Syntax.ConstructorInitializerSyntax initializer, Microsoft.CodeAnalysis.CSharp.Syntax.BlockSyntax body, Microsoft.CodeAnalysis.CSharp.Syntax.ArrowExpressionClauseSyntax expressionBody, Microsoft.CodeAnalysis.SyntaxToken semicolonToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.ConstructorDeclarationSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.DeclarationExpression(Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type, Microsoft.CodeAnalysis.CSharp.Syntax.VariableDesignationSyntax designation) -> Microsoft.CodeAnalysis.CSharp.Syntax.DeclarationExpressionSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.DeclarationPattern(Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type, Microsoft.CodeAnalysis.CSharp.Syntax.VariableDesignationSyntax designation) -> Microsoft.CodeAnalysis.CSharp.Syntax.DeclarationPatternSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.DestructorDeclaration(Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> attributeLists, Microsoft.CodeAnalysis.SyntaxTokenList modifiers, Microsoft.CodeAnalysis.SyntaxToken identifier, Microsoft.CodeAnalysis.CSharp.Syntax.ParameterListSyntax parameterList, Microsoft.CodeAnalysis.CSharp.Syntax.ArrowExpressionClauseSyntax expressionBody) -> Microsoft.CodeAnalysis.CSharp.Syntax.DestructorDeclarationSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.DestructorDeclaration(Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> attributeLists, Microsoft.CodeAnalysis.SyntaxTokenList modifiers, Microsoft.CodeAnalysis.SyntaxToken identifier, Microsoft.CodeAnalysis.CSharp.Syntax.ParameterListSyntax parameterList, Microsoft.CodeAnalysis.CSharp.Syntax.BlockSyntax body, Microsoft.CodeAnalysis.CSharp.Syntax.ArrowExpressionClauseSyntax expressionBody) -> Microsoft.CodeAnalysis.CSharp.Syntax.DestructorDeclarationSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.DestructorDeclaration(Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> attributeLists, Microsoft.CodeAnalysis.SyntaxTokenList modifiers, Microsoft.CodeAnalysis.SyntaxToken tildeToken, Microsoft.CodeAnalysis.SyntaxToken identifier, Microsoft.CodeAnalysis.CSharp.Syntax.ParameterListSyntax parameterList, Microsoft.CodeAnalysis.CSharp.Syntax.ArrowExpressionClauseSyntax expressionBody, Microsoft.CodeAnalysis.SyntaxToken semicolonToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.DestructorDeclarationSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.DestructorDeclaration(Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> attributeLists, Microsoft.CodeAnalysis.SyntaxTokenList modifiers, Microsoft.CodeAnalysis.SyntaxToken tildeToken, Microsoft.CodeAnalysis.SyntaxToken identifier, Microsoft.CodeAnalysis.CSharp.Syntax.ParameterListSyntax parameterList, Microsoft.CodeAnalysis.CSharp.Syntax.BlockSyntax body, Microsoft.CodeAnalysis.CSharp.Syntax.ArrowExpressionClauseSyntax expressionBody, Microsoft.CodeAnalysis.SyntaxToken semicolonToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.DestructorDeclarationSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.DiscardDesignation() -> Microsoft.CodeAnalysis.CSharp.Syntax.DiscardDesignationSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.DiscardDesignation(Microsoft.CodeAnalysis.SyntaxToken underscoreToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.DiscardDesignationSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.ForEachVariableStatement(Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax variable, Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax expression, Microsoft.CodeAnalysis.CSharp.Syntax.StatementSyntax statement) -> Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.ForEachVariableStatement(Microsoft.CodeAnalysis.SyntaxToken forEachKeyword, Microsoft.CodeAnalysis.SyntaxToken openParenToken, Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax variable, Microsoft.CodeAnalysis.SyntaxToken inKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax expression, Microsoft.CodeAnalysis.SyntaxToken closeParenToken, Microsoft.CodeAnalysis.CSharp.Syntax.StatementSyntax statement) -> Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.IsPatternExpression(Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax expression, Microsoft.CodeAnalysis.CSharp.Syntax.PatternSyntax pattern) -> Microsoft.CodeAnalysis.CSharp.Syntax.IsPatternExpressionSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.IsPatternExpression(Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax expression, Microsoft.CodeAnalysis.SyntaxToken isKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.PatternSyntax pattern) -> Microsoft.CodeAnalysis.CSharp.Syntax.IsPatternExpressionSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.LocalFunctionStatement(Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax returnType, Microsoft.CodeAnalysis.SyntaxToken identifier) -> Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.LocalFunctionStatement(Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax returnType, string identifier) -> Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.LocalFunctionStatement(Microsoft.CodeAnalysis.SyntaxTokenList modifiers, Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax returnType, Microsoft.CodeAnalysis.SyntaxToken identifier, Microsoft.CodeAnalysis.CSharp.Syntax.TypeParameterListSyntax typeParameterList, Microsoft.CodeAnalysis.CSharp.Syntax.ParameterListSyntax parameterList, Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.TypeParameterConstraintClauseSyntax> constraintClauses, Microsoft.CodeAnalysis.CSharp.Syntax.BlockSyntax body, Microsoft.CodeAnalysis.CSharp.Syntax.ArrowExpressionClauseSyntax expressionBody) -> Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.LocalFunctionStatement(Microsoft.CodeAnalysis.SyntaxTokenList modifiers, Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax returnType, Microsoft.CodeAnalysis.SyntaxToken identifier, Microsoft.CodeAnalysis.CSharp.Syntax.TypeParameterListSyntax typeParameterList, Microsoft.CodeAnalysis.CSharp.Syntax.ParameterListSyntax parameterList, Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.TypeParameterConstraintClauseSyntax> constraintClauses, Microsoft.CodeAnalysis.CSharp.Syntax.BlockSyntax body, Microsoft.CodeAnalysis.CSharp.Syntax.ArrowExpressionClauseSyntax expressionBody, Microsoft.CodeAnalysis.SyntaxToken semicolonToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.ParenthesizedVariableDesignation(Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.VariableDesignationSyntax> variables = default(Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.VariableDesignationSyntax>)) -> Microsoft.CodeAnalysis.CSharp.Syntax.ParenthesizedVariableDesignationSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.ParenthesizedVariableDesignation(Microsoft.CodeAnalysis.SyntaxToken openParenToken, Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.VariableDesignationSyntax> variables, Microsoft.CodeAnalysis.SyntaxToken closeParenToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.ParenthesizedVariableDesignationSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.RefExpression(Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax expression) -> Microsoft.CodeAnalysis.CSharp.Syntax.RefExpressionSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.RefExpression(Microsoft.CodeAnalysis.SyntaxToken refKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax expression) -> Microsoft.CodeAnalysis.CSharp.Syntax.RefExpressionSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.RefType(Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type) -> Microsoft.CodeAnalysis.CSharp.Syntax.RefTypeSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.RefType(Microsoft.CodeAnalysis.SyntaxToken refKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type) -> Microsoft.CodeAnalysis.CSharp.Syntax.RefTypeSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.SingleVariableDesignation(Microsoft.CodeAnalysis.SyntaxToken identifier) -> Microsoft.CodeAnalysis.CSharp.Syntax.SingleVariableDesignationSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.ThrowExpression(Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax expression) -> Microsoft.CodeAnalysis.CSharp.Syntax.ThrowExpressionSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.ThrowExpression(Microsoft.CodeAnalysis.SyntaxToken throwKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax expression) -> Microsoft.CodeAnalysis.CSharp.Syntax.ThrowExpressionSyntax`\n* [x] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.TupleElement(Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type) -> Microsoft.CodeAnalysis.CSharp.Syntax.TupleElementSyntax`\n* [x] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.TupleElement(Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type, Microsoft.CodeAnalysis.SyntaxToken identifier) -> Microsoft.CodeAnalysis.CSharp.Syntax.TupleElementSyntax`\n* [x] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.TupleExpression(Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.ArgumentSyntax> arguments = default(Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.ArgumentSyntax>)) -> Microsoft.CodeAnalysis.CSharp.Syntax.TupleExpressionSyntax`\n* [x] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.TupleExpression(Microsoft.CodeAnalysis.SyntaxToken openParenToken, Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.ArgumentSyntax> arguments, Microsoft.CodeAnalysis.SyntaxToken closeParenToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.TupleExpressionSyntax`\n* [x] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.TupleType(Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.TupleElementSyntax> elements = default(Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.TupleElementSyntax>)) -> Microsoft.CodeAnalysis.CSharp.Syntax.TupleTypeSyntax`\n* [x] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.TupleType(Microsoft.CodeAnalysis.SyntaxToken openParenToken, Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.TupleElementSyntax> elements, Microsoft.CodeAnalysis.SyntaxToken closeParenToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.TupleTypeSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.WhenClause(Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax condition) -> Microsoft.CodeAnalysis.CSharp.Syntax.WhenClauseSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.WhenClause(Microsoft.CodeAnalysis.SyntaxToken whenKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax condition) -> Microsoft.CodeAnalysis.CSharp.Syntax.WhenClauseSyntax`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitCasePatternSwitchLabel(Microsoft.CodeAnalysis.CSharp.Syntax.CasePatternSwitchLabelSyntax node) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitConstantPattern(Microsoft.CodeAnalysis.CSharp.Syntax.ConstantPatternSyntax node) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitDeclarationExpression(Microsoft.CodeAnalysis.CSharp.Syntax.DeclarationExpressionSyntax node) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitDeclarationPattern(Microsoft.CodeAnalysis.CSharp.Syntax.DeclarationPatternSyntax node) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitDiscardDesignation(Microsoft.CodeAnalysis.CSharp.Syntax.DiscardDesignationSyntax node) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitForEachVariableStatement(Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax node) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitIsPatternExpression(Microsoft.CodeAnalysis.CSharp.Syntax.IsPatternExpressionSyntax node) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitLocalFunctionStatement(Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax node) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitParenthesizedVariableDesignation(Microsoft.CodeAnalysis.CSharp.Syntax.ParenthesizedVariableDesignationSyntax node) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitRefExpression(Microsoft.CodeAnalysis.CSharp.Syntax.RefExpressionSyntax node) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitRefType(Microsoft.CodeAnalysis.CSharp.Syntax.RefTypeSyntax node) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitSingleVariableDesignation(Microsoft.CodeAnalysis.CSharp.Syntax.SingleVariableDesignationSyntax node) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitThrowExpression(Microsoft.CodeAnalysis.CSharp.Syntax.ThrowExpressionSyntax node) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitTupleElement(Microsoft.CodeAnalysis.CSharp.Syntax.TupleElementSyntax node) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitTupleExpression(Microsoft.CodeAnalysis.CSharp.Syntax.TupleExpressionSyntax node) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitTupleType(Microsoft.CodeAnalysis.CSharp.Syntax.TupleTypeSyntax node) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitWhenClause(Microsoft.CodeAnalysis.CSharp.Syntax.WhenClauseSyntax node) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult>.VisitCasePatternSwitchLabel(Microsoft.CodeAnalysis.CSharp.Syntax.CasePatternSwitchLabelSyntax node) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult>.VisitConstantPattern(Microsoft.CodeAnalysis.CSharp.Syntax.ConstantPatternSyntax node) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult>.VisitDeclarationExpression(Microsoft.CodeAnalysis.CSharp.Syntax.DeclarationExpressionSyntax node) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult>.VisitDeclarationPattern(Microsoft.CodeAnalysis.CSharp.Syntax.DeclarationPatternSyntax node) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult>.VisitDiscardDesignation(Microsoft.CodeAnalysis.CSharp.Syntax.DiscardDesignationSyntax node) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult>.VisitForEachVariableStatement(Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax node) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult>.VisitIsPatternExpression(Microsoft.CodeAnalysis.CSharp.Syntax.IsPatternExpressionSyntax node) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult>.VisitLocalFunctionStatement(Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax node) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult>.VisitParenthesizedVariableDesignation(Microsoft.CodeAnalysis.CSharp.Syntax.ParenthesizedVariableDesignationSyntax node) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult>.VisitRefExpression(Microsoft.CodeAnalysis.CSharp.Syntax.RefExpressionSyntax node) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult>.VisitRefType(Microsoft.CodeAnalysis.CSharp.Syntax.RefTypeSyntax node) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult>.VisitSingleVariableDesignation(Microsoft.CodeAnalysis.CSharp.Syntax.SingleVariableDesignationSyntax node) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult>.VisitThrowExpression(Microsoft.CodeAnalysis.CSharp.Syntax.ThrowExpressionSyntax node) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult>.VisitTupleElement(Microsoft.CodeAnalysis.CSharp.Syntax.TupleElementSyntax node) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult>.VisitTupleExpression(Microsoft.CodeAnalysis.CSharp.Syntax.TupleExpressionSyntax node) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult>.VisitTupleType(Microsoft.CodeAnalysis.CSharp.Syntax.TupleTypeSyntax node) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult>.VisitWhenClause(Microsoft.CodeAnalysis.CSharp.Syntax.WhenClauseSyntax node) -> TResult`\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/CSharp71.md",
    "content": "﻿# C# 7.1 APIs supported via light-up\n\nSee [dotnet/roslyn@5520eac](https://github.com/dotnet/roslyn/commit/5520eaccd5d22ae98a39a5f88120277f02097dbf).\n\n## Semantics\n\n* [ ] `Microsoft.CodeAnalysis.CSharp.LanguageVersionFacts`\n* [ ] `const Microsoft.CodeAnalysis.LanguageNames.FSharp = \"F#\" -> string`\n* [ ] `Microsoft.CodeAnalysis.CommandLineArguments.OutputRefFilePath.get -> string`\n* [ ] `Microsoft.CodeAnalysis.CommandLineArguments.RuleSetPath.get -> string`\n* [ ] `Microsoft.CodeAnalysis.CommandLineReference.CommandLineReference(string reference, Microsoft.CodeAnalysis.MetadataReferenceProperties properties) -> void`\n* [ ] `Microsoft.CodeAnalysis.CommandLineSourceFile.CommandLineSourceFile(string path, bool isScript) -> void`\n* [ ] `Microsoft.CodeAnalysis.Compilation.Emit(System.IO.Stream peStream, System.IO.Stream pdbStream = null, System.IO.Stream xmlDocumentationStream = null, System.IO.Stream win32Resources = null, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.ResourceDescription> manifestResources = null, Microsoft.CodeAnalysis.Emit.EmitOptions options = null, Microsoft.CodeAnalysis.IMethodSymbol debugEntryPoint = null, System.IO.Stream sourceLinkStream = null, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.EmbeddedText> embeddedTexts = null, System.IO.Stream metadataPEStream = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.Emit.EmitResult`\n* [ ] `Microsoft.CodeAnalysis.Compilation.Emit(System.IO.Stream peStream, System.IO.Stream pdbStream, System.IO.Stream xmlDocumentationStream, System.IO.Stream win32Resources, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.ResourceDescription> manifestResources, Microsoft.CodeAnalysis.Emit.EmitOptions options, Microsoft.CodeAnalysis.IMethodSymbol debugEntryPoint, System.IO.Stream sourceLinkStream, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.EmbeddedText> embeddedTexts, System.Threading.CancellationToken cancellationToken) -> Microsoft.CodeAnalysis.Emit.EmitResult`\n* [ ] `Microsoft.CodeAnalysis.Emit.EmitOptions.EmitOptions(bool metadataOnly = false, Microsoft.CodeAnalysis.Emit.DebugInformationFormat debugInformationFormat = (Microsoft.CodeAnalysis.Emit.DebugInformationFormat)0, string pdbFilePath = null, string outputNameOverride = null, int fileAlignment = 0, ulong baseAddress = 0, bool highEntropyVirtualAddressSpace = false, Microsoft.CodeAnalysis.SubsystemVersion subsystemVersion = default(Microsoft.CodeAnalysis.SubsystemVersion), string runtimeMetadataVersion = null, bool tolerateErrors = false, bool includePrivateMembers = true, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Emit.InstrumentationKind> instrumentationKinds = default(System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Emit.InstrumentationKind>)) -> void`\n* [ ] `Microsoft.CodeAnalysis.ParseOptions.Errors.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostic>`\n* [ ] `Microsoft.CodeAnalysis.ParseOptions.SpecifiedKind.get -> Microsoft.CodeAnalysis.SourceCodeKind`\n* [ ] `static Microsoft.CodeAnalysis.Compilation.GetRequiredLanguageVersion(Microsoft.CodeAnalysis.Diagnostic diagnostic) -> string`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.LanguageVersionFacts.MapSpecifiedToEffectiveVersion(this Microsoft.CodeAnalysis.CSharp.LanguageVersion version) -> Microsoft.CodeAnalysis.CSharp.LanguageVersion`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.LanguageVersionFacts.ToDisplayString(this Microsoft.CodeAnalysis.CSharp.LanguageVersion version) -> string`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.LanguageVersionFacts.TryParse(this string version, out Microsoft.CodeAnalysis.CSharp.LanguageVersion result) -> bool`\n\n## Syntax\n\n* [x] `Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp7_1 = 701 -> Microsoft.CodeAnalysis.CSharp.LanguageVersion`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.ConflictMarkerTrivia = 8564 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.DefaultLiteralExpression = 8755 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `static Microsoft.CodeAnalysis.CSharp.SyntaxFacts.IsReservedTupleElementName(string elementName) -> bool`\n* [x] `static Microsoft.CodeAnalysis.CSharp.SyntaxFacts.TryGetInferredMemberName(this Microsoft.CodeAnalysis.SyntaxNode syntax) -> string`\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/CSharp72.md",
    "content": "﻿# C# 7.2 APIs supported via light-up\n\nSee [dotnet/roslyn@30a68f1](https://github.com/dotnet/roslyn/commit/30a68f16a0cb3d154a0fca41df38ec509dfe703c).\n\n## Semantics\n\n* [ ] `abstract Microsoft.CodeAnalysis.Diagnostics.OperationBlockStartAnalysisContext.RegisterOperationAction(System.Action<Microsoft.CodeAnalysis.Diagnostics.OperationAnalysisContext> action, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.OperationKind> operationKinds) -> void`\n* [ ] `abstract Microsoft.CodeAnalysis.Diagnostics.OperationBlockStartAnalysisContext.RegisterOperationBlockEndAction(System.Action<Microsoft.CodeAnalysis.Diagnostics.OperationBlockAnalysisContext> action) -> void`\n* [ ] `abstract Microsoft.CodeAnalysis.SemanticModel.GetOperationCore(Microsoft.CodeAnalysis.SyntaxNode node, System.Threading.CancellationToken cancellationToken) -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `abstract Microsoft.CodeAnalysis.SemanticModel.RootCore.get -> Microsoft.CodeAnalysis.SyntaxNode`\n* [ ] `Microsoft.CodeAnalysis.CommandLineArguments.DisplayLangVersions.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.AnalysisContext.RegisterOperationAction(System.Action<Microsoft.CodeAnalysis.Diagnostics.OperationAnalysisContext> action, params Microsoft.CodeAnalysis.OperationKind[] operationKinds) -> void`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.CompilationStartAnalysisContext.RegisterOperationAction(System.Action<Microsoft.CodeAnalysis.Diagnostics.OperationAnalysisContext> action, params Microsoft.CodeAnalysis.OperationKind[] operationKinds) -> void`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.OperationAnalysisContext`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.OperationAnalysisContext.CancellationToken.get -> System.Threading.CancellationToken`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.OperationAnalysisContext.Compilation.get -> Microsoft.CodeAnalysis.Compilation`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.OperationAnalysisContext.ContainingSymbol.get -> Microsoft.CodeAnalysis.ISymbol`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.OperationAnalysisContext.Operation.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.OperationAnalysisContext.OperationAnalysisContext(Microsoft.CodeAnalysis.IOperation operation, Microsoft.CodeAnalysis.ISymbol containingSymbol, Microsoft.CodeAnalysis.Compilation compilation, Microsoft.CodeAnalysis.Diagnostics.AnalyzerOptions options, System.Action<Microsoft.CodeAnalysis.Diagnostic> reportDiagnostic, System.Func<Microsoft.CodeAnalysis.Diagnostic, bool> isSupportedDiagnostic, System.Threading.CancellationToken cancellationToken) -> void`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.OperationAnalysisContext.Options.get -> Microsoft.CodeAnalysis.Diagnostics.AnalyzerOptions`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.OperationAnalysisContext.ReportDiagnostic(Microsoft.CodeAnalysis.Diagnostic diagnostic) -> void`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.OperationBlockAnalysisContext`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.OperationBlockAnalysisContext.CancellationToken.get -> System.Threading.CancellationToken`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.OperationBlockAnalysisContext.Compilation.get -> Microsoft.CodeAnalysis.Compilation`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.OperationBlockAnalysisContext.OperationBlockAnalysisContext(System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.IOperation> operationBlocks, Microsoft.CodeAnalysis.ISymbol owningSymbol, Microsoft.CodeAnalysis.Compilation compilation, Microsoft.CodeAnalysis.Diagnostics.AnalyzerOptions options, System.Action<Microsoft.CodeAnalysis.Diagnostic> reportDiagnostic, System.Func<Microsoft.CodeAnalysis.Diagnostic, bool> isSupportedDiagnostic, System.Threading.CancellationToken cancellationToken) -> void`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.OperationBlockAnalysisContext.OperationBlocks.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.IOperation>`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.OperationBlockAnalysisContext.Options.get -> Microsoft.CodeAnalysis.Diagnostics.AnalyzerOptions`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.OperationBlockAnalysisContext.OwningSymbol.get -> Microsoft.CodeAnalysis.ISymbol`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.OperationBlockAnalysisContext.ReportDiagnostic(Microsoft.CodeAnalysis.Diagnostic diagnostic) -> void`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.OperationBlockStartAnalysisContext`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.OperationBlockStartAnalysisContext.CancellationToken.get -> System.Threading.CancellationToken`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.OperationBlockStartAnalysisContext.Compilation.get -> Microsoft.CodeAnalysis.Compilation`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.OperationBlockStartAnalysisContext.OperationBlockStartAnalysisContext(System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.IOperation> operationBlocks, Microsoft.CodeAnalysis.ISymbol owningSymbol, Microsoft.CodeAnalysis.Compilation compilation, Microsoft.CodeAnalysis.Diagnostics.AnalyzerOptions options, System.Threading.CancellationToken cancellationToken) -> void`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.OperationBlockStartAnalysisContext.OperationBlocks.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.IOperation>`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.OperationBlockStartAnalysisContext.Options.get -> Microsoft.CodeAnalysis.Diagnostics.AnalyzerOptions`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.OperationBlockStartAnalysisContext.OwningSymbol.get -> Microsoft.CodeAnalysis.ISymbol`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.OperationBlockStartAnalysisContext.RegisterOperationAction(System.Action<Microsoft.CodeAnalysis.Diagnostics.OperationAnalysisContext> action, params Microsoft.CodeAnalysis.OperationKind[] operationKinds) -> void`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.OperationActionsCount.get -> int`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.OperationActionsCount.set -> void`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.OperationBlockActionsCount.get -> int`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.OperationBlockActionsCount.set -> void`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.OperationBlockEndActionsCount.get -> int`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.OperationBlockEndActionsCount.set -> void`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.OperationBlockStartActionsCount.get -> int`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.OperationBlockStartActionsCount.set -> void`\n* [ ] `Microsoft.CodeAnalysis.ILocalSymbol.RefKind.get -> Microsoft.CodeAnalysis.RefKind`\n* [ ] `Microsoft.CodeAnalysis.IMethodSymbol.RefKind.get -> Microsoft.CodeAnalysis.RefKind`\n* [ ] `Microsoft.CodeAnalysis.IMethodSymbol.ReturnsByRefReadonly.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.IOperation.Accept(Microsoft.CodeAnalysis.Operations.OperationVisitor visitor) -> void`\n* [ ] `Microsoft.CodeAnalysis.IOperation.Accept<TArgument, TResult>(Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult> visitor, TArgument argument) -> TResult`\n* [ ] `Microsoft.CodeAnalysis.IOperation.Children.get -> System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.IOperation>`\n* [ ] `Microsoft.CodeAnalysis.IOperation.ConstantValue.get -> Microsoft.CodeAnalysis.Optional<object>`\n* [ ] `Microsoft.CodeAnalysis.IOperation.IsImplicit.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.IOperation.Kind.get -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.IOperation.Language.get -> string`\n* [ ] `Microsoft.CodeAnalysis.IOperation.Parent.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.IOperation.Syntax.get -> Microsoft.CodeAnalysis.SyntaxNode`\n* [ ] `Microsoft.CodeAnalysis.IOperation.Type.get -> Microsoft.CodeAnalysis.ITypeSymbol`\n* [ ] `Microsoft.CodeAnalysis.IPropertySymbol.RefKind.get -> Microsoft.CodeAnalysis.RefKind`\n* [ ] `Microsoft.CodeAnalysis.IPropertySymbol.ReturnsByRefReadonly.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.ModuleMetadata.IsDisposed.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.AddressOf = 64 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.AnonymousFunction = 35 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.AnonymousObjectCreation = 49 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.Argument = 79 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.ArrayCreation = 38 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.ArrayElementReference = 23 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.ArrayInitializer = 76 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.Await = 41 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.BinaryOperator = 32 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.Block = 2 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.Branch = 7 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.CaseClause = 82 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.CatchClause = 80 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.Coalesce = 34 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.CollectionElementInitializer = 52 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.CompoundAssignment = 43 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.Conditional = 33 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.ConditionalAccess = 46 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.ConditionalAccessInstance = 47 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.ConstantPattern = 85 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.Conversion = 21 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.DeclarationExpression = 70 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.DeclarationPattern = 86 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.DeconstructionAssignment = 69 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.Decrement = 68 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.DefaultValue = 61 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.DelegateCreation = 60 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.DynamicIndexerAccess = 58 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.DynamicInvocation = 57 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.DynamicMemberReference = 56 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.DynamicObjectCreation = 55 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.Empty = 8 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.End = 18 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.EventAssignment = 45 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.EventReference = 30 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.ExpressionStatement = 15 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.FieldInitializer = 72 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.FieldReference = 26 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.Increment = 66 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.InstanceReference = 39 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.InterpolatedString = 48 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.InterpolatedStringText = 83 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.Interpolation = 84 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.Invalid = 1 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.Invocation = 22 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.IsPattern = 65 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.IsType = 40 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.Labeled = 6 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.Literal = 20 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.LocalFunction = 16 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.LocalReference = 24 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.Lock = 11 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.Loop = 5 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.MemberInitializer = 51 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.MethodReference = 27 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.NameOf = 53 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.None = 0 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.ObjectCreation = 36 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.ObjectOrCollectionInitializer = 50 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.OmittedArgument = 71 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.ParameterInitializer = 75 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.ParameterReference = 25 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.Parenthesized = 44 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.PropertyInitializer = 74 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.PropertyReference = 28 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.RaiseEvent = 19 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.Return = 9 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.SimpleAssignment = 42 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.SizeOf = 63 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.Stop = 17 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.Switch = 4 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.SwitchCase = 81 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.Throw = 67 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.TranslatedQuery = 59 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.Try = 12 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.Tuple = 54 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.TypeOf = 62 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.TypeParameterObjectCreation = 37 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.UnaryOperator = 31 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.Using = 13 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.VariableDeclaration = 78 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.VariableDeclarationGroup = 3 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.VariableDeclarator = 77 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.VariableInitializer = 73 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.YieldBreak = 10 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.YieldReturn = 14 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.ArgumentKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.ArgumentKind.DefaultValue = 3 -> Microsoft.CodeAnalysis.Operations.ArgumentKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.ArgumentKind.Explicit = 1 -> Microsoft.CodeAnalysis.Operations.ArgumentKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.ArgumentKind.None = 0 -> Microsoft.CodeAnalysis.Operations.ArgumentKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.ArgumentKind.ParamArray = 2 -> Microsoft.CodeAnalysis.Operations.ArgumentKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.BinaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.BinaryOperatorKind.Add = 1 -> Microsoft.CodeAnalysis.Operations.BinaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.BinaryOperatorKind.And = 10 -> Microsoft.CodeAnalysis.Operations.BinaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.BinaryOperatorKind.Concatenate = 15 -> Microsoft.CodeAnalysis.Operations.BinaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.BinaryOperatorKind.ConditionalAnd = 13 -> Microsoft.CodeAnalysis.Operations.BinaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.BinaryOperatorKind.ConditionalOr = 14 -> Microsoft.CodeAnalysis.Operations.BinaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.BinaryOperatorKind.Divide = 4 -> Microsoft.CodeAnalysis.Operations.BinaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.BinaryOperatorKind.Equals = 16 -> Microsoft.CodeAnalysis.Operations.BinaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.BinaryOperatorKind.ExclusiveOr = 12 -> Microsoft.CodeAnalysis.Operations.BinaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.BinaryOperatorKind.GreaterThan = 23 -> Microsoft.CodeAnalysis.Operations.BinaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.BinaryOperatorKind.GreaterThanOrEqual = 22 -> Microsoft.CodeAnalysis.Operations.BinaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.BinaryOperatorKind.IntegerDivide = 5 -> Microsoft.CodeAnalysis.Operations.BinaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.BinaryOperatorKind.LeftShift = 8 -> Microsoft.CodeAnalysis.Operations.BinaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.BinaryOperatorKind.LessThan = 20 -> Microsoft.CodeAnalysis.Operations.BinaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.BinaryOperatorKind.LessThanOrEqual = 21 -> Microsoft.CodeAnalysis.Operations.BinaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.BinaryOperatorKind.Like = 24 -> Microsoft.CodeAnalysis.Operations.BinaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.BinaryOperatorKind.Multiply = 3 -> Microsoft.CodeAnalysis.Operations.BinaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.BinaryOperatorKind.None = 0 -> Microsoft.CodeAnalysis.Operations.BinaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.BinaryOperatorKind.NotEquals = 18 -> Microsoft.CodeAnalysis.Operations.BinaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.BinaryOperatorKind.ObjectValueEquals = 17 -> Microsoft.CodeAnalysis.Operations.BinaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.BinaryOperatorKind.ObjectValueNotEquals = 19 -> Microsoft.CodeAnalysis.Operations.BinaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.BinaryOperatorKind.Or = 11 -> Microsoft.CodeAnalysis.Operations.BinaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.BinaryOperatorKind.Power = 7 -> Microsoft.CodeAnalysis.Operations.BinaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.BinaryOperatorKind.Remainder = 6 -> Microsoft.CodeAnalysis.Operations.BinaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.BinaryOperatorKind.RightShift = 9 -> Microsoft.CodeAnalysis.Operations.BinaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.BinaryOperatorKind.Subtract = 2 -> Microsoft.CodeAnalysis.Operations.BinaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.BranchKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.BranchKind.Break = 2 -> Microsoft.CodeAnalysis.Operations.BranchKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.BranchKind.Continue = 1 -> Microsoft.CodeAnalysis.Operations.BranchKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.BranchKind.GoTo = 3 -> Microsoft.CodeAnalysis.Operations.BranchKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.BranchKind.None = 0 -> Microsoft.CodeAnalysis.Operations.BranchKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.CaseKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.CaseKind.Default = 4 -> Microsoft.CodeAnalysis.Operations.CaseKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.CaseKind.None = 0 -> Microsoft.CodeAnalysis.Operations.CaseKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.CaseKind.Pattern = 5 -> Microsoft.CodeAnalysis.Operations.CaseKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.CaseKind.Range = 3 -> Microsoft.CodeAnalysis.Operations.CaseKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.CaseKind.Relational = 2 -> Microsoft.CodeAnalysis.Operations.CaseKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.CaseKind.SingleValue = 1 -> Microsoft.CodeAnalysis.Operations.CaseKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.CommonConversion`\n* [ ] `Microsoft.CodeAnalysis.Operations.CommonConversion.Exists.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.Operations.CommonConversion.IsIdentity.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.Operations.CommonConversion.IsNumeric.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.Operations.CommonConversion.IsReference.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.Operations.CommonConversion.IsUserDefined.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.Operations.CommonConversion.MethodSymbol.get -> Microsoft.CodeAnalysis.IMethodSymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.IAddressOfOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IAddressOfOperation.Reference.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IAnonymousFunctionOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IAnonymousFunctionOperation.Body.get -> Microsoft.CodeAnalysis.Operations.IBlockOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IAnonymousFunctionOperation.Symbol.get -> Microsoft.CodeAnalysis.IMethodSymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.IAnonymousObjectCreationOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IAnonymousObjectCreationOperation.Initializers.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.IOperation>`\n* [ ] `Microsoft.CodeAnalysis.Operations.IArgumentOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IArgumentOperation.ArgumentKind.get -> Microsoft.CodeAnalysis.Operations.ArgumentKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.IArgumentOperation.InConversion.get -> Microsoft.CodeAnalysis.Operations.CommonConversion`\n* [ ] `Microsoft.CodeAnalysis.Operations.IArgumentOperation.OutConversion.get -> Microsoft.CodeAnalysis.Operations.CommonConversion`\n* [ ] `Microsoft.CodeAnalysis.Operations.IArgumentOperation.Parameter.get -> Microsoft.CodeAnalysis.IParameterSymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.IArgumentOperation.Value.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IArrayCreationOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IArrayCreationOperation.DimensionSizes.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.IOperation>`\n* [ ] `Microsoft.CodeAnalysis.Operations.IArrayCreationOperation.Initializer.get -> Microsoft.CodeAnalysis.Operations.IArrayInitializerOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IArrayElementReferenceOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IArrayElementReferenceOperation.ArrayReference.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IArrayElementReferenceOperation.Indices.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.IOperation>`\n* [ ] `Microsoft.CodeAnalysis.Operations.IArrayInitializerOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IArrayInitializerOperation.ElementValues.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.IOperation>`\n* [ ] `Microsoft.CodeAnalysis.Operations.IAssignmentOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IAssignmentOperation.Target.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IAssignmentOperation.Value.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IAwaitOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IAwaitOperation.Operation.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IBinaryOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IBinaryOperation.IsChecked.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.Operations.IBinaryOperation.IsCompareText.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.Operations.IBinaryOperation.IsLifted.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.Operations.IBinaryOperation.LeftOperand.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IBinaryOperation.OperatorKind.get -> Microsoft.CodeAnalysis.Operations.BinaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.IBinaryOperation.OperatorMethod.get -> Microsoft.CodeAnalysis.IMethodSymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.IBinaryOperation.RightOperand.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IBlockOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IBlockOperation.Locals.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ILocalSymbol>`\n* [ ] `Microsoft.CodeAnalysis.Operations.IBlockOperation.Operations.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.IOperation>`\n* [ ] `Microsoft.CodeAnalysis.Operations.IBranchOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IBranchOperation.BranchKind.get -> Microsoft.CodeAnalysis.Operations.BranchKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.IBranchOperation.Target.get -> Microsoft.CodeAnalysis.ILabelSymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.ICaseClauseOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ICaseClauseOperation.CaseKind.get -> Microsoft.CodeAnalysis.Operations.CaseKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.ICatchClauseOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ICatchClauseOperation.ExceptionDeclarationOrExpression.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ICatchClauseOperation.ExceptionType.get -> Microsoft.CodeAnalysis.ITypeSymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.ICatchClauseOperation.Filter.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ICatchClauseOperation.Handler.get -> Microsoft.CodeAnalysis.Operations.IBlockOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ICatchClauseOperation.Locals.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ILocalSymbol>`\n* [ ] `Microsoft.CodeAnalysis.Operations.ICoalesceOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ICoalesceOperation.Value.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ICoalesceOperation.WhenNull.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ICollectionElementInitializerOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ICollectionElementInitializerOperation.AddMethod.get -> Microsoft.CodeAnalysis.IMethodSymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.ICollectionElementInitializerOperation.Arguments.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.IOperation>`\n* [ ] `Microsoft.CodeAnalysis.Operations.ICollectionElementInitializerOperation.IsDynamic.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.Operations.ICompoundAssignmentOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ICompoundAssignmentOperation.InConversion.get -> Microsoft.CodeAnalysis.Operations.CommonConversion`\n* [ ] `Microsoft.CodeAnalysis.Operations.ICompoundAssignmentOperation.IsChecked.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.Operations.ICompoundAssignmentOperation.IsLifted.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.Operations.ICompoundAssignmentOperation.OperatorKind.get -> Microsoft.CodeAnalysis.Operations.BinaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.ICompoundAssignmentOperation.OperatorMethod.get -> Microsoft.CodeAnalysis.IMethodSymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.ICompoundAssignmentOperation.OutConversion.get -> Microsoft.CodeAnalysis.Operations.CommonConversion`\n* [ ] `Microsoft.CodeAnalysis.Operations.IConditionalAccessInstanceOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IConditionalAccessOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IConditionalAccessOperation.Operation.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IConditionalAccessOperation.WhenNotNull.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IConditionalOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IConditionalOperation.Condition.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IConditionalOperation.IsRef.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.Operations.IConditionalOperation.WhenFalse.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IConditionalOperation.WhenTrue.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IConstantPatternOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IConstantPatternOperation.Value.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IConversionOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IConversionOperation.Conversion.get -> Microsoft.CodeAnalysis.Operations.CommonConversion`\n* [ ] `Microsoft.CodeAnalysis.Operations.IConversionOperation.IsChecked.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.Operations.IConversionOperation.IsTryCast.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.Operations.IConversionOperation.Operand.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IConversionOperation.OperatorMethod.get -> Microsoft.CodeAnalysis.IMethodSymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.IDeclarationExpressionOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IDeclarationExpressionOperation.Expression.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IDeclarationPatternOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IDeclarationPatternOperation.DeclaredSymbol.get -> Microsoft.CodeAnalysis.ISymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.IDeconstructionAssignmentOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IDefaultCaseClauseOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IDefaultValueOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IDelegateCreationOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IDelegateCreationOperation.Target.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IDynamicIndexerAccessOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IDynamicIndexerAccessOperation.Arguments.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.IOperation>`\n* [ ] `Microsoft.CodeAnalysis.Operations.IDynamicIndexerAccessOperation.Operation.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IDynamicInvocationOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IDynamicInvocationOperation.Arguments.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.IOperation>`\n* [ ] `Microsoft.CodeAnalysis.Operations.IDynamicInvocationOperation.Operation.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IDynamicMemberReferenceOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IDynamicMemberReferenceOperation.ContainingType.get -> Microsoft.CodeAnalysis.ITypeSymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.IDynamicMemberReferenceOperation.Instance.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IDynamicMemberReferenceOperation.MemberName.get -> string`\n* [ ] `Microsoft.CodeAnalysis.Operations.IDynamicMemberReferenceOperation.TypeArguments.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ITypeSymbol>`\n* [ ] `Microsoft.CodeAnalysis.Operations.IDynamicObjectCreationOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IDynamicObjectCreationOperation.Arguments.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.IOperation>`\n* [ ] `Microsoft.CodeAnalysis.Operations.IDynamicObjectCreationOperation.Initializer.get -> Microsoft.CodeAnalysis.Operations.IObjectOrCollectionInitializerOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IEmptyOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IEndOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IEventAssignmentOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IEventAssignmentOperation.Adds.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.Operations.IEventAssignmentOperation.EventReference.get -> Microsoft.CodeAnalysis.Operations.IEventReferenceOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IEventAssignmentOperation.HandlerValue.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IEventReferenceOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IEventReferenceOperation.Event.get -> Microsoft.CodeAnalysis.IEventSymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.IExpressionStatementOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IExpressionStatementOperation.Operation.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IFieldInitializerOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IFieldInitializerOperation.InitializedFields.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.IFieldSymbol>`\n* [ ] `Microsoft.CodeAnalysis.Operations.IFieldReferenceOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IFieldReferenceOperation.Field.get -> Microsoft.CodeAnalysis.IFieldSymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.IFieldReferenceOperation.IsDeclaration.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.Operations.IForEachLoopOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IForEachLoopOperation.Collection.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IForEachLoopOperation.LoopControlVariable.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IForEachLoopOperation.NextVariables.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.IOperation>`\n* [ ] `Microsoft.CodeAnalysis.Operations.IForLoopOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IForLoopOperation.AtLoopBottom.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.IOperation>`\n* [ ] `Microsoft.CodeAnalysis.Operations.IForLoopOperation.Before.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.IOperation>`\n* [ ] `Microsoft.CodeAnalysis.Operations.IForLoopOperation.Condition.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IForToLoopOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IForToLoopOperation.InitialValue.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IForToLoopOperation.LimitValue.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IForToLoopOperation.LoopControlVariable.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IForToLoopOperation.NextVariables.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.IOperation>`\n* [ ] `Microsoft.CodeAnalysis.Operations.IForToLoopOperation.StepValue.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IIncrementOrDecrementOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IIncrementOrDecrementOperation.IsChecked.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.Operations.IIncrementOrDecrementOperation.IsLifted.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.Operations.IIncrementOrDecrementOperation.IsPostfix.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.Operations.IIncrementOrDecrementOperation.OperatorMethod.get -> Microsoft.CodeAnalysis.IMethodSymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.IIncrementOrDecrementOperation.Target.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IInstanceReferenceOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IInterpolatedStringContentOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IInterpolatedStringOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IInterpolatedStringOperation.Parts.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Operations.IInterpolatedStringContentOperation>`\n* [ ] `Microsoft.CodeAnalysis.Operations.IInterpolatedStringTextOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IInterpolatedStringTextOperation.Text.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IInterpolationOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IInterpolationOperation.Alignment.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IInterpolationOperation.Expression.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IInterpolationOperation.FormatString.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IInvalidOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IInvocationOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IInvocationOperation.Arguments.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Operations.IArgumentOperation>`\n* [ ] `Microsoft.CodeAnalysis.Operations.IInvocationOperation.Instance.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IInvocationOperation.IsVirtual.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.Operations.IInvocationOperation.TargetMethod.get -> Microsoft.CodeAnalysis.IMethodSymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.IIsPatternOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IIsPatternOperation.Pattern.get -> Microsoft.CodeAnalysis.Operations.IPatternOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IIsPatternOperation.Value.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IIsTypeOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IIsTypeOperation.IsNegated.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.Operations.IIsTypeOperation.TypeOperand.get -> Microsoft.CodeAnalysis.ITypeSymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.IIsTypeOperation.ValueOperand.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ILabeledOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ILabeledOperation.Label.get -> Microsoft.CodeAnalysis.ILabelSymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.ILabeledOperation.Operation.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ILiteralOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ILocalFunctionOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ILocalFunctionOperation.Body.get -> Microsoft.CodeAnalysis.Operations.IBlockOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ILocalFunctionOperation.Symbol.get -> Microsoft.CodeAnalysis.IMethodSymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.ILocalReferenceOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ILocalReferenceOperation.IsDeclaration.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.Operations.ILocalReferenceOperation.Local.get -> Microsoft.CodeAnalysis.ILocalSymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.ILockOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ILockOperation.Body.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ILockOperation.LockedValue.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ILoopOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ILoopOperation.Body.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ILoopOperation.Locals.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ILocalSymbol>`\n* [ ] `Microsoft.CodeAnalysis.Operations.ILoopOperation.LoopKind.get -> Microsoft.CodeAnalysis.Operations.LoopKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.IMemberInitializerOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IMemberInitializerOperation.InitializedMember.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IMemberInitializerOperation.Initializer.get -> Microsoft.CodeAnalysis.Operations.IObjectOrCollectionInitializerOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IMemberReferenceOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IMemberReferenceOperation.Instance.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IMemberReferenceOperation.Member.get -> Microsoft.CodeAnalysis.ISymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.IMethodReferenceOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IMethodReferenceOperation.IsVirtual.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.Operations.IMethodReferenceOperation.Method.get -> Microsoft.CodeAnalysis.IMethodSymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.INameOfOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.INameOfOperation.Argument.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IObjectCreationOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IObjectCreationOperation.Arguments.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Operations.IArgumentOperation>`\n* [ ] `Microsoft.CodeAnalysis.Operations.IObjectCreationOperation.Constructor.get -> Microsoft.CodeAnalysis.IMethodSymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.IObjectCreationOperation.Initializer.get -> Microsoft.CodeAnalysis.Operations.IObjectOrCollectionInitializerOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IObjectOrCollectionInitializerOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IObjectOrCollectionInitializerOperation.Initializers.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.IOperation>`\n* [ ] `Microsoft.CodeAnalysis.Operations.IOmittedArgumentOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IParameterInitializerOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IParameterInitializerOperation.Parameter.get -> Microsoft.CodeAnalysis.IParameterSymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.IParameterReferenceOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IParameterReferenceOperation.Parameter.get -> Microsoft.CodeAnalysis.IParameterSymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.IParenthesizedOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IParenthesizedOperation.Operand.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IPatternCaseClauseOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IPatternCaseClauseOperation.Guard.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IPatternCaseClauseOperation.Label.get -> Microsoft.CodeAnalysis.ILabelSymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.IPatternCaseClauseOperation.Pattern.get -> Microsoft.CodeAnalysis.Operations.IPatternOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IPatternOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IPropertyInitializerOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IPropertyInitializerOperation.InitializedProperties.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.IPropertySymbol>`\n* [ ] `Microsoft.CodeAnalysis.Operations.IPropertyReferenceOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IPropertyReferenceOperation.Arguments.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Operations.IArgumentOperation>`\n* [ ] `Microsoft.CodeAnalysis.Operations.IPropertyReferenceOperation.Property.get -> Microsoft.CodeAnalysis.IPropertySymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.IRaiseEventOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IRaiseEventOperation.Arguments.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Operations.IArgumentOperation>`\n* [ ] `Microsoft.CodeAnalysis.Operations.IRaiseEventOperation.EventReference.get -> Microsoft.CodeAnalysis.Operations.IEventReferenceOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IRangeCaseClauseOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IRangeCaseClauseOperation.MaximumValue.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IRangeCaseClauseOperation.MinimumValue.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IRelationalCaseClauseOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IRelationalCaseClauseOperation.Relation.get -> Microsoft.CodeAnalysis.Operations.BinaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.IRelationalCaseClauseOperation.Value.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IReturnOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IReturnOperation.ReturnedValue.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ISimpleAssignmentOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ISimpleAssignmentOperation.IsRef.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.Operations.ISingleValueCaseClauseOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ISingleValueCaseClauseOperation.Value.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ISizeOfOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ISizeOfOperation.TypeOperand.get -> Microsoft.CodeAnalysis.ITypeSymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.IStopOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ISwitchCaseOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ISwitchCaseOperation.Body.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.IOperation>`\n* [ ] `Microsoft.CodeAnalysis.Operations.ISwitchCaseOperation.Clauses.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Operations.ICaseClauseOperation>`\n* [ ] `Microsoft.CodeAnalysis.Operations.ISwitchOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ISwitchOperation.Cases.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Operations.ISwitchCaseOperation>`\n* [ ] `Microsoft.CodeAnalysis.Operations.ISwitchOperation.Value.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ISymbolInitializerOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ISymbolInitializerOperation.Value.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IThrowOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IThrowOperation.Exception.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ITranslatedQueryOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ITranslatedQueryOperation.Operation.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ITryOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ITryOperation.Body.get -> Microsoft.CodeAnalysis.Operations.IBlockOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ITryOperation.Catches.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Operations.ICatchClauseOperation>`\n* [ ] `Microsoft.CodeAnalysis.Operations.ITryOperation.Finally.get -> Microsoft.CodeAnalysis.Operations.IBlockOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ITupleOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ITupleOperation.Elements.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.IOperation>`\n* [ ] `Microsoft.CodeAnalysis.Operations.ITypeOfOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ITypeOfOperation.TypeOperand.get -> Microsoft.CodeAnalysis.ITypeSymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.ITypeParameterObjectCreationOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ITypeParameterObjectCreationOperation.Initializer.get -> Microsoft.CodeAnalysis.Operations.IObjectOrCollectionInitializerOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IUnaryOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IUnaryOperation.IsChecked.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.Operations.IUnaryOperation.IsLifted.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.Operations.IUnaryOperation.Operand.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IUnaryOperation.OperatorKind.get -> Microsoft.CodeAnalysis.Operations.UnaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.IUnaryOperation.OperatorMethod.get -> Microsoft.CodeAnalysis.IMethodSymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.IUsingOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IUsingOperation.Body.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IUsingOperation.Resources.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IVariableDeclarationGroupOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IVariableDeclarationGroupOperation.Declarations.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Operations.IVariableDeclarationOperation>`\n* [ ] `Microsoft.CodeAnalysis.Operations.IVariableDeclarationOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IVariableDeclarationOperation.Declarators.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Operations.IVariableDeclaratorOperation>`\n* [ ] `Microsoft.CodeAnalysis.Operations.IVariableDeclarationOperation.Initializer.get -> Microsoft.CodeAnalysis.Operations.IVariableInitializerOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IVariableDeclaratorOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IVariableDeclaratorOperation.IgnoredArguments.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.IOperation>`\n* [ ] `Microsoft.CodeAnalysis.Operations.IVariableDeclaratorOperation.Initializer.get -> Microsoft.CodeAnalysis.Operations.IVariableInitializerOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IVariableDeclaratorOperation.Symbol.get -> Microsoft.CodeAnalysis.ILocalSymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.IVariableInitializerOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IWhileLoopOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IWhileLoopOperation.Condition.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IWhileLoopOperation.ConditionIsTop.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.Operations.IWhileLoopOperation.ConditionIsUntil.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.Operations.IWhileLoopOperation.IgnoredCondition.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.LoopKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.LoopKind.For = 2 -> Microsoft.CodeAnalysis.Operations.LoopKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.LoopKind.ForEach = 4 -> Microsoft.CodeAnalysis.Operations.LoopKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.LoopKind.ForTo = 3 -> Microsoft.CodeAnalysis.Operations.LoopKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.LoopKind.None = 0 -> Microsoft.CodeAnalysis.Operations.LoopKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.LoopKind.While = 1 -> Microsoft.CodeAnalysis.Operations.LoopKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.OperationExtensions`\n* [ ] `Microsoft.CodeAnalysis.Operations.OperationVisitor`\n* [ ] `Microsoft.CodeAnalysis.Operations.OperationVisitor.OperationVisitor() -> void`\n* [ ] `Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>`\n* [ ] `Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.OperationVisitor() -> void`\n* [ ] `Microsoft.CodeAnalysis.Operations.OperationWalker`\n* [ ] `Microsoft.CodeAnalysis.Operations.OperationWalker.OperationWalker() -> void`\n* [ ] `Microsoft.CodeAnalysis.Operations.UnaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.UnaryOperatorKind.BitwiseNegation = 1 -> Microsoft.CodeAnalysis.Operations.UnaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.UnaryOperatorKind.False = 6 -> Microsoft.CodeAnalysis.Operations.UnaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.UnaryOperatorKind.Minus = 4 -> Microsoft.CodeAnalysis.Operations.UnaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.UnaryOperatorKind.None = 0 -> Microsoft.CodeAnalysis.Operations.UnaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.UnaryOperatorKind.Not = 2 -> Microsoft.CodeAnalysis.Operations.UnaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.UnaryOperatorKind.Plus = 3 -> Microsoft.CodeAnalysis.Operations.UnaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.UnaryOperatorKind.True = 5 -> Microsoft.CodeAnalysis.Operations.UnaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.RefKind.In = 3 -> Microsoft.CodeAnalysis.RefKind`\n* [ ] `Microsoft.CodeAnalysis.RefKind.RefReadOnly = 3 -> Microsoft.CodeAnalysis.RefKind`\n* [ ] `Microsoft.CodeAnalysis.SemanticModel.GetOperation(Microsoft.CodeAnalysis.SyntaxNode node, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.SyntaxList<TNode>.SyntaxList(System.Collections.Generic.IEnumerable<TNode> nodes) -> void`\n* [ ] `Microsoft.CodeAnalysis.SyntaxList<TNode>.SyntaxList(TNode node) -> void`\n* [ ] `Microsoft.CodeAnalysis.SyntaxNodeOrTokenList.SyntaxNodeOrTokenList(System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.SyntaxNodeOrToken> nodesAndTokens) -> void`\n* [ ] `Microsoft.CodeAnalysis.SyntaxNodeOrTokenList.SyntaxNodeOrTokenList(params Microsoft.CodeAnalysis.SyntaxNodeOrToken[] nodesAndTokens) -> void`\n* [ ] `Microsoft.CodeAnalysis.SyntaxTokenList.SyntaxTokenList(Microsoft.CodeAnalysis.SyntaxToken token) -> void`\n* [ ] `Microsoft.CodeAnalysis.SyntaxTokenList.SyntaxTokenList(System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.SyntaxToken> tokens) -> void`\n* [ ] `Microsoft.CodeAnalysis.SyntaxTokenList.SyntaxTokenList(params Microsoft.CodeAnalysis.SyntaxToken[] tokens) -> void`\n* [ ] `Microsoft.CodeAnalysis.SyntaxTriviaList.SyntaxTriviaList(Microsoft.CodeAnalysis.SyntaxTrivia trivia) -> void`\n* [ ] `Microsoft.CodeAnalysis.SyntaxTriviaList.SyntaxTriviaList(System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.SyntaxTrivia> trivias) -> void`\n* [ ] `Microsoft.CodeAnalysis.SyntaxTriviaList.SyntaxTriviaList(params Microsoft.CodeAnalysis.SyntaxTrivia[] trivias) -> void`\n* [ ] `override Microsoft.CodeAnalysis.Operations.OperationWalker.DefaultVisit(Microsoft.CodeAnalysis.IOperation operation) -> void`\n* [ ] `override Microsoft.CodeAnalysis.Operations.OperationWalker.Visit(Microsoft.CodeAnalysis.IOperation operation) -> void`\n* [ ] `override Microsoft.CodeAnalysis.Optional<T>.ToString() -> string`\n* [ ] `static Microsoft.CodeAnalysis.Emit.EmitBaseline.CreateInitialBaseline(Microsoft.CodeAnalysis.ModuleMetadata module, System.Func<System.Reflection.Metadata.MethodDefinitionHandle, Microsoft.CodeAnalysis.Emit.EditAndContinueMethodDebugInformation> debugInformationProvider, System.Func<System.Reflection.Metadata.MethodDefinitionHandle, System.Reflection.Metadata.StandaloneSignatureHandle> localSignatureProvider, bool hasPortableDebugInformation) -> Microsoft.CodeAnalysis.Emit.EmitBaseline`\n* [ ] `static Microsoft.CodeAnalysis.Operations.OperationExtensions.Descendants(this Microsoft.CodeAnalysis.IOperation operation) -> System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.IOperation>`\n* [ ] `static Microsoft.CodeAnalysis.Operations.OperationExtensions.DescendantsAndSelf(this Microsoft.CodeAnalysis.IOperation operation) -> System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.IOperation>`\n* [ ] `static Microsoft.CodeAnalysis.Operations.OperationExtensions.GetArgumentName(this Microsoft.CodeAnalysis.Operations.IDynamicIndexerAccessOperation dynamicOperation, int index) -> string`\n* [ ] `static Microsoft.CodeAnalysis.Operations.OperationExtensions.GetArgumentName(this Microsoft.CodeAnalysis.Operations.IDynamicInvocationOperation dynamicOperation, int index) -> string`\n* [ ] `static Microsoft.CodeAnalysis.Operations.OperationExtensions.GetArgumentName(this Microsoft.CodeAnalysis.Operations.IDynamicObjectCreationOperation dynamicOperation, int index) -> string`\n* [ ] `static Microsoft.CodeAnalysis.Operations.OperationExtensions.GetArgumentRefKind(this Microsoft.CodeAnalysis.Operations.IDynamicIndexerAccessOperation dynamicOperation, int index) -> Microsoft.CodeAnalysis.RefKind?`\n* [ ] `static Microsoft.CodeAnalysis.Operations.OperationExtensions.GetArgumentRefKind(this Microsoft.CodeAnalysis.Operations.IDynamicInvocationOperation dynamicOperation, int index) -> Microsoft.CodeAnalysis.RefKind?`\n* [ ] `static Microsoft.CodeAnalysis.Operations.OperationExtensions.GetArgumentRefKind(this Microsoft.CodeAnalysis.Operations.IDynamicObjectCreationOperation dynamicOperation, int index) -> Microsoft.CodeAnalysis.RefKind?`\n* [ ] `static Microsoft.CodeAnalysis.Operations.OperationExtensions.GetDeclaredVariables(this Microsoft.CodeAnalysis.Operations.IVariableDeclarationGroupOperation declarationGroup) -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ILocalSymbol>`\n* [ ] `static Microsoft.CodeAnalysis.Operations.OperationExtensions.GetDeclaredVariables(this Microsoft.CodeAnalysis.Operations.IVariableDeclarationOperation declaration) -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ILocalSymbol>`\n* [ ] `static Microsoft.CodeAnalysis.Operations.OperationExtensions.GetVariableInitializer(this Microsoft.CodeAnalysis.Operations.IVariableDeclaratorOperation declarationOperation) -> Microsoft.CodeAnalysis.Operations.IVariableInitializerOperation`\n* [ ] `virtual Microsoft.CodeAnalysis.Diagnostics.AnalysisContext.RegisterOperationAction(System.Action<Microsoft.CodeAnalysis.Diagnostics.OperationAnalysisContext> action, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.OperationKind> operationKinds) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Diagnostics.AnalysisContext.RegisterOperationBlockAction(System.Action<Microsoft.CodeAnalysis.Diagnostics.OperationBlockAnalysisContext> action) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Diagnostics.AnalysisContext.RegisterOperationBlockStartAction(System.Action<Microsoft.CodeAnalysis.Diagnostics.OperationBlockStartAnalysisContext> action) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Diagnostics.CompilationStartAnalysisContext.RegisterOperationAction(System.Action<Microsoft.CodeAnalysis.Diagnostics.OperationAnalysisContext> action, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.OperationKind> operationKinds) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Diagnostics.CompilationStartAnalysisContext.RegisterOperationBlockAction(System.Action<Microsoft.CodeAnalysis.Diagnostics.OperationBlockAnalysisContext> action) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Diagnostics.CompilationStartAnalysisContext.RegisterOperationBlockStartAction(System.Action<Microsoft.CodeAnalysis.Diagnostics.OperationBlockStartAnalysisContext> action) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.DefaultVisit(Microsoft.CodeAnalysis.IOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.Visit(Microsoft.CodeAnalysis.IOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitAddressOf(Microsoft.CodeAnalysis.Operations.IAddressOfOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitAnonymousFunction(Microsoft.CodeAnalysis.Operations.IAnonymousFunctionOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitAnonymousObjectCreation(Microsoft.CodeAnalysis.Operations.IAnonymousObjectCreationOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitArgument(Microsoft.CodeAnalysis.Operations.IArgumentOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitArrayCreation(Microsoft.CodeAnalysis.Operations.IArrayCreationOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitArrayElementReference(Microsoft.CodeAnalysis.Operations.IArrayElementReferenceOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitArrayInitializer(Microsoft.CodeAnalysis.Operations.IArrayInitializerOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitAwait(Microsoft.CodeAnalysis.Operations.IAwaitOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitBinaryOperator(Microsoft.CodeAnalysis.Operations.IBinaryOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitBlock(Microsoft.CodeAnalysis.Operations.IBlockOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitBranch(Microsoft.CodeAnalysis.Operations.IBranchOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitCatchClause(Microsoft.CodeAnalysis.Operations.ICatchClauseOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitCoalesce(Microsoft.CodeAnalysis.Operations.ICoalesceOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitCollectionElementInitializer(Microsoft.CodeAnalysis.Operations.ICollectionElementInitializerOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitCompoundAssignment(Microsoft.CodeAnalysis.Operations.ICompoundAssignmentOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitConditional(Microsoft.CodeAnalysis.Operations.IConditionalOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitConditionalAccess(Microsoft.CodeAnalysis.Operations.IConditionalAccessOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitConditionalAccessInstance(Microsoft.CodeAnalysis.Operations.IConditionalAccessInstanceOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitConstantPattern(Microsoft.CodeAnalysis.Operations.IConstantPatternOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitConversion(Microsoft.CodeAnalysis.Operations.IConversionOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitDeclarationExpression(Microsoft.CodeAnalysis.Operations.IDeclarationExpressionOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitDeclarationPattern(Microsoft.CodeAnalysis.Operations.IDeclarationPatternOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitDeconstructionAssignment(Microsoft.CodeAnalysis.Operations.IDeconstructionAssignmentOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitDefaultCaseClause(Microsoft.CodeAnalysis.Operations.IDefaultCaseClauseOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitDefaultValue(Microsoft.CodeAnalysis.Operations.IDefaultValueOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitDelegateCreation(Microsoft.CodeAnalysis.Operations.IDelegateCreationOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitDynamicIndexerAccess(Microsoft.CodeAnalysis.Operations.IDynamicIndexerAccessOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitDynamicInvocation(Microsoft.CodeAnalysis.Operations.IDynamicInvocationOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitDynamicMemberReference(Microsoft.CodeAnalysis.Operations.IDynamicMemberReferenceOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitDynamicObjectCreation(Microsoft.CodeAnalysis.Operations.IDynamicObjectCreationOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitEmpty(Microsoft.CodeAnalysis.Operations.IEmptyOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitEnd(Microsoft.CodeAnalysis.Operations.IEndOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitEventAssignment(Microsoft.CodeAnalysis.Operations.IEventAssignmentOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitEventReference(Microsoft.CodeAnalysis.Operations.IEventReferenceOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitExpressionStatement(Microsoft.CodeAnalysis.Operations.IExpressionStatementOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitFieldInitializer(Microsoft.CodeAnalysis.Operations.IFieldInitializerOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitFieldReference(Microsoft.CodeAnalysis.Operations.IFieldReferenceOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitForEachLoop(Microsoft.CodeAnalysis.Operations.IForEachLoopOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitForLoop(Microsoft.CodeAnalysis.Operations.IForLoopOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitForToLoop(Microsoft.CodeAnalysis.Operations.IForToLoopOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitIncrementOrDecrement(Microsoft.CodeAnalysis.Operations.IIncrementOrDecrementOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitInstanceReference(Microsoft.CodeAnalysis.Operations.IInstanceReferenceOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitInterpolatedString(Microsoft.CodeAnalysis.Operations.IInterpolatedStringOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitInterpolatedStringText(Microsoft.CodeAnalysis.Operations.IInterpolatedStringTextOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitInterpolation(Microsoft.CodeAnalysis.Operations.IInterpolationOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitInvalid(Microsoft.CodeAnalysis.Operations.IInvalidOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitInvocation(Microsoft.CodeAnalysis.Operations.IInvocationOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitIsPattern(Microsoft.CodeAnalysis.Operations.IIsPatternOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitIsType(Microsoft.CodeAnalysis.Operations.IIsTypeOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitLabeled(Microsoft.CodeAnalysis.Operations.ILabeledOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitLiteral(Microsoft.CodeAnalysis.Operations.ILiteralOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitLocalFunction(Microsoft.CodeAnalysis.Operations.ILocalFunctionOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitLocalReference(Microsoft.CodeAnalysis.Operations.ILocalReferenceOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitLock(Microsoft.CodeAnalysis.Operations.ILockOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitMemberInitializer(Microsoft.CodeAnalysis.Operations.IMemberInitializerOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitMethodReference(Microsoft.CodeAnalysis.Operations.IMethodReferenceOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitNameOf(Microsoft.CodeAnalysis.Operations.INameOfOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitObjectCreation(Microsoft.CodeAnalysis.Operations.IObjectCreationOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitObjectOrCollectionInitializer(Microsoft.CodeAnalysis.Operations.IObjectOrCollectionInitializerOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitOmittedArgument(Microsoft.CodeAnalysis.Operations.IOmittedArgumentOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitParameterInitializer(Microsoft.CodeAnalysis.Operations.IParameterInitializerOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitParameterReference(Microsoft.CodeAnalysis.Operations.IParameterReferenceOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitParenthesized(Microsoft.CodeAnalysis.Operations.IParenthesizedOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitPatternCaseClause(Microsoft.CodeAnalysis.Operations.IPatternCaseClauseOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitPropertyInitializer(Microsoft.CodeAnalysis.Operations.IPropertyInitializerOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitPropertyReference(Microsoft.CodeAnalysis.Operations.IPropertyReferenceOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitRaiseEvent(Microsoft.CodeAnalysis.Operations.IRaiseEventOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitRangeCaseClause(Microsoft.CodeAnalysis.Operations.IRangeCaseClauseOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitRelationalCaseClause(Microsoft.CodeAnalysis.Operations.IRelationalCaseClauseOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitReturn(Microsoft.CodeAnalysis.Operations.IReturnOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitSimpleAssignment(Microsoft.CodeAnalysis.Operations.ISimpleAssignmentOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitSingleValueCaseClause(Microsoft.CodeAnalysis.Operations.ISingleValueCaseClauseOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitSizeOf(Microsoft.CodeAnalysis.Operations.ISizeOfOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitStop(Microsoft.CodeAnalysis.Operations.IStopOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitSwitch(Microsoft.CodeAnalysis.Operations.ISwitchOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitSwitchCase(Microsoft.CodeAnalysis.Operations.ISwitchCaseOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitThrow(Microsoft.CodeAnalysis.Operations.IThrowOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitTranslatedQuery(Microsoft.CodeAnalysis.Operations.ITranslatedQueryOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitTry(Microsoft.CodeAnalysis.Operations.ITryOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitTuple(Microsoft.CodeAnalysis.Operations.ITupleOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitTypeOf(Microsoft.CodeAnalysis.Operations.ITypeOfOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitTypeParameterObjectCreation(Microsoft.CodeAnalysis.Operations.ITypeParameterObjectCreationOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitUnaryOperator(Microsoft.CodeAnalysis.Operations.IUnaryOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitUsing(Microsoft.CodeAnalysis.Operations.IUsingOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitVariableDeclaration(Microsoft.CodeAnalysis.Operations.IVariableDeclarationOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitVariableDeclarationGroup(Microsoft.CodeAnalysis.Operations.IVariableDeclarationGroupOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitVariableDeclarator(Microsoft.CodeAnalysis.Operations.IVariableDeclaratorOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitVariableInitializer(Microsoft.CodeAnalysis.Operations.IVariableInitializerOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitWhileLoop(Microsoft.CodeAnalysis.Operations.IWhileLoopOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.DefaultVisit(Microsoft.CodeAnalysis.IOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.Visit(Microsoft.CodeAnalysis.IOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitAddressOf(Microsoft.CodeAnalysis.Operations.IAddressOfOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitAnonymousFunction(Microsoft.CodeAnalysis.Operations.IAnonymousFunctionOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitAnonymousObjectCreation(Microsoft.CodeAnalysis.Operations.IAnonymousObjectCreationOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitArgument(Microsoft.CodeAnalysis.Operations.IArgumentOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitArrayCreation(Microsoft.CodeAnalysis.Operations.IArrayCreationOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitArrayElementReference(Microsoft.CodeAnalysis.Operations.IArrayElementReferenceOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitArrayInitializer(Microsoft.CodeAnalysis.Operations.IArrayInitializerOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitAwait(Microsoft.CodeAnalysis.Operations.IAwaitOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitBinaryOperator(Microsoft.CodeAnalysis.Operations.IBinaryOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitBlock(Microsoft.CodeAnalysis.Operations.IBlockOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitBranch(Microsoft.CodeAnalysis.Operations.IBranchOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitCatchClause(Microsoft.CodeAnalysis.Operations.ICatchClauseOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitCoalesce(Microsoft.CodeAnalysis.Operations.ICoalesceOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitCollectionElementInitializer(Microsoft.CodeAnalysis.Operations.ICollectionElementInitializerOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitCompoundAssignment(Microsoft.CodeAnalysis.Operations.ICompoundAssignmentOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitConditional(Microsoft.CodeAnalysis.Operations.IConditionalOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitConditionalAccess(Microsoft.CodeAnalysis.Operations.IConditionalAccessOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitConditionalAccessInstance(Microsoft.CodeAnalysis.Operations.IConditionalAccessInstanceOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitConstantPattern(Microsoft.CodeAnalysis.Operations.IConstantPatternOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitConversion(Microsoft.CodeAnalysis.Operations.IConversionOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitDeclarationExpression(Microsoft.CodeAnalysis.Operations.IDeclarationExpressionOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitDeclarationPattern(Microsoft.CodeAnalysis.Operations.IDeclarationPatternOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitDeconstructionAssignment(Microsoft.CodeAnalysis.Operations.IDeconstructionAssignmentOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitDefaultCaseClause(Microsoft.CodeAnalysis.Operations.IDefaultCaseClauseOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitDefaultValue(Microsoft.CodeAnalysis.Operations.IDefaultValueOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitDelegateCreation(Microsoft.CodeAnalysis.Operations.IDelegateCreationOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitDynamicIndexerAccess(Microsoft.CodeAnalysis.Operations.IDynamicIndexerAccessOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitDynamicInvocation(Microsoft.CodeAnalysis.Operations.IDynamicInvocationOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitDynamicMemberReference(Microsoft.CodeAnalysis.Operations.IDynamicMemberReferenceOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitDynamicObjectCreation(Microsoft.CodeAnalysis.Operations.IDynamicObjectCreationOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitEmpty(Microsoft.CodeAnalysis.Operations.IEmptyOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitEnd(Microsoft.CodeAnalysis.Operations.IEndOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitEventAssignment(Microsoft.CodeAnalysis.Operations.IEventAssignmentOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitEventReference(Microsoft.CodeAnalysis.Operations.IEventReferenceOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitExpressionStatement(Microsoft.CodeAnalysis.Operations.IExpressionStatementOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitFieldInitializer(Microsoft.CodeAnalysis.Operations.IFieldInitializerOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitFieldReference(Microsoft.CodeAnalysis.Operations.IFieldReferenceOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitForEachLoop(Microsoft.CodeAnalysis.Operations.IForEachLoopOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitForLoop(Microsoft.CodeAnalysis.Operations.IForLoopOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitForToLoop(Microsoft.CodeAnalysis.Operations.IForToLoopOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitIncrementOrDecrement(Microsoft.CodeAnalysis.Operations.IIncrementOrDecrementOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitInstanceReference(Microsoft.CodeAnalysis.Operations.IInstanceReferenceOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitInterpolatedString(Microsoft.CodeAnalysis.Operations.IInterpolatedStringOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitInterpolatedStringText(Microsoft.CodeAnalysis.Operations.IInterpolatedStringTextOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitInterpolation(Microsoft.CodeAnalysis.Operations.IInterpolationOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitInvalid(Microsoft.CodeAnalysis.Operations.IInvalidOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitInvocation(Microsoft.CodeAnalysis.Operations.IInvocationOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitIsPattern(Microsoft.CodeAnalysis.Operations.IIsPatternOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitIsType(Microsoft.CodeAnalysis.Operations.IIsTypeOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitLabeled(Microsoft.CodeAnalysis.Operations.ILabeledOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitLiteral(Microsoft.CodeAnalysis.Operations.ILiteralOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitLocalFunction(Microsoft.CodeAnalysis.Operations.ILocalFunctionOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitLocalReference(Microsoft.CodeAnalysis.Operations.ILocalReferenceOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitLock(Microsoft.CodeAnalysis.Operations.ILockOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitMemberInitializer(Microsoft.CodeAnalysis.Operations.IMemberInitializerOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitMethodReference(Microsoft.CodeAnalysis.Operations.IMethodReferenceOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitNameOf(Microsoft.CodeAnalysis.Operations.INameOfOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitObjectCreation(Microsoft.CodeAnalysis.Operations.IObjectCreationOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitObjectOrCollectionInitializer(Microsoft.CodeAnalysis.Operations.IObjectOrCollectionInitializerOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitOmittedArgument(Microsoft.CodeAnalysis.Operations.IOmittedArgumentOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitParameterInitializer(Microsoft.CodeAnalysis.Operations.IParameterInitializerOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitParameterReference(Microsoft.CodeAnalysis.Operations.IParameterReferenceOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitParenthesized(Microsoft.CodeAnalysis.Operations.IParenthesizedOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitPatternCaseClause(Microsoft.CodeAnalysis.Operations.IPatternCaseClauseOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitPropertyInitializer(Microsoft.CodeAnalysis.Operations.IPropertyInitializerOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitPropertyReference(Microsoft.CodeAnalysis.Operations.IPropertyReferenceOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitRaiseEvent(Microsoft.CodeAnalysis.Operations.IRaiseEventOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitRangeCaseClause(Microsoft.CodeAnalysis.Operations.IRangeCaseClauseOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitRelationalCaseClause(Microsoft.CodeAnalysis.Operations.IRelationalCaseClauseOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitReturn(Microsoft.CodeAnalysis.Operations.IReturnOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitSimpleAssignment(Microsoft.CodeAnalysis.Operations.ISimpleAssignmentOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitSingleValueCaseClause(Microsoft.CodeAnalysis.Operations.ISingleValueCaseClauseOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitSizeOf(Microsoft.CodeAnalysis.Operations.ISizeOfOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitStop(Microsoft.CodeAnalysis.Operations.IStopOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitSwitch(Microsoft.CodeAnalysis.Operations.ISwitchOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitSwitchCase(Microsoft.CodeAnalysis.Operations.ISwitchCaseOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitThrow(Microsoft.CodeAnalysis.Operations.IThrowOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitTranslatedQuery(Microsoft.CodeAnalysis.Operations.ITranslatedQueryOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitTry(Microsoft.CodeAnalysis.Operations.ITryOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitTuple(Microsoft.CodeAnalysis.Operations.ITupleOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitTypeOf(Microsoft.CodeAnalysis.Operations.ITypeOfOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitTypeParameterObjectCreation(Microsoft.CodeAnalysis.Operations.ITypeParameterObjectCreationOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitUnaryOperator(Microsoft.CodeAnalysis.Operations.IUnaryOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitUsing(Microsoft.CodeAnalysis.Operations.IUsingOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitVariableDeclaration(Microsoft.CodeAnalysis.Operations.IVariableDeclarationOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitVariableDeclarationGroup(Microsoft.CodeAnalysis.Operations.IVariableDeclarationGroupOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitVariableDeclarator(Microsoft.CodeAnalysis.Operations.IVariableDeclaratorOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitVariableInitializer(Microsoft.CodeAnalysis.Operations.IVariableInitializerOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitWhileLoop(Microsoft.CodeAnalysis.Operations.IWhileLoopOperation operation, TArgument argument) -> TResult`\n\n* [ ] `Microsoft.CodeAnalysis.CSharp.Conversion.IsStackAlloc.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Conversion.ToCommonConversion() -> Microsoft.CodeAnalysis.Operations.CommonConversion`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetConversion(this Microsoft.CodeAnalysis.Operations.IConversionOperation conversionExpression) -> Microsoft.CodeAnalysis.CSharp.Conversion`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetInConversion(this Microsoft.CodeAnalysis.Operations.ICompoundAssignmentOperation compoundAssignment) -> Microsoft.CodeAnalysis.CSharp.Conversion`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetOutConversion(this Microsoft.CodeAnalysis.Operations.ICompoundAssignmentOperation compoundAssignment) -> Microsoft.CodeAnalysis.CSharp.Conversion`\n\n## Syntax\n\n* [x] `Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp7_2 = 702 -> Microsoft.CodeAnalysis.CSharp.LanguageVersion`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.RefTypeSyntax.ReadOnlyKeyword.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.RefTypeSyntax.Update(Microsoft.CodeAnalysis.SyntaxToken refKeyword, Microsoft.CodeAnalysis.SyntaxToken readOnlyKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type) -> Microsoft.CodeAnalysis.CSharp.Syntax.RefTypeSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.RefTypeSyntax.WithReadOnlyKeyword(Microsoft.CodeAnalysis.SyntaxToken readOnlyKeyword) -> Microsoft.CodeAnalysis.CSharp.Syntax.RefTypeSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.RefType(Microsoft.CodeAnalysis.SyntaxToken refKeyword, Microsoft.CodeAnalysis.SyntaxToken readOnlyKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type) -> Microsoft.CodeAnalysis.CSharp.Syntax.RefTypeSyntax`\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/CSharp73.md",
    "content": "﻿# C# 7.3 APIs supported via light-up\n\nSee [dotnet/roslyn@e60c9fe](https://github.com/dotnet/roslyn/commit/e60c9fe8accc442218b7858ca79f07b115e493b2).\n\n## Semantics\n\n* [ ] `abstract Microsoft.CodeAnalysis.DataFlowAnalysis.CapturedInside.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ISymbol>`\n* [ ] `abstract Microsoft.CodeAnalysis.DataFlowAnalysis.CapturedOutside.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ISymbol>`\n* [ ] `const Microsoft.CodeAnalysis.WellKnownMemberNames.DeconstructMethodName = \"Deconstruct\" -> string`\n* [ ] `Microsoft.CodeAnalysis.CompilationOptions.MetadataImportOptions.get -> Microsoft.CodeAnalysis.MetadataImportOptions`\n* [ ] `Microsoft.CodeAnalysis.CompilationOptions.WithMetadataImportOptions(Microsoft.CodeAnalysis.MetadataImportOptions value) -> Microsoft.CodeAnalysis.CompilationOptions`\n* [ ] `Microsoft.CodeAnalysis.Emit.EmitOptions.EmitOptions(bool metadataOnly = false, Microsoft.CodeAnalysis.Emit.DebugInformationFormat debugInformationFormat = (Microsoft.CodeAnalysis.Emit.DebugInformationFormat)0, string pdbFilePath = null, string outputNameOverride = null, int fileAlignment = 0, ulong baseAddress = 0, bool highEntropyVirtualAddressSpace = false, Microsoft.CodeAnalysis.SubsystemVersion subsystemVersion = default(Microsoft.CodeAnalysis.SubsystemVersion), string runtimeMetadataVersion = null, bool tolerateErrors = false, bool includePrivateMembers = true, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Emit.InstrumentationKind> instrumentationKinds = default(System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Emit.InstrumentationKind>), System.Security.Cryptography.HashAlgorithmName? pdbChecksumAlgorithm = null) -> void`\n* [ ] `Microsoft.CodeAnalysis.Emit.EmitOptions.EmitOptions(bool metadataOnly, Microsoft.CodeAnalysis.Emit.DebugInformationFormat debugInformationFormat, string pdbFilePath, string outputNameOverride, int fileAlignment, ulong baseAddress, bool highEntropyVirtualAddressSpace, Microsoft.CodeAnalysis.SubsystemVersion subsystemVersion, string runtimeMetadataVersion, bool tolerateErrors, bool includePrivateMembers, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Emit.InstrumentationKind> instrumentationKinds) -> void`\n* [ ] `Microsoft.CodeAnalysis.Emit.EmitOptions.PdbChecksumAlgorithm.get -> System.Security.Cryptography.HashAlgorithmName`\n* [ ] `Microsoft.CodeAnalysis.Emit.EmitOptions.WithPdbChecksumAlgorithm(System.Security.Cryptography.HashAlgorithmName name) -> Microsoft.CodeAnalysis.Emit.EmitOptions`\n* [x] `Microsoft.CodeAnalysis.INamedTypeSymbol.IsSerializable.get -> bool`\n* [x] `Microsoft.CodeAnalysis.ITypeParameterSymbol.HasUnmanagedTypeConstraint.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.MetadataImportOptions`\n* [ ] `Microsoft.CodeAnalysis.MetadataImportOptions.All = 2 -> Microsoft.CodeAnalysis.MetadataImportOptions`\n* [ ] `Microsoft.CodeAnalysis.MetadataImportOptions.Internal = 1 -> Microsoft.CodeAnalysis.MetadataImportOptions`\n* [ ] `Microsoft.CodeAnalysis.MetadataImportOptions.Public = 0 -> Microsoft.CodeAnalysis.MetadataImportOptions`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.ConstructorBodyOperation = 89 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.Discard = 90 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.MethodBodyOperation = 88 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.TupleBinaryOperator = 87 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.IConstructorBodyOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IConstructorBodyOperation.Initializer.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IConstructorBodyOperation.Locals.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ILocalSymbol>`\n* [ ] `Microsoft.CodeAnalysis.Operations.IDiscardOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IDiscardOperation.DiscardSymbol.get -> Microsoft.CodeAnalysis.IDiscardSymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.ILocalFunctionOperation.IgnoredBody.get -> Microsoft.CodeAnalysis.Operations.IBlockOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IMethodBodyBaseOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IMethodBodyBaseOperation.BlockBody.get -> Microsoft.CodeAnalysis.Operations.IBlockOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IMethodBodyBaseOperation.ExpressionBody.get -> Microsoft.CodeAnalysis.Operations.IBlockOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IMethodBodyOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ISymbolInitializerOperation.Locals.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ILocalSymbol>`\n* [ ] `Microsoft.CodeAnalysis.Operations.ITupleBinaryOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ITupleBinaryOperation.LeftOperand.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ITupleBinaryOperation.OperatorKind.get -> Microsoft.CodeAnalysis.Operations.BinaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.ITupleBinaryOperation.RightOperand.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ITupleOperation.NaturalType.get -> Microsoft.CodeAnalysis.ITypeSymbol`\n* [ ] `Microsoft.CodeAnalysis.Platform.Arm64 = 6 -> Microsoft.CodeAnalysis.Platform`\n* [ ] `static Microsoft.CodeAnalysis.Diagnostic.Create(Microsoft.CodeAnalysis.DiagnosticDescriptor descriptor, Microsoft.CodeAnalysis.Location location, Microsoft.CodeAnalysis.DiagnosticSeverity effectiveSeverity, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Location> additionalLocations, System.Collections.Immutable.ImmutableDictionary<string, string> properties, params object[] messageArgs) -> Microsoft.CodeAnalysis.Diagnostic`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitConstructorBodyOperation(Microsoft.CodeAnalysis.Operations.IConstructorBodyOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitDiscardOperation(Microsoft.CodeAnalysis.Operations.IDiscardOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitMethodBodyOperation(Microsoft.CodeAnalysis.Operations.IMethodBodyOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitTupleBinaryOperator(Microsoft.CodeAnalysis.Operations.ITupleBinaryOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitConstructorBodyOperation(Microsoft.CodeAnalysis.Operations.IConstructorBodyOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitDiscardOperation(Microsoft.CodeAnalysis.Operations.IDiscardOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitMethodBodyOperation(Microsoft.CodeAnalysis.Operations.IMethodBodyOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitTupleBinaryOperator(Microsoft.CodeAnalysis.Operations.ITupleBinaryOperation operation, TArgument argument) -> TResult`\n* [ ] `Microsoft.CodeAnalysis.CSharp.CSharpCompilationOptions.CSharpCompilationOptions(Microsoft.CodeAnalysis.OutputKind outputKind, bool reportSuppressedDiagnostics = false, string moduleName = null, string mainTypeName = null, string scriptClassName = null, System.Collections.Generic.IEnumerable<string> usings = null, Microsoft.CodeAnalysis.OptimizationLevel optimizationLevel = Microsoft.CodeAnalysis.OptimizationLevel.Debug, bool checkOverflow = false, bool allowUnsafe = false, string cryptoKeyContainer = null, string cryptoKeyFile = null, System.Collections.Immutable.ImmutableArray<byte> cryptoPublicKey = default(System.Collections.Immutable.ImmutableArray<byte>), bool? delaySign = null, Microsoft.CodeAnalysis.Platform platform = Microsoft.CodeAnalysis.Platform.AnyCpu, Microsoft.CodeAnalysis.ReportDiagnostic generalDiagnosticOption = Microsoft.CodeAnalysis.ReportDiagnostic.Default, int warningLevel = 4, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, Microsoft.CodeAnalysis.ReportDiagnostic>> specificDiagnosticOptions = null, bool concurrentBuild = true, bool deterministic = false, Microsoft.CodeAnalysis.XmlReferenceResolver xmlReferenceResolver = null, Microsoft.CodeAnalysis.SourceReferenceResolver sourceReferenceResolver = null, Microsoft.CodeAnalysis.MetadataReferenceResolver metadataReferenceResolver = null, Microsoft.CodeAnalysis.AssemblyIdentityComparer assemblyIdentityComparer = null, Microsoft.CodeAnalysis.StrongNameProvider strongNameProvider = null, bool publicSign = false, Microsoft.CodeAnalysis.MetadataImportOptions metadataImportOptions = Microsoft.CodeAnalysis.MetadataImportOptions.Public) -> void`\n* [ ] `Microsoft.CodeAnalysis.CSharp.CSharpCompilationOptions.CSharpCompilationOptions(Microsoft.CodeAnalysis.OutputKind outputKind, bool reportSuppressedDiagnostics, string moduleName, string mainTypeName, string scriptClassName, System.Collections.Generic.IEnumerable<string> usings, Microsoft.CodeAnalysis.OptimizationLevel optimizationLevel, bool checkOverflow, bool allowUnsafe, string cryptoKeyContainer, string cryptoKeyFile, System.Collections.Immutable.ImmutableArray<byte> cryptoPublicKey, bool? delaySign, Microsoft.CodeAnalysis.Platform platform, Microsoft.CodeAnalysis.ReportDiagnostic generalDiagnosticOption, int warningLevel, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, Microsoft.CodeAnalysis.ReportDiagnostic>> specificDiagnosticOptions, bool concurrentBuild, bool deterministic, Microsoft.CodeAnalysis.XmlReferenceResolver xmlReferenceResolver, Microsoft.CodeAnalysis.SourceReferenceResolver sourceReferenceResolver, Microsoft.CodeAnalysis.MetadataReferenceResolver metadataReferenceResolver, Microsoft.CodeAnalysis.AssemblyIdentityComparer assemblyIdentityComparer, Microsoft.CodeAnalysis.StrongNameProvider strongNameProvider, bool publicSign) -> void`\n* [ ] `Microsoft.CodeAnalysis.CSharp.CSharpCompilationOptions.WithMetadataImportOptions(Microsoft.CodeAnalysis.MetadataImportOptions value) -> Microsoft.CodeAnalysis.CSharp.CSharpCompilationOptions`\n* [ ] `Microsoft.CodeAnalysis.CSharp.DeconstructionInfo`\n* [ ] `Microsoft.CodeAnalysis.CSharp.DeconstructionInfo.Conversion.get -> Microsoft.CodeAnalysis.CSharp.Conversion?`\n* [ ] `Microsoft.CodeAnalysis.CSharp.DeconstructionInfo.Method.get -> Microsoft.CodeAnalysis.IMethodSymbol`\n* [ ] `Microsoft.CodeAnalysis.CSharp.DeconstructionInfo.Nested.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.CSharp.DeconstructionInfo>`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.CSharpCommandLineParser.Script.get -> Microsoft.CodeAnalysis.CSharp.CSharpCommandLineParser`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetDeconstructionInfo(this Microsoft.CodeAnalysis.SemanticModel semanticModel, Microsoft.CodeAnalysis.CSharp.Syntax.AssignmentExpressionSyntax assignment) -> Microsoft.CodeAnalysis.CSharp.DeconstructionInfo`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetDeconstructionInfo(this Microsoft.CodeAnalysis.SemanticModel semanticModel, Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax foreach) -> Microsoft.CodeAnalysis.CSharp.DeconstructionInfo`\n\n## Syntax\n\n* [x] `Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp7_3 = 703 -> Microsoft.CodeAnalysis.CSharp.LanguageVersion`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ArgumentSyntax.RefKindKeyword.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ArgumentSyntax.WithRefKindKeyword(Microsoft.CodeAnalysis.SyntaxToken refKindKeyword) -> Microsoft.CodeAnalysis.CSharp.Syntax.ArgumentSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterSyntax.RefKindKeyword.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterSyntax.WithRefKindKeyword(Microsoft.CodeAnalysis.SyntaxToken refKindKeyword) -> Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ImplicitStackAllocArrayCreationExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ImplicitStackAllocArrayCreationExpressionSyntax.AddInitializerExpressions(params Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.ImplicitStackAllocArrayCreationExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ImplicitStackAllocArrayCreationExpressionSyntax.CloseBracketToken.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ImplicitStackAllocArrayCreationExpressionSyntax.Initializer.get -> Microsoft.CodeAnalysis.CSharp.Syntax.InitializerExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ImplicitStackAllocArrayCreationExpressionSyntax.OpenBracketToken.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ImplicitStackAllocArrayCreationExpressionSyntax.StackAllocKeyword.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.ImplicitStackAllocArrayCreationExpressionSyntax.Update(Microsoft.CodeAnalysis.SyntaxToken stackAllocKeyword, Microsoft.CodeAnalysis.SyntaxToken openBracketToken, Microsoft.CodeAnalysis.SyntaxToken closeBracketToken, Microsoft.CodeAnalysis.CSharp.Syntax.InitializerExpressionSyntax initializer) -> Microsoft.CodeAnalysis.CSharp.Syntax.ImplicitStackAllocArrayCreationExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ImplicitStackAllocArrayCreationExpressionSyntax.WithCloseBracketToken(Microsoft.CodeAnalysis.SyntaxToken closeBracketToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.ImplicitStackAllocArrayCreationExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ImplicitStackAllocArrayCreationExpressionSyntax.WithInitializer(Microsoft.CodeAnalysis.CSharp.Syntax.InitializerExpressionSyntax initializer) -> Microsoft.CodeAnalysis.CSharp.Syntax.ImplicitStackAllocArrayCreationExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ImplicitStackAllocArrayCreationExpressionSyntax.WithOpenBracketToken(Microsoft.CodeAnalysis.SyntaxToken openBracketToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.ImplicitStackAllocArrayCreationExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ImplicitStackAllocArrayCreationExpressionSyntax.WithStackAllocKeyword(Microsoft.CodeAnalysis.SyntaxToken stackAllocKeyword) -> Microsoft.CodeAnalysis.CSharp.Syntax.ImplicitStackAllocArrayCreationExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.StackAllocArrayCreationExpressionSyntax.Initializer.get -> Microsoft.CodeAnalysis.CSharp.Syntax.InitializerExpressionSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.StackAllocArrayCreationExpressionSyntax.Update(Microsoft.CodeAnalysis.SyntaxToken stackAllocKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type, Microsoft.CodeAnalysis.CSharp.Syntax.InitializerExpressionSyntax initializer) -> Microsoft.CodeAnalysis.CSharp.Syntax.StackAllocArrayCreationExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.StackAllocArrayCreationExpressionSyntax.WithInitializer(Microsoft.CodeAnalysis.CSharp.Syntax.InitializerExpressionSyntax initializer) -> Microsoft.CodeAnalysis.CSharp.Syntax.StackAllocArrayCreationExpressionSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax.IsUnmanaged.get -> bool`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.ImplicitStackAllocArrayCreationExpression = 9053 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitImplicitStackAllocArrayCreationExpression(Microsoft.CodeAnalysis.CSharp.Syntax.ImplicitStackAllocArrayCreationExpressionSyntax node) -> Microsoft.CodeAnalysis.SyntaxNode`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.ImplicitStackAllocArrayCreationExpressionSyntax.Accept(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor visitor) -> void`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.ImplicitStackAllocArrayCreationExpressionSyntax.Accept<TResult>(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult> visitor) -> TResult`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.ImplicitStackAllocArrayCreationExpression(Microsoft.CodeAnalysis.CSharp.Syntax.InitializerExpressionSyntax initializer) -> Microsoft.CodeAnalysis.CSharp.Syntax.ImplicitStackAllocArrayCreationExpressionSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.ImplicitStackAllocArrayCreationExpression(Microsoft.CodeAnalysis.SyntaxToken stackAllocKeyword, Microsoft.CodeAnalysis.SyntaxToken openBracketToken, Microsoft.CodeAnalysis.SyntaxToken closeBracketToken, Microsoft.CodeAnalysis.CSharp.Syntax.InitializerExpressionSyntax initializer) -> Microsoft.CodeAnalysis.CSharp.Syntax.ImplicitStackAllocArrayCreationExpressionSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.StackAllocArrayCreationExpression(Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type, Microsoft.CodeAnalysis.CSharp.Syntax.InitializerExpressionSyntax initializer) -> Microsoft.CodeAnalysis.CSharp.Syntax.StackAllocArrayCreationExpressionSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.StackAllocArrayCreationExpression(Microsoft.CodeAnalysis.SyntaxToken stackAllocKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type, Microsoft.CodeAnalysis.CSharp.Syntax.InitializerExpressionSyntax initializer) -> Microsoft.CodeAnalysis.CSharp.Syntax.StackAllocArrayCreationExpressionSyntax`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitImplicitStackAllocArrayCreationExpression(Microsoft.CodeAnalysis.CSharp.Syntax.ImplicitStackAllocArrayCreationExpressionSyntax node) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult>.VisitImplicitStackAllocArrayCreationExpression(Microsoft.CodeAnalysis.CSharp.Syntax.ImplicitStackAllocArrayCreationExpressionSyntax node) -> TResult`\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/CSharp8.md",
    "content": "﻿# C# 8 APIs supported via light-up\n\n## Semantics\n\n## Syntax\n\n## Uncategorized\n\nSee [Microsoft.CodeAnalysis release/dev16.3@c955f3c99b5698c906e0700ef691b5b1571c8136](https://raw.githubusercontent.com/dotnet/roslyn/c955f3c99b5698c906e0700ef691b5b1571c8136/src/Compilers/Core/Portable/PublicAPI.Unshipped.txt)\n\n* [ ] `*REMOVED*Microsoft.CodeAnalysis.Operations.IEventAssignmentOperation.EventReference.get -> Microsoft.CodeAnalysis.Operations.IEventReferenceOperation`\n* [ ] `*REMOVED*Microsoft.CodeAnalysis.SpecialType.Count = 43 -> Microsoft.CodeAnalysis.SpecialType`\n* [ ] `Microsoft.CodeAnalysis.CommandLineArguments.EmitPdbFile.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.CommandLineArguments.GetOutputFilePath(string outputFileName) -> string`\n* [ ] `Microsoft.CodeAnalysis.CommandLineArguments.GetPdbFilePath(string outputFileName) -> string`\n* [ ] `*REMOVED*Microsoft.CodeAnalysis.Compilation.CreateTupleTypeSymbol(Microsoft.CodeAnalysis.INamedTypeSymbol underlyingType, System.Collections.Immutable.ImmutableArray<string> elementNames = default(System.Collections.Immutable.ImmutableArray<string>), System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Location> elementLocations = default(System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Location>)) -> Microsoft.CodeAnalysis.INamedTypeSymbol`\n* [ ] `Microsoft.CodeAnalysis.Compilation.CreateAnonymousTypeSymbol(System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ITypeSymbol> memberTypes, System.Collections.Immutable.ImmutableArray<string> memberNames, System.Collections.Immutable.ImmutableArray<bool> memberIsReadOnly = default(System.Collections.Immutable.ImmutableArray<bool>), System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Location> memberLocations = default(System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Location>), System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.NullableAnnotation> memberNullableAnnotations = default(System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.NullableAnnotation>)) -> Microsoft.CodeAnalysis.INamedTypeSymbol`\n* [ ] `*REMOVED*Microsoft.CodeAnalysis.Compilation.CreateAnonymousTypeSymbol(System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ITypeSymbol> memberTypes, System.Collections.Immutable.ImmutableArray<string> memberNames, System.Collections.Immutable.ImmutableArray<bool> memberIsReadOnly = default(System.Collections.Immutable.ImmutableArray<bool>), System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Location> memberLocations = default(System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Location>)) -> Microsoft.CodeAnalysis.INamedTypeSymbol`\n* [ ] `Microsoft.CodeAnalysis.Compilation.CreateAnonymousTypeSymbol(System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ITypeSymbol> memberTypes, System.Collections.Immutable.ImmutableArray<string> memberNames, System.Collections.Immutable.ImmutableArray<bool> memberIsReadOnly, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Location> memberLocations) -> Microsoft.CodeAnalysis.INamedTypeSymbol`\n* [ ] `Microsoft.CodeAnalysis.Compilation.CreateArrayTypeSymbol(Microsoft.CodeAnalysis.ITypeSymbol elementType, int rank = 1, Microsoft.CodeAnalysis.NullableAnnotation elementNullableAnnotation = Microsoft.CodeAnalysis.NullableAnnotation.None) -> Microsoft.CodeAnalysis.IArrayTypeSymbol`\n* [ ] `*REMOVED*Microsoft.CodeAnalysis.Compilation.CreateArrayTypeSymbol(Microsoft.CodeAnalysis.ITypeSymbol elementType, int rank = 1) -> Microsoft.CodeAnalysis.IArrayTypeSymbol`\n* [ ] `Microsoft.CodeAnalysis.Compilation.CreateArrayTypeSymbol(Microsoft.CodeAnalysis.ITypeSymbol elementType, int rank) -> Microsoft.CodeAnalysis.IArrayTypeSymbol`\n* [ ] `Microsoft.CodeAnalysis.Compilation.CreateTupleTypeSymbol(Microsoft.CodeAnalysis.INamedTypeSymbol underlyingType, System.Collections.Immutable.ImmutableArray<string> elementNames = default(System.Collections.Immutable.ImmutableArray<string>), System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Location> elementLocations = default(System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Location>), System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.NullableAnnotation> elementNullableAnnotations = default(System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.NullableAnnotation>)) -> Microsoft.CodeAnalysis.INamedTypeSymbol`\n* [ ] `Microsoft.CodeAnalysis.Compilation.CreateTupleTypeSymbol(Microsoft.CodeAnalysis.INamedTypeSymbol underlyingType, System.Collections.Immutable.ImmutableArray<string> elementNames, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Location> elementLocations) -> Microsoft.CodeAnalysis.INamedTypeSymbol`\n* [ ] `*REMOVED*Microsoft.CodeAnalysis.Compilation.CreateTupleTypeSymbol(System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ITypeSymbol> elementTypes, System.Collections.Immutable.ImmutableArray<string> elementNames = default(System.Collections.Immutable.ImmutableArray<string>), System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Location> elementLocations = default(System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Location>)) -> Microsoft.CodeAnalysis.INamedTypeSymbol`\n* [ ] `Microsoft.CodeAnalysis.Compilation.CreateTupleTypeSymbol(System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ITypeSymbol> elementTypes, System.Collections.Immutable.ImmutableArray<string> elementNames = default(System.Collections.Immutable.ImmutableArray<string>), System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Location> elementLocations = default(System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Location>), System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.NullableAnnotation> elementNullableAnnotations = default(System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.NullableAnnotation>)) -> Microsoft.CodeAnalysis.INamedTypeSymbol`\n* [ ] `Microsoft.CodeAnalysis.Compilation.CreateTupleTypeSymbol(System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ITypeSymbol> elementTypes, System.Collections.Immutable.ImmutableArray<string> elementNames, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Location> elementLocations) -> Microsoft.CodeAnalysis.INamedTypeSymbol`\n* [ ] `Microsoft.CodeAnalysis.Compilation.HasImplicitConversion(Microsoft.CodeAnalysis.ITypeSymbol fromType, Microsoft.CodeAnalysis.ITypeSymbol toType) -> bool`\n* [ ] `Microsoft.CodeAnalysis.Compilation.IsSymbolAccessibleWithin(Microsoft.CodeAnalysis.ISymbol symbol, Microsoft.CodeAnalysis.ISymbol within, Microsoft.CodeAnalysis.ITypeSymbol throughType = null) -> bool`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.DiagnosticSuppressor`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.DiagnosticSuppressor.DiagnosticSuppressor() -> void`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Suppression`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Suppression.Descriptor.get -> Microsoft.CodeAnalysis.SuppressionDescriptor`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Suppression.SuppressedDiagnostic.get -> Microsoft.CodeAnalysis.Diagnostic`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.SuppressionAnalysisContext`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.SuppressionAnalysisContext.CancellationToken.get -> System.Threading.CancellationToken`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.SuppressionAnalysisContext.Compilation.get -> Microsoft.CodeAnalysis.Compilation`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.SuppressionAnalysisContext.GetSemanticModel(Microsoft.CodeAnalysis.SyntaxTree syntaxTree) -> Microsoft.CodeAnalysis.SemanticModel`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.SuppressionAnalysisContext.Options.get -> Microsoft.CodeAnalysis.Diagnostics.AnalyzerOptions`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.SuppressionAnalysisContext.ReportSuppression(Microsoft.CodeAnalysis.Diagnostics.Suppression suppression) -> void`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.SuppressionAnalysisContext.ReportedDiagnostics.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostic>`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.SuppressionActionsCount.get -> int`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.SuppressionActionsCount.set -> void`\n* [ ] `Microsoft.CodeAnalysis.IArrayTypeSymbol.ElementNullableAnnotation.get -> Microsoft.CodeAnalysis.NullableAnnotation`\n* [ ] `Microsoft.CodeAnalysis.IDiscardSymbol.NullableAnnotation.get -> Microsoft.CodeAnalysis.NullableAnnotation`\n* [ ] `Microsoft.CodeAnalysis.IEventSymbol.NullableAnnotation.get -> Microsoft.CodeAnalysis.NullableAnnotation`\n* [ ] `Microsoft.CodeAnalysis.IFieldSymbol.NullableAnnotation.get -> Microsoft.CodeAnalysis.NullableAnnotation`\n* [ ] `Microsoft.CodeAnalysis.ILocalSymbol.NullableAnnotation.get -> Microsoft.CodeAnalysis.NullableAnnotation`\n* [ ] `Microsoft.CodeAnalysis.IMethodSymbol.Construct(System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ITypeSymbol> typeArguments, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.NullableAnnotation> typeArgumentNullableAnnotations) -> Microsoft.CodeAnalysis.IMethodSymbol`\n* [ ] `Microsoft.CodeAnalysis.IMethodSymbol.ReceiverNullableAnnotation.get -> Microsoft.CodeAnalysis.NullableAnnotation`\n* [ ] `Microsoft.CodeAnalysis.IMethodSymbol.ReturnNullableAnnotation.get -> Microsoft.CodeAnalysis.NullableAnnotation`\n* [ ] `Microsoft.CodeAnalysis.IMethodSymbol.TypeArgumentNullableAnnotations.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.NullableAnnotation>`\n* [ ] `Microsoft.CodeAnalysis.INamedTypeSymbol.Construct(System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ITypeSymbol> typeArguments, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.NullableAnnotation> typeArgumentNullableAnnotations) -> Microsoft.CodeAnalysis.INamedTypeSymbol`\n* [ ] `Microsoft.CodeAnalysis.INamedTypeSymbol.TypeArgumentNullableAnnotations.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.NullableAnnotation>`\n* [ ] `Microsoft.CodeAnalysis.IParameterSymbol.NullableAnnotation.get -> Microsoft.CodeAnalysis.NullableAnnotation`\n* [ ] `Microsoft.CodeAnalysis.IPropertySymbol.NullableAnnotation.get -> Microsoft.CodeAnalysis.NullableAnnotation`\n* [ ] `Microsoft.CodeAnalysis.ISymbol.Equals(Microsoft.CodeAnalysis.ISymbol other, Microsoft.CodeAnalysis.SymbolEqualityComparer equalityComparer) -> bool`\n* [ ] `Microsoft.CodeAnalysis.ITypeParameterSymbol.ConstraintNullableAnnotations.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.NullableAnnotation>`\n* [ ] `Microsoft.CodeAnalysis.ITypeParameterSymbol.HasNotNullConstraint.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.ITypeParameterSymbol.ReferenceTypeConstraintNullableAnnotation.get -> Microsoft.CodeAnalysis.NullableAnnotation`\n* [ ] `Microsoft.CodeAnalysis.ITypeSymbol.ToDisplayParts(Microsoft.CodeAnalysis.NullableFlowState topLevelNullability, Microsoft.CodeAnalysis.SymbolDisplayFormat format = null) -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.SymbolDisplayPart>`\n* [ ] `Microsoft.CodeAnalysis.ITypeSymbol.ToDisplayString(Microsoft.CodeAnalysis.NullableFlowState topLevelNullability, Microsoft.CodeAnalysis.SymbolDisplayFormat format = null) -> string`\n* [ ] `Microsoft.CodeAnalysis.ITypeSymbol.ToMinimalDisplayParts(Microsoft.CodeAnalysis.SemanticModel semanticModel, Microsoft.CodeAnalysis.NullableFlowState topLevelNullability, int position, Microsoft.CodeAnalysis.SymbolDisplayFormat format = null) -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.SymbolDisplayPart>`\n* [ ] `Microsoft.CodeAnalysis.ITypeSymbol.ToMinimalDisplayString(Microsoft.CodeAnalysis.SemanticModel semanticModel, Microsoft.CodeAnalysis.NullableFlowState topLevelNullability, int position, Microsoft.CodeAnalysis.SymbolDisplayFormat format = null) -> string`\n* [ ] `Microsoft.CodeAnalysis.NullabilityInfo`\n* [ ] `Microsoft.CodeAnalysis.NullabilityInfo.Annotation.get -> Microsoft.CodeAnalysis.NullableAnnotation`\n* [ ] `Microsoft.CodeAnalysis.NullabilityInfo.Equals(Microsoft.CodeAnalysis.NullabilityInfo other) -> bool`\n* [ ] `Microsoft.CodeAnalysis.NullabilityInfo.FlowState.get -> Microsoft.CodeAnalysis.NullableFlowState`\n* [ ] `Microsoft.CodeAnalysis.NullableAnnotation`\n* [ ] `Microsoft.CodeAnalysis.NullableAnnotation.Annotated = 2 -> Microsoft.CodeAnalysis.NullableAnnotation`\n* [ ] `Microsoft.CodeAnalysis.NullableAnnotation.None = 0 -> Microsoft.CodeAnalysis.NullableAnnotation`\n* [ ] `Microsoft.CodeAnalysis.NullableAnnotation.NotAnnotated = 1 -> Microsoft.CodeAnalysis.NullableAnnotation`\n* [ ] `Microsoft.CodeAnalysis.NullableContext`\n* [ ] `Microsoft.CodeAnalysis.NullableContext.AnnotationsContextInherited = 8 -> Microsoft.CodeAnalysis.NullableContext`\n* [ ] `Microsoft.CodeAnalysis.NullableContext.AnnotationsEnabled = 2 -> Microsoft.CodeAnalysis.NullableContext`\n* [ ] `Microsoft.CodeAnalysis.NullableContext.ContextInherited = Microsoft.CodeAnalysis.NullableContext.WarningsContextInherited | Microsoft.CodeAnalysis.NullableContext.AnnotationsContextInherited -> Microsoft.CodeAnalysis.NullableContext`\n* [ ] `Microsoft.CodeAnalysis.NullableContext.Disabled = 0 -> Microsoft.CodeAnalysis.NullableContext`\n* [ ] `Microsoft.CodeAnalysis.NullableContext.Enabled = Microsoft.CodeAnalysis.NullableContext.WarningsEnabled | Microsoft.CodeAnalysis.NullableContext.AnnotationsEnabled -> Microsoft.CodeAnalysis.NullableContext`\n* [ ] `Microsoft.CodeAnalysis.NullableContext.WarningsContextInherited = 4 -> Microsoft.CodeAnalysis.NullableContext`\n* [ ] `Microsoft.CodeAnalysis.NullableContext.WarningsEnabled = 1 -> Microsoft.CodeAnalysis.NullableContext`\n* [ ] `Microsoft.CodeAnalysis.NullableContextExtensions`\n* [ ] `Microsoft.CodeAnalysis.NullableContextOptions`\n* [ ] `Microsoft.CodeAnalysis.NullableContextOptions.Annotations = 2 -> Microsoft.CodeAnalysis.NullableContextOptions`\n* [ ] `Microsoft.CodeAnalysis.NullableContextOptions.Disable = 0 -> Microsoft.CodeAnalysis.NullableContextOptions`\n* [ ] `Microsoft.CodeAnalysis.NullableContextOptions.Enable = Microsoft.CodeAnalysis.NullableContextOptions.Warnings | Microsoft.CodeAnalysis.NullableContextOptions.Annotations -> Microsoft.CodeAnalysis.NullableContextOptions`\n* [ ] `Microsoft.CodeAnalysis.NullableContextOptions.Warnings = 1 -> Microsoft.CodeAnalysis.NullableContextOptions`\n* [ ] `Microsoft.CodeAnalysis.NullableContextOptionsExtensions`\n* [ ] `Microsoft.CodeAnalysis.NullableFlowState`\n* [ ] `Microsoft.CodeAnalysis.NullableFlowState.MaybeNull = 2 -> Microsoft.CodeAnalysis.NullableFlowState`\n* [ ] `Microsoft.CodeAnalysis.NullableFlowState.None = 0 -> Microsoft.CodeAnalysis.NullableFlowState`\n* [ ] `Microsoft.CodeAnalysis.NullableFlowState.NotNull = 1 -> Microsoft.CodeAnalysis.NullableFlowState`\n* [ ] `Microsoft.CodeAnalysis.SuppressionDescriptor`\n* [ ] `Microsoft.CodeAnalysis.SuppressionDescriptor.Equals(Microsoft.CodeAnalysis.SuppressionDescriptor other) -> bool`\n* [ ] `Microsoft.CodeAnalysis.SuppressionDescriptor.Id.get -> string`\n* [ ] `Microsoft.CodeAnalysis.SuppressionDescriptor.Justification.get -> Microsoft.CodeAnalysis.LocalizableString`\n* [ ] `Microsoft.CodeAnalysis.SuppressionDescriptor.SuppressedDiagnosticId.get -> string`\n* [ ] `Microsoft.CodeAnalysis.SuppressionDescriptor.SuppressionDescriptor(string id, string suppressedDiagnosticId, Microsoft.CodeAnalysis.LocalizableString justification) -> void`\n* [ ] `Microsoft.CodeAnalysis.SuppressionDescriptor.SuppressionDescriptor(string id, string suppressedDiagnosticId, string justification) -> void`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.PropertySubpattern = 107 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.IPropertySubpatternOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IPropertySubpatternOperation.Member.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IPropertySubpatternOperation.Pattern.get -> Microsoft.CodeAnalysis.Operations.IPatternOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IRecursivePatternOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IRecursivePatternOperation.DeclaredSymbol.get -> Microsoft.CodeAnalysis.ISymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.IRecursivePatternOperation.DeconstructSymbol.get -> Microsoft.CodeAnalysis.ISymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.IRecursivePatternOperation.DeconstructionSubpatterns.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Operations.IPatternOperation>`\n* [ ] `Microsoft.CodeAnalysis.Operations.IRecursivePatternOperation.MatchedType.get -> Microsoft.CodeAnalysis.ITypeSymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.IRecursivePatternOperation.PropertySubpatterns.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Operations.IPropertySubpatternOperation>`\n* [ ] `Microsoft.CodeAnalysis.SymbolEqualityComparer`\n* [ ] `Microsoft.CodeAnalysis.SymbolEqualityComparer.Equals(Microsoft.CodeAnalysis.ISymbol x, Microsoft.CodeAnalysis.ISymbol y) -> bool`\n* [ ] `Microsoft.CodeAnalysis.SymbolEqualityComparer.GetHashCode(Microsoft.CodeAnalysis.ISymbol obj) -> int`\n* [ ] `Microsoft.CodeAnalysis.TypeInfo.ConvertedNullability.get -> Microsoft.CodeAnalysis.NullabilityInfo`\n* [ ] `Microsoft.CodeAnalysis.TypeInfo.Nullability.get -> Microsoft.CodeAnalysis.NullabilityInfo`\n* [ ] `abstract Microsoft.CodeAnalysis.Compilation.ClassifyCommonConversion(Microsoft.CodeAnalysis.ITypeSymbol source, Microsoft.CodeAnalysis.ITypeSymbol destination) -> Microsoft.CodeAnalysis.Operations.CommonConversion`\n* [ ] `abstract Microsoft.CodeAnalysis.Compilation.ContainsSymbolsWithName(string name, Microsoft.CodeAnalysis.SymbolFilter filter = Microsoft.CodeAnalysis.SymbolFilter.TypeAndMember, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> bool`\n* [ ] `abstract Microsoft.CodeAnalysis.Compilation.GetSymbolsWithName(string name, Microsoft.CodeAnalysis.SymbolFilter filter = Microsoft.CodeAnalysis.SymbolFilter.TypeAndMember, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.ISymbol>`\n* [ ] `abstract Microsoft.CodeAnalysis.CompilationOptions.NullableContextOptions.get -> Microsoft.CodeAnalysis.NullableContextOptions`\n* [ ] `abstract Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions.TryGetValue(string key, out string value) -> bool`\n* [ ] `abstract Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptionsProvider.GetOptions(Microsoft.CodeAnalysis.AdditionalText textFile) -> Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions`\n* [ ] `abstract Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptionsProvider.GetOptions(Microsoft.CodeAnalysis.SyntaxTree tree) -> Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions`\n* [ ] `abstract Microsoft.CodeAnalysis.Diagnostics.DiagnosticSuppressor.ReportSuppressions(Microsoft.CodeAnalysis.Diagnostics.SuppressionAnalysisContext context) -> void`\n* [ ] `abstract Microsoft.CodeAnalysis.Diagnostics.DiagnosticSuppressor.SupportedSuppressions.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.SuppressionDescriptor>`\n* [ ] `abstract Microsoft.CodeAnalysis.Diagnostics.SymbolStartAnalysisContext.RegisterCodeBlockAction(System.Action<Microsoft.CodeAnalysis.Diagnostics.CodeBlockAnalysisContext> action) -> void`\n* [ ] `abstract Microsoft.CodeAnalysis.Diagnostics.SymbolStartAnalysisContext.RegisterCodeBlockStartAction<TLanguageKindEnum>(System.Action<Microsoft.CodeAnalysis.Diagnostics.CodeBlockStartAnalysisContext<TLanguageKindEnum>> action) -> void`\n* [ ] `abstract Microsoft.CodeAnalysis.Diagnostics.SymbolStartAnalysisContext.RegisterOperationAction(System.Action<Microsoft.CodeAnalysis.Diagnostics.OperationAnalysisContext> action, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.OperationKind> operationKinds) -> void`\n* [ ] `abstract Microsoft.CodeAnalysis.Diagnostics.SymbolStartAnalysisContext.RegisterOperationBlockAction(System.Action<Microsoft.CodeAnalysis.Diagnostics.OperationBlockAnalysisContext> action) -> void`\n* [ ] `abstract Microsoft.CodeAnalysis.Diagnostics.SymbolStartAnalysisContext.RegisterOperationBlockStartAction(System.Action<Microsoft.CodeAnalysis.Diagnostics.OperationBlockStartAnalysisContext> action) -> void`\n* [ ] `abstract Microsoft.CodeAnalysis.Diagnostics.SymbolStartAnalysisContext.RegisterSymbolEndAction(System.Action<Microsoft.CodeAnalysis.Diagnostics.SymbolAnalysisContext> action) -> void`\n* [ ] `abstract Microsoft.CodeAnalysis.Diagnostics.SymbolStartAnalysisContext.RegisterSyntaxNodeAction<TLanguageKindEnum>(System.Action<Microsoft.CodeAnalysis.Diagnostics.SyntaxNodeAnalysisContext> action, System.Collections.Immutable.ImmutableArray<TLanguageKindEnum> syntaxKinds) -> void`\n* [ ] `abstract Microsoft.CodeAnalysis.SemanticModel.GetNullableContext(int position) -> Microsoft.CodeAnalysis.NullableContext`\n* [ ] `const Microsoft.CodeAnalysis.WellKnownMemberNames.CountPropertyName = \"Count\" -> string`\n* [ ] `const Microsoft.CodeAnalysis.WellKnownMemberNames.DisposeAsyncMethodName = \"DisposeAsync\" -> string`\n* [ ] `const Microsoft.CodeAnalysis.WellKnownMemberNames.DisposeMethodName = \"Dispose\" -> string`\n* [ ] `const Microsoft.CodeAnalysis.WellKnownMemberNames.GetAsyncEnumeratorMethodName = \"GetAsyncEnumerator\" -> string`\n* [ ] `const Microsoft.CodeAnalysis.WellKnownMemberNames.LengthPropertyName = \"Length\" -> string`\n* [ ] `const Microsoft.CodeAnalysis.WellKnownMemberNames.MoveNextAsyncMethodName = \"MoveNextAsync\" -> string`\n* [ ] `Microsoft.CodeAnalysis.AnalyzerConfig`\n* [ ] `Microsoft.CodeAnalysis.AnalyzerConfig.GlobalSection.get -> Microsoft.CodeAnalysis.AnalyzerConfig.Section`\n* [ ] `Microsoft.CodeAnalysis.AnalyzerConfig.IsRoot.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.AnalyzerConfig.NamedSections.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.AnalyzerConfig.Section>`\n* [ ] `Microsoft.CodeAnalysis.AnalyzerConfig.NormalizedDirectory.get -> string`\n* [ ] `Microsoft.CodeAnalysis.AnalyzerConfig.PathToFile.get -> string`\n* [ ] `Microsoft.CodeAnalysis.AnalyzerConfig.Section`\n* [ ] `Microsoft.CodeAnalysis.AnalyzerConfig.Section.Name.get -> string`\n* [ ] `Microsoft.CodeAnalysis.AnalyzerConfig.Section.Properties.get -> System.Collections.Immutable.ImmutableDictionary<string, string>`\n* [ ] `Microsoft.CodeAnalysis.AnalyzerConfig.Section.Section(string name, System.Collections.Immutable.ImmutableDictionary<string, string> properties) -> void`\n* [ ] `Microsoft.CodeAnalysis.AnalyzerConfig.SectionNameMatcher`\n* [ ] `Microsoft.CodeAnalysis.AnalyzerConfig.SectionNameMatcher.IsMatch(string s) -> bool`\n* [ ] `Microsoft.CodeAnalysis.AnalyzerConfigOptionsResult`\n* [ ] `Microsoft.CodeAnalysis.AnalyzerConfigOptionsResult.AnalyzerOptions.get -> System.Collections.Immutable.ImmutableDictionary<string, string>`\n* [ ] `Microsoft.CodeAnalysis.AnalyzerConfigOptionsResult.Diagnostics.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostic>`\n* [ ] `Microsoft.CodeAnalysis.AnalyzerConfigOptionsResult.TreeOptions.get -> System.Collections.Immutable.ImmutableDictionary<string, Microsoft.CodeAnalysis.ReportDiagnostic>`\n* [ ] `Microsoft.CodeAnalysis.AnalyzerConfigSet`\n* [ ] `Microsoft.CodeAnalysis.AnalyzerConfigSet.GetOptionsForSourcePath(string sourcePath) -> Microsoft.CodeAnalysis.AnalyzerConfigOptionsResult`\n* [ ] `Microsoft.CodeAnalysis.CommandLineArguments.AnalyzerConfigPaths.get -> System.Collections.Immutable.ImmutableArray<string>`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions.AnalyzerConfigOptions() -> void`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptionsProvider`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptionsProvider.AnalyzerConfigOptionsProvider() -> void`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.AnalyzerOptions.AnalyzerConfigOptionsProvider.get -> Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptionsProvider`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.AnalyzerOptions.AnalyzerOptions(System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.AdditionalText> additionalFiles, Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptionsProvider optionsProvider) -> void`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.OperationAnalysisContext.GetControlFlowGraph() -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.OperationBlockAnalysisContext.GetControlFlowGraph(Microsoft.CodeAnalysis.IOperation operationBlock) -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.OperationBlockStartAnalysisContext.GetControlFlowGraph(Microsoft.CodeAnalysis.IOperation operationBlock) -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.SymbolStartAnalysisContext`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.SymbolStartAnalysisContext.CancellationToken.get -> System.Threading.CancellationToken`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.SymbolStartAnalysisContext.Compilation.get -> Microsoft.CodeAnalysis.Compilation`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.SymbolStartAnalysisContext.Options.get -> Microsoft.CodeAnalysis.Diagnostics.AnalyzerOptions`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.SymbolStartAnalysisContext.RegisterOperationAction(System.Action<Microsoft.CodeAnalysis.Diagnostics.OperationAnalysisContext> action, params Microsoft.CodeAnalysis.OperationKind[] operationKinds) -> void`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.SymbolStartAnalysisContext.RegisterSyntaxNodeAction<TLanguageKindEnum>(System.Action<Microsoft.CodeAnalysis.Diagnostics.SyntaxNodeAnalysisContext> action, params TLanguageKindEnum[] syntaxKinds) -> void`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.SymbolStartAnalysisContext.Symbol.get -> Microsoft.CodeAnalysis.ISymbol`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.SymbolStartAnalysisContext.SymbolStartAnalysisContext(Microsoft.CodeAnalysis.ISymbol symbol, Microsoft.CodeAnalysis.Compilation compilation, Microsoft.CodeAnalysis.Diagnostics.AnalyzerOptions options, System.Threading.CancellationToken cancellationToken) -> void`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.Concurrent.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.Concurrent.set -> void`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.SymbolEndActionsCount.get -> int`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.SymbolEndActionsCount.set -> void`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.SymbolStartActionsCount.get -> int`\n* [ ] `Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.SymbolStartActionsCount.set -> void`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.BasicBlock`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.BasicBlock.BranchValue.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.BasicBlock.ConditionalSuccessor.get -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowBranch`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.BasicBlock.ConditionKind.get -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowConditionKind`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.BasicBlock.EnclosingRegion.get -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegion`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.BasicBlock.FallThroughSuccessor.get -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowBranch`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.BasicBlock.IsReachable.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.BasicBlock.Kind.get -> Microsoft.CodeAnalysis.FlowAnalysis.BasicBlockKind`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.BasicBlock.Operations.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.IOperation>`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.BasicBlock.Ordinal.get -> int`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.BasicBlock.Predecessors.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowBranch>`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.BasicBlockKind`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.BasicBlockKind.Block = 2 -> Microsoft.CodeAnalysis.FlowAnalysis.BasicBlockKind`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.BasicBlockKind.Entry = 0 -> Microsoft.CodeAnalysis.FlowAnalysis.BasicBlockKind`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.BasicBlockKind.Exit = 1 -> Microsoft.CodeAnalysis.FlowAnalysis.BasicBlockKind`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.CaptureId`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.CaptureId.Equals(Microsoft.CodeAnalysis.FlowAnalysis.CaptureId other) -> bool`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowBranch`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowBranch.Destination.get -> Microsoft.CodeAnalysis.FlowAnalysis.BasicBlock`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowBranch.EnteringRegions.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegion>`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowBranch.FinallyRegions.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegion>`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowBranch.IsConditionalSuccessor.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowBranch.LeavingRegions.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegion>`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowBranch.Semantics.get -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowBranchSemantics`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowBranch.Source.get -> Microsoft.CodeAnalysis.FlowAnalysis.BasicBlock`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowBranchSemantics`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowBranchSemantics.Error = 7 -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowBranchSemantics`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowBranchSemantics.None = 0 -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowBranchSemantics`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowBranchSemantics.ProgramTermination = 4 -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowBranchSemantics`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowBranchSemantics.Regular = 1 -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowBranchSemantics`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowBranchSemantics.Rethrow = 6 -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowBranchSemantics`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowBranchSemantics.Return = 2 -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowBranchSemantics`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowBranchSemantics.StructuredExceptionHandling = 3 -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowBranchSemantics`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowBranchSemantics.Throw = 5 -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowBranchSemantics`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowConditionKind`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowConditionKind.None = 0 -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowConditionKind`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowConditionKind.WhenFalse = 1 -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowConditionKind`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowConditionKind.WhenTrue = 2 -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowConditionKind`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph.Blocks.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.FlowAnalysis.BasicBlock>`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph.GetAnonymousFunctionControlFlowGraph(Microsoft.CodeAnalysis.FlowAnalysis.IFlowAnonymousFunctionOperation anonymousFunction, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph.GetLocalFunctionControlFlowGraph(Microsoft.CodeAnalysis.IMethodSymbol localFunction, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph.LocalFunctions.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.IMethodSymbol>`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph.OriginalOperation.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph.Parent.get -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph.Root.get -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegion`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraphExtensions`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegion`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegion.CaptureIds.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.FlowAnalysis.CaptureId>`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegion.EnclosingRegion.get -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegion`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegion.ExceptionType.get -> Microsoft.CodeAnalysis.ITypeSymbol`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegion.FirstBlockOrdinal.get -> int`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegion.Kind.get -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegionKind`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegion.LastBlockOrdinal.get -> int`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegion.LocalFunctions.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.IMethodSymbol>`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegion.Locals.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ILocalSymbol>`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegion.NestedRegions.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegion>`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegionKind`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegionKind.Catch = 4 -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegionKind`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegionKind.ErroneousBody = 10 -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegionKind`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegionKind.Filter = 3 -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegionKind`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegionKind.FilterAndHandler = 5 -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegionKind`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegionKind.Finally = 7 -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegionKind`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegionKind.LocalLifetime = 1 -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegionKind`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegionKind.Root = 0 -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegionKind`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegionKind.StaticLocalInitializer = 9 -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegionKind`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegionKind.Try = 2 -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegionKind`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegionKind.TryAndCatch = 6 -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegionKind`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegionKind.TryAndFinally = 8 -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowRegionKind`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.ICaughtExceptionOperation`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.IFlowAnonymousFunctionOperation`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.IFlowAnonymousFunctionOperation.Symbol.get -> Microsoft.CodeAnalysis.IMethodSymbol`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.IFlowCaptureOperation`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.IFlowCaptureOperation.Id.get -> Microsoft.CodeAnalysis.FlowAnalysis.CaptureId`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.IFlowCaptureOperation.Value.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.IFlowCaptureReferenceOperation`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.IFlowCaptureReferenceOperation.Id.get -> Microsoft.CodeAnalysis.FlowAnalysis.CaptureId`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.IIsNullOperation`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.IIsNullOperation.Operand.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.IStaticLocalInitializationSemaphoreOperation`\n* [ ] `Microsoft.CodeAnalysis.FlowAnalysis.IStaticLocalInitializationSemaphoreOperation.Local.get -> Microsoft.CodeAnalysis.ILocalSymbol`\n* [ ] `Microsoft.CodeAnalysis.IFieldSymbol.IsFixedSizeBuffer.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.ILocalSymbol.IsFixed.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.IMethodSymbol.IsReadOnly.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.IOperation.SemanticModel.get -> Microsoft.CodeAnalysis.SemanticModel`\n* [ ] `Microsoft.CodeAnalysis.ITypeSymbol.IsReadOnly.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.ITypeSymbol.IsRefLikeType.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.ITypeSymbol.IsUnmanagedType.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.Binary = 32 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.CaughtException = 94 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.CoalesceAssignment = 97 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.ConstructorBody = 89 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.DiscardPattern = 104 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.FlowAnonymousFunction = 96 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.FlowCapture = 91 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.FlowCaptureReference = 92 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.IsNull = 93 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.MethodBody = 88 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.Range = 99 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.RecursivePattern = 103 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.ReDim = 101 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.ReDimClause = 102 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.StaticLocalInitializationSemaphore = 95 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.SwitchExpression = 105 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.SwitchExpressionArm = 106 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.TupleBinary = 87 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.OperationKind.Unary = 31 -> Microsoft.CodeAnalysis.OperationKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.CommonConversion.IsImplicit.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.Operations.ICaseClauseOperation.Label.get -> Microsoft.CodeAnalysis.ILabelSymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.ICoalesceAssignmentOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ICoalesceOperation.ValueConversion.get -> Microsoft.CodeAnalysis.Operations.CommonConversion`\n* [ ] `Microsoft.CodeAnalysis.Operations.IDeclarationPatternOperation.MatchedType.get -> Microsoft.CodeAnalysis.ITypeSymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.IDeclarationPatternOperation.MatchesNull.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.Operations.IDiscardPatternOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IEventAssignmentOperation.EventReference.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IForLoopOperation.ConditionLocals.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ILocalSymbol>`\n* [ ] `Microsoft.CodeAnalysis.Operations.IForToLoopOperation.IsChecked.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.Operations.IInstanceReferenceOperation.ReferenceKind.get -> Microsoft.CodeAnalysis.Operations.InstanceReferenceKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.ILoopOperation.ContinueLabel.get -> Microsoft.CodeAnalysis.ILabelSymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.ILoopOperation.ExitLabel.get -> Microsoft.CodeAnalysis.ILabelSymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.InstanceReferenceKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.InstanceReferenceKind.ContainingTypeInstance = 0 -> Microsoft.CodeAnalysis.Operations.InstanceReferenceKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.InstanceReferenceKind.ImplicitReceiver = 1 -> Microsoft.CodeAnalysis.Operations.InstanceReferenceKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.InstanceReferenceKind.PatternInput = 2 -> Microsoft.CodeAnalysis.Operations.InstanceReferenceKind`\n* [ ] `Microsoft.CodeAnalysis.Operations.IPatternOperation.InputType.get -> Microsoft.CodeAnalysis.ITypeSymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.IRangeOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IRangeOperation.IsLifted.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.Operations.IRangeOperation.LeftOperand.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IRangeOperation.Method.get -> Microsoft.CodeAnalysis.IMethodSymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.IRangeOperation.RightOperand.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IReDimClauseOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IReDimClauseOperation.DimensionSizes.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.IOperation>`\n* [ ] `Microsoft.CodeAnalysis.Operations.IReDimClauseOperation.Operand.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IReDimOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.IReDimOperation.Clauses.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Operations.IReDimClauseOperation>`\n* [ ] `Microsoft.CodeAnalysis.Operations.IReDimOperation.Preserve.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.Operations.ISwitchCaseOperation.Locals.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ILocalSymbol>`\n* [ ] `Microsoft.CodeAnalysis.Operations.ISwitchExpressionArmOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ISwitchExpressionArmOperation.Guard.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ISwitchExpressionArmOperation.Locals.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ILocalSymbol>`\n* [ ] `Microsoft.CodeAnalysis.Operations.ISwitchExpressionArmOperation.Pattern.get -> Microsoft.CodeAnalysis.Operations.IPatternOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ISwitchExpressionArmOperation.Value.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ISwitchExpressionOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ISwitchExpressionOperation.Arms.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Operations.ISwitchExpressionArmOperation>`\n* [ ] `Microsoft.CodeAnalysis.Operations.ISwitchExpressionOperation.Value.get -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `Microsoft.CodeAnalysis.Operations.ISwitchOperation.ExitLabel.get -> Microsoft.CodeAnalysis.ILabelSymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.ISwitchOperation.Locals.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ILocalSymbol>`\n* [ ] `Microsoft.CodeAnalysis.Operations.ITryOperation.ExitLabel.get -> Microsoft.CodeAnalysis.ILabelSymbol`\n* [ ] `Microsoft.CodeAnalysis.Operations.IUsingOperation.Locals.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ILocalSymbol>`\n* [ ] `Microsoft.CodeAnalysis.Operations.IVariableDeclarationOperation.IgnoredDimensions.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.IOperation>`\n* [ ] `Microsoft.CodeAnalysis.Operations.UnaryOperatorKind.Hat = 7 -> Microsoft.CodeAnalysis.Operations.UnaryOperatorKind`\n* [ ] `Microsoft.CodeAnalysis.SpecialType.Count = 44 -> Microsoft.CodeAnalysis.SpecialType`\n* [ ] `Microsoft.CodeAnalysis.SpecialType.System_Runtime_CompilerServices_RuntimeFeature = 44 -> Microsoft.CodeAnalysis.SpecialType`\n* [ ] `Microsoft.CodeAnalysis.SymbolDisplayMiscellaneousOptions.AllowDefaultLiteral = 128 -> Microsoft.CodeAnalysis.SymbolDisplayMiscellaneousOptions`\n* [ ] `Microsoft.CodeAnalysis.SymbolDisplayMiscellaneousOptions.IncludeNullableReferenceTypeModifier = 64 -> Microsoft.CodeAnalysis.SymbolDisplayMiscellaneousOptions`\n* [ ] `Microsoft.CodeAnalysis.SymbolDisplayPartKind.ConstantName = 30 -> Microsoft.CodeAnalysis.SymbolDisplayPartKind`\n* [ ] `Microsoft.CodeAnalysis.SymbolDisplayPartKind.EnumMemberName = 28 -> Microsoft.CodeAnalysis.SymbolDisplayPartKind`\n* [ ] `Microsoft.CodeAnalysis.SymbolDisplayPartKind.ExtensionMethodName = 29 -> Microsoft.CodeAnalysis.SymbolDisplayPartKind`\n* [ ] `const Microsoft.CodeAnalysis.WellKnownMemberNames.SliceMethodName = \"Slice\" -> string`\n* [ ] `override Microsoft.CodeAnalysis.FlowAnalysis.CaptureId.Equals(object obj) -> bool`\n* [ ] `override Microsoft.CodeAnalysis.FlowAnalysis.CaptureId.GetHashCode() -> int`\n* [ ] `override Microsoft.CodeAnalysis.SuppressionDescriptor.Equals(object obj) -> bool`\n* [ ] `override Microsoft.CodeAnalysis.SuppressionDescriptor.GetHashCode() -> int`\n* [ ] `override sealed Microsoft.CodeAnalysis.Diagnostics.DiagnosticSuppressor.Initialize(Microsoft.CodeAnalysis.Diagnostics.AnalysisContext context) -> void`\n* [ ] `override sealed Microsoft.CodeAnalysis.Diagnostics.DiagnosticSuppressor.SupportedDiagnostics.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.DiagnosticDescriptor>`\n* [ ] `static Microsoft.CodeAnalysis.AnalyzerConfig.Parse(Microsoft.CodeAnalysis.Text.SourceText text, string pathToFile) -> Microsoft.CodeAnalysis.AnalyzerConfig`\n* [ ] `static Microsoft.CodeAnalysis.AnalyzerConfig.Parse(string text, string pathToFile) -> Microsoft.CodeAnalysis.AnalyzerConfig`\n* [ ] `static Microsoft.CodeAnalysis.AnalyzerConfig.ReservedKeys.get -> System.Collections.Immutable.ImmutableHashSet<string>`\n* [ ] `static Microsoft.CodeAnalysis.AnalyzerConfig.ReservedValues.get -> System.Collections.Immutable.ImmutableHashSet<string>`\n* [ ] `static Microsoft.CodeAnalysis.AnalyzerConfig.Section.NameComparer.get -> System.StringComparison`\n* [ ] `static Microsoft.CodeAnalysis.AnalyzerConfig.Section.PropertiesKeyComparer.get -> System.StringComparer`\n* [ ] `static Microsoft.CodeAnalysis.AnalyzerConfig.TryCreateSectionNameMatcher(string sectionName) -> Microsoft.CodeAnalysis.AnalyzerConfig.SectionNameMatcher?`\n* [ ] `static Microsoft.CodeAnalysis.AnalyzerConfigSet.Create<TList>(TList analyzerConfigs) -> Microsoft.CodeAnalysis.AnalyzerConfigSet`\n* [ ] `static Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions.KeyComparer.get -> System.StringComparer`\n* [ ] `override Microsoft.CodeAnalysis.NullabilityInfo.Equals(object other) -> bool`\n* [ ] `override Microsoft.CodeAnalysis.NullabilityInfo.GetHashCode() -> int`\n* [ ] `static Microsoft.CodeAnalysis.Diagnostics.Suppression.Create(Microsoft.CodeAnalysis.SuppressionDescriptor descriptor, Microsoft.CodeAnalysis.Diagnostic suppressedDiagnostic) -> Microsoft.CodeAnalysis.Diagnostics.Suppression`\n* [ ] `static Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph.Create(Microsoft.CodeAnalysis.Operations.IBlockOperation body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph`\n* [ ] `static Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph.Create(Microsoft.CodeAnalysis.Operations.IConstructorBodyOperation constructorBody, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph`\n* [ ] `static Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph.Create(Microsoft.CodeAnalysis.Operations.IFieldInitializerOperation initializer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph`\n* [ ] `static Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph.Create(Microsoft.CodeAnalysis.Operations.IMethodBodyOperation methodBody, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph`\n* [ ] `static Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph.Create(Microsoft.CodeAnalysis.Operations.IParameterInitializerOperation initializer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph`\n* [ ] `static Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph.Create(Microsoft.CodeAnalysis.Operations.IPropertyInitializerOperation initializer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph`\n* [ ] `static Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph.Create(Microsoft.CodeAnalysis.SyntaxNode node, Microsoft.CodeAnalysis.SemanticModel semanticModel, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph`\n* [ ] `static Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraphExtensions.GetAnonymousFunctionControlFlowGraphInScope(this Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph controlFlowGraph, Microsoft.CodeAnalysis.FlowAnalysis.IFlowAnonymousFunctionOperation anonymousFunction, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph`\n* [ ] `static Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraphExtensions.GetLocalFunctionControlFlowGraphInScope(this Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph controlFlowGraph, Microsoft.CodeAnalysis.IMethodSymbol localFunction, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph`\n* [ ] `static Microsoft.CodeAnalysis.NullableContextExtensions.AnnotationsEnabled(this Microsoft.CodeAnalysis.NullableContext context) -> bool`\n* [ ] `static Microsoft.CodeAnalysis.NullableContextExtensions.AnnotationsInherited(this Microsoft.CodeAnalysis.NullableContext context) -> bool`\n* [ ] `static Microsoft.CodeAnalysis.NullableContextExtensions.WarningsEnabled(this Microsoft.CodeAnalysis.NullableContext context) -> bool`\n* [ ] `static Microsoft.CodeAnalysis.NullableContextExtensions.WarningsInherited(this Microsoft.CodeAnalysis.NullableContext context) -> bool`\n* [ ] `static Microsoft.CodeAnalysis.NullableContextOptionsExtensions.AnnotationsEnabled(this Microsoft.CodeAnalysis.NullableContextOptions context) -> bool`\n* [ ] `static Microsoft.CodeAnalysis.NullableContextOptionsExtensions.WarningsEnabled(this Microsoft.CodeAnalysis.NullableContextOptions context) -> bool`\n* [ ] `static Microsoft.CodeAnalysis.Operations.OperationExtensions.GetCorrespondingOperation(this Microsoft.CodeAnalysis.Operations.IBranchOperation operation) -> Microsoft.CodeAnalysis.IOperation`\n* [ ] `static readonly Microsoft.CodeAnalysis.SymbolEqualityComparer.Default -> Microsoft.CodeAnalysis.SymbolEqualityComparer`\n* [ ] `static readonly Microsoft.CodeAnalysis.SymbolEqualityComparer.IncludeNullability -> Microsoft.CodeAnalysis.SymbolEqualityComparer`\n* [ ] `static readonly Microsoft.CodeAnalysis.SyntaxTree.EmptyDiagnosticOptions -> System.Collections.Immutable.ImmutableDictionary<string, Microsoft.CodeAnalysis.ReportDiagnostic>`\n* [ ] `virtual Microsoft.CodeAnalysis.Diagnostics.AnalysisContext.RegisterSymbolStartAction(System.Action<Microsoft.CodeAnalysis.Diagnostics.SymbolStartAnalysisContext> action, Microsoft.CodeAnalysis.SymbolKind symbolKind) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Diagnostics.CompilationStartAnalysisContext.RegisterSymbolStartAction(System.Action<Microsoft.CodeAnalysis.Diagnostics.SymbolStartAnalysisContext> action, Microsoft.CodeAnalysis.SymbolKind symbolKind) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitCaughtException(Microsoft.CodeAnalysis.FlowAnalysis.ICaughtExceptionOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitCoalesceAssignment(Microsoft.CodeAnalysis.Operations.ICoalesceAssignmentOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitDiscardPattern(Microsoft.CodeAnalysis.Operations.IDiscardPatternOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitFlowAnonymousFunction(Microsoft.CodeAnalysis.FlowAnalysis.IFlowAnonymousFunctionOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitFlowCapture(Microsoft.CodeAnalysis.FlowAnalysis.IFlowCaptureOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitFlowCaptureReference(Microsoft.CodeAnalysis.FlowAnalysis.IFlowCaptureReferenceOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitIsNull(Microsoft.CodeAnalysis.FlowAnalysis.IIsNullOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitRangeOperation(Microsoft.CodeAnalysis.Operations.IRangeOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitReDim(Microsoft.CodeAnalysis.Operations.IReDimOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitReDimClause(Microsoft.CodeAnalysis.Operations.IReDimClauseOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitStaticLocalInitializationSemaphore(Microsoft.CodeAnalysis.FlowAnalysis.IStaticLocalInitializationSemaphoreOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitSwitchExpression(Microsoft.CodeAnalysis.Operations.ISwitchExpressionOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitSwitchExpressionArm(Microsoft.CodeAnalysis.Operations.ISwitchExpressionArmOperation operation) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitCaughtException(Microsoft.CodeAnalysis.FlowAnalysis.ICaughtExceptionOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitCoalesceAssignment(Microsoft.CodeAnalysis.Operations.ICoalesceAssignmentOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitDiscardPattern(Microsoft.CodeAnalysis.Operations.IDiscardPatternOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitFlowAnonymousFunction(Microsoft.CodeAnalysis.FlowAnalysis.IFlowAnonymousFunctionOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitFlowCapture(Microsoft.CodeAnalysis.FlowAnalysis.IFlowCaptureOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitFlowCaptureReference(Microsoft.CodeAnalysis.FlowAnalysis.IFlowCaptureReferenceOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitIsNull(Microsoft.CodeAnalysis.FlowAnalysis.IIsNullOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitRangeOperation(Microsoft.CodeAnalysis.Operations.IRangeOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitReDim(Microsoft.CodeAnalysis.Operations.IReDimOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitReDimClause(Microsoft.CodeAnalysis.Operations.IReDimClauseOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitStaticLocalInitializationSemaphore(Microsoft.CodeAnalysis.FlowAnalysis.IStaticLocalInitializationSemaphoreOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitSwitchExpression(Microsoft.CodeAnalysis.Operations.ISwitchExpressionOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.Operations.OperationVisitor<TArgument, TResult>.VisitSwitchExpressionArm(Microsoft.CodeAnalysis.Operations.ISwitchExpressionArmOperation operation, TArgument argument) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.SyntaxTree.DiagnosticOptions.get -> System.Collections.Immutable.ImmutableDictionary<string, Microsoft.CodeAnalysis.ReportDiagnostic>`\n* [ ] `virtual Microsoft.CodeAnalysis.SyntaxTree.WithDiagnosticOptions(System.Collections.Immutable.ImmutableDictionary<string, Microsoft.CodeAnalysis.ReportDiagnostic> options) -> Microsoft.CodeAnalysis.SyntaxTree`\n\nSee [Microsoft.CodeAnalysis.CSharp release/dev16.3@c955f3c99b5698c906e0700ef691b5b1571c8136](https://raw.githubusercontent.com/dotnet/roslyn/c955f3c99b5698c906e0700ef691b5b1571c8136/src/Compilers/CSharp/Portable/PublicAPI.Unshipped.txt)\n\n* [ ] `*REMOVED*static Microsoft.CodeAnalysis.CSharp.CSharpSyntaxTree.Create(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode root, Microsoft.CodeAnalysis.CSharp.CSharpParseOptions options = null, string path = \"\", System.Text.Encoding encoding = null) -> Microsoft.CodeAnalysis.SyntaxTree`\n* [ ] `*REMOVED*static Microsoft.CodeAnalysis.CSharp.CSharpSyntaxTree.ParseText(Microsoft.CodeAnalysis.Text.SourceText text, Microsoft.CodeAnalysis.CSharp.CSharpParseOptions options = null, string path = \"\", System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.SyntaxTree`\n* [ ] `*REMOVED*static Microsoft.CodeAnalysis.CSharp.CSharpSyntaxTree.ParseText(string text, Microsoft.CodeAnalysis.CSharp.CSharpParseOptions options = null, string path = \"\", System.Text.Encoding encoding = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.SyntaxTree`\n* [ ] `*REMOVED*static Microsoft.CodeAnalysis.CSharp.LanguageVersionFacts.TryParse(this string version, out Microsoft.CodeAnalysis.CSharp.LanguageVersion result) -> bool`\n* [ ] `*REMOVED*static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.ParseSyntaxTree(Microsoft.CodeAnalysis.Text.SourceText text, Microsoft.CodeAnalysis.ParseOptions options = null, string path = \"\", System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.SyntaxTree`\n* [ ] `*REMOVED*static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.ParseSyntaxTree(string text, Microsoft.CodeAnalysis.ParseOptions options = null, string path = \"\", System.Text.Encoding encoding = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.SyntaxTree`\n* [ ] `*REMOVED*abstract Microsoft.CodeAnalysis.CSharp.Syntax.BaseFieldDeclarationSyntax.AttributeLists.get -> Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax>`\n* [ ] `*REMOVED*abstract Microsoft.CodeAnalysis.CSharp.Syntax.BaseFieldDeclarationSyntax.Modifiers.get -> Microsoft.CodeAnalysis.SyntaxTokenList`\n* [ ] `*REMOVED*abstract Microsoft.CodeAnalysis.CSharp.Syntax.BaseMethodDeclarationSyntax.AttributeLists.get -> Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax>`\n* [ ] `*REMOVED*abstract Microsoft.CodeAnalysis.CSharp.Syntax.BaseMethodDeclarationSyntax.Modifiers.get -> Microsoft.CodeAnalysis.SyntaxTokenList`\n* [ ] `*REMOVED*abstract Microsoft.CodeAnalysis.CSharp.Syntax.BasePropertyDeclarationSyntax.AttributeLists.get -> Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax>`\n* [ ] `*REMOVED*abstract Microsoft.CodeAnalysis.CSharp.Syntax.BasePropertyDeclarationSyntax.Modifiers.get -> Microsoft.CodeAnalysis.SyntaxTokenList`\n* [ ] `*REMOVED*abstract Microsoft.CodeAnalysis.CSharp.Syntax.BaseTypeDeclarationSyntax.AttributeLists.get -> Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax>`\n* [ ] `*REMOVED*abstract Microsoft.CodeAnalysis.CSharp.Syntax.BaseTypeDeclarationSyntax.Modifiers.get -> Microsoft.CodeAnalysis.SyntaxTokenList`\n* [ ] `*REMOVED*Microsoft.CodeAnalysis.CSharp.Syntax.DelegateDeclarationSyntax.AttributeLists.get -> Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax>`\n* [ ] `*REMOVED*Microsoft.CodeAnalysis.CSharp.Syntax.DelegateDeclarationSyntax.Modifiers.get -> Microsoft.CodeAnalysis.SyntaxTokenList`\n* [ ] `*REMOVED*Microsoft.CodeAnalysis.CSharp.Syntax.EnumMemberDeclarationSyntax.AttributeLists.get -> Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax>`\n* [ ] `*REMOVED*Microsoft.CodeAnalysis.CSharp.Syntax.IncompleteMemberSyntax.AttributeLists.get -> Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax>`\n* [ ] `*REMOVED*Microsoft.CodeAnalysis.CSharp.Syntax.IncompleteMemberSyntax.Modifiers.get -> Microsoft.CodeAnalysis.SyntaxTokenList`\n* [ ] `Microsoft.CodeAnalysis.CSharp.CSharpCompilationOptions.CSharpCompilationOptions(Microsoft.CodeAnalysis.OutputKind outputKind, bool reportSuppressedDiagnostics = false, string moduleName = null, string mainTypeName = null, string scriptClassName = null, System.Collections.Generic.IEnumerable<string> usings = null, Microsoft.CodeAnalysis.OptimizationLevel optimizationLevel = Microsoft.CodeAnalysis.OptimizationLevel.Debug, bool checkOverflow = false, bool allowUnsafe = false, string cryptoKeyContainer = null, string cryptoKeyFile = null, System.Collections.Immutable.ImmutableArray<byte> cryptoPublicKey = default(System.Collections.Immutable.ImmutableArray<byte>), bool? delaySign = null, Microsoft.CodeAnalysis.Platform platform = Microsoft.CodeAnalysis.Platform.AnyCpu, Microsoft.CodeAnalysis.ReportDiagnostic generalDiagnosticOption = Microsoft.CodeAnalysis.ReportDiagnostic.Default, int warningLevel = 4, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, Microsoft.CodeAnalysis.ReportDiagnostic>> specificDiagnosticOptions = null, bool concurrentBuild = true, bool deterministic = false, Microsoft.CodeAnalysis.XmlReferenceResolver xmlReferenceResolver = null, Microsoft.CodeAnalysis.SourceReferenceResolver sourceReferenceResolver = null, Microsoft.CodeAnalysis.MetadataReferenceResolver metadataReferenceResolver = null, Microsoft.CodeAnalysis.AssemblyIdentityComparer assemblyIdentityComparer = null, Microsoft.CodeAnalysis.StrongNameProvider strongNameProvider = null, bool publicSign = false, Microsoft.CodeAnalysis.MetadataImportOptions metadataImportOptions = Microsoft.CodeAnalysis.MetadataImportOptions.Public, Microsoft.CodeAnalysis.NullableContextOptions nullableContextOptions = Microsoft.CodeAnalysis.NullableContextOptions.Disable) -> void`\n* [ ] `Microsoft.CodeAnalysis.CSharp.CSharpCompilationOptions.WithNullableContextOptions(Microsoft.CodeAnalysis.NullableContextOptions options) -> Microsoft.CodeAnalysis.CSharp.CSharpCompilationOptions`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.EventDeclarationSyntax.SemicolonToken.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.EventDeclarationSyntax.Update(Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> attributeLists, Microsoft.CodeAnalysis.SyntaxTokenList modifiers, Microsoft.CodeAnalysis.SyntaxToken eventKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type, Microsoft.CodeAnalysis.CSharp.Syntax.ExplicitInterfaceSpecifierSyntax explicitInterfaceSpecifier, Microsoft.CodeAnalysis.SyntaxToken identifier, Microsoft.CodeAnalysis.CSharp.Syntax.AccessorListSyntax accessorList, Microsoft.CodeAnalysis.SyntaxToken semicolonToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.EventDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.EventDeclarationSyntax.Update(Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> attributeLists, Microsoft.CodeAnalysis.SyntaxTokenList modifiers, Microsoft.CodeAnalysis.SyntaxToken eventKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type, Microsoft.CodeAnalysis.CSharp.Syntax.ExplicitInterfaceSpecifierSyntax explicitInterfaceSpecifier, Microsoft.CodeAnalysis.SyntaxToken identifier, Microsoft.CodeAnalysis.SyntaxToken semicolonToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.EventDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.EventDeclarationSyntax.WithSemicolonToken(Microsoft.CodeAnalysis.SyntaxToken semicolonToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.EventDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.NullableDirectiveTriviaSyntax.TargetToken.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.NullableDirectiveTriviaSyntax.Update(Microsoft.CodeAnalysis.SyntaxToken hashToken, Microsoft.CodeAnalysis.SyntaxToken nullableKeyword, Microsoft.CodeAnalysis.SyntaxToken settingToken, Microsoft.CodeAnalysis.SyntaxToken targetToken, Microsoft.CodeAnalysis.SyntaxToken endOfDirectiveToken, bool isActive) -> Microsoft.CodeAnalysis.CSharp.Syntax.NullableDirectiveTriviaSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.NullableDirectiveTriviaSyntax.WithTargetToken(Microsoft.CodeAnalysis.SyntaxToken targetToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.NullableDirectiveTriviaSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax.IsNotNull.get -> bool`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.AnnotationsKeyword = 8489 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.WarningsKeyword = 8488 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `abstract Microsoft.CodeAnalysis.CSharp.Syntax.CommonForEachStatementSyntax.AwaitKeyword.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Conversion.IsSwitchExpression.get -> bool`\n* [ ] `Microsoft.CodeAnalysis.CSharp.CSharpCompilationOptions.CSharpCompilationOptions(Microsoft.CodeAnalysis.OutputKind outputKind, bool reportSuppressedDiagnostics, string moduleName, string mainTypeName, string scriptClassName, System.Collections.Generic.IEnumerable<string> usings, Microsoft.CodeAnalysis.OptimizationLevel optimizationLevel, bool checkOverflow, bool allowUnsafe, string cryptoKeyContainer, string cryptoKeyFile, System.Collections.Immutable.ImmutableArray<byte> cryptoPublicKey, bool? delaySign, Microsoft.CodeAnalysis.Platform platform, Microsoft.CodeAnalysis.ReportDiagnostic generalDiagnosticOption, int warningLevel, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, Microsoft.CodeAnalysis.ReportDiagnostic>> specificDiagnosticOptions, bool concurrentBuild, bool deterministic, Microsoft.CodeAnalysis.XmlReferenceResolver xmlReferenceResolver, Microsoft.CodeAnalysis.SourceReferenceResolver sourceReferenceResolver, Microsoft.CodeAnalysis.MetadataReferenceResolver metadataReferenceResolver, Microsoft.CodeAnalysis.AssemblyIdentityComparer assemblyIdentityComparer, Microsoft.CodeAnalysis.StrongNameProvider strongNameProvider, bool publicSign, Microsoft.CodeAnalysis.MetadataImportOptions metadataImportOptions) -> void`\n* [x] `Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp8 = 800 -> Microsoft.CodeAnalysis.CSharp.LanguageVersion`\n* [x] `Microsoft.CodeAnalysis.CSharp.LanguageVersion.LatestMajor = 2147483645 -> Microsoft.CodeAnalysis.CSharp.LanguageVersion`\n* [x] `Microsoft.CodeAnalysis.CSharp.LanguageVersion.Preview = 2147483646 -> Microsoft.CodeAnalysis.CSharp.LanguageVersion`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.AnonymousFunctionExpressionSyntax.WithAsyncKeyword(Microsoft.CodeAnalysis.SyntaxToken asyncKeyword) -> Microsoft.CodeAnalysis.CSharp.Syntax.AnonymousFunctionExpressionSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.AnonymousFunctionExpressionSyntax.WithBody(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode body) -> Microsoft.CodeAnalysis.CSharp.Syntax.AnonymousFunctionExpressionSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BaseArgumentListSyntax.AddArguments(params Microsoft.CodeAnalysis.CSharp.Syntax.ArgumentSyntax[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseArgumentListSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BaseArgumentListSyntax.WithArguments(Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.ArgumentSyntax> arguments) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseArgumentListSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BaseCrefParameterListSyntax.AddParameters(params Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterSyntax[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseCrefParameterListSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BaseCrefParameterListSyntax.WithParameters(Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterSyntax> parameters) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseCrefParameterListSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BaseFieldDeclarationSyntax.AddAttributeLists(params Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseFieldDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BaseFieldDeclarationSyntax.AddDeclarationVariables(params Microsoft.CodeAnalysis.CSharp.Syntax.VariableDeclaratorSyntax[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseFieldDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BaseFieldDeclarationSyntax.AddModifiers(params Microsoft.CodeAnalysis.SyntaxToken[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseFieldDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BaseFieldDeclarationSyntax.WithAttributeLists(Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> attributeLists) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseFieldDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BaseFieldDeclarationSyntax.WithDeclaration(Microsoft.CodeAnalysis.CSharp.Syntax.VariableDeclarationSyntax declaration) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseFieldDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BaseFieldDeclarationSyntax.WithModifiers(Microsoft.CodeAnalysis.SyntaxTokenList modifiers) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseFieldDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BaseFieldDeclarationSyntax.WithSemicolonToken(Microsoft.CodeAnalysis.SyntaxToken semicolonToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseFieldDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BaseMethodDeclarationSyntax.AddAttributeLists(params Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseMethodDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BaseMethodDeclarationSyntax.AddBodyStatements(params Microsoft.CodeAnalysis.CSharp.Syntax.StatementSyntax[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseMethodDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BaseMethodDeclarationSyntax.AddModifiers(params Microsoft.CodeAnalysis.SyntaxToken[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseMethodDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BaseMethodDeclarationSyntax.AddParameterListParameters(params Microsoft.CodeAnalysis.CSharp.Syntax.ParameterSyntax[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseMethodDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BaseMethodDeclarationSyntax.WithAttributeLists(Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> attributeLists) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseMethodDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BaseMethodDeclarationSyntax.WithBody(Microsoft.CodeAnalysis.CSharp.Syntax.BlockSyntax body) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseMethodDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BaseMethodDeclarationSyntax.WithExpressionBody(Microsoft.CodeAnalysis.CSharp.Syntax.ArrowExpressionClauseSyntax expressionBody) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseMethodDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BaseMethodDeclarationSyntax.WithModifiers(Microsoft.CodeAnalysis.SyntaxTokenList modifiers) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseMethodDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BaseMethodDeclarationSyntax.WithParameterList(Microsoft.CodeAnalysis.CSharp.Syntax.ParameterListSyntax parameterList) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseMethodDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BaseMethodDeclarationSyntax.WithSemicolonToken(Microsoft.CodeAnalysis.SyntaxToken semicolonToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseMethodDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BaseParameterListSyntax.AddParameters(params Microsoft.CodeAnalysis.CSharp.Syntax.ParameterSyntax[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseParameterListSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BaseParameterListSyntax.WithParameters(Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.ParameterSyntax> parameters) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseParameterListSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BasePropertyDeclarationSyntax.AddAccessorListAccessors(params Microsoft.CodeAnalysis.CSharp.Syntax.AccessorDeclarationSyntax[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.BasePropertyDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BasePropertyDeclarationSyntax.AddAttributeLists(params Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.BasePropertyDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BasePropertyDeclarationSyntax.AddModifiers(params Microsoft.CodeAnalysis.SyntaxToken[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.BasePropertyDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BasePropertyDeclarationSyntax.WithAccessorList(Microsoft.CodeAnalysis.CSharp.Syntax.AccessorListSyntax accessorList) -> Microsoft.CodeAnalysis.CSharp.Syntax.BasePropertyDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BasePropertyDeclarationSyntax.WithAttributeLists(Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> attributeLists) -> Microsoft.CodeAnalysis.CSharp.Syntax.BasePropertyDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BasePropertyDeclarationSyntax.WithExplicitInterfaceSpecifier(Microsoft.CodeAnalysis.CSharp.Syntax.ExplicitInterfaceSpecifierSyntax explicitInterfaceSpecifier) -> Microsoft.CodeAnalysis.CSharp.Syntax.BasePropertyDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BasePropertyDeclarationSyntax.WithModifiers(Microsoft.CodeAnalysis.SyntaxTokenList modifiers) -> Microsoft.CodeAnalysis.CSharp.Syntax.BasePropertyDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BasePropertyDeclarationSyntax.WithType(Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type) -> Microsoft.CodeAnalysis.CSharp.Syntax.BasePropertyDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BaseTypeDeclarationSyntax.AddAttributeLists(params Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseTypeDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BaseTypeDeclarationSyntax.AddBaseListTypes(params Microsoft.CodeAnalysis.CSharp.Syntax.BaseTypeSyntax[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseTypeDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BaseTypeDeclarationSyntax.AddModifiers(params Microsoft.CodeAnalysis.SyntaxToken[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseTypeDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BaseTypeDeclarationSyntax.WithAttributeLists(Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> attributeLists) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseTypeDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BaseTypeDeclarationSyntax.WithBaseList(Microsoft.CodeAnalysis.CSharp.Syntax.BaseListSyntax baseList) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseTypeDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BaseTypeDeclarationSyntax.WithCloseBraceToken(Microsoft.CodeAnalysis.SyntaxToken closeBraceToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseTypeDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BaseTypeDeclarationSyntax.WithIdentifier(Microsoft.CodeAnalysis.SyntaxToken identifier) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseTypeDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BaseTypeDeclarationSyntax.WithModifiers(Microsoft.CodeAnalysis.SyntaxTokenList modifiers) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseTypeDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BaseTypeDeclarationSyntax.WithOpenBraceToken(Microsoft.CodeAnalysis.SyntaxToken openBraceToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseTypeDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BaseTypeDeclarationSyntax.WithSemicolonToken(Microsoft.CodeAnalysis.SyntaxToken semicolonToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseTypeDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BaseTypeSyntax.WithType(Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseTypeSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BranchingDirectiveTriviaSyntax.WithEndOfDirectiveToken(Microsoft.CodeAnalysis.SyntaxToken endOfDirectiveToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.BranchingDirectiveTriviaSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.BranchingDirectiveTriviaSyntax.WithHashToken(Microsoft.CodeAnalysis.SyntaxToken hashToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.BranchingDirectiveTriviaSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ClassOrStructConstraintSyntax.QuestionToken.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] ~~`Microsoft.CodeAnalysis.CSharp.Syntax.ClassOrStructConstraintSyntax.Update(Microsoft.CodeAnalysis.SyntaxToken classOrStructKeyword, Microsoft.CodeAnalysis.SyntaxToken questionToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.ClassOrStructConstraintSyntax`~~\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ClassOrStructConstraintSyntax.WithQuestionToken(Microsoft.CodeAnalysis.SyntaxToken questionToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.ClassOrStructConstraintSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.CommonForEachStatementSyntax.WithAwaitKeyword(Microsoft.CodeAnalysis.SyntaxToken awaitKeyword) -> Microsoft.CodeAnalysis.CSharp.Syntax.CommonForEachStatementSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.CommonForEachStatementSyntax.WithCloseParenToken(Microsoft.CodeAnalysis.SyntaxToken closeParenToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.CommonForEachStatementSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.CommonForEachStatementSyntax.WithExpression(Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax expression) -> Microsoft.CodeAnalysis.CSharp.Syntax.CommonForEachStatementSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.CommonForEachStatementSyntax.WithForEachKeyword(Microsoft.CodeAnalysis.SyntaxToken forEachKeyword) -> Microsoft.CodeAnalysis.CSharp.Syntax.CommonForEachStatementSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.CommonForEachStatementSyntax.WithInKeyword(Microsoft.CodeAnalysis.SyntaxToken inKeyword) -> Microsoft.CodeAnalysis.CSharp.Syntax.CommonForEachStatementSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.CommonForEachStatementSyntax.WithOpenParenToken(Microsoft.CodeAnalysis.SyntaxToken openParenToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.CommonForEachStatementSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.CommonForEachStatementSyntax.WithStatement(Microsoft.CodeAnalysis.CSharp.Syntax.StatementSyntax statement) -> Microsoft.CodeAnalysis.CSharp.Syntax.CommonForEachStatementSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.ConditionalDirectiveTriviaSyntax.WithCondition(Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax condition) -> Microsoft.CodeAnalysis.CSharp.Syntax.ConditionalDirectiveTriviaSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.DirectiveTriviaSyntax.WithEndOfDirectiveToken(Microsoft.CodeAnalysis.SyntaxToken endOfDirectiveToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.DirectiveTriviaSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.DirectiveTriviaSyntax.WithHashToken(Microsoft.CodeAnalysis.SyntaxToken hashToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.DirectiveTriviaSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.DiscardPatternSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.DiscardPatternSyntax.UnderscoreToken.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] ~~`Microsoft.CodeAnalysis.CSharp.Syntax.DiscardPatternSyntax.Update(Microsoft.CodeAnalysis.SyntaxToken underscoreToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.DiscardPatternSyntax`~~\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.DiscardPatternSyntax.WithUnderscoreToken(Microsoft.CodeAnalysis.SyntaxToken underscoreToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.DiscardPatternSyntax`\n* [x] ~~`Microsoft.CodeAnalysis.CSharp.Syntax.ForEachStatementSyntax.Update(Microsoft.CodeAnalysis.SyntaxToken awaitKeyword, Microsoft.CodeAnalysis.SyntaxToken forEachKeyword, Microsoft.CodeAnalysis.SyntaxToken openParenToken, Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type, Microsoft.CodeAnalysis.SyntaxToken identifier, Microsoft.CodeAnalysis.SyntaxToken inKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax expression, Microsoft.CodeAnalysis.SyntaxToken closeParenToken, Microsoft.CodeAnalysis.CSharp.Syntax.StatementSyntax statement) -> Microsoft.CodeAnalysis.CSharp.Syntax.ForEachStatementSyntax`~~\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ForEachStatementSyntax.WithAwaitKeyword(Microsoft.CodeAnalysis.SyntaxToken awaitKeyword) -> Microsoft.CodeAnalysis.CSharp.Syntax.ForEachStatementSyntax`\n* [x] ~~`Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax.Update(Microsoft.CodeAnalysis.SyntaxToken awaitKeyword, Microsoft.CodeAnalysis.SyntaxToken forEachKeyword, Microsoft.CodeAnalysis.SyntaxToken openParenToken, Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax variable, Microsoft.CodeAnalysis.SyntaxToken inKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax expression, Microsoft.CodeAnalysis.SyntaxToken closeParenToken, Microsoft.CodeAnalysis.CSharp.Syntax.StatementSyntax statement) -> Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax`~~\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax.WithAwaitKeyword(Microsoft.CodeAnalysis.SyntaxToken awaitKeyword) -> Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.LambdaExpressionSyntax.WithArrowToken(Microsoft.CodeAnalysis.SyntaxToken arrowToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.LambdaExpressionSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.LambdaExpressionSyntax.WithAsyncKeyword(Microsoft.CodeAnalysis.SyntaxToken asyncKeyword) -> Microsoft.CodeAnalysis.CSharp.Syntax.LambdaExpressionSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.LambdaExpressionSyntax.WithBody(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode body) -> Microsoft.CodeAnalysis.CSharp.Syntax.LambdaExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.LocalDeclarationStatementSyntax.AwaitKeyword.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] ~~`Microsoft.CodeAnalysis.CSharp.Syntax.LocalDeclarationStatementSyntax.Update(Microsoft.CodeAnalysis.SyntaxToken awaitKeyword, Microsoft.CodeAnalysis.SyntaxToken usingKeyword, Microsoft.CodeAnalysis.SyntaxTokenList modifiers, Microsoft.CodeAnalysis.CSharp.Syntax.VariableDeclarationSyntax declaration, Microsoft.CodeAnalysis.SyntaxToken semicolonToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.LocalDeclarationStatementSyntax`~~\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.LocalDeclarationStatementSyntax.UsingKeyword.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.LocalDeclarationStatementSyntax.WithAwaitKeyword(Microsoft.CodeAnalysis.SyntaxToken awaitKeyword) -> Microsoft.CodeAnalysis.CSharp.Syntax.LocalDeclarationStatementSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.LocalDeclarationStatementSyntax.WithUsingKeyword(Microsoft.CodeAnalysis.SyntaxToken usingKeyword) -> Microsoft.CodeAnalysis.CSharp.Syntax.LocalDeclarationStatementSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.NullableDirectiveTriviaSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.NullableDirectiveTriviaSyntax.NullableKeyword.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.NullableDirectiveTriviaSyntax.SettingToken.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.NullableDirectiveTriviaSyntax.WithEndOfDirectiveToken(Microsoft.CodeAnalysis.SyntaxToken endOfDirectiveToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.NullableDirectiveTriviaSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.NullableDirectiveTriviaSyntax.WithHashToken(Microsoft.CodeAnalysis.SyntaxToken hashToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.NullableDirectiveTriviaSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.NullableDirectiveTriviaSyntax.WithIsActive(bool isActive) -> Microsoft.CodeAnalysis.CSharp.Syntax.NullableDirectiveTriviaSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.NullableDirectiveTriviaSyntax.WithNullableKeyword(Microsoft.CodeAnalysis.SyntaxToken nullableKeyword) -> Microsoft.CodeAnalysis.CSharp.Syntax.NullableDirectiveTriviaSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.NullableDirectiveTriviaSyntax.WithSettingToken(Microsoft.CodeAnalysis.SyntaxToken settingToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.NullableDirectiveTriviaSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.PositionalPatternClauseSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.PositionalPatternClauseSyntax.AddSubpatterns(params Microsoft.CodeAnalysis.CSharp.Syntax.SubpatternSyntax[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.PositionalPatternClauseSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.PositionalPatternClauseSyntax.CloseParenToken.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.PositionalPatternClauseSyntax.OpenParenToken.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.PositionalPatternClauseSyntax.Subpatterns.get -> Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.SubpatternSyntax>`\n* [x] ~~`Microsoft.CodeAnalysis.CSharp.Syntax.PositionalPatternClauseSyntax.Update(Microsoft.CodeAnalysis.SyntaxToken openParenToken, Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.SubpatternSyntax> subpatterns, Microsoft.CodeAnalysis.SyntaxToken closeParenToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.PositionalPatternClauseSyntax`~~\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.PositionalPatternClauseSyntax.WithCloseParenToken(Microsoft.CodeAnalysis.SyntaxToken closeParenToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.PositionalPatternClauseSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.PositionalPatternClauseSyntax.WithOpenParenToken(Microsoft.CodeAnalysis.SyntaxToken openParenToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.PositionalPatternClauseSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.PositionalPatternClauseSyntax.WithSubpatterns(Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.SubpatternSyntax> subpatterns) -> Microsoft.CodeAnalysis.CSharp.Syntax.PositionalPatternClauseSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.PropertyPatternClauseSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.PropertyPatternClauseSyntax.AddSubpatterns(params Microsoft.CodeAnalysis.CSharp.Syntax.SubpatternSyntax[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.PropertyPatternClauseSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.PropertyPatternClauseSyntax.CloseBraceToken.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.PropertyPatternClauseSyntax.OpenBraceToken.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.PropertyPatternClauseSyntax.Subpatterns.get -> Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.SubpatternSyntax>`\n* [x] ~~`Microsoft.CodeAnalysis.CSharp.Syntax.PropertyPatternClauseSyntax.Update(Microsoft.CodeAnalysis.SyntaxToken openBraceToken, Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.SubpatternSyntax> subpatterns, Microsoft.CodeAnalysis.SyntaxToken closeBraceToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.PropertyPatternClauseSyntax`~~\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.PropertyPatternClauseSyntax.WithCloseBraceToken(Microsoft.CodeAnalysis.SyntaxToken closeBraceToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.PropertyPatternClauseSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.PropertyPatternClauseSyntax.WithOpenBraceToken(Microsoft.CodeAnalysis.SyntaxToken openBraceToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.PropertyPatternClauseSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.PropertyPatternClauseSyntax.WithSubpatterns(Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.SubpatternSyntax> subpatterns) -> Microsoft.CodeAnalysis.CSharp.Syntax.PropertyPatternClauseSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.RangeExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.RangeExpressionSyntax.LeftOperand.get -> Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.RangeExpressionSyntax.OperatorToken.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.RangeExpressionSyntax.RightOperand.get -> Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax`\n* [x] ~~`Microsoft.CodeAnalysis.CSharp.Syntax.RangeExpressionSyntax.Update(Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax leftOperand, Microsoft.CodeAnalysis.SyntaxToken operatorToken, Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax rightOperand) -> Microsoft.CodeAnalysis.CSharp.Syntax.RangeExpressionSyntax`~~\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.RangeExpressionSyntax.WithLeftOperand(Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax leftOperand) -> Microsoft.CodeAnalysis.CSharp.Syntax.RangeExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.RangeExpressionSyntax.WithOperatorToken(Microsoft.CodeAnalysis.SyntaxToken operatorToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.RangeExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.RangeExpressionSyntax.WithRightOperand(Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax rightOperand) -> Microsoft.CodeAnalysis.CSharp.Syntax.RangeExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.RecursivePatternSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.RecursivePatternSyntax.AddPositionalPatternClauseSubpatterns(params Microsoft.CodeAnalysis.CSharp.Syntax.SubpatternSyntax[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.RecursivePatternSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.RecursivePatternSyntax.AddPropertyPatternClauseSubpatterns(params Microsoft.CodeAnalysis.CSharp.Syntax.SubpatternSyntax[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.RecursivePatternSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.RecursivePatternSyntax.Designation.get -> Microsoft.CodeAnalysis.CSharp.Syntax.VariableDesignationSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.RecursivePatternSyntax.PositionalPatternClause.get -> Microsoft.CodeAnalysis.CSharp.Syntax.PositionalPatternClauseSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.RecursivePatternSyntax.PropertyPatternClause.get -> Microsoft.CodeAnalysis.CSharp.Syntax.PropertyPatternClauseSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.RecursivePatternSyntax.Type.get -> Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax`\n* [x] ~~`Microsoft.CodeAnalysis.CSharp.Syntax.RecursivePatternSyntax.Update(Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type, Microsoft.CodeAnalysis.CSharp.Syntax.PositionalPatternClauseSyntax positionalPatternClause, Microsoft.CodeAnalysis.CSharp.Syntax.PropertyPatternClauseSyntax propertyPatternClause, Microsoft.CodeAnalysis.CSharp.Syntax.VariableDesignationSyntax designation) -> Microsoft.CodeAnalysis.CSharp.Syntax.RecursivePatternSyntax`~~\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.RecursivePatternSyntax.WithDesignation(Microsoft.CodeAnalysis.CSharp.Syntax.VariableDesignationSyntax designation) -> Microsoft.CodeAnalysis.CSharp.Syntax.RecursivePatternSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.RecursivePatternSyntax.WithPositionalPatternClause(Microsoft.CodeAnalysis.CSharp.Syntax.PositionalPatternClauseSyntax positionalPatternClause) -> Microsoft.CodeAnalysis.CSharp.Syntax.RecursivePatternSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.RecursivePatternSyntax.WithPropertyPatternClause(Microsoft.CodeAnalysis.CSharp.Syntax.PropertyPatternClauseSyntax propertyPatternClause) -> Microsoft.CodeAnalysis.CSharp.Syntax.RecursivePatternSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.RecursivePatternSyntax.WithType(Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type) -> Microsoft.CodeAnalysis.CSharp.Syntax.RecursivePatternSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.SimpleNameSyntax.WithIdentifier(Microsoft.CodeAnalysis.SyntaxToken identifier) -> Microsoft.CodeAnalysis.CSharp.Syntax.SimpleNameSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.SubpatternSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.SubpatternSyntax.NameColon.get -> Microsoft.CodeAnalysis.CSharp.Syntax.NameColonSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.SubpatternSyntax.Pattern.get -> Microsoft.CodeAnalysis.CSharp.Syntax.PatternSyntax`\n* [x] ~~`Microsoft.CodeAnalysis.CSharp.Syntax.SubpatternSyntax.Update(Microsoft.CodeAnalysis.CSharp.Syntax.NameColonSyntax nameColon, Microsoft.CodeAnalysis.CSharp.Syntax.PatternSyntax pattern) -> Microsoft.CodeAnalysis.CSharp.Syntax.SubpatternSyntax`~~\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.SubpatternSyntax.WithNameColon(Microsoft.CodeAnalysis.CSharp.Syntax.NameColonSyntax nameColon) -> Microsoft.CodeAnalysis.CSharp.Syntax.SubpatternSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.SubpatternSyntax.WithPattern(Microsoft.CodeAnalysis.CSharp.Syntax.PatternSyntax pattern) -> Microsoft.CodeAnalysis.CSharp.Syntax.SubpatternSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionArmSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionArmSyntax.EqualsGreaterThanToken.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionArmSyntax.Expression.get -> Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionArmSyntax.Pattern.get -> Microsoft.CodeAnalysis.CSharp.Syntax.PatternSyntax`\n* [x] ~~`Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionArmSyntax.Update(Microsoft.CodeAnalysis.CSharp.Syntax.PatternSyntax pattern, Microsoft.CodeAnalysis.CSharp.Syntax.WhenClauseSyntax whenClause, Microsoft.CodeAnalysis.SyntaxToken equalsGreaterThanToken, Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax expression) -> Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionArmSyntax`~~\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionArmSyntax.WhenClause.get -> Microsoft.CodeAnalysis.CSharp.Syntax.WhenClauseSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionArmSyntax.WithEqualsGreaterThanToken(Microsoft.CodeAnalysis.SyntaxToken equalsGreaterThanToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionArmSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionArmSyntax.WithExpression(Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax expression) -> Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionArmSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionArmSyntax.WithPattern(Microsoft.CodeAnalysis.CSharp.Syntax.PatternSyntax pattern) -> Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionArmSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionArmSyntax.WithWhenClause(Microsoft.CodeAnalysis.CSharp.Syntax.WhenClauseSyntax whenClause) -> Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionArmSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionSyntax.AddArms(params Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionArmSyntax[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionSyntax.Arms.get -> Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionArmSyntax>`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionSyntax.CloseBraceToken.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionSyntax.GoverningExpression.get -> Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionSyntax.OpenBraceToken.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionSyntax.SwitchKeyword.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] ~~`Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionSyntax.Update(Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax governingExpression, Microsoft.CodeAnalysis.SyntaxToken switchKeyword, Microsoft.CodeAnalysis.SyntaxToken openBraceToken, Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionArmSyntax> arms, Microsoft.CodeAnalysis.SyntaxToken closeBraceToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionSyntax`~~\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionSyntax.WithArms(Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionArmSyntax> arms) -> Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionSyntax.WithCloseBraceToken(Microsoft.CodeAnalysis.SyntaxToken closeBraceToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionSyntax.WithGoverningExpression(Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax governingExpression) -> Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionSyntax.WithOpenBraceToken(Microsoft.CodeAnalysis.SyntaxToken openBraceToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionSyntax.WithSwitchKeyword(Microsoft.CodeAnalysis.SyntaxToken switchKeyword) -> Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.SwitchLabelSyntax.WithColonToken(Microsoft.CodeAnalysis.SyntaxToken colonToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.SwitchLabelSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.SwitchLabelSyntax.WithKeyword(Microsoft.CodeAnalysis.SyntaxToken keyword) -> Microsoft.CodeAnalysis.CSharp.Syntax.SwitchLabelSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax.AddAttributeLists(params Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax.AddBaseListTypes(params Microsoft.CodeAnalysis.CSharp.Syntax.BaseTypeSyntax[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseTypeDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax.AddConstraintClauses(params Microsoft.CodeAnalysis.CSharp.Syntax.TypeParameterConstraintClauseSyntax[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax.AddMembers(params Microsoft.CodeAnalysis.CSharp.Syntax.MemberDeclarationSyntax[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax.AddModifiers(params Microsoft.CodeAnalysis.SyntaxToken[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax.AddTypeParameterListParameters(params Microsoft.CodeAnalysis.CSharp.Syntax.TypeParameterSyntax[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax.WithAttributeLists(Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> attributeLists) -> Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax.WithBaseList(Microsoft.CodeAnalysis.CSharp.Syntax.BaseListSyntax baseList) -> Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax.WithCloseBraceToken(Microsoft.CodeAnalysis.SyntaxToken closeBraceToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax.WithConstraintClauses(Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.TypeParameterConstraintClauseSyntax> constraintClauses) -> Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax.WithIdentifier(Microsoft.CodeAnalysis.SyntaxToken identifier) -> Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax.WithKeyword(Microsoft.CodeAnalysis.SyntaxToken keyword) -> Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax.WithMembers(Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.MemberDeclarationSyntax> members) -> Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax.WithModifiers(Microsoft.CodeAnalysis.SyntaxTokenList modifiers) -> Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax.WithOpenBraceToken(Microsoft.CodeAnalysis.SyntaxToken openBraceToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax.WithSemicolonToken(Microsoft.CodeAnalysis.SyntaxToken semicolonToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax.WithTypeParameterList(Microsoft.CodeAnalysis.CSharp.Syntax.TypeParameterListSyntax typeParameterList) -> Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.UsingStatementSyntax.AwaitKeyword.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] ~~`Microsoft.CodeAnalysis.CSharp.Syntax.UsingStatementSyntax.Update(Microsoft.CodeAnalysis.SyntaxToken awaitKeyword, Microsoft.CodeAnalysis.SyntaxToken usingKeyword, Microsoft.CodeAnalysis.SyntaxToken openParenToken, Microsoft.CodeAnalysis.CSharp.Syntax.VariableDeclarationSyntax declaration, Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax expression, Microsoft.CodeAnalysis.SyntaxToken closeParenToken, Microsoft.CodeAnalysis.CSharp.Syntax.StatementSyntax statement) -> Microsoft.CodeAnalysis.CSharp.Syntax.UsingStatementSyntax`~~\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.UsingStatementSyntax.WithAwaitKeyword(Microsoft.CodeAnalysis.SyntaxToken awaitKeyword) -> Microsoft.CodeAnalysis.CSharp.Syntax.UsingStatementSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.VarPatternSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.VarPatternSyntax.Designation.get -> Microsoft.CodeAnalysis.CSharp.Syntax.VariableDesignationSyntax`\n* [x] ~~`Microsoft.CodeAnalysis.CSharp.Syntax.VarPatternSyntax.Update(Microsoft.CodeAnalysis.SyntaxToken varKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.VariableDesignationSyntax designation) -> Microsoft.CodeAnalysis.CSharp.Syntax.VarPatternSyntax`~~\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.VarPatternSyntax.VarKeyword.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.VarPatternSyntax.WithDesignation(Microsoft.CodeAnalysis.CSharp.Syntax.VariableDesignationSyntax designation) -> Microsoft.CodeAnalysis.CSharp.Syntax.VarPatternSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.Syntax.VarPatternSyntax.WithVarKeyword(Microsoft.CodeAnalysis.SyntaxToken varKeyword) -> Microsoft.CodeAnalysis.CSharp.Syntax.VarPatternSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.XmlAttributeSyntax.WithEndQuoteToken(Microsoft.CodeAnalysis.SyntaxToken endQuoteToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.XmlAttributeSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.XmlAttributeSyntax.WithEqualsToken(Microsoft.CodeAnalysis.SyntaxToken equalsToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.XmlAttributeSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.XmlAttributeSyntax.WithName(Microsoft.CodeAnalysis.CSharp.Syntax.XmlNameSyntax name) -> Microsoft.CodeAnalysis.CSharp.Syntax.XmlAttributeSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.XmlAttributeSyntax.WithStartQuoteToken(Microsoft.CodeAnalysis.SyntaxToken startQuoteToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.XmlAttributeSyntax`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.CoalesceAssignmentExpression = 8725 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.DiscardPattern = 9024 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.DotDotToken = 8222 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.EnableKeyword = 8487 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.IndexExpression = 8741 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.NullableDirectiveTrivia = 9055 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.NullableKeyword = 8486 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.PositionalPatternClause = 9023 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.PropertyPatternClause = 9021 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.QuestionQuestionEqualsToken = 8284 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.RangeExpression = 8658 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.RecursivePattern = 9020 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.Subpattern = 9022 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.SuppressNullableWarningExpression = 9054 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.SwitchExpression = 9025 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.SwitchExpressionArm = 9026 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.VarKeyword = 8490 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [x] `Microsoft.CodeAnalysis.CSharp.SyntaxKind.VarPattern = 9027 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.CSharpCompilation.ClassifyCommonConversion(Microsoft.CodeAnalysis.ITypeSymbol source, Microsoft.CodeAnalysis.ITypeSymbol destination) -> Microsoft.CodeAnalysis.Operations.CommonConversion`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.CSharpCompilation.ContainsSymbolsWithName(string name, Microsoft.CodeAnalysis.SymbolFilter filter = Microsoft.CodeAnalysis.SymbolFilter.TypeAndMember, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> bool`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.CSharpCompilation.GetSymbolsWithName(string name, Microsoft.CodeAnalysis.SymbolFilter filter = Microsoft.CodeAnalysis.SymbolFilter.TypeAndMember, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.ISymbol>`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.CSharpCompilationOptions.NullableContextOptions.get -> Microsoft.CodeAnalysis.NullableContextOptions`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitDiscardPattern(Microsoft.CodeAnalysis.CSharp.Syntax.DiscardPatternSyntax node) -> Microsoft.CodeAnalysis.SyntaxNode`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitNullableDirectiveTrivia(Microsoft.CodeAnalysis.CSharp.Syntax.NullableDirectiveTriviaSyntax node) -> Microsoft.CodeAnalysis.SyntaxNode`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitPositionalPatternClause(Microsoft.CodeAnalysis.CSharp.Syntax.PositionalPatternClauseSyntax node) -> Microsoft.CodeAnalysis.SyntaxNode`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitPropertyPatternClause(Microsoft.CodeAnalysis.CSharp.Syntax.PropertyPatternClauseSyntax node) -> Microsoft.CodeAnalysis.SyntaxNode`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitRangeExpression(Microsoft.CodeAnalysis.CSharp.Syntax.RangeExpressionSyntax node) -> Microsoft.CodeAnalysis.SyntaxNode`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitRecursivePattern(Microsoft.CodeAnalysis.CSharp.Syntax.RecursivePatternSyntax node) -> Microsoft.CodeAnalysis.SyntaxNode`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitSubpattern(Microsoft.CodeAnalysis.CSharp.Syntax.SubpatternSyntax node) -> Microsoft.CodeAnalysis.SyntaxNode`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitSwitchExpression(Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionSyntax node) -> Microsoft.CodeAnalysis.SyntaxNode`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitSwitchExpressionArm(Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionArmSyntax node) -> Microsoft.CodeAnalysis.SyntaxNode`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitVarPattern(Microsoft.CodeAnalysis.CSharp.Syntax.VarPatternSyntax node) -> Microsoft.CodeAnalysis.SyntaxNode`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.DiscardPatternSyntax.Accept(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor visitor) -> void`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.DiscardPatternSyntax.Accept<TResult>(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult> visitor) -> TResult`\n* [x] `override Microsoft.CodeAnalysis.CSharp.Syntax.ForEachStatementSyntax.AwaitKeyword.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [x] `override Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax.AwaitKeyword.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.NullableDirectiveTriviaSyntax.Accept(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor visitor) -> void`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.NullableDirectiveTriviaSyntax.Accept<TResult>(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult> visitor) -> TResult`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.NullableDirectiveTriviaSyntax.EndOfDirectiveToken.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.NullableDirectiveTriviaSyntax.HashToken.get -> Microsoft.CodeAnalysis.SyntaxToken`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.NullableDirectiveTriviaSyntax.IsActive.get -> bool`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.PositionalPatternClauseSyntax.Accept(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor visitor) -> void`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.PositionalPatternClauseSyntax.Accept<TResult>(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult> visitor) -> TResult`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.PropertyPatternClauseSyntax.Accept(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor visitor) -> void`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.PropertyPatternClauseSyntax.Accept<TResult>(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult> visitor) -> TResult`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.RangeExpressionSyntax.Accept(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor visitor) -> void`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.RangeExpressionSyntax.Accept<TResult>(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult> visitor) -> TResult`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.RecursivePatternSyntax.Accept(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor visitor) -> void`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.RecursivePatternSyntax.Accept<TResult>(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult> visitor) -> TResult`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.SubpatternSyntax.Accept(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor visitor) -> void`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.SubpatternSyntax.Accept<TResult>(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult> visitor) -> TResult`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionArmSyntax.Accept(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor visitor) -> void`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionArmSyntax.Accept<TResult>(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult> visitor) -> TResult`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionSyntax.Accept(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor visitor) -> void`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionSyntax.Accept<TResult>(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult> visitor) -> TResult`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.VarPatternSyntax.Accept(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor visitor) -> void`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.VarPatternSyntax.Accept<TResult>(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult> visitor) -> TResult`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.CSharpSyntaxTree.Create(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode root, Microsoft.CodeAnalysis.CSharp.CSharpParseOptions options = null, string path = \"\", System.Text.Encoding encoding = null, System.Collections.Immutable.ImmutableDictionary<string, Microsoft.CodeAnalysis.ReportDiagnostic> diagnosticOptions = null) -> Microsoft.CodeAnalysis.SyntaxTree`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.CSharpSyntaxTree.Create(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode root, Microsoft.CodeAnalysis.CSharp.CSharpParseOptions options, string path, System.Text.Encoding encoding) -> Microsoft.CodeAnalysis.SyntaxTree`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.CSharpSyntaxTree.ParseText(Microsoft.CodeAnalysis.Text.SourceText text, Microsoft.CodeAnalysis.CSharp.CSharpParseOptions options = null, string path = \"\", System.Collections.Immutable.ImmutableDictionary<string, Microsoft.CodeAnalysis.ReportDiagnostic> diagnosticOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.SyntaxTree`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.CSharpSyntaxTree.ParseText(Microsoft.CodeAnalysis.Text.SourceText text, Microsoft.CodeAnalysis.CSharp.CSharpParseOptions options, string path, System.Threading.CancellationToken cancellationToken) -> Microsoft.CodeAnalysis.SyntaxTree`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.CSharpSyntaxTree.ParseText(string text, Microsoft.CodeAnalysis.CSharp.CSharpParseOptions options, string path, System.Text.Encoding encoding, System.Threading.CancellationToken cancellationToken) -> Microsoft.CodeAnalysis.SyntaxTree`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.CSharpSyntaxTree.ParseText(string text, Microsoft.CodeAnalysis.CSharp.CSharpParseOptions options = null, string path = \"\", System.Text.Encoding encoding = null, System.Collections.Immutable.ImmutableDictionary<string, Microsoft.CodeAnalysis.ReportDiagnostic> diagnosticOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.SyntaxTree`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.LanguageVersionFacts.TryParse(string version, out Microsoft.CodeAnalysis.CSharp.LanguageVersion result) -> bool`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SymbolDisplay.ToDisplayParts(Microsoft.CodeAnalysis.ITypeSymbol symbol, Microsoft.CodeAnalysis.NullableAnnotation nullableAnnotation, Microsoft.CodeAnalysis.SymbolDisplayFormat format = null) -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.SymbolDisplayPart>`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SymbolDisplay.ToDisplayParts(Microsoft.CodeAnalysis.ITypeSymbol symbol, Microsoft.CodeAnalysis.NullableFlowState nullableFlowState, Microsoft.CodeAnalysis.SymbolDisplayFormat format = null) -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.SymbolDisplayPart>`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SymbolDisplay.ToDisplayString(Microsoft.CodeAnalysis.ITypeSymbol symbol, Microsoft.CodeAnalysis.NullableAnnotation nullableAnnotation, Microsoft.CodeAnalysis.SymbolDisplayFormat format = null) -> string`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SymbolDisplay.ToDisplayString(Microsoft.CodeAnalysis.ITypeSymbol symbol, Microsoft.CodeAnalysis.NullableFlowState nullableFlowState, Microsoft.CodeAnalysis.SymbolDisplayFormat format = null) -> string`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SymbolDisplay.ToMinimalDisplayParts(Microsoft.CodeAnalysis.ITypeSymbol symbol, Microsoft.CodeAnalysis.NullableAnnotation nullableAnnotation, Microsoft.CodeAnalysis.SemanticModel semanticModel, int position, Microsoft.CodeAnalysis.SymbolDisplayFormat format = null) -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.SymbolDisplayPart>`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SymbolDisplay.ToMinimalDisplayParts(Microsoft.CodeAnalysis.ITypeSymbol symbol, Microsoft.CodeAnalysis.NullableFlowState nullableFlowState, Microsoft.CodeAnalysis.SemanticModel semanticModel, int position, Microsoft.CodeAnalysis.SymbolDisplayFormat format = null) -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.SymbolDisplayPart>`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SymbolDisplay.ToMinimalDisplayString(Microsoft.CodeAnalysis.ITypeSymbol symbol, Microsoft.CodeAnalysis.NullableAnnotation nullableAnnotation, Microsoft.CodeAnalysis.SemanticModel semanticModel, int position, Microsoft.CodeAnalysis.SymbolDisplayFormat format = null) -> string`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SymbolDisplay.ToMinimalDisplayString(Microsoft.CodeAnalysis.ITypeSymbol symbol, Microsoft.CodeAnalysis.NullableFlowState nullableFlowState, Microsoft.CodeAnalysis.SemanticModel semanticModel, int position, Microsoft.CodeAnalysis.SymbolDisplayFormat format = null) -> string`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.ClassOrStructConstraint(Microsoft.CodeAnalysis.CSharp.SyntaxKind kind, Microsoft.CodeAnalysis.SyntaxToken classOrStructKeyword, Microsoft.CodeAnalysis.SyntaxToken questionToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.ClassOrStructConstraintSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.DiscardPattern() -> Microsoft.CodeAnalysis.CSharp.Syntax.DiscardPatternSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.DiscardPattern(Microsoft.CodeAnalysis.SyntaxToken underscoreToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.DiscardPatternSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.EventDeclaration(Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> attributeLists, Microsoft.CodeAnalysis.SyntaxTokenList modifiers, Microsoft.CodeAnalysis.SyntaxToken eventKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type, Microsoft.CodeAnalysis.CSharp.Syntax.ExplicitInterfaceSpecifierSyntax explicitInterfaceSpecifier, Microsoft.CodeAnalysis.SyntaxToken identifier, Microsoft.CodeAnalysis.CSharp.Syntax.AccessorListSyntax accessorList, Microsoft.CodeAnalysis.SyntaxToken semicolonToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.EventDeclarationSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.EventDeclaration(Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> attributeLists, Microsoft.CodeAnalysis.SyntaxTokenList modifiers, Microsoft.CodeAnalysis.SyntaxToken eventKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type, Microsoft.CodeAnalysis.CSharp.Syntax.ExplicitInterfaceSpecifierSyntax explicitInterfaceSpecifier, Microsoft.CodeAnalysis.SyntaxToken identifier, Microsoft.CodeAnalysis.SyntaxToken semicolonToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.EventDeclarationSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.ForEachStatement(Microsoft.CodeAnalysis.SyntaxToken awaitKeyword, Microsoft.CodeAnalysis.SyntaxToken forEachKeyword, Microsoft.CodeAnalysis.SyntaxToken openParenToken, Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type, Microsoft.CodeAnalysis.SyntaxToken identifier, Microsoft.CodeAnalysis.SyntaxToken inKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax expression, Microsoft.CodeAnalysis.SyntaxToken closeParenToken, Microsoft.CodeAnalysis.CSharp.Syntax.StatementSyntax statement) -> Microsoft.CodeAnalysis.CSharp.Syntax.ForEachStatementSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.ForEachVariableStatement(Microsoft.CodeAnalysis.SyntaxToken awaitKeyword, Microsoft.CodeAnalysis.SyntaxToken forEachKeyword, Microsoft.CodeAnalysis.SyntaxToken openParenToken, Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax variable, Microsoft.CodeAnalysis.SyntaxToken inKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax expression, Microsoft.CodeAnalysis.SyntaxToken closeParenToken, Microsoft.CodeAnalysis.CSharp.Syntax.StatementSyntax statement) -> Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.LocalDeclarationStatement(Microsoft.CodeAnalysis.SyntaxToken awaitKeyword, Microsoft.CodeAnalysis.SyntaxToken usingKeyword, Microsoft.CodeAnalysis.SyntaxTokenList modifiers, Microsoft.CodeAnalysis.CSharp.Syntax.VariableDeclarationSyntax declaration, Microsoft.CodeAnalysis.SyntaxToken semicolonToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.LocalDeclarationStatementSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.NullableDirectiveTrivia(Microsoft.CodeAnalysis.SyntaxToken hashToken, Microsoft.CodeAnalysis.SyntaxToken nullableKeyword, Microsoft.CodeAnalysis.SyntaxToken settingToken, Microsoft.CodeAnalysis.SyntaxToken targetToken, Microsoft.CodeAnalysis.SyntaxToken endOfDirectiveToken, bool isActive) -> Microsoft.CodeAnalysis.CSharp.Syntax.NullableDirectiveTriviaSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.NullableDirectiveTrivia(Microsoft.CodeAnalysis.SyntaxToken settingToken, Microsoft.CodeAnalysis.SyntaxToken targetToken, bool isActive) -> Microsoft.CodeAnalysis.CSharp.Syntax.NullableDirectiveTriviaSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.NullableDirectiveTrivia(Microsoft.CodeAnalysis.SyntaxToken settingToken, bool isActive) -> Microsoft.CodeAnalysis.CSharp.Syntax.NullableDirectiveTriviaSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.ParseMemberDeclaration(string text, int offset = 0, Microsoft.CodeAnalysis.ParseOptions options = null, bool consumeFullText = true) -> Microsoft.CodeAnalysis.CSharp.Syntax.MemberDeclarationSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.ParseSyntaxTree(Microsoft.CodeAnalysis.Text.SourceText text, Microsoft.CodeAnalysis.ParseOptions options = null, string path = \"\", System.Collections.Immutable.ImmutableDictionary<string, Microsoft.CodeAnalysis.ReportDiagnostic> diagnosticOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.SyntaxTree`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.ParseSyntaxTree(Microsoft.CodeAnalysis.Text.SourceText text, Microsoft.CodeAnalysis.ParseOptions options, string path, System.Threading.CancellationToken cancellationToken) -> Microsoft.CodeAnalysis.SyntaxTree`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.ParseSyntaxTree(string text, Microsoft.CodeAnalysis.ParseOptions options = null, string path = \"\", System.Text.Encoding encoding = null, System.Collections.Immutable.ImmutableDictionary<string, Microsoft.CodeAnalysis.ReportDiagnostic> diagnosticOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.SyntaxTree`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.ParseSyntaxTree(string text, Microsoft.CodeAnalysis.ParseOptions options, string path, System.Text.Encoding encoding, System.Threading.CancellationToken cancellationToken) -> Microsoft.CodeAnalysis.SyntaxTree`\n* [x] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.PositionalPatternClause(Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.SubpatternSyntax> subpatterns = default(Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.SubpatternSyntax>)) -> Microsoft.CodeAnalysis.CSharp.Syntax.PositionalPatternClauseSyntax`\n* [x] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.PositionalPatternClause(Microsoft.CodeAnalysis.SyntaxToken openParenToken, Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.SubpatternSyntax> subpatterns, Microsoft.CodeAnalysis.SyntaxToken closeParenToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.PositionalPatternClauseSyntax`\n* [x] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.PropertyPatternClause(Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.SubpatternSyntax> subpatterns = default(Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.SubpatternSyntax>)) -> Microsoft.CodeAnalysis.CSharp.Syntax.PropertyPatternClauseSyntax`\n* [x] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.PropertyPatternClause(Microsoft.CodeAnalysis.SyntaxToken openBraceToken, Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.SubpatternSyntax> subpatterns, Microsoft.CodeAnalysis.SyntaxToken closeBraceToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.PropertyPatternClauseSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.RangeExpression() -> Microsoft.CodeAnalysis.CSharp.Syntax.RangeExpressionSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.RangeExpression(Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax leftOperand, Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax rightOperand) -> Microsoft.CodeAnalysis.CSharp.Syntax.RangeExpressionSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.RangeExpression(Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax leftOperand, Microsoft.CodeAnalysis.SyntaxToken operatorToken, Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax rightOperand) -> Microsoft.CodeAnalysis.CSharp.Syntax.RangeExpressionSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.RecursivePattern() -> Microsoft.CodeAnalysis.CSharp.Syntax.RecursivePatternSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.RecursivePattern(Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type, Microsoft.CodeAnalysis.CSharp.Syntax.PositionalPatternClauseSyntax positionalPatternClause, Microsoft.CodeAnalysis.CSharp.Syntax.PropertyPatternClauseSyntax propertyPatternClause, Microsoft.CodeAnalysis.CSharp.Syntax.VariableDesignationSyntax designation) -> Microsoft.CodeAnalysis.CSharp.Syntax.RecursivePatternSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.Subpattern(Microsoft.CodeAnalysis.CSharp.Syntax.NameColonSyntax nameColon, Microsoft.CodeAnalysis.CSharp.Syntax.PatternSyntax pattern) -> Microsoft.CodeAnalysis.CSharp.Syntax.SubpatternSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.Subpattern(Microsoft.CodeAnalysis.CSharp.Syntax.PatternSyntax pattern) -> Microsoft.CodeAnalysis.CSharp.Syntax.SubpatternSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.SwitchExpression(Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax governingExpression) -> Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.SwitchExpression(Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax governingExpression, Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionArmSyntax> arms) -> Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.SwitchExpression(Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax governingExpression, Microsoft.CodeAnalysis.SyntaxToken switchKeyword, Microsoft.CodeAnalysis.SyntaxToken openBraceToken, Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionArmSyntax> arms, Microsoft.CodeAnalysis.SyntaxToken closeBraceToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.SwitchExpressionArm(Microsoft.CodeAnalysis.CSharp.Syntax.PatternSyntax pattern, Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax expression) -> Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionArmSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.SwitchExpressionArm(Microsoft.CodeAnalysis.CSharp.Syntax.PatternSyntax pattern, Microsoft.CodeAnalysis.CSharp.Syntax.WhenClauseSyntax whenClause, Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax expression) -> Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionArmSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.SwitchExpressionArm(Microsoft.CodeAnalysis.CSharp.Syntax.PatternSyntax pattern, Microsoft.CodeAnalysis.CSharp.Syntax.WhenClauseSyntax whenClause, Microsoft.CodeAnalysis.SyntaxToken equalsGreaterThanToken, Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax expression) -> Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionArmSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.UsingStatement(Microsoft.CodeAnalysis.SyntaxToken awaitKeyword, Microsoft.CodeAnalysis.SyntaxToken usingKeyword, Microsoft.CodeAnalysis.SyntaxToken openParenToken, Microsoft.CodeAnalysis.CSharp.Syntax.VariableDeclarationSyntax declaration, Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax expression, Microsoft.CodeAnalysis.SyntaxToken closeParenToken, Microsoft.CodeAnalysis.CSharp.Syntax.StatementSyntax statement) -> Microsoft.CodeAnalysis.CSharp.Syntax.UsingStatementSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.VarPattern(Microsoft.CodeAnalysis.CSharp.Syntax.VariableDesignationSyntax designation) -> Microsoft.CodeAnalysis.CSharp.Syntax.VarPatternSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.VarPattern(Microsoft.CodeAnalysis.SyntaxToken varKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.VariableDesignationSyntax designation) -> Microsoft.CodeAnalysis.CSharp.Syntax.VarPatternSyntax`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitDiscardPattern(Microsoft.CodeAnalysis.CSharp.Syntax.DiscardPatternSyntax node) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitNullableDirectiveTrivia(Microsoft.CodeAnalysis.CSharp.Syntax.NullableDirectiveTriviaSyntax node) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitPositionalPatternClause(Microsoft.CodeAnalysis.CSharp.Syntax.PositionalPatternClauseSyntax node) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitPropertyPatternClause(Microsoft.CodeAnalysis.CSharp.Syntax.PropertyPatternClauseSyntax node) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitRangeExpression(Microsoft.CodeAnalysis.CSharp.Syntax.RangeExpressionSyntax node) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitRecursivePattern(Microsoft.CodeAnalysis.CSharp.Syntax.RecursivePatternSyntax node) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitSubpattern(Microsoft.CodeAnalysis.CSharp.Syntax.SubpatternSyntax node) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitSwitchExpression(Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionSyntax node) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitSwitchExpressionArm(Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionArmSyntax node) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitVarPattern(Microsoft.CodeAnalysis.CSharp.Syntax.VarPatternSyntax node) -> void`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult>.VisitDiscardPattern(Microsoft.CodeAnalysis.CSharp.Syntax.DiscardPatternSyntax node) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult>.VisitNullableDirectiveTrivia(Microsoft.CodeAnalysis.CSharp.Syntax.NullableDirectiveTriviaSyntax node) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult>.VisitPositionalPatternClause(Microsoft.CodeAnalysis.CSharp.Syntax.PositionalPatternClauseSyntax node) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult>.VisitPropertyPatternClause(Microsoft.CodeAnalysis.CSharp.Syntax.PropertyPatternClauseSyntax node) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult>.VisitRangeExpression(Microsoft.CodeAnalysis.CSharp.Syntax.RangeExpressionSyntax node) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult>.VisitRecursivePattern(Microsoft.CodeAnalysis.CSharp.Syntax.RecursivePatternSyntax node) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult>.VisitSubpattern(Microsoft.CodeAnalysis.CSharp.Syntax.SubpatternSyntax node) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult>.VisitSwitchExpression(Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionSyntax node) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult>.VisitSwitchExpressionArm(Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionArmSyntax node) -> TResult`\n* [ ] `virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult>.VisitVarPattern(Microsoft.CodeAnalysis.CSharp.Syntax.VarPatternSyntax node) -> TResult`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.EnumMemberDeclarationSyntax.AddModifiers(params Microsoft.CodeAnalysis.SyntaxToken[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.EnumMemberDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.EnumMemberDeclarationSyntax.Update(Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> attributeLists, Microsoft.CodeAnalysis.SyntaxTokenList modifiers, Microsoft.CodeAnalysis.SyntaxToken identifier, Microsoft.CodeAnalysis.CSharp.Syntax.EqualsValueClauseSyntax equalsValue) -> Microsoft.CodeAnalysis.CSharp.Syntax.EnumMemberDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.EnumMemberDeclarationSyntax.WithModifiers(Microsoft.CodeAnalysis.SyntaxTokenList modifiers) -> Microsoft.CodeAnalysis.CSharp.Syntax.EnumMemberDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.GlobalStatementSyntax.AddAttributeLists(params Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.GlobalStatementSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.GlobalStatementSyntax.AddModifiers(params Microsoft.CodeAnalysis.SyntaxToken[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.GlobalStatementSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.GlobalStatementSyntax.Update(Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> attributeLists, Microsoft.CodeAnalysis.SyntaxTokenList modifiers, Microsoft.CodeAnalysis.CSharp.Syntax.StatementSyntax statement) -> Microsoft.CodeAnalysis.CSharp.Syntax.GlobalStatementSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.GlobalStatementSyntax.WithAttributeLists(Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> attributeLists) -> Microsoft.CodeAnalysis.CSharp.Syntax.GlobalStatementSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.GlobalStatementSyntax.WithModifiers(Microsoft.CodeAnalysis.SyntaxTokenList modifiers) -> Microsoft.CodeAnalysis.CSharp.Syntax.GlobalStatementSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.MemberDeclarationSyntax.AddAttributeLists(params Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.MemberDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.MemberDeclarationSyntax.AddModifiers(params Microsoft.CodeAnalysis.SyntaxToken[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.MemberDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.MemberDeclarationSyntax.WithAttributeLists(Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> attributeLists) -> Microsoft.CodeAnalysis.CSharp.Syntax.MemberDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.MemberDeclarationSyntax.WithModifiers(Microsoft.CodeAnalysis.SyntaxTokenList modifiers) -> Microsoft.CodeAnalysis.CSharp.Syntax.MemberDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.NamespaceDeclarationSyntax.AddAttributeLists(params Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.NamespaceDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.NamespaceDeclarationSyntax.AddModifiers(params Microsoft.CodeAnalysis.SyntaxToken[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.NamespaceDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.NamespaceDeclarationSyntax.Update(Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> attributeLists, Microsoft.CodeAnalysis.SyntaxTokenList modifiers, Microsoft.CodeAnalysis.SyntaxToken namespaceKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.NameSyntax name, Microsoft.CodeAnalysis.SyntaxToken openBraceToken, Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.ExternAliasDirectiveSyntax> externs, Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.UsingDirectiveSyntax> usings, Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.MemberDeclarationSyntax> members, Microsoft.CodeAnalysis.SyntaxToken closeBraceToken, Microsoft.CodeAnalysis.SyntaxToken semicolonToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.NamespaceDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.NamespaceDeclarationSyntax.WithAttributeLists(Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> attributeLists) -> Microsoft.CodeAnalysis.CSharp.Syntax.NamespaceDeclarationSyntax`\n* [ ] `Microsoft.CodeAnalysis.CSharp.Syntax.NamespaceDeclarationSyntax.WithModifiers(Microsoft.CodeAnalysis.SyntaxTokenList modifiers) -> Microsoft.CodeAnalysis.CSharp.Syntax.NamespaceDeclarationSyntax`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.DelegateDeclarationSyntax.AttributeLists.get -> Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax>`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.DelegateDeclarationSyntax.Modifiers.get -> Microsoft.CodeAnalysis.SyntaxTokenList`\n* [ ] `abstract Microsoft.CodeAnalysis.CSharp.Syntax.MemberDeclarationSyntax.AttributeLists.get -> Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax>`\n* [ ] `abstract Microsoft.CodeAnalysis.CSharp.Syntax.MemberDeclarationSyntax.Modifiers.get -> Microsoft.CodeAnalysis.SyntaxTokenList`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.GlobalStatementSyntax.AttributeLists.get -> Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax>`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.GlobalStatementSyntax.Modifiers.get -> Microsoft.CodeAnalysis.SyntaxTokenList`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.IncompleteMemberSyntax.AttributeLists.get -> Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax>`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.IncompleteMemberSyntax.Modifiers.get -> Microsoft.CodeAnalysis.SyntaxTokenList`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.NamespaceDeclarationSyntax.AttributeLists.get -> Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax>`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.NamespaceDeclarationSyntax.Modifiers.get -> Microsoft.CodeAnalysis.SyntaxTokenList`\n* [ ] `override abstract Microsoft.CodeAnalysis.CSharp.Syntax.BaseFieldDeclarationSyntax.AttributeLists.get -> Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax>`\n* [ ] `override abstract Microsoft.CodeAnalysis.CSharp.Syntax.BaseFieldDeclarationSyntax.Modifiers.get -> Microsoft.CodeAnalysis.SyntaxTokenList`\n* [ ] `override abstract Microsoft.CodeAnalysis.CSharp.Syntax.BaseMethodDeclarationSyntax.AttributeLists.get -> Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax>`\n* [ ] `override abstract Microsoft.CodeAnalysis.CSharp.Syntax.BaseMethodDeclarationSyntax.Modifiers.get -> Microsoft.CodeAnalysis.SyntaxTokenList`\n* [ ] `override abstract Microsoft.CodeAnalysis.CSharp.Syntax.BasePropertyDeclarationSyntax.AttributeLists.get -> Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax>`\n* [ ] `override abstract Microsoft.CodeAnalysis.CSharp.Syntax.BasePropertyDeclarationSyntax.Modifiers.get -> Microsoft.CodeAnalysis.SyntaxTokenList`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.EnumMemberDeclaration(Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> attributeLists, Microsoft.CodeAnalysis.SyntaxTokenList modifiers, Microsoft.CodeAnalysis.SyntaxToken identifier, Microsoft.CodeAnalysis.CSharp.Syntax.EqualsValueClauseSyntax equalsValue) -> Microsoft.CodeAnalysis.CSharp.Syntax.EnumMemberDeclarationSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.GlobalStatement(Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> attributeLists, Microsoft.CodeAnalysis.SyntaxTokenList modifiers, Microsoft.CodeAnalysis.CSharp.Syntax.StatementSyntax statement) -> Microsoft.CodeAnalysis.CSharp.Syntax.GlobalStatementSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.NamespaceDeclaration(Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> attributeLists, Microsoft.CodeAnalysis.SyntaxTokenList modifiers, Microsoft.CodeAnalysis.CSharp.Syntax.NameSyntax name, Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.ExternAliasDirectiveSyntax> externs, Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.UsingDirectiveSyntax> usings, Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.MemberDeclarationSyntax> members) -> Microsoft.CodeAnalysis.CSharp.Syntax.NamespaceDeclarationSyntax`\n* [ ] `static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.NamespaceDeclaration(Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> attributeLists, Microsoft.CodeAnalysis.SyntaxTokenList modifiers, Microsoft.CodeAnalysis.SyntaxToken namespaceKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.NameSyntax name, Microsoft.CodeAnalysis.SyntaxToken openBraceToken, Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.ExternAliasDirectiveSyntax> externs, Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.UsingDirectiveSyntax> usings, Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.MemberDeclarationSyntax> members, Microsoft.CodeAnalysis.SyntaxToken closeBraceToken, Microsoft.CodeAnalysis.SyntaxToken semicolonToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.NamespaceDeclarationSyntax`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.EnumMemberDeclarationSyntax.AttributeLists.get -> Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax>`\n* [ ] `override Microsoft.CodeAnalysis.CSharp.Syntax.EnumMemberDeclarationSyntax.Modifiers.get -> Microsoft.CodeAnalysis.SyntaxTokenList`\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/IFieldSymbolExtensions.cs",
    "content": "﻿// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.\n// Licensed under the MIT License. See LICENSE in the project root for license information.\n\n#nullable disable\n\nnamespace StyleCop.Analyzers.Lightup\n{\n    using System;\n    using Microsoft.CodeAnalysis;\n\n    public static class IFieldSymbolExtensions\n    {\n        private static readonly Func<IFieldSymbol, IFieldSymbol> CorrespondingTupleFieldAccessor;\n\n        static IFieldSymbolExtensions()\n        {\n            CorrespondingTupleFieldAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<IFieldSymbol, IFieldSymbol>(typeof(IFieldSymbol), nameof(CorrespondingTupleField));\n        }\n\n        public static IFieldSymbol CorrespondingTupleField(this IFieldSymbol symbol)\n        {\n            return CorrespondingTupleFieldAccessor(symbol);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/INamedTypeSymbolExtensions.cs",
    "content": "﻿// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.\n// Licensed under the MIT License. See LICENSE in the project root for license information.\n\nnamespace StyleCop.Analyzers.Lightup;\n\npublic static class INamedTypeSymbolExtensions\n{\n    private static readonly Func<INamedTypeSymbol, INamedTypeSymbol> TupleUnderlyingTypeAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<INamedTypeSymbol, INamedTypeSymbol>(typeof(INamedTypeSymbol), \"TupleUnderlyingType\");\n    private static readonly Func<INamedTypeSymbol, ImmutableArray<IFieldSymbol>> TupleElementsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<INamedTypeSymbol, ImmutableArray<IFieldSymbol>>(typeof(INamedTypeSymbol), \"TupleElements\");\n    private static readonly Func<INamedTypeSymbol, bool> IsSerializableAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<INamedTypeSymbol, bool>(typeof(INamedTypeSymbol), \"IsSerializable\");\n    private static readonly Func<INamedTypeSymbol, bool> IsExtensionAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<INamedTypeSymbol, bool>(typeof(INamedTypeSymbol), \"IsExtension\");\n\n    extension(INamedTypeSymbol symbol)\n    {\n        public INamedTypeSymbol TupleUnderlyingType => TupleUnderlyingTypeAccessor(symbol);\n        public ImmutableArray<IFieldSymbol> TupleElements => TupleElementsAccessor(symbol);\n        public bool IsSerializable => IsSerializableAccessor(symbol);\n        public bool IsExtension => IsExtensionAccessor(symbol);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/ISyntaxWrapper`1.cs",
    "content": "﻿// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.\n// Licensed under the MIT License. See LICENSE in the project root for license information.\n\n#nullable disable\n\nnamespace StyleCop.Analyzers.Lightup\n{\n    using Microsoft.CodeAnalysis;\n\n    /// <summary>\n    /// Represents a light-up wrapper for a type derived from a known back syntax kind <typeparamref name=\"T\"/>.\n    /// </summary>\n    /// <typeparam name=\"T\">The base syntax kind which is exposed in the referenced API.</typeparam>\n    public interface ISyntaxWrapper<T>\n        where T : SyntaxNode\n    {\n        /// <summary>\n        /// Gets the wrapped syntax node.\n        /// </summary>\n        /// <value>\n        /// The wrapped syntax node.\n        /// </value>\n        T SyntaxNode\n        {\n            get;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/ITypeParameterSymbolExtensions.cs",
    "content": "﻿// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.\n// Licensed under the MIT License. See LICENSE in the project root for license information.\n\n#nullable disable\n\nnamespace StyleCop.Analyzers.Lightup\n{\n    using System;\n    using Microsoft.CodeAnalysis;\n\n    public static class ITypeParameterSymbolExtensions\n    {\n        private static readonly Func<ITypeParameterSymbol, bool> HasUnmanagedTypeConstraintAccessor;\n\n        static ITypeParameterSymbolExtensions()\n        {\n            HasUnmanagedTypeConstraintAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ITypeParameterSymbol, bool>(typeof(ITypeParameterSymbol), nameof(HasUnmanagedTypeConstraint));\n        }\n\n        public static bool HasUnmanagedTypeConstraint(this ITypeParameterSymbol symbol)\n        {\n            return HasUnmanagedTypeConstraintAccessor(symbol);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/ITypeSymbolExtensions.cs",
    "content": "﻿// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.\n// Licensed under the MIT License. See LICENSE in the project root for license information.\n\n#nullable disable\n\nnamespace StyleCop.Analyzers.Lightup\n{\n    using System;\n    using Microsoft.CodeAnalysis;\n\n    public static partial class ITypeSymbolExtensions\n    {\n        private static readonly Func<ITypeSymbol, bool> IsTupleTypeAccessor;\n\n        static ITypeSymbolExtensions()\n        {\n            IsTupleTypeAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ITypeSymbol, bool>(typeof(ITypeSymbol), nameof(IsTupleType));\n        }\n\n        public static bool IsTupleType(this ITypeSymbol symbol)\n        {\n            return IsTupleTypeAccessor(symbol);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/LICENSE",
    "content": "MIT License\n\nCopyright (c) Tunnel Vision Laboratories, LLC\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/LightupHelpers.cs",
    "content": "﻿// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.\n// Licensed under the MIT License. See LICENSE in the project root for license information.\n\n#nullable disable\n\nnamespace StyleCop.Analyzers.Lightup\n{\n    using System;\n    using System.Collections.Concurrent;\n    using System.Collections.Immutable;\n    using System.Linq;\n    using System.Linq.Expressions;\n    using System.Reflection;\n    using Microsoft.CodeAnalysis;\n    using Microsoft.CodeAnalysis.CSharp;\n    using Roslyn.Utilities;\n\n    public static class LightupHelpers\n    {\n        private static readonly ConcurrentDictionary<Type, ConcurrentDictionary<Type, bool>> SupportedObjectWrappers\n            = new ConcurrentDictionary<Type, ConcurrentDictionary<Type, bool>>();\n\n        private static readonly ConcurrentDictionary<Type, ConcurrentDictionary<SyntaxKind, bool>> SupportedSyntaxWrappers\n            = new ConcurrentDictionary<Type, ConcurrentDictionary<SyntaxKind, bool>>();\n\n        private static readonly ConcurrentDictionary<Type, ConcurrentDictionary<OperationKind, bool>> SupportedOperationWrappers\n            = new ConcurrentDictionary<Type, ConcurrentDictionary<OperationKind, bool>>();\n\n        public static bool SupportsCSharp7 { get; }\n            = Enum.GetNames(typeof(LanguageVersion)).Contains(nameof(LanguageVersionEx.CSharp7));\n\n        public static bool SupportsCSharp71 { get; }\n            = Enum.GetNames(typeof(LanguageVersion)).Contains(nameof(LanguageVersionEx.CSharp7_1));\n\n        public static bool SupportsCSharp72 { get; }\n            = Enum.GetNames(typeof(LanguageVersion)).Contains(nameof(LanguageVersionEx.CSharp7_2));\n\n        public static bool SupportsCSharp73 { get; }\n            = Enum.GetNames(typeof(LanguageVersion)).Contains(nameof(LanguageVersionEx.CSharp7_3));\n\n        public static bool SupportsCSharp8 { get; }\n            = Enum.GetNames(typeof(LanguageVersion)).Contains(nameof(LanguageVersionEx.CSharp8));\n\n        public static bool SupportsCSharp9 { get; }\n            = Enum.GetNames(typeof(LanguageVersion)).Contains(nameof(LanguageVersionEx.CSharp9));\n\n        public static bool SupportsCSharp10 { get; }\n            = Enum.GetNames(typeof(LanguageVersion)).Contains(nameof(LanguageVersionEx.CSharp10));\n\n        public static bool SupportsCSharp11 { get; }\n            = Enum.GetNames(typeof(LanguageVersion)).Contains(nameof(LanguageVersionEx.CSharp11));\n\n        public static bool SupportsCSharp12 { get; }\n            = Enum.GetNames(typeof(LanguageVersion)).Contains(nameof(LanguageVersionEx.CSharp12));\n\n        public static bool SupportsIOperation => SupportsCSharp73;\n\n        [PerformanceSensitive(\"https://github.com/SonarSource/sonar-dotnet/issues/8106\", AllowCaptures = false, AllowGenericEnumeration = false, AllowImplicitBoxing = false)] // Sonar\n        internal static bool CanWrapObject(object obj, Type underlyingType)\n        {\n            if (obj == null)\n            {\n                // The wrappers support a null instance\n                return true;\n            }\n\n            if (underlyingType == null)\n            {\n                // The current runtime doesn't define the target type of the conversion, so no instance of it can exist\n                return false;\n            }\n\n            ConcurrentDictionary<Type, bool> wrappedObject = SupportedObjectWrappers.GetOrAdd(underlyingType, static _ => new ConcurrentDictionary<Type, bool>());\n\n            // Avoid creating a delegate and capture class\n            if (!wrappedObject.TryGetValue(obj.GetType(), out var canCast))\n            {\n                canCast = underlyingType.GetTypeInfo().IsAssignableFrom(obj.GetType().GetTypeInfo());\n                wrappedObject.TryAdd(obj.GetType(), canCast);\n            }\n\n            return canCast;\n        }\n\n        [PerformanceSensitive(\"https://github.com/SonarSource/sonar-dotnet/issues/8106\", AllowCaptures = false, AllowGenericEnumeration = false, AllowImplicitBoxing = false)] // Sonar\n        internal static bool CanWrapNode(SyntaxNode node, Type underlyingType)\n        {\n            if (node == null)\n            {\n                // The wrappers support a null instance\n                return true;\n            }\n\n            if (underlyingType == null)\n            {\n                // The current runtime doesn't define the target type of the conversion, so no instance of it can exist\n                return false;\n            }\n\n            ConcurrentDictionary<SyntaxKind, bool> wrappedSyntax = SupportedSyntaxWrappers.GetOrAdd(underlyingType, static _ => new ConcurrentDictionary<SyntaxKind, bool>());\n\n            // Avoid creating a delegate and capture class\n            if (!wrappedSyntax.TryGetValue(node.Kind(), out var canCast))\n            {\n                canCast = underlyingType.GetTypeInfo().IsAssignableFrom(node.GetType().GetTypeInfo());\n                wrappedSyntax.TryAdd(node.Kind(), canCast);\n            }\n\n            return canCast;\n        }\n\n        [PerformanceSensitive(\"https://github.com/SonarSource/sonar-dotnet/issues/8106\", AllowCaptures = false, AllowGenericEnumeration = false, AllowImplicitBoxing = false)] // Sonar\n        internal static bool CanWrapOperation(IOperation operation, Type underlyingType)\n        {\n            if (operation == null)\n            {\n                // The wrappers support a null instance\n                return true;\n            }\n\n            if (underlyingType == null)\n            {\n                // The current runtime doesn't define the target type of the conversion, so no instance of it can exist\n                return false;\n            }\n\n            ConcurrentDictionary<OperationKind, bool> wrappedSyntax = SupportedOperationWrappers.GetOrAdd(underlyingType, static _ => new ConcurrentDictionary<OperationKind, bool>());\n\n            // Avoid creating a delegate and capture class\n            // Sonar: https://learn.microsoft.com/en-us/dotnet/api/microsoft.codeanalysis.operationkind Loop && CaseClause are further differentiated by LoopKind & CaseKind, but are not castable between different Kinds which can result in InvalidCast Exceptions\n            if (!wrappedSyntax.TryGetValue(operation.Kind, out var canCast) || operation.Kind is OperationKindEx.Loop or OperationKindEx.CaseClause) // Sonar\n            {\n                canCast = underlyingType.GetTypeInfo().IsAssignableFrom(operation.GetType().GetTypeInfo());\n                wrappedSyntax.TryAdd(operation.Kind, canCast);\n            }\n\n            return canCast;\n        }\n\n        internal static Func<TOperation, TProperty> CreateOperationPropertyAccessor<TOperation, TProperty>(Type type, string propertyName)\n        {\n            TProperty FallbackAccessor(TOperation syntax)\n            {\n                if (syntax == null)\n                {\n                    // Unlike an extension method which would throw ArgumentNullException here, the light-up\n                    // behavior needs to match behavior of the underlying property.\n                    throw new NullReferenceException();\n                }\n\n                return default;\n            }\n\n            if (type == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (!typeof(TOperation).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var property = type.GetTypeInfo().GetDeclaredProperty(propertyName);\n            if (property == null)\n            {\n                return FallbackAccessor;\n            }\n\n            var operationParameter = Expression.Parameter(typeof(TOperation), \"operation\");\n            Expression instance =\n                type.GetTypeInfo().IsAssignableFrom(typeof(TOperation).GetTypeInfo())\n                ? (Expression)operationParameter\n                : Expression.Convert(operationParameter, type);\n\n            if (property.PropertyType.FullName == \"Microsoft.CodeAnalysis.FlowAnalysis.CaptureId\") // Sonar - begin\n            {\n                var constructor = typeof(CaptureId).GetConstructors().Single();\n\n                Expression<Func<TOperation, TProperty>> expression =\n                    Expression.Lambda<Func<TOperation, TProperty>>(\n                        Expression.New(constructor, Expression.Convert(Expression.Call(instance, property.GetMethod), typeof(object))),\n                        operationParameter);\n                return expression.Compile();\n            }\n            else if (typeof(TProperty).IsEnum && property.PropertyType.IsEnum)\n            {\n                Expression<Func<TOperation, TProperty>> expression =\n                    Expression.Lambda<Func<TOperation, TProperty>>(\n                        Expression.Convert(Expression.Call(instance, property.GetMethod), typeof(TProperty)),\n                        operationParameter);\n                return expression.Compile();\n            }\n            else if (!typeof(TProperty).GetTypeInfo().IsAssignableFrom(property.PropertyType.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n            else\n            {\n                Expression<Func<TOperation, TProperty>> expression =\n                    Expression.Lambda<Func<TOperation, TProperty>>(\n                        Expression.Call(instance, property.GetMethod),\n                        operationParameter);\n                return expression.Compile();\n            } // Sonar - end\n        }\n\n        internal static Func<TOperation, ImmutableArray<IOperation>> CreateOperationListPropertyAccessor<TOperation>(Type type, string propertyName)\n        {\n            ImmutableArray<IOperation> FallbackAccessor(TOperation syntax)\n            {\n                if (syntax == null)\n                {\n                    // Unlike an extension method which would throw ArgumentNullException here, the light-up\n                    // behavior needs to match behavior of the underlying property.\n                    throw new NullReferenceException();\n                }\n\n                return ImmutableArray<IOperation>.Empty;\n            }\n\n            if (type == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (!typeof(TOperation).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var property = type.GetTypeInfo().GetDeclaredProperty(propertyName);\n            if (property == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (property.PropertyType.GetGenericTypeDefinition() != typeof(ImmutableArray<>))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var propertyOperationType = property.PropertyType.GenericTypeArguments[0];\n\n            if (!typeof(IOperation).GetTypeInfo().IsAssignableFrom(propertyOperationType.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var syntaxParameter = Expression.Parameter(typeof(TOperation), \"syntax\");\n            Expression instance =\n                type.GetTypeInfo().IsAssignableFrom(typeof(TOperation).GetTypeInfo())\n                ? (Expression)syntaxParameter\n                : Expression.Convert(syntaxParameter, type);\n            Expression propertyAccess = Expression.Call(instance, property.GetMethod);\n\n            var unboundCastUpMethod = typeof(ImmutableArray<IOperation>).GetTypeInfo().GetDeclaredMethod(nameof(ImmutableArray<IOperation>.CastUp));\n            var boundCastUpMethod = unboundCastUpMethod.MakeGenericMethod(propertyOperationType);\n\n            Expression<Func<TOperation, ImmutableArray<IOperation>>> expression =\n                Expression.Lambda<Func<TOperation, ImmutableArray<IOperation>>>(\n                    Expression.Call(boundCastUpMethod, propertyAccess),\n                    syntaxParameter);\n            return expression.Compile();\n        }\n\n        internal static Func<TProperty> CreateStaticPropertyAccessor<TProperty>(Type type, string propertyName)\n        {\n            static TProperty FallbackAccessor()\n            {\n                return default;\n            }\n\n            if (type == null)\n            {\n                return FallbackAccessor;\n            }\n\n            var property = type.GetTypeInfo().GetDeclaredProperty(propertyName);\n            if (property == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (!typeof(TProperty).GetTypeInfo().IsAssignableFrom(property.PropertyType.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            Expression<Func<TProperty>> expression =\n                Expression.Lambda<Func<TProperty>>(\n                    Expression.Call(null, property.GetMethod));\n            return expression.Compile();\n        }\n\n        public static Func<TSyntax, TProperty> CreateSyntaxPropertyAccessor<TSyntax, TProperty>(Type type, string propertyName)\n        {\n            TProperty FallbackAccessor(TSyntax syntax)\n            {\n                if (syntax == null)\n                {\n                    // Unlike an extension method which would throw ArgumentNullException here, the light-up\n                    // behavior needs to match behavior of the underlying property.\n                    throw new NullReferenceException();\n                }\n\n                return default;\n            }\n\n            if (type == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (!typeof(TSyntax).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var property = type.GetTypeInfo().GetDeclaredProperty(propertyName);\n            if (property == null)\n            {\n                return FallbackAccessor;\n            }\n            var syntaxParameter = Expression.Parameter(typeof(TSyntax), \"syntax\"); // Sonar - begin\n            Expression instance =\n                type.GetTypeInfo().IsAssignableFrom(typeof(TSyntax).GetTypeInfo())\n                ? (Expression)syntaxParameter\n                : Expression.Convert(syntaxParameter, type);\n\n            Expression body = Expression.Call(instance, property.GetMethod);\n\n            if (!typeof(TProperty).GetTypeInfo().IsAssignableFrom(property.PropertyType.GetTypeInfo()))\n            {\n                body = Expression.Convert(body, typeof(TProperty));\n            }\n\n            return Expression.Lambda<Func<TSyntax, TProperty>>(body, syntaxParameter).Compile(); // Sonar - end\n        }\n\n        internal static Func<TSyntax, TArg, TProperty> CreateSyntaxPropertyAccessor<TSyntax, TArg, TProperty>(Type type, Type argumentType, string accessorMethodName)\n        {\n            static TProperty FallbackAccessor(TSyntax syntax, TArg argument)\n            {\n                if (syntax == null)\n                {\n                    // Unlike an extension method which would throw ArgumentNullException here, the light-up\n                    // behavior needs to match behavior of the underlying property.\n                    throw new NullReferenceException();\n                }\n\n                return default;\n            }\n\n            if (type == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (!typeof(TSyntax).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            if (!typeof(TArg).GetTypeInfo().IsAssignableFrom(argumentType.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var methods = type.GetTypeInfo().GetDeclaredMethods(accessorMethodName);\n            MethodInfo method = null;\n            foreach (var candidate in methods)\n            {\n                var parameters = candidate.GetParameters();\n                if (parameters.Length != 1)\n                {\n                    continue;\n                }\n\n                if (Equals(argumentType, parameters[0].ParameterType))\n                {\n                    method = candidate;\n                    break;\n                }\n            }\n\n            if (method == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (!typeof(TProperty).GetTypeInfo().IsAssignableFrom(method.ReturnType.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var syntaxParameter = Expression.Parameter(typeof(TSyntax), \"syntax\");\n            var argParameter = Expression.Parameter(typeof(TArg), \"arg\");\n            Expression instance =\n                type.GetTypeInfo().IsAssignableFrom(typeof(TSyntax).GetTypeInfo())\n                ? (Expression)syntaxParameter\n                : Expression.Convert(syntaxParameter, type);\n            Expression argument =\n                argumentType.GetTypeInfo().IsAssignableFrom(typeof(TArg).GetTypeInfo())\n                ? (Expression)argParameter\n                : Expression.Convert(argParameter, argumentType);\n\n            Expression<Func<TSyntax, TArg, TProperty>> expression =\n                Expression.Lambda<Func<TSyntax, TArg, TProperty>>(\n                    Expression.Call(instance, method, argument),\n                    syntaxParameter,\n                    argParameter);\n            return expression.Compile();\n        }\n\n        internal static TryGetValueAccessor<TSyntax, TKey, TValue> CreateTryGetValueAccessor<TSyntax, TKey, TValue>(Type type, Type keyType, string methodName)\n        {\n            static bool FallbackAccessor(TSyntax syntax, TKey key, out TValue value)\n            {\n                if (syntax == null)\n                {\n                    // Unlike an extension method which would throw ArgumentNullException here, the light-up\n                    // behavior needs to match behavior of the underlying property.\n                    throw new NullReferenceException();\n                }\n\n                value = default;\n                return false;\n            }\n\n            if (type == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (!typeof(TSyntax).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            if (!typeof(TKey).GetTypeInfo().IsAssignableFrom(keyType.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var methods = type.GetTypeInfo().GetDeclaredMethods(methodName);\n            MethodInfo method = null;\n            foreach (var candidate in methods)\n            {\n                var parameters = candidate.GetParameters();\n                if (parameters.Length != 2)\n                {\n                    continue;\n                }\n\n                if (Equals(keyType, parameters[0].ParameterType)\n                    && Equals(typeof(TValue).MakeByRefType(), parameters[1].ParameterType))\n                {\n                    method = candidate;\n                    break;\n                }\n            }\n\n            if (method == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (method.ReturnType != typeof(bool))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var syntaxParameter = Expression.Parameter(typeof(TSyntax), \"syntax\");\n            var keyParameter = Expression.Parameter(typeof(TKey), \"key\");\n            var valueParameter = Expression.Parameter(typeof(TValue).MakeByRefType(), \"value\");\n            Expression instance =\n                type.GetTypeInfo().IsAssignableFrom(typeof(TSyntax).GetTypeInfo())\n                ? (Expression)syntaxParameter\n                : Expression.Convert(syntaxParameter, type);\n            Expression key =\n                keyType.GetTypeInfo().IsAssignableFrom(typeof(TKey).GetTypeInfo())\n                ? (Expression)keyParameter\n                : Expression.Convert(keyParameter, keyType);\n\n            Expression<TryGetValueAccessor<TSyntax, TKey, TValue>> expression =\n                Expression.Lambda<TryGetValueAccessor<TSyntax, TKey, TValue>>(\n                    Expression.Call(instance, method, key, valueParameter),\n                    syntaxParameter,\n                    keyParameter,\n                    valueParameter);\n            return expression.Compile();\n        }\n\n        internal static TryGetValueAccessor<TSender, TFirst, TSecond, TValue> CreateTryGetValueAccessor<TSender, TFirst, TSecond, TValue>(Type type, Type firstType, Type secondType, string methodName) // Sonar\n        {\n            static bool FallbackAccessor(TSender sender, TFirst first, TSecond second, out TValue value)\n            {\n                if (sender == null)\n                {\n                    // Unlike an extension method which would throw ArgumentNullException here, the light-up\n                    // behavior needs to match behavior of the underlying property.\n                    throw new NullReferenceException();\n                }\n\n                value = default;\n                return false;\n            }\n\n            if (type == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (!typeof(TSender).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            if (!typeof(TFirst).GetTypeInfo().IsAssignableFrom(firstType.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            if (!typeof(TSecond).GetTypeInfo().IsAssignableFrom(secondType.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var methods = type.GetTypeInfo().GetDeclaredMethods(methodName);\n            MethodInfo method = null;\n            foreach (var candidate in methods)\n            {\n                var parameters = candidate.GetParameters();\n                if (parameters.Length != 4)\n                {\n                    continue;\n                }\n\n                if (Equals(firstType, parameters[0].ParameterType)\n                    && Equals(secondType, parameters[1].ParameterType)\n                    && Equals(typeof(TValue).MakeByRefType(), parameters[2].ParameterType))\n                {\n                    method = candidate;\n                    break;\n                }\n            }\n\n            if (method == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (method.ReturnType != typeof(bool))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var senderParameter = Expression.Parameter(typeof(TSender), \"sender\");\n            var firstParameter = Expression.Parameter(typeof(TFirst), \"first\");\n            var secondParameter = Expression.Parameter(typeof(TSecond), \"second\");\n            var valueParameter = Expression.Parameter(typeof(TValue).MakeByRefType(), \"value\");\n            Expression instance =\n                type.GetTypeInfo().IsAssignableFrom(typeof(TSender).GetTypeInfo())\n                ? (Expression)senderParameter\n                : Expression.Convert(senderParameter, type);\n            Expression first =\n                firstType.GetTypeInfo().IsAssignableFrom(typeof(TFirst).GetTypeInfo())\n                ? (Expression)firstParameter\n                : Expression.Convert(firstParameter, firstType);\n            Expression second =\n                secondType.GetTypeInfo().IsAssignableFrom(typeof(TSecond).GetTypeInfo())\n                ? (Expression)secondParameter\n                : Expression.Convert(secondParameter, secondType);\n\n            Expression<TryGetValueAccessor<TSender, TFirst, TSecond, TValue>> expression =\n                Expression.Lambda<TryGetValueAccessor<TSender, TFirst, TSecond, TValue>>(\n                    Expression.Call(instance, method, first, second, valueParameter),\n                    senderParameter,\n                    firstParameter,\n                    secondParameter,\n                    valueParameter);\n            return expression.Compile();\n        }\n\n        internal static TryGetValueAccessor<TSender, TFirst, TSecond, TThird, TValue> CreateTryGetValueAccessor<TSender, TFirst, TSecond, TThird, TValue>(Type type, Type firstType, Type secondType, Type thirdType, string methodName) // Sonar\n        {\n            static bool FallbackAccessor(TSender sender, TFirst first, TSecond second, TThird third, out TValue value)\n            {\n                if (sender == null)\n                {\n                    // Unlike an extension method which would throw ArgumentNullException here, the light-up\n                    // behavior needs to match behavior of the underlying property.\n                    throw new NullReferenceException();\n                }\n\n                value = default;\n                return false;\n            }\n\n            if (type == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (!typeof(TSender).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            if (!typeof(TFirst).GetTypeInfo().IsAssignableFrom(firstType.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            if (!typeof(TSecond).GetTypeInfo().IsAssignableFrom(secondType.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            if (!typeof(TThird).GetTypeInfo().IsAssignableFrom(thirdType.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var methods = type.GetTypeInfo().GetDeclaredMethods(methodName);\n            MethodInfo method = null;\n            foreach (var candidate in methods)\n            {\n                var parameters = candidate.GetParameters();\n                if (parameters.Length != 4)\n                {\n                    continue;\n                }\n\n                if (Equals(firstType, parameters[0].ParameterType)\n                    && Equals(secondType, parameters[1].ParameterType)\n                    && Equals(thirdType, parameters[2].ParameterType)\n                    && Equals(typeof(TValue).MakeByRefType(), parameters[3].ParameterType))\n                {\n                    method = candidate;\n                    break;\n                }\n            }\n\n            if (method == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (method.ReturnType != typeof(bool))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var senderParameter = Expression.Parameter(typeof(TSender), \"sender\");\n            var firstParameter = Expression.Parameter(typeof(TFirst), \"first\");\n            var secondParameter = Expression.Parameter(typeof(TSecond), \"second\");\n            var thirdParameter = Expression.Parameter(typeof(TThird), \"third\");\n            var valueParameter = Expression.Parameter(typeof(TValue).MakeByRefType(), \"value\");\n            Expression instance =\n                type.GetTypeInfo().IsAssignableFrom(typeof(TSender).GetTypeInfo())\n                ? (Expression)senderParameter\n                : Expression.Convert(senderParameter, type);\n            Expression first =\n                firstType.GetTypeInfo().IsAssignableFrom(typeof(TFirst).GetTypeInfo())\n                ? (Expression)firstParameter\n                : Expression.Convert(firstParameter, firstType);\n            Expression second =\n                secondType.GetTypeInfo().IsAssignableFrom(typeof(TSecond).GetTypeInfo())\n                ? (Expression)secondParameter\n                : Expression.Convert(secondParameter, secondType);\n            Expression third =\n                thirdType.GetTypeInfo().IsAssignableFrom(typeof(TThird).GetTypeInfo())\n                ? (Expression)thirdParameter\n                : Expression.Convert(thirdParameter, thirdType);\n\n            Expression<TryGetValueAccessor<TSender, TFirst, TSecond, TThird, TValue>> expression =\n                Expression.Lambda<TryGetValueAccessor<TSender, TFirst, TSecond, TThird, TValue>>(\n                    Expression.Call(instance, method, first, second, third, valueParameter),\n                    senderParameter,\n                    firstParameter,\n                    secondParameter,\n                    thirdParameter,\n                    valueParameter);\n            return expression.Compile();\n        }\n\n        internal static Func<TSyntax, SeparatedSyntaxListWrapper<TProperty>> CreateSeparatedSyntaxListPropertyAccessor<TSyntax, TProperty>(Type type, string propertyName)\n        {\n            SeparatedSyntaxListWrapper<TProperty> FallbackAccessor(TSyntax syntax)\n            {\n                if (syntax == null)\n                {\n                    // Unlike an extension method which would throw ArgumentNullException here, the light-up\n                    // behavior needs to match behavior of the underlying property.\n                    throw new NullReferenceException();\n                }\n\n                return SeparatedSyntaxListWrapper<TProperty>.UnsupportedEmpty;\n            }\n\n            if (type == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (!typeof(TSyntax).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var property = type.GetTypeInfo().GetDeclaredProperty(propertyName);\n            if (property == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (property.PropertyType.GetGenericTypeDefinition() != typeof(SeparatedSyntaxList<>))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var propertySyntaxType = property.PropertyType.GenericTypeArguments[0];\n\n            if (!ValidatePropertyType(typeof(TProperty), propertySyntaxType))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var syntaxParameter = Expression.Parameter(typeof(TSyntax), \"syntax\");\n            Expression instance =\n                type.GetTypeInfo().IsAssignableFrom(typeof(TSyntax).GetTypeInfo())\n                ? (Expression)syntaxParameter\n                : Expression.Convert(syntaxParameter, type);\n            Expression propertyAccess = Expression.Call(instance, property.GetMethod);\n\n            var unboundWrapperType = typeof(SeparatedSyntaxListWrapper<>.AutoWrapSeparatedSyntaxList<>);\n            var boundWrapperType = unboundWrapperType.MakeGenericType(typeof(TProperty), propertySyntaxType);\n            var constructorInfo = boundWrapperType.GetTypeInfo().DeclaredConstructors.Single(constructor => constructor.GetParameters().Length == 1);\n\n            Expression<Func<TSyntax, SeparatedSyntaxListWrapper<TProperty>>> expression =\n                Expression.Lambda<Func<TSyntax, SeparatedSyntaxListWrapper<TProperty>>>(\n                    Expression.New(constructorInfo, propertyAccess),\n                    syntaxParameter);\n            return expression.Compile();\n        }\n\n        internal static Func<TSyntax, TProperty, TSyntax> CreateSyntaxWithPropertyAccessor<TSyntax, TProperty>(Type type, string propertyName)\n        {\n            TSyntax FallbackAccessor(TSyntax syntax, TProperty newValue)\n            {\n                if (syntax == null)\n                {\n                    // Unlike an extension method which would throw ArgumentNullException here, the light-up\n                    // behavior needs to match behavior of the underlying property.\n                    throw new NullReferenceException();\n                }\n\n                if (Equals(newValue, default(TProperty)))\n                {\n                    return syntax;\n                }\n\n                throw new NotSupportedException();\n            }\n\n            if (type == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (!typeof(TSyntax).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var property = type.GetTypeInfo().GetDeclaredProperty(propertyName);\n            if (property == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (!typeof(TProperty).GetTypeInfo().IsAssignableFrom(property.PropertyType.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var methodInfo = type.GetTypeInfo().GetDeclaredMethods(\"With\" + propertyName)\n                .SingleOrDefault(m => !m.IsStatic && m.GetParameters().Length == 1 && m.GetParameters()[0].ParameterType.Equals(property.PropertyType));\n            if (methodInfo is null)\n            {\n                return FallbackAccessor;\n            }\n\n            var syntaxParameter = Expression.Parameter(typeof(TSyntax), \"syntax\");\n            var valueParameter = Expression.Parameter(typeof(TProperty), methodInfo.GetParameters()[0].Name);\n            Expression instance =\n                type.GetTypeInfo().IsAssignableFrom(typeof(TSyntax).GetTypeInfo())\n                ? (Expression)syntaxParameter\n                : Expression.Convert(syntaxParameter, type);\n            Expression value =\n                property.PropertyType.GetTypeInfo().IsAssignableFrom(typeof(TProperty).GetTypeInfo())\n                ? (Expression)valueParameter\n                : Expression.Convert(valueParameter, property.PropertyType);\n\n            Expression<Func<TSyntax, TProperty, TSyntax>> expression =\n                Expression.Lambda<Func<TSyntax, TProperty, TSyntax>>(\n                    Expression.Call(instance, methodInfo, value),\n                    syntaxParameter,\n                    valueParameter);\n            return expression.Compile();\n        }\n\n        internal static Func<TSyntax, SeparatedSyntaxListWrapper<TProperty>, TSyntax> CreateSeparatedSyntaxListWithPropertyAccessor<TSyntax, TProperty>(Type type, string propertyName)\n        {\n            TSyntax FallbackAccessor(TSyntax syntax, SeparatedSyntaxListWrapper<TProperty> newValue)\n            {\n                if (syntax == null)\n                {\n                    // Unlike an extension method which would throw ArgumentNullException here, the light-up\n                    // behavior needs to match behavior of the underlying property.\n                    throw new NullReferenceException();\n                }\n\n                if (newValue is null)\n                {\n                    return syntax;\n                }\n\n                throw new NotSupportedException();\n            }\n\n            if (type == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (!typeof(TSyntax).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo()))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var property = type.GetTypeInfo().GetDeclaredProperty(propertyName);\n            if (property == null)\n            {\n                return FallbackAccessor;\n            }\n\n            if (property.PropertyType.GetGenericTypeDefinition() != typeof(SeparatedSyntaxList<>))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var propertySyntaxType = property.PropertyType.GenericTypeArguments[0];\n\n            if (!ValidatePropertyType(typeof(TProperty), propertySyntaxType))\n            {\n                throw new InvalidOperationException();\n            }\n\n            var methodInfo = type.GetTypeInfo().GetDeclaredMethods(\"With\" + propertyName)\n                .Single(m => !m.IsStatic && m.GetParameters().Length == 1 && m.GetParameters()[0].ParameterType.Equals(property.PropertyType));\n\n            var syntaxParameter = Expression.Parameter(typeof(TSyntax), \"syntax\");\n            var valueParameter = Expression.Parameter(typeof(SeparatedSyntaxListWrapper<TProperty>), methodInfo.GetParameters()[0].Name);\n            Expression instance =\n                type.GetTypeInfo().IsAssignableFrom(typeof(TSyntax).GetTypeInfo())\n                ? (Expression)syntaxParameter\n                : Expression.Convert(syntaxParameter, type);\n\n            var underlyingListProperty = typeof(SeparatedSyntaxListWrapper<TProperty>).GetTypeInfo().GetDeclaredProperty(nameof(SeparatedSyntaxListWrapper<TProperty>.UnderlyingList));\n            Expression value = Expression.Convert(\n                Expression.Call(valueParameter, underlyingListProperty.GetMethod),\n                property.PropertyType);\n\n            Expression<Func<TSyntax, SeparatedSyntaxListWrapper<TProperty>, TSyntax>> expression =\n                Expression.Lambda<Func<TSyntax, SeparatedSyntaxListWrapper<TProperty>, TSyntax>>(\n                    Expression.Call(instance, methodInfo, value),\n                    syntaxParameter,\n                    valueParameter);\n            return expression.Compile();\n        }\n\n        private static bool ValidatePropertyType(Type returnType, Type actualType)\n        {\n            var requiredType = SyntaxWrapperHelper.GetWrappedType(returnType) ?? returnType;\n            return requiredType == actualType;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/OperationInterfaces.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->\n<Tree Root=\"IOperation\">\n\n  <!--\n      To regenerate the operation nodes, run eng/generate-compiler-code.cmd\n\n      The operations in this file are _ordered_! If you change the order in here,\n      you will affect the ordering in the generated OperationKind enum, which will\n      break the public api analyzer. All new types should be put at the end of this\n      file in order to ensure that the kind does not continue to change.\n\n      UnusedOperationKinds indicates kinds that are currently skipped by the OperationKind\n      enum. They can be used by future nodes by inserting those nodes at the correct point\n      in the list.\n\n      When implementing new operations, run tests with additional IOperation validation enabled.\n      You can test with `Build.cmd -testIOperation`.\n      Or to repro in VS, you can do `set ROSLYN_TEST_IOPERATION=true` then `devenv`.\n        -->\n\n  <UnusedOperationKinds>\n    <Entry Value=\"0x1D\"/>\n    <Entry Value=\"0x62\"/>\n    <Entry Value=\"0x64\"/>\n  </UnusedOperationKinds>\n\n  <Node Name=\"IInvalidOperation\" Base=\"IOperation\" SkipClassGeneration=\"true\">\n    <Comments>\n      <summary>\n        Represents an invalid operation with one or more child operations.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# invalid expression or invalid statement</description></item>\n          <item><description>VB invalid expression or invalid statement</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n  </Node>\n  <Node Name=\"IBlockOperation\" Base=\"IOperation\">\n    <Comments>\n      <summary>\n        Represents a block containing a sequence of operations and local declarations.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# \"{ ... }\" block statement</description></item>\n          <item><description>VB implicit block statement for method bodies and other block scoped statements</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Operations\" Type=\"ImmutableArray&lt;IOperation&gt;\">\n      <Comments>\n        <summary>Operations contained within the block.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Locals\" Type=\"ImmutableArray&lt;ILocalSymbol&gt;\">\n      <Comments>\n        <summary>Local declarations contained within the block.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IVariableDeclarationGroupOperation\" Base=\"IOperation\">\n    <Comments>\n      <summary>\n        Represents a variable declaration statement.\n        <para>\n        Current Usage:\n        <list type=\"number\">\n          <item><description>C# local declaration statement</description></item>\n          <item><description>C# fixed statement</description></item>\n          <item><description>C# using statement</description></item>\n          <item><description>C# using declaration</description></item>\n          <item><description>VB Dim statement</description></item>\n          <item><description>VB Using statement</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Declarations\" Type=\"ImmutableArray&lt;IVariableDeclarationOperation&gt;\">\n      <Comments>\n        <summary>Variable declaration in the statement.</summary>\n        <remarks>\n          In C#, this will always be a single declaration, with all variables in <see cref=\"IVariableDeclarationOperation.Declarators\" />.\n        </remarks>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"ISwitchOperation\" Base=\"IOperation\" ChildrenOrder=\"Value,Cases\">\n    <Comments>\n      <summary>\n        Represents a switch operation with a value to be switched upon and switch cases.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# switch statement</description></item>\n          <item><description>VB Select Case statement</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Locals\" Type=\"ImmutableArray&lt;ILocalSymbol&gt;\">\n      <Comments>\n        <summary>\n          Locals declared within the switch operation with scope spanning across all <see cref=\"Cases\" />.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Value\" Type=\"IOperation\">\n      <Comments>\n        <summary>Value to be switched upon.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Cases\" Type=\"ImmutableArray&lt;ISwitchCaseOperation&gt;\">\n      <Comments>\n        <summary>Cases of the switch.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"ExitLabel\" Type=\"ILabelSymbol\">\n      <Comments>\n        <summary>Exit label for the switch statement.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <AbstractNode Name=\"ILoopOperation\" Base=\"IOperation\">\n    <OperationKind Include=\"true\" ExtraDescription=\"This is further differentiated by &lt;see cref=&quot;ILoopOperation.LoopKind&quot;/&gt;.\" />\n    <Comments>\n      <summary>\n        Represents a loop operation.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# 'while', 'for', 'foreach' and 'do' loop statements</description></item>\n          <item><description>VB 'While', 'ForTo', 'ForEach', 'Do While' and 'Do Until' loop statements</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"LoopKind\" Type=\"LoopKind\" MakeAbstract=\"true\">\n      <Comments>\n        <summary>Kind of the loop.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Body\" Type=\"IOperation\">\n      <Comments>\n        <summary>Body of the loop.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Locals\" Type=\"ImmutableArray&lt;ILocalSymbol&gt;\">\n      <Comments>\n        <summary>Declared locals.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"ContinueLabel\" Type=\"ILabelSymbol\">\n      <Comments>\n        <summary>Loop continue label.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"ExitLabel\" Type=\"ILabelSymbol\">\n      <Comments>\n        <summary>Loop exit/break label.</summary>\n      </Comments>\n    </Property>\n  </AbstractNode>\n  <Node Name=\"IForEachLoopOperation\" Base=\"ILoopOperation\" ChildrenOrder=\"Collection,LoopControlVariable,Body,NextVariables\">\n    <OperationKind Include=\"false\" />\n    <Comments>\n      <summary>\n        Represents a for each loop.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# 'foreach' loop statement</description></item>\n          <item><description>VB 'For Each' loop statement</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"LoopControlVariable\" Type=\"IOperation\">\n      <Comments>\n        <summary>Refers to the operation for declaring a new local variable or reference an existing variable or an expression.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Collection\" Type=\"IOperation\">\n      <Comments>\n        <summary>Collection value over which the loop iterates.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"NextVariables\" Type=\"ImmutableArray&lt;IOperation&gt;\">\n      <Comments>\n        <summary>\n          Optional list of comma separated next variables at loop bottom in VB.\n          This list is always empty for C#.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Info\" Type=\"ForEachLoopOperationInfo?\" Internal=\"true\" />\n    <Property Name=\"IsAsynchronous\" Type=\"bool\">\n      <Comments>\n        <summary>\n          Whether this for each loop is asynchronous.\n          Always false for VB.\n        </summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IForLoopOperation\" Base=\"ILoopOperation\" ChildrenOrder=\"Before,Condition,Body,AtLoopBottom\">\n    <OperationKind Include=\"false\" />\n    <Comments>\n      <summary>\n        Represents a for loop.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# 'for' loop statement</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Before\" Type=\"ImmutableArray&lt;IOperation&gt;\">\n      <Comments>\n        <summary>List of operations to execute before entry to the loop. For C#, this comes from the first clause of the for statement.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"ConditionLocals\" Type=\"ImmutableArray&lt;ILocalSymbol&gt;\">\n      <Comments>\n        <summary>\n          Locals declared within the loop Condition and are in scope throughout the <see cref=\"Condition\" />,\n          <see cref=\"ILoopOperation.Body\" /> and <see cref=\"AtLoopBottom\" />.\n          They are considered to be declared per iteration.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Condition\" Type=\"IOperation?\">\n      <Comments>\n        <summary>Condition of the loop. For C#, this comes from the second clause of the for statement.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"AtLoopBottom\" Type=\"ImmutableArray&lt;IOperation&gt;\">\n      <Comments>\n        <summary>List of operations to execute at the bottom of the loop. For C#, this comes from the third clause of the for statement.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IForToLoopOperation\" Base=\"ILoopOperation\" ChildrenOrder=\"LoopControlVariable,InitialValue,LimitValue,StepValue,Body,NextVariables\">\n    <OperationKind Include=\"false\" />\n    <Comments>\n      <summary>\n        Represents a for to loop with loop control variable and initial, limit and step values for the control variable.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>VB 'For ... To ... Step' loop statement</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"LoopControlVariable\" Type=\"IOperation\">\n      <Comments>\n        <summary>Refers to the operation for declaring a new local variable or reference an existing variable or an expression.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"InitialValue\" Type=\"IOperation\">\n      <Comments>\n        <summary>Operation for setting the initial value of the loop control variable. This comes from the expression between the 'For' and 'To' keywords.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"LimitValue\" Type=\"IOperation\">\n      <Comments>\n        <summary>Operation for the limit value of the loop control variable. This comes from the expression after the 'To' keyword.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"StepValue\" Type=\"IOperation\">\n      <Comments>\n        <summary>\n          Operation for the step value of the loop control variable. This comes from the expression after the 'Step' keyword,\n          or inferred by the compiler if 'Step' clause is omitted.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"IsChecked\" Type=\"bool\">\n      <Comments>\n        <summary>\n          <see langword=\"true\" /> if arithmetic operations behind this loop are 'checked'.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"NextVariables\" Type=\"ImmutableArray&lt;IOperation&gt;\">\n      <Comments>\n        <summary>Optional list of comma separated next variables at loop bottom.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Info\"  Type=\"(ILocalSymbol LoopObject, ForToLoopOperationUserDefinedInfo UserDefinedInfo)\" Internal=\"true\" />\n  </Node>\n  <Node Name=\"IWhileLoopOperation\" Base=\"ILoopOperation\" SkipChildrenGeneration=\"true\">\n    <OperationKind Include=\"false\" />\n    <Comments>\n      <summary>\n        Represents a while or do while loop.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# 'while' and 'do while' loop statements</description></item>\n          <item><description>VB 'While', 'Do While' and 'Do Until' loop statements</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Condition\" Type=\"IOperation?\">\n      <Comments>\n        <summary>Condition of the loop. This can only be null in error scenarios.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"ConditionIsTop\" Type=\"bool\">\n      <Comments>\n        <summary>\n          True if the <see cref=\"Condition\" /> is evaluated at start of each loop iteration.\n          False if it is evaluated at the end of each loop iteration.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"ConditionIsUntil\" Type=\"bool\">\n      <Comments>\n        <summary>True if the loop has 'Until' loop semantics and the loop is executed while <see cref=\"Condition\" /> is false.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"IgnoredCondition\" Type=\"IOperation?\">\n      <Comments>\n        <summary>\n          Additional conditional supplied for loop in error cases, which is ignored by the compiler.\n          For example, for VB 'Do While' or 'Do Until' loop with syntax errors where both the top and bottom conditions are provided.\n          The top condition is preferred and exposed as <see cref=\"Condition\" /> and the bottom condition is ignored and exposed by this property.\n          This property should be null for all non-error cases.\n        </summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"ILabeledOperation\" Base=\"IOperation\">\n    <Comments>\n      <summary>\n        Represents an operation with a label.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# labeled statement</description></item>\n          <item><description>VB label statement</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Label\" Type=\"ILabelSymbol\">\n      <Comments>\n        <summary>Label that can be the target of branches.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Operation\" Type=\"IOperation?\">\n      <Comments>\n        <summary>Operation that has been labeled. In VB, this is always null.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IBranchOperation\" Base=\"IOperation\">\n    <Comments>\n      <summary>\n        Represents a branch operation.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# goto, break, or continue statement</description></item>\n          <item><description>VB GoTo, Exit ***, or Continue *** statement</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Target\" Type=\"ILabelSymbol\">\n      <Comments>\n        <summary>Label that is the target of the branch.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"BranchKind\" Type=\"BranchKind\">\n      <Comments>\n        <summary>Kind of the branch.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IEmptyOperation\" Base=\"IOperation\">\n    <Comments>\n      <summary>\n        Represents an empty or no-op operation.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# empty statement</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n  </Node>\n  <Node Name=\"IReturnOperation\" Base=\"IOperation\">\n    <OperationKind>\n      <Entry Name=\"Return\" Value=\"0x9\"/>\n      <Entry Name=\"YieldBreak\" Value=\"0xa\" ExtraDescription=\"This has yield break semantics.\"/>\n      <Entry Name=\"YieldReturn\" Value=\"0xe\" ExtraDescription=\"This has yield return semantics.\"/>\n    </OperationKind>\n    <Comments>\n      <summary>\n        Represents a return from the method with an optional return value.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# return statement and yield statement</description></item>\n          <item><description>VB Return statement</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"ReturnedValue\" Type=\"IOperation?\">\n      <Comments>\n        <summary>Value to be returned.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"ILockOperation\" Base=\"IOperation\" ChildrenOrder=\"LockedValue,Body\">\n    <Comments>\n      <summary>\n        Represents a <see cref=\"Body\" /> of operations that are executed while holding a lock onto the <see cref=\"LockedValue\" />.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# lock statement</description></item>\n          <item><description>VB SyncLock statement</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"LockedValue\" Type=\"IOperation\">\n      <Comments>\n        <summary>Operation producing a value to be locked.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Body\" Type=\"IOperation\">\n      <Comments>\n        <summary>Body of the lock, to be executed while holding the lock.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"LockTakenSymbol\" Type=\"ILocalSymbol?\" Internal=\"true\"/>\n  </Node>\n  <Node Name=\"ITryOperation\" Base=\"IOperation\" ChildrenOrder=\"Body,Catches,Finally\">\n    <Comments>\n      <summary>\n        Represents a try operation for exception handling code with a body, catch clauses and a finally handler.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# try statement</description></item>\n          <item><description>VB Try statement</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Body\" Type=\"IBlockOperation\">\n      <Comments>\n        <summary>Body of the try, over which the handlers are active.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Catches\" Type=\"ImmutableArray&lt;ICatchClauseOperation&gt;\">\n      <Comments>\n        <summary>Catch clauses of the try.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Finally\" Type=\"IBlockOperation?\">\n      <Comments>\n        <summary>Finally handler of the try.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"ExitLabel\" Type=\"ILabelSymbol?\">\n      <Comments>\n        <summary>Exit label for the try. This will always be null for C#.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IUsingOperation\" Base=\"IOperation\" ChildrenOrder=\"Resources,Body\">\n    <Comments>\n      <summary>\n        Represents a <see cref=\"Body\" /> of operations that are executed while using disposable <see cref=\"Resources\" />.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# using statement</description></item>\n          <item><description>VB Using statement</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Resources\" Type=\"IOperation\">\n      <Comments>\n        <summary>Declaration introduced or resource held by the using.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Body\" Type=\"IOperation\">\n      <Comments>\n        <summary>Body of the using, over which the resources of the using are maintained.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Locals\" Type=\"ImmutableArray&lt;ILocalSymbol&gt;\">\n      <Comments>\n        <summary>\n          Locals declared within the <see cref=\"Resources\" /> with scope spanning across this entire <see cref=\"IUsingOperation\" />.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"IsAsynchronous\" Type=\"bool\">\n      <Comments>\n        <summary>\n          Whether this using is asynchronous.\n          Always false for VB.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"DisposeInfo\" Type=\"DisposeOperationInfo\" Internal=\"true\">\n      <Comments>\n        <summary>Information about the method that will be invoked to dispose the <see cref=\"Resources\" /> when pattern based disposal is used.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IExpressionStatementOperation\" Base=\"IOperation\">\n    <Comments>\n      <summary>\n        Represents an operation that drops the resulting value and the type of the underlying wrapped <see cref=\"Operation\" />.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# expression statement</description></item>\n          <item><description>VB expression statement</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Operation\" Type=\"IOperation\">\n      <Comments>\n        <summary>Underlying operation with a value and type.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"ILocalFunctionOperation\" Base=\"IOperation\" ChildrenOrder=\"Body,IgnoredBody\">\n    <Comments>\n      <summary>\n        Represents a local function defined within a method.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# local function statement</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Symbol\" Type=\"IMethodSymbol\">\n      <Comments>\n        <summary>Local function symbol.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Body\" Type=\"IBlockOperation?\">\n      <Comments>\n        <summary>Body of the local function.</summary>\n        <remarks>This can be null in error scenarios, or when the method is an extern method.</remarks>\n      </Comments>\n    </Property>\n    <Property Name=\"IgnoredBody\" Type=\"IBlockOperation?\">\n      <Comments>\n        <summary>An extra body for the local function, if both a block body and expression body are specified in source.</summary>\n        <remarks>This is only ever non-null in error situations.</remarks>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IStopOperation\" Base=\"IOperation\">\n    <Comments>\n      <summary>\n        Represents an operation to stop or suspend execution of code.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>VB Stop statement</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n  </Node>\n  <Node Name=\"IEndOperation\" Base=\"IOperation\">\n    <Comments>\n      <summary>\n        Represents an operation that stops the execution of code abruptly.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>VB End Statement</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n  </Node>\n  <Node Name=\"IRaiseEventOperation\" Base=\"IOperation\" ChildrenOrder=\"EventReference,Arguments\">\n    <Comments>\n      <summary>\n        Represents an operation for raising an event.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>VB raise event statement</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"EventReference\" Type=\"IEventReferenceOperation\">\n      <Comments>\n        <summary>Reference to the event to be raised.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Arguments\" Type=\"ImmutableArray&lt;IArgumentOperation&gt;\">\n      <Comments>\n        <summary>Arguments of the invocation, excluding the instance argument. Arguments are in evaluation order.</summary>\n        <remarks>\n          If the invocation is in its expanded form, then params/ParamArray arguments would be collected into arrays.\n          Default values are supplied for optional arguments missing in source.\n        </remarks>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"ILiteralOperation\" Base=\"IOperation\" HasType=\"true\" HasConstantValue=\"true\">\n    <Comments>\n      <summary>\n        Represents a textual literal numeric, string, etc.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# literal expression</description></item>\n          <item><description>VB literal expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n  </Node>\n  <Node Name=\"IConversionOperation\" Base=\"IOperation\" HasType=\"true\" HasConstantValue=\"true\">\n    <Comments>\n      <summary>\n        Represents a type conversion.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# conversion expression</description></item>\n          <item><description>VB conversion expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Operand\" Type=\"IOperation\">\n      <Comments>\n        <summary>Value to be converted.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"OperatorMethod\" Type=\"IMethodSymbol?\" SkipGeneration=\"true\">\n      <Comments>\n        <summary>Operator method used by the operation, null if the operation does not use an operator method.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"ConstrainedToType\" Type=\"ITypeSymbol?\" SkipGeneration=\"true\">\n      <Comments>\n        <summary>\n          Type parameter which runtime type will be used to resolve virtual invocation of the <see cref=\"OperatorMethod\" />, if any.\n          Null if <see cref=\"OperatorMethod\" /> is resolved statically, or is null.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Conversion\" Type=\"CommonConversion\">\n      <Comments>\n        <summary>Gets the underlying common conversion information.</summary>\n        <remarks>\n          If you need conversion information that is language specific, use either\n          <see cref=\"T:Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetConversion(IConversionOperation)\" /> or\n          <see cref=\"T:Microsoft.CodeAnalysis.VisualBasic.VisualBasicExtensions.GetConversion(IConversionOperation)\" />.\n        </remarks>\n      </Comments>\n    </Property>\n    <Property Name=\"IsTryCast\" Type=\"bool\">\n      <Comments>\n        <summary>\n          False if the conversion will fail with a <see cref=\"InvalidCastException\" /> at runtime if the cast fails. This is true for C#'s\n          <c>as</c> operator and for VB's <c>TryCast</c> operator.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"IsChecked\" Type=\"bool\">\n      <Comments>\n        <summary>True if the conversion can fail at runtime with an overflow exception. This corresponds to C# checked and unchecked blocks.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IInvocationOperation\" Base=\"IOperation\" ChildrenOrder=\"Instance,Arguments\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents an invocation of a method.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# method invocation expression</description></item>\n          <item>\n            <description>\n              C# collection element initializer.\n              For example, in the following collection initializer: <c>new C() { 1, 2, 3 }</c>, we will have\n              3 <see cref=\"IInvocationOperation\" /> nodes, each of which will be a call to the corresponding <c>Add</c> method\n              with either 1, 2, 3 as the argument\n            </description>\n          </item>\n          <item><description>VB method invocation expression</description></item>\n          <item>\n            <description>\n              VB collection element initializer.\n              Similar to the C# example, <c>New C() From {1, 2, 3}</c> will have 3 <see cref=\"IInvocationOperation\" />\n              nodes with 1, 2, and 3 as their arguments, respectively\n            </description>\n          </item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"TargetMethod\" Type=\"IMethodSymbol\">\n      <Comments>\n        <summary>Method to be invoked.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"ConstrainedToType\" Type=\"ITypeSymbol?\">\n      <Comments>\n        <summary>\n          Type parameter which runtime type will be used to resolve virtual invocation of the <see cref=\"TargetMethod\" />.\n          Null if <see cref=\"TargetMethod\" /> is resolved statically, or is an instance method.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Instance\" Type=\"IOperation?\">\n      <Comments>\n        <summary>'This' or 'Me' instance to be supplied to the method, or null if the method is static.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"IsVirtual\" Type=\"bool\">\n      <Comments>\n        <summary>True if the invocation uses a virtual mechanism, and false otherwise.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Arguments\" Type=\"ImmutableArray&lt;IArgumentOperation&gt;\">\n      <Comments>\n        <summary>Arguments of the invocation, excluding the instance argument. Arguments are in evaluation order.</summary>\n        <remarks>\n          If the invocation is in its expanded form, then params/ParamArray arguments would be collected into arrays.\n          Default values are supplied for optional arguments missing in source.\n        </remarks>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IArrayElementReferenceOperation\" Base=\"IOperation\" ChildrenOrder=\"ArrayReference,Indices\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents a reference to an array element.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# array element reference expression</description></item>\n          <item><description>VB array element reference expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"ArrayReference\" Type=\"IOperation\">\n      <Comments>\n        <summary>Array to be indexed.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Indices\" Type=\"ImmutableArray&lt;IOperation&gt;\">\n      <Comments>\n        <summary>Indices that specify an individual element.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"ILocalReferenceOperation\" Base=\"IOperation\" HasType=\"true\" HasConstantValue=\"true\">\n    <Comments>\n      <summary>\n        Represents a reference to a declared local variable.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# local reference expression</description></item>\n          <item><description>VB local reference expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Local\" Type=\"ILocalSymbol\">\n      <Comments>\n        <summary>Referenced local variable.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"IsDeclaration\" Type=\"bool\">\n      <Comments>\n        <summary>\n          True if this reference is also the declaration site of this variable. This is true in out variable declarations\n          and in deconstruction operations where a new variable is being declared.\n        </summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IParameterReferenceOperation\" Base=\"IOperation\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents a reference to a parameter.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# parameter reference expression</description></item>\n          <item><description>VB parameter reference expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Parameter\" Type=\"IParameterSymbol\">\n      <Comments>\n        <summary>Referenced parameter.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <AbstractNode Name=\"IMemberReferenceOperation\" Base=\"IOperation\" >\n    <Comments>\n      <summary>\n        Represents a reference to a member of a class, struct, or interface.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# member reference expression</description></item>\n          <item><description>VB member reference expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Instance\" Type=\"IOperation?\">\n      <Comments>\n        <summary>Instance of the type. Null if the reference is to a static/shared member.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Member\" Type=\"ISymbol\" SkipGeneration=\"true\">\n      <Comments>\n        <summary>Referenced member.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"ConstrainedToType\" Type=\"ITypeSymbol?\" MakeAbstract=\"true\">\n      <Comments>\n        <summary>\n          Type parameter which runtime type will be used to resolve virtual invocation of the <see cref=\"Member\" />.\n          Null if <see cref=\"Member\" /> is resolved statically, or is an instance member.\n        </summary>\n      </Comments>\n    </Property>\n  </AbstractNode>\n  <Node Name=\"IFieldReferenceOperation\" Base=\"IMemberReferenceOperation\" HasType=\"true\" HasConstantValue=\"true\">\n    <Comments>\n      <summary>\n        Represents a reference to a field.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# field reference expression</description></item>\n          <item><description>VB field reference expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Field\" Type=\"IFieldSymbol\">\n      <Comments>\n        <summary>Referenced field.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"IsDeclaration\" Type=\"bool\">\n      <Comments>\n        <summary>If the field reference is also where the field was declared.</summary>\n        <remarks>\n          This is only ever true in CSharp scripts, where a top-level statement creates a new variable\n          in a reference, such as an out variable declaration or a deconstruction declaration.\n        </remarks>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IMethodReferenceOperation\" Base=\"IMemberReferenceOperation\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents a reference to a method other than as the target of an invocation.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# method reference expression</description></item>\n          <item><description>VB method reference expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Method\" Type=\"IMethodSymbol\">\n      <Comments>\n        <summary>Referenced method.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"ConstrainedToType\" Type=\"ITypeSymbol?\" Override=\"true\"/>\n    <Property Name=\"IsVirtual\" Type=\"bool\">\n      <Comments>\n        <summary>Indicates whether the reference uses virtual semantics.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IPropertyReferenceOperation\" Base=\"IMemberReferenceOperation\" ChildrenOrder=\"Instance,Arguments\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents a reference to a property.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# property reference expression</description></item>\n          <item><description>VB property reference expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Property\" Type=\"IPropertySymbol\">\n      <Comments>\n        <summary>Referenced property.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"ConstrainedToType\" Type=\"ITypeSymbol?\" Override=\"true\"/>\n    <Property Name=\"Arguments\" Type=\"ImmutableArray&lt;IArgumentOperation&gt;\">\n      <Comments>\n        <summary>Arguments of the indexer property reference, excluding the instance argument. Arguments are in evaluation order.</summary>\n        <remarks>\n          If the invocation is in its expanded form, then params/ParamArray arguments would be collected into arrays.\n          Default values are supplied for optional arguments missing in source.\n        </remarks>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IEventReferenceOperation\" Base=\"IMemberReferenceOperation\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents a reference to an event.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# event reference expression</description></item>\n          <item><description>VB event reference expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Event\" Type=\"IEventSymbol\">\n      <Comments>\n        <summary>Referenced event.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"ConstrainedToType\" Type=\"ITypeSymbol?\" Override=\"true\"/>\n  </Node>\n  <Node Name=\"IUnaryOperation\" Base=\"IOperation\" VisitorName=\"VisitUnaryOperator\" HasType=\"true\" HasConstantValue=\"true\">\n    <OperationKind>\n      <Entry Name=\"Unary\" Value=\"0x1f\" />\n      <Entry Name=\"UnaryOperator\" Value=\"0x1f\" EditorBrowsable=\"false\" ExtraDescription=\"Use &lt;see cref=&quot;Unary&quot;/&gt; instead.\" />\n    </OperationKind>\n    <Comments>\n      <summary>\n        Represents an operation with one operand and a unary operator.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# unary operation expression</description></item>\n          <item><description>VB unary operation expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"OperatorKind\" Type=\"UnaryOperatorKind\">\n      <Comments>\n        <summary>Kind of unary operation.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Operand\" Type=\"IOperation\">\n      <Comments>\n        <summary>Operand.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"IsLifted\" Type=\"bool\">\n      <Comments>\n        <summary>\n          <see langword=\"true\" /> if this is a 'lifted' unary operator.  When there is an\n          operator that is defined to work on a value type, 'lifted' operators are\n          created to work on the <see cref=\"System.Nullable{T}\" /> versions of those\n          value types.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"IsChecked\" Type=\"bool\">\n      <Comments>\n        <summary>\n          <see langword=\"true\" /> if overflow checking is performed for the arithmetic operation.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"OperatorMethod\" Type=\"IMethodSymbol?\">\n      <Comments>\n        <summary>Operator method used by the operation, null if the operation does not use an operator method.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"ConstrainedToType\" Type=\"ITypeSymbol?\">\n      <Comments>\n        <summary>\n          Type parameter which runtime type will be used to resolve virtual invocation of the <see cref=\"OperatorMethod\" />, if any.\n          Null if <see cref=\"OperatorMethod\" /> is resolved statically, or is null.\n        </summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IBinaryOperation\" Base=\"IOperation\" VisitorName=\"VisitBinaryOperator\" ChildrenOrder=\"LeftOperand,RightOperand\" HasType=\"true\" HasConstantValue=\"true\">\n    <OperationKind>\n      <Entry Name=\"Binary\" Value=\"0x20\" />\n      <Entry Name=\"BinaryOperator\" Value=\"0x20\" EditorBrowsable=\"false\" ExtraDescription=\"Use &lt;see cref=&quot;Binary&quot;/&gt; instead.\" />\n    </OperationKind>\n    <Comments>\n      <summary>\n        Represents an operation with two operands and a binary operator that produces a result with a non-null type.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# binary operator expression</description></item>\n          <item><description>VB binary operator expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"OperatorKind\" Type=\"BinaryOperatorKind\">\n      <Comments>\n        <summary>Kind of binary operation.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"LeftOperand\" Type=\"IOperation\">\n      <Comments>\n        <summary>Left operand.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"RightOperand\" Type=\"IOperation\">\n      <Comments>\n        <summary>Right operand.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"IsLifted\" Type=\"bool\">\n      <Comments>\n        <summary>\n          <see langword=\"true\" /> if this is a 'lifted' binary operator.  When there is an\n          operator that is defined to work on a value type, 'lifted' operators are\n          created to work on the <see cref=\"System.Nullable{T}\" /> versions of those\n          value types.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"IsChecked\" Type=\"bool\">\n      <Comments>\n        <summary>\n          <see langword=\"true\" /> if this is a 'checked' binary operator.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"IsCompareText\" Type=\"bool\">\n      <Comments>\n        <summary>\n          <see langword=\"true\" /> if the comparison is text based for string or object comparison in VB.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"OperatorMethod\" Type=\"IMethodSymbol?\">\n      <Comments>\n        <summary>Operator method used by the operation, null if the operation does not use an operator method.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"ConstrainedToType\" Type=\"ITypeSymbol?\">\n      <Comments>\n        <summary>\n          Type parameter which runtime type will be used to resolve virtual invocation of the <see cref=\"OperatorMethod\" />\n          or corresponding true/false operator, if any.\n          Null if operators are resolved statically, or are not used.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"UnaryOperatorMethod\" Type=\"IMethodSymbol?\" Internal=\"true\">\n      <Comments>\n        <summary>\n          True/False operator method used for short circuiting.\n          https://github.com/dotnet/roslyn/issues/27598 tracks exposing this information through public API\n        </summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IConditionalOperation\" Base=\"IOperation\" ChildrenOrder=\"Condition,WhenTrue,WhenFalse\" HasType=\"true\" HasConstantValue=\"true\">\n    <Comments>\n      <summary>\n        Represents a conditional operation with:\n        <list type=\"number\">\n          <item><description><see cref=\"Condition\" /> to be tested</description></item>\n          <item><description><see cref=\"WhenTrue\" /> operation to be executed when <see cref=\"Condition\" /> is true and</description></item>\n          <item><description><see cref=\"WhenFalse\" /> operation to be executed when the <see cref=\"Condition\" /> is false</description></item>\n        </list>\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# ternary expression <c>a ? b : c</c> and if statement</description></item>\n          <item><description>VB ternary expression <c>If(a, b, c)</c> and If Else statement</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Condition\" Type=\"IOperation\">\n      <Comments>\n        <summary>Condition to be tested.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"WhenTrue\" Type=\"IOperation\">\n      <Comments>\n        <summary>\n          Operation to be executed if the <see cref=\"Condition\" /> is true.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"WhenFalse\" Type=\"IOperation?\">\n      <Comments>\n        <summary>\n          Operation to be executed if the <see cref=\"Condition\" /> is false.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"IsRef\" Type=\"bool\">\n      <Comments>\n        <summary><see langword=\"true\"/> if the result is by-reference.</summary>\n        <remarks>This occurs in C# for ternaries whose branches use <see langword=\"ref\"/>.</remarks>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"ICoalesceOperation\" Base=\"IOperation\" ChildrenOrder=\"Value,WhenNull\" HasType=\"true\" HasConstantValue=\"true\">\n    <Comments>\n      <summary>\n        Represents a coalesce operation with two operands:\n        <list type=\"number\">\n          <item><description><see cref=\"Value\" />, which is the first operand that is unconditionally evaluated and is the result of the operation if non null</description></item>\n          <item><description><see cref=\"WhenNull\" />, which is the second operand that is conditionally evaluated and is the result of the operation if <see cref=\"Value\" /> is null</description></item>\n        </list>\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# null-coalescing expression <c>Value ?? WhenNull</c></description></item>\n          <item><description>VB binary conditional expression <c>If(Value, WhenNull)</c></description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Value\" Type=\"IOperation\">\n      <Comments>\n        <summary>Operation to be unconditionally evaluated.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"WhenNull\" Type=\"IOperation\">\n      <Comments>\n        <summary>\n          Operation to be conditionally evaluated if <see cref=\"Value\" /> evaluates to null/Nothing.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"ValueConversion\" Type=\"CommonConversion\">\n      <Comments>\n        <summary>\n          Conversion associated with <see cref=\"Value\" /> when it is not null/Nothing.\n\n          Identity if result type of the operation is the same as type of <see cref=\"Value\" />.\n          Otherwise, if type of <see cref=\"Value\" /> is nullable, then conversion is applied to an\n          unwrapped <see cref=\"Value\" />, otherwise to the <see cref=\"Value\" /> itself.\n        </summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IAnonymousFunctionOperation\" Base=\"IOperation\">\n    <!--\n      IAnonymousFunctionOperations do not have a type, users must look at the IConversionOperation\n      on top of this node to get the type of lambda, matching SemanticModel.GetType behavior.\n    -->\n    <Comments>\n      <summary>\n        Represents an anonymous function operation.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# lambda expression</description></item>\n          <item><description>VB anonymous delegate expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Symbol\" Type=\"IMethodSymbol\">\n      <Comments>\n        <summary>Symbol of the anonymous function.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Body\" Type=\"IBlockOperation\">\n      <Comments>\n        <summary>Body of the anonymous function.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IObjectCreationOperation\" Base=\"IOperation\" ChildrenOrder=\"Arguments,Initializer\" HasType=\"true\" HasConstantValue=\"true\">\n    <Comments>\n      <summary>\n        Represents creation of an object instance.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# new expression</description></item>\n          <item><description>VB New expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Constructor\" Type=\"IMethodSymbol?\">\n      <Comments>\n        <summary>Constructor to be invoked on the created instance.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Initializer\" Type=\"IObjectOrCollectionInitializerOperation?\">\n      <Comments>\n        <summary>Object or collection initializer, if any.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Arguments\" Type=\"ImmutableArray&lt;IArgumentOperation&gt;\">\n      <Comments>\n        <summary>Arguments of the object creation, excluding the instance argument. Arguments are in evaluation order.</summary>\n        <remarks>\n          If the invocation is in its expanded form, then params/ParamArray arguments would be collected into arrays.\n          Default values are supplied for optional arguments missing in source.\n        </remarks>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"ITypeParameterObjectCreationOperation\" Base=\"IOperation\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents a creation of a type parameter object, i.e. new T(), where T is a type parameter with new constraint.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# type parameter object creation expression</description></item>\n          <item><description>VB type parameter object creation expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Initializer\" Type=\"IObjectOrCollectionInitializerOperation?\">\n      <Comments>\n        <summary>Object or collection initializer, if any.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IArrayCreationOperation\" Base=\"IOperation\" ChildrenOrder=\"DimensionSizes,Initializer\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents the creation of an array instance.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# array creation expression</description></item>\n          <item><description>VB array creation expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"DimensionSizes\" Type=\"ImmutableArray&lt;IOperation&gt;\">\n      <Comments>\n        <summary>Sizes of the dimensions of the created array instance.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Initializer\" Type=\"IArrayInitializerOperation?\">\n      <Comments>\n        <summary>Values of elements of the created array instance.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IInstanceReferenceOperation\" Base=\"IOperation\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents an implicit/explicit reference to an instance.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# this or base expression</description></item>\n          <item><description>VB Me, MyClass, or MyBase expression</description></item>\n          <item><description>C# object or collection or 'with' expression initializers</description></item>\n          <item><description>VB With statements, object or collection initializers</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"ReferenceKind\" Type=\"InstanceReferenceKind\">\n      <Comments>\n        <summary>The kind of reference that is being made.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IIsTypeOperation\" Base=\"IOperation\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents an operation that tests if a value is of a specific type.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# \"is\" operator expression</description></item>\n          <item><description>VB \"TypeOf\" and \"TypeOf IsNot\" expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"ValueOperand\" Type=\"IOperation\">\n      <Comments>\n        <summary>Value to test.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"TypeOperand\" Type=\"ITypeSymbol\">\n      <Comments>\n        <summary>Type for which to test.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"IsNegated\" Type=\"bool\">\n      <Comments>\n        <summary>\n          Flag indicating if this is an \"is not\" type expression.\n          True for VB \"TypeOf ... IsNot ...\" expression.\n          False, otherwise.\n        </summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IAwaitOperation\" Base=\"IOperation\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents an await operation.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# await expression</description></item>\n          <item><description>VB await expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Operation\" Type=\"IOperation\">\n      <Comments>\n        <summary>Awaited operation.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <AbstractNode Name=\"IAssignmentOperation\" Base=\"IOperation\">\n    <Comments>\n      <summary>\n        Represents a base interface for assignments.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# simple, compound and deconstruction assignment expressions</description></item>\n          <item><description>VB simple and compound assignment expressions</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Target\" Type=\"IOperation\">\n      <Comments>\n        <summary>Target of the assignment.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Value\" Type=\"IOperation\">\n      <Comments>\n        <summary>Value to be assigned to the target of the assignment.</summary>\n      </Comments>\n    </Property>\n  </AbstractNode>\n  <Node Name=\"ISimpleAssignmentOperation\" Base=\"IAssignmentOperation\" ChildrenOrder=\"Target,Value\" HasType=\"true\" HasConstantValue=\"true\">\n    <Comments>\n      <summary>\n        Represents a simple assignment operation.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# simple assignment expression</description></item>\n          <item><description>VB simple assignment expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"IsRef\" Type=\"bool\">\n      <Comments>\n        <summary>Is this a ref assignment</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"ICompoundAssignmentOperation\" Base=\"IAssignmentOperation\" ChildrenOrder=\"Target,Value\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents a compound assignment that mutates the target with the result of a binary operation.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# compound assignment expression</description></item>\n          <item><description>VB compound assignment expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"InConversion\" Type=\"CommonConversion\">\n      <Comments>\n        <summary>\n          Conversion applied to <see cref=\"IAssignmentOperation.Target\" /> before the operation occurs.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"OutConversion\" Type=\"CommonConversion\">\n      <Comments>\n        <summary>\n          Conversion applied to the result of the binary operation, before it is assigned back to\n          <see cref=\"IAssignmentOperation.Target\" />.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"OperatorKind\" Type=\"BinaryOperatorKind\">\n      <Comments>\n        <summary>Kind of binary operation.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"IsLifted\" Type=\"bool\">\n      <Comments>\n        <summary>\n          <see langword=\"true\" /> if this assignment contains a 'lifted' binary operation.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"IsChecked\" Type=\"bool\">\n      <Comments>\n        <summary>\n          <see langword=\"true\" /> if overflow checking is performed for the arithmetic operation.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"OperatorMethod\" Type=\"IMethodSymbol?\">\n      <Comments>\n        <summary>Operator method used by the operation, null if the operation does not use an operator method.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"ConstrainedToType\" Type=\"ITypeSymbol?\">\n      <Comments>\n        <summary>\n          Type parameter which runtime type will be used to resolve virtual invocation of the <see cref=\"OperatorMethod\" />, if any.\n          Null if <see cref=\"OperatorMethod\" /> is resolved statically, or is null.\n        </summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IParenthesizedOperation\" Base=\"IOperation\" HasType=\"true\" HasConstantValue=\"true\">\n    <Comments>\n      <summary>\n        Represents a parenthesized operation.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>VB parenthesized expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Operand\" Type=\"IOperation\">\n      <Comments>\n        <summary>Operand enclosed in parentheses.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IEventAssignmentOperation\" Base=\"IOperation\" ChildrenOrder=\"EventReference,HandlerValue\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents a binding of an event.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# event assignment expression</description></item>\n          <item><description>VB Add/Remove handler statement</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"EventReference\" Type=\"IOperation\">\n      <Comments>\n        <summary>Reference to the event being bound.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"HandlerValue\" Type=\"IOperation\">\n      <Comments>\n        <summary>Handler supplied for the event.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Adds\" Type=\"bool\">\n      <Comments>\n        <summary>True for adding a binding, false for removing one.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IConditionalAccessOperation\" Base=\"IOperation\" ChildrenOrder=\"Operation,WhenNotNull\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents a conditionally accessed operation. Note that <see cref=\"IConditionalAccessInstanceOperation\" /> is used to refer to the value\n        of <see cref=\"Operation\" /> within <see cref=\"WhenNotNull\" />.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# conditional access expression (<c>?</c> or <c>?.</c> operator)</description></item>\n          <item><description>VB conditional access expression (<c>?</c> or <c>?.</c> operator)</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Operation\" Type=\"IOperation\">\n      <Comments>\n        <summary>Operation that will be evaluated and accessed if non null.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"WhenNotNull\" Type=\"IOperation\">\n      <Comments>\n        <summary>\n          Operation to be evaluated if <see cref=\"Operation\" /> is non null.\n        </summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IConditionalAccessInstanceOperation\" Base=\"IOperation\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents the value of a conditionally-accessed operation within <see cref=\"IConditionalAccessOperation.WhenNotNull\" />.\n        For a conditional access operation of the form <c>someExpr?.Member</c>, this operation is used as the InstanceReceiver for the right operation <c>Member</c>.\n        See https://github.com/dotnet/roslyn/issues/21279#issuecomment-323153041 for more details.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# conditional access instance expression</description></item>\n          <item><description>VB conditional access instance expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n  </Node>\n  <Node Name=\"IInterpolatedStringOperation\" Base=\"IOperation\" HasType=\"true\" HasConstantValue=\"true\">\n    <Comments>\n      <summary>\n        Represents an interpolated string.\n        <para>\n        Current usage:\n         (1) C# interpolated string expression.\n         (2) VB interpolated string expression.\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Parts\" Type=\"ImmutableArray&lt;IInterpolatedStringContentOperation&gt;\">\n      <Comments>\n        <summary>\n          Constituent parts of interpolated string, each of which is an <see cref=\"IInterpolatedStringContentOperation\" />.\n        </summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IAnonymousObjectCreationOperation\" Base=\"IOperation\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents a creation of anonymous object.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# <c>new { ... }</c> expression</description></item>\n          <item><description>VB <c>New With { ... }</c> expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Initializers\" Type=\"ImmutableArray&lt;IOperation&gt;\">\n      <Comments>\n        <summary>\n          Property initializers.\n          Each initializer is an <see cref=\"ISimpleAssignmentOperation\" />, with an <see cref=\"IPropertyReferenceOperation\" />\n          as the target whose Instance is an <see cref=\"IInstanceReferenceOperation\" /> with <see cref=\"InstanceReferenceKind.ImplicitReceiver\" /> kind.\n        </summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IObjectOrCollectionInitializerOperation\" Base=\"IOperation\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents an initialization for an object or collection creation.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item>\n            <description>\n              C# object or collection initializer expression.\n              For example, object initializer <c>{ X = x }</c> within object creation <c>new Class() { X = x }</c> and\n              collection initializer <c>{ x, y, 3 }</c> within collection creation <c>new MyList() { x, y, 3 }</c>\n            </description>\n          </item>\n          <item><description>VB object or collection initializer expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Initializers\" Type=\"ImmutableArray&lt;IOperation&gt;\">\n      <Comments>\n        <summary>Object member or collection initializers.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IMemberInitializerOperation\" Base=\"IOperation\" ChildrenOrder=\"InitializedMember,Initializer\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents an initialization of member within an object initializer with a nested object or collection initializer.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item>\n            <description>\n              C# nested member initializer expression.\n              For example, given an object creation with initializer <c>new Class() { X = x, Y = { x, y, 3 }, Z = { X = z } }</c>,\n              member initializers for Y and Z, i.e. <c>Y = { x, y, 3 }</c>, and <c>Z = { X = z }</c> are nested member initializers represented by this operation\n            </description>\n          </item>\n          <item><description>VB object or collection initializer expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"InitializedMember\" Type=\"IOperation\">\n      <Comments>\n        <summary>\n          Initialized member reference <see cref=\"IMemberReferenceOperation\" /> or an invalid operation for error cases.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Initializer\" Type=\"IObjectOrCollectionInitializerOperation\">\n      <Comments>\n        <summary>Member initializer.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"ICollectionElementInitializerOperation\" Base=\"IOperation\" SkipClassGeneration=\"true\">\n    <Obsolete Error=\"true\">\"ICollectionElementInitializerOperation has been replaced with \" + nameof(IInvocationOperation) + \" and \" + nameof(IDynamicInvocationOperation)</Obsolete>\n    <Comments>\n      <summary>\n        Obsolete interface that used to represent a collection element initializer. It has been replaced by\n        <see cref=\"IInvocationOperation\" /> and <see cref=\"IDynamicInvocationOperation\" />, as appropriate.\n        <para>\n        Current usage:\n          None. This API has been obsoleted in favor of <see cref=\"IInvocationOperation\" /> and <see cref=\"IDynamicInvocationOperation\" />.\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"AddMethod\" Type=\"IMethodSymbol\" />\n    <Property Name=\"Arguments\" Type=\"ImmutableArray&lt;IOperation&gt;\" />\n    <Property Name=\"IsDynamic\" Type=\"bool\" />\n  </Node>\n  <Node Name=\"INameOfOperation\" Base=\"IOperation\" HasType=\"true\" HasConstantValue=\"true\">\n    <Comments>\n      <summary>\n        Represents an operation that gets a string value for the <see cref=\"Argument\" /> name.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# nameof expression</description></item>\n          <item><description>VB NameOf expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Argument\" Type=\"IOperation\">\n      <Comments>\n        <summary>Argument to the name of operation.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"ITupleOperation\" Base=\"IOperation\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents a tuple with one or more elements.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# tuple expression</description></item>\n          <item><description>VB tuple expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Elements\" Type=\"ImmutableArray&lt;IOperation&gt;\">\n      <Comments>\n        <summary>Tuple elements.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"NaturalType\" Type=\"ITypeSymbol?\">\n      <Comments>\n        <summary>\n          Natural type of the tuple, or null if tuple doesn't have a natural type.\n          Natural type can be different from <see cref=\"IOperation.Type\" /> depending on the\n          conversion context, in which the tuple is used.\n        </summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IDynamicObjectCreationOperation\" Base=\"IOperation\" SkipClassGeneration=\"true\">\n    <Comments>\n      <summary>\n        Represents an object creation with a dynamically bound constructor.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# <c>new</c> expression with dynamic argument(s)</description></item>\n          <item><description>VB late bound <c>New</c> expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Initializer\" Type=\"IObjectOrCollectionInitializerOperation?\">\n      <Comments>\n        <summary>Object or collection initializer, if any.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Arguments\" Type=\"ImmutableArray&lt;IOperation&gt;\">\n      <Comments>\n        <summary>Dynamically bound arguments, excluding the instance argument.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IDynamicMemberReferenceOperation\" Base=\"IOperation\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents a reference to a member of a class, struct, or module that is dynamically bound.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# dynamic member reference expression</description></item>\n          <item><description>VB late bound member reference expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Instance\" Type=\"IOperation?\">\n      <Comments>\n        <summary>Instance receiver, if it exists.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"MemberName\" Type=\"string\">\n      <Comments>\n        <summary>Referenced member.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"TypeArguments\" Type=\"ImmutableArray&lt;ITypeSymbol&gt;\">\n      <Comments>\n        <summary>Type arguments.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"ContainingType\" Type=\"ITypeSymbol?\">\n      <Comments>\n        <summary>\n          The containing type of the referenced member, if different from type of the <see cref=\"Instance\" />.\n        </summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IDynamicInvocationOperation\" Base=\"IOperation\" SkipClassGeneration=\"true\">\n    <Comments>\n      <summary>\n        Represents a invocation that is dynamically bound.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# dynamic invocation expression</description></item>\n          <item>\n            <description>\n              C# dynamic collection element initializer.\n              For example, in the following collection initializer: <c>new C() { do1, do2, do3 }</c> where\n              the doX objects are of type dynamic, we'll have 3 <see cref=\"IDynamicInvocationOperation\" /> with do1, do2, and\n              do3 as their arguments\n            </description>\n          </item>\n          <item><description>VB late bound invocation expression</description></item>\n          <item>\n            <description>\n              VB dynamic collection element initializer.\n              Similar to the C# example, <c>New C() From {do1, do2, do3}</c> will generate 3 <see cref=\"IDynamicInvocationOperation\" />\n              nodes with do1, do2, and do3 as their arguments, respectively\n            </description>\n          </item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Operation\" Type=\"IOperation\">\n      <Comments>\n        <summary>Dynamically or late bound operation.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Arguments\" Type=\"ImmutableArray&lt;IOperation&gt;\">\n      <Comments>\n        <summary>Dynamically bound arguments, excluding the instance argument.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IDynamicIndexerAccessOperation\" Base=\"IOperation\" SkipClassGeneration=\"true\">\n    <Comments>\n      <summary>\n        Represents an indexer access that is dynamically bound.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# dynamic indexer access expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Operation\" Type=\"IOperation\">\n      <Comments>\n        <summary>Dynamically indexed operation.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Arguments\" Type=\"ImmutableArray&lt;IOperation&gt;\">\n      <Comments>\n        <summary>Dynamically bound arguments, excluding the instance argument.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"ITranslatedQueryOperation\" Base=\"IOperation\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents an unrolled/lowered query operation.\n        For example, for a C# query expression \"from x in set where x.Name != null select x.Name\", the Operation tree has the following shape:\n          ITranslatedQueryExpression\n            IInvocationExpression ('Select' invocation for \"select x.Name\")\n              IInvocationExpression ('Where' invocation for \"where x.Name != null\")\n                IInvocationExpression ('From' invocation for \"from x in set\")\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# query expression</description></item>\n          <item><description>VB query expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Operation\" Type=\"IOperation\">\n      <Comments>\n        <summary>Underlying unrolled operation.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IDelegateCreationOperation\" Base=\"IOperation\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents a delegate creation. This is created whenever a new delegate is created.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# delegate creation expression</description></item>\n          <item><description>VB delegate creation expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Target\" Type=\"IOperation\">\n      <Comments>\n        <summary>The lambda or method binding that this delegate is created from.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IDefaultValueOperation\" Base=\"IOperation\" HasType=\"true\" HasConstantValue=\"true\">\n    <Comments>\n      <summary>\n        Represents a default value operation.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# default value expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n  </Node>\n  <Node Name=\"ITypeOfOperation\" Base=\"IOperation\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents an operation that gets <see cref=\"System.Type\" /> for the given <see cref=\"TypeOperand\" />.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# typeof expression</description></item>\n          <item><description>VB GetType expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"TypeOperand\" Type=\"ITypeSymbol\">\n      <Comments>\n        <summary>Type operand.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"ISizeOfOperation\" Base=\"IOperation\" HasType=\"true\" HasConstantValue=\"true\">\n    <Comments>\n      <summary>\n        Represents an operation to compute the size of a given type.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# sizeof expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"TypeOperand\" Type=\"ITypeSymbol\">\n      <Comments>\n        <summary>Type operand.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IAddressOfOperation\" Base=\"IOperation\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents an operation that creates a pointer value by taking the address of a reference.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# address of expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Reference\" Type=\"IOperation\">\n      <Comments>\n        <summary>Addressed reference.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IIsPatternOperation\" Base=\"IOperation\" ChildrenOrder=\"Value,Pattern\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents an operation that tests if a value matches a specific pattern.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# is pattern expression. For example, <c>x is int i</c></description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Value\" Type=\"IOperation\">\n      <Comments>\n        <summary>Underlying operation to test.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Pattern\" Type=\"IPatternOperation\">\n      <Comments>\n        <summary>Pattern.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IIncrementOrDecrementOperation\" Base=\"IOperation\" HasType=\"true\">\n    <OperationKind>\n      <Entry Name=\"Increment\" Value=\"0x42\" ExtraDescription=\"This is used as an increment operator\"/>\n      <Entry Name=\"Decrement\" Value=\"0x44\" ExtraDescription=\"This is used as a decrement operator\"/>\n    </OperationKind>\n    <Comments>\n      <summary>\n        Represents an <see cref=\"OperationKind.Increment\" /> or <see cref=\"OperationKind.Decrement\" /> operation.\n        Note that this operation is different from an <see cref=\"IUnaryOperation\" /> as it mutates the <see cref=\"Target\" />,\n        while unary operator expression does not mutate it's operand.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# increment expression or decrement expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"IsPostfix\" Type=\"bool\">\n      <Comments>\n        <summary>\n          <see langword=\"true\" /> if this is a postfix expression. <see langword=\"false\" /> if this is a prefix expression.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"IsLifted\" Type=\"bool\">\n      <Comments>\n        <summary>\n          <see langword=\"true\" /> if this is a 'lifted' increment operator.  When there\n          is an operator that is defined to work on a value type, 'lifted' operators are\n          created to work on the <see cref=\"System.Nullable{T}\" /> versions of those\n          value types.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"IsChecked\" Type=\"bool\">\n      <Comments>\n        <summary>\n          <see langword=\"true\" /> if overflow checking is performed for the arithmetic operation.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Target\" Type=\"IOperation\">\n      <Comments>\n        <summary>Target of the assignment.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"OperatorMethod\" Type=\"IMethodSymbol?\">\n      <Comments>\n        <summary>Operator method used by the operation, null if the operation does not use an operator method.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"ConstrainedToType\" Type=\"ITypeSymbol?\">\n      <Comments>\n        <summary>\n          Type parameter which runtime type will be used to resolve virtual invocation of the <see cref=\"OperatorMethod\" />, if any.\n          Null if <see cref=\"OperatorMethod\" /> is resolved statically, or is null.\n        </summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IThrowOperation\" Base=\"IOperation\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents an operation to throw an exception.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# throw expression</description></item>\n          <item><description>C# throw statement</description></item>\n          <item><description>VB Throw statement</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Exception\" Type=\"IOperation?\">\n      <Comments>\n        <summary>Instance of an exception being thrown.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IDeconstructionAssignmentOperation\" Base=\"IAssignmentOperation\" ChildrenOrder=\"Target,Value\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents a assignment with a deconstruction.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# deconstruction assignment expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n  </Node>\n  <Node Name=\"IDeclarationExpressionOperation\" Base=\"IOperation\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents a declaration expression operation. Unlike a regular variable declaration <see cref=\"IVariableDeclaratorOperation\" /> and <see cref=\"IVariableDeclarationOperation\" />, this operation represents an \"expression\" declaring a variable.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item>\n            <description>\n              C# deconstruction assignment expression. For example:\n              <list type=\"bullet\">\n                <item><description><c>var (x, y)</c> is a deconstruction declaration expression with variables <c>x</c> and <c>y</c></description></item>\n                <item><description><c>(var x, var y)</c> is a tuple expression with two declaration expressions</description></item>\n                <item><description><c>M(out var x);</c> is an invocation expression with an out <c>var x</c> declaration expression</description></item>\n              </list>\n            </description>\n          </item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Expression\" Type=\"IOperation\">\n      <Comments>\n        <summary>Underlying expression.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IOmittedArgumentOperation\" Base=\"IOperation\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents an argument value that has been omitted in an invocation.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>VB omitted argument in an invocation expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n  </Node>\n  <AbstractNode Name=\"ISymbolInitializerOperation\" Base=\"IOperation\">\n    <Comments>\n      <summary>\n        Represents an initializer for a field, property, parameter or a local variable declaration.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# field, property, parameter or local variable initializer</description></item>\n          <item><description>VB field(s), property, parameter or local variable initializer</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Locals\" Type=\"ImmutableArray&lt;ILocalSymbol&gt;\">\n      <Comments>\n        <summary>\n          Local declared in and scoped to the <see cref=\"Value\" />.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Value\" Type=\"IOperation\">\n      <Comments>\n        <summary>Underlying initializer value.</summary>\n      </Comments>\n    </Property>\n  </AbstractNode>\n  <Node Name=\"IFieldInitializerOperation\" Base=\"ISymbolInitializerOperation\">\n    <Comments>\n      <summary>\n        Represents an initialization of a field.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# field initializer with equals value clause</description></item>\n          <item><description>VB field(s) initializer with equals value clause or AsNew clause. Multiple fields can be initialized with AsNew clause in VB</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"InitializedFields\" Type=\"ImmutableArray&lt;IFieldSymbol&gt;\">\n      <Comments>\n        <summary>Initialized fields. There can be multiple fields for Visual Basic fields declared with AsNew clause.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IVariableInitializerOperation\" Base=\"ISymbolInitializerOperation\">\n    <Comments>\n      <summary>\n        Represents an initialization of a local variable.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# local variable initializer with equals value clause</description></item>\n          <item><description>VB local variable initializer with equals value clause or AsNew clause</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n  </Node>\n  <Node Name=\"IPropertyInitializerOperation\" Base=\"ISymbolInitializerOperation\">\n    <Comments>\n      <summary>\n        Represents an initialization of a property.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# property initializer with equals value clause</description></item>\n          <item><description>VB property initializer with equals value clause or AsNew clause. Multiple properties can be initialized with 'WithEvents' declaration with AsNew clause in VB</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"InitializedProperties\" Type=\"ImmutableArray&lt;IPropertySymbol&gt;\">\n      <Comments>\n        <summary>Initialized properties. There can be multiple properties for Visual Basic 'WithEvents' declaration with AsNew clause.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IParameterInitializerOperation\" Base=\"ISymbolInitializerOperation\">\n    <Comments>\n      <summary>\n        Represents an initialization of a parameter at the point of declaration.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# parameter initializer with equals value clause</description></item>\n          <item><description>VB parameter initializer with equals value clause</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Parameter\" Type=\"IParameterSymbol\">\n      <Comments>\n        <summary>Initialized parameter.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IArrayInitializerOperation\" Base=\"IOperation\">\n    <Comments>\n      <summary>\n        Represents the initialization of an array instance.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# array initializer</description></item>\n          <item><description>VB array initializer</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"ElementValues\" Type=\"ImmutableArray&lt;IOperation&gt;\">\n      <Comments>\n        <summary>Values to initialize array elements.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IVariableDeclaratorOperation\" Base=\"IOperation\" ChildrenOrder=\"IgnoredArguments,Initializer\">\n    <Comments>\n      <summary>\n        Represents a single variable declarator and initializer.\n        <para>\n        Current Usage:\n        <list type=\"number\">\n          <item><description>C# variable declarator</description></item>\n          <item><description>C# catch variable declaration</description></item>\n          <item><description>VB single variable declaration</description></item>\n          <item><description>VB catch variable declaration</description></item>\n        </list>\n        </para>\n      </summary>\n      <remarks>\n        In VB, the initializer for this node is only ever used for explicit array bounds initializers. This node corresponds to\n        the VariableDeclaratorSyntax in C# and the ModifiedIdentifierSyntax in VB.\n      </remarks>\n    </Comments>\n    <Property Name=\"Symbol\" Type=\"ILocalSymbol\">\n      <Comments>\n        <summary>Symbol declared by this variable declaration</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Initializer\" Type=\"IVariableInitializerOperation?\">\n      <Comments>\n        <summary>Optional initializer of the variable.</summary>\n        <remarks>\n          If this variable is in an <see cref=\"IVariableDeclarationOperation\" />, the initializer may be located\n          in the parent operation. Call <see cref=\"OperationExtensions.GetVariableInitializer(IVariableDeclaratorOperation)\" />\n          to check in all locations. It is only possible to have initializers in both locations in VB invalid code scenarios.\n        </remarks>\n      </Comments>\n    </Property>\n    <Property Name=\"IgnoredArguments\" Type=\"ImmutableArray&lt;IOperation&gt;\">\n      <Comments>\n        <summary>\n          Additional arguments supplied to the declarator in error cases, ignored by the compiler. This only used for the C# case of\n          DeclaredArgumentSyntax nodes on a VariableDeclaratorSyntax.\n        </summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IVariableDeclarationOperation\" Base=\"IOperation\" ChildrenOrder=\"IgnoredDimensions,Declarators,Initializer\">\n    <Comments>\n      <summary>\n        Represents a declarator that declares multiple individual variables.\n        <para>\n        Current Usage:\n        <list type=\"number\">\n          <item><description>C# VariableDeclaration</description></item>\n          <item><description>C# fixed declarations</description></item>\n          <item><description>VB Dim statement declaration groups</description></item>\n          <item><description>VB Using statement variable declarations</description></item>\n        </list>\n        </para>\n      </summary>\n      <remarks>\n        The initializer of this node is applied to all individual declarations in <see cref=\"Declarators\" />. There cannot\n        be initializers in both locations except in invalid code scenarios.\n        In C#, this node will never have an initializer.\n        This corresponds to the VariableDeclarationSyntax in C#, and the VariableDeclaratorSyntax in Visual Basic.\n      </remarks>\n    </Comments>\n    <Property Name=\"Declarators\" Type=\"ImmutableArray&lt;IVariableDeclaratorOperation&gt;\">\n      <Comments>\n        <summary>Individual variable declarations declared by this multiple declaration.</summary>\n        <remarks>\n          All <see cref=\"IVariableDeclarationGroupOperation\" /> will have at least 1 <see cref=\"IVariableDeclarationOperation\" />,\n          even if the declaration group only declares 1 variable.\n        </remarks>\n      </Comments>\n    </Property>\n    <Property Name=\"Initializer\" Type=\"IVariableInitializerOperation?\">\n      <Comments>\n        <summary>Optional initializer of the variable.</summary>\n        <remarks>In C#, this will always be null.</remarks>\n      </Comments>\n    </Property>\n    <Property Name=\"IgnoredDimensions\" Type=\"ImmutableArray&lt;IOperation&gt;\">\n      <Comments>\n        <summary>\n          Array dimensions supplied to an array declaration in error cases, ignored by the compiler. This is only used for the C# case of\n          RankSpecifierSyntax nodes on an ArrayTypeSyntax.\n        </summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IArgumentOperation\" Base=\"IOperation\">\n    <Comments>\n      <summary>\n        Represents an argument to a method invocation.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# argument to an invocation expression, object creation expression, etc.</description></item>\n          <item><description>VB argument to an invocation expression, object creation expression, etc.</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"ArgumentKind\" Type=\"ArgumentKind\">\n      <Comments>\n        <summary>Kind of argument.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Parameter\" Type=\"IParameterSymbol?\">\n      <Comments>\n        <summary>Parameter the argument matches. This can be null for __arglist parameters.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Value\" Type=\"IOperation\">\n      <Comments>\n        <summary>Value supplied for the argument.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"InConversion\" Type=\"CommonConversion\">\n      <Comments>\n        <summary>Information of the conversion applied to the argument value passing it into the target method. Applicable only to VB Reference arguments.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"OutConversion\" Type=\"CommonConversion\">\n      <Comments>\n        <summary>Information of the conversion applied to the argument value after the invocation. Applicable only to VB Reference arguments.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"ICatchClauseOperation\" Base=\"IOperation\" ChildrenOrder=\"ExceptionDeclarationOrExpression,Filter,Handler\">\n    <Comments>\n      <summary>\n        Represents a catch clause.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# catch clause</description></item>\n          <item><description>VB Catch clause</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"ExceptionDeclarationOrExpression\" Type=\"IOperation?\">\n      <Comments>\n        <summary>\n          Optional source for exception. This could be any of the following operation:\n          1. Declaration for the local catch variable bound to the caught exception (C# and VB) OR\n          2. Null, indicating no declaration or expression (C# and VB)\n          3. Reference to an existing local or parameter (VB) OR\n          4. Other expression for error scenarios (VB)\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"ExceptionType\" Type=\"ITypeSymbol\">\n      <Comments>\n        <summary>Type of the exception handled by the catch clause.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Locals\" Type=\"ImmutableArray&lt;ILocalSymbol&gt;\">\n      <Comments>\n        <summary>\n          Locals declared by the <see cref=\"ExceptionDeclarationOrExpression\" /> and/or <see cref=\"Filter\" /> clause.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Filter\" Type=\"IOperation?\">\n      <Comments>\n        <summary>Filter operation to be executed to determine whether to handle the exception.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Handler\" Type=\"IBlockOperation\">\n      <Comments>\n        <summary>Body of the exception handler.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"ISwitchCaseOperation\" Base=\"IOperation\" ChildrenOrder=\"Clauses,Body\">\n    <Comments>\n      <summary>\n        Represents a switch case section with one or more case clauses to match and one or more operations to execute within the section.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# switch section for one or more case clause and set of statements to execute</description></item>\n          <item><description>VB case block with a case statement for one or more case clause and set of statements to execute</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Clauses\" Type=\"ImmutableArray&lt;ICaseClauseOperation&gt;\">\n      <Comments>\n        <summary>Clauses of the case.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Body\" Type=\"ImmutableArray&lt;IOperation&gt;\">\n      <Comments>\n        <summary>One or more operations to execute within the switch section.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Locals\" Type=\"ImmutableArray&lt;ILocalSymbol&gt;\">\n      <Comments>\n        <summary>Locals declared within the switch case section scoped to the section.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Condition\" Type=\"IOperation?\" Internal=\"true\">\n      <Comments>\n        <summary>\n          Optional combined logical condition that accounts for all <see cref=\"Clauses\"/>.\n          An instance of <see cref=\"IPlaceholderOperation\"/> with kind <see cref=\"PlaceholderKind.SwitchOperationExpression\"/>\n          is used to refer to the <see cref=\"ISwitchOperation.Value\"/> in context of this expression.\n          It is not part of <see cref=\"Children\"/> list and likely contains duplicate nodes for\n          nodes exposed by <see cref=\"Clauses\"/>, like <see cref=\"ISingleValueCaseClauseOperation.Value\"/>,\n          etc.\n          Never set for C# at the moment.\n        </summary>\n      </Comments>\n    </Property>\n  </Node>\n  <AbstractNode Name=\"ICaseClauseOperation\" Base=\"IOperation\">\n    <OperationKind Include=\"true\" ExtraDescription=\"This is further differentiated by &lt;see cref=&quot;ICaseClauseOperation.CaseKind&quot;/&gt;.\" />\n    <Comments>\n      <summary>\n        Represents a case clause.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# case clause</description></item>\n          <item><description>VB Case clause</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"CaseKind\" Type=\"CaseKind\" MakeAbstract=\"true\">\n      <Comments>\n        <summary>Kind of the clause.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Label\" Type=\"ILabelSymbol?\">\n      <Comments>\n        <summary>Label associated with the case clause, if any.</summary>\n      </Comments>\n    </Property>\n  </AbstractNode>\n  <Node Name=\"IDefaultCaseClauseOperation\" Base=\"ICaseClauseOperation\">\n    <OperationKind Include=\"false\" />\n    <Comments>\n      <summary>\n        Represents a default case clause.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# default clause</description></item>\n          <item><description>VB Case Else clause</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n  </Node>\n  <Node Name=\"IPatternCaseClauseOperation\" Base=\"ICaseClauseOperation\" ChildrenOrder=\"Pattern,Guard\">\n    <OperationKind Include=\"false\" />\n    <Comments>\n      <summary>\n        Represents a case clause with a pattern and an optional guard operation.\n        <para>\n        Current usage:\n         (1) C# pattern case clause.\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Label\" Type=\"ILabelSymbol\" New=\"true\">\n      <Comments>\n        <!-- It would be a binary breaking change to remove this -->\n        <summary>\n          Label associated with the case clause.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Pattern\" Type=\"IPatternOperation\">\n      <Comments>\n        <summary>Pattern associated with case clause.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Guard\" Type=\"IOperation?\">\n      <Comments>\n        <summary>Guard associated with the pattern case clause.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IRangeCaseClauseOperation\" Base=\"ICaseClauseOperation\" ChildrenOrder=\"MinimumValue,MaximumValue\">\n    <OperationKind Include=\"false\" />\n    <Comments>\n      <summary>\n        Represents a case clause with range of values for comparison.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>VB range case clause of the form <c>Case x To y</c></description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"MinimumValue\" Type=\"IOperation\">\n      <Comments>\n        <summary>Minimum value of the case range.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"MaximumValue\" Type=\"IOperation\">\n      <Comments>\n        <summary>Maximum value of the case range.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IRelationalCaseClauseOperation\" Base=\"ICaseClauseOperation\">\n    <OperationKind Include=\"false\" />\n    <Comments>\n      <summary>\n        Represents a case clause with custom relational operator for comparison.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>VB relational case clause of the form <c>Case Is op x</c></description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Value\" Type=\"IOperation\">\n      <Comments>\n        <summary>Case value.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Relation\" Type=\"BinaryOperatorKind\">\n      <Comments>\n        <summary>Relational operator used to compare the switch value with the case value.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"ISingleValueCaseClauseOperation\" Base=\"ICaseClauseOperation\">\n    <OperationKind Include=\"false\" />\n    <Comments>\n      <summary>\n        Represents a case clause with a single value for comparison.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# case clause of the form <c>case x</c></description></item>\n          <item><description>VB case clause of the form <c>Case x</c></description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Value\" Type=\"IOperation\">\n      <Comments>\n        <summary>Case value.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <AbstractNode Name=\"IInterpolatedStringContentOperation\" Base=\"IOperation\">\n    <Comments>\n      <summary>\n        Represents a constituent part of an interpolated string.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# interpolated string content</description></item>\n          <item><description>VB interpolated string content</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n  </AbstractNode>\n  <Node Name=\"IInterpolatedStringTextOperation\" Base=\"IInterpolatedStringContentOperation\">\n    <Comments>\n      <summary>\n        Represents a constituent string literal part of an interpolated string operation.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# interpolated string text</description></item>\n          <item><description>VB interpolated string text</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Text\" Type=\"IOperation\">\n      <Comments>\n        <summary>Text content.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IInterpolationOperation\" Base=\"IInterpolatedStringContentOperation\" ChildrenOrder=\"Expression,Alignment,FormatString\">\n    <Comments>\n      <summary>\n        Represents a constituent interpolation part of an interpolated string operation.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# interpolation part</description></item>\n          <item><description>VB interpolation part</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Expression\" Type=\"IOperation\">\n      <Comments>\n        <summary>Expression of the interpolation.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Alignment\" Type=\"IOperation?\">\n      <Comments>\n        <summary>Optional alignment of the interpolation.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"FormatString\" Type=\"IOperation?\">\n      <Comments>\n        <summary>Optional format string of the interpolation.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <AbstractNode Name=\"IPatternOperation\" Base=\"IOperation\">\n    <Comments>\n      <summary>\n        Represents a pattern matching operation.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# pattern</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"InputType\" Type=\"ITypeSymbol\">\n      <Comments>\n        <summary>The input type to the pattern-matching operation.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"NarrowedType\" Type=\"ITypeSymbol\">\n      <Comments>\n        <summary>The narrowed type of the pattern-matching operation.</summary>\n      </Comments>\n    </Property>\n  </AbstractNode>\n  <Node Name=\"IConstantPatternOperation\" Base=\"IPatternOperation\">\n    <Comments>\n      <summary>\n        Represents a pattern with a constant value.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# constant pattern</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Value\" Type=\"IOperation\">\n      <Comments>\n        <summary>Constant value of the pattern operation.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IDeclarationPatternOperation\" Base=\"IPatternOperation\">\n    <Comments>\n      <summary>\n        Represents a pattern that declares a symbol.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# declaration pattern</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"MatchedType\" Type=\"ITypeSymbol?\">\n      <Comments>\n        <summary>\n          The type explicitly specified, or null if it was inferred (e.g. using <see langword=\"var\" /> in C#).\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"MatchesNull\" Type=\"bool\">\n      <Comments>\n        <summary>\n          True if the pattern is of a form that accepts null.\n          For example, in C# the pattern `var x` will match a null input,\n          while the pattern `string x` will not.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"DeclaredSymbol\" Type=\"ISymbol?\">\n      <Comments>\n        <summary>Symbol declared by the pattern, if any.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"ITupleBinaryOperation\" Base=\"IOperation\" VisitorName=\"VisitTupleBinaryOperator\" ChildrenOrder=\"LeftOperand,RightOperand\" HasType=\"true\">\n    <OperationKind>\n      <Entry Name=\"TupleBinary\" Value=\"0x57\" />\n      <Entry Name=\"TupleBinaryOperator\" Value=\"0x57\" EditorBrowsable=\"false\" ExtraDescription=\"Use &lt;see cref=&quot;TupleBinary&quot;/&gt; instead.\" />\n    </OperationKind>\n    <Comments>\n      <summary>\n        Represents a comparison of two operands that returns a bool type.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# tuple binary operator expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"OperatorKind\" Type=\"BinaryOperatorKind\">\n      <Comments>\n        <summary>Kind of binary operation.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"LeftOperand\" Type=\"IOperation\">\n      <Comments>\n        <summary>Left operand.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"RightOperand\" Type=\"IOperation\">\n      <Comments>\n        <summary>Right operand.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <AbstractNode Name=\"IMethodBodyBaseOperation\" Base=\"IOperation\">\n    <Comments>\n      <summary>\n        Represents a method body operation.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# method body</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"BlockBody\" Type=\"IBlockOperation?\">\n      <Comments>\n        <summary>Method body corresponding to BaseMethodDeclarationSyntax.Body or AccessorDeclarationSyntax.Body</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"ExpressionBody\" Type=\"IBlockOperation?\">\n      <Comments>\n        <summary>Method body corresponding to BaseMethodDeclarationSyntax.ExpressionBody or AccessorDeclarationSyntax.ExpressionBody</summary>\n      </Comments>\n    </Property>\n  </AbstractNode>\n  <Node Name=\"IMethodBodyOperation\" Base=\"IMethodBodyBaseOperation\" VisitorName=\"VisitMethodBodyOperation\" ChildrenOrder=\"BlockBody,ExpressionBody\">\n    <OperationKind>\n      <Entry Name=\"MethodBody\" Value=\"0x58\" />\n      <Entry Name=\"MethodBodyOperation\" Value=\"0x58\" EditorBrowsable=\"false\" ExtraDescription=\"Use &lt;see cref=&quot;MethodBody&quot;/&gt; instead.\" />\n    </OperationKind>\n    <Comments>\n      <summary>\n        Represents a method body operation.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# method body for non-constructor</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n  </Node>\n  <Node Name=\"IConstructorBodyOperation\" Base=\"IMethodBodyBaseOperation\" VisitorName=\"VisitConstructorBodyOperation\" ChildrenOrder=\"Initializer,BlockBody,ExpressionBody\">\n    <OperationKind>\n      <Entry Name=\"ConstructorBody\" Value=\"0x59\" />\n      <Entry Name=\"ConstructorBodyOperation\" Value=\"0x59\" EditorBrowsable=\"false\" ExtraDescription=\"Use &lt;see cref=&quot;ConstructorBody&quot;/&gt; instead.\" />\n    </OperationKind>\n    <Comments>\n      <summary>\n        Represents a constructor method body operation.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# method body for constructor declaration</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Locals\" Type=\"ImmutableArray&lt;ILocalSymbol&gt;\">\n      <Comments>\n        <summary>Local declarations contained within the <see cref=\"Initializer\" />.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Initializer\" Type=\"IOperation?\">\n      <Comments>\n        <summary>Constructor initializer, if any.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IDiscardOperation\" Base=\"IOperation\" VisitorName=\"VisitDiscardOperation\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents a discard operation.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# discard expressions</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"DiscardSymbol\" Type=\"IDiscardSymbol\">\n      <Comments>\n        <summary>The symbol of the discard operation.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IFlowCaptureOperation\" Base=\"IOperation\" Namespace=\"FlowAnalysis\" SkipInCloner=\"true\">\n    <Comments>\n      <summary>\n        Represents that an intermediate result is being captured.\n        This node is produced only as part of a <see cref=\"ControlFlowGraph\" />.\n      </summary>\n    </Comments>\n    <Property Name=\"Id\" Type=\"CaptureId\">\n      <Comments>\n        <summary>An id used to match references to the same intermediate result.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Value\" Type=\"IOperation\">\n      <Comments>\n        <summary>Value to be captured.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IFlowCaptureReferenceOperation\" Base=\"IOperation\" Namespace=\"FlowAnalysis\" HasType=\"true\" HasConstantValue=\"true\">\n    <Comments>\n      <summary>\n        Represents a point of use of an intermediate result captured earlier.\n        The fact of capturing the result is represented by <see cref=\"IFlowCaptureOperation\" />.\n        This node is produced only as part of a <see cref=\"ControlFlowGraph\" />.\n      </summary>\n    </Comments>\n    <Property Name=\"Id\" Type=\"CaptureId\">\n      <Comments>\n        <summary>An id used to match references to the same intermediate result.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"IsInitialization\" Type=\"bool\">\n      <Comments>\n        <summary>True if this reference to the capture initializes the capture. Used when the capture is being initialized by being passed as an <see langword=\"out\" /> parameter.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IIsNullOperation\" Base=\"IOperation\" Namespace=\"FlowAnalysis\" SkipInCloner=\"true\" HasType=\"true\" HasConstantValue=\"true\">\n    <Comments>\n      <summary>\n        Represents result of checking whether the <see cref=\"Operand\" /> is null.\n        For reference types this checks if the <see cref=\"Operand\" /> is a null reference,\n        for nullable types this checks if the <see cref=\"Operand\" /> doesn’t have a value.\n        The node is produced as part of a flow graph during rewrite of <see cref=\"ICoalesceOperation\" />\n        and <see cref=\"IConditionalAccessOperation\" /> nodes.\n      </summary>\n    </Comments>\n    <Property Name=\"Operand\" Type=\"IOperation\">\n      <Comments>\n        <summary>Value to check.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"ICaughtExceptionOperation\" Base=\"IOperation\" Namespace=\"FlowAnalysis\" SkipInCloner=\"true\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents a exception instance passed by an execution environment to an exception filter or handler.\n        This node is produced only as part of a <see cref=\"ControlFlowGraph\" />.\n      </summary>\n    </Comments>\n  </Node>\n  <Node Name=\"IStaticLocalInitializationSemaphoreOperation\" Base=\"IOperation\" Namespace=\"FlowAnalysis\" SkipInCloner=\"true\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents the check during initialization of a VB static local that is initialized on the first call of the function, and never again.\n        If the semaphore operation returns true, the static local has not yet been initialized, and the initializer will be run. If it returns\n        false, then the local has already been initialized, and the static local initializer region will be skipped.\n        This node is produced only as part of a <see cref=\"ControlFlowGraph\" />.\n      </summary>\n    </Comments>\n    <Property Name=\"Local\" Type=\"ILocalSymbol\">\n      <Comments>\n        <summary>The static local variable that is possibly initialized.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IFlowAnonymousFunctionOperation\" Base=\"IOperation\" Namespace=\"FlowAnalysis\" SkipClassGeneration=\"true\">\n    <Comments>\n      <summary>\n        Represents an anonymous function operation in context of a <see cref=\"ControlFlowGraph\" />.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# lambda expression</description></item>\n          <item><description>VB anonymous delegate expression</description></item>\n        </list>\n        </para>\n        A <see cref=\"ControlFlowGraph\" /> for the body of the anonymous function is available from\n        the enclosing <see cref=\"ControlFlowGraph\" />.\n      </summary>\n    </Comments>\n    <Property Name=\"Symbol\" Type=\"IMethodSymbol\">\n      <Comments>\n        <summary>Symbol of the anonymous function.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"ICoalesceAssignmentOperation\" Base=\"IAssignmentOperation\" ChildrenOrder=\"Target,Value\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents a coalesce assignment operation with a target and a conditionally-evaluated value:\n        <list type=\"number\">\n          <item><description><see cref=\"IAssignmentOperation.Target\" /> is evaluated for null. If it is null, <see cref=\"IAssignmentOperation.Value\" /> is evaluated and assigned to target</description></item>\n          <item><description><see cref=\"IAssignmentOperation.Value\" /> is conditionally evaluated if <see cref=\"IAssignmentOperation.Target\" /> is null, and the result is assigned into <see cref=\"IAssignmentOperation.Target\" /></description></item>\n        </list>\n        The result of the entire expression is <see cref=\"IAssignmentOperation.Target\" />, which is only evaluated once.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# null-coalescing assignment operation <c>Target ??= Value</c></description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n  </Node>\n  <Node Name=\"IRangeOperation\" Base=\"IOperation\" VisitorName=\"VisitRangeOperation\" ChildrenOrder=\"LeftOperand,RightOperand\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents a range operation.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# range expressions</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"LeftOperand\" Type=\"IOperation?\">\n      <Comments>\n        <summary>Left operand.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"RightOperand\" Type=\"IOperation?\">\n      <Comments>\n        <summary>Right operand.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"IsLifted\" Type=\"bool\">\n      <Comments>\n        <summary>\n          <see langword=\"true\" /> if this is a 'lifted' range operation.  When there is an\n          operator that is defined to work on a value type, 'lifted' operators are\n          created to work on the <see cref=\"System.Nullable{T}\" /> versions of those\n          value types.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Method\" Type=\"IMethodSymbol?\">\n      <Comments>\n        <summary>\n          Factory method used to create this Range value. Can be null if appropriate\n          symbol was not found.\n        </summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IReDimOperation\" Base=\"IOperation\">\n    <Comments>\n      <summary>\n        Represents the ReDim operation to re-allocate storage space for array variables.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>VB ReDim statement</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Clauses\" Type=\"ImmutableArray&lt;IReDimClauseOperation&gt;\">\n      <Comments>\n        <summary>Individual clauses of the ReDim operation.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Preserve\" Type=\"bool\">\n      <Comments>\n        <summary>Modifier used to preserve the data in the existing array when you change the size of only the last dimension.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IReDimClauseOperation\" Base=\"IOperation\" ChildrenOrder=\"Operand,DimensionSizes\">\n    <Comments>\n      <summary>\n        Represents an individual clause of an <see cref=\"IReDimOperation\" /> to re-allocate storage space for a single array variable.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>VB ReDim clause</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Operand\" Type=\"IOperation\">\n      <Comments>\n        <summary>Operand whose storage space needs to be re-allocated.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"DimensionSizes\" Type=\"ImmutableArray&lt;IOperation&gt;\">\n      <Comments>\n        <summary>Sizes of the dimensions of the created array instance.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IRecursivePatternOperation\" Base=\"IPatternOperation\" ChildrenOrder=\"DeconstructionSubpatterns,PropertySubpatterns\">\n    <Comments>\n      <summary>Represents a C# recursive pattern.</summary>\n    </Comments>\n    <Property Name=\"MatchedType\" Type=\"ITypeSymbol\">\n      <Comments>\n        <summary>The type accepted for the recursive pattern.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"DeconstructSymbol\" Type=\"ISymbol?\">\n      <Comments>\n        <summary>\n          The symbol, if any, used for the fetching values for subpatterns. This is either a <c>Deconstruct</c>\n          method, the type <c>System.Runtime.CompilerServices.ITuple</c>, or null (for example, in\n          error cases or when matching a tuple type).\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"DeconstructionSubpatterns\" Type=\"ImmutableArray&lt;IPatternOperation&gt;\">\n      <Comments>\n        <summary>This contains the patterns contained within a deconstruction or positional subpattern.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"PropertySubpatterns\" Type=\"ImmutableArray&lt;IPropertySubpatternOperation&gt;\">\n      <Comments>\n        <summary>This contains the (symbol, property) pairs within a property subpattern.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"DeclaredSymbol\" Type=\"ISymbol?\">\n      <Comments>\n        <summary>Symbol declared by the pattern.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IDiscardPatternOperation\" Base=\"IPatternOperation\">\n    <Comments>\n      <summary>\n        Represents a discard pattern.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# discard pattern</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n  </Node>\n  <Node Name=\"ISwitchExpressionOperation\" Base=\"IOperation\" ChildrenOrder=\"Value,Arms\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents a switch expression.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# switch expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Value\" Type=\"IOperation\">\n      <Comments>\n        <summary>Value to be switched upon.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Arms\" Type=\"ImmutableArray&lt;ISwitchExpressionArmOperation&gt;\">\n      <Comments>\n        <summary>Arms of the switch expression.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"IsExhaustive\" Type=\"bool\">\n        <Comments>\n            <summary>True if the switch expressions arms cover every possible input value.</summary>\n        </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"ISwitchExpressionArmOperation\" Base=\"IOperation\" ChildrenOrder=\"Pattern,Guard,Value\">\n    <Comments>\n      <summary>Represents one arm of a switch expression.</summary>\n    </Comments>\n    <Property Name=\"Pattern\" Type=\"IPatternOperation\">\n      <Comments>\n        <summary>The pattern to match.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Guard\" Type=\"IOperation?\">\n      <Comments>\n        <summary>Guard (when clause expression) associated with the switch arm, if any.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Value\" Type=\"IOperation\">\n      <Comments>\n        <summary>Result value of the enclosing switch expression when this arm matches.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Locals\" Type=\"ImmutableArray&lt;ILocalSymbol&gt;\">\n      <Comments>\n        <summary>Locals declared within the switch arm (e.g. pattern locals and locals declared in the guard) scoped to the arm.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IPropertySubpatternOperation\" Base=\"IOperation\" ChildrenOrder=\"Member,Pattern\">\n    <Comments>\n      <summary>\n        Represents an element of a property subpattern, which identifies a member to be matched and the\n        pattern to match it against.\n      </summary>\n    </Comments>\n    <Property Name=\"Member\" Type=\"IOperation\">\n      <Comments>\n        <summary>\n          The member being matched in a property subpattern.  This can be a <see cref=\"IMemberReferenceOperation\" />\n          in non-error cases, or an <see cref=\"IInvalidOperation\" /> in error cases.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Pattern\" Type=\"IPatternOperation\">\n      <Comments>\n        <summary>The pattern to which the member is matched in a property subpattern.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IAggregateQueryOperation\" Base=\"IOperation\" Internal=\"true\" ChildrenOrder=\"Group,Aggregation\" HasType=\"true\">\n    <Comments>\n      <summary>Represents a standalone VB query Aggregate operation with more than one item in Into clause.</summary>\n    </Comments>\n    <Property Name=\"Group\" Type=\"IOperation\" />\n    <Property Name=\"Aggregation\" Type=\"IOperation\" />\n  </Node>\n  <Node Name=\"IFixedOperation\" Base=\"IOperation\" Internal=\"true\" SkipInVisitor=\"true\" ChildrenOrder=\"Variables,Body\">\n    <!-- Making this public is tracked by https://github.com/dotnet/roslyn/issues/21281 -->\n    <Comments>\n      <summary>Represents a C# fixed statement.</summary>\n    </Comments>\n    <Property Name=\"Locals\" Type=\"ImmutableArray&lt;ILocalSymbol&gt;\">\n      <Comments>\n        <summary>Locals declared.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Variables\" Type=\"IVariableDeclarationGroupOperation\">\n      <Comments>\n        <summary>Variables to be fixed.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Body\" Type=\"IOperation\">\n      <Comments>\n        <summary>Body of the fixed, over which the variables are fixed.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"INoPiaObjectCreationOperation\" Base=\"IOperation\" Internal=\"true\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents a creation of an instance of a NoPia interface, i.e. new I(), where I is an embedded NoPia interface.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# NoPia interface instance creation expression</description></item>\n          <item><description>VB NoPia interface instance creation expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Initializer\" Type=\"IObjectOrCollectionInitializerOperation?\">\n      <Comments>\n        <summary>Object or collection initializer, if any.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IPlaceholderOperation\" Base=\"IOperation\" Internal=\"true\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents a general placeholder when no more specific kind of placeholder is available.\n        A placeholder is an expression whose meaning is inferred from context.\n      </summary>\n    </Comments>\n    <Property Name=\"PlaceholderKind\" Type=\"PlaceholderKind\" />\n  </Node>\n  <Node Name=\"IPointerIndirectionReferenceOperation\" Base=\"IOperation\" SkipClassGeneration=\"true\" Internal=\"true\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents a reference through a pointer.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# pointer indirection reference expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Pointer\" Type=\"IOperation\">\n      <Comments>\n        <summary>Pointer to be dereferenced.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IWithStatementOperation\" Base=\"IOperation\" Internal=\"true\" ChildrenOrder=\"Value,Body\">\n    <Comments>\n      <summary>\n        Represents a <see cref=\"Body\" /> of operations that are executed with implicit reference to the <see cref=\"Value\" /> for member references.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>VB With statement</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Body\" Type=\"IOperation\">\n      <Comments>\n        <summary>Body of the with.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Value\" Type=\"IOperation\">\n      <Comments>\n        <summary>Value to whose members leading-dot-qualified references within the with body bind.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IUsingDeclarationOperation\" Base=\"IOperation\">\n    <Comments>\n      <summary>\n        Represents using variable declaration, with scope spanning across the parent <see cref=\"IBlockOperation\"/>.\n        <para>\n        Current Usage:\n        <list type=\"number\">\n          <item><description>C# using declaration</description></item>\n          <item><description>C# asynchronous using declaration</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"DeclarationGroup\" Type=\"IVariableDeclarationGroupOperation\">\n      <Comments>\n        <summary>The variables declared by this using declaration.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"IsAsynchronous\" Type=\"bool\">\n      <Comments>\n        <summary>True if this is an asynchronous using declaration.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"DisposeInfo\" Type=\"DisposeOperationInfo\" Internal=\"true\">\n      <Comments>\n        <summary>Information about the method that will be invoked to dispose the declared instances when pattern based disposal is used.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"INegatedPatternOperation\" Base=\"IPatternOperation\">\n    <Comments>\n      <summary>\n        Represents a negated pattern.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# negated pattern</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Pattern\" Type=\"IPatternOperation\">\n      <Comments>\n        <summary>The negated pattern.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IBinaryPatternOperation\" Base=\"IPatternOperation\" ChildrenOrder=\"LeftPattern,RightPattern\">\n    <Comments>\n      <summary>\n        Represents a binary (\"and\" or \"or\") pattern.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# \"and\" and \"or\" patterns</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"OperatorKind\" Type=\"BinaryOperatorKind\">\n      <Comments>\n        <summary>Kind of binary pattern; either <see cref=\"BinaryOperatorKind.And\"/> or <see cref=\"BinaryOperatorKind.Or\"/>.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"LeftPattern\" Type=\"IPatternOperation\">\n      <Comments>\n        <summary>The pattern on the left.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"RightPattern\" Type=\"IPatternOperation\">\n      <Comments>\n        <summary>The pattern on the right.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"ITypePatternOperation\" Base=\"IPatternOperation\">\n    <Comments>\n      <summary>\n        Represents a pattern comparing the input with a given type.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# type pattern</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"MatchedType\" Type=\"ITypeSymbol\">\n      <Comments>\n        <summary>\n          The type explicitly specified, or null if it was inferred (e.g. using <see langword=\"var\" /> in C#).\n        </summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IRelationalPatternOperation\" Base=\"IPatternOperation\">\n    <Comments>\n      <summary>\n        Represents a pattern comparing the input with a constant value using a relational operator.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# relational pattern</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"OperatorKind\" Type=\"BinaryOperatorKind\">\n      <Comments>\n        <summary>The kind of the relational operator.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Value\" Type=\"IOperation\">\n      <Comments>\n        <summary>Constant value of the pattern operation.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IWithOperation\" Base=\"IOperation\" ChildrenOrder=\"Operand,Initializer\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents cloning of an object instance.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# with expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Operand\" Type=\"IOperation\">\n      <Comments>\n        <summary>Operand to be cloned.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"CloneMethod\" Type=\"IMethodSymbol?\">\n      <Comments>\n        <summary>Clone method to be invoked on the value. This can be null in error scenarios.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Initializer\" Type=\"IObjectOrCollectionInitializerOperation\">\n      <Comments>\n        <summary>With collection initializer.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IInterpolatedStringHandlerCreationOperation\" Base=\"IOperation\" ChildrenOrder=\"HandlerCreation,Content\" HasType=\"true\">\n    <Comments>\n      <summary>Represents an interpolated string converted to a custom interpolated string handler type.</summary>\n    </Comments>\n    <Property Name=\"HandlerCreation\" Type=\"IOperation\">\n      <Comments>\n        <summary>\n          The construction of the interpolated string handler instance. This can be an <see cref=\"IObjectCreationOperation\"/> for valid code, and\n          <see cref=\"IDynamicObjectCreationOperation\"/> or <see cref=\"IInvalidOperation\"/> for invalid code.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"HandlerCreationHasSuccessParameter\" Type=\"bool\">\n      <Comments>\n        <summary>\n          True if the last parameter of <see cref=\"HandlerCreation\"/> is an out <see langword=\"bool\"/> parameter that will be checked before executing the code in\n          <see cref=\"Content\"/>. False otherwise.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"HandlerAppendCallsReturnBool\" Type=\"bool\">\n      <Comments>\n        <summary>\n          True if the AppendLiteral or AppendFormatted calls in nested <see cref=\"IInterpolatedStringOperation.Parts\"/> return <see langword=\"bool\"/>. When that is true, each part\n          will be conditional on the return of the part before it, only being executed when the Append call returns true. False otherwise.\n        </summary>\n        <remarks>\n          when this is true and <see cref=\"HandlerCreationHasSuccessParameter\"/> is true, then the first part in nested <see cref=\"IInterpolatedStringOperation.Parts\"/> is conditionally\n          run. If this is true and <see cref=\"HandlerCreationHasSuccessParameter\"/> is false, then the first part is unconditionally run.\n          <br/>\n          Just because this is true or false does not guarantee that all Append calls actually do return boolean values, as there could be dynamic calls or errors.\n          It only governs what the compiler was expecting, based on the first calls it did see.\n        </remarks>\n      </Comments>\n    </Property>\n    <Property Name=\"Content\" Type=\"IOperation\">\n      <Comments>\n        <summary>\n          The interpolated string expression or addition operation that makes up the content of this string. This is either an <see cref=\"IInterpolatedStringOperation\"/>\n          or an <see cref=\"IInterpolatedStringAdditionOperation\"/> operation.\n        </summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IInterpolatedStringAdditionOperation\" Base=\"IOperation\" ChildrenOrder=\"Left,Right\">\n    <Comments>\n      <summary>\n        Represents an addition of multiple interpolated string literals being converted to an interpolated string handler type.\n      </summary>\n    </Comments>\n    <Property Name=\"Left\" Type=\"IOperation\">\n      <Comments>\n        <summary>\n          The interpolated string expression or addition operation on the left side of the operator. This is either an <see cref=\"IInterpolatedStringOperation\"/>\n          or an <see cref=\"IInterpolatedStringAdditionOperation\"/> operation.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Right\" Type=\"IOperation\">\n      <Comments>\n        <summary>\n          The interpolated string expression or addition operation on the right side of the operator. This is either an <see cref=\"IInterpolatedStringOperation\"/>\n          or an <see cref=\"IInterpolatedStringAdditionOperation\"/> operation.\n        </summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IInterpolatedStringAppendOperation\" Base=\"IInterpolatedStringContentOperation\">\n    <OperationKind>\n      <Entry Name=\"InterpolatedStringAppendLiteral\" Value=\"0x74\" ExtraDescription=\"This append is of a literal component\"/>\n      <Entry Name=\"InterpolatedStringAppendFormatted\" Value=\"0x75\" ExtraDescription=\"This append is of an interpolation component\"/>\n      <Entry Name=\"InterpolatedStringAppendInvalid\" Value=\"0x76\" ExtraDescription=\"This append is invalid\"/>\n    </OperationKind>\n    <Comments>\n      <summary>Represents a call to either AppendLiteral or AppendFormatted as part of an interpolated string handler conversion.</summary>\n    </Comments>\n    <Property Name=\"AppendCall\" Type=\"IOperation\">\n      <Comments>\n        <summary>\n          If this interpolated string is subject to an interpolated string handler conversion, the construction of the interpolated string handler instance.\n          This can be an <see cref=\"IInvocationOperation\"/>  or <see cref=\"IDynamicInvocationOperation\"/> for valid code, and <see cref=\"IInvalidOperation\"/> for invalid code.\n        </summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IInterpolatedStringHandlerArgumentPlaceholderOperation\" Base=\"IOperation\">\n    <Comments>\n      <summary>Represents an argument from the method call, indexer access, or constructor invocation that is creating the containing <see cref=\"IInterpolatedStringHandlerCreationOperation\"/></summary>\n    </Comments>\n    <Property Name=\"ArgumentIndex\" Type=\"int\">\n      <Comments>\n        <summary>\n          The index of the argument of the method call, indexer, or object creation containing the interpolated string handler conversion this placeholder is referencing.\n          -1 if <see cref=\"PlaceholderKind\" /> is anything other than <see cref=\"InterpolatedStringArgumentPlaceholderKind.CallsiteArgument\"/>.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"PlaceholderKind\" Type=\"InterpolatedStringArgumentPlaceholderKind\">\n      <Comments>\n        <summary>\n          The component this placeholder represents.\n        </summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IFunctionPointerInvocationOperation\" Base=\"IOperation\" ChildrenOrder=\"Target,Arguments\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents an invocation of a function pointer.\n      </summary>\n    </Comments>\n\t<Property Name=\"Target\" Type=\"IOperation\">\n      <Comments>\n        <summary>Invoked pointer.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Arguments\" Type=\"ImmutableArray&lt;IArgumentOperation&gt;\">\n      <Comments>\n        <summary>Arguments of the invocation. Arguments are in evaluation order.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IListPatternOperation\" Base=\"IPatternOperation\">\n    <Comments>\n      <summary>Represents a C# list pattern.</summary>\n    </Comments>\n    <Property Name=\"LengthSymbol\" Type=\"ISymbol?\">\n      <Comments>\n        <summary>\n          The <c>Length</c> or <c>Count</c> property that is used to fetch the length value.\n          Returns <c>null</c> if no such property is found.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"IndexerSymbol\" Type=\"ISymbol?\">\n      <Comments>\n        <summary>\n          The indexer that is used to fetch elements.\n          Returns <c>null</c> for an array input.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Patterns\" Type=\"ImmutableArray&lt;IPatternOperation&gt;\">\n      <Comments>\n        <summary>\n          Returns subpatterns contained within the list pattern.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"DeclaredSymbol\" Type=\"ISymbol?\">\n      <Comments>\n        <summary>Symbol declared by the pattern, if any.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"ISlicePatternOperation\" Base=\"IPatternOperation\">\n    <Comments>\n      <summary>\n        Represents a C# slice pattern.\n      </summary>\n    </Comments>\n    <Property Name=\"SliceSymbol\" Type=\"ISymbol?\">\n      <Comments>\n        <summary>\n          The range indexer or the <c>Slice</c> method used to fetch the slice value.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Pattern\" Type=\"IPatternOperation?\">\n      <Comments>\n        <summary>\n          The pattern that the slice value is matched with, if any.\n        </summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IImplicitIndexerReferenceOperation\" Base=\"IOperation\" ChildrenOrder=\"Instance,Argument\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents a reference to an implicit System.Index or System.Range indexer over a non-array type.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# implicit System.Index or System.Range indexer reference expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Instance\" Type=\"IOperation\">\n      <Comments>\n        <summary>Instance of the type to be indexed.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Argument\" Type=\"IOperation\">\n      <Comments>\n        <summary>System.Index or System.Range value.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"LengthSymbol\" Type=\"ISymbol\">\n      <Comments>\n        <summary>\n          The <c>Length</c> or <c>Count</c> property that might be used to fetch the length value.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"IndexerSymbol\" Type=\"ISymbol\">\n      <Comments>\n        <summary>\n          Symbol for the underlying indexer or a slice method that is used to implement the implicit indexer.\n        </summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IUtf8StringOperation\" Base=\"IOperation\" HasType=\"true\" HasConstantValue=\"false\">\n    <Comments>\n      <summary>\n        Represents a UTF-8 encoded byte representation of a string.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# UTF-8 string literal expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Value\" Type=\"string\">\n      <Comments>\n        <summary>The underlying string value.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IAttributeOperation\" Base=\"IOperation\">\n    <Comments>\n      <summary>\n        Represents the application of an attribute.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# attribute application</description></item>\n          <item><description>VB attribute application</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Operation\" Type=\"IOperation\">\n      <Comments>\n        <summary>The operation representing the attribute. This can be a <see cref=\"IObjectCreationOperation\" /> in non-error cases, or an <see cref=\"IInvalidOperation\" /> in error cases.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"IInlineArrayAccessOperation\" Base=\"IOperation\" ChildrenOrder=\"Instance,Argument\" HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents an element reference or a slice operation over an inline array type.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# inline array access</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Instance\" Type=\"IOperation\">\n      <Comments>\n        <summary>Instance of the inline array type to be accessed.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Argument\" Type=\"IOperation\">\n      <Comments>\n        <summary>System.Int32, System.Index or System.Range value.</summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"ICollectionExpressionOperation\" Base=\"IOperation\"  HasType=\"true\">\n    <Comments>\n      <summary>\n        Represents a collection expression.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# collection expression</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"ConstructMethod\" Type=\"IMethodSymbol?\">\n      <Comments>\n        <summary>\n          Method used to construct the collection.\n          <para>\n            If the collection type is an array, span, array interface, or type parameter, the method is null;\n            if the collection type has a [CollectionBuilder] attribute, the method is the builder method;\n            otherwise, the method is the collection type constructor.\n          </para>\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"Elements\" Type=\"ImmutableArray&lt;IOperation&gt;\">\n      <Comments>\n        <summary>\n          Collection expression elements.\n          <para>\n            If the element is an expression, the entry is the expression, with a conversion to\n            the target element type if necessary;\n            otherwise, the entry is an ISpreadOperation.\n          </para>\n        </summary>\n      </Comments>\n    </Property>\n  </Node>\n  <Node Name=\"ISpreadOperation\" Base=\"IOperation\" HasType=\"false\">\n      <Comments>\n      <summary>\n        Represents a collection expression spread element.\n        <para>\n        Current usage:\n        <list type=\"number\">\n          <item><description>C# spread element</description></item>\n        </list>\n        </para>\n      </summary>\n    </Comments>\n    <Property Name=\"Operand\" Type=\"IOperation\">\n      <Comments>\n        <summary>Collection being spread.</summary>\n      </Comments>\n    </Property>\n    <Property Name=\"ElementType\" Type=\"ITypeSymbol?\">\n      <Comments>\n        <summary>\n          Type of the elements in the collection.\n        </summary>\n      </Comments>\n    </Property>\n    <Property Name=\"ElementConversion\" Type=\"CommonConversion\">\n      <Comments>\n        <summary>\n          Conversion from the type of the collection element to the target element type\n          of the containing collection expression.\n        </summary>\n      </Comments>\n    </Property>\n  </Node>\n</Tree>\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/README.md",
    "content": "# Roslyn Shim Layer\n\n## Purpose\n\nEnables the new Roslyn API usage while maintaining compatibility with old versions.\n\n## Structure\n\nThe project is divided into the following parts:\n- At the root level is the `Lightup` layer introduced by the stylecop analyzers. The code was copied from\n  https://github.com/DotNetAnalyzers/StyleCopAnalyzers/tree/master/StyleCop.Analyzers/StyleCop.Analyzers/Lightup excepting `Syntax.xml` and `OperationInterfaces.xml`.\n- [Syntax.xml](https://github.com/dotnet/roslyn/blob/main/src/Compilers/CSharp/Portable/Syntax/Syntax.xml) and [OperationInterfaces.xml](https://github.com/dotnet/roslyn/blob/main/src/Compilers/Core/Portable/Operations/OperationInterfaces.xml) are copied from the Roslyn repository (ideally, from the latest release version branch).\nThey are used to generate the `Lightup` layer. We copy them from Roslyn and not from StyleCopAnalyzers to ensure that we have the most recent version to be able to support the latest features.\n- All the additions made by SonarSource are in the `Sonar` folder.\n\n## Conventions\n\n- Keep our changes and all logic in a dedicated directory `Sonar`, using partial classes, extension methods, and external handlers.\n- Keep the namespace. Have different license headers.\n- Inject ourselves to the StyleCop code with minimal changes that are annotated with `// Sonar` comment everywhere.\n- When importing `Syntax.xml` and `OperationInterfaces.xml`, it's important to maintain the original file content, including the whitespaces. To ensure this, download the file directly into the project directory. If you opt to copy and paste the content, you risk losing the whitespaces, which can make the diff more challenging to read and future updates more difficult to implement.\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/SeparatedSyntaxListWrapper`1.cs",
    "content": "﻿// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.\n// Licensed under the MIT License. See LICENSE in the project root for license information.\n\n#nullable disable\n\nnamespace StyleCop.Analyzers.Lightup\n{\n    using System;\n    using System.Collections;\n    using System.Collections.Generic;\n    using System.Collections.Immutable;\n    using System.ComponentModel;\n    using System.Linq;\n    using Microsoft.CodeAnalysis;\n    using Microsoft.CodeAnalysis.Text;\n\n    public abstract class SeparatedSyntaxListWrapper<TNode> : IEquatable<SeparatedSyntaxListWrapper<TNode>>, IReadOnlyList<TNode>\n    {\n        private static readonly SyntaxWrapper<TNode> SyntaxWrapper = SyntaxWrapper<TNode>.Default;\n\n        public static SeparatedSyntaxListWrapper<TNode> UnsupportedEmpty { get; } =\n            new UnsupportedSyntaxList();\n\n        public abstract int Count\n        {\n            get;\n        }\n\n        public abstract TextSpan FullSpan\n        {\n            get;\n        }\n\n        public abstract int SeparatorCount\n        {\n            get;\n        }\n\n        public abstract TextSpan Span\n        {\n            get;\n        }\n\n        [EditorBrowsable(EditorBrowsableState.Never)]\n        public abstract object UnderlyingList\n        {\n            get;\n        }\n\n        public abstract TNode this[int index]\n        {\n            get;\n        }\n\n        public static bool operator ==(SeparatedSyntaxListWrapper<TNode> left, SeparatedSyntaxListWrapper<TNode> right)\n        {\n            // Currently unused\n            _ = left;\n            _ = right;\n\n            throw new NotImplementedException();\n        }\n\n        public static bool operator !=(SeparatedSyntaxListWrapper<TNode> left, SeparatedSyntaxListWrapper<TNode> right)\n        {\n            // Currently unused\n            _ = left;\n            _ = right;\n\n            throw new NotImplementedException();\n        }\n\n        // Summary:\n        //     Creates a new list with the specified node added to the end.\n        //\n        // Parameters:\n        //   node:\n        //     The node to add.\n        public SeparatedSyntaxListWrapper<TNode> Add(TNode node)\n            => this.Insert(this.Count, node);\n\n        // Summary:\n        //     Creates a new list with the specified nodes added to the end.\n        //\n        // Parameters:\n        //   nodes:\n        //     The nodes to add.\n        public SeparatedSyntaxListWrapper<TNode> AddRange(IEnumerable<TNode> nodes)\n            => this.InsertRange(this.Count, nodes);\n\n        public abstract bool Any();\n\n        public abstract bool Contains(TNode node);\n\n        public bool Equals(SeparatedSyntaxListWrapper<TNode> other)\n        {\n            throw new NotImplementedException();\n        }\n\n        public override bool Equals(object obj)\n        {\n            throw new NotImplementedException();\n        }\n\n        public abstract TNode First();\n\n        public abstract TNode FirstOrDefault();\n\n        public Enumerator GetEnumerator()\n        {\n            return new Enumerator(this);\n        }\n\n        IEnumerator<TNode> IEnumerable<TNode>.GetEnumerator()\n        {\n            return this.GetEnumerator();\n        }\n\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return ((IEnumerable<TNode>)this).GetEnumerator();\n        }\n\n        public override abstract int GetHashCode();\n\n        public abstract SyntaxToken GetSeparator(int index);\n\n        public abstract IEnumerable<SyntaxToken> GetSeparators();\n\n        public abstract SyntaxNodeOrTokenList GetWithSeparators();\n\n        public abstract int IndexOf(Func<TNode, bool> predicate);\n\n        public abstract int IndexOf(TNode node);\n\n        public abstract SeparatedSyntaxListWrapper<TNode> Insert(int index, TNode node);\n\n        public abstract SeparatedSyntaxListWrapper<TNode> InsertRange(int index, IEnumerable<TNode> nodes);\n\n        public abstract TNode Last();\n\n        public abstract int LastIndexOf(Func<TNode, bool> predicate);\n\n        public abstract int LastIndexOf(TNode node);\n\n        public abstract TNode LastOrDefault();\n\n        public abstract SeparatedSyntaxListWrapper<TNode> Remove(TNode node);\n\n        public abstract SeparatedSyntaxListWrapper<TNode> RemoveAt(int index);\n\n        public abstract SeparatedSyntaxListWrapper<TNode> Replace(TNode nodeInList, TNode newNode);\n\n        public abstract SeparatedSyntaxListWrapper<TNode> ReplaceRange(TNode nodeInList, IEnumerable<TNode> newNodes);\n\n        public abstract SeparatedSyntaxListWrapper<TNode> ReplaceSeparator(SyntaxToken separatorToken, SyntaxToken newSeparator);\n\n        public abstract string ToFullString();\n\n        public override abstract string ToString();\n\n        public struct Enumerator : IEnumerator<TNode>\n        {\n            private readonly SeparatedSyntaxListWrapper<TNode> wrapper;\n            private int index;\n            private TNode current;\n\n            public Enumerator(SeparatedSyntaxListWrapper<TNode> wrapper)\n            {\n                this.wrapper = wrapper;\n                this.index = -1;\n                this.current = default;\n            }\n\n            public TNode Current => this.current;\n\n            object IEnumerator.Current => this.Current;\n\n            public override bool Equals(object obj)\n            {\n                Enumerator? otherOpt = obj as Enumerator?;\n                if (!otherOpt.HasValue)\n                {\n                    return false;\n                }\n\n                Enumerator other = otherOpt.GetValueOrDefault();\n                return other.wrapper == this.wrapper\n                    && other.index == this.index;\n            }\n\n            public override int GetHashCode()\n            {\n                if (this.wrapper == null)\n                {\n                    return 0;\n                }\n\n                return this.wrapper.GetHashCode() ^ this.index;\n            }\n\n            public void Dispose()\n            {\n            }\n\n            public bool MoveNext()\n            {\n                if (this.index < -1)\n                {\n                    return false;\n                }\n\n                if (this.index == this.wrapper.Count - 1)\n                {\n                    this.index = int.MinValue;\n                    return false;\n                }\n\n                this.index++;\n                this.current = this.wrapper[this.index];\n                return true;\n            }\n\n            public void Reset()\n            {\n                this.index = -1;\n                this.current = default;\n            }\n        }\n\n        internal sealed class AutoWrapSeparatedSyntaxList<TSyntax> : SeparatedSyntaxListWrapper<TNode>\n            where TSyntax : SyntaxNode\n        {\n            private readonly SeparatedSyntaxList<TSyntax> syntaxList;\n\n            public AutoWrapSeparatedSyntaxList()\n                : this(default)\n            {\n            }\n\n            public AutoWrapSeparatedSyntaxList(SeparatedSyntaxList<TSyntax> syntaxList)\n            {\n                this.syntaxList = syntaxList;\n            }\n\n            public override int Count\n                => this.syntaxList.Count;\n\n            public override TextSpan FullSpan\n                => this.syntaxList.FullSpan;\n\n            public override int SeparatorCount\n                => this.syntaxList.SeparatorCount;\n\n            public override TextSpan Span\n                => this.syntaxList.Span;\n\n            public override object UnderlyingList\n                => this.syntaxList;\n\n            public override TNode this[int index]\n                => SyntaxWrapper.Wrap(this.syntaxList[index]);\n\n            public override bool Any()\n                => this.syntaxList.Any();\n\n            public override bool Contains(TNode node)\n                => this.syntaxList.Contains(SyntaxWrapper.Unwrap(node));\n\n            public override TNode First()\n                => SyntaxWrapper.Wrap(this.syntaxList.First());\n\n            public override TNode FirstOrDefault()\n                => SyntaxWrapper.Wrap(this.syntaxList.FirstOrDefault());\n\n            public override int GetHashCode()\n                => this.syntaxList.GetHashCode();\n\n            public override SyntaxToken GetSeparator(int index)\n                => this.syntaxList.GetSeparator(index);\n\n            public override IEnumerable<SyntaxToken> GetSeparators()\n                => this.syntaxList.GetSeparators();\n\n            public override SyntaxNodeOrTokenList GetWithSeparators()\n                => this.syntaxList.GetWithSeparators();\n\n            public override int IndexOf(TNode node)\n                => this.syntaxList.IndexOf((TSyntax)SyntaxWrapper.Unwrap(node));\n\n            public override int IndexOf(Func<TNode, bool> predicate)\n                => this.syntaxList.IndexOf(node => predicate(SyntaxWrapper.Wrap(node)));\n\n            public override SeparatedSyntaxListWrapper<TNode> Insert(int index, TNode node)\n                => new AutoWrapSeparatedSyntaxList<TSyntax>(this.syntaxList.Insert(index, (TSyntax)SyntaxWrapper.Unwrap(node)));\n\n            public override SeparatedSyntaxListWrapper<TNode> InsertRange(int index, IEnumerable<TNode> nodes)\n                => new AutoWrapSeparatedSyntaxList<TSyntax>(this.syntaxList.InsertRange(index, nodes.Select(node => (TSyntax)SyntaxWrapper.Unwrap(node))));\n\n            public override TNode Last()\n                => SyntaxWrapper.Wrap(this.syntaxList.Last());\n\n            public override int LastIndexOf(TNode node)\n                => this.syntaxList.LastIndexOf((TSyntax)SyntaxWrapper.Unwrap(node));\n\n            public override int LastIndexOf(Func<TNode, bool> predicate)\n                => this.syntaxList.LastIndexOf(node => predicate(SyntaxWrapper.Wrap(node)));\n\n            public override TNode LastOrDefault()\n                => SyntaxWrapper.Wrap(this.syntaxList.LastOrDefault());\n\n            public override SeparatedSyntaxListWrapper<TNode> Remove(TNode node)\n                => new AutoWrapSeparatedSyntaxList<TSyntax>(this.syntaxList.Remove((TSyntax)SyntaxWrapper.Unwrap(node)));\n\n            public override SeparatedSyntaxListWrapper<TNode> RemoveAt(int index)\n                => new AutoWrapSeparatedSyntaxList<TSyntax>(this.syntaxList.RemoveAt(index));\n\n            public override SeparatedSyntaxListWrapper<TNode> Replace(TNode nodeInList, TNode newNode)\n                => new AutoWrapSeparatedSyntaxList<TSyntax>(this.syntaxList.Replace((TSyntax)SyntaxWrapper.Unwrap(nodeInList), (TSyntax)SyntaxWrapper.Unwrap(newNode)));\n\n            public override SeparatedSyntaxListWrapper<TNode> ReplaceRange(TNode nodeInList, IEnumerable<TNode> newNodes)\n                => new AutoWrapSeparatedSyntaxList<TSyntax>(this.syntaxList.ReplaceRange((TSyntax)SyntaxWrapper.Unwrap(nodeInList), newNodes.Select(node => (TSyntax)SyntaxWrapper.Unwrap(node))));\n\n            public override SeparatedSyntaxListWrapper<TNode> ReplaceSeparator(SyntaxToken separatorToken, SyntaxToken newSeparator)\n                => new AutoWrapSeparatedSyntaxList<TSyntax>(this.syntaxList.ReplaceSeparator(separatorToken, newSeparator));\n\n            public override string ToFullString()\n                => this.syntaxList.ToFullString();\n\n            public override string ToString()\n                => this.syntaxList.ToString();\n        }\n\n        private sealed class UnsupportedSyntaxList : SeparatedSyntaxListWrapper<TNode>\n        {\n            private static readonly SeparatedSyntaxList<SyntaxNode> SyntaxList = default;\n\n            public UnsupportedSyntaxList()\n            {\n            }\n\n            public override int Count\n                => 0;\n\n            public override TextSpan FullSpan\n                => SyntaxList.FullSpan;\n\n            public override int SeparatorCount\n                => 0;\n\n            public override TextSpan Span\n                => SyntaxList.Span;\n\n            public override object UnderlyingList\n                => null;\n\n            public override TNode this[int index]\n                => SyntaxWrapper.Wrap(SyntaxList[index]);\n\n            public override bool Any()\n                => false;\n\n            public override bool Contains(TNode node)\n                => false;\n\n            public override TNode First()\n                => SyntaxWrapper.Wrap(SyntaxList.First());\n\n            public override TNode FirstOrDefault()\n                => SyntaxWrapper.Wrap(default);\n\n            public override int GetHashCode()\n                => SyntaxList.GetHashCode();\n\n            public override SyntaxToken GetSeparator(int index)\n                => SyntaxList.GetSeparator(index);\n\n            public override IEnumerable<SyntaxToken> GetSeparators()\n                => SyntaxList.GetSeparators();\n\n            public override SyntaxNodeOrTokenList GetWithSeparators()\n                => SyntaxList.GetWithSeparators();\n\n            public override int IndexOf(TNode node)\n                => SyntaxList.IndexOf(SyntaxWrapper.Unwrap(node));\n\n            public override int IndexOf(Func<TNode, bool> predicate)\n                => SyntaxList.IndexOf(node => predicate(SyntaxWrapper.Wrap(node)));\n\n            public override SeparatedSyntaxListWrapper<TNode> Insert(int index, TNode node)\n            {\n                throw new NotSupportedException();\n            }\n\n            public override SeparatedSyntaxListWrapper<TNode> InsertRange(int index, IEnumerable<TNode> nodes)\n            {\n                throw new NotSupportedException();\n            }\n\n            public override TNode Last()\n                => SyntaxWrapper.Wrap(SyntaxList.Last());\n\n            public override int LastIndexOf(TNode node)\n                => SyntaxList.LastIndexOf(SyntaxWrapper.Unwrap(node));\n\n            public override int LastIndexOf(Func<TNode, bool> predicate)\n                => SyntaxList.LastIndexOf(node => predicate(SyntaxWrapper.Wrap(node)));\n\n            public override TNode LastOrDefault()\n                => SyntaxWrapper.Wrap(default);\n\n            public override SeparatedSyntaxListWrapper<TNode> Remove(TNode node)\n            {\n                throw new NotSupportedException();\n            }\n\n            public override SeparatedSyntaxListWrapper<TNode> RemoveAt(int index)\n            {\n                throw new NotSupportedException();\n            }\n\n            public override SeparatedSyntaxListWrapper<TNode> Replace(TNode nodeInList, TNode newNode)\n            {\n                throw new NotSupportedException();\n            }\n\n            public override SeparatedSyntaxListWrapper<TNode> ReplaceRange(TNode nodeInList, IEnumerable<TNode> newNodes)\n            {\n                throw new NotSupportedException();\n            }\n\n            public override SeparatedSyntaxListWrapper<TNode> ReplaceSeparator(SyntaxToken separatorToken, SyntaxToken newSeparator)\n            {\n                throw new NotSupportedException();\n            }\n\n            public override string ToFullString()\n                => SyntaxList.ToFullString();\n\n            public override string ToString()\n                => SyntaxList.ToString();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/Sonar/CaptureId.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace StyleCop.Analyzers.Lightup;\n\npublic readonly struct CaptureId : IEquatable<CaptureId>\n{\n    private readonly object instance;   // Underlaying struct holds only internal int Value as the identificator.\n\n    public CaptureId(object instance) =>\n        this.instance = instance ?? throw new ArgumentNullException(nameof(instance));\n\n    public override bool Equals(object obj) =>\n        obj is CaptureId capture && Equals(capture);\n\n    public bool Equals(CaptureId other) =>\n        instance.Equals(other.instance);\n\n    public override int GetHashCode() =>\n        instance.GetHashCode();\n\n    public string Serialize() =>\n        \"#Capture-\" + GetHashCode();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/Sonar/CompilationOptionsWrapper.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace StyleCop.Analyzers.Lightup;\n\npublic readonly struct CompilationOptionsWrapper\n{\n    internal const string WrappedTypeName = \"Microsoft.CodeAnalysis.CompilationOptions\";\n    private static readonly Type WrappedType;\n\n    private static readonly Func<CompilationOptions, object> SyntaxTreeOptionsProviderAccessor;\n    private readonly CompilationOptions node;\n\n    public SyntaxTreeOptionsProviderWrapper SyntaxTreeOptionsProvider =>\n        node is null || WrappedType is null ? default : SyntaxTreeOptionsProviderWrapper.FromObject(SyntaxTreeOptionsProviderAccessor(node));\n\n    static CompilationOptionsWrapper()\n    {\n        WrappedType = WrapperHelper.GetWrappedType(typeof(CompilationOptionsWrapper));\n        SyntaxTreeOptionsProviderAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CompilationOptions, object>(WrappedType, nameof(SyntaxTreeOptionsProvider));\n    }\n\n    private CompilationOptionsWrapper(CompilationOptions node) =>\n        this.node = node;\n\n    public static CompilationOptionsWrapper FromObject(CompilationOptions node) =>\n        node is null ? default : new(node);\n\n    public static bool IsInstance(object obj) =>\n        obj is not null && LightupHelpers.CanWrapObject(obj, WrappedType);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/Sonar/IEventSymbolExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace StyleCop.Analyzers.Lightup;\n\npublic static class IEventSymbolExtensions\n{\n    private static readonly Func<IEventSymbol, IEventSymbol> PartialDefinitionPartAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<IEventSymbol, IEventSymbol>(typeof(IEventSymbol), \"PartialDefinitionPart\");\n\n    extension(IEventSymbol symbol)\n    {\n        public IEventSymbol PartialDefinitionPart => PartialDefinitionPartAccessor(symbol);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/Sonar/IMethodSymbolExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace StyleCop.Analyzers.Lightup;\n\npublic static class IMethodSymbolExtensions\n{\n    private static readonly Func<IMethodSymbol, bool> IsPartialDefinitionAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<IMethodSymbol, bool>(typeof(IMethodSymbol), \"IsPartialDefinition\");\n\n    private static readonly Func<IMethodSymbol, IMethodSymbol> AssociatedExtensionImplementationAccessor =\n        LightupHelpers.CreateSyntaxPropertyAccessor<IMethodSymbol, IMethodSymbol>(typeof(IMethodSymbol), \"AssociatedExtensionImplementation\");\n\n    extension(IMethodSymbol symbol)\n    {\n        public IMethodSymbol AssociatedExtensionImplementation => AssociatedExtensionImplementationAccessor(symbol);\n        public bool IsPartialDefinition => IsPartialDefinitionAccessor(symbol);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/Sonar/INamedTypeSymbolExtensions.Sonar.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Reflection;\nusing static System.Linq.Expressions.Expression;\n\nnamespace StyleCop.Analyzers.Lightup;\n\npublic static class INamedTypeSymbolExtensionsSonar\n{\n    private static readonly Func<INamedTypeSymbol, ImmutableArray<NullableAnnotation>> TypeArgumentNullableAnnotationsAccessor;\n\n    static INamedTypeSymbolExtensionsSonar()\n    {\n        TypeArgumentNullableAnnotationsAccessor = CreateTypeArgumentNullableAnnotationsAccessor();\n    }\n\n    public static ImmutableArray<NullableAnnotation> TypeArgumentNullableAnnotations(this INamedTypeSymbol symbol) => TypeArgumentNullableAnnotationsAccessor(symbol);\n\n    private static Func<INamedTypeSymbol, ImmutableArray<NullableAnnotation>> CreateTypeArgumentNullableAnnotationsAccessor()\n    {\n        // INamedTypeSymbol.TypeArgumentNullableAnnotations is ImmutableArray<Roslyn.NullableAnnotation>\n        // The generated code is symbol => ImmutableArray.CreateRange(symbol.TypeArgumentNullableAnnotations, x => (Sonar.NullableAnnotationType)x);\n\n        // Callers may rely on the fact that symbol.TypeArgumentNullableAnnotations is supposed to have the same length as symbol.TypeArguments\n        var fallback = static (INamedTypeSymbol x) => Enumerable.Repeat(NullableAnnotation.None, x.TypeArguments.Length).ToImmutableArray();\n        if (OriginalNullableAnnotationType() is not { } originalNullableAnnotationType)\n        {\n            return fallback;\n        }\n\n        if (typeof(ImmutableArray).GetMethods(BindingFlags.Public | BindingFlags.Static).FirstOrDefault(x =>\n            x.Name == nameof(ImmutableArray.CreateRange)     // https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable.immutablearray.createrange\n            && x.GetParameters() is { Length: 2 } parameters // CreateRange<TSource,TResult>(ImmutableArray<TSource> items, Func<TSource,TResult> selector)\n            && parameters[0].Name == \"items\"                 // see also https://stackoverflow.com/a/4036187\n            && parameters[1].Name == \"selector\"\n            && x.GetGenericArguments() is { Length: 2 } typeArguments\n            && typeArguments[0].Name == \"TSource\"\n            && typeArguments[1].Name == \"TResult\") is not { } createRange)\n        {\n            return fallback;\n        }\n        var sonarNullableAnnotationType = typeof(NullableAnnotation);\n        var createRangeT = createRange.MakeGenericMethod(originalNullableAnnotationType, sonarNullableAnnotationType);\n        var delegateType = typeof(Func<,>).MakeGenericType(originalNullableAnnotationType, sonarNullableAnnotationType);\n\n        var originalNullableAnnotationParameter = Parameter(originalNullableAnnotationType, \"x\");\n        var conversion = Lambda(delegateType, Convert(originalNullableAnnotationParameter, sonarNullableAnnotationType), originalNullableAnnotationParameter); // (originalNullableAnnotationType x) => (sonarNullableAnnotationType)x;\n\n        var symbolParameter = Parameter(typeof(INamedTypeSymbol), \"symbol\");\n        return Lambda<Func<INamedTypeSymbol, ImmutableArray<NullableAnnotation>>>(\n            Call(createRangeT, Property(symbolParameter, nameof(TypeArgumentNullableAnnotations)), conversion), // ImmutableArray.CreateRange(symbol.TypeArgumentNullableAnnotations, conversion)\n            symbolParameter).Compile();\n    }\n\n    private static Type OriginalNullableAnnotationType()\n    {\n        try\n        {\n            return Type.GetType(\"Microsoft.CodeAnalysis.NullableAnnotation, Microsoft.CodeAnalysis\");\n        }\n        catch\n        {\n            return null;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/Sonar/IOperationWrapper.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace StyleCop.Analyzers.Lightup;\n\npublic interface IOperationWrapper\n{\n    IOperation? WrappedOperation { get; }\n\n    ////IOperationWrapper Parent { get; }\n\n    ////OperationKind Kind { get; }\n\n    ////SyntaxNode Syntax { get; }\n\n    ITypeSymbol? Type { get; }\n\n    ////Optional<object> ConstantValue { get; }\n\n    ////IEnumerable<IOperationWrapper> Children { get; }\n\n    ////string Language { get; }\n\n    ////bool IsImplicit { get; }\n\n    ////SemanticModel SemanticModel { get; }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/Sonar/IOperationWrapperSonar.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace StyleCop.Analyzers.Lightup;\n\n// This is a temporary substitute for IOperationWrapper in case StyleCop will accept PR https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/3381\npublic readonly struct IOperationWrapperSonar\n{\n    private static readonly Func<IOperation, IOperation> ParentAccessor;\n    private static readonly Func<IOperation, IEnumerable<IOperation>> ChildrenAccessor;\n    private static readonly Func<IOperation, string> LanguageAccessor;\n    private static readonly Func<IOperation, bool> IsImplicitAccessor;\n    private static readonly Func<IOperation, SemanticModel> SemanticModelAccessor;\n\n    public IOperation Instance { get; }\n    public IOperation Parent => ParentAccessor(Instance);\n    public IEnumerable<IOperation> Children => ChildrenAccessor(Instance);\n    public string Language => LanguageAccessor(Instance);\n    public bool IsImplicit => IsImplicitAccessor(Instance);\n    public SemanticModel SemanticModel => SemanticModelAccessor(Instance);\n\n    public IOperationWrapperSonar(IOperation instance) =>\n        Instance = instance ?? throw new ArgumentNullException(nameof(instance));\n\n    static IOperationWrapperSonar()\n    {\n        var type = typeof(IOperation);\n        ParentAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<IOperation, IOperation>(type, nameof(Parent));\n        ChildrenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<IOperation, IEnumerable<IOperation>>(type, nameof(Children));\n        LanguageAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<IOperation, string>(type, nameof(Language));\n        IsImplicitAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<IOperation, bool>(type, nameof(IsImplicit));\n        SemanticModelAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<IOperation, SemanticModel>(type, nameof(SemanticModel));\n    }\n\n    public override int GetHashCode() =>\n        Instance.GetHashCode();\n\n    public override bool Equals(object obj) =>\n        obj is IOperationWrapperSonar wrapper && wrapper.Instance.Equals(Instance);\n\n    public override string ToString() =>\n        Instance.ToString();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/Sonar/IPropertySymbolExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace StyleCop.Analyzers.Lightup;\n\npublic static class IPropertySymbolExtensions\n{\n    private static readonly Func<IPropertySymbol, bool> IsRequiredAccessor;\n    private static readonly Func<IPropertySymbol, IPropertySymbol> PartialDefinitionPartAccessor;\n    private static readonly Func<IPropertySymbol, IPropertySymbol> PartialImplementationPartAccessor;\n    private static readonly Func<IPropertySymbol, bool> IsPartialDefinitionAccessor;\n\n    static IPropertySymbolExtensions()\n    {\n        IsRequiredAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<IPropertySymbol, bool>(typeof(IPropertySymbol), nameof(IsRequired));\n        IsPartialDefinitionAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<IPropertySymbol, bool>(typeof(IPropertySymbol), nameof(IsPartialDefinition));\n        PartialDefinitionPartAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<IPropertySymbol, IPropertySymbol>(typeof(IPropertySymbol), nameof(PartialDefinitionPart));\n        PartialImplementationPartAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<IPropertySymbol, IPropertySymbol>(typeof(IPropertySymbol), nameof(PartialImplementationPart));\n    }\n\n    public static bool IsRequired(this IPropertySymbol propertySymbol) =>\n        IsRequiredAccessor(propertySymbol);\n\n    public static bool IsPartialDefinition(this IPropertySymbol propertySymbol) =>\n        IsPartialDefinitionAccessor(propertySymbol);\n\n    public static IPropertySymbol PartialDefinitionPart(this IPropertySymbol propertySymbol) =>\n        PartialDefinitionPartAccessor(propertySymbol);\n\n    public static IPropertySymbol PartialImplementationPart(this IPropertySymbol propertySymbol) =>\n        PartialImplementationPartAccessor(propertySymbol);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/Sonar/ISymbolNullableExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace StyleCop.Analyzers.Lightup;\n\npublic static class ISymbolNullableExtensions\n{\n    private static readonly Func<ITypeSymbol, NullableAnnotation> TypeSymbolAccessor = CreateSymbolNullableAnnotationAccessor<ITypeSymbol>();\n    private static readonly Func<IArrayTypeSymbol, NullableAnnotation> ArrayTypeSymbolElementAccessor = CreateSymbolNullableAnnotationAccessor<IArrayTypeSymbol>(\"ElementNullableAnnotation\");\n    private static readonly Func<IParameterSymbol, NullableAnnotation> ParameterSymbolAccessor = CreateSymbolNullableAnnotationAccessor<IParameterSymbol>();\n    private static readonly Func<ILocalSymbol, NullableAnnotation> LocalSymbolAccessor = CreateSymbolNullableAnnotationAccessor<ILocalSymbol>();\n    private static readonly Func<IPropertySymbol, NullableAnnotation> PropertySymbolAccessor = CreateSymbolNullableAnnotationAccessor<IPropertySymbol>();\n    private static readonly Func<IFieldSymbol, NullableAnnotation> FieldSymbolAccessor = CreateSymbolNullableAnnotationAccessor<IFieldSymbol>();\n    private static readonly Func<IEventSymbol, NullableAnnotation> EventSymbolAccessor = CreateSymbolNullableAnnotationAccessor<IEventSymbol>();\n\n    private static readonly Func<ITypeParameterSymbol, NullableAnnotation> TypeParameterSymbolReferenceTypeConstraintAccessor =\n        CreateSymbolNullableAnnotationAccessor<ITypeParameterSymbol>(\"ReferenceTypeConstraintNullableAnnotation\"); // ConstraintNullableAnnotations is not yet supported\n\n    private static readonly Func<IMethodSymbol, NullableAnnotation> MethodSymbolReceiverAccessor =\n        CreateSymbolNullableAnnotationAccessor<IMethodSymbol>(\"ReceiverNullableAnnotation\");\n\n    private static readonly Func<IMethodSymbol, NullableAnnotation> MethodSymbolReturnAccessor =\n        CreateSymbolNullableAnnotationAccessor<IMethodSymbol>(\"ReturnNullableAnnotation\"); // TypeArgumentNullableAnnotations is not yet supported\n\n    /// <summary>\n    /// Nullable annotation associated with the type, or < see cref=\"NullableAnnotation.None\" /> if there are none.\n    /// </summary>\n    public static NullableAnnotation NullableAnnotation(this ITypeSymbol type) => TypeSymbolAccessor(type);\n\n    /// <summary>\n    /// Gets the top-level nullability of the parameter.\n    /// </summary>\n    public static NullableAnnotation NullableAnnotation(this IParameterSymbol parameter) => ParameterSymbolAccessor(parameter);\n\n    /// <summary>\n    /// Gets the top-level nullability of this local variable.\n    /// </summary>\n    public static NullableAnnotation NullableAnnotation(this ILocalSymbol local) => LocalSymbolAccessor(local);\n\n    /// <summary>\n    /// Gets the top-level nullability of this property.\n    /// </summary>\n    public static NullableAnnotation NullableAnnotation(this IPropertySymbol property) => PropertySymbolAccessor(property);\n\n    /// <summary>\n    /// Gets the top-level nullability of this field.\n    /// </summary>\n    public static NullableAnnotation NullableAnnotation(this IFieldSymbol field) => FieldSymbolAccessor(field);\n\n    /// <summary>\n    /// The top-level nullability of the event.\n    /// </summary>\n    public static NullableAnnotation NullableAnnotation(this IEventSymbol eventSymbol) => EventSymbolAccessor(eventSymbol);\n\n    /// <summary>\n    /// Gets the top-level nullability of the elements stored in the array.\n    /// </summary>\n    public static NullableAnnotation ElementNullableAnnotation(this IArrayTypeSymbol arrayType) => ArrayTypeSymbolElementAccessor(arrayType);\n\n    /// <summary>\n    /// If <see cref=\"ITypeParameterSymbol.HasReferenceTypeConstraint\"/> is <see langword=\"true\" />, returns the top-level nullability of the\n    /// class constraint that was specified for the type parameter. If there was no class constraint, this returns <see cref=\"NullableAnnotation.None\"/>.\n    /// </summary>\n    public static NullableAnnotation ReferenceTypeConstraintNullableAnnotation(this ITypeParameterSymbol eventSymbol) => TypeParameterSymbolReferenceTypeConstraintAccessor(eventSymbol);\n\n    /// <summary>\n    /// If this method can be applied to an object, returns the top-level nullability of the object it is applied to.\n    /// </summary>\n    public static NullableAnnotation ReceiverNullableAnnotation(this IMethodSymbol method) => MethodSymbolReceiverAccessor(method);\n\n    /// <summary>\n    /// Gets the top-level nullability of the return type of the method.\n    /// </summary>\n    public static NullableAnnotation ReturnNullableAnnotation(this IMethodSymbol method) => MethodSymbolReturnAccessor(method);\n\n    private static Func<T, NullableAnnotation> CreateSymbolNullableAnnotationAccessor<T>(string propertyName = nameof(NullableAnnotation)) where T : ISymbol =>\n        LightupHelpers.CreateSyntaxPropertyAccessor<T, NullableAnnotation>(typeof(T), propertyName);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/Sonar/ITypeSymbolExtension.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace StyleCop.Analyzers.Lightup;\n\npublic static partial class ITypeSymbolExtensions\n{\n    private static readonly Func<ITypeSymbol, bool> IsRefLikeTypeAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ITypeSymbol, bool>(typeof(ITypeSymbol), nameof(IsRefLikeType));\n\n    public static bool IsRefLikeType(this ITypeSymbol symbol) => IsRefLikeTypeAccessor(symbol);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/Sonar/NullabilityInfo.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace StyleCop.Analyzers.Lightup;\n\npublic readonly record struct NullabilityInfo\n{\n    /// <summary>\n    /// The nullable annotation of the expression represented by the syntax node. This represents\n    /// the nullability of expressions that can be assigned to this expression, if this expression\n    /// can be used as an lvalue.\n    /// </summary>\n    public NullableAnnotation Annotation { get; }\n\n    /// <summary>\n    /// The nullable flow state of the expression represented by the syntax node. This represents\n    /// the compiler's understanding of whether this expression can currently contain null, if\n    /// this expression can be used as an rvalue.\n    /// </summary>\n    public NullableFlowState FlowState { get; }\n\n    public NullabilityInfo(NullableAnnotation annotation, NullableFlowState flowState)\n    {\n        Annotation = annotation;\n        FlowState = flowState;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/Sonar/SyntaxTreeOptionsProviderWrapper.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace StyleCop.Analyzers.Lightup;\n\npublic readonly struct SyntaxTreeOptionsProviderWrapper\n{\n    internal const string WrappedTypeName = \"Microsoft.CodeAnalysis.SyntaxTreeOptionsProvider\";\n    private static readonly Type WrappedType;\n\n    private static readonly TryGetValueAccessor<object, SyntaxTree, string, CancellationToken, ReportDiagnostic> TryGetDiagnosticValueAccessor;\n    private static readonly TryGetValueAccessor<object, string, CancellationToken, ReportDiagnostic> TryGetGlobalDiagnosticValueAccessor;\n\n    public object Instance { get; }\n\n    static SyntaxTreeOptionsProviderWrapper()\n    {\n        WrappedType = WrapperHelper.GetWrappedType(typeof(SyntaxTreeOptionsProviderWrapper));\n\n        TryGetDiagnosticValueAccessor = LightupHelpers.CreateTryGetValueAccessor<object, SyntaxTree, string, CancellationToken, ReportDiagnostic>(WrappedType, typeof(SyntaxTree),typeof(string), typeof(CancellationToken), nameof(TryGetDiagnosticValue));\n        TryGetGlobalDiagnosticValueAccessor = LightupHelpers.CreateTryGetValueAccessor<object, string, CancellationToken, ReportDiagnostic>(WrappedType, typeof(string), typeof(CancellationToken), nameof(TryGetGlobalDiagnosticValue));\n    }\n\n    private SyntaxTreeOptionsProviderWrapper(object instance) =>\n        Instance = instance;\n\n    public static SyntaxTreeOptionsProviderWrapper FromObject(object instance)\n    {\n        if (instance is null)\n        {\n            return default;\n        }\n        else if (IsInstance(instance))\n        {\n            return new SyntaxTreeOptionsProviderWrapper(instance);\n        }\n        else\n        {\n            throw new InvalidCastException($\"Cannot cast '{instance.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n    }\n\n    public static bool IsInstance(object obj) =>\n        obj is not null && LightupHelpers.CanWrapObject(obj, WrappedType);\n\n    public bool TryGetDiagnosticValue(SyntaxTree tree, string diagnosticId, CancellationToken cancel, out ReportDiagnostic severity)\n    {\n        if (WrappedType is null)\n        {\n            severity = ReportDiagnostic.Default;\n            return false;\n        }\n        else\n        {\n            return TryGetDiagnosticValueAccessor(Instance, tree, diagnosticId, cancel, out severity);\n        }\n    }\n\n    public bool TryGetGlobalDiagnosticValue(string diagnosticId, CancellationToken cancel, out ReportDiagnostic severity)\n    {\n        if (WrappedType is null)\n        {\n            severity = ReportDiagnostic.Default;\n            return false;\n        }\n        else\n        {\n            return TryGetGlobalDiagnosticValueAccessor(Instance, diagnosticId, cancel, out severity);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/Sonar/TypeInfoExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing static System.Linq.Expressions.Expression;\n\nnamespace StyleCop.Analyzers.Lightup;\n\npublic static class TypeInfoExtensions\n{\n    private static readonly Func<TypeInfo, NullabilityInfo> ConvertedNullabilityAccessor = CreateNullabilityAccessor(nameof(ConvertedNullability));\n    private static readonly Func<TypeInfo, NullabilityInfo> NullabilityAccessor = CreateNullabilityAccessor(nameof(Nullability));\n\n    public static NullabilityInfo ConvertedNullability(this TypeInfo typeInfo) =>\n        ConvertedNullabilityAccessor(typeInfo);\n\n    public static NullabilityInfo Nullability(this TypeInfo typeInfo) =>\n        NullabilityAccessor(typeInfo);\n\n    private static Func<TypeInfo, NullabilityInfo> CreateNullabilityAccessor(string propertyName)\n    {\n        var property = typeof(TypeInfo).GetProperty(propertyName);\n        if (property is null)\n        {\n            return static _ => default;\n        }\n\n        Type nullableAnnotationType = typeof(NullableAnnotation), nullableFlowStateType = typeof(NullableFlowState);\n        var typeInfoParameter = Parameter(typeof(TypeInfo), \"typeInfo\");\n        var intermediateResult = Variable(property.PropertyType); // local variable which holds the Roslyn NullabilityInfo\n\n        // intermediateResult = typeInfo.{propertyName};\n        // return new Lightup.NullabilityInfo((Lightup.NullableAnnotation)intermediateResult.Annotation, (Lightup.NullableFlowState)intermediateResult.FlowState);\n        var body = Block(variables: new[] { intermediateResult },\n            Assign(intermediateResult, Property(typeInfoParameter, propertyName)),\n            New(typeof(NullabilityInfo).GetConstructor(new[] { nullableAnnotationType, nullableFlowStateType }),\n                Convert(Property(intermediateResult, \"Annotation\"), nullableAnnotationType), // enum to enum conversion\n                Convert(Property(intermediateResult, \"FlowState\"), nullableFlowStateType)));\n        var expression = Lambda<Func<TypeInfo, NullabilityInfo>>(body, typeInfoParameter);\n        return expression.Compile();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/SonarAnalyzer.ShimLayer.Lightup.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n  <PropertyGroup>\n    <TargetFramework>netstandard2.0</TargetFramework>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Microsoft.CodeAnalysis.CSharp.Workspaces\" Version=\"1.3.2\" />\n    <PackageReference Include=\"Microsoft.Composition\" Version=\"1.0.27\">\n      <!-- This package is a dependency of Microsoft.CodeAnalysis.CSharp.Workspaces. It is safe to use since it's compatible with .Net Portable runtime -->\n      <NoWarn>NU1701</NoWarn>\n    </PackageReference>\n    <PackageReference Include=\"System.Collections.Immutable\" Version=\"1.1.37\">\n      <!-- Downgrade System.Collections.Immutable to support VS2015 Update 3 -->\n      <NoWarn>NU1605, NU1701</NoWarn>\n    </PackageReference>\n\n    <ProjectReference Include=\"..\\SonarAnalyzer.ShimLayer.CodeGeneration\\SonarAnalyzer.ShimLayer.CodeGeneration.csproj\" SetTargetFramework=\"TargetFramework=netstandard2.0\" OutputItemType=\"Analyzer\" ReferenceOutputAssembly=\"false\" />\n    <ProjectReference Include=\"..\\SonarAnalyzer.ShimLayer\\SonarAnalyzer.ShimLayer.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <AdditionalFiles Include=\"OperationInterfaces.xml\" />\n    <AdditionalFiles Include=\"Syntax.xml\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Using Include=\"StyleCop.Analyzers.Lightup\" />\n    <Using Include=\"Microsoft.CodeAnalysis\" />\n    <Using Include=\"Microsoft.CodeAnalysis.Diagnostics\" />\n    <Using Include=\"SonarAnalyzer.ShimLayer\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/StatementSyntaxExtensions.cs",
    "content": "﻿// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.\n// Licensed under the MIT License. See LICENSE in the project root for license information.\n\n#nullable disable\n\nnamespace StyleCop.Analyzers.Lightup\n{\n    using System;\n    using Microsoft.CodeAnalysis;\n    using Microsoft.CodeAnalysis.CSharp.Syntax;\n\n    public static class StatementSyntaxExtensions\n    {\n        private static readonly Func<StatementSyntax, SyntaxList<AttributeListSyntax>> AttributeListsAccessor;\n        private static readonly Func<StatementSyntax, SyntaxList<AttributeListSyntax>, StatementSyntax> WithAttributeListsAccessor;\n\n        static StatementSyntaxExtensions()\n        {\n            AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<StatementSyntax, SyntaxList<AttributeListSyntax>>(typeof(StatementSyntax), nameof(AttributeLists));\n            WithAttributeListsAccessor = LightupHelpers.CreateSyntaxWithPropertyAccessor<StatementSyntax, SyntaxList<AttributeListSyntax>>(typeof(StatementSyntax), nameof(AttributeLists));\n        }\n\n        public static SyntaxList<AttributeListSyntax> AttributeLists(this StatementSyntax syntax)\n        {\n            return AttributeListsAccessor(syntax);\n        }\n\n        public static StatementSyntax WithAttributeLists(this StatementSyntax syntax, SyntaxList<AttributeListSyntax> attributeLists)\n        {\n            return WithAttributeListsAccessor(syntax, attributeLists);\n        }\n\n        public static StatementSyntax AddAttributeLists(this StatementSyntax syntax, params AttributeListSyntax[] items)\n        {\n            return syntax.WithAttributeLists(syntax.AttributeLists().AddRange(items));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/Syntax.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->\n\n<!-- \n To re-generate source from this file, run eng/generate-compiler-code.cmd\n-->\n\n<Tree Root=\"SyntaxNode\">\n  <PredefinedNode Name=\"CSharpSyntaxNode\" Base=\"SyntaxNode\"/>\n  <PredefinedNode Name=\"SyntaxToken\" Base=\"CSharpSyntaxNode\"/>\n  <PredefinedNode Name=\"StructuredTriviaSyntax\" Base=\"CSharpSyntaxNode\"/>\n  <!-- Names -->\n  <AbstractNode Name=\"NameSyntax\" Base=\"TypeSyntax\">\n    <TypeComment>\n      <summary>Provides the base class from which the classes that represent name syntax nodes are derived. This is an abstract class.</summary>\n    </TypeComment>\n  </AbstractNode>\n  <AbstractNode Name=\"SimpleNameSyntax\" Base=\"NameSyntax\">\n    <Field Name=\"Identifier\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>SyntaxToken representing the identifier of the simple name.</summary>\n      </PropertyComment>\n      <Kind Name=\"IdentifierToken\" />\n    </Field>\n    <TypeComment>\n      <summary>Provides the base class from which the classes that represent simple name syntax nodes are derived. This is an abstract class.</summary>\n    </TypeComment>\n  </AbstractNode>\n  <Node Name=\"IdentifierNameSyntax\" Base=\"SimpleNameSyntax\">\n    <Kind Name=\"IdentifierName\"/>\n    <Field Name=\"Identifier\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"IdentifierToken\"/>\n      <Kind Name=\"GlobalKeyword\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the keyword for the kind of the identifier name.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for identifier name.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates an IdentifierNameSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"QualifiedNameSyntax\" Base=\"NameSyntax\">\n    <Kind Name=\"QualifiedName\"/>\n    <Field Name=\"Left\" Type=\"NameSyntax\">\n      <PropertyComment>\n        <summary>NameSyntax node representing the name on the left side of the dot token of the qualified name.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"DotToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"DotToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the dot.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Right\" Type=\"SimpleNameSyntax\">\n      <PropertyComment>\n        <summary>SimpleNameSyntax node representing the name on the right side of the dot token of the qualified name.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for qualified name.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a QualifiedNameSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"GenericNameSyntax\" Base=\"SimpleNameSyntax\">\n    <Kind Name=\"GenericName\"/>\n    <Field Name=\"Identifier\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"IdentifierToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the name of the identifier of the generic name.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"TypeArgumentList\" Type=\"TypeArgumentListSyntax\">\n      <PropertyComment>\n        <summary>TypeArgumentListSyntax node representing the list of type arguments of the generic name.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for generic name.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a GenericNameSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"TypeArgumentListSyntax\" Base=\"CSharpSyntaxNode\">\n    <Kind Name=\"TypeArgumentList\"/>\n    <Field Name=\"LessThanToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"LessThanToken\" />\n      <PropertyComment>\n        <summary>SyntaxToken representing less than.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Arguments\" Type=\"SeparatedSyntaxList&lt;TypeSyntax&gt;\">\n      <PropertyComment>\n        <summary>SeparatedSyntaxList of TypeSyntax node representing the type arguments.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"GreaterThanToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"GreaterThanToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing greater than.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for type argument list.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a TypeArgumentListSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"AliasQualifiedNameSyntax\" Base=\"NameSyntax\">\n    <Kind Name=\"AliasQualifiedName\"/>\n    <Field Name=\"Alias\" Type=\"IdentifierNameSyntax\">\n      <PropertyComment>\n        <summary>IdentifierNameSyntax node representing the name of the alias</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"ColonColonToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"ColonColonToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing colon colon.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Name\" Type=\"SimpleNameSyntax\">\n      <PropertyComment>\n        <summary>SimpleNameSyntax node representing the name that is being alias qualified.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for alias qualified name.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates an AliasQualifiedNameSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <!-- Type names -->\n    <AbstractNode Name=\"TypeSyntax\" Base=\"ExpressionSyntax\">\n    <TypeComment>\n      <summary>Provides the base class from which the classes that represent type syntax nodes are derived. This is an abstract class.</summary>\n    </TypeComment>\n  </AbstractNode>\n  <Node Name=\"PredefinedTypeSyntax\" Base=\"TypeSyntax\">\n    <Kind Name=\"PredefinedType\"/>\n    <Field Name=\"Keyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"BoolKeyword\"/>\n      <Kind Name=\"ByteKeyword\"/>\n      <Kind Name=\"SByteKeyword\"/>\n      <Kind Name=\"IntKeyword\"/>\n      <Kind Name=\"UIntKeyword\"/>\n      <Kind Name=\"ShortKeyword\"/>\n      <Kind Name=\"UShortKeyword\"/>\n      <Kind Name=\"LongKeyword\"/>\n      <Kind Name=\"ULongKeyword\"/>\n      <Kind Name=\"FloatKeyword\"/>\n      <Kind Name=\"DoubleKeyword\"/>\n      <Kind Name=\"DecimalKeyword\"/>\n      <Kind Name=\"StringKeyword\"/>\n      <Kind Name=\"CharKeyword\"/>\n      <Kind Name=\"ObjectKeyword\"/>\n      <Kind Name=\"VoidKeyword\"/>\n      <PropertyComment>\n        <summary>SyntaxToken which represents the keyword corresponding to the predefined type.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for predefined types.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a PredefinedTypeSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"ArrayTypeSyntax\" Base=\"TypeSyntax\">\n    <Kind Name=\"ArrayType\"/>\n    <Field Name=\"ElementType\" Type=\"TypeSyntax\">\n      <PropertyComment>\n        <summary>TypeSyntax node representing the type of the element of the array.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"RankSpecifiers\" Type=\"SyntaxList&lt;ArrayRankSpecifierSyntax&gt;\" MinCount=\"1\">\n      <PropertyComment>\n        <summary>SyntaxList of ArrayRankSpecifierSyntax nodes representing the list of rank specifiers for the array.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for the array type.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates an ArrayTypeSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"ArrayRankSpecifierSyntax\" Base=\"CSharpSyntaxNode\">\n    <Kind Name=\"ArrayRankSpecifier\" />\n    <Field Name=\"OpenBracketToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenBracketToken\"/>\n    </Field>\n    <Field Name=\"Sizes\" Type=\"SeparatedSyntaxList&lt;ExpressionSyntax&gt;\"/>\n    <Field Name=\"CloseBracketToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseBracketToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"PointerTypeSyntax\" Base=\"TypeSyntax\">\n    <Kind Name=\"PointerType\"/>\n    <Field Name=\"ElementType\" Type=\"TypeSyntax\">\n      <PropertyComment>\n        <summary>TypeSyntax node that represents the element type of the pointer.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"AsteriskToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"AsteriskToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the asterisk.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for pointer type.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a PointerTypeSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"FunctionPointerTypeSyntax\" Base=\"TypeSyntax\">\n    <Kind Name=\"FunctionPointerType\"/>\n    <Field Name=\"DelegateKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"DelegateKeyword\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the delegate keyword.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"AsteriskToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"AsteriskToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the asterisk.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"CallingConvention\" Type=\"FunctionPointerCallingConventionSyntax\" Optional=\"true\">\n      <PropertyComment>\n        <summary>Node representing the optional calling convention.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"ParameterList\" Type=\"FunctionPointerParameterListSyntax\">\n      <PropertyComment>\n        <summary>List of the parameter types and return type of the function pointer.</summary>\n      </PropertyComment>\n    </Field>\n  </Node>\n  <Node Name=\"FunctionPointerParameterListSyntax\" Base=\"CSharpSyntaxNode\">\n    <TypeComment>\n      <summary>Function pointer parameter list syntax.</summary>\n    </TypeComment>\n    <Kind Name=\"FunctionPointerParameterList\"/>\n    <Field Name=\"LessThanToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"LessThanToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the less than token.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Parameters\" Type=\"SeparatedSyntaxList&lt;FunctionPointerParameterSyntax&gt;\" MinCount=\"1\">\n      <PropertyComment>\n        <summary>SeparatedSyntaxList of ParameterSyntaxes representing the list of parameters and return type.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"GreaterThanToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"GreaterThanToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the greater than token.</summary>\n      </PropertyComment>\n    </Field>\n  </Node>\n  <Node Name=\"FunctionPointerCallingConventionSyntax\" Base=\"CSharpSyntaxNode\">\n    <TypeComment>\n      <summary>Function pointer calling convention syntax.</summary>\n    </TypeComment>\n    <Kind Name=\"FunctionPointerCallingConvention\"/>\n    <Field Name=\"ManagedOrUnmanagedKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"ManagedKeyword\"/>\n      <Kind Name=\"UnmanagedKeyword\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing whether the calling convention is managed or unmanaged.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"UnmanagedCallingConventionList\" Type=\"FunctionPointerUnmanagedCallingConventionListSyntax\" Optional=\"true\">\n      <PropertyComment>\n        <summary>Optional list of identifiers that will contribute to an unmanaged calling convention.</summary>\n      </PropertyComment>\n    </Field>\n  </Node>\n  <Node Name=\"FunctionPointerUnmanagedCallingConventionListSyntax\" Base=\"CSharpSyntaxNode\">\n    <TypeComment>\n      <summary>Function pointer calling convention syntax.</summary>\n    </TypeComment>\n    <Kind Name=\"FunctionPointerUnmanagedCallingConventionList\"/>\n    <Field Name=\"OpenBracketToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenBracketToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing open bracket.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"CallingConventions\" Type=\"SeparatedSyntaxList&lt;FunctionPointerUnmanagedCallingConventionSyntax&gt;\" MinCount=\"1\">\n      <PropertyComment>\n        <summary>SeparatedSyntaxList of calling convention identifiers.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"CloseBracketToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseBracketToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing close bracket.</summary>\n      </PropertyComment>\n    </Field>\n  </Node>\n  <Node Name=\"FunctionPointerUnmanagedCallingConventionSyntax\" Base=\"CSharpSyntaxNode\">\n    <TypeComment>\n      <summary>Individual function pointer unmanaged calling convention.</summary>\n    </TypeComment>\n    <Kind Name=\"FunctionPointerUnmanagedCallingConvention\"/>\n    <Field Name=\"Name\" Type=\"SyntaxToken\">\n      <Kind Name=\"IdentifierToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the calling convention identifier.</summary>\n      </PropertyComment>\n    </Field>\n  </Node>\n  <Node Name=\"NullableTypeSyntax\" Base=\"TypeSyntax\">\n    <Kind Name=\"NullableType\"/>\n    <Field Name=\"ElementType\" Type=\"TypeSyntax\">\n      <PropertyComment>\n        <summary>TypeSyntax node representing the type of the element.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"QuestionToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"QuestionToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the question mark.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for a nullable type.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a NullableTypeSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"TupleTypeSyntax\" Base=\"TypeSyntax\">\n    <Kind Name=\"TupleType\"/>\n    <Field Name=\"OpenParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenParenToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the open parenthesis.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Elements\" Type=\"SeparatedSyntaxList&lt;TupleElementSyntax&gt;\" MinCount=\"2\"/>\n    <Field Name=\"CloseParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseParenToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the close parenthesis.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for tuple type.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a TupleTypeSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"TupleElementSyntax\" Base=\"CSharpSyntaxNode\">\n    <TypeComment>\n      <summary>Tuple type element.</summary>\n    </TypeComment>\n    <Kind Name=\"TupleElement\"/>\n    <Field Name=\"Type\" Type=\"TypeSyntax\">\n      <PropertyComment>\n        <summary>Gets the type of the tuple element.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Identifier\" Type=\"SyntaxToken\" Optional=\"true\">\n      <PropertyComment>\n        <summary>Gets the name of the tuple element.</summary>\n      </PropertyComment>\n      <Kind Name=\"IdentifierToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"OmittedTypeArgumentSyntax\" Base=\"TypeSyntax\">\n    <Kind Name=\"OmittedTypeArgument\"/>\n    <Field Name=\"OmittedTypeArgumentToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OmittedTypeArgumentToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the omitted type argument.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents a placeholder in the type argument list of an unbound generic type.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates an OmittedTypeArgumentSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"RefTypeSyntax\" Base=\"TypeSyntax\">\n    <TypeComment>\n      <summary>The ref modifier of a method's return value or a local.</summary>\n    </TypeComment>\n    <Kind Name=\"RefType\"/>\n    <Field Name=\"RefKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"RefKeyword\"/>\n    </Field>\n    <Field Name=\"ReadOnlyKeyword\" Type=\"SyntaxToken\" Optional=\"true\">\n      <Kind Name=\"ReadOnlyKeyword\"/>\n      <PropertyComment>\n        <summary>Gets the optional \"readonly\" keyword.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Type\" Type=\"TypeSyntax\"/>\n  </Node>\n  <Node Name=\"ScopedTypeSyntax\" Base=\"TypeSyntax\">\n    <TypeComment>\n      <summary>The 'scoped' modifier of a local.</summary>\n    </TypeComment>\n    <Kind Name=\"ScopedType\"/>\n    <Field Name=\"ScopedKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"ScopedKeyword\"/>\n    </Field>\n    <Field Name=\"Type\" Type=\"TypeSyntax\"/>\n  </Node>\n  <!-- Expressions -->\n  <AbstractNode Name=\"ExpressionOrPatternSyntax\" Base=\"CSharpSyntaxNode\" />\n  <AbstractNode Name=\"ExpressionSyntax\" Base=\"ExpressionOrPatternSyntax\">\n    <TypeComment>\n      <summary>Provides the base class from which the classes that represent expression syntax nodes are derived. This is an abstract class.</summary>\n    </TypeComment>\n  </AbstractNode>\n  <Node Name=\"ParenthesizedExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"ParenthesizedExpression\"/>\n    <Field Name=\"OpenParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenParenToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the open parenthesis.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\">\n      <PropertyComment>\n        <summary>ExpressionSyntax node representing the expression enclosed within the parenthesis.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"CloseParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseParenToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the close parenthesis.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for parenthesized expression.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a ParenthesizedExpressionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"TupleExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"TupleExpression\"/>\n    <Field Name=\"OpenParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenParenToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the open parenthesis.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Arguments\" Type=\"SeparatedSyntaxList&lt;ArgumentSyntax&gt;\" MinCount=\"2\">\n      <PropertyComment>\n        <summary>SeparatedSyntaxList of ArgumentSyntax representing the list of arguments.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"CloseParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseParenToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the close parenthesis.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for tuple expression.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a TupleExpressionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"PrefixUnaryExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"UnaryPlusExpression\"/>\n    <Kind Name=\"UnaryMinusExpression\"/>\n    <Kind Name=\"BitwiseNotExpression\"/>\n    <Kind Name=\"LogicalNotExpression\"/>\n    <Kind Name=\"PreIncrementExpression\"/>\n    <Kind Name=\"PreDecrementExpression\"/>\n    <Kind Name=\"AddressOfExpression\"/>\n    <Kind Name=\"PointerIndirectionExpression\"/>\n    <Kind Name=\"IndexExpression\"/>\n    <Field Name=\"OperatorToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"PlusToken\"/>\n      <Kind Name=\"MinusToken\"/>\n      <Kind Name=\"TildeToken\"/>\n      <Kind Name=\"ExclamationToken\"/>\n      <Kind Name=\"PlusPlusToken\"/>\n      <Kind Name=\"MinusMinusToken\"/>\n      <Kind Name=\"AmpersandToken\"/>\n      <Kind Name=\"AsteriskToken\"/>\n      <Kind Name=\"CaretToken\"/>\"\n      <PropertyComment>\n        <summary>SyntaxToken representing the kind of the operator of the prefix unary expression.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Operand\" Type=\"ExpressionSyntax\">\n      <PropertyComment>\n        <summary>ExpressionSyntax representing the operand of the prefix unary expression.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for prefix unary expression.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a PrefixUnaryExpressionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"AwaitExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"AwaitExpression\"/>\n    <Field Name=\"AwaitKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"AwaitKeyword\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the kind \"await\" keyword.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\">\n      <PropertyComment>\n        <summary>ExpressionSyntax representing the operand of the \"await\" operator.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for an \"await\" expression.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates an AwaitExpressionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"PostfixUnaryExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"PostIncrementExpression\"/>\n    <Kind Name=\"PostDecrementExpression\"/>\n    <Kind Name=\"SuppressNullableWarningExpression\"/>\n    <Field Name=\"Operand\" Type=\"ExpressionSyntax\">\n      <PropertyComment>\n        <summary>ExpressionSyntax representing the operand of the postfix unary expression.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"OperatorToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"PlusPlusToken\"/>\n      <Kind Name=\"MinusMinusToken\"/>\n      <Kind Name=\"ExclamationToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the kind of the operator of the postfix unary expression.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for postfix unary expression.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a PostfixUnaryExpressionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"MemberAccessExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"SimpleMemberAccessExpression\"/>\n    <Kind Name=\"PointerMemberAccessExpression\"/>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\">\n      <PropertyComment>\n        <summary>ExpressionSyntax node representing the object that the member belongs to.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"OperatorToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"DotToken\"/>\n      <Kind Name=\"MinusGreaterThanToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the kind of the operator in the member access expression.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Name\" Type=\"SimpleNameSyntax\">\n      <PropertyComment>\n        <summary>SimpleNameSyntax node representing the member being accessed.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for member access expression.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a MemberAccessExpressionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"ConditionalAccessExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"ConditionalAccessExpression\"/>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\">\n      <PropertyComment>\n        <summary>ExpressionSyntax node representing the object conditionally accessed.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"OperatorToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"QuestionToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the question mark.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"WhenNotNull\" Type=\"ExpressionSyntax\">\n      <PropertyComment>\n        <summary>ExpressionSyntax node representing the access expression to be executed when the object is not null.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for conditional access expression.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a ConditionalAccessExpressionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"MemberBindingExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"MemberBindingExpression\"/>\n    <Field Name=\"OperatorToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"DotToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing dot.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Name\" Type=\"SimpleNameSyntax\">\n      <PropertyComment>\n        <summary>SimpleNameSyntax node representing the member being bound to.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for member binding expression.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a MemberBindingExpressionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"ElementBindingExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"ElementBindingExpression\"/>\n    <Field Name=\"ArgumentList\" Type=\"BracketedArgumentListSyntax\">\n      <PropertyComment>\n        <summary>BracketedArgumentListSyntax node representing the list of arguments of the element binding expression.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for element binding expression.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates an ElementBindingExpressionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"RangeExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"RangeExpression\"/>\n    <Field Name=\"LeftOperand\" Type=\"ExpressionSyntax\" Optional=\"true\">\n      <PropertyComment>\n        <summary>ExpressionSyntax node representing the expression on the left of the range operator.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"OperatorToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"DotDotToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the operator of the range expression.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"RightOperand\" Type=\"ExpressionSyntax\" Optional=\"true\">\n      <PropertyComment>\n        <summary>ExpressionSyntax node representing the expression on the right of the range operator.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for a range expression.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates an RangeExpressionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"ImplicitElementAccessSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"ImplicitElementAccess\"/>\n    <Field Name=\"ArgumentList\" Type=\"BracketedArgumentListSyntax\">\n      <PropertyComment>\n        <summary>BracketedArgumentListSyntax node representing the list of arguments of the implicit element access expression.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for implicit element access expression.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates an ImplicitElementAccessSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"BinaryExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"AddExpression\"/>\n    <Kind Name=\"SubtractExpression\"/>\n    <Kind Name=\"MultiplyExpression\"/>\n    <Kind Name=\"DivideExpression\"/>\n    <Kind Name=\"ModuloExpression\"/>\n    <Kind Name=\"LeftShiftExpression\"/>\n    <Kind Name=\"RightShiftExpression\"/>\n    <Kind Name=\"UnsignedRightShiftExpression\"/>\n    <Kind Name=\"LogicalOrExpression\"/>\n    <Kind Name=\"LogicalAndExpression\"/>\n    <Kind Name=\"BitwiseOrExpression\"/>\n    <Kind Name=\"BitwiseAndExpression\"/>\n    <Kind Name=\"ExclusiveOrExpression\"/>\n    <Kind Name=\"EqualsExpression\"/>\n    <Kind Name=\"NotEqualsExpression\"/>\n    <Kind Name=\"LessThanExpression\"/>\n    <Kind Name=\"LessThanOrEqualExpression\"/>\n    <Kind Name=\"GreaterThanExpression\"/>\n    <Kind Name=\"GreaterThanOrEqualExpression\"/>\n    <Kind Name=\"IsExpression\"/>\n    <Kind Name=\"AsExpression\"/>\n    <Kind Name=\"CoalesceExpression\"/>\n    <Field Name=\"Left\" Type=\"ExpressionSyntax\">\n      <PropertyComment>\n        <summary>ExpressionSyntax node representing the expression on the left of the binary operator.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"OperatorToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"PlusToken\"/>\n      <Kind Name=\"MinusToken\"/>\n      <Kind Name=\"AsteriskToken\"/>\n      <Kind Name=\"SlashToken\"/>\n      <Kind Name=\"PercentToken\"/>\n      <Kind Name=\"LessThanLessThanToken\"/>\n      <Kind Name=\"GreaterThanGreaterThanToken\"/>\n      <Kind Name=\"GreaterThanGreaterThanGreaterThanToken\"/>\n      <Kind Name=\"BarBarToken\"/>\n      <Kind Name=\"AmpersandAmpersandToken\"/>\n      <Kind Name=\"BarToken\"/>\n      <Kind Name=\"AmpersandToken\"/>\n      <Kind Name=\"CaretToken\"/>\n      <Kind Name=\"EqualsEqualsToken\"/>\n      <Kind Name=\"ExclamationEqualsToken\"/>\n      <Kind Name=\"LessThanToken\"/>\n      <Kind Name=\"LessThanEqualsToken\"/>\n      <Kind Name=\"GreaterThanToken\"/>\n      <Kind Name=\"GreaterThanEqualsToken\"/>\n      <Kind Name=\"IsKeyword\"/>\n      <Kind Name=\"AsKeyword\"/>\n      <Kind Name=\"QuestionQuestionToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the operator of the binary expression.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Right\" Type=\"ExpressionSyntax\">\n      <PropertyComment>\n        <summary>ExpressionSyntax node representing the expression on the right of the binary operator.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents an expression that has a binary operator.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a BinaryExpressionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"AssignmentExpressionSyntax\" Base=\"ExpressionSyntax\">\n      <Kind Name=\"SimpleAssignmentExpression\"/>\n      <Kind Name=\"AddAssignmentExpression\"/>\n      <Kind Name=\"SubtractAssignmentExpression\"/>\n      <Kind Name=\"MultiplyAssignmentExpression\"/>\n      <Kind Name=\"DivideAssignmentExpression\"/>\n      <Kind Name=\"ModuloAssignmentExpression\"/>\n      <Kind Name=\"AndAssignmentExpression\"/>\n      <Kind Name=\"ExclusiveOrAssignmentExpression\"/>\n      <Kind Name=\"OrAssignmentExpression\"/>\n      <Kind Name=\"LeftShiftAssignmentExpression\"/>\n      <Kind Name=\"RightShiftAssignmentExpression\"/>\n      <Kind Name=\"UnsignedRightShiftAssignmentExpression\"/>\n      <Kind Name=\"CoalesceAssignmentExpression\" />\n      <Field Name=\"Left\" Type=\"ExpressionSyntax\">\n        <PropertyComment>\n          <summary>ExpressionSyntax node representing the expression on the left of the assignment operator.</summary>\n        </PropertyComment>\n      </Field>\n      <Field Name=\"OperatorToken\" Type=\"SyntaxToken\">\n        <Kind Name=\"EqualsToken\"/>\n        <Kind Name=\"PlusEqualsToken\"/>\n        <Kind Name=\"MinusEqualsToken\"/>\n        <Kind Name=\"AsteriskEqualsToken\"/>\n        <Kind Name=\"SlashEqualsToken\"/>\n        <Kind Name=\"PercentEqualsToken\"/>\n        <Kind Name=\"AmpersandEqualsToken\"/>\n        <Kind Name=\"CaretEqualsToken\"/>\n        <Kind Name=\"BarEqualsToken\"/>\n        <Kind Name=\"LessThanLessThanEqualsToken\"/>\n        <Kind Name=\"GreaterThanGreaterThanEqualsToken\"/>\n        <Kind Name=\"GreaterThanGreaterThanGreaterThanEqualsToken\"/>\n        <Kind Name=\"QuestionQuestionEqualsToken\" />\n        <PropertyComment>\n          <summary>SyntaxToken representing the operator of the assignment expression.</summary>\n        </PropertyComment>\n      </Field>\n      <Field Name=\"Right\" Type=\"ExpressionSyntax\">\n        <PropertyComment>\n          <summary>ExpressionSyntax node representing the expression on the right of the assignment operator.</summary>\n        </PropertyComment>\n      </Field>\n      <TypeComment>\n        <summary>Class which represents an expression that has an assignment operator.</summary>\n      </TypeComment>\n      <FactoryComment>\n        <summary>Creates an AssignmentExpressionSyntax node.</summary>\n      </FactoryComment>\n  </Node>\n  <Node Name=\"ConditionalExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"ConditionalExpression\"/>\n    <Field Name=\"Condition\" Type=\"ExpressionSyntax\">\n      <PropertyComment>\n        <summary>ExpressionSyntax node representing the condition of the conditional expression.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"QuestionToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"QuestionToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the question mark.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"WhenTrue\" Type=\"ExpressionSyntax\">\n      <PropertyComment>\n        <summary>ExpressionSyntax node representing the expression to be executed when the condition is true.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"ColonToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"ColonToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the colon.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"WhenFalse\" Type=\"ExpressionSyntax\">\n      <PropertyComment>\n        <summary>ExpressionSyntax node representing the expression to be executed when the condition is false.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for conditional expression.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a ConditionalExpressionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <AbstractNode Name=\"InstanceExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <TypeComment>\n      <summary>Provides the base class from which the classes that represent instance expression syntax nodes are derived. This is an abstract class.</summary>\n    </TypeComment>\n  </AbstractNode>\n  <Node Name=\"ThisExpressionSyntax\" Base=\"InstanceExpressionSyntax\">\n    <Kind Name=\"ThisExpression\"/>\n    <Field Name=\"Token\" Type=\"SyntaxToken\">\n      <Kind Name=\"ThisKeyword\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the this keyword.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for a this expression.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a ThisExpressionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"BaseExpressionSyntax\" Base=\"InstanceExpressionSyntax\">\n    <Kind Name=\"BaseExpression\"/>\n    <Field Name=\"Token\" Type=\"SyntaxToken\">\n      <Kind Name=\"BaseKeyword\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the base keyword.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for a base expression.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a BaseExpressionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"LiteralExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"ArgListExpression\"/>\n    <Kind Name=\"NumericLiteralExpression\"/>\n    <Kind Name=\"StringLiteralExpression\"/>\n    <Kind Name=\"Utf8StringLiteralExpression\"/>\n    <Kind Name=\"CharacterLiteralExpression\"/>\n    <Kind Name=\"TrueLiteralExpression\"/>\n    <Kind Name=\"FalseLiteralExpression\"/>\n    <Kind Name=\"NullLiteralExpression\"/>\n    <Kind Name=\"DefaultLiteralExpression\"/>\n    <Field Name=\"Token\" Type=\"SyntaxToken\">\n      <Kind Name=\"ArgListKeyword\"/>\n      <Kind Name=\"NumericLiteralToken\"/>\n      <Kind Name=\"StringLiteralToken\"/>\n      <Kind Name=\"Utf8StringLiteralToken\"/>\n      <Kind Name=\"MultiLineRawStringLiteralToken\"/>\n      <Kind Name=\"Utf8MultiLineRawStringLiteralToken\"/>\n      <Kind Name=\"SingleLineRawStringLiteralToken\"/>\n      <Kind Name=\"Utf8SingleLineRawStringLiteralToken\"/>\n      <Kind Name=\"CharacterLiteralToken\"/>\n      <Kind Name=\"TrueKeyword\"/>\n      <Kind Name=\"FalseKeyword\"/>\n      <Kind Name=\"NullKeyword\"/>\n      <Kind Name=\"DefaultKeyword\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the keyword corresponding to the kind of the literal expression.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for a literal expression.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a LiteralExpressionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"MakeRefExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"MakeRefExpression\"/>\n    <Field Name=\"Keyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"MakeRefKeyword\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the MakeRefKeyword.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"OpenParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenParenToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing open parenthesis.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\">\n      <PropertyComment>\n        <summary>Argument of the primary function.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"CloseParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseParenToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing close parenthesis.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for MakeRef expression.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a MakeRefExpressionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"RefTypeExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"RefTypeExpression\"/>\n    <Field Name=\"Keyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"RefTypeKeyword\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the RefTypeKeyword.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"OpenParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenParenToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing open parenthesis.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\">\n      <PropertyComment>\n        <summary>Argument of the primary function.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"CloseParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseParenToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing close parenthesis.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for RefType expression.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a RefTypeExpressionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"RefValueExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"RefValueExpression\"/>\n    <Field Name=\"Keyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"RefValueKeyword\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the RefValueKeyword.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"OpenParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenParenToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing open parenthesis.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\">\n      <PropertyComment>\n        <summary>Typed reference expression.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Comma\" Type=\"SyntaxToken\">\n      <Kind Name=\"CommaToken\"/>\n      <PropertyComment>\n        <summary>Comma separating the arguments.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Type\" Type=\"TypeSyntax\">\n      <PropertyComment>\n        <summary>The type of the value.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"CloseParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseParenToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing close parenthesis.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for RefValue expression.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a RefValueExpressionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"CheckedExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"CheckedExpression\"/>\n    <Kind Name=\"UncheckedExpression\"/>\n    <Field Name=\"Keyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"CheckedKeyword\"/>\n      <Kind Name=\"UncheckedKeyword\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the checked or unchecked keyword.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"OpenParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenParenToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing open parenthesis.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\">\n      <PropertyComment>\n        <summary>Argument of the primary function.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"CloseParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseParenToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing close parenthesis.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for Checked or Unchecked expression.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a CheckedExpressionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"DefaultExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"DefaultExpression\"/>\n    <Field Name=\"Keyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"DefaultKeyword\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the DefaultKeyword.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"OpenParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenParenToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing open parenthesis.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Type\" Type=\"TypeSyntax\">\n      <PropertyComment>\n        <summary>Argument of the primary function.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"CloseParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseParenToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing close parenthesis.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for Default expression.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a DefaultExpressionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"TypeOfExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"TypeOfExpression\"/>\n    <Field Name=\"Keyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"TypeOfKeyword\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the TypeOfKeyword.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"OpenParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenParenToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing open parenthesis.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Type\" Type=\"TypeSyntax\">\n      <PropertyComment>\n        <summary>The expression to return type of.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"CloseParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseParenToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing close parenthesis.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for TypeOf expression.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a TypeOfExpressionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"SizeOfExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"SizeOfExpression\"/>\n    <Field Name=\"Keyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"SizeOfKeyword\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the SizeOfKeyword.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"OpenParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenParenToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing open parenthesis.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Type\" Type=\"TypeSyntax\">\n      <PropertyComment>\n        <summary>Argument of the primary function.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"CloseParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseParenToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing close parenthesis.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for SizeOf expression.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a SizeOfExpressionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"InvocationExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"InvocationExpression\"/>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\">\n      <PropertyComment>\n        <summary>ExpressionSyntax node representing the expression part of the invocation.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"ArgumentList\" Type=\"ArgumentListSyntax\">\n      <PropertyComment>\n        <summary>ArgumentListSyntax node representing the list of arguments of the invocation expression.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for invocation expression.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates an InvocationExpressionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"ElementAccessExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"ElementAccessExpression\"/>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\">\n      <PropertyComment>\n        <summary>ExpressionSyntax node representing the expression which is accessing the element.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"ArgumentList\" Type=\"BracketedArgumentListSyntax\">\n      <PropertyComment>\n        <summary>BracketedArgumentListSyntax node representing the list of arguments of the element access expression.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for element access expression.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates an ElementAccessExpressionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <AbstractNode Name=\"BaseArgumentListSyntax\" Base=\"CSharpSyntaxNode\">\n    <Field Name=\"Arguments\" Type=\"SeparatedSyntaxList&lt;ArgumentSyntax&gt;\">\n      <PropertyComment>\n        <summary>SeparatedSyntaxList of ArgumentSyntax nodes representing the list of arguments.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Provides the base class from which the classes that represent argument list syntax nodes are derived. This is an abstract class.</summary>\n    </TypeComment>\n  </AbstractNode>\n  <Node Name=\"ArgumentListSyntax\" Base=\"BaseArgumentListSyntax\">\n    <Kind Name=\"ArgumentList\"/>\n    <Field Name=\"OpenParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenParenToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing open parenthesis.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Arguments\" Type=\"SeparatedSyntaxList&lt;ArgumentSyntax&gt;\" Override=\"true\">\n      <PropertyComment>\n        <summary>SeparatedSyntaxList of ArgumentSyntax representing the list of arguments.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"CloseParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseParenToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing close parenthesis.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for the list of arguments.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates an ArgumentListSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"BracketedArgumentListSyntax\" Base=\"BaseArgumentListSyntax\">\n    <Kind Name=\"BracketedArgumentList\"/>\n    <Field Name=\"OpenBracketToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenBracketToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing open bracket.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Arguments\" Type=\"SeparatedSyntaxList&lt;ArgumentSyntax&gt;\" Override=\"true\" MinCount=\"1\">\n      <PropertyComment>\n        <summary>SeparatedSyntaxList of ArgumentSyntax representing the list of arguments.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"CloseBracketToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseBracketToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing close bracket.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for bracketed argument list.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a BracketedArgumentListSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"ArgumentSyntax\" Base=\"CSharpSyntaxNode\">\n    <Kind Name=\"Argument\"/>\n    <Field Name=\"NameColon\" Type=\"NameColonSyntax\" Optional=\"true\">\n      <PropertyComment>\n        <summary>NameColonSyntax node representing the optional name arguments.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"RefKindKeyword\" Type=\"SyntaxToken\" Optional=\"true\">\n      <Kind Name=\"RefKeyword\"/>\n      <Kind Name=\"OutKeyword\"/>\n      <Kind Name=\"InKeyword\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the optional ref or out keyword.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\">\n      <PropertyComment>\n        <summary>ExpressionSyntax node representing the argument.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for argument.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates an ArgumentSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <AbstractNode Name=\"BaseExpressionColonSyntax\" Base=\"CSharpSyntaxNode\">\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\"/>\n    <Field Name=\"ColonToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"ColonToken\"/>\n    </Field>\n  </AbstractNode>\n  <Node Name=\"ExpressionColonSyntax\" Base=\"BaseExpressionColonSyntax\">\n    <Kind Name=\"ExpressionColon\"/>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\" Override=\"true\"/>\n    <Field Name=\"ColonToken\" Type=\"SyntaxToken\" Override=\"true\"/>\n  </Node>\n  <Node Name=\"NameColonSyntax\" Base=\"BaseExpressionColonSyntax\">\n    <Kind Name=\"NameColon\"/>\n    <Field Name=\"Name\" Type=\"IdentifierNameSyntax\">\n      <Kind Name=\"IdentifierName\"/>\n      <PropertyComment>\n        <summary>IdentifierNameSyntax representing the identifier name.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"ColonToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <PropertyComment>\n        <summary>SyntaxToken representing colon.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for name colon syntax.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a NameColonSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"DeclarationExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"DeclarationExpression\"/>\n    <Field Name=\"Type\" Type=\"TypeSyntax\"/>\n    <Field Name=\"Designation\" Type=\"VariableDesignationSyntax\">\n      <PropertyComment>\n        <summary>Declaration representing the variable declared in an out parameter or deconstruction.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for the variable declaration in an out var declaration or a deconstruction declaration.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a DeclarationExpression node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"CastExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"CastExpression\"/>\n    <Field Name=\"OpenParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenParenToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the open parenthesis.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Type\" Type=\"TypeSyntax\">\n      <PropertyComment>\n        <summary>TypeSyntax node representing the type to which the expression is being cast.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"CloseParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseParenToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the close parenthesis.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\">\n      <PropertyComment>\n        <summary>ExpressionSyntax node representing the expression that is being casted.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for cast expression.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a CastExpressionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <AbstractNode Name=\"AnonymousFunctionExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <TypeComment>\n      <summary>Provides the base class from which the classes that represent anonymous function expressions are derived.</summary>\n    </TypeComment>\n    <Field Name=\"Modifiers\" Type=\"SyntaxList&lt;SyntaxToken&gt;\"/>\n    <Choice>\n      <Field Name=\"Block\" Type=\"BlockSyntax\">\n        <PropertyComment>\n          <summary>\n            BlockSyntax node representing the body of the anonymous function.\n            Only one of Block or ExpressionBody will be non-null.\n          </summary>\n        </PropertyComment>\n      </Field>\n      <Field Name=\"ExpressionBody\" Type=\"ExpressionSyntax\">\n        <PropertyComment>\n          <summary>\n            ExpressionSyntax node representing the body of the anonymous function.\n            Only one of Block or ExpressionBody will be non-null.\n          </summary>\n        </PropertyComment>\n      </Field>\n    </Choice>\n  </AbstractNode>\n  <Node Name=\"AnonymousMethodExpressionSyntax\" Base=\"AnonymousFunctionExpressionSyntax\" SkipConvenienceFactories=\"true\">\n    <Kind Name=\"AnonymousMethodExpression\"/>\n    <Field Name=\"Modifiers\" Type=\"SyntaxList&lt;SyntaxToken&gt;\" Override=\"true\"/>\n    <Field Name=\"DelegateKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"DelegateKeyword\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the delegate keyword.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"ParameterList\" Type=\"ParameterListSyntax\" Optional=\"true\">\n      <PropertyComment>\n        <summary>List of parameters of the anonymous method expression, or null if there no parameters are specified.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Block\" Type=\"BlockSyntax\" Override=\"true\">\n      <PropertyComment>\n        <summary>\n          BlockSyntax node representing the body of the anonymous function.\n          This will never be null.\n        </summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"ExpressionBody\" Type=\"ExpressionSyntax\" Optional=\"true\" Override=\"true\">\n      <PropertyComment>\n        <summary>\n          Inherited from AnonymousFunctionExpressionSyntax, but not used for\n          AnonymousMethodExpressionSyntax.  This will always be null.\n        </summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for anonymous method expression.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates an AnonymousMethodExpressionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <AbstractNode Name=\"LambdaExpressionSyntax\" Base=\"AnonymousFunctionExpressionSyntax\">\n    <TypeComment>\n      <summary>Provides the base class from which the classes that represent lambda expressions are derived.</summary>\n    </TypeComment>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\"/>\n    <Field Name=\"ArrowToken\" Type=\"SyntaxToken\">\n      <!-- should be EqualsGreaterThanToken -->\n      <Kind Name=\"EqualsGreaterThanToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing equals greater than.</summary>\n      </PropertyComment>\n    </Field>\n  </AbstractNode>\n  <Node Name=\"SimpleLambdaExpressionSyntax\" Base=\"LambdaExpressionSyntax\">\n    <Kind Name=\"SimpleLambdaExpression\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"Modifiers\" Type=\"SyntaxList&lt;SyntaxToken&gt;\" Override=\"true\"/>\n    <Field Name=\"Parameter\" Type=\"ParameterSyntax\">\n      <Kind Name=\"Parameter\"/>\n      <PropertyComment>\n        <summary>ParameterSyntax node representing the parameter of the lambda expression.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"ArrowToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <!-- should be EqualsGreaterThanToken -->\n      <Kind Name=\"EqualsGreaterThanToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing equals greater than.</summary>\n      </PropertyComment>\n    </Field>\n    <Choice>\n      <Field Name=\"Block\" Type=\"BlockSyntax\" Override=\"true\">\n        <PropertyComment>\n          <summary>\n            BlockSyntax node representing the body of the lambda.\n            Only one of Block or ExpressionBody will be non-null.\n          </summary>\n        </PropertyComment>\n      </Field>\n      <Field Name=\"ExpressionBody\" Type=\"ExpressionSyntax\" Override=\"true\">\n        <PropertyComment>\n          <summary>\n            ExpressionSyntax node representing the body of the lambda.\n            Only one of Block or ExpressionBody will be non-null.\n          </summary>\n        </PropertyComment>\n      </Field>\n    </Choice>\n    <TypeComment>\n      <summary>Class which represents the syntax node for a simple lambda expression.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a SimpleLambdaExpressionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"RefExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"RefExpression\"/>\n    <Field Name=\"RefKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"RefKeyword\"/>\n    </Field>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\"/>\n  </Node>\n  <Node Name=\"ParenthesizedLambdaExpressionSyntax\" Base=\"LambdaExpressionSyntax\">\n    <Kind Name=\"ParenthesizedLambdaExpression\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"Modifiers\" Type=\"SyntaxList&lt;SyntaxToken&gt;\" Override=\"true\"/>\n    <Field Name=\"ReturnType\" Type=\"TypeSyntax\" Optional=\"true\"/>\n    <Field Name=\"ParameterList\" Type=\"ParameterListSyntax\">\n      <PropertyComment>\n        <summary>ParameterListSyntax node representing the list of parameters for the lambda expression.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"ArrowToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <!-- should be EqualsGreaterThanToken -->\n      <Kind Name=\"EqualsGreaterThanToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing equals greater than.</summary>\n      </PropertyComment>\n    </Field>\n    <Choice>\n      <Field Name=\"Block\" Type=\"BlockSyntax\" Override=\"true\">\n        <PropertyComment>\n          <summary>\n            BlockSyntax node representing the body of the lambda.\n            Only one of Block or ExpressionBody will be non-null.\n          </summary>\n        </PropertyComment>\n      </Field>\n      <Field Name=\"ExpressionBody\" Type=\"ExpressionSyntax\" Override=\"true\">\n        <PropertyComment>\n          <summary>\n            ExpressionSyntax node representing the body of the lambda.\n            Only one of Block or ExpressionBody will be non-null.\n          </summary>\n        </PropertyComment>\n      </Field>\n    </Choice>\n    <TypeComment>\n      <summary>Class which represents the syntax node for parenthesized lambda expression.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a ParenthesizedLambdaExpressionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"InitializerExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"ObjectInitializerExpression\"/>\n    <Kind Name=\"CollectionInitializerExpression\"/>\n    <Kind Name=\"ArrayInitializerExpression\"/>\n    <Kind Name=\"ComplexElementInitializerExpression\"/>\n    <Kind Name=\"WithInitializerExpression\" />\n    <Field Name=\"OpenBraceToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenBraceToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the open brace.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Expressions\" Type=\"SeparatedSyntaxList&lt;ExpressionSyntax&gt;\" AllowTrailingSeparator=\"true\">\n      <PropertyComment>\n        <summary>SeparatedSyntaxList of ExpressionSyntax representing the list of expressions in the initializer expression.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"CloseBraceToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseBraceToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the close brace.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for initializer expression.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates an InitializerExpressionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <AbstractNode Name=\"BaseObjectCreationExpressionSyntax\" Base=\"ExpressionSyntax\">\n      <Field Name=\"NewKeyword\" Type=\"SyntaxToken\">\n          <Kind Name=\"NewKeyword\"/>\n          <PropertyComment>\n              <summary>SyntaxToken representing the new keyword.</summary>\n          </PropertyComment>\n      </Field>\n      <Field Name=\"ArgumentList\" Type=\"ArgumentListSyntax\" Optional=\"true\">\n          <PropertyComment>\n              <summary>ArgumentListSyntax representing the list of arguments passed as part of the object creation expression.</summary>\n          </PropertyComment>\n      </Field>\n      <Field Name=\"Initializer\" Type=\"InitializerExpressionSyntax\" Optional=\"true\">\n          <PropertyComment>\n              <summary>InitializerExpressionSyntax representing the initializer expression for the object being created.</summary>\n          </PropertyComment>\n      </Field>\n  </AbstractNode>\n  <Node Name=\"ImplicitObjectCreationExpressionSyntax\" Base=\"BaseObjectCreationExpressionSyntax\">\n      <Kind Name=\"ImplicitObjectCreationExpression\"/>\n      <Field Name=\"NewKeyword\" Type=\"SyntaxToken\" Override=\"true\">\n          <Kind Name=\"NewKeyword\"/>\n          <PropertyComment>\n              <summary>SyntaxToken representing the new keyword.</summary>\n          </PropertyComment>\n      </Field>\n      <Field Name=\"ArgumentList\" Type=\"ArgumentListSyntax\" Optional=\"false\" Override=\"true\">\n          <PropertyComment>\n              <summary>ArgumentListSyntax representing the list of arguments passed as part of the object creation expression.</summary>\n          </PropertyComment>\n      </Field>\n      <Field Name=\"Initializer\" Type=\"InitializerExpressionSyntax\" Optional=\"true\" Override=\"true\">\n          <PropertyComment>\n              <summary>InitializerExpressionSyntax representing the initializer expression for the object being created.</summary>\n          </PropertyComment>\n      </Field>\n      <TypeComment>\n          <summary>Class which represents the syntax node for implicit object creation expression.</summary>\n      </TypeComment>\n      <FactoryComment>\n          <summary>Creates an ImplicitObjectCreationExpressionSyntax node.</summary>\n      </FactoryComment>\n  </Node>\n  <Node Name=\"ObjectCreationExpressionSyntax\" Base=\"BaseObjectCreationExpressionSyntax\">\n    <Kind Name=\"ObjectCreationExpression\"/>\n    <Field Name=\"NewKeyword\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"NewKeyword\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the new keyword.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Type\" Type=\"TypeSyntax\">\n      <PropertyComment>\n        <summary>TypeSyntax representing the type of the object being created.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"ArgumentList\" Type=\"ArgumentListSyntax\" Optional=\"true\" Override=\"true\">\n      <PropertyComment>\n        <summary>ArgumentListSyntax representing the list of arguments passed as part of the object creation expression.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Initializer\" Type=\"InitializerExpressionSyntax\" Optional=\"true\" Override=\"true\">\n      <PropertyComment>\n        <summary>InitializerExpressionSyntax representing the initializer expression for the object being created.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for object creation expression.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates an ObjectCreationExpressionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"WithExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"WithExpression\"/>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\" />\n    <Field Name=\"WithKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"WithKeyword\" />\n    </Field>\n    <Field Name=\"Initializer\" Type=\"InitializerExpressionSyntax\">\n        <PropertyComment>\n            <summary>InitializerExpressionSyntax representing the initializer expression for the with expression.</summary>\n        </PropertyComment>\n    </Field>\n  </Node>\n  <Node Name=\"AnonymousObjectMemberDeclaratorSyntax\" Base=\"CSharpSyntaxNode\">\n    <Kind Name=\"AnonymousObjectMemberDeclarator\"/>\n    <Field Name=\"NameEquals\" Type=\"NameEqualsSyntax\" Optional=\"true\">\n      <PropertyComment>\n        <summary>NameEqualsSyntax representing the optional name of the member being initialized.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\">\n      <PropertyComment>\n        <summary>ExpressionSyntax representing the value the member is initialized with.</summary>\n      </PropertyComment>\n    </Field>\n    <FactoryComment>\n      <summary>Creates an AnonymousObjectMemberDeclaratorSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"AnonymousObjectCreationExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"AnonymousObjectCreationExpression\"/>\n    <Field Name=\"NewKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"NewKeyword\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the new keyword.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"OpenBraceToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenBraceToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the open brace.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Initializers\" Type=\"SeparatedSyntaxList&lt;AnonymousObjectMemberDeclaratorSyntax&gt;\" AllowTrailingSeparator=\"true\">\n      <PropertyComment>\n        <summary>SeparatedSyntaxList of AnonymousObjectMemberDeclaratorSyntax representing the list of object member initializers.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"CloseBraceToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseBraceToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the close brace.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for anonymous object creation expression.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates an AnonymousObjectCreationExpressionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"ArrayCreationExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"ArrayCreationExpression\"/>\n    <Field Name=\"NewKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"NewKeyword\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the new keyword.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Type\" Type=\"ArrayTypeSyntax\">\n      <PropertyComment>\n        <summary>ArrayTypeSyntax node representing the type of the array.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Initializer\" Type=\"InitializerExpressionSyntax\" Optional=\"true\">\n      <PropertyComment>\n        <summary>InitializerExpressionSyntax node representing the initializer of the array creation expression.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for array creation expression.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates an ArrayCreationExpressionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"ImplicitArrayCreationExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"ImplicitArrayCreationExpression\"/>\n    <Field Name=\"NewKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"NewKeyword\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the new keyword.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"OpenBracketToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenBracketToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the open bracket.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Commas\" Type=\"SyntaxList&lt;SyntaxToken&gt;\">\n      <PropertyComment>\n        <summary>SyntaxList of SyntaxToken representing the commas in the implicit array creation expression.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"CloseBracketToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseBracketToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the close bracket.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Initializer\" Type=\"InitializerExpressionSyntax\">\n      <PropertyComment>\n        <summary>InitializerExpressionSyntax representing the initializer expression of the implicit array creation expression.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for implicit array creation expression.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates an ImplicitArrayCreationExpressionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"StackAllocArrayCreationExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"StackAllocArrayCreationExpression\"/>\n    <Field Name=\"StackAllocKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"StackAllocKeyword\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the stackalloc keyword.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Type\" Type=\"TypeSyntax\">\n      <PropertyComment>\n        <summary>TypeSyntax node representing the type of the stackalloc array.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Initializer\" Type=\"InitializerExpressionSyntax\" Optional=\"true\">\n      <PropertyComment>\n        <summary>InitializerExpressionSyntax node representing the initializer of the stackalloc array creation expression.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for stackalloc array creation expression.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a StackAllocArrayCreationExpressionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"ImplicitStackAllocArrayCreationExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"ImplicitStackAllocArrayCreationExpression\"/>\n    <Field Name=\"StackAllocKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"StackAllocKeyword\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the stackalloc keyword.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"OpenBracketToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenBracketToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the open bracket.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"CloseBracketToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseBracketToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the close bracket.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Initializer\" Type=\"InitializerExpressionSyntax\">\n      <PropertyComment>\n        <summary>InitializerExpressionSyntax representing the initializer expression of the implicit stackalloc array creation expression.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents the syntax node for implicit stackalloc array creation expression.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates an ImplicitStackAllocArrayCreationExpressionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"CollectionExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"CollectionExpression\"/>\n    <Field Name=\"OpenBracketToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenBracketToken\"/>\n    </Field>\n    <Field Name=\"Elements\" Type=\"SeparatedSyntaxList&lt;CollectionElementSyntax&gt;\" AllowTrailingSeparator=\"true\">\n      <PropertyComment>\n        <summary>SeparatedSyntaxList of CollectionElementSyntax representing the list of elements in the collection expression.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"CloseBracketToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseBracketToken\"/>\n    </Field>\n  </Node>\n  <AbstractNode Name=\"CollectionElementSyntax\" Base=\"CSharpSyntaxNode\" />\n  <Node Name=\"ExpressionElementSyntax\" Base=\"CollectionElementSyntax\">\n    <Kind Name=\"ExpressionElement\"/>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\" />\n  </Node>\n  <Node Name=\"SpreadElementSyntax\" Base=\"CollectionElementSyntax\">\n    <Kind Name=\"SpreadElement\"/>\n    <Field Name=\"OperatorToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"DotDotToken\"/>\n    </Field>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\" />\n  </Node>\n  <AbstractNode Name=\"QueryClauseSyntax\" Base=\"CSharpSyntaxNode\">\n  </AbstractNode>\n  <AbstractNode Name=\"SelectOrGroupClauseSyntax\" Base=\"CSharpSyntaxNode\">\n  </AbstractNode>\n  <Node Name=\"QueryExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"QueryExpression\"/>\n    <Field Name=\"FromClause\" Type=\"FromClauseSyntax\"/>\n    <Field Name=\"Body\" Type=\"QueryBodySyntax\"/>\n  </Node>\n  <Node Name=\"QueryBodySyntax\" Base=\"CSharpSyntaxNode\">\n    <Kind Name=\"QueryBody\"/>\n    <Field Name=\"Clauses\" Type=\"SyntaxList&lt;QueryClauseSyntax&gt;\" MinCount=\"1\"/>\n    <Field Name=\"SelectOrGroup\" Type=\"SelectOrGroupClauseSyntax\"/>\n    <Field Name=\"Continuation\" Type=\"QueryContinuationSyntax\" Optional=\"true\"/>\n  </Node>\n  <Node Name=\"FromClauseSyntax\" Base=\"QueryClauseSyntax\">\n    <Kind Name=\"FromClause\"/>\n    <Field Name=\"FromKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"FromKeyword\"/>\n    </Field>\n    <Field Name=\"Type\" Type=\"TypeSyntax\" Optional=\"true\"/>\n    <Field Name=\"Identifier\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the identifier.</summary>\n      </PropertyComment>\n      <Kind Name=\"IdentifierToken\"/>\n    </Field>\n    <Field Name=\"InKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"InKeyword\"/>\n    </Field>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\"/>\n  </Node>\n  <Node Name=\"LetClauseSyntax\" Base=\"QueryClauseSyntax\">\n    <Kind Name=\"LetClause\"/>\n    <Field Name=\"LetKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"LetKeyword\"/>\n    </Field>\n    <Field Name=\"Identifier\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the identifier.</summary>\n      </PropertyComment>\n      <Kind Name=\"IdentifierToken\"/>\n    </Field>\n    <Field Name=\"EqualsToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"EqualsToken\"/>\n    </Field>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\"/>\n  </Node>\n  <Node Name=\"JoinClauseSyntax\" Base=\"QueryClauseSyntax\">\n    <Kind Name=\"JoinClause\"/>\n    <Field Name=\"JoinKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"JoinKeyword\"/>\n    </Field>\n    <Field Name=\"Type\" Type=\"TypeSyntax\" Optional=\"true\"/>\n    <Field Name=\"Identifier\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the identifier.</summary>\n      </PropertyComment>\n      <Kind Name=\"IdentifierToken\"/>\n    </Field>\n    <Field Name=\"InKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"InKeyword\"/>\n    </Field>\n    <Field Name=\"InExpression\" Type=\"ExpressionSyntax\"/>\n    <Field Name=\"OnKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"OnKeyword\"/>\n    </Field>\n    <Field Name=\"LeftExpression\" Type=\"ExpressionSyntax\"/>\n    <Field Name=\"EqualsKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"EqualsKeyword\"/>\n    </Field>\n    <Field Name=\"RightExpression\" Type=\"ExpressionSyntax\"/>\n    <Field Name=\"Into\" Type=\"JoinIntoClauseSyntax\" Optional=\"true\"/>\n  </Node>\n  <Node Name=\"JoinIntoClauseSyntax\" Base=\"CSharpSyntaxNode\">\n    <Kind Name=\"JoinIntoClause\"/>\n    <Field Name=\"IntoKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"IntoKeyword\"/>\n    </Field>\n    <Field Name=\"Identifier\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the identifier.</summary>\n      </PropertyComment>\n      <Kind Name=\"IdentifierToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"WhereClauseSyntax\" Base=\"QueryClauseSyntax\">\n    <Kind Name=\"WhereClause\"/>\n    <Field Name=\"WhereKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"WhereKeyword\"/>\n    </Field>\n    <Field Name=\"Condition\" Type=\"ExpressionSyntax\"/>\n  </Node>\n  <Node Name=\"OrderByClauseSyntax\" Base=\"QueryClauseSyntax\">\n    <Kind Name=\"OrderByClause\"/>\n    <Field Name=\"OrderByKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"OrderByKeyword\"/>\n    </Field>\n    <Field Name=\"Orderings\" Type=\"SeparatedSyntaxList&lt;OrderingSyntax&gt;\" MinCount=\"1\"/>\n  </Node>\n  <Node Name=\"OrderingSyntax\" Base=\"CSharpSyntaxNode\">\n    <Kind Name=\"AscendingOrdering\"/>\n    <Kind Name=\"DescendingOrdering\"/>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\"/>\n    <Field Name=\"AscendingOrDescendingKeyword\" Type=\"SyntaxToken\" Optional=\"true\">\n      <Kind Name=\"AscendingKeyword\"/>\n      <Kind Name=\"DescendingKeyword\"/>\n    </Field>\n  </Node>\n  <Node Name=\"SelectClauseSyntax\" Base=\"SelectOrGroupClauseSyntax\">\n    <Kind Name=\"SelectClause\"/>\n    <Field Name=\"SelectKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"SelectKeyword\"/>\n    </Field>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\"/>\n  </Node>\n  <Node Name=\"GroupClauseSyntax\" Base=\"SelectOrGroupClauseSyntax\">\n    <Kind Name=\"GroupClause\"/>\n    <Field Name=\"GroupKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"GroupKeyword\"/>\n    </Field>\n    <Field Name=\"GroupExpression\" Type=\"ExpressionSyntax\"/>\n    <Field Name=\"ByKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"ByKeyword\"/>\n    </Field>\n    <Field Name=\"ByExpression\" Type=\"ExpressionSyntax\"/>\n  </Node>\n  <Node Name=\"QueryContinuationSyntax\" Base=\"CSharpSyntaxNode\">\n    <Kind Name=\"QueryContinuation\"/>\n    <Field Name=\"IntoKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"IntoKeyword\"/>\n    </Field>\n    <Field Name=\"Identifier\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the identifier.</summary>\n      </PropertyComment>\n      <Kind Name=\"IdentifierToken\"/>\n    </Field>\n    <Field Name=\"Body\" Type=\"QueryBodySyntax\"/>\n  </Node>\n  <Node Name=\"OmittedArraySizeExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"OmittedArraySizeExpression\"/>\n    <Field Name=\"OmittedArraySizeExpressionToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OmittedArraySizeExpressionToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the omitted array size expression.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents a placeholder in an array size list.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates an OmittedArraySizeExpressionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"InterpolatedStringExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"InterpolatedStringExpression\"/>\n    <Field Name=\"StringStartToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"InterpolatedStringStartToken\"/>\n      <Kind Name=\"InterpolatedVerbatimStringStartToken\"/>\n      <Kind Name=\"InterpolatedSingleLineRawStringStartToken\"/>\n      <Kind Name=\"InterpolatedMultiLineRawStringStartToken\"/>\n      <PropertyComment>\n        <summary>The first part of an interpolated string, <c>$\"</c> or <c>$@\"</c> or <c>$\"\"\"</c></summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Contents\" Type=\"SyntaxList&lt;InterpolatedStringContentSyntax&gt;\" >\n      <PropertyComment>\n        <summary>List of parts of the interpolated string, each one is either a literal part or an interpolation.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"StringEndToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"InterpolatedStringEndToken\"/>\n      <Kind Name=\"InterpolatedStringEndToken\"/>\n      <Kind Name=\"InterpolatedRawStringEndToken\"/>\n      <Kind Name=\"InterpolatedRawStringEndToken\"/>\n      <PropertyComment>\n        <summary>The closing quote of the interpolated string.</summary>\n      </PropertyComment>\n    </Field>\n  </Node>\n  <Node Name=\"IsPatternExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"IsPatternExpression\"/>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\">\n    <PropertyComment>\n      <summary>ExpressionSyntax node representing the expression on the left of the \"is\" operator.</summary>\n    </PropertyComment>\n    </Field>\n    <Field Name=\"IsKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"IsKeyword\"/>\n    </Field>\n    <Field Name=\"Pattern\" Type=\"PatternSyntax\">\n      <PropertyComment>\n        <summary>PatternSyntax node representing the pattern on the right of the \"is\" operator.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Class which represents a simple pattern-matching expression using the \"is\" keyword.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates an IsPatternExpressionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"ThrowExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"ThrowExpression\" />\n    <Field Name=\"ThrowKeyword\" Type=\"SyntaxToken\" Optional=\"false\">\n      <Kind Name=\"ThrowKeyword\"/>\n    </Field>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\" Optional=\"false\"/>\n  </Node>\n  <Node Name=\"WhenClauseSyntax\" Base=\"CSharpSyntaxNode\">\n    <Kind Name=\"WhenClause\" />\n    <Field Name=\"WhenKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"WhenKeyword\"/>\n    </Field>\n    <Field Name=\"Condition\" Type=\"ExpressionSyntax\"/>\n  </Node>\n  <AbstractNode Name=\"PatternSyntax\" Base=\"ExpressionOrPatternSyntax\" />\n  <Node Name=\"DiscardPatternSyntax\" Base=\"PatternSyntax\">\n    <Kind Name=\"DiscardPattern\" />\n    <Field Name=\"UnderscoreToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"UnderscoreToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"DeclarationPatternSyntax\" Base=\"PatternSyntax\">\n    <Kind Name=\"DeclarationPattern\" />\n    <Field Name=\"Type\" Type=\"TypeSyntax\"/>\n    <Field Name=\"Designation\" Type=\"VariableDesignationSyntax\">\n      <Kind Name=\"SingleVariableDesignation\"/>\n      <Kind Name=\"DiscardDesignation\"/>\n    </Field>\n  </Node>\n  <Node Name=\"VarPatternSyntax\" Base=\"PatternSyntax\">\n    <Kind Name=\"VarPattern\" />\n    <Field Name=\"VarKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"VarKeyword\"/>\n    </Field>\n    <Field Name=\"Designation\" Type=\"VariableDesignationSyntax\"/>\n  </Node>\n  <Node Name=\"RecursivePatternSyntax\" Base=\"PatternSyntax\">\n    <Kind Name=\"RecursivePattern\" />\n    <Field Name=\"Type\" Type=\"TypeSyntax\" Optional=\"true\" />\n    <Field Name=\"PositionalPatternClause\" Type=\"PositionalPatternClauseSyntax\" Optional=\"true\" />\n    <Field Name=\"PropertyPatternClause\" Type=\"PropertyPatternClauseSyntax\" Optional=\"true\" />\n    <Field Name=\"Designation\" Type=\"VariableDesignationSyntax\" Optional=\"true\">\n      <Kind Name=\"SingleVariableDesignation\"/>\n      <Kind Name=\"DiscardDesignation\"/>\n    </Field>\n  </Node>\n  <Node Name=\"PositionalPatternClauseSyntax\" Base=\"CSharpSyntaxNode\">\n    <Kind Name=\"PositionalPatternClause\"/>\n    <Field Name=\"OpenParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenParenToken\"/>\n    </Field>\n    <Field Name=\"Subpatterns\" Type=\"SeparatedSyntaxList&lt;SubpatternSyntax&gt;\"/>\n    <Field Name=\"CloseParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseParenToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"PropertyPatternClauseSyntax\" Base=\"CSharpSyntaxNode\">\n    <Kind Name=\"PropertyPatternClause\"/>\n    <Field Name=\"OpenBraceToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenBraceToken\"/>\n    </Field>\n    <Field Name=\"Subpatterns\" Type=\"SeparatedSyntaxList&lt;SubpatternSyntax&gt;\" AllowTrailingSeparator=\"true\"/>\n    <Field Name=\"CloseBraceToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseBraceToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"SubpatternSyntax\" Base=\"CSharpSyntaxNode\">\n    <Kind Name=\"Subpattern\"/>\n    <Field Name=\"ExpressionColon\" Type=\"BaseExpressionColonSyntax\" Optional=\"true\"/>\n    <Field Name=\"Pattern\" Type=\"PatternSyntax\" />\n  </Node>\n  <Node Name=\"ConstantPatternSyntax\" Base=\"PatternSyntax\">\n    <Kind Name=\"ConstantPattern\"/>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\">\n      <PropertyComment>\n        <summary>ExpressionSyntax node representing the constant expression.</summary>\n      </PropertyComment>\n    </Field>\n  </Node>\n\n  <!-- Pattern forms added for C# 9.0 -->\n  <Node Name=\"ParenthesizedPatternSyntax\" Base=\"PatternSyntax\">\n    <Kind Name=\"ParenthesizedPattern\"/>\n    <Field Name=\"OpenParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenParenToken\"/>\n    </Field>\n    <Field Name=\"Pattern\" Type=\"PatternSyntax\" />\n    <Field Name=\"CloseParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseParenToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"RelationalPatternSyntax\" Base=\"PatternSyntax\">\n    <Kind Name=\"RelationalPattern\"/>\n    <Field Name=\"OperatorToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"EqualsEqualsToken\"/>\n      <Kind Name=\"ExclamationEqualsToken\"/>\n      <Kind Name=\"LessThanToken\"/>\n      <Kind Name=\"LessThanEqualsToken\"/>\n      <Kind Name=\"GreaterThanToken\"/>\n      <Kind Name=\"GreaterThanEqualsToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the operator of the relational pattern.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\" />\n  </Node>\n  <Node Name=\"TypePatternSyntax\" Base=\"PatternSyntax\">\n    <Kind Name=\"TypePattern\"/>\n    <Field Name=\"Type\" Type=\"TypeSyntax\">\n      <PropertyComment>\n        <summary>The type for the type pattern.</summary>\n      </PropertyComment>\n    </Field>\n  </Node>\n  <Node Name=\"BinaryPatternSyntax\" Base=\"PatternSyntax\">\n    <Kind Name=\"OrPattern\"/>\n    <Kind Name=\"AndPattern\"/>\n    <Field Name=\"Left\" Type=\"PatternSyntax\" />\n    <Field Name=\"OperatorToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OrKeyword\"/>\n      <Kind Name=\"AndKeyword\"/>\n    </Field>\n    <Field Name=\"Right\" Type=\"PatternSyntax\" />\n  </Node>\n  <Node Name=\"UnaryPatternSyntax\" Base=\"PatternSyntax\">\n    <Kind Name=\"NotPattern\"/>\n    <Field Name=\"OperatorToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"NotKeyword\"/>\n    </Field>\n    <Field Name=\"Pattern\" Type=\"PatternSyntax\" />\n  </Node>\n  <Node Name=\"ListPatternSyntax\" Base=\"PatternSyntax\">\n    <Kind Name=\"ListPattern\"/>\n    <Field Name=\"OpenBracketToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenBracketToken\"/>\n    </Field>\n    <Field Name=\"Patterns\" Type=\"SeparatedSyntaxList&lt;PatternSyntax&gt;\" AllowTrailingSeparator=\"true\"/>\n    <Field Name=\"CloseBracketToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseBracketToken\"/>\n    </Field>\n    <Field Name=\"Designation\" Type=\"VariableDesignationSyntax\" Optional=\"true\">\n      <Kind Name=\"SingleVariableDesignation\"/>\n      <Kind Name=\"DiscardDesignation\"/>\n    </Field>\n  </Node>\n  <Node Name=\"SlicePatternSyntax\" Base=\"PatternSyntax\">\n    <Kind Name=\"SlicePattern\"/>\n    <Field Name=\"DotDotToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"DotDotToken\"/>\n    </Field>\n    <Field Name=\"Pattern\" Type=\"PatternSyntax\" Optional=\"true\"/>\n  </Node>\n\n  <AbstractNode Name=\"InterpolatedStringContentSyntax\" Base=\"CSharpSyntaxNode\" />\n  <Node Name=\"InterpolatedStringTextSyntax\" Base=\"InterpolatedStringContentSyntax\">\n    <Kind Name=\"InterpolatedStringText\"/>\n    <Field Name=\"TextToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"InterpolatedStringTextToken\"/>\n      <PropertyComment>\n        <summary>The text contents of a part of the interpolated string.</summary>\n      </PropertyComment>\n    </Field>\n  </Node>\n  <Node Name=\"InterpolationSyntax\" Base=\"InterpolatedStringContentSyntax\">\n    <Kind Name=\"Interpolation\"/>\n    <Field Name=\"OpenBraceToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenBraceToken\"/>\n      <PropertyComment>\n        <summary>This could be a single <c>{</c> or multiple in a row (in the case of an interpolation in a raw interpolated string).</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\"/>\n    <Field Name=\"AlignmentClause\" Type=\"InterpolationAlignmentClauseSyntax\" Optional=\"true\"/>\n    <Field Name=\"FormatClause\" Type=\"InterpolationFormatClauseSyntax\" Optional=\"true\"/>\n    <Field Name=\"CloseBraceToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseBraceToken\"/>\n      <PropertyComment>\n        <summary>\n          This could be a single <c>}</c> or multiple in a row (in the case of an interpolation in a raw interpolated string).\n        </summary>\n      </PropertyComment>\n    </Field>\n  </Node>\n  <Node Name=\"InterpolationAlignmentClauseSyntax\" Base=\"CSharpSyntaxNode\">\n    <Kind Name=\"InterpolationAlignmentClause\"/>\n    <Field Name=\"CommaToken\" Type=\"SyntaxToken\"/>\n    <Field Name=\"Value\" Type=\"ExpressionSyntax\"/>\n  </Node>\n  <Node Name=\"InterpolationFormatClauseSyntax\" Base=\"CSharpSyntaxNode\">\n    <Kind Name=\"InterpolationFormatClause\"/>\n    <Field Name=\"ColonToken\" Type=\"SyntaxToken\"/>\n    <Field Name=\"FormatStringToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"InterpolatedStringTextToken\"/>\n      <PropertyComment>\n        <summary>The text contents of the format specifier for an interpolation.</summary>\n      </PropertyComment>\n    </Field>\n  </Node>\n  <!-- Statements -->\n  <Node Name=\"GlobalStatementSyntax\" Base=\"MemberDeclarationSyntax\">\n    <Kind Name=\"GlobalStatement\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\">\n      <summary>Always empty on a global statement.</summary>\n    </Field>\n    <Field Name=\"Modifiers\" Type=\"SyntaxList&lt;SyntaxToken&gt;\" Override=\"true\">\n      <summary>Always empty on a global statement.</summary>\n    </Field>\n    <Field Name=\"Statement\" Type=\"StatementSyntax\"/>\n  </Node>\n  <AbstractNode Name=\"StatementSyntax\" Base=\"CSharpSyntaxNode\">\n    <TypeComment>\n      <summary>Represents the base class for all statements syntax classes.</summary>\n    </TypeComment>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\"/> \n  </AbstractNode>\n  <Node Name=\"BlockSyntax\" Base=\"StatementSyntax\">\n    <Kind Name=\"Block\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"OpenBraceToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenBraceToken\"/>\n    </Field>\n    <Field Name=\"Statements\" Type=\"SyntaxList&lt;StatementSyntax&gt;\"/>\n    <Field Name=\"CloseBraceToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseBraceToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"LocalFunctionStatementSyntax\" Base=\"StatementSyntax\">\n    <Kind Name=\"LocalFunctionStatement\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"Modifiers\" Type=\"SyntaxList&lt;SyntaxToken&gt;\"/>\n    <Field Name=\"ReturnType\" Type=\"TypeSyntax\"/>\n    <Field Name=\"Identifier\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the identifier.</summary>\n      </PropertyComment>\n      <Kind Name=\"IdentifierToken\"/>\n    </Field>\n    <Field Name=\"TypeParameterList\" Type=\"TypeParameterListSyntax\" Optional=\"true\"/>\n    <Field Name=\"ParameterList\" Type=\"ParameterListSyntax\"/>\n    <Field Name=\"ConstraintClauses\" Type=\"SyntaxList&lt;TypeParameterConstraintClauseSyntax&gt;\"/>\n    <Choice>\n      <Field Name=\"Body\" Type=\"BlockSyntax\"/>\n      <Sequence>\n        <Field Name=\"ExpressionBody\" Type=\"ArrowExpressionClauseSyntax\"/>\n        <Field Name=\"SemicolonToken\" Type=\"SyntaxToken\">\n          <PropertyComment>\n            <summary>Gets the optional semicolon token.</summary>\n          </PropertyComment>\n          <Kind Name=\"SemicolonToken\"/>\n        </Field>\n      </Sequence>\n    </Choice>\n  </Node>\n\n  <Node Name=\"LocalDeclarationStatementSyntax\" Base=\"StatementSyntax\">\n    <Kind Name=\"LocalDeclarationStatement\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"AwaitKeyword\" Type=\"SyntaxToken\" Optional=\"true\">\n      <Kind Name=\"AwaitKeyword\"/>\n    </Field>\n    <Field Name=\"UsingKeyword\" Type=\"SyntaxToken\" Optional=\"true\">\n      <Kind Name=\"UsingKeyword\"/>\n    </Field>\n    <Field Name=\"Modifiers\" Type=\"SyntaxList&lt;SyntaxToken&gt;\">\n      <PropertyComment>\n        <summary>Gets the modifier list.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Declaration\" Type=\"VariableDeclarationSyntax\"/>\n    <Field Name=\"SemicolonToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"SemicolonToken\"/>\n    </Field>\n  </Node>\n\n  <Node Name=\"VariableDeclarationSyntax\" Base=\"CSharpSyntaxNode\">\n    <Kind Name=\"VariableDeclaration\"/>\n    <Field Name=\"Type\" Type=\"TypeSyntax\"/>\n    <Field Name=\"Variables\" Type=\"SeparatedSyntaxList&lt;VariableDeclaratorSyntax&gt;\" MinCount=\"1\"/>\n  </Node>\n\n  <Node Name=\"VariableDeclaratorSyntax\" Base=\"CSharpSyntaxNode\">\n    <Kind Name=\"VariableDeclarator\"/>\n    <Field Name=\"Identifier\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the identifier.</summary>\n      </PropertyComment>\n      <Kind Name=\"IdentifierToken\"/>\n    </Field>\n    <Field Name=\"ArgumentList\" Type=\"BracketedArgumentListSyntax\" Optional=\"true\"/>\n    <Field Name=\"Initializer\" Type=\"EqualsValueClauseSyntax\" Optional=\"true\"/>\n  </Node>\n  <Node Name=\"EqualsValueClauseSyntax\" Base=\"CSharpSyntaxNode\">\n    <Kind Name=\"EqualsValueClause\"/>\n    <Field Name=\"EqualsToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"EqualsToken\"/>\n    </Field>\n    <Field Name=\"Value\" Type=\"ExpressionSyntax\"/>\n  </Node>\n  <AbstractNode Name=\"VariableDesignationSyntax\" Base=\"CSharpSyntaxNode\">\n  </AbstractNode>\n  <Node Name=\"SingleVariableDesignationSyntax\" Base=\"VariableDesignationSyntax\">\n    <Kind Name=\"SingleVariableDesignation\"/>\n    <Field Name=\"Identifier\" Type=\"SyntaxToken\">\n      <Kind Name=\"IdentifierToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"DiscardDesignationSyntax\" Base=\"VariableDesignationSyntax\">\n    <Kind Name=\"DiscardDesignation\"/>\n    <Field Name=\"UnderscoreToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"UnderscoreToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"ParenthesizedVariableDesignationSyntax\" Base=\"VariableDesignationSyntax\">\n    <Kind Name=\"ParenthesizedVariableDesignation\"/>\n    <Field Name=\"OpenParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenParenToken\"/>\n    </Field>\n    <Field Name=\"Variables\" Type=\"SeparatedSyntaxList&lt;VariableDesignationSyntax&gt;\"/>\n    <Field Name=\"CloseParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseParenToken\"/>\n    </Field>\n  </Node>\n\n  <Node Name=\"ExpressionStatementSyntax\" Base=\"StatementSyntax\">\n    <Kind Name=\"ExpressionStatement\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\"/>\n    <Field Name=\"SemicolonToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"SemicolonToken\"/>\n    </Field>\n  </Node>\n\n  <Node Name=\"EmptyStatementSyntax\" Base=\"StatementSyntax\">\n    <Kind Name=\"EmptyStatement\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"SemicolonToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"SemicolonToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"LabeledStatementSyntax\" Base=\"StatementSyntax\">\n    <Kind Name=\"LabeledStatement\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"Identifier\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the identifier.</summary>\n      </PropertyComment>\n      <Kind Name=\"IdentifierToken\"/>\n    </Field>\n    <Field Name=\"ColonToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"ColonToken\"/>\n      <PropertyComment>\n        <summary>Gets a SyntaxToken that represents the colon following the statement's label.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Statement\" Type=\"StatementSyntax\"/>\n    <TypeComment>\n      <summary>Represents a labeled statement syntax.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a LabeledStatementSyntax node</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"GotoStatementSyntax\" Base=\"StatementSyntax\">\n    <Kind Name=\"GotoStatement\"/>\n    <Kind Name=\"GotoCaseStatement\"/>\n    <Kind Name=\"GotoDefaultStatement\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"GotoKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"GotoKeyword\"/>\n      <PropertyComment>\n        <summary>\n          Gets a SyntaxToken that represents the goto keyword.\n        </summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"CaseOrDefaultKeyword\" Type=\"SyntaxToken\" Optional=\"true\">\n      <Kind Name=\"CaseKeyword\"/>\n      <Kind Name=\"DefaultKeyword\"/>\n      <PropertyComment>\n        <summary>\n          Gets a SyntaxToken that represents the case or default keywords if any exists.\n        </summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\" Optional=\"true\">\n      <PropertyComment>\n        <summary>\n          Gets a constant expression for a goto case statement.\n        </summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"SemicolonToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"SemicolonToken\"/>\n      <PropertyComment>\n        <summary>\n          Gets a SyntaxToken that represents the semi-colon at the end of the statement.\n        </summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>\n        Represents a goto statement syntax\n      </summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>\n        Creates a GotoStatementSyntax node.\n      </summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"BreakStatementSyntax\" Base=\"StatementSyntax\">\n    <Kind Name=\"BreakStatement\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"BreakKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"BreakKeyword\"/>\n    </Field>\n    <Field Name=\"SemicolonToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"SemicolonToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"ContinueStatementSyntax\" Base=\"StatementSyntax\">\n    <Kind Name=\"ContinueStatement\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"ContinueKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"ContinueKeyword\"/>\n    </Field>\n    <Field Name=\"SemicolonToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"SemicolonToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"ReturnStatementSyntax\" Base=\"StatementSyntax\">\n    <Kind Name=\"ReturnStatement\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"ReturnKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"ReturnKeyword\"/>\n    </Field>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\" Optional=\"true\"/>\n    <Field Name=\"SemicolonToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"SemicolonToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"ThrowStatementSyntax\" Base=\"StatementSyntax\">\n    <Kind Name=\"ThrowStatement\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"ThrowKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"ThrowKeyword\"/>\n    </Field>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\" Optional=\"true\"/>\n    <Field Name=\"SemicolonToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"SemicolonToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"YieldStatementSyntax\" Base=\"StatementSyntax\">\n    <Kind Name=\"YieldReturnStatement\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Kind Name=\"YieldBreakStatement\"/>\n    <Field Name=\"YieldKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"YieldKeyword\"/>\n    </Field>\n    <Field Name=\"ReturnOrBreakKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"ReturnKeyword\"/>\n      <Kind Name=\"BreakKeyword\"/>\n    </Field>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\" Optional=\"true\"/>\n    <Field Name=\"SemicolonToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"SemicolonToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"WhileStatementSyntax\" Base=\"StatementSyntax\">\n    <Kind Name=\"WhileStatement\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"WhileKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"WhileKeyword\"/>\n    </Field>\n    <Field Name=\"OpenParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenParenToken\"/>\n    </Field>\n    <Field Name=\"Condition\" Type=\"ExpressionSyntax\"/>\n    <Field Name=\"CloseParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseParenToken\"/>\n    </Field>\n    <Field Name=\"Statement\" Type=\"StatementSyntax\"/>\n  </Node>\n  <Node Name=\"DoStatementSyntax\" Base=\"StatementSyntax\">\n    <Kind Name=\"DoStatement\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"DoKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"DoKeyword\"/>\n    </Field>\n    <Field Name=\"Statement\" Type=\"StatementSyntax\"/>\n    <Field Name=\"WhileKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"WhileKeyword\"/>\n    </Field>\n    <Field Name=\"OpenParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenParenToken\"/>\n    </Field>\n    <Field Name=\"Condition\" Type=\"ExpressionSyntax\"/>\n    <Field Name=\"CloseParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseParenToken\"/>\n    </Field>\n    <Field Name=\"SemicolonToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"SemicolonToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"ForStatementSyntax\" Base=\"StatementSyntax\">\n    <Kind Name=\"ForStatement\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"ForKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"ForKeyword\"/>\n    </Field>\n    <Field Name=\"OpenParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenParenToken\"/>\n    </Field>\n    <!-- Declaration and Initializers are mutually exclusive. -->\n    <Choice>\n      <Field Name=\"Declaration\" Type=\"VariableDeclarationSyntax\" Optional=\"true\"/>\n      <Field Name=\"Initializers\" Type=\"SeparatedSyntaxList&lt;ExpressionSyntax&gt;\"/>\n    </Choice>\n    <Field Name=\"FirstSemicolonToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"SemicolonToken\"/>\n    </Field>\n    <Field Name=\"Condition\" Type=\"ExpressionSyntax\" Optional=\"true\"/>\n    <Field Name=\"SecondSemicolonToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"SemicolonToken\"/>\n    </Field>\n    <Field Name=\"Incrementors\" Type=\"SeparatedSyntaxList&lt;ExpressionSyntax&gt;\"/>\n    <Field Name=\"CloseParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseParenToken\"/>\n    </Field>\n    <Field Name=\"Statement\" Type=\"StatementSyntax\"/>\n  </Node>\n\n  <!-- Because there are two forms of the foreach loop, we make an abstract base. -->\n  <AbstractNode Name=\"CommonForEachStatementSyntax\" Base=\"StatementSyntax\">\n    <Field Name=\"AwaitKeyword\" Type=\"SyntaxToken\" Optional=\"true\">\n      <Kind Name=\"AwaitKeyword\"/>\n    </Field>\n    <Field Name=\"ForEachKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"ForEachKeyword\"/>\n    </Field>\n    <Field Name=\"OpenParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenParenToken\"/>\n    </Field>\n    <!-- At this point one of two declaration forms appears -->\n    <Field Name=\"InKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"InKeyword\"/>\n    </Field>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\"/>\n    <Field Name=\"CloseParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseParenToken\"/>\n    </Field>\n    <Field Name=\"Statement\" Type=\"StatementSyntax\"/>\n  </AbstractNode>\n  <Node Name=\"ForEachStatementSyntax\" Base=\"CommonForEachStatementSyntax\">\n    <!-- This is the existing C# 6 node. -->\n    <Kind Name=\"ForEachStatement\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"AwaitKeyword\" Type=\"SyntaxToken\" Optional=\"true\" Override=\"true\">\n      <Kind Name=\"AwaitKeyword\"/>\n    </Field>\n    <Field Name=\"ForEachKeyword\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"ForEachKeyword\"/>\n    </Field>\n    <Field Name=\"OpenParenToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"OpenParenToken\"/>\n    </Field>\n    <Field Name=\"Type\" Type=\"TypeSyntax\"/>\n    <Field Name=\"Identifier\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the identifier.</summary>\n      </PropertyComment>\n      <Kind Name=\"IdentifierToken\"/>\n    </Field>\n    <Field Name=\"InKeyword\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"InKeyword\"/>\n    </Field>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\" Override=\"true\"/>\n    <Field Name=\"CloseParenToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"CloseParenToken\"/>\n    </Field>\n    <Field Name=\"Statement\" Type=\"StatementSyntax\" Override=\"true\"/>\n  </Node>\n  <!-- We name this \"DeclarationForEachStatementSyntax\" because it can express existing foreach\n       loops. We may elect to represent all foreach loops using this node and deprecate (stop parsing\n       into) the old one. -->\n  <Node Name=\"ForEachVariableStatementSyntax\" Base=\"CommonForEachStatementSyntax\">\n    <Kind Name=\"ForEachVariableStatement\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"AwaitKeyword\" Type=\"SyntaxToken\" Optional=\"true\" Override=\"true\">\n      <Kind Name=\"AwaitKeyword\"/>\n    </Field>\n    <Field Name=\"ForEachKeyword\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"ForEachKeyword\"/>\n    </Field>\n    <Field Name=\"OpenParenToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"OpenParenToken\"/>\n    </Field>\n    <Field Name=\"Variable\" Type=\"ExpressionSyntax\">\n      <PropertyComment>\n        <summary>\n           The variable(s) of the loop. In correct code this is a tuple\n           literal, declaration expression with a tuple designator, or\n           a discard syntax in the form of a simple identifier. In broken\n           code it could be something else.\n        </summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"InKeyword\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"InKeyword\"/>\n    </Field>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\" Override=\"true\"/>\n    <Field Name=\"CloseParenToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"CloseParenToken\"/>\n    </Field>\n    <Field Name=\"Statement\" Type=\"StatementSyntax\" Override=\"true\"/>\n  </Node>\n\n  <!--\n  - using (...) { ... }\n  - await using (...) { ... }\n  -->\n  <Node Name=\"UsingStatementSyntax\" Base=\"StatementSyntax\">\n    <Kind Name=\"UsingStatement\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"AwaitKeyword\" Type=\"SyntaxToken\" Optional=\"true\">\n      <Kind Name=\"AwaitKeyword\"/>\n    </Field>\n    <Field Name=\"UsingKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"UsingKeyword\"/>\n    </Field>\n    <Field Name=\"OpenParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenParenToken\"/>\n    </Field>\n    <Choice>\n      <Field Name=\"Declaration\" Type=\"VariableDeclarationSyntax\"/>\n      <Field Name=\"Expression\" Type=\"ExpressionSyntax\"/>\n    </Choice>\n    <Field Name=\"CloseParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseParenToken\"/>\n    </Field>\n    <Field Name=\"Statement\" Type=\"StatementSyntax\"/>\n  </Node>\n\n  <Node Name=\"FixedStatementSyntax\" Base=\"StatementSyntax\">\n    <Kind Name=\"FixedStatement\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"FixedKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"FixedKeyword\"/>\n    </Field>\n    <Field Name=\"OpenParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenParenToken\"/>\n    </Field>\n    <Field Name=\"Declaration\" Type=\"VariableDeclarationSyntax\"/>\n    <Field Name=\"CloseParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseParenToken\"/>\n    </Field>\n    <Field Name=\"Statement\" Type=\"StatementSyntax\"/>\n  </Node>\n  <Node Name=\"CheckedStatementSyntax\" Base=\"StatementSyntax\">\n    <Kind Name=\"CheckedStatement\"/>\n    <Kind Name=\"UncheckedStatement\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"Keyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"CheckedKeyword\"/>\n      <Kind Name=\"UncheckedKeyword\"/>\n    </Field>\n    <Field Name=\"Block\" Type=\"BlockSyntax\"/>\n  </Node>\n  <Node Name=\"UnsafeStatementSyntax\" Base=\"StatementSyntax\">\n    <Kind Name=\"UnsafeStatement\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"UnsafeKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"UnsafeKeyword\"/>\n    </Field>\n    <Field Name=\"Block\" Type=\"BlockSyntax\"/>\n  </Node>\n  <Node Name=\"LockStatementSyntax\" Base=\"StatementSyntax\">\n    <Kind Name=\"LockStatement\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"LockKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"LockKeyword\"/>\n    </Field>\n    <Field Name=\"OpenParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenParenToken\"/>\n    </Field>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\"/>\n    <Field Name=\"CloseParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseParenToken\"/>\n    </Field>\n    <Field Name=\"Statement\" Type=\"StatementSyntax\"/>\n  </Node>\n  <Node Name=\"IfStatementSyntax\" Base=\"StatementSyntax\">\n    <Kind Name=\"IfStatement\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"IfKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"IfKeyword\"/>\n      <PropertyComment>\n        <summary>\n          Gets a SyntaxToken that represents the if keyword.\n        </summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"OpenParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenParenToken\"/>\n      <PropertyComment>\n        <summary>\n          Gets a SyntaxToken that represents the open parenthesis before the if statement's condition expression.\n        </summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Condition\" Type=\"ExpressionSyntax\">\n      <PropertyComment>\n        <summary>\n          Gets an ExpressionSyntax that represents the condition of the if statement.\n        </summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"CloseParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseParenToken\"/>\n      <PropertyComment>\n        <summary>\n          Gets a SyntaxToken that represents the close parenthesis after the if statement's condition expression.\n        </summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Statement\" Type=\"StatementSyntax\">\n      <PropertyComment>\n        <summary>\n          Gets a StatementSyntax the represents the statement to be executed when the condition is true.\n        </summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Else\" Type=\"ElseClauseSyntax\" Optional=\"true\">\n      <PropertyComment>\n        <summary>\n          Gets an ElseClauseSyntax that represents the statement to be executed when the condition is false if such statement exists.\n        </summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>\n        Represents an if statement syntax.\n      </summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates an IfStatementSyntax node</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"ElseClauseSyntax\" Base=\"CSharpSyntaxNode\">\n    <Kind Name=\"ElseClause\"/>\n    <Field Name=\"ElseKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"ElseKeyword\"/>\n      <PropertyComment>\n        <summary>\n          Gets a syntax token\n        </summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Statement\" Type=\"StatementSyntax\"/>\n    <TypeComment>\n      <summary>Represents an else statement syntax.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a ElseClauseSyntax node</summary>\n    </FactoryComment>\n  </Node>\n\n  <Node Name=\"SwitchStatementSyntax\" Base=\"StatementSyntax\" SkipConvenienceFactories=\"true\">\n    <Kind Name=\"SwitchStatement\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"SwitchKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"SwitchKeyword\"/>\n      <PropertyComment>\n        <summary>\n          Gets a SyntaxToken that represents the switch keyword.\n        </summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"OpenParenToken\" Type=\"SyntaxToken\" Optional=\"true\">\n      <Kind Name=\"OpenParenToken\"/>\n      <PropertyComment>\n        <summary>\n          Gets a SyntaxToken that represents the open parenthesis preceding the switch governing expression.\n        </summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\">\n      <PropertyComment>\n        <summary>\n          Gets an ExpressionSyntax representing the expression of the switch statement.\n        </summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"CloseParenToken\" Type=\"SyntaxToken\" Optional=\"true\">\n      <Kind Name=\"CloseParenToken\"/>\n      <PropertyComment>\n        <summary>\n          Gets a SyntaxToken that represents the close parenthesis following the switch governing expression.\n        </summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"OpenBraceToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenBraceToken\"/>\n      <PropertyComment>\n        <summary>\n          Gets a SyntaxToken that represents the open braces preceding the switch sections.\n        </summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Sections\" Type=\"SyntaxList&lt;SwitchSectionSyntax&gt;\">\n      <PropertyComment>\n        <summary>\n          Gets a SyntaxList of SwitchSectionSyntax's that represents the switch sections of the switch statement.\n        </summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"CloseBraceToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseBraceToken\"/>\n      <PropertyComment>\n        <summary>\n          Gets a SyntaxToken that represents the open braces following the switch sections.\n        </summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Represents a switch statement syntax.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a SwitchStatementSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"SwitchSectionSyntax\" Base=\"CSharpSyntaxNode\">\n    <Kind Name=\"SwitchSection\"/>\n    <Field Name=\"Labels\" Type=\"SyntaxList&lt;SwitchLabelSyntax&gt;\" MinCount=\"1\">\n      <PropertyComment>\n        <summary>\n          Gets a SyntaxList of SwitchLabelSyntax's the represents the possible labels that control can transfer to within the section.\n        </summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Statements\" Type=\"SyntaxList&lt;StatementSyntax&gt;\" MinCount=\"1\">\n      <PropertyComment>\n        <summary>\n          Gets a SyntaxList of StatementSyntax's the represents the statements to be executed when control transfer to a label the belongs to the section.\n        </summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Represents a switch section syntax of a switch statement.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a SwitchSectionSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <AbstractNode Name=\"SwitchLabelSyntax\" Base=\"CSharpSyntaxNode\">\n    <Field Name=\"Keyword\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>\n          Gets a SyntaxToken that represents a case or default keyword that belongs to a switch label.\n        </summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"ColonToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"ColonToken\"/>\n      <PropertyComment>\n        <summary>\n          Gets a SyntaxToken that represents the colon that terminates the switch label.\n        </summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>Represents a switch label within a switch statement.</summary>\n    </TypeComment>\n  </AbstractNode>\n  <Node Name=\"CasePatternSwitchLabelSyntax\" Base=\"SwitchLabelSyntax\">\n    <Kind Name=\"CasePatternSwitchLabel\"/>\n    <Field Name=\"Keyword\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"CaseKeyword\"/>\n      <PropertyComment>\n        <summary>Gets the case keyword token.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Pattern\" Type=\"PatternSyntax\">\n      <PropertyComment>\n        <summary>\n          Gets a PatternSyntax that represents the pattern that gets matched for the case label.\n        </summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"WhenClause\" Type=\"WhenClauseSyntax\" Optional=\"true\"/>\n    <Field Name=\"ColonToken\" Type=\"SyntaxToken\" Override=\"true\"/>\n    <TypeComment>\n      <summary>Represents a case label within a switch statement.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a CaseMatchLabelSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"CaseSwitchLabelSyntax\" Base=\"SwitchLabelSyntax\">\n    <Kind Name=\"CaseSwitchLabel\"/>\n    <Field Name=\"Keyword\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"CaseKeyword\"/>\n      <PropertyComment>\n        <summary>Gets the case keyword token.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Value\" Type=\"ExpressionSyntax\">\n      <PropertyComment>\n        <summary>\n          Gets an ExpressionSyntax that represents the constant expression that gets matched for the case label.\n        </summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"ColonToken\" Type=\"SyntaxToken\" Override=\"true\"/>\n    <TypeComment>\n      <summary>Represents a case label within a switch statement.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a CaseSwitchLabelSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"DefaultSwitchLabelSyntax\" Base=\"SwitchLabelSyntax\">\n    <Kind Name=\"DefaultSwitchLabel\"/>\n    <Field Name=\"Keyword\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"DefaultKeyword\"/>\n      <PropertyComment>\n        <summary>Gets the default keyword token.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"ColonToken\" Type=\"SyntaxToken\" Override=\"true\"/>\n    <TypeComment>\n      <summary>Represents a default label within a switch statement.</summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates a DefaultSwitchLabelSyntax node.</summary>\n    </FactoryComment>\n  </Node>\n\n  <Node Name=\"SwitchExpressionSyntax\" Base=\"ExpressionSyntax\">\n    <Kind Name=\"SwitchExpression\"/>\n    <Field Name=\"GoverningExpression\" Type=\"ExpressionSyntax\"/>\n    <Field Name=\"SwitchKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"SwitchKeyword\"/>\n    </Field>\n    <Field Name=\"OpenBraceToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenBraceToken\"/>\n    </Field>\n    <Field Name=\"Arms\" Type=\"SeparatedSyntaxList&lt;SwitchExpressionArmSyntax&gt;\" AllowTrailingSeparator=\"true\"/>\n    <Field Name=\"CloseBraceToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseBraceToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"SwitchExpressionArmSyntax\" Base=\"CSharpSyntaxNode\">\n    <Kind Name=\"SwitchExpressionArm\"/>\n    <Field Name=\"Pattern\" Type=\"PatternSyntax\"/>\n    <Field Name=\"WhenClause\" Type=\"WhenClauseSyntax\" Optional=\"true\"/>\n    <Field Name=\"EqualsGreaterThanToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"EqualsGreaterThanToken\"/>\n    </Field>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\"/>\n  </Node>\n\n  <Node Name=\"TryStatementSyntax\" Base=\"StatementSyntax\">\n    <Kind Name=\"TryStatement\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"TryKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"TryKeyword\"/>\n    </Field>\n    <Field Name=\"Block\" Type=\"BlockSyntax\"/>\n    <Field Name=\"Catches\" Type=\"SyntaxList&lt;CatchClauseSyntax&gt;\"/>\n    <Field Name=\"Finally\" Type=\"FinallyClauseSyntax\" Optional=\"true\"/>\n  </Node>\n  <Node Name=\"CatchClauseSyntax\" Base=\"CSharpSyntaxNode\">\n    <Kind Name=\"CatchClause\"/>\n    <Field Name=\"CatchKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"CatchKeyword\"/>\n    </Field>\n    <Field Name=\"Declaration\" Type=\"CatchDeclarationSyntax\" Optional=\"true\"/>\n    <Field Name=\"Filter\" Type=\"CatchFilterClauseSyntax\" Optional=\"true\"/>\n    <Field Name=\"Block\" Type=\"BlockSyntax\"/>\n  </Node>\n  <Node Name=\"CatchDeclarationSyntax\" Base=\"CSharpSyntaxNode\">\n    <Kind Name=\"CatchDeclaration\"/>\n    <Field Name=\"OpenParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenParenToken\"/>\n    </Field>\n    <Field Name=\"Type\" Type=\"TypeSyntax\"/>\n    <Field Name=\"Identifier\" Type=\"SyntaxToken\" Optional=\"true\">\n      <Kind Name=\"IdentifierToken\"/>\n    </Field>\n    <Field Name=\"CloseParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseParenToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"CatchFilterClauseSyntax\" Base=\"CSharpSyntaxNode\">\n    <Kind Name=\"CatchFilterClause\"/>\n    <Field Name=\"WhenKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"WhenKeyword\"/>\n    </Field>\n    <Field Name=\"OpenParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenParenToken\"/>\n    </Field>\n    <Field Name=\"FilterExpression\" Type=\"ExpressionSyntax\"/>\n    <Field Name=\"CloseParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseParenToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"FinallyClauseSyntax\" Base=\"CSharpSyntaxNode\">\n    <Kind Name=\"FinallyClause\"/>\n    <Field Name=\"FinallyKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"FinallyKeyword\"/>\n    </Field>\n    <Field Name=\"Block\" Type=\"BlockSyntax\"/>\n  </Node>\n\n  <!-- Declarations -->\n  <Node Name=\"CompilationUnitSyntax\" Base=\"CSharpSyntaxNode\">\n    <Kind Name=\"CompilationUnit\"/>\n    <Field Name=\"Externs\" Type=\"SyntaxList&lt;ExternAliasDirectiveSyntax&gt;\"/>\n    <Field Name=\"Usings\" Type=\"SyntaxList&lt;UsingDirectiveSyntax&gt;\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\">\n      <PropertyComment>\n        <summary>Gets the attribute declaration list.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Members\" Type=\"SyntaxList&lt;MemberDeclarationSyntax&gt;\"/>\n    <Field Name=\"EndOfFileToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"EndOfFileToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"ExternAliasDirectiveSyntax\" Base=\"CSharpSyntaxNode\">\n    <Kind Name=\"ExternAliasDirective\"/>\n    <Field Name=\"ExternKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"ExternKeyword\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the extern keyword.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"AliasKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"AliasKeyword\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the alias keyword.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Identifier\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the identifier.</summary>\n      </PropertyComment>\n      <Kind Name=\"IdentifierToken\"/>\n    </Field>\n    <Field Name=\"SemicolonToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"SemicolonToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the semicolon token.</summary>\n      </PropertyComment>\n    </Field>\n    <TypeComment>\n      <summary>\n        Represents an ExternAlias directive syntax, e.g. &quot;extern alias MyAlias;&quot; with specifying &quot;/r:MyAlias=SomeAssembly.dll &quot; on the compiler command line.\n      </summary>\n    </TypeComment>\n    <FactoryComment>\n      <summary>Creates an ExternAliasDirectiveSyntax node</summary>\n    </FactoryComment>\n  </Node>\n  <Node Name=\"UsingDirectiveSyntax\" Base=\"CSharpSyntaxNode\">\n    <Kind Name=\"UsingDirective\"/>\n    <Field Name=\"GlobalKeyword\" Type=\"SyntaxToken\" Optional=\"true\">\n      <Kind Name=\"GlobalKeyword\"/>\n    </Field>\n    <Field Name=\"UsingKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"UsingKeyword\"/>\n    </Field>\n    <Choice Optional=\"true\">\n      <Field Name=\"StaticKeyword\" Type=\"SyntaxToken\">\n        <Kind Name=\"StaticKeyword\"/>\n      </Field>\n      <Sequence>\n        <Field Name=\"UnsafeKeyword\" Type=\"SyntaxToken\" Optional=\"true\">\n          <Kind Name=\"UnsafeKeyword\"/>\n        </Field>\n        <Field Name=\"Alias\" Type=\"NameEqualsSyntax\"/>\n      </Sequence>\n    </Choice>\n    <Field Name=\"NamespaceOrType\" Type=\"TypeSyntax\"/>\n    <Field Name=\"SemicolonToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"SemicolonToken\"/>\n    </Field>\n  </Node>\n  <AbstractNode Name=\"MemberDeclarationSyntax\" Base=\"CSharpSyntaxNode\">\n    <TypeComment>\n      <summary>Member declaration syntax.</summary>\n    </TypeComment>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\">\n      <PropertyComment>\n        <summary>Gets the attribute declaration list.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Modifiers\" Type=\"SyntaxList&lt;SyntaxToken&gt;\">\n      <PropertyComment>\n        <summary>Gets the modifier list.</summary>\n      </PropertyComment>\n    </Field>\n  </AbstractNode>\n  <AbstractNode Name=\"BaseNamespaceDeclarationSyntax\" Base=\"MemberDeclarationSyntax\">\n    <Field Name=\"NamespaceKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"NamespaceKeyword\"/>\n    </Field>\n    <Field Name=\"Name\" Type=\"NameSyntax\"/>\n    <Field Name=\"Externs\" Type=\"SyntaxList&lt;ExternAliasDirectiveSyntax&gt;\"/>\n    <Field Name=\"Usings\" Type=\"SyntaxList&lt;UsingDirectiveSyntax&gt;\"/>\n    <Field Name=\"Members\" Type=\"SyntaxList&lt;MemberDeclarationSyntax&gt;\"/>\n  </AbstractNode>\n  <Node Name=\"NamespaceDeclarationSyntax\" Base=\"BaseNamespaceDeclarationSyntax\">\n    <Kind Name=\"NamespaceDeclaration\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"Modifiers\" Type=\"SyntaxList&lt;SyntaxToken&gt;\" Override=\"true\"/>\n    <Field Name=\"NamespaceKeyword\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"NamespaceKeyword\"/>\n    </Field>\n    <Field Name=\"Name\" Type=\"NameSyntax\" Override=\"true\"/>\n    <Field Name=\"OpenBraceToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenBraceToken\"/>\n    </Field>\n    <Field Name=\"Externs\" Type=\"SyntaxList&lt;ExternAliasDirectiveSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"Usings\" Type=\"SyntaxList&lt;UsingDirectiveSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"Members\" Type=\"SyntaxList&lt;MemberDeclarationSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"CloseBraceToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseBraceToken\"/>\n    </Field>\n    <Field Name=\"SemicolonToken\" Type=\"SyntaxToken\" Optional=\"true\">\n      <PropertyComment>\n        <summary>Gets the optional semicolon token.</summary>\n      </PropertyComment>\n      <Kind Name=\"SemicolonToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"FileScopedNamespaceDeclarationSyntax\" Base=\"BaseNamespaceDeclarationSyntax\">\n    <Kind Name=\"FileScopedNamespaceDeclaration\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"Modifiers\" Type=\"SyntaxList&lt;SyntaxToken&gt;\" Override=\"true\"/>\n    <Field Name=\"NamespaceKeyword\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"NamespaceKeyword\"/>\n    </Field>\n    <Field Name=\"Name\" Type=\"NameSyntax\" Override=\"true\"/>\n    <Field Name=\"SemicolonToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"SemicolonToken\"/>\n    </Field>\n    <Field Name=\"Externs\" Type=\"SyntaxList&lt;ExternAliasDirectiveSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"Usings\" Type=\"SyntaxList&lt;UsingDirectiveSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"Members\" Type=\"SyntaxList&lt;MemberDeclarationSyntax&gt;\" Override=\"true\"/>\n  </Node>\n  <Node Name=\"AttributeListSyntax\" Base=\"CSharpSyntaxNode\">\n    <TypeComment>\n      <summary>Class representing one or more attributes applied to a language construct.</summary>\n    </TypeComment>\n    <Kind Name=\"AttributeList\"/>\n    <Field Name=\"OpenBracketToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenBracketToken\"/>\n      <PropertyComment>\n        <summary>Gets the open bracket token.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Target\" Type=\"AttributeTargetSpecifierSyntax\" Optional=\"true\">\n      <PropertyComment>\n        <summary>Gets the optional construct targeted by the attribute.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Attributes\" Type=\"SeparatedSyntaxList&lt;AttributeSyntax&gt;\" MinCount=\"1\">\n      <PropertyComment>\n        <summary>Gets the attribute declaration list.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"CloseBracketToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseBracketToken\"/>\n      <PropertyComment>\n        <summary>Gets the close bracket token.</summary>\n      </PropertyComment>\n    </Field>\n  </Node>\n  <Node Name=\"AttributeTargetSpecifierSyntax\" Base=\"CSharpSyntaxNode\">\n    <TypeComment>\n      <summary>Class representing what language construct an attribute targets.</summary>\n    </TypeComment>\n    <Kind Name=\"AttributeTargetSpecifier\"/>\n    <Field Name=\"Identifier\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the identifier.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"ColonToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"ColonToken\"/>\n      <PropertyComment>\n        <summary>Gets the colon token.</summary>\n      </PropertyComment>\n    </Field>\n  </Node>\n  <Node Name=\"AttributeSyntax\" Base=\"CSharpSyntaxNode\">\n    <TypeComment>\n      <summary>Attribute syntax.</summary>\n    </TypeComment>\n    <Kind Name=\"Attribute\"/>\n    <Field Name=\"Name\" Type=\"NameSyntax\">\n      <PropertyComment>\n        <summary>Gets the name.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"ArgumentList\" Type=\"AttributeArgumentListSyntax\" Optional=\"true\"/>\n  </Node>\n  <Node Name=\"AttributeArgumentListSyntax\" Base=\"CSharpSyntaxNode\">\n    <TypeComment>\n      <summary>Attribute argument list syntax.</summary>\n    </TypeComment>\n    <Kind Name=\"AttributeArgumentList\"/>\n    <Field Name=\"OpenParenToken\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the open paren token.</summary>\n      </PropertyComment>\n      <Kind Name=\"OpenParenToken\"/>\n    </Field>\n    <Field Name=\"Arguments\" Type=\"SeparatedSyntaxList&lt;AttributeArgumentSyntax&gt;\">\n      <PropertyComment>\n        <summary>Gets the arguments syntax list.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"CloseParenToken\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the close paren token.</summary>\n      </PropertyComment>\n      <Kind Name=\"CloseParenToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"AttributeArgumentSyntax\" Base=\"CSharpSyntaxNode\">\n    <TypeComment>\n      <summary>Attribute argument syntax.</summary>\n    </TypeComment>\n    <Kind Name=\"AttributeArgument\"/>\n    <Choice>\n      <Field Name=\"NameEquals\" Type=\"NameEqualsSyntax\" Optional=\"true\"/>\n      <Field Name=\"NameColon\" Type=\"NameColonSyntax\" Optional=\"true\"/>\n    </Choice>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\">\n      <PropertyComment>\n        <summary>Gets the expression.</summary>\n      </PropertyComment>\n    </Field>\n  </Node>\n  <Node Name=\"NameEqualsSyntax\" Base=\"CSharpSyntaxNode\">\n    <TypeComment>\n      <summary>Class representing an identifier name followed by an equals token.</summary>\n    </TypeComment>\n    <Kind Name=\"NameEquals\"/>\n    <Field Name=\"Name\" Type=\"IdentifierNameSyntax\">\n      <PropertyComment>\n        <summary>Gets the identifier name.</summary>\n      </PropertyComment>\n      <Kind Name=\"IdentifierName\"/>\n    </Field>\n    <Field Name=\"EqualsToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"EqualsToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"TypeParameterListSyntax\" Base=\"CSharpSyntaxNode\">\n    <TypeComment>\n      <summary>Type parameter list syntax.</summary>\n    </TypeComment>\n    <Kind Name=\"TypeParameterList\"/>\n    <Field Name=\"LessThanToken\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the &lt; token.</summary>\n      </PropertyComment>\n      <Kind Name=\"LessThanToken\"/>\n    </Field>\n    <Field Name=\"Parameters\" Type=\"SeparatedSyntaxList&lt;TypeParameterSyntax&gt;\" MinCount=\"1\">\n      <PropertyComment>\n        <summary>Gets the parameter list.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"GreaterThanToken\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the &gt; token.</summary>\n      </PropertyComment>\n      <Kind Name=\"GreaterThanToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"TypeParameterSyntax\" Base=\"CSharpSyntaxNode\">\n    <TypeComment>\n      <summary>Type parameter syntax.</summary>\n    </TypeComment>\n    <Kind Name=\"TypeParameter\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\">\n      <PropertyComment>\n        <summary>Gets the attribute declaration list.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"VarianceKeyword\" Type=\"SyntaxToken\" Optional=\"true\">\n      <Kind Name=\"InKeyword\"/>\n      <Kind Name=\"OutKeyword\"/>\n    </Field>\n    <Field Name=\"Identifier\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the identifier.</summary>\n      </PropertyComment>\n      <Kind Name=\"IdentifierToken\"/>\n    </Field>\n  </Node>\n  <AbstractNode Name=\"BaseTypeDeclarationSyntax\" Base=\"MemberDeclarationSyntax\">\n    <TypeComment>\n      <summary>Base class for type declaration syntax.</summary>\n    </TypeComment>\n    <Field Name=\"Identifier\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the identifier.</summary>\n      </PropertyComment>\n      <Kind Name=\"IdentifierToken\"/>\n    </Field>\n    <Field Name=\"BaseList\" Type=\"BaseListSyntax\" Optional=\"true\">\n      <PropertyComment>\n        <summary>Gets the base type list.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"OpenBraceToken\" Type=\"SyntaxToken\" Optional=\"true\">\n      <PropertyComment>\n        <summary>Gets the open brace token.</summary>\n      </PropertyComment>\n      <Kind Name=\"OpenBraceToken\"/>\n    </Field>\n    <Field Name=\"CloseBraceToken\" Type=\"SyntaxToken\" Optional=\"true\">\n      <PropertyComment>\n        <summary>Gets the close brace token.</summary>\n      </PropertyComment>\n      <Kind Name=\"CloseBraceToken\"/>\n    </Field>\n    <Field Name=\"SemicolonToken\" Type=\"SyntaxToken\" Optional=\"true\">\n      <PropertyComment>\n        <summary>Gets the optional semicolon token.</summary>\n      </PropertyComment>\n      <Kind Name=\"SemicolonToken\"/>\n    </Field>\n  </AbstractNode>\n  <AbstractNode Name=\"TypeDeclarationSyntax\" Base=\"BaseTypeDeclarationSyntax\">\n    <TypeComment>\n      <summary>Base class for type declaration syntax (class, struct, interface, record).</summary>\n    </TypeComment>\n    <Field Name=\"Keyword\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the type keyword token (\"class\", \"struct\", \"interface\", \"record\").</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"TypeParameterList\" Type=\"TypeParameterListSyntax\" Optional=\"true\"/>\n    <Field Name=\"ParameterList\" Type=\"ParameterListSyntax\" Optional=\"true\"/>\n    <Field Name=\"ConstraintClauses\" Type=\"SyntaxList&lt;TypeParameterConstraintClauseSyntax&gt;\">\n      <PropertyComment>\n        <summary>Gets the type constraint list.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Members\" Type=\"SyntaxList&lt;MemberDeclarationSyntax&gt;\">\n      <PropertyComment>\n        <summary>Gets the member declarations.</summary>\n      </PropertyComment>\n    </Field>\n  </AbstractNode>\n  <Node Name=\"ClassDeclarationSyntax\" Base=\"TypeDeclarationSyntax\" SkipConvenienceFactories=\"true\">\n    <TypeComment>\n      <summary>Class type declaration syntax.</summary>\n    </TypeComment>\n    <Kind Name=\"ClassDeclaration\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"Modifiers\" Type=\"SyntaxList&lt;SyntaxToken&gt;\" Override=\"true\"/>\n    <Field Name=\"Keyword\" Type=\"SyntaxToken\" Override=\"true\">\n      <PropertyComment>\n        <summary>Gets the class keyword token.</summary>\n      </PropertyComment>\n      <Kind Name=\"ClassKeyword\"/>\n    </Field>\n    <Field Name=\"Identifier\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"IdentifierToken\"/>\n    </Field>\n    <Field Name=\"TypeParameterList\" Type=\"TypeParameterListSyntax\" Optional=\"true\" Override=\"true\"/>\n    <Field Name=\"ParameterList\" Type=\"ParameterListSyntax\" Optional=\"true\" Override=\"true\" />\n    <Field Name=\"BaseList\" Type=\"BaseListSyntax\" Optional=\"true\" Override=\"true\"/>\n    <Field Name=\"ConstraintClauses\" Type=\"SyntaxList&lt;TypeParameterConstraintClauseSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"OpenBraceToken\" Type=\"SyntaxToken\" Override=\"true\" Optional=\"true\">\n      <Kind Name=\"OpenBraceToken\"/>\n    </Field>\n    <Field Name=\"Members\" Type=\"SyntaxList&lt;MemberDeclarationSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"CloseBraceToken\" Type=\"SyntaxToken\" Override=\"true\" Optional=\"true\">\n      <Kind Name=\"CloseBraceToken\"/>\n    </Field>\n    <Field Name=\"SemicolonToken\" Type=\"SyntaxToken\" Optional=\"true\" Override=\"true\">\n      <Kind Name=\"SemicolonToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"StructDeclarationSyntax\" Base=\"TypeDeclarationSyntax\" SkipConvenienceFactories=\"true\">\n    <TypeComment>\n      <summary>Struct type declaration syntax.</summary>\n    </TypeComment>\n    <Kind Name=\"StructDeclaration\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"Modifiers\" Type=\"SyntaxList&lt;SyntaxToken&gt;\" Override=\"true\"/>\n    <Field Name=\"Keyword\" Type=\"SyntaxToken\" Override=\"true\">\n      <PropertyComment>\n        <summary>Gets the struct keyword token.</summary>\n      </PropertyComment>\n      <Kind Name=\"StructKeyword\"/>\n    </Field>\n    <Field Name=\"Identifier\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"IdentifierToken\"/>\n    </Field>\n    <Field Name=\"TypeParameterList\" Type=\"TypeParameterListSyntax\" Optional=\"true\" Override=\"true\"/>\n    <Field Name=\"ParameterList\" Type=\"ParameterListSyntax\" Optional=\"true\" Override=\"true\" />\n    <Field Name=\"BaseList\" Type=\"BaseListSyntax\" Optional=\"true\" Override=\"true\"/>\n    <Field Name=\"ConstraintClauses\" Type=\"SyntaxList&lt;TypeParameterConstraintClauseSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"OpenBraceToken\" Type=\"SyntaxToken\" Override=\"true\" Optional=\"true\">\n      <Kind Name=\"OpenBraceToken\"/>\n    </Field>\n    <Field Name=\"Members\" Type=\"SyntaxList&lt;MemberDeclarationSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"CloseBraceToken\" Type=\"SyntaxToken\" Override=\"true\" Optional=\"true\">\n      <Kind Name=\"CloseBraceToken\"/>\n    </Field>\n    <Field Name=\"SemicolonToken\" Type=\"SyntaxToken\" Optional=\"true\" Override=\"true\">\n      <Kind Name=\"SemicolonToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"InterfaceDeclarationSyntax\" Base=\"TypeDeclarationSyntax\" SkipConvenienceFactories=\"true\">\n    <TypeComment>\n      <summary>Interface type declaration syntax.</summary>\n    </TypeComment>\n    <Kind Name=\"InterfaceDeclaration\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"Modifiers\" Type=\"SyntaxList&lt;SyntaxToken&gt;\" Override=\"true\"/>\n    <Field Name=\"Keyword\" Type=\"SyntaxToken\" Override=\"true\">\n      <PropertyComment>\n        <summary>Gets the interface keyword token.</summary>\n      </PropertyComment>\n      <Kind Name=\"InterfaceKeyword\"/>\n    </Field>\n    <Field Name=\"Identifier\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"IdentifierToken\"/>\n    </Field>\n    <Field Name=\"TypeParameterList\" Type=\"TypeParameterListSyntax\" Optional=\"true\" Override=\"true\"/>\n    <Field Name=\"ParameterList\" Type=\"ParameterListSyntax\" Optional=\"true\" Override=\"true\" />\n    <Field Name=\"BaseList\" Type=\"BaseListSyntax\" Optional=\"true\" Override=\"true\"/>\n    <Field Name=\"ConstraintClauses\" Type=\"SyntaxList&lt;TypeParameterConstraintClauseSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"OpenBraceToken\" Type=\"SyntaxToken\" Override=\"true\" Optional=\"true\">\n      <Kind Name=\"OpenBraceToken\"/>\n    </Field>\n    <Field Name=\"Members\" Type=\"SyntaxList&lt;MemberDeclarationSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"CloseBraceToken\" Type=\"SyntaxToken\" Override=\"true\" Optional=\"true\">\n      <Kind Name=\"CloseBraceToken\"/>\n    </Field>\n    <Field Name=\"SemicolonToken\" Type=\"SyntaxToken\" Optional=\"true\" Override=\"true\">\n      <Kind Name=\"SemicolonToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"RecordDeclarationSyntax\" Base=\"TypeDeclarationSyntax\">\n    <Kind Name=\"RecordDeclaration\" />\n    <Kind Name=\"RecordStructDeclaration\" />\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"Modifiers\" Type=\"SyntaxList&lt;SyntaxToken&gt;\" Override=\"true\"/>\n    <Field Name=\"Keyword\" Type=\"SyntaxToken\" Override=\"true\">\n      <ContextualKind Name=\"RecordKeyword\"/>\n    </Field>\n    <Field Name=\"ClassOrStructKeyword\" Type=\"SyntaxToken\" Optional=\"true\">\n      <Kind Name=\"ClassKeyword\"/>\n      <Kind Name=\"StructKeyword\"/>\n    </Field>\n    <Field Name=\"Identifier\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"IdentifierToken\"/>\n    </Field>\n    <Field Name=\"TypeParameterList\" Type=\"TypeParameterListSyntax\" Optional=\"true\" Override=\"true\"/>\n    <Field Name=\"ParameterList\" Type=\"ParameterListSyntax\" Optional=\"true\" Override=\"true\" />\n    <Field Name=\"BaseList\" Type=\"BaseListSyntax\" Optional=\"true\" Override=\"true\"/>\n    <Field Name=\"ConstraintClauses\" Type=\"SyntaxList&lt;TypeParameterConstraintClauseSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"OpenBraceToken\" Type=\"SyntaxToken\" Override=\"true\" Optional=\"true\">\n      <Kind Name=\"OpenBraceToken\"/>\n    </Field>\n    <Field Name=\"Members\" Type=\"SyntaxList&lt;MemberDeclarationSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"CloseBraceToken\" Type=\"SyntaxToken\" Override=\"true\" Optional=\"true\">\n      <Kind Name=\"CloseBraceToken\"/>\n    </Field>\n    <Field Name=\"SemicolonToken\" Type=\"SyntaxToken\" Optional=\"true\" Override=\"true\">\n      <Kind Name=\"SemicolonToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"EnumDeclarationSyntax\" Base=\"BaseTypeDeclarationSyntax\" SkipConvenienceFactories=\"true\">\n    <TypeComment>\n      <summary>Enum type declaration syntax.</summary>\n    </TypeComment>\n    <Kind Name=\"EnumDeclaration\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"Modifiers\" Type=\"SyntaxList&lt;SyntaxToken&gt;\" Override=\"true\"/>\n    <Field Name=\"EnumKeyword\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the enum keyword token.</summary>\n      </PropertyComment>\n      <Kind Name=\"EnumKeyword\"/>\n    </Field>\n    <Field Name=\"Identifier\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"IdentifierToken\"/>\n    </Field>\n    <Field Name=\"BaseList\" Type=\"BaseListSyntax\" Optional=\"true\" Override=\"true\">\n    </Field>\n    <Field Name=\"OpenBraceToken\" Type=\"SyntaxToken\" Override=\"true\" Optional=\"true\">\n      <Kind Name=\"OpenBraceToken\"/>\n    </Field>\n    <Field Name=\"Members\" Type=\"SeparatedSyntaxList&lt;EnumMemberDeclarationSyntax&gt;\" AllowTrailingSeparator=\"true\">\n      <PropertyComment>\n        <summary>Gets the members declaration list.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"CloseBraceToken\" Type=\"SyntaxToken\" Override=\"true\" Optional=\"true\">\n      <Kind Name=\"CloseBraceToken\"/>\n    </Field>\n    <Field Name=\"SemicolonToken\" Type=\"SyntaxToken\" Optional=\"true\" Override=\"true\">\n      <PropertyComment>\n        <summary>Gets the optional semicolon token.</summary>\n      </PropertyComment>\n      <Kind Name=\"SemicolonToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"DelegateDeclarationSyntax\" Base=\"MemberDeclarationSyntax\">\n    <TypeComment>\n      <summary>Delegate declaration syntax.</summary>\n    </TypeComment>\n    <Kind Name=\"DelegateDeclaration\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"Modifiers\" Type=\"SyntaxList&lt;SyntaxToken&gt;\" Override=\"true\"/>\n    <Field Name=\"DelegateKeyword\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the \"delegate\" keyword.</summary>\n      </PropertyComment>\n      <Kind Name=\"DelegateKeyword\"/>\n    </Field>\n    <Field Name=\"ReturnType\" Type=\"TypeSyntax\">\n      <PropertyComment>\n        <summary>Gets the return type.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Identifier\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the identifier.</summary>\n      </PropertyComment>\n      <Kind Name=\"IdentifierToken\"/>\n    </Field>\n    <Field Name=\"TypeParameterList\" Type=\"TypeParameterListSyntax\" Optional=\"true\"/>\n    <Field Name=\"ParameterList\" Type=\"ParameterListSyntax\">\n      <PropertyComment>\n        <summary>Gets the parameter list.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"ConstraintClauses\" Type=\"SyntaxList&lt;TypeParameterConstraintClauseSyntax&gt;\">\n      <PropertyComment>\n        <summary>Gets the constraint clause list.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"SemicolonToken\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the semicolon token.</summary>\n      </PropertyComment>\n      <Kind Name=\"SemicolonToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"EnumMemberDeclarationSyntax\" Base=\"MemberDeclarationSyntax\">\n    <Kind Name=\"EnumMemberDeclaration\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"Modifiers\" Type=\"SyntaxList&lt;SyntaxToken&gt;\" Override=\"true\"/>\n    <Field Name=\"Identifier\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the identifier.</summary>\n      </PropertyComment>\n      <Kind Name=\"IdentifierToken\"/>\n    </Field>\n    <Field Name=\"EqualsValue\" Type=\"EqualsValueClauseSyntax\" Optional=\"true\"/>\n  </Node>\n  <Node Name=\"BaseListSyntax\" Base=\"CSharpSyntaxNode\">\n    <TypeComment>\n      <summary>Base list syntax.</summary>\n    </TypeComment>\n    <Kind Name=\"BaseList\"/>\n    <Field Name=\"ColonToken\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the colon token.</summary>\n      </PropertyComment>\n      <Kind Name=\"ColonToken\"/>\n    </Field>\n    <Field Name=\"Types\" Type=\"SeparatedSyntaxList&lt;BaseTypeSyntax&gt;\" MinCount=\"1\">\n      <PropertyComment>\n        <summary>Gets the base type references.</summary>\n      </PropertyComment>\n    </Field>\n  </Node>\n\n  <AbstractNode Name=\"BaseTypeSyntax\" Base=\"CSharpSyntaxNode\">\n    <TypeComment>\n      <summary>Provides the base class from which the classes that represent base type syntax nodes are derived. This is an abstract class.</summary>\n    </TypeComment>\n    <Field Name=\"Type\" Type=\"TypeSyntax\">\n    </Field>\n  </AbstractNode>\n\n  <Node Name=\"SimpleBaseTypeSyntax\" Base=\"BaseTypeSyntax\">\n    <Kind Name=\"SimpleBaseType\"/>\n    <Field Name=\"Type\" Type=\"TypeSyntax\" Override=\"true\">\n    </Field>\n  </Node>\n\n  <Node Name=\"PrimaryConstructorBaseTypeSyntax\" Base=\"BaseTypeSyntax\">\n    <Kind Name=\"PrimaryConstructorBaseType\"/>\n    <Field Name=\"Type\" Type=\"TypeSyntax\" Override=\"true\"/>\n    <Field Name=\"ArgumentList\" Type=\"ArgumentListSyntax\"/>\n  </Node>\n  \n  <Node Name=\"TypeParameterConstraintClauseSyntax\" Base=\"CSharpSyntaxNode\">\n    <TypeComment>\n      <summary>Type parameter constraint clause.</summary>\n    </TypeComment>\n    <Kind Name=\"TypeParameterConstraintClause\"/>\n    <Field Name=\"WhereKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"WhereKeyword\"/>\n    </Field>\n    <Field Name=\"Name\" Type=\"IdentifierNameSyntax\">\n      <PropertyComment>\n        <summary>Gets the identifier.</summary>\n      </PropertyComment>\n      <Kind Name=\"IdentifierName\"/>\n    </Field>\n    <Field Name=\"ColonToken\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the colon token.</summary>\n      </PropertyComment>\n      <Kind Name=\"ColonToken\"/>\n    </Field>\n    <Field Name=\"Constraints\" Type=\"SeparatedSyntaxList&lt;TypeParameterConstraintSyntax&gt;\" MinCount=\"1\">\n      <PropertyComment>\n        <summary>Gets the constraints list.</summary>\n      </PropertyComment>\n    </Field>\n  </Node>\n  <AbstractNode Name=\"TypeParameterConstraintSyntax\" Base=\"CSharpSyntaxNode\">\n    <TypeComment>\n      <summary>Base type for type parameter constraint syntax.</summary>\n    </TypeComment>\n  </AbstractNode>\n  <Node Name=\"ConstructorConstraintSyntax\" Base=\"TypeParameterConstraintSyntax\">\n    <TypeComment>\n      <summary>Constructor constraint syntax.</summary>\n    </TypeComment>\n    <Kind Name=\"ConstructorConstraint\"/>\n    <Field Name=\"NewKeyword\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the \"new\" keyword.</summary>\n      </PropertyComment>\n      <Kind Name=\"NewKeyword\"/>\n    </Field>\n    <Field Name=\"OpenParenToken\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the open paren keyword.</summary>\n      </PropertyComment>\n      <Kind Name=\"OpenParenToken\"/>\n    </Field>\n    <Field Name=\"CloseParenToken\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the close paren keyword.</summary>\n      </PropertyComment>\n      <Kind Name=\"CloseParenToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"ClassOrStructConstraintSyntax\" Base=\"TypeParameterConstraintSyntax\">\n    <TypeComment>\n      <summary>Class or struct constraint syntax.</summary>\n    </TypeComment>\n    <Kind Name=\"ClassConstraint\"/>\n    <Kind Name=\"StructConstraint\"/>\n    <Field Name=\"ClassOrStructKeyword\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the constraint keyword (\"class\" or \"struct\").</summary>\n      </PropertyComment>\n      <Kind Name=\"ClassKeyword\"/>\n      <Kind Name=\"StructKeyword\"/>\n    </Field>\n    <Field Name=\"QuestionToken\" Type=\"SyntaxToken\" Optional=\"true\">\n      <Kind Name=\"QuestionToken\"/>\n      <PropertyComment>\n        <summary>SyntaxToken representing the question mark.</summary>\n      </PropertyComment>\n    </Field>\n  </Node>\n  <Node Name=\"TypeConstraintSyntax\" Base=\"TypeParameterConstraintSyntax\">\n    <TypeComment>\n      <summary>Type constraint syntax.</summary>\n    </TypeComment>\n    <Kind Name=\"TypeConstraint\"/>\n    <Field Name=\"Type\" Type=\"TypeSyntax\">\n      <PropertyComment>\n        <summary>Gets the type syntax.</summary>\n      </PropertyComment>\n    </Field>\n  </Node>\n  <Node Name=\"DefaultConstraintSyntax\" Base=\"TypeParameterConstraintSyntax\">\n    <TypeComment>\n      <summary>Default constraint syntax.</summary>\n    </TypeComment>\n    <Kind Name=\"DefaultConstraint\"/>\n    <Field Name=\"DefaultKeyword\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the \"default\" keyword.</summary>\n      </PropertyComment>\n      <Kind Name=\"DefaultKeyword\"/>\n    </Field>\n  </Node>\n\n  <Node Name=\"AllowsConstraintClauseSyntax\" Base=\"TypeParameterConstraintSyntax\">\n    <TypeComment>\n      <summary>The allows type parameter constraint clause.</summary>\n    </TypeComment>\n    <Kind Name=\"AllowsConstraintClause\"/>\n    <Field Name=\"AllowsKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"AllowsKeyword\"/>\n    </Field>\n    <Field Name=\"Constraints\" Type=\"SeparatedSyntaxList&lt;AllowsConstraintSyntax&gt;\" MinCount=\"1\">\n      <PropertyComment>\n        <summary>Gets the constraints list.</summary>\n      </PropertyComment>\n    </Field>\n  </Node>\n\n  <AbstractNode Name=\"AllowsConstraintSyntax\" Base=\"CSharpSyntaxNode\">\n    <TypeComment>\n      <summary>Base type for allow constraint syntax.</summary>\n    </TypeComment>\n  </AbstractNode>\n\n  <Node Name=\"RefStructConstraintSyntax\" Base=\"AllowsConstraintSyntax\">\n    <TypeComment>\n      <summary>Ref struct constraint syntax.</summary>\n    </TypeComment>\n    <Kind Name=\"RefStructConstraint\"/>\n    <Field Name=\"RefKeyword\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the \"ref\" keyword.</summary>\n      </PropertyComment>\n      <Kind Name=\"RefKeyword\"/>\n    </Field>\n    <Field Name=\"StructKeyword\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the \"struct\" keyword.</summary>\n      </PropertyComment>\n      <Kind Name=\"StructKeyword\"/>\n    </Field>\n  </Node>\n\n  <AbstractNode Name=\"BaseFieldDeclarationSyntax\" Base=\"MemberDeclarationSyntax\">\n    <Field Name=\"Declaration\" Type=\"VariableDeclarationSyntax\"/>\n    <Field Name=\"SemicolonToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"SemicolonToken\"/>\n    </Field>\n  </AbstractNode>\n  <Node Name=\"FieldDeclarationSyntax\" Base=\"BaseFieldDeclarationSyntax\">\n    <Kind Name=\"FieldDeclaration\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"Modifiers\" Type=\"SyntaxList&lt;SyntaxToken&gt;\" Override=\"true\"/>\n    <Field Name=\"Declaration\" Type=\"VariableDeclarationSyntax\" Override=\"true\"/>\n    <Field Name=\"SemicolonToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"SemicolonToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"EventFieldDeclarationSyntax\" Base=\"BaseFieldDeclarationSyntax\">\n    <Kind Name=\"EventFieldDeclaration\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"Modifiers\" Type=\"SyntaxList&lt;SyntaxToken&gt;\" Override=\"true\"/>\n    <Field Name=\"EventKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"EventKeyword\"/>\n    </Field>\n    <Field Name=\"Declaration\" Type=\"VariableDeclarationSyntax\" Override=\"true\"/>\n    <Field Name=\"SemicolonToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"SemicolonToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"ExplicitInterfaceSpecifierSyntax\" Base=\"CSharpSyntaxNode\">\n    <Kind Name=\"ExplicitInterfaceSpecifier\"/>\n    <Field Name=\"Name\" Type=\"NameSyntax\"/>\n    <Field Name=\"DotToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"DotToken\"/>\n    </Field>\n  </Node>\n  <AbstractNode Name=\"BaseMethodDeclarationSyntax\" Base=\"MemberDeclarationSyntax\">\n    <TypeComment>\n      <summary>Base type for method declaration syntax.</summary>\n    </TypeComment>\n    <Field Name=\"ParameterList\" Type=\"ParameterListSyntax\">\n      <PropertyComment>\n        <summary>Gets the parameter list.</summary>\n      </PropertyComment>\n    </Field>\n    <Choice>\n      <Field Name=\"Body\" Type=\"BlockSyntax\"/>\n      <Sequence>\n        <Field Name=\"ExpressionBody\" Type=\"ArrowExpressionClauseSyntax\"/>\n        <Field Name=\"SemicolonToken\" Type=\"SyntaxToken\">\n          <PropertyComment>\n            <summary>Gets the optional semicolon token.</summary>\n          </PropertyComment>\n          <Kind Name=\"SemicolonToken\"/>\n        </Field>\n      </Sequence>\n    </Choice>\n  </AbstractNode>\n  <Node Name=\"MethodDeclarationSyntax\" Base=\"BaseMethodDeclarationSyntax\">\n    <TypeComment>\n      <summary>Method declaration syntax.</summary>\n    </TypeComment>\n    <Kind Name=\"MethodDeclaration\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"Modifiers\" Type=\"SyntaxList&lt;SyntaxToken&gt;\" Override=\"true\"/>\n    <Field Name=\"ReturnType\" Type=\"TypeSyntax\">\n      <PropertyComment>\n        <summary>Gets the return type syntax.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"ExplicitInterfaceSpecifier\" Type=\"ExplicitInterfaceSpecifierSyntax\" Optional=\"true\"/>\n    <Field Name=\"Identifier\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the identifier.</summary>\n      </PropertyComment>\n      <Kind Name=\"IdentifierToken\"/>\n    </Field>\n    <Field Name=\"TypeParameterList\" Type=\"TypeParameterListSyntax\" Optional=\"true\"/>\n    <Field Name=\"ParameterList\" Type=\"ParameterListSyntax\" Override=\"true\"/>\n    <Field Name=\"ConstraintClauses\" Type=\"SyntaxList&lt;TypeParameterConstraintClauseSyntax&gt;\">\n      <PropertyComment>\n        <summary>Gets the constraint clause list.</summary>\n      </PropertyComment>\n    </Field>\n    <Choice>\n      <Field Name=\"Body\" Type=\"BlockSyntax\" Override=\"true\"/>\n      <Sequence>\n        <Field Name=\"ExpressionBody\" Type=\"ArrowExpressionClauseSyntax\" Override=\"true\"/>\n        <Field Name=\"SemicolonToken\" Type=\"SyntaxToken\" Override=\"true\">\n          <PropertyComment>\n            <summary>Gets the optional semicolon token.</summary>\n          </PropertyComment>\n          <Kind Name=\"SemicolonToken\"/>\n        </Field>\n      </Sequence>\n    </Choice>\n  </Node>\n  <Node Name=\"OperatorDeclarationSyntax\" Base=\"BaseMethodDeclarationSyntax\">\n    <!-- should be multiple kinds? -->\n    <TypeComment>\n      <summary>Operator declaration syntax.</summary>\n    </TypeComment>\n    <Kind Name=\"OperatorDeclaration\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"Modifiers\" Type=\"SyntaxList&lt;SyntaxToken&gt;\" Override=\"true\"/>\n    <Field Name=\"ReturnType\" Type=\"TypeSyntax\">\n      <PropertyComment>\n        <summary>Gets the return type.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"ExplicitInterfaceSpecifier\" Type=\"ExplicitInterfaceSpecifierSyntax\" Optional=\"true\"/>\n    <Field Name=\"OperatorKeyword\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the \"operator\" keyword.</summary>\n      </PropertyComment>\n      <Kind Name=\"OperatorKeyword\"/>\n    </Field>\n    <Field Name=\"CheckedKeyword\" Type=\"SyntaxToken\" Optional=\"true\">\n      <PropertyComment>\n        <summary>Gets the \"checked\" keyword.</summary>\n      </PropertyComment>\n      <Kind Name=\"CheckedKeyword\"/>\n    </Field>\n    <Field Name=\"OperatorToken\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the operator token.</summary>\n      </PropertyComment>\n      <Kind Name=\"PlusToken\"/>\n      <Kind Name=\"MinusToken\"/>\n      <Kind Name=\"ExclamationToken\"/>\n      <Kind Name=\"TildeToken\"/>\n      <Kind Name=\"PlusPlusToken\"/>\n      <Kind Name=\"MinusMinusToken\"/>\n      <Kind Name=\"AsteriskToken\"/>\n      <Kind Name=\"SlashToken\"/>\n      <Kind Name=\"PercentToken\"/>\n      <Kind Name=\"LessThanLessThanToken\"/>\n      <Kind Name=\"GreaterThanGreaterThanToken\"/>\n      <Kind Name=\"GreaterThanGreaterThanGreaterThanToken\"/>\n      <Kind Name=\"BarToken\"/>\n      <Kind Name=\"AmpersandToken\"/>\n      <Kind Name=\"CaretToken\"/>\n      <Kind Name=\"EqualsEqualsToken\"/>\n      <Kind Name=\"ExclamationEqualsToken\"/>\n      <Kind Name=\"LessThanToken\"/>\n      <Kind Name=\"LessThanEqualsToken\"/>\n      <Kind Name=\"GreaterThanToken\"/>\n      <Kind Name=\"GreaterThanEqualsToken\"/>\n      <Kind Name=\"FalseKeyword\"/>\n      <Kind Name=\"TrueKeyword\"/>\n      <Kind Name=\"IsKeyword\"/>\n    </Field>\n    <Field Name=\"ParameterList\" Type=\"ParameterListSyntax\" Override=\"true\"/>\n    <Choice>\n      <Field Name=\"Body\" Type=\"BlockSyntax\" Override=\"true\"/>\n      <Sequence>\n        <Field Name=\"ExpressionBody\" Type=\"ArrowExpressionClauseSyntax\" Override=\"true\"/>\n        <Field Name=\"SemicolonToken\" Type=\"SyntaxToken\" Override=\"true\">\n          <PropertyComment>\n            <summary>Gets the optional semicolon token.</summary>\n          </PropertyComment>\n          <Kind Name=\"SemicolonToken\"/>\n        </Field>\n      </Sequence>\n    </Choice>\n  </Node>\n  <Node Name=\"ConversionOperatorDeclarationSyntax\" Base=\"BaseMethodDeclarationSyntax\">\n    <!-- should be split into two kinds-->\n    <TypeComment>\n      <summary>Conversion operator declaration syntax.</summary>\n    </TypeComment>\n    <Kind Name=\"ConversionOperatorDeclaration\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"Modifiers\" Type=\"SyntaxList&lt;SyntaxToken&gt;\" Override=\"true\"/>\n    <Field Name=\"ImplicitOrExplicitKeyword\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the \"implicit\" or \"explicit\" token.</summary>\n      </PropertyComment>\n      <Kind Name=\"ImplicitKeyword\"/>\n      <Kind Name=\"ExplicitKeyword\"/>\n    </Field>\n    <Field Name=\"ExplicitInterfaceSpecifier\" Type=\"ExplicitInterfaceSpecifierSyntax\" Optional=\"true\"/>\n    <Field Name=\"OperatorKeyword\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the \"operator\" token.</summary>\n      </PropertyComment>\n      <Kind Name=\"OperatorKeyword\"/>\n    </Field>\n    <Field Name=\"CheckedKeyword\" Type=\"SyntaxToken\" Optional=\"true\">\n      <PropertyComment>\n        <summary>Gets the \"checked\" keyword.</summary>\n      </PropertyComment>\n      <Kind Name=\"CheckedKeyword\"/>\n    </Field>\n    <Field Name=\"Type\" Type=\"TypeSyntax\">\n      <PropertyComment>\n        <summary>Gets the type.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"ParameterList\" Type=\"ParameterListSyntax\" Override=\"true\"/>\n    <Choice>\n      <Field Name=\"Body\" Type=\"BlockSyntax\" Override=\"true\"/>\n      <Sequence>\n        <Field Name=\"ExpressionBody\" Type=\"ArrowExpressionClauseSyntax\" Override=\"true\"/>\n        <Field Name=\"SemicolonToken\" Type=\"SyntaxToken\" Override=\"true\">\n          <PropertyComment>\n            <summary>Gets the optional semicolon token.</summary>\n          </PropertyComment>\n          <Kind Name=\"SemicolonToken\"/>\n        </Field>\n      </Sequence>\n    </Choice>\n  </Node>\n  <Node Name=\"ConstructorDeclarationSyntax\" Base=\"BaseMethodDeclarationSyntax\">\n    <TypeComment>\n      <summary>Constructor declaration syntax.</summary>\n    </TypeComment>\n    <Kind Name=\"ConstructorDeclaration\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"Modifiers\" Type=\"SyntaxList&lt;SyntaxToken&gt;\" Override=\"true\"/>\n    <Field Name=\"Identifier\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the identifier.</summary>\n      </PropertyComment>\n      <Kind Name=\"IdentifierToken\"/>\n    </Field>\n    <Field Name=\"ParameterList\" Type=\"ParameterListSyntax\" Override=\"true\"/>\n    <Field Name=\"Initializer\" Type=\"ConstructorInitializerSyntax\" Optional=\"true\"/>\n    <Choice>\n      <Field Name=\"Body\" Type=\"BlockSyntax\" Override=\"true\"/>\n      <Sequence>\n        <Field Name=\"ExpressionBody\" Type=\"ArrowExpressionClauseSyntax\" Override=\"true\"/>\n        <Field Name=\"SemicolonToken\" Type=\"SyntaxToken\" Override=\"true\">\n          <PropertyComment>\n            <summary>Gets the optional semicolon token.</summary>\n          </PropertyComment>\n          <Kind Name=\"SemicolonToken\"/>\n        </Field>\n      </Sequence>\n    </Choice>\n  </Node>\n  <Node Name=\"ConstructorInitializerSyntax\" Base=\"CSharpSyntaxNode\">\n    <TypeComment>\n      <summary>Constructor initializer syntax.</summary>\n    </TypeComment>\n    <Kind Name=\"BaseConstructorInitializer\"/>\n    <Kind Name=\"ThisConstructorInitializer\"/>\n    <Field Name=\"ColonToken\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the colon token.</summary>\n      </PropertyComment>\n      <Kind Name=\"ColonToken\"/>\n    </Field>\n    <Field Name=\"ThisOrBaseKeyword\" Type=\"SyntaxToken\" >\n      <PropertyComment>\n        <summary>Gets the \"this\" or \"base\" keyword.</summary>\n      </PropertyComment>\n      <Kind Name=\"BaseKeyword\"/>\n      <Kind Name=\"ThisKeyword\"/>\n    </Field>\n    <Field Name=\"ArgumentList\" Type=\"ArgumentListSyntax\"/>\n  </Node>\n  <Node Name=\"DestructorDeclarationSyntax\" Base=\"BaseMethodDeclarationSyntax\">\n    <TypeComment>\n      <summary>Destructor declaration syntax.</summary>\n    </TypeComment>\n    <Kind Name=\"DestructorDeclaration\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"Modifiers\" Type=\"SyntaxList&lt;SyntaxToken&gt;\" Override=\"true\"/>\n    <Field Name=\"TildeToken\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the tilde token.</summary>\n      </PropertyComment>\n      <Kind Name=\"TildeToken\"/>\n    </Field>\n    <Field Name=\"Identifier\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the identifier.</summary>\n      </PropertyComment>\n      <Kind Name=\"IdentifierToken\"/>\n    </Field>\n    <Field Name=\"ParameterList\" Type=\"ParameterListSyntax\" Override=\"true\"/>\n    <Choice>\n      <Field Name=\"Body\" Type=\"BlockSyntax\" Override=\"true\"/>\n      <Sequence>\n        <Field Name=\"ExpressionBody\" Type=\"ArrowExpressionClauseSyntax\" Override=\"true\"/>\n        <Field Name=\"SemicolonToken\" Type=\"SyntaxToken\" Override=\"true\">\n          <PropertyComment>\n            <summary>Gets the optional semicolon token.</summary>\n          </PropertyComment>\n          <Kind Name=\"SemicolonToken\"/>\n        </Field>\n      </Sequence>\n    </Choice>\n  </Node>\n  <AbstractNode Name=\"BasePropertyDeclarationSyntax\" Base=\"MemberDeclarationSyntax\">\n    <TypeComment>\n      <summary>Base type for property declaration syntax.</summary>\n    </TypeComment>\n    <Field Name=\"Type\" Type=\"TypeSyntax\">\n      <PropertyComment>\n        <summary>Gets the type syntax.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"ExplicitInterfaceSpecifier\" Type=\"ExplicitInterfaceSpecifierSyntax\" Optional=\"true\">\n      <PropertyComment>\n        <summary>Gets the optional explicit interface specifier.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"AccessorList\" Type=\"AccessorListSyntax\" Optional=\"true\" />\n  </AbstractNode>\n  <Node Name=\"PropertyDeclarationSyntax\" Base=\"BasePropertyDeclarationSyntax\">\n    <Kind Name=\"PropertyDeclaration\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"Modifiers\" Type=\"SyntaxList&lt;SyntaxToken&gt;\" Override=\"true\"/>\n    <Field Name=\"Type\" Type=\"TypeSyntax\" Override=\"true\"/>\n    <Field Name=\"ExplicitInterfaceSpecifier\" Type=\"ExplicitInterfaceSpecifierSyntax\" Optional=\"true\" Override=\"true\"/>\n    <Field Name=\"Identifier\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the identifier.</summary>\n      </PropertyComment>\n      <Kind Name=\"IdentifierToken\"/>\n    </Field>\n    <Choice>\n      <Field Name=\"AccessorList\" Type=\"AccessorListSyntax\" Override=\"true\" />\n      <Sequence>\n        <Choice>\n          <Field Name=\"ExpressionBody\" Type=\"ArrowExpressionClauseSyntax\" />\n          <Field Name=\"Initializer\" Type=\"EqualsValueClauseSyntax\" />\n        </Choice>\n        <Field Name=\"SemicolonToken\" Type=\"SyntaxToken\">\n          <Kind Name=\"SemicolonToken\" />\n        </Field>\n      </Sequence>\n    </Choice>\n  </Node>\n  <Node Name=\"ArrowExpressionClauseSyntax\" Base=\"CSharpSyntaxNode\">\n    <TypeComment>\n      <summary>The syntax for the expression body of an expression-bodied member.</summary>\n    </TypeComment>\n    <Kind Name=\"ArrowExpressionClause\" />\n    <Field Name=\"ArrowToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"EqualsGreaterThanToken\" />\n    </Field>\n    <Field Name=\"Expression\" Type=\"ExpressionSyntax\" />\n  </Node>\n  <Node Name=\"EventDeclarationSyntax\" Base=\"BasePropertyDeclarationSyntax\">\n    <Kind Name=\"EventDeclaration\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"Modifiers\" Type=\"SyntaxList&lt;SyntaxToken&gt;\" Override=\"true\"/>\n    <Field Name=\"EventKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"EventKeyword\"/>\n    </Field>\n    <Field Name=\"Type\" Type=\"TypeSyntax\" Override=\"true\"/>\n    <Field Name=\"ExplicitInterfaceSpecifier\" Type=\"ExplicitInterfaceSpecifierSyntax\" Optional=\"true\" Override=\"true\"/>\n    <Field Name=\"Identifier\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the identifier.</summary>\n      </PropertyComment>\n      <Kind Name=\"IdentifierToken\"/>\n    </Field>\n    <Choice>\n      <Field Name=\"AccessorList\" Type=\"AccessorListSyntax\" Override=\"true\"/>\n      <Field Name=\"SemicolonToken\" Type=\"SyntaxToken\">\n        <Kind Name=\"SemicolonToken\"/>\n      </Field>\n    </Choice>\n  </Node>\n  <Node Name=\"IndexerDeclarationSyntax\" Base=\"BasePropertyDeclarationSyntax\">\n    <Kind Name=\"IndexerDeclaration\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"Modifiers\" Type=\"SyntaxList&lt;SyntaxToken&gt;\" Override=\"true\"/>\n    <Field Name=\"Type\" Type=\"TypeSyntax\" Override=\"true\"/>\n    <Field Name=\"ExplicitInterfaceSpecifier\" Type=\"ExplicitInterfaceSpecifierSyntax\" Optional=\"true\" Override=\"true\"/>\n    <Field Name=\"ThisKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"ThisKeyword\"/>\n    </Field>\n    <Field Name=\"ParameterList\" Type=\"BracketedParameterListSyntax\">\n      <PropertyComment>\n        <summary>Gets the parameter list.</summary>\n      </PropertyComment>\n    </Field>\n    <Choice>\n      <Field Name=\"AccessorList\" Type=\"AccessorListSyntax\" Override=\"true\"/>\n      <Sequence>\n        <Field Name=\"ExpressionBody\" Type=\"ArrowExpressionClauseSyntax\"/>\n        <Field Name=\"SemicolonToken\" Type=\"SyntaxToken\">\n          <Kind Name=\"SemicolonToken\"/>\n        </Field>\n      </Sequence>\n    </Choice>\n  </Node>\n  <Node Name=\"AccessorListSyntax\" Base=\"CSharpSyntaxNode\">\n    <Kind Name=\"AccessorList\"/>\n    <Field Name=\"OpenBraceToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenBraceToken\"/>\n    </Field>\n    <Field Name=\"Accessors\" Type=\"SyntaxList&lt;AccessorDeclarationSyntax&gt;\"/>\n    <Field Name=\"CloseBraceToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseBraceToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"AccessorDeclarationSyntax\" Base=\"CSharpSyntaxNode\">\n    <Kind Name=\"GetAccessorDeclaration\"/>\n    <Kind Name=\"SetAccessorDeclaration\"/>\n    <Kind Name=\"InitAccessorDeclaration\"/>\n    <Kind Name=\"AddAccessorDeclaration\"/>\n    <Kind Name=\"RemoveAccessorDeclaration\"/>\n    <Kind Name=\"UnknownAccessorDeclaration\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\">\n      <PropertyComment>\n        <summary>Gets the attribute declaration list.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Modifiers\" Type=\"SyntaxList&lt;SyntaxToken&gt;\">\n      <PropertyComment>\n        <summary>Gets the modifier list.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Keyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"GetKeyword\"/>\n      <Kind Name=\"SetKeyword\"/>\n      <Kind Name=\"InitKeyword\"/>\n      <Kind Name=\"AddKeyword\"/>\n      <Kind Name=\"RemoveKeyword\"/>\n      <Kind Name=\"IdentifierToken\"/>\n      <PropertyComment>\n        <summary>Gets the keyword token, or identifier if an erroneous accessor declaration.</summary>\n      </PropertyComment>\n    </Field>\n    <Choice>\n      <Field Name=\"Body\" Type=\"BlockSyntax\">\n        <PropertyComment>\n          <summary>Gets the optional body block which may be empty, but it is null if there are no braces.</summary>\n        </PropertyComment>\n      </Field>\n      <Sequence>\n        <Field Name=\"ExpressionBody\" Type=\"ArrowExpressionClauseSyntax\">\n          <PropertyComment>\n            <summary>Gets the optional expression body.</summary>\n          </PropertyComment>\n        </Field>\n        <Field Name=\"SemicolonToken\" Type=\"SyntaxToken\">\n          <PropertyComment>\n            <summary>Gets the optional semicolon token.</summary>\n          </PropertyComment>\n          <Kind Name=\"SemicolonToken\"/>\n        </Field>\n      </Sequence>\n    </Choice>\n  </Node>\n  <AbstractNode Name=\"BaseParameterListSyntax\" Base=\"CSharpSyntaxNode\">\n    <TypeComment>\n      <summary>Base type for parameter list syntax.</summary>\n    </TypeComment>\n    <Field Name=\"Parameters\" Type=\"SeparatedSyntaxList&lt;ParameterSyntax&gt;\">\n      <PropertyComment>\n        <summary>Gets the parameter list.</summary>\n      </PropertyComment>\n    </Field>\n  </AbstractNode>\n  <Node Name=\"ParameterListSyntax\" Base=\"BaseParameterListSyntax\">\n    <TypeComment>\n      <summary>Parameter list syntax.</summary>\n    </TypeComment>\n    <Kind Name=\"ParameterList\"/>\n    <Field Name=\"OpenParenToken\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the open paren token.</summary>\n      </PropertyComment>\n      <Kind Name=\"OpenParenToken\"/>\n    </Field>\n    <Field Name=\"Parameters\" Type=\"SeparatedSyntaxList&lt;ParameterSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"CloseParenToken\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the close paren token.</summary>\n      </PropertyComment>\n      <Kind Name=\"CloseParenToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"BracketedParameterListSyntax\" Base=\"BaseParameterListSyntax\">\n    <TypeComment>\n      <summary>Parameter list syntax with surrounding brackets.</summary>\n    </TypeComment>\n    <Kind Name=\"BracketedParameterList\"/>\n    <Field Name=\"OpenBracketToken\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the open bracket token.</summary>\n      </PropertyComment>\n      <Kind Name=\"OpenBracketToken\"/>\n    </Field>\n    <Field Name=\"Parameters\" Type=\"SeparatedSyntaxList&lt;ParameterSyntax&gt;\" Override=\"true\" MinCount=\"1\"/>\n    <Field Name=\"CloseBracketToken\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the close bracket token.</summary>\n      </PropertyComment>\n      <Kind Name=\"CloseBracketToken\"/>\n    </Field>\n  </Node>\n  <AbstractNode Name=\"BaseParameterSyntax\" Base=\"CSharpSyntaxNode\">\n    <TypeComment>\n      <summary>Base parameter syntax.</summary>\n    </TypeComment>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\">\n      <PropertyComment>\n        <summary>Gets the attribute declaration list.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Modifiers\" Type=\"SyntaxList&lt;SyntaxToken&gt;\">\n      <PropertyComment>\n        <summary>Gets the modifier list.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Type\" Type=\"TypeSyntax\" Optional=\"true\"/>\n  </AbstractNode>\n  <Node Name=\"ParameterSyntax\" Base=\"BaseParameterSyntax\">\n    <TypeComment>\n      <summary>Parameter syntax.</summary>\n    </TypeComment>\n    <Kind Name=\"Parameter\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\">\n      <PropertyComment>\n        <summary>Gets the attribute declaration list.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Modifiers\" Type=\"SyntaxList&lt;SyntaxToken&gt;\" Override=\"true\">\n      <PropertyComment>\n        <summary>Gets the modifier list.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Type\" Type=\"TypeSyntax\" Optional=\"true\" Override=\"true\"/>\n    <Field Name=\"Identifier\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the identifier.</summary>\n      </PropertyComment>\n      <Kind Name=\"IdentifierToken\"/>\n      <Kind Name=\"ArgListKeyword\"/>\n    </Field>\n    <Field Name=\"Default\" Type=\"EqualsValueClauseSyntax\" Optional=\"true\"/>\n  </Node>\n  <Node Name=\"FunctionPointerParameterSyntax\" Base=\"BaseParameterSyntax\">\n    <TypeComment>\n      <summary>Parameter syntax.</summary>\n    </TypeComment>\n    <Kind Name=\"FunctionPointerParameter\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\">\n      <PropertyComment>\n        <summary>Gets the attribute declaration list.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Modifiers\" Type=\"SyntaxList&lt;SyntaxToken&gt;\" Override=\"true\">\n      <PropertyComment>\n        <summary>Gets the modifier list.</summary>\n      </PropertyComment>\n    </Field>\n    <Field Name=\"Type\" Type=\"TypeSyntax\" Optional=\"false\" Override=\"true\"/>\n  </Node>\n  <Node Name=\"IncompleteMemberSyntax\" Base=\"MemberDeclarationSyntax\">\n    <Kind Name=\"IncompleteMember\"/>\n    <Field Name=\"AttributeLists\" Type=\"SyntaxList&lt;AttributeListSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"Modifiers\" Type=\"SyntaxList&lt;SyntaxToken&gt;\" Override=\"true\"/>\n    <Field Name=\"Type\" Type=\"TypeSyntax\" Optional=\"true\"/>\n  </Node>\n  <Node Name=\"SkippedTokensTriviaSyntax\" Base=\"StructuredTriviaSyntax\">\n    <Kind Name=\"SkippedTokensTrivia\"/>\n    <Field Name=\"Tokens\" Type=\"SyntaxList&lt;SyntaxToken&gt;\"/>\n  </Node>\n  <!--\n  <Node Name=\"BadNamespaceMemberDeclarationSyntax\" Base=\"MemberDeclarationSyntax\">\n    <Kind Name=\"BadNamespaceMemberDeclaration\"/>\n    <Field Name=\"Nodes\" Type=\"SyntaxNodeOrTokenList\"/>\n  </Node>\n  -->\n  <!-- Xml -->\n  <Node Name=\"DocumentationCommentTriviaSyntax\" Base=\"StructuredTriviaSyntax\">\n    <Kind Name=\"SingleLineDocumentationCommentTrivia\"/>\n    <Kind Name=\"MultiLineDocumentationCommentTrivia\"/>\n    <Field Name=\"Content\" Type=\"SyntaxList&lt;XmlNodeSyntax&gt;\"/>\n    <Field Name=\"EndOfComment\" Type=\"SyntaxToken\">\n      <!-- should be renamed to EndOfCommentToken -->\n      <Kind Name=\"EndOfDocumentationCommentToken\"/>\n    </Field>\n  </Node>\n  <AbstractNode Name=\"CrefSyntax\" Base=\"CSharpSyntaxNode\">\n    <TypeComment>\n      <summary>\n        A symbol referenced by a cref attribute (e.g. in a &lt;see&gt; or &lt;seealso&gt; documentation comment tag).\n        For example, the M in &lt;see cref=\"M\" /&gt;.\n      </summary>\n    </TypeComment>\n  </AbstractNode>\n  <Node Name=\"TypeCrefSyntax\" Base=\"CrefSyntax\">\n    <TypeComment>\n      <summary>\n        A symbol reference that definitely refers to a type.\n        For example, \"int\", \"A::B\", \"A.B\", \"A&lt;T&gt;\", but not \"M()\" (has parameter list) or \"this\" (indexer).\n        NOTE: TypeCrefSyntax, QualifiedCrefSyntax, and MemberCrefSyntax overlap.  The syntax in a TypeCrefSyntax\n        will always be bound as type, so it's safer to use QualifiedCrefSyntax or MemberCrefSyntax if the symbol\n        might be a non-type member.\n      </summary>\n    </TypeComment>\n    <Kind Name=\"TypeCref\"/>\n    <Field Name=\"Type\" Type=\"TypeSyntax\"/>\n  </Node>\n  <Node Name=\"QualifiedCrefSyntax\" Base=\"CrefSyntax\">\n    <TypeComment>\n      <summary>\n        A symbol reference to a type or non-type member that is qualified by an enclosing type or namespace.\n        For example, cref=\"System.String.ToString()\".\n        NOTE: TypeCrefSyntax, QualifiedCrefSyntax, and MemberCrefSyntax overlap.  The syntax in a TypeCrefSyntax\n        will always be bound as type, so it's safer to use QualifiedCrefSyntax or MemberCrefSyntax if the symbol\n        might be a non-type member.\n      </summary>\n    </TypeComment>\n    <Kind Name=\"QualifiedCref\"/>\n    <Field Name=\"Container\" Type=\"TypeSyntax\"/>\n    <Field Name=\"DotToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"DotToken\"/>\n    </Field>\n    <Field Name=\"Member\" Type=\"MemberCrefSyntax\"/>\n  </Node>\n  <AbstractNode Name=\"MemberCrefSyntax\" Base=\"CrefSyntax\">\n    <TypeComment>\n      <summary>\n        The unqualified part of a CrefSyntax.\n        For example, \"ToString()\" in \"object.ToString()\".\n        NOTE: TypeCrefSyntax, QualifiedCrefSyntax, and MemberCrefSyntax overlap.  The syntax in a TypeCrefSyntax\n        will always be bound as type, so it's safer to use QualifiedCrefSyntax or MemberCrefSyntax if the symbol\n        might be a non-type member.\n      </summary>\n    </TypeComment>\n  </AbstractNode>\n  <Node Name=\"NameMemberCrefSyntax\" Base=\"MemberCrefSyntax\">\n    <TypeComment>\n      <summary>\n        A MemberCrefSyntax specified by a name (an identifier, predefined type keyword, or an alias-qualified name,\n        with an optional type parameter list) and an optional parameter list.\n        For example, \"M\", \"M&lt;T&gt;\" or \"M(int)\".\n        Also, \"A::B()\" or \"string()\".\n      </summary>\n    </TypeComment>\n    <Kind Name=\"NameMemberCref\"/>\n    <Field Name=\"Name\" Type=\"TypeSyntax\"/>\n    <Field Name=\"Parameters\" Type=\"CrefParameterListSyntax\" Optional=\"true\"/>\n  </Node>\n  <Node Name=\"IndexerMemberCrefSyntax\" Base=\"MemberCrefSyntax\">\n    <TypeComment>\n      <summary>\n        A MemberCrefSyntax specified by a this keyword and an optional parameter list.\n        For example, \"this\" or \"this[int]\".\n      </summary>\n    </TypeComment>\n    <Kind Name=\"IndexerMemberCref\"/>\n    <Field Name=\"ThisKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"ThisKeyword\"/>\n    </Field>\n    <Field Name=\"Parameters\" Type=\"CrefBracketedParameterListSyntax\" Optional=\"true\"/>\n  </Node>\n  <Node Name=\"OperatorMemberCrefSyntax\" Base=\"MemberCrefSyntax\">\n    <TypeComment>\n      <summary>\n        A MemberCrefSyntax specified by an operator keyword, an operator symbol and an optional parameter list.\n        For example, \"operator +\" or \"operator -[int]\".\n        NOTE: the operator must be overloadable.\n      </summary>\n    </TypeComment>\n    <Kind Name=\"OperatorMemberCref\"/>\n    <Field Name=\"OperatorKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"OperatorKeyword\"/>\n    </Field>\n    <Field Name=\"CheckedKeyword\" Type=\"SyntaxToken\" Optional=\"true\">\n      <Kind Name=\"CheckedKeyword\"/>\n    </Field>\n    <Field Name=\"OperatorToken\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the operator token.</summary>\n      </PropertyComment>\n      <Kind Name=\"PlusToken\"/>\n      <Kind Name=\"MinusToken\"/>\n      <Kind Name=\"ExclamationToken\"/>\n      <Kind Name=\"TildeToken\"/>\n      <Kind Name=\"PlusPlusToken\"/>\n      <Kind Name=\"MinusMinusToken\"/>\n      <Kind Name=\"AsteriskToken\"/>\n      <Kind Name=\"SlashToken\"/>\n      <Kind Name=\"PercentToken\"/>\n      <Kind Name=\"LessThanLessThanToken\"/>\n      <Kind Name=\"GreaterThanGreaterThanToken\"/>\n      <Kind Name=\"GreaterThanGreaterThanGreaterThanToken\"/>\n      <Kind Name=\"BarToken\"/>\n      <Kind Name=\"AmpersandToken\"/>\n      <Kind Name=\"CaretToken\"/>\n      <Kind Name=\"EqualsEqualsToken\"/>\n      <Kind Name=\"ExclamationEqualsToken\"/>\n      <Kind Name=\"LessThanToken\"/>\n      <Kind Name=\"LessThanEqualsToken\"/>\n      <Kind Name=\"GreaterThanToken\"/>\n      <Kind Name=\"GreaterThanEqualsToken\"/>\n      <Kind Name=\"FalseKeyword\"/>\n      <Kind Name=\"TrueKeyword\"/>\n    </Field>\n    <Field Name=\"Parameters\" Type=\"CrefParameterListSyntax\" Optional=\"true\"/>\n  </Node>\n  <Node Name=\"ConversionOperatorMemberCrefSyntax\" Base=\"MemberCrefSyntax\">\n    <TypeComment>\n      <summary>\n        A MemberCrefSyntax specified by an implicit or explicit keyword, an operator keyword, a destination type, and an optional parameter list.\n        For example, \"implicit operator int\" or \"explicit operator MyType(int)\".\n      </summary>\n    </TypeComment>\n    <Kind Name=\"ConversionOperatorMemberCref\"/>\n    <Field Name=\"ImplicitOrExplicitKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"ImplicitKeyword\"/>\n      <Kind Name=\"ExplicitKeyword\"/>\n    </Field>\n    <Field Name=\"OperatorKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"OperatorKeyword\"/>\n    </Field>\n    <Field Name=\"CheckedKeyword\" Type=\"SyntaxToken\" Optional=\"true\">\n      <Kind Name=\"CheckedKeyword\"/>\n    </Field>\n    <Field Name=\"Type\" Type=\"TypeSyntax\"/>\n    <Field Name=\"Parameters\" Type=\"CrefParameterListSyntax\" Optional=\"true\"/>\n  </Node>\n  <AbstractNode Name=\"BaseCrefParameterListSyntax\" Base=\"CSharpSyntaxNode\">\n    <TypeComment>\n      <summary>\n        A list of cref parameters with surrounding punctuation.\n        Unlike regular parameters, cref parameters do not have names.\n      </summary>\n    </TypeComment>\n    <Field Name=\"Parameters\" Type=\"SeparatedSyntaxList&lt;CrefParameterSyntax&gt;\">\n      <PropertyComment>\n        <summary>Gets the parameter list.</summary>\n      </PropertyComment>\n    </Field>\n  </AbstractNode>\n  <Node Name=\"CrefParameterListSyntax\" Base=\"BaseCrefParameterListSyntax\">\n    <TypeComment>\n      <summary>\n        A parenthesized list of cref parameters.\n      </summary>\n    </TypeComment>\n    <Kind Name=\"CrefParameterList\"/>\n    <Field Name=\"OpenParenToken\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the open paren token.</summary>\n      </PropertyComment>\n      <Kind Name=\"OpenParenToken\"/>\n    </Field>\n    <Field Name=\"Parameters\" Type=\"SeparatedSyntaxList&lt;CrefParameterSyntax&gt;\" Override=\"true\"/>\n    <Field Name=\"CloseParenToken\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the close paren token.</summary>\n      </PropertyComment>\n      <Kind Name=\"CloseParenToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"CrefBracketedParameterListSyntax\" Base=\"BaseCrefParameterListSyntax\">\n    <TypeComment>\n      <summary>\n        A bracketed list of cref parameters.\n      </summary>\n    </TypeComment>\n    <Kind Name=\"CrefBracketedParameterList\"/>\n    <Field Name=\"OpenBracketToken\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the open bracket token.</summary>\n      </PropertyComment>\n      <Kind Name=\"OpenBracketToken\"/>\n    </Field>\n    <Field Name=\"Parameters\" Type=\"SeparatedSyntaxList&lt;CrefParameterSyntax&gt;\" Override=\"true\" MinCount=\"1\"/>\n    <Field Name=\"CloseBracketToken\" Type=\"SyntaxToken\">\n      <PropertyComment>\n        <summary>Gets the close bracket token.</summary>\n      </PropertyComment>\n      <Kind Name=\"CloseBracketToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"CrefParameterSyntax\" Base=\"CSharpSyntaxNode\">\n    <TypeComment>\n      <summary>\n        An element of a BaseCrefParameterListSyntax.\n        Unlike a regular parameter, a cref parameter has only an optional ref, in, out keyword,\n        an optional readonly keyword, and a type -\n        there is no name and there are no attributes or other modifiers.\n      </summary>\n    </TypeComment>\n    <Kind Name=\"CrefParameter\"/>\n    <Field Name=\"RefKindKeyword\" Type=\"SyntaxToken\" Optional=\"true\">\n      <Kind Name=\"RefKeyword\"/>\n      <Kind Name=\"OutKeyword\"/>\n      <Kind Name=\"InKeyword\"/>\n    </Field>\n    <Field Name=\"ReadOnlyKeyword\" Type=\"SyntaxToken\" Optional=\"true\">\n      <Kind Name=\"ReadOnlyKeyword\"/>\n    </Field>\n    <Field Name=\"Type\" Type=\"TypeSyntax\"/>\n  </Node>\n  <AbstractNode Name=\"XmlNodeSyntax\" Base=\"CSharpSyntaxNode\">\n  </AbstractNode>\n  <Node Name=\"XmlElementSyntax\" Base=\"XmlNodeSyntax\">\n    <Kind Name=\"XmlElement\"/>\n    <Field Name=\"StartTag\" Type=\"XmlElementStartTagSyntax\"/>\n    <Field Name=\"Content\" Type=\"SyntaxList&lt;XmlNodeSyntax&gt;\"/>\n    <Field Name=\"EndTag\" Type=\"XmlElementEndTagSyntax\"/>\n  </Node>\n  <Node Name=\"XmlElementStartTagSyntax\" Base=\"CSharpSyntaxNode\">\n    <Kind Name=\"XmlElementStartTag\"/>\n    <Field Name=\"LessThanToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"LessThanToken\"/>\n    </Field>\n    <Field Name=\"Name\" Type=\"XmlNameSyntax\"/>\n    <Field Name=\"Attributes\" Type=\"SyntaxList&lt;XmlAttributeSyntax&gt;\"/>\n    <Field Name=\"GreaterThanToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"GreaterThanToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"XmlElementEndTagSyntax\" Base=\"CSharpSyntaxNode\">\n    <Kind Name=\"XmlElementEndTag\"/>\n    <Field Name=\"LessThanSlashToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"LessThanSlashToken\"/>\n    </Field>\n    <Field Name=\"Name\" Type=\"XmlNameSyntax\"/>\n    <Field Name=\"GreaterThanToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"GreaterThanToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"XmlEmptyElementSyntax\" Base=\"XmlNodeSyntax\">\n    <Kind Name=\"XmlEmptyElement\"/>\n    <Field Name=\"LessThanToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"LessThanToken\"/>\n    </Field>\n    <Field Name=\"Name\" Type=\"XmlNameSyntax\"/>\n    <Field Name=\"Attributes\" Type=\"SyntaxList&lt;XmlAttributeSyntax&gt;\"/>\n    <Field Name=\"SlashGreaterThanToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"SlashGreaterThanToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"XmlNameSyntax\" Base=\"CSharpSyntaxNode\">\n    <Kind Name=\"XmlName\"/>\n    <Field Name=\"Prefix\" Type=\"XmlPrefixSyntax\" Optional=\"true\"/>\n    <Field Name=\"LocalName\" Type=\"SyntaxToken\">\n      <Kind Name=\"IdentifierToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"XmlPrefixSyntax\" Base=\"CSharpSyntaxNode\">\n    <Kind Name=\"XmlPrefix\"/>\n    <Field Name=\"Prefix\" Type=\"SyntaxToken\">\n      <Kind Name=\"IdentifierToken\"/>\n    </Field>\n    <Field Name=\"ColonToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"ColonToken\"/>\n    </Field>\n  </Node>\n  <AbstractNode Name=\"XmlAttributeSyntax\" Base=\"CSharpSyntaxNode\">\n    <Field Name=\"Name\" Type=\"XmlNameSyntax\"/>\n    <Field Name=\"EqualsToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"EqualsToken\"/>\n    </Field>\n    <Field Name=\"StartQuoteToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"SingleQuoteToken\"/>\n      <Kind Name=\"DoubleQuoteToken\"/>\n    </Field>\n    <Field Name=\"EndQuoteToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"SingleQuoteToken\"/>\n      <Kind Name=\"DoubleQuoteToken\"/>\n    </Field>\n  </AbstractNode>\n  <Node Name=\"XmlTextAttributeSyntax\" Base=\"XmlAttributeSyntax\">\n    <Kind Name=\"XmlTextAttribute\"/>\n    <Field Name=\"Name\" Type=\"XmlNameSyntax\" Override=\"true\"/>\n    <Field Name=\"EqualsToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"EqualsToken\"/>\n    </Field>\n    <Field Name=\"StartQuoteToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"SingleQuoteToken\"/>\n      <Kind Name=\"DoubleQuoteToken\"/>\n    </Field>\n    <Field Name=\"TextTokens\" Type=\"SyntaxList&lt;SyntaxToken&gt;\"/>\n    <!-- XmlTextLiteralToken or XmlEntityLiteralToken-->\n    <Field Name=\"EndQuoteToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"SingleQuoteToken\"/>\n      <Kind Name=\"DoubleQuoteToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"XmlCrefAttributeSyntax\" Base=\"XmlAttributeSyntax\">\n    <Kind Name=\"XmlCrefAttribute\"/>\n    <Field Name=\"Name\" Type=\"XmlNameSyntax\" Override=\"true\"/>\n    <Field Name=\"EqualsToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"EqualsToken\"/>\n    </Field>\n    <Field Name=\"StartQuoteToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"SingleQuoteToken\"/>\n      <Kind Name=\"DoubleQuoteToken\"/>\n    </Field>\n    <Field Name=\"Cref\" Type=\"CrefSyntax\"/>\n    <Field Name=\"EndQuoteToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"SingleQuoteToken\"/>\n      <Kind Name=\"DoubleQuoteToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"XmlNameAttributeSyntax\" Base=\"XmlAttributeSyntax\">\n    <Kind Name=\"XmlNameAttribute\"/>\n    <Field Name=\"Name\" Type=\"XmlNameSyntax\" Override=\"true\"/>\n    <Field Name=\"EqualsToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"EqualsToken\"/>\n    </Field>\n    <Field Name=\"StartQuoteToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"SingleQuoteToken\"/>\n      <Kind Name=\"DoubleQuoteToken\"/>\n    </Field>\n    <Field Name=\"Identifier\" Type=\"IdentifierNameSyntax\" />\n    <Field Name=\"EndQuoteToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"SingleQuoteToken\"/>\n      <Kind Name=\"DoubleQuoteToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"XmlTextSyntax\" Base=\"XmlNodeSyntax\">\n    <Kind Name=\"XmlText\"/>\n    <Field Name=\"TextTokens\" Type=\"SyntaxList&lt;SyntaxToken&gt;\"/>\n    <!-- XmlTextLiteralToken or XmlEntityLiteralToken-->\n  </Node>\n  <Node Name=\"XmlCDataSectionSyntax\" Base=\"XmlNodeSyntax\">\n    <Kind Name=\"XmlCDataSection\"/>\n    <Field Name=\"StartCDataToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"XmlCDataStartToken\"/>\n    </Field>\n    <Field Name=\"TextTokens\" Type=\"SyntaxList&lt;SyntaxToken&gt;\"/>\n    <!-- XmlTextLiteralToken only -->\n    <Field Name=\"EndCDataToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"XmlCDataEndToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"XmlProcessingInstructionSyntax\" Base=\"XmlNodeSyntax\">\n    <Kind Name=\"XmlProcessingInstruction\"/>\n    <Field Name=\"StartProcessingInstructionToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"XmlProcessingInstructionStartToken\"/>\n    </Field>\n    <Field Name=\"Name\" Type=\"XmlNameSyntax\" />\n    <Field Name=\"TextTokens\" Type=\"SyntaxList&lt;SyntaxToken&gt;\"/>\n    <!-- XmlTextLiteralToken only -->\n    <Field Name=\"EndProcessingInstructionToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"XmlProcessingInstructionEndToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"XmlCommentSyntax\" Base=\"XmlNodeSyntax\">\n    <Kind Name=\"XmlComment\"/>\n    <Field Name=\"LessThanExclamationMinusMinusToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"XmlCommentStartToken\"/>\n    </Field>\n    <Field Name=\"TextTokens\" Type=\"SyntaxList&lt;SyntaxToken&gt;\"/>\n    <!-- XmlTextLiteralToken only -->\n    <Field Name=\"MinusMinusGreaterThanToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"XmlCommentEndToken\"/>\n    </Field>\n  </Node>\n  <!--\n  <Node Name=\"XmlProcessingInstructionSyntax\" Base=\"XmlNodeSyntax\">\n    <Kind Name=\"XmlProcessingInstruction\"/>\n    <Field Name=\"LessThanQuestionToken\" Type=\"SyntaxToken\"/>\n    <Field Name=\"TextTokens\" Type=\"SyntaxList&lt;SyntaxToken&gt;\"/>\n    <Field Name=\"QuestionGreaterThanToken\" Type=\"SyntaxToken\"/>\n  </Node>\n  -->\n  <!-- Preprocessor -->\n  <AbstractNode Name=\"DirectiveTriviaSyntax\" Base=\"StructuredTriviaSyntax\">\n    <Field Name=\"IsActive\" Type=\"bool\"/>\n    <Field Name=\"HashToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"HashToken\" />\n    </Field>\n    <Field Name=\"EndOfDirectiveToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"EndOfDirectiveToken\" />\n    </Field>\n  </AbstractNode>\n  <AbstractNode Name=\"BranchingDirectiveTriviaSyntax\" Base=\"DirectiveTriviaSyntax\">\n    <Field Name=\"BranchTaken\" Type=\"bool\"/>\n  </AbstractNode>\n  <AbstractNode Name=\"ConditionalDirectiveTriviaSyntax\" Base=\"BranchingDirectiveTriviaSyntax\">\n    <Field Name=\"Condition\" Type=\"ExpressionSyntax\"/>\n    <Field Name=\"ConditionValue\" Type=\"bool\"/>\n  </AbstractNode>\n  <Node Name=\"IfDirectiveTriviaSyntax\" Base=\"ConditionalDirectiveTriviaSyntax\">\n    <Kind Name=\"IfDirectiveTrivia\"/>\n    <Field Name=\"HashToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"HashToken\"/>\n    </Field>\n    <Field Name=\"IfKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"IfKeyword\"/>\n    </Field>\n    <Field Name=\"Condition\" Type=\"ExpressionSyntax\" Override=\"true\"/>\n    <Field Name=\"EndOfDirectiveToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"EndOfDirectiveToken\"/>\n    </Field>\n    <Field Name=\"IsActive\" Type=\"bool\" Override=\"true\"/>\n    <Field Name=\"BranchTaken\" Type=\"bool\" Override=\"true\"/>\n    <Field Name=\"ConditionValue\" Type=\"bool\" Override=\"true\"/>\n  </Node>\n  <Node Name=\"ElifDirectiveTriviaSyntax\" Base=\"ConditionalDirectiveTriviaSyntax\">\n    <Kind Name=\"ElifDirectiveTrivia\"/>\n    <Field Name=\"HashToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"HashToken\"/>\n    </Field>\n    <Field Name=\"ElifKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"ElifKeyword\"/>\n    </Field>\n    <Field Name=\"Condition\" Type=\"ExpressionSyntax\" Override=\"true\"/>\n    <Field Name=\"EndOfDirectiveToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"EndOfDirectiveToken\"/>\n    </Field>\n    <Field Name=\"IsActive\" Type=\"bool\" Override=\"true\"/>\n    <Field Name=\"BranchTaken\" Type=\"bool\" Override=\"true\"/>\n    <Field Name=\"ConditionValue\" Type=\"bool\" Override=\"true\"/>\n  </Node>\n  <Node Name=\"ElseDirectiveTriviaSyntax\" Base=\"BranchingDirectiveTriviaSyntax\">\n    <Kind Name=\"ElseDirectiveTrivia\"/>\n    <Field Name=\"HashToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"HashToken\"/>\n    </Field>\n    <Field Name=\"ElseKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"ElseKeyword\"/>\n    </Field>\n    <Field Name=\"EndOfDirectiveToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"EndOfDirectiveToken\"/>\n    </Field>\n    <Field Name=\"IsActive\" Type=\"bool\" Override=\"true\"/>\n    <Field Name=\"BranchTaken\" Type=\"bool\" Override=\"true\"/>\n  </Node>\n  <Node Name=\"EndIfDirectiveTriviaSyntax\" Base=\"DirectiveTriviaSyntax\">\n    <Kind Name=\"EndIfDirectiveTrivia\"/>\n    <Field Name=\"HashToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"HashToken\"/>\n    </Field>\n    <Field Name=\"EndIfKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"EndIfKeyword\"/>\n    </Field>\n    <Field Name=\"EndOfDirectiveToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"EndOfDirectiveToken\"/>\n    </Field>\n    <Field Name=\"IsActive\" Type=\"bool\" Override=\"true\"/>\n  </Node>\n  <Node Name=\"RegionDirectiveTriviaSyntax\" Base=\"DirectiveTriviaSyntax\">\n    <Kind Name=\"RegionDirectiveTrivia\"/>\n    <Field Name=\"HashToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"HashToken\"/>\n    </Field>\n    <Field Name=\"RegionKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"RegionKeyword\"/>\n    </Field>\n    <Field Name=\"EndOfDirectiveToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"EndOfDirectiveToken\"/>\n    </Field>\n    <Field Name=\"IsActive\" Type=\"bool\" Override=\"true\"/>\n  </Node>\n  <Node Name=\"EndRegionDirectiveTriviaSyntax\" Base=\"DirectiveTriviaSyntax\">\n    <Kind Name=\"EndRegionDirectiveTrivia\"/>\n    <Field Name=\"HashToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"HashToken\"/>\n    </Field>\n    <Field Name=\"EndRegionKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"EndRegionKeyword\"/>\n    </Field>\n    <Field Name=\"EndOfDirectiveToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"EndOfDirectiveToken\"/>\n    </Field>\n    <Field Name=\"IsActive\" Type=\"bool\" Override=\"true\"/>\n  </Node>\n  <Node Name=\"ErrorDirectiveTriviaSyntax\" Base=\"DirectiveTriviaSyntax\">\n    <Kind Name=\"ErrorDirectiveTrivia\"/>\n    <Field Name=\"HashToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"HashToken\"/>\n    </Field>\n    <Field Name=\"ErrorKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"ErrorKeyword\"/>\n    </Field>\n    <Field Name=\"EndOfDirectiveToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"EndOfDirectiveToken\"/>\n    </Field>\n    <Field Name=\"IsActive\" Type=\"bool\" Override=\"true\"/>\n  </Node>\n  <Node Name=\"WarningDirectiveTriviaSyntax\" Base=\"DirectiveTriviaSyntax\">\n    <Kind Name=\"WarningDirectiveTrivia\"/>\n    <Field Name=\"HashToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"HashToken\"/>\n    </Field>\n    <Field Name=\"WarningKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"WarningKeyword\"/>\n    </Field>\n    <Field Name=\"EndOfDirectiveToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"EndOfDirectiveToken\"/>\n    </Field>\n    <Field Name=\"IsActive\" Type=\"bool\" Override=\"true\"/>\n  </Node>\n  <Node Name=\"BadDirectiveTriviaSyntax\" Base=\"DirectiveTriviaSyntax\">\n    <Kind Name=\"BadDirectiveTrivia\"/>\n    <Field Name=\"HashToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"HashToken\"/>\n    </Field>\n    <Field Name=\"Identifier\" Type=\"SyntaxToken\" />\n    <Field Name=\"EndOfDirectiveToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"EndOfDirectiveToken\"/>\n    </Field>\n    <Field Name=\"IsActive\" Type=\"bool\" Override=\"true\"/>\n  </Node>\n  <Node Name=\"DefineDirectiveTriviaSyntax\" Base=\"DirectiveTriviaSyntax\">\n    <Kind Name=\"DefineDirectiveTrivia\"/>\n    <Field Name=\"HashToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"HashToken\"/>\n    </Field>\n    <Field Name=\"DefineKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"DefineKeyword\"/>\n    </Field>\n    <Field Name=\"Name\" Type=\"SyntaxToken\">\n      <!-- should be identifier -->\n      <Kind Name=\"IdentifierToken\"/>\n    </Field>\n    <Field Name=\"EndOfDirectiveToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"EndOfDirectiveToken\"/>\n    </Field>\n    <Field Name=\"IsActive\" Type=\"bool\" Override=\"true\"/>\n  </Node>\n  <Node Name=\"UndefDirectiveTriviaSyntax\" Base=\"DirectiveTriviaSyntax\">\n    <Kind Name=\"UndefDirectiveTrivia\"/>\n    <Field Name=\"HashToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"HashToken\"/>\n    </Field>\n    <Field Name=\"UndefKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"UndefKeyword\"/>\n    </Field>\n    <Field Name=\"Name\" Type=\"SyntaxToken\">\n      <!-- should be identifier -->\n      <Kind Name=\"IdentifierToken\"/>\n    </Field>\n    <Field Name=\"EndOfDirectiveToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"EndOfDirectiveToken\"/>\n    </Field>\n    <Field Name=\"IsActive\" Type=\"bool\" Override=\"true\"/>\n  </Node>\n  <AbstractNode Name=\"LineOrSpanDirectiveTriviaSyntax\" Base=\"DirectiveTriviaSyntax\">\n    <Field Name=\"LineKeyword\" Type=\"SyntaxToken\" />\n    <Field Name=\"File\" Type=\"SyntaxToken\" Optional=\"true\" />\n  </AbstractNode>\n  <Node Name=\"LineDirectiveTriviaSyntax\" Base=\"LineOrSpanDirectiveTriviaSyntax\">\n    <Kind Name=\"LineDirectiveTrivia\"/>\n    <Field Name=\"HashToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"HashToken\"/>\n    </Field>\n    <Field Name=\"LineKeyword\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"LineKeyword\"/>\n    </Field>\n    <Field Name=\"Line\" Type=\"SyntaxToken\">\n      <Kind Name=\"NumericLiteralToken\"/>\n      <Kind Name=\"DefaultKeyword\"/>\n      <Kind Name=\"HiddenKeyword\"/>\n    </Field>\n    <Field Name=\"File\" Type=\"SyntaxToken\" Optional=\"true\" Override=\"true\">\n      <Kind Name=\"StringLiteralToken\"/>\n    </Field>\n    <Field Name=\"EndOfDirectiveToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"EndOfDirectiveToken\"/>\n    </Field>\n    <Field Name=\"IsActive\" Type=\"bool\" Override=\"true\"/>\n  </Node>\n  <Node Name=\"LineDirectivePositionSyntax\" Base=\"CSharpSyntaxNode\">\n    <Kind Name=\"LineDirectivePosition\"/>\n    <Field Name=\"OpenParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"OpenParenToken\"/>\n    </Field>\n    <Field Name=\"Line\" Type=\"SyntaxToken\">\n      <Kind Name=\"NumericLiteralToken\"/>\n    </Field>\n    <Field Name=\"CommaToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CommaToken\"/>\n    </Field>\n    <Field Name=\"Character\" Type=\"SyntaxToken\">\n      <Kind Name=\"NumericLiteralToken\"/>\n    </Field>\n    <Field Name=\"CloseParenToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"CloseParenToken\"/>\n    </Field>\n  </Node>\n  <Node Name=\"LineSpanDirectiveTriviaSyntax\" Base=\"LineOrSpanDirectiveTriviaSyntax\">\n    <Kind Name=\"LineSpanDirectiveTrivia\"/>\n    <Field Name=\"HashToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"HashToken\"/>\n    </Field>\n    <Field Name=\"LineKeyword\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"LineKeyword\"/>\n    </Field>\n     <Field Name=\"Start\" Type=\"LineDirectivePositionSyntax\" />\n     <Field Name=\"MinusToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"MinusToken\"/>\n    </Field>\n    <Field Name=\"End\" Type=\"LineDirectivePositionSyntax\" />\n    <Field Name=\"CharacterOffset\" Type=\"SyntaxToken\"  Optional=\"true\">\n      <Kind Name=\"NumericLiteralToken\"/>\n    </Field>\n    <Field Name=\"File\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"StringLiteralToken\"/>\n    </Field>\n    <Field Name=\"EndOfDirectiveToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"EndOfDirectiveToken\"/>\n    </Field>\n    <Field Name=\"IsActive\" Type=\"bool\" Override=\"true\"/>\n  </Node>\n  <Node Name=\"PragmaWarningDirectiveTriviaSyntax\" Base=\"DirectiveTriviaSyntax\">\n    <Kind Name=\"PragmaWarningDirectiveTrivia\"/>\n    <Field Name=\"HashToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"HashToken\"/>\n    </Field>\n    <Field Name=\"PragmaKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"PragmaKeyword\"/>\n    </Field>\n    <Field Name=\"WarningKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"WarningKeyword\"/>\n    </Field>\n    <Field Name=\"DisableOrRestoreKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"DisableKeyword\"/>\n      <Kind Name=\"RestoreKeyword\"/>\n    </Field>\n    <Field Name=\"ErrorCodes\" Type=\"SeparatedSyntaxList&lt;ExpressionSyntax&gt;\"/>\n    <Field Name=\"EndOfDirectiveToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"EndOfDirectiveToken\"/>\n    </Field>\n    <Field Name=\"IsActive\" Type=\"bool\" Override=\"true\"/>\n  </Node>\n  <Node Name=\"PragmaChecksumDirectiveTriviaSyntax\" Base=\"DirectiveTriviaSyntax\">\n    <Kind Name=\"PragmaChecksumDirectiveTrivia\"/>\n    <Field Name=\"HashToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"HashToken\"/>\n    </Field>\n    <Field Name=\"PragmaKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"PragmaKeyword\"/>\n    </Field>\n    <Field Name=\"ChecksumKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"ChecksumKeyword\"/>\n    </Field>\n    <Field Name=\"File\" Type=\"SyntaxToken\">\n      <Kind Name=\"StringLiteralToken\"/>\n    </Field>\n    <Field Name=\"Guid\" Type=\"SyntaxToken\">\n      <Kind Name=\"StringLiteralToken\"/>\n    </Field>\n    <Field Name=\"Bytes\" Type=\"SyntaxToken\">\n      <Kind Name=\"StringLiteralToken\"/>\n    </Field>\n    <Field Name=\"EndOfDirectiveToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"EndOfDirectiveToken\"/>\n    </Field>\n    <Field Name=\"IsActive\" Type=\"bool\" Override=\"true\"/>\n  </Node>\n  <Node Name=\"ReferenceDirectiveTriviaSyntax\" Base=\"DirectiveTriviaSyntax\">\n    <Kind Name=\"ReferenceDirectiveTrivia\"/>\n    <Field Name=\"HashToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"HashToken\"/>\n    </Field>\n    <Field Name=\"ReferenceKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"ReferenceKeyword\"/>\n    </Field>\n    <Field Name=\"File\" Type=\"SyntaxToken\">\n      <Kind Name=\"StringLiteralToken\"/>\n    </Field>\n    <Field Name=\"EndOfDirectiveToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"EndOfDirectiveToken\"/>\n    </Field>\n    <Field Name=\"IsActive\" Type=\"bool\" Override=\"true\"/>\n  </Node>\n  <Node Name=\"LoadDirectiveTriviaSyntax\" Base=\"DirectiveTriviaSyntax\">\n    <Kind Name=\"LoadDirectiveTrivia\"/>\n    <Field Name=\"HashToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"HashToken\"/>\n    </Field>\n    <Field Name=\"LoadKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"LoadKeyword\"/>\n    </Field>\n    <Field Name=\"File\" Type=\"SyntaxToken\">\n      <Kind Name=\"StringLiteralToken\"/>\n    </Field>\n    <Field Name=\"EndOfDirectiveToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"EndOfDirectiveToken\"/>\n    </Field>\n    <Field Name=\"IsActive\" Type=\"bool\" Override=\"true\"/>\n  </Node>\n  <Node Name=\"ShebangDirectiveTriviaSyntax\" Base=\"DirectiveTriviaSyntax\">\n    <Kind Name=\"ShebangDirectiveTrivia\"/>\n    <Field Name=\"HashToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"HashToken\"/>\n    </Field>\n    <Field Name=\"ExclamationToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"ExclamationToken\"/>\n    </Field>\n    <Field Name=\"EndOfDirectiveToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"EndOfDirectiveToken\"/>\n    </Field>\n    <Field Name=\"IsActive\" Type=\"bool\" Override=\"true\"/>\n  </Node>\n  <Node Name=\"NullableDirectiveTriviaSyntax\" Base=\"DirectiveTriviaSyntax\">\n    <Kind Name=\"NullableDirectiveTrivia\"/>\n    <Field Name=\"HashToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"HashToken\"/>\n    </Field>\n    <Field Name=\"NullableKeyword\" Type=\"SyntaxToken\">\n      <Kind Name=\"NullableKeyword\"/>\n    </Field>\n    <Field Name=\"SettingToken\" Type=\"SyntaxToken\">\n      <Kind Name=\"EnableKeyword\"/>\n      <Kind Name=\"DisableKeyword\"/>\n      <Kind Name=\"RestoreKeyword\"/>\n    </Field>\n    <Field Name=\"TargetToken\" Type=\"SyntaxToken\" Optional=\"true\">\n      <Kind Name=\"WarningsKeyword\"/>\n      <Kind Name=\"AnnotationsKeyword\"/>\n    </Field>\n    <Field Name=\"EndOfDirectiveToken\" Type=\"SyntaxToken\" Override=\"true\">\n      <Kind Name=\"EndOfDirectiveToken\"/>\n    </Field>\n    <Field Name=\"IsActive\" Type=\"bool\" Override=\"true\"/>\n  </Node>\n</Tree>\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/SyntaxFactoryEx.cs",
    "content": "﻿// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.\n// Licensed under the MIT License. See LICENSE in the project root for license information.\n\n#nullable disable\n\nnamespace StyleCop.Analyzers.Lightup\n{\n    using System;\n    using System.Linq;\n    using System.Linq.Expressions;\n    using System.Reflection;\n    using Microsoft.CodeAnalysis;\n    using Microsoft.CodeAnalysis.CSharp;\n    using Microsoft.CodeAnalysis.CSharp.Syntax;\n\n    public static class SyntaxFactoryEx\n    {\n        private static readonly Func<SeparatedSyntaxListWrapper<SubpatternSyntaxWrapper>, CSharpSyntaxNode> PositionalPatternClauseAccessor1;\n        private static readonly Func<SyntaxToken, SeparatedSyntaxListWrapper<SubpatternSyntaxWrapper>, SyntaxToken, CSharpSyntaxNode> PositionalPatternClauseAccessor2;\n        private static readonly Func<SeparatedSyntaxListWrapper<SubpatternSyntaxWrapper>, CSharpSyntaxNode> PropertyPatternClauseAccessor1;\n        private static readonly Func<SyntaxToken, SeparatedSyntaxListWrapper<SubpatternSyntaxWrapper>, SyntaxToken, CSharpSyntaxNode> PropertyPatternClauseAccessor2;\n        private static readonly Func<TypeSyntax, CSharpSyntaxNode> TupleElementAccessor1;\n        private static readonly Func<TypeSyntax, SyntaxToken, CSharpSyntaxNode> TupleElementAccessor2;\n        private static readonly Func<SeparatedSyntaxList<ArgumentSyntax>, ExpressionSyntax> TupleExpressionAccessor1;\n        private static readonly Func<SyntaxToken, SeparatedSyntaxList<ArgumentSyntax>, SyntaxToken, ExpressionSyntax> TupleExpressionAccessor2;\n        private static readonly Func<SeparatedSyntaxListWrapper<TupleElementSyntaxWrapper>, TypeSyntax> TupleTypeAccessor1;\n        private static readonly Func<SyntaxToken, SeparatedSyntaxListWrapper<TupleElementSyntaxWrapper>, SyntaxToken, TypeSyntax> TupleTypeAccessor2;\n\n        static SyntaxFactoryEx()\n        {\n            var positionalPatternClauseMethods = typeof(SyntaxFactory).GetTypeInfo().GetDeclaredMethods(nameof(PositionalPatternClause));\n            var positionalPatternClauseMethod = positionalPatternClauseMethods.FirstOrDefault(method => method.GetParameters().Length == 1 && method.GetParameters()[0].ParameterType == typeof(SeparatedSyntaxList<>).MakeGenericType(SyntaxWrapperHelper.GetWrappedType(typeof(SubpatternSyntaxWrapper))));\n            if (positionalPatternClauseMethod is object)\n            {\n                var subpatternsParameter = Expression.Parameter(typeof(SeparatedSyntaxListWrapper<SubpatternSyntaxWrapper>), \"subpatterns\");\n                var underlyingListProperty = typeof(SeparatedSyntaxListWrapper<SubpatternSyntaxWrapper>).GetTypeInfo().GetDeclaredProperty(nameof(SeparatedSyntaxListWrapper<SubpatternSyntaxWrapper>.UnderlyingList));\n                Expression<Func<SeparatedSyntaxListWrapper<SubpatternSyntaxWrapper>, CSharpSyntaxNode>> expression =\n                    Expression.Lambda<Func<SeparatedSyntaxListWrapper<SubpatternSyntaxWrapper>, CSharpSyntaxNode>>(\n                        Expression.Call(\n                            positionalPatternClauseMethod,\n                            Expression.Convert(\n                                Expression.Call(subpatternsParameter, underlyingListProperty.GetMethod),\n                                positionalPatternClauseMethod.GetParameters()[0].ParameterType)),\n                        subpatternsParameter);\n                PositionalPatternClauseAccessor1 = expression.Compile();\n            }\n            else\n            {\n                PositionalPatternClauseAccessor1 = ThrowNotSupportedOnFallback<SeparatedSyntaxListWrapper<SubpatternSyntaxWrapper>, CSharpSyntaxNode>(nameof(SyntaxFactory), nameof(PositionalPatternClause));\n            }\n\n            positionalPatternClauseMethod = positionalPatternClauseMethods.FirstOrDefault(method => method.GetParameters().Length == 3\n                && method.GetParameters()[0].ParameterType == typeof(SyntaxToken)\n                && method.GetParameters()[1].ParameterType == typeof(SeparatedSyntaxList<>).MakeGenericType(SyntaxWrapperHelper.GetWrappedType(typeof(SubpatternSyntaxWrapper)))\n                && method.GetParameters()[2].ParameterType == typeof(SyntaxToken));\n            if (positionalPatternClauseMethod is object)\n            {\n                var openParenTokenParameter = Expression.Parameter(typeof(SyntaxToken), \"openParenToken\");\n                var subpatternsParameter = Expression.Parameter(typeof(SeparatedSyntaxListWrapper<SubpatternSyntaxWrapper>), \"subpatterns\");\n                var closeParenTokenParameter = Expression.Parameter(typeof(SyntaxToken), \"closeParenToken\");\n\n                var underlyingListProperty = typeof(SeparatedSyntaxListWrapper<SubpatternSyntaxWrapper>).GetTypeInfo().GetDeclaredProperty(nameof(SeparatedSyntaxListWrapper<SubpatternSyntaxWrapper>.UnderlyingList));\n\n                Expression<Func<SyntaxToken, SeparatedSyntaxListWrapper<SubpatternSyntaxWrapper>, SyntaxToken, CSharpSyntaxNode>> expression =\n                    Expression.Lambda<Func<SyntaxToken, SeparatedSyntaxListWrapper<SubpatternSyntaxWrapper>, SyntaxToken, CSharpSyntaxNode>>(\n                        Expression.Call(\n                            positionalPatternClauseMethod,\n                            openParenTokenParameter,\n                            Expression.Convert(\n                                Expression.Call(subpatternsParameter, underlyingListProperty.GetMethod),\n                                positionalPatternClauseMethod.GetParameters()[1].ParameterType),\n                            closeParenTokenParameter),\n                        openParenTokenParameter,\n                        subpatternsParameter,\n                        closeParenTokenParameter);\n                PositionalPatternClauseAccessor2 = expression.Compile();\n            }\n            else\n            {\n                PositionalPatternClauseAccessor2 = ThrowNotSupportedOnFallback<SyntaxToken, SeparatedSyntaxListWrapper<SubpatternSyntaxWrapper>, SyntaxToken, TypeSyntax>(nameof(SyntaxFactory), nameof(PositionalPatternClause));\n            }\n\n            var propertyPatternClauseMethods = typeof(SyntaxFactory).GetTypeInfo().GetDeclaredMethods(nameof(PropertyPatternClause));\n            var propertyPatternClauseMethod = propertyPatternClauseMethods.FirstOrDefault(method => method.GetParameters().Length == 1 && method.GetParameters()[0].ParameterType == typeof(SeparatedSyntaxList<>).MakeGenericType(SyntaxWrapperHelper.GetWrappedType(typeof(SubpatternSyntaxWrapper))));\n            if (propertyPatternClauseMethod is object)\n            {\n                var subpatternsParameter = Expression.Parameter(typeof(SeparatedSyntaxListWrapper<SubpatternSyntaxWrapper>), \"subpatterns\");\n                var underlyingListProperty = typeof(SeparatedSyntaxListWrapper<SubpatternSyntaxWrapper>).GetTypeInfo().GetDeclaredProperty(nameof(SeparatedSyntaxListWrapper<SubpatternSyntaxWrapper>.UnderlyingList));\n                Expression<Func<SeparatedSyntaxListWrapper<SubpatternSyntaxWrapper>, CSharpSyntaxNode>> expression =\n                    Expression.Lambda<Func<SeparatedSyntaxListWrapper<SubpatternSyntaxWrapper>, CSharpSyntaxNode>>(\n                        Expression.Call(\n                            propertyPatternClauseMethod,\n                            Expression.Convert(\n                                Expression.Call(subpatternsParameter, underlyingListProperty.GetMethod),\n                                propertyPatternClauseMethod.GetParameters()[0].ParameterType)),\n                        subpatternsParameter);\n                PropertyPatternClauseAccessor1 = expression.Compile();\n            }\n            else\n            {\n                PropertyPatternClauseAccessor1 = ThrowNotSupportedOnFallback<SeparatedSyntaxListWrapper<SubpatternSyntaxWrapper>, CSharpSyntaxNode>(nameof(SyntaxFactory), nameof(PropertyPatternClause));\n            }\n\n            propertyPatternClauseMethod = propertyPatternClauseMethods.FirstOrDefault(method => method.GetParameters().Length == 3\n                && method.GetParameters()[0].ParameterType == typeof(SyntaxToken)\n                && method.GetParameters()[1].ParameterType == typeof(SeparatedSyntaxList<>).MakeGenericType(SyntaxWrapperHelper.GetWrappedType(typeof(SubpatternSyntaxWrapper)))\n                && method.GetParameters()[2].ParameterType == typeof(SyntaxToken));\n            if (propertyPatternClauseMethod is object)\n            {\n                var openBraceTokenParameter = Expression.Parameter(typeof(SyntaxToken), \"openBraceToken\");\n                var subpatternsParameter = Expression.Parameter(typeof(SeparatedSyntaxListWrapper<SubpatternSyntaxWrapper>), \"subpatterns\");\n                var closeBraceTokenParameter = Expression.Parameter(typeof(SyntaxToken), \"closeBraceToken\");\n\n                var underlyingListProperty = typeof(SeparatedSyntaxListWrapper<SubpatternSyntaxWrapper>).GetTypeInfo().GetDeclaredProperty(nameof(SeparatedSyntaxListWrapper<SubpatternSyntaxWrapper>.UnderlyingList));\n\n                Expression<Func<SyntaxToken, SeparatedSyntaxListWrapper<SubpatternSyntaxWrapper>, SyntaxToken, CSharpSyntaxNode>> expression =\n                    Expression.Lambda<Func<SyntaxToken, SeparatedSyntaxListWrapper<SubpatternSyntaxWrapper>, SyntaxToken, CSharpSyntaxNode>>(\n                        Expression.Call(\n                            propertyPatternClauseMethod,\n                            openBraceTokenParameter,\n                            Expression.Convert(\n                                Expression.Call(subpatternsParameter, underlyingListProperty.GetMethod),\n                                propertyPatternClauseMethod.GetParameters()[1].ParameterType),\n                            closeBraceTokenParameter),\n                        openBraceTokenParameter,\n                        subpatternsParameter,\n                        closeBraceTokenParameter);\n                PropertyPatternClauseAccessor2 = expression.Compile();\n            }\n            else\n            {\n                PropertyPatternClauseAccessor2 = ThrowNotSupportedOnFallback<SyntaxToken, SeparatedSyntaxListWrapper<SubpatternSyntaxWrapper>, SyntaxToken, TypeSyntax>(nameof(SyntaxFactory), nameof(PropertyPatternClause));\n            }\n\n            var tupleElementMethods = typeof(SyntaxFactory).GetTypeInfo().GetDeclaredMethods(nameof(TupleElement));\n            var tupleElementMethod = tupleElementMethods.FirstOrDefault(method => method.GetParameters().Length == 1 && method.GetParameters()[0].ParameterType == typeof(TypeSyntax));\n            if (tupleElementMethod is object)\n            {\n                var typeParameter = Expression.Parameter(typeof(TypeSyntax), \"type\");\n                Expression<Func<TypeSyntax, CSharpSyntaxNode>> expression =\n                    Expression.Lambda<Func<TypeSyntax, CSharpSyntaxNode>>(\n                        Expression.Call(tupleElementMethod, typeParameter),\n                        typeParameter);\n                TupleElementAccessor1 = expression.Compile();\n            }\n            else\n            {\n                TupleElementAccessor1 = ThrowNotSupportedOnFallback<TypeSyntax, CSharpSyntaxNode>(nameof(SyntaxFactory), nameof(TupleElement));\n            }\n\n            tupleElementMethod = tupleElementMethods.FirstOrDefault(method => method.GetParameters().Length == 2 && method.GetParameters()[0].ParameterType == typeof(TypeSyntax) && method.GetParameters()[1].ParameterType == typeof(SyntaxToken));\n            if (tupleElementMethod is object)\n            {\n                var typeParameter = Expression.Parameter(typeof(TypeSyntax), \"type\");\n                var identifierParameter = Expression.Parameter(typeof(SyntaxToken), \"identifier\");\n                Expression<Func<TypeSyntax, SyntaxToken, CSharpSyntaxNode>> expression =\n                    Expression.Lambda<Func<TypeSyntax, SyntaxToken, CSharpSyntaxNode>>(\n                        Expression.Call(tupleElementMethod, typeParameter, identifierParameter),\n                        typeParameter,\n                        identifierParameter);\n                TupleElementAccessor2 = expression.Compile();\n            }\n            else\n            {\n                TupleElementAccessor2 = ThrowNotSupportedOnFallback<TypeSyntax, SyntaxToken, CSharpSyntaxNode>(nameof(SyntaxFactory), nameof(TupleElement));\n            }\n\n            var tupleExpressionMethods = typeof(SyntaxFactory).GetTypeInfo().GetDeclaredMethods(nameof(TupleExpression));\n            var tupleExpressionMethod = tupleExpressionMethods.FirstOrDefault(method => method.GetParameters().Length == 1 && method.GetParameters()[0].ParameterType == typeof(SeparatedSyntaxList<ArgumentSyntax>));\n            if (tupleExpressionMethod is object)\n            {\n                var argumentsParameter = Expression.Parameter(typeof(SeparatedSyntaxList<ArgumentSyntax>), \"arguments\");\n                Expression<Func<SeparatedSyntaxList<ArgumentSyntax>, ExpressionSyntax>> expression =\n                    Expression.Lambda<Func<SeparatedSyntaxList<ArgumentSyntax>, ExpressionSyntax>>(\n                        Expression.Call(tupleExpressionMethod, argumentsParameter),\n                        argumentsParameter);\n                TupleExpressionAccessor1 = expression.Compile();\n            }\n            else\n            {\n                TupleExpressionAccessor1 = ThrowNotSupportedOnFallback<SeparatedSyntaxList<ArgumentSyntax>, ExpressionSyntax>(nameof(SyntaxFactory), nameof(TupleExpression));\n            }\n\n            tupleExpressionMethod = tupleExpressionMethods.FirstOrDefault(method => method.GetParameters().Length == 3\n                && method.GetParameters()[0].ParameterType == typeof(SyntaxToken)\n                && method.GetParameters()[1].ParameterType == typeof(SeparatedSyntaxList<ArgumentSyntax>)\n                && method.GetParameters()[2].ParameterType == typeof(SyntaxToken));\n            if (tupleExpressionMethod is object)\n            {\n                var openParenTokenParameter = Expression.Parameter(typeof(SyntaxToken), \"openParenToken\");\n                var argumentsParameter = Expression.Parameter(typeof(SeparatedSyntaxList<ArgumentSyntax>), \"arguments\");\n                var closeParenTokenParameter = Expression.Parameter(typeof(SyntaxToken), \"closeParenToken\");\n                Expression<Func<SyntaxToken, SeparatedSyntaxList<ArgumentSyntax>, SyntaxToken, ExpressionSyntax>> expression =\n                    Expression.Lambda<Func<SyntaxToken, SeparatedSyntaxList<ArgumentSyntax>, SyntaxToken, ExpressionSyntax>>(\n                        Expression.Call(tupleExpressionMethod, openParenTokenParameter, argumentsParameter, closeParenTokenParameter),\n                        openParenTokenParameter,\n                        argumentsParameter,\n                        closeParenTokenParameter);\n                TupleExpressionAccessor2 = expression.Compile();\n            }\n            else\n            {\n                TupleExpressionAccessor2 = ThrowNotSupportedOnFallback<SyntaxToken, SeparatedSyntaxList<ArgumentSyntax>, SyntaxToken, ExpressionSyntax>(nameof(SyntaxFactory), nameof(TupleExpression));\n            }\n\n            var tupleTypeMethods = typeof(SyntaxFactory).GetTypeInfo().GetDeclaredMethods(nameof(TupleType));\n            var tupleTypeMethod = tupleTypeMethods.FirstOrDefault(method => method.GetParameters().Length == 1 && method.GetParameters()[0].ParameterType == typeof(SeparatedSyntaxList<>).MakeGenericType(SyntaxWrapperHelper.GetWrappedType(typeof(TupleElementSyntaxWrapper))));\n            if (tupleTypeMethod is object)\n            {\n                var elementsParameter = Expression.Parameter(typeof(SeparatedSyntaxListWrapper<TupleElementSyntaxWrapper>), \"elements\");\n                var underlyingListProperty = typeof(SeparatedSyntaxListWrapper<TupleElementSyntaxWrapper>).GetTypeInfo().GetDeclaredProperty(nameof(SeparatedSyntaxListWrapper<TupleElementSyntaxWrapper>.UnderlyingList));\n                Expression<Func<SeparatedSyntaxListWrapper<TupleElementSyntaxWrapper>, TypeSyntax>> expression =\n                    Expression.Lambda<Func<SeparatedSyntaxListWrapper<TupleElementSyntaxWrapper>, TypeSyntax>>(\n                        Expression.Call(\n                            tupleTypeMethod,\n                            Expression.Convert(\n                                Expression.Call(elementsParameter, underlyingListProperty.GetMethod),\n                                tupleTypeMethod.GetParameters()[0].ParameterType)),\n                        elementsParameter);\n                TupleTypeAccessor1 = expression.Compile();\n            }\n            else\n            {\n                TupleTypeAccessor1 = ThrowNotSupportedOnFallback<SeparatedSyntaxListWrapper<TupleElementSyntaxWrapper>, TypeSyntax>(nameof(SyntaxFactory), nameof(TupleType));\n            }\n\n            tupleTypeMethod = tupleTypeMethods.FirstOrDefault(method => method.GetParameters().Length == 3\n                && method.GetParameters()[0].ParameterType == typeof(SyntaxToken)\n                && method.GetParameters()[1].ParameterType == typeof(SeparatedSyntaxList<>).MakeGenericType(SyntaxWrapperHelper.GetWrappedType(typeof(TupleElementSyntaxWrapper)))\n                && method.GetParameters()[2].ParameterType == typeof(SyntaxToken));\n            if (tupleTypeMethod is object)\n            {\n                var openParenTokenParameter = Expression.Parameter(typeof(SyntaxToken), \"openParenToken\");\n                var elementsParameter = Expression.Parameter(typeof(SeparatedSyntaxListWrapper<TupleElementSyntaxWrapper>), \"elements\");\n                var closeParenTokenParameter = Expression.Parameter(typeof(SyntaxToken), \"closeParenToken\");\n\n                var underlyingListProperty = typeof(SeparatedSyntaxListWrapper<TupleElementSyntaxWrapper>).GetTypeInfo().GetDeclaredProperty(nameof(SeparatedSyntaxListWrapper<TupleElementSyntaxWrapper>.UnderlyingList));\n\n                Expression<Func<SyntaxToken, SeparatedSyntaxListWrapper<TupleElementSyntaxWrapper>, SyntaxToken, TypeSyntax>> expression =\n                    Expression.Lambda<Func<SyntaxToken, SeparatedSyntaxListWrapper<TupleElementSyntaxWrapper>, SyntaxToken, TypeSyntax>>(\n                        Expression.Call(\n                            tupleTypeMethod,\n                            openParenTokenParameter,\n                            Expression.Convert(\n                                Expression.Call(elementsParameter, underlyingListProperty.GetMethod),\n                                tupleTypeMethod.GetParameters()[1].ParameterType),\n                            closeParenTokenParameter),\n                        openParenTokenParameter,\n                        elementsParameter,\n                        closeParenTokenParameter);\n                TupleTypeAccessor2 = expression.Compile();\n            }\n            else\n            {\n                TupleTypeAccessor2 = ThrowNotSupportedOnFallback<SyntaxToken, SeparatedSyntaxListWrapper<TupleElementSyntaxWrapper>, SyntaxToken, TypeSyntax>(nameof(SyntaxFactory), nameof(TupleType));\n            }\n        }\n\n        public static PositionalPatternClauseSyntaxWrapper PositionalPatternClause(SeparatedSyntaxListWrapper<SubpatternSyntaxWrapper> subpatterns = default)\n        {\n            return (PositionalPatternClauseSyntaxWrapper)PositionalPatternClauseAccessor1(subpatterns);\n        }\n\n        public static PositionalPatternClauseSyntaxWrapper PositionalPatternClause(SyntaxToken openParenToken, SeparatedSyntaxListWrapper<SubpatternSyntaxWrapper> subpatterns, SyntaxToken closeParenToken)\n        {\n            return (PositionalPatternClauseSyntaxWrapper)PositionalPatternClauseAccessor2(openParenToken, subpatterns, closeParenToken);\n        }\n\n        public static PropertyPatternClauseSyntaxWrapper PropertyPatternClause(SeparatedSyntaxListWrapper<SubpatternSyntaxWrapper> subpatterns = default)\n        {\n            return (PropertyPatternClauseSyntaxWrapper)PropertyPatternClauseAccessor1(subpatterns);\n        }\n\n        public static PropertyPatternClauseSyntaxWrapper PropertyPatternClause(SyntaxToken openBraceToken, SeparatedSyntaxListWrapper<SubpatternSyntaxWrapper> subpatterns, SyntaxToken closeBraceToken)\n        {\n            return (PropertyPatternClauseSyntaxWrapper)PropertyPatternClauseAccessor2(openBraceToken, subpatterns, closeBraceToken);\n        }\n\n        public static TupleElementSyntaxWrapper TupleElement(TypeSyntax type)\n        {\n            return (TupleElementSyntaxWrapper)TupleElementAccessor1(type);\n        }\n\n        public static TupleElementSyntaxWrapper TupleElement(TypeSyntax type, SyntaxToken identifier)\n        {\n            return (TupleElementSyntaxWrapper)TupleElementAccessor2(type, identifier);\n        }\n\n        public static TupleExpressionSyntaxWrapper TupleExpression(SeparatedSyntaxList<ArgumentSyntax> arguments = default)\n        {\n            return (TupleExpressionSyntaxWrapper)TupleExpressionAccessor1(arguments);\n        }\n\n        public static TupleExpressionSyntaxWrapper TupleExpression(SyntaxToken openParenToken, SeparatedSyntaxList<ArgumentSyntax> arguments, SyntaxToken closeParenToken)\n        {\n            return (TupleExpressionSyntaxWrapper)TupleExpressionAccessor2(openParenToken, arguments, closeParenToken);\n        }\n\n        public static TupleTypeSyntaxWrapper TupleType(SeparatedSyntaxListWrapper<TupleElementSyntaxWrapper> elements = default)\n        {\n            return (TupleTypeSyntaxWrapper)TupleTypeAccessor1(elements);\n        }\n\n        public static TupleTypeSyntaxWrapper TupleType(SyntaxToken openParenToken, SeparatedSyntaxListWrapper<TupleElementSyntaxWrapper> elements, SyntaxToken closeParenToken)\n        {\n            return (TupleTypeSyntaxWrapper)TupleTypeAccessor2(openParenToken, elements, closeParenToken);\n        }\n\n        private static Func<T, TResult> ThrowNotSupportedOnFallback<T, TResult>(string typeName, string methodName)\n        {\n            return _ => throw new NotSupportedException($\"{typeName}.{methodName} is not supported in this version\");\n        }\n\n        private static Func<T1, T2, TResult> ThrowNotSupportedOnFallback<T1, T2, TResult>(string typeName, string methodName)\n        {\n            return (_, __) => throw new NotSupportedException($\"{typeName}.{methodName} is not supported in this version\");\n        }\n\n        private static Func<T1, T2, T3, TResult> ThrowNotSupportedOnFallback<T1, T2, T3, TResult>(string typeName, string methodName)\n        {\n            return (arg1, arg2, arg3) => throw new NotSupportedException($\"{typeName}.{methodName} is not supported in this version\");\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/SyntaxFactsEx.cs",
    "content": "﻿// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.\n// Licensed under the MIT License. See LICENSE in the project root for license information.\n\n#nullable disable\n\nnamespace StyleCop.Analyzers.Lightup\n{\n    using System;\n    using System.Linq.Expressions;\n    using System.Reflection;\n    using Microsoft.CodeAnalysis;\n    using Microsoft.CodeAnalysis.CSharp;\n\n    public static class SyntaxFactsEx\n    {\n        private static readonly Func<SyntaxNode, string> TryGetInferredMemberNameAccessor;\n        private static readonly Func<string, bool> IsReservedTupleElementNameAccessor;\n\n        static SyntaxFactsEx()\n        {\n            string FallbackAccessor(SyntaxNode syntax)\n            {\n                if (syntax == null)\n                {\n                    // Unlike an extension method which would throw ArgumentNullException here, the light-up\n                    // behavior needs to match behavior of the underlying property.\n                    throw new NullReferenceException();\n                }\n\n                return null;\n            }\n\n            var tryGetInferredMemberNameMethod = typeof(SyntaxFacts).GetTypeInfo().GetDeclaredMethod(nameof(TryGetInferredMemberName));\n            if (tryGetInferredMemberNameMethod is object)\n            {\n                var syntaxParameter = Expression.Parameter(typeof(SyntaxNode), \"syntax\");\n                Expression<Func<SyntaxNode, string>> expression =\n                    Expression.Lambda<Func<SyntaxNode, string>>(\n                        Expression.Call(tryGetInferredMemberNameMethod, syntaxParameter),\n                        syntaxParameter);\n                TryGetInferredMemberNameAccessor = expression.Compile();\n            }\n            else\n            {\n                TryGetInferredMemberNameAccessor = FallbackAccessor;\n            }\n\n            var isReservedTupleElementNameMethod = typeof(SyntaxFacts).GetTypeInfo().GetDeclaredMethod(nameof(IsReservedTupleElementName));\n            if (isReservedTupleElementNameMethod is object)\n            {\n                var elementNameParameter = Expression.Parameter(typeof(string), \"elementName\");\n                Expression<Func<string, bool>> expression =\n                    Expression.Lambda<Func<string, bool>>(\n                        Expression.Call(isReservedTupleElementNameMethod, elementNameParameter),\n                        elementNameParameter);\n                IsReservedTupleElementNameAccessor = expression.Compile();\n            }\n            else\n            {\n                IsReservedTupleElementNameAccessor = _ => false;\n            }\n        }\n\n        public static string TryGetInferredMemberName(this SyntaxNode syntax)\n        {\n            return TryGetInferredMemberNameAccessor(syntax);\n        }\n\n        public static bool IsReservedTupleElementName(string elementName)\n        {\n            return IsReservedTupleElementNameAccessor(elementName);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/SyntaxWrapper`1.cs",
    "content": "﻿// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.\n// Licensed under the MIT License. See LICENSE in the project root for license information.\n\n#nullable disable\n\nnamespace StyleCop.Analyzers.Lightup\n{\n    using System;\n    using System.Linq;\n    using System.Linq.Expressions;\n    using System.Reflection;\n    using Microsoft.CodeAnalysis;\n\n    public abstract class SyntaxWrapper<TNode>\n    {\n        public static SyntaxWrapper<TNode> Default { get; } = FindDefaultSyntaxWrapper();\n\n        public abstract TNode Wrap(SyntaxNode node);\n\n        public abstract SyntaxNode Unwrap(TNode node);\n\n        private static SyntaxWrapper<TNode> FindDefaultSyntaxWrapper()\n        {\n            if (typeof(SyntaxNode).GetTypeInfo().IsAssignableFrom(typeof(TNode).GetTypeInfo()))\n            {\n                return new DirectCastSyntaxWrapper();\n            }\n\n            return new ConversionSyntaxWrapper();\n        }\n\n        private sealed class DirectCastSyntaxWrapper : SyntaxWrapper<TNode>\n        {\n            public override SyntaxNode Unwrap(TNode node)\n            {\n                return (SyntaxNode)(object)node;\n            }\n\n            public override TNode Wrap(SyntaxNode node)\n            {\n                return (TNode)(object)node;\n            }\n        }\n\n        private sealed class ConversionSyntaxWrapper : SyntaxWrapper<TNode>\n        {\n            private readonly Func<TNode, SyntaxNode> unwrapAccessor;\n            private readonly Func<SyntaxNode, TNode> wrapAccessor;\n\n            public ConversionSyntaxWrapper()\n            {\n                this.unwrapAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TNode, SyntaxNode>(typeof(TNode), nameof(ISyntaxWrapper<SyntaxNode>.SyntaxNode));\n\n                var explicitOperator = typeof(TNode).GetTypeInfo().GetDeclaredMethods(\"op_Explicit\")\n                    .Single(m => m.ReturnType == typeof(TNode) && m.GetParameters()[0].ParameterType == typeof(SyntaxNode));\n                var syntaxParameter = Expression.Parameter(typeof(SyntaxNode), \"syntax\");\n                Expression<Func<SyntaxNode, TNode>> wrapAccessorExpression =\n                    Expression.Lambda<Func<SyntaxNode, TNode>>(\n                        Expression.Call(explicitOperator, syntaxParameter),\n                        syntaxParameter);\n\n                this.wrapAccessor = wrapAccessorExpression.Compile();\n            }\n\n            public override SyntaxNode Unwrap(TNode node)\n            {\n                return this.unwrapAccessor(node);\n            }\n\n            public override TNode Wrap(SyntaxNode node)\n            {\n                return this.wrapAccessor(node);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/TryGetValueAccessor`3.cs",
    "content": "﻿// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.\n// Licensed under the MIT License. See LICENSE in the project root for license information.\n\n#nullable disable\n\nnamespace StyleCop.Analyzers.Lightup\n{\n    internal delegate bool TryGetValueAccessor<T, TKey, TValue>(T instance, TKey key, out TValue value);\n    internal delegate bool TryGetValueAccessor<T, TFirst, TSecond, TValue>(T instance, TFirst first, TSecond second, out TValue value); // Sonar\n    internal delegate bool TryGetValueAccessor<T, TFirst, TSecond, TThird, TValue>(T instance, TFirst first, TSecond second, TThird third, out TValue value); // Sonar\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/WrapperHelper.cs",
    "content": "﻿// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.\n// Licensed under the MIT License. See LICENSE in the project root for license information.\n\n#nullable disable\n\nnamespace StyleCop.Analyzers.Lightup\n{\n    using System;\n    using System.Collections.Immutable;\n    using System.Reflection;\n    using Microsoft.CodeAnalysis;\n    using Microsoft.CodeAnalysis.CSharp;\n\n    public static class WrapperHelper\n    {\n        private static readonly ImmutableDictionary<Type, Type> WrappedTypes;\n\n        static WrapperHelper()\n        {\n            var codeAnalysisAssembly = typeof(SyntaxNode).GetTypeInfo().Assembly;\n            var builder = ImmutableDictionary.CreateBuilder<Type, Type>();\n\n            builder.Add(typeof(AnalyzerConfigOptionsProviderWrapper), codeAnalysisAssembly.GetType(AnalyzerConfigOptionsProviderWrapper.WrappedTypeName));\n            builder.Add(typeof(AnalyzerConfigOptionsWrapper), codeAnalysisAssembly.GetType(AnalyzerConfigOptionsWrapper.WrappedTypeName));\n            builder.Add(typeof(CompilationOptionsWrapper), codeAnalysisAssembly.GetType(CompilationOptionsWrapper.WrappedTypeName)); // Sonar\n            builder.Add(typeof(SyntaxTreeOptionsProviderWrapper), codeAnalysisAssembly.GetType(SyntaxTreeOptionsProviderWrapper.WrappedTypeName)); // Sonar\n\n            WrappedTypes = builder.ToImmutable();\n        }\n\n        /// <summary>\n        /// Gets the type that is wrapped by the given wrapper.\n        /// </summary>\n        /// <param name = \"wrapperType\">Type of the wrapper for which the wrapped type should be retrieved.</param>\n        /// <returns>The wrapped type, or null if there is no info.</returns>\n        internal static Type GetWrappedType(Type wrapperType)\n        {\n            if (WrappedTypes.TryGetValue(wrapperType, out Type wrappedType))\n            {\n                return wrappedType;\n            }\n\n            return null;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.ShimLayer.Lightup/packages.lock.json",
    "content": "{\n  \"version\": 1,\n  \"dependencies\": {\n    \".NETStandard,Version=v2.0\": {\n      \"Microsoft.CodeAnalysis.CSharp.Workspaces\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.3.2, )\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"MwGmrrPx3okEJuCogSn4TM3yTtJUDdmTt8RXpnjVo0dPund0YSAq4bHQQ9bxgArbrrapcopJmkb7UOLAvanXkg==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp\": \"[1.3.2]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2]\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[3.3.1, )\",\n        \"resolved\": \"3.3.1\",\n        \"contentHash\": \"eT+kgNCDdTRbQ5WF6BGx1HI3D5jYfHteza/koefhWC2vNZGxObA74XxwWfg40dy3uUv7dn3OGKLK5GUPLroVog==\"\n      },\n      \"Microsoft.Composition\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.0.27, )\",\n        \"resolved\": \"1.0.27\",\n        \"contentHash\": \"pwu80Ohe7SBzZ6i69LVdzowp6V+LaVRzd5F7A6QlD42vQkX0oT7KXKWWPlM/S00w1gnMQMRnEdbtOV12z6rXdQ==\"\n      },\n      \"NETStandard.Library\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[2.0.3, )\",\n        \"resolved\": \"2.0.3\",\n        \"contentHash\": \"st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.1.0\"\n        }\n      },\n      \"SonarAnalyzer.CSharp.Styling\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[10.21.0.135717, )\",\n        \"resolved\": \"10.21.0.135717\",\n        \"contentHash\": \"hl264jF539oB7m2jED5QGM345eFSiDAdoJc8TH0HM6L7ZeqT5TDqZDQeZ8IDP02dVIpH/Fhhn+HsGfEcj8ohyQ==\"\n      },\n      \"StyleCop.Analyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.2.0-beta.556, )\",\n        \"resolved\": \"1.2.0-beta.556\",\n        \"contentHash\": \"llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==\",\n        \"dependencies\": {\n          \"StyleCop.Analyzers.Unstable\": \"1.2.0.556\"\n        }\n      },\n      \"System.Collections.Immutable\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.1.37, )\",\n        \"resolved\": \"1.1.37\",\n        \"contentHash\": \"fTpqwZYBzoklTT+XjTRK8KxvmrGkYHzBiylCcKyQcxiOM8k+QvhNBxRvFHDWzy4OEP5f8/9n+xQ9mEgEXY+muA==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.0\",\n          \"System.Diagnostics.Debug\": \"4.0.0\",\n          \"System.Globalization\": \"4.0.0\",\n          \"System.Linq\": \"4.0.0\",\n          \"System.Resources.ResourceManager\": \"4.0.0\",\n          \"System.Runtime\": \"4.0.0\",\n          \"System.Runtime.Extensions\": \"4.0.0\",\n          \"System.Threading\": \"4.0.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.1.0\",\n        \"contentHash\": \"HS3iRWZKcUw/8eZ/08GXKY2Bn7xNzQPzf8gRPHGSowX7u7XXu9i9YEaBeBNKUXWfI7qjvT2zXtLUvbN0hds8vg==\"\n      },\n      \"Microsoft.CodeAnalysis.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"lOinFNbjpCvkeYQHutjKi+CfsjoKu88wAFT6hAumSR/XJSJmmVGvmnbzCWW8kUJnDVrw1RrcqS8BzgPMj263og==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"1.1.0\",\n          \"System.AppContext\": \"4.1.0\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.Collections.Concurrent\": \"4.0.12\",\n          \"System.Collections.Immutable\": \"1.2.0\",\n          \"System.Console\": \"4.0.0\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Diagnostics.FileVersionInfo\": \"4.0.0\",\n          \"System.Diagnostics.StackTrace\": \"4.0.1\",\n          \"System.Diagnostics.Tools\": \"4.0.1\",\n          \"System.Dynamic.Runtime\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Linq.Expressions\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Metadata\": \"1.3.0\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Runtime.Numerics\": \"4.0.1\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.X509Certificates\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Text.Encoding.CodePages\": \"4.0.1\",\n          \"System.Text.Encoding.Extensions\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\",\n          \"System.Threading.Tasks.Parallel\": \"4.0.1\",\n          \"System.Threading.Thread\": \"4.0.0\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\",\n          \"System.Xml.XDocument\": \"4.0.11\",\n          \"System.Xml.XPath.XDocument\": \"4.0.1\",\n          \"System.Xml.XmlDocument\": \"4.0.1\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"GrYMp6ScZDOMR0fNn/Ce6SegNVFw1G/QRT/8FiKv7lAP+V6lEZx9e42n0FvFUgjjcKgcEJOI4muU6i+3LSvOBA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Common\": \"[1.3.2]\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Workspaces.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"kvdo+rkImlx5MuBgkayl4OV3Mg8/qirUdYgCIfQ9EqN15QasJFlQXmDAtCGqpkK9sYLLO/VK+y+4mvKjfh/FOA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Common\": \"[1.3.2]\",\n          \"Microsoft.Composition\": \"1.0.27\"\n        }\n      },\n      \"Microsoft.NETCore.Platforms\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.1.0\",\n        \"contentHash\": \"kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==\"\n      },\n      \"Microsoft.NETCore.Targets\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.1\",\n        \"contentHash\": \"rkn+fKobF/cbWfnnfBOQHKVKIOpxMZBvlSHkqDWgBpwGDcLRduvs3D9OLGeV6GWGvVwNlVi2CBbTjuPmtHvyNw==\"\n      },\n      \"runtime.native.System\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"QfS/nQI7k/BLgmLrw7qm7YBoULEvgWnPI+cYsbfCVFTW8Aj+i8JhccxcFMu1RWms0YZzF+UHguNBK4Qn89e2Sg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\"\n        }\n      },\n      \"runtime.native.System.Net.Http\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"Nh0UPZx2Vifh8r+J+H2jxifZUD3sBrmolgiFWJd2yiNrxO0xTa6bAw3YwRn1VOiSen/tUXMS31ttNItCZ6lKuA==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\"\n        }\n      },\n      \"runtime.native.System.Security.Cryptography\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"2CQK0jmO6Eu7ZeMgD+LOFbNJSXHFVQbCJJkEyEwowh1SCgYnrn9W9RykMfpeeVGw7h4IBvYikzpGUlmZTUafJw==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\"\n        }\n      },\n      \"StyleCop.Analyzers.Unstable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.2.0.556\",\n        \"contentHash\": \"zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==\"\n      },\n      \"System.AppContext\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"3QjO4jNV7PdKkmQAVp9atA+usVnKRwI3Kx1nMwJ93T0LcQfx7pKAYk0nKz5wn1oP5iqlhZuy6RXOFdhr7rDwow==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Collections\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"YUJGz6eFKqS0V//mLt25vFGrrCvOnsXjlvFQs+KimpwNxug9x0Pzy4PlFMU3Q2IzqAa9G2L4LsK3+9vCBK7oTg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Collections.Concurrent\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.12\",\n        \"contentHash\": \"2gBcbb3drMLgxlI0fBfxMA31ec6AEyYCHygGse4vxceJan8mRIWeKJ24BFzN7+bi/NFTgdIgufzb94LWO5EERQ==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Diagnostics.Tracing\": \"4.1.0\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Console\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"qSKUSOIiYA/a0g5XXdxFcUFmv1hNICBD7QZ0QhGYVipPIhvpiydY8VZqr1thmCXvmn8aipMg64zuanB4eotK9A==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\"\n        }\n      },\n      \"System.Diagnostics.Debug\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"w5U95fVKHY4G8ASs/K5iK3J5LY+/dLFd4vKejsnI/ZhBsWS9hQakfx3Zr7lRWKg4tAw9r4iktyvsTagWkqYCiw==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Diagnostics.FileVersionInfo\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"qjF74OTAU+mRhLaL4YSfiWy3vj6T3AOz8AW37l5zCwfbBfj0k7E94XnEsRaf2TnhE/7QaV6Hvqakoy2LoV8MVg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Reflection.Metadata\": \"1.3.0\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.InteropServices\": \"4.1.0\"\n        }\n      },\n      \"System.Diagnostics.StackTrace\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"6i2EbRq0lgGfiZ+FDf0gVaw9qeEU+7IS2+wbZJmFVpvVzVOgZEt0ScZtyenuBvs6iDYbGiF51bMAa0oDP/tujQ==\",\n        \"dependencies\": {\n          \"System.Collections.Immutable\": \"1.2.0\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Metadata\": \"1.3.0\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\"\n        }\n      },\n      \"System.Diagnostics.Tools\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"xBfJ8pnd4C17dWaC9FM6aShzbJcRNMChUMD42I6772KGGrqaFdumwhn9OdM68erj1ueNo3xdQ1EwiFjK5k8p0g==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Diagnostics.Tracing\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"vDN1PoMZCkkdNjvZLql592oYJZgS7URcJzJ7bxeBgGtx5UtR5leNm49VmfHGqIffX4FKacHbI3H6UyNSHQknBg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Dynamic.Runtime\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"db34f6LHYM0U0JpE+sOmjar27BnqTVkbLJhgfwMpTdgTigG/Hna3m2MYVwnFzGGKnEJk2UXFuoVTr8WUbU91/A==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Linq.Expressions\": \"4.1.0\",\n          \"System.ObjectModel\": \"4.0.12\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Emit\": \"4.0.1\",\n          \"System.Reflection.Emit.ILGeneration\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Reflection.TypeExtensions\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Globalization\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"B95h0YLEL2oSnwF/XjqSWKnwKOy/01VWkNlsCeMTFJLLabflpGV26nK164eRs5GiaRSBGpOxQ3pKoSnnyZN5pg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Globalization.Calendars\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"L1c6IqeQ88vuzC1P81JeHmHA8mxq8a18NUBNXnIY/BVb+TCyAaGIFbhpZt60h9FJNmisymoQkHEFSE9Vslja1Q==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.IO\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"3KlTJceQc3gnGIaHZ7UBZO26SHL1SHE4ddrmiwumFnId+CEHP+O8r386tZKaE6zlk5/mF8vifMBzHj9SaXN+mQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.IO.FileSystem\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"IBErlVq5jOggAD69bg1t0pJcHaDbJbWNUZTPI96fkYWzwYbN6D9wRHMULLDd9dHsl7C2YsxXL31LMfPI1SWt8w==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.IO.FileSystem.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"kWkKD203JJKxJeE74p8aF8y4Qc9r9WQx4C0cHzHPrY3fv/L/IhWnyCHaFJ3H1QPOH6A93whlQ2vG5nHlBDvzWQ==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Linq\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"bQ0iYFOQI0nuTnt+NQADns6ucV4DUvMdwN6CbkB1yj8i7arTGiTN5eok1kQwdnnNWSDZfIUySQY+J3d5KjWn0g==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\"\n        }\n      },\n      \"System.Linq.Expressions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"I+y02iqkgmCAyfbqOmSDOgqdZQ5tTj80Akm5BPSS8EeB0VGWdy6X1KCoYe8Pk6pwDoAKZUOdLVxnTJcExiv5zw==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.ObjectModel\": \"4.0.12\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Emit\": \"4.0.1\",\n          \"System.Reflection.Emit.ILGeneration\": \"4.0.1\",\n          \"System.Reflection.Emit.Lightweight\": \"4.0.1\",\n          \"System.Reflection.Extensions\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Reflection.TypeExtensions\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.ObjectModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.12\",\n        \"contentHash\": \"tAgJM1xt3ytyMoW4qn4wIqgJYm7L7TShRZG4+Q4Qsi2PCcj96pXN7nRywS9KkB3p/xDUjc2HSwP9SROyPYDYKQ==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Reflection\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"JCKANJ0TI7kzoQzuwB/OoJANy1Lg338B6+JVacPl4TpUwi3cReg3nMLplMq2uqYfHFQpKIlHAUVAJlImZz/4ng==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Emit\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"P2wqAj72fFjpP6wb9nSfDqNBMab+2ovzSDzUZK7MVIm54tBJEPr9jWfSjjoTpPwj1LeKcmX3vr0ttyjSSFM47g==\",\n        \"dependencies\": {\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Emit.ILGeneration\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Emit.ILGeneration\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"Ov6dU8Bu15Bc7zuqttgHF12J5lwSWyTf1S+FJouUXVMSqImLZzYaQ+vRr1rQ0OZ0HqsrwWl4dsKHELckQkVpgA==\",\n        \"dependencies\": {\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Emit.Lightweight\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"sSzHHXueZ5Uh0OLpUQprhr+ZYJrLPA2Cmr4gn0wj9+FftNKXx8RIMKvO9qnjk2ebPYUjZ+F2ulGdPOsvj+MEjA==\",\n        \"dependencies\": {\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Emit.ILGeneration\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"GYrtRsZcMuHF3sbmRHfMYpvxZoIN2bQGrYGerUiWLEkqdEUQZhH3TRSaC/oI4wO0II1RKBPlpIa1TOMxIcOOzQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Metadata\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.0\",\n        \"contentHash\": \"jMSCxA4LSyKBGRDm/WtfkO03FkcgRzHxwvQRib1bm2GZ8ifKM1MX1al6breGCEQK280mdl9uQS7JNPXRYk90jw==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Collections.Immutable\": \"1.2.0\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Extensions\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Text.Encoding.Extensions\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Reflection.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"4inTox4wTBaDhB7V3mPvp9XlCbeGYWVEM9/fXALd52vNEAVisc1BoVWQPuUuD0Ga//dNbA/WeMy9u9mzLxGTHQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.TypeExtensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"tsQ/ptQ3H5FYfON8lL4MxRk/8kFyE0A+tGPXmVP967cT/gzLHYxIejIYSxp4JmIeFHVP78g/F2FE1mUUTbDtrg==\",\n        \"dependencies\": {\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Resources.ResourceManager\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"TxwVeUNoTgUOdQ09gfTjvW411MF+w9MBYL7AtNVc+HtBCFlutPLhUCdZjNkjbhj3bNQWMdHboF0KIWEOjJssbA==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Runtime\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"v6c/4Yaa9uWsq+JMhnOFewrYkgdNHNG2eMKuNqRn8P733rNXeRCGvV5FkkjBXn2dbVkPXOsO0xjsEeM1q2zC0g==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\"\n        }\n      },\n      \"System.Runtime.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"CUOHjTT/vgP0qGW22U4/hDlOqXmcPq5YicBaXdUR2UiUoLwBT+olO6we4DVbq57jeX5uXH2uerVZhf0qGj+sVQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Runtime.Handles\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"nCJvEKguXEvk2ymk1gqj625vVnlK3/xdGzx0vOKicQkoquaTBJTP13AIYkocSUwHCLNBwUbXTqTWGDxBTWpt7g==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Runtime.InteropServices\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"16eu3kjHS633yYdkjwShDHZLRNMKVi/s0bY8ODiqJ2RfMhDMAwxZaUaWVnZ2P71kr/or+X9o/xFWtNqz8ivieQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\"\n        }\n      },\n      \"System.Runtime.Numerics\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"+XbKFuzdmLP3d1o9pdHu2nxjNr2OEPqGzKeegPLCUMM71a0t50A/rOcIRmGs9wR7a8KuHX6hYs/7/TymIGLNqg==\",\n        \"dependencies\": {\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\"\n        }\n      },\n      \"System.Security.Cryptography.Algorithms\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.2.0\",\n        \"contentHash\": \"8JQFxbLVdrtIOKMDN38Fn0GWnqYZw/oMlwOUG/qz1jqChvyZlnUmu+0s7wLx7JYua/nAXoESpHA3iw11QFWhXg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Runtime.Numerics\": \"4.0.1\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"runtime.native.System.Security.Cryptography\": \"4.0.0\"\n        }\n      },\n      \"System.Security.Cryptography.Cng\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.2.0\",\n        \"contentHash\": \"cUJ2h+ZvONDe28Szw3st5dOHdjndhJzQ2WObDEXAWRPEQBtVItVoxbXM/OEsTthl3cNn2dk2k0I3y45igCQcLw==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\"\n        }\n      },\n      \"System.Security.Cryptography.Csp\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"/i1Usuo4PgAqgbPNC0NjbO3jPW//BoBlTpcWFD1EHVbidH21y4c1ap5bbEMSGAXjAShhMH4abi/K8fILrnu4BQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Security.Cryptography.Encoding\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"FbKgE5MbxSQMPcSVRgwM6bXN3GtyAh04NkV8E5zKCBE26X0vYW0UtTa2FIgkH33WVqBVxRgxljlVYumWtU+HcQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.Collections.Concurrent\": \"4.0.12\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"runtime.native.System.Security.Cryptography\": \"4.0.0\"\n        }\n      },\n      \"System.Security.Cryptography.OpenSsl\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"HUG/zNUJwEiLkoURDixzkzZdB5yGA5pQhDP93ArOpDPQMteURIGERRNzzoJlmTreLBWr5lkFSjjMSk8ySEpQMw==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Runtime.Numerics\": \"4.0.1\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"runtime.native.System.Security.Cryptography\": \"4.0.0\"\n        }\n      },\n      \"System.Security.Cryptography.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"Wkd7QryWYjkQclX0bngpntW5HSlMzeJU24UaLJQ7YTfI8ydAVAaU2J+HXLLABOVJlKTVvAeL0Aj39VeTe7L+oA==\",\n        \"dependencies\": {\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Security.Cryptography.X509Certificates\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"4HEfsQIKAhA1+ApNn729Gi09zh+lYWwyIuViihoMDWp1vQnEkL2ct7mAbhBlLYm+x/L4Rr/pyGge1lIY635e0w==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Globalization.Calendars\": \"4.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Runtime.Numerics\": \"4.0.1\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Cng\": \"4.2.0\",\n          \"System.Security.Cryptography.Csp\": \"4.0.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.OpenSsl\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\",\n          \"runtime.native.System\": \"4.0.0\",\n          \"runtime.native.System.Net.Http\": \"4.0.1\",\n          \"runtime.native.System.Security.Cryptography\": \"4.0.0\"\n        }\n      },\n      \"System.Text.Encoding\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"U3gGeMlDZXxCEiY4DwVLSacg+DFWCvoiX+JThA/rvw37Sqrku7sEFeVBBBMBnfB6FeZHsyDx85HlKL19x0HtZA==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Text.Encoding.CodePages\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"h4z6rrA/hxWf4655D18IIZ0eaLRa3tQC/j+e26W+VinIHY0l07iEXaAvO0YSYq3MvCjMYy8Zs5AdC1sxNQOB7Q==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Text.Encoding.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"jtbiTDtvfLYgXn8PTfWI+SiBs51rrmO4AAckx4KR6vFK9Wzf6tI8kcRdsYQNwriUeQ1+CtQbM1W4cMbLXnj/OQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\"\n        }\n      },\n      \"System.Text.RegularExpressions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"i88YCXpRTjCnoSQZtdlHkAOx4KNNik4hMy83n0+Ftlb7jvV6ZiZWMpnEZHhjBp6hQVh8gWd/iKNPzlPF7iyA2g==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Threading\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"N+3xqIcg3VDKyjwwCGaZ9HawG9aC6cSDI+s7ROma310GQo8vilFZa86hqKppwTHleR/G0sfOzhvgnUxWCR/DrQ==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Threading.Tasks\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"k1S4Gc6IGwtHGT8188RSeGaX86Qw/wnrgNLshJvsdNUOPP9etMmo8S07c+UlOAx4K/xLuN9ivA1bD0LVurtIxQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Threading.Tasks.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"pH4FZDsZQ/WmgJtN4LWYmRdJAEeVkyriSwrv2Teoe5FOU0Yxlb6II6GL8dBPOfRmutHGATduj3ooMt7dJ2+i+w==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Threading.Tasks.Parallel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"7Pc9t25bcynT9FpMvkUw4ZjYwUiGup/5cJFW72/5MgCG+np2cfVUMdh29u8d7onxX7d8PS3J+wL73zQRqkdrSA==\",\n        \"dependencies\": {\n          \"System.Collections.Concurrent\": \"4.0.12\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Diagnostics.Tracing\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Threading.Thread\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"gIdJqDXlOr5W9zeqFErLw3dsOsiShSCYtF9SEHitACycmvNvY8odf9kiKvp6V7aibc8C4HzzNBkWXjyfn7plbQ==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Xml.ReaderWriter\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"ZIiLPsf67YZ9zgr31vzrFaYQqxRPX9cVHjtPSnmx4eN6lbS/yEyYNr2vs1doGDEscF0tjCZFsk9yUg1sC9e8tg==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Text.Encoding.Extensions\": \"4.0.11\",\n          \"System.Text.RegularExpressions\": \"4.1.0\",\n          \"System.Threading.Tasks\": \"4.0.11\",\n          \"System.Threading.Tasks.Extensions\": \"4.0.0\"\n        }\n      },\n      \"System.Xml.XDocument\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"Mk2mKmPi0nWaoiYeotq1dgeNK1fqWh61+EK+w4Wu8SWuTYLzpUnschb59bJtGywaPq7SmTuPf44wrXRwbIrukg==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Diagnostics.Tools\": \"4.0.1\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\"\n        }\n      },\n      \"System.Xml.XmlDocument\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"2eZu6IP+etFVBBFUFzw2w6J21DqIN5eL9Y8r8JfJWUmV28Z5P0SNU01oCisVHQgHsDhHPnmq2s1hJrJCFZWloQ==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\"\n        }\n      },\n      \"System.Xml.XPath\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"UWd1H+1IJ9Wlq5nognZ/XJdyj8qPE4XufBUkAW59ijsCPjZkZe0MUzKKJFBr+ZWBe5Wq1u1d5f2CYgE93uH7DA==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\"\n        }\n      },\n      \"System.Xml.XPath.XDocument\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"FLhdYJx4331oGovQypQ8JIw2kEmNzCsjVOVYY/16kZTUoquZG85oVn7yUhBE2OZt1yGPSXAL0HTEfzjlbNpM7Q==\",\n        \"dependencies\": {\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\",\n          \"System.Xml.XDocument\": \"4.0.11\",\n          \"System.Xml.XPath\": \"4.0.1\"\n        }\n      },\n      \"sonaranalyzer.shimlayer\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.SourceGenerators/RuleCatalogGenerator.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Diagnostics.CodeAnalysis;\nusing System.IO;\nusing System.Net;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing Newtonsoft.Json.Linq;\n\nnamespace SonarAnalyzer.SourceGenerators;\n\n[Generator]\n[ExcludeFromCodeCoverage]\npublic class RuleCatalogGenerator : IIncrementalGenerator\n{\n    private static readonly TimeSpan RegexTimeout = TimeSpan.FromMilliseconds(200);\n    private static readonly Regex HtmlTagRegex = new(\"<[^>]*>\", RegexOptions.None, RegexTimeout);\n    private static readonly Regex MultipleWhitespaceRegex = new(@\"\\s{2,}\", RegexOptions.None, RegexTimeout);\n\n    public void Initialize(IncrementalGeneratorInitializationContext context)\n    {\n        // IIncrementalGenerator transformers should return types with value equality or use a custom comparer via WithComparer to avoid performance issues.\n        // This implementation doesn't do it because it would make the implementation much more complex and performance is not a concern for this generator.\n        var jsonFiles = RspecFiles(context, \"json\");\n        var htmlFiles = RspecFiles(context, \"html\");\n        var qualityProfile = RspecFiles(context, \"qualityprofile\").Collect().Select((x, ct) => CancelableExecute(() => ParseSonarWay(x.Single().GetText().ToString()), ct));\n        var filePair = jsonFiles.Combine(htmlFiles.Collect())\n            .Select((x, ct) => CancelableExecute(() => (Json: x.Left, Html: x.Right.Single(html => html.Path == Path.ChangeExtension(x.Left.Path, \".html\"))), ct));\n        var ruleDescriptorArguments = filePair.Combine(qualityProfile).Select((x, ct) => CancelableExecute(() => RuleDescriptorArguments(x.Left.Json, x.Left.Html, x.Right), ct)).Collect();\n        var rootNamespace = context.AnalyzerConfigOptionsProvider\n            .Select((x, ct) => CancelableExecute(() => x.GlobalOptions.TryGetValue(\"build_property.rootnamespace\", out var rootNamespace) ? rootNamespace : null, ct));\n        var source = ruleDescriptorArguments.Combine(rootNamespace).Select((x, ct) => CancelableExecute(() => GenerateSource(x.Right, x.Left), ct));\n\n        context.RegisterSourceOutput(source, (context, source) => context.AddSource(\"RuleCatalog.g.cs\", source));\n    }\n\n    private static T CancelableExecute<T>(Func<T> func, CancellationToken ct)\n    {\n        if (ct.IsCancellationRequested)\n        {\n            return default;\n        }\n        return func();\n    }\n\n    private static IncrementalValuesProvider<AdditionalText> RspecFiles(IncrementalGeneratorInitializationContext context, string fileType) =>\n        context.AdditionalTextsProvider\n            .Combine(context.AnalyzerConfigOptionsProvider)\n            .Where(x => x.Right.GetOptions(x.Left).TryGetValue(\"build_metadata.AdditionalFiles.RspecFile\", out var value) && value == fileType)\n            .Select((x, _) => x.Left);\n\n    private static string[] RuleDescriptorArguments(AdditionalText jsonFile, AdditionalText htmlFile, ImmutableHashSet<string> sonarWay)\n    {\n        var json = JObject.Parse(jsonFile.GetText().ToString());\n        var id = Path.GetFileNameWithoutExtension(jsonFile.Path);\n        var html = htmlFile.GetText().ToString();\n        return\n        [\n            Encode(id),\n            Encode(json.Value<string>(\"title\")),\n            Encode(json.Value<string>(\"type\")),\n            Encode(json.Value<string>(\"defaultSeverity\")),\n            Encode(json.Value<string>(\"status\")),\n            $\"SourceScope.{json.Value<string>(\"scope\")}\",\n            sonarWay.Contains(id).ToString().ToLower(),\n            Encode(FirstParagraphText(id, html))\n        ];\n    }\n\n    private static string GenerateSource(string namespacePrefix, ImmutableArray<string[]> rulesArguments)\n    {\n        var sb = new StringBuilder();\n        sb.AppendLine($$\"\"\"\n            // <auto-generated/>\n\n            namespace {{namespacePrefix}}.Rspec;\n\n            public static class RuleCatalog\n            {\n                public static Dictionary<string, RuleDescriptor> Rules { get; } = new()\n                {\n            \"\"\");\n        foreach (var arguments in rulesArguments)\n        {\n            sb.AppendLine($@\"        {{ {arguments[0]}, new({string.Join(\", \", arguments)}) }},\");\n        }\n        sb.AppendLine(\"\"\"\n                };\n            }\n            \"\"\");\n        return sb.ToString();\n    }\n\n    private static string Encode(string value) =>\n        $@\"@\"\"{value.Replace(@\"\"\"\", @\"\"\"\"\"\")}\"\"\";\n\n    private static string FirstParagraphText(string id, string html)\n    {\n        var startIndex = html.IndexOf(\"<p>\");\n        if (startIndex >= 0)\n        {\n            startIndex += 3; // end of <p>\n            var endIndex = html.IndexOf(\"</p>\", startIndex);\n            var text = html.Substring(startIndex, endIndex - startIndex);\n            text = HtmlTagRegex.Replace(text, string.Empty);\n            text = text.Replace(\"\\n\", \" \").Replace(\"\\r\", \" \");\n            text = MultipleWhitespaceRegex.Replace(text, \" \");\n            return WebUtility.HtmlDecode(text);\n        }\n        else\n        {\n            throw new NotSupportedException($\"Description of rule {id} does not contain any HTML <p>paragraphs</p>.\");\n        }\n    }\n\n    private static ImmutableHashSet<string> ParseSonarWay(string json) =>\n        JObject.Parse(json)[\"ruleKeys\"].Values<string>().ToImmutableHashSet();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.SourceGenerators/SonarAnalyzer.SourceGenerators.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFramework>netstandard2.0</TargetFramework>\n    <!-- The scanner removes all the analyzers that have the \"SonarAnalyzer\" prefix -->\n    <AssemblyName>Internal.SonarAnalyzer.SourceGenerators</AssemblyName>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Microsoft.CodeAnalysis.CSharp\" Version=\"5.0.0\" PrivateAssets=\"all\" />\n    <PackageReference Include=\"Newtonsoft.Json\" Version=\"13.0.4\" GeneratePathProperty=\"true\" PrivateAssets=\"all\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Using Include=\"Microsoft.CodeAnalysis\"/>\n    <Using Include=\"Microsoft.CodeAnalysis.Diagnostics\"/>\n  </ItemGroup>\n\n  <PropertyGroup>\n    <GetTargetPathDependsOn>$(GetTargetPathDependsOn);GetDependencyTargetPaths</GetTargetPathDependsOn>\n  </PropertyGroup>\n\n  <Target Name=\"GetDependencyTargetPaths\">\n    <!-- This is needed for the analyzer dependencies to work -->\n    <ItemGroup>\n      <TargetPathWithTargetPlatformMoniker Include=\"$(PKGNewtonsoft_Json)\\lib\\netstandard2.0\\Newtonsoft.Json.dll\" IncludeRuntimeDependency=\"false\" />\n    </ItemGroup>\n  </Target>\n\n</Project>\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.SourceGenerators/packages.lock.json",
    "content": "{\n  \"version\": 1,\n  \"dependencies\": {\n    \".NETStandard,Version=v2.0\": {\n      \"Microsoft.CodeAnalysis.CSharp\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[5.0.0, )\",\n        \"resolved\": \"5.0.0\",\n        \"contentHash\": \"5DSyJ9bk+ATuDy7fp2Zt0mJStDVKbBoiz1DyfAwSa+k4H4IwykAUcV3URelw5b8/iVbfSaOwkwmPUZH6opZKCw==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"3.11.0\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.0.0]\",\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Memory\": \"4.6.0\",\n          \"System.Numerics.Vectors\": \"4.6.0\",\n          \"System.Reflection.Metadata\": \"9.0.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\",\n          \"System.Text.Encoding.CodePages\": \"8.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.6.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[3.3.1, )\",\n        \"resolved\": \"3.3.1\",\n        \"contentHash\": \"eT+kgNCDdTRbQ5WF6BGx1HI3D5jYfHteza/koefhWC2vNZGxObA74XxwWfg40dy3uUv7dn3OGKLK5GUPLroVog==\"\n      },\n      \"NETStandard.Library\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[2.0.3, )\",\n        \"resolved\": \"2.0.3\",\n        \"contentHash\": \"st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.1.0\"\n        }\n      },\n      \"Newtonsoft.Json\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[13.0.4, )\",\n        \"resolved\": \"13.0.4\",\n        \"contentHash\": \"pdgNNMai3zv51W5aq268sujXUyx7SNdE2bj1wZcWjAQrKMFZV260lbqYop1d2GM67JI1huLRwxo9ZqnfF/lC6A==\"\n      },\n      \"SonarAnalyzer.CSharp.Styling\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[10.21.0.135717, )\",\n        \"resolved\": \"10.21.0.135717\",\n        \"contentHash\": \"hl264jF539oB7m2jED5QGM345eFSiDAdoJc8TH0HM6L7ZeqT5TDqZDQeZ8IDP02dVIpH/Fhhn+HsGfEcj8ohyQ==\"\n      },\n      \"StyleCop.Analyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.2.0-beta.556, )\",\n        \"resolved\": \"1.2.0-beta.556\",\n        \"contentHash\": \"llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==\",\n        \"dependencies\": {\n          \"StyleCop.Analyzers.Unstable\": \"1.2.0.556\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"3.11.0\",\n        \"contentHash\": \"v/EW3UE8/lbEYHoC2Qq7AR/DnmvpgdtAMndfQNmpuIMx/Mto8L5JnuCfdBYtgvalQOtfNCnxFejxuRrryvUTsg==\"\n      },\n      \"Microsoft.CodeAnalysis.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.0.0\",\n        \"contentHash\": \"ZXRAdvH6GiDeHRyd3q/km8Z44RoM6FBWHd+gen/la81mVnAdHTEsEkO5J0TCNXBymAcx5UYKt5TvgKBhaLJEow==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"3.11.0\",\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Memory\": \"4.6.0\",\n          \"System.Numerics.Vectors\": \"4.6.0\",\n          \"System.Reflection.Metadata\": \"9.0.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\",\n          \"System.Text.Encoding.CodePages\": \"8.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.6.0\"\n        }\n      },\n      \"Microsoft.NETCore.Platforms\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.1.0\",\n        \"contentHash\": \"kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==\"\n      },\n      \"StyleCop.Analyzers.Unstable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.2.0.556\",\n        \"contentHash\": \"zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==\"\n      },\n      \"System.Buffers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.6.0\",\n        \"contentHash\": \"lN6tZi7Q46zFzAbRYXTIvfXcyvQQgxnY7Xm6C6xQ9784dEL1amjM6S6Iw4ZpsvesAKnRVsM4scrDQaDqSClkjA==\"\n      },\n      \"System.Collections.Immutable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"QhkXUl2gNrQtvPmtBTQHb0YsUrDiDQ2QS09YbtTTiSjGcf7NBqtYbrG/BE06zcBPCKEwQGzIv13IVdXNOSub2w==\",\n        \"dependencies\": {\n          \"System.Memory\": \"4.5.5\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.0.0\"\n        }\n      },\n      \"System.Memory\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.6.0\",\n        \"contentHash\": \"OEkbBQoklHngJ8UD8ez2AERSk2g+/qpAaSWWCBFbpH727HxDq5ydVkuncBaKcKfwRqXGWx64dS6G1SUScMsitg==\",\n        \"dependencies\": {\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Numerics.Vectors\": \"4.6.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\"\n        }\n      },\n      \"System.Numerics.Vectors\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.6.0\",\n        \"contentHash\": \"t+SoieZsRuEyiw/J+qXUbolyO219tKQQI0+2/YI+Qv7YdGValA6WiuokrNKqjrTNsy5ABWU11bdKOzUdheteXg==\"\n      },\n      \"System.Reflection.Metadata\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"ANiqLu3DxW9kol/hMmTWbt3414t9ftdIuiIU7j80okq2YzAueo120M442xk1kDJWtmZTqWQn7wHDvMRipVOEOQ==\",\n        \"dependencies\": {\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Memory\": \"4.5.5\"\n        }\n      },\n      \"System.Runtime.CompilerServices.Unsafe\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.1.0\",\n        \"contentHash\": \"5o/HZxx6RVqYlhKSq8/zronDkALJZUT2Vz0hx43f0gwe8mwlM0y2nYlqdBwLMzr262Bwvpikeb/yEwkAa5PADg==\"\n      },\n      \"System.Text.Encoding.CodePages\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"OZIsVplFGaVY90G2SbpgU7EnCoOO5pw1t4ic21dBF3/1omrJFpAGoNAVpPyMVOC90/hvgkGG3VFqR13YgZMQfg==\",\n        \"dependencies\": {\n          \"System.Memory\": \"4.5.5\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.0.0\"\n        }\n      },\n      \"System.Threading.Tasks.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.6.0\",\n        \"contentHash\": \"I5G6Y8jb0xRtGUC9Lahy7FUvlYlnGMMkbuKAQBy8Jb7Y6Yn8OlBEiUOY0PqZ0hy6Ua8poVA1ui1tAIiXNxGdsg==\",\n        \"dependencies\": {\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\"\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Metrics/VisualBasicCognitiveComplexityMetric.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Metrics;\n\nnamespace SonarAnalyzer.VisualBasic.Metrics;\n\npublic static class VisualBasicCognitiveComplexityMetric\n{\n    public static CognitiveComplexity GetComplexity(SyntaxNode node)\n    {\n        var walker = new CognitiveWalker();\n        walker.SafeVisit(node);\n\n        return new CognitiveComplexity(walker.State.Complexity, walker.State.IncrementLocations.ToImmutableArray());\n    }\n\n    private class CognitiveWalker : SafeVisualBasicSyntaxWalker\n    {\n        public CognitiveComplexityWalkerState<MethodStatementSyntax> State { get; } = new();\n\n        public override void VisitBinaryConditionalExpression(BinaryConditionalExpressionSyntax node)\n        {\n            State.IncreaseComplexityByNestingPlusOne(node.IfKeyword);\n            State.VisitWithNesting(node, base.VisitBinaryConditionalExpression);\n        }\n\n        public override void VisitBinaryExpression(BinaryExpressionSyntax node)\n        {\n            var nodeKind = node.Kind();\n            if (!State.LogicalOperationsToIgnore.Contains(node)\n                && (nodeKind == SyntaxKind.AndExpression\n                    || nodeKind == SyntaxKind.AndAlsoExpression\n                    || nodeKind == SyntaxKind.OrExpression\n                    || nodeKind == SyntaxKind.OrElseExpression))\n            {\n                var left = node.Left.RemoveParentheses();\n                if (!left.IsKind(nodeKind))\n                {\n                    State.IncreaseComplexityByOne(node.OperatorToken);\n                }\n\n                var right = node.Right.RemoveParentheses();\n                if (right.IsKind(nodeKind))\n                {\n                    State.LogicalOperationsToIgnore.Add(right);\n                }\n            }\n\n            base.VisitBinaryExpression(node);\n        }\n\n        public override void VisitCatchBlock(CatchBlockSyntax node)\n        {\n            State.IncreaseComplexityByNestingPlusOne(node.CatchStatement.CatchKeyword);\n            State.VisitWithNesting(node, base.VisitCatchBlock);\n        }\n\n        public override void VisitDoLoopBlock(DoLoopBlockSyntax node)\n        {\n            State.IncreaseComplexityByNestingPlusOne(node.DoStatement.DoKeyword);\n            State.VisitWithNesting(node, base.VisitDoLoopBlock);\n        }\n\n        public override void VisitElseIfStatement(ElseIfStatementSyntax node)\n        {\n            State.IncreaseComplexityByOne(node.ElseIfKeyword);\n            base.VisitElseIfStatement(node);\n        }\n\n        public override void VisitElseStatement(ElseStatementSyntax node)\n        {\n            State.IncreaseComplexityByOne(node.ElseKeyword);\n            base.VisitElseStatement(node);\n        }\n\n        public override void VisitForEachBlock(ForEachBlockSyntax node)\n        {\n            State.IncreaseComplexityByNestingPlusOne(node.ForEachStatement.ForKeyword);\n            State.VisitWithNesting(node, base.VisitForEachBlock);\n        }\n\n        public override void VisitForBlock(ForBlockSyntax node)\n        {\n            State.IncreaseComplexityByNestingPlusOne(node.ForStatement.ForKeyword);\n            State.VisitWithNesting(node, base.VisitForBlock);\n        }\n\n        public override void VisitGoToStatement(GoToStatementSyntax node)\n        {\n            State.IncreaseComplexityByNestingPlusOne(node.GoToKeyword);\n            base.VisitGoToStatement(node);\n        }\n\n        public override void VisitInvocationExpression(InvocationExpressionSyntax node)\n        {\n            if (node.Expression == null\n                || node.ArgumentList == null\n                || State.CurrentMethod == null\n                || node.ArgumentList.Arguments.Count != State.CurrentMethod.ParameterList?.Parameters.Count)\n            {\n                return;\n            }\n            State.HasDirectRecursiveCall = string.Equals(GetIdentifierName(node.Expression), State.CurrentMethod.Identifier.ValueText, StringComparison.Ordinal);\n            base.VisitInvocationExpression(node);\n\n            static string GetIdentifierName(ExpressionSyntax expression)\n            {\n                if (expression.IsKind(SyntaxKind.IdentifierName))\n                {\n                    return (expression as IdentifierNameSyntax).Identifier.ValueText;\n                }\n                else if (expression.IsKind(SyntaxKind.SimpleMemberAccessExpression))\n                {\n                    return (expression as MemberAccessExpressionSyntax).Name.Identifier.ValueText;\n                }\n                else\n                {\n                    return string.Empty;\n                }\n            }\n        }\n\n        public override void VisitMethodBlock(MethodBlockSyntax node)\n        {\n            State.CurrentMethod = node.SubOrFunctionStatement;\n            base.VisitMethodBlock(node);\n\n            if (State.HasDirectRecursiveCall)\n            {\n                State.HasDirectRecursiveCall = false;\n                State.IncreaseComplexity(node.SubOrFunctionStatement.Identifier, 1, \"+1 (recursion)\");\n            }\n        }\n\n        public override void VisitMultiLineIfBlock(MultiLineIfBlockSyntax node)\n        {\n            State.IncreaseComplexityByNestingPlusOne(node.IfStatement.IfKeyword);\n            State.VisitWithNesting(node, base.VisitMultiLineIfBlock);\n        }\n\n        public override void VisitMultiLineLambdaExpression(MultiLineLambdaExpressionSyntax node) =>\n            State.VisitWithNesting(node, base.VisitMultiLineLambdaExpression);\n\n        public override void VisitSelectBlock(SelectBlockSyntax node)\n        {\n            State.IncreaseComplexityByNestingPlusOne(node.SelectStatement.SelectKeyword);\n            State.VisitWithNesting(node, base.VisitSelectBlock);\n        }\n\n        public override void VisitSingleLineIfStatement(SingleLineIfStatementSyntax node)\n        {\n            State.IncreaseComplexityByNestingPlusOne(node.IfKeyword);\n            State.VisitWithNesting(node, base.VisitSingleLineIfStatement);\n        }\n\n        public override void VisitSingleLineLambdaExpression(SingleLineLambdaExpressionSyntax node) =>\n            State.VisitWithNesting(node, base.VisitSingleLineLambdaExpression);\n\n        public override void VisitTernaryConditionalExpression(TernaryConditionalExpressionSyntax node)\n        {\n            State.IncreaseComplexityByNestingPlusOne(node.IfKeyword);\n            State.VisitWithNesting(node, base.VisitTernaryConditionalExpression);\n        }\n\n        public override void VisitWhileBlock(WhileBlockSyntax node)\n        {\n            State.IncreaseComplexityByNestingPlusOne(node.WhileStatement.WhileKeyword);\n            State.VisitWithNesting(node, base.VisitWhileBlock);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Metrics/VisualBasicExecutableLinesMetric.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Metrics;\n\npublic static class VisualBasicExecutableLinesMetric\n{\n    public static ImmutableArray<int> GetLineNumbers(SyntaxTree syntaxTree, SemanticModel semanticModel)\n    {\n        var walker = new ExecutableLinesWalker(semanticModel);\n        walker.SafeVisit(syntaxTree.GetRoot());\n\n        return walker.ExecutableLines.ToImmutableArray();\n    }\n\n    private class ExecutableLinesWalker : SafeVisualBasicSyntaxWalker\n    {\n        private readonly HashSet<int> executableLineNumbers = new();\n        private readonly SemanticModel semanticModel;\n\n        public ExecutableLinesWalker(SemanticModel semanticModel)\n        {\n            this.semanticModel = semanticModel;\n        }\n\n        public ICollection<int> ExecutableLines => this.executableLineNumbers;\n\n        public override void DefaultVisit(SyntaxNode node)\n        {\n            if (FindExecutableLines(node))\n            {\n                base.DefaultVisit(node);\n            }\n        }\n\n        private static bool HasExcludedAttribute(AttributeSyntax attribute)\n        {\n            var attributeName = attribute?.Name?.ToString() ?? string.Empty;\n\n            // Check the attribute name without the attribute suffix OR the full name of the attribute\n            var excludeCoverageName = KnownType.System_Diagnostics_CodeAnalysis_ExcludeFromCodeCoverageAttribute.TypeName;\n            return attributeName.EndsWith(excludeCoverageName.Substring(0, excludeCoverageName.Length - 9), StringComparison.Ordinal)\n                || attributeName.EndsWith(excludeCoverageName, StringComparison.Ordinal);\n        }\n\n        private bool FindExecutableLines(SyntaxNode node)\n        {\n            switch (node.Kind())\n            {\n                // The following C# constructs have no equivalent in VB.NET:\n                // - checked\n                // - unchecked\n                // - fixed\n                // - unsafe\n\n                case SyntaxKind.AttributeList:\n                    return false;\n\n                case SyntaxKind.SyncLockStatement:\n                case SyntaxKind.UsingStatement:\n\n                case SyntaxKind.EmptyStatement:\n                case SyntaxKind.ExpressionStatement:\n                case SyntaxKind.SimpleAssignmentStatement:\n\n                case SyntaxKind.DoUntilStatement:\n                case SyntaxKind.DoWhileStatement:\n                case SyntaxKind.ForEachStatement:\n                case SyntaxKind.ForStatement:\n                case SyntaxKind.WhileStatement:\n\n                case SyntaxKind.IfStatement:\n                case SyntaxKind.ElseIfStatement:\n                case SyntaxKind.LabelStatement:\n                case SyntaxKind.SelectStatement:\n                case SyntaxKind.ConditionalAccessExpression:\n                case SyntaxKind.BinaryConditionalExpression:\n                case SyntaxKind.TernaryConditionalExpression:\n\n                case SyntaxKind.GoToStatement:\n                case SyntaxKind.ThrowStatement:\n                case SyntaxKind.ReturnStatement:\n                case SyntaxKind.ExitDoStatement:\n                case SyntaxKind.ExitForStatement:\n                case SyntaxKind.ExitFunctionStatement:\n                case SyntaxKind.ExitOperatorStatement:\n                case SyntaxKind.ExitPropertyStatement:\n                case SyntaxKind.ExitSelectStatement:\n                case SyntaxKind.ExitSubStatement:\n                case SyntaxKind.ExitTryStatement:\n                case SyntaxKind.ExitWhileStatement:\n                case SyntaxKind.ContinueDoStatement:\n                case SyntaxKind.ContinueForStatement:\n\n                case SyntaxKind.YieldStatement:\n\n                case SyntaxKind.SimpleMemberAccessExpression:\n                case SyntaxKind.InvocationExpression:\n\n                case SyntaxKind.SingleLineSubLambdaExpression:\n                case SyntaxKind.SingleLineFunctionLambdaExpression:\n                case SyntaxKind.MultiLineSubLambdaExpression:\n                case SyntaxKind.MultiLineFunctionLambdaExpression:\n                    this.executableLineNumbers.Add(node.GetLocation().LineNumberToReport());\n                    return true;\n\n                case SyntaxKind.StructureStatement:\n                case SyntaxKind.ClassStatement:\n                case SyntaxKind.ModuleStatement:\n                    return !HasExcludedCodeAttribute((TypeStatementSyntax)node, tss => tss.AttributeLists,\n                        canBePartial: true);\n\n                case SyntaxKind.FunctionStatement:\n                case SyntaxKind.SubStatement:\n                case SyntaxKind.SubNewStatement:\n                    return !HasExcludedCodeAttribute((MethodBaseSyntax)node, mbs => mbs.AttributeLists,\n                        canBePartial: true);\n\n                case SyntaxKind.PropertyStatement:\n                case SyntaxKind.EventStatement:\n                    return !HasExcludedCodeAttribute((MethodBaseSyntax)node, mbs => mbs.AttributeLists,\n                        canBePartial: false);\n\n                case SyntaxKind.AddHandlerAccessorStatement:\n                case SyntaxKind.RemoveHandlerAccessorStatement:\n                case SyntaxKind.SetAccessorStatement:\n                case SyntaxKind.GetAccessorStatement:\n                    return !HasExcludedCodeAttribute((AccessorStatementSyntax)node, ass => ass.AttributeLists,\n                        canBePartial: false);\n\n                default:\n                    return true;\n            }\n        }\n\n        private bool HasExcludedCodeAttribute<T>(T node, Func<T, SyntaxList<AttributeListSyntax>> getAttributeLists,\n            bool canBePartial = false)\n            where T : SyntaxNode\n        {\n            var hasExcludeFromCodeCoverageAttribute = getAttributeLists(node)\n                .SelectMany(attributeList => attributeList.Attributes)\n                .Any(HasExcludedAttribute);\n\n            if (!canBePartial)\n            {\n                return hasExcludeFromCodeCoverageAttribute;\n            }\n\n            var nodeSymbol = this.semanticModel.GetDeclaredSymbol(node);\n            switch (nodeSymbol?.Kind)\n            {\n                case SymbolKind.Method:\n                case SymbolKind.NamedType:\n                    return hasExcludeFromCodeCoverageAttribute ||\n                        nodeSymbol.HasAttribute(KnownType.System_Diagnostics_CodeAnalysis_ExcludeFromCodeCoverageAttribute);\n\n                default:\n                    return hasExcludeFromCodeCoverageAttribute;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Metrics/VisualBasicMetrics.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Metrics;\n\nnamespace SonarAnalyzer.VisualBasic.Metrics;\n\npublic sealed class VisualBasicMetrics : MetricsBase\n{\n    private static readonly ISet<SyntaxKind> FunctionKinds = new HashSet<SyntaxKind>\n    {\n        SyntaxKind.SubNewStatement,\n        SyntaxKind.SubStatement,\n        SyntaxKind.FunctionStatement,\n        SyntaxKind.OperatorStatement,\n        SyntaxKind.GetAccessorStatement,\n        SyntaxKind.SetAccessorStatement,\n        SyntaxKind.RaiseEventAccessorStatement,\n        SyntaxKind.AddHandlerAccessorStatement,\n        SyntaxKind.RemoveHandlerAccessorStatement,\n        SyntaxKind.DeclareSubStatement,\n        SyntaxKind.DeclareFunctionStatement\n    };\n\n    private static readonly ISet<SyntaxKind> MethodBlocks = new HashSet<SyntaxKind>\n    {\n        SyntaxKind.ConstructorBlock,\n        SyntaxKind.FunctionBlock,\n        SyntaxKind.SubBlock,\n        SyntaxKind.OperatorBlock,\n        SyntaxKind.GetAccessorBlock,\n        SyntaxKind.SetAccessorBlock,\n        SyntaxKind.RaiseEventAccessorBlock,\n        SyntaxKind.AddHandlerAccessorBlock,\n        SyntaxKind.RemoveHandlerAccessorBlock\n    };\n\n    private readonly Lazy<ImmutableArray<int>> lazyExecutableLines;\n\n    public override ImmutableArray<int> ExecutableLines =>\n        lazyExecutableLines.Value;\n\n    public VisualBasicMetrics(SyntaxTree tree, SemanticModel semanticModel)\n        : base(tree)\n    {\n        var root = tree.GetRoot();\n        if (root.Language != LanguageNames.VisualBasic)\n        {\n            throw new ArgumentException(InitializationErrorTextPattern, nameof(tree));\n        }\n\n        lazyExecutableLines = new Lazy<ImmutableArray<int>>(() => VisualBasicExecutableLinesMetric.GetLineNumbers(tree, semanticModel));\n    }\n\n    protected override int ComputeCognitiveComplexity(SyntaxNode node) =>\n        VisualBasicCognitiveComplexityMetric.GetComplexity(node).Complexity;\n\n    public override int ComputeCyclomaticComplexity(SyntaxNode node) =>\n        node.DescendantNodesAndSelf().Count(n => IsComplexityIncreasingKind(n) || IsFunction(n));\n\n    protected override bool IsClass(SyntaxNode node)\n    {\n        switch (node.Kind())\n        {\n            case SyntaxKind.ClassBlock:\n            case SyntaxKind.StructureBlock:\n            case SyntaxKind.InterfaceBlock:\n            case SyntaxKind.ModuleBlock:\n                return true;\n\n            default:\n                return false;\n        }\n    }\n\n    protected override bool IsCommentTrivia(SyntaxTrivia trivia) => trivia.IsComment();\n\n    protected override bool IsEndOfFile(SyntaxToken token) =>\n        token.IsKind(SyntaxKind.EndOfFileToken);\n\n    protected override bool IsFunction(SyntaxNode node)\n    {\n        if (!FunctionKinds.Contains(node.Kind())\n            || !MethodBlocks.Contains(node.Parent.Kind())\n            || node.Parent.Parent.IsKind(SyntaxKind.InterfaceBlock))\n        {\n            return false;\n        }\n\n        if (node is MethodBaseSyntax method && method.Modifiers.Any(SyntaxKind.MustOverrideKeyword))\n        {\n            return false;\n        }\n\n        return true;\n    }\n\n    protected override bool IsNoneToken(SyntaxToken token) =>\n        token.IsKind(SyntaxKind.None);\n\n    protected override bool IsStatement(SyntaxNode node) =>\n        node is ExecutableStatementSyntax;\n\n    private static bool IsComplexityIncreasingKind(SyntaxNode node)\n    {\n        switch (node.Kind())\n        {\n            case SyntaxKind.IfStatement:\n            case SyntaxKind.SingleLineIfStatement:\n            case SyntaxKind.TernaryConditionalExpression:\n            case SyntaxKind.CaseStatement:\n\n            case SyntaxKind.WhileStatement:\n            case SyntaxKind.DoWhileStatement:\n            case SyntaxKind.DoUntilStatement:\n            case SyntaxKind.SimpleDoStatement:\n            case SyntaxKind.ForStatement:\n            case SyntaxKind.ForEachStatement:\n\n            case SyntaxKind.ThrowStatement:\n            case SyntaxKind.TryStatement:\n\n            case SyntaxKind.ErrorStatement:\n\n            case SyntaxKind.ResumeStatement:\n            case SyntaxKind.ResumeNextStatement:\n            case SyntaxKind.ResumeLabelStatement:\n\n            case SyntaxKind.OnErrorGoToLabelStatement:\n            case SyntaxKind.OnErrorGoToMinusOneStatement:\n            case SyntaxKind.OnErrorGoToZeroStatement:\n            case SyntaxKind.OnErrorResumeNextStatement:\n\n            case SyntaxKind.GoToStatement:\n\n            case SyntaxKind.ExitDoStatement:\n            case SyntaxKind.ExitForStatement:\n            case SyntaxKind.ExitFunctionStatement:\n            case SyntaxKind.ExitOperatorStatement:\n            case SyntaxKind.ExitPropertyStatement:\n            case SyntaxKind.ExitSelectStatement:\n            case SyntaxKind.ExitSubStatement:\n            case SyntaxKind.ExitTryStatement:\n            case SyntaxKind.ExitWhileStatement:\n\n            case SyntaxKind.ContinueDoStatement:\n            case SyntaxKind.ContinueForStatement:\n            case SyntaxKind.ContinueWhileStatement:\n\n            case SyntaxKind.StopStatement:\n\n            case SyntaxKind.AndAlsoExpression:\n            case SyntaxKind.OrElseExpression:\n\n            case SyntaxKind.EndStatement:\n                return true;\n\n            default:\n                return false;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Properties/AssemblyInfo.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Runtime.CompilerServices;\n\n[assembly: InternalsVisibleTo(\"SonarAnalyzer.Test\")]\n[assembly: InternalsVisibleTo(\"SonarAnalyzer.TestFramework.Test\")]\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/AllBranchesShouldNotHaveSameImplementation.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class AllBranchesShouldNotHaveSameImplementation : AllBranchesShouldNotHaveSameImplementationBase\n    {\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } =\n            ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                new SelectCaseStatementAnalyzer().GetAnalysisAction(rule),\n                SyntaxKind.SelectBlock);\n\n            context.RegisterNodeAction(\n                new TernaryStatementAnalyzer().GetAnalysisAction(rule),\n                SyntaxKind.TernaryConditionalExpression);\n\n            context.RegisterNodeAction(\n                new IfStatementAnalyzer().GetAnalysisAction(rule),\n                SyntaxKind.ElseBlock);\n\n            context.RegisterNodeAction(\n                new SingleLineIfStatementAnalyzer().GetAnalysisAction(rule),\n                SyntaxKind.SingleLineElseClause);\n        }\n\n        private class IfStatementAnalyzer : IfStatementAnalyzerBase<ElseBlockSyntax, MultiLineIfBlockSyntax>\n        {\n            protected override bool IsLastElseInChain(ElseBlockSyntax elseSyntax) => true;\n\n            protected override IEnumerable<SyntaxNode> GetStatements(ElseBlockSyntax elseSyntax) =>\n                elseSyntax.Statements;\n\n            protected override IEnumerable<IEnumerable<SyntaxNode>> GetIfBlocksStatements(ElseBlockSyntax elseSyntax,\n                out MultiLineIfBlockSyntax topLevelIf)\n            {\n                topLevelIf = (MultiLineIfBlockSyntax)elseSyntax.Parent;\n                return topLevelIf.ElseIfBlocks\n                    .Select(elseif => elseif.Statements.Cast<SyntaxNode>())\n                    .Concat(new[] { topLevelIf.Statements.Cast<SyntaxNode>() });\n            }\n\n            protected override Location GetLocation(MultiLineIfBlockSyntax topLevelIf)\n                => topLevelIf.IfStatement.IfKeyword.GetLocation();\n        }\n\n        private class TernaryStatementAnalyzer : TernaryStatementAnalyzerBase<TernaryConditionalExpressionSyntax>\n        {\n            protected override SyntaxNode GetWhenFalse(TernaryConditionalExpressionSyntax ternaryStatement) =>\n                ternaryStatement.WhenFalse.RemoveParentheses();\n\n            protected override SyntaxNode GetWhenTrue(TernaryConditionalExpressionSyntax ternaryStatement) =>\n                ternaryStatement.WhenTrue.RemoveParentheses();\n\n            protected override Location GetLocation(TernaryConditionalExpressionSyntax ternaryStatement) =>\n                ternaryStatement.IfKeyword.GetLocation();\n        }\n\n        private class SingleLineIfStatementAnalyzer : IfStatementAnalyzerBase<SingleLineElseClauseSyntax, SingleLineIfStatementSyntax>\n        {\n            protected override IEnumerable<IEnumerable<SyntaxNode>> GetIfBlocksStatements(SingleLineElseClauseSyntax elseSyntax,\n                out SingleLineIfStatementSyntax topLevelIf)\n            {\n                topLevelIf = (SingleLineIfStatementSyntax)elseSyntax.Parent;\n                return new[] { topLevelIf.Statements.Cast<SyntaxNode>() };\n            }\n\n            protected override IEnumerable<SyntaxNode> GetStatements(SingleLineElseClauseSyntax elseSyntax) =>\n                elseSyntax.Statements;\n\n            protected override bool IsLastElseInChain(SingleLineElseClauseSyntax elseSyntax) => true;\n\n            protected override Location GetLocation(SingleLineIfStatementSyntax topLevelIf) =>\n                topLevelIf.IfKeyword.GetLocation();\n        }\n\n        private class SelectCaseStatementAnalyzer : SwitchStatementAnalyzerBase<SelectBlockSyntax, CaseBlockSyntax>\n        {\n            protected override bool AreEquivalent(CaseBlockSyntax section1, CaseBlockSyntax section2) =>\n                SyntaxFactory.AreEquivalent(section1.Statements, section2.Statements);\n\n            protected override IEnumerable<CaseBlockSyntax> GetSections(SelectBlockSyntax switchStatement) =>\n                switchStatement.CaseBlocks;\n\n            protected override bool HasDefaultLabel(SelectBlockSyntax switchStatement) =>\n                switchStatement.CaseBlocks.Any(section => section.IsKind(SyntaxKind.CaseElseBlock));\n\n            protected override Location GetLocation(SelectBlockSyntax switchStatement) =>\n                switchStatement.SelectStatement.SelectKeyword.GetLocation();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/AlwaysSetDateTimeKind.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class AlwaysSetDateTimeKind : AlwaysSetDateTimeKindBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override SyntaxKind ObjectCreationExpression => SyntaxKind.ObjectCreationExpression;\n\n    protected override string[] ValidNames { get; } = new[] { nameof(DateTime), \"Date\" };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/ArrayCreationLongSyntax.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class ArrayCreationLongSyntax : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S2355\";\n        private const string MessageFormat = \"Use an array literal here instead.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n                {\n                    var arrayCreation = (ArrayCreationExpressionSyntax)c.Node;\n                    if (arrayCreation.Initializer == null\n                        || HasSizeSpecifier(arrayCreation)\n                        || c.Model.GetTypeInfo(arrayCreation).Type is not IArrayTypeSymbol arrayType\n                        || arrayType.ElementType is null or IErrorTypeSymbol)\n                    {\n                        return;\n                    }\n                    if (arrayCreation.Initializer.Initializers.Any())\n                    {\n                        if (AtLeastOneExactTypeMatch(c.Model, arrayCreation, arrayType)\n                            && AllTypesAreConvertible(c.Model, arrayCreation, arrayType))\n                        {\n                            c.ReportIssue(Rule, arrayCreation);\n                        }\n                    }\n                    else\n                    {\n                        if (arrayType.ElementType.Is(KnownType.System_Object))\n                        {\n                            c.ReportIssue(Rule, arrayCreation);\n                        }\n                    }\n                },\n                SyntaxKind.ArrayCreationExpression);\n\n        private static bool HasSizeSpecifier(ArrayCreationExpressionSyntax arrayCreation) =>\n            arrayCreation.ArrayBounds != null && arrayCreation.ArrayBounds.Arguments.Any();\n\n        private static bool AllTypesAreConvertible(SemanticModel semanticModel, ArrayCreationExpressionSyntax arrayCreation, IArrayTypeSymbol arrayType) =>\n            arrayCreation.Initializer.Initializers.All(x => semanticModel.ClassifyConversion(x, arrayType.ElementType) is var conversion\n                                                            && conversion.Exists\n                                                            && (conversion.IsIdentity || conversion.IsWidening));\n\n        private static bool AtLeastOneExactTypeMatch(SemanticModel semanticModel, ArrayCreationExpressionSyntax arrayCreation, IArrayTypeSymbol arrayType) =>\n            arrayCreation.Initializer.Initializers.Any(x => arrayType.ElementType.Equals(semanticModel.GetTypeInfo(x).Type));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/ArrayCreationLongSyntaxCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.VisualBasic)]\n    public sealed class ArrayCreationLongSyntaxCodeFix : SonarCodeFix\n    {\n        internal const string Title = \"Use an array literal\";\n\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(ArrayCreationLongSyntax.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            var node = root.FindNode(diagnosticSpan);\n\n            ArrayCreationExpressionSyntax arrayCreation;\n            switch (node.Kind())\n            {\n                case SyntaxKind.SimpleArgument:\n                    arrayCreation = ((SimpleArgumentSyntax)node).Expression as ArrayCreationExpressionSyntax;\n                    break;\n\n                case SyntaxKind.ArrayCreationExpression:\n                    arrayCreation = (ArrayCreationExpressionSyntax)node;\n                    break;\n\n                default:\n                    arrayCreation = null;\n                    break;\n            }\n\n            if (arrayCreation != null)\n            {\n                context.RegisterCodeFix(\n                    Title,\n                    c =>\n                    {\n                        var newRoot = root.ReplaceNode(\n                            arrayCreation,\n                            arrayCreation.Initializer);\n\n                        return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                    },\n                    context.Diagnostics);\n            }\n\n            return Task.CompletedTask;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/ArrayDesignatorOnVariable.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class ArrayDesignatorOnVariable : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S1197\";\n        private const string MessageFormat = \"Move the array designator from the variable to the type.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var declarator = (VariableDeclaratorSyntax)c.Node;\n                    if (declarator.AsClause is AsNewClauseSyntax)\n                    {\n                        return;\n                    }\n\n                    foreach (var name in declarator.Names.Where(n => n.ArrayRankSpecifiers.Any()))\n                    {\n                        c.ReportIssue(rule, name);\n                    }\n                },\n                SyntaxKind.VariableDeclarator);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/ArrayDesignatorOnVariableCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.VisualBasic)]\n    public sealed class ArrayDesignatorOnVariableCodeFix : SonarCodeFix\n    {\n        internal const string Title = \"Move the array designator to the type\";\n\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(ArrayDesignatorOnVariable.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            var name = root.FindNode(diagnosticSpan) as ModifiedIdentifierSyntax;\n\n            if (!(name?.Parent is VariableDeclaratorSyntax variableDeclarator) ||\n                variableDeclarator.Names.Count != 1)\n            {\n                return Task.CompletedTask;\n            }\n\n            if (!(variableDeclarator.AsClause is SimpleAsClauseSyntax simpleAsClause))\n            {\n                return Task.CompletedTask;\n            }\n\n            context.RegisterCodeFix(\n                Title,\n                c =>\n                {\n                    var type = simpleAsClause.Type.WithoutTrivia();\n                    var rankSpecifiers = name.ArrayRankSpecifiers.Select(rank => rank.WithoutTrivia());\n                    var newType = !(type is ArrayTypeSyntax typeAsArrayType)\n                        ? SyntaxFactory.ArrayType(\n                                    type,\n                                    SyntaxFactory.List(rankSpecifiers))\n                        : typeAsArrayType.AddRankSpecifiers(rankSpecifiers.ToArray());\n\n                    newType = newType.WithTriviaFrom(simpleAsClause.Type);\n\n                    var newVariableDeclarator = variableDeclarator\n                        .WithNames(SyntaxFactory.SeparatedList(new[]\n                        {\n                            SyntaxFactory.ModifiedIdentifier(name.Identifier, name.ArrayBounds).WithTriviaFrom(name)\n                        }))\n                        .WithAsClause(simpleAsClause.WithType(newType));\n\n                    var newRoot = root.ReplaceNode(\n                        variableDeclarator,\n                        newVariableDeclarator);\n\n                    return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                },\n                context.Diagnostics);\n\n            return Task.CompletedTask;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/ArrayInitializationMultipleStatements.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class ArrayInitializationMultipleStatements : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S2429\";\n        private const string MessageFormat = \"Refactor this code to use the '... = {}' syntax.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var declaration = (LocalDeclarationStatementSyntax)c.Node;\n                    if (declaration.Declarators.Count != 1)\n                    {\n                        return;\n                    }\n\n                    var declarator = declaration.Declarators.First();\n                    if (declarator.Names.Count != 1)\n                    {\n                        return;\n                    }\n\n                    var name = declarator.Names.First();\n                    if (name?.ArrayBounds == null ||\n                        name.ArrayBounds.Arguments.Count != 1)\n                    {\n                        return;\n                    }\n\n                    var bound = GetConstantArgumentValue(name.ArrayBounds.Arguments.First(), c.Model);\n                    if (!bound.HasValue)\n                    {\n                        return;\n                    }\n\n                    if (!(c.Model.GetDeclaredSymbol(name) is ILocalSymbol variableSymbol) ||\n                        !(variableSymbol.Type is IArrayTypeSymbol))\n                    {\n                        return;\n                    }\n\n                    var statements = GetFollowingStatements(declaration);\n                    var indexes = GetAssignedIndexes(statements, variableSymbol, c.Model).ToHashSet();\n\n                    var upperBound = Math.Max(bound.Value, 0);\n\n                    if (Enumerable.Range(0, upperBound + 1).Any(index => !indexes.Contains(index)))\n                    {\n                        return;\n                    }\n\n                    c.ReportIssue(rule, declaration);\n                },\n                SyntaxKind.LocalDeclarationStatement);\n        }\n\n        private static IEnumerable<int> GetAssignedIndexes(IEnumerable<StatementSyntax> statements, ILocalSymbol symbol, SemanticModel semanticModel)\n        {\n            foreach (var statement in statements)\n            {\n                if (!(statement is AssignmentStatementSyntax assignment))\n                {\n                    yield break;\n                }\n\n                var invocation = assignment.Left as InvocationExpressionSyntax;\n                if (invocation?.ArgumentList == null ||\n                    invocation.ArgumentList.Arguments.Count != 1)\n                {\n                    yield break;\n                }\n\n                var assignedSymbol = semanticModel.GetSymbolInfo(invocation.Expression).Symbol;\n                if (!symbol.Equals(assignedSymbol))\n                {\n                    yield break;\n                }\n\n                var argument = invocation.ArgumentList.Arguments.First();\n                var index = GetConstantArgumentValue(argument, semanticModel);\n                if (!index.HasValue)\n                {\n                    yield break;\n                }\n\n                yield return index.Value;\n            }\n        }\n\n        private static IEnumerable<StatementSyntax> GetFollowingStatements(SyntaxNode node)\n        {\n            var siblings = node.Parent.ChildNodes().ToList();\n            var index = siblings.IndexOf(node);\n            if (index < 0)\n            {\n                yield break;\n            }\n\n            for (var i = index + 1; i < siblings.Count; i++)\n            {\n                if (siblings[i] is StatementSyntax statement)\n                {\n                    yield return statement;\n                }\n                else\n                {\n                    yield break;\n                }\n            }\n        }\n\n        private static int? GetConstantArgumentValue(ArgumentSyntax argument, SemanticModel semanticModel)\n        {\n            var bound = semanticModel.GetConstantValue(argument.GetExpression());\n            if (!bound.HasValue)\n            {\n                return null;\n            }\n\n            var boundValue = bound.Value as int?;\n            return boundValue;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/ArrayPassedAsParams.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class ArrayPassedAsParams : ArrayPassedAsParamsBase<SyntaxKind, ArgumentSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override SyntaxKind[] ExpressionKinds { get; } =\n        [\n            SyntaxKind.ObjectCreationExpression,\n            SyntaxKind.InvocationExpression\n        ];\n\n    protected override ArgumentSyntax LastArgumentIfArrayCreation(SyntaxNode expression) =>\n        ArgumentList(expression) is { Arguments: { Count: > 0 } arguments }\n        && arguments.Last() is var lastArgument\n        && IsArrayCreation(lastArgument.GetExpression())\n            ? lastArgument\n            : null;\n\n    protected override ITypeSymbol ArrayElementType(ArgumentSyntax argument, SemanticModel model) =>\n        argument.GetExpression() switch\n        {\n            ArrayCreationExpressionSyntax arrayCreation => model.GetTypeInfo(arrayCreation.Type).Type,\n            CollectionInitializerSyntax collectionInitializer => (model.GetTypeInfo(collectionInitializer).Type as IArrayTypeSymbol)?.ElementType,\n            _ => null\n        };\n\n    private static ArgumentListSyntax ArgumentList(SyntaxNode expression) =>\n        expression switch\n        {\n            ObjectCreationExpressionSyntax { } creation => creation.ArgumentList,\n            InvocationExpressionSyntax { } invocation => invocation.ArgumentList,\n            _ => null\n        };\n\n    private static bool IsArrayCreation(ExpressionSyntax expression) =>\n        expression switch\n        {\n            ArrayCreationExpressionSyntax { Initializer.Initializers.Count: > 0 } => true,\n            ArrayCreationExpressionSyntax { ArrayBounds: null } => true,\n            CollectionInitializerSyntax => true,\n            _ => false\n        };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/AspNet/BackslashShouldBeAvoidedInAspNetRoutes.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class BackslashShouldBeAvoidedInAspNetRoutes : BackslashShouldBeAvoidedInAspNetRoutesBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override SyntaxKind[] SyntaxKinds => [SyntaxKind.SimpleArgument];\n\n    protected override bool IsNamedAttributeArgument(SyntaxNode node) => false;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/AspNet/RouteTemplateShouldNotStartWithSlash.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class RouteTemplateShouldNotStartWithSlash : RouteTemplateShouldNotStartWithSlashBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/AvoidDateTimeNowForBenchmarking.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class AvoidDateTimeNowForBenchmarking : AvoidDateTimeNowForBenchmarkingBase<MemberAccessExpressionSyntax, InvocationExpressionSyntax, SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override bool ContainsDateTimeArgument(InvocationExpressionSyntax invocation, SemanticModel model) =>\n        invocation.ArgumentList.Arguments[0].GetExpression().IsKnownType(KnownType.System_DateTime, model);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/AvoidUnsealedAttributes.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class AvoidUnsealedAttributes : AvoidUnsealedAttributesBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/BeginInvokePairedWithEndInvoke.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class BeginInvokePairedWithEndInvoke : BeginInvokePairedWithEndInvokeBase<SyntaxKind, InvocationExpressionSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n    protected override SyntaxKind InvocationExpressionKind { get; } = SyntaxKind.InvocationExpression;\n    protected override string CallbackParameterName { get; } = \"DelegateCallback\";\n\n    protected override ISet<SyntaxKind> ParentDeclarationKinds { get; } = new HashSet<SyntaxKind>\n    {\n        // Methods\n        SyntaxKind.ConstructorBlock,\n        SyntaxKind.FunctionBlock,\n        SyntaxKind.SubBlock,\n        SyntaxKind.OperatorBlock,\n        // Properties\n        SyntaxKind.AddHandlerAccessorBlock,\n        SyntaxKind.GetAccessorBlock,\n        SyntaxKind.RaiseEventAccessorBlock,\n        SyntaxKind.RemoveHandlerAccessorBlock,\n        SyntaxKind.SetAccessorBlock,\n        // Lambdas\n        SyntaxKind.MultiLineFunctionLambdaExpression,\n        SyntaxKind.MultiLineSubLambdaExpression,\n        SyntaxKind.SingleLineFunctionLambdaExpression,\n        SyntaxKind.SingleLineSubLambdaExpression\n    }.ToImmutableHashSet();\n\n    protected override void VisitInvocation(EndInvokeContext context) =>\n        new InvocationWalker(context).SafeVisit(context.Root);\n\n    protected override bool IsInvalidCallback(SyntaxNode callbackArg, SemanticModel semanticModel) =>\n        FindCallback(callbackArg, semanticModel) is { } callback\n        && callback.EnsureCorrectSemanticModelOrDefault(semanticModel) is { } callbackModel\n        && (Language.Syntax.IsNullLiteral(callback) || !IsParentDeclarationWithEndInvoke(callback, callbackModel));\n\n    /// <summary>\n    /// This method is looking for the callback code which can be:\n    /// - in a identifier initializer (like a lambda)\n    /// - passed directly as a lambda argument\n    /// - passed as a new delegate instantiation (and the code can be inside the method declaration)\n    /// - a mix of the above.\n    /// </summary>\n    private static SyntaxNode FindCallback(SyntaxNode callbackArg, SemanticModel model)\n    {\n        var callback = callbackArg.RemoveParentheses();\n        if (callback is IdentifierNameSyntax identifier)\n        {\n            callback = LookupIdentifierInitializer(identifier, model);\n        }\n\n        if (callback is ObjectCreationExpressionSyntax objectCreation)\n        {\n            callback = objectCreation.ArgumentList.Arguments.Count == 1 ? objectCreation.ArgumentList.Arguments.Single().GetExpression() : null;\n        }\n\n        if (callback is UnaryExpressionSyntax addressOf\n            && callback.IsKind(SyntaxKind.AddressOfExpression)\n            && callback.EnsureCorrectSemanticModelOrDefault(model) is { } addressOfModel\n            && addressOfModel.GetSymbolInfo(addressOf.Operand).Symbol is IMethodSymbol methodSymbol)\n        {\n            callback = methodSymbol.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax().Parent;\n        }\n\n        return callback;\n    }\n\n    private static SyntaxNode LookupIdentifierInitializer(IdentifierNameSyntax identifier, SemanticModel semantic) =>\n        semantic.GetSymbolInfo(identifier).Symbol?.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax() is ModifiedIdentifierSyntax modifiedIdentifier\n        && modifiedIdentifier.Parent is VariableDeclaratorSyntax variableDeclarator\n            ? variableDeclarator.Initializer?.Value.RemoveParentheses() ?? (variableDeclarator.AsClause as AsNewClauseSyntax)?.NewExpression\n            : null;\n\n    private class InvocationWalker : SafeVisualBasicSyntaxWalker\n    {\n        private readonly EndInvokeContext context;\n\n        public InvocationWalker(EndInvokeContext context) =>\n            this.context = context;\n\n        public override void Visit(SyntaxNode node)\n        {\n            if (context.Visit(node))\n            {\n                base.Visit(node);\n            }\n        }\n\n        public override void VisitInvocationExpression(InvocationExpressionSyntax node)\n        {\n            if (context.VisitInvocationExpression(node))\n            {\n                base.VisitInvocationExpression(node);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/BinaryOperationWithIdenticalExpressions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class BinaryOperationWithIdenticalExpressions : BinaryOperationWithIdenticalExpressionsBase\n    {\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, \"{0}\");\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        private static readonly SyntaxKind[] SyntaxKindsToCheckBinary =\n        {\n            SyntaxKind.SubtractExpression,\n            SyntaxKind.DivideExpression, SyntaxKind.ModuloExpression, SyntaxKind.IntegerDivideExpression,\n            SyntaxKind.OrElseExpression, SyntaxKind.AndAlsoExpression,\n            SyntaxKind.OrExpression, SyntaxKind.AndExpression, SyntaxKind.ExclusiveOrExpression,\n            SyntaxKind.EqualsExpression, SyntaxKind.NotEqualsExpression,\n            SyntaxKind.LessThanExpression, SyntaxKind.LessThanOrEqualExpression,\n            SyntaxKind.GreaterThanExpression, SyntaxKind.GreaterThanOrEqualExpression\n        };\n\n        private static readonly SyntaxKind[] SyntaxKindsToCheckAssignment =\n        {\n            SyntaxKind.SubtractAssignmentStatement,\n            SyntaxKind.DivideAssignmentStatement,\n            SyntaxKind.IntegerDivideAssignmentStatement\n        };\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var expression = (BinaryExpressionSyntax)c.Node;\n                    ReportIfExpressionsMatch(c, expression.Left, expression.Right, expression.OperatorToken);\n                },\n                SyntaxKindsToCheckBinary);\n\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var expression = (AssignmentStatementSyntax)c.Node;\n                    ReportIfExpressionsMatch(c, expression.Left, expression.Right, expression.OperatorToken);\n                },\n                SyntaxKindsToCheckAssignment);\n        }\n\n        private static void ReportIfExpressionsMatch(SonarSyntaxNodeReportingContext context, ExpressionSyntax left, ExpressionSyntax right,\n            SyntaxToken operatorToken)\n        {\n            if (VisualBasicEquivalenceChecker.AreEquivalent(left.RemoveParentheses(), right.RemoveParentheses()))\n            {\n                var message = string.Format(OperatorMessageFormat, operatorToken);\n                context.ReportIssue(Rule, context.Node, message);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/BooleanCheckInverted.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class BooleanCheckInverted : BooleanCheckInvertedBase<BinaryExpressionSyntax>\n{\n    private static readonly ISet<SyntaxKind> UnsafeInversionOperators = new HashSet<SyntaxKind>\n        {\n            SyntaxKind.GreaterThanToken,\n            SyntaxKind.GreaterThanEqualsToken,\n            SyntaxKind.LessThanToken,\n            SyntaxKind.LessThanEqualsToken,\n        };\n\n    private static readonly Dictionary<SyntaxKind, string> OppositeTokens = new()\n        {\n            { SyntaxKind.GreaterThanToken, \"<=\" },\n            { SyntaxKind.GreaterThanEqualsToken, \"<\" },\n            { SyntaxKind.LessThanToken, \">=\" },\n            { SyntaxKind.LessThanEqualsToken, \">\" },\n            { SyntaxKind.EqualsToken, \"<>\" },\n            { SyntaxKind.LessThanGreaterThanToken, \"=\" },\n        };\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            AnalysisAction(Rule),\n            SyntaxKind.GreaterThanExpression,\n            SyntaxKind.GreaterThanOrEqualExpression,\n            SyntaxKind.LessThanExpression,\n            SyntaxKind.LessThanOrEqualExpression,\n            SyntaxKind.EqualsExpression,\n            SyntaxKind.NotEqualsExpression);\n\n    protected override bool IsUnsafeInversionOperation(BinaryExpressionSyntax expression, SemanticModel model) =>\n        expression.OperatorToken.IsAnyKind(UnsafeInversionOperators)\n        && (IsNullable(expression.Left, model)\n            || IsNullable(expression.Right, model)\n            || IsConditionalAccessExpression(expression.Left)\n            || IsConditionalAccessExpression(expression.Right)\n            || IsFloatingPoint(expression.Left, model)\n            || IsFloatingPoint(expression.Right, model));\n\n    protected override SyntaxNode LogicalNotNode(BinaryExpressionSyntax expression) =>\n        expression.SelfOrTopParenthesizedExpression.Parent is UnaryExpressionSyntax unaryExpression && unaryExpression.OperatorToken.IsKind(SyntaxKind.NotKeyword)\n            ? unaryExpression\n            : null;\n\n    protected override string SuggestedReplacement(BinaryExpressionSyntax expression) =>\n        OppositeTokens[expression.OperatorToken.Kind()];\n\n    private static bool IsConditionalAccessExpression(ExpressionSyntax expression) =>\n        expression.RemoveParentheses().IsKind(SyntaxKind.ConditionalAccessExpression);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/BooleanLiteralUnnecessary.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class BooleanLiteralUnnecessary : BooleanLiteralUnnecessaryBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n        protected override SyntaxToken? GetOperatorToken(SyntaxNode node) => ((BinaryExpressionSyntax)node).OperatorToken;\n\n        protected override bool IsTrue(SyntaxNode syntaxNode) => syntaxNode.IsTrue();\n\n        protected override bool IsFalse(SyntaxNode syntaxNode) => syntaxNode.IsFalse();\n\n        protected override SyntaxNode GetLeftNode(SyntaxNode node) => ((BinaryExpressionSyntax)node).Left;\n\n        protected override SyntaxNode GetRightNode(SyntaxNode node) => ((BinaryExpressionSyntax)node).Right;\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(CheckLogicalNot, SyntaxKind.NotExpression);\n            context.RegisterNodeAction(CheckAndExpression, SyntaxKind.AndAlsoExpression);\n            context.RegisterNodeAction(CheckAndExpression, SyntaxKind.AndExpression);\n            context.RegisterNodeAction(CheckOrExpression, SyntaxKind.OrElseExpression);\n            context.RegisterNodeAction(CheckOrExpression, SyntaxKind.OrExpression);\n            context.RegisterNodeAction(CheckEquals, SyntaxKind.EqualsExpression);\n            context.RegisterNodeAction(CheckNotEquals, SyntaxKind.NotEqualsExpression);\n            context.RegisterNodeAction(CheckConditional, SyntaxKind.TernaryConditionalExpression);\n            base.Initialize(context);\n        }\n\n        private void CheckLogicalNot(SonarSyntaxNodeReportingContext context)\n        {\n            var logicalNot = (UnaryExpressionSyntax)context.Node;\n            var logicalNotOperand = logicalNot.Operand.RemoveParentheses();\n            if (IsTrue(logicalNotOperand) || IsFalse(logicalNotOperand))\n            {\n                context.ReportIssue(Rule, logicalNot.Operand);\n            }\n        }\n\n        private void CheckConditional(SonarSyntaxNodeReportingContext context)\n        {\n            var conditional = (TernaryConditionalExpressionSyntax)context.Node;\n            var whenTrue = conditional.WhenTrue;\n            var whenFalse = conditional.WhenFalse;\n            var typeLeft = context.Model.GetTypeInfo(whenTrue).Type;\n            var typeRight = context.Model.GetTypeInfo(whenFalse).Type;\n            if (typeLeft.IsNullableBoolean()\n                || typeRight.IsNullableBoolean()\n                || typeLeft == null\n                || typeRight == null)\n            {\n                return;\n            }\n            CheckTernaryExpressionBranches(context, whenTrue, whenFalse);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/BypassingAccessibility.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class BypassingAccessibility : BypassingAccessibilityBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n        public BypassingAccessibility() : base(AnalyzerConfiguration.AlwaysEnabled) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/CatchRethrow.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class CatchRethrow : CatchRethrowBase<SyntaxKind, CatchBlockSyntax>\n{\n    private static readonly SyntaxList<ThrowStatementSyntax> ThrowBlock = SyntaxFactory.List([SyntaxFactory.ThrowStatement()]);\n\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override bool ContainsOnlyThrow(CatchBlockSyntax currentCatch) =>\n        VisualBasicEquivalenceChecker.AreEquivalent(currentCatch.Statements, ThrowBlock);\n\n    protected override CatchBlockSyntax[] AllCatches(SyntaxNode node) =>\n        ((TryBlockSyntax)node).CatchBlocks.ToArray();\n\n    protected override SyntaxNode DeclarationType(CatchBlockSyntax catchClause) =>\n        catchClause.CatchStatement?.AsClause?.Type;\n\n    protected override bool HasFilter(CatchBlockSyntax catchClause) =>\n        catchClause.CatchStatement?.WhenClause is not null;\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(RaiseOnInvalidCatch, SyntaxKind.TryBlock);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/CertificateValidationCheck.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class CertificateValidationCheck : CertificateValidationCheckBase<\n    SyntaxKind,\n    ArgumentSyntax,\n    ExpressionSyntax,\n    IdentifierNameSyntax,\n    AssignmentStatementSyntax,\n    InvocationExpressionSyntax,\n    ParameterSyntax,\n    ModifiedIdentifierSyntax,\n    LambdaExpressionSyntax,\n    MemberAccessExpressionSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language { get; } = VisualBasicFacade.Instance;\n    protected override HashSet<SyntaxKind> MethodDeclarationKinds { get; } = [SyntaxKind.FunctionBlock, SyntaxKind.SubBlock];\n    protected override HashSet<SyntaxKind> TypeDeclarationKinds { get; } = VisualBasicFacade.Instance.SyntaxKind.TypeDeclaration.ToHashSet();\n\n    internal override MethodParameterLookupBase<ArgumentSyntax> CreateParameterLookup(SyntaxNode argumentListNode, IMethodSymbol method) =>\n        argumentListNode switch\n        {\n            InvocationExpressionSyntax invocation => new VisualBasicMethodParameterLookup(invocation.ArgumentList, method),\n            ObjectCreationExpressionSyntax ctor => new VisualBasicMethodParameterLookup(ctor.ArgumentList, method),\n            _ => throw new ArgumentException(\"Unexpected type.\", nameof(argumentListNode)) // This should be throw only by bad usage of this method, not by input dependency\n        };\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        // C# += equivalent:\n        // AddHandler situation does not exist in VB.NET. Delegate is pointer to one function only and can not have multiple handlers. It's not an event.\n        // Only assignment and object creation are valid cases for VB.NET\n\n        // Handling of = syntax\n        context.RegisterNodeAction(CheckAssignmentSyntax, SyntaxKind.SimpleAssignmentStatement);\n\n        // Handling of constructor parameter syntax (SslStream)\n        context.RegisterNodeAction(CheckConstructorParameterSyntax, SyntaxKind.ObjectCreationExpression);\n    }\n\n    protected override Location ExpressionLocation(SyntaxNode expression) =>\n        // For Lambda expression extract location of the parentheses only to separate them from secondary location of \"true\"\n        ((expression is LambdaExpressionSyntax lambda) ? lambda.SubOrFunctionHeader.ParameterList : expression).GetLocation();\n\n    protected override void SplitAssignment(AssignmentStatementSyntax assignment, out IdentifierNameSyntax leftIdentifier, out ExpressionSyntax right)\n    {\n        leftIdentifier = assignment.Left.DescendantNodesAndSelf().OfType<IdentifierNameSyntax>().LastOrDefault();\n        right = assignment.Right;\n    }\n\n    protected override IEqualityComparer<ExpressionSyntax> CreateNodeEqualityComparer() =>\n        new VisualBasicSyntaxNodeEqualityComparer<ExpressionSyntax>();\n\n    protected override SyntaxNode FindRootTypeDeclaration(SyntaxNode node)\n    {\n        if (node.FirstAncestorOrSelf<ModuleBlockSyntax>() is { } module)\n        {\n            return module; // Modules can't be nested. If there's one, it's the Root\n        }\n        return base.FindRootTypeDeclaration(node);\n    }\n\n    protected override ExpressionSyntax[] FindReturnAndThrowExpressions(InspectionContext c, SyntaxNode block)\n    {\n        // Return value set by assignment to function variable/value\n        var assignments = block.DescendantNodes()\n            .OfType<AssignmentStatementSyntax>()\n            .Where(x => c.Context.Model.GetSymbolInfo(x.Left).Symbol is ILocalSymbol { IsFunctionValue: true });\n        // And normal Return statements and throws\n        return block.DescendantNodes().OfType<ReturnStatementSyntax>().Select(x => x.Expression)\n            // Throw statements #2825. x.Expression can be NULL for standalone Throw and we need that one as well.\n            .Concat(block.DescendantNodes().OfType<ThrowStatementSyntax>().Select(x => x.Expression))\n            .Concat(assignments.Select(x => x.Right))\n            .ToArray();\n    }\n\n    protected override bool IsTrueLiteral(ExpressionSyntax expression) =>\n        expression?.RemoveParentheses().Kind() == SyntaxKind.TrueLiteralExpression;\n\n    protected override ExpressionSyntax VariableInitializer(ModifiedIdentifierSyntax variable) =>\n        variable.FirstAncestorOrSelf<VariableDeclaratorSyntax>()?.Initializer?.Value;\n\n    protected override ImmutableArray<Location> LambdaLocations(InspectionContext c, LambdaExpressionSyntax lambda) =>\n        lambda switch\n        {\n            SingleLineLambdaExpressionSyntax single => single.Body is ExpressionSyntax expr && IsTrueLiteral(expr)    // LiteralExpressionSyntax or ParenthesizedExpressionSyntax like (((true)))\n                ? new[] { single.Body.GetLocation() }.ToImmutableArray()\n                : ImmutableArray<Location>.Empty,\n            MultiLineLambdaExpressionSyntax multi => BlockLocations(c, multi),\n            _ => ImmutableArray<Location>.Empty,\n        };\n\n    protected override SyntaxNode LocalVariableScope(ModifiedIdentifierSyntax variable) =>\n        variable.FirstAncestorOrSelf<LocalDeclarationStatementSyntax>()?.Parent;\n\n    protected override SyntaxNode ExtractArgumentExpressionNode(SyntaxNode expression)\n    {\n        expression = expression.RemoveParentheses();\n        return expression is UnaryExpressionSyntax unary && unary.Kind() == SyntaxKind.AddressOfExpression\n            ? unary.Operand   // Parentheses can not wrap AddressOf operand\n            : expression;\n    }\n\n    protected override SyntaxNode SyntaxFromReference(SyntaxReference reference)\n    {\n        var syntax = reference.GetSyntax();\n        return syntax is MethodStatementSyntax ? syntax.Parent : syntax;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/CheckFileLicense.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class CheckFileLicense : CheckFileLicenseBase\n    {\n        internal const string HeaderFormatDefaultValue =\n@\"' <Your-Product-Name>\n' Copyright (c) <Year-From>-<Year-To> <Your-Company-Name>\n'\n' Please configure this header in your SonarCloud/SonarQube quality profile.\n' You can also set it in SonarLint.xml additional file for SonarLint or standalone NuGet analyzer.\n\";\n\n        protected override ILanguageFacade Language => VisualBasicFacade.Instance;\n\n        [RuleParameter(HeaderFormatRuleParameterKey, PropertyType.Text, \"Expected copyright and license header.\", HeaderFormatDefaultValue)]\n        public override string HeaderFormat { get; set; } = HeaderFormatDefaultValue;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/ClassNamedException.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class ClassNamedException : ClassNamedExceptionBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/ClassNotInstantiatable.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class ClassNotInstantiatable : ClassNotInstantiatableBase<TypeBlockSyntax, SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n        protected override IEnumerable<ConstructorContext> CollectRemovableDeclarations(INamedTypeSymbol namedType, Compilation compilation, string messageArg)\n        {\n            var typeDeclarations = new VisualBasicRemovableDeclarationCollector(namedType, compilation).TypeDeclarations;\n\n            return typeDeclarations.Select(x => new ConstructorContext(x, Diagnostic.Create(Rule, x.Node.BlockStatement.Identifier.GetLocation(), \"class\", messageArg)));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/ClassShouldNotBeEmpty.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class ClassShouldNotBeEmpty : ClassShouldNotBeEmptyBase<SyntaxKind, TypeBlockSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override bool IsEmptyAndNotPartial(SyntaxNode node) =>\n        node is ClassBlockSyntax { Members.Count: 0 } classSyntax\n        && !classSyntax.ClassStatement.Modifiers.Any(x => x.IsKind(SyntaxKind.PartialKeyword));\n\n    protected override TypeBlockSyntax GetIfHasDeclaredBaseClassOrInterface(SyntaxNode node) =>\n        node is ClassBlockSyntax { Inherits.Count: > 0 } or ClassBlockSyntax { Implements.Count: > 0 }\n            ? (ClassBlockSyntax)node\n            : null;\n\n    protected override bool HasInterfaceOrGenericBaseClass(TypeBlockSyntax declaration) =>\n        declaration.Implements.Any()\n        || declaration.Inherits.Any(x => x.Types.Any(t => t is GenericNameSyntax));\n\n    protected override bool HasAnyAttribute(SyntaxNode node) =>\n        node is ClassBlockSyntax { ClassStatement.AttributeLists.Count: > 0 };\n\n    protected override bool HasConditionalCompilationDirectives(SyntaxNode node) =>\n        node.DescendantNodes(descendIntoTrivia: true).Any(x => x.IsAnyKind(\n            SyntaxKind.IfDirectiveTrivia,\n            SyntaxKind.ElseIfDirectiveTrivia,\n            SyntaxKind.ElseDirectiveTrivia,\n            SyntaxKind.EndIfDirectiveTrivia));\n\n    protected override string DeclarationTypeKeyword(SyntaxNode node) =>\n        ((TypeBlockSyntax)node).BlockStatement.DeclarationKeyword.ValueText.ToLower();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/CognitiveComplexity.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Metrics;\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class CognitiveComplexity : CognitiveComplexityBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n        protected override void Initialize(SonarParametrizedAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                 c => CheckComplexity<MethodBlockSyntax>(c, m => m, m => m.SubOrFunctionStatement.Identifier.GetLocation(),\n                     VisualBasicCognitiveComplexityMetric.GetComplexity, \"method\", Threshold),\n                 SyntaxKind.SubBlock,\n                 SyntaxKind.FunctionBlock);\n\n            context.RegisterNodeAction(\n                c => CheckComplexity<ConstructorBlockSyntax>(c, co => co, co => co.BlockStatement.DeclarationKeyword.GetLocation(),\n                    VisualBasicCognitiveComplexityMetric.GetComplexity, \"constructor\", Threshold),\n                SyntaxKind.ConstructorBlock);\n\n            context.RegisterNodeAction(\n                c => CheckComplexity<OperatorBlockSyntax>(c, o => o, o => o.BlockStatement.DeclarationKeyword.GetLocation(),\n                    VisualBasicCognitiveComplexityMetric.GetComplexity, \"operator\", Threshold),\n                SyntaxKind.OperatorBlock);\n\n            context.RegisterNodeAction(\n                c => CheckComplexity<AccessorBlockSyntax>(c, a => a, a => a.AccessorStatement.DeclarationKeyword.GetLocation(),\n                    VisualBasicCognitiveComplexityMetric.GetComplexity, \"accessor\", PropertyThreshold),\n                SyntaxKind.GetAccessorBlock,\n                SyntaxKind.SetAccessorBlock);\n\n            context.RegisterNodeAction(\n               c => CheckComplexity<FieldDeclarationSyntax>(c, f => f, f => f.Declarators[0].Names[0].Identifier.GetLocation(),\n                    VisualBasicCognitiveComplexityMetric.GetComplexity, \"field\", Threshold),\n               SyntaxKind.FieldDeclaration);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/CollectionEmptinessChecking.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class CollectionEmptinessChecking : CollectionEmptinessCheckingBase<SyntaxKind>\n    {\n        protected override string MessageFormat => \"Use '.Any()' to test whether this 'IEnumerable(Of {0})' is empty or not.\";\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/CommentKeyword.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class CommentKeyword : CommentKeywordBase\n    {\n        protected override ILanguageFacade Language => VisualBasicFacade.Instance;\n\n        protected override bool IsComment(SyntaxTrivia trivia) => trivia.IsComment();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/CommentLineEnd.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class CommentLineEnd : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S139\";\n        private const string MessageFormat = \"Move this trailing comment on the previous empty line.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        private const string DefaultPattern = @\"^'\\s*\\S+\\s*$\";\n\n        [RuleParameter(\"legalCommentPattern\", PropertyType.String,\n            \"Pattern for text of trailing comments that are allowed.\", DefaultPattern)]\n        public string LegalCommentPattern { get; set; } = DefaultPattern;\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterTreeAction(\n                c =>\n                {\n                    foreach (var token in c.Tree.GetRoot().DescendantTokens())\n                    {\n                        CheckTokenComments(c, token);\n                    }\n                });\n        }\n\n        private void CheckTokenComments(SonarSyntaxTreeReportingContext context, SyntaxToken token)\n        {\n            var tokenLine = token.GetLocation().StartLine();\n\n            var comments = token.TrailingTrivia\n                .Where(tr => tr.IsKind(SyntaxKind.CommentTrivia));\n\n            foreach (var comment in comments)\n            {\n                var location = comment.GetLocation();\n                if (location.StartLine() == tokenLine && !SafeRegex.IsMatch(comment.ToString(), LegalCommentPattern))\n                {\n                    context.ReportIssue(rule, location);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/CommentsShouldNotBeEmpty.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text;\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class CommentsShouldNotBeEmpty : CommentsShouldNotBeEmptyBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override bool IsValidTriviaType(SyntaxTrivia trivia) =>\n        trivia.IsComment();\n\n    protected override string GetCommentText(SyntaxTrivia trivia) =>\n        trivia.Kind() switch\n        {\n            SyntaxKind.CommentTrivia => GetText(trivia),\n            SyntaxKind.DocumentationCommentTrivia => GetDocumentationText(trivia),\n        };\n\n    // '\n    private static string GetText(SyntaxTrivia trivia)\n        => trivia.ToString().Trim().Substring(1);\n\n    // '''\n    private static string GetDocumentationText(SyntaxTrivia trivia)\n    {\n        var stringBuilder = new StringBuilder();\n        foreach (var line in trivia.ToFullString().Split(Constants.LineTerminators, StringSplitOptions.None))\n        {\n            var trimmedLine = line.TrimStart(null);\n            trimmedLine = trimmedLine.StartsWith(\"'''\")\n                ? trimmedLine.Substring(3).Trim()\n                : trimmedLine.TrimEnd(null);\n            stringBuilder.Append(trimmedLine);\n        }\n        return stringBuilder.ToString();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/ConditionalStructureSameCondition.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class ConditionalStructureSameCondition : ConditionalStructureSameConditionBase\n    {\n        protected override ILanguageFacade Language => VisualBasicFacade.Instance;\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n                {\n                    var ifBlock = (MultiLineIfBlockSyntax)c.Node;\n                    var conditions = new[] { ifBlock.IfStatement?.Condition }\n                        .Concat(ifBlock.ElseIfBlocks.Select(x => x.ElseIfStatement?.Condition))\n                        .WhereNotNull()\n                        .Select(x => x.RemoveParentheses())\n                        .ToArray();\n\n                    for (var i = 1; i < conditions.Length; i++)\n                    {\n                        CheckConditionAt(c, conditions, i);\n                    }\n                },\n                SyntaxKind.MultiLineIfBlock);\n\n        private void CheckConditionAt(SonarSyntaxNodeReportingContext context, ExpressionSyntax[] conditions, int currentIndex)\n        {\n            for (var i = 0; i < currentIndex; i++)\n            {\n                if (VisualBasicEquivalenceChecker.AreEquivalent(conditions[currentIndex], conditions[i]))\n                {\n                    context.ReportIssue(rule, conditions[currentIndex], conditions[i].LineNumberToReport().ToString());\n                    return;\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/ConditionalStructureSameImplementation.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class ConditionalStructureSameImplementation : ConditionalStructureSameImplementationBase\n{\n    private static readonly DiagnosticDescriptor Rule =\n        DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    private static readonly ISet<SyntaxKind> IgnoredStatementsInSwitch = new HashSet<SyntaxKind> { SyntaxKind.ReturnStatement, SyntaxKind.ThrowStatement };\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context)\n    {\n        context.RegisterNodeAction(\n            c =>\n            {\n                var ifStatement = (SingleLineIfStatementSyntax)c.Node;\n\n                if (ifStatement.ElseClause is not null &&\n                    VisualBasicEquivalenceChecker.AreEquivalent(ifStatement.ElseClause.Statements, ifStatement.Statements))\n                {\n                    ReportIssue(c, ifStatement.ElseClause.Statements, ifStatement.Statements, \"branch\");\n                }\n            },\n            SyntaxKind.SingleLineIfStatement);\n\n        context.RegisterNodeAction(\n            c =>\n            {\n                var ifBlock = (MultiLineIfBlockSyntax)c.Node;\n\n                var statements = new[] { ifBlock.Statements }\n                    .Concat(ifBlock.ElseIfBlocks.Select(elseIf => elseIf.Statements))\n                    .Concat(new[] { ifBlock.ElseBlock?.Statements ?? new SyntaxList<StatementSyntax>() })\n                    .Where(l => l.Any())\n                    .ToList();\n\n                for (var i = 1; i < statements.Count; i++)\n                {\n                    CheckStatementsAt(c, statements, i, ifBlock.ElseBlock is not null, \"branch\");\n                }\n            },\n            SyntaxKind.MultiLineIfBlock);\n\n        context.RegisterNodeAction(\n            c =>\n            {\n                var select = (SelectBlockSyntax)c.Node;\n                var statements = select.CaseBlocks.Select(b => b.Statements).ToList();\n                var hasCaseElse = select.CaseBlocks.Any(b => b.IsKind(SyntaxKind.CaseElseBlock));\n                for (var i = 1; i < statements.Count; i++)\n                {\n                    CheckStatementsAt(c, statements, i, hasCaseElse, \"case\");\n                }\n            },\n            SyntaxKind.SelectBlock);\n    }\n\n    private static void CheckStatementsAt(SonarSyntaxNodeReportingContext context, List<SyntaxList<StatementSyntax>> statements, int currentIndex, bool hasElse, string constructType)\n    {\n        var currentBlockStatements = statements[currentIndex];\n        var numberOfStatements = currentBlockStatements.Count(IsApprovedStatement);\n        if (!hasElse && numberOfStatements == 1)\n        {\n            if (statements.Count > 1 && statements.TrueForAll(x => VisualBasicEquivalenceChecker.AreEquivalent(currentBlockStatements, x)))\n            {\n                ReportIssue(context, currentBlockStatements, statements[0], constructType);\n            }\n        }\n        else if (numberOfStatements > 1)\n        {\n            for (var j = 0; j < currentIndex; j++)\n            {\n                if (VisualBasicEquivalenceChecker.AreEquivalent(currentBlockStatements, statements[j]))\n                {\n                    ReportIssue(context, currentBlockStatements, statements[j], constructType);\n                    return;\n                }\n            }\n        }\n    }\n\n    private static void ReportIssue(SonarSyntaxNodeReportingContext context, SyntaxList<StatementSyntax> statementsToReport, SyntaxList<StatementSyntax> locationProvider, string constructType)\n    {\n        var firstStatement = statementsToReport.FirstOrDefault();\n        if (firstStatement is null)\n        {\n            return;\n        }\n\n        var lastStatement = statementsToReport.Last();\n\n        context.ReportIssue(Rule, firstStatement.CreateLocation(lastStatement),\n            locationProvider.First().LineNumberToReport().ToString(), constructType);\n    }\n\n    private static bool IsApprovedStatement(StatementSyntax statement) =>\n        !statement.IsAnyKind(IgnoredStatementsInSwitch);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/ConstructorArgumentValueShouldExist.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class ConstructorArgumentValueShouldExist : ConstructorArgumentValueShouldExistBase<SyntaxKind, AttributeSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override SyntaxNode GetFirstAttributeArgument(AttributeSyntax attributeSyntax) =>\n        attributeSyntax.ArgumentList?.Arguments.FirstOrDefault();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/DangerousGetHandleShouldNotBeCalled.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class DangerousGetHandleShouldNotBeCalled : DangerousGetHandleShouldNotBeCalledBase<SyntaxKind, InvocationExpressionSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/DateAndTimeShouldNotBeUsedasTypeForPrimaryKey.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing static Microsoft.CodeAnalysis.VisualBasic.SyntaxKind;\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class DateAndTimeShouldNotBeUsedAsTypeForPrimaryKey : DateAndTimeShouldNotBeUsedasTypeForPrimaryKeyBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override IEnumerable<SyntaxNode> TypeNodesOfTemporalKeyProperties(SonarSyntaxNodeReportingContext context)\n    {\n        var classDeclaration = (ClassBlockSyntax)context.Node;\n        var className = classDeclaration.ClassStatement.Identifier.ValueText;\n        return PropertyDeclarationsInClass(classDeclaration)\n            .Where(x => IsCandidateProperty(x)\n                        && IsTemporalType(x.AsClause.Type().GetName())\n                        && IsKeyProperty(x, className))\n            .Select(x => x.AsClause.Type());\n    }\n\n    protected override bool IsTemporalType(string propertyTypeName) =>\n        propertyTypeName.Equals(\"Date\", Language.NameComparison)\n        || base.IsTemporalType(propertyTypeName);\n\n    private static IEnumerable<PropertyStatementSyntax> PropertyDeclarationsInClass(ClassBlockSyntax classDeclaration) =>\n        classDeclaration.Members\n            .OfType<PropertyStatementSyntax>()\n            .Concat(classDeclaration.Members.OfType<PropertyBlockSyntax>().Select(x => x.PropertyStatement));\n\n    private static bool IsCandidateProperty(PropertyStatementSyntax property) =>\n        (property.Modifiers.Any(x => x.IsKind(PublicKeyword))\n         || property.Modifiers.All(x => !(x.Kind() is PrivateKeyword or ProtectedKeyword or FriendKeyword)))\n        && property.Modifiers.All(x => !(x.Kind() is SharedKeyword or ReadOnlyKeyword or WriteOnlyKeyword));\n\n    private bool IsKeyProperty(PropertyStatementSyntax property, string className)\n    {\n        var propertyName = property.Identifier.ValueText;\n        return IsKeyPropertyBasedOnName(propertyName, className)\n            || HasKeyAttribute(property);\n    }\n\n    private bool HasKeyAttribute(PropertyStatementSyntax property) =>\n        property.AttributeLists\n            .SelectMany(x => x.Attributes)\n            .Any(x => MatchesAttributeName(x.GetName(), KeyAttributeTypeNames));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/DateTimeFormatShouldNotBeHardcoded.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class DateTimeFormatShouldNotBeHardcoded : DateTimeFormatShouldNotBeHardcodedBase<SyntaxKind, InvocationExpressionSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override Location HardCodedArgumentLocation(InvocationExpressionSyntax invocation)\n    {\n        var simpleArgument = (SimpleArgumentSyntax)invocation.ArgumentList.Arguments[0];\n        return simpleArgument.Expression.GetLocation();\n    }\n\n    protected override bool HasInvalidFirstArgument(InvocationExpressionSyntax invocation, SemanticModel semanticModel) =>\n        invocation.ArgumentList is { }\n        && invocation.ArgumentList.Arguments.Any()\n        && invocation.ArgumentList.Arguments[0] is SimpleArgumentSyntax simpleArgument\n        && simpleArgument.Expression.FindConstantValue(semanticModel) is string { Length: > 1 };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/DebuggerDisplayUsesExistingMembers.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class DebuggerDisplayUsesExistingMembers : DebuggerDisplayUsesExistingMembersBase<SimpleArgumentSyntax, SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override SyntaxNode AttributeTarget(SimpleArgumentSyntax attribute) =>\n        attribute.GetAncestor<AttributeListSyntax>()?.Parent;\n\n    protected override ImmutableArray<SyntaxNode> ResolvableIdentifiers(SyntaxNode expression) =>\n        expression is IdentifierNameSyntax identifierName\n            ? ImmutableArray.Create<SyntaxNode>(identifierName)\n            : ImmutableArray<SyntaxNode>.Empty;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/DeclareTypesInNamespaces.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class DeclareTypesInNamespaces : DeclareTypesInNamespacesBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n        protected override SyntaxKind[] SyntaxKinds { get; } =\n        {\n            SyntaxKind.ClassStatement,\n            SyntaxKind.StructureStatement,\n            SyntaxKind.EnumStatement,\n            SyntaxKind.InterfaceStatement\n        };\n\n        protected override SyntaxToken GetTypeIdentifier(SyntaxNode declaration)\n        {\n            switch (declaration.Kind())\n            {\n                case SyntaxKind.EnumStatement:\n                    return ((EnumStatementSyntax)declaration).Identifier;\n                case SyntaxKind.ClassStatement:\n                case SyntaxKind.InterfaceStatement:\n                case SyntaxKind.StructureStatement:\n                    return ((TypeStatementSyntax)declaration).Identifier;\n                default:\n                    return default;\n            }\n        }\n\n        protected override bool IsException(SyntaxNode node) => false;\n\n        protected override bool IsInnerTypeOrWithinNamespace(SyntaxNode declaration, SemanticModel semanticModel)\n        {\n            switch (declaration.Parent.Parent.Kind())\n            {\n                case SyntaxKind.ClassBlock:\n                case SyntaxKind.InterfaceBlock:\n                case SyntaxKind.StructureBlock:\n                case SyntaxKind.NamespaceBlock:\n                    return true;\n                default:\n                    // If declaration is an outer type that is not within a namespace block,\n                    // make sure there is no Root Namespace set in the project\n                    var typeSymbol = (INamedTypeSymbol)semanticModel.GetDeclaredSymbol(declaration);\n                    return typeSymbol == null ||\n                        !typeSymbol.ContainingNamespace.IsGlobalNamespace;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/DoNotCheckZeroSizeCollection.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class DoNotCheckZeroSizeCollection : DoNotCheckZeroSizeCollectionBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n        protected override string IEnumerableTString => \"IEnumerable(Of T)\";\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/DoNotHardcodeCredentials.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class DoNotHardcodeCredentials : DoNotHardcodeCredentialsBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override void InitializeActions(SonarParametrizedAnalysisContext context) =>\n        context.RegisterCompilationStartAction(\n            c =>\n            {\n                c.RegisterNodeAction(\n                    new VariableDeclarationBannedWordsFinder(this).AnalysisAction(),\n                    SyntaxKind.VariableDeclarator);\n\n                c.RegisterNodeAction(\n                    new AssignmentExpressionBannedWordsFinder(this).AnalysisAction(),\n                    SyntaxKind.SimpleAssignmentStatement);\n\n                c.RegisterNodeAction(\n                    new StringLiteralBannedWordsFinder(this).AnalysisAction(),\n                    SyntaxKind.StringLiteralExpression);\n\n                c.RegisterNodeAction(\n                    new AddExpressionBannedWordsFinder(this).AnalysisAction(),\n                    SyntaxKind.ConcatenateExpression,\n                    SyntaxKind.AddExpression);\n\n                c.RegisterNodeAction(\n                    new InterpolatedStringBannedWordsFinder(this).AnalysisAction(),\n                    SyntaxKind.InterpolatedStringExpression);\n\n                c.RegisterNodeAction(\n                    new InvocationBannedWordsFinder(this).AnalysisAction(),\n                    SyntaxKind.InvocationExpression);\n            });\n\n    protected override bool IsSecureStringAppendCharFromConstant(SyntaxNode argumentNode, SemanticModel model) =>\n        argumentNode is ArgumentSyntax argument\n        && argument.GetExpression() is { } argumentExpression\n        && argumentExpression switch\n        {\n            InvocationExpressionSyntax { Expression: { } accessed } => accessed.FindConstantValue(model) is string,\n            LiteralExpressionSyntax { RawKind: (int)SyntaxKind.CharacterLiteralExpression } => true,\n            IdentifierNameSyntax identifier when model.GetSymbolInfo(identifier) is { Symbol: ILocalSymbol { } local }\n                && local.DeclaringSyntaxReferences.Length == 1\n                && local.DeclaringSyntaxReferences[0].GetSyntax() is ForEachStatementSyntax { Expression: { } forEachExpression }\n                && forEachExpression.FindConstantValue(model) is string => true,\n            _ => false,\n        };\n\n    private sealed class VariableDeclarationBannedWordsFinder : CredentialWordsFinderBase<VariableDeclaratorSyntax>\n    {\n        public VariableDeclarationBannedWordsFinder(DoNotHardcodeCredentialsBase<SyntaxKind> analyzer) : base(analyzer) { }\n\n        protected override string AssignedValue(VariableDeclaratorSyntax syntaxNode, SemanticModel model) =>\n            syntaxNode.Initializer.Value.StringValue(model);\n\n        protected override string VariableName(VariableDeclaratorSyntax syntaxNode) =>\n            syntaxNode.Names[0].Identifier.ValueText; // We already tested the count in IsAssignedWithStringLiteral\n\n        protected override bool ShouldHandle(VariableDeclaratorSyntax syntaxNode, SemanticModel model) =>\n            syntaxNode.Names.Count == 1\n            && syntaxNode.Initializer?.Value is LiteralExpressionSyntax literalExpression\n            && literalExpression.IsKind(SyntaxKind.StringLiteralExpression)\n            && syntaxNode.Names[0].IsDeclarationKnownType(KnownType.System_String, model);\n    }\n\n    private sealed class AssignmentExpressionBannedWordsFinder : CredentialWordsFinderBase<AssignmentStatementSyntax>\n    {\n        public AssignmentExpressionBannedWordsFinder(DoNotHardcodeCredentialsBase<SyntaxKind> analyzer) : base(analyzer) { }\n\n        protected override string AssignedValue(AssignmentStatementSyntax syntaxNode, SemanticModel model) =>\n            syntaxNode.Right.StringValue(model);\n\n        protected override string VariableName(AssignmentStatementSyntax syntaxNode) =>\n            (syntaxNode.Left as IdentifierNameSyntax)?.Identifier.ValueText;\n\n        protected override bool ShouldHandle(AssignmentStatementSyntax syntaxNode, SemanticModel model) =>\n            syntaxNode.IsKind(SyntaxKind.SimpleAssignmentStatement)\n            && syntaxNode.Left.IsKnownType(KnownType.System_String, model)\n            && syntaxNode.Right.IsKind(SyntaxKind.StringLiteralExpression);\n    }\n\n    /// <summary>\n    /// This finder checks all string literal in the code, except VariableDeclarator, SimpleAssignmentExpression and String.Format invocation.\n    /// These two have their own finders with precise logic and variable name checking.\n    /// This class inspects all other standalone string literals for values considered as hardcoded passwords (in connection strings)\n    /// based on same rules as in VariableDeclarationBannedWordsFinder and AssignmentExpressionBannedWordsFinder.\n    /// </summary>\n    private sealed class StringLiteralBannedWordsFinder : CredentialWordsFinderBase<LiteralExpressionSyntax>\n    {\n        public StringLiteralBannedWordsFinder(DoNotHardcodeCredentialsBase<SyntaxKind> analyzer) : base(analyzer) { }\n\n        protected override string AssignedValue(LiteralExpressionSyntax syntaxNode, SemanticModel model) =>\n            syntaxNode.StringValue(model);\n\n        // We don't have a variable for cases that this finder should handle.  Cases with variable name are\n        // handled by VariableDeclarationBannedWordsFinder and AssignmentExpressionBannedWordsFinder\n        // Returning null is safe here, it will not be considered as a value.\n        protected override string VariableName(LiteralExpressionSyntax syntaxNode) =>\n            null;\n\n        protected override bool ShouldHandle(LiteralExpressionSyntax syntaxNode, SemanticModel model) =>\n            syntaxNode.IsKind(SyntaxKind.StringLiteralExpression) && ShouldHandle(syntaxNode.GetTopMostContainingMethod(), syntaxNode, model);\n\n        // We don't want to handle VariableDeclarator and SimpleAssignmentExpression,\n        // they are implemented by other finders with better and more precise logic.\n        private static bool ShouldHandle(SyntaxNode method, SyntaxNode current, SemanticModel model)\n        {\n            while (current is not null && current != method)\n            {\n                switch (current.Kind())\n                {\n                    case SyntaxKind.VariableDeclarator:\n                    case SyntaxKind.SimpleAssignmentStatement:\n                        return false;\n\n                    // Direct return from nested syntaxes that must be handled by this finder\n                    // before search reaches top level VariableDeclarator or SimpleAssignmentExpression.\n                    case SyntaxKind.InvocationExpression:\n                    case SyntaxKind.AddExpression: // String concatenation is not supported by other finders\n                    case SyntaxKind.ConcatenateExpression:\n                        return true;\n\n                    // Handle all arguments except those inside string.Format. InvocationBannedWordsFinder takes care of them.\n                    case SyntaxKind.SimpleArgument:\n                        return !(current.Parent.Parent is InvocationExpressionSyntax invocation && invocation.IsMethodInvocation(KnownType.System_String, \"Format\", model));\n\n                    default:\n                        current = current.Parent;\n                        break;\n                }\n            }\n            // We want to handle all other literals (property initializers, return statement and return values from lambdas, arrow functions, ...)\n            return true;\n        }\n    }\n\n    private sealed class AddExpressionBannedWordsFinder : CredentialWordsFinderBase<BinaryExpressionSyntax>\n    {\n        public AddExpressionBannedWordsFinder(DoNotHardcodeCredentialsBase<SyntaxKind> analyzer) : base(analyzer) { }\n\n        protected override string AssignedValue(BinaryExpressionSyntax syntaxNode, SemanticModel model)\n        {\n            var left = syntaxNode.Left is BinaryExpressionSyntax precedingConcat && precedingConcat.Kind() is SyntaxKind.ConcatenateExpression or SyntaxKind.AddExpression\n                ? precedingConcat.Right\n                : syntaxNode.Left;\n            return left.FindStringConstant(model) is { } leftString\n                && syntaxNode.Right.FindStringConstant(model) is { } rightString\n                    ? leftString + rightString\n                    : null;\n        }\n\n        protected override string VariableName(BinaryExpressionSyntax syntaxNode) => null;\n\n        protected override bool ShouldHandle(BinaryExpressionSyntax syntaxNode, SemanticModel model) => true;\n    }\n\n    private sealed class InterpolatedStringBannedWordsFinder : CredentialWordsFinderBase<InterpolatedStringExpressionSyntax>\n    {\n        public InterpolatedStringBannedWordsFinder(DoNotHardcodeCredentialsBase<SyntaxKind> analyzer) : base(analyzer) { }\n\n        protected override string AssignedValue(InterpolatedStringExpressionSyntax syntaxNode, SemanticModel model) =>\n            syntaxNode.Contents.JoinStr(null, x => x switch\n            {\n                InterpolationSyntax interpolation => interpolation.Expression.FindStringConstant(model),\n                InterpolatedStringTextSyntax text => text.TextToken.ToString(),\n                _ => null\n            } ?? KeywordSeparator.ToString()); // Unknown elements resolved to separator to terminate the keyword-value sequence\n\n        protected override string VariableName(InterpolatedStringExpressionSyntax syntaxNode) => null;\n\n        protected override bool ShouldHandle(InterpolatedStringExpressionSyntax syntaxNode, SemanticModel model) => true;\n    }\n\n    private sealed class InvocationBannedWordsFinder : CredentialWordsFinderBase<InvocationExpressionSyntax>\n    {\n        public InvocationBannedWordsFinder(DoNotHardcodeCredentials analyzer) : base(analyzer) { }\n\n        protected override string AssignedValue(InvocationExpressionSyntax syntaxNode, SemanticModel model)\n        {\n            var allArgs = syntaxNode.ArgumentList.Arguments.Select(x => x.GetExpression().FindStringConstant(model) ?? KeywordSeparator.ToString());\n            try\n            {\n                return string.Format(allArgs.First(), allArgs.Skip(1).ToArray());\n            }\n            catch (FormatException)\n            {\n                return null;\n            }\n        }\n\n        protected override string VariableName(InvocationExpressionSyntax syntaxNode) => null;\n\n        protected override bool ShouldHandle(InvocationExpressionSyntax syntaxNode, SemanticModel model) =>\n            syntaxNode.IsMethodInvocation(KnownType.System_String, \"Format\", model)\n            && model.GetSymbolInfo(syntaxNode).Symbol is IMethodSymbol symbol\n            && symbol.Parameters.First().Type.Is(KnownType.System_String);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/DoNotHardcodeSecrets.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class DoNotHardcodeSecrets : DoNotHardcodeSecretsBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override void RegisterNodeActions(SonarCompilationStartAnalysisContext context)\n    {\n        context.RegisterNodeAction(\n            ReportIssues,\n            SyntaxKind.AddAssignmentStatement,\n            SyntaxKind.ConcatenateAssignmentStatement,\n            SyntaxKind.SimpleAssignmentStatement,\n            SyntaxKind.VariableDeclarator,\n            SyntaxKind.PropertyStatement,\n            SyntaxKind.EqualsExpression);\n\n        context.RegisterNodeAction(c =>\n            {\n                var invocationExpression = (InvocationExpressionSyntax)c.Node;\n\n                if (invocationExpression.Expression is MemberAccessExpressionSyntax memberAccessExpression\n                    && memberAccessExpression.Name.Identifier.ValueText == EqualsName\n                    && invocationExpression.ArgumentList?.Arguments.FirstOrDefault() is { } firstArgument\n                    && memberAccessExpression.IsMemberAccessOnKnownType(EqualsName, KnownType.System_String, c.Model))\n                {\n                    ReportIssuesForEquals(c, memberAccessExpression, IdentifierAndValue(memberAccessExpression.Expression, firstArgument));\n                }\n            },\n            SyntaxKind.InvocationExpression);\n    }\n\n    protected override SyntaxNode IdentifierRoot(SyntaxNode node) =>\n        node switch\n        {\n            AssignmentStatementSyntax assignment => assignment.Left,\n            BinaryExpressionSyntax { Left: IdentifierNameSyntax left } => left,\n            BinaryExpressionSyntax { Right: IdentifierNameSyntax right } => right,\n            _ => node\n        };\n\n    protected override SyntaxNode RightHandSide(SyntaxNode node) =>\n        node switch\n        {\n            AssignmentStatementSyntax assignment => assignment.Right,\n            VariableDeclaratorSyntax variable => variable.Initializer?.Value,\n            PropertyStatementSyntax property => property.Initializer?.Value,\n            BinaryExpressionSyntax { Left: IdentifierNameSyntax } binary => binary.Right,\n            BinaryExpressionSyntax { Right: IdentifierNameSyntax } binary => binary.Left,\n            _ => null\n        };\n\n    private static IdentifierValuePair IdentifierAndValue(ExpressionSyntax expression, ArgumentSyntax argument) =>\n        expression switch\n        {\n            MemberAccessExpressionSyntax or IdentifierNameSyntax or InvocationExpressionSyntax => new(expression.GetIdentifier(), argument.GetExpression()),\n            LiteralExpressionSyntax literal => new(argument.GetExpression().GetIdentifier(), literal),\n            _ => null,\n        };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/DoNotInstantiateSharedClasses.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class DoNotInstantiateSharedClasses : DoNotInstantiateSharedClassesBase\n    {\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var creationSyntax = (ObjectCreationExpressionSyntax)c.Node;\n\n                    var createdType = c.Model.GetTypeInfo(creationSyntax).Type;\n                    if (createdType != null &&\n                        createdType.GetAttributes(KnownType.System_ComponentModel_Composition_PartCreationPolicyAttribute).Any(IsShared))\n                    {\n                        c.ReportIssue(rule, creationSyntax);\n                    }\n                },\n                SyntaxKind.ObjectCreationExpression);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/DoNotLockOnSharedResource.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class DoNotLockOnSharedResource : DoNotLockOnSharedResourceBase\n    {\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var lockStatement = (SyncLockStatementSyntax)c.Node;\n\n                    if (IsLockOnThis(lockStatement.Expression) ||\n                        IsLockOnStringLiteral(lockStatement.Expression) ||\n                        IsLockOnForbiddenKnownType(lockStatement.Expression, c.Model))\n                    {\n                        c.ReportIssue(rule, lockStatement.Expression);\n                    }\n                },\n                SyntaxKind.SyncLockStatement);\n        }\n\n        private static bool IsLockOnThis(ExpressionSyntax expression) =>\n            expression.IsKind(SyntaxKind.MeExpression);\n\n        private static bool IsLockOnStringLiteral(ExpressionSyntax expression) =>\n            expression.IsKind(SyntaxKind.StringLiteralExpression);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/DoNotLockWeakIdentityObjects.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class DoNotLockWeakIdentityObjects : DoNotLockWeakIdentityObjectsBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n        protected override SyntaxKind SyntaxKind { get; } = SyntaxKind.SyncLockStatement;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/DoNotNestTernaryOperators.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class DoNotNestTernaryOperators : DoNotNestTernaryOperatorsBase\n    {\n        private const string MessageFormat = \"Extract this nested If operator into independent If...Then...Else statements.\";\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n                {\n                    if (c.Node.Ancestors()\n                        .TakeWhile(x => !x.IsAnyKind(\n                            SyntaxKind.MultiLineFunctionLambdaExpression,\n                            SyntaxKind.SingleLineFunctionLambdaExpression,\n                            SyntaxKind.MultiLineSubLambdaExpression,\n                            SyntaxKind.SingleLineSubLambdaExpression))\n                        .OfType<TernaryConditionalExpressionSyntax>()\n                        .Any())\n                    {\n                        c.ReportIssue(Rule, c.Node);\n                    }\n                },\n                SyntaxKind.TernaryConditionalExpression);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/DoNotOverwriteCollectionElements.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class DoNotOverwriteCollectionElements : DoNotOverwriteCollectionElementsBase<SyntaxKind, StatementSyntax>\n{\n    private static readonly HashSet<SyntaxKind> IdentifierOrLiteral =\n    [\n        SyntaxKind.IdentifierName,\n        SyntaxKind.StringLiteralExpression,\n        SyntaxKind.NumericLiteralExpression,\n        SyntaxKind.CharacterLiteralExpression,\n        SyntaxKind.NothingLiteralExpression,\n        SyntaxKind.TrueLiteralExpression,\n        SyntaxKind.FalseLiteralExpression\n    ];\n\n    private static readonly HashSet<string> CollectionModifyingMethods =\n        new(StringComparer.InvariantCultureIgnoreCase) // VB is case-insensitive\n        {\n            \"Item\",\n            \"Add\",\n        };\n\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            AnalysisAction,\n            SyntaxKind.ExpressionStatement,\n            SyntaxKind.SimpleAssignmentStatement);\n\n    protected override SyntaxNode GetCollectionIdentifier(StatementSyntax statement)\n    {\n        var invocation = GetInvocation(statement);\n        return invocation is not null\n            ? GetInvokedMethodContainer(invocation).RemoveParentheses()\n            : null;\n    }\n\n    protected override SyntaxNode GetIndexOrKey(StatementSyntax statement)\n    {\n        var invocation = GetInvocation(statement);\n        return invocation is not null\n            ? GetFirstArgumentExpression(invocation).RemoveParentheses()\n            : null;\n    }\n\n    protected override bool IsIdentifierOrLiteral(SyntaxNode node) =>\n        node.IsAnyKind(IdentifierOrLiteral);\n\n    // In Visual Basic all collection/dictionary item sets are made through invocations\n    private static InvocationExpressionSyntax GetInvocation(StatementSyntax statement)\n    {\n        switch (statement.Kind())\n        {\n            case SyntaxKind.SimpleAssignmentStatement:\n                var assignmentStatement = (AssignmentStatementSyntax)statement;\n                return assignmentStatement.Left as InvocationExpressionSyntax;\n\n            case SyntaxKind.ExpressionStatement:\n                var expression = ((ExpressionStatementSyntax)statement).Expression;\n\n                return expression.IsKind(SyntaxKind.ConditionalAccessExpression)\n                    ? ((ConditionalAccessExpressionSyntax)expression).WhenNotNull as InvocationExpressionSyntax\n                    : expression as InvocationExpressionSyntax;\n\n            default:\n                return null;\n        }\n    }\n\n    private static SyntaxNode GetInvokedMethodContainer(InvocationExpressionSyntax invocation)\n    {\n        // Supported syntax structures:\n        // dictionary(key) = value\n        // dictionary.Item(key) = value\n        // dictionary.Add(key, value)\n        // list(index) = value\n        // list.Item(index) = value\n        var expression = invocation.Expression.RemoveParentheses();\n        switch (expression.Kind())\n        {\n            case SyntaxKind.SimpleMemberAccessExpression:\n                var memberAccess = (MemberAccessExpressionSyntax)expression;\n                if (!CollectionModifyingMethods.Contains(memberAccess.Name.ToString()))\n                {\n                    // Possibly an indexer syntax\n                    return memberAccess;\n                }\n                if (memberAccess.Expression is null) // Possibly in a ConditionalAccess\n                {\n                    var conditionalAccess = memberAccess.Parent.Parent as ConditionalAccessExpressionSyntax;\n                    return conditionalAccess?.Expression;\n                }\n\n                if (memberAccess.Name.ToString().Equals(\"Add\", StringComparison.OrdinalIgnoreCase) && invocation.ArgumentList?.Arguments.Count == 1)\n                {\n                    return null;    // #2674 Do not raise on ICollection.Add(item)\n                }\n\n                return memberAccess.Expression; // Return the collection identifier containing the method\n\n            case SyntaxKind.IdentifierName:\n                return expression;\n\n            default:\n                return null;\n        }\n    }\n\n    private static ExpressionSyntax GetFirstArgumentExpression(InvocationExpressionSyntax invocation) =>\n        invocation.ArgumentList?.Arguments.ElementAtOrDefault(0)?.GetExpression().RemoveParentheses();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/DoNotThrowFromDestructors.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class DoNotThrowFromDestructors : DoNotThrowFromDestructorsBase\n    {\n        private const string MessageFormat = \"Remove this 'Throw' statement.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    if (IsFinalizer(c.Node.FirstAncestorOrSelf<MethodBlockSyntax>()))\n                    {\n                        c.ReportIssue(rule, c.Node);\n                    }\n                },\n                SyntaxKind.ThrowStatement);\n        }\n\n        private bool IsFinalizer(MethodBlockSyntax methodBlockSyntax)\n        {\n            if (methodBlockSyntax == null)\n            {\n                return false;\n            }\n\n            var subOrFunctionDeclaration = methodBlockSyntax.SubOrFunctionStatement;\n            var noParam = subOrFunctionDeclaration.ParameterList == null || subOrFunctionDeclaration.ParameterList.Parameters.Count == 0;\n            var noTypeParam = subOrFunctionDeclaration.TypeParameterList == null || subOrFunctionDeclaration.TypeParameterList.Parameters.Count == 0;\n            var isSub = subOrFunctionDeclaration.SubOrFunctionKeyword.IsKind(SyntaxKind.SubKeyword);\n            var isProtected = subOrFunctionDeclaration.Modifiers.Any(modifier => modifier.IsKind(SyntaxKind.ProtectedKeyword));\n\n            return noParam && noTypeParam && isSub && isProtected &&\n                subOrFunctionDeclaration.Identifier.ValueText.Equals(\"Finalize\", StringComparison.InvariantCultureIgnoreCase);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/DoNotUseByVal.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class DoNotUseByVal : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S3860\";\n        private const string MessageFormat = \"Remove this redundant 'ByVal' modifier.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(c =>\n            {\n                var parameter = (ParameterSyntax)c.Node;\n                foreach (var byVal in parameter.Modifiers.Where(IsByVal))\n                {\n                    c.ReportIssue(rule, byVal);\n                }\n            },\n            SyntaxKind.Parameter);\n        }\n\n        public static bool IsByVal(SyntaxToken modifier)\n        {\n            return modifier.IsKind(SyntaxKind.ByValKeyword);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/DoNotUseByValCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.VisualBasic)]\n    public sealed class DoNotUseByValCodeFix : SonarCodeFix\n    {\n        internal const string Title = \"Remove the 'ByVal' modifier.\";\n\n        public override ImmutableArray<string> FixableDiagnosticIds =>\n            ImmutableArray.Create(DoNotUseByVal.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n\n            if (root.FindNode(diagnosticSpan) is ParameterSyntax oldNode)\n            {\n                context.RegisterCodeFix(\n                    Title,\n                    c =>\n                    {\n                        var modifiers = default(SyntaxTokenList)\n                            .AddRange(oldNode.Modifiers.Where(m => !DoNotUseByVal.IsByVal(m)));\n\n                        var newNode = oldNode.WithModifiers(modifiers);\n                        var newRoot = root.ReplaceNode(oldNode, newNode);\n\n                        return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                    },\n                    context.Diagnostics);\n            }\n\n            return Task.CompletedTask;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/DoNotUseDateTimeNow.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class DoNotUseDateTimeNow : DoNotUseDateTimeNowBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override bool IsInsideNameOf(SyntaxNode node) =>\n        node.Ancestors()\n            .OfType<NameOfExpressionSyntax>()\n            .Any();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/DoNotUseIIf.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class DoNotUseIIf : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S3866\";\n        private const string MessageFormat = \"Use the 'If' operator here instead of 'IIf'.\";\n\n        private const string IIfOperatorName = \"IIf\";\n\n        private static readonly DiagnosticDescriptor Rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n            {\n                var invocationExpression = (InvocationExpressionSyntax)c.Node;\n                var invokedMethod = c.Model.GetSymbolInfo(invocationExpression).Symbol as IMethodSymbol;\n\n                if (IsIIf(invokedMethod))\n                {\n                    c.ReportIssue(Rule, invocationExpression);\n                }\n            },\n            SyntaxKind.InvocationExpression);\n\n        private static bool IsIIf(IMethodSymbol method) =>\n            method != null\n            && method.Name == IIfOperatorName\n            && method.ContainingType.Is(KnownType.Microsoft_VisualBasic_Interaction);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/DoNotUseIIfCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.VisualBasic)]\n    public sealed class DoNotUseIIfCodeFix : SonarCodeFix\n    {\n        internal const string IfOperatorName = \"If\";\n        internal const string Title = \"Use 'If' operator.\";\n\n        public override ImmutableArray<string> FixableDiagnosticIds =>\n            ImmutableArray.Create(DoNotUseIIf.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n\n            if (root.FindNode(diagnosticSpan) is InvocationExpressionSyntax iifInvocation)\n            {\n                context.RegisterCodeFix(\n                    Title,\n                    c =>\n                    {\n                        var ifInvocation = SyntaxFactory.InvocationExpression(\n                            SyntaxFactory.IdentifierName(IfOperatorName), iifInvocation.ArgumentList);\n\n                        var newRoot = root.ReplaceNode(iifInvocation, ifInvocation);\n\n                        return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                    },\n                    context.Diagnostics);\n            }\n\n            return Task.CompletedTask;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/EmptyMethod.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class EmptyMethod : EmptyMethodBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n        protected override HashSet<SyntaxKind> SyntaxKinds { get; } =\n        [\n            SyntaxKind.FunctionBlock,\n            SyntaxKind.SubBlock\n        ];\n\n        protected override void CheckMethod(SonarSyntaxNodeReportingContext context)\n        {\n            var methodBlock = (MethodBlockSyntax)context.Node;\n            if (methodBlock.Statements.Count == 0\n                && !ContainsComments(methodBlock.EndSubOrFunctionStatement.GetLeadingTrivia())\n                && !ShouldMethodBeExcluded(context, methodBlock.SubOrFunctionStatement))\n            {\n                context.ReportIssue(Rule, methodBlock.SubOrFunctionStatement.Identifier);\n            }\n        }\n\n        private static bool ContainsComments(IEnumerable<SyntaxTrivia> trivias) =>\n            trivias.Any(s => s.IsKind(SyntaxKind.CommentTrivia));\n\n        private static bool ShouldMethodBeExcluded(SonarSyntaxNodeReportingContext context, MethodStatementSyntax methodStatement)\n        {\n            if (methodStatement.Modifiers.Any(SyntaxKind.MustOverrideKeyword)\n                || methodStatement.Modifiers.Any(SyntaxKind.OverridableKeyword)\n                || IsDllImport(context.Model, methodStatement))\n            {\n                return true;\n            }\n            else if (context.Model.GetDeclaredSymbol(methodStatement) is { IsOverride: true } methodSymbol)\n            {\n                return methodSymbol.OverriddenMethod is { IsAbstract: true } || context.IsTestProject();\n            }\n            else\n            {\n                return false;\n            }\n        }\n\n        private static bool IsDllImport(SemanticModel model, MethodStatementSyntax methodStatement) =>\n            methodStatement.AttributeLists.SelectMany(x => x.Attributes).Any(x => x.IsKnownType(KnownType.System_Runtime_InteropServices_DllImportAttribute, model));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/EmptyNestedBlock.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class EmptyNestedBlock : EmptyNestedBlockBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n        protected override SyntaxKind[] SyntaxKinds { get; } = new[]\n        {\n            SyntaxKind.SimpleDoLoopBlock,\n            SyntaxKind.DoLoopUntilBlock,\n            SyntaxKind.DoLoopWhileBlock,\n            SyntaxKind.DoUntilLoopBlock,\n            SyntaxKind.DoWhileLoopBlock,\n            SyntaxKind.ForBlock,\n            SyntaxKind.ForEachBlock,\n            // The Else and ElseIf blocks are inside the MultiLineIfBlock\n            SyntaxKind.MultiLineIfBlock,\n            SyntaxKind.SelectBlock,\n            // The CatchBlock and FinallyBlock are inside the TryBlock\n            SyntaxKind.TryBlock,\n            SyntaxKind.UsingBlock,\n            SyntaxKind.WhileBlock,\n            SyntaxKind.WithBlock\n        };\n\n        /**\n         * Verify that the given block has no statements and no comments inside\n         * (notable exception: the Select block)\n         *\n         * Note: Roslyn maps the comments which are inside a block as trivia of the following block\n         * e.g. in the below snippet, the comment will be part of the Finally block\n         *\n         * Try\n         *   ' my comment\n         * Finally\n         * End Try\n         */\n\n        protected override IEnumerable<SyntaxNode> EmptyBlocks(SyntaxNode node)\n        {\n            switch (node.Kind())\n            {\n                case SyntaxKind.SimpleDoLoopBlock:\n                case SyntaxKind.DoLoopUntilBlock:\n                case SyntaxKind.DoLoopWhileBlock:\n                case SyntaxKind.DoUntilLoopBlock:\n                case SyntaxKind.DoWhileLoopBlock:\n                    return VisitDoLoopBlock((DoLoopBlockSyntax)node);\n\n                case SyntaxKind.ForBlock:\n                    return VisitForBlock((ForBlockSyntax)node);\n\n                case SyntaxKind.ForEachBlock:\n                    return VisitForEachBlock((ForEachBlockSyntax)node);\n\n                case SyntaxKind.MultiLineIfBlock:\n                    return VisitMultiLineIfBlock((MultiLineIfBlockSyntax)node);\n\n                case SyntaxKind.SelectBlock:\n                    return VisitSelectBlock((SelectBlockSyntax)node);\n\n                case SyntaxKind.TryBlock:\n                    return VisitTryBlock((TryBlockSyntax)node);\n\n                case SyntaxKind.UsingBlock:\n                    return VisitUsingBlock((UsingBlockSyntax)node);\n\n                case SyntaxKind.WhileBlock:\n                    return VisitWhileBlock((WhileBlockSyntax)node);\n\n                case SyntaxKind.WithBlock:\n                    return VisitWithBlock((WithBlockSyntax)node);\n\n                default:\n                    // we do not throw an exception as the language can evolve over time\n                    return Enumerable.Empty<SyntaxNode>();\n            }\n        }\n\n        private static IEnumerable<SyntaxNode> VisitDoLoopBlock(DoLoopBlockSyntax node)\n        {\n            if (!node.Statements.Any() && NoCommentsOrConditionalCompilationBefore(node.LoopStatement))\n            {\n                yield return node.DoStatement;\n            }\n        }\n\n        private static IEnumerable<SyntaxNode> VisitForBlock(ForBlockSyntax node)\n        {\n            if (!node.Statements.Any() && NoCommentsOrConditionalCompilationBefore(node.NextStatement))\n            {\n                yield return node.ForStatement;\n            }\n        }\n\n        private static IEnumerable<SyntaxNode> VisitForEachBlock(ForEachBlockSyntax node)\n        {\n            if (!node.Statements.Any() && NoCommentsOrConditionalCompilationBefore(node.NextStatement))\n            {\n                yield return node.ForEachStatement;\n            }\n        }\n\n        private static IEnumerable<SyntaxNode> VisitMultiLineIfBlock(MultiLineIfBlockSyntax node)\n        {\n            var result = new List<SyntaxNode>();\n            if (node.ElseBlock == null)\n            {\n                if (node.ElseIfBlocks.Any())\n                {\n                    result.AddRange(VerifyIfAndMostElseIfBlocks(node));\n                    result.AddRange(VerifyElseIfBlock(node.ElseIfBlocks[node.ElseIfBlocks.Count - 1], node.EndIfStatement));\n                }\n                else\n                {\n                    result.AddRange(VerifyIfBlock(node, node.EndIfStatement));\n                }\n            }\n            else\n            {\n                if (node.ElseIfBlocks.Any())\n                {\n                    result.AddRange(VerifyIfAndMostElseIfBlocks(node));\n                    result.AddRange(VerifyElseIfBlock(node.ElseIfBlocks[node.ElseIfBlocks.Count - 1], node.ElseBlock));\n                    result.AddRange(VerifyElseBlock(node.ElseBlock, node.EndIfStatement));\n                }\n                else\n                {\n                    result.AddRange(VerifyIfBlock(node, node.ElseBlock));\n                    result.AddRange(VerifyElseBlock(node.ElseBlock, node.EndIfStatement));\n                }\n            }\n            return result;\n        }\n\n        private static IEnumerable<SyntaxNode> VisitSelectBlock(SelectBlockSyntax node)\n        {\n            if (!node.CaseBlocks.Any())\n            {\n                yield return node.SelectStatement;\n            }\n        }\n\n        private static IEnumerable<SyntaxNode> VisitTryBlock(TryBlockSyntax node)\n        {\n            var result = new List<SyntaxNode>();\n            if (node.CatchBlocks.Any() && node.FinallyBlock != null)\n            {\n                result.AddRange(VerifyTryAndMostCatches(node));\n                result.AddRange(VerifyCatchBlock(node.CatchBlocks[node.CatchBlocks.Count - 1], node.FinallyBlock));\n                result.AddRange(VerifyFinallyBlock(node.FinallyBlock, node.EndTryStatement));\n            }\n            else if (node.FinallyBlock != null)\n            {\n                result.AddRange(VerifyTryBlock(node, node.FinallyBlock));\n                result.AddRange(VerifyFinallyBlock(node.FinallyBlock, node.EndTryStatement));\n            }\n            else if (node.CatchBlocks.Any())\n            {\n                result.AddRange(VerifyTryAndMostCatches(node));\n                result.AddRange(VerifyCatchBlock(node.CatchBlocks[node.CatchBlocks.Count - 1], node.EndTryStatement));\n            }\n            else\n            {\n                throw new InvalidOperationException(\"Try block must be followed by at least one catch or one finally block\");\n            }\n            return result;\n        }\n\n        private static IEnumerable<SyntaxNode> VisitUsingBlock(UsingBlockSyntax node)\n        {\n            if (!node.Statements.Any() && NoCommentsOrConditionalCompilationBefore(node.EndUsingStatement))\n            {\n                yield return node.UsingStatement;\n            }\n        }\n\n        private static IEnumerable<SyntaxNode> VisitWhileBlock(WhileBlockSyntax node)\n        {\n            if (!node.Statements.Any() && NoCommentsOrConditionalCompilationBefore(node.EndWhileStatement))\n            {\n                yield return node.WhileStatement;\n            }\n        }\n\n        private static IEnumerable<SyntaxNode> VisitWithBlock(WithBlockSyntax node)\n        {\n            if (!node.Statements.Any() && NoCommentsOrConditionalCompilationBefore(node.EndWithStatement))\n            {\n                yield return node.WithStatement;\n            }\n        }\n\n        private static IEnumerable<SyntaxNode> VerifyIfAndMostElseIfBlocks(MultiLineIfBlockSyntax ifBlock)\n        {\n            var result = new List<SyntaxNode>();\n            result.AddRange(VerifyIfBlock(ifBlock, ifBlock.ElseIfBlocks[0]));\n            // verify all ElseIf except the last one\n            for (int i = 0; i < ifBlock.ElseIfBlocks.Count - 1; i++)\n            {\n                result.AddRange(VerifyElseIfBlock(ifBlock.ElseIfBlocks[i], ifBlock.ElseIfBlocks[i + 1]));\n            }\n            return result;\n        }\n\n        private static IEnumerable<SyntaxNode> VerifyIfBlock(MultiLineIfBlockSyntax ifBlock, SyntaxNode node)\n        {\n            if (!ifBlock.Statements.Any() && NoCommentsOrConditionalCompilationBefore(node))\n            {\n                yield return ifBlock.IfStatement;\n            }\n        }\n\n        private static IEnumerable<SyntaxNode> VerifyElseIfBlock(ElseIfBlockSyntax elseIfBlock, SyntaxNode node)\n        {\n            if (!elseIfBlock.Statements.Any() && NoCommentsOrConditionalCompilationBefore(node))\n            {\n                yield return elseIfBlock.ElseIfStatement;\n            }\n        }\n\n        private static IEnumerable<SyntaxNode> VerifyElseBlock(ElseBlockSyntax elseBlock, SyntaxNode node)\n        {\n            if (!elseBlock.Statements.Any() && NoCommentsOrConditionalCompilationBefore(node))\n            {\n                yield return elseBlock.ElseStatement;\n            }\n        }\n\n        private static IEnumerable<SyntaxNode> VerifyTryAndMostCatches(TryBlockSyntax node)\n        {\n            var result = new List<SyntaxNode>();\n            result.AddRange(VerifyTryBlock(node, node.CatchBlocks[0]));\n            // verify all catches except the last one\n            for (int i = 0; i < node.CatchBlocks.Count - 1; i++)\n            {\n                result.AddRange(VerifyCatchBlock(node.CatchBlocks[i], node.CatchBlocks[i + 1]));\n            }\n            return result;\n        }\n\n        private static IEnumerable<SyntaxNode> VerifyTryBlock(TryBlockSyntax node, SyntaxNode nextBlock)\n        {\n            if (!node.Statements.Any() && NoCommentsOrConditionalCompilationBefore(nextBlock))\n            {\n                yield return node.TryStatement;\n            }\n        }\n\n        private static IEnumerable<SyntaxNode> VerifyCatchBlock(CatchBlockSyntax node, SyntaxNode nextBlock)\n        {\n            if (!node.Statements.Any() && NoCommentsOrConditionalCompilationBefore(nextBlock))\n            {\n                yield return node.CatchStatement;\n            }\n        }\n\n        private static IEnumerable<SyntaxNode> VerifyFinallyBlock(FinallyBlockSyntax node, SyntaxNode nextBlock)\n        {\n            if (!node.Statements.Any() && NoCommentsOrConditionalCompilationBefore(nextBlock))\n            {\n                yield return node.FinallyStatement;\n            }\n        }\n\n        private static bool NoCommentsOrConditionalCompilationBefore(SyntaxNode node) =>\n            !node.GetLeadingTrivia().Any(t => t.IsComment() || t.IsKind(SyntaxKind.DisabledTextTrivia));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/EncryptionAlgorithmsShouldBeSecure.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class EncryptionAlgorithmsShouldBeSecure : EncryptionAlgorithmsShouldBeSecureBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n        public EncryptionAlgorithmsShouldBeSecure() : base(AnalyzerConfiguration.AlwaysEnabled) { }\n\n        protected override TrackerBase<SyntaxKind, PropertyAccessContext>.Condition IsInsideObjectInitializer() =>\n            context => context.Node.FirstAncestorOrSelf<ObjectMemberInitializerSyntax>() != null;\n\n        protected override TrackerBase<SyntaxKind, InvocationContext>.Condition HasPkcs1PaddingArgument() =>\n            (context) =>\n            {\n                var argumentList = ((InvocationExpressionSyntax)context.Node).ArgumentList;\n                var values = argumentList.ArgumentValuesForParameter(context.Model, \"padding\");\n                return values.Length == 1\n                    && values[0] is ExpressionSyntax valueSyntax\n                    && context.Model.GetSymbolInfo(valueSyntax).Symbol is ISymbol symbol\n                    && symbol.Name == \"Pkcs1\";\n            };\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/EndStatementUsage.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class EndStatementUsage : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S1147\";\n        private const string MessageFormat = \"Remove this call to 'End' or ensure it is really required.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c => c.ReportIssue(rule, c.Node),\n                SyntaxKind.EndStatement);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/EnumNameHasEnumSuffix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class EnumNameHasEnumSuffix : EnumNameHasEnumSuffixBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language { get; } = VisualBasicFacade.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/EventNameContainsBeforeOrAfter.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class EventNameContainsBeforeOrAfter : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S2349\";\n        private const string MessageFormat = \"Rename this event to remove the '{0}' {1}.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        private const string PrefixLiteral = \"prefix\";\n        private const string SuffixLiteral = \"suffix\";\n        private const string AfterLiteral = \"after\";\n        private const string BeforeLiteral = \"before\";\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var eventStatement = (EventStatementSyntax)c.Node;\n                    var name = eventStatement.Identifier.ValueText;\n\n                    string part;\n                    string matched;\n\n                    if (name.StartsWith(BeforeLiteral, System.StringComparison.OrdinalIgnoreCase))\n                    {\n                        part = PrefixLiteral;\n                        matched = name.Substring(0, BeforeLiteral.Length);\n                    }\n                    else if (name.StartsWith(AfterLiteral, System.StringComparison.OrdinalIgnoreCase))\n                    {\n                        part = PrefixLiteral;\n                        matched = name.Substring(0, AfterLiteral.Length);\n                    }\n                    else if (name.EndsWith(BeforeLiteral, System.StringComparison.OrdinalIgnoreCase))\n                    {\n                        part = SuffixLiteral;\n                        matched = name.Substring(name.Length - 1 - BeforeLiteral.Length);\n                    }\n                    else if (name.EndsWith(AfterLiteral, System.StringComparison.OrdinalIgnoreCase))\n                    {\n                        part = SuffixLiteral;\n                        matched = name.Substring(name.Length - 1 - AfterLiteral.Length);\n                    }\n                    else\n                    {\n                        return;\n                    }\n\n                    c.ReportIssue(rule, eventStatement.Identifier, matched, part);\n                },\n                SyntaxKind.EventStatement);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/ExceptionsShouldBePublic.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class ExceptionsShouldBePublic : ExceptionsShouldBePublicBase<SyntaxKind>\n{\n    protected override string MessageFormat => \"Make this exception 'Public'.\";\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/ExcludeFromCodeCoverageAttributesNeedJustification.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class ExcludeFromCodeCoverageAttributesNeedJustification : ExcludeFromCodeCoverageAttributesNeedJustificationBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override SyntaxNode GetJustificationExpression(SyntaxNode node) =>\n        node is AttributeSyntax { ArgumentList.Arguments: { Count: 1 } arguments }\n            && arguments[0] is SimpleArgumentSyntax { Expression: { } } argument\n            && Language.NameComparer.Equals(argument.GetName(), JustificationPropertyName)\n                ? argument.Expression\n                : null;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/ExitStatementUsage.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class ExitStatementUsage : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S3385\";\n    private const string MessageFormat = \"Remove this 'Exit' statement.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            c => c.ReportIssue(Rule, c.Node),\n            SyntaxKind.ExitFunctionStatement,\n            SyntaxKind.ExitPropertyStatement,\n            SyntaxKind.ExitSubStatement);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/ExpectedExceptionAttributeShouldNotBeUsed.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CFG.Extensions;\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class ExpectedExceptionAttributeShouldNotBeUsed : ExpectedExceptionAttributeShouldNotBeUsedBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override SyntaxNode FindExpectedExceptionAttribute(SyntaxNode node) =>\n        ((MethodStatementSyntax)node).AttributeLists.SelectMany(x => x.Attributes).FirstOrDefault(x => x.GetName() is \"ExpectedException\" or \"ExpectedExceptionAttribute\");\n\n    protected override bool HasMultiLineBody(SyntaxNode node) =>\n        node.Parent is MethodBlockSyntax { Statements.Count: > 1 };\n\n    protected override bool AssertInCatchFinallyBlock(SyntaxNode node)\n    {\n        var walker = new CatchFinallyAssertion();\n        foreach (var x in node.Parent.DescendantNodes().Where(x => x.Kind() is SyntaxKind.CatchBlock or SyntaxKind.FinallyBlock))\n        {\n            if (!walker.HasAssertion)\n            {\n                walker.SafeVisit(x);\n            }\n        }\n        return walker.HasAssertion;\n    }\n\n    private sealed class CatchFinallyAssertion : SafeVisualBasicSyntaxWalker\n    {\n        public bool HasAssertion { get; set; }\n\n        public override void VisitInvocationExpression(InvocationExpressionSyntax node) =>\n            HasAssertion = HasAssertion || node.Expression.ToString().SplitCamelCaseToWords().Intersect(KnownMethods.AssertionMethodParts).Any();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/ExpressionComplexity.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class ExpressionComplexity : ExpressionComplexityBase<SyntaxKind>\n{\n    protected override ILanguageFacade Language { get; } = VisualBasicFacade.Instance;\n\n    protected override HashSet<SyntaxKind> TransparentKinds { get; } =\n        [\n            SyntaxKind.ParenthesizedExpression,\n            SyntaxKind.NotExpression,\n        ];\n\n    protected override HashSet<SyntaxKind> ComplexityIncreasingKinds { get; } =\n        [\n            SyntaxKind.AndExpression,\n            SyntaxKind.AndAlsoExpression,\n            SyntaxKind.OrExpression,\n            SyntaxKind.OrElseExpression,\n            SyntaxKind.ExclusiveOrExpression\n        ];\n\n    protected override SyntaxNode[] ExpressionChildren(SyntaxNode node) =>\n        node switch\n        {\n            BinaryExpressionSyntax\n            {\n                RawKind: (int)SyntaxKind.AndExpression\n                or (int)SyntaxKind.AndAlsoExpression\n                or (int)SyntaxKind.OrExpression\n                or (int)SyntaxKind.OrElseExpression\n                or (int)SyntaxKind.ExclusiveOrExpression\n            } binary => new[] { binary.Left, binary.Right },\n            ParenthesizedExpressionSyntax parenthesized => new[] { parenthesized.Expression },\n            UnaryExpressionSyntax { RawKind: (int)SyntaxKind.NotExpression } unary => new[] { unary.Operand },\n            _ => Array.Empty<SyntaxNode>(),\n        };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/ExtensionMethodShouldNotExtendObject.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class ExtensionMethodShouldNotExtendObject : ExtensionMethodShouldNotExtendObjectBase<SyntaxKind, MethodStatementSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override bool IsExtensionMethod(MethodStatementSyntax declaration, SemanticModel semanticModel) =>\n        declaration.Parent.Parent is ModuleBlockSyntax\n        && declaration.AttributeLists.SelectMany(x => x.Attributes).Any(x => x.IsKnownType(KnownType.System_Runtime_CompilerServices_ExtensionAttribute, semanticModel));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/FieldShadowsParentField.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class FieldShadowsParentField : FieldShadowsParentFieldBase<SyntaxKind, ModifiedIdentifierSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n                {\n                    var fieldDeclaration = (FieldDeclarationSyntax)c.Node;\n                    if (!fieldDeclaration.Modifiers.Any(x => x.IsKind(SyntaxKind.ShadowsKeyword)))\n                    {\n                        foreach (var diagnostics in fieldDeclaration.Declarators.SelectMany(x => x.Names).SelectMany(x => CheckFields(c.Model, x)))\n                        {\n                            c.ReportIssue(diagnostics);\n                        }\n                    }\n                },\n                SyntaxKind.FieldDeclaration);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/FieldShouldNotBePublic.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class FieldShouldNotBePublic : FieldShouldNotBePublicBase<SyntaxKind, FieldDeclarationSyntax, ModifiedIdentifierSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n        protected override IEnumerable<ModifiedIdentifierSyntax> Variables(FieldDeclarationSyntax fieldDeclaration) =>\n            fieldDeclaration.Declarators.SelectMany(x => x.Names);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/FileLines.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class FileLines : FileLinesBase\n    {\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat,\n                isEnabledByDefault: false);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override GeneratedCodeRecognizer GeneratedCodeRecognizer => VisualBasicGeneratedCodeRecognizer.Instance;\n\n        protected override bool IsEndOfFileToken(SyntaxToken token) => token.IsKind(SyntaxKind.EndOfFileToken);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/FindInsteadOfFirstOrDefault.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class FindInsteadOfFirstOrDefault : FindInsteadOfFirstOrDefaultBase<SyntaxKind, InvocationExpressionSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/FlagsEnumWithoutInitializer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class FlagsEnumWithoutInitializer : FlagsEnumWithoutInitializerBase<SyntaxKind, EnumMemberDeclarationSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language { get; } = VisualBasicFacade.Instance;\n\n        protected override bool IsInitialized(EnumMemberDeclarationSyntax member) =>\n            member.Initializer != null;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/FlagsEnumZeroMember.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class FlagsEnumZeroMember : FlagsEnumZeroMemberBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language { get; } = VisualBasicFacade.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/FunctionComplexity.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Metrics;\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class FunctionComplexity : FunctionComplexityBase\n    {\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat,\n                isEnabledByDefault: false);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarParametrizedAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c => CheckComplexity<MethodBlockBaseSyntax>(c, m => m.BlockStatement.GetLocation(), \"procedure\"),\n                SyntaxKind.SubBlock);\n\n            context.RegisterNodeAction(\n                c => CheckComplexity<MethodBlockBaseSyntax>(c, m => m.BlockStatement.GetLocation(), \"function\"),\n                SyntaxKind.FunctionBlock);\n\n            context.RegisterNodeAction(\n                c => CheckComplexity<MethodBlockBaseSyntax>(c, m => m.BlockStatement.GetLocation(), \"constructor\"),\n                SyntaxKind.ConstructorBlock);\n\n            context.RegisterNodeAction(\n                c => CheckComplexity<OperatorBlockSyntax>(c, m => m.OperatorStatement.GetLocation(), \"operator\"),\n                SyntaxKind.OperatorBlock);\n\n            context.RegisterNodeAction(\n                c => CheckComplexity<AccessorBlockSyntax>(c, m => m.AccessorStatement.GetLocation(), \"accessor\"),\n                SyntaxKind.GetAccessorBlock,\n                SyntaxKind.SetAccessorBlock,\n                SyntaxKind.AddHandlerAccessorBlock,\n                SyntaxKind.RemoveHandlerAccessorBlock);\n        }\n\n        protected override int GetComplexity(SyntaxNode node, SemanticModel semanticModel) =>\n            new VisualBasicMetrics(node.SyntaxTree, semanticModel).ComputeCyclomaticComplexity(node);\n\n        protected sealed override GeneratedCodeRecognizer GeneratedCodeRecognizer => VisualBasicGeneratedCodeRecognizer.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/FunctionNestingDepth.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class FunctionNestingDepth : FunctionNestingDepthBase\n    {\n        protected override ILanguageFacade Language => VisualBasicFacade.Instance;\n\n        protected override void Initialize(SonarParametrizedAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n            {\n                var walker = new NestingDepthWalker(Maximum, token => c.ReportIssue(rule, token, Maximum.ToString()));\n                walker.SafeVisit(c.Node);\n            },\n            SyntaxKind.SubBlock,\n            SyntaxKind.FunctionBlock,\n            SyntaxKind.OperatorBlock,\n            SyntaxKind.ConstructorBlock,\n            SyntaxKind.GetAccessorBlock,\n            SyntaxKind.SetAccessorBlock,\n            SyntaxKind.AddHandlerAccessorBlock,\n            SyntaxKind.RemoveHandlerAccessorBlock);\n\n        private class NestingDepthWalker : SafeVisualBasicSyntaxWalker\n        {\n            private readonly NestingDepthCounter counter;\n\n            public NestingDepthWalker(int maximumNestingDepth, Action<SyntaxToken> actionMaximumExceeded) =>\n                counter = new NestingDepthCounter(maximumNestingDepth, actionMaximumExceeded);\n\n            public override void VisitMultiLineIfBlock(MultiLineIfBlockSyntax node) =>\n                counter.CheckNesting(node.IfStatement.IfKeyword, () => base.VisitMultiLineIfBlock(node));\n\n            public override void VisitForBlock(ForBlockSyntax node) =>\n                counter.CheckNesting(node.ForStatement.ForKeyword, () => base.VisitForBlock(node));\n\n            public override void VisitForEachBlock(ForEachBlockSyntax node) =>\n                counter.CheckNesting(node.ForEachStatement.ForKeyword, () => base.VisitForEachBlock(node));\n\n            public override void VisitWhileBlock(WhileBlockSyntax node) =>\n                counter.CheckNesting(node.WhileStatement.WhileKeyword, () => base.VisitWhileBlock(node));\n\n            public override void VisitDoLoopBlock(DoLoopBlockSyntax node) =>\n                counter.CheckNesting(node.DoStatement.DoKeyword, () => base.VisitDoLoopBlock(node));\n\n            public override void VisitSelectBlock(SelectBlockSyntax node) =>\n                counter.CheckNesting(node.SelectStatement.SelectKeyword, () => base.VisitSelectBlock(node));\n\n            public override void VisitTryBlock(TryBlockSyntax node) =>\n                counter.CheckNesting(node.TryStatement.TryKeyword, () => base.VisitTryBlock(node));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/GenericInheritanceShouldNotBeRecursive.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class GenericInheritanceShouldNotBeRecursive : GenericInheritanceShouldNotBeRecursiveBase<SyntaxKind, TypeBlockSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n        protected override SyntaxKind[] SyntaxKinds { get; } =\n        {\n            SyntaxKind.ClassBlock,\n            SyntaxKind.InterfaceBlock,\n        };\n\n        protected override SyntaxToken GetKeyword(TypeBlockSyntax declaration) =>\n            declaration.BlockStatement.DeclarationKeyword;\n\n        protected override Location GetLocation(TypeBlockSyntax declaration) =>\n            declaration.BlockStatement.Identifier.GetLocation();\n\n        protected override INamedTypeSymbol GetNamedTypeSymbol(TypeBlockSyntax declaration, SemanticModel semanticModel) =>\n            semanticModel.GetDeclaredSymbol(declaration);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/GotoStatement.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class GotoStatement : GotoStatementBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n        protected override SyntaxKind[] GotoSyntaxKinds => new[] { SyntaxKind.GoToStatement };\n\n        protected override string GoToLabel => \"GoTo\";\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Hotspots/CommandPath.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class CommandPath : CommandPathBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n        public CommandPath() : this(AnalyzerConfiguration.Hotspot) { }\n\n        internal /*for testing*/ CommandPath(IAnalyzerConfiguration configuration) : base(configuration) { }\n\n        protected override string FirstArgument(InvocationContext context) =>\n            ((InvocationExpressionSyntax)context.Node).ArgumentList.Get(0).FindStringConstant(context.Model);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Hotspots/ConfiguringLoggers.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class ConfiguringLoggers : ConfiguringLoggersBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n        public ConfiguringLoggers() : this(AnalyzerConfiguration.Hotspot) { }\n\n        // Set internal for testing\n        internal ConfiguringLoggers(IAnalyzerConfiguration configuration) : base(configuration) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Hotspots/CreatingHashAlgorithms.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class CreatingHashAlgorithms : CreatingHashAlgorithmsBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    public CreatingHashAlgorithms() : this(AnalyzerConfiguration.Hotspot) { }\n\n    internal /*for testing*/ CreatingHashAlgorithms(IAnalyzerConfiguration configuration) : base(configuration) { }\n\n    protected override bool IsUnsafeAlgorithm(SyntaxNode argumentNode, SemanticModel model) =>\n        argumentNode as SimpleArgumentSyntax is { } argument\n        && argument.Expression as MemberAccessExpressionSyntax is { } memberAccess\n        && memberAccess.Name.ToString() is \"SHA1\" or \"MD5\"\n        && model.GetSymbolInfo(memberAccess.Expression).Symbol.GetSymbolType().Is(KnownType.System_Security_Cryptography_HashAlgorithmName);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Hotspots/DeliveringDebugFeaturesInProduction.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class DeliveringDebugFeaturesInProduction : DeliveringDebugFeaturesInProductionBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n        public DeliveringDebugFeaturesInProduction() : this(AnalyzerConfiguration.Hotspot) { }\n\n        internal /*for testing*/ DeliveringDebugFeaturesInProduction(IAnalyzerConfiguration configuration) : base(configuration) { }\n\n        protected override bool IsDevelopmentCheckInvoked(SyntaxNode node, SemanticModel semanticModel) =>\n            node.FirstAncestorOrSelf<StatementSyntax>() is var invocationStatement\n            && invocationStatement.Ancestors().Any(x => IsDevelopmentCheck(x, semanticModel));\n\n        protected override bool IsInDevelopmentContext(SyntaxNode node) =>\n            node.Ancestors()\n                .OfType<ClassBlockSyntax>()\n                .Any(x => x.ClassStatement.Identifier.Text == StartupDevelopment);\n\n        private bool IsDevelopmentCheck(SyntaxNode node, SemanticModel semanticModel) =>\n            FindCondition(node).RemoveParentheses() is InvocationExpressionSyntax condition\n            && IsValidationMethod(semanticModel, condition, condition.Expression.GetIdentifier()?.ValueText);\n\n        private static ExpressionSyntax FindCondition(SyntaxNode node) =>\n            node switch\n            {\n                MultiLineIfBlockSyntax multiline => multiline.IfStatement.Condition,\n                SingleLineIfStatementSyntax singleLine => singleLine.Condition,\n                _ => null\n            };\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Hotspots/DisablingRequestValidation.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class DisablingRequestValidation : DisablingRequestValidationBase\n    {\n        protected override ILanguageFacade Language => VisualBasicFacade.Instance;\n\n        public DisablingRequestValidation() : this(AnalyzerConfiguration.Hotspot) { }\n\n        public DisablingRequestValidation(IAnalyzerConfiguration analyzerConfiguration) : base(analyzerConfiguration) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Hotspots/ExecutingSqlQueries.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class ExecutingSqlQueries : ExecutingSqlQueriesBase<SyntaxKind, ExpressionSyntax, IdentifierNameSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language { get; } = VisualBasicFacade.Instance;\n\n    public ExecutingSqlQueries() : this(AnalyzerConfiguration.Hotspot) { }\n\n    internal /*for testing*/ ExecutingSqlQueries(IAnalyzerConfiguration configuration) : base(configuration) { }\n\n    protected override ExpressionSyntax GetArgumentAtIndex(InvocationContext context, int index) =>\n        context.Node is InvocationExpressionSyntax invocation\n            ? invocation.ArgumentList.Get(index)\n            : null;\n\n    protected override ExpressionSyntax GetArgumentAtIndex(ObjectCreationContext context, int index) =>\n        context.Node is ObjectCreationExpressionSyntax objectCreation\n            ? objectCreation.ArgumentList.Get(index)\n            : null;\n\n    protected override ExpressionSyntax GetSetValue(PropertyAccessContext context) =>\n        context.Node is MemberAccessExpressionSyntax setter && setter.IsLeftSideOfAssignment\n            ? ((AssignmentStatementSyntax)setter.SelfOrTopParenthesizedExpression.Parent).Right.RemoveParentheses()\n            : null;\n\n    protected override bool IsTracked(ExpressionSyntax expression, SyntaxBaseContext context) =>\n        expression is not null && (IsSensitiveExpression(expression, context.Model) || IsTrackedVariableDeclaration(expression, context));\n\n    protected override bool IsSensitiveExpression(ExpressionSyntax expression, SemanticModel semanticModel) =>\n        IsConcatenation(expression, semanticModel)\n        || expression.IsKind(SyntaxKind.InterpolatedStringExpression)\n        || (expression is InvocationExpressionSyntax invocation && IsInvocationOfInterest(invocation, semanticModel));\n\n    protected override Location SecondaryLocationForExpression(ExpressionSyntax node, string identifierNameToFind, out string identifierNameFound)\n    {\n        identifierNameFound = string.Empty;\n        if (node is null)\n        {\n            return Location.None;\n        }\n\n        if (node.Parent is EqualsValueSyntax equalsValue\n            && equalsValue.Parent is VariableDeclaratorSyntax declarationSyntax)\n        {\n            var identifier = declarationSyntax.Names.FirstOrDefault(x => x.Identifier.ValueText.Equals(identifierNameToFind, StringComparison.OrdinalIgnoreCase));\n\n            if (identifier is null)\n            {\n                return Location.None;\n            }\n            else\n            {\n                identifierNameFound = identifier.Identifier.ValueText;\n                return identifier.GetLocation();\n            }\n        }\n\n        if (node.Parent is AssignmentStatementSyntax assignment)\n        {\n            identifierNameFound = assignment.Left.GetName();\n            return assignment.Left.GetLocation();\n        }\n\n        return Location.None;\n    }\n\n    private static bool IsInvocationOfInterest(InvocationExpressionSyntax invocation, SemanticModel model) =>\n        (invocation.IsMethodInvocation(KnownType.System_String, \"Format\", model) || invocation.IsMethodInvocation(KnownType.System_String, \"Concat\", model))\n        && !AllConstants(invocation.ArgumentList.Arguments.ToList(), model);\n\n    private static bool IsConcatenation(ExpressionSyntax expression, SemanticModel model) =>\n        IsConcatenationOperator(expression)\n        && expression is BinaryExpressionSyntax concatenation\n        && !IsConcatenationOfConstants(concatenation, model);\n\n    private static bool AllConstants(List<ArgumentSyntax> arguments, SemanticModel model) =>\n        arguments.TrueForAll(x => x.GetExpression().HasConstantValue(model));\n\n    private static bool IsConcatenationOperator(SyntaxNode node) =>\n        node.IsKind(SyntaxKind.ConcatenateExpression)\n        || node.IsKind(SyntaxKind.AddExpression);\n\n    private static bool IsConcatenationOfConstants(BinaryExpressionSyntax binaryExpression, SemanticModel model)\n    {\n        if ((model.GetTypeInfo(binaryExpression).Type is ITypeSymbol) && binaryExpression.Right.HasConstantValue(model))\n        {\n            var nestedLeft = binaryExpression.Left;\n            var nestedBinary = nestedLeft as BinaryExpressionSyntax;\n            while (nestedBinary is not null)\n            {\n                if (nestedBinary.Right.HasConstantValue(model)\n                    && (IsConcatenationOperator(nestedBinary) || nestedBinary.HasConstantValue(model)))\n                {\n                    nestedLeft = nestedBinary.Left;\n                    nestedBinary = nestedLeft as BinaryExpressionSyntax;\n                }\n                else\n                {\n                    return false;\n                }\n            }\n            return nestedLeft.HasConstantValue(model);\n        }\n        return false;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Hotspots/ExpandingArchives.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class ExpandingArchives : ExpandingArchivesBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n        public ExpandingArchives() : this(AnalyzerConfiguration.Hotspot) { }\n\n        internal /*for testing*/ ExpandingArchives(IAnalyzerConfiguration configuration) : base(configuration) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Hotspots/HardcodedIpAddress.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class HardcodedIpAddress : HardcodedIpAddressBase<SyntaxKind, LiteralExpressionSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n        public HardcodedIpAddress() : this(AnalyzerConfiguration.Hotspot) { }\n\n        public HardcodedIpAddress(IAnalyzerConfiguration analyzerConfiguration) : base(analyzerConfiguration) { }\n\n        protected override bool HasAttributes(SyntaxNode literalExpression) =>\n            literalExpression.HasAncestor(SyntaxKind.Attribute);\n\n        protected override string GetAssignedVariableName(SyntaxNode stringLiteral) =>\n            stringLiteral.FirstAncestorOrSelf<SyntaxNode>(IsVariableIdentifier)?.ToString();\n\n        private static bool IsVariableIdentifier(SyntaxNode syntaxNode) =>\n            syntaxNode is StatementSyntax\n            || syntaxNode is VariableDeclaratorSyntax\n            || syntaxNode is ParameterSyntax;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Hotspots/PubliclyWritableDirectories.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class PubliclyWritableDirectories : PubliclyWritableDirectoriesBase<SyntaxKind, InvocationExpressionSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n        public PubliclyWritableDirectories() : this(AnalyzerConfiguration.Hotspot) { }\n\n        internal PubliclyWritableDirectories(IAnalyzerConfiguration configuration) : base(configuration) { }\n\n        private protected override bool IsGetTempPathAssignment(InvocationExpressionSyntax invocationExpression, KnownType type, string methodName, SemanticModel semanticModel) =>\n            invocationExpression.IsMethodInvocation(type, methodName, semanticModel)\n            && invocationExpression.Parent.IsAnyKind(SyntaxKind.EqualsValue, SyntaxKind.SimpleAssignmentStatement, SyntaxKind.ReturnStatement);\n\n        private protected override bool IsInsecureEnvironmentVariableRetrieval(InvocationExpressionSyntax invocation, KnownType type, string methodName, SemanticModel semanticModel) =>\n            invocation.IsMethodInvocation(type, methodName, semanticModel)\n            && invocation.ArgumentList?.Arguments.First() is var firstArgument\n            && InsecureEnvironmentVariables.Any(x => x.Equals(firstArgument.GetExpression().StringValue(semanticModel), StringComparison.OrdinalIgnoreCase));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Hotspots/RequestsWithExcessiveLength.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class RequestsWithExcessiveLength : RequestsWithExcessiveLengthBase<SyntaxKind, AttributeSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n        public RequestsWithExcessiveLength() : this(SonarAnalyzer.Core.Common.AnalyzerConfiguration.Hotspot) { }\n\n        public RequestsWithExcessiveLength(IAnalyzerConfiguration analyzerConfiguration) : base(analyzerConfiguration) { }\n\n        protected override AttributeSyntax IsInvalidRequestFormLimits(AttributeSyntax attribute, SemanticModel semanticModel) =>\n            IsRequestFormLimits(attribute.Name.ToString())\n            && attribute.ArgumentList?.Arguments.FirstOrDefault(arg => IsMultipartBodyLengthLimit(arg)) is { } firstArgument\n            && semanticModel.GetConstantValue(firstArgument.GetExpression()) is { HasValue: true } constantValue\n            && constantValue.Value is int intValue\n            && intValue > FileUploadSizeLimit\n            && attribute.IsKnownType(KnownType.Microsoft_AspNetCore_Mvc_RequestFormLimitsAttribute, semanticModel)\n                ? attribute\n                : null;\n\n        protected override AttributeSyntax IsInvalidRequestSizeLimit(AttributeSyntax attribute, SemanticModel semanticModel) =>\n            IsRequestSizeLimit(attribute.Name.ToString())\n            && attribute.ArgumentList?.Arguments.FirstOrDefault() is { } firstArgument\n            && semanticModel.GetConstantValue(firstArgument.GetExpression()) is { HasValue: true } constantValue\n            && constantValue.Value is int intValue\n            && intValue > FileUploadSizeLimit\n            && attribute.IsKnownType(KnownType.Microsoft_AspNetCore_Mvc_RequestSizeLimitAttribute, semanticModel)\n                ? attribute\n                : null;\n\n        protected override SyntaxNode GetMethodLocalFunctionOrClassDeclaration(AttributeSyntax attribute) =>\n            attribute.FirstAncestorOrSelf<DeclarationStatementSyntax>();\n\n        protected override string AttributeName(AttributeSyntax attribute) =>\n            attribute.Name.ToString();\n\n        private bool IsMultipartBodyLengthLimit(ArgumentSyntax argument) =>\n            argument is SimpleArgumentSyntax { NameColonEquals: { } nameColonEquals }\n            && nameColonEquals.Name.Identifier.ValueText.Equals(MultipartBodyLengthLimit, Language.NameComparison);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Hotspots/SpecifyTimeoutOnRegex.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class SpecifyTimeoutOnRegex : SpecifyTimeoutOnRegexBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    public SpecifyTimeoutOnRegex() : this(AnalyzerConfiguration.Hotspot) { }\n\n    internal /*for testing*/ SpecifyTimeoutOnRegex(IAnalyzerConfiguration config) : base(config) { }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Hotspots/UsingNonstandardCryptography.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class UsingNonstandardCryptography : UsingNonstandardCryptographyBase<SyntaxKind, TypeBlockSyntax>\n    {\n        protected override ILanguageFacade Language => VisualBasicFacade.Instance;\n\n        protected override SyntaxKind[] SyntaxKinds { get; } = { SyntaxKind.ClassBlock, SyntaxKind.InterfaceBlock };\n\n        public UsingNonstandardCryptography() : this(AnalyzerConfiguration.Hotspot) { }\n\n        public UsingNonstandardCryptography(IAnalyzerConfiguration analyzerConfiguration) : base(analyzerConfiguration) { }\n\n        protected override INamedTypeSymbol DeclaredSymbol(TypeBlockSyntax typeDeclarationSyntax, SemanticModel semanticModel) =>\n            semanticModel.GetDeclaredSymbol(typeDeclarationSyntax);\n\n        protected override Location Location(TypeBlockSyntax typeDeclarationSyntax) =>\n            typeDeclarationSyntax switch\n            {\n                ClassBlockSyntax c => c.ClassStatement.Identifier.GetLocation(),\n                InterfaceBlockSyntax i => i.InterfaceStatement.Identifier.GetLocation(),\n                _ => null,\n            };\n\n        protected override bool DerivesOrImplementsAny(TypeBlockSyntax typeDeclarationSyntax) =>\n            typeDeclarationSyntax.Implements.Any() || typeDeclarationSyntax.Inherits.Any();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/IfChainWithoutElse.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class IfChainWithoutElse : IfChainWithoutElseBase<SyntaxKind, MultiLineIfBlockSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n        protected override SyntaxKind SyntaxKind => SyntaxKind.MultiLineIfBlock;\n        protected override string ElseClause => \"Else\";\n\n        protected override bool IsElseIfWithoutElse(MultiLineIfBlockSyntax ifSyntax) =>\n            ifSyntax.ElseIfBlocks.Any()\n            && (ifSyntax.ElseBlock == null || IsEmptyBlock(ifSyntax));\n\n        protected override Location IssueLocation(SonarSyntaxNodeReportingContext context, MultiLineIfBlockSyntax ifSyntax) =>\n            ifSyntax.ElseIfBlocks.Last().ElseIfStatement.ElseIfKeyword.GetLocation();\n\n        private static bool IsEmptyBlock(MultiLineIfBlockSyntax multiLineIfBlock) =>\n            !(multiLineIfBlock.ElseBlock.Statements.Count > 0\n            || multiLineIfBlock.ElseBlock.GetTrailingTrivia().Any(IsCommentOrDisabledText)\n            || multiLineIfBlock.EndIfStatement.GetLeadingTrivia().Any(IsCommentOrDisabledText));\n\n        private static bool IsCommentOrDisabledText(SyntaxTrivia trivia) =>\n            trivia.IsComment() || trivia.IsKind(SyntaxKind.DisabledTextTrivia);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/IfCollapsible.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class IfCollapsible : IfCollapsibleBase\n{\n    private static readonly DiagnosticDescriptor rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(\n            c =>\n            {\n                var multilineIfBlock = (MultiLineIfBlockSyntax)c.Node;\n\n                if (multilineIfBlock.ElseIfBlocks.Count > 0 ||\n                    multilineIfBlock.ElseBlock is not null)\n                {\n                    return;\n                }\n\n                var parentMultilineIfBlock = multilineIfBlock.Parent as MultiLineIfBlockSyntax;\n\n                if (parentMultilineIfBlock is null ||\n                    parentMultilineIfBlock.ElseIfBlocks.Count != 0 ||\n                    parentMultilineIfBlock.ElseBlock is not null ||\n                    parentMultilineIfBlock.Statements.Count != 1)\n                {\n                    return;\n                }\n\n                c.ReportIssue(rule, multilineIfBlock.IfStatement.IfKeyword, [parentMultilineIfBlock.IfStatement.IfKeyword.ToSecondaryLocation(SecondaryMessage)]);\n            },\n            SyntaxKind.MultiLineIfBlock);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/ImplementSerializationMethodsCorrectly.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class ImplementSerializationMethodsCorrectly : ImplementSerializationMethodsCorrectlyBase\n    {\n        private const string ProblemStatic = \"non-shared\";\n        private const string ProblemReturnVoidText = \"a 'Sub' not a 'Function'\";\n\n        protected override ILanguageFacade Language => VisualBasicFacade.Instance;\n        protected override string MethodStaticMessage => ProblemStatic;\n        protected override string MethodReturnTypeShouldBeVoidMessage => ProblemReturnVoidText;\n\n        protected override Location GetIdentifierLocation(IMethodSymbol methodSymbol) =>\n            methodSymbol.DeclaringSyntaxReferences.Select(x => x.GetSyntax())\n                .OfType<MethodStatementSyntax>()\n                .FirstOrDefault()\n                ?.Identifier\n                .GetLocation();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/IndexOfCheckAgainstZero.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class IndexOfCheckAgainstZero : IndexOfCheckAgainstZeroBase<SyntaxKind, BinaryExpressionSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n        protected override SyntaxKind LessThanExpression => SyntaxKind.LessThanExpression;\n        protected override SyntaxKind GreaterThanExpression => SyntaxKind.GreaterThanExpression;\n\n        protected override SyntaxNode Left(BinaryExpressionSyntax binaryExpression) =>\n            binaryExpression.Left;\n\n        protected override SyntaxToken OperatorToken(BinaryExpressionSyntax binaryExpression) =>\n            binaryExpression.OperatorToken;\n\n        protected override SyntaxNode Right(BinaryExpressionSyntax binaryExpression) =>\n            binaryExpression.Right;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/IndexedPropertyWithMultipleParameters.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class IndexedPropertyWithMultipleParameters : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S2352\";\n        private const string MessageFormat = \"This indexed property has {0} parameters, use methods instead.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var property = (PropertyStatementSyntax)c.Node;\n                    if (property.ParameterList != null &&\n                        property.ParameterList.Parameters.Count > 1)\n                    {\n                        c.ReportIssue(rule, property.Identifier, property.ParameterList.Parameters.Count.ToString());\n                    }\n                },\n                SyntaxKind.PropertyStatement);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/InsecureEncryptionAlgorithm.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class InsecureEncryptionAlgorithm : InsecureEncryptionAlgorithmBase<SyntaxKind, InvocationExpressionSyntax, ArgumentListSyntax, ArgumentSyntax>\n    {\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n        protected override ILanguageFacade<SyntaxKind> Language { get; } = VisualBasicFacade.Instance;\n\n        protected override Location Location(SyntaxNode objectCreation) =>\n            ((ObjectCreationExpressionSyntax)objectCreation).Type.GetLocation();\n\n        protected override ArgumentListSyntax ArgumentList(InvocationExpressionSyntax invocationExpression) =>\n            invocationExpression.ArgumentList;\n\n        protected override SeparatedSyntaxList<ArgumentSyntax> Arguments(ArgumentListSyntax argumentList) =>\n            argumentList.Arguments;\n\n        protected override bool IsStringLiteralArgument(ArgumentSyntax argument) =>\n            argument.GetExpression().IsKind(SyntaxKind.StringLiteralExpression);\n\n        protected override SyntaxNode Expression(ArgumentSyntax argument) =>\n            argument.GetExpression();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/InsecureTemporaryFilesCreation.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class InsecureTemporaryFilesCreation : InsecureTemporaryFilesCreationBase<MemberAccessExpressionSyntax, SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language { get; } = VisualBasicFacade.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/InsteadOfAny.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class InsteadOfAny : InsteadOfAnyBase<SyntaxKind, InvocationExpressionSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override bool IsSimpleEqualityCheck(InvocationExpressionSyntax node, SemanticModel model) =>\n        GetArgumentExpression(node, 0) is SingleLineLambdaExpressionSyntax lambda\n        && lambda.SubOrFunctionHeader.ParameterList.Parameters is { Count: 1 } parameters\n        && parameters[0].Identifier.GetName() is var lambdaVariableName\n        && lambda.Body switch\n        {\n            BinaryExpressionSyntax binary when binary.OperatorToken.Kind() is SyntaxKind.EqualsToken or SyntaxKind.IsKeyword =>\n                HasValidBinaryOperands(lambdaVariableName, binary.Left, binary.Right, model),\n            InvocationExpressionSyntax invocation =>\n                HasValidInvocationOperands(invocation, lambdaVariableName, model),\n            _ => false\n        };\n\n    private bool HasValidBinaryOperands(string lambdaVariableName, SyntaxNode first, SyntaxNode second, SemanticModel model) =>\n        (AreValidOperands(lambdaVariableName, first, second) && IsNullOrValueTypeOrString(second, model))\n        || (AreValidOperands(lambdaVariableName, second, first) && IsNullOrValueTypeOrString(first, model));\n\n    private static bool IsNullOrValueTypeOrString(SyntaxNode node, SemanticModel model) =>\n        node.IsKind(SyntaxKind.NothingLiteralExpression) || IsValueTypeOrString(node, model);\n\n    protected override bool AreValidOperands(string lambdaVariable, SyntaxNode first, SyntaxNode second) =>\n        first is IdentifierNameSyntax && IsNameEqualTo(first, lambdaVariable)\n        && second switch\n        {\n            LiteralExpressionSyntax => true,\n            IdentifierNameSyntax => !IsNameEqualTo(first, second.GetName()),\n            _ => false,\n        };\n\n    protected override SyntaxNode GetArgumentExpression(InvocationExpressionSyntax invocation, int index) =>\n        invocation.ArgumentList.Arguments[index].GetExpression();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/InvalidCastToInterface.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class InvalidCastToInterface : InvalidCastToInterfaceBase<SyntaxKind>\n{\n    protected override DiagnosticDescriptor Rule { get; } = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/JwtSigned.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\nusing SonarAnalyzer.VisualBasic.Core.Trackers;\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class JwtSigned : JwtSignedBase<SyntaxKind, InvocationExpressionSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n        public JwtSigned() : base(AnalyzerConfiguration.AlwaysEnabled) { }\n\n        protected override BuilderPatternCondition<SyntaxKind, InvocationExpressionSyntax> CreateBuilderPatternCondition() =>\n            new VisualBasicBuilderPatternCondition(JwtBuilderConstructorIsSafe, JwtBuilderDescriptors(\n                invocation =>\n                    invocation.ArgumentList?.Arguments.Count != 1\n                    || !invocation.ArgumentList.Arguments.Single().GetExpression().RemoveParentheses().IsKind(SyntaxKind.FalseLiteralExpression)));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/LineContinuation.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class LineContinuation : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S2354\";\n        private const string MessageFormat = \"Reformat the code to remove this use of the line continuation character.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterTreeAction(\n                c =>\n                {\n                    var lineContinuations = c.Tree.GetRoot().DescendantTokens()\n                        .SelectMany(token => token.TrailingTrivia)\n                        .Where(trivia => trivia.IsKind(SyntaxKind.LineContinuationTrivia));\n\n                    foreach (var lineContinuation in lineContinuations)\n                    {\n                        c.ReportIssue(rule, lineContinuation.GetLocation());\n                    }\n                });\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/LineLength.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class LineLength : LineLengthBase\n    {\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat,\n                isEnabledByDefault: false);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override GeneratedCodeRecognizer GeneratedCodeRecognizer =>\n            VisualBasicGeneratedCodeRecognizer.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/LinkedListPropertiesInsteadOfMethods.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class LinkedListPropertiesInsteadOfMethods : LinkedListPropertiesInsteadOfMethodsBase<SyntaxKind, InvocationExpressionSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override bool IsRelevantCallAndType(InvocationExpressionSyntax invocation, SemanticModel model) =>\n        invocation.Operands().Right is { } right\n        && IsRelevantType(right, model)\n        && IsCorrectType(invocation, model);\n\n    private static bool IsCorrectType(InvocationExpressionSyntax invocation, SemanticModel model) =>\n        invocation?.ArgumentList?.Arguments is { Count: 1 } args\n        && model.GetTypeInfo(args[0].GetExpression()).Type is { } type\n        && type.DerivesFrom(KnownType.System_Collections_Generic_LinkedList_T);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/LooseFilePermissions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class LooseFilePermissions : LooseFilePermissionsBase<SyntaxKind, MemberAccessExpressionSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override void VisitInvocations(SonarSyntaxNodeReportingContext context)\n    {\n        var invocation = (InvocationExpressionSyntax)context.Node;\n        if ((IsSetAccessRule(invocation, context.Model) || IsAddAccessRule(invocation, context.Model))\n            && (ObjectCreation(invocation, context.Model) is { } objectCreation))\n        {\n            var invocationLocation = invocation.GetLocation();\n            var secondaryLocation = objectCreation.GetLocation();\n            context.ReportIssue(rule, invocationLocation, invocationLocation.StartLine() == secondaryLocation.StartLine() ? [] : [secondaryLocation.ToSecondary(MessageFormat)]);\n        }\n    }\n\n    private static ObjectCreationExpressionSyntax ObjectCreation(InvocationExpressionSyntax invocation, SemanticModel model)\n    {\n        var accessRuleSyntaxNode = VulnerableFileSystemAccessRule(invocation.DescendantNodes());\n        if (accessRuleSyntaxNode is not null)\n        {\n            return accessRuleSyntaxNode;\n        }\n\n        var accessRuleSymbol = invocation.GetArgumentSymbolsOfKnownType(KnownType.System_Security_AccessControl_FileSystemAccessRule, model).FirstOrDefault();\n        return accessRuleSymbol is null or IMethodSymbol\n            ? null\n            : VulnerableFileSystemAccessRule(accessRuleSymbol.LocationNodes(invocation));\n\n        ObjectCreationExpressionSyntax VulnerableFileSystemAccessRule(IEnumerable<SyntaxNode> nodes) =>\n            nodes.OfType<ObjectCreationExpressionSyntax>()\n                .FirstOrDefault(x => IsFileSystemAccessRuleForEveryoneWithAllow(x, model));\n    }\n\n    private static bool IsFileSystemAccessRuleForEveryoneWithAllow(ObjectCreationExpressionSyntax objectCreation, SemanticModel model) =>\n        objectCreation.IsKnownType(KnownType.System_Security_AccessControl_FileSystemAccessRule, model)\n        && objectCreation.ArgumentList is { } argumentList\n        && IsEveryone(argumentList.Arguments.First().GetExpression(), model)\n        && model.GetConstantValue(argumentList.Arguments.Last().GetExpression()) is {HasValue: true, Value: 0};\n\n    private static bool IsEveryone(SyntaxNode node, SemanticModel model) =>\n        model.GetConstantValue(node) is {HasValue: true, Value: Everyone}\n        || node.DescendantNodesAndSelf()\n            .OfType<ObjectCreationExpressionSyntax>()\n            .Any(x => IsNTAccountWithEveryone(x, model) || IsSecurityIdentifierWithEveryone(x, model));\n\n    private static bool IsNTAccountWithEveryone(ObjectCreationExpressionSyntax objectCreation, SemanticModel model) =>\n        objectCreation.IsKnownType(KnownType.System_Security_Principal_NTAccount, model)\n        && objectCreation.ArgumentList is { } argumentList\n        && model.GetConstantValue(argumentList.Arguments.Last().GetExpression()) is { HasValue: true, Value: Everyone };\n\n    private static bool IsSecurityIdentifierWithEveryone(ObjectCreationExpressionSyntax objectCreation, SemanticModel model) =>\n        objectCreation.IsKnownType(KnownType.System_Security_Principal_SecurityIdentifier, model)\n        && objectCreation.ArgumentList is { } argumentList\n        && model.GetConstantValue(argumentList.Arguments.First().GetExpression()) is { HasValue: true, Value: 1 };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/MarkAssemblyWithAssemblyVersionAttribute.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class MarkAssemblyWithAssemblyVersionAttribute : MarkAssemblyWithAssemblyVersionAttributeBase\n    {\n        protected override ILanguageFacade Language => VisualBasicFacade.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/MarkAssemblyWithClsCompliantAttribute.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class MarkAssemblyWithClsCompliantAttribute : MarkAssemblyWithClsCompliantAttributeBase\n    {\n        protected override ILanguageFacade Language => VisualBasicFacade.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/MarkAssemblyWithComVisibleAttribute.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class MarkAssemblyWithComVisibleAttribute : MarkAssemblyWithComVisibleAttributeBase\n    {\n        protected override ILanguageFacade Language => VisualBasicFacade.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/MarkWindowsFormsMainWithStaThread.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class MarkWindowsFormsMainWithStaThread : MarkWindowsFormsMainWithStaThreadBase<SyntaxKind, MethodBlockSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n        protected override SyntaxKind[] SyntaxKinds { get; } =\n        {\n            SyntaxKind.FunctionBlock,\n            SyntaxKind.SubBlock\n        };\n\n        protected override Location GetLocation(MethodBlockSyntax method) =>\n            method.SubOrFunctionStatement.Identifier.GetLocation();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/MethodOverloadsShouldBeGrouped.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class MethodOverloadsShouldBeGrouped : MethodOverloadsShouldBeGroupedBase<SyntaxKind, StatementSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override SyntaxKind[] SyntaxKinds { get; } =\n    {\n        SyntaxKind.ClassBlock,\n        SyntaxKind.InterfaceBlock,\n        SyntaxKind.StructureBlock\n    };\n\n    protected override MemberInfo CreateMemberInfo(SonarSyntaxNodeReportingContext c, StatementSyntax member)\n    {\n        if (member is ConstructorBlockSyntax constructor)\n        {\n            return new MemberInfo(c, member, constructor.SubNewStatement.NewKeyword, IsStaticStatement(constructor.SubNewStatement), false, false);\n        }\n        else if (member is MethodBlockSyntax methodBlock)\n        {\n            return new MemberInfo(\n                c,\n                member,\n                methodBlock.SubOrFunctionStatement.Identifier,\n                IsStaticStatement(methodBlock.SubOrFunctionStatement),\n                IsAbstractStatement(methodBlock.SubOrFunctionStatement),\n                false);\n        }\n        else if (member is MethodStatementSyntax methodStatement)\n        {\n            return new MemberInfo(c, member, methodStatement.Identifier, IsStaticStatement(methodStatement), IsAbstractStatement(methodStatement), false);\n        }\n        return null;\n    }\n\n    protected override IEnumerable<StatementSyntax> MemberDeclarations(SyntaxNode node) =>\n        ((TypeBlockSyntax)node).Members;\n\n    private static bool IsStaticStatement(MethodBaseSyntax statement) =>\n        statement.DescendantTokens().Any(x => x.Kind() == SyntaxKind.SharedKeyword);\n\n    private static bool IsAbstractStatement(MethodBaseSyntax statement) =>\n        statement.DescendantTokens().Any(x => x.Kind() == SyntaxKind.MustOverrideKeyword);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/MethodParameterUnused.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class MethodParameterUnused : MethodParameterUnusedBase\n    {\n        private const string MessageFormat = \"Remove this unused procedure parameter '{0}'.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n                {\n                    var methodBlock = (MethodBlockSyntax)c.Node;\n\n                    // Bail-out if this is not a method we want to report on (only based on syntax checks)\n                    if (methodBlock.SubOrFunctionStatement == null\n                        || !HasAnyParameter(methodBlock)\n                        || IsEmptyMethod(methodBlock)\n                        || IsVirtualOrOverride(methodBlock)\n                        || IsInterfaceImplementation(methodBlock)\n                        || IsWithEventsHandler(methodBlock)\n                        || HasAnyAttribute(methodBlock)\n                        || OnlyThrowsNotImplementedException(methodBlock, c.Model))\n                    {\n                        return;\n                    }\n\n                    var unusedParameters = GetUnusedParameters(methodBlock);\n                    if (unusedParameters.Count == 0)\n                    {\n                        return;\n                    }\n\n                    // Bail-out if this is not a method we want to report on (only based on symbols checks)\n                    var methodSymbol = c.Model.GetDeclaredSymbol(methodBlock);\n                    if (methodSymbol == null\n                        || methodSymbol.IsMainMethod()\n                        || methodSymbol.IsEventHandler()\n                        || methodSymbol.GetEffectiveAccessibility() != Accessibility.Private)\n                    {\n                        return;\n                    }\n\n                    foreach (var parameter in unusedParameters)\n                    {\n                        c.ReportIssue(Rule, parameter, parameter.Identifier.Identifier.ValueText);\n                    }\n                },\n                SyntaxKind.SubBlock,\n                SyntaxKind.FunctionBlock);\n\n        private static bool HasAnyParameter(MethodBlockBaseSyntax method) =>\n            method.BlockStatement.ParameterList != null\n            && method.BlockStatement.ParameterList.Parameters.Any();\n\n        private static bool IsEmptyMethod(MethodBlockBaseSyntax method) =>\n            method.Statements.Count == 0;\n\n        private static bool IsVirtualOrOverride(MethodBlockBaseSyntax method) =>\n             method.BlockStatement.Modifiers.Any(x => x.Kind() is SyntaxKind.OverridesKeyword or SyntaxKind.OverridableKeyword);\n\n        private static bool IsInterfaceImplementation(MethodBlockSyntax method) =>\n            method.SubOrFunctionStatement.ImplementsClause != null;\n\n        private static bool IsWithEventsHandler(MethodBlockSyntax method) =>\n            method.SubOrFunctionStatement.HandlesClause != null;\n\n        private static bool HasAnyAttribute(MethodBlockBaseSyntax method) =>\n            method.BlockStatement.AttributeLists.Any();\n\n        private static bool OnlyThrowsNotImplementedException(MethodBlockBaseSyntax method, SemanticModel semanticModel) =>\n            method.Statements.Count == 1\n            && method.Statements\n                .OfType<ThrowStatementSyntax>()\n                .Select(x => x.Expression)\n                .OfType<ObjectCreationExpressionSyntax>()\n                .Select(x => semanticModel.GetSymbolInfo(x).Symbol)\n                .OfType<IMethodSymbol>()\n                .Any(x => x.ContainingType.Is(KnownType.System_NotImplementedException));\n\n        private static List<ParameterSyntax> GetUnusedParameters(MethodBlockBaseSyntax methodBlock)\n        {\n            var usedIdentifiers = methodBlock.Statements.SelectMany(x => x.DescendantNodes())\n                    .Where(node => node.IsKind(SyntaxKind.IdentifierName) && IsVarOrParameter(node))\n                    .Cast<IdentifierNameSyntax>()\n                    .Select(x => x.Identifier.ValueText)\n                    .WhereNotNull()\n                    .ToHashSet(StringComparer.InvariantCultureIgnoreCase);\n\n            return methodBlock.BlockStatement.ParameterList.Parameters\n                .Where(p => !usedIdentifiers.Contains(p.Identifier.Identifier.ValueText))\n                .ToList();\n\n            static bool IsVarOrParameter(SyntaxNode node) =>\n                node.Parent switch\n                {\n                    MemberAccessExpressionSyntax memberAccess => memberAccess.Expression == node,\n                    ConditionalAccessExpressionSyntax conditionalAccess => conditionalAccess.Expression == node,\n                    _ => true\n                };\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/MethodsShouldNotHaveIdenticalImplementations.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class MethodsShouldNotHaveIdenticalImplementations : MethodsShouldNotHaveIdenticalImplementationsBase<SyntaxKind, MethodBlockSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override SyntaxKind[] SyntaxKinds => [SyntaxKind.ClassBlock, SyntaxKind.StructureBlock];\n\n    protected override IEnumerable<MethodBlockSyntax> GetMethodDeclarations(SyntaxNode node) =>\n        ((TypeBlockSyntax)node).Members.OfType<MethodBlockSyntax>();\n\n    protected override bool AreDuplicates(SemanticModel model, MethodBlockSyntax firstMethod, MethodBlockSyntax secondMethod) =>\n        firstMethod.Statements.Count > 1\n        && firstMethod.GetIdentifierText() != secondMethod.GetIdentifierText()\n        && HaveSameParameters(firstMethod.GetParameters(), secondMethod.GetParameters())\n        && HaveSameTypeParameters(model, firstMethod.SubOrFunctionStatement?.TypeParameterList?.Parameters, secondMethod.SubOrFunctionStatement?.TypeParameterList?.Parameters)\n        && AreTheSameType(model, firstMethod.SubOrFunctionStatement.AsClause?.Type, secondMethod.SubOrFunctionStatement.AsClause?.Type)\n        && VisualBasicEquivalenceChecker.AreEquivalent(firstMethod.Statements, secondMethod.Statements);\n\n    protected override SyntaxToken GetMethodIdentifier(MethodBlockSyntax method) =>\n        method.SubOrFunctionStatement.Identifier;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/MethodsShouldNotHaveTooManyLines.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class MethodsShouldNotHaveTooManyLines\n        : MethodsShouldNotHaveTooManyLinesBase<SyntaxKind, MethodBlockBaseSyntax>\n    {\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(rule);\n\n        protected override GeneratedCodeRecognizer GeneratedCodeRecognizer =>\n            VisualBasicGeneratedCodeRecognizer.Instance;\n\n        protected override SyntaxKind[] SyntaxKinds { get; } =\n            new[]\n            {\n                SyntaxKind.ConstructorBlock,\n                SyntaxKind.SubBlock,\n                SyntaxKind.FunctionBlock\n            };\n\n        protected override string MethodKeyword { get; } = \"procedures\";\n\n        protected override IEnumerable<SyntaxToken> GetMethodTokens(MethodBlockBaseSyntax baseMethodDeclaration) =>\n            baseMethodDeclaration.Statements.SelectMany(s => s.DescendantTokens());\n\n        protected override SyntaxToken? GetMethodIdentifierToken(MethodBlockBaseSyntax baseMethodDeclaration) =>\n            baseMethodDeclaration.GetIdentifierOrDefault();\n\n        protected override string GetMethodKindAndName(SyntaxToken identifierToken)\n        {\n            var declaration = identifierToken.Parent;\n            if (declaration.IsKind(SyntaxKind.SubNewStatement))\n            {\n                return $\"constructor\";\n            }\n\n            var identifierName = identifierToken.ValueText;\n            if (string.IsNullOrEmpty(identifierName))\n            {\n                return \"procedure\";\n            }\n\n            if (declaration.IsKind(SyntaxKind.FunctionStatement))\n            {\n                return $\"function '{identifierName}'\";\n            }\n\n            if (declaration.IsKind(SyntaxKind.SubStatement))\n            {\n                return identifierName == \"Finalize\"\n                    ? \"finalizer\"\n                    : $\"method '{identifierName}'\";\n            }\n\n            return \"procedure\";\n        }\n    }\n}\n\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/MultipleVariableDeclaration.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class MultipleVariableDeclaration : MultipleVariableDeclarationBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language { get; } = VisualBasicFacade.Instance;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/MultipleVariableDeclarationCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Formatting;\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[ExportCodeFixProvider(LanguageNames.VisualBasic)]\npublic sealed class MultipleVariableDeclarationCodeFix : MultipleVariableDeclarationCodeFixBase\n{\n    protected override SyntaxNode CalculateNewRoot(SyntaxNode root, SyntaxNode node) =>\n        node is ModifiedIdentifierSyntax { Parent: VariableDeclaratorSyntax declarator }\n            ? root.ReplaceNode(declarator.Parent, CreateNewNodes(declarator))\n            : root;\n\n    private static IEnumerable<SyntaxNode> CreateNewNodes(VariableDeclaratorSyntax declarator) =>\n        declarator.Parent switch\n        {\n            FieldDeclarationSyntax fieldDeclaration => CreateNewNodes(fieldDeclaration),\n            LocalDeclarationStatementSyntax localDeclaration => CreateNewNodes(localDeclaration),\n            _ => new[] { declarator.Parent }\n        };\n\n    private static IEnumerable<SyntaxNode> CreateNewNodes(FieldDeclarationSyntax declaration) =>\n        declaration.Declarators.SelectMany(x => GetConvertedDeclarators(x).Select(declarator => CreateFieldDeclarationSyntax(declaration, declarator)));\n\n    private static IEnumerable<SyntaxNode> CreateNewNodes(LocalDeclarationStatementSyntax declaration) =>\n        declaration.Declarators.SelectMany(x => GetConvertedDeclarators(x).Select(declarator => CreateLocalDeclarationStatementSyntax(declaration, declarator)));\n\n    private static FieldDeclarationSyntax CreateFieldDeclarationSyntax(FieldDeclarationSyntax declaration, VariableDeclaratorSyntax declarator) =>\n        SyntaxFactory.FieldDeclaration(declaration.AttributeLists, declaration.Modifiers, SyntaxFactory.SeparatedList(new[] { declarator }));\n\n    private static LocalDeclarationStatementSyntax CreateLocalDeclarationStatementSyntax(LocalDeclarationStatementSyntax declaration, VariableDeclaratorSyntax declarator) =>\n        SyntaxFactory.LocalDeclarationStatement(declaration.Modifiers, SyntaxFactory.SeparatedList(new[] { declarator }));\n\n    private static IEnumerable<VariableDeclaratorSyntax> GetConvertedDeclarators(VariableDeclaratorSyntax declarator)\n    {\n        var declarators = declarator.Names.Select(x => SyntaxFactory.VariableDeclarator(SyntaxFactory.SeparatedList(new[] { x }), declarator.AsClause, null)).ToList();\n        if (declarator.Initializer != null)\n        {\n            var last = declarators.Last();\n            last = last.WithInitializer(declarator.Initializer);\n            declarators[declarators.Count - 1] = last;\n        }\n\n        return declarators.Select(x => x.WithTrailingTrivia(SyntaxFactory.EndOfLineTrivia(Environment.NewLine)).WithAdditionalAnnotations(Formatter.Annotation));\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/NameOfShouldBeUsed.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class NameOfShouldBeUsed : NameOfShouldBeUsedBase<MethodBlockBaseSyntax, SyntaxKind, ThrowStatementSyntax>\n    {\n        private static readonly HashSet<SyntaxKind> StringTokenTypes = new HashSet<SyntaxKind>\n        {\n            SyntaxKind.InterpolatedStringTextToken,\n            SyntaxKind.StringLiteralToken\n        };\n\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n        protected override string NameOf => \"NameOf\";\n\n        protected override MethodBlockBaseSyntax MethodSyntax(SyntaxNode node) =>\n            node.AncestorsAndSelf().OfType<MethodBlockBaseSyntax>().FirstOrDefault();\n\n        protected override bool IsStringLiteral(SyntaxToken t) =>\n            t.IsAnyKind(StringTokenTypes);\n\n        protected override IEnumerable<string> GetParameterNames(MethodBlockBaseSyntax method)\n        {\n            var paramGroups = method?.BlockStatement.ParameterList?.Parameters.GroupBy(x => x.Identifier.Identifier.ValueText);\n            return paramGroups == null || paramGroups.Any(x => x.Count() != 1)\n                ? Enumerable.Empty<string>()\n                : paramGroups.Select(x => x.First().Identifier.Identifier.ValueText);\n        }\n\n        protected override bool LeastLanguageVersionMatches(SonarSyntaxNodeReportingContext context) =>\n            context.Compilation.IsAtLeastLanguageVersion(LanguageVersion.VisualBasic14);\n\n        protected override bool IsArgumentExceptionCallingNameOf(SyntaxNode node, IEnumerable<string> arguments) =>\n            ((ThrowStatementSyntax)node).Expression is ObjectCreationExpressionSyntax objectCreation\n            && ArgumentExceptionNameOfPosition(objectCreation.Type.ToString()) is var idx\n            && objectCreation.ArgumentList?.Arguments is { } creationArguments\n            && creationArguments.Count >= idx + 1\n            && creationArguments[idx].GetExpression() is NameOfExpressionSyntax nameOfExpression\n            && arguments.Contains(nameOfExpression.Argument.ToString());\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Naming/ClassName.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class ClassName : ParametrizedDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S101\";\n    private const string MessageFormat = \"Rename this class to match the regular expression: '{0}'.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat, false);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    [RuleParameter(\"format\", PropertyType.String, \"Regular expression used to check the class names against.\", NamingPatterns.PascalCasingPattern)]\n    public string Pattern { get; set; } = NamingPatterns.PascalCasingPattern;\n\n    protected override void Initialize(SonarParametrizedAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var declaration = (ClassStatementSyntax)c.Node;\n                if (!NamingPatterns.IsRegexMatch(declaration.Identifier.ValueText, Pattern))\n                {\n                    c.ReportIssue(Rule, declaration.Identifier, Pattern);\n                }\n            },\n            SyntaxKind.ClassStatement);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Naming/EnumNameShouldFollowRegex.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class EnumNameShouldFollowRegex : EnumNameShouldFollowRegexBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language { get; } = VisualBasicFacade.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Naming/EnumerationValueName.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class EnumerationValueName : ParametrizedDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S2343\";\n    private const string MessageFormat = \"Rename '{0}' to match the regular expression: '{1}'.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat, false);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    [RuleParameter(\"format\", PropertyType.String, \"Regular expression used to check the enumeration value names against.\", NamingPatterns.PascalCasingPattern)]\n    public string Pattern { get; set; } = NamingPatterns.PascalCasingPattern;\n\n    protected override void Initialize(SonarParametrizedAnalysisContext context) =>\n        context.RegisterNodeAction(\n            c =>\n            {\n                var enumMemberDeclaration = (EnumMemberDeclarationSyntax)c.Node;\n                if (!NamingPatterns.IsRegexMatch(enumMemberDeclaration.Identifier.ValueText, Pattern))\n                {\n                    c.ReportIssue(Rule, enumMemberDeclaration.Identifier,\n                        enumMemberDeclaration.Identifier.ValueText, Pattern);\n                }\n            },\n            SyntaxKind.EnumMemberDeclaration);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Naming/EventHandlerName.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class EventHandlerName : ParametrizedDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S2347\";\n    private const string MessageFormat = \"Rename event handler '{0}' to match the regular expression: '{1}'.\";\n    private const string DefaultPattern = \"^(([a-z][a-z0-9]*)?\" + NamingPatterns.PascalCasingInternalPattern + \"_)?\" + NamingPatterns.PascalCasingInternalPattern + \"$\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat, false);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    [RuleParameter(\"format\", PropertyType.String, \"Regular expression used to check the even handler names against.\", DefaultPattern)]\n    public string Pattern { get; set; } = DefaultPattern;\n\n    internal static bool IsEventHandler(MethodStatementSyntax declaration, SemanticModel model)\n    {\n        if (declaration.HandlesClause is not null)\n        {\n            return true;\n        }\n\n        var symbol = model.GetDeclaredSymbol(declaration);\n        return symbol is not null && symbol.IsEventHandler();\n    }\n\n    protected override void Initialize(SonarParametrizedAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var methodDeclaration = (MethodStatementSyntax)c.Node;\n                if (!NamingPatterns.IsRegexMatch(methodDeclaration.Identifier.ValueText, Pattern)\n                    && IsEventHandler(methodDeclaration, c.Model))\n                {\n                    c.ReportIssue(Rule, methodDeclaration.Identifier, methodDeclaration.Identifier.ValueText, Pattern);\n                }\n            },\n            SyntaxKind.SubStatement);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Naming/EventName.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class EventName : ParametrizedDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S2348\";\n    private const string MessageFormat = \"Rename this event to match the regular expression: '{0}'.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat, false);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    [RuleParameter(\"format\", PropertyType.String, \"Regular expression used to check the event names against.\", NamingPatterns.PascalCasingPattern)]\n    public string Pattern { get; set; } = NamingPatterns.PascalCasingPattern;\n\n    protected override void Initialize(SonarParametrizedAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var eventDeclaration = (EventStatementSyntax)c.Node;\n                if (!NamingPatterns.IsRegexMatch(eventDeclaration.Identifier.ValueText, Pattern))\n                {\n                    c.ReportIssue(Rule, eventDeclaration.Identifier, Pattern);\n                }\n            },\n            SyntaxKind.EventStatement);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Naming/FieldNameChecker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    public abstract class FieldNameChecker : ParametrizedDiagnosticAnalyzer\n    {\n        public virtual string Pattern { get; set; }\n\n        protected abstract bool IsCandidateSymbol(IFieldSymbol symbol);\n\n        protected sealed override void Initialize(SonarParametrizedAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var fieldDeclaration = (FieldDeclarationSyntax)c.Node;\n                    foreach (var name in fieldDeclaration.Declarators.SelectMany(v => v.Names).WhereNotNull())\n                    {\n                        if (c.Model.GetDeclaredSymbol(name) is IFieldSymbol symbol &&\n                            IsCandidateSymbol(symbol) &&\n                            !NamingPatterns.IsRegexMatch(symbol.Name, Pattern))\n                        {\n                            c.ReportIssue(SupportedDiagnostics[0], name, symbol.Name, Pattern);\n                        }\n                    }\n                },\n                SyntaxKind.FieldDeclaration);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Naming/FunctionName.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class FunctionName : ParametrizedDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S1542\";\n    private const string MessageFormat = \"Rename {0} '{1}' to match the regular expression: '{2}'.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat, false);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    [RuleParameter(\"format\", PropertyType.String, \"Regular expression used to check the function names against.\", NamingPatterns.PascalCasingPattern)]\n    public string Pattern { get; set; } = NamingPatterns.PascalCasingPattern;\n\n    protected override void Initialize(SonarParametrizedAnalysisContext context)\n    {\n        context.RegisterNodeAction(\n            c =>\n            {\n                var methodDeclaration = (MethodStatementSyntax)c.Node;\n                if (ShouldBeChecked(methodDeclaration, c.ContainingSymbol)\n                    && !NamingPatterns.IsRegexMatch(methodDeclaration.Identifier.ValueText, Pattern))\n                {\n                    c.ReportIssue(Rule, methodDeclaration.Identifier, \"function\", methodDeclaration.Identifier.ValueText, Pattern);\n                }\n            },\n            SyntaxKind.FunctionStatement);\n\n        context.RegisterNodeAction(\n            c =>\n            {\n                var methodDeclaration = (MethodStatementSyntax)c.Node;\n                if (ShouldBeChecked(methodDeclaration, c.ContainingSymbol)\n                    && !NamingPatterns.IsRegexMatch(methodDeclaration.Identifier.ValueText, Pattern)\n                    && !EventHandlerName.IsEventHandler(methodDeclaration, c.Model))\n                {\n                    c.ReportIssue(Rule, methodDeclaration.Identifier, \"procedure\", methodDeclaration.Identifier.ValueText, Pattern);\n                }\n            },\n            SyntaxKind.SubStatement);\n\n        static bool ShouldBeChecked(MethodStatementSyntax methodStatement, ISymbol declaredSymbol) =>\n            !declaredSymbol.IsOverride\n            && !IsExternImport(declaredSymbol)\n            && !ImplementsSingleMethodWithoutOverride(methodStatement, declaredSymbol);\n\n        static bool IsExternImport(ISymbol methodSymbol) =>\n            methodSymbol.IsExtern && methodSymbol.IsStatic && methodSymbol.HasAttribute(KnownType.System_Runtime_InteropServices_DllImportAttribute);\n\n        static bool ImplementsSingleMethodWithoutOverride(MethodStatementSyntax methodStatement, ISymbol methodSymbol) =>\n            methodStatement.ImplementsClause is { } implementsClause\n            && implementsClause.InterfaceMembers.Count == 1\n            && methodSymbol.InterfaceMembers().FirstOrDefault() is { } interfaceMember\n            && string.Equals(interfaceMember.Name, methodStatement.Identifier.ValueText, StringComparison.Ordinal);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Naming/InterfaceName.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class InterfaceName : ParametrizedDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S114\";\n    private const string MessageFormat = \"Rename this interface to match the regular expression: '{0}'.\";\n    private const string DefaultPattern = \"^I\" + NamingPatterns.PascalCasingInternalPattern + \"$\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat, false);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    [RuleParameter(\"format\", PropertyType.String, \"Regular expression used to check the interface names against.\", DefaultPattern)]\n    public string Pattern { get; set; } = DefaultPattern;\n\n    protected override void Initialize(SonarParametrizedAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var declaration = (InterfaceStatementSyntax)c.Node;\n                if (!NamingPatterns.IsRegexMatch(declaration.Identifier.ValueText, Pattern))\n                {\n                    c.ReportIssue(Rule, declaration.Identifier, Pattern);\n                }\n            },\n            SyntaxKind.InterfaceStatement);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Naming/LocalVariableName.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class LocalVariableName : ParametrizedDiagnosticAnalyzer\n{\n    internal const string DiagnosticId = \"S117\";\n    private const string MessageFormat = \"Rename this local variable to match the regular expression: '{0}'.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat, false);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    [RuleParameter(\"format\", PropertyType.String, \"Regular expression used to check the local variable names against.\", NamingPatterns.CamelCasingPattern)]\n    public string Pattern { get; set; } = NamingPatterns.CamelCasingPattern;\n\n    protected override void Initialize(SonarParametrizedAnalysisContext context)\n    {\n        context.RegisterNodeAction(ProcessVariableDeclarator, SyntaxKind.VariableDeclarator);\n        context.RegisterNodeAction(c => ProcessLoop(c, (ForStatementSyntax)c.Node, f => f.ControlVariable, s => s.IsFor()), SyntaxKind.ForStatement);\n        context.RegisterNodeAction(c => ProcessLoop(c, (ForEachStatementSyntax)c.Node, f => f.ControlVariable, s => s.IsForEach()), SyntaxKind.ForEachStatement);\n    }\n\n    private void ProcessLoop<T>(SonarSyntaxNodeReportingContext context, T loop, Func<T, VisualBasicSyntaxNode> controlVariable, Func<ILocalSymbol, bool> isDeclaredInLoop)\n    {\n        if (controlVariable(loop) is IdentifierNameSyntax identifier\n            && context.Model.GetSymbolInfo(identifier).Symbol is ILocalSymbol symbol\n            && isDeclaredInLoop(symbol)\n            && !NamingPatterns.IsRegexMatch(symbol.Name, Pattern))\n        {\n            context.ReportIssue(Rule, identifier, Pattern);\n        }\n    }\n\n    private void ProcessVariableDeclarator(SonarSyntaxNodeReportingContext context)\n    {\n        var declarator = (VariableDeclaratorSyntax)context.Node;\n        if (declarator.Parent is FieldDeclarationSyntax)\n        {\n            return;\n        }\n\n        foreach (var name in declarator.Names.Where(x => x is not null && !NamingPatterns.IsRegexMatch(x.Identifier.ValueText, Pattern)))\n        {\n            if (context.Model.GetDeclaredSymbol(name) is ILocalSymbol symbol && !symbol.IsConst)\n            {\n                context.ReportIssue(Rule, name.Identifier, Pattern);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Naming/NamespaceName.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class NamespaceName : ParametrizedDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S2304\";\n    private const string MessageFormat = \"Rename this namespace to match the regular expression: '{0}'.\";\n    private const string DefaultPattern = \"^\" + NamingPatterns.PascalCasingInternalPattern + @\"(\\.\" + NamingPatterns.PascalCasingInternalPattern + \")*$\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat, isEnabledByDefault: false);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    [RuleParameter(\"format\", PropertyType.String, \"Regular expression used to check the namespace names against.\", DefaultPattern)]\n    public string Pattern { get; set; } = DefaultPattern;\n\n    protected override void Initialize(SonarParametrizedAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var declaration = (NamespaceStatementSyntax)c.Node;\n                var declarationName = declaration.Name?.ToString();\n                if (declarationName is not null && !NamingPatterns.IsRegexMatch(declarationName, Pattern))\n                {\n                    c.ReportIssue(Rule, declaration.Name, Pattern);\n                }\n            },\n            SyntaxKind.NamespaceStatement);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Naming/ParameterName.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class ParameterName : ParametrizedDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S1654\";\n    private const string MessageFormat = \"Rename this parameter to match the regular expression: '{0}'.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat, isEnabledByDefault: false);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    [RuleParameter(\"format\", PropertyType.String, \"Regular expression used to check the parameter names against.\", NamingPatterns.CamelCasingPattern)]\n    public string Pattern { get; set; } = NamingPatterns.CamelCasingPattern;\n\n    protected override void Initialize(SonarParametrizedAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var parameter = (ParameterSyntax)c.Node;\n                if (parameter.Identifier is not null\n                    && !HasPredefinedName(parameter)\n                    && !NamingPatterns.IsRegexMatch(parameter.Identifier.Identifier.ValueText, Pattern))\n                {\n                    c.ReportIssue(Rule, parameter.Identifier.Identifier, Pattern);\n                }\n            },\n            SyntaxKind.Parameter);\n\n    private static bool HasPredefinedName(SyntaxNode node)\n    {\n        while (node is not null)\n        {\n            if (node is MethodStatementSyntax method)\n            {\n                return method.Modifiers.Any(SyntaxKind.OverridesKeyword) || method.ImplementsClause is not null || method.HandlesClause is not null;\n            }\n            else if (node is PropertyStatementSyntax property)\n            {\n                return property.Modifiers.Any(SyntaxKind.OverridesKeyword) || property.ImplementsClause is not null;\n            }\n            else\n            {\n                node = node.Parent;\n            }\n        }\n        return false;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Naming/PrivateConstantFieldName.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class PrivateConstantFieldName : FieldNameChecker\n{\n    private const string DiagnosticId = \"S2362\";\n    private const string MessageFormat = \"Rename '{0}' to match the regular expression: '{1}'.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat, false);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    [RuleParameter(\"format\", PropertyType.String, \"Regular expression used to check the private constant names against.\", NamingPatterns.CamelCasingPatternWithOptionalPrefixes)]\n    public override string Pattern { get; set; } = NamingPatterns.CamelCasingPatternWithOptionalPrefixes;\n\n    protected override bool IsCandidateSymbol(IFieldSymbol symbol) =>\n        symbol.DeclaredAccessibility == Accessibility.Private && symbol.IsConst;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Naming/PrivateFieldName.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class PrivateFieldName : FieldNameChecker\n{\n    private const string DiagnosticId = \"S2364\";\n    private const string MessageFormat = \"Rename '{0}' to match the regular expression: '{1}'.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat, false);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    [RuleParameter(\"format\", PropertyType.String, \"Regular expression used to check the private field names against.\", NamingPatterns.CamelCasingPatternWithOptionalPrefixes)]\n    public override string Pattern { get; set; } = NamingPatterns.CamelCasingPatternWithOptionalPrefixes;\n\n    protected override bool IsCandidateSymbol(IFieldSymbol symbol) => symbol.DeclaredAccessibility == Accessibility.Private\n        && !symbol.IsConst\n        && !(symbol.IsShared() && symbol.IsReadOnly);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Naming/PrivateSharedReadonlyFieldName.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class PrivateSharedReadonlyFieldName : FieldNameChecker\n{\n    private const string DiagnosticId = \"S2363\";\n    private const string MessageFormat = \"Rename '{0}' to match the regular expression: '{1}'.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat, false);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    [RuleParameter(\"format\", PropertyType.String, \"Regular expression used to check the 'Private Shared ReadOnly' field names against.\", NamingPatterns.CamelCasingPatternWithOptionalPrefixes)]\n    public override string Pattern { get; set; } = NamingPatterns.CamelCasingPatternWithOptionalPrefixes;\n\n    protected override bool IsCandidateSymbol(IFieldSymbol symbol) =>\n        symbol.DeclaredAccessibility == Accessibility.Private\n        && symbol.IsShared()\n        && symbol.IsReadOnly;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Naming/PropertyName.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class PropertyName : ParametrizedDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"S2366\";\n    private const string MessageFormat = \"Rename this property to match the regular expression: '{0}'.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat, false);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    [RuleParameter(\"format\", PropertyType.String, \"Regular expression used to check the property names against.\", NamingPatterns.PascalCasingPattern)]\n    public string Pattern { get; set; } = NamingPatterns.PascalCasingPattern;\n\n    protected override void Initialize(SonarParametrizedAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var propertyDeclaration = (PropertyStatementSyntax)c.Node;\n                if (!NamingPatterns.IsRegexMatch(propertyDeclaration.Identifier.ValueText, Pattern))\n                {\n                    c.ReportIssue(Rule, propertyDeclaration.Identifier, Pattern);\n                }\n            },\n            SyntaxKind.PropertyStatement);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Naming/PublicConstantFieldName.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class PublicConstantFieldName : FieldNameChecker\n{\n    private const string DiagnosticId = \"S2367\";\n    private const string MessageFormat = \"Rename '{0}' to match the regular expression: '{1}'.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat, false);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    [RuleParameter(\"format\", PropertyType.String, \"Regular expression used to check the non-private constant names against.\", NamingPatterns.PascalCasingPattern)]\n    public override string Pattern { get; set; } = NamingPatterns.PascalCasingPattern;\n\n    protected override bool IsCandidateSymbol(IFieldSymbol symbol) =>\n        symbol.DeclaredAccessibility != Accessibility.Private && symbol.IsConst;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Naming/PublicFieldName.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class PublicFieldName : FieldNameChecker\n{\n    private const string DiagnosticId = \"S2369\";\n    private const string MessageFormat = \"Rename '{0}' to match the regular expression: '{1}'.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat, isEnabledByDefault: false);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    [RuleParameter(\"format\", PropertyType.String, \"Regular expression used to check the non-private field names against.\", NamingPatterns.PascalCasingPattern)]\n    public override string Pattern { get; set; } = NamingPatterns.PascalCasingPattern;\n\n    protected override bool IsCandidateSymbol(IFieldSymbol symbol) =>\n        symbol.DeclaredAccessibility != Accessibility.Private\n        && !symbol.IsConst\n        && !(symbol.IsShared() && symbol.IsReadOnly);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Naming/PublicSharedReadonlyFieldName.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class PublicSharedReadonlyFieldName : FieldNameChecker\n{\n    private const string DiagnosticId = \"S2370\";\n    private const string MessageFormat = \"Rename '{0}' to match the regular expression: '{1}'.\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat, false);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n    [RuleParameter(\"format\", PropertyType.String, \"Regular expression used to check the non-private 'Shared ReadOnly' field names against.\", NamingPatterns.PascalCasingPattern)]\n    public override string Pattern { get; set; } = NamingPatterns.PascalCasingPattern;\n\n    protected override bool IsCandidateSymbol(IFieldSymbol symbol) =>\n        symbol.DeclaredAccessibility != Accessibility.Private\n        && symbol.IsShared()\n        && symbol.IsReadOnly;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Naming/TypeParameterName.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class TypeParameterName : ParametrizedDiagnosticAnalyzer\n{\n    private const string S119DiagnosticId = \"S119\";\n\n    [Obsolete(\"This rule is superseded by S119.\")]\n    private const string S2373DiagnosticId = \"S2373\";\n\n    private const string MessageFormat = \"Rename '{0}' to match the regular expression: '{1}'.\";\n    private const string DefaultFormat = \"^T(\" + NamingPatterns.PascalCasingInternalPattern + \")?\";\n\n    internal static readonly DiagnosticDescriptor S119 = DescriptorFactory.Create(S119DiagnosticId, MessageFormat, isEnabledByDefault: false);\n    internal static readonly DiagnosticDescriptor S2373 = DescriptorFactory.Create(S2373DiagnosticId, MessageFormat, isEnabledByDefault: false);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(S119, S2373);\n\n    [RuleParameter(\"format\", PropertyType.String, \"Regular expression used to check the generic type parameter names against.\", DefaultFormat)]\n    public string Pattern { get; set; } = DefaultFormat;\n\n    protected override void Initialize(SonarParametrizedAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var typeParameter = (TypeParameterSyntax)c.Node;\n                if (!NamingPatterns.IsRegexMatch(typeParameter.Identifier.ValueText, Pattern))\n                {\n                    var location = typeParameter.Identifier.GetLocation();\n                    c.ReportIssue(S119, location, typeParameter.Identifier.ValueText, Pattern);\n                    c.ReportIssue(S2373, location, typeParameter.Identifier.ValueText, Pattern);\n                }\n            },\n            SyntaxKind.TypeParameter);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/NegatedIsExpression.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class NegatedIsExpression : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S2358\";\n        private const string MessageFormat = \"Replace this use of 'Not...Is...' with 'IsNot'.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var unary = (UnaryExpressionSyntax)c.Node;\n                    if (unary.Operand.IsKind(SyntaxKind.IsExpression))\n                    {\n                        c.ReportIssue(rule, unary);\n                    }\n                },\n                SyntaxKind.NotExpression);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/NegatedIsExpressionCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.VisualBasic)]\n    public sealed class NegatedIsExpressionCodeFix : SonarCodeFix\n    {\n        internal const string Title = \"Replace 'Not...Is...' with 'IsNot'.\";\n\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(NegatedIsExpression.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n            var unary = root.FindNode(diagnosticSpan, getInnermostNodeForTie: true) as UnaryExpressionSyntax;\n\n            if (!(unary?.Operand is BinaryExpressionSyntax isExpression) ||\n                !isExpression.IsKind(SyntaxKind.IsExpression))\n            {\n                return Task.CompletedTask;\n            }\n\n            context.RegisterCodeFix(\n                Title,\n                c => ChangeToIsNotAsync(context.Document, unary, isExpression, c),\n                context.Diagnostics);\n\n            return Task.CompletedTask;\n        }\n\n        private static async Task<Document> ChangeToIsNotAsync(Document document, UnaryExpressionSyntax unary, BinaryExpressionSyntax isExpression, CancellationToken cancel)\n        {\n            var root = await document.GetSyntaxRootAsync(cancel).ConfigureAwait(false);\n            var newRoot = root.ReplaceNode(\n                unary,\n                SyntaxFactory.BinaryExpression(\n                    SyntaxKind.IsNotExpression,\n                    isExpression.Left,\n                    SyntaxFactory.Token(SyntaxKind.IsNotKeyword).WithTriviaFrom(isExpression.OperatorToken),\n                    isExpression.Right));\n            return document.WithSyntaxRoot(newRoot);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/NoExceptionsInFinally.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class NoExceptionsInFinally : NoExceptionsInFinallyBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n                {\n                    var walker = new ThrowInFinallyWalker(c, Rule);\n                    foreach (var statement in ((FinallyBlockSyntax)c.Node).Statements)\n                    {\n                        walker.SafeVisit(statement);\n                    }\n                }, SyntaxKind.FinallyBlock);\n\n        private class ThrowInFinallyWalker : SafeVisualBasicSyntaxWalker\n        {\n            private readonly SonarSyntaxNodeReportingContext context;\n            private readonly DiagnosticDescriptor rule;\n\n            public ThrowInFinallyWalker(SonarSyntaxNodeReportingContext context, DiagnosticDescriptor rule)\n            {\n                this.context = context;\n                this.rule = rule;\n            }\n\n            public override void VisitThrowStatement(ThrowStatementSyntax node) =>\n                context.ReportIssue(rule, node);\n\n            public override void VisitFinallyBlock(FinallyBlockSyntax node)\n            {\n                // Do not call base to force the walker to stop. Another walker will take care of this finally clause.\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/NonAsyncTaskShouldNotReturnNull.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class NonAsyncTaskShouldNotReturnNull : NonAsyncTaskShouldNotReturnNullBase\n    {\n        private const string MessageFormat = \"Do not return null from this method, instead return \" +\n            \"'Task.FromResult(Of T)(Nothing)', 'Task.CompletedTask' or 'Task.Delay(0)'.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var nullLiteral = (LiteralExpressionSyntax)c.Node;\n\n                    if (!IsParentReturnOrReturnTernary(nullLiteral))\n                    {\n                        return;\n                    }\n\n                    var enclosingMember = GetEnclosingMember(nullLiteral);\n                    if (enclosingMember != null &&\n                        !enclosingMember.IsKind(SyntaxKind.VariableDeclarator) &&\n                        IsInvalidEnclosingSymbolContext(enclosingMember, c.Model))\n                    {\n                        c.ReportIssue(rule, nullLiteral);\n                    }\n                },\n                SyntaxKind.NothingLiteralExpression);\n        }\n\n        private static bool IsParentReturnOrReturnTernary(SyntaxNode node)\n        {\n            var parent = node.GetFirstNonParenthesizedParent();\n\n            if (parent.IsKind(SyntaxKind.ReturnStatement))\n            {\n                return true;\n            }\n            else if (parent.IsKind(SyntaxKind.TernaryConditionalExpression))\n            {\n                var grandParent = parent.GetFirstNonParenthesizedParent();\n\n                return grandParent.IsKind(SyntaxKind.ReturnStatement);\n            }\n            else\n            {\n                return false;\n            }\n        }\n\n        private static SyntaxNode GetEnclosingMember(LiteralExpressionSyntax literal)\n        {\n            foreach (var ancestor in literal.Ancestors())\n            {\n                switch (ancestor.Kind())\n                {\n                    case SyntaxKind.MultiLineFunctionLambdaExpression:\n                    case SyntaxKind.SingleLineFunctionLambdaExpression:\n                        return null;\n\n                    case SyntaxKind.VariableDeclarator:\n                    case SyntaxKind.PropertyBlock:\n                    case SyntaxKind.FunctionBlock:\n                        return ancestor;\n\n                    default:\n                        // do nothing\n                        break;\n                }\n            }\n\n            return null;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/ObsoleteAttributes.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class ObsoleteAttributes : ObsoleteAttributesBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override SyntaxNode GetExplanationExpression(SyntaxNode node) =>\n       node is AttributeSyntax { ArgumentList.Arguments: { Count: >= 1 } arguments }\n           && arguments[0] is SimpleArgumentSyntax { Expression: { } } argument\n               ? argument.Expression\n               : null;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/OnErrorStatement.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class OnErrorStatement : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S2359\";\n        private const string MessageFormat = \"Remove this use of 'OnError'.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var node = (OnErrorGoToStatementSyntax)c.Node;\n                    c.ReportIssue(rule, node.OnKeyword.CreateLocation(node.ErrorKeyword));\n                },\n                SyntaxKind.OnErrorGoToLabelStatement,\n                SyntaxKind.OnErrorGoToZeroStatement,\n                SyntaxKind.OnErrorGoToMinusOneStatement);\n\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var node = (OnErrorResumeNextStatementSyntax)c.Node;\n                    c.ReportIssue(rule, node.OnKeyword.CreateLocation(node.ErrorKeyword));\n                },\n                SyntaxKind.OnErrorResumeNextStatement);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/OptionExplicitOn.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class OptionExplicitOn : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S6146\";\n        private const string MessageFormat = \"{0}\";\n        private const string StatementMessage = \"Change this to 'Option Explicit On'.\";\n        private const string AssemblyMessageFormat = \"Configure 'Option Explicit On' for assembly '{0}'.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(c =>\n                {\n                    var statement = (OptionStatementSyntax)c.Node;\n                    if (statement.NameKeyword.IsKind(SyntaxKind.ExplicitKeyword) && statement.ValueKeyword.IsKind(SyntaxKind.OffKeyword))\n                    {\n                        c.ReportIssue(Rule, statement, StatementMessage);\n                    }\n                },\n                SyntaxKind.OptionStatement);\n\n            context.RegisterCompilationStartAction(cStart =>\n                cStart.RegisterCompilationEndAction(c =>\n                {\n                    if (!c.Compilation.VB().Options.OptionExplicit)\n                    {\n                        c.ReportIssue(Rule, (Location)null, string.Format(AssemblyMessageFormat, c.Compilation.AssemblyName));\n                    }\n                }));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/OptionStrictOn.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class OptionStrictOn : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S6145\";\n        private const string MessageFormat = \"{0}\";\n        private const string StatementMessage = \"Change this to 'Option Strict On'.\";\n        private const string AssemblyMessageFormat = \"Configure 'Option Strict On' for assembly '{0}'.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(c =>\n            {\n                var statement = (OptionStatementSyntax)c.Node;\n                if (statement.NameKeyword.IsKind(SyntaxKind.StrictKeyword) && !statement.ValueKeyword.IsKind(SyntaxKind.OnKeyword))\n                {\n                    c.ReportIssue(Rule, statement, StatementMessage);\n                }\n            },\n            SyntaxKind.OptionStatement);\n\n            context.RegisterCompilationStartAction(cStart =>\n                cStart.RegisterCompilationEndAction(c =>\n                {\n                    if (c.Compilation.VB().Options.OptionStrict != OptionStrict.On)\n                    {\n                        c.ReportIssue(Rule, (Location)null, string.Format(AssemblyMessageFormat, c.Compilation.AssemblyName));\n                    }\n                }));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/OptionalParameter.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class OptionalParameter : OptionalParameterBase<SyntaxKind, MethodBaseSyntax, ParameterSyntax>\n    {\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        private static readonly ImmutableArray<SyntaxKind> kindsOfInterest = ImmutableArray.Create(\n            SyntaxKind.SubStatement, SyntaxKind.SubNewStatement, SyntaxKind.PropertyStatement, SyntaxKind.FunctionStatement);\n\n        public override ImmutableArray<SyntaxKind> SyntaxKindsOfInterest => kindsOfInterest;\n\n        protected override Location GetReportLocation(ParameterSyntax parameter) =>\n            parameter.Modifiers.First(m => m.IsKind(SyntaxKind.OptionalKeyword)).GetLocation();\n\n        protected override IEnumerable<ParameterSyntax> GetParameters(MethodBaseSyntax method) =>\n            method.ParameterList?.Parameters ?? Enumerable.Empty<ParameterSyntax>();\n\n        protected override bool IsOptional(ParameterSyntax parameter) =>\n            parameter.Modifiers.Any(SyntaxKind.OptionalKeyword);\n\n        protected override GeneratedCodeRecognizer GeneratedCodeRecognizer => VisualBasicGeneratedCodeRecognizer.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/OptionalParameterNotPassedToBaseCall.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class OptionalParameterNotPassedToBaseCall : OptionalParameterNotPassedToBaseCallBase<InvocationExpressionSyntax>\n    {\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(rule);\n\n        protected override DiagnosticDescriptor Rule => rule;\n\n        protected override int GetArgumentCount(InvocationExpressionSyntax invocation) =>\n            invocation.ArgumentList == null ? 0 : invocation.ArgumentList.Arguments.Count;\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var invocation = (InvocationExpressionSyntax)c.Node;\n                    if (!invocation.IsOnBase)\n                    {\n                        return;\n                    }\n\n                    ReportOptionalParameterNotPassedToBase(c, invocation);\n                },\n                SyntaxKind.InvocationExpression);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/ParameterAssignedTo.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class ParameterAssignedTo : ParameterAssignedToBase<SyntaxKind, IdentifierNameSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n        protected override bool IsAssignmentToCatchVariable(ISymbol symbol, SyntaxNode node) =>\n            // This could mimic the C# variant too, but that doesn't work https://github.com/dotnet/roslyn/issues/6209\n            symbol is ILocalSymbol localSymbol\n            && localSymbol.Locations.FirstOrDefault() is { } location\n            && node.SyntaxTree.GetRoot().FindNode(location.SourceSpan, getInnermostNodeForTie: true) is IdentifierNameSyntax declarationName\n            && declarationName.Parent is CatchStatementSyntax catchStatement\n            && catchStatement.IdentifierName == declarationName;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/ParameterNameMatchesOriginal.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class ParameterNameMatchesOriginal : ParameterNameMatchesOriginalBase<SyntaxKind, MethodBlockBaseSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n        protected override SyntaxKind[] SyntaxKinds { get; } = new[] { SyntaxKind.SubBlock, SyntaxKind.FunctionBlock };\n\n        protected override IEnumerable<SyntaxToken> ParameterIdentifiers(MethodBlockBaseSyntax method) =>\n            method.BlockStatement.ParameterList.Parameters.Select(x => x.Identifier.Identifier);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/ParametersCorrectOrder.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class ParametersCorrectOrder : ParametersCorrectOrderBase<SyntaxKind>\n    {\n        protected override SyntaxKind[] InvocationKinds => new[]\n        {\n            SyntaxKind.ObjectCreationExpression,\n            SyntaxKind.InvocationExpression\n        };\n\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n        protected override Location PrimaryLocation(SyntaxNode node) =>\n            node switch\n            {\n                InvocationExpressionSyntax { Expression: MemberAccessExpressionSyntax { Name: { } name } } => name.GetLocation(), // A.B.C() -> C\n                InvocationExpressionSyntax { Expression: { } expression } => expression.GetLocation(),                            // A() -> A\n                ObjectCreationExpressionSyntax { Type: QualifiedNameSyntax { Right: { } right } } => right.GetLocation(),         // New A.B.C() -> C\n                ObjectCreationExpressionSyntax { Type: { } type } => type.GetLocation(),                                          // New A() -> A\n                _ => base.PrimaryLocation(node),\n            };\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/PartCreationPolicyShouldBeUsedWithExportAttribute.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class PartCreationPolicyShouldBeUsedWithExportAttribute\n        : PartCreationPolicyShouldBeUsedWithExportAttributeBase<AttributeSyntax, ClassStatementSyntax>\n    {\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override ClassStatementSyntax GetTypeDeclaration(AttributeSyntax attribute) =>\n            attribute.FirstAncestorOrSelf<ClassStatementSyntax>();\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(AnalyzeNode, SyntaxKind.Attribute);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/PreferGuidEmpty.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class PreferGuidEmpty : PreferGuidEmptyBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/PropertiesAccessCorrectField.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class PropertiesAccessCorrectField : PropertiesAccessCorrectFieldBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override IEnumerable<FieldData> FindFieldAssignments(IPropertySymbol property, Compilation compilation)\n    {\n        if (property.SetMethod.GetFirstSyntaxRef() is not AccessorStatementSyntax setter)\n        {\n            return [];\n        }\n\n        // we only keep information for the first location of the symbol\n        var assignments = new Dictionary<IFieldSymbol, FieldData>();\n        FillAssignments(setter, true);\n        // If there're no candidate variables, we'll try to inspect one local method invocation with value as argument\n        if (assignments.Count == 0\n            && SingleInvocation(setter) is { } expression\n            && FindInvokedMethod(compilation, property.ContainingType, expression) is MethodBaseSyntax invokedMethod)\n        {\n            FillAssignments(invokedMethod, false);\n        }\n\n        return assignments.Values;\n\n        void FillAssignments(SyntaxNode root, bool useFieldLocation)\n        {\n            // The \".Parent\" is to go from the accessor statement to the accessor block\n            foreach (var node in root.Parent.DescendantNodes())\n            {\n                FieldData? foundField = null;\n                if (node is AssignmentStatementSyntax { RawKind: (int)SyntaxKind.SimpleAssignmentStatement or (int)SyntaxKind.ConcatenateAssignmentStatement } assignment)\n                {\n                    foundField = assignment.Left.DescendantNodesAndSelf().OfType<ExpressionSyntax>()\n                        .Select(x => ExtractFieldFromExpression(AccessorKind.Setter, x, compilation, useFieldLocation))\n                        .FirstOrDefault(x => x is not null);\n                }\n                else if (node is ArgumentSyntax argument)\n                {\n                    foundField = ExtractFieldFromRefArgument(argument, compilation, useFieldLocation);\n                }\n                if (foundField.HasValue && !assignments.ContainsKey(foundField.Value.Field))\n                {\n                    assignments.Add(foundField.Value.Field, foundField.Value);\n                }\n            }\n        }\n    }\n\n    protected override IEnumerable<FieldData> FindFieldReads(IPropertySymbol property, Compilation compilation)\n    {\n        // We don't handle properties with multiple returns that return different fields\n        if (property.GetMethod.GetFirstSyntaxRef() is not AccessorStatementSyntax getter)\n        {\n            return [];\n        }\n\n        var reads = new Dictionary<IFieldSymbol, FieldData>();\n        FillReads(getter, true);\n        // If there're no candidate variables, we'll try inspect one return of local method invocation\n        if (reads.Count == 0\n            && SingleReturn(getter) is InvocationExpressionSyntax returnExpression\n            && FindInvokedMethod(compilation, property.ContainingType, returnExpression) is MethodBaseSyntax invokedMethod)\n        {\n            FillReads(invokedMethod, false);\n        }\n        return reads.Values;\n\n        void FillReads(SyntaxNode root, bool useFieldLocation)\n        {\n            var notAssigned = root.Parent.DescendantNodes().OfType<ExpressionSyntax>().Where(x => !IsLeftSideOfAssignment(x));\n            // The \".Parent\" is to go from the accessor statement to the accessor block\n            foreach (var expression in notAssigned)\n            {\n                var readField = ExtractFieldFromExpression(AccessorKind.Getter, expression, compilation, useFieldLocation);\n                // we only keep information for the first location of the symbol\n                if (readField.HasValue && !reads.ContainsKey(readField.Value.Field))\n                {\n                    reads.Add(readField.Value.Field, readField.Value);\n                }\n            }\n        }\n    }\n\n    protected override bool ShouldIgnoreAccessor(IMethodSymbol accessorMethod, Compilation compilation)\n    {\n        if (accessorMethod.GetFirstSyntaxRef() is not AccessorStatementSyntax accessor\n            || accessor.Parent.ContainsGetOrSetOnDependencyProperty(compilation)\n            || AccessesSelfBaseProperty(accessorMethod, accessor.Parent, compilation))\n        {\n            return true;\n        }\n\n        // Special case: ignore the accessor if the only statement/expression is a throw.\n        return accessor.DescendantNodes(x => x is StatementSyntax).Take(2).Count() == 1\n            && accessor.DescendantNodes(x => x is ThrowStatementSyntax).Take(2).Count() == 1;\n    }\n\n    protected override bool ImplementsExplicitGetterOrSetter(IPropertySymbol property) =>\n        HasExplicitAccessor(property.SetMethod)\n        || HasExplicitAccessor(property.GetMethod);\n\n    private static ExpressionSyntax SingleReturn(StatementSyntax body)\n    {\n        var returns = body.Parent.DescendantNodes().OfType<ReturnStatementSyntax>().ToArray();\n        return returns.Length == 1 ? returns.Single().Expression : null;\n    }\n\n    private static ExpressionSyntax SingleInvocation(StatementSyntax body)\n    {\n        var expressions = body.Parent.DescendantNodes().OfType<InvocationExpressionSyntax>().Select(x => x.Expression).ToArray();\n        if (expressions.Length == 1)\n        {\n            var expr = expressions.Single();\n            if (expr is IdentifierNameSyntax or MemberAccessExpressionSyntax { Expression: MeExpressionSyntax })\n            {\n                return expr;\n            }\n        }\n        return null;\n    }\n\n    private static FieldData? ExtractFieldFromRefArgument(ArgumentSyntax argument, Compilation compilation, bool useFieldLocation)\n    {\n        var model = compilation.GetSemanticModel(argument.SyntaxTree);\n        if (model is not null && argument.Parent is ArgumentListSyntax argList)\n        {\n            var argumentIndex = argList.Arguments.IndexOf(argument);\n            if (model.GetSymbolInfo(argList.Parent).Symbol is IMethodSymbol methodSymbol\n                && argumentIndex < methodSymbol.Parameters.Length\n                && methodSymbol.Parameters[argumentIndex]?.RefKind != RefKind.None)\n            {\n                return ExtractFieldFromExpression(AccessorKind.Setter, argument.GetExpression(), compilation, useFieldLocation);\n            }\n        }\n        return null;\n    }\n\n    private static FieldData? ExtractFieldFromExpression(AccessorKind accessorKind, ExpressionSyntax expression, Compilation compilation, bool useFieldLocation)\n    {\n        var model = compilation.GetSemanticModel(expression.SyntaxTree);\n        if (model is null)\n        {\n            return null;\n        }\n\n        var strippedExpression = expression.RemoveParentheses();\n\n        // Check for direct field access: \"Foo\"\n        if (strippedExpression is IdentifierNameSyntax && IsFieldOrWithEvents(out var directSymbol))\n        {\n            return new FieldData(accessorKind, directSymbol, strippedExpression, useFieldLocation);\n        }\n        // Check for \"Me.Foo\"\n        else if (strippedExpression is MemberAccessExpressionSyntax { Expression: MeExpressionSyntax } member\n            && model.GetSymbolInfo(strippedExpression).Symbol is IFieldSymbol field)\n        {\n            return new FieldData(accessorKind, field, member.Name, useFieldLocation);\n        }\n\n        return null;\n\n        bool IsFieldOrWithEvents(out IFieldSymbol fieldSymbol)\n        {\n            var symbol = model.GetSymbolInfo(strippedExpression).Symbol;\n            if (symbol is IFieldSymbol strippedExpressionSymbol)\n            {\n                fieldSymbol = strippedExpressionSymbol;\n                return true;\n            }\n            else if (symbol is IPropertySymbol { IsWithEvents: true } property)\n            {\n                fieldSymbol = property.ContainingType.GetMembers(\"_\" + property.Name).OfType<IFieldSymbol>().SingleOrDefault();\n                return fieldSymbol is not null;\n            }\n            else\n            {\n                fieldSymbol = null;\n                return false;\n            }\n        }\n    }\n\n    private static bool IsLeftSideOfAssignment(ExpressionSyntax expression)\n    {\n        var strippedExpression = expression.RemoveParentheses();\n        return strippedExpression.IsLeftSideOfAssignment\n            || (strippedExpression.Parent is ExpressionSyntax parent && parent.IsLeftSideOfAssignment); // for Me.field\n    }\n\n    private static bool HasExplicitAccessor(ISymbol symbol) =>\n        symbol.GetFirstSyntaxRef() is AccessorStatementSyntax accessor\n        && accessor.Parent.DescendantNodes().Any();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/PropertyGetterWithThrow.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class PropertyGetterWithThrow : PropertyGetterWithThrowBase<SyntaxKind, AccessorBlockSyntax>\n    {\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override SyntaxKind ThrowSyntaxKind => SyntaxKind.ThrowStatement;\n\n        protected override bool IsGetter(AccessorBlockSyntax propertyGetter) =>\n            propertyGetter.IsKind(SyntaxKind.GetAccessorBlock);\n\n        protected override bool IsIndexer(AccessorBlockSyntax propertyGetter)\n        {\n            if (!(propertyGetter.Parent is PropertyBlockSyntax propertyBlock))\n            {\n                return false;\n            }\n\n            return propertyBlock.PropertyStatement.ParameterList != null &&\n                propertyBlock.PropertyStatement.ParameterList.Parameters.Any();\n        }\n\n        protected override SyntaxNode GetThrowExpression(SyntaxNode syntaxNode) =>\n            ((ThrowStatementSyntax)syntaxNode).Expression;\n\n        protected override GeneratedCodeRecognizer GeneratedCodeRecognizer =>\n            VisualBasicGeneratedCodeRecognizer.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/PropertyWithArrayType.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class PropertyWithArrayType : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S2365\";\n        private const string MessageFormat = \"Refactor '{0}' into a method, properties should not be based on arrays.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var property = (PropertyStatementSyntax)c.Node;\n                    if (property.ImplementsClause is null\n                        && !property.Modifiers.Any(x => x.IsKind(SyntaxKind.OverridesKeyword))\n                        && c.Model.GetDeclaredSymbol(property) is IPropertySymbol symbol\n                        && !symbol.IsAutoProperty()\n                        && symbol.Type is IArrayTypeSymbol)\n                    {\n                        c.ReportIssue(Rule, property.Identifier, symbol.Name);\n                    }\n                },\n                SyntaxKind.PropertyStatement);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/PropertyWriteOnly.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class PropertyWriteOnly : PropertyWriteOnlyBase<SyntaxKind, PropertyStatementSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n        protected override SyntaxKind SyntaxKind => SyntaxKind.PropertyStatement;\n\n        protected override bool IsWriteOnlyProperty(PropertyStatementSyntax prop) =>\n            prop.Modifiers.Any(SyntaxKind.WriteOnlyKeyword);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/ProvideDeserializationMethodsForOptionalFields.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class ProvideDeserializationMethodsForOptionalFields : ProvideDeserializationMethodsForOptionalFieldsBase\n    {\n        protected override ILanguageFacade Language => VisualBasicFacade.Instance;\n\n        protected override Location GetNamedTypeIdentifierLocation(SyntaxNode node) =>\n            ((TypeStatementSyntax)node).Identifier.GetLocation();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/PublicConstantField.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class PublicConstantField : PublicConstantFieldBase<SyntaxKind, FieldDeclarationSyntax, ModifiedIdentifierSyntax>\n    {\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        public override SyntaxKind FieldDeclarationKind => SyntaxKind.FieldDeclaration;\n        public override string MessageArgument => \"'Shared Read-Only'\";\n\n        protected override Location GetReportLocation(ModifiedIdentifierSyntax node) =>\n            node.GetLocation();\n\n        protected override IEnumerable<ModifiedIdentifierSyntax> GetVariables(FieldDeclarationSyntax node) =>\n            node.Declarators.SelectMany(d => d.Names);\n\n        protected override GeneratedCodeRecognizer GeneratedCodeRecognizer => VisualBasicGeneratedCodeRecognizer.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/PublicMethodWithMultidimensionalArray.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class PublicMethodWithMultidimensionalArray : PublicMethodWithMultidimensionalArrayBase<SyntaxKind>\n{\n    private static readonly ImmutableArray<SyntaxKind> KindsOfInterest = ImmutableArray.Create(SyntaxKind.SubStatement, SyntaxKind.FunctionStatement, SyntaxKind.ConstructorBlock);\n\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n    protected override ImmutableArray<SyntaxKind> SyntaxKindsOfInterest => KindsOfInterest;\n\n    protected override Location GetIssueLocation(SyntaxNode node) =>\n        node is ConstructorBlockSyntax x\n            ? x.SubNewStatement.NewKeyword.GetLocation()\n            : Language.Syntax.NodeIdentifier(node)?.GetLocation();\n\n    protected override string GetType(SyntaxNode node) =>\n        node is MethodStatementSyntax ? \"method\" : \"constructor\";\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/PureAttributeOnVoidMethod.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class PureAttributeOnVoidMethod : PureAttributeOnVoidMethodBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/RedundantExitSelect.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class RedundantExitSelect : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S2951\";\n        private const string MessageFormat = \"Remove this redundant use of 'Exit Select'.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var exit = (ExitStatementSyntax)c.Node;\n                    if (!(exit.Parent is CaseBlockSyntax caseBlock))\n                    {\n                        return;\n                    }\n\n                    if (caseBlock.Statements.Last() == exit)\n                    {\n                        c.ReportIssue(rule, exit);\n                    }\n                },\n                SyntaxKind.ExitSelectStatement);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/RedundantNullCheck.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class RedundantNullCheck : RedundantNullCheckBase<BinaryExpressionSyntax>\n    {\n        private const string MessageFormat = \"Remove this unnecessary null check; 'TypeOf ... Is' returns false for nulls.\";\n\n        private static readonly DiagnosticDescriptor rule =\n           DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                CheckAndExpression,\n                SyntaxKind.AndExpression,\n                SyntaxKind.AndAlsoExpression);\n\n            context.RegisterNodeAction(\n                CheckOrExpression,\n                SyntaxKind.OrExpression,\n                SyntaxKind.OrElseExpression);\n        }\n\n        protected override SyntaxNode GetLeftNode(BinaryExpressionSyntax binaryExpression) => binaryExpression.Left.RemoveParentheses();\n\n        protected override SyntaxNode GetRightNode(BinaryExpressionSyntax binaryExpression) => binaryExpression.Right.RemoveParentheses();\n\n        protected override SyntaxNode GetNullCheckVariable(SyntaxNode node)\n        {\n            if (RemoveParentheses(node) is BinaryExpressionSyntax binaryExpression\n               && binaryExpression.IsKind(SyntaxKind.IsExpression)\n               && GetRightNode(binaryExpression).IsKind(SyntaxKind.NothingLiteralExpression))\n            {\n                return GetLeftNode(binaryExpression);\n            }\n            return null;\n        }\n\n        protected override SyntaxNode GetNonNullCheckVariable(SyntaxNode node)\n        {\n            var innerExpression = RemoveParentheses(node);\n            if (innerExpression is BinaryExpressionSyntax binaryExpression\n               && binaryExpression.IsKind(SyntaxKind.IsNotExpression)\n               && GetRightNode(binaryExpression).IsKind(SyntaxKind.NothingLiteralExpression))\n            {\n                return GetLeftNode(binaryExpression);\n            }\n            else if (innerExpression is UnaryExpressionSyntax prefixUnary && prefixUnary.IsKind(SyntaxKind.NotExpression))\n            {\n                return GetNullCheckVariable(prefixUnary.Operand);\n            }\n            return null;\n        }\n\n        protected override SyntaxNode GetIsOperatorCheckVariable(SyntaxNode node)\n        {\n            if (RemoveParentheses(node) is TypeOfExpressionSyntax typeOfExpression && typeOfExpression.OperatorToken.IsKind(SyntaxKind.IsKeyword))\n            {\n                return typeOfExpression.Expression.RemoveParentheses();\n            }\n            return null;\n        }\n\n        protected override SyntaxNode GetInvertedIsOperatorCheckVariable(SyntaxNode node)\n        {\n            var innerExpression = RemoveParentheses(node);\n            if (innerExpression is UnaryExpressionSyntax prefixUnary && prefixUnary.IsKind(SyntaxKind.NotExpression))\n            {\n                return GetIsOperatorCheckVariable(prefixUnary.Operand);\n            }\n            else if (innerExpression is TypeOfExpressionSyntax typeOfExpression && typeOfExpression.OperatorToken.IsKind(SyntaxKind.IsNotKeyword))\n            {\n                return typeOfExpression.Expression.RemoveParentheses();\n            }\n            return null;\n        }\n\n        protected override bool AreEquivalent(SyntaxNode node1, SyntaxNode node2) => VisualBasicEquivalenceChecker.AreEquivalent(node1, node2);\n\n        private SyntaxNode RemoveParentheses(SyntaxNode syntaxNode) => syntaxNode.RemoveParentheses();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/RedundantParentheses.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class RedundantParentheses : RedundantParenthesesBase<ParenthesizedExpressionSyntax, SyntaxKind>\n    {\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(rule);\n\n        protected override GeneratedCodeRecognizer GeneratedCodeRecognizer => VisualBasicGeneratedCodeRecognizer.Instance;\n        protected override SyntaxKind ParenthesizedExpressionSyntaxKind { get; } = SyntaxKind.ParenthesizedExpression;\n\n        protected override SyntaxNode GetExpression(ParenthesizedExpressionSyntax parenthesizedExpression) =>\n            parenthesizedExpression.Expression;\n        protected override SyntaxToken GetOpenParenToken(ParenthesizedExpressionSyntax parenthesizedExpression) =>\n            parenthesizedExpression.OpenParenToken;\n        protected override SyntaxToken GetCloseParenToken(ParenthesizedExpressionSyntax parenthesizedExpression) =>\n            parenthesizedExpression.CloseParenToken;\n    }\n}\n\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/RegularExpressions/RegexMustHaveValidSyntax.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class RegexMustHaveValidSyntax : RegexMustHaveValidSyntaxBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/ReversedOperators.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class ReversedOperators : ReversedOperatorsBase<UnaryExpressionSyntax>\n    {\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n               GetAnalysisAction(Rule),\n               // As opposed to C#, the VB operators for negation ('Not') and inequality ('<>') leave no room for confusion\n               SyntaxKind.UnaryMinusExpression,\n               SyntaxKind.UnaryPlusExpression);\n\n        protected override SyntaxToken GetOperatorToken(UnaryExpressionSyntax e) => e.OperatorToken;\n\n        protected override bool IsEqualsToken(SyntaxToken token) => token.IsKind(SyntaxKind.EqualsToken);\n\n        protected override bool IsMinusToken(SyntaxToken token) => token.IsKind(SyntaxKind.MinusToken);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/SecurityPInvokeMethodShouldNotBeCalled.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class SecurityPInvokeMethodShouldNotBeCalled : SecurityPInvokeMethodShouldNotBeCalledBase<SyntaxKind, InvocationExpressionSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n        protected override bool IsImportFromInteropDll(IMethodSymbol symbol, SemanticModel semanticModel) =>\n            base.IsImportFromInteropDll(symbol, semanticModel)\n            || (symbol.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax() is DeclareStatementSyntax declaration\n                && IsInterop(declaration.LibraryName?.StringValue(semanticModel)));\n\n        protected override string GetMethodName(ISymbol symbol, SemanticModel semanticModel) =>\n            symbol.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax() is DeclareStatementSyntax declaration\n            && declaration.AliasName != null\n                ? declaration.AliasName.StringValue(semanticModel)\n                : symbol.Name;\n\n        protected override IMethodSymbol MethodSymbolForInvalidInvocation(SyntaxNode syntaxNode, SemanticModel semanticModel) =>\n            semanticModel.GetSymbolInfo(syntaxNode).Symbol is IMethodSymbol methodSymbol\n            && GetMethodName(methodSymbol, semanticModel) is var methodName\n            && InvalidMethods.Any(x => methodName.Equals(x, StringComparison.OrdinalIgnoreCase))\n                ? methodSymbol\n                : null;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/SelfAssignment.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class SelfAssignment : SelfAssignmentBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var expression = (AssignmentStatementSyntax) c.Node;\n                    if (VisualBasicEquivalenceChecker.AreEquivalent(expression.Left, expression.Right))\n                    {\n                        c.ReportIssue(Rule, c.Node);\n                    }\n                },\n                SyntaxKind.SimpleAssignmentStatement);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/SetPropertiesInsteadOfMethods.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class SetPropertiesInsteadOfMethods : SetPropertiesInsteadOfMethodsBase<SyntaxKind, InvocationExpressionSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override bool HasCorrectArgumentCount(InvocationExpressionSyntax invocation) =>\n        invocation.HasExactlyNArguments(1);\n\n    // In VB you need to be explicit: Enumerable.Min(set), because set.Min() resolves to the property.\n    protected override bool TryGetOperands(InvocationExpressionSyntax invocation, out SyntaxNode typeNode, out SyntaxNode methodNode)\n    {\n        typeNode = invocation.ArgumentList.Arguments[0].GetExpression();\n        methodNode = invocation;\n        return true;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/ShiftDynamicNotInteger.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class ShiftDynamicNotInteger : ShiftDynamicNotIntegerBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override bool ShouldRaise(SemanticModel model, SyntaxNode left, SyntaxNode right) =>\n        IsObject(left, model) || !IsConvertibleToInt(right, model);\n\n    protected override bool CanBeConvertedTo(SyntaxNode expression, ITypeSymbol type, SemanticModel model) =>\n        expression.IsKind(SyntaxKind.NothingLiteralExpression) // x >> Nothing will not throw, so ignore\n        || model.GetTypeInfo(expression).Type.IsAny(KnownType.IntegralNumbers);\n\n    private static bool IsObject(SyntaxNode expression, SemanticModel model) =>\n        model.GetTypeInfo(expression).Type is { } type\n        && type.Is(KnownType.System_Object);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/ShouldImplementExportedInterfaces.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class ShouldImplementExportedInterfaces : ShouldImplementExportedInterfacesBase<ArgumentSyntax, AttributeSyntax, SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n        protected override SeparatedSyntaxList<ArgumentSyntax>? GetAttributeArguments(AttributeSyntax attributeSyntax) =>\n            attributeSyntax.ArgumentList?.Arguments;\n\n        protected override SyntaxNode GetAttributeName(AttributeSyntax attributeSyntax) =>\n            attributeSyntax.Name;\n\n        protected override bool IsClassOrRecordSyntax(SyntaxNode syntaxNode) =>\n            syntaxNode.IsKind(SyntaxKind.ClassStatement);\n\n        protected override SyntaxNode GetTypeOfOrGetTypeExpression(SyntaxNode expressionSyntax) =>\n            (expressionSyntax as GetTypeExpressionSyntax)?.Type;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/SimpleDoLoop.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class SimpleDoLoop : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S2340\";\n        private const string MessageFormat = \"Use a structured loop instead.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var doBlock = (DoLoopBlockSyntax)c.Node;\n                    c.ReportIssue(rule, doBlock.DoStatement.DoKeyword);\n                },\n                SyntaxKind.SimpleDoLoopBlock);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/SingleStatementPerLine.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class SingleStatementPerLine : SingleStatementPerLineBase<SyntaxKind, StatementSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n        protected override GeneratedCodeRecognizer GeneratedCodeRecognizer => VisualBasicGeneratedCodeRecognizer.Instance;\n\n        protected override bool StatementShouldBeExcluded(StatementSyntax statement) =>\n            StatementIsBlock(statement) || StatementIsSingleInLambda(statement);\n\n        private static bool StatementIsSingleInLambda(StatementSyntax st) =>\n            !st.DescendantNodes().OfType<StatementSyntax>().Any()\n            && st.Parent is MultiLineLambdaExpressionSyntax multiline\n            && multiline.Statements.Count == 1;\n\n        private static bool StatementIsBlock(StatementSyntax st) =>\n            st is NamespaceBlockSyntax\n            or TypeBlockSyntax\n            or EnumBlockSyntax\n            or MethodBlockBaseSyntax\n            or PropertyBlockSyntax\n            or EventBlockSyntax\n            or DoLoopBlockSyntax\n            or WhileBlockSyntax\n            or ForOrForEachBlockSyntax\n            or MultiLineIfBlockSyntax\n            or ElseStatementSyntax\n            or SyncLockBlockSyntax\n            or TryBlockSyntax\n            or UsingBlockSyntax\n            or WithBlockSyntax\n            or MethodBaseSyntax\n            or InheritsOrImplementsStatementSyntax\n            or SelectBlockSyntax;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/StringConcatenationInLoop.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class StringConcatenationInLoop : StringConcatenationInLoopBase<SyntaxKind, AssignmentStatementSyntax, BinaryExpressionSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override SyntaxKind[] CompoundAssignmentKinds { get; } = [SyntaxKind.AddAssignmentStatement, SyntaxKind.ConcatenateAssignmentStatement];\n\n    protected override ISet<SyntaxKind> ExpressionConcatenationKinds { get; } = new HashSet<SyntaxKind>\n    {\n        SyntaxKind.AddExpression,\n        SyntaxKind.ConcatenateExpression\n    };\n\n    protected override ISet<SyntaxKind> LoopKinds { get; } = new HashSet<SyntaxKind>\n    {\n        SyntaxKind.WhileBlock,\n        SyntaxKind.SimpleDoLoopBlock,\n        SyntaxKind.ForBlock,\n        SyntaxKind.ForEachBlock,\n        SyntaxKind.DoUntilLoopBlock,\n        SyntaxKind.DoWhileLoopBlock,\n        SyntaxKind.DoLoopUntilBlock,\n        SyntaxKind.DoLoopWhileBlock\n    };\n\n    protected override SyntaxNode LeftMostExpression(SyntaxNode expression) =>\n        expression is InvocationExpressionSyntax\n            ? null\n            : ((ExpressionSyntax)expression).LeftMostInMemberAccess;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/StringConcatenationWithPlus.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class StringConcatenationWithPlus : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S1645\";\n        private const string MessageFormat = \"Switch this use of the '+' operator to the '&'.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var binary = (BinaryExpressionSyntax)c.Node;\n                    var leftType = c.Model.GetTypeInfo(binary.Left).Type;\n                    if (leftType.Is(KnownType.System_String)\n                        // If op_Addition exist, there's areason for it => don't raise. We don't care about type of op_Addition arguments, they match because it compiles.\n                        || (leftType.GetMembers(\"op_Addition\").IsEmpty && c.Model.GetTypeInfo(binary.Right).Type.Is(KnownType.System_String)))\n                    {\n                        c.ReportIssue(Rule, binary.OperatorToken);\n                    }\n                },\n                SyntaxKind.AddExpression);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/StringConcatenationWithPlusCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.VisualBasic)]\n    public sealed class StringConcatenationWithPlusCodeFix : SonarCodeFix\n    {\n        internal const string Title = \"Change to '&'\";\n\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(StringConcatenationWithPlus.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            var diagnostic = context.Diagnostics.First();\n            var diagnosticSpan = diagnostic.Location.SourceSpan;\n\n            if (root.FindNode(diagnosticSpan, getInnermostNodeForTie: true) is BinaryExpressionSyntax binary)\n            {\n                context.RegisterCodeFix(\n                    Title,\n                    c =>\n                    {\n                        var newRoot = CalculateNewRoot(root, binary);\n                        return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n                    },\n                    context.Diagnostics);\n            }\n\n            return Task.CompletedTask;\n        }\n\n        private static SyntaxNode CalculateNewRoot(SyntaxNode root, BinaryExpressionSyntax currentAsBinary)\n        {\n            return root.ReplaceNode(currentAsBinary,\n                SyntaxFactory.ConcatenateExpression(\n                    currentAsBinary.Left,\n                    SyntaxFactory.Token(SyntaxKind.AmpersandToken).WithTriviaFrom(currentAsBinary.OperatorToken),\n                    currentAsBinary.Right));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/StringLiteralShouldNotBeDuplicated.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class StringLiteralShouldNotBeDuplicated : StringLiteralShouldNotBeDuplicatedBase<SyntaxKind, LiteralExpressionSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n        protected override SyntaxKind[] SyntaxKinds { get; } =\n        {\n            SyntaxKind.ClassBlock,\n            SyntaxKind.StructureBlock\n        };\n\n        protected override bool IsMatchingMethodParameterName(LiteralExpressionSyntax literalExpression) =>\n            literalExpression.FirstAncestorOrSelf<MethodBlockBaseSyntax>()\n                ?.BlockStatement?.ParameterList\n                ?.Parameters\n                .Any(p => p.Identifier.Identifier.ValueText.Equals(literalExpression.Token.ValueText, StringComparison.OrdinalIgnoreCase))\n                ?? false;\n\n        protected override bool IsInnerInstance(SonarSyntaxNodeReportingContext context) =>\n            context.Node.HasAncestor(SyntaxKind.ClassBlock, SyntaxKind.StructureBlock);\n\n        protected override IEnumerable<LiteralExpressionSyntax> FindLiteralExpressions(SyntaxNode node) =>\n            node.DescendantNodes(n => !n.IsKind(SyntaxKind.AttributeList))\n                .Where(les => les.IsKind(SyntaxKind.StringLiteralExpression))\n                .Cast<LiteralExpressionSyntax>();\n\n        protected override SyntaxToken LiteralToken(LiteralExpressionSyntax literal) =>\n            literal.Token;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/SwitchCasesMinimumThree.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class SwitchCasesMinimumThree : SwitchCasesMinimumThreeBase\n    {\n        private const string MessageFormat = \"Replace this 'Select' statement with 'If' statements to increase readability.\";\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var selectNode = (SelectBlockSyntax)c.Node;\n                    if (!HasAtLeastThreeLabels(selectNode))\n                    {\n                        c.ReportIssue(rule, selectNode.SelectStatement.SelectKeyword);\n                    }\n                },\n                SyntaxKind.SelectBlock);\n        }\n\n        private static bool HasAtLeastThreeLabels(SelectBlockSyntax node) =>\n            node.CaseBlocks.Sum(caseBlock => caseBlock.CaseStatement.Cases.Count) >= 3;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/SwitchSectionShouldNotHaveTooManyStatements.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class SwitchSectionShouldNotHaveTooManyStatements : SwitchSectionShouldNotHaveTooManyStatementsBase\n    {\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat,\n                isEnabledByDefault: false);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarParametrizedAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var caseBlock = (CaseBlockSyntax)c.Node;\n\n                    if (caseBlock.IsMissing)\n                    {\n                        return;\n                    }\n\n                    var statementsCount = caseBlock.Statements.SelectMany(GetInnerStatements).Count();\n                    if (statementsCount > Threshold)\n                    {\n                        c.ReportIssue(rule, caseBlock.CaseStatement,\n                            \"'Case' block\", statementsCount.ToString(), Threshold.ToString(), \"procedure\");\n                    }\n                },\n                SyntaxKind.CaseBlock,\n                SyntaxKind.CaseElseBlock);\n        }\n\n        private IEnumerable<StatementSyntax> GetInnerStatements(StatementSyntax statement)\n        {\n            return statement.DescendantNodesAndSelf()\n                .OfType<StatementSyntax>()\n                .Where(s => !IsExcludedFromCount(s));\n\n            bool IsExcludedFromCount(StatementSyntax s)\n            {\n                switch (s.Kind())\n                {\n                    // Blocks are excluded because they contain statements (duplicating the interesting part)\n                    case SyntaxKind.CatchBlock:\n                    case SyntaxKind.DoLoopUntilBlock:\n                    case SyntaxKind.DoLoopWhileBlock:\n                    case SyntaxKind.DoUntilLoopBlock:\n                    case SyntaxKind.DoWhileLoopBlock:\n                    case SyntaxKind.ElseBlock:\n                    case SyntaxKind.ElseIfBlock:\n                    case SyntaxKind.FinallyBlock:\n                    case SyntaxKind.ForBlock:\n                    case SyntaxKind.ForEachBlock:\n                    case SyntaxKind.MultiLineIfBlock:\n                    case SyntaxKind.SelectBlock:\n                    case SyntaxKind.SimpleDoLoopBlock:\n                    case SyntaxKind.SyncLockBlock:\n                    case SyntaxKind.TryBlock:\n                    case SyntaxKind.UsingBlock:\n                    case SyntaxKind.WhileBlock:\n                    case SyntaxKind.WithBlock:\n\n                    // Don't count End statements\n                    case SyntaxKind.EndIfStatement:\n                    case SyntaxKind.EndSelectStatement:\n                    case SyntaxKind.EndSyncLockStatement:\n                    case SyntaxKind.EndTryStatement:\n                    case SyntaxKind.EndUsingStatement:\n                    case SyntaxKind.EndWhileStatement:\n                    case SyntaxKind.EndWithStatement:\n\n                    // Don't count the Do from Do...While and Do...Until\n                    case SyntaxKind.SimpleDoStatement:\n\n                    // Don't count the Next from For...Next\n                    case SyntaxKind.NextStatement:\n\n                    // Don't count single line if statements\n                    // We will count the next statement on the line anyway\n                    // Example:\n                    // If foo Then bar = 2\n                    case SyntaxKind.SingleLineIfStatement:\n                        return true;\n\n                    default:\n                        return false;\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/SwitchShouldNotBeNested.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class SwitchShouldNotBeNested : SwitchShouldNotBeNestedBase\n    {\n        private const string MessageFormat = \"Refactor the code to eliminate this nested 'Select Case'.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var selectBlock = (SelectBlockSyntax)c.Node;\n                    if (selectBlock.Parent?.FirstAncestorOrSelf<SelectBlockSyntax>() != null)\n                    {\n                        c.ReportIssue(rule, selectBlock.SelectStatement);\n                    }\n                },\n                SyntaxKind.SelectBlock);\n        }\n\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/SwitchWithoutDefault.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class SwitchWithoutDefault : SwitchWithoutDefaultBase<SyntaxKind>\n    {\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        private static readonly ImmutableArray<SyntaxKind> kindsOfInterest = ImmutableArray.Create(SyntaxKind.SelectBlock);\n        public override ImmutableArray<SyntaxKind> SyntaxKindsOfInterest => kindsOfInterest;\n\n        protected override bool TryGetDiagnostic(SyntaxNode node, out Diagnostic diagnostic)\n        {\n            diagnostic = null;\n            var switchNode = (SelectBlockSyntax)node;\n            if (!HasDefaultLabel(switchNode))\n            {\n                diagnostic = Diagnostic.Create(rule, switchNode.SelectStatement.SelectKeyword.GetLocation(), \"Case Else\", \"Select\");\n                return true;\n            }\n\n            return false;\n        }\n\n        private static bool HasDefaultLabel(SelectBlockSyntax node)\n        {\n            return node.CaseBlocks.Any(SyntaxKind.CaseElseBlock);\n        }\n\n        protected override GeneratedCodeRecognizer GeneratedCodeRecognizer => VisualBasicGeneratedCodeRecognizer.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/TabCharacter.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class TabCharacter : TabCharacterBase\n    {\n        private const string DiagnosticId = \"S105\";\n        private const string MessageFormat = \"Replace all tab characters in this file by sequences of white-spaces.\";\n\n        internal static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override GeneratedCodeRecognizer GeneratedCodeRecognizer => VisualBasicGeneratedCodeRecognizer.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/TestsShouldNotUseThreadSleep.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class TestsShouldNotUseThreadSleep : TestsShouldNotUseThreadSleepBase<MethodBlockSyntax, SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override SyntaxNode MethodDeclaration(MethodBlockSyntax method) => method.SubOrFunctionStatement;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/ThreadResumeOrSuspendShouldNotBeCalled.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class ThreadResumeOrSuspendShouldNotBeCalled : ThreadResumeOrSuspendShouldNotBeCalledBase<SyntaxKind, InvocationExpressionSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/ThrowReservedExceptions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class ThrowReservedExceptions : ThrowReservedExceptionsBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c => Process(c, ((ThrowStatementSyntax)c.Node).Expression), SyntaxKind.ThrowStatement);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/ToStringShouldNotReturnNull.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class ToStringShouldNotReturnNull : ToStringShouldNotReturnNullBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override SyntaxKind MethodKind => SyntaxKind.FunctionBlock;\n\n    protected override IEnumerable<SyntaxNode> Conditionals(SyntaxNode expression) =>\n        expression is TernaryConditionalExpressionSyntax conditional\n            ? new SyntaxNode[] { conditional.WhenTrue, conditional.WhenFalse }\n            : Array.Empty<SyntaxNode>();\n\n    protected override bool IsLocalOrLambda(SyntaxNode node) =>\n        node.IsKind(SyntaxKind.MultiLineFunctionLambdaExpression);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/TooManyLabelsInSwitch.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class TooManyLabelsInSwitch : TooManyLabelsInSwitchBase<SyntaxKind, SelectStatementSyntax>\n{\n    private static readonly ISet<SyntaxKind> IgnoredStatementsInSwitch = new HashSet<SyntaxKind> { SyntaxKind.ReturnStatement, SyntaxKind.ThrowStatement };\n\n    private static readonly ISet<SyntaxKind> TransparentSyntax = new HashSet<SyntaxKind>\n    {\n        SyntaxKind.CatchBlock,\n        SyntaxKind.CaseBlock,\n        SyntaxKind.DoWhileStatement,\n        SyntaxKind.DoLoopUntilBlock,\n        SyntaxKind.DoWhileLoopBlock,\n        SyntaxKind.DoLoopWhileBlock,\n        SyntaxKind.ElseIfBlock,\n        SyntaxKind.ElseIfStatement,\n        SyntaxKind.FinallyBlock,\n        SyntaxKind.FinallyStatement,\n        SyntaxKind.ForEachBlock,\n        SyntaxKind.ForEachStatement,\n        SyntaxKind.ForBlock,\n        SyntaxKind.ForStatement,\n        SyntaxKind.IfStatement,\n        SyntaxKind.MultiLineIfBlock,\n        SyntaxKind.SelectBlock,\n        SyntaxKind.SelectStatement,\n        SyntaxKind.SingleLineIfStatement,\n        SyntaxKind.SingleLineElseClause,\n        SyntaxKind.TryBlock,\n        SyntaxKind.TryStatement,\n        SyntaxKind.UsingBlock,\n        SyntaxKind.UsingStatement,\n        SyntaxKind.WhileBlock,\n        SyntaxKind.WhileStatement\n    };\n\n    protected override DiagnosticDescriptor Rule { get; } =\n        DescriptorFactory.Create(DiagnosticId, string.Format(MessageFormat, \"Select Case\", \"Case\"),\n            isEnabledByDefault: false);\n\n    protected override SyntaxKind[] SyntaxKinds { get; } = [SyntaxKind.SelectStatement];\n\n    protected override GeneratedCodeRecognizer GeneratedCodeRecognizer =>\n        VisualBasicGeneratedCodeRecognizer.Instance;\n\n    protected override SyntaxNode GetExpression(SelectStatementSyntax statement) =>\n        statement.Expression;\n\n    protected override int GetSectionsCount(SelectStatementSyntax statement) =>\n        ((SelectBlockSyntax)statement.Parent).CaseBlocks.Count;\n\n    protected override bool AllSectionsAreOneLiners(SelectStatementSyntax statement) =>\n        ((SelectBlockSyntax)statement.Parent).CaseBlocks.All(HasOneLine);\n\n    protected override Location GetKeywordLocation(SelectStatementSyntax statement) =>\n        statement.SelectKeyword.GetLocation();\n\n    private static bool HasOneLine(CaseBlockSyntax switchSection) =>\n        switchSection.Statements\n            .SelectMany(x => x.DescendantNodesAndSelf(descendIntoChildren: c => c.IsAnyKind(TransparentSyntax)))\n            .Count(x => !x.IsAnyKind(IgnoredStatementsInSwitch)) is 0 or 1;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/TooManyParameters.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class TooManyParameters : TooManyParametersBase<SyntaxKind, ParameterListSyntax>\n    {\n        private static readonly ImmutableDictionary<SyntaxKind, string> NodeToDeclarationName = new Dictionary<SyntaxKind, string>\n        {\n            { SyntaxKind.SubNewStatement, \"Constructor\" },\n            { SyntaxKind.FunctionStatement, \"Function\" },\n            { SyntaxKind.SubStatement, \"Sub\" },\n            { SyntaxKind.DelegateFunctionStatement, \"Delegate\" },\n            { SyntaxKind.DelegateSubStatement, \"Delegate\" },\n            { SyntaxKind.SubLambdaHeader, \"Lambda\" },\n            { SyntaxKind.FunctionLambdaHeader, \"Lambda\" },\n            { SyntaxKind.PropertyStatement, \"Property\" },\n            { SyntaxKind.EventStatement, \"Event\" },\n        }\n        .ToImmutableDictionary();\n\n        private static readonly SyntaxKind[] LambdaHeaders =\n            [\n                SyntaxKind.FunctionLambdaHeader,\n                SyntaxKind.SubLambdaHeader\n            ];\n\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n        protected override string UserFriendlyNameForNode(SyntaxNode node) =>\n            NodeToDeclarationName[node.Kind()];\n\n        protected override int CountParameters(ParameterListSyntax parameterList) =>\n            parameterList.Parameters.Count;\n\n        protected override bool CanBeChanged(SyntaxNode node, SemanticModel semanticModel) =>\n            node.IsAnyKind(LambdaHeaders)\n            || (NodeToDeclarationName.ContainsKey(node.Kind()) && VerifyCanBeChangedBySymbol(node, semanticModel));\n\n        protected override int BaseParameterCount(SyntaxNode node) =>\n            node.Parent is ConstructorBlockSyntax constructorBlock\n            && constructorBlock.SubNewStatement.ParameterList?.Parameters.Count > Maximum   // Performance optimization\n                ? constructorBlock.Statements.Select(x => MyBaseNewParameterCount(x)).SingleOrDefault(x => x > 0)\n                : 0;\n\n        private static int MyBaseNewParameterCount(StatementSyntax statement) =>\n            statement is ExpressionStatementSyntax expression\n            && expression.Expression is InvocationExpressionSyntax invocation\n            && invocation.Expression is MemberAccessExpressionSyntax memberAccess\n            && memberAccess.Expression is MyBaseExpressionSyntax\n            && memberAccess.Name.Identifier.Text.Equals(\"New\", System.StringComparison.OrdinalIgnoreCase)\n            ? invocation.ArgumentList.Arguments.Count\n            : 0;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/UnaryPrefixOperatorRepeated.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class UnaryPrefixOperatorRepeated :\n        UnaryPrefixOperatorRepeatedBase<SyntaxKind, UnaryExpressionSyntax>\n    {\n        protected override ISet<SyntaxKind> SyntaxKinds { get; } = new HashSet<SyntaxKind>\n        {\n            SyntaxKind.NotExpression\n        };\n\n        protected override DiagnosticDescriptor Rule { get; } =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        protected override GeneratedCodeRecognizer GeneratedCodeRecognizer { get; } =\n            VisualBasicGeneratedCodeRecognizer.Instance;\n\n        protected override SyntaxNode GetOperand(UnaryExpressionSyntax unarySyntax) =>\n             unarySyntax.Operand;\n\n        protected override SyntaxToken GetOperatorToken(UnaryExpressionSyntax unarySyntax) =>\n            unarySyntax.OperatorToken;\n\n        protected override bool SameOperators(UnaryExpressionSyntax expression1, UnaryExpressionSyntax expression2) =>\n            expression1.OperatorToken.IsKind(expression2.OperatorToken.Kind());\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/UnconditionalJumpStatement.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class UnconditionalJumpStatement : UnconditionalJumpStatementBase<StatementSyntax, SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n        protected override ISet<SyntaxKind> LoopStatements { get; } = new HashSet<SyntaxKind>\n        {\n            SyntaxKind.ForBlock,\n            SyntaxKind.ForEachBlock,\n            SyntaxKind.WhileBlock,\n            SyntaxKind.DoLoopWhileBlock,\n            SyntaxKind.DoLoopUntilBlock,\n            SyntaxKind.SimpleDoLoopBlock\n        };\n\n        protected override LoopWalkerBase<StatementSyntax, SyntaxKind> GetWalker(SonarSyntaxNodeReportingContext context)\n            => new LoopWalker(context, LoopStatements);\n\n        private class LoopWalker : LoopWalkerBase<StatementSyntax, SyntaxKind>\n        {\n            protected override ISet<SyntaxKind> StatementsThatCanThrow { get; } = new HashSet<SyntaxKind>\n            {\n                SyntaxKind.InvocationExpression,\n                SyntaxKind.ObjectCreationExpression,\n                SyntaxKind.SimpleMemberAccessExpression\n            };\n\n            protected override ISet<SyntaxKind> LambdaSyntaxes { get; } = new HashSet<SyntaxKind>\n                {\n                    SyntaxKind.FunctionLambdaHeader,\n                    SyntaxKind.MultiLineFunctionLambdaExpression,\n                    SyntaxKind.MultiLineSubLambdaExpression,\n                    SyntaxKind.SingleLineFunctionLambdaExpression,\n                    SyntaxKind.SingleLineSubLambdaExpression,\n                    SyntaxKind.SubLambdaHeader\n                };\n\n            protected override ISet<SyntaxKind> LocalFunctionSyntaxes { get; } = new HashSet<SyntaxKind>();\n\n            protected override ISet<SyntaxKind> ConditionalStatements { get; } = new HashSet<SyntaxKind>\n            {\n                SyntaxKind.SingleLineIfStatement,\n                SyntaxKind.SingleLineIfPart,\n                SyntaxKind.MultiLineIfBlock,\n                SyntaxKind.CaseBlock,\n                SyntaxKind.CaseElseBlock,\n                SyntaxKind.CatchBlock\n            };\n\n            protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n            public LoopWalker(SonarSyntaxNodeReportingContext context, ISet<SyntaxKind> loopStatements) : base(context, loopStatements) { }\n\n            public override void Visit()\n            {\n                var vbWalker = new VbLoopwalker(this);\n                vbWalker.SafeVisit(rootExpression);\n            }\n\n            protected override bool IsPropertyAccess(StatementSyntax node) =>\n                node.DescendantNodes().OfType<IdentifierNameSyntax>().Any(x => semanticModel.GetSymbolInfo(x).Symbol is { } symbol && symbol.Kind == SymbolKind.Property);\n\n            protected override bool TryGetTryAncestorStatements(StatementSyntax node, List<SyntaxNode> ancestors, out IEnumerable<StatementSyntax> tryAncestorStatements)\n            {\n                var tryAncestor = (TryBlockSyntax)ancestors.FirstOrDefault(n => n.IsKind(SyntaxKind.TryBlock));\n\n                if (tryAncestor == null || tryAncestor.CatchBlocks.Count == 0)\n                {\n                    tryAncestorStatements = null;\n                    return false;\n                }\n\n                tryAncestorStatements = tryAncestor.Statements;\n                return true;\n            }\n\n            private class VbLoopwalker : SafeVisualBasicSyntaxWalker\n            {\n                private readonly LoopWalker walker;\n\n                public VbLoopwalker(LoopWalker loopWalker)\n                {\n                    walker = loopWalker;\n                }\n\n                public override void VisitContinueStatement(ContinueStatementSyntax node)\n                {\n                    base.VisitContinueStatement(node);\n                    walker.StoreVisitData(node, walker.ConditionalContinues, walker.UnconditionalContinues);\n                }\n\n                public override void VisitExitStatement(ExitStatementSyntax node)\n                {\n                    base.VisitExitStatement(node);\n                    walker.StoreVisitData(node, walker.ConditionalTerminates, walker.UnconditionalTerminates);\n                }\n\n                public override void VisitReturnStatement(ReturnStatementSyntax node)\n                {\n                    base.VisitReturnStatement(node);\n                    walker.StoreVisitData(node, walker.ConditionalTerminates, walker.UnconditionalTerminates);\n                }\n\n                public override void VisitThrowStatement(ThrowStatementSyntax node)\n                {\n                    base.VisitThrowStatement(node);\n                    walker.StoreVisitData(node, walker.ConditionalTerminates, walker.UnconditionalTerminates);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/UnnecessaryBitwiseOperation.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class UnnecessaryBitwiseOperation : UnnecessaryBitwiseOperationBase\n    {\n        protected override ILanguageFacade Language => VisualBasicFacade.Instance;\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c => CheckBinary(c, -1),\n                SyntaxKind.AndExpression);\n\n            context.RegisterNodeAction(\n                c => CheckBinary(c, 0),\n                SyntaxKind.OrExpression,\n                SyntaxKind.ExclusiveOrExpression);\n        }\n\n        private void CheckBinary(SonarSyntaxNodeReportingContext context, int constValueToLookFor)\n        {\n            var binary = (BinaryExpressionSyntax)context.Node;\n            CheckBinary(context, binary.Left, binary.OperatorToken, binary.Right, constValueToLookFor);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/UnnecessaryBitwiseOperationCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Formatting;\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.VisualBasic)]\n    public sealed class UnnecessaryBitwiseOperationCodeFix : UnnecessaryBitwiseOperationCodeFixBase\n    {\n        protected override Func<SyntaxNode> CreateNewRoot(SyntaxNode root, TextSpan diagnosticSpan, bool isReportingOnLeft)\n        {\n            if (root.FindNode(diagnosticSpan, getInnermostNodeForTie: true) is BinaryExpressionSyntax binary)\n            {\n                var newNode = isReportingOnLeft ? binary.Right : binary.Left;\n                return () => root.ReplaceNode(binary, newNode.WithTrailingTrivia(binary.GetTrailingTrivia()).WithAdditionalAnnotations(Formatter.Annotation));\n            }\n            else\n            {\n                return null;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/UnsignedTypesUsage.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class UnsignedTypesUsage : SonarDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S2374\";\n        private const string MessageFormat = \"Change this unsigned type to '{0}'.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    var typeSyntax = (TypeSyntax)c.Node;\n                    if (typeSyntax.Parent is QualifiedNameSyntax)\n                    {\n                        return;\n                    }\n\n                    var typeSymbol = c.Model.GetSymbolInfo(typeSyntax).Symbol as ITypeSymbol;\n                    if (typeSymbol.IsAny(KnownType.UnsignedIntegers))\n                    {\n                        c.ReportIssue(rule, typeSyntax, SignedPairs[typeSymbol.SpecialType]);\n                    }\n                },\n                SyntaxKind.PredefinedType,\n                SyntaxKind.IdentifierName,\n                SyntaxKind.QualifiedName);\n        }\n\n        private static readonly IDictionary<SpecialType, string> SignedPairs =\n            new Dictionary<SpecialType, string>\n            {\n                {SpecialType.System_UInt16, \"Short\"},\n                {SpecialType.System_UInt32, \"Integer\"},\n                {SpecialType.System_UInt64, \"Long\"}\n            };\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/UnusedStringBuilder.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class UnusedStringBuilder : UnusedStringBuilderBase<SyntaxKind, VariableDeclaratorSyntax, IdentifierNameSyntax>\n{\n    private static readonly HashSet<SyntaxKind> SkipChildren = [];\n\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override SyntaxNode Scope(VariableDeclaratorSyntax declarator) =>\n        declarator is { Parent: LocalDeclarationStatementSyntax { Parent: { } block } }\n            ? block\n            : null;\n\n    protected override ILocalSymbol RetrieveStringBuilderObject(SemanticModel model, VariableDeclaratorSyntax declarator) =>\n        declarator is\n        {\n            Parent: LocalDeclarationStatementSyntax,\n            Initializer.Value: ObjectCreationExpressionSyntax { } objectCreation,\n            Names: { Count: 1 } names, // Must be 1, because otherwise \"BC30671: Explicit initialization is not permitted with multiple variables declared with a single type specifier.\" is raised.\n        }\n        && objectCreation.Type.IsKnownType(KnownType.System_Text_StringBuilder, model)\n            ? model.GetDeclaredSymbol(names[0]) as ILocalSymbol\n            : null;\n\n    protected override SyntaxNode StringBuilderReadExpression(SemanticModel model, SyntaxNode node) =>\n        node switch\n        {\n            InvocationExpressionSyntax invocation when\n                IsAccessInvocation(invocation.GetName()) || model.GetSymbolInfo(invocation).Symbol is IPropertySymbol { IsIndexer: true } => invocation.Expression,\n            ReturnStatementSyntax returnStatement => returnStatement.Expression,\n            InterpolationSyntax interpolation => interpolation.Expression,\n            ArgumentSyntax argument => argument.GetExpression(),\n            MemberAccessExpressionSyntax memberAccess when IsAccessExpression(memberAccess.Name.GetName()) => memberAccess.Expression,\n            VariableDeclaratorSyntax { Initializer.Value: IdentifierNameSyntax identifier } => identifier,\n            AssignmentStatementSyntax { Right: IdentifierNameSyntax identifier } => identifier,\n            _ => null,\n        };\n\n    protected override bool DescendIntoChildren(SyntaxNode node) =>\n        !node.IsAnyKind(SkipChildren);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/UriShouldNotBeHardcoded.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class UriShouldNotBeHardcoded : UriShouldNotBeHardcodedBase<SyntaxKind, LiteralExpressionSyntax, ArgumentSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n    protected override GeneratedCodeRecognizer GeneratedCodeRecognizer => VisualBasicGeneratedCodeRecognizer.Instance;\n    protected override SyntaxKind[] StringConcatenateExpressions => [SyntaxKind.AddExpression, SyntaxKind.ConcatenateExpression];\n    protected override SyntaxKind[] InvocationOrObjectCreationKind => [SyntaxKind.InvocationExpression, SyntaxKind.ObjectCreationExpression];\n\n    protected override SyntaxNode GetRelevantAncestor(SyntaxNode node) =>\n        (SyntaxNode)node.FirstAncestorOrSelf<ParameterSyntax>() ?? node.FirstAncestorOrSelf<VariableDeclaratorSyntax>();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/UseCharOverloadOfStringMethods.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class UseCharOverloadOfStringMethods : UseCharOverloadOfStringMethodsBase<SyntaxKind, InvocationExpressionSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override bool HasCorrectArguments(InvocationExpressionSyntax invocation) =>\n        invocation.HasExactlyNArguments(1)\n        && invocation.ArgumentList.Arguments[0].GetExpression() is { } literal\n        && literal.IsKind(SyntaxKind.StringLiteralExpression)\n        && ((LiteralExpressionSyntax)literal).Token.ValueText.Length == 1;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/UseDateTimeOffsetInsteadOfDateTime.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class UseDateTimeOffsetInsteadOfDateTime : UseDateTimeOffsetInsteadOfDateTimeBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override string[] ValidNames { get; } = new[] { \"DateTime\", \"Date\" };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/UseFindSystemTimeZoneById.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class UseFindSystemTimeZoneById : UseFindSystemTimeZoneByIdBase<SyntaxKind, InvocationExpressionSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/UseIFormatProviderForParsingDateAndTime.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class UseIFormatProviderForParsingDateAndTime : UseIFormatProviderForParsingDateAndTimeBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/UseIndexingInsteadOfLinqMethods.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class UseIndexingInsteadOfLinqMethods : UseIndexingInsteadOfLinqMethodsBase<SyntaxKind, InvocationExpressionSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override int GetArgumentCount(InvocationExpressionSyntax invocation) =>\n        invocation.ArgumentList.Arguments.Count;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/UseLambdaParameterInConcurrentDictionary.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class UseLambdaParameterInConcurrentDictionary : UseLambdaParameterInConcurrentDictionaryBase<SyntaxKind, InvocationExpressionSyntax, ArgumentSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override SeparatedSyntaxList<ArgumentSyntax> GetArguments(InvocationExpressionSyntax invocation) =>\n         invocation.ArgumentList.Arguments;\n\n    protected override bool IsLambdaAndContainsIdentifier(ArgumentSyntax argument, string keyName) =>\n        argument.GetExpression() is SingleLineLambdaExpressionSyntax lambda\n        && lambda.Body.DescendantNodesAndSelf().OfType<IdentifierNameSyntax>().Any(p => p.GetName().Equals(keyName) && p.Parent is not NameOfExpressionSyntax);\n\n    protected override bool TryGetKeyName(ArgumentSyntax argument, out string keyName)\n    {\n        keyName = string.Empty;\n        if (argument.GetExpression() is IdentifierNameSyntax identifier)\n        {\n            keyName = identifier.GetName();\n            return true;\n        }\n        return false;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/UseReturnStatement.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class UseReturnStatement : SonarDiagnosticAnalyzer\n    {\n        private const string DiagnosticId = \"S5944\";\n        private const string MessageFormat = \"{0}\";\n        private const string UseReturnStatementMessage = \"Use a 'Return' statement; assigning returned values to function names is obsolete.\";\n        private const string DontUseImplicitMessage = \"Do not make use of the implicit return value.\";\n\n        private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(c =>\n            {\n                var method = (MethodStatementSyntax)((MethodBlockSyntax)c.Node).BlockStatement;\n                new IdentifierWalker(c, method.Identifier.ValueText).SafeVisit(c.Node);\n            },\n            SyntaxKind.FunctionBlock);\n\n        private class IdentifierWalker : SafeVisualBasicSyntaxWalker\n        {\n            private readonly SonarSyntaxNodeReportingContext context;\n            private readonly string name;\n\n            public IdentifierWalker(SonarSyntaxNodeReportingContext context, string name)\n            {\n                this.context = context;\n                this.name = name;\n            }\n\n            public override void VisitIdentifierName(IdentifierNameSyntax node)\n            {\n                if (IsImplicitReturnValue(node))\n                {\n                    context.ReportIssue(Rule, node, IsAssignmentStatement(node) ? UseReturnStatementMessage : DontUseImplicitMessage);\n                }\n            }\n\n            public override void VisitImplementsClause(ImplementsClauseSyntax node) { /* Skip */ }\n\n            public override void VisitAttributeList(AttributeListSyntax node) { /* Skip */ }\n\n            private bool IsImplicitReturnValue(IdentifierNameSyntax node) =>\n                name.Equals(node.Identifier.ValueText, StringComparison.InvariantCultureIgnoreCase)\n                && !IsExcluded(node);\n\n            private static bool IsExcluded(SyntaxNode node) =>\n                node.Parent switch\n                {\n                    InvocationExpressionSyntax => true,\n                    MemberAccessExpressionSyntax => true,\n                    QualifiedNameSyntax => true,\n                    NamedFieldInitializerSyntax => true,\n                    NameOfExpressionSyntax => true,\n                    AsClauseSyntax => true,\n                    ObjectCreationExpressionSyntax => true,\n                    TypeArgumentListSyntax => true,\n                    UnaryExpressionSyntax unary => unary.IsKind(SyntaxKind.AddressOfExpression),\n                    NameColonEqualsSyntax nameColon => nameColon.Name == node,\n                    _ => false,\n                };\n\n            private static bool IsAssignmentStatement(SyntaxNode node) =>\n                node.Parent is AssignmentStatementSyntax assignement\n                && assignement.Left == node;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/UseShortCircuitingOperator.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class UseShortCircuitingOperator : UseShortCircuitingOperatorBase<SyntaxKind, BinaryExpressionSyntax>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n        protected override string GetSuggestedOpName(BinaryExpressionSyntax node) =>\n            OperatorNames[ShortCircuitingAlternative[node.Kind()]];\n\n        protected override string GetCurrentOpName(BinaryExpressionSyntax node) =>\n            OperatorNames[node.Kind()];\n\n        protected override SyntaxToken GetOperator(BinaryExpressionSyntax expression) =>\n            expression.OperatorToken;\n\n        internal static readonly IDictionary<SyntaxKind, SyntaxKind> ShortCircuitingAlternative = new Dictionary<SyntaxKind, SyntaxKind>\n        {\n            { SyntaxKind.AndExpression, SyntaxKind.AndAlsoExpression },\n            { SyntaxKind.OrExpression, SyntaxKind.OrElseExpression }\n        }.ToImmutableDictionary();\n\n        private static readonly IDictionary<SyntaxKind, string> OperatorNames = new Dictionary<SyntaxKind, string>\n        {\n            { SyntaxKind.AndExpression, \"And\" },\n            { SyntaxKind.OrExpression, \"Or\" },\n            { SyntaxKind.AndAlsoExpression, \"AndAlso\" },\n            { SyntaxKind.OrElseExpression, \"OrElse\" },\n        }.ToImmutableDictionary();\n\n        protected override ImmutableArray<SyntaxKind> SyntaxKindsOfInterest => ImmutableArray.Create<SyntaxKind>(\n            SyntaxKind.AndExpression,\n            SyntaxKind.OrExpression);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/UseShortCircuitingOperatorCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.VisualBasic)]\n    public sealed class UseShortCircuitingOperatorCodeFix : UseShortCircuitingOperatorCodeFixBase<SyntaxKind, BinaryExpressionSyntax>\n    {\n        internal override bool IsCandidateExpression(BinaryExpressionSyntax expression)\n        {\n            return UseShortCircuitingOperator.ShortCircuitingAlternative.ContainsKey(expression.Kind());\n        }\n\n        protected override BinaryExpressionSyntax GetShortCircuitingExpressionNode(BinaryExpressionSyntax expression)\n        {\n            return expression.IsKind(SyntaxKind.AndExpression)\n                ? SyntaxFactory.AndAlsoExpression(expression.Left, expression.Right)\n                : SyntaxFactory.OrElseExpression(expression.Left, expression.Right);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/UseTestableTimeProvider.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class UseTestableTimeProvider : UseTestableTimeProviderBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override bool Ignore(SyntaxNode ancestor, SemanticModel semanticModel) =>\n        ancestor.IsAnyKind(SyntaxKind.NameOfKeyword, SyntaxKind.XmlCrefAttribute);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/UseTrueForAll.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class UseTrueForAll : UseTrueForAllBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/UseUnixEpoch.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class UseUnixEpoch : UseUnixEpochBase<SyntaxKind, LiteralExpressionSyntax, MemberAccessExpressionSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override bool IsDateTimeKindUtc(MemberAccessExpressionSyntax memberAccess) =>\n        memberAccess.NameIs(\"Utc\") && memberAccess.Expression.NameIs(\"DateTimeKind\");\n\n    protected override bool IsGregorianCalendar(SyntaxNode node) =>\n        node is ObjectCreationExpressionSyntax objectCreation && objectCreation.Type.NameIs(\"GregorianCalendar\");\n\n    protected override bool IsZeroTimeOffset(SyntaxNode node) =>\n        node switch\n        {\n            MemberAccessExpressionSyntax memberAccess => memberAccess.NameIs(\"Zero\") && memberAccess.Expression.NameIs(\"TimeSpan\"),\n            ObjectCreationExpressionSyntax objectCreation => objectCreation.Type.NameIs(\"TimeSpan\")\n                                                             && objectCreation?.ArgumentList != null && objectCreation.ArgumentList.Arguments.Count is 1\n                                                             && objectCreation.ArgumentList.Arguments[0].GetExpression() is LiteralExpressionSyntax literal\n                                                             && IsValueEqualTo(literal, 0),\n            _ => false\n        };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/UseUnixEpochCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [ExportCodeFixProvider(LanguageNames.VisualBasic)]\n    public sealed class UseUnixEpochCodeFix : UseUnixEpochCodeFixBase<SyntaxKind>\n    {\n        protected override SyntaxNode ReplaceConstructorWithField(SyntaxNode root, SyntaxNode node, SonarCodeFixContext context)\n        {\n            var leadingTrivia = node.GetLeadingTrivia();\n            var trailingTrivia = node.GetTrailingTrivia();\n            return root.ReplaceNode(node,\n                SyntaxFactory.MemberAccessExpression(\n                    SyntaxKind.SimpleMemberAccessExpression,\n                    ((ObjectCreationExpressionSyntax)node).Type,\n                    SyntaxFactory.Token(SyntaxKind.DotToken),\n                    SyntaxFactory.IdentifierName(\"UnixEpoch\")).WithLeadingTrivia(leadingTrivia).WithTrailingTrivia(trailingTrivia));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/UseWhereBeforeOrderBy.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class UseWhereBeforeOrderBy : UseWhereBeforeOrderByBase<SyntaxKind, InvocationExpressionSyntax>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/UseWithStatement.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class UseWithStatement : ParametrizedDiagnosticAnalyzer\n    {\n        internal const string DiagnosticId = \"S2375\";\n        private const string MessageFormat = \"Wrap this and the following {0} statement{2} that use '{1}' in a 'With' statement.\";\n\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat,\n                isEnabledByDefault: false);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        private const int DefaultMinimumSeriesLength = 6;\n\n        [RuleParameter(\"minimumSeriesLength\", PropertyType.Integer,\n            \"Minimum length a series must have to trigger an issue.\", DefaultMinimumSeriesLength)]\n        public int MinimumSeriesLength { get; set; } = DefaultMinimumSeriesLength;\n\n        private static readonly ISet<Type> WhiteListedStatementTypes = new HashSet<Type>\n        {\n            typeof(AssignmentStatementSyntax),\n            typeof(WithBlockSyntax),\n            typeof(ExpressionStatementSyntax)\n        };\n\n        protected override void Initialize(SonarParametrizedAnalysisContext context)\n        {\n            context.RegisterNodeAction(\n                c =>\n                {\n                    if (MinimumSeriesLength <= 1)\n                    {\n                        return;\n                    }\n\n                    var simpleMemberAccess = (MemberAccessExpressionSyntax)c.Node;\n\n                    var parenthesized = simpleMemberAccess.SelfOrTopParenthesizedExpression;\n                    if (parenthesized.Parent is MemberAccessExpressionSyntax)\n                    {\n                        // Only process top level member access expressions\n                        return;\n                    }\n\n                    var currentMemberExpression = simpleMemberAccess.Expression.RemoveParentheses();\n                    while (simpleMemberAccess != null &&\n                        !CheckExpression(c, currentMemberExpression))\n                    {\n                        simpleMemberAccess = currentMemberExpression as MemberAccessExpressionSyntax;\n                        currentMemberExpression = simpleMemberAccess?.Expression.RemoveParentheses();\n                    }\n                },\n                SyntaxKind.SimpleMemberAccessExpression);\n        }\n\n        private bool CheckExpression(SonarSyntaxNodeReportingContext context, ExpressionSyntax expression)\n        {\n            if (!IsCandidateForExtraction(context, expression))\n            {\n                return false;\n            }\n\n            var executableStatement = GetParentStatement(expression);\n            if (executableStatement == null)\n            {\n                return false;\n            }\n\n            // check previous statement if it contains\n            var prevStatement = executableStatement.PrecedingStatement as ExecutableStatementSyntax;\n            if (IsCandidateStatement(prevStatement, expression))\n            {\n                return false;\n            }\n\n            var matchCount = 1;\n\n            // check following statements\n            var nextStatement = executableStatement.SucceedingStatement as ExecutableStatementSyntax;\n            while (IsCandidateStatement(nextStatement, expression))\n            {\n                matchCount++;\n                nextStatement = nextStatement.SucceedingStatement as ExecutableStatementSyntax;\n            }\n\n            if (matchCount >= MinimumSeriesLength)\n            {\n                var nextStatementCount = matchCount - 1;\n                context.ReportIssue(rule, executableStatement, nextStatementCount.ToString(), expression.ToString(), nextStatementCount == 1 ? string.Empty : \"s\");\n                return true;\n            }\n\n            return false;\n        }\n\n        private static bool IsCandidateForExtraction(SonarSyntaxNodeReportingContext context, ExpressionSyntax currentMemberExpression)\n        {\n            return currentMemberExpression != null &&\n                !currentMemberExpression.IsKind(SyntaxKind.IdentifierName) &&\n                !(currentMemberExpression is InstanceExpressionSyntax) &&\n                !(context.Model.GetSymbolInfo(currentMemberExpression).Symbol is ITypeSymbol);\n        }\n\n        private static ExecutableStatementSyntax GetParentStatement(ExpressionSyntax expression)\n        {\n            var expr = expression;\n            var parent = expr.Parent as ExpressionSyntax;\n            while (parent != null)\n            {\n                expr = parent;\n                parent = expr.Parent as ExpressionSyntax;\n            }\n\n            return expr.Parent as ExecutableStatementSyntax;\n        }\n\n        private static bool IsCandidateStatement(ExecutableStatementSyntax statement, ExpressionSyntax expression)\n        {\n            return statement != null &&\n                IsAllowedStatement(statement) &&\n                !ContainsEmptyMemberAccess(statement) &&\n                ContainsExpression(statement, expression);\n        }\n\n        private static bool ContainsEmptyMemberAccess(ExecutableStatementSyntax container)\n        {\n            return container.DescendantNodes()\n                .OfType<MemberAccessExpressionSyntax>()\n                .Any(m => m.Expression == null);\n        }\n\n        private static bool IsAllowedStatement(ExecutableStatementSyntax statement)\n        {\n            return WhiteListedStatementTypes.Contains(statement.GetType());\n        }\n\n        private static bool ContainsExpression(ExecutableStatementSyntax container, ExpressionSyntax contained)\n        {\n            return contained != null &&\n                container.DescendantNodes()\n                    .OfType<MemberAccessExpressionSyntax>()\n                    .Any(m => m.Expression != null && VisualBasicEquivalenceChecker.AreEquivalent(contained, m.Expression));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Utilities/AnalysisWarningAnalyzer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic class AnalysisWarningAnalyzer : AnalysisWarningAnalyzerBase { }\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Utilities/CopyPasteTokenAnalyzer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public class CopyPasteTokenAnalyzer : CopyPasteTokenAnalyzerBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language { get; } = VisualBasicFacade.Instance;\n\n        protected override bool IsUsingDirective(SyntaxNode node) =>\n            node is ImportsStatementSyntax;\n\n        protected override string GetCpdValue(SyntaxToken token)\n        {\n            if (token.Kind() is SyntaxKind.DecimalLiteralToken or SyntaxKind.FloatingLiteralToken or SyntaxKind.IntegerLiteralToken)\n            {\n                return \"$num\";\n            }\n            else if (token.Kind() is SyntaxKind.StringLiteralToken or SyntaxKind.InterpolatedStringTextToken)\n            {\n                return \"$str\";\n            }\n            else if (token.IsKind(SyntaxKind.CharacterLiteralToken))\n            {\n                return \"$char\";\n            }\n            else\n            {\n                return token.Text;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Utilities/FileMetadataAnalyzer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class FileMetadataAnalyzer : FileMetadataAnalyzerBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language { get; } = VisualBasicFacade.Instance;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Utilities/LogAnalyzer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public class LogAnalyzer : LogAnalyzerBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language { get; } = VisualBasicFacade.Instance;\n\n        protected override string LanguageVersion(Compilation compilation) =>\n            ((VisualBasicCompilation)compilation).LanguageVersion.ToString();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Utilities/MetricsAnalyzer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Metrics;\nusing SonarAnalyzer.VisualBasic.Metrics;\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class MetricsAnalyzer : MetricsAnalyzerBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language { get; } = VisualBasicFacade.Instance;\n\n        protected override MetricsBase GetMetrics(SyntaxTree syntaxTree, SemanticModel semanticModel) =>\n            new VisualBasicMetrics(syntaxTree, semanticModel);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Utilities/SymbolReferenceAnalyzer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public class SymbolReferenceAnalyzer : SymbolReferenceAnalyzerBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language { get; } = VisualBasicFacade.Instance;\n\n        protected override SyntaxNode GetBindableParent(SyntaxToken token) =>\n            token.GetBindableParent();\n\n        protected override ReferenceInfo[] CreateDeclarationReferenceInfo(SyntaxNode node, SemanticModel model) =>\n            node switch\n            {\n                TypeStatementSyntax typeStatement => new[] { CreateDeclarationReferenceInfo(node, typeStatement.Identifier, model) },\n                MethodStatementSyntax methodStatement => new[] { CreateDeclarationReferenceInfo(node, methodStatement.Identifier, model) },\n                EventStatementSyntax eventStatement => new[] { CreateDeclarationReferenceInfo(node, eventStatement.Identifier, model) },\n                FieldDeclarationSyntax fieldDeclaration => CreateDeclarationReferenceInfo(fieldDeclaration, model),\n                VariableDeclaratorSyntax variableDeclarator => CreateDeclarationReferenceInfo(variableDeclarator, model),\n                ParameterSyntax parameter => new[] { CreateDeclarationReferenceInfo(node, parameter.Identifier.Identifier, model) },\n                LocalDeclarationStatementSyntax localDeclaration => CreateDeclarationReferenceInfo(localDeclaration, model),\n                PropertyStatementSyntax propertyStatement => new[] { CreateDeclarationReferenceInfo(node, propertyStatement.Identifier, model) },\n                TypeParameterSyntax typeParameter => new[] { CreateDeclarationReferenceInfo(node, typeParameter.Identifier, model) },\n                _ => null\n            };\n\n        protected override IList<SyntaxNode> GetDeclarations(SyntaxNode node)\n        {\n            var walker = new DeclarationsFinder();\n            walker.SafeVisit(node);\n            return walker.Declarations;\n        }\n\n        private static ReferenceInfo[] CreateDeclarationReferenceInfo(LocalDeclarationStatementSyntax declaration, SemanticModel model) =>\n            declaration.Declarators.SelectMany(x => CreateDeclarationReferenceInfo(x, model)).ToArray();\n\n        private static ReferenceInfo[] CreateDeclarationReferenceInfo(FieldDeclarationSyntax fieldDeclaration, SemanticModel model) =>\n            fieldDeclaration.Declarators.SelectMany(x => CreateDeclarationReferenceInfo(x, model)).ToArray();\n\n        private static ReferenceInfo[] CreateDeclarationReferenceInfo(VariableDeclaratorSyntax variableDeclarator, SemanticModel model) =>\n            variableDeclarator.Names.Select(x => CreateDeclarationReferenceInfo(x, x.Identifier, model)).ToArray();\n\n        private static ReferenceInfo CreateDeclarationReferenceInfo(SyntaxNode node, SyntaxToken identifier, SemanticModel model) =>\n            new(node, identifier, model.GetDeclaredSymbol(node), true);\n\n        private sealed class DeclarationsFinder : SafeVisualBasicSyntaxWalker\n        {\n            private readonly ISet<ushort> declarationKinds = new HashSet<SyntaxKind>\n            {\n                SyntaxKind.ClassStatement,\n                SyntaxKind.EnumStatement,\n                SyntaxKind.EventStatement,\n                SyntaxKind.FieldDeclaration,\n                SyntaxKind.FunctionStatement,\n                SyntaxKind.InterfaceStatement,\n                SyntaxKind.LocalDeclarationStatement,\n                SyntaxKind.Parameter,\n                SyntaxKind.PropertyStatement,\n                SyntaxKind.StructureStatement,\n                SyntaxKind.SubStatement,\n                SyntaxKind.TypeParameter,\n                SyntaxKind.VariableDeclarator\n            }.Cast<ushort>().ToHashSet();\n\n            public readonly List<SyntaxNode> Declarations = new();\n\n            public override void Visit(SyntaxNode node)\n            {\n                if (declarationKinds.Contains((ushort)node.RawKind))\n                {\n                    Declarations.Add(node);\n                }\n                base.Visit(node);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Utilities/TelemetryAnalyzer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class TelemetryAnalyzer : TelemetryAnalyzerBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language { get; } = VisualBasicFacade.Instance;\n\n    protected override string LanguageVersion(Compilation compilation) =>\n        ((VisualBasicCompilation)compilation).LanguageVersion.ToString();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Utilities/TestMethodDeclarationsAnalyzer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic class TestMethodDeclarationsAnalyzer : TestMethodDeclarationsAnalyzerBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language { get; } = VisualBasicFacade.Instance;\n\n    protected override IEnumerable<SyntaxNode> GetMethodDeclarations(SyntaxNode node) =>\n        node.DescendantNodes().OfType<MethodStatementSyntax>();\n\n    protected override IEnumerable<SyntaxNode> GetTypeDeclarations(SyntaxNode node) =>\n        node.DescendantNodes().OfType<TypeBlockSyntax>();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/Utilities/TokenTypeAnalyzer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public class TokenTypeAnalyzer : TokenTypeAnalyzerBase<SyntaxKind>\n    {\n        protected override ILanguageFacade<SyntaxKind> Language { get; } = VisualBasicFacade.Instance;\n\n        protected override TokenClassifierBase GetTokenClassifier(SemanticModel semanticModel, bool skipIdentifierTokens) =>\n            new TokenClassifier(semanticModel, skipIdentifierTokens);\n\n        protected override TriviaClassifierBase GetTriviaClassifier() =>\n            new TriviaClassifier();\n\n        private sealed class TokenClassifier : TokenClassifierBase\n        {\n            public TokenClassifier(SemanticModel semanticModel, bool skipIdentifiers) : base(semanticModel, skipIdentifiers) { }\n\n            protected override SyntaxNode GetBindableParent(SyntaxToken token) =>\n                token.GetBindableParent();\n\n            protected override bool IsIdentifier(SyntaxToken token) =>\n                token.IsKind(SyntaxKind.IdentifierToken);\n\n            protected override bool IsKeyword(SyntaxToken token) =>\n                SyntaxFacts.IsKeywordKind(token.Kind());\n\n            protected override bool IsNumericLiteral(SyntaxToken token) =>\n                token.Kind() is SyntaxKind.DecimalLiteralToken or SyntaxKind.FloatingLiteralToken or SyntaxKind.IntegerLiteralToken;\n\n            protected override bool IsStringLiteral(SyntaxToken token) =>\n                token.Kind() is\n                    SyntaxKind.StringLiteralToken or\n                    SyntaxKind.CharacterLiteralToken or\n                    SyntaxKind.InterpolatedStringTextToken or\n                    SyntaxKind.EndOfInterpolatedStringToken;\n        }\n\n        private sealed class TriviaClassifier : TriviaClassifierBase\n        {\n            protected override bool IsRegularComment(SyntaxTrivia trivia) =>\n                trivia.IsKind(SyntaxKind.CommentTrivia);\n\n            protected override bool IsDocComment(SyntaxTrivia trivia) =>\n                trivia.IsKind(SyntaxKind.DocumentationCommentTrivia);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/ValueTypeShouldImplementIEquatable.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class ValueTypeShouldImplementIEquatable : ValueTypeShouldImplementIEquatableBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/VariableUnused.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class VariableUnused : VariableUnusedBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language { get; } = VisualBasicFacade.Instance;\n\n    protected override bool IsExcludedDeclaration(SyntaxNode node) =>\n        node is ModifiedIdentifierSyntax { Parent.Parent: UsingStatementSyntax or ForStatementSyntax or ForEachStatementSyntax }  // Using/For/For Each x ... in VB\n                or ModifiedIdentifierSyntax { Parent: CatchStatementSyntax }                                                      // Catch e As Exception in VB\n                or ModifiedIdentifierSyntax { Parent: CollectionRangeVariableSyntax or VariableNameEqualsSyntax };                // From x In / Select x = / Let x = / Into x = in VB LINQ\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/WcfNonVoidOneWay.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules\n{\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    public sealed class WcfNonVoidOneWay : WcfNonVoidOneWayBase<MethodStatementSyntax, SyntaxKind>\n    {\n        private static readonly DiagnosticDescriptor rule =\n            DescriptorFactory.Create(DiagnosticId, MessageFormat);\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(rule);\n\n        protected override GeneratedCodeRecognizer GeneratedCodeRecognizer =>\n            VisualBasicGeneratedCodeRecognizer.Instance;\n\n        protected override SyntaxKind MethodDeclarationKind =>\n            SyntaxKind.FunctionStatement;\n\n        protected override Location GetReturnTypeLocation(MethodStatementSyntax method) =>\n            method.AsClause.Type.GetLocation();\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/Rules/WeakSslTlsProtocols.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class WeakSslTlsProtocols : WeakSslTlsProtocolsBase<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/SonarAnalyzer.VisualBasic.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFramework>netstandard2.0</TargetFramework>\n    <!-- .NET Standard target does not copy referenced DLLs into bin folder, so we need to enable it explicitly. -->\n    <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>\n    <!-- Title for DLL file properties -->\n    <AssemblyTitle>SonarAnalyzer Visual Basic .NET</AssemblyTitle>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Microsoft.CodeAnalysis.VisualBasic.Workspaces\" Version=\"1.3.2\" />\n    <PackageReference Include=\"System.Collections.Immutable\" Version=\"1.1.37\">\n      <!-- Downgrade System.Collections.Immutable to support VS2015 Update 3 -->\n      <NoWarn>NU1605, NU1701</NoWarn>\n    </PackageReference>\n  </ItemGroup>\n\n  <ItemGroup>\n    <!-- We need to update NuGet and JAR packaging after changing references -->\n    <ProjectReference Include=\"..\\SonarAnalyzer.Core\\SonarAnalyzer.Core.csproj\" />\n    <ProjectReference Include=\"..\\SonarAnalyzer.VisualBasic.Core\\SonarAnalyzer.VisualBasic.Core.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Using Include=\"Microsoft.CodeAnalysis\" />\n    <Using Include=\"Microsoft.CodeAnalysis.CodeFixes\" />\n    <Using Include=\"Microsoft.CodeAnalysis.Diagnostics\" />\n    <Using Include=\"Microsoft.CodeAnalysis.Shared.Extensions\" />\n    <Using Include=\"Microsoft.CodeAnalysis.VisualBasic\" />\n    <Using Include=\"Microsoft.CodeAnalysis.VisualBasic.Syntax\" />\n    <Using Include=\"Microsoft.CodeAnalysis.VisualBasic.Extensions\" />\n    <Using Include=\"SonarAnalyzer.Core.AnalysisContext\" />\n    <Using Include=\"SonarAnalyzer.Core.Analyzers\" />\n    <Using Include=\"SonarAnalyzer.Core.Common\" />\n    <Using Include=\"SonarAnalyzer.Core.Extensions\" />\n    <Using Include=\"SonarAnalyzer.Core.Facade\" />\n    <Using Include=\"SonarAnalyzer.Core.RegularExpressions\" />\n    <Using Include=\"SonarAnalyzer.Core.Rules\" />\n    <Using Include=\"SonarAnalyzer.Core.Semantics\" />\n    <Using Include=\"SonarAnalyzer.Core.Semantics.Extensions\" />\n    <Using Include=\"SonarAnalyzer.Core.Syntax.Extensions\" />\n    <Using Include=\"SonarAnalyzer.Core.Syntax.Utilities\" />\n    <Using Include=\"SonarAnalyzer.VisualBasic.Core.Common\" />\n    <Using Include=\"SonarAnalyzer.VisualBasic.Core.Extensions\" />\n    <Using Include=\"SonarAnalyzer.VisualBasic.Core.Syntax.Extensions\" />\n    <Using Include=\"SonarAnalyzer.VisualBasic.Core.Syntax.Utilities\" />\n    <Using Include=\"SonarAnalyzer.VisualBasic.Core.Facade\" />\n  </ItemGroup>\n\n  <Target Name=\"CopyBinaries\" AfterTargets=\"Build\">\n    <ItemGroup>\n      <BinariesToCopy Include=\"$(OutputPath)Google.Protobuf.dll\" />\n      <BinariesToCopy Include=\"$(OutputPath)SonarAnalyzer.CFG.dll\" />\n      <BinariesToCopy Include=\"$(OutputPath)SonarAnalyzer.Core.dll\" />\n      <BinariesToCopy Include=\"$(OutputPath)SonarAnalyzer.ShimLayer.dll\" />\n      <BinariesToCopy Include=\"$(OutputPath)SonarAnalyzer.ShimLayer.Lightup.dll\" />\n      <BinariesToCopy Include=\"$(OutputPath)SonarAnalyzer.VisualBasic.dll\" />\n      <BinariesToCopy Include=\"$(OutputPath)SonarAnalyzer.VisualBasic.Core.dll\" />\n    </ItemGroup>\n    <Copy SourceFiles=\"@(BinariesToCopy)\" DestinationFolder=\"$(BinariesFolder)\" />\n  </Target>\n\n</Project>\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/packages.lock.json",
    "content": "{\n  \"version\": 1,\n  \"dependencies\": {\n    \".NETStandard,Version=v2.0\": {\n      \"Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[3.3.1, )\",\n        \"resolved\": \"3.3.1\",\n        \"contentHash\": \"eT+kgNCDdTRbQ5WF6BGx1HI3D5jYfHteza/koefhWC2vNZGxObA74XxwWfg40dy3uUv7dn3OGKLK5GUPLroVog==\"\n      },\n      \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.3.2, )\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"I5Z2WBgFsx0G22Na1uVFPDkT6Ob4XI+g91GPN8JWldYUMlmIBcUDBfGmfr8oQPdUipvThpaU1x1xZrnNwRR8JA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.VisualBasic\": \"[1.3.2]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2]\"\n        }\n      },\n      \"NETStandard.Library\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[2.0.3, )\",\n        \"resolved\": \"2.0.3\",\n        \"contentHash\": \"st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.1.0\"\n        }\n      },\n      \"SonarAnalyzer.CSharp.Styling\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[10.21.0.135717, )\",\n        \"resolved\": \"10.21.0.135717\",\n        \"contentHash\": \"hl264jF539oB7m2jED5QGM345eFSiDAdoJc8TH0HM6L7ZeqT5TDqZDQeZ8IDP02dVIpH/Fhhn+HsGfEcj8ohyQ==\"\n      },\n      \"StyleCop.Analyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.2.0-beta.556, )\",\n        \"resolved\": \"1.2.0-beta.556\",\n        \"contentHash\": \"llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==\",\n        \"dependencies\": {\n          \"StyleCop.Analyzers.Unstable\": \"1.2.0.556\"\n        }\n      },\n      \"System.Collections.Immutable\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.1.37, )\",\n        \"resolved\": \"1.1.37\",\n        \"contentHash\": \"fTpqwZYBzoklTT+XjTRK8KxvmrGkYHzBiylCcKyQcxiOM8k+QvhNBxRvFHDWzy4OEP5f8/9n+xQ9mEgEXY+muA==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.0\",\n          \"System.Diagnostics.Debug\": \"4.0.0\",\n          \"System.Globalization\": \"4.0.0\",\n          \"System.Linq\": \"4.0.0\",\n          \"System.Resources.ResourceManager\": \"4.0.0\",\n          \"System.Runtime\": \"4.0.0\",\n          \"System.Runtime.Extensions\": \"4.0.0\",\n          \"System.Threading\": \"4.0.0\"\n        }\n      },\n      \"Google.Protobuf\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"3.6.1\",\n        \"contentHash\": \"741fGeDQjixBJaU2j+0CbrmZXsNJkTn/hWbOh4fLVXndHsCclJmWznCPWrJmPoZKvajBvAz3e8ECJOUvRtwjNQ==\",\n        \"dependencies\": {\n          \"NETStandard.Library\": \"1.6.1\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.1.0\",\n        \"contentHash\": \"HS3iRWZKcUw/8eZ/08GXKY2Bn7xNzQPzf8gRPHGSowX7u7XXu9i9YEaBeBNKUXWfI7qjvT2zXtLUvbN0hds8vg==\"\n      },\n      \"Microsoft.CodeAnalysis.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"lOinFNbjpCvkeYQHutjKi+CfsjoKu88wAFT6hAumSR/XJSJmmVGvmnbzCWW8kUJnDVrw1RrcqS8BzgPMj263og==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"1.1.0\",\n          \"System.AppContext\": \"4.1.0\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.Collections.Concurrent\": \"4.0.12\",\n          \"System.Collections.Immutable\": \"1.2.0\",\n          \"System.Console\": \"4.0.0\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Diagnostics.FileVersionInfo\": \"4.0.0\",\n          \"System.Diagnostics.StackTrace\": \"4.0.1\",\n          \"System.Diagnostics.Tools\": \"4.0.1\",\n          \"System.Dynamic.Runtime\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Linq.Expressions\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Metadata\": \"1.3.0\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Runtime.Numerics\": \"4.0.1\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.X509Certificates\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Text.Encoding.CodePages\": \"4.0.1\",\n          \"System.Text.Encoding.Extensions\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\",\n          \"System.Threading.Tasks.Parallel\": \"4.0.1\",\n          \"System.Threading.Thread\": \"4.0.0\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\",\n          \"System.Xml.XDocument\": \"4.0.11\",\n          \"System.Xml.XPath.XDocument\": \"4.0.1\",\n          \"System.Xml.XmlDocument\": \"4.0.1\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"GrYMp6ScZDOMR0fNn/Ce6SegNVFw1G/QRT/8FiKv7lAP+V6lEZx9e42n0FvFUgjjcKgcEJOI4muU6i+3LSvOBA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Common\": \"[1.3.2]\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp.Workspaces\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"MwGmrrPx3okEJuCogSn4TM3yTtJUDdmTt8RXpnjVo0dPund0YSAq4bHQQ9bxgArbrrapcopJmkb7UOLAvanXkg==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp\": \"[1.3.2]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2]\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.VisualBasic\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"yllH3rSYEc0bV15CJ2T9Jtx+tSXO5/OVNb+xofuWrACn65Q5VqeFBKgcbgwpyVY/98ypPcGQIWNQL2A/L1seJg==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Common\": \"1.3.2\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Workspaces.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"kvdo+rkImlx5MuBgkayl4OV3Mg8/qirUdYgCIfQ9EqN15QasJFlQXmDAtCGqpkK9sYLLO/VK+y+4mvKjfh/FOA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Common\": \"[1.3.2]\",\n          \"Microsoft.Composition\": \"1.0.27\"\n        }\n      },\n      \"Microsoft.Composition\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.27\",\n        \"contentHash\": \"pwu80Ohe7SBzZ6i69LVdzowp6V+LaVRzd5F7A6QlD42vQkX0oT7KXKWWPlM/S00w1gnMQMRnEdbtOV12z6rXdQ==\"\n      },\n      \"Microsoft.NETCore.Platforms\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.1.0\",\n        \"contentHash\": \"kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==\"\n      },\n      \"Microsoft.NETCore.Targets\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.1\",\n        \"contentHash\": \"rkn+fKobF/cbWfnnfBOQHKVKIOpxMZBvlSHkqDWgBpwGDcLRduvs3D9OLGeV6GWGvVwNlVi2CBbTjuPmtHvyNw==\"\n      },\n      \"runtime.native.System\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"QfS/nQI7k/BLgmLrw7qm7YBoULEvgWnPI+cYsbfCVFTW8Aj+i8JhccxcFMu1RWms0YZzF+UHguNBK4Qn89e2Sg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\"\n        }\n      },\n      \"runtime.native.System.Net.Http\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"Nh0UPZx2Vifh8r+J+H2jxifZUD3sBrmolgiFWJd2yiNrxO0xTa6bAw3YwRn1VOiSen/tUXMS31ttNItCZ6lKuA==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\"\n        }\n      },\n      \"runtime.native.System.Security.Cryptography\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"2CQK0jmO6Eu7ZeMgD+LOFbNJSXHFVQbCJJkEyEwowh1SCgYnrn9W9RykMfpeeVGw7h4IBvYikzpGUlmZTUafJw==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\"\n        }\n      },\n      \"StyleCop.Analyzers.Unstable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.2.0.556\",\n        \"contentHash\": \"zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==\"\n      },\n      \"System.AppContext\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"3QjO4jNV7PdKkmQAVp9atA+usVnKRwI3Kx1nMwJ93T0LcQfx7pKAYk0nKz5wn1oP5iqlhZuy6RXOFdhr7rDwow==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Collections\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"YUJGz6eFKqS0V//mLt25vFGrrCvOnsXjlvFQs+KimpwNxug9x0Pzy4PlFMU3Q2IzqAa9G2L4LsK3+9vCBK7oTg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Collections.Concurrent\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.12\",\n        \"contentHash\": \"2gBcbb3drMLgxlI0fBfxMA31ec6AEyYCHygGse4vxceJan8mRIWeKJ24BFzN7+bi/NFTgdIgufzb94LWO5EERQ==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Diagnostics.Tracing\": \"4.1.0\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Console\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"qSKUSOIiYA/a0g5XXdxFcUFmv1hNICBD7QZ0QhGYVipPIhvpiydY8VZqr1thmCXvmn8aipMg64zuanB4eotK9A==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\"\n        }\n      },\n      \"System.Diagnostics.Debug\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"w5U95fVKHY4G8ASs/K5iK3J5LY+/dLFd4vKejsnI/ZhBsWS9hQakfx3Zr7lRWKg4tAw9r4iktyvsTagWkqYCiw==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Diagnostics.FileVersionInfo\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"qjF74OTAU+mRhLaL4YSfiWy3vj6T3AOz8AW37l5zCwfbBfj0k7E94XnEsRaf2TnhE/7QaV6Hvqakoy2LoV8MVg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Reflection.Metadata\": \"1.3.0\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.InteropServices\": \"4.1.0\"\n        }\n      },\n      \"System.Diagnostics.StackTrace\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"6i2EbRq0lgGfiZ+FDf0gVaw9qeEU+7IS2+wbZJmFVpvVzVOgZEt0ScZtyenuBvs6iDYbGiF51bMAa0oDP/tujQ==\",\n        \"dependencies\": {\n          \"System.Collections.Immutable\": \"1.2.0\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Metadata\": \"1.3.0\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\"\n        }\n      },\n      \"System.Diagnostics.Tools\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"xBfJ8pnd4C17dWaC9FM6aShzbJcRNMChUMD42I6772KGGrqaFdumwhn9OdM68erj1ueNo3xdQ1EwiFjK5k8p0g==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Diagnostics.Tracing\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"vDN1PoMZCkkdNjvZLql592oYJZgS7URcJzJ7bxeBgGtx5UtR5leNm49VmfHGqIffX4FKacHbI3H6UyNSHQknBg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Dynamic.Runtime\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"db34f6LHYM0U0JpE+sOmjar27BnqTVkbLJhgfwMpTdgTigG/Hna3m2MYVwnFzGGKnEJk2UXFuoVTr8WUbU91/A==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Linq.Expressions\": \"4.1.0\",\n          \"System.ObjectModel\": \"4.0.12\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Emit\": \"4.0.1\",\n          \"System.Reflection.Emit.ILGeneration\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Reflection.TypeExtensions\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Globalization\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"B95h0YLEL2oSnwF/XjqSWKnwKOy/01VWkNlsCeMTFJLLabflpGV26nK164eRs5GiaRSBGpOxQ3pKoSnnyZN5pg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Globalization.Calendars\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"L1c6IqeQ88vuzC1P81JeHmHA8mxq8a18NUBNXnIY/BVb+TCyAaGIFbhpZt60h9FJNmisymoQkHEFSE9Vslja1Q==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.IO\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"3KlTJceQc3gnGIaHZ7UBZO26SHL1SHE4ddrmiwumFnId+CEHP+O8r386tZKaE6zlk5/mF8vifMBzHj9SaXN+mQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.IO.FileSystem\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"IBErlVq5jOggAD69bg1t0pJcHaDbJbWNUZTPI96fkYWzwYbN6D9wRHMULLDd9dHsl7C2YsxXL31LMfPI1SWt8w==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.IO.FileSystem.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"kWkKD203JJKxJeE74p8aF8y4Qc9r9WQx4C0cHzHPrY3fv/L/IhWnyCHaFJ3H1QPOH6A93whlQ2vG5nHlBDvzWQ==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Linq\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"bQ0iYFOQI0nuTnt+NQADns6ucV4DUvMdwN6CbkB1yj8i7arTGiTN5eok1kQwdnnNWSDZfIUySQY+J3d5KjWn0g==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\"\n        }\n      },\n      \"System.Linq.Expressions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"I+y02iqkgmCAyfbqOmSDOgqdZQ5tTj80Akm5BPSS8EeB0VGWdy6X1KCoYe8Pk6pwDoAKZUOdLVxnTJcExiv5zw==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.ObjectModel\": \"4.0.12\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Emit\": \"4.0.1\",\n          \"System.Reflection.Emit.ILGeneration\": \"4.0.1\",\n          \"System.Reflection.Emit.Lightweight\": \"4.0.1\",\n          \"System.Reflection.Extensions\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Reflection.TypeExtensions\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.ObjectModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.12\",\n        \"contentHash\": \"tAgJM1xt3ytyMoW4qn4wIqgJYm7L7TShRZG4+Q4Qsi2PCcj96pXN7nRywS9KkB3p/xDUjc2HSwP9SROyPYDYKQ==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Reflection\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"JCKANJ0TI7kzoQzuwB/OoJANy1Lg338B6+JVacPl4TpUwi3cReg3nMLplMq2uqYfHFQpKIlHAUVAJlImZz/4ng==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Emit\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"P2wqAj72fFjpP6wb9nSfDqNBMab+2ovzSDzUZK7MVIm54tBJEPr9jWfSjjoTpPwj1LeKcmX3vr0ttyjSSFM47g==\",\n        \"dependencies\": {\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Emit.ILGeneration\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Emit.ILGeneration\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"Ov6dU8Bu15Bc7zuqttgHF12J5lwSWyTf1S+FJouUXVMSqImLZzYaQ+vRr1rQ0OZ0HqsrwWl4dsKHELckQkVpgA==\",\n        \"dependencies\": {\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Emit.Lightweight\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"sSzHHXueZ5Uh0OLpUQprhr+ZYJrLPA2Cmr4gn0wj9+FftNKXx8RIMKvO9qnjk2ebPYUjZ+F2ulGdPOsvj+MEjA==\",\n        \"dependencies\": {\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Emit.ILGeneration\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"GYrtRsZcMuHF3sbmRHfMYpvxZoIN2bQGrYGerUiWLEkqdEUQZhH3TRSaC/oI4wO0II1RKBPlpIa1TOMxIcOOzQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Metadata\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.0\",\n        \"contentHash\": \"jMSCxA4LSyKBGRDm/WtfkO03FkcgRzHxwvQRib1bm2GZ8ifKM1MX1al6breGCEQK280mdl9uQS7JNPXRYk90jw==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Collections.Immutable\": \"1.2.0\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Extensions\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Text.Encoding.Extensions\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Reflection.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"4inTox4wTBaDhB7V3mPvp9XlCbeGYWVEM9/fXALd52vNEAVisc1BoVWQPuUuD0Ga//dNbA/WeMy9u9mzLxGTHQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.TypeExtensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"tsQ/ptQ3H5FYfON8lL4MxRk/8kFyE0A+tGPXmVP967cT/gzLHYxIejIYSxp4JmIeFHVP78g/F2FE1mUUTbDtrg==\",\n        \"dependencies\": {\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Resources.ResourceManager\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"TxwVeUNoTgUOdQ09gfTjvW411MF+w9MBYL7AtNVc+HtBCFlutPLhUCdZjNkjbhj3bNQWMdHboF0KIWEOjJssbA==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Runtime\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"v6c/4Yaa9uWsq+JMhnOFewrYkgdNHNG2eMKuNqRn8P733rNXeRCGvV5FkkjBXn2dbVkPXOsO0xjsEeM1q2zC0g==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\"\n        }\n      },\n      \"System.Runtime.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"CUOHjTT/vgP0qGW22U4/hDlOqXmcPq5YicBaXdUR2UiUoLwBT+olO6we4DVbq57jeX5uXH2uerVZhf0qGj+sVQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Runtime.Handles\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"nCJvEKguXEvk2ymk1gqj625vVnlK3/xdGzx0vOKicQkoquaTBJTP13AIYkocSUwHCLNBwUbXTqTWGDxBTWpt7g==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Runtime.InteropServices\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"16eu3kjHS633yYdkjwShDHZLRNMKVi/s0bY8ODiqJ2RfMhDMAwxZaUaWVnZ2P71kr/or+X9o/xFWtNqz8ivieQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\"\n        }\n      },\n      \"System.Runtime.Numerics\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"+XbKFuzdmLP3d1o9pdHu2nxjNr2OEPqGzKeegPLCUMM71a0t50A/rOcIRmGs9wR7a8KuHX6hYs/7/TymIGLNqg==\",\n        \"dependencies\": {\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\"\n        }\n      },\n      \"System.Security.Cryptography.Algorithms\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.2.0\",\n        \"contentHash\": \"8JQFxbLVdrtIOKMDN38Fn0GWnqYZw/oMlwOUG/qz1jqChvyZlnUmu+0s7wLx7JYua/nAXoESpHA3iw11QFWhXg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Runtime.Numerics\": \"4.0.1\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"runtime.native.System.Security.Cryptography\": \"4.0.0\"\n        }\n      },\n      \"System.Security.Cryptography.Cng\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.2.0\",\n        \"contentHash\": \"cUJ2h+ZvONDe28Szw3st5dOHdjndhJzQ2WObDEXAWRPEQBtVItVoxbXM/OEsTthl3cNn2dk2k0I3y45igCQcLw==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\"\n        }\n      },\n      \"System.Security.Cryptography.Csp\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"/i1Usuo4PgAqgbPNC0NjbO3jPW//BoBlTpcWFD1EHVbidH21y4c1ap5bbEMSGAXjAShhMH4abi/K8fILrnu4BQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Security.Cryptography.Encoding\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"FbKgE5MbxSQMPcSVRgwM6bXN3GtyAh04NkV8E5zKCBE26X0vYW0UtTa2FIgkH33WVqBVxRgxljlVYumWtU+HcQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.Collections.Concurrent\": \"4.0.12\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"runtime.native.System.Security.Cryptography\": \"4.0.0\"\n        }\n      },\n      \"System.Security.Cryptography.OpenSsl\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"HUG/zNUJwEiLkoURDixzkzZdB5yGA5pQhDP93ArOpDPQMteURIGERRNzzoJlmTreLBWr5lkFSjjMSk8ySEpQMw==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Runtime.Numerics\": \"4.0.1\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"runtime.native.System.Security.Cryptography\": \"4.0.0\"\n        }\n      },\n      \"System.Security.Cryptography.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"Wkd7QryWYjkQclX0bngpntW5HSlMzeJU24UaLJQ7YTfI8ydAVAaU2J+HXLLABOVJlKTVvAeL0Aj39VeTe7L+oA==\",\n        \"dependencies\": {\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Security.Cryptography.X509Certificates\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"4HEfsQIKAhA1+ApNn729Gi09zh+lYWwyIuViihoMDWp1vQnEkL2ct7mAbhBlLYm+x/L4Rr/pyGge1lIY635e0w==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Globalization.Calendars\": \"4.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Runtime.Numerics\": \"4.0.1\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Cng\": \"4.2.0\",\n          \"System.Security.Cryptography.Csp\": \"4.0.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.OpenSsl\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\",\n          \"runtime.native.System\": \"4.0.0\",\n          \"runtime.native.System.Net.Http\": \"4.0.1\",\n          \"runtime.native.System.Security.Cryptography\": \"4.0.0\"\n        }\n      },\n      \"System.Text.Encoding\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"U3gGeMlDZXxCEiY4DwVLSacg+DFWCvoiX+JThA/rvw37Sqrku7sEFeVBBBMBnfB6FeZHsyDx85HlKL19x0HtZA==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Text.Encoding.CodePages\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"h4z6rrA/hxWf4655D18IIZ0eaLRa3tQC/j+e26W+VinIHY0l07iEXaAvO0YSYq3MvCjMYy8Zs5AdC1sxNQOB7Q==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Text.Encoding.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"jtbiTDtvfLYgXn8PTfWI+SiBs51rrmO4AAckx4KR6vFK9Wzf6tI8kcRdsYQNwriUeQ1+CtQbM1W4cMbLXnj/OQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\"\n        }\n      },\n      \"System.Text.RegularExpressions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"i88YCXpRTjCnoSQZtdlHkAOx4KNNik4hMy83n0+Ftlb7jvV6ZiZWMpnEZHhjBp6hQVh8gWd/iKNPzlPF7iyA2g==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Threading\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"N+3xqIcg3VDKyjwwCGaZ9HawG9aC6cSDI+s7ROma310GQo8vilFZa86hqKppwTHleR/G0sfOzhvgnUxWCR/DrQ==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Threading.Tasks\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"k1S4Gc6IGwtHGT8188RSeGaX86Qw/wnrgNLshJvsdNUOPP9etMmo8S07c+UlOAx4K/xLuN9ivA1bD0LVurtIxQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Threading.Tasks.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"pH4FZDsZQ/WmgJtN4LWYmRdJAEeVkyriSwrv2Teoe5FOU0Yxlb6II6GL8dBPOfRmutHGATduj3ooMt7dJ2+i+w==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Threading.Tasks.Parallel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"7Pc9t25bcynT9FpMvkUw4ZjYwUiGup/5cJFW72/5MgCG+np2cfVUMdh29u8d7onxX7d8PS3J+wL73zQRqkdrSA==\",\n        \"dependencies\": {\n          \"System.Collections.Concurrent\": \"4.0.12\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Diagnostics.Tracing\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Threading.Thread\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"gIdJqDXlOr5W9zeqFErLw3dsOsiShSCYtF9SEHitACycmvNvY8odf9kiKvp6V7aibc8C4HzzNBkWXjyfn7plbQ==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Xml.ReaderWriter\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"ZIiLPsf67YZ9zgr31vzrFaYQqxRPX9cVHjtPSnmx4eN6lbS/yEyYNr2vs1doGDEscF0tjCZFsk9yUg1sC9e8tg==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Text.Encoding.Extensions\": \"4.0.11\",\n          \"System.Text.RegularExpressions\": \"4.1.0\",\n          \"System.Threading.Tasks\": \"4.0.11\",\n          \"System.Threading.Tasks.Extensions\": \"4.0.0\"\n        }\n      },\n      \"System.Xml.XDocument\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"Mk2mKmPi0nWaoiYeotq1dgeNK1fqWh61+EK+w4Wu8SWuTYLzpUnschb59bJtGywaPq7SmTuPf44wrXRwbIrukg==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Diagnostics.Tools\": \"4.0.1\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\"\n        }\n      },\n      \"System.Xml.XmlDocument\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"2eZu6IP+etFVBBFUFzw2w6J21DqIN5eL9Y8r8JfJWUmV28Z5P0SNU01oCisVHQgHsDhHPnmq2s1hJrJCFZWloQ==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\"\n        }\n      },\n      \"System.Xml.XPath\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"UWd1H+1IJ9Wlq5nognZ/XJdyj8qPE4XufBUkAW59ijsCPjZkZe0MUzKKJFBr+ZWBe5Wq1u1d5f2CYgE93uH7DA==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\"\n        }\n      },\n      \"System.Xml.XPath.XDocument\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"FLhdYJx4331oGovQypQ8JIw2kEmNzCsjVOVYY/16kZTUoquZG85oVn7yUhBE2OZt1yGPSXAL0HTEfzjlbNpM7Q==\",\n        \"dependencies\": {\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\",\n          \"System.Xml.XDocument\": \"4.0.11\",\n          \"System.Xml.XPath\": \"4.0.1\"\n        }\n      },\n      \"sonaranalyzer.cfg\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer.Lightup\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.core\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Google.Protobuf\": \"[3.6.1, )\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.CFG\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer.lightup\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.visualbasic.core\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": \"[1.3.2, )\",\n          \"SonarAnalyzer.CFG\": \"[10.26.0, )\",\n          \"SonarAnalyzer.Core\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic/sonarpedia.json",
    "content": "{\n  \"rules-metadata-path\": \"../../rspec/vbnet/\",\n  \"languages\": [\n    \"VBNET\"\n  ],\n  \"latest-update\": \"2026-04-27T06:52:08.926315Z\",\n  \"options\": {\n    \"no-language-in-filenames\": true\n  }\n}"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Common/DescriptorFactory.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Core.Rspec;\n\nnamespace SonarAnalyzer.VisualBasic.Core.Common;\n\npublic static class DescriptorFactory\n{\n    public static DiagnosticDescriptor Create(string id, string messageFormat, bool? isEnabledByDefault = null, bool fadeOutCode = false, bool isCompilationEnd = false) =>\n        // RuleCatalog class is created from SonarAnalyzer.SourceGenerator\n        DiagnosticDescriptorFactory.Create(AnalyzerLanguage.VisualBasic, RuleCatalog.Rules[id], messageFormat, isEnabledByDefault, fadeOutCode, isCompilationEnd);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Extensions/ICompilationReportExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Core.Extensions;\n\n// Don't change the this parameter to (this IAnalysisContext context) because it would cause boxing\npublic static class ICompilationReportExtensions\n{\n    extension<TContext>(TContext context) where TContext : ICompilationReport\n    {\n        public void ReportIssue(DiagnosticDescriptor rule, SyntaxNode locationSyntax, params string[] messageArgs) =>\n            context.ReportIssue(VisualBasicGeneratedCodeRecognizer.Instance, rule, locationSyntax, messageArgs);\n\n        public void ReportIssue(DiagnosticDescriptor rule, SyntaxToken locationToken, params string[] messageArgs) =>\n            context.ReportIssue(VisualBasicGeneratedCodeRecognizer.Instance, rule, locationToken, messageArgs);\n\n        public void ReportIssue(DiagnosticDescriptor rule, Location location, params string[] messageArgs) =>\n            context.ReportIssue(VisualBasicGeneratedCodeRecognizer.Instance, rule, location, messageArgs);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Extensions/ISymbolExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Core.Extensions;\n\npublic static class ISymbolExtensions\n{\n    extension(ISymbol symbol)\n    {\n        public IEnumerable<SyntaxNode> LocationNodes(SyntaxNode node) =>\n            symbol.Locations.SelectMany(location => GetDescendantNodes(location, node));\n    }\n\n    public static IEnumerable<SyntaxNode> GetDescendantNodes(Location location, SyntaxNode node) =>\n        location.SourceTree?.GetRoot() is { } locationRootNode\n        && locationRootNode == node.SyntaxTree.GetRoot()\n        && locationRootNode.FindNode(location.SourceSpan)\n                           .FirstAncestorOrSelf<VariableDeclaratorSyntax>() is { } declaration\n            ? declaration.DescendantNodes()\n            : Enumerable.Empty<SyntaxNode>();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Extensions/SonarAnalysisContextExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Core.Extensions;\n\npublic static class SonarAnalysisContextExtensions\n{\n    extension(SonarAnalysisContext context)\n    {\n        public void RegisterNodeAction(Action<SonarSyntaxNodeReportingContext> action, params SyntaxKind[] syntaxKinds) =>\n            context.RegisterNodeAction(VisualBasicGeneratedCodeRecognizer.Instance, action, syntaxKinds);\n\n        public void RegisterTreeAction(Action<SonarSyntaxTreeReportingContext> action) =>\n            context.RegisterTreeAction(VisualBasicGeneratedCodeRecognizer.Instance, action);\n\n        public void RegisterSemanticModelAction(Action<SonarSemanticModelReportingContext> action) =>\n            context.RegisterSemanticModelAction(VisualBasicGeneratedCodeRecognizer.Instance, action);\n\n        public void RegisterCodeBlockStartAction(Action<SonarCodeBlockStartAnalysisContext<SyntaxKind>> action) =>\n            context.RegisterCodeBlockStartAction(VisualBasicGeneratedCodeRecognizer.Instance, action);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Extensions/SonarCompilationStartAnalysisContextExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Core.Extensions;\n\npublic static class SonarCompilationStartAnalysisContextExtensions\n{\n    extension(SonarCompilationStartAnalysisContext context)\n    {\n        public void RegisterNodeAction(Action<SonarSyntaxNodeReportingContext> action, params SyntaxKind[] syntaxKinds) =>\n            context.RegisterNodeAction(VisualBasicGeneratedCodeRecognizer.Instance, action, syntaxKinds);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Extensions/SonarParametrizedAnalysisContextExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Core.Extensions;\n\npublic static class SonarParametrizedAnalysisContextExtensions\n{\n    extension(SonarParametrizedAnalysisContext context)\n    {\n        public void RegisterNodeAction(Action<SonarSyntaxNodeReportingContext> action, params SyntaxKind[] syntaxKinds) =>\n            context.RegisterNodeAction(VisualBasicGeneratedCodeRecognizer.Instance, action, syntaxKinds);\n\n        public void RegisterTreeAction(Action<SonarSyntaxTreeReportingContext> action) =>\n            context.RegisterTreeAction(VisualBasicGeneratedCodeRecognizer.Instance, action);\n\n        public void RegisterSemanticModelAction(Action<SonarSemanticModelReportingContext> action) =>\n            context.RegisterSemanticModelAction(VisualBasicGeneratedCodeRecognizer.Instance, action);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Extensions/SonarSyntaxNodeReportingContextExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Core.Extensions;\n\npublic static class SonarSyntaxNodeReportingContextExtensions\n{\n    extension(SonarSyntaxNodeReportingContext context)\n    {\n        public bool IsInExpressionTree() =>\n            context.Node.IsInExpressionTree(context.Model);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Facade/Implementation/VisualBasicSyntaxFacade.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing ComparisonKindEnum = SonarAnalyzer.Core.Syntax.Utilities.ComparisonKind;\n\nnamespace SonarAnalyzer.VisualBasic.Core.Facade.Implementation;\n\ninternal sealed class VisualBasicSyntaxFacade : SyntaxFacade<SyntaxKind>\n{\n    public override bool AreEquivalent(SyntaxNode firstNode, SyntaxNode secondNode) =>\n        SyntaxFactory.AreEquivalent(firstNode, secondNode);\n\n    public override IEnumerable<SyntaxNode> ArgumentExpressions(SyntaxNode node) =>\n        ArgumentList(node)?.OfType<ArgumentSyntax>().Select(x => x.GetExpression()).WhereNotNull() ?? Enumerable.Empty<SyntaxNode>();\n\n    public override IReadOnlyList<SyntaxNode> ArgumentList(SyntaxNode node) =>\n        node.ArgumentList()?.Arguments;\n\n    public override int? ArgumentIndex(SyntaxNode argument) =>\n        Cast<ArgumentSyntax>(argument).GetArgumentIndex();\n\n    public override SyntaxToken? ArgumentNameColon(SyntaxNode argument) =>\n        (argument as SimpleArgumentSyntax)?.NameColonEquals?.Name.Identifier;\n\n    public override SyntaxNode AssignmentLeft(SyntaxNode assignment) =>\n        Cast<AssignmentStatementSyntax>(assignment).Left;\n\n    public override SyntaxNode AssignmentRight(SyntaxNode assignment) =>\n        Cast<AssignmentStatementSyntax>(assignment).Right;\n\n    public override ImmutableArray<SyntaxNode> AssignmentTargets(SyntaxNode assignment) =>\n        ImmutableArray.Create<SyntaxNode>(Cast<AssignmentStatementSyntax>(assignment).Left);\n\n    public override SyntaxNode BinaryExpressionLeft(SyntaxNode binary) =>\n        Cast<BinaryExpressionSyntax>(binary).Left;\n\n    public override SyntaxNode BinaryExpressionRight(SyntaxNode binary) =>\n        Cast<BinaryExpressionSyntax>(binary).Right;\n\n    public override SyntaxNode CastType(SyntaxNode cast) =>\n        Cast<CastExpressionSyntax>(cast).Type;\n\n    public override SyntaxNode CastExpression(SyntaxNode cast) =>\n        Cast<CastExpressionSyntax>(cast).Expression;\n\n    public override ComparisonKind ComparisonKind(SyntaxNode node) =>\n        node is BinaryExpressionSyntax { OperatorToken: var token }\n            ? token.ToComparisonKind()\n            : ComparisonKindEnum.None;\n\n    public override IEnumerable<SyntaxNode> EnumMembers(SyntaxNode @enum) =>\n        @enum is null ? Enumerable.Empty<SyntaxNode>() : Cast<EnumStatementSyntax>(@enum).Parent.ChildNodes().OfType<EnumMemberDeclarationSyntax>();\n\n    public override ImmutableArray<SyntaxToken> FieldDeclarationIdentifiers(SyntaxNode node) =>\n        Cast<FieldDeclarationSyntax>(node).Declarators.SelectMany(x => x.Names.Select(n => n.Identifier)).ToImmutableArray();\n\n    public override bool HasExactlyNArguments(SyntaxNode invocation, int count) =>\n        Cast<InvocationExpressionSyntax>(invocation).HasExactlyNArguments(count);\n\n    public override SyntaxToken? InvocationIdentifier(SyntaxNode invocation) =>\n        invocation is null ? null : Cast<InvocationExpressionSyntax>(invocation).GetMethodCallIdentifier();\n\n    public override bool IsAnyKind(SyntaxNode node, ISet<SyntaxKind> syntaxKinds) => node.IsAnyKind(syntaxKinds);\n\n    [Obsolete(\"Either use '.Kind() is A or B' or the overload with the ISet instead.\")]\n    public override bool IsAnyKind(SyntaxNode node, params SyntaxKind[] syntaxKinds) => node.IsAnyKind(syntaxKinds);\n\n    public override bool IsAnyKind(SyntaxTrivia trivia, ISet<SyntaxKind> syntaxKinds) => trivia.IsAnyKind(syntaxKinds);\n\n    public override bool IsInExpressionTree(SemanticModel model, SyntaxNode node) =>\n        node.IsInExpressionTree(model);\n\n    public override bool IsKind(SyntaxNode node, SyntaxKind kind) => node.IsKind(kind);\n\n    public override bool IsKind(SyntaxToken token, SyntaxKind kind) => token.IsKind(kind);\n\n    public override bool IsKind(SyntaxTrivia trivia, SyntaxKind kind) => trivia.IsKind(kind);\n\n    public override bool IsKnownAttributeType(SemanticModel model, SyntaxNode attribute, KnownType knownType) =>\n        AttributeSyntaxExtensions.IsKnownType(Cast<AttributeSyntax>(attribute), knownType, model);\n\n    public override bool IsMemberAccessOnKnownType(SyntaxNode memberAccess, string name, KnownType knownType, SemanticModel model) =>\n        Cast<MemberAccessExpressionSyntax>(memberAccess).IsMemberAccessOnKnownType(name, knownType, model);\n\n    public override bool IsNullLiteral(SyntaxNode node) =>\n        node.IsNothingLiteral();\n\n    public override bool IsPartOfBinaryNegationOrCondition(SyntaxNode node) =>\n        node.IsPartOfBinaryNegationOrCondition();\n\n    public override bool IsStatic(SyntaxNode node) =>\n        Cast<MethodBlockSyntax>(node).IsShared();\n\n    /// <inheritdoc cref=\"ExpressionSyntaxExtensions.IsWrittenTo(ExpressionSyntax, SemanticModel, CancellationToken)\"/>\n    public override bool IsWrittenTo(SyntaxNode expression, SemanticModel model, CancellationToken cancel) =>\n        Cast<ExpressionSyntax>(expression).IsWrittenTo(model, cancel);\n\n    public override SyntaxKind Kind(SyntaxNode node) => node.Kind();\n\n    public override string LiteralText(SyntaxNode literal) =>\n        Cast<LiteralExpressionSyntax>(literal).Token.ValueText;\n\n    public override ImmutableArray<SyntaxToken> LocalDeclarationIdentifiers(SyntaxNode node) =>\n        Cast<LocalDeclarationStatementSyntax>(node).Declarators.SelectMany(x => x.Names.Select(n => n.Identifier)).ToImmutableArray();\n\n    public override SyntaxKind[] ModifierKinds(SyntaxNode node) =>\n        node is StructureBlockSyntax structureBlock\n            ? structureBlock.StructureStatement.Modifiers.Select(x => x.Kind()).ToArray()\n            : Array.Empty<SyntaxKind>();\n\n    public override SyntaxNode NodeExpression(SyntaxNode node) =>\n        node switch\n        {\n            ArgumentSyntax x => x.GetExpression(),\n            InterpolationSyntax x => x.Expression,\n            InvocationExpressionSyntax x => x.Expression,\n            SyncLockStatementSyntax x => x.Expression,\n            ReturnStatementSyntax x => x.Expression,\n            MemberAccessExpressionSyntax x => x.Expression,\n            null => null,\n            _ => throw InvalidOperation(node, nameof(NodeExpression)),\n        };\n\n    public override SyntaxToken? NodeIdentifier(SyntaxNode node) =>\n        node.GetIdentifier();\n\n    public override SyntaxToken? ObjectCreationTypeIdentifier(SyntaxNode objectCreation) =>\n        objectCreation is null ? null : Cast<ObjectCreationExpressionSyntax>(objectCreation).GetObjectCreationTypeIdentifier();\n\n    public override SyntaxNode RemoveConditionalAccess(SyntaxNode node)\n    {\n        var whenNotNull = node.RemoveParentheses();\n        while (whenNotNull is ConditionalAccessExpressionSyntax conditionalAccess)\n        {\n            whenNotNull = conditionalAccess.WhenNotNull.RemoveParentheses();\n        }\n        return whenNotNull;\n    }\n\n    public override SyntaxNode RemoveParentheses(SyntaxNode node) =>\n        node.RemoveParentheses();\n\n    public override string StringValue(SyntaxNode node, SemanticModel model) =>\n        node.StringValue(model);\n\n    public override string InterpolatedTextValue(SyntaxNode node, SemanticModel model) =>\n        Cast<InterpolatedStringExpressionSyntax>(node).InterpolatedTextValue(model);\n\n    public override Pair<SyntaxNode, SyntaxNode> Operands(SyntaxNode invocation) =>\n        Cast<InvocationExpressionSyntax>(invocation).Operands();\n\n    public override SyntaxNode ParseExpression(string expression) =>\n        SyntaxFactory.ParseExpression(expression);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Facade/Implementation/VisualBasicSyntaxKindFacade.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Core.Facade.Implementation;\n\ninternal sealed class VisualBasicSyntaxKindFacade : ISyntaxKindFacade<SyntaxKind>\n{\n    public SyntaxKind Attribute => SyntaxKind.Attribute;\n    public SyntaxKind AttributeArgument => SyntaxKind.SimpleArgument;\n    public SyntaxKind[] CastExpressions => new[] { SyntaxKind.CTypeExpression, SyntaxKind.DirectCastExpression };\n    public SyntaxKind ClassDeclaration => SyntaxKind.ClassBlock;\n    public SyntaxKind[] ClassAndRecordDeclarations => new[] { SyntaxKind.ClassBlock };\n    public SyntaxKind[] ClassAndModuleDeclarations => new[]\n    {\n        SyntaxKind.ClassBlock,\n        SyntaxKind.ModuleBlock\n    };\n    public SyntaxKind[] ComparisonKinds => new[]\n    {\n        SyntaxKind.GreaterThanExpression,\n        SyntaxKind.GreaterThanOrEqualExpression,\n        SyntaxKind.LessThanExpression,\n        SyntaxKind.LessThanOrEqualExpression,\n        SyntaxKind.EqualsExpression,\n        SyntaxKind.NotEqualsExpression,\n    };\n    public SyntaxKind ConstructorDeclaration => SyntaxKind.ConstructorBlock;\n    public SyntaxKind[] DefaultExpressions => new[] { SyntaxKind.NothingLiteralExpression };\n    public SyntaxKind EndOfLineTrivia => SyntaxKind.EndOfLineTrivia;\n    public SyntaxKind EnumDeclaration => SyntaxKind.EnumStatement;\n    public SyntaxKind FieldDeclaration => SyntaxKind.FieldDeclaration;\n    public SyntaxKind IdentifierName => SyntaxKind.IdentifierName;\n    public SyntaxKind IdentifierToken => SyntaxKind.IdentifierToken;\n    public SyntaxKind InvocationExpression => SyntaxKind.InvocationExpression;\n    public SyntaxKind InterpolatedStringExpression => SyntaxKind.InterpolatedStringExpression;\n    public SyntaxKind LeftShiftAssignmentStatement => SyntaxKind.LeftShiftAssignmentStatement;\n    public SyntaxKind LeftShiftExpression => SyntaxKind.LeftShiftExpression;\n    public SyntaxKind LocalDeclaration => SyntaxKind.LocalDeclarationStatement;\n    public SyntaxKind[] MethodDeclarations => new[] { SyntaxKind.FunctionStatement, SyntaxKind.SubStatement };\n    public SyntaxKind[] ObjectCreationExpressions => new[] { SyntaxKind.ObjectCreationExpression };\n    public SyntaxKind Parameter => SyntaxKind.Parameter;\n    public SyntaxKind ParameterList => SyntaxKind.ParameterList;\n    public SyntaxKind RefKeyword => SyntaxKind.ByRefKeyword;\n    public SyntaxKind ReturnStatement => SyntaxKind.ReturnStatement;\n    public SyntaxKind RightShiftAssignmentStatement => SyntaxKind.RightShiftAssignmentStatement;\n    public SyntaxKind RightShiftExpression => SyntaxKind.RightShiftExpression;\n    public SyntaxKind SimpleAssignment => SyntaxKind.SimpleAssignmentStatement;\n    public SyntaxKind SimpleCommentTrivia => SyntaxKind.CommentTrivia;\n    public SyntaxKind SimpleMemberAccessExpression => SyntaxKind.SimpleMemberAccessExpression;\n    public SyntaxKind[] StringLiteralExpressions => new[] { SyntaxKind.StringLiteralExpression };\n    public SyntaxKind StructDeclaration => SyntaxKind.StructureBlock;\n    public SyntaxKind SubtractExpression => SyntaxKind.SubtractExpression;\n    public SyntaxKind[] TypeDeclaration => new[] { SyntaxKind.ClassBlock, SyntaxKind.StructureBlock, SyntaxKind.InterfaceBlock, SyntaxKind.EnumBlock };\n    public SyntaxKind VariableDeclarator => SyntaxKind.VariableDeclarator;\n    public SyntaxKind[] LocalDeclarationKinds => [SyntaxKind.ModifiedIdentifier];\n    public SyntaxKind WhitespaceTrivia => SyntaxKind.WhitespaceTrivia;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Facade/Implementation/VisualBasicTrackerFacade.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\nusing SonarAnalyzer.VisualBasic.Core.Trackers;\n\nnamespace SonarAnalyzer.VisualBasic.Core.Facade.Implementation;\n\ninternal sealed class VisualBasicTrackerFacade : ITrackerFacade<SyntaxKind>\n{\n    public ArgumentTracker<SyntaxKind> Argument => new VisualBasicArgumentTracker();\n    public BaseTypeTracker<SyntaxKind> BaseType { get; } = new VisualBasicBaseTypeTracker();\n    public ElementAccessTracker<SyntaxKind> ElementAccess { get; } = new VisualBasicElementAccessTracker();\n    public FieldAccessTracker<SyntaxKind> FieldAccess { get; } = new VisualBasicFieldAccessTracker();\n    public InvocationTracker<SyntaxKind> Invocation { get; } = new VisualBasicInvocationTracker();\n    public MethodDeclarationTracker<SyntaxKind> MethodDeclaration { get; } = new VisualBasicMethodDeclarationTracker();\n    public ObjectCreationTracker<SyntaxKind> ObjectCreation { get; } = new VisualBasicObjectCreationTracker();\n    public PropertyAccessTracker<SyntaxKind> PropertyAccess { get; } = new VisualBasicPropertyAccessTracker();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Facade/VisualBasicFacade.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\nusing SonarAnalyzer.VisualBasic.Core.Facade.Implementation;\nusing SonarAnalyzer.VisualBasic.Core.Trackers;\n\nnamespace SonarAnalyzer.VisualBasic.Core.Facade;\n\npublic sealed class VisualBasicFacade : ILanguageFacade<SyntaxKind>\n{\n    private static readonly Lazy<VisualBasicFacade> Singleton = new(() => new VisualBasicFacade());\n    private static readonly Lazy<AssignmentFinder> AssignmentFinderLazy = new(() => new VisualBasicAssignmentFinder());\n    private static readonly Lazy<IExpressionNumericConverter> ExpressionNumericConverterLazy = new(() => new VisualBasicExpressionNumericConverter());\n    private static readonly Lazy<SyntaxFacade<SyntaxKind>> SyntaxLazy = new(() => new VisualBasicSyntaxFacade());\n    private static readonly Lazy<ISyntaxKindFacade<SyntaxKind>> SyntaxKindLazy = new(() => new VisualBasicSyntaxKindFacade());\n    private static readonly Lazy<ITrackerFacade<SyntaxKind>> TrackerLazy = new(() => new VisualBasicTrackerFacade());\n\n    public static VisualBasicFacade Instance => Singleton.Value;\n\n    public AssignmentFinder AssignmentFinder => AssignmentFinderLazy.Value;\n    public StringComparison NameComparison => StringComparison.OrdinalIgnoreCase;\n    public StringComparer NameComparer => StringComparer.OrdinalIgnoreCase;\n    public GeneratedCodeRecognizer GeneratedCodeRecognizer => VisualBasicGeneratedCodeRecognizer.Instance;\n    public IExpressionNumericConverter ExpressionNumericConverter => ExpressionNumericConverterLazy.Value;\n    public SyntaxFacade<SyntaxKind> Syntax => SyntaxLazy.Value;\n    public ISyntaxKindFacade<SyntaxKind> SyntaxKind => SyntaxKindLazy.Value;\n    public ITrackerFacade<SyntaxKind> Tracker => TrackerLazy.Value;\n\n    private VisualBasicFacade() { }\n\n    public DiagnosticDescriptor CreateDescriptor(string id, string messageFormat, bool? isEnabledByDefault = null, bool fadeOutCode = false) =>\n        DescriptorFactory.Create(id, messageFormat, isEnabledByDefault, fadeOutCode);\n\n    public object FindConstantValue(SemanticModel model, SyntaxNode node) =>\n        node.FindConstantValue(model);\n\n    public IMethodParameterLookup MethodParameterLookup(SyntaxNode invocation, IMethodSymbol methodSymbol) =>\n        invocation switch\n        {\n            null => null,\n            AttributeSyntax x => new VisualBasicAttributeParameterLookup(x.ArgumentList.Arguments, methodSymbol),\n            IdentifierNameSyntax\n            {\n                Parent: NameColonEqualsSyntax { Parent: SimpleArgumentSyntax { IsNamed: true, Parent.Parent: AttributeSyntax attribute } }\n            } => new VisualBasicAttributeParameterLookup(attribute.ArgumentList.Arguments, methodSymbol),\n            _ => new VisualBasicMethodParameterLookup(invocation.ArgumentList(), methodSymbol),\n        };\n\n    public IMethodParameterLookup MethodParameterLookup(SyntaxNode invocation, SemanticModel model) =>\n        invocation?.ArgumentList() is { } argumentList\n            ? new VisualBasicMethodParameterLookup(argumentList, model)\n            : null;\n\n    public string GetName(SyntaxNode expression) =>\n        expression.GetName();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Properties/AssemblyInfo.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Runtime.CompilerServices;\n\n[assembly: InternalsVisibleTo(\"SonarAnalyzer.Test\")]\n[assembly: InternalsVisibleTo(\"SonarAnalyzer.VisualBasic.Core.Test\")]\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/SonarAnalyzer.VisualBasic.Core.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFramework>netstandard2.0</TargetFramework>\n    <DefineConstants>$(DefineConstants);VB</DefineConstants>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Microsoft.CodeAnalysis.VisualBasic.Workspaces\" Version=\"1.3.2\" />\n    <PackageReference Include=\"System.Collections.Immutable\" Version=\"1.1.37\">\n      <!-- Downgrade System.Collections.Immutable to support VS2015 Update 3 -->\n      <NoWarn>NU1605, NU1701</NoWarn>\n    </PackageReference>\n  </ItemGroup>\n\n  <Import Project=\"..\\SonarAnalyzer.Shared\\SonarAnalyzer.Shared.projitems\" Label=\"Shared\" />\n\n  <ItemGroup>\n    <!-- We need to update NuGet and JAR packaging after changing references -->\n    <ProjectReference Include=\"..\\SonarAnalyzer.CFG\\SonarAnalyzer.CFG.csproj\" />\n    <ProjectReference Include=\"..\\SonarAnalyzer.Core\\SonarAnalyzer.Core.csproj\" />\n    <ProjectReference Include=\"..\\SonarAnalyzer.SourceGenerators\\SonarAnalyzer.SourceGenerators.csproj\" SetTargetFramework=\"TargetFramework=netstandard2.0\" OutputItemType=\"Analyzer\" ReferenceOutputAssembly=\"false\" />\n  </ItemGroup>\n\n  <PropertyGroup>\n    <RSpecLanguage>vbnet</RSpecLanguage>\n  </PropertyGroup>\n  <Import Project=\"../RuleCatalog.targets\" />\n\n  <ItemGroup>\n    <Using Include=\"Microsoft.CodeAnalysis\" />\n    <Using Include=\"Microsoft.CodeAnalysis.Diagnostics\" />\n    <Using Include=\"Microsoft.CodeAnalysis.Shared.Extensions\" />\n    <Using Include=\"Microsoft.CodeAnalysis.VisualBasic\" />\n    <Using Include=\"Microsoft.CodeAnalysis.VisualBasic.Syntax\" />\n    <Using Include=\"Microsoft.CodeAnalysis.VisualBasic.Extensions\" />\n    <Using Include=\"SonarAnalyzer.Core.AnalysisContext\" />\n    <Using Include=\"SonarAnalyzer.Core.Analyzers\" />\n    <Using Include=\"SonarAnalyzer.Core.Common\" />\n    <Using Include=\"SonarAnalyzer.Core.Extensions\" />\n    <Using Include=\"SonarAnalyzer.Core.Facade\" />\n    <Using Include=\"SonarAnalyzer.Core.Semantics\" />\n    <Using Include=\"SonarAnalyzer.Core.Semantics.Extensions\" />\n    <Using Include=\"SonarAnalyzer.Core.Syntax.Extensions\" />\n    <Using Include=\"SonarAnalyzer.Core.Syntax.Utilities\" />\n    <Using Include=\"SonarAnalyzer.VisualBasic.Core.Common\" />\n    <Using Include=\"SonarAnalyzer.VisualBasic.Core.Extensions\" />\n    <Using Include=\"SonarAnalyzer.VisualBasic.Core.Facade\" />\n    <Using Include=\"SonarAnalyzer.VisualBasic.Core.Syntax.Extensions\" />\n    <Using Include=\"SonarAnalyzer.VisualBasic.Core.Syntax.Utilities\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Syntax/Extensions/ArgumentListSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Core.Syntax.Extensions;\n\npublic static class ArgumentListSyntaxExtensions\n{\n    public static ExpressionSyntax Get(this ArgumentListSyntax argumentList, int index) =>\n        argumentList is not null && argumentList.Arguments.Count > index\n            ? argumentList.Arguments[index].GetExpression().RemoveParentheses()\n            : null;\n\n    /// <summary>\n    /// Returns argument expressions for given parameter.\n    ///\n    /// There can be zero, one or more results based on parameter type (Optional or ParamArray/params).\n    /// </summary>\n    public static ImmutableArray<SyntaxNode> ArgumentValuesForParameter(this ArgumentListSyntax argumentList, SemanticModel model, string parameterName) =>\n        argumentList is not null\n            && new VisualBasicMethodParameterLookup(argumentList, model).TryGetSyntax(parameterName, out var expressions)\n                ? expressions\n                : ImmutableArray<SyntaxNode>.Empty;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Syntax/Extensions/ArgumentSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Core.Syntax.Extensions;\n\npublic static class ArgumentSyntaxExtensions\n{\n    internal static int? GetArgumentIndex(this ArgumentSyntax argument) =>\n        (argument.Parent as ArgumentListSyntax)?.Arguments.IndexOf(argument);\n\n    internal static IEnumerable<ISymbol> GetSymbolsOfKnownType(this SeparatedSyntaxList<ArgumentSyntax> syntaxList, KnownType knownType, SemanticModel semanticModel) =>\n        syntaxList.GetArgumentsOfKnownType(knownType, semanticModel)\n                  .Select(argument => semanticModel.GetSymbolInfo(argument.GetExpression()).Symbol);\n\n    private static IEnumerable<ArgumentSyntax> GetArgumentsOfKnownType(this SeparatedSyntaxList<ArgumentSyntax> syntaxList, KnownType knownType, SemanticModel semanticModel) =>\n        syntaxList.Where(argument => semanticModel.GetTypeInfo(argument.GetExpression()).Type.Is(knownType));\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Syntax/Extensions/AttributeSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Core.Syntax.Extensions;\n\ninternal static class AttributeSyntaxExtensions\n{\n    private const int AttributeLength = 9;\n\n    public static bool IsKnownType(this AttributeSyntax attribute, KnownType knownType, SemanticModel semanticModel) =>\n        attribute.Name.GetName().Contains(GetShortNameWithoutAttributeSuffix(knownType))\n        && ((SyntaxNode)attribute).IsKnownType(knownType, semanticModel);\n\n    private static string GetShortNameWithoutAttributeSuffix(KnownType knownType) =>\n        knownType.TypeName == nameof(Attribute) || !knownType.TypeName.EndsWith(nameof(Attribute))\n            ? knownType.TypeName\n            : knownType.TypeName.Remove(knownType.TypeName.Length - AttributeLength);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Syntax/Extensions/ExpressionSyntaxExtensions.Roslyn.cs",
    "content": "﻿// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// See the LICENSE file in the project root for more information.\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace Microsoft.CodeAnalysis.VisualBasic.Extensions;\n\n[ExcludeFromCodeCoverage]\ninternal static class ExpressionSyntaxExtensions\n{\n    /// <summary>\n    /// Returns <see langword=\"true\"/> if <paramref name=\"expression\"/> represents a node where a value is written to, like on the left side of an assignment expression. This method\n    /// also returns <see langword=\"true\"/> for potentially writeable expressions, like <see langword=\"ref\"/> parameters.\n    /// See also <seealso cref=\"IsOnlyWrittenTo(ExpressionSyntax)\"/>.\n    /// </summary>\n    /// <remarks>\n    /// Copied from <seealso href=\"https://github.com/dotnet/roslyn/blob/5a1cc5f83e4baba57f0355a685a5d1f487bfac66/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Extensions/ExpressionSyntaxExtensions.vb#L362\"/>\n    /// </remarks>\n    public static bool IsWrittenTo(this ExpressionSyntax expression, SemanticModel semanticModel, CancellationToken cancellationToken)\n    {\n        if (expression == null)\n            return false;\n\n        if (expression.IsOnlyWrittenTo())\n            return true;\n\n        if (expression.IsRightSideOfDot())\n            expression = expression.Parent as ExpressionSyntax;\n\n        if (expression != null)\n        {\n            if (expression.IsInRefContext(semanticModel, cancellationToken))\n                return true;\n\n            if (expression.Parent is AssignmentStatementSyntax)\n            {\n                var assignmentStatement = (AssignmentStatementSyntax)expression.Parent;\n                if (expression == assignmentStatement.Left)\n                    return true;\n            }\n\n            if (expression.IsChildNode<NamedFieldInitializerSyntax>(n => n.Name))\n                return true;\n\n            // Extension method with a 'ref' parameter can write to the value it is called on.\n            if (expression.Parent is MemberAccessExpressionSyntax)\n            {\n                var memberAccess = (MemberAccessExpressionSyntax)expression.Parent;\n                if (memberAccess.Expression == expression)\n                {\n                    var method = semanticModel.GetSymbolInfo(memberAccess, cancellationToken).Symbol as IMethodSymbol;\n                    if (method != null)\n                    {\n                        if (method.MethodKind == MethodKind.ReducedExtension && method.ReducedFrom.Parameters.Length > 0 && method.ReducedFrom.Parameters.First().RefKind == RefKind.Ref)\n                            return true;\n                    }\n                }\n            }\n\n            return false;\n        }\n\n        return false;\n    }\n\n    // Copy of\n    // https://github.com/dotnet/roslyn/blob/5a1cc5f83e4baba57f0355a685a5d1f487bfac66/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Extensions/ExpressionSyntaxExtensions.vb#L325\n    public static bool IsOnlyWrittenTo(this ExpressionSyntax expression)\n    {\n        if (expression.IsRightSideOfDot())\n            expression = expression.Parent as ExpressionSyntax;\n\n        if (expression != null)\n        {\n            // Sonar: IsInOutContext deleted because not relevant for VB\n            if (expression.IsParentKind(SyntaxKind.SimpleAssignmentStatement))\n            {\n                var assignmentStatement = (AssignmentStatementSyntax)expression.Parent;\n                if (expression == assignmentStatement.Left)\n                    return true;\n            }\n\n            if (expression.IsParentKind(SyntaxKind.NameColonEquals) && expression.Parent.IsParentKind(SyntaxKind.SimpleArgument))\n\n                // <C(Prop:=1)>\n                // this is only a write to Prop\n                return true;\n\n            if (expression.IsChildNode<NamedFieldInitializerSyntax>(n => n.Name))\n                return true;\n\n            return false;\n        }\n\n        return false;\n    }\n\n    // Copy of\n    // https://github.com/dotnet/roslyn/blob/5a1cc5f83e4baba57f0355a685a5d1f487bfac66/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Extensions/ExpressionSyntaxExtensions.vb#L73\n    public static bool IsRightSideOfDot(this ExpressionSyntax expression)\n    {\n        return expression.IsSimpleMemberAccessExpressionName() || expression.IsRightSideOfQualifiedName();\n    }\n\n    // Copy of\n    // https://github.com/dotnet/roslyn/blob/5a1cc5f83e4baba57f0355a685a5d1f487bfac66/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Extensions/ExpressionSyntaxExtensions.vb#L56\n    public static bool IsSimpleMemberAccessExpressionName(this ExpressionSyntax expression)\n    {\n        return expression.IsParentKind(SyntaxKind.SimpleMemberAccessExpression) && ((MemberAccessExpressionSyntax)expression.Parent).Name == expression;\n    }\n\n    // Copy of\n    // https://github.com/dotnet/roslyn/blob/5a1cc5f83e4baba57f0355a685a5d1f487bfac66/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Extensions/ExpressionSyntaxExtensions.vb#L78\n    public static bool IsRightSideOfQualifiedName(this ExpressionSyntax expression)\n    {\n        return expression.IsParentKind(SyntaxKind.QualifiedName) && ((QualifiedNameSyntax)expression.Parent).Right == expression;\n    }\n\n    // Copy of\n    // https://github.com/dotnet/roslyn/blob/5a1cc5f83e4baba57f0355a685a5d1f487bfac66/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Extensions/ExpressionSyntaxExtensions.vb#L277\n    public static bool IsInRefContext(this ExpressionSyntax expression, SemanticModel semanticModel, CancellationToken cancellationToken)\n    {\n        var simpleArgument = expression?.Parent as SimpleArgumentSyntax;\n\n        if (simpleArgument == null)\n            return false;\n        else if (simpleArgument.IsNamed)\n        {\n            var info = semanticModel.GetSymbolInfo(simpleArgument.NameColonEquals.Name, cancellationToken);\n\n            var parameter = info.Symbol as IParameterSymbol;\n            return parameter != null && parameter.RefKind != RefKind.None;\n        }\n        else\n        {\n            var argumentList = simpleArgument.Parent as ArgumentListSyntax;\n\n            if (argumentList != null)\n            {\n                var parent = argumentList.Parent;\n                var index = argumentList.Arguments.IndexOf(simpleArgument);\n\n                var info = semanticModel.GetSymbolInfo(parent, cancellationToken);\n                var symbol = info.Symbol;\n\n                if (symbol is IMethodSymbol)\n                {\n                    var method = (IMethodSymbol)symbol;\n                    if (index < method.Parameters.Length)\n                        return method.Parameters[index].RefKind != RefKind.None;\n                }\n                else if (symbol is IPropertySymbol)\n                {\n                    var prop = (IPropertySymbol)symbol;\n                    if (index < prop.Parameters.Length)\n                        return prop.Parameters[index].RefKind != RefKind.None;\n                }\n            }\n        }\n\n        return false;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Syntax/Extensions/ExpressionSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Core.Syntax.Extensions;\n\npublic static class ExpressionSyntaxExtensions\n{\n    private static readonly HashSet<SyntaxKind> LiteralSyntaxKinds =\n        [\n            SyntaxKind.CharacterLiteralExpression,\n            SyntaxKind.FalseLiteralExpression,\n            SyntaxKind.NothingLiteralExpression,\n            SyntaxKind.NumericLiteralExpression,\n            SyntaxKind.StringLiteralExpression,\n            SyntaxKind.TrueLiteralExpression,\n        ];\n\n    extension(ExpressionSyntax expression)\n    {\n        public ExpressionSyntax SelfOrTopParenthesizedExpression => (ExpressionSyntax)SyntaxNodeExtensionsVisualBasic.GetSelfOrTopParenthesizedExpression(expression);\n\n        public bool IsOnBase => expression.IsOn(SyntaxKind.MyBaseExpression);\n\n        /// <summary>\n        /// On member access like operations, like <c>a.b</c>, c>a.b()</c>, or <c>a[b]</c>, the most left hand\n        /// member (<c>a</c>) is returned. <see langword=\"Me\"/> is skipped, so <c>this.a</c> returns <c>a</c>.\n        /// </summary>\n        public ExpressionSyntax LeftMostInMemberAccess =>\n            expression switch\n            {\n                IdentifierNameSyntax identifier => identifier,                                                                          // Prop\n                MemberAccessExpressionSyntax { Expression: IdentifierNameSyntax identifier } => identifier,                             // Prop.Something -> Prop\n                MemberAccessExpressionSyntax { Expression: MeExpressionSyntax, Name: IdentifierNameSyntax identifier } => identifier,   // this.Prop -> Prop\n                MemberAccessExpressionSyntax { Expression: PredefinedTypeSyntax predefinedType } => predefinedType,                     // int.MaxValue -> int\n                MemberAccessExpressionSyntax { Expression: { } left } => left.LeftMostInMemberAccess,                                   // Prop.Something.Something -> Prop\n                InvocationExpressionSyntax { Expression: { } left } => left.LeftMostInMemberAccess,                                     // Method() -> Method, also this.Method() and Method().Something\n                ConditionalAccessExpressionSyntax conditional => conditional.RootConditionalAccessExpression.Expression.LeftMostInMemberAccess, // a?.b -> a\n                ParenthesizedExpressionSyntax { Expression: { } inner } => inner.LeftMostInMemberAccess,                                // (a.b).c -> a\n                _ => null,\n            };\n\n        public ConditionalAccessExpressionSyntax RootConditionalAccessExpression =>\n            expression.AncestorsAndSelf().TakeWhile(x => x is ExpressionSyntax).OfType<ConditionalAccessExpressionSyntax>().LastOrDefault();\n\n        public bool IsLeftSideOfAssignment\n        {\n            get\n            {\n                var topParenthesizedExpression = expression.SelfOrTopParenthesizedExpression;\n                return topParenthesizedExpression.Parent.IsKind(SyntaxKind.SimpleAssignmentStatement)\n                    && topParenthesizedExpression.Parent is AssignmentStatementSyntax assignment\n                    && assignment.Left == topParenthesizedExpression;\n            }\n        }\n\n        public ExpressionSyntax RemoveParentheses() =>\n            (ExpressionSyntax)SyntaxNodeExtensionsVisualBasic.RemoveParentheses(expression);\n\n        public bool NameIs(string name) =>\n            expression.GetName().Equals(name, StringComparison.InvariantCultureIgnoreCase);\n\n        public bool HasConstantValue(SemanticModel model) =>\n            expression.RemoveParentheses().IsAnyKind(LiteralSyntaxKinds) || expression.FindConstantValue(model) is not null;\n\n        private bool IsOn(SyntaxKind onKind) =>\n            expression switch\n            {\n                InvocationExpressionSyntax invocation => invocation.Expression.IsOn(onKind),\n                // This is a simplification as we don't check where the method is defined (so this could be this or base)\n                GlobalNameSyntax or GenericNameSyntax or IdentifierNameSyntax or QualifiedNameSyntax => true,\n                MemberAccessExpressionSyntax memberAccessExpression when memberAccessExpression.IsKind(SyntaxKind.SimpleMemberAccessExpression) =>\n                    memberAccessExpression.Expression.RemoveParentheses().IsKind(onKind),\n                ConditionalAccessExpressionSyntax conditionalAccess => conditionalAccess.Expression.RemoveParentheses().IsKind(onKind),\n                _ => false,\n            };\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Syntax/Extensions/InterpolatedStringExpressionSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Core.Syntax.Extensions;\n\npublic static class InterpolatedStringExpressionSyntaxExtensions\n{\n    public static string ContentsText(this InterpolatedStringExpressionSyntax interpolatedStringExpression) =>\n        interpolatedStringExpression.Contents.JoinStr(null, x => x.ToString());\n\n    public static string InterpolatedTextValue(this InterpolatedStringExpressionSyntax interpolatedStringExpression, SemanticModel model) =>\n        VisualBasicStringInterpolationConstantValueResolver.Instance.InterpolatedTextValue(interpolatedStringExpression, model);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Syntax/Extensions/InvocationExpressionSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Core.Syntax.Extensions;\n\npublic static class InvocationExpressionSyntaxExtensions\n{\n    public static bool IsMemberAccessOnKnownType(this InvocationExpressionSyntax invocation, string identifierName, KnownType knownType, SemanticModel semanticModel) =>\n        invocation.Expression is MemberAccessExpressionSyntax memberAccess\n        && memberAccess.IsMemberAccessOnKnownType(identifierName, knownType, semanticModel);\n\n    public static IEnumerable<ISymbol> GetArgumentSymbolsOfKnownType(this InvocationExpressionSyntax invocation, KnownType knownType, SemanticModel semanticModel) =>\n        invocation.ArgumentList.Arguments.GetSymbolsOfKnownType(knownType, semanticModel);\n\n    public static bool HasExactlyNArguments(this InvocationExpressionSyntax invocation, int count) =>\n        invocation?.ArgumentList is null\n            ? count == 0\n            : invocation.ArgumentList.Arguments.Count == count;\n\n    public static Pair<SyntaxNode, SyntaxNode> Operands(this InvocationExpressionSyntax invocation) =>\n        invocation is { Expression: MemberAccessExpressionSyntax access }\n            ? new(access.Expression ?? invocation.GetParentConditionalAccessExpression()?.Expression, access.Name)\n            : default;\n\n    public static SyntaxToken? GetMethodCallIdentifier(this InvocationExpressionSyntax invocation) =>\n        invocation?.Expression.GetIdentifier();\n\n    public static bool IsMethodInvocation(this InvocationExpressionSyntax expression, KnownType type, string methodName, SemanticModel semanticModel) =>\n        semanticModel.GetSymbolInfo(expression).Symbol is IMethodSymbol methodSymbol &&\n        methodSymbol.IsInType(type) &&\n        // vbnet is case insensitive\n        methodName.Equals(methodSymbol.Name, StringComparison.InvariantCultureIgnoreCase);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Syntax/Extensions/MemberAccessExpressionSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Core.Syntax.Extensions;\n\npublic static class MemberAccessExpressionSyntaxExtensions\n{\n    public static bool IsMemberAccessOnKnownType(this MemberAccessExpressionSyntax memberAccess, string name, KnownType knownType, SemanticModel semanticModel) =>\n        memberAccess.NameIs(name)\n        && semanticModel.GetSymbolInfo(memberAccess).Symbol is { } symbol\n        && symbol.ContainingType.DerivesFrom(knownType);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Syntax/Extensions/MethodBlockBaseSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Core.Syntax.Extensions;\n\npublic static class MethodBlockBaseSyntaxExtensions\n{\n    public static Location FindIdentifierLocation(this MethodBlockBaseSyntax methodBlockBase) =>\n        GetIdentifierOrDefault(methodBlockBase)?.GetLocation();\n\n    public static SyntaxToken? GetIdentifierOrDefault(this MethodBlockBaseSyntax methodBlockBase) =>\n        methodBlockBase?.BlockStatement switch\n        {\n            SubNewStatementSyntax subNewStatement => subNewStatement.NewKeyword,\n            MethodStatementSyntax methodStatement => methodStatement.Identifier,\n            _ => null,\n        };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Syntax/Extensions/MethodBlockSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Core.Syntax.Extensions;\n\npublic static class MethodBlockSyntaxExtensions\n{\n    public static bool IsShared(this MethodBlockSyntax methodBlock) =>\n        methodBlock.SubOrFunctionStatement.Modifiers.Any(SyntaxKind.SharedKeyword);\n\n    public static string GetIdentifierText(this MethodBlockSyntax method) =>\n        method.SubOrFunctionStatement.Identifier.ValueText;\n\n    public static SeparatedSyntaxList<ParameterSyntax>? GetParameters(this MethodBlockSyntax method) =>\n        method.BlockStatement?.ParameterList?.Parameters;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Syntax/Extensions/ObjectCreationExpressionSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Core.Syntax.Extensions;\n\ninternal static class ObjectCreationExpressionSyntaxExtensions\n{\n    public static SyntaxToken? GetObjectCreationTypeIdentifier(this ObjectCreationExpressionSyntax objectCreation) =>\n        objectCreation?.Type.GetIdentifier();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Syntax/Extensions/StatementSyntaxExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Core.Syntax.Extensions;\n\npublic static class StatementSyntaxExtensions\n{\n    extension(StatementSyntax currentStatement)\n    {\n        public StatementSyntax PrecedingStatement =>\n            currentStatement.Parent.ChildNodes()\n                .TakeWhile(x => x != currentStatement)\n                .LastOrDefault() as StatementSyntax;\n\n        public StatementSyntax SucceedingStatement =>\n            currentStatement.Parent.ChildNodes()\n                .SkipWhile(x => x != currentStatement)\n                .Skip(1)\n                .FirstOrDefault() as StatementSyntax;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Syntax/Extensions/SyntaxNodeExtensions.Roslyn.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace Microsoft.CodeAnalysis.VisualBasic.Extensions;\n\n[ExcludeFromCodeCoverage]\ninternal static class SyntaxNodeExtensions\n{\n    // Copied and converted from\n    // https://github.com/dotnet/roslyn/blob/5a1cc5f83e4baba57f0355a685a5d1f487bfac66/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Extensions/SyntaxNodeExtensions.vb#L16\n    public static bool IsParentKind(this SyntaxNode node, SyntaxKind kind)\n    {\n        return node != null && node.Parent.IsKind(kind);\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Syntax/Extensions/SyntaxNodeExtensionsVisualBasic.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CFG.Roslyn;\nusing SonarAnalyzer.VisualBasic.Core.Trackers;\n\nnamespace SonarAnalyzer.VisualBasic.Core.Syntax.Extensions;\n\npublic static class SyntaxNodeExtensionsVisualBasic\n{\n    private static readonly ControlFlowGraphCache CfgCache = new();\n\n    public static ControlFlowGraph CreateCfg(this SyntaxNode block, SemanticModel model, CancellationToken cancel) =>\n        CfgCache.FindOrCreate(block, model, cancel);\n\n    public static bool IsPartOfBinaryNegationOrCondition(this SyntaxNode node)\n    {\n        if (node.Parent is not MemberAccessExpressionSyntax)\n        {\n            return false;\n        }\n\n        var current = node;\n        while (current.Parent is not null && !current.Parent.IsAnyKind(SyntaxKind.IfStatement, SyntaxKind.WhileStatement))\n        {\n            current = current.Parent;\n        }\n\n        return current.Parent switch\n        {\n            IfStatementSyntax ifStatement => ifStatement.Condition == current,\n            WhileStatementSyntax whileStatement => whileStatement.Condition == current,\n            _ => false\n        };\n    }\n\n    public static object FindConstantValue(this SyntaxNode node, SemanticModel semanticModel) =>\n        new VisualBasicConstantValueFinder(semanticModel).FindConstant(node);\n\n    public static string FindStringConstant(this SyntaxNode node, SemanticModel semanticModel) =>\n        FindConstantValue(node, semanticModel) as string;\n\n    // This is a refactored version of internal Roslyn SyntaxNodeExtensions.IsInExpressionTree\n    public static bool IsInExpressionTree(this SyntaxNode node, SemanticModel model)\n    {\n        return node.AncestorsAndSelf().Any(x => IsExpressionLambda(x) || IsExpressionQuery(x));\n\n        bool IsExpressionLambda(SyntaxNode node) =>\n            node is LambdaExpressionSyntax && model.GetTypeInfo(node).ConvertedType.DerivesFrom(KnownType.System_Linq_Expressions_Expression);\n\n        bool IsExpressionQuery(SyntaxNode node) =>\n            node is OrderingSyntax or QueryClauseSyntax or FunctionAggregationSyntax or ExpressionRangeVariableSyntax && TakesExpressionTree(model.GetSymbolInfo(node));\n\n        static bool TakesExpressionTree(SymbolInfo info)\n        {\n            var symbols = info.Symbol is null ? info.CandidateSymbols : ImmutableArray.Create(info.Symbol);\n            return symbols.Any(x => x is IMethodSymbol method && method.Parameters.Length > 0 && method.Parameters[0].Type.DerivesFrom(KnownType.System_Linq_Expressions_Expression));\n        }\n    }\n\n    public static SyntaxToken? GetIdentifier(this SyntaxNode node) =>\n        node?.RemoveParentheses() switch\n        {\n            AttributeSyntax x => x.Name?.GetIdentifier(),\n            ClassBlockSyntax x => x.ClassStatement.Identifier,\n            ClassStatementSyntax x => x.Identifier,\n            IdentifierNameSyntax x => x.Identifier,\n            MemberAccessExpressionSyntax x => x.Name.Identifier,\n            MethodBlockSyntax x => x.SubOrFunctionStatement?.GetIdentifier(),\n            MethodStatementSyntax x => x.Identifier,\n            ModuleBlockSyntax x => x.ModuleStatement.Identifier,\n            EnumStatementSyntax x => x.Identifier,\n            EnumMemberDeclarationSyntax x => x.Identifier,\n            InvocationExpressionSyntax x => x.Expression?.GetIdentifier(),\n            ModifiedIdentifierSyntax x => x.Identifier,\n            ObjectCreationExpressionSyntax x => x.Type?.GetIdentifier(),\n            PredefinedTypeSyntax x => x.Keyword,\n            ParameterSyntax x => x.Identifier?.GetIdentifier(),\n            PropertyStatementSyntax x => x.Identifier,\n            SimpleArgumentSyntax x => x.NameColonEquals?.Name.Identifier,\n            SimpleNameSyntax x => x.Identifier,\n            StructureBlockSyntax x => x.StructureStatement.Identifier,\n            QualifiedNameSyntax x => x.Right.Identifier,\n            VariableDeclaratorSyntax x => x.Names.FirstOrDefault()?.Identifier,\n            _ => null,\n        };\n\n    // based on kind=\"ArgumentList\" in https://github.com/dotnet/roslyn/blob/main/src/Compilers/VisualBasic/Portable/Syntax/Syntax.xml\n    public static ArgumentListSyntax ArgumentList(this SyntaxNode node) =>\n        node switch\n        {\n            ArgumentListSyntax argumentList => argumentList,\n            ArrayCreationExpressionSyntax arrayCreation => arrayCreation.ArrayBounds,\n            AttributeSyntax attribute => attribute.ArgumentList,\n            InvocationExpressionSyntax invocation => invocation.ArgumentList,\n            MidExpressionSyntax mid => mid.ArgumentList,\n            ModifiedIdentifierSyntax modified => modified.ArrayBounds,\n            ObjectCreationExpressionSyntax creation => creation.ArgumentList,\n            RaiseEventStatementSyntax raise => raise.ArgumentList,\n            RedimClauseSyntax reDim => reDim.ArrayBounds,\n            null => null,\n            _ => throw new InvalidOperationException($\"The {nameof(node)} of kind {node.Kind()} does not have an {nameof(ArgumentList)}.\"),\n        };\n\n    /// <summary>\n    /// Returns the left hand side of a conditional access expression. Returns c in case like a?.b?[0].c?.d.e?.f if d is passed.\n    /// </summary>\n    /// <remarks>Adapted from\n    /// <seealso href=\"https://github.com/dotnet/roslyn/blob/adaa56d/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Extensions/SyntaxNodeExtensions.vb#L1003\">\n    /// Roslyn SyntaxNodeExtensions VB.NET version</seealso>.</remarks>\n    public static ConditionalAccessExpressionSyntax GetParentConditionalAccessExpression(this SyntaxNode node)\n    {\n        // Walk upwards based on the grammar/parser rules around ?. expressions (can be seen in\n        // LanguageParser.ParseConsequenceSyntax).\n\n        // These are the parts of the expression that the ?... expression can end with.  Specifically:\n        //\n        //  1.      x?.y.M()            // invocation\n        //  2.      x?.y[...];          // element access\n        //  3.      x?.y.z              // member access\n        //  4.      x?.y                // member binding\n        //  5.      x?[y]               // element binding\n        if (node.IsAnyMemberAccessExpressionName())\n        {\n            node = node.Parent;\n        }\n\n        // Effectively, if we're on the RHS of the ? we have to walk up the RHS spine first until we hit the first\n        // conditional access.\n        while (node is InvocationExpressionSyntax or MemberAccessExpressionSyntax or XmlMemberAccessExpressionSyntax\n               && node.Parent is not ConditionalAccessExpressionSyntax)\n        {\n            node = node.Parent;\n        }\n\n        // Two cases we have to care about:\n        //\n        //      1. a?.b.$$c.d        and\n        //      2. a?.b.$$c.d?.e...\n        //\n        // Note that `a?.b.$$c.d?.e.f?.g.h.i` falls into the same bucket as two.  i.e. the parts after `.e` are\n        // lower in the tree and are not seen as we walk upwards.\n        //\n        //\n        // To get the root ?. (the one after the `a`) we have to potentially consume the first ?. on the RHS of the\n        // right spine (i.e. the one after `d`).  Once we do this, we then see if that itself is on the RHS of a\n        // another conditional, and if so we hten return the one on the left.  i.e. for '2' this goes in this direction:\n        //\n        //      a?.b.$$c.d?.e           // it will do:\n        //           ----->\n        //       <---------\n        //\n        // Note that this only one CAE consumption on both sides.  GetRootConditionalAccessExpression can be used to\n        // get the root parent in a case like:\n        //\n        //      x?.y?.z?.a?.b.$$c.d?.e.f?.g.h.i         // it will do:\n        //                    ----->\n        //                <---------\n        //             <---\n        //          <---\n        //       <---\n        if (node.Parent is ConditionalAccessExpressionSyntax conditional1 && conditional1.Expression == node)\n        {\n            node = node.Parent;\n        }\n\n        if (node.Parent is ConditionalAccessExpressionSyntax conditional2 && conditional2.WhenNotNull == node)\n        {\n            node = node.Parent;\n        }\n\n        return node as ConditionalAccessExpressionSyntax;\n    }\n\n    public static bool IsAnyMemberAccessExpressionName(this SyntaxNode node) =>\n        node.Parent is MemberAccessExpressionSyntax memberAccess && memberAccess.Name == node;\n\n    public static bool IsTrue(this SyntaxNode node) =>\n        node switch\n        {\n            { RawKind: (int)SyntaxKind.TrueLiteralExpression } => true, // True\n            { RawKind: (int)SyntaxKind.NotExpression } => IsFalse(((UnaryExpressionSyntax)node).Operand), // Not False\n            _ => false,\n        };\n\n    public static bool IsFalse(this SyntaxNode node) =>\n        node switch\n        {\n            { RawKind: (int)SyntaxKind.FalseLiteralExpression } => true, // False\n            { RawKind: (int)SyntaxKind.NotExpression } => IsTrue(((UnaryExpressionSyntax)node).Operand), // Not True\n            _ => false,\n        };\n\n    public static SyntaxNode GetTopMostContainingMethod(this SyntaxNode node) =>\n        node.AncestorsAndSelf().LastOrDefault(x => x is MethodBaseSyntax || x is PropertyBlockSyntax);\n\n    public static SyntaxNode RemoveParentheses(this SyntaxNode expression)\n    {\n        var current = expression;\n        while (current is ParenthesizedExpressionSyntax parenthesized)\n        {\n            current = parenthesized.Expression;\n        }\n        return current;\n    }\n\n    public static SyntaxNode GetSelfOrTopParenthesizedExpression(this SyntaxNode node)\n    {\n        var current = node;\n        while (current?.Parent?.IsKind(SyntaxKind.ParenthesizedExpression) ?? false)\n        {\n            current = current.Parent;\n        }\n        return current;\n    }\n\n    public static bool HasAncestor(this SyntaxNode syntaxNode, params SyntaxKind[] syntaxKinds) =>\n        syntaxNode.Ancestors().Any(x => x.IsAnyKind(syntaxKinds));\n\n    public static bool IsNothingLiteral(this SyntaxNode syntaxNode) =>\n        syntaxNode is not null && syntaxNode.IsKind(SyntaxKind.NothingLiteralExpression);\n\n    [Obsolete(\"Either use '.Kind() is A or B' or the overload with the ISet instead.\")]\n    public static bool IsAnyKind(this SyntaxNode syntaxNode, params SyntaxKind[] syntaxKinds) =>\n       syntaxNode is not null && syntaxKinds.Contains((SyntaxKind)syntaxNode.RawKind);\n\n    public static bool IsAnyKind(this SyntaxNode syntaxNode, ISet<SyntaxKind> collection) =>\n        syntaxNode is not null && collection.Contains((SyntaxKind)syntaxNode.RawKind);\n\n    public static SyntaxNode GetFirstNonParenthesizedParent(this SyntaxNode node) =>\n        node.GetSelfOrTopParenthesizedExpression().Parent;\n\n    public static string GetName(this SyntaxNode expression) =>\n        expression.GetIdentifier()?.ValueText ?? string.Empty;\n\n    public static string StringValue(this SyntaxNode node, SemanticModel model) =>\n        node switch\n        {\n            LiteralExpressionSyntax literal when literal.IsKind(SyntaxKind.StringLiteralExpression) => literal.Token.ValueText,\n            InterpolatedStringExpressionSyntax expression => expression.InterpolatedTextValue(model) ?? expression.ContentsText(),\n            _ => null\n        };\n\n    public static bool AnyOfKind(this IEnumerable<SyntaxNode> nodes, SyntaxKind kind) =>\n        nodes.Any(x => x.RawKind == (int)kind);\n\n    private sealed class ControlFlowGraphCache : ControlFlowGraphCacheBase\n    {\n        protected override bool IsLocalFunction(SyntaxNode node) =>\n            false;\n\n        protected override bool HasNestedCfg(SyntaxNode node) =>\n            node is LambdaExpressionSyntax;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Syntax/Extensions/SyntaxTokenExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Core.Syntax.Extensions;\n\npublic static class SyntaxTokenExtensions\n{\n    public static bool IsAnyKind(this SyntaxToken token, ISet<SyntaxKind> collection) =>\n        collection.Contains((SyntaxKind)token.RawKind);\n\n    public static ComparisonKind ToComparisonKind(this SyntaxToken token) =>\n        token.Kind() switch\n        {\n            SyntaxKind.EqualsToken => ComparisonKind.Equals,\n            SyntaxKind.LessThanGreaterThanToken => ComparisonKind.NotEquals,\n            SyntaxKind.LessThanToken => ComparisonKind.LessThan,\n            SyntaxKind.LessThanEqualsToken => ComparisonKind.LessThanOrEqual,\n            SyntaxKind.GreaterThanToken => ComparisonKind.GreaterThan,\n            SyntaxKind.GreaterThanEqualsToken => ComparisonKind.GreaterThanOrEqual,\n            _ => ComparisonKind.None,\n        };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Syntax/Extensions/SyntaxTriviaExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Core.Syntax.Extensions;\n\npublic static class SyntaxTriviaExtensions\n{\n    private static readonly HashSet<SyntaxKind> CommentKinds =\n        [\n            SyntaxKind.CommentTrivia,\n            SyntaxKind.DocumentationCommentExteriorTrivia,\n            SyntaxKind.DocumentationCommentTrivia\n        ];\n\n    public static bool IsAnyKind(this SyntaxTrivia trivia, ISet<SyntaxKind> syntaxKinds) =>\n        syntaxKinds.Contains((SyntaxKind)trivia.RawKind);\n\n    public static bool IsComment(this SyntaxTrivia trivia) =>\n        trivia.IsAnyKind(CommentKinds);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Syntax/Extensions/VisualBasicCompilationExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Core.Syntax.Extensions;\n\npublic static class VisualBasicCompilationExtensions\n{\n    public static bool IsAtLeastLanguageVersion(this Compilation compilation, LanguageVersion languageVersion) =>\n        compilation.VB()?.LanguageVersion.CompareTo(languageVersion) >= 0;\n\n    public static VisualBasicCompilation VB(this Compilation compilation) => compilation as VisualBasicCompilation;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Syntax/Utilities/SafeVisualBasicSyntaxWalker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Core.Syntax.Utilities;\n\npublic class SafeVisualBasicSyntaxWalker : VisualBasicSyntaxWalker, ISafeSyntaxWalker\n{\n    public bool SafeVisit(SyntaxNode syntaxNode)\n    {\n        try\n        {\n            Visit(syntaxNode);\n            return true;\n        }\n        catch (InsufficientExecutionStackException)\n        {\n            // Roslyn walker overflows the stack when the depth of the call is around 2050.\n            // See https://github.com/SonarSource/sonar-dotnet/issues/2115\n            return false;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Syntax/Utilities/VisualBasicAttributeParameterLookup.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Core.Syntax.Utilities;\n\ninternal class VisualBasicAttributeParameterLookup(SeparatedSyntaxList<ArgumentSyntax> argumentList, IMethodSymbol methodSymbol) : MethodParameterLookupBase<ArgumentSyntax>(argumentList, methodSymbol)\n{\n    protected override SyntaxNode Expression(ArgumentSyntax argument) =>\n        argument.GetExpression();\n\n    protected override SyntaxToken? GetNameColonIdentifier(ArgumentSyntax argument) =>\n        null;\n\n    protected override SyntaxToken? GetNameEqualsIdentifier(ArgumentSyntax argument) =>\n        argument is SimpleArgumentSyntax { NameColonEquals.Name.Identifier: var identifier }\n            ? identifier\n            : null;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Syntax/Utilities/VisualBasicEquivalenceChecker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Core.Syntax.Utilities;\n\npublic static class VisualBasicEquivalenceChecker\n{\n    public static bool AreEquivalent(SyntaxNode node1, SyntaxNode node2) =>\n        EquivalenceChecker.AreEquivalent(node1, node2,\n            (n1, n2) => SyntaxFactory.AreEquivalent(n1, n2));\n\n    public static bool AreEquivalent(SyntaxList<SyntaxNode> nodeList1, SyntaxList<SyntaxNode> nodeList2) =>\n        EquivalenceChecker.AreEquivalent(nodeList1, nodeList2,\n            (n1, n2) => SyntaxFactory.AreEquivalent(n1, n2));\n}\n\npublic class VisualBasicSyntaxNodeEqualityComparer<T> : IEqualityComparer<T>, IEqualityComparer<SyntaxList<T>>\n    where T : SyntaxNode\n{\n    public bool Equals(T x, T y) =>\n        VisualBasicEquivalenceChecker.AreEquivalent(x, y);\n\n    public bool Equals(SyntaxList<T> x, SyntaxList<T> y) =>\n        VisualBasicEquivalenceChecker.AreEquivalent(x, y);\n\n    public int GetHashCode(T obj) =>\n        obj.GetType().FullName.GetHashCode();\n\n    public int GetHashCode(SyntaxList<T> obj) =>\n        (obj.Count + string.Join(\", \", obj.Select(x => x.GetType().FullName).Distinct())).GetHashCode();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Syntax/Utilities/VisualBasicExpressionNumericConverter.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Core.Syntax.Utilities;\n\ninternal class VisualBasicExpressionNumericConverter : ExpressionNumericConverterBase<LiteralExpressionSyntax, UnaryExpressionSyntax>\n{\n    private static readonly ISet<SyntaxKind> SupportedOperatorTokens = new HashSet<SyntaxKind>\n    {\n        SyntaxKind.MinusToken,\n        SyntaxKind.PlusToken\n    };\n\n    protected override object TokenValue(LiteralExpressionSyntax literalExpression) =>\n        literalExpression.Token.Value;\n\n    protected override SyntaxNode Operand(UnaryExpressionSyntax unaryExpression) =>\n        unaryExpression.Operand;\n\n    protected override bool IsSupportedOperator(UnaryExpressionSyntax unaryExpression) =>\n        SupportedOperatorTokens.Contains(unaryExpression.OperatorToken.Kind());\n\n    protected override bool IsMinusOperator(UnaryExpressionSyntax unaryExpression) =>\n        unaryExpression.OperatorToken.Kind() == SyntaxKind.MinusToken;\n\n    protected override SyntaxNode RemoveParentheses(SyntaxNode expression) =>\n        expression.RemoveParentheses();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Syntax/Utilities/VisualBasicGeneratedCodeRecognizer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Core.Syntax.Utilities;\n\npublic sealed class VisualBasicGeneratedCodeRecognizer : GeneratedCodeRecognizer\n{\n    #region Singleton implementation\n\n    private VisualBasicGeneratedCodeRecognizer()\n    {\n    }\n\n    private static readonly Lazy<VisualBasicGeneratedCodeRecognizer> Lazy = new Lazy<VisualBasicGeneratedCodeRecognizer>(() => new VisualBasicGeneratedCodeRecognizer());\n    public static VisualBasicGeneratedCodeRecognizer Instance => Lazy.Value;\n\n    #endregion Singleton implementation\n\n    protected override bool IsTriviaComment(SyntaxTrivia trivia) =>\n        trivia.IsKind(SyntaxKind.CommentTrivia);\n\n    protected override string GetAttributeName(SyntaxNode node) =>\n        node.IsKind(SyntaxKind.Attribute)\n            ? ((AttributeSyntax)node).Name.ToString()\n            : string.Empty;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Syntax/Utilities/VisualBasicMethodParameterLookup.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Core.Syntax.Utilities;\n\npublic class VisualBasicMethodParameterLookup : MethodParameterLookupBase<ArgumentSyntax>\n{\n    public VisualBasicMethodParameterLookup(InvocationExpressionSyntax invocation, SemanticModel semanticModel)\n        : this(invocation.ArgumentList, semanticModel) { }\n\n    public VisualBasicMethodParameterLookup(InvocationExpressionSyntax invocation, IMethodSymbol methodSymbol)\n        : this(invocation.ArgumentList, methodSymbol) { }\n\n    public VisualBasicMethodParameterLookup(ArgumentListSyntax argumentList, SemanticModel semanticModel)\n        : base(argumentList.Arguments, semanticModel.GetSymbolInfo(argumentList.Parent)) { }\n\n    public VisualBasicMethodParameterLookup(ArgumentListSyntax argumentList, IMethodSymbol methodSymbol)\n        : base(argumentList.Arguments, methodSymbol) { }\n\n    protected override SyntaxToken? GetNameColonIdentifier(ArgumentSyntax argument) =>\n        (argument as SimpleArgumentSyntax)?.NameColonEquals?.Name.Identifier;\n\n    protected override SyntaxToken? GetNameEqualsIdentifier(ArgumentSyntax argument) =>\n       null;\n\n    protected override SyntaxNode Expression(ArgumentSyntax argument) =>\n        argument.GetExpression();\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Syntax/Utilities/VisualBasicRemovableDeclarationCollector.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing NodeSymbolAndModel = SonarAnalyzer.Core.Common.NodeSymbolAndModel<Microsoft.CodeAnalysis.SyntaxNode, Microsoft.CodeAnalysis.ISymbol>;\n\nnamespace SonarAnalyzer.VisualBasic.Core.Syntax.Utilities;\n\npublic class VisualBasicRemovableDeclarationCollector : RemovableDeclarationCollectorBase<TypeBlockSyntax, TypeStatementSyntax, SyntaxKind>\n{\n    public VisualBasicRemovableDeclarationCollector(INamedTypeSymbol namedType, Compilation compilation) : base(namedType, compilation) { }\n\n    public static bool IsNodeStructOrClassDeclaration(SyntaxNode node) =>\n        node.IsKind(SyntaxKind.ClassBlock) || node.IsKind(SyntaxKind.StructureBlock);\n\n    public static bool IsNodeContainerTypeDeclaration(SyntaxNode node) =>\n        IsNodeStructOrClassDeclaration(node) || node.IsKind(SyntaxKind.InterfaceBlock);\n\n    protected override IEnumerable<SyntaxNode> MatchingDeclarations(NodeAndModel<TypeBlockSyntax> container, ISet<SyntaxKind> kinds) =>\n        container.Node.DescendantNodes(IsNodeContainerTypeDeclaration).Where(node => kinds.Contains(node.Kind()));\n\n    public override IEnumerable<NodeSymbolAndModel> RemovableFieldLikeDeclarations(ISet<SyntaxKind> kinds, Accessibility maxAccessibility)\n    {\n        var fieldLikeNodes = TypeDeclarations\n            .SelectMany(typeDeclaration => MatchingDeclarations(typeDeclaration, kinds)\n                .Select(x => new NodeAndModel<FieldDeclarationSyntax>((FieldDeclarationSyntax)x, typeDeclaration.Model)));\n\n        return fieldLikeNodes\n            .SelectMany(fieldLikeNode => fieldLikeNode.Node.Declarators.SelectMany(x => x.Names)\n                .Select(name => CreateNodeSymbolAndModel(name, fieldLikeNode.Model))\n                .Where(x => IsRemovable(x.Symbol, maxAccessibility)));\n    }\n\n    public override TypeBlockSyntax OwnerOfSubnodes(TypeStatementSyntax node) =>\n        node.Parent as TypeBlockSyntax;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Syntax/Utilities/VisualBasicStringInterpolationConstantValueResolver.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Core.Syntax.Utilities;\n\npublic class VisualBasicStringInterpolationConstantValueResolver : StringInterpolationConstantValueResolver<SyntaxKind,\n                                                                                                            InterpolatedStringExpressionSyntax,\n                                                                                                            InterpolatedStringContentSyntax,\n                                                                                                            InterpolationSyntax,\n                                                                                                            InterpolatedStringTextSyntax>\n{\n    private static readonly Lazy<VisualBasicStringInterpolationConstantValueResolver> Singleton = new(() => new VisualBasicStringInterpolationConstantValueResolver());\n\n    public static VisualBasicStringInterpolationConstantValueResolver Instance => Singleton.Value;\n\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override IEnumerable<InterpolatedStringContentSyntax> Contents(InterpolatedStringExpressionSyntax interpolatedStringExpression) =>\n        interpolatedStringExpression.Contents;\n\n    protected override SyntaxToken TextToken(InterpolatedStringTextSyntax interpolatedStringText) =>\n        interpolatedStringText.TextToken;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Syntax/Utilities/VisualBasicSyntaxClassifier.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CFG.Syntax.Utilities;\n\nnamespace SonarAnalyzer.VisualBasic.Core.Syntax.Utilities;\n\npublic sealed class VisualBasicSyntaxClassifier : SyntaxClassifierBase\n{\n    private static VisualBasicSyntaxClassifier instance;\n\n    public static VisualBasicSyntaxClassifier Instance => instance ??= new();\n\n    private VisualBasicSyntaxClassifier() { }\n\n    public override SyntaxNode MemberAccessExpression(SyntaxNode node) =>\n        (node as MemberAccessExpressionSyntax)?.Expression;\n\n    protected override bool IsStatement(SyntaxNode node) =>\n        node is StatementSyntax;\n\n    protected override SyntaxNode ParentLoopCondition(SyntaxNode node) =>\n        node.Parent switch\n        {\n            DoStatementSyntax doStatement => doStatement.WhileOrUntilClause,\n            LoopStatementSyntax loopStatement => loopStatement.WhileOrUntilClause,\n            ForBlockSyntax forBlock => forBlock.ForStatement,\n            ForEachStatementSyntax foreachStatement => foreachStatement.Expression,\n            WhileStatementSyntax whileStatement => whileStatement.Condition,\n            _ => null\n        };\n\n    protected override bool IsCfgBoundary(SyntaxNode node) =>\n        node is LambdaExpressionSyntax;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Trackers/VisualBasicArgumentTracker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.VisualBasic.Core.Trackers;\n\npublic class VisualBasicArgumentTracker : ArgumentTracker<SyntaxKind>\n{\n    protected override SyntaxKind[] TrackedSyntaxKinds => [SyntaxKind.SimpleArgument];\n\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override IReadOnlyCollection<SyntaxNode> ArgumentList(SyntaxNode argumentNode) =>\n        argumentNode is ArgumentSyntax { Parent: ArgumentListSyntax { Arguments: { } list } }\n            ? list\n            : null;\n\n    protected override int? Position(SyntaxNode argumentNode) =>\n        argumentNode is ArgumentSyntax { IsNamed: true }\n        ? null\n        : ArgumentList(argumentNode)?.IndexOf(x => x == argumentNode);\n\n    protected override RefKind? ArgumentRefKind(SyntaxNode argumentNode) =>\n        null;\n\n    protected override bool InvocationMatchesMemberKind(SyntaxNode invokedExpression, MemberKind memberKind) =>\n        memberKind switch\n        {\n            MemberKind.Method => invokedExpression is InvocationExpressionSyntax,\n            MemberKind.Constructor => invokedExpression is ObjectCreationExpressionSyntax,\n            MemberKind.Indexer => invokedExpression is InvocationExpressionSyntax,\n            MemberKind.Attribute => invokedExpression is AttributeSyntax,\n            _ => false,\n        };\n\n    protected override bool InvokedMemberMatches(SemanticModel model, SyntaxNode invokedExpression, MemberKind memberKind, Func<string, bool> invokedMemberNameConstraint) =>\n        invokedMemberNameConstraint(invokedExpression.GetName());\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Trackers/VisualBasicAssignmentFinder.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.VisualBasic.Core.Trackers;\n\npublic class VisualBasicAssignmentFinder : AssignmentFinder\n{\n    protected override SyntaxNode GetTopMostContainingMethod(SyntaxNode node) =>\n        node.GetTopMostContainingMethod();\n\n    /// <param name=\"anyAssignmentKind\">'true' will find any AssignmentExpressionSyntax like =, +=, -=, &=. 'false' will find only '=' SimpleAssignmentExpression.</param>\n    protected override bool IsAssignmentToIdentifier(SyntaxNode node, string identifierName, bool anyAssignmentKind, out SyntaxNode rightExpression)\n    {\n        if ((anyAssignmentKind || node.IsKind(SyntaxKind.SimpleAssignmentStatement))\n            && node is AssignmentStatementSyntax assignment\n            && assignment.Left.NameIs(identifierName))\n        {\n            rightExpression = assignment.Right;\n            return true;\n        }\n        rightExpression = null;\n        return false;\n    }\n\n    protected override bool IsIdentifierDeclaration(SyntaxNode node, string identifierName, out SyntaxNode initializer)\n    {\n        if (node is LocalDeclarationStatementSyntax declarationStatement\n            && declarationStatement.Declarators.SingleOrDefault(MatchesIdentifierName) is { } declaration)\n        {\n            initializer = declaration.Initializer?.Value ?? (declaration.AsClause as AsNewClauseSyntax)?.NewExpression;\n            return true;\n        }\n        initializer = null;\n        return false;\n\n        bool MatchesIdentifierName(VariableDeclaratorSyntax declarator) =>\n            declarator.Names.Any(n => identifierName.Equals(n.Identifier.ValueText, StringComparison.OrdinalIgnoreCase));\n    }\n\n    protected override bool IsLoop(SyntaxNode node) =>\n        node.IsAnyKind(SyntaxKind.ForBlock,\n                       SyntaxKind.ForEachBlock,\n                       SyntaxKind.WhileBlock,\n                       SyntaxKind.DoLoopUntilBlock,\n                       SyntaxKind.DoLoopWhileBlock,\n                       SyntaxKind.DoUntilLoopBlock,\n                       SyntaxKind.DoWhileLoopBlock);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Trackers/VisualBasicBaseTypeTracker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.VisualBasic.Core.Trackers;\n\npublic class VisualBasicBaseTypeTracker : BaseTypeTracker<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n    protected override SyntaxKind[] TrackedSyntaxKinds { get; } = new[] { SyntaxKind.InheritsStatement, SyntaxKind.ImplementsStatement };\n\n    protected override IEnumerable<SyntaxNode> GetBaseTypeNodes(SyntaxNode contextNode) =>\n        // VB has separate Inherits and Implements keywords so the base types\n        // are in separate lists under different types of syntax node.\n        // If a class both inherits and implements then this tracker will check\n        // the conditions against Inherits and Implements *separately*\n        // i.e. the conditions will be called twice\n        contextNode switch\n        {\n            InheritsStatementSyntax inherits => inherits.Types,\n            ImplementsStatementSyntax implements => implements.Types,\n            _ => Enumerable.Empty<SyntaxNode>(),\n        };\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Trackers/VisualBasicBuilderPatternCondition.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.VisualBasic.Core.Trackers;\n\npublic class VisualBasicBuilderPatternCondition : BuilderPatternCondition<SyntaxKind, InvocationExpressionSyntax>\n{\n    public VisualBasicBuilderPatternCondition(bool constructorIsSafe, params BuilderPatternDescriptor<SyntaxKind, InvocationExpressionSyntax>[] descriptors)\n        : base(constructorIsSafe, descriptors, new VisualBasicAssignmentFinder()) { }\n\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    protected override SyntaxNode GetExpression(InvocationExpressionSyntax node) =>\n        node.Expression;\n\n    protected override string GetIdentifierName(InvocationExpressionSyntax node) =>\n        node.Expression.GetName();\n\n    protected override bool IsMemberAccess(SyntaxNode node, out SyntaxNode memberAccessExpression)\n    {\n        if (node is MemberAccessExpressionSyntax memberAccess)\n        {\n            memberAccessExpression = memberAccess.Expression;\n            return true;\n        }\n        memberAccessExpression = null;\n        return false;\n    }\n\n    protected override bool IsObjectCreation(SyntaxNode node) =>\n        node is ObjectCreationExpressionSyntax;\n\n    protected override bool IsIdentifier(SyntaxNode node, out string identifierName)\n    {\n        if (node is IdentifierNameSyntax identifier)\n        {\n            identifierName = identifier.Identifier.ValueText;\n            return true;\n        }\n        identifierName = null;\n        return false;\n    }\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Trackers/VisualBasicConstantValueFinder.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.VisualBasic.Core.Trackers;\n\npublic class VisualBasicConstantValueFinder : ConstantValueFinder<IdentifierNameSyntax, VariableDeclaratorSyntax>\n{\n    public VisualBasicConstantValueFinder(SemanticModel semanticModel) : base(semanticModel, new VisualBasicAssignmentFinder(), (int)SyntaxKind.NothingLiteralExpression) { }\n\n    protected override string IdentifierName(IdentifierNameSyntax node) =>\n        node.Identifier.ValueText;\n\n    protected override SyntaxNode InitializerValue(VariableDeclaratorSyntax node) =>\n        node.Initializer?.Value;\n\n    protected override VariableDeclaratorSyntax VariableDeclarator(SyntaxNode node) =>\n        node?.Parent as VariableDeclaratorSyntax;\n\n    protected override bool IsPtrZero(SyntaxNode node) =>\n        node is MemberAccessExpressionSyntax memberAccess\n        && memberAccess.IsPtrZero(Model);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Trackers/VisualBasicElementAccessTracker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.VisualBasic.Core.Trackers;\n\npublic class VisualBasicElementAccessTracker : ElementAccessTracker<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n    protected override SyntaxKind[] TrackedSyntaxKinds { get; } = { SyntaxKind.InvocationExpression };\n\n    public override object AssignedValue(ElementAccessContext context) =>\n        context.Node.Ancestors().FirstOrDefault(x => x.IsKind(SyntaxKind.SimpleAssignmentStatement)) is AssignmentStatementSyntax assignment\n            ? assignment.Right.FindConstantValue(context.Model)\n            : null;\n\n    public override Condition ArgumentAtIndexEquals(int index, string value) =>\n        context => ((InvocationExpressionSyntax)context.Node).ArgumentList is { } argumentList\n                   && index < argumentList.Arguments.Count\n                   && argumentList.Arguments[index].GetExpression().FindStringConstant(context.Model) == value;\n\n    public override Condition MatchSetter() =>\n        context => ((ExpressionSyntax)context.Node).IsLeftSideOfAssignment;\n\n    public override Condition MatchProperty(MemberDescriptor member) =>\n        context => ((InvocationExpressionSyntax)context.Node).Expression is MemberAccessExpressionSyntax memberAccess\n                   && memberAccess.IsKind(SyntaxKind.SimpleMemberAccessExpression)\n                   && context.Model.GetTypeInfo(memberAccess.Expression) is TypeInfo enclosingClassType\n                   && member.IsMatch(memberAccess.Name.Identifier.ValueText, enclosingClassType.Type, Language.NameComparison);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Trackers/VisualBasicFieldAccessTracker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.VisualBasic.Core.Trackers;\n\npublic class VisualBasicFieldAccessTracker : FieldAccessTracker<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n    protected override SyntaxKind[] TrackedSyntaxKinds { get; } =\n        new[]\n        {\n            SyntaxKind.SimpleMemberAccessExpression,\n            SyntaxKind.IdentifierName\n        };\n\n    public override Condition WhenRead() =>\n        context => !((ExpressionSyntax)context.Node).IsLeftSideOfAssignment;\n\n    public override Condition MatchSet() =>\n        context => ((ExpressionSyntax)context.Node).IsLeftSideOfAssignment;\n\n    public override Condition AssignedValueIsConstant() =>\n        context =>\n        {\n            var assignment = (AssignmentStatementSyntax)context.Node.Ancestors().FirstOrDefault(ancestor => ancestor.IsKind(SyntaxKind.SimpleAssignmentStatement));\n            return assignment != null && assignment.Right.HasConstantValue(context.Model);\n        };\n\n    protected override bool IsIdentifierWithinMemberAccess(SyntaxNode expression) =>\n        expression.IsKind(SyntaxKind.IdentifierName)\n        && expression.Parent.IsKind(SyntaxKind.SimpleMemberAccessExpression);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Trackers/VisualBasicInvocationTracker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.VisualBasic.Core.Trackers;\n\npublic class VisualBasicInvocationTracker : InvocationTracker<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n    protected override SyntaxKind[] TrackedSyntaxKinds { get; } = [SyntaxKind.InvocationExpression, SyntaxKind.SimpleMemberAccessExpression];\n\n    public override Condition ArgumentAtIndexIsStringConstant(int index) =>\n        ArgumentAtIndexConformsTo(index, (argument, model) =>\n            argument.GetExpression().FindStringConstant(model) is not null);\n\n    public override Condition ArgumentAtIndexIsAny(int index, params string[] values) =>\n        ArgumentAtIndexConformsTo(index, (argument, model) =>\n            values.Contains(argument.GetExpression().FindStringConstant(model)));\n\n    public override Condition ArgumentAtIndexIs(int index, Func<SyntaxNode, SemanticModel, bool> predicate) =>\n        ArgumentAtIndexConformsTo(index, (argument, model) =>\n            predicate(argument, model));\n\n    public override Condition MatchProperty(MemberDescriptor member) =>\n        context => ((InvocationExpressionSyntax)context.Node).Expression is MemberAccessExpressionSyntax methodMemberAccess\n                    && methodMemberAccess.IsKind(SyntaxKind.SimpleMemberAccessExpression)\n                    && methodMemberAccess.Expression is MemberAccessExpressionSyntax propertyMemberAccess\n                    && propertyMemberAccess.IsKind(SyntaxKind.SimpleMemberAccessExpression)\n                    && context.Model.GetTypeInfo(propertyMemberAccess.Expression) is var enclosingClassType\n                    && member.IsMatch(propertyMemberAccess.Name.Identifier.ValueText, enclosingClassType.Type, Language.NameComparison);\n\n    public override object ConstArgumentForParameter(InvocationContext context, string parameterName)\n    {\n        var argumentList = ((InvocationExpressionSyntax)context.Node).ArgumentList;\n        var values = argumentList.ArgumentValuesForParameter(context.Model, parameterName);\n        return values.Length == 1 && values[0] is ExpressionSyntax valueSyntax\n            ? valueSyntax.FindConstantValue(context.Model)\n            : null;\n    }\n\n    protected override SyntaxNode NodeExpression(SyntaxNode node) =>\n        node switch\n        {\n            MemberAccessExpressionSyntax { Parent: InvocationExpressionSyntax } => null,    // Avoid duplicate handling, this is handled by InvocationExpression\n            MemberAccessExpressionSyntax => node,\n            _ => base.NodeExpression(node)\n        };\n\n    protected override SyntaxToken? ExpectedExpressionIdentifier(SyntaxNode expression) =>\n        ((ExpressionSyntax)expression).GetIdentifier();\n\n    private static Condition ArgumentAtIndexConformsTo(int index, Func<ArgumentSyntax, SemanticModel, bool> predicate) =>\n        context => context.Node is InvocationExpressionSyntax { ArgumentList: { } argumentList }\n                    && index < argumentList.Arguments.Count\n                    && argumentList.Arguments[index] is { } argument\n                    && predicate(argument, context.Model);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Trackers/VisualBasicMethodDeclarationTracker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.VisualBasic.Core.Trackers;\n\npublic class VisualBasicMethodDeclarationTracker : MethodDeclarationTracker<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    public override Condition ParameterAtIndexIsUsed(int index) =>\n        context =>\n        {\n            var parameterSymbol = context.MethodSymbol.Parameters.ElementAtOrDefault(0);\n            if (parameterSymbol == null)\n            {\n                return false;\n            }\n\n            var methodDeclaration = context.MethodSymbol.DeclaringSyntaxReferences\n                .Select(r => (MethodBlockSyntax)r.GetSyntax().Parent)\n                .FirstOrDefault(HasImplementation);\n\n            if (methodDeclaration == null)\n            {\n                return false;\n            }\n\n            var semanticModel = context.GetSemanticModel(methodDeclaration);\n\n            var descendantNodes = methodDeclaration.Statements\n                .SelectMany(statement => statement.DescendantNodes());\n\n            return descendantNodes.Any(\n                node =>\n                    node.IsKind(SyntaxKind.IdentifierName)\n                    && ((IdentifierNameSyntax)node).Identifier.ValueText == parameterSymbol.Name\n                    && parameterSymbol.Equals(semanticModel.GetSymbolInfo(node).Symbol));\n        };\n\n    protected override SyntaxToken? GetMethodIdentifier(SyntaxNode methodDeclaration) =>\n        methodDeclaration switch\n        {\n            SubNewStatementSyntax constructor => constructor.NewKeyword,\n            MethodStatementSyntax method => method.Identifier,\n            OperatorStatementSyntax op => op.OperatorToken,\n            _ => methodDeclaration?.Parent.Parent switch\n            {\n                EventBlockSyntax e => e.EventStatement.Identifier,\n                PropertyBlockSyntax p => p.PropertyStatement.Identifier,\n                _ => null\n            }\n        };\n\n    private static bool HasImplementation(MethodBlockSyntax methodBlock) =>\n        methodBlock.Statements.Count > 0;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Trackers/VisualBasicObjectCreationTracker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.VisualBasic.Core.Trackers;\n\npublic class VisualBasicObjectCreationTracker : ObjectCreationTracker<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n\n    public override Condition ArgumentAtIndexIsConst(int index) =>\n        context => ((ObjectCreationExpressionSyntax)context.Node).ArgumentList  is { } argumentList\n                   && argumentList.Arguments.Count > index\n                   && argumentList.Arguments[index].GetExpression().HasConstantValue(context.Model);\n\n    public override object ConstArgumentForParameter(ObjectCreationContext context, string parameterName) =>\n        ((ObjectCreationExpressionSyntax)context.Node).ArgumentList is { } argumentList\n            && argumentList.ArgumentValuesForParameter(context.Model, parameterName) is { Length: 1 } values\n            && values[0] is ExpressionSyntax valueSyntax\n                ? valueSyntax.FindConstantValue(context.Model)\n                : null;\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/Trackers/VisualBasicPropertyAccessTracker.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.VisualBasic.Core.Trackers;\n\npublic class VisualBasicPropertyAccessTracker : PropertyAccessTracker<SyntaxKind>\n{\n    protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\n    protected override SyntaxKind[] TrackedSyntaxKinds { get; } =\n        new[]\n        {\n            SyntaxKind.SimpleMemberAccessExpression,\n            SyntaxKind.IdentifierName\n        };\n\n    public override object AssignedValue(PropertyAccessContext context) =>\n        context.Node.Ancestors().FirstOrDefault(ancestor => ancestor.IsKind(SyntaxKind.SimpleAssignmentStatement)) is AssignmentStatementSyntax assignment\n            ? assignment.Right.FindConstantValue(context.Model)\n            : null;\n\n    public override Condition MatchGetter() =>\n        context => !((ExpressionSyntax)context.Node).IsLeftSideOfAssignment;\n\n    public override Condition MatchSetter() =>\n        context => ((ExpressionSyntax)context.Node).IsLeftSideOfAssignment;\n\n    public override Condition AssignedValueIsConstant() =>\n        context => AssignedValue(context) != null;\n\n    protected override bool IsIdentifierWithinMemberAccess(SyntaxNode expression) =>\n        expression.IsKind(SyntaxKind.IdentifierName) && expression.Parent.IsKind(SyntaxKind.SimpleMemberAccessExpression);\n}\n"
  },
  {
    "path": "analyzers/src/SonarAnalyzer.VisualBasic.Core/packages.lock.json",
    "content": "{\n  \"version\": 1,\n  \"dependencies\": {\n    \".NETStandard,Version=v2.0\": {\n      \"Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[3.3.1, )\",\n        \"resolved\": \"3.3.1\",\n        \"contentHash\": \"eT+kgNCDdTRbQ5WF6BGx1HI3D5jYfHteza/koefhWC2vNZGxObA74XxwWfg40dy3uUv7dn3OGKLK5GUPLroVog==\"\n      },\n      \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.3.2, )\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"I5Z2WBgFsx0G22Na1uVFPDkT6Ob4XI+g91GPN8JWldYUMlmIBcUDBfGmfr8oQPdUipvThpaU1x1xZrnNwRR8JA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.VisualBasic\": \"[1.3.2]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2]\"\n        }\n      },\n      \"NETStandard.Library\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[2.0.3, )\",\n        \"resolved\": \"2.0.3\",\n        \"contentHash\": \"st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.1.0\"\n        }\n      },\n      \"SonarAnalyzer.CSharp.Styling\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[10.21.0.135717, )\",\n        \"resolved\": \"10.21.0.135717\",\n        \"contentHash\": \"hl264jF539oB7m2jED5QGM345eFSiDAdoJc8TH0HM6L7ZeqT5TDqZDQeZ8IDP02dVIpH/Fhhn+HsGfEcj8ohyQ==\"\n      },\n      \"StyleCop.Analyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.2.0-beta.556, )\",\n        \"resolved\": \"1.2.0-beta.556\",\n        \"contentHash\": \"llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==\",\n        \"dependencies\": {\n          \"StyleCop.Analyzers.Unstable\": \"1.2.0.556\"\n        }\n      },\n      \"System.Collections.Immutable\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.1.37, )\",\n        \"resolved\": \"1.1.37\",\n        \"contentHash\": \"fTpqwZYBzoklTT+XjTRK8KxvmrGkYHzBiylCcKyQcxiOM8k+QvhNBxRvFHDWzy4OEP5f8/9n+xQ9mEgEXY+muA==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.0\",\n          \"System.Diagnostics.Debug\": \"4.0.0\",\n          \"System.Globalization\": \"4.0.0\",\n          \"System.Linq\": \"4.0.0\",\n          \"System.Resources.ResourceManager\": \"4.0.0\",\n          \"System.Runtime\": \"4.0.0\",\n          \"System.Runtime.Extensions\": \"4.0.0\",\n          \"System.Threading\": \"4.0.0\"\n        }\n      },\n      \"Google.Protobuf\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"3.6.1\",\n        \"contentHash\": \"741fGeDQjixBJaU2j+0CbrmZXsNJkTn/hWbOh4fLVXndHsCclJmWznCPWrJmPoZKvajBvAz3e8ECJOUvRtwjNQ==\",\n        \"dependencies\": {\n          \"NETStandard.Library\": \"1.6.1\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.1.0\",\n        \"contentHash\": \"HS3iRWZKcUw/8eZ/08GXKY2Bn7xNzQPzf8gRPHGSowX7u7XXu9i9YEaBeBNKUXWfI7qjvT2zXtLUvbN0hds8vg==\"\n      },\n      \"Microsoft.CodeAnalysis.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"lOinFNbjpCvkeYQHutjKi+CfsjoKu88wAFT6hAumSR/XJSJmmVGvmnbzCWW8kUJnDVrw1RrcqS8BzgPMj263og==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"1.1.0\",\n          \"System.AppContext\": \"4.1.0\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.Collections.Concurrent\": \"4.0.12\",\n          \"System.Collections.Immutable\": \"1.2.0\",\n          \"System.Console\": \"4.0.0\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Diagnostics.FileVersionInfo\": \"4.0.0\",\n          \"System.Diagnostics.StackTrace\": \"4.0.1\",\n          \"System.Diagnostics.Tools\": \"4.0.1\",\n          \"System.Dynamic.Runtime\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Linq.Expressions\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Metadata\": \"1.3.0\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Runtime.Numerics\": \"4.0.1\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.X509Certificates\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Text.Encoding.CodePages\": \"4.0.1\",\n          \"System.Text.Encoding.Extensions\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\",\n          \"System.Threading.Tasks.Parallel\": \"4.0.1\",\n          \"System.Threading.Thread\": \"4.0.0\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\",\n          \"System.Xml.XDocument\": \"4.0.11\",\n          \"System.Xml.XPath.XDocument\": \"4.0.1\",\n          \"System.Xml.XmlDocument\": \"4.0.1\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"GrYMp6ScZDOMR0fNn/Ce6SegNVFw1G/QRT/8FiKv7lAP+V6lEZx9e42n0FvFUgjjcKgcEJOI4muU6i+3LSvOBA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Common\": \"[1.3.2]\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp.Workspaces\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"MwGmrrPx3okEJuCogSn4TM3yTtJUDdmTt8RXpnjVo0dPund0YSAq4bHQQ9bxgArbrrapcopJmkb7UOLAvanXkg==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp\": \"[1.3.2]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2]\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.VisualBasic\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"yllH3rSYEc0bV15CJ2T9Jtx+tSXO5/OVNb+xofuWrACn65Q5VqeFBKgcbgwpyVY/98ypPcGQIWNQL2A/L1seJg==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Common\": \"1.3.2\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Workspaces.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.2\",\n        \"contentHash\": \"kvdo+rkImlx5MuBgkayl4OV3Mg8/qirUdYgCIfQ9EqN15QasJFlQXmDAtCGqpkK9sYLLO/VK+y+4mvKjfh/FOA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Common\": \"[1.3.2]\",\n          \"Microsoft.Composition\": \"1.0.27\"\n        }\n      },\n      \"Microsoft.Composition\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.27\",\n        \"contentHash\": \"pwu80Ohe7SBzZ6i69LVdzowp6V+LaVRzd5F7A6QlD42vQkX0oT7KXKWWPlM/S00w1gnMQMRnEdbtOV12z6rXdQ==\"\n      },\n      \"Microsoft.NETCore.Platforms\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.1.0\",\n        \"contentHash\": \"kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==\"\n      },\n      \"Microsoft.NETCore.Targets\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.1\",\n        \"contentHash\": \"rkn+fKobF/cbWfnnfBOQHKVKIOpxMZBvlSHkqDWgBpwGDcLRduvs3D9OLGeV6GWGvVwNlVi2CBbTjuPmtHvyNw==\"\n      },\n      \"runtime.native.System\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"QfS/nQI7k/BLgmLrw7qm7YBoULEvgWnPI+cYsbfCVFTW8Aj+i8JhccxcFMu1RWms0YZzF+UHguNBK4Qn89e2Sg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\"\n        }\n      },\n      \"runtime.native.System.Net.Http\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"Nh0UPZx2Vifh8r+J+H2jxifZUD3sBrmolgiFWJd2yiNrxO0xTa6bAw3YwRn1VOiSen/tUXMS31ttNItCZ6lKuA==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\"\n        }\n      },\n      \"runtime.native.System.Security.Cryptography\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"2CQK0jmO6Eu7ZeMgD+LOFbNJSXHFVQbCJJkEyEwowh1SCgYnrn9W9RykMfpeeVGw7h4IBvYikzpGUlmZTUafJw==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\"\n        }\n      },\n      \"StyleCop.Analyzers.Unstable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.2.0.556\",\n        \"contentHash\": \"zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==\"\n      },\n      \"System.AppContext\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"3QjO4jNV7PdKkmQAVp9atA+usVnKRwI3Kx1nMwJ93T0LcQfx7pKAYk0nKz5wn1oP5iqlhZuy6RXOFdhr7rDwow==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Collections\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"YUJGz6eFKqS0V//mLt25vFGrrCvOnsXjlvFQs+KimpwNxug9x0Pzy4PlFMU3Q2IzqAa9G2L4LsK3+9vCBK7oTg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Collections.Concurrent\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.12\",\n        \"contentHash\": \"2gBcbb3drMLgxlI0fBfxMA31ec6AEyYCHygGse4vxceJan8mRIWeKJ24BFzN7+bi/NFTgdIgufzb94LWO5EERQ==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Diagnostics.Tracing\": \"4.1.0\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Console\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"qSKUSOIiYA/a0g5XXdxFcUFmv1hNICBD7QZ0QhGYVipPIhvpiydY8VZqr1thmCXvmn8aipMg64zuanB4eotK9A==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\"\n        }\n      },\n      \"System.Diagnostics.Debug\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"w5U95fVKHY4G8ASs/K5iK3J5LY+/dLFd4vKejsnI/ZhBsWS9hQakfx3Zr7lRWKg4tAw9r4iktyvsTagWkqYCiw==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Diagnostics.FileVersionInfo\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"qjF74OTAU+mRhLaL4YSfiWy3vj6T3AOz8AW37l5zCwfbBfj0k7E94XnEsRaf2TnhE/7QaV6Hvqakoy2LoV8MVg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Reflection.Metadata\": \"1.3.0\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.InteropServices\": \"4.1.0\"\n        }\n      },\n      \"System.Diagnostics.StackTrace\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"6i2EbRq0lgGfiZ+FDf0gVaw9qeEU+7IS2+wbZJmFVpvVzVOgZEt0ScZtyenuBvs6iDYbGiF51bMAa0oDP/tujQ==\",\n        \"dependencies\": {\n          \"System.Collections.Immutable\": \"1.2.0\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Metadata\": \"1.3.0\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\"\n        }\n      },\n      \"System.Diagnostics.Tools\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"xBfJ8pnd4C17dWaC9FM6aShzbJcRNMChUMD42I6772KGGrqaFdumwhn9OdM68erj1ueNo3xdQ1EwiFjK5k8p0g==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Diagnostics.Tracing\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"vDN1PoMZCkkdNjvZLql592oYJZgS7URcJzJ7bxeBgGtx5UtR5leNm49VmfHGqIffX4FKacHbI3H6UyNSHQknBg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Dynamic.Runtime\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"db34f6LHYM0U0JpE+sOmjar27BnqTVkbLJhgfwMpTdgTigG/Hna3m2MYVwnFzGGKnEJk2UXFuoVTr8WUbU91/A==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Linq.Expressions\": \"4.1.0\",\n          \"System.ObjectModel\": \"4.0.12\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Emit\": \"4.0.1\",\n          \"System.Reflection.Emit.ILGeneration\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Reflection.TypeExtensions\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Globalization\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"B95h0YLEL2oSnwF/XjqSWKnwKOy/01VWkNlsCeMTFJLLabflpGV26nK164eRs5GiaRSBGpOxQ3pKoSnnyZN5pg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Globalization.Calendars\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"L1c6IqeQ88vuzC1P81JeHmHA8mxq8a18NUBNXnIY/BVb+TCyAaGIFbhpZt60h9FJNmisymoQkHEFSE9Vslja1Q==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.IO\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"3KlTJceQc3gnGIaHZ7UBZO26SHL1SHE4ddrmiwumFnId+CEHP+O8r386tZKaE6zlk5/mF8vifMBzHj9SaXN+mQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.IO.FileSystem\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"IBErlVq5jOggAD69bg1t0pJcHaDbJbWNUZTPI96fkYWzwYbN6D9wRHMULLDd9dHsl7C2YsxXL31LMfPI1SWt8w==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.IO.FileSystem.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"kWkKD203JJKxJeE74p8aF8y4Qc9r9WQx4C0cHzHPrY3fv/L/IhWnyCHaFJ3H1QPOH6A93whlQ2vG5nHlBDvzWQ==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Linq\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"bQ0iYFOQI0nuTnt+NQADns6ucV4DUvMdwN6CbkB1yj8i7arTGiTN5eok1kQwdnnNWSDZfIUySQY+J3d5KjWn0g==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\"\n        }\n      },\n      \"System.Linq.Expressions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"I+y02iqkgmCAyfbqOmSDOgqdZQ5tTj80Akm5BPSS8EeB0VGWdy6X1KCoYe8Pk6pwDoAKZUOdLVxnTJcExiv5zw==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.ObjectModel\": \"4.0.12\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Emit\": \"4.0.1\",\n          \"System.Reflection.Emit.ILGeneration\": \"4.0.1\",\n          \"System.Reflection.Emit.Lightweight\": \"4.0.1\",\n          \"System.Reflection.Extensions\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Reflection.TypeExtensions\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.ObjectModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.12\",\n        \"contentHash\": \"tAgJM1xt3ytyMoW4qn4wIqgJYm7L7TShRZG4+Q4Qsi2PCcj96pXN7nRywS9KkB3p/xDUjc2HSwP9SROyPYDYKQ==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Reflection\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"JCKANJ0TI7kzoQzuwB/OoJANy1Lg338B6+JVacPl4TpUwi3cReg3nMLplMq2uqYfHFQpKIlHAUVAJlImZz/4ng==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Emit\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"P2wqAj72fFjpP6wb9nSfDqNBMab+2ovzSDzUZK7MVIm54tBJEPr9jWfSjjoTpPwj1LeKcmX3vr0ttyjSSFM47g==\",\n        \"dependencies\": {\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Emit.ILGeneration\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Emit.ILGeneration\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"Ov6dU8Bu15Bc7zuqttgHF12J5lwSWyTf1S+FJouUXVMSqImLZzYaQ+vRr1rQ0OZ0HqsrwWl4dsKHELckQkVpgA==\",\n        \"dependencies\": {\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Emit.Lightweight\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"sSzHHXueZ5Uh0OLpUQprhr+ZYJrLPA2Cmr4gn0wj9+FftNKXx8RIMKvO9qnjk2ebPYUjZ+F2ulGdPOsvj+MEjA==\",\n        \"dependencies\": {\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Emit.ILGeneration\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"GYrtRsZcMuHF3sbmRHfMYpvxZoIN2bQGrYGerUiWLEkqdEUQZhH3TRSaC/oI4wO0II1RKBPlpIa1TOMxIcOOzQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.Metadata\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.3.0\",\n        \"contentHash\": \"jMSCxA4LSyKBGRDm/WtfkO03FkcgRzHxwvQRib1bm2GZ8ifKM1MX1al6breGCEQK280mdl9uQS7JNPXRYk90jw==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Collections.Immutable\": \"1.2.0\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Extensions\": \"4.0.1\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Text.Encoding.Extensions\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Reflection.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"4inTox4wTBaDhB7V3mPvp9XlCbeGYWVEM9/fXALd52vNEAVisc1BoVWQPuUuD0Ga//dNbA/WeMy9u9mzLxGTHQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Reflection.TypeExtensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"tsQ/ptQ3H5FYfON8lL4MxRk/8kFyE0A+tGPXmVP967cT/gzLHYxIejIYSxp4JmIeFHVP78g/F2FE1mUUTbDtrg==\",\n        \"dependencies\": {\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Resources.ResourceManager\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"TxwVeUNoTgUOdQ09gfTjvW411MF+w9MBYL7AtNVc+HtBCFlutPLhUCdZjNkjbhj3bNQWMdHboF0KIWEOjJssbA==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Runtime\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"v6c/4Yaa9uWsq+JMhnOFewrYkgdNHNG2eMKuNqRn8P733rNXeRCGvV5FkkjBXn2dbVkPXOsO0xjsEeM1q2zC0g==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\"\n        }\n      },\n      \"System.Runtime.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"CUOHjTT/vgP0qGW22U4/hDlOqXmcPq5YicBaXdUR2UiUoLwBT+olO6we4DVbq57jeX5uXH2uerVZhf0qGj+sVQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Runtime.Handles\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"nCJvEKguXEvk2ymk1gqj625vVnlK3/xdGzx0vOKicQkoquaTBJTP13AIYkocSUwHCLNBwUbXTqTWGDxBTWpt7g==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Runtime.InteropServices\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"16eu3kjHS633yYdkjwShDHZLRNMKVi/s0bY8ODiqJ2RfMhDMAwxZaUaWVnZ2P71kr/or+X9o/xFWtNqz8ivieQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Reflection.Primitives\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\"\n        }\n      },\n      \"System.Runtime.Numerics\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"+XbKFuzdmLP3d1o9pdHu2nxjNr2OEPqGzKeegPLCUMM71a0t50A/rOcIRmGs9wR7a8KuHX6hYs/7/TymIGLNqg==\",\n        \"dependencies\": {\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\"\n        }\n      },\n      \"System.Security.Cryptography.Algorithms\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.2.0\",\n        \"contentHash\": \"8JQFxbLVdrtIOKMDN38Fn0GWnqYZw/oMlwOUG/qz1jqChvyZlnUmu+0s7wLx7JYua/nAXoESpHA3iw11QFWhXg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Runtime.Numerics\": \"4.0.1\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"runtime.native.System.Security.Cryptography\": \"4.0.0\"\n        }\n      },\n      \"System.Security.Cryptography.Cng\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.2.0\",\n        \"contentHash\": \"cUJ2h+ZvONDe28Szw3st5dOHdjndhJzQ2WObDEXAWRPEQBtVItVoxbXM/OEsTthl3cNn2dk2k0I3y45igCQcLw==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\"\n        }\n      },\n      \"System.Security.Cryptography.Csp\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"/i1Usuo4PgAqgbPNC0NjbO3jPW//BoBlTpcWFD1EHVbidH21y4c1ap5bbEMSGAXjAShhMH4abi/K8fILrnu4BQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Security.Cryptography.Encoding\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"FbKgE5MbxSQMPcSVRgwM6bXN3GtyAh04NkV8E5zKCBE26X0vYW0UtTa2FIgkH33WVqBVxRgxljlVYumWtU+HcQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.Collections.Concurrent\": \"4.0.12\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"runtime.native.System.Security.Cryptography\": \"4.0.0\"\n        }\n      },\n      \"System.Security.Cryptography.OpenSsl\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"HUG/zNUJwEiLkoURDixzkzZdB5yGA5pQhDP93ArOpDPQMteURIGERRNzzoJlmTreLBWr5lkFSjjMSk8ySEpQMw==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Runtime.Numerics\": \"4.0.1\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"runtime.native.System.Security.Cryptography\": \"4.0.0\"\n        }\n      },\n      \"System.Security.Cryptography.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"Wkd7QryWYjkQclX0bngpntW5HSlMzeJU24UaLJQ7YTfI8ydAVAaU2J+HXLLABOVJlKTVvAeL0Aj39VeTe7L+oA==\",\n        \"dependencies\": {\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Security.Cryptography.X509Certificates\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"4HEfsQIKAhA1+ApNn729Gi09zh+lYWwyIuViihoMDWp1vQnEkL2ct7mAbhBlLYm+x/L4Rr/pyGge1lIY635e0w==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Globalization.Calendars\": \"4.0.1\",\n          \"System.IO\": \"4.1.0\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Runtime.Numerics\": \"4.0.1\",\n          \"System.Security.Cryptography.Algorithms\": \"4.2.0\",\n          \"System.Security.Cryptography.Cng\": \"4.2.0\",\n          \"System.Security.Cryptography.Csp\": \"4.0.0\",\n          \"System.Security.Cryptography.Encoding\": \"4.0.0\",\n          \"System.Security.Cryptography.OpenSsl\": \"4.0.0\",\n          \"System.Security.Cryptography.Primitives\": \"4.0.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\",\n          \"runtime.native.System\": \"4.0.0\",\n          \"runtime.native.System.Net.Http\": \"4.0.1\",\n          \"runtime.native.System.Security.Cryptography\": \"4.0.0\"\n        }\n      },\n      \"System.Text.Encoding\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"U3gGeMlDZXxCEiY4DwVLSacg+DFWCvoiX+JThA/rvw37Sqrku7sEFeVBBBMBnfB6FeZHsyDx85HlKL19x0HtZA==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Text.Encoding.CodePages\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"h4z6rrA/hxWf4655D18IIZ0eaLRa3tQC/j+e26W+VinIHY0l07iEXaAvO0YSYq3MvCjMYy8Zs5AdC1sxNQOB7Q==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.Handles\": \"4.0.1\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Text.Encoding.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"jtbiTDtvfLYgXn8PTfWI+SiBs51rrmO4AAckx4KR6vFK9Wzf6tI8kcRdsYQNwriUeQ1+CtQbM1W4cMbLXnj/OQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\"\n        }\n      },\n      \"System.Text.RegularExpressions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"i88YCXpRTjCnoSQZtdlHkAOx4KNNik4hMy83n0+Ftlb7jvV6ZiZWMpnEZHhjBp6hQVh8gWd/iKNPzlPF7iyA2g==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\"\n        }\n      },\n      \"System.Threading\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"N+3xqIcg3VDKyjwwCGaZ9HawG9aC6cSDI+s7ROma310GQo8vilFZa86hqKppwTHleR/G0sfOzhvgnUxWCR/DrQ==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Threading.Tasks\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"k1S4Gc6IGwtHGT8188RSeGaX86Qw/wnrgNLshJvsdNUOPP9etMmo8S07c+UlOAx4K/xLuN9ivA1bD0LVurtIxQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.0.1\",\n          \"Microsoft.NETCore.Targets\": \"1.0.1\",\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Threading.Tasks.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"pH4FZDsZQ/WmgJtN4LWYmRdJAEeVkyriSwrv2Teoe5FOU0Yxlb6II6GL8dBPOfRmutHGATduj3ooMt7dJ2+i+w==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Threading.Tasks.Parallel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"7Pc9t25bcynT9FpMvkUw4ZjYwUiGup/5cJFW72/5MgCG+np2cfVUMdh29u8d7onxX7d8PS3J+wL73zQRqkdrSA==\",\n        \"dependencies\": {\n          \"System.Collections.Concurrent\": \"4.0.12\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Diagnostics.Tracing\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Threading.Tasks\": \"4.0.11\"\n        }\n      },\n      \"System.Threading.Thread\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.0\",\n        \"contentHash\": \"gIdJqDXlOr5W9zeqFErLw3dsOsiShSCYtF9SEHitACycmvNvY8odf9kiKvp6V7aibc8C4HzzNBkWXjyfn7plbQ==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Xml.ReaderWriter\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"ZIiLPsf67YZ9zgr31vzrFaYQqxRPX9cVHjtPSnmx4eN6lbS/yEyYNr2vs1doGDEscF0tjCZFsk9yUg1sC9e8tg==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.IO.FileSystem.Primitives\": \"4.0.1\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Text.Encoding.Extensions\": \"4.0.11\",\n          \"System.Text.RegularExpressions\": \"4.1.0\",\n          \"System.Threading.Tasks\": \"4.0.11\",\n          \"System.Threading.Tasks.Extensions\": \"4.0.0\"\n        }\n      },\n      \"System.Xml.XDocument\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.11\",\n        \"contentHash\": \"Mk2mKmPi0nWaoiYeotq1dgeNK1fqWh61+EK+w4Wu8SWuTYLzpUnschb59bJtGywaPq7SmTuPf44wrXRwbIrukg==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Diagnostics.Tools\": \"4.0.1\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Reflection\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\"\n        }\n      },\n      \"System.Xml.XmlDocument\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"2eZu6IP+etFVBBFUFzw2w6J21DqIN5eL9Y8r8JfJWUmV28Z5P0SNU01oCisVHQgHsDhHPnmq2s1hJrJCFZWloQ==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Text.Encoding\": \"4.0.11\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\"\n        }\n      },\n      \"System.Xml.XPath\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"UWd1H+1IJ9Wlq5nognZ/XJdyj8qPE4XufBUkAW59ijsCPjZkZe0MUzKKJFBr+ZWBe5Wq1u1d5f2CYgE93uH7DA==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.0.11\",\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Globalization\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\"\n        }\n      },\n      \"System.Xml.XPath.XDocument\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.0.1\",\n        \"contentHash\": \"FLhdYJx4331oGovQypQ8JIw2kEmNzCsjVOVYY/16kZTUoquZG85oVn7yUhBE2OZt1yGPSXAL0HTEfzjlbNpM7Q==\",\n        \"dependencies\": {\n          \"System.Diagnostics.Debug\": \"4.0.11\",\n          \"System.Linq\": \"4.1.0\",\n          \"System.Resources.ResourceManager\": \"4.0.1\",\n          \"System.Runtime\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Threading\": \"4.0.11\",\n          \"System.Xml.ReaderWriter\": \"4.0.11\",\n          \"System.Xml.XDocument\": \"4.0.11\",\n          \"System.Xml.XPath\": \"4.0.1\"\n        }\n      },\n      \"sonaranalyzer.cfg\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer.Lightup\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.core\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Google.Protobuf\": \"[3.6.1, )\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.CFG\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer.lightup\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "analyzers/stylecop.json",
    "content": "{\n  \"$schema\": \"https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json\",\n  \"settings\": {\n    \"orderingRules\": {\n      \"usingDirectivesPlacement\": \"outsideNamespace\",\n      \"elementOrder\": [\n        \"constant\",\n        \"readonly\"\n      ]\n    },\n    \"layoutRules\": {\n      \"newlineAtEndOfFile\": \"require\"\n    }\n  }\n}\n"
  },
  {
    "path": "analyzers/tests/Directory.Build.targets",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project>\n  <Import Project=\"$(MSBuildThisFileDirectory)\\..\\Common.targets\" />\n\n  <PropertyGroup>\n    <!-- NuGet.Protocol (used by TestFramework) requires NuGet.Frameworks at runtime,\n         which conflicts with Microsoft.Build.Locator's MSBL001 check.\n         The MSBL001 warning is about potential assembly loading issues when MSBuildLocator\n         registers MSBuild assemblies, but NuGet.Frameworks is not an MSBuild assembly\n         and is safe to include at runtime. -->\n    <DisableMSBuildAssemblyCopyCheck>true</DisableMSBuildAssemblyCopyCheck>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"altcover\" Version=\"9.0.102\" />\n    <PackageReference Include=\"Combinatorial.MSTest\" Version=\"2.0.0\" />\n    <PackageReference Include=\"Microsoft.NET.Test.Sdk\" Version=\"18.4.0\" />\n    <PackageReference Include=\"MSTest.TestAdapter\" Version=\"4.2.1\" />\n    <PackageReference Include=\"MSTest.TestFramework\" Version=\"4.2.1\" />\n  </ItemGroup>\n\n  <!-- Explicit reference to ensure consistent lock files across platforms (Linux/Windows).\n       On Linux, this package is implicitly added for net48 targets, but not on Windows.\n       See: https://github.com/NuGet/Home/issues/9195 -->\n  <ItemGroup Condition=\"'$(TargetFramework)' == 'net48'\">\n    <PackageReference Include=\"Microsoft.NETFramework.ReferenceAssemblies\" Version=\"1.0.3\" PrivateAssets=\"All\" />\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "analyzers/tests/FrameworkMocks/src/Directory.Build.targets",
    "content": "<Project>\n  <!-- This file prevents build picking up the common Directory.Build.Targets from the root that imports ImplicitUsings and other stuff -->\n</Project>"
  },
  {
    "path": "analyzers/tests/FrameworkMocks/src/Mocks.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio Version 17\nVisualStudioVersion = 17.12.35527.113 d17.12\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"mscorlib\", \"Mscorlib3.5Mock\\mscorlib.csproj\", \"{ED2CFD01-54DB-4251-8A2D-FD005AE2F0B3}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"3.5\", \"3.5\", \"{EE67D0BB-112E-437F-BE6F-9B2F28560BB8}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"4.0\", \"4.0\", \"{103EC28B-25FF-4CC9-9588-F43A8A4D5789}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"mscorlib\", \"Mscorlib4.0Mock\\mscorlib.csproj\", \"{8FF129EE-F38C-4B15-9E4A-25BD50B22FF0}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"4.0-with-io\", \"4.0-with-io\", \"{F6BA4FFC-4130-4928-BA35-0E6397DDDFC7}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"mscorlib\", \"Mscorlib4.0MockWithIo\\mscorlib.csproj\", \"{C353F0EB-DA0B-4872-925B-827E69707513}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"4.8\", \"4.8\", \"{3BA66093-5811-41DB-AF8C-89EDB201B2C9}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"mscorlib\", \"Mscorlib4.8Mock\\mscorlib.csproj\", \"{4E22A2C7-6B61-42D6-83EE-E511BBF573AF}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Any CPU = Debug|Any CPU\n\t\tRelease|Any CPU = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{ED2CFD01-54DB-4251-8A2D-FD005AE2F0B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{ED2CFD01-54DB-4251-8A2D-FD005AE2F0B3}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{ED2CFD01-54DB-4251-8A2D-FD005AE2F0B3}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{ED2CFD01-54DB-4251-8A2D-FD005AE2F0B3}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{8FF129EE-F38C-4B15-9E4A-25BD50B22FF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{8FF129EE-F38C-4B15-9E4A-25BD50B22FF0}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{8FF129EE-F38C-4B15-9E4A-25BD50B22FF0}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{8FF129EE-F38C-4B15-9E4A-25BD50B22FF0}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{C353F0EB-DA0B-4872-925B-827E69707513}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{C353F0EB-DA0B-4872-925B-827E69707513}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{C353F0EB-DA0B-4872-925B-827E69707513}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{C353F0EB-DA0B-4872-925B-827E69707513}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{4E22A2C7-6B61-42D6-83EE-E511BBF573AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{4E22A2C7-6B61-42D6-83EE-E511BBF573AF}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{4E22A2C7-6B61-42D6-83EE-E511BBF573AF}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{4E22A2C7-6B61-42D6-83EE-E511BBF573AF}.Release|Any CPU.Build.0 = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\n\tGlobalSection(NestedProjects) = preSolution\n\t\t{ED2CFD01-54DB-4251-8A2D-FD005AE2F0B3} = {EE67D0BB-112E-437F-BE6F-9B2F28560BB8}\n\t\t{8FF129EE-F38C-4B15-9E4A-25BD50B22FF0} = {103EC28B-25FF-4CC9-9588-F43A8A4D5789}\n\t\t{C353F0EB-DA0B-4872-925B-827E69707513} = {F6BA4FFC-4130-4928-BA35-0E6397DDDFC7}\n\t\t{4E22A2C7-6B61-42D6-83EE-E511BBF573AF} = {3BA66093-5811-41DB-AF8C-89EDB201B2C9}\n\tEndGlobalSection\n\tGlobalSection(ExtensibilityGlobals) = postSolution\n\t\tSolutionGuid = {5C7D9932-C1AB-407E-B1CD-4971BDAE10F0}\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "analyzers/tests/FrameworkMocks/src/Mscorlib3.5Mock/Debugger.cs",
    "content": "﻿\nnamespace System.Diagnostics\n{\n    public class Debugger\n    {\n        public Debugger()\n        {\n\n        }\n\n        public string Foo()\n        {\n            return \"\";\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/FrameworkMocks/src/Mscorlib3.5Mock/mscorlib.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n  <PropertyGroup>\n    <TargetFramework>net35</TargetFramework>\n    <RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>\n  </PropertyGroup>\n</Project>\n"
  },
  {
    "path": "analyzers/tests/FrameworkMocks/src/Mscorlib3.5Mock/packages.lock.json",
    "content": "{\n  \"version\": 1,\n  \"dependencies\": {\n    \".NETFramework,Version=v3.5\": {\n      \"Microsoft.NETFramework.ReferenceAssemblies\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.0.3, )\",\n        \"resolved\": \"1.0.3\",\n        \"contentHash\": \"vUc9Npcs14QsyOD01tnv/m8sQUnGTGOw1BCmKcv77LBJY7OxhJ+zJF7UD/sCL3lYNFuqmQEVlkfS4Quif6FyYg==\",\n        \"dependencies\": {\n          \"Microsoft.NETFramework.ReferenceAssemblies.net35\": \"1.0.3\"\n        }\n      },\n      \"Microsoft.NETFramework.ReferenceAssemblies.net35\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.3\",\n        \"contentHash\": \"Mhbr13IGgsW4AHj50uAiVNMPWdvUPWePRsI4x1NiTkhHUc4rqi9XvY5xxBC4d56bJypQbxAZ8bPuZIpz+TjBVQ==\"\n      }\n    }\n  }\n}"
  },
  {
    "path": "analyzers/tests/FrameworkMocks/src/Mscorlib4.0Mock/Debugger.cs",
    "content": "﻿\nnamespace System.Diagnostics\n{\n    public class Debugger\n    {\n        [Obsolete]\n        public Debugger()\n        {\n\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/FrameworkMocks/src/Mscorlib4.0Mock/mscorlib.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n  <PropertyGroup>\n    <TargetFramework>net40</TargetFramework>\n    <RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>\n  </PropertyGroup>\n</Project>\n"
  },
  {
    "path": "analyzers/tests/FrameworkMocks/src/Mscorlib4.0Mock/packages.lock.json",
    "content": "{\n  \"version\": 1,\n  \"dependencies\": {\n    \".NETFramework,Version=v4.0\": {\n      \"Microsoft.NETFramework.ReferenceAssemblies\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.0.3, )\",\n        \"resolved\": \"1.0.3\",\n        \"contentHash\": \"vUc9Npcs14QsyOD01tnv/m8sQUnGTGOw1BCmKcv77LBJY7OxhJ+zJF7UD/sCL3lYNFuqmQEVlkfS4Quif6FyYg==\",\n        \"dependencies\": {\n          \"Microsoft.NETFramework.ReferenceAssemblies.net40\": \"1.0.3\"\n        }\n      },\n      \"Microsoft.NETFramework.ReferenceAssemblies.net40\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.3\",\n        \"contentHash\": \"3ctXnCpHdoYJNH9ATfXKwckkkdHvHc1Xls12QB9kf1tjh3b+VzxtiwpkZN4GxOawakfH6CJAkqhlDKSiz6Ujbg==\"\n      }\n    }\n  }\n}"
  },
  {
    "path": "analyzers/tests/FrameworkMocks/src/Mscorlib4.0MockWithIo/Debugger.cs",
    "content": "﻿\nnamespace System.Diagnostics\n{\n    public class Debugger\n    {\n        [Obsolete]\n        public Debugger()\n        {\n\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/FrameworkMocks/src/Mscorlib4.0MockWithIo/UnmanagedMemoryStream.cs",
    "content": "﻿namespace System.IO\n{\n    public class UnmanagedMemoryStream\n    {\n        // no FlushAsync\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/FrameworkMocks/src/Mscorlib4.0MockWithIo/mscorlib.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFramework>net40</TargetFramework>\n    <RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>\n  </PropertyGroup>\n</Project>\n"
  },
  {
    "path": "analyzers/tests/FrameworkMocks/src/Mscorlib4.0MockWithIo/packages.lock.json",
    "content": "{\n  \"version\": 1,\n  \"dependencies\": {\n    \".NETFramework,Version=v4.0\": {\n      \"Microsoft.NETFramework.ReferenceAssemblies\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.0.3, )\",\n        \"resolved\": \"1.0.3\",\n        \"contentHash\": \"vUc9Npcs14QsyOD01tnv/m8sQUnGTGOw1BCmKcv77LBJY7OxhJ+zJF7UD/sCL3lYNFuqmQEVlkfS4Quif6FyYg==\",\n        \"dependencies\": {\n          \"Microsoft.NETFramework.ReferenceAssemblies.net40\": \"1.0.3\"\n        }\n      },\n      \"Microsoft.NETFramework.ReferenceAssemblies.net40\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.3\",\n        \"contentHash\": \"3ctXnCpHdoYJNH9ATfXKwckkkdHvHc1Xls12QB9kf1tjh3b+VzxtiwpkZN4GxOawakfH6CJAkqhlDKSiz6Ujbg==\"\n      }\n    }\n  }\n}"
  },
  {
    "path": "analyzers/tests/FrameworkMocks/src/Mscorlib4.8Mock/Debugger.cs",
    "content": "﻿\nnamespace System.Diagnostics\n{\n    public class Debugger\n    {\n        [Obsolete]\n        public Debugger()\n        {\n\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/FrameworkMocks/src/Mscorlib4.8Mock/UnmanagedMemoryStream.cs",
    "content": "﻿namespace System.IO\n{\n    public class UnmanagedMemoryStream\n    {\n        public void FlushAsync() { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/FrameworkMocks/src/Mscorlib4.8Mock/mscorlib.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n  <PropertyGroup>\n    <TargetFramework>net48</TargetFramework>\n    <RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>\n  </PropertyGroup>\n</Project>\n"
  },
  {
    "path": "analyzers/tests/FrameworkMocks/src/Mscorlib4.8Mock/packages.lock.json",
    "content": "{\n  \"version\": 1,\n  \"dependencies\": {\n    \".NETFramework,Version=v4.8\": {}\n  }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Core.Test/Extensions/BaseArgumentListSyntaxExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Test.Extensions;\n\n[TestClass]\npublic class BaseArgumentListSyntaxExtensionsTest\n{\n    [TestMethod]\n    public void GivenEmptyList_GetArgumentByName_ReturnsNull() =>\n        CreateNamedArgumentList().GetArgumentByName(\"argument\").Should().BeNull();\n\n    [TestMethod]\n    public void GivenListWithAnotherNamedArgument_GetArgumentByName_ReturnsNull() =>\n        CreateNamedArgumentList(\"p1\").GetArgumentByName(\"p2\").Should().BeNull();\n\n    [TestMethod]\n    public void GivenListWithNamedArgument_GetArgumentByName_ReturnsArgument() =>\n        CreateNamedArgumentList(\"p1\").GetArgumentByName(\"p1\").Should().Match(x => ((ArgumentSyntax)x).NameColon.Name.Identifier.Text == \"p1\");\n\n    [TestMethod]\n    public void GivenListWithMultipleNamedArguments_GetArgumentByName_ReturnsArgument() =>\n        CreateNamedArgumentList(\"p1\", \"p2\", \"p3\").GetArgumentByName(\"p2\").Should().Match(x =>  ((ArgumentSyntax)x).NameColon.Name.Identifier.Text == \"p2\");\n\n    [TestMethod]\n    public void GivenListWithNotNamedArguments_GetArgumentByName_ReturnsNull() =>\n        SyntaxFactory.ArgumentList(SyntaxFactory.SeparatedList(\n                new[]\n                {\n                    CreateNotNamedArgument(\"p1\"),\n                    CreateNotNamedArgument(\"p2\")\n                }))\n            .GetArgumentByName(\"p1\")\n            .Should().BeNull();\n\n    [TestMethod]\n    public void GivenListWithMixedNotNamedAndNamedArguments_GetArgumentByName_ReturnsNull() =>\n        SyntaxFactory.ArgumentList(SyntaxFactory.SeparatedList(\n                new[]\n                {\n                    CreateNamedArgument(\"p1\"),\n                    CreateNotNamedArgument(\"p2\"),\n                    CreateNotNamedArgument(\"p3\")\n                }))\n            .GetArgumentByName(\"p1\")\n            .Should().Match(x =>  ((ArgumentSyntax)x).NameColon.Name.Identifier.Text == \"p1\");\n\n    private static ArgumentListSyntax CreateNamedArgumentList(params string[] names) =>\n        SyntaxFactory.ArgumentList(SyntaxFactory.SeparatedList(names.Select(CreateNamedArgument)));\n\n    private static ArgumentSyntax CreateNamedArgument(string name) =>\n        SyntaxFactory.Argument(SyntaxFactory.NameColon(name), SyntaxFactory.Token(SyntaxKind.None), SyntaxFactory.IdentifierName(name));\n\n    private static ArgumentSyntax CreateNotNamedArgument(string identifierName) =>\n        SyntaxFactory.Argument(SyntaxFactory.IdentifierName(identifierName));\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Core.Test/Extensions/BaseMethodDeclarationSyntaxExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;\n\nnamespace SonarAnalyzer.CSharp.Core.Test.Extensions;\n\n[TestClass]\npublic class BaseMethodDeclarationSyntaxExtensionsTest\n{\n    [TestMethod]\n    public void GivenNullMethodDeclaration_GetBodyDescendantNodes_ThrowsArgumentNullException()\n    {\n#if NETFRAMEWORK\n        var messageFormat = \"Value cannot be null.\" + Environment.NewLine + \"Parameter name: {0}\";\n#else\n        var messageFormat = \"Value cannot be null. (Parameter '{0}')\";\n#endif\n\n        BaseMethodDeclarationSyntax sut = null;\n\n        var exception = Assert.Throws<ArgumentNullException>(sut.GetBodyDescendantNodes);\n\n        exception.Message.Should().Be(string.Format(messageFormat, \"method\"));\n    }\n\n    [TestMethod]\n    [DynamicData(nameof(GetMethodDeclarationsAndExpectedBody))]\n    public void HasBodyOrExpressionBody(BaseMethodDeclarationSyntax methodDeclaration, SyntaxNode expectedBody)\n    {\n        var hasBody = methodDeclaration.HasBodyOrExpressionBody();\n        if (expectedBody is null)\n        {\n            hasBody.Should().BeFalse();\n        }\n        else\n        {\n            hasBody.Should().BeTrue();\n        }\n    }\n\n    [TestMethod]\n    [DynamicData(nameof(GetMethodDeclarationsAndExpectedBody), DynamicDataSourceType.Method)]\n    public void GetBodyOrExpressionBody(BaseMethodDeclarationSyntax methodDeclaration, SyntaxNode expectedBody) =>\n        methodDeclaration.GetBodyOrExpressionBody().Should().Be(expectedBody);\n\n    private static IEnumerable<object[]> GetMethodDeclarationsAndExpectedBody()\n    {\n        var methodWithBody = Method().WithBody(Block());\n        var expressionBody = ArrowExpressionClause(LiteralExpression(SyntaxKind.TrueLiteralExpression));\n        var methodWithExpressionBody = Method().WithExpressionBody(expressionBody);\n        var methodWithBoth = Method().WithBody(Block()).WithExpressionBody(expressionBody);\n\n        // Corresponds to (BaseMethodDeclarationSyntax methodDeclaration, SyntaxNode expectedBody)\n        yield return new object[] { null, null };\n        yield return new object[] { Method(), null };\n        yield return new object[] { methodWithBody, methodWithBody.Body };\n        yield return new object[] { methodWithExpressionBody, methodWithExpressionBody.ExpressionBody.Expression };\n        yield return new object[] { methodWithBoth, methodWithBoth.Body };\n\n        static BaseMethodDeclarationSyntax Method() =>\n            MethodDeclaration(PredefinedType(Token(SyntaxKind.BoolKeyword)), \"Test\");\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Core.Test/Extensions/ISymbolExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing ISymbolExtensionsCS = SonarAnalyzer.CSharp.Core.Extensions.ISymbolExtensions;\n\nnamespace SonarAnalyzer.Test.Extensions;\n\n[TestClass]\npublic class ISymbolExtensionsTest\n{\n    [TestMethod]\n    [DataRow(\"class SymbolMember();\", true)]\n    [DataRow(\"class SymbolMember() { }\", true)]\n    [DataRow(\"class SymbolMember(int a) { }\", true)]\n    [DataRow(\"class SymbolMember { }\", false)]\n    [DataRow(\"class SymbolMember(int a) { @SymbolMember() : this(1) { } };\", true)]\n    [DataRow(\"class SymbolMember { SymbolMember() { } };\", false)]\n    [DataRow(\"class Base(int i); class SymbolMember() : Base(1);\", true)]\n    [DataRow(\"\"\"\n        class Base(int i);\n        class SymbolMember : Base\n        {\n            @SymbolMember() : base(1) { }\n        }\n        \"\"\", false)]\n    [DataRow(\"struct SymbolMember();\", true)]\n    [DataRow(\"struct SymbolMember() { }\", true)]\n    [DataRow(\"struct SymbolMember(int a) { }\", true)]\n    [DataRow(\"struct SymbolMember { }\", false)]\n    [DataRow(\"struct SymbolMember(int a) { public @SymbolMember() : this(1) { } };\", true)]\n    [DataRow(\"struct SymbolMember { public @SymbolMember() { } };\", false)]\n    [DataRow(\"record SymbolMember();\", true)]\n    [DataRow(\"record SymbolMember() { }\", true)]\n    [DataRow(\"record SymbolMember(int a) { }\", true)]\n    [DataRow(\"record SymbolMember { }\", false)]\n    [DataRow(\"record SymbolMember(int a) { @SymbolMember() : this(1) { } };\", true)]\n    [DataRow(\"record SymbolMember { SymbolMember() { } };\", false)]\n    [DataRow(\"record struct SymbolMember();\", true)]\n    [DataRow(\"record struct SymbolMember() { }\", true)]\n    [DataRow(\"record struct SymbolMember(int a) { }\", true)]\n    [DataRow(\"record struct SymbolMember { }\", false)]\n    [DataRow(\"record struct SymbolMember(int a) { public @SymbolMember() : this(1) { } };\", true)]\n    [DataRow(\"record struct SymbolMember { public @SymbolMember() { } };\", false)]\n    [DataRow(\"record class SymbolMember();\", true)]\n    [DataRow(\"record class SymbolMember() { }\", true)]\n    [DataRow(\"record class SymbolMember(int a) { }\", true)]\n    [DataRow(\"record class SymbolMember { }\", false)]\n    [DataRow(\"record class SymbolMember(int a) { @SymbolMember() : this(1) { } };\", true)]\n    [DataRow(\"record class SymbolMember { @SymbolMember() { } };\", false)]\n    [DataRow(\"readonly struct SymbolMember();\", true)]\n    [DataRow(\"readonly struct SymbolMember() { }\", true)]\n    [DataRow(\"readonly struct SymbolMember(int a) { }\", true)]\n    [DataRow(\"readonly struct SymbolMember { }\", false)]\n    [DataRow(\"readonly struct SymbolMember(int a) { public @SymbolMember() : this(1) { } };\", true)]\n    [DataRow(\"readonly struct SymbolMember { public @SymbolMember() { } };\", false)]\n    public void IsPrimaryConstructor(string code, bool hasPrimaryConstructor)\n    {\n        var typeSymbol = new SnippetCompiler(code).DeclaredSymbol<INamedTypeSymbol>(\"SymbolMember\");\n        var methodSymbols = typeSymbol.GetMembers().OfType<IMethodSymbol>();\n\n        methodSymbols.Count(x => x.IsPrimaryConstructor).Should().Be(hasPrimaryConstructor ? 1 : 0);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Core.Test/Extensions/TypeDeclarationSyntaxExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Test.Extensions;\n\n[TestClass]\npublic class TypeDeclarationSyntaxExtensionsTest\n{\n    [TestMethod]\n    public void GetMethodDeclarations_EmptyClass_ReturnsEmpty()\n    {\n        var typeDeclaration = SyntaxFactory.ClassDeclaration(SyntaxFactory.Identifier(\"TestClass\"));\n\n        typeDeclaration.GetMethodDeclarations().Should().BeEmpty();\n    }\n\n    [TestMethod]\n    public void GetMethodDeclarations_SingleMethod_ReturnsMethod()\n    {\n        const string code = \"\"\"\n            namespace Test\n            {\n                class TestClass\n                {\n                    private void WriteLine() {}\n                }\n            }\n            \"\"\";\n        var snippet = new SnippetCompiler(code);\n        var typeDeclaration = snippet.Tree.Single<TypeDeclarationSyntax>();\n        typeDeclaration.GetMethodDeclarations().Single().Identifier.Text.Should().Be(\"WriteLine\");\n    }\n\n    [TestMethod]\n    public void GetMethodDeclarations_MultipleMethodsWithLocalFunctions_ReturnsMethodsAndFunctions()\n    {\n        const string code = \"\"\"\n            namespace Test\n            {\n                class TestClass\n                {\n                    private void Method1()\n                    {\n                        Function1();\n                        Function2();\n                        void Function1() {}\n                        void Function2() {}\n                    }\n\n                    private void Method2()\n                    {\n                        Function3();\n                        void Function3() {}\n                    }\n                }\n            }\n            \"\"\";\n        var snippet = new SnippetCompiler(code);\n        var typeDeclaration = snippet.Tree.Single<TypeDeclarationSyntax>();\n        typeDeclaration\n            .GetMethodDeclarations()\n            .Select(x => x.Identifier.Text)\n            .Should()\n            .BeEquivalentTo(new List<string>\n            {\n                \"Method1\",\n                \"Method2\",\n                \"Function1\",\n                \"Function2\",\n                \"Function3\"\n            });\n    }\n\n    [TestMethod]\n    [DataRow(\"class\")]\n    [DataRow(\"struct\")]\n    [DataRow(\"readonly struct\")]\n    [DataRow(\"record struct\")]\n#if NET\n    [DataRow(\"record\")]\n    [DataRow(\"record class\")]\n    [DataRow(\"readonly record struct\")]\n#endif\n    public void ParameterList_ReturnsList(string type)\n    {\n        var tree = TestCompiler.CompileCS($$\"\"\"{{type}} Test(int i) { }\"\"\").Tree;\n        var typeDeclaration = tree.GetCompilationUnitRoot().DescendantNodesAndSelf().OfType<TypeDeclarationSyntax>().Single();\n        var parameterList = typeDeclaration.ParameterList();\n        parameterList.Should().NotBeNull();\n        var entry = parameterList.Parameters.Should().ContainSingle().Which;\n        entry.Type.Should().BeOfType<PredefinedTypeSyntax>();\n        entry.Identifier.ValueText.Should().Be(\"i\");\n    }\n\n    [TestMethod]\n    public void ParameterList_Interface()\n    {\n        var tree = TestCompiler.CompileCS(\"interface Test { }\").Tree;\n        var typeDeclaration = tree.GetCompilationUnitRoot().DescendantNodesAndSelf().OfType<TypeDeclarationSyntax>().Single();\n        var parameterList = typeDeclaration.ParameterList();\n        parameterList.Should().BeNull();\n    }\n\n    [TestMethod]\n    [DataRow(LanguageVersion.CSharp1)]\n    [DataRow(LanguageVersion.CSharp2)]\n    [DataRow(LanguageVersion.CSharp3)]\n    [DataRow(LanguageVersion.CSharp4)]\n    [DataRow(LanguageVersion.CSharp5)]\n    [DataRow(LanguageVersion.CSharp6)]\n    [DataRow(LanguageVersion.CSharp7)]\n    [DataRow(LanguageVersion.CSharp7_1)]\n    [DataRow(LanguageVersion.CSharp7_2)]\n    [DataRow(LanguageVersion.CSharp7_3)]\n    [DataRow(LanguageVersion.CSharp8)]\n    [DataRow(LanguageVersion.CSharp9)]\n    [DataRow(LanguageVersion.CSharp10)]\n    [DataRow(LanguageVersion.CSharp11)]\n    [DataRow(LanguageVersion.CSharp12)]\n    public void PrimaryConstructor_NoPrimaryConstructor(LanguageVersion languageVersion)\n    {\n        var tree = CSharpSyntaxTree.ParseText(\"public class Test { }\", new CSharpParseOptions(languageVersion));\n        var compilation = CSharpCompilation.Create(assemblyName: null, syntaxTrees: new[] { tree });\n        var typeDeclaration = tree.GetCompilationUnitRoot().DescendantNodesAndSelf().OfType<TypeDeclarationSyntax>().Single();\n        typeDeclaration.PrimaryConstructor(compilation.GetSemanticModel(tree)).Should().BeNull();\n    }\n\n    [TestMethod]\n    [DataRow(LanguageVersion.CSharp9)]\n    [DataRow(LanguageVersion.CSharp10)]\n    [DataRow(LanguageVersion.CSharp11)]\n    [DataRow(LanguageVersion.CSharp12)]\n    public void PrimaryConstructor_PrimaryConstructorRecord(LanguageVersion languageVersion)\n    {\n        var tree = CSharpSyntaxTree.ParseText(\"public record Test(int i) { }\", new CSharpParseOptions(languageVersion));\n        var compilation = CSharpCompilation.Create(assemblyName: null, syntaxTrees: new[] { tree });\n        var typeDeclaration = tree.GetCompilationUnitRoot().DescendantNodesAndSelf().OfType<TypeDeclarationSyntax>().Single();\n        var methodSymbol = typeDeclaration.PrimaryConstructor(compilation.GetSemanticModel(tree));\n        methodSymbol.Should().NotBeNull();\n        methodSymbol.MethodKind.Should().Be(MethodKind.Constructor);\n        var entry = methodSymbol.Parameters.Should().ContainSingle().Which;\n        entry.Name.Should().Be(\"i\");\n        entry.Type.SpecialType.Should().Be(SpecialType.System_Int32);\n    }\n\n    [TestMethod]\n    [DataRow(\"class\")]\n    [DataRow(\"struct\")]\n    [DataRow(\"readonly struct\")]\n    [DataRow(\"record struct\")]\n#if NET\n    [DataRow(\"record\")]\n    [DataRow(\"record class\")]\n#endif\n    public void PrimaryConstructor_PrimaryConstructorOnClass(string type)\n    {\n        var (tree, model) = TestCompiler.CompileCS($$\"\"\"{{type}} Test(int i) { }\"\"\");\n        var typeDeclaration = tree.GetCompilationUnitRoot().DescendantNodesAndSelf().OfType<TypeDeclarationSyntax>().Single();\n        var methodSymbol = typeDeclaration.PrimaryConstructor(model);\n        methodSymbol.Should().NotBeNull();\n        methodSymbol.MethodKind.Should().Be(MethodKind.Constructor);\n        var entry = methodSymbol.Parameters.Should().ContainSingle().Which;\n        entry.Name.Should().Be(\"i\");\n        entry.Type.SpecialType.Should().Be(SpecialType.System_Int32);\n    }\n\n    [TestMethod]\n    public void PrimaryConstructor_EmptyPrimaryConstructor()\n    {\n        var (tree, model) = TestCompiler.CompileCS(\"public class Test() { }\");\n        var typeDeclaration = tree.GetCompilationUnitRoot().DescendantNodesAndSelf().OfType<TypeDeclarationSyntax>().Single();\n        var methodSymbol = typeDeclaration.PrimaryConstructor(model);\n        methodSymbol.Should().NotBeNull();\n        methodSymbol.MethodKind.Should().Be(MethodKind.Constructor);\n        methodSymbol.Parameters.Should().BeEmpty();\n    }\n\n    [TestMethod]\n    public void PrimaryConstructor_EmptyPrimaryConstructor_SecondConstructor()\n    {\n        var (tree, model) = TestCompiler.CompileCS(\"\"\"\n            public class Test()\n            {\n                public Test(int i) : this() { }\n            }\n            \"\"\");\n        var typeDeclaration = tree.GetCompilationUnitRoot().DescendantNodesAndSelf().OfType<TypeDeclarationSyntax>().Single();\n        var methodSymbol = typeDeclaration.PrimaryConstructor(model);\n        methodSymbol.Should().NotBeNull();\n        methodSymbol.MethodKind.Should().Be(MethodKind.Constructor);\n        methodSymbol.Parameters.Should().BeEmpty();\n    }\n\n    [TestMethod]\n    public void PrimaryConstructor_EmptyPrimaryConstructorAndStaticConstructor()\n    {\n        var (tree, model) = TestCompiler.CompileCS(\"\"\"\n            public class Test()\n            {\n                static Test() { }\n            }\n            \"\"\");\n        var typeDeclaration = tree.GetCompilationUnitRoot().DescendantNodesAndSelf().OfType<TypeDeclarationSyntax>().Single();\n        var methodSymbol = typeDeclaration.PrimaryConstructor(model);\n        methodSymbol.Should().NotBeNull();\n        methodSymbol.MethodKind.Should().Be(MethodKind.Constructor);\n        methodSymbol.Parameters.Should().BeEmpty();\n        methodSymbol.IsStatic.Should().BeFalse();\n    }\n\n    [TestMethod]\n    [DataRow(\"__arglist\", 0)]\n    [DataRow(\"int i, __arglist\", 1)]\n    [DataRow(\"int i, int j, __arglist\", 2)]\n    public void PrimaryConstructor_ArglistPrimaryConstructor(string parameterList, int expectedNumberOfParameters)\n    {\n        var (tree, model) = TestCompiler.CompileCS($$\"\"\"public class Test({{parameterList}}) { }\"\"\");\n        var typeDeclaration = tree.GetCompilationUnitRoot().DescendantNodesAndSelf().OfType<TypeDeclarationSyntax>().Single();\n        var methodSymbol = typeDeclaration.PrimaryConstructor(model);\n        methodSymbol.Should().NotBeNull();\n        methodSymbol.MethodKind.Should().Be(MethodKind.Constructor);\n        methodSymbol.Parameters.Should().HaveCount(expectedNumberOfParameters);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Core.Test/Extensions/TypeSyntaxExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Test.Extensions;\n\n[TestClass]\npublic class TypeSyntaxExtensionsTest\n{\n    [TestMethod]\n    [DataRow(\"\"\"$$int$$ field;\"\"\", \"int\")]                                      // identity — no wrapper\n    [DataRow(\"\"\"$$int[]$$ field;\"\"\", \"int\")]                                    // array\n    [DataRow(\"\"\"$$int[][]$$ field;\"\"\", \"int\")]                                  // nested array\n    [DataRow(\"\"\"$$int?$$ field;\"\"\", \"int\")]                                     // nullable\n    [DataRow(\"\"\"$$int*$$ field;\"\"\", \"int\")]                                     // pointer\n    [DataRow(\"\"\"$$int?[]$$ field;\"\"\", \"int\")]                                   // nullable inside array\n    [DataRow(\"\"\"void M(ref int p) { $$ref int$$ x = ref p; }\"\"\", \"int\")]        // ref\n    [DataRow(\"\"\"void M(ref int p) { $$scoped ref int$$ x = ref p; }\"\"\", \"int\")] // scoped ref\n    [DataRow(\"\"\"$$List<int>$$ field;\"\"\", \"List<int>\")]                          // generic — not unwrapped\n    public void Unwrap(string snippet, string expected)\n    {\n        var node = TestCompiler.NodeBetweenMarkersCS($$\"\"\"\n            using System;\n            using System.Collections.Generic;\n            unsafe class Test\n            {\n                public Test(int i) { }\n                {{snippet}}\n            }\n            \"\"\").Node;\n        ((TypeSyntax)node).Unwrap().ToString().Should().Be(expected);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Core.Test/Facade/CSharpFacadeTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Facade.Test;\n\n[TestClass]\npublic class CSharpFacadeTest\n{\n    [TestMethod]\n    public void MethodParameterLookup_ForInvocation()\n    {\n        var sut = CSharpFacade.Instance;\n        var code = \"\"\"\n            public class C\n            {\n                public int M(int arg) =>\n                    M(1);\n            }\n            \"\"\";\n        var (tree, model) = TestCompiler.CompileCS(code);\n        var root = tree.GetRoot();\n        var invocation = root.DescendantNodes().OfType<InvocationExpressionSyntax>().First();\n        var method = model.GetDeclaredSymbol(root.DescendantNodes().OfType<MethodDeclarationSyntax>().First());\n        var actual = sut.MethodParameterLookup(invocation, method);\n        actual.Should().NotBeNull().And.BeOfType<CSharpMethodParameterLookup>();\n    }\n\n    [TestMethod]\n    public void MethodParameterLookup_SemanticModelOverload()\n    {\n        var code = \"\"\"\n            public class C\n            {\n                public int M(int arg) =>\n                    M(1);\n            }\n            \"\"\";\n        var (tree, model) = TestCompiler.CompileCS(code);\n        var lookup = CSharpFacade.Instance.MethodParameterLookup(tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(), model);\n        lookup.Should().NotBeNull().And.BeOfType<CSharpMethodParameterLookup>();\n    }\n\n    [TestMethod]\n    public void MethodParameterLookup_ForObjectCreation()\n    {\n        var sut = CSharpFacade.Instance;\n        var code = \"\"\"\n            public class C\n            {\n                public C(int arg) { }\n\n                public C M() =>\n                    new C(1);\n            }\n            \"\"\";\n        var (tree, model) = TestCompiler.CompileCS(code);\n        var root = tree.GetRoot();\n        var creation = root.DescendantNodes().OfType<ObjectCreationExpressionSyntax>().First();\n        var constructor = model.GetDeclaredSymbol(root.DescendantNodes().OfType<ConstructorDeclarationSyntax>().First());\n        var actual = sut.MethodParameterLookup(creation, constructor);\n        actual.Should().NotBeNull().And.BeOfType<CSharpMethodParameterLookup>();\n    }\n\n    [TestMethod]\n    public void MethodParameterLookup_ForImplicitObjectCreation()\n    {\n        var sut = CSharpFacade.Instance;\n        var code = \"\"\"\n            public class C\n            {\n                public C(int arg) { }\n\n                public C M() =>\n                    new(1);\n            }\n            \"\"\";\n        var (tree, model) = TestCompiler.CompileCS(code);\n        var root = tree.GetRoot();\n        var creation = root.DescendantNodes().First(x => x.IsKind(SyntaxKindEx.ImplicitObjectCreationExpression));\n        var constructor = model.GetDeclaredSymbol(root.DescendantNodes().OfType<ConstructorDeclarationSyntax>().First());\n        var actual = sut.MethodParameterLookup(creation, constructor);\n        actual.Should().NotBeNull().And.BeOfType<CSharpMethodParameterLookup>();\n    }\n\n    [TestMethod]\n    public void MethodParameterLookup_ForArgumentList()\n    {\n        var sut = CSharpFacade.Instance;\n        var code = \"\"\"\n            public class C\n            {\n                public int M(int arg) =>\n                    M(1);\n            }\n            \"\"\";\n        var (tree, model) = TestCompiler.CompileCS(code);\n        var root = tree.GetRoot();\n        var argumentList = root.DescendantNodes().OfType<ArgumentListSyntax>().First();\n        var method = model.GetDeclaredSymbol(root.DescendantNodes().OfType<MethodDeclarationSyntax>().First());\n        var actual = () => sut.MethodParameterLookup(argumentList, method);\n        actual.Should().Throw<InvalidOperationException>();\n    }\n\n    [TestMethod]\n    public void MethodParameterLookup_UnsupportedSyntaxKind()\n    {\n        var sut = CSharpFacade.Instance;\n        var code = \"\"\"\n            public class C\n            {\n                public int M(int arg) =>\n                    M(1);\n            }\n            \"\"\";\n        var (tree, model) = TestCompiler.CompileCS(code);\n        var root = tree.GetRoot();\n        var methodDeclaration = root.DescendantNodes().OfType<MethodDeclarationSyntax>().First();\n        var method = model.GetDeclaredSymbol(methodDeclaration);\n        var actual = () => sut.MethodParameterLookup(methodDeclaration, method); // MethodDeclarationSyntax passed instead of invocation\n        actual.Should().Throw<InvalidOperationException>().Which.Message.Should().StartWith(\"The node of kind MethodDeclaration does not have an ArgumentList.\");\n    }\n\n    [TestMethod]\n    public void MethodParameterLookup_Null()\n    {\n        var sut = CSharpFacade.Instance;\n        var code = \"\"\"\n            public class C\n            {\n                public int M(int arg) =>\n                    M(1);\n            }\n            \"\"\";\n        var (tree, model) = TestCompiler.CompileCS(code);\n        var root = tree.GetRoot();\n        var method = model.GetDeclaredSymbol(root.DescendantNodes().OfType<MethodDeclarationSyntax>().First());\n        var actual = sut.MethodParameterLookup(null, method);\n        actual.Should().BeNull();\n    }\n\n    [TestMethod]\n    public void MethodParameterLookup_Null_SemanticModelOverload()\n    {\n        var sut = CSharpFacade.Instance;\n        var code = \"\"\"\n            public class C\n            {\n                public int M(int arg) =>\n                    M(1);\n            }\n            \"\"\";\n        var (_, model) = TestCompiler.CompileCS(code);\n        var actual = sut.MethodParameterLookup(null, model);\n        actual.Should().BeNull();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Core.Test/Facade/Implementation/CSharpSyntaxFacadeTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Syntax.Utilities;\nusing static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;\n\nnamespace SonarAnalyzer.CSharp.Core.Facade.Implementation.Test;\n\n[TestClass]\npublic class CSharpSyntaxFacadeTest\n{\n    private readonly CSharpSyntaxFacade cs = new();\n\n    [TestMethod]\n    public void EnumMembers_Null_CS() =>\n        cs.EnumMembers(null).Should().BeEmpty();\n\n    [TestMethod]\n    public void InvocationIdentifier_Null_CS() =>\n        cs.InvocationIdentifier(null).Should().BeNull();\n\n    [TestMethod]\n    public void ObjectCreationTypeIdentifier_Null_CS() =>\n        cs.ObjectCreationTypeIdentifier(null).Should().BeNull();\n\n    [TestMethod]\n    public void InvocationIdentifier_UnexpectedTypeThrows_CS() =>\n        cs.Invoking(x => x.InvocationIdentifier(IdentifierName(\"ThisIsNotInvocation\"))).Should().Throw<InvalidCastException>();\n\n    [TestMethod]\n    public void ModifierKinds_Null_CS() =>\n        cs.ModifierKinds(null).Should().BeEmpty();\n\n    [TestMethod]\n    public void NodeExpression_Null_CS() =>\n        cs.NodeExpression(null).Should().BeNull();\n\n    [TestMethod]\n    public void NodeExpression_UnexpectedTypeThrows_CS() =>\n        cs.Invoking(x => x.NodeExpression(IdentifierName(\"ThisTypeDoesNotHaveExpression\"))).Should().Throw<InvalidOperationException>();\n\n    [TestMethod]\n    public void NodeIdentifier_Null_CS() =>\n        cs.NodeIdentifier(null).Should().BeNull();\n\n    [TestMethod]\n    public void NodeIdentifier_Unexpected_Returns_Null_CS() =>\n       cs.NodeIdentifier(AttributeList()).Should().BeNull();\n\n    [TestMethod]\n    public void StringValue_UnexpectedType_CS() =>\n         cs.StringValue(ThrowStatement(), null).Should().BeNull();\n\n    [TestMethod]\n    public void StringValue_NodeIsNull_CS() =>\n        cs.StringValue(null, null).Should().BeNull();\n\n    [TestMethod]\n    public void RemoveConditionalAccess_Null_CS() =>\n        cs.RemoveConditionalAccess(null).Should().BeNull();\n\n    [TestMethod]\n    [DataRow(\"M()\", \"M()\")]\n    [DataRow(\"this.M()\", \"this.M()\")]\n    [DataRow(\"A.B.C.M()\", \"A.B.C.M()\")]\n    [DataRow(\"A.B?.C.M()\", \".C.M()\")]\n    [DataRow(\"A.B?.C?.M()\", \".M()\")]\n    [DataRow(\"A.B?.C?.D\", \".D\")]\n    public void RemoveConditionalAccess_SimpleInvocation_CS(string invocation, string expected) =>\n        cs.RemoveConditionalAccess(ParseExpression(invocation)).ToString().Should().Be(expected);\n\n    [TestMethod]\n    public void ArgumentNameColon_CS_WithNameColon()\n    {\n        var expression = LiteralExpression(SyntaxKind.TrueLiteralExpression);\n        var argument = Argument(NameColon(IdentifierName(\"a\")), Token(SyntaxKind.None), expression);\n        cs.ArgumentNameColon(argument).Should().BeOfType<SyntaxToken>().Subject.ValueText.Should().Be(\"a\");\n    }\n\n    [TestMethod]\n    public void ArgumentNameColon_CS_WithoutNameColon()\n    {\n        var expression = LiteralExpression(SyntaxKind.TrueLiteralExpression);\n        var argument = Argument(expression);\n        cs.ArgumentNameColon(argument).Should().BeNull();\n    }\n\n    [TestMethod]\n    public void ArgumentNameColon_CS_UnsupportedSyntaxKind()\n    {\n        var expression = LiteralExpression(SyntaxKind.TrueLiteralExpression, Token(SyntaxKind.TrueKeyword));\n        cs.ArgumentNameColon(expression).Should().BeNull();\n    }\n\n    [TestMethod]\n    public void ComparisonKind_BinaryExpression_CS()\n    {\n        var binary = BinaryExpression(SyntaxKind.EqualsExpression, IdentifierName(\"a\"), IdentifierName(\"b\"));\n        cs.ComparisonKind(binary).Should().Be(ComparisonKind.Equals);\n    }\n\n    [TestMethod]\n    public void ComparisonKind_NonBinaryExpression_CS() =>\n        cs.ComparisonKind(IdentifierName(\"a\")).Should().Be(ComparisonKind.None);\n\n    [TestMethod]\n    public void ComparisonKind_Null_CS() =>\n        cs.ComparisonKind(null).Should().Be(ComparisonKind.None);\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Core.Test/RegularExpressions/MessageTemplateParserTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.RegularExpressions.Test;\n\n[TestClass]\npublic class MessageTemplateParserTest\n{\n    [TestMethod]\n    [DataRow(\"\")]\n    [DataRow(\"}\")]\n    [DataRow(\"{{}}\")]\n    [DataRow(\"{{\")]\n    [DataRow(\"}}\")]\n    [DataRow(\"}}{{{{\")]\n    [DataRow(\"hello world\")]\n    [DataRow(\"hello {{world}}\")]\n    [DataRow(\"{{hello {{world}}}}\")]\n    public void Parse_NoPlaceholder(string template)\n    {\n        var result = MessageTemplatesParser.Parse(template, MessageTemplatesParser.TemplateRegex);\n        ShouldBeSuccess(result);\n    }\n\n    [TestMethod]\n    // named\n    [DataRow(\"{world}\", \"world\", 1, 5)]\n    [DataRow(\"hello {world}\", \"world\", 7, 5)]\n    [DataRow(\"hello {{{world42}}}\", \"world42\", 9, 7)]\n    [DataRow(\"hello {{ {42world}\", \"42world\", 10, 7)]\n    [DataRow(\"hello {{ {w_0_rld}\", \"w_0_rld\", 10, 7)]\n    [DataRow(\"hello {{ {_}\", \"_\", 10, 1)]\n    [DataRow(\"hello {{ {_world}\", \"_world\", 10, 6)]\n    // index\n    [DataRow(\"{0}\", \"0\", 1, 1)]\n    [DataRow(\"hello {0}\", \"0\", 7, 1)]\n    [DataRow(\"hello {{{42}}}\", \"42\", 9, 2)]\n    [DataRow(\"hello {{ {199}\", \"199\", 10, 3)]\n    // prefix optional operator\n    [DataRow(\"{@world}\", \"world\", 2, 5)]\n    [DataRow(\"{$199}\", \"199\", 2, 3)]\n    [DataRow(\"{@0}\", \"0\", 2, 1)]\n    [DataRow(\"{$world_42}\", \"world_42\", 2, 8)]\n    [DataRow(\"\"\" \"hello\" + \"{world}\" + \"!\" \"\"\", \"world\", 13, 5)]\n    public void Parse_Placeholder(string template, string placeholder, int start, int length)\n    {\n        var result = MessageTemplatesParser.Parse(template, MessageTemplatesParser.TemplateRegex);\n        ShouldBeSuccess(result, 1);\n        ShouldBe(result.Placeholders[0], placeholder, start, length);\n    }\n\n    [TestMethod]\n    // alignment\n    [DataRow(\"hello {world,1}\")]\n    [DataRow(\"hello {world,42}\")]\n    [DataRow(\"hello {world,-1}\")]\n    [DataRow(\"hello {world,-199}\")]\n    // format\n    [DataRow(\"hello {world:format}\")]\n    [DataRow(\"hello {world:42}\")]\n    [DataRow(\"hello {world:{}\")]\n    [DataRow(\"hello {world:!@#$%^&*()_}\")]\n    [DataRow(\"hello {world:42}\")]\n    [DataRow(\"hello {world:#for_mat42}\")]\n    // mixed\n    [DataRow(\"hello {world,1:format}\")]\n    [DataRow(\"hello {world,42:!@#$%}\")]\n    [DataRow(\"hello {world,-1:dd-MM-yyy}\")]\n    [DataRow(\"hello {world,-42:3,14159}\")]\n    [DataRow(\"hello {world:format,42}\")] // semantically looks like a typo, format and alignment are reversed, but it's syntactically valid.\n    public void Parse_Placeholder_Named_Alignment_Format(string template)\n    {\n        var result = MessageTemplatesParser.Parse(template, MessageTemplatesParser.TemplateRegex);\n        ShouldBeSuccess(result, 1);\n        ShouldBe(result.Placeholders[0], \"world\", 7, 5);\n    }\n\n    [TestMethod]\n    public void Parse_Placeholder_Multiple()\n    {\n        var template = \"\"\"\n            In code's {$silent} realm,\n            Logic weaves through lines {@0}f text,\n            Errors {@teach,42} us well.\n\n            Syntax {sym_phony,42:dd-MM},\n            Logic {@_orchestrates42} the mind,\n            Programmer's {ballet:_}.\n            \"\"\";\n        var result = MessageTemplatesParser.Parse(template, MessageTemplatesParser.TemplateRegex);\n        ShouldBeSuccess(result, 6);\n        ShouldBe(result.Placeholders[0], \"silent\", 12, 6);\n        ShouldBe(result.Placeholders[1], \"0\", 56, 1);\n        ShouldBe(result.Placeholders[2], \"teach\", 75, 5);\n\n        ShouldBe(result.Placeholders[3], \"sym_phony\", 103, 9);\n        ShouldBe(result.Placeholders[4], \"_orchestrates42\", 132, 15);\n        ShouldBe(result.Placeholders[5], \"ballet\", 173, 6);\n    }\n\n    [TestMethod]\n    [DataRow(\"{\")]                                  // Left bracket is not allowed\n    [DataRow(\"{{{\")]                                // Third left bracket is not allowed (first two are valid)\n    [DataRow(\"{}\")]                                 // Empty placeholder is not allowed\n    [DataRow(\"{{{}}}\")]                             // Empty placeholder is not allowed\n    [DataRow(\"Login failed for {User\")]             // Missing closing bracket\n    [DataRow(\"Login failed for {&User}\")]           // Only '@' and '$' are allowed as prefix\n    [DataRow(\"Login failed for {User_%Name}\")]      // Only alphanumerics and '_' are allowed for placeholders\n    [DataRow(\"Retry attempt {Cnt,r}\")]              // The alignment specifier must be numeric\n    [DataRow(\"Retry attempt {Cnt,}\")]               // Empty alignment specifier is not allowed\n    [DataRow(\"Retry attempt {Cnt:}\")]               // Empty format specifier is not allowed\n    [DataRow(\"\"\" \"hello {\" + \"world\" + \"}\" \"\"\")]    // '+' and '\"' is not allowed in placeholders\n    public void Parse_Placeholder_Failure(string template)\n    {\n        var result = MessageTemplatesParser.Parse(template, MessageTemplatesParser.TemplateRegex);\n        result.Should().NotBeNull();\n        result.Success.Should().BeFalse();\n        result.Placeholders.Should().BeNull();\n    }\n\n    private static void ShouldBeSuccess(MessageTemplatesParser.ParseResult actual, int placeholderCount = 0)\n    {\n        actual.Should().NotBeNull();\n        actual.Success.Should().BeTrue();\n        actual.Placeholders.Should().NotBeNull().And.HaveCount(placeholderCount);\n    }\n\n    private static void ShouldBe(MessageTemplatesParser.Placeholder actual, string name, int start, int length)\n    {\n        actual.Should().NotBeNull();\n        actual.Name.Should().Be(name);\n        actual.Start.Should().Be(start);\n        actual.Length.Should().Be(length);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Core.Test/SonarAnalyzer.CSharp.Core.Test.csproj",
    "content": "﻿  <Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFramework>net10.0</TargetFramework>\n    <IsPackable>false</IsPackable>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\src\\SonarAnalyzer.CSharp.Core\\SonarAnalyzer.CSharp.Core.csproj\" />\n    <ProjectReference Include=\"..\\SonarAnalyzer.TestFramework\\SonarAnalyzer.TestFramework.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Using Include=\"FluentAssertions\" />\n    <Using Include=\"Microsoft.CodeAnalysis\" />\n    <Using Include=\"Microsoft.CodeAnalysis.CSharp\" />\n    <Using Include=\"Microsoft.CodeAnalysis.CSharp.Syntax\" />\n    <Using Include=\"Microsoft.CodeAnalysis.Diagnostics\" />\n    <Using Include=\"Microsoft.VisualStudio.TestTools.UnitTesting\" />\n    <Using Include=\"SonarAnalyzer.Core.Common\" />\n    <Using Include=\"SonarAnalyzer.Core.Extensions\" />\n    <Using Include=\"SonarAnalyzer.Core.Semantics\" />\n    <Using Include=\"SonarAnalyzer.CSharp.Core.Extensions\" />\n    <Using Include=\"SonarAnalyzer.CSharp.Core.Facade\" />\n    <Using Include=\"SonarAnalyzer.CSharp.Core.Syntax.Extensions\" />\n    <Using Include=\"SonarAnalyzer.CSharp.Core.Syntax.Utilities\" />\n    <Using Include=\"SonarAnalyzer.CSharp.Core.Wrappers\" />\n    <Using Include=\"SonarAnalyzer.ShimLayer\" />\n    <Using Include=\"SonarAnalyzer.TestFramework.Build\" />\n    <Using Include=\"SonarAnalyzer.TestFramework.Common\" />\n    <Using Include=\"SonarAnalyzer.TestFramework.Extensions\" />\n    <Using Include=\"SonarAnalyzer.TestFramework.MetadataReferences\" />\n    <Using Include=\"StyleCop.Analyzers.Lightup\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Core.Test/Syntax/Extensions/ArgumentSyntaxExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.CSharp.Core.Test.Syntax.Extensions;\n\n[TestClass]\npublic class ArgumentSyntaxExtensionsTest\n{\n    [TestMethod]\n    [DataRow(\"($$a, b) = (42, 42);\")]\n    [DataRow(\"(a, $$b) = (42, 42);\")]\n    [DataRow(\"(a, (b, $$c)) = (42, (42, 42));\")]\n    [DataRow(\"(a, (b, ($$c, d))) = (42, (42, (42, 42)));\")]\n    public void IsInTupleAssignmentTarget_IsTrue(string assignment)\n    {\n        var code = $$\"\"\"\n            public class Sample\n            {\n                public void Method()\n                {\n                    int a, b, c, d;\n                    {{assignment}}\n                }\n            }\n            \"\"\";\n        var argument = GetTupleArgumentAtMarker(ref code);\n        argument.IsInTupleAssignmentTarget().Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void IsInTupleAssignmentTarget_IsFalse()\n    {\n        const string code = \"\"\"\n            public class Sample\n            {\n                public void TupleArg((int, int) tuple) { }\n\n                public void Method(int methodArgument)\n                {\n                    int a = 42;\n                    var t = (a, methodArgument);\n                    var x = (42, 42);\n                    var nested = (42, (42, 42));\n                    TupleArg((42, 42));\n                    Method(0);\n                }\n            }\n            \"\"\";\n        var arguments = CSharpSyntaxTree.ParseText(code).GetRoot().DescendantNodes().OfType<ArgumentSyntax>().ToArray();\n\n        arguments.Should().HaveCount(12);\n        foreach (var argument in arguments)\n        {\n            argument.IsInTupleAssignmentTarget().Should().BeFalse();\n        }\n    }\n\n    [TestMethod]\n    // Simple tuple\n    [DataRow(\"($$1, (2, 3))\", \"(1, (2, 3))\")]\n    [DataRow(\"(1, ($$2, 3))\", \"(1, (2, 3))\")]\n    [DataRow(\"(1, (2, $$3))\", \"(1, (2, 3))\")]\n    // With method call with single argument\n    [DataRow(\"($$1, (M(2), 3))\", \"(1, (M(2), 3))\")]\n    [DataRow(\"(1, ($$M(2), 3))\", \"(1, (M(2), 3))\")]\n    [DataRow(\"(1, (M($$2), 3))\", null)]\n    // With method call with two arguments\n    [DataRow(\"(1, $$M(2, 3))\", \"(1, M(2, 3))\")]\n    [DataRow(\"(1, M($$2, 3))\", null)]\n    [DataRow(\"(1, M(2, $$3))\", null)]\n    // With method call with tuple argument\n    [DataRow(\"($$M((1, 2)), 3)\", \"(M((1, 2)), 3)\")]\n    [DataRow(\"(M($$(1, 2)), 3)\", null)]\n    [DataRow(\"(M(($$1, 2)), 3)\", \"(1, 2)\")]\n    public void OutermostTuple_DifferentPositions(string tuple, string expectedOuterTuple)\n    {\n        var code = $$\"\"\"\n            public class C\n            {\n                public void Test()\n                {\n                    _ = {{tuple}};\n                }\n\n                static int M(int a) => 0;\n                static int M(int a, int b) => 0;\n                static int M((int a, int b) t) => 0;\n            }\n            \"\"\";\n        var argument = GetTupleArgumentAtMarker(ref code);\n        var outerMostTuple = argument.OutermostTuple();\n        if (expectedOuterTuple is null)\n        {\n            outerMostTuple.Should().BeNull();\n        }\n        else\n        {\n            outerMostTuple.Should().NotBeNull();\n            outerMostTuple.Value.SyntaxNode.ToString().Should().Be(expectedOuterTuple);\n        }\n    }\n\n    private static ArgumentSyntax GetTupleArgumentAtMarker(ref string code)\n    {\n        var nodePosition = code.IndexOf(\"$$\");\n        code = code.Replace(\"$$\", string.Empty);\n        var tree = Microsoft.CodeAnalysis.CSharp.CSharpSyntaxTree.ParseText(code);\n        tree.GetDiagnostics().Should().BeEmpty();\n        var nodeAtPosition = tree.GetRoot().FindNode(new TextSpan(nodePosition, 0), getInnermostNodeForTie: true);\n        var argument = nodeAtPosition?.AncestorsAndSelf().OfType<ArgumentSyntax>().First();\n        return argument;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Core.Test/Syntax/Extensions/AssignmentExpressionSyntaxExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Test.Syntax.Extensions;\n\n[TestClass]\npublic class AssignmentExpressionSyntaxExtensionsTest\n{\n    [TestMethod]\n    public void MapAssignmentArguments_TupleElementsAreExtracted() =>\n        AssertMapAssignmentArguments(\"(var x, var y) = (1, 2);\", new[]\n            {\n                new\n                {\n                    Left = WithDesignation(\"x\"),\n                    Right = WithToken(\"1\"),\n                },\n                new\n                {\n                    Left = WithDesignation(\"y\"),\n                    Right = WithToken(\"2\"),\n                },\n            });\n\n    [TestMethod]\n    public void MapAssignmentArguments_SimpleAssignmentReturnsSingleElementArray() =>\n        AssertMapAssignmentArguments(\"int x; x = 1;\", new[]\n            {\n                new\n                {\n                    Left = WithIdentifier(\"x\"),\n                    Right = WithToken(\"1\"),\n                },\n            });\n\n    [TestMethod]\n    public void MapAssignmentArguments_NestedDeconstruction() =>\n        AssertMapAssignmentArguments(\"(var a, (var b, (var c, var d)), var e) = (1, (2, (3, 4)), 5);\", new[]\n            {\n                new\n                {\n                    Left = WithDesignation(\"a\"),\n                    Right = WithToken(\"1\"),\n                },\n                new\n                {\n                    Left = WithDesignation(\"b\"),\n                    Right = WithToken(\"2\"),\n                },\n                new\n                {\n                    Left = WithDesignation(\"c\"),\n                    Right = WithToken(\"3\"),\n                },\n                new\n                {\n                    Left = WithDesignation(\"d\"),\n                    Right = WithToken(\"4\"),\n                },\n                new\n                {\n                    Left = WithDesignation(\"e\"),\n                    Right = WithToken(\"5\"),\n                },\n            });\n\n    [TestMethod]\n    public void MapAssignmentArguments_RightSideNotATupleExpression() =>\n        AssertMapAssignmentArguments(\"(var x, var y) = M(); static (int, int) M() => (1, 2);\", new[]\n            {\n                new\n                {\n                    Left = WithDesignationArguments(\"x\", \"y\"),\n                    Right = new { Expression = WithIdentifier(\"M\") },\n                },\n            });\n\n    [TestMethod]\n    public void MapAssignmentArguments_LeftSideNotATupleExpression() =>\n        AssertMapAssignmentArguments(\"(int, int) tuple; tuple = (1, 2);\", new[]\n            {\n                new\n                {\n                    Left = WithIdentifier(\"tuple\"),\n                    Right = WithTokenArguments(\"1\", \"2\"),\n                },\n            });\n\n    [TestMethod]\n    public void MapAssignmentArguments_SimpleDeconstructionAssignment() =>\n        AssertMapAssignmentArguments(\"var (x, y) =  (1, 2);\", new[]\n            {\n                new\n                {\n                    Left = WithIdentifier(\"x\"),\n                    Right = WithToken(\"1\"),\n                },\n                new\n                {\n                    Left = WithIdentifier(\"y\"),\n                    Right = WithToken(\"2\"),\n                },\n            });\n\n    [TestMethod]\n    public void MapAssignmentArguments_NestedDeconstructionAssignment() =>\n        AssertMapAssignmentArguments(\"var (a, (b, c), d) =  (1, (2, 3), 4);\", new[]\n            {\n                new\n                {\n                    Left = WithIdentifier(\"a\"),\n                    Right = WithToken(\"1\"),\n                },\n                new\n                {\n                    Left = WithIdentifier(\"b\"),\n                    Right = WithToken(\"2\"),\n                },\n                new\n                {\n                    Left = WithIdentifier(\"c\"),\n                    Right = WithToken(\"3\"),\n                },\n                new\n                {\n                    Left = WithIdentifier(\"d\"),\n                    Right = WithToken(\"4\"),\n                },\n            });\n\n    [TestMethod]\n    public void MapAssignmentArguments_MisalignedDeconstructionAssignment() =>\n        AssertMapAssignmentArguments(\"var (a, (b, c, d)) =  (1, (2, 3), 4);\", new[]\n            {\n                new\n                {\n                    Left = new\n                    {\n                        Designation = new\n                        {\n                            Variables = new object[]\n                            {\n                                WithIdentifier(\"a\"),\n                                WithIdentifierVariables(\"b\", \"c\", \"d\"),\n                            },\n                        },\n                    },\n                    Right = new\n                    {\n                        Arguments = new object[]\n                        {\n                            new { Expression = WithToken(\"1\") },\n                            new { Expression = WithTokenArguments(\"2\", \"3\") },\n                            new { Expression = WithToken(\"4\") },\n                        }\n                    },\n                },\n            });\n\n    [TestMethod]\n    public void MapAssignmentArguments_MisalignedDeconstructionAssignmentInNestedTuple() =>\n        AssertMapAssignmentArguments(\"var (a, (b, c, d)) =  (1, (2, 3));\", new object[]\n            {\n                new\n                {\n                    Left = new\n                    {\n                        Designation = new\n                        {\n                            Variables = new object[]\n                            {\n                                WithIdentifier(\"a\"),\n                                WithIdentifierVariables(\"b\", \"c\", \"d\"),\n                            },\n                        },\n                    },\n                    Right = new\n                    {\n                        Arguments = new object[]\n                        {\n                            new { Expression = WithToken(\"1\") },\n                            new { Expression = WithTokenArguments(\"2\", \"3\") },\n                        }\n                    },\n                },\n            });\n\n    [TestMethod]\n    public void MapAssignmentArguments_MixedAssignment() =>\n        AssertMapAssignmentArguments(\"int a; (a, var b) =  (1, 2);\", new[]\n        {\n            new\n            {\n                Left = WithIdentifier(\"a\"),\n                Right = WithToken(\"1\"),\n            },\n            new\n            {\n                Left = WithDesignation(\"b\"),\n                Right = WithToken(\"2\"),\n            },\n        });\n\n    [TestMethod]\n    public void MapAssignmentArguments_MisalignedLeft() =>\n        AssertMapAssignmentArguments(\"(var x, var y) = (1, 2, 3);\", new[]\n            {\n                new\n                {\n                    Left = WithDesignationArguments(\"x\", \"y\"),\n                    Right = WithTokenArguments(\"1\", \"2\", \"3\"),\n                },\n            });\n\n    [TestMethod]\n    public void MapAssignmentArguments_MisalignedRight() =>\n        AssertMapAssignmentArguments(\"(var x, var y, var z) = (1, 2);\", new[]\n            {\n                new\n                {\n                    Left = WithDesignationArguments(\"x\", \"y\", \"z\"),\n                    Right = WithTokenArguments(\"1\", \"2\"),\n                },\n            });\n\n    [TestMethod]\n    public void MapAssignmentArguments_MisalignedNested1() =>\n        AssertMapAssignmentArguments(\"(var a, (var b, var c)) = (1, (2, 3, 4));\", new[]\n            {\n                new\n                {\n                    Left = new\n                    {\n                        Arguments = new object[]\n                        {\n                            new { Expression = WithDesignation(\"a\") },\n                            new { Expression = WithDesignationArguments(\"b\", \"c\") },\n                        }\n                    },\n                    Right = new\n                    {\n                        Arguments = new object[]\n                        {\n                            new { Expression = WithToken(\"1\") },\n                            new { Expression = WithTokenArguments(\"2\", \"3\", \"4\") },\n                        }\n                    },\n                },\n            });\n\n    [TestMethod]\n    public void MapAssignmentArguments_MisalignedNested2() =>\n        AssertMapAssignmentArguments(\"(var a, (var b, var c), var d) = (1, (2, 3, 4));\", new[]\n            {\n                new\n                {\n                    Left = new\n                    {\n                        Arguments = new object[]\n                        {\n                            new { Expression = WithDesignation(\"a\") },\n                            new { Expression = WithDesignationArguments(\"b\", \"c\") },\n                            new { Expression = WithDesignation(\"d\") },\n                        }\n                    },\n                    Right = new\n                    {\n                        Arguments = new object[]\n                        {\n                            new { Expression = WithToken(\"1\") },\n                            new { Expression = WithTokenArguments(\"2\", \"3\", \"4\") },\n                        }\n                    },\n                },\n            });\n\n    [TestMethod]\n    public void MapAssignmentArguments_DifferentConventions() =>\n        AssertMapAssignmentArguments(\n            @\"int a;\n                int M() => 1;\n                ((a), (var b, _), object c, double d, _) = (1, (two: 2, (3)), string.Empty, M(), new object());\", new object[]\n            {\n                new\n                {\n                    Left = new { Expression = WithIdentifier(\"a\") },\n                    Right = WithToken(\"1\"),\n                },\n                new\n                {\n                    Left = WithDesignation(\"b\"),\n                    Right = WithToken(\"2\"),\n                },\n                new\n                {\n                    Left = WithIdentifier(\"_\"),\n                    Right = new { Expression = WithToken(\"3\") },\n                },\n                new\n                {\n                    Left = WithDesignation(\"c\"),\n                    Right = new\n                    {\n                        Expression = new { Keyword = new { Text = \"string\" } },\n                        Name = WithIdentifier(\"Empty\"),\n                    },\n                },\n                new\n                {\n                    Left = WithDesignation(\"d\"),\n                    Right = new { Expression = WithIdentifier(\"M\") },\n                },\n                new\n                {\n                    Left = WithIdentifier(\"_\"),\n                    Right = new { Type = new { Keyword = new { Text = \"object\" } } },\n                },\n            });\n\n    [TestMethod]\n    // Tuples.\n    [DataRow(\"(var a, (x, var b)) = (0, (x++, 1));\", \"var a | 0\", \"x | x++\", \"var b | 1\")]\n    [DataRow(\"(var a, (var b, var c, var d), var e) = (0, (1, 2, 3), 4);\", \"var a | 0\", \"var b | 1\", \"var c | 2\", \"var d | 3\", \"var e | 4\")]\n    // Designation.\n    [DataRow(\"var (a, (b, c)) = (0, (1, 2));\", \"a | 0\", \"b | 1\", \"c | 2\")]\n    [DataRow(\"var (a, (b, _)) = (0, (1, 2));\", \"a | 0\", \"b | 1\", \"_ | 2\")]\n    [DataRow(\"var (a, _) = (0, (1, 2));\", \"a | 0\", \"_ | (1, 2)\")]\n    // Unaligned tuples.\n    [DataRow(\"(var a, var b) = (0, 1, 2);\", \"(var a, var b) | (0, 1, 2)\")]\n    [DataRow(\"(var a, var b) = (0, 1, 2);\", \"(var a, var b) | (0, 1, 2)\")]\n    [DataRow(\"(var a, var b) = (0, (1, 2));\", \"var a | 0\", \"var b | (1, 2)\")]\n    [DataRow(\"(var a, (var b, var c)) = (0, 1);\", \"var a | 0\", \"(var b, var c) | 1\")] // Syntacticly correct\n    [DataRow(\"(var a, var b, var c) = (0, (1, 2));\", \"(var a, var b, var c) | (0, (1, 2))\")]\n    [DataRow(\"(var a, (var b, var c)) = (0, 1, 2);\", \"(var a, (var b, var c)) | (0, 1, 2)\")]\n    // Unaligned designation.\n    [DataRow(\"var (a, (b, c)) = (0, (1, 2, 3));\", \"var (a, (b, c)) | (0, (1, 2, 3))\")]\n    [DataRow(\"var (a, (b, c)) = (0, (1, (2, 3)));\", \"a | 0\", \"b | 1\", \"c | (2, 3)\")]\n    [DataRow(\"var (a, (b, (c, d))) = (0, (1, 2));\", \"a | 0\", \"b | 1\", \"(c, d) | 2\")]\n    [DataRow(\"var (a, (b, c, d)) = (0, (1, 2));\", \"var (a, (b, c, d)) | (0, (1, 2))\")]\n    // Mixed.\n    [DataRow(\"(var a, var (b, c)) = (0, (1, 2));\", \"var a | 0\", \"b | 1\", \"c | 2\")]\n    [DataRow(\"(var a, var (b, (c, (d, e)))) = (0, (1, (2, (3, 4))));\", \"var a | 0\", \"b | 1\", \"c | 2\", \"d | 3\", \"e | 4\")]\n    [DataRow(\"(var a, (var b, var (c, d))) = (0, (1, (2, 3)));\", \"var a | 0\", \"var b | 1\", \"c | 2\", \"d | 3\")]\n    public void MapAssignmentArguments_DataTest(string code, params string[] pairs)\n    {\n        var actualMapping = ParseAssignmentExpression(code).MapAssignmentArguments();\n        var actualMappingPairs = actualMapping.Select(x => $\"{x.Left} | {x.Right}\");\n        actualMappingPairs.Should().BeEquivalentTo(pairs);\n    }\n\n    [TestMethod]\n    // Normal assignment\n    [DataRow(\"int a; a = 1;\", \"a\")]\n    // Deconstruction into tuple\n    [DataRow(\"(var a, var b) = (1, 2);\", \"a\", \"b\")]\n    [DataRow(\"(var a, var b) = (1, (2, 3));\", \"a\", \"b\")]\n    [DataRow(\"(var a, _) = (1, 2);\", \"a\", \"_\")]  // \"_\" can refer to a local variable or be a discard.\n    [DataRow(\"(var _, var _) = (1, 2);\")]        // \"var _\" is always a discard.\n    [DataRow(\"(var _, _) = (1, 2);\", \"_\")]\n    [DataRow(\"(_, _) = (1, 2);\", \"_\", \"_\")]\n    [DataRow(\"_ = (1, 2);\", \"_\")]\n    [DataRow(\"(var a, (var b, var c), var d) = (1, (2, 3), 4);\", \"a\", \"b\", \"c\", \"d\")]\n    [DataRow(\"int b; (var a, (b, var c), _) = (1, (2, 3), 4);\", \"a\", \"b\", \"c\", \"_\")]\n    [DataRow(\"(var a, (int, int) b) = (1, (2, 3));\", \"a\", \"b\")]\n    // Deconstruction into declaration expression designation\n    [DataRow(\"var (a, b) = (1, 2);\", \"a\", \"b\")]\n    [DataRow(\"var (a, _) = (1, 2);\", \"a\")]\n    [DataRow(\"var (_, _) = (1, 2);\")]\n    // Mixed\n    [DataRow(\"(var a, var (b, c), var d, (int, int) e) = (1, (2, 3), (4, 5), (6, 7));\", \"a\", \"b\", \"c\", \"d\", \"e\")]\n    public void AssignmentTargets_DeconstructTargets(string assignment, params string[] expectedTargets)\n    {\n        var allTargets = ParseAssignmentExpression(assignment).AssignmentTargets();\n        var allTargetsAsString = allTargets.Select(x => x.ToString());\n        allTargetsAsString.Should().BeEquivalentTo(expectedTargets);\n    }\n\n    private static void AssertMapAssignmentArguments<T>(string code, T[] expectation)\n    {\n        var mapping = ParseAssignmentExpression(code).MapAssignmentArguments();\n        mapping.Should().BeEquivalentTo(expectation);\n    }\n\n    private static object WithDesignation(string identifier) =>\n        new { Designation = WithIdentifier(identifier) };\n\n    private static object WithIdentifier(string identifier) =>\n        new { Identifier = new { Text = identifier } };\n\n    private static object WithToken(string identifier) =>\n        new { Token = new { Text = identifier } };\n\n    private static object WithTokenArguments(params string[] tokens) =>\n        new { Arguments = tokens.Select(x => new { Expression = WithToken(x) }) };\n\n    private static object WithDesignationArguments(params string[] designations) =>\n        new { Arguments = designations.Select(x => new { Expression = WithDesignation(x) }) };\n\n    private static object WithIdentifierVariables(params string[] identifier) =>\n        new { Variables = identifier.Select(x => WithIdentifier(x)) };\n\n    private static AssignmentExpressionSyntax ParseAssignmentExpression(string code)\n    {\n        var syntaxTree = CSharpSyntaxTree.ParseText($@\"\npublic class C\n{{\n    public void M()\n    {{\n        {code}\n    }}\n}}\");\n        syntaxTree.GetDiagnostics().Should().BeEmpty();\n        return syntaxTree.GetRoot().DescendantNodesAndSelf().OfType<AssignmentExpressionSyntax>().Single();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Core.Test/Syntax/Extensions/AttributeDataExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing NSubstitute;\nusing SonarAnalyzer.Core.Syntax.Extensions;\n\nnamespace SonarAnalyzer.CSharp.Core.Test.Syntax.Extensions;\n\n[TestClass]\npublic class AttributeDataExtensionsTest\n{\n    [TestMethod]\n    [DataRow(true, \"Test\", \"Test\")]\n    [DataRow(true, \"TestAttribute\", \"TestAttribute\")]\n    [DataRow(false, \"TestAttribute\", null)]\n    [DataRow(false, \"Test\", \"test\")]\n    [DataRow(false, \"Test\", \"TEST\")]\n    [DataRow(false, \"TestAttribute\", \"Test\")]\n    [DataRow(false, \"TestAttribute\", \"testAttribute\")]\n    [DataRow(false, \"TestAttribute\", \"test\")]\n    [DataRow(false, \"TestAttribute\", \"testAttr\")]\n    [DataRow(false, \"TestAttribute\", \"TestAttr\")]\n    [DataRow(false, \"TestAttribute\", \"TestAttributes\")]\n    [DataRow(false, \"TestAttribute\", \"TestTest\")]\n    [DataRow(false, \"Test\", \"PrefixTest\")]\n    [DataRow(false, \"Test\", \"TestSuffix\")]\n    public void HasName(bool expected, string attributeClassName, string testName) =>\n        AttributeDataWithName(attributeClassName).HasName(testName).Should().Be(expected);\n\n    [TestMethod]\n    [DataRow(true, \"Test\", \"Test\", \"Test\")]\n    [DataRow(true, \"TestAttribute\", \"TestAttribute\", \"TestAttribute\")]\n    [DataRow(false, \"Test\", \"test\", \"other\")]\n    [DataRow(false, \"Test\", \"other\", \"test\")]\n    [DataRow(false, \"TestAttribute\", \"test\", \"other\")]\n    [DataRow(false, \"TestAttribute\", \"other\", \"other\")]\n    [DataRow(false, \"TestAttribute\", \"other1\", \"other2\", \"Test\")]\n    [DataRow(true, \"TestAttribute\", \"other1\", \"other2\", \"other3\", \"TestAttribute\")]\n    [DataRow(false, \"TestAttribute\", \"Test\", \"test\", \"SomeAttribute\")]\n    public void HasAnyName(bool expected, string attributeClassName, params string[] testNames) =>\n        AttributeDataWithName(attributeClassName).HasAnyName(testNames).Should().Be(expected);\n\n    [TestMethod]\n    public void HasAnyNameThrowsForNull() =>\n        new Action(() => AttributeDataWithName(\"TestAttribute\").HasAnyName(null)).Should().Throw<Exception>();\n\n    [TestMethod]\n    public void TryGetAttributeValue_Arguments()\n    {\n        var arguments = new Dictionary<string, object>\n        {\n            { \"SomeBool\", true },\n            { \"SomeInt\", 1_234_567 },\n            { \"SomeByte\", (byte)24 },\n            { \"SomeString\", \"Text\" },\n            { \"SomeNumberString\", \"42\" },\n            { \"SomeNull\", null },\n        };\n        var named = AttributeDataWithArguments(namedArguments: arguments);\n        var constructor = AttributeDataWithArguments(constructorArguments: arguments);\n        AssertTryGetAttributeValue<bool>(\"SomeBool\", true, true);\n        AssertTryGetAttributeValue<bool>(\"someBool\", true, true);\n        AssertTryGetAttributeValue<bool>(\"somebool\", true, true);\n        AssertTryGetAttributeValue<bool>(\"SOMEBOOL\", true, true);\n        AssertTryGetAttributeValue<int>(\"SomeInt\", true, 1_234_567);\n        AssertTryGetAttributeValue<byte>(\"SomeInt\", false, 0); // SomeInt is too big\n        AssertTryGetAttributeValue<byte>(\"SomeByte\", true, 24);\n        AssertTryGetAttributeValue<int>(\"SomeByte\", true, 24);\n        AssertTryGetAttributeValue<string>(\"SomeString\", true, \"Text\");\n        AssertTryGetAttributeValue<object>(\"SomeNull\", true, null);\n        AssertTryGetAttributeValue<string>(\"SomeNull\", true, null);\n        AssertTryGetAttributeValue<int>(\"SomeNull\", true, 0);\n        AssertTryGetAttributeValue<object>(\"Missing\", false, null);\n        AssertTryGetAttributeValue<string>(\"Missing\", false, null);\n        AssertTryGetAttributeValue<int>(\"Missing\", false, 0);\n        AssertTryGetAttributeValue<int>(\"SomeString\", false, 0);\n        AssertTryGetAttributeValue<int>(\"SomeNumberString\", true, 42);\n\n        void AssertTryGetAttributeValue<T>(string valueName, bool expectedSuccess, T expectedResult)\n        {\n            var success = named.TryGetAttributeValue<T>(valueName, out T result);\n            success.Should().Be(expectedSuccess);\n            result.Should().Be(expectedResult);\n\n            success = constructor.TryGetAttributeValue<T>(valueName, out result);\n            success.Should().Be(expectedSuccess);\n            result.Should().Be(expectedResult);\n        }\n    }\n\n    [TestMethod]\n    public void TryGetAttributeValue_ConstructorArgumentAndNamedArgumentNamedTheSame()\n    {\n        var attributeData = AttributeDataWithArguments(namedArguments: new() { { \"Result\", true } }, constructorArguments: new() { { \"Result\", false } });\n        var actualSuccess = attributeData.TryGetAttributeValue(\"Result\", out bool actualValue);\n        actualSuccess.Should().BeTrue();\n        actualValue.Should().BeTrue(); // Named argument takes precedence\n    }\n\n    [TestMethod]\n    public void TryGetAttributeValue_DateTimeConversion()\n    {\n        var attributeData = AttributeDataWithArguments(namedArguments: new() { { \"Result\", \"2022-12-24\" } });\n        var actualSuccess = attributeData.TryGetAttributeValue(\"Result\", out DateTime actualValue);\n        actualSuccess.Should().BeTrue();\n        actualValue.Should().Be(new DateTime(2022, 12, 24));\n    }\n\n    [TestMethod]\n    [DataRow(\"SomeText\", typeof(string))]\n    [DataRow(42, typeof(int))]\n    [DataRow(null, null)]\n    public void TryGetAttributeValue_ObjectConversion(object value, Type expectedType)\n    {\n        var attributeData = AttributeDataWithArguments(namedArguments: new() { { \"Result\", value } });\n        var actualSuccess = attributeData.TryGetAttributeValue(\"Result\", out object actualValue);\n        actualSuccess.Should().BeTrue();\n        if (expectedType != null)\n        {\n            actualValue.Should().BeOfType(expectedType);\n        }\n        actualValue.Should().Be(value);\n    }\n\n    [TestMethod]\n    [DataRow(true)]\n    [DataRow(false)]\n    public void HasAttributeUsageInherited_InheritedSpecified(bool inherited)\n    {\n        var code = $$\"\"\"\n            using System;\n\n            [AttributeUsage(AttributeTargets.All, Inherited = {{inherited.ToString().ToLower()}})]\n            public class MyAttribute: Attribute { }\n\n            [My]\n            public class Program { }\n            \"\"\";\n        CompileAttribute(code).HasAttributeUsageInherited().Should().Be(inherited);\n    }\n\n    [TestMethod]\n    public void HasAttributeUsageInherited_InheritedUnSpecified()\n    {\n        const string code = \"\"\"\n            using System;\n\n            [AttributeUsage(AttributeTargets.All)]\n            public class MyAttribute: Attribute { }\n\n            [My]\n            public class Program { }\n            \"\"\";\n        CompileAttribute(code).HasAttributeUsageInherited().Should().Be(true); // The default for Inherited = true\n    }\n\n    [TestMethod]\n    public void HasAttributeUsageInherited_NoUsageAttribute()\n    {\n        const string code = \"\"\"\n            using System;\n\n            public class MyAttribute: Attribute { }\n\n            [My]\n            public class Program { }\n            \"\"\";\n        CompileAttribute(code).HasAttributeUsageInherited().Should().Be(true); // The default for Inherited = true\n    }\n\n    [TestMethod]\n    [DataRow(true, true)]\n    [DataRow(false, true)] // The \"Inherited\" flag is not inherited for the AttributeUsage attribute itself. See also the SymbolHelperTest.GetAttributesWithInherited... tests,\n                           // where the reflection behavior of MemberInfo.GetCustomAttributes is also tested.\n    public void HasAttributeUsageInherited_UsageInherited(bool inherited, bool expected)\n    {\n        var code = $$\"\"\"\n            using System;\n\n            [AttributeUsage(AttributeTargets.All, Inherited = {{inherited.ToString().ToLower()}})]\n            public class BaseAttribute: Attribute { }\n\n            public class MyAttribute: BaseAttribute { }\n\n            [My]\n            public class Program { }\n            \"\"\";\n        CompileAttribute(code).HasAttributeUsageInherited().Should().Be(expected);\n    }\n\n    [TestMethod]\n    public void HasAttributeUsageInherited_DuplicateAttributeUsage()\n    {\n        const string code = \"\"\"\n            using System;\n\n            [AttributeUsage(AttributeTargets.All, Inherited = true)]\n            [AttributeUsage(AttributeTargets.All, Inherited = false)] // Compiler error\n            public class MyAttribute: Attribute { }\n\n            [My]\n            public class Program { }\n            \"\"\";\n        CompileAttribute(code, ignoreErrors: true).HasAttributeUsageInherited().Should().BeTrue();\n    }\n\n    private static AttributeData CompileAttribute(string code, bool ignoreErrors = false) =>\n        new SnippetCompiler(code, ignoreErrors, AnalyzerLanguage.CSharp).DeclaredSymbol(\"Program\").GetAttributes().Single(x => x.HasName(\"MyAttribute\"));\n\n    private static AttributeDataMock AttributeDataWithName(string attributeClassName)\n    {\n        var namedType = Substitute.For<INamedTypeSymbol>();\n        namedType.Name.Returns(attributeClassName);\n        return new AttributeDataMock(namedType);\n    }\n\n    private static AttributeData AttributeDataWithArguments(Dictionary<string, object> namedArguments = null, Dictionary<string, object> constructorArguments = null)\n    {\n        namedArguments ??= new();\n        constructorArguments ??= new();\n        var separator = constructorArguments.Any() && namedArguments.Any() ? \", \" : string.Empty;\n        var code = $$\"\"\"\n            using System;\n\n            public class MyAttribute: Attribute\n            {\n                public MyAttribute({{constructorArguments.Select(x => $\"{TypeName(x.Value)} {x.Key}\").JoinStr(\", \")}})\n                {\n                }\n\n                {{namedArguments.Select(x => $@\"public {TypeName(x.Value)} {x.Key} {{ get; set; }}\").JoinStr(\"\\r\\n\")}}\n            }\n\n            [My({{constructorArguments.Select(x => Quote(x.Value)).JoinStr(\", \")}}{{separator}}{{namedArguments.Select(x => $\"{x.Key}={Quote(x.Value)}\").JoinStr(\", \")}})]\n            public class Dummy { }\n            \"\"\";\n        var snippet = new SnippetCompiler(code);\n        var classDeclaration = snippet.Tree.GetRoot().DescendantNodes().OfType<ClassDeclarationSyntax>().Last();\n        var symbol = snippet.Model.GetDeclaredSymbol(classDeclaration);\n        return symbol.GetAttributes().First();\n\n        static string TypeName(object value) =>\n            value == null ? \"object\" : value.GetType().FullName;\n\n        static string Quote(object value) =>\n            value switch\n            {\n                string s => @$\"\"\"{s}\"\"\",\n                bool b => b ? \"true\" : \"false\",\n                null => \"null\",\n                var v => v.ToString(),\n            };\n    }\n\n    private class AttributeDataMock : AttributeData\n    {\n        protected override INamedTypeSymbol CommonAttributeClass { get; }\n        protected override IMethodSymbol CommonAttributeConstructor => throw new NotSupportedException();\n        protected override SyntaxReference CommonApplicationSyntaxReference => throw new NotSupportedException();\n        protected override ImmutableArray<TypedConstant> CommonConstructorArguments => throw new NotSupportedException();\n        protected override ImmutableArray<KeyValuePair<string, TypedConstant>> CommonNamedArguments => throw new NotSupportedException();\n\n        public AttributeDataMock(INamedTypeSymbol commonAttributeClass) =>\n            CommonAttributeClass = commonAttributeClass;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Core.Test/Syntax/Extensions/AttributeSyntaxExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Test.Syntax.Extensions;\n\n[TestClass]\npublic class AttributeSyntaxExtensionsTest\n{\n    [TestMethod]\n    [DataRow(\"[System.ObsoleteAttribute] public class X{}\", true)]\n    [DataRow(\"using System; [ObsoleteAttribute] public class X{}\", true)]\n    [DataRow(\"using System; [Obsolete] public class X{}\", true)]\n    [DataRow(\"using System; [Attribute] public class X{}\", false)]\n    [DataRow(\"using System; [AttributeUsageAttribute] public class X{}\", false)]\n    public void IsKnownType_ChecksAttributeType(string code, bool isKnownType)\n    {\n        var compilation = CreateCompilation(code);\n        var syntaxTree = compilation.SyntaxTrees.First();\n        var attribute = syntaxTree.First<AttributeSyntax>();\n\n        attribute.IsKnownType(KnownType.System_ObsoleteAttribute, compilation.GetSemanticModel(syntaxTree)).Should().Be(isKnownType);\n    }\n\n    [TestMethod]\n    public void IsKnownType_TypeNotAnAttribute()\n    {\n        var compilation = CreateCompilation(\"[System.ObsoleteAttribute] public class X{}\");\n        var syntaxTree = compilation.SyntaxTrees.First();\n        var attribute = syntaxTree.First<AttributeSyntax>();\n\n        attribute.IsKnownType(KnownType.System_String, compilation.GetSemanticModel(syntaxTree)).Should().Be(false);\n    }\n\n    [TestMethod]\n    public void IsKnownType_EmptyImmutableArray_ReturnsFalse()\n    {\n        var compilation = CreateCompilation(\"[System.ObsoleteAttribute] public class X{}\");\n        var syntaxTree = compilation.SyntaxTrees.First();\n        var attribute = syntaxTree.First<AttributeSyntax>();\n\n        attribute.IsKnownType(ImmutableArray<KnownType>.Empty, compilation.GetSemanticModel(syntaxTree)).Should().Be(false);\n    }\n\n    private static CSharpCompilation CreateCompilation(string code) =>\n        CSharpCompilation.Create(\"TempAssembly.dll\")\n                         .AddSyntaxTrees(CSharpSyntaxTree.ParseText(code))\n                         .AddReferences(MetadataReferenceFacade.ProjectDefaultReferences)\n                         .WithOptions(new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Core.Test/Syntax/Extensions/AwaitExpressionSyntaxExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.CSharp.Core.Test.Syntax.Extensions;\n\n[TestClass]\npublic class AwaitExpressionSyntaxExtensionsTest\n{\n    [TestMethod]\n    [DataRow(\"[|await t|];\", \"t\")]\n    [DataRow(\"[|await t.ConfigureAwait(false)|];\", \"t\")]\n    [DataRow(\"[|await (t.ConfigureAwait(false))|];\", \"t\")]\n    [DataRow(\"[|await (t).ConfigureAwait(false)|];\", \"(t)\")]\n    [DataRow(\"[|await M(t).ConfigureAwait(false)|];\", \"M(t)\")]\n    [DataRow(\"[|await await TaskOfTask().ConfigureAwait(false)|];\", \"await TaskOfTask().ConfigureAwait(false)\")]\n    [DataRow(\"await [|await TaskOfTask().ConfigureAwait(false)|];\", \"TaskOfTask()\")]\n    [DataRow(\"[|await (await TaskOfTask()).ConfigureAwait(false)|];\", \"(await TaskOfTask())\")]\n    public void AwaitedExpressionWithoutConfigureAwait(string expression, string expected)\n    {\n        var code = $$\"\"\"\n            using System.Threading.Tasks;\n            class C\n            {\n                async Task M(Task t)\n                {\n                    {{expression}}\n                }\n\n                Task<Task> TaskOfTask() => default;\n            }\n            \"\"\";\n        var start = code.IndexOf(\"[|\");\n        code = code.Replace(\"[|\", string.Empty);\n        var end = code.IndexOf(\"|]\");\n        code = code.Replace(\"|]\", string.Empty);\n        var root = CSharpSyntaxTree.ParseText(code).GetRoot();\n        var node = root.FindNode(TextSpan.FromBounds(start, end)) as AwaitExpressionSyntax;\n        var actual = node.AwaitedExpressionWithoutConfigureAwait();\n        actual.ToString().Should().Be(expected);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Core.Test/Syntax/Extensions/BlockSyntaxExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;\n\nnamespace SonarAnalyzer.CSharp.Core.Test.Syntax.Extensions;\n\n[TestClass]\npublic class BlockSyntaxExtensionsTest\n{\n    [TestMethod]\n    public void IsEmpty_BlockMethodEmpty()\n    {\n        var declaration = MethodDeclarationForBlock(@\"\n{\n\n}\");\n        declaration.Body.IsEmpty().Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void IsEmpty_BlockMethodWithCode()\n    {\n        var declaration = MethodDeclarationForBlock(@\"\n{\n    var i = 0;\n}\");\n        declaration.Body.IsEmpty().Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void IsEmpty_ArgumentExceptionOnNull()\n    {\n        var code = @\"\npublic class C\n{\n    public int M() => 1;\n}\";\n\n        var declaration = MethodDeclaration(code);\n        declaration.Body.Should().BeNull();\n        var isEmpty = () => declaration.Body.IsEmpty();\n        isEmpty.Should().Throw<ArgumentNullException>().Which.Message.Should().Contain(\"Value cannot be null\").And.Contain(\"block\");\n    }\n\n    [TestMethod]\n    public void IsEmpty_BlockMethodWithComment_Singleline_On()\n    {\n        var declaration = MethodDeclarationForBlock(@\"\n{\n    // Single line\n}\");\n        declaration.Body.IsEmpty(treatCommentsAsContent: true).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void IsEmpty_BlockMethodWithComment_Singleline_Off()\n    {\n        var declaration = MethodDeclarationForBlock(@\"\n{\n    // Single line\n}\");\n        declaration.Body.IsEmpty(treatCommentsAsContent: false).Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void IsEmpty_BlockMethodWithComment_Empty_On()\n    {\n        var declaration = MethodDeclarationForBlock(@\"\n{\n    //\n}\");\n        declaration.Body.IsEmpty(treatCommentsAsContent: true).Should().BeFalse(); // This is a questionable behavior.\n    }\n\n    [TestMethod]\n    public void IsEmpty_BlockMethodWithComment_Multiline_On()\n    {\n        var declaration = MethodDeclarationForBlock(@\"\n{\n    /* Multi line */\n}\");\n        declaration.Body.IsEmpty(treatCommentsAsContent: true).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void IsEmpty_BlockMethodWithComment_Multiline_Off()\n    {\n        var declaration = MethodDeclarationForBlock(@\"\n{\n    /* Multi line */\n}\");\n        declaration.Body.IsEmpty(treatCommentsAsContent: false).Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void IsEmpty_BlockMethodWithConditionalCompilation_WithDisabledCode_On()\n    {\n        var declaration = MethodDeclarationForBlock(@\"\n{\n#if SomeThing\n    var i = 0;\n#endif\n}\");\n        declaration.Body.IsEmpty(treatConditionalCompilationAsContent: true).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void IsEmpty_BlockMethodWithConditionalCompilation_WithDisabledCode_Off()\n    {\n        var declaration = MethodDeclarationForBlock(@\"\n{\n#if SomeThing\n    var i = 0;\n#endif\n}\");\n        declaration.Body.IsEmpty(treatConditionalCompilationAsContent: false).Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void IsEmpty_BlockMethodWithConditionalCompilation_WithEmptyRegion_On()\n    {\n        var declaration = MethodDeclarationForBlock(@\"\n{\n#region SomeRegion\n#endregion\n}\");\n        declaration.Body.IsEmpty(treatConditionalCompilationAsContent: true).Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void IsEmpty_BlockMethodWithConditionalCompilation_WithEmptyConditional_On()\n    {\n        var declaration = MethodDeclarationForBlock(@\"\n{\n#if SomeCondition\n#endif\n}\");\n        declaration.Body.IsEmpty(treatConditionalCompilationAsContent: true).Should().BeTrue();\n    }\n\n    [TestMethod]\n    [DataRow(true, true, false)]\n    [DataRow(false, true, false)] // isEmpty should be true here, because the content of the conditional is just a comment and a comment should not be treated as content.\n    [DataRow(true, false, true)]\n    [DataRow(false, false, true)]\n    public void IsEmpty_BlockMethodCombinations_CommentInConditional(bool treatCommentsAsContent, bool treatConditionalCompilationAsContent, bool isEmpty)\n    {\n        var declaration = MethodDeclarationForBlock(@\"\n{\n#if SomeCondition\n    // Some comment\n#endif\n}\");\n        if (isEmpty)\n        {\n            declaration.Body.IsEmpty(treatCommentsAsContent, treatConditionalCompilationAsContent).Should().BeTrue();\n        }\n        else\n        {\n            declaration.Body.IsEmpty(treatCommentsAsContent, treatConditionalCompilationAsContent).Should().BeFalse();\n        }\n    }\n\n    [TestMethod]\n    public void IsEmpty_TrailingTriviaOnOpenBrace_Comment()\n    {\n        var block = CreateBlock(afterOpen: CreateTriviaListWithComment());\n        block.IsEmpty(treatCommentsAsContent: true).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void IsEmpty_LeadingTriviaOnCloseBrace_Comment()\n    {\n        var block = CreateBlock(beforeClose: CreateTriviaListWithComment());\n        block.IsEmpty(treatCommentsAsContent: true).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void IsEmpty_TrailingTriviaOnOpenBrace_ConditionalCompilation()\n    {\n        var block = CreateBlock(afterOpen: CreateTriviaListWithConditionalCompilation());\n        block.IsEmpty(treatConditionalCompilationAsContent: true).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void IsEmpty_LeadingTriviaOnCloseBrace_ConditionalCompilation()\n    {\n        var block = CreateBlock(beforeClose: CreateTriviaListWithConditionalCompilation());\n        block.IsEmpty(treatConditionalCompilationAsContent: true).Should().BeFalse();\n    }\n\n    private static SyntaxTriviaList CreateTriviaListWithComment() =>\n        TriviaList(Comment(\"// Comment\"));\n\n    private static SyntaxTriviaList CreateTriviaListWithConditionalCompilation() =>\n        TriviaList(\n            Trivia(IfDirectiveTrivia(IdentifierName(\"Something\"), isActive: false, branchTaken: false, conditionValue: false)),\n            DisabledText(@\"var i= 0;\"),\n            Trivia(EndIfDirectiveTrivia(isActive: false)));\n\n    private static BlockSyntax CreateBlock(SyntaxTriviaList beforeOpen = default,\n                                           SyntaxTriviaList afterOpen = default,\n                                           SyntaxTriviaList beforeClose = default,\n                                           SyntaxTriviaList afterClose = default) =>\n        Block(Token(beforeOpen, SyntaxKind.OpenBraceToken, afterOpen), statements: default, Token(beforeClose, SyntaxKind.CloseBraceToken, afterClose));\n\n    private static MethodDeclarationSyntax MethodDeclarationForBlock(string methodBlock)\n        => MethodDeclaration(WrapInClass(methodBlock));\n\n    private static string WrapInClass(string methodBlockOrArrow) => $@\"\npublic class C\n{{\n    public void M()\n    {methodBlockOrArrow}\n}}\";\n\n    private static MethodDeclarationSyntax MethodDeclaration(string source)\n    {\n        var root = CSharpSyntaxTree.ParseText(source).GetRoot();\n        root.ContainsDiagnostics.Should().BeFalse();\n        return root.DescendantNodes().OfType<MethodDeclarationSyntax>().Single();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Core.Test/Syntax/Extensions/DiagnosticDescriptorExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Test.Syntax.Extensions;\n\n[TestClass]\npublic class DiagnosticDescriptorExtensionsTest\n{\n    [TestMethod]\n    public void IsSecurityHotspot_IsHotspot()\n    {\n        var descriptor = new DiagnosticDescriptor(\"S2092\", \"title\", \"message\", \"category\", DiagnosticSeverity.Warning, true);\n        descriptor.IsSecurityHotspot().Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void IsSecurityHotspot_NonexistentId()\n    {\n        var descriptor = new DiagnosticDescriptor(\"Sxxxx\", \"title\", \"message\", \"category\", DiagnosticSeverity.Warning, true);\n        descriptor.IsSecurityHotspot().Should().BeFalse();\n    }\n\n    [TestMethod]\n    [DataRow(\"S101\")] // Both C# and VB rules\n    [DataRow(\"S100\")] // C# rule\n    [DataRow(\"S117\")] // VB rule\n    public void IsSecurityHotspot_NotHotspot(string ruleId)\n    {\n        var descriptor = new DiagnosticDescriptor(ruleId, \"title\", \"message\", \"category\", DiagnosticSeverity.Warning, true);\n        descriptor.IsSecurityHotspot().Should().BeFalse();\n    }\n\n    // Repro: https://sonarsource.atlassian.net/browse/NET-3543\n    [TestMethod]\n    public void IsEnabled_NullSyntaxTreeOptionsProvider_DoesNotThrow()\n    {\n        var tree = CSharpSyntaxTree.ParseText(\"class C { void M() {} }\", cancellationToken: default);\n        var compilation = CSharpCompilation.Create(\"test\", [tree], options: new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));\n        compilation.Options.SyntaxTreeOptionsProvider.Should().BeNull(\"this is the precondition that triggers the bug\");\n        var context = AnalysisScaffolding.CreateNodeReportingContext(tree.GetRoot(default), compilation.GetSemanticModel(tree), _ => { });\n\n        AnalysisScaffolding.CreateDescriptorMain().IsEnabled(context).Should().BeTrue();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Core.Test/Syntax/Extensions/ExpressionSyntaxExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Test.Syntax.Extensions;\n\n[TestClass]\npublic class ExpressionSyntaxExtensionsTest\n{\n    [TestMethod]\n    [DataRow(\"null\", false)]\n    [DataRow(\"var o = new object();\", true)]\n    [DataRow(\"int? x = 1\", true)]\n    [DataRow(\"int x = 1;\", false)]\n    public void CanBeNull(string code, bool expected)\n    {\n        var (expression, semanticModel) = Compile(code);\n\n        expression.CanBeNull(semanticModel).Should().Be(expected);\n    }\n\n    [TestMethod]\n    [DataRow(\"a\", \"a\")]\n    [DataRow(\"a + b\", \"a\", \"b\")]\n    [DataRow(\"a++\", \"a\")]\n    [DataRow(\"++a\", \"a\")]\n    [DataRow(\"a.b\", \"a.b\")]\n    [DataRow(\"a.b()\", \"a.b()\")]\n    [DataRow(\"a.b() + 1\", \"a.b()\")]\n    [DataRow(\"a.b() + b().c\", \"a.b()\", \"b().c\")]\n    [DataRow(\"a!.b()\", \"a!.b()\")]\n    [DataRow(\"a?.b()\", \"a?.b()\")]\n    [DataRow(\"a.b()?.c.d?[e].f?.g\", \"a.b()?.c.d?[e].f?.g\")] // Should also return \"e\"\n    [DataRow(\"a(b, c)\", \"a(b, c)\", \"b\", \"c\")]\n    [DataRow(\"a[b, c]]\", \"a[b, c]\", \"b\", \"c\")]\n    [DataRow(\"(a)\", \"a\")]\n    [DataRow(\"a as b\", \"a\")]\n    [DataRow(\"a is b\", \"a\")]\n    [DataRow(\"a is b c\", \"a\")]\n    [DataRow(\"(a)b\", \"b\")]\n    [DataRow(\"await a\", \"a\")]\n    [DataRow(\"a!\", \"a\")]\n    [DataRow(\"\"\"  $\"{a} {b}\" \"\"\", \"a\", \"b\")]\n    [DataRow(\"\"\"\" $\"\"\"{a} {b}\"\"\" \"\"\"\", \"a\", \"b\")]\n    [DataRow(\"a switch { b c => d }\", \"a\", \"d\")]\n    [DataRow(\"a switch { b => c, { d: { } } => e }\", \"a\", \"c\", \"e\")]\n    public void ExtractMemberIdentifier(string expression, params string[] memberIdentifiers)\n    {\n        var parsed = SyntaxFactory.ParseExpression(expression);\n        var result = parsed.ExtractMemberIdentifier();\n        var asString = result.Select(x => x.ToString());\n        asString.Should().BeEquivalentTo(memberIdentifiers);\n    }\n\n    [TestMethod]\n    [DataRow(\"a\", \"a\")]\n    [DataRow(\"null\", \"null\")]\n    [DataRow(\"a + b\", \"null\")]\n    [DataRow(\"this.a\", \"a\")]\n    [DataRow(\"this.a.b\", \"a\")]\n    [DataRow(\"a.b\", \"a\")]\n    [DataRow(\"a.b()\", \"a\")]\n    [DataRow(\"a.b().c\", \"a\")]\n    [DataRow(\"a()\", \"a\")]\n    [DataRow(\"a().b\", \"a\")]\n    [DataRow(\"a()!.b\", \"a\")]\n    [DataRow(\"(a.b).c\", \"a\")]\n    [DataRow(\"a.b?.c.d[e]?[f].g?.h\", \"a\")]\n    [DataRow(\"a[b]\", \"a\")]\n    [DataRow(\"a?[b]\", \"a\")]\n    [DataRow(\"a->b\", \"a\")]\n    [DataRow(\"int.MaxValue\", \"int\")]\n    public void GetLeftMostInMemberAccess(string expression, string expected)\n    {\n        var parsed = SyntaxFactory.ParseExpression(expression);\n        var result = parsed.LeftMostInMemberAccess();\n        var asString = result?.ToString() ?? \"null\";\n        asString.Should().BeEquivalentTo(expected);\n    }\n\n    [TestMethod]\n    [DataRow(\"default\", true)]\n    [DataRow(\"default!\", true)]\n    [DataRow(\"(default)!\", true)]\n    [DataRow(\"(default!)\", true)]\n    [DataRow(\"((default)!)\", true)]\n    [DataRow(\"default(int)\", false)]\n    [DataRow(\"default(int)!\", false)]\n    [DataRow(\"(default(int)!)\", false)]\n    [DataRow(\"(1 + 1)\", false)]\n    [DataRow(\"\", false)]\n    [DataRow(\"()\", false)]\n    public void IsDefaultLiteral(string expression, bool expected)\n    {\n        var parsed = SyntaxFactory.ParseExpression(expression);\n        var result = parsed.IsDefaultLiteral();\n        result.Should().Be(expected);\n    }\n\n    [TestMethod]\n    public void IsDefaultLiteral_Null() =>\n        ((ExpressionSyntax)null).IsDefaultLiteral().Should().BeFalse();\n\n    private static (ExpressionSyntax Expression, SemanticModel Model) Compile(string code)\n    {\n        var tree = CSharpSyntaxTree.ParseText(code);\n        var compilation = CSharpCompilation.Create(\"TempAssembly.dll\").AddSyntaxTrees(tree).AddReferences(MetadataReferenceFacade.ProjectDefaultReferences);\n        var model = compilation.GetSemanticModel(tree);\n        return (tree.First<ExpressionSyntax>(), model);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Core.Test/Syntax/Extensions/ITupleOperationWrapperExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text;\nusing FluentAssertions.Extensions;\n\nnamespace SonarAnalyzer.CSharp.Core.Test.Syntax.Extensions;\n\n[TestClass]\npublic class ITupleOperationWrapperExtensionsTest\n{\n    [TestMethod]\n    // Tuple expression on the right side of assignment\n    [DataRow(\"_ = (1, 2);\", \"1\", \"2\")]\n    [DataRow(\"_ = (x: 1, y: 2);\", \"1\", \"2\")]\n    [DataRow(\"_ = (1, M());\", \"1\", \"M()\")]\n    [DataRow(\"_ = (1, (2, 3));\", \"1\", \"2\", \"3\")]\n    [DataRow(\"_ = (1, (2, 3), 4, (5, (6, 7)));\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\")]\n    // Tuple deconstruction on the left side of assignment\n    [DataRow(\"(var a, (var b, var c)) = (1, (2, 3));\", \"var a\", \"var b\", \"var c\")]\n    [DataRow(\"(var a, var b) = (1, 2);\", \"var a\", \"var b\")]\n    [DataRow(\"(var a, _) = (1, 2);\", \"var a\", \"_\")]\n    [DataRow(\"int a; (a, var b) = (1, M());\", \"a\", \"var b\")]\n    // Tuple declaration expression\n    [DataRow(\"var (a, b) = (1, 2);\", \"a\", \"b\")]\n    [DataRow(\"var (a, (b, c)) = (1, (2, 3));\", \"a\", \"b\", \"c\")]\n    [DataRow(\"var (a, (_, c)) = (1, (2, 3));\", \"a\", \"_\", \"c\")]\n    public void AllElements_ElementsOfFirstFoundTupleAreExtracted(string tuple, params string[] expectedElements)\n    {\n        var tupleOperation = CompileFirstTupleOperation(tuple);\n        var allElements = tupleOperation.AllElements();\n        allElements.Select(x => x.Syntax.ToString()).Should().BeEquivalentTo(expectedElements);\n    }\n\n#if NET\n\n    [TestMethod]\n    public void AllElements_Performance_DeepNesting()\n    {\n        // NET48 does not support deeply nested tuples and fails with CS8078: An expression is too long or complex to compile\n        var deeplyNestedTuple = DeeplyNestedTuple(500); // (1, (2,... , 500))..)\n        // Actual execution time is about 0.5 - 10.0 ms on enterprise CI but 15-30ms on sonar-dotnet due to different UT parallelization\n        AssertAllElementsExecutionTimeBeLessThan(deeplyNestedTuple, 75.Milliseconds());\n\n        static string DeeplyNestedTuple(int depth)\n        {\n            var sb = new StringBuilder();\n            for (var i = 1; i < depth; i++)\n            {\n                sb.Append($\"({i}, \");\n            }\n            sb.Append($\"{depth}{new string(')', depth - 1)}\");\n            return sb.ToString();\n        }\n    }\n\n#endif\n\n    [TestMethod]\n    public void AllElements_Performance_LargeTuple()\n    {\n        var largeTuple = LargeTuple(500); // (1, 2,... , 500)\n        // Actual execution time is about 0.4ms - 0.7ms\n        AssertAllElementsExecutionTimeBeLessThan(largeTuple, 20.Milliseconds());\n\n        static string LargeTuple(int length)\n        {\n            var sb = new StringBuilder();\n            sb.Append('(');\n            for (var i = 1; i < length; i++)\n            {\n                sb.Append($\"{i}, \");\n            }\n            sb.Append($\"{length})\");\n            return sb.ToString();\n        }\n    }\n\n    private static void AssertAllElementsExecutionTimeBeLessThan(string tuple, TimeSpan maxDuration)\n    {\n        var tupleOperation = CompileFirstTupleOperation($\"_ = {tuple};\");\n        Action allElements = () => tupleOperation.AllElements();\n        // Warm-up (make sure method is jitted)\n        allElements();\n\n        allElements.ExecutionTime().Should().BeLessThan(maxDuration);\n    }\n\n    private static ITupleOperationWrapper CompileFirstTupleOperation(string tuple)\n    {\n        var syntaxTree = CSharpSyntaxTree.ParseText(WrapInMethod(tuple));\n        var compilation = CSharpCompilation.Create(\"TempAssembly.dll\")\n             .AddSyntaxTrees(syntaxTree)\n             .AddReferences(MetadataReferenceFacade.ProjectDefaultReferences)\n             .WithOptions(new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));\n        compilation.GetDiagnostics().Should().BeEmpty();\n        var model = compilation.GetSemanticModel(syntaxTree);\n        var tupleExpression = syntaxTree.GetRoot().DescendantNodes().First(x => x.Kind() is SyntaxKind.TupleExpression or SyntaxKindEx.ParenthesizedVariableDesignation);\n        return ITupleOperationWrapper.FromOperation(model.GetOperation(tupleExpression));\n    }\n\n    private static string WrapInMethod(string code) =>\n$@\"public class C\n{{\n    public int M()\n    {{\n        {code};\n        return 0;\n    }}\n}}\";\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Core.Test/Syntax/Extensions/InterpolatedStringExpressionSyntaxExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Test.Syntax.Extensions;\n\n[TestClass]\npublic class InterpolatedStringExpressionSyntaxExtensionsTest\n{\n    [TestMethod]\n    [DataRow(@\"var methodCall = $\"\"{Foo()}\"\";\")]\n    [DataRow(@\"var nestedMethodCall = $\"\"{$\"\"{$\"\"{Foo()}\"\"}\"\"}\"\";\")]\n    [DataRow(@\"const int constant = 1; var mixConstantNonConstant = $\"\"{notConstant}{constant}\"\";\")]\n    [DataRow(@\"const int constant = 1; var mixConstantAndLiteral = $\"\"TextValue {constant}\"\";\")]\n    [DataRow(@\"const int constant = 1; var mix = $\"\"{constant}{$\"\"{Foo()}\"\"}{\"\"{notConstant}\"\"}\"\";\")]\n    public void TryGetGetInterpolatedTextValue_UnsupportedSyntaxKinds_ReturnsFalse_CS(string snippet)\n    {\n        var (expression, model) = CompileCS(snippet);\n        InterpolatedStringExpressionSyntaxExtensions.InterpolatedTextValue(expression, model).Should().BeNull();\n    }\n\n    [TestMethod]\n    [DataRow(@\"var textOnly = $\"\"TextOnly\"\";\", \"TextOnly\")]\n    [DataRow(@\"const string constantString = \"\"Foo\"\"; const string constantInterpolation = $\"\"{constantString} with text.\"\";\", \"Foo with text.\")]\n    [DataRow(@\"const string constantString = \"\"Foo\"\"; const string constantInterpolation = $\"\"{$\"\"Nested {constantString}\"\"} with text.\"\";\", \"Nested Foo with text.\")]\n    [DataRow(@\"notConstantString = \"\"SomeValue\"\"; string interpolatedString = $\"\"{notConstantString}\"\";\", \"SomeValue\")]\n    public void TryGetGetInterpolatedTextValue_SupportedSyntaxKinds_ReturnsTrue_CS(string snippet, string expectedTextValue)\n    {\n        var (expression, model) = CompileCS(snippet);\n        InterpolatedStringExpressionSyntaxExtensions.InterpolatedTextValue(expression, model).Should().Be(expectedTextValue);\n    }\n\n    private static (InterpolatedStringExpressionSyntax InterpolatedStringExpression, SemanticModel SemanticModel) CompileCS(string snippet)\n    {\n        var code = $$\"\"\"\n            public class C\n            {\n                public void M(int notConstant, string notConstantString)\n                {\n                    {{snippet}}\n                }\n\n                string Foo() => \"x\";\n            }\n            \"\"\";\n        var tree = CSharpSyntaxTree.ParseText(code);\n        var compilation = CSharpCompilation.Create(\"TempAssembly.dll\").AddSyntaxTrees(tree).AddReferences(MetadataReferenceFacade.ProjectDefaultReferences);\n        var model = compilation.GetSemanticModel(tree);\n        return (tree.First<InterpolatedStringExpressionSyntax>(), model);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Core.Test/Syntax/Extensions/InvocationExpressionSyntaxExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.CSharp.Core.Test.Syntax.Extensions;\n\n[TestClass]\npublic class InvocationExpressionSyntaxExtensionsTest\n{\n    [TestMethod]\n    [DataRow(\"System.Array.$$Empty<int>()$$\", \"System.Array\", \"Empty<int>\")]\n    [DataRow(\"this.$$M()$$\", \"this\", \"M\")]\n    [DataRow(\"A?.$$M()$$\", \"A\", \"M\")]\n    public void TryGetOperands_InvocationNode_ShouldReturnsTrue_CS(string expression, string expectedLeft, string expectedRight)\n    {\n        var code = $$\"\"\"\n            public class X\n            {\n                public X A { get; }\n                public int M()\n                {\n                    var _ = {{expression}};\n                    return 42;\n                }\n            }\n            \"\"\";\n        var node = NodeBetweenMarkers(code, LanguageNames.CSharp) as InvocationExpressionSyntax;\n        var (left, right) = InvocationExpressionSyntaxExtensions.Operands(node);\n\n        left.Should().NotBeNull();\n        left.ToString().Should().Be(expectedLeft);\n        right.Should().NotBeNull();\n        right.ToString().Should().Be(expectedRight);\n    }\n\n    [TestMethod]\n    [DataRow(\"$$M()$$\")]\n    [DataRow(\"new System.Func<int>(() => 1)$$()$$\")]\n    public void TryGetOperands_InvocationNodeDoesNotContainMemberAccess_ShouldReturnsFalse_CS(string expression)\n    {\n        var code = $$\"\"\"\n            public class X\n            {\n                public X A { get; }\n                public int M()\n                {\n                    var _ = {{expression}};\n                    return 42;\n                }\n            }\n            \"\"\";\n        var node = NodeBetweenMarkers(code, LanguageNames.CSharp) as InvocationExpressionSyntax;\n\n        var (left, right) = InvocationExpressionSyntaxExtensions.Operands(node);\n\n        left.Should().BeNull();\n        right.Should().BeNull();\n    }\n\n    [TestMethod]\n    public void HasExactlyNArguments_Null_CS() =>\n        InvocationExpressionSyntaxExtensions.HasExactlyNArguments(null, 42).Should().BeFalse();\n\n    [TestMethod]\n    public void GetMethodCallIdentifier_Null_CS() =>\n        InvocationExpressionSyntaxExtensions.GetMethodCallIdentifier(null).Should().BeNull();\n\n    private static SyntaxNode NodeBetweenMarkers(string code, string language)\n    {\n        var position = code.IndexOf(\"$$\");\n        var lastPosition = code.LastIndexOf(\"$$\");\n        var length = lastPosition == position ? 0 : lastPosition - position - \"$$\".Length;\n        code = code.Replace(\"$$\", string.Empty);\n        return TestCompiler.CompileCS(code).Tree.GetRoot().FindNode(new TextSpan(position, length));\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Core.Test/Syntax/Extensions/ObjectCreationExpressionSyntaxExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Test.Syntax.Extensions;\n\n[TestClass]\npublic class ObjectCreationExpressionSyntaxExtensionsTest\n{\n    [TestMethod]\n    [DataRow(\"new System.DateTime()\", true)]\n    [DataRow(\"using System; class T { DateTime field = new DateTime(); }\", true)]\n    [DataRow(\"new double()\", false)]\n    [DataRow(\"using DT = System.DateTime; class T { DT field = new DT(); }\", false)]\n    public void IsKnownType_ChecksCtorType(string code, bool expectedResult)\n    {\n        var compilation = CreateCompilation(code);\n        var syntaxTree = compilation.SyntaxTrees.First();\n        var objectCreation = syntaxTree.First<ObjectCreationExpressionSyntax>();\n\n        objectCreation.IsKnownType(KnownType.System_DateTime, compilation.GetSemanticModel(syntaxTree)).Should().Be(expectedResult);\n    }\n\n    [TestMethod]\n    public void GetObjectCreationTypeIdentifier_Null_CS() =>\n        ObjectCreationExpressionSyntaxExtensions.GetObjectCreationTypeIdentifier(null).Should().BeNull();\n\n    private static CSharpCompilation CreateCompilation(string code) =>\n        CSharpCompilation.Create(\"TempAssembly.dll\")\n                         .AddSyntaxTrees(CSharpSyntaxTree.ParseText(code))\n                         .AddReferences(MetadataReferenceFacade.ProjectDefaultReferences)\n                         .WithOptions(new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Core.Test/Syntax/Extensions/PatternSyntaxWrapperExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CFG.Extensions;\n\nnamespace SonarAnalyzer.CSharp.Core.Test.Syntax.Extensions;\n\n[TestClass]\npublic class PatternSyntaxWrapperExtensionsTest\n{\n    [TestMethod]\n    public void IsNull_ForNullPattern_ReturnsTrue()\n    {\n        var isPattern = (IsPatternExpressionSyntaxWrapper)SyntaxFactory.ParseExpression(\"is null\");\n        isPattern.Pattern.IsNull().Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void IsNull_ForDifferentPattern_ReturnsFalse()\n    {\n        var isPattern = (IsPatternExpressionSyntaxWrapper)SyntaxFactory.ParseExpression(\"is not 1\");\n        isPattern.Pattern.IsNull().Should().BeFalse();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Core.Test/Syntax/Extensions/PropertyDeclarationSyntaxExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Test.Syntax.Extensions;\n\n[TestClass]\npublic class PropertyDeclarationSyntaxExtensionsTest\n{\n    [TestMethod]\n    public void IsAutoProperty_AccessorWithBody_ReturnsFalse()\n    {\n        const string code = @\"class TestCases\n{\n    public int Property { get { return 0; } }\n}\n\";\n        GetPropertyDeclaration(code).IsAutoProperty().Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void IsAutoProperty_AccessorWithExpressionBody_ReturnsFalse()\n    {\n        const string code = @\"record TestCases\n{\n    public int Property\n    {\n        get => 0;\n    }\n}\n\";\n        GetPropertyDeclaration(code).IsAutoProperty().Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void IsAutoProperty_ExpressionBody_ReturnsFalse()\n    {\n        const string code = @\"record TestCases\n{\n    public int Property => 0;\n}\n\";\n        GetPropertyDeclaration(code).IsAutoProperty().Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void IsAutoProperty_AccessorsWithoutBody_ReturnsTrue()\n    {\n        const string code = @\"class TestCases\n{\n    public int Property { get; set; }\n}\n\";\n        GetPropertyDeclaration(code).IsAutoProperty().Should().BeTrue();\n    }\n\n    private static PropertyDeclarationSyntax GetPropertyDeclaration(string code) =>\n        SyntaxFactory.ParseSyntaxTree(code)\n                     .GetRoot()\n                     .DescendantNodes()\n                     .OfType<PropertyDeclarationSyntax>()\n                     .First();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Core.Test/Syntax/Extensions/StatementSyntaxExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Test.Syntax.Extensions;\n\n[TestClass]\npublic class StatementSyntaxExtensionsTest\n{\n    [TestMethod]\n    public void PrecedingStatement()\n    {\n        var ifMethodStatements = DescendantNodes<MethodDeclarationSyntax>()\n            .First(x => x.Identifier.ValueText == \"IfMethod\")\n            .Body.Statements.ToList();\n\n        ifMethodStatements[2].PrecedingStatement.Should().BeEquivalentTo(ifMethodStatements[1]);\n        ifMethodStatements[1].PrecedingStatement.Should().BeEquivalentTo(ifMethodStatements[0]);\n        ifMethodStatements[0].PrecedingStatement.Should().Be(null);\n    }\n\n    [TestMethod]\n    public void FollowingStatement()\n    {\n        var ifMethodStatements = DescendantNodes<MethodDeclarationSyntax>()\n            .First(x => x.Identifier.ValueText == \"IfMethod\")\n            .Body.Statements.ToList();\n\n        ifMethodStatements[0].FollowingStatement.Should().BeEquivalentTo(ifMethodStatements[1]);\n        ifMethodStatements[1].FollowingStatement.Should().BeEquivalentTo(ifMethodStatements[2]);\n        ifMethodStatements[2].FollowingStatement.Should().Be(null);\n    }\n\n    [TestMethod]\n    public void PrecedingStatementTopLevelStatements()\n    {\n        var sourceTopLevelStatement = \"\"\"\n            var a = 1;\n            var b = 2;\n            if (a == b)\n            {\n                DoSomething();\n            }\n            void DoSomething() { }\n            \"\"\";\n        var variableDeclarators = DescendantNodes<LocalDeclarationStatementSyntax>(sourceTopLevelStatement).ToArray();\n        var aDeclaration = variableDeclarators[0];\n        var bDeclaration = variableDeclarators[1];\n        aDeclaration.PrecedingStatement.Should().Be(null);\n        bDeclaration.PrecedingStatement.Should().BeEquivalentTo(aDeclaration);\n    }\n\n    [TestMethod]\n    public void FirstNonBlockStatement_NoBlock()\n    {\n        var ifStatements = DescendantNodes<IfStatementSyntax>()\n            .Select(x => x.Statement)\n            .ToArray();\n        var expressionStatements = DescendantNodes<ExpressionStatementSyntax>().ToArray();\n        ifStatements[0].FirstNonBlockStatement.Span.Should().Be(expressionStatements[0].Span);\n        ifStatements[1].FirstNonBlockStatement.Span.Should().Be(expressionStatements[1].Span);\n        ifStatements[2].FirstNonBlockStatement.Span.Should().Be(expressionStatements[2].Span);\n    }\n\n    private static IEnumerable<T> DescendantNodes<T>()\n    {\n        var source = \"\"\"\n            namespace Test\n            {\n                class TestClass\n                {\n                    public void IfMethod()\n                    {\n                        if (a > 1)\n                            DoSomething();\n                        if (a < 0)\n                        {\n                            DoSomething();\n                        }\n                        if (a == 42)\n                        {\n                            {\n                                DoSomething();\n                                DoSomething();\n                            }\n                        }\n                    }\n                }\n            }\n            \"\"\";\n        return DescendantNodes<T>(source);\n    }\n\n    private static IEnumerable<T> DescendantNodes<T>(string source) =>\n        CSharpSyntaxTree.ParseText(source)\n            .GetRoot()\n            .DescendantNodes()\n            .OfType<T>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Core.Test/Syntax/Extensions/SyntaxNodeExtensionsCSharpTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Test.Syntax.Extensions;\n\n[TestClass]\npublic class SyntaxNodeExtensionsCSharpTest\n{\n    [TestMethod]\n    public void NameIs()\n    {\n        const string code = \"\"\"\n            public class Sample\n            {\n                public string Method(int arg) =>\n                    arg.ToString();\n            }\n            \"\"\";\n        var toString = CSharpSyntaxTree.ParseText(code).GetRoot().DescendantNodes().OfType<MemberAccessExpressionSyntax>().Single();\n        toString.NameIs(\"ToString\").Should().BeTrue();\n        toString.NameIs(\"TOSTRING\").Should().BeFalse();\n        toString.NameIs(\"tostring\").Should().BeFalse();\n        toString.NameIs(\"test\").Should().BeFalse();\n        toString.NameIs(\"\").Should().BeFalse();\n        toString.NameIs(null).Should().BeFalse();\n    }\n\n    [TestMethod]\n    [DataRow(true, \"Test\")]\n    [DataRow(true, \"Test\", \"Test\")]\n    [DataRow(true, \"Other\", \"Test\")]\n    [DataRow(false)]\n    [DataRow(false, \"TEST\")]\n    public void NameIsOrNames(bool expected, params string[] orNames)\n    {\n        var identifier = SyntaxFactory.IdentifierName(\"Test\");\n        identifier.NameIs(\"other\", orNames).Should().Be(expected);\n    }\n\n    [TestMethod]\n    [DataRow(\"Strasse\", \"Straße\", false)] // StringComparison.InvariantCulture returns in this case and so do other cultures like de-DE\n    [DataRow(\"\\u00F6\", \"\\u006F\\u0308\", false)] // 00F6 = ö; 006F = o; 0308 = https://www.fileformat.info/info/unicode/char/0308/index.htm\n    [DataRow(\"ö\", \"Ö\", false)]\n    [DataRow(\"ö\", \"\\u00F6\", true)]\n    public void NameIs_CultureSensitivity(string identifierName, string actual, bool expected)\n    {\n        var identifier = SyntaxFactory.IdentifierName(identifierName);\n        identifier.NameIs(actual).Should().Be(expected);\n    }\n\n    [TestMethod]\n    [DataRow(false, \"Strasse\", \"Straße\")] // StringComparison.InvariantCulture returns in this case and so do other cultures like de-DE\n    [DataRow(false, \"\\u00F6\", \"\\u006F\\u0308\")] // 00F6 = ö; 006F = o; 0308 = https://www.fileformat.info/info/unicode/char/0308/index.htm\n    [DataRow(false, \"ö\", \"\\u006F\\u0308\", \"ä\", \"oe\")] // 006F = o; 0308 = https://www.fileformat.info/info/unicode/char/0308/index.htm\n    [DataRow(false, \"Köln\", \"Koeln\", \"Cologne, \", \"köln\")]\n    [DataRow(true, \"Köln\", \"Koeln\", \"Cologne, \", \"K\\u00F6ln\")] // 00F6 = ö\n    public void NameIsOrNames_CultureSensitivity(bool expected, string identifierName, string name, params string[] orNames)\n    {\n        var identifier = SyntaxFactory.IdentifierName(identifierName);\n        identifier.NameIs(name, orNames).Should().Be(expected);\n    }\n\n    [TestMethod]\n    public void NameIsOrNamesNodeWithoutName()\n    {\n        var returnStatement = SyntaxFactory.ReturnStatement();\n        returnStatement.NameIs(\"A\", \"B\", \"C\").Should().BeFalse();\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"void M() { var i = 42; }\"\"\")]\n    [DataRow(\"\"\"int M() => 42;\"\"\")]\n    [DataRow(\"\"\"Sample() : this(42) { }\"\"\")]\n    [DataRow(\"\"\"int field = 42;\"\"\")]\n    [DataRow(\"\"\"int Property { get; } = 42;\"\"\")]\n    [DataRow(\"\"\"int Property { get => 42; }\"\"\")]\n    [DataRow(\"\"\"int Property { get { return 42; } }\"\"\")]\n    [DataRow(\"\"\"[Priority(42)] void M() { }\"\"\")]\n    [DataRow(\"\"\"[Priority(Order = 42)] void M() { }\"\"\")]\n    [DataRow(\"\"\"void M(int i = 42) { }\"\"\")]\n    public void ChangeSyntaxElement_ReturnsNewNodeAndModel(string expressionScope)\n    {\n        var code = $$\"\"\"\n            using System;\n            public class PriorityAttribute : Attribute\n            {\n                public PriorityAttribute() { }\n                public PriorityAttribute(int priority) { }\n                public int Order { get; set; }\n            }\n\n            public class Sample\n            {\n                public Sample(int i) { }\n\n                {{expressionScope}}\n            }\n            \"\"\";\n        var (tree, model) = TestCompiler.CompileCS(code);\n        var literal = tree.GetRoot().DescendantNodes().OfType<LiteralExpressionSyntax>().Single();\n        var newLiteral = literal.ChangeSyntaxElement(literal.WithToken(SyntaxFactory.Literal(-42)), model, out var newModel);\n        newLiteral.Should().NotBeNull();\n        newModel.Should().NotBeNull();\n        newLiteral.Token.ValueText.Should().Be(\"-42\");\n        model.GetConstantValue(literal).Value.Should().Be(42);\n        newModel.GetConstantValue(newLiteral).Value.Should().Be(-42);\n    }\n\n    [TestMethod]\n    public void ChangeSyntaxElement_FailsForUnsupportedSyntaxKind()\n    {\n        var (tree, model) = TestCompiler.CompileCS(\"\"\"namespace N { }\"\"\");\n        var namespaceDeclaration = tree.GetRoot().DescendantNodes().OfType<NamespaceDeclarationSyntax>().Single();\n        var newNamespaceDeclaration = namespaceDeclaration.ChangeSyntaxElement(namespaceDeclaration.WithName(SyntaxFactory.IdentifierName(\"M\")), model, out var newModel);\n        newNamespaceDeclaration.Should().BeNull();\n        newModel.Should().BeNull();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Core.Test/Syntax/Extensions/SyntaxTokenExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Syntax.Utilities;\nusing static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;\n\nnamespace SonarAnalyzer.CSharp.Core.Syntax.Extensions.Test;\n\n[TestClass]\npublic class SyntaxTokenExtensionsTest\n{\n    [TestMethod]\n    [DataRow(SyntaxKind.EqualsEqualsToken, ComparisonKind.Equals)]\n    [DataRow(SyntaxKind.ExclamationEqualsToken, ComparisonKind.NotEquals)]\n    [DataRow(SyntaxKind.LessThanToken, ComparisonKind.LessThan)]\n    [DataRow(SyntaxKind.LessThanEqualsToken, ComparisonKind.LessThanOrEqual)]\n    [DataRow(SyntaxKind.GreaterThanToken, ComparisonKind.GreaterThan)]\n    [DataRow(SyntaxKind.GreaterThanEqualsToken, ComparisonKind.GreaterThanOrEqual)]\n    [DataRow(SyntaxKind.PlusToken, ComparisonKind.None)]\n    public void ToComparisonKind(SyntaxKind tokenKind, ComparisonKind expected) =>\n        Token(tokenKind).ToComparisonKind().Should().Be(expected);\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Core.Test/Syntax/Extensions/SyntaxTreeExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Syntax.Extensions;\nusing SonarAnalyzer.Core.Syntax.Utilities;\n\nnamespace SonarAnalyzer.CSharp.Core.Test.Syntax.Extensions;\n\n[TestClass]\npublic class SyntaxTreeExtensionsTest\n{\n    [TestMethod]\n    public void IsGenerated_On_GeneratedTree()\n    {\n        const string source =\n@\"namespace Generated\n{\n    class MyClass\n    {\n        [System.Diagnostics.DebuggerNonUserCodeAttribute()]\n        void M()\n        {\n            ;;;;\n        }\n    }\n}\";\n\n        var result = IsGenerated(source, CSharpGeneratedCodeRecognizer.Instance);\n        result.Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void IsGenerated_On_GeneratedLocalFunctionTree()\n    {\n        const string source =\n@\"namespace Generated\n{\n    class MyClass\n    {\n        void M()\n        {\n            ;;;;\n            [System.Diagnostics.DebuggerNonUserCodeAttribute()]\n            void LocalFunction()\n            {\n                ;;;\n            }\n        }\n    }\n}\";\n        var result = IsGenerated(source, CSharpGeneratedCodeRecognizer.Instance);\n        result.Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void IsGenerated_On_NonGeneratedTree()\n    {\n        const string source =\n@\"namespace NonGenerated\n{\n    class MyClass\n    {\n    }\n}\";\n\n        var result = IsGenerated(source, CSharpGeneratedCodeRecognizer.Instance);\n        result.Should().BeFalse();\n    }\n\n    private static bool IsGenerated(string content, GeneratedCodeRecognizer generatedCodeRecognizer)\n    {\n        var compilation = SolutionBuilder\n           .Create()\n           .AddProject(AnalyzerLanguage.CSharp)\n           .AddSnippet(content)\n           .GetCompilation();\n        return compilation.SyntaxTrees.First().IsGenerated(generatedCodeRecognizer);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Core.Test/Syntax/Extensions/TupleExpressionSyntaxExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Test.Syntax.Extensions;\n\n[TestClass]\npublic class TupleExpressionSyntaxExtensionsTest\n{\n    [TestMethod]\n    [DataRow(\"(1, 2)\", \"1,2\")]\n    [DataRow(\"(1, (2, 3))\", \"1,2,3\")]\n    [DataRow(\"(1, (2, 3), 4)\", \"1,2,3,4\")]\n    [DataRow(\"(1, (2, 3), 4, M())\", \"1,2,3,4,M()\")]\n    [DataRow(\"(1, (2, 3, (4, 5, 6), 7), 8, M())\", \"1,2,3,4,5,6,7,8,M()\")]\n    public void TupleExpressionSyntaxExtensions_FlatteningTests(string tuple, string expectedArguments)\n    {\n        var syntaxTree = CSharpSyntaxTree.ParseText(WrapInMethod(tuple));\n        var tupleExpression = (TupleExpressionSyntaxWrapper)syntaxTree.GetRoot().DescendantNodesAndSelf().First(x => TupleExpressionSyntaxWrapper.IsInstance(x));\n        var allArguments = tupleExpression.AllArguments();\n        var allArgumentsAsString = string.Join(\",\", allArguments.Select(x => x.ToString()));\n        allArgumentsAsString.Should().Be(expectedArguments);\n    }\n\n    private static string WrapInMethod(string code) =>\n$@\"\npublic class C\n{{\n    public int M()\n    {{\n        var t = {code};\n        return 0;\n    }}\n}}\n\";\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Core.Test/Syntax/Extensions/TypeExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.AnalysisContext;\nusing SonarAnalyzer.Core.Analyzers;\n\nnamespace SonarAnalyzer.CSharp.Core.Test.Syntax.Extensions;\n\n[TestClass]\npublic class TypeExtensionsTest\n{\n    [TestMethod]\n    public void AnalyzerTargetLanguage_NotSupportedType()\n    {\n        var analyzerType = typeof(TypeExtensionsTest);\n        var action = () => analyzerType.AnalyzerTargetLanguage();\n\n        action.Should().Throw<NotSupportedException>().WithMessage(\"Can not find any language for the given type TypeExtensionsTest!\");\n    }\n\n    [TestMethod]\n    public void AnalyzerTargetLanguage_MultiLanguage()\n    {\n        var analyzerType = typeof(MultiLanguageAnalyzer);\n        var action = () => analyzerType.AnalyzerTargetLanguage();\n\n        action.Should().Throw<NotSupportedException>().WithMessage(\"Analyzer can not have multiple languages: MultiLanguageAnalyzer\");\n    }\n\n    [TestMethod]\n    public void AnalyzerTargetLanguage_SingleLanguage()\n    {\n        var analyzerType = typeof(SingleLanguageAnalyzer);\n        var language = analyzerType.AnalyzerTargetLanguage();\n        language.Should().Be(AnalyzerLanguage.CSharp);\n    }\n\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    private class SingleLanguageAnalyzer : SonarDiagnosticAnalyzer\n    {\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => throw new NotImplementedException();\n\n        protected override void Initialize(SonarAnalysisContext context) => throw new NotImplementedException();\n    }\n\n    [DiagnosticAnalyzer(LanguageNames.CSharp, LanguageNames.VisualBasic)]\n    private class MultiLanguageAnalyzer : SonarDiagnosticAnalyzer\n    {\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => throw new NotImplementedException();\n\n        protected override void Initialize(SonarAnalysisContext context) => throw new NotImplementedException();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Core.Test/Syntax/Extensions/VariableDesignationSyntaxWrapperTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Test.Syntax.Extensions;\n\n[TestClass]\npublic class VariableDesignationSyntaxWrapperTest\n{\n    [TestMethod]\n    [DataRow(\"var (a, b) = (1, 2);\", \"a,b\")]\n    [DataRow(\"var (a, _) = (1, 2);\", \"a\")]\n    [DataRow(\"var (a, (b, c), d) = (1, (2, 3), 4);\", \"a,b,c,d\")]\n    [DataRow(\"_ = (1, 2) is var (a, b);\", \"a,b\")]\n    [DataRow(\"_ = (1, 2) switch { var (a, b) => true };\", \"a,b\")]\n    public void VariableDesignationSyntaxWrapper_DifferentDesignations(string designation, string expectedVariables)\n    {\n        var syntaxTree = CSharpSyntaxTree.ParseText(WrapInMethod(designation));\n        var variableDesignation = (VariableDesignationSyntaxWrapper)syntaxTree.GetRoot().DescendantNodesAndSelf().First(VariableDesignationSyntaxWrapper.IsInstance);\n        var allVariables = variableDesignation.AllVariables();\n        var allVariablesAsString = string.Join(\",\", allVariables.Select(x => x.SyntaxNode.ToString()));\n        allVariablesAsString.Should().Be(expectedVariables);\n    }\n\n    private static string WrapInMethod(string code) =>\n$@\"\npublic class C\n{{\n    public void M()\n    {{\n        {code}\n    }}\n}}\n\";\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Core.Test/Syntax/Utilities/SafeCSharpSyntaxWalkerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Test.Syntax.Utilities;\n\n[TestClass]\npublic class SafeCSharpSyntaxWalkerTest\n{\n    [TestMethod]\n    public void GivenSyntaxNodeWithReasonableDepth_SafeVisit_ReturnsTrue() =>\n        new Walker().SafeVisit(SyntaxFactory.ParseSyntaxTree(\"void Method() { }\").GetRoot()).Should().BeTrue();\n\n    [TestMethod]\n    public void GivenSyntaxNodeWithHighDepth_SafeVisit_ReturnsFalse()\n    {\n        var method = SyntaxFactory.MethodDeclaration(SyntaxFactory.PredefinedType(SyntaxFactory.Token(SyntaxKind.VoidKeyword)), \"Method\");\n\n        var condition = SyntaxFactory.BinaryExpression(SyntaxKind.NotEqualsExpression,\n                                                       SyntaxFactory.LiteralExpression(SyntaxKind.StringLiteralExpression, SyntaxFactory.Literal(\"a\")),\n                                                       SyntaxFactory.LiteralExpression(SyntaxKind.StringLiteralExpression, SyntaxFactory.Literal(\"b\")));\n\n        var ifStatement = SyntaxFactory.IfStatement(condition, SyntaxFactory.Block());\n\n        var node = ifStatement;\n        for (var index = 0; index < 5000; index++)\n        {\n            node = SyntaxFactory.IfStatement(condition, SyntaxFactory.Block().AddStatements(node));\n        }\n\n        method = method.AddBodyStatements(node);\n\n        new Walker().SafeVisit(method).Should().BeFalse();\n    }\n\n    private class Walker : SafeCSharpSyntaxWalker { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Core.Test/Trackers/FieldAccessTrackerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.CSharp.Core.Trackers.Test;\n\n[TestClass]\npublic class FieldAccessTrackerTest\n{\n    [TestMethod]\n    public void MatchSet_CS()\n    {\n        var tracker = new CSharpFieldAccessTracker();\n        var context = CreateContext(\"assignConst\");\n        tracker.MatchSet()(context).Should().BeTrue();\n\n        context = CreateContext(\"read\");\n        tracker.MatchSet()(context).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void AssignedValueIsConstant_CS()\n    {\n        var tracker = new CSharpFieldAccessTracker();\n        var context = CreateContext(\"assignConst\");\n        tracker.AssignedValueIsConstant()(context).Should().BeTrue();\n\n        context = CreateContext(\"assignVariable\");\n        tracker.AssignedValueIsConstant()(context).Should().BeFalse();\n\n        context = CreateContext(\"invocationArg\");\n        tracker.AssignedValueIsConstant()(context).Should().BeFalse();\n    }\n\n    private static FieldAccessContext CreateContext(string fieldName)\n    {\n        const string code = \"\"\"\n            public class Sample\n            {\n                private int assignConst;\n                private int assignVariable;\n                private int read;\n                private int invocationArg;\n\n                private void Usage()\n                {\n                    var x = read;\n                    assignConst = 42;\n                    assignVariable = x;\n                    Method(invocationArg);\n                }\n\n                private void Method(int arg) { }\n            }\n            \"\"\";\n        var testCode = new SnippetCompiler(code, false, AnalyzerLanguage.CSharp);\n        var node = testCode.Nodes<IdentifierNameSyntax>().First(x => x.ToString() == fieldName);\n        return new FieldAccessContext(testCode.CreateAnalysisContext(node), fieldName);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Core.Test/Wrappers/MethodDeclarationFactoryTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Test.Wrappers;\n\n[TestClass]\npublic class MethodDeclarationFactoryTest\n{\n    [TestMethod]\n    public void MethodDeclarationFactory_WithMethodDeclaration()\n    {\n        const string code = @\"\n                public class Foo\n                {\n                    public void Bar(int y) { }\n                }\";\n        var snippet = new SnippetCompiler(code);\n        var method = snippet.Tree.Single<MethodDeclarationSyntax>();\n        var wrapper = MethodDeclarationFactory.Create(method);\n        wrapper.Body.Should().BeEquivalentTo(method.Body);\n        wrapper.ExpressionBody.Should().BeEquivalentTo(method.ExpressionBody);\n        wrapper.Identifier.Should().BeEquivalentTo(method.Identifier);\n        wrapper.ParameterList.Should().BeEquivalentTo(method.ParameterList);\n        wrapper.HasImplementation.Should().BeTrue();\n        wrapper.IsLocal.Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void MethodDeclarationFactory_WithLocalFunctionDeclaration()\n    {\n        const string code = @\"\n                public class Foo\n                {\n                    public void Bar(int a)\n                    {\n                        LocalFunction();\n                        int LocalFunction() => 1;\n                    }\n                }\";\n        var snippet = new SnippetCompiler(code);\n        var method = snippet.Tree.Single<LocalFunctionStatementSyntax>();\n        var wrapper = MethodDeclarationFactory.Create(method);\n        wrapper.Body.Should().BeEquivalentTo(method.Body);\n        wrapper.ExpressionBody.Should().BeEquivalentTo(method.ExpressionBody);\n        wrapper.Identifier.Should().BeEquivalentTo(method.Identifier);\n        wrapper.ParameterList.Should().BeEquivalentTo(method.ParameterList);\n        wrapper.HasImplementation.Should().BeTrue();\n        wrapper.IsLocal.Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void MethodDeclarationFactory_WithMethodDeclaration_NoImplementation()\n    {\n        const string code = @\"\n                partial class Foo\n                {\n                    partial void Bar(int a);\n                }\";\n        var snippet = new SnippetCompiler(code);\n        var method = snippet.Tree.Single<MethodDeclarationSyntax>();\n        var wrapper = MethodDeclarationFactory.Create(method);\n        wrapper.HasImplementation.Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void MethodDeclarationFactory_Throws_WhenNull()\n    {\n        Action a = () => MethodDeclarationFactory.Create(null);\n        a.Should().Throw<ArgumentNullException>().WithMessage(\"*node*\");\n    }\n\n    [TestMethod]\n    public void MethodDeclarationFactory_Throws_WhenNotMethodOrLocalFunction()\n    {\n        const string code = @\"\n                public partial class Foo\n                {\n                }\";\n        var snippet = new SnippetCompiler(code);\n        var method = snippet.Tree.Single<ClassDeclarationSyntax>();\n        Action a = () => MethodDeclarationFactory.Create(method);\n        a.Should().Throw<InvalidOperationException>().WithMessage(\"Unexpected type: ClassDeclarationSyntax\");\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Core.Test/Wrappers/ObjectCreationFactoryTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Core.Test.Wrappers;\n\n[TestClass]\npublic class ObjectCreationFactoryTest\n{\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    public void ObjectCreationSyntax()\n    {\n        var snippet = new SnippetCompiler(\"\"\"\n            public class A\n            {\n                public int X;\n                public A(int y) { }\n            }\n            public class B\n            {\n                void Foo()\n                {\n                    var bar = new A(1) { X = 2 };\n                }\n            }\n            \"\"\");\n        var objectCreation = snippet.Tree.Single<ObjectCreationExpressionSyntax>();\n        var wrapper = ObjectCreationFactory.Create(objectCreation);\n        wrapper.Expression.Should().BeEquivalentTo(objectCreation);\n        wrapper.Initializer.Should().BeEquivalentTo(objectCreation.Initializer);\n        wrapper.ArgumentList.Should().BeEquivalentTo(objectCreation.ArgumentList);\n        wrapper.InitializerExpressions.Should().BeEquivalentTo(objectCreation.Initializer.Expressions);\n        wrapper.TypeAsString(snippet.Model).Should().Be(\"A\");\n        wrapper.TypeSymbol(snippet.Model).Name.Should().Be(\"A\");\n        wrapper.MethodSymbol(snippet.Model).Parameters.Length.Should().Be(1);\n    }\n\n    [TestMethod]\n    public void ObjectCreationEmptyInitializerSyntax()\n    {\n        var snippet = new SnippetCompiler(\"\"\"\n            public class A\n            {\n                public int X;\n                public A(int y) { }\n            }\n            public class B\n            {\n                void Foo()\n                {\n                    var bar = new A(1);\n                }\n            }\n            \"\"\");\n        var wrapper = ObjectCreationFactory.Create(snippet.Tree.Single<ObjectCreationExpressionSyntax>());\n        wrapper.Initializer.Should().BeNull();\n        wrapper.InitializerExpressions.Should().BeNull();\n    }\n\n    [TestMethod]\n    public void ImplicitObjectCreationSyntax()\n    {\n        var snippet = new SnippetCompiler(\"\"\"\n            public class A\n            {\n                public int X;\n                public A(int y) { }\n            }\n            public class B\n            {\n                void Foo()\n                {\n                    A bar =new(1) { X = 2 };\n                }\n            }\n            \"\"\");\n        var objectCreation = (ImplicitObjectCreationExpressionSyntaxWrapper)snippet.Tree.GetRoot(TestContext.CancellationToken).DescendantNodes()\n            .First(x => x.IsKind(SyntaxKindEx.ImplicitObjectCreationExpression));\n        var wrapper = ObjectCreationFactory.Create(objectCreation);\n        wrapper.Expression.Should().BeEquivalentTo(objectCreation.Node);\n        wrapper.Initializer.Should().BeEquivalentTo(objectCreation.Initializer);\n        wrapper.ArgumentList.Should().BeEquivalentTo(objectCreation.ArgumentList);\n        wrapper.InitializerExpressions.Should().BeEquivalentTo(objectCreation.Initializer.Expressions);\n        wrapper.TypeAsString(snippet.Model).Should().Be(\"A\");\n        wrapper.TypeSymbol(snippet.Model).Name.Should().Be(\"A\");\n        wrapper.MethodSymbol(snippet.Model).Parameters.Length.Should().Be(1);\n    }\n\n    [TestMethod]\n    public void ImplicitObjectCreationEmptyInitializerSyntax()\n    {\n        var snippet = new SnippetCompiler(\"\"\"\n            public class A\n            {\n                public int X;\n                public A(int y) { }\n            }\n            public class B\n            {\n                void Foo()\n                {\n                    A bar = new (1);\n                }\n            }\n            \"\"\");\n        var wrapper = ObjectCreationFactory.Create(snippet.Tree.Single<ImplicitObjectCreationExpressionSyntax>());\n        wrapper.Initializer.Should().BeNull();\n        wrapper.InitializerExpressions.Should().BeNull();\n    }\n\n    [TestMethod]\n    public void GivenImplicitObjectCreationSyntaxWithMissingType_HasEmptyType()\n    {\n        var snippet = new SnippetCompiler(\"\"\"\n            public class B\n            {\n                void Foo()\n                {\n                    var bar = new();\n                }\n            }\n            \"\"\",\n            true,\n            AnalyzerLanguage.CSharp);\n        ObjectCreationFactory.Create((ImplicitObjectCreationExpressionSyntaxWrapper)snippet.Tree.GetRoot(TestContext.CancellationToken).DescendantNodes()\n            .First(x => x.IsKind(SyntaxKindEx.ImplicitObjectCreationExpression)))\n            .TypeAsString(snippet.Model)\n            .Should().BeEmpty();\n    }\n\n    [TestMethod]\n    public void ImplicitObjectCreation_UserDefinedNullable_DoesNotCrash()\n    {\n        var snippet = new SnippetCompiler(\"\"\"\n            public class Repro_3596_AD0001<T> // https://sonarsource.atlassian.net/browse/NET-3596\n            {\n                private readonly Nullable field;\n                public Repro_3596_AD0001() => field = new(this);\n\n                private class Nullable(Repro_3596_AD0001<T> outer) { }\n            }\n            \"\"\");\n        ObjectCreationFactory.Create((ImplicitObjectCreationExpressionSyntaxWrapper)snippet.Tree.GetRoot(TestContext.CancellationToken).DescendantNodes()\n            .First(x => x.IsKind(SyntaxKindEx.ImplicitObjectCreationExpression)))\n            .TypeAsString(snippet.Model)\n            .Should().Be(\"Nullable\");\n    }\n\n    [TestMethod]\n    public void GivenNull_ThrowsException() =>\n        FluentActions.Invoking(() => ObjectCreationFactory.Create(null)).Should().Throw<ArgumentNullException>();\n\n    [TestMethod]\n    public void GivenNonConstructor_ThrowsException() =>\n        FluentActions.Invoking(() => ObjectCreationFactory.Create(new SnippetCompiler(\"public class A{}\").Tree.Single<ClassDeclarationSyntax>()))\n            .Should().Throw<InvalidOperationException>()\n            .WithMessage(\"Unexpected type: ClassDeclarationSyntax\");\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Core.Test/packages.lock.json",
    "content": "{\n  \"version\": 1,\n  \"dependencies\": {\n    \"net10.0\": {\n      \"altcover\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[9.0.102, )\",\n        \"resolved\": \"9.0.102\",\n        \"contentHash\": \"q3Rf5t0M9kXlcO5qhsaAe6NrFSNd5enrhKmF/Ezgmomqw34PbUTbRSYjSDNhS3YGDyUrPTkyPn14EfLDJWztcA==\"\n      },\n      \"Combinatorial.MSTest\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[2.0.0, )\",\n        \"resolved\": \"2.0.0\",\n        \"contentHash\": \"9tB2TMPkuEkYYUq64WREHMMyPt9NfKAyuitpK9yw3zbVe6v/vYkClZTR02+yKFUG+g8XHi5LMTt8jHz4RufGqw==\",\n        \"dependencies\": {\n          \"MSTest.TestFramework\": \"4.0.1\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[3.3.1, )\",\n        \"resolved\": \"3.3.1\",\n        \"contentHash\": \"eT+kgNCDdTRbQ5WF6BGx1HI3D5jYfHteza/koefhWC2vNZGxObA74XxwWfg40dy3uUv7dn3OGKLK5GUPLroVog==\"\n      },\n      \"Microsoft.NET.Test.Sdk\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[18.4.0, )\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"w49iZdL4HL6V25l41NVQLXWQ+e71GvSkKVteMrOL02gP/PUkcnO/1yEb2s9FntU4wGmJWfKnyrRAhcMHd9ZZNA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeCoverage\": \"18.4.0\",\n          \"Microsoft.TestPlatform.TestHost\": \"18.4.0\"\n        }\n      },\n      \"MSTest.TestAdapter\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[4.2.1, )\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"lZRgNzaQnffK4XLjM/og4Eoqp/3IkpcyJQQcyKXkPdkzCT3+ghpwHa9zG1xYhQDbUFoc54M+/waLwh31K9stDQ==\",\n        \"dependencies\": {\n          \"MSTest.TestFramework\": \"4.2.1\",\n          \"Microsoft.Testing.Extensions.VSTestBridge\": \"2.2.1\",\n          \"Microsoft.Testing.Platform.MSBuild\": \"2.2.1\"\n        }\n      },\n      \"MSTest.TestFramework\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[4.2.1, )\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"I4/RbS2TpGZ56CE98+jPbrGlcerYtw2LvPVKzQGvyQQcJDekPy2Kd+fnThXYn+geJ1sW+vA9B7++rFNxvKcWxA==\",\n        \"dependencies\": {\n          \"MSTest.Analyzers\": \"4.2.1\"\n        }\n      },\n      \"SonarAnalyzer.CSharp.Styling\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[10.21.0.135717, )\",\n        \"resolved\": \"10.21.0.135717\",\n        \"contentHash\": \"hl264jF539oB7m2jED5QGM345eFSiDAdoJc8TH0HM6L7ZeqT5TDqZDQeZ8IDP02dVIpH/Fhhn+HsGfEcj8ohyQ==\"\n      },\n      \"StyleCop.Analyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.2.0-beta.556, )\",\n        \"resolved\": \"1.2.0-beta.556\",\n        \"contentHash\": \"llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==\",\n        \"dependencies\": {\n          \"StyleCop.Analyzers.Unstable\": \"1.2.0.556\"\n        }\n      },\n      \"Castle.Core\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.1.1\",\n        \"contentHash\": \"rpYtIczkzGpf+EkZgDr9CClTdemhsrwA/W5hMoPjLkRFnXzH44zDLoovXeKtmxb1ykXK9aJVODSpiJml8CTw2g==\",\n        \"dependencies\": {\n          \"System.Diagnostics.EventLog\": \"6.0.0\"\n        }\n      },\n      \"FluentAssertions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.2.1\",\n        \"contentHash\": \"MilqBF2lZrT0V1azIA6DG6I/snS0rG3A8ohT2Jjkhq6zOFk76nqx4BPnEnzrX6jFVa6xvkDU++z3PebCGZyJ4g==\",\n        \"dependencies\": {\n          \"System.Configuration.ConfigurationManager\": \"6.0.0\"\n        }\n      },\n      \"FluentAssertions.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"0.34.1\",\n        \"contentHash\": \"2BnAAB8CCPdRA9P1+lAvBZOleR2BTmsxGMtGt+LnABJUARGqoGMWEFxG3znZYqHVIrMP0Za/kyw6atyt8x2mzA==\"\n      },\n      \"Google.Protobuf\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"3.6.1\",\n        \"contentHash\": \"741fGeDQjixBJaU2j+0CbrmZXsNJkTn/hWbOh4fLVXndHsCclJmWznCPWrJmPoZKvajBvAz3e8ECJOUvRtwjNQ==\",\n        \"dependencies\": {\n          \"NETStandard.Library\": \"1.6.1\"\n        }\n      },\n      \"Humanizer.Core\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.14.1\",\n        \"contentHash\": \"lQKvtaTDOXnoVJ20ibTuSIOf2i0uO0MPbDhd1jm238I+U/2ZnRENj0cktKZhtchBMtCUSRQ5v4xBCUbKNmyVMw==\"\n      },\n      \"Microsoft.ApplicationInsights\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.23.0\",\n        \"contentHash\": \"nWArUZTdU7iqZLycLKWe0TDms48KKGE6pONH2terYNa8REXiqixrMOkf1sk5DHGMaUTqONU2YkS4SAXBhLStgw==\",\n        \"dependencies\": {\n          \"System.Diagnostics.DiagnosticSource\": \"5.0.0\"\n        }\n      },\n      \"Microsoft.Build.Framework\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"17.11.48\",\n        \"contentHash\": \"C3WIMt2wBl4++NX3jSEpTq5KXBhvAV154R4JrYHkfy9JSBcXWiL0mkgpspk5xSdOj+fS/uz7zluIy6bMM1fkkQ==\"\n      },\n      \"Microsoft.Build.Locator\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.11.2\",\n        \"contentHash\": \"tY+/S54G29CGsbL3slVu4vqtpciwVnb3fKOmrhgzEQmu/VziFaWmD/E1e/2KH7cDucuycGSkWsSXndBs5Uawow==\"\n      },\n      \"Microsoft.CodeAnalysis.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0-2.25625.1\",\n        \"contentHash\": \"4Yhh2fnu3G+J0J1lDc8WZVgMjgbynSeTfkl5IFJMFrmiIO0sc7Tjx+f3sFVV8Sd35PrIUWfof0RWc3lAMl7Azg==\"\n      },\n      \"Microsoft.CodeAnalysis.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"uC0qk3jzTQY7i90ehfnCqaOZpBUGJyPMiHJ3c0jOb8yaPBjWzIhVdNxPbeVzI74DB0C+YgBKPLqUkgFZzua5Mg==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"SQFNGQF4f7UfDXKxMzzGNMr3fjrPDIjLfmRvvVgDCw+dyvEHDaRfHuKA5q0Pr0/JW0Gcw89TxrxrS/MjwBvluQ==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp.Workspaces\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"mRwxchBs3ewXK4dqK4R/eVCx99VIq1k/lhwArlu+fJuV0uzmbkTTRw4jR9gN9sOcAQfX0uV9KQlmCk1yC0JNog==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.CSharp\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.VisualBasic\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"AJxddsIOmfimuihaLuSAm4c/zskHoL1ypAjIpSOZqHlNm2iuw0twsB8nbKczJyfClqD7+iYjdIeE5EV8WAyxRA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"pAGdr4qs7+v287DPiiM8px1cBXnhe8LxymkVGTnCwv2OEjCk5HO2zIoFvype4ivKJTRW3aTUUV8ab+915wbv+w==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.VisualBasic\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Workspaces.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"QSf1ge9A+XFZbGL+gIqXYBIKlm8QdQVLvHDPZiydG11W6mJY7XBMusrsgIEz6L8GYMzGJKTM78m9icliGMF7NA==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Workspaces.MSBuild\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"2Mg/ppo5dza1e4DJWX4+RIHMc3FgnYzuHTaLRZDupiK1LTi/PAZ1PBpF/iivHVNKQKwipHE984gy37MbM0RO9Q==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.Build.Framework\": \"17.11.48\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"Microsoft.Extensions.DependencyInjection\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Options\": \"9.0.0\",\n          \"Microsoft.Extensions.Primitives\": \"9.0.0\",\n          \"Microsoft.VisualStudio.SolutionPersistence\": \"1.0.52\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeCoverage\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"9O0BtCfzCWrkAmK187ugKdq72HHOXoOUjuWFDVc2LsZZ0pOnA9bTt+Sg9q4cF+MoAaUU+MuWtvBuFsnduviJow==\"\n      },\n      \"Microsoft.Composition\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.27\",\n        \"contentHash\": \"pwu80Ohe7SBzZ6i69LVdzowp6V+LaVRzd5F7A6QlD42vQkX0oT7KXKWWPlM/S00w1gnMQMRnEdbtOV12z6rXdQ==\"\n      },\n      \"Microsoft.Extensions.DependencyInjection\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"MCPrg7v3QgNMr0vX4vzRXvkNGgLg8vKWX0nKCWUxu2uPyMsaRgiRc1tHBnbTcfJMhMKj2slE/j2M9oGkd25DNw==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.DependencyInjection.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"+6f2qv2a3dLwd5w6JanPIPs47CxRbnk+ZocMJUhv9NxP88VlOcJYZs9jY+MYSjxvady08bUZn6qgiNh7DadGgg==\"\n      },\n      \"Microsoft.Extensions.Logging\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"crjWyORoug0kK7RSNJBTeSE6VX8IQgLf3nUpTB9m62bPXp/tzbnOsnbe8TXEG0AASNaKZddnpHKw7fET8E++Pg==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Options\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.Logging.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"g0UfujELzlLbHoVG8kPKVBaW470Ewi+jnptGS9KUi6jcb+k2StujtK3m26DFSGGwQ/+bVgZfsWqNzlP6YOejvw==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.Options\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"y2146b3jrPI3Q0lokKXdKLpmXqakYbDIPDV6r3M8SqvSf45WwOTzkyfDpxnZXJsJQEpAsAqjUq5Pu8RCJMjubg==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Primitives\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"N3qEBzmLMYiASUlKxxFIISP4AiwuPTHF5uCh+2CWSwwzAJiIYx0kBJsS30cp1nvhSySFAVi30jecD307jV+8Kg==\"\n      },\n      \"Microsoft.Testing.Extensions.Telemetry\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"7zB8BjffOyvqfHF26rFVPuK0w1fCf5+j1tLuhHIr76CqxXkGb+fMJtq6YNOV+m6qPytExHMXxluk3RgJ+dSIqw==\",\n        \"dependencies\": {\n          \"Microsoft.ApplicationInsights\": \"2.23.0\",\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.Testing.Extensions.TrxReport.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"RD6D1Jx6cKDA5IHd1H2q8ylIuQG3PD+gdULI0JC8CvsRtaypFzTFpB5xDPuQi8o6kAkcM04cBhAiJPxZboNH2Q==\",\n        \"dependencies\": {\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.Testing.Extensions.VSTestBridge\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"D8AGlkNtlTQPe3zf4SLnHBMr13lerMe0RuHSoRfnRatcuX/T7YbRtgn39rWBjKhXsNio0WXKrPKv3gfWE2I46w==\",\n        \"dependencies\": {\n          \"Microsoft.TestPlatform.ObjectModel\": \"18.3.0\",\n          \"Microsoft.Testing.Extensions.Telemetry\": \"2.2.1\",\n          \"Microsoft.Testing.Extensions.TrxReport.Abstractions\": \"2.2.1\",\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.Testing.Platform\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"9bbPuls/b6/vUFzxbSjJLZlJHyKBfOZE5kjIY+ITI2ASqlFPJhR83BdLydJeQOCLEZhEbrEcz5xtt1B69nwSVg==\"\n      },\n      \"Microsoft.Testing.Platform.MSBuild\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"CSJOcZHfKlTyPbS0CTJk6iEnU4gJC+eUA5z72UBnMDRdgVHYOmB8k9Y7jT233gZjnCOQiYFg3acQHRfu2H62nw==\",\n        \"dependencies\": {\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.TestPlatform.ObjectModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"4L6m2kS2pY5uJ9cpeRxzW22opr6ttScIRqsOpMDQpgENp/ZwxkkQCcmc6LRSURo2dFaaSW5KVflQZvroiJ7Wzg==\",\n        \"dependencies\": {\n          \"System.Reflection.Metadata\": \"8.0.0\"\n        }\n      },\n      \"Microsoft.TestPlatform.TestHost\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"gZsCHI+zOmZCcKZieIL4Jg14qKD2OGZOmX5DehuIk1EA9BN6Crm0+taXQNEuajOH1G9CCyBxw8VWR4t5tumcng==\",\n        \"dependencies\": {\n          \"Microsoft.TestPlatform.ObjectModel\": \"18.4.0\",\n          \"Newtonsoft.Json\": \"13.0.3\"\n        }\n      },\n      \"Microsoft.VisualStudio.SolutionPersistence\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.52\",\n        \"contentHash\": \"oNv2JtYXhpdJrX63nibx1JT3uCESOBQ1LAk7Dtz/sr0+laW0KRM6eKp4CZ3MHDR2siIkKsY8MmUkeP5DKkQQ5w==\"\n      },\n      \"Microsoft.Win32.SystemEvents\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"hqTM5628jSsQiv+HGpiq3WKBl2c8v1KZfby2J6Pr7pEPlK9waPdgEO6b8A/+/xn/yZ9ulv8HuqK71ONy2tg67A==\"\n      },\n      \"MSTest.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"1i9jgE/42KGGyZ4s0MdrYM/Uu/dRYhbRfYQifcO0AZ6vw4sBXRjoQGQRGNSm771AYgPAmoGl0u4sJc2lMET6HQ==\"\n      },\n      \"Newtonsoft.Json\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"13.0.3\",\n        \"contentHash\": \"HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==\"\n      },\n      \"NSubstitute\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"lJ47Cps5Qzr86N99lcwd+OUvQma7+fBgr8+Mn+aOC0WrlqMNkdivaYD9IvnZ5Mqo6Ky3LS7ZI+tUq1/s9ERd0Q==\",\n        \"dependencies\": {\n          \"Castle.Core\": \"5.1.1\"\n        }\n      },\n      \"NuGet.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"1mp7zmyAGmQfT93ELC4c+MYOrJ8Ff4ekFZRek4JSVLb/wOO/o0bsPfLmqujCsJ2Hlwc+fpq1TQEnjSEgWdt8ng==\",\n        \"dependencies\": {\n          \"NuGet.Frameworks\": \"7.3.1\"\n        }\n      },\n      \"NuGet.Configuration\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"tGxWBo47EQONOaqY+MbEWMrNjFthHgfavLM1HE0RcLyOXVCoQKBlZGV7v0hrS/rJrQKw6ZaBeHetX+ZJgS7Lxg==\",\n        \"dependencies\": {\n          \"NuGet.Common\": \"7.3.1\",\n          \"System.Security.Cryptography.ProtectedData\": \"8.0.0\"\n        }\n      },\n      \"NuGet.Frameworks\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"VUPAE5l/Ir4Gb3dv+v0jq0Qe4nfwxfrfiYN7QhwlGyWPXFKYXSSke1t1bV/ZYd6idtTtRDqJPM49Lt/U8NTocg==\"\n      },\n      \"NuGet.Packaging\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"5bT8uOrNBx4Srhbrd3HonYmyKhWJkvQyTWTYE2jvfPgYx2aCbPmq8MCYko7ce78hEN9mpq2xlrztVhguYPc+GQ==\",\n        \"dependencies\": {\n          \"Newtonsoft.Json\": \"13.0.3\",\n          \"NuGet.Configuration\": \"7.3.1\",\n          \"NuGet.Versioning\": \"7.3.1\",\n          \"System.Security.Cryptography.Pkcs\": \"8.0.1\"\n        }\n      },\n      \"NuGet.Protocol\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"vYd5vtCJ/tpMQjbAs6rrftNgeh5Ip1w7tnEsDZCpGObKgUgOxHQBekCul3TnzmbNgobvJEkDJNaec5/ZBv66Hg==\",\n        \"dependencies\": {\n          \"NuGet.Packaging\": \"7.3.1\"\n        }\n      },\n      \"NuGet.Versioning\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"TJrQWSmD1vakfav7qIhDXgDFfaZFfMJ+v6P8tcND9ZqXajD5B/ZzaoGYNzL4D3eDue6vAOUvwzu42G+19JNVUA==\"\n      },\n      \"StyleCop.Analyzers.Unstable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.2.0.556\",\n        \"contentHash\": \"zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==\"\n      },\n      \"System.Collections.Immutable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"AurL6Y5BA1WotzlEvVaIDpqzpIPvYnnldxru8oXJU2yFxFUy3+pNXjXd1ymO+RA0rq0+590Q8gaz2l3Sr7fmqg==\"\n      },\n      \"System.Composition\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"3Djj70fFTraOarSKmRnmRy/zm4YurICm+kiCtI0dYRqGJnLX6nJ+G3WYuFJ173cAPax/gh96REcbNiVqcrypFQ==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\",\n          \"System.Composition.Convention\": \"9.0.0\",\n          \"System.Composition.Hosting\": \"9.0.0\",\n          \"System.Composition.Runtime\": \"9.0.0\",\n          \"System.Composition.TypedParts\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.AttributedModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"iri00l/zIX9g4lHMY+Nz0qV1n40+jFYAmgsaiNn16xvt2RDwlqByNG4wgblagnDYxm3YSQQ0jLlC/7Xlk9CzyA==\"\n      },\n      \"System.Composition.Convention\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"+vuqVP6xpi582XIjJi6OCsIxuoTZfR0M7WWufk3uGDeCl3wGW6KnpylUJ3iiXdPByPE0vR5TjJgR6hDLez4FQg==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.Hosting\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"OFqSeFeJYr7kHxDfaViGM1ymk7d4JxK//VSoNF9Ux0gpqkLsauDZpu89kTHHNdCWfSljbFcvAafGyBoY094btQ==\",\n        \"dependencies\": {\n          \"System.Composition.Runtime\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.Runtime\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"w1HOlQY1zsOWYussjFGZCEYF2UZXgvoYnS94NIu2CBnAGMbXFAX8PY8c92KwUItPmowal68jnVLBCzdrWLeEKA==\"\n      },\n      \"System.Composition.TypedParts\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"aRZlojCCGEHDKqh43jaDgaVpYETsgd7Nx4g1zwLKMtv4iTo0627715ajEFNpEEBTgLmvZuv8K0EVxc3sM4NWJA==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\",\n          \"System.Composition.Hosting\": \"9.0.0\",\n          \"System.Composition.Runtime\": \"9.0.0\"\n        }\n      },\n      \"System.Configuration.ConfigurationManager\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"7T+m0kDSlIPTHIkPMIu6m6tV6qsMqJpvQWW2jIc2qi7sn40qxFo0q+7mEQAhMPXZHMKnWrnv47ntGlM/ejvw3g==\",\n        \"dependencies\": {\n          \"System.Security.Cryptography.ProtectedData\": \"6.0.0\",\n          \"System.Security.Permissions\": \"6.0.0\"\n        }\n      },\n      \"System.Diagnostics.DiagnosticSource\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.0.0\",\n        \"contentHash\": \"tCQTzPsGZh/A9LhhA6zrqCRV4hOHsK90/G7q3Khxmn6tnB1PuNU0cRaKANP2AWcF9bn0zsuOoZOSrHuJk6oNBA==\"\n      },\n      \"System.Diagnostics.EventLog\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"lcyUiXTsETK2ALsZrX+nWuHSIQeazhqPphLfaRxzdGaG93+0kELqpgEHtwWOlQe7+jSFnKwaCAgL4kjeZCQJnw==\"\n      },\n      \"System.Drawing.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"NfuoKUiP2nUWwKZN6twGqXioIe1zVD0RIj2t976A+czLHr2nY454RwwXs6JU9Htc6mwqL6Dn/nEL3dpVf2jOhg==\",\n        \"dependencies\": {\n          \"Microsoft.Win32.SystemEvents\": \"6.0.0\"\n        }\n      },\n      \"System.Reflection.Metadata\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"ptvgrFh7PvWI8bcVqG5rsA/weWM09EnthFHR5SCnS6IN+P4mj6rE1lBDC4U8HL9/57htKAqy4KQ3bBj84cfYyQ==\",\n        \"dependencies\": {\n          \"System.Collections.Immutable\": \"8.0.0\"\n        }\n      },\n      \"System.Security.AccessControl\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"AUADIc0LIEQe7MzC+I0cl0rAT8RrTAKFHl53yHjEUzNVIaUlhFY11vc2ebiVJzVBuOzun6F7FBA+8KAbGTTedQ==\"\n      },\n      \"System.Security.Cryptography.Pkcs\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.1\",\n        \"contentHash\": \"CoCRHFym33aUSf/NtWSVSZa99dkd0Hm7OCZUxORBjRB16LNhIEOf8THPqzIYlvKM0nNDAPTRBa1FxEECrgaxxA==\"\n      },\n      \"System.Security.Cryptography.ProtectedData\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"+TUFINV2q2ifyXauQXRwy4CiBhqvDEDZeVJU7qfxya4aRYOKzVBpN+4acx25VcPB9ywUN6C0n8drWl110PhZEg==\"\n      },\n      \"System.Security.Permissions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"T/uuc7AklkDoxmcJ7LGkyX1CcSviZuLCa4jg3PekfJ7SU0niF0IVTXwUiNVP9DSpzou2PpxJ+eNY2IfDM90ZCg==\",\n        \"dependencies\": {\n          \"System.Security.AccessControl\": \"6.0.0\",\n          \"System.Windows.Extensions\": \"6.0.0\"\n        }\n      },\n      \"System.Windows.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"IXoJOXIqc39AIe+CIR7koBtRGMiCt/LPM3lI+PELtDIy9XdyeSrwXFdWV9dzJ2Awl0paLWUaknLxFQ5HpHZUog==\",\n        \"dependencies\": {\n          \"System.Drawing.Common\": \"6.0.0\"\n        }\n      },\n      \"sonaranalyzer.cfg\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer.Lightup\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.core\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Google.Protobuf\": \"[3.6.1, )\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.CFG\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.csharp.core\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.CFG\": \"[10.26.0, )\",\n          \"SonarAnalyzer.Core\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer.lightup\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.testframework\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Combinatorial.MSTest\": \"[2.0.0, )\",\n          \"FluentAssertions\": \"[7.2.1, )\",\n          \"FluentAssertions.Analyzers\": \"[0.34.1, )\",\n          \"MSTest.TestAdapter\": \"[4.2.1, )\",\n          \"MSTest.TestFramework\": \"[4.2.1, )\",\n          \"Microsoft.Build.Locator\": \"[1.11.2, )\",\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[5.3.0, )\",\n          \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": \"[5.3.0, )\",\n          \"Microsoft.CodeAnalysis.Workspaces.MSBuild\": \"[5.3.0, )\",\n          \"Microsoft.NET.Test.Sdk\": \"[18.4.0, )\",\n          \"NSubstitute\": \"[5.3.0, )\",\n          \"NuGet.Protocol\": \"[7.3.1, )\",\n          \"SonarAnalyzer.Core\": \"[10.26.0, )\",\n          \"altcover\": \"[9.0.102, )\"\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Common/StylingRuleTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing FluentAssertions;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing SonarAnalyzer.CSharp.Styling.Common;\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class StylingRuleTest\n{\n    private readonly Type[] stylingAnalyzers = typeof(StylingAnalyzer).Assembly.GetExportedTypes().Where(x => typeof(DiagnosticAnalyzer).IsAssignableFrom(x) && !x.IsAbstract).ToArray();\n\n    [TestMethod]\n    public void StylingRuleTestScaffolding_FindsAnalyzers() =>\n        stylingAnalyzers.Should().NotBeEmpty();\n\n    [TestMethod]\n    public void Analyzers_InheritStylingAnalyzer()\n    {\n        foreach (var type in stylingAnalyzers)\n        {\n            type.Should().BeAssignableTo(typeof(StylingAnalyzer), \"Styling rules should have a simple strucure. StylingAnalyzer should be enough.\");\n        }\n    }\n\n    [TestMethod]\n    public void RuleIDs_AreUnique()\n    {\n        var ids = new Dictionary<string, Type>();\n        foreach (var type in stylingAnalyzers)\n        {\n            var analyzer = (DiagnosticAnalyzer)Activator.CreateInstance(type);\n            foreach (var descriptor in analyzer.SupportedDiagnostics)\n            {\n                ids.TryAdd(descriptor.Id, type).Should().BeTrue(\"Each rule ID should be registered by a single analyzer but {0} is used by at least the two analyzers {1} and {2}.\",\n                    descriptor.Id, type, ids[descriptor.Id]);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Common/StylingVerifierBuilder.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Diagnostics;\n\nnamespace SonarAnalyzer.CSharp.Styling.Common.Test;\n\npublic static class StylingVerifierBuilder\n{\n    // This should solve only simple cases. Do not add parametrized overloads to preserve the builder logic.\n    public static VerifierBuilder Create<TAnalyzer>() where TAnalyzer : DiagnosticAnalyzer, new() =>\n        new VerifierBuilder<TAnalyzer>().WithOptions(LanguageOptions.CSharpLatest);  // We don't use older version on our codebase => we don't need to waste time testing them.\n\n    // This should solve only simple cases. Do not add parametrized overloads.\n    public static void Verify<TAnalyzer>() where TAnalyzer : DiagnosticAnalyzer, new() =>\n        new VerifierBuilder<TAnalyzer>()\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .AddPaths(typeof(TAnalyzer).Name + \".cs\")\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/AllArgumentsOnSameLineTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class AllArgumentsOnSameLineTest\n{\n    [TestMethod]\n    public void AllArgumentsOnSameLine() =>\n        StylingVerifierBuilder.Verify<AllArgumentsOnSameLine>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/AllParametersOnSameColumnTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class AllParametersOnSameColumnTest\n{\n    [TestMethod]\n    public void AllParametersOnSameColumn() =>\n        StylingVerifierBuilder.Verify<AllParametersOnSameColumn>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/AllParametersOnSameLineTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class AllParametersOnSameLineTest\n{\n    [TestMethod]\n    public void AllParametersOnSameLine() =>\n        StylingVerifierBuilder.Verify<AllParametersOnSameLine>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/ArrowLocationTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class ArrowLocationTest\n{\n    [TestMethod]\n    public void ArrowLocation() =>\n        StylingVerifierBuilder.Verify<ArrowLocation>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/AvoidArrangeActAssertCommentTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class AvoidArrangeActAssertCommentTest\n{\n    [TestMethod]\n    public void AvoidArrangeActAssertComment() =>\n        StylingVerifierBuilder\n            .Create<AvoidArrangeActAssertComment>()\n            .AddPaths(\"AvoidArrangeActAssertComment.cs\")\n            .AddTestReference()\n            .Verify();\n\n    [TestMethod]\n    public void AvoidArrangeActAssertComment_NonTestProject() =>\n        StylingVerifierBuilder\n            .Create<AvoidArrangeActAssertComment>()\n            .AddPaths(\"AvoidArrangeActAssertComment.cs\")\n            .VerifyNoIssues();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/AvoidDeconstructionTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class AvoidDeconstructionTest\n{\n    [TestMethod]\n    public void AvoidDeconstruction() =>\n        StylingVerifierBuilder.Verify<AvoidDeconstruction>();\n\n    [TestMethod]\n    public void AvoidDeconstruction_TopLevelStatement() =>\n        StylingVerifierBuilder.Create<AvoidDeconstruction>()\n            .AddPaths(\"AvoidDeconstruction.TopLevelStatements.cs\")\n            .WithTopLevelStatements()\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/AvoidGetTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class AvoidGetTest\n{\n    [TestMethod]\n    public void AvoidGet() =>\n        StylingVerifierBuilder.Verify<AvoidGet>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/AvoidListForEachTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class AvoidListForEachTest\n{\n    [TestMethod]\n    public void AvoidListForEach() =>\n        StylingVerifierBuilder.Verify<AvoidListForEach>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/AvoidNullableTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class AvoidNullableTest\n{\n    [TestMethod]\n    public void AvoidNullable() =>\n        StylingVerifierBuilder.Verify<AvoidNullable>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/AvoidPrimaryConstructorTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class AvoidPrimaryConstructorTest\n{\n    [TestMethod]\n    public void AvoidPrimaryConstructor() =>\n        StylingVerifierBuilder.Verify<AvoidPrimaryConstructor>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/AvoidUnusedInterpolationTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class AvoidUnusedInterpolationTest\n{\n    [TestMethod]\n    public void AvoidUnusedInterpolation() =>\n        StylingVerifierBuilder.Verify<AvoidUnusedInterpolation>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/AvoidValueTupleTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class AvoidValueTupleTest\n{\n    private readonly VerifierBuilder builder = StylingVerifierBuilder.Create<AvoidValueTuple>().AddPaths(\"AvoidValueTuple.cs\");\n\n    [TestMethod]\n    public void AvoidValueTuple() =>\n        builder.Verify();\n\n    [TestMethod]\n    public void AvoidValueTuple_TestCode() =>\n        builder.AddTestReference().VerifyNoIssues();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/AvoidVarPatternTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class AvoidVarPatternTest\n{\n    [TestMethod]\n    public void AvoidVarPattern() =>\n        StylingVerifierBuilder.Verify<AvoidVarPattern>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/FieldOrderingTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class FieldOrderingTest\n{\n    [TestMethod]\n    public void FieldOrdering() =>\n        StylingVerifierBuilder.Verify<FieldOrdering>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/FileScopeNamespaceTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.TestFramework.Common;\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class FileScopeNamespaceTest\n{\n    private readonly VerifierBuilder builder = StylingVerifierBuilder.Create<FileScopeNamespace>().WithConcurrentAnalysis(false);\n\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    public void FileScopeNamespace() =>\n        builder.AddPaths(\"FileScopeNamespace.cs\").Verify();\n\n    [TestMethod]\n    public void FileScopeNamespace_TestCode() =>\n        builder.AddPaths(\"FileScopeNamespace.cs\")\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Test))\n            .Verify();\n\n    [TestMethod]\n    public void FileScopeNamespace_Compliant() =>\n        builder.AddPaths(\"FileScopeNamespace.Compliant.cs\").VerifyNoIssues();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/HelperInTypeNameTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class HelperInTypeNameTest\n{\n    private readonly VerifierBuilder builder = StylingVerifierBuilder.Create<HelperInTypeName>().WithConcurrentAnalysis(false);\n\n    [TestMethod]\n    public void HelperInTypeName() =>\n        builder.AddPaths(\"HelperInTypeName.cs\").Verify();\n\n    [TestMethod]\n    public void HelperInTypeName_FileScopedNamespace() =>\n        builder.AddSnippet(\"namespace Something.Helpers;    // Noncompliant\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/IndentArgumentTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class IndentArgumentTest\n{\n    [TestMethod]\n    public void IndentArgument() =>\n        StylingVerifierBuilder.Verify<IndentArgument>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/IndentInvocationTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class IndentInvocationTest\n{\n    [TestMethod]\n    public void IndentInvocation() =>\n        StylingVerifierBuilder.Verify<IndentInvocation>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/IndentOperatorTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class IndentOperatorTest\n{\n    [TestMethod]\n    public void IndentOperator() =>\n        StylingVerifierBuilder.Verify<IndentOperator>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/IndentRawStringTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class IndentRawStringTest\n{\n    [TestMethod]\n    public void IndentRawString() =>\n        StylingVerifierBuilder.Verify<IndentRawString>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/IndentTernaryTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class IndentTernaryTest\n{\n    [TestMethod]\n    public void IndentTernary() =>\n        StylingVerifierBuilder.Verify<IndentTernary>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/InitializerLineTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class InitializerLineTest\n{\n    [TestMethod]\n    public void InitializerLine() =>\n        StylingVerifierBuilder.Verify<InitializerLine>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/LambdaParameterNameTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class LambdaParameterNameTest\n{\n    [TestMethod]\n    public void LambdaParameterName() =>\n        StylingVerifierBuilder.Verify<LambdaParameterName>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/LocalFunctionLocationTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class LocalFunctionLocationTest\n{\n    [TestMethod]\n    public void LocalFunctionLocation() =>\n        StylingVerifierBuilder.Verify<LocalFunctionLocation>();\n\n    [TestMethod]\n    public void LocalFunctionLocation_TopLevelStatements() =>\n        StylingVerifierBuilder.Create<LocalFunctionLocation>()\n            .AddPaths(\"LocalFunctionLocation.TopLevelStatements.cs\")\n            .WithTopLevelStatements()\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/MemberAccessLineTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class MemberAccessLineTest\n{\n    [TestMethod]\n    public void MemberAccessLine() =>\n        StylingVerifierBuilder.Verify<MemberAccessLine>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/MemberVisibilityOrderingTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class MemberVisibilityOrderingTest\n{\n    [TestMethod]\n    public void MemberVisibilityOrdering() =>\n        StylingVerifierBuilder.Verify<MemberVisibilityOrdering>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/MethodExpressionBodyLineTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class MethodExpressionBodyLineTest\n{\n    [TestMethod]\n    public void MethodExpressionBodyLine() =>\n        StylingVerifierBuilder.Verify<MethodExpressionBodyLine>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/MoveMethodToDedicatedExtensionClassTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Test.Rules;\n\n[TestClass]\npublic class MoveMethodToDedicatedExtensionClassTest\n{\n    [TestMethod]\n    public void MoveMethodToDedicatedExtensionClass() =>\n        StylingVerifierBuilder.Verify<MoveMethodToDedicatedExtensionClass>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/NamespaceNameTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class NamespaceNameTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<NamespaceName>()\n        .WithOptions(LanguageOptions.CSharpLatest)\n        .AddTestReference() // For now, we raise only in UTs\n        .AddSnippet(\"namespace SonarAnalyzer.Project.Folder.Something;\", \"ProductionCode.cs\");   // Production code to import via using statement\n\n    [TestMethod]\n    [DataRow(\"SonarAnalyzer.Project.Folder.Something\")]\n    [DataRow(\"SonarAnalyzer.Project.Folder.Something.Test\")]\n    [DataRow(\"SonarAnalyzer.Project.Test.Folder.Something\")]\n    public void NamespaceName_Compliant(string name) =>\n        builder\n            .AddSnippet($\"namespace {name};\")   // No using to remove, no issue raised here\n            .VerifyNoIssues();\n\n    [TestMethod]\n    [DataRow(\"SonarAnalyzer.Test.Project.Folder.Something\")]    // Anywhere the .Test is\n    [DataRow(\"SonarAnalyzer.Project.Test.Folder.Something\")]\n    [DataRow(\"SonarAnalyzer.Project.Folder.Test.Something\")]\n    public void NamespaceName_Noncompliant(string name) =>\n        builder\n            .AddSnippet($$$\"\"\"\n                using SonarAnalyzer.Project.Folder.Something;\n                namespace {{{name}}};   // Noncompliant {{Use SonarAnalyzer.Project.Folder.Something.Test namespace.}}\n                \"\"\")\n            .Verify();\n\n    [TestMethod]\n    public void NamespaceName_NoncompliantLocation() =>\n        builder\n            .AddSnippet(\"\"\"\n                using SonarAnalyzer.Project.Folder.Something;\n                namespace SonarAnalyzer.Project.Test.Folder.Something;   // Noncompliant {{Use SonarAnalyzer.Project.Folder.Something.Test namespace.}}\n                //        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n                \"\"\")\n            .Verify();\n\n    [TestMethod]\n    public void NamespaceName_ExpectedWithUsing() =>\n        builder\n            .AddSnippet($\"\"\"\n                using SonarAnalyzer.Project.Folder.Something;           // This is useless now\n                namespace SonarAnalyzer.Project.Folder.Something.Test;  // Compliant\n                \"\"\")\n            .VerifyNoIssues();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/NullPatternMatchingTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class NullPatternMatchingTest\n{\n    [TestMethod]\n    public void NullPatternMatching() =>\n        StylingVerifierBuilder.Verify<NullPatternMatching>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/OperatorLocationTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class OperatorLocationTest\n{\n    [TestMethod]\n    public void OperatorLocation() =>\n        StylingVerifierBuilder.Verify<OperatorLocation>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/PropertyOrderingTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class PropertyOrderingTest\n{\n    [TestMethod]\n    public void PropertyOrdering() =>\n        StylingVerifierBuilder.Verify<PropertyOrdering>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/ProtectedFieldsCaseTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class ProtectedFieldsCaseTest\n{\n    [TestMethod]\n    public void ProtectedFieldsCase() =>\n        StylingVerifierBuilder.Verify<ProtectedFieldsCase>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/SeparateDeclarationsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class SeparateDeclarationsTest\n{\n    [TestMethod]\n    public void SeparateDeclarations() =>\n        StylingVerifierBuilder.Create<SeparateDeclarations>().AddPaths(\"SeparateDeclarations.cs\").WithConcurrentAnalysis(false).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/TernaryLineTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class TernaryLineTest\n{\n    [TestMethod]\n    public void TernaryLine() =>\n        StylingVerifierBuilder.Verify<TernaryLine>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/TypeMemberOrderingTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class TypeMemberOrderingTest\n{\n    [TestMethod]\n    public void TypeMemberOrdering() =>\n        StylingVerifierBuilder.Verify<TypeMemberOrdering>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/UseDifferentMemberTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class UseDifferentMemberTest\n{\n    private readonly VerifierBuilder builder = StylingVerifierBuilder.Create<UseDifferentMember>().AddReferences(NuGetMetadataReference.MicrosoftCodeAnalysisCSharp());\n\n    [TestMethod]\n    public void UseIsExtension() =>\n        builder.AddPaths(\"UseDifferentMember.cs\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/UseFieldTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class UseFieldTest\n{\n    [TestMethod]\n    public void UseField() =>\n        StylingVerifierBuilder.Verify<UseField>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/UseInnermostRegistrationContextTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing SonarAnalyzer.Core.AnalysisContext;\nusing SonarAnalyzer.TestFramework.MetadataReferences;\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class UseInnermostRegistrationContextTest\n{\n    private readonly VerifierBuilder builder = StylingVerifierBuilder.Create<UseInnermostRegistrationContext>()\n        .AddReferences([MetadataReference.CreateFromFile(typeof(SonarAnalysisContext).Assembly.Location)])\n        .AddReferences(NuGetMetadataReference.MicrosoftCodeAnalysisCSharp());\n\n    [TestMethod]\n    public void UseInnermostRegistrationContext() =>\n        builder.AddPaths(\"UseInnermostRegistrationContext.cs\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/UseLinqExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class UseLinqExtensionsTest\n{\n    [TestMethod]\n    public void UseLinqExtensions() =>\n        StylingVerifierBuilder.Verify<UseLinqExtensions>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/UseNullInsteadOfDefaultTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class UseNullInsteadOfDefaultTest\n{\n    [TestMethod]\n    public void UseNullInsteadOfDefault() =>\n        StylingVerifierBuilder.Verify<UseNullInsteadOfDefault>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/UsePositiveLogicTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class UsePositiveLogicTest\n{\n    [TestMethod]\n    public void UsePositiveLogic() =>\n        StylingVerifierBuilder.Verify<UsePositiveLogic>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/UseRawStringTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class UseRawStringTest\n{\n    [TestMethod]\n    public void UseRawString() =>\n        StylingVerifierBuilder.Verify<UseRawString>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/UseRegexSafeIsMatchTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.TestFramework.MetadataReferences;\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class UseRegexSafeIsMatchTest\n{\n    [TestMethod]\n    public void UseRegexSafeIsMatch() =>\n        StylingVerifierBuilder.Create<UseRegexSafeIsMatch>().AddPaths(\"UseRegexSafeIsMatch.cs\").AddReferences(MetadataReferenceFacade.RegularExpressions).Verify();\n\n    [TestMethod]\n    public void UseRegexSafeIsMatchWithoutRegexExtensions() =>\n        StylingVerifierBuilder.Create<UseRegexSafeIsMatch>()\n            .AddSnippet(\"\"\"\n                            using System.Text.RegularExpressions;\n\n                            class UseRegexSafeIsMatchNonCompliant\n                            {\n                                private Regex regex;\n                                void InstanceRegex(string content)\n                                {\n                                    regex.IsMatch(content);         // Compliant\n                                    regex.Matches(content);         // Compliant\n                                    regex.Match(content);           // Compliant\n                                }\n                            }\n                            \"\"\")\n            .AddReferences(MetadataReferenceFacade.RegularExpressions)\n            .VerifyNoIssues();\n\n    [TestMethod]\n    public void UseRegexSafeIsMatchWithRegexExtensionOnlyIsMatch() =>\n        StylingVerifierBuilder.Create<UseRegexSafeIsMatch>()\n            .AddSnippet(\"\"\"\n                            using System.Text.RegularExpressions;\n                            using System;\n                            namespace RegexNamespace\n                            {\n                                class UseRegexSafeIsMatchNonCompliant\n                                {\n                                    private Regex regex;\n                                    void InstanceRegex(string content)\n                                    {\n                                        regex.IsMatch(content);         // Noncompliant\n                                        regex.Matches(content);         // Compliant\n                                        regex.Match(content);           // Compliant\n                                    }\n                                }\n                            }\n\n                            namespace SafeRegexNamespace\n                            {\n                                public static class RegexExtensions\n                                {\n                                    public static bool SafeIsMatch(this Regex regex, string input) =>\n                                        throw new NotImplementedException();\n                                }\n                            }\n                            \"\"\")\n            .AddReferences(MetadataReferenceFacade.RegularExpressions)\n            .Verify();\n\n    [TestMethod]\n    public void UseRegexSafeIsMatchWithRegexExtensionOnlyMatch() =>\n        StylingVerifierBuilder.Create<UseRegexSafeIsMatch>()\n            .AddSnippet(\"\"\"\n                                using System.Text.RegularExpressions;\n                                using System;\n                                class UseRegexSafeIsMatchNonCompliant\n                                {\n                                    private Regex regex;\n                                    void InstanceRegex(string content)\n                                    {\n                                        regex.IsMatch(content);         // Compliant\n                                        regex.Matches(content);         // Compliant\n                                        regex.Match(content);           // Noncompliant\n                                    }\n                                }\n\n                                public static class RegexExtensions\n                                {\n                                    public static bool SafeMatch(this Regex regex, string input) =>\n                                        throw new NotImplementedException();\n                                }\n                                \"\"\")\n            .AddReferences(MetadataReferenceFacade.RegularExpressions)\n            .Verify();\n\n    [TestMethod]\n    public void UseRegexSafeIsMatchWithRegexExtensionOnlyMatches() =>\n        StylingVerifierBuilder.Create<UseRegexSafeIsMatch>()\n            .AddSnippet(\"\"\"\n                                using System.Text.RegularExpressions;\n                                using System;\n                                class UseRegexSafeIsMatchNonCompliant\n                                {\n                                    private Regex regex;\n                                    void InstanceRegex(string content)\n                                    {\n                                        regex.IsMatch(content);         // Compliant\n                                        regex.Matches(content);         // Noncompliant\n                                        regex.Match(content);           // Compliant\n                                    }\n                                }\n\n                                public static class RegexExtensions\n                                {\n                                    public static bool SafeMatches(this Regex regex, string input) =>\n                                        throw new NotImplementedException();\n                                }\n                                \"\"\")\n            .AddReferences(MetadataReferenceFacade.RegularExpressions)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/UseShortNameTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class UseShortNameTest\n{\n    [TestMethod]\n    public void UseShortName() =>\n        StylingVerifierBuilder.Verify<UseShortName>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/Rules/UseVarTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Styling.Rules.Test;\n\n[TestClass]\npublic class UseVarTest\n{\n    [TestMethod]\n    public void UseVar() =>\n        StylingVerifierBuilder.Verify<UseVar>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/SonarAnalyzer.CSharp.Styling.Test.csproj",
    "content": "﻿  <Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFramework>net10.0</TargetFramework>\n    <IsPackable>false</IsPackable>\n    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>\n    <GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <Compile Remove=\"TestCases\\**\\*\" />\n    <None Include=\"TestCases\\**\\*\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\SonarAnalyzer.TestFramework\\SonarAnalyzer.TestFramework.csproj\" />\n    <ProjectReference Include=\"..\\..\\src\\SonarAnalyzer.CSharp.Styling\\SonarAnalyzer.CSharp.Styling.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Using Include=\"Microsoft.VisualStudio.TestTools.UnitTesting\" />\n    <Using Include=\"SonarAnalyzer.Core.Configuration\" />\n    <Using Include=\"SonarAnalyzer.CSharp.Styling.Common.Test\" />\n    <Using Include=\"SonarAnalyzer.CSharp.Styling.Rules\" />\n    <Using Include=\"SonarAnalyzer.TestFramework.Build\" />\n    <Using Include=\"SonarAnalyzer.TestFramework.MetadataReferences\" />\n    <Using Include=\"SonarAnalyzer.TestFramework.Verification\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/AllArgumentsOnSameLine.cs",
    "content": "﻿using System;\nusing System.Linq;\nusing System.Collections.Generic;\n\n[Obsolete(\n    \"Because I said so\",\n    true, DiagnosticId = \"ID0001\")] // Noncompliant\n//        ^^^^^^^^^^^^^^^^^^^^^^^\nclass IAmObsolete { }\n\n[Obsolete(\"Yes\", true, DiagnosticId = \"ID0001\")]\nclass AlsoObolete { }\n\n[Obsolete(\n    \"Yes\",\n    true,\n    DiagnosticId = \"ID0001\")]\nclass LastOneObsolete { }\n\n[Obsolete(\"Yes\", // Noncompliant {{All arguments should be on the same line or on separate lines.}}\n    //    ^^^^^\n    true,\n    DiagnosticId = \"ID0001\")]\nclass ILiedObsolete { }\n\nclass ArgumentsOnSameLine\n{\n    static object Method(params object[] args) => null;\n\n    static void TypedMethod<T1, T2, T3, T4>() { }\n\n    static void RefOutInMethod(int a, in int b, ref int c, out int d) { d = 0; }\n    static void OptionalParameters(int a = 0, int b = 0, int c = 0, int d = 0) { d = 0; }\n\n    public string this[params object[] args] => null;\n\n    void Compliant(List<string> list, int a)\n    {\n        Method();\n        Method(1);\n        Method(1, 2);\n        Method(1, 2, 3);\n        Method(\n            1, 2, 3, 4); // Noncompliant {{All arguments should be on the same line or on separate lines.}}\n\n        Method(\n            1,\n            2,\n            3);\n\n        Method(\n            1,\n            list\n                .Where(x => x.Length > 4)\n                .Select(x => x + x)\n                .ToArray(),\n            42);\n\n        RefOutInMethod(0, in a, ref a, out a);\n        RefOutInMethod(\n            0, in a, ref a, out a); // Noncompliant\n        RefOutInMethod(\n            0,\n            in a,\n            ref a,\n            out a);\n\n        _ = this[1, 2, 3];\n        _ = this[\n            1,\n            2,\n            3];\n\n        TypedMethod<int, int, int, int>();\n        TypedMethod<\n            int,\n            int,\n            int,\n            int>();\n\n        OptionalParameters(0, 0, 0, 0);\n        OptionalParameters(d: 0, c: 0, b: 0, a:0);\n        OptionalParameters(\n            d: 0,\n            c: 0,\n            b: 0,\n            a: 0);\n\n        Method(\"\"\"\n            We want to ignore this\n            \"\"\",\n            true);\n        Method($\"\"\"\n            We want to ignore {this}\n            \"\"\",\n            true);\n        Method(\"\"\"\n            We want to ignore this\n            \"\"\", \"\"\"\n            And also this\n            \"\"\");\n        Method($\"\"\"\n            We want to ignore {this}\n            \"\"\", $\"\"\"\n            And also {this}\n            \"\"\");\n        Method(\n            true,\n            true, \"\"\"\n            This isn't great, but also ignorable\n            \"\"\");\n        Method( // Noncompliant@+1, because this is evaluated as a single-line scenario\n            true, \"\"\"\n            This isn't great, but also ignorable\n            \"\"\");\n        Method(true, \"\"\"\n            This isn't great, but also ignorable\n            \"\"\");\n\n        // We don't want to raise on the outer invocation if the inner one is too long\n        Method(\"first\", Method(\"\"\"\n            Last argument is long, we start to raise here\n            \"\"\"));\n    }\n\n    void NonCompliant(List<string> list, int a)\n    {\n        Method(\n            1,\n            2,\n            3, 42); // Noncompliant {{All arguments should be on the same line or on separate lines.}}\n        //     ^^\n\n        Method(1,   // Noncompliant\n            2,\n            3, 4,   // Noncompliant\n            5,\n            6, 7);  // Noncompliant\n\n        Method(\n            1,\n            2,\n            3, 4,   // Noncompliant\n            5,\n            6, 7);  // Noncompliant\n\n        Method(1,   // Noncompliant {{All arguments should be on the same line or on separate lines.}}\n        //     ^\n            2,\n            3);\n        Method(1, list              // Noncompliant\n                                    // Noncompliant@-1\n            .Where(x => x.Length > 4), 42); // Noncompliant\n\n        Method(1,                   // Noncompliant\n            2, 3);                  // Noncompliant\n\n        RefOutInMethod(0,           // Noncompliant\n            in a, ref a,            // Noncompliant\n            out a);\n        RefOutInMethod(\n            0,\n            in a, ref a,            // Noncompliant\n            out a);\n\n        _ = this[1,                 // Noncompliant\n            2, 3];                  // Noncompliant\n        _ = this[\n                1, 2, 3];           // Noncompliant\n        _ = this[\n            1,\n            2, 3];                  // Noncompliant\n\n        TypedMethod<int,            // Noncompliant\n            int, int, int>();       // Noncompliant\n                                    // Noncompliant@-1\n        TypedMethod<\n            int, int, int, int>();  // Noncompliant\n        TypedMethod<\n            int,\n            int, int,               // Noncompliant\n            int>();\n\n        OptionalParameters(d: 0,    // Noncompliant\n            c: 0,\n            b: 0,\n            a: 0);\n        OptionalParameters(\n            d: 0,\n            c: 0, b: 0,             // Noncompliant\n            a: 0);\n\n        Method(\"\"\"Not OK\"\"\",        // Noncompliant\n            true);\n        Method($\"\"\"Not {42} OK\"\"\",  // Noncompliant\n            true);\n        Method($\"Not {42} OK\",      // Noncompliant\n            true);\n\n    }\n\n    void LocalFunction()\n    {\n        Local(1, 2, 3);\n        Local(\n            1,\n            2,\n            3);\n        Local(\n            1,\n            2, 3); // Noncompliant\n\n        void Local(params object[] args) { }\n    }\n\n    void Lambdas(Func<int, int, int, bool> predicate, Action<int, int, int> action)\n    {\n        predicate(1, 2, 3);\n        predicate(\n            1,\n            2,\n            3);\n        predicate(1,    // Noncompliant\n            2,\n            3);\n        predicate(\n            1,\n            2, 3);      // Noncompliant\n\n        action(1, 2, 3);\n        action(\n            1,\n            2,\n            3);\n        action(1,       // Noncompliant\n            2,\n            3);\n        action(\n            1,\n            2, 3);      // Noncompliant\n\n        var lambda = (int a, int b, int c) => { };\n\n        lambda(1, 2, 3);\n        lambda(\n            1,\n            2,\n            3);\n        lambda(1,   // Noncompliant\n            2,\n            3);\n        lambda(\n            1,\n            2, 3);  // Noncompliant\n    }\n}\n\npublic class RuleRegistration\n{\n    public void Initialize()\n    {\n        RegisterSonarWhateverAnalysisContext(c =>\n            {\n                // something\n            }, 0, 0);   // Noncompliant\n                        // Noncompliant@-1\n        RegisterSonarWhateverAnalysisContext(context =>\n            {\n                // something\n            },\n            0,\n            0);\n        RegisterSonarWhateverAnalysisContext(whateverContext =>\n            {\n                // something\n            },\n            0,\n            0);\n        RegisterSonarWhateverReportingContext(c =>\n            {\n                // something\n            },\n            0,\n            0);\n        RegisterSonarWhateverReportingContextActionNotFirst(\"first\", c =>   // Noncompliant\n            {\n                // something\n            },\n            \"last\");\n        RegisterSonarSomething(c =>             // Noncompliant\n            {\n                // something\n            },\n            0,\n            0);\n        RegisterSomethingAnalysisContext(c =>\n            {\n                // something\n            },\n            0,\n            0);\n        RegisterSomethingReportingContext(c =>  // Noncompliant\n            {\n                // something\n            },\n            0,\n            0);\n        RegisterSonarSomethingContext(c =>      // Noncompliant\n            {\n                // something\n            },\n            0,\n            0);\n        RegisterSonarWhateverReportingContext(c => { }, 0, 0);\n        RegisterSonarWhateverReportingContext(\n            c => { },\n            0,\n            0);\n        RegisterSonarWhateverReportingContext(\n            c =>\n            {\n            },\n            0,\n            0);\n        // Noncompliant@+1\n        UnrelatedContext((c =>\n        {\n        }, 42),\n            0,\n            0);\n    }\n\n    protected void RegisterSonarWhateverAnalysisContext(Action<SonarWhateverAnalysisContext> action, params object[] kind) { }\n    protected void RegisterSonarWhateverReportingContext(Action<SonarWhateverReportingContext> action, params object[] kind) { }\n    protected void RegisterSonarWhateverReportingContextActionNotFirst(string first, Action<SonarWhateverReportingContext> action, string last) { }\n    protected void RegisterSonarWhateverReportingContext(Func<SonarWhateverReportingContext, Action<SonarWhateverReportingContext>> action, params object[] kind) { }\n    protected void RegisterSonarSomething(Action<SonarSomething> action, params object[] kind) { }\n    protected void RegisterSomethingAnalysisContext(Action<SomethingAnalysisContext> action, params object[] kind) { }\n    protected void RegisterSomethingReportingContext(Action<SomethingReportingContext> action, params object[] kind) { }\n    protected void RegisterSonarSomethingContext(Action<SonarSomethingContext> action, params object[] kind) { }\n    protected void UnrelatedContext((Action<SonarWhateverReportingContext>, int) tuple, params object[] kind) { }\n\n    // Well-known expected classes patterns\n    public class SonarWhateverAnalysisContext { }\n    public class SonarWhateverReportingContext { }\n    public class SomethingAnalysisContext { }\n    // Unexpected types\n    public class SonarSomething { }\n    public class SomethingReportingContext { }\n    public class SonarSomethingContext { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/AllParametersOnSameColumn.cs",
    "content": "﻿using System;\nusing System.Runtime.CompilerServices;\n\nabstract class MyClass\n{\n    public int this[int a,\n                int b,      // Noncompliant\n    //          ^^^^^\n                   int c]   // Noncompliant\n    {\n        get\n        {\n            return a;\n        }\n        set { }\n    }\n\n    public int this[int a, int b, string c]\n    {\n        get\n        {\n            return a;\n        }\n        set { }\n    }\n\n    public int this[int a,\n                    float b,\n                    string c]\n    {\n        get\n        {\n            return a;\n        }\n        set { }\n    }\n\n    delegate string AnotherDelegate(string param1, int param2, float param3);\n    delegate string AlignedDelegate(string param1,\n                                    int param2,\n                                    float param3);\n\n    delegate string Delegate(string param1,\n                        int param2);  // Noncompliant\n\n    MyClass(int a,\n              int b,            // Noncompliant\n                  int c) { }    // Noncompliant\n\n    void SameLine(int a, int b, int c)\n    {\n        Delegate _ = (string param1,\n                 int param2) => \"\"; // Noncompliant\n    }\n\n    protected abstract void Aligned(int a,\n                                    int b,\n                                    int c);\n\n    protected abstract void AlignedNewLine(\n        int a,\n        int b,\n        int c);\n\n    protected abstract void MiddleNotAligned(int a,\n                                    int b,  // Noncompliant\n                                             int c);\n\n    void NotAligned(int a,\n              int b,        // Noncompliant\n                  int c)    // Noncompliant\n    {\n        void LocalMethod(int a,\n              int b,            // Noncompliant\n                  int c) { }    // Noncompliant\n    }\n\n    protected abstract void RefParameter(ref int a,\n                                         ref int b,\n                                         ref int c);\n    protected abstract void RefParameter(ref long a,\n                            ref              long b,    // Noncompliant\n    //                      ^^^^^^^^^^^^^^^^^^^^^^^\n                                    ref long c);        // Noncompliant\n\n    protected abstract void OutParameter(out int a,\n                                         out int b,\n                                         out int c);\n    protected abstract void OutParameter(out long a,\n                                      out    long b,    // Noncompliant\n                                    out long c);        // Noncompliant\n\n    protected abstract void MixedParameter(int a,\n                                           ref int b,\n                                           out int c);\n\n    protected abstract void MixedParameter2(int a,\n                                        ref int b,   // Noncompliant\n                                        out int c);  // Noncompliant\n\n    protected abstract void AttributeParameter([CallerMemberName] string a = \"\",\n                                               [CallerFilePath] string b = \"\",\n                                               [CallerLineNumber] int c = 0);\n\n    protected abstract void AttributeParameter2([CallerMemberName] string a = \"\",\n                                                  [CallerFilePath] string b = \"\",                 // Noncompliant\n    //                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n                                                        [CallerLineNumber] int c = 0); // Noncompliant\n    protected abstract void ValidTypeParameter<T1,\n                                               T2,\n                                               T3>();\n    protected abstract void ValidTypeParameter<T1, T2, T3>(T1 a, T2 b, T3 c);\n    protected abstract void AlignedTypeParameter<T1, T2, T3>(T1 a,\n                                                             T2 b,\n                                                             T3 c);\n\n    protected abstract void TypeParameter<T1,\n        T2,     // Noncompliant\n    //  ^^\n        T3>();  // Noncompliant\n\n    protected abstract void TypeParameter<T1, T2, T3>(T1 a,\n        T2 b,       // Noncompliant\n            T3 c);  // Noncompliant\n}\n\nunsafe class FunctionPointer\n{\n    public delegate*<int, int, int> Compliant;\n    public delegate*<int,\n            int,            //Noncompliant\n        int> Noncompliant;  //Noncompliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/AllParametersOnSameLine.cs",
    "content": "﻿using System;\n\npublic abstract class Sample\n{\n    public abstract void Empty(); // Compliant\n    public abstract void SingleParam(int param); // Compliant\n    public abstract void DoubleParam1(int a, int b); // Compliant\n    public abstract void DoubleParam2(int a,\n        int b); // Compliant\n    public abstract void DoubleParam3(\n        int a,\n        int b); // Compliant\n\n    public abstract void CompliantSingleLineMethod(string first, string second, string third, string fourth); // Compliant\n\n    public abstract void CompliantMultiLineMethod(string first, // Compliant\n        string second,\n        string third,\n        string fourth);\n\n    public abstract void NonCompliantMethod(string first, string second, string third,\n                               string fourth); // Noncompliant {{Parameters should be on the same line or all on separate lines.}}\n\n    public abstract void NonCompliantMethodStart(string first, string second,\n        string third, // Noncompliant\n    //  ^^^^^^^^^^^^\n        string fourth);\n\n    public abstract void NonCompliantMethodMiddle(string first,\n                                        string second, string third,    // Noncompliant\n//                                                     ^^^^^^^^^^^^\n                                        string fourth);\n\n    public abstract void NonCompliantMethodEnd(string first,\n        string second,\n        string third, string fourth); // Noncompliant\n    //                ^^^^^^^^^^^^^\n\n    public abstract void Foo(\n    string first, // Compliant\n    string second,\n    string third,\n    string fourth);\n\n    public abstract void Foo1(\n     string first\n     , string second, string third);  // Noncompliant\n\n    public abstract void Foo2( // Compliant\n        string first\n        , string second,\n        string third);\n\n    public abstract void Foo3(string first\n        , string second, string third);  // Noncompliant\n\n    public abstract void Foo4(string first // Compliant\n        , string second,\n        string third);\n\n    public abstract void Foo5( // Compliant\n    string first\n    ,\n    string second\n    ,\n    string third);\n\n    public abstract void Foo6( // Compliant\n    string first\n    ,\n    string second\n    , string third,\n    string fourth);\n\n    public abstract void Foo7(\n    string first // compliant\n\n\n    ,\n\n\n    string second\n    , string third,\n    string fourth);\n\n    // DelegateDeclarationSyntax\n    public delegate void Compliant(int a, int b, int c);\n    public delegate void Noncompliant(int a, int b,\n        int c); // Noncompliant\n\n    // ParenthesizedLambdaExpressionSyntax\n    Func<int, int, int> pleC = (int x, int y) => x + y; // Compliant\n    Func<int,\n        int, int, int> pleNC = (int x, int y\n        , int z) => x + y + z; // Noncompliant\n\n    // AnonymousMethodExpression\n    public void Ame()\n    {\n        Action<int, int, int> ame = delegate (int x, int y, int z) // Compliant\n        { };\n        ame = delegate (int x, int y,\n            int z) // Noncompliant\n        { };\n    }\n\n    // LocalFunctionStatementSyntax\n    public void lfs()\n    {\n        void localFS(int x, int y, int z) // Compliant\n        { };\n\n        void localFSNoncompliant(int x,\n            int y, int z) // Noncompliant\n        { };\n    }\n\n    public abstract void EndOfLineInParameter(int x, string y, params // Compliant\n    int\n    []\n    otherParams);\n\n    public abstract void EndOfLineEndParameters(int x, string y, params int[] otherParams // Compliant\n        );\n\n    public abstract void CommaInParams1((int,\nint) x, int y, int z);  // Noncompliant\n\n    public abstract void CommaInParams2((int, int) x, int y, int z);  // Compliant\n\n    public abstract void CommaInParams3(\n        Action<int,\n            int> a, int b, int c); // Noncompliant\n\n    public abstract void CommaInParams4(\n        Action<int, int> a, int b, int c); // Compliant\n\n    public abstract void CommaInParams5((int,\n        int) x, int y,\n        int z); // Compliant - FN\n\n    public abstract void CommaInParams6(\n        Action<int,\n        int> a, int b\n            , int c); // Compliant - FN\n\n    public abstract void CommaInParams7(\n        Action<int,\n        int> a,\n        int b, int c); // Noncompliant\n\n    public abstract void CommaInParams8(\n        Func<string,\n        int> a, Action<int,\n        int> b\n            , string c = \"Hello\"); // Compliant\n}\n// FunctionPointerSyntax\npublic unsafe class Example\n{\n    public delegate*<int, int, int> Compliant; // Compliant\n    public delegate*<int,\n        int, int> Noncompliant; // Noncompliant\n}\n\n// ClassDeclarationSyntax\npublic class cdsC(int a, int b, int c) { } // Compliant\npublic class cdsNC(int a,\n    int b, int c) // Noncompliant\n{ }\n\n// StructDeclarationSyntax\npublic struct sdsC(int a, int b, int c) { } // Compliant\npublic struct sdsNC(int a,\n    int b, int c) // Noncompliant\n{ }\n\n// InterfaceDeclarationSyntax\npublic interface ICompliant<T, X, Y> // Compliant\n{ }\npublic interface INoncompliant<T,\n    X, Y> // Noncompliant\n{ }\n\n// RecordDeclarationSyntax\npublic record rdsC(int a, int b, int c); // Compliant\npublic record rdsNC(int a, int b,\n    int c); // Noncompliant\n\n// ConstructorDeclarationSyntax\npublic abstract class Constructor\n{\n    public abstract void Compliant(\n        int a,\n        int b,\n        int c,\n        int d);\n\n    public abstract void Noncompliant(\n        int a,\n        int b,\n        int c, int d); // Noncompliant\n}\n\n// IndexerDeclarationSyntax\npublic class idsC\n{\n    public int this[int a, int b, int c] // Compliant\n    {\n        get\n        {\n            return a;\n        }\n        set { }\n    }\n}\n\npublic class idsNC\n{\n    public int this[int a,\n        int b, int c] // Noncompliant\n    {\n        get\n        {\n            return a;\n        }\n        set { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/ArrowLocation.cs",
    "content": "﻿\nusing System;\n\npublic class NoncompliantCases\n{\n    public string Wrong()\n        => \"wrong\"; // Noncompliant {{Place the arrow at the end of the previous line.}}\n    //  ^^\n\n    public string AloneOnLine()\n        =>          // Noncompliant\n        \"wrong\";\n\n    public string NoWhitespace()\n=> \"wrong\"; // Noncompliant\n\n    public string TooMuchWhitespace()\n\n\n        => \"wrong\"; // Noncompliant\n\n    public string CommentInTheWay()\n        // There's a comment around here\n        // And here\n        => \"wrong\"; // Noncompliant\n\n    public int Region()\n    #region Why would you do this?\n        => 0;   // Noncompliant\n    #endregion\n\n    public int Directive()\n#if SOME_DIRECTIVE\n        => 0;   // Not analyzed\n#else\n        => 1;   // Noncompliant\n#endif\n\n    public void LocalFunction()\n    {\n        int Local()\n            => 1;   // Noncompliant\n\n        static int StaticLocal()\n            => 1;   // Noncompliant\n    }\n\n    public int SwitchExpression(object arg)\n    {\n        return arg switch\n        {\n            EventArgs\n                => 1,   // Noncompliant\n            Exception ex\n                => 2,   // Noncompliant\n            _\n                => 3    // Noncompliant\n        };\n    }\n\n    public int NoToken(object arg)\n    {\n        return arg switch\n        {\n            EventArgs   // Error [CS1003] Syntax error, '=>' expected\n            42          // Compliant, while Roslyn gives us the Token with correct kind, it has IsMissing=true\n        };\n    }\n\n    public int Property\n        => 42;      // Noncompliant\n\n    public int Accessors\n    {\n        get\n            => 42;  // Noncompliant\n\n        set\n            => throw new NotImplementedException(); // Noncompliant\n    }\n\n    public int InitAccessor\n    {\n        init\n            => throw new NotImplementedException();      // Noncompliant\n    }\n\n    public event EventHandler Event\n    {\n        add\n            => DoSomething();   // Noncompliant\n\n        remove\n            => DoSomething();   // Noncompliant\n    }\n\n    public NoncompliantCases()\n        => throw new Exception(\"Constructor\");  // Noncompliant\n\n    public static int operator +(NoncompliantCases a, NoncompliantCases b)\n        => 42; // Noncompliant\n\n    public void DoSomething() { }\n}\n\n\npublic class CompliantCases\n{\n    public string CommentInTheWay() =>\n        // There's a comment around here\n        // And here\n        \"good\";\n\n    public int Region() =>\n    #region Why would you do this?\n        0;\n    #endregion\n\n    public int Directive() =>\n#if SOME_DIRECTIVE\n        0;   // Not analyzed\n#else\n        1;\n#endif\n\n    public void LocalFunction()\n    {\n        int Local() => 1;\n\n        static int StaticLocal() => 1;\n    }\n\n    public int SwitchExpression(object arg)\n    {\n        return arg switch\n        {\n            EventArgs => 1,\n            Exception ex => 2,\n            _ => 3\n        };\n    }\n\n    public int Property => 42;\n\n    public int Accessors\n    {\n        get => 42;\n        set => throw new NotImplementedException();\n    }\n\n    public int InitAccessor\n    {\n        init => throw new NotImplementedException();\n    }\n\n    public event EventHandler Event\n    {\n        add => DoSomething();\n        remove => DoSomething();\n    }\n\n    public CompliantCases() =>\n        throw new Exception(\"Constructor\");\n\n    public static int operator +(CompliantCases a, CompliantCases b) =>\n        42;\n\n    public int Generic<T>() where T : struct\n        => 0;   // Noncompliant\n\n    public int WrongParenthesis(\n        )\n        => 0; // Noncompliant\n\n\n    public void DoSomething() { }\n}\n\n\n\npublic class ReturnValueSameLine\n{\n    public int CompliantSingleLine => 0;\n\n    public int WithOneParameter(int a) => 0;\n\n    public int WithMultilineParameters(int a,\n                                       int b,\n                                       int c) => 0;\n\n    public int Generic<T>() where T : struct => 0;\n\n    public int WrongParenthesis(\n        ) => 0; // Compliant, this is another problem\n}\n\npublic class ReturnValueNextLine\n{\n    public int CompliantSingleLine =>\n        0;\n\n    public int WithOneParameter(int a) =>\n        0;\n\n    public int WithMultilineParameters(int a,\n                                       int b,\n                                       int c) =>\n        0;\n\n    public int Generic<T>() where T : struct =>\n        0;\n\n    public int WrongParenthesis(\n        ) =>\n        0; // Compliant, this is another problem\n}\n\npublic class Lambdas\n{\n    public void Method()\n    {\n        Method(x => x + 1);\n        Method((x, y) => x + y);\n        Method(() => 1 + 2);\n\n        Method(x =>\n            x + 1);\n        Method((x, y) =>\n            x + y);\n        Method(() =>\n            1 + 2);\n\n        Method(x =>\n        {\n            return 0;\n        });\n\n        Method(x\n            => x + 1);  // Noncompliant\n        //  ^^\n        Method((x, y)\n            => x + y);  // Noncompliant\n        Method(()\n            => 1 + 2);  // Noncompliant\n    }\n\n    public void Method(Func<int> lambda) { }\n    public void Method(Func<int, int> lambda) { }\n    public void Method(Func<int, int, int> lambda) { }\n}\n\npublic class Others\n{\n    public void Comparison(int a, int b)\n    {\n        if (a >= b)\n        {\n            return;\n        }\n\n        if (a\n            >= b)   // Bad, but compliant with this rule\n        {\n            return;\n        }\n\n        if (a\n            <= b)   // Bad, but compliant with this rule\n        {\n            return;\n        }\n\n        if (a\n            < b)   // Bad, but compliant with this rule\n        {\n            return;\n        }\n\n        if (a\n            < b)   // Bad, but compliant with this rule\n        {\n            return;\n        }\n    }\n\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/AvoidArrangeActAssertComment.cs",
    "content": "﻿// Arrange\n\n// Act\n\n// Assert\n\npublic class TestClass\n{\n    public void TestMethod()\n    {\n        // Noncompliant@+1 {{Remove this Arrange, Act, Assert comment.}}\n        // Arrange\n        int number1 = 2;\n        int number2 = 2;\n\n        // Noncompliant@+1 {{Remove this Arrange, Act, Assert comment.}}\n        // Act\n        int result = number1 + number2;\n\n        // Noncompliant@+1 {{Remove this Arrange, Act, Assert comment.}}\n        // Assert\n        _ = 4 == result;\n\n        // Noncompliant@+1\n        //Arrange\n        // Noncompliant@+1\n        //                      Act\n        // Noncompliant@+1 ^9#27\n        /*     * Assert\n         */\n        // Noncompliant@+1 ^9#32\n        /*\n         * // Act\n         */\n        // Noncompliant@+1\n        // /* Assert */\n        // Noncompliant@+1\n        /// Arrange\n        // Noncompliant@+1\n        /**\n         * Arrange\n         */\n        // Noncompliant@+1\n        // Arrange Act Assert\n\n        /*\n         * This not an Act comment or even Arrange or Assert\n         */\n\n        // Noncompliant@+3 ^9#10\n        // Noncompliant@+3 ^9#6\n        // Noncompliant@+3 ^9#9\n        // Arrange\n        // Act\n        // Assert\n\n        // Noncompliant@+1\n        // Act & Assert\n\n        // Noncompliant@+1\n        /// Arrange\n        /// Act\n        /// Assert\n    }\n\n    // Noncompliant@+1 - FP This comment is part of the method declaration\n    /*\n     * Act\n     */\n    public void Multiline_Comment(string input)\n    {\n        // Noncompliant@+1\n        /* Arrange */\n        int number1 = 2;\n        int number2 = 2;\n\n        // Noncompliant@+1 ^9#29\n        /*\n         * Act\n         */\n        int result = number1 + number2;\n\n        // Noncompliant@+1 ^9#32\n        /*\n           Assert\n         */\n        _ = 4 == result;\n    }\n\n    public void DifferentCase()\n    {\n        // Noncompliant@+1\n        // arrange\n        // Noncompliant@+1\n        // aRRange\n        // Noncompliant@+1\n        // act\n        // Noncompliant@+1\n        // acT\n        // Noncompliant@+1\n        // assert\n        // Noncompliant@+1\n        // assERT\n    }\n\n    private void AreEqual(object expected, object actual) { }\n}\n\n///\n/// Assert\n///\npublic class NotATestClassInTestProject\n{\n    // Noncompliant@+1 - FP This comment is part of the method declaration\n    /**\n     * Arrange\n     */\n    public void Method()\n    {\n        // Noncompliant@+1\n        // Arrange\n        int number1 = 2;\n        int number2 = 2;\n\n        // Noncompliant@+1\n        // Act\n        int result = number1 + number2;\n\n        // Noncompliant@+1\n        // Assert\n        _ = 4 == result;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/AvoidDeconstruction.TopLevelStatements.cs",
    "content": "﻿object value = null;\n\n_ = value is System.Exception { Message: var message }; // Noncompliant\n\n_ = value is System.Exception { Message: var used }     // Noncompliant FP, we use this for coverage and don't support top-level statements\n    && used is not null\n    && used is not null\n    && used is not null;\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/AvoidDeconstruction.cs",
    "content": "﻿using System.Linq;\n\npublic class Sample\n{\n    private Person person;\n\n    public void Basic(string expected)\n    {\n        _ = person is { Name: var _ };              // Noncompliant {{Don't use this deconstruction. It's pointless.}}\n        //                    ^^^^^\n        _ = person is { Name: var unused };         // Noncompliant {{Don't use this deconstruction. Reference the member from the instance instead.}}\n        //                    ^^^^^^^^^^\n        _ = person is { Name: var usedOnce }        // Noncompliant\n            && usedOnce is null;\n        _ = person is { Name: var usedTwice }       // Noncompliant\n            && usedTwice is null\n            && usedTwice is null;\n        _ = person is { Name: var usedThrice }      // Compliant, used 3 or more times\n            && usedThrice is null\n            && usedThrice is null\n            && usedThrice is null;\n\n        _ = person is { Address: (var city, var street) } && city.Name == street;\n        //                        ^^^^^^^^              Noncompliant\n        //                                  ^^^^^^^^^^  Noncompliant@-1\n\n        // The best way is to do this, but that does not demonstrate the purpose of the rule\n        _ = person is { Name: not null };\n        // What should be used is this, if we imagine that \"person\" was a method invocation instead and we need to rename it:\n        _ = MayReturnPerson() is Person { } renamedPerson\n            && renamedPerson.Name == expected;\n\n        _ = person is var renamed && renamed.Name == \"Lorem\";  // T0034, this is not a deconstruction\n    }\n\n    public void Nested()\n    {\n        _ = person is\n        {\n            Name: var name,                 // Noncompliant\n            Address:\n            {\n                City:\n                {\n                    Country: var country,   // Noncompliant\n                    Name: var city,         // Compliant, used 3 times\n                    Code: var code          // Noncompliant\n                }\n            }\n        }\n            && name is not null\n            && country is not null\n            && city is not null\n            && city is not null\n            && city is not null\n            && code is not null;\n\n        _ = person is { Address.City.Name: var propertyName }   // Noncompliant\n            && propertyName is not null;\n    }\n\n    public void Usages()\n    {\n        if (false || person is { Name: var name } || false)\n        {\n            name.ToString();\n            _ = string.Format(\"{0}\", name);\n            _ = name[0];\n        }\n        if (!(person is { Name: var usedInElse }))\n        {\n            // Nothing to see here\n        }\n        else\n        {\n            usedInElse.ToString();\n            _ = string.Format(\"{0}\", usedInElse);\n            _ = usedInElse[0];\n        }\n    }\n\n    public bool PropertyNoncompliant =>\n        person is { Name: var name }    // Noncompliant\n        && name is null\n        && name is null;\n\n    public bool PropertyCompliant =>\n        person is { Name: var name }    // Used 3 times\n        && name is null\n        && name is null\n        && name is null;\n\n    public bool AccessorNoncompliant\n    {\n        get => person is { Name: var name }    // Noncompliant\n                && name is null\n                && name is null;\n    }\n\n    public bool Accessor\n    {\n        get => person is { Name: var name }    // Used 3 times\n                && name is null\n                && name is null\n                && name is null;\n    }\n\n    public string Lambda(Person[] list)\n    {\n        list.Where(x => x is { Name: var name } && name is not null);   // Noncompliant\n        //                           ^^^^^^^^\n        string name = null;\n        return name + name + name;  // Same name, different symbol\n    }\n\n    public object SwitchExpressionVar(object o) =>\n        MayReturnPerson(o) switch\n        {\n            var necessary when necessary.ToString() == \"\" => necessary,\n            var _ when o is null => null,\n            var acceptable => acceptable\n        };\n\n    public object SwitchExpressionDiscard(object o) =>\n        MayReturnPerson(o) switch\n        {\n            _ when o is null => \"Also needed\",\n            _ => null\n        };\n\n    public object MayReturnPerson(object arg = null) => null;\n}\n\npublic record Person(string Name, Address Address);\n\npublic record Address(City City, string Street);\n\npublic record City(string Country, string Name, string Code);\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/AvoidGet.cs",
    "content": "﻿\npublic class Sample\n{\n    public string GetName() => \"Lorem ipsum\";   // Noncompliant {{Do not use 'Get' prefix. Just don't.}}\n    //            ^^^^^^^\n    public int GetValue() => 42;                // Noncompliant\n    public int Get2items() => 2;                // Noncompliant, and wrong\n\n    public int Getvalue() => 42;                // Wrong, but compliant\n    public int getValue() => 42;                // Wrong, but compliant\n    public int Get() => 42;                     // Wrong, but compliant\n\n    public object FindGetGetterGet() => null;   // Compliant\n    public object Getter() => null;             // Compliant\n    public object Getaway() => null;            // Compliant\n    public object Getup() => null;              // Compliant\n\n    public void GetLier() { }                   // Wrong due to void, but compliant\n\n    public bool GetIsTrue(bool value)           // Noncompliant\n    {\n        return value == true;\n    }\n\n    public int Parameter(int GetSometing) => 42; // Wrong, but compliant\n\n    public string LocalFunction()\n    {\n        return GetName(GetValue(GetLost()));    // Ugly, but compliant. We raise on declarations\n\n        int GetValue(bool arg) => 42;   // Noncompliant\n        string GetName(int count)       // Noncompliant\n        {\n            return count.ToString();\n        }\n        static bool GetLost() => true;  // Noncompliant\n    }\n\n    public int GetProperty => 42;       // Wrong, but compliant\n    public int GetField = 42;           // Wrong, but compliant\n\n    private class Nested\n    {\n        public int GetValue() => 42;    // Noncompliant\n    }\n}\n\npublic abstract class Base\n{\n    public abstract int GetValue();             // Noncompliant\n    public abstract int GetProperty { get; }    // Wrong, but compliant\n\n    public virtual string GetName() => null;    // Noncompliant\n}\n\npublic class Derived : Base\n{\n    public override int GetValue() => 42;           // Compliant, unfortunately\n    public override int GetProperty => 42;          // Compliant, unfortunately\n    public override string GetName() => \"Lorem\";    // Compliant, unfortunately\n}\n\npublic interface IGet\n{\n    int GetProperty { get; }    // Wrong, but compliant\n    int GetValue();             // Noncompliant\n}\n\npublic class ImplicitInterface : IGet\n{\n    public int GetValue() => 42;    // Compliant, unfortunately\n    public int GetProperty => 42;   // Wrong, but compliant\n}\n\npublic class ExplicitInterface : IGet\n{\n    int IGet.GetValue() => 42;      // Compliant, unfortunately\n    int IGet.GetProperty => 42;     // Wrong, unfortunately\n}\n\npublic class GetGettingGetter\n{\n    public GetGettingGetter() { }   // Wrong, but compliant\n}\n\npublic partial class Partial\n{\n    public partial int GetValue();          // Noncompliant, both are wrong\n}\n\npublic partial class Partial\n{\n    public partial int GetValue() => 42;    // Noncompliant, both are wrong\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/AvoidListForEach.cs",
    "content": "﻿using System.Collections.Generic;\n\npublic class Sample\n{\n    public void Method(List<int> list, CustomList custom, Sample otherType)\n    {\n        list.ForEach(x => { });  // Noncompliant {{Use 'foreach' iteration instead of 'List.ForEach'.}}\n        //   ^^^^^^^\n        custom.ForEach(x => { });   // Noncompliant\n\n        ForEach();                  // Compliant\n        otherType.ForEach();        // Compliant, we don't know what it does\n        list.Add(1);\n        list.TrueForAll(x => true);\n    }\n\n    public void Errors(List<int> list)\n    {\n        list.();            // Error [CS1001] Identifier expected\n        list.Undefined();   // Error [CS1061] 'List<int>' does not contain a definition for 'Undefined'\n        list.ForEach();     // Error [CS7036] There is no argument given that corresponds to the required parameter 'action' of 'List<int>.ForEach(Action<int>)'\n        unknown.ForEach();  // Error [CS0103] The name 'unknown' does not exist in the current context\n    }\n\n    public void ErrorNoExpression()\n    {   // Error [CS1513] Closing curly brace expected\n        .ForEach();\n    }\n\n    public void ForEach() { }\n}\n\npublic class CustomList : List<string> { }\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/AvoidNullable.cs",
    "content": "﻿\n// This is not expected to raise when the whole project is configured with nullable context.\n\n// Noncompliant@+1 {{Do not use nullable context.}}\n  #nullable enable\n//^^^^^^^^^^^^^^^^\n\n#nullable disable // Compliant\n\n#nullable restore // Compliant\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/AvoidPrimaryConstructor.cs",
    "content": "﻿using System;\n\npublic class Class(string param1, int param2);                  // Noncompliant {{Do not use primary constructors.}}\n//                ^^^^^^^^^^^^^^^^^^^^^^^^^^^\npublic abstract class AbstractClass();                          // Noncompliant\n//                                 ^^\npublic sealed class SealedClass(string param1, int param2);     // Noncompliant\npublic class Box<T>(string param1, int param2);                 // Noncompliant\npublic partial class PartialClass(string param1, int param2);   // Noncompliant\npublic partial class PartialClass;\n\nclass BothConstructor(string param1, int param2)                // Noncompliant\n{\n    BothConstructor(int param2) : this(\"\", param2) { }\n}\n\npublic struct Struct(string param1, int param2);                            // Noncompliant\n//                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^\npublic readonly struct ReadonlyStruct(string param1, int param2);           // Noncompliant\npublic ref struct RefStruct(string param1, int param2);                     // Noncompliant\npublic readonly ref struct ReadonlyRefStruct(string param1, int param2);    // Noncompliant\n\npublic record class RecordClass(string param1, int param2);\npublic record struct RecordStruct(string param1, int param2);\npublic record Record(string param1, int param2);\n\npublic static class StaticClass(string param1, int param2);     // Noncompliant\n                                                                // Error@-1 [CS0710]\npublic interface Interface(string param1, int param2);          // Error [CS9122]\n\nclass NormalConstructor\n{\n    delegate string Delegate(string param1, int param2);\n\n    NormalConstructor(string param1, int param2)\n    {\n        Delegate _ = (string param1, int param2) => \"\";\n    }\n\n    void Method(string param1, int param2)\n    {\n        string Local(string param1, int param2) => \"\";\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/AvoidUnusedInterpolation.cs",
    "content": "﻿\npublic class Sample\n{\n    public void ToRemove()\n    {\n        _ = $\"Unused\";          // Noncompliant {{Remove unused interpolation from this string.}}\n        //  ^^\n        _ = $@\"Unused\";         // Noncompliant {{Remove unused interpolation from this string.}}\n        //  ^^^\n        _ = @$\"Unused\";         // Noncompliant {{Remove unused interpolation from this string.}}\n        //  ^^^\n        _ = $\"\"\"Unused\"\"\";      // Noncompliant {{Remove unused interpolation from this string.}}\n        _ = $$\"\"\"Unused\"\"\";     // Noncompliant\n        _ = $$$\"\"\"Unused\"\"\";    // Noncompliant\n        _ = $\"\"\"\n                Unused\n                \"\"\";            // Noncompliant@-2\n        _ = $$\"\"\"\n                Unused\n                \"\"\";            // Noncompliant@-2\n        _ = $$$\"\"\"\n                Unused\n                \"\"\";            // Noncompliant@-2\n    }\n\n    public void ToReduce(int value)\n    {\n        _ = $$\"\"\"Too many {{value}}\"\"\";                             // Noncompliant {{Reduce the number of $ in this string.}}\n        //  ^^^^^\n        _ = $$\"\"\"Too many {{value}} somewhere {{42}}\"\"\";            // Noncompliant\n        _ = $$$\"\"\"Too many { {{{value}}}\"\"\";                        // Noncompliant\n        _ = $$$\"\"\"Too many } {{{value}}}\"\"\";                        // Noncompliant\n        _ = $$$\"\"\"Too many {}{} {{{value}}}\"\"\";                       // Noncompliant\n        _ = $$$\"\"\"Too many {{{value}}} somewhere {{{42}}} {}{}\"\"\";    // Noncompliant\n        _ = $$$$\"\"\"Way too many } {{{{value}}}}\"\"\";                 // Noncompliant\n        //  ^^^^^^^\n        _ = $$\"\"\"\n            Too many {{value}}\n            \"\"\";                                                    // Noncompliant@-2\n        _ = $$$$\"\"\"\n            Way too many } {{{{value}}}}\n            \"\"\";                                                    // Noncompliant@-2\n        _ = $$\"\"\"{{value}}\"\"\";                                      // Noncompliant, no text\n\n        _ = \"Leave me alone\";\n        _ = $\"Needed {value}\";\n        _ = $\"\"\"Needed {value}\"\"\";\n        _ = $$\"\"\"Needed { {{value}}\"\"\";\n        _ = $$\"\"\"Needed } {{value}}\"\"\";\n        _ = $$\"\"\"Needed {}{} {{value}}\"\"\";\n        _ = $$\"\"\"Needed {{value}} somewhere {{42}} {}{}\"\"\";\n        _ = $$$\"\"\"Needed {{ {{{value}}}\"\"\";\n        _ = $$$\"\"\"Needed }} {{{value}}}\"\"\";\n        _ = $$$\"\"\"Needed {{}}{{}} {{{value}}}\"\"\";\n        _ = $$$\"\"\"Needed {{{value}}} somewhere {{{42}}} {{}}{{}}\"\"\";\n        _ = $\"\"\"\n            Needed {value}\n            \"\"\";\n        _ = $$\"\"\"\n            Needed } {{value}}\n            \"\"\";\n        _ = $\"\"\"{value}\"\"\"; // No text\n        _ = $\"{value}\";     // No text\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/AvoidValueTuple.cs",
    "content": "﻿using System;\n\npublic class Sample\n{\n    public (string, int) ReturnedType() // Noncompliant {{Do not use ValueTuple in the production code due to missing System.ValueTuple.dll.}}\n    //     ^^^^^^^^^^^^^\n    {\n        return (\"Lorem\", 42);   // Noncompliant\n        //     ^^^^^^^^^^^^^\n    }\n\n    public (string Name, int Count) NamedReturnedType() =>  // Noncompliant\n        (\"Lorem\", 42);                                      // Noncompliant\n\n    public void Use()\n    {\n        (string, int) noName;                   // Noncompliant\n        (string Name, int Count) withName;      // Noncompliant\n\n        noName = (\"Lorem\", 42);     // Noncompliant\n        withName = (\"Lorem\", 42);   // Noncompliant\n    }\n\n    public System.Tuple<string, int> ExplicitType() // Complaint\n    {\n        return new Tuple<string, int>(\"Lorem\", 42);\n    }\n\n    public int SwitchExpression(int a, int b)\n    {\n        var result = (a, b) switch      // Noncompliant: a ValueTuple is created for the SwitchExpressionException that is thrown for uncovered cases\n        {\n            (0, 0) => 0,\n            (1, 1) => 2,\n            _ => 42\n        };\n        return result;\n    }\n\n    public int SwitchStatement(int a, int b)\n    {\n        switch (a, b)                   // Noncompliant: unlike switch expressions, switch statements use ValueTuple under the hood\n        {\n            case (0, 0):\n                return 0;\n            case (1, 1):\n                return 1;\n            default:\n                return 42;\n        };\n    }\n\n    public int PositionalPatternMatching(Sample s) => s switch\n    {\n        (0, 0) => 0, // Compliant, Sample.Deconstruct is called\n        _ => 42\n    };\n\n    void Deconstruct(out int i, out int j)\n    {\n        i = 42; j = 12;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/AvoidVarPattern.cs",
    "content": "﻿using System.Linq;\n\npublic class Sample\n{\n    private string name;\n    private int min;\n\n    public void Method()\n    {\n        if (Invocation() is var value       // Noncompliant {{Avoid embedding this var pattern. Declare it in var statement instead.}}\n        //                  ^^^^^^^^^\n            && value.Name == name\n            && value.Count > min)\n        { }\n\n        if (Invocation() is var single)      // Noncompliant\n        { }\n\n        if (Invocation() is { } prerequisite\n            && Invocation() is var afterPrerequisite    // Compliant, can not be extracted without adding more nesting\n            && afterPrerequisite.Name == name\n            && afterPrerequisite.Count > min)\n        { }\n\n        if (true\n            && Invocation() is var middle\n            && middle.Name == name)\n        { }\n\n        if (true\n            && Invocation() is var last)    // Noncompliant\n        { }\n\n        if (Invocation() is var first       // Noncompliant\n            && Invocation() is var second   // Bad, but we don't raise. Once the previous one is fixed, this will light up\n            && first.Name == name\n            && first.Count > min\n            && second.Name == name\n            && second.Count > min)\n        { }\n        else if (Invocation() is var unavoidable\n            && unavoidable.Name == name\n            && unavoidable.Count > min)\n        { }\n\n        while (Invocation() is var inWhile  // Noncompliant\n            && inWhile.Name == name\n            && inWhile.Count > min)\n        { }\n\n        for (var i = 0; Invocation() is var inFor && inFor.Name == name && inFor.Count > min; i++)  // Noncompliant\n        //                              ^^^^^^^^^\n        { }\n\n        var compliant = Invocation();       // Compliant\n        if (compliant.Name == name && compliant.Count > min)\n        { }\n\n        if ((Invocation() is var parenthesized))   // We don't raise, some more tricky logic is going on around\n        { }\n\n        _ = Invocation() is { Name: var declaredName }; // T0035\n    }\n\n    public bool Arrow() =>\n        Invocation() is var value       // Compliant\n        && value.Name == name\n        && value.Count > min\n        && Invocation() is var last;    // Useless, but compliant\n\n    public void Lambda(Pair[] list)\n    {\n        list.Where(x => x.Inc() is var value // Compliant\n                        && value.Name == name\n                        && value.Count > min);\n    }\n\n    private static Pair Invocation() => null;\n}\n\npublic record Pair(string Name, int Count)\n{\n    public Pair Inc() => new(Name, Count + 1);\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/FieldOrdering.cs",
    "content": "﻿public class AllValid\n{\n    public static int s1;\n    public static int s2 = 42;\n    public static int s3, s4 = 42;\n    public int i1;\n    public int i2 = 42;\n    public int i3, i4 = 42;\n\n    internal static int internalS;\n    internal int internalI;\n\n    protected static int protectedS;    // Compliant\n    protected int protectedI;\n\n    private static int privateS;        // Compliant\n    private int privateI;\n\n    public const string C = \"C\";        // Compliant, while this is FieldDeclarationSyntax, it's not in the scope of this rule.\n}\n\npublic class SomeValid\n{\n    public static int s1;\n    public int i1;\n    public int i2;\n    public static int s2, s3;      // Noncompliant {{Move this static field above the public instance ones.}}\n    //            ^^^^^^^^^^\n    public int i3;\n\n    // Compliant, there're no other private/protected/internal instance fields above\n    internal static int internalS;\n    protected static int protectedS;\n    protected internal static int protectedInternalS;\n    protected private static int protectedPrivateS;\n    private static int privateS;\n}\n\npublic class ProtectedInternal\n{\n    protected internal int protectedI;\n    protected static int protectedS;    // Noncompliant {{Move this static field above the protected instance ones.}}\n}\n\npublic class ProtectedPrivate\n{\n    protected private int protectedI;\n    protected static int protectedS;    // Noncompliant {{Move this static field above the protected instance ones.}}\n}\n\npublic class AllWrong\n{\n    public int i1;\n    public int i2 = 42;\n    public int i3, i4 = 42;\n    protected int protectedI;\n    private int privateI;\n    internal int internalI;\n\n    public static int s1;               // Noncompliant {{Move this static field above the public instance ones.}}\n    public static int s2 = 42;          // Noncompliant\n    public static int s3, s4 = 42;      // Noncompliant\n    internal static int internalS;      // Noncompliant {{Move this static field above the internal instance ones.}}\n    private static int privateS;        // Noncompliant {{Move this static field above the private instance ones.}}\n    protected static int protectedS;    // Noncompliant {{Move this static field above the protected instance ones.}}\n}\n\npublic record R\n{\n    private int i;\n    private static int s;   // Noncompliant\n\n}\n\npublic record struct RS\n{\n    private int i;\n    private static int s;   // Noncompliant\n\n}\n\npublic struct S\n{\n    private int i;\n    private static int s;   // Noncompliant\n\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/FileScopeNamespace.Compliant.cs",
    "content": "﻿namespace Outer; // Compliant\n\npublic class NotRelevant\n{\n\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/FileScopeNamespace.cs",
    "content": "﻿\nnamespace Outer // Noncompliant {{Use file-scoped namespace.}}\n//        ^^^^^\n{\n    public class NotRelevant\n    {\n\n    }\n\n    namespace Inner // Noncompliant, nested namespace should not be used in general\n    {\n\n    }\n}\n\n\nnamespace   // Error [CS1001] Identifier expected\n{           // Noncompliant^1#0\n\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/HelperInTypeName.cs",
    "content": "﻿using SomeName.WithHelper; // Error [CS0246]\nusing AliasHelper = SatchelPerks; // Noncompliant {{Do not use 'Helper' in type names.}}\n//    ^^^^^^^^^^^\nclass SonarHelper // Noncompliant {{Do not use 'Helper' in type names.}}\n//    ^^^^^^^^^^^\n{\n    public delegate int HelperDelegate(int x, int y);\n\n    void HelperMethod()\n    {\n\n    }\n}\n\nclass HelperSonarContext // Noncompliant\n{\n}\n\nclass SonarHelperContext // Noncompliant\n{\n}\n\ninterface ISonarHelper // Noncompliant\n{\n    void MethodHelper();\n}\n\nstruct ValueTypeHelper // Noncompliant\n{\n    public bool HelperEnabled { get; set; }\n}\n\nenum EnumHelper // Noncompliant\n{\n}\n\nrecord RecordHelper // Noncompliant\n{\n}\n\nrecord struct RecordStructHelper // Noncompliant\n{\n}\n\nclass SatchelPerks\n{\n\n}\n\ninterface IMonsterWhelpEradicator\n{\n\n}\n\nnamespace Something.Helper { }              // Noncompliant {{Do not use 'Helper' in type names.}}\nnamespace Something.Helpers { }             // Noncompliant\nnamespace Something.SyntaxHelper { }        // Noncompliant\nnamespace Something.SyntaxHelpers { }       // Noncompliant\nnamespace Something.Helpers.Extensions { }  // Noncompliant\nnamespace Helper.Helping.Helpers.Work { }   // Noncompliant, just once\nnamespace { }   // Error [CS1001] Identifier expected\nnamespace;      // Error [CS1001] Identifier expected\n                // Error@-1 [CS8956] File-scoped namespace must precede all other members in a file.\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/IndentArgument.cs",
    "content": "﻿using System;\nusing System.Linq;\n\npublic class Sample\n{\n    public void Method()\n    {\n        Invocation(      // 0\n        \"Argument\",     // Noncompliant {{Indent this argument at line position 13.}}\n        \"Another\");     // Noncompliant {{Indent this argument at line position 13.}}\n\n        Invocation(      // 1\n         \"Argument\",    // Noncompliant {{Indent this argument at line position 13.}}\n         \"Another\");    // Noncompliant {{Indent this argument at line position 13.}}\n\n        Invocation(      // 2\n          \"Argument\",   // Noncompliant {{Indent this argument at line position 13.}}\n          \"Another\");   // Noncompliant {{Indent this argument at line position 13.}}\n\n        Invocation(      // 3\n           \"Argument\",  // Noncompliant {{Indent this argument at line position 13.}}\n           \"Another\");  // Noncompliant {{Indent this argument at line position 13.}}\n\n        Invocation(      // 4\n            \"Argument\",\n            \"Another\");\n\n        Invocation(          // 5\n             \"Argument\",    // Noncompliant {{Indent this argument at line position 13.}}\n        //   ^^^^^^^^^^\n             \"Another\");    // Noncompliant {{Indent this argument at line position 13.}}\n        //   ^^^^^^^^^\n\n        Invocation(\"Argument\");\n        Invocation(\"Argument\", \"Another\");\n        Invocation(\n            \"Argument\",\n            \"Another\");\n        Invocation(\"Argument\",       // T0028\n            \"Another\");\n        Invocation(\n            \"Argument\", \"Another\"); // T0028\n\n        new Builder()\n            .And.Build([\n                \"Some\",\n                \"Argument\",\n                \"Correct\"]);\n\n        // Collection expression in fluent chain - compliant cases\n        new Builder()\n            .Build([\n                \"Aligned\",\n                \"Correctly\"]);\n        new Builder()\n            .And\n            .Build([\n                \"Multi\",\n                \"Line\",\n                \"Chain\"]);\n        new Builder().And\n            .Build([\n                \"Mixed\",\n                \"Style\"]);\n\n        // Collection expression in fluent chain - noncompliant cases\n        new Builder()\n            .Build([\n            \"Too close\",        // Noncompliant {{Indent this argument at line position 17.}}\n                    \"Too far\"]);// Noncompliant {{Indent this argument at line position 17.}}\n        new Builder()\n            .And.Build([\n        \"Way too close\",        // Noncompliant {{Indent this argument at line position 17.}}\n                        \"Way too far\"]); // Noncompliant {{Indent this argument at line position 17.}}\n        new Builder()\n            .And\n            .Build([\n            \"Too close\",        // Noncompliant {{Indent this argument at line position 17.}}\n                    \"Too far\"]);// Noncompliant {{Indent this argument at line position 17.}}\n\n        // Multiple chained calls with collection expressions - compliant\n        new Builder()\n            .And.Build([\n                \"First\",\n                \"Chain\"])\n            .And.Build([\n                \"Second\",\n                \"Chain\"]);\n        new Builder()\n            .Build([\n                \"One\"])\n            .Build([\n                \"Two\"])\n            .Build([\n                \"Three\"]);\n\n        // Multiple chained calls with collection expressions - noncompliant\n        new Builder()\n            .And.Build([\n            \"Too close\",        // Noncompliant {{Indent this argument at line position 17.}}\n                    \"Too far\"]) // Noncompliant {{Indent this argument at line position 17.}}\n            .And.Build([\n            \"Too close\",        // Noncompliant {{Indent this argument at line position 17.}}\n                    \"Too far\"]);// Noncompliant {{Indent this argument at line position 17.}}\n    }\n\n    public bool ArrowNoncompliant() =>\n        Invocation(\n        \"Arg\",              // Noncompliant\n                \"Another\"); // Noncompliant\n\n    public bool ArrowCompliant() =>\n        Invocation(\n            \"Arg\",\n            \"Another\",\n            \"One more\");\n\n    public bool ArrowNotInScope() =>\n        Invocation(\"Arg\", \"Another\");\n\n    public bool ReturnNoncompliant()\n    {\n        return Invocation(\n        \"Arg\",              // Noncompliant\n                \"Another\"); // Noncompliant\n    }\n\n    public bool ReturnCompliant()\n    {\n        return Invocation(\n            \"Arg\",\n            \"Another\");\n    }\n\n    public Builder ReturnNested()\n    {\n        return new Builder()\n            .Build(\n                \"Arg\",\n                    \"Too far\"); // Noncompliant\n    }\n\n    public Builder FluentChainArguments()\n    {\n        // Arguments in fluent chain where ( is not on its own line\n        return new Builder()\n            .And.Build(\n                \"Compliant\",\n                \"Arguments\");\n    }\n\n    public Builder FluentChainArgumentsNoncompliant()\n    {\n        return new Builder()\n            .And.Build(\n            \"Too close\",            // Noncompliant {{Indent this argument at line position 17.}}\n                    \"Too far\");     // Noncompliant {{Indent this argument at line position 17.}}\n    }\n\n    public Builder FluentChainArgumentsMultiple()\n    {\n        // Multiple chained calls with arguments\n        return new Builder()\n            .And.Build(\n                \"First\",\n                \"Chain\")\n            .And.Build(\n                \"Second\",\n                \"Chain\");\n    }\n\n    public void LongFluentChainWithCollectionExpression()\n    {\n        new Builder().Build()\n            .And.AllSatisfy(x => Invocation(x))\n            .And.AllSatisfy(x => Invocation(x))\n            .And.Contain([\n                \"First\",\n                \"Second\",\n                \"Third\"]);\n\n        new Builder().Build()\n            .And.AllSatisfy(x => Invocation(x))\n            .And.AllSatisfy(x => Invocation(x))\n            .And.Contain([\n            \"Too close\",            // Noncompliant {{Indent this argument at line position 17.}}\n                        \"Too far\"]);// Noncompliant {{Indent this argument at line position 17.}}\n\n        new Builder().Should().ContainKey(\"x\").And.ContainSingle().Which.Value.Should().BeOfType<Builder>()\n            .Which.Members.Select(x => x).Should().BeEquivalentTo([\n                (\"First\", true),\n                (\"Second\", true)]);\n\n        new Builder().Should().ContainKey(\"x\").And.ContainSingle().Which.Value.Should().BeOfType<Builder>()\n            .Which.Members.Select(x => x).Should().BeEquivalentTo([\n            (\"Too close\", true),        // Noncompliant {{Indent this argument at line position 17.}}\n                    (\"Too far\", true)]);// Noncompliant {{Indent this argument at line position 17.}}\n\n        new Builder().Build()\n            .And.AllSatisfy(x => Invocation(x))\n            .And.AllSatisfy(x => Invocation(x))\n            .And.Contain(\n                [\n                    \"First\",\n                    \"Second\",\n                    \"Third\"]);\n\n        new Builder().Build()\n            .And.AllSatisfy(x => Invocation(x))\n            .And.AllSatisfy(x => Invocation(x))\n            .And.Contain(\n                [\n                \"Too close\",            // Noncompliant\n                    \"Just right\",\n                        \"Too far\"]);    // Noncompliant\n\n    }\n\n    public void FluentChainWithConstructor()\n    {\n        // Constructor arguments in fluent chain - noncompliant\n        new Builder()\n            .Build(new Builder(\n            \"Too close\",        // Noncompliant {{Indent this argument at line position 17.}}\n                \"Just right\",\n                    \"Too far\"));// Noncompliant {{Indent this argument at line position 17.}}\n        new Builder()\n            .And.Build(new Builder(\n            \"Too close\",        // Noncompliant {{Indent this argument at line position 17.}}\n                \"Just right\",\n                    \"Too far\"));// Noncompliant {{Indent this argument at line position 17.}}\n\n        new Builder()\n            .Build(\n                new Builder(\n                \"Too close\",        // Noncompliant {{Indent this argument at line position 21.}}\n                    \"Just right\",\n                        \"Too far\"));// Noncompliant {{Indent this argument at line position 21.}}\n\n        // Constructor on same line as fluent chain method - compliant\n        new Builder()\n            .And.Build(new Builder(\n                \"Compliant\",\n                \"Args\"));\n\n        // Constructor on same line as fluent chain method - noncompliant\n        new Builder()\n            .And.Build(new Builder(\n            \"Too close\",            // Noncompliant {{Indent this argument at line position 17.}}\n                    \"Too far\"));    // Noncompliant {{Indent this argument at line position 17.}}\n    }\n\n    public void TargetTypedNewExpression()\n    {\n        PrepareProjectZip(\n            new(\n                \"Project.json\",\n                \"Content\"));\n\n        PrepareProjectZip(\n            new(\n            \"Too close\",            // Noncompliant {{Indent this argument at line position 17.}}\n                    \"Too far\"));    // Noncompliant {{Indent this argument at line position 17.}}\n\n        PrepareProjectZip(new(\n            \"Project.json\",\n            \"Content\"));\n\n        PrepareProjectZip(new(\n        \"Too close\",                // Noncompliant {{Indent this argument at line position 13.}}\n                \"Too far\"));        // Noncompliant {{Indent this argument at line position 13.}}\n    }\n\n    public void Invocations()\n    {\n        Invocation(\"First\",\n        \"Too close\",            // Noncompliant {{Indent this argument at line position 13.}}\n            \"Good\",\n                \"Too far\");     // Noncompliant\n        Invocation(\n            \"First\",\n            \"Second\");\n        global::Sample.Invocation(\"First\",\n        \"Too close\",            // Noncompliant {{Indent this argument at line position 13.}}\n            \"Good\",\n                \"Too far\");     // Noncompliant\n        global::Sample.Invocation(\n            \"First\",\n            \"Second\");\n        Invocation(Invocation(Invocation(\"First\",   // This is bad already for other reasons\n        \"Too close\",            // Noncompliant {{Indent this argument at line position 13.}}\n            \"Good\",\n                \"Too far\")));   // Noncompliant\n        Invocation(Invocation(Invocation(\n            \"First\",\n            \"Second\")));\n\n        Invocation(\n            Invocation(\n            \"Nested too close\",         // Noncompliant {{Indent this argument at line position 17.}}\n                    \"Nested too far\"),  // Noncompliant\n            \"Some other argument\");\n        Invocation(\n            Invocation(\n                \"First\",\n                \"Second\"),\n            \"Some other argument\");\n        global::Sample.Invocation(       // Longer invocation name does not matter\n            \"First\",\n            \"Second\");\n\n        Invocation(Invocation(Invocation(   // This is bad already for other reasons\n            \"First\",\n            \"Second\")));\n\n        // Simple lambda\n        RegisterNodeAction(c =>\n        {                               // Noncompliant\n        },\n            42);\n        RegisterNodeAction(c => { }, 42);\n        RegisterNodeAction(c =>\n            {\n            },\n            42);\n        // Parenthesized lambda\n        RegisterNodeAction((c) =>\n        {                               // Noncompliant\n        },\n            42);\n        RegisterNodeAction((c) => { }, 42);\n        RegisterNodeAction((c) =>\n            {\n            },\n            42);\n        // Expression-body lambda\n        AcceptFunc(c =>\n        c,                              // Noncompliant\n            42);\n        AcceptFunc(c => c, 42);\n        AcceptFunc(c =>\n            c,\n            42);\n\n}\n\n    public void ObjectInitializer()\n    {\n        _ = new WithProperty\n        {\n            Value = Invocation(\n                \"Good\",\n            \"Too close\",        // Noncompliant\n                    \"Too far\")  // Noncompliant\n        };\n    }\n\n    public void CollectionExpression()\n    {\n        _ = string.Join(\n            \" \",\n            [\n            \"Too Close\",        // Noncompliant {{Indent this argument at line position 17.}}\n                \"Good\",\n                    \"Too far\"   // Noncompliant {{Indent this argument at line position 17.}}\n            ]);\n        _ = string.Join(\" \", [\n        \"Too Close\",        // Noncompliant {{Indent this argument at line position 13.}}\n            \"Good\",\n                \"Too far\"   // Noncompliant {{Indent this argument at line position 13.}}\n            ]);\n    }\n\n    public void InsideTernary()\n    {\n        Builder x = new Builder() is { } builder\n            ? builder.Build()\n            : new(\n            \"Too close\",        // Noncompliant\n                \"Just right\",\n                    \"Too far\"); // Noncompliant\n\n        Builder y = new Builder() is { } other\n            ? other.Build()\n            : new Builder().And.Build(\n            \"Too close\",        // Noncompliant\n                \"Just right\",\n                    \"Too far\"); // Noncompliant\n    }\n\n    public void Lambdas(int[] list, int[] longer)\n    {\n        list.Where(x => Invocation(\n            \"Too close\",                        // Noncompliant {{Indent this argument at line position 29.}}\n                \"Too close\",                    // Noncompliant\n                    \"Too close\",                // Noncompliant\n                        \"Too close\",            // Noncompliant\n                            \"Good\",\n                                \"Too far\"));    // Noncompliant\n        list.Where(x => Invocation(         // Simple lambda\n                        \"Too close\",        // Noncompliant {{Indent this argument at line position 29.}}\n                            \"Good\"));\n        list.Where((x) => Invocation(       // Parenthesized lambda\n                        \"Too close\",        // Noncompliant {{Indent this argument at line position 29.}}\n                            \"Good\"));\n        longer.Where(x => Invocation(       // Simple lambda, longer name\n                            \"Good\"));       // Compliant, as long as it's after the invocation and aligned to the grid of 4\n        longer.Where((x) => Invocation(     // Parenthesized lambda, longer name\n                                \"Good\"));   // Compliant, as long as it's after the invocation and aligned to the grid of 4\n\n        list.Where(x =>\n        {                                   // Noncompliant\n            return Invocation(\n                \"Good\");\n        });\n    }\n\n    public void If()\n    {\n        if (Invocation(\n            \"Too close\",        // Noncompliant {{Indent this argument at line position 17.}}\n                \"Good\",\n                    \"Too far\")) // Noncompliant\n        {\n        }\n        if (Invocation(\n                \"Good\"))\n        {\n        }\n        else if (Invocation(\n                    \"Good\",\n                        \"Too far\")) // Noncompliant\n        {\n        }\n    }\n\n    public void While()\n    {\n        while (Invocation(\n            \"Too close\",        // Noncompliant {{Indent this argument at line position 17.}}\n                \"Good\",\n                    \"Too far\")) // Noncompliant\n        {\n        }\n        while (Invocation(\n                \"Good\"))\n        {\n        }\n    }\n\n    public void For()\n    {\n        for (var i = 0; Invocation(\n                        \"Too close\",                // Noncompliant {{Indent this argument at line position 29.}}\n                            \"Good\",\n                                \"Too far\"); i++)    // Noncompliant\n        {\n        }\n        for (int i = 0; Invocation(\n                            \"Good\"); i++)\n        {\n        }\n    }\n\n    public void ConditionalAccess(Builder builder)\n    {\n        builder?\n            .Build(\n            \"Too close\",            // Noncompliant\n                \"Good\");\n\n        builder?\n            .Build(\n            \"Too close\",            // Noncompliant\n                \"Good\")?\n            .Build(\n            \"Too close\",            // Noncompliant\n                \"Good\");\n        builder?.Build()?.Build(\n        \"Too close\",                // Noncompliant\n            \"Good\");\n    }\n\n    public void Global()\n    {\n        global::Sample.Invocation(\n        \"Too close\",            // Noncompliant\n            \"Good\",\n                \"Too far\");     // Noncompliant\n        global::Sample.Invocation(\n            \"First\",\n            \"Second\");\n    }\n\n    public void SwitchExpressions(object arg)\n    {\n        _ = arg switch\n        {\n            Exception someLongerName => Invocation( // This is already bad\n                \"Good\",\n                    \"Too far\"), // Noncompliant\n            _ => Invocation(\n                \"Good\",\n                    \"Too far\"), // Noncompliant\n        };\n    }\n\n    public void OtherSyntaxes()\n    {\n        _ = new int[\n            1,\n        2,          // FN, we don't care. Nobody should specify array ranks on multiple lines\n                3\n            ];\n        int[] array = [\n            1,\n        2,          // Noncompliant\n                3   // Noncompliant\n            ];\n    }\n\n    public static bool Invocation(params object[] args) => true;\n    public static string ReturnString(string arg) => arg;\n    public void RegisterNodeAction(Action<object> action, params object[] syntaxKinds) { }\n    public void AcceptFunc(Func<object, object> func, params object[] args) { }\n    public static Builder PrepareProjectZip(Builder arg) => new Builder();\n\n    [Obsolete(ReturnString(\"For coverage\"))]    // Error [CS0182] An attribute argument must be a constant expression\n    public void Coverage() { }\n}\n\npublic class Builder\n{\n    public Builder(params object[] args) { }\n    public Builder And => this;\n    public Builder Which => this;\n    public Builder Members => this;\n    public Builder Value => this;\n    public Builder Build(params object[] args) => this;\n    public Builder Should() => this;\n    public Builder AllSatisfy(Func<object, object> predicate) => this;\n    public Builder Contain(params object[] args) => this;\n    public Builder ContainKey(object key) => this;\n    public Builder ContainSingle() => this;\n    public Builder BeEquivalentTo(params object[] args) => this;\n    public Builder BeOfType<T>() => this;\n    public Builder Select(Func<object, object> selector) => this;\n}\n\npublic class WithProperty\n{\n    public object Value { get; set; }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/IndentInvocation.cs",
    "content": "﻿using System;\nusing System.Linq;\n\npublic class Sample\n{\n    private Builder builder;\n\n    public void Method()\n    {\n        builder         // 0\n        .Variable       // Noncompliant {{Indent this member access at line position 13.}}\n        .Property       // Noncompliant {{Indent this member access at line position 13.}}\n        .Build();       // Noncompliant {{Indent this member access at line position 13.}}\n\n        builder         // 1\n         .Variable      // Noncompliant\n         .Property      // Noncompliant\n         .Build();      // Noncompliant\n\n        builder         // 2\n          .Variable     // Noncompliant\n          .Property     // Noncompliant\n          .Build();     // Noncompliant\n\n        builder         // 3\n           .Variable    // Noncompliant\n           .Property    // Noncompliant\n           .Build();    // Noncompliant\n\n        builder         // 4\n            .Variable\n            .Property\n            .Build();\n\n        builder         // 5\n             .Variable      // Noncompliant\n        //   ^^^^^^^^^\n             .Property      // Noncompliant\n        //   ^^^^^^^^^\n             .Indexed[424242]   // Noncompliant\n        //   ^^^^^^^^\n             .Build(\"Same with arguments\");     // Noncompliant\n        //   ^^^^^^\n\n        builder\n            .Build()\n             .Build()   // Noncompliant, too far\n            .Build()\n           .Build()     // Noncompliant, too close\n            .Build();\n\n        builder.Build();\n        builder.Build().Build().Build();\n        builder.Build()\n            .Build().Build();   // Compliant, this is T0027\n    }\n\n    public Builder ArrowNoncompliant() =>\n        builder\n        .Build();       // Noncompliant\n\n    public Builder ArrowCompliant() =>\n        builder\n            .Build()\n            .Build()\n            .Build();\n\n    public Builder ArrowNotInScope() =>\n        builder.Build();\n\n    public object ArrowInInvocationArgument() =>\n        Something(builder\n        .Build()        // Noncompliant\n            .Build());\n\n    public object ArrowInConstructorArgument() =>\n        new Exception(builder\n        .Build()    // Noncompliant\n            .ToString());\n\n    public Builder ReturnNoncompliant()\n    {\n        return builder\n        .Build()            // Noncompliant, too little\n                .Build();   // Noncompliant, too much\n    }\n\n    public Builder ReturnCompliant()\n    {\n        return builder\n            .Build()\n            .Build()\n            .Build()\n            .Build(\"Are we sure it's really built?\");\n    }\n\n    public bool ReturnNestedExpressions()\n    {\n        return true\n            && true\n            && builder\n                .Build()\n                    .IsTrue();   // Noncompliant\n    }\n\n    public bool ArrowNestedExpressions() =>\n        true\n        && true\n        && builder\n            .Build()\n                .IsTrue();   // Noncompliant\n\n    public object ArrowNestedExpressionTernary() =>\n        true\n        && true\n            ? builder\n                .Build()\n                    .Build()    // Noncompliant\n            : null;\n\n    public void Invocations()\n    {\n        Something(builder\n        .Build()            // Noncompliant {{Indent this member access at line position 13.}}\n                .Build(),   // Noncompliant, too far\n            \"Some other argument\");\n        Something(builder   // This is bad already\n            .Build()\n            .Build(),\n            \"Some other argument\");\n        global::Sample.Something(builder    // This is bad already\n                .Build()    // Noncompliant {{Indent this member access at line position 13.}}\n                .Build(),   // Noncompliant\n            \"Some other argument\");\n        global::Sample.Something(builder  // This is bad already\n            .Build()\n            .Build(),\n            \"Some other argument\");\n        Something(Something(Something(builder // This is bad already\n                .Build()    // Noncompliant {{Indent this member access at line position 13.}}\n                .Build(),   // Noncompliant\n            \"Some other argument\")));\n        Something(Something(Something(builder // This is bad already\n            .Build()\n            .Build(),\n            \"Some other argument\")));\n\n        Something(\n            builder\n            .Build()        // Noncompliant {{Indent this member access at line position 17.}}\n            .Build(),       // Noncompliant\n            \"Some other argument\");\n        Something(\n            builder\n                .Build()\n                .Build(),\n            \"Some other argument\");\n\n        global::Sample.Something(       // Longer invocation name does not matter\n            builder\n                .Build()\n                .Build(),\n            \"Some other argument\");\n\n        Something(Something(Something(  // This is bad already for other reasons\n            builder\n                .Build()\n                .Build(),\n            \"Some other argument\")));\n    }\n\n    public void ObjectInitializer()\n    {\n        _ = new Builder\n        {\n            Variable = builder.Build()\n                .Build()\n            .Build()            // Noncompliant\n                    .Build()    // Noncompliant\n        };\n    }\n\n    public void Lambdas(int[] list, int[] longer)\n    {\n        list.Where(x => builder\n            .Build()                    // Noncompliant, too close\n                        .IsTrue());     // Noncompliant, too close\n        list.Where(x => builder\n                        .IsTrue());     // Noncompliant, too close\n        list.Where(x => builder\n                             .IsTrue());    // Noncompliant, too far\n        list.Where(x => builder             // Simple lambda\n                            .IsTrue());\n        list.Where((x) => builder           // Parenthesized lambda\n                            .IsTrue());\n        longer.Where(x => builder           // Simple lambda, longer name\n                            .Build()        // Compliant, as long as it's after the builder and aligned to the grid of 4\n                            .IsTrue());\n        longer.Where((x) => builder         // Parenthesized lambda, longer name\n                                .Build()    // Compliant, as long as it's after the builder and aligned to the grid of 4\n                                .IsTrue());\n        list.Where(x =>\n        {\n            return builder\n                .IsTrue();\n        });\n    }\n\n    public void If()\n    {\n        if (builder\n        .Build()                // Noncompliant {{Indent this member access at line position 17.}}\n                    .IsTrue())  // Noncompliant\n        {\n        }\n        if (builder\n                .Build()\n                .IsTrue())\n        {\n        }\n        else if (builder\n                    .Build()\n                        .IsTrue())  // Noncompliant\n        {\n        }\n\n    }\n\n    public void While()\n    {\n        while (builder\n        .Build()                // Noncompliant {{Indent this member access at line position 17.}}\n                    .IsTrue())  // Noncompliant\n        {\n        }\n        while (builder\n                .Build()\n                .IsTrue())\n        {\n        }\n    }\n\n    public void For()\n    {\n        for (var i = 0; builder\n                        .Build()                // Noncompliant {{Indent this member access at line position 29.}}\n                                .IsTrue(); i++) // Noncompliant\n        {\n        }\n        for (int i = 0; builder\n                            .Build()\n                            .IsTrue(); i++)\n        {\n        }\n    }\n\n    public void ConditionalAccess()\n    {\n        builder?\n                .Build()?   // Noncompliant\n        //      ^^^^^^\n        .Build();           // Noncompliant\n\n        builder?\n            .Build()?\n            .Build();\n        builder\n        ?.Build()       // Another problem that is out of scope\n                ?.Build();\n        builder?.Build()?.Build();\n    }\n\n    public void Global()\n    {\n        global::Builder\n                .StaticMethod();    // Noncompliant\n        global::Builder\n            .StaticMethod();\n    }\n\n    public void NestedClasses()\n    {\n        Builder.NestedOnce\n                .StaticMethod();    // Noncompliant\n        Builder.NestedOnce\n            .StaticMethod();\n        Builder.NestedOnce.NestedTwice\n                .StaticMethod();    // Noncompliant\n        Builder.NestedOnce.NestedTwice\n            .StaticMethod();\n    }\n\n    public void SwitchExpressions(object arg)\n    {\n        _ = arg switch\n        {\n            ArgumentException someLongerName =>\n                builder\n                    .Build()\n                        .Build(),   // Noncompliant\n            Exception someLongerName => builder\n                .Build()\n                    .Build(),       // Noncompliant\n            _ => builder\n                .Build()\n                    .Build()        // Noncompliant\n        };\n    }\n\n    public static bool Something(object arg, object another = null) => true;\n}\n\npublic class Builder\n{\n    public Builder Variable;\n    public Builder Property => null;\n    public Builder[] Indexed;\n\n    public Builder Build() => this;\n    public Builder Build(object arg) => this;\n    public static Builder StaticMethod() => null;\n    public bool IsTrue() => true;\n\n    public class NestedOnce\n    {\n        public static Builder StaticMethod() => null;\n\n        public class NestedTwice\n        {\n            public static Builder StaticMethod() => null;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/IndentOperator.cs",
    "content": "﻿using System;\nusing System.Linq;\n\npublic class Sample\n{\n    private bool condition;\n    private object first, middle, last;\n\n    public void Method()\n    {\n        bool longVariableName;\n        longVariableName = condition    // 0\n        && true;        // Noncompliant {{Indent this operator at line position 13.}}\n\n        longVariableName = condition   // 1\n         && true;       // Noncompliant\n\n        longVariableName = condition   // 2\n          && true;      // Noncompliant\n\n        longVariableName = condition   // 3\n           && true;     // Noncompliant\n\n        longVariableName = condition   // 4\n            && true;\n\n        longVariableName = condition   // 5\n             && true;   // Noncompliant\n        //   ^^^^^^^\n\n        longVariableName = condition   // One of the branches is too far\n            && true;\n\n        longVariableName = condition   // One of the branches is too far\n             && true;   // Noncompliant\n\n        longVariableName = condition && true;\n    }\n\n    public bool ArrowNoncompliant() =>\n        condition\n            && true     // Noncompliant {{Indent this operator at line position 9.}}\n            && true;    // Noncompliant\n\n    public bool ArrowCompliant() =>\n        condition\n        && true\n        && true\n        && true;\n\n    public object ArrowNullCoalescing() =>\n        first\n        ?? middle\n        ?? middle\n            ?? last;    // Noncompliant\n\n    public bool ArrowNotInScope() =>\n        condition && true;\n\n    public object ArrowInInvocationArgument() =>\n        Something(condition\n            && true\n            && true\n                && true);   // Noncompliant\n\n    public object ArrowInInvocationArgumentStartsOnNextLIne() =>\n        Something(\n            condition\n            && true\n            && true\n                && true);   // Noncompliant\n\n    public object ArrowInConstructorArgument() =>\n        new Nullable<bool>(condition\n                        && true     // Noncompliant\n                            && true);\n\n    public bool ReturnNoncompliant()\n    {\n        return condition\n                && true; // Noncompliant, too much\n    }\n\n    public bool ReturnCompliant()\n    {\n        return condition\n            && true\n            && true;\n    }\n\n    public bool ReturnTernary()\n    {\n        return condition\n            && true\n                ? true\n                : false;\n    }\n\n    public void Invocations()\n    {\n        Something(condition // This is bad already\n        && true,            // Noncompliant {{Indent this operator at line position 13.}}\n            \"Some other argument\");\n        Something(condition     // This is bad already\n                    && true,    // Noncompliant\n            \"Some other argument\");\n        global::Sample.Something(condition  // This is bad already\n                && true     // Noncompliant {{Indent this operator at line position 13.}}\n                && true,    // Noncompliant\n            \"Some other argument\");\n        global::Sample.Something(condition      // This is bad already\n                                    && true,    // Noncompliant\n            \"Some other argument\");\n        Something(Something(Something(condition // This is bad already\n                && true,    // Noncompliant {{Indent this operator at line position 13.}}\n            \"Some other argument\")));\n        Something(Something(Something(condition     // This is bad already\n                                        && true,    // Noncompliant\n            \"Some other argument\")));\n\n        Something(\n            condition\n                && true,        // Noncompliant {{Indent this operator at line position 13.}}\n            \"Some other argument\");\n        Something(\n            condition\n            && true,\n            \"Some other argument\");\n\n        global::Sample.Something(       // Longer invocation name does not matter\n            condition\n            && true,\n            \"Some other argument\");\n\n        Something(Something(Something(  // This is bad already for other reasons\n            condition\n            && true\n            && true,\n            \"Some other argument\")));\n    }\n\n    public void ObjectInitializer()\n    {\n        _ = new WithProperty\n        {\n            Value = condition\n                && true\n            && true             // Noncompliant\n                    && true     // Noncompliant\n        };\n    }\n\n    public void CollectionExpression()\n    {\n        _ = string.Join(\" \",\n            [\n                \"\"\n            + \"Too close\"       // Noncompliant\n                + \"Good\"\n                    + \"Too far\" // Noncompliant\n            ]);\n        _ = string.Join(\" \", [\n            \"\"\n        + \"Too close\"       // Noncompliant\n            + \"Good\"\n                + \"Too far\" // Noncompliant\n            ]);\n    }\n\n    public void Lambdas(int[] list, int[] longer)\n    {\n        list.Where(x => condition\n                    && true             // Noncompliant, too close\n                            && true);   // Noncompliant, too close\n        list.Where(x => condition\n                                && true // Noncompliant, too far\n                             && true);  // Noncompliant, too far\n        list.Where(x => condition       // Simple lambda\n                        && true\n                        && true\n                        && true);\n        list.Where((x) => condition     // Parenthesized lambda\n                            && true\n                            && true);\n        longer.Where(x => condition     // Simple lambda, longer name\n                            && true);   // Compliant, as long as it's after the condition and aligned to the grid of 4\n        longer.Where((x) => condition   // Parenthesized lambda, longer name\n                            && true);   // Compliant, as long as it's after the condition and aligned to the grid of 4\n        list.Select(xxxx => first\n                            ?? middle\n                            ?? middle\n                                ?? last);   // Noncompliant\n        list.Where(x =>\n        {\n            return condition\n                && true;\n        });\n    }\n\n    public void If()\n    {\n        if (condition\n        && true             // Noncompliant {{Indent this operator at line position 13.}}\n                && true)    // Noncompliant\n        {\n        }\n        if (condition\n            && true\n            && true)\n        {\n        }\n        else if (condition\n            && true\n                && true)    // Noncompliant\n        {\n        }\n    }\n\n    public void While()\n    {\n        while (condition\n        && true             // Noncompliant {{Indent this operator at line position 13.}}\n                && true)    // Noncompliant\n        {\n        }\n        while (condition\n            && true\n            && true)\n        {\n        }\n    }\n\n    public void For()\n    {\n        for (var i = 0; condition\n                    && true                 // Noncompliant {{Indent this operator at line position 25.}}\n                            && true; i++)   // Noncompliant\n        {\n        }\n        for (int i = 0; condition\n                        && true; i++)\n        { }\n        for (int i = 0; condition\n                        && true\n                        && true; i++)\n        { }\n        for (int ii = 0; condition\n                            && true\n                            && true; ii++)\n        { }\n        for (int iii = 0; condition\n                            && true\n                            && true; iii++)\n        { }\n        for (int iiii = 0; condition\n                            && true\n                            && true; iiii++)\n        { }\n        for (int iiiii = 0; condition\n                            && true\n                            && true; iiiii++)\n        { }\n    }\n\n    public void Nested()\n    {\n        _ = true\n            || true\n            || (false && true)\n            || (false\n            && true)            // Noncompliant {{Indent this operator at line position 17.}}\n            || ((((false))\n            && ((true))))       // Noncompliant {{Indent this operator at line position 17.}}\n            || (((bool)(false))\n            && ((bool)(true)))  // Noncompliant {{Indent this operator at line position 17.}}\n            || (false\n            && (true            // Noncompliant {{Indent this operator at line position 17.}}\n            || false))          // Noncompliant {{Indent this operator at line position 17.}} This should be 21, but because the previous line is misplaced, it self-aligns with it to 17.\n            || (false\n                && (true\n                || false));     // Noncompliant {{Indent this operator at line position 21.}} Once the previous line is fixed, this will be 21 as expected.\n        _ = true\n            || true\n            || (false && true)\n            || (false\n                && true)\n            || ((((false))\n                && ((true))))\n            || (((bool)(false))\n                && ((bool)(true)))\n            || (false\n                && (true\n                    || false));\n\n        _ = true\n            || (false\n                && (condition is true\n                or false));     // Noncompliant {{Indent this operator at line position 21.}}\n        _ = true\n            || (false\n                && (condition is true\n                    or false));\n        _ = true\n            || (false\n                && (condition\n                is true));      // Noncompliant {{Indent this operator at line position 21.}}\n        _ = true\n            || (false\n                && (condition\n                    is true));\n    }\n\n    public void ConditionalAccess(Builder builder)\n    {\n        builder?\n            .Build(true\n                || false\n                    || false);           // Noncompliant\n\n        builder?\n            .Build(true\n                || false\n                    || false)?           // Noncompliant\n            .Build(true\n                || false\n                    || false);           // Noncompliant\n        builder?.Build()?.Build(true\n            || false\n                || false);               // Noncompliant\n    }\n\n    public void SwitchExpressions(object arg)\n    {\n        _ = arg switch\n        {\n            Exception someLongerName => condition\n                && true\n                    && true,            // Noncompliant\n            _ => condition\n                && true\n                    && true             // Noncompliant\n        };\n    }\n\n    public object Property =>\n        first\n        ?? middle\n        ?? middle\n            ?? last;  // Noncompliant\n\n    public object AccessorCoalesce\n    {\n        get => first\n            ?? middle\n            ?? middle\n                ?? last;  // Noncompliant\n    }\n\n    public bool Accessor\n    {\n        get => condition\n            && true\n                && true;    // Noncompliant\n    }\n\n    public static bool Something(bool arg, object another = null) => true;\n}\n\nclass Operators\n{\n    object first, middle, last;\n\n    void LogicalOperator(bool a, bool b)\n    {\n        _ = a\n                && b;   // Noncompliant {{Indent this operator at line position 13.}}\n        //      ^^^^\n        _ = a\n                || b;   // Noncompliant\n        _ = a\n                & b;    // Noncompliant\n        _ = a\n                | b;    // Noncompliant\n        _ = a\n                ^ b;    // Noncompliant\n    }\n\n    void Ternary()\n    {\n        _ = true\n        ? 1 // Compliant, handled by T0025\n        : 2;\n\n        _ = true\n        && true             // Noncompliant\n                || false    // Noncompliant\n            ? 1\n            : 2;\n\n        _ = true\n            && true\n            || false\n            ? 1\n            : 2;\n\n        _ = true\n            ? true\n            && false            // Noncompliant\n                    && false    // Noncompliant\n            : false\n            || true             // Noncompliant\n                    || true;    // Noncompliant\n\n        _ = true\n            ? true\n                && false\n            : false\n                || true;\n\n        _ = true\n            ? first\n                ?? middle\n                ?? middle\n                    ?? last     // Noncompliant\n            : null;\n    }\n\n    void Coelesce(object o1, object o2, object o3)\n    {\n        _ = o1\n            ?? o2\n            ?? o2\n            ?? o2\n                ?? o3;      // Noncompliant\n    }\n\n    void AsIs(object o)\n    {\n        _ = o\n                as string;  // Noncompliant\n        //      ^^^^^^^^^\n        _ = o\n                is string;  // Noncompliant\n    }\n\n    void Pattern(object o1, object o2)\n    {\n        _ = o1 is int\n                or float;   // Noncompliant\n        //      ^^^^^^^^\n\n        _ = o1 is string { Length: > 5 }\n                and { Length: < 10 };    // Noncompliant {{Indent this operator at line position 13.}}\n    }\n\n    void Arithmetic(int a, int b, string str)\n    {\n        _ = a\n                + b;        // Noncompliant\n        _ = a\n                - b;        // Noncompliant\n        _ = a\n                * b;        // Noncompliant\n        _ = a\n                / b;        // Noncompliant\n        _ = a\n                % b;        // Noncompliant\n        _ = str\n                + \"asdf\";   // Noncompliant\n    }\n\n    void Comparison(int a, int b)\n    {\n        _ = a\n                == b;   // Noncompliant\n        _ = a\n                != b;   // Noncompliant\n        _ = a\n                < b;    // Noncompliant\n        _ = a\n                > b;    // Noncompliant\n        _ = a\n                <= b;   // Noncompliant\n        _ = a\n                >= b;   // Noncompliant\n    }\n\n    void Shift(int a, int b)\n    {\n        _ = a\n                << b;   // Noncompliant\n        _ = a\n                >> b;   // Noncompliant\n        _ = a\n                >>> b;  // Noncompliant\n    }\n\n    void Range()\n    {\n        _ = 1\n                ..2;    // Noncompliant\n        //      ^^^\n    }\n}\n\npublic class WithProperty\n{\n    public bool Value { get; set; }\n}\n\npublic class Coverage\n{\n    [Obsolete(\"For\" + \" coverage\", true is true or true)]   // Error [CS0182] An attribute argument must be a constant expression\n    public void BinaryAndPatterns() { }\n\n    [Obsolete(1..2)]    // Error [CS1503] Argument 1: cannot convert from 'System.Range' to 'string?'\n    public void RangeOperator() { }\n}\n\npublic class Builder\n{\n    public Builder Build(params object[] args) => this;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/IndentRawString.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\npublic class Sample\n{\n    public void Method()\n    {\n        _ = \"\"\"\n        0\n        \"\"\";           // Noncompliant {{Indent this raw string literal at line position 13.}}\n\n        _ = \"\"\"\n         1\n         \"\"\";          // Noncompliant {{Indent this raw string literal at line position 13.}}\n\n        _ = \"\"\"\n          2\n          \"\"\";         // Noncompliant {{Indent this raw string literal at line position 13.}}\n\n        _ = \"\"\"\n           3\n           \"\"\";        // Noncompliant {{Indent this raw string literal at line position 13.}}\n\n        _ = \"\"\"\n            4\n            \"\"\";\n\n        _ = \"\"\"\n             5\n             \"\"\";      // Noncompliant {{Indent this raw string literal at line position 13.}}\n        //   ^^^\n\n        _ = $\"\"\"\n             Interpolated{5}\n             \"\"\";      // Noncompliant\n        _ = $$$\"\"\"\n             Interpolated{{{5}}}\n             \"\"\";      // Noncompliant\n        _ = \"\"\"\n             Utf8\n             \"\"\"u8;   // Noncompliant\n\n        _ = \"\"\"Text\"\"\";\n        _ =\n        \"\"\"\n            Wrong start is not in scope\n            \"\"\";\n        _ = \"\"\"\n            Good\n            \"\"\";\n        _ = $\"\"\"{this} is not relevant\"\"\";\n        _ = $$\"\"\"{{this}} is not relevant\"\"\";\n    }\n\n    public string ArrowNoncompliant() =>\n    \"\"\"\n    Too close\n    \"\"\";                // Noncompliant\n\n    public string ArrowCompliant() =>\n        \"\"\"\n        Good\n        \"\"\";\n\n    public string ArrowInterpolatedNoncompliant(string value) =>\n    $\"\"\"\n    Too close {value}\n    \"\"\";                // Noncompliant\n\n    public string ArrowInterpolatedCompliant(string value) =>\n        $\"\"\"\n        Good interpolated {value}\n        \"\"\";\n\n    public object ArrowInInvocationArgument() =>\n        Invocation(\"\"\"\n            Good\n            \"\"\");\n\n    public object ArrowInConstructorArgument() =>\n        new Exception(\"\"\"\n            Good\n            \"\"\");\n\n    public Exception ArrowInConstructorArgumentImplicit() =>\n        new(\"\"\"\n            Good\n            \"\"\");\n\n    public object ArrowBuilderArgument() =>\n        new Builder()\n            .Build(\"\"\"\n                Good\n                \"\"\")\n            .Build(\"\"\"\n            Too close\n            \"\"\");       // Noncompliant\n\n\n    public string ReturnNoncompliant()\n    {\n        return \"\"\"\n        Too close\n        \"\"\";            // Noncompliant\n    }\n\n    public string ReturnCompliant()\n    {\n        return \"\"\"\n            Good\n            \"\"\";\n    }\n\n    public string ArrowPropertyNoncompliant\n    {\n        get => \"\"\"\n        Too close\n        \"\"\";    // Noncompliant\n    }\n    public string ArrowPropertyCompliant\n    {\n        get => \"\"\"\n            Good\n            \"\"\";\n    }\n\n    public void Assignment()\n    {\n        _ = Invocation(\"\"\"\n            Good\n            \"\"\");\n        _ = Invocation(\"\"\"\n        Too close\n        \"\"\");       // Noncompliant\n        _ = Invocation(\"\"\"\n                Too far\n                \"\"\");       // Noncompliant\n    }\n\n    public void Invocations()\n    {\n        var value = \"Previous is not string\";\n        Invocation(\"\"\"\n        Too close\n        \"\"\",                // Noncompliant {{Indent this raw string literal at line position 13.}}\n            \"\"\"\n            Good, standalone start line\n            \"\"\", \"\"\"\n            Good, sharing start line with comma\n            \"\"\", \"\"\"\n                Too far\n                \"\"\");       // Noncompliant\n        Invocation(\n            value, \"\"\"\n            Good, sharing start line with comma\n            \"\"\", \"\"\"\n                Too far\n                \"\"\");       // Noncompliant\n        Invocation(\"\"\"\n            Good\n            \"\"\", \"\"\"\n            Good\n            \"\"\");\n        global::Sample.Invocation(\"\"\"\n        Too close\n        \"\"\",            // Noncompliant {{Indent this raw string literal at line position 13.}}\n            \"\"\"\n            Good\n            \"\"\", \"\"\"\n                 Too far\n                 \"\"\");     // Noncompliant\n        global::Sample.Invocation(\"\"\"\n            Good\n            \"\"\");\n        // This is bad already for other reasons\n        Invocation(Invocation(Invocation(\"\"\"\n        Too close\n        \"\"\",            // Noncompliant {{Indent this raw string literal at line position 13.}}\n            \"\"\"\n            Good\n            \"\"\", \"\"\"\n                Too far\n                \"\"\"))); // Noncompliant\n        // This is bad already for other reasons\n        Invocation(Invocation(Invocation(\"\"\"\n            Good\n            \"\"\")));\n\n        Invocation(\n            Invocation(\"\"\"\n            Nested too close\n            \"\"\",         // Noncompliant {{Indent this raw string literal at line position 17.}}\n                    \"\"\"\n                    Nested too far\n                    \"\"\"),  // Noncompliant\n            \"Some other argument\");\n        Invocation(\n            Invocation(\"\"\"\n                Good\n                \"\"\", \"\"\"\n                Good\n                \"\"\"),\n            \"Some other argument\");\n        global::Sample.Invocation(  // Longer invocation name does not matter\n            \"\"\"\n            Good\n            \"\"\", \"\"\"\n            Good\n            \"\"\");\n\n        Invocation(Invocation(Invocation(   // This is bad already for other reasons\n            \"\"\"\n            Good\n            \"\"\", \"\"\"\n            Good\n            \"\"\")));\n    }\n\n    public void ObjectInitializer()\n    {\n        _ = new WithProperty\n        {\n            First = \"\"\"\n                Good\n                \"\"\",\n            Second = \"\"\"\n            Good\n            \"\"\",        // Noncompliant\n        };\n    }\n\n    public void CollectionExpression()\n    {\n        _ = string.Join(\" \",\n            [\n            \"\"\"\n            Too close\n            \"\"\",            // Noncompliant {{Indent this raw string literal at line position 17.}}\n                \"\"\"\n                Good\n                \"\"\", \"\"\"\n                    Too far\n                    \"\"\"     // Noncompliant {{Indent this raw string literal at line position 17.}}\n            ]);\n        _ = string.Join(\" \", [\n        \"\"\"\n        Too close\n        \"\"\",            // Noncompliant {{Indent this raw string literal at line position 13.}}\n            \"\"\"\n            Good\n            \"\"\", \"\"\"\n                Too far\n                \"\"\"     // Noncompliant {{Indent this raw string literal at line position 13.}}\n        ]);\n    }\n\n    public void Constructors()\n    {\n        Invoke(new(\n        \"\"\"\n        Too close\n        \"\"\",            // Noncompliant {{Indent this raw string literal at line position 13.}}\n            \"\"\"\n            Good\n            \"\"\", \"\"\"\n                Too far\n                \"\"\"     // Noncompliant {{Indent this raw string literal at line position 13.}}\n            ));\n        Invoke(\n            new(\n            \"\"\"\n            Too close\n            \"\"\",            // Noncompliant {{Indent this raw string literal at line position 17.}}\n                \"\"\"\n                Good\n                \"\"\", \"\"\"\n                    Too far\n                    \"\"\"     // Noncompliant {{Indent this raw string literal at line position 17.}}\n            ));\n        Invoke(new WithThreeArguments(\n        \"\"\"\n        Too close\n        \"\"\",            // Noncompliant {{Indent this raw string literal at line position 13.}}\n            \"\"\"\n            Good\n            \"\"\", \"\"\"\n                Too far\n                \"\"\"     // Noncompliant {{Indent this raw string literal at line position 13.}}\n            ));\n        Invoke(\n            new WithThreeArguments(\n            \"\"\"\n            Too close\n            \"\"\",            // Noncompliant {{Indent this raw string literal at line position 17.}}\n                \"\"\"\n                Good\n                \"\"\", \"\"\"\n                    Too far\n                    \"\"\"     // Noncompliant {{Indent this raw string literal at line position 17.}}\n            ));\n\n        void Invoke(WithThreeArguments ex) { }\n    }\n\n    public void Lambdas(int[] list)\n    {\n        // Simple lambda\n        list.Where(x => \"\"\"\n        We don't care, it's wrong already to use it here\n        \"\"\" == \"\");\n        list.Where(x => \"\"\"\n                                        We don't care, it's wrong already to use it here\n                                        \"\"\" == \"\");\n        // Parenthesized lambda\n        list.Where((x) => \"\"\"\n        We don't care, it's wrong already to use it here\n        \"\"\" == \"\");\n        list.Where((x) => \"\"\"\n                                        We don't care, it's wrong already to use it here\n                                        \"\"\" == \"\");\n\n        list.Where(x =>\n        {\n            return \"\"\"\n            Too close\n            \"\"\" == \"\";          // Noncompliant\n            return \"\"\"\n                Good\n                \"\"\" == \"\";\n            return \"\"\"\n                    Too far\n                    \"\"\" == \"\";  // Noncompliant\n        });\n    }\n\n    public void If()\n    {\n        if (\"\"\"\n        We don't care, it's wrong already to use it here\n        \"\"\" == \"\"\"\n                            We don't care, it's wrong already to use it here\n                            \"\"\")\n        {\n            _ = \"\"\"\n            Alignment inside IF body is supported\n            \"\"\";    // Noncompliant\n        }\n        if (true)\n            _ = \"\"\"\n        Too close, even without parenthesis\n        \"\"\";        // Noncompliant\n    }\n\n    public void While()\n    {\n        while (\"\"\"\n        We don't care, it's wrong already to use it here\n        \"\"\" == \"\"\"\n                        We don't care, it's wrong already to use it here\n                        \"\"\")\n        {\n            _ = \"\"\"\n            Alignment inside WHILE body is supported\n            \"\"\";    // Noncompliant\n        }\n    }\n\n    public void For()\n    {\n        for (var i = 0; \"\"\"\n            We don't care, it's wrong already to use it here\n            \"\"\" == \"\"\"\n                                    We don't care, it's wrong already to use it here\n                                    \"\"\"; i++)\n        {\n            _ = \"\"\"\n            Alignment inside FOR body is supported\n            \"\"\";    // Noncompliant\n        }\n    }\n\n    public void ConditionalAccess(Builder builder)\n    {\n        builder?\n            .Build(\"\"\"\n                Good\n                \"\"\", \"\"\"\n                    Too Far\n                    \"\"\");           // Noncompliant\n\n        builder?\n            .Build(\"\"\"\n                Good\n                \"\"\", \"\"\"\n                    Too Far\n                    \"\"\")?           // Noncompliant\n            .Build(\"\"\"\n                Good\n                \"\"\", \"\"\"\n                    Too Far\n                    \"\"\");           // Noncompliant\n        builder?.Build()?.Build(\"\"\"\n            Good\n            \"\"\", \"\"\"\n                Too Far\n                \"\"\");               // Noncompliant\n    }\n\n    public void SwitchExpressions(object arg)\n    {\n        _ = arg switch\n        {\n            ArgumentException someLongerName => \"\"\"\n                Good\n                \"\"\",\n            Exception someLongerName => \"\"\"\n            Too close\n            \"\"\",                    // Noncompliant\n            _ => \"\"\"\n                Good\n                \"\"\"\n        };\n    }\n\n    public void Throw(bool condition, object arg)\n    {\n        _ = arg ?? new Exception(\"\"\"\n            Good\n            \"\"\");\n        if (condition)\n        {\n            throw new Exception(\"\"\"\n                Good\n                \"\"\");\n        }\n        else\n        {\n            throw new ArgumentException(\"\"\"\n            Too close\n            \"\"\",            // Noncompliant\n                    \"\"\"\n                    Too far\n                    \"\"\");   // Noncompliant\n\n        }\n    }\n\n    public void Builders()\n    {\n        //EqualsValue\n        var builder = new Builder(\"\"\"\n            Good\n            \"\"\", \"\"\"\n                Too far\n                \"\"\");   // Noncompliant\n\n        // Assignment\n        builder = new Builder(\"\"\"\n            Good\n            \"\"\", \"\"\"\n                Too far\n                \"\"\");   // Noncompliant\n\n\n        builder.Build(\"\"\"\n            Good\n            \"\"\",\n                \"\"\"\n                Too far\n                \"\"\");   // Noncompliant\n    }\n\n    public void ArgumentWithInvocation()\n    {\n        Invocation(\"\"\"\n            Good\n            \"\"\"\n                .ToString());\n\n        Invocation(\n            \"\"\"\n            Good\n            \"\"\"\n                .ToString());\n\n        Invocation(\"\"\"\n                Too far\n                \"\"\" // Noncompliant\n                    .ToString());\n    }\n\n    public void CollectionInitializer()\n    {\n        var list = new List<string>\n        {\n            \"\"\"\n            Good\n            \"\"\", \"\"\"\n                Too far\n                \"\"\"     // Noncompliant\n        };\n        var dict = new Dictionary<string, string> {\n            {\n                \"Key\", \"\"\"\n                Good\n                \"\"\"\n            },\n            {\n                \"Key\", \"\"\"\n                    Too far\n                    \"\"\" // Noncompliant\n            }\n        };\n    }\n\n    public void Ternary(bool condition)\n    {\n        _ = condition\n            ? \"\"\"\n                Good\n                \"\"\"\n            : \"\"\"\n                Good\n                \"\"\";\n        _ = condition\n            ? \"\"\"\n            Too close\n            \"\"\"     // Noncompliant\n            : \"\"\"\n            Too close\n            \"\"\";    // Noncompliant\n\n        Invocation(condition\n            ? \"\"\"\n                Good\n                \"\"\"\n            : \"\"\"\n            Too close\n            \"\"\"); // Noncompliant\n        Invocation(condition\n            ?\n            \"\"\"\n                Good, although the opening quote is questionable (not in scope of this rule)\n                \"\"\"\n            :\n            \"\"\"\n            Too close\n            \"\"\"); // Noncompliant\n    }\n\n    public static bool Invocation(params object[] args) => true;\n\n    [Obsolete(\"\"\"\n        For coverage\n        \"\"\")]\n    public void Coverage() { }\n}\n\npublic class Builder\n{\n    public Builder(params object[] args) { }\n    public Builder Build(params object[] args) => this;\n}\n\npublic class WithProperty\n{\n    public string First { get; set; }\n    public string Second { get; set; }\n}\n\npublic class WithThreeArguments\n{\n    public WithThreeArguments(string a, string b, string c) { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/IndentTernary.cs",
    "content": "﻿using System;\nusing System.Linq;\n\npublic class Sample\n{\n    private bool condition;\n\n    public void Method()\n    {\n        bool longVariableName;\n        longVariableName = condition    // 0\n        ? true          // Noncompliant {{Indent this ternary at line position 13.}}\n        : false;        // Noncompliant {{Indent this ternary at line position 13.}}\n\n        longVariableName = condition   // 1\n         ? true         // Noncompliant\n         : false;       // Noncompliant\n\n        longVariableName = condition   // 2\n          ? true        // Noncompliant\n          : false;      // Noncompliant\n\n        longVariableName = condition   // 3\n           ? true       // Noncompliant\n           : false;     // Noncompliant\n\n        longVariableName = condition   // 4\n            ? true\n            : false;\n\n        longVariableName = condition   // 5\n             ? true     // Noncompliant\n        //   ^^^^^^\n             : false;   // Noncompliant\n        //   ^^^^^^^\n\n        longVariableName = condition   // One of the branches is too far\n             ? true     // Noncompliant\n            : false;\n\n        longVariableName = condition   // One of the branches is too far\n            ? true\n             : false;   // Noncompliant\n\n        longVariableName = condition\n            && true\n                ? true\n                    : false;    // Noncompliant\n\n        longVariableName = condition ? true : false;\n        longVariableName = condition\n            ? true : false;     // Compliant, this is T0024\n        longVariableName = condition ? true\n            : false;            // Compliant, this is T0024\n    }\n\n    public bool ArrowNoncompliant() =>\n        condition\n        ? true          // Noncompliant\n        : false;        // Noncompliant\n\n    public bool ArrowCompliant() =>\n        condition\n            ? true\n            : false;\n\n    public bool ArrowLongerCondition() =>\n        condition\n        && true\n            ? true\n                : false;    // Noncompliant\n\n    public bool ArrowNotInScope() =>\n        condition ? true : false;\n\n    public object ArrowInInvocationArgument() =>\n        Something(condition\n        ? true          // Noncompliant\n            : false);\n\n    public object ArrowInInvocationArgumentLongerCondition() =>\n        Something(condition\n            && true\n            ? true          // Noncompliant\n                : false);\n\n    public object ArrowInConstructorArgument() =>\n        new Nullable<bool>(condition\n        ? true  // Noncompliant\n            : false);\n\n    public bool ReturnNoncompliant()\n    {\n        return condition\n        ? true  // Noncompliant, too little\n                : false; // Noncompliant, too much\n    }\n\n    public bool ReturnCompliant()\n    {\n        return condition\n            ? true\n            : false;\n    }\n\n    public bool ReturnLongerCondition()\n    {\n        return condition\n            && true\n                ? true\n                    : false;    // Noncompliant\n        return (condition\n            && true)\n                ? true\n                    : false;    // FN, we're only looking for binary expression at top level\n    }\n\n    public void Invocations()\n    {\n        Something(condition // This is bad already\n        ? true              // Noncompliant {{Indent this ternary at line position 13.}}\n            : false,\n            \"Some other argument\");\n        Something(condition // This is bad already\n            ? true\n            : false,\n            \"Some other argument\");\n        global::Sample.Something(condition  // This is bad already\n                ? true      // Noncompliant {{Indent this ternary at line position 13.}}\n                : false,    // Noncompliant\n            \"Some other argument\");\n        global::Sample.Something(condition  // This is bad already\n            ? true\n            : false,\n            \"Some other argument\");\n        Something(Something(Something(condition // This is bad already\n                ? true      // Noncompliant {{Indent this ternary at line position 13.}}\n                : false,    // Noncompliant\n            \"Some other argument\")));\n        Something(Something(Something(condition // This is bad already\n            ? true\n            : false,\n            \"Some other argument\")));\n\n        Something(\n            condition\n            ? true          // Noncompliant {{Indent this ternary at line position 17.}}\n            : false,        // Noncompliant\n            \"Some other argument\");\n        Something(\n            condition\n                ? true\n                : false,\n            \"Some other argument\");\n\n        global::Sample.Something(       // Longer invocation name does not matter\n            condition\n                ? true\n                : false,\n            \"Some other argument\");\n\n        Something(Something(Something(  // This is bad already for other reasons\n            condition\n                ? true\n                : false,\n            \"Some other argument\")));\n\n        Something(condition\n            && true\n                ? true\n                    : false);    // Noncompliant)\n        Something(\n            condition\n            && true\n                ? true\n                    : false);    // Noncompliant)\n    }\n\n    public void ObjectInitializer()\n    {\n        _ = new WithProperty\n        {\n            Value = condition\n                ? true\n            :false              // Noncompliant\n        };\n    }\n\n    public void CollectionExpression()\n    {\n        _ = string.Join(\" \",\n            [\n                condition\n                    ? \"true\"\n                : \"false\" // Noncompliant\n            ]);\n        _ = string.Join(\" \", [\n            condition\n                ? \"true\"\n            : \"false\" // Noncompliant\n        ]);\n    }\n\n    public void Lambdas(int[] list, int[] longer)\n    {\n        list.Where(x => condition\n            ? true                  // Noncompliant, too close\n                        : false);   // Noncompliant, too close\n        list.Where(x => condition\n                        ? true      // Noncompliant, too close\n                        : false);   // Noncompliant, too close\n        list.Where(x => condition\n                                ? true  // Noncompliant, too far\n                             : false);  // Noncompliant, too far\n        list.Where(x => condition       // Simple lambda\n                            ? true\n                            : false);\n        list.Where((x) => condition     // Parenthesized lambda\n                            ? true\n                            : false);\n        longer.Where(x => condition         // Simple lambda, longer name\n                            ? true          // Compliant, as long as it's after the condition and aligned to the grid of 4\n                            : false);\n        longer.Where((x) => condition       // Parenthesized lambda, longer name\n                                ? true      // Compliant, as long as it's after the condition and aligned to the grid of 4\n                                : false);\n        list.Where(x =>\n        {\n            return condition\n                ? true\n                : false;\n        });\n    }\n\n    public void If()\n    {\n        if (condition\n        ? true                  // Noncompliant {{Indent this ternary at line position 17.}}\n                    : false)    // Noncompliant\n        {\n        }\n        if (condition\n                ? true\n                : false)\n        {\n        }\n        else if (condition\n                    ? true\n                        : false)    // Noncompliant\n        {\n        }\n        if(condition\n            && true\n                ? true\n                    : false)    // Noncompliant\n        {\n        }\n    }\n\n    public void While()\n    {\n        while (condition\n        ? true                  // Noncompliant {{Indent this ternary at line position 17.}}\n                    : false)    // Noncompliant\n        {\n        }\n        while (condition\n                ? true\n                : false)\n        {\n        }\n    }\n\n    public void For()\n    {\n        for (var i = 0; condition\n                        ? true                  // Noncompliant {{Indent this ternary at line position 29.}}\n                                : false; i++)   // Noncompliant\n        {\n        }\n        for (int i = 0; condition\n                            ? true\n                            : false; i++)\n        {\n        }\n    }\n\n    public void ConditionalAccess(Builder builder)\n    {\n        builder?\n            .Build(condition\n                ? true\n                    : false);       // Noncompliant\n\n        builder?\n            .Build(condition\n                ? true\n                    : false)?       // Noncompliant\n            .Build(condition\n                ? true\n                    : false);       // Noncompliant\n        builder?.Build()?.Build(condition\n            ? true\n                : false);           // Noncompliant\n    }\n\n    public void SwitchExpressions(object arg)\n    {\n        _ = arg switch\n        {\n            ArgumentException someLongerName => condition\n                && true\n                    ? true\n                        : false,        // Noncompliant\n            Exception someLongerName => condition\n                ? true\n                    : false,        // Noncompliant\n            _ => condition\n                ? true\n                    : false         // Noncompliant\n        };\n    }\n\n    [Obsolete(true  // Not supported, used for coverage\n    ? \"true\"\n    : \"false\")]\n    public static bool Something(bool arg, object another = null) => true;\n}\n\npublic class Builder\n{\n    public Builder Build(params object[] args) => this;\n}\n\npublic class WithProperty\n{\n    public bool Value { get; set; }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/InitializerLine.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\npublic class Fields\n{\n    private string nextLineString =\n        \"Ipsum\"; // Noncompliant {{Move this initializer to the previous line.}}\n    //  ^^^^^^^\n\n    private string sameLine = \"Lorem\";\n\n    private string nextLineWhereTheFinalLinewouldBeLongButWithin200Limit_Noncompliant =\n        \"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus faucibus elit et phasellus, Length is 200.\";    // Noncompliant, it fits\n\n    private string nextLineWhereTheFinalLinewouldBeTooLongSoItMustBeOnTheNextLineAnyway_Length201_Compliant =\n        \"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus. Final Length is 201.\";\n\n    private string nextLineWhereTheFinalLinewouldBeTooLongSoItMustBeOnTheNextLineAnyway_Length223_Compliant =\n        \"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus. Final Length is definitely more than 200.\";\n\n    private int[] values =\n        [\n        ];\n    public List<int> newOnNextLine =\n        new()               // Noncompliant, multiline only in this case\n//      ^^^^^\n        {\n        };\n\n    public List<int> newOnNextLineWithArguments_Implicit =\n        new(42)             // Noncompliant\n//      ^^^^^^^\n        {\n        };\n\n    public List<int> newOnNextLineWithArguments_Explicit =\n        new List<int>(42)   // Noncompliant\n//      ^^^^^^^^^^^^^^^^^\n        {\n        };\n\n    public List<int> newOnNextLineWithArguments_Explicit_NoArgumentList =\n        new List<int>       // Noncompliant\n//      ^^^^^^^^^^^^^\n        {\n        };\n\n    public List<int> newOnNextLineWithArgumentsWhereTheFinalLineWouldBeTooLongSoItMustBeOnTheNextLineAnyway_Implicit_Compliant =\n        new(1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1)\n        {\n        };\n\n    public List<int> newOnNextLineWithArgumentsWhereTheFinalLineWouldBeTooLongSoItMustBeOnTheNextLineAnyway_Explicit_Compliant =\n        new List<int>(1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1)\n        {\n        };\n\n    public List<int> newOnSameLine = new()\n    {\n    };\n\n    private string multiLine = \"Lorem\" +\n        \"Ipsum\";\n\n    private int computedNextLine =\n        Compute();              // Noncompliant\n    private int computedSameLine = Compute();\n    private int computedMultipleLines = Compute()\n        + Compute();\n\n    private static int Compute() => 42;\n\n    private int multipleSameLineA = 1, multipleSameLineB = 2;\n    private int multipleMixedLineA = 1, multipleMixedLineB =\n        2;                      // Noncompliant\n    private int multipleMultiLineA =\n        1, multipleMultiLineB = // Noncompliant\n        2;                      // Noncompliant\n\n    [Obsolete]\n    public string sameLineAttribute = \"Lorem\";\n\n    [Obsolete]\n    public string nextLineAttribute =\n        \"Ipsum\";    // Noncompliant\n}\n\npublic class Properties\n{\n    private int field;\n    private event EventHandler eventField;\n\n    public string NextLineStringExpressionBody =>\n        \"Ipsum\"; // Noncompliant {{Move this expression to the previous line.}}\n    //  ^^^^^^^\n\n    public string NextLineStringInitializer { get; } =\n        \"Ipsum\"; // Noncompliant {{Move this initializer to the previous line.}}\n    //  ^^^^^^^\n\n    public string SameLineExpressionBody => \"Lorem\";\n    public string SameLineInitializer { get; } = \"Lorem\";\n\n    public string NextLineWhereTheFinalLinewouldBeLongButWithin200Limit_Noncompliant =>\n        \"Lorem ipsum dolor sit amet consectetur adipiscing elit. Phasellus faucibus elit et phasellus, Length is 200.\";    // Noncompliant, it fits\n\n    public string NextLineWhereTheFinalLinewouldBeTooLongSoItMustBeOnTheNextLineAnyway_Length201_Compliant =>\n        \"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus. Final Length is 201.\";\n\n    public string NextLineWhereTheFinalLinewouldBeTooLongSoItMustBeOnTheNextLineAnyway_Length223_Compliant =\n        \"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus. Final Length is definitely more than 200.\";\n\n    public int[] Values =>\n        [\n        ];\n\n    public string MultiLine => \"Lorem\" +\n        \"Ipsum\";\n\n    public int ArrowNoncompliant\n    {\n        get =>\n            field;          // Noncompliant\n        set =>\n            field = value;  // Noncompliant\n    }\n\n    public int ArrowInitNoncompliant\n    {\n        get =>\n            field;          // Noncompliant\n        init =>\n            field = value;  // Noncompliant\n    }\n\n    public event EventHandler MyEvent\n    {\n        add =>\n            eventField += value;    // Noncompliant\n        remove =>\n            eventField -= value;    // Noncompliant\n    }\n\n    public int ArrowCompliant\n    {\n        get => field;\n        set => field = value;\n    }\n\n    public int BodyGetter\n    {\n        get\n        {\n            return 42;\n        }\n    }\n\n    public int AutoImplemented { get; set; }\n\n    [Obsolete]\n    public string SameLineAttribute => \"Lorem\";\n\n    [Obsolete]\n    public string NextLineAttribute { get; } =\n        \"Ipsum\";    // Noncompliant\n\n    public int AccessorsWithAttributes\n    {\n        [Obsolete]\n        get => field;\n        [Obsolete]\n        set =>\n            field = value;  // Noncompliant\n    }\n\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/LambdaParameterName.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\npublic class Sample\n{\n    public void SimpleLambdas()\n    {\n        Method(x => 42);\n        Method(x => { });\n\n        Method(item => 42);     // Noncompliant {{Use 'x' for the lambda parameter name.}}\n        Method(item => { });    // Noncompliant\n        //     ^^^^\n\n        Method(a => 42);        // Noncompliant\n        Method(b => 42);        // Noncompliant\n        Method(y => 42);        // Noncompliant\n        Method(z => 42);        // Noncompliant\n        Method(_ => 42);        // Compliant\n        Method(node => 42);     // Noncompliant\n        Method(dataGridViewCellContextMenuStripNeededEventArgs => 42);     // Noncompliant\n\n\n        Method(x => Enumerable.Range(x, 10).Where(item => item == 42)); // Compliant, nested\n        Method(item => Enumerable.Range(item, 10).Where(x => x == 42)); // Noncompliant, the outer one should be x\n        //     ^^^^\n    }\n\n    public void ParenthesizedLambdas()\n    {\n        Method(() => 42);\n        Method(() => { });\n        Method((a, b) => 42);\n        Method((_, _) => 42);\n        Method((a, b) => { });\n    }\n\n    public void Errors()\n    {\n        // Error@+5 [CS1001] Identifier expected\n        // Error@+4 [CS1003] Syntax error, '=>' expected\n        // Error@+3 [CS1026] ) expected\n        // Error@+2 [CS1593] Delegate 'Func<int, int>' does not take 0 arguments\n        // Error@+1 [CS1003] Syntax error, ',' expected\n        Func<int, int> f = ( => 42);\n\n        // Error@+2 [CS1001] Identifier expected\n        // Error@+1 [CS1503] Argument 1: cannot convert from 'int' to 'System.Func<int>'\n        Method( => 42);\n\n        // Error@+5 [CS1501] No overload for method 'Method' takes 0 arguments\n        // Error@+4 [CS1001] Identifier expected\n        // Error@+3 [CS1002] ; expected\n        // Error@+2 [CS1026] ) expected\n        // Error@+1 [CS1513] Closing curly brace expected\n        Method( => { });\n    }\n\n    private void Method(Func<int> f) { }\n    private void Method(Func<int, int> f) { }\n    private void Method(Func<int, int, int> f) { }\n\n    private void Method(Action a) { }\n    private void Method(Action<int> a) { }\n    private void Method(Action<int, int> a) { }\n}\n\npublic class RuleRegistration\n{\n    public void Initialize()\n    {\n        RegisterSonarWhateverAnalysisContext(c => { });\n        RegisterSonarWhateverAnalysisContext(context => { });\n        RegisterSonarWhateverAnalysisContext(whateverContext => { });\n        RegisterSonarWhateverReportingContext(c => { });\n        RegisterSonarSomething(c => { });                // Noncompliant, wrong suffix\n        RegisterSomethingAnalysisContext(c => { });\n        RegisterSomethingReportingContext(c => { });     // Noncompliant, wrong prefix\n        RegisterSonarSomethingContext(c => { });         // Noncompliant, wrong suffix\n    }\n\n    protected void RegisterSonarWhateverAnalysisContext(Action<SonarWhateverAnalysisContext> action) { }\n    protected void RegisterSonarWhateverReportingContext(Action<SonarWhateverReportingContext> action) { }\n    protected void RegisterSonarSomething(Action<SonarSomething> action) { }\n    protected void RegisterSomethingAnalysisContext(Action<SomethingAnalysisContext> action) { }\n    protected void RegisterSomethingReportingContext(Action<SomethingReportingContext> action) { }\n    protected void RegisterSonarSomethingContext(Action<SonarSomethingContext> action) { }\n\n    // Well-known expected classes patterns\n    public class SonarWhateverAnalysisContext { }\n    public class SonarWhateverReportingContext { }\n    public class SomethingAnalysisContext { }\n    // Unexpected types\n    public class SonarSomething { }\n    public class SomethingReportingContext { }\n    public class SonarSomethingContext { }\n}\n\npublic class CustomDelegates\n{\n    public delegate void ParameterNamedI(int i);\n    public delegate void ParameterNamedTest(int test);\n    public delegate void ParameterNamedCamelCasing(int camelCasing);\n\n    public void Test()\n    {\n        ParameterNamedI delegate1 = i => { }; // Compliant \"i\" matches the parameter name of the delegate\n        ParameterNamedI delegate2 = j => { }; // Noncompliant\n        ParameterNamedI delegate3 = x => { }; // Compliant\n\n        ParameterNamedTest delegate4 = test => { };     // Compliant\n        ParameterNamedTest delegate5 = someTest => { }; // Noncompliant\n        ParameterNamedTest delegate6 = testSome => { }; // Noncompliant\n\n        ParameterNamedCamelCasing delegate7 = camelCasing => { }; // Compliant\n        ParameterNamedCamelCasing delegate8 = camelcasing => { }; // Noncompliant\n        ParameterNamedCamelCasing delegate9 = camel => { };     // Noncompliant\n        ParameterNamedCamelCasing delegate10 = casing => { };    // Noncompliant\n\n        Func<int, int> function = arg => 0;  // Noncompliant, the delegate parameter is named \"arg\" (https://learn.microsoft.com/en-us/dotnet/api/system.func-2) but we do not allow that for Func<T, TResult>\n        Action<int> action = obj => { };     // Noncompliant, the delegate parameter is named \"obj\" (https://learn.microsoft.com/en-us/dotnet/api/system.action-1) but we do not allow that for Action<T>\n        new List<int>().Exists(obj => true); // Compliant. List.Exists uses System.Predicate<T> instead of System.Func<T, bool>\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/LocalFunctionLocation.TopLevelStatements.cs",
    "content": "﻿string LocalFunction() => \"Empty\"; // Noncompliant {{This local function should be at the end of the method.}}\n//     ^^^^^^^^^^^^^\n\n_ = LocalFunction();\n\nstring LocalFunction2() => \"Empty\";\nstatic string StaticLocalFunction() => \"Empty\";\n\nclass MyClass\n{\n    public void Method()\n    {\n        void LocalFunction() { } // Noncompliant\n\n        LocalFunction();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/LocalFunctionLocation.cs",
    "content": "﻿class Noncompliant\n{\n    public string Value\n    {\n        get\n        {\n            string LocalFunction() => \"Empty\"; // Noncompliant {{This local function should be at the end of the method.}}\n            return LocalFunction();\n        }\n        set\n        {\n            static void LocalFunction(string _) { }; // Noncompliant {{This local function should be at the end of the method.}}\n            LocalFunction(value);\n        }\n    }\n\n    public string this[int a] {\n        get\n        {\n            string LocalFunction() => \"Empty\"; // Noncompliant {{This local function should be at the end of the method.}}\n            return LocalFunction();\n        }\n        set\n        {\n            static void LocalFunction(string _) { } // Noncompliant {{This local function should be at the end of the method.}}\n            LocalFunction(value);\n        }\n    }\n\n    public Noncompliant()\n    {\n        void LocalFunction() { } // Noncompliant {{This local function should be at the end of the method.}}\n        //   ^^^^^^^^^^^^^\n\n        LocalFunction();\n    }\n\n    void SingleLocalFunction()\n    {\n        void LocalFunction() { } // Noncompliant {{This local function should be at the end of the method.}}\n        //   ^^^^^^^^^^^^^\n\n        LocalFunction();\n    }\n\n    void StaticLocalFunction()\n    {\n        static int LocalFunction() => 42; // Noncompliant\n\n        LocalFunction();\n    }\n\n    void MultipleLocalFunctions()\n    {\n        LocalFunction();\n\n        void LocalFunction() { } // Noncompliant\n\n        LocalFunction2();\n\n        void LocalFunction2() { } // Noncompliant {{This local function should be at the end of the method.}}\n\n        LocalFunction();\n    }\n\n    void WithinBlock(bool a)\n    {\n        if (a)\n        {\n            LocalFunction();\n            void LocalFunction() { } // Noncompliant\n        }\n    }\n\n    void MixCompliantNoncompliant()\n    {\n        LocalFunction();\n\n        void LocalFunction() { } // Noncompliant\n\n        LocalFunction2();\n        LocalFunction();\n\n        void LocalFunction2() { }\n    }\n}\n\nclass Compliant\n{\n    public string Value\n    {\n        get\n        {\n            return LocalFunction();\n            string LocalFunction() => \"Empty\";\n        }\n        set\n        {\n            LocalFunction(value);\n            static void LocalFunction(string _)\n            { }\n        }\n    }\n\n    public string this[int a]\n    {\n        get\n        {\n            return LocalFunction();\n            string LocalFunction() => \"Empty\";\n        }\n        set\n        {\n            LocalFunction(value);\n            static void LocalFunction(string _)\n            { }\n        }\n    }\n\n    public Compliant()\n    {\n        LocalFunction();\n\n        void LocalFunction()\n        { }\n    }\n\n    void SingleLocalFunction()\n    {\n        LocalFunction();\n\n        void LocalFunction() { }\n    }\n\n    void WithinBlock(bool a)\n    {\n        if (a)\n        {\n            LocalFunction();\n        }\n        void LocalFunction() { }\n    }\n\n    void MultipleLocalFunctions()\n    {\n        LocalFunction();\n        LocalFunction();\n        LocalFunction2();\n\n        void LocalFunction() { }\n        void LocalFunction2() { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/MemberAccessLine.cs",
    "content": "﻿using System.Linq;\n\npublic class Sample\n{\n    Builder builder;\n\n    public void Method()\n    {\n        builder.Build().Build()\n            .Build();\n        _ = builder\n            .Build().Build()    // Noncompliant {{Move this member access to the next line.}}\n        //          ^^^^^^\n            .Build().Variable;  // Noncompliant\n        //          ^^^^^^^^^\n        builder\n            .Build().Build();   // Noncompliant\n        //          ^^^^^^\n        builder.Build().Variable.Build()\n            .Build()\n            .Build().Build()    // Noncompliant\n            .Build().Variable   // Noncompliant\n            .Build().Property   // Noncompliant\n            .Build()[42]\n            .Build();\n\n        builder.Build()\n            .Build().Build().Build().Build();\n        //          ^^^^^^                  Noncompliant\n        //                  ^^^^^^          Noncompliant@-1\n        //                          ^^^^^^  Noncompliant@-2\n\n        builder.Build()\n            .Variable\n            .Build()\n            .Property\n            .Build()\n            .Indexed[42]\n            .Build()\n            .Property[42]\n            .Variable[42]\n            .Build()[42]\n            .Build();\n    }\n\n    public void Prerequisites() // These nodes start a multi-line chain\n    {\n        builder\n            .Build().Build();          // Noncompliant\n        builder\n            .Variable.Build();          // Noncompliant\n        builder\n            .Build()[42].Build();       // Noncompliant\n        builder\n            .Variable[42].Build();      // Noncompliant\n    }\n\n    public void FluentAssertions()\n    {\n        builder.Should().BeSomething()\n            .And.BeSomething().And.BeSomething();\n        builder.Should().BeSomething()\n            .And.BeSomething()\n            .And            // Allowed\n            .BeSomething();\n        builder.Build(\"Something long\")\n            .Should().BeSomething();\n\n        builder\n            .And.Variable.Should().BeSomething();\n        builder\n            .And.Variable.Build().Should().BeSomething();\n        builder\n            .Subject.Variable.Should().BeSomething();\n        builder\n            .Which.Variable.Should().BeSomething();\n    }\n\n    public void ConditionalAccess()\n    {\n        builder?\n            .Build()?.Build();              // FN, ConditionalAccessExpression and MemberBindingExpression are too different from MemberAccessExpression to deal with\n        builder?.Build()?.Build();\n    }\n\n    public void Global()\n    {\n        global::Builder\n                .StaticMethod().Build();    // Noncompliant\n        //                     ^^^^^^\n        global::Builder\n            .StaticMethod()\n            .Build();\n    }\n\n    public void Nested()\n    {\n        Builder.NestedOnce.NestedTwice\n            .StaticMethod().Build();        // Noncompliant\n        Builder.NestedOnce.NestedTwice\n            .StaticMethod()\n            .Build();\n    }\n\n    public void ContinuesLines()\n    {\n        var typicallyForImmutableField = new int[]\n            {\n                0,\n                1,\n                2\n            }.ToList();\n\n        _ = builder\n            .Build(\"\"\"\n                This is a long argument\n                \"\"\").Variable;  // Noncompliant, because there's .Build() already in the chain\n\n        _ = builder.Build(\"\"\"\n            This is a long argument\n            \"\"\").Variable.Build();  // Useful for TestSnippet(...).Model.Compilation\n    }\n}\n\npublic class Builder\n{\n    public Builder Variable;\n    public Builder Property => null;\n    public Builder[] Indexed;\n    public Builder this[int index] => null;\n\n    public Builder Build(params object[] args) => this;\n    public static Builder StaticMethod() => null;\n    public bool IsTrue() => true;\n\n    // FluentAssertions-like methods\n    public Builder And => null;\n    public Builder Which => null;\n    public Builder Subject => null;\n    public Builder Should() => null;\n    public Builder BeSomething() => null;\n\n    public class NestedOnce\n    {\n        public class NestedTwice\n        {\n            public static Builder StaticMethod() => null;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/MemberVisibilityOrdering.cs",
    "content": "﻿using System;\n\npublic class ValidOrder\n{\n    public int public1;\n    public int public2;\n\n    internal int internal1;\n    internal int internal2;\n\n    protected int protectedVariant1;\n    private protected int protectedVariant2;\n    protected internal int protectedVariant3;\n    protected int protectedVariant4;\n    private protected int protectedVariant5;\n    protected internal int protectedVariant6;\n\n    private int private1;\n    private int private2;\n}\n\npublic class AbovePrivate\n{\n    private int private1;                       // Secondary    [Private1, Private2, Private3, Private4, Private5, Private6, Private7]\n    //      ^^^^^^^^^^^^\n\n    protected int protectedVariant1;            // Noncompliant [Private1] {{Move this protected Field above the private ones.}}\n    //        ^^^^^^^^^^^^^^^^^^^^^\n    private protected int protectedVariant2;    // Noncompliant [Private2] {{Move this protected Field above the private ones.}}\n    protected internal int protectedVariant3;   // Noncompliant [Private3] {{Move this protected Field above the private ones.}}\n\n    public int public1;                         // Noncompliant [Private4] {{Move this public Field above the private ones.}}\n    internal int internal1;                     // Noncompliant [Private5] {{Move this internal Field above the private ones.}}\n    public int public2;                         // Noncompliant [Private6] {{Move this public Field above the private ones.}}\n    internal int internal2;                     // Noncompliant [Private7] {{Move this internal Field above the private ones.}}\n}\n\npublic class AboveProtected\n{\n    protected int protectedVariant;             // Secondary    [Protected1, Protected2]\n\n    public int public1;                         // Noncompliant [Protected1] {{Move this public Field above the protected ones.}}\n    internal int internal1;                     // Noncompliant [Protected2] {{Move this internal Field above the protected ones.}}\n}\n\npublic class AboveProtectedInternal\n{\n    protected internal int protectedVariant;    // Secondary    [ProtectedInternal1, ProtectedInternal2]\n\n    public int public1;                         // Noncompliant [ProtectedInternal1] {{Move this public Field above the protected ones.}}\n    internal int internal1;                     // Noncompliant [ProtectedInternal2] {{Move this internal Field above the protected ones.}}\n}\n\npublic class AboveProtectedPrivate\n{\n    protected private int protectedVariant;     // Secondary    [ProtectedPrivate1, ProtectedPrivate2]\n\n    public int public1;                         // Noncompliant [ProtectedPrivate1] {{Move this public Field above the protected ones.}}\n    internal int internal1;                     // Noncompliant [ProtectedPrivate2] {{Move this internal Field above the protected ones.}}\n}\n\npublic abstract class CompliantClassFull\n{\n    public const string Constant1 = \"C1\";\n    private const string Constant2 = \"C2\";\n\n    public enum Enum1\n    {\n        None,\n        All\n    }\n\n    private enum Enum2\n    {\n        None,\n        Any,\n        All\n    }\n\n    public readonly object field1 = new();\n    public static readonly object field2 = new();\n    private readonly object field3 = new();\n    private static readonly object field4, field5;\n\n    public abstract int AbstractMethod1();\n    public abstract int AbstractProperty1 { get; }\n    protected abstract int AbstractMethod2();\n    protected abstract int AbstractProperty2 { get; }\n\n    public delegate void SomeDelegate1();\n    private delegate void SomeDelegate2();\n\n    public event EventHandler SomeEvent1;\n    private event EventHandler SomeEvent2;\n\n    public object Property1 { get; } = 42;\n    private object Property2 => 42;\n\n    public object this[int index] => 42;\n    private object this[string name]\n    {\n        get => 42;\n    }\n\n    public CompliantClassFull() { }\n    private CompliantClassFull(int arg) { }\n\n    ~CompliantClassFull() { }   // Not interesting\n\n    public void Method1() { }\n    private void Method2() { }\n\n    public class Nested1 { }        // Relative order of these types is not important\n    private struct Nested2 { }\n    public record Nested3 { }\n    protected record struct Nested4 { }\n    public record Nested5 { }\n    public struct Nested6 { }\n    public class Nested7 { }\n}\n\n\npublic abstract class AllWrong\n{\n    private const string Constant1 = \"C1\";  // Secondary    [Const]\n    public const string Constant2 = \"C2\";   // Noncompliant [Const] {{Move this public Constant above the private ones.}}\n\n    private enum Enum1                      // Secondary    [Enum]\n    {\n        None,\n        All\n    }\n\n    public enum Enum2                       // Noncompliant [Enum] {{Move this public Enum above the private ones.}}\n    {\n        None,\n        Any,\n        All\n    }\n\n    private readonly object field1 = new();         // Secondary    [Field1, Field2]\n    private static readonly object field2 = new();\n    public readonly object field3 = new();          // Noncompliant [Field1] {{Move this public Field above the private ones.}}\n    public static readonly object field4, field5;   // Noncompliant [Field2] {{Move this public Field above the private ones.}}\n\n    protected abstract int AbstractMethod1();       // Secondary    [Abstract1, Abstract2]\n    protected abstract int AbstractProperty1 { get; }\n    public abstract int AbstractMethod2();          // Noncompliant [Abstract1] {{Move this public Abstract Member above the protected ones.}}\n    public abstract int AbstractProperty2 { get; }  // Noncompliant [Abstract2] {{Move this public Abstract Member above the protected ones.}}\n\n    private delegate void SomeDelegate1();          // Secondary    [Delegate]\n    public delegate void SomeDelegate2();           // Noncompliant [Delegate] {{Move this public Delegate above the private ones.}}\n\n    private event EventHandler SomeEvent1;          // Secondary    [Event]\n    public event EventHandler SomeEvent2;           // Noncompliant [Event] {{Move this public Event above the private ones.}}\n\n    private object Property1 { get; } = 42;         // Secondary    [Property]\n    public object Property2 => 42;                  // Noncompliant [Property] {{Move this public Property above the private ones.}}\n\n    private object this[int index] => 42;           // Secondary    [Indexer]\n    public object this[string name]                 // Noncompliant [Indexer] {{Move this public Indexer above the private ones.}}\n    {\n        get => 42;\n    }\n\n    private AllWrong() { }                          // Secondary    [Constructor]\n    public AllWrong(int arg) { }                    // Noncompliant [Constructor] {{Move this public Constructor above the private ones.}}\n\n    private void Method1() { }                      // Secondary    [Method]\n    public void Method2() { }                       // Noncompliant [Method] {{Move this public Method above the private ones.}}\n}\n\npublic record R\n{\n    private int shouldBeLast;   // Secondary    [InRecord]\n    public int shouldBeFirst;   // Noncompliant [InRecord] {{Move this public Field above the private ones.}}\n}\n\npublic record struct RS\n{\n    private int shouldBeLast;   // Secondary    [InRecordStruct]\n    public int shouldBeFirst;   // Noncompliant [InRecordStruct] {{Move this public Field above the private ones.}}\n}\n\npublic record struct S\n{\n    private int shouldBeLast;   // Secondary    [InStruct]\n    public int shouldBeFirst;   // Noncompliant [InStruct] {{Move this public Field above the private ones.}}\n}\n\npublic static class ExtensionBlockCompliant\n{\n    extension(string s)\n    {\n        public int PublicProp => 0;\n        internal int InternalProp => 0;\n        private int PrivateProp => 0;\n\n        public void PublicMethod() { }\n        private void PrivateMethod() { }\n    }\n}\n\npublic static class ExtensionBlockWrong\n{\n    extension(string s)\n    {\n        private int PrivateProp => 0;   // Secondary    [ExtProp]\n        public int PublicProp => 0;     // Noncompliant [ExtProp] {{Move this public Property above the private ones.}}\n\n        private void PrivateMethod() { }  // Secondary    [ExtMethod]\n        public void PublicMethod() { }    // Noncompliant [ExtMethod] {{Move this public Method above the private ones.}}\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/MethodExpressionBodyLine.cs",
    "content": "﻿\nusing System;\n\npublic class Sample\n{\n    private Exception field;\n\n    public Sample() => field = new Exception();     // Noncompliant {{Move this expression body to the next line.}}\n    //                 ^^^^^^^^^^^^^^^^^^^^^^^\n\n    public object MemberAccess() => field.Message;  // Noncompliant {{Move this expression body to the next line.}}\n    //                              ^^^^^^^^^^^^^\n\n    public object Invocation() => Expression();     // Noncompliant\n    public object Expression() => 1 + 2;            // Noncompliant\n    ~Sample() => Console.WriteLine(\"Bye\");          // Noncompliant\n\n    public static object operator +(Sample a, Sample b) => a.field;                 // Noncompliant\n    public static explicit operator string(Sample sample) => sample.field.Message;  // Noncompliant\n\n    // Single-token values are tolerated\n    public object SingleName() => field;    // Comments are fine\n    public object Simple_Null() => null;\n    public object Simple_Bool() => true;\n    public object Simple_Int() => 42;\n    public object Simple_Decimal() => 42.42D;\n\n    public bool ComplexCompliant() =>\n        true && false || true;\n\n    public void WithBody()\n    {\n        Console.WriteLine(\"This is fine\");\n    }\n}\n\npublic interface IBase\n{\n    object FromInterface();\n}\n\npublic abstract class Base\n{\n    public abstract object FromAbstractClass();\n    public virtual object FromVirtualMethod() => 42;\n}\n\npublic class TestStub : Base, IBase\n{\n    public object NewMethod() => throw new NotImplementedException();   // Noncompliant, not a mandatory stub override\n\n    // This is common pattern in UTs => we ignore these specific cases\n    public override object FromAbstractClass() => throw new NotImplementedException();\n    public override object FromVirtualMethod() => throw new NotSupportedException(\"Parameters are allowed\");\n    public object FromInterface() => throw new NotImplementedException();\n}\n\npublic class UnexpectedExceptionType : IBase\n{\n    public object FromInterface() => throw new ArgumentException(\"This is functional\"); // Noncompliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/MoveMethodToDedicatedExtensionClass.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\n\nusing MyString = string;\n\nstatic class StringExtensions\n{\n    public static string ToUpperCase(this string str)\n    {\n        return str.ToUpper();\n    }\n\n    public static string String(this System.String str) => str;\n\n    public static string Generic<T>(this System.String str, T other) => str + other.ToString();\n\n    public static string ToLowerCase(this MyString str) => str.ToLower();\n\n    public static short Short(this short nb) => nb;                  // Noncompliant {{Move this extension method to the Int16Extensions class.}}\n    //                  ^^^^^\n    public static int Int(this int nb) => nb;                        // Noncompliant {{Move this extension method to the Int32Extensions class.}}\n    //                ^^^\n    public static long Long(this long nb) => nb;                     // Noncompliant {{Move this extension method to the Int64Extensions class.}}\n\n    public static short Int16(this System.Int16 nb) => nb;           // Noncompliant {{Move this extension method to the Int16Extensions class.}}\n    public static int Int32(this System.Int32 nb) => nb;             // Noncompliant {{Move this extension method to the Int32Extensions class.}}\n    public static long Int64(this System.Int64 nb) => nb;            // Noncompliant {{Move this extension method to the Int64Extensions class.}}\n    public static System.Int128 Int128(this System.Int128 nb) => nb; // Noncompliant {{Move this extension method to the Int128Extensions class.}}\n\n    public static void ValueTuple(this (int, int) tuple) { }                                // Noncompliant {{Move this extension method to the ValueTupleExtensions or Int32Extensions class.}}\n    public static void ValueTruple(this (int, int, int) truple) { }                         // Noncompliant {{Move this extension method to the ValueTupleExtensions or Int32Extensions class.}}\n    public static void FunWithTuples(this (int, ExplodedNode, System.Int64) truple) { }     // Noncompliant {{Move this extension method to the ValueTupleExtensions, Int32Extensions, ExplodedNodeExtensions, or Int64Extensions class.}}\n    public static void FunWithTwoples(this (string, ExplodedNode, System.Int64) truple) { } // Compliant\n}\n\nclass Generic { }\n\nstatic class GenericExtensions\n{\n    public static T Generic<T>(this T t) => t;      // Noncompliant {{Move this extension method to the ObjectExtensions class.}}\n    public static T[] Generic<T>(this T[] t) => t;  // Noncompliant {{Move this extension method to the ObjectExtensions class.}}\n\n    public static T ConstrainedGeneric<T>(this T t) where T : Generic => t;\n\n    // Error@+1 [CS0450]\n    public static T InvalidConstrainedGeneric<T>(this T t) where T : class, Generic => t;   // Noncompliant - the where clause is invalid and thus we cannot find Generic\n}\n\nstatic class IEnumerableExtensions\n{\n    public static IEnumerable<T> ToEnumerable<T>(this T item)           // Noncompliant {{Move this extension method to the ObjectExtensions class.}}\n    {\n        yield return item;\n    }\n\n    public static IEnumerable<T> GenericExtension<T>(this IEnumerable<T> enumerable) => enumerable;\n\n    public static T ComplexConstrainedGeneric<T>(this T t) where T : class, IEnumerable => t;\n\n    public static T TwoConstrainedGeneric<T>(this T t) where T : class, IEnumerable, ICloneable => t;\n}\n\nstatic class ICloneableExtensions\n{\n    public static T TwoConstrainedGeneric<T>(this T t) where T : struct, IEnumerable, ICloneable => t;\n}\n\nstatic class NotClonableNorEnumerableExtensions\n{\n    public static T TwoConstrainedGeneric<T>(this T t) where T : class, IEnumerable, ICloneable => t;   // Noncompliant {{Move this extension method to the IEnumerableExtensions or ICloneableExtensions class.}}\n    public static T DifferentOrder<T>(this T t) where T : class, ICloneable, IEnumerable => t;          // Noncompliant {{Move this extension method to the ICloneableExtensions or IEnumerableExtensions class.}}\n}\n\nstatic class DictionaryExtensions\n{\n    public static Dictionary<T, U> GenericExtension<T, U>(this Dictionary<T, U> dictionary) => dictionary;\n}\n\nclass NotAnExtensionClass // Error [CS1106]\n{\n    public static int Int(this int nb) => nb;                // Noncompliant\n}\n\nclass IntExtensions // Error [CS1106]\n{\n    public static int Int(this int nb) => nb;                // Noncompliant - The class is not static\n}\n\nclass IntExtensions<T> // Error [CS1106]\n{\n    public static int Int(this int nb) => nb;                // Noncompliant - The class is not static\n}\n\nstatic class InvalidExtensions\n{\n    // Error@+1 [CS1103]\n    public static void Dynamic(this dynamic dynamic) { }     // Noncompliant {{Move this extension method to the dynamicExtensions class.}}\n\n    // Error@+1 [CS1103]\n    unsafe public static void Pointer(this int* pointer) { } // Noncompliant {{Move this extension method to the ObjectExtensions class.}}\n}\n\npublic class ExplodedNode { }\n\nstatic class ExplodedNodeExtensions\n{\n    public static void FromIEnumerable(this IEnumerable<ExplodedNode> nodes) { }                                // Compliant\n    public static void FromDictionaryValue(this Dictionary<string, ExplodedNode> map) { }                       // Compliant\n    public static void GenericFromKey<TValue>(this Dictionary<ExplodedNode, TValue> map) { }                    // Compliant\n    public static void GenericFromValue<TKey>(this Dictionary<TKey, ExplodedNode> map) { }                      // Compliant\n    public static void Nested(this IEnumerable<IList<IDictionary<string, ExplodedNode>>> convoluted) { }        // Compliant\n    public static void OtherType(this Action<ExplodedNode> action) { }                                          // Compliant\n}\n\nstatic class SomeOtherExtensions\n{\n    public static void FromIEnumerable(this IEnumerable<ExplodedNode> nodes) { }                                // Noncompliant {{Move this extension method to the IEnumerableExtensions or ExplodedNodeExtensions class.}}\n    public static void FromDictionaryValue(this Dictionary<string, ExplodedNode> map) { }                       // Noncompliant {{Move this extension method to the DictionaryExtensions, StringExtensions, or ExplodedNodeExtensions class.}}\n    public static void GenericFromKey<TValue>(this Dictionary<ExplodedNode, TValue> map) { }                    // Noncompliant {{Move this extension method to the DictionaryExtensions or ExplodedNodeExtensions class.}}\n    public static void GenericFromValue<TKey>(this Dictionary<TKey, ExplodedNode> map) { }                      // Noncompliant {{Move this extension method to the DictionaryExtensions or ExplodedNodeExtensions class.}}\n    public static void Nested(this IEnumerable<IList<IDictionary<string, ExplodedNode>>> convoluted) { }        // Noncompliant {{Move this extension method to the IEnumerableExtensions, IListExtensions, IDictionaryExtensions, StringExtensions, or ExplodedNodeExtensions class.}}\n    public static void DictionaryGenerics<TKey, TValue>(this Dictionary<TKey, TValue> map) { }                  // Noncompliant {{Move this extension method to the DictionaryExtensions class.}}\n    public static void OtherType(this Action<ExplodedNode> action) { }                                          // Noncompliant {{Move this extension method to the ActionExtensions or ExplodedNodeExtensions class.}}\n}\n\nstatic class ListExtensions\n{\n    public static void GenericList<T>(this List<T> items) { }                                                   // Compliant\n    public static void NestedGeneric<TK, TV>(this List<IList<IDictionary<TK, TV>>> convoluted) { }              // Compliant\n}\n\nstatic class GenericIntermediateTypeExtensions\n{\n\n    public static void NonGenericType(this GenericIntermediateType<ExplodedNode> nodes) { }                     // Compliant\n    public static void GenericType<T>(this GenericIntermediateType<T> generics) { }                             // Compliant\n    public static void NestedGeneric<T>(this List<GenericIntermediateType<T>> generics) { }                     // Compliant\n    public static void NestedNonGeneric<T>(this List<GenericIntermediateType<ExplodedNode>> generics) { }       // Compliant\n    public class GenericIntermediateType<T> { }\n}\n\nstatic class NoncompliantCSharp14Extensions\n{\n    extension(IEnumerable<ExplodedNode> nodes)\n    {\n        public void InstanceNoncompliant() { }   // Noncompliant {{Move this extension method to the IEnumerableExtensions or ExplodedNodeExtensions class.}}\n    }\n\n    extension(IEnumerable<ExplodedNode>)\n    {\n        public static void StaticNoncompliant() { } // Noncompliant {{Move this extension method to the IEnumerableExtensions or ExplodedNodeExtensions class.}}\n    }\n}\n\npublic class Compliant { }\n\nstatic class CompliantExtensions\n{\n    extension(IEnumerable<Compliant> nodes)\n    {\n        public void InstanceCompliant() { }   // Compliant\n    }\n\n    extension(IEnumerable<Compliant>)\n    {\n        public static void StaticCompliant() { } // Compliant\n    }\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/NullPatternMatching.cs",
    "content": "﻿using System;\nusing System.Linq.Expressions;\n\npublic class Sample\n{\n    public void Method(object o, int a, int b, object another)\n    {\n        if (o == null)  // Noncompliant {{Use 'is null' pattern matching.}}\n        //  ^^^^^^^^^\n        { }\n        if (a > b || (a < b && o == null))  // Noncompliant\n        //                     ^^^^^^^^^\n        { }\n\n        if (o != null)  // Noncompliant {{Use 'is not null' pattern matching.}}\n        //  ^^^^^^^^^\n        { }\n\n        _ = !(o == null);   // Noncompliant\n        //    ^^^^^^^^^\n        _ = !(o != null);   // Noncompliant\n        //    ^^^^^^^^^\n        _ = null == o;      // Noncompliant\n        _ = null != o;      // Noncompliant\n\n        _ = o is null;\n        _ = o is not null;\n        _ = o == \"null\";\n        _ = o != \"null\";\n        _ = o == this;\n        _ = o != this;\n        _ = o == another;\n        _ = o != another;\n        _ = o == Invocation();\n        _ = o != Invocation();\n\n        Use(o == null);     // Noncompliant\n        while (o == null)   // Noncompliant\n        { }\n\n        Use(o ==);  // Error [CS1525] Invalid expression term ';'\n        Use(== o);  // Error [CS1525] Invalid expression term '=='\n    }\n\n    private object Invocation() => null;\n\n    private void Use(bool b) { }\n\n    public void CustomOperator()\n    {\n        var s = new Sample();\n        if(s == null)   // Noncompliant\n        {\n            // This is always visited due to overriden operator => we don't care, it's a bad idea anyway\n        }\n    }\n\n    public void ExpressionTree(object x)\n    {\n        Func<bool> func1 = () => x == null; // Noncompliant\n        Func<bool> func2 = () => x is null;\n        Expression<Func<bool>> expression1 = () => x == null;\n        Expression<Func<bool>> expression2 = () => x != null;\n        Expression<Func<bool>> expression3 = () => x is null; // Error [CS8122]\n    }\n\n    public static bool operator ==(Sample a, Sample b) =>\n        b is null;\n\n    public static bool operator !=(Sample a, Sample b) =>\n        b is not null;\n}\n\npublic class IsPattern\n{\n    public void Method(object value, Exception ex)\n    {\n        _ = value is { };           // Noncompliant {{Use 'is not null' pattern matching.}}\n        //           ^^^\n        _ = ex is { Message: { } }; // Noncompliant {{Use 'is not null' pattern matching.}}\n        //                   ^^^\n    }\n\n    public void Compliant(object value, string str, Exception ex)\n    {\n        _ = value is null;\n        _ = value is not null;\n        _ = value is { } renamed;\n        _ = Value() is { } captured;\n        _ = value is Exception;\n        _ = value is Exception e;\n        _ = str is { Length: 0 };\n        _ = ex is { Message: { } message };\n    }\n\n    private object Value() => null;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/OperatorLocation.cs",
    "content": "﻿using System.Collections.Generic;\nusing System\n    .Collections\n    .Generic;\nusing System.       // Noncompliant\n    Collections.    // Noncompliant\n    Generic;\n\nclass MyClass\n{\n    void Compliant(int a, int b, int c, object o, List<int?> list)\n    {\n        _ = a + b;\n        _ =\n            a + b;\n        c +=\n            a - b;\n        c -=\n            a - b;\n        c *=\n            a - b;\n        c /=\n            a - b;\n        c %=\n            a - b;\n        o ??=\n            new\n                object();\n        c <<=\n            a - b;\n        c >>=\n            a - b;\n        c >>>=\n            a - b;\n        c |=\n            a - b;\n        c &=\n            a - b;\n        c ^=\n            a - b;\n\n        o.ToString\n            ();\n        _ = list?\n            [0];\n        _ = list!\n            [0];\n        _ = list[0]\n            .ToString();\n        _ = list?[0]?\n            .ToString();\n    }\n\n    void LogicalOperator(bool a, bool b)\n    {\n        _ = a && b;\n        _ = a &&    // Noncompliant {{The '&&' operator should not be at the end of the line.}}\n        //    ^^\n            b;\n        _ = a ||    // Noncompliant\n            b;\n        _ = a &     // Noncompliant\n            b;\n        _ = a |     // Noncompliant\n            b;\n        _ = a ^     // Noncompliant\n            b;\n\n        _ = a\n            &&      // Noncompliant\n            b;\n\n        _ = a &&    // Noncompliant\n            (b ||   // Noncompliant\n            a) &&   // Noncompliant\n            b;\n    }\n\n    void Ternary(bool a, bool b)\n    {\n        _ = a ? 1 : 2;\n        _ = a ? 1 :     // Noncompliant\n            2;\n        _ = a ?         // Noncompliant\n            1 :         // Noncompliant\n            2;\n\n        _ = a\n            &&  // Noncompliant\n            b\n            ?   // Noncompliant {{The '?' operator should not be at the end of the line.}}\n            1\n            :   // Noncompliant {{The ':' operator should not be at the end of the line.}}\n            2;\n    }\n\n    void Coelesce(object o1, object o2)\n    {\n        _ = o1 ?? o2;\n        _ = o1 ??   // Noncompliant\n            o2;\n        _ = o1 ??   // Noncompliant\n            o2;\n        _ = o1\n            ??      // Noncompliant\n            o2;\n\n        _ = o1?\n            .ToString();\n    }\n\n    void AsIs(object o)\n    {\n        _ = o as string;\n        _ = o as    // Noncompliant\n            string;\n        _ = o\n            as      // Noncompliant\n            string;\n        _ = o is string;\n        _ = o is    // Noncompliant\n            string;\n        _ = o\n            is      // Noncompliant\n            string;\n    }\n\n    void Pattern(object o1, object o2)\n    {\n        _ = o1 is int or float;\n        _ = o1 is                               // Noncompliant\n            int or float;\n        _ = o1 is int or                        // Noncompliant\n            float;\n\n        _ = o1 is string { Length: > 5 } and    // Noncompliant {{The 'and' operator should not be at the end of the line.}}\n            { Length: < 10 };\n\n        _ = o2 is string { Length: > 5 }\n            and                                 // Noncompliant\n            { Length: < 10 };\n    }\n\n    void Arithmetic(int a, int b, string str)\n    {\n        _ = a + b;\n        _ = a +             // Noncompliant\n            b;\n        _ = a\n            +               // Noncompliant\n            b;\n        _ = a - b;\n        _ = a -             // Noncompliant\n            b;\n        _ = a\n            -               // Noncompliant\n            b;\n        _ = a * b;\n        _ = a *             // Noncompliant\n            b;\n        _ = a\n            *               // Noncompliant\n            b;\n        _ = a / b;\n        _ = a /             // Noncompliant\n            b;\n        _ = a\n            /               // Noncompliant\n            b;\n        _ = a % b;\n        _ = a %             // Noncompliant\n            b;\n        _ = a\n            %               // Noncompliant\n            b;\n\n        _ = str + \" text \" + str;\n        _ = str +           // Noncompliant\n            \" text \" + str;\n        _ = str\n            + \" text \" +    // Noncompliant\n            str;\n    }\n\n    void Comparison(int a, int b)\n    {\n        _ = a == b;\n        _ = a ==    // Noncompliant\n            b;\n        _ = a\n            ==      // Noncompliant\n            b;\n        _ = a != b;\n        _ = a !=    // Noncompliant\n            b;\n        _ = a\n            !=      // Noncompliant\n            b;\n        _ = a < b;\n        _ = a <     // Noncompliant\n            b;\n        _ = a\n            <       // Noncompliant\n            b;\n        _ = a > b;\n        _ = a >     // Noncompliant\n            b;\n        _ = a\n            >       // Noncompliant\n            b;\n        _ = a <= b;\n        _ = a <=    // Noncompliant\n            b;\n        _ = a\n            <=      // Noncompliant\n            b;\n        _ = a >= b;\n        _ = a >=    // Noncompliant\n            b;\n        _ = a\n            >=      // Noncompliant\n            b;\n    }\n\n    void Shift(int a, int b)\n    {\n        _ = a << b;\n        _ = a <<    // Noncompliant\n            b;\n        _ = a\n            <<      // Noncompliant\n            b;\n        _ = a >> b;\n        _ = a >>    // Noncompliant\n            b;\n        _ = a\n            >>      // Noncompliant\n            b;\n        _ = a >>> b;\n        _ = a >>>   // Noncompliant\n            b;\n        _ = a\n            >>>     // Noncompliant\n            b;\n    }\n\n    // Covered by SA1003\n    void Unary(int a, bool b)\n    {\n        _ = a++\n            + 1;\n        _ = +a;\n        _ = +\n            a;\n        _ = -a;\n        _ = -\n            a;\n        _ = ~a;\n        _ = ~\n            a;\n        _ = ++a;\n        _ = ++\n            a;\n        _ = --a;\n        _ = --\n            a;\n        _ = a++;\n        _ = !b;\n        _ = !\n            b;\n        _ = ^a;\n        _ = ^\n            a;\n\n        unsafe\n        {\n            _ = &a;\n            _ = &\n                a;\n            int *p = &a;\n            _ = *p;\n            _ = *\n                p;\n        }\n    }\n\n    void Range()\n    {\n        _ = 1..2;\n        _ = 1\n            ..2;\n        _ = 1.. // Noncompliant\n            2;\n        _ = 1\n            .. // Noncompliant\n            2;\n    }\n\n    void MemberAccess(object o)\n    {\n        _ = o.ToString();\n        _ = o\n            .ToString();\n        _ = o.              // Noncompliant\n            ToString();\n        _ = o?.ToString().ToString();\n        _ = o?\n            .ToString()!\n            .ToString();\n        _ = o!\n            .ToString()?\n            .ToString();\n        _ = o?.             // Noncompliant {{The '.' operator should not be at the end of the line.}}\n        //    ^\n            ToString()?.    // Noncompliant\n            ToString();\n        _ = o!.             // Noncompliant\n            ToString()!.    // Noncompliant\n            ToString();\n\n        o?\n            .               // Noncompliant\n            ToString();\n        o!\n            .               // Noncompliant\n            ToString();\n    }\n\n    void QualifiedName()\n    {\n        System.Console.BackgroundColor = System.ConsoleColor.Yellow;\n        System\n            .Console\n            .BackgroundColor = System\n                .ConsoleColor\n                .Yellow;\n        System.                         // Noncompliant\n            Console.                    // Noncompliant\n            BackgroundColor = System.   // Noncompliant\n                ConsoleColor.           // Noncompliant\n                Yellow;\n\n    }\n}\n\nnamespace MyNamespace.With.Some.Dots { }\nnamespace MyNamespace\n    .With\n    .Some\n    .Dots { }\nnamespace MyNamespace.  // FN, Roslyn doesn't call us back in this case => we don't care\n    With.               // FN, Roslyn doesn't call us back in this case => we don't care\n    Some.               // Noncompliant\n    Dots { }\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/PropertyOrdering.cs",
    "content": "﻿public class AllValid\n{\n    public static int S1 { get; }\n    public static int S2 => 42;\n    public static int S3\n    {\n        get => 42;\n    }\n    public int I1 { get; }\n    public int I2 => 42;\n    public int I3\n    {\n        get => 42;\n    }\n\n    internal static int InternalS { get; }      // Compliant\n    internal int InternalI { get; }\n\n    protected static int ProtectedS { get; }    // Compliant\n    protected int ProtectedI { get; }\n\n    private static int PrivateS { get; }        // Compliant\n    private int PrivateI { get; }\n}\n\npublic class SomeValid\n{\n    public static int S1 => 42;\n    public int I1 => 42;\n    public int I2 => 42;\n    public static int S2 => 42;  // Noncompliant {{Move this static property above the public instance ones.}}\n    //                ^^\n    public int I3 => 42;\n\n    // Compliant, there're no other private/protected/internal instance fields above\n    internal static int InternalS { get; }\n    protected static int ProtectedS { get; }\n    protected internal static int ProtectedInternalS { get; }\n    protected private static int ProtectedPrivateS { get; }\n    private static int PrivateS { get; }\n}\n\npublic class ProtectedInternal\n{\n    protected internal int ProtectedI { get; }\n    protected static int ProtectedS { get; }    // Noncompliant {{Move this static property above the protected instance ones.}}\n}\n\npublic class ProtectedPrivate\n{\n    protected private int ProtectedI { get; }\n    protected static int ProtectedS { get; }    // Noncompliant {{Move this static property above the protected instance ones.}}\n}\n\npublic class AllWrong\n{\n    public int I1 { get; }\n    public int I2 => 42;\n    public int I3\n    {\n        get => 42;\n    }\n    internal int InternalI { get; }\n    protected int ProtectedI { get; }\n    private int PrivateI { get; }\n\n    public static int S1 { get; }   // Noncompliant {{Move this static property above the public instance ones.}}\n    public static int S2 => 42;     // Noncompliant\n    public static int S3            // Noncompliant\n    {\n        get => 42;\n    }\n\n    internal static int InternalS { get; }      // Noncompliant {{Move this static property above the internal instance ones.}}\n    private static int PrivateS { get; }        // Noncompliant {{Move this static property above the private instance ones.}}\n    protected static int ProtectedS { get; }    // Noncompliant {{Move this static property above the protected instance ones.}}\n}\n\npublic record R\n{\n    public int I => 42;\n    public static int S => 42;   // Noncompliant\n\n}\n\npublic record struct RS\n{\n    public int I => 42;\n    public static int S => 42;   // Noncompliant\n}\n\npublic struct Str\n{\n    public int I => 42;\n    public static int S => 42;   // Noncompliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/ProtectedFieldsCase.cs",
    "content": "﻿\npublic class Sample\n{\n    public int PublicField;\n    private int PrivateField;\n    internal int InternalField;\n    file int FileField; // Error [CS0106]\n    protected const int ConstProtectedField = 42;\n\n    abstract protected readonly int AbstractReadonlyProtectedField; // Error [CS0681]\n    protected readonly int ReadonlyProtectedField;              // Noncompliant\n\n    protected readonly int ReadonlyProtectedField1, ReadonlyProtectedField2, ReadonlyProtectedField3;\n    //                     ^^^^^^^^^^^^^^^^^^^^^^^                                                      Noncompliant\n    //                                              ^^^^^^^^^^^^^^^^^^^^^^^                             Noncompliant@-1\n    //                                                                       ^^^^^^^^^^^^^^^^^^^^^^^    Noncompliant@-2\n\n    protected int ProtectedField;                               // Raise by SA1306\n    private protected int PrivateProtectedField;                // Raise by SA1306\n    protected static int StaticProtectedField;                  // Raise by SA1306\n    private protected static int StaticPrivateProtectedField;   // Raise by SA1306\n    protected int MultipleProtectedField1, MultipleProtectedField2, MultipleProtectedField3; // Raise by SA1306\n\n    protected static readonly int StaticReadonlyProtectedField; // Conflict with SA1311\n    protected internal int ProtectedInternalField;              // Conflict with SA1307\n    protected internal static int StaticProtectedInternalField; // Conflict with SA1307\n\n    public int publicField;\n    private int privateField;\n    internal int internalField;\n    file int fileField; // Error [CS0106]\n    protected int protectedField;\n    protected int multipleProtectedField1, multipleProtectedField2, multipleProtectedField3;\n    protected internal int protectedInternalField;\n    private protected int privateProtectedField;\n    protected static int staticProtectedField;\n    protected readonly int readonlyProtectedField;\n    protected static readonly int staticReadonlyProtectedField;\n    protected internal static int staticProtectedInternalField;\n    private protected static int staticPrivateProtectedField;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/SeparateDeclarations.cs",
    "content": "﻿using System;\n\nnamespace NS\n{\n    public class PrecededByParenthesis() { }    // Compliant\n    public class Adjacent { }                   // Noncompliant {{Add an empty line before this declaration.}}\n//  ^^^^^^\n}\nnamespace AdjacentNS { }                        // Noncompliant\n\npublic abstract class CompliantClassFull\n{\n    private const string Constant1 = \"C1\";\n    private const string Constant2 = \"C2\";\n\n    public enum Enum1\n    {\n        None,\n        All\n    }\n\n    public enum Enum2\n    {\n        None,\n        All\n    }\n\n    private enum Enum3 { None, Any, All }\n\n    private readonly object field1 = new();\n    private static readonly object field2 = new();\n    private readonly object field3 = new();\n    private readonly object field4, field5;\n\n    public abstract int AbstractMethod1();\n    public abstract int AbstractProperty1 { get; }\n    public abstract int AbstractMethod2();\n    public abstract int AbstractProperty2 { get; }\n\n    delegate void SomeDelegate1();\n    delegate void SomeDelegate2();\n\n    public event EventHandler SomeEvent1;\n    public event EventHandler SomeEvent2;\n\n    public object Property1 { get; } = 42;\n    public object Property2 => 42;\n    public object Property3 => 43;\n    public object Property4 { get => 42; }\n    public object Property5 { get; set; }\n    public object Property6 { get; set; }\n\n    public object this[int index] => 42;\n    public object this[bool value] => 42;\n\n    public object this[string name]\n    {\n        get => 42;\n    }\n\n    public CompliantClassFull() { }\n\n    private CompliantClassFull(int arg) { }\n\n    ~CompliantClassFull() { }\n\n    private void Method1() { }\n\n    public void Method2() { }\n\n    public static int operator +(CompliantClassFull a, CompliantClassFull b) => 42;\n\n    public static int operator -(CompliantClassFull a, CompliantClassFull b) => 42;\n\n    public static implicit operator int(CompliantClassFull a) => 42;\n\n    public static explicit operator CompliantClassFull(int a) => null;\n\n    public class Nested1 { }\n\n    private struct Nested2 { }\n\n    public record Nested3 { }\n\n    protected record struct Nested4 { }\n\n    public record Nested5 { }\n\n    public struct Nested6 { }\n\n    public class Nested7 { }\n}\n\npublic abstract class AllWrong\n{\n    private const string Constant1 = \"C1\";\n    private const string Constant2 = \"C2\";\n    public enum Enum1   // Noncompliant\n    {\n        None,\n        All\n    }\n    private enum Enum2  // Noncompliant\n    {\n        None,\n        Any,\n        All\n    }\n    private enum Enum3 {  None } // Noncompliant\n    private readonly object field1 = new();         // Noncompliant\n    private static readonly object field2 = new();\n    private readonly object field3 = new();\n    private readonly object field4, field5;\n    public abstract int AbstractMethod1();          // FN\n    public abstract int AbstractProperty1 { get; }\n    delegate void SomeDelegate1();                  // Noncompliant\n    delegate void SomeDelegate2();\n    public event EventHandler SomeEvent1;           // Noncompliant\n    public event EventHandler SomeEvent2;\n    public object Property1 { get; } = 42;          // Noncompliant\n    public object Property2 => 42;\n    public object Property3 { get => 42; }\n    public object this[int index] => 42;            // Noncompliant\n    public object this[bool value] => 42;\n    public object this[string name]                 // Noncompliant\n    {\n        get => 42;\n    }\n    public AllWrong() { }           // Noncompliant\n    private AllWrong(int arg) { }   // Noncompliant\n    ~AllWrong() { }                 // Noncompliant\n    private void Method1() { }      // Noncompliant\n    public void Method2() { }       // Noncompliant\n    public static int operator +(AllWrong a, AllWrong b) => 42; // Noncompliant\n    public static int operator -(AllWrong a, AllWrong b) => 42; // Noncompliant\n    public static implicit operator int(AllWrong a) => 42;                // Noncompliant\n    public static explicit operator AllWrong(int a) => null;              // Noncompliant\n    public class Nested1 { }                // Noncompliant\n    private struct Nested2 { }              // Noncompliant\n    public record Nested3 { }               // Noncompliant\n    protected record struct Nested4 { }     // Noncompliant\n}\n\npublic class Comments\n{\n    public class Compliant { }\n\n    // This is fine\n    public class CompliantSingleSingleLine { }\n    // Missplaced comment\n\n    // This is not fine, but it is compliant\n    public class CompliantTwoSeparatedSingleLine { }\n\n    /*\n     * Fine for multiline\n     */\n    public class CompliantSingleMultiLine1 { }\n\n    /* And multiline on a single line */\n    public class CompliantSingleMultiLine2 { }\n\n    /* And multiline on a single line */\n    /* Alaso if there are multiple */\n    public class CompliantMultipleMultiLine { }\n\n    /// <summary>\n    /// Documentation is fine\n    /// </summary>\n    public class CompliantDocumentation { }\n\n    /// <summary>\n    /// This is broken, but still compliant\n\n    /// </summary>\n    public class CompliantDocumentationInterrupted { }\n\n    /**\n      * <summary>\n      * There still should be an empty line before the documentation block\n      * </summary>\n      */\n    public class CompliantMultilineDocumentation { }\n\n    public class ProblemsStartBelowThisLine { }\n    // There still should be empty line before the comment\n    public class SingleSingleLine { }       // Noncompliant@-1\n    // There still should be empty line before the comment\n    // Also if there are multiple\n    public class MultipleSingleLine { }     // Noncompliant@-2\n    /*\n     * Fine for multiline\n     */\n    public class SingleMultiLine1 { }       // Noncompliant@-3\n    /* And multiline on a single line */\n    public class SingleMultiLine2 { }       // Noncompliant@-1\n    /* And multiline on a single line */\n    /* Alaso if there are multiple */\n    public class MultipleMultiLine { }      // Noncompliant@-2\n    /// <summary>\n    /// There still should be an empty line before the documentation block\n    /// </summary>\n    public class Documentation { }          // Noncompliant@-3\n    /// <summary>\n    /// There still should be an empty line before the documentation block, not inside\n\n    /// </summary>\n    public class InterruptedDocumentation { }   // Noncompliant@-4\n    /**\n      * <summary>\n      * There still should be an empty line before the documentation block\n      * </summary>\n      */\n    public class MultilineDocumentation { } // Noncompliant@-5\n}\n\npublic class MultiLines\n{\n    private int singleLineField1;\n    private int multiLineField1 =   // Noncompliant\n        1 + 1;\n    private int singleLineField2;\n\n    private int multiLineField2 =\n        1 + 1;\n\n    private int singleLineField3;\n\n    public int SingleLineProperty1 => 42;\n    public int MultiLineProperty1               // Noncompliant\n    {\n        get => 42;\n    }\n    public int SingleLineProperty2 => 42;       // Noncompliant\n\n    public int MultiLineProperty2\n    {\n        get => 42;\n    }\n\n    public int SingleLineProperty3 => 42;\n\n    public event EventHandler SingleLineEvent1;\n    public event EventHandler MultiLineEvent1       // Noncompliant\n    {\n        add { }\n        remove { }\n    }\n    public event EventHandler SingleLineEvent2;     // Noncompliant\n\n    public event EventHandler MultiLineEvent2\n    {\n        add { }\n        remove { }\n    }\n\n    public event EventHandler SingleLineEvent3;\n\n    public object this[int index] => 42;\n    public object this[string name]                 // Noncompliant\n    {\n        get => 42;\n    }\n    public object this[bool condition] => 42;       // Noncompliant\n\n    public object this[double value]\n    {\n        get => 42;\n    }\n\n    public object this[decimal value] => 42;\n}\n\npublic interface ISomething\n{\n    void SayHello();    // All compliant\n    int Property { get; }\n    int DoSomething();\n    int MultiLineProperty\n    {\n        get;\n        set;\n    }\n    void DoNothing();\n    void DoNothingAtAll();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/TernaryLine.cs",
    "content": "﻿\npublic class Sample\n{\n    private bool condition;\n    private object trueBranch, falseBranch;\n\n    public void Method()\n    {\n        _ = condition\n            && condition ? trueBranch : falseBranch;\n        //               ^^^^^^^^^^^^                   Noncompliant    {{Place branches of the multiline ternary on a separate line.}}\n        //                            ^^^^^^^^^^^^^     Noncompliant@-1 {{Place branches of the multiline ternary on a separate line.}}\n\n        _ = condition\n            ? trueBranch : falseBranch;     // Noncompliant\n        //               ^^^^^^^^^^^^^\n\n        _ = condition ? trueBranch          // Noncompliant\n        //            ^^^^^^^^^^^^\n            : falseBranch;\n\n        _ = condition ? trueBranch          // Noncompliant\n                .ToString()\n            : falseBranch;\n\n        _ = condition ? trueBranch : falseBranch;\n        _ = condition\n                ? trueBranch\n                : falseBranch;\n        _ = condition\n            && condition\n                ? trueBranch\n                : falseBranch;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/TypeMemberOrdering.cs",
    "content": "﻿\nusing System;\n\npublic class CompliantClassSmall\n{\n    private const string Constant = \"C\";\n\n    private static readonly object field = new();\n\n    public object Property { get; }\n\n    public void Method() { }\n}\n\npublic abstract class CompliantClassFull\n{\n    private const string Constant1 = \"C1\";\n    private const string Constant2 = \"C2\";\n\n    public enum Enum1\n    {\n        None,\n        All\n    }\n\n    private enum Enum2\n    {\n        None,\n        Any,\n        All\n    }\n\n    private readonly object field1 = new();\n    private static readonly object field2 = new();\n    private readonly object field3 = new();\n    private readonly object field4, field5;\n\n    public abstract int AbstractMethod1();\n    public abstract int AbstractProperty1 { get; }\n    public abstract int AbstractMethod2();\n    public abstract int AbstractProperty2 { get; }\n\n    delegate void SomeDelegate1();\n    delegate void SomeDelegate2();\n\n    public event EventHandler SomeEvent1;\n    public event EventHandler SomeEvent2;\n\n    public object Property1 { get; } = 42;\n    public object Property2 => 42;\n    public object Property3 { get => 42; }\n\n    public object this[int index] => 42;\n    public object this[string name]\n    {\n        get => 42;\n    }\n\n    public CompliantClassFull() { }\n    private CompliantClassFull(int arg) { }\n\n    ~CompliantClassFull() { }\n\n    private void Method1() { }      // Compliant, this rule doesn't care about accessibility ordering\n    public void Method2() { }\n\n    public static int operator +(CompliantClassFull a, CompliantClassFull b) => 42;\n    public static int operator -(CompliantClassFull a, CompliantClassFull b) => 42;\n    public static implicit operator int(CompliantClassFull a) => 42;\n    public static explicit operator CompliantClassFull(int a) => null;\n\n    public class Nested1 { }        // Relative order of these types is not important\n    private struct Nested2 { }\n    public record Nested3 { }\n    protected record struct Nested4 { }\n    public record Nested5 { }\n    public struct Nested6 { }\n    public class Nested7 { }\n}\n\npublic class WhenMemberShouldBeFirst\n{\n    public WhenMemberShouldBeFirst() { }    // Secondary [First] {{Move the declaration before this one.}}\n\n    public void Method() { }\n\n    private readonly object field;          // Noncompliant [First] {{Move Fields before Constructors.}}\n\n    public class Nested { }\n}\n\npublic class WhenMemberShouldBeLast\n{\n    private readonly object field;\n\n    public class Nested { }                 // Secondary [Last2] {{Move the declaration before this one.}}\n\n    public WhenMemberShouldBeLast() { }     // Noncompliant [Last1] {{Move Constructors after Fields, before Methods.}}\n\n                                            // Secondary@+1 [Last1]\n    public void Method() { }                // Noncompliant [Last2] {{Move Methods after Constructors, before Nested Types.}}\n}\n\npublic class WhenMembersAreSwapped\n{\n    private readonly object field;\n\n    public void Method() { }            // Secondary [Swapped1] {{Move the declaration before this one.}}\n\n    public WhenMembersAreSwapped() { }  // Noncompliant [Swapped1] {{Move Constructors after Fields, before Methods.}}\n\n    public class Nested { }\n}\n\npublic class WhenLessMembersAreSwapped\n{\n    private const string constant = \"C\";\n\n    public void Method1() { }               // Secondary [Swapped2] {{Move the declaration before this one.}}\n    public void Method2() { }\n\n    // Only this one is out of place\n    public WhenLessMembersAreSwapped() { }  // Noncompliant [Swapped2] {{Move Constructors after Constants, before Methods.}}\n    //     ^^^^^^^^^^^^^^^^^^^^^^^^^\n\n    public class Nested { }\n}\n\npublic class InterleavedViolations\n{\n    private int field1;\n    public int Property1 { get; set; }  // Secondary    [Interleaved1, Interleaved3]\n    private int field2;                 // Noncompliant [Interleaved1] {{Move Fields before Properties.}}\n    void Method1() { }                  // Secondary    [Interleaved2, Interleaved4]\n    public int Property2 { get; set; }  // Noncompliant [Interleaved2] {{Move Properties after Fields, before Methods.}}\n    void Method2() { }\n    private int field3;                 // Noncompliant [Interleaved3] {{Move Fields before Properties.}}\n    void Method3() { }\n    public int Property3 { get; set; }  // Noncompliant [Interleaved4] {{Move Properties after Fields, before Methods.}}\n}\n\npublic abstract class AllWrong\n{\n    public class Nested { }     // Secondary [AllWrongOperator1, AllWrongOperator2, AllWrongOperator3, AllWrongOperator4]\n\n                                // Secondary@+1 [AllWrongDestructor]\n    public void Method() { }    // Noncompliant [AllWrongMethod1] {{Move Methods after Destructor, before Operators.}}\n    //          ^^^^^^\n\n    public void Method2() { }   // Noncompliant [AllWrongMethod2] {{Move Methods after Destructor, before Operators.}}\n                                                                // Secondary@+1 [AllWrongMethod1, AllWrongMethod2] This is not very useful, because it's already where it should be. \"After\" part would be more helpful.\n    public static int operator +(AllWrong a, AllWrong b) => 42; // Noncompliant [AllWrongOperator1] {{Move Operators after Methods, before Nested Types.}}\n    //                         ^\n    public static int operator -(AllWrong a, AllWrong b) => 42; // Noncompliant [AllWrongOperator2] {{Move Operators after Methods, before Nested Types.}}\n    public static implicit operator int(AllWrong a) => 42;      // Noncompliant [AllWrongOperator3] {{Move Operators after Methods, before Nested Types.}}\n    public static explicit operator AllWrong(int a) => null;    // Noncompliant [AllWrongOperator4] {{Move Operators after Methods, before Nested Types.}}\n    //                              ^^^^^^^^\n\n                                                // Secondary@+1 [AllWrongConstructor]\n    ~AllWrong() { }                             // Noncompliant [AllWrongDestructor]    {{Move Destructor after Constructors, before Methods.}}\n//   ^^^^^^^^\n\n    // Secondary@+1 [AllWrongIndexer]\n    public AllWrong() { }                       // Noncompliant [AllWrongConstructor]   {{Move Constructors after Indexers, before Destructor.}}\n    //     ^^^^^^^^\n\n                                                // Secondary@+1 [AllWrongField1, AllWrongField2]\n    public abstract int Abstract();             // Noncompliant [AllWrongAbstract]      {{Move Abstract Members after Fields, before Properties.}}\n    //                  ^^^^^^^^\n                                                // Secondary@+1 [AllWrongProperty]\n    public object this[int index] => 42;        // Noncompliant [AllWrongIndexer]       {{Move Indexers after Properties, before Constructors.}}\n    //            ^^^^\n\n                                                // Secondary@+1 [AllWrongAbstract]\n    public object Property { get; }             // Noncompliant [AllWrongProperty]      {{Move Properties after Abstract Members, before Indexers.}}\n    //            ^^^^^^^^\n\n                                                // Secondary@+1 [AllWrongEnum]\n    private readonly object field1 = new();     // Noncompliant [AllWrongField1]        {{Move Fields after Enums, before Abstract Members.}}\n    //               ^^^^^^^^^^^^^^^^^^^^^\n\n    private readonly object field2, field3;     // Noncompliant [AllWrongField2]        {{Move Fields after Enums, before Abstract Members.}}\n    //               ^^^^^^^^^^^^^^^^^^^^^\n\n                                                // Secondary@+1 [AllWrongConst]\n    public enum Enum { None, All }              // Noncompliant [AllWrongEnum]          {{Move Enums after Constants, before Fields.}}\n    //          ^^^^\n\n    private const string Constant = \"C\", Answer = \"42\";   // Noncompliant [AllWrongConst] {{Move Constants before Enums.}}\n    //            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n}\n\npublic record R (string Name)\n{\n    public void DoNothing() { } // Secondary [R]\n    public int field;           // Noncompliant [R] {{Move Fields before Methods.}}\n}\n\npublic struct S\n{\n    public void DoNothing() { } // Secondary [S]\n    public int field;           // Noncompliant [S] {{Move Fields before Methods.}}\n}\n\npublic record struct RS\n{\n    public void DoNothing() { } // Secondary [RS]\n    public int field;           // Noncompliant [RS] {{Move Fields before Methods.}}\n}\n\npublic interface ISomething\n{\n    public void DoNothing();    // Secondary [ISomething]\n    public int Value { get; }   // Noncompliant [ISomething] {{Move Properties before Methods.}}\n}\n\npublic class AbstractClassValid\n{\n    public void Go() { }\n\n    protected class NestedClassBefore();\n    protected abstract class NestedAbstract { }     // Compliant, classes should be at the end, even when abstract\n    protected class NestedClassAfter();\n}\n\npublic class AbstractClassWrong\n{\n    protected abstract class Nested { } // Secondary    [AbstractClass]\n\n    public void Go() { }                // Noncompliant [AbstractClass]\n}\n\npublic static class ExtensionBlockCompliant\n{\n    extension(string s)\n    {\n        public int Property => 0;\n\n        public void Method() { }\n    }\n}\n\npublic static class ExtensionBlockWrong\n{\n    extension(string s)\n    {\n        public void Method() { }       // Secondary    [ExtBlock]\n        public int Property => 0;      // Noncompliant [ExtBlock] {{Move Properties before Methods.}}\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/UseDifferentMember.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nusing Microsoft.CodeAnalysis;\n\ninternal class UseIsExtension\n{\n    public void Test(IMethodSymbol methodSymbol)\n    {\n        _ = methodSymbol.IsExtensionMethod;                                 // Noncompliant {{Use 'IsExtension' instead of 'IsExtensionMethod'. It also covers extension methods defined in extension blocks.}}\n        IsExtensionMethod();                                                // Compliant\n        _ = new Inner().IsExtensionMethod;                                  // Compliant\n        _ = methodSymbol is { IsExtensionMethod: true };                    // Noncompliant\n        _ = methodSymbol is { OriginalDefinition.IsExtensionMethod: true }; // Noncompliant\n        //                                       ^^^^^^^^^^^^^^^^^\n        _ = methodSymbol is { OriginalDefinition.IsExtension: true };       // Compliant\n    }\n\n    private void IsExtensionMethod()\n    {\n        throw new NotImplementedException();\n    }\n\n    class Inner\n    {\n        public bool IsExtensionMethod => true;\n    }\n}\n\npublic static class IMethodSymbolExtensions\n{\n    extension(IMethodSymbol methodSymbol)\n    {\n        public bool IsExtension => true;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/UseField.cs",
    "content": "﻿public class Sample\n{\n    private int field;\n\n    private int Private { get; set; }                       // Noncompliant {{Use field instead of this private auto-property.}}\n//  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    protected int Protected { get; set; }                   // Noncompliant {{Use field instead of this protected auto-property.}}\n    protected static int ProtectedStatic { get; set; }      // Noncompliant {{Use field instead of this protected auto-property.}}\n    private protected int PrivateProtected { get; set; }    // Noncompliant {{Use field instead of this private protected auto-property.}}\n    private int PrivateReadOnly { get; }                    // Noncompliant\n    protected int ProtectedReadOnly { get; }                // Noncompliant\n    protected static int ProtectedStaticReadOnly { get; }   // Noncompliant\n    private protected int PrivateProtectedReadOnly { get; } // Noncompliant\n\n    // Compliant\n    public int Public { get; set; }\n    internal int Internal { get; set; }\n    internal protected int InternalProtected { get; set; }\n    protected virtual int ProtectedVirtual { get; set; }\n\n    private int WithArrow\n    {\n        get => field;\n        set => field = value;\n    }\n\n    private int WithBody\n    {\n        get\n        {\n            return field;\n        }\n        set\n        {\n            field = value;\n        }\n    }\n}\n\npublic abstract class Abstract\n{\n    protected abstract bool IsAbstract { get; set; }\n}\n\npublic abstract class Override : Abstract\n{\n    protected override bool IsAbstract { get; set; }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/UseInnermostRegistrationContext.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing SonarAnalyzer.Core.AnalysisContext;\n\nclass UseInnermostRegistrationContext\n{\n    void SonarAnalysisContext(SonarAnalysisContext context) =>\n        context.RegisterCompilationStartAction(compilationStart => context.RegisterTreeAction(null, treeAction => { })); // Noncompliant {{Use inner-most registration context 'compilationStart' instead of 'context'.}}\n        //                                                         ^^^^^^^\n\n    void SonarCompilationStartAnalysisContext(SonarCompilationStartAnalysisContext compilationStart) =>\n        compilationStart.RegisterTreeAction(null, tree => _ = compilationStart.Cancel); // Noncompliant {{Use inner-most registration context 'tree' instead of 'compilationStart'.}}\n        //                                                    ^^^^^^^^^^^^^^^^\n\n    void SonarCodeBlockStartAnalysisContext(SonarCodeBlockStartAnalysisContext<SyntaxKind> sonarCodeBlockStart) =>\n        sonarCodeBlockStart.RegisterCodeBlockEndAction(end => _ = sonarCodeBlockStart.CodeBlock); // Noncompliant {{Use inner-most registration context 'end' instead of 'sonarCodeBlockStart'.}}\n\n    void SonarSymbolStartAnalysisContext(SonarSymbolStartAnalysisContext symbolStart) =>\n        symbolStart.RegisterSymbolEndAction(end => _ = symbolStart.Symbol); // Noncompliant {{Use inner-most registration context 'end' instead of 'symbolStart'.}}\n\n    void SonarParametrizedAnalysisContext(SonarParametrizedAnalysisContext context) =>\n        context.RegisterCompilationStartAction(compilationStart => context.RegisterTreeAction(null, treeAction => { })); // Noncompliant {{Use inner-most registration context 'compilationStart' instead of 'context'.}}\n\n    void NestedAndDuplicated(SonarAnalysisContext context)\n    {\n        context.RegisterCompilationStartAction(compilationStart =>\n        {\n            context.RegisterCompilationStartAction(innerCompilationStart => { }); // Noncompliant\n            _ = compilationStart.Cancel;                                          // Compliant\n            compilationStart.RegisterTreeAction(null, treeAction =>\n            {\n                context.RegisterTreeAction(null, innerTreeAction => { });         // Noncompliant {{Use inner-most registration context 'treeAction' instead of 'context'.}}\n                _ = compilationStart.Cancel;                                      // Noncompliant\n                _ = treeAction.Cancel;                                            // Compliant\n            });\n            compilationStart.RegisterCompilationEndAction(end =>\n            {\n                compilationStart.RegisterCompilationEndAction(innerEnd => { });   // Noncompliant {{Use inner-most registration context 'end' instead of 'compilationStart'.}}\n                _ = compilationStart.Cancel;                                      // Noncompliant\n                _ = end.Cancel;                                                   // Compliant\n            });\n            compilationStart.RegisterSymbolStartAction(symbolStart => symbolStart.RegisterCodeBlockStartAction<SyntaxKind>(codeBlockStart => codeBlockStart.RegisterNodeAction(node =>\n            {\n                context.RegisterTreeAction(null, _ => { });                       // Noncompliant {{Use inner-most registration context 'node' instead of 'context'.}}\n                _ = compilationStart.Cancel;                                      // Noncompliant {{Use inner-most registration context 'node' instead of 'compilationStart'.}}\n                _ = symbolStart.Cancel;                                           // Noncompliant {{Use inner-most registration context 'node' instead of 'symbolStart'.}}\n                _ = codeBlockStart.Cancel;                                        // Noncompliant {{Use inner-most registration context 'node' instead of 'codeBlockStart'.}}\n                _ = node.Cancel;                                                  // Compliant\n            })), SymbolKind.NamedType);\n        });\n    }\n\n    void TwoContextInOutterScope(SonarAnalysisContext context, SonarCompilationStartAnalysisContext compilationStart, int p)\n    {\n        context.RegisterCompilationStartAction(innerCompilationStart => { });                             // Compliant\n        _ = compilationStart.Cancel;                                                                      // Compliant\n        context.RegisterCompilationStartAction(_ => context.RegisterTreeAction(null, treeAction => { })); // Noncompliant {{Use inner-most registration context '_' instead of 'context'.}}\n        compilationStart.RegisterTreeAction(null, _ =>\n        {\n            context.RegisterTreeAction(null, _ => { });                                                   // Noncompliant {{Use inner-most registration context '_' instead of 'context'.}}\n            var c1 = compilationStart.Cancel;                                                             // Noncompliant\n            var c2 = _.Cancel;                                                                            // Compliant\n        });\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/UseLinqExtensions.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\n\npublic class Sample\n{\n    public IEnumerable<int> Query(IEnumerable<string> list) =>\n        from x in list      // Noncompliant {{Use IEnumerable extensions instead of the query syntax.}}\n        where x != \"test\"\n        select x.Length;\n\n    public IEnumerable<int> Extensions(IEnumerable<string> list) =>\n        list.Where(x => x != \"test\").Select(x => x.Length);\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/UseNullInsteadOfDefault.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nclass UseNullInsteadOfDefault\n{\n    void Method()\n    {\n        _ = default;                                                // Error [CS8716]\n        var discarded = default;                                    // Error [CS8716]\n        int integer = default;\n        int x = default, y = 0, z = default(int);\n        var integer2 = default(Int32);\n        object objectReference = default;                           // Noncompliant {{Use 'null' instead of 'default' for reference types.}}\n        //                       ^^^^^^^\n        var objectReference2 = default(object);                     // Noncompliant {{Use 'null' instead of 'default' for reference types.}}\n        //                     ^^^^^^^^^^^^^^^\n        object obj1 = default, obj2 = null, obj3 = default(object);\n        //            ^^^^^^^\n        //                                         ^^^^^^^^^^^^^^^@-1\n        IEnumerable<string> collection = null;\n        IEnumerable<string> collection2 = default;                  // Noncompliant\n        IEnumerable<string> collection3 = true ? null : default;    // Noncompliant\n        collection = null;\n        collection2 = default;                                      // Noncompliant\n        collection2 = true ? null : default;                        // Noncompliant\n\n        _ = default(object) is null;                                // Noncompliant FP - Do we care?\n        _ = collection is default(IEnumerable<string>);             // Noncompliant\n\n\n        int? nullableInt = default;                                 // Noncompliant\n\n        _ = collection == default;                                  // Noncompliant\n\n        Use(null);\n        Use(default);                                               // Noncompliant\n\n        switch (collection)\n        {\n            case default(IEnumerable<string>):                      // Noncompliant\n                break;\n            default:\n                break;\n        }\n\n        switch (integer)\n        {\n            case default(int):\n                break;\n            default:\n                break;\n        }\n    }\n\n    void Use(string s) { }\n    void OptionalWithNull(string name = null) { }\n    void OptionalWithDefault(string name = default) { }             // Noncompliant\n    void OptionalWithNull(int? name = null) { }\n    void OptionalWithDefault(int name = default) { }\n    void OptionalWithDefault(int? name = default) { }               // Noncompliant\n\n    void GenericMethod<T>()\n    {\n        T t = default;\n        var t2 = default(T);\n        T? t3 = default;\n        T? t4 = default(T);\n\n        t = default;\n        t = default(T);\n        t3 = default;\n        t3 = default(T);\n\n        _ = t == default;           // Error [CS8761]\n        _ = t3 == default;          // Error [CS8761]\n        _ = t is default(T);        // Error [CS0150]\n        _ = t3 is default(T);       // Error [CS0150]\n\n        switch (t)\n        {\n            case default(T):        // Error [CS0150]\n                break;\n            default:\n                break;\n        }\n\n        switch (t3)\n        {\n            case default(T):        // Error [CS0150]\n                break;\n            default:\n                break;\n        }\n    }\n\n    void GenericMethodClassConstraint<T>()\n        where T : class\n    {\n        T t = default;              // Noncompliant\n        var t2 = default(T);        // Noncompliant\n        T? t3 = default;            // Noncompliant\n        T? t4 = default(T);         // Noncompliant\n\n        t = default;                // Noncompliant\n        t = default(T);             // Noncompliant\n        t3 = default;               // Noncompliant\n        t3 = default(T);            // Noncompliant\n\n        _ = t == default;           // Noncompliant\n        _ = t3 == default;          // Noncompliant\n        _ = t3 != default;          // Noncompliant\n        _ = t is default(T);        // Noncompliant\n        _ = t3 is default(T);       // Noncompliant\n        _ = t is not default(T);    // Noncompliant\n        _ = t3 is not default(T);   // Noncompliant\n\n        switch (t)\n        {\n            case default(T):        // Noncompliant\n                break;\n            default:\n                break;\n        }\n\n        switch (t3)\n        {\n            case default(T):        // Noncompliant\n                break;\n            default:\n                break;\n        }\n    }\n\n    void GenericMethodStructConstraint<T>()\n        where T : struct\n    {\n        T t = default;\n        var t2 = default(T);\n\n        T? t3 = default;            // Noncompliant\n    }\n\n    void GenericMethodEnumConstraint<T>()\n        where T : Enum\n    {\n        T t = default;\n        var t2 = default(T);\n\n        T? t3 = default;            // FN\n    }\n\n    void GenericMethodStructEnumConstraint<T>()\n        where T : struct, Enum\n    {\n        T t = default;\n        var t2 = default(T);\n        T? t3 = default;            // Noncompliant\n        T? t4 = default(T);         // FN\n\n        t = default;\n        t = default(T);\n        t3 = default;               // Noncompliant\n        t3 = default(T);\n\n        _ = t == default;           // Error [CS8761]\n        _ = t3 == default;          // Error [CS0019]\n        _ = t is default(T);        // Error [CS0150]\n        _ = t3 is default(T);       // Error [CS0150]\n\n        switch (t)\n        {\n            case default(T):        // Error [CS0150]\n                break;\n            default:\n                break;\n        }\n\n        switch (t3)\n        {\n            case default(T):        // Error [CS0150]\n                break;\n            default:\n                break;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/UsePositiveLogic.cs",
    "content": "﻿public class Sample\n{\n    private bool condition;\n\n    public object Not(object value)\n    {\n        if (!condition) // Noncompliant {{Swap the branches and use positive condition.}}\n        //  ^^^^^^^^^^\n        {\n            return null;\n        }\n        else\n        {\n            return value;\n        }\n\n        if (!condition) // Compliant, doesn't have 'else'\n        {\n            return null;\n        }\n\n        if (!condition) // Compliant, has `else if`\n        {\n            return null;\n        }\n        else if (condition)\n        {\n            return null;\n        }\n\n        if (!condition) // Compliant, has `else if`\n        {\n            return null;\n        }\n        else if (!condition)    // Noncompliant\n        {\n            return null;\n        }\n        else\n        {\n            return value;\n        }\n\n        if (condition)\n        {\n            return value;\n        }\n        else\n        {\n            return null;\n        }\n\n        if (!condition) // Compliant, has `else if`\n        {\n            return null;\n        }\n        else if (condition)\n        {\n            return value;\n        }\n        else\n        {\n            return null;\n        }\n    }\n\n    public object NotEquals(object left, object right)\n    {\n        if (left != right)  // Noncompliant\n        {\n            return null;\n        }\n        else\n        {\n            return left;\n        }\n\n        if (left == right)\n        {\n            return left;\n        }\n        else\n        {\n            return null;\n        }\n    }\n\n    public object NotEqualsBool(bool left, bool right)\n    {\n        if (left != right)  // Noncompliant\n        {\n            return null;\n        }\n        else\n        {\n            return left;\n        }\n\n        if (left == right)\n        {\n            return left;\n        }\n        else\n        {\n            return null;\n        }\n    }\n\n    public void Ternary(object value)\n    {\n        _ = !condition  // Noncompliant\n            ? null\n            : value;\n\n        _ = condition\n            ? value\n            : null;\n    }\n\n    public void NotAndChain(object value)\n    {\n        _ = !condition && (!condition && (!condition))  // Noncompliant\n            ? null\n            : value;\n\n        _ = condition || condition || condition\n            ? value\n            : null;\n\n        _ = !condition || !condition || !condition  // Noncompliant\n            ? null\n            : value;\n\n        _ = condition && condition && condition\n            ? value\n            : null;\n\n        _ = !condition && !(condition || condition && !condition)  // Noncompliant, the outer can be inverted\n            ? null\n            : value;\n\n        _ = condition || condition || (condition && !condition)\n            ? value\n            : null;\n\n        _ = !condition && condition && !condition      // Compliant, there's at least one positive\n            ? null\n            : value;\n\n        _ = !condition && (!condition || !condition)   // Compliant\n            ? null\n            : value;\n    }\n\n    public void PatternMatching(object value)\n    {\n        _ = value is not null   // Noncompliant\n            ? value\n            : null;\n\n        _ = value is not true   // Noncompliant\n            ? value\n            : null;\n\n        _ = value is not string // Noncompliant\n            ? value\n            : null;\n\n        _ = value is not string and not int and not bool // Noncompliant\n            ? value\n            : null;\n\n        _ = value is not string or not int or not bool  // Noncompliant\n            ? value\n            : null;\n\n        _ = value is not string and not int or not bool // Compliant, there's 'or' in the 'and' chain\n            ? value\n            : null;\n\n        _ = value is null\n            ? null\n            : value;\n    }\n\n\n    public void ConditionAndPatternChain_Simple(object value)\n    {\n        _ = !condition && value is not string and not int   // Noncompliant\n            ? value\n            : null;\n\n        _ = !condition || value is not string or not int    // Noncompliant\n            ? value\n            : null;\n\n        _ = !condition && value is not string or not int    // Compliant, there's 'or' in the 'and' chain\n            ? value\n            : null;\n\n        _ = !condition || value is not string and not int   // Compliant, there's 'and' in the 'or' chain\n            ? value\n            : null;\n    }\n\n    public void ConditionAndPatternChain_Long(object value)\n    {\n        _ = !condition && !condition && value is not string and not int and not bool && !condition  // Noncompliant\n            ? value\n            : null;\n\n        _ = !condition || !condition || value is not string or not int or not bool || !condition    // Noncompliant\n            ? value\n            : null;\n\n        _ = !condition && !condition && value is not string and not int and not bool || !condition  // Compliant, there's 'or' in the 'and' chain\n            ? value\n            : null;\n\n        _ = !condition && !condition && value is not string and not int or not bool && !condition   // Compliant, there's 'or' in the 'and' chain\n            ? value\n            : null;\n\n        _ = !condition || !condition || value is not string or not int or not bool && !condition    // Compliant, there's 'and' in the 'or' chain\n            ? value\n            : null;\n\n        _ = !condition || !condition || value is not string or not int and not bool || !condition   // Compliant, there's 'and' in the 'or' chain\n            ? value\n            : null;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/UseRawString.cs",
    "content": "﻿public class Sample\n{\n    public void Method()\n    {\n        // Noncompliant@+1 {{Use raw string literal for multiline strings.}}\n        _ = @\"\nVerbatim\nMultiline\";\n        // Noncompliant@+1\n        _ = @\"\"\"\nStill Verbatim\nBut mutiline\n\"\"\";\n        // Noncompliant@+1\n        _ = @\"Smallest just to get the EOL\n\";\n        // Noncompliant@+1\n        _ = @$\"Verbatim\n{42}\nInterpolated\";\n        // Noncompliant@+1\n        _ = $@\"Interpolated\n{42}\nVerbatim\";\n\n        _ = \"\"\"\n            This is fine\n            \"\"\";\n        _ = $\"\"\"\n            Interpolated\n            {42}\n            Raw\n            \"\"\";\n        _ = $$$\"\"\"\n            Interpolated\n            {{{42}}}\n            Raw\n            \"\"\";\n    }\n\n    public void SingleLine()\n    {\n        _ = \"\";\n        _ = \"Normal\";\n        _ = @\"Verbatim\";\n        _ = @\"\"\"Still Verbatim\"\"\";\n        _ = \"\"\"Raw\"\"\";\n        _ = $\"Interpolated {42}\";\n        _ = @$\"Verbatim {42} Interpolated\";\n        _ = $@\"Interpolated {42} Verbatim\";\n        _ = $\"\"\"Interpolated {42} Raw\"\"\";\n        _ = $$$\"\"\"Interpolated {{{42}}} Raw\"\"\";\n    }\n\n    public void Binary()\n    {\n        // We don't raise on these\n        _ = \"FirstLine\" +\n            \"Also first Line\";\n        _ = \"FirstLine\\n\" +\n            \"Second Line\";\n        _ = \"FirstLine\\r\" +\n            \"Second Line\";\n        _ = \"FirstLine\\n\\r\" +\n            \"Second Line\";\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/UseRegexSafeIsMatch.cs",
    "content": "﻿using System.Text.RegularExpressions;\nusing RealRegex = System.Text.RegularExpressions.Regex;\nusing System;\n\nnamespace ThisNamespace\n{\n    class UseRegexSafeIsMatchNonCompliant\n    {\n        private Regex regex;\n        private RealRegex realRegex;\n\n        void InstanceRegex(string content)\n        {\n            regex.IsMatch(content);         // Noncompliant {{Use 'SafeIsMatch' instead.}}\n            //    ^^^^^^^\n            regex.IsMatch(content, 0);      // Noncompliant\n            regex.Matches(content);         // Noncompliant {{Use 'SafeMatches' instead.}}\n            regex.Matches(content, 0);      // Noncompliant\n            regex.Match(content);           // Noncompliant {{Use 'SafeMatch' instead.}}\n            regex.Match(content, 0);        // Noncompliant\n            realRegex.IsMatch(content);     // Noncompliant\n            realRegex.IsMatch(content, 0);  // Noncompliant\n            realRegex.Matches(content);     // Noncompliant\n            realRegex.Matches(content, 0);  // Noncompliant\n            realRegex.Match(content);       // Noncompliant\n            realRegex.Match(content, 0);    // Noncompliant\n            Regex.IsMatch(content, \"pattern\");                          // Noncompliant {{Use 'SafeRegex.IsMatch' instead.}}\n    //      ^^^^^\n            Regex.IsMatch(content, \"pattern\", RegexOptions.None);       // Noncompliant\n            Regex.Matches(content, \"pattern\");                          // Noncompliant {{Use 'SafeRegex.Matches' instead.}}\n            Regex.Matches(content, \"pattern\", RegexOptions.None);       // Noncompliant\n            Regex.Match(content, \"pattern\");                            // Noncompliant {{Use 'SafeRegex.Match' instead.}}\n            Regex.Match(content, \"pattern\", RegexOptions.None);         // Noncompliant\n            RealRegex.IsMatch(content, \"pattern\");                      // Noncompliant\n            RealRegex.IsMatch(content, \"pattern\", RegexOptions.None);   // Noncompliant\n            RealRegex.Matches(content, \"pattern\");                      // Noncompliant\n            RealRegex.Matches(content, \"pattern\", RegexOptions.None);   // Noncompliant\n            RealRegex.Match(content, \"pattern\");                        // Noncompliant\n            RealRegex.Match(content, \"pattern\", RegexOptions.None);     // Noncompliant\n        }\n    }\n\n    class UseRegexSafeIsMatchCompliant\n    {\n        private class Regex\n        {\n            public bool IsMatch(string input) => false;\n            public MatchCollection Matches(string input) => null;\n            public Match Match(string input) => null;\n            public static bool IsMatch(string input, string pattern) => false;\n            public static MatchCollection Matches(string input, string pattern) => null;\n            public static Match Match(string input, string pattern) => null;\n        }\n\n        private Regex regex;\n\n        void InstanceRegex(string content)\n        {\n            regex.IsMatch(content);\n            regex.Matches(content);\n            regex.Match(content);\n            Regex.IsMatch(content, \"pattern\");\n            Regex.Matches(content, \"pattern\");\n            Regex.Match(content, \"pattern\");\n        }\n    }\n}\n\nnamespace OtherNamespace\n{\n    public static class RegexExtensions\n    {\n        public static bool SafeIsMatch(this Regex regex, string input) =>\n            throw new NotImplementedException();\n        public static Match SafeMatch(this Regex regex, string input) =>\n            throw new NotImplementedException();\n        public static bool SafeIsMatch(this Regex regex, string input, bool timeoutFallback) =>\n            throw new NotImplementedException();\n        public static MatchCollection SafeMatches(this Regex regex, string input) =>\n            throw new NotImplementedException();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/UseShortName.cs",
    "content": "﻿using System.Threading;\n\npublic class Sample\n{\n    public void SuggestedNames(SyntaxNode node, SyntaxTree tree, SemanticModel model, CancellationToken cancel) { }\n    public void OtherNames(SyntaxNode song, SyntaxTree wood, SemanticModel sculpture, CancellationToken nuke) { }\n\n    public void LongName1(SyntaxNode syntaxNode) { }     // Noncompliant {{Use short name 'node'.}}\n    //                               ^^^^^^^^^^\n    public void LongName2(SyntaxNode prefixedSyntaxNode) { }         // Noncompliant {{Use short name 'prefixedNode'.}}\n    public void LongName3(SyntaxNode syntaxNodeCount) { }            // Noncompliant {{Use short name 'nodeCount'.}}\n    public void LongName4(SyntaxTree syntaxTree) { }                 // Noncompliant {{Use short name 'tree'.}}\n    public void LongName5(SyntaxTree firstSyntaxTreeCount) { }       // Noncompliant {{Use short name 'firstTreeCount'.}}\n    public void LongName6(CancellationToken cancellationToken) { }   // Noncompliant {{Use short name 'cancel'.}}\n\n    private SyntaxNode node;\n    private SyntaxNode otherNode, syntaxNode;   // Noncompliant {{Use short name 'node'.}}\n    //                            ^^^^^^^^^^\n    private SyntaxTree syntaxTree;              // Noncompliant\n    private SemanticModel semanticModel;        // Noncompliant\n\n    public SyntaxNode SyntaxNode { get; }       // Noncompliant {{Use short name 'Node'.}}\n    //                ^^^^^^^^^^\n\n    private SyntaxToken syntaxToken;            // Noncompliant {{Use short name 'token'.}}\n    private SyntaxToken SyntaxToken { get; }    // Noncompliant {{Use short name 'Token'.}}\n\n    private SyntaxTrivia syntaxTrivia;          // Noncompliant {{Use short name 'trivia'.}}\n    private SyntaxTrivia SyntaxTrivia{ get; }   // Noncompliant {{Use short name 'Trivia'.}}\n\n    private DiagnosticDescriptor diagnosticDescriptor;          // Noncompliant {{Use short name 'descriptor'.}}\n    private DiagnosticDescriptor DiagnosticDescriptor { get; }  // Noncompliant {{Use short name 'Descriptor'.}}\n\n    public void TypedDeclarations()\n    {\n        SyntaxNode nodeNode;\n        SyntaxNode otherNode;\n        SyntaxNode node;\n        SyntaxNode syntaxNode;  // Noncompliant {{Use short name 'node'.}} If there exist 'node' and 'syntaxNode' in the same scope, both need a rename.\n\n        SyntaxTree syntaxTree;                  // Noncompliant\n        SemanticModel semanticModel;            // Noncompliant\n        CancellationToken cancellationToken;    // Noncompliant\n\n        void SyntaxNode() { }   // Not in the scope (for now)\n    }\n\n    public void VarDeclarations()\n    {\n        var nodeNode = CreateNode();\n        var otherNode = CreateNode();\n        var node = CreateNode();\n        var syntaxNode = CreateNode();  // Noncompliant {{Use short name 'node'.}} If there exist 'node' and 'syntaxNode' in the same scope, both need a rename.\n        //  ^^^^^^^^^^\n\n        var syntaxTree = CreateTree();          // Noncompliant\n        var semanticModel = CreateModel();      // Noncompliant\n        var cancellationToken = CreateCancel(); // Noncompliant\n\n        void SyntaxNode() { }   // Not in the scope (for now)\n    }\n\n    public void UnexpectedType(SyntaxNode syntaxTree)   // Wrong, but compliant\n    {\n        var semanticModel = CreateNode();               // Wrong, but compliant\n        SemanticModel syntaxNode = null;                // Wrong, but compliant\n    }\n\n    private SyntaxNode CreateNode() => null;\n    private SyntaxTree CreateTree() => null;\n    private SemanticModel CreateModel() => null;\n    private CancellationToken CreateCancel() => default;\n\n    private class NestedWithPublicFields\n    {\n        public SyntaxNode SyntaxNode;       // Noncompliant {{Use short name 'Node'.}}\n        public SyntaxTree SyntaxTree;       // Noncompliant\n        public SemanticModel SemanticModel; // Noncompliant\n    }\n}\n\npublic class ArrowProperty\n{\n    public SyntaxNode SyntaxNode => null;   // Noncompliant\n}\n\npublic class BodyProperty\n{\n    public SyntaxNode SyntaxNode            // Noncompliant\n    {\n        get => null;\n        set { }\n    }\n}\n\npublic class Methods\n{\n    // It does not appy to method names\n    public void SyntaxNode() { }\n    public void SyntaxTree() { }\n    public void SemanticModel() { }\n    public void CancellationToken() { }\n}\n\npublic abstract class Base\n{\n    protected abstract void DoSomething(SyntaxNode syntaxNode); // Noncompliant {{Use short name 'node'.}}\n}\n\npublic class Inherited : Base\n{\n    protected override void DoSomething(SyntaxNode syntaxNode) // Compliant so we don't contradict S927\n    {\n    }\n}\n\npublic interface IInterface\n{\n    void DoSomething(SyntaxNode syntaxNode);    // Noncompliant\n}\n\npublic class Implemented : IInterface\n{\n    public void DoSomething(SyntaxNode syntaxNode) // Compliant so we don't contradict S927\n    {\n    }\n}\n\npublic partial class Partial\n{\n    public partial void DoSomething(SyntaxNode syntaxNode); // Noncompliant\n}\n\npublic partial class Partial\n{\n    public partial void DoSomething(SyntaxNode syntaxNode) // Compliant so we don't contradict S927\n    {\n        // Implementation\n    }\n}\n\npublic class SyntaxNode { }\npublic class SyntaxToken { }\npublic class SyntaxTree { }\npublic class SyntaxTrivia { }\npublic class SemanticModel { }\npublic class DiagnosticDescriptor { }\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/TestCases/UseVar.cs",
    "content": "﻿using System.Collections.Generic;\n\npublic class UseVar\n{\n    public static Dictionary<string, string> field = new();\n    public static List<string> Property { get; set; } = new();\n\n    List<string> FromMethod() => new();\n\n    List<string> Method(bool condition, List<string> optional = new()) // Error [CS1736]\n    {\n        field = new();\n        Property = new();\n\n        int uninitializedValueType;\n        List<string> uninitialized;\n\n        var list = new List<string>();\n        var array = new string[0];\n        List<string> multiple1 = new(), multiple2 = new();\n        List<string> ternary = condition ? new() : new();\n        IEnumerable<string> canNotInfer = condition ? list : array;\n\n        var invalidMultiple1 = new List<string>(), invalidMultiple2 = new List<string>();   // Error [CS0819]\n        var nottyped = new();                                                               // Error [CS8754]\n\n        List<string> noncompliant = new();                                  // Noncompliant {{Use var.}}\n//      ^^^^^^^^^^^^\n        List<string> fromInvocation = FromMethod();                         // Noncompliant\n        List<string> listRenamed = list;                                    // Noncompliant\n        List<string> propertyRenamed = UseVar.Property;                     // Noncompliant\n        Dictionary<string, string> filedRenamed = global::UseVar.field;     // Noncompliant\n\n        List<string> redundant = new List<string>();                        // IDE0007\n\n        return new();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.CSharp.Styling.Test/packages.lock.json",
    "content": "{\n  \"version\": 1,\n  \"dependencies\": {\n    \"net10.0\": {\n      \"altcover\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[9.0.102, )\",\n        \"resolved\": \"9.0.102\",\n        \"contentHash\": \"q3Rf5t0M9kXlcO5qhsaAe6NrFSNd5enrhKmF/Ezgmomqw34PbUTbRSYjSDNhS3YGDyUrPTkyPn14EfLDJWztcA==\"\n      },\n      \"Combinatorial.MSTest\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[2.0.0, )\",\n        \"resolved\": \"2.0.0\",\n        \"contentHash\": \"9tB2TMPkuEkYYUq64WREHMMyPt9NfKAyuitpK9yw3zbVe6v/vYkClZTR02+yKFUG+g8XHi5LMTt8jHz4RufGqw==\",\n        \"dependencies\": {\n          \"MSTest.TestFramework\": \"4.0.1\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[3.3.1, )\",\n        \"resolved\": \"3.3.1\",\n        \"contentHash\": \"eT+kgNCDdTRbQ5WF6BGx1HI3D5jYfHteza/koefhWC2vNZGxObA74XxwWfg40dy3uUv7dn3OGKLK5GUPLroVog==\"\n      },\n      \"Microsoft.NET.Test.Sdk\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[18.4.0, )\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"w49iZdL4HL6V25l41NVQLXWQ+e71GvSkKVteMrOL02gP/PUkcnO/1yEb2s9FntU4wGmJWfKnyrRAhcMHd9ZZNA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeCoverage\": \"18.4.0\",\n          \"Microsoft.TestPlatform.TestHost\": \"18.4.0\"\n        }\n      },\n      \"MSTest.TestAdapter\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[4.2.1, )\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"lZRgNzaQnffK4XLjM/og4Eoqp/3IkpcyJQQcyKXkPdkzCT3+ghpwHa9zG1xYhQDbUFoc54M+/waLwh31K9stDQ==\",\n        \"dependencies\": {\n          \"MSTest.TestFramework\": \"4.2.1\",\n          \"Microsoft.Testing.Extensions.VSTestBridge\": \"2.2.1\",\n          \"Microsoft.Testing.Platform.MSBuild\": \"2.2.1\"\n        }\n      },\n      \"MSTest.TestFramework\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[4.2.1, )\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"I4/RbS2TpGZ56CE98+jPbrGlcerYtw2LvPVKzQGvyQQcJDekPy2Kd+fnThXYn+geJ1sW+vA9B7++rFNxvKcWxA==\",\n        \"dependencies\": {\n          \"MSTest.Analyzers\": \"4.2.1\"\n        }\n      },\n      \"SonarAnalyzer.CSharp.Styling\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[10.21.0.135717, )\",\n        \"resolved\": \"10.21.0.135717\",\n        \"contentHash\": \"hl264jF539oB7m2jED5QGM345eFSiDAdoJc8TH0HM6L7ZeqT5TDqZDQeZ8IDP02dVIpH/Fhhn+HsGfEcj8ohyQ==\"\n      },\n      \"StyleCop.Analyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.2.0-beta.556, )\",\n        \"resolved\": \"1.2.0-beta.556\",\n        \"contentHash\": \"llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==\",\n        \"dependencies\": {\n          \"StyleCop.Analyzers.Unstable\": \"1.2.0.556\"\n        }\n      },\n      \"Castle.Core\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.1.1\",\n        \"contentHash\": \"rpYtIczkzGpf+EkZgDr9CClTdemhsrwA/W5hMoPjLkRFnXzH44zDLoovXeKtmxb1ykXK9aJVODSpiJml8CTw2g==\",\n        \"dependencies\": {\n          \"System.Diagnostics.EventLog\": \"6.0.0\"\n        }\n      },\n      \"FluentAssertions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.2.1\",\n        \"contentHash\": \"MilqBF2lZrT0V1azIA6DG6I/snS0rG3A8ohT2Jjkhq6zOFk76nqx4BPnEnzrX6jFVa6xvkDU++z3PebCGZyJ4g==\",\n        \"dependencies\": {\n          \"System.Configuration.ConfigurationManager\": \"6.0.0\"\n        }\n      },\n      \"FluentAssertions.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"0.34.1\",\n        \"contentHash\": \"2BnAAB8CCPdRA9P1+lAvBZOleR2BTmsxGMtGt+LnABJUARGqoGMWEFxG3znZYqHVIrMP0Za/kyw6atyt8x2mzA==\"\n      },\n      \"Google.Protobuf\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"3.6.1\",\n        \"contentHash\": \"741fGeDQjixBJaU2j+0CbrmZXsNJkTn/hWbOh4fLVXndHsCclJmWznCPWrJmPoZKvajBvAz3e8ECJOUvRtwjNQ==\",\n        \"dependencies\": {\n          \"NETStandard.Library\": \"1.6.1\"\n        }\n      },\n      \"Humanizer.Core\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.14.1\",\n        \"contentHash\": \"lQKvtaTDOXnoVJ20ibTuSIOf2i0uO0MPbDhd1jm238I+U/2ZnRENj0cktKZhtchBMtCUSRQ5v4xBCUbKNmyVMw==\"\n      },\n      \"Microsoft.ApplicationInsights\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.23.0\",\n        \"contentHash\": \"nWArUZTdU7iqZLycLKWe0TDms48KKGE6pONH2terYNa8REXiqixrMOkf1sk5DHGMaUTqONU2YkS4SAXBhLStgw==\",\n        \"dependencies\": {\n          \"System.Diagnostics.DiagnosticSource\": \"5.0.0\"\n        }\n      },\n      \"Microsoft.Build.Framework\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"17.11.48\",\n        \"contentHash\": \"C3WIMt2wBl4++NX3jSEpTq5KXBhvAV154R4JrYHkfy9JSBcXWiL0mkgpspk5xSdOj+fS/uz7zluIy6bMM1fkkQ==\"\n      },\n      \"Microsoft.Build.Locator\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.11.2\",\n        \"contentHash\": \"tY+/S54G29CGsbL3slVu4vqtpciwVnb3fKOmrhgzEQmu/VziFaWmD/E1e/2KH7cDucuycGSkWsSXndBs5Uawow==\"\n      },\n      \"Microsoft.CodeAnalysis.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0-2.25625.1\",\n        \"contentHash\": \"4Yhh2fnu3G+J0J1lDc8WZVgMjgbynSeTfkl5IFJMFrmiIO0sc7Tjx+f3sFVV8Sd35PrIUWfof0RWc3lAMl7Azg==\"\n      },\n      \"Microsoft.CodeAnalysis.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"uC0qk3jzTQY7i90ehfnCqaOZpBUGJyPMiHJ3c0jOb8yaPBjWzIhVdNxPbeVzI74DB0C+YgBKPLqUkgFZzua5Mg==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"SQFNGQF4f7UfDXKxMzzGNMr3fjrPDIjLfmRvvVgDCw+dyvEHDaRfHuKA5q0Pr0/JW0Gcw89TxrxrS/MjwBvluQ==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp.Workspaces\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"mRwxchBs3ewXK4dqK4R/eVCx99VIq1k/lhwArlu+fJuV0uzmbkTTRw4jR9gN9sOcAQfX0uV9KQlmCk1yC0JNog==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.CSharp\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.VisualBasic\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"AJxddsIOmfimuihaLuSAm4c/zskHoL1ypAjIpSOZqHlNm2iuw0twsB8nbKczJyfClqD7+iYjdIeE5EV8WAyxRA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"pAGdr4qs7+v287DPiiM8px1cBXnhe8LxymkVGTnCwv2OEjCk5HO2zIoFvype4ivKJTRW3aTUUV8ab+915wbv+w==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.VisualBasic\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Workspaces.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"QSf1ge9A+XFZbGL+gIqXYBIKlm8QdQVLvHDPZiydG11W6mJY7XBMusrsgIEz6L8GYMzGJKTM78m9icliGMF7NA==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Workspaces.MSBuild\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"2Mg/ppo5dza1e4DJWX4+RIHMc3FgnYzuHTaLRZDupiK1LTi/PAZ1PBpF/iivHVNKQKwipHE984gy37MbM0RO9Q==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.Build.Framework\": \"17.11.48\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"Microsoft.Extensions.DependencyInjection\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Options\": \"9.0.0\",\n          \"Microsoft.Extensions.Primitives\": \"9.0.0\",\n          \"Microsoft.VisualStudio.SolutionPersistence\": \"1.0.52\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeCoverage\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"9O0BtCfzCWrkAmK187ugKdq72HHOXoOUjuWFDVc2LsZZ0pOnA9bTt+Sg9q4cF+MoAaUU+MuWtvBuFsnduviJow==\"\n      },\n      \"Microsoft.Composition\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.27\",\n        \"contentHash\": \"pwu80Ohe7SBzZ6i69LVdzowp6V+LaVRzd5F7A6QlD42vQkX0oT7KXKWWPlM/S00w1gnMQMRnEdbtOV12z6rXdQ==\"\n      },\n      \"Microsoft.Extensions.DependencyInjection\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"MCPrg7v3QgNMr0vX4vzRXvkNGgLg8vKWX0nKCWUxu2uPyMsaRgiRc1tHBnbTcfJMhMKj2slE/j2M9oGkd25DNw==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.DependencyInjection.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"+6f2qv2a3dLwd5w6JanPIPs47CxRbnk+ZocMJUhv9NxP88VlOcJYZs9jY+MYSjxvady08bUZn6qgiNh7DadGgg==\"\n      },\n      \"Microsoft.Extensions.Logging\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"crjWyORoug0kK7RSNJBTeSE6VX8IQgLf3nUpTB9m62bPXp/tzbnOsnbe8TXEG0AASNaKZddnpHKw7fET8E++Pg==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Options\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.Logging.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"g0UfujELzlLbHoVG8kPKVBaW470Ewi+jnptGS9KUi6jcb+k2StujtK3m26DFSGGwQ/+bVgZfsWqNzlP6YOejvw==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.Options\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"y2146b3jrPI3Q0lokKXdKLpmXqakYbDIPDV6r3M8SqvSf45WwOTzkyfDpxnZXJsJQEpAsAqjUq5Pu8RCJMjubg==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Primitives\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"N3qEBzmLMYiASUlKxxFIISP4AiwuPTHF5uCh+2CWSwwzAJiIYx0kBJsS30cp1nvhSySFAVi30jecD307jV+8Kg==\"\n      },\n      \"Microsoft.Testing.Extensions.Telemetry\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"7zB8BjffOyvqfHF26rFVPuK0w1fCf5+j1tLuhHIr76CqxXkGb+fMJtq6YNOV+m6qPytExHMXxluk3RgJ+dSIqw==\",\n        \"dependencies\": {\n          \"Microsoft.ApplicationInsights\": \"2.23.0\",\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.Testing.Extensions.TrxReport.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"RD6D1Jx6cKDA5IHd1H2q8ylIuQG3PD+gdULI0JC8CvsRtaypFzTFpB5xDPuQi8o6kAkcM04cBhAiJPxZboNH2Q==\",\n        \"dependencies\": {\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.Testing.Extensions.VSTestBridge\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"D8AGlkNtlTQPe3zf4SLnHBMr13lerMe0RuHSoRfnRatcuX/T7YbRtgn39rWBjKhXsNio0WXKrPKv3gfWE2I46w==\",\n        \"dependencies\": {\n          \"Microsoft.TestPlatform.ObjectModel\": \"18.3.0\",\n          \"Microsoft.Testing.Extensions.Telemetry\": \"2.2.1\",\n          \"Microsoft.Testing.Extensions.TrxReport.Abstractions\": \"2.2.1\",\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.Testing.Platform\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"9bbPuls/b6/vUFzxbSjJLZlJHyKBfOZE5kjIY+ITI2ASqlFPJhR83BdLydJeQOCLEZhEbrEcz5xtt1B69nwSVg==\"\n      },\n      \"Microsoft.Testing.Platform.MSBuild\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"CSJOcZHfKlTyPbS0CTJk6iEnU4gJC+eUA5z72UBnMDRdgVHYOmB8k9Y7jT233gZjnCOQiYFg3acQHRfu2H62nw==\",\n        \"dependencies\": {\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.TestPlatform.ObjectModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"4L6m2kS2pY5uJ9cpeRxzW22opr6ttScIRqsOpMDQpgENp/ZwxkkQCcmc6LRSURo2dFaaSW5KVflQZvroiJ7Wzg==\",\n        \"dependencies\": {\n          \"System.Reflection.Metadata\": \"8.0.0\"\n        }\n      },\n      \"Microsoft.TestPlatform.TestHost\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"gZsCHI+zOmZCcKZieIL4Jg14qKD2OGZOmX5DehuIk1EA9BN6Crm0+taXQNEuajOH1G9CCyBxw8VWR4t5tumcng==\",\n        \"dependencies\": {\n          \"Microsoft.TestPlatform.ObjectModel\": \"18.4.0\",\n          \"Newtonsoft.Json\": \"13.0.3\"\n        }\n      },\n      \"Microsoft.VisualStudio.SolutionPersistence\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.52\",\n        \"contentHash\": \"oNv2JtYXhpdJrX63nibx1JT3uCESOBQ1LAk7Dtz/sr0+laW0KRM6eKp4CZ3MHDR2siIkKsY8MmUkeP5DKkQQ5w==\"\n      },\n      \"Microsoft.Win32.SystemEvents\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"hqTM5628jSsQiv+HGpiq3WKBl2c8v1KZfby2J6Pr7pEPlK9waPdgEO6b8A/+/xn/yZ9ulv8HuqK71ONy2tg67A==\"\n      },\n      \"MSTest.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"1i9jgE/42KGGyZ4s0MdrYM/Uu/dRYhbRfYQifcO0AZ6vw4sBXRjoQGQRGNSm771AYgPAmoGl0u4sJc2lMET6HQ==\"\n      },\n      \"Newtonsoft.Json\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"13.0.3\",\n        \"contentHash\": \"HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==\"\n      },\n      \"NSubstitute\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"lJ47Cps5Qzr86N99lcwd+OUvQma7+fBgr8+Mn+aOC0WrlqMNkdivaYD9IvnZ5Mqo6Ky3LS7ZI+tUq1/s9ERd0Q==\",\n        \"dependencies\": {\n          \"Castle.Core\": \"5.1.1\"\n        }\n      },\n      \"NuGet.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"1mp7zmyAGmQfT93ELC4c+MYOrJ8Ff4ekFZRek4JSVLb/wOO/o0bsPfLmqujCsJ2Hlwc+fpq1TQEnjSEgWdt8ng==\",\n        \"dependencies\": {\n          \"NuGet.Frameworks\": \"7.3.1\"\n        }\n      },\n      \"NuGet.Configuration\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"tGxWBo47EQONOaqY+MbEWMrNjFthHgfavLM1HE0RcLyOXVCoQKBlZGV7v0hrS/rJrQKw6ZaBeHetX+ZJgS7Lxg==\",\n        \"dependencies\": {\n          \"NuGet.Common\": \"7.3.1\",\n          \"System.Security.Cryptography.ProtectedData\": \"8.0.0\"\n        }\n      },\n      \"NuGet.Frameworks\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"VUPAE5l/Ir4Gb3dv+v0jq0Qe4nfwxfrfiYN7QhwlGyWPXFKYXSSke1t1bV/ZYd6idtTtRDqJPM49Lt/U8NTocg==\"\n      },\n      \"NuGet.Packaging\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"5bT8uOrNBx4Srhbrd3HonYmyKhWJkvQyTWTYE2jvfPgYx2aCbPmq8MCYko7ce78hEN9mpq2xlrztVhguYPc+GQ==\",\n        \"dependencies\": {\n          \"Newtonsoft.Json\": \"13.0.3\",\n          \"NuGet.Configuration\": \"7.3.1\",\n          \"NuGet.Versioning\": \"7.3.1\",\n          \"System.Security.Cryptography.Pkcs\": \"8.0.1\"\n        }\n      },\n      \"NuGet.Protocol\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"vYd5vtCJ/tpMQjbAs6rrftNgeh5Ip1w7tnEsDZCpGObKgUgOxHQBekCul3TnzmbNgobvJEkDJNaec5/ZBv66Hg==\",\n        \"dependencies\": {\n          \"NuGet.Packaging\": \"7.3.1\"\n        }\n      },\n      \"NuGet.Versioning\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"TJrQWSmD1vakfav7qIhDXgDFfaZFfMJ+v6P8tcND9ZqXajD5B/ZzaoGYNzL4D3eDue6vAOUvwzu42G+19JNVUA==\"\n      },\n      \"StyleCop.Analyzers.Unstable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.2.0.556\",\n        \"contentHash\": \"zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==\"\n      },\n      \"System.Collections.Immutable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"AurL6Y5BA1WotzlEvVaIDpqzpIPvYnnldxru8oXJU2yFxFUy3+pNXjXd1ymO+RA0rq0+590Q8gaz2l3Sr7fmqg==\"\n      },\n      \"System.Composition\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"3Djj70fFTraOarSKmRnmRy/zm4YurICm+kiCtI0dYRqGJnLX6nJ+G3WYuFJ173cAPax/gh96REcbNiVqcrypFQ==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\",\n          \"System.Composition.Convention\": \"9.0.0\",\n          \"System.Composition.Hosting\": \"9.0.0\",\n          \"System.Composition.Runtime\": \"9.0.0\",\n          \"System.Composition.TypedParts\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.AttributedModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"iri00l/zIX9g4lHMY+Nz0qV1n40+jFYAmgsaiNn16xvt2RDwlqByNG4wgblagnDYxm3YSQQ0jLlC/7Xlk9CzyA==\"\n      },\n      \"System.Composition.Convention\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"+vuqVP6xpi582XIjJi6OCsIxuoTZfR0M7WWufk3uGDeCl3wGW6KnpylUJ3iiXdPByPE0vR5TjJgR6hDLez4FQg==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.Hosting\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"OFqSeFeJYr7kHxDfaViGM1ymk7d4JxK//VSoNF9Ux0gpqkLsauDZpu89kTHHNdCWfSljbFcvAafGyBoY094btQ==\",\n        \"dependencies\": {\n          \"System.Composition.Runtime\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.Runtime\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"w1HOlQY1zsOWYussjFGZCEYF2UZXgvoYnS94NIu2CBnAGMbXFAX8PY8c92KwUItPmowal68jnVLBCzdrWLeEKA==\"\n      },\n      \"System.Composition.TypedParts\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"aRZlojCCGEHDKqh43jaDgaVpYETsgd7Nx4g1zwLKMtv4iTo0627715ajEFNpEEBTgLmvZuv8K0EVxc3sM4NWJA==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\",\n          \"System.Composition.Hosting\": \"9.0.0\",\n          \"System.Composition.Runtime\": \"9.0.0\"\n        }\n      },\n      \"System.Configuration.ConfigurationManager\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"7T+m0kDSlIPTHIkPMIu6m6tV6qsMqJpvQWW2jIc2qi7sn40qxFo0q+7mEQAhMPXZHMKnWrnv47ntGlM/ejvw3g==\",\n        \"dependencies\": {\n          \"System.Security.Cryptography.ProtectedData\": \"6.0.0\",\n          \"System.Security.Permissions\": \"6.0.0\"\n        }\n      },\n      \"System.Diagnostics.DiagnosticSource\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.0.0\",\n        \"contentHash\": \"tCQTzPsGZh/A9LhhA6zrqCRV4hOHsK90/G7q3Khxmn6tnB1PuNU0cRaKANP2AWcF9bn0zsuOoZOSrHuJk6oNBA==\"\n      },\n      \"System.Diagnostics.EventLog\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"lcyUiXTsETK2ALsZrX+nWuHSIQeazhqPphLfaRxzdGaG93+0kELqpgEHtwWOlQe7+jSFnKwaCAgL4kjeZCQJnw==\"\n      },\n      \"System.Drawing.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"NfuoKUiP2nUWwKZN6twGqXioIe1zVD0RIj2t976A+czLHr2nY454RwwXs6JU9Htc6mwqL6Dn/nEL3dpVf2jOhg==\",\n        \"dependencies\": {\n          \"Microsoft.Win32.SystemEvents\": \"6.0.0\"\n        }\n      },\n      \"System.Reflection.Metadata\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"ptvgrFh7PvWI8bcVqG5rsA/weWM09EnthFHR5SCnS6IN+P4mj6rE1lBDC4U8HL9/57htKAqy4KQ3bBj84cfYyQ==\",\n        \"dependencies\": {\n          \"System.Collections.Immutable\": \"8.0.0\"\n        }\n      },\n      \"System.Security.AccessControl\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"AUADIc0LIEQe7MzC+I0cl0rAT8RrTAKFHl53yHjEUzNVIaUlhFY11vc2ebiVJzVBuOzun6F7FBA+8KAbGTTedQ==\"\n      },\n      \"System.Security.Cryptography.Pkcs\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.1\",\n        \"contentHash\": \"CoCRHFym33aUSf/NtWSVSZa99dkd0Hm7OCZUxORBjRB16LNhIEOf8THPqzIYlvKM0nNDAPTRBa1FxEECrgaxxA==\"\n      },\n      \"System.Security.Cryptography.ProtectedData\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"+TUFINV2q2ifyXauQXRwy4CiBhqvDEDZeVJU7qfxya4aRYOKzVBpN+4acx25VcPB9ywUN6C0n8drWl110PhZEg==\"\n      },\n      \"System.Security.Permissions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"T/uuc7AklkDoxmcJ7LGkyX1CcSviZuLCa4jg3PekfJ7SU0niF0IVTXwUiNVP9DSpzou2PpxJ+eNY2IfDM90ZCg==\",\n        \"dependencies\": {\n          \"System.Security.AccessControl\": \"6.0.0\",\n          \"System.Windows.Extensions\": \"6.0.0\"\n        }\n      },\n      \"System.Windows.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"IXoJOXIqc39AIe+CIR7koBtRGMiCt/LPM3lI+PELtDIy9XdyeSrwXFdWV9dzJ2Awl0paLWUaknLxFQ5HpHZUog==\",\n        \"dependencies\": {\n          \"System.Drawing.Common\": \"6.0.0\"\n        }\n      },\n      \"Internal.SonarAnalyzer.CSharp.Styling\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[5.0.0, )\",\n          \"SonarAnalyzer.CSharp.Core\": \"[10.26.0, )\",\n          \"SonarAnalyzer.Core\": \"[10.26.0, )\"\n        }\n      },\n      \"sonaranalyzer.cfg\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer.Lightup\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.core\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Google.Protobuf\": \"[3.6.1, )\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.CFG\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.csharp.core\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.CFG\": \"[10.26.0, )\",\n          \"SonarAnalyzer.Core\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer.lightup\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.testframework\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Combinatorial.MSTest\": \"[2.0.0, )\",\n          \"FluentAssertions\": \"[7.2.1, )\",\n          \"FluentAssertions.Analyzers\": \"[0.34.1, )\",\n          \"MSTest.TestAdapter\": \"[4.2.1, )\",\n          \"MSTest.TestFramework\": \"[4.2.1, )\",\n          \"Microsoft.Build.Locator\": \"[1.11.2, )\",\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[5.3.0, )\",\n          \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": \"[5.3.0, )\",\n          \"Microsoft.CodeAnalysis.Workspaces.MSBuild\": \"[5.3.0, )\",\n          \"Microsoft.NET.Test.Sdk\": \"[18.4.0, )\",\n          \"NSubstitute\": \"[5.3.0, )\",\n          \"NuGet.Protocol\": \"[7.3.1, )\",\n          \"SonarAnalyzer.Core\": \"[10.26.0, )\",\n          \"altcover\": \"[9.0.102, )\"\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/AnalysisContext/IssueReporterTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Reflection;\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.Core.AnalysisContext.Test;\n\n#pragma warning disable CS0618 // Type or member is obsolete\n[TestClass]\npublic class IssueReporterTest\n{\n    private readonly Version defaultVersion = new Version(\"4.9.2\");\n    private readonly DummyDiagnosticReporter reporter = new();\n\n    [TestMethod]\n    [DataRow(\"S1481\")]\n    [DataRow(\"S927\")]\n    [DataRow(\"S4487\")]\n    [DataRow(\"S2696\")]\n    [DataRow(\"S2259\")]\n    [DataRow(\"S1144\")]\n    [DataRow(\"S2325\")]\n    [DataRow(\"S1117\")]\n    [DataRow(\"S1481\")]\n    [DataRow(\"S1871\")]\n    [DataRow(\"S108\")]\n    public void ReportIssueCore_DesignTimeDiagnostic_ExcludedRule(string diagnosticId)\n    {\n        ReportDiagnostic(@\"C:\\SonarSource\\SomeFile.razor.-6NXeWT5Akt4vxdz.ide.g.cs\", true, diagnosticId);\n        reporter.Counter.Should().Be(0);\n        reporter.LastDiagnostic.Should().BeNull();\n    }\n\n    [TestMethod]\n    public void ReportIssueCore_DesignTimeDiagnostic_HasMappedPath_True()\n    {\n        var diagnostic = ReportDiagnostic(@\"C:\\SonarSource\\SomeFile.razor.-6NXeWT5Akt4vxdz.ide.g.cs\", hasMappedPath: true);\n        reporter.Counter.Should().Be(1);\n        reporter.LastDiagnostic.Should().Be(diagnostic);\n    }\n\n    [TestMethod]\n    public void ReportIssueCore_DesignTimeDiagnostic_HasMappedPath_False()\n    {\n        ReportDiagnostic(@\"C:\\SonarSource\\SomeFile.razor.-6NXeWT5Akt4vxdz.ide.g.cs\", hasMappedPath: false);\n        reporter.Counter.Should().Be(0);\n        reporter.LastDiagnostic.Should().BeNull();\n    }\n\n    [TestMethod]\n    public void ReportIssueCore_DesignTimeDiagnostic_RoslynVersion_1000_0_0()\n    {\n        ReportDiagnostic(@\"C:\\SonarSource\\SomeFile.razor.-6NXeWT5Akt4vxdz.ide.g.cs\", hasMappedPath: true, roslynVersion: new Version(1000, 0, 0));\n        reporter.Counter.Should().Be(0);\n        reporter.LastDiagnostic.Should().BeNull();\n    }\n\n    [TestMethod]\n    public void ReportIssueCore_DesignTimeDiagnostic_RoslynVersion_Greater_Than_Current()\n    {\n        Version current = new(typeof(SemanticModel).Assembly.GetName().Version.ToString());\n        Version greaterThanCurrent = new(current.Major, current.Minor, current.Build + 1);\n\n        ReportDiagnostic(@\"C:\\SonarSource\\SomeFile.razor.-6NXeWT5Akt4vxdz.ide.g.cs\", hasMappedPath: true, roslynVersion: greaterThanCurrent);\n        reporter.Counter.Should().Be(0);\n        reporter.LastDiagnostic.Should().BeNull();\n    }\n\n    [TestMethod]\n    public void ReportIssueCore_DesignTimeDiagnostic_RoslynVersion_Less_Than_Current()\n    {\n        var lessthanCurrent = LessThanCurrent();\n\n        var diagnostic = ReportDiagnostic(@\"C:\\SonarSource\\SomeFile.razor.-6NXeWT5Akt4vxdz.ide.g.cs\", hasMappedPath: true, roslynVersion: lessthanCurrent);\n        reporter.Counter.Should().Be(1);\n        reporter.LastDiagnostic.Should().Be(diagnostic);\n\n        static Version LessThanCurrent()\n        {\n            var roslynVersion = new Version(typeof(SemanticModel).Assembly.GetName().Version.ToString());\n            return roslynVersion.Build switch\n            {\n                > 0 => new Version(roslynVersion.Major, roslynVersion.Minor, roslynVersion.Build - 1),\n                _ when roslynVersion.Minor > 0 => new Version(roslynVersion.Major, roslynVersion.Minor - 1),\n                _ => new Version(roslynVersion.Major - 1, 99, 99),\n            };\n        }\n    }\n\n    [TestMethod]\n    public void ReportIssueCore_MinimumRoslyVersion_Is_4_9_2() =>\n        Assert.AreEqual(defaultVersion, IssueReporter.GetMinimumDesignTimeRoslynVersion());\n\n    [TestMethod]\n    [DataRow(null, false)]\n    [DataRow(\"error\", false)]\n    [DataRow(\"error:\", false)]\n    [DataRow(\" error:\", true)]\n    [DataRow(\"   error:\", true)]\n    [DataRow(\"   error\", false)]\n    [DataRow(\" error :\", true)]\n    [DataRow(\" ErRoR :\", true)]\n    [DataRow(\" error   :\", true)]\n    [DataRow(\" error   \", false)]\n    [DataRow(\"error foo\", false)]\n    [DataRow(\"error foo:\", false)]\n    [DataRow(\" error foo:\", true)]\n    [DataRow(\" error foo :\", true)]\n    [DataRow(\" error   foo:\", true)]\n    [DataRow(\" error foo   :\", true)]\n    [DataRow(\" errorfoo:\", false)]\n    [DataRow(\"   error foo:\", true)]\n    [DataRow(\"   eRrOr fOo:\", true)]\n    [DataRow(\"   error in foo:\", false)]\n    [DataRow(\"   error in foo :\", false)]\n    public void IsTextMatchingVbcErrorPattern_ReturnsExpected(string text, bool expectedResult) =>\n        IssueReporter.IsTextMatchingVbcErrorPattern(text).Should().Be(expectedResult);\n\n    private Diagnostic ReportDiagnostic(string filePath, bool hasMappedPath, string diagnosticId = \"id\", Version roslynVersion = null)\n    {\n        roslynVersion ??= defaultVersion;\n        var tree = GetTree(filePath);\n        var diagnostic = GetDiagnostic(diagnosticId, tree, hasMappedPath);\n\n        IssueReporter.SetMinimumDesignTimeRoslynVersion(roslynVersion);\n\n        IssueReporter.ReportIssueCore(\n            x => true,\n            x => new DummyReportingContext(reporter, x, tree),\n            diagnostic);\n\n        IssueReporter.SetMinimumDesignTimeRoslynVersion(defaultVersion);\n\n        return diagnostic;\n    }\n\n    private static SyntaxTree GetTree(string filePath)\n    {\n        var tree = Substitute.For<SyntaxTree>();\n        tree.FilePath.Returns(filePath);\n\n        var root = Substitute.For<SyntaxNode>(null, null, 42);\n        root.Language.Returns(LanguageNames.CSharp);\n        tree.GetRoot().Returns(root);\n        return tree;\n    }\n\n    private static Diagnostic GetDiagnostic(string diagnosticId, SyntaxTree tree, bool hasMappedPath)\n    {\n        var location = GetLocation(tree, hasMappedPath);\n        var descriptor = new DiagnosticDescriptor(diagnosticId, \"title\", \"message\", \"category\", DiagnosticSeverity.Warning, true);\n        return Diagnostic.Create(descriptor, location);\n    }\n\n    private static Location GetLocation(SyntaxTree tree, bool hasMappedPath)\n    {\n        var location = Substitute.For<Location>();\n        location.Kind.Returns(LocationKind.ExternalFile);\n        location.SourceTree.Returns(tree);\n        location.GetMappedLineSpan().Returns(GetPosition(hasMappedPath));\n        return location;\n    }\n\n    private static FileLinePositionSpan GetPosition(bool hasMappedPath)\n    {\n        // Unfortunately, this is the only way to set hasMappedPath to true for LinePositionSpan.\n        // It's a struct, so it cannot be substituted.\n        // And the property does not have a setter, so we have to use reflection at the constructor level.\n        var ctor = typeof(FileLinePositionSpan).GetConstructor(\n            BindingFlags.NonPublic | BindingFlags.Instance,\n            null,\n            [typeof(string), typeof(LinePositionSpan), typeof(bool)],\n            null);\n\n        return (FileLinePositionSpan)ctor.Invoke([string.Empty, default(LinePositionSpan), hasMappedPath]);\n    }\n\n    private class DummyReportingContext(DummyDiagnosticReporter reporter, Diagnostic diagnostic, SyntaxTree tree)\n        : ReportingContext(diagnostic, reporter.ReportDiagnostic, null, tree);\n\n    private class DummyDiagnosticReporter\n    {\n        public int Counter { get; private set; } = 0;\n        public Diagnostic LastDiagnostic { get; private set; }\n\n        public void ReportDiagnostic(Diagnostic diagnostic)\n        {\n            LastDiagnostic = diagnostic;\n            Counter++;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/AnalysisContext/SonarCodeBlockReportingContextTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\n\nnamespace SonarAnalyzer.Core.AnalysisContext.Test;\n\n[TestClass]\npublic class SonarCodeBlockReportingContextTest\n{\n    [TestMethod]\n    public void Properties_ArePropagated()\n    {\n        var cancel = new CancellationToken(true);\n        var codeBlock = SyntaxFactory.Block();\n        var owningSymbol = Substitute.For<ISymbol>();\n        var model = Substitute.For<SemanticModel>();\n        var options = AnalysisScaffolding.CreateOptions();\n        var context = new CodeBlockAnalysisContext(codeBlock, owningSymbol, model, options, _ => { }, _ => true, cancel);\n        var sut = new SonarCodeBlockReportingContext(AnalysisScaffolding.CreateSonarAnalysisContext(), context);\n\n        sut.Tree.Should().BeSameAs(codeBlock.SyntaxTree);\n        sut.Compilation.Should().BeSameAs(model.Compilation);\n        sut.Options.Should().BeSameAs(options);\n        sut.Cancel.Should().Be(cancel);\n        sut.CodeBlock.Should().BeSameAs(codeBlock);\n        sut.OwningSymbol.Should().BeSameAs(owningSymbol);\n        sut.Model.Should().BeSameAs(model);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/AnalysisContext/SonarCodeBlockStartAnalysisContextTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\n\nnamespace SonarAnalyzer.Core.AnalysisContext.Test;\n\n[TestClass]\npublic class SonarCodeBlockStartAnalysisContextTest\n{\n    [TestMethod]\n    public void Properties_ArePropagated()\n    {\n        var cancel = new CancellationToken(true);\n        var codeBlock = SyntaxFactory.Block();\n        var owningSymbol = Substitute.For<ISymbol>();\n        var model = Substitute.For<SemanticModel>();\n        var options = AnalysisScaffolding.CreateOptions();\n        var context = Substitute.For<CodeBlockStartAnalysisContext<SyntaxKind>>(codeBlock, owningSymbol, model, options, cancel);\n        var sut = new SonarCodeBlockStartAnalysisContext<SyntaxKind>(AnalysisScaffolding.CreateSonarAnalysisContext(), context);\n\n        sut.Compilation.Should().BeSameAs(model.Compilation);\n        sut.Options.Should().BeSameAs(options);\n        sut.Cancel.Should().Be(cancel);\n        sut.CodeBlock.Should().BeSameAs(codeBlock);\n        sut.OwningSymbol.Should().BeSameAs(owningSymbol);\n        sut.Model.Should().BeSameAs(model);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/AnalysisContext/SonarCodeFixContextTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.Core.AnalysisContext.Test;\n\n[TestClass]\npublic class SonarCodeFixContextTest\n{\n    [TestMethod]\n    public async Task SonarCodeFixContext_Properties_ReturnRoslynCodeFixContextProperties()\n    {\n        var document = CreateProject().FindDocument(\"MyFile.cs\");\n        var tree = await document.GetSyntaxTreeAsync();\n        var literal = tree.GetRoot().DescendantNodesAndSelf().OfType<LiteralExpressionSyntax>().Single();\n        var cancel = new CancellationToken(true);\n        var diagnostic = Diagnostic.Create(new DiagnosticDescriptor(\"1\", \"title\", \"format\", \"category\", DiagnosticSeverity.Hidden, false), literal.GetLocation());\n        var sonarCodefix = new SonarCodeFixContext(new CodeFixContext(document, diagnostic, (_, _) => { }, cancel));\n\n        sonarCodefix.Cancel.Should().Be(cancel);\n        sonarCodefix.Document.Should().Be(document);\n        sonarCodefix.Diagnostics.Should().Contain(diagnostic);\n        sonarCodefix.Span.Should().Be(new TextSpan(18, 13));\n    }\n\n    [TestMethod]\n    public void SonarCodeFixContext_RegisterDocumentCodeFix_CodeFixRegistered()\n    {\n        var isActionRegistered = false;\n        var document = CreateProject().FindDocument(\"MyFile.cs\");\n        var diagnostic = Diagnostic.Create(new DiagnosticDescriptor(\"1\", \"title\", \"format\", \"category\", DiagnosticSeverity.Hidden, false), Location.None);\n        var sonarCodefix = new SonarCodeFixContext(new CodeFixContext(document, diagnostic, (_, _) => isActionRegistered = true, CancellationToken.None));\n        sonarCodefix.RegisterCodeFix(\"Title\", _ => Task.FromResult(document), [diagnostic]);\n\n        isActionRegistered.Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void SonarCodeFixContext_RegisterSolutionCodeFix_CodeFixRegistered()\n    {\n        var isActionRegistered = false;\n        var document = CreateProject().FindDocument(\"MyFile.cs\");\n        var diagnostic = Diagnostic.Create(new DiagnosticDescriptor(\"1\", \"title\", \"format\", \"category\", DiagnosticSeverity.Hidden, false), Location.None);\n        var sonarCodefix = new SonarCodeFixContext(new CodeFixContext(document, diagnostic, (_, _) => isActionRegistered = true, CancellationToken.None));\n        sonarCodefix.RegisterCodeFix(\"Title\", _ => Task.FromResult(new AdhocWorkspace().CurrentSolution), [diagnostic]);\n\n        isActionRegistered.Should().BeTrue();\n    }\n\n    private static ProjectBuilder CreateProject() =>\n        SolutionBuilder.Create()\n            .AddProject(AnalyzerLanguage.CSharp)\n            .AddSnippet(@\"Console.WriteLine(\"\"Hello World\"\")\", \"MyFile.cs\");\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/AnalysisContext/SonarCompilationReportingContextTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.AnalysisContext.Test;\n\n[TestClass]\npublic class SonarCompilationReportingContextTest\n{\n    [TestMethod]\n    public void Properties_ArePropagated()\n    {\n        var cancel = new CancellationToken(true);\n        var compilation = TestCompiler.CompileCS(\"// Nothing to see here\").Model.Compilation;\n        var options = AnalysisScaffolding.CreateOptions();\n        var context = new CompilationAnalysisContext(compilation, options, _ => { }, _ => true, cancel);\n        var sut = new SonarCompilationReportingContext(AnalysisScaffolding.CreateSonarAnalysisContext(), context);\n\n        sut.Compilation.Should().BeSameAs(compilation);\n        sut.Options.Should().BeSameAs(options);\n        sut.Cancel.Should().Be(cancel);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/AnalysisContext/SonarCompilationStartAnalysisContextTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.AnalysisContext.Test;\n\n[TestClass]\npublic class SonarCompilationStartAnalysisContextTest\n{\n    [TestMethod]\n    public void Properties_ArePropagated()\n    {\n        var cancel = new CancellationToken(true);\n        var compilation = TestCompiler.CompileCS(\"// Nothing to see here\").Model.Compilation;\n        var options = AnalysisScaffolding.CreateOptions();\n        var context = Substitute.For<CompilationStartAnalysisContext>(compilation, options, cancel);\n        var sut = new SonarCompilationStartAnalysisContext(AnalysisScaffolding.CreateSonarAnalysisContext(), context);\n\n        sut.Compilation.Should().BeSameAs(compilation);\n        sut.Options.Should().BeSameAs(options);\n        sut.Cancel.Should().Be(cancel);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/AnalysisContext/SonarSemanticModelReportingContextTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = Microsoft.CodeAnalysis.CSharp;\nusing VB = Microsoft.CodeAnalysis.VisualBasic;\n\nnamespace SonarAnalyzer.Core.AnalysisContext.Test;\n\n[TestClass]\npublic class SonarSemanticModelReportingContextTest\n{\n    [TestMethod]\n    public void Properties_ArePropagated()\n    {\n        var cancel = new CancellationToken(true);\n        var (tree, model) = TestCompiler.CompileCS(\"// Nothing to see here\");\n        var options = AnalysisScaffolding.CreateOptions();\n        var context = new SemanticModelAnalysisContext(model, options, _ => { }, _ => true, cancel);\n        var sut = new SonarSemanticModelReportingContext(AnalysisScaffolding.CreateSonarAnalysisContext(), context);\n\n        sut.Tree.Should().BeSameAs(tree);\n        sut.Compilation.Should().BeSameAs(model.Compilation);\n        sut.Model.Should().BeSameAs(model);\n        sut.Options.Should().BeSameAs(options);\n        sut.Cancel.Should().Be(cancel);\n    }\n\n    [TestMethod]\n    public void RegistrationIsExecuted_SonarAnalysisContext_CS() =>\n        new VerifierBuilder().AddAnalyzer(() => new TestAnalyzerCS((context, g) =>\n            context.RegisterSemanticModelAction(g, c =>\n                c.ReportIssue(TestAnalyzer.Rule, c.Tree.GetRoot().GetFirstToken()))))\n        .AddSnippet(\"\"\"\n        using System; // Noncompliant\n        \"\"\")\n        .Verify();\n\n    [TestMethod]\n    public void RegistrationIsNotExecuted_SonarAnalysisContext_TestScope_CS() =>\n        new VerifierBuilder()\n            .AddTestReference()\n            .AddAnalyzer(() => new TestAnalyzerCS((context, g) =>\n                context.RegisterSemanticModelAction(g, c => Assert.Fail(\"Registration should not happen\"))))\n            .AddSnippet(\"\"\"\n            using System;\n            \"\"\")\n        .VerifyNoIssues();\n\n    [TestMethod]\n    public void RegistrationIsNotExecuted_SonarAnalysisContext_GeneratedCode_CS() =>\n        new VerifierBuilder()\n            .AddAnalyzer(() => new TestAnalyzerCS((context, g) =>\n                context.RegisterSemanticModelAction(g, c => Assert.Fail(\"Action should not be called\"))))\n            .AddSnippet(\"\"\"\n            // <auto-generated>\n            using System;\n            \"\"\")\n        .VerifyNoIssues();\n\n    [TestMethod]\n    public void RegistrationIsExecuted_SonarAnalysisContext_VB() =>\n        new VerifierBuilder().AddAnalyzer(() => new TestAnalyzerVB((context, g) =>\n            context.RegisterSemanticModelAction(g, c =>\n                c.ReportIssue(TestAnalyzer.Rule, c.Tree.GetRoot().GetFirstToken()))))\n        .AddSnippet(\"\"\"\n        Imports System ' Noncompliant\n        \"\"\")\n        .Verify();\n\n    [TestMethod]\n    [CombinatorialData]\n    public void RegistrationInAllFilesIsExecuted_SonarCompilationStartAnalysisContext_CS(\n        [CombinatorialValues(\"\", \"// <auto-generated/>\")] string autoGenerated,\n        [CombinatorialValues(true, false)] bool testScope)\n    {\n        var verifier = new VerifierBuilder().AddAnalyzer(() => new TestAnalyzerCS((context, _) =>\n            context.RegisterCompilationStartAction(start =>\n                start.RegisterSemanticModelActionInAllFiles(c =>\n                {\n                    if (c.Tree.GetRoot().GetFirstToken() is { RawKind: not (int)CS.SyntaxKind.None } token)\n                    {\n                        c.ReportIssue(TestAnalyzer.Rule, token);\n                    }\n                }))))\n            .AddSnippet($$\"\"\"\n            {{autoGenerated}}\n            using System; // Noncompliant\n            \"\"\");\n        if (testScope)\n        {\n            verifier.AddTestReference().VerifyNoIssues();\n        }\n        else\n        {\n            verifier.Verify();\n        }\n    }\n\n    [TestMethod]\n    public void RegistrationIsNotExecuted_SonarCompilationStartAnalysisContext_TestScope_CS() =>\n        new VerifierBuilder()\n            .AddTestReference()\n            .AddAnalyzer(() => new TestAnalyzerCS((context, generatedCodeRecognizer) =>\n                context.RegisterCompilationStartAction(start =>\n                    start.RegisterSemanticModelAction(generatedCodeRecognizer, c => Assert.Fail(\"Registration should not be done\")))))\n            .AddSnippet(\"\"\"\n            using System;\n            \"\"\")\n            .VerifyNoIssues();\n\n    [TestMethod]\n    public void RegistrationIsNotExecuted_SonarCompilationStartAnalysisContext_GeneratedCode_CS() =>\n        new VerifierBuilder().AddAnalyzer(() => new TestAnalyzerCS((context, generatedCodeRecognizer) =>\n            context.RegisterCompilationStartAction(start =>\n                start.RegisterSemanticModelAction(generatedCodeRecognizer, c => Assert.Fail(\"Action should not be called\")))))\n            .AddSnippet(\"\"\"\n            // <auto-generated>\n            using System;\n            \"\"\")\n            .VerifyNoIssues();\n\n    [TestMethod]\n    public void RegistrationIsExecuted_SonarCompilationStartAnalysisContext_VB() =>\n        new VerifierBuilder().AddAnalyzer(() => new TestAnalyzerVB((context, _) =>\n            context.RegisterCompilationStartAction(start =>\n                start.RegisterSemanticModelActionInAllFiles(c =>\n                {\n                    if (c.Tree.GetRoot().GetFirstToken() is { RawKind: not (int)VB.SyntaxKind.None } token)\n                    {\n                        c.ReportIssue(TestAnalyzer.Rule, token);\n                    }\n                }))))\n            .AddSnippet(\"\"\"\n            Imports System ' Noncompliant\n            \"\"\")\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/AnalysisContext/SonarSymbolReportingContextTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\n\nnamespace SonarAnalyzer.Core.AnalysisContext.Test;\n\n[TestClass]\npublic class SonarSymbolReportingContextTest\n{\n    [TestMethod]\n    public void Properties_ArePropagated()\n    {\n        var cancel = new CancellationToken(true);\n        var (tree, model) = TestCompiler.CompileCS(\"public class Sample { }\");\n        var options = AnalysisScaffolding.CreateOptions();\n        var symbol = model.GetDeclaredSymbol(tree.Single<ClassDeclarationSyntax>());\n        var context = new SymbolAnalysisContext(symbol, model.Compilation, options, _ => { }, _ => true, cancel);\n        var sut = new SonarSymbolReportingContext(AnalysisScaffolding.CreateSonarAnalysisContext(), context);\n\n        sut.Compilation.Should().BeSameAs(model.Compilation);\n        sut.Options.Should().BeSameAs(options);\n        sut.Cancel.Should().Be(cancel);\n        sut.Symbol.Should().BeSameAs(symbol);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/AnalysisContext/SonarSyntaxNodeReportingContextTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing StyleCop.Analyzers.Lightup;\n\nnamespace SonarAnalyzer.Core.AnalysisContext.Test;\n\n[TestClass]\npublic class SonarSyntaxNodeReportingContextTest\n{\n    [TestMethod]\n    public void Properties_ArePropagated()\n    {\n        var cancel = new CancellationToken(true);\n        var (tree, model) = TestCompiler.CompileCS(\"// Nothing to see here\");\n        var node = tree.GetRoot();\n        var options = AnalysisScaffolding.CreateOptions();\n        var containingSymbol = Substitute.For<ISymbol>();\n        var context = new SyntaxNodeAnalysisContext(node, containingSymbol, model, options, _ => { }, _ => true, cancel);\n        var sut = new SonarSyntaxNodeReportingContext(AnalysisScaffolding.CreateSonarAnalysisContext(), context);\n\n        sut.Tree.Should().BeSameAs(tree);\n        sut.Compilation.Should().BeSameAs(model.Compilation);\n        sut.Options.Should().BeSameAs(options);\n        sut.Cancel.Should().Be(cancel);\n        sut.Node.Should().BeSameAs(node);\n        sut.Model.Should().BeSameAs(model);\n        sut.ContainingSymbol.Should().BeSameAs(containingSymbol);\n    }\n\n#if NET // .NET Fx shows the message box directly, the exception cannot be caught\n\n    [TestMethod]\n    [DataRow(true)] // Purpose of this is to make sure that the scaffolding works successfully end-to-end\n    [DataRow(false)]\n    public void ReportIssue_TreeNotInCompilation_DoNotReport(bool reportOnCorrectTree)\n    {\n        var analysisContext = AnalysisScaffolding.CreateSonarAnalysisContext();\n        var (tree, model) = TestCompiler.CompileCS(\"// Nothing to see here\");\n        var nodeFromCorrectCompilation = tree.GetRoot();\n        var nodeFromAnotherCompilation = TestCompiler.CompileCS(\"// This is another Compilation with another Tree\").Tree.GetRoot();\n        var rule = AnalysisScaffolding.CreateDescriptorMain();\n        var node = tree.GetRoot();\n        var wasReported = false;\n        var context = new SyntaxNodeAnalysisContext(node, model, AnalysisScaffolding.CreateOptions(), _ => wasReported = true, _ => true, default);\n        var sut = new SonarSyntaxNodeReportingContext(analysisContext, context);\n        try\n        {\n            sut.ReportIssue(rule, reportOnCorrectTree ? nodeFromCorrectCompilation : nodeFromAnotherCompilation);\n        }\n        catch (Exception ex)    // Can't catch internal DebugAssertException\n        {\n            if (reportOnCorrectTree)\n            {\n                throw;  // This should not happen => fail the test\n            }\n            else\n            {\n                ex.GetType().Name.Should().BeOneOf(\"AssertionException\", \"DebugAssertException\");\n                ex.Message.Should().Contain(\"Primary location should be part of the compilation. An AD0001 is raised if this is not the case.\");\n            }\n        }\n\n        wasReported.Should().Be(reportOnCorrectTree);\n    }\n#endif\n\n    [TestMethod]\n    [DataRow(\"class\")]\n#if NET\n    [DataRow(\"record\")]\n#endif\n    public void IsRedundantPrimaryConstructorBaseTypeContext_ReturnsTrueForTypeDeclaration(string type)\n    {\n        // For Roslyn < 4.9.2, the node action is called either twice with different ContainingSymbol.\n        var snippet = $$$\"\"\"\n            public {{{type}}} Base(int i);\n            public {{{type}}} Derived(int i) :\n                Base(i); // This is the node that is asserted\n            //  ^^^^^^^    {{IsRedundantPrimaryConstructorBaseTypeContext is False, ContainingSymbol is Method Derived.Derived(int)}}\n            \"\"\";\n        new VerifierBuilder()\n            .AddAnalyzer(() => new TestAnalyzer([SyntaxKindEx.PrimaryConstructorBaseType], c =>\n                $\"IsRedundantPrimaryConstructorBaseTypeContext is {c.IsRedundantPrimaryConstructorBaseTypeContext()}, ContainingSymbol is {c.ContainingSymbol.Kind} {c.ContainingSymbol.ToDisplayString()}\"))\n            .WithOptions(LanguageOptions.FromCSharp12)\n            .AddSnippet(snippet)\n            .Verify();\n    }\n\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    private sealed class TestAnalyzer : SonarDiagnosticAnalyzer\n    {\n        private readonly SyntaxKind[] syntaxKinds;\n        private readonly Func<SonarSyntaxNodeReportingContext, string> message;\n\n        public DiagnosticDescriptor Rule { get; } = DiagnosticDescriptorFactory.Create(AnalyzerLanguage.CSharp,\n            new RuleDescriptor(\"Test\", \"Test\", \"BUG\", \"BLOCKER\", \"READY\", SourceScope.All, true, \"Test\"), \"{0}\", true, false, false);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => [Rule];\n\n        public TestAnalyzer(SyntaxKind[] syntaxKinds, Func<SonarSyntaxNodeReportingContext, string> message)\n        {\n            this.syntaxKinds = syntaxKinds;\n            this.message = message;\n        }\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(TestGeneratedCodeRecognizer.Instance, c => c.ReportIssue(Rule, c.Node, message(c)), syntaxKinds);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/AnalysisContext/SonarSyntaxTreeReportingContextTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.AnalysisContext.Test;\n\n[TestClass]\npublic class SonarSyntaxTreeReportingContextTest\n{\n    [TestMethod]\n    public void Properties_ArePropagated()\n    {\n        var cancel = new CancellationToken(true);\n        var (tree, model) = TestCompiler.CompileCS(\"// Nothing to see here\");\n        var options = AnalysisScaffolding.CreateOptions();\n        var context = new SyntaxTreeAnalysisContext(tree, options, _ => { }, _ => true, cancel);\n        var sut = new SonarSyntaxTreeReportingContext(AnalysisScaffolding.CreateSonarAnalysisContext(), context, model.Compilation);\n\n        sut.Tree.Should().BeSameAs(tree);\n        sut.Compilation.Should().BeSameAs(model.Compilation);\n        sut.Options.Should().BeSameAs(options);\n        sut.Cancel.Should().Be(cancel);\n    }\n\n    [TestMethod]\n    public void ReportIssue_IgnoreSecondaryLocationOutsideCompilation()\n    {\n        Diagnostic lastDiagnostic = null;\n        var (tree, model) = TestCompiler.CompileCS(\"using System;\");\n        var secondaryTree = TestCompiler.CompileCS(\"namespace Nothing;\").Tree; // This tree is not in the analyzed compilation\n        var context = new SyntaxTreeAnalysisContext(tree, AnalysisScaffolding.CreateOptions(), x => lastDiagnostic = x, _ => true, default);\n        var sut = new SonarSyntaxTreeReportingContext(AnalysisScaffolding.CreateSonarAnalysisContext(), context, model.Compilation);\n        var rule = AnalysisScaffolding.CreateDescriptor(\"Sxxxx\", DiagnosticDescriptorFactory.MainSourceScopeTag);\n\n        sut.ReportIssue(rule, tree.GetRoot(), [new SecondaryLocation(tree.GetRoot().GetLocation(), null)]);\n        lastDiagnostic.Should().NotBeNull();\n        lastDiagnostic.Id.Should().Be(\"Sxxxx\");\n        lastDiagnostic.AdditionalLocations.Should().ContainSingle(\"This secondary location is in compilation\");\n\n        sut.ReportIssue(rule, tree.GetRoot(), [new SecondaryLocation(secondaryTree.GetRoot().GetLocation(), null)]);\n        lastDiagnostic.Should().NotBeNull();\n        lastDiagnostic.Id.Should().Be(\"Sxxxx\");\n        lastDiagnostic.AdditionalLocations.Should().BeEmpty(\"This secondary location is outside the compilation\");\n    }\n\n    [TestMethod]\n    public void ReportIssue_NullArguments_Throws()\n    {\n        var compilation = TestCompiler.CompileCS(\"// Nothing to see here\").Model.Compilation;\n        var context = new SyntaxTreeAnalysisContext(compilation.SyntaxTrees.First(), new AnalyzerOptions([]), _ => { }, _ => true, CancellationToken.None);\n        var sut = new SonarSyntaxTreeReportingContext(AnalysisScaffolding.CreateSonarAnalysisContext(), context, compilation);\n        var rule = AnalysisScaffolding.CreateDescriptor(\"Sxxxx\", DiagnosticDescriptorFactory.MainSourceScopeTag);\n\n        sut.Invoking(x => x.ReportIssue(null, primaryLocation: null, secondaryLocations: [])).Should().Throw<ArgumentNullException>().And.ParamName.Should().Be(\"rule\");\n        sut.Invoking(x => x.ReportIssue(rule, primaryLocation: null, secondaryLocations: null)).Should().NotThrow();\n        sut.Invoking(x => x.ReportIssue(rule, primaryLocation: null, secondaryLocations: [], properties: null)).Should().NotThrow();\n    }\n\n    [TestMethod]\n    public void ReportIssue_PropertiesAndSecondaryLocations_Combine()\n    {\n        Diagnostic lastDiagnostic = null;\n        var (tree, model) = TestCompiler.CompileCS(\"using System;\");\n        var context = new SyntaxTreeAnalysisContext(tree, AnalysisScaffolding.CreateOptions(), x => lastDiagnostic = x, _ => true, default);\n        var sut = new SonarSyntaxTreeReportingContext(AnalysisScaffolding.CreateSonarAnalysisContext(), context, model.Compilation);\n        var rule = AnalysisScaffolding.CreateDescriptor(\"Sxxxx\", DiagnosticDescriptorFactory.MainSourceScopeTag);\n        var secondaryLocation = new SecondaryLocation(tree.GetRoot().GetLocation(), \"secondary\");\n\n        sut.ReportIssue(rule, tree.GetRoot().GetLocation(), [secondaryLocation], properties: new[] { \"custom property\"}.ToImmutableDictionary(x => x));\n        lastDiagnostic.Should().NotBeNull();\n        lastDiagnostic.Id.Should().Be(\"Sxxxx\");\n        lastDiagnostic.Properties.Should().HaveCount(2)\n            .And.Contain(new KeyValuePair<string, string>(\"custom property\", \"custom property\")).And.Contain(new KeyValuePair<string, string>(\"0\", \"secondary\"));\n        lastDiagnostic.AdditionalLocations.Should().ContainSingle(\"secondary\");\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Analyzers/DiagnosticDescriptorFactoryTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Test.Analyzers;\n\n[TestClass]\npublic class DiagnosticDescriptorFactoryTest\n{\n    [TestMethod]\n    public void GetUtilityDescriptor_Should_Contain_NotConfigurable_CustomTag()\n    {\n        var result = DiagnosticDescriptorFactory.CreateUtility(\"Sxxx\", \"Title\");\n#if DEBUG\n        result.CustomTags.Should().NotContain(WellKnownDiagnosticTags.NotConfigurable);\n#else\n        result.CustomTags.Should().Contain(WellKnownDiagnosticTags.NotConfigurable);\n#endif\n    }\n\n    [TestMethod]\n    public void Create_ConfiguresProperties_CS()\n    {\n        var result = DiagnosticDescriptorFactory.Create(AnalyzerLanguage.CSharp, CreateRuleDescriptor(SourceScope.Main, true), \"Sxxxx Message\", null, false, false);\n\n        result.Id.Should().Be(\"Sxxxx\");\n        result.Title.ToString().Should().Be(\"Sxxxx Title\");\n        result.MessageFormat.ToString().Should().Be(\"Sxxxx Message\");\n        result.Category.Should().Be(\"Major Bug\");\n        result.DefaultSeverity.Should().Be(DiagnosticSeverity.Warning);\n        result.IsEnabledByDefault.Should().BeTrue();\n        result.Description.ToString().Should().Be(\"Sxxxx Description\");\n        result.HelpLinkUri.Should().Be(string.Empty);\n        result.CustomTags.Should().BeEquivalentTo(LanguageNames.CSharp, DiagnosticDescriptorFactory.MainSourceScopeTag, DiagnosticDescriptorFactory.SonarWayTag);\n    }\n\n    [TestMethod]\n    public void Create_ConfiguresProperties_VB()\n    {\n        var result = DiagnosticDescriptorFactory.Create(AnalyzerLanguage.VisualBasic, CreateRuleDescriptor(SourceScope.Main, true), \"Sxxxx Message\", null, false, false);\n\n        result.Id.Should().Be(\"Sxxxx\");\n        result.Title.ToString().Should().Be(\"Sxxxx Title\");\n        result.MessageFormat.ToString().Should().Be(\"Sxxxx Message\");\n        result.Category.Should().Be(\"Major Bug\");\n        result.DefaultSeverity.Should().Be(DiagnosticSeverity.Warning);\n        result.IsEnabledByDefault.Should().BeTrue();\n        result.Description.ToString().Should().Be(\"Sxxxx Description\");\n        result.HelpLinkUri.Should().Be(string.Empty);\n        result.CustomTags.Should().BeEquivalentTo(LanguageNames.VisualBasic, DiagnosticDescriptorFactory.MainSourceScopeTag, DiagnosticDescriptorFactory.SonarWayTag);\n    }\n\n    [TestMethod]\n    public void Create_FadeOutCode_HasUnnecessaryTag_HasInfoSeverity()\n    {\n        var result = DiagnosticDescriptorFactory.Create(AnalyzerLanguage.CSharp, CreateRuleDescriptor(SourceScope.Main, true), \"Sxxxx Message\", null, true, false);\n\n        result.DefaultSeverity.Should().Be(DiagnosticSeverity.Info);\n        result.CustomTags.Should().Contain(WellKnownDiagnosticTags.Unnecessary);\n    }\n\n    [TestMethod]\n    [CombinatorialData]\n    public void Create_CompilationEndDiagnostic([CombinatorialValues(LanguageNames.CSharp, LanguageNames.VisualBasic)] string language, [CombinatorialValues(true, false)] bool isCompilationEnd)\n    {\n        var result = DiagnosticDescriptorFactory.Create(AnalyzerLanguage.FromName(language), CreateRuleDescriptor(SourceScope.Main, true), \"Sxxxx Message\", null, false, isCompilationEnd);\n\n        if (isCompilationEnd)\n        {\n            result.CustomTags.Should().Contain(DiagnosticDescriptorFactory.CompilationEnd);\n        }\n        else\n        {\n            result.CustomTags.Should().NotContain(DiagnosticDescriptorFactory.CompilationEnd);\n        }\n    }\n\n    [TestMethod]\n    public void Create_HasCorrectSonarWayTag()\n    {\n        CreateTags(true).Should().Contain(DiagnosticDescriptorFactory.SonarWayTag);\n        CreateTags(false).Should().NotContain(DiagnosticDescriptorFactory.SonarWayTag);\n\n        static IEnumerable<string> CreateTags(bool sonarWay) =>\n            DiagnosticDescriptorFactory.Create(AnalyzerLanguage.CSharp, CreateRuleDescriptor(SourceScope.Main, sonarWay), \"Sxxxx Message\", null, false, false).CustomTags;\n    }\n\n    [TestMethod]\n    public void Create_HasCorrectScopeTags()\n    {\n        CreateTags(SourceScope.Main).Should().Contain(DiagnosticDescriptorFactory.MainSourceScopeTag).And.NotContain(DiagnosticDescriptorFactory.TestSourceScopeTag);\n        CreateTags(SourceScope.Tests).Should().Contain(DiagnosticDescriptorFactory.TestSourceScopeTag).And.NotContain(DiagnosticDescriptorFactory.MainSourceScopeTag);\n        CreateTags(SourceScope.All).Should().Contain(DiagnosticDescriptorFactory.MainSourceScopeTag, DiagnosticDescriptorFactory.TestSourceScopeTag);\n\n        static IEnumerable<string> CreateTags(SourceScope scope) =>\n            DiagnosticDescriptorFactory.Create(AnalyzerLanguage.CSharp, CreateRuleDescriptor(scope, true), \"Sxxxx Message\", null, false, false).CustomTags;\n    }\n\n    [TestMethod]\n    public void Create_UnexpectedType_Throws()\n    {\n        var rule = new RuleDescriptor(\"Sxxxx\", string.Empty, \"Lorem Ipsum\", string.Empty, string.Empty, SourceScope.Main, true, string.Empty);\n        var f = () => DiagnosticDescriptorFactory.Create(AnalyzerLanguage.CSharp, rule, string.Empty, null, false, false);\n        f.Should().Throw<UnexpectedValueException>().WithMessage(\"Unexpected Type value: Lorem Ipsum\");\n    }\n\n    [TestMethod]\n    [DataRow(\"Minor\", \"BUG\", \"Minor Bug\")]\n    [DataRow(\"Major\", \"BUG\", \"Major Bug\")]\n    [DataRow(\"Major\", \"CODE_SMELL\", \"Major Code Smell\")]\n    [DataRow(\"Major\", \"VULNERABILITY\", \"Major Vulnerability\")]\n    [DataRow(\"Major\", \"SECURITY_HOTSPOT\", \"Major Security Hotspot\")]\n    [DataRow(\"Critical\", \"BUG\", \"Critical Bug\")]\n    [DataRow(\"Blocker\", \"BUG\", \"Blocker Bug\")]\n    [DataRow(\"Whatever Xxx\", \"BUG\", \"Whatever Xxx Bug\")]\n    public void Create_ComputesCategory(string severity, string type, string expected)\n    {\n        var rule = new RuleDescriptor(\"Sxxxx\", string.Empty, type, severity, string.Empty, SourceScope.Main, true, string.Empty);\n        DiagnosticDescriptorFactory.Create(AnalyzerLanguage.CSharp, rule, \"Sxxxx Message\", null, false, false).Category.Should().Be(expected);\n    }\n\n    private static RuleDescriptor CreateRuleDescriptor(SourceScope scope, bool sonarWay) =>\n        new(\"Sxxxx\", \"Sxxxx Title\", \"BUG\", \"Major\", string.Empty, scope, sonarWay, \"Sxxxx Description\");\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Common/AnalyzerAdditionalFileTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Test.Common;\n\n[TestClass]\npublic class AnalyzerAdditionalFileTest\n{\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    public void AnalyzerAdditionalFile_GetText()\n    {\n        var path = TestFiles.WriteFile(TestContext, \"AdditionalFile.txt\", \"some sample content\");\n        var additionalFile = new AnalyzerAdditionalFile(path);\n        var content = additionalFile.GetText();\n        content.ToString().Should().Be(\"some sample content\");\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Common/AnalyzerConfigurationTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Text;\nusing static SonarAnalyzer.Core.Common.AnalyzerConfiguration;\n\nnamespace SonarAnalyzer.Core.Test.Common;\n\n[TestClass]\npublic class AnalyzerConfigurationTest\n{\n    private const string FirstSonarLintFilePath = @\"bar\\SonarLint.xml\";\n    private const string FirstSonarLintFileContent = \"fake SonarLintXml content 1\";\n    private const string FirstRuleId = \"S0000\";\n    private const string SecondSonarLintFilePath = @\"qix\\SonarLint.xml\";\n    private const string SecondSonarLintFileContent = \"fake SonarLintXml content 2\";\n    private const string SecondRuleId = \"S9999\";\n    private IRuleLoader ruleLoader;\n\n    [TestInitialize]\n    public void Initialize()\n    {\n        ruleLoader = Substitute.For<IRuleLoader>();\n        ruleLoader.GetEnabledRules(FirstSonarLintFileContent).Returns(new HashSet<string> { FirstRuleId });\n        ruleLoader.GetEnabledRules(SecondSonarLintFileContent).Returns(new HashSet<string> { SecondRuleId });\n    }\n\n    [TestMethod]\n    public void AlwaysEnabled_WhenNotInitialized_ReturnsTrue() =>\n        AlwaysEnabled.IsEnabled(\"S101\").Should().BeTrue();\n\n    [TestMethod]\n    public void AlwaysEnabled_AnyValue_ReturnsTrue()\n    {\n        AlwaysEnabled.IsEnabled(null).Should().BeTrue();\n        AlwaysEnabled.IsEnabled(string.Empty).Should().BeTrue();\n        AlwaysEnabled.IsEnabled(\"foo\").Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void ForceSonarCfg_DisabledByDefault()\n    {\n        AlwaysEnabled.ForceSonarCfg.Should().BeFalse();\n        new HotspotConfiguration(ruleLoader).ForceSonarCfg.Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void ForceSonarCfg_DisabledByDefault_ExistExceptionalConfig()\n    {\n        AlwaysEnabled.ForceSonarCfg.Should().BeFalse();\n        new HotspotConfiguration(ruleLoader).ForceSonarCfg.Should().BeFalse();\n        AlwaysEnabledWithSonarCfg.ForceSonarCfg.Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void AlwaysEnabled_IgnoresInitialize()\n    {\n        var sut = AlwaysEnabled;\n\n        sut.Initialize(null);\n        sut.IsEnabled(FirstRuleId).Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void HotspotConfiguration_WhenInitializeIsCalledWithDifferentSonarLintPaths_UpdatesEnabledRules()\n    {\n        var sut = new HotspotConfiguration(ruleLoader);\n\n        // act\n        Initialize(sut, FirstSonarLintFilePath, FirstSonarLintFileContent);\n\n        // assert\n        sut.IsEnabled(FirstRuleId).Should().BeTrue();\n        sut.IsEnabled(SecondRuleId).Should().BeFalse();\n\n        // act\n        Initialize(sut, SecondSonarLintFilePath, SecondSonarLintFileContent);\n\n        // assert\n        sut.IsEnabled(FirstRuleId).Should().BeFalse();\n        sut.IsEnabled(SecondRuleId).Should().BeTrue();\n\n        ruleLoader.Received(1).GetEnabledRules(FirstSonarLintFileContent);\n        ruleLoader.Received(1).GetEnabledRules(SecondSonarLintFileContent);\n    }\n\n    [TestMethod]\n    public void HotspotConfiguration_WhenInitializedTwiceWithTheSameFile_DoesNotUpdateEnabledRules()\n    {\n        var sut = new HotspotConfiguration(ruleLoader);\n\n        // act\n        Initialize(sut, FirstSonarLintFilePath, FirstSonarLintFileContent);\n        Initialize(sut, FirstSonarLintFilePath, FirstSonarLintFileContent);\n\n        // assert\n        ruleLoader.Received(1).GetEnabledRules(Arg.Any<string>());\n        ruleLoader.Received(1).GetEnabledRules(FirstSonarLintFileContent);\n    }\n\n    [TestMethod]\n    public void HotspotConfiguration_WhenInitializeIsSecondTimeWithNonSonarLint_DoesNotUpdateEnabledRules()\n    {\n        var sut = new HotspotConfiguration(ruleLoader);\n\n        // act\n        Initialize(sut, FirstSonarLintFilePath, FirstSonarLintFileContent);\n        Initialize(sut, \"Foo.xml\", \"fake SonarLintXml content\");\n\n        // assert\n        ruleLoader.Received(1).GetEnabledRules(Arg.Any<string>());\n        ruleLoader.Received(1).GetEnabledRules(FirstSonarLintFileContent);\n    }\n\n    [TestMethod]\n    public void HotspotConfiguration_WhenIsEnabledWithoutInitialized_ThrowException()\n    {\n        var sut = new HotspotConfiguration(ruleLoader);\n        sut.Invoking(x => x.IsEnabled(string.Empty)).Should().Throw<InvalidOperationException>().WithMessage(\"Call Initialize() before calling IsEnabled().\");\n    }\n\n    [TestMethod]\n    public void HotspotConfiguration_WhenIsInitializedWithNull_ThrowsException()\n    {\n        var sut = new HotspotConfiguration(ruleLoader);\n        sut.Invoking(x => x.Initialize(null)).Should().Throw<NullReferenceException>();\n    }\n\n    [TestMethod]\n    public void HotspotConfiguration_GivenDifferentFileName_WillNotFinishInitialization()\n    {\n        var sut = new HotspotConfiguration(ruleLoader);\n        Initialize(sut, \"FooBarSonarLint.xml\", \"fake SonarLintXml content\");\n\n        ruleLoader.DidNotReceive().GetEnabledRules(Arg.Any<string>());\n    }\n\n    private static void Initialize(HotspotConfiguration sut, string path, string content) =>\n        sut.Initialize(new AnalyzerOptions(GetAdditionalFiles(path, content)));\n\n    private static ImmutableArray<AdditionalText> GetAdditionalFiles(string path, string content)\n    {\n        var additionalText = Substitute.For<AdditionalText>();\n        additionalText.Path.Returns(path);\n        additionalText.GetText(default).Returns(SourceText.From(content));\n        return [additionalText];\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Common/AnalyzerLanguageTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Test.Common;\n\n[TestClass]\npublic class AnalyzerLanguageTest\n{\n    [TestMethod]\n    public void ToString_ReturnsLanguageName()\n    {\n        AnalyzerLanguage.CSharp.ToString().Should().Be(\"C#\");\n        AnalyzerLanguage.VisualBasic.ToString().Should().Be(\"Visual Basic\");\n    }\n\n    [TestMethod]\n    [DataRow(\"File.cs\")]\n    [DataRow(\"File.Cs\")]\n    [DataRow(\"File.CS\")]\n    [DataRow(\"File.razor\")]\n    [DataRow(@\"C:\\Project\\File.cs\")]\n    [DataRow(@\"/c/Project/File.cs\")]\n    [DataRow(@\"/c/Project/File.razor\")]\n    public void FromPath_CS(string path) =>\n        AnalyzerLanguage.FromPath(path).Should().Be(AnalyzerLanguage.CSharp);\n\n    [TestMethod]\n    [DataRow(\"File.vb\")]\n    [DataRow(\"File.Vb\")]\n    [DataRow(\"File.VB\")]\n    [DataRow(@\"C:\\Project\\File.vb\")]\n    [DataRow(@\"/c/Project/File.vb\")]\n    public void FromPath_VB(string path) =>\n        AnalyzerLanguage.FromPath(path).Should().Be(AnalyzerLanguage.VisualBasic);\n\n    [TestMethod]\n    [DataRow(\"File.txt\", \".txt\")]\n    [DataRow(\"\", \"\")]\n    [DataRow(null, \"\")]\n    public void FromPath_UnexpectedThrows(string path, string message)\n    {\n        var action = () => AnalyzerLanguage.FromPath(path);\n        action.Should().Throw<NotSupportedException>().WithMessage($\"Unsupported file extension: {message}\");\n    }\n\n    [TestMethod]\n    public void FromName()\n    {\n        AnalyzerLanguage.FromName(LanguageNames.CSharp).Should().Be(AnalyzerLanguage.CSharp);\n        AnalyzerLanguage.FromName(LanguageNames.VisualBasic).Should().Be(AnalyzerLanguage.VisualBasic);\n    }\n\n    [TestMethod]\n    public void FromName_UnexpectedThrows() =>\n        ((Func<AnalyzerLanguage>)(() => AnalyzerLanguage.FromName(LanguageNames.FSharp))).Should().Throw<NotSupportedException>().WithMessage(\"Unsupported language name: F#\");\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Common/BidirectionalDictionaryTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Test.Common;\n\n[TestClass]\npublic class BidirectionalDictionaryTest\n{\n    private BidirectionalDictionary<int, int> sut;\n\n    [TestInitialize]\n    public void Initialize() =>\n        sut = new BidirectionalDictionary<int, int>();\n\n    [TestMethod]\n    public void AddKeyA_AlreadyExists_Throws()\n    {\n        sut.Add(1, 2);\n        sut.Invoking(x => x.Add(1, 3)).Should().Throw<ArgumentException>().WithMessage(\"An element with the same key already exists in the BidirectionalDictionary.\");\n    }\n\n    [TestMethod]\n    public void AddKeyB_AlreadyExists_Throws()\n    {\n        sut.Add(1, 2);\n        sut.Invoking(x => x.Add(3, 2)).Should().Throw<ArgumentException>().WithMessage(\"An element with the same key already exists in the BidirectionalDictionary.\");\n    }\n\n    [TestMethod]\n    public void Keys_ReturnsCorrectKeys()\n    {\n        sut.Add(1, 11);\n        sut.Add(2, 12);\n        sut.Add(3, 13);\n        sut.Add(4, 14);\n        sut.Add(5, 15);\n\n        sut.AKeys.Should().BeEquivalentTo(new[] {1, 2, 3, 4, 5});\n        sut.BKeys.Should().BeEquivalentTo(new[] {11, 12, 13, 14, 15});\n    }\n\n    [TestMethod]\n    public void GetByA_ElementExists_ReturnsCorrectElement()\n    {\n        sut.Add(1, 2);\n        sut.GetByA(1).Should().Be(2);\n    }\n\n    [TestMethod]\n    public void GetByB_ElementExists_ReturnsCorrectElement()\n    {\n        sut.Add(1, 2);\n        sut.GetByB(2).Should().Be(1);\n    }\n\n    [TestMethod]\n    public void GetByA_ElementDoesNotExist_ThrowsException() =>\n        sut.Invoking(x => x.GetByA(1)).Should().Throw<KeyNotFoundException>();\n\n    [TestMethod]\n    public void GetByB_ElementDoesNotExist_ThrowsException() =>\n        sut.Invoking(x => x.GetByB(1)).Should().Throw<KeyNotFoundException>();\n\n    [TestMethod]\n    public void ContainsKeyByA_ElementExists_ReturnsTrue()\n    {\n        sut.Add(4, 2);\n        sut.ContainsKeyByA(4).Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void ContainsKeyByB_ElementExists_ReturnsTrue()\n    {\n        sut.Add(4, 2);\n        sut.ContainsKeyByB(2).Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void ContainsKeyByA_ElementDoesNotExist_ReturnsFalse()\n    {\n        sut.Add(2, 3);\n        sut.ContainsKeyByA(1).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void ContainsKeyByB_ElementDoesNotExist_ReturnsFalse()\n    {\n        sut.Add(2, 3);\n        sut.ContainsKeyByB(1).Should().BeFalse();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Common/DisjointSetsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Test.Common;\n\n[TestClass]\npublic class DisjointSetsTest\n{\n    private static readonly string[] FirstSixPositiveInts = Enumerable.Range(1, 6).Select(x => x.ToString()).ToArray();\n\n    [TestMethod]\n    public void FindRootAndUnion_AreConsistent()\n    {\n        var sets = new DisjointSets(FirstSixPositiveInts);\n        foreach (var element in FirstSixPositiveInts)\n        {\n            sets.FindRoot(element).Should().Be(element);\n        }\n\n        sets.Union(\"1\", \"1\");\n        sets.FindRoot(\"1\").Should().Be(\"1\");                // Reflexivity\n        sets.Union(\"1\", \"2\");\n        sets.FindRoot(\"1\").Should().Be(sets.FindRoot(\"2\")); // Correctness\n        sets.Union(\"1\", \"2\");\n        sets.FindRoot(\"1\").Should().Be(sets.FindRoot(\"2\")); // Idempotency\n        sets.Union(\"2\", \"1\");\n        sets.FindRoot(\"1\").Should().Be(sets.FindRoot(\"2\")); // Symmetry\n\n        sets.FindRoot(\"3\").Should().Be(\"3\");\n        sets.Union(\"2\", \"3\");\n        sets.FindRoot(\"2\").Should().Be(sets.FindRoot(\"3\"));\n        sets.FindRoot(\"1\").Should().Be(sets.FindRoot(\"3\")); // Transitivity\n        sets.Union(\"3\", \"4\");\n        sets.FindRoot(\"1\").Should().Be(sets.FindRoot(\"4\")); // Double transitivity\n        sets.Union(\"4\", \"1\");\n        sets.FindRoot(\"4\").Should().Be(sets.FindRoot(\"1\")); // Idempotency after transitivity\n    }\n\n    [TestMethod]\n    public void GetAllSetsAndUnion_AreConsistent()\n    {\n        var sets = new DisjointSets(FirstSixPositiveInts);\n        AssertSets([[\"1\"], [\"2\"], [\"3\"], [\"4\"], [\"5\"], [\"6\"]], sets); // Initial state\n        sets.Union(\"1\", \"2\");\n        AssertSets([[\"1\", \"2\"], [\"3\"], [\"4\"], [\"5\"], [\"6\"]], sets);   // Correctness\n        sets.Union(\"1\", \"2\");\n        AssertSets([[\"1\", \"2\"], [\"3\"], [\"4\"], [\"5\"], [\"6\"]], sets);   // Idempotency\n\n        sets.Union(\"2\", \"3\");\n        AssertSets([[\"1\", \"2\", \"3\"], [\"4\"], [\"5\"], [\"6\"]], sets);     // Transitivity\n        sets.Union(\"1\", \"3\");\n        AssertSets([[\"1\", \"2\", \"3\"], [\"4\"], [\"5\"], [\"6\"]], sets);     // Idempotency after transitivity\n\n        sets.Union(\"4\", \"5\");\n        AssertSets([[\"1\", \"2\", \"3\"], [\"4\", \"5\"], [\"6\"]], sets);       // Separated trees\n        sets.Union(\"3\", \"4\");\n        AssertSets([[\"1\", \"2\", \"3\", \"4\", \"5\"], [\"6\"]], sets);         // Merged trees\n    }\n\n    [TestMethod]\n    public void GetAllSetsAndUnion_OfNestedTrees()\n    {\n        var sets = new DisjointSets(FirstSixPositiveInts);\n        sets.Union(\"1\", \"2\");\n        sets.Union(\"3\", \"4\");\n        sets.Union(\"5\", \"6\");\n        AssertSets([[\"1\", \"2\"], [\"3\", \"4\"], [\"5\", \"6\"]], sets); // Merge of 1-height trees\n        sets.Union(\"2\", \"3\");\n        AssertSets([[\"1\", \"2\", \"3\", \"4\"], [\"5\", \"6\"]], sets);   // Merge of 2-height trees\n        sets.Union(\"4\", \"5\");\n        AssertSets([[\"1\", \"2\", \"3\", \"4\", \"5\", \"6\"]], sets);     // Merge of 1-height tree and 2-height tree\n    }\n\n    [TestMethod]\n    public void GetAllSets_ReturnsSortedSets()\n    {\n        var sets = new DisjointSets([\"3\", \"2\", \"1\"]);\n        AssertSets([[\"1\"], [\"2\"], [\"3\"]], sets);\n        sets.Union(\"3\", \"1\");\n        AssertSets([[\"1\", \"3\"], [\"2\"]], sets);\n    }\n\n    private static void AssertSets(List<List<string>> expected, DisjointSets sets) =>\n        sets.GetAllSets().Should().BeEquivalentTo(expected, x => x.WithStrictOrdering());\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Common/FixAllProviders/DocumentBasedFixAllProviderTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\n\nnamespace SonarAnalyzer.Core.Test.Common.FixAllProviders;\n\n[TestClass]\npublic class DocumentBasedFixAllProviderTest\n{\n    [TestMethod]\n    [DataRow(FixAllScope.Document, \"Fix all 'SDummy' in 'MyFile1.cs'\")]\n    [DataRow(FixAllScope.Project, \"Fix all 'SDummy' in 'project0'\")]\n    [DataRow(FixAllScope.Solution, \"Fix all 'SDummy' in Solution\")]\n    public async Task GetFixAsync_ForSupportedScope_HasCorrectTitle(FixAllScope scope, string expectedTitle)\n    {\n        var codeFix = new DummyCodeFixCS();\n        var document = CreateProject().FindDocument(\"MyFile1.cs\");\n        var fixAllContext = new FixAllContext(document, codeFix, scope, \"Dummy Action\", codeFix.FixableDiagnosticIds, new FixAllDiagnosticProvider(null), default);\n        var result = await SonarAnalyzer.Core.Common.DocumentBasedFixAllProvider.Instance.GetFixAsync(fixAllContext);\n        result.Title.Should().Be(expectedTitle);\n    }\n\n    [TestMethod]\n    public async Task GetFixAsync_ForUnsupportedScope_ReturnsNull()\n    {\n        var codeFix = new DummyCodeFixCS();\n        var document = CreateProject().FindDocument(\"MyFile1.cs\");\n        var fixAllContext = new FixAllContext(document, codeFix, FixAllScope.Custom, \"Dummy Action\", codeFix.FixableDiagnosticIds, new FixAllDiagnosticProvider(null), default);\n        var result = await SonarAnalyzer.Core.Common.DocumentBasedFixAllProvider.Instance.GetFixAsync(fixAllContext);\n        result.Should().BeNull();\n    }\n\n    [TestMethod]\n    public async Task GetFixAsync_ForDocument_OnlyTheDocumentChanged()\n    {\n        var codeFix = new DummyCodeFixCS();\n        var project = CreateProject();\n        var document1Before = project.FindDocument(\"MyFile1.cs\");\n        var document2Before = project.FindDocument(\"MyFile2.cs\");\n        var compilation = project.GetCompilation();\n        var diagnostics = DiagnosticVerifier.AnalyzerDiagnostics(compilation, new DummyAnalyzerCS(), CompilationErrorBehavior.Ignore).ToImmutableArray();\n\n        var fixAllContext = new FixAllContext(document1Before, codeFix, FixAllScope.Document, \"Dummy Action\", codeFix.FixableDiagnosticIds, new FixAllDiagnosticProvider(diagnostics), default);\n        var result = await SonarAnalyzer.Core.Common.DocumentBasedFixAllProvider.Instance.GetFixAsync(fixAllContext);\n        var executedOperation = await result.GetOperationsAsync(default);\n        var document1After = executedOperation.OfType<ApplyChangesOperation>().Single().ChangedSolution.GetDocument(document1Before.Id);\n        var document2After = executedOperation.OfType<ApplyChangesOperation>().Single().ChangedSolution.GetDocument(document2Before.Id);\n\n        var document1BeforeRoot = await document1Before.GetSyntaxRootAsync();\n        var document1BeforeContent = document1BeforeRoot.GetText().ToString();\n        var document1AfterRoot = await document1After.GetSyntaxRootAsync();\n        var document1AfterContent = document1AfterRoot.GetText().ToString();\n\n        document1BeforeContent.Should().NotBe(document1AfterContent);\n\n        var document2BeforeRoot = await document2Before.GetSyntaxRootAsync();\n        var document2BeforeContent = document2BeforeRoot.GetText().ToString();\n        var document2AfterRoot = await document2After.GetSyntaxRootAsync();\n        var document2AfterContent = document2AfterRoot.GetText().ToString();\n\n        document2BeforeContent.Should().Be(document2AfterContent);\n    }\n\n    [TestMethod]\n    [DataRow(FixAllScope.Project)]\n    [DataRow(FixAllScope.Solution)]\n    public async Task GetFixAsync_ForProjectAndSolution_AllFilesAreFixed(FixAllScope scope)\n    {\n        var codeFix = new DummyCodeFixCS();\n        var project = CreateProject();\n        var document1Before = project.FindDocument(\"MyFile1.cs\");\n        var document2Before = project.FindDocument(\"MyFile2.cs\");\n        var compilation = project.GetCompilation();\n        var diagnostics = DiagnosticVerifier.AnalyzerDiagnostics(compilation, new DummyAnalyzerCS(), CompilationErrorBehavior.Ignore).ToImmutableArray();\n\n        var fixAllContext = new FixAllContext(project.Project, codeFix, scope, \"Dummy Action\", codeFix.FixableDiagnosticIds, new FixAllDiagnosticProvider(diagnostics), default);\n        var result = await SonarAnalyzer.Core.Common.DocumentBasedFixAllProvider.Instance.GetFixAsync(fixAllContext);\n        var executedOperation = await result.GetOperationsAsync(default);\n        var document1After = executedOperation.OfType<ApplyChangesOperation>().Single().ChangedSolution.GetDocument(document1Before.Id);\n        var document2After = executedOperation.OfType<ApplyChangesOperation>().Single().ChangedSolution.GetDocument(document2Before.Id);\n\n        var document1BeforeRoot = await document1Before.GetSyntaxRootAsync();\n        var document1BeforeContent = document1BeforeRoot.GetText().ToString();\n        var document1AfterRoot = await document1After.GetSyntaxRootAsync();\n        var document1AfterContent = document1AfterRoot.GetText().ToString();\n\n        document1BeforeContent.Should().NotBe(document1AfterContent);\n\n        var document2BeforeRoot = await document2Before.GetSyntaxRootAsync();\n        var document2BeforeContent = document2BeforeRoot.GetText().ToString();\n        var document2AfterRoot = await document2After.GetSyntaxRootAsync();\n        var document2AfterContent = document2AfterRoot.GetText().ToString();\n\n        document2BeforeContent.Should().NotBe(document2AfterContent);\n    }\n\n    private static ProjectBuilder CreateProject() =>\n        SolutionBuilder.Create()\n            .AddProject(AnalyzerLanguage.CSharp)\n            .AddSnippet(@\"public class C1 { public void M1() { int number1 = 1 } };\", \"MyFile1.cs\")\n            .AddSnippet(@\"public class C2 { public void M2() { int number2 = 2 } };\", \"MyFile2.cs\");\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Common/HashCodeTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\n#pragma warning disable CA1825 // Avoid zero-length array allocations\n\nusing HashCode = SonarAnalyzer.Core.Common.HashCode;\n\nnamespace SonarAnalyzer.Core.Common.Test;\n\n[TestClass]\npublic class HashCodeTest\n{\n    [TestMethod]\n    [DataRow(null)]\n    [DataRow(\"Lorem Ipsum\")]\n    public void Combine_ProducesDifferentResults(string input)\n    {\n        var hash2 = HashCode.Combine(input, input);\n        var hash3 = HashCode.Combine(input, input, input);\n        var hash4 = HashCode.Combine(input, input, input, input);\n        var hash5 = HashCode.Combine(input, input, input, input, input);\n\n        hash2.Should().NotBe(0);\n        hash3.Should().NotBe(0).And.NotBe(hash2);\n        hash4.Should().NotBe(0).And.NotBe(hash2).And.NotBe(hash3);\n        hash5.Should().NotBe(0).And.NotBe(hash2).And.NotBe(hash3).And.NotBe(hash4);\n    }\n\n    [TestMethod]\n    public void DictionaryContentHash_StableForImmutableDictionary()\n    {\n        var numbers = Enumerable.Range(1, 1000);\n        var dict1 = numbers.ToImmutableDictionary(x => x, x => x);\n        var dict2 = numbers.OrderByDescending(x => x).ToImmutableDictionary(x => x, x => x);\n        var hashCode1 = HashCode.DictionaryContentHash(dict1);\n        var hashCode2 = HashCode.DictionaryContentHash(dict2);\n        hashCode1.Should().Be(hashCode2);\n    }\n\n    [TestMethod]\n    public void EnumerableUnorderedContentHash_Empty()\n    {\n        var ints = new int[0];\n        var strings = new string[0];\n\n        HashCode.EnumerableUnorderedContentHash(ints).Should().Be(HashCode.EnumerableUnorderedContentHash(new int[0]));\n        HashCode.EnumerableUnorderedContentHash(strings).Should().Be(HashCode.EnumerableUnorderedContentHash(strings));\n        HashCode.EnumerableUnorderedContentHash(ints).Should().Be(HashCode.EnumerableUnorderedContentHash(strings));\n    }\n\n    [TestMethod]\n    public void EnumerableUnorderedContentHash_Order()\n    {\n        var ints1 = new[] { 0, 1, 2 };\n        var ints2 = new[] { 2, 1, 0 };\n        var ints3 = new[] { 0, 1, 8 };\n\n        HashCode.EnumerableUnorderedContentHash(ints1).Should().Be(HashCode.EnumerableUnorderedContentHash(ints2)).And.NotBe(0);\n        HashCode.EnumerableUnorderedContentHash(ints1).Should().NotBe(HashCode.EnumerableUnorderedContentHash(ints3));\n    }\n\n    [TestMethod]\n    public void EnumerableUnorderedContentHash_DifferentLength()\n    {\n        var ints1 = new[] { 0, 1, 2 };\n        var ints2 = new[] { 0, 1, 2, 3 };\n\n        HashCode.EnumerableUnorderedContentHash(ints1).Should().NotBe(HashCode.EnumerableUnorderedContentHash(ints2));\n    }\n\n    [TestMethod]\n    public void EnumerableOrderedContentHash_Empty()\n    {\n        var ints = new int[0];\n        var strings = new string[0];\n\n        HashCode.EnumerableOrderedContentHash(ints).Should().Be(HashCode.EnumerableOrderedContentHash(new int[0]));\n        HashCode.EnumerableOrderedContentHash(strings).Should().Be(HashCode.EnumerableOrderedContentHash(strings));\n        HashCode.EnumerableOrderedContentHash(ints).Should().Be(HashCode.EnumerableOrderedContentHash(strings));\n    }\n\n    [TestMethod]\n    public void EnumerableOrderedContentHash_Order()\n    {\n        var ints1 = new[] { 0, 1, 2 };\n        var ints2 = new[] { 0, 1, 2 };\n        var ints3 = new[] { 2, 1, 0 };\n        var ints4 = new[] { 0, 1, 8 };\n\n        HashCode.EnumerableOrderedContentHash(ints1).Should().Be(HashCode.EnumerableOrderedContentHash(ints2)).And.NotBe(0);\n        HashCode.EnumerableOrderedContentHash(ints1).Should().NotBe(HashCode.EnumerableOrderedContentHash(ints3));\n        HashCode.EnumerableOrderedContentHash(ints1).Should().NotBe(HashCode.EnumerableOrderedContentHash(ints4));\n    }\n\n    [TestMethod]\n    public void EnumerableOrderedContentHash_DifferentLength()\n    {\n        var ints1 = new[] { 0, 1, 2 };\n        var ints2 = new[] { 0, 1, 2, 3 };\n\n        HashCode.EnumerableOrderedContentHash(ints1).Should().NotBe(HashCode.EnumerableOrderedContentHash(ints2));\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Common/MultiValueDictionaryTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Test.Common;\n\n[TestClass]\npublic class MultiValueDictionaryTest\n{\n    [TestMethod]\n    public void MultiValueDictionary_Add()\n    {\n        var mvd = new MultiValueDictionary<int, int>\n        {\n            { 5, 42 },\n            { 5, 42 },\n            { 42, 42 }\n        };\n\n        mvd.Keys.Should().HaveCount(2);\n        mvd[5].Should().HaveCount(2);\n    }\n\n    [TestMethod]\n    public void MultiValueDictionary_Add_Set()\n    {\n        var mvd = MultiValueDictionary<int, int>.Create<HashSet<int>>();\n        mvd.Add(5, 42);\n        mvd.Add(5, 42);\n        mvd.Add(42, 42);\n\n        mvd.Keys.Should().HaveCount(2);\n        mvd[5].Should().ContainSingle();\n    }\n\n    [TestMethod]\n    public void MultiValueDictionary_AddRange()\n    {\n        var mvd = new MultiValueDictionary<int, int>();\n        mvd.AddRangeWithKey(5, new[] { 42, 42 });\n\n        mvd[5].Should().HaveCount(2);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Common/NaturalLanguageDetectorTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Test.Common;\n\n[TestClass]\npublic class NaturalLanguageDetectorTest\n{\n    [TestMethod]\n    [DataRow(null, 0)]\n    [DataRow(\"Hello02139710238712987\", 1.3262863)]\n    [DataRow(\"This is an english text!\", 4.6352161)]\n    [DataRow(\"Hello\", 4.7598878)]\n    [DataRow(\"Hello hello hello hello\", 4.7598878)]\n    [DataRow(\"Hleol\", 2.0215728)]\n    [DataRow(\"Hleol hleol\", 2.0215728)]\n    [DataRow(\"Hleol Hello hleol\", 2.9343445)]\n    [DataRow(\"Hleol Incomprehensibility hleol\", 3.5209606)]\n    [DataRow(\"Incomprehensibility \", 4.3978577)]\n    [DataRow(\"slrwaxquavy\", 0.783135)]\n    [DataRow(\"SlRwAxQuAvY\", 0.5729079)]\n    [DataRow(\"012345678\", 1)]\n    [DataRow(\"images/blob/50281d86d6ed5c61975971150adf\", 1.1821769)]\n    [DataRow(\"js/commit/8863b9d04c722b278fa93c5d66ad1e\", 0.9126614)]\n    [DataRow(\"net/core/builder/e426a9ae7167c5807b173d5\", 1.9399531)]\n    [DataRow(\"net/more/builder/3ad489866f41084fa4f3307\", 1.9014789)]\n    [DataRow(\"project/commit/c5acf965067478784b54e2d24\", 1.2177787)]\n    [DataRow(\"/var/lib/openshift/51122e382d5271c5ca000\", 1.3230153)]\n    [DataRow(\"examples/commit/16ad89c4172c259f15bce56e\", 1.6869377)]\n    [DataRow(\"examples/commit/8e1d746900f5411e9700fea0\", 1.48724)]\n    [DataRow(\"examples/commit/c95b6a84b6fd1efc832a46cd\", 1.503256)]\n    [DataRow(\"examples/commit/d6f6ef7457d99e31990fa64b\", 1.4204883)]\n    [DataRow(\"examples/commit/ea15f07ce79366a08fee5b60\", 1.8357153)]\n    [DataRow(\"cn/res/chinapostplan/structure/181041269\", 3.494024)]\n    [DataRow(\"com/istio/proxy/blob/bcdc1684df0839a6125\", 1.5356048)]\n    [DataRow(\"com/kriskowal/q/blob/b0fa72980717dc202ff\", 1.3069352)]\n    [DataRow(\"com/ph/logstash/de2ba3f964ae7039b7b74a4a\", 1.4612998)]\n    [DataRow(\"default/src/test/java/org/xwiki/componen\", 2.6909549)]\n    [DataRow(\"search_my_organization-example.json\", 3.6890879)]\n    [DataRow(\"org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH\", 3.5768316)]\n    [DataRow(\"org.apache.catalina.startup.EXIT_ON_INIT_FAILURE\", 4.2315959)]\n    [DataRow(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\", 1.2038558)]\n    [DataRow(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_\", 1.2038558)]\n    [DataRow(\"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567\", 1.2252754)]\n    [DataRow(\"0123456789ABCDEFGHIJKLMNOPQRSTUV\", 1.2310129)]\n    [DataRow(\"abcdefghijklmnopqrstuvwxyz\", 1.1127479)]\n    [DataRow(\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\", 1.1127479)]\n    [DataRow(\"org.eclipse.jetty.server.HttpChannelState.DEFAULT_TIMEOUT\", 3.2985092)]\n    [DataRow(\"org.apache.tomcat.websocket.WS_AUTHENTICATION_PASSWORD\", 4.061177)]\n    public void CalculateHumanLanguageScore(string input, double expectedScore) =>\n        NaturalLanguageDetector.HumanLanguageScore(input).Should().BeApproximately(expectedScore, 0.01);\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Common/RuleLoaderTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Xml;\n\nnamespace SonarAnalyzer.Core.Test.Common;\n\n[TestClass]\npublic class RuleLoaderTest\n{\n    [TestMethod]\n    public void GivenNonXmlFile_RuleLoader_Throws()\n    {\n        var sut = new RuleLoader();\n        sut.Invoking(x => x.GetEnabledRules(\"not xml\")).Should().Throw<XmlException>();\n    }\n\n    [TestMethod]\n    public void GivenSonarLintXml_RuleLoader_LoadsActiveRules()\n    {\n        const string content = \"\"\"\n            <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n            <AnalysisInput>\n              <Rules>\n                <Rule>\n                  <Key>S1067</Key>\n                </Rule>\n                <Rule>\n                </Rule>\n              </Rules>\n            </AnalysisInput>\n            \"\"\";\n\n        CollectionAssert.AreEqual(new RuleLoader().GetEnabledRules(content).ToArray(), new[] {\"S1067\"});\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Common/ShannonEntropyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Test.Common;\n\n[TestClass]\npublic class ShannonEntropyTest\n{\n    [TestMethod]\n    [DataRow(null, 0)]\n    [DataRow(\"\", 0)]\n    [DataRow(\"a\", 0)]\n    [DataRow(\"aa\", 0)]\n    [DataRow(\"aA\", 1)]\n    [DataRow(\"abc\", 1.58)]\n    [DataRow(\"aabc\", 1.5)]\n    [DataRow(\"0000000000000000000000000000000000000000\", 0)]\n    [DataRow(\"0000000000000000000011111111111111111111\", 1)]\n    [DataRow(\"0000011111222223333344444555556666677777\", 3)]\n    [DataRow(\"squ_764ba4e9ccba193c84369792691b5500d999aadd\", 3.964)]\n    [DataRow(\"qAhEMdXy/MPwEuDlhh7O0AFBuzGvNy7AxpL3sX3q\", 4.684183)]\n\n    public void Calculate_Entropy(string input, double expectedEntropy) =>\n        ShannonEntropy.Calculate(input).Should().BeApproximately(expectedEntropy, 0.01);\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Common/UnexpectedLanguageExceptionTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Test.Common;\n\n[TestClass]\npublic class UnexpectedLanguageExceptionTest\n{\n    [TestMethod]\n    public void Message_String_Ctor() =>\n        new UnexpectedLanguageException(\"F#\").Message.Should().Be(\"Unexpected language: F#\");\n\n    [TestMethod]\n    public void Message_CS() =>\n        new UnexpectedLanguageException(AnalyzerLanguage.CSharp).Message.Should().Be(\"Unexpected language: C#\");\n\n    [TestMethod]\n    public void Message_VB() =>\n        new UnexpectedLanguageException(AnalyzerLanguage.VisualBasic).Message.Should().Be(\"Unexpected language: Visual Basic\");\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Configuration/AnalysisConfigReaderTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Configuration.Test;\n\n[TestClass]\npublic class AnalysisConfigReaderTest\n{\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    public void MissingFile_ReturnsEmpty()\n    {\n        var sut = new AnalysisConfigReader(\"ThisFileDoesNotExist.xml\");\n        sut.UnchangedFiles().Should().BeEmpty();\n        sut.IsCloud.Should().BeFalse();\n    }\n\n    [TestMethod]\n    [DataRow(@\"<?xml that is invalid\")]\n    [DataRow(@\"<ValidXml><UnexpectedContent /></ValidXml>\")]\n    [DataRow(@\"<WrongRootCorrectNamespace xmlns=\"\"http://www.sonarsource.com/msbuild/integration/2015/1\"\" />\")]\n    [DataRow(@\"<AnalysisConfig xmlns=\"\"http://wrong.namespace\"\" />\")]\n    [DataRow(@\"<AnalysisConfig xmlns=\"\"http://www.sonarsource.com/msbuild/integration/2015/1\"\"><AdditionalConfig><ConfigSetting /></AdditionalConfig></AnalysisConfig>\")] // No Id attribute\n    public void UnexpectedXml_Throws(string xml)\n    {\n        var path = TestFiles.WriteFile(TestContext, \"SonarQubeAnalysisConfig.xml\", xml);\n        ((Func<AnalysisConfigReader>)(() => new AnalysisConfigReader(path))).Should().Throw<InvalidOperationException>().WithMessage($\"File '{path}' could not be parsed.\");\n    }\n\n    [TestMethod]\n    [DataRow(@\"<AnalysisConfig xmlns=\"\"http://www.sonarsource.com/msbuild/integration/2015/1\"\"><AdditionalConfig><ConfigSetting Id=\"\"wrong\"\" Value=\"\"42\"\" /></AdditionalConfig></AnalysisConfig>\")]\n    [DataRow(@\"<AnalysisConfig xmlns=\"\"http://www.sonarsource.com/msbuild/integration/2015/1\"\"><AdditionalConfig><ConfigSetting Id=\"\"UnchangedFilesPath\"\" /></AdditionalConfig></AnalysisConfig>\")]\n    [DataRow(@\"<AnalysisConfig xmlns=\"\"http://www.sonarsource.com/msbuild/integration/2015/1\"\"><AdditionalConfig><X Id=\"\"UnchangedFilesPath\"\" Value=\"\"42\"\" /></AdditionalConfig></AnalysisConfig>\")]\n    [DataRow(@\"<AnalysisConfig xmlns=\"\"http://www.sonarsource.com/msbuild/integration/2015/1\"\"><AdditionalConfig></AdditionalConfig></AnalysisConfig>\")]\n    [DataRow(@\"<AnalysisConfig xmlns=\"\"http://www.sonarsource.com/msbuild/integration/2015/1\"\"></AnalysisConfig>\")]\n    public void MissingContent(string xml)\n    {\n        var path = TestFiles.WriteFile(TestContext, \"SonarQubeAnalysisConfig.xml\", xml);\n        var sut = new AnalysisConfigReader(path);\n        sut.UnchangedFiles().Should().BeEmpty();\n        sut.IsCloud.Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void UnchangedFiles_NotPresent_ReturnsEmpty()\n    {\n        var path = AnalysisScaffolding.CreateAnalysisConfig(TestContext, \"SomeOtherProperty\", \"This is not UnchangedFilesPath\");\n        var sut = new AnalysisConfigReader(path);\n        sut.UnchangedFiles().Should().BeEmpty();\n    }\n\n    [TestMethod]\n    public void UnchangedFiles_Empty_ReturnsEmpty()\n    {\n        var path = AnalysisScaffolding.CreateAnalysisConfig(TestContext, []);\n        var sut = new AnalysisConfigReader(path);\n        sut.UnchangedFiles().Should().BeEmpty();\n    }\n\n    [TestMethod]\n    public void UnchangedFiles_Present_ReturnsContent()\n    {\n        var path = AnalysisScaffolding.CreateAnalysisConfig(TestContext, [@\"C:\\File1.cs\", @\"C:\\File2.cs\", \"Any other string\"]);\n        var sut = new AnalysisConfigReader(path);\n        sut.UnchangedFiles().Should().BeEquivalentTo(@\"C:\\File1.cs\", @\"C:\\File2.cs\", \"Any other string\");\n    }\n\n    [TestMethod]\n    [DataRow(\"8.0.0.82356\", true)]  // Actual SQ-C version\n    [DataRow(\"8.0.0.29455\", true)]  // While this is SQ-S 8.0 and not cloud, we expect true, because this analyzer will never be backported there\n    [DataRow(\"8.0.0.99999\", true)]\n    [DataRow(\"2026.1.0.1234\", false)]\n    [DataRow(\"whatever\", false)]\n    [DataRow(\"\", false)]\n    public void IsSonarCloud(string version, bool expected)\n    {\n        var path = AnalysisScaffolding.CreateAnalysisConfig(TestContext, \"key\", \"value\", version);\n        var sut = new AnalysisConfigReader(path);\n        sut.IsCloud.Should().Be(expected);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Configuration/FilesToAnalyzeProviderTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\nusing System.Text.RegularExpressions;\n\nnamespace SonarAnalyzer.Core.Configuration.Test;\n\n[TestClass]\npublic class FilesToAnalyzeProviderTest\n{\n    private const string MixedSlashesWebConfigPath1 = @\"C:\\Projects/DummyProj/wEB.config\";\n    private const string MixedSlashesWebConfigPath2 = @\"C:\\Projects/DummyProj/Views\\Web.confiG\";\n    private const string FilesToAnalyzePath = @\"TestResources\\FilesToAnalyze\\FilesToAnalyze.txt\";\n    private const string InvalidFilesToAnalyzePath = @\"TestResources\\FilesToAnalyze\\FilesToAnalyzeWithInvalidValues.txt\";\n\n    [TestMethod]\n    public void FileNameWithMixedCapitalizationAndMixedSlashes_FindFilesWithFileName_ReturnsAllWebConfigFiles()\n    {\n        var sut = new FilesToAnalyzeProvider(FilesToAnalyzePath);\n\n        var results = sut.FindFiles(\"Web.config\", false);\n        results.Should().BeEquivalentTo(new[] { MixedSlashesWebConfigPath1, MixedSlashesWebConfigPath2 });\n    }\n\n    [TestMethod]\n    public void FileNameWithMixedCapitalizationAndMixedSlashes_FindFilesWithRegex_ReturnsAllWebConfigFiles()\n    {\n        var fileNamePattern = new Regex(@\"[\\\\\\/]web\\.config$\", RegexOptions.IgnoreCase);\n\n        var sut = new FilesToAnalyzeProvider(FilesToAnalyzePath);\n\n        var results = sut.FindFiles(fileNamePattern, false);\n        results.Should().BeEquivalentTo(new[] { MixedSlashesWebConfigPath1, MixedSlashesWebConfigPath2 });\n    }\n\n    [TestMethod]\n    public void FileWithInvalidValues_FindFilesWithFileName_ReturnsValidValue()\n    {\n        var sut = new FilesToAnalyzeProvider(InvalidFilesToAnalyzePath);\n\n        var results = sut.FindFiles(\"123\", false);\n        results.Should().ContainSingle();\n        results.Should().Contain(\"123\");\n    }\n\n    [TestMethod]\n    public void FileWithInvalidValues_FindFilesWithRegex_ReturnsValidValue()\n    {\n        var fileNamePattern = new Regex(\"web\\\\.config$\", RegexOptions.IgnoreCase);\n\n        var sut = new FilesToAnalyzeProvider(InvalidFilesToAnalyzePath);\n\n        var results = sut.FindFiles(fileNamePattern, false);\n        results.Should().BeEquivalentTo(new[]\n        {\n            MixedSlashesWebConfigPath2,\n            @\"C:\\Projects\\Controllers:web.config\",\n            @\"C:web.config\",\n            @\"C:\\Projects<web.config\",\n            @\"C:\\Projects>\\Controllers/web.config\"\n        });\n    }\n\n    [TestMethod]\n    public void EmptyFile_FindFiles_ReturnsEmptyEnumerable()\n    {\n        var sut = new FilesToAnalyzeProvider(@\"TestResources\\FilesToAnalyze\\EmptyFilesToAnalyze.txt\");\n\n        var results = sut.FindFiles(new Regex(\".*\"), false);\n        results.Should().BeEmpty();\n    }\n\n    [TestMethod]\n    [DataRow(\"\")]\n    [DataRow(null)]\n    [DataRow(\"invalidPath\")]\n    [DataRow(@\"TestResources\\FilesToAnalyze\\NonExistingFile.txt\")]\n    public void InvalidPath_FindFiles_ReturnsEmptyEnumerable(string filePath)\n    {\n        var sut = new FilesToAnalyzeProvider(filePath);\n\n        var results = sut.FindFiles(new Regex(\".*\"), false);\n        results.Should().BeEmpty();\n    }\n\n    [TestMethod]\n    public void FileWithValidValues_FindFilesRequestingAnyFile_AllValuesFromTheFileAreReturned()\n    {\n        var sut = new FilesToAnalyzeProvider(FilesToAnalyzePath);\n\n        var results = sut.FindFiles(new Regex(\".*\"), false);\n        results.Should().BeEquivalentTo(new[]\n        {\n            MixedSlashesWebConfigPath1,\n            MixedSlashesWebConfigPath2,\n            @\"C:\\Projects\\DummyProj\\Views\\Global.asax\",\n            @\"C:\\Projects\\DummyProj\\Csharp\\Controllers\\HomeController.cs\",\n            @\"C:\\Projects\\DummyProj\\VisualBasic\\Controllers\\HomeController.vb\",\n            @\"C:\\Projects/DummyProj/Views\\Web.confiGuration\"\n        });\n    }\n\n    [TestMethod]\n    public void UnableToOpenFile_FindFiles_ReturnsEmptyEnumerable()\n    {\n        using (Stream iStream = File.Open(FilesToAnalyzePath, FileMode.Open, FileAccess.Read, FileShare.None))\n        {\n            var sut = new FilesToAnalyzeProvider(FilesToAnalyzePath);\n\n            var results = sut.FindFiles(new Regex(\".*\"));\n            results.Should().BeEmpty();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Configuration/ProjectConfigReaderTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.Core.Configuration.Test;\n\n[TestClass]\npublic class ProjectConfigReaderTest\n{\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    public void AllPropertiesAreSet()\n    {\n        var sut = CreateProjectConfigReader(@\"TestResources\\SonarProjectConfig\\Path_Windows\\SonarProjectConfig.xml\");\n\n        // this will fail if a new property is added to the class and no test case for it is added\n        foreach (var property in sut.GetType().GetProperties().Where(x => x.Name != \"AnalysisConfig\"))\n        {\n            var value = property.GetValue(sut)?.ToString();\n            value.Should().NotBeNullOrEmpty($\"property '{property.Name}' should have value\");\n        }\n    }\n\n    [TestMethod]\n    public void WhenAllValuesAreSet_LoadsExpectedValues()\n    {\n        var sut = CreateProjectConfigReader(@\"TestResources\\SonarProjectConfig\\Path_Windows\\SonarProjectConfig.xml\");\n\n        sut.AnalysisConfigPath.Should().Be(@\"c:\\foo\\bar\\.sonarqube\\conf\\SonarQubeAnalysisConfig.xml\");\n        sut.ProjectPath.Should().Be(@\"C:\\foo\\bar\\AwesomeBankWeb.CSharp\\AwesomeBankWeb.CSharp.csproj\");\n        sut.FilesToAnalyzePath.Should().Be(@\"c:\\foo\\bar\\.sonarqube\\conf\\0\\FilesToAnalyze.txt\");\n        sut.OutPath.Should().Be(@\"C:\\foo\\bar\\.sonarqube\\out\\0\");\n        sut.ProjectType.Should().Be(ProjectType.Product);\n        sut.TargetFramework.Should().Be(\"netcoreapp3.1\");\n    }\n\n    [TestMethod]\n    [DataRow(\"Path_MixedSeparators\", @\"c:\\foo\\bar\\.sonarqube\\conf/0/FilesToAnalyze.txt\")]\n    [DataRow(\"Path_Unix\", @\"/home/user/.sonarqube/conf/0/FilesToAnalyze.txt\")]\n    [DataRow(\"Path_Windows\", @\"c:\\foo\\bar\\.sonarqube\\conf\\0\\FilesToAnalyze.txt\")]\n    public void WithVariousPathFormats_ReturnsValueAsIs(string project, string expectedFilesToAnalyzePath) =>\n        CreateProjectConfigReader($@\"TestResources\\SonarProjectConfig\\{project}\\SonarProjectConfig.xml\").FilesToAnalyzePath.Should().Be(expectedFilesToAnalyzePath);\n\n    [TestMethod]\n    public void WhenHasMissingFilesToAnalyzePath_ReturnsCorrectValue()\n    {\n        var sut = CreateProjectConfigReader(@\"TestResources\\SonarProjectConfig\\MissingFilesToAnalyzePath\\SonarProjectConfig.xml\");\n\n        sut.AnalysisConfigPath.Should().Be(@\"c:\\foo\\bar\\.sonarqube\\conf\\SonarQubeAnalysisConfig.xml\");\n        sut.ProjectPath.Should().Be(@\"C:\\foo\\bar\\AwesomeBankWeb.CSharp\\AwesomeBankWeb.CSharp.csproj\");\n        sut.OutPath.Should().Be(@\"C:\\foo\\bar\\.sonarqube\\out\\0\");\n        sut.ProjectType.Should().Be(ProjectType.Product);\n        sut.TargetFramework.Should().Be(\"netcoreapp3.1\");\n    }\n\n    [TestMethod]\n    public void WhenHasUnexpectedProjectType_FallsBackToProduct() =>\n        CreateProjectConfigReader(@\"TestResources\\SonarProjectConfig\\UnexpectedProjectTypeValue\\SonarProjectConfig.xml\").ProjectType.Should().Be(ProjectType.Product);\n\n    [TestMethod]\n    [DataRow(\"MissingAnalysisConfigPath\")]\n    [DataRow(\"MissingOutPath\")]\n    [DataRow(\"MissingProjectPath\")]\n    [DataRow(\"MissingProjectType\")]\n    [DataRow(\"MissingTargetFramework\")]\n    public void WhenHasMissingValues_FilesToAnalyzePath_ReturnsCorrectValue(string folder) =>\n        CreateProjectConfigReader($@\"TestResources\\SonarProjectConfig\\{folder}\\SonarProjectConfig.xml\").FilesToAnalyzePath.Should().Be(@\"c:\\foo\\bar\\.sonarqube\\conf\\0\\FilesToAnalyze.txt\");\n\n    [TestMethod]\n    [DataRow(\"Invalid_DifferentClassName\")]\n    [DataRow(\"Invalid_DifferentNamespace\")]\n    [DataRow(\"Invalid_Xml\")]\n    public void WhenInvalid_FilesToReturnPath_ThrowsException(string folder) =>\n        Assert.Throws<InvalidOperationException>(() => CreateProjectConfigReader($@\"TestResources\\SonarProjectConfig\\{folder}\\SonarProjectConfig.xml\"))\n            .Message.Should().Be(\"sonarProjectConfig could not be parsed.\");\n\n    [TestMethod]\n    public void FilesToAnalyze_LoadsFileFromConfig()\n    {\n        var config = SourceText.From(\"\"\"\n            <SonarProjectConfig xmlns=\"http://www.sonarsource.com/msbuild/analyzer/2021/1\">\n                <FilesToAnalyzePath>TestResources\\FilesToAnalyze\\FilesToAnalyze.txt</FilesToAnalyzePath>\n            </SonarProjectConfig>\n            \"\"\");\n        var files = new ProjectConfigReader(config).FilesToAnalyze.FindFiles(\"web.config\", false);\n\n        files.Should().BeEquivalentTo(@\"C:\\Projects/DummyProj/wEB.config\", @\"C:\\Projects/DummyProj/Views\\Web.confiG\");\n    }\n\n    [TestMethod]\n    public void AnalysisConfig_LoadsConfigFromDisk()\n    {\n        var path = AnalysisScaffolding.CreateSonarProjectConfigWithUnchangedFiles(TestContext);     // With AnalysisConfigPath that exists\n        var sut = CreateProjectConfigReader(path);\n        sut.AnalysisConfig.Should().NotBeNull();\n    }\n\n    private static ProjectConfigReader CreateProjectConfigReader(string relativePath) =>\n        new(SourceText.From(File.ReadAllText(relativePath)));\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Configuration/ProjectTypeCacheTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Configuration.Test;\n\n[TestClass]\npublic class ProjectTypeCacheTest\n{\n    [TestMethod]\n    public void TestReference_ShouldBeSynchronized()\n    {\n        // Purpose of this test is to remind us, that we need to synchronize this list with sonar-scanner-msbuild and sonar-security.\n        var synchronizedSortedReferences = new[]\n        {\n            \"dotMemory.Unit\",\n            \"Microsoft.VisualStudio.TestPlatform.TestFramework\",\n            \"Microsoft.VisualStudio.QualityTools.UnitTestFramework\",\n            \"MSTest.TestFramework\",\n            \"Machine.Specifications\",\n            \"nunit.framework\",\n            \"nunitlite\",\n            \"TechTalk.SpecFlow\",\n            \"xunit\",\n            \"xunit.core\",\n            \"xunit.v3.core\",\n            \"FluentAssertions\",\n            \"Shouldly\",\n            \"FakeItEasy\",\n            \"Moq\",\n            \"NSubstitute\",\n            \"Rhino.Mocks\",\n            \"Telerik.JustMock\"\n        };\n        ProjectTypeCache.TestAssemblyNames.OrderBy(x => x).Should().BeEquivalentTo(synchronizedSortedReferences);\n    }\n\n    [TestMethod]\n    public void IsTest_ReturnsTrueForTestFrameworks()\n    {\n        IsTest(NuGetMetadataReference.JetBrainsDotMemoryUnit(TestConstants.NuGetLatestVersion)).Should().BeTrue();\n        IsTest(NuGetMetadataReference.MSTestTestFrameworkV1).Should().BeTrue();\n        IsTest(NuGetMetadataReference.MSTestTestFramework(TestConstants.NuGetLatestVersion)).Should().BeTrue();\n        IsTest(NuGetMetadataReference.MicrosoftVisualStudioQualityToolsUnitTestFramework).Should().BeTrue();\n        IsTest(NuGetMetadataReference.MachineSpecifications(TestConstants.NuGetLatestVersion)).Should().BeTrue();\n        IsTest(NuGetMetadataReference.NUnit(TestConstants.NuGetLatestVersion)).Should().BeTrue();\n        IsTest(NuGetMetadataReference.NUnitLite(TestConstants.NuGetLatestVersion)).Should().BeTrue();\n        IsTest(NuGetMetadataReference.SpecFlow(TestConstants.NuGetLatestVersion)).Should().BeTrue();\n        IsTest(NuGetMetadataReference.XunitFrameworkV1).Should().BeTrue();\n        IsTest(NuGetMetadataReference.XunitFramework(TestConstants.NuGetLatestVersion)).Should().BeTrue();\n        IsTest(NuGetMetadataReference.XunitFrameworkV3(TestConstants.NuGetLatestVersion)).Should().BeTrue();\n\n        // Assertion\n        IsTest(NuGetMetadataReference.FluentAssertions(NugetPackageVersions.FluentAssertionsVersions.Ver7)).Should().BeTrue();\n        IsTest(NuGetMetadataReference.Shouldly(TestConstants.NuGetLatestVersion)).Should().BeTrue();\n\n        // Mock\n        IsTest(NuGetMetadataReference.FakeItEasy(TestConstants.NuGetLatestVersion)).Should().BeTrue();\n        IsTest(NuGetMetadataReference.JustMock(TestConstants.NuGetLatestVersion)).Should().BeTrue();\n        IsTest(NuGetMetadataReference.Moq(TestConstants.NuGetLatestVersion)).Should().BeTrue();\n        IsTest(NuGetMetadataReference.NSubstitute(TestConstants.NuGetLatestVersion)).Should().BeTrue();\n        IsTest(NuGetMetadataReference.RhinoMocks(TestConstants.NuGetLatestVersion)).Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void IsTest_ReturnsFalse()\n    {\n        IsTest(null).Should().BeFalse();\n        // Any non-test reference\n        IsTest(NuGetMetadataReference.SystemValueTuple(TestConstants.NuGetLatestVersion)).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void IsTest_Compilation()\n    {\n        IsTest(NuGetMetadataReference.MSTestTestFrameworkV1).Should().BeTrue();\n\n        IsTest(null).Should().BeFalse();\n    }\n\n    private static bool IsTest(IEnumerable<MetadataReference> additionalReferences) =>\n        CreateSemanticModel(additionalReferences).Compilation.IsTest();\n\n    private static SemanticModel CreateSemanticModel(IEnumerable<MetadataReference> additionalReferences) =>\n        new SnippetCompiler(\"// Nothing to see here\", additionalReferences).Model;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Configuration/SonarLintXmlReaderTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.Core.Configuration.Test;\n\n[TestClass]\npublic class SonarLintXmlReaderTest\n{\n    [TestMethod]\n    [DataRow(LanguageNames.CSharp, \"cs\")]\n    [DataRow(LanguageNames.VisualBasic, \"vbnet\")]\n    public void SonarLintXmlReader_WhenAllValuesAreSet_ExpectedValues(string language, string xmlLanguageName)\n    {\n        var sut = CreateSonarLintXmlReader(@$\"TestResources\\SonarLintXml\\All_Properties_{xmlLanguageName}\\SonarLint.xml\");\n        sut.IgnoreHeaderComments(language).Should().BeTrue();\n        sut.AnalyzeGeneratedCode(language).Should().BeFalse();\n        sut.AnalyzeRazorCode(language).Should().BeFalse();\n        AssertArrayContent(sut.Exclusions, nameof(sut.Exclusions));\n        AssertArrayContent(sut.Inclusions, nameof(sut.Inclusions));\n        AssertArrayContent(sut.GlobalExclusions, nameof(sut.GlobalExclusions));\n        AssertArrayContent(sut.TestExclusions, nameof(sut.TestExclusions));\n        AssertArrayContent(sut.TestInclusions, nameof(sut.TestInclusions));\n        AssertArrayContent(sut.GlobalTestExclusions, nameof(sut.GlobalTestExclusions));\n\n        sut.ParametrizedRules.Should().HaveCount(2);\n        var rule = sut.ParametrizedRules.First(x => x.Key.Equals(\"S2342\"));\n        rule.Parameters[0].Key.Should().Be(\"format\");\n        rule.Parameters[0].Value.Should().Be(\"^([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?$\");\n        rule.Parameters[1].Key.Should().Be(\"flagsAttributeFormat\");\n        rule.Parameters[1].Value.Should().Be(\"^([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?s$\");\n\n        static void AssertArrayContent(string[] array, string folder)\n        {\n            array.Should().HaveCount(2);\n            array[0].Should().BeEquivalentTo($\"Fake/{folder}/**/*\");\n            array[1].Should().BeEquivalentTo($\"Fake/{folder}/Second*/**/*\");\n        }\n    }\n\n    [TestMethod]\n    public void SonarLintXmlReader_PartiallyMissingProperties_ExpectedAndDefaultValues()\n    {\n        var sut = CreateSonarLintXmlReader(@\"TestResources\\SonarLintXml\\Partially_missing_properties\\SonarLint.xml\");\n        sut.IgnoreHeaderComments(LanguageNames.CSharp).Should().BeFalse();\n        sut.AnalyzeGeneratedCode(LanguageNames.CSharp).Should().BeTrue();\n        sut.AnalyzeRazorCode(LanguageNames.CSharp).Should().BeTrue();\n        AssertArrayContent(sut.Exclusions, nameof(sut.Exclusions));\n        AssertArrayContent(sut.Inclusions, nameof(sut.Inclusions));\n        sut.GlobalExclusions.Should().NotBeNull().And.HaveCount(0);\n        sut.TestExclusions.Should().NotBeNull().And.HaveCount(0);\n        sut.TestInclusions.Should().NotBeNull().And.HaveCount(0);\n        sut.GlobalTestExclusions.Should().NotBeNull().And.HaveCount(0);\n        sut.ParametrizedRules.Should().NotBeNull().And.HaveCount(0);\n    }\n\n    [TestMethod]\n    public void SonarLintXmlReader_PropertiesCSharpTrueVBNetFalse_ExpectedValues()\n    {\n        var sut = CreateSonarLintXmlReader(@\"TestResources\\SonarLintXml\\PropertiesCSharpTrueVbnetFalse\\SonarLint.xml\");\n        sut.IgnoreHeaderComments(LanguageNames.CSharp).Should().BeTrue();\n        sut.IgnoreHeaderComments(LanguageNames.VisualBasic).Should().BeFalse();\n        sut.AnalyzeGeneratedCode(LanguageNames.CSharp).Should().BeTrue();\n        sut.AnalyzeGeneratedCode(LanguageNames.VisualBasic).Should().BeFalse();\n        sut.AnalyzeRazorCode(LanguageNames.CSharp).Should().BeTrue();\n        sut.AnalyzeRazorCode(LanguageNames.VisualBasic).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void SonarLintXmlReader_DuplicatedProperties_DoesNotFail() =>\n        ((Action)(() => CreateSonarLintXmlReader(@\"TestResources\\SonarLintXml\\Duplicated_Properties\\SonarLint.xml\"))).Should().NotThrow();\n\n    [TestMethod]\n    [DataRow(\"\")]\n    [DataRow(\"this is not an xml\")]\n    [DataRow(@\"<?xml version=\"\"1.0\"\" encoding=\"\"UTF - 8\"\"?><AnalysisInput><Settings>\")]\n    public void SonarLintXmlReader_WithMalformedXml_DefaultBehaviour(string sonarLintXmlContent) =>\n        CheckSonarLintXmlReaderDefaultValues(new SonarLintXmlReader(SourceText.From(sonarLintXmlContent)));\n\n    [TestMethod]\n    public void SonarLintXmlReader_MissingProperties_DefaultBehaviour() =>\n        CheckSonarLintXmlReaderDefaultValues(CreateSonarLintXmlReader(@\"TestResources\\SonarLintXml\\Missing_properties\\SonarLint.xml\"));\n\n    [TestMethod]\n    public void SonarLintXmlReader_WithIncorrectValueType_DefaultBehaviour() =>\n        CheckSonarLintXmlReaderDefaultValues(CreateSonarLintXmlReader(@\"TestResources\\SonarLintXml\\Incorrect_value_type\\SonarLint.xml\"));\n\n    [TestMethod]\n    public void SonarLintXmlReader_CheckEmpty_DefaultBehaviour() =>\n        CheckSonarLintXmlReaderDefaultValues(SonarLintXmlReader.Empty);\n\n    [TestMethod]\n    public void SonarLintXmlReader_LanguageDoesNotExist_Throws()\n    {\n        var sut = CreateSonarLintXmlReader(@\"TestResources\\SonarLintXml\\All_Properties_cs\\SonarLint.xml\");\n        sut.Invoking(x => x.IgnoreHeaderComments(LanguageNames.FSharp)).Should().Throw<UnexpectedLanguageException>().WithMessage(\"Unexpected language: F#\");\n        sut.Invoking(x => x.AnalyzeGeneratedCode(LanguageNames.FSharp)).Should().Throw<UnexpectedLanguageException>().WithMessage(\"Unexpected language: F#\");\n        sut.Invoking(x => x.AnalyzeRazorCode(LanguageNames.FSharp)).Should().Throw<UnexpectedLanguageException>().WithMessage(\"Unexpected language: F#\");\n    }\n\n    private static void CheckSonarLintXmlReaderDefaultValues(SonarLintXmlReader sut)\n    {\n        sut.AnalyzeGeneratedCode(LanguageNames.CSharp).Should().BeFalse();\n        sut.IgnoreHeaderComments(LanguageNames.CSharp).Should().BeFalse();\n        sut.AnalyzeRazorCode(LanguageNames.CSharp).Should().BeTrue();\n        sut.Exclusions.Should().NotBeNull().And.HaveCount(0);\n        sut.Inclusions.Should().NotBeNull().And.HaveCount(0);\n        sut.GlobalExclusions.Should().NotBeNull().And.HaveCount(0);\n        sut.TestExclusions.Should().NotBeNull().And.HaveCount(0);\n        sut.TestInclusions.Should().NotBeNull().And.HaveCount(0);\n        sut.GlobalTestExclusions.Should().NotBeNull().And.HaveCount(0);\n        sut.ParametrizedRules.Should().NotBeNull().And.HaveCount(0);\n    }\n\n    private static void AssertArrayContent(string[] array, string folder)\n    {\n        array.Should().HaveCount(2);\n        array[0].Should().BeEquivalentTo($\"Fake/{folder}/**/*\");\n        array[1].Should().BeEquivalentTo($\"Fake/{folder}/Second*/**/*\");\n    }\n\n    private static SonarLintXmlReader CreateSonarLintXmlReader(string relativePath) =>\n        new(SourceText.From(File.ReadAllText(relativePath)));\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Configuration/SonarLintXmlTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\nusing System.Xml.Serialization;\n\nnamespace SonarAnalyzer.Core.Configuration.Test;\n\n[TestClass]\npublic class SonarLintXmlTest\n{\n    [TestMethod]\n    public void SonarLintXml_DeserializeFile_ExpectedValues()\n    {\n        var deserializer = new XmlSerializer(typeof(SonarLintXml));\n        using TextReader textReader = new StreamReader(@\"TestResources\\SonarLintXml\\All_properties_cs\\SonarLint.xml\");\n        var sonarLintXml = (SonarLintXml)deserializer.Deserialize(textReader);\n\n        AssertSettings(sonarLintXml.Settings);\n        AssertRules(sonarLintXml.Rules);\n    }\n\n    private static void AssertSettings(List<SonarLintXmlKeyValuePair> settings)\n    {\n        settings.Should().HaveCount(11);\n\n        AssertKeyValuePair(settings[0], \"sonar.cs.analyzeRazorCode\", \"false\");\n        AssertKeyValuePair(settings[1], \"sonar.cs.ignoreHeaderComments\", \"true\");\n        AssertKeyValuePair(settings[2], \"sonar.cs.analyzeGeneratedCode\", \"false\");\n        AssertKeyValuePair(settings[3], \"sonar.cs.file.suffixes\", \".cs\");\n        AssertKeyValuePair(settings[4], \"sonar.cs.roslyn.ignoreIssues\", \"false\");\n        AssertKeyValuePair(settings[5], \"sonar.exclusions\", \"Fake/Exclusions/**/*,Fake/Exclusions/Second*/**/*\");\n        AssertKeyValuePair(settings[6], \"sonar.inclusions\", \"Fake/Inclusions/**/*,Fake/Inclusions/Second*/**/*\");\n        AssertKeyValuePair(settings[7], \"sonar.global.exclusions\", \"Fake/GlobalExclusions/**/*,Fake/GlobalExclusions/Second*/**/*\");\n        AssertKeyValuePair(settings[8], \"sonar.test.exclusions\", \"Fake/TestExclusions/**/*,Fake/TestExclusions/Second*/**/*\");\n        AssertKeyValuePair(settings[9], \"sonar.test.inclusions\", \"Fake/TestInclusions/**/*,Fake/TestInclusions/Second*/**/*\");\n        AssertKeyValuePair(settings[10], \"sonar.global.test.exclusions\", \"Fake/GlobalTestExclusions/**/*,Fake/GlobalTestExclusions/Second*/**/*\");\n    }\n\n    private static void AssertRules(List<SonarLintXmlRule> rules)\n    {\n        rules.Should().HaveCount(4);\n        rules.Where(x => x.Parameters.Any()).Should().HaveCount(2);\n\n        rules[0].Key.Should().BeEquivalentTo(\"S2225\");\n        rules[0].Parameters.Should().BeEmpty();\n\n        rules[1].Key.Should().BeEquivalentTo(\"S2342\");\n        rules[1].Parameters.Should().HaveCount(2);\n        AssertKeyValuePair(rules[1].Parameters[0], \"format\", \"^([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?$\");\n        AssertKeyValuePair(rules[1].Parameters[1], \"flagsAttributeFormat\", \"^([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?s$\");\n\n        rules[2].Key.Should().BeEquivalentTo(\"S2346\");\n        rules[2].Parameters.Should().BeEmpty();\n\n        rules[3].Key.Should().BeEquivalentTo(\"S1067\");\n        rules[3].Parameters.Should().HaveCount(1);\n        AssertKeyValuePair(rules[3].Parameters[0], \"max\", \"1\");\n    }\n\n    private static void AssertKeyValuePair(SonarLintXmlKeyValuePair pair, string expectedKey, string expectedValue)\n    {\n        pair.Key.Should().BeEquivalentTo(expectedKey);\n        pair.Value.Should().BeEquivalentTo(expectedValue);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Extensions/BasicBlockExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CFG.Extensions;\nusing SonarAnalyzer.CFG.Roslyn;\n\nnamespace SonarAnalyzer.Core.Test.Extensions;\n\n[TestClass]\npublic class BasicBlockExtensionsTest\n{\n    [TestMethod]\n    public void IsEnclosedIn_ReturnsTrueForLocalLifeTime()\n    {\n        const string code = @\"\npublic class Sample\n{\n    public void Method()\n    {\n        var t = true || true;\n    }\n}\";\n        var cfg = TestCompiler.CompileCfgCS(code);\n        var localLifetimeRegion = cfg.Root.NestedRegions.Single();\n        var block = cfg.Blocks[localLifetimeRegion.FirstBlockOrdinal];\n\n        block.IsEnclosedIn(ControlFlowRegionKind.LocalLifetime).Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void IsEnclosedIn_IgnoresLocalLifeTimeForOtherKinds()\n    {\n        const string code = @\"\npublic class Sample\n{\n    public void Method()\n    {\n        try\n        {\n            DoSomething();\n            var t = true || true;   // This causes LocalLivetimeRegion to be generated\n        }\n        catch\n        {\n        }\n    }\n\n    public void DoSomething() { }\n}\";\n        var cfg = TestCompiler.CompileCfgCS(code);\n        var block = cfg.Blocks[2];\n\n        block.EnclosingRegion.Kind.Should().Be(ControlFlowRegionKind.LocalLifetime);\n        block.EnclosingRegion.EnclosingRegion.Kind.Should().Be(ControlFlowRegionKind.Try);\n        block.EnclosingRegion.EnclosingRegion.EnclosingRegion.Kind.Should().Be(ControlFlowRegionKind.TryAndCatch);\n        block.IsEnclosedIn(ControlFlowRegionKind.Try).Should().BeTrue();\n        block.IsEnclosedIn(ControlFlowRegionKind.Catch).Should().BeFalse();\n        block.IsEnclosedIn(ControlFlowRegionKind.TryAndCatch).Should().BeFalse();   // Because it's enclosed in Try\n        block.IsEnclosedIn(ControlFlowRegionKind.LocalLifetime).Should().BeTrue();  // When asking for it, it should return\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Extensions/CompilationExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Test.Extensions;\n\n[TestClass]\npublic class CompilationExtensionsTest\n{\n    private const string Snippet = \"\"\"\n        class Sample\n        {\n            int _field;\n            string Property { get; }\n            void MethodWithParameters(int arg1) { }\n            void MethodWithParameters(int arg1, string arg2) { }\n        }\n        \"\"\";\n\n    [TestMethod]\n    [DataRow(\"NonExistingType\", \"NonExistingMember\", false)]\n    [DataRow(\"Sample\", \"NonExistingMember\", false)]\n    [DataRow(\"Sample\", \"_field\", true)]\n    [DataRow(\"Sample\", \"Property\", true)]\n    [DataRow(\"Sample\", \"MethodWithParameters\", true)]\n    public void IsMemberAvailable_WithoutTypeCheck(string typeName, string memberName, bool expectedResult)\n    {\n        var (_, semanticModel) = TestCompiler.Compile(Snippet, false, AnalyzerLanguage.CSharp);\n        semanticModel.Compilation.IsMemberAvailable<ISymbol>(new(typeName), memberName)\n            .Should().Be(expectedResult);\n    }\n\n    [TestMethod]\n    public void IsMemberAvailable_WithPredicate()\n    {\n        var (_, semanticModel) = TestCompiler.Compile(Snippet, false, AnalyzerLanguage.CSharp);\n        semanticModel.Compilation.IsMemberAvailable<IFieldSymbol>(new(\"Sample\"), \"_field\", x => KnownType.System_Int32.Matches(x.Type))\n            .Should().BeTrue();\n        semanticModel.Compilation.IsMemberAvailable<IPropertySymbol>(new(\"Sample\"), \"Property\", x => x is { IsReadOnly: true })\n            .Should().BeTrue();\n        semanticModel.Compilation.IsMemberAvailable<IMethodSymbol>(new(\"Sample\"), \"MethodWithParameters\", x => x is { Parameters.Length: 2 })\n            .Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void ReferencesAny_ShouldBeTrue()\n    {\n        Check(NuGetMetadataReference.NLog(), KnownAssembly.NLog);\n        Check(NuGetMetadataReference.NLog().Concat(NuGetMetadataReference.NHibernate()), KnownAssembly.NLog);\n        Check(NuGetMetadataReference.NLog(), KnownAssembly.NLog, KnownAssembly.NSubstitute);\n\n        static void Check(IEnumerable<MetadataReference> compilationReferences, params KnownAssembly[] checkedAssemblies) =>\n            ReferencesAny_ShouldBe(true, compilationReferences, checkedAssemblies);\n    }\n\n    [TestMethod]\n    public void ReferencesAny_ShouldBeFalse()\n    {\n        Check(Enumerable.Empty<MetadataReference>(), KnownAssembly.NLog);\n        Check(Enumerable.Empty<MetadataReference>(), KnownAssembly.NLog, KnownAssembly.NSubstitute);\n\n        static void Check(IEnumerable<MetadataReference> compilationReferences, params KnownAssembly[] checkedAssemblies) =>\n            ReferencesAny_ShouldBe(false, compilationReferences, checkedAssemblies);\n    }\n\n    [TestMethod]\n    public void ReferencesAny_ShouldThrow()\n    {\n        var (_, model) = TestCompiler.Compile(string.Empty, false, AnalyzerLanguage.CSharp);\n\n        ((Func<bool>)(() => model.Compilation.ReferencesAny()))\n            .Should()\n            .ThrowExactly<ArgumentException>()\n            .WithMessage(\"Assemblies argument needs to be non-empty\");\n    }\n\n    private static void ReferencesAny_ShouldBe(bool expected, IEnumerable<MetadataReference> compilationReferences, params KnownAssembly[] checkedAssemblies)\n    {\n        var (_, model) = TestCompiler.Compile(string.Empty, false, AnalyzerLanguage.CSharp, compilationReferences.ToArray());\n        model.Compilation.ReferencesAny(checkedAssemblies).Should().Be(expected);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Extensions/ControlFlowGraphExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing SonarAnalyzer.CFG.Extensions;\nusing SonarAnalyzer.CFG.Roslyn;\n\nnamespace SonarAnalyzer.Core.Test.Extensions;\n\n[TestClass]\npublic class ControlFlowGraphExtensionsTest\n{\n    [TestMethod]\n    public void FindLocalFunctionCfgInScope_ThrowForUnexpectedSymbol()\n    {\n        const string code = @\"\npublic class Sample\n{\n    public void Method() { }\n}\";\n        var (tree, semanticModel) = TestCompiler.CompileCS(code);\n        var method = tree.Single<MethodDeclarationSyntax>();\n        var symbol = semanticModel.GetDeclaredSymbol(method) as IMethodSymbol;\n        var cfg = ControlFlowGraph.Create(method, semanticModel, default);\n\n        Action a = () => cfg.FindLocalFunctionCfgInScope(symbol, default);\n        a.Should().Throw<ArgumentOutOfRangeException>().WithMessage(\"Specified argument was out of the range of valid values.*Parameter*localFunction*\");\n    }\n\n    [TestMethod]\n    public void FindLocalFunctionCfgInScope_ThrowForNullSymbol()\n    {\n        const string code = @\"\npublic class Sample\n{\n    public void Method() { }\n}\";\n        var cfg = TestCompiler.CompileCfgCS(code);\n        Action a = () => cfg.FindLocalFunctionCfgInScope(null, default);\n        a.Should().Throw<ArgumentOutOfRangeException>().WithMessage(\"Specified argument was out of the range of valid values.*Parameter*localFunction*\");\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Extensions/DictionaryExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Test.Extensions;\n\n[TestClass]\npublic class DictionaryExtensionsTest\n{\n    [TestMethod]\n    public void DictionaryEquals_Different()\n    {\n        var empty = new Dictionary<string, string>();\n        var original = new Dictionary<string, string> { { \"a\", \"a\" }, { \"b\", \"b\" } };\n        var differentKeys = new Dictionary<string, string> { { \"a\", \"a\" }, { \"c\", \"c\" } };\n        var differentValues = new Dictionary<string, string> { { \"a\", \"a\" }, { \"b\", \"xxxx\" } };\n\n        DictionaryExtensions.DictionaryEquals(null, empty).Should().BeFalse();\n        DictionaryExtensions.DictionaryEquals(empty, null).Should().BeFalse();\n        original.DictionaryEquals(empty).Should().BeFalse();\n        original.DictionaryEquals(differentKeys).Should().BeFalse();\n        original.DictionaryEquals(differentValues).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void DictionaryEquals_SameContent()\n    {\n        var dict1 = new Dictionary<string, string> { { \"a\", \"a\" }, { \"b\", \"b\" } };\n        var dict2 = new Dictionary<string, string> { { \"a\", \"a\" }, { \"b\", \"b\" } };\n        dict1.DictionaryEquals(dict1).Should().BeTrue();\n        dict1.DictionaryEquals(dict2).Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void DictionaryEquals_SameContent_DifferentOrdering()\n    {\n        var numbers = Enumerable.Range(1, 1000);\n        var dict1 = numbers.ToDictionary(x => x, x => x);\n        var dict2 = numbers.OrderByDescending(x => x).ToDictionary(x => x, x => x);\n        dict1.DictionaryEquals(dict1).Should().BeTrue();\n        dict1.DictionaryEquals(dict2).Should().BeTrue();\n        dict2.DictionaryEquals(dict1).Should().BeTrue();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Extensions/IEnumerableExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.Text;\n\n#pragma warning disable SA1122 // Use string.Empty for empty strings\n\nnamespace SonarAnalyzer.Core.Test.Extensions;\n\n[TestClass]\npublic class IEnumerableExtensionsTest\n{\n    [TestMethod]\n    public void TestAreEqual_01()\n    {\n        var c1 = new List<int> { 1, 2, 3 };\n        var c2 = new List<string> { \"1\", \"2\", \"3\" };\n\n        c1.Equals(c2, (e1, e2) => e1.ToString() == e2).Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void TestAreEqual_02()\n    {\n        var c1 = new List<int> { 1, 2 };\n        var c2 = new List<string> { \"1\", \"2\", \"3\" };\n\n        c1.Equals(c2, (e1, e2) => e1.ToString() == e2).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void TestAreEqual_03()\n    {\n        var c1 = new List<int> { 1, 2, 3 };\n        var c2 = new List<string> { \"1\", \"2\" };\n\n        c1.Equals(c2, (e1, e2) => e1.ToString() == e2).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void TestAreEqual_04()\n    {\n        var c1 = new List<int>();\n        var c2 = new List<string> { \"1\", \"2\" };\n\n        c1.Equals(c2, (e1, e2) => e1.ToString() == e2).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void TestAreEqual_05()\n    {\n        var c1 = new List<int> { 1 };\n        var c2 = new List<string>();\n\n        c1.Equals(c2, (e1, e2) => e1.ToString() == e2).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void TestAreEqual_06()\n    {\n        var c1 = new List<int>();\n        var c2 = new List<string>();\n\n        c1.Equals(c2, (e1, e2) => e1.ToString() == e2).Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void JoinStr_T_String()\n    {\n        var lst = new[]\n        {\n            Tuple.Create(1, \"a\"),\n            Tuple.Create(2, \"bb\"),\n            Tuple.Create(3, \"ccc\")\n        };\n\n        lst.JoinStr(null, x => x.Item2).Should().Be(\"abbccc\");\n        lst.JoinStr(\", \", x => x.Item2).Should().Be(\"a, bb, ccc\");\n        lst.JoinStr(\" \", x => x.Item2 + \"!\").Should().Be(\"a! bb! ccc!\");\n        lst.JoinStr(\"; \", x => x.Item1 + \":\" + x.Item2).Should().Be(\"1:a; 2:bb; 3:ccc\");\n    }\n\n    [TestMethod]\n    public void JoinStr_T_Int()\n    {\n        var lst = new[]\n        {\n            Tuple.Create(1, \"a\"),\n            Tuple.Create(2, \"bb\"),\n            Tuple.Create(3, \"ccc\")\n        };\n\n        lst.JoinStr(\", \", x => x.Item1).Should().Be(\"1, 2, 3\");\n        lst.JoinStr(null, x => x.Item1 + 10).Should().Be(\"111213\");\n    }\n\n    [TestMethod]\n    public void JoinStr_String()\n    {\n        Array.Empty<string>().JoinStr(\", \").Should().Be(\"\");\n        new[] { \"a\" }.JoinStr(\", \").Should().Be(\"a\");\n        new[] { \"a\", \"bb\", \"ccc\" }.JoinStr(\", \").Should().Be(\"a, bb, ccc\");\n        new[] { \"a\", \"bb\", \"ccc\" }.JoinStr(null).Should().Be(\"abbccc\");\n    }\n\n    [TestMethod]\n    public void JoinStr_Int()\n    {\n        Array.Empty<int>().JoinStr(\", \").Should().Be(\"\");\n        new[] { 1 }.JoinStr(\", \").Should().Be(\"1\");\n        new[] { 1, 22, 333 }.JoinStr(\", \").Should().Be(\"1, 22, 333\");\n        new[] { 1, 22, 333 }.JoinStr(null).Should().Be(\"122333\");\n    }\n\n    [TestMethod]\n    public void JoinNonEmpty()\n    {\n        Array.Empty<string>().JoinNonEmpty(\", \").Should().Be(\"\");\n        new[] { \"a\" }.JoinNonEmpty(\", \").Should().Be(\"a\");\n        new[] { \"a\", \"bb\", \"ccc\" }.JoinNonEmpty(\", \").Should().Be(\"a, bb, ccc\");\n        new[] { \"a\", \"bb\", \"ccc\" }.JoinNonEmpty(null).Should().Be(\"abbccc\");\n        new[] { \"a\", \"bb\", \"ccc\" }.JoinNonEmpty(\"\").Should().Be(\"abbccc\");\n        new[] { null, \"a\", \"b\" }.JoinNonEmpty(\".\").Should().Be(\"a.b\");\n        new[] { \"a\", null, \"b\" }.JoinNonEmpty(\".\").Should().Be(\"a.b\");\n        new[] { \"a\", \"b\", null }.JoinNonEmpty(\".\").Should().Be(\"a.b\");\n        new string[] { null, null, null }.JoinNonEmpty(\".\").Should().Be(\"\");\n        new string[] { \"\", \"\", \"\" }.JoinNonEmpty(\".\").Should().Be(\"\");\n        new string[] { \"\", \"\\t\", \" \" }.JoinNonEmpty(\".\").Should().Be(\"\");\n        new string[] { \"a\", \"\\t\", \"b\" }.JoinNonEmpty(\".\").Should().Be(\"a.b\");\n    }\n\n    [TestMethod]\n    public void WhereNotNull_Class()\n    {\n        var instance = new object();\n        Array.Empty<object>().WhereNotNull().Should().BeEmpty();\n        new object[] { null, null, null }.WhereNotNull().Should().BeEmpty();\n        new object[] { 1, \"a\", instance }.WhereNotNull().Should().BeEquivalentTo(new object[] { 1, \"a\", instance });\n        new object[] { 1, \"a\", null }.WhereNotNull().Should().BeEquivalentTo(new object[] { 1, \"a\" });\n    }\n\n    [TestMethod]\n    public void WhereNotNull_NullableStruct()\n    {\n        Array.Empty<StructType?>().WhereNotNull().Should().BeEmpty();\n        new StructType?[] { null, null, null }.WhereNotNull().Should().BeEmpty();\n        new StructType?[] { new StructType(1), new StructType(2), new StructType(3) }\n                          .WhereNotNull().Should().BeEquivalentTo(new object[] { new StructType(1), new StructType(2), new StructType(3) });\n        new StructType?[] { new StructType(1), new StructType(2), null }.WhereNotNull().Should().BeEquivalentTo(new object[] { new StructType(1), new StructType(2) });\n    }\n\n    [TestMethod]\n    public void JoinAndNull() =>\n        ((object[])null).JoinAnd().Should().Be(string.Empty);\n\n    [TestMethod]\n    [DataRow(\"\")] // empty collection\n    [DataRow(\"\", null)]\n    [DataRow(\"\", \"\")]\n    [DataRow(\"\", \"\", \"\")]\n    [DataRow(\"\", \"\", \" \", \"\\t\", null)]\n    [DataRow(\"a\", \"a\")]\n    [DataRow(\"a and b\", \"a\", \"b\")]\n    [DataRow(\"a and b\", \"a\", null, \"b\")]\n    [DataRow(\"a, b, and c\", \"a\", \"b\", \"c\")]\n    [DataRow(\"a, b, and c\", \"a\", null, \"b\", \"\", \"c\")]\n    public void JoinAndStrings(string expected, params string[] collection) =>\n        collection.JoinAnd().Should().Be(expected);\n\n    [TestMethod]\n    [DataRow(\"\")] // Empty collection\n    [DataRow(\"0\", 0)]\n    [DataRow(\"0 and 1\", 0, 1)]\n    [DataRow(\"0, 1, and 2\", 0, 1, 2)]\n    [DataRow(\"1000\", 1000)]\n    public void JoinAndInts(string expected, params int[] collection) =>\n        collection.JoinAnd().Should().Be(expected);\n\n    [TestMethod]\n    [DataRow(\"\")] // Empty collection\n    [DataRow(\"08/30/2022 12:29:11\", \"2022-08-30T12:29:11\")]\n    [DataRow(\"08/30/2022 12:29:11 and 12/24/2022 16:00:00\", \"2022-08-30T12:29:11\", \"2022-12-24T16:00:00\")]\n    [DataRow(\"08/30/2022 12:29:11, 12/24/2022 16:00:00, and 12/31/2022 00:00:00\", \"2022-08-30T12:29:11\", \"2022-12-24T16:00:00\", \"2022-12-31T00:00:00\")]\n    public void JoinAndDateTime(string expected, params string[] collection)\n    {\n        using var scope = new CurrentCultureScope();\n        collection.Select(x => DateTime.Parse(x)).JoinAnd().Should().Be(expected);\n    }\n\n    [TestMethod]\n    public void JoinAndMixedClasses()\n    {\n        var collection = new Exception[]\n        {\n            new IndexOutOfRangeException(\"IndexOutOfRangeMessage\"),\n            new InvalidOperationException(\"OperationMessage\"),\n            null,\n            new NotSupportedException(\"NotSupportedMessage\"),\n        };\n        var result = collection.JoinAnd();\n        result.Should().Be(\"System.IndexOutOfRangeException: IndexOutOfRangeMessage, System.InvalidOperationException: OperationMessage, and System.NotSupportedException: NotSupportedMessage\");\n    }\n\n    [TestMethod]\n    public void ToSecondary_NullMessage()\n    {\n        var code = \"public class C {}\";\n        List<Location> locations =\n        [\n            Location.Create(CSharpSyntaxTree.ParseText(code), TextSpan.FromBounds(0, 6)),\n            Location.Create(CSharpSyntaxTree.ParseText(code), TextSpan.FromBounds(7, 12)),\n            Location.Create(CSharpSyntaxTree.ParseText(code), TextSpan.FromBounds(13, 14))\n        ];\n\n        var secondaryLocations = locations.ToSecondary(null);\n\n        secondaryLocations.Should().NotBeEmpty()\n            .And.HaveCount(3)\n            .And.AllSatisfy(x => x.Message.Should().BeNull());\n    }\n\n    [TestMethod]\n    [DataRow(null)]\n    [DataRow([])]\n    public void ToSecondary_MessageArgs(string[] messageArgs)\n    {\n        var code = \"public class C {}\";\n        List<Location> locations =\n        [\n            Location.Create(CSharpSyntaxTree.ParseText(code), TextSpan.FromBounds(0, 6)),\n            Location.Create(CSharpSyntaxTree.ParseText(code), TextSpan.FromBounds(7, 12)),\n            Location.Create(CSharpSyntaxTree.ParseText(code), TextSpan.FromBounds(13, 14))\n        ];\n\n        var secondaryLocations = locations.ToSecondary(\"Message\", messageArgs);\n\n        secondaryLocations.Should().NotBeEmpty()\n            .And.HaveCount(3)\n            .And.AllSatisfy(x => x.Message.Should().Be(\"Message\"));\n    }\n\n    [TestMethod]\n    [DataRow(\"Message {0}\", \"42\")]\n    [DataRow(\"{1} Message {0} \", \"42\", \"21\")]\n    public void ToSecondary_MessageFormat(string format, params string[] messageArgs)\n    {\n        var code = \"public class C {}\";\n        List<Location> locations =\n        [\n            Location.Create(CSharpSyntaxTree.ParseText(code), TextSpan.FromBounds(0, 6)),\n            Location.Create(CSharpSyntaxTree.ParseText(code), TextSpan.FromBounds(7, 12)),\n            Location.Create(CSharpSyntaxTree.ParseText(code), TextSpan.FromBounds(13, 14))\n        ];\n\n        var secondaryLocations = locations.ToSecondary(format, messageArgs);\n\n        secondaryLocations.Should().NotBeEmpty()\n            .And.HaveCount(3)\n            .And.AllSatisfy(x => x.Message.Should().Be(string.Format(format, messageArgs)));\n    }\n\n    [TestMethod]\n    public void ToSecondarySecondary_SyntaxNode_NullMessage()\n    {\n        List<SyntaxNode> nodes =\n        [\n            TestCompiler.NodeBetweenMarkersCS(\"$$public$$ class C {}\").Node,\n            TestCompiler.NodeBetweenMarkersCS(\"public $$class$$ C {}\").Node,\n            TestCompiler.NodeBetweenMarkersCS(\"public class $$C$$ {}\").Node,\n        ];\n\n        var secondaryLocations = nodes.ToSecondaryLocations(null);\n\n        secondaryLocations.Should().NotBeEmpty()\n            .And.HaveCount(3)\n            .And.AllSatisfy(x => x.Message.Should().BeNull());\n    }\n\n    [TestMethod]\n    [DataRow(null)]\n    [DataRow([])]\n    public void ToSecondarySecondary_SyntaxNode_MessageArgs(string[] messageArgs)\n    {\n        List<SyntaxNode> nodes =\n        [\n            TestCompiler.NodeBetweenMarkersCS(\"$$public$$ class C {}\").Node,\n            TestCompiler.NodeBetweenMarkersCS(\"public $$class$$ C {}\").Node,\n            TestCompiler.NodeBetweenMarkersCS(\"public class $$C$$ {}\").Node,\n        ];\n\n        var secondaryLocations = nodes.ToSecondaryLocations(\"Message\", messageArgs);\n\n        secondaryLocations.Should().NotBeEmpty()\n            .And.HaveCount(3)\n            .And.AllSatisfy(x => x.Message.Should().Be(\"Message\"));\n    }\n\n    [TestMethod]\n    [DataRow(\"Message {0}\", \"42\")]\n    [DataRow(\"{1} Message {0} \", \"42\", \"21\")]\n    public void ToSecondarySecondary_SyntaxNode_MessageFormat(string format, params string[] messageArgs)\n    {\n        List<SyntaxNode> nodes =\n        [\n            TestCompiler.NodeBetweenMarkersCS(\"$$public$$ class C {}\").Node,\n            TestCompiler.NodeBetweenMarkersCS(\"public $$class$$ C {}\").Node,\n            TestCompiler.NodeBetweenMarkersCS(\"public class $$C$$ {}\").Node,\n        ];\n\n        var secondaryLocations = nodes.ToSecondaryLocations(format, messageArgs);\n\n        secondaryLocations.Should().NotBeEmpty()\n            .And.HaveCount(3)\n            .And.AllSatisfy(x => x.Message.Should().Be(string.Format(format, messageArgs)));\n    }\n\n    [TestMethod]\n    public void ToSecondarySecondary_SyntaxToken_NullMessage()\n    {\n        List<SyntaxToken> nodes =\n        [\n            TestCompiler.TokenBetweenMarkersCS(\"$$public$$ class C {}\").Token,\n            TestCompiler.TokenBetweenMarkersCS(\"public $$class$$ C {}\").Token,\n            TestCompiler.TokenBetweenMarkersCS(\"public class $$C$$ {}\").Token,\n        ];\n\n        var secondaryLocations = nodes.ToSecondaryLocations(null);\n\n        secondaryLocations.Should().NotBeEmpty()\n            .And.HaveCount(3)\n            .And.AllSatisfy(x => x.Message.Should().BeNull());\n    }\n\n    [TestMethod]\n    [DataRow(null)]\n    [DataRow([])]\n    public void ToSecondarySecondary_SyntaxToken_MessageArgs(string[] messageArgs)\n    {\n        List<SyntaxToken> nodes =\n        [\n            TestCompiler.TokenBetweenMarkersCS(\"$$public$$ class C {}\").Token,\n            TestCompiler.TokenBetweenMarkersCS(\"public $$class$$ C {}\").Token,\n            TestCompiler.TokenBetweenMarkersCS(\"public class $$C$$ {}\").Token,\n        ];\n\n        var secondaryLocations = nodes.ToSecondaryLocations(\"Message\", messageArgs);\n\n        secondaryLocations.Should().NotBeEmpty()\n            .And.HaveCount(3)\n            .And.AllSatisfy(x => x.Message.Should().Be(\"Message\"));\n    }\n\n    [TestMethod]\n    [DataRow(\"Message {0}\", \"42\")]\n    [DataRow(\"{1} Message {0} \", \"42\", \"21\")]\n    public void ToSecondarySecondary_SyntaxToken_MessageFormat(string format, params string[] messageArgs)\n    {\n        List<SyntaxToken> nodes =\n        [\n            TestCompiler.TokenBetweenMarkersCS(\"$$public$$ class C {}\").Token,\n            TestCompiler.TokenBetweenMarkersCS(\"public $$class$$ C {}\").Token,\n            TestCompiler.TokenBetweenMarkersCS(\"public class $$C$$ {}\").Token,\n        ];\n\n        var secondaryLocations = nodes.ToSecondaryLocations(format, messageArgs);\n\n        secondaryLocations.Should().NotBeEmpty()\n            .And.HaveCount(3)\n            .And.AllSatisfy(x => x.Message.Should().Be(string.Format(format, messageArgs)));\n    }\n\n    private struct StructType\n    {\n        private readonly int count;\n\n        public StructType(int count)\n        {\n            this.count = count;\n        }\n    }\n}\n\n#pragma warning restore SA1122 // Use string.Empty for empty strings\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Extensions/IXmlLineInfoExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Xml.Linq;\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.Core.Test.Extensions;\n\n[TestClass]\npublic class IXmlLineInfoExtensionsTest\n{\n    [TestMethod]\n    public void Element_Simple()\n    {\n        var doc = XDocument.Parse(\"<a/>\", LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);\n        var tag = doc.Elements().First();\n        var location = tag.CreateLocation(\"Test\", tag.Name, tag);\n        location.Should().Be(Location.Create(\"Test\", new TextSpan(0, 1), new LinePositionSpan(new LinePosition(0, 1), new LinePosition(0, 2))));\n    }\n\n    [TestMethod]\n    // https://sonarsource.atlassian.net/browse/USER-292\n    // How to fix: https://sonarsource.atlassian.net/browse/USER-292?focusedCommentId=763449\n    public void Element_WithNamespace()\n    {\n        var doc = XDocument.Parse(\"\"\"\n            <?xml version=\"1.0\" encoding=\"utf-8\"?>\n            <wsse:Security\n                xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\n                <wsse:Password>xxx</wsse:Password>\n            </wsse:Security>\n            \"\"\", LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);\n        var passwordTag = doc.DescendantNodes().OfType<XElement>().First(x => x.Name.LocalName == \"Password\");\n        var location = passwordTag.CreateLocation(\"Test\", passwordTag.Name, passwordTag);\n        location.Should().Be(Location.Create(\"Test\", new TextSpan(3, 13), new LinePositionSpan(new LinePosition(3, 5), new LinePosition(3, 18))));\n    }\n\n    [TestMethod]\n    public void Element_WithDefaultNamespace()\n    {\n        var doc = XDocument.Parse(\"\"\"\n            <?xml version=\"1.0\" encoding=\"utf-8\"?>\n            <Security\n                xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\n                <Password>xxx</Password>\n            </Security>\n            \"\"\", LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);\n        var passwordTag = doc.DescendantNodes().OfType<XElement>().First(x => x.Name.LocalName == \"Password\");\n        var location = passwordTag.CreateLocation(\"Test\", passwordTag.Name, passwordTag);\n        location.Should().Be(Location.Create(\"Test\", new TextSpan(3, 8), new LinePositionSpan(new LinePosition(3, 5), new LinePosition(3, 13))));\n    }\n\n    [TestMethod]\n    public void Attribute_WithNamespace()\n    {\n        var doc = XDocument.Parse(\"\"\"\n            <?xml version=\"1.0\" encoding=\"utf-8\"?>\n            <wsse:Security\n                xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"\n                wsse:Password=\"xxx\">\n            </wsse:Security>\n            \"\"\", LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);\n        var securityTag = doc.DescendantNodes().OfType<XElement>().First(x => x.Name.LocalName == \"Security\");\n        var passwordAttribute = securityTag.Attributes().First(x => x.Name.LocalName == \"Password\");\n        var location = passwordAttribute.CreateLocation(\"Test\", passwordAttribute.Name, passwordAttribute.Parent);\n        location.Should().Be(Location.Create(\"Test\", new TextSpan(3, 13), new LinePositionSpan(new LinePosition(3, 4), new LinePosition(3, 17))));\n    }\n\n    [TestMethod]\n    public void Element_WithNestedNamespaces()\n    {\n        var doc = XDocument.Parse(\"\"\"\n            <?xml version=\"1.0\" encoding=\"utf-8\"?>\n            <Root xmlns:c2=\"http://example.org/root\">\n                <Child xmlns:c0005=\"http://example.org/child\">\n                    <c0005:T0005>\n                        <c2:T2>\n                        </c2:T2>\n                    </c0005:T0005>\n                </Child>\n            </Root>\n            \"\"\", LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);\n        var t2 = doc.DescendantNodes().OfType<XElement>().First(x => x.Name.LocalName == \"T2\");\n        var t0005 = doc.DescendantNodes().OfType<XElement>().First(x => x.Name.LocalName == \"T0005\");\n        var t2Location = t2.CreateLocation(\"Test\", t2.Name, t2);\n        var t0005Location = t0005.CreateLocation(\"Test\", t0005.Name, t0005);\n        // \"c0005\".Length + \"t0005\".Length + \":\".Length == 11\n        t0005Location.Should().Be(Location.Create(\"Test\", new TextSpan(3, 11), new LinePositionSpan(new LinePosition(3, 9), new LinePosition(3, 20))));\n        // \"c2\".Length + \"t2\".Length + \":\".Length == 5\n        t2Location.Should().Be(Location.Create(\"Test\", new TextSpan(4, 5), new LinePositionSpan(new LinePosition(4, 13), new LinePosition(4, 18))));\n    }\n\n    [TestMethod]\n    public void Element_WithRedefinition()\n    {\n        var doc = XDocument.Parse(\"\"\"\n            <?xml version=\"1.0\" encoding=\"utf-8\"?>\n            <Root xmlns:defined=\"http://example.org/root\">\n                <Child xmlns:defined=\"http://example.org/child\">\n                    <defined:Nested>\n                    </defined:Nested>\n                </Child>\n            </Root>\n            \"\"\", LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);\n        var nestedTag = doc.DescendantNodes().OfType<XElement>().First(x => x.Name.LocalName == \"Nested\");\n        var nestedLocation = nestedTag.CreateLocation(\"Test\", nestedTag.Name, nestedTag);\n        nestedLocation.Should().Be(Location.Create(\"Test\", new TextSpan(3, 14), new LinePositionSpan(new LinePosition(3, 9), new LinePosition(3, 23))));\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Extensions/RegexExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text.RegularExpressions;\n\nnamespace SonarAnalyzer.Core.Test.Extensions;\n\n[TestClass]\npublic class RegexExtensionsTest\n{\n    // https://stackoverflow.com/questions/3403512/regex-match-take-a-very-long-time-to-execute\n    // Regular expression with catastrophic backtracking to ensure timeout exception when a small timeout is set\n    private const string TimeoutPattern =\n        @\"^((?<DRIVE>[a-zA-Z]):\\\\)*((?<DIR>[a-zA-Z0-9_]+(([a-zA-Z0-9_\\s_\\-\\.]*[a-zA-Z0-9_]+)|([a-zA-Z0-9_]+)))\\\\)*(?<FILE>([a-zA-Z0-9_]+(([a-zA-Z0-9_\\s_\\-\\.]*[a-zA-Z0-9_]+)|([a-zA-Z0-9_]+))\\.(?<EXTENSION>[a-zA-Z0-9]{1,6})$))\";\n\n    private const string MatchingPath = @\"C:\\Users\\username\\AppData\\Local\\Temp\\00af5451-626f-40db-af1d-89d376dc5ef6\\SomeFile.csproj\";\n\n    [TestMethod]\n    [DataRow(true)]\n    [DataRow(false)]\n    public void SafeIsMatch_Timeout_Fallback(bool timeoutFallback)\n    {\n        var regex = new Regex(TimeoutPattern, RegexOptions.None, TimeSpan.FromTicks(1));\n        regex.SafeIsMatch(MatchingPath, timeoutFallback).Should().Be(timeoutFallback);\n    }\n\n    [TestMethod]\n    [DataRow(MatchingPath, 1, false)]\n    [DataRow(MatchingPath, 1_000_000, true)]\n    [DataRow(\"äöü\", 1, false)]\n    [DataRow(\"äöü\", 1_000_000, false)]\n    public void SafeMatch_Timeout(string input, long timeoutTicks, bool matchSucceed)\n    {\n        var regex = new Regex(TimeoutPattern, RegexOptions.None, TimeSpan.FromTicks(timeoutTicks));\n        regex.SafeMatch(input).Success.Should().Be(matchSucceed);\n    }\n\n    [TestMethod]\n    [DataRow(MatchingPath, 1, 0)]\n    [DataRow(MatchingPath, 1_000_000, 1)]\n    [DataRow(\"äöü\", 1, 0)]\n    [DataRow(\"äöü\", 1_000_000, 0)]\n    public void SafeMatches_Timeout(string input, long timeoutTicks, int matchCount)\n    {\n        var regex = new Regex(TimeoutPattern, RegexOptions.None, TimeSpan.FromTicks(timeoutTicks));\n        var actual = regex.SafeMatches(input);\n        actual.Count.Should().Be(matchCount);\n        if (matchCount > 0)\n        {\n            var access = () => actual[0];\n            access.Should().NotThrow().Which.Index.Should().Be(0);\n        }\n    }\n\n    [TestMethod]\n    [DataRow(MatchingPath, 1, MatchingPath)]\n    [DataRow(MatchingPath, 1_000_000, \"Replaced\")]\n    [DataRow(\"äöü\", 1, \"äöü\")]\n    [DataRow(\"äöü\", 1_000_000, \"äöü\")]\n    public void SafeReplace_Timeout(string input, long timeoutTicks, string expected)\n    {\n        var regex = new Regex(TimeoutPattern, RegexOptions.None, TimeSpan.FromTicks(timeoutTicks));\n        var actual = regex.SafeReplace(input, \"Replaced\");\n        actual.Should().Be(expected);\n    }\n\n    [TestMethod]\n    [DataRow(MatchingPath, 1, false)]\n    [DataRow(MatchingPath, 1_000_000, true)]\n    [DataRow(\"äöü\", 1, false)]\n    [DataRow(\"äöü\", 1_000_000, false)]\n    public void SafeRegex_IsMatch_Timeout(string input, long timeoutTicks, bool isMatch)\n    {\n        var actual = SafeRegex.IsMatch(input, TimeoutPattern, RegexOptions.None, TimeSpan.FromTicks(timeoutTicks));\n        actual.Should().Be(isMatch);\n    }\n\n    [TestMethod]\n    [DataRow(false)]\n    [DataRow(true)]\n    public void SafeRegex_IsMatch_TimeoutFallback(bool fallback)\n    {\n        var actual = SafeRegex.IsMatch(MatchingPath, TimeoutPattern, RegexOptions.None, TimeSpan.FromTicks(1), fallback);\n        actual.Should().Be(fallback);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Extensions/XAttributeExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Xml.Linq;\n\nnamespace SonarAnalyzer.Core.Test.Extensions;\n\n[TestClass]\npublic class XAttributeExtensionsTest\n{\n    [TestMethod]\n    public void CreateLocation_WithNoLineInfo_ReturnsNull()\n    {\n        var sut = new XAttribute(XName.Get(\"name\"), \"A\");\n        sut.CreateLocation(string.Empty).Should().BeNull();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Json/JsonNodeTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Collections;\nusing Microsoft.CodeAnalysis.Text;\nusing SonarAnalyzer.Core.Json.Parsing;\n\nnamespace SonarAnalyzer.Core.Json.Test;\n\n[TestClass]\npublic class JsonNodeTest\n{\n    [TestMethod]\n    public void BehavesAsValue()\n    {\n        var sut = new JsonNode(LinePosition.Zero, LinePosition.Zero, 42);\n        sut.Kind.Should().Be(Kind.Value);\n        sut.Value.Should().Be(42);\n        sut.Invoking(x => x.Count).Should().Throw<InvalidOperationException>();\n        sut.Invoking(x => x[0]).Should().Throw<InvalidOperationException>();\n        sut.Invoking(x => x[\"Key\"]).Should().Throw<InvalidOperationException>();\n        sut.Invoking(x => x.Keys).Should().Throw<InvalidOperationException>();\n        sut.Invoking(x => x.Add(sut)).Should().Throw<InvalidOperationException>();\n        sut.Invoking(x => x.Add(\"Key\", sut)).Should().Throw<InvalidOperationException>();\n        sut.Invoking(x => x.ContainsKey(\"Key\")).Should().Throw<InvalidOperationException>();\n        sut.Invoking(x => ((IEnumerable)x).GetEnumerator()).Should().Throw<InvalidOperationException>();\n    }\n\n    [TestMethod]\n    public void UnsupportedKinds()\n    {\n        Func<JsonNode> action = () => new JsonNode(LinePosition.Zero, Kind.Value);\n        action.Should().Throw<InvalidOperationException>();\n        action = () => new JsonNode(LinePosition.Zero, Kind.Unknown);\n        action.Should().Throw<InvalidOperationException>();\n    }\n\n    [TestMethod]\n    public void BehavesAsList()\n    {\n        var a = new JsonNode(LinePosition.Zero, LinePosition.Zero, \"a\");\n        var b = new JsonNode(LinePosition.Zero, LinePosition.Zero, \"b\");\n        var sut = new JsonNode(LinePosition.Zero, Kind.List);\n        sut.Add(a);\n        sut.Add(b);\n        sut.Kind.Should().Be(Kind.List);\n        sut.Should().HaveCount(2);\n        ((object)sut[0]).Should().Be(a);\n        ((object)sut[1]).Should().Be(b);\n        var cnt = 0;\n        foreach (var item in sut)\n        {\n            new[] { a, b }.Should().Contain(item);\n            cnt++;\n        }\n        cnt.Should().Be(2);\n        sut.Invoking(x => x.Value).Should().Throw<InvalidOperationException>();\n        sut.Invoking(x => x[\"Key\"]).Should().Throw<InvalidOperationException>();\n        sut.Invoking(x => x.Keys).Should().Throw<InvalidOperationException>();\n        sut.Invoking(x => x.Add(\"Key\", sut)).Should().Throw<InvalidOperationException>();\n        sut.Invoking(x => x.ContainsKey(\"Key\")).Should().Throw<InvalidOperationException>();\n    }\n\n    [TestMethod]\n    public void BehavesAsDictionary()\n    {\n        var a = new JsonNode(LinePosition.Zero, LinePosition.Zero, \"a\");\n        var b = new JsonNode(LinePosition.Zero, LinePosition.Zero, \"b\");\n        var sut = new JsonNode(LinePosition.Zero, Kind.Object);\n        sut.Add(\"KeyA\", a);\n        sut.Add(\"KeyB\", b);\n        sut.Kind.Should().Be(Kind.Object);\n        sut.Count.Should().Be(2);\n        ((object)sut[\"KeyA\"]).Should().Be(a);\n        ((object)sut[\"KeyB\"]).Should().Be(b);\n        sut.Keys.Should().BeEquivalentTo(\"KeyA\", \"KeyB\");\n        sut.ContainsKey(\"KeyA\").Should().BeTrue();\n        sut.ContainsKey(\"KeyB\").Should().BeTrue();\n        sut.ContainsKey(\"KeyC\").Should().BeFalse();\n        sut.Invoking(x => x.Value).Should().Throw<InvalidOperationException>();\n        sut.Invoking(x => x[0]).Should().Throw<InvalidOperationException>();\n        sut.Invoking(x => x.Add(sut)).Should().Throw<InvalidOperationException>();\n        sut.Invoking(x => ((IEnumerable)x).GetEnumerator()).Should().Throw<InvalidOperationException>();\n    }\n\n    [TestMethod]\n    public void UpdateEnd()\n    {\n        var start = new LinePosition(1, 42);\n        var end = new LinePosition(2, 10);\n        var sut = new JsonNode(start, Kind.List);\n        sut.Start.Should().Be(start);\n        sut.End.Should().Be(LinePosition.Zero);\n\n        sut.UpdateEnd(end);\n        sut.End.Should().Be(end);\n\n        sut.Invoking(x => x.UpdateEnd(end)).Should().Throw<InvalidOperationException>();\n    }\n\n    // Light-weight way to test that string could be parsed. Precise tests could be found in SyntaxAnalyzerTest.cs\n    [TestMethod]\n    public void ParsedFromString()\n    {\n        var sut = JsonNode.FromString(@\"[\"\"a\"\",\"\"b\"\"]\");\n        sut.Kind.Should().Be(Kind.List);\n        sut.Should().HaveCount(2);\n        sut[0].Kind.Should().Be(Kind.Value);\n        sut[1].Kind.Should().Be(Kind.Value);\n        sut[0].Value.Should().Be(\"a\");\n        sut[1].Value.Should().Be(\"b\");\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Json/JsonSerializerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Globalization;\nusing System.Text;\nusing System.Text.Json;\nusing System.Text.Json.Serialization;\n\nnamespace SonarAnalyzer.Core.Json.Test;\n\n[TestClass]\npublic class JsonSerializerTest\n{\n    [TestMethod]\n    public void Serialize_UnsupportedType() =>\n        FluentActions.Invoking(() => JsonSerializer.Serialize(new { Value = new StringBuilder() })).Should().Throw<NotSupportedException>().WithMessage(\"Unexpected type: StringBuilder\");\n\n    [TestMethod]\n    public void Serialize_BasicTypes()\n    {\n        var stringObjectMap = new Dictionary<string, object>\n        {\n            { \"StringKey\", \"String value\"},\n            { \"BoolKey\", true},\n            { \"IntKey\", 42}\n        };\n        var stringStringMap = ImmutableSortedDictionary<string, string>.Empty.Add(\"Key A\", \"Value A\").Add(\"Key B\", \"Value B\");\n        var value = new TestData(\"Name\", true, false, null, [\"a\", \"b\", \"c\"], StringComparison.CurrentCulture, stringObjectMap.ToArray(), stringStringMap.ToArray());\n\n        var result = JsonSerializer.Serialize(value);\n        result.ToUnixLineEndings().Should().Be(\"\"\"\n            {\n              \"stringValue\": \"Name\",\n              \"trueValue\": true,\n              \"falseValue\": false,\n              \"nullString\": null,\n              \"stringArray\": [\"a\", \"b\", \"c\"],\n              \"enumValue\": \"CurrentCulture\",\n              \"stringObjectMap\": [\n                { \"key\": \"StringKey\", \"value\": \"String value\" },\n                { \"key\": \"BoolKey\", \"value\": true },\n                { \"key\": \"IntKey\", \"value\": 42 }\n              ],\n              \"stringStringMap\": [\n                { \"key\": \"Key A\", \"value\": \"Value A\" },\n                { \"key\": \"Key B\", \"value\": \"Value B\" }\n              ]\n            }\n            \"\"\");\n        // And it also deserializes correctly\n        var options = new JsonSerializerOptions { PropertyNameCaseInsensitive = true, Converters = { new JsonStringEnumConverter(), new PrimitiveObjectConverter() } };\n        System.Text.Json.JsonSerializer.Deserialize<TestData>(result, options).Should().BeEquivalentTo(value);\n    }\n\n    [TestMethod]\n    public void Serialize_Encoding() =>\n        JsonSerializer.Serialize(new { Value = \"Start \\\\ \\\" \\n \\r \\t \\b \\f End\" }).ToUnixLineEndings().Should().Be(\"\"\"\n            {\n              \"value\": \"Start \\\\ \\\" \\n \\r \\t \\b \\f End\"\n            }\n            \"\"\");\n\n    [TestMethod]\n    public void Serialize_ObjectWithIndexer() =>\n        JsonSerializer.Serialize(new List<int> { 42, 43 }).ToUnixLineEndings().Should().Be(\"\"\"\n            {\n              \"capacity\": 4,\n              \"count\": 2\n            }\n            \"\"\");\n\n    [DataRow((sbyte)42)]     // sbyte\n    [DataRow((byte)42)]      // byte\n    [DataRow((short)42)]     // short\n    [DataRow((ushort)42)]    // ushort\n    [DataRow(42)]            // int\n    [DataRow(42U)]           // uint\n    [DataRow(42L)]           // long\n    [DataRow(42UL)]          // ulong\n    [TestMethod]\n    public void Serialize_IntegerTypes(object value) =>\n        JsonSerializer.Serialize(new { Value = value }).ToUnixLineEndings().Should().Be(\"\"\"\n            {\n              \"value\": 42\n            }\n            \"\"\");\n\n    [DataRow(42.42)]         // double\n    [DataRow(42.42f)]        // float\n    [TestMethod]\n    public void Serialize_FloatingPointTypes(object value)\n    {\n        var newCulture = (CultureInfo)Thread.CurrentThread.CurrentCulture.Clone();\n        newCulture.NumberFormat.NumberDecimalSeparator = \",\";\n        using var scope = new CurrentCultureScope(newCulture);\n        value.ToString().Should().Be(\"42,42\");\n\n        JsonSerializer.Serialize(new { Value = value }).ToUnixLineEndings().Should().Be(\"\"\"\n            {\n              \"value\": 42.42\n            }\n            \"\"\");\n    }\n\n    [TestMethod]    // decimal cannot be in DataRow\n    public void Serialize_DecimalType()\n    {\n        var newCulture = (CultureInfo)Thread.CurrentThread.CurrentCulture.Clone();\n        newCulture.NumberFormat.NumberDecimalSeparator = \",\";\n        using var scope = new CurrentCultureScope(newCulture);\n        42.42m.ToString().Should().Be(\"42,42\");\n        JsonSerializer.Serialize(new { Value = 42.42m }).ToUnixLineEndings().Should().Be(\"\"\"\n            {\n              \"value\": 42.42\n            }\n            \"\"\");\n    }\n\n    private sealed record TestData(string StringValue,\n                                   bool TrueValue,\n                                   bool FalseValue,\n                                   string NullString,\n                                   string[] StringArray,\n                                   StringComparison EnumValue,\n                                   KeyValuePair<string, object>[] StringObjectMap,\n                                   KeyValuePair<string, string>[] StringStringMap)\n    {\n        public TestData() : this(null, true, false, null, null, StringComparison.Ordinal, null, null) { }\n    }\n\n    private sealed class PrimitiveObjectConverter : JsonConverter<object>\n    {\n        // This makes KeyValuePair<string, object> to deserialize to actual value. The default behavior is that object holds general JsonElement instead.\n        public override object Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) =>\n            reader.TokenType switch\n            {\n                JsonTokenType.True => true,\n                JsonTokenType.False => false,\n                JsonTokenType.Null => null,\n                JsonTokenType.String => reader.GetString(),\n                JsonTokenType.Number => reader.GetDouble(),\n                _ => throw new InvalidOperationException(\"Unexpected token type: \" + reader.TokenType)\n            };\n\n        public override void Write(Utf8JsonWriter writer, object value, JsonSerializerOptions options) =>\n            throw new NotSupportedException();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Json/JsonWalkerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Json.Test;\n\n[TestClass]\npublic class JsonWalkerTest\n{\n    [TestMethod]\n    public void VisitsAllNodes()\n    {\n        const string json = @\"\n{\n    \"\"OuterKey\"\": \"\"OuterValue\"\",\n    \"\"OuterBool\"\": true,\n    \"\"OuterNull\"\": null,\n    \"\"NestedArray\"\": [\n        \"\"Array1\"\",\n        [\"\"Array2-Nested1\"\", null, \"\"Array2-Nested2\"\", { \"\"InnerKey\"\": \"\"Array2-NestedObject\"\" }],\n        \"\"Array3\"\"\n    ]\n}\";\n        var sut = new JsonWalkerCollector();\n        sut.Visit(JsonNode.FromString(json));\n        sut.VisitedKeys.Should().BeEquivalentTo(\"OuterKey\", \"OuterBool\", \"OuterNull\", \"NestedArray\", \"InnerKey\");\n        sut.VisitedValues.Should().BeEquivalentTo(new object[] { \"OuterValue\", true, null, \"Array1\", \"Array2-Nested1\", null, \"Array2-Nested2\", \"Array2-NestedObject\", \"Array3\" });\n    }\n\n    [TestMethod]\n    [DataRow(\"[]\")]\n    [DataRow(\"{}\")]\n    public void VisitsAtomicJson_VisitsEmpty(string json)\n    {\n        var sut = new JsonWalkerCollector();\n        sut.Visit(JsonNode.FromString(json));\n        sut.VisitedKeys.Should().BeEmpty();\n        sut.VisitedValues.Should().BeEmpty();\n    }\n\n    private class JsonWalkerCollector : JsonWalker\n    {\n        public readonly List<string> VisitedKeys = new();\n        public readonly List<object> VisitedValues = new();\n\n        protected override void VisitObject(string key, JsonNode value)\n        {\n            VisitedKeys.Add(key);\n            base.VisitObject(key, value);\n        }\n\n        protected override void VisitValue(JsonNode node)\n        {\n            VisitedValues.Add(node.Value);\n            base.VisitValue(node);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Json/LexicalAnalyzerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Globalization;\nusing SonarAnalyzer.Core.Json.Parsing;\n\nnamespace SonarAnalyzer.Core.Json.Test;\n\n[TestClass]\npublic class LexicalAnalyzerTest\n{\n    [TestMethod]\n    public void IgnoresWhiteSpace()\n    {\n        var sut = new LexicalAnalyzer(\"   \\t\\n\\r [ \\n \\r ] \\r\\n\");\n        sut.NextSymbol().Should().Be(Symbol.OpenSquareBracket);\n        sut.NextSymbol().Should().Be(Symbol.CloseSquareBracket);\n        sut.NextSymbol().Should().Be(Symbol.EndOfInput);\n    }\n\n    [TestMethod]\n    public void SupportsSingleLineComments()\n    {\n        var sut = new LexicalAnalyzer(\"   // [ ]\\t\\n\\r [ //{}\\n \\r ] //{{}}\\r\\n\");\n        sut.NextSymbol().Should().Be(Symbol.OpenSquareBracket);\n        sut.NextSymbol().Should().Be(Symbol.CloseSquareBracket);\n        sut.NextSymbol().Should().Be(Symbol.EndOfInput);\n    }\n\n    [TestMethod]\n    public void SupportsMultiLineComments()\n    {\n        var sut = new LexicalAnalyzer(\"   /* [ ]\\t\\n\\r */ [ /* foo bar \\n baz [] */ \\n \\r ] /*{{}}*/\\r\\n\");\n        sut.NextSymbol().Should().Be(Symbol.OpenSquareBracket);\n        sut.NextSymbol().Should().Be(Symbol.CloseSquareBracket);\n        sut.NextSymbol().Should().Be(Symbol.EndOfInput);\n    }\n\n    [TestMethod]\n    public void ReadSpecialCharacters()\n    {\n        var sut = new LexicalAnalyzer(\"{{[[,,]]}}::\");\n        sut.NextSymbol().Should().Be(Symbol.OpenCurlyBracket);\n        sut.NextSymbol().Should().Be(Symbol.OpenCurlyBracket);\n        sut.NextSymbol().Should().Be(Symbol.OpenSquareBracket);\n        sut.NextSymbol().Should().Be(Symbol.OpenSquareBracket);\n        sut.NextSymbol().Should().Be(Symbol.Comma);\n        sut.NextSymbol().Should().Be(Symbol.Comma);\n        sut.NextSymbol().Should().Be(Symbol.CloseSquareBracket);\n        sut.NextSymbol().Should().Be(Symbol.CloseSquareBracket);\n        sut.NextSymbol().Should().Be(Symbol.CloseCurlyBracket);\n        sut.NextSymbol().Should().Be(Symbol.CloseCurlyBracket);\n        sut.NextSymbol().Should().Be(Symbol.Colon);\n        sut.NextSymbol().Should().Be(Symbol.Colon);\n        sut.NextSymbol().Should().Be(Symbol.EndOfInput);\n    }\n\n    [TestMethod]\n    [DataRow(\"0\")]\n    [DataRow(\"000\")]\n    [DataRow(\"-0\")]\n    [DataRow(\"-1\")]\n    [DataRow(\"-42\")]\n    [DataRow(\"-42424242\")]\n    [DataRow(\"1\")]\n    [DataRow(\"2\")]\n    [DataRow(\"3\")]\n    [DataRow(\"4\")]\n    [DataRow(\"5\")]\n    [DataRow(\"6\")]\n    [DataRow(\"7\")]\n    [DataRow(\"8\")]\n    [DataRow(\"9\")]\n    [DataRow(\"42\")]\n    [DataRow(\"42424242\")]\n    [DataRow(\"1234567890\")]\n    [DataRow(\"9223372036854775807\")]\n    [DataRow(\"-9223372036854775807\")]\n    public void ReadNumber_Integers_ParseToDouble(string source)\n    {\n        var sut = new LexicalAnalyzer(source);\n        sut.NextSymbol().Should().Be(Symbol.Value);\n        sut.Value.Should().BeOfType<double>().And.Be(double.Parse(source));\n        sut.NextSymbol().Should().Be(Symbol.EndOfInput);\n    }\n\n    [TestMethod]\n    [DataRow(\"0.0\")]\n    [DataRow(\"000.000\")]\n    [DataRow(\"111.111\")]\n    [DataRow(\"424242.5555555\")]\n    public void ReadNumber_Decimal(string source)\n    {\n        var expected = decimal.Parse(source, CultureInfo.InvariantCulture);\n        var sut = new LexicalAnalyzer(source);\n        sut.NextSymbol().Should().Be(Symbol.Value);\n        sut.Value.Should().BeOfType<decimal>().And.Be(expected);\n        sut.NextSymbol().Should().Be(Symbol.EndOfInput);\n    }\n\n    [TestMethod]\n    [DataRow(\"0e0\", 0.0)]\n    [DataRow(\"1e1\", 10.0)]\n    [DataRow(\"42e0\", 42.0)]\n    [DataRow(\"42e-1\", 4.2)]\n    [DataRow(\"42E-1\", 4.2)]\n    [DataRow(\"42e1\", 420.0)]\n    [DataRow(\"42e+1\", 420.0)]\n    [DataRow(\"42E+1\", 420.0)]\n    [DataRow(\"8e8\", 800_000_000)]\n    [DataRow(\"-42e1\", -420.0)]\n    [DataRow(\"-42e-1\", -4.2)]\n    [DataRow(\"-42e+1\", -420.0)]\n    [DataRow(\"4.2e1\", 42.0)]\n    [DataRow(\"44.22e2\", 4422.0)]\n    public void ReadNumber_Double_ParseToDouble(string source, double expected)\n    {\n        var sut = new LexicalAnalyzer(source);\n        sut.NextSymbol().Should().Be(Symbol.Value);\n        sut.Value.Should().BeOfType<double>().And.Be(expected);\n        sut.NextSymbol().Should().Be(Symbol.EndOfInput);\n    }\n\n    [TestMethod]\n    [DataRow(\" \\\"\\\" \", \"\")]\n    [DataRow(\" \\\"Lorem Ipsum\\\" \", \"Lorem Ipsum\")]\n    [DataRow(\" /*\\\"Lorem Ipsum\\\"*/ \\\"dolor sit amet\\\" \", \"dolor sit amet\")]\n    [DataRow(\" \\\"Lorem /**/ Ipsum\\\" \", \"Lorem /**/ Ipsum\")]\n    [DataRow(\" \\\"Lorem // Ipsum\\\" \", \"Lorem // Ipsum\")]\n    [DataRow(\" \\\"Quote\\\\\\\"Quote\\\" \", \"Quote\\\"Quote\")]\n    [DataRow(\" \\\"Slash\\\\/ Backslash\\\\\\\\\\\" \", \"Slash/ Backslash\\\\\")]\n    [DataRow(\" \\\"Special B\\\\b F\\\\f N\\\\n R\\\\r T\\\\t\\\" \", \"Special B\\b F\\f N\\n R\\r T\\t\")]\n    [DataRow(\" \\\"Unicode\\u0158\\u0159\\\" \", \"UnicodeŘř\")]\n    [DataRow(@\"\"\"\\u0159\"\"\", \"ř\")]\n    public void ReadString(string source, string expected)\n    {\n        var sut = new LexicalAnalyzer(source);\n        sut.NextSymbol().Should().Be(Symbol.Value);\n        sut.Value.Should().BeOfType<string>().And.Be(expected);\n        sut.NextSymbol().Should().Be(Symbol.EndOfInput);\n    }\n\n    [TestMethod]\n    [DataRow(\"null\", null)]\n    [DataRow(\"true\", true)]\n    [DataRow(\"false\", false)]\n    public void ReadKeyword(string source, object expected)\n    {\n        var sut = new LexicalAnalyzer(source);\n        sut.NextSymbol().Should().Be(Symbol.Value);\n        sut.Value.Should().Be(expected);\n        sut.NextSymbol().Should().Be(Symbol.EndOfInput);\n    }\n\n    [TestMethod]\n    [DataRow(\".\", \"Unexpected character '.' at line 1 position 1\")]\n    [DataRow(\"tx\", \"Unexpected character 'x'. Keyword 'true' was expected at line 1 position 1\")]\n    [DataRow(@\"\"\"\\u\", @\"Unexpected EOI, \\uXXXX escape expected at line 1 position 1\")]\n    [DataRow(@\"\"\"\\u12\", @\"Unexpected EOI, \\uXXXX escape expected at line 1 position 1\")]\n    [DataRow(@\"\"\"\\u12345\", @\"Unexpected EOI at line 1 position 1\")]\n    [DataRow(@\"\"\"\\x\", @\"Unexpected escape sequence \\x at line 1 position 1\")]\n    [DataRow(@\"\"\"\\\", @\"Unexpected EOI at line 1 position 1\")]\n    [DataRow(\"0-\", \"Unexpected Number format: Unexpected '-' at line 1 position 1\")]\n    [DataRow(\"-.\", \"Unexpected Number format: Unexpected '.' at line 1 position 1\")]\n    [DataRow(\"0..\", \"Unexpected Number format: Unexpected '.' at line 1 position 1\")]\n    [DataRow(\"0.0.\", \"Unexpected Number format: Unexpected '.' at line 1 position 1\")]\n    [DataRow(\"0e0.0\", \"Unexpected Number format: Unexpected '.' at line 1 position 1\")]\n    [DataRow(\"0+\", \"Unexpected Number format at line 1 position 1\")]\n    [DataRow(\"0.0+\", \"Unexpected Number format at line 1 position 1\")]\n    [DataRow(\"0e0+0\", \"Unexpected Number format at line 1 position 1\")]\n    [DataRow(\"0e\", \"Unexpected Number exponent format:  at line 1 position 1\")]\n    [DataRow(\"0e-\", \"Unexpected Number exponent format: - at line 1 position 1\")]\n    [DataRow(\"/*\", \"Unexpected EOI at line 1 position 1\")]\n    [DataRow(\" /* * /\", \"Unexpected EOI at line 1 position 1\")]\n    [DataRow(\" /* *\", \"Unexpected EOI at line 1 position 1\")]\n    [DataRow(\"/*/\", \"Unexpected EOI at line 1 position 1\")]\n    [DataRow(\" */\", \"Unexpected character '*' at line 1 position 2\")]\n    [DataRow(\" /0\", \"Unexpected character '*' at line 1 position 2\")]\n    [DataRow(\" /\", \"Unexpected character '*' at line 1 position 2\")]\n    [DataRow(\"#\", \"Unexpected character '*' at line 1 position 1\")]\n    [DataRow(\"$\", \"Unexpected character '*' at line 1 position 1\")]\n    [DataRow(\"%\", \"Unexpected character '*' at line 1 position 1\")]\n    [DataRow(\"&\", \"Unexpected character '*' at line 1 position 1\")]\n    [DataRow(\"'\", \"Unexpected character '*' at line 1 position 1\")]\n    [DataRow(\"(\", \"Unexpected character '*' at line 1 position 1\")]\n    [DataRow(\")\", \"Unexpected character '*' at line 1 position 1\")]\n    [DataRow(\"*\", \"Unexpected character '*' at line 1 position 1\")]\n    [DataRow(\"+\", \"Unexpected character '*' at line 1 position 1\")]\n    [DataRow(\".\", \"Unexpected character '*' at line 1 position 1\")]\n    [DataRow(\"/\", \"Unexpected character '*' at line 1 position 1\")]\n    public void InvalidInput_ThrowsJsonException(string source, string expectedMessage)\n    {\n        var sut = new LexicalAnalyzer(source);\n        sut.Invoking(x => x.NextSymbol()).Should().Throw<JsonException>().WithMessage(expectedMessage);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Json/SyntaxAnalyzerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Linq.Expressions;\nusing SonarAnalyzer.Core.Json.Parsing;\n\nnamespace SonarAnalyzer.Core.Json.Test;\n\n[TestClass]\npublic class SyntaxAnalyzerTest\n{\n    [TestMethod]\n    [DataRow(\"[null]\", null)]\n    [DataRow(\"[true]\", true)]\n    [DataRow(\"[false]\", false)]\n    [DataRow(\"[42]\", 42)]\n    [DataRow(\"[42.42]\", 42.42)]\n    [DataRow(\"[\\\"Lorem Ipsum\\\"]\", \"Lorem Ipsum\")]\n    public void StandaloneValue(string source, object expected)\n    {\n        var sut = new SyntaxAnalyzer(source);\n        var ret = sut.Parse();\n        ret.Kind.Should().Be(Kind.List);\n        ret.Should().ContainSingle();\n        var value = ret.Single();\n        value.Kind.Should().Be(Kind.Value);\n        value.Value.Should().Be(expected);\n    }\n\n    [TestMethod]\n    [DataRow(\"{}\")]\n    [DataRow(\"{ }\")]\n    [DataRow(\" { \\t\\n\\r } \")]\n    public void EmptyObject(string source)\n    {\n        var sut = new SyntaxAnalyzer(source);\n        var ret = sut.Parse();\n        ret.Kind.Should().Be(Kind.Object);\n        ret.Count.Should().Be(0);\n    }\n\n    [TestMethod]\n    [DataRow(\"[]\")]\n    [DataRow(\"[ ]\")]\n    [DataRow(\" [ \\t\\n\\r ] \")]\n    public void EmptyList(string source)\n    {\n        var sut = new SyntaxAnalyzer(source);\n        var ret = sut.Parse();\n        ret.Kind.Should().Be(Kind.List);\n        ret.Should().BeEmpty();\n    }\n\n    [TestMethod]\n    public void ParseObject()\n    {\n        const string json = @\"\n{\n    \"\"a\"\": \"\"aaa\"\",\n    \"\"b\"\": 42,\n    \"\"c\"\": true,\n    \"\"d\"\": null\n}\";\n        var sut = new SyntaxAnalyzer(json);\n        var ret = sut.Parse();\n        ret.Kind.Should().Be(Kind.Object);\n        ret.ContainsKey(\"a\").Should().BeTrue();\n        ret.ContainsKey(\"b\").Should().BeTrue();\n        ret.ContainsKey(\"c\").Should().BeTrue();\n        ret.ContainsKey(\"d\").Should().BeTrue();\n        ret[\"a\"].Value.Should().Be(\"aaa\");\n        ret[\"b\"].Value.Should().Be(42);\n        ret[\"c\"].Value.Should().Be(true);\n        ret[\"d\"].Value.Should().Be(null);\n    }\n\n    [TestMethod]\n    public void ParseList()\n    {\n        const string json = @\"[\"\"aaa\"\", 42, true, null]\";\n        var sut = new SyntaxAnalyzer(json);\n        var ret = sut.Parse();\n        ret.Kind.Should().Be(Kind.List);\n        ret.Select(x => x.Value).Should().ContainInOrder(\"aaa\", 42, true, null);\n    }\n\n    [TestMethod]\n    public void ParseNested()\n    {\n        const string json = @\"\n{\n    \"\"a\"\": [\"\"aaa\"\", \"\"bbb\"\", \"\"ccc\"\", { \"\"x\"\": true}],\n    \"\"b\"\": 42,\n    \"\"c\"\": {\"\"1\"\": 111, \"\"2\"\": \"\"222\"\", \"\"list\"\": [42, 43, 44]}\n}\";\n        var sut = new SyntaxAnalyzer(json);\n        var root = sut.Parse();\n        root.Kind.Should().Be(Kind.Object);\n        root.ContainsKey(\"a\").Should().BeTrue();\n        root.ContainsKey(\"b\").Should().BeTrue();\n        root.ContainsKey(\"c\").Should().BeTrue();\n        root.ContainsKey(\"d\").Should().BeFalse();\n\n        var a = root[\"a\"];\n        a.Kind.Should().Be(Kind.List);\n        a.Where(x => x.Kind == Kind.Value).Select(x => x.Value).Should().ContainInOrder(new[] { \"aaa\", \"bbb\", \"ccc\" });\n        var objectInList = a.Single(x => x.Kind == Kind.Object);\n        objectInList.ContainsKey(\"x\").Should().BeTrue();\n        objectInList[\"x\"].Value.Should().Be(true);\n\n        root[\"b\"].Value.Should().Be(42);\n\n        var c = root[\"c\"];\n        c.Kind.Should().Be(Kind.Object);\n        c.ContainsKey(\"1\").Should().BeTrue();\n        c.ContainsKey(\"2\").Should().BeTrue();\n        c.ContainsKey(\"list\").Should().BeTrue();\n        c[\"1\"].Kind.Should().Be(Kind.Value);\n        c[\"1\"].Value.Should().Be(111);\n        c[\"2\"].Kind.Should().Be(Kind.Value);\n        c[\"2\"].Value.Should().Be(\"222\");\n        c[\"list\"].Kind.Should().Be(Kind.List);\n        c[\"list\"].Select(x => x.Value).Should().ContainInOrder(42, 43, 44);\n    }\n\n    [TestMethod]\n    [DataRow(\"true\", \"{ or [ expected, but Value found at line 1 position 1\")]\n    [DataRow(@\"{ \"\"key\"\",\", \": expected, but Comma found at line 1 position 8\")]\n    [DataRow(\"{,\", \"String Value expected, but Comma found at line 1 position 2\")]\n    [DataRow(\"[0 0\", \"] expected, but Value found at line 1 position 4\")]\n    [DataRow(\"[ ,\", \"{, [ or Value (true, false, null, String, Number) expected, but Comma found at line 1 position 3\")]\n    [DataRow(@\"{ \"\"key\"\" : \"\"value\"\" \", \"} expected, but EndOfInput found at line 1 position 11\")]\n    public void InvalidSyntax_Throws(string source, string expectedMessage)\n    {\n        var sut = new SyntaxAnalyzer(source);\n        sut.Invoking(x => x.Parse()).Should().Throw<JsonException>().WithMessage(expectedMessage);\n    }\n\n    [TestMethod]\n    public void Location()\n    {\n        const string json =\n@\"{\n    'a': [\n            'aaa',\n            'bbb',\n            'ccc',\n            { 'x': true}\n           ],\n    'b': 42,\n    'c': {\n            '1': 111,\n            '2': '222',\n            'list': [42, 43, 44]\n         },\n    'd':\n[]\n}\";\n        var sut = new SyntaxAnalyzer(json.Replace('\\'', '\"'));  // Avoid \"\" escaping to preserve correct indexes in this editor\n        var root = sut.Parse();\n        AssertLocation(() => root, 0, 0, 15, 1);\n        AssertLocation(() => root[\"a\"], 1, 9, 6, 12);\n        AssertLocation(() => root[\"b\"], 7, 9, 7, 11);\n        AssertLocation(() => root[\"c\"], 8, 9, 12, 10);\n        AssertLocation(() => root[\"d\"], 14, 0, 14, 2);\n\n        var array = root[\"a\"];\n        AssertLocation(() => array[0], 2, 12, 2, 17);\n        AssertLocation(() => array[1], 3, 12, 3, 17);\n        AssertLocation(() => array[2], 4, 12, 4, 17);\n        AssertLocation(() => array[3], 5, 12, 5, 24);\n\n        AssertLocation(() => array[3][\"x\"], 5, 19, 5, 23);\n    }\n\n    [TestMethod]\n    public void Location_EndOfLines()\n    {\n        const string json = \"[0,\\n1,\\r2,\\r\\n3,\\u20284,\\u20295]\";\n        var sut = new SyntaxAnalyzer(json);\n        var root = sut.Parse();\n        AssertLocation(() => root, 0, 0, 5, 2);\n        AssertLocation(() => root[0], 0, 1, 0, 2);\n        AssertLocation(() => root[1], 1, 0, 1, 1);\n        AssertLocation(() => root[2], 2, 0, 2, 1);\n        AssertLocation(() => root[3], 3, 0, 3, 1);\n        AssertLocation(() => root[4], 4, 0, 4, 1);\n        AssertLocation(() => root[5], 5, 0, 5, 1);\n    }\n\n    private static void AssertLocation(Expression<Func<JsonNode>> expression, int startLine, int startCharacter, int endLine, int endCharacter)\n    {\n        var node = expression.Compile()();\n        node.Start.Line.Should().Be(startLine, expression.ToString());\n        node.Start.Character.Should().Be(startCharacter, expression.ToString());\n        node.End.Line.Should().Be(endLine, expression.ToString());\n        node.End.Character.Should().Be(endCharacter, expression.ToString());\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/RegularExpressions/RegexContextTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text.RegularExpressions;\n\nnamespace SonarAnalyzer.Core.RegularExpressions.Test;\n\n[TestClass]\npublic class RegexContextTest\n{\n    [TestMethod]\n    [DataRow(\"[A\", RegexOptions.None)]\n#if NET\n    [DataRow(@\"^([0-9]{2})(?<!00)$\", RegexOptions.NonBacktracking)]\n#endif\n    public void InvalidInput_SetParseError(string pattern, RegexOptions options) =>\n        new RegexContext(null, pattern, null, options).ParseError.Should().NotBeNull();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/RegularExpressions/WildcardPatternMatcherTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\n\nnamespace SonarAnalyzer.Core.RegularExpressions.Test;\n\n[TestClass]\npublic class WildcardPatternMatcherTest\n{\n    /// <summary>\n    /// Based on https://github.com/SonarSource/sonar-plugin-api/blob/master/plugin-api/src/test/java/org/sonar/api/utils/WildcardPatternTest.java.\n    /// </summary>\n    [TestMethod]\n    [DataRow(\"Foo\", \"Foo\", true)]\n    [DataRow(\"foo\", \"FOO\", false)]\n    [DataRow(\"Foo\", \"Foot\", false)]\n    [DataRow(\"Foo\", \"Bar\", false)]\n    [DataRow(\"org/T?st.cs\", \"org/Test.cs\", true)]\n    [DataRow(\"org/T?st.cs\", \"org/Tost.cs\", true)]\n    [DataRow(\"org/T?st.cs\", \"org/Teeest.cs\", false)]\n    [DataRow(\"org/*.cs\", \"org/Foo.cs\", true)]\n    [DataRow(\"org/*.cs\", \"org/Bar.cs\", true)]\n    [DataRow(\"org/**\", \"org/Foo.cs\", true)]\n    [DataRow(\"org/**\", \"org/foo/bar.jsp\", true)]\n    [DataRow(\"org/**/Test.cs\", \"org/Test.cs\", true)]\n    [DataRow(\"org/**/Test.cs\", \"org/foo/Test.cs\", true)]\n    [DataRow(\"org/**/Test.cs\", \"org/foo/bar/Test.cs\", true)]\n    [DataRow(\"org/**/*.cs\", \"org/Foo.cs\", true)]\n    [DataRow(\"org/**/*.cs\", \"org/foo/Bar.cs\", true)]\n    [DataRow(\"org/**/*.cs\", \"org/foo/bar/Baz.cs\", true)]\n    [DataRow(\"o?/**/*.cs\", \"org/test.cs\", false)]\n    [DataRow(\"o?/**/*.cs\", \"o/test.cs\", false)]\n    [DataRow(\"o?/**/*.cs\", \"og/test.cs\", true)]\n    [DataRow(\"o?/**/*.cs\", \"og/foo/bar/test.cs\", true)]\n    [DataRow(\"o?/**/*.cs\", \"og/foo/bar/test.c\", false)]\n    [DataRow(\"org/sonar/**\", \"org/sonar/commons/Foo\", true)]\n    [DataRow(\"org/sonar/**\", \"org/sonar/Foo.cs\", true)]\n    [DataRow(\"xxx/org/sonar/**\", \"org/sonar/Foo\", false)]\n    [DataRow(\"org/sonar/**/**\", \"org/sonar/commons/Foo\", true)]\n    [DataRow(\"org/sonar/**/**\", \"org/sonar/commons/sub/Foo.cs\", true)]\n    [DataRow(\"org/sonar/**/Foo\", \"org/sonar/commons/sub/Foo\", true)]\n    [DataRow(\"org/sonar/**/Foo\", \"org/sonar/Foo\", true)]\n    [DataRow(\"*/foo/*\", \"org/foo/Bar\", true)]\n    [DataRow(\"*/foo/*\", \"foo/Bar\", false)]\n    [DataRow(\"*/foo/*\", \"foo\", false)]\n    [DataRow(\"*/foo/*\", \"org/foo/bar/Hello\", false)]\n    [DataRow(\"hell?\", \"hell\", false)]\n    [DataRow(\"hell?\", \"hello\", true)]\n    [DataRow(\"hell?\", \"helloworld\", false)]\n    [DataRow(\"**/Reader\", \"java/io/Reader\", true)]\n    [DataRow(\"**/Reader\", \"org/sonar/channel/CodeReader\", false)]\n    [DataRow(\"**\", \"java/io/Reader\", true)]\n    [DataRow(\"**/app/**\", \"com/app/Utils\", true)]\n    [DataRow(\"**/app/**\", \"com/application/MyService\", false)]\n    [DataRow(\"**/*$*\", \"foo/bar\", false)]\n    [DataRow(\"**/*$*\", \"foo/bar$baz\", true)]\n    [DataRow(\"a+\", \"aa\", false)]\n    [DataRow(\"a+\", \"a+\", true)]\n    [DataRow(\"[ab]\", \"a\", false)]\n    [DataRow(\"[ab]\", \"[ab]\", true)]\n    [DataRow(\"\\\\n\", \"\\n\", false)]\n    [DataRow(\"foo\\\\bar\", \"foo/bar\", true)]\n    [DataRow(\"/foo\", \"foo\", true)]\n    [DataRow(\"\\\\foo\", \"foo\", true)]\n    [DataRow(\"foo\\\\bar\", \"foo\\\\bar\", true)]\n    [DataRow(\"foo/bar\", \"foo\\\\bar\", true)]\n    [DataRow(\"foo\\\\bar/baz\", \"foo\\\\bar\\\\baz\", true)]\n    [DataRow(\"*cshtml.g.cs\", \"hello_cshtml.g.cs\", true)] // Compile time cshtml auto-generated files\n    [DataRow(\"*razor.g.cs\", \"hello_razor.g.cs\", true)] // Compile time cshtml auto-generated files\n    [DataRow(\"**\\\\*cshtml*g.cs\", \"C:\\\\Something\\\\SomeFile.cshtml.-6NXeWT5Akt4vxdz.ide.g.cs\", true)] // Design time cshtml auto-generated files\n    [DataRow(\"**/*cshtml*g.cs\", \"C:\\\\Something\\\\SomeFile.cshtml.-6NXeWT5Akt4vxdz.ide.g.cs\", true)]\n    [DataRow(\"**/*razor*ide.g.cs\", \"C:\\\\Something\\\\SomeFile.razor.-6NXeWT5Akt4vxdz.ide.g.cs\", true)] // Design time razor auto-generated files\n    public void IsMatch_MatchesPatternsAsExpected(string pattern, string input, bool expectedResult)\n    {\n        // The test cases are copied from the plugin-api and the directory separators need replacing as Roslyn will not give us the paths with '/'.\n        input = input.Replace(\"/\", Path.DirectorySeparatorChar.ToString());\n\n        WildcardPatternMatcher.IsMatch(pattern, input, false).Should().Be(expectedResult);\n    }\n\n    [TestMethod]\n    [DataRow(\"\")]\n    [DataRow(\"  \")]\n    [DataRow(\"/\")]\n    [DataRow(\"\\\\\")]\n    public void IsMatch_InvalidPattern_ReturnsFalse(string pattern) =>\n        WildcardPatternMatcher.IsMatch(pattern, \"foo\", false).Should().BeFalse();\n\n    [TestMethod]\n    [DataRow(null, \"foo\")]\n    [DataRow(\"foo\", null)]\n    public void IsMatch_InputParametersArenull_DoesNotThrow(string pattern, string input) =>\n        WildcardPatternMatcher.IsMatch(pattern, input, false).Should().BeFalse();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Semantics/Extensions/IMethodSymbolExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\n\nnamespace SonarAnalyzer.Core.Test.Semantics.Extensions;\n\n[TestClass]\npublic class IMethodSymbolExtensionsTest\n{\n    internal const string TestInput = \"\"\"\n        using System.Linq;\n\n        namespace NS\n        {\n          public static class Helper\n          {\n            public static void ToVoid(this int self){}\n          }\n          public class Class\n          {\n            public static void TestMethod()\n            {\n              new int[] { 0, 1, 2 }.Any();\n              Enumerable.Any(new int[] { 0, 1, 2 });\n\n              new int[] { 0, 1, 2 }.Clone();\n\n              new int[] { 0, 1, 2 }.Cast<object>();\n\n              1.ToVoid();\n            }\n          }\n        }\n        \"\"\";\n\n    private SemanticModel model;\n    private List<StatementSyntax> statements;\n\n    public TestContext TestContext { get; set; }\n\n    [TestInitialize]\n    public void Compile()\n    {\n        var compilation = SolutionBuilder.Create().AddProject(AnalyzerLanguage.CSharp).AddSnippet(TestInput).GetCompilation();\n\n        var tree = compilation.SyntaxTrees.First();\n        model = compilation.GetSemanticModel(tree);\n        statements = tree.GetRoot(TestContext.CancellationToken).DescendantNodes().OfType<MethodDeclarationSyntax>().First(x => x.Identifier.ValueText == \"TestMethod\")\n            .Body.DescendantNodes().OfType<StatementSyntax>().ToList();\n    }\n\n    [TestMethod]\n    public void Symbol_IsExtensionOnIEnumerable()\n    {\n        MethodSymbolForIndex(3).IsExtensionOn(KnownType.System_Collections_IEnumerable)\n            .Should().BeTrue();\n\n        MethodSymbolForIndex(2).IsExtensionOn(KnownType.System_Collections_IEnumerable)\n            .Should().BeFalse();\n        MethodSymbolForIndex(1).IsExtensionOn(KnownType.System_Collections_IEnumerable)\n            .Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void Symbol_IsExtensionOnGenericIEnumerable()\n    {\n        MethodSymbolForIndex(0).IsExtensionOn(KnownType.System_Collections_Generic_IEnumerable_T)\n            .Should().BeTrue();\n        MethodSymbolForIndex(1).IsExtensionOn(KnownType.System_Collections_Generic_IEnumerable_T)\n            .Should().BeTrue();\n\n        MethodSymbolForIndex(2).IsExtensionOn(KnownType.System_Collections_Generic_IEnumerable_T)\n            .Should().BeFalse();\n        MethodSymbolForIndex(3).IsExtensionOn(KnownType.System_Collections_Generic_IEnumerable_T)\n            .Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void Symbol_IsExtensionOnInt()\n    {\n        MethodSymbolForIndex(4).IsExtensionOn(KnownType.System_Int32)\n            .Should().BeTrue();\n        MethodSymbolForIndex(2).IsExtensionOn(KnownType.System_Int32)\n            .Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void IsAnyAttributeInOverridingChain_WhenMethodSymbolIsNull_ReturnsFalse() =>\n        ((IMethodSymbol)null).IsAnyAttributeInOverridingChain().Should().BeFalse();\n\n    [TestMethod]\n    [DataRow(MethodKind.AnonymousFunction, \"method\")]\n    [DataRow(MethodKind.BuiltinOperator, \"operator\")]\n    [DataRow(MethodKind.Constructor, \"constructor\")]\n    [DataRow(MethodKind.Conversion, \"operator\")]\n    [DataRow(MethodKind.DeclareMethod, \"method\")]\n    [DataRow(MethodKind.DelegateInvoke, \"method\")]\n    [DataRow(MethodKind.Destructor, \"destructor\")]\n    [DataRow(MethodKind.EventAdd, \"method\")]\n    [DataRow(MethodKind.EventRaise, \"method\")]\n    [DataRow(MethodKind.EventRemove, \"method\")]\n    [DataRow(MethodKind.ExplicitInterfaceImplementation, \"method\")]\n    [DataRow(MethodKind.FunctionPointerSignature, \"method\")]\n    [DataRow(MethodKind.LambdaMethod, \"method\")]\n    [DataRow(MethodKind.LocalFunction, \"local function\")]\n    [DataRow(MethodKind.Ordinary, \"method\")]\n    [DataRow(MethodKind.PropertyGet, \"getter\")]\n    [DataRow(MethodKind.PropertySet, \"setter\")]\n    [DataRow(MethodKind.ReducedExtension, \"method\")]\n    [DataRow(MethodKind.SharedConstructor, \"constructor\")]\n    [DataRow(MethodKind.StaticConstructor, \"constructor\")]\n    [DataRow(MethodKind.UserDefinedOperator, \"operator\")]\n    public void GetClassification_Method(MethodKind methodKind, string expected)\n    {\n        var symbol = Substitute.For<IMethodSymbol>();\n        symbol.Kind.Returns(SymbolKind.Method);\n        symbol.MethodKind.Returns(methodKind);\n\n        symbol.GetClassification().Should().Be(expected);\n    }\n\n    [TestMethod]\n    [DataRow(\"BaseClass<int>         \", \"VirtualMethod               \", \"InheritedAttribute\", \"DerivedInheritedAttribute\", \"DerivedNotInheritedAttribute\", \"UnannotatedAttribute\", \"NotInheritedAttribute\")]\n    [DataRow(\"DerivedOpenGeneric<int>\", \"VirtualMethod               \", \"InheritedAttribute\", \"DerivedInheritedAttribute\", \"DerivedNotInheritedAttribute\", \"UnannotatedAttribute\")]\n    [DataRow(\"DerivedClosedGeneric   \", \"VirtualMethod               \", \"InheritedAttribute\", \"DerivedInheritedAttribute\", \"DerivedNotInheritedAttribute\", \"UnannotatedAttribute\")]\n    [DataRow(\"DerivedNoOverrides<int>\", \"VirtualMethod               \", \"InheritedAttribute\", \"DerivedInheritedAttribute\", \"DerivedNotInheritedAttribute\", \"UnannotatedAttribute\", \"NotInheritedAttribute\")]\n    [DataRow(\"DerivedOpenGeneric<int>\", \"GenericVirtualMethod<int>   \", \"InheritedAttribute\", \"DerivedInheritedAttribute\", \"DerivedNotInheritedAttribute\", \"UnannotatedAttribute\")]\n    [DataRow(\"DerivedClosedGeneric   \", \"GenericVirtualMethod<int>   \", \"InheritedAttribute\", \"DerivedInheritedAttribute\", \"DerivedNotInheritedAttribute\", \"UnannotatedAttribute\")]\n    [DataRow(\"DerivedNoOverrides<int>\", \"GenericVirtualMethod<int>   \", \"InheritedAttribute\", \"DerivedInheritedAttribute\", \"DerivedNotInheritedAttribute\", \"UnannotatedAttribute\", \"NotInheritedAttribute\")]\n    [DataRow(\"DerivedOpenGeneric<int>\", \"NonVirtualMethod            \")]\n    [DataRow(\"DerivedClosedGeneric   \", \"NonVirtualMethod            \")]\n    [DataRow(\"DerivedNoOverrides<int>\", \"NonVirtualMethod            \", \"InheritedAttribute\", \"DerivedInheritedAttribute\", \"DerivedNotInheritedAttribute\", \"UnannotatedAttribute\", \"NotInheritedAttribute\")]\n    [DataRow(\"DerivedOpenGeneric<int>\", \"GenericNonVirtualMethod<int>\")]\n    [DataRow(\"DerivedClosedGeneric   \", \"GenericNonVirtualMethod<int>\")]\n    [DataRow(\"DerivedNoOverrides<int>\", \"GenericNonVirtualMethod<int>\", \"InheritedAttribute\", \"DerivedInheritedAttribute\", \"DerivedNotInheritedAttribute\", \"UnannotatedAttribute\", \"NotInheritedAttribute\")]\n    public void GetAttributesWithInherited_MethodSymbol(string className, string methodName, params string[] expectedAttributes)\n    {\n        className = className.TrimEnd();\n        methodName = methodName.TrimEnd();\n        var code = $$\"\"\"\n            using System;\n\n            [AttributeUsage(AttributeTargets.All, Inherited = true)]\n            public class InheritedAttribute : Attribute { }\n\n            [AttributeUsage(AttributeTargets.All, Inherited = false)]\n            public class NotInheritedAttribute : Attribute { }\n\n            public class DerivedInheritedAttribute: InheritedAttribute { }\n\n            public class DerivedNotInheritedAttribute: NotInheritedAttribute { }\n\n            public class UnannotatedAttribute : Attribute { }\n\n            public class BaseClass<T1>\n            {\n                [Inherited]\n                [DerivedInherited]\n                [NotInherited]\n                [DerivedNotInherited]\n                [Unannotated]\n                public virtual void VirtualMethod() { }\n\n                [Inherited]\n                [DerivedInherited]\n                [NotInherited]\n                [DerivedNotInherited]\n                [Unannotated]\n                public void NonVirtualMethod() { }\n\n                [Inherited]\n                [DerivedInherited]\n                [NotInherited]\n                [DerivedNotInherited]\n                [Unannotated]\n                public void GenericNonVirtualMethod<T2>() { }\n\n                [Inherited]\n                [DerivedInherited]\n                [NotInherited]\n                [DerivedNotInherited]\n                [Unannotated]\n                public virtual void GenericVirtualMethod<T2>() { }\n            }\n\n            public class DerivedOpenGeneric<T1>: BaseClass<T1>\n            {\n                public override void VirtualMethod() { }\n                public new void NonVirtualMethod() { }\n                public new void GenericNonVirtualMethod<T2>() { }\n                public override void GenericVirtualMethod<T2>() { }\n            }\n\n            public class DerivedClosedGeneric: BaseClass<int>\n            {\n                public override void VirtualMethod() { }\n                public new void NonVirtualMethod() { }\n                public new void GenericNonVirtualMethod<T2>() { }\n                public override void GenericVirtualMethod<T2>() { }\n            }\n\n            public class DerivedNoOverrides<T>: BaseClass<T> { }\n\n            public class Program\n            {\n                public static void Main()\n                {\n                    new {{className}}().{{methodName}}();\n                }\n            }\n            \"\"\";\n        var compiler = new SnippetCompiler(code);\n        var invocationExpression = compiler.Nodes<InvocationExpressionSyntax>().Should().ContainSingle().Subject;\n        var method = compiler.Symbol<IMethodSymbol>(invocationExpression);\n        var actual = method.GetAttributesWithInherited().Select(x => x.AttributeClass.Name).ToList();\n        actual.Should().BeEquivalentTo(expectedAttributes);\n\n        // GetAttributesWithInherited should behave like MemberInfo.GetCustomAttributes from runtime reflection:\n        var type = compiler.EmitAssembly().GetType(className.Replace(\"<int>\", \"`1\"), throwOnError: true);\n        var methodInfo = type.GetMethod(methodName.Replace(\"<int>\", string.Empty));\n        methodInfo.GetCustomAttributes(inherit: true).Select(x => x.GetType().Name).Should().BeEquivalentTo(expectedAttributes);\n    }\n\n    [TestMethod]\n    [DataRow(\"3.0.20105.1\")]\n    [DataRow(TestConstants.NuGetLatestVersion)]\n    public void IsControllerActionMethod_PublicControllerMethods_AreEntryPoints(string aspNetMvcVersion)\n    {\n        const string code = \"\"\"\n            public abstract class Foo : System.Web.Mvc.Controller\n            {\n                public Foo() { }\n                public void PublicFoo() { }\n                protected void ProtectedFoo() { }\n                internal void InternalFoo() { }\n                private void PrivateFoo() { }\n                public static void StaticFoo() { }\n                public virtual void VirtualFoo() { }\n                public abstract void AbstractFoo();\n                public void InFoo(in string arg) { }\n                public void OutFoo(out string arg) { arg = null; }\n                public void RefFoo(ref string arg) { }\n                public void ReadonlyRefFoo(ref readonly string arg) { }\n                public void GenericFoo<T>(T arg) { }\n                private class Bar : System.Web.Mvc.Controller\n                {\n                    public void InnerFoo() { }\n                }\n                [System.Web.Mvc.NonActionAttribute]\n                public void PublicNonAction() { }\n            }\n            \"\"\";\n        var compilation = new SnippetCompiler(code, NuGetMetadataReference.MicrosoftAspNetMvc(aspNetMvcVersion));\n        compilation.TypeByMetadataName(\"Foo\").Constructors[0].IsControllerActionMethod().Should().BeFalse();\n        compilation.MethodSymbol(\"Foo.PublicFoo\").IsControllerActionMethod().Should().BeTrue();\n        compilation.MethodSymbol(\"Foo.ProtectedFoo\").IsControllerActionMethod().Should().BeFalse();\n        compilation.MethodSymbol(\"Foo.InternalFoo\").IsControllerActionMethod().Should().BeFalse();\n        compilation.MethodSymbol(\"Foo.PrivateFoo\").IsControllerActionMethod().Should().BeFalse();\n        compilation.MethodSymbol(\"Foo.StaticFoo\").IsControllerActionMethod().Should().BeFalse();\n        compilation.MethodSymbol(\"Foo.VirtualFoo\").IsControllerActionMethod().Should().BeTrue();\n        compilation.MethodSymbol(\"Foo.AbstractFoo\").IsControllerActionMethod().Should().BeTrue();\n        compilation.MethodSymbol(\"Foo.InFoo\").IsControllerActionMethod().Should().BeFalse();\n        compilation.MethodSymbol(\"Foo.OutFoo\").IsControllerActionMethod().Should().BeFalse();\n        compilation.MethodSymbol(\"Foo.ReadonlyRefFoo\").IsControllerActionMethod().Should().BeFalse();\n        compilation.MethodSymbol(\"Foo.RefFoo\").IsControllerActionMethod().Should().BeFalse();\n        compilation.MethodSymbol(\"Foo.GenericFoo\").IsControllerActionMethod().Should().BeFalse();\n        compilation.MethodSymbol(\"Foo.InnerFoo\").IsControllerActionMethod().Should().BeFalse();\n        compilation.MethodSymbol(\"Foo.PublicNonAction\").IsControllerActionMethod().Should().BeFalse();\n    }\n\n    [TestMethod]\n    [DataRow(\"3.0.20105.1\")]\n    [DataRow(TestConstants.NuGetLatestVersion)]\n    public void IsControllerActionMethod_ControllerMethods_AreEntryPoints(string aspNetMvcVersion)\n    {\n        const string code = \"\"\"\n            public class Foo : System.Web.Mvc.Controller\n            {\n                public void PublicFoo() { }\n                [System.Web.Mvc.NonActionAttribute]\n                public void PublicNonAction() { }\n            }\n            public class Controller\n            {\n                public void PublicBar() { }\n            }\n            public class MyController : Controller\n            {\n                public void PublicDiz() { }\n            }\n            \"\"\";\n        var compilation = new SnippetCompiler(code, NuGetMetadataReference.MicrosoftAspNetMvc(aspNetMvcVersion));\n        compilation.MethodSymbol(\"Foo.PublicFoo\").IsControllerActionMethod().Should().BeTrue();\n        compilation.MethodSymbol(\"Controller.PublicBar\").IsControllerActionMethod().Should().BeFalse();\n        compilation.MethodSymbol(\"MyController.PublicDiz\").IsControllerActionMethod().Should().BeFalse();\n        compilation.MethodSymbol(\"Foo.PublicNonAction\").IsControllerActionMethod().Should().BeFalse();\n    }\n\n    [TestMethod]\n    [DataRow(\"2.1.3\")]\n    [DataRow(TestConstants.NuGetLatestVersion)]\n    public void IsControllerActionMethod_MethodsInClassesWithControllerAttribute_AreEntryPoints(string aspNetMvcVersion)\n    {\n        const string code = \"\"\"\n            [Microsoft.AspNetCore.Mvc.ControllerAttribute]\n            public class Foo\n            {\n                public void PublicFoo() { }\n                [Microsoft.AspNetCore.Mvc.NonActionAttribute]\n                public void PublicNonAction() { }\n            }\n            \"\"\";\n        var compilation = new SnippetCompiler(code, MetadataReferenceFacade.NetStandard.Union(NuGetMetadataReference.MicrosoftAspNetCoreMvcCore(aspNetMvcVersion)));\n        compilation.MethodSymbol(\"Foo.PublicFoo\").IsControllerActionMethod().Should().BeTrue();\n        compilation.MethodSymbol(\"Foo.PublicNonAction\").IsControllerActionMethod().Should().BeFalse();\n    }\n\n    [TestMethod]\n    [DataRow(\"2.1.3\")]\n    [DataRow(TestConstants.NuGetLatestVersion)]\n    public void IsControllerActionMethod_MethodsInClassesWithNonControllerAttribute_AreNotEntryPoints(string aspNetMvcVersion)\n    {\n        const string code = \"\"\"\n            [Microsoft.AspNetCore.Mvc.NonControllerAttribute]\n            public class Foo : Microsoft.AspNetCore.Mvc.ControllerBase\n            {\n                public void PublicFoo() { }\n            }\n            \"\"\";\n        var compilation = new SnippetCompiler(code, MetadataReferenceFacade.NetStandard.Union(NuGetMetadataReference.MicrosoftAspNetCoreMvcCore(aspNetMvcVersion)));\n        compilation.MethodSymbol(\"Foo.PublicFoo\").IsControllerActionMethod().Should().BeFalse();\n    }\n\n    [TestMethod]\n    [DataRow(\"2.1.3\")]\n    [DataRow(TestConstants.NuGetLatestVersion)]\n    public void IsControllerActionMethod_ConstructorsInClasses_AreNotEntryPoints(string aspNetMvcVersion)\n    {\n        const string code = \"\"\"\n            [Microsoft.AspNetCore.Mvc.ControllerAttribute]\n            public class Foo : Microsoft.AspNetCore.Mvc.ControllerBase\n            {\n                public Foo() { }\n            }\n            \"\"\";\n        var compilation = new SnippetCompiler(code, MetadataReferenceFacade.NetStandard.Union(NuGetMetadataReference.MicrosoftAspNetCoreMvcCore(aspNetMvcVersion)));\n        compilation.TypeByMetadataName(\"Foo\").Constructors[0].IsControllerActionMethod().Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void IsImplementingInterfaceMember_VBRenamedExplicitImplementation()\n    {\n        var compilation = new SnippetCompiler(\"\"\"\n            Public Class Foo\n                Implements System.IEquatable(Of Foo)\n\n                Public Function MyEquals(other As Foo) As Boolean Implements System.IEquatable(Of Foo).Equals\n                    Return True\n                End Function\n            End Class\n            \"\"\",\n            false,\n            AnalyzerLanguage.VisualBasic);\n        var methodSymbol = compilation.DeclaredSymbols<IMethodSymbol>().Single(x => x.Name == \"MyEquals\");\n        methodSymbol.IsImplementingInterfaceMember(KnownType.System_IEquatable_T, nameof(IEquatable<>.Equals)).Should().BeTrue();\n    }\n\n    [TestMethod]\n    [DataRow(\"List<int>\", \"Clear()\", \"Clear\", \"System.Collections.Generic.ICollection\", \"T\")]\n    [DataRow(\"List<int>\", \"Clear()\", \"Clear\", \"System.Collections.IList\")]\n    [DataRow(\"List<int>\", \"RemoveAt(1)\", \"RemoveAt\", \"System.Collections.Generic.IList\", \"T\")]\n    [DataRow(\"List<int>\", \"RemoveAt(1)\", \"RemoveAt\", \"System.Collections.IList\")]\n    [DataRow(\"ObservableCollection<int>\", \"RemoveAt(1)\", \"RemoveAt\", \"System.Collections.Generic.IList\", \"T\")]\n    [DataRow(\"ObservableCollection<int>\", \"RemoveAt(1)\", \"RemoveAt\", \"System.Collections.IList\")]\n    [DataRow(\"Derived1\", \"ToString(string.Empty, null)\", \"ToString\", \"System.IFormattable\")]\n    [DataRow(\"Derived2\", \"ToString(string.Empty, null)\", \"ToString\", \"System.IFormattable\")]\n    [DataRow(\"Derived3\", \"ToString(string.Empty, null)\", \"ToString\", \"System.IFormattable\")]\n    [DataRow(\"Derived4\", \"ToString(string.Empty, null)\", \"ToString\", \"System.IFormattable\")]\n    public void IsImplementingInterfaceMember_Methods(string declaration, string invocation, string methodName, string interfaceType, params string[] genericParameter)\n    {\n        var code = $$\"\"\"\n            using System;\n            using System.Collections.Generic;\n            using System.Collections.ObjectModel;\n\n            public class Test\n            {\n                public void Method({{declaration}} instance)\n                {\n                    instance.{{invocation}};\n                }\n            }\n\n            public class Base\n            {\n                public virtual string ToString(string format, IFormatProvider formatProvider) => \"\";\n            }\n\n            public class Derived1: Base, IFormattable\n            {\n                public override string ToString(string format, IFormatProvider formatProvider) => \"\";\n            }\n\n            public class Derived2: Derived1\n            {\n                public override string ToString(string format, IFormatProvider formatProvider) => \"\";\n            }\n\n            public class Derived3: Derived2\n            { }\n\n            public class Derived4: Derived3\n            {\n                public override string ToString(string format, IFormatProvider formatProvider) => \"\";\n            }\n            \"\"\";\n        var compilation = new SnippetCompiler(code);\n        var invocationSyntax = compilation.Tree.GetRoot(TestContext.CancellationToken).DescendantNodesAndSelf().OfType<InvocationExpressionSyntax>().First();\n        var methodSymbol = compilation.Model.GetSymbolInfo(invocationSyntax, TestContext.CancellationToken).Symbol as IMethodSymbol;\n        methodSymbol.IsImplementingInterfaceMember(new KnownType(interfaceType, genericParameter), methodName).Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void IsExtension_ExtensionMethod_ReturnsTrue_CS() =>\n        new SnippetCompiler(\"\"\"\n            public static class Extensions\n            {\n                public static void ExtensionMethod(this string s) { }\n                extension(string s)\n                {\n                    public int ExtensionMemberMethod() => 42;\n                }\n                extension(string)\n                {\n                    public static int StaticExtensionMemberMethod() => 42;\n                }\n            }\n            \"\"\").DeclaredSymbols<IMethodSymbol>().Should().AllSatisfy(x => x.IsExtension.Should().BeTrue());\n\n    [TestMethod]\n    public void IsExtension_RegularMethod_ReturnsFalse_CS() =>\n        new SnippetCompiler(\"\"\"\n            public class Sample\n            {\n                public void RegularMethod() { }\n                public static void StaticRegularMethod() { }\n            }\n            \"\"\").DeclaredSymbols<IMethodSymbol>().Should().AllSatisfy(x => x.IsExtension.Should().BeFalse());\n\n    [TestMethod]\n    public void IsExtension_ExtensionMethod_ReturnsTrue_VB() =>\n        new SnippetCompiler(\"\"\"\n            Module Extensions\n                <Runtime.CompilerServices.Extension>\n                Public Sub ExtensionMethod(s As String)\n                End Sub\n            End Module\n            \"\"\",\n            false,\n            AnalyzerLanguage.VisualBasic).DeclaredSymbols<IMethodSymbol>().Should().AllSatisfy(x => x.IsExtension.Should().BeTrue());\n\n    [TestMethod]\n    public void IsExtension_RegularMethod_ReturnsFalse_VB() =>\n        new SnippetCompiler(\"\"\"\n            Public Class Sample\n                Public Sub RegularMethod()\n                End Sub\n                Public Shared Sub SharedRegularMethod()\n                End Sub\n            End Class\n            \"\"\",\n            false,\n            AnalyzerLanguage.VisualBasic).DeclaredSymbols<IMethodSymbol>().Should().AllSatisfy(x => x.IsExtension.Should().BeFalse());\n\n    private IMethodSymbol MethodSymbolForIndex(int index)\n    {\n        var statement = (ExpressionStatementSyntax)statements[index];\n        var methodSymbol = model.GetSymbolInfo(statement.Expression, TestContext.CancellationToken).Symbol as IMethodSymbol;\n        return methodSymbol;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Semantics/Extensions/INamedTypeSymbolExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Test.Semantics.Extensions;\n\n[TestClass]\npublic class INamedTypeSymbolExtensionsTest\n{\n    [TestMethod]\n    public void GetAllNamedTypesForNamedType_WhenSymbolIsNull_ReturnsEmpty() =>\n        ((INamedTypeSymbol)null).GetAllNamedTypes().Should().BeEmpty();\n\n    [TestMethod]\n    [DataRow(TypeKind.Array, \"array\")]\n    [DataRow(TypeKind.Class, \"class\")]\n    [DataRow(TypeKind.Delegate, \"delegate\")]\n    [DataRow(TypeKind.Dynamic, \"dynamic\")]\n    [DataRow(TypeKind.Enum, \"enum\")]\n    [DataRow(TypeKind.Error, \"error\")]\n    [DataRow(TypeKind.FunctionPointer, \"function pointer\")]\n    [DataRow(TypeKind.Interface, \"interface\")]\n    [DataRow(TypeKind.Module, \"module\")]\n    [DataRow(TypeKind.Pointer, \"pointer\")]\n    [DataRow(TypeKind.Struct, \"struct\")]\n    [DataRow(TypeKind.Structure, \"struct\")]\n    [DataRow(TypeKind.Submission, \"submission\")]\n    [DataRow(TypeKind.TypeParameter, \"type parameter\")]\n    [DataRow(TypeKind.Unknown, \"unknown\")]\n    public void GetClassification_NamedTypes(TypeKind typeKind, string expected)\n    {\n        var symbol = Substitute.For<INamedTypeSymbol>();\n        symbol.Kind.Returns(SymbolKind.NamedType);\n        symbol.TypeKind.Returns(typeKind);\n        symbol.IsRecord.Returns(false);\n\n        symbol.GetClassification().Should().Be(expected);\n    }\n\n    [TestMethod]\n    public void GetClassification_NamedType_Unknown()\n    {\n        var symbol = Substitute.For<INamedTypeSymbol>();\n        symbol.Kind.Returns(SymbolKind.NamedType);\n        symbol.TypeKind.Returns((TypeKind)255);\n#if DEBUG\n        new Action(() => symbol.GetClassification()).Should().Throw<NotSupportedException>();\n#else\n        symbol.GetClassification().Should().Be(\"type\");\n#endif\n    }\n\n    [TestMethod]\n    [DataRow(TypeKind.Class, \"record\")]\n    [DataRow(TypeKind.Struct, \"record struct\")]\n    public void GetClassification_Record(TypeKind typeKind, string expected)\n    {\n        var symbol = Substitute.For<INamedTypeSymbol>();\n        symbol.Kind.Returns(SymbolKind.NamedType);\n        symbol.TypeKind.Returns(typeKind);\n        symbol.IsRecord.Returns(true);\n\n        symbol.GetClassification().Should().Be(expected);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Semantics/Extensions/INamespaceSymbolExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\n\nnamespace SonarAnalyzer.Core.Test.Semantics.Extensions;\n\n[TestClass]\npublic class INamespaceSymbolExtensionsTest\n{\n    [TestMethod]\n    [DataRow(\"System\", \"System\")]\n    [DataRow(\"System.Collections.Generic\", \"System.Collections.Generic\")]\n    // Odd cases but nothing that needs a fix:\n    [DataRow(\"System.Collections.Generic\", \"System..Collections..Generic\")]\n    [DataRow(\"System.Collections.Generic\", \".System.Collections.Generic.\")]\n    public void Is_ValidNameSpaces(string code, string test)\n    {\n        var snippet = $\"\"\"\n            using {code};\n            \"\"\";\n        var (tree, model) = TestCompiler.CompileCS(snippet);\n        var name = tree.GetRoot().DescendantNodes().OfType<UsingDirectiveSyntax>().Single().Name;\n        var symbol = model.GetSymbolInfo(name).Symbol;\n        var ns = symbol.Should().BeAssignableTo<INamespaceSymbol>().Subject;\n        ns.Is(test).Should().BeTrue();\n    }\n\n    [TestMethod]\n    [DataRow(\"\", true)]\n    [DataRow(\"System\", false)]\n    public void Is_Global(string test, bool expected)\n    {\n        var snippet = \"\"\"\n            using System;\n            \"\"\";\n        var (tree, model) = TestCompiler.CompileCS(snippet);\n        var name = tree.GetRoot().DescendantNodes().OfType<UsingDirectiveSyntax>().Single().Name;\n        var symbol = model.GetSymbolInfo(name).Symbol;\n        var ns = symbol.Should().BeAssignableTo<INamespaceSymbol>().Subject;\n        var globalNs = ns.ContainingNamespace;\n        globalNs.IsGlobalNamespace.Should().BeTrue();\n        globalNs.Is(test).Should().Be(expected);\n    }\n\n    [TestMethod]\n    [DataRow(\"System\", \"Microsoft\")]\n    [DataRow(\"System\", \"System.Collections\")]\n    [DataRow(\"System.Collections\", \"System\")]\n    [DataRow(\"System.Collections\", \"Collections\")]\n    [DataRow(\"System.Collections\", \"System.Collections.Generic\")]\n    [DataRow(\"System.Collections\", \"Collections.Generic\")]\n    [DataRow(\"System.Collections.Generic\", \"System.Collections\")]\n    [DataRow(\"System.Collections.Generic\", \"Generic\")]\n    [DataRow(\"System.Collections.Generic\", \"\")]\n    [DataRow(\"System.Collections.Generic\", \"global::System.Collections.Generic\")]\n    [DataRow(\"System.Collections.Generic\", \"global.System.Collections.Generic\")]\n    public void Is_InvalidNameSpaces(string code, string test)\n    {\n        var snippet = $\"\"\"\n            using {code};\n            \"\"\";\n        var (tree, model) = TestCompiler.CompileCS(snippet);\n        var name = tree.GetRoot().DescendantNodes().OfType<UsingDirectiveSyntax>().Single().Name;\n        var symbol = model.GetSymbolInfo(name).Symbol;\n        var ns = symbol.Should().BeAssignableTo<INamespaceSymbol>().Subject;\n        ns.Is(test).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void Is_ThrowsArgumentNullExceptionForName()\n    {\n        var snippet = \"\"\"\n            using System;\n            \"\"\";\n        var (tree, model) = TestCompiler.CompileCS(snippet);\n        var name = tree.GetRoot().DescendantNodes().OfType<UsingDirectiveSyntax>().Single().Name;\n        var symbol = model.GetSymbolInfo(name).Symbol;\n        var ns = symbol.Should().BeAssignableTo<INamespaceSymbol>().Subject;\n        var action = () => ns.Is(null);\n        action.Should().Throw<ArgumentNullException>().WithMessage(\"*name*\");\n    }\n\n    [TestMethod]\n    [DataRow(\"\")]\n    [DataRow(\"System\")]\n    [DataRow(\"System.Collection\")]\n    public void Is_ReturnsFalseForNullSymbol(string nameSpace)\n    {\n        INamespaceSymbol ns = null;\n        ns.Is(nameSpace).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void GetAllNamedTypesForNamespace_WhenSymbolIsNull_ReturnsEmpty() =>\n        ((INamespaceSymbol)null).GetAllNamedTypes().Should().BeEmpty();\n\n    [TestMethod]\n    public void Symbol_GetSelfAndBaseTypes()\n    {\n        var snippet = new SnippetCompiler(\"\"\"\n            public class Base { }\n            public class Derived : Base { }\n            \"\"\");\n        var objectType = snippet.TypeByMetadataName(\"System.Object\");\n        var baseTypes = objectType.GetSelfAndBaseTypes().ToList();\n        baseTypes.Should().ContainSingle();\n        baseTypes.Should().HaveElementAt(0, objectType);\n\n        var derivedType = snippet.DeclaredSymbol<INamedTypeSymbol>(\"Derived\");\n        baseTypes = derivedType.GetSelfAndBaseTypes().ToList();\n        baseTypes.Should().HaveCount(3);\n        baseTypes.Should().HaveElementAt(0, derivedType);\n        baseTypes.Should().HaveElementAt(1, snippet.DeclaredSymbol<INamedTypeSymbol>(\"Base\"));\n        baseTypes.Should().HaveElementAt(2, objectType);\n    }\n\n    [TestMethod]\n    public void Symbol_GetAllNamedTypes_Type()\n    {\n        var snippet = new SnippetCompiler(\"\"\"\n            public class Outer\n            {\n                public class Nested\n                {\n                  public class NestedMore { }\n                }\n            }\n            \"\"\");\n        var typeSymbol = snippet.DeclaredSymbol<INamedTypeSymbol>(\"Outer\");\n        typeSymbol.GetAllNamedTypes().Should().HaveCount(3);\n    }\n\n    [TestMethod]\n    public void Symbol_GetAllNamedTypes_Namespace()\n    {\n        var snippet = new SnippetCompiler(\"\"\"\n            namespace NS\n            {\n              public class Base\n              {\n                public class Nested\n                {\n                  public class NestedMore { }\n                }\n              }\n              public class Derived : Base { }\n              public interface IInterface { }\n            }\n            \"\"\");\n        var nsSymbol = snippet.NamespaceSymbol(\"NS\");\n\n        nsSymbol.GetAllNamedTypes().Should().HaveCount(5);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Semantics/Extensions/IParameterSymbolExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Test.Semantics.Extensions;\n\n[TestClass]\npublic class IParameterSymbolExtensionsTest\n{\n    [TestMethod]\n    public void IsType_Null() =>\n        IParameterSymbolExtensions.IsType(null, KnownType.System_Boolean).Should().BeFalse();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Semantics/Extensions/IPropertySymbolExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Test.Semantics.Extensions;\n\n[TestClass]\npublic class IPropertySymbolExtensionsTest\n{\n    [TestMethod]\n    public void IsExtension_ExtensionProperty_ReturnsTrue() =>\n        new SnippetCompiler(\"\"\"\n            public static class Extensions\n            {\n                extension(string s)\n                {\n                    public int Property { get => 42; set { } }\n                    public int GetterOnly => 42;\n                    public int SetterOnly { set { } }\n                }\n                extension(string)\n                {\n                    public static int StaticProperty { get => 42; set { } }\n                    public static int StaticGetterOnly => 42;\n                    public static int StaticSetterOnly { set { } }\n                }\n            }\n            \"\"\").DeclaredSymbols<IPropertySymbol>().Should().AllSatisfy(x => x.IsExtension.Should().BeTrue());\n\n    [TestMethod]\n    public void IsExtension_RegularProperty_ReturnsFalse() =>\n        new SnippetCompiler(\"\"\"\n            public class Sample\n            {\n                public int Property { get; set; }\n                public int GetterOnly => 42;\n                public int SetterOnly { set { } }\n                public static int StaticProperty { get; set; }\n                public static int StaticGetterOnly => 42;\n                public static int StaticSetterOnly { set { } }\n            }\n            \"\"\").DeclaredSymbols<IPropertySymbol>().Should().AllSatisfy(x => x.IsExtension.Should().BeFalse());\n\n    [TestMethod]\n    public void IsAnyAttributeInOverridingChain_WhenPropertySymbolIsNull_ReturnsFalse() =>\n        IPropertySymbolExtensions.IsAnyAttributeInOverridingChain(null).Should().BeFalse();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Semantics/Extensions/ISymbolExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing ISymbolExtensionsCommon = SonarAnalyzer.Core.Semantics.Extensions.ISymbolExtensions;\n\nnamespace SonarAnalyzer.Core.Test.Semantics.Extensions;\n\n[TestClass]\npublic class ISymbolExtensionsTest\n{\n    private const string TestInput = \"\"\"\n        public interface IInterface\n        {\n            int Property2 { get; set; }\n            void Method3();\n        }\n\n        public interface IOtherInterface\n        {\n            void Method3();\n        }\n\n        public abstract class Base\n        {\n            public virtual void Method1() { }\n            protected virtual void Method2() { }\n            public abstract int Property { get; set; }\n\n            public void Method4(){}\n        }\n\n        public class Derived1 : Base\n        {\n            public override int Property { get; set; }\n            private int PrivateProperty { get; set; }\n            private protected int PrivateProtectedProperty { get; set; }\n            protected int ProtectedProperty { get; set; }\n            protected internal int ProtectedInternalProperty { get; set; }\n            internal int InternalProperty { get; set; }\n        }\n\n        public abstract class Derived2 : Base, IInterface\n        {\n            public override int Property { get; set; }\n            public int Property2 { get; set; }\n            public virtual void Method3(){}\n\n            public abstract void Method5();\n        }\n\n        public class Derived3: Derived2, IInterface, IOtherInterface\n        {\n            public override void Method3(){}\n            public override void Method5() {}\n        }\n\n        public class TwoInterfaces: IInterface, IOtherInterface\n        {\n            public int Property2 { get; set; }\n            public void Method3(){}\n        }\n        \"\"\";\n\n    private SnippetCompiler testSnippet;\n\n    [TestInitialize]\n    public void Compile() =>\n        testSnippet = new SnippetCompiler(TestInput);\n\n    [TestMethod]\n    public void IsInType_Null_KnownType() =>\n        ISymbolExtensionsCommon.IsInType(null, KnownType.System_Boolean).Should().BeFalse();\n\n    [TestMethod]\n    public void IsInType_Null_TypeSymbol() =>\n        ISymbolExtensionsCommon.IsInType(null, (ITypeSymbol)null).Should().BeFalse();\n\n    [TestMethod]\n    public void IsInType_Null_ArrayOfTypeSymbols() =>\n        ISymbolExtensionsCommon.IsInType(null, []).Should().BeFalse();\n\n    [TestMethod]\n    [DataRow(\"{ get; set; }\")]\n    [DataRow(\"{ get; }\")]\n    [DataRow(\"{ get; } = string.Empty;\")]\n    [DataRow(\"{ get; set; } = string.Empty;\")]\n#if NET\n    [DataRow(\"{ get; init; }\")]\n#endif\n    public void IsAutoProperty_AutoProperty_CS(string getterSetter)\n    {\n        var code = $$\"\"\"\n            public class Sample\n            {\n                public string SymbolMember {{getterSetter}}\n            }\n            \"\"\";\n        CreateSymbol(code, AnalyzerLanguage.CSharp).IsAutoProperty().Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void IsAutoProperty_AutoProperty_VB()\n    {\n        const string code = \"\"\"\n            Public Class Sample\n\n                Public Property SymbolMember As String\n\n            End Class\n            \"\"\";\n        CreateSymbol(code, AnalyzerLanguage.VisualBasic).IsAutoProperty().Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void IsAutoProperty_ExplicitProperty_CS()\n    {\n        const string code = \"\"\"\n            public class Sample\n            {\n                private string _SymbolMember; // Try to confuse the method with auto-like implementation\n\n                public string SymbolMember\n                {\n                    get => _SymbolMember;\n                    set { _SymbolMember = value; }\n                }\n            }\n            \"\"\";\n        CreateSymbol(code, AnalyzerLanguage.CSharp).IsAutoProperty().Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void IsAutoProperty_ExplicitProperty_VB()\n    {\n        const string code = \"\"\"\n            Public Class Sample\n\n                Private _SymbolMember As String ' Try to confuse the method with auto-like implementation\n\n                Public Property SymbolMember As String\n                    Get\n                        Return _SymbolMember\n                    End Get\n                    Set(value As String)\n                        _SymbolMember = value\n                    End Set\n                End Property\n\n            End Class\n            \"\"\";\n        CreateSymbol(code, AnalyzerLanguage.VisualBasic).IsAutoProperty().Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void IsAutoProperty_NonpropertySymbol_CS()\n    {\n        const string code = \"\"\"\n            public class Sample\n            {\n                public void SymbolMember() { }\n            }\n            \"\"\";\n        CreateSymbol(code, AnalyzerLanguage.CSharp).IsAutoProperty().Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void IsAutoProperty_NonpropertySymbol_VB()\n    {\n        const string code = \"\"\"\n            Public Class Sample\n\n                Public Sub SymbolMember()\n                End Sub\n\n            End Class\n            \"\"\";\n        CreateSymbol(code, AnalyzerLanguage.VisualBasic).IsAutoProperty().Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void Symbol_IsPublicApi()\n    {\n        testSnippet.MethodSymbol(\"Base.Method1\").IsPubliclyAccessible().Should().BeTrue();\n        testSnippet.MethodSymbol(\"Base.Method2\").IsPubliclyAccessible().Should().BeTrue();\n        testSnippet.PropertySymbol(\"Base.Property\").IsPubliclyAccessible().Should().BeTrue();\n        testSnippet.PropertySymbol(\"IInterface.Property2\").IsPubliclyAccessible().Should().BeTrue();\n        testSnippet.PropertySymbol(\"Derived1.PrivateProperty\").IsPubliclyAccessible().Should().BeFalse();\n        testSnippet.PropertySymbol(\"Derived1.PrivateProtectedProperty\").IsPubliclyAccessible().Should().BeFalse();\n        testSnippet.PropertySymbol(\"Derived1.ProtectedProperty\").IsPubliclyAccessible().Should().BeTrue();\n        testSnippet.PropertySymbol(\"Derived1.ProtectedInternalProperty\").IsPubliclyAccessible().Should().BeTrue();\n        testSnippet.PropertySymbol(\"Derived1.InternalProperty\").IsPubliclyAccessible().Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void Symbol_InterfaceMembersOrMemberOverride()\n    {\n        testSnippet.MethodSymbol(\"Base.Method1\").InterfaceMembers().Should().BeEmpty();\n        testSnippet.MethodSymbol(\"Base.Method1\").GetOverriddenMember().Should().BeNull();\n        testSnippet.PropertySymbol(\"Derived2.Property\").GetOverriddenMember().Should().NotBeNull();\n        testSnippet.PropertySymbol(\"Derived2.Property2\").InterfaceMembers().Should().ContainSingle();\n        testSnippet.MethodSymbol(\"Derived2.Method3\").InterfaceMembers().Should().ContainSingle().Which.Should().Be(testSnippet.MethodSymbol(\"IInterface.Method3\"));\n        testSnippet.MethodSymbol(\"TwoInterfaces.Method3\").InterfaceMembers().Should().BeEquivalentTo([\n            testSnippet.MethodSymbol(\"IInterface.Method3\"),\n            testSnippet.MethodSymbol(\"IOtherInterface.Method3\")]);\n        testSnippet.MethodSymbol(\"Derived3.Method3\").InterfaceMembers().Should().BeEquivalentTo([\n            testSnippet.MethodSymbol(\"IInterface.Method3\"),\n            testSnippet.MethodSymbol(\"IOtherInterface.Method3\")]);\n    }\n\n    [TestMethod]\n    [CombinatorialData]\n    public void Symbol_InterfaceMembers_CrossAssemblyNullableContext(\n        [CombinatorialValues(\"disable\", \"enable\")] string nullableExternal,\n        [CombinatorialValues(\"disable\", \"enable\")] string nullableInternal)\n    {\n        // Tests that InterfaceMembers() correctly identifies implementations regardless of nullable context.\n        // See https://github.com/SonarSource/sonar-dotnet-enterprise/pull/1732 for details.\n        var returnAnnotation = nullableExternal == \"enable\" ? \"?\" : string.Empty;\n        var paramAnnotation = nullableInternal == \"enable\" ? \"?\" : string.Empty;\n\n        var interfaceCode = $$\"\"\"\n            #nullable {{nullableExternal}}\n            public interface IExternalInterface\n            {\n                string{{returnAnnotation}} Execute(string parameter);\n            }\n            \"\"\";\n\n        var implementationCode = $$\"\"\"\n            #nullable {{nullableInternal}}\n            public class Implementation : IExternalInterface\n            {\n                public string Execute(string{{paramAnnotation}} parameter) => \"\";\n            }\n            \"\"\";\n\n        var parseOptions = new CSharpParseOptions(LanguageVersion.Latest);\n        var interfaceMetadata = new SnippetCompiler(interfaceCode, ignoreErrors: false, AnalyzerLanguage.CSharp, parseOptions: parseOptions).Compilation.ToMetadataReference();\n        var implCompilation = new SnippetCompiler(implementationCode, ignoreErrors: false, AnalyzerLanguage.CSharp, [interfaceMetadata], parseOptions: parseOptions).Compilation;\n\n        var method = implCompilation.GetTypeByMetadataName(\"Implementation\").Should().BeAssignableTo<INamedTypeSymbol>()\n            .Which.GetMembers(\"Execute\").Should().ContainSingle()\n            .Which.Should().BeAssignableTo<IMethodSymbol>()\n            .Subject;\n        var interfaceMethod = implCompilation.GetTypeByMetadataName(\"IExternalInterface\").Should().BeAssignableTo<INamedTypeSymbol>()\n            .Which.GetMembers(\"Execute\").Should().ContainSingle()\n            .Which.Should().BeAssignableTo<IMethodSymbol>()\n            .Subject;\n\n        method.InterfaceMembers().Should().ContainSingle().Which.Should().Be(interfaceMethod);\n    }\n\n    [TestMethod]\n    public void Symbol_GetOverriddenMember()\n    {\n        var actualOverriddenMethod = testSnippet.MethodSymbol(\"Base.Method1\").GetOverriddenMember();\n        actualOverriddenMethod.Should().BeNull();\n\n        var expectedOverriddenProperty = testSnippet.PropertySymbol(\"Base.Property\");\n        var propertySymbol = testSnippet.PropertySymbol(\"Derived2.Property\");\n\n        var actualOverriddenProperty = propertySymbol.GetOverriddenMember();\n        actualOverriddenProperty.Should().NotBeNull();\n        actualOverriddenProperty.Should().Be(expectedOverriddenProperty);\n\n        testSnippet.MethodSymbol(\"Derived3.Method3\").GetOverriddenMember().Should().Be(testSnippet.MethodSymbol(\"Derived2.Method3\"));\n        testSnippet.MethodSymbol(\"Derived3.Method5\").GetOverriddenMember().Should().Be(testSnippet.MethodSymbol(\"Derived2.Method5\"));\n    }\n\n    [TestMethod]\n    public void Symbol_IsChangeable()\n    {\n        testSnippet.MethodSymbol(\"Base.Method1\").IsChangeable().Should().BeFalse();\n        testSnippet.MethodSymbol(\"Base.Method4\").IsChangeable().Should().BeTrue();\n        testSnippet.MethodSymbol(\"Derived2.Method5\").IsChangeable().Should().BeFalse();\n        testSnippet.MethodSymbol(\"Derived2.Method3\").IsChangeable().Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void AnyAttributeDerivesFrom_WhenSymbolIsNull_ReturnsFalse() =>\n        ISymbolExtensionsCommon.AnyAttributeDerivesFrom(null, KnownType.Void).Should().BeFalse();\n\n    [TestMethod]\n    public void AnyAttributeDerivesFromAny_WhenSymbolIsNull_ReturnsFalse() =>\n        ISymbolExtensionsCommon.AnyAttributeDerivesFromAny(null, [KnownType.Void]).Should().BeFalse();\n\n    [TestMethod]\n    public void GetAttributesForKnownType_WhenSymbolIsNull_ReturnsEmpty() =>\n        ISymbolExtensionsCommon.GetAttributes(null, KnownType.Void).Should().BeEmpty();\n\n    [TestMethod]\n    public void GetAttributesForKnownTypes_WhenSymbolIsNull_ReturnsEmpty() =>\n        ISymbolExtensionsCommon.GetAttributes(null, [KnownType.Void]).Should().BeEmpty();\n\n    [TestMethod]\n    public void GetParameters_WhenSymbolIsNotMethodOrProperty_ReturnsEmpty()\n    {\n        var symbol = Substitute.For<ISymbol>();\n        symbol.Kind.Returns(SymbolKind.Alias);\n        symbol.GetParameters().Should().BeEmpty();\n    }\n\n    [TestMethod]\n    public void InterfaceMembers_WhenSymbolIsNull_ReturnsEmpty() =>\n        ((ISymbol)null).InterfaceMembers().Should().BeEmpty();\n\n    [TestMethod]\n    public void GetOverriddenMember_WhenSymbolIsNull_ReturnsNull() =>\n        ((ISymbol)null).GetOverriddenMember().Should().BeNull();\n\n    [TestMethod]\n    public void GetEffectiveAccessibility_WhenSymbolIsNull_ReturnsNotApplicable() =>\n        ISymbolExtensionsCommon.GetEffectiveAccessibility(null).Should().Be(Accessibility.NotApplicable);\n\n    [TestMethod]\n    [DataRow(SymbolKind.Alias, \"alias\")]\n    [DataRow(SymbolKind.ArrayType, \"array\")]\n    [DataRow(SymbolKind.Assembly, \"assembly\")]\n    [DataRow(SymbolKind.Discard, \"discard\")]\n    [DataRow(SymbolKind.DynamicType, \"dynamic\")]\n    [DataRow(SymbolKind.ErrorType, \"error\")]\n    [DataRow(SymbolKind.Event, \"event\")]\n    [DataRow(SymbolKind.Field, \"field\")]\n    [DataRow(SymbolKind.FunctionPointerType, \"function pointer\")]\n    [DataRow(SymbolKind.Label, \"label\")]\n    [DataRow(SymbolKind.Local, \"local\")]\n    [DataRow(SymbolKind.Namespace, \"namespace\")]\n    [DataRow(SymbolKind.NetModule, \"netmodule\")]\n    [DataRow(SymbolKind.Parameter, \"parameter\")]\n    [DataRow(SymbolKind.PointerType, \"pointer\")]\n    [DataRow(SymbolKind.Preprocessing, \"preprocessing\")]\n    [DataRow(SymbolKind.Property, \"property\")]\n    [DataRow(SymbolKind.RangeVariable, \"range variable\")]\n    [DataRow(SymbolKind.TypeParameter, \"type parameter\")]\n    public void GetClassification_SimpleKinds(SymbolKind symbolKind, string expected)\n    {\n        var symbol = Substitute.For<ISymbol>();\n        symbol.Kind.Returns(symbolKind);\n        symbol.GetClassification().Should().Be(expected);\n    }\n\n    [TestMethod]\n    public void GetClassification_UnknowKind()\n    {\n        var symbol = Substitute.For<ISymbol>();\n        symbol.Kind.Returns((SymbolKind)999);\n#if DEBUG\n        new Action(() => symbol.GetClassification()).Should().Throw<NotSupportedException>();\n#else\n        ISymbolExtensionsCommon.GetClassification(symbol).Should().Be(\"symbol\");\n#endif\n    }\n\n    [TestMethod]\n    public void AllPartialParts_MethodSymbol_NonPartialMethod()\n    {\n        const string code = \"\"\"\n            public partial class Sample\n            {\n                partial void SymbolMember();\n            }\n            \"\"\";\n        var symbol = CreateSymbol(code, AnalyzerLanguage.CSharp);\n        var methodSymbol = symbol as IMethodSymbol;\n\n        var result = symbol.AllPartialParts().ToList();\n\n        result.Should().ContainSingle().And.Subject.Should().Contain(methodSymbol);\n    }\n\n    [TestMethod]\n    public void AllPartialParts_MethodSymbol_PartialMethodSameClass()\n    {\n        const string code = \"\"\"\n            public partial class Sample\n            {\n                partial void SymbolMember();\n                partial void SymbolMember() { }\n            }\n            \"\"\";\n        var symbols = CreateSymbols(code, AnalyzerLanguage.CSharp, x => x is MethodDeclarationSyntax);\n\n        var declarationSymbol = symbols[0] as IMethodSymbol;\n        var declarationResult = declarationSymbol.AllPartialParts().ToList();\n        declarationResult.Should().HaveCount(2).And.Contain([declarationSymbol, declarationSymbol.PartialImplementationPart]);\n\n        var implementationSymbol = symbols[1] as IMethodSymbol;\n        var implementationResult = implementationSymbol.AllPartialParts().ToList();\n        implementationResult.Should().HaveCount(2).And.Contain([implementationSymbol, implementationSymbol.PartialDefinitionPart]);\n    }\n\n    [TestMethod]\n    public void AllPartialParts_MethodSymbol_PartialMethodDifferentClass()\n    {\n        const string code = \"\"\"\n            public partial class Sample\n            {\n                partial void SymbolMember();\n            }\n            public partial class Sample\n            {\n                partial void SymbolMember() { }\n            }\n            \"\"\";\n        var symbols = CreateSymbols(code, AnalyzerLanguage.CSharp, x => x is MethodDeclarationSyntax);\n\n        var declarationSymbol = symbols[0] as IMethodSymbol;\n        var declarationResult = declarationSymbol.AllPartialParts().ToList();\n        declarationResult.Should().HaveCount(2).And.Contain([declarationSymbol, declarationSymbol.PartialImplementationPart]);\n\n        var implementationSymbol = symbols[1] as IMethodSymbol;\n        var implementationResult = implementationSymbol.AllPartialParts().ToList();\n        implementationResult.Should().HaveCount(2).And.Contain([implementationSymbol, implementationSymbol.PartialDefinitionPart]);\n    }\n\n    [TestMethod]\n    public void AllPartialParts_PropertySymbol_PartialPropertySameClass()\n    {\n        const string code = \"\"\"\n            public partial class Sample\n            {\n                public partial int SymbolMember { get; set; }\n                public partial int SymbolMember\n                {\n                    get => 0;\n                    set { }\n                }\n            }\n            \"\"\";\n        var symbols = CreateSymbols(code, AnalyzerLanguage.CSharp, x => x is PropertyDeclarationSyntax);\n\n        var declarationSymbol = symbols[0] as IPropertySymbol;\n        var declarationResult = declarationSymbol.AllPartialParts().ToList();\n        declarationResult.Should().HaveCount(2).And.Contain([declarationSymbol, declarationSymbol.PartialImplementationPart]);\n\n        var implementationSymbol = symbols[1] as IPropertySymbol;\n        var implementationResult = implementationSymbol.AllPartialParts().ToList();\n        implementationResult.Should().HaveCount(2).And.Contain([implementationSymbol, implementationSymbol.PartialDefinitionPart]);\n    }\n\n    [TestMethod]\n    public void AllPartialParts_PropertySymbol_PartialPropertyDifferentClass()\n    {\n        const string code = \"\"\"\n            public partial class Sample\n            {\n                public partial int SymbolMember { get; set; }\n            }\n            public partial class Sample\n            {\n                public partial int SymbolMember\n                {\n                    get => 0;\n                    set { }\n                }\n            }\n            \"\"\";\n        var symbols = CreateSymbols(code, AnalyzerLanguage.CSharp, x => x is PropertyDeclarationSyntax);\n\n        var declarationSymbol = symbols[0] as IPropertySymbol;\n        var declarationResult = declarationSymbol.AllPartialParts().ToList();\n        declarationResult.Should().HaveCount(2).And.Contain([declarationSymbol, declarationSymbol.PartialImplementationPart]);\n\n        var implementationSymbol = symbols[1] as IPropertySymbol;\n        var implementationResult = implementationSymbol.AllPartialParts().ToList();\n        implementationResult.Should().HaveCount(2).And.Contain([implementationSymbol, implementationSymbol.PartialDefinitionPart]);\n    }\n\n    [TestMethod]\n    public void AllPartialParts_OtherSymbol()\n    {\n        var result = Substitute.For<ISymbol>().AllPartialParts().ToList();\n        result.Should().ContainSingle();\n    }\n\n    private static ISymbol CreateSymbol(string snippet, AnalyzerLanguage language, ParseOptions parseOptions = null)\n    {\n        var (tree, semanticModel) = TestCompiler.Compile(snippet, false, language, parseOptions: parseOptions);\n        var node = tree.GetRoot().DescendantNodes().Last(x => x.ToString().Contains(\" SymbolMember\"));\n        return semanticModel.GetDeclaredSymbol(node);\n    }\n\n    private static List<ISymbol> CreateSymbols(string snippet, AnalyzerLanguage language, Func<SyntaxNode, bool> additionalFilter = null)\n    {\n        var (tree, semanticModel) = TestCompiler.Compile(snippet, false, language);\n        var nodes = tree.GetRoot().DescendantNodes().Where(x => x.ToString().Contains(\"SymbolMember\") && (additionalFilter?.Invoke(x) ?? true)).ToList();\n        return nodes.Select(x => semanticModel.GetDeclaredSymbol(x)).ToList();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Semantics/Extensions/ITypeSymbolExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\n\nnamespace SonarAnalyzer.Core.Test.Semantics.Extensions;\n\n[TestClass]\npublic class ITypeSymbolExtensionsTest\n{\n    private const string TestInput = \"\"\"\n        namespace NS\n        {\n            using System;\n            using PropertyBag = System.Collections.Generic.Dictionary<string, object>;\n\n            public abstract class Base\n            {\n                public class Nested\n                {\n                    public class NestedMore { }\n                }\n            }\n            public class Derived1 : Base { }\n            public class Derived2 : Base, IInterface { }\n            public interface IInterface { }\n        }\n        \"\"\";\n\n    private ClassDeclarationSyntax baseClassDeclaration;\n    private ClassDeclarationSyntax derivedClassDeclaration1;\n    private ClassDeclarationSyntax derivedClassDeclaration2;\n    private SyntaxNode root;\n    private SemanticModel model;\n\n    [TestInitialize]\n    public void Compile()\n    {\n        var snippet = new SnippetCompiler(TestInput);\n        root = snippet.Tree.GetRoot();\n        model = snippet.Model;\n        baseClassDeclaration = root.DescendantNodes().OfType<ClassDeclarationSyntax>().First(x => x.Identifier.ValueText == \"Base\");\n        derivedClassDeclaration1 = root.DescendantNodes().OfType<ClassDeclarationSyntax>().First(x => x.Identifier.ValueText == \"Derived1\");\n        derivedClassDeclaration2 = root.DescendantNodes().OfType<ClassDeclarationSyntax>().First(x => x.Identifier.ValueText == \"Derived2\");\n    }\n\n    [TestMethod]\n    public void IsAny_Null() =>\n        ((ITypeSymbol)null).IsAny(KnownType.System_Boolean).Should().BeFalse();\n\n    [TestMethod]\n    public void ImplementsAny_Null() =>\n        ((ITypeSymbol)null).ImplementsAny([KnownType.System_Boolean]).Should().BeFalse();\n\n    [TestMethod]\n    public void Type_DerivesOrImplementsAny()\n    {\n        var baseType = new KnownType(\"NS.Base\");\n        var interfaceType = new KnownType(\"NS.IInterface\");\n\n        var derived1Type = model.GetDeclaredSymbol(derivedClassDeclaration1) as INamedTypeSymbol;\n        var derived2Type = model.GetDeclaredSymbol(derivedClassDeclaration2) as INamedTypeSymbol;\n\n        derived2Type.DerivesOrImplements(interfaceType).Should().BeTrue();\n        derived1Type.DerivesOrImplements(interfaceType).Should().BeFalse();\n\n        var baseTypes = ImmutableArray.Create(interfaceType, baseType);\n        derived1Type.DerivesOrImplementsAny(baseTypes).Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void Type_Is()\n    {\n        var baseKnownType = new KnownType(\"NS.Base\");\n        var baseKnownTypes = ImmutableArray.Create(baseKnownType);\n\n        var baseType = model.GetDeclaredSymbol(baseClassDeclaration) as INamedTypeSymbol;\n\n        baseType.Is(baseKnownType).Should().BeTrue();\n        baseType.IsAny(baseKnownTypes).Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void Type_GetSymbolType_Alias()\n    {\n        var aliasUsing = root.DescendantNodesAndSelf().OfType<UsingDirectiveSyntax>().FirstOrDefault(x => x.Alias is not null);\n        var symbol = model.GetDeclaredSymbol(aliasUsing);\n        var type = symbol.GetSymbolType();\n        symbol.ToString().Should().Be(\"PropertyBag\");\n        type.ToString().Should().Be(\"System.Collections.Generic.Dictionary<string, object>\");\n    }\n\n    [TestMethod]\n    [DataRow(\"System.Collections.Generic.IEnumerable<T>\", \"System.Collections.Generic.IEnumerable<T>\", true)]\n    [DataRow(\"System.Collections.Generic.IEnumerable<T>\", \"System.IDisposable\", false)]\n    [DataRow(\"System.Collections.Generic.IEnumerable<int>\", \"System.Collections.Generic.IEnumerable<T>\", true)]\n    [DataRow(\"System.Collections.Generic.IEnumerable<int>\", \"System.Collections.Generic.IEnumerable<string>\", false)]\n    [DataRow(\"System.Collections.Generic.IEnumerable<int>\", \"System.IDisposable\", false)]\n    [DataRow(\"System.Collections.Generic.List<T>\", \"System.Collections.Generic.IEnumerable<T>\", true)]\n    [DataRow(\"System.Collections.Generic.List<T>\", \"System.Collections.Generic.IEnumerable<int>\", false)]\n    [DataRow(\"System.Collections.Generic.List<T>\", \"System.IDisposable\", false)]\n    [DataRow(\"System.Collections.Generic.List<int>\", \"System.Collections.Generic.IEnumerable<T>\", true)]\n    [DataRow(\"System.Collections.Generic.List<int>\", \"System.Collections.Generic.IEnumerable<int>\", true)]\n    [DataRow(\"System.Collections.Generic.List<int>\", \"System.IDisposable\", false)]\n    public void Type_DerivesOrImplements_Type(string typeSymbolName, string typeName, bool expected)\n    {\n        var compilation = TestCompiler.CompileCS(\"\"\"\n            using System.Collections.Generic;\n            public class IntList : List<int>, IEnumerable<string>\n            {\n                IEnumerator<string> IEnumerable<string>.GetEnumerator() => null;\n            }\n            \"\"\").Model.Compilation;\n        var allTypes = compilation.GlobalNamespace.GetAllNamedTypes().ToList();\n        var intList = allTypes.Single(x => x.Name == \"IntList\");\n        allTypes.Add(intList.BaseType);\n        allTypes.AddRange(intList.AllInterfaces);\n        var typeSymbol = allTypes.Single(x => x.ToString() == typeSymbolName);\n        var type = allTypes.Single(x => x.ToString() == typeName);\n\n        typeSymbol.DerivesOrImplements(type).Should().Be(expected);\n    }\n\n    [TestMethod]\n    [DataRow(\"Open`3\", \"Open`3\", true)]\n    [DataRow(\"Half2`2\", \"Open`3\", true)]\n    [DataRow(\"Half1`1\", \"Open`3\", true)]\n    [DataRow(\"Closed\", \"Open`3\", true)]\n    [DataRow(\"Half2`2\", \"Half2`2\", true)]\n    [DataRow(\"Half1`1\", \"Half2`2\", true)]\n    [DataRow(\"Closed\", \"Half2`2\", true)]\n    [DataRow(\"Half1`1\", \"Half1`1\", true)]\n    [DataRow(\"Closed\", \"Half1`1\", true)]\n    [DataRow(\"Closed\", \"Closed\", true)]\n    [DataRow(\"Half2`2\", \"Closed\", false)]\n    [DataRow(\"Half1`1\", \"Closed\", false)]\n    [DataRow(\"Half2`2\", \"Half1`1\", false)]\n    public void Type_DerivesOrImplements_HalfClosed(string typeName, string derivesFromName, bool expected)\n    {\n        var compilation = TestCompiler.CompileCS(\"\"\"\n            public class Open<A, B, C> { }\n            public class Half2<A, B>: Open<A, B, int> { }\n            public class Half1<A>: Half2<A, int> { }\n            public class Closed: Half1<int> { }\n            \"\"\").Model.Compilation;\n        var type = compilation.GetTypeByMetadataName(typeName);\n        var derivesFrom = compilation.GetTypeByMetadataName(derivesFromName);\n        type.DerivesOrImplements(derivesFrom).Should().Be(expected);\n    }\n\n    [TestMethod]\n    [DataRow(\"int\")]\n    [DataRow(\"System.Int32\")]\n    [DataRow(\"int?\")]\n    [DataRow(\"System.Nullable<int>\")]\n    [DataRow(\"CustomStruct\")]\n    [DataRow(\"CustomRefStruct\")]\n    [DataRow(\"RecordStruct\")]\n    public void IsStruct_Simple_True(string type)\n    {\n        var fieldSymbol = FirstFieldSymbolFromCode($$\"\"\"\n            struct CustomStruct { }\n            record struct RecordStruct { }\n            ref struct CustomRefStruct { }\n\n            ref struct Test\n            {\n                {{type}} field;\n            }\n            \"\"\");\n        fieldSymbol.Type.IsStruct().Should().BeTrue();\n    }\n\n    [TestMethod]\n    [DataRow(\"object\")]\n    [DataRow(\"System.IComparable\")]\n    public void IsStruct_Simple_False(string type)\n    {\n        var fieldSymbol = FirstFieldSymbolFromCode($$\"\"\"\n            class Test\n            {\n                {{type}} field;\n            }\n            \"\"\");\n        fieldSymbol.Type.IsStruct().Should().BeFalse();\n    }\n\n    [TestMethod]\n    [DataRow(\"struct\")]\n    [DataRow(\"unmanaged\")]\n    public void IsStruct_Generic(string typeConstraint)\n    {\n        var fieldSymbol = FirstFieldSymbolFromCode($$\"\"\"\n            using System;\n            class Test<T> where T: {{typeConstraint}}\n            {\n                T field;\n            }\n            \"\"\");\n        fieldSymbol.Type.IsStruct().Should().BeTrue();\n    }\n\n    [TestMethod]\n    [DataRow(\"T\")]\n    [DataRow(\"T?\")]\n    [DataRow(\"Nullable<T>\")]\n    public void IsStruct_Generic_Nullable(string type)\n    {\n        var fieldSymbol = FirstFieldSymbolFromCode($$\"\"\"\n            using System;\n            class Test<T> where T: struct\n            {\n                {{type}} field;\n            }\n            \"\"\");\n        fieldSymbol.Type.IsStruct().Should().BeTrue();\n    }\n\n    [TestMethod]\n    [DataRow(\"\")]\n    [DataRow(\"where T: new()\")]\n    [DataRow(\"where T: class\")]\n    [DataRow(\"where T: class, new()\")]\n    [DataRow(\"where T: Exception\")]\n    [DataRow(\"where T: Enum\")]\n    [DataRow(\"where T: Enum, IComparable\")]\n    [DataRow(\"where T: Enum, new()\")]\n    [DataRow(\"where T: Enum, IComparable, new()\")]\n    [DataRow(\"where T: notnull\")]\n    public void IsStruct_False_Generic(string typeConstraint)\n    {\n        var fieldSymbol = FirstFieldSymbolFromCode($$\"\"\"\n            using System;\n            class Test<T> {{typeConstraint}}\n            {\n                T field;\n            }\n            \"\"\");\n        fieldSymbol.Type.IsStruct().Should().BeFalse();\n    }\n\n    [TestMethod]\n    [DataRow(\"\")]                      // Unbounded (can be reference type or value type)\n    [DataRow(\"where T: new()\")]        // Unbounded\n    [DataRow(\"where T: notnull\")]      // Unbounded\n    [DataRow(\"where T: class\")]\n    [DataRow(\"where T: class?\")]\n    [DataRow(\"where T: class, new()\")]\n    [DataRow(\"where T: Exception\")]\n    [DataRow(\"where T: Exception?\")]\n    [DataRow(\"where T: IComparable\")]\n    [DataRow(\"where T: IComparable?\")]\n    [DataRow(\"where T: Delegate\")]\n    [DataRow(\"where T: Delegate?\")]\n    public void IsStruct_False_Generic_NullableReferenceType(string typeConstraint)\n    {\n        var fieldSymbol = FirstFieldSymbolFromCode($$\"\"\"\n            #nullable enable\n            using System;\n            class Test<T> {{typeConstraint}}\n            {\n                T? field;\n            }\n            \"\"\");\n        fieldSymbol.Type.IsStruct().Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void IsStruct_False_Generic_Derived()\n    {\n        var fieldSymbol = FirstFieldSymbolFromCode($$\"\"\"\n            using System;\n            class Test<T, U> where U: T\n            {\n                U field;\n            }\n            \"\"\");\n        fieldSymbol.Type.IsStruct().Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void IsStruct_SelfRefrencingStruct()\n    {\n        var (tree, model) = TestCompiler.CompileCS(\"\"\"\n            interface Interface<T> where T: struct, Interface<T> { }\n            struct Impl: Interface<Impl> { } // For demonstration how an implementation can look like\n\n            class Test\n            {\n                static void Method<T>(Interface<T> parameter) where T: struct, Interface<T>\n                {\n                }\n            }\n            \"\"\");\n        var parameter = tree.GetRoot().DescendantNodes().OfType<ParameterSyntax>().First();\n        var parameterSymbol = (IParameterSymbol)model.GetDeclaredSymbol(parameter);\n        parameterSymbol.Type.IsStruct().Should().BeFalse(); // parameter must be a struct, but even the compiler doesn't recognizes this\n    }\n\n    [TestMethod]\n    [DataRow(\"int\")]\n    [DataRow(\"System.Int32\")]\n    [DataRow(\"CustomStruct\")]\n    [DataRow(\"CustomRefStruct\")]\n    [DataRow(\"RecordStruct\")]\n    public void IsNonNullableValueType_Simple_True(string type)\n    {\n        var fieldSymbol = FirstFieldSymbolFromCode($$\"\"\"\n            struct CustomStruct { }\n            record struct RecordStruct { }\n            ref struct CustomRefStruct { }\n\n            ref struct Test\n            {\n                {{type}} field;\n            }\n            \"\"\");\n        fieldSymbol.Type.IsNonNullableValueType().Should().BeTrue();\n    }\n\n    [TestMethod]\n    [DataRow(\"object\")]\n    [DataRow(\"System.IComparable\")]\n    [DataRow(\"int?\")]\n    [DataRow(\"System.Nullable<int>\")]\n    public void IsNonNullableValueType_Simple_False(string type)\n    {\n        var fieldSymbol = FirstFieldSymbolFromCode($$\"\"\"\n            class Test\n            {\n                {{type}} field;\n            }\n            \"\"\");\n        fieldSymbol.Type.IsNonNullableValueType().Should().BeFalse();\n    }\n\n    [TestMethod]\n    [DataRow(\"struct\")]\n    [DataRow(\"unmanaged\")]\n    public void IsNonNullableValueType_Generic(string typeConstraint)\n    {\n        var fieldSymbol = FirstFieldSymbolFromCode($$\"\"\"\n            using System;\n            class Test<T> where T: {{typeConstraint}}\n            {\n                T field;\n            }\n            \"\"\");\n        fieldSymbol.Type.IsNonNullableValueType().Should().BeTrue();\n    }\n\n    [TestMethod]\n    [DataRow(\"T?\")]\n    [DataRow(\"Nullable<T>\")]\n    public void IsNonNullableValueType_Generic_ConstraintStruct_Nullable(string type)\n    {\n        var fieldSymbol = FirstFieldSymbolFromCode($$\"\"\"\n            using System;\n            class Test<T> where T: struct\n            {\n                {{type}} field;\n            }\n            \"\"\");\n        fieldSymbol.Type.IsNonNullableValueType().Should().BeFalse();\n    }\n\n    [TestMethod]\n    [DataRow(\"\")]                      // Unbounded (can be reference type or value type)\n    [DataRow(\"where T: new()\")]        // Unbounded\n    [DataRow(\"where T: notnull\")]      // Unbounded\n    [DataRow(\"where T: struct\")]\n    [DataRow(\"where T: unmanaged\")]\n    [DataRow(\"where T: Enum\")]\n    [DataRow(\"where T: struct, Enum\")]\n    [DataRow(\"where T: struct, Enum, IComparable\")]\n    [DataRow(\"where T: class\")]\n    [DataRow(\"where T: class?\")]\n    [DataRow(\"where T: class, new()\")]\n    [DataRow(\"where T: Exception\")]\n    [DataRow(\"where T: Exception?\")]\n    [DataRow(\"where T: IComparable\")]\n    [DataRow(\"where T: IComparable?\")]\n    [DataRow(\"where T: Delegate\")]\n    [DataRow(\"where T: Delegate?\")]\n    public void IsNonNullableValueType_Generic_Constraint_Nullable(string constraint)\n    {\n        var fieldSymbol = FirstFieldSymbolFromCode($$\"\"\"\n            #nullable enable\n            using System;\n            class Test<T> {{constraint}}\n            {\n                T? field;\n            }\n            \"\"\");\n        fieldSymbol.Type.IsNonNullableValueType().Should().BeFalse();\n    }\n\n    [TestMethod]\n    [DataRow(\"int?\")]\n    [DataRow(\"System.Nullable<int>\")]\n    public void IsNullableValueType_Simple_True(string type)\n    {\n        var fieldSymbol = FirstFieldSymbolFromCode($$\"\"\"\n            class Test\n            {\n                {{type}} field;\n            }\n            \"\"\");\n        fieldSymbol.Type.IsNullableValueType().Should().BeTrue();\n    }\n\n    [TestMethod]\n    [DataRow(\"int\")]\n    [DataRow(\"System.Int32\")]\n    [DataRow(\"CustomStruct\")]\n    [DataRow(\"CustomRefStruct\")]\n    [DataRow(\"RecordStruct\")]\n    [DataRow(\"object\")]\n    [DataRow(\"System.IComparable\")]\n    public void IsNullableValueType_Simple_False(string type)\n    {\n        var fieldSymbol = FirstFieldSymbolFromCode($$\"\"\"\n            struct CustomStruct { }\n            record struct RecordStruct { }\n            ref struct CustomRefStruct { }\n\n            ref struct Test\n            {\n                {{type}} field;\n            }\n            \"\"\");\n        fieldSymbol.Type.IsNullableValueType().Should().BeFalse();\n    }\n\n    [TestMethod]\n    [DataRow(\"T?\")]\n    [DataRow(\"Nullable<T>\")]\n    [DataRow(\"CustomStruct?\")]\n    [DataRow(\"RecordStruct?\")]\n    public void IsNullableValueType_Generic_ConstraintStruct_Nullable(string type)\n    {\n        var fieldSymbol = FirstFieldSymbolFromCode($$\"\"\"\n            using System;\n            struct CustomStruct { }\n            record struct RecordStruct { }\n            class Test<T> where T: struct\n            {\n                {{type}} field;\n            }\n            \"\"\");\n        fieldSymbol.Type.IsNullableValueType().Should().BeTrue();\n    }\n\n    [TestMethod]\n    [DataRow(\"struct\")]\n    [DataRow(\"unmanaged\")]\n    [DataRow(\"struct, Enum\")]\n    [DataRow(\"struct, Enum, IComparable\")]\n    public void IsNullableValueType_Generic_Constraint_Nullable(string constraint)\n    {\n        var fieldSymbol = FirstFieldSymbolFromCode($$\"\"\"\n            using System;\n            class Test<T> where T: {{constraint}}\n            {\n                T? field;\n            }\n            \"\"\");\n        fieldSymbol.Type.IsNullableValueType().Should().BeTrue();\n    }\n\n    [TestMethod]\n    [DataRow(\"struct\")]\n    [DataRow(\"unmanaged\")]\n    public void IsNullableValueType_Generic_ConstraintStruct_NonNullable(string typeConstraint)\n    {\n        var fieldSymbol = FirstFieldSymbolFromCode($$\"\"\"\n            using System;\n            class Test<T> where T: {{typeConstraint}}\n            {\n                T field;\n            }\n            \"\"\");\n        fieldSymbol.Type.IsNullableValueType().Should().BeFalse();\n    }\n\n    [TestMethod]\n    [DataRow(\"\")]                      // Unbounded (can be reference type or value type)\n    [DataRow(\"where T: new()\")]        // Unbounded\n    [DataRow(\"where T: notnull\")]      // Unbounded\n    [DataRow(\"where T: class\")]\n    [DataRow(\"where T: class?\")]\n    [DataRow(\"where T: class, new()\")]\n    [DataRow(\"where T: Enum\")]\n    [DataRow(\"where T: Exception\")]\n    [DataRow(\"where T: Exception?\")]\n    [DataRow(\"where T: IComparable\")]\n    [DataRow(\"where T: IComparable?\")]\n    [DataRow(\"where T: Delegate\")]\n    [DataRow(\"where T: Delegate?\")]\n    public void IsNullableValueType_False_Generic_NullableReferenceType(string typeConstraint)\n    {\n        var fieldSymbol = FirstFieldSymbolFromCode($$\"\"\"\n            #nullable enable\n            using System;\n            class Test<T> {{typeConstraint}}\n            {\n                T? field;\n            }\n            \"\"\");\n        fieldSymbol.Type.IsNullableValueType().Should().BeFalse();\n    }\n\n    [TestMethod]\n    [DataRow(\"\", \"AttributeTargets\")]\n    [DataRow(\"where T: Enum\", \"T\")]\n    [DataRow(\"where T: struct, Enum\", \"T\")]\n    [DataRow(\"where T: Enum\", \"T?\")] // With \"#nullable enable\" \"?\" means either nullable value type or nullable reference type (unbound generic) and T? is an Enum\n    public void IsEnum_True(string typeConstraint, string fieldType)\n    {\n        var fieldSymbol = FirstFieldSymbolFromCode($$\"\"\"\n            #nullable enable\n            using System;\n            class Test<T> {{typeConstraint}}\n            {\n                {{fieldType}} field;\n            }\n            \"\"\");\n        fieldSymbol.Type.IsEnum().Should().BeTrue();\n    }\n\n    [TestMethod]\n    [DataRow(\"\", \"int\")]\n    [DataRow(\"\", \"object\")]\n    [DataRow(\"\", \"IComparable\")]\n    [DataRow(\"where T: struct, Enum\", \"T?\")] // Here ? means nullable value type because of the additional struct constraint and T? is an Nullable<Enum>\n    [DataRow(\"where T: struct, Enum\", \"Nullable<T>\")]\n    public void IsEnum_False(string typeConstraint, string fieldType)\n    {\n        var fieldSymbol = FirstFieldSymbolFromCode($$\"\"\"\n            #nullable enable\n            using System;\n            class Test<T> {{typeConstraint}}\n            {\n                {{fieldType}} field;\n            }\n            \"\"\");\n        fieldSymbol.Type.IsEnum().Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void GetSelfAndBaseTypes_WhenSymbolIsNull_ReturnsEmpty() =>\n        ((ITypeSymbol)null).GetSelfAndBaseTypes().Should().BeEmpty();\n\n    [TestMethod]\n    [DataRow(\"BaseClass<int>         \", \"InheritedAttribute\", \"DerivedInheritedAttribute\", \"DerivedNotInheritedAttribute\", \"UnannotatedAttribute\", \"NotInheritedAttribute\")]\n    [DataRow(\"DerivedOpenGeneric<int>\", \"InheritedAttribute\", \"DerivedInheritedAttribute\", \"DerivedNotInheritedAttribute\", \"UnannotatedAttribute\")]\n    [DataRow(\"DerivedClosedGeneric   \", \"InheritedAttribute\", \"DerivedInheritedAttribute\", \"DerivedNotInheritedAttribute\", \"UnannotatedAttribute\")]\n    [DataRow(\"Implement              \")]\n    public void GetAttributesWithInherited_TypeSymbol(string className, params string[] expectedAttributes)\n    {\n        className = className.TrimEnd();\n        var code = $$\"\"\"\n            using System;\n\n            [AttributeUsage(AttributeTargets.All, Inherited = true)]\n            public class InheritedAttribute : Attribute { }\n\n            [AttributeUsage(AttributeTargets.All, Inherited = false)]\n            public class NotInheritedAttribute : Attribute { }\n\n            public class DerivedInheritedAttribute: InheritedAttribute { }\n\n            public class DerivedNotInheritedAttribute: NotInheritedAttribute { }\n\n            public class UnannotatedAttribute : Attribute { }\n\n            [Inherited]\n            [DerivedInherited]\n            [NotInherited]\n            [DerivedNotInherited]\n            [Unannotated]\n            public class BaseClass<T1> { }\n\n            [Inherited]\n            [DerivedInherited]\n            [NotInherited]\n            [DerivedNotInherited]\n            [Unannotated]\n            public interface IInterface { }\n\n            public class DerivedOpenGeneric<T1>: BaseClass<T1> { }\n\n            public class DerivedClosedGeneric: BaseClass<int> { }\n\n            public class Implement: IInterface { }\n\n            public class Program\n            {\n                public static void Main()\n                {\n                    new {{className}}();\n                }\n            }\n            \"\"\";\n        var compiler = new SnippetCompiler(code);\n        var objectCreation = compiler.Nodes<ObjectCreationExpressionSyntax>().Should().ContainSingle().Subject;\n        if (compiler.Symbol<IMethodSymbol>(objectCreation) is { MethodKind: MethodKind.Constructor, ReceiverType: { } receiver })\n        {\n            var actual = receiver.GetAttributesWithInherited().Select(x => x.AttributeClass.Name).ToList();\n            actual.Should().BeEquivalentTo(expectedAttributes);\n        }\n        else\n        {\n            Assert.Fail(\"Constructor could not be found.\");\n        }\n        // GetAttributesWithInherited should behave like MemberInfo.GetCustomAttributes from runtime reflection:\n        var type = compiler.EmitAssembly().GetType(className.Replace(\"<int>\", \"`1\"), throwOnError: true);\n        type.GetCustomAttributes(inherit: true).Select(x => x.GetType().Name).Should().BeEquivalentTo(expectedAttributes);\n    }\n\n    private static IFieldSymbol FirstFieldSymbolFromCode(string code)\n    {\n        var (tree, model) = TestCompiler.CompileCS(code);\n        var field = tree.GetRoot().DescendantNodes().OfType<FieldDeclarationSyntax>().First();\n        var fieldSymbol = (IFieldSymbol)model.GetDeclaredSymbol(field.Declaration.Variables[0]);\n        return fieldSymbol;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Semantics/KnownAssemblyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing static SonarAnalyzer.Core.Semantics.KnownAssembly;\nusing static SonarAnalyzer.Core.Semantics.KnownAssembly.Predicates;\n\nnamespace SonarAnalyzer.Core.Test.Semantics;\n\n[TestClass]\npublic class KnownAssemblyTest\n{\n    [TestMethod]\n    public void KnownReference_ThrowsWhenPredicateNull_1()\n    {\n        var sut = () => new KnownAssembly(default(Func<AssemblyIdentity, bool>));\n        sut.Should().Throw<ArgumentNullException>().Which.ParamName.Should().Be(\"predicate\");\n    }\n\n    [TestMethod]\n    public void KnownReference_ThrowsWhenPredicateNull_2()\n    {\n        var sut = () => new KnownAssembly(default(Func<IEnumerable<AssemblyIdentity>, bool>));\n        sut.Should().Throw<ArgumentNullException>().Which.ParamName.Should().Be(\"predicate\");\n    }\n\n    [TestMethod]\n    public void KnownReference_ThrowsWhenPredicateNull_Params()\n    {\n        var sut = () => new KnownAssembly(_ => true, null, _ => true);\n        sut.Should().Throw<ArgumentNullException>().Which.ParamName.Should().Be(\"predicate\");\n    }\n\n    [TestMethod]\n    [DataRow(\"Test\", true)]\n    [DataRow(\"test\", true)]\n    [DataRow(\"TEST\", true)]\n    [DataRow(\"MyTest\", false)]\n    [DataRow(\"TestMy\", false)]\n    [DataRow(\"MyTestMy\", false)]\n    [DataRow(\"MyTESTMy\", false)]\n    [DataRow(\"Without\", false)]\n    public void NameIs_Test(string name, bool expected)\n    {\n        var sut = new KnownAssembly(NameIs(\"Test\"));\n        var identity = new AssemblyIdentity(name);\n        var compilation = CompilationWithReferenceTo(identity);\n        sut.IsReferencedBy(compilation).Should().Be(expected);\n    }\n\n    [TestMethod]\n    [DataRow(\"Test\", true)]\n    [DataRow(\"test\", true)]\n    [DataRow(\"TEST\", true)]\n    [DataRow(\"MyTest\", true)]\n    [DataRow(\"TestMy\", true)]\n    [DataRow(\"MyTestMy\", true)]\n    [DataRow(\"MyTESTMy\", true)]\n    [DataRow(\"Without\", false)]\n    public void NameContains_Test(string name, bool expected)\n    {\n        var sut = new KnownAssembly(Contains(\"Test\"));\n        var compilation = CompilationWithReferenceTo(new AssemblyIdentity(name));\n        sut.IsReferencedBy(compilation).Should().Be(expected);\n    }\n\n    [TestMethod]\n    [DataRow(\"Test\", true)]\n    [DataRow(\"test\", true)]\n    [DataRow(\"TEST\", true)]\n    [DataRow(\"MyTest\", false)]\n    [DataRow(\"TestMy\", true)]\n    [DataRow(\"MyTestMy\", false)]\n    [DataRow(\"MyTESTMy\", false)]\n    [DataRow(\"Without\", false)]\n    public void NameStartsWith_Test(string name, bool expected)\n    {\n        var sut = new KnownAssembly(StartsWith(\"Test\"));\n        var compilation = CompilationWithReferenceTo(new AssemblyIdentity(name));\n        sut.IsReferencedBy(compilation).Should().Be(expected);\n    }\n\n    [TestMethod]\n    [DataRow(\"Test\", true)]\n    [DataRow(\"test\", true)]\n    [DataRow(\"TEST\", true)]\n    [DataRow(\"MyTest\", true)]\n    [DataRow(\"TestMy\", false)]\n    [DataRow(\"MyTestMy\", false)]\n    [DataRow(\"MyTESTMy\", false)]\n    [DataRow(\"Without\", false)]\n    public void NameEndsWith_Test(string name, bool expected)\n    {\n        var sut = new KnownAssembly(EndsWith(\"Test\"));\n        var compilation = CompilationWithReferenceTo(new AssemblyIdentity(name));\n        sut.IsReferencedBy(compilation).Should().Be(expected);\n    }\n\n    [TestMethod]\n    [DataRow(\"1.0.0.0\", false)]\n    [DataRow(\"1.9.9.99\", false)]\n    [DataRow(\"2.0.0.0\", true)]\n    [DataRow(\"2.0.0.1\", true)]\n    [DataRow(\"2.1.0.0\", true)]\n    [DataRow(\"3.1.0.0\", true)]\n    public void Version_GreaterOrEqual_2_0(string version, bool expected)\n    {\n        var compilation = CompilationWithReferenceTo(new AssemblyIdentity(\"assemblyName\", new Version(version)));\n        var sut = new KnownAssembly(VersionGreaterOrEqual(new Version(2, 0)));\n        sut.IsReferencedBy(compilation).Should().Be(expected);\n        sut = new KnownAssembly(VersionGreaterOrEqual(\"2.0\"));\n        sut.IsReferencedBy(compilation).Should().Be(expected);\n    }\n\n    [TestMethod]\n    [DataRow(\"1.0.0.0\", true)]\n    [DataRow(\"1.9.9.99\", true)]\n    [DataRow(\"2.0.0.0\", false)]\n    [DataRow(\"2.0.0.1\", false)]\n    [DataRow(\"2.1.0.0\", false)]\n    [DataRow(\"3.1.0.0\", false)]\n    public void Version_LowerThen_2_0(string version, bool expected)\n    {\n        var compilation = CompilationWithReferenceTo(new AssemblyIdentity(\"assemblyName\", new Version(version)));\n        var sut = new KnownAssembly(VersionLowerThen(new Version(2, 0)));\n        sut.IsReferencedBy(compilation).Should().Be(expected);\n        sut = new KnownAssembly(VersionLowerThen(\"2.0\"));\n        sut.IsReferencedBy(compilation).Should().Be(expected);\n    }\n\n    [TestMethod]\n    [DataRow(\"1.0.0.0\", false)]\n    [DataRow(\"1.9.9.99\", false)]\n    [DataRow(\"2.0.0.0\", true)]\n    [DataRow(\"2.0.0.1\", true)]\n    [DataRow(\"2.1.0.0\", true)]\n    [DataRow(\"3.1.0.0\", true)]\n    [DataRow(\"3.4.9.99\", true)]\n    [DataRow(\"3.5.0.0\", true)]\n    [DataRow(\"3.5.0.1\", false)]\n    [DataRow(\"10.0.0.0\", false)]\n    public void Version_Between_2_0_and_3_5(string version, bool expected)\n    {\n        var compilation = CompilationWithReferenceTo(new AssemblyIdentity(\"assemblyName\", new Version(version)));\n        var sut = new KnownAssembly(VersionBetween(new Version(2, 0, 0, 0), new Version(3, 5, 0, 0)));\n        sut.IsReferencedBy(compilation).Should().Be(expected);\n        sut = new KnownAssembly(VersionBetween(\"2.0.0.0\", \"3.5.0.0\"));\n        sut.IsReferencedBy(compilation).Should().Be(expected);\n    }\n\n    [TestMethod]\n    [DataRow(\"c5b62af9de6d7244\", true)]\n    [DataRow(\"C5B62AF9DE6D7244\", true)]\n    [DataRow(\"c5-b6-2a-f9-de-6d-72-44\", true)]\n    [DataRow(\n        \"002400000480000094000000060200000024000052534131000400000100010081b4345a022cc0f4b42bdc795a5a7a1623c1e58dc2246645d751ad41ba98f2749dc5c4e0da3a9e09febcb2cd5b088a0f\" +\n        \"041f8ac24b20e736d8ae523061733782f9c4cd75b44f17a63714aced0b29a59cd1ce58d8e10ccdb6012c7098c39871043b7241ac4ab9f6b34f183db716082cd57c1ff648135bece256357ba735e67dc6\", true)]\n    [DataRow(\"AA-68-91-16-d3-a4-ae-33\", false)]\n    public void PublicKeyTokenIs_c5b62af9de6d7244(string publicKeyToken, bool expected)\n    {\n        var identity = new AssemblyIdentity(\"assemblyName\", publicKeyOrToken: ImmutableArray.Create<byte>(\n            0x00, 0x24, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x06, 0x02, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x52, 0x53, 0x41, 0x31, 0x00,\n            0x04, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x81, 0xb4, 0x34, 0x5a, 0x02, 0x2c, 0xc0, 0xf4, 0xb4, 0x2b, 0xdc, 0x79, 0x5a, 0x5a, 0x7a, 0x16, 0x23, 0xc1,\n            0xe5, 0x8d, 0xc2, 0x24, 0x66, 0x45, 0xd7, 0x51, 0xad, 0x41, 0xba, 0x98, 0xf2, 0x74, 0x9d, 0xc5, 0xc4, 0xe0, 0xda, 0x3a, 0x9e, 0x09, 0xfe, 0xbc, 0xb2,\n            0xcd, 0x5b, 0x08, 0x8a, 0x0f, 0x04, 0x1f, 0x8a, 0xc2, 0x4b, 0x20, 0xe7, 0x36, 0xd8, 0xae, 0x52, 0x30, 0x61, 0x73, 0x37, 0x82, 0xf9, 0xc4, 0xcd, 0x75,\n            0xb4, 0x4f, 0x17, 0xa6, 0x37, 0x14, 0xac, 0xed, 0x0b, 0x29, 0xa5, 0x9c, 0xd1, 0xce, 0x58, 0xd8, 0xe1, 0x0c, 0xcd, 0xb6, 0x01, 0x2c, 0x70, 0x98, 0xc3,\n            0x98, 0x71, 0x04, 0x3b, 0x72, 0x41, 0xac, 0x4a, 0xb9, 0xf6, 0xb3, 0x4f, 0x18, 0x3d, 0xb7, 0x16, 0x08, 0x2c, 0xd5, 0x7c, 0x1f, 0xf6, 0x48, 0x13, 0x5b,\n            0xec, 0xe2, 0x56, 0x35, 0x7b, 0xa7, 0x35, 0xe6, 0x7d, 0xc6), hasPublicKey: true);\n        var compilation = CompilationWithReferenceTo(identity);\n        var sut = new KnownAssembly(PublicKeyTokenIs(publicKeyToken));\n        sut.IsReferencedBy(compilation).Should().Be(expected);\n        sut = new KnownAssembly(OptionalPublicKeyTokenIs(publicKeyToken));\n        sut.IsReferencedBy(compilation).Should().Be(expected);\n    }\n\n    [TestMethod]\n    public void PublicKeyTokenIs_FailsWhenKeyIsMissing()\n    {\n        var compilation = CompilationWithReferenceTo(new AssemblyIdentity(\"assemblyName\", hasPublicKey: false));\n        var sut = new KnownAssembly(PublicKeyTokenIs(\"c5b62af9de6d7244\"));\n        sut.IsReferencedBy(compilation).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void OptionalPublicKeyTokenIs_SucceedsWhenKeyIsMissing()\n    {\n        var compilation = CompilationWithReferenceTo(new AssemblyIdentity(\"assemblyName\", hasPublicKey: false));\n        var sut = new KnownAssembly(OptionalPublicKeyTokenIs(\"c5b62af9de6d7244\"));\n        sut.IsReferencedBy(compilation).Should().BeTrue();\n    }\n\n    [TestMethod]\n    [DataRow(\"Test\", \"1.0.0.0\", false)]\n    [DataRow(\"Test\", \"1.9.9.99\", false)]\n    [DataRow(\"TestMy\", \"2.0.0.0\", true)]\n    [DataRow(\"MyTest\", \"2.0.0.0\", false)]\n    [DataRow(\"TestMy\", \"3.5.0.0\", true)]\n    [DataRow(\"TestMy\", \"3.5.0.1\", false)]\n    [DataRow(\"Test\", \"10.0.0.0\", false)]\n    public void Combinator_NameStartWith_Test_And_Version_Between_2_0_And_3_5(string name, string version, bool expected)\n    {\n        var compilation = CompilationWithReferenceTo(new AssemblyIdentity(name, new Version(version)));\n        var sut = new KnownAssembly(StartsWith(\"Test\").And(VersionBetween(new Version(2, 0, 0, 0), new Version(3, 5, 0, 0))));\n        sut.IsReferencedBy(compilation).Should().Be(expected);\n    }\n\n    [TestMethod]\n    [DataRow(\"Start\", true)]\n    [DataRow(\"End\", true)]\n    [DataRow(\"StartOrEnd\", true)]\n    [DataRow(\"StartTest\", true)]\n    [DataRow(\"TestEnd\", true)]\n    [DataRow(\"EndStart\", false)]\n    [DataRow(\"EndSomething\", false)]\n    [DataRow(\"SomethingStart\", false)]\n    public void Combinator_StartsWith_Start_Or_EndsWith_End_1(string name, bool expected)\n    {\n        var compilation = CompilationWithReferenceTo(new AssemblyIdentity(name));\n        var sut = new KnownAssembly(StartsWith(\"Start\"), EndsWith(\"End\"));\n        sut.IsReferencedBy(compilation).Should().Be(expected);\n    }\n\n    [TestMethod]\n    [DataRow(\"Start\", true)]\n    [DataRow(\"End\", true)]\n    [DataRow(\"StartOrEnd\", true)]\n    [DataRow(\"StartTest\", true)]\n    [DataRow(\"TestEnd\", true)]\n    [DataRow(\"EndStart\", false)]\n    [DataRow(\"EndSomething\", false)]\n    [DataRow(\"SomethingStart\", false)]\n    public void Combinator_StartsWith_Start_Or_EndsWith_End_2(string name, bool expected)\n    {\n        var compilation = CompilationWithReferenceTo(new AssemblyIdentity(name));\n        var sut = new KnownAssembly(StartsWith(\"Start\").Or(EndsWith(\"End\")));\n        sut.IsReferencedBy(compilation).Should().Be(expected);\n    }\n\n    [TestMethod]\n    public void CompilationShouldNotReferenceAssemblies()\n    {\n        var compilation = TestCompiler.CompileCS(\"// Empty file\").Model.Compilation;\n\n        compilation.References(XUnit_Assert).Should().BeFalse();\n        compilation.References(MSTest).Should().BeFalse();\n        compilation.References(NFluent).Should().BeFalse();\n        compilation.References(KnownAssembly.FluentAssertions).Should().BeFalse();\n        compilation.References(KnownAssembly.NSubstitute).Should().BeFalse();\n        compilation.References(MicrosoftExtensionsLoggingAbstractions).Should().BeFalse();\n        compilation.References(Serilog).Should().BeFalse();\n        compilation.References(NLog).Should().BeFalse();\n        compilation.References(Log4Net).Should().BeFalse();\n        compilation.References(CommonLoggingCore).Should().BeFalse();\n        compilation.References(CastleCore).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void XUnitAssert_2_4() =>\n        CompilationShouldReference(NuGetMetadataReference.XunitFramework(\"2.4.2\"), XUnit_Assert);\n\n    [TestMethod]\n    public void XUnitAssert_1_9() =>\n        CompilationShouldReference(NuGetMetadataReference.XunitFrameworkV1, XUnit_Assert);\n\n    [TestMethod]\n    public void XUnitAssert_3_0() =>\n        CompilationShouldReference(NuGetMetadataReference.XunitFrameworkV3(), XUnit_Assert);\n\n    [TestMethod]\n    public void MSTest_V1() =>\n        CompilationShouldReference(NuGetMetadataReference.MSTestTestFrameworkV1, MSTest);\n\n    [TestMethod]\n    public void MSTest_V2() =>\n        CompilationShouldReference(NuGetMetadataReference.MSTestTestFramework(\"3.0.2\"), MSTest);\n\n    [TestMethod]\n    public void MSTest_MicrosoftVisualStudioQualityToolsUnitTestFramework() =>\n        CompilationShouldReference(NuGetMetadataReference.MicrosoftVisualStudioQualityToolsUnitTestFramework, MSTest);\n\n    [TestMethod]\n    public void FluentAssertions_6_10() =>\n        CompilationShouldReference(NuGetMetadataReference.FluentAssertions(\"6.10.0\"), KnownAssembly.FluentAssertions);\n\n    [TestMethod]\n    public void NFluent_2_8() =>\n        CompilationShouldReference(NuGetMetadataReference.NFluent(\"2.8.0\"), NFluent);\n\n    [TestMethod]\n    public void NFluent_1_0() =>\n        // 1.0.0 has no publicKeyToken\n        CompilationShouldReference(NuGetMetadataReference.NFluent(\"1.0.0\"), NFluent);\n\n    [TestMethod]\n    public void NSubstitute_5_0() =>\n        CompilationShouldReference(NuGetMetadataReference.NSubstitute(\"5.0.0\"), KnownAssembly.NSubstitute);\n\n    [TestMethod]\n    public void MicrosoftExtensionsLoggingAbstractions_Latest() =>\n        CompilationShouldReference(NuGetMetadataReference.MicrosoftExtensionsLoggingAbstractions(), MicrosoftExtensionsLoggingAbstractions);\n\n    [TestMethod]\n    public void Serilog_Latest() =>\n        CompilationShouldReference(NuGetMetadataReference.Serilog(TestConstants.NuGetLatestVersion), Serilog);\n\n    [TestMethod]\n    public void NLog_Latest() =>\n        CompilationShouldReference(NuGetMetadataReference.NLog(), NLog);\n\n    [TestMethod]\n    public void Log4net_1_2_10() =>\n        CompilationShouldReference(NuGetMetadataReference.Log4Net(\"1.2.10\", \"1.0\"), Log4Net);\n\n    [TestMethod]\n    public void Log4net_2_0_8() =>\n        CompilationShouldReference(NuGetMetadataReference.Log4Net(\"2.0.8\", \"net45-full\"), Log4Net);\n\n    [TestMethod]\n    public void CommonLoggingCore_Latest() =>\n        CompilationShouldReference(NuGetMetadataReference.CommonLoggingCore(), CommonLoggingCore);\n\n    [TestMethod]\n    public void CastleCore_Latest() =>\n        CompilationShouldReference(NuGetMetadataReference.CastleCore(), CastleCore);\n\n    private static void CompilationShouldReference(IEnumerable<MetadataReference> references, KnownAssembly expectedAssembly) =>\n        TestCompiler.CompileCS(\"// Empty file\", references.ToArray()).Model.Compilation.References(expectedAssembly).Should().BeTrue();\n\n    private static Compilation CompilationWithReferenceTo(AssemblyIdentity identity)\n    {\n        var compilation = Substitute.For<Compilation>(\"compilationName\", ImmutableArray<MetadataReference>.Empty, new Dictionary<string, string>(), false, null, null);\n        compilation.ReferencedAssemblyNames.Returns([identity]);\n        return compilation;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Semantics/KnownMethodsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Semantics;\n\n[TestClass]\npublic class KnownMethodsTest\n{\n    [TestMethod]\n    public  void IsMainMethod_Null_ShouldBeFalse() =>\n        KnownMethods.IsMainMethod(null).Should().BeFalse();\n\n    [TestMethod]\n    public void IsObjectEquals_Null_ShouldBeFalse() =>\n        KnownMethods.IsObjectEquals(null).Should().BeFalse();\n\n    [TestMethod]\n    public void IsStaticObjectEquals_Null_ShouldBeFalse() =>\n        KnownMethods.IsStaticObjectEquals(null).Should().BeFalse();\n\n    [TestMethod]\n    public void IsObjectGetHashCode_Null_ShouldBeFalse() =>\n        KnownMethods.IsObjectGetHashCode(null).Should().BeFalse();\n\n    [TestMethod]\n    public void IsObjectToString_Null_ShouldBeFalse() =>\n        KnownMethods.IsObjectToString(null).Should().BeFalse();\n\n    [TestMethod]\n    public void IsIAsyncDisposableDisposeAsync_Null_ShouldBeFalse() =>\n        KnownMethods.IsIAsyncDisposableDisposeAsync(null).Should().BeFalse();\n\n    [TestMethod]\n    public void IsGetObjectData_Null_ShouldBeFalse() =>\n        KnownMethods.IsGetObjectData(null).Should().BeFalse();\n\n    [TestMethod]\n    public void IsSerializationConstructor_Null_ShouldBeFalse() =>\n        KnownMethods.IsSerializationConstructor(null).Should().BeFalse();\n\n    [TestMethod]\n    public void IsArrayClone_Null_ShouldBeFalse() =>\n        KnownMethods.IsArrayClone(null).Should().BeFalse();\n\n    [TestMethod]\n    public void IsRecordPrintMembers_Null_ShouldBeFalse() =>\n        KnownMethods.IsRecordPrintMembers(null).Should().BeFalse();\n\n    [TestMethod]\n    public void IsGcSuppressFinalize_Null_ShouldBeFalse() =>\n        KnownMethods.IsGcSuppressFinalize(null).Should().BeFalse();\n\n    [TestMethod]\n    public void IsDebugAssert_Null_ShouldBeFalse() =>\n        KnownMethods.IsDebugAssert(null).Should().BeFalse();\n\n    [TestMethod]\n    public void IsDiagnosticDebugMethod_Null_ShouldBeFalse() =>\n        KnownMethods.IsDiagnosticDebugMethod(null).Should().BeFalse();\n\n    [TestMethod]\n    public void IsOperatorBinaryPlus_Null_ShouldBeFalse() =>\n        KnownMethods.IsOperatorBinaryPlus(null).Should().BeFalse();\n\n    [TestMethod]\n    public void IsOperatorBinaryMinus_Null_ShouldBeFalse() =>\n        KnownMethods.IsOperatorBinaryMinus(null).Should().BeFalse();\n\n    [TestMethod]\n    public void IsOperatorBinaryMultiply_Null_ShouldBeFalse() =>\n        KnownMethods.IsOperatorBinaryMultiply(null).Should().BeFalse();\n\n    [TestMethod]\n    public void IsOperatorBinaryDivide_Null_ShouldBeFalse() =>\n        KnownMethods.IsOperatorBinaryDivide(null).Should().BeFalse();\n\n    [TestMethod]\n    public void IsOperatorBinaryModulus_Null_ShouldBeFalse() =>\n        KnownMethods.IsOperatorBinaryModulus(null).Should().BeFalse();\n\n    [TestMethod]\n    public void IsOperatorEquals_Null_ShouldBeFalse() =>\n        KnownMethods.IsOperatorEquals(null).Should().BeFalse();\n\n    [TestMethod]\n    public void IsOperatorNotEquals_Null_ShouldBeFalse() =>\n        KnownMethods.IsOperatorNotEquals(null).Should().BeFalse();\n\n    [TestMethod]\n    public void IsConsoleWriteLine_Null_ShouldBeFalse() =>\n        KnownMethods.IsConsoleWriteLine(null).Should().BeFalse();\n\n    [TestMethod]\n    public void IsConsoleWrite_Null_ShouldBeFalse() =>\n        KnownMethods.IsConsoleWrite(null).Should().BeFalse();\n\n    [TestMethod]\n    public void IsListAddRange_Null_ShouldBeFalse() =>\n        KnownMethods.IsListAddRange(null).Should().BeFalse();\n\n    [TestMethod]\n    public void IsEventHandler_Null_ShouldBeFalse() =>\n        KnownMethods.IsEventHandler(null).Should().BeFalse();\n\n    [TestMethod]\n    public void IsEnumerableConcat_Null_ShouldBeFalse() =>\n        KnownMethods.IsEnumerableConcat(null).Should().BeFalse();\n\n    [TestMethod]\n    public void Symbol_IsProbablyEventHandler()\n    {\n        var snippet = new SnippetCompiler(\"\"\"\n            public class Sample\n            {\n                public void Method() { }\n                public void EventHandler(object o, System.EventArgs args){}\n            }\n            \"\"\");\n        snippet.MethodSymbol(\"Sample.Method\").IsEventHandler().Should().BeFalse();\n        snippet.MethodSymbol(\"Sample.EventHandler\").IsEventHandler().Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void Symbol_IsProbablyEventHandler_ResolveEventHandler()\n    {\n        var snippet = new SnippetCompiler(\"\"\"\n            using System;\n            using System.Reflection;\n            public class AssemblyLoad\n            {\n                public AssemblyLoad()\n                {\n                    AppDomain.CurrentDomain.AssemblyResolve += LoadAnyVersion;\n                }\n                Assembly LoadAnyVersion(object sender, ResolveEventArgs args) => null;\n            }\n            \"\"\");\n        snippet.MethodSymbol(\"AssemblyLoad.LoadAnyVersion\").IsEventHandler().Should().BeTrue();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Semantics/KnownTypeTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = Microsoft.CodeAnalysis.CSharp.Syntax;\nusing VB = Microsoft.CodeAnalysis.VisualBasic.Syntax;\n\nnamespace SonarAnalyzer.Core.Test.Semantics;\n\n[TestClass]\npublic class KnownTypeTest\n{\n    [TestMethod]\n    public void Matches_TypeSymbolIsNull_ThrowsArgumentNullException() =>\n        new KnownType(\"typeName\").Invoking(x => x.Matches(null)).Should().Throw<ArgumentNullException>();\n\n    [TestMethod]\n    public void Constructor_InvalidName_Throws() =>\n        ((Func<KnownType>)(() => new KnownType(\"Invalid.Order+Of.Separators\"))).Should().Throw<ArgumentException>();\n\n    [TestMethod]\n    [DataRow(\"System.Action\", true, \"System.Action\", false)]\n    [DataRow(\"System.DateTime\", false, \"System.Action\", false)]\n    [DataRow(\"System.Collections.ArrayList\", true, \"System.Collections.ArrayList\", false)]\n    [DataRow(\"System.Threading.Timer\", false, \"System.Timers.Timer\", false)]\n    [DataRow(\"string\", true, \"System.String\", false)]\n    [DataRow(\"byte\", true, \"System.Byte\", false)]\n    [DataRow(\"string[]\", true, \"System.String\", true)]\n    [DataRow(\"System.String[]\", true, \"System.String\", true)]\n    [DataRow(\"byte[]\", true, \"System.Byte\", true)]\n    [DataRow(\"System.Byte[]\", true, \"System.Byte\", true)]\n    [DataRow(\"System.Exception[]\", false, \"Exceptions.Exception\", true)]\n    [DataRow(\"System.Action[]\", false, \"System.Action\", false)]\n    [DataRow(\"System.Action<T>\", false, \"System.Action\", false)]\n    [DataRow(\"System.Action<T>\", true, \"System.Action\", false, \"T\")]\n    [DataRow(\"System.Action<T1>\", false, \"System.Action\", true, \"T2\")]\n    [DataRow(\"System.Action<T1, T2>\", true, \"System.Action\", false, \"T1\", \"T2\")]\n    [DataRow(\"System.Action<T1, T2>\", false, \"System.Action\", true, \"T1\", \"T2\")]\n    [DataRow(\"System.Action<T1, T2>\", false, \"System.Action\", false, \"T2\", \"T1\")]\n    [DataRow(\"System.Action<T1, T2>\", false, \"System.Action\", true, \"T1\")]\n    [DataRow(\"System.Action\", false, \"System.Action\", false, \"T\")]\n    [DataRow(\"System.Action<T>\", false, \"System.Action\", true, \"T\")]\n    [DataRow(\"OuterNamespace.InnerNamespace.TheType\", true, \"OuterNamespace.InnerNamespace.TheType\", false)]\n    [DataRow(\"OuterNamespace.InnerNamespace.TheType.NestedOnce\", false, \"OuterNamespace.InnerNamespace.TheType\", false)]\n    [DataRow(\"OuterNamespace.InnerNamespace.TheType.NestedOnce\", true, \"OuterNamespace.InnerNamespace.TheType+NestedOnce\", false)]\n    [DataRow(\"OuterNamespace.InnerNamespace.TheType.NestedOnce.NestedTwice\", false, \"OuterNamespace.InnerNamespace.TheType+NestedOnce\", false)]\n    [DataRow(\"OuterNamespace.InnerNamespace.TheType.NestedOnce.NestedTwice\", true, \"OuterNamespace.InnerNamespace.TheType+NestedOnce+NestedTwice\", false)]\n    [DataRow(\"OuterNamespace.InnerNamespace.TheType.NestedOnce\", false, \"NestedOnce\", false)]\n    [DataRow(\"OuterNamespace.InnerNamespace.TheType\", false, \"OuterNamespace.InnerNamespace.TheType+NestedOnce\", false)]\n    [DataRow(\"OuterNamespace.InnerNamespace.TheType.NestedGeneric<T1>\", true, \"OuterNamespace.InnerNamespace.TheType+NestedGeneric\", false, \"T\")]\n    [DataRow(\"OuterNamespace.InnerNamespace.GenericType<T1>.Nested\", true, \"OuterNamespace.InnerNamespace.GenericType+Nested\", false)]\n    [DataRow(\"OuterNamespace.InnerNamespace.GenericType<T1>\", true, \"OuterNamespace.InnerNamespace.GenericType\", false, \"TOuter\")]\n    [DataRow(\"OuterNamespace.InnerNamespace.GenericType<T1>.NestedGeneric<T2>\", true, \"OuterNamespace.InnerNamespace.GenericType+NestedGeneric\", false, \"TInner\")]  // Only the most-inner Generic type is relevant\n    [DataRow(\"OuterNamespace.InnerNamespace.GenericType<T1>.NestedGeneric<T2>.NestedTwice\", true, \"OuterNamespace.InnerNamespace.GenericType+NestedGeneric+NestedTwice\", false)]\n    public void Matches_TypeSymbol_CS(string symbolName, bool expectedMatch, string fullTypeName, bool isArray, params string[] genericParameters) =>\n        new KnownType(fullTypeName, genericParameters) { IsArray = isArray }\n            .Matches(GetSymbol_CS(symbolName))\n            .Should().Be(expectedMatch);\n\n    [TestMethod]\n    [DataRow(\"System.Collections.Generic.IDictionary(Of TKey, TValue)\", false, \"System.Collections.Generic.IDictionary\", false)]\n    [DataRow(\"System.Collections.Generic.IDictionary(Of TKey, TValue)\", false, \"System.Collections.Generic.IDictionary\", false, \"TKey\")]\n    [DataRow(\"System.Collections.Generic.IDictionary(Of TKey, TValue)\", true, \"System.Collections.Generic.IDictionary\", false, \"TKey\", \"TValue\")]\n    [DataRow(\"System.Collections.Generic.IDictionary(Of TKey, TValue)\", false, \"System.Collections.Generic.IDictionary\", false, \"TValue\", \"TKey\")]\n    [DataRow(\"String()\", true, \"System.String\", true)]\n    [DataRow(\"String()\", false, \"System.Byte\", true)]\n    [DataRow(\"OuterNamespace.InnerNamespace.TheType\", true, \"OuterNamespace.InnerNamespace.TheType\", false)]\n    [DataRow(\"OuterNamespace.InnerNamespace.TheType.NestedOnce\", false, \"OuterNamespace.InnerNamespace.TheType\", false)]\n    [DataRow(\"OuterNamespace.InnerNamespace.TheType.NestedOnce\", true, \"OuterNamespace.InnerNamespace.TheType+NestedOnce\", false)]\n    [DataRow(\"OuterNamespace.InnerNamespace.TheType.NestedOnce.NestedTwice\", false, \"OuterNamespace.InnerNamespace.TheType+NestedOnce\", false)]\n    [DataRow(\"OuterNamespace.InnerNamespace.TheType.NestedOnce.NestedTwice\", true, \"OuterNamespace.InnerNamespace.TheType+NestedOnce+NestedTwice\", false)]\n    public void Matches_TypeSymbol_VB(string symbolName, bool expectedMatch, string fullTypeName, bool isArray, params string[] genericParameters) =>\n        new KnownType(fullTypeName, genericParameters) { IsArray = isArray }\n            .Matches(GetSymbol_VB(symbolName))\n            .Should().Be(expectedMatch);\n\n    [TestMethod]\n    [DataRow(\"System.String\", \"System.String\", false)]\n    [DataRow(\"System.String[]\", \"System.String\", true)]\n    [DataRow(\"System.Action<T>\", \"System.Action\", false, \"T\")]\n    [DataRow(\"System.Action<T1, T2>\", \"System.Action\", false, \"T1\", \"T2\")]\n    [DataRow(\"System.Action<T1, T2>[]\", \"System.Action\", true, \"T1\", \"T2\")]\n    public void DebuggerDisplay(string expectedResult, string fullTypeName, bool isArray, params string[] genericParameters) =>\n        new KnownType(fullTypeName, genericParameters) { IsArray = isArray }.DebuggerDisplay.Should().Be(expectedResult);\n\n    private static ITypeSymbol GetSymbol_CS(string type)\n    {\n        var (tree, model) = TestCompiler.CompileCS($$\"\"\"\n            namespace Exceptions { public class Exception { } }\n            public class Test<T, T1, T2, T3> { public {{type}} Value; }\n            namespace OuterNamespace\n            {\n                namespace InnerNamespace\n                {\n                    public class TheType\n                    {\n                        public class NestedOnce\n                        {\n                            public class NestedTwice { }\n                        }\n                        public class NestedGeneric<T> { }\n                    }\n                    public class GenericType<TOuter>\n                    {\n                        public class Nested { }\n                        public class NestedGeneric<TInner>\n                        {\n                            public class NestedTwice { }\n                        }\n                    }\n                }\n            }\n            \"\"\");\n        var expression = tree.Single<CS.VariableDeclaratorSyntax>();\n        return model.GetDeclaredSymbol(expression).GetSymbolType();\n    }\n\n    private static ITypeSymbol GetSymbol_VB(string type)\n    {\n        var (tree, model) = TestCompiler.CompileVB($\"\"\"\n            Public Class Test(Of TKey, TValue) : Public Value As {type} : End Class\n            Namespace OuterNamespace\n                Namespace InnerNamespace\n                    Public Class TheType\n                        Public Class NestedOnce\n                            Public Class NestedTwice\n                            End Class\n                        End Class\n                    End Class\n                End Namespace\n            End Namespace\n            \"\"\");\n        var expression = tree.Single<VB.ModifiedIdentifierSyntax>();\n        return model.GetDeclaredSymbol(expression).GetSymbolType();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Semantics/NetFrameworkVersionProviderTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\n\nnamespace SonarAnalyzer.Core.Test.Semantics;\n\n[TestClass]\npublic class NetFrameworkVersionProviderTest\n{\n    [TestMethod]\n    public void NetFrameworkVersionProvider_WithNullCompilation_ReturnsUnknown()\n    {\n        var versionProvider = new NetFrameworkVersionProvider();\n        versionProvider.Version(null).Should().Be(NetFrameworkVersion.Unknown);\n    }\n\n    [TestMethod]\n    [DataRow(\"3.5\", NetFrameworkVersion.Probably35)]\n    [DataRow(\"4.0_no_IO\", NetFrameworkVersion.Between4And451)]\n    [DataRow(\"4.0_with_IO\", NetFrameworkVersion.Between4And451)]\n    [DataRow(\"4.8\", NetFrameworkVersion.After452)]\n    public void Version_MockedFramework(string name, NetFrameworkVersion expected)\n    {\n        var compilation = CreateRawCompilation(MetadataReference.CreateFromFile(Path.Combine(Paths.TestsRoot, \"FrameworkMocks\", \"lib\", name, \"mscorlib.dll\")));\n        var versionProvider = new NetFrameworkVersionProvider();\n        versionProvider.Version(compilation).Should().Be(expected);\n    }\n\n    [TestMethod]\n    public void NetFrameworkVersionProvider_NoReference()\n    {\n        var compilation = CreateRawCompilation();\n        var versionProvider = new NetFrameworkVersionProvider();\n        versionProvider.Version(compilation).Should().Be(NetFrameworkVersion.Unknown);\n    }\n\n    private static Compilation CreateRawCompilation(params MetadataReference[] references)\n    {\n        var solution = new AdhocWorkspace().CurrentSolution;\n        var project = solution.AddProject(\"Test\", \"Test\", LanguageNames.CSharp);\n        var projectBuilder = ProjectBuilder.FromProject(project);\n        return projectBuilder.AddReferences(references).GetCompilation();   // Do not add default references from SnippetCompiler\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/SonarAnalyzer.Core.Test.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFramework>net10.0</TargetFramework>\n    <IsPackable>false</IsPackable>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\src\\SonarAnalyzer.Core\\SonarAnalyzer.Core.csproj\" />\n    <ProjectReference Include=\"..\\SonarAnalyzer.TestFramework\\SonarAnalyzer.TestFramework.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Using Include=\"FluentAssertions\" />\n    <Using Include=\"Microsoft.CodeAnalysis\" />\n    <Using Include=\"Microsoft.CodeAnalysis.Diagnostics\" />\n    <Using Include=\"Microsoft.VisualStudio.TestTools.UnitTesting\" />\n    <Using Include=\"Combinatorial.MSTest\" />\n    <Using Include=\"NSubstitute\" />\n    <Using Include=\"SonarAnalyzer.Core.Analyzers\" />\n    <Using Include=\"SonarAnalyzer.Core.Common\" />\n    <Using Include=\"SonarAnalyzer.Core.Extensions\" />\n    <Using Include=\"SonarAnalyzer.Core.Semantics\" />\n    <Using Include=\"SonarAnalyzer.Core.Semantics.Extensions\" />\n    <Using Include=\"SonarAnalyzer.ShimLayer\" />\n    <Using Include=\"SonarAnalyzer.TestFramework.Analyzers\" />\n    <Using Include=\"SonarAnalyzer.TestFramework.Build\" />\n    <Using Include=\"SonarAnalyzer.TestFramework.Common\" />\n    <Using Include=\"SonarAnalyzer.TestFramework.Extensions\" />\n    <Using Include=\"SonarAnalyzer.TestFramework.MetadataReferences\" />\n    <Using Include=\"SonarAnalyzer.TestFramework.Verification\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Content Include=\"TestResources\\**\\*\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Syntax/Extensions/ComparisonKindExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Syntax.Utilities;\n\nnamespace SonarAnalyzer.Core.Syntax.Extensions.Test;\n\n[TestClass]\npublic class ComparisonKindExtensionsTest\n{\n    [TestMethod]\n    [DataRow(ComparisonKind.Equals, \"==\")]\n    [DataRow(ComparisonKind.NotEquals, \"!=\")]\n    [DataRow(ComparisonKind.LessThan, \"<\")]\n    [DataRow(ComparisonKind.LessThanOrEqual, \"<=\")]\n    [DataRow(ComparisonKind.GreaterThan, \">\")]\n    [DataRow(ComparisonKind.GreaterThanOrEqual, \">=\")]\n    public void ToDisplayString_CSharp(ComparisonKind kind, string expected) =>\n        kind.ToDisplayString(AnalyzerLanguage.CSharp).Should().Be(expected);\n\n    [TestMethod]\n    [DataRow(ComparisonKind.Equals, \"=\")]\n    [DataRow(ComparisonKind.NotEquals, \"<>\")]\n    [DataRow(ComparisonKind.LessThan, \"<\")]\n    [DataRow(ComparisonKind.LessThanOrEqual, \"<=\")]\n    [DataRow(ComparisonKind.GreaterThan, \">\")]\n    [DataRow(ComparisonKind.GreaterThanOrEqual, \">=\")]\n    public void ToDisplayString_VisualBasic(ComparisonKind kind, string expected) =>\n        kind.ToDisplayString(AnalyzerLanguage.VisualBasic).Should().Be(expected);\n\n    [TestMethod]\n    public void ToDisplayString_None_CSharp_Throws() =>\n        ComparisonKind.None.Invoking(x => x.ToDisplayString(AnalyzerLanguage.CSharp)).Should().Throw<InvalidOperationException>();\n\n    [TestMethod]\n    public void ToDisplayString_None_VisualBasic_Throws() =>\n        ComparisonKind.None.Invoking(x => x.ToDisplayString(AnalyzerLanguage.VisualBasic)).Should().Throw<InvalidOperationException>();\n\n    [TestMethod]\n    public void ToDisplayString_UnsupportedLanguage_Throws() =>\n        ComparisonKind.Equals.Invoking(x => x.ToDisplayString(null)).Should().Throw<NotSupportedException>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Syntax/Extensions/CountComparisonResultExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Syntax.Utilities;\n\nnamespace SonarAnalyzer.Core.Syntax.Extensions.Test;\n\n[TestClass]\npublic class CountComparisonResultExtensionsTest\n{\n    [TestMethod]\n    [DataRow(ComparisonKind.Equals, -1, CountComparisonResult.AlwaysFalse)]\n    [DataRow(ComparisonKind.Equals, +0, CountComparisonResult.Empty)]\n    [DataRow(ComparisonKind.Equals, +1, CountComparisonResult.SizeDepedendent)]\n    [DataRow(ComparisonKind.Equals, +9, CountComparisonResult.SizeDepedendent)]\n    [DataRow(ComparisonKind.NotEquals, -1, CountComparisonResult.AlwaysTrue)]\n    [DataRow(ComparisonKind.NotEquals, +0, CountComparisonResult.NotEmpty)]\n    [DataRow(ComparisonKind.NotEquals, +1, CountComparisonResult.SizeDepedendent)]\n    [DataRow(ComparisonKind.NotEquals, +9, CountComparisonResult.SizeDepedendent)]\n    [DataRow(ComparisonKind.GreaterThan, -1, CountComparisonResult.AlwaysTrue)]\n    [DataRow(ComparisonKind.GreaterThan, +0, CountComparisonResult.NotEmpty)]\n    [DataRow(ComparisonKind.GreaterThan, +1, CountComparisonResult.SizeDepedendent)]\n    [DataRow(ComparisonKind.GreaterThan, +9, CountComparisonResult.SizeDepedendent)]\n    [DataRow(ComparisonKind.LessThan, -1, CountComparisonResult.AlwaysFalse)]\n    [DataRow(ComparisonKind.LessThan, +0, CountComparisonResult.AlwaysFalse)]\n    [DataRow(ComparisonKind.LessThan, +1, CountComparisonResult.Empty)]\n    [DataRow(ComparisonKind.LessThan, +2, CountComparisonResult.SizeDepedendent)]\n    [DataRow(ComparisonKind.GreaterThanOrEqual, -1, CountComparisonResult.AlwaysTrue)]\n    [DataRow(ComparisonKind.GreaterThanOrEqual, +0, CountComparisonResult.AlwaysTrue)]\n    [DataRow(ComparisonKind.GreaterThanOrEqual, +1, CountComparisonResult.NotEmpty)]\n    [DataRow(ComparisonKind.GreaterThanOrEqual, +2, CountComparisonResult.SizeDepedendent)]\n    [DataRow(ComparisonKind.LessThanOrEqual, -9, CountComparisonResult.AlwaysFalse)]\n    [DataRow(ComparisonKind.LessThanOrEqual, -1, CountComparisonResult.AlwaysFalse)]\n    [DataRow(ComparisonKind.LessThanOrEqual, +0, CountComparisonResult.Empty)]\n    [DataRow(ComparisonKind.LessThanOrEqual, +1, CountComparisonResult.SizeDepedendent)]\n    public void Compare(ComparisonKind comparison, int count, CountComparisonResult expected) =>\n        comparison.Compare(count).Should().Be(expected);\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Syntax/Extensions/LocationExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.Core.Syntax.Extensions.Test;\n\n[TestClass]\npublic class LocationExtensionsTest\n{\n    [TestMethod]\n    public void EnsureMappedLocation_NonGeneratedLocation_ShouldBeSame()\n    {\n        var code = \"\"\"\n            using System;\n\n            namespace HelloWorld\n            {\n                class Program\n                {\n                    static void Main(string[] args)\n                    {\n                        Console.WriteLine(\"Hello, World!\");\n                    }\n                }\n            }\n            \"\"\";\n        var location = Location.Create(CSharpSyntaxTree.ParseText(code), TextSpan.FromBounds(50, 75));\n\n        var result = location.EnsureMappedLocation();\n\n        result.Should().BeSameAs(location);\n    }\n\n    [TestMethod]\n    public void EnsureMappedLocation_LocationNull_ShouldReturnNull()\n    {\n        Location location = null;\n\n        var result = location.EnsureMappedLocation();\n\n        result.Should().BeNull();\n    }\n\n    [TestMethod]\n    public void EnsureMappedLocation_GeneratedLocation_ShouldTargetOriginal()\n    {\n        var code = \"\"\"\n            using System;\n\n            namespace HelloWorld\n            {\n                class Program\n                {\n                    static void Main(string[] args)\n                    {\n            #line (1, 5) - (1, 20) 30 \"Original.razor\"\n                        Console.WriteLine(\"Hello, World!\");\n                    }\n                }\n            }\n            \"\"\";\n        var location = Location.Create(CSharpSyntaxTree.ParseText(code).WithFilePath(\"Program.razor.g.cs\"), new TextSpan(code.IndexOf(\"\\\"Hello, World!\\\"\"), 15));\n\n        var result = location.EnsureMappedLocation();\n\n        result.Should().NotBeSameAs(location);\n        result.GetLineSpan().Path.Should().Be(\"Original.razor\");\n        result.GetLineSpan().Span.Start.Line.Should().Be(0);\n        result.GetLineSpan().Span.Start.Character.Should().Be(4);\n        result.GetLineSpan().Span.End.Line.Should().Be(0);\n        result.GetLineSpan().Span.End.Character.Should().Be(19);\n    }\n\n    [TestMethod]\n    public void ToSecondary_NullMessage()\n    {\n        var code = \"public class C {}\";\n        var location = Location.Create(CSharpSyntaxTree.ParseText(code), TextSpan.FromBounds(13, 14));\n\n        var secondaryLocation = location.ToSecondary(null);\n\n        secondaryLocation.Should().NotBeNull();\n        secondaryLocation.Location.Should().Be(location);\n        secondaryLocation.Message.Should().BeNull();\n    }\n\n    [TestMethod]\n    [DataRow(null)]\n    [DataRow([])]\n    public void ToSecondary_MessageArgs(string[] messageArgs)\n    {\n        var code = \"public class C {}\";\n        var location = Location.Create(CSharpSyntaxTree.ParseText(code), TextSpan.FromBounds(13, 14));\n\n        var secondaryLocation = location.ToSecondary(\"Message\", messageArgs);\n\n        secondaryLocation.Should().NotBeNull();\n        secondaryLocation.Location.Should().Be(location);\n        secondaryLocation.Message.Should().Be(\"Message\");\n    }\n\n    [TestMethod]\n    [DataRow(\"Message {0}\", \"42\")]\n    [DataRow(\"{1} Message {0} \", \"42\", \"21\")]\n    public void ToSecondary_MessageFormat(string format, params string[] messageArgs)\n    {\n        var code = \"public class C {}\";\n        var location = Location.Create(CSharpSyntaxTree.ParseText(code), TextSpan.FromBounds(13, 14));\n\n        var secondaryLocation = location.ToSecondary(format, messageArgs);\n\n        secondaryLocation.Should().NotBeNull();\n        secondaryLocation.Location.Should().Be(location);\n        secondaryLocation.Message.Should().Be(string.Format(format, messageArgs));\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Syntax/Extensions/SyntaxNodeExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\n\nnamespace SonarAnalyzer.Core.Syntax.Extensions.Test;\n\n[TestClass]\npublic class SyntaxNodeExtensionsTest\n{\n    [TestMethod]\n    public void LineNumberToReport()\n    {\n        const string code = \"\"\"\n         namespace Test\n         {\n             class Sample { }\n         }\n         \"\"\";\n        var method = CSharpSyntaxTree.ParseText(code).Single<ClassDeclarationSyntax>();\n        method.LineNumberToReport().Should().Be(3);\n        method.GetLocation().GetLineSpan().StartLinePosition.LineNumberToReport().Should().Be(3);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Syntax/Extensions/SyntaxTokenExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Syntax.Extensions.Test;\n\n[TestClass]\npublic class SyntaxTokenExtensionsTest\n{\n    [TestMethod]\n    public void ToSecondaryLocation_NullMessage()\n    {\n        var code = \"public class $$C$$ {}\";\n        var token = TestCompiler.TokenBetweenMarkersCS(code).Token;\n        var secondaryLocation = token.ToSecondaryLocation(null);\n        secondaryLocation.Should().NotBeNull();\n        secondaryLocation.Location.Should().Be(token.GetLocation());\n        secondaryLocation.Message.Should().BeNull();\n    }\n\n    [TestMethod]\n    [DataRow(null)]\n    [DataRow([])]\n    public void ToSecondaryLocation_MessageArgs(string[] messageArgs)\n    {\n        var code = \"public class $$C$$ {}\";\n        var token = TestCompiler.TokenBetweenMarkersCS(code).Token;\n        var secondaryLocation = token.ToSecondaryLocation(\"Message\", messageArgs);\n        secondaryLocation.Should().NotBeNull();\n        secondaryLocation.Location.Should().Be(token.GetLocation());\n        secondaryLocation.Message.Should().Be(\"Message\");\n    }\n\n    [TestMethod]\n    [DataRow(\"Message {0}\", \"42\")]\n    [DataRow(\"{1} Message {0} \", \"42\", \"21\")]\n    public void ToSecondaryLocation_MessageFormat(string format, params string[] messageArgs)\n    {\n        var code = \"public class $$C$$ {}\";\n        var token = TestCompiler.TokenBetweenMarkersCS(code).Token;\n        var secondaryLocation = token.ToSecondaryLocation(format, messageArgs);\n        secondaryLocation.Should().NotBeNull();\n        secondaryLocation.Location.Should().Be(token.GetLocation());\n        secondaryLocation.Message.Should().Be(string.Format(format, messageArgs));\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Syntax/Utilities/GeneratedCodeRecognizerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Syntax.Utilities.Test;\n\n[TestClass]\npublic class GeneratedCodeRecognizerTest\n{\n    [TestMethod]\n    [DataRow(null)]\n    [DataRow(\"\")]\n    public void IsGenerated_WithNullOrEmptyPathAndNullRoot_ReturnsFalse(string path)\n    {\n        var tree = Substitute.For<SyntaxTree>();\n        tree.FilePath.Returns(path);\n\n        new TestRecognizer().IsGenerated(tree).Should().BeFalse();\n    }\n\n    [TestMethod]\n    [DataRow(@\"C:\\SonarSource\\SomeFile.g.cs\")]\n    [DataRow(@\"C:\\SonarSource\\SomeFile_razor.g.cs\")]\n    [DataRow(@\"C:\\SonarSource\\SomeFile_cshtml.g.cs\")]\n    [DataRow(@\"C:\\SonarSource\\SomeFile_razor.ide.g.cs\")]\n    [DataRow(@\"C:\\SonarSource\\SomeFile_cshtml.ide.g.cs\")]\n    [DataRow(@\"C:\\SonarSource\\SomeFile_RAZOR.g.cS\")]\n    public void IsGenerated_GeneratedFiles_ReturnsTrue(string path)\n    {\n        var tree = Substitute.For<SyntaxTree>();\n        tree.FilePath.Returns(path);\n        new TestRecognizer().IsGenerated(tree).Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void IsGenerated_NonGeneratedPath_ReturnsTrue()\n    {\n        var tree = Substitute.For<SyntaxTree>();\n        tree.FilePath.Returns(@\"C:\\SonarSource\\SomeFile.cs\");\n        new TestRecognizer().IsGenerated(tree).Should().BeFalse();\n    }\n\n    [TestMethod]\n    [DataRow(@\"C:\\SonarSource\\SomeFile_razor.g.cs\")]\n    [DataRow(@\"C:\\SonarSource\\SomeFile_RAZOR.g.cS\")]\n    [DataRow(@\"C:\\SonarSource\\SomeFile_razor.ide.g.cs\")]\n    [DataRow(@\"C:\\SonarSource\\SomeFile.razor.-6NXeWT5Akt4vxdz.ide.g.cs\")]\n    [DataRow(@\"SomeFile_razor.ide.g.cs\")]\n    [DataRow(@\"SomeFile.razor.-6NXeWT5Akt4vxdz.ide.g.cs\")]\n    public void IsRazorGeneratedFile_RazorGeneratedFiles_Razor_ReturnsTrue(string path)\n    {\n        var tree = Substitute.For<SyntaxTree>();\n        tree.FilePath.Returns(path);\n\n        GeneratedCodeRecognizer.IsRazorGeneratedFile(tree).Should().BeTrue();\n        GeneratedCodeRecognizer.IsRazor(tree).Should().BeTrue();\n        GeneratedCodeRecognizer.IsCshtml(tree).Should().BeFalse();\n    }\n\n    [TestMethod]\n    [DataRow(@\"C:\\SonarSource\\SomeFile_cshtml.g.cs\")]\n    [DataRow(@\"C:\\SonarSource\\SomeFile_CSHTML.g.cs\")]\n    [DataRow(@\"SomeFile_cshtml.g.cs\")]\n    [DataRow(@\"SomeFile_cshtml.ide.g.cs\")]\n    [DataRow(@\"C:\\SonarSource\\SomeFile_cshtml.ide.g.cs\")]\n    [DataRow(@\"C:\\SonarSource\\SomeFile.cshtml.-6NXeWT5Akt4vxdz.ide.g.cs\")]\n    [DataRow(@\"SomeFile.cshtml.-6NXeWT5Akt4vxdz.ide.g.cs\")]\n    public void IsRazorGeneratedFile_RazorGeneratedFiles_Cshtml_ReturnsTrue(string path)\n    {\n        var tree = Substitute.For<SyntaxTree>();\n        tree.FilePath.Returns(path);\n\n        GeneratedCodeRecognizer.IsRazorGeneratedFile(tree).Should().BeTrue();\n        GeneratedCodeRecognizer.IsCshtml(tree).Should().BeTrue();\n        GeneratedCodeRecognizer.IsRazor(tree).Should().BeFalse();\n    }\n\n    [TestMethod]\n    [DataRow(@\"C:\\SonarSource\\SomeFile.g.cs\")]\n    [DataRow(@\"C:\\SonarSource\\SomeFile_razor.g.cs.randomEnding\")]\n    [DataRow(@\"C:\\SonarSource\\SomeFile_cshtml.g.cs.randomEnding\")]\n    [DataRow(@\"C:\\SonarSource\\SomeFile_razor.g.ß\")]\n    [DataRow(@\"SomeFile.__virtual.cs\")]\n    [DataRow(@\"SomeFile.razor__virtual.cs\")]\n    [DataRow(@\"virtualcsharp-razor:///c:/dev/Project/Views/Home/Index.razor__viRtUaL.cs\")]\n    [DataRow(@\"virtualcsharp-razor:///c:/dev/Project/Views/Home/Index.cshtml__VIRTUAL.cs\")]\n    [DataRow(@\"SomeFile.php.-ABC.ide.g.cs\")]\n    public void IsRazorGeneratedFile_NonRazorGeneratedFiles_ReturnsFalse(string path)\n    {\n        var tree = Substitute.For<SyntaxTree>();\n        tree.FilePath.Returns(path);\n\n        GeneratedCodeRecognizer.IsRazorGeneratedFile(tree).Should().BeFalse();\n        GeneratedCodeRecognizer.IsRazor(tree).Should().BeFalse();\n        GeneratedCodeRecognizer.IsCshtml(tree).Should().BeFalse();\n    }\n\n    [TestMethod]\n    [DataRow(@\"C:\\SonarSource\\SomeFile_razor.g.cs\")]\n    [DataRow(@\"C:\\SonarSource\\SomeFile_RAZOR.g.cS\")]\n    [DataRow(@\"SomeFile_RAZOR.g.cS\")]\n    [DataRow(@\"C:\\SonarSource\\SomeFile_cshtml.g.cs\")]\n    [DataRow(@\"C:\\SonarSource\\SomeFile_CSHTML.g.cS\")]\n    [DataRow(@\"SomeFile_csHTML.g.cS\")]\n    public void IsBuildTimeRazorGeneratedFile_ReturnsTrue(string path)\n    {\n        var tree = Substitute.For<SyntaxTree>();\n        tree.FilePath.Returns(path);\n\n        GeneratedCodeRecognizer.IsBuildTimeRazorGeneratedFile(tree).Should().BeTrue();\n        GeneratedCodeRecognizer.IsDesignTimeRazorGeneratedFile(tree).Should().BeFalse();\n    }\n\n    [TestMethod]\n    [DataRow(@\"C:\\SonarSource\\SomeFile_razor.ide.g.cs\")]\n    [DataRow(@\"C:\\SonarSource\\SomeFile.razor.-6NXeWT5Akt4vxdz.ide.g.cs\")]\n    [DataRow(@\"SomeFile_razor.ide.g.cs\")]\n    [DataRow(@\"SomeFile.razor.-6NXeWT5Akt4vxdz.ide.g.cs\")]\n    [DataRow(@\"C:\\SonarSource\\SomeFile_cshtml.ide.g.cs\")]\n    [DataRow(@\"C:\\SonarSource\\SomeFile.csHTml.-6NXeWT5Akt4vxdz.ide.g.cs\")]\n    [DataRow(@\"SomeFile_cshtml.ide.g.cs\")]\n    [DataRow(@\"SomeFile.CSHTmL.-6NXeWT5Akt4vxdz.ide.g.cs\")]\n    public void IsDesignTimeRazorGeneratedFile_ReturnsTrue(string path)\n    {\n        var tree = Substitute.For<SyntaxTree>();\n        tree.FilePath.Returns(path);\n\n        GeneratedCodeRecognizer.IsDesignTimeRazorGeneratedFile(tree).Should().BeTrue();\n        GeneratedCodeRecognizer.IsBuildTimeRazorGeneratedFile(tree).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void IsRazorGeneratedFile_NullSyntaxTree_ReturnsFalse() =>\n        GeneratedCodeRecognizer.IsRazorGeneratedFile(null).Should().BeFalse();\n\n    [TestMethod]\n    public void IsBuildTimeRazorGeneratedFile_NullSyntaxTree_ReturnsFalse() =>\n        GeneratedCodeRecognizer.IsBuildTimeRazorGeneratedFile(null).Should().BeFalse();\n\n    [TestMethod]\n    public void IsDesignTimeRazorGeneratedFile_NullSyntaxTree_ReturnsFalse() =>\n        GeneratedCodeRecognizer.IsDesignTimeRazorGeneratedFile(null).Should().BeFalse();\n\n#pragma warning disable T0016 // Internal Styling Rule T0016\n    private class TestRecognizer : GeneratedCodeRecognizer\n    {\n        protected override string GetAttributeName(SyntaxNode node) => string.Empty;\n        protected override bool IsTriviaComment(SyntaxTrivia trivia) => false;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/Syntax/Utilities/VisualIndentComparerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Core.Syntax.Utilities.Test;\n\n[TestClass]\npublic class VisualIndentComparerTest\n{\n    [TestMethod]\n    public void TestVisualIndent_NonTabsOnly()\n    {\n        VisualIndentComparer.IsSecondIndentLonger(\"\", \"\").Should().Be(false);\n        VisualIndentComparer.IsSecondIndentLonger(\"\", \"@\").Should().Be(true);\n        VisualIndentComparer.IsSecondIndentLonger(\"123\", \"AB\").Should().Be(false);\n        VisualIndentComparer.IsSecondIndentLonger(\"123\", \"ABC\").Should().Be(false);\n        VisualIndentComparer.IsSecondIndentLonger(\"123\", \"ABCD\").Should().Be(true);\n    }\n\n    [TestMethod]\n    public void TestVisualIndent_TabsOnly()\n    {\n        VisualIndentComparer.IsSecondIndentLonger(\"\\t\\t\\t\", \"\\t\\t\").Should().Be(false);\n        VisualIndentComparer.IsSecondIndentLonger(\"\\t\\t\\t\", \"\\t\").Should().Be(false);\n        VisualIndentComparer.IsSecondIndentLonger(\"\\t\", \"\\t\\t\").Should().Be(true);\n        VisualIndentComparer.IsSecondIndentLonger(\"\\t\", \"\\t\").Should().Be(false);\n        VisualIndentComparer.IsSecondIndentLonger(\"\", \"\\t\").Should().Be(true);\n    }\n\n    [TestMethod]\n    public void TestVisualIndent_Mix_ResultIsCertain()\n    {\n        // More tabs and same chars -> certain of outcome\n        VisualIndentComparer.IsSecondIndentLonger(\"\\t\\t123\", \"\\tABCD\").Should().Be(false);\n        VisualIndentComparer.IsSecondIndentLonger(\"\\tABCD\", \"\\t\\t123\").Should().Be(true);\n\n        // More tabs and more chars -> certain of outcome\n        VisualIndentComparer.IsSecondIndentLonger(\"\\t\\t123\", \"\\t12\").Should().Be(false);\n        VisualIndentComparer.IsSecondIndentLonger(\"\\t12\", \"\\t\\t123\").Should().Be(true);\n    }\n\n    [TestMethod]\n    public void TestVisualIndent_Mix_ResultIsUncertain()\n    {\n        // More tabs but fewer characters -> depends on tab spacing\n        // -> error on the side of caution and return false\n        VisualIndentComparer.IsSecondIndentLonger(\"\\t\\t\", \"          \").Should().Be(true);\n        VisualIndentComparer.IsSecondIndentLonger(\"          \", \"\\t\\t\").Should().Be(true);\n\n        VisualIndentComparer.IsSecondIndentLonger(\"\\t\\t\\t\", \"\\t\\t12\").Should().Be(true);\n        VisualIndentComparer.IsSecondIndentLonger(\"\\t\\t12\", \"\\t\\t\\t\").Should().Be(true);\n\n        // Example ITs: sources\\Nancy\\src\\Nancy\\Json\\JsonDeserializer.cs #389,390, same pattern in #620,621\n        // \"\t\t\t} else if (... )\"\n        // \"\t\t\t\tbuffer.Append (ch);\"\n        VisualIndentComparer.IsSecondIndentLonger(\"\\t\\t\\t} \", \"\\t\\t\\t\\t\").Should().Be(true);\n        VisualIndentComparer.IsSecondIndentLonger(\"\\t\\t\\t\\t\", \"\\t\\t\\t} \").Should().Be(true);\n\n        // Example ITs: \"sources\\Nancy\\src\\Nancy\\TinyIoc\\TinyIoC.cs, #1448,1450\n        // \"                if (!registrationType.IsAssignableFrom(type))\"\n        // \"#endif\"  <-- not part of syntax tree\n        // \"\t\t\t\t\tthrow new ArgumentException(String.Format(\"types: The type {0} is not assignable from {1}\", registrationType.FullName, type.FullName));\"\n        VisualIndentComparer.IsSecondIndentLonger(\"                \", \"\\t\\t\\t\\t\\t\").Should().Be(true);\n        VisualIndentComparer.IsSecondIndentLonger(\"\\t\\t\\t\\t\", \"                \").Should().Be(true);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/TestResources/FilesToAnalyze/EmptyFilesToAnalyze.txt",
    "content": "﻿"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/TestResources/FilesToAnalyze/FilesToAnalyze.txt",
    "content": "﻿C:\\Projects/DummyProj/wEB.config\nC:\\Projects/DummyProj/Views\\Web.confiG\nC:\\Projects\\DummyProj\\Views\\Global.asax\nC:\\Projects\\DummyProj\\Csharp\\Controllers\\HomeController.cs\nC:\\Projects\\DummyProj\\VisualBasic\\Controllers\\HomeController.vb\nC:\\Projects/DummyProj/Views\\Web.confiGuration"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/TestResources/FilesToAnalyze/FilesToAnalyzeWithInvalidValues.txt",
    "content": "﻿foo\n123\nC:\\Projects\\Controllers:web.config\nC:web.config\nC:\\Projects<web.config\nC:\\Projects>\\Controllers/web.config\nC:\\Projects/DummyProj/Views\\Web.confiG"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/TestResources/SonarLintXml/All_properties_cs/SonarLint.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<AnalysisInput>\n  <Settings>\n    <Setting>\n      <Key>sonar.cs.analyzeRazorCode</Key>\n      <Value>false</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.cs.ignoreHeaderComments</Key>\n      <Value>true</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.cs.analyzeGeneratedCode</Key>\n      <Value>false</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.cs.file.suffixes</Key>\n      <Value>.cs</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.cs.roslyn.ignoreIssues</Key>\n      <Value>false</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.exclusions</Key>\n      <Value>Fake/Exclusions/**/*,Fake/Exclusions/Second*/**/*</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.inclusions</Key>\n      <Value>Fake/Inclusions/**/*,Fake/Inclusions/Second*/**/*</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.global.exclusions</Key>\n      <Value>Fake/GlobalExclusions/**/*,Fake/GlobalExclusions/Second*/**/*</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.test.exclusions</Key>\n      <Value>Fake/TestExclusions/**/*,Fake/TestExclusions/Second*/**/*</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.test.inclusions</Key>\n      <Value>Fake/TestInclusions/**/*,Fake/TestInclusions/Second*/**/*</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.global.test.exclusions</Key>\n      <Value>Fake/GlobalTestExclusions/**/*,Fake/GlobalTestExclusions/Second*/**/*</Value>\n    </Setting>\n  </Settings>\n  <Rules>\n    <Rule>\n      <Key>S2225</Key>\n    </Rule>\n    <Rule>\n      <Key>S2342</Key>\n      <Parameters>\n        <Parameter>\n          <Key>format</Key>\n          <Value>^([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?$</Value>\n        </Parameter>\n        <Parameter>\n          <Key>flagsAttributeFormat</Key>\n          <Value>^([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?s$</Value>\n        </Parameter>\n      </Parameters>\n    </Rule>\n    <Rule>\n      <Key>S2346</Key>\n    </Rule>\n\t<Rule>\n      <Key>S1067</Key>\n      <Parameters>\n        <Parameter>\n          <Key>max</Key>\n          <Value>1</Value>\n        </Parameter>\n      </Parameters>\n    </Rule>\n  </Rules>\n  <Files> \n  </Files>\n</AnalysisInput>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/TestResources/SonarLintXml/All_properties_vbnet/SonarLint.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<AnalysisInput>\n  <Settings>\n    <Setting>\n      <Key>sonar.vbnet.ignoreHeaderComments</Key>\n      <Value>true</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.vbnet.analyzeGeneratedCode</Key>\n      <Value>false</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.vbnet.file.suffixes</Key>\n      <Value>.vb</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.vbnet.roslyn.ignoreIssues</Key>\n      <Value>false</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.exclusions</Key>\n      <Value>Fake/Exclusions/**/*,Fake/Exclusions/Second*/**/*</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.inclusions</Key>\n      <Value>Fake/Inclusions/**/*,Fake/Inclusions/Second*/**/*</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.global.exclusions</Key>\n      <Value>Fake/GlobalExclusions/**/*,Fake/GlobalExclusions/Second*/**/*</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.test.exclusions</Key>\n      <Value>Fake/TestExclusions/**/*,Fake/TestExclusions/Second*/**/*</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.test.inclusions</Key>\n      <Value>Fake/TestInclusions/**/*,Fake/TestInclusions/Second*/**/*</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.global.test.exclusions</Key>\n      <Value>Fake/GlobalTestExclusions/**/*,Fake/GlobalTestExclusions/Second*/**/*</Value>\n    </Setting>\n  </Settings>\n  <Rules>\n    <Rule>\n      <Key>S2225</Key>\n    </Rule>\n    <Rule>\n      <Key>S2342</Key>\n      <Parameters>\n        <Parameter>\n          <Key>format</Key>\n          <Value>^([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?$</Value>\n        </Parameter>\n        <Parameter>\n          <Key>flagsAttributeFormat</Key>\n          <Value>^([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?s$</Value>\n        </Parameter>\n      </Parameters>\n    </Rule>\n    <Rule>\n      <Key>S2115</Key>\n    </Rule>\n    <Rule>\n      <Key>S3776</Key>\n      <Parameters>\n        <Parameter>\n          <Key>threshold</Key>\n          <Value>15</Value>\n        </Parameter>\n        <Parameter>\n          <Key>propertyThreshold</Key>\n          <Value>3</Value>\n        </Parameter>\n      </Parameters>\n    </Rule>\n  </Rules>\n  <Files> \n  </Files>\n</AnalysisInput>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/TestResources/SonarLintXml/Duplicated_Properties/SonarLint.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<AnalysisInput>\n  <Settings>\n    <Setting>\n      <Key>sonar.cs.ignoreHeaderComments</Key>\n      <Value>true</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.cs.ignoreHeaderComments</Key>\n      <Value>true</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.cs.analyzeGeneratedCode</Key>\n      <Value>true</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.cs.analyzeGeneratedCode</Key>\n      <Value>false</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.exclusions</Key>\n      <Value>Fake/Exclusions/**/*,Fake/Exclusions/Second*/**/*</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.exclusions</Key>\n      <Value>Fake/Inclusions/**/*</Value>\n    </Setting>\n  </Settings>\n</AnalysisInput>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/TestResources/SonarLintXml/Incorrect_value_type/SonarLint.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<AnalysisInput>\n  <Settings>\n    <Setting>\n      <Key>sonar.cs.ignoreHeaderComments</Key>\n      <Value>abc</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.cs.analyzeGeneratedCode</Key>\n      <Value>null</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.cs.roslyn.ignoreIssues</Key>\n      <Value></Value>\n    </Setting>\n  </Settings>\n  <Rules>\n  </Rules>\n  <Files> \n  </Files>\n</AnalysisInput>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/TestResources/SonarLintXml/Missing_properties/SonarLint.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<AnalysisInput>\n  <Settings>\n    <Setting>\n      <Key>sonar.nothing</Key>\n      <Value>nothing</Value>\n    </Setting>\n  </Settings>\n  <Rules>\n  </Rules>\n  <Files> \n  </Files>\n</AnalysisInput>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/TestResources/SonarLintXml/Partially_missing_properties/SonarLint.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<AnalysisInput>\n  <Settings>\n    <Setting>\n      <Key>sonar.nothing</Key>\n      <Value>nothing</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.cs.analyzeGeneratedCode</Key>\n      <Value>true</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.exclusions</Key>\n      <Value>Fake/Exclusions/**/*,Fake/Exclusions/Second*/**/*</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.inclusions</Key>\n      <Value>Fake/Inclusions/**/*,Fake/Inclusions/Second*/**/*</Value>\n    </Setting>\n  </Settings>\n  <Rules>\n  </Rules>\n  <Files> \n  </Files>\n</AnalysisInput>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/TestResources/SonarLintXml/PropertiesCSharpTrueVbnetFalse/SonarLint.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<AnalysisInput>\n  <Settings>\n    <Setting>\n      <Key>sonar.cs.ignoreHeaderComments</Key>\n      <Value>true</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.vbnet.ignoreHeaderComments</Key>\n      <Value>false</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.cs.analyzeGeneratedCode</Key>\n      <Value>true</Value>\n    </Setting>\n    <Setting>\n       <Key>sonar.cs.analyzeRazorCode</Key>\n       <Value>true</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.vbnet.analyzeGeneratedCode</Key>\n      <Value>false</Value>\n    </Setting>\n  </Settings>\n</AnalysisInput>"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/TestResources/SonarProjectConfig/Invalid_DifferentClassName/SonarProjectConfig.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FOO xmlns=\"http://www.sonarsource.com/msbuild/analyzer/2021/1\">\n  <AnalysisConfigPath>c:\\foo\\bar\\.sonarqube\\conf\\SonarQubeAnalysisConfig.xml</AnalysisConfigPath>\n  <ProjectPath>C:\\foo\\bar\\AwesomeBankWeb.CSharp\\AwesomeBankWeb.CSharp.csproj</ProjectPath>\n  <FilesToAnalyzePath>c:\\foo\\bar\\.sonarqube\\conf\\0\\FilesToAnalyze.txt</FilesToAnalyzePath>\n  <OutPath>C:\\foo\\bar\\.sonarqube\\out\\0</OutPath>\n  <ProjectType>Product</ProjectType>\n  <TargetFramework>netcoreapp3.1</TargetFramework>\n</FOO>"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/TestResources/SonarProjectConfig/Invalid_DifferentNamespace/SonarProjectConfig.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<SonarProjectConfig xmlns=\"http://www.FOO.com/BAR/2021/1\">\n  <AnalysisConfigPath>c:\\foo\\bar\\.sonarqube\\conf\\SonarQubeAnalysisConfig.xml</AnalysisConfigPath>\n  <ProjectPath>C:\\foo\\bar\\AwesomeBankWeb.CSharp\\AwesomeBankWeb.CSharp.csproj</ProjectPath>\n  <FilesToAnalyzePath>c:\\foo\\bar\\.sonarqube\\conf\\0\\FilesToAnalyze.txt</FilesToAnalyzePath>\n  <OutPath>C:\\foo\\bar\\.sonarqube\\out\\0</OutPath>\n  <ProjectType>Product</ProjectType>\n  <TargetFramework>netcoreapp3.1</TargetFramework>\n</SonarProjectConfig>"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/TestResources/SonarProjectConfig/Invalid_Xml/SonarProjectConfig.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<SonarProjectConfig\n  <AnalysisConfigPath>c:\\foo\\bar\\.sonarqube\\conf\\SonarQubeAnalysisConfig.xml</AnalysisConfigPath>\n  <ProjectPath>C:\n</SonarProjectConfig>"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/TestResources/SonarProjectConfig/MissingAnalysisConfigPath/SonarProjectConfig.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<SonarProjectConfig xmlns=\"http://www.sonarsource.com/msbuild/analyzer/2021/1\">\n  <ProjectPath>C:\\foo\\bar\\AwesomeBankWeb.CSharp\\AwesomeBankWeb.CSharp.csproj</ProjectPath>\n  <FilesToAnalyzePath>c:\\foo\\bar\\.sonarqube\\conf\\0\\FilesToAnalyze.txt</FilesToAnalyzePath>\n  <OutPath>C:\\foo\\bar\\.sonarqube\\out\\0</OutPath>\n  <ProjectType>Product</ProjectType>\n  <TargetFramework>netcoreapp3.1</TargetFramework>\n</SonarProjectConfig>"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/TestResources/SonarProjectConfig/MissingFilesToAnalyzePath/SonarProjectConfig.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<SonarProjectConfig xmlns=\"http://www.sonarsource.com/msbuild/analyzer/2021/1\">\n  <AnalysisConfigPath>c:\\foo\\bar\\.sonarqube\\conf\\SonarQubeAnalysisConfig.xml</AnalysisConfigPath>\n  <ProjectPath>C:\\foo\\bar\\AwesomeBankWeb.CSharp\\AwesomeBankWeb.CSharp.csproj</ProjectPath>\n  <OutPath>C:\\foo\\bar\\.sonarqube\\out\\0</OutPath>\n  <ProjectType>Product</ProjectType>\n  <TargetFramework>netcoreapp3.1</TargetFramework>\n</SonarProjectConfig>"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/TestResources/SonarProjectConfig/MissingOutPath/SonarProjectConfig.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<SonarProjectConfig xmlns=\"http://www.sonarsource.com/msbuild/analyzer/2021/1\">\n  <AnalysisConfigPath>c:\\foo\\bar\\.sonarqube\\conf\\SonarQubeAnalysisConfig.xml</AnalysisConfigPath>\n  <ProjectPath>C:\\foo\\bar\\AwesomeBankWeb.CSharp\\AwesomeBankWeb.CSharp.csproj</ProjectPath>\n  <FilesToAnalyzePath>c:\\foo\\bar\\.sonarqube\\conf\\0\\FilesToAnalyze.txt</FilesToAnalyzePath>\n  <ProjectType>Product</ProjectType>\n  <TargetFramework>netcoreapp3.1</TargetFramework>\n</SonarProjectConfig>"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/TestResources/SonarProjectConfig/MissingProjectPath/SonarProjectConfig.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<SonarProjectConfig xmlns=\"http://www.sonarsource.com/msbuild/analyzer/2021/1\">\n  <AnalysisConfigPath>c:\\foo\\bar\\.sonarqube\\conf\\SonarQubeAnalysisConfig.xml</AnalysisConfigPath>\n  <FilesToAnalyzePath>c:\\foo\\bar\\.sonarqube\\conf\\0\\FilesToAnalyze.txt</FilesToAnalyzePath>\n  <OutPath>C:\\foo\\bar\\.sonarqube\\out\\0</OutPath>\n  <ProjectType>Product</ProjectType>\n  <TargetFramework>netcoreapp3.1</TargetFramework>\n</SonarProjectConfig>"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/TestResources/SonarProjectConfig/MissingProjectType/SonarProjectConfig.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<SonarProjectConfig xmlns=\"http://www.sonarsource.com/msbuild/analyzer/2021/1\">\n  <AnalysisConfigPath>c:\\foo\\bar\\.sonarqube\\conf\\SonarQubeAnalysisConfig.xml</AnalysisConfigPath>\n  <ProjectPath>C:\\foo\\bar\\AwesomeBankWeb.CSharp\\AwesomeBankWeb.CSharp.csproj</ProjectPath>\n  <FilesToAnalyzePath>c:\\foo\\bar\\.sonarqube\\conf\\0\\FilesToAnalyze.txt</FilesToAnalyzePath>\n  <OutPath>C:\\foo\\bar\\.sonarqube\\out\\0</OutPath>\n  <TargetFramework>netcoreapp3.1</TargetFramework>\n</SonarProjectConfig>"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/TestResources/SonarProjectConfig/MissingTargetFramework/SonarProjectConfig.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<SonarProjectConfig xmlns=\"http://www.sonarsource.com/msbuild/analyzer/2021/1\">\n  <AnalysisConfigPath>c:\\foo\\bar\\.sonarqube\\conf\\SonarQubeAnalysisConfig.xml</AnalysisConfigPath>\n  <ProjectPath>C:\\foo\\bar\\AwesomeBankWeb.CSharp\\AwesomeBankWeb.CSharp.csproj</ProjectPath>\n  <FilesToAnalyzePath>c:\\foo\\bar\\.sonarqube\\conf\\0\\FilesToAnalyze.txt</FilesToAnalyzePath>\n  <OutPath>C:\\foo\\bar\\.sonarqube\\out\\0</OutPath>\n  <ProjectType>Product</ProjectType>\n</SonarProjectConfig>"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/TestResources/SonarProjectConfig/Path_MixedSeparators/SonarProjectConfig.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<SonarProjectConfig xmlns=\"http://www.sonarsource.com/msbuild/analyzer/2021/1\">\n  <AnalysisConfigPath>c:\\foo\\bar\\.sonarqube/conf/SonarQubeAnalysisConfig.xml</AnalysisConfigPath>\n  <ProjectPath>C:\\foo\\bar\\AwesomeBankWeb.CSharp/AwesomeBankWeb.CSharp.csproj</ProjectPath>\n  <FilesToAnalyzePath>c:\\foo\\bar\\.sonarqube\\conf/0/FilesToAnalyze.txt</FilesToAnalyzePath>\n  <OutPath>C:\\foo\\bar\\.sonarqube/out/0</OutPath>\n  <ProjectType>Product</ProjectType>\n  <TargetFramework>netcoreapp3.1</TargetFramework>\n</SonarProjectConfig>"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/TestResources/SonarProjectConfig/Path_Unix/SonarProjectConfig.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<SonarProjectConfig xmlns=\"http://www.sonarsource.com/msbuild/analyzer/2021/1\">\n  <AnalysisConfigPath>/home/user/.sonarqube/conf/SonarQubeAnalysisConfig.xml</AnalysisConfigPath>\n  <ProjectPath>/home/user/AwesomeBankWeb.CSharp.csproj</ProjectPath>\n  <FilesToAnalyzePath>/home/user/.sonarqube/conf/0/FilesToAnalyze.txt</FilesToAnalyzePath>\n  <OutPath>/home/user/.sonarqube/out/0</OutPath>\n  <ProjectType>Test</ProjectType>\n  <TargetFramework>net5</TargetFramework>\n</SonarProjectConfig>"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/TestResources/SonarProjectConfig/Path_Windows/SonarProjectConfig.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<SonarProjectConfig xmlns=\"http://www.sonarsource.com/msbuild/analyzer/2021/1\">\n  <AnalysisConfigPath>c:\\foo\\bar\\.sonarqube\\conf\\SonarQubeAnalysisConfig.xml</AnalysisConfigPath>\n  <ProjectPath>C:\\foo\\bar\\AwesomeBankWeb.CSharp\\AwesomeBankWeb.CSharp.csproj</ProjectPath>\n  <FilesToAnalyzePath>c:\\foo\\bar\\.sonarqube\\conf\\0\\FilesToAnalyze.txt</FilesToAnalyzePath>\n  <OutPath>C:\\foo\\bar\\.sonarqube\\out\\0</OutPath>\n  <ProjectType>Product</ProjectType>\n  <TargetFramework>netcoreapp3.1</TargetFramework>\n</SonarProjectConfig>"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/TestResources/SonarProjectConfig/UnexpectedProjectTypeValue/SonarProjectConfig.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<SonarProjectConfig xmlns=\"http://www.sonarsource.com/msbuild/analyzer/2021/1\">\n  <AnalysisConfigPath>/home/user/.sonarqube/conf/SonarQubeAnalysisConfig.xml</AnalysisConfigPath>\n  <ProjectPath>/home/user/AwesomeBankWeb.CSharp.csproj</ProjectPath>\n  <FilesToAnalyzePath>/home/user/.sonarqube/conf/0/FilesToAnalyze.txt</FilesToAnalyzePath>\n  <OutPath>/home/user/.sonarqube/out/0</OutPath>\n  <ProjectType>FOO</ProjectType>\n  <TargetFramework>net5</TargetFramework>\n</SonarProjectConfig>"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Core.Test/packages.lock.json",
    "content": "{\n  \"version\": 1,\n  \"dependencies\": {\n    \"net10.0\": {\n      \"altcover\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[9.0.102, )\",\n        \"resolved\": \"9.0.102\",\n        \"contentHash\": \"q3Rf5t0M9kXlcO5qhsaAe6NrFSNd5enrhKmF/Ezgmomqw34PbUTbRSYjSDNhS3YGDyUrPTkyPn14EfLDJWztcA==\"\n      },\n      \"Combinatorial.MSTest\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[2.0.0, )\",\n        \"resolved\": \"2.0.0\",\n        \"contentHash\": \"9tB2TMPkuEkYYUq64WREHMMyPt9NfKAyuitpK9yw3zbVe6v/vYkClZTR02+yKFUG+g8XHi5LMTt8jHz4RufGqw==\",\n        \"dependencies\": {\n          \"MSTest.TestFramework\": \"4.0.1\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[3.3.1, )\",\n        \"resolved\": \"3.3.1\",\n        \"contentHash\": \"eT+kgNCDdTRbQ5WF6BGx1HI3D5jYfHteza/koefhWC2vNZGxObA74XxwWfg40dy3uUv7dn3OGKLK5GUPLroVog==\"\n      },\n      \"Microsoft.NET.Test.Sdk\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[18.4.0, )\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"w49iZdL4HL6V25l41NVQLXWQ+e71GvSkKVteMrOL02gP/PUkcnO/1yEb2s9FntU4wGmJWfKnyrRAhcMHd9ZZNA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeCoverage\": \"18.4.0\",\n          \"Microsoft.TestPlatform.TestHost\": \"18.4.0\"\n        }\n      },\n      \"MSTest.TestAdapter\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[4.2.1, )\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"lZRgNzaQnffK4XLjM/og4Eoqp/3IkpcyJQQcyKXkPdkzCT3+ghpwHa9zG1xYhQDbUFoc54M+/waLwh31K9stDQ==\",\n        \"dependencies\": {\n          \"MSTest.TestFramework\": \"4.2.1\",\n          \"Microsoft.Testing.Extensions.VSTestBridge\": \"2.2.1\",\n          \"Microsoft.Testing.Platform.MSBuild\": \"2.2.1\"\n        }\n      },\n      \"MSTest.TestFramework\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[4.2.1, )\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"I4/RbS2TpGZ56CE98+jPbrGlcerYtw2LvPVKzQGvyQQcJDekPy2Kd+fnThXYn+geJ1sW+vA9B7++rFNxvKcWxA==\",\n        \"dependencies\": {\n          \"MSTest.Analyzers\": \"4.2.1\"\n        }\n      },\n      \"SonarAnalyzer.CSharp.Styling\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[10.21.0.135717, )\",\n        \"resolved\": \"10.21.0.135717\",\n        \"contentHash\": \"hl264jF539oB7m2jED5QGM345eFSiDAdoJc8TH0HM6L7ZeqT5TDqZDQeZ8IDP02dVIpH/Fhhn+HsGfEcj8ohyQ==\"\n      },\n      \"StyleCop.Analyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.2.0-beta.556, )\",\n        \"resolved\": \"1.2.0-beta.556\",\n        \"contentHash\": \"llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==\",\n        \"dependencies\": {\n          \"StyleCop.Analyzers.Unstable\": \"1.2.0.556\"\n        }\n      },\n      \"Castle.Core\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.1.1\",\n        \"contentHash\": \"rpYtIczkzGpf+EkZgDr9CClTdemhsrwA/W5hMoPjLkRFnXzH44zDLoovXeKtmxb1ykXK9aJVODSpiJml8CTw2g==\",\n        \"dependencies\": {\n          \"System.Diagnostics.EventLog\": \"6.0.0\"\n        }\n      },\n      \"FluentAssertions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.2.1\",\n        \"contentHash\": \"MilqBF2lZrT0V1azIA6DG6I/snS0rG3A8ohT2Jjkhq6zOFk76nqx4BPnEnzrX6jFVa6xvkDU++z3PebCGZyJ4g==\",\n        \"dependencies\": {\n          \"System.Configuration.ConfigurationManager\": \"6.0.0\"\n        }\n      },\n      \"FluentAssertions.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"0.34.1\",\n        \"contentHash\": \"2BnAAB8CCPdRA9P1+lAvBZOleR2BTmsxGMtGt+LnABJUARGqoGMWEFxG3znZYqHVIrMP0Za/kyw6atyt8x2mzA==\"\n      },\n      \"Google.Protobuf\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"3.6.1\",\n        \"contentHash\": \"741fGeDQjixBJaU2j+0CbrmZXsNJkTn/hWbOh4fLVXndHsCclJmWznCPWrJmPoZKvajBvAz3e8ECJOUvRtwjNQ==\",\n        \"dependencies\": {\n          \"NETStandard.Library\": \"1.6.1\"\n        }\n      },\n      \"Humanizer.Core\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.14.1\",\n        \"contentHash\": \"lQKvtaTDOXnoVJ20ibTuSIOf2i0uO0MPbDhd1jm238I+U/2ZnRENj0cktKZhtchBMtCUSRQ5v4xBCUbKNmyVMw==\"\n      },\n      \"Microsoft.ApplicationInsights\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.23.0\",\n        \"contentHash\": \"nWArUZTdU7iqZLycLKWe0TDms48KKGE6pONH2terYNa8REXiqixrMOkf1sk5DHGMaUTqONU2YkS4SAXBhLStgw==\",\n        \"dependencies\": {\n          \"System.Diagnostics.DiagnosticSource\": \"5.0.0\"\n        }\n      },\n      \"Microsoft.Build.Framework\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"17.11.48\",\n        \"contentHash\": \"C3WIMt2wBl4++NX3jSEpTq5KXBhvAV154R4JrYHkfy9JSBcXWiL0mkgpspk5xSdOj+fS/uz7zluIy6bMM1fkkQ==\"\n      },\n      \"Microsoft.Build.Locator\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.11.2\",\n        \"contentHash\": \"tY+/S54G29CGsbL3slVu4vqtpciwVnb3fKOmrhgzEQmu/VziFaWmD/E1e/2KH7cDucuycGSkWsSXndBs5Uawow==\"\n      },\n      \"Microsoft.CodeAnalysis.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0-2.25625.1\",\n        \"contentHash\": \"4Yhh2fnu3G+J0J1lDc8WZVgMjgbynSeTfkl5IFJMFrmiIO0sc7Tjx+f3sFVV8Sd35PrIUWfof0RWc3lAMl7Azg==\"\n      },\n      \"Microsoft.CodeAnalysis.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"uC0qk3jzTQY7i90ehfnCqaOZpBUGJyPMiHJ3c0jOb8yaPBjWzIhVdNxPbeVzI74DB0C+YgBKPLqUkgFZzua5Mg==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"SQFNGQF4f7UfDXKxMzzGNMr3fjrPDIjLfmRvvVgDCw+dyvEHDaRfHuKA5q0Pr0/JW0Gcw89TxrxrS/MjwBvluQ==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp.Workspaces\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"mRwxchBs3ewXK4dqK4R/eVCx99VIq1k/lhwArlu+fJuV0uzmbkTTRw4jR9gN9sOcAQfX0uV9KQlmCk1yC0JNog==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.CSharp\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.VisualBasic\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"AJxddsIOmfimuihaLuSAm4c/zskHoL1ypAjIpSOZqHlNm2iuw0twsB8nbKczJyfClqD7+iYjdIeE5EV8WAyxRA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"pAGdr4qs7+v287DPiiM8px1cBXnhe8LxymkVGTnCwv2OEjCk5HO2zIoFvype4ivKJTRW3aTUUV8ab+915wbv+w==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.VisualBasic\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Workspaces.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"QSf1ge9A+XFZbGL+gIqXYBIKlm8QdQVLvHDPZiydG11W6mJY7XBMusrsgIEz6L8GYMzGJKTM78m9icliGMF7NA==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Workspaces.MSBuild\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"2Mg/ppo5dza1e4DJWX4+RIHMc3FgnYzuHTaLRZDupiK1LTi/PAZ1PBpF/iivHVNKQKwipHE984gy37MbM0RO9Q==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.Build.Framework\": \"17.11.48\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"Microsoft.Extensions.DependencyInjection\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Options\": \"9.0.0\",\n          \"Microsoft.Extensions.Primitives\": \"9.0.0\",\n          \"Microsoft.VisualStudio.SolutionPersistence\": \"1.0.52\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeCoverage\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"9O0BtCfzCWrkAmK187ugKdq72HHOXoOUjuWFDVc2LsZZ0pOnA9bTt+Sg9q4cF+MoAaUU+MuWtvBuFsnduviJow==\"\n      },\n      \"Microsoft.Composition\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.27\",\n        \"contentHash\": \"pwu80Ohe7SBzZ6i69LVdzowp6V+LaVRzd5F7A6QlD42vQkX0oT7KXKWWPlM/S00w1gnMQMRnEdbtOV12z6rXdQ==\"\n      },\n      \"Microsoft.Extensions.DependencyInjection\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"MCPrg7v3QgNMr0vX4vzRXvkNGgLg8vKWX0nKCWUxu2uPyMsaRgiRc1tHBnbTcfJMhMKj2slE/j2M9oGkd25DNw==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.DependencyInjection.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"+6f2qv2a3dLwd5w6JanPIPs47CxRbnk+ZocMJUhv9NxP88VlOcJYZs9jY+MYSjxvady08bUZn6qgiNh7DadGgg==\"\n      },\n      \"Microsoft.Extensions.Logging\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"crjWyORoug0kK7RSNJBTeSE6VX8IQgLf3nUpTB9m62bPXp/tzbnOsnbe8TXEG0AASNaKZddnpHKw7fET8E++Pg==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Options\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.Logging.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"g0UfujELzlLbHoVG8kPKVBaW470Ewi+jnptGS9KUi6jcb+k2StujtK3m26DFSGGwQ/+bVgZfsWqNzlP6YOejvw==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.Options\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"y2146b3jrPI3Q0lokKXdKLpmXqakYbDIPDV6r3M8SqvSf45WwOTzkyfDpxnZXJsJQEpAsAqjUq5Pu8RCJMjubg==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Primitives\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"N3qEBzmLMYiASUlKxxFIISP4AiwuPTHF5uCh+2CWSwwzAJiIYx0kBJsS30cp1nvhSySFAVi30jecD307jV+8Kg==\"\n      },\n      \"Microsoft.Testing.Extensions.Telemetry\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"7zB8BjffOyvqfHF26rFVPuK0w1fCf5+j1tLuhHIr76CqxXkGb+fMJtq6YNOV+m6qPytExHMXxluk3RgJ+dSIqw==\",\n        \"dependencies\": {\n          \"Microsoft.ApplicationInsights\": \"2.23.0\",\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.Testing.Extensions.TrxReport.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"RD6D1Jx6cKDA5IHd1H2q8ylIuQG3PD+gdULI0JC8CvsRtaypFzTFpB5xDPuQi8o6kAkcM04cBhAiJPxZboNH2Q==\",\n        \"dependencies\": {\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.Testing.Extensions.VSTestBridge\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"D8AGlkNtlTQPe3zf4SLnHBMr13lerMe0RuHSoRfnRatcuX/T7YbRtgn39rWBjKhXsNio0WXKrPKv3gfWE2I46w==\",\n        \"dependencies\": {\n          \"Microsoft.TestPlatform.ObjectModel\": \"18.3.0\",\n          \"Microsoft.Testing.Extensions.Telemetry\": \"2.2.1\",\n          \"Microsoft.Testing.Extensions.TrxReport.Abstractions\": \"2.2.1\",\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.Testing.Platform\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"9bbPuls/b6/vUFzxbSjJLZlJHyKBfOZE5kjIY+ITI2ASqlFPJhR83BdLydJeQOCLEZhEbrEcz5xtt1B69nwSVg==\"\n      },\n      \"Microsoft.Testing.Platform.MSBuild\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"CSJOcZHfKlTyPbS0CTJk6iEnU4gJC+eUA5z72UBnMDRdgVHYOmB8k9Y7jT233gZjnCOQiYFg3acQHRfu2H62nw==\",\n        \"dependencies\": {\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.TestPlatform.ObjectModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"4L6m2kS2pY5uJ9cpeRxzW22opr6ttScIRqsOpMDQpgENp/ZwxkkQCcmc6LRSURo2dFaaSW5KVflQZvroiJ7Wzg==\",\n        \"dependencies\": {\n          \"System.Reflection.Metadata\": \"8.0.0\"\n        }\n      },\n      \"Microsoft.TestPlatform.TestHost\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"gZsCHI+zOmZCcKZieIL4Jg14qKD2OGZOmX5DehuIk1EA9BN6Crm0+taXQNEuajOH1G9CCyBxw8VWR4t5tumcng==\",\n        \"dependencies\": {\n          \"Microsoft.TestPlatform.ObjectModel\": \"18.4.0\",\n          \"Newtonsoft.Json\": \"13.0.3\"\n        }\n      },\n      \"Microsoft.VisualStudio.SolutionPersistence\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.52\",\n        \"contentHash\": \"oNv2JtYXhpdJrX63nibx1JT3uCESOBQ1LAk7Dtz/sr0+laW0KRM6eKp4CZ3MHDR2siIkKsY8MmUkeP5DKkQQ5w==\"\n      },\n      \"Microsoft.Win32.SystemEvents\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"hqTM5628jSsQiv+HGpiq3WKBl2c8v1KZfby2J6Pr7pEPlK9waPdgEO6b8A/+/xn/yZ9ulv8HuqK71ONy2tg67A==\"\n      },\n      \"MSTest.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"1i9jgE/42KGGyZ4s0MdrYM/Uu/dRYhbRfYQifcO0AZ6vw4sBXRjoQGQRGNSm771AYgPAmoGl0u4sJc2lMET6HQ==\"\n      },\n      \"Newtonsoft.Json\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"13.0.3\",\n        \"contentHash\": \"HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==\"\n      },\n      \"NSubstitute\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"lJ47Cps5Qzr86N99lcwd+OUvQma7+fBgr8+Mn+aOC0WrlqMNkdivaYD9IvnZ5Mqo6Ky3LS7ZI+tUq1/s9ERd0Q==\",\n        \"dependencies\": {\n          \"Castle.Core\": \"5.1.1\"\n        }\n      },\n      \"NuGet.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"1mp7zmyAGmQfT93ELC4c+MYOrJ8Ff4ekFZRek4JSVLb/wOO/o0bsPfLmqujCsJ2Hlwc+fpq1TQEnjSEgWdt8ng==\",\n        \"dependencies\": {\n          \"NuGet.Frameworks\": \"7.3.1\"\n        }\n      },\n      \"NuGet.Configuration\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"tGxWBo47EQONOaqY+MbEWMrNjFthHgfavLM1HE0RcLyOXVCoQKBlZGV7v0hrS/rJrQKw6ZaBeHetX+ZJgS7Lxg==\",\n        \"dependencies\": {\n          \"NuGet.Common\": \"7.3.1\",\n          \"System.Security.Cryptography.ProtectedData\": \"8.0.0\"\n        }\n      },\n      \"NuGet.Frameworks\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"VUPAE5l/Ir4Gb3dv+v0jq0Qe4nfwxfrfiYN7QhwlGyWPXFKYXSSke1t1bV/ZYd6idtTtRDqJPM49Lt/U8NTocg==\"\n      },\n      \"NuGet.Packaging\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"5bT8uOrNBx4Srhbrd3HonYmyKhWJkvQyTWTYE2jvfPgYx2aCbPmq8MCYko7ce78hEN9mpq2xlrztVhguYPc+GQ==\",\n        \"dependencies\": {\n          \"Newtonsoft.Json\": \"13.0.3\",\n          \"NuGet.Configuration\": \"7.3.1\",\n          \"NuGet.Versioning\": \"7.3.1\",\n          \"System.Security.Cryptography.Pkcs\": \"8.0.1\"\n        }\n      },\n      \"NuGet.Protocol\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"vYd5vtCJ/tpMQjbAs6rrftNgeh5Ip1w7tnEsDZCpGObKgUgOxHQBekCul3TnzmbNgobvJEkDJNaec5/ZBv66Hg==\",\n        \"dependencies\": {\n          \"NuGet.Packaging\": \"7.3.1\"\n        }\n      },\n      \"NuGet.Versioning\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"TJrQWSmD1vakfav7qIhDXgDFfaZFfMJ+v6P8tcND9ZqXajD5B/ZzaoGYNzL4D3eDue6vAOUvwzu42G+19JNVUA==\"\n      },\n      \"StyleCop.Analyzers.Unstable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.2.0.556\",\n        \"contentHash\": \"zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==\"\n      },\n      \"System.Collections.Immutable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"AurL6Y5BA1WotzlEvVaIDpqzpIPvYnnldxru8oXJU2yFxFUy3+pNXjXd1ymO+RA0rq0+590Q8gaz2l3Sr7fmqg==\"\n      },\n      \"System.Composition\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"3Djj70fFTraOarSKmRnmRy/zm4YurICm+kiCtI0dYRqGJnLX6nJ+G3WYuFJ173cAPax/gh96REcbNiVqcrypFQ==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\",\n          \"System.Composition.Convention\": \"9.0.0\",\n          \"System.Composition.Hosting\": \"9.0.0\",\n          \"System.Composition.Runtime\": \"9.0.0\",\n          \"System.Composition.TypedParts\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.AttributedModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"iri00l/zIX9g4lHMY+Nz0qV1n40+jFYAmgsaiNn16xvt2RDwlqByNG4wgblagnDYxm3YSQQ0jLlC/7Xlk9CzyA==\"\n      },\n      \"System.Composition.Convention\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"+vuqVP6xpi582XIjJi6OCsIxuoTZfR0M7WWufk3uGDeCl3wGW6KnpylUJ3iiXdPByPE0vR5TjJgR6hDLez4FQg==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.Hosting\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"OFqSeFeJYr7kHxDfaViGM1ymk7d4JxK//VSoNF9Ux0gpqkLsauDZpu89kTHHNdCWfSljbFcvAafGyBoY094btQ==\",\n        \"dependencies\": {\n          \"System.Composition.Runtime\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.Runtime\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"w1HOlQY1zsOWYussjFGZCEYF2UZXgvoYnS94NIu2CBnAGMbXFAX8PY8c92KwUItPmowal68jnVLBCzdrWLeEKA==\"\n      },\n      \"System.Composition.TypedParts\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"aRZlojCCGEHDKqh43jaDgaVpYETsgd7Nx4g1zwLKMtv4iTo0627715ajEFNpEEBTgLmvZuv8K0EVxc3sM4NWJA==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\",\n          \"System.Composition.Hosting\": \"9.0.0\",\n          \"System.Composition.Runtime\": \"9.0.0\"\n        }\n      },\n      \"System.Configuration.ConfigurationManager\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"7T+m0kDSlIPTHIkPMIu6m6tV6qsMqJpvQWW2jIc2qi7sn40qxFo0q+7mEQAhMPXZHMKnWrnv47ntGlM/ejvw3g==\",\n        \"dependencies\": {\n          \"System.Security.Cryptography.ProtectedData\": \"6.0.0\",\n          \"System.Security.Permissions\": \"6.0.0\"\n        }\n      },\n      \"System.Diagnostics.DiagnosticSource\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.0.0\",\n        \"contentHash\": \"tCQTzPsGZh/A9LhhA6zrqCRV4hOHsK90/G7q3Khxmn6tnB1PuNU0cRaKANP2AWcF9bn0zsuOoZOSrHuJk6oNBA==\"\n      },\n      \"System.Diagnostics.EventLog\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"lcyUiXTsETK2ALsZrX+nWuHSIQeazhqPphLfaRxzdGaG93+0kELqpgEHtwWOlQe7+jSFnKwaCAgL4kjeZCQJnw==\"\n      },\n      \"System.Drawing.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"NfuoKUiP2nUWwKZN6twGqXioIe1zVD0RIj2t976A+czLHr2nY454RwwXs6JU9Htc6mwqL6Dn/nEL3dpVf2jOhg==\",\n        \"dependencies\": {\n          \"Microsoft.Win32.SystemEvents\": \"6.0.0\"\n        }\n      },\n      \"System.Reflection.Metadata\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"ptvgrFh7PvWI8bcVqG5rsA/weWM09EnthFHR5SCnS6IN+P4mj6rE1lBDC4U8HL9/57htKAqy4KQ3bBj84cfYyQ==\",\n        \"dependencies\": {\n          \"System.Collections.Immutable\": \"8.0.0\"\n        }\n      },\n      \"System.Security.AccessControl\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"AUADIc0LIEQe7MzC+I0cl0rAT8RrTAKFHl53yHjEUzNVIaUlhFY11vc2ebiVJzVBuOzun6F7FBA+8KAbGTTedQ==\"\n      },\n      \"System.Security.Cryptography.Pkcs\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.1\",\n        \"contentHash\": \"CoCRHFym33aUSf/NtWSVSZa99dkd0Hm7OCZUxORBjRB16LNhIEOf8THPqzIYlvKM0nNDAPTRBa1FxEECrgaxxA==\"\n      },\n      \"System.Security.Cryptography.ProtectedData\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"+TUFINV2q2ifyXauQXRwy4CiBhqvDEDZeVJU7qfxya4aRYOKzVBpN+4acx25VcPB9ywUN6C0n8drWl110PhZEg==\"\n      },\n      \"System.Security.Permissions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"T/uuc7AklkDoxmcJ7LGkyX1CcSviZuLCa4jg3PekfJ7SU0niF0IVTXwUiNVP9DSpzou2PpxJ+eNY2IfDM90ZCg==\",\n        \"dependencies\": {\n          \"System.Security.AccessControl\": \"6.0.0\",\n          \"System.Windows.Extensions\": \"6.0.0\"\n        }\n      },\n      \"System.Windows.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"IXoJOXIqc39AIe+CIR7koBtRGMiCt/LPM3lI+PELtDIy9XdyeSrwXFdWV9dzJ2Awl0paLWUaknLxFQ5HpHZUog==\",\n        \"dependencies\": {\n          \"System.Drawing.Common\": \"6.0.0\"\n        }\n      },\n      \"sonaranalyzer.cfg\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer.Lightup\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.core\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Google.Protobuf\": \"[3.6.1, )\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.CFG\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer.lightup\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.testframework\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Combinatorial.MSTest\": \"[2.0.0, )\",\n          \"FluentAssertions\": \"[7.2.1, )\",\n          \"FluentAssertions.Analyzers\": \"[0.34.1, )\",\n          \"MSTest.TestAdapter\": \"[4.2.1, )\",\n          \"MSTest.TestFramework\": \"[4.2.1, )\",\n          \"Microsoft.Build.Locator\": \"[1.11.2, )\",\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[5.3.0, )\",\n          \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": \"[5.3.0, )\",\n          \"Microsoft.CodeAnalysis.Workspaces.MSBuild\": \"[5.3.0, )\",\n          \"Microsoft.NET.Test.Sdk\": \"[18.4.0, )\",\n          \"NSubstitute\": \"[5.3.0, )\",\n          \"NuGet.Protocol\": \"[7.3.1, )\",\n          \"SonarAnalyzer.Core\": \"[10.26.0, )\",\n          \"altcover\": \"[9.0.102, )\"\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Memory.Test/DotMemorySetupTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing JetBrains.dotMemoryUnit;\n\nnamespace SonarAnalyzer.Memory.Test;\n\n[TestClass]\npublic class DotMemorySetupTest\n{\n    [TestMethod]\n    [DotMemoryUnit(FailIfRunWithoutSupport = true)]\n    public void EnsureDotMemoryUTsAreExecutedWithTheRightRunner()\n    {\n        try\n        {\n            dotMemory.Check(x => { });\n        }\n        catch (DotMemoryUnitException ex) when (ex.Message.StartsWith(\"The test was run without the support for dotMemory Unit.\"))\n        {\n            if (TestEnvironment.IsAzureDevOpsContext)\n            {\n                Assert.Fail(\"Memory tests are not executed correctly. Make sure you run the memory tests with the appropiate test runner. See https://www.jetbrains.com/help/dotmemory-unit/Using_dotMemory_Unit_Standalone_Runner.html for details.\");\n            }\n            else\n            {\n                Assert.Inconclusive(\"The tests in this assembly need to be executed with the dotMemory tools. See 'RunMemoryTest.ps1' for details.\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Memory.Test/MSTestSettings.cs",
    "content": "﻿using JetBrains.dotMemoryUnit;\n\n[assembly: DoNotParallelize]\n[assembly: DotMemoryUnit(FailIfRunWithoutSupport = false)]\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Memory.Test/Registrations/SonarSyntaxNodeReportingContextMemoryTest.cs",
    "content": "﻿/*\n* SonarAnalyzer for .NET\n* Copyright (C) SonarSource Sàrl\n* mailto:info AT sonarsource DOT com\n* This program is free software; you can redistribute it and/or\n* modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA.\n*\n* This program is distributed in the hope that it will be useful,\n* but WITHOUT ANY WARRANTY; without even the implied warranty of\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n* See the Sonar Source-Available License for more details.\n*\n* You should have received a copy of the Sonar Source-Available License\n* along with this program; if not, see https://sonarsource.com/license/ssal/\n*/\n\nusing System.Collections.Concurrent;\nusing System.Runtime.CompilerServices;\nusing System.Text;\nusing JetBrains.dotMemoryUnit;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing SonarAnalyzer.Core.AnalysisContext;\n\nnamespace SonarAnalyzer.Memory.Test.Registrations;\n\n[TestClass]\npublic class SonarSyntaxNodeReportingContextMemoryTest\n{\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    public void SonarSyntaxNodeReportingContextAllocationsPerNodeKind()\n    {\n        const int namespaceCount = 20_000;\n        var compilation = CreateCompilationWithNamespaceDeclarations(namespaceCount);\n        var keepAlive = new ConcurrentStack<SonarSyntaxNodeReportingContext>();\n        var withAnalyzer = compilation.WithAnalyzers([new TestAnalyzerCS((c, g) =>\n            c.RegisterNodeAction(\n                g,\n                context =>\n                {\n                    keepAlive.Push(context);\n                    context.ReportIssue(TestAnalyzer.Rule, context.Node);\n                },\n                SyntaxKind.NamespaceDeclaration))]);\n        var result = withAnalyzer.GetAllDiagnosticsAsync().GetAwaiter().GetResult();\n        keepAlive.Should().HaveCount(namespaceCount);\n        dotMemory.Check(x =>\n            {\n                PrintObjectStatistics(x.GroupByType());\n                var contextCount = x.GetObjects(where => where.Type.Is<SonarSyntaxNodeReportingContext>()).ObjectsCount;\n                contextCount.Should().Be(0); // SonarSyntaxNodeReportingContext is a struct and should never be boxed\n            });\n        result.Should().HaveCount(namespaceCount);\n        GC.KeepAlive(keepAlive);\n    }\n\n    [TestMethod]\n    [DotMemoryUnit(CollectAllocations = true)]\n    public void SonarSyntaxNodeReportingContextOverallAllocations()\n    {\n        const int namespaceCount = 20_000;\n        var warmupCompilation = CSharpCompilation.Create(assemblyName: null, [CreateNamespaceDeclarations(1)], options: new(OutputKind.DynamicallyLinkedLibrary));\n        ImmutableArray<DiagnosticAnalyzer> analyzers = [new TestAnalyzerCS((c, g) =>\n            c.RegisterNodeAction(\n                g,\n                context =>\n                {\n                    new MarkerObject().Reset(); // Make sure we don't get optimized away by inlining\n                    context.ReportIssue(TestAnalyzer.Rule, context.Node);\n                },\n                SyntaxKind.NamespaceDeclaration))];\n        var withAnalyzer = warmupCompilation.WithAnalyzers(analyzers);\n        // Warmup\n        withAnalyzer.GetAllDiagnosticsAsync().GetAwaiter().GetResult();\n\n        var compilation = warmupCompilation.RemoveAllSyntaxTrees().AddSyntaxTrees(CreateNamespaceDeclarations(namespaceCount));\n        withAnalyzer = compilation.WithAnalyzers(analyzers);\n        var checkpoint = dotMemory.Check();\n        var result = withAnalyzer.GetAllDiagnosticsAsync().GetAwaiter().GetResult();\n        dotMemory.Check(x =>\n            {\n                var traffic = x.GetTrafficFrom(checkpoint).GroupByType();\n                PrintObjectStatistics(traffic);\n                var allocated = new { AllocatedMemoryInfo = new { ObjectsCount = namespaceCount }, CollectedMemoryInfo = new { ObjectsCount = namespaceCount } };\n                var allocatedAndCollected = new { AllocatedMemoryInfo = new { ObjectsCount = namespaceCount }, CollectedMemoryInfo = new { ObjectsCount = 0 } };\n                traffic.Should().ContainEquivalentOf(new { Type = typeof(MarkerObject) }).Which.Should().BeEquivalentTo(allocated);\n                traffic.Should().ContainEquivalentOf(new { Type = typeof(SonarSyntaxNodeReportingContext) }).Which.Should().BeEquivalentTo(\n                    allocated,\n                    because: \"ReportIssue captures and boxes SonarSyntaxNodeReportingContext. This is not the hotpath, though and therefore okay.\");\n                traffic.Should().ContainEquivalentOf(new { Type = typeof(SyntaxNodeAnalysisContext) }).Which.Should().BeEquivalentTo(allocated, because: \"Boxed by ReportIssue\");\n                traffic.Should().ContainEquivalentOf(new { Type = typeof(NamespaceDeclarationSyntax) }).Which.Should().BeEquivalentTo(allocatedAndCollected);\n                traffic.Should().ContainEquivalentOf(new { Type = typeof(ReportingContext) }).Which.Should().BeEquivalentTo(allocated);\n                var stringAllocations = traffic.Should().ContainEquivalentOf(new { Type = typeof(string) }).Subject;\n                stringAllocations.AllocatedMemoryInfo.ObjectsCount.Should().BeLessThan(100);\n                stringAllocations.AllocatedMemoryInfo.SizeInBytes.Should().BeLessThan(5_000);\n            });\n        result.Should().HaveCount(namespaceCount);\n        GC.KeepAlive(result);\n        GC.KeepAlive(withAnalyzer);\n    }\n\n    [TestMethod]\n    [DotMemoryUnit(CollectAllocations = true)]\n    public void SonarSyntaxNodeReportingContextOverallAllocationsWithoutReporting()\n    {\n        const int namespaceCount = 20_000;\n        var compilation = CSharpCompilation.Create(assemblyName: null, [CreateNamespaceDeclarations(namespaceCount)], options: new(OutputKind.DynamicallyLinkedLibrary));\n        var withAnalyzer = compilation.WithAnalyzers([new TestAnalyzerCS((c, g) => c.RegisterNodeAction(g, _ => new MarkerObject().Reset(), SyntaxKind.NamespaceDeclaration))]);\n        var checkpoint = dotMemory.Check();\n        var result = withAnalyzer.GetAllDiagnosticsAsync().GetAwaiter().GetResult();\n        dotMemory.Check(x =>\n            {\n                var traffic = x.GetTrafficFrom(checkpoint).GroupByType();\n                PrintObjectStatistics(traffic);\n                traffic.Should().ContainEquivalentOf(new { Type = typeof(MarkerObject) }).Which.Should().BeEquivalentTo(new { AllocatedMemoryInfo = new { ObjectsCount = namespaceCount } });\n                traffic.Should().NotContainEquivalentOf(new { Type = typeof(SonarSyntaxNodeReportingContext) }, because: \"The action invocation is allocation free\");\n                traffic.Should().NotContainEquivalentOf(new { Type = typeof(SyntaxNodeAnalysisContext) }, because: \"The action invocation is allocation free\");\n                traffic.Where(x => x.Type.Namespace.StartsWith(nameof(SonarAnalyzer)) && x.Type != typeof(MarkerObject)).Should().NotBeEmpty().And.AllSatisfy(x =>\n                    x.AllocatedMemoryInfo.ObjectsCount.Should().BeLessThan(50));\n                var stringAllocations = traffic.Should().ContainEquivalentOf(new { Type = typeof(string) }).Subject;\n                stringAllocations.AllocatedMemoryInfo.ObjectsCount.Should().BeLessThan(1_000);\n                stringAllocations.AllocatedMemoryInfo.SizeInBytes.Should().BeLessThan(60_000);\n            });\n        result.Should().HaveCount(0);\n        GC.KeepAlive(result);\n        GC.KeepAlive(withAnalyzer);\n    }\n\n    private void PrintObjectStatistics(IEnumerable<TypeTrafficInfo> typeTrafficInfos) =>\n        TestContext.WriteLine(typeTrafficInfos.OrderByDescending(x => x.AllocatedMemoryInfo.SizeInBytes).Aggregate(\n            new StringBuilder(),\n            (builder, x) => builder.AppendLine(x.ToString()),\n            x => x.ToString()));\n\n    private void PrintObjectStatistics(IEnumerable<TypeMemoryInfo> typeMemoryInfos) =>\n        TestContext.WriteLine(typeMemoryInfos.OrderByDescending(x => x.SizeInBytes).Aggregate(\n            new StringBuilder(),\n            (builder, x) => builder.AppendLine(x.ToString()),\n            x => x.ToString()));\n\n    private static CSharpCompilation CreateCompilationWithNamespaceDeclarations(int namespaceCount) =>\n        CSharpCompilation.Create(assemblyName: null, [CreateNamespaceDeclarations(namespaceCount)], options: new(OutputKind.DynamicallyLinkedLibrary));\n\n    private static SyntaxTree CreateNamespaceDeclarations(int namespaceCount) =>\n        CSharpSyntaxTree.ParseText(Enumerable.Range(0, namespaceCount).Aggregate(\n            new StringBuilder(),\n            (x, i) => x.AppendLine($$\"\"\"namespace A{{i}} { }\"\"\"),\n            x => x.ToString()));\n}\n\npublic class MarkerObject\n{\n    public int Value { get; set; } = 1;\n\n    [MethodImpl(MethodImplOptions.NoInlining)]\n    public void Reset() => Value = 0;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Memory.Test/RunMemoryTest.ps1",
    "content": "$dotNet = (get-command dotnet.exe).Path\n& $dotNet build -c Release\n\n$dotMemoryUnit = dir $env:USERPROFILE\\.nuget\\packages\\jetbrains.dotmemoryunit\\*\\lib\\tools\\dotMemoryUnit.exe | sort -Property {$_.VersionInfo.FileVersion} | select -First 1\n\ntry {\n    Push-Location $PSScriptRoot\n    & $dotMemoryUnit \"$dotNet\" --propagate-exit-code --no-updates -- test \"bin/Release/net9.0/SonarAnalyzer.Memory.Test.dll\" --logger \"trx;logfilename=net9.trx\" @args\n    & $dotMemoryUnit \"$dotNet\" --propagate-exit-code --no-updates -- test \"bin/Release/net48/SonarAnalyzer.Memory.Test.dll\" --logger \"trx;logfilename=net48.trx\" @args\n} finally {\n    Pop-Location\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Memory.Test/SonarAnalyzer.Memory.Test.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <!-- JetBrains.dotMemoryUnit hangs on net10.0, so Memory.Test uses net9.0 instead. -->\n    <TargetFrameworks>net48;net9.0</TargetFrameworks>\n    <IsPackable>false</IsPackable>\n    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>\n    <GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"JetBrains.dotMemoryUnit\" Version=\"3.2.20220510\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\SonarAnalyzer.TestFramework\\SonarAnalyzer.TestFramework.csproj\" />\n    <ProjectReference Include=\"..\\..\\src\\SonarAnalyzer.CFG\\SonarAnalyzer.CFG.csproj\" />\n    <ProjectReference Include=\"..\\..\\src\\SonarAnalyzer.Core\\SonarAnalyzer.Core.csproj\">\n      <Aliases>global,common</Aliases>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\src\\SonarAnalyzer.CSharp\\SonarAnalyzer.CSharp.csproj\">\n      <Aliases>global,csharp</Aliases>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\src\\SonarAnalyzer.CSharp.Core\\SonarAnalyzer.CSharp.Core.csproj\" />\n    <ProjectReference Include=\"..\\..\\src\\SonarAnalyzer.VisualBasic\\SonarAnalyzer.VisualBasic.csproj\">\n      <Aliases>global,vbnet</Aliases>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\src\\SonarAnalyzer.VisualBasic.Core\\SonarAnalyzer.VisualBasic.Core.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Using Include=\"FluentAssertions\" />\n\t  <Using Include=\"Microsoft.CodeAnalysis\" />\n\t  <Using Include=\"Microsoft.CodeAnalysis.Diagnostics\" />\n    <Using Include=\"Microsoft.VisualStudio.TestTools.UnitTesting\" />\n    <Using Include=\"SonarAnalyzer.Core.Analyzers\" />\n    <Using Include=\"SonarAnalyzer.Core.Common\" />\n    <Using Include=\"SonarAnalyzer.Core.Extensions\" />\n    <Using Include=\"SonarAnalyzer.Core.Semantics\" />\n    <Using Include=\"SonarAnalyzer.TestFramework.Analyzers\" />\n    <Using Include=\"SonarAnalyzer.TestFramework.Build\" />\n    <Using Include=\"SonarAnalyzer.TestFramework.Common\" />\n    <Using Include=\"SonarAnalyzer.TestFramework.Extensions\" />\n    <Using Include=\"SonarAnalyzer.TestFramework.MetadataReferences\" />\n    <Using Include=\"SonarAnalyzer.TestFramework.Verification\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Memory.Test/packages.lock.json",
    "content": "{\n  \"version\": 1,\n  \"dependencies\": {\n    \".NETFramework,Version=v4.8\": {\n      \"altcover\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[9.0.102, )\",\n        \"resolved\": \"9.0.102\",\n        \"contentHash\": \"q3Rf5t0M9kXlcO5qhsaAe6NrFSNd5enrhKmF/Ezgmomqw34PbUTbRSYjSDNhS3YGDyUrPTkyPn14EfLDJWztcA==\"\n      },\n      \"Combinatorial.MSTest\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[2.0.0, )\",\n        \"resolved\": \"2.0.0\",\n        \"contentHash\": \"9tB2TMPkuEkYYUq64WREHMMyPt9NfKAyuitpK9yw3zbVe6v/vYkClZTR02+yKFUG+g8XHi5LMTt8jHz4RufGqw==\",\n        \"dependencies\": {\n          \"MSTest.TestFramework\": \"4.0.1\"\n        }\n      },\n      \"JetBrains.dotMemoryUnit\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[3.2.20220510, )\",\n        \"resolved\": \"3.2.20220510\",\n        \"contentHash\": \"jhzqT6zXFN0S6zxNXKmiEoNIqAEtlbsteQEhDA8TkTFfQpE/noktqU1HXfJ4P2PPczW48aFW9h69nHY8pSbnXw==\"\n      },\n      \"Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[3.3.1, )\",\n        \"resolved\": \"3.3.1\",\n        \"contentHash\": \"eT+kgNCDdTRbQ5WF6BGx1HI3D5jYfHteza/koefhWC2vNZGxObA74XxwWfg40dy3uUv7dn3OGKLK5GUPLroVog==\"\n      },\n      \"Microsoft.NET.Test.Sdk\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[18.4.0, )\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"w49iZdL4HL6V25l41NVQLXWQ+e71GvSkKVteMrOL02gP/PUkcnO/1yEb2s9FntU4wGmJWfKnyrRAhcMHd9ZZNA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeCoverage\": \"18.4.0\"\n        }\n      },\n      \"Microsoft.NETFramework.ReferenceAssemblies\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.0.3, )\",\n        \"resolved\": \"1.0.3\",\n        \"contentHash\": \"vUc9Npcs14QsyOD01tnv/m8sQUnGTGOw1BCmKcv77LBJY7OxhJ+zJF7UD/sCL3lYNFuqmQEVlkfS4Quif6FyYg==\",\n        \"dependencies\": {\n          \"Microsoft.NETFramework.ReferenceAssemblies.net48\": \"1.0.3\"\n        }\n      },\n      \"MSTest.TestAdapter\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[4.2.1, )\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"lZRgNzaQnffK4XLjM/og4Eoqp/3IkpcyJQQcyKXkPdkzCT3+ghpwHa9zG1xYhQDbUFoc54M+/waLwh31K9stDQ==\",\n        \"dependencies\": {\n          \"MSTest.TestFramework\": \"4.2.1\",\n          \"Microsoft.Testing.Extensions.VSTestBridge\": \"2.2.1\",\n          \"Microsoft.Testing.Platform.MSBuild\": \"2.2.1\",\n          \"System.Threading.Tasks.Extensions\": \"4.5.4\"\n        }\n      },\n      \"MSTest.TestFramework\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[4.2.1, )\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"I4/RbS2TpGZ56CE98+jPbrGlcerYtw2LvPVKzQGvyQQcJDekPy2Kd+fnThXYn+geJ1sW+vA9B7++rFNxvKcWxA==\",\n        \"dependencies\": {\n          \"MSTest.Analyzers\": \"4.2.1\"\n        }\n      },\n      \"SonarAnalyzer.CSharp.Styling\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[10.21.0.135717, )\",\n        \"resolved\": \"10.21.0.135717\",\n        \"contentHash\": \"hl264jF539oB7m2jED5QGM345eFSiDAdoJc8TH0HM6L7ZeqT5TDqZDQeZ8IDP02dVIpH/Fhhn+HsGfEcj8ohyQ==\"\n      },\n      \"StyleCop.Analyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.2.0-beta.556, )\",\n        \"resolved\": \"1.2.0-beta.556\",\n        \"contentHash\": \"llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==\",\n        \"dependencies\": {\n          \"StyleCop.Analyzers.Unstable\": \"1.2.0.556\"\n        }\n      },\n      \"Castle.Core\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.1.1\",\n        \"contentHash\": \"rpYtIczkzGpf+EkZgDr9CClTdemhsrwA/W5hMoPjLkRFnXzH44zDLoovXeKtmxb1ykXK9aJVODSpiJml8CTw2g==\"\n      },\n      \"FluentAssertions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.2.1\",\n        \"contentHash\": \"MilqBF2lZrT0V1azIA6DG6I/snS0rG3A8ohT2Jjkhq6zOFk76nqx4BPnEnzrX6jFVa6xvkDU++z3PebCGZyJ4g==\",\n        \"dependencies\": {\n          \"System.Threading.Tasks.Extensions\": \"4.5.4\"\n        }\n      },\n      \"FluentAssertions.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"0.34.1\",\n        \"contentHash\": \"2BnAAB8CCPdRA9P1+lAvBZOleR2BTmsxGMtGt+LnABJUARGqoGMWEFxG3znZYqHVIrMP0Za/kyw6atyt8x2mzA==\"\n      },\n      \"Google.Protobuf\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"3.6.1\",\n        \"contentHash\": \"741fGeDQjixBJaU2j+0CbrmZXsNJkTn/hWbOh4fLVXndHsCclJmWznCPWrJmPoZKvajBvAz3e8ECJOUvRtwjNQ==\"\n      },\n      \"Humanizer.Core\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.14.1\",\n        \"contentHash\": \"lQKvtaTDOXnoVJ20ibTuSIOf2i0uO0MPbDhd1jm238I+U/2ZnRENj0cktKZhtchBMtCUSRQ5v4xBCUbKNmyVMw==\"\n      },\n      \"Microsoft.ApplicationInsights\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.23.0\",\n        \"contentHash\": \"nWArUZTdU7iqZLycLKWe0TDms48KKGE6pONH2terYNa8REXiqixrMOkf1sk5DHGMaUTqONU2YkS4SAXBhLStgw==\",\n        \"dependencies\": {\n          \"System.Diagnostics.DiagnosticSource\": \"5.0.0\"\n        }\n      },\n      \"Microsoft.Bcl.AsyncInterfaces\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"owmu2Cr3IQ8yQiBleBHlGk8dSQ12oaF2e7TpzwJKEl4m84kkZJjEY1n33L67Y3zM5jPOjmmbdHjbfiL0RqcMRQ==\",\n        \"dependencies\": {\n          \"System.Threading.Tasks.Extensions\": \"4.5.4\"\n        }\n      },\n      \"Microsoft.Build.Framework\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.0.2\",\n        \"contentHash\": \"sOSb+0J4G/jCBW/YqmRuL0eOMXgfw1KQLdC9TkbvfA5xs7uNm+PBQXJCOzSJGXtZcZrtXozcwxPmUiRUbmd7FA==\",\n        \"dependencies\": {\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Diagnostics.DiagnosticSource\": \"9.0.0\",\n          \"System.Memory\": \"4.6.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\",\n          \"System.Text.Json\": \"9.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.6.0\"\n        }\n      },\n      \"Microsoft.Build.Locator\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.11.2\",\n        \"contentHash\": \"tY+/S54G29CGsbL3slVu4vqtpciwVnb3fKOmrhgzEQmu/VziFaWmD/E1e/2KH7cDucuycGSkWsSXndBs5Uawow==\"\n      },\n      \"Microsoft.CodeAnalysis.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0-2.25625.1\",\n        \"contentHash\": \"4Yhh2fnu3G+J0J1lDc8WZVgMjgbynSeTfkl5IFJMFrmiIO0sc7Tjx+f3sFVV8Sd35PrIUWfof0RWc3lAMl7Azg==\"\n      },\n      \"Microsoft.CodeAnalysis.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"uC0qk3jzTQY7i90ehfnCqaOZpBUGJyPMiHJ3c0jOb8yaPBjWzIhVdNxPbeVzI74DB0C+YgBKPLqUkgFZzua5Mg==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Memory\": \"4.6.0\",\n          \"System.Numerics.Vectors\": \"4.6.0\",\n          \"System.Reflection.Metadata\": \"9.0.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\",\n          \"System.Text.Encoding.CodePages\": \"8.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.6.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"SQFNGQF4f7UfDXKxMzzGNMr3fjrPDIjLfmRvvVgDCw+dyvEHDaRfHuKA5q0Pr0/JW0Gcw89TxrxrS/MjwBvluQ==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Memory\": \"4.6.0\",\n          \"System.Numerics.Vectors\": \"4.6.0\",\n          \"System.Reflection.Metadata\": \"9.0.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\",\n          \"System.Text.Encoding.CodePages\": \"8.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.6.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp.Workspaces\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"mRwxchBs3ewXK4dqK4R/eVCx99VIq1k/lhwArlu+fJuV0uzmbkTTRw4jR9gN9sOcAQfX0uV9KQlmCk1yC0JNog==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.Bcl.AsyncInterfaces\": \"9.0.0\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.CSharp\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Composition\": \"9.0.0\",\n          \"System.IO.Pipelines\": \"9.0.0\",\n          \"System.Memory\": \"4.6.0\",\n          \"System.Numerics.Vectors\": \"4.6.0\",\n          \"System.Reflection.Metadata\": \"9.0.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\",\n          \"System.Text.Encoding.CodePages\": \"8.0.0\",\n          \"System.Threading.Channels\": \"8.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.6.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.VisualBasic\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"AJxddsIOmfimuihaLuSAm4c/zskHoL1ypAjIpSOZqHlNm2iuw0twsB8nbKczJyfClqD7+iYjdIeE5EV8WAyxRA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Memory\": \"4.6.0\",\n          \"System.Numerics.Vectors\": \"4.6.0\",\n          \"System.Reflection.Metadata\": \"9.0.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\",\n          \"System.Text.Encoding.CodePages\": \"8.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.6.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"pAGdr4qs7+v287DPiiM8px1cBXnhe8LxymkVGTnCwv2OEjCk5HO2zIoFvype4ivKJTRW3aTUUV8ab+915wbv+w==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.Bcl.AsyncInterfaces\": \"9.0.0\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.VisualBasic\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Composition\": \"9.0.0\",\n          \"System.IO.Pipelines\": \"9.0.0\",\n          \"System.Memory\": \"4.6.0\",\n          \"System.Numerics.Vectors\": \"4.6.0\",\n          \"System.Reflection.Metadata\": \"9.0.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\",\n          \"System.Text.Encoding.CodePages\": \"8.0.0\",\n          \"System.Threading.Channels\": \"8.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.6.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Workspaces.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"QSf1ge9A+XFZbGL+gIqXYBIKlm8QdQVLvHDPZiydG11W6mJY7XBMusrsgIEz6L8GYMzGJKTM78m9icliGMF7NA==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.Bcl.AsyncInterfaces\": \"9.0.0\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Composition\": \"9.0.0\",\n          \"System.IO.Pipelines\": \"9.0.0\",\n          \"System.Memory\": \"4.6.0\",\n          \"System.Numerics.Vectors\": \"4.6.0\",\n          \"System.Reflection.Metadata\": \"9.0.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\",\n          \"System.Text.Encoding.CodePages\": \"8.0.0\",\n          \"System.Threading.Channels\": \"8.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.6.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Workspaces.MSBuild\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"2Mg/ppo5dza1e4DJWX4+RIHMc3FgnYzuHTaLRZDupiK1LTi/PAZ1PBpF/iivHVNKQKwipHE984gy37MbM0RO9Q==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.Bcl.AsyncInterfaces\": \"9.0.0\",\n          \"Microsoft.Build.Framework\": \"18.0.2\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"Microsoft.Extensions.DependencyInjection\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Options\": \"9.0.0\",\n          \"Microsoft.Extensions.Primitives\": \"9.0.0\",\n          \"Microsoft.IO.Redist\": \"6.1.0\",\n          \"Microsoft.VisualStudio.SolutionPersistence\": \"1.0.52\",\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Composition\": \"9.0.0\",\n          \"System.Diagnostics.DiagnosticSource\": \"9.0.0\",\n          \"System.IO.Pipelines\": \"9.0.0\",\n          \"System.Memory\": \"4.6.0\",\n          \"System.Numerics.Vectors\": \"4.6.0\",\n          \"System.Reflection.Metadata\": \"9.0.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\",\n          \"System.Text.Encoding.CodePages\": \"8.0.0\",\n          \"System.Text.Encodings.Web\": \"9.0.0\",\n          \"System.Text.Json\": \"9.0.0\",\n          \"System.Threading.Channels\": \"8.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.6.0\",\n          \"System.ValueTuple\": \"4.5.0\"\n        }\n      },\n      \"Microsoft.CodeCoverage\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"9O0BtCfzCWrkAmK187ugKdq72HHOXoOUjuWFDVc2LsZZ0pOnA9bTt+Sg9q4cF+MoAaUU+MuWtvBuFsnduviJow==\"\n      },\n      \"Microsoft.Composition\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.27\",\n        \"contentHash\": \"pwu80Ohe7SBzZ6i69LVdzowp6V+LaVRzd5F7A6QlD42vQkX0oT7KXKWWPlM/S00w1gnMQMRnEdbtOV12z6rXdQ==\"\n      },\n      \"Microsoft.Extensions.DependencyInjection\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"MCPrg7v3QgNMr0vX4vzRXvkNGgLg8vKWX0nKCWUxu2uPyMsaRgiRc1tHBnbTcfJMhMKj2slE/j2M9oGkd25DNw==\",\n        \"dependencies\": {\n          \"Microsoft.Bcl.AsyncInterfaces\": \"9.0.0\",\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.5.4\"\n        }\n      },\n      \"Microsoft.Extensions.DependencyInjection.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"+6f2qv2a3dLwd5w6JanPIPs47CxRbnk+ZocMJUhv9NxP88VlOcJYZs9jY+MYSjxvady08bUZn6qgiNh7DadGgg==\",\n        \"dependencies\": {\n          \"Microsoft.Bcl.AsyncInterfaces\": \"9.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.5.4\"\n        }\n      },\n      \"Microsoft.Extensions.Logging\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"crjWyORoug0kK7RSNJBTeSE6VX8IQgLf3nUpTB9m62bPXp/tzbnOsnbe8TXEG0AASNaKZddnpHKw7fET8E++Pg==\",\n        \"dependencies\": {\n          \"Microsoft.Bcl.AsyncInterfaces\": \"9.0.0\",\n          \"Microsoft.Extensions.DependencyInjection\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Options\": \"9.0.0\",\n          \"System.Diagnostics.DiagnosticSource\": \"9.0.0\",\n          \"System.ValueTuple\": \"4.5.0\"\n        }\n      },\n      \"Microsoft.Extensions.Logging.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"g0UfujELzlLbHoVG8kPKVBaW470Ewi+jnptGS9KUi6jcb+k2StujtK3m26DFSGGwQ/+bVgZfsWqNzlP6YOejvw==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\",\n          \"System.Buffers\": \"4.5.1\",\n          \"System.Diagnostics.DiagnosticSource\": \"9.0.0\",\n          \"System.Memory\": \"4.5.5\"\n        }\n      },\n      \"Microsoft.Extensions.Options\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"y2146b3jrPI3Q0lokKXdKLpmXqakYbDIPDV6r3M8SqvSf45WwOTzkyfDpxnZXJsJQEpAsAqjUq5Pu8RCJMjubg==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Primitives\": \"9.0.0\",\n          \"System.ValueTuple\": \"4.5.0\"\n        }\n      },\n      \"Microsoft.Extensions.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"N3qEBzmLMYiASUlKxxFIISP4AiwuPTHF5uCh+2CWSwwzAJiIYx0kBJsS30cp1nvhSySFAVi30jecD307jV+8Kg==\",\n        \"dependencies\": {\n          \"System.Memory\": \"4.5.5\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.0.0\"\n        }\n      },\n      \"Microsoft.IO.Redist\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.1.0\",\n        \"contentHash\": \"pTYqyiu9nLeCXROGjKnnYTH9v3yQNgXj3t4v7fOWwh9dgSBIwZbiSi8V76hryG2CgTjUFU+xu8BXPQ122CwAJg==\",\n        \"dependencies\": {\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Memory\": \"4.6.0\"\n        }\n      },\n      \"Microsoft.NETFramework.ReferenceAssemblies.net48\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.3\",\n        \"contentHash\": \"zMk4D+9zyiEWByyQ7oPImPN/Jhpj166Ky0Nlla4eXlNL8hI/BtSJsgR8Inldd4NNpIAH3oh8yym0W2DrhXdSLQ==\"\n      },\n      \"Microsoft.Testing.Extensions.Telemetry\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"7zB8BjffOyvqfHF26rFVPuK0w1fCf5+j1tLuhHIr76CqxXkGb+fMJtq6YNOV+m6qPytExHMXxluk3RgJ+dSIqw==\",\n        \"dependencies\": {\n          \"Microsoft.ApplicationInsights\": \"2.23.0\",\n          \"Microsoft.Testing.Platform\": \"2.2.1\",\n          \"System.Diagnostics.DiagnosticSource\": \"6.0.0\"\n        }\n      },\n      \"Microsoft.Testing.Extensions.TrxReport.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"RD6D1Jx6cKDA5IHd1H2q8ylIuQG3PD+gdULI0JC8CvsRtaypFzTFpB5xDPuQi8o6kAkcM04cBhAiJPxZboNH2Q==\",\n        \"dependencies\": {\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.Testing.Extensions.VSTestBridge\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"D8AGlkNtlTQPe3zf4SLnHBMr13lerMe0RuHSoRfnRatcuX/T7YbRtgn39rWBjKhXsNio0WXKrPKv3gfWE2I46w==\",\n        \"dependencies\": {\n          \"Microsoft.TestPlatform.ObjectModel\": \"18.3.0\",\n          \"Microsoft.Testing.Extensions.Telemetry\": \"2.2.1\",\n          \"Microsoft.Testing.Extensions.TrxReport.Abstractions\": \"2.2.1\",\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.Testing.Platform\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"9bbPuls/b6/vUFzxbSjJLZlJHyKBfOZE5kjIY+ITI2ASqlFPJhR83BdLydJeQOCLEZhEbrEcz5xtt1B69nwSVg==\"\n      },\n      \"Microsoft.Testing.Platform.MSBuild\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"CSJOcZHfKlTyPbS0CTJk6iEnU4gJC+eUA5z72UBnMDRdgVHYOmB8k9Y7jT233gZjnCOQiYFg3acQHRfu2H62nw==\",\n        \"dependencies\": {\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.TestPlatform.ObjectModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.3.0\",\n        \"contentHash\": \"AEIEX2aWdPO9XbtR96eBaJxmXRD9vaI9uQ1T/JbPEKlTAZwYx0ZrMzKyULMdh/HH9Sg03kXCoN7LszQ90o6nPQ==\",\n        \"dependencies\": {\n          \"System.Reflection.Metadata\": \"8.0.0\"\n        }\n      },\n      \"Microsoft.VisualStudio.SolutionPersistence\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.52\",\n        \"contentHash\": \"oNv2JtYXhpdJrX63nibx1JT3uCESOBQ1LAk7Dtz/sr0+laW0KRM6eKp4CZ3MHDR2siIkKsY8MmUkeP5DKkQQ5w==\",\n        \"dependencies\": {\n          \"Microsoft.IO.Redist\": \"6.0.1\",\n          \"System.Memory\": \"4.5.5\",\n          \"System.Threading.Tasks.Extensions\": \"4.5.4\"\n        }\n      },\n      \"MSTest.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"1i9jgE/42KGGyZ4s0MdrYM/Uu/dRYhbRfYQifcO0AZ6vw4sBXRjoQGQRGNSm771AYgPAmoGl0u4sJc2lMET6HQ==\"\n      },\n      \"Newtonsoft.Json\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"13.0.3\",\n        \"contentHash\": \"HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==\"\n      },\n      \"NSubstitute\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"lJ47Cps5Qzr86N99lcwd+OUvQma7+fBgr8+Mn+aOC0WrlqMNkdivaYD9IvnZ5Mqo6Ky3LS7ZI+tUq1/s9ERd0Q==\",\n        \"dependencies\": {\n          \"Castle.Core\": \"5.1.1\",\n          \"System.Threading.Tasks.Extensions\": \"4.3.0\"\n        }\n      },\n      \"NuGet.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"1mp7zmyAGmQfT93ELC4c+MYOrJ8Ff4ekFZRek4JSVLb/wOO/o0bsPfLmqujCsJ2Hlwc+fpq1TQEnjSEgWdt8ng==\",\n        \"dependencies\": {\n          \"NuGet.Frameworks\": \"7.3.1\",\n          \"System.Collections.Immutable\": \"8.0.0\"\n        }\n      },\n      \"NuGet.Configuration\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"tGxWBo47EQONOaqY+MbEWMrNjFthHgfavLM1HE0RcLyOXVCoQKBlZGV7v0hrS/rJrQKw6ZaBeHetX+ZJgS7Lxg==\",\n        \"dependencies\": {\n          \"NuGet.Common\": \"7.3.1\"\n        }\n      },\n      \"NuGet.Frameworks\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"VUPAE5l/Ir4Gb3dv+v0jq0Qe4nfwxfrfiYN7QhwlGyWPXFKYXSSke1t1bV/ZYd6idtTtRDqJPM49Lt/U8NTocg==\"\n      },\n      \"NuGet.Packaging\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"5bT8uOrNBx4Srhbrd3HonYmyKhWJkvQyTWTYE2jvfPgYx2aCbPmq8MCYko7ce78hEN9mpq2xlrztVhguYPc+GQ==\",\n        \"dependencies\": {\n          \"Newtonsoft.Json\": \"13.0.3\",\n          \"NuGet.Configuration\": \"7.3.1\",\n          \"NuGet.Versioning\": \"7.3.1\",\n          \"System.Text.Json\": \"8.0.5\"\n        }\n      },\n      \"NuGet.Protocol\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"vYd5vtCJ/tpMQjbAs6rrftNgeh5Ip1w7tnEsDZCpGObKgUgOxHQBekCul3TnzmbNgobvJEkDJNaec5/ZBv66Hg==\",\n        \"dependencies\": {\n          \"NuGet.Packaging\": \"7.3.1\",\n          \"System.Text.Json\": \"8.0.5\"\n        }\n      },\n      \"NuGet.Versioning\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"TJrQWSmD1vakfav7qIhDXgDFfaZFfMJ+v6P8tcND9ZqXajD5B/ZzaoGYNzL4D3eDue6vAOUvwzu42G+19JNVUA==\"\n      },\n      \"StyleCop.Analyzers.Unstable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.2.0.556\",\n        \"contentHash\": \"zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==\"\n      },\n      \"System.Buffers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.6.0\",\n        \"contentHash\": \"lN6tZi7Q46zFzAbRYXTIvfXcyvQQgxnY7Xm6C6xQ9784dEL1amjM6S6Iw4ZpsvesAKnRVsM4scrDQaDqSClkjA==\"\n      },\n      \"System.Collections.Immutable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"QhkXUl2gNrQtvPmtBTQHb0YsUrDiDQ2QS09YbtTTiSjGcf7NBqtYbrG/BE06zcBPCKEwQGzIv13IVdXNOSub2w==\",\n        \"dependencies\": {\n          \"System.Memory\": \"4.5.5\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.0.0\"\n        }\n      },\n      \"System.Composition\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"3Djj70fFTraOarSKmRnmRy/zm4YurICm+kiCtI0dYRqGJnLX6nJ+G3WYuFJ173cAPax/gh96REcbNiVqcrypFQ==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\",\n          \"System.Composition.Convention\": \"9.0.0\",\n          \"System.Composition.Hosting\": \"9.0.0\",\n          \"System.Composition.Runtime\": \"9.0.0\",\n          \"System.Composition.TypedParts\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.AttributedModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"iri00l/zIX9g4lHMY+Nz0qV1n40+jFYAmgsaiNn16xvt2RDwlqByNG4wgblagnDYxm3YSQQ0jLlC/7Xlk9CzyA==\"\n      },\n      \"System.Composition.Convention\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"+vuqVP6xpi582XIjJi6OCsIxuoTZfR0M7WWufk3uGDeCl3wGW6KnpylUJ3iiXdPByPE0vR5TjJgR6hDLez4FQg==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.Hosting\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"OFqSeFeJYr7kHxDfaViGM1ymk7d4JxK//VSoNF9Ux0gpqkLsauDZpu89kTHHNdCWfSljbFcvAafGyBoY094btQ==\",\n        \"dependencies\": {\n          \"System.Composition.Runtime\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.Runtime\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"w1HOlQY1zsOWYussjFGZCEYF2UZXgvoYnS94NIu2CBnAGMbXFAX8PY8c92KwUItPmowal68jnVLBCzdrWLeEKA==\"\n      },\n      \"System.Composition.TypedParts\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"aRZlojCCGEHDKqh43jaDgaVpYETsgd7Nx4g1zwLKMtv4iTo0627715ajEFNpEEBTgLmvZuv8K0EVxc3sM4NWJA==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\",\n          \"System.Composition.Hosting\": \"9.0.0\",\n          \"System.Composition.Runtime\": \"9.0.0\"\n        }\n      },\n      \"System.Diagnostics.DiagnosticSource\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"ddppcFpnbohLWdYKr/ZeLZHmmI+DXFgZ3Snq+/E7SwcdW4UnvxmaugkwGywvGVWkHPGCSZjCP+MLzu23AL5SDw==\",\n        \"dependencies\": {\n          \"System.Memory\": \"4.5.5\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.0.0\"\n        }\n      },\n      \"System.IO.Pipelines\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"eA3cinogwaNB4jdjQHOP3Z3EuyiDII7MT35jgtnsA4vkn0LUrrSHsU0nzHTzFzmaFYeKV7MYyMxOocFzsBHpTw==\",\n        \"dependencies\": {\n          \"System.Buffers\": \"4.5.1\",\n          \"System.Memory\": \"4.5.5\",\n          \"System.Threading.Tasks.Extensions\": \"4.5.4\"\n        }\n      },\n      \"System.Memory\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.6.0\",\n        \"contentHash\": \"OEkbBQoklHngJ8UD8ez2AERSk2g+/qpAaSWWCBFbpH727HxDq5ydVkuncBaKcKfwRqXGWx64dS6G1SUScMsitg==\",\n        \"dependencies\": {\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Numerics.Vectors\": \"4.6.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\"\n        }\n      },\n      \"System.Numerics.Vectors\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.6.0\",\n        \"contentHash\": \"t+SoieZsRuEyiw/J+qXUbolyO219tKQQI0+2/YI+Qv7YdGValA6WiuokrNKqjrTNsy5ABWU11bdKOzUdheteXg==\"\n      },\n      \"System.Reflection.Metadata\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"ANiqLu3DxW9kol/hMmTWbt3414t9ftdIuiIU7j80okq2YzAueo120M442xk1kDJWtmZTqWQn7wHDvMRipVOEOQ==\",\n        \"dependencies\": {\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Memory\": \"4.5.5\"\n        }\n      },\n      \"System.Runtime.CompilerServices.Unsafe\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.1.0\",\n        \"contentHash\": \"5o/HZxx6RVqYlhKSq8/zronDkALJZUT2Vz0hx43f0gwe8mwlM0y2nYlqdBwLMzr262Bwvpikeb/yEwkAa5PADg==\"\n      },\n      \"System.Text.Encoding.CodePages\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"OZIsVplFGaVY90G2SbpgU7EnCoOO5pw1t4ic21dBF3/1omrJFpAGoNAVpPyMVOC90/hvgkGG3VFqR13YgZMQfg==\",\n        \"dependencies\": {\n          \"System.Memory\": \"4.5.5\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.0.0\"\n        }\n      },\n      \"System.Text.Encodings.Web\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"e2hMgAErLbKyUUwt18qSBf9T5Y+SFAL3ZedM8fLupkVj8Rj2PZ9oxQ37XX2LF8fTO1wNIxvKpihD7Of7D/NxZw==\",\n        \"dependencies\": {\n          \"System.Buffers\": \"4.5.1\",\n          \"System.Memory\": \"4.5.5\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.0.0\"\n        }\n      },\n      \"System.Text.Json\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"js7+qAu/9mQvnhA4EfGMZNEzXtJCDxgkgj8ohuxq/Qxv+R56G+ljefhiJHOxTNiw54q8vmABCWUwkMulNdlZ4A==\",\n        \"dependencies\": {\n          \"Microsoft.Bcl.AsyncInterfaces\": \"9.0.0\",\n          \"System.Buffers\": \"4.5.1\",\n          \"System.IO.Pipelines\": \"9.0.0\",\n          \"System.Memory\": \"4.5.5\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.0.0\",\n          \"System.Text.Encodings.Web\": \"9.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.5.4\",\n          \"System.ValueTuple\": \"4.5.0\"\n        }\n      },\n      \"System.Threading.Channels\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"CMaFr7v+57RW7uZfZkPExsPB6ljwzhjACWW1gfU35Y56rk72B/Wu+sTqxVmGSk4SFUlPc3cjeKND0zktziyjBA==\",\n        \"dependencies\": {\n          \"System.Threading.Tasks.Extensions\": \"4.5.4\"\n        }\n      },\n      \"System.Threading.Tasks.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.6.0\",\n        \"contentHash\": \"I5G6Y8jb0xRtGUC9Lahy7FUvlYlnGMMkbuKAQBy8Jb7Y6Yn8OlBEiUOY0PqZ0hy6Ua8poVA1ui1tAIiXNxGdsg==\",\n        \"dependencies\": {\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\"\n        }\n      },\n      \"System.ValueTuple\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.5.0\",\n        \"contentHash\": \"okurQJO6NRE/apDIP23ajJ0hpiNmJ+f0BwOlB/cSqTLQlw5upkf+5+96+iG2Jw40G1fCVCyPz/FhIABUjMR+RQ==\"\n      },\n      \"sonaranalyzer.cfg\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer.Lightup\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.core\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Google.Protobuf\": \"[3.6.1, )\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.CFG\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.csharp\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"SonarAnalyzer.CSharp.Core\": \"[10.26.0, )\",\n          \"SonarAnalyzer.Core\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.csharp.core\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.CFG\": \"[10.26.0, )\",\n          \"SonarAnalyzer.Core\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer.lightup\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.testframework\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Combinatorial.MSTest\": \"[2.0.0, )\",\n          \"FluentAssertions\": \"[7.2.1, )\",\n          \"FluentAssertions.Analyzers\": \"[0.34.1, )\",\n          \"MSTest.TestAdapter\": \"[4.2.1, )\",\n          \"MSTest.TestFramework\": \"[4.2.1, )\",\n          \"Microsoft.Build.Locator\": \"[1.11.2, )\",\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[5.3.0, )\",\n          \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": \"[5.3.0, )\",\n          \"Microsoft.CodeAnalysis.Workspaces.MSBuild\": \"[5.3.0, )\",\n          \"Microsoft.NET.Test.Sdk\": \"[18.4.0, )\",\n          \"NSubstitute\": \"[5.3.0, )\",\n          \"NuGet.Protocol\": \"[7.3.1, )\",\n          \"SonarAnalyzer.Core\": \"[10.26.0, )\",\n          \"altcover\": \"[9.0.102, )\"\n        }\n      },\n      \"sonaranalyzer.visualbasic\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": \"[1.3.2, )\",\n          \"SonarAnalyzer.Core\": \"[10.26.0, )\",\n          \"SonarAnalyzer.VisualBasic.Core\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.visualbasic.core\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": \"[1.3.2, )\",\n          \"SonarAnalyzer.CFG\": \"[10.26.0, )\",\n          \"SonarAnalyzer.Core\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      }\n    },\n    \"net9.0\": {\n      \"altcover\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[9.0.102, )\",\n        \"resolved\": \"9.0.102\",\n        \"contentHash\": \"q3Rf5t0M9kXlcO5qhsaAe6NrFSNd5enrhKmF/Ezgmomqw34PbUTbRSYjSDNhS3YGDyUrPTkyPn14EfLDJWztcA==\"\n      },\n      \"Combinatorial.MSTest\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[2.0.0, )\",\n        \"resolved\": \"2.0.0\",\n        \"contentHash\": \"9tB2TMPkuEkYYUq64WREHMMyPt9NfKAyuitpK9yw3zbVe6v/vYkClZTR02+yKFUG+g8XHi5LMTt8jHz4RufGqw==\",\n        \"dependencies\": {\n          \"MSTest.TestFramework\": \"4.0.1\"\n        }\n      },\n      \"JetBrains.dotMemoryUnit\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[3.2.20220510, )\",\n        \"resolved\": \"3.2.20220510\",\n        \"contentHash\": \"jhzqT6zXFN0S6zxNXKmiEoNIqAEtlbsteQEhDA8TkTFfQpE/noktqU1HXfJ4P2PPczW48aFW9h69nHY8pSbnXw==\"\n      },\n      \"Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[3.3.1, )\",\n        \"resolved\": \"3.3.1\",\n        \"contentHash\": \"eT+kgNCDdTRbQ5WF6BGx1HI3D5jYfHteza/koefhWC2vNZGxObA74XxwWfg40dy3uUv7dn3OGKLK5GUPLroVog==\"\n      },\n      \"Microsoft.NET.Test.Sdk\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[18.4.0, )\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"w49iZdL4HL6V25l41NVQLXWQ+e71GvSkKVteMrOL02gP/PUkcnO/1yEb2s9FntU4wGmJWfKnyrRAhcMHd9ZZNA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeCoverage\": \"18.4.0\",\n          \"Microsoft.TestPlatform.TestHost\": \"18.4.0\"\n        }\n      },\n      \"MSTest.TestAdapter\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[4.2.1, )\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"lZRgNzaQnffK4XLjM/og4Eoqp/3IkpcyJQQcyKXkPdkzCT3+ghpwHa9zG1xYhQDbUFoc54M+/waLwh31K9stDQ==\",\n        \"dependencies\": {\n          \"MSTest.TestFramework\": \"4.2.1\",\n          \"Microsoft.Testing.Extensions.VSTestBridge\": \"2.2.1\",\n          \"Microsoft.Testing.Platform.MSBuild\": \"2.2.1\"\n        }\n      },\n      \"MSTest.TestFramework\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[4.2.1, )\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"I4/RbS2TpGZ56CE98+jPbrGlcerYtw2LvPVKzQGvyQQcJDekPy2Kd+fnThXYn+geJ1sW+vA9B7++rFNxvKcWxA==\",\n        \"dependencies\": {\n          \"MSTest.Analyzers\": \"4.2.1\"\n        }\n      },\n      \"SonarAnalyzer.CSharp.Styling\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[10.21.0.135717, )\",\n        \"resolved\": \"10.21.0.135717\",\n        \"contentHash\": \"hl264jF539oB7m2jED5QGM345eFSiDAdoJc8TH0HM6L7ZeqT5TDqZDQeZ8IDP02dVIpH/Fhhn+HsGfEcj8ohyQ==\"\n      },\n      \"StyleCop.Analyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.2.0-beta.556, )\",\n        \"resolved\": \"1.2.0-beta.556\",\n        \"contentHash\": \"llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==\",\n        \"dependencies\": {\n          \"StyleCop.Analyzers.Unstable\": \"1.2.0.556\"\n        }\n      },\n      \"Castle.Core\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.1.1\",\n        \"contentHash\": \"rpYtIczkzGpf+EkZgDr9CClTdemhsrwA/W5hMoPjLkRFnXzH44zDLoovXeKtmxb1ykXK9aJVODSpiJml8CTw2g==\",\n        \"dependencies\": {\n          \"System.Diagnostics.EventLog\": \"6.0.0\"\n        }\n      },\n      \"FluentAssertions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.2.1\",\n        \"contentHash\": \"MilqBF2lZrT0V1azIA6DG6I/snS0rG3A8ohT2Jjkhq6zOFk76nqx4BPnEnzrX6jFVa6xvkDU++z3PebCGZyJ4g==\",\n        \"dependencies\": {\n          \"System.Configuration.ConfigurationManager\": \"6.0.0\"\n        }\n      },\n      \"FluentAssertions.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"0.34.1\",\n        \"contentHash\": \"2BnAAB8CCPdRA9P1+lAvBZOleR2BTmsxGMtGt+LnABJUARGqoGMWEFxG3znZYqHVIrMP0Za/kyw6atyt8x2mzA==\"\n      },\n      \"Google.Protobuf\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"3.6.1\",\n        \"contentHash\": \"741fGeDQjixBJaU2j+0CbrmZXsNJkTn/hWbOh4fLVXndHsCclJmWznCPWrJmPoZKvajBvAz3e8ECJOUvRtwjNQ==\",\n        \"dependencies\": {\n          \"NETStandard.Library\": \"1.6.1\"\n        }\n      },\n      \"Humanizer.Core\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.14.1\",\n        \"contentHash\": \"lQKvtaTDOXnoVJ20ibTuSIOf2i0uO0MPbDhd1jm238I+U/2ZnRENj0cktKZhtchBMtCUSRQ5v4xBCUbKNmyVMw==\"\n      },\n      \"Microsoft.ApplicationInsights\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.23.0\",\n        \"contentHash\": \"nWArUZTdU7iqZLycLKWe0TDms48KKGE6pONH2terYNa8REXiqixrMOkf1sk5DHGMaUTqONU2YkS4SAXBhLStgw==\",\n        \"dependencies\": {\n          \"System.Diagnostics.DiagnosticSource\": \"5.0.0\"\n        }\n      },\n      \"Microsoft.Build.Framework\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"17.11.48\",\n        \"contentHash\": \"C3WIMt2wBl4++NX3jSEpTq5KXBhvAV154R4JrYHkfy9JSBcXWiL0mkgpspk5xSdOj+fS/uz7zluIy6bMM1fkkQ==\"\n      },\n      \"Microsoft.Build.Locator\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.11.2\",\n        \"contentHash\": \"tY+/S54G29CGsbL3slVu4vqtpciwVnb3fKOmrhgzEQmu/VziFaWmD/E1e/2KH7cDucuycGSkWsSXndBs5Uawow==\"\n      },\n      \"Microsoft.CodeAnalysis.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0-2.25625.1\",\n        \"contentHash\": \"4Yhh2fnu3G+J0J1lDc8WZVgMjgbynSeTfkl5IFJMFrmiIO0sc7Tjx+f3sFVV8Sd35PrIUWfof0RWc3lAMl7Azg==\"\n      },\n      \"Microsoft.CodeAnalysis.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"uC0qk3jzTQY7i90ehfnCqaOZpBUGJyPMiHJ3c0jOb8yaPBjWzIhVdNxPbeVzI74DB0C+YgBKPLqUkgFZzua5Mg==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"SQFNGQF4f7UfDXKxMzzGNMr3fjrPDIjLfmRvvVgDCw+dyvEHDaRfHuKA5q0Pr0/JW0Gcw89TxrxrS/MjwBvluQ==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp.Workspaces\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"mRwxchBs3ewXK4dqK4R/eVCx99VIq1k/lhwArlu+fJuV0uzmbkTTRw4jR9gN9sOcAQfX0uV9KQlmCk1yC0JNog==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.CSharp\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.VisualBasic\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"AJxddsIOmfimuihaLuSAm4c/zskHoL1ypAjIpSOZqHlNm2iuw0twsB8nbKczJyfClqD7+iYjdIeE5EV8WAyxRA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"pAGdr4qs7+v287DPiiM8px1cBXnhe8LxymkVGTnCwv2OEjCk5HO2zIoFvype4ivKJTRW3aTUUV8ab+915wbv+w==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.VisualBasic\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Workspaces.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"QSf1ge9A+XFZbGL+gIqXYBIKlm8QdQVLvHDPZiydG11W6mJY7XBMusrsgIEz6L8GYMzGJKTM78m9icliGMF7NA==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Workspaces.MSBuild\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"2Mg/ppo5dza1e4DJWX4+RIHMc3FgnYzuHTaLRZDupiK1LTi/PAZ1PBpF/iivHVNKQKwipHE984gy37MbM0RO9Q==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.Build.Framework\": \"17.11.48\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"Microsoft.Extensions.DependencyInjection\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Options\": \"9.0.0\",\n          \"Microsoft.Extensions.Primitives\": \"9.0.0\",\n          \"Microsoft.VisualStudio.SolutionPersistence\": \"1.0.52\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeCoverage\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"9O0BtCfzCWrkAmK187ugKdq72HHOXoOUjuWFDVc2LsZZ0pOnA9bTt+Sg9q4cF+MoAaUU+MuWtvBuFsnduviJow==\"\n      },\n      \"Microsoft.Composition\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.27\",\n        \"contentHash\": \"pwu80Ohe7SBzZ6i69LVdzowp6V+LaVRzd5F7A6QlD42vQkX0oT7KXKWWPlM/S00w1gnMQMRnEdbtOV12z6rXdQ==\"\n      },\n      \"Microsoft.Extensions.DependencyInjection\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"MCPrg7v3QgNMr0vX4vzRXvkNGgLg8vKWX0nKCWUxu2uPyMsaRgiRc1tHBnbTcfJMhMKj2slE/j2M9oGkd25DNw==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.DependencyInjection.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"+6f2qv2a3dLwd5w6JanPIPs47CxRbnk+ZocMJUhv9NxP88VlOcJYZs9jY+MYSjxvady08bUZn6qgiNh7DadGgg==\"\n      },\n      \"Microsoft.Extensions.Logging\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"crjWyORoug0kK7RSNJBTeSE6VX8IQgLf3nUpTB9m62bPXp/tzbnOsnbe8TXEG0AASNaKZddnpHKw7fET8E++Pg==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Options\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.Logging.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"g0UfujELzlLbHoVG8kPKVBaW470Ewi+jnptGS9KUi6jcb+k2StujtK3m26DFSGGwQ/+bVgZfsWqNzlP6YOejvw==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.Options\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"y2146b3jrPI3Q0lokKXdKLpmXqakYbDIPDV6r3M8SqvSf45WwOTzkyfDpxnZXJsJQEpAsAqjUq5Pu8RCJMjubg==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Primitives\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"N3qEBzmLMYiASUlKxxFIISP4AiwuPTHF5uCh+2CWSwwzAJiIYx0kBJsS30cp1nvhSySFAVi30jecD307jV+8Kg==\"\n      },\n      \"Microsoft.Testing.Extensions.Telemetry\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"7zB8BjffOyvqfHF26rFVPuK0w1fCf5+j1tLuhHIr76CqxXkGb+fMJtq6YNOV+m6qPytExHMXxluk3RgJ+dSIqw==\",\n        \"dependencies\": {\n          \"Microsoft.ApplicationInsights\": \"2.23.0\",\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.Testing.Extensions.TrxReport.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"RD6D1Jx6cKDA5IHd1H2q8ylIuQG3PD+gdULI0JC8CvsRtaypFzTFpB5xDPuQi8o6kAkcM04cBhAiJPxZboNH2Q==\",\n        \"dependencies\": {\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.Testing.Extensions.VSTestBridge\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"D8AGlkNtlTQPe3zf4SLnHBMr13lerMe0RuHSoRfnRatcuX/T7YbRtgn39rWBjKhXsNio0WXKrPKv3gfWE2I46w==\",\n        \"dependencies\": {\n          \"Microsoft.TestPlatform.ObjectModel\": \"18.3.0\",\n          \"Microsoft.Testing.Extensions.Telemetry\": \"2.2.1\",\n          \"Microsoft.Testing.Extensions.TrxReport.Abstractions\": \"2.2.1\",\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.Testing.Platform\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"9bbPuls/b6/vUFzxbSjJLZlJHyKBfOZE5kjIY+ITI2ASqlFPJhR83BdLydJeQOCLEZhEbrEcz5xtt1B69nwSVg==\"\n      },\n      \"Microsoft.Testing.Platform.MSBuild\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"CSJOcZHfKlTyPbS0CTJk6iEnU4gJC+eUA5z72UBnMDRdgVHYOmB8k9Y7jT233gZjnCOQiYFg3acQHRfu2H62nw==\",\n        \"dependencies\": {\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.TestPlatform.ObjectModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"4L6m2kS2pY5uJ9cpeRxzW22opr6ttScIRqsOpMDQpgENp/ZwxkkQCcmc6LRSURo2dFaaSW5KVflQZvroiJ7Wzg==\",\n        \"dependencies\": {\n          \"System.Reflection.Metadata\": \"8.0.0\"\n        }\n      },\n      \"Microsoft.TestPlatform.TestHost\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"gZsCHI+zOmZCcKZieIL4Jg14qKD2OGZOmX5DehuIk1EA9BN6Crm0+taXQNEuajOH1G9CCyBxw8VWR4t5tumcng==\",\n        \"dependencies\": {\n          \"Microsoft.TestPlatform.ObjectModel\": \"18.4.0\",\n          \"Newtonsoft.Json\": \"13.0.3\"\n        }\n      },\n      \"Microsoft.VisualStudio.SolutionPersistence\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.52\",\n        \"contentHash\": \"oNv2JtYXhpdJrX63nibx1JT3uCESOBQ1LAk7Dtz/sr0+laW0KRM6eKp4CZ3MHDR2siIkKsY8MmUkeP5DKkQQ5w==\"\n      },\n      \"Microsoft.Win32.SystemEvents\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"hqTM5628jSsQiv+HGpiq3WKBl2c8v1KZfby2J6Pr7pEPlK9waPdgEO6b8A/+/xn/yZ9ulv8HuqK71ONy2tg67A==\"\n      },\n      \"MSTest.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"1i9jgE/42KGGyZ4s0MdrYM/Uu/dRYhbRfYQifcO0AZ6vw4sBXRjoQGQRGNSm771AYgPAmoGl0u4sJc2lMET6HQ==\"\n      },\n      \"Newtonsoft.Json\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"13.0.3\",\n        \"contentHash\": \"HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==\"\n      },\n      \"NSubstitute\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"lJ47Cps5Qzr86N99lcwd+OUvQma7+fBgr8+Mn+aOC0WrlqMNkdivaYD9IvnZ5Mqo6Ky3LS7ZI+tUq1/s9ERd0Q==\",\n        \"dependencies\": {\n          \"Castle.Core\": \"5.1.1\"\n        }\n      },\n      \"NuGet.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"1mp7zmyAGmQfT93ELC4c+MYOrJ8Ff4ekFZRek4JSVLb/wOO/o0bsPfLmqujCsJ2Hlwc+fpq1TQEnjSEgWdt8ng==\",\n        \"dependencies\": {\n          \"NuGet.Frameworks\": \"7.3.1\"\n        }\n      },\n      \"NuGet.Configuration\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"tGxWBo47EQONOaqY+MbEWMrNjFthHgfavLM1HE0RcLyOXVCoQKBlZGV7v0hrS/rJrQKw6ZaBeHetX+ZJgS7Lxg==\",\n        \"dependencies\": {\n          \"NuGet.Common\": \"7.3.1\",\n          \"System.Security.Cryptography.ProtectedData\": \"8.0.0\"\n        }\n      },\n      \"NuGet.Frameworks\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"VUPAE5l/Ir4Gb3dv+v0jq0Qe4nfwxfrfiYN7QhwlGyWPXFKYXSSke1t1bV/ZYd6idtTtRDqJPM49Lt/U8NTocg==\"\n      },\n      \"NuGet.Packaging\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"5bT8uOrNBx4Srhbrd3HonYmyKhWJkvQyTWTYE2jvfPgYx2aCbPmq8MCYko7ce78hEN9mpq2xlrztVhguYPc+GQ==\",\n        \"dependencies\": {\n          \"Newtonsoft.Json\": \"13.0.3\",\n          \"NuGet.Configuration\": \"7.3.1\",\n          \"NuGet.Versioning\": \"7.3.1\",\n          \"System.Security.Cryptography.Pkcs\": \"8.0.1\"\n        }\n      },\n      \"NuGet.Protocol\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"vYd5vtCJ/tpMQjbAs6rrftNgeh5Ip1w7tnEsDZCpGObKgUgOxHQBekCul3TnzmbNgobvJEkDJNaec5/ZBv66Hg==\",\n        \"dependencies\": {\n          \"NuGet.Packaging\": \"7.3.1\"\n        }\n      },\n      \"NuGet.Versioning\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"TJrQWSmD1vakfav7qIhDXgDFfaZFfMJ+v6P8tcND9ZqXajD5B/ZzaoGYNzL4D3eDue6vAOUvwzu42G+19JNVUA==\"\n      },\n      \"StyleCop.Analyzers.Unstable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.2.0.556\",\n        \"contentHash\": \"zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==\"\n      },\n      \"System.Collections.Immutable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"AurL6Y5BA1WotzlEvVaIDpqzpIPvYnnldxru8oXJU2yFxFUy3+pNXjXd1ymO+RA0rq0+590Q8gaz2l3Sr7fmqg==\"\n      },\n      \"System.Composition\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"3Djj70fFTraOarSKmRnmRy/zm4YurICm+kiCtI0dYRqGJnLX6nJ+G3WYuFJ173cAPax/gh96REcbNiVqcrypFQ==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\",\n          \"System.Composition.Convention\": \"9.0.0\",\n          \"System.Composition.Hosting\": \"9.0.0\",\n          \"System.Composition.Runtime\": \"9.0.0\",\n          \"System.Composition.TypedParts\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.AttributedModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"iri00l/zIX9g4lHMY+Nz0qV1n40+jFYAmgsaiNn16xvt2RDwlqByNG4wgblagnDYxm3YSQQ0jLlC/7Xlk9CzyA==\"\n      },\n      \"System.Composition.Convention\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"+vuqVP6xpi582XIjJi6OCsIxuoTZfR0M7WWufk3uGDeCl3wGW6KnpylUJ3iiXdPByPE0vR5TjJgR6hDLez4FQg==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.Hosting\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"OFqSeFeJYr7kHxDfaViGM1ymk7d4JxK//VSoNF9Ux0gpqkLsauDZpu89kTHHNdCWfSljbFcvAafGyBoY094btQ==\",\n        \"dependencies\": {\n          \"System.Composition.Runtime\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.Runtime\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"w1HOlQY1zsOWYussjFGZCEYF2UZXgvoYnS94NIu2CBnAGMbXFAX8PY8c92KwUItPmowal68jnVLBCzdrWLeEKA==\"\n      },\n      \"System.Composition.TypedParts\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"aRZlojCCGEHDKqh43jaDgaVpYETsgd7Nx4g1zwLKMtv4iTo0627715ajEFNpEEBTgLmvZuv8K0EVxc3sM4NWJA==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\",\n          \"System.Composition.Hosting\": \"9.0.0\",\n          \"System.Composition.Runtime\": \"9.0.0\"\n        }\n      },\n      \"System.Configuration.ConfigurationManager\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"7T+m0kDSlIPTHIkPMIu6m6tV6qsMqJpvQWW2jIc2qi7sn40qxFo0q+7mEQAhMPXZHMKnWrnv47ntGlM/ejvw3g==\",\n        \"dependencies\": {\n          \"System.Security.Cryptography.ProtectedData\": \"6.0.0\",\n          \"System.Security.Permissions\": \"6.0.0\"\n        }\n      },\n      \"System.Diagnostics.DiagnosticSource\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.0.0\",\n        \"contentHash\": \"tCQTzPsGZh/A9LhhA6zrqCRV4hOHsK90/G7q3Khxmn6tnB1PuNU0cRaKANP2AWcF9bn0zsuOoZOSrHuJk6oNBA==\"\n      },\n      \"System.Diagnostics.EventLog\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"lcyUiXTsETK2ALsZrX+nWuHSIQeazhqPphLfaRxzdGaG93+0kELqpgEHtwWOlQe7+jSFnKwaCAgL4kjeZCQJnw==\"\n      },\n      \"System.Drawing.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"NfuoKUiP2nUWwKZN6twGqXioIe1zVD0RIj2t976A+czLHr2nY454RwwXs6JU9Htc6mwqL6Dn/nEL3dpVf2jOhg==\",\n        \"dependencies\": {\n          \"Microsoft.Win32.SystemEvents\": \"6.0.0\"\n        }\n      },\n      \"System.Reflection.Metadata\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"ptvgrFh7PvWI8bcVqG5rsA/weWM09EnthFHR5SCnS6IN+P4mj6rE1lBDC4U8HL9/57htKAqy4KQ3bBj84cfYyQ==\",\n        \"dependencies\": {\n          \"System.Collections.Immutable\": \"8.0.0\"\n        }\n      },\n      \"System.Security.AccessControl\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"AUADIc0LIEQe7MzC+I0cl0rAT8RrTAKFHl53yHjEUzNVIaUlhFY11vc2ebiVJzVBuOzun6F7FBA+8KAbGTTedQ==\"\n      },\n      \"System.Security.Cryptography.Pkcs\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.1\",\n        \"contentHash\": \"CoCRHFym33aUSf/NtWSVSZa99dkd0Hm7OCZUxORBjRB16LNhIEOf8THPqzIYlvKM0nNDAPTRBa1FxEECrgaxxA==\"\n      },\n      \"System.Security.Cryptography.ProtectedData\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"+TUFINV2q2ifyXauQXRwy4CiBhqvDEDZeVJU7qfxya4aRYOKzVBpN+4acx25VcPB9ywUN6C0n8drWl110PhZEg==\"\n      },\n      \"System.Security.Permissions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"T/uuc7AklkDoxmcJ7LGkyX1CcSviZuLCa4jg3PekfJ7SU0niF0IVTXwUiNVP9DSpzou2PpxJ+eNY2IfDM90ZCg==\",\n        \"dependencies\": {\n          \"System.Security.AccessControl\": \"6.0.0\",\n          \"System.Windows.Extensions\": \"6.0.0\"\n        }\n      },\n      \"System.Windows.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"IXoJOXIqc39AIe+CIR7koBtRGMiCt/LPM3lI+PELtDIy9XdyeSrwXFdWV9dzJ2Awl0paLWUaknLxFQ5HpHZUog==\",\n        \"dependencies\": {\n          \"System.Drawing.Common\": \"6.0.0\"\n        }\n      },\n      \"sonaranalyzer.cfg\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer.Lightup\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.core\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Google.Protobuf\": \"[3.6.1, )\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.CFG\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.csharp\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"SonarAnalyzer.CSharp.Core\": \"[10.26.0, )\",\n          \"SonarAnalyzer.Core\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.csharp.core\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.CFG\": \"[10.26.0, )\",\n          \"SonarAnalyzer.Core\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer.lightup\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.testframework\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Combinatorial.MSTest\": \"[2.0.0, )\",\n          \"FluentAssertions\": \"[7.2.1, )\",\n          \"FluentAssertions.Analyzers\": \"[0.34.1, )\",\n          \"MSTest.TestAdapter\": \"[4.2.1, )\",\n          \"MSTest.TestFramework\": \"[4.2.1, )\",\n          \"Microsoft.Build.Locator\": \"[1.11.2, )\",\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[5.3.0, )\",\n          \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": \"[5.3.0, )\",\n          \"Microsoft.CodeAnalysis.Workspaces.MSBuild\": \"[5.3.0, )\",\n          \"Microsoft.NET.Test.Sdk\": \"[18.4.0, )\",\n          \"NSubstitute\": \"[5.3.0, )\",\n          \"NuGet.Protocol\": \"[7.3.1, )\",\n          \"SonarAnalyzer.Core\": \"[10.26.0, )\",\n          \"altcover\": \"[9.0.102, )\"\n        }\n      },\n      \"sonaranalyzer.visualbasic\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": \"[1.3.2, )\",\n          \"SonarAnalyzer.Core\": \"[10.26.0, )\",\n          \"SonarAnalyzer.VisualBasic.Core\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.visualbasic.core\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": \"[1.3.2, )\",\n          \"SonarAnalyzer.CFG\": \"[10.26.0, )\",\n          \"SonarAnalyzer.Core\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/FactoryTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing VerifyMSTest;\nusing VerifyTests;\n\nnamespace SonarAnalyzer.ShimLayer.Generator.Test;\n\n[TestClass]\n[UsesVerify]\npublic partial class FactoryTest\n{\n    [TestMethod]\n    public async Task SnapshotAsync() =>\n        // If this test fails in CI, execute it locally to update the snapshots and push the changes.\n        await Verifier.Verify(Factory.CreateAllFiles().Select(x => new Target(\"cs\", x.Content, x.Name)))\n            .UseDirectory(\"Snapshots\")\n            .AutoVerify(includeBuildServer: false)\n            .UseFileName(\"Snap\");\n\n    [TestMethod]\n    public async Task Run() =>\n        await VerifyChecks.Run();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Model/ModelBuilderTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Operations;\n\nnamespace SonarAnalyzer.ShimLayer.Generator.Model.Test;\n\n[TestClass]\npublic class ModelBuilderTest\n{\n    [TestMethod]\n    public void Build_NestedTypes()\n    {\n        var type = typeof(IOperation.OperationList);\n        var model = ModelBuilder.Build([new TypeDescriptor(type, [])], []);\n        model[type].Should().BeOfType<SkipStrategy>();\n    }\n\n    [TestMethod]\n    public void Build_GenericTypes()\n    {\n        var type = typeof(IEnumerable<int>);\n        var model = ModelBuilder.Build([new TypeDescriptor(type, [])], []);\n        model[type].Should().BeOfType<SkipStrategy>();\n    }\n\n    [TestMethod]\n    public void Build_Delegates()\n    {\n        var type = typeof(SyntaxReceiverCreator);\n        var model = ModelBuilder.Build([new TypeDescriptor(type, [])], []);\n        model[type].Should().BeOfType<SkipStrategy>();\n    }\n\n    [TestMethod]\n    public void Build_Enums_NoBaseline()\n    {\n        var type = typeof(NamespaceKind);\n        var members = type.GetMembers();\n        var model = ModelBuilder.Build([new TypeDescriptor(type, members)], []);\n        model[type].Should().BeOfType<NewEnumStrategy>()\n            .Which.Fields.Select(x => x.Name).Should().BeEquivalentTo([\n                \"Assembly\",\n                \"Compilation\",\n                \"Module\"]);\n        // Make sure we've sent other members that are not in the result\n        members.Should().ContainSingle(x => x is FieldInfo && x.Name == \"value__\"); // IsSpecialName\n        members.Should().ContainSingle(x => x is MethodInfo && x.Name == \"HasFlag\"); // IsSpecialName\n    }\n\n    [TestMethod]\n    public void Build_Enums_WithBaseline()\n    {\n        var type = typeof(NamespaceKind);\n        var assembly = type.GetMember(\"Assembly\").Single();\n        var compilation = type.GetMember(\"Compilation\").Single();\n        var module = type.GetMember(\"Module\").Single();\n\n        var model = ModelBuilder.Build([new(type, [assembly, compilation, module])], [new(type, [assembly])]);\n        model[type].Should().BeOfType<PartialEnumStrategy>()\n            .Which.Fields.Select(x => x.Name).Should().BeEquivalentTo([\n                \"Compilation\",\n                \"Module\"]);\n    }\n\n    [TestMethod]\n    public void Build_SyntaxNode_Itself()\n    {\n        var type = typeof(SyntaxNode);\n        var model = ModelBuilder.Build([new TypeDescriptor(type, [])], []);\n        model[type].Should().BeOfType<SyntaxNodeWrapStrategy>();\n    }\n\n    [TestMethod]\n    public void Build_SyntaxNode_RecordDeclaration()\n    {\n        var type = typeof(RecordDeclarationSyntax);\n        var model = ModelBuilder.Build([new TypeDescriptor(type, [])], [\n            new(typeof(TypeDeclarationSyntax), []),\n            new(typeof(BaseTypeDeclarationSyntax), []),\n            new(typeof(MemberDeclarationSyntax), []),\n            new(typeof(CSharpSyntaxNode), []),\n            new(typeof(SyntaxNode), [])]);\n        model[type].Should().BeOfType<SyntaxNodeWrapStrategy>().Which.BaseType.FullName.Should().Be(typeof(TypeDeclarationSyntax).FullName);\n    }\n\n    [TestMethod]\n    public void Build_SyntaxNode_NoCommonBaseType()\n    {\n        var type = typeof(RecordDeclarationSyntax);\n        var model = ModelBuilder.Build([new TypeDescriptor(type, [])], []);\n        model[type].Should().BeOfType<SyntaxNodeWrapStrategy>().Which.BaseType.Should().Be<object>();\n    }\n\n    [TestMethod]\n    public void Build_SyntaxNode_ExtensionBlockDeclarationSyntax_EndToEnd()\n    {\n        using var typeLoader = new TypeLoader();\n        var typeDescriptor = typeLoader.LoadLatest().Single(x => x.Type.Name == nameof(ExtensionBlockDeclarationSyntax));\n        var model = ModelBuilder.Build([typeDescriptor], typeLoader.LoadBaseline());\n        var strategy = model[typeDescriptor.Type].Should().BeOfType<SyntaxNodeWrapStrategy>().Which;\n        strategy.BaseType.FullName.Should().Be(typeof(TypeDeclarationSyntax).FullName);\n        strategy.Members.Should().HaveCount(150);\n        strategy.Members.Should().ContainEquivalentOf(new MemberDescriptor(typeDescriptor.Type.GetMember(nameof(ExtensionBlockDeclarationSyntax.Modifiers)).Should().ContainSingle().Subject, true));\n        strategy.Members.Should().ContainEquivalentOf(new MemberDescriptor(typeDescriptor.Type.GetMember(nameof(ExtensionBlockDeclarationSyntax.ParameterList)).Should().ContainSingle().Subject, false));\n    }\n\n    [TestMethod]\n    public void Build_IOperation()\n    {\n        using var typeLoader = new TypeLoader();\n        var type = typeLoader.LoadLatest().Single(x => x.Type.Name == nameof(IOperation));\n        var model = ModelBuilder.Build([type], []);\n        model[type.Type].Should().BeOfType<IOperationStrategy>()\n            .Which.Members.Select(x => x.Member.ToString()).Should().BeEquivalentTo([\n                \"System.Void Accept(Microsoft.CodeAnalysis.Operations.OperationVisitor)\",\n                \"TResult Accept[TArgument,TResult](Microsoft.CodeAnalysis.Operations.OperationVisitor`2[TArgument,TResult], TArgument)\",\n                \"Microsoft.CodeAnalysis.IOperation Parent\",\n                \"Microsoft.CodeAnalysis.OperationKind Kind\",\n                \"Microsoft.CodeAnalysis.SyntaxNode Syntax\",\n                \"Microsoft.CodeAnalysis.ITypeSymbol Type\",\n                \"Microsoft.CodeAnalysis.Optional`1[System.Object] ConstantValue\",\n                \"System.Collections.Generic.IEnumerable`1[Microsoft.CodeAnalysis.IOperation] Children\",\n                \"Microsoft.CodeAnalysis.IOperation+OperationList ChildOperations\",\n                \"System.String Language\",\n                \"System.Boolean IsImplicit\",\n                \"Microsoft.CodeAnalysis.SemanticModel SemanticModel\"]);\n    }\n\n    [TestMethod]\n    public void Build_IInvocationOperation()\n    {\n        using var typeLoader = new TypeLoader();\n        var type = typeLoader.LoadLatest().Single(x => x.Type.Name == nameof(IInvocationOperation));\n        var model = ModelBuilder.Build([type], []);\n        model[type.Type].Should().BeOfType<IOperationStrategy>()\n            .Which.Members.Select(x => x.Member.ToString()).Should().BeEquivalentTo([\n                \"Microsoft.CodeAnalysis.IMethodSymbol TargetMethod\",\n                \"Microsoft.CodeAnalysis.ITypeSymbol ConstrainedToType\",\n                \"Microsoft.CodeAnalysis.IOperation Instance\",\n                \"System.Boolean IsVirtual\",\n                \"System.Collections.Immutable.ImmutableArray`1[Microsoft.CodeAnalysis.Operations.IArgumentOperation] Arguments\",\n                \"System.Void Accept(Microsoft.CodeAnalysis.Operations.OperationVisitor)\",\n                \"TResult Accept[TArgument,TResult](Microsoft.CodeAnalysis.Operations.OperationVisitor`2[TArgument,TResult], TArgument)\",\n                \"Microsoft.CodeAnalysis.IOperation Parent\",\n                \"Microsoft.CodeAnalysis.OperationKind Kind\",\n                \"Microsoft.CodeAnalysis.SyntaxNode Syntax\",\n                \"Microsoft.CodeAnalysis.ITypeSymbol Type\",\n                \"Microsoft.CodeAnalysis.Optional`1[System.Object] ConstantValue\",\n                \"System.Collections.Generic.IEnumerable`1[Microsoft.CodeAnalysis.IOperation] Children\",\n                \"Microsoft.CodeAnalysis.IOperation+OperationList ChildOperations\",\n                \"System.String Language\",\n                \"System.Boolean IsImplicit\",\n                \"Microsoft.CodeAnalysis.SemanticModel SemanticModel\"]);\n    }\n\n    [TestMethod]\n    public void Build_StaticClass()\n    {\n        var type = typeof(GeneratorExtensions);\n        var model = ModelBuilder.Build([new TypeDescriptor(type, [])], []);\n        model[type].Should().BeOfType<SkipStrategy>();  // ToDo: This will change later, likely to StaticClassStrategy\n    }\n\n    [TestMethod]\n    public void Build_NoChangeStrategy()\n    {\n        var type = typeof(NamespaceKind);\n        var members = type.GetMembers();\n\n        var model = ModelBuilder.Build(\n            [new(type, members)],\n            [new(type, members.OrderByDescending(x => x.ToString()).ToArray())]);\n        model[type].Should().BeOfType<NoChangeStrategy>();\n    }\n\n    [TestMethod]\n    public void Build_NoChangeStrategy_DifferentMembers()\n    {\n        var type = typeof(SyntaxToken);\n        var members = type.GetMembers();\n\n        var model = ModelBuilder.Build(\n            [new(type, members)],\n            [new(type, [])]);           // Fallback for types that do have a baseline (can be used), but do not have a dedicated strategy\n        model[type].Should().BeOfType<NoChangeStrategy>();\n    }\n\n    [TestMethod]\n    public void CreateMembers_NoBaseline()\n    {\n        var type = typeof(SyntaxNode);\n        var parent = type.GetMember(\"Parent\").Single();\n        var ancestors = type.GetMember(\"Ancestors\").Single();\n        var model = ModelBuilder.Build([new TypeDescriptor(type, [parent, ancestors])], []);\n        model[type].Should().BeOfType<SyntaxNodeWrapStrategy>()\n            .Which.Members.Should().BeEquivalentTo([\n                new MemberDescriptor(parent, false),\n                new MemberDescriptor(ancestors, false)]);\n    }\n\n    [TestMethod]\n    public void CreateMembers_WithBaseline()\n    {\n        using var typeLoader = new TypeLoader();\n        var baseline = typeLoader.LoadBaseline().Single(x => x.Type.Name == nameof(SyntaxNode));\n        var latest = typeLoader.LoadLatest().Single(x => x.Type.Name == nameof(SyntaxNode));\n        var model = ModelBuilder.Build([latest], [baseline]);\n        model[latest.Type].Should().BeOfType<SyntaxNodeExtendStrategy>()\n            .Which.Members.Select(x => x.ToString()).Should().BeEquivalentTo([\n                \"System.Boolean IsIncrementallyIdenticalTo(Microsoft.CodeAnalysis.SyntaxNode)\",\n                \"System.Boolean ContainsDirective(System.Int32)\",\n                \"TNode FirstAncestorOrSelf[TNode,TArg](System.Func`3[TNode,TArg,System.Boolean], TArg, System.Boolean)\"]);\n    }\n\n    [TestMethod]\n    public void CreateMembers_SkippedMembers()\n    {\n        var type = typeof(SyntaxNode);\n        var membersToSkip = new[]\n        {\n            type.GetMember(\"get_SyntaxTree\").First(),\n            type.GetMember(\"GetType\").First(),\n            type.GetMember(\"Equals\").First(),\n            type.GetMember(\"GetHashCode\").First(),\n            type.GetMember(\"ToString\").First()\n        };\n        var model = ModelBuilder.Build([new(type, membersToSkip)], []);\n        model[type].Should().BeOfType<SyntaxNodeWrapStrategy>().Which.Members.Should().BeEmpty();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Model/TypeLoaderTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.ShimLayer.Generator.Model.Test;\n\n[TestClass]\npublic class TypeLoaderTest\n{\n    private const string NewTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.FileScopedNamespaceDeclarationSyntax\"; // This type is not part of Roslyn 1.3.2\n\n    [TestMethod]\n    public void LoadBaseline_AllAssemblies()\n    {\n        using var typeLoader = new TypeLoader();\n        typeLoader.LoadBaseline().Select(x => x.Type).Should()\n            .ContainSingle(x => x.FullName == \"Microsoft.CodeAnalysis.CSharp.CSharpCompilation\")\n            .And.ContainSingle(x => x.FullName == \"Microsoft.CodeAnalysis.Compilation\")\n            .And.NotContain(x => x.FullName == NewTypeName)\n            .And.HaveCount(555);\n    }\n\n    [TestMethod]\n    public void LoadLatest_AllAssemblies()\n    {\n        using var typeLoader = new TypeLoader();\n        typeLoader.LoadLatest().Select(x => x.Type).Should()\n            .ContainSingle(x => x.FullName == \"Microsoft.CodeAnalysis.CSharp.CSharpCompilation\")\n            .And.ContainSingle(x => x.FullName == \"Microsoft.CodeAnalysis.Compilation\")\n            .And.ContainSingle(x => x.FullName == NewTypeName)\n            .And.HaveCountGreaterThan(750);\n    }\n\n    [TestMethod]\n    public void Load_AllTypes()\n    {\n        using var typeLoader = new TypeLoader();\n        typeLoader.LoadLatest().Select(x => x.Type).Should()\n            .ContainSingle(x => x.FullName == \"Microsoft.CodeAnalysis.Compilation\", \"it should return classes\")\n            .And.ContainSingle(x => x.FullName == \"Microsoft.CodeAnalysis.SymbolInfo\", \"it should return structs\")\n            .And.ContainSingle(x => x.FullName == \"Microsoft.CodeAnalysis.SyntaxList`1\", \"it should return generic types\")\n            .And.ContainSingle(x => x.FullName == \"Microsoft.CodeAnalysis.IOperation+OperationList\", \"it should return nested types\")\n            .And.ContainSingle(x => x.FullName == \"Microsoft.CodeAnalysis.OutputKind\", \"it should return enums\")\n            .And.ContainSingle(x => x.FullName == \"Microsoft.CodeAnalysis.IMethodSymbol\", \"it should return interfaces\")\n            .And.NotContain(x => !x.IsEnum && !x.IsGenericType && !x.IsInterface && !x.IsNested && !x.IsClass && !x.IsValueType, \"there should be no unexpected types\");\n    }\n\n    [TestMethod]\n    public void Load_InheritedMembers()\n    {\n        using var typeLoader = new TypeLoader();\n        typeLoader.LoadLatest().Single(x => x.Type.FullName == \"Microsoft.CodeAnalysis.CSharp.CSharpCompilation\").Members.Should()\n            .ContainSingle(x => x.DeclaringType.Name == \"Compilation\" && x.ToString() == \"Microsoft.CodeAnalysis.Compilation RemoveAllSyntaxTrees()\", \"it's in the base type\")\n            .And.ContainSingle(x => x.DeclaringType.Name == \"CSharpCompilation\" && x.ToString() == \"Microsoft.CodeAnalysis.CSharp.CSharpCompilation RemoveAllSyntaxTrees()\", \"it shadows\")\n            .And.ContainSingle(x => x.DeclaringType.Name == \"Compilation\" && x.ToString() == \"System.Boolean ContainsSyntaxTree(Microsoft.CodeAnalysis.SyntaxTree)\", \"it's in the base type\")\n            .And.ContainSingle(x => x.DeclaringType.Name == \"CSharpCompilation\" && x.ToString() == \"Microsoft.CodeAnalysis.CSharp.CSharpCompilation RemoveAllSyntaxTrees()\", \"it overrides\")\n            .And.ContainSingle(x => x.DeclaringType.Name == \"Object\" && x.ToString() == \"System.Int32 GetHashCode()\", \"it should contain all members down to System.Object\");\n    }\n\n    [TestMethod]\n    public void Load_ContainsInheritedInterfaces()\n    {\n        using var typeLoader = new TypeLoader();\n        typeLoader.LoadLatest().Single(x => x.Type.FullName == \"Microsoft.CodeAnalysis.IMethodSymbol\").Members.Should()\n            .ContainSingle(x => x.DeclaringType.Name == \"IMethodSymbol\" && x.ToString() == \"System.Boolean IsGenericMethod\")\n            .And.ContainSingle(x => x.DeclaringType.Name == \"ISymbol\" && x.ToString() == \"System.String Name\", \"it's from the base interface\");\n    }\n\n    [TestMethod]\n    public void Load_ExplicitInterfaces_Ignored()\n    {\n        const string ImplicitInterface = \"IFormattable\";\n        const string ImplicitInterfaceMember = \"System.String ToString(System.String, System.IFormatProvider)\";\n        using var typeLoader = new TypeLoader();\n        var node = typeLoader.LoadLatest().Single(x => x.Type.FullName == \"Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode\");\n        // Make sure that the member exists on the type (it's explicit interface implementation)\n        node.Type.GetInterface(ImplicitInterface).Should().NotBeNull(\"CSharpSyntaxNode implements IFormattable\")\n            .And.Subject.GetMembers().Should().ContainSingle(x => x.ToString() == ImplicitInterfaceMember);\n        // Then assert with that member\n        node.Members.Should().NotContain(x => x.ToString() == ImplicitInterfaceMember);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#AccessorDeclarationSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class AccessorDeclarationSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(AccessorDeclarationSyntax);\n\n    private static readonly Func<AccessorDeclarationSyntax, ArrowExpressionClauseSyntax> ExpressionBodyAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<AccessorDeclarationSyntax, ArrowExpressionClauseSyntax>(WrappedType, \"ExpressionBody\");\n\n    extension(AccessorDeclarationSyntax @this)\n    {\n        public ArrowExpressionClauseSyntax ExpressionBody => ExpressionBodyAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#AliasQualifiedNameSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class AliasQualifiedNameSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(AliasQualifiedNameSyntax);\n\n    private static readonly Func<AliasQualifiedNameSyntax, Boolean> IsUnmanagedAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<AliasQualifiedNameSyntax, Boolean>(WrappedType, \"IsUnmanaged\");\n\n    private static readonly Func<AliasQualifiedNameSyntax, Boolean> IsNotNullAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<AliasQualifiedNameSyntax, Boolean>(WrappedType, \"IsNotNull\");\n\n    private static readonly Func<AliasQualifiedNameSyntax, Boolean> IsNintAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<AliasQualifiedNameSyntax, Boolean>(WrappedType, \"IsNint\");\n\n    private static readonly Func<AliasQualifiedNameSyntax, Boolean> IsNuintAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<AliasQualifiedNameSyntax, Boolean>(WrappedType, \"IsNuint\");\n\n    extension(AliasQualifiedNameSyntax @this)\n    {\n        public Boolean IsUnmanaged => (Boolean)IsUnmanagedAccessor(@this);\n        public Boolean IsNotNull => (Boolean)IsNotNullAccessor(@this);\n        public Boolean IsNint => (Boolean)IsNintAccessor(@this);\n        public Boolean IsNuint => (Boolean)IsNuintAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#AllowsConstraintClauseSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct AllowsConstraintClauseSyntaxWrapper: ISyntaxWrapper<TypeParameterConstraintSyntax>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.AllowsConstraintClauseSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly TypeParameterConstraintSyntax node;\n\n    static AllowsConstraintClauseSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(AllowsConstraintClauseSyntaxWrapper));\n        AllowsKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeParameterConstraintSyntax, SyntaxToken>(WrappedType, \"AllowsKeyword\");\n        ConstraintsAccessor = LightupHelpers.CreateSeparatedSyntaxListPropertyAccessor<TypeParameterConstraintSyntax, AllowsConstraintSyntaxWrapper>(WrappedType, nameof(Constraints));\n    }\n\n    private AllowsConstraintClauseSyntaxWrapper(TypeParameterConstraintSyntax node) =>\n        this.node = node;\n\n    public TypeParameterConstraintSyntax Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public TypeParameterConstraintSyntax SyntaxNode => this.node;\n\n    private static readonly Func<TypeParameterConstraintSyntax, SyntaxToken> AllowsKeywordAccessor;\n    public SyntaxToken AllowsKeyword => (SyntaxToken)AllowsKeywordAccessor(this.node);\n    private static readonly Func<TypeParameterConstraintSyntax, SeparatedSyntaxListWrapper<AllowsConstraintSyntaxWrapper>> ConstraintsAccessor;\n    public SeparatedSyntaxListWrapper<AllowsConstraintSyntaxWrapper> Constraints => ConstraintsAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator AllowsConstraintClauseSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new AllowsConstraintClauseSyntaxWrapper((TypeParameterConstraintSyntax)node);\n    }\n\n    public static implicit operator TypeParameterConstraintSyntax(AllowsConstraintClauseSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#AllowsConstraintSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct AllowsConstraintSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.AllowsConstraintSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static AllowsConstraintSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(AllowsConstraintSyntaxWrapper));\n\n    }\n\n    private AllowsConstraintSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator AllowsConstraintSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new AllowsConstraintSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(AllowsConstraintSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#AnonymousFunctionExpressionSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class AnonymousFunctionExpressionSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(AnonymousFunctionExpressionSyntax);\n\n    private static readonly Func<AnonymousFunctionExpressionSyntax, SyntaxTokenList> ModifiersAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<AnonymousFunctionExpressionSyntax, SyntaxTokenList>(WrappedType, \"Modifiers\");\n\n    private static readonly Func<AnonymousFunctionExpressionSyntax, BlockSyntax> BlockAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<AnonymousFunctionExpressionSyntax, BlockSyntax>(WrappedType, \"Block\");\n\n    private static readonly Func<AnonymousFunctionExpressionSyntax, ExpressionSyntax> ExpressionBodyAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<AnonymousFunctionExpressionSyntax, ExpressionSyntax>(WrappedType, \"ExpressionBody\");\n\n    extension(AnonymousFunctionExpressionSyntax @this)\n    {\n        public SyntaxTokenList Modifiers => (SyntaxTokenList)ModifiersAccessor(@this);\n        public BlockSyntax Block => BlockAccessor(@this);\n        public ExpressionSyntax ExpressionBody => ExpressionBodyAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#AnonymousMethodExpressionSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class AnonymousMethodExpressionSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(AnonymousMethodExpressionSyntax);\n\n    private static readonly Func<AnonymousMethodExpressionSyntax, SyntaxTokenList> ModifiersAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<AnonymousMethodExpressionSyntax, SyntaxTokenList>(WrappedType, \"Modifiers\");\n\n    private static readonly Func<AnonymousMethodExpressionSyntax, ExpressionSyntax> ExpressionBodyAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<AnonymousMethodExpressionSyntax, ExpressionSyntax>(WrappedType, \"ExpressionBody\");\n\n    extension(AnonymousMethodExpressionSyntax @this)\n    {\n        public SyntaxTokenList Modifiers => (SyntaxTokenList)ModifiersAccessor(@this);\n        public ExpressionSyntax ExpressionBody => ExpressionBodyAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ArgumentKind.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic enum ArgumentKind : System.Int32\n{\n    None = 0,\n    Explicit = 1,\n    ParamArray = 2,\n    DefaultValue = 3,\n    ParamCollection = 4,\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ArgumentSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class ArgumentSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(ArgumentSyntax);\n\n    private static readonly Func<ArgumentSyntax, SyntaxToken> RefKindKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ArgumentSyntax, SyntaxToken>(WrappedType, \"RefKindKeyword\");\n\n    extension(ArgumentSyntax @this)\n    {\n        public SyntaxToken RefKindKeyword => (SyntaxToken)RefKindKeywordAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ArrayTypeSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class ArrayTypeSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(ArrayTypeSyntax);\n\n    private static readonly Func<ArrayTypeSyntax, Boolean> IsUnmanagedAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ArrayTypeSyntax, Boolean>(WrappedType, \"IsUnmanaged\");\n\n    private static readonly Func<ArrayTypeSyntax, Boolean> IsNotNullAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ArrayTypeSyntax, Boolean>(WrappedType, \"IsNotNull\");\n\n    private static readonly Func<ArrayTypeSyntax, Boolean> IsNintAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ArrayTypeSyntax, Boolean>(WrappedType, \"IsNint\");\n\n    private static readonly Func<ArrayTypeSyntax, Boolean> IsNuintAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ArrayTypeSyntax, Boolean>(WrappedType, \"IsNuint\");\n\n    extension(ArrayTypeSyntax @this)\n    {\n        public Boolean IsUnmanaged => (Boolean)IsUnmanagedAccessor(@this);\n        public Boolean IsNotNull => (Boolean)IsNotNullAccessor(@this);\n        public Boolean IsNint => (Boolean)IsNintAccessor(@this);\n        public Boolean IsNuint => (Boolean)IsNuintAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#BaseExpressionColonSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct BaseExpressionColonSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.BaseExpressionColonSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static BaseExpressionColonSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(BaseExpressionColonSyntaxWrapper));\n        ExpressionAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, ExpressionSyntax>(WrappedType, \"Expression\");\n        ColonTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxToken>(WrappedType, \"ColonToken\");\n    }\n\n    private BaseExpressionColonSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    private static readonly Func<CSharpSyntaxNode, ExpressionSyntax> ExpressionAccessor;\n    public ExpressionSyntax Expression => ExpressionAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, SyntaxToken> ColonTokenAccessor;\n    public SyntaxToken ColonToken => (SyntaxToken)ColonTokenAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator BaseExpressionColonSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new BaseExpressionColonSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(BaseExpressionColonSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#BaseMethodDeclarationSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class BaseMethodDeclarationSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(BaseMethodDeclarationSyntax);\n\n    private static readonly Func<BaseMethodDeclarationSyntax, ArrowExpressionClauseSyntax> ExpressionBodyAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<BaseMethodDeclarationSyntax, ArrowExpressionClauseSyntax>(WrappedType, \"ExpressionBody\");\n\n    extension(BaseMethodDeclarationSyntax @this)\n    {\n        public ArrowExpressionClauseSyntax ExpressionBody => ExpressionBodyAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#BaseNamespaceDeclarationSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct BaseNamespaceDeclarationSyntaxWrapper: ISyntaxWrapper<MemberDeclarationSyntax>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.BaseNamespaceDeclarationSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly MemberDeclarationSyntax node;\n\n    static BaseNamespaceDeclarationSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(BaseNamespaceDeclarationSyntaxWrapper));\n        NamespaceKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<MemberDeclarationSyntax, SyntaxToken>(WrappedType, \"NamespaceKeyword\");\n        NameAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<MemberDeclarationSyntax, NameSyntax>(WrappedType, \"Name\");\n        ExternsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<MemberDeclarationSyntax, SyntaxList<ExternAliasDirectiveSyntax>>(WrappedType, \"Externs\");\n        UsingsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<MemberDeclarationSyntax, SyntaxList<UsingDirectiveSyntax>>(WrappedType, \"Usings\");\n        MembersAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<MemberDeclarationSyntax, SyntaxList<MemberDeclarationSyntax>>(WrappedType, \"Members\");\n        AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<MemberDeclarationSyntax, SyntaxList<AttributeListSyntax>>(WrappedType, \"AttributeLists\");\n        ModifiersAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<MemberDeclarationSyntax, SyntaxTokenList>(WrappedType, \"Modifiers\");\n    }\n\n    private BaseNamespaceDeclarationSyntaxWrapper(MemberDeclarationSyntax node) =>\n        this.node = node;\n\n    public MemberDeclarationSyntax Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public MemberDeclarationSyntax SyntaxNode => this.node;\n\n    private static readonly Func<MemberDeclarationSyntax, SyntaxToken> NamespaceKeywordAccessor;\n    public SyntaxToken NamespaceKeyword => (SyntaxToken)NamespaceKeywordAccessor(this.node);\n    private static readonly Func<MemberDeclarationSyntax, NameSyntax> NameAccessor;\n    public NameSyntax Name => NameAccessor(this.node);\n    private static readonly Func<MemberDeclarationSyntax, SyntaxList<ExternAliasDirectiveSyntax>> ExternsAccessor;\n    public SyntaxList<ExternAliasDirectiveSyntax> Externs => (SyntaxList<ExternAliasDirectiveSyntax>)ExternsAccessor(this.node);\n    private static readonly Func<MemberDeclarationSyntax, SyntaxList<UsingDirectiveSyntax>> UsingsAccessor;\n    public SyntaxList<UsingDirectiveSyntax> Usings => (SyntaxList<UsingDirectiveSyntax>)UsingsAccessor(this.node);\n    private static readonly Func<MemberDeclarationSyntax, SyntaxList<MemberDeclarationSyntax>> MembersAccessor;\n    public SyntaxList<MemberDeclarationSyntax> Members => (SyntaxList<MemberDeclarationSyntax>)MembersAccessor(this.node);\n    private static readonly Func<MemberDeclarationSyntax, SyntaxList<AttributeListSyntax>> AttributeListsAccessor;\n    public SyntaxList<AttributeListSyntax> AttributeLists => (SyntaxList<AttributeListSyntax>)AttributeListsAccessor(this.node);\n    private static readonly Func<MemberDeclarationSyntax, SyntaxTokenList> ModifiersAccessor;\n    public SyntaxTokenList Modifiers => (SyntaxTokenList)ModifiersAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator BaseNamespaceDeclarationSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new BaseNamespaceDeclarationSyntaxWrapper((MemberDeclarationSyntax)node);\n    }\n\n    public static implicit operator MemberDeclarationSyntax(BaseNamespaceDeclarationSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#BaseObjectCreationExpressionSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct BaseObjectCreationExpressionSyntaxWrapper: ISyntaxWrapper<ExpressionSyntax>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.BaseObjectCreationExpressionSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly ExpressionSyntax node;\n\n    static BaseObjectCreationExpressionSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(BaseObjectCreationExpressionSyntaxWrapper));\n        NewKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ExpressionSyntax, SyntaxToken>(WrappedType, \"NewKeyword\");\n        ArgumentListAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ExpressionSyntax, ArgumentListSyntax>(WrappedType, \"ArgumentList\");\n        InitializerAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ExpressionSyntax, InitializerExpressionSyntax>(WrappedType, \"Initializer\");\n    }\n\n    private BaseObjectCreationExpressionSyntaxWrapper(ExpressionSyntax node) =>\n        this.node = node;\n\n    public ExpressionSyntax Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public ExpressionSyntax SyntaxNode => this.node;\n\n    private static readonly Func<ExpressionSyntax, SyntaxToken> NewKeywordAccessor;\n    public SyntaxToken NewKeyword => (SyntaxToken)NewKeywordAccessor(this.node);\n    private static readonly Func<ExpressionSyntax, ArgumentListSyntax> ArgumentListAccessor;\n    public ArgumentListSyntax ArgumentList => ArgumentListAccessor(this.node);\n    private static readonly Func<ExpressionSyntax, InitializerExpressionSyntax> InitializerAccessor;\n    public InitializerExpressionSyntax Initializer => InitializerAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator BaseObjectCreationExpressionSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new BaseObjectCreationExpressionSyntaxWrapper((ExpressionSyntax)node);\n    }\n\n    public static implicit operator ExpressionSyntax(BaseObjectCreationExpressionSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#BaseParameterSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct BaseParameterSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.BaseParameterSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static BaseParameterSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(BaseParameterSyntaxWrapper));\n        AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxList<AttributeListSyntax>>(WrappedType, \"AttributeLists\");\n        ModifiersAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxTokenList>(WrappedType, \"Modifiers\");\n        TypeAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, TypeSyntax>(WrappedType, \"Type\");\n    }\n\n    private BaseParameterSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    private static readonly Func<CSharpSyntaxNode, SyntaxList<AttributeListSyntax>> AttributeListsAccessor;\n    public SyntaxList<AttributeListSyntax> AttributeLists => (SyntaxList<AttributeListSyntax>)AttributeListsAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, SyntaxTokenList> ModifiersAccessor;\n    public SyntaxTokenList Modifiers => (SyntaxTokenList)ModifiersAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, TypeSyntax> TypeAccessor;\n    public TypeSyntax Type => TypeAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator BaseParameterSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new BaseParameterSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(BaseParameterSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#BasicBlockKind.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic enum BasicBlockKind : System.Int32\n{\n    Entry = 0,\n    Exit = 1,\n    Block = 2,\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#BinaryOperatorKind.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic enum BinaryOperatorKind : System.Int32\n{\n    None = 0,\n    Add = 1,\n    Subtract = 2,\n    Multiply = 3,\n    Divide = 4,\n    IntegerDivide = 5,\n    Remainder = 6,\n    Power = 7,\n    LeftShift = 8,\n    RightShift = 9,\n    And = 10,\n    Or = 11,\n    ExclusiveOr = 12,\n    ConditionalAnd = 13,\n    ConditionalOr = 14,\n    Concatenate = 15,\n    Equals = 16,\n    ObjectValueEquals = 17,\n    NotEquals = 18,\n    ObjectValueNotEquals = 19,\n    LessThan = 20,\n    LessThanOrEqual = 21,\n    GreaterThanOrEqual = 22,\n    GreaterThan = 23,\n    Like = 24,\n    UnsignedRightShift = 25,\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#BinaryPatternSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct BinaryPatternSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.BinaryPatternSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static BinaryPatternSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(BinaryPatternSyntaxWrapper));\n        LeftAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, CSharpSyntaxNode>(WrappedType, \"Left\");\n        OperatorTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxToken>(WrappedType, \"OperatorToken\");\n        RightAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, CSharpSyntaxNode>(WrappedType, \"Right\");\n    }\n\n    private BinaryPatternSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    private static readonly Func<CSharpSyntaxNode, CSharpSyntaxNode> LeftAccessor;\n    public PatternSyntaxWrapper Left => (PatternSyntaxWrapper)LeftAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, SyntaxToken> OperatorTokenAccessor;\n    public SyntaxToken OperatorToken => (SyntaxToken)OperatorTokenAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, CSharpSyntaxNode> RightAccessor;\n    public PatternSyntaxWrapper Right => (PatternSyntaxWrapper)RightAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator BinaryPatternSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new BinaryPatternSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(BinaryPatternSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static implicit operator PatternSyntaxWrapper(BinaryPatternSyntaxWrapper up) => (PatternSyntaxWrapper)up.SyntaxNode;\n    public static explicit operator BinaryPatternSyntaxWrapper(PatternSyntaxWrapper down) => (BinaryPatternSyntaxWrapper)down.SyntaxNode;\n\n    public static implicit operator ExpressionOrPatternSyntaxWrapper(BinaryPatternSyntaxWrapper up) => (ExpressionOrPatternSyntaxWrapper)up.SyntaxNode;\n    public static explicit operator BinaryPatternSyntaxWrapper(ExpressionOrPatternSyntaxWrapper down) => (BinaryPatternSyntaxWrapper)down.SyntaxNode;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#BlockSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class BlockSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(BlockSyntax);\n\n    private static readonly Func<BlockSyntax, SyntaxList<AttributeListSyntax>> AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<BlockSyntax, SyntaxList<AttributeListSyntax>>(WrappedType, \"AttributeLists\");\n\n    extension(BlockSyntax @this)\n    {\n        public SyntaxList<AttributeListSyntax> AttributeLists => (SyntaxList<AttributeListSyntax>)AttributeListsAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#BranchKind.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic enum BranchKind : System.Int32\n{\n    None = 0,\n    Continue = 1,\n    Break = 2,\n    GoTo = 3,\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#BreakStatementSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class BreakStatementSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(BreakStatementSyntax);\n\n    private static readonly Func<BreakStatementSyntax, SyntaxList<AttributeListSyntax>> AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<BreakStatementSyntax, SyntaxList<AttributeListSyntax>>(WrappedType, \"AttributeLists\");\n\n    extension(BreakStatementSyntax @this)\n    {\n        public SyntaxList<AttributeListSyntax> AttributeLists => (SyntaxList<AttributeListSyntax>)AttributeListsAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#CaseKind.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic enum CaseKind : System.Int32\n{\n    None = 0,\n    SingleValue = 1,\n    Relational = 2,\n    Range = 3,\n    Default = 4,\n    Pattern = 5,\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#CasePatternSwitchLabelSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct CasePatternSwitchLabelSyntaxWrapper: ISyntaxWrapper<SwitchLabelSyntax>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.CasePatternSwitchLabelSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly SwitchLabelSyntax node;\n\n    static CasePatternSwitchLabelSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(CasePatternSwitchLabelSyntaxWrapper));\n        PatternAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<SwitchLabelSyntax, CSharpSyntaxNode>(WrappedType, \"Pattern\");\n        WhenClauseAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<SwitchLabelSyntax, CSharpSyntaxNode>(WrappedType, \"WhenClause\");\n    }\n\n    private CasePatternSwitchLabelSyntaxWrapper(SwitchLabelSyntax node) =>\n        this.node = node;\n\n    public SwitchLabelSyntax Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public SwitchLabelSyntax SyntaxNode => this.node;\n\n    public SyntaxToken Keyword => this.node.Keyword;\n    private static readonly Func<SwitchLabelSyntax, CSharpSyntaxNode> PatternAccessor;\n    public PatternSyntaxWrapper Pattern => (PatternSyntaxWrapper)PatternAccessor(this.node);\n    private static readonly Func<SwitchLabelSyntax, CSharpSyntaxNode> WhenClauseAccessor;\n    public WhenClauseSyntaxWrapper WhenClause => (WhenClauseSyntaxWrapper)WhenClauseAccessor(this.node);\n    public SyntaxToken ColonToken => this.node.ColonToken;\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator CasePatternSwitchLabelSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new CasePatternSwitchLabelSyntaxWrapper((SwitchLabelSyntax)node);\n    }\n\n    public static implicit operator SwitchLabelSyntax(CasePatternSwitchLabelSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#CheckedStatementSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class CheckedStatementSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(CheckedStatementSyntax);\n\n    private static readonly Func<CheckedStatementSyntax, SyntaxList<AttributeListSyntax>> AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CheckedStatementSyntax, SyntaxList<AttributeListSyntax>>(WrappedType, \"AttributeLists\");\n\n    extension(CheckedStatementSyntax @this)\n    {\n        public SyntaxList<AttributeListSyntax> AttributeLists => (SyntaxList<AttributeListSyntax>)AttributeListsAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ClassDeclarationSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class ClassDeclarationSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(ClassDeclarationSyntax);\n\n    private static readonly Func<ClassDeclarationSyntax, ParameterListSyntax> ParameterListAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ClassDeclarationSyntax, ParameterListSyntax>(WrappedType, \"ParameterList\");\n\n    extension(ClassDeclarationSyntax @this)\n    {\n        public ParameterListSyntax ParameterList => ParameterListAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ClassOrStructConstraintSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class ClassOrStructConstraintSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(ClassOrStructConstraintSyntax);\n\n    private static readonly Func<ClassOrStructConstraintSyntax, SyntaxToken> QuestionTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ClassOrStructConstraintSyntax, SyntaxToken>(WrappedType, \"QuestionToken\");\n\n    extension(ClassOrStructConstraintSyntax @this)\n    {\n        public SyntaxToken QuestionToken => (SyntaxToken)QuestionTokenAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#CollectionElementSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct CollectionElementSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.CollectionElementSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static CollectionElementSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(CollectionElementSyntaxWrapper));\n\n    }\n\n    private CollectionElementSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator CollectionElementSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new CollectionElementSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(CollectionElementSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#CollectionExpressionSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct CollectionExpressionSyntaxWrapper: ISyntaxWrapper<ExpressionSyntax>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.CollectionExpressionSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly ExpressionSyntax node;\n\n    static CollectionExpressionSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(CollectionExpressionSyntaxWrapper));\n        OpenBracketTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ExpressionSyntax, SyntaxToken>(WrappedType, \"OpenBracketToken\");\n        ElementsAccessor = LightupHelpers.CreateSeparatedSyntaxListPropertyAccessor<ExpressionSyntax, CollectionElementSyntaxWrapper>(WrappedType, nameof(Elements));\n        CloseBracketTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ExpressionSyntax, SyntaxToken>(WrappedType, \"CloseBracketToken\");\n    }\n\n    private CollectionExpressionSyntaxWrapper(ExpressionSyntax node) =>\n        this.node = node;\n\n    public ExpressionSyntax Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public ExpressionSyntax SyntaxNode => this.node;\n\n    private static readonly Func<ExpressionSyntax, SyntaxToken> OpenBracketTokenAccessor;\n    public SyntaxToken OpenBracketToken => (SyntaxToken)OpenBracketTokenAccessor(this.node);\n    private static readonly Func<ExpressionSyntax, SeparatedSyntaxListWrapper<CollectionElementSyntaxWrapper>> ElementsAccessor;\n    public SeparatedSyntaxListWrapper<CollectionElementSyntaxWrapper> Elements => ElementsAccessor(this.node);\n    private static readonly Func<ExpressionSyntax, SyntaxToken> CloseBracketTokenAccessor;\n    public SyntaxToken CloseBracketToken => (SyntaxToken)CloseBracketTokenAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator CollectionExpressionSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new CollectionExpressionSyntaxWrapper((ExpressionSyntax)node);\n    }\n\n    public static implicit operator ExpressionSyntax(CollectionExpressionSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#CommonForEachStatementSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct CommonForEachStatementSyntaxWrapper: ISyntaxWrapper<StatementSyntax>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.CommonForEachStatementSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly StatementSyntax node;\n\n    static CommonForEachStatementSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(CommonForEachStatementSyntaxWrapper));\n        AwaitKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<StatementSyntax, SyntaxToken>(WrappedType, \"AwaitKeyword\");\n        ForEachKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<StatementSyntax, SyntaxToken>(WrappedType, \"ForEachKeyword\");\n        OpenParenTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<StatementSyntax, SyntaxToken>(WrappedType, \"OpenParenToken\");\n        InKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<StatementSyntax, SyntaxToken>(WrappedType, \"InKeyword\");\n        ExpressionAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<StatementSyntax, ExpressionSyntax>(WrappedType, \"Expression\");\n        CloseParenTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<StatementSyntax, SyntaxToken>(WrappedType, \"CloseParenToken\");\n        StatementAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<StatementSyntax, StatementSyntax>(WrappedType, \"Statement\");\n        AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<StatementSyntax, SyntaxList<AttributeListSyntax>>(WrappedType, \"AttributeLists\");\n    }\n\n    private CommonForEachStatementSyntaxWrapper(StatementSyntax node) =>\n        this.node = node;\n\n    public StatementSyntax Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public StatementSyntax SyntaxNode => this.node;\n\n    private static readonly Func<StatementSyntax, SyntaxToken> AwaitKeywordAccessor;\n    public SyntaxToken AwaitKeyword => (SyntaxToken)AwaitKeywordAccessor(this.node);\n    private static readonly Func<StatementSyntax, SyntaxToken> ForEachKeywordAccessor;\n    public SyntaxToken ForEachKeyword => (SyntaxToken)ForEachKeywordAccessor(this.node);\n    private static readonly Func<StatementSyntax, SyntaxToken> OpenParenTokenAccessor;\n    public SyntaxToken OpenParenToken => (SyntaxToken)OpenParenTokenAccessor(this.node);\n    private static readonly Func<StatementSyntax, SyntaxToken> InKeywordAccessor;\n    public SyntaxToken InKeyword => (SyntaxToken)InKeywordAccessor(this.node);\n    private static readonly Func<StatementSyntax, ExpressionSyntax> ExpressionAccessor;\n    public ExpressionSyntax Expression => ExpressionAccessor(this.node);\n    private static readonly Func<StatementSyntax, SyntaxToken> CloseParenTokenAccessor;\n    public SyntaxToken CloseParenToken => (SyntaxToken)CloseParenTokenAccessor(this.node);\n    private static readonly Func<StatementSyntax, StatementSyntax> StatementAccessor;\n    public StatementSyntax Statement => StatementAccessor(this.node);\n    private static readonly Func<StatementSyntax, SyntaxList<AttributeListSyntax>> AttributeListsAccessor;\n    public SyntaxList<AttributeListSyntax> AttributeLists => (SyntaxList<AttributeListSyntax>)AttributeListsAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator CommonForEachStatementSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new CommonForEachStatementSyntaxWrapper((StatementSyntax)node);\n    }\n\n    public static implicit operator StatementSyntax(CommonForEachStatementSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ConstantPatternSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct ConstantPatternSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.ConstantPatternSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static ConstantPatternSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(ConstantPatternSyntaxWrapper));\n        ExpressionAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, ExpressionSyntax>(WrappedType, \"Expression\");\n    }\n\n    private ConstantPatternSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    private static readonly Func<CSharpSyntaxNode, ExpressionSyntax> ExpressionAccessor;\n    public ExpressionSyntax Expression => ExpressionAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator ConstantPatternSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new ConstantPatternSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(ConstantPatternSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static implicit operator PatternSyntaxWrapper(ConstantPatternSyntaxWrapper up) => (PatternSyntaxWrapper)up.SyntaxNode;\n    public static explicit operator ConstantPatternSyntaxWrapper(PatternSyntaxWrapper down) => (ConstantPatternSyntaxWrapper)down.SyntaxNode;\n\n    public static implicit operator ExpressionOrPatternSyntaxWrapper(ConstantPatternSyntaxWrapper up) => (ExpressionOrPatternSyntaxWrapper)up.SyntaxNode;\n    public static explicit operator ConstantPatternSyntaxWrapper(ExpressionOrPatternSyntaxWrapper down) => (ConstantPatternSyntaxWrapper)down.SyntaxNode;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ConstructorDeclarationSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class ConstructorDeclarationSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(ConstructorDeclarationSyntax);\n\n    private static readonly Func<ConstructorDeclarationSyntax, ArrowExpressionClauseSyntax> ExpressionBodyAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ConstructorDeclarationSyntax, ArrowExpressionClauseSyntax>(WrappedType, \"ExpressionBody\");\n\n    extension(ConstructorDeclarationSyntax @this)\n    {\n        public ArrowExpressionClauseSyntax ExpressionBody => ExpressionBodyAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ContinueStatementSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class ContinueStatementSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(ContinueStatementSyntax);\n\n    private static readonly Func<ContinueStatementSyntax, SyntaxList<AttributeListSyntax>> AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ContinueStatementSyntax, SyntaxList<AttributeListSyntax>>(WrappedType, \"AttributeLists\");\n\n    extension(ContinueStatementSyntax @this)\n    {\n        public SyntaxList<AttributeListSyntax> AttributeLists => (SyntaxList<AttributeListSyntax>)AttributeListsAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ControlFlowBranchSemantics.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic enum ControlFlowBranchSemantics : System.Int32\n{\n    None = 0,\n    Regular = 1,\n    Return = 2,\n    StructuredExceptionHandling = 3,\n    ProgramTermination = 4,\n    Throw = 5,\n    Rethrow = 6,\n    Error = 7,\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ControlFlowConditionKind.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic enum ControlFlowConditionKind : System.Int32\n{\n    None = 0,\n    WhenFalse = 1,\n    WhenTrue = 2,\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ControlFlowRegionKind.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic enum ControlFlowRegionKind : System.Int32\n{\n    Root = 0,\n    LocalLifetime = 1,\n    Try = 2,\n    Filter = 3,\n    Catch = 4,\n    FilterAndHandler = 5,\n    TryAndCatch = 6,\n    Finally = 7,\n    TryAndFinally = 8,\n    StaticLocalInitializer = 9,\n    ErroneousBody = 10,\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ConversionOperatorDeclarationSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class ConversionOperatorDeclarationSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(ConversionOperatorDeclarationSyntax);\n\n    private static readonly Func<ConversionOperatorDeclarationSyntax, ExplicitInterfaceSpecifierSyntax> ExplicitInterfaceSpecifierAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ConversionOperatorDeclarationSyntax, ExplicitInterfaceSpecifierSyntax>(WrappedType, \"ExplicitInterfaceSpecifier\");\n\n    private static readonly Func<ConversionOperatorDeclarationSyntax, SyntaxToken> CheckedKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ConversionOperatorDeclarationSyntax, SyntaxToken>(WrappedType, \"CheckedKeyword\");\n\n    extension(ConversionOperatorDeclarationSyntax @this)\n    {\n        public ExplicitInterfaceSpecifierSyntax ExplicitInterfaceSpecifier => ExplicitInterfaceSpecifierAccessor(@this);\n        public SyntaxToken CheckedKeyword => (SyntaxToken)CheckedKeywordAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ConversionOperatorMemberCrefSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class ConversionOperatorMemberCrefSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(ConversionOperatorMemberCrefSyntax);\n\n    private static readonly Func<ConversionOperatorMemberCrefSyntax, SyntaxToken> CheckedKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ConversionOperatorMemberCrefSyntax, SyntaxToken>(WrappedType, \"CheckedKeyword\");\n\n    extension(ConversionOperatorMemberCrefSyntax @this)\n    {\n        public SyntaxToken CheckedKeyword => (SyntaxToken)CheckedKeywordAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#CrefParameterSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class CrefParameterSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(CrefParameterSyntax);\n\n    private static readonly Func<CrefParameterSyntax, SyntaxToken> RefKindKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CrefParameterSyntax, SyntaxToken>(WrappedType, \"RefKindKeyword\");\n\n    private static readonly Func<CrefParameterSyntax, SyntaxToken> ReadOnlyKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CrefParameterSyntax, SyntaxToken>(WrappedType, \"ReadOnlyKeyword\");\n\n    extension(CrefParameterSyntax @this)\n    {\n        public SyntaxToken RefKindKeyword => (SyntaxToken)RefKindKeywordAccessor(@this);\n        public SyntaxToken ReadOnlyKeyword => (SyntaxToken)ReadOnlyKeywordAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#DeclarationExpressionSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct DeclarationExpressionSyntaxWrapper: ISyntaxWrapper<ExpressionSyntax>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.DeclarationExpressionSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly ExpressionSyntax node;\n\n    static DeclarationExpressionSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(DeclarationExpressionSyntaxWrapper));\n        TypeAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ExpressionSyntax, TypeSyntax>(WrappedType, \"Type\");\n        DesignationAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ExpressionSyntax, CSharpSyntaxNode>(WrappedType, \"Designation\");\n    }\n\n    private DeclarationExpressionSyntaxWrapper(ExpressionSyntax node) =>\n        this.node = node;\n\n    public ExpressionSyntax Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public ExpressionSyntax SyntaxNode => this.node;\n\n    private static readonly Func<ExpressionSyntax, TypeSyntax> TypeAccessor;\n    public TypeSyntax Type => TypeAccessor(this.node);\n    private static readonly Func<ExpressionSyntax, CSharpSyntaxNode> DesignationAccessor;\n    public VariableDesignationSyntaxWrapper Designation => (VariableDesignationSyntaxWrapper)DesignationAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator DeclarationExpressionSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new DeclarationExpressionSyntaxWrapper((ExpressionSyntax)node);\n    }\n\n    public static implicit operator ExpressionSyntax(DeclarationExpressionSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#DeclarationPatternSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct DeclarationPatternSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.DeclarationPatternSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static DeclarationPatternSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(DeclarationPatternSyntaxWrapper));\n        TypeAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, TypeSyntax>(WrappedType, \"Type\");\n        DesignationAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, CSharpSyntaxNode>(WrappedType, \"Designation\");\n    }\n\n    private DeclarationPatternSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    private static readonly Func<CSharpSyntaxNode, TypeSyntax> TypeAccessor;\n    public TypeSyntax Type => TypeAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, CSharpSyntaxNode> DesignationAccessor;\n    public VariableDesignationSyntaxWrapper Designation => (VariableDesignationSyntaxWrapper)DesignationAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator DeclarationPatternSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new DeclarationPatternSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(DeclarationPatternSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static implicit operator PatternSyntaxWrapper(DeclarationPatternSyntaxWrapper up) => (PatternSyntaxWrapper)up.SyntaxNode;\n    public static explicit operator DeclarationPatternSyntaxWrapper(PatternSyntaxWrapper down) => (DeclarationPatternSyntaxWrapper)down.SyntaxNode;\n\n    public static implicit operator ExpressionOrPatternSyntaxWrapper(DeclarationPatternSyntaxWrapper up) => (ExpressionOrPatternSyntaxWrapper)up.SyntaxNode;\n    public static explicit operator DeclarationPatternSyntaxWrapper(ExpressionOrPatternSyntaxWrapper down) => (DeclarationPatternSyntaxWrapper)down.SyntaxNode;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#DefaultConstraintSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct DefaultConstraintSyntaxWrapper: ISyntaxWrapper<TypeParameterConstraintSyntax>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.DefaultConstraintSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly TypeParameterConstraintSyntax node;\n\n    static DefaultConstraintSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(DefaultConstraintSyntaxWrapper));\n        DefaultKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeParameterConstraintSyntax, SyntaxToken>(WrappedType, \"DefaultKeyword\");\n    }\n\n    private DefaultConstraintSyntaxWrapper(TypeParameterConstraintSyntax node) =>\n        this.node = node;\n\n    public TypeParameterConstraintSyntax Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public TypeParameterConstraintSyntax SyntaxNode => this.node;\n\n    private static readonly Func<TypeParameterConstraintSyntax, SyntaxToken> DefaultKeywordAccessor;\n    public SyntaxToken DefaultKeyword => (SyntaxToken)DefaultKeywordAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator DefaultConstraintSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new DefaultConstraintSyntaxWrapper((TypeParameterConstraintSyntax)node);\n    }\n\n    public static implicit operator TypeParameterConstraintSyntax(DefaultConstraintSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#DestructorDeclarationSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class DestructorDeclarationSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(DestructorDeclarationSyntax);\n\n    private static readonly Func<DestructorDeclarationSyntax, ArrowExpressionClauseSyntax> ExpressionBodyAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<DestructorDeclarationSyntax, ArrowExpressionClauseSyntax>(WrappedType, \"ExpressionBody\");\n\n    extension(DestructorDeclarationSyntax @this)\n    {\n        public ArrowExpressionClauseSyntax ExpressionBody => ExpressionBodyAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#DiscardDesignationSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct DiscardDesignationSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.DiscardDesignationSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static DiscardDesignationSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(DiscardDesignationSyntaxWrapper));\n        UnderscoreTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxToken>(WrappedType, \"UnderscoreToken\");\n    }\n\n    private DiscardDesignationSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    private static readonly Func<CSharpSyntaxNode, SyntaxToken> UnderscoreTokenAccessor;\n    public SyntaxToken UnderscoreToken => (SyntaxToken)UnderscoreTokenAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator DiscardDesignationSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new DiscardDesignationSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(DiscardDesignationSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static implicit operator VariableDesignationSyntaxWrapper(DiscardDesignationSyntaxWrapper up) => (VariableDesignationSyntaxWrapper)up.SyntaxNode;\n    public static explicit operator DiscardDesignationSyntaxWrapper(VariableDesignationSyntaxWrapper down) => (DiscardDesignationSyntaxWrapper)down.SyntaxNode;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#DiscardPatternSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct DiscardPatternSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.DiscardPatternSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static DiscardPatternSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(DiscardPatternSyntaxWrapper));\n        UnderscoreTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxToken>(WrappedType, \"UnderscoreToken\");\n    }\n\n    private DiscardPatternSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    private static readonly Func<CSharpSyntaxNode, SyntaxToken> UnderscoreTokenAccessor;\n    public SyntaxToken UnderscoreToken => (SyntaxToken)UnderscoreTokenAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator DiscardPatternSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new DiscardPatternSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(DiscardPatternSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static implicit operator PatternSyntaxWrapper(DiscardPatternSyntaxWrapper up) => (PatternSyntaxWrapper)up.SyntaxNode;\n    public static explicit operator DiscardPatternSyntaxWrapper(PatternSyntaxWrapper down) => (DiscardPatternSyntaxWrapper)down.SyntaxNode;\n\n    public static implicit operator ExpressionOrPatternSyntaxWrapper(DiscardPatternSyntaxWrapper up) => (ExpressionOrPatternSyntaxWrapper)up.SyntaxNode;\n    public static explicit operator DiscardPatternSyntaxWrapper(ExpressionOrPatternSyntaxWrapper down) => (DiscardPatternSyntaxWrapper)down.SyntaxNode;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#DoStatementSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class DoStatementSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(DoStatementSyntax);\n\n    private static readonly Func<DoStatementSyntax, SyntaxList<AttributeListSyntax>> AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<DoStatementSyntax, SyntaxList<AttributeListSyntax>>(WrappedType, \"AttributeLists\");\n\n    extension(DoStatementSyntax @this)\n    {\n        public SyntaxList<AttributeListSyntax> AttributeLists => (SyntaxList<AttributeListSyntax>)AttributeListsAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#EmptyStatementSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class EmptyStatementSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(EmptyStatementSyntax);\n\n    private static readonly Func<EmptyStatementSyntax, SyntaxList<AttributeListSyntax>> AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<EmptyStatementSyntax, SyntaxList<AttributeListSyntax>>(WrappedType, \"AttributeLists\");\n\n    extension(EmptyStatementSyntax @this)\n    {\n        public SyntaxList<AttributeListSyntax> AttributeLists => (SyntaxList<AttributeListSyntax>)AttributeListsAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#EnumMemberDeclarationSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class EnumMemberDeclarationSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(EnumMemberDeclarationSyntax);\n\n    private static readonly Func<EnumMemberDeclarationSyntax, SyntaxTokenList> ModifiersAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<EnumMemberDeclarationSyntax, SyntaxTokenList>(WrappedType, \"Modifiers\");\n\n    extension(EnumMemberDeclarationSyntax @this)\n    {\n        public SyntaxTokenList Modifiers => (SyntaxTokenList)ModifiersAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#EventDeclarationSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class EventDeclarationSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(EventDeclarationSyntax);\n\n    private static readonly Func<EventDeclarationSyntax, SyntaxToken> SemicolonTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<EventDeclarationSyntax, SyntaxToken>(WrappedType, \"SemicolonToken\");\n\n    extension(EventDeclarationSyntax @this)\n    {\n        public SyntaxToken SemicolonToken => (SyntaxToken)SemicolonTokenAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ExpressionColonSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct ExpressionColonSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionColonSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static ExpressionColonSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(ExpressionColonSyntaxWrapper));\n        ExpressionAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, ExpressionSyntax>(WrappedType, \"Expression\");\n        ColonTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxToken>(WrappedType, \"ColonToken\");\n    }\n\n    private ExpressionColonSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    private static readonly Func<CSharpSyntaxNode, ExpressionSyntax> ExpressionAccessor;\n    public ExpressionSyntax Expression => ExpressionAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, SyntaxToken> ColonTokenAccessor;\n    public SyntaxToken ColonToken => (SyntaxToken)ColonTokenAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator ExpressionColonSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new ExpressionColonSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(ExpressionColonSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static implicit operator BaseExpressionColonSyntaxWrapper(ExpressionColonSyntaxWrapper up) => (BaseExpressionColonSyntaxWrapper)up.SyntaxNode;\n    public static explicit operator ExpressionColonSyntaxWrapper(BaseExpressionColonSyntaxWrapper down) => (ExpressionColonSyntaxWrapper)down.SyntaxNode;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ExpressionElementSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct ExpressionElementSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionElementSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static ExpressionElementSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(ExpressionElementSyntaxWrapper));\n        ExpressionAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, ExpressionSyntax>(WrappedType, \"Expression\");\n    }\n\n    private ExpressionElementSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    private static readonly Func<CSharpSyntaxNode, ExpressionSyntax> ExpressionAccessor;\n    public ExpressionSyntax Expression => ExpressionAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator ExpressionElementSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new ExpressionElementSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(ExpressionElementSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static implicit operator CollectionElementSyntaxWrapper(ExpressionElementSyntaxWrapper up) => (CollectionElementSyntaxWrapper)up.SyntaxNode;\n    public static explicit operator ExpressionElementSyntaxWrapper(CollectionElementSyntaxWrapper down) => (ExpressionElementSyntaxWrapper)down.SyntaxNode;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ExpressionOrPatternSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct ExpressionOrPatternSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionOrPatternSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static ExpressionOrPatternSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(ExpressionOrPatternSyntaxWrapper));\n\n    }\n\n    private ExpressionOrPatternSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator ExpressionOrPatternSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new ExpressionOrPatternSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(ExpressionOrPatternSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ExpressionStatementSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class ExpressionStatementSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(ExpressionStatementSyntax);\n\n    private static readonly Func<ExpressionStatementSyntax, SyntaxList<AttributeListSyntax>> AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ExpressionStatementSyntax, SyntaxList<AttributeListSyntax>>(WrappedType, \"AttributeLists\");\n\n    extension(ExpressionStatementSyntax @this)\n    {\n        public SyntaxList<AttributeListSyntax> AttributeLists => (SyntaxList<AttributeListSyntax>)AttributeListsAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ExtensionBlockDeclarationSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct ExtensionBlockDeclarationSyntaxWrapper: ISyntaxWrapper<TypeDeclarationSyntax>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.ExtensionBlockDeclarationSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly TypeDeclarationSyntax node;\n\n    static ExtensionBlockDeclarationSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(ExtensionBlockDeclarationSyntaxWrapper));\n        ParameterListAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeDeclarationSyntax, ParameterListSyntax>(WrappedType, \"ParameterList\");\n    }\n\n    private ExtensionBlockDeclarationSyntaxWrapper(TypeDeclarationSyntax node) =>\n        this.node = node;\n\n    public TypeDeclarationSyntax Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public TypeDeclarationSyntax SyntaxNode => this.node;\n\n    public SyntaxToken Identifier => this.node.Identifier;\n    public BaseListSyntax BaseList => this.node.BaseList;\n    public SyntaxList<AttributeListSyntax> AttributeLists => this.node.AttributeLists;\n    public SyntaxTokenList Modifiers => this.node.Modifiers;\n    public SyntaxToken Keyword => this.node.Keyword;\n    public TypeParameterListSyntax TypeParameterList => this.node.TypeParameterList;\n    private static readonly Func<TypeDeclarationSyntax, ParameterListSyntax> ParameterListAccessor;\n    public ParameterListSyntax ParameterList => ParameterListAccessor(this.node);\n    public SyntaxList<TypeParameterConstraintClauseSyntax> ConstraintClauses => this.node.ConstraintClauses;\n    public SyntaxToken OpenBraceToken => this.node.OpenBraceToken;\n    public SyntaxList<MemberDeclarationSyntax> Members => this.node.Members;\n    public SyntaxToken CloseBraceToken => this.node.CloseBraceToken;\n    public SyntaxToken SemicolonToken => this.node.SemicolonToken;\n    public Int32 Arity => this.node.Arity;\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator ExtensionBlockDeclarationSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new ExtensionBlockDeclarationSyntaxWrapper((TypeDeclarationSyntax)node);\n    }\n\n    public static implicit operator TypeDeclarationSyntax(ExtensionBlockDeclarationSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ExtensionMemberCrefSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct ExtensionMemberCrefSyntaxWrapper: ISyntaxWrapper<MemberCrefSyntax>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.ExtensionMemberCrefSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly MemberCrefSyntax node;\n\n    static ExtensionMemberCrefSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(ExtensionMemberCrefSyntaxWrapper));\n        ExtensionKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<MemberCrefSyntax, SyntaxToken>(WrappedType, \"ExtensionKeyword\");\n        TypeArgumentListAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<MemberCrefSyntax, TypeArgumentListSyntax>(WrappedType, \"TypeArgumentList\");\n        ParametersAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<MemberCrefSyntax, CrefParameterListSyntax>(WrappedType, \"Parameters\");\n        DotTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<MemberCrefSyntax, SyntaxToken>(WrappedType, \"DotToken\");\n        MemberAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<MemberCrefSyntax, MemberCrefSyntax>(WrappedType, \"Member\");\n    }\n\n    private ExtensionMemberCrefSyntaxWrapper(MemberCrefSyntax node) =>\n        this.node = node;\n\n    public MemberCrefSyntax Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public MemberCrefSyntax SyntaxNode => this.node;\n\n    private static readonly Func<MemberCrefSyntax, SyntaxToken> ExtensionKeywordAccessor;\n    public SyntaxToken ExtensionKeyword => (SyntaxToken)ExtensionKeywordAccessor(this.node);\n    private static readonly Func<MemberCrefSyntax, TypeArgumentListSyntax> TypeArgumentListAccessor;\n    public TypeArgumentListSyntax TypeArgumentList => TypeArgumentListAccessor(this.node);\n    private static readonly Func<MemberCrefSyntax, CrefParameterListSyntax> ParametersAccessor;\n    public CrefParameterListSyntax Parameters => ParametersAccessor(this.node);\n    private static readonly Func<MemberCrefSyntax, SyntaxToken> DotTokenAccessor;\n    public SyntaxToken DotToken => (SyntaxToken)DotTokenAccessor(this.node);\n    private static readonly Func<MemberCrefSyntax, MemberCrefSyntax> MemberAccessor;\n    public MemberCrefSyntax Member => MemberAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator ExtensionMemberCrefSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new ExtensionMemberCrefSyntaxWrapper((MemberCrefSyntax)node);\n    }\n\n    public static implicit operator MemberCrefSyntax(ExtensionMemberCrefSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#FieldExpressionSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct FieldExpressionSyntaxWrapper: ISyntaxWrapper<ExpressionSyntax>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.FieldExpressionSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly ExpressionSyntax node;\n\n    static FieldExpressionSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(FieldExpressionSyntaxWrapper));\n        TokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ExpressionSyntax, SyntaxToken>(WrappedType, \"Token\");\n    }\n\n    private FieldExpressionSyntaxWrapper(ExpressionSyntax node) =>\n        this.node = node;\n\n    public ExpressionSyntax Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public ExpressionSyntax SyntaxNode => this.node;\n\n    private static readonly Func<ExpressionSyntax, SyntaxToken> TokenAccessor;\n    public SyntaxToken Token => (SyntaxToken)TokenAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator FieldExpressionSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new FieldExpressionSyntaxWrapper((ExpressionSyntax)node);\n    }\n\n    public static implicit operator ExpressionSyntax(FieldExpressionSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#FileScopedNamespaceDeclarationSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct FileScopedNamespaceDeclarationSyntaxWrapper: ISyntaxWrapper<MemberDeclarationSyntax>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.FileScopedNamespaceDeclarationSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly MemberDeclarationSyntax node;\n\n    static FileScopedNamespaceDeclarationSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(FileScopedNamespaceDeclarationSyntaxWrapper));\n        AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<MemberDeclarationSyntax, SyntaxList<AttributeListSyntax>>(WrappedType, \"AttributeLists\");\n        ModifiersAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<MemberDeclarationSyntax, SyntaxTokenList>(WrappedType, \"Modifiers\");\n        NamespaceKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<MemberDeclarationSyntax, SyntaxToken>(WrappedType, \"NamespaceKeyword\");\n        NameAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<MemberDeclarationSyntax, NameSyntax>(WrappedType, \"Name\");\n        SemicolonTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<MemberDeclarationSyntax, SyntaxToken>(WrappedType, \"SemicolonToken\");\n        ExternsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<MemberDeclarationSyntax, SyntaxList<ExternAliasDirectiveSyntax>>(WrappedType, \"Externs\");\n        UsingsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<MemberDeclarationSyntax, SyntaxList<UsingDirectiveSyntax>>(WrappedType, \"Usings\");\n        MembersAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<MemberDeclarationSyntax, SyntaxList<MemberDeclarationSyntax>>(WrappedType, \"Members\");\n    }\n\n    private FileScopedNamespaceDeclarationSyntaxWrapper(MemberDeclarationSyntax node) =>\n        this.node = node;\n\n    public MemberDeclarationSyntax Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public MemberDeclarationSyntax SyntaxNode => this.node;\n\n    private static readonly Func<MemberDeclarationSyntax, SyntaxList<AttributeListSyntax>> AttributeListsAccessor;\n    public SyntaxList<AttributeListSyntax> AttributeLists => (SyntaxList<AttributeListSyntax>)AttributeListsAccessor(this.node);\n    private static readonly Func<MemberDeclarationSyntax, SyntaxTokenList> ModifiersAccessor;\n    public SyntaxTokenList Modifiers => (SyntaxTokenList)ModifiersAccessor(this.node);\n    private static readonly Func<MemberDeclarationSyntax, SyntaxToken> NamespaceKeywordAccessor;\n    public SyntaxToken NamespaceKeyword => (SyntaxToken)NamespaceKeywordAccessor(this.node);\n    private static readonly Func<MemberDeclarationSyntax, NameSyntax> NameAccessor;\n    public NameSyntax Name => NameAccessor(this.node);\n    private static readonly Func<MemberDeclarationSyntax, SyntaxToken> SemicolonTokenAccessor;\n    public SyntaxToken SemicolonToken => (SyntaxToken)SemicolonTokenAccessor(this.node);\n    private static readonly Func<MemberDeclarationSyntax, SyntaxList<ExternAliasDirectiveSyntax>> ExternsAccessor;\n    public SyntaxList<ExternAliasDirectiveSyntax> Externs => (SyntaxList<ExternAliasDirectiveSyntax>)ExternsAccessor(this.node);\n    private static readonly Func<MemberDeclarationSyntax, SyntaxList<UsingDirectiveSyntax>> UsingsAccessor;\n    public SyntaxList<UsingDirectiveSyntax> Usings => (SyntaxList<UsingDirectiveSyntax>)UsingsAccessor(this.node);\n    private static readonly Func<MemberDeclarationSyntax, SyntaxList<MemberDeclarationSyntax>> MembersAccessor;\n    public SyntaxList<MemberDeclarationSyntax> Members => (SyntaxList<MemberDeclarationSyntax>)MembersAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator FileScopedNamespaceDeclarationSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new FileScopedNamespaceDeclarationSyntaxWrapper((MemberDeclarationSyntax)node);\n    }\n\n    public static implicit operator MemberDeclarationSyntax(FileScopedNamespaceDeclarationSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static implicit operator BaseNamespaceDeclarationSyntaxWrapper(FileScopedNamespaceDeclarationSyntaxWrapper up) => (BaseNamespaceDeclarationSyntaxWrapper)up.SyntaxNode;\n    public static explicit operator FileScopedNamespaceDeclarationSyntaxWrapper(BaseNamespaceDeclarationSyntaxWrapper down) => (FileScopedNamespaceDeclarationSyntaxWrapper)down.SyntaxNode;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#FixedStatementSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class FixedStatementSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(FixedStatementSyntax);\n\n    private static readonly Func<FixedStatementSyntax, SyntaxList<AttributeListSyntax>> AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<FixedStatementSyntax, SyntaxList<AttributeListSyntax>>(WrappedType, \"AttributeLists\");\n\n    extension(FixedStatementSyntax @this)\n    {\n        public SyntaxList<AttributeListSyntax> AttributeLists => (SyntaxList<AttributeListSyntax>)AttributeListsAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ForEachStatementSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class ForEachStatementSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(ForEachStatementSyntax);\n\n    private static readonly Func<ForEachStatementSyntax, SyntaxList<AttributeListSyntax>> AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ForEachStatementSyntax, SyntaxList<AttributeListSyntax>>(WrappedType, \"AttributeLists\");\n\n    private static readonly Func<ForEachStatementSyntax, SyntaxToken> AwaitKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ForEachStatementSyntax, SyntaxToken>(WrappedType, \"AwaitKeyword\");\n\n    extension(ForEachStatementSyntax @this)\n    {\n        public SyntaxList<AttributeListSyntax> AttributeLists => (SyntaxList<AttributeListSyntax>)AttributeListsAccessor(@this);\n        public SyntaxToken AwaitKeyword => (SyntaxToken)AwaitKeywordAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ForEachVariableStatementSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct ForEachVariableStatementSyntaxWrapper: ISyntaxWrapper<StatementSyntax>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly StatementSyntax node;\n\n    static ForEachVariableStatementSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(ForEachVariableStatementSyntaxWrapper));\n        AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<StatementSyntax, SyntaxList<AttributeListSyntax>>(WrappedType, \"AttributeLists\");\n        AwaitKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<StatementSyntax, SyntaxToken>(WrappedType, \"AwaitKeyword\");\n        ForEachKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<StatementSyntax, SyntaxToken>(WrappedType, \"ForEachKeyword\");\n        OpenParenTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<StatementSyntax, SyntaxToken>(WrappedType, \"OpenParenToken\");\n        VariableAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<StatementSyntax, ExpressionSyntax>(WrappedType, \"Variable\");\n        InKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<StatementSyntax, SyntaxToken>(WrappedType, \"InKeyword\");\n        ExpressionAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<StatementSyntax, ExpressionSyntax>(WrappedType, \"Expression\");\n        CloseParenTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<StatementSyntax, SyntaxToken>(WrappedType, \"CloseParenToken\");\n        StatementAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<StatementSyntax, StatementSyntax>(WrappedType, \"Statement\");\n    }\n\n    private ForEachVariableStatementSyntaxWrapper(StatementSyntax node) =>\n        this.node = node;\n\n    public StatementSyntax Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public StatementSyntax SyntaxNode => this.node;\n\n    private static readonly Func<StatementSyntax, SyntaxList<AttributeListSyntax>> AttributeListsAccessor;\n    public SyntaxList<AttributeListSyntax> AttributeLists => (SyntaxList<AttributeListSyntax>)AttributeListsAccessor(this.node);\n    private static readonly Func<StatementSyntax, SyntaxToken> AwaitKeywordAccessor;\n    public SyntaxToken AwaitKeyword => (SyntaxToken)AwaitKeywordAccessor(this.node);\n    private static readonly Func<StatementSyntax, SyntaxToken> ForEachKeywordAccessor;\n    public SyntaxToken ForEachKeyword => (SyntaxToken)ForEachKeywordAccessor(this.node);\n    private static readonly Func<StatementSyntax, SyntaxToken> OpenParenTokenAccessor;\n    public SyntaxToken OpenParenToken => (SyntaxToken)OpenParenTokenAccessor(this.node);\n    private static readonly Func<StatementSyntax, ExpressionSyntax> VariableAccessor;\n    public ExpressionSyntax Variable => VariableAccessor(this.node);\n    private static readonly Func<StatementSyntax, SyntaxToken> InKeywordAccessor;\n    public SyntaxToken InKeyword => (SyntaxToken)InKeywordAccessor(this.node);\n    private static readonly Func<StatementSyntax, ExpressionSyntax> ExpressionAccessor;\n    public ExpressionSyntax Expression => ExpressionAccessor(this.node);\n    private static readonly Func<StatementSyntax, SyntaxToken> CloseParenTokenAccessor;\n    public SyntaxToken CloseParenToken => (SyntaxToken)CloseParenTokenAccessor(this.node);\n    private static readonly Func<StatementSyntax, StatementSyntax> StatementAccessor;\n    public StatementSyntax Statement => StatementAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator ForEachVariableStatementSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new ForEachVariableStatementSyntaxWrapper((StatementSyntax)node);\n    }\n\n    public static implicit operator StatementSyntax(ForEachVariableStatementSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static implicit operator CommonForEachStatementSyntaxWrapper(ForEachVariableStatementSyntaxWrapper up) => (CommonForEachStatementSyntaxWrapper)up.SyntaxNode;\n    public static explicit operator ForEachVariableStatementSyntaxWrapper(CommonForEachStatementSyntaxWrapper down) => (ForEachVariableStatementSyntaxWrapper)down.SyntaxNode;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ForStatementSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class ForStatementSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(ForStatementSyntax);\n\n    private static readonly Func<ForStatementSyntax, SyntaxList<AttributeListSyntax>> AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ForStatementSyntax, SyntaxList<AttributeListSyntax>>(WrappedType, \"AttributeLists\");\n\n    extension(ForStatementSyntax @this)\n    {\n        public SyntaxList<AttributeListSyntax> AttributeLists => (SyntaxList<AttributeListSyntax>)AttributeListsAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#FunctionPointerCallingConventionSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct FunctionPointerCallingConventionSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.FunctionPointerCallingConventionSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static FunctionPointerCallingConventionSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(FunctionPointerCallingConventionSyntaxWrapper));\n        ManagedOrUnmanagedKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxToken>(WrappedType, \"ManagedOrUnmanagedKeyword\");\n        UnmanagedCallingConventionListAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, CSharpSyntaxNode>(WrappedType, \"UnmanagedCallingConventionList\");\n    }\n\n    private FunctionPointerCallingConventionSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    private static readonly Func<CSharpSyntaxNode, SyntaxToken> ManagedOrUnmanagedKeywordAccessor;\n    public SyntaxToken ManagedOrUnmanagedKeyword => (SyntaxToken)ManagedOrUnmanagedKeywordAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, CSharpSyntaxNode> UnmanagedCallingConventionListAccessor;\n    public FunctionPointerUnmanagedCallingConventionListSyntaxWrapper UnmanagedCallingConventionList => (FunctionPointerUnmanagedCallingConventionListSyntaxWrapper)UnmanagedCallingConventionListAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator FunctionPointerCallingConventionSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new FunctionPointerCallingConventionSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(FunctionPointerCallingConventionSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#FunctionPointerParameterListSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct FunctionPointerParameterListSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.FunctionPointerParameterListSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static FunctionPointerParameterListSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(FunctionPointerParameterListSyntaxWrapper));\n        LessThanTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxToken>(WrappedType, \"LessThanToken\");\n        ParametersAccessor = LightupHelpers.CreateSeparatedSyntaxListPropertyAccessor<CSharpSyntaxNode, FunctionPointerParameterSyntaxWrapper>(WrappedType, nameof(Parameters));\n        GreaterThanTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxToken>(WrappedType, \"GreaterThanToken\");\n    }\n\n    private FunctionPointerParameterListSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    private static readonly Func<CSharpSyntaxNode, SyntaxToken> LessThanTokenAccessor;\n    public SyntaxToken LessThanToken => (SyntaxToken)LessThanTokenAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, SeparatedSyntaxListWrapper<FunctionPointerParameterSyntaxWrapper>> ParametersAccessor;\n    public SeparatedSyntaxListWrapper<FunctionPointerParameterSyntaxWrapper> Parameters => ParametersAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, SyntaxToken> GreaterThanTokenAccessor;\n    public SyntaxToken GreaterThanToken => (SyntaxToken)GreaterThanTokenAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator FunctionPointerParameterListSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new FunctionPointerParameterListSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(FunctionPointerParameterListSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#FunctionPointerParameterSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct FunctionPointerParameterSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.FunctionPointerParameterSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static FunctionPointerParameterSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(FunctionPointerParameterSyntaxWrapper));\n        AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxList<AttributeListSyntax>>(WrappedType, \"AttributeLists\");\n        ModifiersAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxTokenList>(WrappedType, \"Modifiers\");\n        TypeAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, TypeSyntax>(WrappedType, \"Type\");\n    }\n\n    private FunctionPointerParameterSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    private static readonly Func<CSharpSyntaxNode, SyntaxList<AttributeListSyntax>> AttributeListsAccessor;\n    public SyntaxList<AttributeListSyntax> AttributeLists => (SyntaxList<AttributeListSyntax>)AttributeListsAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, SyntaxTokenList> ModifiersAccessor;\n    public SyntaxTokenList Modifiers => (SyntaxTokenList)ModifiersAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, TypeSyntax> TypeAccessor;\n    public TypeSyntax Type => TypeAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator FunctionPointerParameterSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new FunctionPointerParameterSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(FunctionPointerParameterSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static implicit operator BaseParameterSyntaxWrapper(FunctionPointerParameterSyntaxWrapper up) => (BaseParameterSyntaxWrapper)up.SyntaxNode;\n    public static explicit operator FunctionPointerParameterSyntaxWrapper(BaseParameterSyntaxWrapper down) => (FunctionPointerParameterSyntaxWrapper)down.SyntaxNode;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#FunctionPointerTypeSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct FunctionPointerTypeSyntaxWrapper: ISyntaxWrapper<TypeSyntax>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.FunctionPointerTypeSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly TypeSyntax node;\n\n    static FunctionPointerTypeSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(FunctionPointerTypeSyntaxWrapper));\n        DelegateKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeSyntax, SyntaxToken>(WrappedType, \"DelegateKeyword\");\n        AsteriskTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeSyntax, SyntaxToken>(WrappedType, \"AsteriskToken\");\n        CallingConventionAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeSyntax, CSharpSyntaxNode>(WrappedType, \"CallingConvention\");\n        ParameterListAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeSyntax, CSharpSyntaxNode>(WrappedType, \"ParameterList\");\n        IsUnmanagedAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeSyntax, Boolean>(WrappedType, \"IsUnmanaged\");\n        IsNotNullAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeSyntax, Boolean>(WrappedType, \"IsNotNull\");\n        IsNintAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeSyntax, Boolean>(WrappedType, \"IsNint\");\n        IsNuintAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeSyntax, Boolean>(WrappedType, \"IsNuint\");\n    }\n\n    private FunctionPointerTypeSyntaxWrapper(TypeSyntax node) =>\n        this.node = node;\n\n    public TypeSyntax Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public TypeSyntax SyntaxNode => this.node;\n\n    private static readonly Func<TypeSyntax, SyntaxToken> DelegateKeywordAccessor;\n    public SyntaxToken DelegateKeyword => (SyntaxToken)DelegateKeywordAccessor(this.node);\n    private static readonly Func<TypeSyntax, SyntaxToken> AsteriskTokenAccessor;\n    public SyntaxToken AsteriskToken => (SyntaxToken)AsteriskTokenAccessor(this.node);\n    private static readonly Func<TypeSyntax, CSharpSyntaxNode> CallingConventionAccessor;\n    public FunctionPointerCallingConventionSyntaxWrapper CallingConvention => (FunctionPointerCallingConventionSyntaxWrapper)CallingConventionAccessor(this.node);\n    private static readonly Func<TypeSyntax, CSharpSyntaxNode> ParameterListAccessor;\n    public FunctionPointerParameterListSyntaxWrapper ParameterList => (FunctionPointerParameterListSyntaxWrapper)ParameterListAccessor(this.node);\n    public Boolean IsVar => this.node.IsVar;\n    private static readonly Func<TypeSyntax, Boolean> IsUnmanagedAccessor;\n    public Boolean IsUnmanaged => (Boolean)IsUnmanagedAccessor(this.node);\n    private static readonly Func<TypeSyntax, Boolean> IsNotNullAccessor;\n    public Boolean IsNotNull => (Boolean)IsNotNullAccessor(this.node);\n    private static readonly Func<TypeSyntax, Boolean> IsNintAccessor;\n    public Boolean IsNint => (Boolean)IsNintAccessor(this.node);\n    private static readonly Func<TypeSyntax, Boolean> IsNuintAccessor;\n    public Boolean IsNuint => (Boolean)IsNuintAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator FunctionPointerTypeSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new FunctionPointerTypeSyntaxWrapper((TypeSyntax)node);\n    }\n\n    public static implicit operator TypeSyntax(FunctionPointerTypeSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#FunctionPointerUnmanagedCallingConventionListSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct FunctionPointerUnmanagedCallingConventionListSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.FunctionPointerUnmanagedCallingConventionListSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static FunctionPointerUnmanagedCallingConventionListSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(FunctionPointerUnmanagedCallingConventionListSyntaxWrapper));\n        OpenBracketTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxToken>(WrappedType, \"OpenBracketToken\");\n        CallingConventionsAccessor = LightupHelpers.CreateSeparatedSyntaxListPropertyAccessor<CSharpSyntaxNode, FunctionPointerUnmanagedCallingConventionSyntaxWrapper>(WrappedType, nameof(CallingConventions));\n        CloseBracketTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxToken>(WrappedType, \"CloseBracketToken\");\n    }\n\n    private FunctionPointerUnmanagedCallingConventionListSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    private static readonly Func<CSharpSyntaxNode, SyntaxToken> OpenBracketTokenAccessor;\n    public SyntaxToken OpenBracketToken => (SyntaxToken)OpenBracketTokenAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, SeparatedSyntaxListWrapper<FunctionPointerUnmanagedCallingConventionSyntaxWrapper>> CallingConventionsAccessor;\n    public SeparatedSyntaxListWrapper<FunctionPointerUnmanagedCallingConventionSyntaxWrapper> CallingConventions => CallingConventionsAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, SyntaxToken> CloseBracketTokenAccessor;\n    public SyntaxToken CloseBracketToken => (SyntaxToken)CloseBracketTokenAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator FunctionPointerUnmanagedCallingConventionListSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new FunctionPointerUnmanagedCallingConventionListSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(FunctionPointerUnmanagedCallingConventionListSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#FunctionPointerUnmanagedCallingConventionSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct FunctionPointerUnmanagedCallingConventionSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.FunctionPointerUnmanagedCallingConventionSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static FunctionPointerUnmanagedCallingConventionSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(FunctionPointerUnmanagedCallingConventionSyntaxWrapper));\n        NameAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxToken>(WrappedType, \"Name\");\n    }\n\n    private FunctionPointerUnmanagedCallingConventionSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    private static readonly Func<CSharpSyntaxNode, SyntaxToken> NameAccessor;\n    public SyntaxToken Name => (SyntaxToken)NameAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator FunctionPointerUnmanagedCallingConventionSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new FunctionPointerUnmanagedCallingConventionSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(FunctionPointerUnmanagedCallingConventionSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#GeneratedKind.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic enum GeneratedKind : System.Int32\n{\n    Unknown = 0,\n    NotGenerated = 1,\n    MarkedGenerated = 2,\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#GenericNameSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class GenericNameSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(GenericNameSyntax);\n\n    private static readonly Func<GenericNameSyntax, Boolean> IsUnmanagedAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<GenericNameSyntax, Boolean>(WrappedType, \"IsUnmanaged\");\n\n    private static readonly Func<GenericNameSyntax, Boolean> IsNotNullAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<GenericNameSyntax, Boolean>(WrappedType, \"IsNotNull\");\n\n    private static readonly Func<GenericNameSyntax, Boolean> IsNintAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<GenericNameSyntax, Boolean>(WrappedType, \"IsNint\");\n\n    private static readonly Func<GenericNameSyntax, Boolean> IsNuintAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<GenericNameSyntax, Boolean>(WrappedType, \"IsNuint\");\n\n    extension(GenericNameSyntax @this)\n    {\n        public Boolean IsUnmanaged => (Boolean)IsUnmanagedAccessor(@this);\n        public Boolean IsNotNull => (Boolean)IsNotNullAccessor(@this);\n        public Boolean IsNint => (Boolean)IsNintAccessor(@this);\n        public Boolean IsNuint => (Boolean)IsNuintAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#GlobalStatementSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class GlobalStatementSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(GlobalStatementSyntax);\n\n    private static readonly Func<GlobalStatementSyntax, SyntaxList<AttributeListSyntax>> AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<GlobalStatementSyntax, SyntaxList<AttributeListSyntax>>(WrappedType, \"AttributeLists\");\n\n    private static readonly Func<GlobalStatementSyntax, SyntaxTokenList> ModifiersAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<GlobalStatementSyntax, SyntaxTokenList>(WrappedType, \"Modifiers\");\n\n    extension(GlobalStatementSyntax @this)\n    {\n        public SyntaxList<AttributeListSyntax> AttributeLists => (SyntaxList<AttributeListSyntax>)AttributeListsAccessor(@this);\n        public SyntaxTokenList Modifiers => (SyntaxTokenList)ModifiersAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#GotoStatementSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class GotoStatementSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(GotoStatementSyntax);\n\n    private static readonly Func<GotoStatementSyntax, SyntaxList<AttributeListSyntax>> AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<GotoStatementSyntax, SyntaxList<AttributeListSyntax>>(WrappedType, \"AttributeLists\");\n\n    extension(GotoStatementSyntax @this)\n    {\n        public SyntaxList<AttributeListSyntax> AttributeLists => (SyntaxList<AttributeListSyntax>)AttributeListsAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IAddressOfOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IAddressOfOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IAnonymousFunctionOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IAnonymousFunctionOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IAnonymousObjectCreationOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IAnonymousObjectCreationOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IArgumentOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IArgumentOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IArrayCreationOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IArrayCreationOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IArrayElementReferenceOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IArrayElementReferenceOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IArrayInitializerOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IArrayInitializerOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IAssignmentOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IAssignmentOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IAttributeOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IAttributeOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IAwaitOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IAwaitOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IBinaryOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IBinaryOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IBinaryPatternOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IBinaryPatternOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IBlockOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IBlockOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IBranchOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IBranchOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ICaseClauseOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // ICaseClauseOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ICatchClauseOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // ICatchClauseOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ICaughtExceptionOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // ICaughtExceptionOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ICoalesceAssignmentOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // ICoalesceAssignmentOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ICoalesceOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // ICoalesceOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ICollectionElementInitializerOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // ICollectionElementInitializerOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ICollectionExpressionOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // ICollectionExpressionOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ICompoundAssignmentOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // ICompoundAssignmentOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IConditionalAccessInstanceOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IConditionalAccessInstanceOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IConditionalAccessOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IConditionalAccessOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IConditionalOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IConditionalOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IConstantPatternOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IConstantPatternOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IConstructorBodyOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IConstructorBodyOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IConversionOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IConversionOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IDeclarationExpressionOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IDeclarationExpressionOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IDeclarationPatternOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IDeclarationPatternOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IDeconstructionAssignmentOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IDeconstructionAssignmentOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IDefaultCaseClauseOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IDefaultCaseClauseOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IDefaultValueOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IDefaultValueOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IDelegateCreationOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IDelegateCreationOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IDiscardOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IDiscardOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IDiscardPatternOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IDiscardPatternOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IDynamicIndexerAccessOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IDynamicIndexerAccessOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IDynamicInvocationOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IDynamicInvocationOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IDynamicMemberReferenceOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IDynamicMemberReferenceOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IDynamicObjectCreationOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IDynamicObjectCreationOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IEmptyOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IEmptyOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IEndOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IEndOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IEventAssignmentOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IEventAssignmentOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IEventReferenceOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IEventReferenceOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IExpressionStatementOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IExpressionStatementOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IFieldInitializerOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IFieldInitializerOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IFieldReferenceOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IFieldReferenceOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IFlowAnonymousFunctionOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IFlowAnonymousFunctionOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IFlowCaptureOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IFlowCaptureOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IFlowCaptureReferenceOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IFlowCaptureReferenceOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IForEachLoopOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IForEachLoopOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IForLoopOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IForLoopOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IForToLoopOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IForToLoopOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IFunctionPointerInvocationOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IFunctionPointerInvocationOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IImplicitIndexerReferenceOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IImplicitIndexerReferenceOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IIncrementOrDecrementOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IIncrementOrDecrementOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IInlineArrayAccessOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IInlineArrayAccessOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IInstanceReferenceOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IInstanceReferenceOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IInterpolatedStringAdditionOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IInterpolatedStringAdditionOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IInterpolatedStringAppendOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IInterpolatedStringAppendOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IInterpolatedStringContentOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IInterpolatedStringContentOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IInterpolatedStringHandlerArgumentPlaceholderOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IInterpolatedStringHandlerArgumentPlaceholderOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IInterpolatedStringHandlerCreationOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IInterpolatedStringHandlerCreationOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IInterpolatedStringOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IInterpolatedStringOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IInterpolatedStringTextOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IInterpolatedStringTextOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IInterpolationOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IInterpolationOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IInvalidOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IInvalidOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IInvocationOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IInvocationOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IIsNullOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IIsNullOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IIsPatternOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IIsPatternOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IIsTypeOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IIsTypeOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ILabeledOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // ILabeledOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IListPatternOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IListPatternOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ILiteralOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // ILiteralOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ILocalFunctionOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // ILocalFunctionOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ILocalReferenceOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // ILocalReferenceOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ILockOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // ILockOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ILoopOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // ILoopOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IMemberInitializerOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IMemberInitializerOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IMemberReferenceOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IMemberReferenceOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IMethodBodyBaseOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IMethodBodyBaseOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IMethodBodyOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IMethodBodyOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IMethodReferenceOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IMethodReferenceOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#INameOfOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // INameOfOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#INegatedPatternOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // INegatedPatternOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IObjectCreationOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IObjectCreationOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IObjectOrCollectionInitializerOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IObjectOrCollectionInitializerOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IOmittedArgumentOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IOmittedArgumentOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IParameterInitializerOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IParameterInitializerOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IParameterReferenceOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IParameterReferenceOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IParenthesizedOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IParenthesizedOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IPatternCaseClauseOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IPatternCaseClauseOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IPatternOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IPatternOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IPropertyInitializerOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IPropertyInitializerOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IPropertyReferenceOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IPropertyReferenceOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IPropertySubpatternOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IPropertySubpatternOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IRaiseEventOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IRaiseEventOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IRangeCaseClauseOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IRangeCaseClauseOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IRangeOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IRangeOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IReDimClauseOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IReDimClauseOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IReDimOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IReDimOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IRecursivePatternOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IRecursivePatternOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IRelationalCaseClauseOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IRelationalCaseClauseOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IRelationalPatternOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IRelationalPatternOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IReturnOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IReturnOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ISimpleAssignmentOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // ISimpleAssignmentOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ISingleValueCaseClauseOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // ISingleValueCaseClauseOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ISizeOfOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // ISizeOfOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ISlicePatternOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // ISlicePatternOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ISpreadOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // ISpreadOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IStaticLocalInitializationSemaphoreOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IStaticLocalInitializationSemaphoreOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IStopOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IStopOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ISwitchCaseOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // ISwitchCaseOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ISwitchExpressionArmOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // ISwitchExpressionArmOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ISwitchExpressionOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // ISwitchExpressionOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ISwitchOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // ISwitchOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ISymbolInitializerOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // ISymbolInitializerOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IThrowOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IThrowOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ITranslatedQueryOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // ITranslatedQueryOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ITryOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // ITryOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ITupleBinaryOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // ITupleBinaryOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ITupleOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // ITupleOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ITypeOfOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // ITypeOfOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ITypeParameterObjectCreationOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // ITypeParameterObjectCreationOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ITypePatternOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // ITypePatternOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IUnaryOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IUnaryOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IUsingDeclarationOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IUsingDeclarationOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IUsingOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IUsingOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IUtf8StringOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IUtf8StringOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IVariableDeclarationGroupOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IVariableDeclarationGroupOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IVariableDeclarationOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IVariableDeclarationOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IVariableDeclaratorOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IVariableDeclaratorOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IVariableInitializerOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IVariableInitializerOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IWhileLoopOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IWhileLoopOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IWithOperation.g.cs.verified.cs",
    "content": "﻿namespace SonarAnalyzer.ShimLayer; // IWithOperation"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IdentifierNameSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class IdentifierNameSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(IdentifierNameSyntax);\n\n    private static readonly Func<IdentifierNameSyntax, Boolean> IsUnmanagedAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<IdentifierNameSyntax, Boolean>(WrappedType, \"IsUnmanaged\");\n\n    private static readonly Func<IdentifierNameSyntax, Boolean> IsNotNullAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<IdentifierNameSyntax, Boolean>(WrappedType, \"IsNotNull\");\n\n    private static readonly Func<IdentifierNameSyntax, Boolean> IsNintAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<IdentifierNameSyntax, Boolean>(WrappedType, \"IsNint\");\n\n    private static readonly Func<IdentifierNameSyntax, Boolean> IsNuintAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<IdentifierNameSyntax, Boolean>(WrappedType, \"IsNuint\");\n\n    extension(IdentifierNameSyntax @this)\n    {\n        public Boolean IsUnmanaged => (Boolean)IsUnmanagedAccessor(@this);\n        public Boolean IsNotNull => (Boolean)IsNotNullAccessor(@this);\n        public Boolean IsNint => (Boolean)IsNintAccessor(@this);\n        public Boolean IsNuint => (Boolean)IsNuintAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IfStatementSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class IfStatementSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(IfStatementSyntax);\n\n    private static readonly Func<IfStatementSyntax, SyntaxList<AttributeListSyntax>> AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<IfStatementSyntax, SyntaxList<AttributeListSyntax>>(WrappedType, \"AttributeLists\");\n\n    extension(IfStatementSyntax @this)\n    {\n        public SyntaxList<AttributeListSyntax> AttributeLists => (SyntaxList<AttributeListSyntax>)AttributeListsAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IgnoredDirectiveTriviaSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct IgnoredDirectiveTriviaSyntaxWrapper: ISyntaxWrapper<DirectiveTriviaSyntax>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.IgnoredDirectiveTriviaSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly DirectiveTriviaSyntax node;\n\n    static IgnoredDirectiveTriviaSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(IgnoredDirectiveTriviaSyntaxWrapper));\n        ColonTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<DirectiveTriviaSyntax, SyntaxToken>(WrappedType, \"ColonToken\");\n        ContentAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<DirectiveTriviaSyntax, SyntaxToken>(WrappedType, \"Content\");\n    }\n\n    private IgnoredDirectiveTriviaSyntaxWrapper(DirectiveTriviaSyntax node) =>\n        this.node = node;\n\n    public DirectiveTriviaSyntax Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public DirectiveTriviaSyntax SyntaxNode => this.node;\n\n    public SyntaxToken HashToken => this.node.HashToken;\n    private static readonly Func<DirectiveTriviaSyntax, SyntaxToken> ColonTokenAccessor;\n    public SyntaxToken ColonToken => (SyntaxToken)ColonTokenAccessor(this.node);\n    private static readonly Func<DirectiveTriviaSyntax, SyntaxToken> ContentAccessor;\n    public SyntaxToken Content => (SyntaxToken)ContentAccessor(this.node);\n    public SyntaxToken EndOfDirectiveToken => this.node.EndOfDirectiveToken;\n    public Boolean IsActive => this.node.IsActive;\n    public SyntaxToken DirectiveNameToken => this.node.DirectiveNameToken;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator IgnoredDirectiveTriviaSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new IgnoredDirectiveTriviaSyntaxWrapper((DirectiveTriviaSyntax)node);\n    }\n\n    public static implicit operator DirectiveTriviaSyntax(IgnoredDirectiveTriviaSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ImplicitObjectCreationExpressionSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct ImplicitObjectCreationExpressionSyntaxWrapper: ISyntaxWrapper<ExpressionSyntax>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.ImplicitObjectCreationExpressionSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly ExpressionSyntax node;\n\n    static ImplicitObjectCreationExpressionSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(ImplicitObjectCreationExpressionSyntaxWrapper));\n        NewKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ExpressionSyntax, SyntaxToken>(WrappedType, \"NewKeyword\");\n        ArgumentListAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ExpressionSyntax, ArgumentListSyntax>(WrappedType, \"ArgumentList\");\n        InitializerAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ExpressionSyntax, InitializerExpressionSyntax>(WrappedType, \"Initializer\");\n    }\n\n    private ImplicitObjectCreationExpressionSyntaxWrapper(ExpressionSyntax node) =>\n        this.node = node;\n\n    public ExpressionSyntax Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public ExpressionSyntax SyntaxNode => this.node;\n\n    private static readonly Func<ExpressionSyntax, SyntaxToken> NewKeywordAccessor;\n    public SyntaxToken NewKeyword => (SyntaxToken)NewKeywordAccessor(this.node);\n    private static readonly Func<ExpressionSyntax, ArgumentListSyntax> ArgumentListAccessor;\n    public ArgumentListSyntax ArgumentList => ArgumentListAccessor(this.node);\n    private static readonly Func<ExpressionSyntax, InitializerExpressionSyntax> InitializerAccessor;\n    public InitializerExpressionSyntax Initializer => InitializerAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator ImplicitObjectCreationExpressionSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new ImplicitObjectCreationExpressionSyntaxWrapper((ExpressionSyntax)node);\n    }\n\n    public static implicit operator ExpressionSyntax(ImplicitObjectCreationExpressionSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static implicit operator BaseObjectCreationExpressionSyntaxWrapper(ImplicitObjectCreationExpressionSyntaxWrapper up) => (BaseObjectCreationExpressionSyntaxWrapper)up.SyntaxNode;\n    public static explicit operator ImplicitObjectCreationExpressionSyntaxWrapper(BaseObjectCreationExpressionSyntaxWrapper down) => (ImplicitObjectCreationExpressionSyntaxWrapper)down.SyntaxNode;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ImplicitStackAllocArrayCreationExpressionSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct ImplicitStackAllocArrayCreationExpressionSyntaxWrapper: ISyntaxWrapper<ExpressionSyntax>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.ImplicitStackAllocArrayCreationExpressionSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly ExpressionSyntax node;\n\n    static ImplicitStackAllocArrayCreationExpressionSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(ImplicitStackAllocArrayCreationExpressionSyntaxWrapper));\n        StackAllocKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ExpressionSyntax, SyntaxToken>(WrappedType, \"StackAllocKeyword\");\n        OpenBracketTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ExpressionSyntax, SyntaxToken>(WrappedType, \"OpenBracketToken\");\n        CloseBracketTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ExpressionSyntax, SyntaxToken>(WrappedType, \"CloseBracketToken\");\n        InitializerAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ExpressionSyntax, InitializerExpressionSyntax>(WrappedType, \"Initializer\");\n    }\n\n    private ImplicitStackAllocArrayCreationExpressionSyntaxWrapper(ExpressionSyntax node) =>\n        this.node = node;\n\n    public ExpressionSyntax Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public ExpressionSyntax SyntaxNode => this.node;\n\n    private static readonly Func<ExpressionSyntax, SyntaxToken> StackAllocKeywordAccessor;\n    public SyntaxToken StackAllocKeyword => (SyntaxToken)StackAllocKeywordAccessor(this.node);\n    private static readonly Func<ExpressionSyntax, SyntaxToken> OpenBracketTokenAccessor;\n    public SyntaxToken OpenBracketToken => (SyntaxToken)OpenBracketTokenAccessor(this.node);\n    private static readonly Func<ExpressionSyntax, SyntaxToken> CloseBracketTokenAccessor;\n    public SyntaxToken CloseBracketToken => (SyntaxToken)CloseBracketTokenAccessor(this.node);\n    private static readonly Func<ExpressionSyntax, InitializerExpressionSyntax> InitializerAccessor;\n    public InitializerExpressionSyntax Initializer => InitializerAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator ImplicitStackAllocArrayCreationExpressionSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new ImplicitStackAllocArrayCreationExpressionSyntaxWrapper((ExpressionSyntax)node);\n    }\n\n    public static implicit operator ExpressionSyntax(ImplicitStackAllocArrayCreationExpressionSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IncrementalGeneratorOutputKind.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\n[System.FlagsAttribute]\npublic enum IncrementalGeneratorOutputKind : System.Int32\n{\n    None = 0,\n    Source = 1,\n    PostInit = 2,\n    Implementation = 4,\n    Host = 8,\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IncrementalStepRunReason.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic enum IncrementalStepRunReason : System.Int32\n{\n    New = 0,\n    Modified = 1,\n    Unchanged = 2,\n    Cached = 3,\n    Removed = 4,\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#InstanceReferenceKind.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic enum InstanceReferenceKind : System.Int32\n{\n    ContainingTypeInstance = 0,\n    ImplicitReceiver = 1,\n    PatternInput = 2,\n    InterpolatedStringHandler = 3,\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#InstrumentationKind.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic enum InstrumentationKind : System.Int32\n{\n    None = 0,\n    TestCoverage = 1,\n    StackOverflowProbing = 2,\n    ModuleCancellation = 3,\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#InterfaceDeclarationSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class InterfaceDeclarationSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(InterfaceDeclarationSyntax);\n\n    private static readonly Func<InterfaceDeclarationSyntax, ParameterListSyntax> ParameterListAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<InterfaceDeclarationSyntax, ParameterListSyntax>(WrappedType, \"ParameterList\");\n\n    extension(InterfaceDeclarationSyntax @this)\n    {\n        public ParameterListSyntax ParameterList => ParameterListAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#InterpolatedStringArgumentPlaceholderKind.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic enum InterpolatedStringArgumentPlaceholderKind : System.Int32\n{\n    CallsiteArgument = 0,\n    CallsiteReceiver = 1,\n    TrailingValidityArgument = 2,\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#IsPatternExpressionSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct IsPatternExpressionSyntaxWrapper: ISyntaxWrapper<ExpressionSyntax>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.IsPatternExpressionSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly ExpressionSyntax node;\n\n    static IsPatternExpressionSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(IsPatternExpressionSyntaxWrapper));\n        ExpressionAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ExpressionSyntax, ExpressionSyntax>(WrappedType, \"Expression\");\n        IsKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ExpressionSyntax, SyntaxToken>(WrappedType, \"IsKeyword\");\n        PatternAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ExpressionSyntax, CSharpSyntaxNode>(WrappedType, \"Pattern\");\n    }\n\n    private IsPatternExpressionSyntaxWrapper(ExpressionSyntax node) =>\n        this.node = node;\n\n    public ExpressionSyntax Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public ExpressionSyntax SyntaxNode => this.node;\n\n    private static readonly Func<ExpressionSyntax, ExpressionSyntax> ExpressionAccessor;\n    public ExpressionSyntax Expression => ExpressionAccessor(this.node);\n    private static readonly Func<ExpressionSyntax, SyntaxToken> IsKeywordAccessor;\n    public SyntaxToken IsKeyword => (SyntaxToken)IsKeywordAccessor(this.node);\n    private static readonly Func<ExpressionSyntax, CSharpSyntaxNode> PatternAccessor;\n    public PatternSyntaxWrapper Pattern => (PatternSyntaxWrapper)PatternAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator IsPatternExpressionSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new IsPatternExpressionSyntaxWrapper((ExpressionSyntax)node);\n    }\n\n    public static implicit operator ExpressionSyntax(IsPatternExpressionSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#LabeledStatementSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class LabeledStatementSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(LabeledStatementSyntax);\n\n    private static readonly Func<LabeledStatementSyntax, SyntaxList<AttributeListSyntax>> AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<LabeledStatementSyntax, SyntaxList<AttributeListSyntax>>(WrappedType, \"AttributeLists\");\n\n    extension(LabeledStatementSyntax @this)\n    {\n        public SyntaxList<AttributeListSyntax> AttributeLists => (SyntaxList<AttributeListSyntax>)AttributeListsAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#LambdaExpressionSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class LambdaExpressionSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(LambdaExpressionSyntax);\n\n    private static readonly Func<LambdaExpressionSyntax, SyntaxList<AttributeListSyntax>> AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<LambdaExpressionSyntax, SyntaxList<AttributeListSyntax>>(WrappedType, \"AttributeLists\");\n\n    private static readonly Func<LambdaExpressionSyntax, SyntaxTokenList> ModifiersAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<LambdaExpressionSyntax, SyntaxTokenList>(WrappedType, \"Modifiers\");\n\n    private static readonly Func<LambdaExpressionSyntax, BlockSyntax> BlockAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<LambdaExpressionSyntax, BlockSyntax>(WrappedType, \"Block\");\n\n    private static readonly Func<LambdaExpressionSyntax, ExpressionSyntax> ExpressionBodyAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<LambdaExpressionSyntax, ExpressionSyntax>(WrappedType, \"ExpressionBody\");\n\n    extension(LambdaExpressionSyntax @this)\n    {\n        public SyntaxList<AttributeListSyntax> AttributeLists => (SyntaxList<AttributeListSyntax>)AttributeListsAccessor(@this);\n        public SyntaxTokenList Modifiers => (SyntaxTokenList)ModifiersAccessor(@this);\n        public BlockSyntax Block => BlockAccessor(@this);\n        public ExpressionSyntax ExpressionBody => ExpressionBodyAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#LanguageVersion.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static class LanguageVersionEx\n{\n    public const LanguageVersion CSharp7 = (LanguageVersion)7;\n    public const LanguageVersion CSharp7_1 = (LanguageVersion)701;\n    public const LanguageVersion CSharp7_2 = (LanguageVersion)702;\n    public const LanguageVersion CSharp7_3 = (LanguageVersion)703;\n    public const LanguageVersion CSharp8 = (LanguageVersion)800;\n    public const LanguageVersion CSharp9 = (LanguageVersion)900;\n    public const LanguageVersion CSharp10 = (LanguageVersion)1000;\n    public const LanguageVersion CSharp11 = (LanguageVersion)1100;\n    public const LanguageVersion CSharp12 = (LanguageVersion)1200;\n    public const LanguageVersion CSharp13 = (LanguageVersion)1300;\n    public const LanguageVersion CSharp14 = (LanguageVersion)1400;\n    public const LanguageVersion LatestMajor = (LanguageVersion)2147483645;\n    public const LanguageVersion Preview = (LanguageVersion)2147483646;\n    public const LanguageVersion Latest = (LanguageVersion)2147483647;\n    public const LanguageVersion Default = (LanguageVersion)0;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#LineDirectivePositionSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct LineDirectivePositionSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.LineDirectivePositionSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static LineDirectivePositionSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(LineDirectivePositionSyntaxWrapper));\n        OpenParenTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxToken>(WrappedType, \"OpenParenToken\");\n        LineAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxToken>(WrappedType, \"Line\");\n        CommaTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxToken>(WrappedType, \"CommaToken\");\n        CharacterAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxToken>(WrappedType, \"Character\");\n        CloseParenTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxToken>(WrappedType, \"CloseParenToken\");\n    }\n\n    private LineDirectivePositionSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    private static readonly Func<CSharpSyntaxNode, SyntaxToken> OpenParenTokenAccessor;\n    public SyntaxToken OpenParenToken => (SyntaxToken)OpenParenTokenAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, SyntaxToken> LineAccessor;\n    public SyntaxToken Line => (SyntaxToken)LineAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, SyntaxToken> CommaTokenAccessor;\n    public SyntaxToken CommaToken => (SyntaxToken)CommaTokenAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, SyntaxToken> CharacterAccessor;\n    public SyntaxToken Character => (SyntaxToken)CharacterAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, SyntaxToken> CloseParenTokenAccessor;\n    public SyntaxToken CloseParenToken => (SyntaxToken)CloseParenTokenAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator LineDirectivePositionSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new LineDirectivePositionSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(LineDirectivePositionSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#LineOrSpanDirectiveTriviaSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct LineOrSpanDirectiveTriviaSyntaxWrapper: ISyntaxWrapper<DirectiveTriviaSyntax>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.LineOrSpanDirectiveTriviaSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly DirectiveTriviaSyntax node;\n\n    static LineOrSpanDirectiveTriviaSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(LineOrSpanDirectiveTriviaSyntaxWrapper));\n        LineKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<DirectiveTriviaSyntax, SyntaxToken>(WrappedType, \"LineKeyword\");\n        FileAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<DirectiveTriviaSyntax, SyntaxToken>(WrappedType, \"File\");\n    }\n\n    private LineOrSpanDirectiveTriviaSyntaxWrapper(DirectiveTriviaSyntax node) =>\n        this.node = node;\n\n    public DirectiveTriviaSyntax Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public DirectiveTriviaSyntax SyntaxNode => this.node;\n\n    private static readonly Func<DirectiveTriviaSyntax, SyntaxToken> LineKeywordAccessor;\n    public SyntaxToken LineKeyword => (SyntaxToken)LineKeywordAccessor(this.node);\n    private static readonly Func<DirectiveTriviaSyntax, SyntaxToken> FileAccessor;\n    public SyntaxToken File => (SyntaxToken)FileAccessor(this.node);\n    public SyntaxToken DirectiveNameToken => this.node.DirectiveNameToken;\n    public SyntaxToken HashToken => this.node.HashToken;\n    public SyntaxToken EndOfDirectiveToken => this.node.EndOfDirectiveToken;\n    public Boolean IsActive => this.node.IsActive;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator LineOrSpanDirectiveTriviaSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new LineOrSpanDirectiveTriviaSyntaxWrapper((DirectiveTriviaSyntax)node);\n    }\n\n    public static implicit operator DirectiveTriviaSyntax(LineOrSpanDirectiveTriviaSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#LineSpanDirectiveTriviaSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct LineSpanDirectiveTriviaSyntaxWrapper: ISyntaxWrapper<DirectiveTriviaSyntax>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.LineSpanDirectiveTriviaSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly DirectiveTriviaSyntax node;\n\n    static LineSpanDirectiveTriviaSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(LineSpanDirectiveTriviaSyntaxWrapper));\n        LineKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<DirectiveTriviaSyntax, SyntaxToken>(WrappedType, \"LineKeyword\");\n        StartAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<DirectiveTriviaSyntax, CSharpSyntaxNode>(WrappedType, \"Start\");\n        MinusTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<DirectiveTriviaSyntax, SyntaxToken>(WrappedType, \"MinusToken\");\n        EndAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<DirectiveTriviaSyntax, CSharpSyntaxNode>(WrappedType, \"End\");\n        CharacterOffsetAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<DirectiveTriviaSyntax, SyntaxToken>(WrappedType, \"CharacterOffset\");\n        FileAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<DirectiveTriviaSyntax, SyntaxToken>(WrappedType, \"File\");\n    }\n\n    private LineSpanDirectiveTriviaSyntaxWrapper(DirectiveTriviaSyntax node) =>\n        this.node = node;\n\n    public DirectiveTriviaSyntax Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public DirectiveTriviaSyntax SyntaxNode => this.node;\n\n    public SyntaxToken HashToken => this.node.HashToken;\n    private static readonly Func<DirectiveTriviaSyntax, SyntaxToken> LineKeywordAccessor;\n    public SyntaxToken LineKeyword => (SyntaxToken)LineKeywordAccessor(this.node);\n    private static readonly Func<DirectiveTriviaSyntax, CSharpSyntaxNode> StartAccessor;\n    public LineDirectivePositionSyntaxWrapper Start => (LineDirectivePositionSyntaxWrapper)StartAccessor(this.node);\n    private static readonly Func<DirectiveTriviaSyntax, SyntaxToken> MinusTokenAccessor;\n    public SyntaxToken MinusToken => (SyntaxToken)MinusTokenAccessor(this.node);\n    private static readonly Func<DirectiveTriviaSyntax, CSharpSyntaxNode> EndAccessor;\n    public LineDirectivePositionSyntaxWrapper End => (LineDirectivePositionSyntaxWrapper)EndAccessor(this.node);\n    private static readonly Func<DirectiveTriviaSyntax, SyntaxToken> CharacterOffsetAccessor;\n    public SyntaxToken CharacterOffset => (SyntaxToken)CharacterOffsetAccessor(this.node);\n    private static readonly Func<DirectiveTriviaSyntax, SyntaxToken> FileAccessor;\n    public SyntaxToken File => (SyntaxToken)FileAccessor(this.node);\n    public SyntaxToken EndOfDirectiveToken => this.node.EndOfDirectiveToken;\n    public Boolean IsActive => this.node.IsActive;\n    public SyntaxToken DirectiveNameToken => this.node.DirectiveNameToken;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator LineSpanDirectiveTriviaSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new LineSpanDirectiveTriviaSyntaxWrapper((DirectiveTriviaSyntax)node);\n    }\n\n    public static implicit operator DirectiveTriviaSyntax(LineSpanDirectiveTriviaSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static implicit operator LineOrSpanDirectiveTriviaSyntaxWrapper(LineSpanDirectiveTriviaSyntaxWrapper up) => (LineOrSpanDirectiveTriviaSyntaxWrapper)up.SyntaxNode;\n    public static explicit operator LineSpanDirectiveTriviaSyntaxWrapper(LineOrSpanDirectiveTriviaSyntaxWrapper down) => (LineSpanDirectiveTriviaSyntaxWrapper)down.SyntaxNode;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ListPatternSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct ListPatternSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.ListPatternSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static ListPatternSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(ListPatternSyntaxWrapper));\n        OpenBracketTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxToken>(WrappedType, \"OpenBracketToken\");\n        PatternsAccessor = LightupHelpers.CreateSeparatedSyntaxListPropertyAccessor<CSharpSyntaxNode, PatternSyntaxWrapper>(WrappedType, nameof(Patterns));\n        CloseBracketTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxToken>(WrappedType, \"CloseBracketToken\");\n        DesignationAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, CSharpSyntaxNode>(WrappedType, \"Designation\");\n    }\n\n    private ListPatternSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    private static readonly Func<CSharpSyntaxNode, SyntaxToken> OpenBracketTokenAccessor;\n    public SyntaxToken OpenBracketToken => (SyntaxToken)OpenBracketTokenAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, SeparatedSyntaxListWrapper<PatternSyntaxWrapper>> PatternsAccessor;\n    public SeparatedSyntaxListWrapper<PatternSyntaxWrapper> Patterns => PatternsAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, SyntaxToken> CloseBracketTokenAccessor;\n    public SyntaxToken CloseBracketToken => (SyntaxToken)CloseBracketTokenAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, CSharpSyntaxNode> DesignationAccessor;\n    public VariableDesignationSyntaxWrapper Designation => (VariableDesignationSyntaxWrapper)DesignationAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator ListPatternSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new ListPatternSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(ListPatternSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static implicit operator PatternSyntaxWrapper(ListPatternSyntaxWrapper up) => (PatternSyntaxWrapper)up.SyntaxNode;\n    public static explicit operator ListPatternSyntaxWrapper(PatternSyntaxWrapper down) => (ListPatternSyntaxWrapper)down.SyntaxNode;\n\n    public static implicit operator ExpressionOrPatternSyntaxWrapper(ListPatternSyntaxWrapper up) => (ExpressionOrPatternSyntaxWrapper)up.SyntaxNode;\n    public static explicit operator ListPatternSyntaxWrapper(ExpressionOrPatternSyntaxWrapper down) => (ListPatternSyntaxWrapper)down.SyntaxNode;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#LocalDeclarationStatementSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class LocalDeclarationStatementSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(LocalDeclarationStatementSyntax);\n\n    private static readonly Func<LocalDeclarationStatementSyntax, SyntaxList<AttributeListSyntax>> AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<LocalDeclarationStatementSyntax, SyntaxList<AttributeListSyntax>>(WrappedType, \"AttributeLists\");\n\n    private static readonly Func<LocalDeclarationStatementSyntax, SyntaxToken> AwaitKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<LocalDeclarationStatementSyntax, SyntaxToken>(WrappedType, \"AwaitKeyword\");\n\n    private static readonly Func<LocalDeclarationStatementSyntax, SyntaxToken> UsingKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<LocalDeclarationStatementSyntax, SyntaxToken>(WrappedType, \"UsingKeyword\");\n\n    extension(LocalDeclarationStatementSyntax @this)\n    {\n        public SyntaxList<AttributeListSyntax> AttributeLists => (SyntaxList<AttributeListSyntax>)AttributeListsAccessor(@this);\n        public SyntaxToken AwaitKeyword => (SyntaxToken)AwaitKeywordAccessor(@this);\n        public SyntaxToken UsingKeyword => (SyntaxToken)UsingKeywordAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#LocalFunctionStatementSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct LocalFunctionStatementSyntaxWrapper: ISyntaxWrapper<StatementSyntax>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly StatementSyntax node;\n\n    static LocalFunctionStatementSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(LocalFunctionStatementSyntaxWrapper));\n        AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<StatementSyntax, SyntaxList<AttributeListSyntax>>(WrappedType, \"AttributeLists\");\n        ModifiersAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<StatementSyntax, SyntaxTokenList>(WrappedType, \"Modifiers\");\n        ReturnTypeAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<StatementSyntax, TypeSyntax>(WrappedType, \"ReturnType\");\n        IdentifierAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<StatementSyntax, SyntaxToken>(WrappedType, \"Identifier\");\n        TypeParameterListAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<StatementSyntax, TypeParameterListSyntax>(WrappedType, \"TypeParameterList\");\n        ParameterListAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<StatementSyntax, ParameterListSyntax>(WrappedType, \"ParameterList\");\n        ConstraintClausesAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<StatementSyntax, SyntaxList<TypeParameterConstraintClauseSyntax>>(WrappedType, \"ConstraintClauses\");\n        BodyAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<StatementSyntax, BlockSyntax>(WrappedType, \"Body\");\n        ExpressionBodyAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<StatementSyntax, ArrowExpressionClauseSyntax>(WrappedType, \"ExpressionBody\");\n        SemicolonTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<StatementSyntax, SyntaxToken>(WrappedType, \"SemicolonToken\");\n    }\n\n    private LocalFunctionStatementSyntaxWrapper(StatementSyntax node) =>\n        this.node = node;\n\n    public StatementSyntax Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public StatementSyntax SyntaxNode => this.node;\n\n    private static readonly Func<StatementSyntax, SyntaxList<AttributeListSyntax>> AttributeListsAccessor;\n    public SyntaxList<AttributeListSyntax> AttributeLists => (SyntaxList<AttributeListSyntax>)AttributeListsAccessor(this.node);\n    private static readonly Func<StatementSyntax, SyntaxTokenList> ModifiersAccessor;\n    public SyntaxTokenList Modifiers => (SyntaxTokenList)ModifiersAccessor(this.node);\n    private static readonly Func<StatementSyntax, TypeSyntax> ReturnTypeAccessor;\n    public TypeSyntax ReturnType => ReturnTypeAccessor(this.node);\n    private static readonly Func<StatementSyntax, SyntaxToken> IdentifierAccessor;\n    public SyntaxToken Identifier => (SyntaxToken)IdentifierAccessor(this.node);\n    private static readonly Func<StatementSyntax, TypeParameterListSyntax> TypeParameterListAccessor;\n    public TypeParameterListSyntax TypeParameterList => TypeParameterListAccessor(this.node);\n    private static readonly Func<StatementSyntax, ParameterListSyntax> ParameterListAccessor;\n    public ParameterListSyntax ParameterList => ParameterListAccessor(this.node);\n    private static readonly Func<StatementSyntax, SyntaxList<TypeParameterConstraintClauseSyntax>> ConstraintClausesAccessor;\n    public SyntaxList<TypeParameterConstraintClauseSyntax> ConstraintClauses => (SyntaxList<TypeParameterConstraintClauseSyntax>)ConstraintClausesAccessor(this.node);\n    private static readonly Func<StatementSyntax, BlockSyntax> BodyAccessor;\n    public BlockSyntax Body => BodyAccessor(this.node);\n    private static readonly Func<StatementSyntax, ArrowExpressionClauseSyntax> ExpressionBodyAccessor;\n    public ArrowExpressionClauseSyntax ExpressionBody => ExpressionBodyAccessor(this.node);\n    private static readonly Func<StatementSyntax, SyntaxToken> SemicolonTokenAccessor;\n    public SyntaxToken SemicolonToken => (SyntaxToken)SemicolonTokenAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator LocalFunctionStatementSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new LocalFunctionStatementSyntaxWrapper((StatementSyntax)node);\n    }\n\n    public static implicit operator StatementSyntax(LocalFunctionStatementSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#LockStatementSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class LockStatementSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(LockStatementSyntax);\n\n    private static readonly Func<LockStatementSyntax, SyntaxList<AttributeListSyntax>> AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<LockStatementSyntax, SyntaxList<AttributeListSyntax>>(WrappedType, \"AttributeLists\");\n\n    extension(LockStatementSyntax @this)\n    {\n        public SyntaxList<AttributeListSyntax> AttributeLists => (SyntaxList<AttributeListSyntax>)AttributeListsAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#LoopKind.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic enum LoopKind : System.Int32\n{\n    None = 0,\n    While = 1,\n    For = 2,\n    ForTo = 3,\n    ForEach = 4,\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#MemberDeclarationSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class MemberDeclarationSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(MemberDeclarationSyntax);\n\n    private static readonly Func<MemberDeclarationSyntax, SyntaxList<AttributeListSyntax>> AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<MemberDeclarationSyntax, SyntaxList<AttributeListSyntax>>(WrappedType, \"AttributeLists\");\n\n    private static readonly Func<MemberDeclarationSyntax, SyntaxTokenList> ModifiersAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<MemberDeclarationSyntax, SyntaxTokenList>(WrappedType, \"Modifiers\");\n\n    extension(MemberDeclarationSyntax @this)\n    {\n        public SyntaxList<AttributeListSyntax> AttributeLists => (SyntaxList<AttributeListSyntax>)AttributeListsAccessor(@this);\n        public SyntaxTokenList Modifiers => (SyntaxTokenList)ModifiersAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#MetadataImportOptions.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic enum MetadataImportOptions : System.Byte\n{\n    Public = 0,\n    Internal = 1,\n    All = 2,\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#MethodKind.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static class MethodKindEx\n{\n    public const MethodKind LocalFunction = (MethodKind)17;\n    public const MethodKind FunctionPointerSignature = (MethodKind)18;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#NameColonSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class NameColonSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(NameColonSyntax);\n\n    private static readonly Func<NameColonSyntax, ExpressionSyntax> ExpressionAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<NameColonSyntax, ExpressionSyntax>(WrappedType, \"Expression\");\n\n    extension(NameColonSyntax @this)\n    {\n        public ExpressionSyntax Expression => ExpressionAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#NameSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class NameSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(NameSyntax);\n\n    private static readonly Func<NameSyntax, Boolean> IsUnmanagedAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<NameSyntax, Boolean>(WrappedType, \"IsUnmanaged\");\n\n    private static readonly Func<NameSyntax, Boolean> IsNotNullAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<NameSyntax, Boolean>(WrappedType, \"IsNotNull\");\n\n    private static readonly Func<NameSyntax, Boolean> IsNintAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<NameSyntax, Boolean>(WrappedType, \"IsNint\");\n\n    private static readonly Func<NameSyntax, Boolean> IsNuintAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<NameSyntax, Boolean>(WrappedType, \"IsNuint\");\n\n    extension(NameSyntax @this)\n    {\n        public Boolean IsUnmanaged => (Boolean)IsUnmanagedAccessor(@this);\n        public Boolean IsNotNull => (Boolean)IsNotNullAccessor(@this);\n        public Boolean IsNint => (Boolean)IsNintAccessor(@this);\n        public Boolean IsNuint => (Boolean)IsNuintAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#NamespaceDeclarationSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class NamespaceDeclarationSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(NamespaceDeclarationSyntax);\n\n    private static readonly Func<NamespaceDeclarationSyntax, SyntaxList<AttributeListSyntax>> AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<NamespaceDeclarationSyntax, SyntaxList<AttributeListSyntax>>(WrappedType, \"AttributeLists\");\n\n    private static readonly Func<NamespaceDeclarationSyntax, SyntaxTokenList> ModifiersAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<NamespaceDeclarationSyntax, SyntaxTokenList>(WrappedType, \"Modifiers\");\n\n    extension(NamespaceDeclarationSyntax @this)\n    {\n        public SyntaxList<AttributeListSyntax> AttributeLists => (SyntaxList<AttributeListSyntax>)AttributeListsAccessor(@this);\n        public SyntaxTokenList Modifiers => (SyntaxTokenList)ModifiersAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#NullableAnnotation.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic enum NullableAnnotation : System.Byte\n{\n    None = 0,\n    NotAnnotated = 1,\n    Annotated = 2,\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#NullableContext.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\n[System.FlagsAttribute]\npublic enum NullableContext : System.Int32\n{\n    Disabled = 0,\n    WarningsEnabled = 1,\n    AnnotationsEnabled = 2,\n    Enabled = 3,\n    WarningsContextInherited = 4,\n    AnnotationsContextInherited = 8,\n    ContextInherited = 12,\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#NullableContextOptions.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\n[System.FlagsAttribute]\npublic enum NullableContextOptions : System.Int32\n{\n    Disable = 0,\n    Warnings = 1,\n    Annotations = 2,\n    Enable = 3,\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#NullableDirectiveTriviaSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct NullableDirectiveTriviaSyntaxWrapper: ISyntaxWrapper<DirectiveTriviaSyntax>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.NullableDirectiveTriviaSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly DirectiveTriviaSyntax node;\n\n    static NullableDirectiveTriviaSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(NullableDirectiveTriviaSyntaxWrapper));\n        NullableKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<DirectiveTriviaSyntax, SyntaxToken>(WrappedType, \"NullableKeyword\");\n        SettingTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<DirectiveTriviaSyntax, SyntaxToken>(WrappedType, \"SettingToken\");\n        TargetTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<DirectiveTriviaSyntax, SyntaxToken>(WrappedType, \"TargetToken\");\n    }\n\n    private NullableDirectiveTriviaSyntaxWrapper(DirectiveTriviaSyntax node) =>\n        this.node = node;\n\n    public DirectiveTriviaSyntax Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public DirectiveTriviaSyntax SyntaxNode => this.node;\n\n    public SyntaxToken HashToken => this.node.HashToken;\n    private static readonly Func<DirectiveTriviaSyntax, SyntaxToken> NullableKeywordAccessor;\n    public SyntaxToken NullableKeyword => (SyntaxToken)NullableKeywordAccessor(this.node);\n    private static readonly Func<DirectiveTriviaSyntax, SyntaxToken> SettingTokenAccessor;\n    public SyntaxToken SettingToken => (SyntaxToken)SettingTokenAccessor(this.node);\n    private static readonly Func<DirectiveTriviaSyntax, SyntaxToken> TargetTokenAccessor;\n    public SyntaxToken TargetToken => (SyntaxToken)TargetTokenAccessor(this.node);\n    public SyntaxToken EndOfDirectiveToken => this.node.EndOfDirectiveToken;\n    public Boolean IsActive => this.node.IsActive;\n    public SyntaxToken DirectiveNameToken => this.node.DirectiveNameToken;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator NullableDirectiveTriviaSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new NullableDirectiveTriviaSyntaxWrapper((DirectiveTriviaSyntax)node);\n    }\n\n    public static implicit operator DirectiveTriviaSyntax(NullableDirectiveTriviaSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#NullableFlowState.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic enum NullableFlowState : System.Byte\n{\n    None = 0,\n    NotNull = 1,\n    MaybeNull = 2,\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#NullableTypeSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class NullableTypeSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(NullableTypeSyntax);\n\n    private static readonly Func<NullableTypeSyntax, Boolean> IsUnmanagedAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<NullableTypeSyntax, Boolean>(WrappedType, \"IsUnmanaged\");\n\n    private static readonly Func<NullableTypeSyntax, Boolean> IsNotNullAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<NullableTypeSyntax, Boolean>(WrappedType, \"IsNotNull\");\n\n    private static readonly Func<NullableTypeSyntax, Boolean> IsNintAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<NullableTypeSyntax, Boolean>(WrappedType, \"IsNint\");\n\n    private static readonly Func<NullableTypeSyntax, Boolean> IsNuintAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<NullableTypeSyntax, Boolean>(WrappedType, \"IsNuint\");\n\n    extension(NullableTypeSyntax @this)\n    {\n        public Boolean IsUnmanaged => (Boolean)IsUnmanagedAccessor(@this);\n        public Boolean IsNotNull => (Boolean)IsNotNullAccessor(@this);\n        public Boolean IsNint => (Boolean)IsNintAccessor(@this);\n        public Boolean IsNuint => (Boolean)IsNuintAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#OmittedTypeArgumentSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class OmittedTypeArgumentSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(OmittedTypeArgumentSyntax);\n\n    private static readonly Func<OmittedTypeArgumentSyntax, Boolean> IsUnmanagedAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<OmittedTypeArgumentSyntax, Boolean>(WrappedType, \"IsUnmanaged\");\n\n    private static readonly Func<OmittedTypeArgumentSyntax, Boolean> IsNotNullAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<OmittedTypeArgumentSyntax, Boolean>(WrappedType, \"IsNotNull\");\n\n    private static readonly Func<OmittedTypeArgumentSyntax, Boolean> IsNintAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<OmittedTypeArgumentSyntax, Boolean>(WrappedType, \"IsNint\");\n\n    private static readonly Func<OmittedTypeArgumentSyntax, Boolean> IsNuintAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<OmittedTypeArgumentSyntax, Boolean>(WrappedType, \"IsNuint\");\n\n    extension(OmittedTypeArgumentSyntax @this)\n    {\n        public Boolean IsUnmanaged => (Boolean)IsUnmanagedAccessor(@this);\n        public Boolean IsNotNull => (Boolean)IsNotNullAccessor(@this);\n        public Boolean IsNint => (Boolean)IsNintAccessor(@this);\n        public Boolean IsNuint => (Boolean)IsNuintAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#OperationKind.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static class OperationKindEx\n{\n    public const OperationKind None = (OperationKind)0;\n    public const OperationKind Invalid = (OperationKind)1;\n    public const OperationKind Block = (OperationKind)2;\n    public const OperationKind VariableDeclarationGroup = (OperationKind)3;\n    public const OperationKind Switch = (OperationKind)4;\n    public const OperationKind Loop = (OperationKind)5;\n    public const OperationKind Labeled = (OperationKind)6;\n    public const OperationKind Branch = (OperationKind)7;\n    public const OperationKind Empty = (OperationKind)8;\n    public const OperationKind Return = (OperationKind)9;\n    public const OperationKind YieldBreak = (OperationKind)10;\n    public const OperationKind Lock = (OperationKind)11;\n    public const OperationKind Try = (OperationKind)12;\n    public const OperationKind Using = (OperationKind)13;\n    public const OperationKind YieldReturn = (OperationKind)14;\n    public const OperationKind ExpressionStatement = (OperationKind)15;\n    public const OperationKind LocalFunction = (OperationKind)16;\n    public const OperationKind Stop = (OperationKind)17;\n    public const OperationKind End = (OperationKind)18;\n    public const OperationKind RaiseEvent = (OperationKind)19;\n    public const OperationKind Literal = (OperationKind)20;\n    public const OperationKind Conversion = (OperationKind)21;\n    public const OperationKind Invocation = (OperationKind)22;\n    public const OperationKind ArrayElementReference = (OperationKind)23;\n    public const OperationKind LocalReference = (OperationKind)24;\n    public const OperationKind ParameterReference = (OperationKind)25;\n    public const OperationKind FieldReference = (OperationKind)26;\n    public const OperationKind MethodReference = (OperationKind)27;\n    public const OperationKind PropertyReference = (OperationKind)28;\n    public const OperationKind EventReference = (OperationKind)30;\n    public const OperationKind Unary = (OperationKind)31;\n    public const OperationKind UnaryOperator = (OperationKind)31;\n    public const OperationKind Binary = (OperationKind)32;\n    public const OperationKind BinaryOperator = (OperationKind)32;\n    public const OperationKind Conditional = (OperationKind)33;\n    public const OperationKind Coalesce = (OperationKind)34;\n    public const OperationKind AnonymousFunction = (OperationKind)35;\n    public const OperationKind ObjectCreation = (OperationKind)36;\n    public const OperationKind TypeParameterObjectCreation = (OperationKind)37;\n    public const OperationKind ArrayCreation = (OperationKind)38;\n    public const OperationKind InstanceReference = (OperationKind)39;\n    public const OperationKind IsType = (OperationKind)40;\n    public const OperationKind Await = (OperationKind)41;\n    public const OperationKind SimpleAssignment = (OperationKind)42;\n    public const OperationKind CompoundAssignment = (OperationKind)43;\n    public const OperationKind Parenthesized = (OperationKind)44;\n    public const OperationKind EventAssignment = (OperationKind)45;\n    public const OperationKind ConditionalAccess = (OperationKind)46;\n    public const OperationKind ConditionalAccessInstance = (OperationKind)47;\n    public const OperationKind InterpolatedString = (OperationKind)48;\n    public const OperationKind AnonymousObjectCreation = (OperationKind)49;\n    public const OperationKind ObjectOrCollectionInitializer = (OperationKind)50;\n    public const OperationKind MemberInitializer = (OperationKind)51;\n    public const OperationKind CollectionElementInitializer = (OperationKind)52;\n    public const OperationKind NameOf = (OperationKind)53;\n    public const OperationKind Tuple = (OperationKind)54;\n    public const OperationKind DynamicObjectCreation = (OperationKind)55;\n    public const OperationKind DynamicMemberReference = (OperationKind)56;\n    public const OperationKind DynamicInvocation = (OperationKind)57;\n    public const OperationKind DynamicIndexerAccess = (OperationKind)58;\n    public const OperationKind TranslatedQuery = (OperationKind)59;\n    public const OperationKind DelegateCreation = (OperationKind)60;\n    public const OperationKind DefaultValue = (OperationKind)61;\n    public const OperationKind TypeOf = (OperationKind)62;\n    public const OperationKind SizeOf = (OperationKind)63;\n    public const OperationKind AddressOf = (OperationKind)64;\n    public const OperationKind IsPattern = (OperationKind)65;\n    public const OperationKind Increment = (OperationKind)66;\n    public const OperationKind Throw = (OperationKind)67;\n    public const OperationKind Decrement = (OperationKind)68;\n    public const OperationKind DeconstructionAssignment = (OperationKind)69;\n    public const OperationKind DeclarationExpression = (OperationKind)70;\n    public const OperationKind OmittedArgument = (OperationKind)71;\n    public const OperationKind FieldInitializer = (OperationKind)72;\n    public const OperationKind VariableInitializer = (OperationKind)73;\n    public const OperationKind PropertyInitializer = (OperationKind)74;\n    public const OperationKind ParameterInitializer = (OperationKind)75;\n    public const OperationKind ArrayInitializer = (OperationKind)76;\n    public const OperationKind VariableDeclarator = (OperationKind)77;\n    public const OperationKind VariableDeclaration = (OperationKind)78;\n    public const OperationKind Argument = (OperationKind)79;\n    public const OperationKind CatchClause = (OperationKind)80;\n    public const OperationKind SwitchCase = (OperationKind)81;\n    public const OperationKind CaseClause = (OperationKind)82;\n    public const OperationKind InterpolatedStringText = (OperationKind)83;\n    public const OperationKind Interpolation = (OperationKind)84;\n    public const OperationKind ConstantPattern = (OperationKind)85;\n    public const OperationKind DeclarationPattern = (OperationKind)86;\n    public const OperationKind TupleBinary = (OperationKind)87;\n    public const OperationKind TupleBinaryOperator = (OperationKind)87;\n    public const OperationKind MethodBody = (OperationKind)88;\n    public const OperationKind MethodBodyOperation = (OperationKind)88;\n    public const OperationKind ConstructorBody = (OperationKind)89;\n    public const OperationKind ConstructorBodyOperation = (OperationKind)89;\n    public const OperationKind Discard = (OperationKind)90;\n    public const OperationKind FlowCapture = (OperationKind)91;\n    public const OperationKind FlowCaptureReference = (OperationKind)92;\n    public const OperationKind IsNull = (OperationKind)93;\n    public const OperationKind CaughtException = (OperationKind)94;\n    public const OperationKind StaticLocalInitializationSemaphore = (OperationKind)95;\n    public const OperationKind FlowAnonymousFunction = (OperationKind)96;\n    public const OperationKind CoalesceAssignment = (OperationKind)97;\n    public const OperationKind Range = (OperationKind)99;\n    public const OperationKind ReDim = (OperationKind)101;\n    public const OperationKind ReDimClause = (OperationKind)102;\n    public const OperationKind RecursivePattern = (OperationKind)103;\n    public const OperationKind DiscardPattern = (OperationKind)104;\n    public const OperationKind SwitchExpression = (OperationKind)105;\n    public const OperationKind SwitchExpressionArm = (OperationKind)106;\n    public const OperationKind PropertySubpattern = (OperationKind)107;\n    public const OperationKind UsingDeclaration = (OperationKind)108;\n    public const OperationKind NegatedPattern = (OperationKind)109;\n    public const OperationKind BinaryPattern = (OperationKind)110;\n    public const OperationKind TypePattern = (OperationKind)111;\n    public const OperationKind RelationalPattern = (OperationKind)112;\n    public const OperationKind With = (OperationKind)113;\n    public const OperationKind InterpolatedStringHandlerCreation = (OperationKind)114;\n    public const OperationKind InterpolatedStringAddition = (OperationKind)115;\n    public const OperationKind InterpolatedStringAppendLiteral = (OperationKind)116;\n    public const OperationKind InterpolatedStringAppendFormatted = (OperationKind)117;\n    public const OperationKind InterpolatedStringAppendInvalid = (OperationKind)118;\n    public const OperationKind InterpolatedStringHandlerArgumentPlaceholder = (OperationKind)119;\n    public const OperationKind FunctionPointerInvocation = (OperationKind)120;\n    public const OperationKind ListPattern = (OperationKind)121;\n    public const OperationKind SlicePattern = (OperationKind)122;\n    public const OperationKind ImplicitIndexerReference = (OperationKind)123;\n    public const OperationKind Utf8String = (OperationKind)124;\n    public const OperationKind Attribute = (OperationKind)125;\n    public const OperationKind InlineArrayAccess = (OperationKind)126;\n    public const OperationKind CollectionExpression = (OperationKind)127;\n    public const OperationKind Spread = (OperationKind)128;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#OperatorDeclarationSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class OperatorDeclarationSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(OperatorDeclarationSyntax);\n\n    private static readonly Func<OperatorDeclarationSyntax, ExplicitInterfaceSpecifierSyntax> ExplicitInterfaceSpecifierAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<OperatorDeclarationSyntax, ExplicitInterfaceSpecifierSyntax>(WrappedType, \"ExplicitInterfaceSpecifier\");\n\n    private static readonly Func<OperatorDeclarationSyntax, SyntaxToken> CheckedKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<OperatorDeclarationSyntax, SyntaxToken>(WrappedType, \"CheckedKeyword\");\n\n    extension(OperatorDeclarationSyntax @this)\n    {\n        public ExplicitInterfaceSpecifierSyntax ExplicitInterfaceSpecifier => ExplicitInterfaceSpecifierAccessor(@this);\n        public SyntaxToken CheckedKeyword => (SyntaxToken)CheckedKeywordAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#OperatorMemberCrefSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class OperatorMemberCrefSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(OperatorMemberCrefSyntax);\n\n    private static readonly Func<OperatorMemberCrefSyntax, SyntaxToken> CheckedKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<OperatorMemberCrefSyntax, SyntaxToken>(WrappedType, \"CheckedKeyword\");\n\n    extension(OperatorMemberCrefSyntax @this)\n    {\n        public SyntaxToken CheckedKeyword => (SyntaxToken)CheckedKeywordAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ParenthesizedLambdaExpressionSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class ParenthesizedLambdaExpressionSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(ParenthesizedLambdaExpressionSyntax);\n\n    private static readonly Func<ParenthesizedLambdaExpressionSyntax, SyntaxList<AttributeListSyntax>> AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ParenthesizedLambdaExpressionSyntax, SyntaxList<AttributeListSyntax>>(WrappedType, \"AttributeLists\");\n\n    private static readonly Func<ParenthesizedLambdaExpressionSyntax, SyntaxTokenList> ModifiersAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ParenthesizedLambdaExpressionSyntax, SyntaxTokenList>(WrappedType, \"Modifiers\");\n\n    private static readonly Func<ParenthesizedLambdaExpressionSyntax, TypeSyntax> ReturnTypeAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ParenthesizedLambdaExpressionSyntax, TypeSyntax>(WrappedType, \"ReturnType\");\n\n    private static readonly Func<ParenthesizedLambdaExpressionSyntax, BlockSyntax> BlockAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ParenthesizedLambdaExpressionSyntax, BlockSyntax>(WrappedType, \"Block\");\n\n    private static readonly Func<ParenthesizedLambdaExpressionSyntax, ExpressionSyntax> ExpressionBodyAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ParenthesizedLambdaExpressionSyntax, ExpressionSyntax>(WrappedType, \"ExpressionBody\");\n\n    extension(ParenthesizedLambdaExpressionSyntax @this)\n    {\n        public SyntaxList<AttributeListSyntax> AttributeLists => (SyntaxList<AttributeListSyntax>)AttributeListsAccessor(@this);\n        public SyntaxTokenList Modifiers => (SyntaxTokenList)ModifiersAccessor(@this);\n        public TypeSyntax ReturnType => ReturnTypeAccessor(@this);\n        public BlockSyntax Block => BlockAccessor(@this);\n        public ExpressionSyntax ExpressionBody => ExpressionBodyAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ParenthesizedPatternSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct ParenthesizedPatternSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.ParenthesizedPatternSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static ParenthesizedPatternSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(ParenthesizedPatternSyntaxWrapper));\n        OpenParenTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxToken>(WrappedType, \"OpenParenToken\");\n        PatternAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, CSharpSyntaxNode>(WrappedType, \"Pattern\");\n        CloseParenTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxToken>(WrappedType, \"CloseParenToken\");\n    }\n\n    private ParenthesizedPatternSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    private static readonly Func<CSharpSyntaxNode, SyntaxToken> OpenParenTokenAccessor;\n    public SyntaxToken OpenParenToken => (SyntaxToken)OpenParenTokenAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, CSharpSyntaxNode> PatternAccessor;\n    public PatternSyntaxWrapper Pattern => (PatternSyntaxWrapper)PatternAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, SyntaxToken> CloseParenTokenAccessor;\n    public SyntaxToken CloseParenToken => (SyntaxToken)CloseParenTokenAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator ParenthesizedPatternSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new ParenthesizedPatternSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(ParenthesizedPatternSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static implicit operator PatternSyntaxWrapper(ParenthesizedPatternSyntaxWrapper up) => (PatternSyntaxWrapper)up.SyntaxNode;\n    public static explicit operator ParenthesizedPatternSyntaxWrapper(PatternSyntaxWrapper down) => (ParenthesizedPatternSyntaxWrapper)down.SyntaxNode;\n\n    public static implicit operator ExpressionOrPatternSyntaxWrapper(ParenthesizedPatternSyntaxWrapper up) => (ExpressionOrPatternSyntaxWrapper)up.SyntaxNode;\n    public static explicit operator ParenthesizedPatternSyntaxWrapper(ExpressionOrPatternSyntaxWrapper down) => (ParenthesizedPatternSyntaxWrapper)down.SyntaxNode;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ParenthesizedVariableDesignationSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct ParenthesizedVariableDesignationSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.ParenthesizedVariableDesignationSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static ParenthesizedVariableDesignationSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(ParenthesizedVariableDesignationSyntaxWrapper));\n        OpenParenTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxToken>(WrappedType, \"OpenParenToken\");\n        VariablesAccessor = LightupHelpers.CreateSeparatedSyntaxListPropertyAccessor<CSharpSyntaxNode, VariableDesignationSyntaxWrapper>(WrappedType, nameof(Variables));\n        CloseParenTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxToken>(WrappedType, \"CloseParenToken\");\n    }\n\n    private ParenthesizedVariableDesignationSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    private static readonly Func<CSharpSyntaxNode, SyntaxToken> OpenParenTokenAccessor;\n    public SyntaxToken OpenParenToken => (SyntaxToken)OpenParenTokenAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, SeparatedSyntaxListWrapper<VariableDesignationSyntaxWrapper>> VariablesAccessor;\n    public SeparatedSyntaxListWrapper<VariableDesignationSyntaxWrapper> Variables => VariablesAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, SyntaxToken> CloseParenTokenAccessor;\n    public SyntaxToken CloseParenToken => (SyntaxToken)CloseParenTokenAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator ParenthesizedVariableDesignationSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new ParenthesizedVariableDesignationSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(ParenthesizedVariableDesignationSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static implicit operator VariableDesignationSyntaxWrapper(ParenthesizedVariableDesignationSyntaxWrapper up) => (VariableDesignationSyntaxWrapper)up.SyntaxNode;\n    public static explicit operator ParenthesizedVariableDesignationSyntaxWrapper(VariableDesignationSyntaxWrapper down) => (ParenthesizedVariableDesignationSyntaxWrapper)down.SyntaxNode;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#PatternSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct PatternSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.PatternSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static PatternSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(PatternSyntaxWrapper));\n\n    }\n\n    private PatternSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator PatternSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new PatternSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(PatternSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static implicit operator ExpressionOrPatternSyntaxWrapper(PatternSyntaxWrapper up) => (ExpressionOrPatternSyntaxWrapper)up.SyntaxNode;\n    public static explicit operator PatternSyntaxWrapper(ExpressionOrPatternSyntaxWrapper down) => (PatternSyntaxWrapper)down.SyntaxNode;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#Platform.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static class PlatformEx\n{\n    public const Platform Arm64 = (Platform)6;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#PointerTypeSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class PointerTypeSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(PointerTypeSyntax);\n\n    private static readonly Func<PointerTypeSyntax, Boolean> IsUnmanagedAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<PointerTypeSyntax, Boolean>(WrappedType, \"IsUnmanaged\");\n\n    private static readonly Func<PointerTypeSyntax, Boolean> IsNotNullAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<PointerTypeSyntax, Boolean>(WrappedType, \"IsNotNull\");\n\n    private static readonly Func<PointerTypeSyntax, Boolean> IsNintAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<PointerTypeSyntax, Boolean>(WrappedType, \"IsNint\");\n\n    private static readonly Func<PointerTypeSyntax, Boolean> IsNuintAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<PointerTypeSyntax, Boolean>(WrappedType, \"IsNuint\");\n\n    extension(PointerTypeSyntax @this)\n    {\n        public Boolean IsUnmanaged => (Boolean)IsUnmanagedAccessor(@this);\n        public Boolean IsNotNull => (Boolean)IsNotNullAccessor(@this);\n        public Boolean IsNint => (Boolean)IsNintAccessor(@this);\n        public Boolean IsNuint => (Boolean)IsNuintAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#PositionalPatternClauseSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct PositionalPatternClauseSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.PositionalPatternClauseSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static PositionalPatternClauseSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(PositionalPatternClauseSyntaxWrapper));\n        OpenParenTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxToken>(WrappedType, \"OpenParenToken\");\n        SubpatternsAccessor = LightupHelpers.CreateSeparatedSyntaxListPropertyAccessor<CSharpSyntaxNode, SubpatternSyntaxWrapper>(WrappedType, nameof(Subpatterns));\n        CloseParenTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxToken>(WrappedType, \"CloseParenToken\");\n    }\n\n    private PositionalPatternClauseSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    private static readonly Func<CSharpSyntaxNode, SyntaxToken> OpenParenTokenAccessor;\n    public SyntaxToken OpenParenToken => (SyntaxToken)OpenParenTokenAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, SeparatedSyntaxListWrapper<SubpatternSyntaxWrapper>> SubpatternsAccessor;\n    public SeparatedSyntaxListWrapper<SubpatternSyntaxWrapper> Subpatterns => SubpatternsAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, SyntaxToken> CloseParenTokenAccessor;\n    public SyntaxToken CloseParenToken => (SyntaxToken)CloseParenTokenAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator PositionalPatternClauseSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new PositionalPatternClauseSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(PositionalPatternClauseSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#PredefinedTypeSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class PredefinedTypeSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(PredefinedTypeSyntax);\n\n    private static readonly Func<PredefinedTypeSyntax, Boolean> IsUnmanagedAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<PredefinedTypeSyntax, Boolean>(WrappedType, \"IsUnmanaged\");\n\n    private static readonly Func<PredefinedTypeSyntax, Boolean> IsNotNullAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<PredefinedTypeSyntax, Boolean>(WrappedType, \"IsNotNull\");\n\n    private static readonly Func<PredefinedTypeSyntax, Boolean> IsNintAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<PredefinedTypeSyntax, Boolean>(WrappedType, \"IsNint\");\n\n    private static readonly Func<PredefinedTypeSyntax, Boolean> IsNuintAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<PredefinedTypeSyntax, Boolean>(WrappedType, \"IsNuint\");\n\n    extension(PredefinedTypeSyntax @this)\n    {\n        public Boolean IsUnmanaged => (Boolean)IsUnmanagedAccessor(@this);\n        public Boolean IsNotNull => (Boolean)IsNotNullAccessor(@this);\n        public Boolean IsNint => (Boolean)IsNintAccessor(@this);\n        public Boolean IsNuint => (Boolean)IsNuintAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#PrimaryConstructorBaseTypeSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct PrimaryConstructorBaseTypeSyntaxWrapper: ISyntaxWrapper<BaseTypeSyntax>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.PrimaryConstructorBaseTypeSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly BaseTypeSyntax node;\n\n    static PrimaryConstructorBaseTypeSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(PrimaryConstructorBaseTypeSyntaxWrapper));\n        ArgumentListAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<BaseTypeSyntax, ArgumentListSyntax>(WrappedType, \"ArgumentList\");\n    }\n\n    private PrimaryConstructorBaseTypeSyntaxWrapper(BaseTypeSyntax node) =>\n        this.node = node;\n\n    public BaseTypeSyntax Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public BaseTypeSyntax SyntaxNode => this.node;\n\n    public TypeSyntax Type => this.node.Type;\n    private static readonly Func<BaseTypeSyntax, ArgumentListSyntax> ArgumentListAccessor;\n    public ArgumentListSyntax ArgumentList => ArgumentListAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator PrimaryConstructorBaseTypeSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new PrimaryConstructorBaseTypeSyntaxWrapper((BaseTypeSyntax)node);\n    }\n\n    public static implicit operator BaseTypeSyntax(PrimaryConstructorBaseTypeSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#PropertyPatternClauseSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct PropertyPatternClauseSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.PropertyPatternClauseSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static PropertyPatternClauseSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(PropertyPatternClauseSyntaxWrapper));\n        OpenBraceTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxToken>(WrappedType, \"OpenBraceToken\");\n        SubpatternsAccessor = LightupHelpers.CreateSeparatedSyntaxListPropertyAccessor<CSharpSyntaxNode, SubpatternSyntaxWrapper>(WrappedType, nameof(Subpatterns));\n        CloseBraceTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxToken>(WrappedType, \"CloseBraceToken\");\n    }\n\n    private PropertyPatternClauseSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    private static readonly Func<CSharpSyntaxNode, SyntaxToken> OpenBraceTokenAccessor;\n    public SyntaxToken OpenBraceToken => (SyntaxToken)OpenBraceTokenAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, SeparatedSyntaxListWrapper<SubpatternSyntaxWrapper>> SubpatternsAccessor;\n    public SeparatedSyntaxListWrapper<SubpatternSyntaxWrapper> Subpatterns => SubpatternsAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, SyntaxToken> CloseBraceTokenAccessor;\n    public SyntaxToken CloseBraceToken => (SyntaxToken)CloseBraceTokenAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator PropertyPatternClauseSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new PropertyPatternClauseSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(PropertyPatternClauseSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#QualifiedNameSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class QualifiedNameSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(QualifiedNameSyntax);\n\n    private static readonly Func<QualifiedNameSyntax, Boolean> IsUnmanagedAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<QualifiedNameSyntax, Boolean>(WrappedType, \"IsUnmanaged\");\n\n    private static readonly Func<QualifiedNameSyntax, Boolean> IsNotNullAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<QualifiedNameSyntax, Boolean>(WrappedType, \"IsNotNull\");\n\n    private static readonly Func<QualifiedNameSyntax, Boolean> IsNintAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<QualifiedNameSyntax, Boolean>(WrappedType, \"IsNint\");\n\n    private static readonly Func<QualifiedNameSyntax, Boolean> IsNuintAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<QualifiedNameSyntax, Boolean>(WrappedType, \"IsNuint\");\n\n    extension(QualifiedNameSyntax @this)\n    {\n        public Boolean IsUnmanaged => (Boolean)IsUnmanagedAccessor(@this);\n        public Boolean IsNotNull => (Boolean)IsNotNullAccessor(@this);\n        public Boolean IsNint => (Boolean)IsNintAccessor(@this);\n        public Boolean IsNuint => (Boolean)IsNuintAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#RangeExpressionSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct RangeExpressionSyntaxWrapper: ISyntaxWrapper<ExpressionSyntax>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.RangeExpressionSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly ExpressionSyntax node;\n\n    static RangeExpressionSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(RangeExpressionSyntaxWrapper));\n        LeftOperandAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ExpressionSyntax, ExpressionSyntax>(WrappedType, \"LeftOperand\");\n        OperatorTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ExpressionSyntax, SyntaxToken>(WrappedType, \"OperatorToken\");\n        RightOperandAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ExpressionSyntax, ExpressionSyntax>(WrappedType, \"RightOperand\");\n    }\n\n    private RangeExpressionSyntaxWrapper(ExpressionSyntax node) =>\n        this.node = node;\n\n    public ExpressionSyntax Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public ExpressionSyntax SyntaxNode => this.node;\n\n    private static readonly Func<ExpressionSyntax, ExpressionSyntax> LeftOperandAccessor;\n    public ExpressionSyntax LeftOperand => LeftOperandAccessor(this.node);\n    private static readonly Func<ExpressionSyntax, SyntaxToken> OperatorTokenAccessor;\n    public SyntaxToken OperatorToken => (SyntaxToken)OperatorTokenAccessor(this.node);\n    private static readonly Func<ExpressionSyntax, ExpressionSyntax> RightOperandAccessor;\n    public ExpressionSyntax RightOperand => RightOperandAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator RangeExpressionSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new RangeExpressionSyntaxWrapper((ExpressionSyntax)node);\n    }\n\n    public static implicit operator ExpressionSyntax(RangeExpressionSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#RecordDeclarationSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct RecordDeclarationSyntaxWrapper: ISyntaxWrapper<TypeDeclarationSyntax>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.RecordDeclarationSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly TypeDeclarationSyntax node;\n\n    static RecordDeclarationSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(RecordDeclarationSyntaxWrapper));\n        ClassOrStructKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeDeclarationSyntax, SyntaxToken>(WrappedType, \"ClassOrStructKeyword\");\n        ParameterListAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeDeclarationSyntax, ParameterListSyntax>(WrappedType, \"ParameterList\");\n    }\n\n    private RecordDeclarationSyntaxWrapper(TypeDeclarationSyntax node) =>\n        this.node = node;\n\n    public TypeDeclarationSyntax Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public TypeDeclarationSyntax SyntaxNode => this.node;\n\n    public SyntaxList<AttributeListSyntax> AttributeLists => this.node.AttributeLists;\n    public SyntaxTokenList Modifiers => this.node.Modifiers;\n    public SyntaxToken Keyword => this.node.Keyword;\n    private static readonly Func<TypeDeclarationSyntax, SyntaxToken> ClassOrStructKeywordAccessor;\n    public SyntaxToken ClassOrStructKeyword => (SyntaxToken)ClassOrStructKeywordAccessor(this.node);\n    public SyntaxToken Identifier => this.node.Identifier;\n    public TypeParameterListSyntax TypeParameterList => this.node.TypeParameterList;\n    private static readonly Func<TypeDeclarationSyntax, ParameterListSyntax> ParameterListAccessor;\n    public ParameterListSyntax ParameterList => ParameterListAccessor(this.node);\n    public BaseListSyntax BaseList => this.node.BaseList;\n    public SyntaxList<TypeParameterConstraintClauseSyntax> ConstraintClauses => this.node.ConstraintClauses;\n    public SyntaxToken OpenBraceToken => this.node.OpenBraceToken;\n    public SyntaxList<MemberDeclarationSyntax> Members => this.node.Members;\n    public SyntaxToken CloseBraceToken => this.node.CloseBraceToken;\n    public SyntaxToken SemicolonToken => this.node.SemicolonToken;\n    public Int32 Arity => this.node.Arity;\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator RecordDeclarationSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new RecordDeclarationSyntaxWrapper((TypeDeclarationSyntax)node);\n    }\n\n    public static implicit operator TypeDeclarationSyntax(RecordDeclarationSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#RecursivePatternSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct RecursivePatternSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.RecursivePatternSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static RecursivePatternSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(RecursivePatternSyntaxWrapper));\n        TypeAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, TypeSyntax>(WrappedType, \"Type\");\n        PositionalPatternClauseAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, CSharpSyntaxNode>(WrappedType, \"PositionalPatternClause\");\n        PropertyPatternClauseAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, CSharpSyntaxNode>(WrappedType, \"PropertyPatternClause\");\n        DesignationAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, CSharpSyntaxNode>(WrappedType, \"Designation\");\n    }\n\n    private RecursivePatternSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    private static readonly Func<CSharpSyntaxNode, TypeSyntax> TypeAccessor;\n    public TypeSyntax Type => TypeAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, CSharpSyntaxNode> PositionalPatternClauseAccessor;\n    public PositionalPatternClauseSyntaxWrapper PositionalPatternClause => (PositionalPatternClauseSyntaxWrapper)PositionalPatternClauseAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, CSharpSyntaxNode> PropertyPatternClauseAccessor;\n    public PropertyPatternClauseSyntaxWrapper PropertyPatternClause => (PropertyPatternClauseSyntaxWrapper)PropertyPatternClauseAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, CSharpSyntaxNode> DesignationAccessor;\n    public VariableDesignationSyntaxWrapper Designation => (VariableDesignationSyntaxWrapper)DesignationAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator RecursivePatternSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new RecursivePatternSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(RecursivePatternSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static implicit operator PatternSyntaxWrapper(RecursivePatternSyntaxWrapper up) => (PatternSyntaxWrapper)up.SyntaxNode;\n    public static explicit operator RecursivePatternSyntaxWrapper(PatternSyntaxWrapper down) => (RecursivePatternSyntaxWrapper)down.SyntaxNode;\n\n    public static implicit operator ExpressionOrPatternSyntaxWrapper(RecursivePatternSyntaxWrapper up) => (ExpressionOrPatternSyntaxWrapper)up.SyntaxNode;\n    public static explicit operator RecursivePatternSyntaxWrapper(ExpressionOrPatternSyntaxWrapper down) => (RecursivePatternSyntaxWrapper)down.SyntaxNode;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#RefExpressionSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct RefExpressionSyntaxWrapper: ISyntaxWrapper<ExpressionSyntax>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.RefExpressionSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly ExpressionSyntax node;\n\n    static RefExpressionSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(RefExpressionSyntaxWrapper));\n        RefKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ExpressionSyntax, SyntaxToken>(WrappedType, \"RefKeyword\");\n        ExpressionAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ExpressionSyntax, ExpressionSyntax>(WrappedType, \"Expression\");\n    }\n\n    private RefExpressionSyntaxWrapper(ExpressionSyntax node) =>\n        this.node = node;\n\n    public ExpressionSyntax Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public ExpressionSyntax SyntaxNode => this.node;\n\n    private static readonly Func<ExpressionSyntax, SyntaxToken> RefKeywordAccessor;\n    public SyntaxToken RefKeyword => (SyntaxToken)RefKeywordAccessor(this.node);\n    private static readonly Func<ExpressionSyntax, ExpressionSyntax> ExpressionAccessor;\n    public ExpressionSyntax Expression => ExpressionAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator RefExpressionSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new RefExpressionSyntaxWrapper((ExpressionSyntax)node);\n    }\n\n    public static implicit operator ExpressionSyntax(RefExpressionSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#RefKind.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static class RefKindEx\n{\n    public const RefKind In = (RefKind)3;\n    public const RefKind RefReadOnly = (RefKind)3;\n    public const RefKind RefReadOnlyParameter = (RefKind)4;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#RefStructConstraintSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct RefStructConstraintSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.RefStructConstraintSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static RefStructConstraintSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(RefStructConstraintSyntaxWrapper));\n        RefKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxToken>(WrappedType, \"RefKeyword\");\n        StructKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxToken>(WrappedType, \"StructKeyword\");\n    }\n\n    private RefStructConstraintSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    private static readonly Func<CSharpSyntaxNode, SyntaxToken> RefKeywordAccessor;\n    public SyntaxToken RefKeyword => (SyntaxToken)RefKeywordAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, SyntaxToken> StructKeywordAccessor;\n    public SyntaxToken StructKeyword => (SyntaxToken)StructKeywordAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator RefStructConstraintSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new RefStructConstraintSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(RefStructConstraintSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static implicit operator AllowsConstraintSyntaxWrapper(RefStructConstraintSyntaxWrapper up) => (AllowsConstraintSyntaxWrapper)up.SyntaxNode;\n    public static explicit operator RefStructConstraintSyntaxWrapper(AllowsConstraintSyntaxWrapper down) => (RefStructConstraintSyntaxWrapper)down.SyntaxNode;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#RefTypeSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct RefTypeSyntaxWrapper: ISyntaxWrapper<TypeSyntax>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.RefTypeSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly TypeSyntax node;\n\n    static RefTypeSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(RefTypeSyntaxWrapper));\n        RefKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeSyntax, SyntaxToken>(WrappedType, \"RefKeyword\");\n        ReadOnlyKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeSyntax, SyntaxToken>(WrappedType, \"ReadOnlyKeyword\");\n        TypeAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeSyntax, TypeSyntax>(WrappedType, \"Type\");\n        IsUnmanagedAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeSyntax, Boolean>(WrappedType, \"IsUnmanaged\");\n        IsNotNullAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeSyntax, Boolean>(WrappedType, \"IsNotNull\");\n        IsNintAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeSyntax, Boolean>(WrappedType, \"IsNint\");\n        IsNuintAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeSyntax, Boolean>(WrappedType, \"IsNuint\");\n    }\n\n    private RefTypeSyntaxWrapper(TypeSyntax node) =>\n        this.node = node;\n\n    public TypeSyntax Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public TypeSyntax SyntaxNode => this.node;\n\n    private static readonly Func<TypeSyntax, SyntaxToken> RefKeywordAccessor;\n    public SyntaxToken RefKeyword => (SyntaxToken)RefKeywordAccessor(this.node);\n    private static readonly Func<TypeSyntax, SyntaxToken> ReadOnlyKeywordAccessor;\n    public SyntaxToken ReadOnlyKeyword => (SyntaxToken)ReadOnlyKeywordAccessor(this.node);\n    private static readonly Func<TypeSyntax, TypeSyntax> TypeAccessor;\n    public TypeSyntax Type => TypeAccessor(this.node);\n    public Boolean IsVar => this.node.IsVar;\n    private static readonly Func<TypeSyntax, Boolean> IsUnmanagedAccessor;\n    public Boolean IsUnmanaged => (Boolean)IsUnmanagedAccessor(this.node);\n    private static readonly Func<TypeSyntax, Boolean> IsNotNullAccessor;\n    public Boolean IsNotNull => (Boolean)IsNotNullAccessor(this.node);\n    private static readonly Func<TypeSyntax, Boolean> IsNintAccessor;\n    public Boolean IsNint => (Boolean)IsNintAccessor(this.node);\n    private static readonly Func<TypeSyntax, Boolean> IsNuintAccessor;\n    public Boolean IsNuint => (Boolean)IsNuintAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator RefTypeSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new RefTypeSyntaxWrapper((TypeSyntax)node);\n    }\n\n    public static implicit operator TypeSyntax(RefTypeSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#RelationalPatternSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct RelationalPatternSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.RelationalPatternSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static RelationalPatternSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(RelationalPatternSyntaxWrapper));\n        OperatorTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxToken>(WrappedType, \"OperatorToken\");\n        ExpressionAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, ExpressionSyntax>(WrappedType, \"Expression\");\n    }\n\n    private RelationalPatternSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    private static readonly Func<CSharpSyntaxNode, SyntaxToken> OperatorTokenAccessor;\n    public SyntaxToken OperatorToken => (SyntaxToken)OperatorTokenAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, ExpressionSyntax> ExpressionAccessor;\n    public ExpressionSyntax Expression => ExpressionAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator RelationalPatternSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new RelationalPatternSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(RelationalPatternSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static implicit operator PatternSyntaxWrapper(RelationalPatternSyntaxWrapper up) => (PatternSyntaxWrapper)up.SyntaxNode;\n    public static explicit operator RelationalPatternSyntaxWrapper(PatternSyntaxWrapper down) => (RelationalPatternSyntaxWrapper)down.SyntaxNode;\n\n    public static implicit operator ExpressionOrPatternSyntaxWrapper(RelationalPatternSyntaxWrapper up) => (ExpressionOrPatternSyntaxWrapper)up.SyntaxNode;\n    public static explicit operator RelationalPatternSyntaxWrapper(ExpressionOrPatternSyntaxWrapper down) => (RelationalPatternSyntaxWrapper)down.SyntaxNode;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ReturnStatementSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class ReturnStatementSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(ReturnStatementSyntax);\n\n    private static readonly Func<ReturnStatementSyntax, SyntaxList<AttributeListSyntax>> AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ReturnStatementSyntax, SyntaxList<AttributeListSyntax>>(WrappedType, \"AttributeLists\");\n\n    extension(ReturnStatementSyntax @this)\n    {\n        public SyntaxList<AttributeListSyntax> AttributeLists => (SyntaxList<AttributeListSyntax>)AttributeListsAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#RuntimeCapability.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic enum RuntimeCapability : System.Int32\n{\n    ByRefFields = 1,\n    CovariantReturnsOfClasses = 2,\n    DefaultImplementationsOfInterfaces = 3,\n    NumericIntPtr = 4,\n    UnmanagedSignatureCallingConvention = 5,\n    VirtualStaticsInInterfaces = 6,\n    InlineArrayTypes = 7,\n    ByRefLikeGenerics = 8,\n    RuntimeAsyncMethods = 9,\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#SarifVersion.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic enum SarifVersion : System.Int32\n{\n    Sarif1 = 1,\n    Sarif2 = 2,\n    Default = 1,\n    Latest = 2147483647,\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ScopedKind.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic enum ScopedKind : System.Byte\n{\n    None = 0,\n    ScopedRef = 1,\n    ScopedValue = 2,\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ScopedTypeSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct ScopedTypeSyntaxWrapper: ISyntaxWrapper<TypeSyntax>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.ScopedTypeSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly TypeSyntax node;\n\n    static ScopedTypeSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(ScopedTypeSyntaxWrapper));\n        ScopedKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeSyntax, SyntaxToken>(WrappedType, \"ScopedKeyword\");\n        TypeAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeSyntax, TypeSyntax>(WrappedType, \"Type\");\n        IsUnmanagedAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeSyntax, Boolean>(WrappedType, \"IsUnmanaged\");\n        IsNotNullAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeSyntax, Boolean>(WrappedType, \"IsNotNull\");\n        IsNintAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeSyntax, Boolean>(WrappedType, \"IsNint\");\n        IsNuintAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeSyntax, Boolean>(WrappedType, \"IsNuint\");\n    }\n\n    private ScopedTypeSyntaxWrapper(TypeSyntax node) =>\n        this.node = node;\n\n    public TypeSyntax Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public TypeSyntax SyntaxNode => this.node;\n\n    private static readonly Func<TypeSyntax, SyntaxToken> ScopedKeywordAccessor;\n    public SyntaxToken ScopedKeyword => (SyntaxToken)ScopedKeywordAccessor(this.node);\n    private static readonly Func<TypeSyntax, TypeSyntax> TypeAccessor;\n    public TypeSyntax Type => TypeAccessor(this.node);\n    public Boolean IsVar => this.node.IsVar;\n    private static readonly Func<TypeSyntax, Boolean> IsUnmanagedAccessor;\n    public Boolean IsUnmanaged => (Boolean)IsUnmanagedAccessor(this.node);\n    private static readonly Func<TypeSyntax, Boolean> IsNotNullAccessor;\n    public Boolean IsNotNull => (Boolean)IsNotNullAccessor(this.node);\n    private static readonly Func<TypeSyntax, Boolean> IsNintAccessor;\n    public Boolean IsNint => (Boolean)IsNintAccessor(this.node);\n    private static readonly Func<TypeSyntax, Boolean> IsNuintAccessor;\n    public Boolean IsNuint => (Boolean)IsNuintAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator ScopedTypeSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new ScopedTypeSyntaxWrapper((TypeSyntax)node);\n    }\n\n    public static implicit operator TypeSyntax(ScopedTypeSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#SemanticEditKind.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Emit;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static class SemanticEditKindEx\n{\n    public const SemanticEditKind Replace = (SemanticEditKind)4;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#SemanticModelOptions.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\n[System.FlagsAttribute]\npublic enum SemanticModelOptions : System.Int32\n{\n    None = 0,\n    IgnoreAccessibility = 1,\n    DisableNullableAnalysis = 2,\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ShebangDirectiveTriviaSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class ShebangDirectiveTriviaSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(ShebangDirectiveTriviaSyntax);\n\n    private static readonly Func<ShebangDirectiveTriviaSyntax, SyntaxToken> ContentAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ShebangDirectiveTriviaSyntax, SyntaxToken>(WrappedType, \"Content\");\n\n    extension(ShebangDirectiveTriviaSyntax @this)\n    {\n        public SyntaxToken Content => (SyntaxToken)ContentAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#SimpleLambdaExpressionSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class SimpleLambdaExpressionSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(SimpleLambdaExpressionSyntax);\n\n    private static readonly Func<SimpleLambdaExpressionSyntax, SyntaxList<AttributeListSyntax>> AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<SimpleLambdaExpressionSyntax, SyntaxList<AttributeListSyntax>>(WrappedType, \"AttributeLists\");\n\n    private static readonly Func<SimpleLambdaExpressionSyntax, SyntaxTokenList> ModifiersAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<SimpleLambdaExpressionSyntax, SyntaxTokenList>(WrappedType, \"Modifiers\");\n\n    private static readonly Func<SimpleLambdaExpressionSyntax, BlockSyntax> BlockAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<SimpleLambdaExpressionSyntax, BlockSyntax>(WrappedType, \"Block\");\n\n    private static readonly Func<SimpleLambdaExpressionSyntax, ExpressionSyntax> ExpressionBodyAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<SimpleLambdaExpressionSyntax, ExpressionSyntax>(WrappedType, \"ExpressionBody\");\n\n    extension(SimpleLambdaExpressionSyntax @this)\n    {\n        public SyntaxList<AttributeListSyntax> AttributeLists => (SyntaxList<AttributeListSyntax>)AttributeListsAccessor(@this);\n        public SyntaxTokenList Modifiers => (SyntaxTokenList)ModifiersAccessor(@this);\n        public BlockSyntax Block => BlockAccessor(@this);\n        public ExpressionSyntax ExpressionBody => ExpressionBodyAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#SimpleNameSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class SimpleNameSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(SimpleNameSyntax);\n\n    private static readonly Func<SimpleNameSyntax, Boolean> IsUnmanagedAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<SimpleNameSyntax, Boolean>(WrappedType, \"IsUnmanaged\");\n\n    private static readonly Func<SimpleNameSyntax, Boolean> IsNotNullAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<SimpleNameSyntax, Boolean>(WrappedType, \"IsNotNull\");\n\n    private static readonly Func<SimpleNameSyntax, Boolean> IsNintAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<SimpleNameSyntax, Boolean>(WrappedType, \"IsNint\");\n\n    private static readonly Func<SimpleNameSyntax, Boolean> IsNuintAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<SimpleNameSyntax, Boolean>(WrappedType, \"IsNuint\");\n\n    extension(SimpleNameSyntax @this)\n    {\n        public Boolean IsUnmanaged => (Boolean)IsUnmanagedAccessor(@this);\n        public Boolean IsNotNull => (Boolean)IsNotNullAccessor(@this);\n        public Boolean IsNint => (Boolean)IsNintAccessor(@this);\n        public Boolean IsNuint => (Boolean)IsNuintAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#SingleVariableDesignationSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct SingleVariableDesignationSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.SingleVariableDesignationSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static SingleVariableDesignationSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(SingleVariableDesignationSyntaxWrapper));\n        IdentifierAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxToken>(WrappedType, \"Identifier\");\n    }\n\n    private SingleVariableDesignationSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    private static readonly Func<CSharpSyntaxNode, SyntaxToken> IdentifierAccessor;\n    public SyntaxToken Identifier => (SyntaxToken)IdentifierAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator SingleVariableDesignationSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new SingleVariableDesignationSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(SingleVariableDesignationSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static implicit operator VariableDesignationSyntaxWrapper(SingleVariableDesignationSyntaxWrapper up) => (VariableDesignationSyntaxWrapper)up.SyntaxNode;\n    public static explicit operator SingleVariableDesignationSyntaxWrapper(VariableDesignationSyntaxWrapper down) => (SingleVariableDesignationSyntaxWrapper)down.SyntaxNode;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#SlicePatternSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct SlicePatternSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.SlicePatternSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static SlicePatternSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(SlicePatternSyntaxWrapper));\n        DotDotTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxToken>(WrappedType, \"DotDotToken\");\n        PatternAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, CSharpSyntaxNode>(WrappedType, \"Pattern\");\n    }\n\n    private SlicePatternSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    private static readonly Func<CSharpSyntaxNode, SyntaxToken> DotDotTokenAccessor;\n    public SyntaxToken DotDotToken => (SyntaxToken)DotDotTokenAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, CSharpSyntaxNode> PatternAccessor;\n    public PatternSyntaxWrapper Pattern => (PatternSyntaxWrapper)PatternAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator SlicePatternSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new SlicePatternSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(SlicePatternSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static implicit operator PatternSyntaxWrapper(SlicePatternSyntaxWrapper up) => (PatternSyntaxWrapper)up.SyntaxNode;\n    public static explicit operator SlicePatternSyntaxWrapper(PatternSyntaxWrapper down) => (SlicePatternSyntaxWrapper)down.SyntaxNode;\n\n    public static implicit operator ExpressionOrPatternSyntaxWrapper(SlicePatternSyntaxWrapper up) => (ExpressionOrPatternSyntaxWrapper)up.SyntaxNode;\n    public static explicit operator SlicePatternSyntaxWrapper(ExpressionOrPatternSyntaxWrapper down) => (SlicePatternSyntaxWrapper)down.SyntaxNode;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#SpecialType.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static class SpecialTypeEx\n{\n    public const SpecialType System_Runtime_CompilerServices_RuntimeFeature = (SpecialType)44;\n    public const SpecialType System_Runtime_CompilerServices_PreserveBaseOverridesAttribute = (SpecialType)45;\n    public const SpecialType System_Runtime_CompilerServices_InlineArrayAttribute = (SpecialType)46;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#SpreadElementSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct SpreadElementSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.SpreadElementSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static SpreadElementSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(SpreadElementSyntaxWrapper));\n        OperatorTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxToken>(WrappedType, \"OperatorToken\");\n        ExpressionAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, ExpressionSyntax>(WrappedType, \"Expression\");\n    }\n\n    private SpreadElementSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    private static readonly Func<CSharpSyntaxNode, SyntaxToken> OperatorTokenAccessor;\n    public SyntaxToken OperatorToken => (SyntaxToken)OperatorTokenAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, ExpressionSyntax> ExpressionAccessor;\n    public ExpressionSyntax Expression => ExpressionAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator SpreadElementSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new SpreadElementSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(SpreadElementSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static implicit operator CollectionElementSyntaxWrapper(SpreadElementSyntaxWrapper up) => (CollectionElementSyntaxWrapper)up.SyntaxNode;\n    public static explicit operator SpreadElementSyntaxWrapper(CollectionElementSyntaxWrapper down) => (SpreadElementSyntaxWrapper)down.SyntaxNode;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#StackAllocArrayCreationExpressionSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class StackAllocArrayCreationExpressionSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(StackAllocArrayCreationExpressionSyntax);\n\n    private static readonly Func<StackAllocArrayCreationExpressionSyntax, InitializerExpressionSyntax> InitializerAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<StackAllocArrayCreationExpressionSyntax, InitializerExpressionSyntax>(WrappedType, \"Initializer\");\n\n    extension(StackAllocArrayCreationExpressionSyntax @this)\n    {\n        public InitializerExpressionSyntax Initializer => InitializerAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#StatementSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class StatementSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(StatementSyntax);\n\n    private static readonly Func<StatementSyntax, SyntaxList<AttributeListSyntax>> AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<StatementSyntax, SyntaxList<AttributeListSyntax>>(WrappedType, \"AttributeLists\");\n\n    extension(StatementSyntax @this)\n    {\n        public SyntaxList<AttributeListSyntax> AttributeLists => (SyntaxList<AttributeListSyntax>)AttributeListsAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#StructDeclarationSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class StructDeclarationSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(StructDeclarationSyntax);\n\n    private static readonly Func<StructDeclarationSyntax, ParameterListSyntax> ParameterListAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<StructDeclarationSyntax, ParameterListSyntax>(WrappedType, \"ParameterList\");\n\n    extension(StructDeclarationSyntax @this)\n    {\n        public ParameterListSyntax ParameterList => ParameterListAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#SubpatternSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct SubpatternSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.SubpatternSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static SubpatternSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(SubpatternSyntaxWrapper));\n        NameColonAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, NameColonSyntax>(WrappedType, \"NameColon\");\n        ExpressionColonAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, CSharpSyntaxNode>(WrappedType, \"ExpressionColon\");\n        PatternAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, CSharpSyntaxNode>(WrappedType, \"Pattern\");\n    }\n\n    private SubpatternSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    private static readonly Func<CSharpSyntaxNode, NameColonSyntax> NameColonAccessor;\n    public NameColonSyntax NameColon => NameColonAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, CSharpSyntaxNode> ExpressionColonAccessor;\n    public BaseExpressionColonSyntaxWrapper ExpressionColon => (BaseExpressionColonSyntaxWrapper)ExpressionColonAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, CSharpSyntaxNode> PatternAccessor;\n    public PatternSyntaxWrapper Pattern => (PatternSyntaxWrapper)PatternAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator SubpatternSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new SubpatternSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(SubpatternSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#SwitchExpressionArmSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct SwitchExpressionArmSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionArmSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static SwitchExpressionArmSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(SwitchExpressionArmSyntaxWrapper));\n        PatternAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, CSharpSyntaxNode>(WrappedType, \"Pattern\");\n        WhenClauseAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, CSharpSyntaxNode>(WrappedType, \"WhenClause\");\n        EqualsGreaterThanTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxToken>(WrappedType, \"EqualsGreaterThanToken\");\n        ExpressionAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, ExpressionSyntax>(WrappedType, \"Expression\");\n    }\n\n    private SwitchExpressionArmSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    private static readonly Func<CSharpSyntaxNode, CSharpSyntaxNode> PatternAccessor;\n    public PatternSyntaxWrapper Pattern => (PatternSyntaxWrapper)PatternAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, CSharpSyntaxNode> WhenClauseAccessor;\n    public WhenClauseSyntaxWrapper WhenClause => (WhenClauseSyntaxWrapper)WhenClauseAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, SyntaxToken> EqualsGreaterThanTokenAccessor;\n    public SyntaxToken EqualsGreaterThanToken => (SyntaxToken)EqualsGreaterThanTokenAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, ExpressionSyntax> ExpressionAccessor;\n    public ExpressionSyntax Expression => ExpressionAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator SwitchExpressionArmSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new SwitchExpressionArmSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(SwitchExpressionArmSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#SwitchExpressionSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct SwitchExpressionSyntaxWrapper: ISyntaxWrapper<ExpressionSyntax>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.SwitchExpressionSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly ExpressionSyntax node;\n\n    static SwitchExpressionSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(SwitchExpressionSyntaxWrapper));\n        GoverningExpressionAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ExpressionSyntax, ExpressionSyntax>(WrappedType, \"GoverningExpression\");\n        SwitchKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ExpressionSyntax, SyntaxToken>(WrappedType, \"SwitchKeyword\");\n        OpenBraceTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ExpressionSyntax, SyntaxToken>(WrappedType, \"OpenBraceToken\");\n        ArmsAccessor = LightupHelpers.CreateSeparatedSyntaxListPropertyAccessor<ExpressionSyntax, SwitchExpressionArmSyntaxWrapper>(WrappedType, nameof(Arms));\n        CloseBraceTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ExpressionSyntax, SyntaxToken>(WrappedType, \"CloseBraceToken\");\n    }\n\n    private SwitchExpressionSyntaxWrapper(ExpressionSyntax node) =>\n        this.node = node;\n\n    public ExpressionSyntax Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public ExpressionSyntax SyntaxNode => this.node;\n\n    private static readonly Func<ExpressionSyntax, ExpressionSyntax> GoverningExpressionAccessor;\n    public ExpressionSyntax GoverningExpression => GoverningExpressionAccessor(this.node);\n    private static readonly Func<ExpressionSyntax, SyntaxToken> SwitchKeywordAccessor;\n    public SyntaxToken SwitchKeyword => (SyntaxToken)SwitchKeywordAccessor(this.node);\n    private static readonly Func<ExpressionSyntax, SyntaxToken> OpenBraceTokenAccessor;\n    public SyntaxToken OpenBraceToken => (SyntaxToken)OpenBraceTokenAccessor(this.node);\n    private static readonly Func<ExpressionSyntax, SeparatedSyntaxListWrapper<SwitchExpressionArmSyntaxWrapper>> ArmsAccessor;\n    public SeparatedSyntaxListWrapper<SwitchExpressionArmSyntaxWrapper> Arms => ArmsAccessor(this.node);\n    private static readonly Func<ExpressionSyntax, SyntaxToken> CloseBraceTokenAccessor;\n    public SyntaxToken CloseBraceToken => (SyntaxToken)CloseBraceTokenAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator SwitchExpressionSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new SwitchExpressionSyntaxWrapper((ExpressionSyntax)node);\n    }\n\n    public static implicit operator ExpressionSyntax(SwitchExpressionSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#SwitchStatementSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class SwitchStatementSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(SwitchStatementSyntax);\n\n    private static readonly Func<SwitchStatementSyntax, SyntaxList<AttributeListSyntax>> AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<SwitchStatementSyntax, SyntaxList<AttributeListSyntax>>(WrappedType, \"AttributeLists\");\n\n    extension(SwitchStatementSyntax @this)\n    {\n        public SyntaxList<AttributeListSyntax> AttributeLists => (SyntaxList<AttributeListSyntax>)AttributeListsAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#SymbolDisplayLocalOptions.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static class SymbolDisplayLocalOptionsEx\n{\n    public const SymbolDisplayLocalOptions IncludeRef = (SymbolDisplayLocalOptions)4;\n    public const SymbolDisplayLocalOptions IncludeModifiers = (SymbolDisplayLocalOptions)4;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#SymbolDisplayMemberOptions.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static class SymbolDisplayMemberOptionsEx\n{\n    public const SymbolDisplayMemberOptions IncludeRef = (SymbolDisplayMemberOptions)128;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#SymbolDisplayMiscellaneousOptions.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static class SymbolDisplayMiscellaneousOptionsEx\n{\n    public const SymbolDisplayMiscellaneousOptions IncludeNullableReferenceTypeModifier = (SymbolDisplayMiscellaneousOptions)64;\n    public const SymbolDisplayMiscellaneousOptions AllowDefaultLiteral = (SymbolDisplayMiscellaneousOptions)128;\n    public const SymbolDisplayMiscellaneousOptions IncludeNotNullableReferenceTypeModifier = (SymbolDisplayMiscellaneousOptions)256;\n    public const SymbolDisplayMiscellaneousOptions CollapseTupleTypes = (SymbolDisplayMiscellaneousOptions)512;\n    public const SymbolDisplayMiscellaneousOptions ExpandValueTuple = (SymbolDisplayMiscellaneousOptions)1024;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#SymbolDisplayParameterOptions.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static class SymbolDisplayParameterOptionsEx\n{\n    public const SymbolDisplayParameterOptions IncludeModifiers = (SymbolDisplayParameterOptions)2;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#SymbolDisplayPartKind.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static class SymbolDisplayPartKindEx\n{\n    public const SymbolDisplayPartKind EnumMemberName = (SymbolDisplayPartKind)28;\n    public const SymbolDisplayPartKind ExtensionMethodName = (SymbolDisplayPartKind)29;\n    public const SymbolDisplayPartKind ConstantName = (SymbolDisplayPartKind)30;\n    public const SymbolDisplayPartKind RecordClassName = (SymbolDisplayPartKind)31;\n    public const SymbolDisplayPartKind RecordStructName = (SymbolDisplayPartKind)32;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#SymbolKind.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static class SymbolKindEx\n{\n    public const SymbolKind Discard = (SymbolKind)19;\n    public const SymbolKind FunctionPointerType = (SymbolKind)20;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#SyntaxKind.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static class SyntaxKindEx\n{\n    public const SyntaxKind DotDotToken = (SyntaxKind)8222;\n    public const SyntaxKind QuestionQuestionEqualsToken = (SyntaxKind)8284;\n    public const SyntaxKind GreaterThanGreaterThanGreaterThanToken = (SyntaxKind)8286;\n    public const SyntaxKind GreaterThanGreaterThanGreaterThanEqualsToken = (SyntaxKind)8287;\n    public const SyntaxKind OrKeyword = (SyntaxKind)8438;\n    public const SyntaxKind AndKeyword = (SyntaxKind)8439;\n    public const SyntaxKind NotKeyword = (SyntaxKind)8440;\n    public const SyntaxKind WithKeyword = (SyntaxKind)8442;\n    public const SyntaxKind InitKeyword = (SyntaxKind)8443;\n    public const SyntaxKind RecordKeyword = (SyntaxKind)8444;\n    public const SyntaxKind ManagedKeyword = (SyntaxKind)8445;\n    public const SyntaxKind UnmanagedKeyword = (SyntaxKind)8446;\n    public const SyntaxKind RequiredKeyword = (SyntaxKind)8447;\n    public const SyntaxKind ScopedKeyword = (SyntaxKind)8448;\n    public const SyntaxKind FileKeyword = (SyntaxKind)8449;\n    public const SyntaxKind AllowsKeyword = (SyntaxKind)8450;\n    public const SyntaxKind ExtensionKeyword = (SyntaxKind)8451;\n    public const SyntaxKind NullableKeyword = (SyntaxKind)8486;\n    public const SyntaxKind EnableKeyword = (SyntaxKind)8487;\n    public const SyntaxKind WarningsKeyword = (SyntaxKind)8488;\n    public const SyntaxKind AnnotationsKeyword = (SyntaxKind)8489;\n    public const SyntaxKind VarKeyword = (SyntaxKind)8490;\n    public const SyntaxKind UnderscoreToken = (SyntaxKind)8491;\n    public const SyntaxKind SingleLineRawStringLiteralToken = (SyntaxKind)8518;\n    public const SyntaxKind MultiLineRawStringLiteralToken = (SyntaxKind)8519;\n    public const SyntaxKind Utf8StringLiteralToken = (SyntaxKind)8520;\n    public const SyntaxKind Utf8SingleLineRawStringLiteralToken = (SyntaxKind)8521;\n    public const SyntaxKind Utf8MultiLineRawStringLiteralToken = (SyntaxKind)8522;\n    public const SyntaxKind RazorContentToken = (SyntaxKind)8523;\n    public const SyntaxKind ConflictMarkerTrivia = (SyntaxKind)8564;\n    public const SyntaxKind ExtensionMemberCref = (SyntaxKind)8607;\n    public const SyntaxKind IsPatternExpression = (SyntaxKind)8657;\n    public const SyntaxKind RangeExpression = (SyntaxKind)8658;\n    public const SyntaxKind ImplicitObjectCreationExpression = (SyntaxKind)8659;\n    public const SyntaxKind UnsignedRightShiftExpression = (SyntaxKind)8692;\n    public const SyntaxKind CoalesceAssignmentExpression = (SyntaxKind)8725;\n    public const SyntaxKind UnsignedRightShiftAssignmentExpression = (SyntaxKind)8726;\n    public const SyntaxKind IndexExpression = (SyntaxKind)8741;\n    public const SyntaxKind DefaultLiteralExpression = (SyntaxKind)8755;\n    public const SyntaxKind Utf8StringLiteralExpression = (SyntaxKind)8756;\n    public const SyntaxKind FieldExpression = (SyntaxKind)8757;\n    public const SyntaxKind LocalFunctionStatement = (SyntaxKind)8830;\n    public const SyntaxKind FileScopedNamespaceDeclaration = (SyntaxKind)8845;\n    public const SyntaxKind AllowsConstraintClause = (SyntaxKind)8879;\n    public const SyntaxKind RefStructConstraint = (SyntaxKind)8880;\n    public const SyntaxKind TupleType = (SyntaxKind)8924;\n    public const SyntaxKind TupleElement = (SyntaxKind)8925;\n    public const SyntaxKind TupleExpression = (SyntaxKind)8926;\n    public const SyntaxKind SingleVariableDesignation = (SyntaxKind)8927;\n    public const SyntaxKind ParenthesizedVariableDesignation = (SyntaxKind)8928;\n    public const SyntaxKind ForEachVariableStatement = (SyntaxKind)8929;\n    public const SyntaxKind DeclarationPattern = (SyntaxKind)9000;\n    public const SyntaxKind ConstantPattern = (SyntaxKind)9002;\n    public const SyntaxKind CasePatternSwitchLabel = (SyntaxKind)9009;\n    public const SyntaxKind WhenClause = (SyntaxKind)9013;\n    public const SyntaxKind DiscardDesignation = (SyntaxKind)9014;\n    public const SyntaxKind RecursivePattern = (SyntaxKind)9020;\n    public const SyntaxKind PropertyPatternClause = (SyntaxKind)9021;\n    public const SyntaxKind Subpattern = (SyntaxKind)9022;\n    public const SyntaxKind PositionalPatternClause = (SyntaxKind)9023;\n    public const SyntaxKind DiscardPattern = (SyntaxKind)9024;\n    public const SyntaxKind SwitchExpression = (SyntaxKind)9025;\n    public const SyntaxKind SwitchExpressionArm = (SyntaxKind)9026;\n    public const SyntaxKind VarPattern = (SyntaxKind)9027;\n    public const SyntaxKind ParenthesizedPattern = (SyntaxKind)9028;\n    public const SyntaxKind RelationalPattern = (SyntaxKind)9029;\n    public const SyntaxKind TypePattern = (SyntaxKind)9030;\n    public const SyntaxKind OrPattern = (SyntaxKind)9031;\n    public const SyntaxKind AndPattern = (SyntaxKind)9032;\n    public const SyntaxKind NotPattern = (SyntaxKind)9033;\n    public const SyntaxKind SlicePattern = (SyntaxKind)9034;\n    public const SyntaxKind ListPattern = (SyntaxKind)9035;\n    public const SyntaxKind DeclarationExpression = (SyntaxKind)9040;\n    public const SyntaxKind RefExpression = (SyntaxKind)9050;\n    public const SyntaxKind RefType = (SyntaxKind)9051;\n    public const SyntaxKind ThrowExpression = (SyntaxKind)9052;\n    public const SyntaxKind ImplicitStackAllocArrayCreationExpression = (SyntaxKind)9053;\n    public const SyntaxKind SuppressNullableWarningExpression = (SyntaxKind)9054;\n    public const SyntaxKind NullableDirectiveTrivia = (SyntaxKind)9055;\n    public const SyntaxKind FunctionPointerType = (SyntaxKind)9056;\n    public const SyntaxKind FunctionPointerParameter = (SyntaxKind)9057;\n    public const SyntaxKind FunctionPointerParameterList = (SyntaxKind)9058;\n    public const SyntaxKind FunctionPointerCallingConvention = (SyntaxKind)9059;\n    public const SyntaxKind InitAccessorDeclaration = (SyntaxKind)9060;\n    public const SyntaxKind WithExpression = (SyntaxKind)9061;\n    public const SyntaxKind WithInitializerExpression = (SyntaxKind)9062;\n    public const SyntaxKind RecordDeclaration = (SyntaxKind)9063;\n    public const SyntaxKind DefaultConstraint = (SyntaxKind)9064;\n    public const SyntaxKind PrimaryConstructorBaseType = (SyntaxKind)9065;\n    public const SyntaxKind FunctionPointerUnmanagedCallingConventionList = (SyntaxKind)9066;\n    public const SyntaxKind FunctionPointerUnmanagedCallingConvention = (SyntaxKind)9067;\n    public const SyntaxKind RecordStructDeclaration = (SyntaxKind)9068;\n    public const SyntaxKind ExpressionColon = (SyntaxKind)9069;\n    public const SyntaxKind LineDirectivePosition = (SyntaxKind)9070;\n    public const SyntaxKind LineSpanDirectiveTrivia = (SyntaxKind)9071;\n    public const SyntaxKind InterpolatedSingleLineRawStringStartToken = (SyntaxKind)9072;\n    public const SyntaxKind InterpolatedMultiLineRawStringStartToken = (SyntaxKind)9073;\n    public const SyntaxKind InterpolatedRawStringEndToken = (SyntaxKind)9074;\n    public const SyntaxKind ScopedType = (SyntaxKind)9075;\n    public const SyntaxKind CollectionExpression = (SyntaxKind)9076;\n    public const SyntaxKind ExpressionElement = (SyntaxKind)9077;\n    public const SyntaxKind SpreadElement = (SyntaxKind)9078;\n    public const SyntaxKind ExtensionBlockDeclaration = (SyntaxKind)9079;\n    public const SyntaxKind IgnoredDirectiveTrivia = (SyntaxKind)9080;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ThrowExpressionSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct ThrowExpressionSyntaxWrapper: ISyntaxWrapper<ExpressionSyntax>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.ThrowExpressionSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly ExpressionSyntax node;\n\n    static ThrowExpressionSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(ThrowExpressionSyntaxWrapper));\n        ThrowKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ExpressionSyntax, SyntaxToken>(WrappedType, \"ThrowKeyword\");\n        ExpressionAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ExpressionSyntax, ExpressionSyntax>(WrappedType, \"Expression\");\n    }\n\n    private ThrowExpressionSyntaxWrapper(ExpressionSyntax node) =>\n        this.node = node;\n\n    public ExpressionSyntax Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public ExpressionSyntax SyntaxNode => this.node;\n\n    private static readonly Func<ExpressionSyntax, SyntaxToken> ThrowKeywordAccessor;\n    public SyntaxToken ThrowKeyword => (SyntaxToken)ThrowKeywordAccessor(this.node);\n    private static readonly Func<ExpressionSyntax, ExpressionSyntax> ExpressionAccessor;\n    public ExpressionSyntax Expression => ExpressionAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator ThrowExpressionSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new ThrowExpressionSyntaxWrapper((ExpressionSyntax)node);\n    }\n\n    public static implicit operator ExpressionSyntax(ThrowExpressionSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#ThrowStatementSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class ThrowStatementSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(ThrowStatementSyntax);\n\n    private static readonly Func<ThrowStatementSyntax, SyntaxList<AttributeListSyntax>> AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ThrowStatementSyntax, SyntaxList<AttributeListSyntax>>(WrappedType, \"AttributeLists\");\n\n    extension(ThrowStatementSyntax @this)\n    {\n        public SyntaxList<AttributeListSyntax> AttributeLists => (SyntaxList<AttributeListSyntax>)AttributeListsAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#TryStatementSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class TryStatementSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(TryStatementSyntax);\n\n    private static readonly Func<TryStatementSyntax, SyntaxList<AttributeListSyntax>> AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TryStatementSyntax, SyntaxList<AttributeListSyntax>>(WrappedType, \"AttributeLists\");\n\n    extension(TryStatementSyntax @this)\n    {\n        public SyntaxList<AttributeListSyntax> AttributeLists => (SyntaxList<AttributeListSyntax>)AttributeListsAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#TupleElementSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct TupleElementSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.TupleElementSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static TupleElementSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(TupleElementSyntaxWrapper));\n        TypeAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, TypeSyntax>(WrappedType, \"Type\");\n        IdentifierAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxToken>(WrappedType, \"Identifier\");\n    }\n\n    private TupleElementSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    private static readonly Func<CSharpSyntaxNode, TypeSyntax> TypeAccessor;\n    public TypeSyntax Type => TypeAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, SyntaxToken> IdentifierAccessor;\n    public SyntaxToken Identifier => (SyntaxToken)IdentifierAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator TupleElementSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new TupleElementSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(TupleElementSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#TupleExpressionSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct TupleExpressionSyntaxWrapper: ISyntaxWrapper<ExpressionSyntax>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.TupleExpressionSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly ExpressionSyntax node;\n\n    static TupleExpressionSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(TupleExpressionSyntaxWrapper));\n        OpenParenTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ExpressionSyntax, SyntaxToken>(WrappedType, \"OpenParenToken\");\n        ArgumentsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ExpressionSyntax, SeparatedSyntaxList<ArgumentSyntax>>(WrappedType, \"Arguments\");\n        CloseParenTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ExpressionSyntax, SyntaxToken>(WrappedType, \"CloseParenToken\");\n    }\n\n    private TupleExpressionSyntaxWrapper(ExpressionSyntax node) =>\n        this.node = node;\n\n    public ExpressionSyntax Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public ExpressionSyntax SyntaxNode => this.node;\n\n    private static readonly Func<ExpressionSyntax, SyntaxToken> OpenParenTokenAccessor;\n    public SyntaxToken OpenParenToken => (SyntaxToken)OpenParenTokenAccessor(this.node);\n    private static readonly Func<ExpressionSyntax, SeparatedSyntaxList<ArgumentSyntax>> ArgumentsAccessor;\n    public SeparatedSyntaxList<ArgumentSyntax> Arguments => (SeparatedSyntaxList<ArgumentSyntax>)ArgumentsAccessor(this.node);\n    private static readonly Func<ExpressionSyntax, SyntaxToken> CloseParenTokenAccessor;\n    public SyntaxToken CloseParenToken => (SyntaxToken)CloseParenTokenAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator TupleExpressionSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new TupleExpressionSyntaxWrapper((ExpressionSyntax)node);\n    }\n\n    public static implicit operator ExpressionSyntax(TupleExpressionSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#TupleTypeSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct TupleTypeSyntaxWrapper: ISyntaxWrapper<TypeSyntax>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.TupleTypeSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly TypeSyntax node;\n\n    static TupleTypeSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(TupleTypeSyntaxWrapper));\n        OpenParenTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeSyntax, SyntaxToken>(WrappedType, \"OpenParenToken\");\n        ElementsAccessor = LightupHelpers.CreateSeparatedSyntaxListPropertyAccessor<TypeSyntax, TupleElementSyntaxWrapper>(WrappedType, nameof(Elements));\n        CloseParenTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeSyntax, SyntaxToken>(WrappedType, \"CloseParenToken\");\n        IsUnmanagedAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeSyntax, Boolean>(WrappedType, \"IsUnmanaged\");\n        IsNotNullAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeSyntax, Boolean>(WrappedType, \"IsNotNull\");\n        IsNintAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeSyntax, Boolean>(WrappedType, \"IsNint\");\n        IsNuintAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeSyntax, Boolean>(WrappedType, \"IsNuint\");\n    }\n\n    private TupleTypeSyntaxWrapper(TypeSyntax node) =>\n        this.node = node;\n\n    public TypeSyntax Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public TypeSyntax SyntaxNode => this.node;\n\n    private static readonly Func<TypeSyntax, SyntaxToken> OpenParenTokenAccessor;\n    public SyntaxToken OpenParenToken => (SyntaxToken)OpenParenTokenAccessor(this.node);\n    private static readonly Func<TypeSyntax, SeparatedSyntaxListWrapper<TupleElementSyntaxWrapper>> ElementsAccessor;\n    public SeparatedSyntaxListWrapper<TupleElementSyntaxWrapper> Elements => ElementsAccessor(this.node);\n    private static readonly Func<TypeSyntax, SyntaxToken> CloseParenTokenAccessor;\n    public SyntaxToken CloseParenToken => (SyntaxToken)CloseParenTokenAccessor(this.node);\n    public Boolean IsVar => this.node.IsVar;\n    private static readonly Func<TypeSyntax, Boolean> IsUnmanagedAccessor;\n    public Boolean IsUnmanaged => (Boolean)IsUnmanagedAccessor(this.node);\n    private static readonly Func<TypeSyntax, Boolean> IsNotNullAccessor;\n    public Boolean IsNotNull => (Boolean)IsNotNullAccessor(this.node);\n    private static readonly Func<TypeSyntax, Boolean> IsNintAccessor;\n    public Boolean IsNint => (Boolean)IsNintAccessor(this.node);\n    private static readonly Func<TypeSyntax, Boolean> IsNuintAccessor;\n    public Boolean IsNuint => (Boolean)IsNuintAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator TupleTypeSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new TupleTypeSyntaxWrapper((TypeSyntax)node);\n    }\n\n    public static implicit operator TypeSyntax(TupleTypeSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#TypeDeclarationSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class TypeDeclarationSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(TypeDeclarationSyntax);\n\n    private static readonly Func<TypeDeclarationSyntax, ParameterListSyntax> ParameterListAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeDeclarationSyntax, ParameterListSyntax>(WrappedType, \"ParameterList\");\n\n    extension(TypeDeclarationSyntax @this)\n    {\n        public ParameterListSyntax ParameterList => ParameterListAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#TypeKind.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static class TypeKindEx\n{\n    public const TypeKind FunctionPointer = (TypeKind)13;\n    public const TypeKind Extension = (TypeKind)14;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#TypePatternSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct TypePatternSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.TypePatternSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static TypePatternSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(TypePatternSyntaxWrapper));\n        TypeAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, TypeSyntax>(WrappedType, \"Type\");\n    }\n\n    private TypePatternSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    private static readonly Func<CSharpSyntaxNode, TypeSyntax> TypeAccessor;\n    public TypeSyntax Type => TypeAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator TypePatternSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new TypePatternSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(TypePatternSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static implicit operator PatternSyntaxWrapper(TypePatternSyntaxWrapper up) => (PatternSyntaxWrapper)up.SyntaxNode;\n    public static explicit operator TypePatternSyntaxWrapper(PatternSyntaxWrapper down) => (TypePatternSyntaxWrapper)down.SyntaxNode;\n\n    public static implicit operator ExpressionOrPatternSyntaxWrapper(TypePatternSyntaxWrapper up) => (ExpressionOrPatternSyntaxWrapper)up.SyntaxNode;\n    public static explicit operator TypePatternSyntaxWrapper(ExpressionOrPatternSyntaxWrapper down) => (TypePatternSyntaxWrapper)down.SyntaxNode;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#TypeSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class TypeSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(TypeSyntax);\n\n    private static readonly Func<TypeSyntax, Boolean> IsUnmanagedAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeSyntax, Boolean>(WrappedType, \"IsUnmanaged\");\n\n    private static readonly Func<TypeSyntax, Boolean> IsNotNullAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeSyntax, Boolean>(WrappedType, \"IsNotNull\");\n\n    private static readonly Func<TypeSyntax, Boolean> IsNintAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeSyntax, Boolean>(WrappedType, \"IsNint\");\n\n    private static readonly Func<TypeSyntax, Boolean> IsNuintAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeSyntax, Boolean>(WrappedType, \"IsNuint\");\n\n    extension(TypeSyntax @this)\n    {\n        public Boolean IsUnmanaged => (Boolean)IsUnmanagedAccessor(@this);\n        public Boolean IsNotNull => (Boolean)IsNotNullAccessor(@this);\n        public Boolean IsNint => (Boolean)IsNintAccessor(@this);\n        public Boolean IsNuint => (Boolean)IsNuintAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#UnaryOperatorKind.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic enum UnaryOperatorKind : System.Int32\n{\n    None = 0,\n    BitwiseNegation = 1,\n    Not = 2,\n    Plus = 3,\n    Minus = 4,\n    True = 5,\n    False = 6,\n    Hat = 7,\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#UnaryPatternSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct UnaryPatternSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.UnaryPatternSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static UnaryPatternSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(UnaryPatternSyntaxWrapper));\n        OperatorTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxToken>(WrappedType, \"OperatorToken\");\n        PatternAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, CSharpSyntaxNode>(WrappedType, \"Pattern\");\n    }\n\n    private UnaryPatternSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    private static readonly Func<CSharpSyntaxNode, SyntaxToken> OperatorTokenAccessor;\n    public SyntaxToken OperatorToken => (SyntaxToken)OperatorTokenAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, CSharpSyntaxNode> PatternAccessor;\n    public PatternSyntaxWrapper Pattern => (PatternSyntaxWrapper)PatternAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator UnaryPatternSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new UnaryPatternSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(UnaryPatternSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static implicit operator PatternSyntaxWrapper(UnaryPatternSyntaxWrapper up) => (PatternSyntaxWrapper)up.SyntaxNode;\n    public static explicit operator UnaryPatternSyntaxWrapper(PatternSyntaxWrapper down) => (UnaryPatternSyntaxWrapper)down.SyntaxNode;\n\n    public static implicit operator ExpressionOrPatternSyntaxWrapper(UnaryPatternSyntaxWrapper up) => (ExpressionOrPatternSyntaxWrapper)up.SyntaxNode;\n    public static explicit operator UnaryPatternSyntaxWrapper(ExpressionOrPatternSyntaxWrapper down) => (UnaryPatternSyntaxWrapper)down.SyntaxNode;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#UnsafeStatementSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class UnsafeStatementSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(UnsafeStatementSyntax);\n\n    private static readonly Func<UnsafeStatementSyntax, SyntaxList<AttributeListSyntax>> AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<UnsafeStatementSyntax, SyntaxList<AttributeListSyntax>>(WrappedType, \"AttributeLists\");\n\n    extension(UnsafeStatementSyntax @this)\n    {\n        public SyntaxList<AttributeListSyntax> AttributeLists => (SyntaxList<AttributeListSyntax>)AttributeListsAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#UsingDirectiveSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class UsingDirectiveSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(UsingDirectiveSyntax);\n\n    private static readonly Func<UsingDirectiveSyntax, SyntaxToken> GlobalKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<UsingDirectiveSyntax, SyntaxToken>(WrappedType, \"GlobalKeyword\");\n\n    private static readonly Func<UsingDirectiveSyntax, SyntaxToken> UnsafeKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<UsingDirectiveSyntax, SyntaxToken>(WrappedType, \"UnsafeKeyword\");\n\n    private static readonly Func<UsingDirectiveSyntax, TypeSyntax> NamespaceOrTypeAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<UsingDirectiveSyntax, TypeSyntax>(WrappedType, \"NamespaceOrType\");\n\n    extension(UsingDirectiveSyntax @this)\n    {\n        public SyntaxToken GlobalKeyword => (SyntaxToken)GlobalKeywordAccessor(@this);\n        public SyntaxToken UnsafeKeyword => (SyntaxToken)UnsafeKeywordAccessor(@this);\n        public TypeSyntax NamespaceOrType => NamespaceOrTypeAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#UsingStatementSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class UsingStatementSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(UsingStatementSyntax);\n\n    private static readonly Func<UsingStatementSyntax, SyntaxList<AttributeListSyntax>> AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<UsingStatementSyntax, SyntaxList<AttributeListSyntax>>(WrappedType, \"AttributeLists\");\n\n    private static readonly Func<UsingStatementSyntax, SyntaxToken> AwaitKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<UsingStatementSyntax, SyntaxToken>(WrappedType, \"AwaitKeyword\");\n\n    extension(UsingStatementSyntax @this)\n    {\n        public SyntaxList<AttributeListSyntax> AttributeLists => (SyntaxList<AttributeListSyntax>)AttributeListsAccessor(@this);\n        public SyntaxToken AwaitKeyword => (SyntaxToken)AwaitKeywordAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#VarPatternSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct VarPatternSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.VarPatternSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static VarPatternSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(VarPatternSyntaxWrapper));\n        VarKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxToken>(WrappedType, \"VarKeyword\");\n        DesignationAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, CSharpSyntaxNode>(WrappedType, \"Designation\");\n    }\n\n    private VarPatternSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    private static readonly Func<CSharpSyntaxNode, SyntaxToken> VarKeywordAccessor;\n    public SyntaxToken VarKeyword => (SyntaxToken)VarKeywordAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, CSharpSyntaxNode> DesignationAccessor;\n    public VariableDesignationSyntaxWrapper Designation => (VariableDesignationSyntaxWrapper)DesignationAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator VarPatternSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new VarPatternSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(VarPatternSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static implicit operator PatternSyntaxWrapper(VarPatternSyntaxWrapper up) => (PatternSyntaxWrapper)up.SyntaxNode;\n    public static explicit operator VarPatternSyntaxWrapper(PatternSyntaxWrapper down) => (VarPatternSyntaxWrapper)down.SyntaxNode;\n\n    public static implicit operator ExpressionOrPatternSyntaxWrapper(VarPatternSyntaxWrapper up) => (ExpressionOrPatternSyntaxWrapper)up.SyntaxNode;\n    public static explicit operator VarPatternSyntaxWrapper(ExpressionOrPatternSyntaxWrapper down) => (VarPatternSyntaxWrapper)down.SyntaxNode;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#VariableDesignationSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct VariableDesignationSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.VariableDesignationSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static VariableDesignationSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(VariableDesignationSyntaxWrapper));\n\n    }\n\n    private VariableDesignationSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator VariableDesignationSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new VariableDesignationSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(VariableDesignationSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#WhenClauseSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct WhenClauseSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.WhenClauseSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly CSharpSyntaxNode node;\n\n    static WhenClauseSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(WhenClauseSyntaxWrapper));\n        WhenKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, SyntaxToken>(WrappedType, \"WhenKeyword\");\n        ConditionAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<CSharpSyntaxNode, ExpressionSyntax>(WrappedType, \"Condition\");\n    }\n\n    private WhenClauseSyntaxWrapper(CSharpSyntaxNode node) =>\n        this.node = node;\n\n    public CSharpSyntaxNode Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public CSharpSyntaxNode SyntaxNode => this.node;\n\n    private static readonly Func<CSharpSyntaxNode, SyntaxToken> WhenKeywordAccessor;\n    public SyntaxToken WhenKeyword => (SyntaxToken)WhenKeywordAccessor(this.node);\n    private static readonly Func<CSharpSyntaxNode, ExpressionSyntax> ConditionAccessor;\n    public ExpressionSyntax Condition => ConditionAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator WhenClauseSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new WhenClauseSyntaxWrapper((CSharpSyntaxNode)node);\n    }\n\n    public static implicit operator CSharpSyntaxNode(WhenClauseSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#WhileStatementSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class WhileStatementSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(WhileStatementSyntax);\n\n    private static readonly Func<WhileStatementSyntax, SyntaxList<AttributeListSyntax>> AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<WhileStatementSyntax, SyntaxList<AttributeListSyntax>>(WrappedType, \"AttributeLists\");\n\n    extension(WhileStatementSyntax @this)\n    {\n        public SyntaxList<AttributeListSyntax> AttributeLists => (SyntaxList<AttributeListSyntax>)AttributeListsAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#WithExpressionSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic readonly partial struct WithExpressionSyntaxWrapper: ISyntaxWrapper<ExpressionSyntax>\n{\n    public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.WithExpressionSyntax\";\n    private static readonly Type WrappedType;\n\n    private readonly ExpressionSyntax node;\n\n    static WithExpressionSyntaxWrapper()\n    {\n        WrappedType = SyntaxNodeTypes.LatestType(typeof(WithExpressionSyntaxWrapper));\n        ExpressionAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ExpressionSyntax, ExpressionSyntax>(WrappedType, \"Expression\");\n        WithKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ExpressionSyntax, SyntaxToken>(WrappedType, \"WithKeyword\");\n        InitializerAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ExpressionSyntax, InitializerExpressionSyntax>(WrappedType, \"Initializer\");\n    }\n\n    private WithExpressionSyntaxWrapper(ExpressionSyntax node) =>\n        this.node = node;\n\n    public ExpressionSyntax Node => this.node;\n\n    [Obsolete(\"Use Node instead\")]\n    public ExpressionSyntax SyntaxNode => this.node;\n\n    private static readonly Func<ExpressionSyntax, ExpressionSyntax> ExpressionAccessor;\n    public ExpressionSyntax Expression => ExpressionAccessor(this.node);\n    private static readonly Func<ExpressionSyntax, SyntaxToken> WithKeywordAccessor;\n    public SyntaxToken WithKeyword => (SyntaxToken)WithKeywordAccessor(this.node);\n    private static readonly Func<ExpressionSyntax, InitializerExpressionSyntax> InitializerAccessor;\n    public InitializerExpressionSyntax Initializer => InitializerAccessor(this.node);\n    public String Language => this.node.Language;\n    public Int32 RawKind => this.node.RawKind;\n    public TextSpan FullSpan => this.node.FullSpan;\n    public TextSpan Span => this.node.Span;\n    public Int32 SpanStart => this.node.SpanStart;\n    public Boolean IsMissing => this.node.IsMissing;\n    public Boolean IsStructuredTrivia => this.node.IsStructuredTrivia;\n    public Boolean HasStructuredTrivia => this.node.HasStructuredTrivia;\n    public Boolean ContainsSkippedText => this.node.ContainsSkippedText;\n    public Boolean ContainsDiagnostics => this.node.ContainsDiagnostics;\n    public Boolean ContainsDirectives => this.node.ContainsDirectives;\n    public Boolean HasLeadingTrivia => this.node.HasLeadingTrivia;\n    public Boolean HasTrailingTrivia => this.node.HasTrailingTrivia;\n    public SyntaxNode Parent => this.node.Parent;\n    public SyntaxTrivia ParentTrivia => this.node.ParentTrivia;\n    public Boolean ContainsAnnotations => this.node.ContainsAnnotations;\n\n    public static explicit operator WithExpressionSyntaxWrapper(SyntaxNode node)\n    {\n        if (node is null)\n        {\n            return default;\n        }\n\n        if (!IsInstance(node))\n        {\n            throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n        }\n\n        return new WithExpressionSyntaxWrapper((ExpressionSyntax)node);\n    }\n\n    public static implicit operator ExpressionSyntax(WithExpressionSyntaxWrapper wrapper) =>\n        wrapper.node;\n\n    public static bool IsInstance(SyntaxNode node) =>\n        node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Snapshots/Snap#YieldStatementSyntax.g.cs.verified.cs",
    "content": "﻿//<auto-generated/>\n/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing System;\nusing System.Collections.Immutable;\n\nnamespace SonarAnalyzer.ShimLayer;\n\npublic static partial class YieldStatementSyntaxShimExtensions\n{\n    private static readonly Type WrappedType = typeof(YieldStatementSyntax);\n\n    private static readonly Func<YieldStatementSyntax, SyntaxList<AttributeListSyntax>> AttributeListsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<YieldStatementSyntax, SyntaxList<AttributeListSyntax>>(WrappedType, \"AttributeLists\");\n\n    extension(YieldStatementSyntax @this)\n    {\n        public SyntaxList<AttributeListSyntax> AttributeLists => (SyntaxList<AttributeListSyntax>)AttributeListsAccessor(@this);\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/SonarAnalyzer.ShimLayer.Generator.Test.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFramework>net10.0</TargetFramework>\n    <IsPackable>false</IsPackable>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Verify.MSTest\" Version=\"31.16.1\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\src\\SonarAnalyzer.ShimLayer.Generator\\SonarAnalyzer.ShimLayer.Generator.csproj\" />\n    <ProjectReference Include=\"..\\SonarAnalyzer.TestFramework\\SonarAnalyzer.TestFramework.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Using Include=\"FluentAssertions\" />\n    <Using Include=\"Microsoft.CodeAnalysis\" />\n    <Using Include=\"Microsoft.CodeAnalysis.Diagnostics\" />\n    <Using Include=\"Microsoft.VisualStudio.TestTools.UnitTesting\" />\n    <Using Include=\"SonarAnalyzer.ShimLayer.Generator.Model\" />\n    <Using Include=\"SonarAnalyzer.ShimLayer.Generator.Strategies\" />\n    <Using Include=\"System.Reflection\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Compile Remove=\"Snapshots\\**\\*\" />\n    <None Include=\"Snapshots\\**\\*\">\n      <CopyToOutputDirectory>Never</CopyToOutputDirectory>\n    </None>\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Strategies/NewEnumStrategyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Diagnostics.CodeAnalysis;\nusing SonarAnalyzer.TestFramework.Extensions;\n\nnamespace SonarAnalyzer.ShimLayer.Generator.Strategies.Test;\n\n[TestClass]\npublic class NewEnumStrategyTest\n{\n    [Experimental(\"RSEXPERIMENTAL001\")] // Microsoft.CodeAnalysis.SemanticModelOptions' is for evaluation purposes only and is subject to change or removal in future updates.\n    private enum EnumWithExperimentalAttribute\n    {\n        Lorem,\n        Ipsum,\n    }\n\n    [TestMethod]\n    public void Generate()\n    {\n        using var typeLoader = new TypeLoader();\n        var type = typeLoader.LoadLatest().Single(x => x.Type.Name == nameof(IncrementalGeneratorOutputKind));\n        var sut = new NewEnumStrategy(type.Type, type.Members.OfType<FieldInfo>().Where(x => x.Name != \"value__\").ToArray());\n        sut.Generate([]).Should().BeIgnoringLineEndings(\"\"\"\n            //<auto-generated/>\n            /*\n             * SonarAnalyzer for .NET\n             * Copyright (C) SonarSource Sàrl\n             * mailto:info AT sonarsource DOT com\n             *\n             * You can redistribute and/or modify this program under the terms of\n             * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n             *\n             * This program is distributed in the hope that it will be useful,\n             * but WITHOUT ANY WARRANTY; without even the implied warranty of\n             * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n             * See the Sonar Source-Available License for more details.\n             *\n             * You should have received a copy of the Sonar Source-Available License\n             * along with this program; if not, see https://sonarsource.com/license/ssal/\n             */\n\n            using Microsoft.CodeAnalysis;\n            using Microsoft.CodeAnalysis.CSharp;\n            using Microsoft.CodeAnalysis.CSharp.Syntax;\n            using Microsoft.CodeAnalysis.Text;\n            using System;\n            using System.Collections.Immutable;\n\n            namespace SonarAnalyzer.ShimLayer;\n\n            [System.FlagsAttribute]\n            public enum IncrementalGeneratorOutputKind : System.Int32\n            {\n                None = 0,\n                Source = 1,\n                PostInit = 2,\n                Implementation = 4,\n                Host = 8,\n            }\n\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Generate_IgnoreExperimentalAttribute()\n    {\n#pragma warning disable RSEXPERIMENTAL001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.\n        var type = typeof(EnumWithExperimentalAttribute);\n        var sut = new NewEnumStrategy(type, type.GetMembers().OfType<FieldInfo>().Where(x => x.Name != \"value__\").ToArray());\n        sut.Generate([]).Should().BeIgnoringLineEndings(\"\"\"\n            //<auto-generated/>\n            /*\n             * SonarAnalyzer for .NET\n             * Copyright (C) SonarSource Sàrl\n             * mailto:info AT sonarsource DOT com\n             *\n             * You can redistribute and/or modify this program under the terms of\n             * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n             *\n             * This program is distributed in the hope that it will be useful,\n             * but WITHOUT ANY WARRANTY; without even the implied warranty of\n             * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n             * See the Sonar Source-Available License for more details.\n             *\n             * You should have received a copy of the Sonar Source-Available License\n             * along with this program; if not, see https://sonarsource.com/license/ssal/\n             */\n\n            using Microsoft.CodeAnalysis;\n            using Microsoft.CodeAnalysis.CSharp;\n            using Microsoft.CodeAnalysis.CSharp.Syntax;\n            using Microsoft.CodeAnalysis.Text;\n            using System;\n            using System.Collections.Immutable;\n\n            namespace SonarAnalyzer.ShimLayer;\n\n            public enum EnumWithExperimentalAttribute : System.Int32\n            {\n                Lorem = 0,\n                Ipsum = 1,\n            }\n\n            \"\"\");\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Strategies/NoChangeStrategyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.ShimLayer.Generator.Strategies.Test;\n\n[TestClass]\npublic class NoChangeStrategyTest\n{\n    [TestMethod]\n    public void Generate()\n    {\n        var sut = new NoChangeStrategy(typeof(NamespaceKind));\n        sut.Generate([]).Should().BeNull();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Strategies/PartialEnumStrategyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.TestFramework.Extensions;\n\nnamespace SonarAnalyzer.ShimLayer.Generator.Strategies.Test;\n\n[TestClass]\npublic class PartialEnumStrategyTest\n{\n    [TestMethod]\n    public void Generate()\n    {\n        var type = typeof(SymbolKind);\n        var sut = new PartialEnumStrategy(type, type.GetMembers().OfType<FieldInfo>().Where(x => x.Name is nameof(SymbolKind.Discard) or nameof(SymbolKind.RangeVariable)).ToArray());\n        sut.Generate([]).Should().BeIgnoringLineEndings(\"\"\"\n            //<auto-generated/>\n            /*\n             * SonarAnalyzer for .NET\n             * Copyright (C) SonarSource Sàrl\n             * mailto:info AT sonarsource DOT com\n             *\n             * You can redistribute and/or modify this program under the terms of\n             * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n             *\n             * This program is distributed in the hope that it will be useful,\n             * but WITHOUT ANY WARRANTY; without even the implied warranty of\n             * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n             * See the Sonar Source-Available License for more details.\n             *\n             * You should have received a copy of the Sonar Source-Available License\n             * along with this program; if not, see https://sonarsource.com/license/ssal/\n             */\n\n            using Microsoft.CodeAnalysis;\n            using Microsoft.CodeAnalysis.CSharp;\n            using Microsoft.CodeAnalysis.CSharp.Syntax;\n            using Microsoft.CodeAnalysis.Text;\n            using System;\n            using System.Collections.Immutable;\n\n            namespace SonarAnalyzer.ShimLayer;\n\n            public static class SymbolKindEx\n            {\n                public const SymbolKind RangeVariable = (SymbolKind)16;\n                public const SymbolKind Discard = (SymbolKind)19;\n            }\n\n            \"\"\");\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Strategies/SkipStrategyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.ShimLayer.Generator.Strategies.Test;\n\n[TestClass]\npublic class SkipStrategyTest\n{\n    [TestMethod]\n    public void SkipStrategy()\n    {\n        var sut = new SkipStrategy(typeof(SyntaxNode));\n        sut.Generate([]).Should().BeNull();\n    }\n\n    [TestMethod]\n    public void ReturnTypeSnippet() =>\n        new SkipStrategy(typeof(SyntaxNode)).Invoking(x => x.ReturnTypeSnippet()).Should().Throw<NotSupportedException>();\n\n    [TestMethod]\n    public void ToConversionSnippet() =>\n        new SkipStrategy(typeof(SyntaxNode)).Invoking(x => x.ToConversionSnippet(\"Lorem ipsum\")).Should().Throw<NotSupportedException>();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Strategies/SyntaxNodeExtendStrategyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing SonarAnalyzer.TestFramework.Extensions;\n\nnamespace SonarAnalyzer.ShimLayer.Generator.Strategies.Test;\n\n[TestClass]\npublic class SyntaxNodeExtendStrategyTest\n{\n    [TestMethod]\n    public void Generate_TypeDeclarationSyntax_Empty()\n    {\n        var sut = new SyntaxNodeExtendStrategy(typeof(TypeDeclarationSyntax), []);\n        sut.Generate([]).Should().BeNull();\n    }\n\n    [TestMethod]\n    public void Generate_ClassDeclarationSyntax_ParameterList()\n    {\n        var sut = new SyntaxNodeExtendStrategy(typeof(ClassDeclarationSyntax), [\n            new(typeof(ClassDeclarationSyntax).GetMember(nameof(ClassDeclarationSyntax.ParameterList))[0], false),\n            new(typeof(ClassDeclarationSyntax).GetMember(nameof(ClassDeclarationSyntax.SemicolonToken))[0], false),\n            new(typeof(ClassDeclarationSyntax).GetMember(nameof(ClassDeclarationSyntax.Span))[0], true), // exisiting member, should be ignored\n        ]);\n        var result = sut.Generate([]);\n        result.Should().BeIgnoringLineEndings(\n            \"\"\"\n            //<auto-generated/>\n            /*\n             * SonarAnalyzer for .NET\n             * Copyright (C) SonarSource Sàrl\n             * mailto:info AT sonarsource DOT com\n             *\n             * You can redistribute and/or modify this program under the terms of\n             * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n             *\n             * This program is distributed in the hope that it will be useful,\n             * but WITHOUT ANY WARRANTY; without even the implied warranty of\n             * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n             * See the Sonar Source-Available License for more details.\n             *\n             * You should have received a copy of the Sonar Source-Available License\n             * along with this program; if not, see https://sonarsource.com/license/ssal/\n             */\n\n            using Microsoft.CodeAnalysis;\n            using Microsoft.CodeAnalysis.CSharp;\n            using Microsoft.CodeAnalysis.CSharp.Syntax;\n            using Microsoft.CodeAnalysis.Text;\n            using System;\n            using System.Collections.Immutable;\n\n            namespace SonarAnalyzer.ShimLayer;\n\n            public static partial class ClassDeclarationSyntaxShimExtensions\n            {\n                private static readonly Type WrappedType = typeof(ClassDeclarationSyntax);\n\n                private static readonly Func<ClassDeclarationSyntax, ParameterListSyntax> ParameterListAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ClassDeclarationSyntax, ParameterListSyntax>(WrappedType, \"ParameterList\");\n\n                private static readonly Func<ClassDeclarationSyntax, SyntaxToken> SemicolonTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ClassDeclarationSyntax, SyntaxToken>(WrappedType, \"SemicolonToken\");\n\n\n                extension(ClassDeclarationSyntax @this)\n                {\n                    public ParameterListSyntax ParameterList => (ParameterListSyntax)ParameterListAccessor(@this);\n                    public SyntaxToken SemicolonToken => (SyntaxToken)SemicolonTokenAccessor(@this);\n                }\n            }\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Generate_ProcessStartInfo_GetterOnly()\n    {\n        var sut = new SyntaxNodeExtendStrategy(typeof(ProcessStartInfo), [\n            // FileName has a getter and a setter. We do not generate setters, because there are no SyntaxNode properties with setters.\n            new(typeof(ProcessStartInfo).GetMember(nameof(ProcessStartInfo.FileName))[0], false),\n        ]);\n        var result = sut.Generate([]);\n        result.Should().BeIgnoringLineEndings(\n            \"\"\"\n            //<auto-generated/>\n            /*\n             * SonarAnalyzer for .NET\n             * Copyright (C) SonarSource Sàrl\n             * mailto:info AT sonarsource DOT com\n             *\n             * You can redistribute and/or modify this program under the terms of\n             * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n             *\n             * This program is distributed in the hope that it will be useful,\n             * but WITHOUT ANY WARRANTY; without even the implied warranty of\n             * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n             * See the Sonar Source-Available License for more details.\n             *\n             * You should have received a copy of the Sonar Source-Available License\n             * along with this program; if not, see https://sonarsource.com/license/ssal/\n             */\n\n            using Microsoft.CodeAnalysis;\n            using Microsoft.CodeAnalysis.CSharp;\n            using Microsoft.CodeAnalysis.CSharp.Syntax;\n            using Microsoft.CodeAnalysis.Text;\n            using System;\n            using System.Collections.Immutable;\n            using System.Diagnostics;\n\n            namespace SonarAnalyzer.ShimLayer;\n\n            public static partial class ProcessStartInfoShimExtensions\n            {\n                private static readonly Type WrappedType = typeof(ProcessStartInfo);\n\n                private static readonly Func<ProcessStartInfo, String> FileNameAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ProcessStartInfo, String>(WrappedType, \"FileName\");\n\n\n                extension(ProcessStartInfo @this)\n                {\n                    public String FileName => (String)FileNameAccessor(@this);\n                }\n            }\n            \"\"\");\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/Strategies/SyntaxNodeWrapStrategyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing SonarAnalyzer.TestFramework.Extensions;\n\nnamespace SonarAnalyzer.ShimLayer.Generator.Strategies.Test;\n\n[TestClass]\npublic class SyntaxNodeWrapStrategyTest\n{\n    [TestMethod]\n    public void Generate_Empty()\n    {\n        var sut = new SyntaxNodeWrapStrategy(\n            typeof(RecordDeclarationSyntax),\n            typeof(TypeDeclarationSyntax),\n            []);\n        var result = sut.Generate([]);\n        result.Should().BeIgnoringLineEndings(\n            \"\"\"\n            //<auto-generated/>\n            /*\n             * SonarAnalyzer for .NET\n             * Copyright (C) SonarSource Sàrl\n             * mailto:info AT sonarsource DOT com\n             *\n             * You can redistribute and/or modify this program under the terms of\n             * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n             *\n             * This program is distributed in the hope that it will be useful,\n             * but WITHOUT ANY WARRANTY; without even the implied warranty of\n             * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n             * See the Sonar Source-Available License for more details.\n             *\n             * You should have received a copy of the Sonar Source-Available License\n             * along with this program; if not, see https://sonarsource.com/license/ssal/\n             */\n\n            using Microsoft.CodeAnalysis;\n            using Microsoft.CodeAnalysis.CSharp;\n            using Microsoft.CodeAnalysis.CSharp.Syntax;\n            using Microsoft.CodeAnalysis.Text;\n            using System;\n            using System.Collections.Immutable;\n\n            namespace SonarAnalyzer.ShimLayer;\n\n            public readonly partial struct RecordDeclarationSyntaxWrapper: ISyntaxWrapper<TypeDeclarationSyntax>\n            {\n                public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.RecordDeclarationSyntax\";\n                private static readonly Type WrappedType;\n\n                private readonly TypeDeclarationSyntax node;\n\n                static RecordDeclarationSyntaxWrapper()\n                {\n                    WrappedType = SyntaxNodeTypes.LatestType(typeof(RecordDeclarationSyntaxWrapper));\n\n                }\n\n                private RecordDeclarationSyntaxWrapper(TypeDeclarationSyntax node) =>\n                    this.node = node;\n\n                public TypeDeclarationSyntax Node => this.node;\n\n                [Obsolete(\"Use Node instead\")]\n                public TypeDeclarationSyntax SyntaxNode => this.node;\n\n\n\n                public static explicit operator RecordDeclarationSyntaxWrapper(SyntaxNode node)\n                {\n                    if (node is null)\n                    {\n                        return default;\n                    }\n\n                    if (!IsInstance(node))\n                    {\n                        throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n                    }\n\n                    return new RecordDeclarationSyntaxWrapper((TypeDeclarationSyntax)node);\n                }\n\n                public static implicit operator TypeDeclarationSyntax(RecordDeclarationSyntaxWrapper wrapper) =>\n                    wrapper.node;\n\n\n\n                public static bool IsInstance(SyntaxNode node) =>\n                    node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n            }\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Generate_RecordDeclarationSyntax()\n    {\n        var skippedPropertyTypeMember = (PropertyInfo)typeof(RecordDeclarationSyntax).GetMember(\"ConstraintClauses\")[0];\n        var sut = new SyntaxNodeWrapStrategy(\n            typeof(RecordDeclarationSyntax),\n            typeof(TypeDeclarationSyntax),\n            [\n                new(typeof(RecordDeclarationSyntax).GetMember(nameof(RecordDeclarationSyntax.Span))[0], true),\n                new(typeof(RecordDeclarationSyntax).GetMember(nameof(RecordDeclarationSyntax.ClassOrStructKeyword))[0], false),\n                new(skippedPropertyTypeMember, false) // PropertyType is skipped and this should not render anything\n            ]);\n        var model = new StrategyModel(new() { { skippedPropertyTypeMember.PropertyType, new SkipStrategy(skippedPropertyTypeMember.PropertyType) } });\n\n        sut.Generate(model).Should().BeIgnoringLineEndings(\n            \"\"\"\n            //<auto-generated/>\n            /*\n             * SonarAnalyzer for .NET\n             * Copyright (C) SonarSource Sàrl\n             * mailto:info AT sonarsource DOT com\n             *\n             * You can redistribute and/or modify this program under the terms of\n             * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n             *\n             * This program is distributed in the hope that it will be useful,\n             * but WITHOUT ANY WARRANTY; without even the implied warranty of\n             * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n             * See the Sonar Source-Available License for more details.\n             *\n             * You should have received a copy of the Sonar Source-Available License\n             * along with this program; if not, see https://sonarsource.com/license/ssal/\n             */\n\n            using Microsoft.CodeAnalysis;\n            using Microsoft.CodeAnalysis.CSharp;\n            using Microsoft.CodeAnalysis.CSharp.Syntax;\n            using Microsoft.CodeAnalysis.Text;\n            using System;\n            using System.Collections.Immutable;\n\n            namespace SonarAnalyzer.ShimLayer;\n\n            public readonly partial struct RecordDeclarationSyntaxWrapper: ISyntaxWrapper<TypeDeclarationSyntax>\n            {\n                public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.RecordDeclarationSyntax\";\n                private static readonly Type WrappedType;\n\n                private readonly TypeDeclarationSyntax node;\n\n                static RecordDeclarationSyntaxWrapper()\n                {\n                    WrappedType = SyntaxNodeTypes.LatestType(typeof(RecordDeclarationSyntaxWrapper));\n                    ClassOrStructKeywordAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeDeclarationSyntax, SyntaxToken>(WrappedType, \"ClassOrStructKeyword\");\n                }\n\n                private RecordDeclarationSyntaxWrapper(TypeDeclarationSyntax node) =>\n                    this.node = node;\n\n                public TypeDeclarationSyntax Node => this.node;\n\n                [Obsolete(\"Use Node instead\")]\n                public TypeDeclarationSyntax SyntaxNode => this.node;\n\n                public TextSpan Span => this.node.Span;\n                private static readonly Func<TypeDeclarationSyntax, SyntaxToken> ClassOrStructKeywordAccessor;\n                public SyntaxToken ClassOrStructKeyword => (SyntaxToken)ClassOrStructKeywordAccessor(this.node);\n\n                public static explicit operator RecordDeclarationSyntaxWrapper(SyntaxNode node)\n                {\n                    if (node is null)\n                    {\n                        return default;\n                    }\n\n                    if (!IsInstance(node))\n                    {\n                        throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n                    }\n\n                    return new RecordDeclarationSyntaxWrapper((TypeDeclarationSyntax)node);\n                }\n\n                public static implicit operator TypeDeclarationSyntax(RecordDeclarationSyntaxWrapper wrapper) =>\n                    wrapper.node;\n\n\n\n                public static bool IsInstance(SyntaxNode node) =>\n                    node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n            }\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Generate_IsPatternSyntax()\n    {\n        var sut = new SyntaxNodeWrapStrategy(\n            typeof(IsPatternExpressionSyntax),\n            typeof(ExpressionSyntax),\n            [\n                new(typeof(IsPatternExpressionSyntax).GetMember(nameof(IsPatternExpressionSyntax.Pattern))[0], false),\n            ]);\n        var patternSyntaxStrategy = new SyntaxNodeWrapStrategy(typeof(PatternSyntax), typeof(CSharpSyntaxNode), []);\n\n        var result = sut.Generate(new() { { typeof(PatternSyntax), patternSyntaxStrategy } });\n        result.Should().BeIgnoringLineEndings(\n            \"\"\"\n            //<auto-generated/>\n            /*\n             * SonarAnalyzer for .NET\n             * Copyright (C) SonarSource Sàrl\n             * mailto:info AT sonarsource DOT com\n             *\n             * You can redistribute and/or modify this program under the terms of\n             * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n             *\n             * This program is distributed in the hope that it will be useful,\n             * but WITHOUT ANY WARRANTY; without even the implied warranty of\n             * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n             * See the Sonar Source-Available License for more details.\n             *\n             * You should have received a copy of the Sonar Source-Available License\n             * along with this program; if not, see https://sonarsource.com/license/ssal/\n             */\n\n            using Microsoft.CodeAnalysis;\n            using Microsoft.CodeAnalysis.CSharp;\n            using Microsoft.CodeAnalysis.CSharp.Syntax;\n            using Microsoft.CodeAnalysis.Text;\n            using System;\n            using System.Collections.Immutable;\n\n            namespace SonarAnalyzer.ShimLayer;\n\n            public readonly partial struct IsPatternExpressionSyntaxWrapper: ISyntaxWrapper<ExpressionSyntax>\n            {\n                public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.IsPatternExpressionSyntax\";\n                private static readonly Type WrappedType;\n\n                private readonly ExpressionSyntax node;\n\n                static IsPatternExpressionSyntaxWrapper()\n                {\n                    WrappedType = SyntaxNodeTypes.LatestType(typeof(IsPatternExpressionSyntaxWrapper));\n                    PatternAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<ExpressionSyntax, CSharpSyntaxNode>(WrappedType, \"Pattern\");\n                }\n\n                private IsPatternExpressionSyntaxWrapper(ExpressionSyntax node) =>\n                    this.node = node;\n\n                public ExpressionSyntax Node => this.node;\n\n                [Obsolete(\"Use Node instead\")]\n                public ExpressionSyntax SyntaxNode => this.node;\n\n                private static readonly Func<ExpressionSyntax, CSharpSyntaxNode> PatternAccessor;\n                public PatternSyntaxWrapper Pattern => (PatternSyntaxWrapper)PatternAccessor(this.node);\n\n                public static explicit operator IsPatternExpressionSyntaxWrapper(SyntaxNode node)\n                {\n                    if (node is null)\n                    {\n                        return default;\n                    }\n\n                    if (!IsInstance(node))\n                    {\n                        throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n                    }\n\n                    return new IsPatternExpressionSyntaxWrapper((ExpressionSyntax)node);\n                }\n\n                public static implicit operator ExpressionSyntax(IsPatternExpressionSyntaxWrapper wrapper) =>\n                    wrapper.node;\n\n\n\n                public static bool IsInstance(SyntaxNode node) =>\n                    node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n            }\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Generate_ConstantPatternSyntax()\n    {\n        var sut = new SyntaxNodeWrapStrategy(typeof(ConstantPatternSyntax), typeof(CSharpSyntaxNode), []);\n        var model = new Dictionary<Type, Strategy>()\n        {\n            { typeof(ConstantPatternSyntax), sut },\n            { typeof(PatternSyntax), new SyntaxNodeWrapStrategy(typeof(PatternSyntax), typeof(CSharpSyntaxNode), []) },\n            { typeof(ExpressionOrPatternSyntax), new SyntaxNodeWrapStrategy(typeof(ExpressionOrPatternSyntax), typeof(CSharpSyntaxNode), []) },\n        };\n        var result = sut.Generate(new(model));\n        result.Should().BeIgnoringLineEndings(\n            \"\"\"\n            //<auto-generated/>\n            /*\n             * SonarAnalyzer for .NET\n             * Copyright (C) SonarSource Sàrl\n             * mailto:info AT sonarsource DOT com\n             *\n             * You can redistribute and/or modify this program under the terms of\n             * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n             *\n             * This program is distributed in the hope that it will be useful,\n             * but WITHOUT ANY WARRANTY; without even the implied warranty of\n             * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n             * See the Sonar Source-Available License for more details.\n             *\n             * You should have received a copy of the Sonar Source-Available License\n             * along with this program; if not, see https://sonarsource.com/license/ssal/\n             */\n\n            using Microsoft.CodeAnalysis;\n            using Microsoft.CodeAnalysis.CSharp;\n            using Microsoft.CodeAnalysis.CSharp.Syntax;\n            using Microsoft.CodeAnalysis.Text;\n            using System;\n            using System.Collections.Immutable;\n\n            namespace SonarAnalyzer.ShimLayer;\n\n            public readonly partial struct ConstantPatternSyntaxWrapper: ISyntaxWrapper<CSharpSyntaxNode>\n            {\n                public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.ConstantPatternSyntax\";\n                private static readonly Type WrappedType;\n\n                private readonly CSharpSyntaxNode node;\n\n                static ConstantPatternSyntaxWrapper()\n                {\n                    WrappedType = SyntaxNodeTypes.LatestType(typeof(ConstantPatternSyntaxWrapper));\n\n                }\n\n                private ConstantPatternSyntaxWrapper(CSharpSyntaxNode node) =>\n                    this.node = node;\n\n                public CSharpSyntaxNode Node => this.node;\n\n                [Obsolete(\"Use Node instead\")]\n                public CSharpSyntaxNode SyntaxNode => this.node;\n\n\n\n                public static explicit operator ConstantPatternSyntaxWrapper(SyntaxNode node)\n                {\n                    if (node is null)\n                    {\n                        return default;\n                    }\n\n                    if (!IsInstance(node))\n                    {\n                        throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n                    }\n\n                    return new ConstantPatternSyntaxWrapper((CSharpSyntaxNode)node);\n                }\n\n                public static implicit operator CSharpSyntaxNode(ConstantPatternSyntaxWrapper wrapper) =>\n                    wrapper.node;\n\n                public static implicit operator PatternSyntaxWrapper(ConstantPatternSyntaxWrapper up) => (PatternSyntaxWrapper)up.SyntaxNode;\n                public static explicit operator ConstantPatternSyntaxWrapper(PatternSyntaxWrapper down) => (ConstantPatternSyntaxWrapper)down.SyntaxNode;\n\n                public static implicit operator ExpressionOrPatternSyntaxWrapper(ConstantPatternSyntaxWrapper up) => (ExpressionOrPatternSyntaxWrapper)up.SyntaxNode;\n                public static explicit operator ConstantPatternSyntaxWrapper(ExpressionOrPatternSyntaxWrapper down) => (ConstantPatternSyntaxWrapper)down.SyntaxNode;\n\n\n\n                public static bool IsInstance(SyntaxNode node) =>\n                    node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n            }\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Generate_SkippedMembers_DoNotProduceEmptyLines()\n    {\n        var unsupportedMember = new MemberDescriptor(typeof(SyntaxNode).GetMembers().OfType<MethodInfo>().First(x => x.ReturnType.IsNested), true);\n        var sut = new SyntaxNodeWrapStrategy(\n            typeof(SyntaxNode),\n            typeof(SyntaxNode),\n            Enumerable.Repeat(unsupportedMember, 20).ToList());    // This should not produce 20 empty lines\n\n        var result = sut.Generate(new() { { typeof(PatternSyntax), sut } });\n        result.Should().BeIgnoringLineEndings(\n            \"\"\"\n            //<auto-generated/>\n            /*\n             * SonarAnalyzer for .NET\n             * Copyright (C) SonarSource Sàrl\n             * mailto:info AT sonarsource DOT com\n             *\n             * You can redistribute and/or modify this program under the terms of\n             * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n             *\n             * This program is distributed in the hope that it will be useful,\n             * but WITHOUT ANY WARRANTY; without even the implied warranty of\n             * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n             * See the Sonar Source-Available License for more details.\n             *\n             * You should have received a copy of the Sonar Source-Available License\n             * along with this program; if not, see https://sonarsource.com/license/ssal/\n             */\n\n            using Microsoft.CodeAnalysis;\n            using Microsoft.CodeAnalysis.CSharp;\n            using Microsoft.CodeAnalysis.CSharp.Syntax;\n            using Microsoft.CodeAnalysis.Text;\n            using System;\n            using System.Collections.Immutable;\n\n            namespace SonarAnalyzer.ShimLayer;\n\n            public readonly partial struct SyntaxNodeWrapper: ISyntaxWrapper<SyntaxNode>\n            {\n                public const string WrappedTypeName = \"Microsoft.CodeAnalysis.SyntaxNode\";\n                private static readonly Type WrappedType;\n\n                private readonly SyntaxNode node;\n\n                static SyntaxNodeWrapper()\n                {\n                    WrappedType = SyntaxNodeTypes.LatestType(typeof(SyntaxNodeWrapper));\n\n                }\n\n                private SyntaxNodeWrapper(SyntaxNode node) =>\n                    this.node = node;\n\n                public SyntaxNode Node => this.node;\n\n                [Obsolete(\"Use Node instead\")]\n                public SyntaxNode SyntaxNode => this.node;\n\n\n\n                public static explicit operator SyntaxNodeWrapper(SyntaxNode node)\n                {\n                    if (node is null)\n                    {\n                        return default;\n                    }\n\n                    if (!IsInstance(node))\n                    {\n                        throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n                    }\n\n                    return new SyntaxNodeWrapper((SyntaxNode)node);\n                }\n\n                public static implicit operator SyntaxNode(SyntaxNodeWrapper wrapper) =>\n                    wrapper.node;\n\n\n\n                public static bool IsInstance(SyntaxNode node) =>\n                    node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n            }\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Generate_PropagateMemberAttributes()\n    {\n        var sut = new SyntaxNodeWrapStrategy(\n            typeof(IndexerDeclarationSyntax),\n            typeof(SyntaxNode),\n            [\n                new(typeof(IndexerDeclarationSyntax).GetMember(\"Semicolon\")[0], true),  // Has ObsoleteAttribute to render\n                new(typeof(AliasQualifiedNameSyntax).GetMember(\"Parent\")[0], true)      // Has NullableAttribute to ignore\n            ]);\n        var result = sut.Generate([]);\n        result.Should().BeIgnoringLineEndings(\"\"\"\n            //<auto-generated/>\n            /*\n             * SonarAnalyzer for .NET\n             * Copyright (C) SonarSource Sàrl\n             * mailto:info AT sonarsource DOT com\n             *\n             * You can redistribute and/or modify this program under the terms of\n             * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n             *\n             * This program is distributed in the hope that it will be useful,\n             * but WITHOUT ANY WARRANTY; without even the implied warranty of\n             * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n             * See the Sonar Source-Available License for more details.\n             *\n             * You should have received a copy of the Sonar Source-Available License\n             * along with this program; if not, see https://sonarsource.com/license/ssal/\n             */\n\n            using Microsoft.CodeAnalysis;\n            using Microsoft.CodeAnalysis.CSharp;\n            using Microsoft.CodeAnalysis.CSharp.Syntax;\n            using Microsoft.CodeAnalysis.Text;\n            using System;\n            using System.Collections.Immutable;\n\n            namespace SonarAnalyzer.ShimLayer;\n\n            public readonly partial struct IndexerDeclarationSyntaxWrapper: ISyntaxWrapper<SyntaxNode>\n            {\n                public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.IndexerDeclarationSyntax\";\n                private static readonly Type WrappedType;\n\n                private readonly SyntaxNode node;\n\n                static IndexerDeclarationSyntaxWrapper()\n                {\n                    WrappedType = SyntaxNodeTypes.LatestType(typeof(IndexerDeclarationSyntaxWrapper));\n\n                }\n\n                private IndexerDeclarationSyntaxWrapper(SyntaxNode node) =>\n                    this.node = node;\n\n                public SyntaxNode Node => this.node;\n\n                [Obsolete(\"Use Node instead\")]\n                public SyntaxNode SyntaxNode => this.node;\n\n                [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]\n                [System.ObsoleteAttribute(\"This member is obsolete.\", true)]\n                public SyntaxToken Semicolon => this.node.Semicolon;\n                public SyntaxNode Parent => this.node.Parent;\n\n                public static explicit operator IndexerDeclarationSyntaxWrapper(SyntaxNode node)\n                {\n                    if (node is null)\n                    {\n                        return default;\n                    }\n\n                    if (!IsInstance(node))\n                    {\n                        throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n                    }\n\n                    return new IndexerDeclarationSyntaxWrapper((SyntaxNode)node);\n                }\n\n                public static implicit operator SyntaxNode(IndexerDeclarationSyntaxWrapper wrapper) =>\n                    wrapper.node;\n\n\n\n                public static bool IsInstance(SyntaxNode node) =>\n                    node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n            }\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Generate_GenericMembers()\n    {\n        var sut = new SyntaxNodeWrapStrategy(\n            typeof(RecordDeclarationSyntax),\n            typeof(TypeDeclarationSyntax),\n            [\n                // This class is not authentic. There's a mix of different types to demonstrate what will be rendered\n                new(typeof(RecordDeclarationSyntax).GetMember(nameof(RecordDeclarationSyntax.Members))[0], false),          // SyntaxList with accessor\n                new(typeof(RecordDeclarationSyntax).GetMember(nameof(RecordDeclarationSyntax.AttributeLists))[0], true),    // SyntaxList passthrough\n                new(typeof(TupleExpressionSyntax).GetMember(nameof(TupleExpressionSyntax.Arguments))[0], false),            // SeparatedSyntaxList\n                new(typeof(SwitchExpressionSyntax).GetMember(nameof(SwitchExpressionSyntax.Arms))[0], false)                // SeparatedSyntaxListWrapper\n            ]);\n        var result = sut.Generate(new() { { typeof(SwitchExpressionArmSyntax), new SyntaxNodeWrapStrategy(typeof(SwitchExpressionArmSyntax), typeof(CSharpSyntaxNode), []) } });\n        result.Should().BeIgnoringLineEndings(\n            \"\"\"\n            //<auto-generated/>\n            /*\n             * SonarAnalyzer for .NET\n             * Copyright (C) SonarSource Sàrl\n             * mailto:info AT sonarsource DOT com\n             *\n             * You can redistribute and/or modify this program under the terms of\n             * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n             *\n             * This program is distributed in the hope that it will be useful,\n             * but WITHOUT ANY WARRANTY; without even the implied warranty of\n             * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n             * See the Sonar Source-Available License for more details.\n             *\n             * You should have received a copy of the Sonar Source-Available License\n             * along with this program; if not, see https://sonarsource.com/license/ssal/\n             */\n\n            using Microsoft.CodeAnalysis;\n            using Microsoft.CodeAnalysis.CSharp;\n            using Microsoft.CodeAnalysis.CSharp.Syntax;\n            using Microsoft.CodeAnalysis.Text;\n            using System;\n            using System.Collections.Immutable;\n\n            namespace SonarAnalyzer.ShimLayer;\n\n            public readonly partial struct RecordDeclarationSyntaxWrapper: ISyntaxWrapper<TypeDeclarationSyntax>\n            {\n                public const string WrappedTypeName = \"Microsoft.CodeAnalysis.CSharp.Syntax.RecordDeclarationSyntax\";\n                private static readonly Type WrappedType;\n\n                private readonly TypeDeclarationSyntax node;\n\n                static RecordDeclarationSyntaxWrapper()\n                {\n                    WrappedType = SyntaxNodeTypes.LatestType(typeof(RecordDeclarationSyntaxWrapper));\n                    MembersAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeDeclarationSyntax, SyntaxList<MemberDeclarationSyntax>>(WrappedType, \"Members\");\n                    ArgumentsAccessor = LightupHelpers.CreateSyntaxPropertyAccessor<TypeDeclarationSyntax, SeparatedSyntaxList<ArgumentSyntax>>(WrappedType, \"Arguments\");\n                    ArmsAccessor = LightupHelpers.CreateSeparatedSyntaxListPropertyAccessor<TypeDeclarationSyntax, SwitchExpressionArmSyntaxWrapper>(WrappedType, nameof(Arms));\n                }\n\n                private RecordDeclarationSyntaxWrapper(TypeDeclarationSyntax node) =>\n                    this.node = node;\n\n                public TypeDeclarationSyntax Node => this.node;\n\n                [Obsolete(\"Use Node instead\")]\n                public TypeDeclarationSyntax SyntaxNode => this.node;\n\n                private static readonly Func<TypeDeclarationSyntax, SyntaxList<MemberDeclarationSyntax>> MembersAccessor;\n                public SyntaxList<MemberDeclarationSyntax> Members => (SyntaxList<MemberDeclarationSyntax>)MembersAccessor(this.node);\n                public SyntaxList<AttributeListSyntax> AttributeLists => this.node.AttributeLists;\n                private static readonly Func<TypeDeclarationSyntax, SeparatedSyntaxList<ArgumentSyntax>> ArgumentsAccessor;\n                public SeparatedSyntaxList<ArgumentSyntax> Arguments => (SeparatedSyntaxList<ArgumentSyntax>)ArgumentsAccessor(this.node);\n                private static readonly Func<TypeDeclarationSyntax, SeparatedSyntaxListWrapper<SwitchExpressionArmSyntaxWrapper>> ArmsAccessor;\n                public SeparatedSyntaxListWrapper<SwitchExpressionArmSyntaxWrapper> Arms => ArmsAccessor(this.node);\n\n                public static explicit operator RecordDeclarationSyntaxWrapper(SyntaxNode node)\n                {\n                    if (node is null)\n                    {\n                        return default;\n                    }\n\n                    if (!IsInstance(node))\n                    {\n                        throw new InvalidCastException($\"Cannot cast '{node.GetType().FullName}' to '{WrappedTypeName}'\");\n                    }\n\n                    return new RecordDeclarationSyntaxWrapper((TypeDeclarationSyntax)node);\n                }\n\n                public static implicit operator TypeDeclarationSyntax(RecordDeclarationSyntaxWrapper wrapper) =>\n                    wrapper.node;\n\n\n\n                public static bool IsInstance(SyntaxNode node) =>\n                    node is not null && LightupHelpers.CanWrapNode(node, WrappedType);\n            }\n            \"\"\");\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.ShimLayer.Generator.Test/packages.lock.json",
    "content": "{\n  \"version\": 1,\n  \"dependencies\": {\n    \"net10.0\": {\n      \"altcover\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[9.0.102, )\",\n        \"resolved\": \"9.0.102\",\n        \"contentHash\": \"q3Rf5t0M9kXlcO5qhsaAe6NrFSNd5enrhKmF/Ezgmomqw34PbUTbRSYjSDNhS3YGDyUrPTkyPn14EfLDJWztcA==\"\n      },\n      \"Combinatorial.MSTest\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[2.0.0, )\",\n        \"resolved\": \"2.0.0\",\n        \"contentHash\": \"9tB2TMPkuEkYYUq64WREHMMyPt9NfKAyuitpK9yw3zbVe6v/vYkClZTR02+yKFUG+g8XHi5LMTt8jHz4RufGqw==\",\n        \"dependencies\": {\n          \"MSTest.TestFramework\": \"4.0.1\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[3.3.1, )\",\n        \"resolved\": \"3.3.1\",\n        \"contentHash\": \"eT+kgNCDdTRbQ5WF6BGx1HI3D5jYfHteza/koefhWC2vNZGxObA74XxwWfg40dy3uUv7dn3OGKLK5GUPLroVog==\"\n      },\n      \"Microsoft.NET.Test.Sdk\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[18.4.0, )\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"w49iZdL4HL6V25l41NVQLXWQ+e71GvSkKVteMrOL02gP/PUkcnO/1yEb2s9FntU4wGmJWfKnyrRAhcMHd9ZZNA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeCoverage\": \"18.4.0\",\n          \"Microsoft.TestPlatform.TestHost\": \"18.4.0\"\n        }\n      },\n      \"MSTest.TestAdapter\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[4.2.1, )\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"lZRgNzaQnffK4XLjM/og4Eoqp/3IkpcyJQQcyKXkPdkzCT3+ghpwHa9zG1xYhQDbUFoc54M+/waLwh31K9stDQ==\",\n        \"dependencies\": {\n          \"MSTest.TestFramework\": \"4.2.1\",\n          \"Microsoft.Testing.Extensions.VSTestBridge\": \"2.2.1\",\n          \"Microsoft.Testing.Platform.MSBuild\": \"2.2.1\"\n        }\n      },\n      \"MSTest.TestFramework\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[4.2.1, )\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"I4/RbS2TpGZ56CE98+jPbrGlcerYtw2LvPVKzQGvyQQcJDekPy2Kd+fnThXYn+geJ1sW+vA9B7++rFNxvKcWxA==\",\n        \"dependencies\": {\n          \"MSTest.Analyzers\": \"4.2.1\"\n        }\n      },\n      \"SonarAnalyzer.CSharp.Styling\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[10.21.0.135717, )\",\n        \"resolved\": \"10.21.0.135717\",\n        \"contentHash\": \"hl264jF539oB7m2jED5QGM345eFSiDAdoJc8TH0HM6L7ZeqT5TDqZDQeZ8IDP02dVIpH/Fhhn+HsGfEcj8ohyQ==\"\n      },\n      \"StyleCop.Analyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.2.0-beta.556, )\",\n        \"resolved\": \"1.2.0-beta.556\",\n        \"contentHash\": \"llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==\",\n        \"dependencies\": {\n          \"StyleCop.Analyzers.Unstable\": \"1.2.0.556\"\n        }\n      },\n      \"Verify.MSTest\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[31.16.1, )\",\n        \"resolved\": \"31.16.1\",\n        \"contentHash\": \"IL/zKYBpM1ERMJ71BtYc1JQfT5VJ8mj9LrlJsLoWe/J7NN546YJsONs7ENWmOWcLvsyd/0+EL+XqnCmOBHHGZA==\",\n        \"dependencies\": {\n          \"Argon\": \"0.33.5\",\n          \"DiffEngine\": \"19.1.2\",\n          \"MSTest.TestFramework\": \"4.2.1\",\n          \"SimpleInfoName\": \"3.2.0\",\n          \"Verify\": \"31.16.1\"\n        }\n      },\n      \"Argon\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"0.33.5\",\n        \"contentHash\": \"J6821zxO+EqMzO9C/V5uiWc2eBGyzN7Z8Z0xq3Q1/e6IxYcHDA32OgiZX5/7/f8rVPQQa7aYtm6f0UfnrgKNBg==\"\n      },\n      \"Castle.Core\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.1.1\",\n        \"contentHash\": \"rpYtIczkzGpf+EkZgDr9CClTdemhsrwA/W5hMoPjLkRFnXzH44zDLoovXeKtmxb1ykXK9aJVODSpiJml8CTw2g==\",\n        \"dependencies\": {\n          \"System.Diagnostics.EventLog\": \"6.0.0\"\n        }\n      },\n      \"DiffEngine\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"19.1.2\",\n        \"contentHash\": \"5fteTgsAXovFNT8wnZT3US51KzVOipI2ptvBG5O27BuHqBPgdu6G8dwAnfF7BoP7RCJyLoT4AyoQ5KS3b3YhCw==\",\n        \"dependencies\": {\n          \"EmptyFiles\": \"8.17.2\"\n        }\n      },\n      \"EmptyFiles\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.17.2\",\n        \"contentHash\": \"2oyDVmM/DU3g0h2kqcV05zjOUfo9AdwPoduIGh0LZL6nXqSN4qhZna2M/aJoYiQrmIznJ52wxYCmxDnWaRZ1JQ==\"\n      },\n      \"FluentAssertions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.2.1\",\n        \"contentHash\": \"MilqBF2lZrT0V1azIA6DG6I/snS0rG3A8ohT2Jjkhq6zOFk76nqx4BPnEnzrX6jFVa6xvkDU++z3PebCGZyJ4g==\",\n        \"dependencies\": {\n          \"System.Configuration.ConfigurationManager\": \"6.0.0\"\n        }\n      },\n      \"FluentAssertions.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"0.34.1\",\n        \"contentHash\": \"2BnAAB8CCPdRA9P1+lAvBZOleR2BTmsxGMtGt+LnABJUARGqoGMWEFxG3znZYqHVIrMP0Za/kyw6atyt8x2mzA==\"\n      },\n      \"Google.Protobuf\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"3.6.1\",\n        \"contentHash\": \"741fGeDQjixBJaU2j+0CbrmZXsNJkTn/hWbOh4fLVXndHsCclJmWznCPWrJmPoZKvajBvAz3e8ECJOUvRtwjNQ==\",\n        \"dependencies\": {\n          \"NETStandard.Library\": \"1.6.1\"\n        }\n      },\n      \"Humanizer.Core\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.14.1\",\n        \"contentHash\": \"lQKvtaTDOXnoVJ20ibTuSIOf2i0uO0MPbDhd1jm238I+U/2ZnRENj0cktKZhtchBMtCUSRQ5v4xBCUbKNmyVMw==\"\n      },\n      \"Microsoft.ApplicationInsights\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.23.0\",\n        \"contentHash\": \"nWArUZTdU7iqZLycLKWe0TDms48KKGE6pONH2terYNa8REXiqixrMOkf1sk5DHGMaUTqONU2YkS4SAXBhLStgw==\",\n        \"dependencies\": {\n          \"System.Diagnostics.DiagnosticSource\": \"5.0.0\"\n        }\n      },\n      \"Microsoft.Build.Framework\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"17.11.48\",\n        \"contentHash\": \"C3WIMt2wBl4++NX3jSEpTq5KXBhvAV154R4JrYHkfy9JSBcXWiL0mkgpspk5xSdOj+fS/uz7zluIy6bMM1fkkQ==\"\n      },\n      \"Microsoft.Build.Locator\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.11.2\",\n        \"contentHash\": \"tY+/S54G29CGsbL3slVu4vqtpciwVnb3fKOmrhgzEQmu/VziFaWmD/E1e/2KH7cDucuycGSkWsSXndBs5Uawow==\"\n      },\n      \"Microsoft.CodeAnalysis.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0-2.25625.1\",\n        \"contentHash\": \"4Yhh2fnu3G+J0J1lDc8WZVgMjgbynSeTfkl5IFJMFrmiIO0sc7Tjx+f3sFVV8Sd35PrIUWfof0RWc3lAMl7Azg==\"\n      },\n      \"Microsoft.CodeAnalysis.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"uC0qk3jzTQY7i90ehfnCqaOZpBUGJyPMiHJ3c0jOb8yaPBjWzIhVdNxPbeVzI74DB0C+YgBKPLqUkgFZzua5Mg==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"SQFNGQF4f7UfDXKxMzzGNMr3fjrPDIjLfmRvvVgDCw+dyvEHDaRfHuKA5q0Pr0/JW0Gcw89TxrxrS/MjwBvluQ==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp.Workspaces\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"mRwxchBs3ewXK4dqK4R/eVCx99VIq1k/lhwArlu+fJuV0uzmbkTTRw4jR9gN9sOcAQfX0uV9KQlmCk1yC0JNog==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.CSharp\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.VisualBasic\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"AJxddsIOmfimuihaLuSAm4c/zskHoL1ypAjIpSOZqHlNm2iuw0twsB8nbKczJyfClqD7+iYjdIeE5EV8WAyxRA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"pAGdr4qs7+v287DPiiM8px1cBXnhe8LxymkVGTnCwv2OEjCk5HO2zIoFvype4ivKJTRW3aTUUV8ab+915wbv+w==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.VisualBasic\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Workspaces.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"QSf1ge9A+XFZbGL+gIqXYBIKlm8QdQVLvHDPZiydG11W6mJY7XBMusrsgIEz6L8GYMzGJKTM78m9icliGMF7NA==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Workspaces.MSBuild\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"2Mg/ppo5dza1e4DJWX4+RIHMc3FgnYzuHTaLRZDupiK1LTi/PAZ1PBpF/iivHVNKQKwipHE984gy37MbM0RO9Q==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.Build.Framework\": \"17.11.48\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"Microsoft.Extensions.DependencyInjection\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Options\": \"9.0.0\",\n          \"Microsoft.Extensions.Primitives\": \"9.0.0\",\n          \"Microsoft.VisualStudio.SolutionPersistence\": \"1.0.52\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeCoverage\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"9O0BtCfzCWrkAmK187ugKdq72HHOXoOUjuWFDVc2LsZZ0pOnA9bTt+Sg9q4cF+MoAaUU+MuWtvBuFsnduviJow==\"\n      },\n      \"Microsoft.Composition\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.27\",\n        \"contentHash\": \"pwu80Ohe7SBzZ6i69LVdzowp6V+LaVRzd5F7A6QlD42vQkX0oT7KXKWWPlM/S00w1gnMQMRnEdbtOV12z6rXdQ==\"\n      },\n      \"Microsoft.Extensions.DependencyInjection\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"MCPrg7v3QgNMr0vX4vzRXvkNGgLg8vKWX0nKCWUxu2uPyMsaRgiRc1tHBnbTcfJMhMKj2slE/j2M9oGkd25DNw==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.DependencyInjection.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"+6f2qv2a3dLwd5w6JanPIPs47CxRbnk+ZocMJUhv9NxP88VlOcJYZs9jY+MYSjxvady08bUZn6qgiNh7DadGgg==\"\n      },\n      \"Microsoft.Extensions.Logging\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"crjWyORoug0kK7RSNJBTeSE6VX8IQgLf3nUpTB9m62bPXp/tzbnOsnbe8TXEG0AASNaKZddnpHKw7fET8E++Pg==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Options\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.Logging.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"g0UfujELzlLbHoVG8kPKVBaW470Ewi+jnptGS9KUi6jcb+k2StujtK3m26DFSGGwQ/+bVgZfsWqNzlP6YOejvw==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.Options\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"y2146b3jrPI3Q0lokKXdKLpmXqakYbDIPDV6r3M8SqvSf45WwOTzkyfDpxnZXJsJQEpAsAqjUq5Pu8RCJMjubg==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Primitives\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"N3qEBzmLMYiASUlKxxFIISP4AiwuPTHF5uCh+2CWSwwzAJiIYx0kBJsS30cp1nvhSySFAVi30jecD307jV+8Kg==\"\n      },\n      \"Microsoft.Testing.Extensions.Telemetry\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"7zB8BjffOyvqfHF26rFVPuK0w1fCf5+j1tLuhHIr76CqxXkGb+fMJtq6YNOV+m6qPytExHMXxluk3RgJ+dSIqw==\",\n        \"dependencies\": {\n          \"Microsoft.ApplicationInsights\": \"2.23.0\",\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.Testing.Extensions.TrxReport.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"RD6D1Jx6cKDA5IHd1H2q8ylIuQG3PD+gdULI0JC8CvsRtaypFzTFpB5xDPuQi8o6kAkcM04cBhAiJPxZboNH2Q==\",\n        \"dependencies\": {\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.Testing.Extensions.VSTestBridge\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"D8AGlkNtlTQPe3zf4SLnHBMr13lerMe0RuHSoRfnRatcuX/T7YbRtgn39rWBjKhXsNio0WXKrPKv3gfWE2I46w==\",\n        \"dependencies\": {\n          \"Microsoft.TestPlatform.ObjectModel\": \"18.3.0\",\n          \"Microsoft.Testing.Extensions.Telemetry\": \"2.2.1\",\n          \"Microsoft.Testing.Extensions.TrxReport.Abstractions\": \"2.2.1\",\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.Testing.Platform\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"9bbPuls/b6/vUFzxbSjJLZlJHyKBfOZE5kjIY+ITI2ASqlFPJhR83BdLydJeQOCLEZhEbrEcz5xtt1B69nwSVg==\"\n      },\n      \"Microsoft.Testing.Platform.MSBuild\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"CSJOcZHfKlTyPbS0CTJk6iEnU4gJC+eUA5z72UBnMDRdgVHYOmB8k9Y7jT233gZjnCOQiYFg3acQHRfu2H62nw==\",\n        \"dependencies\": {\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.TestPlatform.ObjectModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"4L6m2kS2pY5uJ9cpeRxzW22opr6ttScIRqsOpMDQpgENp/ZwxkkQCcmc6LRSURo2dFaaSW5KVflQZvroiJ7Wzg==\",\n        \"dependencies\": {\n          \"System.Reflection.Metadata\": \"8.0.0\"\n        }\n      },\n      \"Microsoft.TestPlatform.TestHost\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"gZsCHI+zOmZCcKZieIL4Jg14qKD2OGZOmX5DehuIk1EA9BN6Crm0+taXQNEuajOH1G9CCyBxw8VWR4t5tumcng==\",\n        \"dependencies\": {\n          \"Microsoft.TestPlatform.ObjectModel\": \"18.4.0\",\n          \"Newtonsoft.Json\": \"13.0.3\"\n        }\n      },\n      \"Microsoft.VisualStudio.SolutionPersistence\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.52\",\n        \"contentHash\": \"oNv2JtYXhpdJrX63nibx1JT3uCESOBQ1LAk7Dtz/sr0+laW0KRM6eKp4CZ3MHDR2siIkKsY8MmUkeP5DKkQQ5w==\"\n      },\n      \"Microsoft.Win32.SystemEvents\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"hqTM5628jSsQiv+HGpiq3WKBl2c8v1KZfby2J6Pr7pEPlK9waPdgEO6b8A/+/xn/yZ9ulv8HuqK71ONy2tg67A==\"\n      },\n      \"MSTest.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"1i9jgE/42KGGyZ4s0MdrYM/Uu/dRYhbRfYQifcO0AZ6vw4sBXRjoQGQRGNSm771AYgPAmoGl0u4sJc2lMET6HQ==\"\n      },\n      \"Newtonsoft.Json\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"13.0.3\",\n        \"contentHash\": \"HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==\"\n      },\n      \"NSubstitute\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"lJ47Cps5Qzr86N99lcwd+OUvQma7+fBgr8+Mn+aOC0WrlqMNkdivaYD9IvnZ5Mqo6Ky3LS7ZI+tUq1/s9ERd0Q==\",\n        \"dependencies\": {\n          \"Castle.Core\": \"5.1.1\"\n        }\n      },\n      \"NuGet.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"1mp7zmyAGmQfT93ELC4c+MYOrJ8Ff4ekFZRek4JSVLb/wOO/o0bsPfLmqujCsJ2Hlwc+fpq1TQEnjSEgWdt8ng==\",\n        \"dependencies\": {\n          \"NuGet.Frameworks\": \"7.3.1\"\n        }\n      },\n      \"NuGet.Configuration\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"tGxWBo47EQONOaqY+MbEWMrNjFthHgfavLM1HE0RcLyOXVCoQKBlZGV7v0hrS/rJrQKw6ZaBeHetX+ZJgS7Lxg==\",\n        \"dependencies\": {\n          \"NuGet.Common\": \"7.3.1\",\n          \"System.Security.Cryptography.ProtectedData\": \"8.0.0\"\n        }\n      },\n      \"NuGet.Frameworks\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"VUPAE5l/Ir4Gb3dv+v0jq0Qe4nfwxfrfiYN7QhwlGyWPXFKYXSSke1t1bV/ZYd6idtTtRDqJPM49Lt/U8NTocg==\"\n      },\n      \"NuGet.Packaging\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"5bT8uOrNBx4Srhbrd3HonYmyKhWJkvQyTWTYE2jvfPgYx2aCbPmq8MCYko7ce78hEN9mpq2xlrztVhguYPc+GQ==\",\n        \"dependencies\": {\n          \"Newtonsoft.Json\": \"13.0.3\",\n          \"NuGet.Configuration\": \"7.3.1\",\n          \"NuGet.Versioning\": \"7.3.1\",\n          \"System.Security.Cryptography.Pkcs\": \"8.0.1\"\n        }\n      },\n      \"NuGet.Protocol\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"vYd5vtCJ/tpMQjbAs6rrftNgeh5Ip1w7tnEsDZCpGObKgUgOxHQBekCul3TnzmbNgobvJEkDJNaec5/ZBv66Hg==\",\n        \"dependencies\": {\n          \"NuGet.Packaging\": \"7.3.1\"\n        }\n      },\n      \"NuGet.Versioning\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"TJrQWSmD1vakfav7qIhDXgDFfaZFfMJ+v6P8tcND9ZqXajD5B/ZzaoGYNzL4D3eDue6vAOUvwzu42G+19JNVUA==\"\n      },\n      \"SimpleInfoName\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"3.2.0\",\n        \"contentHash\": \"K8ivHRbPWfncijk62Dan/r/z55gwq3aFzqB6yFlD9X0bbpIaacHyHH2cpcIdz0FECUpERUZTwxts0z4gRWpQpA==\"\n      },\n      \"StyleCop.Analyzers.Unstable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.2.0.556\",\n        \"contentHash\": \"zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==\"\n      },\n      \"System.Collections.Immutable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"AurL6Y5BA1WotzlEvVaIDpqzpIPvYnnldxru8oXJU2yFxFUy3+pNXjXd1ymO+RA0rq0+590Q8gaz2l3Sr7fmqg==\"\n      },\n      \"System.Composition\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"3Djj70fFTraOarSKmRnmRy/zm4YurICm+kiCtI0dYRqGJnLX6nJ+G3WYuFJ173cAPax/gh96REcbNiVqcrypFQ==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\",\n          \"System.Composition.Convention\": \"9.0.0\",\n          \"System.Composition.Hosting\": \"9.0.0\",\n          \"System.Composition.Runtime\": \"9.0.0\",\n          \"System.Composition.TypedParts\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.AttributedModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"iri00l/zIX9g4lHMY+Nz0qV1n40+jFYAmgsaiNn16xvt2RDwlqByNG4wgblagnDYxm3YSQQ0jLlC/7Xlk9CzyA==\"\n      },\n      \"System.Composition.Convention\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"+vuqVP6xpi582XIjJi6OCsIxuoTZfR0M7WWufk3uGDeCl3wGW6KnpylUJ3iiXdPByPE0vR5TjJgR6hDLez4FQg==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.Hosting\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"OFqSeFeJYr7kHxDfaViGM1ymk7d4JxK//VSoNF9Ux0gpqkLsauDZpu89kTHHNdCWfSljbFcvAafGyBoY094btQ==\",\n        \"dependencies\": {\n          \"System.Composition.Runtime\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.Runtime\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"w1HOlQY1zsOWYussjFGZCEYF2UZXgvoYnS94NIu2CBnAGMbXFAX8PY8c92KwUItPmowal68jnVLBCzdrWLeEKA==\"\n      },\n      \"System.Composition.TypedParts\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"aRZlojCCGEHDKqh43jaDgaVpYETsgd7Nx4g1zwLKMtv4iTo0627715ajEFNpEEBTgLmvZuv8K0EVxc3sM4NWJA==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\",\n          \"System.Composition.Hosting\": \"9.0.0\",\n          \"System.Composition.Runtime\": \"9.0.0\"\n        }\n      },\n      \"System.Configuration.ConfigurationManager\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"7T+m0kDSlIPTHIkPMIu6m6tV6qsMqJpvQWW2jIc2qi7sn40qxFo0q+7mEQAhMPXZHMKnWrnv47ntGlM/ejvw3g==\",\n        \"dependencies\": {\n          \"System.Security.Cryptography.ProtectedData\": \"6.0.0\",\n          \"System.Security.Permissions\": \"6.0.0\"\n        }\n      },\n      \"System.Diagnostics.DiagnosticSource\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.0.0\",\n        \"contentHash\": \"tCQTzPsGZh/A9LhhA6zrqCRV4hOHsK90/G7q3Khxmn6tnB1PuNU0cRaKANP2AWcF9bn0zsuOoZOSrHuJk6oNBA==\"\n      },\n      \"System.Diagnostics.EventLog\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"lcyUiXTsETK2ALsZrX+nWuHSIQeazhqPphLfaRxzdGaG93+0kELqpgEHtwWOlQe7+jSFnKwaCAgL4kjeZCQJnw==\"\n      },\n      \"System.Drawing.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"NfuoKUiP2nUWwKZN6twGqXioIe1zVD0RIj2t976A+czLHr2nY454RwwXs6JU9Htc6mwqL6Dn/nEL3dpVf2jOhg==\",\n        \"dependencies\": {\n          \"Microsoft.Win32.SystemEvents\": \"6.0.0\"\n        }\n      },\n      \"System.Reflection.Metadata\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"ptvgrFh7PvWI8bcVqG5rsA/weWM09EnthFHR5SCnS6IN+P4mj6rE1lBDC4U8HL9/57htKAqy4KQ3bBj84cfYyQ==\",\n        \"dependencies\": {\n          \"System.Collections.Immutable\": \"8.0.0\"\n        }\n      },\n      \"System.Reflection.MetadataLoadContext\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"10.0.5\",\n        \"contentHash\": \"z9yyFZcuCwtZXrxxDc2nBfB5lTHf96gS/rsD38Lcv6Ok25TOYPjNKlqpTZUqu2HTLPAM4w+/WjGL6gi9cIJO6w==\"\n      },\n      \"System.Security.AccessControl\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"AUADIc0LIEQe7MzC+I0cl0rAT8RrTAKFHl53yHjEUzNVIaUlhFY11vc2ebiVJzVBuOzun6F7FBA+8KAbGTTedQ==\"\n      },\n      \"System.Security.Cryptography.Pkcs\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.1\",\n        \"contentHash\": \"CoCRHFym33aUSf/NtWSVSZa99dkd0Hm7OCZUxORBjRB16LNhIEOf8THPqzIYlvKM0nNDAPTRBa1FxEECrgaxxA==\"\n      },\n      \"System.Security.Cryptography.ProtectedData\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"+TUFINV2q2ifyXauQXRwy4CiBhqvDEDZeVJU7qfxya4aRYOKzVBpN+4acx25VcPB9ywUN6C0n8drWl110PhZEg==\"\n      },\n      \"System.Security.Permissions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"T/uuc7AklkDoxmcJ7LGkyX1CcSviZuLCa4jg3PekfJ7SU0niF0IVTXwUiNVP9DSpzou2PpxJ+eNY2IfDM90ZCg==\",\n        \"dependencies\": {\n          \"System.Security.AccessControl\": \"6.0.0\",\n          \"System.Windows.Extensions\": \"6.0.0\"\n        }\n      },\n      \"System.Windows.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"IXoJOXIqc39AIe+CIR7koBtRGMiCt/LPM3lI+PELtDIy9XdyeSrwXFdWV9dzJ2Awl0paLWUaknLxFQ5HpHZUog==\",\n        \"dependencies\": {\n          \"System.Drawing.Common\": \"6.0.0\"\n        }\n      },\n      \"Verify\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"31.16.1\",\n        \"contentHash\": \"nw/NcGR7RjkFyin5Vh8Txm7jn+TDi9PI4dYaFUj3gKx5oBGEqCdEvHfiTOZ3rshHzcQcfVi669itNx0ApFwTxA==\",\n        \"dependencies\": {\n          \"Argon\": \"0.33.5\",\n          \"DiffEngine\": \"19.1.2\",\n          \"SimpleInfoName\": \"3.2.0\"\n        }\n      },\n      \"Internal.SonarAnalyzer.ShimLayer.Generator\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"System.Reflection.MetadataLoadContext\": \"[10.0.5, )\"\n        }\n      },\n      \"sonaranalyzer.cfg\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer.Lightup\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.core\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Google.Protobuf\": \"[3.6.1, )\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.CFG\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer.lightup\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.testframework\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Combinatorial.MSTest\": \"[2.0.0, )\",\n          \"FluentAssertions\": \"[7.2.1, )\",\n          \"FluentAssertions.Analyzers\": \"[0.34.1, )\",\n          \"MSTest.TestAdapter\": \"[4.2.1, )\",\n          \"MSTest.TestFramework\": \"[4.2.1, )\",\n          \"Microsoft.Build.Locator\": \"[1.11.2, )\",\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[5.3.0, )\",\n          \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": \"[5.3.0, )\",\n          \"Microsoft.CodeAnalysis.Workspaces.MSBuild\": \"[5.3.0, )\",\n          \"Microsoft.NET.Test.Sdk\": \"[18.4.0, )\",\n          \"NSubstitute\": \"[5.3.0, )\",\n          \"NuGet.Protocol\": \"[7.3.1, )\",\n          \"SonarAnalyzer.Core\": \"[10.26.0, )\",\n          \"altcover\": \"[9.0.102, )\"\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/AnalysisContext/SonarAnalysisContextBaseTest.ShouldAnalyzeTree.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text;\nusing Microsoft.CodeAnalysis.Text;\nusing SonarAnalyzer.Core.Syntax.Utilities;\nusing SonarAnalyzer.CSharp.Core.Syntax.Utilities;\nusing SonarAnalyzer.VisualBasic.Core.Syntax.Utilities;\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.AnalysisContext;\n\npublic partial class SonarAnalysisContextBaseTest\n{\n    private const string GeneratedFileName = \"Generated.g.\";\n    private const string OtherFileName = \"OtherFile\";\n\n    [TestMethod]\n    public void ShouldAnalyzeTree_SonarLint()\n    {\n        var options = AnalysisScaffolding.CreateOptions();   // No SonarProjectConfig.xml\n\n        ShouldAnalyzeTree(options).Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void ShouldAnalyzeTree_Scanner_UnchangedFiles_NotAvailable()\n    {\n        var options = AnalysisScaffolding.CreateOptions(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Product));  // SonarProjectConfig.xml without UnchangedFiles.txt\n\n        ShouldAnalyzeTree(options).Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void ShouldAnalyzeTree_Scanner_UnchangedFiles_Empty()\n    {\n        var options = CreateOptions(Array.Empty<string>());\n\n        ShouldAnalyzeTree(options).Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void ShouldAnalyzeTree_Scanner_UnchangedFiles_ContainsTreeFile()\n    {\n        var options = CreateOptions(new[] { OtherFileName + \".cs\" });\n\n        ShouldAnalyzeTree(options).Should().BeFalse(\"File is known to be Unchanged in Incremental PR analysis\");\n    }\n\n    [TestMethod]\n    public void ShouldAnalyzeTree_Scanner_UnchangedFiles_ContainsOtherFile()\n    {\n        var options = CreateOptions(new[] { \"ThisIsNotInCompilation.cs\", \"SomethingElse.cs\" });\n\n        ShouldAnalyzeTree(options).Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void ShouldAnalyzeTree_Scanner_WhenRazorFileHasNotChanged_ReturnsFalseForTheAssociatedGeneratedFile()\n    {\n        // The generated files have a different root that is not absolute and might not exist on disk.\n        const string generatedFileName = \"Microsoft.NET.Sdk.Razor.SourceGenerators\\\\Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator\\\\Pages_Component_razor.g\";\n        const string content =\n            \"\"\"\n            #pragma checksum \"C:\\Component.razor\" \"{8829d00f-11b8-4213-878b-770e8597ac16}\" \"35c3e85c77eb4f50f311a96f96be44f36c36b570ce2579ec311010076f7ac44d\"\n            \"\"\";\n\n        var options = CreateOptions(new[] { @\"C:\\Component.razor\" }); // In the configuration file we always provide full paths.\n\n        ShouldAnalyzeTree(options, generatedFileName, content).Should().BeFalse(\"File is known to be Unchanged in Incremental PR analysis.\");\n    }\n\n    [TestMethod]\n    [DataRow(GeneratedFileName, false)]\n    [DataRow(OtherFileName, true)]\n    public void ShouldAnalyzeTree_GeneratedFile_NoSonarLintXml(string fileName, bool expected)\n    {\n        var sonarLintXml = new DummySourceText(AnalysisScaffolding.GenerateSonarLintXmlContent(analyzeGeneratedCode: true));\n        var (compilation, tree) = CreateDummyCompilation(AnalyzerLanguage.CSharp, fileName);\n        var sut = CreateSut(compilation, CreateOptions(sonarLintXml, @\"TestResources\\Foo.xml\"));\n\n        sut.ShouldAnalyzeTree(tree, CSharpGeneratedCodeRecognizer.Instance).Should().Be(expected);\n        sonarLintXml.ToStringCallCount.Should().Be(0, \"this file doesn't have 'SonarLint.xml' name\");\n    }\n\n    [TestMethod]\n    public void ShouldAnalyzeTree_GeneratedFile_ShouldAnalyzeGeneratedProvider_IsCached()\n    {\n        var sonarLintXml = new DummySourceText(AnalysisScaffolding.GenerateSonarLintXmlContent(analyzeGeneratedCode: true));\n        var additionalText = Substitute.For<AdditionalText>();\n        additionalText.Path.Returns(\"SonarLint.xml\");\n        additionalText.GetText(default).Returns(sonarLintXml);\n        var tree = CreateDummyCompilation(AnalyzerLanguage.CSharp, OtherFileName).Tree;\n        var sut = CreateSut(new AnalyzerOptions(ImmutableArray.Create(additionalText)));\n\n        // Call ShouldAnalyzeGenerated multiple times...\n        sut.ShouldAnalyzeTree(tree, CSharpGeneratedCodeRecognizer.Instance).Should().BeTrue();\n        sut.ShouldAnalyzeTree(tree, CSharpGeneratedCodeRecognizer.Instance).Should().BeTrue();\n        sut.ShouldAnalyzeTree(tree, CSharpGeneratedCodeRecognizer.Instance).Should().BeTrue();\n\n        // GetText should be called every time ShouldAnalyzeGenerated is called...\n        additionalText.Received(3).GetText(Arg.Any<CancellationToken>());\n        sonarLintXml.ToStringCallCount.Should().Be(1); // ... but we should only try to read the file once\n    }\n\n    [TestMethod]\n    [DataRow(GeneratedFileName, false)]\n    [DataRow(OtherFileName, true)]\n    public void ShouldAnalyzeTree_GeneratedFile_InvalidSonarLintXml(string fileName, bool expected)\n    {\n        var sonarLintXml = new DummySourceText(\"Not valid xml\");\n        var (compilation, tree) = CreateDummyCompilation(AnalyzerLanguage.CSharp, fileName);\n        var sut = CreateSut(compilation, CreateOptions(sonarLintXml));\n\n        // 1. Read -> no error\n        sut.ShouldAnalyzeTree(tree, CSharpGeneratedCodeRecognizer.Instance).Should().Be(expected);\n        sonarLintXml.ToStringCallCount.Should().Be(1); // should have attempted to read the file\n\n        // 2. Read again to check that the load error doesn't prevent caching from working\n        sut.ShouldAnalyzeTree(tree, CSharpGeneratedCodeRecognizer.Instance).Should().Be(expected);\n        sonarLintXml.ToStringCallCount.Should().Be(1); // should not have attempted to read the file again\n    }\n\n    [TestMethod]\n    [DataRow(GeneratedFileName)]\n    [DataRow(OtherFileName)]\n    public void ShouldAnalyzeTree_GeneratedFile_AnalyzeGenerated_AnalyzeAllFiles(string fileName)\n    {\n        var sonarLintXml = new DummySourceText(AnalysisScaffolding.GenerateSonarLintXmlContent(analyzeGeneratedCode: true));\n        var (compilation, tree) = CreateDummyCompilation(AnalyzerLanguage.CSharp, fileName);\n        var sut = CreateSut(compilation, CreateOptions(sonarLintXml));\n\n        sut.ShouldAnalyzeTree(tree, CSharpGeneratedCodeRecognizer.Instance).Should().BeTrue();\n    }\n\n    [TestMethod]\n    [DataRow(GeneratedFileName, LanguageNames.CSharp, false)]\n    [DataRow(OtherFileName, LanguageNames.CSharp, true)]\n    [DataRow(GeneratedFileName, LanguageNames.VisualBasic, false)]\n    [DataRow(OtherFileName, LanguageNames.VisualBasic, true)]\n    public void ShouldAnalyzeTree_CorrectSettingUsed(string fileName, string language, bool expected)\n    {\n        var sonarLintXml = new DummySourceText(AnalysisScaffolding.GenerateSonarLintXmlContent(language: language, analyzeGeneratedCode: false));\n        var analyzerLanguage = language == LanguageNames.CSharp ? AnalyzerLanguage.CSharp : AnalyzerLanguage.VisualBasic;\n        var (compilation, tree) = CreateDummyCompilation(analyzerLanguage, fileName);\n        var sut = CreateSut(compilation, CreateOptions(sonarLintXml));\n        GeneratedCodeRecognizer generatedCodeRecognizer = language == LanguageNames.CSharp ? CSharpGeneratedCodeRecognizer.Instance : VisualBasicGeneratedCodeRecognizer.Instance;\n\n        sut.ShouldAnalyzeTree(tree, generatedCodeRecognizer).Should().Be(expected);\n        sonarLintXml.ToStringCallCount.Should().Be(1, \"file should be read once per language\");\n\n        // Read again to check caching\n        sut.ShouldAnalyzeTree(tree, generatedCodeRecognizer).Should().Be(expected);\n        sonarLintXml.ToStringCallCount.Should().Be(1, \"file should not have been read again\");\n    }\n\n    // Until https://github.com/SonarSource/sonar-dotnet/issues/2228, we were considering a file as generated if the word \"generated\" was contained inside a region.\n    [TestMethod]\n    [DataRow(\"generated stuff\")]\n    [DataRow(\"Contains FooGenerated methods\")]\n    [DataRow(\"Windows Form Designer generated code\")] // legacy Windows Forms used to include generated code in dev files, surrounded by such a region\n    [DataRow(\"Windows Form Designer GeNeRaTed code\")] // legacy Windows Forms used to include generated code in dev files, surrounded by such a region\n    public void ShouldAnalyzeTree_IssuesRaisedOnPartiallyGenerated_LegacyWinFormsFile(string regionName)\n    {\n        new VerifierBuilder<CS.EmptyStatement>()\n            .AddSnippet($$\"\"\"\n                class Sample\n                {\n                    void HandWrittenEventHandler()\n                    {\n                        ; // Noncompliant\n                    }\n                #region {{regionName}}\n                    void GeneratedStuff()\n                    {\n                        ; // Noncompliant\n                    }\n                #endregion\n                }\n                \"\"\")\n            .Verify();\n    }\n\n    [TestMethod]\n    public void ShouldAnalyzeTree_NoIssue_OnGeneratedFile_WithGeneratedName()\n    {\n        const string sourceCS = \"\"\"\n            class Sample\n            {\n                void MethodWithEmptyStatement()\n                {\n                    ;   // Noncompliant\n                }\n            }\n            \"\"\";\n        const string sourceVB = \"\"\"\n            Module Sample\n                Sub Main()\n                    Dim Foo() As String ' Noncompliant\n                End Sub\n            End Module\n            \"\"\";\n        VerifyEmpty(\"test.g.cs\", sourceCS, new CS.EmptyStatement());\n        VerifyEmpty(\"test.g.vb\", sourceVB, new VB.ArrayDesignatorOnVariable());\n    }\n\n    [TestMethod]\n    public void ShouldAnalyzeTree_NoIssueOnGeneratedFile_WithAutoGeneratedComment()\n    {\n        const string autogeneratedExpandedTagCS = \"\"\"\n            // ------------------------------------------------------------------------------\n            // <auto-generated>\n            //     This code was generated by a tool.\n            //     Runtime Version:2.0.50727.3053\n            //\n            //     Changes to this file may cause incorrect behavior and will be lost if\n            //     the code is regenerated.\n            // </auto-generated>\n            // ------------------------------------------------------------------------------\n            \"\"\";\n        const string autogeneratedCollapsedTagCS = \"\"\"\n            // <autogenerated />\n            \"\"\";\n        const string autogeneratedGeneratedBySwaggerCS = \"\"\"\n            /*\n             * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)\n             *\n             * OpenAPI spec version: 1.0.0\n             *\n             * Generated by: https://github.com/swagger-api/swagger-codegen.git\n             */\n            \"\"\";\n        const string autogeneratedGeneratedByProtobufCS = \"// Generated by the protocol buffer compiler.  DO NOT EDIT!\";\n        const string sourceCS = \"\"\"\n            // Extra line for concatenation\n            class Sample\n            {\n                void MethodWithEmptyStatement()\n                {\n                    ;   // Noncompliant\n                }\n            }\n            \"\"\";\n        const string sourceVB = \"\"\"\n            '------------------------------------------------------------------------------\n            ' <auto-generated>\n            '     This code was generated by a tool.\n            '     Runtime Version:2.0.50727.4927\n            '\n            '     Changes to this file may cause incorrect behavior and will be lost if\n            '     the code is regenerated.\n            ' </auto-generated>\n            '------------------------------------------------------------------------------\n            Module Module1\n                Sub Main()\n                    Dim Foo() As String ' Noncompliant\n                End Sub\n            End Module\n            \"\"\";\n        VerifyEmpty(\"test.cs\", autogeneratedExpandedTagCS + sourceCS, new CS.EmptyStatement());\n        VerifyEmpty(\"test.cs\", autogeneratedCollapsedTagCS + sourceCS, new CS.EmptyStatement());\n        VerifyEmpty(\"test.cs\", autogeneratedGeneratedBySwaggerCS + sourceCS, new CS.EmptyStatement());\n        VerifyEmpty(\"test.cs\", autogeneratedGeneratedByProtobufCS + sourceCS, new CS.EmptyStatement());\n        VerifyEmpty(\"test.vb\", sourceVB, new VB.ArrayDesignatorOnVariable());\n    }\n\n    [TestMethod]\n    public void ShouldAnalyzeTree_NoIssueOnGeneratedFile_WithExcludedAttribute()\n    {\n        const string sourceCS = \"\"\"\n            class Sample\n            {\n                [System.Diagnostics.DebuggerNonUserCodeAttribute()]\n                void M()\n                {\n                    ;   // Noncompliant\n                }\n            }\n            \"\"\";\n        const string sourceVB = \"\"\"\n            Module Module1\n                <System.Diagnostics.DebuggerNonUserCodeAttribute()>\n                Sub Main()\n                    Dim Foo() As String ' Noncompliant\n                End Sub\n            End Module\n            \"\"\";\n        VerifyEmpty(\"test.cs\", sourceCS, new CS.EmptyStatement());\n        VerifyEmpty(\"test.vb\", sourceVB, new VB.ArrayDesignatorOnVariable());\n    }\n\n    [TestMethod]\n    public void ShouldAnalyzeTree_NoIssueOnGeneratedAnnotatedLambda_WithExcludedAttribute()\n    {\n        const string sourceCs = \"\"\"\n            using System;\n            using System.Diagnostics;\n            using System.Runtime.CompilerServices;\n\n            class Sample\n            {\n                public void Bar()\n                {\n                    [DebuggerNonUserCodeAttribute()] int Do() => 1;\n\n                    Action a = [CompilerGenerated] () => { ;;; };\n\n                    Action x = true\n                                    ? ([DebuggerNonUserCodeAttribute] () => { ;;; })\n                                    : [GenericAttribute<int>] () => { ;;; }; // FN? Empty statement in lambda\n\n                    Call([DebuggerNonUserCodeAttribute] (x) => { ;;; });\n                }\n\n                private void Call(Action<int> action) => action(1);\n            }\n\n            public class GenericAttribute<T> : Attribute { }\n            \"\"\";\n        VerifyEmpty(\"test.cs\", sourceCs, new CS.EmptyStatement());\n    }\n\n    [TestMethod]\n    [DataRow(\"Foo\", new string[] { \"Foo\" }, ProjectType.Product, false)]\n    [DataRow(\"Foo\", new string[] { \"NotFoo\" }, ProjectType.Product, true)]\n    [DataRow(\"Foo\", new string[] { \"Foo\" }, ProjectType.Test, true)]\n    [DataRow(\"Foo\", new string[] { \"NotFoo\" }, ProjectType.Test, true)]\n    public void ShouldAnalyzeTree_Exclusions_ReturnExpected(string filePath, string[] exclusions, ProjectType projectType, bool expectedResult) =>\n        ShouldAnalyzeTree_WithExclusionInclusionParametersSet_ReturnsTrueForIncludedFilesOnly(filePath, projectType, expectedResult, exclusions: exclusions);\n\n    [TestMethod]\n    [DataRow(\"Foo\", new string[] { \"Foo\" }, ProjectType.Product, false)]\n    [DataRow(\"Foo\", new string[] { \"NotFoo\" }, ProjectType.Product, true)]\n    [DataRow(\"Foo\", new string[] { \"Foo\" }, ProjectType.Test, true)]\n    [DataRow(\"Foo\", new string[] { \"NotFoo\" }, ProjectType.Test, true)]\n    public void ShouldAnalyzeTree_GlobalExclusions_ReturnExpected(string filePath, string[] globalExclusions, ProjectType projectType, bool expectedResult) =>\n        ShouldAnalyzeTree_WithExclusionInclusionParametersSet_ReturnsTrueForIncludedFilesOnly(filePath, projectType, expectedResult, globalExclusions: globalExclusions);\n\n    [TestMethod]\n    [DataRow(\"Foo\", new string[] { \"Foo\" }, ProjectType.Product, true)]\n    [DataRow(\"Foo\", new string[] { \"NotFoo\" }, ProjectType.Product, true)]\n    [DataRow(\"Foo\", new string[] { \"Foo\" }, ProjectType.Test, false)]\n    [DataRow(\"Foo\", new string[] { \"NotFoo\" }, ProjectType.Test, true)]\n    public void ShouldAnalyzeTree_TestExclusions_ReturnExpected(string filePath, string[] testExclusions, ProjectType projectType, bool expectedResult) =>\n        ShouldAnalyzeTree_WithExclusionInclusionParametersSet_ReturnsTrueForIncludedFilesOnly(filePath, projectType, expectedResult, testExclusions: testExclusions);\n\n    [TestMethod]\n    [DataRow(\"Foo\", new string[] { \"Foo\" }, ProjectType.Product, true)]\n    [DataRow(\"Foo\", new string[] { \"NotFoo\" }, ProjectType.Product, true)]\n    [DataRow(\"Foo\", new string[] { \"Foo\" }, ProjectType.Test, false)]\n    [DataRow(\"Foo\", new string[] { \"NotFoo\" }, ProjectType.Test, true)]\n    public void ShouldAnalyzeTree_GlobalTestExclusions_ReturnExpected(string filePath, string[] globalTestExclusions, ProjectType projectType, bool expectedResult) =>\n        ShouldAnalyzeTree_WithExclusionInclusionParametersSet_ReturnsTrueForIncludedFilesOnly(filePath, projectType, expectedResult, globalTestExclusions: globalTestExclusions);\n\n    [TestMethod]\n    [DataRow(\"Foo\", new string[] { \"Foo\" }, ProjectType.Product, true)]\n    [DataRow(\"Foo\", new string[] { \"NotFoo\" }, ProjectType.Product, false)]\n    [DataRow(\"Foo\", new string[] { \"Foo\" }, ProjectType.Test, true)]\n    [DataRow(\"Foo\", new string[] { \"NotFoo\" }, ProjectType.Test, true)]\n    public void ShouldAnalyzeTree_Inclusions_ReturnExpected(string filePath, string[] inclusions, ProjectType projectType, bool expectedResult) =>\n        ShouldAnalyzeTree_WithExclusionInclusionParametersSet_ReturnsTrueForIncludedFilesOnly(filePath, projectType, expectedResult, inclusions: inclusions);\n\n    [TestMethod]\n    [DataRow(\"Foo\", new string[] { \"Foo\" }, ProjectType.Product, true)]\n    [DataRow(\"Foo\", new string[] { \"NotFoo\" }, ProjectType.Product, true)]\n    [DataRow(\"Foo\", new string[] { \"Foo\" }, ProjectType.Test, true)]\n    [DataRow(\"Foo\", new string[] { \"NotFoo\" }, ProjectType.Test, false)]\n    public void ShouldAnalyzeTree_TestInclusions_ReturnExpected(string filePath, string[] testInclusions, ProjectType projectType, bool expectedResult) =>\n        ShouldAnalyzeTree_WithExclusionInclusionParametersSet_ReturnsTrueForIncludedFilesOnly(filePath, projectType, expectedResult, testInclusions: testInclusions);\n\n    [TestMethod]\n    [DataRow(\"Foo\", new string[] { \"Foo\" }, new string[] { \"Foo\" }, false)]\n    [DataRow(\"Foo\", new string[] { \"NotFoo\" }, new string[] { \"Foo\" }, false)]\n    [DataRow(\"Foo\", new string[] { \"Foo\" }, new string[] { \"NotFoo\" }, true)]\n    [DataRow(\"Foo\", new string[] { \"NotFoo\" }, new string[] { \"NotFoo\" }, false)]\n    public void ShouldAnalyzeTree_MixedInput_ProductProject_ReturnExpected(string filePath, string[] inclusions, string[] exclusions, bool expectedResult) =>\n        ShouldAnalyzeTree_WithExclusionInclusionParametersSet_ReturnsTrueForIncludedFilesOnly(filePath, ProjectType.Product, expectedResult, inclusions: inclusions, exclusions: exclusions);\n\n    [TestMethod]\n    [DataRow(\"Foo\", new string[] { \"Foo\" }, new string[] { \"Foo\" }, false)]\n    [DataRow(\"Foo\", new string[] { \"NotFoo\" }, new string[] { \"Foo\" }, false)]\n    [DataRow(\"Foo\", new string[] { \"Foo\" }, new string[] { \"NotFoo\" }, true)]\n    [DataRow(\"Foo\", new string[] { \"NotFoo\" }, new string[] { \"NotFoo\" }, false)]\n    public void ShouldAnalyzeTree_MixedInput_TestProject_ReturnExpected(string filePath, string[] testInclusions, string[] testExclusions, bool expectedResult) =>\n        ShouldAnalyzeTree_WithExclusionInclusionParametersSet_ReturnsTrueForIncludedFilesOnly(filePath, ProjectType.Test, expectedResult, testInclusions: testInclusions, testExclusions: testExclusions);\n\n    private void ShouldAnalyzeTree_WithExclusionInclusionParametersSet_ReturnsTrueForIncludedFilesOnly(\n        string fileName,\n        ProjectType projectType,\n        bool shouldAnalyze,\n        string language = LanguageNames.CSharp,\n        string[] exclusions = null,\n        string[] inclusions = null,\n        string[] globalExclusions = null,\n        string[] testExclusions = null,\n        string[] testInclusions = null,\n        string[] globalTestExclusions = null)\n    {\n        var analyzerLanguage = language == LanguageNames.CSharp ? AnalyzerLanguage.CSharp : AnalyzerLanguage.VisualBasic;\n        var sonarLintXml = AnalysisScaffolding.CreateSonarLintXml(\n            TestContext,\n            language: language,\n            exclusions: exclusions,\n            inclusions: inclusions,\n            globalExclusions: globalExclusions,\n            testExclusions: testExclusions,\n            testInclusions: testInclusions,\n            globalTestExclusions: globalTestExclusions);\n        var options = AnalysisScaffolding.CreateOptions(sonarLintXml);\n\n        var compilation = SolutionBuilder\n            .Create()\n            .AddProject(analyzerLanguage)\n            .AddReferences(TestCompiler.ProjectTypeReference(projectType))\n            .AddSnippet(string.Empty, fileName)\n            .GetCompilation();\n        var tree = compilation.SyntaxTrees.Single(x => x.FilePath.Contains(fileName));\n        var sut = CreateSut(compilation, options);\n\n        GeneratedCodeRecognizer codeRecognizer = language == LanguageNames.CSharp ? CSharpGeneratedCodeRecognizer.Instance : VisualBasicGeneratedCodeRecognizer.Instance;\n        sut.ShouldAnalyzeTree(tree, codeRecognizer).Should().Be(shouldAnalyze);\n    }\n\n    private AnalyzerOptions CreateOptions(string[] unchangedFiles) =>\n        AnalysisScaffolding.CreateOptions(AnalysisScaffolding.CreateSonarProjectConfigWithUnchangedFiles(TestContext, unchangedFiles));\n\n    private static AnalyzerOptions CreateOptions(SourceText sourceText, string path = @\"TestResources\\SonarLint.xml\") =>\n        AnalysisScaffolding.CreateOptions(path, sourceText);\n\n    private static (Compilation Compilation, SyntaxTree Tree) CreateDummyCompilation(AnalyzerLanguage language, string treeFileName)\n    {\n        var compilation = SolutionBuilder.Create().AddProject(language)\n            .AddSnippet(string.Empty, GeneratedFileName + language.FileExtension)\n            .AddSnippet(string.Empty, OtherFileName + language.FileExtension)\n            .GetCompilation();\n        return (compilation, compilation.SyntaxTrees.Single(x => x.FilePath.Contains(treeFileName)));\n    }\n\n    private static bool ShouldAnalyzeTree(AnalyzerOptions options, string fileName = OtherFileName, string content = \"\")\n    {\n        var compilation = SolutionBuilder.Create().AddProject(AnalyzerLanguage.CSharp).AddSnippet(content, fileName + AnalyzerLanguage.CSharp.FileExtension).GetCompilation();\n        var tree = compilation.SyntaxTrees.Single(x => x.FilePath.Contains(fileName));\n        return CreateSut(options).ShouldAnalyzeTree(tree, CSharpGeneratedCodeRecognizer.Instance);\n    }\n\n    private static void VerifyEmpty(string fileName, string snippet, DiagnosticAnalyzer analyzer)\n    {\n        var builder = new VerifierBuilder().AddAnalyzer(() => analyzer).AddSnippet(snippet, fileName);\n        var language = AnalyzerLanguage.FromPath(fileName);\n        builder = language.LanguageName switch\n        {\n            LanguageNames.CSharp => builder.WithLanguageVersion(Microsoft.CodeAnalysis.CSharp.LanguageVersion.Latest),\n            LanguageNames.VisualBasic => builder.WithLanguageVersion(Microsoft.CodeAnalysis.VisualBasic.LanguageVersion.Latest),\n            _ => throw new UnexpectedLanguageException(language)\n        };\n        builder.VerifyNoIssues();\n    }\n\n    private sealed class DummySourceText : SourceText\n    {\n        private readonly string textToReturn;\n\n        public int ToStringCallCount { get; private set; }\n        public override char this[int position] => throw new NotImplementedException();\n        public override Encoding Encoding => throw new NotImplementedException();\n        public override int Length => throw new NotImplementedException();\n\n        public DummySourceText(string textToReturn) =>\n            this.textToReturn = textToReturn;\n\n        public override string ToString()\n        {\n            ToStringCallCount++;\n            return textToReturn;\n        }\n\n        public override void CopyTo(int sourceIndex, char[] destination, int destinationIndex, int count) =>\n            throw new NotImplementedException();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/AnalysisContext/SonarAnalysisContextBaseTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.AnalysisContext;\nusing SonarAnalyzer.CSharp.Core.Syntax.Utilities;\n\nnamespace SonarAnalyzer.Test.AnalysisContext;\n\n[TestClass]\npublic partial class SonarAnalysisContextBaseTest\n{\n    private const string MainTag = \"MainSourceScope\";\n    private const string TestTag = \"TestSourceScope\";\n    private const string UtilityTag = \"Utility\";\n    private const string DummyID = \"Sxxx\";\n    private const string StyleID = \"Txxx\";\n\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    [DataRow(true, ProjectType.Product, MainTag)]\n    [DataRow(true, ProjectType.Product, MainTag, UtilityTag)]\n    [DataRow(true, ProjectType.Product, MainTag, TestTag)]\n    [DataRow(true, ProjectType.Product, MainTag, TestTag, UtilityTag)]\n    [DataRow(true, ProjectType.Test, TestTag)]\n    [DataRow(true, ProjectType.Test, TestTag, UtilityTag)]\n    [DataRow(true, ProjectType.Test, MainTag, TestTag)]\n    [DataRow(true, ProjectType.Test, MainTag, TestTag, UtilityTag)]\n    [DataRow(false, ProjectType.Product, TestTag)]\n    [DataRow(false, ProjectType.Product, TestTag, TestTag)]\n    [DataRow(false, ProjectType.Test, MainTag)]\n    [DataRow(false, ProjectType.Test, MainTag, MainTag)]\n    public void HasMatchingScope_SingleDiagnostic_WithOneOrMoreScopes_SonarLint(bool expectedResult, ProjectType projectType, params string[] ruleTags)\n    {\n        var sut = CreateSut(projectType, false);\n        sut.HasMatchingScope(AnalysisScaffolding.CreateDescriptor(DummyID, ruleTags)).Should().Be(expectedResult);\n        sut.HasMatchingScope(AnalysisScaffolding.CreateDescriptor(StyleID, ruleTags)).Should().Be(expectedResult);\n    }\n\n    [TestMethod]\n    [DataRow(true, DummyID, ProjectType.Product, MainTag)]\n    [DataRow(true, StyleID, ProjectType.Product, MainTag)]\n    [DataRow(true, DummyID, ProjectType.Product, MainTag, UtilityTag)]\n    [DataRow(true, DummyID, ProjectType.Product, MainTag, TestTag)]\n    [DataRow(true, StyleID, ProjectType.Product, MainTag, TestTag)]\n    [DataRow(true, DummyID, ProjectType.Product, MainTag, TestTag, UtilityTag)]\n    [DataRow(true, DummyID, ProjectType.Test, TestTag)]\n    [DataRow(true, StyleID, ProjectType.Test, TestTag)]\n    [DataRow(true, DummyID, ProjectType.Test, TestTag, UtilityTag)]\n    [DataRow(true, DummyID, ProjectType.Test, MainTag, TestTag, UtilityTag)]    // Utility rules with scope Test&Main do run on test code under scanner context.\n    [DataRow(false, DummyID, ProjectType.Test, MainTag, TestTag)]               // Rules with scope Test&Main do not run on test code under scanner context for now.\n    [DataRow(true, StyleID, ProjectType.Test, MainTag, TestTag)]                // Style rules with Test&Main scope do run on test code under scanner context\n    [DataRow(false, DummyID, ProjectType.Product, TestTag)]\n    [DataRow(false, StyleID, ProjectType.Product, TestTag)]\n    [DataRow(false, DummyID, ProjectType.Product, TestTag, UtilityTag)]\n    [DataRow(false, DummyID, ProjectType.Product, TestTag, TestTag)]\n    [DataRow(false, StyleID, ProjectType.Product, TestTag, TestTag)]\n    [DataRow(false, DummyID, ProjectType.Test, MainTag)]\n    [DataRow(false, StyleID, ProjectType.Test, MainTag)]\n    [DataRow(false, DummyID, ProjectType.Test, MainTag, UtilityTag)]\n    [DataRow(false, DummyID, ProjectType.Test, MainTag, MainTag)]\n    [DataRow(false, StyleID, ProjectType.Test, MainTag, MainTag)]\n    public void HasMatchingScope_SingleDiagnostic_WithOneOrMoreScopes_Scanner(bool expectedResult, string id, ProjectType projectType, params string[] ruleTags)\n    {\n        var diagnostic = AnalysisScaffolding.CreateDescriptor(id, ruleTags);\n        CreateSut(projectType, true).HasMatchingScope(diagnostic).Should().Be(expectedResult);\n    }\n\n    [TestMethod]\n    [DataRow(true, ProjectType.Product, MainTag, MainTag)]\n    [DataRow(true, ProjectType.Product, MainTag, MainTag)]\n    [DataRow(true, ProjectType.Product, MainTag, TestTag)]\n    [DataRow(true, ProjectType.Test, TestTag, TestTag)]\n    [DataRow(true, ProjectType.Test, TestTag, MainTag)]\n    [DataRow(false, ProjectType.Product, TestTag, TestTag)]\n    [DataRow(false, ProjectType.Test, MainTag, MainTag)]\n    public void HasMatchingScope_MultipleDiagnostics_WithSingleScope_SonarLint(bool expectedResult, ProjectType projectType, params string[] rulesTag)\n    {\n        var diagnostics = rulesTag.Select(x => AnalysisScaffolding.CreateDescriptor(DummyID, x)).ToImmutableArray();\n        CreateSut(projectType, false).HasMatchingScope(diagnostics).Should().Be(expectedResult);\n    }\n\n    [TestMethod]\n    [DataRow(true, ProjectType.Product, MainTag, MainTag)]\n    [DataRow(true, ProjectType.Product, MainTag, TestTag)]\n    [DataRow(true, ProjectType.Test, TestTag, TestTag)]\n    [DataRow(true, ProjectType.Test, TestTag, MainTag)]    // Rules with scope Test&Main will run to let the Test diagnostics to be detected. ReportDiagnostic should filter Main issues out.\n    [DataRow(false, ProjectType.Product, TestTag, TestTag)]\n    [DataRow(false, ProjectType.Test, MainTag, MainTag)]\n    public void HasMatchingScope_MultipleDiagnostics_WithSingleScope_Scanner(bool expectedResult, ProjectType projectType, params string[] rulesTag)\n    {\n        var diagnostics = rulesTag.Select(x => AnalysisScaffolding.CreateDescriptor(DummyID, x)).ToImmutableArray();\n        CreateSut(projectType, true).HasMatchingScope(diagnostics).Should().Be(expectedResult);\n    }\n\n    [TestMethod]\n    public void ProjectConfiguration_LoadsExpectedValues()\n    {\n        var options = AnalysisScaffolding.CreateOptions(@\"TestResources\\SonarProjectConfig\\Path_Windows\\SonarProjectConfig.xml\");\n        var config = CreateSut(options).ProjectConfiguration();\n\n        config.AnalysisConfigPath.Should().Be(@\"c:\\foo\\bar\\.sonarqube\\conf\\SonarQubeAnalysisConfig.xml\");\n    }\n\n    [TestMethod]\n    public void ProjectConfiguration_UsesCachedValue()\n    {\n        var options = AnalysisScaffolding.CreateOptions(@\"TestResources\\SonarProjectConfig\\Path_Windows\\SonarProjectConfig.xml\");\n        var firstSut = CreateSut(options);\n        var secondSut = CreateSut(options);\n        var firstConfig = firstSut.ProjectConfiguration();\n        var secondConfig = secondSut.ProjectConfiguration();\n\n        secondConfig.Should().BeSameAs(firstConfig);\n    }\n\n    [TestMethod]\n    public void ProjectConfiguration_WhenFileChanges_RebuildsCache()\n    {\n        var firstOptions = AnalysisScaffolding.CreateOptions(@\"TestResources\\SonarProjectConfig\\Path_Windows\\SonarProjectConfig.xml\");\n        var secondOptions = AnalysisScaffolding.CreateOptions(@\"TestResources\\SonarProjectConfig\\Path_Unix\\SonarProjectConfig.xml\");\n        var firstConfig = CreateSut(firstOptions).ProjectConfiguration();\n        var secondConfig = CreateSut(secondOptions).ProjectConfiguration();\n\n        secondConfig.Should().NotBeSameAs(firstConfig);\n    }\n\n    [TestMethod]\n    [DataRow(null)]\n    [DataRow(\"/foo/bar/does-not-exit\")]\n    [DataRow(\"/foo/bar/x.xml\")]\n    public void ProjectConfiguration_WhenAdditionalFileNotPresent_ReturnsEmptyConfig(string folder)\n    {\n        var options = AnalysisScaffolding.CreateOptions(folder);\n        var config = CreateSut(options).ProjectConfiguration();\n\n        config.AnalysisConfigPath.Should().BeNull();\n        config.ProjectPath.Should().BeNull();\n        config.FilesToAnalyzePath.Should().BeNull();\n        config.OutPath.Should().BeNull();\n        config.ProjectType.Should().Be(ProjectType.Unknown);\n        config.TargetFramework.Should().BeNull();\n    }\n\n    [TestMethod]\n    public void ProjectConfiguration_WhenFileIsMissing_ThrowException()\n    {\n        var sut = CreateSut(AnalysisScaffolding.CreateOptions(@\"ThisPathDoesNotExist\\SonarProjectConfig.xml\"));\n\n        sut.Invoking(x => x.ProjectConfiguration())\n           .Should()\n           .Throw<InvalidOperationException>()\n           .WithMessage(\"File 'SonarProjectConfig.xml' has been added as an AdditionalFile but could not be read and parsed.\");\n    }\n\n    [TestMethod]\n    public void ProjectConfiguration_WhenInvalidXml_ThrowException()\n    {\n        var sut = CreateSut(AnalysisScaffolding.CreateOptions(@\"TestResources\\SonarProjectConfig\\Invalid_Xml\\SonarProjectConfig.xml\"));\n\n        sut.Invoking(x => x.ProjectConfiguration())\n           .Should()\n           .Throw<InvalidOperationException>()\n           .WithMessage(\"File 'SonarProjectConfig.xml' has been added as an AdditionalFile but could not be read and parsed.\");\n    }\n\n    [TestMethod]\n    [DataRow(\"cs\")]\n    [DataRow(\"vbnet\")]\n    public void SonarLintFile_LoadsExpectedValues(string language)\n    {\n        var analyzerLanguage = language == \"cs\" ? AnalyzerLanguage.CSharp : AnalyzerLanguage.VisualBasic;\n        var (compilation, _) = CreateDummyCompilation(analyzerLanguage, GeneratedFileName);\n        var options = AnalysisScaffolding.CreateOptions($@\"TestResources\\SonarLintXml\\All_properties_{language}\\SonarLint.xml\");\n        var sut = CreateSut(compilation, options).SonarLintXml();\n\n        sut.IgnoreHeaderComments(analyzerLanguage.LanguageName).Should().BeTrue();\n        sut.AnalyzeGeneratedCode(analyzerLanguage.LanguageName).Should().BeFalse();\n        sut.AnalyzeRazorCode(analyzerLanguage.LanguageName).Should().BeFalse();\n        AssertArrayContent(sut.Exclusions, nameof(sut.Exclusions));\n        AssertArrayContent(sut.Inclusions, nameof(sut.Inclusions));\n        AssertArrayContent(sut.GlobalExclusions, nameof(sut.GlobalExclusions));\n        AssertArrayContent(sut.TestExclusions, nameof(sut.TestExclusions));\n        AssertArrayContent(sut.TestInclusions, nameof(sut.TestInclusions));\n        AssertArrayContent(sut.GlobalTestExclusions, nameof(sut.GlobalTestExclusions));\n\n        static void AssertArrayContent(string[] array, string folder)\n        {\n            array.Should().HaveCount(2);\n            array[0].Should().BeEquivalentTo($\"Fake/{folder}/**/*\");\n            array[1].Should().BeEquivalentTo($\"Fake/{folder}/Second*/**/*\");\n        }\n    }\n\n    [TestMethod]\n    public void SonarLintFile_UsesCachedValue()\n    {\n        var options = AnalysisScaffolding.CreateOptions(@\"TestResources\\SonarLintXml\\All_properties_cs\\SonarLint.xml\");\n        var firstSut = CreateSut(options);\n        var secondSut = CreateSut(options);\n        var firstFile = firstSut.SonarLintXml();\n        var secondFile = secondSut.SonarLintXml();\n\n        secondFile.Should().BeSameAs(firstFile);\n    }\n\n    [TestMethod]\n    public void SonarLintFile_WhenFileChanges_RebuildsCache()\n    {\n        var firstOptions = AnalysisScaffolding.CreateOptions(@\"TestResources\\SonarLintXml\\All_properties_cs\\SonarLint.xml\");\n        var secondOptions = AnalysisScaffolding.CreateOptions(@\"TestResources\\SonarLintXml\\All_properties_vbnet\\SonarLint.xml\");\n        var firstFile = CreateSut(firstOptions).SonarLintXml();\n        var secondFile = CreateSut(secondOptions).SonarLintXml();\n\n        secondFile.Should().NotBeSameAs(firstFile);\n    }\n\n    [TestMethod]\n    [DataRow(null)]\n    [DataRow(@\"\\foo\\bar\\does-not-exit\")]\n    [DataRow(@\"\\foo\\bar\\x.xml\")]\n    [DataRow(\"path//aSonarLint.xml\")] // different name\n    [DataRow(\"path//SonarLint.xmla\")] // different extension\n    public void SonarLintFile_WhenAdditionalFileNotPresent_ReturnsDefaultValues(string folder)\n    {\n        var sut = CreateSut(AnalysisScaffolding.CreateOptions(folder)).SonarLintXml();\n        CheckSonarLintXmlDefaultValues(sut);\n    }\n\n    [TestMethod]\n    public void SonarLintFile_WhenInvalidXml_ReturnsDefaultValues()\n    {\n        var sut = CreateSut(AnalysisScaffolding.CreateOptions(@\"TestResources\\SonarLintXml\\Invalid_Xml\\SonarLint.xml\")).SonarLintXml();\n        CheckSonarLintXmlDefaultValues(sut);\n    }\n\n    [TestMethod]\n    public void SonarLintFile_WhenFileIsMissing_ThrowException()\n    {\n        var sut = CreateSut(AnalysisScaffolding.CreateOptions(@\"ThisPathDoesNotExist\\SonarLint.xml\"));\n\n        sut.Invoking(x => x.SonarLintXml())\n           .Should()\n           .Throw<InvalidOperationException>()\n           .WithMessage(\"File 'SonarLint.xml' has been added as an AdditionalFile but could not be read and parsed.\");\n    }\n\n    [TestMethod]\n    public void ReportIssue_Null_Throws()\n    {\n        var compilation = TestCompiler.CompileCS(\"// Nothing to see here\").Model.Compilation;\n        var sut = CreateSut(ProjectType.Product, false);\n        var rule = AnalysisScaffolding.CreateDescriptor(\"Sxxxx\", DiagnosticDescriptorFactory.MainSourceScopeTag);\n        var recognizer = CSharpGeneratedCodeRecognizer.Instance;\n\n        sut.Invoking(x => x.ReportIssue(recognizer, null, primaryLocation: null, secondaryLocations: [])).Should().Throw<ArgumentNullException>().And.ParamName.Should().Be(\"rule\");\n        sut.Invoking(x => x.ReportIssue(recognizer, rule, primaryLocation: null, secondaryLocations: null)).Should().NotThrow();\n    }\n\n    [TestMethod]\n    public void ReportIssue_NullLocation_UsesEmpty()\n    {\n        Diagnostic lastDiagnostic = null;\n        var compilation = TestCompiler.CompileCS(\"// Nothing to see here\").Model.Compilation;\n        var compilationContext = new CompilationAnalysisContext(compilation, AnalysisScaffolding.CreateOptions(), x => lastDiagnostic = x, _ => true, default);\n        var sut = new SonarCompilationReportingContext(AnalysisScaffolding.CreateSonarAnalysisContext(), compilationContext);\n        var rule = AnalysisScaffolding.CreateDescriptor(\"Sxxxx\", DiagnosticDescriptorFactory.MainSourceScopeTag);\n        var recognizer = CSharpGeneratedCodeRecognizer.Instance;\n\n        sut.ReportIssue(recognizer, rule, location: null);\n        lastDiagnostic.Should().NotBeNull();\n        lastDiagnostic.Location.Should().Be(Location.None);\n\n        sut.ReportIssue(recognizer, rule, primaryLocation: null, secondaryLocations: []);\n        lastDiagnostic.Should().NotBeNull();\n        lastDiagnostic.Location.Should().Be(Location.None);\n    }\n\n    private static void CheckSonarLintXmlDefaultValues(SonarLintXmlReader sut)\n    {\n        sut.AnalyzeRazorCode(LanguageNames.CSharp).Should().BeTrue();\n        sut.AnalyzeGeneratedCode(LanguageNames.CSharp).Should().BeFalse();\n        sut.IgnoreHeaderComments(LanguageNames.CSharp).Should().BeFalse();\n        sut.Exclusions.Should().NotBeNull().And.HaveCount(0);\n        sut.Inclusions.Should().NotBeNull().And.HaveCount(0);\n        sut.GlobalExclusions.Should().NotBeNull().And.HaveCount(0);\n        sut.TestExclusions.Should().NotBeNull().And.HaveCount(0);\n        sut.TestInclusions.Should().NotBeNull().And.HaveCount(0);\n        sut.GlobalTestExclusions.Should().NotBeNull().And.HaveCount(0);\n    }\n\n    private SonarCompilationReportingContext CreateSut(ProjectType projectType, bool isScannerRun) =>\n        CreateSut(AnalysisScaffolding.CreateOptions(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, projectType, isScannerRun)));\n\n    private static SonarCompilationReportingContext CreateSut(AnalyzerOptions options) =>\n        CreateSut(new SnippetCompiler(\"// Nothing to see here\").Model.Compilation, options);\n\n    private static SonarCompilationReportingContext CreateSut(Compilation compilation, AnalyzerOptions options)\n    {\n        var compilationContext = new CompilationAnalysisContext(compilation, options, _ => { }, _ => true, default);\n        return new(AnalysisScaffolding.CreateSonarAnalysisContext(), compilationContext);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/AnalysisContext/SonarAnalysisContextTest.Parametrized.cs",
    "content": "﻿/*\n* SonarAnalyzer for .NET\n* Copyright (C) SonarSource Sàrl\n* mailto:info AT sonarsource DOT com\n* This program is free software; you can redistribute it and/or\n* modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA.\n*\n* This program is distributed in the hope that it will be useful,\n* but WITHOUT ANY WARRANTY; without even the implied warranty of\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n* See the Sonar Source-Available License for more details.\n*\n* You should have received a copy of the Sonar Source-Available License\n* along with this program; if not, see https://sonarsource.com/license/ssal/\n*/\n\nextern alias common;\n\nusing common::SonarAnalyzer.Core.AnalysisContext;\nusing Microsoft.CodeAnalysis.CSharp;\nusing SonarAnalyzer.CSharp.Core.Syntax.Utilities;\nusing CS = SonarAnalyzer.CSharp.Core.Extensions.SonarParametrizedAnalysisContextExtensions;\nusing VB = SonarAnalyzer.VisualBasic.Core.Extensions.SonarParametrizedAnalysisContextExtensions;\n\nnamespace SonarAnalyzer.Test.AnalysisContext;\n\npublic partial class SonarAnalysisContextTest\n{\n    [TestMethod]\n    [DataRow(SnippetFileName, false)]\n    [DataRow(AnotherFileName, true)]\n    public void RegisterNodeAction_UnchangedFiles_SonarParametrizedAnalysisContext(string unchangedFileName, bool expected)\n    {\n        var context = new DummyAnalysisContext(TestContext, unchangedFileName);\n        var sonarContext = new SonarAnalysisContext(context, DummyMainDescriptor);\n        var sut = new SonarParametrizedAnalysisContext(sonarContext);\n        sut.RegisterNodeAction<SyntaxKind>(CSharpGeneratedCodeRecognizer.Instance, context.DelegateAction);\n        sonarContext.RegisterCompilationStartAction(sut.ExecutePostponedActions);\n\n        context.AssertDelegateInvoked(expected);\n    }\n\n    [TestMethod]\n    [DataRow(SnippetFileName, false)]\n    [DataRow(AnotherFileName, true)]\n    public void RegisterTreeAction_UnchangedFiles_SonarParametrizedAnalysisContext(string unchangedFileName, bool expected)\n    {\n        var context = new DummyAnalysisContext(TestContext, unchangedFileName);\n        var sut = new SonarParametrizedAnalysisContext(new(context, DummyMainDescriptor));\n        sut.RegisterTreeAction(CSharpGeneratedCodeRecognizer.Instance, context.DelegateAction);\n        sut.ExecutePostponedActions(new(sut, MockCompilationStartAnalysisContext(context)));  // Manual invocation, because SonarParametrizedAnalysisContext stores actions separately\n\n        context.AssertDelegateInvoked(expected);\n    }\n\n    [TestMethod]\n    public void RegisterTreeAction_Extension_SonarParametrizedAnalysisContext_CS()\n    {\n        var context = new DummyAnalysisContext(TestContext);\n        var self = new SonarParametrizedAnalysisContext(new(context, DummyMainDescriptor));\n        CS.RegisterTreeAction(self, context.DelegateAction);\n        self.ExecutePostponedActions(new(self, MockCompilationStartAnalysisContext(context)));  // Manual invocation, because SonarParametrizedAnalysisContext stores actions separately\n\n        context.AssertDelegateInvoked(true);\n    }\n\n    [TestMethod]\n    public void RegisterTreeAction_Extension_SonarParametrizedAnalysisContext_VB()\n    {\n        var context = new DummyAnalysisContext(TestContext);\n        var self = new SonarParametrizedAnalysisContext(new(context, DummyMainDescriptor));\n        VB.RegisterTreeAction(self, context.DelegateAction);\n        self.ExecutePostponedActions(new(self, MockCompilationStartAnalysisContext(context)));  // Manual invocation, because SonarParametrizedAnalysisContext stores actions separately\n\n        context.AssertDelegateInvoked(true);\n    }\n\n    [TestMethod]\n    [DataRow(SnippetFileName, false)]\n    [DataRow(AnotherFileName, true)]\n    public void RegisterSemanticModelAction_UnchangedFiles_SonarParametrizedAnalysisContext(string unchangedFileName, bool expected)\n    {\n        var context = new DummyAnalysisContext(TestContext, unchangedFileName);\n        var sut = new SonarParametrizedAnalysisContext(new(context, DummyMainDescriptor));\n        sut.RegisterSemanticModelAction(CSharpGeneratedCodeRecognizer.Instance, context.DelegateAction);\n        ExecutePostponedActions(sut, context);\n\n        context.AssertDelegateInvoked(expected);\n    }\n\n    [TestMethod]\n    public void RegisterSemanticModelAction_Extension_SonarParametrizedAnalysisContext_CS()\n    {\n        var context = new DummyAnalysisContext(TestContext);\n        var self = new SonarParametrizedAnalysisContext(new(context, DummyMainDescriptor));\n        CS.RegisterSemanticModelAction(self, context.DelegateAction);\n        ExecutePostponedActions(self, context);\n\n        context.AssertDelegateInvoked(true);\n    }\n\n    [TestMethod]\n    public void RegisterSemanticModelAction_Extension_SonarParametrizedAnalysisContext_VB()\n    {\n        var context = new DummyAnalysisContext(TestContext);\n        var self = new SonarParametrizedAnalysisContext(new(context, DummyMainDescriptor));\n        VB.RegisterSemanticModelAction(self, context.DelegateAction);\n        ExecutePostponedActions(self, context);\n\n        context.AssertDelegateInvoked(true);\n    }\n\n    private static void ExecutePostponedActions(SonarParametrizedAnalysisContext self, DummyAnalysisContext dummyAnalysisContext)\n    {\n        var sub = Substitute.For<CompilationStartAnalysisContext>(dummyAnalysisContext.Model.Compilation, dummyAnalysisContext.Options, CancellationToken.None);\n        sub\n            .When(x => x.RegisterSemanticModelAction(Arg.Any<Action<SemanticModelAnalysisContext>>()))\n            .Do(x => x.Arg<Action<SemanticModelAnalysisContext>>().Invoke(dummyAnalysisContext.CreateSemanticModelAnalysisContext()));\n        self.ExecutePostponedActions(new(self, sub));\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/AnalysisContext/SonarAnalysisContextTest.Register.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing SonarAnalyzer.Core.AnalysisContext;\nusing SonarAnalyzer.CSharp.Core.Syntax.Utilities;\nusing CS = SonarAnalyzer.CSharp.Core.Extensions.SonarAnalysisContextExtensions;\nusing RoslynAnalysisContext = Microsoft.CodeAnalysis.Diagnostics.AnalysisContext;\nusing VB = SonarAnalyzer.VisualBasic.Core.Extensions.SonarAnalysisContextExtensions;\n\nnamespace SonarAnalyzer.Test.AnalysisContext;\n\npublic partial class SonarAnalysisContextTest\n{\n    private const string SnippetFileName = \"snippet0.cs\";\n    private const string AnotherFileName = \"Any other file name to make snippet0 considered as changed.cs\";\n\n    private static readonly ImmutableArray<DiagnosticDescriptor> DummyMainDescriptor = new[] { AnalysisScaffolding.CreateDescriptorMain() }.ToImmutableArray();\n\n    [TestMethod]\n    [DataRow(SnippetFileName, false)]\n    [DataRow(AnotherFileName, true)]\n    public void RegisterNodeAction_UnchangedFiles_SonarAnalysisContext(string unchangedFileName, bool expected)\n    {\n        var context = new DummyAnalysisContext(TestContext, unchangedFileName);\n        var sut = new SonarAnalysisContext(context, DummyMainDescriptor);\n        sut.RegisterNodeAction<SyntaxKind>(CSharpGeneratedCodeRecognizer.Instance, context.DelegateAction);\n\n        context.AssertDelegateInvoked(expected);\n    }\n\n    [TestMethod]\n    [DataRow(\"snippet1.cs\")]\n    [DataRow(\"Other file is unchanged.cs\")]\n    public void RegisterNodeActionInAllFiles_UnchangedFiles_GeneratedFiles_AlwaysRuns(string unchangedFileName) =>\n        new VerifierBuilder<DummyAnalyzerForGenerated>()\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfigWithUnchangedFiles(TestContext, unchangedFileName))\n            .AddSnippet(\"\"\"\n                        // <auto-generated/>\n                        public class Something { } // Noncompliant\n                        \"\"\")\n            .Verify();\n\n    [TestMethod]\n    [DataRow(SnippetFileName, false)]\n    [DataRow(AnotherFileName, true)]\n    public void RegisterTreeAction_UnchangedFiles_SonarAnalysisContext(string unchangedFileName, bool expected)\n    {\n        var context = new DummyAnalysisContext(TestContext, unchangedFileName);\n        var sut = new SonarAnalysisContext(context, DummyMainDescriptor);\n        sut.RegisterTreeAction(CSharpGeneratedCodeRecognizer.Instance, context.DelegateAction);\n\n        context.AssertDelegateInvoked(expected);\n    }\n\n    [TestMethod]\n    [DataRow(\"\", \"\", 0)]\n    [DataRow(\"MainSourceScope\", \"\", 1)]\n    [DataRow(\"MainSourceScope\", \"//<auto-generated />\", 0)]\n    [DataRow(\"TestSourceScope\", \"\", 0)]\n    [DataRow(\"TestSourceScope\", \"//<auto-generated />\", 0)]\n    public async Task RegisterTreeAction_ScopeAndGeneratedCode(string scope, string autogenerated, int expected)\n    {\n        var snippet = new SnippetCompiler($$\"\"\"\n            {{autogenerated}}\n            class C\n            {\n                public void M() => ToString();\n            }\n            \"\"\");\n        var treeContextExecuted = 0;\n        var analyzer = new TestAnalyzerCS(AnalysisScaffolding.CreateDescriptor(\"TEST\", scope), analysisContext =>\n            analysisContext.RegisterTreeAction(CSharpGeneratedCodeRecognizer.Instance, treeContext =>\n            {\n                treeContextExecuted++;\n            }));\n        var compilation = snippet.Compilation.WithAnalyzers([analyzer]);\n        var diagnostics = await compilation.GetAllDiagnosticsAsync();\n        diagnostics.Should().BeEmpty();\n        treeContextExecuted.Should().Be(expected);\n    }\n\n    [TestMethod]\n    [DataRow(\"\", \"\", 0, 0)]\n    [DataRow(\"MainSourceScope\", \"\", 1, 1)]\n    [DataRow(\"MainSourceScope\", \"//<auto-generated />\", 1, 0)]\n    [DataRow(\"TestSourceScope\", \"\", 0, 0)]\n    [DataRow(\"TestSourceScope\", \"//<auto-generated />\", 0, 0)]\n    public async Task RegisterCompilationStartAction_RegisterTreeAction_ScopeAndGeneratedCode(string scope, string autogenerated, int expectedCompilationStartStartExecuted, int expectedTreeContextExecuted)\n    {\n        var snippet = new SnippetCompiler($$\"\"\"\n            {{autogenerated}}\n            class C\n            {\n                public void M() => ToString();\n            }\n            \"\"\");\n        var compilationStartStartExecuted = 0;\n        var treeContextExecuted = 0;\n        var analyzer = new TestAnalyzerCS(AnalysisScaffolding.CreateDescriptor(\"TEST\", scope), analysisContext =>\n            analysisContext.RegisterCompilationStartAction(compilationStartContext =>\n            {\n                compilationStartStartExecuted++;\n                compilationStartContext.RegisterTreeAction(CSharpGeneratedCodeRecognizer.Instance, treeContext =>\n                {\n                    treeContextExecuted++;\n                });\n            }));\n        var compilation = snippet.Compilation.WithAnalyzers([analyzer]);\n        var diagnostics = await compilation.GetAllDiagnosticsAsync();\n        diagnostics.Should().BeEmpty();\n        compilationStartStartExecuted.Should().Be(expectedCompilationStartStartExecuted);\n        treeContextExecuted.Should().Be(expectedTreeContextExecuted);\n    }\n\n    [TestMethod]\n    [DataRow(SnippetFileName, false)]\n    [DataRow(AnotherFileName, true)]\n    public void RegisterSemanticModelAction_UnchangedFiles_SonarAnalysisContext(string unchangedFileName, bool expected)\n    {\n        var context = new DummyAnalysisContext(TestContext, unchangedFileName);\n        var sut = new SonarAnalysisContext(context, DummyMainDescriptor);\n        sut.RegisterSemanticModelAction(CSharpGeneratedCodeRecognizer.Instance, context.DelegateAction);\n\n        context.AssertDelegateInvoked(expected);\n    }\n\n    [TestMethod]\n    public void RegisterSemanticModelAction_Extension_SonarAnalysisContext_CS()\n    {\n        var context = new DummyAnalysisContext(TestContext);\n        var self = new SonarAnalysisContext(context, DummyMainDescriptor);\n        CS.RegisterSemanticModelAction(self, context.DelegateAction);\n\n        context.AssertDelegateInvoked(true);\n    }\n\n    [TestMethod]\n    public void RegisterSemanticModelAction_Extension_SonarAnalysisContext_VB()\n    {\n        var context = new DummyAnalysisContext(TestContext);\n        var self = new SonarAnalysisContext(context, DummyMainDescriptor);\n        VB.RegisterSemanticModelAction(self, context.DelegateAction);\n\n        context.AssertDelegateInvoked(true);\n    }\n\n    [TestMethod]\n    [DataRow(SnippetFileName, false)]\n    [DataRow(AnotherFileName, true)]\n    public void RegisterCodeBlockStartAction_UnchangedFiles_SonarAnalysisContext(string unchangedFileName, bool expected)\n    {\n        var context = new DummyAnalysisContext(TestContext, unchangedFileName);\n        var sut = new SonarAnalysisContext(context, DummyMainDescriptor);\n        sut.RegisterCodeBlockStartAction<SyntaxKind>(CSharpGeneratedCodeRecognizer.Instance, context.DelegateAction);\n\n        context.AssertDelegateInvoked(expected);\n    }\n\n    [TestMethod]\n    public void SonarCompilationStartAnalysisContext_RegisterSemanticModel()\n    {\n        var context = new DummyAnalysisContext(TestContext);\n        var startContext = new DummyCompilationStartAnalysisContext(context);\n        var sut = new SonarCompilationStartAnalysisContext(new(context, DummyMainDescriptor), startContext);\n        sut.RegisterSemanticModelActionInAllFiles(_ => { });\n\n        startContext.AssertExpectedInvocationCounts(expectedSemanticModelCount: 1);\n    }\n\n    [TestMethod]\n    public void SonarCompilationStartAnalysisContext_RegisterCompilationEndAction()\n    {\n        var context = new DummyAnalysisContext(TestContext);\n        var startContext = new DummyCompilationStartAnalysisContext(context);\n        var sut = new SonarCompilationStartAnalysisContext(new(context, DummyMainDescriptor), startContext);\n        sut.RegisterCompilationEndAction(_ => { });\n\n        startContext.AssertExpectedInvocationCounts(expectedCompilationEndCount: 1);\n    }\n\n    [TestMethod]\n    public void SonarCompilationStartAnalysisContext_RegisterSymbolAction()\n    {\n        var context = new DummyAnalysisContext(TestContext);\n        var startContext = new DummyCompilationStartAnalysisContext(context);\n        var sut = new SonarCompilationStartAnalysisContext(new(context, DummyMainDescriptor), startContext);\n        sut.RegisterSymbolAction(_ => { });\n\n        startContext.AssertExpectedInvocationCounts(expectedSymbolCount: 1);\n    }\n\n    [TestMethod]\n    public void SonarCompilationStartAnalysisContext_RegisterNodeAction()\n    {\n        var context = new DummyAnalysisContext(TestContext);\n        var startContext = new DummyCompilationStartAnalysisContext(context);\n        var sut = new SonarCompilationStartAnalysisContext(new(context, DummyMainDescriptor), startContext);\n        sut.RegisterNodeAction<SyntaxKind>(CSharpGeneratedCodeRecognizer.Instance, _ => { });\n\n        startContext.AssertExpectedInvocationCounts(expectedNodeCount: 1);\n    }\n\n    [TestMethod]\n    public void SonarCompilationStartAnalysisContext_RegisterCompilationEnd_ReportsIssue()\n    {\n        var context = new DummyAnalysisContext(TestContext);\n        var startContext = new DummyCompilationStartAnalysisContext(context);\n        var sut = new SonarCompilationStartAnalysisContext(new(context, DummyMainDescriptor), startContext);\n        var diagnostic = Diagnostic.Create(DiagnosticDescriptorFactory.CreateUtility(\"TEST\", \"Test report\"), context.Tree.GetRoot().GetLocation());\n        sut.RegisterCompilationEndAction(x => x.ReportIssue(CSharpGeneratedCodeRecognizer.Instance, diagnostic));\n\n        startContext.RaisedDiagnostic.Should().NotBeNull().And.BeSameAs(diagnostic);\n    }\n\n    [TestMethod]\n    public void SonarCompilationStartAnalysisContext_RegisterSymbol_ReportsIssue()\n    {\n        var context = new DummyAnalysisContext(TestContext);\n        var startContext = new DummyCompilationStartAnalysisContext(context);\n        var sut = new SonarCompilationStartAnalysisContext(new(context, DummyMainDescriptor), startContext);\n        var diagnostic = Diagnostic.Create(DiagnosticDescriptorFactory.CreateUtility(\"TEST\", \"Test report\"), context.Tree.GetRoot().GetLocation());\n        sut.RegisterSymbolAction(x => x.ReportIssue(CSharpGeneratedCodeRecognizer.Instance, diagnostic));\n\n        startContext.RaisedDiagnostic.Should().NotBeNull().And.BeSameAs(diagnostic);\n    }\n\n    [TestMethod]\n    public void SonarCompilationStartAnalysisContext_RegisterSymbolStartAction()\n    {\n        var context = new DummyAnalysisContext(TestContext);\n        var startContext = new DummyCompilationStartAnalysisContext(context);\n        var sut = new SonarCompilationStartAnalysisContext(new(context, DummyMainDescriptor), startContext);\n        var invocationCount = 0;\n        sut.RegisterSymbolStartAction(x =>\n        {\n            x.Cancel.Should().Be(startContext.CancellationToken);\n            x.Compilation.Should().Be(startContext.Compilation);\n            x.Options.Should().Be(startContext.Options);\n            x.Symbol.Should().NotBeNull();\n            invocationCount++;\n        }, SymbolKind.NamedType);\n        startContext.RaisedDiagnostic.Should().BeNull();\n        invocationCount.Should().Be(1);\n    }\n\n    [TestMethod]\n    public void SonarCompilationStartAnalysisContext_RegisterCodeBlockStartAction_RegistrationIsCalled()\n    {\n        var context = new DummyAnalysisContext(TestContext);\n        var startContext = Substitute.For<CompilationStartAnalysisContext>(context.Model.Compilation, context.Options, null);\n        startContext.RegisterCodeBlockStartAction(Arg.Do<Action<CodeBlockStartAnalysisContext<SyntaxKind>>>(x =>\n            x(context.CreateCodeBlockStartAnalysisContext<SyntaxKind>())));\n        var sut = new SonarCompilationStartAnalysisContext(new(context, DummyMainDescriptor), startContext);\n        var diagnostic = Diagnostic.Create(DiagnosticDescriptorFactory.CreateUtility(\"TEST\", \"Test report\"), context.Tree.GetRoot().GetLocation());\n        var registrationCalled = false;\n        sut.RegisterCodeBlockStartAction<SyntaxKind>(CSharpGeneratedCodeRecognizer.Instance, x =>\n        {\n            registrationCalled = true;\n            x.Model.Should().Be(context.Model);\n            x.CodeBlock.Should().Be(context.ClassDeclarationNode);\n            x.OwningSymbol.Should().Be(context.OwningSymbol);\n        });\n\n        registrationCalled.Should().BeTrue();\n    }\n\n    [TestMethod]\n    [DataRow(\"\", \"\", 0, 0)]\n    [DataRow(\"MainSourceScope\", \"\", 1, 1)]\n    [DataRow(\"MainSourceScope\", \"//<auto-generated />\", 1, 0)]\n    [DataRow(\"TestSourceScope\", \"\", 0, 0)]\n    [DataRow(\"TestSourceScope\", \"//<auto-generated />\", 0, 0)]\n    public async Task SonarCompilationStartAnalysisContext_RegisterCodeBlockStart_ScopeAndGeneratedCode(string scope, string autogenerated, int expectedCompilationStartStartExecuted, int expectedCodeBlockStartExecuted)\n    {\n        var snippet = new SnippetCompiler($$\"\"\"\n            {{autogenerated}}\n            class C\n            {\n                public void M() => ToString();\n            }\n            \"\"\");\n        var compilationStartStartExecuted = 0;\n        var codeBlockStartExecuted = 0;\n        var analyzer = new TestAnalyzerCS(AnalysisScaffolding.CreateDescriptor(\"TEST\", scope), analysisContext =>\n            analysisContext.RegisterCompilationStartAction(compilationStartContext =>\n            {\n                compilationStartStartExecuted++;\n                compilationStartContext.RegisterCodeBlockStartAction<SyntaxKind>(CSharpGeneratedCodeRecognizer.Instance, codeBlockStart =>\n                {\n                    codeBlockStartExecuted++;\n                });\n            }));\n        var compilation = snippet.Compilation.WithAnalyzers([analyzer]);\n        var diagnostics = await compilation.GetAllDiagnosticsAsync();\n        diagnostics.Should().BeEmpty();\n        compilationStartStartExecuted.Should().Be(expectedCompilationStartStartExecuted);\n        codeBlockStartExecuted.Should().Be(expectedCodeBlockStartExecuted);\n    }\n\n    [TestMethod]\n    [DataRow(\"\", \"\", 0)]\n    [DataRow(\"MainSourceScope\", \"\", 1)]\n    [DataRow(\"MainSourceScope\", \"//<auto-generated />\", 0)]\n    [DataRow(\"TestSourceScope\", \"\", 0)]\n    [DataRow(\"TestSourceScope\", \"//<auto-generated />\", 0)]\n    public async Task SonarAnalysisContext_RegisterCodeBlockStart_ScopeAndGeneratedCode(string scope, string autogenerated, int expected)\n    {\n        var snippet = new SnippetCompiler($$\"\"\"\n            {{autogenerated}}\n            class C\n            {\n                public void M() => ToString();\n            }\n            \"\"\");\n        var codeBlockStartExecuted = 0;\n        var analyzer = new TestAnalyzerCS(AnalysisScaffolding.CreateDescriptor(\"TEST\", scope), analysisContext =>\n            analysisContext.RegisterCodeBlockStartAction<SyntaxKind>(CSharpGeneratedCodeRecognizer.Instance, codeBlockStart =>\n                {\n                    codeBlockStartExecuted++;\n                }));\n        var compilation = snippet.Compilation.WithAnalyzers([analyzer]);\n        var diagnostics = await compilation.GetAllDiagnosticsAsync();\n        diagnostics.Should().BeEmpty();\n        codeBlockStartExecuted.Should().Be(expected);\n    }\n\n    [TestMethod]\n    [DataRow(\"\", \"\", 0)]\n    [DataRow(\"MainSourceScope\", \"\", 1)]\n    [DataRow(\"MainSourceScope\", \"//<auto-generated />\", 1)]\n    [DataRow(\"TestSourceScope\", \"\", 0)]\n    [DataRow(\"TestSourceScope\", \"//<auto-generated />\", 0)]\n    public async Task SonarCompilationStartAnalysisContext_RegisterSymbolStartAction_ScopeAndGeneratedCode(string scope, string autogenerated, int expected)\n    {\n        var snippet = new SnippetCompiler($$\"\"\"\n            {{autogenerated}}\n            class C\n            {\n                public void M() => ToString();\n            }\n            \"\"\");\n        var symbolStartExecuted = 0;\n        var analyzer = new TestAnalyzerCS(AnalysisScaffolding.CreateDescriptor(\"TEST\", scope), analysisContext =>\n            analysisContext.RegisterCompilationStartAction(compilationStartContext =>\n                compilationStartContext.RegisterSymbolStartAction(symbolStartContext =>\n                {\n                    symbolStartExecuted++;\n                }, SymbolKind.NamedType)));\n        var compilation = snippet.Compilation.WithAnalyzers(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer));\n        var diagnostics = await compilation.GetAllDiagnosticsAsync();\n        diagnostics.Should().BeEmpty();\n        symbolStartExecuted.Should().Be(expected);\n    }\n\n    [TestMethod]\n    [DataRow(\"\", \"\")]\n    [DataRow(\"MainSourceScope\", \"\", \"Node\", \"CodeBlockStart_Node\", \"CodeBlock\", \"CodeBlockStart_End\", \"SymbolEnd\")]\n    [DataRow(\"MainSourceScope\", \"//<auto-generated />\", \"Node\", \"CodeBlockStart_Node\", \"CodeBlock\", \"CodeBlockStart_End\")] // Note: \"SymbolEnd\" is missing here. ReportIssues does not forward the call.\n                                                                                                                           // https://github.com/SonarSource/sonar-dotnet/issues/8876\n    [DataRow(\"TestSourceScope\", \"\")]\n    [DataRow(\"TestSourceScope\", \"//<auto-generated />\")]\n    public async Task SonarCompilationStartAnalysisContext_RegisterSymbolStartAction_RegisterAndReporting_ScopeAndGeneratedCode(\n        string scope, string autogenerated, params string[] expectedDiagnostics)\n    {\n        var snippet = new SnippetCompiler($$\"\"\"\n            {{autogenerated}}\n            class C\n            {\n                public void M() => ToString();\n            }\n            \"\"\");\n        var diagnosticDescriptor = new DiagnosticDescriptor(\"TEST\", \"Title\", \"{0}\", \"Category\", DiagnosticSeverity.Warning, true, customTags: [scope]);\n        var location = Location.Create(snippet.Tree, TextSpan.FromBounds(0, 0));\n        var analyzer = new TestAnalyzerCS(diagnosticDescriptor, analysisContext =>\n            analysisContext.RegisterCompilationStartAction(compilationStartContext =>\n                compilationStartContext.RegisterSymbolStartAction(symbolStartContext =>\n                {\n                    symbolStartContext.RegisterCodeBlockAction(codeBlockContext =>\n                        codeBlockContext.ReportIssue(diagnosticDescriptor, location, \"CodeBlock\"));\n                    symbolStartContext.RegisterCodeBlockStartAction<SyntaxKind>(codeBlockStartContext =>\n                    {\n                        codeBlockStartContext.RegisterNodeAction(nodeContext =>\n                            nodeContext.ReportIssue(diagnosticDescriptor, location, \"CodeBlockStart_Node\"), SyntaxKind.InvocationExpression);\n                        codeBlockStartContext.RegisterCodeBlockEndAction(codeBlockEndContext =>\n                            codeBlockEndContext.ReportIssue(diagnosticDescriptor, location, \"CodeBlockStart_End\"));\n                    });\n                    symbolStartContext.RegisterSymbolEndAction(symbolEndContext =>\n                        symbolEndContext.ReportIssue(CSharpGeneratedCodeRecognizer.Instance, diagnosticDescriptor, location, \"SymbolEnd\"));\n                    symbolStartContext.RegisterSyntaxNodeAction(nodeContext =>\n                        nodeContext.ReportIssue(diagnosticDescriptor, location, \"Node\"), SyntaxKind.InvocationExpression);\n                },\n            SymbolKind.NamedType)));\n        var compilation = snippet.Compilation.WithAnalyzers([analyzer]);\n        var diagnostics = await compilation.GetAllDiagnosticsAsync();\n        diagnostics.Should().HaveCount(expectedDiagnostics.Length);\n        // Ordering is only partially guaranteed and therefore we use BeEquivalentTo https://github.com/dotnet/roslyn/blob/main/docs/analyzers/Analyzer%20Actions%20Semantics.md\n        diagnostics.Select(x => x.GetMessage()).Should().BeEquivalentTo(expectedDiagnostics);\n    }\n\n    [TestMethod]\n    public async Task SonarCompilationStartAnalysisContext_RegisterSymbolStartAction_RegisterOperationAction_NotImplemented()\n    {\n        var snippet = new SnippetCompiler(\"\"\"class C { }\"\"\");\n        var analyzer = new TestAnalyzerCS(AnalysisScaffolding.CreateDescriptorMain(), analysisContext =>\n            analysisContext.RegisterCompilationStartAction(compilationStartContext =>\n                compilationStartContext.RegisterSymbolStartAction(symbolStartContext =>\n                    symbolStartContext.RegisterOperationAction(_ => { }, ImmutableArray.Create(OperationKind.AddressOf)),\n            SymbolKind.NamedType)));\n        var compilation = snippet.Compilation.WithAnalyzers(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer));\n        var diagnostics = await compilation.GetAllDiagnosticsAsync();\n        var ad0001 = diagnostics.Should().ContainSingle().Which;\n        ad0001.Id.Should().Be(\"AD0001\");\n        ad0001.GetMessage().Should().Contain(\"'System.NotImplementedException' with message 'SonarOperationAnalysisContext wrapper type not implemented.'\");\n    }\n\n    [TestMethod]\n    public async Task SonarCompilationStartAnalysisContext_RegisterSymbolStartAction_RegisterOperationBlockAction_NotImplemented()\n    {\n        var snippet = new SnippetCompiler(\"\"\"class C { }\"\"\");\n        var analyzer = new TestAnalyzerCS(AnalysisScaffolding.CreateDescriptorMain(), analysisContext =>\n            analysisContext.RegisterCompilationStartAction(compilationStartContext =>\n                compilationStartContext.RegisterSymbolStartAction(symbolStartContext =>\n                    symbolStartContext.RegisterOperationBlockAction(_ => { }),\n            SymbolKind.NamedType)));\n        var compilation = snippet.Compilation.WithAnalyzers(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer));\n        var diagnostics = await compilation.GetAllDiagnosticsAsync();\n        var ad0001 = diagnostics.Should().ContainSingle().Which;\n        ad0001.Id.Should().Be(\"AD0001\");\n        ad0001.GetMessage().Should().Contain(\"'System.NotImplementedException' with message 'SonarOperationBlockAnalysisContext wrapper type not implemented.'\");\n    }\n\n    [TestMethod]\n    public async Task SonarCompilationStartAnalysisContext_RegisterSymbolStartAction_RegisterOperationBlockStartAction_NotImplemented()\n    {\n        var snippet = new SnippetCompiler(\"\"\"class C { }\"\"\");\n        var analyzer = new TestAnalyzerCS(AnalysisScaffolding.CreateDescriptorMain(), analysisContext =>\n            analysisContext.RegisterCompilationStartAction(compilationStartContext =>\n                compilationStartContext.RegisterSymbolStartAction(symbolStartContext =>\n                    symbolStartContext.RegisterOperationBlockStartAction(_ => { }),\n            SymbolKind.NamedType)));\n        var compilation = snippet.Compilation.WithAnalyzers(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer));\n        var diagnostics = await compilation.GetAllDiagnosticsAsync();\n        var ad0001 = diagnostics.Should().ContainSingle().Which;\n        ad0001.Id.Should().Be(\"AD0001\");\n        ad0001.GetMessage().Should().Contain(\"'System.NotImplementedException' with message 'SonarOperationBlockStartAnalysisContext wrapper type not implemented.'\");\n    }\n\n#if NET\n\n    [TestMethod]\n    [DataRow(\"S109\", \"razor\")]\n    [DataRow(\"S103\", \"razor\")]\n    [DataRow(\"S1192\", \"razor\")]\n    [DataRow(\"S104\", \"razor\")]\n    [DataRow(\"S113\", \"razor\")]\n    [DataRow(\"S1451\", \"razor\")]\n    [DataRow(\"S1147\", \"razor\")]\n    [DataRow(\"S109\", \"cshtml\")]\n    [DataRow(\"S103\", \"cshtml\")]\n    [DataRow(\"S1192\", \"cshtml\")]\n    [DataRow(\"S104\", \"cshtml\")]\n    [DataRow(\"S113\", \"cshtml\")]\n    [DataRow(\"S1451\", \"cshtml\")]\n    [DataRow(\"S1147\", \"cshtml\")]\n    public void DisabledRules_ForRazor_DoNotRaise(string ruleId, string extension) =>\n        new VerifierBuilder()\n            .AddAnalyzer(() => new DummyAnalyzerWithLocation(ruleId, DiagnosticDescriptorFactory.MainSourceScopeTag))\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Product))\n            .AddSnippet(Snippet(extension), $\"SomeFile.{extension}\")\n            .VerifyNoIssues();\n\n    [TestMethod]\n    [DataRow(\"razor\")]\n    [DataRow(\"cshtml\")]\n    public void TestRules_ForRazor_DoNotRaise(string extension) =>\n        new VerifierBuilder()\n            .AddAnalyzer(() => new DummyAnalyzerWithLocation(\"DummyId\", DiagnosticDescriptorFactory.TestSourceScopeTag))\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Test))\n            .AddSnippet(Snippet(extension), $\"SomeFile.{extension}\")\n            .VerifyNoIssues();\n\n    [TestMethod]\n    [DataRow(\"razor\")]\n    [DataRow(\"cshtml\")]\n    public void AllScopedRules_ForRazor_Raise(string extension)\n    {\n        var keyword = extension == \"razor\" ? \"code\" : \"functions\";\n        new VerifierBuilder()\n            .AddAnalyzer(() => new DummyAnalyzerWithLocation(\"DummyId\", DiagnosticDescriptorFactory.TestSourceScopeTag, DiagnosticDescriptorFactory.MainSourceScopeTag))\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Product))\n            .AddSnippet($$\"\"\"\n                        @{{keyword}}\n                        {\n                            private int magicNumber = RaiseHere(); // Noncompliant\n                            private static int RaiseHere()\n                            {\n                                return 42;\n                            }\n                        }\n                        \"\"\",\n                        $\"SomeFile.{extension}\")\n            .Verify();\n    }\n\n    [TestMethod]\n    [DataRow(\"razor\")]\n    [DataRow(\"cshtml\")]\n    public void RaisedIssue_WithinRazorGeneratedCode_ShouldNotBeReported(string extension) =>\n        new VerifierBuilder()\n            .AddAnalyzer(() => new DummyAnalyzerCS())\n            .AddSnippet(@\"<p>Some Html</p>\", $\"SomeFile.{extension}\")\n            .VerifyNoIssues();\n\n    private static string Snippet(string extension)\n    {\n        var keyword = extension == \"razor\" ? \"code\" : \"functions\";\n        return $$\"\"\"\n                @{{keyword}}\n                {\n                    private int magicNumber = RaiseHere();\n                    private static int RaiseHere()\n                    {\n                        return 42;\n                    }\n                }\n                \"\"\";\n    }\n\n#endif\n\n    private static CompilationStartAnalysisContext MockCompilationStartAnalysisContext(DummyAnalysisContext context)\n    {\n        var mock = Substitute.For<CompilationStartAnalysisContext>(context.Model.Compilation, context.Options, CancellationToken.None);\n        mock.When(x => x.RegisterSyntaxNodeAction(Arg.Any<Action<SyntaxNodeAnalysisContext>>(), Arg.Any<ImmutableArray<SyntaxKind>>()))\n            .Do(x => x.Arg<Action<SyntaxNodeAnalysisContext>>()(context.CreateSyntaxNodeAnalysisContext()));    // Invoke to call RegisterSyntaxTreeAction\n        mock.When(x => x.RegisterSyntaxTreeAction(Arg.Any<Action<SyntaxTreeAnalysisContext>>()))\n            .Do(x => x.Arg<Action<SyntaxTreeAnalysisContext>>()(new SyntaxTreeAnalysisContext(context.Tree, context.Options, _ => { }, _ => true, default)));\n        mock.When(x => x.RegisterSemanticModelAction(Arg.Any<Action<SemanticModelAnalysisContext>>()))\n            .Do(x => x.Arg<Action<SemanticModelAnalysisContext>>()(new SemanticModelAnalysisContext(context.Model, context.Options, _ => { }, _ => true, default)));\n        mock.When(x => x.RegisterCodeBlockStartAction(Arg.Any<Action<CodeBlockStartAnalysisContext<SyntaxKind>>>()))\n            .Do(x => x.Arg<Action<CodeBlockStartAnalysisContext<SyntaxKind>>>()(context.CreateCodeBlockStartAnalysisContext<SyntaxKind>()));\n        return mock;\n    }\n\n    private sealed class DummyAnalysisContext : RoslynAnalysisContext\n    {\n        public readonly AnalyzerOptions Options;\n        public readonly SemanticModel Model;\n        public readonly SyntaxTree Tree;\n        private bool delegateWasInvoked;\n\n        public SyntaxNode ClassDeclarationNode => Tree.GetRoot().DescendantNodes().OfType<ClassDeclarationSyntax>().First();\n        public ISymbol OwningSymbol => Model.GetDeclaredSymbol(ClassDeclarationNode);\n\n        public DummyAnalysisContext(TestContext testContext, params string[] unchangedFiles)\n        {\n            Options = AnalysisScaffolding.CreateOptions(AnalysisScaffolding.CreateSonarProjectConfigWithUnchangedFiles(testContext, unchangedFiles));\n            (Tree, Model) = TestCompiler.CompileCS(\"public class Sample { }\");\n        }\n\n        public void DelegateAction<T>(T arg) =>\n            delegateWasInvoked = true;\n\n        public void AssertDelegateInvoked(bool expected, string because = \"\") =>\n            delegateWasInvoked.Should().Be(expected, because);\n\n        public SyntaxNodeAnalysisContext CreateSyntaxNodeAnalysisContext() =>\n            new(Tree.GetRoot(), Model, Options, _ => { }, _ => true, default);\n\n        public SemanticModelAnalysisContext CreateSemanticModelAnalysisContext() =>\n            new(Model, Options, _ => { }, _ => true, default);\n\n        public CodeBlockStartAnalysisContext<TSyntaxKind> CreateCodeBlockStartAnalysisContext<TSyntaxKind>()\n            where TSyntaxKind : struct =>\n            // SyntaxNode codeBlock, ISymbol owningSymbol, SemanticModel semanticModel, AnalyzerOptions options, CancellationToken cancellationToken\n            Substitute.For<CodeBlockStartAnalysisContext<TSyntaxKind>>(ClassDeclarationNode, OwningSymbol, Model, Options, CancellationToken.None);\n\n        public override void RegisterCodeBlockAction(Action<CodeBlockAnalysisContext> action) =>\n            throw new NotImplementedException();\n\n        public override void RegisterCodeBlockStartAction<TLanguageKindEnum>(Action<CodeBlockStartAnalysisContext<TLanguageKindEnum>> action) =>\n            action(new DummyCodeBlockStartAnalysisContext<TLanguageKindEnum>(this));\n\n        public override void RegisterCompilationAction(Action<CompilationAnalysisContext> action) =>\n            throw new NotImplementedException();\n\n        public override void RegisterCompilationStartAction(Action<CompilationStartAnalysisContext> action) =>\n            action(MockCompilationStartAnalysisContext(this));  // Directly invoke to let the inner registrations be added into this.actions\n\n        public override void RegisterSemanticModelAction(Action<SemanticModelAnalysisContext> action) =>\n            action(CreateSemanticModelAnalysisContext());\n\n        public override void RegisterSymbolAction(Action<SymbolAnalysisContext> action, ImmutableArray<SymbolKind> symbolKinds) =>\n            throw new NotImplementedException();\n\n        public override void RegisterSyntaxNodeAction<TLanguageKindEnum>(Action<SyntaxNodeAnalysisContext> action, ImmutableArray<TLanguageKindEnum> syntaxKinds) =>\n            action(CreateSyntaxNodeAnalysisContext());\n\n        public override void RegisterSyntaxTreeAction(Action<SyntaxTreeAnalysisContext> action) =>\n            throw new NotImplementedException();\n    }\n\n    private class DummyCodeBlockStartAnalysisContext<TSyntaxKind> : CodeBlockStartAnalysisContext<TSyntaxKind> where TSyntaxKind : struct\n    {\n        public DummyCodeBlockStartAnalysisContext(DummyAnalysisContext baseContext) : base(baseContext.Tree.GetRoot(), null, baseContext.Model, baseContext.Options, default) { }\n\n        public override void RegisterCodeBlockEndAction(Action<CodeBlockAnalysisContext> action) =>\n            throw new NotImplementedException();\n\n        public override void RegisterSyntaxNodeAction(Action<SyntaxNodeAnalysisContext> action, ImmutableArray<TSyntaxKind> syntaxKinds) =>\n            throw new NotImplementedException();\n    }\n\n    private class DummyCompilationStartAnalysisContext : CompilationStartAnalysisContext\n    {\n        private readonly DummyAnalysisContext context;\n        private int compilationEndCount;\n        private int semanticModelCount;\n        private int symbolCount;\n        private int nodeCount;\n\n        public Diagnostic RaisedDiagnostic { get; private set; }\n\n        public DummyCompilationStartAnalysisContext(DummyAnalysisContext context) : base(context.Model.Compilation, context.Options, default) =>\n            this.context = context;\n\n        public void AssertExpectedInvocationCounts(int expectedCompilationEndCount = 0, int expectedSemanticModelCount = 0, int expectedSymbolCount = 0, int expectedNodeCount = 0)\n        {\n            compilationEndCount.Should().Be(expectedCompilationEndCount);\n            semanticModelCount.Should().Be(expectedSemanticModelCount);\n            symbolCount.Should().Be(expectedSymbolCount);\n            nodeCount.Should().Be(expectedNodeCount);\n        }\n\n        public override void RegisterCodeBlockAction(Action<CodeBlockAnalysisContext> action) =>\n            throw new NotImplementedException();\n\n        public override void RegisterCodeBlockStartAction<TLanguageKindEnum>(Action<CodeBlockStartAnalysisContext<TLanguageKindEnum>> action) =>\n            action(context.CreateCodeBlockStartAnalysisContext<TLanguageKindEnum>());\n\n        public override void RegisterCompilationEndAction(Action<CompilationAnalysisContext> action)\n        {\n            compilationEndCount++;\n            action(new CompilationAnalysisContext(context.Model.Compilation, context.Options, reportDiagnostic: x => RaisedDiagnostic = x, isSupportedDiagnostic: _ => true, default));\n        }\n\n        public override void RegisterSemanticModelAction(Action<SemanticModelAnalysisContext> action)\n        {\n            semanticModelCount++;\n            action(new SemanticModelAnalysisContext(context.Model, context.Options, reportDiagnostic: x => RaisedDiagnostic = x, isSupportedDiagnostic: _ => true, default));\n        }\n\n        public override void RegisterSymbolAction(Action<SymbolAnalysisContext> action, ImmutableArray<SymbolKind> symbolKinds)\n        {\n            symbolCount++;\n            action(new SymbolAnalysisContext(Substitute.For<ISymbol>(), context.Model.Compilation, context.Options, x => RaisedDiagnostic = x, _ => true, default));\n        }\n\n        public override void RegisterSyntaxNodeAction<TLanguageKindEnum>(Action<SyntaxNodeAnalysisContext> action, ImmutableArray<TLanguageKindEnum> syntaxKinds) =>\n            nodeCount++;\n\n        public override void RegisterSyntaxTreeAction(Action<SyntaxTreeAnalysisContext> action) =>\n            throw new NotImplementedException();\n\n        public override void RegisterSymbolStartAction(Action<SymbolStartAnalysisContext> action, SymbolKind symbolKind)\n        {\n            var symbolStartAnalysisContext = Substitute.For<SymbolStartAnalysisContext>(Substitute.For<ISymbol>(), context.Model.Compilation, context.Options, default);\n            action(symbolStartAnalysisContext);\n        }\n    }\n\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    private class DummyAnalyzerForGenerated : SonarDiagnosticAnalyzer\n    {\n        private readonly DiagnosticDescriptor rule = AnalysisScaffolding.CreateDescriptorMain();\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeActionInAllFiles(c => c.ReportIssue(rule, c.Node), SyntaxKind.ClassDeclaration);\n    }\n\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    private sealed class TestAnalyzerCS(DiagnosticDescriptor rule, Action<SonarAnalysisContext> register) : SonarDiagnosticAnalyzer\n    {\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            register(context);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/AnalysisContext/SonarAnalysisContextTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\nusing SonarAnalyzer.Core.AnalysisContext;\nusing SonarAnalyzer.CSharp.Core.Syntax.Utilities;\nusing SonarAnalyzer.CSharp.Rules;\nusing SonarAnalyzer.Test.Rules;\n\nnamespace SonarAnalyzer.Test.AnalysisContext;\n\n[TestClass]\npublic partial class SonarAnalysisContextTest\n{\n    // Various classes that invoke all the `ReportIssue` methods in AnalysisContextExtensions\n    // We mention in comments the type of Context that is used to invoke (directly or indirectly) the `ReportIssue` method\n    private readonly List<TestSetup> testCases =\n        [\n            // SyntaxNodeAnalysisContext\n            // S3244 - MAIN and TEST\n            new TestSetup(\"AnonymousDelegateEventUnsubscribe.cs\", new AnonymousDelegateEventUnsubscribe()),\n            // S2699 - TEST only\n            new TestSetup(\n                \"TestMethodShouldContainAssertion.NUnit.cs\",\n                new TestMethodShouldContainAssertion(),\n                // Breaking changes in NUnit 4.0 would fail the test https://github.com/SonarSource/sonar-dotnet/issues/8409\n                TestMethodShouldContainAssertionTest.WithTestReferences(NuGetMetadataReference.NUnit(\"3.14.0\")).References),    // ToDo: Reuse the entire builder in TestSetup\n\n            // SyntaxTreeAnalysisContext\n            // S3244 - MAIN and TEST\n            new TestSetup(\"AsyncAwaitIdentifier.cs\", new AsyncAwaitIdentifier()),\n\n            // CompilationAnalysisContext\n            // S3244 - MAIN and TEST\n            new TestSetup(\n                @\"Hotspots\\RequestsWithExcessiveLength.cs\",\n                new RequestsWithExcessiveLength(AnalyzerConfiguration.AlwaysEnabled),\n                RequestsWithExcessiveLengthTest.GetAdditionalReferences()),\n\n            // CodeBlockAnalysisContext\n            // S5693 - MAIN and TEST\n            new TestSetup(\"GetHashCodeEqualsOverride.cs\", new GetHashCodeEqualsOverride()),\n\n            // SymbolAnalysisContext\n            // S2953 - MAIN only\n            new TestSetup(\"DisposeNotImplementingDispose.cs\", new DisposeNotImplementingDispose()),\n            // S1694 - MAIN only\n            new TestSetup(\"AbstractClassToInterface.cs\", new AbstractClassToInterface()),\n        ];\n\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    public void Constructor_Null() =>\n        ((Func<SonarAnalysisContext>)(() => new(null, default))).Should().Throw<ArgumentNullException>().And.ParamName.Should().Be(\"analysisContext\");\n\n    [TestMethod]\n    public void WhenShouldAnalysisBeDisabledReturnsTrue_NoIssueReported()\n    {\n        SonarAnalysisContext.ShouldExecuteRegisteredAction = (_, _) => false;\n        try\n        {\n            foreach (var testCase in testCases)\n            {\n                // ToDo: We should find a way to ack the fact the action was not run\n                testCase.Builder\n                    .WithOptions(LanguageOptions.FromCSharp8)\n                    .VerifyNoIssuesIgnoreErrors();\n            }\n        }\n        finally\n        {\n            SonarAnalysisContext.ShouldExecuteRegisteredAction = null;\n        }\n    }\n\n    [TestMethod]\n    public void ByDefault_ExecuteRule()\n    {\n        foreach (var testCase in testCases)\n        {\n            // ToDo: We test that a rule is enabled only by checking the issues are reported\n            testCase.Builder\n                .WithOptions(LanguageOptions.FromCSharp8)\n                .Verify();\n        }\n    }\n\n    [TestMethod]\n    public void WhenProjectType_IsTest_RunRulesWithTestScope_SonarLint()\n    {\n        var sonarProjectConfig = AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Test, false);\n        foreach (var testCase in testCases)\n        {\n            var hasTestScope = testCase.Analyzer.SupportedDiagnostics.Any(x => x.CustomTags.Contains(DiagnosticDescriptorFactory.TestSourceScopeTag));\n            if (hasTestScope)\n            {\n                testCase.Builder\n                    .WithOptions(LanguageOptions.FromCSharp8)\n                    .WithAdditionalFilePath(sonarProjectConfig)\n                    .Verify();\n            }\n            else\n            {\n                // MAIN-only\n                testCase.Builder\n                    .WithOptions(LanguageOptions.FromCSharp8)\n                    .WithAdditionalFilePath(sonarProjectConfig)\n                    .VerifyNoIssuesIgnoreErrors();\n            }\n        }\n    }\n\n    [TestMethod]\n    public void WhenProjectType_IsTest_RunRulesWithTestScope_Scanner()\n    {\n        var sonarProjectConfig = AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Test);\n        foreach (var testCase in testCases)\n        {\n            var hasProductScope = testCase.Analyzer.SupportedDiagnostics.Any(x => x.CustomTags.Contains(DiagnosticDescriptorFactory.MainSourceScopeTag));\n            if (hasProductScope)\n            {\n                // MAIN-only and MAIN & TEST rules\n                testCase.Builder\n                    .WithOptions(LanguageOptions.FromCSharp8)\n                    .WithAdditionalFilePath(sonarProjectConfig)\n                    .VerifyNoIssuesIgnoreErrors();\n            }\n            else\n            {\n                testCase.Builder\n                    .WithOptions(LanguageOptions.FromCSharp8)\n                    .WithAdditionalFilePath(sonarProjectConfig)\n                    .Verify();\n            }\n        }\n    }\n\n    [TestMethod]\n    public void WhenProjectType_IsTest_RunRulesWithMainScope()\n    {\n        var sonarProjectConfig = AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Product);\n        foreach (var testCase in testCases)\n        {\n            var hasProductScope = testCase.Analyzer.SupportedDiagnostics.Any(d => d.CustomTags.Contains(DiagnosticDescriptorFactory.MainSourceScopeTag));\n            if (hasProductScope)\n            {\n                testCase.Builder\n                    .WithOptions(LanguageOptions.FromCSharp8)\n                    .WithAdditionalFilePath(sonarProjectConfig)\n                    .Verify();\n            }\n            else\n            {\n                // TEST-only rule\n                testCase.Builder\n                    .WithOptions(LanguageOptions.FromCSharp8)\n                    .WithAdditionalFilePath(sonarProjectConfig)\n                    .VerifyNoIssues();\n            }\n        }\n    }\n\n    [TestMethod]\n    public void WhenAnalysisDisabledBaseOnSyntaxTree_ReportIssuesForEnabledRules()\n    {\n        testCases.Should().HaveCountGreaterThan(2);\n\n        try\n        {\n            var testCase = testCases[0];\n            var testCase2 = testCases[2];\n            SonarAnalysisContext.ShouldExecuteRegisteredAction = (diags, tree) => tree.FilePath.EndsWith(new FileInfo(testCase.Path).Name, StringComparison.OrdinalIgnoreCase);\n            testCase.Builder.WithConcurrentAnalysis(false).Verify();\n            testCase2.Builder.VerifyNoIssues();\n        }\n        finally\n        {\n            SonarAnalysisContext.ShouldExecuteRegisteredAction = null;\n        }\n    }\n\n    [TestMethod]\n    public void WhenReportDiagnosticActionNotNull_AllowToControlWhetherOrNotToReport()\n    {\n        try\n        {\n            SonarAnalysisContext.ReportDiagnostic = context =>\n            {\n                // special logic for rules with SyntaxNodeAnalysisContext\n                if (context.Diagnostic.Id != AnonymousDelegateEventUnsubscribe.DiagnosticId && context.Diagnostic.Id != TestMethodShouldContainAssertion.DiagnosticId)\n                {\n                    // Verifier expects all diagnostics to increase the counter in order to check that all rules call the\n                    // extension method and not the direct `ReportDiagnostic`.\n                    SuppressionHandler.IncrementReportCount(context.Diagnostic.Id);\n                    context.ReportDiagnostic(context.Diagnostic);\n                }\n            };\n\n            // Because the Verifier sets the SonarAnalysisContext.ShouldDiagnosticBeReported delegate we end up in a case\n            // where the Debug.Assert of the AnalysisContextExtensions.ReportDiagnostic() method will raise.\n            using (new AssertIgnoreScope())\n            {\n                foreach (var testCase in testCases)\n                {\n                    // special logic for rules with SyntaxNodeAnalysisContext\n                    if (testCase.Analyzer is AnonymousDelegateEventUnsubscribe || testCase.Analyzer is TestMethodShouldContainAssertion)\n                    {\n                        testCase.Builder\n                            .WithOptions(LanguageOptions.FromCSharp8)\n                            .VerifyNoIssues();\n                    }\n                    else\n                    {\n                        testCase.Builder\n                            .WithOptions(LanguageOptions.FromCSharp8)\n                            .Verify();\n                    }\n                }\n            }\n        }\n        finally\n        {\n            SonarAnalysisContext.ReportDiagnostic = null;\n        }\n    }\n\n    [TestMethod]\n    [DataRow(ProjectType.Product, false)]\n    [DataRow(ProjectType.Test, true)]\n    public void IsTestProject_Standalone(ProjectType projectType, bool expectedResult)\n    {\n        var compilation = new SnippetCompiler(\"// Nothing to see here\", TestCompiler.ProjectTypeReference(projectType)).Model.Compilation;\n        var context = new CompilationAnalysisContext(compilation, AnalysisScaffolding.CreateOptions(), null, null, default);\n        var sut = new SonarCompilationReportingContext(AnalysisScaffolding.CreateSonarAnalysisContext(), context);\n\n        sut.IsTestProject().Should().Be(expectedResult);\n    }\n\n    [TestMethod]\n    [DataRow(ProjectType.Product, false)]\n    [DataRow(ProjectType.Test, true)]\n    public void IsTestProject_WithConfigFile(ProjectType projectType, bool expectedResult)\n    {\n        var configPath = AnalysisScaffolding.CreateSonarProjectConfig(TestContext, projectType);\n        var context = new CompilationAnalysisContext(null, AnalysisScaffolding.CreateOptions(configPath), null, null, default);\n        var sut = new SonarCompilationReportingContext(AnalysisScaffolding.CreateSonarAnalysisContext(), context);\n\n        sut.IsTestProject().Should().Be(expectedResult);\n    }\n\n    [TestMethod]\n    [DataRow(SnippetFileName, false)]\n    [DataRow(AnotherFileName, true)]\n    public void ReportDiagnosticIfNonGenerated_UnchangedFiles_CompilationAnalysisContext(string unchangedFileName, bool expected)\n    {\n        var context = new DummyAnalysisContext(TestContext, unchangedFileName);\n        var wasReported = false;\n        var location = context.Tree.GetRoot().GetLocation();\n        var symbol = Substitute.For<ISymbol>();\n        symbol.Locations.Returns([location]);\n        var symbolContext = new SymbolAnalysisContext(symbol, context.Model.Compilation, context.Options, _ => wasReported = true, _ => true, default);\n        var sut = new SonarSymbolReportingContext(new SonarAnalysisContext(context, DummyMainDescriptor), symbolContext);\n        sut.ReportIssue(CSharpGeneratedCodeRecognizer.Instance, DummyMainDescriptor[0], location);\n\n        wasReported.Should().Be(expected);\n    }\n\n    private sealed class TestSetup\n    {\n        public string Path { get; }\n        public DiagnosticAnalyzer Analyzer { get; }\n        public VerifierBuilder Builder { get; }\n\n        public TestSetup(string testCase, SonarDiagnosticAnalyzer analyzer) : this(testCase, analyzer, Enumerable.Empty<MetadataReference>()) { }\n\n        public TestSetup(string testCase, SonarDiagnosticAnalyzer analyzer, IEnumerable<MetadataReference> additionalReferences)\n        {\n            Path = testCase;\n            Analyzer = analyzer;\n            additionalReferences = additionalReferences\n                .Concat(MetadataReferenceFacade.SystemComponentModelPrimitives)\n                .Concat(MetadataReferenceFacade.NetStandard)\n                .Concat(MetadataReferenceFacade.SystemData);\n            Builder = new VerifierBuilder().AddAnalyzer(() => analyzer).AddPaths(Path).AddReferences(additionalReferences);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/CFG/CfgSerializer/DotWriterTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CFG.Test;\n\n[TestClass]\npublic class DotWriterTest\n{\n    [TestMethod]\n    public void WriteGraphStart()\n    {\n        var writer = new DotWriter();\n        writer.WriteGraphStart(\"test\");\n        writer.ToString().Should().BeIgnoringLineEndings(\"digraph \\\"test\\\" {\\r\\n\");\n        writer.Invoking(x => x.WriteGraphStart(\"second\")).Should().Throw<InvalidOperationException>();\n    }\n\n    [TestMethod]\n    public void WriteGraphEnd()\n    {\n        var writer = new DotWriter();\n        writer.Invoking(x => x.WriteGraphEnd()).Should().Throw<InvalidOperationException>();\n        writer.WriteGraphStart(\"test\");\n        writer.WriteGraphEnd();\n        writer.ToString().Should().BeIgnoringLineEndings(\"digraph \\\"test\\\" {\\r\\n}\\r\\n\");\n    }\n\n    [TestMethod]\n    public void WriteSubGraphStart()\n    {\n        var writer = new DotWriter();\n        writer.WriteSubGraphStart(42, \"test\");\n        writer.ToString().Should().BeIgnoringLineEndings(\"subgraph \\\"cluster_42\\\" {\\r\\nlabel = \\\"test\\\"\\r\\n\");\n    }\n\n    [TestMethod]\n    public void WriteSubGraphEnd()\n    {\n        var writer = new DotWriter();\n        writer.WriteSubGraphEnd();\n        writer.ToString().Should().BeIgnoringLineEndings(\"}\\r\\n\");\n    }\n\n    [TestMethod]\n    public void WriteNode_WithItems()\n    {\n        var writer = new DotWriter();\n        writer.WriteRecordNode(\"1\", \"header\", \"a\", \"b\", \"c\");\n        writer.ToString().Should().BeIgnoringLineEndings(\"1 [shape=record label=\\\"{header|a|b|c}\\\"]\\r\\n\");\n    }\n\n    [TestMethod]\n    public void WriteNode_WithEncoding()\n    {\n        var writer = new DotWriter();\n        writer.WriteRecordNode(\"1\", \"header\", \"\\r\", \"\\n\", \"{\", \"}\", \"<\", \">\", \"|\", \"\\\"\");\n        writer.ToString().Should().BeIgnoringLineEndings(@\"1 [shape=record label=\"\"{header||\\n|\\{|\\}|\\<|\\>|\\||\\\"\"}\"\"]\" + \"\\r\\n\");\n    }\n\n    [TestMethod]\n    public void WriteNode_NoItems()\n    {\n        var writer = new DotWriter();\n        writer.WriteRecordNode(\"1\", \"header\");\n        writer.ToString().Should().BeIgnoringLineEndings(\"1 [shape=record label=\\\"{header}\\\"]\\r\\n\");\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/CFG/Extensions/IOperationExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Operations;\n\nnamespace SonarAnalyzer.CFG.Extensions.Test;\n\n[TestClass]\npublic class IOperationExtensionsTest\n{\n    [TestMethod]\n    public void DescendantsAndSelf_Null_ReturnsNull() =>\n        IOperationExtensions.DescendantsAndSelf(null).Should().BeEmpty();\n\n    [TestMethod]\n    public void OperationWrapperSonarPropertyShortcuts()\n    {\n        var operation = Operation<VariableDeclarationSyntax>(\"\"\"\n            public class Sample\n            {\n                public void Method()\n                {\n                    var value = 42;\n                }\n            }\n            \"\"\").ToVariableDeclaration();\n        operation.Parent().Should().NotBeNull();\n        operation.Parent().Kind.Should().Be(OperationKind.VariableDeclarationGroup);\n        operation.Children().Should().HaveCount(1);\n        operation.Children().Single().Kind.Should().Be(OperationKind.VariableDeclarator);\n        operation.Language().Should().Be(\"C#\");\n        operation.IsImplicit().Should().Be(false);\n        operation.SemanticModel().Should().Be(operation.SemanticModel());\n    }\n\n    [TestMethod]\n    public void AsForEachLoop_ForEachLoop_ConvertsToWrapper() =>\n        Operation<MethodDeclarationSyntax>(\"\"\"\n            public class Sample\n            {\n                public void Method(int[] items)\n                {\n                    foreach (var item in items)\n                    {\n                        // Do something with item\n                    }\n                }\n            }\n            \"\"\").Descendants().OfType<ILoopOperation>().Single().AsForEachLoop().Should().NotBeNull();\n\n    [TestMethod]\n    [DataRow(\"for (var i = 0; i < 9; i++) { }\")]\n    [DataRow(\"while (true) { }\")]\n    [DataRow(\"do { } while (true);\")]\n    public void AsForEachLoop_OtherLoop_ConvertsToWrapper(string loop) =>\n        Operation<MethodDeclarationSyntax>($$\"\"\"\n            public class Sample\n            {\n                public void Method()\n                {\n                    {{loop}}\n                }\n            }\n            \"\"\").Descendants().OfType<ILoopOperation>().Single().AsForEachLoop().Should().BeNull();\n\n    [TestMethod]\n    public void ExtensionsMethodsUsedByArchitecture()\n    {\n        IOperation operation = null;\n        // These extension methods are used by sonar-architecture. Do not remove them.\n        Assert.Throws<NullReferenceException>(() => operation.AsForEachLoop());\n        Assert.Throws<NullReferenceException>(() => operation.AsVariableDeclarator());\n        operation.ToArrayCreation();\n        operation.ToCatchClause();\n        operation.ToConversion();\n        operation.ToInvocation();\n        operation.ToIsType();\n        operation.ToLocalFunction();\n        operation.ToMemberReference();\n        operation.ToObjectCreation();\n        operation.ToPattern();\n        operation.ToVariableDeclaration();\n        operation.ToVariableDeclarator();\n    }\n\n    private static IOperation Operation<T>(string code) where T : SyntaxNode\n    {\n        var (tree, model) = TestCompiler.CompileCS(code);\n        return model.GetOperation(tree.Single<T>());\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/CFG/Roslyn/BasicBlockTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Operations;\n\nnamespace SonarAnalyzer.CFG.Roslyn.Test;\n\n[TestClass]\npublic class BasicBlockTest\n{\n    [TestMethod]\n    public void Wrap_ReturnsNull() =>\n        BasicBlock.Wrap(null).Should().BeNull();\n\n    [TestMethod]\n    public void ValidateReflection()\n    {\n        const string code = @\"\npublic class Sample\n{\n    int field;\n\n    public void Method(bool condition)\n    {\n        if (condition)\n            field = 42;\n    }\n}\";\n        var cfg = TestCompiler.CompileCfgCS(code);\n        /*\n         *           Entry 0\n         *             |\n         *             |\n         *           Block 1\n         *      BranchValue: condition\n         *           /   \\\n         *     Else /     \\ WhenFalse\n         *         /       \\\n         *     Block 2      |\n         *     field=42     |\n         *        \\        /\n         *         \\      /\n         *          \\    /\n         *           Exit 3\n         */\n        var entry = cfg.EntryBlock;\n        var branch = cfg.Blocks[1];\n        var assign = cfg.Blocks[2];\n        var exit = cfg.ExitBlock;\n\n        entry.Kind.Should().Be(BasicBlockKind.Entry);\n        branch.Kind.Should().Be(BasicBlockKind.Block);\n        assign.Kind.Should().Be(BasicBlockKind.Block);\n        exit.Kind.Should().Be(BasicBlockKind.Exit);\n\n        entry.BranchValue.Should().BeNull();\n        branch.BranchValue.Should().BeAssignableTo<IParameterReferenceOperation>().Subject.Parameter.Name.Should().Be(\"condition\");\n        assign.BranchValue.Should().BeNull();\n        exit.BranchValue.Should().BeNull();\n\n        entry.ConditionalSuccessor.Should().BeNull();\n        branch.ConditionalSuccessor.Should().NotBeNull();\n        assign.ConditionalSuccessor.Should().BeNull();\n        exit.ConditionalSuccessor.Should().BeNull();\n\n        entry.ConditionKind.Should().Be(ControlFlowConditionKind.None);\n        branch.ConditionKind.Should().Be(ControlFlowConditionKind.WhenFalse);\n        assign.ConditionKind.Should().Be(ControlFlowConditionKind.None);\n        exit.ConditionKind.Should().Be(ControlFlowConditionKind.None);\n\n        entry.EnclosingRegion.Should().Be(cfg.Root);\n        branch.EnclosingRegion.Should().Be(cfg.Root);\n        assign.EnclosingRegion.Should().Be(cfg.Root);\n        exit.EnclosingRegion.Should().Be(cfg.Root);\n\n        entry.FallThroughSuccessor.Should().NotBeNull();\n        branch.FallThroughSuccessor.Should().NotBeNull();\n        assign.FallThroughSuccessor.Should().NotBeNull();\n        exit.FallThroughSuccessor.Should().BeNull();\n\n        entry.IsReachable.Should().Be(true);\n        branch.IsReachable.Should().Be(true);\n        assign.IsReachable.Should().Be(true);\n        exit.IsReachable.Should().Be(true);\n\n        entry.Operations.Should().BeEmpty();\n        branch.Operations.Should().BeEmpty();\n        assign.Operations.Should().HaveCount(1).And.Subject.Single().Should().BeAssignableTo<IExpressionStatementOperation>();\n        exit.Operations.Should().BeEmpty();\n\n        entry.OperationsAndBranchValue.Should().BeEmpty();\n        branch.OperationsAndBranchValue.Should().HaveCount(1).And.Subject.Single().Should().BeAssignableTo<IParameterReferenceOperation>();\n        assign.OperationsAndBranchValue.Should().HaveCount(1).And.Subject.Single().Should().BeAssignableTo<IExpressionStatementOperation>();\n        exit.OperationsAndBranchValue.Should().BeEmpty();\n\n        entry.Ordinal.Should().Be(0);\n        branch.Ordinal.Should().Be(1);\n        assign.Ordinal.Should().Be(2);\n        exit.Ordinal.Should().Be(3);\n\n        entry.Predecessors.Should().BeEmpty();\n        branch.Predecessors.Should().HaveCount(1);\n        assign.Predecessors.Should().HaveCount(1);\n        exit.Predecessors.Should().HaveCount(2);\n\n        entry.SuccessorBlocks.Should().HaveCount(1).And.Subject.Single().Should().Be(branch);\n        branch.SuccessorBlocks.Should().HaveCount(2).And.Subject.Should().ContainInOrder(assign, exit);\n        assign.SuccessorBlocks.Should().HaveCount(1).And.Subject.Single().Should().Be(exit);\n        exit.SuccessorBlocks.Should().HaveCount(0);\n    }\n\n    [TestMethod]\n    public void ValidateOperations()\n    {\n        const string code = @\"\npublic class Sample\n{\n    int Pow(int num, int exponent)\n    {\n        num = num * Pow(num, exponent - 1);\n        return 42;\n    }\n}\";\n        var cfg = TestCompiler.CompileCfgCS(code);\n        var entry = cfg.EntryBlock;\n        var body = cfg.Blocks[1];\n        var exit = cfg.ExitBlock;\n        entry.Kind.Should().Be(BasicBlockKind.Entry);\n        entry.Operations.Should().BeEmpty();\n        body.Kind.Should().Be(BasicBlockKind.Block);\n        body.Operations.Should().HaveCount(1).And.Subject.Single().Should().BeAssignableTo<IExpressionStatementOperation>();\n        body.BranchValue.Should().BeAssignableTo<ILiteralOperation>();\n        body.OperationsAndBranchValue.Should().Equal(body.Operations[0], body.BranchValue);\n        exit.Kind.Should().Be(BasicBlockKind.Exit);\n        exit.Operations.Should().BeEmpty();\n    }\n\n    [TestMethod]\n    public void ValidateSwitchExpressionCase()\n    {\n        const string code = @\"\npublic class Sample\n{\n    public int Method(bool condition) =>\n        condition switch\n        {\n            true => 42,\n            _ => 43\n        };\n}\";\n        var cfg = TestCompiler.CompileCfgCS(code);\n        /*\n         *\n         *         Block 1\n         *        true => 42\n         * Else  /          \\    WhenFalse\n         *      /            \\\n         *     /              \\\n         *  Block 2          Block 3\n         *   => 42           _ => 43\n         *    |                |     \\\n         *    |          Else  |      \\    WhenFalse from Block 3 - Block 5 should not be reachable\n         *    |                |       \\\n         *    |              Block 4    Block 5\n         *    |               => 43     no match => throw exception\n         *     \\              /\n         *      \\            /\n         *       \\          /\n         *        \\        /\n         *         \\      /\n         *          Block 6\n         */\n        var block1 = cfg.Blocks[1];\n        var block2 = cfg.Blocks[2];\n        var block3 = cfg.Blocks[3];\n        var block4 = cfg.Blocks[4];\n        var block5 = cfg.Blocks[5];\n        var block6 = cfg.Blocks[6];\n        block1.FallThroughSuccessor.Destination.Should().Be(block2);\n        block1.ConditionalSuccessor.Destination.Should().Be(block3);\n        block1.SuccessorBlocks.Should().ContainInOrder(block2, block3);\n        block2.FallThroughSuccessor.Destination.Should().Be(block6);\n        block2.ConditionalSuccessor.Should().BeNull();\n        block2.SuccessorBlocks.Single().Should().Be(block6);\n        block3.FallThroughSuccessor.Destination.Should().Be(block4);\n        block3.ConditionalSuccessor.Destination.Should().Be(block5);\n        block3.SuccessorBlocks.Single().Should().Be(block4);             // We don't add the unreachable ConditionalSuccessor in this case\n        block6.SuccessorBlocks.Single().Should().Be(cfg.ExitBlock);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/CFG/Roslyn/CaptureIdTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing StyleCop.Analyzers.Lightup;\nusing IFlowCaptureReferenceOperation = Microsoft.CodeAnalysis.FlowAnalysis.IFlowCaptureReferenceOperation;\n\nnamespace SonarAnalyzer.CFG.Roslyn.Test;\n\n[TestClass]\npublic class CaptureIdTest\n{\n    [TestMethod]\n    public void Null_ThrowsException()\n    {\n        Action a = () => new CaptureId(null).ToString();\n        a.Should().Throw<ArgumentNullException>();\n    }\n\n    [TestMethod]\n    public void Equals_ReturnsFalse()\n    {\n        var capture = new CaptureId(new object());\n        capture.Equals(42).Should().BeFalse();\n        capture.Equals(null).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void ValidateReflection()\n    {\n        const string code = @\"\npublic class Sample\n{\n    public string Method(object a, object b) =>\n        a?.ToString() + b?.ToString();\n}\";\n        var cfg = TestCompiler.CompileCfgCS(code);\n        var outerLocalLifetimeRegion = cfg.Root.NestedRegions.Single();\n        outerLocalLifetimeRegion.Kind.Should().Be(ControlFlowRegionKind.LocalLifetime);\n        outerLocalLifetimeRegion.NestedRegions.Should().HaveCount(2).And.OnlyContain(x => x.Kind == ControlFlowRegionKind.LocalLifetime);\n        var nestedRegionA = outerLocalLifetimeRegion.NestedRegions.First();\n        var nestedRegionB = outerLocalLifetimeRegion.NestedRegions.Last();\n        var captureA = FindCapture(nestedRegionA, \"a\");\n        var captureB = FindCapture(nestedRegionB, \"b\");\n        // Assert\n        nestedRegionA.CaptureIds.Should().HaveCount(1).And.Contain(captureA).And.NotContain(captureB);\n        nestedRegionB.CaptureIds.Should().HaveCount(1).And.Contain(captureB).And.NotContain(captureA);\n        nestedRegionA.CaptureIds.Single().GetHashCode().Should().Be(captureA.GetHashCode()).And.NotBe(captureB.GetHashCode());\n        nestedRegionA.CaptureIds.Single().Equals((object)captureA).Should().BeTrue();\n        nestedRegionA.CaptureIds.Single().Equals((object)captureB).Should().BeFalse();\n\n        CaptureId FindCapture(ControlFlowRegion region, string expectedName)\n        {\n            var flowCapture = (IFlowCaptureReferenceOperation)cfg.Blocks[region.FirstBlockOrdinal].BranchValue.ChildOperations.Single();\n            flowCapture.Syntax.ToString().Should().Be(expectedName);\n            return new CaptureId(flowCapture.Id);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/CFG/Roslyn/CfgAllPathValidatorTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CFG.Roslyn.Test;\n\n[TestClass]\npublic class CfgAllPathValidatorTest\n{\n    [TestMethod]\n    public void ValidateCfgPaths()\n    {\n        const string code = @\"\npublic class Sample\n{\n    public int Method2(bool condition)\n    {\n        if (condition)\n            return 42;\n        else\n            return 1;\n    }\n}\";\n        var cfg = TestCompiler.CompileCfgCS(code);\n        /*\n         *           Entry 0\n         *             |\n         *             |\n         *           Block 1\n         *           /   \\\n         *     Else /     \\ WhenFalse\n         *         /       \\\n         *     Block 2    Block 3\n         *        \\        /\n         *         \\      /\n         *          \\    /\n         *           Exit 4\n         */\n        var validator = new TestCfgValidator(cfg, 0, 1, 2);\n        validator.CheckAllPaths().Should().BeTrue();\n\n        // only entry block is valid\n        validator = new TestCfgValidator(cfg, 0);\n        validator.CheckAllPaths().Should().BeTrue();\n\n        // only exit block is valid\n        validator = new TestCfgValidator(cfg, 4);\n        validator.CheckAllPaths().Should().BeFalse();\n\n        var nonEntryBlockValid = new TestNonEntryBlockValidator(cfg);\n        nonEntryBlockValid.CheckAllPaths().Should().BeTrue();\n    }\n\n    // This test fails on the Sonar version of CfgAllPathValidator\n    [TestMethod]\n    public void ValidAfterBranching()\n    {\n        const string code = @\"\npublic class Sample\n{\n    internal string Prop;\n    public void Method(string input)\n    {\n        var x = true && true;\n        Prop = input;\n    }\n}\n\";\n        var cfg = TestCompiler.CompileCfgCS(code);\n        /*\n         *           Entry 0\n         *             |\n         *             |\n         *           Block 1\n         *           /   \\\n         *     Else /     \\ WhenFalse\n         *         /       \\\n         *     Block 2    Block 3\n         *        \\        /\n         *         \\      /\n         *          \\    /\n         *          Block 4\n         *             |\n         *             |\n         *          Block 5\n         *             |\n         *             |\n         *          Exit 6\n         */\n        var validator = new OnlyOneBlockIsValid(cfg, 5);\n        validator.CheckAllPaths().Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void LoopInCfg()\n    {\n        const string code = @\"\npublic class Sample\n{\n    public void Method(string input)\n    {\n        var a = input;\n    A:\n        if (input != \"\"\"\")\n            goto C;\n        else\n            goto B;\n    C:\n        input = System.String.Empty;\n        goto A;\n    B:\n        input = input;\n    }\n}\n\";\n        var cfg = TestCompiler.CompileCfgCS(code);\n        /*\n         *           Entry 0\n         *             |\n         *           Block 1\n         *             |\n         *           Block 2 <----> Block 3\n         *             |\n         *          Block 4\n         *             |\n         *           Exit 5\n         */\n        var validator = new OnlyOneBlockIsValid(cfg, 4);\n        validator.CheckAllPaths().Should().BeTrue();\n    }\n\n    private class TestNonEntryBlockValidator : CfgAllPathValidator\n    {\n        public TestNonEntryBlockValidator(ControlFlowGraph cfg) : base(cfg) { }\n\n        protected override bool IsValid(BasicBlock block) => block.Ordinal > 0;\n\n        protected override bool IsInvalid(BasicBlock block) => false;\n    }\n\n    private class TestCfgValidator : CfgAllPathValidator\n    {\n        private readonly int[] validBlocks;\n\n        public TestCfgValidator(ControlFlowGraph cfg, params int[] validBlocks) : base(cfg) =>\n            this.validBlocks = validBlocks;\n\n        protected override bool IsValid(BasicBlock block) =>\n            validBlocks.Contains(block.Ordinal);\n\n        protected override bool IsInvalid(BasicBlock block) =>\n            !validBlocks.Contains(block.Ordinal);\n    }\n\n    private class OnlyOneBlockIsValid : CfgAllPathValidator\n    {\n        private readonly int validBlock;\n\n        public OnlyOneBlockIsValid(ControlFlowGraph cfg, int validBlock) : base(cfg) =>\n            this.validBlock = validBlock;\n\n        protected override bool IsValid(BasicBlock block) =>\n            validBlock == block.Ordinal;\n\n        protected override bool IsInvalid(BasicBlock block) => false;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/CFG/Roslyn/ControlFlowBranchTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CFG.Roslyn.Test;\n\n[TestClass]\npublic class ControlFlowBranchTest\n{\n    [TestMethod]\n    public void ValidateReflection()\n    {\n        const string code = @\"\npublic class Sample\n{\n    public void Method(bool condition) { } // Empty, just Entry and Exit block\n}\";\n        var cfg = TestCompiler.CompileCfgCS(code);\n        var entry = cfg.EntryBlock;\n        var exit = cfg.ExitBlock;\n\n        var branch = entry.FallThroughSuccessor;\n        branch.Source.Should().Be(entry);\n        branch.Destination.Should().Be(exit);\n        branch.Semantics.Should().Be(ControlFlowBranchSemantics.Regular);\n        branch.IsConditionalSuccessor.Should().Be(false);\n        branch.EnteringRegions.Should().BeEmpty();\n        branch.LeavingRegions.Should().BeEmpty();\n        branch.FinallyRegions.Should().BeEmpty();\n    }\n\n    [TestMethod]\n    public void ValidateReflection_Regions()\n    {\n        const string code = @\"\npublic class Sample\n{\n    int field;\n\n    public void Method(bool condition)\n    {\n        field = 0;\n        try\n        {\n            field = 1;\n        }\n        finally\n        {\n            field = 42;\n        }\n    }\n}\";\n        var cfg = TestCompiler.CompileCfgCS(code);\n        /*\n         *          Entry 0\n         *            |\n         *            V\n         *          Block 1\n         *          field = 0\n         *            |\n         *  +---------+-- TryAndFinally region ------------------------------+\n         *  |         |                                                      |\n         *  |  +--Try-+-region -+  +-- Finally region --------------------+  |\n         *  |  |      |         |  |                                      |  |\n         *  |  |      v         |  |    Block 3                           |  |\n         *  |  |    Block 2     |  |    field = 42                        |  |\n         *  |  |    field = 1   |  |      |                               |  |\n         *  |  |      |         |  |      |  StructuredExceptionHandling  |  |\n         *  |  +------+---------+  |      V                               |  |\n         *  |         |            |    (null)                            |  |\n         *  |         |            |                                      |  |\n         *  |         |            +--------------------------------------+  |\n         *  +---------+------------------------------------------------------+\n         *            |\n         *            v\n         *         Exit 4\n         */\n        var initBlock = cfg.Blocks[1];\n        var tryBlock = cfg.Blocks[2];\n        var finallyBlock = cfg.Blocks[3];\n        var exitBlock = cfg.ExitBlock;\n        initBlock.Kind.Should().Be(BasicBlockKind.Block);\n        tryBlock.Kind.Should().Be(BasicBlockKind.Block);\n        finallyBlock.Kind.Should().Be(BasicBlockKind.Block);\n        exitBlock.Kind.Should().Be(BasicBlockKind.Exit);\n\n        var tryAndFinallyRegion = cfg.Root.NestedRegions.Single(x => x.Kind == ControlFlowRegionKind.TryAndFinally);\n        var tryRegion = tryAndFinallyRegion.NestedRegions.Single(x => x.Kind == ControlFlowRegionKind.Try);\n        var finallyRegion = tryAndFinallyRegion.NestedRegions.Single(x => x.Kind == ControlFlowRegionKind.Finally);\n\n        var entering = initBlock.FallThroughSuccessor;\n        entering.Destination.Should().Be(tryBlock);\n        entering.EnteringRegions.Should().HaveCount(2).And.ContainInOrder(tryAndFinallyRegion, tryRegion);\n        entering.LeavingRegions.Should().BeEmpty();\n        entering.FinallyRegions.Should().BeEmpty();\n\n        var exiting = tryBlock.FallThroughSuccessor;\n        exiting.Destination.Should().Be(exitBlock);\n        exiting.EnteringRegions.Should().BeEmpty();\n        exiting.LeavingRegions.Should().HaveCount(2).And.ContainInOrder(tryRegion, tryAndFinallyRegion);\n        exiting.FinallyRegions.Should().HaveCount(1).And.Contain(finallyRegion);\n\n        var insideFinally = finallyBlock.FallThroughSuccessor;\n        insideFinally.Destination.Should().BeNull();\n        insideFinally.Semantics.Should().Be(ControlFlowBranchSemantics.StructuredExceptionHandling);\n        entering.EnteringRegions.Should().HaveCount(2).And.ContainInOrder(tryAndFinallyRegion, tryRegion); // Weird, but Roslyn does it this way.\n        entering.LeavingRegions.Should().BeEmpty();\n        entering.FinallyRegions.Should().BeEmpty();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/CFG/Roslyn/ControlFlowRegionTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CFG.Roslyn.Test;\n\n[TestClass]\npublic class ControlFlowRegionTest\n{\n    [TestMethod]\n    public void ValidateReflection()\n    {\n        const string code = @\"\npublic class Sample\n{\n    public void Method()\n    {\n        var value = LocalMethod();\n        try\n        {\n           throw new System.Exception();\n        }\n        catch(System.InvalidOperationException)\n        {\n        }\n        finally\n        {\n            value = 0;\n        }\n\n        int LocalMethod() => 42;\n    }\n}\";\n        var root = TestCompiler.CompileCfgCS(code).Root;\n\n        root.Should().NotBeNull();\n        root.Kind.Should().Be(ControlFlowRegionKind.Root);\n        root.EnclosingRegion.Should().BeNull();\n        root.ExceptionType.Should().BeNull();\n        root.FirstBlockOrdinal.Should().Be(0);\n        root.LastBlockOrdinal.Should().Be(5);\n        root.NestedRegions.Should().HaveCount(1);\n        root.Locals.Should().BeEmpty();\n        root.LocalFunctions.Should().BeEmpty();\n        root.CaptureIds.Should().BeEmpty();\n\n        var localLifetime = root.NestedRegions.Single();\n        localLifetime.Kind.Should().Be(ControlFlowRegionKind.LocalLifetime);\n        localLifetime.EnclosingRegion.Should().Be(root);\n        localLifetime.ExceptionType.Should().BeNull();\n        localLifetime.FirstBlockOrdinal.Should().Be(1);\n        localLifetime.LastBlockOrdinal.Should().Be(4);\n        localLifetime.NestedRegions.Should().HaveCount(1);\n        localLifetime.Locals.Should().HaveCount(1).And.Contain(x => x.Name == \"value\");\n        localLifetime.LocalFunctions.Should().HaveCount(1).And.Contain(x => x.Name == \"LocalMethod\");\n        localLifetime.CaptureIds.Should().BeEmpty();\n\n        var tryFinallyRegion = localLifetime.NestedRegions.Single();\n        tryFinallyRegion.Kind.Should().Be(ControlFlowRegionKind.TryAndFinally);\n\n        var tryRegion = tryFinallyRegion.NestedRegions.First();\n        tryRegion.Kind.Should().Be(ControlFlowRegionKind.Try);\n\n        var tryCatchRegion = tryRegion.NestedRegions.First();\n        tryCatchRegion.Kind.Should().Be(ControlFlowRegionKind.TryAndCatch);\n\n        var catchRegion = tryCatchRegion.NestedRegions.Last();\n        catchRegion.Kind.Should().Be(ControlFlowRegionKind.Catch);\n        catchRegion.ExceptionType.Should().NotBeNull();\n        catchRegion.ExceptionType.Name.Should().Be(\"InvalidOperationException\");\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/CFG/Roslyn/RoslynCfgSerializerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CFG.Sonar.Test;\n\n[TestClass]\npublic class RoslynCfgSerializerTest\n{\n    [TestMethod]\n    public void Serialize_MethodNameUsedInTitle()\n    {\n        const string code = \"\"\"\n            class Sample\n            {\n                void Method() { }\n            }\n            \"\"\";\n        var dot = CfgSerializer.Serialize(TestCompiler.CompileCfgCS(code), \"GraphTitle\");\n        dot.Should().BeIgnoringLineEndings(\n            \"\"\"\n            digraph \"GraphTitle\" {\n            cfg0_block0 [shape=record label=\"{ENTRY #0}\"]\n            cfg0_block1 [shape=record label=\"{EXIT #1}\"]\n            cfg0_block0 -> cfg0_block1\n            }\n\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Serialize_EmptyMethod()\n    {\n        const string code = \"\"\"\n            class Sample\n            {\n                void Method() { }\n            }\n            \"\"\";\n        var dot = CfgSerializer.Serialize(TestCompiler.CompileCfgCS(code));\n\n        dot.Should().BeIgnoringLineEndings(\n            \"\"\"\n            digraph \"RoslynCfg\" {\n            cfg0_block0 [shape=record label=\"{ENTRY #0}\"]\n            cfg0_block1 [shape=record label=\"{EXIT #1}\"]\n            cfg0_block0 -> cfg0_block1\n            }\n\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Serialize_OperationSequence()\n    {\n        const string code = \"\"\"\n            class Sample\n            {\n                void Method()\n                {\n                    A();\n                    B();\n                    var c = C();\n                }\n\n                private void A() { }\n                private void B() { }\n                private int C() => 42;\n            }\n            \"\"\";\n        var dot = CfgSerializer.Serialize(TestCompiler.CompileCfgCS(code));\n        dot.Should().BeIgnoringLineEndings(\"\"\"\n            digraph \"RoslynCfg\" {\n            subgraph \"cluster_1\" {\n            label = \"LocalLifetime region, Locals: c\"\n            cfg0_block1 [shape=record label=\"{BLOCK #1|0#: ExpressionStatementOperation: A();|1#: 0#.Operation: InvocationOperation: A: A()|2#: 1#.Instance: InstanceReferenceOperation: A|##########|0#: ExpressionStatementOperation: B();|1#: 0#.Operation: InvocationOperation: B: B()|2#: 1#.Instance: InstanceReferenceOperation: B|##########|0#: SimpleAssignmentOperation: c = C()|1#: 0#.Target: LocalReferenceOperation: c = C()|1#: 0#.Value: InvocationOperation: C: C()|2#: 1#.Instance: InstanceReferenceOperation: C|##########}\"]\n            }\n            cfg0_block0 [shape=record label=\"{ENTRY #0}\"]\n            cfg0_block2 [shape=record label=\"{EXIT #2}\"]\n            cfg0_block0 -> cfg0_block1\n            cfg0_block1 -> cfg0_block2\n            }\n\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Serialize_Switch()\n    {\n        const string code = \"\"\"\n            class Sample\n            {\n                void Foo(int a)\n                {\n                    switch (a)\n                    {\n                        case 1:\n                            c1();\n                            break;\n\n                        case 2:\n                            c2();\n                            break;\n                    }\n                }\n                private void c1() { }\n                private void c2() { }\n            }\n            \"\"\";\n        var dot = CfgSerializer.Serialize(TestCompiler.CompileCfgCS(code));\n        dot.Should().BeIgnoringLineEndings(\"\"\"\n            digraph \"RoslynCfg\" {\n            subgraph \"cluster_1\" {\n            label = \"LocalLifetime region, Captures: #Capture-0\"\n            cfg0_block1 [shape=record label=\"{BLOCK #1|0#: FlowCaptureOperation: #Capture-0: a|1#: 0#.Value: ParameterReferenceOperation: a|##########|## BranchValue ##|0#: BinaryOperation: 1|1#: 0#.LeftOperand: FlowCaptureReferenceOperation: #Capture-0: a|1#: 0#.RightOperand: LiteralOperation: 1|##########}\"]\n            cfg0_block2 [shape=record label=\"{BLOCK #2|0#: ExpressionStatementOperation: c1();|1#: 0#.Operation: InvocationOperation: c1: c1()|2#: 1#.Instance: InstanceReferenceOperation: c1|##########}\"]\n            cfg0_block3 [shape=record label=\"{BLOCK #3|## BranchValue ##|0#: BinaryOperation: 2|1#: 0#.LeftOperand: FlowCaptureReferenceOperation: #Capture-0: a|1#: 0#.RightOperand: LiteralOperation: 2|##########}\"]\n            cfg0_block4 [shape=record label=\"{BLOCK #4|0#: ExpressionStatementOperation: c2();|1#: 0#.Operation: InvocationOperation: c2: c2()|2#: 1#.Instance: InstanceReferenceOperation: c2|##########}\"]\n            }\n            cfg0_block0 [shape=record label=\"{ENTRY #0}\"]\n            cfg0_block5 [shape=record label=\"{EXIT #5}\"]\n            cfg0_block0 -> cfg0_block1\n            cfg0_block1 -> cfg0_block2 [label=\"Else\"]\n            cfg0_block1 -> cfg0_block3 [label=\"WhenFalse\"]\n            cfg0_block3 -> cfg0_block4 [label=\"Else\"]\n            cfg0_block2 -> cfg0_block5\n            cfg0_block3 -> cfg0_block5 [label=\"WhenFalse\"]\n            cfg0_block4 -> cfg0_block5\n            }\n\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Serialize_If()\n    {\n        const string code = \"\"\"\n            class Sample\n            {\n                void Method()\n                {\n                    if (true)\n                    {\n                        Bar();\n                    }\n                }\n                void Bar() { }\n            }\n            \"\"\";\n        var dot = CfgSerializer.Serialize(TestCompiler.CompileCfgCS(code));\n\n        dot.Should().BeIgnoringLineEndings(\"\"\"\n            digraph \"RoslynCfg\" {\n            cfg0_block0 [shape=record label=\"{ENTRY #0}\"]\n            cfg0_block1 [shape=record label=\"{BLOCK #1|## BranchValue ##|0#: LiteralOperation: true|##########}\"]\n            cfg0_block2 [shape=record label=\"{BLOCK #2|0#: ExpressionStatementOperation: Bar();|1#: 0#.Operation: InvocationOperation: Bar: Bar()|2#: 1#.Instance: InstanceReferenceOperation: Bar|##########}\"]\n            cfg0_block3 [shape=record label=\"{EXIT #3}\"]\n            cfg0_block0 -> cfg0_block1\n            cfg0_block1 -> cfg0_block2 [label=\"Else\"]\n            cfg0_block1 -> cfg0_block3 [label=\"WhenFalse\"]\n            cfg0_block2 -> cfg0_block3\n            }\n\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Serialize_Foreach_Simple()\n    {\n        const string code = \"\"\"\n            class Sample\n            {\n                void Method(int[] items)\n                {\n                    foreach (var i in items)\n                    {\n                        Bar(i);\n                    }\n                }\n                private void Bar(int i) { }\n            }\n            \"\"\";\n        var dot = CfgSerializer.Serialize(TestCompiler.CompileCfgCS(code));\n        dot.Should().BeIgnoringLineEndings(\"\"\"\n            digraph \"RoslynCfg\" {\n            subgraph \"cluster_1\" {\n            label = \"LocalLifetime region, Captures: #Capture-0\"\n            subgraph \"cluster_2\" {\n            label = \"TryAndFinally region\"\n            subgraph \"cluster_3\" {\n            label = \"Try region\"\n            subgraph \"cluster_4\" {\n            label = \"LocalLifetime region, Locals: i\"\n            cfg0_block3 [shape=record label=\"{BLOCK #3|0#: SimpleAssignmentOperation: var|1#: 0#.Target: LocalReferenceOperation: var|1#: 0#.Value: ConversionOperation: var|2#: 1#.Operand: PropertyReferenceOperation: var|3#: 2#.Instance: FlowCaptureReferenceOperation: #Capture-0: items|##########|0#: ExpressionStatementOperation: Bar(i);|1#: 0#.Operation: InvocationOperation: Bar: Bar(i)|2#: 1#.Instance: InstanceReferenceOperation: Bar|2#: ArgumentOperation: i|3#: 2#.Value: LocalReferenceOperation: i|##########}\"]\n            }\n            cfg0_block2 [shape=record label=\"{BLOCK #2|## BranchValue ##|0#: InvocationOperation: MoveNext: items|1#: 0#.Instance: FlowCaptureReferenceOperation: #Capture-0: items|##########}\"]\n            }\n            subgraph \"cluster_5\" {\n            label = \"Finally region, Captures: #Capture-1\"\n            cfg0_block4 [shape=record label=\"{BLOCK #4|0#: FlowCaptureOperation: #Capture-1: items|1#: 0#.Value: ConversionOperation: items|2#: 1#.Operand: FlowCaptureReferenceOperation: #Capture-0: items|##########|## BranchValue ##|0#: IsNullOperation: items|1#: 0#.Operand: FlowCaptureReferenceOperation: #Capture-1: items|##########}\"]\n            cfg0_block5 [shape=record label=\"{BLOCK #5|0#: InvocationOperation: Dispose: items|1#: 0#.Instance: FlowCaptureReferenceOperation: #Capture-1: items|##########}\"]\n            cfg0_block6 [shape=record label=\"{BLOCK #6}\"]\n            }\n            }\n            cfg0_block1 [shape=record label=\"{BLOCK #1|0#: FlowCaptureOperation: #Capture-0: items|1#: 0#.Value: InvocationOperation: GetEnumerator: items|2#: 1#.Instance: ConversionOperation: items|3#: 2#.Operand: ParameterReferenceOperation: items|##########}\"]\n            }\n            cfg0_block0 [shape=record label=\"{ENTRY #0}\"]\n            cfg0_block7 [shape=record label=\"{EXIT #7}\"]\n            cfg0_block2 -> cfg0_block3 [label=\"Else\"]\n            cfg0_block1 -> cfg0_block2\n            cfg0_block3 -> cfg0_block2\n            cfg0_block4 -> cfg0_block5 [label=\"Else\"]\n            cfg0_block4 -> cfg0_block6 [label=\"WhenTrue\"]\n            cfg0_block5 -> cfg0_block6\n            cfg0_block6 -> NoDestination_cfg0_block6 [label=\"StructuredExceptionHandling\"]\n            cfg0_block0 -> cfg0_block1\n            cfg0_block2 -> cfg0_block7 [label=\"WhenFalse\"]\n            }\n\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Serialize_Foreach_TupleVarDeclaration()\n    {\n        const string code = \"\"\"\n            public class Sample\n            {\n                public void Method((string key, string value)[] values)\n                {\n                    foreach (var (key, value) in values)\n                    {\n                        string i = key;\n                        string j = value;\n                    }\n                }\n            }\n            \"\"\";\n        var dot = CfgSerializer.Serialize(TestCompiler.CompileCfgCS(code));\n        dot.Should().BeIgnoringLineEndings(\"\"\"\n            digraph \"RoslynCfg\" {\n            subgraph \"cluster_1\" {\n            label = \"LocalLifetime region, Captures: #Capture-0\"\n            subgraph \"cluster_2\" {\n            label = \"TryAndFinally region\"\n            subgraph \"cluster_3\" {\n            label = \"Try region\"\n            subgraph \"cluster_4\" {\n            label = \"LocalLifetime region, Locals: key, value\"\n            subgraph \"cluster_5\" {\n            label = \"LocalLifetime region, Locals: i, j\"\n            cfg0_block4 [shape=record label=\"{BLOCK #4|0#: SimpleAssignmentOperation: i = key|1#: 0#.Target: LocalReferenceOperation: i = key|1#: 0#.Value: LocalReferenceOperation: key|##########|0#: SimpleAssignmentOperation: j = value|1#: 0#.Target: LocalReferenceOperation: j = value|1#: 0#.Value: LocalReferenceOperation: value|##########}\"]\n            }\n            cfg0_block3 [shape=record label=\"{BLOCK #3|0#: DeconstructionAssignmentOperation: var (key, value)|1#: 0#.Target: DeclarationExpressionOperation: var (key, value)|2#: 1#.Expression: TupleOperation: (key, value)|3#: LocalReferenceOperation: key|3#: LocalReferenceOperation: value|1#: 0#.Value: ConversionOperation: var (key, value)|2#: 1#.Operand: PropertyReferenceOperation: var (key, value)|3#: 2#.Instance: FlowCaptureReferenceOperation: #Capture-0: values|##########}\"]\n            }\n            cfg0_block2 [shape=record label=\"{BLOCK #2|## BranchValue ##|0#: InvocationOperation: MoveNext: values|1#: 0#.Instance: FlowCaptureReferenceOperation: #Capture-0: values|##########}\"]\n            }\n            subgraph \"cluster_6\" {\n            label = \"Finally region, Captures: #Capture-1\"\n            cfg0_block5 [shape=record label=\"{BLOCK #5|0#: FlowCaptureOperation: #Capture-1: values|1#: 0#.Value: ConversionOperation: values|2#: 1#.Operand: FlowCaptureReferenceOperation: #Capture-0: values|##########|## BranchValue ##|0#: IsNullOperation: values|1#: 0#.Operand: FlowCaptureReferenceOperation: #Capture-1: values|##########}\"]\n            cfg0_block6 [shape=record label=\"{BLOCK #6|0#: InvocationOperation: Dispose: values|1#: 0#.Instance: FlowCaptureReferenceOperation: #Capture-1: values|##########}\"]\n            cfg0_block7 [shape=record label=\"{BLOCK #7}\"]\n            }\n            }\n            cfg0_block1 [shape=record label=\"{BLOCK #1|0#: FlowCaptureOperation: #Capture-0: values|1#: 0#.Value: InvocationOperation: GetEnumerator: values|2#: 1#.Instance: ConversionOperation: values|3#: 2#.Operand: ParameterReferenceOperation: values|##########}\"]\n            }\n            cfg0_block0 [shape=record label=\"{ENTRY #0}\"]\n            cfg0_block8 [shape=record label=\"{EXIT #8}\"]\n            cfg0_block3 -> cfg0_block4\n            cfg0_block2 -> cfg0_block3 [label=\"Else\"]\n            cfg0_block1 -> cfg0_block2\n            cfg0_block4 -> cfg0_block2\n            cfg0_block5 -> cfg0_block6 [label=\"Else\"]\n            cfg0_block5 -> cfg0_block7 [label=\"WhenTrue\"]\n            cfg0_block6 -> cfg0_block7\n            cfg0_block7 -> NoDestination_cfg0_block7 [label=\"StructuredExceptionHandling\"]\n            cfg0_block0 -> cfg0_block1\n            cfg0_block2 -> cfg0_block8 [label=\"WhenFalse\"]\n            }\n\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Serialize_For()\n    {\n        const string code = \"\"\"\n            class Sample\n            {\n                void Method()\n                {\n                    for (var i = 0; i < 10; i++)\n                    {\n                        Bar(i);\n                    }\n                }\n                private void Bar(int i) { }\n            }\n            \"\"\";\n        var dot = CfgSerializer.Serialize(TestCompiler.CompileCfgCS(code));\n        dot.Should().BeIgnoringLineEndings(\"\"\"\n            digraph \"RoslynCfg\" {\n            subgraph \"cluster_1\" {\n            label = \"LocalLifetime region, Locals: i\"\n            cfg0_block1 [shape=record label=\"{BLOCK #1|0#: SimpleAssignmentOperation: i = 0|1#: 0#.Target: LocalReferenceOperation: i = 0|1#: 0#.Value: LiteralOperation: 0|##########}\"]\n            cfg0_block2 [shape=record label=\"{BLOCK #2|## BranchValue ##|0#: BinaryOperation: i \\< 10|1#: 0#.LeftOperand: LocalReferenceOperation: i|1#: 0#.RightOperand: LiteralOperation: 10|##########}\"]\n            cfg0_block3 [shape=record label=\"{BLOCK #3|0#: ExpressionStatementOperation: Bar(i);|1#: 0#.Operation: InvocationOperation: Bar: Bar(i)|2#: 1#.Instance: InstanceReferenceOperation: Bar|2#: ArgumentOperation: i|3#: 2#.Value: LocalReferenceOperation: i|##########|0#: ExpressionStatementOperation: i++|1#: 0#.Operation: IncrementOrDecrementOperation: i++|2#: 1#.Target: LocalReferenceOperation: i|##########}\"]\n            }\n            cfg0_block0 [shape=record label=\"{ENTRY #0}\"]\n            cfg0_block4 [shape=record label=\"{EXIT #4}\"]\n            cfg0_block0 -> cfg0_block1\n            cfg0_block1 -> cfg0_block2\n            cfg0_block3 -> cfg0_block2\n            cfg0_block2 -> cfg0_block3 [label=\"Else\"]\n            cfg0_block2 -> cfg0_block4 [label=\"WhenFalse\"]\n            }\n\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Serialize_Using()\n    {\n        const string code = \"\"\"\n            class Sample\n            {\n                void Method()\n                {\n                    using (var x = new System.IO.MemoryStream())\n                    {\n                        Bar();\n                    }\n                }\n                private void Bar() { }\n            }\n            \"\"\";\n        var dot = CfgSerializer.Serialize(TestCompiler.CompileCfgCS(code));\n        dot.Should().BeIgnoringLineEndings(\"\"\"\n            digraph \"RoslynCfg\" {\n            subgraph \"cluster_1\" {\n            label = \"LocalLifetime region, Locals: x\"\n            subgraph \"cluster_2\" {\n            label = \"TryAndFinally region\"\n            subgraph \"cluster_3\" {\n            label = \"Try region\"\n            cfg0_block2 [shape=record label=\"{BLOCK #2|0#: ExpressionStatementOperation: Bar();|1#: 0#.Operation: InvocationOperation: Bar: Bar()|2#: 1#.Instance: InstanceReferenceOperation: Bar|##########}\"]\n            }\n            subgraph \"cluster_4\" {\n            label = \"Finally region\"\n            cfg0_block3 [shape=record label=\"{BLOCK #3|## BranchValue ##|0#: IsNullOperation: x = new System.IO.MemoryStream()|1#: 0#.Operand: LocalReferenceOperation: x = new System.IO.MemoryStream()|##########}\"]\n            cfg0_block4 [shape=record label=\"{BLOCK #4|0#: InvocationOperation: Dispose: x = new System.IO.MemoryStream()|1#: 0#.Instance: ConversionOperation: x = new System.IO.MemoryStream()|2#: 1#.Operand: LocalReferenceOperation: x = new System.IO.MemoryStream()|##########}\"]\n            cfg0_block5 [shape=record label=\"{BLOCK #5}\"]\n            }\n            }\n            cfg0_block1 [shape=record label=\"{BLOCK #1|0#: SimpleAssignmentOperation: x = new System.IO.MemoryStream()|1#: 0#.Target: LocalReferenceOperation: x = new System.IO.MemoryStream()|1#: 0#.Value: ObjectCreationOperation: new System.IO.MemoryStream()|##########}\"]\n            }\n            cfg0_block0 [shape=record label=\"{ENTRY #0}\"]\n            cfg0_block6 [shape=record label=\"{EXIT #6}\"]\n            cfg0_block1 -> cfg0_block2\n            cfg0_block3 -> cfg0_block4 [label=\"Else\"]\n            cfg0_block3 -> cfg0_block5 [label=\"WhenTrue\"]\n            cfg0_block4 -> cfg0_block5\n            cfg0_block5 -> NoDestination_cfg0_block5 [label=\"StructuredExceptionHandling\"]\n            cfg0_block0 -> cfg0_block1\n            cfg0_block2 -> cfg0_block6\n            }\n\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Serialize_Lock()\n    {\n        const string code = \"\"\"\n            class Sample\n            {\n                object x;\n\n                void Method()\n                {\n                    lock (x)\n                    {\n                    Bar();\n                    }\n                }\n                private void Bar() { }\n            }\n            \"\"\";\n        var dot = CfgSerializer.Serialize(TestCompiler.CompileCfgCS(code));\n        dot.Should().BeIgnoringLineEndings(\"\"\"\n            digraph \"RoslynCfg\" {\n            subgraph \"cluster_1\" {\n            label = \"LocalLifetime region, Locals: N/A, Captures: #Capture-0\"\n            subgraph \"cluster_2\" {\n            label = \"TryAndFinally region\"\n            subgraph \"cluster_3\" {\n            label = \"Try region\"\n            cfg0_block2 [shape=record label=\"{BLOCK #2|0#: InvocationOperation: Enter: x|1#: ArgumentOperation: x|2#: 1#.Value: FlowCaptureReferenceOperation: #Capture-0: x|1#: ArgumentOperation: x|2#: 1#.Value: LocalReferenceOperation: x|##########|0#: ExpressionStatementOperation: Bar();|1#: 0#.Operation: InvocationOperation: Bar: Bar()|2#: 1#.Instance: InstanceReferenceOperation: Bar|##########}\"]\n            }\n            subgraph \"cluster_4\" {\n            label = \"Finally region\"\n            cfg0_block3 [shape=record label=\"{BLOCK #3|## BranchValue ##|0#: LocalReferenceOperation: x|##########}\"]\n            cfg0_block4 [shape=record label=\"{BLOCK #4|0#: InvocationOperation: Exit: x|1#: ArgumentOperation: x|2#: 1#.Value: FlowCaptureReferenceOperation: #Capture-0: x|##########}\"]\n            cfg0_block5 [shape=record label=\"{BLOCK #5}\"]\n            }\n            }\n            cfg0_block1 [shape=record label=\"{BLOCK #1|0#: FlowCaptureOperation: #Capture-0: x|1#: 0#.Value: FieldReferenceOperation: x|2#: 1#.Instance: InstanceReferenceOperation: x|##########}\"]\n            }\n            cfg0_block0 [shape=record label=\"{ENTRY #0}\"]\n            cfg0_block6 [shape=record label=\"{EXIT #6}\"]\n            cfg0_block1 -> cfg0_block2\n            cfg0_block3 -> cfg0_block4 [label=\"Else\"]\n            cfg0_block3 -> cfg0_block5 [label=\"WhenFalse\"]\n            cfg0_block4 -> cfg0_block5\n            cfg0_block5 -> NoDestination_cfg0_block5 [label=\"StructuredExceptionHandling\"]\n            cfg0_block0 -> cfg0_block1\n            cfg0_block2 -> cfg0_block6\n            }\n\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Serialize_Regions()\n    {\n        const string code = \"\"\"\n            class Sample\n            {\n                void Method()\n                {\n                    Before();\n                    try\n                    {\n                        InTry();\n                    }\n                    finally\n                    {\n                        InFinally();\n                    }\n                    After();\n                }\n                private void Before() { }\n                private void InTry() { }\n                private void InFinally() { }\n                private void After() { }\n            }\n            \"\"\";\n        var dot = CfgSerializer.Serialize(TestCompiler.CompileCfgCS(code));\n        dot.Should().BeIgnoringLineEndings(\"\"\"\n            digraph \"RoslynCfg\" {\n            subgraph \"cluster_1\" {\n            label = \"TryAndFinally region\"\n            subgraph \"cluster_2\" {\n            label = \"Try region\"\n            cfg0_block2 [shape=record label=\"{BLOCK #2|0#: ExpressionStatementOperation: InTry();|1#: 0#.Operation: InvocationOperation: InTry: InTry()|2#: 1#.Instance: InstanceReferenceOperation: InTry|##########}\"]\n            }\n            subgraph \"cluster_3\" {\n            label = \"Finally region\"\n            cfg0_block3 [shape=record label=\"{BLOCK #3|0#: ExpressionStatementOperation: InFinally();|1#: 0#.Operation: InvocationOperation: InFinally: InFinally()|2#: 1#.Instance: InstanceReferenceOperation: InFinally|##########}\"]\n            }\n            }\n            cfg0_block0 [shape=record label=\"{ENTRY #0}\"]\n            cfg0_block1 [shape=record label=\"{BLOCK #1|0#: ExpressionStatementOperation: Before();|1#: 0#.Operation: InvocationOperation: Before: Before()|2#: 1#.Instance: InstanceReferenceOperation: Before|##########}\"]\n            cfg0_block4 [shape=record label=\"{BLOCK #4|0#: ExpressionStatementOperation: After();|1#: 0#.Operation: InvocationOperation: After: After()|2#: 1#.Instance: InstanceReferenceOperation: After|##########}\"]\n            cfg0_block5 [shape=record label=\"{EXIT #5}\"]\n            cfg0_block1 -> cfg0_block2\n            cfg0_block3 -> NoDestination_cfg0_block3 [label=\"StructuredExceptionHandling\"]\n            cfg0_block0 -> cfg0_block1\n            cfg0_block2 -> cfg0_block4\n            cfg0_block4 -> cfg0_block5\n            }\n\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Serialize_Region_ExceptionType()\n    {\n        const string code = \"\"\"\n            class Sample\n            {\n               void Method()\n               {\n                   try { }\n                   catch(System.InvalidOperationException ex) { }\n               }\n            }\n            \"\"\";\n        var dot = CfgSerializer.Serialize(TestCompiler.CompileCfgCS(code));\n        dot.Should().BeIgnoringLineEndings(\"\"\"\n            digraph \"RoslynCfg\" {\n            subgraph \"cluster_1\" {\n            label = \"TryAndCatch region\"\n            subgraph \"cluster_2\" {\n            label = \"Try region\"\n            cfg0_block1 [shape=record label=\"{BLOCK #1}\"]\n            }\n            subgraph \"cluster_3\" {\n            label = \"Catch region: System.InvalidOperationException, Locals: ex\"\n            cfg0_block2 [shape=record label=\"{BLOCK #2|0#: SimpleAssignmentOperation: (System.InvalidOperationException ex)|1#: 0#.Target: LocalReferenceOperation: (System.InvalidOperationException ex)|1#: 0#.Value: CaughtExceptionOperation: (System.InvalidOperationException ex)|##########}\"]\n            }\n            }\n            cfg0_block0 [shape=record label=\"{ENTRY #0}\"]\n            cfg0_block3 [shape=record label=\"{EXIT #3}\"]\n            cfg0_block0 -> cfg0_block1\n            cfg0_block1 -> cfg0_block3\n            cfg0_block2 -> cfg0_block3\n            }\n\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Serialize_LocalFunctions()\n    {\n        const string code = \"\"\"\n            class Sample\n            {\n               void Method()\n               {\n                   var fourty = 40;\n                   Local();\n\n                   int Local() => fourty + LocalStatic();\n\n                   static int LocalStatic() => LocalStaticArg(1);\n                   static int LocalStaticArg(int one) => one + 1; // Overloaded\n               }\n            }\n            \"\"\";\n        var dot = CfgSerializer.Serialize(TestCompiler.CompileCfgCS(code));\n        dot.Should().BeIgnoringLineEndings(\"\"\"\n            digraph \"RoslynCfg\" {\n            subgraph \"cluster_1\" {\n            label = \"LocalLifetime region, Locals: fourty\"\n            cfg0_block1 [shape=record label=\"{BLOCK #1|0#: SimpleAssignmentOperation: fourty = 40|1#: 0#.Target: LocalReferenceOperation: fourty = 40|1#: 0#.Value: LiteralOperation: 40|##########|0#: ExpressionStatementOperation: Local();|1#: 0#.Operation: InvocationOperation: Local: Local()|##########}\"]\n            }\n            cfg0_block0 [shape=record label=\"{ENTRY #0}\"]\n            cfg0_block2 [shape=record label=\"{EXIT #2}\"]\n            subgraph \"cluster_3\" {\n            label = \"RoslynCfg.Local\"\n            cfg2_block0 [shape=record label=\"{ENTRY #0}\"]\n            cfg2_block1 [shape=record label=\"{BLOCK #1|## BranchValue ##|0#: BinaryOperation: fourty + LocalStatic()|1#: 0#.LeftOperand: LocalReferenceOperation: fourty|1#: 0#.RightOperand: InvocationOperation: LocalStatic: LocalStatic()|##########}\"]\n            cfg2_block2 [shape=record label=\"{EXIT #2}\"]\n            }\n            subgraph \"cluster_5\" {\n            label = \"RoslynCfg.LocalStatic\"\n            cfg4_block0 [shape=record label=\"{ENTRY #0}\"]\n            cfg4_block1 [shape=record label=\"{BLOCK #1|## BranchValue ##|0#: InvocationOperation: LocalStaticArg: LocalStaticArg(1)|1#: ArgumentOperation: 1|2#: 1#.Value: LiteralOperation: 1|##########}\"]\n            cfg4_block2 [shape=record label=\"{EXIT #2}\"]\n            }\n            subgraph \"cluster_7\" {\n            label = \"RoslynCfg.LocalStaticArg\"\n            cfg6_block0 [shape=record label=\"{ENTRY #0}\"]\n            cfg6_block1 [shape=record label=\"{BLOCK #1|## BranchValue ##|0#: BinaryOperation: one + 1|1#: 0#.LeftOperand: ParameterReferenceOperation: one|1#: 0#.RightOperand: LiteralOperation: 1|##########}\"]\n            cfg6_block2 [shape=record label=\"{EXIT #2}\"]\n            }\n            cfg0_block0 -> cfg0_block1\n            cfg0_block1 -> cfg0_block2\n            cfg2_block0 -> cfg2_block1\n            cfg2_block1 -> cfg2_block2 [label=\"Return\"]\n            cfg4_block0 -> cfg4_block1\n            cfg4_block1 -> cfg4_block2 [label=\"Return\"]\n            cfg6_block0 -> cfg6_block1\n            cfg6_block1 -> cfg6_block2 [label=\"Return\"]\n            }\n\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Serialize_Lambdas()\n    {\n        const string code = \"\"\"\n            class Sample\n            {\n                void Method(int arg)\n                {\n                    Bar(x => { return arg + 1; });\n                    Bar(x => arg - 1);\n                }\n                private void Bar(System.Func<int, int> f) { }\n            }\n            \"\"\";\n        var dot = CfgSerializer.Serialize(TestCompiler.CompileCfgCS(code));\n        dot.Should().BeIgnoringLineEndings(\"\"\"\n            digraph \"RoslynCfg\" {\n            cfg0_block0 [shape=record label=\"{ENTRY #0}\"]\n            cfg0_block1 [shape=record label=\"{BLOCK #1|0#: ExpressionStatementOperation: Bar(x =\\> \\{ return arg + 1; \\});|1#: 0#.Operation: InvocationOperation: Bar: Bar(x =\\> \\{ return arg + 1; \\})|2#: 1#.Instance: InstanceReferenceOperation: Bar|2#: ArgumentOperation: x =\\> \\{ return arg + 1; \\}|3#: 2#.Value: DelegateCreationOperation: x =\\> \\{ return arg + 1; \\}|4#: 3#.Target: FlowAnonymousFunctionOperation: x =\\> \\{ return arg + 1; \\}|##########|0#: ExpressionStatementOperation: Bar(x =\\> arg - 1);|1#: 0#.Operation: InvocationOperation: Bar: Bar(x =\\> arg - 1)|2#: 1#.Instance: InstanceReferenceOperation: Bar|2#: ArgumentOperation: x =\\> arg - 1|3#: 2#.Value: DelegateCreationOperation: x =\\> arg - 1|4#: 3#.Target: FlowAnonymousFunctionOperation: x =\\> arg - 1|##########}\"]\n            cfg0_block2 [shape=record label=\"{EXIT #2}\"]\n            subgraph \"cluster_2\" {\n            label = \"RoslynCfg.anonymous\"\n            cfg1_block0 [shape=record label=\"{ENTRY #0}\"]\n            cfg1_block1 [shape=record label=\"{BLOCK #1|## BranchValue ##|0#: BinaryOperation: arg + 1|1#: 0#.LeftOperand: ParameterReferenceOperation: arg|1#: 0#.RightOperand: LiteralOperation: 1|##########}\"]\n            cfg1_block2 [shape=record label=\"{EXIT #2}\"]\n            }\n            subgraph \"cluster_4\" {\n            label = \"RoslynCfg.anonymous\"\n            cfg3_block0 [shape=record label=\"{ENTRY #0}\"]\n            cfg3_block1 [shape=record label=\"{BLOCK #1|## BranchValue ##|0#: BinaryOperation: arg - 1|1#: 0#.LeftOperand: ParameterReferenceOperation: arg|1#: 0#.RightOperand: LiteralOperation: 1|##########}\"]\n            cfg3_block2 [shape=record label=\"{EXIT #2}\"]\n            }\n            cfg0_block0 -> cfg0_block1\n            cfg0_block1 -> cfg0_block2\n            cfg1_block0 -> cfg1_block1\n            cfg1_block1 -> cfg1_block2 [label=\"Return\"]\n            cfg3_block0 -> cfg3_block1\n            cfg3_block1 -> cfg3_block2 [label=\"Return\"]\n            }\n\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Serialize_CaptureId()\n    {\n        const string code = \"\"\"\n            class Sample\n            {\n                void Method(bool arg)\n                {\n                    bool b = arg && false;\n                    b = arg || true;\n                }\n            }\n            \"\"\";\n        var dot = CfgSerializer.Serialize(TestCompiler.CompileCfgCS(code));\n        dot.Should().BeIgnoringLineEndings(\"\"\"\n            digraph \"RoslynCfg\" {\n            subgraph \"cluster_1\" {\n            label = \"LocalLifetime region, Locals: b\"\n            subgraph \"cluster_2\" {\n            label = \"LocalLifetime region, Captures: #Capture-0\"\n            cfg0_block1 [shape=record label=\"{BLOCK #1|## BranchValue ##|0#: ParameterReferenceOperation: arg|##########}\"]\n            cfg0_block2 [shape=record label=\"{BLOCK #2|0#: FlowCaptureOperation: #Capture-0: false|1#: 0#.Value: LiteralOperation: false|##########}\"]\n            cfg0_block3 [shape=record label=\"{BLOCK #3|0#: FlowCaptureOperation: #Capture-0: arg|1#: 0#.Value: LiteralOperation: arg|##########}\"]\n            cfg0_block4 [shape=record label=\"{BLOCK #4|0#: SimpleAssignmentOperation: b = arg && false|1#: 0#.Target: LocalReferenceOperation: b = arg && false|1#: 0#.Value: FlowCaptureReferenceOperation: #Capture-0: arg && false|##########}\"]\n            }\n            subgraph \"cluster_3\" {\n            label = \"LocalLifetime region, Captures: #Capture-1, #Capture-2\"\n            cfg0_block5 [shape=record label=\"{BLOCK #5|0#: FlowCaptureOperation: #Capture-1: b|1#: 0#.Value: LocalReferenceOperation: b|##########|## BranchValue ##|0#: ParameterReferenceOperation: arg|##########}\"]\n            cfg0_block6 [shape=record label=\"{BLOCK #6|0#: FlowCaptureOperation: #Capture-2: true|1#: 0#.Value: LiteralOperation: true|##########}\"]\n            cfg0_block7 [shape=record label=\"{BLOCK #7|0#: FlowCaptureOperation: #Capture-2: arg|1#: 0#.Value: LiteralOperation: arg|##########}\"]\n            cfg0_block8 [shape=record label=\"{BLOCK #8|0#: ExpressionStatementOperation: b = arg \\|\\| true;|1#: 0#.Operation: SimpleAssignmentOperation: b = arg \\|\\| true|2#: 1#.Target: FlowCaptureReferenceOperation: #Capture-1: b|2#: 1#.Value: FlowCaptureReferenceOperation: #Capture-2: arg \\|\\| true|##########}\"]\n            }\n            }\n            cfg0_block0 [shape=record label=\"{ENTRY #0}\"]\n            cfg0_block9 [shape=record label=\"{EXIT #9}\"]\n            cfg0_block0 -> cfg0_block1\n            cfg0_block1 -> cfg0_block2 [label=\"Else\"]\n            cfg0_block1 -> cfg0_block3 [label=\"WhenFalse\"]\n            cfg0_block2 -> cfg0_block4\n            cfg0_block3 -> cfg0_block4\n            cfg0_block4 -> cfg0_block5\n            cfg0_block5 -> cfg0_block6 [label=\"Else\"]\n            cfg0_block5 -> cfg0_block7 [label=\"WhenTrue\"]\n            cfg0_block6 -> cfg0_block8\n            cfg0_block7 -> cfg0_block8\n            cfg0_block8 -> cfg0_block9\n            }\n\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Serialize_InvalidOperation()\n    {\n        const string code = \"\"\"\n            class Sample\n            {\n                void Method()\n                {\n                    undefined();\n                }\n            }\n            \"\"\";\n        var dot = CfgSerializer.Serialize(TestCompiler.CompileCfgCS(code, ignoreErrors: true));\n        dot.Should().BeIgnoringLineEndings(\"\"\"\n            digraph \"RoslynCfg\" {\n            cfg0_block0 [shape=record label=\"{ENTRY #0}\"]\n            cfg0_block1 [shape=record label=\"{BLOCK #1|0#: ExpressionStatementOperation: undefined();|1#: 0#.Operation: INVALID: undefined()|2#: INVALID: undefined|##########}\"]\n            cfg0_block2 [shape=record label=\"{EXIT #2}\"]\n            cfg0_block0 -> cfg0_block1\n            cfg0_block1 -> cfg0_block2\n            }\n\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Serialize_TryCatchChain()\n    {\n        const string code = \"\"\"\n            class Sample\n            {\n                void Method()\n                {\n                    try { }\n                    catch { }\n\n                    try { }\n                    catch { }\n                }\n            }\n            \"\"\";\n        var dot = CfgSerializer.Serialize(TestCompiler.CompileCfgCS(code));\n        dot.Should().BeIgnoringLineEndings(\"\"\"\n            digraph \"RoslynCfg\" {\n            subgraph \"cluster_1\" {\n            label = \"TryAndCatch region\"\n            subgraph \"cluster_2\" {\n            label = \"Try region\"\n            cfg0_block1 [shape=record label=\"{BLOCK #1}\"]\n            }\n            subgraph \"cluster_3\" {\n            label = \"Catch region: object\"\n            cfg0_block2 [shape=record label=\"{BLOCK #2}\"]\n            }\n            }\n            subgraph \"cluster_4\" {\n            label = \"TryAndCatch region\"\n            subgraph \"cluster_5\" {\n            label = \"Try region\"\n            cfg0_block3 [shape=record label=\"{BLOCK #3}\"]\n            }\n            subgraph \"cluster_6\" {\n            label = \"Catch region: object\"\n            cfg0_block4 [shape=record label=\"{BLOCK #4}\"]\n            }\n            }\n            cfg0_block0 [shape=record label=\"{ENTRY #0}\"]\n            cfg0_block5 [shape=record label=\"{EXIT #5}\"]\n            cfg0_block0 -> cfg0_block1\n            cfg0_block1 -> cfg0_block3\n            cfg0_block2 -> cfg0_block3\n            cfg0_block3 -> cfg0_block5\n            cfg0_block4 -> cfg0_block5\n            }\n\n            \"\"\");\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/CFG/Roslyn/RoslynControlFlowGraphTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Operations;\nusing SonarAnalyzer.CFG.Common;\nusing SonarAnalyzer.CFG.Extensions;\nusing StyleCop.Analyzers.Lightup;\nusing FlowAnalysis = Microsoft.CodeAnalysis.FlowAnalysis;\n\nnamespace SonarAnalyzer.CFG.Roslyn.Test;\n\n[TestClass]\npublic class RoslynControlFlowGraphTest\n{\n    [TestMethod]\n    public void IsAvailable_IsTrue() =>\n        ControlFlowGraph.IsAvailable.Should().BeTrue();\n\n    [TestMethod]\n    public void Create_ReturnsCfg_CS()\n    {\n        const string code = \"\"\"\n            public class Sample\n            {\n                public int Method()\n                {\n                    return 42;\n                }\n            }\n            \"\"\";\n        TestCompiler.CompileCfgCS(code).Should().NotBeNull();\n    }\n\n    [TestMethod]\n    public void Create_ReturnsCfg_TopLevelStatements()\n    {\n        const string code = \"\"\"\n            MethodA();\n            MethodB();\n\n            void MethodA() { }\n            void MethodB() { }\n            \"\"\";\n        TestCompiler.CompileCfg(code, AnalyzerLanguage.CSharp, outputKind: OutputKind.ConsoleApplication).Should().NotBeNull();\n    }\n\n    [TestMethod]\n    public void Create_ReturnsCfg_VB()\n    {\n        const string code = \"\"\"\n            Public Class Sample\n                Public Function Method() As Integer\n                    Return 42\n                End Function\n            End Class\n            \"\"\";\n        TestCompiler.CompileCfg(code, AnalyzerLanguage.VisualBasic).Should().NotBeNull();\n    }\n\n    [TestMethod]\n    public void ValidateReflection()\n    {\n        const string code = \"\"\"\n            public class Sample\n            {\n                public int Method()\n                {\n                    System.Action a = () => { };\n                    return LocalMethod();\n\n                    int LocalMethod() => 42;\n                }\n            }\n            \"\"\";\n        var cfg = TestCompiler.CompileCfgCS(code);\n        cfg.Should().NotBeNull();\n        cfg.Root.Should().NotBeNull();\n        cfg.Blocks.Should().NotBeNull().And.HaveCount(3); // Enter, Instructions, Exit\n        cfg.OriginalOperation.Should().NotBeNull().And.BeAssignableTo<IMethodBodyOperation>();\n        cfg.Parent.Should().BeNull();\n        cfg.LocalFunctions.Should().HaveCount(1);\n\n        var localFunctionCfg = cfg.GetLocalFunctionControlFlowGraph(cfg.LocalFunctions.Single(), default);\n        localFunctionCfg.Should().NotBeNull();\n        localFunctionCfg.Parent.Should().Be(cfg);\n\n        var anonymousFunction = cfg.Blocks.SelectMany(x => x.Operations).SelectMany(OperationExtensions.DescendantsAndSelf).OfType<FlowAnalysis.IFlowAnonymousFunctionOperation>().Single();\n        cfg.GetAnonymousFunctionControlFlowGraph(IFlowAnonymousFunctionOperationWrapper.FromOperation(anonymousFunction), default).Should().NotBeNull();\n    }\n\n    [TestMethod]\n    public void FlowAnonymousFunctionOperations_FindsAll()\n    {\n        const string code = \"\"\"\n            public class Sample {\n                private System.Action<int> Simple(int a)\n                {\n                    var x = 42;\n                    if (a == 42)\n                    {\n                        return (x) => {  };\n                    }\n                    return x => {  };\n                }\n            }\n            \"\"\";\n        var cfg = TestCompiler.CompileCfgCS(code);\n        var anonymousFunctionOperations = ControlFlowGraphExtensions.FlowAnonymousFunctionOperations(cfg).ToList();\n        anonymousFunctionOperations.Should().HaveCount(2);\n        cfg.GetAnonymousFunctionControlFlowGraph(anonymousFunctionOperations[0], default).Should().NotBeNull();\n        cfg.GetAnonymousFunctionControlFlowGraph(anonymousFunctionOperations[1], default).Should().NotBeNull();\n    }\n\n    [TestMethod]\n    public void RoslynCfgSupportedVersions()\n    {\n        // We are running on 3 rd major version - it is the minimum requirement\n        RoslynVersion.IsRoslynCfgSupported().Should().BeTrue();\n        // If we set minimum requirement to 2 - we will able to pass the check even with old MsBuild\n        RoslynVersion.IsRoslynCfgSupported(2).Should().BeTrue();\n        // If we set minimum requirement to 100 - we won't be able to pass the check\n        RoslynVersion.IsRoslynCfgSupported(100).Should().BeFalse();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/CFG/Roslyn/RoslynLvaSerializerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CFG.LiveVariableAnalysis;\nusing SonarAnalyzer.CSharp.Core.Syntax.Utilities;\n\nnamespace SonarAnalyzer.CFG.Roslyn.Test;\n\n[TestClass]\npublic class RoslynLvaSerializerTest\n{\n    [TestMethod]\n    public void Serialize_TryCatchFinally()\n    {\n        const string code = \"\"\"\n            class Sample\n            {\n                void Method()\n                {\n                    var value = 0;\n                    try\n                    {\n                        Use(0);\n                        value = 42;\n                    }\n                    catch\n                    {\n                        Use(value);\n                        value = 1;\n                    }\n                    finally\n                    {\n                        Use(value);\n                    }\n                }\n\n                void Use(int v) {}\n            }\n            \"\"\";\n        var dot = CfgSerializer.Serialize(CreateLva(code));\n        dot.Should().BeIgnoringLineEndings(\"\"\"\n            digraph \"RoslynCfgLva\" {\n            subgraph \"cluster_1\" {\n            label = \"LocalLifetime region, Locals: value\"\n            subgraph \"cluster_2\" {\n            label = \"TryAndFinally region\"\n            subgraph \"cluster_3\" {\n            label = \"Try region\"\n            subgraph \"cluster_4\" {\n            label = \"TryAndCatch region\"\n            subgraph \"cluster_5\" {\n            label = \"Try region\"\n            cfg0_block2 [shape=record label=\"{BLOCK #2|0#: ExpressionStatementOperation: Use(0);|1#: 0#.Operation: InvocationOperation: Use: Use(0)|2#: 1#.Instance: InstanceReferenceOperation: Use|2#: ArgumentOperation: 0|3#: 2#.Value: LiteralOperation: 0|##########|0#: ExpressionStatementOperation: value = 42;|1#: 0#.Operation: SimpleAssignmentOperation: value = 42|2#: 1#.Target: LocalReferenceOperation: value|2#: 1#.Value: LiteralOperation: 42|##########}\"]\n            }\n            subgraph \"cluster_6\" {\n            label = \"Catch region: object\"\n            cfg0_block3 [shape=record label=\"{BLOCK #3|0#: ExpressionStatementOperation: Use(value);|1#: 0#.Operation: InvocationOperation: Use: Use(value)|2#: 1#.Instance: InstanceReferenceOperation: Use|2#: ArgumentOperation: value|3#: 2#.Value: LocalReferenceOperation: value|##########|0#: ExpressionStatementOperation: value = 1;|1#: 0#.Operation: SimpleAssignmentOperation: value = 1|2#: 1#.Target: LocalReferenceOperation: value|2#: 1#.Value: LiteralOperation: 1|##########}\"]\n            }\n            }\n            }\n            subgraph \"cluster_7\" {\n            label = \"Finally region\"\n            cfg0_block4 [shape=record label=\"{BLOCK #4|0#: ExpressionStatementOperation: Use(value);|1#: 0#.Operation: InvocationOperation: Use: Use(value)|2#: 1#.Instance: InstanceReferenceOperation: Use|2#: ArgumentOperation: value|3#: 2#.Value: LocalReferenceOperation: value|##########}\"]\n            }\n            }\n            cfg0_block1 [shape=record label=\"{BLOCK #1|0#: SimpleAssignmentOperation: value = 0|1#: 0#.Target: LocalReferenceOperation: value = 0|1#: 0#.Value: LiteralOperation: 0|##########}\"]\n            }\n            cfg0_block0 [shape=record label=\"{ENTRY #0}\"]\n            cfg0_block5 [shape=record label=\"{EXIT #5}\"]\n            cfg0_block1 -> cfg0_block2\n            cfg0_block1 -> cfg0_block3 [label=\"LVA\" fontcolor=\"blue\" penwidth=\"2\" color=\"blue\"]\n            cfg0_block2 -> cfg0_block3 [label=\"LVA\" fontcolor=\"blue\" penwidth=\"2\" color=\"blue\"]\n            cfg0_block2 -> cfg0_block4 [label=\"LVA\" fontcolor=\"blue\" penwidth=\"2\" color=\"blue\"]\n            cfg0_block3 -> cfg0_block4 [label=\"LVA\" fontcolor=\"blue\" penwidth=\"2\" color=\"blue\"]\n            cfg0_block4 -> NoDestination_cfg0_block4 [label=\"StructuredExceptionHandling\"]\n            cfg0_block0 -> cfg0_block1\n            cfg0_block4 -> cfg0_block5 [label=\"LVA\" fontcolor=\"blue\" penwidth=\"2\" color=\"blue\"]\n            cfg0_block4 -> cfg0_block5 [label=\"LVA\" fontcolor=\"blue\" penwidth=\"2\" color=\"blue\"]\n            cfg0_block2 -> cfg0_block5\n            cfg0_block3 -> cfg0_block5\n            }\n\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Serialize_TryCatchFinallyRethrow()\n    {\n        const string code = \"\"\"\n            class Sample\n            {\n                void Method()\n                {\n                    var value = 0;\n                    try\n                    {\n                        Use(0);\n                        value = 42;\n                    }\n                    catch\n                    {\n                        Use(value);\n                        value = 1;\n                        throw;\n                    }\n                    finally\n                    {\n                        Use(value);\n                    }\n                }\n\n                void Use(int v) {}\n            }\n            \"\"\";\n        var dot = CfgSerializer.Serialize(CreateLva(code));\n        dot.Should().BeIgnoringLineEndings(\"\"\"\n            digraph \"RoslynCfgLva\" {\n            subgraph \"cluster_1\" {\n            label = \"LocalLifetime region, Locals: value\"\n            subgraph \"cluster_2\" {\n            label = \"TryAndFinally region\"\n            subgraph \"cluster_3\" {\n            label = \"Try region\"\n            subgraph \"cluster_4\" {\n            label = \"TryAndCatch region\"\n            subgraph \"cluster_5\" {\n            label = \"Try region\"\n            cfg0_block2 [shape=record label=\"{BLOCK #2|0#: ExpressionStatementOperation: Use(0);|1#: 0#.Operation: InvocationOperation: Use: Use(0)|2#: 1#.Instance: InstanceReferenceOperation: Use|2#: ArgumentOperation: 0|3#: 2#.Value: LiteralOperation: 0|##########|0#: ExpressionStatementOperation: value = 42;|1#: 0#.Operation: SimpleAssignmentOperation: value = 42|2#: 1#.Target: LocalReferenceOperation: value|2#: 1#.Value: LiteralOperation: 42|##########}\"]\n            }\n            subgraph \"cluster_6\" {\n            label = \"Catch region: object\"\n            cfg0_block3 [shape=record label=\"{BLOCK #3|0#: ExpressionStatementOperation: Use(value);|1#: 0#.Operation: InvocationOperation: Use: Use(value)|2#: 1#.Instance: InstanceReferenceOperation: Use|2#: ArgumentOperation: value|3#: 2#.Value: LocalReferenceOperation: value|##########|0#: ExpressionStatementOperation: value = 1;|1#: 0#.Operation: SimpleAssignmentOperation: value = 1|2#: 1#.Target: LocalReferenceOperation: value|2#: 1#.Value: LiteralOperation: 1|##########}\"]\n            }\n            }\n            }\n            subgraph \"cluster_7\" {\n            label = \"Finally region\"\n            cfg0_block4 [shape=record label=\"{BLOCK #4|0#: ExpressionStatementOperation: Use(value);|1#: 0#.Operation: InvocationOperation: Use: Use(value)|2#: 1#.Instance: InstanceReferenceOperation: Use|2#: ArgumentOperation: value|3#: 2#.Value: LocalReferenceOperation: value|##########}\"]\n            }\n            }\n            cfg0_block1 [shape=record label=\"{BLOCK #1|0#: SimpleAssignmentOperation: value = 0|1#: 0#.Target: LocalReferenceOperation: value = 0|1#: 0#.Value: LiteralOperation: 0|##########}\"]\n            }\n            cfg0_block0 [shape=record label=\"{ENTRY #0}\"]\n            cfg0_block5 [shape=record label=\"{EXIT #5}\"]\n            cfg0_block1 -> cfg0_block2\n            cfg0_block1 -> cfg0_block3 [label=\"LVA\" fontcolor=\"blue\" penwidth=\"2\" color=\"blue\"]\n            cfg0_block2 -> cfg0_block3 [label=\"LVA\" fontcolor=\"blue\" penwidth=\"2\" color=\"blue\"]\n            cfg0_block3 -> NoDestination_cfg0_block3 [label=\"Rethrow\"]\n            cfg0_block2 -> cfg0_block4 [label=\"LVA\" fontcolor=\"blue\" penwidth=\"2\" color=\"blue\"]\n            cfg0_block3 -> cfg0_block4 [label=\"LVA\" fontcolor=\"blue\" penwidth=\"2\" color=\"blue\"]\n            cfg0_block4 -> NoDestination_cfg0_block4 [label=\"StructuredExceptionHandling\"]\n            cfg0_block0 -> cfg0_block1\n            cfg0_block4 -> cfg0_block5 [label=\"LVA\" fontcolor=\"blue\" penwidth=\"2\" color=\"blue\"]\n            cfg0_block2 -> cfg0_block5\n            }\n\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Serialize_While()\n    {\n        const string code = \"\"\"\n            class Sample\n            {\n                void Method()\n                {\n                    var value = 0;\n                    while (value < 10)\n                    {\n                        Use(value);\n                        value++;\n                    }\n                }\n\n                void Use(int v) {}\n            }\n            \"\"\";\n        var dot = CfgSerializer.Serialize(CreateLva(code));\n        dot.Should().BeIgnoringLineEndings(\"\"\"\n            digraph \"RoslynCfgLva\" {\n            subgraph \"cluster_1\" {\n            label = \"LocalLifetime region, Locals: value\"\n            cfg0_block1 [shape=record label=\"{BLOCK #1|0#: SimpleAssignmentOperation: value = 0|1#: 0#.Target: LocalReferenceOperation: value = 0|1#: 0#.Value: LiteralOperation: 0|##########}\"]\n            cfg0_block2 [shape=record label=\"{BLOCK #2|## BranchValue ##|0#: BinaryOperation: value \\< 10|1#: 0#.LeftOperand: LocalReferenceOperation: value|1#: 0#.RightOperand: LiteralOperation: 10|##########}\"]\n            cfg0_block3 [shape=record label=\"{BLOCK #3|0#: ExpressionStatementOperation: Use(value);|1#: 0#.Operation: InvocationOperation: Use: Use(value)|2#: 1#.Instance: InstanceReferenceOperation: Use|2#: ArgumentOperation: value|3#: 2#.Value: LocalReferenceOperation: value|##########|0#: ExpressionStatementOperation: value++;|1#: 0#.Operation: IncrementOrDecrementOperation: value++|2#: 1#.Target: LocalReferenceOperation: value|##########}\"]\n            }\n            cfg0_block0 [shape=record label=\"{ENTRY #0}\"]\n            cfg0_block4 [shape=record label=\"{EXIT #4}\"]\n            cfg0_block0 -> cfg0_block1\n            cfg0_block1 -> cfg0_block2\n            cfg0_block3 -> cfg0_block2\n            cfg0_block2 -> cfg0_block3 [label=\"Else\"]\n            cfg0_block2 -> cfg0_block4 [label=\"WhenFalse\"]\n            }\n\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Serialize_Foreach()\n    {\n        const string code = \"\"\"\n            class Sample\n            {\n                void Method(int[] values)\n                {\n                    var value = 0;\n                    foreach (var v in values)\n                    {\n                        Use(value);\n                        value = v;\n                    }\n                }\n\n                void Use(int v) {}\n            }\n            \"\"\";\n        var dot = CfgSerializer.Serialize(CreateLva(code));\n        dot.Should().BeIgnoringLineEndings(\"\"\"\n            digraph \"RoslynCfgLva\" {\n            subgraph \"cluster_1\" {\n            label = \"LocalLifetime region, Locals: value\"\n            subgraph \"cluster_2\" {\n            label = \"LocalLifetime region, Captures: #Capture-0\"\n            subgraph \"cluster_3\" {\n            label = \"TryAndFinally region\"\n            subgraph \"cluster_4\" {\n            label = \"Try region\"\n            subgraph \"cluster_5\" {\n            label = \"LocalLifetime region, Locals: v\"\n            cfg0_block4 [shape=record label=\"{BLOCK #4|0#: SimpleAssignmentOperation: var|1#: 0#.Target: LocalReferenceOperation: var|1#: 0#.Value: ConversionOperation: var|2#: 1#.Operand: PropertyReferenceOperation: var|3#: 2#.Instance: FlowCaptureReferenceOperation: #Capture-0: values|##########|0#: ExpressionStatementOperation: Use(value);|1#: 0#.Operation: InvocationOperation: Use: Use(value)|2#: 1#.Instance: InstanceReferenceOperation: Use|2#: ArgumentOperation: value|3#: 2#.Value: LocalReferenceOperation: value|##########|0#: ExpressionStatementOperation: value = v;|1#: 0#.Operation: SimpleAssignmentOperation: value = v|2#: 1#.Target: LocalReferenceOperation: value|2#: 1#.Value: LocalReferenceOperation: v|##########}\"]\n            }\n            cfg0_block3 [shape=record label=\"{BLOCK #3|## BranchValue ##|0#: InvocationOperation: MoveNext: values|1#: 0#.Instance: FlowCaptureReferenceOperation: #Capture-0: values|##########}\"]\n            }\n            subgraph \"cluster_6\" {\n            label = \"Finally region, Captures: #Capture-1\"\n            cfg0_block5 [shape=record label=\"{BLOCK #5|0#: FlowCaptureOperation: #Capture-1: values|1#: 0#.Value: ConversionOperation: values|2#: 1#.Operand: FlowCaptureReferenceOperation: #Capture-0: values|##########|## BranchValue ##|0#: IsNullOperation: values|1#: 0#.Operand: FlowCaptureReferenceOperation: #Capture-1: values|##########}\"]\n            cfg0_block6 [shape=record label=\"{BLOCK #6|0#: InvocationOperation: Dispose: values|1#: 0#.Instance: FlowCaptureReferenceOperation: #Capture-1: values|##########}\"]\n            cfg0_block7 [shape=record label=\"{BLOCK #7}\"]\n            }\n            }\n            cfg0_block2 [shape=record label=\"{BLOCK #2|0#: FlowCaptureOperation: #Capture-0: values|1#: 0#.Value: InvocationOperation: GetEnumerator: values|2#: 1#.Instance: ConversionOperation: values|3#: 2#.Operand: ParameterReferenceOperation: values|##########}\"]\n            }\n            cfg0_block1 [shape=record label=\"{BLOCK #1|0#: SimpleAssignmentOperation: value = 0|1#: 0#.Target: LocalReferenceOperation: value = 0|1#: 0#.Value: LiteralOperation: 0|##########}\"]\n            }\n            cfg0_block0 [shape=record label=\"{ENTRY #0}\"]\n            cfg0_block8 [shape=record label=\"{EXIT #8}\"]\n            cfg0_block3 -> cfg0_block4 [label=\"Else\"]\n            cfg0_block2 -> cfg0_block3\n            cfg0_block4 -> cfg0_block3\n            cfg0_block3 -> cfg0_block5 [label=\"LVA\" fontcolor=\"blue\" penwidth=\"2\" color=\"blue\"]\n            cfg0_block3 -> cfg0_block5 [label=\"LVA\" fontcolor=\"blue\" penwidth=\"2\" color=\"blue\"]\n            cfg0_block2 -> cfg0_block5 [label=\"LVA\" fontcolor=\"blue\" penwidth=\"2\" color=\"blue\"]\n            cfg0_block4 -> cfg0_block5 [label=\"LVA\" fontcolor=\"blue\" penwidth=\"2\" color=\"blue\"]\n            cfg0_block5 -> cfg0_block6 [label=\"Else\"]\n            cfg0_block5 -> cfg0_block7 [label=\"WhenTrue\"]\n            cfg0_block6 -> cfg0_block7\n            cfg0_block7 -> NoDestination_cfg0_block7 [label=\"StructuredExceptionHandling\"]\n            cfg0_block1 -> cfg0_block2\n            cfg0_block0 -> cfg0_block1\n            cfg0_block7 -> cfg0_block8 [label=\"LVA\" fontcolor=\"blue\" penwidth=\"2\" color=\"blue\"]\n            cfg0_block3 -> cfg0_block8 [label=\"WhenFalse\"]\n            }\n\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Serialize_IfElse()\n    {\n        const string code = \"\"\"\n            class Sample\n            {\n                void Method(int value)\n                {\n                    if (value % 2 == 0)\n                    {\n                        Use(value);\n                    }\n                    else\n                    {\n                        Use(value);\n                    }\n                }\n\n                void Use(int v) {}\n            }\n            \"\"\";\n        var dot = CfgSerializer.Serialize(CreateLva(code));\n        dot.Should().BeIgnoringLineEndings(\"\"\"\n            digraph \"RoslynCfgLva\" {\n            cfg0_block0 [shape=record label=\"{ENTRY #0}\"]\n            cfg0_block1 [shape=record label=\"{BLOCK #1|## BranchValue ##|0#: BinaryOperation: value % 2 == 0|1#: 0#.LeftOperand: BinaryOperation: value % 2|2#: 1#.LeftOperand: ParameterReferenceOperation: value|2#: 1#.RightOperand: LiteralOperation: 2|1#: 0#.RightOperand: LiteralOperation: 0|##########}\"]\n            cfg0_block2 [shape=record label=\"{BLOCK #2|0#: ExpressionStatementOperation: Use(value);|1#: 0#.Operation: InvocationOperation: Use: Use(value)|2#: 1#.Instance: InstanceReferenceOperation: Use|2#: ArgumentOperation: value|3#: 2#.Value: ParameterReferenceOperation: value|##########}\"]\n            cfg0_block3 [shape=record label=\"{BLOCK #3|0#: ExpressionStatementOperation: Use(value);|1#: 0#.Operation: InvocationOperation: Use: Use(value)|2#: 1#.Instance: InstanceReferenceOperation: Use|2#: ArgumentOperation: value|3#: 2#.Value: ParameterReferenceOperation: value|##########}\"]\n            cfg0_block4 [shape=record label=\"{EXIT #4}\"]\n            cfg0_block0 -> cfg0_block1\n            cfg0_block1 -> cfg0_block2 [label=\"Else\"]\n            cfg0_block1 -> cfg0_block3 [label=\"WhenFalse\"]\n            cfg0_block2 -> cfg0_block4\n            cfg0_block3 -> cfg0_block4\n            }\n\n            \"\"\");\n    }\n\n    private static RoslynLiveVariableAnalysis CreateLva(string code)\n    {\n        var cfg = TestCompiler.CompileCfgCS(code);\n        return new RoslynLiveVariableAnalysis(cfg, CSharpSyntaxClassifier.Instance, CancellationToken.None);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/CFG/Sonar/BlockIdProviderTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CFG.Sonar;\n\nnamespace SonarAnalyzer.Test.CFG.Sonar;\n\n[TestClass]\npublic class BlockIdProviderTest\n{\n    private BlockIdProvider blockId;\n\n    [TestInitialize]\n    public void TestInitialize()\n    {\n        blockId = new BlockIdProvider();\n    }\n\n    [TestMethod]\n    public void Get_Returns_Same_Id_For_Same_Block()\n    {\n        var block = new TemporaryBlock();\n\n        blockId.Get(block).Should().Be(\"0\");\n        blockId.Get(block).Should().Be(\"0\");\n        blockId.Get(block).Should().Be(\"0\");\n    }\n\n    [TestMethod]\n    public void Get_Returns_Different_Id_For_Different_Block()\n    {\n        var id1 = blockId.Get(new TemporaryBlock());\n        var id2 = blockId.Get(new TemporaryBlock());\n        var id3 = blockId.Get(new TemporaryBlock());\n\n        id1.Should().Be(\"0\");\n        id2.Should().Be(\"1\");\n        id3.Should().Be(\"2\");\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/CFG/Sonar/SonarCfgSerializerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\n\nnamespace SonarAnalyzer.CFG.Sonar.Test;\n\n[TestClass]\npublic class SonarCfgSerializerTest\n{\n    [TestMethod]\n    public void Serialize_Empty_Method()\n    {\n        const string code = \"\"\"\n            class C\n            {\n                void Foo()\n                {\n                }\n            }\n            \"\"\";\n        var dot = CfgSerializer.Serialize(CreateMethodCfg(code), \"Foo\");\n\n        dot.Should().BeIgnoringLineEndings(\"\"\"\n            digraph \"Foo\" {\n            0 [shape=record label=\"{EXIT}\"]\n            }\n\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Serialize_Branch_Jump()\n    {\n        const string code = \"\"\"\n            class C\n            {\n                void Foo(int a)\n                {\n                    switch (a)\n                    {\n                        case 1:\n                            c1();\n                            break;\n\n                        case 2:\n                            c2();\n                            break;\n                    }\n                }\n            }\n            \"\"\";\n        var dot = CfgSerializer.Serialize(CreateMethodCfg(code), \"Foo\");\n\n        dot.Should().BeIgnoringLineEndings(\"\"\"\n            digraph \"Foo\" {\n            0 [shape=record label=\"{BRANCH:SwitchStatement|a}\"]\n            1 [shape=record label=\"{BINARY:CaseSwitchLabel|a}\"]\n            2 [shape=record label=\"{JUMP:BreakStatement|c1|c1()}\"]\n            3 [shape=record label=\"{BINARY:CaseSwitchLabel|a}\"]\n            5 [shape=record label=\"{JUMP:BreakStatement|c2|c2()}\"]\n            4 [shape=record label=\"{EXIT}\"]\n            0 -> 1\n            1 -> 2 [label=\"True\"]\n            1 -> 3 [label=\"False\"]\n            2 -> 4\n            3 -> 5 [label=\"True\"]\n            3 -> 4 [label=\"False\"]\n            5 -> 4\n            }\n\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Serialize_BinaryBranch_Simple()\n    {\n        const string code = \"\"\"\n            class C\n            {\n                void Foo()\n                {\n                    if (true)\n                    {\n                        Bar();\n                    }\n                }\n                void Bar() { }\n            }\n            \"\"\";\n        var dot = CfgSerializer.Serialize(CreateMethodCfg(code), \"Foo\");\n\n        dot.Should().BeIgnoringLineEndings(\"\"\"\n            digraph \"Foo\" {\n            0 [shape=record label=\"{BINARY:TrueLiteralExpression|true}\"]\n            1 [shape=record label=\"{SIMPLE|Bar|Bar()}\"]\n            2 [shape=record label=\"{EXIT}\"]\n            0 -> 1 [label=\"True\"]\n            0 -> 2 [label=\"False\"]\n            1 -> 2\n            }\n\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Serialize_Foreach_Binary_Simple()\n    {\n        const string code = \"\"\"\n            class C\n            {\n                void Foo()\n                {\n                    foreach (var i in items)\n                    {\n                        Bar();\n                    }\n                }\n            }\n            \"\"\";\n        var dot = CfgSerializer.Serialize(CreateMethodCfg(code), \"Foo\");\n\n        dot.Should().BeIgnoringLineEndings(\"\"\"\n            digraph \"Foo\" {\n            0 [shape=record label=\"{FOREACH:ForEachStatement|items}\"]\n            1 [shape=record label=\"{BINARY:ForEachStatement}\"]\n            2 [shape=record label=\"{SIMPLE|Bar|Bar()}\"]\n            3 [shape=record label=\"{EXIT}\"]\n            0 -> 1\n            1 -> 2 [label=\"True\"]\n            1 -> 3 [label=\"False\"]\n            2 -> 1\n            }\n\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Serialize_Foreach_Binary_VarDeclaration()\n    {\n        const string code = \"\"\"\n            namespace Namespace\n            {\n                public class Test\n                {\n                    public void ForEach((string key, string value)[] values)\n                    {\n                        foreach (var (key, value) in values)\n                        {\n                            string i = key;\n                            string j = value;\n                        }\n                    }\n                }\n            };\n            \"\"\";\n\n        var dot = CfgSerializer.Serialize(CreateMethodCfg(code), \"ForEach\");\n\n        dot.Should().BeIgnoringLineEndings(\"\"\"\n            digraph \"ForEach\" {\n            0 [shape=record label=\"{FOREACH:ForEachVariableStatement|values}\"]\n            1 [shape=record label=\"{BINARY:ForEachVariableStatement}\"]\n            2 [shape=record label=\"{SIMPLE|key|i = key|value|j = value}\"]\n            3 [shape=record label=\"{EXIT}\"]\n            0 -> 1\n            1 -> 2 [label=\"True\"]\n            1 -> 3 [label=\"False\"]\n            2 -> 1\n            }\n\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Serialize_For_Binary_Simple()\n    {\n        const string code = \"\"\"\n            class C\n            {\n                void Foo()\n                {\n                    for (var i = 0; i < 10; i++)\n                    {\n                        Bar();\n                    }\n                }\n            }\n            \"\"\";\n        var dot = CfgSerializer.Serialize(CreateMethodCfg(code), \"Foo\");\n\n        dot.Should().BeIgnoringLineEndings(\"\"\"\n            digraph \"Foo\" {\n            0 [shape=record label=\"{FOR:ForStatement|0|i = 0}\"]\n            1 [shape=record label=\"{BINARY:ForStatement|i|10|i \\< 10}\"]\n            2 [shape=record label=\"{SIMPLE|Bar|Bar()}\"]\n            4 [shape=record label=\"{SIMPLE|i|i++}\"]\n            3 [shape=record label=\"{EXIT}\"]\n            0 -> 1\n            1 -> 2 [label=\"True\"]\n            1 -> 3 [label=\"False\"]\n            2 -> 4\n            4 -> 1\n            }\n\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Serialize_Jump_Using()\n    {\n        const string code = \"\"\"\n            class C\n            {\n                void Foo()\n                {\n                    using (x)\n                    {\n                        Bar();\n                    }\n                }\n            }\n            \"\"\";\n        var dot = CfgSerializer.Serialize(CreateMethodCfg(code), \"Foo\");\n\n        dot.Should().BeIgnoringLineEndings(\"\"\"\n            digraph \"Foo\" {\n            0 [shape=record label=\"{JUMP:UsingStatement|x}\"]\n            1 [shape=record label=\"{USING:UsingStatement|Bar|Bar()}\"]\n            2 [shape=record label=\"{EXIT}\"]\n            0 -> 1\n            1 -> 2\n            }\n\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Serialize_Lock_Simple()\n    {\n        const string code = \"\"\"\n            class C\n            {\n                void Foo()\n                {\n                    lock (x)\n                    {\n                        Bar();\n                    }\n                }\n            }\n            \"\"\";\n        var dot = CfgSerializer.Serialize(CreateMethodCfg(code), \"Foo\");\n\n        dot.Should().BeIgnoringLineEndings(\"\"\"\n            digraph \"Foo\" {\n            0 [shape=record label=\"{LOCK:LockStatement|x}\"]\n            1 [shape=record label=\"{SIMPLE|Bar|Bar()}\"]\n            2 [shape=record label=\"{EXIT}\"]\n            0 -> 1\n            1 -> 2\n            }\n\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Serialize_Lambda()\n    {\n        const string code = \"\"\"\n            class C\n            {\n                void Foo()\n                {\n                    Bar(x =>\n                    {\n                        return 1 + 1;\n                    });\n                }\n            }\n            \"\"\";\n        var dot = CfgSerializer.Serialize(CreateMethodCfg(code), \"Foo\");\n\n        dot.Should().BeIgnoringLineEndings(\"\"\"\n            digraph \"Foo\" {\n            0 [shape=record label=\"{SIMPLE|Bar|x =\\>\\n        \\{\\n            return 1 + 1;\\n        \\}|Bar(x =\\>\\n        \\{\\n            return 1 + 1;\\n        \\})}\"]\n            1 [shape=record label=\"{EXIT}\"]\n            0 -> 1\n            }\n\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Serialize_Range()\n    {\n        const string code = \"\"\"\n            internal class Test\n            {\n                public void Range()\n                {\n                    Range r = 1..4;\n                }\n            }\n            \"\"\";\n        var dot = CfgSerializer.Serialize(CreateMethodCfg(code), \"Range\");\n\n        dot.Should().BeIgnoringLineEndings(\"\"\"\n            digraph \"Range\" {\n            0 [shape=record label=\"{SIMPLE|1..4|r = 1..4}\"]\n            1 [shape=record label=\"{EXIT}\"]\n            0 -> 1\n            }\n\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Serialize_Index()\n    {\n        const string code = \"\"\"\n            internal class Test\n            {\n                public void Index()\n                {\n                    Index index = ^1;\n                }\n            }\n            \"\"\";\n        var dot = CfgSerializer.Serialize(CreateMethodCfg(code), \"Index\");\n\n        dot.Should().BeIgnoringLineEndings(\"\"\"\n            digraph \"Index\" {\n            0 [shape=record label=\"{SIMPLE|^1|index = ^1}\"]\n            1 [shape=record label=\"{EXIT}\"]\n            0 -> 1\n            }\n\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Serialize_IndexInRange()\n    {\n        const string code = \"\"\"\n            internal class Test\n            {\n                public void Range()\n                {\n                    Range range = ^2..^0;\n                }\n            }\n            \"\"\";\n        var dot = CfgSerializer.Serialize(CreateMethodCfg(code), \"Range\");\n\n        dot.Should().BeIgnoringLineEndings(\"\"\"\n            digraph \"Range\" {\n            0 [shape=record label=\"{SIMPLE|^2..^0|range = ^2..^0}\"]\n            1 [shape=record label=\"{EXIT}\"]\n            0 -> 1\n            }\n\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Serialize_RangeInIndexer()\n    {\n        const string code = \"\"\"\n            internal class Test\n            {\n                public void Range()\n                {\n                    var ints = new[] { 1, 2 };\n                    var lastTwo = ints[^2..^1];\n                }\n            }\n            \"\"\";\n        var dot = CfgSerializer.Serialize(CreateMethodCfg(code), \"Range\");\n\n        dot.Should().BeIgnoringLineEndings(\"\"\"\n            digraph \"Range\" {\n            0 [shape=record label=\"{SIMPLE|new[] \\{ 1, 2 \\}|1|2|\\{ 1, 2 \\}|ints = new[] \\{ 1, 2 \\}|ints|^2..^1|ints[^2..^1]|lastTwo = ints[^2..^1]}\"]\n            1 [shape=record label=\"{EXIT}\"]\n            0 -> 1\n            }\n\n            \"\"\");\n    }\n\n    private static IControlFlowGraph CreateMethodCfg(string code)\n    {\n        var (tree, model) = TestCompiler.CompileIgnoreErrorsCS(code);\n        return CSharpControlFlowGraph.Create(tree.First<MethodDeclarationSyntax>().Body, model);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/CFG/Sonar/SonarControlFlowGraphTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing StyleCop.Analyzers.Lightup;\n\nnamespace SonarAnalyzer.CFG.Sonar.Test\n{\n    [TestClass]\n    public class SonarControlFlowGraphTest\n    {\n        private const string SimpleReturn = \"return\";\n        private const string SimpleThrow = \"throw\";\n        private const string SimpleYieldBreak = \"yield break\";\n        private const string ExpressionReturn = \"return ii\";\n        private const string ExpressionThrow = \"throw ii\";\n\n        #region Top level - build CFG expression body / body\n\n        [TestMethod]\n        public void Cfg_Constructed_for_Body()\n        {\n            var cfg = Build(\"i = 4 + 5;\");\n            VerifyMinimalCfg(cfg);\n        }\n\n        [TestMethod]\n        public void Cfg_Constructed_for_ExpressionBody()\n        {\n            const string input = @\"\nnamespace NS\n{\n  public class Foo\n  {\n    public int Bar() => 4 + 5;\n  }\n}\";\n            var (method, model) = CompileWithMethodBody(input);\n            var expression = method.ExpressionBody.Expression;\n            var cfg = CSharpControlFlowGraph.Create(expression, model);\n            VerifyMinimalCfg(cfg);\n        }\n\n        [TestMethod]\n        public void Cfg_Constructed_for_Ctor_ComplexArguments()\n        {\n            const string input = @\"\nnamespace NS\n{\n    public class Foo\n    {\n        private static int num = 10;\n\n        public Foo() : this(true ? 5 : num + num)\n        {\n            var x = num;\n        }\n\n        public Foo(int i) {}\n    }\n}\";\n            var (tree, semanticModel) = TestCompiler.CompileCS(input);\n            var cfg = CSharpControlFlowGraph.Create(FirstConstructorBody(tree), semanticModel);\n\n            VerifyCfg(cfg, 5);\n\n            var blocks = cfg.Blocks.ToArray();\n\n            var conditionalBlock = (BinaryBranchBlock)blocks[0];\n            var trueCondition = blocks[1];\n            var falseCondition = blocks[2];\n            var constructorBody = blocks[3];\n            var exit = cfg.ExitBlock;\n\n            conditionalBlock.TrueSuccessorBlock.Should().Be(trueCondition);\n            conditionalBlock.FalseSuccessorBlock.Should().Be(falseCondition);\n            trueCondition.SuccessorBlocks.Should().Equal(constructorBody);\n            falseCondition.SuccessorBlocks.Should().Equal(constructorBody);\n            constructorBody.SuccessorBlocks.Should().Equal(exit);\n            exit.PredecessorBlocks.Should().Equal(constructorBody);\n\n            VerifyAllInstructions(conditionalBlock, \"true\");\n            VerifyAllInstructions(trueCondition, \"5\");\n            VerifyAllInstructions(falseCondition, \"num\", \"num\", \"num + num\");\n            VerifyAllInstructions(constructorBody, \": this(true ? 5 : num + num)\", \"num\", \"x = num\");\n            VerifyAllInstructions(exit);\n        }\n\n        [TestMethod]\n        public void Cfg_Constructed_for_Ctor_This()\n        {\n            const string input = @\"\nnamespace NS\n{\n    public class Foo\n    {\n        public Foo() : this(5) {}\n\n        public Foo(int i) {}\n    }\n}\";\n            var (tree, semanticModel) = TestCompiler.CompileCS(input);\n            var cfg = CSharpControlFlowGraph.Create(FirstConstructorBody(tree), semanticModel);\n\n            VerifyCfg(cfg, 2);\n\n            var blocks = cfg.Blocks.ToArray();\n\n            var constructorBody = blocks[0];\n            var exit = cfg.ExitBlock;\n\n            constructorBody.SuccessorBlocks.Should().Equal(exit);\n            exit.PredecessorBlocks.Should().Equal(constructorBody);\n\n            VerifyAllInstructions(constructorBody, \"5\", \": this(5)\");\n            VerifyAllInstructions(exit);\n        }\n\n        [TestMethod]\n        public void Cfg_Constructed_for_Ctor_Base()\n        {\n            const string input = @\"\nnamespace NS\n{\n    public class Foo : Bar\n    {\n        public Foo() : base(5) {}\n    }\n    public class Bar\n    {\n        public Bar(int i) {}\n    }\n}\";\n            var (tree, semanticModel) = TestCompiler.CompileCS(input);\n            var cfg = CSharpControlFlowGraph.Create(FirstConstructorBody(tree), semanticModel);\n\n            VerifyCfg(cfg, 2);\n\n            var blocks = cfg.Blocks.ToArray();\n\n            var constructorBody = blocks[0];\n            var exit = cfg.ExitBlock;\n\n            constructorBody.SuccessorBlocks.Should().Equal(exit);\n            exit.PredecessorBlocks.Should().Equal(constructorBody);\n\n            VerifyAllInstructions(constructorBody, \"5\", \": base(5)\");\n            VerifyAllInstructions(exit);\n        }\n\n        [TestMethod]\n        public void Cfg_ExtremelyNestedExpression_NotSupported_FromExpression()\n        {\n            var (method, model) = CompileWithMethodBody(string.Format(TestInput, $\"var x = {ExtremelyNestedExpression()};\"));\n            var equalsValueSyntax = method.DescendantNodes(x => !(x is ExpressionSyntax)).OfType<EqualsValueClauseSyntax>().Single();\n            Action a = () => CSharpControlFlowGraph.Create(equalsValueSyntax.Value, model);\n\n            a.Should().Throw<NotSupportedException>().WithMessage(\"Too complex expression\");\n            CSharpControlFlowGraph.TryGet(equalsValueSyntax.Value, model, out _).Should().BeFalse();\n        }\n\n        [TestMethod]\n        public void Cfg_ExtremelyNestedExpression_NotSupported_FromBodyMethod()\n        {\n            var input = @$\"\npublic class Sample\n{{\n    public string Main()\n    {{\n        return {ExtremelyNestedExpression()};\n    }}\n}}\";\n            var (tree, semanticModel) = TestCompiler.CompileCS(input);\n            var method = FirstMethod(tree);\n            Action a = () => CSharpControlFlowGraph.Create(method.Body, semanticModel);\n\n            a.Should().Throw<NotSupportedException>().WithMessage(\"Too complex expression\");\n            CSharpControlFlowGraph.TryGet(method.Body, semanticModel, out _).Should().BeFalse();\n        }\n\n        [TestMethod]\n        public void Cfg_ExtremelyNestedExpression_NotSupported_FromArrowMethod()\n        {\n            var input = @$\"\npublic class Sample\n{{\n    public string Main() =>{ExtremelyNestedExpression()};\n}}\";\n            var (tree, semanticModel) = TestCompiler.CompileCS(input);\n            var method = FirstMethod(tree);\n            Action a = () => CSharpControlFlowGraph.Create(method.ExpressionBody, semanticModel);\n\n            a.Should().Throw<NotSupportedException>().WithMessage(\"Too complex expression\");\n            CSharpControlFlowGraph.TryGet(method.ExpressionBody, semanticModel, out _).Should().BeFalse();\n        }\n\n        [TestMethod]\n        public void Cfg_ExtremelyNestedExpression_IsSupported_InSimpleLambda()\n        {\n            var input = @$\"\npublic class Sample\n{{\n    public void Main() => Go(x => x + {ExtremelyNestedExpression()});\n\n    public void Go(System.Func<string, string> arg) {{ }}\n}}\";\n            var (tree, semanticModel) = TestCompiler.CompileCS(input);\n            var method = FirstMethod(tree);\n            CSharpControlFlowGraph.Create(method.ExpressionBody, semanticModel).Should().NotBeNull();\n            CSharpControlFlowGraph.TryGet(method, semanticModel, out _).Should().BeTrue();\n        }\n\n        [TestMethod]\n        public void Cfg_ExtremelyNestedExpression_IsSupported_InParenthesizedLambda()\n        {\n            var input = @$\"\npublic class Sample\n{{\n    public void Main() => Go(() => {ExtremelyNestedExpression()});\n\n    public void Go(System.Func<string> arg) {{ }}\n}}\";\n            var (tree, semanticModel) = TestCompiler.CompileCS(input);\n            var method = FirstMethod(tree);\n            CSharpControlFlowGraph.Create(method.ExpressionBody, semanticModel).Should().NotBeNull();\n            CSharpControlFlowGraph.TryGet(method, semanticModel, out _).Should().BeTrue();\n        }\n\n        #endregion\n\n        #region Empty statement\n\n        [TestMethod]\n        public void Cfg_EmptyStatement()\n        {\n            var cfg = Build(\";;;;;\");\n            VerifyEmptyCfg(cfg);\n        }\n\n        #endregion\n\n        #region Variable declaration\n\n        [TestMethod]\n        public void Cfg_VariableDeclaration()\n        {\n            var cfg = Build(\"var x = 10, y = 11; var z = 12;\");\n            VerifyMinimalCfg(cfg);\n\n            VerifyAllInstructions(cfg.EntryBlock, \"10\", \"x = 10\", \"11\", \"y = 11\", \"12\", \"z = 12\");\n        }\n\n        #endregion\n\n        #region If statement\n\n        [TestMethod]\n        public void Cfg_If()\n        {\n            var cfg = Build(\"if (true) { var x = 10; }\");\n\n            VerifyCfg(cfg, 3);\n            var branchBlock = cfg.EntryBlock as BinaryBranchBlock;\n            var trueBlock = cfg.Blocks.ToList()[1];\n            var exitBlock = cfg.ExitBlock;\n\n            branchBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { trueBlock, exitBlock });\n            branchBlock.BranchingNode.Kind().Should().Be(SyntaxKind.TrueLiteralExpression);\n\n            trueBlock.SuccessorBlocks.Should().Equal(exitBlock);\n            exitBlock.PredecessorBlocks.Should().BeEquivalentTo(new[] { branchBlock, trueBlock });\n\n            VerifyAllInstructions(branchBlock, \"true\");\n            VerifyAllInstructions(trueBlock, \"10\", \"x = 10\");\n        }\n\n        [TestMethod]\n        public void Cfg_If_Branch_Or_Condition()\n        {\n            var cfg = Build(\"if (a || b) { var x = 10; }\");\n\n            VerifyCfg(cfg, 4);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var branchBlockA = (BinaryBranchBlock)blocks[0];\n            var branchBlockB = (BinaryBranchBlock)blocks[1];\n            var trueBlock = blocks[2];\n            var exitBlock = cfg.ExitBlock;\n\n            branchBlockA.TrueSuccessorBlock.Should().Be(trueBlock);\n            branchBlockA.FalseSuccessorBlock.Should().Be(branchBlockB);\n            branchBlockB.TrueSuccessorBlock.Should().Be(trueBlock);\n            branchBlockB.FalseSuccessorBlock.Should().Be(exitBlock);\n        }\n\n        [TestMethod]\n        public void Cfg_If_Branch_And_Condition()\n        {\n            var cfg = Build(\"if (a && b) { var x = 10; }\");\n\n            VerifyCfg(cfg, 4);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var branchBlockA = (BinaryBranchBlock)blocks[0];\n            var branchBlockB = (BinaryBranchBlock)blocks[1];\n            var trueBlock = blocks[2];\n            var exitBlock = cfg.ExitBlock;\n\n            branchBlockA.TrueSuccessorBlock.Should().Be(branchBlockB);\n            branchBlockA.FalseSuccessorBlock.Should().Be(exitBlock);\n            branchBlockB.TrueSuccessorBlock.Should().Be(trueBlock);\n            branchBlockB.FalseSuccessorBlock.Should().Be(exitBlock);\n        }\n\n        [TestMethod]\n        public void Cfg_If_Branch_And_Condition_Parentheses()\n        {\n            var cfg = Build(\"if (((a && b))) { var x = 10; }\");\n\n            VerifyCfg(cfg, 4);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var branchBlockA = (BinaryBranchBlock)blocks[0];\n            var branchBlockB = (BinaryBranchBlock)blocks[1];\n            var trueBlock = blocks[2];\n            var exitBlock = cfg.ExitBlock;\n\n            branchBlockA.TrueSuccessorBlock.Should().Be(branchBlockB);\n            branchBlockA.FalseSuccessorBlock.Should().Be(exitBlock);\n            branchBlockB.TrueSuccessorBlock.Should().Be(trueBlock);\n            branchBlockB.FalseSuccessorBlock.Should().Be(exitBlock);\n        }\n\n        [TestMethod]\n        public void Cfg_If_Else()\n        {\n            var cfg = Build(\"if (true) { var x = 10; } else { var y = 11; }\");\n            VerifyCfg(cfg, 4);\n            var branchBlock = cfg.EntryBlock as BinaryBranchBlock;\n            var trueBlock = cfg.Blocks.ToList()[1];\n            var falseBlock = cfg.Blocks.ToList()[2];\n            var exitBlock = cfg.ExitBlock;\n\n            branchBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { trueBlock, falseBlock });\n            branchBlock.BranchingNode.Kind().Should().Be(SyntaxKind.TrueLiteralExpression);\n\n            trueBlock.SuccessorBlocks.Should().Equal(exitBlock);\n            falseBlock.SuccessorBlocks.Should().Equal(exitBlock);\n            exitBlock.PredecessorBlocks.Should().BeEquivalentTo(new[] { trueBlock, falseBlock });\n        }\n\n        [TestMethod]\n        public void Cfg_If_ElseIf()\n        {\n            var cfg = Build(\"if (true) { var x = 10; } else if (false) { var y = 11; }\");\n            VerifyCfg(cfg, 5);\n            var firstCondition = cfg.EntryBlock as BinaryBranchBlock;\n            var trueBlockX = cfg.Blocks.ToList()[1];\n            var secondCondition = cfg.Blocks.ToList()[2] as BinaryBranchBlock;\n            var trueBlockY = cfg.Blocks.ToList()[3];\n            var exitBlock = cfg.ExitBlock;\n\n            firstCondition.SuccessorBlocks.Should().BeEquivalentTo(new[] { trueBlockX, secondCondition });\n            firstCondition.BranchingNode.Kind().Should().Be(SyntaxKind.TrueLiteralExpression);\n\n            trueBlockX.SuccessorBlocks.Should().Equal(exitBlock);\n\n            secondCondition.SuccessorBlocks.Should().BeEquivalentTo(new[] { trueBlockY, exitBlock });\n            secondCondition.BranchingNode.Kind().Should().Be(SyntaxKind.FalseLiteralExpression);\n\n            exitBlock.PredecessorBlocks.Should().BeEquivalentTo(new[] { trueBlockX, trueBlockY, secondCondition }, x => x.IgnoringCyclicReferences());\n        }\n\n        [TestMethod]\n        public void Cfg_If_ElseIf_Else()\n        {\n            var cfg = Build(\"if (true) { var x = 10; } else if (false) { var y = 11; } else { var z = 12; }\");\n            VerifyCfg(cfg, 6);\n            var firstCondition = cfg.EntryBlock as BinaryBranchBlock;\n            var trueBlockX = cfg.Blocks.ToList()[1];\n            var secondCondition = cfg.Blocks.ToList()[2] as BinaryBranchBlock;\n            var trueBlockY = cfg.Blocks.ToList()[3];\n            var falseBlockZ = cfg.Blocks.ToList()[4];\n            var exitBlock = cfg.ExitBlock;\n\n            firstCondition.SuccessorBlocks.Should().BeEquivalentTo(new[] { trueBlockX, secondCondition });\n            firstCondition.BranchingNode.Kind().Should().Be(SyntaxKind.TrueLiteralExpression);\n\n            trueBlockX.SuccessorBlocks.Should().Equal(exitBlock);\n\n            secondCondition.SuccessorBlocks.Should().BeEquivalentTo(new[] { trueBlockY, falseBlockZ });\n            secondCondition.BranchingNode.Kind().Should().Be(SyntaxKind.FalseLiteralExpression);\n\n            trueBlockY.SuccessorBlocks.Should().Equal(exitBlock);\n            falseBlockZ.SuccessorBlocks.Should().Equal(exitBlock);\n\n            exitBlock.PredecessorBlocks.Should().BeEquivalentTo(new[] { trueBlockX, trueBlockY, falseBlockZ }, x => x.IgnoringCyclicReferences());\n        }\n\n        [TestMethod]\n        public void Cfg_NestedIf()\n        {\n            var cfg = Build(\"if (true) { if (false) { var x = 10; } else { var y = 10; } }\");\n            VerifyCfg(cfg, 5);\n            var firstCondition = cfg.EntryBlock as BinaryBranchBlock;\n            firstCondition.Instructions.Should().Contain(n => n.IsKind(SyntaxKind.TrueLiteralExpression));\n\n            var secondCondition = cfg.Blocks.ToList()[1] as BinaryBranchBlock;\n            secondCondition.Instructions.Should().Contain(n => n.IsKind(SyntaxKind.FalseLiteralExpression));\n\n            var trueBlockX = cfg.Blocks.ToList()[2];\n            var falseBlockY = cfg.Blocks.ToList()[3];\n            var exitBlock = cfg.ExitBlock;\n\n            firstCondition.SuccessorBlocks.Should().BeEquivalentTo(new Block[] { secondCondition, exitBlock });\n            firstCondition.BranchingNode.Kind().Should().Be(SyntaxKind.TrueLiteralExpression);\n\n            secondCondition.SuccessorBlocks.Should().BeEquivalentTo(new[] { trueBlockX, falseBlockY });\n            secondCondition.BranchingNode.Kind().Should().Be(SyntaxKind.FalseLiteralExpression);\n\n            trueBlockX.SuccessorBlocks.Should().Equal(exitBlock);\n            falseBlockY.SuccessorBlocks.Should().Equal(exitBlock);\n\n            exitBlock.PredecessorBlocks.Should().BeEquivalentTo(new[] { trueBlockX, falseBlockY, firstCondition });\n        }\n\n        [TestMethod]\n        public void Cfg_If_Coalesce()\n        {\n            var cfg = Build(\"if (a ?? b) { var y = 10; }\");\n\n            VerifyCfg(cfg, 5);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var branchBlockA = (BinaryBranchBlock)blocks[0];\n            var branchBlockALeft = (BranchBlock)blocks[1];\n            var branchBlockB = (BinaryBranchBlock)blocks[2];\n            var trueBlock = blocks[3];\n            var exit = blocks[4];\n\n            branchBlockA.TrueSuccessorBlock.Should().Be(branchBlockB);\n            branchBlockA.FalseSuccessorBlock.Should().Be(branchBlockALeft);\n            branchBlockALeft.SuccessorBlocks.Should().BeEquivalentTo(new[] { trueBlock, exit });\n            branchBlockB.TrueSuccessorBlock.Should().Be(trueBlock);\n            branchBlockB.FalseSuccessorBlock.Should().Be(exit);\n            trueBlock.SuccessorBlocks.Should().Equal(exit);\n        }\n\n        [TestMethod]\n        public void Cfg_Conditional_ComplexCondition_Coalesce()\n        {\n            var cfg = Build(\"var a = (x ?? y) ? b : c;\");\n            VerifyCfg(cfg, 7);\n\n            var blocks = cfg.Blocks.ToList();\n            var branchBlockX = (BinaryBranchBlock)blocks[0];\n            var branchBlockXLeft = (BranchBlock)blocks[1];\n            var branchBlockY = (BinaryBranchBlock)blocks[2];\n            var condTrue = blocks[3];\n            var condFalse = blocks[4];\n            var after = blocks[5];\n            var exitBlock = cfg.ExitBlock;\n\n            branchBlockX.TrueSuccessorBlock.Should().Be(branchBlockY);\n            branchBlockX.FalseSuccessorBlock.Should().Be(branchBlockXLeft);\n            branchBlockXLeft.SuccessorBlocks.Should().BeEquivalentTo(new[] { condTrue, condFalse });\n            branchBlockY.TrueSuccessorBlock.Should().Be(condTrue);\n            branchBlockY.FalseSuccessorBlock.Should().Be(condFalse);\n\n            condFalse.SuccessorBlocks.Should().Equal(after);\n            condTrue.SuccessorBlocks.Should().Equal(after);\n            after.SuccessorBlocks.Should().Equal(exitBlock);\n\n            VerifyAllInstructions(branchBlockX, \"x\");\n            VerifyAllInstructions(branchBlockXLeft);\n            VerifyAllInstructions(branchBlockY, \"y\");\n            VerifyAllInstructions(condTrue, \"b\");\n            VerifyAllInstructions(condFalse, \"c\");\n            VerifyAllInstructions(after, \"a = (x ?? y) ? b : c\");\n        }\n\n        [TestMethod]\n        public void Cfg_If_Patterns_Constant_Complex_Condition()\n        {\n            var cfg = Build(\"cw0(); if (x is 10 && o is null) { cw1(); } cw2()\");\n\n            VerifyCfg(cfg, 5);\n            var xBranchBlock = (BinaryBranchBlock)cfg.Blocks.ElementAt(0);\n            var oBranchBlock = (BinaryBranchBlock)cfg.Blocks.ElementAt(1);\n            var trueBlock = cfg.Blocks.ElementAt(2);\n            var falseBlock = cfg.Blocks.ElementAt(3);\n            var exitBlock = cfg.ExitBlock;\n\n            xBranchBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { oBranchBlock, falseBlock });\n            xBranchBlock.BranchingNode.Kind().Should().Be(SyntaxKindEx.IsPatternExpression);\n            VerifyAllInstructions(xBranchBlock, \"cw0\", \"cw0()\", \"x\", \"10\", \"x is 10\");\n\n            oBranchBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { trueBlock, falseBlock });\n            oBranchBlock.BranchingNode.Kind().Should().Be(SyntaxKindEx.IsPatternExpression);\n            VerifyAllInstructions(oBranchBlock, \"o\", \"null\", \"o is null\");\n\n            trueBlock.SuccessorBlocks.Should().Equal(falseBlock);\n            VerifyAllInstructions(trueBlock, \"cw1\", \"cw1()\");\n\n            falseBlock.SuccessorBlocks.Should().Equal(exitBlock);\n            VerifyAllInstructions(falseBlock, \"cw2\", \"cw2()\");\n\n            exitBlock.PredecessorBlocks.Should().Equal(falseBlock);\n        }\n\n        [TestMethod]\n        public void Cfg_If_Patterns_Single_Var_Complex_Condition()\n        {\n            var cfg = Build(\"cw0(); if (x is int i && o is string s) { cw1(); } cw2()\");\n\n            VerifyCfg(cfg, 5);\n            var xBranchBlock = (BinaryBranchBlock)cfg.Blocks.ElementAt(0);\n            var oBranchBlock = (BinaryBranchBlock)cfg.Blocks.ElementAt(1);\n            var trueBlock = cfg.Blocks.ElementAt(2);\n            var falseBlock = cfg.Blocks.ElementAt(3);\n            var exitBlock = cfg.ExitBlock;\n\n            xBranchBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { oBranchBlock, falseBlock });\n            xBranchBlock.BranchingNode.Kind().Should().Be(SyntaxKindEx.IsPatternExpression);\n            VerifyAllInstructions(xBranchBlock, \"cw0\", \"cw0()\", \"x\", \"x is int i\");\n\n            oBranchBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { trueBlock, falseBlock });\n            oBranchBlock.BranchingNode.Kind().Should().Be(SyntaxKindEx.IsPatternExpression);\n            VerifyAllInstructions(oBranchBlock, \"o\", \"o is string s\");\n\n            trueBlock.SuccessorBlocks.Should().Equal(falseBlock);\n            VerifyAllInstructions(trueBlock, \"cw1\", \"cw1()\");\n\n            falseBlock.SuccessorBlocks.Should().Equal(exitBlock);\n            VerifyAllInstructions(falseBlock, \"cw2\", \"cw2()\");\n\n            exitBlock.PredecessorBlocks.Should().Equal(falseBlock);\n        }\n\n        [TestMethod]\n        public void Cfg_If_Patterns_Not_Null()\n        {\n            var cfg = Build(\"cw0(); if (!(x is null)) { cw1(); } cw2()\");\n\n            VerifyCfg(cfg, 4);\n            var xBranchBlock = (BinaryBranchBlock)cfg.Blocks.ElementAt(0);\n            var trueBlock = cfg.Blocks.ElementAt(1);\n            var falseBlock = cfg.Blocks.ElementAt(2);\n            var exitBlock = cfg.ExitBlock;\n\n            xBranchBlock.TrueSuccessorBlock.Should().Be(trueBlock);\n            xBranchBlock.FalseSuccessorBlock.Should().Be(falseBlock);\n            xBranchBlock.BranchingNode.Kind().Should().Be(SyntaxKind.LogicalNotExpression);\n            VerifyAllInstructions(xBranchBlock, \"cw0\", \"cw0()\", \"x\", \"null\", \"x is null\", \"!(x is null)\");\n\n            trueBlock.SuccessorBlocks.Should().Equal(falseBlock);\n            VerifyAllInstructions(trueBlock, \"cw1\", \"cw1()\");\n\n            falseBlock.SuccessorBlocks.Should().Equal(exitBlock);\n            VerifyAllInstructions(falseBlock, \"cw2\", \"cw2()\");\n\n            exitBlock.PredecessorBlocks.Should().Equal(falseBlock);\n        }\n\n        #endregion\n\n        #region While statement\n\n        [TestMethod]\n        public void Cfg_While()\n        {\n            var cfg = Build(\"while (true) { var x = 10; }\");\n            VerifyCfg(cfg, 3);\n            var branchBlock = cfg.EntryBlock as BinaryBranchBlock;\n            var loopBodyBlock = cfg.Blocks\n                .First(b => b.Instructions.Any(n => n.ToString() == \"x = 10\"));\n            var exitBlock = cfg.ExitBlock;\n\n            branchBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { loopBodyBlock, exitBlock });\n            branchBlock.BranchingNode.Kind().Should().Be(SyntaxKind.TrueLiteralExpression);\n\n            loopBodyBlock.SuccessorBlocks.Should().Equal(branchBlock);\n            branchBlock.PredecessorBlocks.Should().Equal(loopBodyBlock);\n            exitBlock.PredecessorBlocks.Should().Equal(branchBlock);\n\n            VerifyAllInstructions(branchBlock, \"true\");\n            VerifyAllInstructions(loopBodyBlock, \"10\", \"x = 10\");\n        }\n\n        [TestMethod]\n        public void Cfg_While_ComplexCondition_Or()\n        {\n            var cfg = Build(\"while (a || b) { var x = 10; }\");\n            VerifyCfg(cfg, 4);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var branchBlockA = blocks[0] as BinaryBranchBlock;\n            var branchBlockB = blocks[1] as BinaryBranchBlock;\n            var loopBodyBlock = blocks[2];\n            var exitBlock = cfg.ExitBlock;\n\n            branchBlockA.TrueSuccessorBlock.Should().Be(loopBodyBlock);\n            branchBlockA.FalseSuccessorBlock.Should().Be(branchBlockB);\n\n            branchBlockB.TrueSuccessorBlock.Should().Be(loopBodyBlock);\n            branchBlockB.FalseSuccessorBlock.Should().Be(exitBlock);\n\n            loopBodyBlock.SuccessorBlocks.Should().Equal(branchBlockA);\n\n            exitBlock.PredecessorBlocks.Should().Equal(branchBlockB);\n\n            VerifyAllInstructions(branchBlockA, \"a\");\n            VerifyAllInstructions(branchBlockB, \"b\");\n            VerifyAllInstructions(loopBodyBlock, \"10\", \"x = 10\");\n        }\n\n        [TestMethod]\n        public void Cfg_While_ComplexCondition_And()\n        {\n            var cfg = Build(\"while (a && b) { var x = 10; }\");\n\n            VerifyCfg(cfg, 4);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var branchBlockA = blocks[0] as BinaryBranchBlock;\n            var branchBlockB = blocks[1] as BinaryBranchBlock;\n            var loopBodyBlock = blocks[2];\n            var exitBlock = cfg.ExitBlock;\n\n            branchBlockA.TrueSuccessorBlock.Should().Be(branchBlockB);\n            branchBlockA.FalseSuccessorBlock.Should().Be(exitBlock);\n\n            branchBlockB.TrueSuccessorBlock.Should().Be(loopBodyBlock);\n            branchBlockB.FalseSuccessorBlock.Should().Be(exitBlock);\n\n            loopBodyBlock.SuccessorBlocks.Should().Equal(branchBlockA);\n\n            exitBlock.PredecessorBlocks.Should().BeEquivalentTo(new[] { branchBlockB, branchBlockA });\n\n            VerifyAllInstructions(branchBlockA, \"a\");\n            VerifyAllInstructions(branchBlockB, \"b\");\n            VerifyAllInstructions(loopBodyBlock, \"10\", \"x = 10\");\n        }\n\n        [TestMethod]\n        public void Cfg_NestedWhile()\n        {\n            var cfg = Build(\"while (true) while(false) { var x = 10; }\");\n            VerifyCfg(cfg, 4);\n            var firstBranchBlock = cfg.EntryBlock as BinaryBranchBlock;\n            firstBranchBlock.Instructions.Should().Contain(n => n.IsKind(SyntaxKind.TrueLiteralExpression));\n            var blocks = cfg.Blocks.ToList();\n            var loopBodyBlock = blocks\n                .First(b => b.Instructions.Any(n => n.ToString() == \"x = 10\"));\n            var secondBranchBlock = blocks[1] as BinaryBranchBlock;\n            secondBranchBlock.Instructions.Should().Contain(n => n.IsKind(SyntaxKind.FalseLiteralExpression));\n            var exitBlock = cfg.ExitBlock;\n\n            firstBranchBlock.SuccessorBlocks.Should().BeEquivalentTo(new Block[] { secondBranchBlock, exitBlock });\n            firstBranchBlock.BranchingNode.Kind().Should().Be(SyntaxKind.TrueLiteralExpression);\n\n            secondBranchBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { loopBodyBlock, firstBranchBlock });\n            secondBranchBlock.BranchingNode.Kind().Should().Be(SyntaxKind.FalseLiteralExpression);\n\n            loopBodyBlock.SuccessorBlocks.Should().Equal(secondBranchBlock);\n            firstBranchBlock.PredecessorBlocks.Should().Equal(secondBranchBlock);\n            secondBranchBlock.PredecessorBlocks.Should().BeEquivalentTo(new[] { firstBranchBlock, loopBodyBlock });\n            exitBlock.PredecessorBlocks.Should().Equal(firstBranchBlock);\n        }\n\n        #endregion\n\n        #region Do statement\n\n        [TestMethod]\n        public void Cfg_DoWhile_ComplexCondition()\n        {\n            var cfg = Build(\"do { var x = 10; } while (a || b);\");\n            VerifyCfg(cfg, 4);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var loopBodyBlock = blocks[0];\n            var branchBlockA = (BinaryBranchBlock)blocks[1];\n            var branchBlockB = (BinaryBranchBlock)blocks[2];\n            var exitBlock = cfg.ExitBlock;\n\n            loopBodyBlock.SuccessorBlocks.Should().Equal(branchBlockA);\n            branchBlockA.TrueSuccessorBlock.Should().Be(loopBodyBlock);\n            branchBlockA.FalseSuccessorBlock.Should().Be(branchBlockB);\n            branchBlockB.TrueSuccessorBlock.Should().Be(loopBodyBlock);\n            branchBlockB.FalseSuccessorBlock.Should().Be(exitBlock);\n\n            exitBlock.PredecessorBlocks.Should().Equal(branchBlockB);\n\n            VerifyAllInstructions(loopBodyBlock, \"10\", \"x = 10\");\n        }\n\n        [TestMethod]\n        public void Cfg_DoWhile()\n        {\n            var cfg = Build(\"do { var x = 10; } while (true);\");\n            VerifyCfg(cfg, 3);\n            var branchBlock = cfg.Blocks.ToList()[1] as BinaryBranchBlock;\n            var loopBodyBlock = cfg.EntryBlock;\n            var exitBlock = cfg.ExitBlock;\n\n            loopBodyBlock.SuccessorBlocks.Should().Equal(branchBlock);\n\n            branchBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { loopBodyBlock, exitBlock });\n            branchBlock.BranchingNode.Kind().Should().Be(SyntaxKind.TrueLiteralExpression);\n\n            branchBlock.PredecessorBlocks.Should().Equal(loopBodyBlock);\n            exitBlock.PredecessorBlocks.Should().Equal(new[] { branchBlock });\n\n            VerifyAllInstructions(loopBodyBlock, \"10\", \"x = 10\");\n            VerifyAllInstructions(branchBlock, \"true\");\n        }\n\n        [TestMethod]\n        public void Cfg_NestedDoWhile()\n        {\n            var cfg = Build(\"do { do { var x = 10; } while (false); } while (true);\");\n            VerifyCfg(cfg, 4);\n            var blocks = cfg.Blocks.ToList();\n            var loopBodyBlock = cfg.EntryBlock;\n            var falseBranchBlock = blocks[1] as BinaryBranchBlock;\n            falseBranchBlock.Instructions.Should().Contain(n => n.IsKind(SyntaxKind.FalseLiteralExpression));\n            var trueBranchBlock = blocks[2] as BinaryBranchBlock;\n            trueBranchBlock.Instructions.Should().Contain(n => n.IsKind(SyntaxKind.TrueLiteralExpression));\n            var exitBlock = cfg.ExitBlock;\n\n            loopBodyBlock.SuccessorBlocks.Should().Equal(falseBranchBlock);\n\n            falseBranchBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { loopBodyBlock, trueBranchBlock });\n            falseBranchBlock.BranchingNode.Kind().Should().Be(SyntaxKind.FalseLiteralExpression);\n\n            trueBranchBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { loopBodyBlock, exitBlock });\n            trueBranchBlock.BranchingNode.Kind().Should().Be(SyntaxKind.TrueLiteralExpression);\n\n            falseBranchBlock.PredecessorBlocks.Should().Equal(loopBodyBlock);\n            trueBranchBlock.PredecessorBlocks.Should().Equal(falseBranchBlock);\n            exitBlock.PredecessorBlocks.Should().Equal(trueBranchBlock);\n        }\n\n        [TestMethod]\n        public void Cfg_DoWhile_Continue()\n        {\n            var cfg = Build(@\"\n                int p;\n                do\n                {\n                    p = unknown();\n                    if (unknown())\n                    {\n                        p = 0;\n                        continue;\n                    }\n                } while (!p);\");\n\n            VerifyCfg(cfg, 5);\n\n            var blocks = cfg.Blocks.ToArray();\n\n            var defBlock = blocks[0];\n            var ifBlock = blocks[1] as BinaryBranchBlock;\n            var continueJump = blocks[2] as JumpBlock;\n            var doCondition = blocks[3] as BinaryBranchBlock;\n            var exitBlock = blocks[4];\n\n            defBlock.Should().Be(cfg.EntryBlock);\n            defBlock.SuccessorBlocks.Should().Equal(ifBlock);\n            VerifyAllInstructions(defBlock, \"p\");\n\n            ifBlock.SuccessorBlocks.Should().BeEquivalentTo(new Block[] { continueJump, doCondition });\n            ifBlock.BranchingNode.Kind().Should().Be(SyntaxKind.InvocationExpression);\n            VerifyAllInstructions(ifBlock, \"unknown\", \"unknown()\", \"p = unknown()\", \"unknown\", \"unknown()\");\n\n            continueJump.SuccessorBlocks.Should().Equal(doCondition);\n            continueJump.JumpNode.Kind().Should().Be(SyntaxKind.ContinueStatement);\n            VerifyAllInstructions(continueJump, \"0\", \"p = 0\");\n\n            doCondition.SuccessorBlocks.Should().BeEquivalentTo(new[] { ifBlock, exitBlock });\n            doCondition.BranchingNode.Kind().Should().Be(SyntaxKind.LogicalNotExpression);\n            VerifyAllInstructions(doCondition, \"p\", \"!p\");\n\n            exitBlock.Should().Be(cfg.ExitBlock);\n        }\n\n        #endregion\n\n        #region Foreach statement\n\n        [TestMethod]\n        public void Cfg_Foreach()\n        {\n            var cfg = Build(\"foreach (var item in collection) { var x = 10; }\");\n            VerifyCfg(cfg, 4);\n            var collectionBlock = cfg.EntryBlock as ForeachCollectionProducerBlock;\n            collectionBlock.Should().NotBeNull();\n            var blocks = cfg.Blocks.ToList();\n            var foreachBlock = blocks[1] as BinaryBranchBlock;\n            var loopBodyBlock = blocks\n                .First(b => b.Instructions.Any(n => n.ToString() == \"x = 10\"));\n            var exitBlock = cfg.ExitBlock;\n\n            collectionBlock.SuccessorBlocks.Should().Contain(foreachBlock);\n\n            foreachBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { loopBodyBlock, exitBlock });\n            foreachBlock.BranchingNode.Kind().Should().Be(SyntaxKind.ForEachStatement);\n\n            loopBodyBlock.SuccessorBlocks.Should().Equal(foreachBlock);\n            exitBlock.PredecessorBlocks.Should().Equal(foreachBlock);\n\n            VerifyAllInstructions(collectionBlock, \"collection\");\n            VerifyNoInstruction(foreachBlock);\n        }\n\n        [TestMethod]\n        public void Cfg_NestedForeach()\n        {\n            var cfg = Build(\"foreach (var item1 in collection1) { foreach (var item2 in collection2) { var x = 10; } }\");\n            VerifyCfg(cfg, 6);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var collection1Block = cfg.EntryBlock;\n            var foreach1Block = blocks[1] as BinaryBranchBlock;\n\n            var collection2Block = blocks[2];\n            var foreach2Block = blocks[3] as BinaryBranchBlock;\n\n            var loopBodyBlock = blocks\n                .First(b => b.Instructions.Any(n => n.ToString() == \"x = 10\"));\n\n            var exitBlock = cfg.ExitBlock;\n\n            collection1Block.Instructions.Should().Contain(n => n.ToString() == \"collection1\");\n            collection2Block.Instructions.Should().Contain(n => n.ToString() == \"collection2\");\n\n            collection1Block.SuccessorBlocks.Should().Contain(foreach1Block);\n\n            foreach1Block.SuccessorBlocks.Should().BeEquivalentTo(new[] { collection2Block, exitBlock });\n            foreach1Block.BranchingNode.Kind().Should().Be(SyntaxKind.ForEachStatement);\n\n            collection2Block.SuccessorBlocks.Should().Contain(foreach2Block);\n\n            foreach2Block.SuccessorBlocks.Should().BeEquivalentTo(new[] { loopBodyBlock, foreach1Block });\n            foreach2Block.BranchingNode.Kind().Should().Be(SyntaxKind.ForEachStatement);\n\n            loopBodyBlock.SuccessorBlocks.Should().Equal(foreach2Block);\n            exitBlock.PredecessorBlocks.Should().Equal(foreach1Block);\n        }\n\n        [TestMethod]\n        public void Cfg_Foreach_VarDeclaration()\n        {\n            var cfg = Build(\"foreach (var (key, value) in collection) { string j = value; } \");\n            VerifyCfg(cfg, 4);\n\n            var allBlocks = cfg.Blocks.ToList();\n\n            var forEachCollectionBlock = cfg.EntryBlock as ForeachCollectionProducerBlock;\n\n            forEachCollectionBlock.Should().NotBeNull();\n            VerifyAllInstructions(forEachCollectionBlock, \"collection\");\n\n            var foreachBlock = allBlocks[1] as BinaryBranchBlock;\n            VerifyNoInstruction(foreachBlock);\n\n            var loopBodyBlock = allBlocks[2] as SimpleBlock;\n            VerifyAllInstructions(loopBodyBlock, \"value\", \"j = value\");\n\n            var exitBlock = cfg.ExitBlock;\n\n            forEachCollectionBlock.SuccessorBlocks.Should().Contain(foreachBlock);\n\n            foreachBlock.SuccessorBlocks.Should().BeEquivalentTo(new Block[] { loopBodyBlock, exitBlock });\n            foreachBlock.BranchingNode.Kind().Should().Be(SyntaxKind.ForEachVariableStatement);\n\n            loopBodyBlock.SuccessorBlocks.Should().Equal(foreachBlock);\n\n            exitBlock.PredecessorBlocks.Should().Equal(foreachBlock);\n        }\n\n        [TestMethod]\n        public void Cfg_Foreach_AsyncStream()\n        {\n            var cfg = Build(\"await foreach (var number in GetAsync()) { var x = 10; }\");\n\n            VerifyCfg(cfg, 4);\n            var collectionBlock = cfg.EntryBlock as ForeachCollectionProducerBlock;\n            var blocks = cfg.Blocks.ToList();\n            var foreachBlock = (BinaryBranchBlock)blocks[1];\n            var loopBodyBlock = blocks[2];\n            var exitBlock = cfg.ExitBlock;\n\n            collectionBlock.SuccessorBlocks.Should().Contain(foreachBlock);\n            VerifyAllInstructions(collectionBlock, \"GetAsync\", \"GetAsync()\");\n\n            foreachBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { loopBodyBlock, exitBlock });\n            foreachBlock.BranchingNode.Kind().Should().Be(SyntaxKind.ForEachStatement);\n            VerifyNoInstruction(foreachBlock);\n\n            loopBodyBlock.SuccessorBlocks.Should().Equal(foreachBlock);\n            VerifyAllInstructions(loopBodyBlock, \"10\", \"x = 10\");\n\n            exitBlock.PredecessorBlocks.Should().Equal(foreachBlock);\n        }\n\n        #endregion\n\n        #region For statement\n\n        [TestMethod]\n        public void Cfg_For()\n        {\n            var cfg = Build(\"for (var i = 0; true; i++) { var x = 10; }\");\n            VerifyForStatement(cfg);\n            VerifyAllInstructions(cfg.EntryBlock, \"0\", \"i = 0\");\n            var condition = cfg.EntryBlock.SuccessorBlocks[0];\n            VerifyAllInstructions(condition, \"true\");\n            var body = condition.SuccessorBlocks[0];\n            VerifyAllInstructions(condition.SuccessorBlocks[0], \"10\", \"x = 10\");\n            VerifyAllInstructions(body.SuccessorBlocks[0], \"i\", \"i++\");\n\n            cfg = Build(\"var y = 11; for (var i = 0; true; i++) { var x = 10; }\");\n            VerifyForStatement(cfg);\n\n            cfg = Build(\"for (var i = 0; ; i++) { var x = 10; }\");\n            VerifyForStatement(cfg);\n\n            cfg = Build(\"for (i = 0, j = 11; ; i++) { var x = 10; }\");\n            VerifyForStatement(cfg);\n            cfg.EntryBlock.Should().BeAssignableTo<ForInitializerBlock>();\n        }\n\n        [TestMethod]\n        public void Cfg_For_NoInitializer()\n        {\n            var cfg = Build(\"for (; true; i++) { var x = 10; }\");\n            VerifyForStatementNoInitializer(cfg);\n\n            cfg = Build(\"for (; ; i++) { var x = 10; }\");\n            VerifyForStatementNoInitializer(cfg);\n        }\n\n        [TestMethod]\n        public void Cfg_For_NoIncrementor()\n        {\n            var cfg = Build(\"for (var i = 0; true;) { var x = 10; }\");\n            VerifyForStatementNoIncrementor(cfg);\n\n            cfg = Build(\"for (var i = 0; ;) { var x = 10; }\");\n            VerifyForStatementNoIncrementor(cfg);\n        }\n\n        [TestMethod]\n        public void Cfg_For_Empty()\n        {\n            var cfg = Build(\"for (; true;) { var x = 10; }\");\n            VerifyForStatementEmpty(cfg);\n\n            cfg = Build(\"for (;;) { var x = 10; }\");\n            VerifyForStatementEmpty(cfg);\n        }\n\n        [TestMethod]\n        public void Cfg_NestedFor()\n        {\n            var cfg = Build(\"for (var i = 0; true; i++) { for (var j = 0; false; j++) { var x = 10; } }\");\n            VerifyCfg(cfg, 8);\n            var initBlockI = cfg.EntryBlock;\n            var blocks = cfg.Blocks.ToList();\n            var branchBlockTrue = blocks\n                .First(b => b.Instructions.Any(n => n.ToString() == \"true\")) as BinaryBranchBlock;\n            var incrementorBlockI = blocks\n                .First(b => b.Instructions.Any(n => n.ToString() == \"i++\"));\n\n            var branchBlockFalse = blocks\n                .First(b => b.Instructions.Any(n => n.ToString() == \"false\")) as BinaryBranchBlock;\n            var incrementorBlockJ = blocks\n                .First(b => b.Instructions.Any(n => n.ToString() == \"j++\"));\n            var initBlockJ = blocks\n                .First(b => b.Instructions.Any(n => n.ToString() == \"j = 0\"));\n\n            var loopBodyBlock = blocks\n                .First(b => b.Instructions.Any(n => n.ToString() == \"x = 10\"));\n            var exitBlock = cfg.ExitBlock;\n\n            initBlockI.SuccessorBlocks.Should().Equal(branchBlockTrue);\n\n            branchBlockTrue.SuccessorBlocks.Should().BeEquivalentTo(new[] { initBlockJ, exitBlock });\n            branchBlockTrue.BranchingNode.Kind().Should().Be(SyntaxKind.ForStatement);\n\n            initBlockJ.SuccessorBlocks.Should().Equal(branchBlockFalse);\n\n            branchBlockFalse.SuccessorBlocks.Should().BeEquivalentTo(new[] { loopBodyBlock, incrementorBlockI });\n            branchBlockFalse.BranchingNode.Kind().Should().Be(SyntaxKind.ForStatement);\n\n            loopBodyBlock.SuccessorBlocks.Should().Equal(incrementorBlockJ);\n            incrementorBlockJ.SuccessorBlocks.Should().Equal(branchBlockFalse);\n            incrementorBlockI.SuccessorBlocks.Should().Equal(branchBlockTrue);\n\n            exitBlock.PredecessorBlocks.Should().Equal(branchBlockTrue);\n        }\n\n        #endregion\n\n        #region Return, throw, yield break statement\n\n        [TestMethod]\n        public void Cfg_Return()\n        {\n            var cfg = Build($\"if (true) {{ var y = 12; {SimpleReturn}; }} var x = 11;\");\n            VerifyJumpWithNoExpression(cfg, SyntaxKind.ReturnStatement);\n\n            cfg = Build($\"if (true) {{ {SimpleReturn}; }} var x = 11;\");\n            VerifyJumpWithNoExpression(cfg, SyntaxKind.ReturnStatement);\n        }\n\n        [TestMethod]\n        public void Cfg_Throw_Statement_InvalidThrow()\n        {\n            var cfg = Build($\"if (true) {{ var y = 12; {SimpleThrow}; }} var x = 11;\");\n            VerifyJumpWithNoExpression(cfg, SyntaxKind.ThrowStatement);\n\n            cfg = Build($\"if (true) {{ {SimpleThrow}; }} var x = 11;\");\n            VerifyJumpWithNoExpression(cfg, SyntaxKind.ThrowStatement);\n        }\n\n        [TestMethod]\n        public void Cfg_Throw_Statement()\n        {\n            var throwException = \"throw new InvalidOperationException(\\\"\\\")\";\n            var cfg = Build($\"if (true) {{ var y = 12; {throwException}; }} var x = 11;\");\n            VerifyJumpWithNoExpression(cfg, SyntaxKind.ThrowStatement);\n\n            cfg = Build($\"if (true) {{ {throwException}; }} var x = 11;\");\n            VerifyJumpWithNoExpression(cfg, SyntaxKind.ThrowStatement);\n        }\n\n        [TestMethod]\n        public void Cfg_YieldBreak()\n        {\n            var cfg = Build($\"if (true) {{ var y = 12; {SimpleYieldBreak}; }} var x = 11;\");\n            VerifyJumpWithNoExpression(cfg, SyntaxKind.YieldBreakStatement);\n\n            cfg = Build($\"if (true) {{ {SimpleYieldBreak}; }} var x = 11;\");\n            VerifyJumpWithNoExpression(cfg, SyntaxKind.YieldBreakStatement);\n        }\n\n        [TestMethod]\n        public void Cfg_Return_Value()\n        {\n            var cfg = Build($\"if (true) {{ var y = 12; {ExpressionReturn}; }} var x = 11;\");\n            VerifyJumpWithExpression(cfg, SyntaxKind.ReturnStatement);\n        }\n\n        [TestMethod]\n        public void Cfg_Return_JustBeforeExit()\n        {\n            var cfg = Build(@\"\n            return;\n            cw0();\n            return;\");\n\n            VerifyCfg(cfg, 3);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var block1 = (JumpBlock)blocks[0];\n            var block2 = (SimpleBlock)blocks[1];\n            var exit = (ExitBlock)blocks.Last();\n\n            block1.Instructions.Should().BeEmpty();\n            block1.SuccessorBlocks.Should().Equal(exit);\n\n            VerifyAllInstructions(block2, \"cw0\", \"cw0()\");\n            block2.SuccessorBlocks.Should().Equal(exit);\n        }\n\n        [TestMethod]\n        public void Cfg_Throw_Value()\n        {\n            var cfg = Build($\"if (true) {{ var y = 12; {ExpressionThrow}; }} var x = 11;\");\n            VerifyJumpWithExpression(cfg, SyntaxKind.ThrowStatement);\n        }\n\n        #endregion\n\n        #region Lock statement\n\n        [TestMethod]\n        public void Cfg_Lock()\n        {\n            var cfg = Build(\"lock(this) { var x = 10; }\");\n\n            VerifyCfg(cfg, 3);\n            var lockBlock = cfg.EntryBlock as LockBlock;\n            var bodyBlock = cfg.Blocks.Skip(1).First();\n            var exitBlock = cfg.ExitBlock;\n\n            lockBlock.SuccessorBlocks.Should().Equal(bodyBlock);\n            bodyBlock.SuccessorBlocks.Should().Equal(exitBlock);\n\n            lockBlock.LockNode.Kind().Should().Be(SyntaxKind.LockStatement);\n\n            VerifyAllInstructions(cfg.EntryBlock, \"this\");\n        }\n\n        [TestMethod]\n        public void Cfg_NestedLock()\n        {\n            var cfg = Build(\"lock(this) { lock(that) { var x = 10; }}\");\n            VerifyCfg(cfg, 4);\n            var lockBlock = cfg.EntryBlock as LockBlock;\n            var innerLockBlock = cfg.Blocks.Skip(1).First() as LockBlock;\n            var bodyBlock = cfg.Blocks.Skip(2).First();\n            var exitBlock = cfg.ExitBlock;\n\n            lockBlock.SuccessorBlocks.Should().Equal(innerLockBlock);\n            innerLockBlock.SuccessorBlocks.Should().Equal(bodyBlock);\n            bodyBlock.SuccessorBlocks.Should().Equal(exitBlock);\n\n            lockBlock.LockNode.Kind().Should().Be(SyntaxKind.LockStatement);\n            lockBlock.Instructions.Should().Contain(n => n.IsKind(SyntaxKind.ThisExpression));\n\n            innerLockBlock.LockNode.Kind().Should().Be(SyntaxKind.LockStatement);\n            innerLockBlock.Instructions.Should().Contain(n => n.IsKind(SyntaxKind.IdentifierName) && n.ToString() == \"that\");\n        }\n\n        #endregion\n\n        #region Using statement\n\n        [TestMethod]\n        public void Cfg_UsingDeclaration()\n        {\n            var cfg = Build(\"using(var stream = new MemoryStream()) { var x = 10; }\");\n            VerifySimpleJumpBlock(cfg, SyntaxKind.UsingStatement);\n\n            VerifyAllInstructions(cfg.EntryBlock, \"new MemoryStream()\", \"stream = new MemoryStream()\");\n\n            var usingBlock = cfg.Blocks.Skip(1).First() as UsingEndBlock;\n            usingBlock.Should().NotBeNull();\n            usingBlock.Identifiers.Select(n => n.ValueText).Should().Equal(new[] { \"stream\" });\n            usingBlock.Should().BeOfType<UsingEndBlock>();\n        }\n\n        [TestMethod]\n        public void Cfg_UsingAssignment()\n        {\n            var cfg = Build(\"Stream stream; using(stream = new MemoryStream()) { var x = 10; }\");\n            VerifySimpleJumpBlock(cfg, SyntaxKind.UsingStatement);\n\n            VerifyAllInstructions(cfg.EntryBlock, \"stream\", \"new MemoryStream()\", \"stream = new MemoryStream()\");\n\n            var usingBlock = cfg.Blocks.Skip(1).First() as UsingEndBlock;\n            usingBlock.Should().NotBeNull();\n            usingBlock.Identifiers.Select(n => n.ValueText).Should().Equal(new[] { \"stream\" });\n            usingBlock.Should().BeOfType<UsingEndBlock>();\n        }\n\n        [TestMethod]\n        public void Cfg_UsingExpression()\n        {\n            var cfg = Build(\"using(new MemoryStream()) { var x = 10; }\");\n            VerifySimpleJumpBlock(cfg, SyntaxKind.UsingStatement);\n\n            VerifyAllInstructions(cfg.EntryBlock, \"new MemoryStream()\");\n        }\n\n        [TestMethod]\n        public void Cfg_UsingLocalDeclaration()\n        {\n            var cfg = Build(\"using var stream = new MemoryStream();\");\n\n            VerifyCfg(cfg, 2);\n            cfg.EntryBlock.Should().BeOfType<SimpleBlock>();\n            VerifyAllInstructions(cfg.EntryBlock, \"new MemoryStream()\", \"stream = new MemoryStream()\");\n        }\n\n        #endregion\n\n        #region Fixed statement\n\n        [TestMethod]\n        public void Cfg_Fixed()\n        {\n            var cfg = Build(\"fixed (int* p = &pt.x) { *p = 1; }\");\n            VerifySimpleJumpBlock(cfg, SyntaxKind.FixedStatement);\n\n            VerifyAllInstructions(cfg.EntryBlock, \"pt\", \"pt.x\", \"&pt.x\", \"p = &pt.x\");\n        }\n\n        #endregion\n\n        #region Checked/unchecked statement\n\n        [TestMethod]\n        public void Cfg_Checked()\n        {\n            var cfg = Build(\"checked { var i = int.MaxValue + 1; }\");\n            VerifySimpleJumpBlock(cfg, SyntaxKind.CheckedStatement);\n\n            VerifyNoInstruction(cfg.EntryBlock);\n            VerifyInstructions(cfg.EntryBlock.SuccessorBlocks[0], 1, \"int.MaxValue\");\n\n            cfg = Build(\"unchecked { var i = int.MaxValue + 1; }\");\n            VerifySimpleJumpBlock(cfg, SyntaxKind.UncheckedStatement);\n\n            VerifyNoInstruction(cfg.EntryBlock);\n            VerifyInstructions(cfg.EntryBlock.SuccessorBlocks[0], 1, \"int.MaxValue\");\n        }\n\n        #endregion\n\n        #region Unsafe statement\n\n        [TestMethod]\n        public void Cfg_Unsafe()\n        {\n            var cfg = Build(\"unsafe { int* p = &i; *p *= *p; }\");\n            VerifySimpleJumpBlock(cfg, SyntaxKind.UnsafeStatement);\n\n            VerifyNoInstruction(cfg.EntryBlock);\n            VerifyInstructions(cfg.EntryBlock.SuccessorBlocks[0], 0, \"i\");\n        }\n\n        #endregion\n\n        #region Logical && and ||\n\n        [TestMethod]\n        public void Cfg_LogicalAnd()\n        {\n            var cfg = Build(\"var b = a && c;\");\n            VerifyCfg(cfg, 4);\n\n            var branchBlock = cfg.EntryBlock as BinaryBranchBlock;\n            var blocks = cfg.Blocks.ToList();\n            var trueABlock = blocks[1];\n            var afterOp = blocks[2];\n            var exitBlock = cfg.ExitBlock;\n\n            branchBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { trueABlock, afterOp });\n            trueABlock.SuccessorBlocks.Should().Equal(afterOp);\n            afterOp.SuccessorBlocks.Should().Equal(exitBlock);\n\n            branchBlock.BranchingNode.Kind().Should().Be(SyntaxKind.LogicalAndExpression);\n\n            VerifyAllInstructions(branchBlock, \"a\");\n            VerifyAllInstructions(trueABlock, \"c\");\n            VerifyAllInstructions(afterOp, \"b = a && c\");\n        }\n\n        [TestMethod]\n        public void Cfg_LogicalOr()\n        {\n            var cfg = Build(\"var b = a || c;\");\n            VerifyCfg(cfg, 4);\n\n            var branchBlock = cfg.EntryBlock as BinaryBranchBlock;\n            var blocks = cfg.Blocks.ToList();\n            var falseABlock = blocks[1];\n            var afterOp = blocks[2];\n            var exitBlock = cfg.ExitBlock;\n\n            branchBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { afterOp, falseABlock });\n            falseABlock.SuccessorBlocks.Should().Equal(afterOp);\n            afterOp.SuccessorBlocks.Should().Equal(exitBlock);\n\n            branchBlock.BranchingNode.Kind().Should().Be(SyntaxKind.LogicalOrExpression);\n\n            VerifyAllInstructions(branchBlock, \"a\");\n            VerifyAllInstructions(falseABlock, \"c\");\n            VerifyAllInstructions(afterOp, \"b = a || c\");\n        }\n\n        [TestMethod]\n        public void Cfg_LogicalAnd_Multiple()\n        {\n            var cfg = Build(\"var b = a && c && d;\");\n            VerifyCfg(cfg, 6);\n\n            var branchBlock = cfg.EntryBlock as BinaryBranchBlock;\n            var blocks = cfg.Blocks.ToList();\n            var trueABlock = blocks[1];\n            var afterAC = blocks[2] as BinaryBranchBlock;\n            var trueACBlock = blocks[3];\n            var afterOp = blocks[4];\n            var exitBlock = cfg.ExitBlock;\n\n            branchBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { trueABlock, afterAC });\n            trueABlock.SuccessorBlocks.Should().Equal(afterAC);\n            afterAC.SuccessorBlocks.Should().BeEquivalentTo(new[] { trueACBlock, afterOp });\n            trueACBlock.SuccessorBlocks.Should().Equal(afterOp);\n            afterOp.SuccessorBlocks.Should().Equal(exitBlock);\n        }\n\n        [TestMethod]\n        public void Cfg_LogicalAnd_With_For()\n        {\n            var cfg = Build(\"for(x = 10; a && c; y++) { var z = 11; }\");\n            VerifyCfg(cfg, 7);\n\n            var initBlock = cfg.EntryBlock;\n            var blocks = cfg.Blocks.ToList();\n            var aBlock = blocks\n                .First(b => b.Instructions.Any(n => n.ToString() == \"a\")) as BinaryBranchBlock;\n            var cBlock = blocks\n                .First(b => b.Instructions.Any(n => n.ToString() == \"c\"));\n            var acBlock = blocks[3] as BinaryBranchBlock;\n            var bodyBlock = blocks\n                .First(b => b.Instructions.Any(n => n.ToString() == \"z = 11\"));\n            var incrementBlock = blocks\n                .First(b => b.Instructions.Any(n => n.ToString() == \"y++\"));\n            var exitBlock = cfg.ExitBlock;\n\n            initBlock.SuccessorBlocks.Should().Equal(aBlock);\n            aBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { cBlock, acBlock });\n            cBlock.SuccessorBlocks.Should().Equal(acBlock);\n            acBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { bodyBlock, exitBlock });\n            bodyBlock.SuccessorBlocks.Should().Equal(incrementBlock);\n            incrementBlock.SuccessorBlocks.Should().Equal(aBlock);\n\n            acBlock.Instructions.Should().BeEmpty();\n        }\n\n        #endregion\n\n        #region Coalesce expression\n\n        [TestMethod]\n        public void Cfg_Coalesce()\n        {\n            var cfg = Build(\"var a = b ?? c;\");\n            VerifyCfg(cfg, 4);\n            var branchBlock = (BinaryBranchBlock)cfg.EntryBlock;\n            var blocks = cfg.Blocks.ToList();\n            var bNullBlock = blocks[1];\n            var assignmentBlock = blocks[2];\n            var exitBlock = cfg.ExitBlock;\n\n            branchBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { bNullBlock, assignmentBlock });\n            bNullBlock.SuccessorBlocks.Should().Equal(assignmentBlock);\n            assignmentBlock.SuccessorBlocks.Should().Equal(exitBlock);\n\n            branchBlock.BranchingNode.Kind().Should().Be(SyntaxKind.CoalesceExpression);\n\n            VerifyAllInstructions(branchBlock, \"b\");\n            VerifyAllInstructions(bNullBlock, \"c\");\n            VerifyAllInstructions(assignmentBlock, \"a = b ?? c\");\n        }\n\n        [TestMethod]\n        public void Cfg_Coalesce_Self()\n        {\n            var cfg = Build(\"a = a ?? c;\");\n            VerifyCfg(cfg, 4);\n\n            var branchBlock = (BinaryBranchBlock)cfg.EntryBlock;\n            var blocks = cfg.Blocks.ToList();\n            var bNullBlock = blocks[1];\n            var afterOp = blocks[2];\n            var exitBlock = cfg.ExitBlock;\n\n            branchBlock.TrueSuccessorBlock.Should().Be(bNullBlock);\n            branchBlock.FalseSuccessorBlock.Should().Be(afterOp);\n            branchBlock.BranchingNode.Kind().Should().Be(SyntaxKind.CoalesceExpression);\n\n            bNullBlock.SuccessorBlocks.Should().Equal(afterOp);\n\n            afterOp.SuccessorBlocks.Should().Equal(exitBlock);\n\n            VerifyAllInstructions(branchBlock, \"a\");\n            VerifyAllInstructions(bNullBlock, \"c\");\n            VerifyAllInstructions(afterOp, \"a = a ?? c\");\n        }\n\n        [TestMethod]\n        public void Cfg_Coalesce_Multiple()\n        {\n            var cfg = Build(\"var a = b ?? c ?? d;\");\n            VerifyCfg(cfg, 5);\n\n            var bBlock = (BinaryBranchBlock)cfg.EntryBlock;\n            var blocks = cfg.Blocks.ToList();\n            var cBlock = (BinaryBranchBlock)blocks[1];\n            var dBlock = blocks[2];\n            var bcdBlock = blocks[3];   // b ?? c ?? d\n            var exitBlock = cfg.ExitBlock;\n\n            bBlock.TrueSuccessorBlock.Should().Be(cBlock);\n            bBlock.FalseSuccessorBlock.Should().Be(bcdBlock);\n            bBlock.Instructions.Should().ContainSingle(\"b\");\n            bBlock.BranchingNode.Kind().Should().Be(SyntaxKind.CoalesceExpression);\n\n            cBlock.TrueSuccessorBlock.Should().Be(dBlock);\n            cBlock.FalseSuccessorBlock.Should().Be(bcdBlock);\n            cBlock.Instructions.Should().ContainSingle(\"c\");\n            cBlock.BranchingNode.Kind().Should().Be(SyntaxKind.CoalesceExpression);\n\n            dBlock.SuccessorBlocks.Should().Equal(bcdBlock);\n            dBlock.Instructions.Should().ContainSingle(\"d\");\n\n            bcdBlock.SuccessorBlocks.Should().Equal(exitBlock);\n            bcdBlock.Instructions.Should().ContainSingle(\"a = b ?? c ?? d\");\n        }\n\n        [TestMethod]\n        public void Cfg_Coalesce_MultipleAssignments()\n        {\n            var cfg = Build(\"a = a ?? (b = b ?? c);\");\n            VerifyCfg(cfg, 6);\n\n            var firstBranchBlockWithA = (BinaryBranchBlock)cfg.EntryBlock;\n            var blocks = cfg.Blocks.ToList();\n            var secondBranchBlockWithB = (BinaryBranchBlock)blocks[1];\n            var simpleBlockWithC = (SimpleBlock)blocks[2];\n            var simpleBlockWithAssignmentToB = (SimpleBlock)blocks[3];\n            var simpleBlockWithFullExpression = (SimpleBlock)blocks[4];\n            var exitBlock = cfg.ExitBlock;\n\n            firstBranchBlockWithA.TrueSuccessorBlock.Should().Be(secondBranchBlockWithB);\n            firstBranchBlockWithA.FalseSuccessorBlock.Should().Be(simpleBlockWithFullExpression);\n            firstBranchBlockWithA.Instructions.Should().ContainSingle(\"a\");\n            firstBranchBlockWithA.BranchingNode.Kind().Should().Be(SyntaxKind.CoalesceExpression);\n\n            secondBranchBlockWithB.TrueSuccessorBlock.Should().Be(simpleBlockWithC);\n            secondBranchBlockWithB.FalseSuccessorBlock.Should().Be(simpleBlockWithAssignmentToB);\n            secondBranchBlockWithB.Instructions.Should().ContainSingle(\"b\");\n            secondBranchBlockWithB.BranchingNode.Kind().Should().Be(SyntaxKind.CoalesceExpression);\n\n            simpleBlockWithC.SuccessorBlock.Should().Be(simpleBlockWithAssignmentToB);\n            simpleBlockWithC.Instructions.Should().ContainSingle(\"c\");\n\n            simpleBlockWithAssignmentToB.SuccessorBlock.Should().Be(simpleBlockWithFullExpression);\n            simpleBlockWithAssignmentToB.Instructions.Should().ContainSingle(\"b = b ?? c\");\n\n            simpleBlockWithFullExpression.SuccessorBlock.Should().Be(exitBlock);\n            simpleBlockWithFullExpression.Instructions.Should().ContainSingle(\"a = a ?? (b = b ?? c)\");\n        }\n\n        [TestMethod]\n        public void Cfg_Coalesce_Throw()\n        {\n            var cfg = Build(@\"var a = b ?? throw new Exception(\"\"Test\"\");\");\n            VerifyCfg(cfg, 4);\n            var branchBlock = (BinaryBranchBlock)cfg.EntryBlock;\n            var blocks = cfg.Blocks.ToList();\n            var throwBlock = blocks[1];\n            var assignmentBlock = blocks[2];\n            var exitBlock = cfg.ExitBlock;\n\n            branchBlock.TrueSuccessorBlock.Should().Be(throwBlock);\n            branchBlock.FalseSuccessorBlock.Should().Be(assignmentBlock);\n            throwBlock.SuccessorBlocks.Should().Equal(exitBlock);\n            assignmentBlock.SuccessorBlocks.Should().Equal(exitBlock);\n\n            branchBlock.BranchingNode.Kind().Should().Be(SyntaxKind.CoalesceExpression);\n\n            VerifyAllInstructions(branchBlock, \"b\");\n            VerifyAllInstructions(throwBlock, @\"\"\"Test\"\"\", @\"new Exception(\"\"Test\"\")\");\n            VerifyAllInstructions(assignmentBlock, @\"a = b ?? throw new Exception(\"\"Test\"\")\");\n        }\n\n        [TestMethod]\n        public void Cfg_Coalesce_ThrowCoalesce()\n        {\n            var cfg = Build(@\"var a = b ?? throw ex ?? new Exception(\"\"Test\"\");\");\n            VerifyCfg(cfg, 6);\n            var blocks = cfg.Blocks.ToList();\n            var firstBranchBlockWithB = (BinaryBranchBlock)cfg.EntryBlock;\n            var secondBranchBlockWithEx = (BinaryBranchBlock)blocks[1];\n            var simpleBlockWithException = (SimpleBlock)blocks[2];\n            var jumpBlockThrow = (JumpBlock)blocks[3];\n            var simpleBlockWithFullExpression = (SimpleBlock)blocks[4];\n            var exitBlock = cfg.ExitBlock;\n\n            firstBranchBlockWithB.TrueSuccessorBlock.Should().Be(secondBranchBlockWithEx);\n            firstBranchBlockWithB.FalseSuccessorBlock.Should().Be(simpleBlockWithFullExpression);\n            firstBranchBlockWithB.Instructions.Should().ContainSingle(\"b\");\n            firstBranchBlockWithB.BranchingNode.Kind().Should().Be(SyntaxKind.CoalesceExpression);\n\n            secondBranchBlockWithEx.TrueSuccessorBlock.Should().Be(simpleBlockWithException);\n            secondBranchBlockWithEx.FalseSuccessorBlock.Should().Be(jumpBlockThrow);\n            secondBranchBlockWithEx.Instructions.Should().ContainSingle(\"ex\");\n            secondBranchBlockWithEx.BranchingNode.Kind().Should().Be(SyntaxKind.CoalesceExpression);\n\n            simpleBlockWithException.SuccessorBlock.Should().Be(jumpBlockThrow);\n            VerifyAllInstructions(simpleBlockWithException, @\"\"\"Test\"\"\", @\"new Exception(\"\"Test\"\")\");\n\n            jumpBlockThrow.SuccessorBlock.Should().Be(exitBlock);\n\n            simpleBlockWithFullExpression.SuccessorBlock.Should().Be(exitBlock);\n            simpleBlockWithFullExpression.Instructions.Should().ContainSingle(@\"a = b ?? throw ex ?? new Exception(\"\"Test\"\")\");\n        }\n\n        #endregion\n\n        #region Null-coalescing assigment\n\n        [TestMethod]\n        public void Cfg_NullCoalescingAssignment()\n        {\n            // is similar with \"a = a ?? b;\"\n            /// <see cref=\"Cfg_Coalesce_Self\"/>\n            var cfg = Build(\"a ??= b;\");\n            VerifyCfg(cfg, 4);\n\n            var branchBlock = (BinaryBranchBlock)cfg.EntryBlock;\n            var blocks = cfg.Blocks.ToList();\n            var blockWithB = blocks[1];\n            var assignmentBlock = blocks[2];\n            var exitBlock = cfg.ExitBlock;\n\n            branchBlock.TrueSuccessorBlock.Should().Be(blockWithB);\n            branchBlock.FalseSuccessorBlock.Should().Be(assignmentBlock);\n            branchBlock.BranchingNode.Kind().Should().Be(SyntaxKindEx.CoalesceAssignmentExpression);\n            VerifyAllInstructions(branchBlock, \"a\");\n\n            blockWithB.SuccessorBlocks.Should().Equal(assignmentBlock);\n            VerifyAllInstructions(blockWithB, \"b\");\n\n            assignmentBlock.SuccessorBlocks.Should().Equal(exitBlock);\n            VerifyAllInstructions(assignmentBlock, \"a ??= b\");\n        }\n\n        [TestMethod]\n        public void Cfg_NullCoalescingAssignment_Multiple()\n        {\n            // is similar with \"a = a ?? (b = b ?? c);\"\n            /// <see cref=\"Cfg_Coalesce_MultipleAssignments\"/>\n            var cfg = Build(\"a ??= b ??= c;\");\n            VerifyCfg(cfg, 6);\n\n            var firstBranchBlockWithA = (BinaryBranchBlock)cfg.EntryBlock;\n            var blocks = cfg.Blocks.ToList();\n            var secondBranchBlockWithB = (BinaryBranchBlock)blocks[1];\n            var simpleBlockWithC = (SimpleBlock)blocks[2];\n            var simpleBlockWithAssignmentToB = (SimpleBlock)blocks[3];\n            var simpleBlockWithFullExpression = (SimpleBlock)blocks[4];\n            var exitBlock = cfg.ExitBlock;\n\n            firstBranchBlockWithA.TrueSuccessorBlock.Should().Be(secondBranchBlockWithB);\n            firstBranchBlockWithA.FalseSuccessorBlock.Should().Be(simpleBlockWithFullExpression);\n            firstBranchBlockWithA.Instructions.Should().ContainSingle(\"a\");\n            firstBranchBlockWithA.BranchingNode.Kind().Should().Be(SyntaxKindEx.CoalesceAssignmentExpression);\n\n            secondBranchBlockWithB.TrueSuccessorBlock.Should().Be(simpleBlockWithC);\n            secondBranchBlockWithB.FalseSuccessorBlock.Should().Be(simpleBlockWithAssignmentToB);\n            secondBranchBlockWithB.Instructions.Should().ContainSingle(\"b\");\n            secondBranchBlockWithB.BranchingNode.Kind().Should().Be(SyntaxKindEx.CoalesceAssignmentExpression);\n\n            simpleBlockWithC.SuccessorBlock.Should().Be(simpleBlockWithAssignmentToB);\n            simpleBlockWithC.Instructions.Should().ContainSingle(\"c\");\n\n            simpleBlockWithAssignmentToB.SuccessorBlock.Should().Be(simpleBlockWithFullExpression);\n            simpleBlockWithAssignmentToB.Instructions.Should().ContainSingle(\"b = b ?? c\");\n\n            simpleBlockWithFullExpression.SuccessorBlock.Should().Be(exitBlock);\n            simpleBlockWithFullExpression.Instructions.Should().ContainSingle(\"a = a ?? (b = b ?? c)\");\n        }\n\n        [TestMethod]\n        public void Cfg_NullCoalescingAssignment_Coalesce()\n        {\n            // similar to a = a ?? b ?? c\n            var cfg = Build(\"a ??= b ?? c;\");\n            VerifyCfg(cfg, 5);\n\n            var coalesceAssignmentBranchBlock = (BinaryBranchBlock)cfg.EntryBlock;\n            var blocks = cfg.Blocks.ToList();\n            var coalesceBranchBlock = (BinaryBranchBlock)blocks[1];\n            var blockWithC = (SimpleBlock)blocks[2];\n            var assignmentBlock = blocks[3];\n            var exitBlock = cfg.ExitBlock;\n\n            coalesceAssignmentBranchBlock.TrueSuccessorBlock.Should().Be(coalesceBranchBlock);\n            coalesceAssignmentBranchBlock.FalseSuccessorBlock.Should().Be(assignmentBlock);\n            coalesceAssignmentBranchBlock.BranchingNode.Kind().Should().Be(SyntaxKindEx.CoalesceAssignmentExpression);\n            coalesceAssignmentBranchBlock.Instructions.Should().ContainSingle(\"a\");\n\n            coalesceBranchBlock.TrueSuccessorBlock.Should().Be(blockWithC);\n            coalesceBranchBlock.FalseSuccessorBlock.Should().Be(assignmentBlock);\n            coalesceBranchBlock.BranchingNode.Kind().Should().Be(SyntaxKind.CoalesceExpression);\n            coalesceBranchBlock.Instructions.Should().ContainSingle(\"b\");\n\n            blockWithC.SuccessorBlocks.Should().Equal(assignmentBlock);\n            blockWithC.Instructions.Should().ContainSingle(\"c\");\n\n            assignmentBlock.SuccessorBlocks.Should().Equal(exitBlock);\n            assignmentBlock.Instructions.Should().ContainSingle(\"a ??= b ?? c\");\n        }\n\n        [TestMethod]\n        public void Cfg_NullCoalescingAssignment_Conditional()\n        {\n            var cfg = Build(\"a ??= b ? c : d;\");\n            VerifyCfg(cfg, 6);\n\n            var nullCoalesceAssignmentBranchBlock = (BinaryBranchBlock)cfg.EntryBlock;\n            var blocks = cfg.Blocks.ToList();\n            var conditionalBranchBlock = (BinaryBranchBlock)blocks[1];\n            var cBlock = (SimpleBlock)blocks[2];\n            var dBlock = (SimpleBlock)blocks[3];\n            var simpleBlockWithFullExpression = (SimpleBlock)blocks[4];\n            var exitBlock = cfg.ExitBlock;\n\n            nullCoalesceAssignmentBranchBlock.TrueSuccessorBlock.Should().Be(conditionalBranchBlock);\n            nullCoalesceAssignmentBranchBlock.FalseSuccessorBlock.Should().Be(simpleBlockWithFullExpression);\n            nullCoalesceAssignmentBranchBlock.Instructions.Should().ContainSingle(\"a\");\n            nullCoalesceAssignmentBranchBlock.BranchingNode.Kind().Should().Be(SyntaxKindEx.CoalesceAssignmentExpression);\n\n            conditionalBranchBlock.TrueSuccessorBlock.Should().Be(cBlock);\n            conditionalBranchBlock.FalseSuccessorBlock.Should().Be(dBlock);\n            conditionalBranchBlock.Instructions.Should().ContainSingle(\"b\");\n            conditionalBranchBlock.BranchingNode.Kind().Should().Be(SyntaxKind.IdentifierName);\n\n            cBlock.SuccessorBlock.Should().Be(simpleBlockWithFullExpression);\n            cBlock.Instructions.Should().ContainSingle(\"c\");\n\n            dBlock.SuccessorBlock.Should().Be(simpleBlockWithFullExpression);\n            dBlock.Instructions.Should().ContainSingle(\"d\");\n\n            simpleBlockWithFullExpression.SuccessorBlock.Should().Be(exitBlock);\n            simpleBlockWithFullExpression.Instructions.Should().HaveCount(1);\n            simpleBlockWithFullExpression.Instructions.Should().ContainSingle(\"a ??= b ? c : d\");\n        }\n\n        #endregion\n\n        #region Conditional expression\n\n        [TestMethod]\n        public void Cfg_Conditional()\n        {\n            var cfg = Build(\"var a = cond ? b : c;\");\n            VerifyCfg(cfg, 5);\n\n            var branchBlock = cfg.EntryBlock as BinaryBranchBlock;\n            var blocks = cfg.Blocks.ToList();\n            var condFalse = blocks[2];\n            var condTrue = blocks[1];\n            var after = blocks[3];\n            var exitBlock = cfg.ExitBlock;\n\n            branchBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { condTrue, condFalse });\n            condFalse.SuccessorBlocks.Should().Equal(after);\n            condTrue.SuccessorBlocks.Should().Equal(after);\n            after.SuccessorBlocks.Should().Equal(exitBlock);\n\n            branchBlock.BranchingNode.Kind().Should().Be(SyntaxKind.IdentifierName);\n\n            VerifyAllInstructions(branchBlock, \"cond\");\n            VerifyAllInstructions(condTrue, \"b\");\n            VerifyAllInstructions(condFalse, \"c\");\n            VerifyAllInstructions(after, \"a = cond ? b : c\");\n        }\n\n        [TestMethod]\n        public void Cfg_Conditional_ComplexCondition_Or()\n        {\n            var cfg = Build(\"var a = x || y ? b : c;\");\n            VerifyCfg(cfg, 6);\n\n            var blocks = cfg.Blocks.ToList();\n            var branchBlockA = (BinaryBranchBlock)blocks[0];\n            var branchBlockB = (BinaryBranchBlock)blocks[1];\n            var condFalse = blocks[3];\n            var condTrue = blocks[2];\n            var after = blocks[4];\n            var exitBlock = cfg.ExitBlock;\n\n            branchBlockA.TrueSuccessorBlock.Should().Be(condTrue);\n            branchBlockA.FalseSuccessorBlock.Should().Be(branchBlockB);\n            branchBlockB.TrueSuccessorBlock.Should().Be(condTrue);\n            branchBlockB.FalseSuccessorBlock.Should().Be(condFalse);\n\n            condFalse.SuccessorBlocks.Should().Equal(after);\n            condTrue.SuccessorBlocks.Should().Equal(after);\n            after.SuccessorBlocks.Should().Equal(exitBlock);\n\n            VerifyAllInstructions(branchBlockA, \"x\");\n            VerifyAllInstructions(branchBlockB, \"y\");\n            VerifyAllInstructions(condTrue, \"b\");\n            VerifyAllInstructions(condFalse, \"c\");\n            VerifyAllInstructions(after, \"a = x || y ? b : c\");\n        }\n\n        [TestMethod]\n        public void Cfg_Conditional_ComplexCondition_And()\n        {\n            var cfg = Build(\"var a = x && y ? b : c;\");\n            VerifyCfg(cfg, 6);\n\n            var blocks = cfg.Blocks.ToList();\n            var branchBlockA = (BinaryBranchBlock)blocks[0];\n            var branchBlockB = (BinaryBranchBlock)blocks[1];\n            var condFalse = blocks[3];\n            var condTrue = blocks[2];\n            var after = blocks[4];\n            var exitBlock = cfg.ExitBlock;\n\n            branchBlockA.TrueSuccessorBlock.Should().Be(branchBlockB);\n            branchBlockA.FalseSuccessorBlock.Should().Be(condFalse);\n            branchBlockB.TrueSuccessorBlock.Should().Be(condTrue);\n            branchBlockB.FalseSuccessorBlock.Should().Be(condFalse);\n\n            condFalse.SuccessorBlocks.Should().Equal(after);\n            condTrue.SuccessorBlocks.Should().Equal(after);\n            after.SuccessorBlocks.Should().Equal(exitBlock);\n\n            VerifyAllInstructions(branchBlockA, \"x\");\n            VerifyAllInstructions(branchBlockB, \"y\");\n            VerifyAllInstructions(condTrue, \"b\");\n            VerifyAllInstructions(condFalse, \"c\");\n            VerifyAllInstructions(after, \"a = x && y ? b : c\");\n        }\n\n        [TestMethod]\n        public void Cfg_ConditionalMultiple()\n        {\n            var cfg = Build(\"var a = cond1 ? (cond2?x:y) : (cond3?p:q);\");\n            VerifyCfg(cfg, 9);\n\n            var branchBlock = cfg.EntryBlock as BinaryBranchBlock;\n            var blocks = cfg.Blocks.ToList();\n            var cond2Block = blocks[1];\n            VerifyAllInstructions(cond2Block, \"cond2\");\n            var cond3Block = blocks[4];\n            VerifyAllInstructions(cond3Block, \"cond3\");\n\n            branchBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { cond2Block, cond3Block });\n            cond2Block.SuccessorBlocks.Should().HaveCount(2);\n            cond3Block.SuccessorBlocks.Should().HaveCount(2);\n\n            cond2Block\n                .SuccessorBlocks[0]\n                .SuccessorBlocks[0]\n                .SuccessorBlocks[0].Should().Be(cfg.ExitBlock);\n\n            var assignmentBlock = cfg.ExitBlock.PredecessorBlocks.First();\n            assignmentBlock.Instructions.Should().HaveCount(1);\n            assignmentBlock.Instructions.Should().Contain(i => i.ToString() == \"a = cond1 ? (cond2?x:y) : (cond3?p:q)\");\n        }\n\n        #endregion\n\n        #region Throw expression\n\n        [TestMethod]\n        public void Cfg_Throw_Expression_NullCoalesce()\n        {\n            var throwException = \"throw new InvalidOperationException(\\\"\\\")\";\n            var cfg = Build($\"object x = null; var y = x ?? {throwException};\");\n            VerifyJumpWithNoExpression(cfg, SyntaxKind.ThrowExpression);\n        }\n\n        [TestMethod]\n        public void Cfg_Throw_Expression_Ternary()\n        {\n            var throwException = \"throw new InvalidOperationException(\\\"\\\")\";\n            var cfg = Build($\"var x = true ? 1 : {throwException};\");\n\n            VerifyCfg(cfg, 5);\n            var binaryBranch = cfg.EntryBlock as BinaryBranchBlock;\n            var blocks = cfg.Blocks.ToList();\n            var trueBlock = blocks[1] as SimpleBlock;\n            var falseJumpBlock = blocks[2] as JumpBlock;\n            var assignmentBlock = blocks[3] as SimpleBlock;\n            var exitBlock = cfg.ExitBlock;\n\n            binaryBranch.SuccessorBlocks.Should().BeEquivalentTo(new[] { trueBlock, falseJumpBlock });\n            trueBlock.SuccessorBlocks.Should().Equal(assignmentBlock);\n            falseJumpBlock.SuccessorBlock.Should().Be(exitBlock);\n            falseJumpBlock.WouldBeSuccessor.Should().Be(assignmentBlock);\n            assignmentBlock.SuccessorBlocks.Should().Equal(exitBlock);\n            exitBlock.PredecessorBlocks.Should().BeEquivalentTo(new[] { falseJumpBlock, assignmentBlock });\n        }\n\n        [TestMethod]\n        public void Cfg_Throw_Expression_MethodArgument()\n        {\n            var throwException = \"throw new InvalidOperationException(\\\"\\\")\";\n            var cfg = Build($\"Console.WriteLine({throwException});\");\n\n            VerifyCfg(cfg, 3);\n            var jumpBlock = cfg.EntryBlock as JumpBlock;\n            var blocks = cfg.Blocks.ToList();\n            var methodCallBlock = blocks[1] as SimpleBlock;\n            var exitBlock = cfg.ExitBlock;\n\n            jumpBlock.SuccessorBlocks.Should().Equal(exitBlock);\n            jumpBlock.WouldBeSuccessor.Should().Be(methodCallBlock);\n            methodCallBlock.SuccessorBlocks.Should().Equal(exitBlock);\n            exitBlock.PredecessorBlocks.Should().BeEquivalentTo(new[] { methodCallBlock, jumpBlock });\n        }\n\n        #endregion\n\n        #region Ranges and Indices\n\n        [TestMethod]\n        public void Cfg_Range_Expression()\n        {\n            var cfg = Build($\"Range r = 1..4;\");\n\n            VerifyCfg(cfg, 2);\n\n            var rangeBlock = cfg.EntryBlock as SimpleBlock;\n            var exitBlock = cfg.ExitBlock;\n\n            VerifyAllInstructions(rangeBlock, \"1..4\", \"r = 1..4\");\n\n            rangeBlock.SuccessorBlocks.Should().Equal(exitBlock);\n            exitBlock.PredecessorBlocks.Should().Equal(rangeBlock);\n        }\n\n        [TestMethod]\n        public void Cfg_Index_Expression()\n        {\n            var cfg = Build($\"Index index = ^1;\");\n\n            VerifyCfg(cfg, 2);\n\n            var rangeBlock = cfg.EntryBlock as SimpleBlock;\n            var exitBlock = cfg.ExitBlock;\n\n            VerifyAllInstructions(rangeBlock, \"^1\", \"index = ^1\");\n\n            rangeBlock.SuccessorBlocks.Should().Equal(exitBlock);\n            exitBlock.PredecessorBlocks.Should().Equal(rangeBlock);\n        }\n\n        #endregion\n\n        #region Conditional access\n\n        [TestMethod]\n        public void Cfg_ConditionalAccess()\n        {\n            var cfg = Build(\"var a = o?.method(1);\");\n            VerifyCfg(cfg, 4);\n\n            var blocks = cfg.Blocks.ToList();\n            var oIsNullBranch = blocks[0] as BinaryBranchBlock;\n            var oNotNull = blocks[1];\n            var assignment = blocks[2];\n            var exitBlock = cfg.ExitBlock;\n\n            oIsNullBranch.TrueSuccessorBlock.Should().Be(assignment);\n            oIsNullBranch.FalseSuccessorBlock.Should().Be(oNotNull);\n            oNotNull.SuccessorBlocks.Should().Equal(assignment);\n            assignment.SuccessorBlocks.Should().Equal(exitBlock);\n\n            oIsNullBranch.BranchingNode.Kind().Should().Be(SyntaxKind.ConditionalAccessExpression);\n\n            VerifyAllInstructions(oIsNullBranch, \"o\");\n            VerifyAllInstructions(oNotNull, \"method\", \".method\" /* This is equivalent to o.method */, \"1\", \".method(1)\");\n            VerifyAllInstructions(assignment, \"a = o?.method(1)\");\n        }\n\n        [TestMethod]\n        public void Cfg_ConditionalAccessNested()\n        {\n            var cfg = Build(\"var a = o?.method()?[10];\");\n            VerifyCfg(cfg, 5);\n\n            var blocks = cfg.Blocks.ToList();\n            var oIsNullBranch = blocks[0] as BinaryBranchBlock;\n            var methodCallIsNull = blocks[1] as BinaryBranchBlock;\n            var arrayAccess = blocks[2];\n            var assignment = blocks[3];\n            var exitBlock = cfg.ExitBlock;\n\n            VerifyAllInstructions(oIsNullBranch, \"o\");\n            VerifyAllInstructions(methodCallIsNull, \"method\", \".method\", \".method()\");\n            VerifyAllInstructions(arrayAccess, \"10\", \"[10]\");\n            VerifyAllInstructions(assignment, \"a = o?.method()?[10]\");\n\n            oIsNullBranch.TrueSuccessorBlock.Should().Be(assignment);\n            oIsNullBranch.FalseSuccessorBlock.Should().Be(methodCallIsNull);\n            methodCallIsNull.TrueSuccessorBlock.Should().Be(assignment);\n            methodCallIsNull.FalseSuccessorBlock.Should().Be(arrayAccess);\n            arrayAccess.SuccessorBlocks.Should().Equal(assignment);\n            assignment.SuccessorBlocks.Should().Equal(exitBlock);\n        }\n\n        [TestMethod]\n        public void Cfg_ConditionalAccess_Coalesce()\n        {\n            var cfg = Build(\"var a = aObj?.booleanVal ?? false\");\n            VerifyCfg(cfg, 6);\n\n            var blocks = cfg.Blocks.ToList();\n            var aObjIsNull = blocks[0] as BinaryBranchBlock;\n            var boolFieldAccess = blocks[1];\n            var coalesceIsNullBranch = blocks[2] as BinaryBranchBlock;\n            var falseBlock = blocks[3];\n            var assignment = blocks[4];\n            var exitBlock = cfg.ExitBlock;\n\n            VerifyAllInstructions(aObjIsNull, \"aObj\");\n            VerifyAllInstructions(boolFieldAccess, \"booleanVal\", \".booleanVal\");\n            VerifyAllInstructions(coalesceIsNullBranch);\n            VerifyAllInstructions(falseBlock, \"false\");\n            VerifyAllInstructions(assignment, \"a = aObj?.booleanVal ?? false\");\n\n            aObjIsNull.TrueSuccessorBlock.Should().Be(coalesceIsNullBranch);\n            aObjIsNull.FalseSuccessorBlock.Should().Be(boolFieldAccess);\n            boolFieldAccess.SuccessorBlocks.Should().Equal(coalesceIsNullBranch);\n            coalesceIsNullBranch.TrueSuccessorBlock.Should().Be(falseBlock);\n            coalesceIsNullBranch.FalseSuccessorBlock.Should().Be(assignment);\n            falseBlock.SuccessorBlocks.Should().Equal(assignment);\n            assignment.SuccessorBlocks.Should().Equal(exitBlock);\n        }\n\n        [TestMethod]\n        public void Cfg_ConditionalAccess_Conditional()\n        {\n            var cfg = Build(\"a?.booleanVal == null ? true : false\");\n            VerifyCfg(cfg, 6);\n\n            var blocks = cfg.Blocks.ToList();\n            var aIsNullBranch = blocks[0] as BinaryBranchBlock;\n            var boolFieldAccess = blocks[1];\n            var nullCheckBranch = blocks[2] as BinaryBranchBlock;\n            var trueBlock = blocks[3];\n            var falseBlock = blocks[4];\n            var exitBlock = cfg.ExitBlock;\n\n            VerifyAllInstructions(aIsNullBranch, \"a\");\n            VerifyAllInstructions(boolFieldAccess, \"booleanVal\", \".booleanVal\");\n            VerifyAllInstructions(nullCheckBranch, \"null\", \"a?.booleanVal == null\");\n            VerifyAllInstructions(trueBlock, \"true\");\n            VerifyAllInstructions(falseBlock, \"false\");\n\n            aIsNullBranch.TrueSuccessorBlock.Should().Be(nullCheckBranch);\n            aIsNullBranch.FalseSuccessorBlock.Should().Be(boolFieldAccess);\n            boolFieldAccess.SuccessorBlocks.Should().Equal(nullCheckBranch);\n            nullCheckBranch.TrueSuccessorBlock.Should().Be(trueBlock);\n            nullCheckBranch.FalseSuccessorBlock.Should().Be(falseBlock);\n            trueBlock.SuccessorBlocks.Should().Equal(exitBlock);\n            falseBlock.SuccessorBlocks.Should().Equal(exitBlock);\n        }\n\n        [TestMethod]\n        public void Cfg_ConditionalAccess_is()\n        {\n            var cfg = Build(\"if(a?.booleanVal is null) {return 1;}\");\n            VerifyCfg(cfg, 5);\n\n            var blocks = cfg.Blocks.ToList();\n            var aIsNullBranch = blocks[0] as BinaryBranchBlock;\n            var boolFieldAccess = blocks[1];\n            var isNullCheck = blocks[2] as BinaryBranchBlock;\n            var returnBlock = blocks[3];\n            var exitBlock = cfg.ExitBlock;\n\n            VerifyAllInstructions(aIsNullBranch, \"a\");\n            VerifyAllInstructions(boolFieldAccess, \"booleanVal\", \".booleanVal\");\n            VerifyAllInstructions(isNullCheck, \"null\", \"a?.booleanVal is null\");\n            VerifyAllInstructions(returnBlock, \"1\");\n\n            aIsNullBranch.TrueSuccessorBlock.Should().Be(isNullCheck);\n            aIsNullBranch.FalseSuccessorBlock.Should().Be(boolFieldAccess);\n            boolFieldAccess.SuccessorBlocks.Should().Equal(isNullCheck);\n            isNullCheck.TrueSuccessorBlock.Should().Be(returnBlock);\n            isNullCheck.FalseSuccessorBlock.Should().Be(exitBlock);\n            returnBlock.SuccessorBlocks.Should().Equal(exitBlock);\n        }\n\n        #endregion\n\n        #region Break\n\n        [TestMethod]\n        public void Cfg_For_Break()\n        {\n            var cfg = Build(\"cw0(); for (a; b && c; d) { if (e) { cw1(); break; } cw2(); } cw3();\");\n            VerifyCfg(cfg, 10);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var cw0 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw0\"));\n            var cw1 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw1\"));\n            var cw2 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw2\"));\n            var cw3 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw3\"));\n\n            var b = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"b\")) as BinaryBranchBlock;\n            var c = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"c\"));\n            var bc = blocks[3] as BinaryBranchBlock;\n\n            var d = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"d\"));\n\n            var e = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"e\")) as BinaryBranchBlock;\n\n            var exitBlock = cfg.ExitBlock;\n\n            cw0.Should().BeSameAs(cfg.EntryBlock);\n\n            cw0.SuccessorBlocks.Should().Equal(b);\n            b.SuccessorBlocks.Should().BeEquivalentTo(new[] { c, bc });\n            c.SuccessorBlocks.Should().Equal(bc);\n            bc.SuccessorBlocks.Should().BeEquivalentTo(new[] { e, cw3 });\n            e.SuccessorBlocks.Should().BeEquivalentTo(new[] { cw1, cw2 });\n            cw1.SuccessorBlocks.Should().Equal(cw3);\n            cw3.SuccessorBlocks.Should().Equal(exitBlock);\n            cw2.SuccessorBlocks.Should().Equal(d);\n            d.SuccessorBlocks.Should().Equal(b);\n\n            bc.Instructions.Should().BeEmpty();\n        }\n\n        [TestMethod]\n        public void Cfg_While_Break()\n        {\n            var cfg = Build(\"cw0(); while (b && c) { if (e) { cw1(); break; } cw2(); } cw3();\");\n            VerifyCfg(cfg, 8);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var beforeWhile = blocks[0];\n            var branchBlockB = (BinaryBranchBlock)blocks[1];\n            var branchBlockC = (BinaryBranchBlock)blocks[2];\n            var branchBlockE = (BinaryBranchBlock)blocks[3];\n            var trueBlock = (JumpBlock)blocks[4];\n            var afterIf = blocks[5];\n            var afterWhile = blocks[6];\n            var exit = blocks[7];\n\n            beforeWhile.SuccessorBlocks.Should().Equal(branchBlockB);\n            branchBlockB.TrueSuccessorBlock.Should().Be(branchBlockC);\n            branchBlockB.FalseSuccessorBlock.Should().Be(afterWhile);\n            branchBlockC.TrueSuccessorBlock.Should().Be(branchBlockE);\n            branchBlockC.FalseSuccessorBlock.Should().Be(afterWhile);\n            branchBlockE.TrueSuccessorBlock.Should().Be(trueBlock);\n            branchBlockE.FalseSuccessorBlock.Should().Be(afterIf);\n            trueBlock.SuccessorBlock.Should().Be(afterWhile);\n            afterIf.SuccessorBlocks.Should().Equal(branchBlockB);\n            afterWhile.SuccessorBlocks.Should().Equal(exit);\n        }\n\n        [TestMethod]\n        public void Cfg_Foreach_Break()\n        {\n            var cfg = Build(\"cw0(); foreach (var x in xs) { if (e) { cw1(); break; } cw2(); } cw3();\");\n            VerifyCfg(cfg, 7);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var cw0 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw0\"));\n            var cw1 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw1\"));\n            var cw2 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw2\"));\n            var cw3 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw3\"));\n\n            var xs = blocks.OfType<BinaryBranchBlock>().First(n => n.BranchingNode.IsKind(SyntaxKind.ForEachStatement));\n\n            var e = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"e\")) as BinaryBranchBlock;\n\n            var exitBlock = cfg.ExitBlock;\n\n            cw0.Should().BeSameAs(cfg.EntryBlock);\n\n            cw0.SuccessorBlocks.Should().Equal(xs);\n            xs.SuccessorBlocks.Should().BeEquivalentTo(new[] { e, cw3 });\n            e.SuccessorBlocks.Should().BeEquivalentTo(new[] { cw1, cw2 });\n            cw1.SuccessorBlocks.Should().Equal(cw3);\n            cw3.SuccessorBlocks.Should().Equal(exitBlock);\n            cw2.SuccessorBlocks.Should().Equal(xs);\n        }\n\n        [TestMethod]\n        public void Cfg_Do_Break()\n        {\n            var cfg = Build(\"cw0(); do { if (e) { cw1(); break; } cw2(); } while (b && c); cw3();\");\n\n            VerifyCfg(cfg, 8);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var beforeDo = blocks[0];\n            var branchBlockE = (BinaryBranchBlock)blocks[1];\n            var trueBlock = (JumpBlock)blocks[2];\n            var afterIf = blocks[3];\n            var branchBlockB = (BinaryBranchBlock)blocks[4];\n            var branchBlockC = (BinaryBranchBlock)blocks[5];\n            var afterWhile = blocks[6];\n            var exit = blocks[7];\n\n            beforeDo.SuccessorBlocks.Should().Equal(branchBlockE);\n            branchBlockE.TrueSuccessorBlock.Should().Be(trueBlock);\n            branchBlockE.FalseSuccessorBlock.Should().Be(afterIf);\n            trueBlock.SuccessorBlock.Should().Be(afterWhile);\n            afterIf.SuccessorBlocks.Should().Equal(branchBlockB);\n            branchBlockB.TrueSuccessorBlock.Should().Be(branchBlockC);\n            branchBlockB.FalseSuccessorBlock.Should().Be(afterWhile);\n            branchBlockC.TrueSuccessorBlock.Should().Be(branchBlockE);\n            branchBlockC.FalseSuccessorBlock.Should().Be(afterWhile);\n            afterWhile.SuccessorBlocks.Should().Equal(exit);\n        }\n\n        [TestMethod]\n        public void Cfg_Switch_Break()\n        {\n            var cfg = Build(\"cw0(); switch(a) { case 1: case 2: cw1(); break; } cw3();\");\n            VerifyCfg(cfg, 6);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var cw0 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw0\")) as BranchBlock;\n            var cw1 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw1\")) as JumpBlock;\n            var cw3 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw3\"));\n\n            var case1Branch = blocks[1] as BinaryBranchBlock;\n            var case2Branch = blocks[2] as BinaryBranchBlock;\n\n            var exitBlock = cfg.ExitBlock;\n\n            cw0.Should().BeSameAs(cfg.EntryBlock);\n\n            cw0.SuccessorBlocks.Should().Equal(case1Branch);\n            case1Branch.TrueSuccessorBlock.Should().Be(cw1);\n            case1Branch.FalseSuccessorBlock.Should().Be(case2Branch);\n            case2Branch.TrueSuccessorBlock.Should().Be(cw1);\n            case2Branch.FalseSuccessorBlock.Should().Be(cw3);\n\n            cw1.SuccessorBlocks.Should().Equal(cw3);\n            cw3.SuccessorBlocks.Should().Equal(exitBlock);\n        }\n\n        #endregion\n\n        #region Continue\n\n        [TestMethod]\n        public void Cfg_For_Continue()\n        {\n            var cfg = Build(\"cw0(); for (a; b && c; d) { if (e) { cw1(); continue; } cw2(); } cw3();\");\n            VerifyCfg(cfg, 10);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var cw0 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw0\"));\n            var cw1 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw1\"));\n            var cw2 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw2\"));\n            var cw3 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw3\"));\n\n            var b = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"b\")) as BinaryBranchBlock;\n            var c = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"c\"));\n            var bc = blocks[3] as BinaryBranchBlock;\n\n            var d = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"d\"));\n\n            var e = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"e\")) as BinaryBranchBlock;\n\n            var exitBlock = cfg.ExitBlock;\n\n            cw0.Should().BeSameAs(cfg.EntryBlock);\n\n            cw0.SuccessorBlocks.Should().Equal(b);\n            b.SuccessorBlocks.Should().BeEquivalentTo(new[] { c, bc });\n            c.SuccessorBlocks.Should().Equal(bc);\n            bc.SuccessorBlocks.Should().BeEquivalentTo(new[] { e, cw3 });\n            e.SuccessorBlocks.Should().BeEquivalentTo(new[] { cw1, cw2 });\n            cw1.SuccessorBlocks.Should().Equal(d);\n            cw3.SuccessorBlocks.Should().Equal(exitBlock);\n            cw2.SuccessorBlocks.Should().Equal(d);\n            d.SuccessorBlocks.Should().Equal(b);\n\n            bc.Instructions.Should().BeEmpty();\n        }\n\n        [TestMethod]\n        public void Cfg_While_Continue()\n        {\n            var cfg = Build(\"cw0(); while (b && c) { if (e) { cw1(); continue; } cw2(); } cw3();\");\n            VerifyCfg(cfg, 8);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var beforeWhile = blocks[0];\n            var branchBlockB = (BinaryBranchBlock)blocks[1];\n            var branchBlockC = (BinaryBranchBlock)blocks[2];\n            var branchBlockE = (BinaryBranchBlock)blocks[3];\n            var trueBlock = (JumpBlock)blocks[4];\n            var afterIf = blocks[5];\n            var afterWhile = blocks[6];\n            var exit = blocks[7];\n\n            beforeWhile.SuccessorBlocks.Should().Equal(branchBlockB);\n            branchBlockB.TrueSuccessorBlock.Should().Be(branchBlockC);\n            branchBlockB.FalseSuccessorBlock.Should().Be(afterWhile);\n            branchBlockC.TrueSuccessorBlock.Should().Be(branchBlockE);\n            branchBlockC.FalseSuccessorBlock.Should().Be(afterWhile);\n            branchBlockE.TrueSuccessorBlock.Should().Be(trueBlock);\n            branchBlockE.FalseSuccessorBlock.Should().Be(afterIf);\n            trueBlock.SuccessorBlock.Should().Be(branchBlockB);\n            afterIf.SuccessorBlocks.Should().Equal(branchBlockB);\n            afterWhile.SuccessorBlocks.Should().Equal(exit);\n        }\n\n        [TestMethod]\n        public void Cfg_Foreach_Continue()\n        {\n            var cfg = Build(\"cw0(); foreach (var x in xs) { if (e) { cw1(); continue; } cw2(); } cw3();\");\n            VerifyCfg(cfg, 7);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var cw0 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw0\"));\n            var cw1 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw1\"));\n            var cw2 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw2\"));\n            var cw3 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw3\"));\n\n            var foreachBlock = blocks.OfType<BinaryBranchBlock>().First(n => n.BranchingNode.IsKind(SyntaxKind.ForEachStatement));\n\n            var e = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"e\")) as BinaryBranchBlock;\n\n            var exitBlock = cfg.ExitBlock;\n\n            cw0.Should().BeSameAs(cfg.EntryBlock);\n\n            cw0.SuccessorBlocks.Should().Equal(foreachBlock);\n            foreachBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { e, cw3 });\n            e.SuccessorBlocks.Should().BeEquivalentTo(new[] { cw1, cw2 });\n            cw1.SuccessorBlocks.Should().Equal(foreachBlock);\n            cw3.SuccessorBlocks.Should().Equal(exitBlock);\n            cw2.SuccessorBlocks.Should().Equal(foreachBlock);\n\n            foreachBlock.Instructions.Should().BeEmpty();\n        }\n\n        [TestMethod]\n        public void Cfg_Foreach_Finally()\n        {\n            var cfg = Build(@\"\n                BeforeForeach();\n                foreach (var item in collection)\n                {\n                    BeforeTry();\n                    try\n                    {\n                        InsideTry();\n                    }\n                    finally\n                    {\n                        InsideFinally();\n                    }\n                    AfterFinally();\n                }\n                AfterForeach();\n            \");\n\n            VerifyCfg(cfg, 8);\n            var blocks = cfg.Blocks.ToList();\n\n            var beforeForeach = (ForeachCollectionProducerBlock)blocks[0];\n            var foreachDecision = (BinaryBranchBlock)blocks[1];\n            var beforeTry = (SimpleBlock)blocks[2];\n            var insideTry = (BranchBlock)blocks[3];\n            var insideFinally = (BranchBlock)blocks[4];\n            var afterFinally = (SimpleBlock)blocks[5];\n            var afterForeach = (SimpleBlock)blocks[6];\n            var exit = (ExitBlock)blocks[7];\n\n            beforeForeach.SuccessorBlock.Should().Be(foreachDecision);\n            foreachDecision.TrueSuccessorBlock.Should().Be(beforeTry);\n            foreachDecision.FalseSuccessorBlock.Should().Be(afterForeach);\n            beforeTry.SuccessorBlock.Should().Be(insideTry);\n            insideTry.SuccessorBlocks.Should().Equal(insideFinally);\n            insideFinally.SuccessorBlocks.Should().BeEquivalentTo(new Block[] { afterFinally, exit });\n            afterFinally.SuccessorBlock.Should().Be(foreachDecision);\n            afterForeach.SuccessorBlock.Should().Be(exit);\n        }\n\n        [TestMethod]\n        public void Cfg_Do_Continue()\n        {\n            var cfg = Build(\"cw0(); do { if (e) { cw1(); continue; } cw2(); } while (b && c); cw3();\");\n\n            VerifyCfg(cfg, 8);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var beforeDo = blocks[0];\n            var branchBlockE = (BinaryBranchBlock)blocks[1];\n            var trueBlock = (JumpBlock)blocks[2];\n            var afterIf = blocks[3];\n            var branchBlockB = (BinaryBranchBlock)blocks[4];\n            var branchBlockC = (BinaryBranchBlock)blocks[5];\n            var afterWhile = blocks[6];\n            var exit = blocks[7];\n\n            beforeDo.SuccessorBlocks.Should().Equal(branchBlockE);\n            branchBlockE.TrueSuccessorBlock.Should().Be(trueBlock);\n            branchBlockE.FalseSuccessorBlock.Should().Be(afterIf);\n            trueBlock.SuccessorBlock.Should().Be(branchBlockB);\n            afterIf.SuccessorBlocks.Should().Equal(branchBlockB);\n            branchBlockB.TrueSuccessorBlock.Should().Be(branchBlockC);\n            branchBlockB.FalseSuccessorBlock.Should().Be(afterWhile);\n            branchBlockC.TrueSuccessorBlock.Should().Be(branchBlockE);\n            branchBlockC.FalseSuccessorBlock.Should().Be(afterWhile);\n            afterWhile.SuccessorBlocks.Should().Equal(exit);\n        }\n\n        #endregion\n\n        #region Try/Finally\n\n        [TestMethod]\n        public void Cfg_Try_Finally()\n        {\n            var cfg = Build(@\"\n            before();\n            try\n            {\n                inside();\n            }\n            finally\n            {\n                fin();\n            }\n            after();\");\n\n            VerifyCfg(cfg, 5);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var tryStartBlock = blocks[0];\n            var insideTryBlock = blocks[1];\n            var finallyBlock = blocks[2];\n            var afterFinallyBlock = blocks[3];\n            var exit = blocks[4];\n\n            tryStartBlock.Should().BeOfType<SimpleBlock>();\n            VerifyAllInstructions(tryStartBlock, \"before\", \"before()\");\n            tryStartBlock.SuccessorBlocks.Should().Equal(insideTryBlock);\n\n            insideTryBlock.Should().BeOfType<BranchBlock>();\n            VerifyAllInstructions(insideTryBlock, \"inside\", \"inside()\");\n            insideTryBlock.SuccessorBlocks.Should().Equal(finallyBlock);\n\n            finallyBlock.Should().BeOfType<BranchBlock>();\n            VerifyAllInstructions(finallyBlock, \"fin\", \"fin()\");\n            finallyBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { afterFinallyBlock, exit });\n\n            afterFinallyBlock.Should().BeOfType<SimpleBlock>();\n            VerifyAllInstructions(afterFinallyBlock, \"after\", \"after()\");\n\n            exit.Should().BeOfType<ExitBlock>();\n        }\n\n        [TestMethod]\n        public void Cfg_Try_CatchSome()\n        {\n            var cfg = Build(@\"\n            before();\n            try\n            {\n                inside();\n            }\n            catch(Exception1 e)\n            {\n                cat1();\n            }\n            catch(Exception2 e)\n            {\n                cat2();\n            }\n            after();\");\n\n            VerifyCfg(cfg, 6);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var beforeTryBlock = blocks[0];\n            var insideTryBlock = blocks[1];\n            var catchBlock1 = blocks[2];\n            var catchBlock2 = blocks[3];\n            var afterFinallyBlock = blocks[4];\n            var exit = blocks[5];\n\n            beforeTryBlock.Should().BeOfType<SimpleBlock>();\n            VerifyAllInstructions(beforeTryBlock, \"before\", \"before()\");\n            beforeTryBlock.SuccessorBlocks.Should().Equal(insideTryBlock);\n\n            insideTryBlock.Should().BeOfType<BranchBlock>();\n            VerifyAllInstructions(insideTryBlock, \"inside\", \"inside()\");\n            insideTryBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { catchBlock1 /*caught ex*/, catchBlock2 /*caught ex*/, afterFinallyBlock /*no ex*/, exit /*uncaught ex*/});\n\n            catchBlock1.Should().BeOfType<SimpleBlock>();\n            VerifyAllInstructions(catchBlock1, \"cat1\", \"cat1()\");\n            catchBlock1.SuccessorBlocks.Should().Equal(afterFinallyBlock);\n\n            catchBlock2.Should().BeOfType<SimpleBlock>();\n            VerifyAllInstructions(catchBlock2, \"cat2\", \"cat2()\");\n            catchBlock2.SuccessorBlocks.Should().Equal(afterFinallyBlock);\n\n            afterFinallyBlock.Should().BeOfType<SimpleBlock>();\n            VerifyAllInstructions(afterFinallyBlock, \"after\", \"after()\");\n\n            exit.Should().BeOfType<ExitBlock>();\n        }\n\n        [TestMethod]\n        public void Cfg_Try_CatchAll()\n        {\n            var cfg = Build(@\"\n            before();\n            try\n            {\n                inside();\n            }\n            catch(Exception1 e)\n            {\n                cat1();\n            }\n            catch\n            {\n                cat2();\n            }\n            after();\");\n\n            VerifyCfg(cfg, 6);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var tryStartBlock = blocks[0];\n            var tryEndBlock = blocks[1];\n            var catchBlock1 = blocks[2];\n            var catchBlock2 = blocks[3];\n            var afterFinallyBlock = blocks[4];\n            var exit = blocks[5];\n\n            tryStartBlock.Should().BeOfType<SimpleBlock>();\n            VerifyAllInstructions(tryStartBlock, \"before\", \"before()\");\n            tryStartBlock.SuccessorBlocks.Should().Equal(tryEndBlock);\n\n            tryEndBlock.Should().BeOfType<BranchBlock>();\n            VerifyAllInstructions(tryEndBlock, \"inside\", \"inside()\");\n            tryEndBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { catchBlock1 /*caught ex*/, catchBlock2 /*caught ex*/, afterFinallyBlock /*no ex*/});\n\n            catchBlock1.Should().BeOfType<SimpleBlock>();\n            VerifyAllInstructions(catchBlock1, \"cat1\", \"cat1()\");\n            catchBlock1.SuccessorBlocks.Should().Equal(afterFinallyBlock);\n\n            catchBlock2.Should().BeOfType<SimpleBlock>();\n            VerifyAllInstructions(catchBlock2, \"cat2\", \"cat2()\");\n            catchBlock2.SuccessorBlocks.Should().Equal(afterFinallyBlock);\n\n            afterFinallyBlock.Should().BeOfType<SimpleBlock>();\n            VerifyAllInstructions(afterFinallyBlock, \"after\", \"after()\");\n\n            exit.Should().BeOfType<ExitBlock>();\n        }\n\n        [TestMethod]\n        public void Cfg_Try_CatchSome_Finally()\n        {\n            var cfg = Build(@\"\n            before();\n            try\n            {\n                inside();\n            }\n            catch(Exception1 e)\n            {\n                cat1();\n            }\n            catch(Exception2 e)\n            {\n                cat2();\n            }\n            finally\n            {\n                fin();\n            }\n            after();\");\n\n            VerifyCfg(cfg, 7);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var tryStartBlock = blocks[0];\n            var insideTryBlock = blocks[1];\n            var catchBlock1 = blocks[2];\n            var catchBlock2 = blocks[3];\n            var finallyBlock = blocks[4];\n            var afterFinallyBlock = blocks[5];\n            var exit = blocks[6];\n\n            tryStartBlock.Should().BeOfType<SimpleBlock>();\n            VerifyAllInstructions(tryStartBlock, \"before\", \"before()\");\n            tryStartBlock.SuccessorBlocks.Should().Equal(insideTryBlock);\n\n            insideTryBlock.Should().BeOfType<BranchBlock>();\n            VerifyAllInstructions(insideTryBlock, \"inside\", \"inside()\");\n            insideTryBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { catchBlock1 /*caught ex*/, catchBlock2 /*caught ex*/, finallyBlock });\n\n            catchBlock1.Should().BeOfType<SimpleBlock>();\n            VerifyAllInstructions(catchBlock1, \"cat1\", \"cat1()\");\n            catchBlock1.SuccessorBlocks.Should().Equal(finallyBlock);\n\n            catchBlock2.Should().BeOfType<SimpleBlock>();\n            VerifyAllInstructions(catchBlock2, \"cat2\", \"cat2()\");\n            catchBlock2.SuccessorBlocks.Should().Equal(finallyBlock);\n\n            finallyBlock.Should().BeOfType<BranchBlock>();\n            VerifyAllInstructions(finallyBlock, \"fin\", \"fin()\");\n            finallyBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { afterFinallyBlock, exit });\n\n            afterFinallyBlock.Should().BeOfType<SimpleBlock>();\n            VerifyAllInstructions(afterFinallyBlock, \"after\", \"after()\");\n\n            exit.Should().BeOfType<ExitBlock>();\n        }\n\n        [TestMethod]\n        public void Cfg_Try_CatchAll_Finally()\n        {\n            var cfg = Build(@\"\n            before();\n            try\n            {\n                inside();\n            }\n            catch(Exception1 e)\n            {\n                cat1();\n            }\n            catch\n            {\n                cat2();\n            }\n            finally\n            {\n                fin();\n            }\n            after();\");\n\n            VerifyCfg(cfg, 7);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var tryStartBlock = blocks[0];\n            var tryEndBlock = blocks[1];\n            var catchBlock1 = blocks[2];\n            var catchBlock2 = blocks[3];\n            var finallyBlock = blocks[4];\n            var afterFinallyBlock = blocks[5];\n            var exit = blocks[6];\n\n            tryStartBlock.Should().BeOfType<SimpleBlock>();\n            VerifyAllInstructions(tryStartBlock, \"before\", \"before()\");\n            tryStartBlock.SuccessorBlocks.Should().Equal(tryEndBlock);\n\n            tryEndBlock.Should().BeOfType<BranchBlock>();\n            VerifyAllInstructions(tryEndBlock, \"inside\", \"inside()\");\n            tryEndBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { catchBlock1 /*caught ex*/, catchBlock2 /*caught ex*/, finallyBlock /*no ex*/});\n\n            catchBlock1.Should().BeOfType<SimpleBlock>();\n            VerifyAllInstructions(catchBlock1, \"cat1\", \"cat1()\");\n            catchBlock1.SuccessorBlocks.Should().Equal(finallyBlock);\n\n            catchBlock2.Should().BeOfType<SimpleBlock>();\n            VerifyAllInstructions(catchBlock2, \"cat2\", \"cat2()\");\n            catchBlock2.SuccessorBlocks.Should().Equal(finallyBlock);\n\n            finallyBlock.Should().BeOfType<BranchBlock>();\n            VerifyAllInstructions(finallyBlock, \"fin\", \"fin()\");\n            finallyBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { afterFinallyBlock, exit });\n\n            afterFinallyBlock.Should().BeOfType<SimpleBlock>();\n            VerifyAllInstructions(afterFinallyBlock, \"after\", \"after()\");\n\n            exit.Should().BeOfType<ExitBlock>();\n        }\n\n        [TestMethod]\n        public void Cfg_Try_CatchAll_Finally_Conditional_Return()\n        {\n            var cfg = Build(@\"\n            before();\n            try\n            {\n                if (true)\n                {\n                    return;\n                }\n                inside();\n            }\n            catch\n            {\n                cat();\n            }\n            finally\n            {\n                fin();\n            }\n            after();\n            \");\n\n            VerifyCfg(cfg, 8);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var tryStartBlock = blocks[0];\n            var binaryBlock = blocks[1];\n            var returnBlock = blocks[2];\n            var tryEndBlock = blocks[3];\n            var catchBlock = blocks[4];\n            var finallyBlock = blocks[5];\n            var afterFinallyBlock = blocks[6];\n            var exit = blocks[7];\n\n            VerifyAllInstructions(tryStartBlock, \"before\", \"before()\");\n            tryStartBlock.SuccessorBlocks.Should().Equal(binaryBlock);\n\n            VerifyAllInstructions(binaryBlock, \"true\");\n            binaryBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { tryEndBlock /*false*/, returnBlock /*true*/});\n\n            VerifyAllInstructions(returnBlock);\n            returnBlock.SuccessorBlocks.Should().Equal(finallyBlock);\n\n            VerifyAllInstructions(tryEndBlock, \"inside\", \"inside()\");\n            tryEndBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { catchBlock /*exception thrown*/, finallyBlock /*no exception*/});\n\n            VerifyAllInstructions(catchBlock, \"cat\", \"cat()\");\n            catchBlock.SuccessorBlocks.Should().Equal(finallyBlock);\n\n            VerifyAllInstructions(finallyBlock, \"fin\", \"fin()\");\n            finallyBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { afterFinallyBlock, exit });\n\n            VerifyAllInstructions(afterFinallyBlock, \"after\", \"after()\");\n            afterFinallyBlock.SuccessorBlocks.Should().Equal(exit);\n\n            blocks.Last().Should().BeOfType<ExitBlock>();\n        }\n\n        [TestMethod]\n        public void Cfg_Try_CatchSome_Finally_Conditional_Return()\n        {\n            var cfg = Build(@\"\n            before();\n            try\n            {\n                if (true)\n                {\n                    return;\n                }\n                inside();\n            }\n            catch(SomeException)\n            {\n                cat();\n            }\n            finally\n            {\n                fin();\n            }\n            after();\n            \");\n\n            VerifyCfg(cfg, 8);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var tryStartBlock = blocks[0];\n            var binaryBlock = blocks[1];\n            var returnBlock = blocks[2];\n            var tryEndBlock = blocks[3];\n            var catchBlock = blocks[4];\n            var finallyBlock = blocks[5];\n            var afterFinallyBlock = blocks[6];\n            var exit = blocks[7];\n\n            VerifyAllInstructions(tryStartBlock, \"before\", \"before()\");\n            tryStartBlock.SuccessorBlocks.Should().Equal(binaryBlock);\n\n            VerifyAllInstructions(binaryBlock, \"true\");\n            binaryBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { tryEndBlock /*false*/, returnBlock /*true*/});\n\n            VerifyAllInstructions(returnBlock);\n            returnBlock.SuccessorBlocks.Should().Equal(finallyBlock);\n\n            VerifyAllInstructions(tryEndBlock, \"inside\", \"inside()\");\n            tryEndBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { catchBlock /*caught exception thrown*/, finallyBlock });\n\n            VerifyAllInstructions(catchBlock, \"cat\", \"cat()\");\n            catchBlock.SuccessorBlocks.Should().Equal(finallyBlock);\n\n            VerifyAllInstructions(finallyBlock, \"fin\", \"fin()\");\n            finallyBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { afterFinallyBlock, exit });\n\n            VerifyAllInstructions(afterFinallyBlock, \"after\", \"after()\");\n            afterFinallyBlock.SuccessorBlocks.Should().Equal(exit);\n\n            blocks.Last().Should().BeOfType<ExitBlock>();\n        }\n\n        [TestMethod]\n        public void Cfg_Try_CatchSome_Conditional_Return()\n        {\n            var cfg = Build(@\"\n            before();\n            try\n            {\n                if (true)\n                {\n                    return;\n                }\n                inside();\n            }\n            catch(SomeException)\n            {\n                cat();\n            }\n            after();\n            \");\n\n            VerifyCfg(cfg, 7);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var tryStartBlock = blocks[0];\n            var binaryBlock = blocks[1];\n            var returnBlock = blocks[2];\n            var tryEndBlock = blocks[3];\n            var catchBlock = blocks[4];\n            var afterFinallyBlock = blocks[5];\n            var exit = blocks[6];\n\n            VerifyAllInstructions(tryStartBlock, \"before\", \"before()\");\n            tryStartBlock.SuccessorBlocks.Should().Equal(binaryBlock);\n\n            VerifyAllInstructions(binaryBlock, \"true\");\n            binaryBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { tryEndBlock /*false*/, returnBlock /*true*/});\n\n            VerifyAllInstructions(returnBlock);\n            returnBlock.SuccessorBlocks.Should().Equal(exit);\n\n            VerifyAllInstructions(tryEndBlock, \"inside\", \"inside()\");\n            tryEndBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { catchBlock /*caught exception thrown*/, afterFinallyBlock /*no exception*/, exit /*uncaught exception*/});\n\n            VerifyAllInstructions(catchBlock, \"cat\", \"cat()\");\n            catchBlock.SuccessorBlocks.Should().Equal(afterFinallyBlock);\n\n            VerifyAllInstructions(afterFinallyBlock, \"after\", \"after()\");\n            afterFinallyBlock.SuccessorBlocks.Should().Equal(exit);\n\n            blocks.Last().Should().BeOfType<ExitBlock>();\n        }\n\n        [TestMethod]\n        public void Cfg_Try_CatchAll_Conditional_Return()\n        {\n            var cfg = Build(@\"\n            before();\n            try\n            {\n                if (true)\n                {\n                    return;\n                }\n                inside();\n            }\n            catch\n            {\n                cat();\n            }\n            after();\n            \");\n\n            VerifyCfg(cfg, 7);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var tryStartBlock = blocks[0];\n            var binaryBlock = blocks[1];\n            var returnBlock = blocks[2];\n            var tryEndBlock = blocks[3];\n            var catchBlock = blocks[4];\n            var afterFinallyBlock = blocks[5];\n            var exit = blocks[6];\n\n            VerifyAllInstructions(tryStartBlock, \"before\", \"before()\");\n            tryStartBlock.SuccessorBlocks.Should().Equal(binaryBlock);\n\n            VerifyAllInstructions(binaryBlock, \"true\");\n            binaryBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { tryEndBlock /*false*/, returnBlock /*true*/});\n\n            VerifyAllInstructions(returnBlock);\n            returnBlock.SuccessorBlocks.Should().Equal(exit);\n\n            VerifyAllInstructions(tryEndBlock, \"inside\", \"inside()\");\n            tryEndBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { catchBlock /*caught exception thrown*/, afterFinallyBlock /*no exception*/});\n\n            VerifyAllInstructions(catchBlock, \"cat\", \"cat()\");\n            catchBlock.SuccessorBlocks.Should().Equal(afterFinallyBlock);\n\n            VerifyAllInstructions(afterFinallyBlock, \"after\", \"after()\");\n            afterFinallyBlock.SuccessorBlocks.Should().Equal(exit);\n\n            blocks.Last().Should().BeOfType<ExitBlock>();\n        }\n\n        [TestMethod]\n        public void Cfg_TryCatch_Exception_Filter()\n        {\n            var cfg = Build(@\"\n            cw0();\n            try\n            {\n                cw1();\n            }\n            catch(Exception e) when (e is InvalidOperationException)\n            {\n                cw2();\n            }\n            cw5();\");\n\n            VerifyCfg(cfg, 6);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var tryStartBlock = blocks[0];\n            var tryBodyBlock = blocks[1];\n            var whenBlock = blocks[2];\n            var catchBlock = blocks[3];\n            var afterTryBlock = blocks[4];\n            var exit = blocks.Last();\n\n            tryStartBlock.Should().BeOfType<SimpleBlock>();\n            VerifyAllInstructions(tryStartBlock, \"cw0\", \"cw0()\");\n            tryStartBlock.SuccessorBlocks.Should().Equal(tryBodyBlock);\n\n            tryBodyBlock.Should().BeOfType<BranchBlock>();\n            VerifyAllInstructions(tryBodyBlock, \"cw1\", \"cw1()\");\n            tryBodyBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { whenBlock, afterTryBlock, exit });\n\n            whenBlock.Should().BeOfType<BinaryBranchBlock>();\n            VerifyAllInstructions(whenBlock, \"e\", \"e is InvalidOperationException\");\n            whenBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { catchBlock, afterTryBlock });\n\n            catchBlock.Should().BeOfType<SimpleBlock>();\n            VerifyAllInstructions(catchBlock, \"cw2\", \"cw2()\");\n            catchBlock.SuccessorBlocks.Should().Equal(afterTryBlock);\n\n            afterTryBlock.Should().BeOfType<SimpleBlock>();\n            VerifyAllInstructions(afterTryBlock, \"cw5\", \"cw5()\");\n            afterTryBlock.SuccessorBlocks.Should().Equal(exit);\n\n            exit.Should().BeOfType<ExitBlock>();\n        }\n\n        [TestMethod]\n        public void Cfg_TryCatch_ThrowInsideTry()\n        {\n            var cfg = Build(@\"\n            bool shouldCatch = false;\n            try\n            {\n                shouldCatch = true;\n                throw new InvalidOperationException(\"\"bar\"\");\n            }\n            catch(Exception e) when (shouldCatch)\n            {\n                cw2();\n            }\n            cw5();\");\n\n            VerifyCfg(cfg, 6);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var tryStartBlock = blocks[0];\n            var tryBodyBlock = blocks[1];\n            var whenBlock = blocks[2];\n            var catchBlock = blocks[3];\n            var afterTryBlock = blocks[4];\n            var exit = blocks.Last();\n\n            tryStartBlock.Should().BeOfType<SimpleBlock>();\n            VerifyAllInstructions(tryStartBlock, \"false\", \"shouldCatch = false\");\n            tryStartBlock.SuccessorBlocks.Should().Equal(tryBodyBlock);\n\n            tryBodyBlock.Should().BeOfType<BranchBlock>();\n            VerifyAllInstructions(tryBodyBlock, \"true\", \"shouldCatch = true\", \"\\\"bar\\\"\", \"new InvalidOperationException(\\\"bar\\\")\");\n            tryBodyBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { whenBlock, afterTryBlock, exit });\n\n            whenBlock.Should().BeOfType<BinaryBranchBlock>();\n            VerifyAllInstructions(whenBlock, \"shouldCatch\");\n            whenBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { catchBlock, afterTryBlock });\n\n            catchBlock.Should().BeOfType<SimpleBlock>();\n            VerifyAllInstructions(catchBlock, \"cw2\", \"cw2()\");\n            catchBlock.SuccessorBlocks.Should().Equal(afterTryBlock);\n\n            afterTryBlock.Should().BeOfType<SimpleBlock>();\n            VerifyAllInstructions(afterTryBlock, \"cw5\", \"cw5()\");\n            afterTryBlock.SuccessorBlocks.Should().Equal(exit);\n\n            exit.Should().BeOfType<ExitBlock>();\n        }\n\n        [TestMethod]\n        public void Cfg_TryCatch_WithBreak_Inside_DoWhile()\n        {\n            var cfg = Build(@\"\n            var attempts = 0;\n            do\n            {\n                cw0();\n                try\n                {\n                    attempts++;\n                    cw1();\n                    break;\n                }\n                catch(Exception e)\n                {\n                    cw2();\n                }\n            } while (true);\n            cw5();\");\n\n            VerifyCfg(cfg, 8);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var beforeDoBlock = (SimpleBlock)blocks[0];\n            var doBlock = (SimpleBlock)blocks[1];\n            var tryBody = (BranchBlock)blocks[2];\n            var tryStatementBranch = (BranchBlock)blocks[3];\n            var catchBlock = (SimpleBlock)blocks[4];\n            var whileStmt = (BinaryBranchBlock)blocks[5];\n            var afterDoWhile = (SimpleBlock)blocks[6];\n            var exit = (ExitBlock)blocks.Last();\n\n            VerifyAllInstructions(beforeDoBlock, \"0\", \"attempts = 0\");\n            beforeDoBlock.SuccessorBlocks.Should().Equal(doBlock);\n\n            VerifyAllInstructions(doBlock, \"cw0\", \"cw0()\");\n            doBlock.SuccessorBlocks.Should().Equal(tryBody);\n\n            VerifyAllInstructions(tryBody, \"attempts\", \"attempts++\", \"cw1\", \"cw1()\");\n            // this is wrong, the tryBody should not have a connection with whileStmt, it can lead to FNs\n            tryBody.SuccessorBlocks.Should().BeEquivalentTo(new Block[] { catchBlock, whileStmt, afterDoWhile });\n\n            tryStatementBranch.ReversedInstructions.Should().BeEmpty();\n            tryStatementBranch.SuccessorBlocks.Should().BeEquivalentTo(new Block[] { catchBlock, whileStmt });\n\n            VerifyAllInstructions(catchBlock, \"cw2\", \"cw2()\");\n            catchBlock.SuccessorBlocks.Should().Equal(whileStmt);\n\n            VerifyAllInstructions(whileStmt, \"true\");\n            whileStmt.TrueSuccessorBlock.Should().Be(doBlock);\n            whileStmt.FalseSuccessorBlock.Should().Be(afterDoWhile);\n\n            VerifyAllInstructions(afterDoWhile, \"cw5\", \"cw5()\");\n            afterDoWhile.SuccessorBlocks.Should().Equal(exit);\n\n            exit.Should().BeOfType<ExitBlock>();\n        }\n\n        // This should be fixed in https://github.com/SonarSource/sonar-dotnet/issues/474\n        [TestMethod]\n        public void Cfg_TryCatchFinally_InsideLoop_WithBreakInsideTry_AndContinueInsideCatch()\n        {\n            var cfg = Build(@\"\n            do\n            {\n                cw0();\n                try\n                {\n                    cw1();\n                    break;\n                }\n                catch(ArgumentNullException e)\n                {\n                    cw2();\n                    continue;\n                }\n                finally\n                {\n                    cw3();\n                    // CS0157 control cannot leave the body of a finally, so we cannot have jumps here\n                }\n                // the below is not reachable\n                cw4();\n            } while (true);\n            cw5();\");\n\n            VerifyCfg(cfg, 9);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var doBeforeTry = (SimpleBlock)blocks[0];\n            var tryStatement = (BranchBlock)blocks[1];\n            var tryBody = (BranchBlock)blocks[2];\n            var catchBody = (JumpBlock)blocks[3];\n            var finallyBlock = (BranchBlock)blocks[4];\n            var afterTry = (SimpleBlock)blocks[5];\n            var whileStmt = (BinaryBranchBlock)blocks[6];\n            var afterDoWhile = (SimpleBlock)blocks[7];\n            var exit = (ExitBlock)blocks.Last();\n\n            VerifyAllInstructions(doBeforeTry, \"cw0\", \"cw0()\");\n            doBeforeTry.SuccessorBlocks.Should().Equal(tryStatement);\n\n            VerifyAllInstructions(tryStatement, \"cw1\", \"cw1()\");\n            tryStatement.SuccessorBlocks.Should().BeEquivalentTo(new Block[] { catchBody, finallyBlock, afterDoWhile });\n\n            tryBody.SuccessorBlocks.Should().BeEquivalentTo(new Block[] { catchBody, finallyBlock });\n\n            VerifyAllInstructions(catchBody, \"cw2\", \"cw2()\");\n            catchBody.SuccessorBlock.Should().Be(whileStmt);\n\n            // ToDo: this is wrong, `finally` should be connected to\n            // - EXIT\n            // - WHILE (because of `continue`)\n            // - afterDoWhile (because of `break`)\n            finallyBlock.SuccessorBlocks.Should().BeEquivalentTo(new Block[] { afterTry, exit });\n            afterTry.SuccessorBlock.Should().Be(whileStmt);\n\n            VerifyAllInstructions(whileStmt, \"true\");\n            whileStmt.TrueSuccessorBlock.Should().Be(doBeforeTry);\n            whileStmt.FalseSuccessorBlock.Should().Be(afterDoWhile);\n\n            VerifyAllInstructions(afterDoWhile, \"cw5\", \"cw5()\");\n            afterDoWhile.SuccessorBlocks.Should().Equal(exit);\n\n            exit.Should().BeOfType<ExitBlock>();\n        }\n\n        // This should be fixed in https://github.com/SonarSource/sonar-dotnet/issues/474\n        [TestMethod]\n        public void Cfg_TryFinally_InsideLoop_WithBreakAndContinueInsideTry()\n        {\n            var cfg = Build(@\"\n            do\n            {\n                cw0();\n                try\n                {\n                    if (cond)\n                    {\n                        cw1();\n                        continue;\n                    }\n                    else\n                    {\n                        cw2();\n                        break;\n                    }\n                }\n                finally\n                {\n                    cw3();\n                }\n                // the below is not reachable\n                cw4();\n            } while (true);\n            cw5();\");\n\n            VerifyCfg(cfg, 10);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var doBeforeTry = (SimpleBlock)blocks[0];\n            var ifInsideTry = (BinaryBranchBlock)blocks[1];\n            var thenContinue = (JumpBlock)blocks[2];\n            var elseIf = (JumpBlock)blocks[3];\n            var tryStatement = (BranchBlock)blocks[4];\n            var finallyBody = (BranchBlock)blocks[5];\n            var afterTry = (SimpleBlock)blocks[6];\n            var whileStmt = (BinaryBranchBlock)blocks[7];\n            var afterDoWhile = (SimpleBlock)blocks[8];\n            var exit = (ExitBlock)blocks.Last();\n\n            VerifyAllInstructions(doBeforeTry, \"cw0\", \"cw0()\");\n            doBeforeTry.SuccessorBlock.Should().Be(ifInsideTry);\n\n            ifInsideTry.TrueSuccessorBlock.Should().Be(thenContinue);\n            ifInsideTry.FalseSuccessorBlock.Should().Be(elseIf);\n\n            VerifyAllInstructions(thenContinue, \"cw1\", \"cw1()\");\n            // ToDo: it should lead to `finally` which should lead to `whileStmt`\n            thenContinue.SuccessorBlock.Should().Be(whileStmt);\n\n            VerifyAllInstructions(elseIf, \"cw2\", \"cw2()\");\n            // ToDo: it should lead to `finally` which should lead to `afterDoWhile`\n            elseIf.SuccessorBlock.Should().Be(afterDoWhile);\n\n            // ToDo: this is weird and is basically skipped\n            tryStatement.SuccessorBlocks.Should().Equal(finallyBody);\n\n            finallyBody.SuccessorBlocks.Should().BeEquivalentTo(new Block[] { afterTry, exit });\n            afterTry.SuccessorBlock.Should().Be(whileStmt);\n\n            VerifyAllInstructions(whileStmt, \"true\");\n            whileStmt.TrueSuccessorBlock.Should().Be(doBeforeTry);\n            whileStmt.FalseSuccessorBlock.Should().Be(afterDoWhile);\n\n            VerifyAllInstructions(afterDoWhile, \"cw5\", \"cw5()\");\n            afterDoWhile.SuccessorBlocks.Should().Equal(exit);\n\n            exit.Should().BeOfType<ExitBlock>();\n        }\n\n        [TestMethod]\n        public void Cfg_TryCatch_Inside_DoWhile_WithThrow_InsideCatch()\n        {\n            var cfg = Build(@\"\n            var attempts = 0;\n            do\n            {\n                cw0();\n                try\n                {\n                    attempts++;\n                    cw1();\n                    break;\n                }\n                catch(Exception e)\n                {\n                    cw2();\n                    if (attempts > retries)\n                    {\n                        cw3();\n                        throw;\n                    }\n                    cw4();\n                }\n            } while (true);\n            cw5();\");\n\n            VerifyCfg(cfg, 10);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var beforeDoBlock = (SimpleBlock)blocks[0];\n            var insideDoBeforeTry = (SimpleBlock)blocks[1];\n            var insideTry = (BranchBlock)blocks[2];\n\n            // this block is initially created for the `insideTry`,\n            // and it gets replaced when seeing the `break;`\n            var temporaryStrayBlock = (BranchBlock)blocks[3];\n\n            var catchBodyWithIf = (BinaryBranchBlock)blocks[4];\n            var insideIfInsideCatch = (JumpBlock)blocks[5];\n            var afterIfInsideCatch = (SimpleBlock)blocks[6];\n            var whileStmt = (BinaryBranchBlock)blocks[7];\n            var afterDoWhile = (SimpleBlock)blocks[8];\n            var exit = (ExitBlock)blocks.Last();\n\n            VerifyAllInstructions(beforeDoBlock, \"0\", \"attempts = 0\");\n            beforeDoBlock.SuccessorBlocks.Should().Equal(insideDoBeforeTry);\n\n            VerifyAllInstructions(insideDoBeforeTry, \"cw0\", \"cw0()\");\n            insideDoBeforeTry.SuccessorBlocks.Should().Equal(insideTry);\n\n            VerifyAllInstructions(insideTry, \"attempts\", \"attempts++\", \"cw1\", \"cw1()\");\n            insideTry.SuccessorBlocks.Should().BeEquivalentTo(new Block[] { catchBodyWithIf, whileStmt, afterDoWhile });\n\n            temporaryStrayBlock.ReversedInstructions.Should().BeEmpty();\n            temporaryStrayBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { catchBodyWithIf, whileStmt });\n\n            VerifyAllInstructions(catchBodyWithIf, \"cw2\", \"cw2()\", \"attempts\", \"retries\", \"attempts > retries\");\n            catchBodyWithIf.TrueSuccessorBlock.Should().Be(insideIfInsideCatch);\n            catchBodyWithIf.FalseSuccessorBlock.Should().Be(afterIfInsideCatch);\n\n            VerifyAllInstructions(insideIfInsideCatch, \"cw3\", \"cw3()\");\n            insideIfInsideCatch.SuccessorBlocks.Should().Equal(exit);\n\n            VerifyAllInstructions(afterIfInsideCatch, \"cw4\", \"cw4()\");\n            afterIfInsideCatch.SuccessorBlocks.Should().Equal(whileStmt);\n\n            VerifyAllInstructions(whileStmt, \"true\");\n            whileStmt.TrueSuccessorBlock.Should().Be(insideDoBeforeTry);\n            whileStmt.FalseSuccessorBlock.Should().Be(afterDoWhile);\n\n            VerifyAllInstructions(afterDoWhile, \"cw5\", \"cw5()\");\n            afterDoWhile.SuccessorBlocks.Should().Equal(exit);\n\n            exit.Should().BeOfType<ExitBlock>();\n        }\n\n        [TestMethod]\n        public void Cfg_TryFinally_Inside_DoWhile_WithThrow_InsideCatch()\n        {\n            var cfg = Build(@\"\n            var attempts = 0;\n            do\n            {\n                cw0();\n                try\n                {\n                    if (attempts)\n                        cw1();\n                }\n                finally\n                {\n                    attempts = 1;\n                }\n            } while (true);\n            cw5();\");\n\n            VerifyCfg(cfg, 9);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var beforeDoBlock = (SimpleBlock)blocks[0];\n            var insideDoBeforeTry = (SimpleBlock)blocks[1];\n            var insideTryIfStatement = (BinaryBranchBlock)blocks[2];\n            var insideIf = (SimpleBlock)blocks[3];\n            var finallyBifurcation = (BranchBlock)blocks[4];\n            var finallyBlock = (BranchBlock)blocks[5];\n            var whileStmt = (BinaryBranchBlock)blocks[6];\n            var afterDoWhile = (SimpleBlock)blocks[7];\n            var exit = (ExitBlock)blocks.Last();\n\n            VerifyAllInstructions(beforeDoBlock, \"0\", \"attempts = 0\");\n            beforeDoBlock.SuccessorBlocks.Should().Equal(insideDoBeforeTry);\n\n            VerifyAllInstructions(insideDoBeforeTry, \"cw0\", \"cw0()\");\n            insideDoBeforeTry.SuccessorBlocks.Should().Equal(insideTryIfStatement);\n\n            VerifyAllInstructions(insideTryIfStatement, \"attempts\");\n            insideTryIfStatement.TrueSuccessorBlock.Should().Be(insideIf);\n            insideTryIfStatement.FalseSuccessorBlock.Should().Be(finallyBifurcation);\n\n            insideIf.SuccessorBlock.Should().Be(finallyBifurcation);\n\n            finallyBifurcation.SuccessorBlocks.Should().Equal(finallyBlock);\n\n            finallyBlock.SuccessorBlocks.Should().BeEquivalentTo(new Block[] { whileStmt, exit });\n\n            whileStmt.TrueSuccessorBlock.Should().Be(insideDoBeforeTry);\n            whileStmt.FalseSuccessorBlock.Should().Be(afterDoWhile);\n\n            afterDoWhile.SuccessorBlock.Should().Be(exit);\n\n            exit.Should().BeOfType<ExitBlock>();\n        }\n\n        [TestMethod]\n        public void Cfg_TryCatchFinally_Return_Nested()\n        {\n            var cfg = Build(@\"\n            before_out();\n            try\n            {\n                before_in();\n                try\n                {\n                    foo();\n                    return;\n                }\n                catch\n                {\n                    cat_in();\n                }\n                finally\n                {\n                    fin_in();\n                }\n                after_in();\n            }\n            catch\n            {\n                cat_out();\n            }\n            finally\n            {\n                fin_out();\n            }\n            after_out();\");\n\n            VerifyCfg(cfg, 11);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var beforeOuterTry = blocks[0];\n            var innerTryStartBlock = blocks[1];\n            var innerReturnBlock = blocks[2];\n            var innerTryEndBlock = blocks[3];\n            var innerCatchBlock = blocks[4];\n            var innerFinallyBlock = blocks[5];\n            var outerTryBlock = blocks[6]; // innerAfterFinallyBlock is not generated, its instructions are in outerTryBlock\n            var outerCatchBlock = blocks[7];\n            var outerFinallyBlock = blocks[8];\n            var afterFinallyBlock = blocks[9];\n            var exit = blocks[10];\n\n            exit.Should().BeOfType<ExitBlock>();\n\n            beforeOuterTry.Should().BeOfType<SimpleBlock>();\n            beforeOuterTry.SuccessorBlocks.Should().Equal(innerTryStartBlock);\n\n            innerTryStartBlock.Should().BeOfType<BranchBlock>();\n            innerTryStartBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { innerReturnBlock /*no ex*/, outerCatchBlock, outerFinallyBlock });\n\n            innerReturnBlock.Should().BeOfType<BranchBlock>();\n            innerReturnBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { innerTryEndBlock, innerCatchBlock });\n\n            innerTryEndBlock.Should().BeOfType<JumpBlock>();\n            VerifyAllInstructions(innerTryEndBlock, \"foo\", \"foo()\");\n            innerTryEndBlock.SuccessorBlocks.Should().Equal(innerFinallyBlock);\n\n            innerCatchBlock.Should().BeOfType<SimpleBlock>();\n            innerCatchBlock.SuccessorBlocks.Should().Equal(innerFinallyBlock);\n\n            innerFinallyBlock.Should().BeOfType<BranchBlock>();\n            innerFinallyBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { outerTryBlock, outerFinallyBlock });\n\n            outerTryBlock.Should().BeOfType<BranchBlock>();\n            outerTryBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { outerCatchBlock /*ex*/, outerFinallyBlock /*no ex*/});\n\n            outerCatchBlock.Should().BeOfType<SimpleBlock>();\n            outerCatchBlock.SuccessorBlocks.Should().Equal(outerFinallyBlock);\n\n            outerFinallyBlock.Should().BeOfType<BranchBlock>();\n            outerFinallyBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { afterFinallyBlock, exit });\n\n            afterFinallyBlock.Should().BeOfType<SimpleBlock>();\n            afterFinallyBlock.SuccessorBlocks.Should().Equal(exit);\n        }\n\n        [TestMethod]\n        public void Cfg_TryCatch_ReturnVariable_InCatch()\n        {\n            var cfg = Build(@\"\n                var number = 5;\n                try\n                {\n                    bar();\n                    return 0;\n                }\n                catch\n                {\n                    return number;\n                }\n                foo();\");\n\n            VerifyCfg(cfg, 6);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var beforeOuterTry = (SimpleBlock)blocks[0];\n            var tryStatementBlock = (BranchBlock)blocks[1];\n            var tryReturn = (JumpBlock)blocks[2];\n            var catchReturn = (JumpBlock)blocks[3];\n            var afterTry = (SimpleBlock)blocks[4];\n            var exit = blocks[5];\n\n            VerifyAllInstructions(beforeOuterTry, \"5\", \"number = 5\");\n            beforeOuterTry.SuccessorBlocks.Should().Equal(tryStatementBlock);\n\n            VerifyNoInstruction(tryStatementBlock);\n            tryStatementBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { tryReturn, catchReturn });\n\n            VerifyAllInstructions(tryReturn, \"bar\", \"bar()\", \"0\");\n            tryReturn.SuccessorBlocks.Should().Equal(exit);\n\n            VerifyAllInstructions(catchReturn, \"number\");\n            catchReturn.SuccessorBlocks.Should().Equal(exit);\n\n            VerifyAllInstructions(afterTry, \"foo\", \"foo()\");\n            afterTry.SuccessorBlocks.Should().Equal(exit);\n\n            exit.Should().BeOfType<ExitBlock>();\n        }\n\n        [TestMethod]\n        public void Cfg_TryCatch_NestedReturnVariable_InCatch()\n        {\n            var cfg = Build(@\"\n                var number = 5;\n                try\n                {\n                    bar();\n                    return 0;\n                }\n                catch\n                {\n                    if (cond) return number;\n                }\n                foo();\");\n\n            VerifyCfg(cfg, 7);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var beforeOuterTry = (SimpleBlock)blocks[0];\n            var tryStatementBlock = (BranchBlock)blocks[1];\n            var tryReturn = (JumpBlock)blocks[2];\n            var ifInsideCatch = (BinaryBranchBlock)blocks[3];\n            var returnInCatch = (JumpBlock)blocks[4];\n            var afterTry = (SimpleBlock)blocks[5];\n            var exit = (ExitBlock)blocks[6];\n\n            VerifyAllInstructions(beforeOuterTry, \"5\", \"number = 5\");\n            beforeOuterTry.SuccessorBlocks.Should().Equal(tryStatementBlock);\n\n            VerifyNoInstruction(tryStatementBlock);\n            tryStatementBlock.SuccessorBlocks.Should().BeEquivalentTo(new Block[] { tryReturn, ifInsideCatch });\n\n            VerifyAllInstructions(tryReturn, \"bar\", \"bar()\", \"0\");\n            tryReturn.SuccessorBlocks.Should().Equal(exit);\n\n            ifInsideCatch.TrueSuccessorBlock.Should().Be(returnInCatch);\n            ifInsideCatch.FalseSuccessorBlock.Should().Be(afterTry);\n\n            VerifyAllInstructions(returnInCatch, \"number\");\n            returnInCatch.SuccessorBlocks.Should().Equal(exit);\n\n            VerifyAllInstructions(afterTry, \"foo\", \"foo()\");\n            afterTry.SuccessorBlocks.Should().Equal(exit);\n\n            exit.Should().BeOfType<ExitBlock>();\n        }\n\n        [TestMethod]\n        public void Cfg_TryCatch_MultipleReturnsInTry()\n        {\n            var cfg = Build(@\"\n                beforeTry();\n                try\n                {\n                    if (cond) return;\n                    insideOne();\n                    if (cond) return;\n                    insideTwo();\n                }\n                catch\n                {\n                    catchOne();\n                }\n                afterTry();\");\n\n            VerifyCfg(cfg, 9);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var beforeOuterTry = (SimpleBlock)blocks[0];\n            var firstIf = (BinaryBranchBlock)blocks[1];\n            var firstIfReturn = (JumpBlock)blocks[2];\n            var secondIf = (BinaryBranchBlock)blocks[3];\n            var secondIfReturn = (JumpBlock)blocks[4];\n            var tryStatementBranch = (BranchBlock)blocks[5];\n            var insideCatch = (SimpleBlock)blocks[6];\n            var afterTry = (SimpleBlock)blocks[7];\n            var exit = (ExitBlock)blocks[8];\n\n            beforeOuterTry.SuccessorBlocks.Should().Equal(firstIf);\n\n            firstIf.TrueSuccessorBlock.Should().Be(firstIfReturn);\n            firstIfReturn.SuccessorBlock.Should().Be(exit);\n            firstIf.FalseSuccessorBlock.Should().Be(secondIf);\n\n            secondIf.TrueSuccessorBlock.Should().Be(secondIfReturn);\n            secondIfReturn.SuccessorBlock.Should().Be(exit);\n            secondIf.FalseSuccessorBlock.Should().Be(tryStatementBranch);\n\n            // ToDo: this tryStatementBranch is not always used as such, or is it?\n            tryStatementBranch.SuccessorBlocks.Should().BeEquivalentTo(new[] { insideCatch, afterTry });\n\n            insideCatch.SuccessorBlocks.Should().Equal(afterTry);\n            afterTry.SuccessorBlocks.Should().Equal(exit);\n\n            exit.Should().BeOfType<ExitBlock>();\n        }\n\n        #endregion\n\n        #region Switch\n\n        [TestMethod]\n        public void Cfg_Switch()\n        {\n            var cfg = Build(\"cw0(); switch(a) { case 1: case 2: cw1(); break; case 3: default: case 4: cw2(); break; } cw3();\");\n            VerifyCfg(cfg, 9);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var cw0 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw0\")) as BranchBlock;\n            var cw1 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw1\")) as JumpBlock;\n            var cw2 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw2\")) as JumpBlock;\n            var cw3 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw3\"));\n\n            var case1Jump = blocks[3] as JumpBlock;\n            var defaultCaseJump = blocks[6] as JumpBlock;\n\n            var branchCase1 = blocks[1] as BinaryBranchBlock;\n            var branchCase2 = blocks[2] as BinaryBranchBlock;\n            var branchCase3 = blocks[4] as BinaryBranchBlock;\n            var branchDefault = blocks[5] as BinaryBranchBlock;\n\n            var exitBlock = cfg.ExitBlock;\n\n            cw0.Should().BeSameAs(cfg.EntryBlock);\n\n            cw0.SuccessorBlocks.Should().Equal(branchCase1);\n            branchCase1.TrueSuccessorBlock.Should().Be(case1Jump);\n            branchCase1.FalseSuccessorBlock.Should().Be(branchCase2);\n\n            branchCase2.TrueSuccessorBlock.Should().Be(case1Jump);\n            branchCase2.FalseSuccessorBlock.Should().Be(branchCase3);\n\n            case1Jump.SuccessorBlocks.Should().Equal(cw3);\n\n            branchCase3.TrueSuccessorBlock.Should().Be(defaultCaseJump);\n            branchCase3.FalseSuccessorBlock.Should().Be(branchDefault);\n\n            branchDefault.TrueSuccessorBlock.Should().Be(defaultCaseJump);\n            branchDefault.FalseSuccessorBlock.Should().Be(defaultCaseJump);\n\n            defaultCaseJump.SuccessorBlocks.Should().Equal(cw3);\n\n            cw1.SuccessorBlocks.Should().Equal(cw3);\n            cw2.SuccessorBlocks.Should().Equal(cw3);\n            cw3.SuccessorBlocks.Should().Equal(exitBlock);\n\n            VerifyAllInstructions(cfg.EntryBlock, \"cw0\", \"cw0()\", \"a\");\n            VerifyAllInstructions(cw1, \"cw1\", \"cw1()\");\n        }\n\n        [TestMethod]\n        public void Cfg_Switch_NoDefault()\n        {\n            var cfg = Build(\"cw0(); switch(a) { case 1: case 2: cw1(); break; case 3: case 4: cw2(); break; } cw3();\");\n            VerifyCfg(cfg, 9);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var cw0 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw0\")) as BranchBlock;\n            var cw1 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw1\")) as JumpBlock;\n            var cw2 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw2\")) as JumpBlock;\n            var cw3 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw3\"));\n\n            var case1Jump = blocks[3] as JumpBlock;\n            var case3Jump = blocks[6] as JumpBlock;\n\n            var branchCase1 = blocks[1] as BinaryBranchBlock;\n            var branchCase2 = blocks[2] as BinaryBranchBlock;\n            var branchCase3 = blocks[4] as BinaryBranchBlock;\n            var branchDefault = blocks[5] as BinaryBranchBlock;\n\n            var exitBlock = cfg.ExitBlock;\n\n            cw0.Should().BeSameAs(cfg.EntryBlock);\n\n            cw0.SuccessorBlocks.Should().Equal(branchCase1);\n            case1Jump.SuccessorBlocks.Should().Equal(cw3);\n            case3Jump.SuccessorBlocks.Should().Equal(cw3);\n\n            cw1.SuccessorBlocks.Should().Equal(cw3);\n            cw2.SuccessorBlocks.Should().Equal(cw3);\n            cw3.SuccessorBlocks.Should().Equal(exitBlock);\n\n            branchCase2.Should().NotBeNull();\n            branchCase3.Should().NotBeNull();\n            branchDefault.Should().NotBeNull();\n        }\n\n        [TestMethod]\n        public void Cfg_Switch_GotoCase()\n        {\n            var cfg = Build(\"cw0(); switch(a) { case 1: case 2: cw1(); goto case 3; case 3: default: case 4: cw2(); break; } cw3();\");\n            VerifyCfg(cfg, 9);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var cw0 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw0\")) as BranchBlock;\n            var cw1 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw1\")) as JumpBlock;\n            var cw2 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw2\")) as JumpBlock;\n            var cw3 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw3\"));\n\n            var case1Jump = blocks[3] as JumpBlock;\n            var defaultCaseJump = blocks[6] as JumpBlock;\n\n            var branchCase1 = blocks[1] as BinaryBranchBlock;\n            var branchCase2 = blocks[2] as BinaryBranchBlock;\n            var branchCase3 = blocks[4] as BinaryBranchBlock;\n            var branchDefault = blocks[5] as BinaryBranchBlock;\n\n            var exitBlock = cfg.ExitBlock;\n\n            cw0.Should().BeSameAs(cfg.EntryBlock);\n\n            cw0.SuccessorBlocks.Should().Equal(branchCase1);\n            case1Jump.SuccessorBlocks.Should().Equal(defaultCaseJump);\n            defaultCaseJump.SuccessorBlocks.Should().Equal(cw3);\n\n            branchCase1.TrueSuccessorBlock.Should().Be(case1Jump);\n            branchCase1.FalseSuccessorBlock.Should().Be(branchCase2);\n\n            branchCase2.TrueSuccessorBlock.Should().Be(case1Jump);\n            branchCase2.FalseSuccessorBlock.Should().Be(branchCase3);\n\n            branchCase3.TrueSuccessorBlock.Should().Be(defaultCaseJump);\n            branchCase3.FalseSuccessorBlock.Should().Be(branchDefault);\n\n            branchDefault.TrueSuccessorBlock.Should().Be(defaultCaseJump);\n            branchDefault.FalseSuccessorBlock.Should().Be(defaultCaseJump);\n\n            cw1.SuccessorBlocks.Should().Equal(defaultCaseJump);\n            cw2.SuccessorBlocks.Should().Equal(cw3);\n            cw3.SuccessorBlocks.Should().Equal(exitBlock);\n        }\n\n        [TestMethod]\n        public void Cfg_Switch_Null()\n        {\n            var cfg = Build(\"cw0(); switch(a) { case \\\"\\\": case null: cw1(); break; case \\\"a\\\": cw2(); goto case null; } cw3();\");\n            VerifyCfg(cfg, 8);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var cw0 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw0\")) as BranchBlock;\n            var cw3 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw3\"));\n\n            var caseEmptyJump = blocks[3] as JumpBlock;\n            var caseAJump = blocks[5] as JumpBlock;\n\n            var branchEmpty = blocks[1] as BinaryBranchBlock;\n            var branchNull = blocks[2] as BinaryBranchBlock;\n            var branchA = blocks[4] as BinaryBranchBlock;\n\n            cw0.Should().BeSameAs(cfg.EntryBlock);\n\n            cw0.SuccessorBlocks.Should().Equal(branchEmpty);\n            caseEmptyJump.SuccessorBlocks.Should().Equal(cw3);\n            caseAJump.SuccessorBlocks.Should().Equal(caseEmptyJump);\n\n            branchEmpty.TrueSuccessorBlock.Should().Be(caseEmptyJump);\n            branchEmpty.FalseSuccessorBlock.Should().Be(branchNull);\n\n            branchNull.TrueSuccessorBlock.Should().Be(caseEmptyJump);\n            branchNull.FalseSuccessorBlock.Should().Be(branchA);\n\n            branchA.TrueSuccessorBlock.Should().Be(caseAJump);\n            branchA.FalseSuccessorBlock.Should().Be(cw3);\n        }\n\n        [TestMethod]\n        public void Cfg_Switch_GotoDefault()\n        {\n            var cfg = Build(\"cw0(); switch(a) { case 1: case 2: cw1(); goto default; case 3: default: case 4: cw2(); break; } cw3();\");\n            VerifyCfg(cfg, 9);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var cw0 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw0\")) as BranchBlock;\n            var cw1 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw1\")) as JumpBlock;\n            var cw2 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw2\")) as JumpBlock;\n            var cw3 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw3\"));\n\n            var case1Jump = blocks[3] as JumpBlock;\n            var defaultCaseJump = blocks[6] as JumpBlock;\n\n            var branchCase1 = blocks[1] as BinaryBranchBlock;\n            var branchCase2 = blocks[2] as BinaryBranchBlock;\n            var branchCase3 = blocks[4] as BinaryBranchBlock;\n            var branchDefault = blocks[5] as BinaryBranchBlock;\n\n            var exitBlock = cfg.ExitBlock;\n\n            cw0.Should().BeSameAs(cfg.EntryBlock);\n\n            cw0.SuccessorBlocks.Should().Equal(branchCase1);\n            case1Jump.SuccessorBlocks.Should().Equal(defaultCaseJump);\n            defaultCaseJump.SuccessorBlocks.Should().Equal(cw3);\n\n            branchCase1.TrueSuccessorBlock.Should().Be(case1Jump);\n            branchCase1.FalseSuccessorBlock.Should().Be(branchCase2);\n\n            branchCase2.TrueSuccessorBlock.Should().Be(case1Jump);\n            branchCase2.FalseSuccessorBlock.Should().Be(branchCase3);\n\n            branchCase3.TrueSuccessorBlock.Should().Be(defaultCaseJump);\n            branchCase3.FalseSuccessorBlock.Should().Be(branchDefault);\n\n            branchDefault.TrueSuccessorBlock.Should().Be(defaultCaseJump);\n            branchDefault.FalseSuccessorBlock.Should().Be(defaultCaseJump);\n\n            cw1.SuccessorBlocks.Should().Equal(defaultCaseJump);\n            cw2.SuccessorBlocks.Should().Equal(cw3);\n            cw3.SuccessorBlocks.Should().Equal(exitBlock);\n        }\n\n        [TestMethod]\n        public void Cfg_Switch_Patterns_Default()\n        {\n            var cfg = Build(\"cw0(); switch(o) { case int i: case string s: cw1(); break; default: case double d: cw2(); break; } cw3();\");\n\n            VerifyCfg(cfg, 8);\n\n            var switchBlock = (BranchBlock)cfg.Blocks.ElementAt(0);\n            var caseIntBlock = (BinaryBranchBlock)cfg.Blocks.ElementAt(1);\n            var caseStringBlock = (BinaryBranchBlock)cfg.Blocks.ElementAt(2);\n            var firstSectionBlock = (JumpBlock)cfg.Blocks.ElementAt(3);\n            var caseDoubleBlock = (BinaryBranchBlock)cfg.Blocks.ElementAt(4);\n            var secondSection_DefaultBlock = (JumpBlock)cfg.Blocks.ElementAt(5);\n            var lastBlock = (SimpleBlock)cfg.Blocks.ElementAt(6);\n            var exitBlock = (ExitBlock)cfg.Blocks.ElementAt(7);\n\n            switchBlock.SuccessorBlocks.Should().Equal(caseIntBlock);\n            VerifyAllInstructions(switchBlock, \"cw0\", \"cw0()\", \"o\");\n\n            caseIntBlock.TrueSuccessorBlock.Should().Be(firstSectionBlock);\n            caseIntBlock.FalseSuccessorBlock.Should().Be(caseStringBlock);\n            VerifyAllInstructions(caseIntBlock, \"int i\");\n\n            caseStringBlock.TrueSuccessorBlock.Should().Be(firstSectionBlock);\n            caseStringBlock.FalseSuccessorBlock.Should().Be(caseDoubleBlock);\n            VerifyAllInstructions(caseStringBlock, \"string s\");\n\n            firstSectionBlock.SuccessorBlock.Should().Be(lastBlock);\n            VerifyAllInstructions(firstSectionBlock, \"cw1\", \"cw1()\");\n\n            caseDoubleBlock.TrueSuccessorBlock.Should().Be(secondSection_DefaultBlock);\n            caseDoubleBlock.FalseSuccessorBlock.Should().Be(secondSection_DefaultBlock);\n            VerifyAllInstructions(caseDoubleBlock, \"double d\");\n\n            secondSection_DefaultBlock.SuccessorBlock.Should().Be(lastBlock);\n            VerifyAllInstructions(secondSection_DefaultBlock, \"cw2\", \"cw2()\");\n\n            lastBlock.SuccessorBlock.Should().Be(exitBlock);\n            VerifyAllInstructions(lastBlock, \"cw3\", \"cw3()\");\n        }\n\n        [TestMethod]\n        public void Cfg_Switch_Patterns_Two_Case_When()\n        {\n            var cfg = Build(\"cw0(); switch(o) { case int i when i > 0: case string s when s.Length > 0: cw1(); break; } cw2();\");\n\n            VerifyCfg(cfg, 8);\n\n            var switchBlock = (BranchBlock)cfg.Blocks.ElementAt(0);\n            var caseIntBlock = (BinaryBranchBlock)cfg.Blocks.ElementAt(1);\n            var caseIntWhenBlock = (BinaryBranchBlock)cfg.Blocks.ElementAt(2);\n            var caseStringBlock = (BinaryBranchBlock)cfg.Blocks.ElementAt(3);\n            var caseStringWhenBlock = (BinaryBranchBlock)cfg.Blocks.ElementAt(4);\n            var firstSectionBlock = (JumpBlock)cfg.Blocks.ElementAt(5);\n            var lastBlock = (SimpleBlock)cfg.Blocks.ElementAt(6);\n            var exitBlock = (ExitBlock)cfg.Blocks.ElementAt(7);\n\n            switchBlock.SuccessorBlocks.Should().Equal(caseIntBlock);\n            VerifyAllInstructions(switchBlock, \"cw0\", \"cw0()\", \"o\");\n\n            caseIntBlock.TrueSuccessorBlock.Should().Be(caseIntWhenBlock);\n            caseIntBlock.FalseSuccessorBlock.Should().Be(caseStringBlock);\n            VerifyAllInstructions(caseIntBlock, \"int i\");\n\n            caseIntWhenBlock.TrueSuccessorBlock.Should().Be(firstSectionBlock);\n            caseIntWhenBlock.FalseSuccessorBlock.Should().Be(caseStringBlock);\n            VerifyAllInstructions(caseIntWhenBlock, \"i\", \"0\", \"i > 0\");\n\n            caseStringBlock.TrueSuccessorBlock.Should().Be(caseStringWhenBlock);\n            caseStringBlock.FalseSuccessorBlock.Should().Be(lastBlock);\n            VerifyAllInstructions(caseStringBlock, \"string s\");\n\n            caseStringWhenBlock.TrueSuccessorBlock.Should().Be(firstSectionBlock);\n            caseStringWhenBlock.FalseSuccessorBlock.Should().Be(lastBlock);\n            VerifyAllInstructions(caseStringWhenBlock, \"s\", \"s.Length\", \"0\", \"s.Length > 0\");\n\n            firstSectionBlock.SuccessorBlock.Should().Be(lastBlock);\n            VerifyAllInstructions(firstSectionBlock, \"cw1\", \"cw1()\");\n\n            lastBlock.SuccessorBlock.Should().Be(exitBlock);\n            VerifyAllInstructions(lastBlock, \"cw2\", \"cw2()\");\n        }\n\n        [TestMethod]\n        public void Cfg_Switch_One_Simple_Case_And_One_Case_With_When()\n        {\n            var cfg = Build(\"cw(); switch(o) { case 0 : cw0(); break; case 1 when s: cw1(); break; } cw2();\");\n\n            VerifyCfg(cfg, 8);\n\n            var switchBlock = (BranchBlock)cfg.Blocks.ElementAt(0);\n            var caseZero = (BinaryBranchBlock)cfg.Blocks.ElementAt(1);\n            var caseZeroBlock = (JumpBlock)cfg.Blocks.ElementAt(2);\n            var caseOne = (BinaryBranchBlock)cfg.Blocks.ElementAt(3);\n            var caseOneWhenBlock = (BinaryBranchBlock)cfg.Blocks.ElementAt(4);\n            var caseOneWhenBlockBody = (JumpBlock)cfg.Blocks.ElementAt(5);\n            var afterSwitchBlock = (SimpleBlock)cfg.Blocks.ElementAt(6);\n            var exitBlock = (ExitBlock)cfg.Blocks.ElementAt(7);\n\n            switchBlock.SuccessorBlocks.Should().Equal(caseZero);\n            VerifyAllInstructions(switchBlock, \"cw\", \"cw()\", \"o\");\n\n            caseZero.TrueSuccessorBlock.Should().Be(caseZeroBlock);\n            caseZero.FalseSuccessorBlock.Should().Be(caseOne);\n            caseZero.BranchingNode.Kind().Should().Be(SyntaxKind.CaseSwitchLabel);\n\n            caseZeroBlock.SuccessorBlock.Should().Be(afterSwitchBlock);\n            VerifyAllInstructions(caseZeroBlock, \"cw0\", \"cw0()\");\n\n            caseOne.TrueSuccessorBlock.Should().Be(caseOneWhenBlock);\n            caseOne.FalseSuccessorBlock.Should().Be(afterSwitchBlock);\n            caseOne.BranchingNode.Kind().Should().Be(SyntaxKind.CasePatternSwitchLabel);\n\n            caseOneWhenBlock.TrueSuccessorBlock.Should().Be(caseOneWhenBlockBody);\n            caseOneWhenBlock.FalseSuccessorBlock.Should().Be(afterSwitchBlock);\n            VerifyAllInstructions(caseOneWhenBlock, \"s\");\n\n            caseOneWhenBlockBody.SuccessorBlock.Should().Be(afterSwitchBlock);\n            VerifyAllInstructions(caseOneWhenBlockBody, \"cw1\", \"cw1()\");\n\n            afterSwitchBlock.SuccessorBlock.Should().Be(exitBlock);\n            VerifyAllInstructions(afterSwitchBlock, \"cw2\", \"cw2()\");\n        }\n\n        [TestMethod]\n        public void Cfg_Switch_Case_With_When_And_Default()\n        {\n            var cfg = Build(\"cw(); switch(o) { case 1 when i > 0: cw0(); break; default: cw1(); break; } cw2();\");\n\n            VerifyCfg(cfg, 7);\n\n            var switchBlock = (BranchBlock)cfg.Blocks.ElementAt(0);\n            var caseOne = (BranchBlock)cfg.Blocks.ElementAt(1);\n            var caseOneWhenBlock = (BinaryBranchBlock)cfg.Blocks.ElementAt(2);\n            var caseOneWhenBlockBody = (JumpBlock)cfg.Blocks.ElementAt(3);\n            var defaultBlock = (SimpleBlock)cfg.Blocks.ElementAt(4);\n            var afterSwitchBlock = (SimpleBlock)cfg.Blocks.ElementAt(5);\n            var exitBlock = (ExitBlock)cfg.Blocks.ElementAt(6);\n\n            switchBlock.SuccessorBlocks.Should().Equal(caseOne);\n            VerifyAllInstructions(switchBlock, \"cw\", \"cw()\", \"o\");\n\n            caseOne.SuccessorBlocks.Should().ContainInOrder(caseOneWhenBlock, defaultBlock);\n            caseOne.BranchingNode.Kind().Should().Be(SyntaxKind.CasePatternSwitchLabel);\n\n            caseOneWhenBlock.TrueSuccessorBlock.Should().Be(caseOneWhenBlockBody);\n            caseOneWhenBlock.FalseSuccessorBlock.Should().Be(defaultBlock);\n            VerifyAllInstructions(caseOneWhenBlock, \"i\", \"0\", \"i > 0\");\n\n            caseOneWhenBlockBody.SuccessorBlock.Should().Be(afterSwitchBlock);\n            VerifyAllInstructions(caseOneWhenBlockBody, \"cw0\", \"cw0()\");\n\n            afterSwitchBlock.SuccessorBlock.Should().Be(exitBlock);\n            VerifyAllInstructions(afterSwitchBlock, \"cw2\", \"cw2()\");\n        }\n\n        [TestMethod]\n        public void Cfg_SwitchExpression_Return()\n        {\n            var cfg = Build(@\"\nvar type = \"\"test\"\";\nreturn type switch\n{\n    \"\"a\"\" => 1,\n    \"\"b\"\" => 2,\n    _ => 3\n};\");\n            VerifyCfg(cfg, 7);\n\n            // The generated CFG is very similar to the one generated for the following conditional expression:\n            // return type == \"a\" ? 1 : (type == \"b\" ? 2 : 3);\n\n            var aArm = (BinaryBranchBlock)cfg.Blocks.ElementAt(0);\n            var aTrue = (SimpleBlock)cfg.Blocks.ElementAt(1);\n            var bArm = (BinaryBranchBlock)cfg.Blocks.ElementAt(2);\n            var bTrue = (SimpleBlock)cfg.Blocks.ElementAt(3);\n            var discardArm = (SimpleBlock)cfg.Blocks.ElementAt(4);\n            var returnStatement = (JumpBlock)cfg.Blocks.ElementAt(5);\n            var exitBlock = cfg.ExitBlock;\n\n            aArm.TrueSuccessorBlock.Should().Be(aTrue);\n            aArm.FalseSuccessorBlock.Should().Be(bArm);\n            VerifyAllInstructions(aArm, \"\\\"test\\\"\", \"type = \\\"test\\\"\", \"type\", \"\\\"a\\\"\");\n\n            aTrue.SuccessorBlock.Should().Be(returnStatement);\n            VerifyAllInstructions(aTrue, \"1\");\n\n            bArm.TrueSuccessorBlock.Should().Be(bTrue);\n            bArm.FalseSuccessorBlock.Should().Be(discardArm);\n            VerifyAllInstructions(bArm, \"type\", \"\\\"b\\\"\");\n\n            bTrue.SuccessorBlock.Should().Be(returnStatement);\n            VerifyAllInstructions(bTrue, \"2\");\n\n            discardArm.SuccessorBlock.Should().Be(returnStatement);\n            VerifyAllInstructions(discardArm, \"3\");\n\n            returnStatement.SuccessorBlock.Should().Be(exitBlock);\n            VerifyNoInstruction(returnStatement);\n        }\n\n        [TestMethod]\n        public void Cfg_SwitchExpression_Assignment()\n        {\n            var cfg = Build(@\"var type = \"\"test\"\"; var result = type switch {\"\"a\"\" => 1, \"\"b\"\" => 2, _ => 3};\");\n            VerifyCfg(cfg, 7);\n\n            var aArm = (BinaryBranchBlock)cfg.Blocks.ElementAt(0);\n            var aTrue = (SimpleBlock)cfg.Blocks.ElementAt(1);\n            var bArm = (BinaryBranchBlock)cfg.Blocks.ElementAt(2);\n            var bTrue = (SimpleBlock)cfg.Blocks.ElementAt(3);\n            var discardArm = (SimpleBlock)cfg.Blocks.ElementAt(4);\n            var assignment = (SimpleBlock)cfg.Blocks.ElementAt(5);\n            var exitBlock = cfg.ExitBlock;\n\n            aArm.TrueSuccessorBlock.Should().Be(aTrue);\n            aArm.FalseSuccessorBlock.Should().Be(bArm);\n            VerifyAllInstructions(aArm, \"\\\"test\\\"\", \"type = \\\"test\\\"\", \"type\", \"\\\"a\\\"\");\n\n            aTrue.SuccessorBlock.Should().Be(assignment);\n            VerifyAllInstructions(aTrue, \"1\");\n\n            bArm.TrueSuccessorBlock.Should().Be(bTrue);\n            bArm.FalseSuccessorBlock.Should().Be(discardArm);\n            VerifyAllInstructions(bArm, \"type\", \"\\\"b\\\"\");\n\n            bTrue.SuccessorBlock.Should().Be(assignment);\n            VerifyAllInstructions(bTrue, \"2\");\n\n            discardArm.SuccessorBlock.Should().Be(assignment);\n            VerifyAllInstructions(discardArm, \"3\");\n\n            assignment.SuccessorBlock.Should().Be(exitBlock);\n            VerifyAllInstructions(assignment, @\"result = type switch {\"\"a\"\" => 1, \"\"b\"\" => 2, _ => 3}\");\n        }\n\n        [TestMethod]\n        public void Cfg_SwitchExpression_InnerSwitch()\n        {\n            var cfg = Build(@\"\nstring first = \"\"foo\"\", second = \"\"bar\"\";\nvar result = first switch {\"\"a\"\" => second switch {\"\"x\"\" => 1, _ => 2}, \"\"b\"\" => 3, _ => 4};\");\n\n            VerifyCfg(cfg, 9);\n\n            var aArm = (BinaryBranchBlock)cfg.Blocks.ElementAt(0);\n            var xArm = (BinaryBranchBlock)cfg.Blocks.ElementAt(1);\n            var xTrue = (SimpleBlock)cfg.Blocks.ElementAt(2);\n            var secondSwitchDiscardArm = (SimpleBlock)cfg.Blocks.ElementAt(3);\n            var bArm = (BinaryBranchBlock)cfg.Blocks.ElementAt(4);\n            var bTrue = (SimpleBlock)cfg.Blocks.ElementAt(5);\n            var firstSwitchDiscard = (SimpleBlock)cfg.Blocks.ElementAt(6);\n            var assignment = (SimpleBlock)cfg.Blocks.ElementAt(7);\n            var exitBlock = cfg.ExitBlock;\n\n            aArm.TrueSuccessorBlock.Should().Be(xArm);\n            aArm.FalseSuccessorBlock.Should().Be(bArm);\n            VerifyAllInstructions(aArm, \"\\\"foo\\\"\", \"first = \\\"foo\\\"\", \"\\\"bar\\\"\", \"second = \\\"bar\\\"\", \"first\", \"\\\"a\\\"\");\n\n            xArm.TrueSuccessorBlock.Should().Be(xTrue);\n            xArm.FalseSuccessorBlock.Should().Be(secondSwitchDiscardArm);\n            VerifyAllInstructions(xArm, \"second\", \"\\\"x\\\"\");\n\n            xTrue.SuccessorBlock.Should().Be(assignment);\n            VerifyAllInstructions(xTrue, \"1\");\n\n            secondSwitchDiscardArm.SuccessorBlock.Should().Be(assignment);\n            VerifyAllInstructions(secondSwitchDiscardArm, \"2\");\n\n            bArm.TrueSuccessorBlock.Should().Be(bTrue);\n            bArm.FalseSuccessorBlock.Should().Be(firstSwitchDiscard);\n            VerifyAllInstructions(bArm, \"first\", \"\\\"b\\\"\");\n\n            bTrue.SuccessorBlock.Should().Be(assignment);\n            VerifyAllInstructions(bTrue, \"3\");\n\n            firstSwitchDiscard.SuccessorBlock.Should().Be(assignment);\n            VerifyAllInstructions(firstSwitchDiscard, \"4\");\n\n            assignment.SuccessorBlock.Should().Be(exitBlock);\n            VerifyAllInstructions(assignment, @\"result = first switch {\"\"a\"\" => second switch {\"\"x\"\" => 1, _ => 2}, \"\"b\"\" => 3, _ => 4}\");\n        }\n\n        [TestMethod]\n        public void Cfg_SwitchExpression_WhenClause()\n        {\n            var cfg = Build(@\"string first = \"\"foo\"\", second = \"\"bar\"\"; var result = first switch {\"\"a\"\" when second == \"\"bar\"\" => 1, \"\"a\"\" => 2, \"\"b\"\" => 3, _ => 4};\");\n\n            VerifyCfg(cfg, 10);\n\n            var aWithWhenClauseArm = (BinaryBranchBlock)cfg.EntryBlock;\n            var whenClause = (BinaryBranchBlock)cfg.Blocks.ElementAt(1);\n            var aWithWhenClauseArmTrue = (SimpleBlock)cfg.Blocks.ElementAt(2);\n            var aArm = (BinaryBranchBlock)cfg.Blocks.ElementAt(3);\n            var aTrue = (SimpleBlock)cfg.Blocks.ElementAt(4);\n            var bArm = (BinaryBranchBlock)cfg.Blocks.ElementAt(5);\n            var bTrue = (SimpleBlock)cfg.Blocks.ElementAt(6);\n            var discardArm = (SimpleBlock)cfg.Blocks.ElementAt(7);\n            var assignment = (SimpleBlock)cfg.Blocks.ElementAt(8);\n            var exitBlock = cfg.ExitBlock;\n\n            aWithWhenClauseArm.TrueSuccessorBlock.Should().Be(whenClause);\n            aWithWhenClauseArm.FalseSuccessorBlock.Should().Be(aArm);\n            VerifyAllInstructions(aWithWhenClauseArm, \"\\\"foo\\\"\", \"first = \\\"foo\\\"\", \"\\\"bar\\\"\", \"second = \\\"bar\\\"\", \"first\", \"\\\"a\\\"\");\n\n            whenClause.TrueSuccessorBlock.Should().Be(aWithWhenClauseArmTrue);\n            whenClause.FalseSuccessorBlock.Should().Be(aArm);\n            VerifyAllInstructions(whenClause, \"second\", \"\\\"bar\\\"\", \"second == \\\"bar\\\"\");\n\n            aWithWhenClauseArmTrue.SuccessorBlock.Should().Be(assignment);\n            VerifyAllInstructions(aWithWhenClauseArmTrue, \"1\");\n\n            aArm.TrueSuccessorBlock.Should().Be(aTrue);\n            aArm.FalseSuccessorBlock.Should().Be(bArm);\n            VerifyAllInstructions(aArm, \"first\", \"\\\"a\\\"\");\n\n            aTrue.SuccessorBlock.Should().Be(assignment);\n            VerifyAllInstructions(aTrue, \"2\");\n\n            bArm.TrueSuccessorBlock.Should().Be(bTrue);\n            bArm.FalseSuccessorBlock.Should().Be(discardArm);\n            VerifyAllInstructions(bArm, \"first\", \"\\\"b\\\"\");\n\n            bTrue.SuccessorBlock.Should().Be(assignment);\n            VerifyAllInstructions(bTrue, \"3\");\n\n            discardArm.SuccessorBlock.Should().Be(assignment);\n            VerifyAllInstructions(discardArm, \"4\");\n\n            assignment.SuccessorBlock.Should().Be(exitBlock);\n            VerifyAllInstructions(assignment, @\"result = first switch {\"\"a\"\" when second == \"\"bar\"\" => 1, \"\"a\"\" => 2, \"\"b\"\" => 3, _ => 4}\");\n        }\n\n        [TestMethod]\n        public void Cfg_VarPattern_InSwitchExpression_IsNotSupported()\n        {\n            var exception = Assert.Throws<NotSupportedException>(() => Build(@\"string a = taintedString switch {var x => null};\"));\n\n            exception.Message.Should().Be(\"VarPattern\");\n        }\n\n        [TestMethod]\n        public void Cfg_VarPattern_InIf_IsNotSupported()\n        {\n            var exception = Assert.Throws<NotSupportedException>(() => Build(@\"if (tainted is var x) { }\"));\n\n            exception.Message.Should().Be(\"VarPattern\");\n        }\n\n        [TestMethod]\n        public void Cfg_NotPattern_InIf_IsNotSupported()\n        {\n            var exception = Assert.Throws<NotSupportedException>(() => Build(@\"if (tainted is not null) { }\"));\n\n            exception.Message.Should().Be(\"NotPattern\");\n        }\n\n        [TestMethod]\n        public void Cfg_AndPattern_InIf_IsNotSupported()\n        {\n            var exception = Assert.Throws<NotSupportedException>(() => Build(@\"if (tainted is int and > 0) { }\"));\n\n            exception.Message.Should().Be(\"AndPattern\");\n        }\n\n        [TestMethod]\n        public void Cfg_OrPattern_InIf_IsNotSupported()\n        {\n            var exception = Assert.Throws<NotSupportedException>(() => Build(@\"if (tainted is string or int) { }\"));\n\n            exception.Message.Should().Be(\"OrPattern\");\n        }\n\n        [TestMethod]\n        public void Cfg_ParenthesizedPattern_InIf_IsNotSupported()\n        {\n            var exception = Assert.Throws<NotSupportedException>(() => Build(@\"if (tainted is (string s)) { }\"));\n\n            exception.Message.Should().Be(\"ParenthesizedPattern\");\n        }\n\n        [TestMethod]\n        public void Cfg_ListPattern_InIf_IsNotSupported()\n        {\n            var exception = Assert.Throws<NotSupportedException>(() => Build(@\"if (tainted is []) { }\"));\n\n            exception.Message.Should().Be(\"ListPattern\");\n        }\n\n        [TestMethod]\n        public void Cfg_Switch_Patterns_NoDefault()\n        {\n            var cfg = Build(\"cw0(); switch(o) { case int i: case string s: cw1(); break; case double d: cw2(); break; } cw3();\");\n\n            VerifyCfg(cfg, 8);\n\n            var switchBlock = (BranchBlock)cfg.Blocks.ElementAt(0);\n            var caseIntBlock = (BinaryBranchBlock)cfg.Blocks.ElementAt(1);\n            var caseStringBlock = (BinaryBranchBlock)cfg.Blocks.ElementAt(2);\n            var firstSectionBlock = (JumpBlock)cfg.Blocks.ElementAt(3);\n            var caseDoubleBlock = (BinaryBranchBlock)cfg.Blocks.ElementAt(4);\n            var secondSectionBlock = (JumpBlock)cfg.Blocks.ElementAt(5);\n            var lastBlock = (SimpleBlock)cfg.Blocks.ElementAt(6);\n            var exitBlock = (ExitBlock)cfg.Blocks.ElementAt(7);\n\n            switchBlock.SuccessorBlocks.Should().Equal(caseIntBlock);\n            VerifyAllInstructions(switchBlock, \"cw0\", \"cw0()\", \"o\");\n\n            caseIntBlock.TrueSuccessorBlock.Should().Be(firstSectionBlock);\n            caseIntBlock.FalseSuccessorBlock.Should().Be(caseStringBlock);\n            VerifyAllInstructions(caseIntBlock, \"int i\");\n\n            caseStringBlock.TrueSuccessorBlock.Should().Be(firstSectionBlock);\n            caseStringBlock.FalseSuccessorBlock.Should().Be(caseDoubleBlock);\n            VerifyAllInstructions(caseStringBlock, \"string s\");\n\n            firstSectionBlock.SuccessorBlock.Should().Be(lastBlock);\n            VerifyAllInstructions(firstSectionBlock, \"cw1\", \"cw1()\");\n\n            caseDoubleBlock.TrueSuccessorBlock.Should().Be(secondSectionBlock);\n            caseDoubleBlock.FalseSuccessorBlock.Should().Be(lastBlock);\n            VerifyAllInstructions(caseDoubleBlock, \"double d\");\n\n            secondSectionBlock.SuccessorBlock.Should().Be(lastBlock);\n            VerifyAllInstructions(secondSectionBlock, \"cw2\", \"cw2()\");\n\n            lastBlock.SuccessorBlock.Should().Be(exitBlock);\n            VerifyAllInstructions(lastBlock, \"cw3\", \"cw3()\");\n        }\n\n        [TestMethod]\n        public void Cfg_Switch_Patterns_GotoDefault()\n        {\n            var cfg = Build(\"cw0(); switch(o) { case int i: case string s: cw1(); goto default; default: case double d: cw2(); break; } cw3();\");\n\n            VerifyCfg(cfg, 8);\n\n            var switchBlock = (BranchBlock)cfg.Blocks.ElementAt(0);\n            var caseIntBlock = (BinaryBranchBlock)cfg.Blocks.ElementAt(1);\n            var caseStringBlock = (BinaryBranchBlock)cfg.Blocks.ElementAt(2);\n            var firstSectionBlock = (JumpBlock)cfg.Blocks.ElementAt(3);\n            var caseDoubleBlock = (BinaryBranchBlock)cfg.Blocks.ElementAt(4);\n            var secondSection_DefaultBlock = (JumpBlock)cfg.Blocks.ElementAt(5);\n            var lastBlock = (SimpleBlock)cfg.Blocks.ElementAt(6);\n            var exitBlock = (ExitBlock)cfg.Blocks.ElementAt(7);\n\n            switchBlock.SuccessorBlocks.Should().Equal(caseIntBlock);\n            VerifyAllInstructions(switchBlock, \"cw0\", \"cw0()\", \"o\");\n\n            caseIntBlock.TrueSuccessorBlock.Should().Be(firstSectionBlock);\n            caseIntBlock.FalseSuccessorBlock.Should().Be(caseStringBlock);\n            VerifyAllInstructions(caseIntBlock, \"int i\");\n\n            caseStringBlock.TrueSuccessorBlock.Should().Be(firstSectionBlock);\n            caseStringBlock.FalseSuccessorBlock.Should().Be(caseDoubleBlock);\n            VerifyAllInstructions(caseStringBlock, \"string s\");\n\n            firstSectionBlock.SuccessorBlock.Should().Be(secondSection_DefaultBlock);\n            VerifyAllInstructions(firstSectionBlock, \"cw1\", \"cw1()\");\n\n            caseDoubleBlock.TrueSuccessorBlock.Should().Be(secondSection_DefaultBlock);\n            caseDoubleBlock.FalseSuccessorBlock.Should().Be(secondSection_DefaultBlock);\n            VerifyAllInstructions(caseDoubleBlock, \"double d\");\n\n            secondSection_DefaultBlock.SuccessorBlock.Should().Be(lastBlock);\n            VerifyAllInstructions(secondSection_DefaultBlock, \"cw2\", \"cw2()\");\n\n            lastBlock.SuccessorBlock.Should().Be(exitBlock);\n            VerifyAllInstructions(lastBlock, \"cw3\", \"cw3()\");\n        }\n\n        [TestMethod]\n        public void Cfg_Switch_Patterns_Null()\n        {\n            var cfg = Build(\"cw0(); switch(o) { case int i: case null: cw1(); break; } cw2();\");\n\n            VerifyCfg(cfg, 6);\n\n            var switchBlock = (BranchBlock)cfg.Blocks.ElementAt(0);\n            var caseIntBlock = (BinaryBranchBlock)cfg.Blocks.ElementAt(1);\n            var caseNullBlock = (BinaryBranchBlock)cfg.Blocks.ElementAt(2);\n            var firstSectionBlock = (JumpBlock)cfg.Blocks.ElementAt(3);\n            var lastBlock = (SimpleBlock)cfg.Blocks.ElementAt(4);\n            var exitBlock = (ExitBlock)cfg.Blocks.ElementAt(5);\n\n            switchBlock.SuccessorBlocks.Should().Equal(caseIntBlock);\n            VerifyAllInstructions(switchBlock, \"cw0\", \"cw0()\", \"o\");\n\n            caseIntBlock.TrueSuccessorBlock.Should().Be(firstSectionBlock);\n            caseIntBlock.FalseSuccessorBlock.Should().Be(caseNullBlock);\n            VerifyAllInstructions(caseIntBlock, \"int i\");\n\n            caseNullBlock.TrueSuccessorBlock.Should().Be(firstSectionBlock);\n            caseNullBlock.FalseSuccessorBlock.Should().Be(lastBlock);\n            VerifyAllInstructions(caseNullBlock, \"o\");\n\n            firstSectionBlock.SuccessorBlock.Should().Be(lastBlock);\n            VerifyAllInstructions(firstSectionBlock, \"cw1\", \"cw1()\");\n\n            lastBlock.SuccessorBlock.Should().Be(exitBlock);\n            VerifyAllInstructions(lastBlock, \"cw2\", \"cw2()\");\n        }\n\n        [TestMethod]\n        public void Cfg_Switch_Patterns_Null_Default()\n        {\n            var cfg = Build(@\"cw0(); switch(o) { case int i: cw1(); break; case null: cw2(); break; default: cw3(); break; } cw4();\");\n\n            VerifyCfg(cfg, 8);\n\n            var switchBlock = (BranchBlock)cfg.Blocks.ElementAt(0);\n            var caseIntBlock = (BinaryBranchBlock)cfg.Blocks.ElementAt(1);\n            var intSectionBlock = (JumpBlock)cfg.Blocks.ElementAt(2);\n            var caseNullBlock = (BinaryBranchBlock)cfg.Blocks.ElementAt(3);\n            var nullSectionBlock = (JumpBlock)cfg.Blocks.ElementAt(4);\n            var defaultSectionBlock = (JumpBlock)cfg.Blocks.ElementAt(5);\n            var lastBlock = (SimpleBlock)cfg.Blocks.ElementAt(6);\n            var exitBlock = (ExitBlock)cfg.Blocks.ElementAt(7);\n\n            switchBlock.SuccessorBlocks.Should().Equal(caseIntBlock);\n            VerifyAllInstructions(switchBlock, \"cw0\", \"cw0()\", \"o\");\n\n            caseIntBlock.TrueSuccessorBlock.Should().Be(intSectionBlock);\n            caseIntBlock.FalseSuccessorBlock.Should().Be(caseNullBlock);\n            VerifyAllInstructions(caseIntBlock, \"int i\");\n\n            intSectionBlock.SuccessorBlock.Should().Be(lastBlock);\n            VerifyAllInstructions(intSectionBlock, \"cw1\", \"cw1()\");\n\n            caseNullBlock.TrueSuccessorBlock.Should().Be(nullSectionBlock);\n            caseNullBlock.FalseSuccessorBlock.Should().Be(defaultSectionBlock);\n            VerifyAllInstructions(caseNullBlock, \"o\");\n\n            nullSectionBlock.SuccessorBlock.Should().Be(lastBlock);\n            VerifyAllInstructions(nullSectionBlock, \"cw2\", \"cw2()\");\n\n            defaultSectionBlock.SuccessorBlock.Should().Be(lastBlock);\n            VerifyAllInstructions(defaultSectionBlock, \"cw3\", \"cw3()\");\n\n            lastBlock.SuccessorBlock.Should().Be(exitBlock);\n            VerifyAllInstructions(lastBlock, \"cw4\", \"cw4()\");\n        }\n\n        [TestMethod]\n        public void Cfg_String_And_Throw()\n        {\n            var cfg = Build(@\"\ncw();\nswitch(o) // switchBlock\n{\n   case \"\"0\"\": cw0(); break; // caseZero\n   default: // defaultBlock\n      throw new InvalidOperationException(\"\"\"\");\n}\ncw1(); // afterSwitchBlock\n\");\n            VerifyCfg(cfg, 6);\n\n            var switchBlock = (BranchBlock)cfg.Blocks.ElementAt(0);\n            var branchBlock = (BinaryBranchBlock)cfg.Blocks.ElementAt(1);\n            var caseZero = (JumpBlock)cfg.Blocks.ElementAt(2);\n            var defaultBlock = (JumpBlock)cfg.Blocks.ElementAt(3);\n            var afterSwitchBlock = (SimpleBlock)cfg.Blocks.ElementAt(4);\n            var exitBlock = (ExitBlock)cfg.Blocks.ElementAt(5);\n\n            switchBlock.SuccessorBlocks.Should().Equal(branchBlock);\n            VerifyAllInstructions(switchBlock, \"cw\", \"cw()\", \"o\");\n\n            branchBlock.TrueSuccessorBlock.Should().Be(caseZero);\n            branchBlock.FalseSuccessorBlock.Should().Be(defaultBlock);\n            VerifyAllInstructions(branchBlock, \"o\");\n\n            caseZero.SuccessorBlock.Should().Be(afterSwitchBlock);\n            VerifyAllInstructions(caseZero, \"cw0\", \"cw0()\");\n\n            defaultBlock.SuccessorBlock.Should().Be(exitBlock);\n            VerifyAllInstructions(defaultBlock, \"\\\"\\\"\", \"new InvalidOperationException(\\\"\\\")\");\n        }\n\n        [TestMethod]\n        public void Cfg_Throws()\n        {\n            var cfg = Build(@\"\ncw();\nswitch(o) // switchBlock\n{\n   case 1:\n    if (b) // firstCaseIfBlock\n    {\n        cw0(); // trueBranchBlock\n    }\n    else\n    {\n      throw new InvalidOperationException(\"\"\"\"); // falseBranchBlock\n    }\n    break;\n\n   default: // defaultThrowBlock\n      throw new InvalidOperationException(\"\"a\"\");\n}\ncw1(); // afterSwitchBlock\n\");\n            VerifyCfg(cfg, 9);\n\n            var switchBlock = (BranchBlock)cfg.Blocks.ElementAt(0);\n            var case1Block = (BinaryBranchBlock)cfg.Blocks.ElementAt(1);\n            var firstCaseIfBlock = (BinaryBranchBlock)cfg.Blocks.ElementAt(2);\n            var trueBranchBlock = (SimpleBlock)cfg.Blocks.ElementAt(3);\n            var falseBranchBlock = (JumpBlock)cfg.Blocks.ElementAt(4);\n            var breakJump = (JumpBlock)cfg.Blocks.ElementAt(5);\n            var defaultBranchBlock = (JumpBlock)cfg.Blocks.ElementAt(6);\n            var afterSwitchBlock = (SimpleBlock)cfg.Blocks.ElementAt(7);\n            var exitBlock = (ExitBlock)cfg.Blocks.ElementAt(8);\n\n            switchBlock.SuccessorBlocks.Should().Equal(case1Block);\n            case1Block.TrueSuccessorBlock.Should().Be(firstCaseIfBlock);\n            case1Block.FalseSuccessorBlock.Should().Be(defaultBranchBlock);\n            firstCaseIfBlock.TrueSuccessorBlock.Should().Be(trueBranchBlock);\n            firstCaseIfBlock.FalseSuccessorBlock.Should().Be(falseBranchBlock);\n            trueBranchBlock.SuccessorBlocks.Should().Equal(breakJump);\n            breakJump.SuccessorBlocks.Should().Equal(afterSwitchBlock);\n            afterSwitchBlock.SuccessorBlocks.Should().Equal(exitBlock);\n            falseBranchBlock.SuccessorBlocks.Should().Equal(exitBlock);\n            defaultBranchBlock.SuccessorBlocks.Should().Equal(exitBlock);\n        }\n\n        [TestMethod]\n        public void Cfg_Enumerable_Patterns()\n        {\n            var cfg = Build(@\"\ncw();\nswitch(o)\n{\n   case IEnumerable<object> subList when subList.Any() && b && sum > 0 : cw0(); break;\n   default: cw2(); break;\n}\ncw3();\n\");\n            VerifyCfg(cfg, 9);\n\n            var switchBlock = (BranchBlock)cfg.Blocks.ElementAt(0);\n            var patternCase = (BinaryBranchBlock)cfg.Blocks.ElementAt(1);\n            var sublistAnyCondition = (BinaryBranchBlock)cfg.Blocks.ElementAt(2);\n            var bCondition = (BinaryBranchBlock)cfg.Blocks.ElementAt(3);\n            var sumGreaterCondition = (BinaryBranchBlock)cfg.Blocks.ElementAt(4);\n            var caseInnerBlock = (JumpBlock)cfg.Blocks.ElementAt(5);\n            var defaultBlock = (JumpBlock)cfg.Blocks.ElementAt(6);\n            var afterSwitchBlock = (SimpleBlock)cfg.Blocks.ElementAt(7);\n            var exitBlock = (ExitBlock)cfg.Blocks.ElementAt(8);\n\n            switchBlock.SuccessorBlocks.Should().Equal(patternCase);\n\n            patternCase.TrueSuccessorBlock.Should().Be(sublistAnyCondition);\n            patternCase.FalseSuccessorBlock.Should().Be(defaultBlock);\n\n            sublistAnyCondition.TrueSuccessorBlock.Should().Be(bCondition);\n            sublistAnyCondition.FalseSuccessorBlock.Should().Be(defaultBlock);\n\n            bCondition.TrueSuccessorBlock.Should().Be(sumGreaterCondition);\n            bCondition.FalseSuccessorBlock.Should().Be(defaultBlock);\n\n            sumGreaterCondition.TrueSuccessorBlock.Should().Be(caseInnerBlock);\n            sumGreaterCondition.FalseSuccessorBlock.Should().Be(defaultBlock);\n\n            caseInnerBlock.SuccessorBlock.Should().Be(afterSwitchBlock);\n            defaultBlock.SuccessorBlock.Should().Be(afterSwitchBlock);\n            afterSwitchBlock.SuccessorBlock.Should().Be(exitBlock);\n        }\n\n        [TestMethod]\n        public void Cfg_Default_Statement_First()\n        {\n            var cfg = Build(@\"\nint index = 0;\nException ex = null;\nswitch (index)\n{\n    default:\n        break;\n\n    case 0 when ex is InvalidOperationException:\n        ex = null;\n        break;\n}\n\");\n            VerifyCfg(cfg, 6);\n\n            var switchBlock = (BranchBlock)cfg.Blocks.ElementAt(0);\n            var caseZero = (BinaryBranchBlock)cfg.Blocks.ElementAt(1);\n            var caseZeroWhenException = (BinaryBranchBlock)cfg.Blocks.ElementAt(2);\n            var caseZeroWhenExceptionBlock = (JumpBlock)cfg.Blocks.ElementAt(3);\n            var defaultBlock = (JumpBlock)cfg.Blocks.ElementAt(4);\n            var exitBlock = (ExitBlock)cfg.Blocks.ElementAt(5);\n\n            switchBlock.SuccessorBlocks.Should().Equal(caseZero);\n\n            caseZero.TrueSuccessorBlock.Should().Be(caseZeroWhenException);\n            caseZero.FalseSuccessorBlock.Should().Be(defaultBlock);\n\n            caseZeroWhenException.TrueSuccessorBlock.Should().Be(caseZeroWhenExceptionBlock);\n            caseZeroWhenException.FalseSuccessorBlock.Should().Be(defaultBlock);\n\n            caseZeroWhenExceptionBlock.SuccessorBlock.Should().Be(exitBlock);\n            defaultBlock.SuccessorBlock.Should().Be(exitBlock);\n        }\n\n        [TestMethod]\n        public void Cfg_Mixed_Cases_With_The_Same_Action()\n        {\n            var cfg = Build(@\"\nobject o = null;\nException ex = null;\nswitch (o)\n{\n    case 0 when ex is ArgumentException:\n    case 1:\n    case string s when s.Length > 0:\n    case object x:\n        // do stuff\n        break;\n}\n\");\n            VerifyCfg(cfg, 9);\n\n            var switchBlock = (BranchBlock)cfg.Blocks.ElementAt(0);\n            var caseZero = (BinaryBranchBlock)cfg.Blocks.ElementAt(1);\n            var caseZeroWhenException = (BinaryBranchBlock)cfg.Blocks.ElementAt(2);\n            var caseOne = (BinaryBranchBlock)cfg.Blocks.ElementAt(3);\n            var caseStringS = (BinaryBranchBlock)cfg.Blocks.ElementAt(4);\n            var caseStringSWhen = (BinaryBranchBlock)cfg.Blocks.ElementAt(5);\n            var caseObjectX = (BinaryBranchBlock)cfg.Blocks.ElementAt(6);\n            var breakBlock = (JumpBlock)cfg.Blocks.ElementAt(7);\n            var exitBlock = (ExitBlock)cfg.Blocks.ElementAt(8);\n\n            switchBlock.SuccessorBlocks.Should().Equal(caseZero);\n\n            caseZero.TrueSuccessorBlock.Should().Be(caseZeroWhenException);\n            caseZero.FalseSuccessorBlock.Should().Be(caseOne);\n\n            caseZeroWhenException.TrueSuccessorBlock.Should().Be(breakBlock);\n            caseZeroWhenException.FalseSuccessorBlock.Should().Be(caseOne);\n\n            caseOne.TrueSuccessorBlock.Should().Be(breakBlock);\n            caseOne.FalseSuccessorBlock.Should().Be(caseStringS);\n\n            caseStringS.TrueSuccessorBlock.Should().Be(caseStringSWhen);\n            caseStringS.FalseSuccessorBlock.Should().Be(caseObjectX);\n\n            caseStringSWhen.TrueSuccessorBlock.Should().Be(breakBlock);\n            caseStringSWhen.FalseSuccessorBlock.Should().Be(caseObjectX);\n\n            caseObjectX.TrueSuccessorBlock.Should().Be(breakBlock);\n            caseObjectX.FalseSuccessorBlock.Should().Be(exitBlock);\n\n            breakBlock.SuccessorBlock.Should().Be(exitBlock);\n        }\n\n        #endregion\n\n        #region Goto\n\n        [TestMethod]\n        public void Cfg_Goto_A()\n        {\n            var cfg = Build(\"var x = 1; a: b: x++; if (x < 42) { cw1(); goto a; } cw2();\");\n            VerifyCfg(cfg, 7);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var cw1 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw1\")) as JumpBlock;\n            var cw2 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw2\"));\n\n            var cond = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"x < 42\"));\n\n            var a = blocks[1] as JumpBlock;\n            var b = blocks[2] as JumpBlock;\n\n            var entry = cfg.EntryBlock;\n\n            (a.JumpNode as LabeledStatementSyntax).Identifier.ValueText.Should().Be(\"a\");\n            (b.JumpNode as LabeledStatementSyntax).Identifier.ValueText.Should().Be(\"b\");\n\n            entry.SuccessorBlocks.Should().Equal(a);\n            a.SuccessorBlocks.Should().Equal(b);\n            b.SuccessorBlocks.Should().Equal(cond);\n            cond.SuccessorBlocks.Should().BeEquivalentTo(new[] { cw1, cw2 });\n            cw1.SuccessorBlocks.Should().Equal(a);\n            cw2.SuccessorBlocks.Should().Equal(cfg.ExitBlock);\n        }\n\n        [TestMethod]\n        public void Cfg_Goto_B()\n        {\n            var cfg = Build(\"var x = 1; a: b: x++; if (x < 42) { cw1(); goto b; } cw2();\");\n            VerifyCfg(cfg, 7);\n\n            var blocks = cfg.Blocks.ToList();\n\n            var cw1 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw1\")) as JumpBlock;\n            var cw2 = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"cw2\"));\n\n            var cond = blocks\n                .First(block => block.Instructions.Any(n => n.ToString() == \"x < 42\"));\n\n            var a = blocks[1] as JumpBlock;\n            var b = blocks[2] as JumpBlock;\n\n            var entry = cfg.EntryBlock;\n\n            (a.JumpNode as LabeledStatementSyntax).Identifier.ValueText.Should().Be(\"a\");\n            (b.JumpNode as LabeledStatementSyntax).Identifier.ValueText.Should().Be(\"b\");\n\n            entry.SuccessorBlocks.Should().Equal(a);\n            a.SuccessorBlocks.Should().Equal(b);\n            b.SuccessorBlocks.Should().Equal(cond);\n            cond.SuccessorBlocks.Should().BeEquivalentTo(new[] { cw1, cw2 });\n            cw1.SuccessorBlocks.Should().Equal(b);\n            cw2.SuccessorBlocks.Should().Equal(cfg.ExitBlock);\n        }\n\n        #endregion\n\n        #region Yield return\n\n        [TestMethod]\n        public void Cfg_YieldReturn()\n        {\n            var cfg = Build(@\"yield return 5;\");\n            VerifyMinimalCfg(cfg);\n\n            cfg.EntryBlock.Should().BeOfType<JumpBlock>();\n\n            var jumpBlock = (JumpBlock)cfg.EntryBlock;\n            jumpBlock.JumpNode.Kind().Should().Be(SyntaxKind.YieldReturnStatement);\n            VerifyAllInstructions(jumpBlock, \"5\");\n        }\n\n        #endregion\n\n        #region Non-branching expressions\n\n        [TestMethod]\n        public void Cfg_NonBranchingExpressions()\n        {\n            var cfg = Build(@\"\nx = a < 2;  x = a <= 2;  x = a > 2;  x = a >= 2;       x = a == 2;  x = a != 2;  s = c << 4;  s = c >> 4;\nb = x | 2;  b = x & 2;   b = x ^ 2;  c = \"\"c\"\" + 'c';  c = a - b;   c = a * b;   c = a / b;   c = a % b;\");\n\n            VerifyMinimalCfg(cfg);\n            VerifyInstructions(cfg.EntryBlock, 0, \"a\", \"2\", \"a < 2\", \"x = a < 2\");\n            VerifyInstructions(cfg.EntryBlock, 15 * 4, \"a\", \"b\", \"a % b\", \"c = a % b\");\n\n            cfg = Build(\"b |= 2;  b &= false;  b ^= 2;  c += b;  c -= b;  c *= b;  c /= b;  c %= b; s <<= 4;  s >>= 4;\");\n\n            VerifyMinimalCfg(cfg);\n            VerifyInstructions(cfg.EntryBlock, 0, \"b\", \"2\", \"b |= 2\");\n            VerifyInstructions(cfg.EntryBlock, 9 * 3, \"s\", \"4\", \"s >>= 4\");\n\n            cfg = Build(\"p = c++;  p = c--;  p = ++c;  p = --c;  p = +c;  p = -c;  p = !true;  p = ~1;  p = &c;  p = *c;\");\n\n            VerifyMinimalCfg(cfg);\n            VerifyInstructions(cfg.EntryBlock, 0, \"c\", \"c++\", \"p = c++\");\n            VerifyInstructions(cfg.EntryBlock, 9 * 3, \"c\", \"*c\", \"p = *c\");\n\n            cfg = Build(\"o = null;\");\n            VerifyMinimalCfg(cfg);\n            VerifyAllInstructions(cfg.EntryBlock, \"null\", \"o = null\");\n\n            cfg = Build(\"b = (b);\");\n            VerifyMinimalCfg(cfg);\n            VerifyAllInstructions(cfg.EntryBlock, \"b\", \"b = (b)\");\n\n            cfg = Build(@\"var t = typeof(int); var s = sizeof(int); var v = default(int);\");\n            VerifyMinimalCfg(cfg);\n            VerifyAllInstructions(cfg.EntryBlock, \"typeof(int)\", \"t = typeof(int)\", \"sizeof(int)\", \"s = sizeof(int)\", \"default(int)\", \"v = default(int)\");\n\n            cfg = Build(@\"v = checked(1+1); v = unchecked(1+1);\");\n            VerifyMinimalCfg(cfg);\n            VerifyInstructions(cfg.EntryBlock, 2, \"1+1\", \"checked(1+1)\", \"v = checked(1+1)\");\n            VerifyInstructions(cfg.EntryBlock, 7, \"1+1\", \"unchecked(1+1)\", \"v = unchecked(1+1)\");\n\n            cfg = Build(\"v = (int)1; v = 1 as object; v = 1 is int;\");\n            VerifyMinimalCfg(cfg);\n            VerifyAllInstructions(cfg.EntryBlock,\n                \"1\", \"(int)1\", \"v = (int)1\",\n                \"1\", \"1 as object\", \"v = 1 as object\",\n                \"1\", \"1 is int\", \"v = 1 is int\");\n\n            cfg = Build(@\"var s = $\"\"Some {text}\"\";\");\n            VerifyMinimalCfg(cfg);\n            VerifyAllInstructions(cfg.EntryBlock,\n                @\"text\",\n                @\"$\"\"Some {text}\"\"\",\n                @\"s = $\"\"Some {text}\"\"\");\n\n            cfg = Build(\"this.Method(call, with, arguments);\");\n            VerifyMinimalCfg(cfg);\n            VerifyAllInstructions(cfg.EntryBlock,\n                \"this\",\n                \"this.Method\",\n                \"call\", \"with\", \"arguments\",\n                \"this.Method(call, with, arguments)\");\n\n            cfg = Build(\"x = array[1,2,3]; x = array2[1][2];\");\n            VerifyMinimalCfg(cfg);\n            VerifyAllInstructions(cfg.EntryBlock,\n                \"array\",\n                \"1\", \"2\", \"3\",\n                \"array[1,2,3]\",\n                \"x = array[1,2,3]\",\n                \"array2\",\n                \"1\",\n                \"array2[1]\",\n                \"2\",\n                \"array2[1][2]\",\n                \"x = array2[1][2]\");\n\n            cfg = Build(@\"var dict = new Dictionary<string,int>{ [\"\"one\"\"] = 1 };\");\n            VerifyMinimalCfg(cfg);\n            VerifyAllInstructions(cfg.EntryBlock,\n                @\"new Dictionary<string,int>{ [\"\"one\"\"] = 1 }\",\n                @\"\"\"one\"\"\",\n                @\"[\"\"one\"\"]\",\n                @\"1\",\n                @\"[\"\"one\"\"] = 1\",\n                @\"{ [\"\"one\"\"] = 1 }\",\n                @\"dict = new Dictionary<string,int>{ [\"\"one\"\"] = 1 }\");\n\n            cfg = Build(\"var x = new { Prop1 = 10, Prop2 = 20 };\");\n            VerifyMinimalCfg(cfg);\n            VerifyAllInstructions(cfg.EntryBlock, \"10\", \"20\", \"new { Prop1 = 10, Prop2 = 20 }\", \"x = new { Prop1 = 10, Prop2 = 20 }\");\n\n            cfg = Build(\"var x = new { Prop1 };\");\n            VerifyMinimalCfg(cfg);\n            VerifyAllInstructions(cfg.EntryBlock, \"Prop1\", \"new { Prop1 }\", \"x = new { Prop1 }\");\n\n            cfg = Build(\"var x = new MyClass(5) { Prop1 = 10 };\");\n            VerifyMinimalCfg(cfg);\n            VerifyInstructions(cfg.EntryBlock, 0,\n                \"5\",\n                \"new MyClass(5) { Prop1 = 10 }\",\n                \"10\",\n                \"Prop1 = 10\",\n                \"{ Prop1 = 10 }\");\n\n            cfg = Build(\"var x = new List<int>{ 10, 20 };\");\n            VerifyMinimalCfg(cfg);\n            VerifyInstructions(cfg.EntryBlock, 0,\n                \"new List<int>{ 10, 20 }\",\n                \"10\",\n                \"20\",\n                \"{ 10, 20 }\");\n\n            cfg = Build(\"var x = new[,] { { 10, 20 }, { 10, 20 } };\");\n            VerifyMinimalCfg(cfg);\n            VerifyInstructions(cfg.EntryBlock, 0,\n                \"new[,] { { 10, 20 }, { 10, 20 } }\",\n                \"10\",\n                \"20\",\n                \"{ 10, 20 }\");\n            VerifyInstructions(cfg.EntryBlock, 7, \"{ { 10, 20 }, { 10, 20 } }\");\n\n            cfg = Build(\"var x = new int[] { 1 };\");\n            VerifyMinimalCfg(cfg);\n            VerifyAllInstructions(cfg.EntryBlock,\n                \"\", \"int[]\", \"new int[] { 1 }\", \"1\", \"{ 1 }\", \"x = new int[] { 1 }\");\n\n            cfg = Build(\"var x = new int [1,2][3]{ 10, 20 };\");\n            VerifyMinimalCfg(cfg);\n            VerifyInstructions(cfg.EntryBlock, 0,\n                \"1\", \"2\", \"3\",\n                \"int [1,2][3]\",\n                \"new int [1,2][3]{ 10, 20 }\",\n                \"10\",\n                \"20\",\n                \"{ 10, 20 }\");\n\n            cfg = Build(\"var z = x->prop;\");\n            VerifyMinimalCfg(cfg);\n            VerifyInstructions(cfg.EntryBlock, 0, \"x\", \"x->prop\");\n\n            cfg = Build(\"var x = await this.Method(__arglist(10,11));\");\n            VerifyMinimalCfg(cfg);\n            VerifyInstructions(cfg.EntryBlock, 2, \"__arglist\", \"10\", \"11\", \"__arglist(10,11)\",\n                \"this.Method(__arglist(10,11))\", \"await this.Method(__arglist(10,11))\");\n\n            cfg = Build(\"var x = 1; var y = __refvalue(__makeref(x), int); var t = __reftype(__makeref(x));\");\n            VerifyMinimalCfg(cfg);\n            VerifyInstructions(cfg.EntryBlock, 2, \"x\", \"__makeref(x)\", \"__refvalue(__makeref(x), int)\");\n            VerifyInstructions(cfg.EntryBlock, 6, \"x\", \"__makeref(x)\", \"__reftype(__makeref(x))\");\n\n            cfg = Build(\"var x = new Action(()=>{}); var y = new Action(i=>{}); var z = new Action(delegate(){});\");\n            VerifyMinimalCfg(cfg);\n            VerifyInstructions(cfg.EntryBlock, 0, \"()=>{}\", \"new Action(()=>{})\");\n\n            cfg = Build(\"var x = from t in ts where t > 42;\");\n            VerifyMinimalCfg(cfg);\n            VerifyInstructions(cfg.EntryBlock, 0, \"from t in ts where t > 42\", \"x = from t in ts where t > 42\");\n\n            cfg = Build(\"string.Format(\\\"\\\")\");\n            VerifyMinimalCfg(cfg);\n            VerifyAllInstructions(cfg.EntryBlock, \"string\", \"string.Format\", \"\\\"\\\"\", \"string.Format(\\\"\\\")\");\n        }\n\n        [TestMethod]\n        public void Cfg_Stackalloc()\n        {\n            var cfg = Build(\"var x = stackalloc int[10];\");\n            VerifyMinimalCfg(cfg);\n            VerifyInstructions(cfg.EntryBlock, 0, \"10\", \"int[10]\", \"stackalloc int[10]\");\n        }\n\n        [TestMethod]\n        public void Cfg_Stackalloc_Initializer()\n        {\n            var cfg = Build(\"var x = stackalloc int[2] { 10, 20 };\");\n            VerifyMinimalCfg(cfg);\n            VerifyInstructions(cfg.EntryBlock, 0, \"2\", \"int[2]\", \"10\", \"20\", \"{ 10, 20 }\", \"stackalloc int[2] { 10, 20 }\");\n        }\n\n        [TestMethod]\n        public void Cfg_Stackalloc_Implicit()\n        {\n            var cfg = Build(\"var x = stackalloc [] {100, 200, 300};\");\n            VerifyMinimalCfg(cfg);\n            VerifyInstructions(cfg.EntryBlock, 0, \"100\", \"200\", \"300\", \"{100, 200, 300}\", \"stackalloc [] {100, 200, 300}\");\n        }\n\n        [TestMethod]\n        public void Cfg_NonRemovedCalls()\n        {\n            var cfg = Build(@\"System.Diagnostics.Debug.Fail(\"\"\"\");\");\n            VerifyCfg(cfg, 2);\n            cfg.EntryBlock.Instructions.Should().NotBeEmpty();\n\n            cfg = Build(@\"System.Diagnostics.Debug.Assert(false);\");\n            VerifyCfg(cfg, 2);\n            cfg.EntryBlock.Instructions.Should().NotBeEmpty();\n        }\n\n        #endregion\n\n        #region Method invocation\n\n        [TestMethod]\n        public void Cfg_Ref_Arg_Should_Be_Last_Instruction()\n        {\n            var cfg = Build(@\"Bye(ref x0, x1, x2, x3, ref x4);}\");\n            VerifyCfg(cfg, 2);\n            var instructionsBlock = (SimpleBlock)cfg.Blocks.ElementAt(0);\n            VerifyAllInstructions(instructionsBlock, \"Bye\", \"x1\", \"x2\", \"x3\", \"x0\", \"x4\", \"Bye(ref x0, x1, x2, x3, ref x4)\");\n        }\n\n        [TestMethod]\n        public void Cfg_Ref_Arg_Should_Be_Last_Instruction_WithMethodCallOnObject()\n        {\n            var cfg = Build(@\"Bye.Hi(ref x0, x1, x2, x3, ref x4);}\");\n            VerifyCfg(cfg, 2);\n            var instructionsBlock = (SimpleBlock)cfg.Blocks.ElementAt(0);\n            VerifyAllInstructions(instructionsBlock, \"Bye\", \"Bye.Hi\", \"x1\", \"x2\", \"x3\", \"x0\", \"x4\", \"Bye.Hi(ref x0, x1, x2, x3, ref x4)\");\n        }\n\n        #endregion\n\n        #region Property Pattern Clause\n\n        [TestMethod]\n        public void Cfg_PropertyPatternClause_Simple()\n        {\n            var cfg = Build(@\"var x = address is Address { State: \"\"WA\"\" };\");\n\n            VerifyCfg(cfg, 2);\n\n            var entryBlock = (SimpleBlock)cfg.EntryBlock;\n            var exitBlock = cfg.ExitBlock;\n\n            entryBlock.SuccessorBlock.Should().Be(exitBlock);\n            VerifyAllInstructions(entryBlock,\n                \"address\",\n                \"Address { State: \\\"WA\\\" }\", // RecursivePattern\n                \"address is Address { State: \\\"WA\\\" }\", // IsPatternExpression\n                \"x = address is Address { State: \\\"WA\\\" }\"); // VariableDeclaration\n        }\n\n        [TestMethod]\n        public void Cfg_PropertyPatternClause_MultipleProperties()\n        {\n            var cfg = Build(@\"var x = address is { State: \"\"WA\"\", Street: \"\"Rue\"\" };\");\n\n            VerifyCfg(cfg, 2);\n\n            var entryBlock = (SimpleBlock)cfg.EntryBlock;\n            var exitBlock = cfg.ExitBlock;\n\n            entryBlock.SuccessorBlock.Should().Be(exitBlock);\n            VerifyAllInstructions(entryBlock,\n                \"address\",\n                \"{ State: \\\"WA\\\", Street: \\\"Rue\\\" }\", // Recursive Pattern\n                \"address is { State: \\\"WA\\\", Street: \\\"Rue\\\" }\", // IsPatternExpression\n                \"x = address is { State: \\\"WA\\\", Street: \\\"Rue\\\" }\"); // VariableDeclaration\n        }\n\n        [TestMethod]\n        public void Cfg_PropertyPatternClause_WithSingleVariableDesignation()\n        {\n            var cfg = Build(@\"var x = address is Address { State: \"\"WA\"\" } addr;\");\n\n            VerifyCfg(cfg, 2);\n\n            var entryBlock = (SimpleBlock)cfg.EntryBlock;\n            var exitBlock = cfg.ExitBlock;\n\n            entryBlock.SuccessorBlock.Should().Be(exitBlock);\n            VerifyAllInstructions(entryBlock,\n                \"address\",\n                \"Address { State: \\\"WA\\\" } addr\", // Recursive Pattern\n                \"address is Address { State: \\\"WA\\\" } addr\", // IsPatternExpression\n                \"x = address is Address { State: \\\"WA\\\" } addr\"); // VariableDeclaration\n        }\n\n        [TestMethod]\n        public void Cfg_PropertyPatternClause_InsideIf()\n        {\n            var cfg = Build(@\"if (address is Address { State: \"\"WA\"\" }) { return true; }\");\n\n            VerifyCfg(cfg, 3);\n\n            var entryBlock = (BinaryBranchBlock)cfg.EntryBlock;\n            var trueBlock = (JumpBlock)cfg.Blocks.ElementAt(1);\n            var exitBlock = cfg.ExitBlock;\n\n            entryBlock.TrueSuccessorBlock.Should().Be(trueBlock);\n            entryBlock.FalseSuccessorBlock.Should().Be(exitBlock);\n            VerifyAllInstructions(entryBlock,\n                \"address\",\n                \"Address { State: \\\"WA\\\" }\", // Recursive Pattern\n                \"address is Address { State: \\\"WA\\\" }\"); // IsPatternExpression\n\n            trueBlock.SuccessorBlock.Should().Be(exitBlock);\n            VerifyAllInstructions(trueBlock, \"true\");\n\n            VerifyNoInstruction(exitBlock);\n        }\n\n        [TestMethod]\n        public void Cfg_PropertyPatternClause_InsideIf_WithSingleVariableDesignation()\n        {\n            var cfg = Build(@\"if (address is Address { State: \"\"WA\"\" } addr) { return true; }\");\n\n            VerifyCfg(cfg, 3);\n\n            var entryBlock = (BinaryBranchBlock)cfg.EntryBlock;\n            var trueBlock = (JumpBlock)cfg.Blocks.ElementAt(1);\n            var exitBlock = cfg.ExitBlock;\n\n            entryBlock.TrueSuccessorBlock.Should().Be(trueBlock);\n            entryBlock.FalseSuccessorBlock.Should().Be(exitBlock);\n            VerifyAllInstructions(entryBlock,\n                \"address\",\n                \"Address { State: \\\"WA\\\" } addr\", // Recursive Pattern\n                \"address is Address { State: \\\"WA\\\" } addr\"); // IsPatternExpression\n\n            trueBlock.SuccessorBlock.Should().Be(exitBlock);\n            VerifyAllInstructions(trueBlock, \"true\");\n\n            VerifyNoInstruction(exitBlock);\n        }\n\n        [TestMethod]\n        public void Cfg_PropertyPatternClause_InsideSwitch()\n        {\n            var cfg = Build(@\"location switch { { State: \"\"WA\"\" } adr => salePrice * 0.06M, { State: \"\"MN\"\" } => salePrice * 0.75M, _ => 0M };\");\n\n            VerifyCfg(cfg, 6);\n\n            var waArmBranch = (BinaryBranchBlock)cfg.EntryBlock;\n            var waArmTrueBranch = (SimpleBlock)cfg.Blocks.ElementAt(1);\n            var mnArmBranch = (BinaryBranchBlock)cfg.Blocks.ElementAt(2);\n            var mnArmTrueBranch = (SimpleBlock)cfg.Blocks.ElementAt(3);\n            var discardArm = (SimpleBlock)cfg.Blocks.ElementAt(4);\n            var exitBlock = cfg.ExitBlock;\n\n            waArmBranch.TrueSuccessorBlock.Should().Be(waArmTrueBranch);\n            waArmBranch.FalseSuccessorBlock.Should().Be(mnArmBranch);\n            VerifyAllInstructions(waArmBranch, \"location\", \"{ State: \\\"WA\\\" } adr\" /* RecursivePattern */);\n\n            waArmTrueBranch.SuccessorBlock.Should().Be(exitBlock);\n            VerifyAllInstructions(waArmTrueBranch, \"salePrice\", \"0.06M\", \"salePrice * 0.06M\");\n\n            mnArmBranch.TrueSuccessorBlock.Should().Be(mnArmTrueBranch);\n            mnArmBranch.FalseSuccessorBlock.Should().Be(discardArm);\n            VerifyAllInstructions(mnArmBranch, \"location\", \"{ State: \\\"MN\\\" }\" /* RecursivePattern */);\n\n            mnArmTrueBranch.SuccessorBlock.Should().Be(exitBlock);\n            VerifyAllInstructions(mnArmTrueBranch, \"salePrice\", \"0.75M\", \"salePrice * 0.75M\");\n\n            discardArm.SuccessorBlock.Should().Be(exitBlock);\n            VerifyAllInstructions(discardArm, \"0M\");\n\n            VerifyNoInstruction(exitBlock);\n        }\n\n        [TestMethod]\n        public void Cfg_PropertyPatternClause_Nested()\n        {\n            var cfg = Build(@\"var result = o is Person { Name: \"\"John Doe\"\", Address: { State: \"\"WA\"\" } };\");\n\n            VerifyCfg(cfg, 2);\n\n            var entryBlock = (SimpleBlock)cfg.EntryBlock;\n            var exitBlock = cfg.ExitBlock;\n\n            entryBlock.SuccessorBlock.Should().Be(exitBlock);\n            VerifyAllInstructions(entryBlock,\n                \"o\",\n                \"Person { Name: \\\"John Doe\\\", Address: { State: \\\"WA\\\" } }\", // RecursivePattern\n                \"o is Person { Name: \\\"John Doe\\\", Address: { State: \\\"WA\\\" } }\", // IsPatternExpression\n                \"result = o is Person { Name: \\\"John Doe\\\", Address: { State: \\\"WA\\\" } }\"); // VariableDeclaration\n        }\n\n        #endregion\n\n        #region Instance creation\n\n        [TestMethod]\n        public void Cfg_New()\n        {\n            var cfg = Build(@\"var x = new Object()\");\n\n            VerifyMinimalCfg(cfg);\n            VerifyAllInstructions(cfg.EntryBlock, \"new Object()\", \"x = new Object()\");\n        }\n\n        [TestMethod]\n        public void Cfg_New_TargetTyped()\n        {\n            Action a = () => Build(@\"Object x = new()\");\n            a.Should().Throw<NotSupportedException>(); // C# 9 ImplicitObjectCreationExpressionSyntax is not supported yet\n        }\n\n        #endregion\n\n        #region \"Tuples\"\n\n        [TestMethod]\n        public void Cfg_Tuple_Create()\n        {\n            var cfg = Build(@\"var x = (true, 42);\");\n\n            VerifyMinimalCfg(cfg);\n            VerifyAllInstructions(cfg.EntryBlock, \"true\", \"42\", \"(true, 42)\", \"x = (true, 42)\");\n        }\n\n        [TestMethod]\n        public void Cfg_Tuple_ComplexExpression()\n        {\n            const string code = @\"\n\nvar x = (LocalBool(), LocalInt() + 2);\n\nbool LocalBool() => true;\nint LocalInt() => 40;\n\";\n            var cfg = Build(code);\n\n            VerifyMinimalCfg(cfg);\n            VerifyAllInstructions(cfg.EntryBlock, \"LocalBool\", \"LocalBool()\", \"LocalInt\", \"LocalInt()\", \"2\", \"LocalInt() + 2\", \"(LocalBool(), LocalInt() + 2)\", \"x = (LocalBool(), LocalInt() + 2)\");\n        }\n\n        [TestMethod]\n        public void Cfg_Tuple_InDeclaration()\n        {\n            var cfg = Build(@\"var (a, b) = (true, 42);\");\n\n            VerifyMinimalCfg(cfg);\n            VerifyAllInstructions(cfg.EntryBlock, \"var (a, b)\", \"true\", \"42\", \"(true, 42)\", \"var (a, b) = (true, 42)\");\n        }\n\n        [TestMethod]\n        public void Cfg_Tuple_AssignmentTarget()\n        {\n            var cfg = Build(@\"bool a; int b; (a, b) = (true, 42);\");\n\n            VerifyMinimalCfg(cfg);\n            VerifyAllInstructions(cfg.EntryBlock, \"a\", \"b\", \"a\", \"b\", \"(a, b)\", \"true\", \"42\", \"(true, 42)\", \"(a, b) = (true, 42)\");\n        }\n\n        #endregion\n\n        #region Methods to build the CFG for the tests\n\n        internal const string TestInput = @\"\nusing System;\nnamespace NS\n{{\n  public class Foo\n  {{\n    public void Bar()\n    {{\n      {0}\n    }}\n  }}\n}}\";\n\n        internal static (MethodDeclarationSyntax Method, SemanticModel Model) CompileWithMethodBody(string input)\n        {\n            var (tree, semanticModel) = TestCompiler.CompileIgnoreErrorsCS(input);\n            return (tree.First<MethodDeclarationSyntax>(), semanticModel);\n        }\n\n        internal static string ExtremelyNestedExpression()\n        {\n            const int count = 2000;\n            const string dna = \"ACGT\";\n            return Enumerable.Repeat($@\"\"\"{dna}\"\"\", count).JoinStr(\" +\\n\");\n        }\n\n        private static IControlFlowGraph Build(string methodBody)\n        {\n            var (method, model) = CompileWithMethodBody(string.Format(TestInput, methodBody));\n            var cfg = CSharpControlFlowGraph.Create(method.Body, model);\n\n            // when debugging the CFG, it is useful to visualize the CFG\n            var dot = CfgSerializer.Serialize(cfg, \"CFG diagnostics\");\n            System.Diagnostics.Debug.WriteLine(dot);\n\n            return cfg;\n        }\n\n        private static SyntaxNode FirstConstructorBody(SyntaxTree tree) =>\n            tree.First<ConstructorDeclarationSyntax>().Body;\n\n        private static MethodDeclarationSyntax FirstMethod(SyntaxTree tree) =>\n            tree.First<MethodDeclarationSyntax>();\n\n        #endregion\n\n        #region Verify helpers\n\n        private static void VerifyForStatement(IControlFlowGraph cfg)\n        {\n            VerifyCfg(cfg, 5);\n            var initBlock = cfg.EntryBlock;\n            var blocks = cfg.Blocks.ToList();\n            var branchBlock = blocks[1] as BinaryBranchBlock;\n            var incrementorBlock = blocks[3];\n            var loopBodyBlock = blocks[2];\n            var exitBlock = cfg.ExitBlock;\n\n            initBlock.SuccessorBlocks.Should().Equal(branchBlock);\n\n            branchBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { loopBodyBlock, exitBlock });\n            branchBlock.BranchingNode.Kind().Should().Be(SyntaxKind.ForStatement);\n\n            loopBodyBlock.SuccessorBlocks.Should().Equal(incrementorBlock);\n            incrementorBlock.SuccessorBlocks.Should().Equal(branchBlock);\n            branchBlock.PredecessorBlocks.Should().BeEquivalentTo(new[] { initBlock, incrementorBlock });\n            exitBlock.PredecessorBlocks.Should().Equal(branchBlock);\n        }\n\n        private static void VerifyInstructions(Block block, int fromIndex, params string[] instructions)\n        {\n            block.Instructions.Count.Should().BeGreaterOrEqualTo(fromIndex + instructions.Length);\n            for (var i = 0; i < instructions.Length; i++)\n            {\n                block.Instructions[fromIndex + i].ToString().Should().Be(instructions[i]);\n            }\n        }\n\n        private static void VerifyAllInstructions(Block block, params string[] instructions)\n        {\n            block.Instructions.Should().HaveSameCount(instructions);\n            VerifyInstructions(block, 0, instructions);\n        }\n\n        private static void VerifyNoInstruction(Block block) =>\n            VerifyAllInstructions(block, Array.Empty<string>());\n\n        private static void VerifyCfg(IControlFlowGraph cfg, int numberOfBlocks)\n        {\n            VerifyBasicCfgProperties(cfg);\n\n            cfg.Blocks.Should().HaveCount(numberOfBlocks);\n\n            if (numberOfBlocks > 1)\n            {\n                cfg.EntryBlock.Should().NotBeSameAs(cfg.ExitBlock);\n                cfg.Blocks.Should().ContainInOrder(new[] { cfg.EntryBlock, cfg.ExitBlock });\n            }\n            else\n            {\n                cfg.EntryBlock.Should().BeSameAs(cfg.ExitBlock);\n                cfg.Blocks.Should().Contain(cfg.EntryBlock);\n            }\n        }\n\n        private static void VerifyMinimalCfg(IControlFlowGraph cfg)\n        {\n            VerifyCfg(cfg, 2);\n\n            cfg.EntryBlock.SuccessorBlocks.Should().Equal(cfg.ExitBlock);\n        }\n\n        private static void VerifyEmptyCfg(IControlFlowGraph cfg) =>\n            VerifyCfg(cfg, 1);\n\n        private static void VerifyBasicCfgProperties(IControlFlowGraph cfg)\n        {\n            cfg.Should().NotBeNull();\n            cfg.EntryBlock.Should().NotBeNull();\n            cfg.ExitBlock.Should().NotBeNull();\n\n            cfg.ExitBlock.SuccessorBlocks.Should().BeEmpty();\n            cfg.ExitBlock.Instructions.Should().BeEmpty();\n        }\n\n        private static void VerifyForStatementNoInitializer(IControlFlowGraph cfg)\n        {\n            VerifyCfg(cfg, 5);\n            var blocks = cfg.Blocks.ToList();\n            var initializerBlock = cfg.EntryBlock as ForInitializerBlock;\n            var branchBlock = blocks[1] as BinaryBranchBlock;\n            var incrementorBlock = blocks\n                .First(b => b.Instructions.Any(n => n.ToString() == \"i++\"));\n            var loopBodyBlock = blocks\n                .First(b => b.Instructions.Any(n => n.ToString() == \"x = 10\"));\n            var exitBlock = cfg.ExitBlock;\n\n            initializerBlock.SuccessorBlock.Should().Be(branchBlock);\n\n            branchBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { loopBodyBlock, exitBlock });\n            branchBlock.BranchingNode.Kind().Should().Be(SyntaxKind.ForStatement);\n\n            loopBodyBlock.SuccessorBlocks.Should().Equal(incrementorBlock);\n            incrementorBlock.SuccessorBlocks.Should().Equal(branchBlock);\n            branchBlock.PredecessorBlocks.Should().BeEquivalentTo(new[] { incrementorBlock, initializerBlock });\n            exitBlock.PredecessorBlocks.Should().Equal(branchBlock);\n        }\n\n        private static void VerifyForStatementNoIncrementor(IControlFlowGraph cfg)\n        {\n            VerifyCfg(cfg, 4);\n            var initBlock = cfg.EntryBlock;\n            var blocks = cfg.Blocks.ToList();\n            var branchBlock = blocks[1] as BinaryBranchBlock;\n            var loopBodyBlock = blocks\n                .First(b => b.Instructions.Any(n => n.ToString() == \"x = 10\"));\n            var exitBlock = cfg.ExitBlock;\n\n            initBlock.SuccessorBlocks.Should().Equal(branchBlock);\n\n            branchBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { loopBodyBlock, exitBlock });\n            branchBlock.BranchingNode.Kind().Should().Be(SyntaxKind.ForStatement);\n\n            loopBodyBlock.SuccessorBlocks.Should().Equal(branchBlock);\n\n            branchBlock.PredecessorBlocks.Should().BeEquivalentTo(new[] { initBlock, loopBodyBlock });\n\n            exitBlock.PredecessorBlocks.Should().Equal(branchBlock);\n        }\n\n        private static void VerifyForStatementEmpty(IControlFlowGraph cfg)\n        {\n            VerifyCfg(cfg, 4);\n            var initializerBlock = cfg.EntryBlock as ForInitializerBlock;\n            var blocks = cfg.Blocks.ToList();\n            var branchBlock = blocks[1] as BinaryBranchBlock;\n            var loopBodyBlock = cfg.Blocks\n                .First(b => b.Instructions.Any(n => n.ToString() == \"x = 10\"));\n            var exitBlock = cfg.ExitBlock;\n\n            initializerBlock.SuccessorBlock.Should().Be(branchBlock);\n\n            branchBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { loopBodyBlock, exitBlock });\n            branchBlock.BranchingNode.Kind().Should().Be(SyntaxKind.ForStatement);\n\n            loopBodyBlock.SuccessorBlocks.Should().Equal(branchBlock);\n            branchBlock.PredecessorBlocks.Should().BeEquivalentTo(new[] { loopBodyBlock, initializerBlock });\n            exitBlock.PredecessorBlocks.Should().Equal(branchBlock);\n        }\n\n        private static void VerifySimpleJumpBlock(IControlFlowGraph cfg, SyntaxKind kind)\n        {\n            VerifyCfg(cfg, 3);\n            var jumpBlock = cfg.EntryBlock as JumpBlock;\n            var bodyBlock = cfg.Blocks.ToList()[1];\n            var exitBlock = cfg.ExitBlock;\n\n            jumpBlock.SuccessorBlocks.Should().Equal(bodyBlock);\n            bodyBlock.SuccessorBlocks.Should().Equal(exitBlock);\n\n            jumpBlock.JumpNode.Kind().Should().Be(kind);\n        }\n\n        private static void VerifyJumpWithNoExpression(IControlFlowGraph cfg, SyntaxKind kind)\n        {\n            VerifyCfg(cfg, 4);\n            var branchBlock = cfg.EntryBlock as BinaryBranchBlock;\n            var blocks = cfg.Blocks.ToList();\n            var trueBlock = blocks[1] as JumpBlock;\n            var falseBlock = blocks[2];\n            var exitBlock = cfg.ExitBlock;\n\n            branchBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { trueBlock, falseBlock });\n            trueBlock.SuccessorBlocks.Should().Equal(exitBlock);\n            trueBlock.JumpNode.Kind().Should().Be(kind);\n            falseBlock.SuccessorBlocks.Should().Equal(exitBlock);\n            exitBlock.PredecessorBlocks.Should().BeEquivalentTo(new[] { trueBlock, falseBlock });\n        }\n\n        private static void VerifyJumpWithExpression(IControlFlowGraph cfg, SyntaxKind kind)\n        {\n            VerifyCfg(cfg, 4);\n            var branchBlock = cfg.EntryBlock as BinaryBranchBlock;\n            var blocks = cfg.Blocks.ToList();\n            var trueBlock = blocks[1] as JumpBlock;\n            var falseBlock = blocks[2];\n            var exitBlock = cfg.ExitBlock;\n\n            branchBlock.SuccessorBlocks.Should().BeEquivalentTo(new[] { trueBlock, falseBlock });\n            trueBlock.SuccessorBlocks.Should().Equal(exitBlock);\n            trueBlock.JumpNode.Kind().Should().Be(kind);\n\n            trueBlock.Instructions.Should().Contain(n => n.IsKind(SyntaxKind.IdentifierName) && n.ToString() == \"ii\");\n\n            exitBlock.PredecessorBlocks.Should().BeEquivalentTo(new[] { trueBlock, falseBlock });\n        }\n\n        #endregion\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Common/ConcurrentExecutionTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.AnalysisContext;\n\nnamespace SonarAnalyzer.Test.Common;\n\n[TestClass]\npublic class ConcurrentExecutionTest\n{\n    [TestMethod]\n    public void Verify_ConcurrentExecutionIsEnabledByDefault()\n    {\n        var reader = new ConcurrentExecutionReader();\n        reader.IsConcurrentExecutionEnabled.Should().BeNull();\n        VerifyNoExceptionThrown(\"TestCases\\\\AsyncVoidMethod.cs\", [reader]);\n        reader.IsConcurrentExecutionEnabled.Should().BeTrue();\n    }\n\n    [TestMethod]\n    [DataRow(\"true\")]\n    [DataRow(\"tRUE\")]\n    [DataRow(\"loremipsum\")]\n    public void Verify_ConcurrentExecutionIsExplicitlyEnabled(string value)\n    {\n        using var scope = new EnvironmentVariableScope();\n        scope.SetVariable(SonarDiagnosticAnalyzer.EnableConcurrentExecutionVariable, value);\n        var reader = new ConcurrentExecutionReader();\n        reader.IsConcurrentExecutionEnabled.Should().BeNull();\n        VerifyNoExceptionThrown(\"TestCases\\\\AsyncVoidMethod.cs\", [reader]);\n        reader.IsConcurrentExecutionEnabled.Should().BeTrue();\n    }\n\n    [TestMethod]\n    [DataRow(\"false\")]\n    [DataRow(\"fALSE\")]\n    public void Verify_ConcurrentExecutionIsExplicitlyDisabled(string value)\n    {\n        using var scope = new EnvironmentVariableScope();\n        scope.SetVariable(SonarDiagnosticAnalyzer.EnableConcurrentExecutionVariable, value);\n        var reader = new ConcurrentExecutionReader();\n        reader.IsConcurrentExecutionEnabled.Should().BeNull();\n        VerifyNoExceptionThrown(\"TestCases\\\\AsyncVoidMethod.cs\", [reader]);\n        reader.IsConcurrentExecutionEnabled.Should().BeFalse();\n    }\n\n    private static void VerifyNoExceptionThrown(string path, DiagnosticAnalyzer[] analyzers, CompilationErrorBehavior checkMode = CompilationErrorBehavior.Default)\n    {\n        var compilation = SolutionBuilder\n            .Create()\n            .AddProject(AnalyzerLanguage.FromPath(path))\n            .AddDocument(path)\n            .GetCompilation();\n        ((Action)(() => DiagnosticVerifier.AnalyzerDiagnostics(compilation, analyzers, checkMode))).Should().NotThrow();\n    }\n\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    private class ConcurrentExecutionReader : SonarDiagnosticAnalyzer\n    {\n        private static readonly DiagnosticDescriptor Rule = DiagnosticDescriptorFactory.CreateUtility(\"S9999\", \"Rule test\");\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = [Rule];\n        public new bool? IsConcurrentExecutionEnabled { get; private set; }\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            IsConcurrentExecutionEnabled = EnableConcurrentExecution;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Common/MetricsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Metrics;\nusing SonarAnalyzer.CSharp.Metrics;\nusing SonarAnalyzer.VisualBasic.Metrics;\n\nnamespace SonarAnalyzer.Test.Common;\n\n[TestClass]\npublic class MetricsTest\n{\n    [TestMethod]\n    public void LinesOfCode()\n    {\n        LinesOfCode(AnalyzerLanguage.CSharp, string.Empty).Should().BeEmpty();\n        LinesOfCode(AnalyzerLanguage.CSharp, \"/* ... */\\n\").Should().BeEmpty();\n        LinesOfCode(AnalyzerLanguage.CSharp, \"namespace X { }\").Should().Equal(1);\n        LinesOfCode(AnalyzerLanguage.CSharp, \"namespace X \\n { \\n }\").Should().BeEquivalentTo([1, 2, 3]);\n        LinesOfCode(AnalyzerLanguage.CSharp, \"public class Sample { public Sample() { System.Console.WriteLine(@\\\"line1 \\n line2 \\n line3 \\n line 4\\\"); } }\").Should().BeEquivalentTo([1, 2, 3, 4]);\n\n        LinesOfCode(AnalyzerLanguage.VisualBasic, string.Empty).Should().BeEmpty();\n        LinesOfCode(AnalyzerLanguage.VisualBasic, \"'\\n\").Should().BeEmpty();\n        LinesOfCode(AnalyzerLanguage.VisualBasic, \"Module Module1 : End Module\").Should().BeEquivalentTo([1]);\n        LinesOfCode(AnalyzerLanguage.VisualBasic, \"Module Module1 \\n  \\n End Module\").Should().BeEquivalentTo([1, 3]);\n        LinesOfCode(AnalyzerLanguage.VisualBasic, \"\"\"\n            Public Class SomeClass\n             Public Sub New()\n              Console.WriteLine(\"line1\n            line2\n            line3\n            line 4\")\n             End Sub\n            End Class\n            \"\"\").Should().BeEquivalentTo([1, 2, 3, 4, 5, 6, 7, 8]);\n    }\n\n    [TestMethod]\n    public void CommentsWithoutHeaders()\n    {\n        CommentsWithoutHeaders(AnalyzerLanguage.CSharp, string.Empty).NonBlank.Should().BeEmpty();\n        CommentsWithoutHeaders(AnalyzerLanguage.CSharp, string.Empty).NoSonar.Should().BeEmpty();\n\n        CommentsWithoutHeaders(AnalyzerLanguage.CSharp, \"#if DEBUG\\nfoo\\n#endif\").NonBlank.Should().BeEmpty();\n        CommentsWithoutHeaders(AnalyzerLanguage.CSharp, \"using System; \\n#if DEBUG\\nfoo\\n#endif\").NonBlank.Should().BeEmpty();\n\n        CommentsWithoutHeaders(AnalyzerLanguage.CSharp, \"// foo\").NonBlank.Should().BeEmpty();\n        CommentsWithoutHeaders(AnalyzerLanguage.CSharp, \"#if DEBUG\\nfoo\\n#endif\\n// foo\").NonBlank.Should().BeEmpty();\n\n        CommentsWithoutHeaders(AnalyzerLanguage.CSharp, \"using System; // l1\").NonBlank.Should().BeEquivalentTo([1]);\n        CommentsWithoutHeaders(AnalyzerLanguage.CSharp, \"using System; // l1\\n// l2\").NonBlank.Should().BeEquivalentTo([1, 2]);\n        CommentsWithoutHeaders(AnalyzerLanguage.CSharp, \"using System; /* l1 */\").NonBlank.Should().BeEquivalentTo([1]);\n        CommentsWithoutHeaders(AnalyzerLanguage.CSharp, \"using System; /* l1 \\n l2 */\").NonBlank.Should().BeEquivalentTo([1, 2]);\n        CommentsWithoutHeaders(AnalyzerLanguage.CSharp, \"using System; /* l1 \\n l2 */\").NonBlank.Should().BeEquivalentTo([1, 2]);\n        CommentsWithoutHeaders(AnalyzerLanguage.CSharp, \"using System; /// foo\").NonBlank.Should().BeEquivalentTo([1]);\n        CommentsWithoutHeaders(AnalyzerLanguage.CSharp, \"using System; /** foo */\").NonBlank.Should().BeEquivalentTo([1]);\n\n        CommentsWithoutHeaders(AnalyzerLanguage.CSharp, \"using System; /** foo \\n \\n bar */\").NonBlank.Should().BeEquivalentTo([1, 3]);\n        CommentsWithoutHeaders(AnalyzerLanguage.CSharp, \"using System; /** foo \\r \\r bar */\").NonBlank.Should().BeEquivalentTo([1, 3]);\n        CommentsWithoutHeaders(AnalyzerLanguage.CSharp, \"using System; /** foo \\r\\n \\r\\n bar */\").NonBlank.Should().BeEquivalentTo([1, 3]);\n\n        CommentsWithoutHeaders(AnalyzerLanguage.CSharp, \"using System; // NOSONAR\").NoSonar.Should().BeEquivalentTo([1]);\n        CommentsWithoutHeaders(AnalyzerLanguage.CSharp, \"using System; // ooNOSONARoo\").NoSonar.Should().BeEquivalentTo([1]);\n        CommentsWithoutHeaders(AnalyzerLanguage.CSharp, \"using System; // nosonar\").NoSonar.Should().BeEmpty();\n        CommentsWithoutHeaders(AnalyzerLanguage.CSharp, \"using System; // nOSonAr\").NoSonar.Should().BeEmpty();\n\n        CommentsWithoutHeaders(AnalyzerLanguage.CSharp, \"using System; /* NOSONAR */ /* foo*/\").NoSonar.Should().BeEquivalentTo([1]);\n        CommentsWithoutHeaders(AnalyzerLanguage.CSharp, \"using System; /* NOSONAR */ /* foo */\").NonBlank.Should().BeEmpty();\n\n        CommentsWithoutHeaders(AnalyzerLanguage.CSharp, \"using System; /* foo*/ /* NOSONAR */\").NoSonar.Should().BeEquivalentTo([1]);\n        CommentsWithoutHeaders(AnalyzerLanguage.CSharp, \"using System; /* foo*/ /* NOSONAR */\").NonBlank.Should().BeEmpty();\n\n        CommentsWithoutHeaders(AnalyzerLanguage.VisualBasic, string.Empty).NonBlank.Should().BeEmpty();\n        CommentsWithoutHeaders(AnalyzerLanguage.VisualBasic, string.Empty).NoSonar.Should().BeEmpty();\n\n        CommentsWithoutHeaders(AnalyzerLanguage.VisualBasic, \"#If DEBUG Then\\nfoo\\n#End If\").NonBlank.Should().BeEmpty();\n        CommentsWithoutHeaders(AnalyzerLanguage.VisualBasic, \"Imports System \\n#If DEBUG Then\\nfoo\\n#End If\").NonBlank.Should().BeEmpty();\n\n        CommentsWithoutHeaders(AnalyzerLanguage.VisualBasic, \"' foo\").NonBlank.Should().BeEmpty();\n        CommentsWithoutHeaders(AnalyzerLanguage.VisualBasic, \"#If DEBUG Then\\nfoo\\n#End If\\n' foo\").NonBlank.Should().BeEmpty();\n\n        CommentsWithoutHeaders(AnalyzerLanguage.VisualBasic, \"Imports System ' l1\").NonBlank.Should().BeEquivalentTo([1]);\n        CommentsWithoutHeaders(AnalyzerLanguage.VisualBasic, \"Imports System ' l1\\n' l2\").NonBlank.Should().BeEquivalentTo([1, 2]);\n        CommentsWithoutHeaders(AnalyzerLanguage.VisualBasic, \"Imports System ''' foo\").NonBlank.Should().BeEquivalentTo([1]);\n\n        CommentsWithoutHeaders(AnalyzerLanguage.VisualBasic, \"Imports System ' NOSONAR\").NoSonar.Should().BeEquivalentTo([1]);\n        CommentsWithoutHeaders(AnalyzerLanguage.VisualBasic, \"Imports System ' ooNOSONARoo\").NoSonar.Should().BeEquivalentTo([1]);\n        CommentsWithoutHeaders(AnalyzerLanguage.VisualBasic, \"Imports System ' nosonar\").NoSonar.Should().BeEmpty();\n        CommentsWithoutHeaders(AnalyzerLanguage.VisualBasic, \"Imports System ' nOSonAr\").NoSonar.Should().BeEmpty();\n\n        CommentsWithoutHeaders(AnalyzerLanguage.VisualBasic, \"Imports System ' fndskgjsdkl \\n ' {00000000-0000-0000-0000-000000000000}\\n\").NonBlank.Should().BeEquivalentTo([1, 2]);\n    }\n\n    [TestMethod]\n    public void CommentsWithHeaders()\n    {\n        CommentsWithHeaders(AnalyzerLanguage.CSharp, string.Empty).NonBlank.Should().BeEmpty();\n        CommentsWithHeaders(AnalyzerLanguage.CSharp, string.Empty).NoSonar.Should().BeEmpty();\n\n        CommentsWithHeaders(AnalyzerLanguage.CSharp, \"#if DEBUG\\nfoo\\n#endif\").NonBlank.Should().BeEmpty();\n        CommentsWithHeaders(AnalyzerLanguage.CSharp, \"using System; \\n#if DEBUG\\nfoo\\n#endif\").NonBlank.Should().BeEmpty();\n\n        CommentsWithHeaders(AnalyzerLanguage.CSharp, \"// foo\").NonBlank.Should().BeEquivalentTo([1]);\n        CommentsWithHeaders(AnalyzerLanguage.CSharp, \"#if DEBUG\\nfoo\\n#endif\\n// foo\").NonBlank.Should().BeEquivalentTo([4]);\n\n        CommentsWithHeaders(AnalyzerLanguage.CSharp, \"using System; // l1\").NonBlank.Should().BeEquivalentTo([1]);\n        CommentsWithHeaders(AnalyzerLanguage.CSharp, \"using System; // l1\\n// l2\").NonBlank.Should().BeEquivalentTo([1, 2]);\n        CommentsWithHeaders(AnalyzerLanguage.CSharp, \"using System; /* l1 */\").NonBlank.Should().BeEquivalentTo([1]);\n        CommentsWithHeaders(AnalyzerLanguage.CSharp, \"using System; /* l1 \\n l2 */\").NonBlank.Should().BeEquivalentTo([1, 2]);\n        CommentsWithHeaders(AnalyzerLanguage.CSharp, \"using System; /* l1 \\n l2 */\").NonBlank.Should().BeEquivalentTo([1, 2]);\n        CommentsWithHeaders(AnalyzerLanguage.CSharp, \"using System; /// foo\").NonBlank.Should().BeEquivalentTo([1]);\n        CommentsWithHeaders(AnalyzerLanguage.CSharp, \"using System; /** foo */\").NonBlank.Should().BeEquivalentTo([1]);\n\n        CommentsWithHeaders(AnalyzerLanguage.CSharp, \"using System; /** foo \\n \\n bar */\").NonBlank.Should().BeEquivalentTo([1, 3]);\n        CommentsWithHeaders(AnalyzerLanguage.CSharp, \"using System; /** foo \\r \\r bar */\").NonBlank.Should().BeEquivalentTo([1, 3]);\n        CommentsWithHeaders(AnalyzerLanguage.CSharp, \"using System; /** foo \\r\\n \\r\\n bar */\").NonBlank.Should().BeEquivalentTo([1, 3]);\n\n        CommentsWithHeaders(AnalyzerLanguage.CSharp, \"using System; // NOSONAR\").NoSonar.Should().BeEquivalentTo([1]);\n        CommentsWithHeaders(AnalyzerLanguage.CSharp, \"using System; // ooNOSONARoo\").NoSonar.Should().BeEquivalentTo([1]);\n        CommentsWithHeaders(AnalyzerLanguage.CSharp, \"using System; // nosonar\").NoSonar.Should().BeEmpty();\n        CommentsWithHeaders(AnalyzerLanguage.CSharp, \"using System; // nOSonAr\").NoSonar.Should().BeEmpty();\n\n        CommentsWithHeaders(AnalyzerLanguage.CSharp, \"using System; /* NOSONAR */ /* foo*/\").NoSonar.Should().BeEquivalentTo([1]);\n        CommentsWithHeaders(AnalyzerLanguage.CSharp, \"using System; /* NOSONAR */ /* foo */\").NonBlank.Should().BeEmpty();\n\n        CommentsWithHeaders(AnalyzerLanguage.CSharp, \"using System; /* foo*/ /* NOSONAR */\").NoSonar.Should().BeEquivalentTo([1]);\n        CommentsWithHeaders(AnalyzerLanguage.CSharp, \"using System; /* foo*/ /* NOSONAR */\").NonBlank.Should().BeEmpty();\n\n        CommentsWithHeaders(AnalyzerLanguage.VisualBasic, string.Empty).NonBlank.Should().BeEmpty();\n        CommentsWithHeaders(AnalyzerLanguage.VisualBasic, string.Empty).NoSonar.Should().BeEmpty();\n\n        CommentsWithHeaders(AnalyzerLanguage.VisualBasic, \"#If DEBUG Then\\nfoo\\n#End If\").NonBlank.Should().BeEmpty();\n        CommentsWithHeaders(AnalyzerLanguage.VisualBasic, \"Imports System \\n#If DEBUG Then\\nfoo\\n#End If\").NonBlank.Should().BeEmpty();\n\n        CommentsWithHeaders(AnalyzerLanguage.VisualBasic, \"' foo\").NonBlank.Should().BeEquivalentTo([1]);\n        CommentsWithHeaders(AnalyzerLanguage.VisualBasic, \"#If DEBUG Then\\nfoo\\n#End If\\n' foo\").NonBlank.Should().BeEquivalentTo([4]);\n\n        CommentsWithHeaders(AnalyzerLanguage.VisualBasic, \"Imports System ' l1\").NonBlank.Should().BeEquivalentTo([1]);\n        CommentsWithHeaders(AnalyzerLanguage.VisualBasic, \"Imports System ' l1\\n' l2\").NonBlank.Should().BeEquivalentTo([1, 2]);\n        CommentsWithHeaders(AnalyzerLanguage.VisualBasic, \"Imports System ''' foo\").NonBlank.Should().BeEquivalentTo([1]);\n\n        CommentsWithHeaders(AnalyzerLanguage.VisualBasic, \"Imports System ' NOSONAR\").NoSonar.Should().BeEquivalentTo([1]);\n        CommentsWithHeaders(AnalyzerLanguage.VisualBasic, \"Imports System ' ooNOSONARoo\").NoSonar.Should().BeEquivalentTo([1]);\n        CommentsWithHeaders(AnalyzerLanguage.VisualBasic, \"Imports System ' nosonar\").NoSonar.Should().BeEmpty();\n        CommentsWithHeaders(AnalyzerLanguage.VisualBasic, \"Imports System ' nOSonAr\").NoSonar.Should().BeEmpty();\n\n        CommentsWithoutHeaders(AnalyzerLanguage.VisualBasic, \"Imports System ' fndskgjsdkl \\n ' {00000000-0000-0000-0000-000000000000}\\n\").NonBlank.Should().BeEquivalentTo([1, 2]);\n    }\n\n    [TestMethod]\n    public void Classes()\n    {\n        Classes(AnalyzerLanguage.CSharp, string.Empty).Should().Be(0);\n        Classes(AnalyzerLanguage.CSharp, \"class Sample {}\").Should().Be(1);\n        Classes(AnalyzerLanguage.CSharp, \"interface IMyInterface {}\").Should().Be(1);\n#if NET\n        Classes(AnalyzerLanguage.CSharp, \"record MyRecord {}\").Should().Be(1);\n        Classes(AnalyzerLanguage.CSharp, \"record MyPositionalRecord(int Prop) {}\").Should().Be(1);\n        Classes(AnalyzerLanguage.CSharp, \"record struct MyRecordStruct {}\").Should().Be(1);\n        Classes(AnalyzerLanguage.CSharp, \"record struct MyPositionalRecordStruct(int Prop) {}\").Should().Be(1);\n        Classes(AnalyzerLanguage.CSharp, \"file class FileScopedClass {}\").Should().Be(1);\n        Classes(AnalyzerLanguage.CSharp, \"file record FileScopedRecord {}\").Should().Be(1);\n#endif\n        Classes(AnalyzerLanguage.CSharp, \"struct Sample {}\").Should().Be(1);\n        Classes(AnalyzerLanguage.CSharp, \"enum MyEnum {}\").Should().Be(0);\n        Classes(AnalyzerLanguage.CSharp, \"class Sample1 {} namespace MyNamespace { class Sample2 {} }\").Should().Be(2);\n\n        Classes(AnalyzerLanguage.VisualBasic, string.Empty).Should().Be(0);\n        Classes(AnalyzerLanguage.VisualBasic, \"Class M \\n End Class\").Should().Be(1);\n        Classes(AnalyzerLanguage.VisualBasic, \"Structure M \\n End Structure\").Should().Be(1);\n        Classes(AnalyzerLanguage.VisualBasic, \"Enum M \\n None \\n End Enum\").Should().Be(0);\n        Classes(AnalyzerLanguage.VisualBasic, \"Interface M \\n End Interface\").Should().Be(1);\n        Classes(AnalyzerLanguage.VisualBasic, \"Module M \\n End Module\").Should().Be(1);\n        Classes(AnalyzerLanguage.VisualBasic, \"Class M \\n End Class \\n Namespace MyNamespace \\n Class Sample2 \\n End Class \\n End Namespace\").Should().Be(2);\n    }\n\n    [TestMethod]\n    public void Accessors()\n    {\n        Functions(AnalyzerLanguage.CSharp, string.Empty).Should().Be(0);\n        Functions(AnalyzerLanguage.CSharp, \"class Sample { public int MyProperty { get; } }\").Should().Be(1);\n        Functions(AnalyzerLanguage.CSharp, \"interface Sample { int MyProperty { get; } }\").Should().Be(0);\n        Functions(AnalyzerLanguage.CSharp, \"abstract class Sample { public abstract int MyProperty { get; } }\").Should().Be(0);\n        Functions(AnalyzerLanguage.CSharp, \"class Sample { public int MyProperty => 42; }\").Should().Be(1);\n        Functions(AnalyzerLanguage.CSharp, \"class Sample { public int MyProperty { get; set; } }\").Should().Be(2);\n        Functions(AnalyzerLanguage.CSharp, \"class Sample { public int MyProperty { get { return 0; } set { } } }\").Should().Be(2);\n        Functions(AnalyzerLanguage.CSharp, \"class Sample { public event System.EventHandler OnSomething { add { } remove {} } }\").Should().Be(2);\n        Functions(AnalyzerLanguage.CSharp, \"class Sample { public int MyMethod() { return 1; } }\").Should().Be(1);\n        Functions(AnalyzerLanguage.CSharp, \"class Sample { public int MyMethod() => 1; }\").Should().Be(1);\n        Functions(AnalyzerLanguage.CSharp, \"abstract class Sample { public abstract int MyMethod(); }\").Should().Be(0);\n\n        Functions(AnalyzerLanguage.VisualBasic, string.Empty).Should().Be(0);\n        Functions(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Public ReadOnly Property MyProperty As Integer \\n End Class\").Should().Be(0); // Is this the expected?\n        Functions(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Public Property MyProperty As Integer \\n End Class\")\n            .Should().Be(0); // Is this the expected?\n        Functions(AnalyzerLanguage.VisualBasic, \"\"\"\n            Class Sample\n                Public Property MyProperty As Integer\n                    Get\n                        Return 0\n                    End Get\n                    Set(value As Integer)\n                    End Set\n                End Property\n            End Class\n            \"\"\")\n            .Should().Be(2);\n        Functions(AnalyzerLanguage.VisualBasic, \"\"\"\n            Class Sample\n                Public Custom Event Click As EventHandler\n                    AddHandler(ByVal value As EventHandler)\n                    End AddHandler\n                    RemoveHandler(ByVal value As EventHandler)\n                    End RemoveHandler\n                    RaiseEvent(ByVal sender As Object, ByVal e As EventArgs)\n                    End RaiseEvent\n                End Event\n            End Class\n            \"\"\")\n            .Should().Be(3);\n    }\n\n    [TestMethod]\n    public void Statements()\n    {\n        Statements(AnalyzerLanguage.CSharp, string.Empty).Should().Be(0);\n        Statements(AnalyzerLanguage.CSharp, \"class Sample {}\").Should().Be(0);\n        Statements(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod() {} }\").Should().Be(0);\n        Statements(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod() { {} } }\").Should().Be(0);\n        Statements(AnalyzerLanguage.CSharp, \"class Sample { int MyMethod() { return 0; } }\").Should().Be(1);\n        Statements(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod() { int l = 42; } }\").Should().Be(1);\n        Statements(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod() { System.Console.WriteLine(); } }\").Should().Be(1);\n        Statements(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod() { ; } }\").Should().Be(1);\n        Statements(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod() { foo: ; } }\").Should().Be(2);\n        Statements(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod() { goto foo; foo: ;} }\").Should().Be(3);\n        Statements(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod() { while(true) break; } }\").Should().Be(2);\n        Statements(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod() { while(false) continue; } }\").Should().Be(2);\n        Statements(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod() { throw new System.Exception(); } }\").Should().Be(1);\n        Statements(AnalyzerLanguage.CSharp, \"class Sample { System.Collections.Generic.IEnumerable<int> MyMethod() { yield return 42; } }\").Should().Be(1);\n        Statements(AnalyzerLanguage.CSharp, \"class Sample { System.Collections.Generic.IEnumerable<int> MyMethod() { yield break; } }\").Should().Be(1);\n        Statements(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod() { while (false) {} } }\").Should().Be(1);\n        Statements(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod() { do {} while (false); } }\").Should().Be(1);\n        Statements(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod() { for (;;) {} } }\").Should().Be(1);\n        Statements(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod() { foreach (var e in new [] {1, 2, 3}) {} } }\").Should().Be(1);\n        Statements(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod() { using (var e = new System.IO.MemoryStream()) {} } }\").Should().Be(1);\n        Statements(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod() { unsafe { fixed (int* p = &this.x) {} } } int x; }\").Should().Be(2);\n        Statements(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod() { checked {} } }\").Should().Be(1);\n        Statements(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod() { unchecked {} } }\").Should().Be(1);\n        Statements(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod() { unsafe {} } }\").Should().Be(1);\n        Statements(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod() { if (false) {} } }\").Should().Be(1);\n        Statements(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod(int v) { switch (v) { case 0: break; } } }\").Should().Be(2);\n        Statements(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod() { try {} catch {} } }\").Should().Be(1);\n        Statements(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod() { try {} finally {} } }\").Should().Be(1);\n        Statements(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod() { try {} catch {} finally {} } }\").Should().Be(1);\n        Statements(AnalyzerLanguage.CSharp, \"class Sample { int MyMethod() { int a = 42; System.Console.WriteLine(a); return a; } }\").Should().Be(3);\n        Statements(AnalyzerLanguage.CSharp, \"class Sample { void Bar() { void LocalFunction() { } } }\").Should().Be(1);\n        Statements(AnalyzerLanguage.CSharp, \"class Sample { void Bar(System.Collections.Generic.List<(int, int)> names) { foreach ((int x, int y) in names){} } }\").Should().Be(1);\n\n        Statements(AnalyzerLanguage.VisualBasic, string.Empty).Should().Be(0);\n        Statements(AnalyzerLanguage.VisualBasic, \"Class Sample \\n \\n End Class\").Should().Be(0);\n        Statements(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Sub MyMethod() \\n End Sub \\n End Class\").Should().Be(0);\n        Statements(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Function MyFunc() As Integer \\n Return 0 \\n End Function \\n End Class\").Should().Be(1);\n        Statements(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Sub MyMethod() \\n Dim a As Integer = 42 \\n \\n End Sub \\n End Class\").Should().Be(1);\n        Statements(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Sub MyMethod() \\n Console.WriteLine() \\n End Sub \\n End Class\").Should().Be(1);\n        Statements(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Sub MyMethod() \\n Foo:  \\n End Sub \\n End Class\").Should().Be(1);\n        Statements(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Sub MyMethod() \\n GoTo Foo \\n Foo: \\n End Sub \\n End Class\").Should().Be(2);\n        Statements(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Sub MyMethod() \\n Exit Sub \\n End Sub \\n End Class\").Should().Be(1);\n        Statements(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Sub MyMethod() \\n Do : Continue Do : Loop\\n End Sub \\n End Class\").Should().Be(2);\n        Statements(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Sub MyMethod() \\n Throw New Exception \\n End Sub \\n End Class\").Should().Be(1);\n        Statements(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Sub MyMethod() \\n While False \\n End While \\n End Sub \\n End Class\").Should().Be(1);\n        Statements(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Sub MyMethod() \\n Do \\n Loop While True \\n End Sub \\n End Class\").Should().Be(1);\n        Statements(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Sub MyMethod() \\n For i As Integer = 0 To -1 \\n Next \\n End Sub \\n End Class\").Should().Be(1);\n        Statements(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Sub MyMethod() \\n For Each e As Integer In {1, 2, 3} \\n Next\\n End Sub \\n End Class\").Should().Be(1);\n        Statements(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Sub MyMethod() \\n Using e As New System.IO.MemoryStream() \\n End Using \\n End Sub \\n End Class\").Should().Be(1);\n        Statements(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Sub MyMethod() \\n If False Then \\n End If \\n End Sub \\n End Class\").Should().Be(1);\n        Statements(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Sub MyMethod(v As Integer) \\n Select Case v \\n Case 0 \\n End Select \\n End Sub \\n End Class\").Should().Be(1);\n        Statements(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Sub MyMethod() \\n Try \\n Catch \\n End Try \\n End Sub \\n End Class\").Should().Be(1);\n        Statements(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Sub MyMethod() \\n Try \\n Finally \\n End Try \\n End Sub \\n End Class\").Should().Be(1);\n        Statements(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Sub MyMethod() \\n Try \\n Catch \\n Finally \\n End Try \\n End Sub \\n End Class\").Should().Be(1);\n        Statements(\n            AnalyzerLanguage.VisualBasic,\n            \"Class Sample \\n Function MyFunc() As Integer \\n Dim a As Integer = 42 \\n Console.WriteLine(a) \\n Return a \\n End \"\n            + \"Function \\n End Class\")\n            .Should().Be(3);\n    }\n\n#if NET\n\n    [TestMethod]\n    [DataRow(\"\", 0)]\n    [DataRow(\"class Sample { }\", 0)]\n    [DataRow(\"abstract class Sample { public abstract void MyMethod1(); }\", 0)]\n    [DataRow(\"interface Interface { void MyMethod1(); }\", 0)]\n    [DataRow(\"class Sample { static Sample() { } }\", 1)]\n    [DataRow(\"class Sample { public Sample() { } }\", 1)]\n    [DataRow(\"class Sample { ~Sample() { } }\", 1)]\n    [DataRow(\"class Sample { public void MyMethod2() { } }\", 1)]\n    [DataRow(\"class Sample { public static Sample operator +(Sample a) { return a; } }\", 1)]\n    [DataRow(\"class Sample { public int MyProperty { get; set; } }\", 2)]\n    [DataRow(\"class Sample { public int MyProperty { get { return 0; } } }\", 1)]\n    [DataRow(\"class Sample { public int MyProperty { set { } } }\", 1)]\n    [DataRow(\"class Sample { public int MyProperty { init { } } }\", 1)]\n    [DataRow(\"class Sample { public int MyProperty { get => 42; } }\", 1)]\n    [DataRow(\"class Sample { public int MyProperty { get { return 0; } set { } } }\", 2)]\n    [DataRow(\"class Sample { public event System.EventHandler OnSomething { add { } remove {} } }\", 2)]\n    [DataRow(\"class Sample { void Bar() { void LocalFunction() { } } }\", 2)]\n    [DataRow(\"\"\"\n        partial class Sample\n        {\n            public partial int MyProperty { get; set; } // The partial definition part of a property is not counted.\n        }\n        partial class Sample\n        {\n            public partial int MyProperty { get => 1; set { } }\n        }\n        \"\"\", 2)]\n    [DataRow(\"\"\"\n        partial class Sample\n        {\n            public partial int this[int index] { get; set; }\n        }\n        partial class Sample\n        {\n            public partial int this[int index] { get => 1; set { } }\n        }\n        \"\"\", 2)]\n    public void Functions_CSharp(string function, int expected) =>\n        Functions(AnalyzerLanguage.CSharp, function).Should().Be(expected);\n\n    [TestMethod]\n    [DataRow(\"\", 0)]\n    [DataRow(\"Class Sample \\n \\n End Class\", 0)]\n    [DataRow(\"MustInherit Class Sample \\n MustOverride Sub MyMethod() \\n End Class\", 0)]\n    [DataRow(\"Interface MyInterface \\n Sub MyMethod() \\n End Interface\", 0)]\n    [DataRow(\"Class Sample \\n Public Property MyProperty As Integer \\n End Class\", 0)]\n    [DataRow(\"Class Sample \\n Shared Sub New() \\n End Sub \\n End Class\", 1)]\n    [DataRow(\"Class Sample \\n Sub New() \\n End Sub \\n End Class\", 1)]\n    [DataRow(\"Class Sample \\n Protected Overrides Sub Finalize() \\n End Sub \\n End Class\", 1)]\n    [DataRow(\"Class Sample \\n Sub MyMethod2() \\n End Sub \\n End Class\", 1)]\n    [DataRow(\"Class Sample \\n Public Shared Operator +(a As Sample) As Sample \\n Return a \\n End Operator \\n End Class\", 1)]\n    public void Functions_VisualBasic(string function, int expected) =>\n        Functions(AnalyzerLanguage.VisualBasic, function).Should().Be(expected);\n#endif\n\n    [TestMethod]\n    public void Complexity()\n    {\n        Complexity(AnalyzerLanguage.CSharp, string.Empty)\n            .Should().Be(0);\n        Complexity(AnalyzerLanguage.CSharp, \"class Sample { }\")\n            .Should().Be(0);\n        Complexity(AnalyzerLanguage.CSharp, \"abstract class Sample { public abstract void MyMethod(); }\")\n            .Should().Be(0);\n        Complexity(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod() { } }\")\n            .Should().Be(1);\n        Complexity(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod() { return; } }\")\n            .Should().Be(1);\n        Complexity(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod() { return; return; } }\")\n            .Should().Be(1);\n        Complexity(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod() { { return; } } }\")\n            .Should().Be(1);\n        Complexity(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod() { if (false) { } } }\")\n            .Should().Be(2);\n        Complexity(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod() { if (false) { } else { } } }\")\n            .Should().Be(2);\n        Complexity(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod() { var t = false ? 0 : 1; } }\")\n            .Should().Be(2);\n        Complexity(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod(int p) { switch (p) { default: break; } } }\")\n            .Should().Be(1);\n        Complexity(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod(int p) { var x = p switch { _ => 1  }; } }\")\n            .Should().Be(2);\n        Complexity(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod(int p) { switch (p) { case 0: break; default: break; } } }\")\n            .Should().Be(2);\n        Complexity(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod(int p) { var x = p switch { 0 => \\\"zero\\\", 1 => \\\"one\\\", _ => \\\"other\\\"  }; } }\")\n            .Should().Be(4);\n        Complexity(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod(bool first, bool second) { var _ = first switch { true => second switch { true => 1, _ => 2}, _ => 3}; } }\")\n            .Should().Be(5);\n        Complexity(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod(int p) { foo: ; } }\")\n            .Should().Be(1);\n        Complexity(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod(int p) { do { } while (false); } }\")\n            .Should().Be(2);\n        Complexity(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod(int p) { for (;;) { } } }\")\n            .Should().Be(2);\n        Complexity(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod(System.Collections.Generic.List<int> p) { foreach (var i in p) { } } }\")\n            .Should().Be(2);\n        Complexity(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod(int p) { var a = false; } }\")\n            .Should().Be(1);\n        Complexity(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod(int p) { var a = false && false; } }\")\n            .Should().Be(2);\n        Complexity(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod(int p) { var a = false || true; } }\")\n            .Should().Be(2);\n        Complexity(AnalyzerLanguage.CSharp, \"class Sample { int MyProperty { get; set; } }\")\n            .Should().Be(2);\n        Complexity(AnalyzerLanguage.CSharp, \"\"\"\n                partial class Sample { partial int MyProperty { get; set; } }\n                partial class Sample { partial int MyProperty { get => 1; set { } } }\n            \"\"\").Should().Be(4);\n        Complexity(AnalyzerLanguage.CSharp, \"class Sample { int MyProperty { get => 0; set {} } }\")\n            .Should().Be(2);\n        Complexity(AnalyzerLanguage.CSharp, \"class Sample { public Sample() { } }\")\n            .Should().Be(1);\n        Complexity(AnalyzerLanguage.CSharp, \"class Sample { ~Sample() { } }\")\n            .Should().Be(1);\n        Complexity(AnalyzerLanguage.CSharp, \"class Sample { public static Sample operator +(Sample a) { return a; } }\")\n            .Should().Be(1);\n        Complexity(AnalyzerLanguage.CSharp, \"class Sample { public event System.EventHandler OnSomething { add { } remove {} } }\")\n            .Should().Be(2);\n        Complexity(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod() { var t = (string)null ?? string.Empty; } }\")\n            .Should().Be(2);\n        Complexity(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod(int? t) { t ??= 0; } }\")\n            .Should().Be(2);\n        Complexity(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod(int? a, int? b, int? c) => a ??= b ??= c ??= 0; }\")\n            .Should().Be(4);\n        Complexity(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod() { int? t = null; t?.ToString(); } }\")\n            .Should().Be(2);\n        Complexity(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod() { throw new System.Exception(); } }\")\n            .Should().Be(1);\n        Complexity(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod() { try { } catch(System.Exception e) { } } }\")\n            .Should().Be(1);\n        Complexity(AnalyzerLanguage.CSharp, \"class Sample { void MyMethod() { goto Foo; Foo: var i = 0; } }\")\n            .Should().Be(1);\n\n        Complexity(AnalyzerLanguage.VisualBasic, string.Empty)\n            .Should().Be(0);\n        Complexity(AnalyzerLanguage.VisualBasic, \"Class Sample \\n End Class\")\n            .Should().Be(0);\n        Complexity(AnalyzerLanguage.VisualBasic, \"MustInherit Class Sample \\n Public MustOverride Sub MyMethod() \\n End Class\")\n            .Should().Be(0);\n        Complexity(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Sub MyMethod() \\n End Sub \\n End Class\")\n            .Should().Be(1);\n        Complexity(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Sub MyMethod() \\n Return \\n End Sub \\n End Class\")\n            .Should().Be(1);\n        Complexity(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Sub MyMethod() \\n Return \\n Return \\n End Sub \\n End Class\")\n            .Should().Be(1);\n        Complexity(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Sub MyMethod() \\n If False Then \\n End If \\n End Sub \\n End Class\")\n            .Should().Be(2);\n        Complexity(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Sub MyMethod() \\n If False Then \\n Else \\n End If \\n End Sub \\n End Class\")\n            .Should().Be(2);\n        Complexity(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Sub MyMethod(p As Integer) \\n Select Case p \\n Case Else \\n Exit Select \\n End Select \\n End Sub \\n End Class\")\n            .Should().Be(2);\n        Complexity(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Sub MyMethod(p As Integer) \\n Select Case p \\n Case 3 \\n Exit Select \\n Case Else \\n Exit Select \\n End Select \\n End Sub \\n End Class\")\n            .Should().Be(4);\n        Complexity(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Sub MyMethod() \\n Foo: \\n End Sub \\n End Class\")\n            .Should().Be(1);\n        Complexity(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Sub MyMethod() \\n Do \\n Loop While True \\n End Sub \\n End Class\")\n            .Should().Be(2);\n        Complexity(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Sub MyMethod() \\n For i As Integer = 0 To -1 \\n Next \\n End Sub \\n End Class\")\n            .Should().Be(2);\n        Complexity(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Sub MyMethod() \\n For Each e As Integer In {1, 2, 3} \\n Next\\n End Sub \\n End Class\")\n            .Should().Be(2);\n        Complexity(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Sub MyMethod() \\n Dim a As Boolean = False\\n End Sub \\n End Class\")\n            .Should().Be(1);\n        Complexity(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Sub MyMethod() \\n Dim a As Boolean = False And False\\n End Sub \\n End Class\")\n            .Should().Be(1);\n        Complexity(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Sub MyMethod() \\n Dim a As Boolean = False Or False\\n End Sub \\n End Class\")\n            .Should().Be(1);\n        Complexity(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Public Property MyProperty As Integer \\n End Class\")\n            .Should().Be(0);\n        Complexity(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Public Property MyProperty As Integer \\n Get \\n End Get \" +\n            \"\\n Set(value As Integer) \\n End Set \\n End Property \\n End Class\")\n            .Should().Be(2);\n        Complexity(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Sub New() \\n End Sub \\n End Class\")\n            .Should().Be(1);\n        Complexity(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Protected Overrides Sub Finalize() \\n End Sub \\n End Class\")\n            .Should().Be(1);\n        Complexity(AnalyzerLanguage.VisualBasic, \"Class Sample \\n Public Shared Operator +(a As Sample) As Sample \\n Return a \\n End Operator \\n End Class\")\n            .Should().Be(1);\n        Complexity(AnalyzerLanguage.VisualBasic, \"\"\"\n            Class Sample\n                Public Custom Event OnSomething As EventHandler\n\n                    AddHandler(ByVal value As EventHandler)\n                    End AddHandler\n                    RemoveHandler(ByVal value As EventHandler)\n                    End RemoveHandler\n                    RaiseEvent(ByVal sender As Object, ByVal e As EventArgs)\n                    End RaiseEvent\n                End Event\n            End Class\n            \"\"\")\n            .Should().Be(3);\n\n        Complexity(AnalyzerLanguage.VisualBasic, \"Module Module1\\n Class Sample\\n Function Bar() \\n Return 0\\n End Function \\n End Class\\n End Module\")\n            .Should().Be(1);\n        Complexity(AnalyzerLanguage.VisualBasic, \"Module Module1\\n Class Sample\\n Function Bar() \\n If False Then \\n Return 1 \\n Else \\n Return 0 \\n End If\\n End Function\\n End Class\\n End Module\")\n            .Should().Be(2);\n        Complexity(AnalyzerLanguage.VisualBasic, \"Module Module1\\n Class Sample\\n Function Foo() \\n Return 42\\n End Function\\n End Class\\n End Module\")\n            .Should().Be(1);\n        Complexity(AnalyzerLanguage.VisualBasic, \"Module Module1\\n Class Sample\\n ReadOnly Property MyProp \\n Get \\n Return \\\"\\\" \\n End Get \\n End Property\\n End Class\\n End Module\")\n            .Should().Be(1);\n        Complexity(AnalyzerLanguage.VisualBasic, \"Module Module1\\n Class Sample\\n Sub Foo() \\n End Sub\\n End Class\\n End Module\")\n            .Should().Be(1);\n        Complexity(AnalyzerLanguage.VisualBasic, \"Module Module1\\n Class Sample\\n Sub Foo() \\n Dim Foo = If(True, True, False)\\n End Sub\\n End Class\\n End Module\")\n            .Should().Be(2);\n        Complexity(AnalyzerLanguage.VisualBasic, \"Module Module1\\n Class Sample\\n Sub Foo() \\n Dim Foo = Function() 0\\n End Sub\\n End Class\\n End Module\")\n            .Should().Be(1);\n        Complexity(AnalyzerLanguage.VisualBasic, \"Module Module1\\n Class Sample\\n Sub Foo() \\n Dim Foo = Function() \\n Return False \\n End Function\\n End Sub\\n End Class\\n End Module\")\n            .Should().Be(1);\n        Complexity(AnalyzerLanguage.VisualBasic, \"Module Module1\\n Class Sample\\n Sub Foo() \\n Throw New AccessViolationException()\\n End Sub\\n End Class\\n End Module\")\n            .Should().Be(2);\n        Complexity(AnalyzerLanguage.VisualBasic, \"Module Module1\\n Class Sample\\n Sub Method() \\n GoTo Foo \\n Foo: \\n End Sub\\n End Class\\n End Module\")\n            .Should().Be(2);\n    }\n\n    [TestMethod]\n    public void CognitiveComplexity()\n    {\n        var csharpText = System.IO.File.ReadAllText(@\"TestCases\\CognitiveComplexity.cs\");\n        CognitiveComplexity(AnalyzerLanguage.CSharp, csharpText).Should().Be(109);\n\n        var csharpLatestText = System.IO.File.ReadAllText(@\"TestCases\\CognitiveComplexity.Latest.cs\");\n        var csharpLatestCompilation = SolutionBuilder.Create().AddProject(AnalyzerLanguage.CSharp, OutputKind.ConsoleApplication)\n            .AddSnippet(csharpLatestText)\n            .GetCompilation();\n        var csharpLatestTree = csharpLatestCompilation.SyntaxTrees.Single();\n        new CSharpMetrics(csharpLatestTree, csharpLatestCompilation.GetSemanticModel(csharpLatestTree)).CognitiveComplexity.Should().Be(49);\n\n        var visualBasicCode = System.IO.File.ReadAllText(@\"TestCases\\CognitiveComplexity.vb\");\n        CognitiveComplexity(AnalyzerLanguage.VisualBasic, visualBasicCode).Should().Be(122);\n    }\n\n    [TestMethod]\n    public void WrongMetrics_CSharp()\n    {\n        var (syntaxTree, semanticModel) = TestCompiler.CompileVB(string.Empty);\n        Assert.Throws<ArgumentException>(() => new CSharpMetrics(syntaxTree, semanticModel));\n    }\n\n    [TestMethod]\n    public void WrongMetrics_VisualBasic()\n    {\n        var (syntaxTree, semanticModel) = TestCompiler.CompileCS(string.Empty);\n        Assert.Throws<ArgumentException>(() => new VisualBasicMetrics(syntaxTree, semanticModel));\n    }\n\n    [TestMethod]\n    public void ExecutableLinesMetricsIsPopulated_CSharp() =>\n        ExecutableLines(AnalyzerLanguage.CSharp, \"public class Sample { public void Foo(int x) { int i = 0; if (i == 0) {i++;i--;} else { while(true){i--;} } } }\")\n            .Should().Equal(1);\n\n    [TestMethod]\n    public void ExecutableLinesMetricsIsPopulated_VB() =>\n        ExecutableLines(AnalyzerLanguage.VisualBasic, \"\"\"\n            Module MainMod\n                Private Sub Foo(x As Integer)\n                    If x = 42 Then\n                    End If\n                End Sub\n            End Module\n            \"\"\")\n            .Should().Equal(3);\n\n    private static ISet<int> LinesOfCode(AnalyzerLanguage language, string text) =>\n        MetricsFor(language, text).CodeLines;\n\n    private static FileComments CommentsWithoutHeaders(AnalyzerLanguage language, string text) =>\n        MetricsFor(language, text).GetComments(true);\n\n    private static FileComments CommentsWithHeaders(AnalyzerLanguage language, string text) =>\n        MetricsFor(language, text).GetComments(false);\n\n    private static int Classes(AnalyzerLanguage language, string text) =>\n        MetricsFor(language, text).ClassCount;\n\n    private static int Statements(AnalyzerLanguage language, string text) =>\n        MetricsFor(language, text).StatementCount;\n\n    private static int Functions(AnalyzerLanguage language, string text) =>\n        MetricsFor(language, text).FunctionCount;\n\n    private static int Complexity(AnalyzerLanguage language, string text) =>\n        MetricsFor(language, text).Complexity;\n\n    private static int CognitiveComplexity(AnalyzerLanguage language, string text) =>\n        MetricsFor(language, text).CognitiveComplexity;\n\n    private static ICollection<int> ExecutableLines(AnalyzerLanguage language, string text) =>\n        MetricsFor(language, text).ExecutableLines;\n\n    private static MetricsBase MetricsFor(AnalyzerLanguage language, string text)\n    {\n        if (language != AnalyzerLanguage.CSharp && language != AnalyzerLanguage.VisualBasic)\n        {\n            throw new ArgumentException(\"Supplied language is not C# neither VB.Net\", nameof(language));\n        }\n\n        var (syntaxTree, semanticModel) = TestCompiler.Compile(text, false, language);\n\n        return language == AnalyzerLanguage.CSharp\n            ? new CSharpMetrics(syntaxTree, semanticModel)\n            : new VisualBasicMetrics(syntaxTree, semanticModel);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Common/ParameterLoaderTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\nusing Microsoft.CodeAnalysis.Text;\nusing SonarAnalyzer.Core.AnalysisContext;\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Common;\n\n[TestClass]\npublic class ParameterLoaderTest\n{\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    [DataRow(\"path//aSonarLint.xml\")] // different name\n    [DataRow(\"path//SonarLint.xmla\")] // different extension\n    public void SetParameterValues_WithInvalidSonarLintPath_DoesNotPopulateParameters(string filePath)\n    {\n        // Arrange\n        var compilation = CreateCompilationWithOption(filePath, SourceText.From(File.ReadAllText(@\"TestResources\\SonarLintXml\\All_properties_cs\\SonarLint.xml\")));\n        var analyzer = new ExpressionComplexity(); // Cannot use mock because we use reflection to find properties.\n\n        // Act\n        ParameterLoader.SetParameterValues(analyzer, compilation.SonarLintXml());\n\n        // Assert\n        analyzer.Maximum.Should().Be(3); // Default value\n    }\n\n    [TestMethod]\n    [DataRow(\"a/SonarLint.xml\")] // unix path\n    [DataRow(@\"a\\SonarLint.xml\")]\n    public void SetParameterValues_WithValidSonarLintPath_PopulatesProperties(string filePath)\n    {\n        // Arrange\n        var compilation = CreateCompilationWithOption(filePath, SourceText.From(File.ReadAllText(@\"TestResources\\SonarLintXml\\All_properties_cs\\SonarLint.xml\")));\n        var analyzer = new ExpressionComplexity(); // Cannot use mock because we use reflection to find properties.\n\n        // Act\n        ParameterLoader.SetParameterValues(analyzer, compilation.SonarLintXml());\n\n        // Assert\n        analyzer.Maximum.Should().Be(1); // Value from the xml file\n    }\n\n    [TestMethod]\n    public void SetParameterValues_SonarLintFileWithIntParameterType_PopulatesProperties()\n    {\n        // Arrange\n        var compilation = CreateCompilationWithOption(@\"TestResources\\SonarLintXml\\All_properties_cs\\SonarLint.xml\");\n        var analyzer = new ExpressionComplexity(); // Cannot use mock because we use reflection to find properties.\n\n        // Act\n        ParameterLoader.SetParameterValues(analyzer, compilation.SonarLintXml());\n\n        // Assert\n        analyzer.Maximum.Should().Be(1); // Value from the xml file\n    }\n\n    [TestMethod]\n    public void SetParameterValues_SonarLintFileWithStringParameterType_PopulatesProperty()\n    {\n        // Arrange\n        var parameterValue = \"1\";\n        var filePath = GenerateSonarLintXmlWithParametrizedRule(\"S2342\", \"flagsAttributeFormat\", parameterValue);\n        var compilation = CreateCompilationWithOption(filePath);\n        var analyzer = new EnumNameShouldFollowRegex(); // Cannot use mock because we use reflection to find properties.\n\n        // Act\n        ParameterLoader.SetParameterValues(analyzer, compilation.SonarLintXml());\n\n        // Assert\n        analyzer.FlagsEnumNamePattern.Should().Be(parameterValue); // value from XML file\n    }\n\n    [TestMethod]\n    public void SetParameterValues_SonarLintFileWithBooleanParameterType_PopulatesProperty()\n    {\n        // Arrange\n        var parameterValue = true;\n        var filePath = GenerateSonarLintXmlWithParametrizedRule(\"S1451\", \"isRegularExpression\", parameterValue.ToString());\n        var compilation = CreateCompilationWithOption(filePath);\n        var analyzer = new CheckFileLicense(); // Cannot use mock because we use reflection to find properties.\n\n        // Act\n        ParameterLoader.SetParameterValues(analyzer, compilation.SonarLintXml());\n\n        // Assert\n        analyzer.IsRegularExpression.Should().Be(parameterValue); // value from XML file\n    }\n\n    [TestMethod]\n    public void SetParameterValues_SonarLintFileWithoutRuleParameters_DoesNotPopulateProperties()\n    {\n        // Arrange\n        var compilation = CreateCompilationWithOption(@\"TestResources\\SonarLintXml\\All_properties_cs\\SonarLint.xml\");\n        var analyzer = new LineLength(); // Cannot use mock because we use reflection to find properties.\n\n        // Act\n        ParameterLoader.SetParameterValues(analyzer, compilation.SonarLintXml());\n\n        // Assert\n        analyzer.Maximum.Should().Be(200); // Default value\n    }\n\n    [TestMethod]\n    public void SetParameterValues_CalledTwiceAfterChangeInConfigFile_UpdatesProperties()\n    {\n        // Arrange\n        var maxValue = 1;\n        var ruleParameters = new List<SonarLintXmlRule>()\n        {\n            new SonarLintXmlRule()\n            {\n                Key = \"S1067\",\n                Parameters = new List<SonarLintXmlKeyValuePair>()\n                {\n                    new SonarLintXmlKeyValuePair()\n                    {\n                        Key = \"max\",\n                        Value = maxValue.ToString()\n                    }\n                }\n            }\n        };\n        var sonarLintXml = AnalysisScaffolding.GenerateSonarLintXmlContent(rulesParameters: ruleParameters);\n        var filePath = TestFiles.WriteFile(TestContext, \"SonarLint.xml\", sonarLintXml);\n        var compilation = CreateCompilationWithOption(filePath);\n        var analyzer = new ExpressionComplexity(); // Cannot use mock because we use reflection to find properties.\n\n        // Act\n        ParameterLoader.SetParameterValues(analyzer, compilation.SonarLintXml());\n        analyzer.Maximum.Should().Be(maxValue);\n\n        // Modify the in-memory additional file\n        maxValue = 42;\n        ruleParameters.First().Parameters.First().Value = maxValue.ToString();\n        var modifiedSonarLintXml = AnalysisScaffolding.GenerateSonarLintXmlContent(rulesParameters: ruleParameters);\n        var modifiedFilePath = TestFiles.WriteFile(TestContext, \"SonarLint.xml\", modifiedSonarLintXml);\n        compilation = CreateCompilationWithOption(modifiedFilePath);\n\n        ParameterLoader.SetParameterValues(analyzer, compilation.SonarLintXml());\n        analyzer.Maximum.Should().Be(maxValue);\n    }\n\n    [TestMethod]\n    [DataRow(\"\")]\n    [DataRow(\"this is not an xml\")]\n    [DataRow(@\"<?xml version=\"\"1.0\"\" encoding=\"\"UTF - 8\"\"?><AnalysisInput><Settings>\")]\n    public void SetParameterValues_WithMalformedXml_DoesNotPopulateProperties(string sonarLintXmlContent)\n    {\n        // Arrange\n        var compilation = CreateCompilationWithOption(@\"fakePath\\SonarLint.xml\", SourceText.From(sonarLintXmlContent));\n        var analyzer = new ExpressionComplexity(); // Cannot use mock because we use reflection to find properties.\n\n        // Act\n        ParameterLoader.SetParameterValues(analyzer, compilation.SonarLintXml());\n\n        // Assert\n        analyzer.Maximum.Should().Be(3); // Default value\n    }\n\n    [TestMethod]\n    public void SetParameterValues_SonarLintFileWithStringInsteadOfIntParameterType_PopulatesProperty()\n    {\n        // Arrange\n        var parameterValue = \"fooBar\";\n        var filePath = GenerateSonarLintXmlWithParametrizedRule(\"S1067\", \"max\", parameterValue);\n        var compilation = CreateCompilationWithOption(filePath);\n        var analyzer = new ExpressionComplexity(); // Cannot use mock because we use reflection to find properties.\n\n        // Act\n        ParameterLoader.SetParameterValues(analyzer, compilation.SonarLintXml());\n\n        // Assert\n        analyzer.Maximum.Should().Be(3); // Default value\n    }\n\n    [TestMethod]\n    public void SetParameterValues_SonarLintFileWithStringInsteadOfBooleanParameterType_PopulatesProperty()\n    {\n        // Arrange\n        var parameterValue = \"fooBar\";\n        var filePath = GenerateSonarLintXmlWithParametrizedRule(\"S1451\", \"isRegularExpression\", parameterValue);\n        var compilation = CreateCompilationWithOption(filePath);\n        var analyzer = new CheckFileLicense(); // Cannot use mock because we use reflection to find properties.\n\n        // Act\n        ParameterLoader.SetParameterValues(analyzer, compilation.SonarLintXml());\n\n        // Assert\n        analyzer.IsRegularExpression.Should().BeFalse(); // Default value\n    }\n\n    private static SonarCompilationReportingContext CreateCompilationWithOption(string filePath, SourceText text = null)\n    {\n        var options = text is null\n            ? AnalysisScaffolding.CreateOptions(filePath)\n            : AnalysisScaffolding.CreateOptions(filePath, text);\n        var compilation = SolutionBuilder.Create().AddProject(AnalyzerLanguage.CSharp).GetCompilation();\n        var compilationContext = new CompilationAnalysisContext(compilation, options, _ => { }, _ => true, default);\n        return new(AnalysisScaffolding.CreateSonarAnalysisContext(), compilationContext);\n    }\n\n    private string GenerateSonarLintXmlWithParametrizedRule(string ruleId, string key, string value)\n    {\n        var ruleParameters = new List<SonarLintXmlRule>()\n        {\n            new SonarLintXmlRule()\n            {\n                Key = ruleId,\n                Parameters = new List<SonarLintXmlKeyValuePair>()\n                {\n                    new SonarLintXmlKeyValuePair()\n                    {\n                        Key = key,\n                        Value = value\n                    }\n                }\n            }\n        };\n        return AnalysisScaffolding.CreateSonarLintXml(TestContext, rulesParameters: ruleParameters);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Common/RuleCatalogTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\nusing RuleCatalogCS = SonarAnalyzer.CSharp.Core.Rspec.RuleCatalog;\nusing RuleCatalogVB = SonarAnalyzer.VisualBasic.Core.Rspec.RuleCatalog;\n\nnamespace SonarAnalyzer.Test.Common;\n\n[TestClass]\npublic class RuleCatalogTest\n{\n    [TestMethod]\n    public void RuleCatalog_HasAllFieldsSet_CS() =>\n        AssertRuleS103(RuleCatalogCS.Rules[\"S103\"]);\n\n    [TestMethod]\n    public void RuleCatalog_HasAllFieldsSet_VB() =>\n        AssertRuleS103(RuleCatalogVB.Rules[\"S103\"]);\n\n    [TestMethod]\n    [DataRow(\"S103\", \"CODE_SMELL\")]\n    [DataRow(\"S1048\", \"BUG\")]\n    [DataRow(\"S1313\", \"SECURITY_HOTSPOT\")]\n    public void Type_IsGenerated(string id, string expected)\n    {\n        RuleCatalogCS.Rules[id].Type.Should().Be(expected);\n        RuleCatalogVB.Rules[id].Type.Should().Be(expected);\n    }\n\n    [TestMethod]\n    [DataRow(\"S101\", SourceScope.All)]\n    [DataRow(\"S112\", SourceScope.Main)]\n    [DataRow(\"S3431\", SourceScope.Tests)]\n    public void SourceScope_IsGenerated(string id, SourceScope expected)\n    {\n        RuleCatalogCS.Rules[id].Scope.Should().Be(expected);\n        RuleCatalogVB.Rules[id].Scope.Should().Be(expected);\n    }\n\n    [TestMethod]\n    public void Description_TakesFirstParagraph() =>\n        ValidateDescription(\n            \"S105\",\n            \"<p>That is why using spaces is preferable.</p>\",    // Asserting existence of the second paragraph that should not be part of the description\n            \"The tab width can differ from one development environment to another.\" +\n            \" Using tabs may require other developers to configure their environment (text editor, preferences, etc.) to read source code.\");\n\n    [TestMethod]\n    public void Description_TagsAreRemoved() =>\n        ValidateDescription(\"S1116\", \"by a semicolon <code>;</code>\", \"Empty statements represented by a semicolon ; are statements that do not perform any operation.\");\n\n    [TestMethod]\n    public void Description_HtmlIsDecoded() =>\n        ValidateDescription(\"S1067\", \"<code>&amp;&amp;</code>\", \"The complexity of an expression is defined by the number of &&, || and condition ? ifTrue : ifFalse operators it contains.\");\n\n    [TestMethod]\n    public void Description_NewLinesAreSpaces() =>\n        ValidateDescription(\n            \"S107\",\n            \"track of their\\nposition.\",    // Html contains new line with no spaces around it\n            \"Methods with a long parameter list are difficult to use because maintainers must figure out the role of each parameter and keep track of their position.\");\n\n    private static void AssertRuleS103(RuleDescriptor rule)\n    {\n        rule.Id.Should().Be(\"S103\");\n        rule.Title.Should().Be(\"Lines should not be too long\");\n        rule.Type.Should().Be(\"CODE_SMELL\");\n        rule.DefaultSeverity.Should().Be(\"Major\");\n        rule.Status.Should().Be(\"ready\");\n        rule.Scope.Should().Be(SourceScope.All);\n        rule.SonarWay.Should().BeFalse();\n        rule.Description.Should().Be(\"Scrolling horizontally to see a full line of code lowers the code readability.\");\n    }\n\n    private static void ValidateDescription(string id, string assertedSourceFragment, string expectedDescription)\n    {\n        var rspecDirectory = Path.Combine(Paths.AnalyzersRoot, \"rspec\", \"cs\");\n        var html = File.ReadAllText(Path.Combine(rspecDirectory, $\"{id}.html\")).Replace(\"\\r\\n\", \"\\n\");\n        html.Should().Contain(assertedSourceFragment, \"we need to make sure that the assertion below has expected data fragment as an input\");\n        RuleCatalogCS.Rules[id].Description.Should().Contain(expectedDescription);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Common/SecurityHotspotTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Reflection;\nusing SonarAnalyzer.Core.Rules;\nusing SonarAnalyzer.CSharp.Rules;\nusing SonarAnalyzer.Test.Rules;\n\nnamespace SonarAnalyzer.Test.Common;\n\n[TestClass]\npublic class SecurityHotspotTest\n{\n    [TestMethod]\n    public void SecurityHotspotRules_DoNotRaiseIssues_CS() =>\n        VerifyNoIssues(AnalyzerLanguage.CSharp, LanguageOptions.FromCSharp9);\n\n    [TestMethod]\n    public void SecurityHotspotRules_DoNotRaiseIssues_VB() =>\n        VerifyNoIssues(AnalyzerLanguage.VisualBasic, LanguageOptions.FromVisualBasic12);\n\n    private static void VerifyNoIssues(AnalyzerLanguage language, ImmutableArray<ParseOptions> parseOptions)\n    {\n        foreach (var analyzer in CreateHotspotAnalyzers(language))\n        {\n            var analyzerName = analyzer.GetType().Name;\n\n#if NETFRAMEWORK\n\n            if (analyzerName is nameof(DisablingCsrfProtection) || analyzerName is nameof(PermissiveCors))\n            {\n                continue;\n            }\n#endif\n\n            new VerifierBuilder()\n                .AddPaths(@$\"Hotspots\\{TestCaseFileName(analyzerName)}{language.FileExtension}\")\n                .AddAnalyzer(() => analyzer)\n                .WithOptions(parseOptions)\n                .AddReferences(AdditionalReferences(analyzerName))\n                .WithConcurrentAnalysis(analyzerName is not nameof(ClearTextProtocolsAreSensitive))\n                .VerifyNoIssuesIgnoreErrors();\n        }\n    }\n\n    private static IEnumerable<SonarDiagnosticAnalyzer> CreateHotspotAnalyzers(AnalyzerLanguage language) =>\n        new[] { typeof(CSharp.Metrics.CSharpMetrics), typeof(VisualBasic.Metrics.VisualBasicMetrics) }  // Any type from those assemblies\n            .SelectMany(x => x.Assembly.GetExportedTypes())\n            .Where(x => x.IsSubclassOf(typeof(DiagnosticAnalyzer))\n                        && !typeof(UtilityAnalyzerBase).IsAssignableFrom(x)\n                        && x.GetCustomAttributes<DiagnosticAnalyzerAttribute>().Any())\n            .Where(x => typeof(SonarDiagnosticAnalyzer).IsAssignableFrom(x) && x.AnalyzerTargetLanguage() == language)   // Avoid IRuleFactory and SE rules\n            .Select(x => (SonarDiagnosticAnalyzer)Activator.CreateInstance(x))\n            .Where(IsSecurityHotspot);\n\n    private static bool IsSecurityHotspot(DiagnosticAnalyzer analyzer) =>\n        analyzer.SupportedDiagnostics.Any(x => x.IsSecurityHotspot());\n\n    private static string TestCaseFileName(string analyzerName) =>\n        analyzerName switch\n        {\n            \"ConfiguringLoggers\" => \"ConfiguringLoggers_Log4Net\",\n            \"CookieShouldBeHttpOnly\" => \"CookieShouldBeHttpOnly_Nancy\",\n            \"CookieShouldBeSecure\" => \"CookieShouldBeSecure_Nancy\",\n            \"DeliveringDebugFeaturesInProduction\" => \"DeliveringDebugFeaturesInProduction.NetCore2\",\n            \"DoNotHardcodeCredentials\" => \"DoNotHardcodeCredentials.DefaultValues\",\n#if NETFRAMEWORK\n            \"ExecutingSqlQueries\" => \"ExecutingSqlQueries.Net46\",\n            \"UsingCookies\" => \"UsingCookies_Net46\",\n#else\n            \"DisablingCsrfProtection\" => \"DisablingCsrfProtection.Latest\",\n            \"ExecutingSqlQueries\" => \"ExecutingSqlQueries.EntityFrameworkCoreLatest\",\n            \"PermissiveCors\" => \"PermissiveCors.Latest\",\n            \"UsingCookies\" => \"UsingCookies_NetCore\",\n#endif\n            _ => analyzerName\n        };\n\n    private static IEnumerable<MetadataReference> AdditionalReferences(string analyzerName) =>\n        analyzerName switch\n        {\n            nameof(ClearTextProtocolsAreSensitive) => ClearTextProtocolsAreSensitiveTest.AdditionalReferences,\n            nameof(CookieShouldBeHttpOnly) => CookieShouldBeHttpOnlyTest.AdditionalReferences,\n            nameof(CookieShouldBeSecure) => CookieShouldBeSecureTest.AdditionalReferences,\n            nameof(ConfiguringLoggers) => ConfiguringLoggersTest.Log4NetReferences,\n            nameof(DeliveringDebugFeaturesInProduction) => DeliveringDebugFeaturesInProductionTest.AdditionalReferencesForAspNetCore2,\n            nameof(DisablingRequestValidation) => NuGetMetadataReference.MicrosoftAspNetMvc(TestConstants.NuGetLatestVersion),\n            nameof(DoNotHardcodeCredentials) => DoNotHardcodeCredentialsTest.AdditionalReferences,\n            nameof(DoNotUseRandom) => MetadataReferenceFacade.SystemSecurityCryptography,\n            nameof(ExpandingArchives) => ExpandingArchivesTest.AdditionalReferences,\n            nameof(RequestsWithExcessiveLength) => RequestsWithExcessiveLengthTest.GetAdditionalReferences(),\n            nameof(SpecifyTimeoutOnRegex) => MetadataReferenceFacade.RegularExpressions\n                .Concat(NuGetMetadataReference.SystemComponentModelAnnotations()),\n\n#if NET\n            nameof(DisablingCsrfProtection) => DisablingCsrfProtectionTest.AdditionalReferences(),\n            nameof(ExecutingSqlQueries) => ExecutingSqlQueriesTest.ReferencesEntityFrameworkNetCore(\"7.0.14\"),\n            nameof(PermissiveCors) => PermissiveCorsTest.AdditionalReferences,\n#else\n            nameof(ExecutingSqlQueries) => ExecutingSqlQueriesTest.ReferencesNet46(TestConstants.NuGetLatestVersion),\n#endif\n            _ => MetadataReferenceFacade.SystemNetHttp\n                                        .Concat(MetadataReferenceFacade.SystemDiagnosticsProcess)\n                                        .Concat(MetadataReferenceFacade.SystemSecurityCryptography)\n        };\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Common/UnchangedFilesTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Common;\n\n[TestClass]\npublic class UnchangedFilesTest\n{\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    [DataRow(\"ClassNotInstantiatable.cs\", true)]\n    [DataRow(\"SomeOtherFile.cs\", false)]\n    public void UnchangedFiles_SymbolBasedRule(string unchangedFileName, bool expectEmptyResults)\n    {\n        var builder = new VerifierBuilder<ClassNotInstantiatable>().AddPaths(\"ClassNotInstantiatable.cs\");\n        UnchangedFiles_Verify(builder, unchangedFileName, expectEmptyResults);\n    }\n\n    [TestMethod]\n    [DataRow(\"AbstractTypesShouldNotHaveConstructors.cs\", true)]\n    [DataRow(\"SomeOtherFile.cs\", false)]\n    public void UnchangedFiles_SyntaxNodesBasedRule(string unchangedFileName, bool expectEmptyResults)\n    {\n        var builder = new VerifierBuilder<AbstractTypesShouldNotHaveConstructors>().AddPaths(\"AbstractTypesShouldNotHaveConstructors.cs\");\n        UnchangedFiles_Verify(builder, unchangedFileName, expectEmptyResults);\n    }\n\n    [TestMethod]\n    [DataRow(\"FileLines20.cs\", true)]\n    [DataRow(\"SomeOtherFile.cs\", false)]\n    public void UnchangedFiles_SyntaxTreeBasedRule(string unchangedFileName, bool expectEmptyResults)\n    {\n        var builder = new VerifierBuilder().AddAnalyzer(() => new FileLines { Maximum = 10 }).AddPaths(\"FileLines20.cs\").WithAutogenerateConcurrentFiles(false);\n        UnchangedFiles_Verify(builder, unchangedFileName, expectEmptyResults);\n    }\n\n    [TestMethod]\n    [DataRow(@\"LooseFilePermissions.Windows.cs\", true)]\n    [DataRow(\"SomeOtherFile.cs\", false)]\n    public void UnchangedFiles_CompilationStartBasedRule(string unchangedFileName, bool expectEmptyResults)\n    {\n        var builder = new VerifierBuilder().AddAnalyzer(() => new LooseFilePermissions()).AddPaths(@\"LooseFilePermissions.Windows.cs\");\n        UnchangedFiles_Verify(builder, unchangedFileName, expectEmptyResults);\n    }\n\n    [TestMethod]\n    [DataRow(\"UnusedPrivateMember.cs\", true)]\n    [DataRow(\"SomeOtherFile.cs\", false)]\n    public void UnchangedFiles_ReportDiagnosticIfNonGeneratedBasedRule(string unchangedFileName, bool expectEmptyResults)\n    {\n        var builder = new VerifierBuilder<UnusedPrivateMember>().AddPaths(\"UnusedPrivateMember.cs\");\n        UnchangedFiles_Verify(builder, unchangedFileName, expectEmptyResults);\n    }\n\n    private void UnchangedFiles_Verify(VerifierBuilder builder, string unchangedFileName, bool expectEmptyResults)\n    {\n        builder = builder.WithConcurrentAnalysis(false).WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfigWithUnchangedFiles(TestContext, unchangedFileName));\n        if (expectEmptyResults)\n        {\n            builder.VerifyNoIssuesIgnoreErrors();\n        }\n        else\n        {\n            builder.Verify();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Common/UniqueQueueTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Collections;\nusing SonarAnalyzer.CFG.Common;\n\nnamespace SonarAnalyzer.Test.Common;\n\n[TestClass]\npublic class UniqueQueueTest\n{\n    [TestMethod]\n    public void Enqueue_UniqueItems()\n    {\n        var sut = new UniqueQueue<int>();\n        sut.Enqueue(42);\n        sut.Dequeue().Should().Be(42);\n        sut.Enqueue(42);\n        sut.Dequeue().Should().Be(42, \"second enqueue of dequeued item should not prevent it from being enqueued again\");\n    }\n\n    [TestMethod]\n    public void Dequeue_UniqueItems()\n    {\n        var sut = new UniqueQueue<int>();\n        sut.Enqueue(41);\n        sut.Enqueue(42);\n        sut.Enqueue(42);\n        sut.Enqueue(43);\n        sut.Enqueue(42);\n        sut.Dequeue().Should().Be(41);\n        sut.Enqueue(42);\n        sut.Dequeue().Should().Be(42);\n        sut.Dequeue().Should().Be(43);\n        sut.Invoking(x => x.Dequeue()).Should().Throw<InvalidOperationException>();\n    }\n\n    [TestMethod]\n    public void GetEnumerator()\n    {\n        var sut = new UniqueQueue<int>();\n        ((IEnumerable)sut).GetEnumerator().Should().NotBeNull();    // For coverage\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Common/XUnitVersions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Test.Common;\n\npublic static class XUnitVersions\n{\n    public const string Ver2 = \"2.0.0\";\n    public const string Ver253 = \"2.5.3\";\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Extensions/ICompilationReportExtensionsTests.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.AnalysisContext;\nusing ExtensionsCS = SonarAnalyzer.CSharp.Core.Extensions.ICompilationReportExtensions;\nusing ExtensionsVB = SonarAnalyzer.VisualBasic.Core.Extensions.ICompilationReportExtensions;\n\nnamespace SonarAnalyzer.Test.Extensions;\n\n[TestClass]\npublic class ICompilationReportExtensionsTests\n{\n    private static readonly DiagnosticDescriptor DummyMainDescriptor = AnalysisScaffolding.CreateDescriptorMain();\n\n    [TestMethod]\n    [DataRow(\"// <auto-generated/>\", false)]\n    [DataRow(\"// any random comment\", true)]\n    public void ReportIssue_SonarSymbolAnalysisContext_CS(string comment, bool expected)\n    {\n        var (tree, model) = TestCompiler.CompileCS($$\"\"\"\n            {{comment}}\n            public class Sample {}\n            \"\"\");\n        var wasReported = false;\n        var symbolContext = new SymbolAnalysisContext(Substitute.For<ISymbol>(), model.Compilation, AnalysisScaffolding.CreateOptions(), _ => wasReported = true, _ => true, default);\n        var context = new SonarSymbolReportingContext(AnalysisScaffolding.CreateSonarAnalysisContext(), symbolContext);\n        ExtensionsCS.ReportIssue(context, DummyMainDescriptor, tree.GetRoot());\n\n        wasReported.Should().Be(expected);\n    }\n\n    [TestMethod]\n    [DataRow(\"' <auto-generated/>\", false)]\n    [DataRow(\"' any random comment\", true)]\n    public void ReportIssue_SonarSymbolAnalysisContext_VB(string comment, bool expected)\n    {\n        var (tree, model) = TestCompiler.CompileVB($\"\"\"\n            {comment}\n            Public Class Sample\n            End Class\n            \"\"\");\n        var wasReported = false;\n        var symbolContext = new SymbolAnalysisContext(Substitute.For<ISymbol>(), model.Compilation, AnalysisScaffolding.CreateOptions(), _ => wasReported = true, _ => true, default);\n        var context = new SonarSymbolReportingContext(AnalysisScaffolding.CreateSonarAnalysisContext(), symbolContext);\n\n        ExtensionsVB.ReportIssue(context, DummyMainDescriptor, tree.GetRoot());\n        wasReported.Should().Be(expected);\n\n        wasReported = false;\n        ExtensionsVB.ReportIssue(context, DummyMainDescriptor, tree.GetRoot().GetFirstToken());\n        wasReported.Should().Be(expected);\n\n        wasReported = false;\n        ExtensionsVB.ReportIssue(context, DummyMainDescriptor, tree.GetRoot().GetLocation());\n        wasReported.Should().Be(expected);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Extensions/StringExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CFG.Extensions;\n\nnamespace SonarAnalyzer.Test.Extensions;\n\n[TestClass]\npublic class StringExtensionsTest\n{\n    [TestMethod]\n    public void TestSplitCamelCaseToWords()\n    {\n        AssertSplitEquivalent(\"thisIsAName\", \"THIS\", \"IS\", \"A\", \"NAME\");\n        AssertSplitEquivalent(\"thisIsSMTPName\", \"THIS\", \"IS\", \"SMTP\", \"NAME\");\n        AssertSplitEquivalent(\"ThisIsIt\", \"THIS\", \"IS\", \"IT\");\n        AssertSplitEquivalent(\"bin2hex\", \"BIN\", \"HEX\");\n        AssertSplitEquivalent(\"HTML\", \"HTML\");\n        AssertSplitEquivalent(\"SOME_VALUE\", \"SOME\", \"VALUE\");\n        AssertSplitEquivalent(\"GR8day\", \"GR\", \"DAY\");\n        AssertSplitEquivalent(\"ThisIsEpic\", \"THIS\", \"IS\", \"EPIC\");\n        AssertSplitEquivalent(\"ThisIsEPIC\", \"THIS\", \"IS\", \"EPIC\");\n        AssertSplitEquivalent(\"This_is_EPIC\", \"THIS\", \"IS\", \"EPIC\");\n        AssertSplitEquivalent(\"PEHeader\", \"PE\", \"HEADER\");\n        AssertSplitEquivalent(\"PE_Header\", \"PE\", \"HEADER\");\n        AssertSplitEquivalent(\"BigB_smallc&GIANTD\", \"BIG\", \"B\", \"SMALLC\", \"GIANTD\");\n        AssertSplitEquivalent(\"SMTPServer\", \"SMTP\", \"SERVER\");\n        AssertSplitEquivalent(\"__url_foo\", \"URL\", \"FOO\");\n        AssertSplitEquivalent(\"\");\n        AssertSplitEquivalent(null);\n    }\n\n    private static void AssertSplitEquivalent(string name, params string[] words) =>\n        CollectionAssert.AreEquivalent(words, name.SplitCamelCaseToWords().ToList(), $\" Value: {name}\");\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Extensions/SyntaxNodeExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing FluentAssertions.Extensions;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Operations;\nusing Microsoft.CodeAnalysis.Text;\nusing SonarAnalyzer.CFG.Roslyn;\nusing SonarAnalyzer.Core.Syntax.Extensions;\nusing SonarAnalyzer.CSharp.Core.Syntax.Extensions;\nusing SonarAnalyzer.VisualBasic.Core.Syntax.Extensions;\nusing ExtensionsCore = SonarAnalyzer.Core.Syntax.Extensions.SyntaxNodeExtensions;\nusing ExtensionsShared = SonarAnalyzer.CSharp.Core.Syntax.Extensions.SyntaxNodeExtensionsShared;\nusing MicrosoftExtensionsCS = Microsoft.CodeAnalysis.CSharp.Extensions.SyntaxNodeExtensions;\nusing SyntaxCS = Microsoft.CodeAnalysis.CSharp.Syntax;\nusing SyntaxTokenExtensions = SonarAnalyzer.CSharp.Core.Syntax.Extensions.SyntaxTokenExtensionsShared;\nusing SyntaxVB = Microsoft.CodeAnalysis.VisualBasic.Syntax;\n\nnamespace SonarAnalyzer.Test.Extensions;\n\n[TestClass]\npublic class SyntaxNodeExtensionsTest\n{\n    private const string DefaultFileName = \"Test.cs\";\n\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    public void GetPreviousStatementsCurrentBlockOfNotAStatement()\n    {\n        const string code = \"int x = 42;\";\n\n        var tree = CSharpSyntaxTree.ParseText(code);\n        var compilationUnit = tree.GetCompilationUnitRoot();\n\n        ExtensionsShared.GetPreviousStatementsCurrentBlock(compilationUnit).Should().BeEmpty();\n    }\n\n    [TestMethod]\n    public void GetPreviousStatementsCurrentBlockOfFirstStatement()\n    {\n        const string code = \"public void M() { int x = 42; }\";\n\n        var tree = CSharpSyntaxTree.ParseText(code);\n        var aToken = GetFirstTokenOfKind(tree, SyntaxKind.NumericLiteralToken);\n        var parent = SyntaxTokenExtensions.GetBindableParent(aToken);\n        ExtensionsShared.GetPreviousStatementsCurrentBlock(parent).Should().BeEmpty();\n    }\n\n    [TestMethod]\n    public void GetPreviousStatementsCurrentBlockOfSecondStatement()\n    {\n        const string code = \"public void M() { string s = null; int x = 42; }\";\n\n        var tree = CSharpSyntaxTree.ParseText(code);\n        var aToken = GetFirstTokenOfKind(tree, SyntaxKind.NumericLiteralToken);\n        var parent = SyntaxTokenExtensions.GetBindableParent(aToken);\n        ExtensionsShared.GetPreviousStatementsCurrentBlock(parent).Should().HaveCount(1);\n    }\n\n    [TestMethod]\n    public void GetPreviousStatementsCurrentBlockRetrievesOnlyForCurrentBlock()\n    {\n        const string code = \"public void M(string y) { string s = null; if (y != null) { int x = 42; } }\";\n\n        var tree = CSharpSyntaxTree.ParseText(code);\n        var aToken = GetFirstTokenOfKind(tree, SyntaxKind.NumericLiteralToken);\n        var parent = SyntaxTokenExtensions.GetBindableParent(aToken);\n        ExtensionsShared.GetPreviousStatementsCurrentBlock(parent).Should().BeEmpty();\n    }\n\n    [TestMethod]\n    public void ContainsGetOrSetOnDependencyProperty_SymbolIsNull_ReturnsFalse()\n    {\n        const string code = \"\"\"\n            class Repro\n            {\n                public object Field\n                {\n                    get => GetValue(42); // CS0103: GetValue does not exist in this context, Symbol is null\n                    set { }\n                }\n            }\n            \"\"\";\n        var (tree, model) = TestCompiler.CompileIgnoreErrorsCS(code);\n        var accessor = tree.GetRoot(TestContext.CancellationToken).DescendantNodes().OfType<AccessorDeclarationSyntax>().First(x => x.IsKind(SyntaxKind.GetAccessorDeclaration));\n        ExtensionsShared.ContainsGetOrSetOnDependencyProperty(accessor, model.Compilation).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void ContainsGetOrSetOnDependencyProperty_NotOnDependencyObject_ReturnsFalse()\n    {\n        // GetValue is a local delegate variable: Symbol resolves to the delegate's Invoke method,\n        // ContainingType is the delegate type (non-null), but does not derive from DependencyObject.\n        const string code = \"\"\"\n            class Repro\n            {\n                public object Field\n                {\n                    get\n                    {\n                        var GetValue = () => new object();\n                        return GetValue();\n                    }\n                    set { }\n                }\n            }\n            \"\"\";\n        var (tree, model) = TestCompiler.CompileCS(code);\n        var accessor = tree.GetRoot(TestContext.CancellationToken).DescendantNodes().OfType<AccessorDeclarationSyntax>().First(x => x.IsKind(SyntaxKind.GetAccessorDeclaration));\n        ExtensionsShared.ContainsGetOrSetOnDependencyProperty(accessor, model.Compilation).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void ArrowExpressionBody_WithNotExpectedNode_ReturnsNull()\n    {\n        const string code = \"var x = 1;\";\n        var tree = CSharpSyntaxTree.ParseText(code);\n        SyntaxNodeExtensionsCSharp.ArrowExpressionBody(tree.GetRoot()).Should().BeNull();\n    }\n\n    [TestMethod]\n    public void GetDeclarationTypeName_UnknownType() =>\n#if DEBUG\n        Assert.Throws<UnexpectedValueException>(() => SyntaxNodeExtensionsCSharp.GetDeclarationTypeName(SyntaxFactory.Block()), \"Unexpected type Block\\r\\nParameter name: kind\");\n#else\n        SyntaxNodeExtensionsCSharp.GetDeclarationTypeName(SyntaxFactory.Block()).Should().Be(\"type\");\n#endif\n\n    [TestMethod]\n    public void GetDeclarationTypeName_Class() =>\n        SyntaxNodeExtensionsCSharp.GetDeclarationTypeName(SyntaxFactory.ClassDeclaration(\"MyClass\")).Should().Be(\"class\");\n\n    [TestMethod]\n    public void GetDeclarationTypeName_Constructor() =>\n        SyntaxNodeExtensionsCSharp.GetDeclarationTypeName(SyntaxFactory.ConstructorDeclaration(\"MyConstructor\")).Should().Be(\"constructor\");\n\n    [TestMethod]\n    public void GetDeclarationTypeName_Delegate() =>\n        SyntaxNodeExtensionsCSharp.GetDeclarationTypeName(SyntaxFactory.DelegateDeclaration(SyntaxFactory.ParseTypeName(\"void\"), \"MyDelegate\")).Should().Be(\"delegate\");\n\n    [TestMethod]\n    public void GetDeclarationTypeName_Destructor() =>\n        SyntaxNodeExtensionsCSharp.GetDeclarationTypeName(SyntaxFactory.DestructorDeclaration(\"~\")).Should().Be(\"destructor\");\n\n    [TestMethod]\n    public void GetDeclarationTypeName_Enum() =>\n        SyntaxNodeExtensionsCSharp.GetDeclarationTypeName(SyntaxFactory.EnumDeclaration(\"MyEnum\")).Should().Be(\"enum\");\n\n    [TestMethod]\n    public void GetDeclarationTypeName_EnumMember() =>\n        SyntaxNodeExtensionsCSharp.GetDeclarationTypeName(SyntaxFactory.EnumMemberDeclaration(\"EnumValue1\")).Should().Be(\"enum\");\n\n    [TestMethod]\n    public void GetDeclarationTypeName_Event() =>\n        SyntaxNodeExtensionsCSharp.GetDeclarationTypeName(SyntaxFactory.EventDeclaration(SyntaxFactory.ParseTypeName(\"void\"), \"MyEvent\")).Should().Be(\"event\");\n\n    [TestMethod]\n    public void GetDeclarationTypeName_EventField() =>\n        SyntaxNodeExtensionsCSharp.GetDeclarationTypeName(SyntaxFactory.EventFieldDeclaration(SyntaxFactory.VariableDeclaration(SyntaxFactory.ParseTypeName(\"MyEvent\")))).Should().Be(\"event\");\n\n    [TestMethod]\n    public void GetDeclarationTypeName_Field() =>\n        SyntaxNodeExtensionsCSharp.GetDeclarationTypeName(SyntaxFactory.FieldDeclaration(SyntaxFactory.VariableDeclaration(SyntaxFactory.ParseTypeName(\"int\")))).Should().Be(\"field\");\n\n    [TestMethod]\n    public void GetDeclarationTypeName_Indexer() =>\n        SyntaxNodeExtensionsCSharp.GetDeclarationTypeName(SyntaxFactory.IndexerDeclaration(SyntaxFactory.ParseTypeName(\"int\"))).Should().Be(\"indexer\");\n\n    [TestMethod]\n    public void GetDeclarationTypeName_Interface() =>\n        SyntaxNodeExtensionsCSharp.GetDeclarationTypeName(SyntaxFactory.InterfaceDeclaration(\"MyInterface\")).Should().Be(\"interface\");\n\n    [TestMethod]\n    public void GetDeclarationTypeName_LocalFunction() =>\n        SyntaxNodeExtensionsCSharp.GetDeclarationTypeName(SyntaxFactory.LocalFunctionStatement(SyntaxFactory.ParseTypeName(\"void\"), \"MyLocalFunction\")).Should().Be(\"local function\");\n\n    [TestMethod]\n    public void GetDeclarationTypeName_Method() =>\n        SyntaxNodeExtensionsCSharp.GetDeclarationTypeName(SyntaxFactory.MethodDeclaration(SyntaxFactory.ParseTypeName(\"void\"), \"MyMethod\")).Should().Be(\"method\");\n\n    [TestMethod]\n    public void GetDeclarationTypeName_Property() =>\n        SyntaxNodeExtensionsCSharp.GetDeclarationTypeName(SyntaxFactory.PropertyDeclaration(SyntaxFactory.ParseTypeName(\"void\"), \"MyProperty\")).Should().Be(\"property\");\n\n    [TestMethod]\n    public void GetDeclarationTypeName_Record() =>\n        SyntaxNodeExtensionsCSharp.GetDeclarationTypeName(SyntaxFactory.RecordDeclaration(SyntaxFactory.Token(SyntaxKind.RecordKeyword), \"MyRecord\")).Should().Be(\"record\");\n\n    [TestMethod]\n    public void GetDeclarationTypeName_RecordStruct() =>\n        SyntaxNodeExtensionsCSharp.GetDeclarationTypeName(SyntaxFactory.RecordDeclaration(SyntaxKind.RecordStructDeclaration, SyntaxFactory.Token(SyntaxKind.RecordKeyword), \"MyRecord\"))\n            .Should().Be(\"record struct\");\n\n    [TestMethod]\n    public void GetDeclarationTypeName_Struct() =>\n        SyntaxNodeExtensionsCSharp.GetDeclarationTypeName(SyntaxFactory.StructDeclaration(\"MyStruct\")).Should().Be(\"struct\");\n\n    [TestMethod]\n    public void CreateCfg_MethodDeclaration_ReturnsCfg_CS()\n    {\n        const string code = \"\"\"\n            public class Sample\n            {\n                public void Main()\n                {\n                    var x = 42;\n                }\n            }\n            \"\"\";\n        CreateCfgCS<SyntaxCS.MethodDeclarationSyntax>(code).Should().NotBeNull();\n    }\n\n    [TestMethod]\n    public void CreateCfg_PropertyDeclaration_ReturnsCfg_CS()\n    {\n        const string code = \"\"\"\n            public class Sample\n            {\n                public int Property => 42;\n            }\n            \"\"\";\n        CreateCfgCS<SyntaxCS.PropertyDeclarationSyntax>(code).Should().NotBeNull();\n    }\n\n    [TestMethod]\n    public void CreateCfg_PropertyDeclarationWithoutExpressionBody_ReturnsNull_CS()\n    {\n        const string code = \"\"\"\n            public class Sample\n            {\n                public int Property {get; set;}\n            }\n            \"\"\";\n        CreateCfgCS<SyntaxCS.PropertyDeclarationSyntax>(code).Should().BeNull();\n    }\n\n    [TestMethod]\n    public void CreateCfg_IndexerDeclaration_ReturnsCfg_CS()\n    {\n        const string code = \"\"\"\n            public class Sample\n            {\n                private string field;\n                public string this[int index] => field = null;\n            }\n            \"\"\";\n        CreateCfgCS<SyntaxCS.IndexerDeclarationSyntax>(code).Should().NotBeNull();\n    }\n\n    [TestMethod]\n    public void CreateCfg_FieldInitializerWithoutOperation_ReturnsCfg_CS()\n    {\n        const string code = \"\"\"\n            public class Sample\n            {\n                private string field = null!;   // null! itself doens't have operation, and we can still generate CFG for it from the equals clause\n            }\n            \"\"\";\n        CreateCfgCS<SyntaxCS.EqualsValueClauseSyntax>(code).Should().NotBeNull();\n    }\n\n    [TestMethod]\n    public void CreateCfg_MethodBlock_ReturnsCfg_VB()\n    {\n        const string code = \"\"\"\n            Public Class Sample\n                Public Sub Main()\n                    Dim X As Integer = 42\n                End Sub\n            End Class\n            \"\"\";\n        CreateCfgVB<SyntaxVB.MethodBlockSyntax>(code).Should().NotBeNull();\n    }\n\n    [TestMethod]\n    public void CreateCfg_AnyNode_ReturnsCfg_CS()\n    {\n        const string code = \"\"\"\n            public class Sample\n            {\n                public void Main()\n                {\n                    Main();\n                }\n            }\n            \"\"\";\n        CreateCfgCS<SyntaxCS.InvocationExpressionSyntax>(code).Should().NotBeNull();\n    }\n\n    [TestMethod]\n    public void CreateCfg_AnyNode_ReturnsCfg_VB()\n    {\n        const string code = \"\"\"\n            Public Class Sample\n                Public Sub Main()\n                    Main()\n                End Sub\n            End Class\n            \"\"\";\n        CreateCfgVB<SyntaxVB.InvocationExpressionSyntax>(code).Should().NotBeNull();\n    }\n\n    [TestMethod]\n    public void CreateCfg_LambdaInsideQuery_CS()\n    {\n        const string code = \"\"\"\n            using System;\n            using System.Linq;\n            public class Sample\n            {\n                public void Main(int[] values)\n                {\n                    var result = from value in values select new Lazy<int>(() => value);\n                }\n            }\n            \"\"\";\n        CreateCfgCS<SyntaxCS.ParenthesizedLambdaExpressionSyntax>(code).Should().NotBeNull();\n    }\n\n    [TestMethod]\n    public void CreateCfg_LambdaInsideQuery_VB()\n    {\n        const string code = \"\"\"\n            Public Class Sample\n                Public Sub Main(Values() As Integer)\n                    Dim Result As IEnumerable(Of Lazy(Of Integer)) = From Value In Values Select New Lazy(Of Integer)(Function() Value)\n                End Sub\n            End Class\n            \"\"\";\n        CreateCfgVB<SyntaxVB.SingleLineLambdaExpressionSyntax>(code).Should().NotBeNull();\n    }\n\n    [TestMethod]\n    public void CreateCfg_NestingChain_CS()\n    {\n        const string code = \"\"\"\n            using System;\n            using System.Linq;\n            public class Sample\n            {\n                public void Main(int[] values)\n                {\n                    OuterLocalFunction();\n\n                    void OuterLocalFunction()\n                    {\n                        Action<int, int> outerParenthesizedLambda = (a, b) =>\n                        {\n                            MiddleLocalFunction(42);\n\n                            void MiddleLocalFunction(int c)\n                            {\n                                var queryExpressionInTheWay = from value in values select new Lazy<int>(() =>\n                                    {\n                                        return InnerLocalFunction(value);\n\n                                        static int InnerLocalFunction(int arg)\n                                        {\n                                            Func<int, int> innerLambda = xxx => xxx;\n\n                                            return innerLambda(arg);\n                                        }\n                                    });\n                            }\n                        };\n                    }\n                }\n            }\n            \"\"\";\n        var (tree, semanticModel) = TestCompiler.CompileCS(code);\n        var innerLambda = tree.Single<SyntaxCS.SimpleLambdaExpressionSyntax>();\n        innerLambda.Parent.Parent.Should().BeOfType<SyntaxCS.VariableDeclaratorSyntax>().Subject.Identifier.ValueText.Should().Be(\"innerLambda\");\n\n        var cfg = SyntaxNodeExtensionsCSharp.CreateCfg(innerLambda, semanticModel, default);\n        cfg.Should().NotBeNull(\"It's innerLambda\");\n        cfg.Parent.Should().NotBeNull(\"It's InnerLocalFunction\");\n        cfg.Parent.Parent.Should().NotBeNull(\"Lambda iniside Lazy<int> constructor\");\n        cfg.Parent.Parent.Parent.Should().NotBeNull(\"Anonymous function for query expression\");\n        cfg.Parent.Parent.Parent.Parent.Should().NotBeNull(\"It's MiddleLocalFunction\");\n        cfg.Parent.Parent.Parent.Parent.Parent.Should().NotBeNull(\"It's outerParenthesizedLambda\");\n        cfg.Parent.Parent.Parent.Parent.Parent.Parent.Should().NotBeNull(\"It's OuterLocalFunction\");\n        cfg.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Should().NotBeNull(\"It's the root CFG\");\n        cfg.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Should().BeNull(\"Root CFG should not have Parent\");\n        cfg.OriginalOperation.Should().BeAssignableTo<IAnonymousFunctionOperation>().Subject.Symbol.Parameters.Should().HaveCount(1).And.Contain(x => x.Name == \"xxx\");\n    }\n\n    [TestMethod]\n    public void CreateCfg_NestingChain_VB()\n    {\n        const string code = \"\"\"\n            Public Class Sample\n                Public Sub Main(Values() As Integer)\n                    Dim OuterMultiLineSub As Action =\n                        Sub()\n                            Dim OuterSingleLineFunc As Func(Of Func(Of Integer, Integer)) =\n                                    Function() Function(NestedMultiLineFuncArg As Integer)\n                                                    Dim Lst = From Value\n                                                              In Values\n                                                              Select New Lazy(Of Integer)(Function()\n                                                                                              Dim InnerSingleLineSub = Sub(xxx As Integer) Value.ToString()\n                                                                                          End Function)\n                                                End Function\n                        End Sub\n                End Sub\n            End Class\n            \"\"\";\n        var (tree, semanticModel) = TestCompiler.CompileVB(code);\n        var innerSub = tree.Single<SyntaxVB.InvocationExpressionSyntax>().FirstAncestorOrSelf<SyntaxVB.SingleLineLambdaExpressionSyntax>();\n        innerSub.Parent.Parent.Should().BeOfType<SyntaxVB.VariableDeclaratorSyntax>().Subject.Names.Single().Identifier.ValueText.Should().Be(\"InnerSingleLineSub\");\n\n        var cfg = SyntaxNodeExtensionsVisualBasic.CreateCfg(innerSub, semanticModel, default);\n        cfg.Should().NotBeNull(\"It's InnerSingleLineSub\");\n        cfg.Parent.Should().NotBeNull(\"It's multiline function inside Lazy(Of Integer)\");\n        cfg.Parent.Parent.Should().NotBeNull(\"Lambda iniside Lazy<int> constructor\");\n        cfg.Parent.Parent.Parent.Should().NotBeNull(\"Anonymous function for query expression\");\n        cfg.Parent.Parent.Parent.Parent.Should().NotBeNull(\"It's OuterSingleLineFunc\");\n        cfg.Parent.Parent.Parent.Parent.Parent.Should().NotBeNull(\"It's OuterMultiLineSub\");\n        cfg.Parent.Parent.Parent.Parent.Parent.Parent.Should().NotBeNull(\"It's the root CFG\");\n        cfg.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Should().BeNull(\"Root CFG should not have Parent\");\n        cfg.OriginalOperation.Should().BeAssignableTo<IAnonymousFunctionOperation>().Subject.Symbol.Parameters.Should().HaveCount(1).And.Contain(x => x.Name == \"xxx\");\n    }\n\n    [TestMethod]\n    public void CreateCfg_UndefinedSymbol_ReturnsCfg_CS()\n    {\n        const string code = \"\"\"\n            public class Sample\n            {\n                public void Main()\n                {\n                    Undefined(() => 45);\n                }\n            }\n            \"\"\";\n        var (tree, model) = TestCompiler.CompileIgnoreErrorsCS(code);\n        var lambda = tree.Single<SyntaxCS.ParenthesizedLambdaExpressionSyntax>();\n        SyntaxNodeExtensionsCSharp.CreateCfg(lambda, model, default).Should().NotBeNull();\n    }\n\n    [TestMethod]\n    public void CreateCfg_UndefinedSymbol_ReturnsNull_VB()\n    {\n        const string code = \"\"\"\n            Public Class Sample\n                Public Sub Main()\n                    Undefined(Function() 42)\n                End Sub\n            End Class\n            \"\"\";\n        var (tree, model) = TestCompiler.CompileIgnoreErrorsVB(code);\n        var lambda = tree.Single<SyntaxVB.SingleLineLambdaExpressionSyntax>();\n        SyntaxNodeExtensionsVisualBasic.CreateCfg(lambda, model, default).Should().BeNull();\n    }\n\n    [TestMethod]\n    [DataRow(@\"() =>\")]\n    [DataRow(@\"} () => }\")]\n    [DataRow(@\"{ () => .\")]\n    [DataRow(@\"{ () => => =>\")]\n    public void CreateCfg_InvalidSyntax_ReturnsCfg_CS(string code)\n    {\n        var (tree, model) = TestCompiler.CompileIgnoreErrorsCS(code);\n        var lambda = tree.Single<SyntaxCS.ParenthesizedLambdaExpressionSyntax>();\n        SyntaxNodeExtensionsCSharp.CreateCfg(lambda, model, default).Should().NotBeNull();\n    }\n\n    [TestMethod]\n    public void CreateCfg_Performance_UsesCache_CS()\n    {\n        const string code = \"\"\"\n            using System;\n            public class Sample\n            {\n                public void Main(string noiseToHaveMoreOperations)\n                {\n                    noiseToHaveMoreOperations.ToString();\n                    noiseToHaveMoreOperations.ToString();\n                    noiseToHaveMoreOperations.ToString();\n                    void LocalFunction()\n                    {\n                        noiseToHaveMoreOperations.ToString();\n                        noiseToHaveMoreOperations.ToString();\n                        noiseToHaveMoreOperations.ToString();\n                        Action a = () => 42.ToString();\n                    }\n                }\n            }\n            \"\"\";\n        var (tree, model) = TestCompiler.CompileCS(code);\n        var lambda = tree.Single<SyntaxCS.ParenthesizedLambdaExpressionSyntax>();\n        Action a = () =>\n            {\n                for (var i = 0; i < 10000; i++)\n                {\n                    SyntaxNodeExtensionsCSharp.CreateCfg(lambda, model, default);\n                }\n            };\n        a.ExecutionTime().Should().BeLessThan(1500.Milliseconds());     // Takes roughly 0.2 sec on CI\n    }\n\n    [TestMethod]\n    public void CreateCfg_Performance_UsesCache_VB()\n    {\n        const string code = \"\"\"\n            Public Class Sample\n                Public Sub Main(NoiseToHaveMoreOperations As String)\n                    NoiseToHaveMoreOperations.ToString()\n                    NoiseToHaveMoreOperations.ToString()\n                    NoiseToHaveMoreOperations.ToString()\n                    Dim Outer As Action = Sub()\n                                              NoiseToHaveMoreOperations.ToString()\n                                              NoiseToHaveMoreOperations.ToString()\n                                              NoiseToHaveMoreOperations.ToString()\n                                              Dim Inner As Action = Sub() NoiseToHaveMoreOperations.ToString()\n                                          End Sub\n                End Sub\n            End Class\n            \"\"\";\n        var (tree, model) = TestCompiler.CompileVB(code);\n        var lambda = tree.Single<SyntaxVB.SingleLineLambdaExpressionSyntax>();\n        Action a = () =>\n        {\n            for (var i = 0; i < 10000; i++)\n            {\n                SyntaxNodeExtensionsCSharp.CreateCfg(lambda, model, default);\n            }\n        };\n        a.ExecutionTime().Should().BeLessThan(1.Seconds());     // Takes roughly 0.4 sec on CI\n    }\n\n    [TestMethod]\n    public void CreateCfg_SameNode_DifferentCompilation_DoesNotCache()\n    {\n        // https://github.com/SonarSource/sonar-dotnet/issues/5491\n        const string code = \"\"\"\n            public class Sample\n            {\n                private void Method()\n                { }\n            }\n            \"\"\";\n        var compilation1 = TestCompiler.CompileCS(code).Model.Compilation;\n        var compilation2 = compilation1.WithAssemblyName(\"Different-Compilation-Reusing-Same-Nodes\");\n        var method1 = compilation1.SyntaxTrees.Single().Single<SyntaxCS.MethodDeclarationSyntax>();\n        var method2 = compilation2.SyntaxTrees.Single().Single<SyntaxCS.MethodDeclarationSyntax>();\n        var cfg1 = SyntaxNodeExtensionsCSharp.CreateCfg(method1, compilation1.GetSemanticModel(method1.SyntaxTree), default);\n        var cfg2 = SyntaxNodeExtensionsCSharp.CreateCfg(method2, compilation2.GetSemanticModel(method2.SyntaxTree), default);\n\n        ReferenceEquals(cfg1, cfg2).Should().BeFalse(\"Different compilations should not reuse cache. They do not share semantic model and symbols.\");\n    }\n\n    [TestMethod]\n    // Tuple. From right to left.\n    [DataRow(\"(var a, (x, var b)) = (0, ($$x++, 1));\", \"x\")]\n    [DataRow(\"(var a, (x, var b)) = (0, $$(1, 2));\", \"(x, var b)\")]\n    [DataRow(\"(var a, (var b, var c, var d), var e) = (0, (1, 2, $$3), 4);\", \"var d\")]\n    // Tuple. From left to right\n    [DataRow(\"(var a, (x, $$var b)) = (0, (x++, 1));\", \"1\")]\n    [DataRow(\"(var a, (var b, var c, $$var d), var e) = (0, (1, 2, 3), 4);\", \"3\")]\n    [DataRow(\"(var a, $$(var b, var c)) = (0, (1, 2));\", \"(1, 2)\")]\n    // Designation. From right to left.\n    [DataRow(\"var (a, (b, c)) = (0, (1, $$2));\", \"c\")]\n    [DataRow(\"var (a, (b, c)) = (0, $$(1, 2));\", \"(b, c)\")]\n    [DataRow(\"var (a, (b, _)) = (0, (1, $$2));\", \"_\")]\n    [DataRow(\"var (a, _) = (0, ($$1, 2));\", null)]\n    [DataRow(\"var (a, _) = (0, $$(1, 2));\", \"_\")]\n    [DataRow(\"var _ = ($$0, (1, 2));\", null)]\n    [DataRow(\"_ = ($$0, (1, 2));\", null)]\n    // Designation. From left to right\n    [DataRow(\"var (a, (b, $$c)) = (0, (1, 2));\", \"2\")]\n    [DataRow(\"var (a, $$(b, c)) = (0, (1, 2));\", \"(1, 2)\")]\n    [DataRow(\"var (a, (b, $$_)) = (0, (1, 2));\", \"2\")]\n    [DataRow(\"var (a, $$_) = (0, (1, 2));\", \"(1, 2)\")]\n    // Unaligned tuples. From left to right.\n    [DataRow(\"(var a, var b) = ($$0, 1, 2);\", null)]\n    [DataRow(\"(var a, var b) = (0, 1, $$2);\", null)]\n    [DataRow(\"(var a, var b) = (0, (1, $$2));\", null)]\n    [DataRow(\"(var a, (var b, var c)) = (0, $$1);\", \"(var b, var c)\")] // Syntacticly correct\n    // Unaligned tuples. From right to left.\n    [DataRow(\"(var a, var b, $$var c) = (0, (1, 2));\", null)]\n    [DataRow(\"(var a, (var b, $$var c)) = (0, 1, 2);\", null)]\n    // Unaligned designation. From right to left.\n    [DataRow(\"var (a, (b, c)) = (0, (1, $$2, 3));\", null)]\n    [DataRow(\"var (a, (b, c)) = (0, (1, ($$2, 3)));\", null)]\n    [DataRow(\"var (a, (b, c, d)) = (0, (1, $$2));\", null)]\n    // Unaligned designation. From left to right .\n    [DataRow(\"var (a, (b, $$c)) = (0, (1, 2, 3));\", null)]\n    [DataRow(\"var (a, (b, ($$c, d))) = (0, (1, 2));\", null)]\n    [DataRow(\"var (a, (b, $$c, d)) = (0, (1, 2));\", null)]\n    // Mixed. From right to left.\n    [DataRow(\"(var a, var (b, c)) = (1, ($$2, 3));\", \"b\")]\n    [DataRow(\"(var a, var (b, (c, (d, e)))) = (1, (2, (3, (4, $$5))));\", \"e\")]\n    // Mixed. From left to right.\n    [DataRow(\"(var a, var ($$b, c) )= (1, (2, 3));\", \"2\")]\n    [DataRow(\"(var a, var (b, (c, (d, $$e)))) = (1, (2, (3, (4, 5))));\", \"5\")]\n    [DataRow(\"(var $$a, var (b, c))= (a: 1, (b: (byte)2, 3));\", \"1\")]\n    [DataRow(\"(var a, $$var (b, c))= (a: 1, (b: (byte)2, 3));\", \"(b: (byte)2, 3)\")]\n    [DataRow(\"(var a, var ($$b, c))= (a: 1, (b: (byte)2, 3));\", \"(byte)2\")]\n    [DataRow(\"(var a, var (b, $$c))= (a: 1, (b: (byte)2, 3));\", \"3\")]\n    // Assignment to tuple variable.\n    [DataRow(\"(int, int) t; t = (1, $$2);\", null)]\n    [DataRow(\"(int, int) t; (var a, t) = (1, ($$2, 3));\", null)]\n    [DataRow(\"(int, int) t; (var a, t) = (1, $$(2, 3));\", \"t\")]\n    // Start node is right side of assignment\n    [DataRow(\"var (a, b) = $$(1, 2);\", \"var (a, b)\")]\n    [DataRow(\"var t = $$(1, 2);\", null)] // Not an assignment\n    [DataRow(\"(int, int) t; t = $$(1, 2);\", \"t\")]\n    [DataRow(\"(int, int) t; t = ($$1, 2);\", null)]\n    [DataRow(\"int a; a = $$1;\", \"a\")]\n    // Start node is left side of assignment\n    [DataRow(\"var (a, b)$$ = (1, 2);\", \"(1, 2)\")]\n    [DataRow(\"$$var t = (1, 2);\", null)] // Not an assignment\n    [DataRow(\"(int, int) t; $$t = (1, 2);\", \"(1, 2)\")]\n    [DataRow(\"int a; $$a = 1;\", \"1\")]\n    public void FindAssignmentComplement_Tests(string code, string expectedNode)\n    {\n        code = $@\"\npublic class C\n{{\n    public void M()\n    {{\n        var x = 0;\n        {code}\n    }}\n}}\";\n        var nodePosition = code.IndexOf(\"$$\");\n        code = code.Replace(\"$$\", string.Empty);\n        var tree = CSharpSyntaxTree.ParseText(code);\n        var argument = tree.GetRoot().FindNode(new TextSpan(nodePosition, 0));\n        argument = argument.AncestorsAndSelf()\n            .FirstOrDefault(x => x?.Kind() is\n                SyntaxKind.Argument or\n                SyntaxKindEx.DiscardDesignation or\n                SyntaxKindEx.SingleVariableDesignation or\n                SyntaxKindEx.ParenthesizedVariableDesignation or\n                SyntaxKindEx.TupleExpression)\n            ?? argument;\n        tree.GetDiagnostics().Should().BeEmpty();\n        var target = SyntaxNodeExtensionsCSharp.FindAssignmentComplement(argument);\n        if (expectedNode is null)\n        {\n            target.Should().BeNull();\n        }\n        else\n        {\n            target.Should().NotBeNull();\n            target.ToString().Should().Be(expectedNode);\n        }\n    }\n\n    [TestMethod]\n    public void IsInExpressionTree_CS()\n    {\n        const string code = @\"\nusing System.Linq;\npublic class Sample\n{\n    public void Main(int[] arr)\n    {\n            var withNormalLambda = arr.Where(xNormal => xNormal == 42).OrderBy((xNormal) => xNormal).Select(xNormal => xNormal.ToString());\n            var withNormal = from xNormal in arr where xNormal == 42 orderby xNormal select xNormal.ToString();\n\n            var withExpressionLambda = arr.AsQueryable().Where(xExpres => xExpres == 42).OrderBy((xExpres) => xExpres).Select(xExpres => xExpres.ToString());\n            var withExpression = from xExpres in arr.AsQueryable() where xExpres == 42 orderby xExpres select xExpres.ToString();\n    }\n}\";\n        var (tree, model) = TestCompiler.CompileCS(code);\n        var allIdentifiers = tree.GetRoot().DescendantNodes().OfType<SyntaxCS.IdentifierNameSyntax>().ToArray();\n        allIdentifiers.Where(x => x.Identifier.ValueText == \"xNormal\").Should().HaveCount(6).And.OnlyContain(x => !SyntaxNodeExtensionsCSharp.IsInExpressionTree(x, model));\n        allIdentifiers.Where(x => x.Identifier.ValueText == \"xExpres\").Should().HaveCount(6).And.OnlyContain(x => SyntaxNodeExtensionsCSharp.IsInExpressionTree(x, model));\n    }\n\n    [TestMethod]\n    public void IsInExpressionTree_VB()\n    {\n        const string code = @\"\nPublic Class Sample\n    Public Sub Main(Arr() As Integer)\n        Dim WithNormalLambda = Arr.Where(Function(xNormal) xNormal = 42).OrderBy(Function(xNormal) xNormal).Select(Function(xNormal) xNormal.ToString())\n        Dim WithNormal = From xNormal In Arr Where xNormal = 42 Order By xNormal Select Result = xNormal.ToString()\n\n        Dim WithExpressionLambda = Arr.AsQueryable().Where(Function(xExpres) xExpres = 42).OrderBy(Function(xExpres) xExpres).Select(Function(xExpres) xExpres.ToString())\n        Dim WithExpression = From xExpres In Arr.AsQueryable() Where xExpres = 42 Order By xExpres Select Result = xExpres.ToString()\n    End Sub\nEnd Class\";\n        var (tree, model) = TestCompiler.CompileVB(code);\n        var allIdentifiers = tree.GetRoot().DescendantNodes().OfType<SyntaxVB.IdentifierNameSyntax>().ToArray();\n        allIdentifiers.Where(x => x.Identifier.ValueText == \"xNormal\").Should().HaveCount(6).And.OnlyContain(x => !SyntaxNodeExtensionsVisualBasic.IsInExpressionTree(x, model));\n        allIdentifiers.Where(x => x.Identifier.ValueText == \"xExpres\").Should().HaveCount(6).And.OnlyContain(x => SyntaxNodeExtensionsVisualBasic.IsInExpressionTree(x, model));\n    }\n\n    [TestMethod]\n    [DataRow(\"A?.$$M()\", \"A?.M()\", \"A\")]\n    [DataRow(\"A?.B?.$$M()\", \".B?.M()\", \".B\")]\n    [DataRow(\"A?.M()?.$$B\", \".M()?.B\", \".M()\")]\n    [DataRow(\"A?.$$M()?.B\", \"A?.M()?.B\", \"A\")]\n    [DataRow(\"A[0]?.M()?.$$B\", \".M()?.B\", \".M()\")]\n    [DataRow(\"A[0]?.M().B?.$$C\", \".M().B?.C\", \".M().B\")]\n    [DataRow(\"A[0]?.$$M().B?.C\", \"A[0]?.M().B?.C\", \"A[0]\")]\n    [DataRow(\"A?.$$B.C\", \"A?.B.C\", \"A\")]\n    [DataRow(\"A?.$$B?.C\", \"A?.B?.C\", \"A\")]\n    public void GetParentConditionalAccessExpression_CS(string expression, string parent, string parentExpression)\n    {\n        var code = $$\"\"\"\n            public class X\n            {\n                public X A { get; }\n                public X B { get; }\n                public X C { get; }\n                public X this[int i] => null;\n                public X M()\n                {\n                    var _ = {{expression}};\n                    return null;\n                }\n            }\n            \"\"\";\n        var node = TestCompiler.NodeBetweenMarkersCS(code).Node;\n        var parentConditional = MicrosoftExtensionsCS.GetParentConditionalAccessExpression(node);\n        parentConditional.ToString().Should().Be(parent);\n        parentConditional.Expression.ToString().Should().Be(parentExpression);\n    }\n\n    [TestMethod]\n    [DataRow(\"A?.$$M()\", \"A?.M()\", \"A\")]\n    [DataRow(\"A?.B?.$$M()\", \".B?.M()\", \".B\")]\n    [DataRow(\"A?.M()?.$$B\", \".M()?.B\", \".M()\")]\n    [DataRow(\"A?.$$M()?.B\", \"A?.M()?.B\", \"A\")]\n    [DataRow(\"A(0)?.M()?.$$B\", \".M()?.B\", \".M()\")]\n    [DataRow(\"A(0)?.M().B?.$$C\", \".M().B?.C\", \".M().B\")]\n    [DataRow(\"A(0)?.$$M().B?.C\", \"A(0)?.M().B?.C\", \"A(0)\")]\n    [DataRow(\"A?.$$B.C\", \"A?.B.C\", \"A\")]\n    [DataRow(\"A?.$$B?.C\", \"A?.B?.C\", \"A\")]\n    public void GetParentConditionalAccessExpression_VB(string expression, string parent, string parentExpression)\n    {\n        var code = $$\"\"\"\n            Public Class X\n                Public ReadOnly Property A As X\n                Public ReadOnly Property B As X\n                Public ReadOnly Property C As X\n\n                Default Public ReadOnly Property Item(i As Integer) As X\n                    Get\n                        Return Nothing\n                    End Get\n                End Property\n\n                Public Function M() As X\n                    Dim __ = {{expression}}\n                    Return Nothing\n                End Function\n            End Class\n            \"\"\";\n        var node = TestCompiler.NodeBetweenMarkersVB(code).Node;\n        var parentConditional = SyntaxNodeExtensionsVisualBasic.GetParentConditionalAccessExpression(node);\n        parentConditional.ToString().Should().Be(parent);\n        parentConditional.Expression.ToString().Should().Be(parentExpression);\n    }\n\n    [TestMethod]\n    [DataRow(\"A?.$$M()\")]\n    [DataRow(\"A?.B?.$$M()\")]\n    [DataRow(\"A?.M()?.$$B\")]\n    [DataRow(\"A?.$$M()?.B\")]\n    [DataRow(\"A[0]?.M()?.$$B\")]\n    [DataRow(\"A[0]?.M().B?.$$C\")]\n    [DataRow(\"A?.$$B.C\")]\n    [DataRow(\"A?.$$B?.C\")]\n    public void GetRootConditionalAccessExpression_CS(string expression)\n    {\n        var code = $$\"\"\"\n            public class X\n            {\n                public X A { get; }\n                public X B { get; }\n                public X C { get; }\n                public X this[int i] => null;\n\n                public X M()\n                {\n                    var _ = {{expression}};\n                    return null;\n                }\n            }\n            \"\"\";\n        var node = TestCompiler.NodeBetweenMarkersCS(code).Node;\n        var parentConditional = MicrosoftExtensionsCS.GetRootConditionalAccessExpression(node);\n        parentConditional.ToString().Should().Be(expression.Replace(\"$$\", string.Empty));\n    }\n\n    [TestMethod]\n    public void Kind_Null_ReturnsNone() =>\n        ExtensionsCore.Kind<SyntaxKind>(null).Should().Be(SyntaxKind.None);\n\n    [TestMethod]\n    [DataRow(\"class Test { }\", DisplayName = \"When there is no pragma, return default file name.\")]\n    [DataRow(\"#pragma checksum \\\"FileName.txt\\\" \\\"{guid}\\\" \\\"checksum bytes\\\"\", \"FileName.txt\", DisplayName = \"When pragma is present, return file name from pragma.\")]\n    public void GetMappedFilePath(string code, string expectedFileName = DefaultFileName)\n    {\n        var tree = GetSyntaxTree(code, DefaultFileName);\n        tree.GetRoot().GetMappedFilePathFromRoot().Should().Be(expectedFileName);\n    }\n\n    [TestMethod]\n    [DataRow(\"$$M(1)$$;\")]\n    [DataRow(\"_ = $$new C(1)$$;\")]\n    [DataRow(\"C c = $$new(1)$$;\")]\n    public void ArgumentList_CS_InvocationObjectCreation(string statement)\n    {\n        var code = $$\"\"\"\n            public class C(int p) {\n                public void M(int p) {\n                    {{statement}}\n                }\n            }\n            \"\"\";\n        var node = TestCompiler.NodeBetweenMarkersCS(code).Node;\n        var argumentList = SyntaxNodeExtensionsCSharp.ArgumentList(node).Arguments;\n        var argument = argumentList.Should().ContainSingle().Which;\n        (argument is { Expression: SyntaxCS.LiteralExpressionSyntax { Token.ValueText: \"1\" } }).Should().BeTrue();\n    }\n\n    [TestMethod]\n    [DataRow(\"base\")]\n    [DataRow(\"this\")]\n    public void ArgumentList_CS_ConstructorInitializer(string keyword)\n    {\n        var code = $$\"\"\"\n            public class Base(int p);\n\n            public class C: Base\n            {\n                public C(): $${{keyword}}(1)$$ { }\n                public C(int  p): base(p) { }\n            }\n\n            \"\"\";\n        var node = TestCompiler.NodeBetweenMarkersCS(code).Node;\n        var argumentList = SyntaxNodeExtensionsCSharp.ArgumentList(node).Arguments;\n        var argument = argumentList.Should().ContainSingle().Which;\n        (argument is { Expression: SyntaxCS.LiteralExpressionSyntax { Token.ValueText: \"1\" } }).Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void ArgumentList_CS_PrimaryConstructorBaseType()\n    {\n        var code = \"\"\"\n            public class Base(int p);\n            public class Derived(int p): $$Base(1)$$;\n            \"\"\";\n        var node = TestCompiler.NodeBetweenMarkersCS(code).Node;\n        var argumentList = SyntaxNodeExtensionsCSharp.ArgumentList(node).Arguments;\n        var argument = argumentList.Should().ContainSingle().Which;\n        (argument is { Expression: SyntaxCS.LiteralExpressionSyntax { Token.ValueText: \"1\" } }).Should().BeTrue();\n    }\n\n    [TestMethod]\n    [DataRow(\"_ = $$new System.Collections.Generic.List<int> { 0 }$$;\")]\n    public void ArgumentList_CS_NoList(string statement)\n    {\n        var code = $$\"\"\"\n            public class C {\n                public void M() {\n                    {{statement}}\n                }\n            }\n            \"\"\";\n        var node = TestCompiler.NodeBetweenMarkersCS(code).Node;\n        SyntaxNodeExtensionsCSharp.ArgumentList(node).Should().BeNull();\n    }\n\n    [TestMethod]\n    public void ArgumentList_CS_Null() =>\n        SyntaxNodeExtensionsCSharp.ArgumentList(null).Should().BeNull();\n\n    [TestMethod]\n    [DataRow(\"_ = $$new int[] { 1 }$$;\")]\n    [DataRow(\"_ = $$new { A = 1 }$$;\")]\n    public void ArgumentList_CS_UnsupportedNodeKinds(string statement)\n    {\n        var code = $$\"\"\"\n            public class C {\n                public void M() {\n                    {{statement}}\n                }\n            }\n            \"\"\";\n        var node = TestCompiler.NodeBetweenMarkersCS(code).Node;\n        var sut = () => SyntaxNodeExtensionsCSharp.ArgumentList(node);\n        sut.Should().Throw<InvalidOperationException>();\n    }\n\n    [TestMethod]\n    [DataRow(\"$$M(1)$$\")]\n    [DataRow(\"Call $$M(1)$$\")]\n    [DataRow(\"Dim c = $$New C(1)$$\")]\n    [DataRow(\"$$RaiseEvent SomeEvent(1)$$\")]\n    public void ArgumentList_VB_Invocations(string statement)\n    {\n        var code = $$\"\"\"\n            Imports System\n\n            Public Class C\n                Public Event SomeEvent As Action(Of Integer)\n\n                Public Sub New(p As Integer)\n                End Sub\n\n                Public Sub M(p As Integer)\n                    Dim s As String = \"Test\"\n                    {{statement}}\n                End Sub\n            End Class\n            \"\"\";\n        var node = TestCompiler.NodeBetweenMarkersVB(code, getInnermostNodeForTie: true).Node;\n        var argumentList = SyntaxNodeExtensionsVisualBasic.ArgumentList(node);\n        var argument = argumentList.Arguments.Should().ContainSingle().Which;\n        (argument.GetExpression() is SyntaxVB.LiteralExpressionSyntax { Token.ValueText: \"1\" }).Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void ArgumentList_VB_Mid()\n    {\n        var code = $$\"\"\"\n            Public Class C\n                Public Sub M()\n                    Dim s As String = \"Test\"\n                    $$Mid(s, 1)$$ = \"Test\"\n                End Sub\n            End Class\n            \"\"\";\n        var node = TestCompiler.NodeBetweenMarkersVB(code, getInnermostNodeForTie: true).Node;\n        var argumentList = SyntaxNodeExtensionsVisualBasic.ArgumentList(node);\n        argumentList.Arguments.Should().SatisfyRespectively(\n            x => (x.GetExpression() is SyntaxVB.IdentifierNameSyntax { Identifier.ValueText: \"s\" }).Should().BeTrue(),\n            x => (x.GetExpression() is SyntaxVB.LiteralExpressionSyntax { Token.ValueText: \"1\" }).Should().BeTrue());\n    }\n\n    [TestMethod]\n    public void ArgumentList_VB_Attribute()\n    {\n        var code = \"\"\"\n            <$$System.Obsolete(\"1\")$$>\n            Public Class C\n            End Class\n            \"\"\";\n        var node = TestCompiler.NodeBetweenMarkersVB(code, getInnermostNodeForTie: true).Node;\n        var argumentList = SyntaxNodeExtensionsVisualBasic.ArgumentList(node);\n        var argument = argumentList.Arguments.Should().ContainSingle().Which;\n        (argument.GetExpression() is SyntaxVB.LiteralExpressionSyntax { Token.ValueText: \"1\" }).Should().BeTrue();\n    }\n\n    [TestMethod]\n    [DataRow(\"Dim $$i(1)$$ As Integer\")]\n    [DataRow(\"Dim sales()() As Double = $$New Double(1)() { }$$\")]\n    [DataRow(\"ReDim $$arr(1)$$\")]\n    public void ArgumentList_VB_ArrayBounds(string statement)\n    {\n        var code = $$\"\"\"\n            Public Class C\n                Public Sub M()\n                    Dim arr(0) As Integer\n                    {{statement}}\n                End Sub\n            End Class\n            \"\"\";\n        var node = TestCompiler.NodeBetweenMarkersVB(code, getInnermostNodeForTie: true).Node;\n        var argumentList = SyntaxNodeExtensionsVisualBasic.ArgumentList(node);\n        var argument = argumentList.Arguments.Should().ContainSingle().Which;\n        (argument.GetExpression() is SyntaxVB.LiteralExpressionSyntax { Token.ValueText: \"1\" }).Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void ArgumentList_VB_Call()\n    {\n        var code = $$\"\"\"\n            Public Class C\n                Public Sub M()\n                    Call $$M$$\n                End Sub\n            End Class\n            \"\"\";\n        var node = TestCompiler.NodeBetweenMarkersVB(code, getInnermostNodeForTie: false).Node;\n        SyntaxNodeExtensionsVisualBasic.ArgumentList(node).Should().BeNull();\n    }\n\n    [TestMethod]\n    public void ArgumentList_VB_Null() =>\n        SyntaxNodeExtensionsVisualBasic.ArgumentList(null).Should().BeNull();\n\n    [TestMethod]\n    [DataRow(\"$$Dim a = 1$$\")]\n    public void ArgumentList_VB_UnsupportedNodeKinds(string statement)\n    {\n        var code = $$\"\"\"\n            Public Class C\n                Public Sub M()\n                    {{statement}}\n                End Sub\n            End Class\n            \"\"\";\n        var node = TestCompiler.NodeBetweenMarkersVB(code, getInnermostNodeForTie: true).Node;\n        var sut = () => SyntaxNodeExtensionsVisualBasic.ArgumentList(node);\n        sut.Should().Throw<InvalidOperationException>();\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"public C(int p) { }\"\"\")]\n    [DataRow(\"\"\"public void M(int p) { }\"\"\")]\n    [DataRow(\"\"\"public static C operator + (C p) => default;\"\"\")]\n    [DataRow(\"\"\"public static implicit operator C (int p) => default;\"\"\")]\n    [DataRow(\"\"\"public delegate void M(int p);\"\"\")]\n    public void ParameterList_Methods(string declarations)\n    {\n        var node = TestCompiler.NodeBetweenMarkersCS($$\"\"\"\n            public class C\n            {\n                $${{declarations}}$$\n            }\n            \"\"\").Node;\n        var actual = SyntaxNodeExtensionsCSharp.ParameterList(node);\n        actual.Should().NotBeNull();\n        var entry = actual.Parameters.Should().ContainSingle().Which;\n        entry.Identifier.ValueText.Should().Be(\"p\");\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"$$void Local(int p) { }$$\"\"\")]\n    [DataRow(\"\"\"$$static void Local(int p) { }$$\"\"\")]\n    [DataRow(\"\"\"Func<int, int> f = $$(int p) => 0$$;\"\"\")]\n    [DataRow(\"\"\"Func<int, int> f = $$delegate (int p) { return 0; }$$;\"\"\")]\n    public void ParameterList_NestedMethods(string declarations)\n    {\n        var node = TestCompiler.NodeBetweenMarkersCS($$\"\"\"\n            using System;\n\n            public class C\n            {\n                public void M()\n                {\n                    {{declarations}}\n                }\n            }\n            \"\"\").Node;\n        var actual = SyntaxNodeExtensionsCSharp.ParameterList(node);\n        actual.Should().NotBeNull();\n        var entry = actual.Parameters.Should().ContainSingle().Which;\n        entry.Identifier.ValueText.Should().Be(\"p\");\n    }\n\n    [TestMethod]\n    public void ParameterList_Destructor()\n    {\n        var node = TestCompiler.NodeBetweenMarkersCS(\"\"\"\n            public class C\n            {\n                $$~C() { }$$\n            }\n            \"\"\").Node;\n        var actual = SyntaxNodeExtensionsCSharp.ParameterList(node);\n        actual.Should().NotBeNull();\n        actual.Parameters.Should().BeEmpty();\n    }\n\n    [TestMethod]\n    [DataRow(\"class\")]\n    [DataRow(\"struct\")]\n    [DataRow(\"record struct\")]\n    [DataRow(\"readonly struct\")]\n#if NET\n    [DataRow(\"readonly record struct\")]\n    [DataRow(\"record\")]\n    [DataRow(\"record class\")]\n#endif\n    public void ParameterList_PrimaryConstructors(string type)\n    {\n        var node = TestCompiler.NodeBetweenMarkersCS($$\"\"\"\n            $$public {{type}} C(int p)\n            {\n\n            }$$\n            \"\"\").Node;\n        var actual = SyntaxNodeExtensionsCSharp.ParameterList(node);\n        actual.Should().NotBeNull();\n        var entry = actual.Parameters.Should().ContainSingle().Which;\n        entry.Identifier.ValueText.Should().Be(\"p\");\n    }\n\n    [TestMethod]\n    [DataRow(\"$$int i;$$\")]\n    [DataRow(\"$$class Nested { }$$\")]\n    public void ParameterList_ReturnsNull(string declaration)\n    {\n        var node = TestCompiler.NodeBetweenMarkersCS($$\"\"\"\n            using System.Collections.Generic;\n            public class C\n            {\n                {{declaration}}\n            }\n            \"\"\").Node;\n        var actual = SyntaxNodeExtensionsCSharp.ParameterList(node);\n        actual.Should().BeNull();\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"$$global::System$$.Int32 i;\"\"\", \"System\")]                        // AliasQualifiedNameSyntax\n    [DataRow(\"\"\"$$global::System.Int32$$ i;\"\"\", \"Int32\")]                         // QualifiedNameSyntax (with AliasQualifiedNameSyntax in Left)\n    [DataRow(\"\"\"$$global::System.Collections.Generic.List<int>$$ l;\"\"\", \"List\")]  // QualifiedNameSyntax.Right -> GenericNameSyntax\n    [DataRow(\"\"\"int i = Math.Abs($$1$$);\"\"\", null)]                               // ArgumentSyntax\n    [DataRow(\"\"\"int i = Math.Abs($$value: 1$$);\"\"\", \"value\")]                     // ArgumentSyntax\n    [DataRow(\"\"\"$$int[]$$ i;\"\"\", \"int\")]                                          // ArrayTypeSyntax\n    [DataRow(\"\"\"$$int[][]$$ i;\"\"\", \"int\")]                                        // ArrayTypeSyntax\n    [DataRow(\"\"\"[DebuggerDisplay($$\"\"$$)]int i;\"\"\", null)]                        // AttributeArgumentSyntax\n    [DataRow(\"\"\"[DebuggerDisplay($$value: \"\"$$)]int i;\"\"\", \"value\")]              // AttributeArgumentSyntax\n    [DataRow(\"\"\"[DebuggerDisplay(\"\", $$Name = \"\"$$)]int i;\"\"\", \"Name\")]           // AttributeArgumentSyntax\n    [DataRow(\"\"\"[$$DebuggerDisplay(\"\")$$]int i;\"\"\", \"DebuggerDisplay\")]           // AttributeSyntax\n    [DataRow(\"\"\"class $$T$$ { }\"\"\", \"T\")]                                         // BaseTypeDeclarationSyntax\n    [DataRow(\"\"\"struct $$T$$ { }\"\"\", \"T\")]                                        // BaseTypeDeclarationSyntax\n    [DataRow(\"\"\"interface $$T$$ { }\"\"\", \"T\")]                                     // BaseTypeDeclarationSyntax\n    [DataRow(\"\"\"record $$T$$ { }\"\"\", \"T\")]                                        // BaseTypeDeclarationSyntax\n    [DataRow(\"\"\"record class $$T$$ { }\"\"\", \"T\")]                                  // BaseTypeDeclarationSyntax\n    [DataRow(\"\"\"record struct $$T$$ { }\"\"\", \"T\")]                                 // BaseTypeDeclarationSyntax\n    [DataRow(\"\"\"enum $$T$$ { }\"\"\", \"T\")]                                          // BaseTypeDeclarationSyntax\n    [DataRow(\"\"\"void M() { try { } catch $$(Exception e)$$ { } }\"\"\", \"e\")]       // CatchDeclarationSyntax\n    [DataRow(\"\"\"void M(string s) { var x = $$s?.Length$$; }\"\"\", \"Length\")]                                      // ConditionalAccessExpressionSyntax\n    [DataRow(\"\"\"void M(string s) { $$s?.ToLower()?.ToUpper()$$; }\"\"\", \"ToUpper\")]                               // ConditionalAccessExpressionSyntax\n    [DataRow(\"\"\"void M(string s) { $$s.ToLower()?.ToUpper()$$; }\"\"\", \"ToUpper\")]                                // ConditionalAccessExpressionSyntax + MemberAccessExpressionSyntax\n    [DataRow(\"\"\"void M(string s) { $$s?.ToLower().ToUpper()$$; }\"\"\", \"ToUpper\")]                                // ConditionalAccessExpressionSyntax + MemberAccessExpressionSyntax\n    [DataRow(\"\"\"void M(string s) { $$s?.ToLower().ToUpper()?.PadLeft(42).Normalize()$$; }\"\"\", \"Normalize\")]     // ConditionalAccessExpressionSyntax + MemberAccessExpressionSyntax\n    [DataRow(\"\"\"void M(string s) { $$s.ToLower().ToUpper().PadLeft(42).Normalize()$$; }\"\"\", \"Normalize\")]       // MemberAccessExpressionSyntax\n    [DataRow(\"\"\"void M(string s) { $$s.ToLower().ToUpper()$$.PadLeft(42).Normalize(); }\"\"\", \"ToUpper\")]         // MemberAccessExpressionSyntax\n    [DataRow(\"\"\"void M(string s) { $$s.ToLower().ToUpper()$$?.PadLeft(42).Normalize(); }\"\"\", \"ToUpper\")]        // ConditionalAccessExpressionSyntax + MemberAccessExpressionSyntax\n    [DataRow(\"\"\"void M(string s) { s.ToLower()?.$$ToUpper()?.PadLeft(42).Normalize()$$; }\"\"\", \"Normalize\")]     // MemberAccessExpressionSyntax\n    [DataRow(\"\"\"$$Test() { }$$\"\"\", \"Test\")]                                       // ConstructorDeclarationSyntax\n    [DataRow(\"\"\"Test() : $$this(1)$$ { }\"\"\", \"this\")]                             // ConstructorInitializerSyntax\n    [DataRow(\"\"\"Test() : $$base()$$ { }\"\"\", \"base\")]                              // ConstructorInitializerSyntax\n    [DataRow(\"\"\"$$public static implicit operator int(Test t) => 1;$$\"\"\", \"int\")] // ConversionOperatorDeclarationSyntax\n    [DataRow(\"\"\"$$delegate void D();$$\"\"\", \"D\")]                                  // DelegateDeclarationSyntax\n    [DataRow(\"\"\"$$~Test() { }$$\"\"\", \"Test\")]                                      // DestructorDeclarationSyntax\n    [DataRow(\"\"\"enum E { $$M$$ }\"\"\", \"M\")]                                        // EnumMemberDeclarationSyntax\n    [DataRow(\"\"\"enum E { $$M = 1$$, }\"\"\", \"M\")]                                   // EnumMemberDeclarationSyntax\n    [DataRow(\"\"\"$$event Action E {add { } remove { } }$$\"\"\", \"E\")]                // EventDeclarationSyntax\n    [DataRow(\"\"\"$$event Action E;$$\"\"\", null)]                                    // EventFieldDeclarationSyntax\n    [DataRow(\"\"\"$$event Action E1, E2;$$\"\"\", null)]                               // EventFieldDeclarationSyntax\n    [DataRow(\"\"\"void M() { $$foreach (var x in new int[0]) { }$$ }\"\"\", \"x\")]      // ForEachStatementSyntax\n    [DataRow(\"\"\"void M() { var q = $$from x in new int[0]$$ select x; }\"\"\", \"x\")] // FromClauseSyntax\n    [DataRow(\"\"\"$$Int32$$ i;\"\"\", \"Int32\")]                                        // IdentifierNameSyntax\n    [DataRow(\"\"\"$$int this[int i] { get => 1; set { } }$$\"\"\", \"this\")]            // IndexerDeclarationSyntax\n    [DataRow(\"\"\"int i = $$Math.Abs(1)$$;\"\"\", \"Abs\")]                              // InvocationExpressionSyntax\n    [DataRow(\"\"\"int i = $$Fun()()$$;\"\"\", null)]                                   // InvocationExpressionSyntax\n    [DataRow(\"\"\"void M() { var q = from _ in new int[0] $$join x in new int[0] on _ equals x$$ select _; }\"\"\", \"x\")]  // JoinClauseSyntax\n    [DataRow(\"\"\"void M() { var q = from _ in new int[0] join y in new int[0] on _ equals y $$into x$$ select _; }\"\"\", \"x\")] // JoinIntoClauseSyntax\n    [DataRow(\"\"\"void M() { var q = from _ in new int[0] $$let x = 0$$ select _; }\"\"\", \"x\")]                            // LetClauseSyntax\n    [DataRow(\"\"\"int i = $$int.MaxValue$$;\"\"\", \"MaxValue\")]                        // MemberAccessExpressionSyntax\n    [DataRow(\"\"\"string s = (new object())?$$.ToString$$();\"\"\", \"ToString\")]       // MemberBindingExpressionSyntax\n    [DataRow(\"\"\"string s = (new object())?$$.ToString()$$;\"\"\", \"ToString\")]       // MemberBindingExpressionSyntax\n    [DataRow(\"\"\"$$void M() { }$$\"\"\", \"M\")]                                        // MethodDeclarationSyntax\n    [DataRow(\"\"\"$$int?$$ i;\"\"\", \"int\")]                                           // NullableTypeSyntax\n    [DataRow(\"\"\"object o = $$new object()$$;\"\"\", \"object\")]                       // ObjectCreationExpressionSyntax\n    [DataRow(\"\"\"$$public static Test operator +(Test t) => default;$$\"\"\", \"+\")]   // OperatorDeclarationSyntax\n    [DataRow(\"\"\"void M($$int i$$) { }\"\"\", \"i\")]                                   // ParameterSyntax\n    [DataRow(\"\"\"int i = $$(int.MaxValue)$$;\"\"\", \"MaxValue\")]                      // ParenthesizedExpressionSyntax\n    [DataRow(\"\"\"$$int P { get; }$$\"\"\", \"P\")]                                      // PropertyDeclarationSyntax\n    [DataRow(\"\"\"int i = $$-int.MaxValue$$;\"\"\", \"MaxValue\")]                       // PrefixUnaryExpressionSyntax\n    [DataRow(\"\"\"object o = $$new object()!$$;\"\"\", \"object\")]                      // PostfixUnaryExpressionSyntax\n    [DataRow(\"\"\"$$int*$$ i;\"\"\", \"int\")]                                           // PointerTypeSyntax\n    [DataRow(\"\"\"$$System.Collections.ArrayList$$ l;\"\"\", \"ArrayList\")]             // QualifiedNameSyntax\n    [DataRow(\"\"\"void M() { var q = from x in new int[0] group x by x $$into y$$ select y; }\"\"\", \"y\")] // QueryContinuationSyntax\n    [DataRow(\"\"\"$$List<int>$$ l;\"\"\", \"List\")]                                     // GenericNameSyntax\n    [DataRow(\"\"\"bool M() => (0, Name: \"a\") is (_, $$Name: null$$);\"\"\", \"Name\")]   // SubpatternSyntax\n    [DataRow(\"\"\"bool M() => (0, Name: \"a\") is ($$_$$, Name: null);\"\"\", null)]     // SubpatternSyntax\n    [DataRow(\"\"\"void M<T>() where $$T : class$$ { }\"\"\", \"T\")]                     // TypeParameterConstraintClauseSyntax\n    [DataRow(\"\"\"void M<$$T$$>() { }\"\"\", \"T\")]                                     // TypeParameterSyntax\n    [DataRow(\"\"\"int $$i$$;\"\"\", \"i\")]                                              // VariableDeclaratorSyntax\n    [DataRow(\"\"\"object o = $$new()$$;\"\"\", \"new\")]                                 // ImplicitObjectCreationExpressionSyntax\n    [DataRow(\"\"\"void M(int p) { $$ref int$$ i = ref p; }\"\"\", \"int\")]              // RefTypeSyntax\n    [DataRow(\"\"\"void M() { int.TryParse(\"\", out var $$x$$); }\"\"\", \"x\")]            // SingleVariableDesignationSyntaxWrapper\n    public void GetIdentifier_Members(string member, string expected)\n    {\n        var node = TestCompiler.NodeBetweenMarkersCS($$\"\"\"\n            using System;\n            using System.Collections.Generic;\n            using System.Diagnostics;\n            using System.Linq;\n            unsafe class Test\n            {\n                static Func<int> Fun() => default;\n                public Test(int i) { }\n                {{member}}\n            }\n            \"\"\").Node;\n        var actual = SyntaxNodeExtensionsCSharp.GetIdentifier(node);\n        if (expected is null)\n        {\n            actual.Should().BeNull();\n        }\n        else\n        {\n            actual.Should().NotBeNull();\n            actual.Value.ValueText.Should().Be(expected);\n        }\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"$$Object$$ M() { return null; }\"\"\", \"Object\")]                                        // TypeSyntax itself\n    [DataRow(\"\"\"$$Object M() { return null; }$$\"\"\", \"Object\")]                                        // MethodDeclarationSyntax\n    [DataRow(\"\"\"$$void M() { }$$\"\"\", \"void\")]                                                         // MethodDeclarationSyntax — void return type\n    [DataRow(\"\"\"$$public static Object operator +(Test t) => default;$$\"\"\", \"Object\")]                // OperatorDeclarationSyntax\n    [DataRow(\"\"\"$$public static implicit operator int(Test t) => 0;$$\"\"\", \"int\")]                     // ConversionOperatorDeclarationSyntax\n    [DataRow(\"\"\"$$delegate Object D();$$\"\"\", \"Object\")]                                               // DelegateDeclarationSyntax\n    [DataRow(\"\"\"$$Object P { get; }$$\"\"\", \"Object\")]                                                  // PropertyDeclarationSyntax (BasePropertyDeclarationSyntax)\n    [DataRow(\"\"\"$$event Action E { add { } remove { } }$$\"\"\", \"Action\")]                              // EventDeclarationSyntax (BasePropertyDeclarationSyntax)\n    [DataRow(\"\"\"$$int this[int i] { get => 1; set { } }$$\"\"\", \"int\")]                                 // IndexerDeclarationSyntax (BasePropertyDeclarationSyntax)\n    [DataRow(\"\"\"$$Object field;$$\"\"\", \"Object\")]                                                      // FieldDeclarationSyntax (BaseFieldDeclarationSyntax)\n    [DataRow(\"\"\"$$event Action E;$$\"\"\", \"Action\")]                                                    // EventFieldDeclarationSyntax (BaseFieldDeclarationSyntax)\n    [DataRow(\"\"\"void M() { $$Object x = null;$$ }\"\"\", \"Object\")]                                      // LocalDeclarationStatementSyntax\n    [DataRow(\"\"\"void M() { $$using (IDisposable x = null) { }$$ }\"\"\", \"IDisposable\")]                 // UsingStatementSyntax (with declaration)\n    [DataRow(\"\"\"void M() { $$using (new System.IO.MemoryStream()) { }$$ }\"\"\", null)]                  // UsingStatementSyntax (expression form — no declaration)\n    [DataRow(\"\"\"void M() { $$for (Object x = null; ; ) { }$$ }\"\"\", \"Object\")]                         // ForStatementSyntax (with declaration)\n    [DataRow(\"\"\"void M() { int[] arr = new int[1]; $$fixed (int* p = arr) { }$$ }\"\"\", \"int*\")]        // FixedStatementSyntax\n    [DataRow(\"\"\"void M() { foreach ($$Object x$$ in new Object[0]) { } }\"\"\", \"Object\")]               // ForEachStatementSyntax\n    [DataRow(\"\"\"void M() { try { } catch ($$Exception e$$) { } }\"\"\", \"Exception\")]                    // CatchDeclarationSyntax\n    [DataRow(\"\"\"void M() { try { } $$catch (Exception e) { }$$ }\"\"\", \"Exception\")]                    // CatchClauseSyntax (with declaration)\n    [DataRow(\"\"\"void M() { try { } $$catch { }$$ }\"\"\", null)]                                         // CatchClauseSyntax (without declaration)\n    [DataRow(\"\"\"void M($$Object p$$) { }\"\"\", \"Object\")]                                               // ParameterSyntax\n    [DataRow(\"\"\"void M() { var _ = $$Object () => default$$; }\"\"\", \"Object\")]                         // ParenthesizedLambdaExpressionSyntax\n    [DataRow(\"\"\"void M() { Func<Object, Object> _ = $$x => x$$; }\"\"\", null)]                          // SimpleLambdaExpressionSyntax — no type annotation\n    [DataRow(\"\"\"void M() { var q = $$from Object x in new Object[0]$$ select x; }\"\"\", \"Object\")]      // FromClauseSyntax\n    [DataRow(\"\"\"void M() { var q = from Object x in new Object[0] $$join Object y in new Object[0] on x equals y$$ select x; }\"\"\", \"Object\")]  // JoinClauseSyntax\n    [DataRow(\"\"\"void M() { _ = $$new Object()$$; }\"\"\", \"Object\")]                                     // ObjectCreationExpressionSyntax\n    [DataRow(\"\"\"void M(object o) { _ = $$(Object)o$$; }\"\"\", \"Object\")]                                // CastExpressionSyntax\n    [DataRow(\"\"\"void M() { _ = $$typeof(Object)$$; }\"\"\", \"Object\")]                                   // TypeOfExpressionSyntax\n    [DataRow(\"\"\"void M() { _ = $$default(Object)$$; }\"\"\", \"Object\")]                                  // DefaultExpressionSyntax\n    [DataRow(\"\"\"void M() { _ = $$sizeof(int)$$; }\"\"\", \"int\")]                                         // SizeOfExpressionSyntax\n    [DataRow(\"\"\"void M() { int* _ = $$stackalloc int[1]$$; }\"\"\", \"int[1]\")]                           // StackAllocArrayCreationExpressionSyntax\n    [DataRow(\"\"\"void M() { Object o = null; TypedReference tr = __makeref(o); _ = $$__refvalue(tr, Object)$$; }\"\"\", \"Object\")]  // RefValueExpressionSyntax\n    [DataRow(\"\"\"void M(object o) { _ = $$o is Object$$; }\"\"\", \"Object\")]                              // BinaryExpressionSyntax IsExpression — type check\n    [DataRow(\"\"\"void M(object o) { _ = $$o is 1$$; }\"\"\", null)]                                       // BinaryExpressionSyntax IsExpression — constant (not TypeSyntax)\n    [DataRow(\"\"\"void M(object o) { _ = $$o as Object$$; }\"\"\", \"Object\")]                              // BinaryExpressionSyntax AsExpression\n    [DataRow(\"\"\"class Inner : $$IDisposable$$ { public void Dispose() { } }\"\"\", \"IDisposable\")]       // BaseTypeSyntax (SimpleBaseTypeSyntax)\n    [DataRow(\"\"\"void M<T>() where T : $$IComparable$$ { }\"\"\", \"IComparable\")]                         // TypeConstraintSyntax\n    [DataRow(\"\"\"void M() { $$Object Local() => null;$$ }\"\"\", \"Object\")]                               // LocalFunctionStatementSyntax\n    [DataRow(\"\"\"void M(object o) { if (o is $$Object x$$) { } }\"\"\", \"Object\")]                        // DeclarationPatternSyntax\n    [DataRow(\"\"\"void M(object o) { _ = o is $$Object { }$$; }\"\"\", \"Object\")]                          // RecursivePatternSyntax\n    [DataRow(\"\"\"void M(object o) { _ = o switch { $$int$$ => 1, _ => 0 }; }\"\"\", \"int\")]               // TypePatternSyntax\n    [DataRow(\"\"\"($$Object x$$, int y) M() => default;\"\"\", \"Object\")]                                  // TupleElement\n    [DataRow(\"\"\"void M(ref Object p) { $$ref Object$$ x = ref p; }\"\"\", \"Object\")]                     // RefTypeSyntax\n    [DataRow(\"\"\"void M() { _ = int.TryParse(\"1\", out $$int result$$); }\"\"\", \"int\")]                   // DeclarationExpression\n    [DataRow(\"\"\"unsafe void M() { delegate*<$$Object$$, void> _ = null; }\"\"\", \"Object\")]              // FunctionPointerParameter\n    [DataRow(\"\"\"void M(ref Object p) { $$scoped ref Object$$ x = ref p; }\"\"\", \"ref Object\")]          // ScopedType\n    [DataRow(\"\"\"[$$Obsolete(\"msg\")$$] void M2() { }\"\"\", \"Obsolete\")]                                    // AttributeSyntax\n    [DataRow(\"\"\"$$Object$$ field;\"\"\", \"Object\")]                                                      // TypeSyntax itself — identity\n    [DataRow(\"\"\"$$Test() { }$$\"\"\", null)]                                                             // ConstructorDeclarationSyntax — no type\n    [DataRow(\"\"\"$$~Test() { }$$\"\"\", null)]                                                            // DestructorDeclarationSyntax — no type\n    public void TypeSyntax_Members(string member, string expected)\n    {\n        var node = TestCompiler.NodeBetweenMarkersCS($$\"\"\"\n            using System;\n            using System.Collections.Generic;\n            using System.Linq;\n            unsafe class Test\n            {\n                public Test(int i) { }\n                {{member}}\n            }\n            \"\"\").Node;\n        var actual = node.TypeSyntax();\n        if (expected is null)\n        {\n            actual.Should().BeNull();\n        }\n        else\n        {\n            actual.Should().NotBeNull();\n            actual.ToString().Should().Be(expected);\n        }\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"$$using System.IO;$$\"\"\", \"System.IO\")]                    // regular namespace import\n    [DataRow(\"\"\"$$using IO = System.IO;$$\"\"\", \"System.IO\")]               // alias\n    public void TypeSyntax_UsingDirective(string snippet, string expected)\n    {\n        var node = TestCompiler.NodeBetweenMarkersCS($$\"\"\"\n            {{snippet}}\n            class Test { }\n            \"\"\").Node;\n        node.TypeSyntax().ToString().Should().Be(expected);\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"$$namespace A.B.C { }$$\"\"\", \"C\")]           // NamespaceDeclarationSyntax\n    [DataRow(\"\"\"$$namespace A.B.C;$$\"\"\", \"C\")]              // FileScopedNamespaceDeclarationSyntax\n    [DataRow(\"\"\"$$using A = System.Collections;$$\"\"\", \"A\")] // UsingDirectiveSyntax\n    [DataRow(\"\"\"$$using System.Collections;$$\"\"\", null)]    // UsingDirectiveSyntax\n    public void GetIdentifier_CompilationUnit(string member, string expected)\n    {\n        var node = TestCompiler.NodeBetweenMarkersCS($$\"\"\"\n            {{member}}\n            \"\"\").Node;\n        var actual = SyntaxNodeExtensionsCSharp.GetIdentifier(node);\n        if (expected is null)\n        {\n            actual.Should().BeNull();\n        }\n        else\n        {\n            actual.Should().NotBeNull();\n            actual.Value.ValueText.Should().Be(expected);\n        }\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\" : $$Base(i)$$\"\"\", \"Base\")]       // NamespaceDeclarationSyntax\n    [DataRow(\"\"\" : $$Test.Base(i)$$\"\"\", \"Base\")]  // NamespaceDeclarationSyntax\n    public void GetIdentifier_PrimaryConstructor(string baseType, string expected)\n    {\n        var node = TestCompiler.NodeBetweenMarkersCS($$\"\"\"\n            namespace Test;\n            public class Base(int i)\n            {\n            }\n            public class Derived(int i) {{baseType}} { }\n            \"\"\").Node;\n        var actual = SyntaxNodeExtensionsCSharp.GetIdentifier(node);\n        if (expected is null)\n        {\n            actual.Should().BeNull();\n        }\n        else\n        {\n            actual.Should().NotBeNull();\n            actual.Value.ValueText.Should().Be(expected);\n        }\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"event EventHandler SomeEvent { add { $$int x = 42;$$ } remove { int x = 42; } }\"\"\", SyntaxKind.AddAccessorDeclaration)]\n    [DataRow(\"\"\"int Method() { Func<int, int, int> add = delegate (int a, int b) { return $$a + b$$; }; return add(1, 2); }\"\"\", SyntaxKind.AnonymousMethodExpression)]\n    [DataRow(\"\"\"Derived(int arg) : base($$arg$$) { }\"\"\", SyntaxKind.BaseConstructorInitializer)]\n    [DataRow(\"\"\"Derived() { $$var x = 42;$$ }\"\"\", SyntaxKind.ConstructorDeclaration)]\n    [DataRow(\"\"\"public static implicit operator int(Derived d) => $$42$$;\"\"\", SyntaxKind.ConversionOperatorDeclaration)]\n    [DataRow(\"\"\"~Derived() { $$var x = 42;$$ }\"\"\", SyntaxKind.DestructorDeclaration)]\n    [DataRow(\"\"\"int field = $$int.Parse(\"42\")$$;\"\"\", SyntaxKind.FieldDeclaration)]\n    [DataRow(\"\"\"int Property { get; set; } = $$int.Parse(\"42\")$$;\"\"\", SyntaxKind.PropertyDeclaration)]\n    [DataRow(\"\"\"int Property { set { $$_ = value;$$ } }\"\"\", SyntaxKind.SetAccessorDeclaration)]\n    [DataRow(\"\"\"int Property { set { $$_ = value;$$ } }\"\"\", SyntaxKind.SetAccessorDeclaration)]\n    [DataRow(\"\"\"int Method() { return LocalFunction(); int LocalFunction() { $$return 42;$$ } }\"\"\", SyntaxKindEx.LocalFunctionStatement)]\n    [DataRow(\"\"\"int Method() { return LocalFunction(); int LocalFunction() => $$42$$; }\"\"\", SyntaxKindEx.LocalFunctionStatement)]\n    [DataRow(\"\"\"int Method() { $$return 42;$$ }\"\"\", SyntaxKind.MethodDeclaration)]\n    [DataRow(\"\"\"int Method() => $$42$$;\"\"\", SyntaxKind.MethodDeclaration)]\n    [DataRow(\"\"\"public static Derived operator +(Derived d) => $$d$$;\"\"\", SyntaxKind.OperatorDeclaration)]\n    [DataRow(\"\"\"int Method() { var lambda = () => $$42$$; return lambda(); }\"\"\", SyntaxKind.ParenthesizedLambdaExpression)]\n    [DataRow(\"\"\"int Method() { Func<int, int> lambda = x => $$x + 1$$; return lambda(42); }\"\"\", SyntaxKind.SimpleLambdaExpression)]\n    [DataRow(\"\"\"event EventHandler SomeEvent { add { int x = 42; } remove { $$int x = 42;$$ } }\"\"\", SyntaxKind.RemoveAccessorDeclaration)]\n    [DataRow(\"\"\"Derived(int arg) : this($$arg.ToString()$$) { }\"\"\", SyntaxKind.ThisConstructorInitializer)]\n    [DataRow(\"\"\"enum E { A = $$1$$ }\"\"\", SyntaxKind.EnumMemberDeclaration)]\n    [DataRow(\"\"\"void M(int i = $$1$$) { }\"\"\", SyntaxKind.Parameter)]\n#if NET\n    [DataRow(\"\"\"int Property { init { $$_ = value;$$ } }\"\"\", SyntaxKindEx.InitAccessorDeclaration)]\n    [DataRow(\"\"\"record BaseRec(int I); record DerivedRec(int I): BaseRec($$I++$$);\"\"\", SyntaxKindEx.PrimaryConstructorBaseType)]\n#endif\n    public void EnclosingScope_Members(string member, SyntaxKind expectedSyntaxKind)\n    {\n        var node = TestCompiler.NodeBetweenMarkersCS($$\"\"\"\n            using System;\n\n            public class Base\n            {\n                public Base() { }\n                public Base(int arg) { }\n            }\n\n            public class Derived: Base\n            {\n                Derived(string arg) { }\n                {{member}}\n            }\n            \"\"\").Node;\n        var actual = SyntaxNodeExtensionsCSharp.EnclosingScope(node)?.Kind() ?? SyntaxKind.None;\n        actual.Should().Be(expectedSyntaxKind);\n    }\n\n    [TestMethod]\n    public void EnclosingScope_TopLevelStatements()\n    {\n        var node = TestCompiler.NodeBetweenMarkersCS($$\"\"\"\n            using System;\n\n            $$Console.WriteLine(\"\")$$;\n            \"\"\", outputKind: OutputKind.ConsoleApplication).Node;\n        var actual = SyntaxNodeExtensionsCSharp.EnclosingScope(node)?.Kind() ?? SyntaxKind.None;\n        actual.Should().Be(SyntaxKind.CompilationUnit);\n    }\n\n    [TestMethod]\n    [DataRow(\"from $$x$$ in qry select x\", SyntaxKind.MethodDeclaration)] // Wrong. Should be FromClause\n    [DataRow(\"from x in $$qry$$ select x\", SyntaxKind.MethodDeclaration)]\n    [DataRow(\"from x in qry from y in $$qry$$ select x\", SyntaxKind.MethodDeclaration)] // Wrong. Should be FromClause\n    [DataRow(\"from x in qry select $$x$$\", SyntaxKind.SelectClause)]\n    [DataRow(\"from x in qry orderby $$x$$ select x\", SyntaxKind.OrderByClause)]\n    [DataRow(\"from x in qry where x == $$string.Empty$$ select x\", SyntaxKind.WhereClause)]\n    [DataRow(\"from x in qry let y = $$x$$ select y\", SyntaxKind.LetClause)]\n    [DataRow(\"from x in qry join y in qry on $$x$$ equals y select x\", SyntaxKind.JoinClause)]\n    [DataRow(\"from x in qry join y in qry on x equals $$y$$ select x\", SyntaxKind.JoinClause)]\n    [DataRow(\"from x in qry join y in $$qry$$ on x equals y select x\", SyntaxKind.JoinClause)] // Wrong. Should be MethodDeclaration\n    [DataRow(\"from x in qry group x by $$x$$ into g select g\", SyntaxKind.GroupClause)]\n    [DataRow(\"from x in qry group $$x$$ by x into g select g\", SyntaxKind.GroupClause)] // Wrong. Should be the FromClause\n    [DataRow(\"from x in qry group x by x into $$g$$ select g\", SyntaxKind.QueryContinuation)]\n    [DataRow(\"from x in qry select x into $$y$$ select y\", SyntaxKind.QueryContinuation)]\n    public void EnclosingScope_QueryExpressionSyntax(string qry, SyntaxKind expected)\n    {\n        var node = TestCompiler.NodeBetweenMarkersCS($$\"\"\"\n            using System;\n            using System.Linq;\n\n            class Test\n            {\n                public void Query(string[] qry)\n                {\n                    _ = {{qry}};\n                }\n            }\n            \"\"\").Node;\n        var actual = SyntaxNodeExtensionsCSharp.EnclosingScope(node)?.Kind();\n        actual.Should().Be(expected);\n    }\n\n    [TestMethod]\n    public void Symbol_IsKnownType()\n    {\n        var snippet = new SnippetCompiler(\"\"\"\n            using System.Collections.Generic;\n            public class Sample\n            {\n                public void Method<T, V>(List<T> param1, List<int> param2, List<V> param3, IList<int> param4) { }\n            }\n            \"\"\");\n        var method = (MethodDeclarationSyntax)snippet.MethodDeclaration(\"Sample.Method\");\n        ExtensionsCore.IsKnownType(method.ParameterList.Parameters[0].Type, KnownType.System_Collections_Generic_List_T, snippet.Model).Should().BeTrue();\n        ExtensionsCore.IsKnownType(method.ParameterList.Parameters[1].Type, KnownType.System_Collections_Generic_List_T, snippet.Model).Should().BeTrue();\n        ExtensionsCore.IsKnownType(method.ParameterList.Parameters[2].Type, KnownType.System_Collections_Generic_List_T, snippet.Model).Should().BeTrue();\n        ExtensionsCore.IsKnownType(method.ParameterList.Parameters[3].Type, KnownType.System_Collections_Generic_List_T, snippet.Model).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void ToSecondaryLocation_NullMessage()\n    {\n        var code = \"public class $$C$$ {}\";\n        var node = TestCompiler.NodeBetweenMarkersCS(code).Node;\n        var secondaryLocation = node.ToSecondaryLocation(null);\n        secondaryLocation.Should().NotBeNull();\n        secondaryLocation.Location.Should().Be(node.GetLocation());\n        secondaryLocation.Message.Should().BeNull();\n    }\n\n    [TestMethod]\n    [DataRow(null)]\n    [DataRow([])]\n    public void ToSecondaryLocation_MessageArgs(string[] messageArgs)\n    {\n        var code = \"public class $$C$$ {}\";\n        var node = TestCompiler.NodeBetweenMarkersCS(code).Node;\n        var secondaryLocation = node.ToSecondaryLocation(\"Message\", messageArgs);\n        secondaryLocation.Should().NotBeNull();\n        secondaryLocation.Location.Should().Be(node.GetLocation());\n        secondaryLocation.Message.Should().Be(\"Message\");\n    }\n\n    [TestMethod]\n    [DataRow(\"Message {0}\", \"42\")]\n    [DataRow(\"{1} Message {0} \", \"42\", \"21\")]\n    public void ToSecondaryLocation_MessageFormat(string format, params string[] messageArgs)\n    {\n        var code = \"public class $$C$$ {}\";\n        var node = TestCompiler.NodeBetweenMarkersCS(code).Node;\n        var secondaryLocation = node.ToSecondaryLocation(format, messageArgs);\n        secondaryLocation.Should().NotBeNull();\n        secondaryLocation.Location.Should().Be(node.GetLocation());\n        secondaryLocation.Message.Should().Be(string.Format(format, messageArgs));\n    }\n\n    [TestMethod]\n    [DataRow(\"public void M() { _ = $$42$$; }\")]\n    [DataRow(\"public void M() { int Local() => $$42$$; }\")]\n    [DataRow(\"public void M() { Func<int> _ = () => $$42$$; }\")]\n    [DataRow(\"public string P { get { $$return P$$; } }\")]\n    [DataRow(\"public C() { _ = $$42$$; }\")]\n    [DataRow(\"private readonly int f = $$42$$;\")]\n    public void PerformanceSensitiveAttribute(string node)\n    {\n        var code = $$\"\"\"\n            using System;\n\n            [AttributeUsage(AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = true, Inherited = false)]\n            public sealed class PerformanceSensitiveAttribute(): Attribute;\n\n            public class C\n            {\n                [PerformanceSensitive]\n                {{node}}\n            }\n            \"\"\";\n        var nodeAndModel = TestCompiler.NodeBetweenMarkersCS(code);\n        nodeAndModel.Node.PerformanceSensitiveAttribute(nodeAndModel.Model).Should().NotBeNull();\n    }\n\n    [TestMethod]\n    public void PerformanceSensitiveAttribute_NullNode() =>\n        SyntaxNodeExtensionsCSharp.PerformanceSensitiveAttribute(null, null).Should().BeNull();\n\n    [TestMethod]\n    [DataRow(\"Func<int> f = [PerformanceSensitive] () => $$42$$;\")]\n    [DataRow(\"[PerformanceSensitive] int Local() => $$42$$;\")]\n    [DataRow(\"LM([PerformanceSensitive] () => $$42$$); int LM(Func<int> f) => f();\")]\n    public void PerformanceSensitiveAttribute_AnonymousAndLocalMethods(string node)\n    {\n        var code = $$\"\"\"\n            using System;\n\n            [AttributeUsage(AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = true, Inherited = false)]\n            public sealed class PerformanceSensitiveAttribute(): Attribute;\n\n            public class C\n            {\n                public void M()\n                {\n                    {{node}}\n                }\n            }\n            \"\"\";\n        var nodeAndModel = TestCompiler.NodeBetweenMarkersCS(code);\n        nodeAndModel.Node.PerformanceSensitiveAttribute(nodeAndModel.Model).Should().NotBeNull();\n    }\n\n    [TestMethod]\n    [DataRow(\"class Inner { public void M() { _ = $$42$$; } }\")]\n    [DataRow(\"interface Inner { void $$M$$(); }\")]\n    [DataRow(\"struct Inner { public void M() { _ = $$42$$; } }\")]\n    [DataRow(\"enum Inner { Value = $$1$$ }\")]\n    [DataRow(\"public event System.Action E = $$null$$;\")]\n    [DataRow(\"public delegate void MyDelegate(int $$param$$);\")]\n    public void PerformanceSensitiveAttribute_InvalidAttributeTarget(string node)\n    {\n        var code = $$\"\"\"\n            [System.AttributeUsage(System.AttributeTargets.All, AllowMultiple = true, Inherited = false)]\n            public sealed class PerformanceSensitiveAttribute(): System.Attribute;\n\n            public class C\n            {\n                [PerformanceSensitive]\n                {{node}}\n            }\n            \"\"\";\n        var nodeAndModel = TestCompiler.NodeBetweenMarkersCS(code);\n        nodeAndModel.Node.PerformanceSensitiveAttribute(nodeAndModel.Model).Should().BeNull();\n    }\n\n    [TestMethod]\n    [DataRow(\"Func<int, int> f = [PerformanceSensitive] x => $$x$$;\")] // error CS8916: Attributes on lambda expressions require a parenthesized parameter list.\n    [DataRow(\"Func<int, int> f = [PerformanceSensitive] delegate(int x) { return $$x$$; };\")]\n    public void PerformanceSensitiveAttribute_DoNotCompile(string node)\n    {\n        var code = $$\"\"\"\n            using System;\n\n            [AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = false)]\n            public sealed class PerformanceSensitiveAttribute(): Attribute;\n\n            public class C\n            {\n                public void M()\n                {\n                    {{node}}\n                }\n            }\n            \"\"\";\n        Action action = () => TestCompiler.NodeBetweenMarkersCS(code);\n        action.Should().Throw<InvalidOperationException>().WithMessage(\"Test setup error: test code snippet did not compile. See output window for details.\");\n    }\n\n    [TestMethod]\n    [DataRow(\"public void M() { _ = $$42$$; }\")]\n    [DataRow(\"[Some] public void M() { Func<int> f = () => $$42$$; }\")]\n    [DataRow(\"public void M() { int Local() => $$42$$; }\")]\n    [DataRow(\"public void M() { LM([Some] () => $$42$$); int LM(Func<int> f) => f(); }\")]\n    [DataRow(\"public string P { get { return $$P$$; } }\")]\n    [DataRow(\"public C() { _ = $$42$$; }\")]\n    [DataRow(\"private readonly int f = $$42$$;\")]\n    public void PerformanceSensitiveAttribute_NoPerformanceSensitiveAttribute(string node)\n    {\n        var code = $$\"\"\"\n            using System;\n\n            [AttributeUsage(AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = true, Inherited = false)]\n            public sealed class SomeAttribute(): Attribute;\n\n            public class C\n            {\n                {{node}}\n            }\n            \"\"\";\n        var nodeAndModel = TestCompiler.NodeBetweenMarkersCS(code);\n        nodeAndModel.Node.PerformanceSensitiveAttribute(nodeAndModel.Model).Should().BeNull();\n    }\n\n    private static SyntaxToken GetFirstTokenOfKind(SyntaxTree tree, SyntaxKind kind) =>\n        tree.GetRoot().DescendantTokens().First(x => x.IsKind(kind));\n\n    private static SyntaxTree GetSyntaxTree(string content, string fileName = null) =>\n        SolutionBuilder\n            .Create()\n            .AddProject(AnalyzerLanguage.CSharp)\n            .AddSnippet(content, fileName)\n            .GetCompilation()\n            .SyntaxTrees\n            .First();\n\n    private static ControlFlowGraph CreateCfgCS<T>(string code) where T : CSharpSyntaxNode\n    {\n        var (tree, model) = TestCompiler.CompileCS(code);\n        return SyntaxNodeExtensionsCSharp.CreateCfg(tree.Single<T>(), model, default);\n    }\n\n    private static ControlFlowGraph CreateCfgVB<T>(string code) where T : Microsoft.CodeAnalysis.VisualBasic.VisualBasicSyntaxNode\n    {\n        var (tree, model) = TestCompiler.CompileVB(code);\n        return SyntaxNodeExtensionsVisualBasic.CreateCfg(tree.Single<T>(), model, default);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Extensions/SyntaxTokenExtensionsSharedTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing static SonarAnalyzer.CSharp.Core.Syntax.Extensions.SyntaxTokenExtensionsShared;\n\nnamespace SonarAnalyzer.Test.Extensions;\n\n[TestClass]\npublic class SyntaxTokenExtensionsSharedTest\n{\n    [TestMethod]\n    public void GetBindableParent_ForEmptyToken_ReturnsNull()\n    {\n        SyntaxToken empty = default;\n\n        empty.GetBindableParent().Should().BeNull();\n    }\n\n    [TestMethod]\n    public void GetBindableParent_ForInterpolatedStringTextTokenInInterpolatedStringTextToken_ReturnsInterpolatedStringExpression()\n    {\n        const string code = @\"string x = $\"\"a\"\";\";\n\n        var syntaxTree = CSharpSyntaxTree.ParseText(code);\n        var aToken = GetFirstTokenOfKind(syntaxTree, SyntaxKind.InterpolatedStringTextToken);\n\n        var parent = aToken.GetBindableParent();\n        parent.Kind().Should().Be(SyntaxKind.InterpolatedStringExpression);\n    }\n\n    [TestMethod]\n    public void GetBindableParent_ForOpenBraceInsideInterpolatedStringTextToken_ReturnsInterpolation()\n    {\n        const string code = @\"string x = $\"\"{1}\"\";\";\n\n        var syntaxTree = CSharpSyntaxTree.ParseText(code);\n        var aToken = GetFirstTokenOfKind(syntaxTree, SyntaxKind.OpenBraceToken);\n\n        var parent = aToken.GetBindableParent();\n        parent.Kind().Should().Be(SyntaxKind.Interpolation);\n    }\n\n    [TestMethod]\n    public void GetBindableParent_ForMemberAccessExpressionSyntax_ReturnsTheExpression()\n    {\n        const string code = @\"this.Value;\";\n\n        var syntaxTree = CSharpSyntaxTree.ParseText(code);\n        var thisToken = GetFirstTokenOfKind(syntaxTree, SyntaxKind.ThisKeyword);\n\n        var parent = thisToken.GetBindableParent();\n        parent.Kind().Should().Be(SyntaxKind.ThisExpression);\n    }\n\n    [TestMethod]\n    public void GetBindableParent_ForObjectCreationExpressionSyntax_ReturnsArgumentList()\n    {\n        const string code = @\"var s = new string();\";\n\n        var syntaxTree = CSharpSyntaxTree.ParseText(code);\n        var openParentToken = GetFirstTokenOfKind(syntaxTree, SyntaxKind.OpenParenToken);\n\n        var parent = openParentToken.GetBindableParent();\n        parent.Kind().Should().Be(SyntaxKind.ArgumentList);\n    }\n\n    private static SyntaxToken GetFirstTokenOfKind(SyntaxTree syntaxTree, SyntaxKind kind) =>\n        syntaxTree.GetRoot().DescendantTokens().First(token => token.IsKind(kind));\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/LiveVariableAnalysis/RoslynLiveVariableAnalysisTest.FlowCaptureOperation.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Test.LiveVariableAnalysis;\n\npublic partial class RoslynLiveVariableAnalysisTest\n{\n    [TestMethod]\n    public void FlowCaptrure_NullCoalescingAssignment()\n    {\n        /*      Block 1\n        *      #0=param\n        *          |\n        *       Block 2\n        *        #1=#0\n        *      #1 is null --+\n        *          |        |\n        *       Block 3     |\n        *       #0=Hello    |\n        *          |        |\n        *        Exit <-----+\n        */\n        const string code = \"\"\"param ??= \"Hello\";\"\"\";\n        var context = CreateContextCS(code, additionalParameters: \"string param\");\n        context.ValidateEntry(LiveIn(\"param\"), LiveOut(\"param\"));\n        context.Validate(context.Cfg.Blocks[1], LiveIn(\"param\"), LiveOut(\"param\"));\n        context.Validate(context.Cfg.Blocks[2], LiveIn(\"param\"));\n        context.Validate(context.Cfg.Blocks[3]);\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void FlowCaptrure_NullCoalescingOperator()\n    {\n        /*       Block 1\n         *      #0=param\n         *     #0 is null\n         *        /   \\\n         *       F     T\n         *      /       \\\n         *  Block 2    Block 3\n         *  #1=#0     #1=\"Hello\"\n         *       \\     /\n         *       Block 4\n         *      result=#1\n         *         |\n         *        Exit\n         */\n        const string code = \"\"\"var result = param ?? \"Hello\";\"\"\";\n        var context = CreateContextCS(code, additionalParameters: \"string param\");\n        context.ValidateEntry(LiveIn(\"param\"), LiveOut(\"param\"));\n        context.Validate(context.Cfg.Blocks[1], LiveIn(\"param\"), LiveOut(\"param\"));\n        context.Validate(context.Cfg.Blocks[2], LiveIn(\"param\"), LiveOut(\"param\"));\n        context.Validate(context.Cfg.Blocks[3], LiveIn(\"param\"), LiveOut(\"param\"));\n        context.Validate(context.Cfg.Blocks[4], LiveIn(\"param\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void FlowCaptrure_ConditionalAccess()\n    {\n        /*       Block 1\n         *      #1=param\n         *     #1 is null\n         *        /   \\\n         *       F     T\n         *      /       \\\n         *  Block 2    Block 3\n         * #0=#1.Length  #0=default\n         *      \\        /\n         *        Block 4\n         *       result=#1\n         *          |\n         *         Exit\n         */\n        const string code = \"\"\"var result = param?.Length;\"\"\";\n        var context = CreateContextCS(code, additionalParameters: \"string param\");\n        context.ValidateEntry(LiveIn(\"param\"), LiveOut(\"param\"));\n        context.Validate(context.Cfg.Blocks[1], LiveIn(\"param\"), LiveOut(\"param\"));\n        context.Validate(context.Cfg.Blocks[2], LiveIn(\"param\"));\n        context.Validate(context.Cfg.Blocks[3]);\n        context.Validate(context.Cfg.Blocks[4]);\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void FlowCaptrure_Ternary()\n    {\n        /*         Block 1\n         *       boolParameter\n         *        /       \\\n         *       F         T\n         *      /           \\\n         *     /             \\\n         *   Block 2        Block 3\n         * #0=StringParam   #0=\"Hello\"\n         *         |             |\n         *      Block 4 <--------+\n         *     result=#0\n         *         |\n         *       Exit\n         */\n        const string code = \"\"\"var result = boolParameter ? stringParam : \"Hello\";\"\"\";\n        var context = CreateContextCS(code, additionalParameters: \"string stringParam\");\n        context.ValidateEntry(LiveIn(\"boolParameter\", \"stringParam\"), LiveOut(\"boolParameter\", \"stringParam\"));\n        context.Validate(context.Cfg.Blocks[1], LiveIn(\"boolParameter\", \"stringParam\"), LiveOut(\"stringParam\"));\n        context.Validate(context.Cfg.Blocks[2], LiveIn(\"stringParam\"), LiveOut(\"stringParam\"));\n        context.Validate(context.Cfg.Blocks[3], LiveIn(\"stringParam\"), LiveOut(\"stringParam\"));\n        context.Validate(context.Cfg.Blocks[4], LiveIn(\"stringParam\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void FlowCaptrure_ReuseCaptures()\n    {\n        /*       Block 1\n         *     boolParameter\n         *       /       \\\n         *      F         T\n         *     /           \\\n         *   Block 2     Block 3\n         *   #0=st     #0=\"Hello\"\n         *       \\     /\n         *        Block 4\n         *       result1=#0\n         *          |\n         *        Block5\n         *     boolParameter\n         *        /    \\\n         *       F      T\n         *      /        \\\n         *  Block 6    Block 7\n         *   #1=st2   #1=\"Hello\"\n         *       \\     /\n         *       Block 8\n         *      result2=#1\n         *         |\n         *        Exit\n         */\n        const string code = \"\"\"\n            var result1 = boolParameter ? s1 : \"Hello\";\n            var result2 = boolParameter ? s2 : \"Hi\";\n            \"\"\";\n        var context = CreateContextCS(code, additionalParameters: \"string s1, string s2\");\n        context.ValidateEntry(LiveIn(\"boolParameter\", \"s1\", \"s2\"), LiveOut(\"boolParameter\", \"s1\", \"s2\"));\n        context.Validate(context.Cfg.Blocks[1], LiveIn(\"boolParameter\", \"s1\", \"s2\"), LiveOut(\"boolParameter\", \"s1\", \"s2\"));\n        context.Validate(context.Cfg.Blocks[2], LiveIn(\"boolParameter\", \"s1\", \"s2\"), LiveOut(\"boolParameter\", \"s1\", \"s2\"));\n        context.Validate(context.Cfg.Blocks[3], LiveIn(\"boolParameter\", \"s1\", \"s2\"), LiveOut(\"boolParameter\", \"s1\", \"s2\"));\n        context.Validate(context.Cfg.Blocks[4], LiveIn(\"boolParameter\", \"s1\", \"s2\"), LiveOut(\"boolParameter\", \"s2\"));\n        context.Validate(context.Cfg.Blocks[5], LiveIn(\"boolParameter\", \"s2\"), LiveOut(\"s2\"));\n        context.Validate(context.Cfg.Blocks[6], LiveIn(\"s2\"), LiveOut(\"s2\"));\n        context.Validate(context.Cfg.Blocks[7], LiveIn(\"s2\"), LiveOut(\"s2\"));\n        context.Validate(context.Cfg.Blocks[8], LiveIn(\"s2\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void FlowCaptrure_NullCoalescingOperator_ConsequentCalls()\n    {\n        /*       Block 1\n         *       #0=s1\n         *     #0 is null\n         *      /       \\\n         *     F         T\n         *    /           \\\n         *   /             \\\n         * Block 2      Block 3\n         * #1=#0         #2=s2\n         *   |        #2 is null\n         *   |          /     \\\n         *   |         F       T\n         *   |        /         \\\n         *   |      Block 4    Block 5\n         *   |     #1=#2     #1=\"Hello\"\n         *   |       |___________|\n         *   |             |\n         *   |             |\n         *   +--------->Block 6\n         *             result=#1\n         *                |\n         *               Exit\n         */\n        const string code = \"\"\"var result = s1 ?? s2 ?? \"Hello\";\"\"\";\n        var context = CreateContextCS(code, additionalParameters: \"string s1, string s2\");\n        context.ValidateEntry(LiveIn(\"s1\", \"s2\"), LiveOut(\"s1\", \"s2\"));\n        context.Validate(context.Cfg.Blocks[1], LiveIn(\"s1\", \"s2\"), LiveOut(\"s1\", \"s2\"));\n        context.Validate(context.Cfg.Blocks[2], LiveIn(\"s1\", \"s2\"), LiveOut(\"s1\", \"s2\"));\n        context.Validate(context.Cfg.Blocks[3], LiveIn(\"s1\", \"s2\"), LiveOut(\"s1\", \"s2\"));\n        context.Validate(context.Cfg.Blocks[4], LiveIn(\"s1\", \"s2\"), LiveOut(\"s1\", \"s2\"));\n        context.Validate(context.Cfg.Blocks[5], LiveIn(\"s1\", \"s2\"), LiveOut(\"s1\", \"s2\"));\n        context.Validate(context.Cfg.Blocks[6], LiveIn(\"s1\", \"s2\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void FlowCaptrure_NullCoalescingOperator_ConsequentCalls_Assignment()\n    {\n        const string code = \"\"\"var result = s1 ??= s2 = s3 ??= s4 ?? \"End\";\"\"\";\n        var context = CreateContextCS(code, additionalParameters: \"string s1, string s2, string s3, string s4\");\n        context.ValidateEntry(LiveIn(\"s1\", \"s3\", \"s4\"), LiveOut(\"s1\", \"s3\", \"s4\"));\n        context.Validate(context.Cfg.Blocks[1], LiveIn(\"s1\", \"s3\", \"s4\"), LiveOut(\"s1\", \"s3\", \"s4\"));   // 1: #0=s1\n        context.Validate(context.Cfg.Blocks[2], LiveIn(\"s1\", \"s3\", \"s4\"), LiveOut(\"s1\", \"s3\", \"s4\"));   // 2: #1=#0; if #1 is null\n        context.Validate(context.Cfg.Blocks[3], LiveIn(\"s1\"), LiveOut(\"s1\"));                           // 3: F: #2=#1\n        context.Validate(context.Cfg.Blocks[4], LiveIn(\"s3\", \"s4\"), LiveOut(\"s3\", \"s4\"));               // 4: T: #3=s2\n        context.Validate(context.Cfg.Blocks[5], LiveIn(\"s3\", \"s4\"), LiveOut(\"s3\", \"s4\"));               // 5: #4=s3\n        context.Validate(context.Cfg.Blocks[6], LiveIn(\"s3\", \"s4\"), LiveOut(\"s3\", \"s4\"));               // 6: #5=#4; if #5 is null\n        context.Validate(context.Cfg.Blocks[7], LiveIn(\"s3\"), LiveOut(\"s3\"));                           // 7: F: #6=#5\n        context.Validate(context.Cfg.Blocks[8], LiveIn(\"s4\"), LiveOut(\"s4\"));                           // 8: T: #7=s4; if #7 is null\n        context.Validate(context.Cfg.Blocks[9], LiveIn(\"s4\"), LiveOut(\"s4\"));                           // 9: F: #8=#7\n        context.Validate(context.Cfg.Blocks[10], LiveIn(\"s4\"), LiveOut(\"s4\"));                          // 10: #7=null; #8=\"End\"\n        context.Validate(context.Cfg.Blocks[11], LiveIn(\"s4\"), LiveOut(\"s3\"));                          // 11: #6= (#4=#8)\n        context.Validate(context.Cfg.Blocks[12], LiveIn(\"s3\"), LiveOut(\"s1\"));                          // 12: #2= (#0 = (#3=#6) )\n        context.Validate(context.Cfg.Blocks[13], LiveIn(\"s1\"));                                         // 13: result=#2\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void FlowCaptrure_NullCoalescingOperator_Nested()\n    {\n        /*       Block 1\n         *       #0=s1\n         *     #0 is null\n         *      /       \\\n         *     F         T\n         *    /           \\\n         *   /             \\\n         * Block 2     Block 3\n         * #1=#0     s2 is null\n         *   |         /   \\\n         *   |        T     F\n         *   |       /       \\\n         *   |   Block 4    Block 5\n         *   |    #2=s3    #2=\"NestedFalse\"\n         *   |      |___________|\n         *   |            |\n         *   |            |\n         *   |        Block 6\n         *   |        #2 is null\n         *   |          /   \\\n         *   |         F     T\n         *   |        /       \\\n         *   |     Block7   Block 8\n         *   |     #1=#2    #1=\"Hello\"\n         *   |       |___________|\n         *   |             |\n         *   +---------->Block 9\n         *              result=#1\n         *                 |\n         *                Exit\n         */\n        const string code = \"\"\"var result = s1 ?? (s2 is null ? s3 : \"NestedFalse\") ?? \"Hello\";\"\"\";\n        var context = CreateContextCS(code, additionalParameters: \"string s1, string s2, string s3\");\n        context.ValidateEntry(LiveIn(\"s1\", \"s2\", \"s3\"), LiveOut(\"s1\", \"s2\", \"s3\"));\n        context.Validate(context.Cfg.Blocks[1], LiveIn(\"s1\", \"s2\", \"s3\"), LiveOut(\"s1\", \"s2\", \"s3\"));\n        context.Validate(context.Cfg.Blocks[2], LiveIn(\"s1\", \"s3\"), LiveOut(\"s1\", \"s3\"));\n        context.Validate(context.Cfg.Blocks[3], LiveIn(\"s1\", \"s2\", \"s3\"), LiveOut(\"s1\", \"s3\"));\n        context.Validate(context.Cfg.Blocks[4], LiveIn(\"s1\", \"s3\"), LiveOut(\"s1\", \"s3\"));\n        context.Validate(context.Cfg.Blocks[5], LiveIn(\"s1\", \"s3\"), LiveOut(\"s1\", \"s3\"));\n        context.Validate(context.Cfg.Blocks[6], LiveIn(\"s1\", \"s3\"), LiveOut(\"s1\", \"s3\"));\n        context.Validate(context.Cfg.Blocks[7], LiveIn(\"s1\", \"s3\"), LiveOut(\"s1\", \"s3\"));\n        context.Validate(context.Cfg.Blocks[8], LiveIn(\"s1\", \"s3\"), LiveOut(\"s1\", \"s3\"));\n        context.Validate(context.Cfg.Blocks[9], LiveIn(\"s1\", \"s3\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void FlowCaptrure_NullCoalescingOperator_Overwrite()\n    {\n        /*       Block 1\n         *       #0=s1\n         *         |\n         *       Block 2\n         *   #1=(s1=\"overwrite\")\n         *     #1 is null\n         *        /    \\\n         *       F      T\n         *      /        \\\n         *   Block3   Block4\n         *   #2=#1   #2=\"value\"\n         *    |___________|\n         *          |\n         *       Block5\n         *       s1=#2\n         */\n        const string code = \"\"\"s1 = (s1 = \"overwrite\") ?? \"value\";\"\"\";\n        var context = CreateContextCS(code, additionalParameters: \"string s1\");\n        // s1 is never read. The assignment returns its r-value, which is used for further calculation.\n        context.ValidateEntry();\n        context.Validate(context.Cfg.Blocks[1]);\n        context.Validate(context.Cfg.Blocks[2]);\n        context.Validate(context.Cfg.Blocks[3]);\n        context.Validate(context.Cfg.Blocks[4]);\n        context.Validate(context.Cfg.Blocks[5]);\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void FlowCaptrure_SwitchStatement()\n    {\n        const string code = \"\"\"\n            var result = i switch\n            {\n                0 =>  param,\n                1 => \"Something\",\n                _ => \"Everything\"\n            };\n            \"\"\";\n        var context = CreateContextCS(code, additionalParameters: \"int i, string param\");\n        context.ValidateEntry(LiveIn(\"i\", \"param\"), LiveOut(\"i\", \"param\"));\n        context.Validate(context.Cfg.Blocks[1], LiveIn(\"i\", \"param\"), LiveOut(\"i\", \"param\")); // #1 = i; if #1 == 0\n        context.Validate(context.Cfg.Blocks[2], LiveIn(\"param\"), LiveOut(\"param\"));           // #0 = param\n        context.Validate(context.Cfg.Blocks[3], LiveIn(\"i\", \"param\"), LiveOut(\"i\", \"param\")); // if #1 == 1\n        context.Validate(context.Cfg.Blocks[4], LiveIn(\"param\"), LiveOut(\"param\"));           // #0 = \"Something\"\n        context.Validate(context.Cfg.Blocks[5], LiveIn(\"i\", \"param\"), LiveOut(\"param\"));      // if discard\n        context.Validate(context.Cfg.Blocks[6], LiveIn(\"param\"), LiveOut(\"param\"));           // #0 = \"Everything\"\n        context.Validate(context.Cfg.Blocks[7]);                                              // else, unreachable, throws\n        context.Validate(context.Cfg.Blocks[8], LiveIn(\"param\"));                             // result = #0\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void FlowCaptrure_ForEachCompundAssignment()\n    {\n        const string code = \"\"\"\n            int sum = 0;\n            foreach (var i in array)\n            {\n                sum += i;\n            }\n            \"\"\";\n        var context = CreateContextCS(code, additionalParameters: \"int[] array\");\n        context.ValidateEntry(LiveIn(\"array\"), LiveOut(\"array\"));\n        context.Validate(context.Cfg.Blocks[1], LiveIn(\"array\"), LiveOut(\"array\", \"sum\")); // sum = 0\n        context.Validate(context.Cfg.Blocks[2], LiveIn(\"array\", \"sum\"), LiveOut(\"sum\"));   // #0 = array\n        context.Validate(context.Cfg.Blocks[3], LiveIn(\"sum\"), LiveOut(\"sum\"));            // If IEnumerator.MoveNext\n        context.Validate(context.Cfg.Blocks[4], LiveIn(\"sum\"), LiveOut(\"sum\"));            // sum += i\n        context.Validate(context.Cfg.Blocks[5]);                                           // Finally Region: #1=#0; if #1 is null, should have LiveIn/Liveout: array\n        context.Validate(context.Cfg.Blocks[6]);                                           // Finally Region: #1.Dispose, should have LiveIn: array\n        context.Validate(context.Cfg.Blocks[7]);                                           // Finally Region: Empty end of finally\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void FlowCaptrure_ImplicDictionaryCreation()\n    {\n        const string code = \"\"\"Dictionary<string, int> dict =  new() { [\"Key\"] = 0, [\"Lorem\"] = 1, [key] = value }; \"\"\";\n        var context = CreateContextCS(code, additionalParameters: \"string key, int value\");\n        context.ValidateEntry(LiveIn(\"key\", \"value\"), LiveOut(\"key\", \"value\"));\n        context.Validate(context.Cfg.Blocks[1], LiveIn(\"key\", \"value\"), LiveOut(\"key\", \"value\"));\n        context.Validate(context.Cfg.Blocks[2], LiveIn(\"key\", \"value\"), LiveOut(\"key\", \"value\"));\n        context.Validate(context.Cfg.Blocks[3], LiveIn(\"key\", \"value\"), LiveOut(\"key\", \"value\"));\n        context.Validate(context.Cfg.Blocks[4], LiveIn(\"key\", \"value\"));\n        context.Validate(context.Cfg.Blocks[5]);\n        context.ValidateExit();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/LiveVariableAnalysis/RoslynLiveVariableAnalysisTest.LocalFunction.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Test.LiveVariableAnalysis;\n\npublic partial class RoslynLiveVariableAnalysisTest\n{\n    [TestMethod]\n    public void StaticLocalFunction_Expression_LiveIn()\n    {\n        var code = \"\"\"\n            outParameter = LocalFunction(intParameter);\n            static int LocalFunction(int a) => a + 1;\n            \"\"\";\n        var context = CreateContextCS(code, \"LocalFunction\", \"out int outParameter\");\n        context.ValidateEntry(LiveIn(\"a\"), LiveOut(\"a\"));\n        context.Validate(\"a + 1\", LiveIn(\"a\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void StaticLocalFunction_Expression_NotLiveIn_NotLiveOut()\n    {\n        var code = \"\"\"\n            outParameter = LocalFunction(0);\n            static int LocalFunction(int a) => 42;\n            \"\"\";\n        var context = CreateContextCS(code, \"LocalFunction\", \"out int outParameter\");\n        context.ValidateEntry();\n        context.Validate(\"42\");\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void StaticLocalFunction_LiveIn()\n    {\n        var code = \"\"\"\n            outParameter = LocalFunction(intParameter);\n            static int LocalFunction(int a)\n            {\n                return a + 1;\n            }\n            \"\"\";\n        var context = CreateContextCS(code, \"LocalFunction\", \"out int outParameter\");\n        context.ValidateEntry(LiveIn(\"a\"), LiveOut(\"a\"));\n        context.Validate(\"a + 1\", LiveIn(\"a\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void StaticLocalFunction_NotLiveIn_NotLivOut()\n    {\n        var code = \"\"\"\n            outParameter = LocalFunction(0);\n            static int LocalFunction(int a)\n            {\n                return 42;\n            }\n            \"\"\";\n        var context = CreateContextCS(code, \"LocalFunction\", \"out int outParameter\");\n        context.ValidateEntry();\n        context.Validate(\"42\");\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void StaticLocalFunction_Recursive()\n    {\n        var code = \"\"\"\n            outParameter = LocalFunction(intParameter);\n            static int LocalFunction(int a)\n            {\n                if(a <= 0)\n                    return 0;\n                else\n                    return LocalFunction(a - 1);\n            };\n            \"\"\";\n        var context = CreateContextCS(code, \"LocalFunction\", \"out int outParameter\");\n        context.ValidateEntry(LiveIn(\"a\"), LiveOut(\"a\"));\n        context.Validate(\"0\");\n        context.Validate(\"LocalFunction(a - 1)\", LiveIn(\"a\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void LocalFunctionInvocation_LiveIn()\n    {\n        var code = \"\"\"\n            var variable = 42;\n            if (boolParameter)\n                return;\n            LocalFunction();\n\n            int LocalFunction() => variable;\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\"), LiveOut(\"boolParameter\"));\n        context.Validate(\"boolParameter\", LiveIn(\"boolParameter\"), LiveOut(\"variable\"));\n        context.Validate(\"LocalFunction();\", LiveIn(\"variable\"));\n    }\n\n    [TestMethod]\n    public void LocalFunctionInvocation_FunctionDeclaredBeforeCode_LiveIn()\n    {\n        var code = \"\"\"\n            var variable = 42;\n            int LocalFunction() => variable;\n\n            if (boolParameter)\n                return;\n            LocalFunction();\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\"), LiveOut(\"boolParameter\"));\n        context.Validate(\"boolParameter\", LiveIn(\"boolParameter\"), LiveOut(\"variable\"));\n        context.Validate(\"LocalFunction();\", LiveIn(\"variable\"));\n    }\n\n    [TestMethod]\n    public void LocalFunctionInvocation_Generic_LiveIn()\n    {\n        var code = \"\"\"\n            var variable = 42;\n            if (boolParameter)\n                return;\n            LocalFunction<int>();\n\n            int LocalFunction<T>() => variable;\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\"), LiveOut(\"boolParameter\"));\n        context.Validate(\"boolParameter\", LiveIn(\"boolParameter\"), LiveOut(\"variable\"));\n        context.Validate(\"LocalFunction<int>();\", LiveIn(\"variable\"));\n    }\n\n    [TestMethod]\n    public void LocalFunctionInvocation_NestedGeneric_LiveIn()\n    {\n        var code = \"\"\"\n            var variable = 42;\n            if (boolParameter)\n                return;\n            LocalFunction<int>();\n\n            int LocalFunction<T>()\n            {\n                return Nested<string>();\n\n                int Nested<TT>() => variable;\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\"), LiveOut(\"boolParameter\"));\n        context.Validate(\"boolParameter\", LiveIn(\"boolParameter\"), LiveOut(\"variable\"));\n        context.Validate(\"LocalFunction<int>();\", LiveIn(\"variable\"));\n    }\n\n    [TestMethod]\n    public void LocalFunctionInvocation_NotLiveIn()\n    {\n        var code = \"\"\"\n            var variable = 42;\n            if (boolParameter)\n                return;\n            LocalFunction();\n            Method(variable);\n\n            void LocalFunction()\n            {\n                variable = 0;\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\"), LiveOut(\"boolParameter\"));\n        context.Validate(\"boolParameter\", LiveIn(\"boolParameter\"));\n        context.Validate(\"LocalFunction();\");\n    }\n\n    [TestMethod]\n    public void LocalFunctionInvocation_NestedArgument_NotLiveIn()\n    {\n        var code = \"\"\"\n            LocalFunction(40);\n\n            int LocalFunction(int cnt) => cnt + 2;\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"LocalFunction(40);\");\n    }\n\n    [TestMethod]\n    public void LocalFunctionInvocation_NestedVariable_NotLiveIn_NotCaptured()\n    {\n        var code = \"\"\"\n            LocalFunction();\n\n            void LocalFunction()\n            {\n                var nested = 42;\n                Func<int> f = () => nested;\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"LocalFunction();\");\n    }\n\n    [TestMethod]\n    public void LocalFunctionInvocation_Recursive_LiveIn_WithoutFlowCapture()\n    {\n        var code = \"\"\"\n            var variable = 42;\n            if (boolParameter)\n                return;\n            LocalFunction(10);\n\n            int LocalFunction(int cnt)\n            {\n                if (cnt == 0)\n                    return 0;\n                return variable + LocalFunction(cnt - 1);\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\"), LiveOut(\"boolParameter\"));\n        context.Validate(\"boolParameter\", LiveIn(\"boolParameter\"), LiveOut(\"variable\"));\n        context.Validate(\"LocalFunction(10);\", LiveIn(\"variable\"));\n    }\n\n    [TestMethod]\n    public void LocalFunctionInvocation_Recursive_LiveIn_FlowCapture()\n    {\n        var code = \"\"\"\n            var variable = 42;\n            if (boolParameter)\n                return;\n            LocalFunction(10);\n\n            int LocalFunction(int cnt) => variable + (cnt == 0 ? 0 : LocalFunction(cnt - 1));\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\"), LiveOut(\"boolParameter\"));\n        context.Validate(\"boolParameter\", LiveIn(\"boolParameter\"), LiveOut(\"variable\"));\n        context.Validate(\"LocalFunction(10);\", LiveIn(\"variable\"));\n    }\n\n    [TestMethod]\n    public void LocalFunctionInvocation_Recursive_WhenAnalyzingLocalFunctionItself_LiveIn()\n    {\n        var code = \"\"\"\n            var variable = 42;\n\n            int LocalFunction(int arg)\n            {\n                return variable + (arg == 0 ? 0 : LocalFunction(arg - 1));\n            }\n            \"\"\";\n        // variable is not local, it's defined above the LocalFunction scope\n        var context = CreateContextCS(code, \"LocalFunction\");\n        context.ValidateEntry(LiveIn(\"arg\"), LiveOut(\"arg\"));\n        context.Validate(\"variable\", LiveIn(\"arg\"), LiveOut(\"arg\"));\n        context.Validate(\"LocalFunction(arg - 1)\", LiveIn(\"arg\"));\n        context.Validate(\"0\");\n    }\n\n    [TestMethod]\n    public void LocalFunctionInvocation_CrossReference_LiveIn()\n    {\n        var code = \"\"\"\n            var variable = 42;\n            if (boolParameter)\n                return;\n            LocalFunction();\n\n            int LocalFunction()\n            {\n                int First() => Second();\n                int Second() => variable;\n                return First();\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\"), LiveOut(\"boolParameter\"));\n        context.Validate(\"LocalFunction();\", LiveIn(\"variable\"));\n    }\n\n    [TestMethod]\n    public void LocalFunctionInvocation_CrossReference_WhenAnalyzingLocalFunctionItself_LiveIn()\n    {\n        var code = \"\"\"\n            int LocalFunction()\n            {\n                var variable = 42;\n                if (boolParameter)\n                    return 0;\n                int First() => Second();\n                int Second() => variable;\n                return First();\n            }\n            \"\"\";\n        var context = CreateContextCS(code, \"LocalFunction\");\n        context.ValidateEntry();\n        context.Validate(\"boolParameter\", LiveOut(\"variable\"));\n        context.Validate(\"First()\", LiveIn(\"variable\"));\n    }\n\n    [TestMethod]\n    public void LocalFunctionInvocation_Nested_LiveIn()\n    {\n        var code = \"\"\"\n            var variable = 42;\n            if (boolParameter)\n                return;\n            LocalFunction();\n\n            int LocalFunction()\n            {\n                return Nested();\n\n                int Nested() => variable;\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\"), LiveOut(\"boolParameter\"));\n        context.Validate(\"boolParameter\", LiveIn(\"boolParameter\"), LiveOut(\"variable\"));\n        context.Validate(\"LocalFunction();\", LiveIn(\"variable\"));\n    }\n\n    [TestMethod]\n    public void LocalFunctionInvocation_TryCatchFinally_LiveIn()\n    {\n        var code = \"\"\"\n            var usedInTry = 42;\n            var usedInCatch = 42;\n            var usedInFinally = 42;\n            var usedInUnreachable = 42;\n            if (boolParameter)\n                return;\n            LocalFunction();\n\n            int LocalFunction()\n            {\n                try\n                {\n                    Method(usedInTry);\n                }\n                catch\n                {\n                    Method(usedInCatch);\n                }\n                finally\n                {\n                    Method(usedInFinally);\n                }\n                return 42;\n                Method(usedInUnreachable);\n            }\n            \"\"\";\n\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\"), LiveOut(\"boolParameter\"));\n        // usedInUnreachable is here only because of simplified processing inside local functions\n        context.Validate(\"boolParameter\", LiveIn(\"boolParameter\"), LiveOut(\"usedInTry\", \"usedInCatch\", \"usedInFinally\", \"usedInUnreachable\"));\n        context.Validate(\"LocalFunction();\", LiveIn(\"usedInTry\", \"usedInCatch\", \"usedInFinally\", \"usedInUnreachable\"));\n    }\n\n    [TestMethod]\n    public void LocalFunctionReference_LiveIn()\n    {\n        var code = \"\"\"\n            var variable = 42;\n            if (boolParameter)\n                return;\n            Capturing(LocalFunction);\n\n            int LocalFunction(int arg) => arg + variable;\n            \"\"\";\n\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\"), LiveOut(\"boolParameter\"));\n        context.Validate(\"boolParameter\", LiveIn(\"boolParameter\"), LiveOut(\"variable\"));\n        context.Validate(\"Capturing(LocalFunction);\", LiveIn(\"variable\"));\n    }\n\n    [TestMethod]\n    public void LocalFunctionReference_Recursive_LiveIn()\n    {\n        var code = \"\"\"\n            var variable = 42;\n            if (boolParameter)\n                return;\n            LocalFunction(42);\n\n            void LocalFunction(int arg)\n            {\n                Enumerable.Empty<object>().Where(IsTrue);\n\n                bool IsTrue(object x)\n                {\n                    arg--;\n                    return arg <= variable || new[] { x }.Any(IsTrue);\n                }\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\"), LiveOut(\"boolParameter\"));\n        context.Validate(\"boolParameter\", LiveIn(\"boolParameter\"), LiveOut(\"variable\"));\n        context.Validate(\"LocalFunction(42);\", LiveIn(\"variable\"));\n    }\n\n    [TestMethod]\n    public void LocalFunctionReference_Recursive_WhenAnalyzingLocalFunctionItself_LiveIn()\n    {\n        var code = \"\"\"\n            var variable = 42;\n\n            int LocalFunction(int arg)\n            {\n                Capturing(LocalFunction);\n                return variable + arg;\n            }\n            \"\"\";\n        // variable is not local, it's defined above the LocalFunction scope\n        var context = CreateContextCS(code, \"LocalFunction\");\n        context.ValidateEntry(LiveIn(\"arg\"), LiveOut(\"arg\"));\n        context.Validate(\"Capturing(LocalFunction);\", LiveIn(\"arg\"));\n    }\n\n    [TestMethod]\n    public void LocalFunctionCapture_CapturedLocalFunction_Captured()\n    {\n        // Local function using ?? (FlowCapture in CFG) is called from inside a lambda.\n        // ResolveCaptures must be called for the local function CFG so that FlowCaptureReference resolves to \"variable\".\n        var code = \"\"\"\n            var variable = \"value\";\n            if (boolParameter)\n                return;\n            Capturing(() => LocalFunction());\n\n            string LocalFunction() => variable ?? \"default\";\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(Captured(\"variable\"), LiveIn(\"boolParameter\"), LiveOut(\"boolParameter\"));\n        context.Validate(\"boolParameter\", Captured(\"variable\"), LiveIn(\"boolParameter\"));\n        context.Validate(\"Capturing(() => LocalFunction());\", Captured(\"variable\"));\n    }\n\n    [TestMethod]\n    public void LocalFunctionCapture_AnonymousFunction_FlowCapture_Captured()\n    {\n        // Lambda using ?? (FlowCapture in CFG) directly captures a variable.\n        // ResolveCaptures must be called for the anonymous function CFG so that FlowCaptureReference resolves to \"variable\".\n        var code = \"\"\"\n            var variable = \"value\";\n            if (boolParameter)\n                return;\n            Capturing(() => variable ?? \"default\");\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(Captured(\"variable\"), LiveIn(\"boolParameter\"), LiveOut(\"boolParameter\"));\n        context.Validate(\"boolParameter\", Captured(\"variable\"), LiveIn(\"boolParameter\"));\n        context.Validate(\"Capturing(() => variable ?? \\\"default\\\");\", Captured(\"variable\"));\n    }\n\n    [TestMethod]\n    public void LocalFunctionReference_FlowCapture_LiveIn()\n    {\n        // Local function using ?? (FlowCapture in CFG) is passed as a method reference.\n        // ResolveCaptures must be called for the local function CFG so that FlowCaptureReference resolves to \"variable\".\n        var code = \"\"\"\n            var variable = \"value\";\n            if (boolParameter)\n                return;\n            Capturing(LocalFunction);\n\n            string LocalFunction() => variable ?? \"default\";\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\"), LiveOut(\"boolParameter\"));\n        context.Validate(\"boolParameter\", LiveIn(\"boolParameter\"), LiveOut(\"variable\"));\n        context.Validate(\"Capturing(LocalFunction);\", LiveIn(\"variable\"));\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/LiveVariableAnalysis/RoslynLiveVariableAnalysisTest.TryCatchFinally.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Operations;\nusing IIsNullOperation = Microsoft.CodeAnalysis.FlowAnalysis.IIsNullOperation;\n\nnamespace SonarAnalyzer.Test.LiveVariableAnalysis;\n\npublic partial class RoslynLiveVariableAnalysisTest\n{\n    [TestMethod]\n    [DataRow(\"using (var ms = new MemoryStream()) {\", \"}\")]\n    [DataRow(\"using var ms = new MemoryStream();\", null)]\n    public void Using_LiveInUntilTheEnd(string usingStatement, string suffix)\n    {\n        /*       Block 1                    Finally region:\n         *       ms = new                   Block 4\n         *         |                        /    \\\n         *         |                    Block5    \\\n         *       Block 2                ms.Dispose |\n         *       Method(ms.Length)          \\     /\n         *        /   \\                     Block 6\n         *       /     \\                      |\n         *   Block 3    |                   (null)\n         *   Method(0)  |\n         *       \\     /\n         *        Exit\n         */\n        var code = $\"\"\"\n            {usingStatement}\n                Method(ms.Capacity);\n                if (boolParameter)\n                    Method(0);\n            {suffix}\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\"), LiveOut(\"boolParameter\"));\n        context.Validate<ISimpleAssignmentOperation>(\"ms = new MemoryStream()\", LiveIn(\"boolParameter\"), LiveOut(\"boolParameter\", \"ms\"));\n        context.Validate(\"Method(ms.Capacity);\", LiveIn(\"boolParameter\", \"ms\"), LiveOut(\"ms\"));\n        context.Validate(\"Method(0);\", LiveIn(\"ms\"), LiveOut(\"ms\"));\n        context.ValidateExit();\n        // Finally region\n        context.Validate<IIsNullOperation>(\"ms = new MemoryStream()\", LiveIn(\"ms\"), LiveOut(\"ms\"));     // Null check\n        context.Validate<IInvocationOperation>(\"ms = new MemoryStream()\", LiveIn(\"ms\"));                // Actual Dispose\n        context.Validate(context.Cfg.Blocks[6]);\n    }\n\n    [TestMethod]\n    public void Using_Nested_Block_LiveInUntilTheEnd()\n    {\n        const string code = \"\"\"\n            using (var msOuter = new MemoryStream())\n            {\n                if (boolParameter)\n                {\n                    using (var msInner = new MemoryStream())\n                    {\n                        Method(0);\n                    }\n                    Method(1);\n                }\n            }\n            Method(2);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\"), LiveOut(\"boolParameter\"));\n        context.Validate(\"Method(0);\", LiveIn(\"msOuter\", \"msInner\"), LiveOut(\"msOuter\", \"msInner\"));\n        context.Validate(\"Method(1);\", LiveIn(\"msOuter\"), LiveOut(\"msOuter\"));\n        context.Validate(\"Method(2);\");\n        context.ValidateExit();\n        // Finally region\n        context.Validate<IIsNullOperation>(\"msInner = new MemoryStream()\", LiveIn(\"msInner\", \"msOuter\"), LiveOut(\"msInner\", \"msOuter\"));   // Null check\n        context.Validate<IInvocationOperation>(\"msInner = new MemoryStream()\", LiveIn(\"msInner\", \"msOuter\"), LiveOut(\"msOuter\"));          // Actual Dispose\n        context.Validate<IIsNullOperation>(\"msOuter = new MemoryStream()\", LiveIn(\"msOuter\"), LiveOut(\"msOuter\"));                         // Null check\n        context.Validate<IInvocationOperation>(\"msOuter = new MemoryStream()\", LiveIn(\"msOuter\"));                                         // Actual Dispose\n    }\n\n    [TestMethod]\n    public void Using_Nested_Declaration_LiveInUntilTheEnd()\n    {\n        const string code = \"\"\"\n            using var msOuter = new MemoryStream();\n            if (boolParameter)\n            {\n                using var msInner = new MemoryStream();\n                Method(0);\n                if (boolParameter)\n                {\n                    Method(1);\n                }\n            }\n            Method(2);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\"), LiveOut(\"boolParameter\"));\n        context.Validate(\"Method(0);\", LiveIn(\"boolParameter\", \"msOuter\", \"msInner\"), LiveOut(\"msOuter\", \"msInner\"));\n        context.Validate(\"Method(1);\", LiveIn(\"msOuter\", \"msInner\"), LiveOut(\"msOuter\", \"msInner\"));\n        context.Validate(\"Method(2);\", LiveIn(\"msOuter\"), LiveOut(\"msOuter\"));\n        context.ValidateExit();\n        // Finally region\n        context.Validate<IIsNullOperation>(\"msInner = new MemoryStream()\", LiveIn(\"msInner\", \"msOuter\"), LiveOut(\"msInner\", \"msOuter\"));   // Null check\n        context.Validate<IInvocationOperation>(\"msInner = new MemoryStream()\", LiveIn(\"msInner\", \"msOuter\"), LiveOut(\"msOuter\"));          // Actual Dispose\n        context.Validate<IIsNullOperation>(\"msOuter = new MemoryStream()\", LiveIn(\"msOuter\"), LiveOut(\"msOuter\"));                         // Null check\n        context.Validate<IInvocationOperation>(\"msOuter = new MemoryStream()\", LiveIn(\"msOuter\"));                                         // Actual Dispose\n    }\n\n    [TestMethod]\n    public void Catch_LiveIn()\n    {\n        const string code = \"\"\"\n            try\n            {\n                Method(0);\n            }\n            catch\n            {\n                Method(intParameter);\n            }\n            Method(1);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"intParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"Method(0);\", LiveIn(\"intParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"Method(intParameter);\", LiveIn(\"intParameter\"));\n        context.Validate(\"Method(1);\");\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void VariableBeforeTry_LiveOut()\n    {\n        const string code = \"\"\"\n            var usedInCatch = 0;\n            Method(0);\n            try\n            {\n                usedInCatch = 1;\n                Method(1);\n            }\n            catch\n            {\n                Method(usedInCatch);\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.Validate(\"Method(0);\", LiveOut(\"usedInCatch\"));\n        context.Validate(\"Method(1);\", LiveOut(\"usedInCatch\"));\n        context.Validate(\"Method(usedInCatch);\", LiveIn(\"usedInCatch\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void NestedCatch_LiveOutOuterCatch()\n    {\n        const string code = \"\"\"\n            var usedInCatch = 0;\n            Method(0);\n            try\n            {\n                Method(1);\n                try\n                {\n                    usedInCatch = 1;\n                    Method(2);\n                }\n                catch\n                {\n                    Method(usedInCatch); // This can throw again\n                    Method(3);\n                }\n            }\n            catch\n            {\n                Method(usedInCatch);\n                Method(4);\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.Validate(\"Method(0);\", LiveOut(\"usedInCatch\"));\n        context.Validate(\"Method(1);\", LiveIn(\"usedInCatch\"), LiveOut(\"usedInCatch\"));\n        context.Validate(\"Method(2);\", LiveOut(\"usedInCatch\"));\n        context.Validate(\"Method(3);\", LiveIn(\"usedInCatch\"), LiveOut(\"usedInCatch\"));\n        context.Validate(\"Method(4);\", LiveIn(\"usedInCatch\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void NestedCatch_LiveOutOuterCatch_NestedTwice()\n    {\n        const string code = \"\"\"\n            var usedInCatch = 0;\n            Method(0);\n            try\n            {\n                Method(1);\n                try\n                {\n                    Method(2);\n                    try\n                    {\n                        usedInCatch = 1;\n                        Method(3);\n                    }\n                    catch\n                    {\n                        Method(usedInCatch); // This can throw again\n                        Method(4);\n                    }\n                }\n                catch\n                {\n                    Method(usedInCatch);\n                    Method(5);\n                }\n            }\n            catch\n            {\n                Method(usedInCatch);\n                Method(6);\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.Validate(\"Method(0);\", LiveOut(\"usedInCatch\"));\n        context.Validate(\"Method(1);\", LiveIn(\"usedInCatch\"), LiveOut(\"usedInCatch\"));\n        context.Validate(\"Method(2);\", LiveIn(\"usedInCatch\"), LiveOut(\"usedInCatch\"));\n        context.Validate(\"Method(3);\", LiveOut(\"usedInCatch\"));\n        context.Validate(\"Method(4);\", LiveIn(\"usedInCatch\"), LiveOut(\"usedInCatch\"));\n        context.Validate(\"Method(5);\", LiveIn(\"usedInCatch\"), LiveOut(\"usedInCatch\"));\n        context.Validate(\"Method(6);\", LiveIn(\"usedInCatch\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void NestedCatch_LiveOutOuterCatch_ForEach()\n    {\n        const string code = \"\"\"\n            var usedInCatch = 0;\n            Method(0);\n            try\n            {\n                Method(1);\n                try\n                {\n                    Method(2);\n                    var list = new List<int>();\n                    foreach(var i in list)\n                    {\n                        Method(i);\n                        Method(usedInCatch);\n                    }\n                }\n                catch\n                {\n                    Method(usedInCatch);\n                    Method(3);\n                }\n            }\n            catch\n            {\n                Method(usedInCatch);\n                Method(4);\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.Validate(\"Method(0);\", LiveOut(\"usedInCatch\"));\n        context.Validate(\"Method(1);\", LiveIn(\"usedInCatch\"), LiveOut(\"usedInCatch\"));\n        context.Validate(\"Method(2);\", LiveIn(\"usedInCatch\"), LiveOut(\"list\", \"usedInCatch\"));\n        context.Validate(\"Method(i);\", LiveIn(\"usedInCatch\"), LiveOut(\"usedInCatch\"));\n        context.Validate(\"Method(3);\", LiveIn(\"usedInCatch\"), LiveOut(\"usedInCatch\"));\n        context.Validate(\"Method(4);\", LiveIn(\"usedInCatch\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void NestedCatch_LiveOutOuterFilterHandler_FromInnerCatch()\n    {\n        const string code = \"\"\"\n            int usedInCatch = 0;\n            Method(0);\n            try\n            {\n                try\n                {\n                    usedInCatch = 2;\n                    Method(1);\n                }\n                catch\n                {\n                    Method(usedInCatch);\n                    Method(2);\n                }\n            }\n            catch when(usedInCatch > 10)\n            {\n                Method(usedInCatch);\n                Method(3);\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.Validate(\"Method(0);\", LiveOut(\"usedInCatch\"));\n        context.Validate(\"Method(1);\", LiveOut(\"usedInCatch\"));\n        context.Validate(\"Method(2);\", LiveIn(\"usedInCatch\"),  LiveOut(\"usedInCatch\"));\n        context.Validate(\"Method(3);\", LiveIn(\"usedInCatch\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void NestedCatch_LiveOutOuterCatch_FromInnerFilterHandler()\n    {\n        const string code = \"\"\"\n            int usedInCatch = 0;\n            Method(0);\n            try\n            {\n                try\n                {\n                    usedInCatch = 2;\n                    Method(1);\n                }\n                catch when (true)\n                {\n                    Method(usedInCatch);\n                    Method(2);\n                }\n            }\n            catch\n            {\n                Method(usedInCatch);\n                Method(3);\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.Validate(\"Method(0);\", LiveOut(\"usedInCatch\"));\n        context.Validate(\"Method(1);\", LiveOut(\"usedInCatch\"));\n        context.Validate(\"Method(2);\", LiveIn(\"usedInCatch\"), LiveOut(\"usedInCatch\"));\n        context.Validate(\"Method(3);\", LiveIn(\"usedInCatch\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void NestedCatch_LiveOutOuterCatch_FromFilterHandler()\n    {\n        const string code = \"\"\"\n            int usedInCatch = 0;\n            Method(0);\n            try\n            {\n                try\n                {\n                    usedInCatch = 2;\n                    Method(1);\n                }\n                catch when(usedInCatch > 10 )\n                {\n                    usedInCatch = 3;\n                    Method(2);\n                }\n            }\n            catch\n            {\n                Method(usedInCatch);\n                Method(3);\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.Validate(\"Method(0);\", LiveOut(\"usedInCatch\"));\n        context.Validate(\"Method(1);\", LiveOut(\"usedInCatch\"));\n        context.Validate(\"Method(2);\", LiveOut(\"usedInCatch\"));\n        context.Validate(\"Method(3);\", LiveIn(\"usedInCatch\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void NestedCatch_LiveOutOuterCatch_CanThrowFromFilterHandler()\n    {\n        const string code = \"\"\"\n            int usedInCatch = 0;\n            Method(0);\n            try\n            {\n                try\n                {\n                    Method(1);\n                }\n                catch when(Method(2) == usedInCatch)\n                {\n                    usedInCatch = 1;\n                    Method(3);\n                }\n            }\n            catch\n            {\n                Method(usedInCatch);\n                Method(4);\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.Validate(\"Method(0);\", LiveOut(\"usedInCatch\"));\n        context.Validate(\"Method(1);\", LiveIn(\"usedInCatch\"), LiveOut(\"usedInCatch\"));\n        context.Validate(\"Method(2) == usedInCatch\", LiveIn(\"usedInCatch\"), LiveOut(\"usedInCatch\"));\n        context.Validate(\"Method(3);\", LiveOut(\"usedInCatch\"));\n        context.Validate(\"Method(4);\", LiveIn(\"usedInCatch\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void NestedCatch_LiveOut_ConsecutiveOuterCatch()\n    {\n        const string code = \"\"\"\n            var usedInCatch = 100;\n            try\n            {\n                try\n                {\n                     Method(usedInCatch);\n                     Method(0);\n                }\n                catch\n                {\n                    usedInCatch = 200;\n                    Method(1);\n                }\n            }\n            catch (ArgumentNullException)\n            {\n                Method(2);\n                Method(usedInCatch);\n            }\n            catch (IOException)\n            {\n                Method(3);\n                Method(usedInCatch);\n            }\n            catch (NullReferenceException)\n            {\n                Method(4);\n                Method(usedInCatch);\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"Method(0);\", LiveIn(\"usedInCatch\")); // No LiveOut, because inner Catch catches all exceptions and reassigns value\n        context.Validate(\"Method(1);\", LiveOut(\"usedInCatch\"));\n        context.Validate(\"Method(2);\", LiveIn(\"usedInCatch\"));\n        context.Validate(\"Method(3);\", LiveIn(\"usedInCatch\"));\n        context.Validate(\"Method(4);\", LiveIn(\"usedInCatch\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void Catch_TryHasLocalLifetimeRegion_LiveIn()\n    {\n        const string code = \"\"\"\n            try\n            {\n                Method(0);\n                var t = true || true; // This causes LocalLivetimeRegion to be generated\n            }\n            catch\n            {\n                Method(intParameter);\n            }\n            Method(1);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"intParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"t = true || true\", LiveIn(\"intParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"Method(intParameter);\", LiveIn(\"intParameter\"));\n        context.Validate(\"Method(1);\");\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void Catch_VariableUsedAfter_LiveIn_LiveOut()\n    {\n        const string code = \"\"\"\n            try\n            {\n                Method(0);\n            }\n            catch\n            {\n                Method(1);\n            }\n            Method(intParameter);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"intParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"Method(0);\", LiveIn(\"intParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"Method(1);\", LiveIn(\"intParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"Method(intParameter);\", LiveIn(\"intParameter\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void Catch_WithThrowStatement_LiveIn()\n    {\n        const string code = \"\"\"\n            var usedInTry = 42;\n            var usedInTryUnreachable = 42;\n            var usedInCatch = 42;\n            var usedInCatchUnreachable = 42;\n            try\n            {\n                Method(usedInTry);\n                throw new Exception();\n                Method(usedInTryUnreachable);  // Unreachable\n            }\n            catch\n            {\n                Method(usedInCatch);\n                throw new Exception();\n                Method(usedInCatchUnreachable);  // Unreachable\n            }\n            Method(intParameter); // Unreachable\n            \"\"\";\n        var context = CreateContextCS(code);\n        // LVA doesn't care if it's reachable. Blocks still should have LiveIn and LiveOut\n        context.ValidateEntry();    // intParameter is used only in unreachable path => not visible here\n        context.Validate(\"Method(usedInTry);\", LiveIn(\"usedInTry\", \"usedInCatch\"), LiveOut(\"usedInCatch\"));         // Doesn't see usedInTryUnreachable nor intParameter\n        context.Validate(\"Method(usedInTryUnreachable);\", LiveIn(\"intParameter\", \"usedInTryUnreachable\", \"usedInCatch\"), LiveOut(\"intParameter\", \"usedInCatch\"));\n        context.Validate(\"Method(usedInCatch);\", LiveIn(\"usedInCatch\"));                                            // Doesn't see usedInCatchUnreachable nor intParameter\n        context.Validate(\"Method(usedInCatchUnreachable);\", LiveIn(\"intParameter\", \"usedInCatchUnreachable\"), LiveOut(\"intParameter\"));\n        context.Validate(\"Method(intParameter);\", LiveIn(\"intParameter\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void Catch_WithThrowStatement_Conditional_LiveIn()\n    {\n        const string code = \"\"\"\n            try\n            {\n                Method(0);\n            }\n            catch\n            {\n                Method(1);\n                if (boolParameter)\n                {\n                    throw new Exception();\n                }\n                Method(2);\n            }\n            Method(intParameter);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"intParameter\", \"boolParameter\"), LiveOut(\"intParameter\", \"boolParameter\"));\n        context.Validate(\"Method(0);\", LiveIn(\"intParameter\", \"boolParameter\"), LiveOut(\"intParameter\", \"boolParameter\"));\n        context.Validate(\"Method(1);\", LiveIn(\"intParameter\", \"boolParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"boolParameter\", LiveIn(\"intParameter\", \"boolParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"Method(2);\", LiveIn(\"intParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"Method(intParameter);\", LiveIn(\"intParameter\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void Catch_Rethrow_LiveIn()\n    {\n        const string code = \"\"\"\n            try\n            {\n                Method(0);\n            }\n            catch\n            {\n                Method(1);\n                throw;\n            }\n            Method(intParameter);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"intParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"Method(0);\", LiveIn(\"intParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"Method(1);\");\n        context.Validate(\"Method(intParameter);\", LiveIn(\"intParameter\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void Catch_NotLiveIn_NotLiveOut()\n    {\n        const string code = \"\"\"\n            try\n            {\n                Method(0);\n            }\n            catch\n            {\n                intParameter = 42;\n                Method(intParameter);\n            }\n            Method(1);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"Method(0);\");\n        context.Validate(\"Method(intParameter);\");\n        context.Validate(\"Method(1);\");\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void Catch_Nested_LiveIn()\n    {\n        const string code = \"\"\"\n            var outer = 42;\n            var inner = 42;\n            try\n            {\n                try\n                {\n                    Method(0);\n                }\n                catch\n                {\n                    Method(inner);\n                }\n                Method(1);\n            }\n            catch\n            {\n                Method(outer);\n            }\n            Method(2);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"Method(0);\", LiveIn(\"inner\", \"outer\"), LiveOut(\"inner\", \"outer\"));\n        context.Validate(\"Method(inner);\", LiveIn(\"inner\", \"outer\"), LiveOut(\"outer\"));\n        context.Validate(\"Method(1);\", LiveIn(\"outer\"), LiveOut(\"outer\"));\n        context.Validate(\"Method(outer);\", LiveIn(\"outer\"));\n        context.Validate(\"Method(2);\");\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void Catch_InvalidSyntax_LiveIn()\n    {\n        /*    Entry 0\n         *      |\n         *    Block 1\n         *    Method(0)\n         *    Method(intParameter)\n         *      |\n         *    Exit 2\n         */\n        const string code = \"\"\"\n            // Error CS1003 Syntax error, 'try' expected\n            // Error CS1514 { expected\n            // Error CS1513 } expected\n            catch\n            {\n                Method(0);\n            }\n            Method(intParameter);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"intParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"Method(0);\", LiveIn(\"intParameter\"));\n        context.Validate(\"Method(intParameter);\", LiveIn(\"intParameter\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void Catch_Loop_Propagates_LiveIn_LiveOut()\n    {\n        const string code = \"\"\"\n            var variableUsedInCatch = 42;\n            A:\n            Method(intParameter);\n            if (boolParameter)\n                goto B;\n            try\n            {\n                Method(0);\n            }\n            catch\n            {\n                Method(variableUsedInCatch);\n            }\n            goto A;\n            B:\n            Method(1);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\", \"intParameter\"), LiveOut(\"boolParameter\", \"intParameter\"));\n        context.Validate(\"Method(intParameter);\", LiveIn(\"boolParameter\", \"intParameter\", \"variableUsedInCatch\"), LiveOut(\"boolParameter\", \"intParameter\", \"variableUsedInCatch\"));\n        context.Validate(\"Method(0);\", LiveIn(\"boolParameter\", \"intParameter\", \"variableUsedInCatch\"), LiveOut(\"boolParameter\", \"intParameter\", \"variableUsedInCatch\"));\n        context.Validate(\"Method(variableUsedInCatch);\", LiveIn(\"boolParameter\", \"intParameter\", \"variableUsedInCatch\"), LiveOut(\"boolParameter\", \"intParameter\", \"variableUsedInCatch\"));\n        context.Validate(\"Method(1);\");\n    }\n\n    [TestMethod]\n    public void Catch_ExVariable_LiveIn()\n    {\n        const string code = \"\"\"\n            try\n            {\n                Method(0);\n            }\n            catch (Exception ex)\n            {\n                if (boolParameter)\n                {\n                    Method(ex.HResult);\n                }\n            }\n            Method(1);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\"), LiveOut(\"boolParameter\"));\n        context.Validate(\"Method(0);\", LiveIn(\"boolParameter\"), LiveOut(\"boolParameter\"));\n        context.Validate(\"boolParameter\", LiveIn(\"boolParameter\"), LiveOut(\"ex\"));     // ex doesn't live in here, becase this blocks starts with SimpleAssignmentOperation: (Exception ex)\n        context.Validate(\"Method(ex.HResult);\", LiveIn(\"ex\"));\n        context.Validate(\"Method(1);\");\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void Catch_SingleType_LiveIn()\n    {\n        const string code = \"\"\"\n            var usedAfter = 42;\n            var usedInTry = 42;\n            var usedInCatch = 42;\n            try\n            {\n                Method(usedInTry);\n            }\n            catch (Exception ex)\n            {\n                Method(intParameter, usedInCatch, ex.HResult);\n            }\n            Method(usedAfter);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"intParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"Method(usedInTry);\", LiveIn(\"usedInTry\", \"usedAfter\", \"usedInCatch\", \"intParameter\"), LiveOut(\"usedAfter\", \"usedInCatch\", \"intParameter\"));\n        context.Validate(\"Method(intParameter, usedInCatch, ex.HResult);\", LiveIn(\"intParameter\", \"usedInCatch\", \"usedAfter\"), LiveOut(\"usedAfter\"));\n        context.Validate(\"Method(usedAfter);\", LiveIn(\"usedAfter\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void Catch_SingleTypeWhenCondition_LiveIn()\n    {\n        const string code = \"\"\"\n            var usedAfter = 42;\n            var usedInTry = 42;\n            var usedInCatch = 42;\n            try\n            {\n                Method(usedInTry);\n            }\n            catch (Exception ex) when (ex.InnerException == null)\n            {\n                Method(intParameter, usedInCatch, ex.HResult);\n            }\n            Method(usedAfter);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"intParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"Method(usedInTry);\", LiveIn(\"usedInTry\", \"usedAfter\", \"usedInCatch\", \"intParameter\"), LiveOut(\"usedAfter\", \"usedInCatch\", \"intParameter\"));\n        context.Validate(\"Method(intParameter, usedInCatch, ex.HResult);\", LiveIn(\"intParameter\", \"usedInCatch\", \"usedAfter\", \"ex\"), LiveOut(\"usedAfter\"));\n        context.Validate(\"Method(usedAfter);\", LiveIn(\"usedAfter\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void Catch_SingleTypeWhenConditionReferencingArgument_LiveIn()\n    {\n        const string code = \"\"\"\n            try\n            {\n                Method(0);\n            }\n            catch (Exception ex) when (boolParameter)\n            {\n                Method(intParameter);\n            }\n            Method(1);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\", \"intParameter\"), LiveOut(\"boolParameter\", \"intParameter\"));\n        context.Validate(\"Method(0);\", LiveIn(\"boolParameter\", \"intParameter\"), LiveOut(\"boolParameter\", \"intParameter\"));\n        context.Validate(\"Method(intParameter);\", LiveIn(\"intParameter\"));\n        context.Validate(\"Method(1);\");\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void Catch_MultipleTypes_LiveIn()\n    {\n        const string code = \"\"\"\n            var usedAfter = 42;\n            var usedInTry = 42;\n            var usedInCatchA = 42;\n            var usedInCatchB = 42;\n            try\n            {\n                Method(usedInTry);\n            }\n            catch (FormatException ex)\n            {\n                Method(intParameter, usedInCatchA, ex.HResult);\n            }\n            catch (Exception ex)\n            {\n                Method(intParameter, usedInCatchB, ex.HResult);\n            }\n            Method(usedAfter);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"intParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"Method(usedInTry);\",\n            LiveIn(\"usedInTry\", \"usedAfter\", \"usedInCatchA\", \"usedInCatchB\", \"intParameter\"),\n            LiveOut(\"usedAfter\", \"usedInCatchA\", \"usedInCatchB\", \"intParameter\"));\n        // ex doesn't live in here, because the blocks starts with SimpleAssignmentOperation: (Exception ex)\n        context.Validate(\"Method(intParameter, usedInCatchA, ex.HResult);\", LiveIn(\"intParameter\", \"usedInCatchA\", \"usedAfter\"), LiveOut(\"usedAfter\"));\n        context.Validate(\"Method(intParameter, usedInCatchB, ex.HResult);\", LiveIn(\"intParameter\", \"usedInCatchB\", \"usedAfter\"), LiveOut(\"usedAfter\"));\n        context.Validate(\"Method(usedAfter);\", LiveIn(\"usedAfter\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void Catch_AssignedInTry_LiveOut()\n    {\n        const string code = \"\"\"\n            int variable = 42;\n            Method(0);\n            try\n            {\n                Method(1);  // Can throw\n                variable = 0;\n            }\n            catch\n            {\n                Method(variable);\n            }\n            Method(2);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"Method(0);\", LiveOut(\"variable\"));\n        context.Validate(\"Method(1);\", LiveOut(\"variable\"));\n        context.Validate(\"Method(variable);\", LiveIn(\"variable\"));\n        context.Validate(\"Method(2);\");\n    }\n\n    [TestMethod]\n    public void Catch_When_AssignedInTry_LiveOut()\n    {\n        const string code = \"\"\"\n            int variable = 42;\n            Method(0);\n            try\n            {\n                Method(1);  // Can throw\n                variable = 0;\n            }\n            catch when(variable == 0)\n            {\n                Method(2);\n            }\n            Method(3);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"Method(0);\", LiveOut(\"variable\"));\n        context.Validate(\"Method(1);\", LiveOut(\"variable\"));\n        context.Validate(\"variable == 0\", LiveIn(\"variable\"));\n        context.Validate(\"Method(2);\");\n        context.Validate(\"Method(3);\");\n    }\n\n    [TestMethod]\n    public void Catch_Loop_Propagates_LiveIn()\n    {\n        const string code = \"\"\"\n            var variable = 0;\n            Method(0);\n            while (variable < 5)\n            {\n                variable++;\n                Method(1);\n                try\n                {\n                    Method(2);  // Can throw\n                    return;\n                }\n                catch (TimeoutException)\n                {\n                    Method(3); // Continue loop to the next try\n                }\n                Method(4);\n            }\n            Method(5);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"Method(0);\", LiveOut(\"variable\"));\n        context.Validate(\"Method(1);\", LiveIn(\"variable\"), LiveOut(\"variable\"));\n        context.Validate(\"Method(2);\", LiveIn(\"variable\"), LiveOut(\"variable\"));\n        context.Validate(\"Method(3);\", LiveIn(\"variable\"), LiveOut(\"variable\"));\n        context.Validate(\"Method(4);\", LiveIn(\"variable\"), LiveOut(\"variable\"));\n        context.Validate(\"Method(5);\");\n    }\n\n    [TestMethod]\n    public void Throw_NestedCatch_LiveOut()\n    {\n        const string code = \"\"\"\n            var value = 100;\n            try\n            {\n                try\n                {\n                     Method(value);\n                     Method(0);\n                }\n                catch\n                {\n                    value = 200;\n                    throw;\n                }\n            }\n            catch\n            {\n                 Method(value);\n                 Method(1);\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"Method(0);\", LiveIn(\"value\"));\n        context.Validate(\"value = 200;\", LiveOut(\"value\"));\n        context.Validate(\"Method(1);\", LiveIn(\"value\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void Throw_NestedCatch_LiveInInConsecutiveOuterCatch()\n    {\n        const string code = \"\"\"\n            var value = 100;\n            try\n            {\n                try\n                {\n                     Method(value);\n                     Method(0);\n                }\n                catch\n                {\n                    value = 200;\n                    throw;\n                }\n            }\n            catch (ArgumentNullException)\n            {\n                Method(value);\n                Method(1);\n            }\n            catch (IOException)\n            {\n                Method(value);\n                Method(2);\n            }\n            catch (NullReferenceException)\n            {\n                Method(value);\n                Method(3);\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"Method(0);\", LiveIn(\"value\"));\n        context.Validate(\"value = 200;\", LiveOut(\"value\"));\n        context.Validate(\"Method(1);\", LiveIn(\"value\"));\n        context.Validate(\"Method(2);\", LiveIn(\"value\"));\n        context.Validate(\"Method(3);\", LiveIn(\"value\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void Throw_NestedCatch_LiveInInConsecutiveOuterCatchNewThrow()\n    {\n        const string code = \"\"\"\n            var value = 100;\n            try\n            {\n                try\n                {\n                     Method(value);\n                     Method(0);\n                }\n                catch (ArgumentNullException ex)\n                {\n                    Method(value);\n                    Method(1);\n                    throw new Exception(\"Message\", ex);\n                }\n            }\n            catch (IOException)\n            {\n                Method(value);\n                Method(2);\n            }\n            catch (NullReferenceException)\n            {\n                Method(value);\n                Method(3);\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"Method(0);\", LiveIn(\"value\"), LiveOut(\"value\"));\n        context.Validate(\"Method(1);\", LiveIn(\"value\"), LiveOut(\"value\"));\n        context.Validate(\"Method(2);\", LiveIn(\"value\"));\n        context.Validate(\"Method(3);\", LiveIn(\"value\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void Throw_NestedCatch_OuterCatchRethrows_LiveOutOuterCatch()\n    {\n        const string code = \"\"\"\n            var value = 100;\n            try\n            {\n                try\n                {\n                    try\n                    {\n                        Method(value);\n                        Method(0);\n                    }\n                    catch\n                    {\n                        value = 200;\n                        throw;\n                    }\n                }\n                catch   // Outer catch\n                {\n                    Method(value);\n                    Method(1);\n                    throw;\n                }\n            }\n            catch\n            {\n                Method(value);\n                Method(2);\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"Method(0);\", LiveIn(\"value\"));\n        context.Validate(\"value = 200;\", LiveOut(\"value\"));\n        context.Validate(\"Method(1);\", LiveIn(\"value\"), LiveOut(\"value\"));\n        context.Validate(\"Method(2);\", LiveIn(\"value\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void Finally_LiveIn()\n    {\n        const string code = \"\"\"\n            try\n            {\n                Method(0);\n            }\n            finally\n            {\n                Method(intParameter);\n            }\n            Method(1);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"intParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"Method(0);\", LiveIn(\"intParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"Method(intParameter);\", LiveIn(\"intParameter\"));\n        context.Validate(\"Method(1);\");\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void Finally_VariableUsedAfter_LiveIn_LiveOut()\n    {\n        const string code = \"\"\"\n            try\n            {\n                Method(0);\n            }\n            finally\n            {\n                Method(1);\n            }\n            Method(intParameter);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"intParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"Method(0);\", LiveIn(\"intParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"Method(1);\", LiveIn(\"intParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"Method(intParameter);\", LiveIn(\"intParameter\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void Finally_VariableUsedAfter_FinallyHasLocalLifetimeRegion_LiveIn_LiveOut()\n    {\n        const string code = \"\"\"\n            try\n            {\n                Method(0);\n            }\n            finally\n            {\n                Method(1);\n                var t = true || true; // This causes LocalLivetimeRegion to be generated, but there's also one empty block outside if before the exit branch\n            }\n            Method(intParameter);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"intParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"Method(0);\", LiveIn(\"intParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"Method(1);\", LiveIn(\"intParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"Method(intParameter);\", LiveIn(\"intParameter\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void Finally_WithThrowStatement_LiveIn()\n    {\n        const string code = \"\"\"\n            try\n            {\n                Method(0);\n            }\n            finally\n            {\n                Method(1);\n                throw new Exception();\n                Method(2);  // Unreachable\n            }\n            Method(intParameter); // Unreachable\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"intParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"Method(0);\", LiveIn(\"intParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"Method(1);\", LiveIn(\"intParameter\"), LiveOut(\"intParameter\"));\n        // LVA doesn't care if it's reachable. Blocks still should have LiveIn and LiveOut\n        context.Validate(\"Method(2);\", LiveIn(\"intParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"Method(intParameter);\", LiveIn(\"intParameter\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void Finally_WithThrowStatementAsSingleExit_LiveIn()\n    {\n        const string code = \"\"\"\n            try\n            {\n                Method(0);\n            }\n            finally\n            {\n                Method(1);\n                throw new Exception();\n            }\n            Method(intParameter); // Unreachable\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"intParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"Method(0);\", LiveIn(\"intParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"Method(1);\", LiveIn(\"intParameter\"), LiveOut(\"intParameter\"));\n        // LVA doesn't care if it's reachable. Blocks still should have LiveIn and LiveOut\n        context.Validate(\"Method(intParameter);\", LiveIn(\"intParameter\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void Finally_WithThrowStatement_Conditional_LiveIn()\n    {\n        const string code = \"\"\"\n            try\n            {\n                Method(0);\n            }\n            finally\n            {\n                Method(1);\n                if (boolParameter)\n                {\n                    throw new Exception();\n                }\n                Method(2);\n            }\n            Method(intParameter);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"intParameter\", \"boolParameter\"), LiveOut(\"intParameter\", \"boolParameter\"));\n        context.Validate(\"Method(0);\", LiveIn(\"intParameter\", \"boolParameter\"), LiveOut(\"intParameter\", \"boolParameter\"));\n        context.Validate(\"Method(1);\", LiveIn(\"intParameter\", \"boolParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"boolParameter\", LiveIn(\"intParameter\", \"boolParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"Method(2);\", LiveIn(\"intParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"Method(intParameter);\", LiveIn(\"intParameter\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void Finally_WithThrowStatementInTry_LiveOut()\n    {\n        const string code = \"\"\"\n            int variable = 42;\n            Method(0);\n            try\n            {\n                Method(1);\n                throw new Exception();\n            }\n            finally\n            {\n                Method(variable);\n            }\n            Method(2);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"Method(0);\", LiveOut(\"variable\"));\n        context.Validate(\"Method(1);\", LiveIn(\"variable\"), LiveOut(\"variable\"));\n        context.Validate(\"Method(variable);\", LiveIn(\"variable\"));\n        context.Validate(\"Method(2);\");\n    }\n\n    [TestMethod]\n    public void Finally_WithThrowStatementInTry_LiveOut_FilteredCatch()\n    {\n        const string code = \"\"\"\n            int variable = 42;\n            Method(0);\n            try\n            {\n                Method(1);\n                throw new Exception();\n            }\n            catch when (Property == 42) { }     // FilterAndHandlerRegion\n            catch (FormatException) { }\n            catch (ArgumentException ex) { }\n            finally\n            {\n                Method(variable);\n            }\n            Method(2);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"Method(0);\", LiveOut(\"variable\"));\n        context.Validate(\"Method(1);\", LiveIn(\"variable\"), LiveOut(\"variable\"));\n        context.Validate(\"Method(variable);\", LiveIn(\"variable\"));\n        context.Validate(\"Method(2);\");\n    }\n\n    [TestMethod]\n    [DataRow(\"catch\")]\n    [DataRow(\"catch (Exception)\")]\n    [DataRow(\"catch (Exception ex)\")]\n    public void Finally_WithThrowStatementInTry_LiveOut_CatchAll(string catchAll)\n    {\n        var code = $$\"\"\"\n            int variable = 42;\n            Method(0);\n            try\n            {\n                Method(1);\n                throw new Exception();\n            }\n            {{catchAll}}\n            {\n                Method(2);\n                variable = 0;\n            }\n            finally\n            {\n                Method(variable);\n            }\n            Method(3);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"Method(0);\");\n        context.Validate(\"Method(1);\");\n        context.Validate(\"Method(2);\", LiveOut(\"variable\"));\n        context.Validate(\"Method(variable);\", LiveIn(\"variable\"));\n        context.Validate(\"Method(3);\");\n    }\n\n    [TestMethod]\n    public void Finally_NotLiveIn_NotLiveOut()\n    {\n        const string code = \"\"\"\n            try\n            {\n                Method(0);\n            }\n            finally\n            {\n                intParameter = 42;\n                Method(intParameter);\n            }\n            Method(1);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"Method(0);\");\n        context.Validate(\"Method(intParameter);\");\n        context.Validate(\"Method(1);\");\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void Finally_Nested_LiveIn()\n    {\n        const string code = \"\"\"\n            var outer = 42;\n            var inner = 42;\n            try\n            {\n                try\n                {\n                    Method(0);\n                }\n                finally\n                {\n                    Method(inner);\n                }\n                Method(1);\n            }\n            finally\n            {\n                Method(outer);\n            }\n            Method(2);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"Method(0);\", LiveIn(\"inner\", \"outer\"), LiveOut(\"inner\", \"outer\"));\n        context.Validate(\"Method(inner);\", LiveIn(\"inner\", \"outer\"), LiveOut(\"outer\"));\n        context.Validate(\"Method(1);\", LiveIn(\"outer\"), LiveOut(\"outer\"));\n        context.Validate(\"Method(outer);\", LiveIn(\"outer\"));\n        context.Validate(\"Method(2);\");\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void Finally_Nested_NoInstructionBetweenFinally_LiveIn()\n    {\n        const string code = \"\"\"\n            var outer = 42;\n            var inner = 42;\n            try\n            {\n                try\n                {\n                    Method(0);\n                }\n                finally\n                {\n                    Method(inner);\n                }\n                // No action here, finally branch is crossing both regions\n            }\n            finally\n            {\n                Method(outer);\n            }\n            Method(2);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"Method(0);\", LiveIn(\"inner\", \"outer\"), LiveOut(\"inner\", \"outer\"));\n        context.Validate(\"Method(inner);\", LiveIn(\"inner\", \"outer\"), LiveOut(\"outer\"));\n        context.Validate(\"Method(outer);\", LiveIn(\"outer\"));\n        context.Validate(\"Method(2);\");\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void NestedFinally_LiveOut_OuterCatch()\n    {\n        const string code = \"\"\"\n            var usedInOuterCatch = 0;\n            Method(0);\n            try\n            {\n                Method(1);\n                try\n                {\n                    Method(2);\n                }\n                finally\n                {\n                    usedInOuterCatch = 2;\n                    Method(3);\n                }\n            }\n            catch (Exception ex)\n            {\n                Method(usedInOuterCatch);\n                Method(4);\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"Method(0);\", LiveOut(\"usedInOuterCatch\"));\n        context.Validate(\"Method(1);\", LiveIn(\"usedInOuterCatch\"), LiveOut(\"usedInOuterCatch\"));\n        context.Validate(\"Method(2);\", LiveIn(\"usedInOuterCatch\"), LiveOut(\"usedInOuterCatch\"));\n        context.Validate(\"Method(3);\", LiveOut(\"usedInOuterCatch\"));\n        context.Validate(\"Method(4);\", LiveIn(\"usedInOuterCatch\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void NestedFinally_LiveOut_NestedTryInOuterCatch()\n    {\n        const string code = \"\"\"\n            var usedInOuterTry = 0;\n            Method(0);\n            try\n            {\n                Method(1);\n                try\n                {\n                    Method(2);\n                }\n                finally\n                {\n                    usedInOuterTry = 2;\n                    Method(3);\n                }\n            }\n            catch\n            {\n                try\n                {\n                    Method(usedInOuterTry);\n                    Method(4);\n                }\n                catch\n                {\n                    Method(5);\n                }\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"Method(0);\", LiveOut(\"usedInOuterTry\"));\n        context.Validate(\"Method(1);\", LiveIn(\"usedInOuterTry\"), LiveOut(\"usedInOuterTry\"));\n        context.Validate(\"Method(2);\", LiveIn(\"usedInOuterTry\"), LiveOut(\"usedInOuterTry\"));\n        context.Validate(\"Method(3);\", LiveOut(\"usedInOuterTry\"));\n        context.Validate(\"Method(4);\", LiveIn(\"usedInOuterTry\"));\n        context.Validate(\"Method(5);\");\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void NestedFinally_LiveOut_NestedFinallyInOuterCatch()\n    {\n        const string code = \"\"\"\n            var usedInOuterFinally = 0;\n            Method(0);\n            try\n            {\n                Method(usedInOuterFinally);\n                Method(1);\n                try\n                {\n                    Method(2);\n                }\n                finally\n                {\n                    usedInOuterFinally = 2; // Compliant - used in outer finally\n                    Method(3);\n                }\n            }\n            catch\n            {\n                try\n                {\n                    Method(4);\n                }\n                finally\n                {\n                    Method(usedInOuterFinally);\n                    Method(5);\n                }\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"Method(0);\", LiveOut(\"usedInOuterFinally\"));\n        context.Validate(\"Method(1);\", LiveIn(\"usedInOuterFinally\"), LiveOut(\"usedInOuterFinally\"));\n        context.Validate(\"Method(2);\", LiveIn(\"usedInOuterFinally\"), LiveOut(\"usedInOuterFinally\"));\n        context.Validate(\"Method(3);\", LiveOut(\"usedInOuterFinally\"));\n        context.Validate(\"Method(4);\", LiveIn(\"usedInOuterFinally\"), LiveOut(\"usedInOuterFinally\"));\n        context.Validate(\"Method(5);\", LiveIn(\"usedInOuterFinally\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void NestedFinally_LiveOut_NestedFinallyInOuter_ConsecutiveCatch()\n    {\n        const string code = \"\"\"\n            var usedInOuterFinally = 0;\n            Method(0);\n            try\n            {\n                Method(usedInOuterFinally);\n                Method(1);\n                try\n                {\n                    Method(2);\n                }\n                finally\n                {\n                    usedInOuterFinally = 2; // Compliant - used in outer finally\n                    Method(3);\n                }\n            }\n            catch(NotImplementedException)\n            {\n                Method(4);\n            }\n            catch\n            {\n                try\n                {\n                    Method(5);\n                }\n                finally\n                {\n                    Method(6);\n                    Method(usedInOuterFinally);\n                }\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"Method(0);\", LiveOut(\"usedInOuterFinally\"));\n        context.Validate(\"Method(1);\", LiveIn(\"usedInOuterFinally\"), LiveOut(\"usedInOuterFinally\"));\n        context.Validate(\"Method(2);\", LiveIn(\"usedInOuterFinally\"), LiveOut(\"usedInOuterFinally\"));\n        context.Validate(\"Method(3);\", LiveOut(\"usedInOuterFinally\"));\n        context.Validate(\"Method(4);\");\n        context.Validate(\"Method(5);\", LiveIn(\"usedInOuterFinally\"), LiveOut(\"usedInOuterFinally\"));\n        context.Validate(\"Method(6);\", LiveIn(\"usedInOuterFinally\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void NestedFinally_LiveOutNestedFinallyInOuter_FinallyHasLocalLifetime()\n    {\n        const string code = \"\"\"\n            var usedInOuterFinally = 0;\n            Method(0);\n            try\n            {\n                Method(usedInOuterFinally);\n                Method(1);\n                try\n                {\n                    Method(2);\n                }\n                finally\n                {\n                    var t = usedInOuterFinally  > 1 ? 1 : 0; // This causes LocalLifetimeRegion to be generated\n                }\n            }\n            catch\n            {\n                try\n                {\n                    Method(4);\n                }\n                finally\n                {\n                    Method(5);\n                    Method(usedInOuterFinally);\n                }\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"Method(0);\", LiveOut(\"usedInOuterFinally\"));\n        context.Validate(\"Method(1);\", LiveIn(\"usedInOuterFinally\"), LiveOut(\"usedInOuterFinally\"));\n        context.Validate(\"Method(2);\", LiveIn(\"usedInOuterFinally\"), LiveOut(\"usedInOuterFinally\"));\n        context.Validate(\"t = usedInOuterFinally  > 1 ? 1 : 0\", LiveIn(\"usedInOuterFinally\"), LiveOut(\"usedInOuterFinally\"));\n        context.Validate(\"Method(4);\", LiveIn(\"usedInOuterFinally\"), LiveOut(\"usedInOuterFinally\"));\n        context.Validate(\"Method(5);\", LiveIn(\"usedInOuterFinally\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void Finally_ForEach_LiveIn()\n    {\n        const string code = \"\"\"\n            var outer = 42;\n            try\n            {\n                Method(0);\n                foreach (var arg in args)   // Produces implicit finally\n                {\n                }\n                // No action here, finally branch is crossing both regions\n            }\n            finally\n            {\n                Method(outer);\n            }\n            Method(1);\n            \"\"\";\n        var context = CreateContextCS(code, null, \"object[] args\");\n        context.ValidateEntry(LiveIn(\"args\"), LiveOut(\"args\"));\n        context.Validate(\"Method(0);\", LiveIn(\"outer\", \"args\"), LiveOut(\"outer\", \"args\"));\n        context.Validate(\"Method(outer);\", LiveIn(\"outer\"));\n        context.Validate(\"Method(1);\");\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void Finally_InvalidSyntax_LiveIn()\n    {\n        /*    Entry 0\n         *      |\n         *    Block 1\n         *    Method(0)\n         *    Method(intParameter)\n         *      |\n         *    Exit 2\n         */\n        const string code = \"\"\"\n            // Error CS1003 Syntax error, 'try' expected\n            // Error CS1514 { expected\n            // Error CS1513 } expected\n            finally\n            {\n                Method(0);\n            }\n            Method(intParameter);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"intParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"Method(0);\", LiveIn(\"intParameter\"));\n        context.Validate(\"Method(intParameter);\", LiveIn(\"intParameter\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void Finally_Loop_Propagates_LiveIn_LiveOut()\n    {\n        const string code = \"\"\"\n            A:\n            Method(intParameter);\n            if (boolParameter)\n                goto B;\n            try\n            {\n                Method(0);\n            }\n            finally\n            {\n                Method(1);\n            }\n            goto A;\n            B:\n            Method(2);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\", \"intParameter\"), LiveOut(\"boolParameter\", \"intParameter\"));\n        context.Validate(\"Method(intParameter);\", LiveIn(\"boolParameter\", \"intParameter\"), LiveOut(\"boolParameter\", \"intParameter\"));\n        context.Validate(\"Method(0);\", LiveIn(\"boolParameter\", \"intParameter\"), LiveOut(\"boolParameter\", \"intParameter\"));\n        context.Validate(\"Method(1);\", LiveIn(\"boolParameter\", \"intParameter\"), LiveOut(\"boolParameter\", \"intParameter\"));\n        context.Validate(\"Method(2);\");\n    }\n\n    [TestMethod]\n    public void Finally_Loop_Propagates_FinallyHasLocalLifetimeRegion_LiveIn_LiveOut()\n    {\n        const string code = \"\"\"\n            A:\n            Method(intParameter);\n            if (boolParameter)\n                goto B;\n            try\n            {\n                Method(0);\n            }\n            finally\n            {\n                var t = true || true; // This causes LocalLivetimeRegion to be generated\n                Method(1);\n            }\n            goto A;\n            B:\n            Method(2);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\", \"intParameter\"), LiveOut(\"boolParameter\", \"intParameter\"));\n        context.Validate(\"Method(intParameter);\", LiveIn(\"boolParameter\", \"intParameter\"), LiveOut(\"boolParameter\", \"intParameter\"));\n        context.Validate(\"Method(0);\", LiveIn(\"boolParameter\", \"intParameter\"), LiveOut(\"boolParameter\", \"intParameter\"));\n        context.Validate(\"Method(1);\", LiveIn(\"boolParameter\", \"intParameter\"), LiveOut(\"boolParameter\", \"intParameter\"));\n        context.Validate(\"Method(2);\");\n    }\n\n    [TestMethod]\n    public void Finally_AssignedInTry_LiveOut()\n    {\n        const string code = \"\"\"\n            int variable = 42;\n            Method(0);\n            try\n            {\n                Method(1);  // Can throw\n                variable = 0;\n            }\n            finally\n            {\n                Method(variable);\n            }\n            Method(2);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"Method(0);\", LiveOut(\"variable\"));\n        context.Validate(\"Method(1);\", LiveOut(\"variable\"));\n        context.Validate(\"Method(variable);\", LiveIn(\"variable\"));\n        context.Validate(\"Method(2);\");\n    }\n\n    [TestMethod]\n    public void TryCatchFinally_LiveIn()\n    {\n        const string code = \"\"\"\n            var usedInTry = 42;\n            var usedInCatch = 42;\n            var usedInFinally = 42;\n            var usedAfter = 42;\n            try\n            {\n                Method(usedInTry);\n            }\n            catch\n            {\n                Method(usedInCatch);\n            }\n            finally\n            {\n                Method(usedInFinally);\n            }\n            Method(usedAfter);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"Method(usedInTry);\", LiveIn(\"usedInTry\", \"usedInCatch\", \"usedInFinally\", \"usedAfter\"), LiveOut(\"usedInCatch\", \"usedInFinally\", \"usedAfter\"));\n        context.Validate(\"Method(usedInCatch);\", LiveIn(\"usedInCatch\", \"usedInFinally\", \"usedAfter\"), LiveOut(\"usedInFinally\", \"usedAfter\"));\n        context.Validate(\"Method(usedInFinally);\", LiveIn(\"usedInFinally\", \"usedAfter\"), LiveOut(\"usedAfter\"));\n        context.Validate(\"Method(usedAfter);\", LiveIn(\"usedAfter\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void TryCatchFinally_Rethrow_ValueLivesOut()\n    {\n        const string code = \"\"\"\n            var value = 0;\n            try\n            {\n                Method(0);\n                value = 42;\n            }\n            catch\n            {\n                Method(value);\n                value = 1;\n                throw;\n            }\n            finally\n            {\n                Method(value + 1);\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"value = 1;\", LiveIn(\"value\"), LiveOut(\"value\"));\n        context.Validate(\"Method(value + 1);\", LiveIn(\"value\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void TryCatchFinally_Rethrow_ValueLivesOut_FinallyHasLocalLifetimeRegion()\n    {\n        const string code = \"\"\"\n            var value = 0;\n            try\n            {\n            }\n            catch\n            {\n                value = 1;\n                throw;\n            }\n            finally\n            {\n                var local = \"\"; // This causes LocalLifetimeRegion to be generated\n                Method(value + 1);\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"value = 1;\", LiveOut(\"value\"));\n        context.Validate(\"Method(value + 1);\", LiveIn(\"value\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void TryCatchFinally_RethrowOuterFinally()\n    {\n        const string code = \"\"\"\n            var value = 0;\n            try\n            {\n               Method(0);\n               try\n               {\n                   Method(0);\n                   value = 42;\n               }\n               catch\n               {\n                   Method(value);\n                   value = 2;\n                   throw;\n               }\n            }\n            finally\n            {\n               Method(value + 1);\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"value = 2;\", LiveIn(\"value\"), LiveOut(\"value\"));\n        context.Validate(\"Method(value + 1);\", LiveIn(\"value\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void TryCatchFinally_RethrowOuterCatchFinally()\n    {\n        const string code = \"\"\"\n            var value = 0;\n            try\n            {\n               Method(0);\n               try\n               {\n                   Method(1);\n                   value = 42;\n               }\n               catch\n               {\n                   value = 2;\n                   throw;\n               }\n            }\n            catch\n            {\n               Method(2);\n            }\n            finally\n            {\n               Method(value + 1);\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"value = 2;\", LiveOut(\"value\"));\n        context.Validate(\"Method(2);\", LiveIn(\"value\"), LiveOut(\"value\"));\n        context.Validate(\"Method(value + 1);\", LiveIn(\"value\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void TryCatchFinally_RethrowOuterCatchRethrowFinally()\n    {\n        const string code = \"\"\"\n            var value = 0;\n            try\n            {\n               Method(0);\n               try\n               {\n                   Method(1);\n                   value = 42;\n               }\n               catch\n               {\n                   value = 2;\n                   throw;\n               }\n            }\n            catch\n            {\n               Method(2);\n               throw;\n            }\n            finally\n            {\n               Method(value + 1);\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"value = 2;\", LiveOut(\"value\"));\n        context.Validate(\"Method(2);\", LiveIn(\"value\"), LiveOut(\"value\"));\n        context.Validate(\"Method(value + 1);\", LiveIn(\"value\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void TryCatchFinally_RethrowCatchRethrowOuterFinally()\n    {\n        const string code = \"\"\"\n            var value = 0;\n            try\n            {\n                Method(0);\n                try\n                {\n                   Method(1);\n                   value = 42;\n                }\n                catch\n                {\n                   value = 2;\n                   throw;\n                }\n                finally\n                {\n                   Method(value + 1);\n                }\n            }\n            finally\n            {\n               Method(value + 2);\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"value = 2;\", LiveOut(\"value\"));\n        context.Validate(\"Method(value + 1);\", LiveIn(\"value\"), LiveOut(\"value\"));\n        context.Validate(\"Method(value + 2);\", LiveIn(\"value\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void TryCatchFinally_ConsecutiveCatchAllThrowRethrowFinally()\n    {\n        const string code = \"\"\"\n            var value = 0;\n            try\n            {\n                Method(0);\n                value = 42;\n            }\n            catch (IOException)\n            {\n                Method(value);\n                value = 1;\n                throw;\n            }\n            catch\n            {\n                Method(value);\n                value = 2;\n                throw;\n            }\n            finally\n            {\n                Method(value + 1);\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"value = 1;\", LiveIn(\"value\"), LiveOut(\"value\"));\n        context.Validate(\"value = 2;\", LiveIn(\"value\"), LiveOut(\"value\"));\n        context.Validate(\"Method(value + 1);\", LiveIn(\"value\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void TryCatchFinally_ConsecutiveCatchRethrow()\n    {\n        const string code = \"\"\"\n            var value = 0;\n            try\n            {\n                Method(0);\n                value = 42;\n            }\n            catch (IOException)\n            {\n                Method(value);\n                value = 1;\n                throw;\n            }\n            catch (ArgumentNullException)\n            {\n                Method(value + 1);\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"value = 1;\", LiveIn(\"value\"));\n        context.Validate(\"Method(value + 1);\", LiveIn(\"value\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void TryCatchFinally_FilteredCatchRethrowFinally()\n    {\n        const string code = \"\"\"\n            var value = 0;\n            try\n            {\n                Method(0);\n                value = 42;\n            }\n            catch (IOException)\n            {\n                Method(value);\n                value = 1;\n                throw;\n            }\n            finally\n            {\n                Method(value + 1);\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"value = 1;\", LiveIn(\"value\"), LiveOut(\"value\"));\n        context.Validate(\"Method(value + 1);\", LiveIn(\"value\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void TryCatchFinally_MultipleFilteredCatchRethrowFinally()\n    {\n        const string code = \"\"\"\n            var value = 0;\n            try\n            {\n                Method(0);\n                value = 42;\n            }\n            catch (IOException)\n            {\n                Method(value);\n                value = 1;\n                throw;\n            }\n            catch (ArgumentException)\n            {\n                Method(value);\n                value = 2;\n                throw;\n            }\n            finally\n            {\n                Method(value + 1);\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"value = 1;\", LiveIn(\"value\"), LiveOut(\"value\"));\n        context.Validate(\"value = 2;\", LiveIn(\"value\"), LiveOut(\"value\"));\n        context.Validate(\"Method(value + 1);\", LiveIn(\"value\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void TryCatchFinally_MultipleFilteredCatchNewThrowFinally()\n    {\n        const string code = \"\"\"\n            var value = 0;\n            try\n            {\n                Method(0);\n                value = 42;\n            }\n            catch (IOException ex)\n            {\n                Method(value);\n                value = 1;\n                throw new Exception(\"Message\", ex);\n            }\n            catch (ArgumentException)\n            {\n                Method(value);\n                value = 2;\n                throw;\n            }\n            finally\n            {\n                Method(value + 1);\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"value = 1;\", LiveIn(\"value\"), LiveOut(\"value\"));\n        context.Validate(\"value = 2;\", LiveIn(\"value\"), LiveOut(\"value\"));\n        context.Validate(\"Method(value + 1);\", LiveIn(\"value\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void Throw_NestedCatch_LiveInInConsecutiveOuterCatchFinally()\n    {\n        const string code = \"\"\"\n            var value = 100;\n            try\n            {\n                try\n                {\n                     Method(value);\n                     Method(0);\n                }\n                catch\n                {\n                    value = 200;\n                    throw;\n                }\n            }\n            catch (ArgumentNullException)\n            {\n                Method(value);\n                Method(1);\n            }\n            catch (IOException)\n            {\n                Method(value);\n                Method(2);\n            }\n            catch (NullReferenceException)\n            {\n                Method(value);\n                Method(3);\n            }\n            finally\n            {\n                Method(value + 1);\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"Method(0);\", LiveIn(\"value\"), LiveOut(\"value\"));\n        context.Validate(\"value = 200;\", LiveOut(\"value\"));\n        context.Validate(\"Method(1);\", LiveIn(\"value\"), LiveOut(\"value\"));\n        context.Validate(\"Method(2);\", LiveIn(\"value\"), LiveOut(\"value\"));\n        context.Validate(\"Method(3);\", LiveIn(\"value\"), LiveOut(\"value\"));\n        context.Validate(\"Method(value + 1);\", LiveIn(\"value\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void Throw_NestedCatch_OuterCatchRethrows_LiveOutOuterCatchFinally()\n    {\n        const string code = \"\"\"\n            var value = 100;\n            try\n            {\n                try\n                {\n                    try\n                    {\n                        Method(value);\n                        Method(0);\n                    }\n                    catch\n                    {\n                        value = 200;\n                        throw;\n                    }\n                }\n                catch   // Outer catch\n                {\n                    Method(value);\n                    Method(1);\n                    throw;\n                }\n            }\n            catch\n            {\n                Method(value);\n                Method(2);\n            }\n            finally\n            {\n                Method(value + 1);\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"Method(0);\", LiveIn(\"value\"), LiveOut(\"value\"));\n        context.Validate(\"value = 200;\", LiveOut(\"value\"));\n        context.Validate(\"Method(1);\", LiveIn(\"value\"), LiveOut(\"value\"));\n        context.Validate(\"Method(2);\", LiveIn(\"value\"), LiveOut(\"value\"));\n        context.Validate(\"Method(value + 1);\", LiveIn(\"value\"));\n        context.ValidateExit();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/LiveVariableAnalysis/RoslynLiveVariableAnalysisTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing SonarAnalyzer.CFG;\nusing SonarAnalyzer.CFG.LiveVariableAnalysis;\nusing SonarAnalyzer.CFG.Roslyn;\nusing SonarAnalyzer.CFG.Syntax.Utilities;\nusing SonarAnalyzer.CSharp.Core.Syntax.Extensions;\nusing SonarAnalyzer.CSharp.Core.Syntax.Utilities;\nusing SonarAnalyzer.VisualBasic.Core.Syntax.Utilities;\n\nnamespace SonarAnalyzer.Test.LiveVariableAnalysis;\n\n[TestClass]\npublic partial class RoslynLiveVariableAnalysisTest\n{\n    private enum ExpectedKind\n    {\n        None,\n        LiveIn,\n        LiveOut,\n        Captured\n    }\n\n    [TestMethod]\n    public void WriteOnly()\n    {\n        var code = \"\"\"\n            int a = 1;\n            var b = Method(0);\n            var c = 2 + 3;\n            \"\"\";\n        CreateContextCS(code).ValidateAllEmpty();\n    }\n\n    [TestMethod]\n    public void ProcessParameterReference_LiveIn()\n    {\n        var code = \"\"\"\n            Method(intParameter);\n            IsMethod(boolParameter);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"intParameter\", \"boolParameter\"), LiveOut(\"intParameter\", \"boolParameter\"));\n        context.Validate(\"Method(intParameter);\", LiveIn(\"intParameter\", \"boolParameter\"));\n    }\n\n    [TestMethod]\n    public void ProcessParameterReference_UsedAsOutArgument_NotLiveIn_NotLiveOut()\n    {\n        var code = \"Main(true, 0, out outParameter, ref refParameter);\";\n        var context = CreateContextCS(code, additionalParameters: \"out int outParameter, ref int refParameter\");\n        context.ValidateEntry(LiveIn(\"refParameter\"), LiveOut(\"refParameter\"));\n        context.Validate(code, LiveIn(\"refParameter\"));\n    }\n\n    [TestMethod]\n    public void ProcessParameterReference_InNameOf_NotLiveIn_NotLiveOut()\n    {\n        var code = \"Method(nameof(intParameter));\";\n        CreateContextCS(code).ValidateAllEmpty();\n    }\n\n    [TestMethod]\n    public void ProcessParameterReference_Assigned_NotLiveIn_LiveOut()\n    {\n        var code = \"\"\"\n            intParameter = 42;\n            if (boolParameter)\n                return;\n            Method(intParameter);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\"), LiveOut(\"boolParameter\"));\n        context.Validate(\"Method(intParameter);\", LiveIn(\"intParameter\"));\n    }\n\n    [TestMethod]\n    public void ProcessParameterReference_MemberBinding_LiveIn()\n    {\n        var code = \"Method(intParameter.ToString());\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"intParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"Method(intParameter.ToString());\", LiveIn(\"intParameter\"));\n    }\n\n    [TestMethod]\n    public void ProcessParameterReference_MemberBindingByReference_LiveIn()\n    {\n        var code = \"Capturing(intParameter.CompareTo);\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"intParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"Capturing(intParameter.CompareTo);\", LiveIn(\"intParameter\"));\n    }\n\n    [TestMethod]\n    public void ProcessParameterReference_MemberBindingByReference_DifferentCfgOnNetFx_LiveIn()\n    {\n        // This specific char/string scenario produces different CFG shape under .NET Framework build. We have a syntax-based solution in place to support it.\n        // https://github.com/dotnet/roslyn/issues/56644\n        var code = \"\"\"\n            char[] charArray = null;\n            var ret = false;\n            var stringVariable = \"Lorem Ipsum\";\n            if (boolParameter)\n                ret = charArray.Any(stringVariable.Contains);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\"), LiveOut(\"boolParameter\"));\n        context.Validate(\"ret = charArray.Any(stringVariable.Contains);\", LiveIn(\"charArray\", \"stringVariable\"));\n    }\n\n    [TestMethod]\n    public void ProcessParameterReference_Reassigned_LiveIn()\n    {\n        var code = \"\"\"\n            intParameter = intParameter + 42;\n            stringParameter = stringParameter.Replace('a', 'b');\n            Method(intParameter);\n            Method(stringParameter);\n            \"\"\";\n        var context = CreateContextCS(code, additionalParameters: \"string stringParameter\");\n\n        context.ValidateEntry(LiveIn(\"intParameter\", \"stringParameter\"), LiveOut(\"intParameter\", \"stringParameter\"));\n        context.Validate(\"Method(intParameter);\", LiveIn(\"intParameter\", \"stringParameter\"));\n    }\n\n    [TestMethod]\n    public void ProcessParameterReference_SelfAssigned_LiveIn()\n    {\n        var code = \"\"\"\n            intParameter = intParameter;\n            Method(intParameter);\n            \"\"\";\n        var context = CreateContextCS(code);\n\n        context.ValidateEntry(LiveIn(\"intParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"Method(intParameter);\", LiveIn(\"intParameter\"));\n    }\n\n    [TestMethod]\n    public void UsedAfterBranch_LiveOut()\n    {\n        /*       Binary\n         *       /   \\\n         *    Jump   Simple\n         *   return  Method()\n         *       \\   /\n         *        Exit\n         */\n        var code = \"\"\"\n            if (boolParameter)\n                return;\n            Method(intParameter);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\", \"intParameter\"), LiveOut(\"boolParameter\", \"intParameter\"));\n        context.Validate(\"boolParameter\", LiveIn(\"boolParameter\", \"intParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"Method(intParameter);\", LiveIn(\"intParameter\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    [DataRow(\"Capturing(x => field + variable + intParameter);\", DisplayName = \"SimpleLambda\")]\n    [DataRow(\"Capturing((x) => field + variable + intParameter);\", DisplayName = \"ParenthesizedLambda\")]\n    [DataRow(\"Capturing(x => { Func<int> xxx = () => field + variable + intParameter; return xxx();});\", DisplayName = \"NestedLambda\")]\n    [DataRow(\"VoidDelegate d = delegate { Method(field + variable + intParameter);};\", DisplayName = \"AnonymousMethod\")]\n    [DataRow(\"var items = from xxx in new int[] { 42, 100 } where xxx > field + variable + intParameter select xxx;\", DisplayName = \"Query\")]\n    public void Captured_NotLiveIn_NotLiveOut(string capturingStatement)\n    {\n        /*       Entry\n         *         |\n         *       Block 1\n         *       /   \\\n         *      |   Block 2\n         *      |   Method()\n         *       \\   /\n         *        Exit\n         */\n        var code = $\"\"\"\n            var variable = 42;\n            {capturingStatement}\n            if (boolParameter)\n                return;\n            Method(field, variable, intParameter);\n            \"\"\";\n        capturingStatement.Should().Contain(\"field + variable + intParameter\");\n        var context = CreateContextCS(code);\n        var expectedCaptured = Captured(\"variable\", \"intParameter\");\n        context.ValidateEntry(expectedCaptured, LiveIn(\"boolParameter\"), LiveOut(\"boolParameter\"));\n        context.Validate(\"boolParameter\", expectedCaptured, LiveIn(\"boolParameter\"));\n        context.Validate(\"Method(field, variable, intParameter);\", expectedCaptured);\n        context.ValidateExit(expectedCaptured);\n    }\n\n    [TestMethod]\n    public void Captured_StaticLambda_NotLiveIn_NotLiveOut()\n    {\n        var code = \"\"\"\n            Capturing(static x => x + 2);\n            if (boolParameter)\n                return;\n            Method(0);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\"), LiveOut(\"boolParameter\"));\n        context.Validate(\"boolParameter\", LiveIn(\"boolParameter\"));\n        context.Validate(\"Method(0);\");\n    }\n\n    [TestMethod]\n    public void Assigned_NotLiveIn_NotLiveOut()\n    {\n        /*       Entry\n         *         |\n         *       Block 1\n         *       boolParameter\n         *       /   \\\n         *      |   Block 2\n         *      |   intParameter=0\n         *       \\   /\n         *        Exit\n         */\n        var code = \"\"\"\n            if (boolParameter)\n                return;\n            intParameter = 0;\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\"), LiveOut(\"boolParameter\"));\n        context.Validate(\"boolParameter\", LiveIn(\"boolParameter\"));\n        context.Validate(\"intParameter = 0;\");\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void LongPropagationChain_LiveIn_LiveOut()\n    {\n        /*    Entry\n         *      |\n         *    Block 1 -------+\n         *    declare        |\n         *      |            |\n         *    Block 2 ------+|\n         *    use & assign  ||\n         *      |           ||\n         *    Block 3 -----+||\n         *    assign       |||\n         *      |          vvv\n         *    Block 4 ---> Exit\n         *    use\n         */\n        var code = \"\"\"\n            var value = 0;\n            if (boolParameter)\n                return;\n            Method(value);\n            value = 1;\n            if (boolParameter)\n                return;\n            value = 42;\n            if (boolParameter)\n                return;\n            Method(intParameter, value);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\", \"intParameter\"), LiveOut(\"boolParameter\", \"intParameter\"));\n        context.Validate(\"value = 0\", LiveIn(\"boolParameter\", \"intParameter\"), LiveOut(\"boolParameter\", \"intParameter\", \"value\"));\n        context.Validate(\"Method(value);\", LiveIn(\"boolParameter\", \"intParameter\", \"value\"), LiveOut(\"boolParameter\", \"intParameter\"));\n        context.Validate(\"value = 42;\", LiveIn(\"boolParameter\", \"intParameter\"), LiveOut(\"value\", \"intParameter\"));\n        context.Validate(\"Method(intParameter, value);\", LiveIn(\"value\", \"intParameter\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void BranchedPropagationChain_LiveIn_LiveOut_CS()\n    {\n        /*              Binary\n         *              boolParameter\n         *              /           \\\n         *             /             \\\n         *            /               \\\n         *       Binary             Binary\n         *       firstBranch        secondBranch\n         *       /      \\              /      \\\n         *      /        \\            /        \\\n         *  Simple     Simple      Simple      Simple\n         *  firstTrue  firstFalse  secondTrue  secondFalse\n         *      \\        /            \\        /\n         *       \\      /              \\      /\n         *        Simple                Simple\n         *        first                 second\n         *             \\               /\n         *              \\             /\n         *                  Simple\n         *                  reassigned\n         *                  everywhere\n         */\n        var code = \"\"\"\n            var everywhere = 42;\n            var reassigned = 42;\n            var first = 42;\n            var firstTrue = 42;\n            var firstFalse = 42;\n            var second = 42;\n            var secondTrue = 42;\n            var secondFalse = 42;\n            var firstCondition = boolParameter;\n            var secondCondition = boolParameter;\n            if (boolParameter)\n            {\n                if (firstCondition)\n                {\n                    Method(firstTrue);\n                }\n                else\n                {\n                    Method(firstFalse);\n                }\n                Method(first);\n            }\n            else\n            {\n                if (secondCondition)\n                {\n                    Method(secondTrue);\n                }\n                else\n                {\n                    Method(secondFalse);\n                }\n                Method(second);\n            }\n            reassigned = 0;\n            Method(everywhere, reassigned);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.Validate(\n            \"everywhere = 42\",\n            LiveIn(\"boolParameter\"),\n            LiveOut(\"everywhere\", \"firstCondition\", \"firstTrue\", \"firstFalse\", \"first\", \"secondCondition\", \"secondTrue\", \"secondFalse\", \"second\"));\n        // First block\n        context.Validate(\n            \"firstCondition\",\n            LiveIn(\"everywhere\", \"firstCondition\", \"firstTrue\", \"firstFalse\", \"first\"),\n            LiveOut(\"everywhere\", \"firstTrue\", \"firstFalse\", \"first\"));\n        context.Validate(\n            \"Method(firstTrue);\",\n            LiveIn(\"everywhere\", \"firstTrue\", \"first\"),\n            LiveOut(\"everywhere\", \"first\"));\n        context.Validate(\n            \"Method(firstFalse);\",\n            LiveIn(\"everywhere\", \"firstFalse\", \"first\"),\n            LiveOut(\"everywhere\", \"first\"));\n        context.Validate(\n            \"Method(first);\",\n            LiveIn(\"everywhere\", \"first\"),\n            LiveOut(\"everywhere\"));\n        // Second block\n        context.Validate(\n            \"secondCondition\",\n            LiveIn(\"everywhere\", \"secondCondition\", \"secondTrue\", \"secondFalse\", \"second\"),\n            LiveOut(\"everywhere\", \"secondTrue\", \"secondFalse\", \"second\"));\n        context.Validate(\n            \"Method(secondTrue);\",\n            LiveIn(\"everywhere\", \"secondTrue\", \"second\"),\n            LiveOut(\"everywhere\", \"second\"));\n        context.Validate(\n            \"Method(secondFalse);\",\n            LiveIn(\"everywhere\", \"secondFalse\", \"second\"),\n            LiveOut(\"everywhere\", \"second\"));\n        context.Validate(\n            \"Method(second);\",\n            LiveIn(\"everywhere\", \"second\"),\n            LiveOut(\"everywhere\"));\n        // Common end\n        context.Validate(\"Method(everywhere, reassigned);\", LiveIn(\"everywhere\"));\n    }\n\n    [TestMethod]\n    public void BranchedPropagationChain_LiveIn_LiveOut_VB()\n    {\n        /*              Binary\n         *              boolParameter\n         *              /           \\\n         *             /             \\\n         *            /               \\\n         *       Binary             Binary\n         *       firstBranch        secondBranch\n         *       /      \\              /      \\\n         *      /        \\            /        \\\n         *  Simple     Simple      Simple      Simple\n         *  firstTrue  firstFalse  secondTrue  secondFalse\n         *      \\        /            \\        /\n         *       \\      /              \\      /\n         *        Simple                Simple\n         *        first                 second\n         *             \\               /\n         *              \\             /\n         *                  Simple\n         *                  reassigned\n         *                  everywhere\n         */\n        var code = \"\"\"\n            Dim Everywhere As Integer = 42\n            Dim Reassigned As Integer = 42\n            Dim First As Integer = 42\n            Dim FirstTrue As Integer = 42\n            Dim FirstFalse As Integer = 42\n            Dim Second As Integer = 42\n            Dim SecondTrue As Integer = 42\n            Dim SecondFalse As Integer = 42\n            Dim FirstCondition As Boolean = BoolParameter\n            Dim SecondCondition As Boolean = BoolParameter\n            If BoolParameter Then\n                If (FirstCondition) Then\n                    Method(FirstTrue)\n                Else\n                    Method(FirstFalse)\n                End If\n                Method(First)\n            Else\n                If SecondCondition Then\n                    Method(SecondTrue)\n                Else\n                    Method(SecondFalse)\n                End If\n                Method(Second)\n            End If\n            Reassigned = 0\n            Method(Everywhere, Reassigned)\n            \"\"\";\n        var context = CreateContextVB(code);\n        context.Validate(\n            \"Everywhere As Integer = 42\",\n            LiveIn(\"BoolParameter\"),\n            LiveOut(\"Everywhere\", \"FirstCondition\", \"FirstTrue\", \"FirstFalse\", \"First\", \"SecondCondition\", \"SecondTrue\", \"SecondFalse\", \"Second\"));\n        // First block\n        context.Validate(\n            \"FirstCondition\",\n            LiveIn(\"Everywhere\", \"FirstCondition\", \"FirstTrue\", \"FirstFalse\", \"First\"),\n            LiveOut(\"Everywhere\", \"FirstTrue\", \"FirstFalse\", \"First\"));\n        context.Validate(\n            \"Method(FirstTrue)\",\n            LiveIn(\"Everywhere\", \"FirstTrue\", \"First\"),\n            LiveOut(\"Everywhere\", \"First\"));\n        context.Validate(\n            \"Method(FirstFalse)\",\n            LiveIn(\"Everywhere\", \"FirstFalse\", \"First\"),\n            LiveOut(\"Everywhere\", \"First\"));\n        context.Validate(\n            \"Method(First)\",\n            LiveIn(\"Everywhere\", \"First\"),\n            LiveOut(\"Everywhere\"));\n        // Second block\n        context.Validate(\n            \"SecondCondition\",\n            LiveIn(\"Everywhere\", \"SecondCondition\", \"SecondTrue\", \"SecondFalse\", \"Second\"),\n            LiveOut(\"Everywhere\", \"SecondTrue\", \"SecondFalse\", \"Second\"));\n        context.Validate(\n            \"Method(SecondTrue)\",\n            LiveIn(\"Everywhere\", \"SecondTrue\", \"Second\"),\n            LiveOut(\"Everywhere\", \"Second\"));\n        context.Validate(\n            \"Method(SecondFalse)\",\n            LiveIn(\"Everywhere\", \"SecondFalse\", \"Second\"),\n            LiveOut(\"Everywhere\", \"Second\"));\n        context.Validate(\n            \"Method(Second)\",\n            LiveIn(\"Everywhere\", \"Second\"),\n            LiveOut(\"Everywhere\"));\n        // Common end\n        context.Validate(\"Method(Everywhere, Reassigned)\", LiveIn(\"Everywhere\"));\n    }\n\n    [TestMethod]\n    public void ProcessBlockInternal_EvaluationOrder_UsedBeforeAssigned_LiveIn()\n    {\n        var code = \"\"\"\n            var variable = 42;\n            if (boolParameter)\n                return;\n            Method(variable, variable = 42);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\"), LiveOut(\"boolParameter\"));\n        context.Validate(\"Method(variable, variable = 42);\", LiveIn(\"variable\"));\n    }\n\n    [TestMethod]\n    public void ProcessBlockInternal_EvaluationOrder_UsedBeforeAssignedInSubexpression_LiveIn()\n    {\n        var code = \"\"\"\n            var variable = 42;\n            if (boolParameter)\n                return;\n            Method(1 + 1 + Method(variable), variable = 42);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\"), LiveOut(\"boolParameter\"));\n        context.Validate(\"Method(1 + 1 + Method(variable), variable = 42);\", LiveIn(\"variable\"));\n    }\n\n    [TestMethod]\n    public void ProcessBlockInternal_EvaluationOrder_AssignedBeforeUsed_NotLiveIn()\n    {\n        var code = \"\"\"\n            var variable = 42;\n            if (boolParameter)\n                return;\n            Method(variable = 42, variable);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\"), LiveOut(\"boolParameter\"));\n        context.Validate(\"Method(variable = 42, variable);\");\n    }\n\n    [TestMethod]\n    public void ProcessBlockInternal_EvaluationOrder_AssignedBeforeUsedInSubexpression_NotLiveIn()\n    {\n        var code = \"\"\"\n            var variable = 42;\n            if (boolParameter)\n                return;\n            Method(variable = 42, 1 + 1 + Method(variable));\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\"), LiveOut(\"boolParameter\"));\n        context.Validate(\"Method(variable = 42, 1 + 1 + Method(variable));\");\n    }\n\n    [TestMethod]\n    public void ProcessLocalReference_InNameOf_NotLiveIn_NotLiveOut()\n    {\n        var code = \"\"\"\n            var variable = 42;\n            if (boolParameter)\n                return;\n            Method(nameof(variable));\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\"), LiveOut(\"boolParameter\"));\n        context.Validate(\"Method(nameof(variable));\");\n    }\n\n    [TestMethod]\n    public void ProcessLocalReference_LocalScopeSymbol_LiveIn()\n    {\n        var code = \"\"\"\n            var variable = 42;\n            if (boolParameter)\n                return;\n            Method(intParameter, variable);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\", \"intParameter\"), LiveOut(\"boolParameter\", \"intParameter\"));\n        context.Validate(\"Method(intParameter, variable);\", LiveIn(\"intParameter\", \"variable\"));\n    }\n\n    [TestMethod]\n    public void ProcessLocalReference_ReassignedBeforeLastBlock_LiveIn()\n    {\n        var code = \"\"\"\n            var variable = 0;\n            variable = 42;\n            if (boolParameter)\n                return;\n            Method(intParameter, variable);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\", \"intParameter\"), LiveOut(\"boolParameter\", \"intParameter\"));\n        context.Validate(\"Method(intParameter, variable);\", LiveIn(\"intParameter\", \"variable\"));\n    }\n\n    [TestMethod]\n    public void ProcessLocalReference_ReassignedInLastBlock_NotLiveIn()\n    {\n        var code = \"\"\"\n            var variable = 0;\n            if (boolParameter)\n                return;\n            variable = 42;\n            Method(intParameter, variable);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\", \"intParameter\"), LiveOut(\"boolParameter\", \"intParameter\"));\n        context.Validate(\"Method(intParameter, variable);\", LiveIn(\"intParameter\"));\n    }\n\n    [TestMethod]\n    public void ProcessLocalReference_GlobalScopeSymbol_NotLiveIn_NotLiveOut()\n    {\n        var code = \"\"\"\n            var s = new Sample();\n            Method(field, s.Property);\n            \"\"\";\n        CreateContextCS(code).ValidateAllEmpty();\n    }\n\n    [TestMethod]\n    public void ProcessLocalReference_UndefinedSymbol_NotLiveIn_NotLiveOut()\n    {\n        var code = \"\"\"Method(undefined); // Error CS0103 The name 'undefined' does not exist in the current context\"\"\";\n        CreateContextCS(code).ValidateAllEmpty();\n    }\n\n    [TestMethod]\n    public void ProcessLocalReference_UsedAsOutArgument_NotLiveIn()\n    {\n        var code = \"\"\"\n            var refVariable = 42;\n            var outVariable = 42;\n            outParameter = 0;\n            if (boolParameter)\n                return;\n            Main(true, 0, out outVariable, ref refVariable);\n            \"\"\";\n        var context = CreateContextCS(code, additionalParameters: \"out int outParameter, ref int refParameter\");\n        context.ValidateEntry(LiveIn(\"boolParameter\"), LiveOut(\"boolParameter\"));\n        context.Validate(\"Main(true, 0, out outVariable, ref refVariable);\", LiveIn(\"refVariable\"));\n    }\n\n    [TestMethod]\n    public void ProcessLocalReference_NotAssigned_LiveIn_LiveOut()\n    {\n        var code = \"\"\"\n            var variable = intParameter;\n            if (boolParameter)\n                return;\n            Method(variable, intParameter);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\", \"intParameter\"), LiveOut(\"boolParameter\", \"intParameter\"));\n        context.Validate(\"variable = intParameter\", LiveIn(\"intParameter\", \"boolParameter\"), LiveOut(\"variable\", \"intParameter\"));\n        context.Validate(\"Method(variable, intParameter);\", LiveIn(\"variable\", \"intParameter\"));\n    }\n\n    [TestMethod]\n    public void ProcessLocalReference_VariableDeclarator_NotLiveIn_LiveOut()\n    {\n        var code = \"\"\"\n            int intValue = 42;\n            var varValue = 42;\n            if (intValue == 0)\n                Method(intValue, varValue);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"intValue = 42\", LiveOut(\"intValue\", \"varValue\"));\n        context.Validate(\"Method(intValue, varValue);\", LiveIn(\"intValue\", \"varValue\"));\n    }\n\n    [TestMethod]\n    public void ProcessLocalReference_MemberBinding_LiveIn()\n    {\n        var code = \"\"\"\n            var variable = 42;\n            if (boolParameter)\n                Method(variable.ToString());\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\"), LiveOut(\"boolParameter\"));\n        context.Validate(\"Method(variable.ToString());\", LiveIn(\"variable\"));\n    }\n\n    [TestMethod]\n    public void ProcessLocalReference_MemberBindingByReference_LiveIn()\n    {\n        var code = \"\"\"\n            var variable = 42;\n            if (boolParameter)\n                Capturing(variable.CompareTo);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\"), LiveOut(\"boolParameter\"));\n        context.Validate(\"Capturing(variable.CompareTo);\", LiveIn(\"variable\"));\n    }\n\n    [TestMethod]\n    public void ProcessLocalReference_Reassigned_LiveIn()\n    {\n        var code = \"\"\"\n            var intVariable = 40;\n            var stringVariable = \"Lorem Ipsum\";\n            if (boolParameter)\n                return;\n            intVariable = intVariable + 2;\n            stringVariable = stringVariable.Replace('a', 'b');\n            Method(intVariable);\n            Method(stringVariable);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\"), LiveOut(\"boolParameter\"));\n        context.Validate(\"boolParameter\", LiveIn(\"boolParameter\"), LiveOut(\"intVariable\", \"stringVariable\"));\n        context.Validate(\"Method(intVariable);\", LiveIn(\"intVariable\", \"stringVariable\"));\n    }\n\n    [TestMethod]\n    public void ProcessLocalReference_SelfAssigned_LiveIn()\n    {\n        var code = \"\"\"\n            var intVariable = 42;\n            if (boolParameter)\n                return;\n            intVariable = intVariable;\n            Method(intVariable);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\"), LiveOut(\"boolParameter\"));\n        context.Validate(\"boolParameter\", LiveIn(\"boolParameter\"), LiveOut(\"intVariable\"));\n        context.Validate(\"Method(intVariable);\", LiveIn(\"intVariable\"));\n    }\n\n    [TestMethod]\n    public void ProcessSimpleAssignment_Discard_NotLiveIn_NotLiveOut()\n    {\n        var code = \"\"\"_ = intParameter;\"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"intParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"_ = intParameter;\", LiveIn(\"intParameter\"));\n    }\n\n    [TestMethod]\n    public void ProcessSimpleAssignment_UndefinedSymbol_NotLiveIn_NotLiveOut()\n    {\n        var code = \"\"\"\n            undefined = intParameter;   // Error CS0103 The name 'undefined' does not exist in the current context\n            if (undefined == 0)         // Error CS0103 The name 'undefined' does not exist in the current context\n                Method(undefined);      // Error CS0103 The name 'undefined' does not exist in the current context\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"intParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"Method(undefined);\");\n    }\n\n    [TestMethod]\n    public void ProcessSimpleAssignment_GlobalScoped_NotLiveIn_NotLiveOut()\n    {\n        var code = \"\"\"\n            field = intParameter;\n            if (field == 0)\n                Method(field);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"intParameter\"), LiveOut(\"intParameter\"));\n        context.Validate(\"Method(field);\");\n    }\n\n    [TestMethod]\n    public void ProcessSimpleAssignment_LocalScoped_NotLiveIn_LiveOut()\n    {\n        var code = \"\"\"\n            int value;\n            value = 42;\n            if (value == 0)\n                Method(value);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry();\n        context.Validate(\"value = 42;\", LiveOut(\"value\"));\n        context.Validate(\"Method(value);\", LiveIn(\"value\"));\n    }\n\n    [TestMethod]\n    public void ProcessVariableInForeach_Declared_LiveIn_LiveOut()\n    {\n        /*\n         * Entry\n         *    |\n         * Block 1\n         * new[] {1, 2, 3}\n         *    |\n         * Block 2 <------------------------+\n         * MoveNext branch                  |\n         * F|   \\ Else                      |\n         *  v    \\                          |\n         * Exit  Block 3                    |\n         *       i=capture.Current          |\n         *       Method(i, intParameter) -->+\n         *        |                         A\n         *       Block 4 ------------------>+\n         *       Method(i)\n         */\n        var code = \"\"\"\n            foreach(var i in new int[] {1, 2, 3})\n            {\n                Method(i, intParameter);\n                if (boolParameter)\n                  Method(i);\n            }\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.Validate(context.Cfg.Blocks[1], LiveIn(\"boolParameter\", \"intParameter\"), LiveOut(\"boolParameter\", \"intParameter\"));\n        context.Validate(context.Cfg.Blocks[2], LiveIn(\"boolParameter\", \"intParameter\"), LiveOut(\"boolParameter\", \"intParameter\"));\n        context.Validate(\"Method(i, intParameter);\", LiveIn(\"boolParameter\", \"intParameter\"), LiveOut(\"boolParameter\", \"intParameter\", \"i\"));\n        context.Validate(\"Method(i);\", LiveIn(\"boolParameter\", \"intParameter\", \"i\"), LiveOut(\"boolParameter\", \"intParameter\"));\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void NestedImplicitFinally_Lock_ForEach_LiveIn()\n    {\n        const string code = \"\"\"\n            lock(args)\n            {\n                var value = 42;\n                Method(0);\n                foreach (var inner in args)\n                {\n                    Method(1);\n                    if (inner == null)\n                        value = 0;\n                }\n                Method(value);\n            }\n            Method(2);\n            \"\"\";\n        var context = CreateContextCS(code, null, \"string[] args\");\n        context.Validate(\"Method(0);\", LiveIn(\"args\", null), LiveOut(\"args\", \"value\", null));   // The null-named symbol is implicit `bool LockTaken` from the lock(args) statement\n        context.Validate(\"Method(1);\", LiveIn(\"value\", null), LiveOut(\"value\", null));\n        context.Validate(\"Method(value);\", LiveIn(null, \"value\"), LiveOut([null]));\n        context.Validate(\"Method(2);\");\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void NestedImplicitFinally_ForEach_ForEach_LiveIn()\n    {\n        const string code = \"\"\"\n            foreach (var outer in args)\n            {\n                var value = 42;\n                Method(0);\n                foreach (var inner in args)\n                {\n                    Method(1);\n                    if (inner == null)\n                        value = 0;\n                }\n                Method(value);\n            }\n            Method(2);\n            \"\"\";\n        var context = CreateContextCS(code, null, \"string[] args\");\n        context.Validate(\"Method(0);\", LiveIn(\"args\"), LiveOut(\"args\", \"value\"));\n        context.Validate(\"Method(1);\", LiveIn(\"args\", \"value\"), LiveOut(\"args\", \"value\"));\n        context.Validate(\"Method(value);\", LiveIn(\"args\", \"value\"), LiveOut(\"args\"));\n        context.Validate(\"Method(2);\");\n        context.ValidateExit();\n    }\n\n    [TestMethod]\n    public void Loop_Propagates_LiveIn_LiveOut()\n    {\n        var code = \"\"\"\n            A:\n            Method(intParameter);\n            if (boolParameter)\n                goto B;\n            Method(0);\n            goto A;\n            B:\n            Method(1);\n            \"\"\";\n        var context = CreateContextCS(code);\n        context.ValidateEntry(LiveIn(\"boolParameter\", \"intParameter\"), LiveOut(\"boolParameter\", \"intParameter\"));\n        context.Validate(\"boolParameter\", LiveIn(\"boolParameter\", \"intParameter\"), LiveOut(\"boolParameter\", \"intParameter\"));\n        context.Validate(\"Method(0);\", LiveIn(\"boolParameter\", \"intParameter\"), LiveOut(\"boolParameter\", \"intParameter\"));\n        context.Validate(\"Method(1);\");\n    }\n\n    [TestMethod]\n    public void InvokedDelegate_LiveIn()\n    {\n        var code = \"action();\";\n        var context = CreateContextCS(code, additionalParameters: \"Action action\");\n        context.ValidateEntry(LiveIn(\"action\"), LiveOut(\"action\"));\n        context.Validate(\"action();\", LiveIn(\"action\"));\n    }\n\n    [TestMethod]\n    public void ReturningDelegate_LiveIn()\n    {\n        var code = \"\"\"\n            using System;\n            public class Sample\n            {\n                public Func<int> Main(int intParameter) => () => intParameter;\n            }\n            \"\"\";\n        var context = new Context(code, AnalyzerLanguage.CSharp);\n        context.ValidateEntry(Captured(\"intParameter\"));\n        context.Validate(\"() => intParameter\", Captured(\"intParameter\"));\n    }\n\n    [TestMethod]\n    public void ReturningDelegate_NestedByReference_LiveIn()\n    {\n        var code = \"\"\"\n            using System;\n            using System.Threading.Tasks;\n            public class Sample\n            {\n                public Action<T> Main<T>(Func<T, Task> asyncHandler)\n                {\n                    return x =>\n                    {\n                        Task Wrap() => asyncHandler(x);\n                        RunTask(Wrap);\n                    };\n                }\n\n                private void RunTask(Func<Task> f) { }\n            }\n            \"\"\";\n        var context = new Context(code, AnalyzerLanguage.CSharp);\n        context.ValidateEntry(Captured(\"asyncHandler\"));\n    }\n\n    [TestMethod]\n    public void ReturningDelegate_Nested_LiveIn()\n    {\n        var code = \"\"\"\n            using System;\n            public class Sample\n            {\n                public Func<int> Main(int intParameter) =>\n                    () =>\n                    {\n                        int NestedLocalFunction() => intParameter;\n                        return NestedLocalFunction();\n                    };\n            }\n            \"\"\";\n        var context = new Context(code, AnalyzerLanguage.CSharp);\n        context.ValidateEntry(Captured(\"intParameter\"));\n    }\n\n    [TestMethod]\n    public void PropertyWithWriteOnly()\n    {\n        var code = \"\"\"\n            public class Sample\n            {\n                public int Property => 42;\n            }\n            \"\"\";\n        new Context(code, SyntaxKind.NumericLiteralExpression).ValidateAllEmpty();\n    }\n\n    [TestMethod]\n    public void AnonyomousFunctionWriteOnly()\n    {\n        var code = \"\"\"\n            using System;\n            public class Sample\n            {\n                public Func<int> Method(int captureMe) =>\n                    () =>\n                    {\n                        return captureMe;\n                    };\n            }\n            \"\"\";\n        new Context(code, SyntaxKind.ParenthesizedLambdaExpression).ValidateAllEmpty();\n    }\n\n    [TestMethod]\n    public void ConstructorWriteOnly()\n    {\n        var code = \"\"\"\n            using System;\n            public class Sample\n            {\n                public Sample()\n                {\n                    var variable = 42;\n                }\n            }\n            \"\"\";\n        new Context(code, SyntaxKind.Block).ValidateAllEmpty();\n    }\n\n    private static Context CreateContextCS(string methodBody, string localFunctionName = null, string additionalParameters = null)\n    {\n        additionalParameters = additionalParameters is null ? null : \", \" + additionalParameters;\n        var code = $$\"\"\"\n            using System;\n            using System.Collections.Generic;\n            using System.IO;\n            using System.Linq;\n            public class Sample\n            {\n                delegate void VoidDelegate();\n\n                private int field;\n                public int Property { get; set; }\n\n                public void Main(bool boolParameter, int intParameter{{additionalParameters}})\n                {\n                    {{methodBody}}\n                }\n\n                private int Method(params int[] args) => 42;\n                private string Method(params string[] args) => null;\n                private bool IsMethod(params bool[] args) => true;\n                private void Capturing(Func<int, int> f) { }\n                private void Capturing(Func<string> f) { }\n            }\n            \"\"\";\n        return new Context(code, AnalyzerLanguage.CSharp, localFunctionName);\n    }\n\n    private static Context CreateContextVB(string methodBody)\n    {\n        var code = $\"\"\"\n            Public Class Sample\n\n                Public Delegate Sub VoidDelegate()\n\n                Private Field As Integer\n                Private Property Prop As Integer\n\n                Public Sub Main(BoolParameter As Boolean, IntParameter As Integer)\n                    {methodBody}\n                End Sub\n\n                Private Function Method(ParamArray Args() As Integer) As Integer\n                End Function\n\n                Private Function Method(ParamArray Args() As String) As String\n                End Function\n\n                Private Function IsMethod(ParamArray Args() As Boolean) As Boolean\n                End Function\n\n                Private Sub Capturing(f As Func(Of Integer, Integer))\n                End Sub\n\n            End Class\n            \"\"\";\n        return new Context(code, AnalyzerLanguage.VisualBasic);\n    }\n\n    private static Expected LiveIn(params string[] names) =>\n        new(names, ExpectedKind.LiveIn);\n\n    private static Expected LiveOut(params string[] names) =>\n        new(names, ExpectedKind.LiveOut);\n\n    private static Expected Captured(params string[] names) =>\n        new(names, ExpectedKind.Captured);\n\n    private record Expected(string[] Names, ExpectedKind Kind);\n\n    private class Context\n    {\n        public readonly RoslynLiveVariableAnalysis Lva;\n        public readonly ControlFlowGraph Cfg;\n\n        public Context(string code, AnalyzerLanguage language, string localFunctionName = null)\n        {\n            Cfg = TestCompiler.CompileCfg(code, language, code.Contains(\"// Error CS\"), localFunctionName);\n            SyntaxClassifierBase syntaxClassifier = language.LanguageName switch\n            {\n                LanguageNames.CSharp => CSharpSyntaxClassifier.Instance,\n                LanguageNames.VisualBasic => VisualBasicSyntaxClassifier.Instance,\n                _ => throw new UnexpectedLanguageException(language)\n            };\n            Lva = new RoslynLiveVariableAnalysis(Cfg, syntaxClassifier, default);\n            const string Separator = \"----------\";\n            Console.WriteLine(Separator);\n            Console.WriteLine(CfgSerializer.Serialize(Lva));\n            Console.WriteLine(Separator);\n        }\n\n        public Context(string code, SyntaxKind syntaxKind)\n        {\n            var (tree, model) = TestCompiler.Compile(code, false, AnalyzerLanguage.CSharp);\n            var node = tree.GetRoot().DescendantNodes().First(x => x.RawKind == (int)syntaxKind);\n            Cfg = node.CreateCfg(model, default);\n            Lva = new RoslynLiveVariableAnalysis(Cfg, CSharpSyntaxClassifier.Instance, default);   // FIXME: null?\n        }\n\n        public void ValidateAllEmpty()\n        {\n            foreach (var block in Cfg.Blocks)\n            {\n                Validate(block, null, []);\n            }\n        }\n\n        public void ValidateEntry(params Expected[] expected) =>\n            Validate(Cfg.EntryBlock, null, expected);\n\n        public void ValidateExit(params Expected[] expected)\n        {\n            Array.TrueForAll(expected, x => x.Kind == ExpectedKind.Captured).Should().BeTrue(\"Exit block should expect only Captured variables.\");\n            Validate(Cfg.ExitBlock, null, expected);\n        }\n\n        public void Validate(string withSyntax, params Expected[] expected)\n        {\n            var block = Cfg.Blocks.Single(x => x.Kind == BasicBlockKind.Block && (withSyntax is null || x.OperationsAndBranchValue.Any(operation => operation.Syntax.ToString() == withSyntax)));\n            Validate(block, withSyntax, expected);\n        }\n\n        public void Validate<TOperation>(string withSyntax, params Expected[] expected) where TOperation : IOperation\n        {\n            var block = Cfg.Blocks.Single(x => x.Kind == BasicBlockKind.Block && x.OperationsAndBranchValue.OfType<TOperation>().Any(operation => operation.Syntax.ToString() == withSyntax));\n            Validate(block, withSyntax, expected);\n        }\n\n        public void Validate(BasicBlock block, params Expected[] expected) =>\n            Validate(block, null, expected);\n\n        public void Validate(BasicBlock block, string blockSuffix, params Expected[] expected)\n        {\n            var empty = new Expected([], ExpectedKind.None);\n            var expectedLiveIn = expected.SingleOrDefault(x => x.Kind == ExpectedKind.LiveIn) ?? empty;\n            var expectedLiveOut = expected.SingleOrDefault(x => x.Kind == ExpectedKind.LiveOut) ?? empty;\n            var expectedCaptured = expected.SingleOrDefault(x => x.Kind == ExpectedKind.Captured) ?? empty;\n            Lva.LiveIn(block).Select(x => x.Name).Should().BeEquivalentTo(expectedLiveIn.Names, $\"{block.Kind} #{block.Ordinal} {blockSuffix}\");\n            Lva.LiveOut(block).Select(x => x.Name).Should().BeEquivalentTo(expectedLiveOut.Names, $\"{block.Kind} #{block.Ordinal} {blockSuffix}\");\n            Lva.CapturedVariables.Select(x => x.Name).Should().BeEquivalentTo(expectedCaptured.Names, $\"{block.Kind} #{block.Ordinal} {blockSuffix}\");\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/LiveVariableAnalysis/SonarLiveVariableAnalysisTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing SonarAnalyzer.CFG;\nusing SonarAnalyzer.CFG.Sonar;\nusing SonarAnalyzer.CFG.Sonar.Test;\nusing SonarAnalyzer.CSharp.Core.LiveVariableAnalysis;\nusing StyleCop.Analyzers.Lightup;\n\nnamespace SonarAnalyzer.Test.LiveVariableAnalysis;\n\n[TestClass]\npublic class SonarLiveVariableAnalysisTest\n{\n    [TestMethod]\n    public void WriteOnly()\n    {\n        var code = \"\"\"\n            int a = 1;\n            var b = Method();\n            var c = 2 + 3;\n            \"\"\";\n        var context = new Context(code);\n        context.Validate(context.Cfg.EntryBlock);\n    }\n\n    [TestMethod]\n    public void UsedBeforeAssigned_LiveIn()\n    {\n        var code = \"\"\"\n            Method(intParameter);\n            IsMethod(boolParameter);\n            \"\"\";\n        var context = new Context(code);\n        context.Validate(context.Cfg.EntryBlock, new LiveIn(\"intParameter\", \"boolParameter\"));\n    }\n\n    [TestMethod]\n    public void UsedAfterBranch_LiveOut()\n    {\n        /*       Binary\n         *       /   \\\n         *    Jump   Simple\n         *   return  Method()\n         *       \\   /\n         *        Exit\n         */\n        var code = \"\"\"\n            if (boolParameter)\n                return;\n            Method(intParameter);\n            \"\"\";\n        var context = new Context(code);\n        var binary = context.Cfg.EntryBlock;\n        var jump = context.Block<JumpBlock>();\n        var simple = context.Block<SimpleBlock>();\n        var exit = context.Cfg.ExitBlock;\n        context.Validate(binary, new LiveIn(\"boolParameter\", \"intParameter\"), new LiveOut(\"intParameter\"));\n        context.Validate(jump);\n        context.Validate(simple, new LiveIn(\"intParameter\"));\n        context.Validate(exit);\n    }\n\n    [TestMethod]\n    public void Captured_NotLiveIn_NotLiveOut()\n    {\n        /*       Binary\n         *       /   \\\n         *    Jump   Simple\n         *   return  Method()\n         *       \\   /\n         *        Exit\n         */\n        var code = \"\"\"\n            Capturing(() => intParameter);\n            if (boolParameter)\n                return;\n            Method(intParameter);\n            \"\"\";\n        var context = new Context(code);\n        var binary = context.Cfg.EntryBlock;\n        var jump = context.Block<JumpBlock>();\n        var simple = context.Block<SimpleBlock>();\n        var exit = context.Cfg.ExitBlock;\n        context.Validate(binary, new Captured(\"intParameter\"), new LiveIn(\"boolParameter\"));\n        context.Validate(jump, new Captured(\"intParameter\"));\n        context.Validate(simple, new Captured(\"intParameter\"));\n        context.Validate(exit, new Captured(\"intParameter\"));\n    }\n\n    [TestMethod]\n    public void Assigned_NotLiveIn_NotLiveOut()\n    {\n        /*       Binary\n         *       /   \\\n         *    Jump   Simple\n         *   return  intParameter=0\n         *       \\   /\n         *        Exit\n         */\n        var code = \"\"\"\n            if (boolParameter)\n                return;\n            intParameter = 0;\n            \"\"\";\n        var context = new Context(code);\n        var binary = context.Cfg.EntryBlock;\n        var jump = context.Block<JumpBlock>();\n        var simple = context.Block<SimpleBlock>();\n        var exit = context.Cfg.ExitBlock;\n        context.Validate(binary, new LiveIn(\"boolParameter\"));\n        context.Validate(jump);\n        context.Validate(simple);\n        context.Validate(exit);\n    }\n\n    [TestMethod]\n    public void LongPropagationChain_LiveIn_LiveOut()\n    {\n        /*    Binary -> Jump (return) ----+\n         *    declare                     |\n         *      |                         |\n         *    Binary -> Jump (return) ---+|\n         *    use & assign               ||\n         *      |                        ||\n         *    Binary -> Jump (return) --+||\n         *    assign                    |||\n         *      |                       vvv\n         *    Simple -----------------> Exit\n         *    use\n         */\n        var code = \"\"\"\n            var value = 0;\n            if (boolParameter)\n                return;\n            Method(value);\n            value = 42;\n            if (boolParameter)\n                return;\n            value = 42;\n            if (boolParameter)\n                return;\n            Method(intParameter, value);\n            \"\"\";\n        var context = new Context(code);\n        var allBinary = context.Cfg.Blocks.OfType<BinaryBranchBlock>().ToArray();\n        var simple = context.Block<SimpleBlock>();\n        context.Validate(allBinary[0], new LiveIn(\"boolParameter\", \"intParameter\"), new LiveOut(\"boolParameter\", \"intParameter\", \"value\"));\n        context.Validate(allBinary[1], new LiveIn(\"boolParameter\", \"intParameter\", \"value\"), new LiveOut(\"boolParameter\", \"intParameter\"));\n        context.Validate(allBinary[2], new LiveIn(\"boolParameter\", \"intParameter\"), new LiveOut(\"value\", \"intParameter\"));\n        context.Validate(simple, new LiveIn(\"value\", \"intParameter\"));\n        context.Validate(context.Cfg.ExitBlock);\n    }\n\n    [TestMethod]\n    public void BranchedPropagationChain_LiveIn_LiveOut()\n    {\n        /*              Binary\n         *              boolParameter\n         *              /           \\\n         *             /             \\\n         *            /               \\\n         *       Binary             Binary\n         *       firstBranch        secondBranch\n         *       /      \\              /      \\\n         *      /        \\            /        \\\n         *  Simple     Simple      Simple      Simple\n         *  firstTrue  firstFalse  secondTrue  secondFalse\n         *      \\        /            \\        /\n         *       \\      /              \\      /\n         *        Simple                Simple\n         *        first                 second\n         *             \\               /\n         *              \\             /\n         *                  Simple\n         *                  reassigned\n         *                  everywhere\n         */\n        var code = \"\"\"\n            var everywhere = 42;\n            var reassigned = 42;\n            var first = 42;\n            var firstTrue = 42;\n            var firstFalse = 42;\n            var second = 42;\n            var secondTrue = 42;\n            var secondFalse = 42;\n            var firstCondition = boolParameter;\n            var secondCondition = boolParameter;\n            if (boolParameter)\n            {\n                if (firstCondition)\n                {\n                    Method(firstTrue);\n                }\n                else\n                {\n                    Method(firstFalse);\n                }\n                Method(first);\n            }\n            else\n            {\n                if (secondCondition)\n                {\n                    Method(secondTrue);\n                }\n                else\n                {\n                    Method(secondFalse);\n                }\n                Method(second);\n            }\n            reassigned = 0;\n            Method(everywhere, reassigned);\n            \"\"\";\n        var context = new Context(code);\n        context.Validate(\n            context.Block<BinaryBranchBlock>(\"boolParameter\"),\n            new LiveIn(\"boolParameter\"),\n            new LiveOut(\"everywhere\", \"firstCondition\", \"firstTrue\", \"firstFalse\", \"first\", \"secondCondition\", \"secondTrue\", \"secondFalse\", \"second\"));\n        // First block\n        context.Validate(\n            context.Block<BinaryBranchBlock>(\"firstCondition\"),\n            new LiveIn(\"everywhere\", \"firstCondition\", \"firstTrue\", \"firstFalse\", \"first\"),\n            new LiveOut(\"everywhere\", \"firstTrue\", \"firstFalse\", \"first\"));\n        context.Validate(\n            context.Block<SimpleBlock>(\"Method(firstTrue)\"),\n            new LiveIn(\"everywhere\", \"firstTrue\", \"first\"),\n            new LiveOut(\"everywhere\", \"first\"));\n        context.Validate(\n            context.Block<SimpleBlock>(\"Method(firstFalse)\"),\n            new LiveIn(\"everywhere\", \"firstFalse\", \"first\"),\n            new LiveOut(\"everywhere\", \"first\"));\n        context.Validate(\n            context.Block<SimpleBlock>(\"Method(first)\"),\n            new LiveIn(\"everywhere\", \"first\"),\n            new LiveOut(\"everywhere\"));\n        // Second block\n        context.Validate(\n            context.Block<BinaryBranchBlock>(\"secondCondition\"),\n            new LiveIn(\"everywhere\", \"secondCondition\", \"secondTrue\", \"secondFalse\", \"second\"),\n            new LiveOut(\"everywhere\", \"secondTrue\", \"secondFalse\", \"second\"));\n        context.Validate(\n            context.Block<SimpleBlock>(\"Method(secondTrue)\"),\n            new LiveIn(\"everywhere\", \"secondTrue\", \"second\"),\n            new LiveOut(\"everywhere\", \"second\"));\n        context.Validate(\n            context.Block<SimpleBlock>(\"Method(secondFalse)\"),\n            new LiveIn(\"everywhere\", \"secondFalse\", \"second\"),\n            new LiveOut(\"everywhere\", \"second\"));\n        context.Validate(\n            context.Block<SimpleBlock>(\"Method(second)\"),\n            new LiveIn(\"everywhere\", \"second\"),\n            new LiveOut(\"everywhere\"));\n        // Common end\n        context.Validate(context.Block<SimpleBlock>(\"Method(everywhere, reassigned)\"), new LiveIn(\"everywhere\"));\n    }\n\n    [TestMethod]\n    public void ProcessIdentifier_InNameOf_NotLiveIn_NotLiveOut()\n    {\n        var code = \"\"\"Method(nameof(intParameter));\"\"\";\n        var context = new Context(code);\n        context.Validate(context.Cfg.EntryBlock);\n    }\n\n    [TestMethod]\n    public void ProcessIdentifier_LocalScopeSymbol_LiveIn()\n    {\n        var code = \"\"\"\n            var variable = 42;\n            if (boolParameter)\n                return;\n            Method(intParameter, variable);\n            \"\"\";\n        var context = new Context(code);\n        context.Validate(context.Block<SimpleBlock>(), new LiveIn(\"intParameter\", \"variable\"));\n    }\n\n    [TestMethod]\n    public void ProcessIdentifier_GlobalScopeSymbol_NotLiveIn_NotLiveOut()\n    {\n        var code = \"\"\"\n            var s = new Sample();\n            Method(field, s.Property);\n            \"\"\";\n        var context = new Context(code);\n        context.Validate(context.Cfg.EntryBlock);\n    }\n\n    [TestMethod]\n    public void ProcessIdentifier_UndefinedSymbol_NotLiveIn_NotLiveOut()\n    {\n        var code = \"\"\"Method(undefined);\"\"\";\n        var context = new Context(code);\n        context.Validate(context.Cfg.EntryBlock);\n    }\n\n    [TestMethod]\n    public void ProcessIdentifier_RefOutArgument_NotLiveIn_LiveOut()\n    {\n        var code = \"\"\"\n            outParameter = true;\n            Method(outParameter, refParameter);\n            \"\"\";\n        var context = new Context(code);\n        context.Validate(context.Cfg.EntryBlock);\n    }\n\n    [TestMethod]\n    public void ProcessIdentifier_Assigned_NotLiveIn_LiveOut()\n    {\n        // Jump (intParamter=42; goto) --> Jump (label) --> Simple (Method) --> Exit\n        var code = \"\"\"\n            intParameter = 42;\n            goto A;\n            A:\n            Method(intParameter);\n            \"\"\";\n        var context = new Context(code);\n        context.Validate(context.Cfg.EntryBlock, new LiveOut(\"intParameter\"));\n        context.Validate(context.Block<SimpleBlock>(), new LiveIn(\"intParameter\"));\n    }\n\n    [TestMethod]\n    public void ProcessIdentifier_NotAssigned_LiveIn_LiveOut()\n    {\n        // Jump (intParamter=42; goto) --> Jump (label) --> Simple (Method) --> Exit\n        var code = \"\"\"\n            var value = intParameter;\n            goto A;\n            A:\n            Method(value, intParameter);\n            \"\"\";\n        var context = new Context(code);\n        context.Validate(context.Cfg.EntryBlock, new LiveIn(\"intParameter\"), new LiveOut(\"intParameter\", \"value\"));\n        context.Validate(context.Block<SimpleBlock>(), new LiveIn(\"value\", \"intParameter\"));\n    }\n\n    [TestMethod]\n    public void ProcessSimpleAssignment_Discard_NotLiveIn_NotLiveOut()\n    {\n        var code = \"\"\"_ = intParameter;\"\"\";\n        var context = new Context(code);\n        context.Validate(context.Cfg.EntryBlock, new LiveIn(\"intParameter\"));\n    }\n\n    [TestMethod]\n    public void ProcessSimpleAssignment_UndefinedSymbol_NotLiveIn_NotLiveOut()\n    {\n        var code = \"\"\"\n            undefined = intParameter;\n            if (undefined == 0)\n                Method(undefined);\n            \"\"\";\n        var context = new Context(code);\n        context.Validate(context.Cfg.EntryBlock, new LiveIn(\"intParameter\"));\n    }\n\n    [TestMethod]\n    public void ProcessSimpleAssignment_GlobalScoped_NotLiveIn_NotLiveOut()\n    {\n        var code = \"\"\"\n            field = intParameter;\n            if (field == 0)\n                Method(field);\n            \"\"\";\n        var context = new Context(code);\n        context.Validate(context.Cfg.EntryBlock, new LiveIn(\"intParameter\"));\n    }\n\n    [TestMethod]\n    public void ProcessSimpleAssignment_LocalScoped_NotLiveIn_LiveOut()\n    {\n        var code = \"\"\"\n        int value;\n        value = 42;\n        if (value == 0)\n            Method(value);\n        \"\"\";\n        var context = new Context(code);\n        context.Validate(context.Cfg.EntryBlock, new LiveOut(\"value\"));\n    }\n\n    [TestMethod]\n    public void ProcessVariableDeclarator_NotLiveIn_LiveOut()\n    {\n        var code = \"\"\"\n            int intValue = 42;\n            var varValue = 42;\n            if (intValue == 0)\n                Method(intValue, varValue);\n            \"\"\";\n        var context = new Context(code);\n        context.Validate(context.Cfg.EntryBlock, new LiveOut(\"intValue\", \"varValue\"));\n    }\n\n    [TestMethod]\n    public void ProcessVariableInForeach_Declared_LiveIn_LiveOut()\n    {\n        /*\n         * ForEach\n         *    |\n         * Binary <-----------+\n         *  |   \\ true        |\n         *  v    \\            |\n         * Exit  Simple       |\n         *       Method(i) -->+\n         */\n        var code = \"\"\"\n            foreach(var i in new int[] {1, 2, 3})\n            {\n                Method(i, intParameter);\n            }\n            \"\"\";\n        var context = new Context(code);\n        context.Validate(context.Block<ForeachCollectionProducerBlock>(), new LiveIn(\"intParameter\"), new LiveOut(\"intParameter\"));\n        context.Validate(context.Block<BinaryBranchBlock>(), new LiveIn(\"intParameter\"), new LiveOut(\"intParameter\", \"i\"));\n        context.Validate(context.Block<SimpleBlock>(), new LiveIn(\"intParameter\", \"i\"), new LiveOut(\"intParameter\"));\n    }\n\n    [TestMethod]\n    public void ProcessVariableInForeach_Reused_LiveIn_LiveOut()\n    {\n        var code = \"\"\"\n            int i = 42;\n            foreach(i in new int[] {1, 2, 3})\n            {\n                Method(i, intParameter);\n            }\n            \"\"\";\n        var context = new Context(code);\n        context.Validate(context.Block<ForeachCollectionProducerBlock>(), new LiveIn(\"intParameter\"), new LiveOut(\"intParameter\", \"i\"));\n        context.Validate(context.Block<BinaryBranchBlock>(), new LiveIn(\"intParameter\", \"i\"), new LiveOut(\"intParameter\", \"i\"));\n        context.Validate(context.Block<SimpleBlock>(), new LiveIn(\"intParameter\", \"i\"), new LiveOut(\"intParameter\", \"i\"));\n    }\n\n    [TestMethod]\n    public void StaticLocalFunction_ExpressionLiveIn()\n    {\n        var code = \"\"\"\n            outParameter = LocalFunction(intParameter);\n            static int LocalFunction(int a) => a + 1;\n            \"\"\";\n        var context = new Context(code, \"LocalFunction\");\n        context.Validate(context.Cfg.EntryBlock, new LiveIn(\"a\"));\n    }\n\n    [TestMethod]\n    public void StaticLocalFunction_ExpressionNotLiveIn()\n    {\n        var code = \"\"\"\n            outParameter = LocalFunction(0);\n            static int LocalFunction(int a) => 42;\n            \"\"\";\n        var context = new Context(code, \"LocalFunction\");\n        context.Validate(context.Cfg.EntryBlock);\n    }\n\n    [TestMethod]\n    public void StaticLocalFunction_LiveIn()\n    {\n        var code = \"\"\"\n            outParameter = LocalFunction(intParameter);\n            static int LocalFunction(int a)\n            {\n                return a + 1;\n            }\n            \"\"\";\n        var context = new Context(code, \"LocalFunction\");\n        context.Validate(context.Cfg.EntryBlock, new LiveIn(\"a\"));\n    }\n\n    [TestMethod]\n    public void StaticLocalFunction_NotLiveIn()\n    {\n        var code = \"\"\"\n            outParameter = LocalFunction(0);\n            static int LocalFunction(int a)\n            {\n                return 42;\n            }\n            \"\"\";\n        var context = new Context(code, \"LocalFunction\");\n        context.Validate(context.Cfg.EntryBlock);\n    }\n\n    [TestMethod]\n    public void StaticLocalFunction_Recursive()\n    {\n        var code = \"\"\"\n            outParameter = LocalFunction(intParameter);\n            static int LocalFunction(int a)\n            {\n                if(a <= 0)\n                    return 0;\n                else\n                    return LocalFunction(a - 1);\n            }\n            \"\"\";\n        var context = new Context(code, \"LocalFunction\");\n        context.Validate(context.Cfg.EntryBlock, new LiveIn(\"a\"), new LiveOut(\"a\"));\n    }\n\n    [TestMethod]\n    public void UsingBlock_LiveInUntilTheEnd()\n    {\n        /*     Jump\n         *     new ms\n         *       |\n         *     Binary\n         *     Method(ms.Length)\n         *      /  \\\n         * Simple   \\\n         * Method(0) |\n         *      \\   /\n         *     Using\n         *       |\n         *     Exit\n         */\n        var code = \"\"\"\n            using (var ms = new System.IO.MemoryStream())\n            {\n                Method(ms.Length);\n                if (boolParameter)\n                    Method(0);\n            }\n            \"\"\";\n        var context = new Context(code);\n        context.Validate(context.Block<JumpBlock>(), new LiveIn(\"boolParameter\"), new LiveOut(\"boolParameter\", \"ms\"));\n        context.Validate(context.Block<BinaryBranchBlock>(), new LiveIn(\"boolParameter\", \"ms\"), new LiveOut(\"ms\"));\n        context.Validate(context.Block<SimpleBlock>(), new LiveIn(\"ms\"), new LiveOut(\"ms\"));\n        context.Validate(context.Block<UsingEndBlock>(), new LiveIn(\"ms\"));\n        context.Validate(context.Block<ExitBlock>());\n    }\n\n    [TestMethod]\n    public void UsingVar_NotSupported()\n    {\n        /* Bad CFG Shape\n         *\n         *     Binary\n         *     ms = new\n         *     Method(ms.Length)\n         *      /  \\\n         * Simple   \\\n         * Method(0) |\n         *      \\   /\n         *      Exit\n         */\n        var code = \"\"\"\n            using var ms = new System.IO.MemoryStream();\n            Method(ms.Length);\n            if (boolParameter)\n                Method(0);\n            \"\"\";\n        var context = new Context(code);\n        context.Validate(context.Block<BinaryBranchBlock>(), new LiveIn(\"boolParameter\"));\n        context.Validate(context.Block<SimpleBlock>());\n        context.Validate(context.Block<ExitBlock>());\n    }\n\n    [TestMethod]\n    public void LocalFunctionInvocation_LiveIn()\n    {\n        var code = \"\"\"\n            var variable = 42;\n            if (boolParameter)\n                return;\n            LocalFunction();\n\n            int LocalFunction() => variable;\n            \"\"\";\n        var context = new Context(code);\n        context.Validate(context.Cfg.EntryBlock, new LiveIn(\"boolParameter\"), new LiveOut(\"variable\"));\n        context.Validate(context.Block<BinaryBranchBlock>(), new LiveIn(\"boolParameter\"), new LiveOut(\"variable\")); // \"variable\" should also LiveIn\n        context.Validate(context.Block<SimpleBlock>(), new LiveIn(\"variable\"));\n    }\n\n    [TestMethod]\n    public void LocalFunctionInvocation_Generic_LiveIn()\n    {\n        var code = \"\"\"\n            var variable = 42;\n            if (boolParameter)\n                return;\n            LocalFunction<int>();\n\n            T LocalFunction<T>() => variable;\n            \"\"\";\n        var context = new Context(code);\n        context.Validate(context.Cfg.EntryBlock, new LiveIn(\"boolParameter\"), new LiveOut(\"variable\"));\n        context.Validate(context.Block<BinaryBranchBlock>(), new LiveIn(\"boolParameter\"), new LiveOut(\"variable\"));\n        context.Validate(context.Block<SimpleBlock>(), new LiveIn(\"variable\"));\n    }\n\n    [TestMethod]\n    public void LocalFunctionInvocation_NotLiveIn()\n    {\n        var code = \"\"\"\n            var variable = 42;\n            if (boolParameter)\n                return;\n            LocalFunction();\n            Method(variable);\n\n            void LocalFunction()\n            {\n                variable = 0;\n            }\n            \"\"\";\n        var context = new Context(code);\n        context.Validate(context.Cfg.EntryBlock, new LiveIn(\"boolParameter\"));\n        context.Validate(context.Block<BinaryBranchBlock>(), new LiveIn(\"boolParameter\"));\n        context.Validate(context.Block<SimpleBlock>());\n    }\n\n    private class Context\n    {\n        public readonly SonarCSharpLiveVariableAnalysis Lva;\n        public readonly IControlFlowGraph Cfg;\n\n        public Context(string methodBody, string localFunctionName = null)\n        {\n            var code = $$\"\"\"\n                public class Sample\n                {\n                    private int field;\n                    public int Property { get; set; }\n\n                    public void Main(bool boolParameter, int intParameter, out int outParameter, ref int refParameter)\n                    {\n                        {{methodBody}}\n                    }\n\n                    private int Method(params int[] args) => 42;\n                    private string Method(params string[] args) => null;\n                    private bool IsMethod(params bool[] args) => true;\n                    private void Capturing(System.Func<int> f) { }\n                }\n                \"\"\";\n            var (method, model) = SonarControlFlowGraphTest.CompileWithMethodBody(code);\n            IMethodSymbol symbol;\n            CSharpSyntaxNode body;\n            if (localFunctionName is null)\n            {\n                symbol = model.GetDeclaredSymbol(method);\n                body = method.Body;\n            }\n            else\n            {\n                var function = (LocalFunctionStatementSyntaxWrapper)method\n                    .DescendantNodes()\n                    .Single(x => x.IsKind(SyntaxKindEx.LocalFunctionStatement) && ((LocalFunctionStatementSyntaxWrapper)x).Identifier.Text == localFunctionName);\n                symbol = model.GetDeclaredSymbol(function) as IMethodSymbol;\n                body = (CSharpSyntaxNode)function.Body ?? function.ExpressionBody;\n            }\n            Cfg = CSharpControlFlowGraph.Create(body, model);\n            Console.WriteLine(CfgSerializer.Serialize(Cfg));\n            Lva = new SonarCSharpLiveVariableAnalysis(Cfg, symbol, model, default);\n        }\n\n        public Block Block<TBlock>(string withInstruction = null) where TBlock : Block =>\n            Cfg.Blocks.Single(x => x.GetType().Equals(typeof(TBlock))\n            && (withInstruction is null || x.Instructions.Any(instruction => instruction.ToString() == withInstruction)));\n\n        public void Validate(Block block, params Expected[] expected)\n        {\n            // This is not very nice from OOP perspective, but it makes UTs above easy to read.\n            var expectedLiveIn = expected.OfType<LiveIn>().SingleOrDefault() ?? new LiveIn();\n            var expectedLiveOut = expected.OfType<LiveOut>().SingleOrDefault() ?? new LiveOut();\n            var expectedCaptured = expected.OfType<Captured>().SingleOrDefault() ?? new Captured();\n            Lva.LiveIn(block).Select(x => x.Name).Should().BeEquivalentTo(expectedLiveIn.Names, block.GetType().Name);\n            Lva.LiveOut(block).Select(x => x.Name).Should().BeEquivalentTo(expectedLiveOut.Names, block.GetType().Name);\n            Lva.CapturedVariables.Select(x => x.Name).Should().BeEquivalentTo(expectedCaptured.Names, block.GetType().Name);\n        }\n    }\n\n    private abstract class Expected\n    {\n        public readonly string[] Names;\n\n        protected Expected(string[] names) =>\n            Names = names;\n    }\n\n    private class LiveIn : Expected\n    {\n        public LiveIn(params string[] names) : base(names) { }\n    }\n\n    private class LiveOut : Expected\n    {\n        public LiveOut(params string[] names) : base(names) { }\n    }\n\n    private class Captured : Expected\n    {\n        public Captured(params string[] names) : base(names) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Metrics/CSharpExecutableLinesMetricTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing SonarAnalyzer.CSharp.Metrics;\n\nnamespace SonarAnalyzer.Metrics.Test;\n\n[TestClass]\npublic class CSharpExecutableLinesMetricTest\n{\n    private const string RazorFile = \"Test.razor\";\n\n    [TestMethod]\n    public void GetLineNumbers_NoExecutableLines() =>\n        AssertLineNumbersOfExecutableLines(\n@\"using System;\nusing System.Linq;\n\nnamespace Test\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n        }\n    }\n}\");\n\n    [TestMethod]\n    public void GetLineNumbers_Class() =>\n        AssertLineNumbersOfExecutableLines(\n@\"class Program\n{\n}\");\n\n    [TestMethod]\n    public void GetLineNumbers_CheckedUnchecked() =>\n        AssertLineNumbersOfExecutableLines(\n@\"class Program\n{\n    static void Main(string[] args)\n    {\n        checked // +1\n        {\n            unchecked // +1\n            {\n            }\n        }\n    }\n}\", 5, 7);\n\n    [TestMethod]\n    public void GetLineNumbers_Blocks() =>\n        AssertLineNumbersOfExecutableLines(\n@\"class Program\n{\n    unsafe static void Main(int[] arr, object obj)\n    {\n        lock (obj) { } // +1\n        fixed (int* p = arr) { } // +1\n        unsafe { } // +1\n        using ((System.IDisposable)obj) { } // +1\n    }\n}\", 5, 6, 7, 8);\n\n    [TestMethod]\n    public void GetLineNumbers_Statements() =>\n        AssertLineNumbersOfExecutableLines(\n@\"class Program\n{\n    void Foo(int i)\n    {\n        ; // +1\n        i++; // +1\n    }\n}\", 5, 6);\n\n    [TestMethod]\n    public void GetLineNumbers_Loops() =>\n        AssertLineNumbersOfExecutableLines(\n@\"class Program\n{\n    void Foo(int[] arr)\n    {\n        do {} // +1\n            while (true);\n        foreach (var a in arr) { }// +1\n        for (;;) { } // +1\n        while // +1\n            (true) { }\n    }\n}\", 5, 7, 8, 9);\n\n    [TestMethod]\n    public void GetLineNumbers_Conditionals() =>\n        AssertLineNumbersOfExecutableLines(\n@\"class Program\n{\n    void Foo(int? i, string s)\n    {\n        if (true) { } // +1\n        label: // +1\n        switch (i) // +1\n        {\n            case 1:\n            case 2:\n            default:\n                break; // +1\n        }\n        var x = s?.Length; // +1\n        var xx = i == 1 ? 1 : 1; // +1\n    }\n}\", 5, 6, 7, 12, 14, 15);\n\n    [TestMethod]\n    public void GetLineNumbers_Conditionals2() =>\n        AssertLineNumbersOfExecutableLines(\n@\"class Program\n{\n    void Foo(System.Exception ex)\n    {\n        goto home;  // +1\n        throw ex;   // +1\n        home:       // +1\n\n        while (true)    // +1\n        {\n            continue;   // +1\n            break;      // +1\n        }\n        return;     // +1\n    }\n}\", 5, 6, 7, 9, 11, 12, 14);\n\n    [TestMethod]\n    public void GetLineNumbers_Yields() =>\n        AssertLineNumbersOfExecutableLines(\n@\"using System.Collections.Generic;\n\nnamespace Test\n{\n    class Program\n    {\n        IEnumerable<string> Foo()\n        {\n            yield return \"\"\"\";  // +1\n            yield break;        // +1\n        }\n    }\n}\", 9, 10);\n\n    [TestMethod]\n    public void GetLineNumbers_AccessAndInvocation() =>\n        AssertLineNumbersOfExecutableLines(\n@\"class Program\n{\n    static void Main(string[] args)\n    {\n        var x = args.Length; // +1\n        args.ToString(); // +1\n    }\n}\", 5, 6);\n\n    [TestMethod]\n    public void GetLineNumbers_Initialization() =>\n        AssertLineNumbersOfExecutableLines(\n@\"class Program\n{\n    static string GetString() => \"\"\"\";\n\n    static void Main()\n    {\n        var arr = new object();\n        var arr2 = new int[] { 1 }; // +1\n\n        var ex = new System.Exception()\n        {\n            Source = GetString(), // +1\n            HelpLink = \"\"\"\"\n        };\n    }\n}\", 8, 12);\n\n    [TestMethod]\n    public void GetLineNumbers_PropertySet() =>\n        AssertLineNumbersOfExecutableLines(\n@\"class Program\n{\n    int Prop { get; set; }\n\n    void Foo()\n    {\n        Prop = 1; // + 1\n    }\n}\", 7);\n\n    [TestMethod]\n    public void GetLineNumbers_PropertyGet() =>\n        AssertLineNumbersOfExecutableLines(\n@\"class Program\n{\n    int Prop { get; set; }\n\n    void Foo()\n    {\n        var x = Prop;\n    }\n}\");\n\n    [TestMethod]\n    public void GetLineNumbers_Lambdas() =>\n        AssertLineNumbersOfExecutableLines(\n@\"using System;\nusing System.Linq;\nusing System.Collections.Generic;\nclass Program\n{\n    static void Main(string[] args)\n    {\n        var x = args.Where(s => s != null) // +1\n            .Select(s => s.ToUpper()) // +1\n            .OrderBy(s => s) // +1\n            .ToList();\n    }\n}\", 8, 9, 10);\n\n    [TestMethod]\n    public void GetLineNumbers_TryCatch() =>\n        AssertLineNumbersOfExecutableLines(\n@\"using System;\nclass Program\n{\n    static void Main(string[] args)\n    {\n        try\n        {\n            Main(null);  // +1\n        }\n        catch (InvalidOperationException)\n        {\n        }\n        catch (ArgumentNullException ane) when (ane.ToString() != null) // +1\n        {\n        }\n        finally\n        {\n        }\n    }\n}\", 8, 13);\n\n    [TestMethod]\n    public void GetLineNumbers_MultipleStatementsSameLine() =>\n        AssertLineNumbersOfExecutableLines(\n@\"using System;\nclass Program\n{\n    public void Foo(int x) {\n        int i = 0; if (i == 0) {i++;i--;} else // +1\n        { while(true){i--;} } // +1\n    }\n}\", 5, 6);\n\n    [TestMethod]\n    public void GetLineNumbers_DoWhile() =>\n        AssertLineNumbersOfExecutableLines(\n@\"class Program\n{\n    static void Main(string[] args)\n    {\n        do // +1\n        {\n\n        }\n\n        while\n        (\n        true\n        )\n        ;\n    }\n}\", 5);\n\n    [TestMethod]\n    public void GetLineNumbers_ClassExcluded() =>\n        AssertLineNumbersOfExecutableLines(\n@\"using System.Diagnostics.CodeAnalysis;\npublic class ComplicatedCode\n{\n    [ExcludeFromCodeCoverage]\n    public string ComplexFoo()\n    {\n        string text = null;\n        return text.ToLower();\n        string Method(string s)\n        {\n            return s.ToLower();\n        }\n    }\n\n    [SomeAttribute]\n    public string ComplexFoo2()\n    {\n        string text = null;\n        return text.ToLower(); // +1\n        string Method(string s)\n        {\n            return s.ToLower(); // +1\n        }\n    }\n}\n\npublic class SomeAttribute : System.Attribute { }\", 19, 22);\n\n    [TestMethod]\n    public void GetLineNumbers_AttributeOnLocalFunctionExcluded() =>\n        AssertLineNumbersOfExecutableLines(\n@\"using System.Diagnostics.CodeAnalysis;\npublic class ComplicatedCode\n{\n    [SomeAttribute]\n    public string ComplexFoo2()\n    {\n        string text = null;\n        return text.ToLower(); // +1\n\n        [ExcludeFromCodeCoverage]\n        string ComplexFoo()\n        {\n            string text = null;\n            return text.ToLower(); // +1 , FP\n        }\n    }\n}\n\npublic class SomeAttribute : System.Attribute { }\", 8, 14);\n\n    [TestMethod]\n    [DataRow(\"ExcludeFromCodeCoverage\")]\n    [DataRow(\"ExcludeFromCodeCoverage()\")]\n    [DataRow(\"ExcludeFromCodeCoverageAttribute\")]\n    [DataRow(\"ExcludeFromCodeCoverageAttribute()\")]\n    [DataRow(\"System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute()\")]\n    public void GetLineNumbers_ExcludeFromCodeCoverage_AttributeVariants(string attribute) =>\n        AssertLineNumbersOfExecutableLines(\n@$\"using System.Diagnostics.CodeAnalysis;\npublic class ComplicatedCode\n{{\n    [{attribute}]\n    public string ComplexFoo()\n    {{\n        string text = null;\n        return text.ToLower();\n    }}\n}}\");\n\n    [TestMethod]\n    public void GetLineNumbers_RecordExcluded() =>\n        AssertLineNumbersOfExecutableLines(\n@\"using System.Diagnostics.CodeAnalysis;\n[ExcludeFromCodeCoverage]\nrecord Program\n{\n    static void Main(string[] args)\n    {\n        Main(null);\n    }\n}\");\n\n    [TestMethod]\n    public void GetLineNumbers_RecordStructExcluded() =>\n        AssertLineNumbersOfExecutableLines(\n@\"using System.Diagnostics.CodeAnalysis;\n[ExcludeFromCodeCoverage]\nrecord struct Program\n{\n    static void Main(string[] args)\n    {\n        Main(null);\n    }\n}\");\n\n    [TestMethod]\n    public void GetLineNumbers_StructExcluded() =>\n        AssertLineNumbersOfExecutableLines(\n@\"using System.Diagnostics.CodeAnalysis;\nnamespace project_1\n{\n    [ExcludeFromCodeCoverage]\n    struct Program\n    {\n        static void Foo()\n        {\n            Foo();\n        }\n    }\n}\");\n\n    [TestMethod]\n    public void GetLineNumbers_ConstructorExcluded() =>\n        AssertLineNumbersOfExecutableLines(\n@\"using System.Diagnostics.CodeAnalysis;\nclass Program\n{\n    int count;\n\n    [ExcludeFromCodeCoverage]\n    public Program() : this(1)\n    {\n        count = 123;            // excluded\n    }\n\n    public Program(int initialCount)\n    {\n        count = initialCount;   // +1\n    }\n}\", 14);\n\n#if NET\n\n    [TestMethod]\n    public void GetLineNumbers_PropertyExcluded() =>\n        AssertLineNumbersOfExecutableLines(\n@\"using System.Diagnostics.CodeAnalysis;\nclass EventClass\n{\nprivate int _value;\n\n[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]\npublic int Value1\n{\n    get { return _value; }      // Excluded\n    set { _value = value; }     // Excluded\n}\n\npublic int Value2\n{\n    get { return _value; }      // +1\n    [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]\n    set { _value = value; }     // Excluded\n}\n\npublic int Value3\n{\n    get { return _value; }      // +1\n    set { _value = value; }     // +1\n}\n\npublic int Value4\n{\n    get { return _value; }      // +1\n    init { _value = value; }     // +1\n}\n\npublic int Value5\n{\n    get { return _value; }      // +1\n    [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]\n    init { _value = value; }     // Excluded\n}\n}\", 15, 22, 23, 28, 29, 34);\n\n#endif\n\n    [TestMethod]\n    public void GetLineNumbers_EventExcluded() =>\n        AssertLineNumbersOfExecutableLines(\n@\"using System.Diagnostics.CodeAnalysis;\nclass EventClass\n{\n    private System.EventHandler _explicitEvent;\n\n    [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]\n    public event System.EventHandler ExplicitEvent1\n    {\n        add { _explicitEvent += value; }        // Excluded\n        remove { _explicitEvent -= value; }     // Excluded\n    }\n\n    public event System.EventHandler ExplicitEvent2\n    {\n        add { _explicitEvent += value; }        // +1\n        [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]\n        remove { _explicitEvent -= value; }     // excluded\n    }\n\n    public event System.EventHandler ExplicitEvent3\n    {\n        add { _explicitEvent += value; }        // +1\n        remove { _explicitEvent -= value; }     // +1\n    }\n}\", 15, 22, 23);\n\n    [TestMethod]\n    public void GetLineNumbers_PartialClassesExcluded() =>\n        AssertLineNumbersOfExecutableLines(\n@\"using System.Diagnostics.CodeAnalysis;\n[ExcludeFromCodeCoverage]\npartial class Program\n{\n    int FooProperty { get { return 1; } }   // excluded\n}\n\npartial class Program\n{\n    void Method1()\n    {\n        System.Console.WriteLine();         // other class partial is excluded -> excluded\n    }\n}\n\npartial class AnotherClass\n{\n    void Method2()\n    {\n        System.Console.WriteLine();         // +1\n    }\n} \", 20);\n\n    [TestMethod]\n    public void GetLineNumbers_PartialMethodsExcluded() =>\n        AssertLineNumbersOfExecutableLines(\n@\"using System.Diagnostics.CodeAnalysis;\npartial class Program\n{\n    [ExcludeFromCodeCoverage]\n    partial void Method1();\n}\n\npartial class Program\n{\n    partial void Method1()\n    {\n        System.Console.WriteLine();         // other partial part of method is excluded -> excluded\n    }\n}\n\npartial class AnotherClass\n{\n    partial void Method2();\n}\n\npartial class AnotherClass\n{\n    [ExcludeFromCodeCoverage]\n    partial void Method2()\n    {\n        System.Console.WriteLine();         // excluded\n    }\n}\");\n\n    [TestMethod]\n    public void GetLineNumbers_AttributeAreIgnored() =>\n        AssertLineNumbersOfExecutableLines(\n@\"using System.Reflection;\nusing System.Runtime.CompilerServices;\n[assembly: InternalsVisibleTo(\"\"FOO\"\")]\");\n\n    [TestMethod]\n    public void GetLineNumbers_OnlyAttributeAreIgnored() =>\n        AssertLineNumbersOfExecutableLines(\n@\"[AnAttribute]\npublic class Foo\n{\n    [AnAttribute]\n    void MyCode([AnAttribute] string foo)\n    {\n        System.Console.WriteLine(); // +1\n    }\n}\n\npublic class AnAttribute : System.Attribute { }\", 7);\n\n    [TestMethod]\n    public void GetLineNumbers_AttributeOnLambdaIsIgnored() =>\n        AssertLineNumbersOfExecutableLines(\n@\"using System;\nusing System.Linq;\nusing System.Collections.Generic;\nclass Test\n{\n    static void Main(string[] args)\n    {\n        [AnAttribute]\n        List<string> LambdaWithAttribute(string[] args) =>\n            args.Where(s => s != null).ToList(); // +1\n    }\n}\n\npublic class AnAttribute : System.Attribute { }\", 10);\n\n    [TestMethod]\n    public void GetLineNumbers_ExpressionsAreCounted() =>\n        AssertLineNumbersOfExecutableLines(\n@\"class Program\n{\n    public void Foo(bool flag)\n    {\n        if (flag) // +1\n        {\n            flag = true; flag = false; flag = true; // +1\n        }\n    }\n}\", 5, 7);\n\n    [TestMethod]\n    public void GetLineNumbers_MultiLineLoop() =>\n        AssertLineNumbersOfExecutableLines(\n@\"class Program\n{\n    void Foo(int[] arr)\n    {\n        for         // +1\n            (         // +0\n            int i=0; // +0\n            i < 10;  // +0\n            i++      // +0\n            )         // +0\n        {           // +0\n        }\n    }\n}\", 5);\n\n    [TestMethod]\n    public void GetLineNumbers_SwitchStatementWithMultipleCases() =>\n        AssertLineNumbersOfExecutableLines(\n@\"class Program\n{\n    void Foo(int? i)\n    {\n        switch (i) // +1\n        {\n            case 1:\n                System.Console.WriteLine(4); // +1\n                break; // +1\n            case 2:\n                System.Console.WriteLine(4); // +1\n                break; // +1\n            default:\n                break; // +1\n        }\n    }\n}\", 5, 8, 9, 11, 12, 14);\n\n    [TestMethod]\n    public void GetLineNumbers_SwitchExpressionWithMultipleCases() =>\n        AssertLineNumbersOfExecutableLines(\n@\"class Program\n{\n    void Foo(int? i, string s)\n    {\n        var x = s switch\n        {\n                \"\"a\"\" => true,\n                \"\"b\"\" => false,\n                _ => true\n        };\n        var y = s switch\n        {\n            \"\"a\"\" => Foo(\"\"b\"\"), // +1\n            \"\"b\"\" => Foo(\"\"a\"\"), // +1\n            _ => false\n        };\n    }\n    bool Foo(string s) => true;\n}\", 13, 14);\n\n    [TestMethod]\n    public void GetLineNumbers_MultiLineInterpolatedString() =>\n        AssertLineNumbersOfExecutableLines(\n@\"class Program\n{\n    void Foo(int? i, string s)\n    {\n        string x = \"\"someString\"\";\n        x += @$\"\"This is a Multi\n                                Line\n                                interpolated\n                                string {i} {s}\"\";\n    }\n}\", 6);\n\n    [TestMethod]\n    public void GetLineNumbers_MultiLineInterpolatedStringWithMultipleLineExpressions() =>\n        AssertLineNumbersOfExecutableLines(\n@\"public class C\n{\n    public string M(int i)\n    {\n        return @$\"\"\n        {(i == 1 ? Bar(1) : Bar(2))}\n        {(i == 2 ? Bar(2) : Bar(3))}\n        { Bar(5)}\n                    \"\";\n    }\n\n    public string Bar(int i) => \"\"y\"\" + i;\n}\", 5, 6, 7, 8);\n\n    [TestMethod]\n    public void GetLineNumbers_UsingDeclaration() =>\n        AssertLineNumbersOfExecutableLines(\n@\"class Program\n{\n    void Foo(int? i, string s)\n    {\n        using var file = new System.IO.StreamWriter(\"\"WriteLines2.txt\"\");\n    }\n}\");\n\n    [TestMethod]\n    public void GetLineNumbers_LocalFunctions() =>\n        AssertLineNumbersOfExecutableLines(\n@\"class Program\n{\n    int M1()\n    {\n        int y = MyMethod(); // +1\n        MyMethod();         // +1\n        return 1; // +1\n        int MyMethod() => 0; // Not counted\n    }\n\n    int M2()\n    {\n        int y = 5;\n        int x = 7;\n        return Add(x, y);\n\n        static int Add(int left, int right) => left + right;\n    }\n}\", 5, 6, 7, 15);\n\n#if NET\n\n    [TestMethod]\n    public void GetLineNumbers_IndicesAndRanges() =>\n        AssertLineNumbersOfExecutableLines(\n@\"using System;\nclass Program\n{\nvoid M()\n{\n    string s = null;\n    string[] subArray;\n    var words = new string[]\n        {\n            \"\"The\"\",\n            \"\"quick\"\",\n            \"\"brown\"\",\n            \"\"fox\"\",\n            \"\"jumped\"\",\n            \"\"over\"\",\n            \"\"the\"\",\n            \"\"lazy\"\",\n            \"\"dog\"\"\n        };\n    s = words[^1];\n    subArray = words[1..4];\n}\n}\", 9, 20, 21);\n\n#endif\n\n    [TestMethod]\n    public void GetLineNumbers_NullCoalescingAssignment() =>\n        AssertLineNumbersOfExecutableLines(\n@\"using System;\nusing System.Collections.Generic;\nclass Program\n{\n    void M()\n    {\n        List<int> numbers = null;\n        int? i = null;\n\n        numbers ??= new List<int>();\n    }\n}\", 10);\n\n    [TestMethod]\n    public void GetLineNumbers_AssignmentAndDeclarationInTheSameDeconstruction() =>\n        AssertLineNumbersOfExecutableLines(\n@\"using System;\nusing System.Collections.Generic;\nclass Program\n{\n    void M()\n    {\n        List<int> numbers = null;\n        int? i = null;\n\n        (i, int k) = (42, 42);\n    }\n}\", 10);\n\n    [TestMethod]\n    public void GetLineNumbers_NullCoalescingOperator() =>\n        AssertLineNumbersOfExecutableLines(\n@\"using System;\nusing System.Collections.Generic;\nusing System.Linq;\nclass Program\n{\n    double SumNumbers(List<double[]> setsOfNumbers, int indexOfSetToSum)\n    {\n        return setsOfNumbers?[indexOfSetToSum]?.Sum() // +1\n                ?? double.NaN; // +1\n    }\n}\", 8, 9);\n\n    [TestMethod]\n    public void GetLineNumbers_SingleLinePatternMatching() =>\n        AssertLineNumbersOfExecutableLines(\n@\"static class Program\n{\n    public static bool IsLetter(this char c) =>\n        c is >= 'a' and <= 'z' or >= 'A' and <= 'Z';\n}\");\n\n    [TestMethod]\n    public void GetLineNumbers_MultiLinePatternMatching() =>\n        AssertLineNumbersOfExecutableLines(\n@\"using System;\nusing System.Collections.Generic;\nclass Program\n{\n    public static bool IsLetter(char c)\n    {\n        if (c is >= 'a'\n                and <= 'z'\n                        or >= 'A'\n                            and <= 'Z')\n        {\n            return true;\n        }\n        return false;\n    }\n}\", 7, 12, 14);\n\n    [TestMethod]\n    public void GetLineNumbers_MultiLineInvocation() =>\n        AssertLineNumbersOfExecutableLines(\n@\"using System;\nusing System.Collections.Generic;\nclass Program\n{\n    public static bool Foo(int a, int b)\n    {\n        return Foo(1,\n                    Bar());\n    }\n\n    public static int Bar() => 42;\n}\", 7, 8);\n\n    [TestMethod]\n    public void GetLineNumbers_PartialProperties() =>\n        AssertLineNumbersOfExecutableLines(\n            \"\"\"\n            partial class Partial\n            {\n                public partial int Property { get; set; }\n            }\n            partial class Partial\n            {\n                public partial int Property\n                {\n                    get => 1;\n                    set { value.ToString(); } // +1\n                }\n            }\n            \"\"\", 10);\n\n    [TestMethod]\n    public void GetLineNumbers_PartialProperties_Excluded() =>\n        AssertLineNumbersOfExecutableLines(\n            \"\"\"\n            partial class Partial\n            {\n                [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]\n                public partial int Property { get; set; }\n            }\n            partial class Partial\n            {\n                public partial int Property\n                {\n                    get => 1;\n                    set { value.ToString(); } // The setter is ignored because of ExcludeFromCodeCoverage in the partial property declaration\n                }\n            }\n            \"\"\");\n\n    [TestMethod]\n    public void GetLineNumbers_PartialIndexers_Excluded() =>\n        AssertLineNumbersOfExecutableLines(\n            \"\"\"\n            partial class Partial\n            {\n                [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]\n                public partial int this[int index] { get; set; }\n            }\n            partial class Partial\n            {\n                public partial int this[int index]\n                {\n                    get => 1;\n                    set { } // The setter is ignored because of ExcludeFromCodeCoverage in the partial indexer declaration\n                }\n            }\n            \"\"\");\n\n#if NET\n\n    [TestMethod]\n    public void GetLineNumbers_Razor_NoExecutableLines() =>\n        AssertLineNumbersOfExecutableLinesRazor(\"\"\"\n<p>Hello world!</p>\n@* Noncompliant *@\n@code\n{\nprivate void SomeMethod()\n{\n}\n}\n\"\"\", RazorFile);\n\n    [TestMethod]\n    // This is incorrect, see https://sonarsource.atlassian.net/browse/NET-2052\n    public void GetLineNumbers_Razor_FieldReference() =>\n        AssertLineNumbersOfExecutableLinesRazor(\"\"\"\n            @page \"/razor\"\n            @using TestCases\n\n            <p>Current count: @currentCount</p>     <!-- +1 -->\n\n            @currentCount                           <!-- +1 -->\n\n            @code {\n            private int currentCount = 0;\n            }\n            \"\"\",\n            RazorFile,\n            4,\n            6);\n\n    [TestMethod]\n    // This is incorrect, see https://sonarsource.atlassian.net/browse/NET-2052\n    public void GetLineNumbers_Razor_MethodReferenceAndCall() =>\n        AssertLineNumbersOfExecutableLinesRazor(\"\"\"\n            <button @onclick=\"IncrementCount\">Increment</button>    <!-- Not counted | Razor FN -->\n            <p> @(ShowAmount()) </p>                                <!-- +1 -->\n\n            @code {\n            [Parameter]\n            public int IncrementAmount { get; set; } = 1;\n\n            private void IncrementCount()\n            {\n                IncrementAmount += 1;                           // +1\n            }\n\n            private string ShowAmount()\n            {\n                return $\"Amount: {IncrementAmount}\";            // +1\n            }\n            }\n            \"\"\",\n            RazorFile,\n            2,\n            10,\n            15);\n\n    [TestMethod]\n    // This is incorrect, see https://sonarsource.atlassian.net/browse/NET-2052\n    public void GetLineNumbers_Razor_PropertyReference() =>\n        AssertLineNumbersOfExecutableLinesRazor(\"\"\"\n            @IncrementAmount <!-- +1 -->\n\n            @code {\n            [Parameter]\n            public int IncrementAmount { get; set; } = 1;\n            }\n            \"\"\",\n            RazorFile,\n            1);\n\n    [TestMethod]\n    // This is incorrect, see https://sonarsource.atlassian.net/browse/NET-2052\n    public void GetLineNumbers_Razor_Html() =>\n        AssertLineNumbersOfExecutableLinesRazor(\"\"\"\n            <ul>\n            @foreach (var todo in todos)                        <!-- +1 -->\n            {\n                <li>@todo.Title</li>                            <!-- +1 -->\n            }\n            </ul>\n\n            <h3>Todo (@todos.Count(todo => !todo.IsDone))</h3>      <!-- +1 -->\n            \"\"\",\n            RazorFile,\n            2,\n            4,\n            8);\n\n    [TestMethod]\n    public void GetLineNumbers_Razor_AssignmentAndDeclarationInTheSameDeconstruction() =>\n        AssertLineNumbersOfExecutableLinesRazor(\"\"\"\n@code {\nvoid Foo()\n{\n    int? i = null;\n    (i, int j) = (42, 42);      // +1\n}\n}\n\"\"\", RazorFile, 5);\n\n    [TestMethod]\n    public void GetLineNumbers_Razor_MultiLineInvocation() =>\n        AssertLineNumbersOfExecutableLinesRazor(\"\"\"\n@code {\npublic static bool Foo(int a, int b)\n{\n    return Foo(1,               // +1\n                Bar());         // +1\n}\n\npublic static int Bar() => 42;\n}\n\"\"\", RazorFile, 4, 5);\n\n    [TestMethod]\n    public void GetLineNumbers_Razor_NullCoalescingAssignment() =>\n        AssertLineNumbersOfExecutableLinesRazor(\"\"\"\n@code {\nvoid Foo()\n{\n    List<int> numbers = null;\n    numbers ??= new List<int>(); // +1\n}\n}\n\"\"\", RazorFile, 5);\n\n    [TestMethod]\n    public void GetLineNumbers_Razor_MultiLinePatternMatching() =>\n        AssertLineNumbersOfExecutableLinesRazor(\"\"\"\n@code {\nbool IsLetter(char c)\n{\n    if (c is >= 'a'                     // +1\n            and <= 'z'\n                    or >= 'A'\n                        and <= 'Z')\n    {\n        return true;                    // +1\n    }\n    return false;                       // +1\n}\n}\n\"\"\", RazorFile, 4, 9, 11);\n\n    [TestMethod]\n    public void GetLineNumbers_Razor_NullCoalescingOperator() =>\n        AssertLineNumbersOfExecutableLinesRazor(\"\"\"\n@code {\ndouble SumNumbers(List<double[]> setsOfNumbers, int indexOfSetToSum)\n{\n    return setsOfNumbers?[indexOfSetToSum]?.Sum() // +1\n            ?? double.NaN; // +1\n}\n}\n\"\"\", RazorFile, 4, 5);\n\n    [TestMethod]\n    public void GetLineNumbers_Razor_LocalFunctions() =>\n        AssertLineNumbersOfExecutableLinesRazor(\"\"\"\n@code {\nvoid Foo()\n{\n    var x = LocalMethod();          // +1\n    LocalMethod();                  // +1\n    int LocalMethod() => 42;\n}\n}\n\"\"\", RazorFile, 4, 5);\n\n#endif\n\n    private static void AssertLineNumbersOfExecutableLines(string code, params int[] expectedExecutableLines)\n    {\n        var (syntaxTree, semanticModel) = TestCompiler.CompileCS(code);\n        CSharpExecutableLinesMetric.GetLineNumbers(syntaxTree, semanticModel).Should().BeEquivalentTo(expectedExecutableLines);\n    }\n\n    private static void AssertLineNumbersOfExecutableLinesRazor(string code, string fileName, params int[] expectedExecutableLines)\n    {\n        var compilation = new VerifierBuilder<DummyAnalyzerWithLocation>()\n            .AddSnippet(code, fileName)\n            .WithLanguageVersion(LanguageVersion.Latest)\n            .Compile()\n            .Single();\n\n        var syntaxTree = compilation.SyntaxTrees.Single(x => x.ToString().Contains(fileName));\n        var semanticModel = compilation.GetSemanticModel(syntaxTree);\n\n        var lineNumbers = CSharpExecutableLinesMetric.GetLineNumbers(syntaxTree, semanticModel);\n        lineNumbers.Should().BeEquivalentTo(expectedExecutableLines);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Metrics/VisualBasicExecutableLinesMetricTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Metrics;\n\nnamespace SonarAnalyzer.Metrics.Test;\n\n[TestClass]\npublic class VisualBasicExecutableLinesMetricTest\n{\n    [TestMethod]\n    public void AttributeList() =>\n        AssertLinesOfCode(\n@\"<Serializable()>\nPublic Class Sample\n    <Runtime.InteropServices.DllImport(\"\"user32.dll\"\")>\n    Shared Sub SampleMethod()\n    End Sub\nEnd Class\");\n\n    [TestMethod]\n    public void SyncLockStatement() =>\n        AssertLinesOfCode(\n@\"Class simpleMessageList\n    Private messagesLock As New Object\n\n    Public Sub addAnotherMessage(ByVal newMessage As String)\n        SyncLock messagesLock ' +1\n        End SyncLock\n    End Sub\nEnd Class\", 5);\n\n    [TestMethod]\n    public void UsingStatement() =>\n        AssertLinesOfCode(\n@\"Public Module Sample\n    Public Sub Go()\n        Using MS As New IO.MemoryStream\n        End Using\n    End Sub\nEnd Module\", 3);\n\n    [TestMethod]\n    public void DoUntilStatement() =>\n        AssertLinesOfCode(\n@\"Public Module Sample\n    Public Sub Go()\n        Dim index As Integer = 0\n        Do\n        Loop Until index > 10\n    End Sub\nEnd Module\");\n\n    [TestMethod]\n    public void DoWhileStatement() =>\n        AssertLinesOfCode(\n@\"Public Module Sample\n    Public Sub Go()\n        Dim index As Integer = 0\n        Do While index <= 10\n        Loop\n    End Sub\nEnd Module\", 4);\n\n    [TestMethod]\n    public void ForEachStatement() =>\n        AssertLinesOfCode(\n@\"Public Module Sample\n    Public Sub Go()\n        For Each item As String In {\"\"a\"\", \"\"b\"\", \"\"c\"\"} ' +1\n        Next\n    End Sub\nEnd Module\", 3);\n\n    [TestMethod]\n    public void ForStatement() =>\n        AssertLinesOfCode(\n@\"Public Module Sample\n    Public Sub Go()\n        For index As Integer = 1 To 5\n        Next\n    End Sub\nEnd Module\", 3);\n\n    [TestMethod]\n    public void WhileStatement() =>\n        AssertLinesOfCode(\n@\"Public Module Sample\n    Public Sub Go(Index As Integer)\n        While Index <= 10\n        End While\n    End Sub\nEnd Module\", 3);\n\n    [TestMethod]\n    public void IfStatement() =>\n        AssertLinesOfCode(\n@\"Public Module Sample\n    Public Sub Go(Count As Integer)\n        Dim Message As String\n        If Count = 0 Then\n            Message = \"\"There are no items.\"\"\n        ElseIf Count = 1 Then\n            Message = \"\"There is 1 item.\"\"\n        Else\n            Message = $\"\"There are many items.\"\"\n        End If\n    End Sub\nEnd Module\", 4, 5, 6, 7, 9);\n\n    [TestMethod]\n    public void SelectStatement() =>\n        AssertLinesOfCode(\n@\"Public Module Sample\n    Public Sub Go()\n        Dim number As Integer = 8\n        Select Case number ' +1\n            Case 1 To 5\n                Debug.WriteLine(\"\"f\"\") ' +1\n            Case Else\n                Debug.WriteLine(\"\"f\"\") ' +1\n        End Select\n    End Sub\nEnd Module\", 4, 6, 8);\n\n    [TestMethod]\n    public void ConditionalAccessExpression() =>\n        AssertLinesOfCode(\n@\"Public Module Sample\n    Public Sub Go(Customers() As Integer)\n        Dim length As Integer? = Customers?.Length\n    End Sub\nEnd Module\", 3);\n\n    [TestMethod]\n    public void BinaryConditionalExpression() =>\n        AssertLinesOfCode(\n@\"Public Module Sample\n    Public Function Go(First As String, Second As String) As String\n        Return If(First, Second)\n    End Function\nEnd Module\", 3);\n\n    [TestMethod]\n    public void TernaryConditionalExpression() =>\n        AssertLinesOfCode(\n@\"Public Module Sample\n    Public Sub Go(A As String, B As String, C As String, D As String)\n        Dim Ret As String = If(A = B, C, D)\n    End Sub\nEnd Module\", 3);\n\n    [TestMethod]\n    public void GoToStatement() =>\n        AssertLinesOfCode(\n@\"Public Module Sample\n    Public Sub Go()\n        GoTo LastLine\nLastLine:\n    End Sub\nEnd Module\", 3, 4);\n\n    [TestMethod]\n    public void ThrowStatement() =>\n        AssertLinesOfCode(\n@\"Public Module Sample\n    Public Sub Go()\n        Throw New Exception()\n    End Sub\nEnd Module\", 3);\n\n    [TestMethod]\n    public void ReturnStatement() =>\n        AssertLinesOfCode(\n@\"Public Module Sample\n    Public Function getAgePhrase(ByVal age As Integer) As String\n        Return \"\"Infant\"\"\n    End Function\nEnd Module\", 3);\n\n    [TestMethod]\n    public void ExitDoStatement() =>\n        AssertLinesOfCode(\n@\"Public Module Sample\n    Public Sub Go(Index As Integer)\n        Do While Index <= 100\n            If Index > 10 Then\n                Exit Do\n            End If\n        Loop\n    End Sub\nEnd Module\", 3, 4, 5);\n\n    [TestMethod]\n    public void ExitForStatement() =>\n        AssertLinesOfCode(\n@\"Public Module Sample\n    Public Sub Go()\n        For index As Integer = 1 To 100000\n            Exit For\n        Next\n    End Sub\nEnd Module\", 3, 4);\n\n    [TestMethod]\n    public void ExitWhileStatement() =>\n        AssertLinesOfCode(\n@\"Public Module Sample\n    Public Sub Go(Index As Integer)\n        While Index < 100000\n            Exit While\n        End While\n    End Sub\nEnd Module\", 3, 4);\n\n    [TestMethod]\n    public void ContinueDoStatement() =>\n        AssertLinesOfCode(\n@\"Public Module Sample\n    Public Sub Go(Cnt As Integer)\n        Do\n            Continue Do\n        Loop While Cnt < 20\n    End Sub\nEnd Module\", 4);\n\n    [TestMethod]\n    public void ContinueForStatement() =>\n        AssertLinesOfCode(\n@\"Public Module Sample\n    Public Sub Go()\n        For index As Integer = 1 To 100000\n            Continue For\n        Next\n    End Sub\nEnd Module\", 3, 4);\n\n    [TestMethod]\n    public void SimpleMemberAccessExpression() =>\n        AssertLinesOfCode(\n@\"Public Module Sample\n    Public Sub Go()\n        Console.WriteLine(\"\"Found\"\")\n    End Sub\nEnd Module\", 3);\n\n    [TestMethod]\n    public void InvocationExpression() =>\n        AssertLinesOfCode(\n@\"Public Module Sample\n    Public Sub foo()\n    End Sub\n\n    Public Sub bar()\n        foo()\n    End Sub\nEnd Module\", 6);\n\n    [TestMethod]\n    public void SingleLineSubLambdaExpression() =>\n        AssertLinesOfCode(\n@\"Public Module Sample\n    Public Sub Go()\n        Dim writeline1 = Sub(x) Console.WriteLine(x)\n    End Sub\nEnd Module\", 3);\n\n    [TestMethod]\n    public void SingleLineFunctionLambdaExpression() =>\n        AssertLinesOfCode(\n@\"Public Module Sample\n    Public Sub Go()\n        Dim increment1 = Function(x) x + 1\n    End Sub\nEnd Module\", 3);\n\n    [TestMethod]\n    public void MultiLineSubLambdaExpression() =>\n        AssertLinesOfCode(\n@\"Public Module Sample\n    Public Sub Go()\n        Dim writeline2 = Sub(x)\n                            Console.WriteLine(x)\n                         End Sub\n    End Sub\nEnd Module\", 3, 4);\n\n    [TestMethod]\n    public void MultiLineFunctionLambdaExpression() =>\n        AssertLinesOfCode(\n@\"Public Module Sample\n    Public Sub Go()\n        Dim increment2 = Function(x)\n                             Return x + 2\n                         End Function\n    End Sub\nEnd Module\", 3, 4);\n\n    [TestMethod]\n    public void StructureStatement() =>\n        AssertLinesOfCode(\n@\"Structure foo\nEnd Structure\");\n\n    [TestMethod]\n    public void ClassStatement() =>\n        AssertLinesOfCode(\n@\"Class foo\nEnd Class\");\n\n    [TestMethod]\n    public void ModuleStatement() =>\n        AssertLinesOfCode(\n@\"Module foo\nEnd Module\");\n\n    [TestMethod]\n    public void FunctionStatement() =>\n        AssertLinesOfCode(\n@\"Public Module Sample\n    Function myFunction(ByVal j As Integer) As Double\n        Return 3.87 * j\n    End Function\nEnd Module\", 3);\n\n    [TestMethod]\n    public void SubStatement() =>\n        AssertLinesOfCode(\n@\"Public Module Sample\n    Sub computeArea(ByVal length As Double, ByVal width As Double)\n    End Sub\nEnd Module\");\n\n    [TestMethod]\n    public void SubNewStatement() =>\n        AssertLinesOfCode(\n@\"Public Class Sample\n    Public Sub New()\n    End Sub\nEnd Class\");\n\n    [TestMethod]\n    public void PropertyStatement() =>\n        AssertLinesOfCode(\n@\"Public Class Sample\n    Public Property Name As String\nEnd Class\");\n\n    [TestMethod]\n    public void EventStatement() =>\n        AssertLinesOfCode(\n@\"Public Class Sample\n    Public Event LogonCompleted(ByVal UserName As String)\nEnd Class\");\n\n    [TestMethod]\n    public void AddHandlerAccessorStatement() =>\n        AssertLinesOfCode(\n@\"Public Class Sample\n    Public Event SomeEvent\n\n    Sub TestEvents()\n        Dim S As New Sample\n        AddHandler S.SomeEvent, AddressOf OnSomeEvent\n    End Sub\n\n    Private Sub OnSomeEvent()\n    End Sub\nEnd Class\", 6);\n\n    [TestMethod]\n    public void RemoveHandlerAccessorStatement() =>\n        AssertLinesOfCode(\n@\"Public Class Sample\n    Public Event SomeEvent\n\n    Sub TestEvents()\n        Dim S As New Sample\n        RemoveHandler S.SomeEvent, AddressOf OnSomeEvent\n    End Sub\n\n    Private Sub OnSomeEvent()\n    End Sub\nEnd Class\", 6);\n\n    [TestMethod]\n    public void SetAccessorStatement() =>\n        AssertLinesOfCode(\n@\"Public Class Sample\n    Private QuoteValue As String\n\n    Public WriteOnly Property QuoteForTheDay() As String\n        Set(ByVal Value As String)\n            QuoteValue = Value\n        End Set\n    End Property\nEnd Class\", 6);\n\n    [TestMethod]\n    public void GetAccessorStatement() =>\n        AssertLinesOfCode(\n@\"Public Class Sample\n    ReadOnly Property quoteForTheDay() As String\n        Get\n        End Get\n    End Property\nEnd Class\");\n\n    [TestMethod]\n    public void Assignments() =>\n        AssertLinesOfCode(\n@\"Public Module Sample\n    Public Sub Foo(ByVal flag _\n                    As Boolean)\n        If flag _\n            Then\n            flag = True : flag = False : flag = True\n        End If\n    End Sub\nEnd Module\", 4, 6);\n\n    [TestMethod]\n    public void ExcludedFromCodeCoverage_Class() =>\n        AssertLinesOfCode(\n            \"\"\"\n            Imports System.Diagnostics.CodeAnalysis\n\n            <ExcludeFromCodeCoverage>\n            Public Module Class1\n                Public Sub TestMe()\n                    Console.WriteLine(\"Exclude me\") ' +1, FP\n                End Sub\n            End Module\n            \"\"\", 6); // There should be no executable lines in the module\n\n    [TestMethod]\n    public void ExcludedFromCodeCoverage_Methods() =>\n        AssertLinesOfCode(\n            \"\"\"\n            Imports System.Diagnostics.CodeAnalysis\n\n            Public Module Class3\n                <ExcludeFromCodeCoverage>\n                Public Sub Excluded()\n                    Console.WriteLine(\"Exclude me\") ' +1, FP\n                End Sub\n                Public Sub NotCovered()\n                    Console.WriteLine(\"Not covered\") ' +1\n                End Sub\n            End Module\n            \"\"\", 6, 9);\n\n    private static void AssertLinesOfCode(string code, params int[] expectedExecutableLines)\n    {\n        var (syntaxTree, semanticModel) = TestCompiler.CompileVB(code);\n        VisualBasicExecutableLinesMetric.GetLineNumbers(syntaxTree, semanticModel).Should().BeEquivalentTo(expectedExecutableLines);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Operations/Utilities/OperationExecutionOrderTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Collections;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing SonarAnalyzer.CFG.Operations.Utilities;\nusing StyleCop.Analyzers.Lightup;\n\nnamespace SonarAnalyzer.Test.Operations.Utilities;\n\n[TestClass]\npublic class OperationExecutionOrderTest\n{\n    [TestMethod]\n    [DataRow(false, DisplayName = \"Execution order\")]\n    [DataRow(true, DisplayName = \"Reversed execution order\")]\n    public void Linear(bool reverseOrder)\n    {\n        const string code = \"\"\"\n            var a = 1;\n            var b = 2;\n            a = b + 1;\n            Method();\n            \"\"\";\n        var expected = new[]\n        {\n            \"Literal: 1\",\n            \"VariableInitializer: = 1\",\n            \"VariableDeclarator: a = 1\",\n            \"VariableDeclaration: var a = 1\",\n            \"VariableDeclarationGroup: var a = 1;\",\n            \"Literal: 2\",\n            \"VariableInitializer: = 2\",\n            \"VariableDeclarator: b = 2\",\n            \"VariableDeclaration: var b = 2\",\n            \"VariableDeclarationGroup: var b = 2;\",\n            \"LocalReference: a\",\n            \"LocalReference: b\",\n            \"Literal: 1\",\n            \"Binary: b + 1\",\n            \"SimpleAssignment: a = b + 1\",\n            \"ExpressionStatement: a = b + 1;\",\n            \"Invocation: Method()\",\n            \"ExpressionStatement: Method();\"\n        };\n        ValidateOrder(code, expected, reverseOrder);\n    }\n\n    [TestMethod]\n    [DataRow(false, DisplayName = \"Execution order\")]\n    [DataRow(true, DisplayName = \"Reversed execution order\")]\n    public void Nested(bool reverseOrder)\n    {\n        const string code = \"\"\"\n            Method(0);\n            Method(1, Nested(40 + 2), 3);\n            Method(4);\n            \"\"\";\n        var expected = new[]\n        {\n            \"Literal: 0\",\n            \"Invocation: Method(0)\",\n            \"ExpressionStatement: Method(0);\",\n            \"Literal: 1\",\n            \"Literal: 40\",\n            \"Literal: 2\",\n            \"Binary: 40 + 2\",\n            \"Invocation: Nested(40 + 2)\",\n            \"Literal: 3\",\n            \"Invocation: Method(1, Nested(40 + 2), 3)\",\n            \"ExpressionStatement: Method(1, Nested(40 + 2), 3);\",\n            \"Literal: 4\",\n            \"Invocation: Method(4)\",\n            \"ExpressionStatement: Method(4);\"\n        };\n        ValidateOrder(code, expected, reverseOrder);\n    }\n\n    [TestMethod]\n    public void InterruptedEvaluation()\n    {\n        var enumerator = Compile(\"Method(0);\", false).GetEnumerator();\n        enumerator.MoveNext().Should().BeTrue();\n        enumerator.Current.Should().NotBeNull();\n        enumerator.Current.Instance.Should().NotBeNull();\n\n        enumerator.Reset();\n        enumerator.MoveNext().Should().BeTrue();\n        enumerator.Current.Should().NotBeNull();\n        enumerator.Current.Instance.Should().NotBeNull();\n\n        enumerator.Dispose();\n        enumerator.MoveNext().Should().BeFalse();\n        enumerator.Current.Should().NotBeNull();\n        enumerator.Current.Instance.Should().BeNull();\n    }\n\n    [TestMethod]\n    public void AsIEnumerable()\n    {\n        var enumerator = ((IEnumerable)Compile(\"Method(0);\", false)).GetEnumerator();\n        enumerator.MoveNext().Should().BeTrue();\n        enumerator.Current.Should().NotBeNull();\n    }\n\n    private static void ValidateOrder(string code, string[] expected, bool reverseOrder)\n    {\n        var sut = Compile(code, reverseOrder);\n        var list = new List<string>();\n        if (reverseOrder)\n        {\n            expected = Enumerable.Reverse(expected).ToArray();\n        }\n        foreach (var operation in sut)   // Act\n        {\n            if (!operation.IsImplicit)\n            {\n                list.Add(operation.Instance.Kind + \": \" + operation.Instance.Syntax);\n            }\n        }\n        list.Should().Equal(expected);\n    }\n\n    private static OperationExecutionOrder Compile(string methodBody, bool reverseOrder)\n    {\n        var code = $$\"\"\"\n            public class Sample\n            {\n                public void Main()\n                {\n            {{methodBody}}\n                }\n\n                public int Method(params int[] values) => 0;\n                public int Nested(params int[] values) => 0;\n            }\n            \"\"\";\n        var (tree, semanticModel) = TestCompiler.CompileCS(code);\n        var body = tree.First<BlockSyntax>();\n        var rootOperation = new IOperationWrapperSonar(semanticModel.GetOperation(body));\n        return new OperationExecutionOrder(rootOperation.Children, reverseOrder);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Operations/Utilities/OperationFinderTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Operations;\nusing SonarAnalyzer.CFG.Operations.Utilities;\nusing StyleCop.Analyzers.Lightup;\n\nnamespace SonarAnalyzer.Test.Operations.Utilities;\n\n[TestClass]\npublic class OperationFinderTest\n{\n    [TestMethod]\n    public void ValidateFinder()\n    {\n        const string code = @\"\npublic class Sample\n{\n    int field;\n\n    public void Method(bool condition)\n    {\n        if (condition)\n            field = 42 + 43;\n    }\n}\";\n        var cfg = TestCompiler.CompileCfgCS(code);\n        var assign = cfg.Blocks[2];\n        var finder = new FirstNumericLiteralFinder();\n        finder.TryFind(cfg.EntryBlock, out var result).Should().BeFalse();\n        result.Should().Be(default);\n        finder.TryFind(assign, out result).Should().BeTrue();\n        result.Should().Be(42);\n    }\n\n    private class FirstNumericLiteralFinder : OperationFinder<int>\n    {\n        protected override bool TryFindOperation(IOperationWrapperSonar operation, out int result)\n        {\n            if (operation.Instance is ILiteralOperation)\n            {\n                result = (int)operation.Instance.ConstantValue.Value;\n                return true;\n            }\n            result = default;\n            return false;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/AbstractClassToInterfaceTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class AbstractClassToInterfaceTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<AbstractClassToInterface>();\n\n    [TestMethod]\n    public void ClassShouldNotBeAbstract() =>\n        builder.AddPaths(\"AbstractClassToInterface.cs\").Verify();\n\n    [TestMethod]\n    public void ClassShouldNotBeAbstract_CS_Latest() =>\n        builder\n            .AddPaths(\"AbstractClassToInterface.Latest.cs\")\n            .AddPaths(\"AbstractClassToInterface.Latest.Partial.cs\")\n            .WithConcurrentAnalysis(false)\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/AbstractTypesShouldNotHaveConstructorsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class AbstractTypesShouldNotHaveConstructorsTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<AbstractTypesShouldNotHaveConstructors>();\n\n        [TestMethod]\n        public void AbstractTypesShouldNotHaveConstructors() =>\n            builder.AddPaths(\"AbstractTypesShouldNotHaveConstructors.cs\").Verify();\n\n        [TestMethod]\n        public void AbstractTypesShouldNotHaveConstructors_TopLevelStatements() =>\n            builder.AddPaths(\"AbstractTypesShouldNotHaveConstructors.TopLevelStatements.cs\")\n                .WithTopLevelStatements()\n                .Verify();\n\n        [TestMethod]\n        public void AbstractTypesShouldNotHaveConstructors_Latest() =>\n            builder.AddPaths(\"AbstractTypesShouldNotHaveConstructors.Latest.cs\")\n                .AddPaths(\"AbstractTypesShouldNotHaveConstructors.Latest.Partial.cs\")\n                .WithOptions(LanguageOptions.CSharpLatest)\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/AllBranchesShouldNotHaveSameImplementationTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class AllBranchesShouldNotHaveSameImplementationTest\n    {\n        private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.AllBranchesShouldNotHaveSameImplementation>();\n\n        [TestMethod]\n        public void AllBranchesShouldNotHaveSameImplementation_CSharp8() =>\n            builderCS.AddPaths(\"AllBranchesShouldNotHaveSameImplementation.cs\")\n                .WithOptions(LanguageOptions.FromCSharp8)\n                .Verify();\n\n        [TestMethod]\n        public void AllBranchesShouldNotHaveSameImplementation_CSharp9() =>\n            builderCS.AddPaths(\"AllBranchesShouldNotHaveSameImplementation.CSharp9.cs\")\n                .WithTopLevelStatements()\n                .Verify();\n\n        [TestMethod]\n        public void AllBranchesShouldNotHaveSameImplementation_VB() =>\n            new VerifierBuilder<VB.AllBranchesShouldNotHaveSameImplementation>().AddPaths(\"AllBranchesShouldNotHaveSameImplementation.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/AlwaysSetDateTimeKindTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class AlwaysSetDateTimeKindTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.AlwaysSetDateTimeKind>();\n\n    [TestMethod]\n    public void AlwaysSetDateTimeKind_CS() =>\n        builderCS.AddPaths(\"AlwaysSetDateTimeKind.cs\").Verify();\n\n    [TestMethod]\n    public void AlwaysSetDateTimeKind_VB() =>\n        new VerifierBuilder<VB.AlwaysSetDateTimeKind>().AddPaths(\"AlwaysSetDateTimeKind.vb\").Verify();\n\n    [TestMethod]\n    public void AlwaysSetDateTimeKind_CSharp9() =>\n        builderCS.AddSnippet(\n            \"\"\"\n                using System;\n\n                DateTime dateTime = new(1994, 07, 05, 16, 23, 00, 42, 42); // Noncompliant\n                //                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n                dateTime = new(1623, DateTimeKind.Unspecified); // Compliant\n                \"\"\")\n            .WithTopLevelStatements()\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/AnonymousDelegateEventUnsubscribeTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class AnonymousDelegateEventUnsubscribeTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<AnonymousDelegateEventUnsubscribe>();\n\n        [TestMethod]\n        public void AnonymousDelegateEventUnsubscribe() =>\n            builder.AddPaths(\"AnonymousDelegateEventUnsubscribe.cs\").Verify();\n\n        [TestMethod]\n        public void AnonymousDelegateEventUnsubscribe_CS_Latest() =>\n            builder.AddPaths(\"AnonymousDelegateEventUnsubscribe.Latest.cs\")\n                .WithOptions(LanguageOptions.CSharpLatest)\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ArgumentSpecifiedForCallerInfoParameterTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ArgumentSpecifiedForCallerInfoParameterTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<ArgumentSpecifiedForCallerInfoParameter>();\n\n    [TestMethod]\n    public void ArgumentSpecifiedForCallerInfoParameter() =>\n        builder.AddPaths(\"ArgumentSpecifiedForCallerInfoParameter.cs\").Verify();\n\n    [TestMethod]\n    public void ArgumentSpecifiedForCallerInfoParameter_CS_Latest() =>\n        builder.AddPaths(\"ArgumentSpecifiedForCallerInfoParameter.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ArrayCovarianceTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class ArrayCovarianceTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<ArrayCovariance>();\n\n        [TestMethod]\n        public void ArrayCovariance() =>\n            builder.AddPaths(\"ArrayCovariance.cs\").Verify();\n\n        [TestMethod]\n        public void ArrayCovariance_CSharp9() =>\n            builder.AddPaths(\"ArrayCovariance.CSharp9.cs\")\n                .WithOptions(LanguageOptions.FromCSharp9)\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ArrayCreationLongSyntaxTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class ArrayCreationLongSyntaxTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<ArrayCreationLongSyntax>();\n\n        [TestMethod]\n        public void ArrayCreationLongSyntax() =>\n            builder.AddPaths(\"ArrayCreationLongSyntax.vb\").Verify();\n\n        [TestMethod]\n        public void ArrayCreationLongSyntax_CodeFix() =>\n            builder.AddPaths(\"ArrayCreationLongSyntax.vb\").WithCodeFix<ArrayCreationLongSyntaxCodeFix>().WithCodeFixedPaths(\"ArrayCreationLongSyntax.Fixed.vb\").VerifyCodeFix();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ArrayDesignatorOnVariableTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class ArrayDesignatorOnVariableTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<ArrayDesignatorOnVariable>();\n\n        [TestMethod]\n        public void ArrayDesignatorOnVariable() =>\n            builder.AddPaths(\"ArrayDesignatorOnVariable.vb\").Verify();\n\n        [TestMethod]\n        public void ArrayDesignatorOnVariable_CodeFix() =>\n            builder.AddPaths(\"ArrayDesignatorOnVariable.vb\")\n                .WithCodeFix<ArrayDesignatorOnVariableCodeFix>()\n                .WithCodeFixedPaths(\"ArrayDesignatorOnVariable.Fixed.vb\")\n                .VerifyCodeFix();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ArrayInitializationMultipleStatementsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class ArrayInitializationMultipleStatementsTest\n    {\n        [TestMethod]\n        public void ArrayInitializationMultipleStatements() =>\n            new VerifierBuilder<ArrayInitializationMultipleStatements>().AddPaths(\"ArrayInitializationMultipleStatements.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ArrayPassedAsParamsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ArrayPassedAsParamsTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.ArrayPassedAsParams>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.ArrayPassedAsParams>();\n\n    [TestMethod]\n    public void ArrayPassedAsParams_CS() =>\n        builderCS.AddPaths(\"ArrayPassedAsParams.cs\").Verify();\n\n    [TestMethod]\n    public void ArrayPassedAsParams_CS_Latest() =>\n        builderCS.AddPaths(\"ArrayPassedAsParams.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .WithTopLevelStatements()\n            .Verify();\n\n    [TestMethod]\n    public void ArrayPassedAsParams_VB() =>\n        builderVB.AddPaths(\"ArrayPassedAsParams.vb\").Verify();\n\n    [TestMethod]\n    [DataRow(\"{ }\", false)]\n    [DataRow(\"\"\"{ \"s\", \"s\", \"s\", \"s\" }\"\"\", false)]\n    [DataRow(\"New String(2) { }\", true)]\n    [DataRow(\"\"\"New String(2) { \"s\", \"s\", \"s\" }\"\"\", false)]\n    [DataRow(\"New String() { }\", false)]\n    [DataRow(\"\"\"New String() { \"s\" }\"\"\", false)]\n    public void ArrayPassedAsParams_VBCollectionInitializerSyntaxTests(string arrayCreation, bool compliant)\n    {\n        var code = $$\"\"\"\n            Public Class C\n                Public Sub M()\n                    ParamsMethod({{arrayCreation}}) ' {{(compliant ? \"Compliant\" : \"Noncompliant\")}}\n                End Sub\n\n                Public Sub ParamsMethod(ParamArray p As String())\n                End Sub\n            End Class\n            \"\"\";\n        var builder = builderVB.AddSnippet(code);\n        if (compliant)\n        {\n            builder.VerifyNoIssues();\n        }\n        else\n        {\n            builder.Verify();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/AspNet/AnnotateApiActionsWithHttpVerbTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\n#if NET\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules.AspNet;\n\n[TestClass]\npublic class AnnotateApiActionsWithHttpVerbTest\n{\n    private static readonly VerifierBuilder Builder = new VerifierBuilder<AnnotateApiActionsWithHttpVerb>()\n        .WithBasePath(\"AspNet\")\n        .AddReferences(\n            [\n                AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcCore,             // ControllerBase, ApiController, etc\n                AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcViewFeatures,     // Controller\n                AspNetCoreMetadataReference.MicrosoftAspNetCoreHttpAbstractions,    // StatusCodes\n            ]);\n\n    [TestMethod]\n    public void AnnotateApiActionsWithHttpVerb_CS() =>\n        Builder\n        .AddPaths(\"AnnotateApiActionsWithHttpVerb.cs\")\n        .Verify();\n}\n#endif\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/AspNet/ApiControllersShouldNotDeriveDirectlyFromControllerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ApiControllersShouldNotDeriveDirectlyFromControllerTest\n{\n#if NET\n    private readonly VerifierBuilder builder = new VerifierBuilder<ApiControllersShouldNotDeriveDirectlyFromController>()\n        .AddReferences(AspNetCoreReferences)\n        .WithBasePath(\"AspNet\");\n\n    private static IEnumerable<MetadataReference> AspNetCoreReferences =>\n    [\n        AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcAbstractions,\n        AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcCore,\n        AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcViewFeatures,\n    ];\n\n    [TestMethod]\n    public void ApiControllersShouldNotDeriveDirectlyFromController_CS() =>\n        builder.AddPaths(\"ApiControllersShouldNotDeriveDirectlyFromController.cs\").Verify();\n\n    [DataRow(\"\"\"View()\"\"\")]\n    [DataRow(\"\"\"View(\"viewName\")\"\"\")]\n    [DataRow(\"\"\"View(model)\"\"\")]\n    [DataRow(\"\"\"View(\"viewName\", model)\"\"\")]\n    [DataRow(\"\"\"PartialView()\"\"\")]\n    [DataRow(\"\"\"PartialView(\"viewName\")\"\"\")]\n    [DataRow(\"\"\"PartialView(model)\"\"\")]\n    [DataRow(\"\"\"PartialView(\"viewName\", model)\"\"\")]\n    [DataRow(\"\"\"ViewComponent(\"foo\")\"\"\")]\n    [DataRow(\"\"\"ViewComponent(\"foo\", model)\"\"\")]\n    [DataRow(\"\"\"ViewComponent(typeof(object))\"\"\")]\n    [DataRow(\"\"\"ViewComponent(typeof(object), model)\"\"\")]\n    [DataRow(\"\"\"Json(model)\"\"\")]\n    [DataRow(\"\"\"Json(model, model)\"\"\")]\n    [DataRow(\"\"\"OnActionExecutionAsync(default(ActionExecutingContext), default(ActionExecutionDelegate))\"\"\")]\n    [DataRow(\"\"\"ViewData\"\"\")]\n    [DataRow(\"\"\"ViewBag\"\"\")]\n    [DataRow(\"\"\"TempData\"\"\")]\n    [DataRow(\"\"\"ViewData[\"foo\"]\"\"\")]\n    [DataRow(\"\"\"ViewBag[\"foo\"]\"\"\")]\n    [DataRow(\"\"\"TempData[\"foo\"]\"\"\")]\n    [TestMethod]\n    public void ApiControllersShouldNotDeriveDirectlyFromController_DoesNotRaiseWithViewFunctionality(string invocation) =>\n        builder.AddSnippet($$\"\"\"\n            using Microsoft.AspNetCore.Mvc;\n            using Microsoft.AspNetCore.Mvc.Filters;\n\n            [ApiController]\n            public class Invocations : Controller    // Compliant\n            {\n                object model = null;\n                public object Foo() => {{invocation}};\n            }\n            \"\"\").VerifyNoIssues();\n\n    [DataRow(\"\"\"OnActionExecuted(default(ActionExecutedContext))\"\"\")]\n    [DataRow(\"\"\"OnActionExecuting(default(ActionExecutingContext))\"\"\")]\n    [TestMethod]\n    public void ApiControllersShouldNotDeriveDirectlyFromController_DoesNotRaiseWithVoidInvocations(string assignment) =>\n        builder.AddSnippet($$\"\"\"\n            using Microsoft.AspNetCore.Mvc;\n            using Microsoft.AspNetCore.Mvc.Filters;\n\n            [ApiController]\n            public class VoidInvocations : Controller           // Compliant\n            {\n                public void Foo() => {{assignment}};\n            }\n            \"\"\").VerifyNoIssues();\n\n    [DataRow(\"public Test() => foo = View();\", DisplayName = \"Constructor\")]\n    [DataRow(\"~Test() => foo = View();\", DisplayName = \"Destructor\")]\n    [DataRow(\"object prop => View();\", DisplayName = \"PropertyGet\")]\n    [DataRow(\"object prop { set => _ = View(); }\", DisplayName = \"PropertySet\")]\n    [DataRow(\"object this[int index] => View();\", DisplayName = \"Indexer\")]\n    [TestMethod]\n    public void ApiControllersShouldNotDeriveDirectlyFromController_DoesNotRaiseInDifferentConstructs(string code) =>\n        builder.AddSnippet($$\"\"\"\n            using Microsoft.AspNetCore.Mvc;\n\n            [ApiController]\n            public class Test : Controller  // Compliant\n            {\n                object foo;\n                {{code}}\n            }\n            \"\"\").VerifyNoIssues();\n\n    [TestMethod]\n    public void ApiControllersShouldNotDeriveDirectlyFromController_CodeFix() =>\n        builder\n            .WithCodeFix<ApiControllersShouldNotDeriveDirectlyFromControllerCodeFix>()\n            .AddPaths(\"ApiControllersShouldNotDeriveDirectlyFromControllerCodeFix.cs\")\n            .WithCodeFixedPaths(\"ApiControllersShouldNotDeriveDirectlyFromControllerCodeFix.Fixed.cs\")\n            .VerifyCodeFix();\n#endif\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/AspNet/AvoidUnderPostingTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\n#if NET\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class AvoidUnderPostingTest\n{\n    private static readonly IEnumerable<MetadataReference> AspNetReferences = [\n                AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcAbstractions,\n                AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcCore,\n                AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcViewFeatures,\n                ..NuGetMetadataReference.SystemComponentModelAnnotations(TestConstants.NuGetLatestVersion)];\n\n    private readonly VerifierBuilder builder = new VerifierBuilder<AvoidUnderPosting>()\n            .WithBasePath(\"AspNet\")\n            .AddReferences([.. AspNetReferences, .. NuGetMetadataReference.SystemTextJson(\"7.0.4\"), .. NuGetMetadataReference.NewtonsoftJson(\"13.0.3\")]);\n\n    [TestMethod]\n    public void AvoidUnderPosting_CSharp() =>\n        builder.AddPaths(\"AvoidUnderPosting.cs\", \"AvoidUnderPosting.AutogeneratedModel.cs\").Verify();\n\n    [TestMethod]\n    public void AvoidUnderPosting_Latest() =>\n        builder.AddPaths(\"AvoidUnderPosting.Latest.cs\", \"AvoidUnderPosting.Latest.Partial.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    [DataRow(\"class\")]\n    [DataRow(\"struct\")]\n    [DataRow(\"record\")]\n    [DataRow(\"record struct\")]\n    public void AvoidUnderPosting_EnclosingTypes_CSharp(string enclosingType) =>\n        builder.AddSnippet($$\"\"\"\n            using Microsoft.AspNetCore.Mvc;\n            using System.ComponentModel.DataAnnotations;\n\n            public {{enclosingType}} Model\n            {\n                public int ValueProperty { get; set; }                      // Noncompliant\n                public int? NullableValueProperty { get; set; }             // Compliant\n                public required int RequiredValueProperty { get; set; }     // Compliant\n            }\n\n            public class ControllerClass : Controller\n            {\n                [HttpPost] public IActionResult Create(Model model) => View(model);\n            }\n            \"\"\")\n            .WithOptions(LanguageOptions.FromCSharp11)\n            .Verify();\n\n    [TestMethod]\n    [DataRow(\"HttpDelete\")]\n    [DataRow(\"HttpGet\")]\n    [DataRow(\"HttpPost\")]\n    [DataRow(\"HttpPut\")]\n    public void AvoidUnderPosting_HttpHandlers_CSharp(string attribute) =>\n        builder.AddSnippet($$\"\"\"\n            using Microsoft.AspNetCore.Mvc;\n            using System.ComponentModel.DataAnnotations;\n\n            public class Model\n            {\n                public int ValueProperty { get; set; }  // Noncompliant\n            }\n\n            public class ControllerClass : Controller\n            {\n                [{{attribute}}] public IActionResult Create(Model model) => View(model);\n            }\n            \"\"\").Verify();\n\n    [TestMethod]\n    public void AvoidUnderPosting_ModelInDifferentProject_CSharp()\n    {\n        const string modelCode = \"\"\"\n            namespace Models\n            {\n                public class Person\n                {\n                    public int Age { get; set; }    // FN - Roslyn can't raise an issue when the location is in different project than the one being analyzed\n                }\n            }\n            \"\"\";\n        const string controllerCode = \"\"\"\n            using Microsoft.AspNetCore.Mvc;\n            using Models;\n\n            namespace Controllers\n            {\n                public class PersonController : Controller\n                {\n                    [HttpPost] public IActionResult Post(Person person) => View(person);\n                }\n            }\n            \"\"\";\n        var solution = SolutionBuilder.Create()\n            .AddProject(AnalyzerLanguage.CSharp)\n            .AddSnippet(modelCode)\n            .Solution\n            .AddProject(AnalyzerLanguage.CSharp)\n            .AddProjectReference(x => x.ProjectIds[0])\n            .AddReferences(AspNetReferences)\n            .AddSnippet(controllerCode)\n            .Solution;\n        var compiledAspNetProject = solution.Compile()[1];\n        DiagnosticVerifier.Verify(compiledAspNetProject, [new AvoidUnderPosting()], CompilationErrorBehavior.Default, null, [], []);\n    }\n}\n\n#endif\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/AspNet/BackslashShouldBeAvoidedInAspNetRoutesTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Reflection;\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n#pragma warning disable T0008 // Internal Styling Rule T0008\n#pragma warning disable T0009 // Internal Styling Rule T0009\n\n[TestClass]\npublic class BackslashShouldBeAvoidedInAspNetRoutesTest\n{\n    private const string AttributePlaceholder = \"<attributeName>\";\n\n    private const string SlashAndBackslashConstants = \"\"\"\n        private const string ASlash = \"/\";\n        private const string ABackSlash = @\"\\\";\n        private const string AConstStringIncludingABackslash = $\"A{ABackSlash}\";\n        private const string AConstStringNotIncludingABackslash = $\"A{ASlash}\";\n        \"\"\";\n\n    private static readonly object[][] AttributesWithAllTypesOfStrings =\n    [\n        [$\"[{AttributePlaceholder}(AConstStringIncludingABackslash)]\", false, \"ConstStringIncludingABackslash\"],\n        [$\"[{AttributePlaceholder}(AConstStringNotIncludingABackslash)]\", true, \"ConstStringNotIncludingABackslash\"],\n        [$\"\"\"[{AttributePlaceholder}(\"\\u002f[action]\")]\"\"\", true, \"EscapeCodeOfSlash\"],\n        [$\"\"\"[{AttributePlaceholder}(\"\\u005c[action]\")]\"\"\", false, \"EscapeCodeOfBackslash\"],\n        [$$\"\"\"[{{AttributePlaceholder}}($\"A{ASlash}[action]\")]\"\"\", true, \"InterpolatedString\"],\n        [$$\"\"\"[{{AttributePlaceholder}}($@\"A{ABackSlash}[action]\")]\"\"\", false, \"InterpolatedVerbatimString\"],\n        [$\"\"\"\"[{AttributePlaceholder}(\"\"\"\\[action]\"\"\")]\"\"\"\", false, \"RawStringLiteralsTriple\"],\n        [$\"\"\"\"\"[{AttributePlaceholder}(\"\"\"\"\\[action]\"\"\"\")]\"\"\"\"\", false, \"RawStringLiteralsQuadruple\"],\n        [$$$\"\"\"\"[{{{AttributePlaceholder}}}($$\"\"\"{{ABackSlash}}/[action]\"\"\")]\"\"\"\", false, \"InterpolatedRawStringLiteralsIncludingABackslash\"],\n        [$$$\"\"\"\"[{{{AttributePlaceholder}}}($$\"\"\"{{ASlash}}/[action]\"\"\")]\"\"\"\", true, \"InterpolatedRawStringLiteralsNotIncludingABackslash\"],\n    ];\n\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.BackslashShouldBeAvoidedInAspNetRoutes>().WithBasePath(\"AspNet\");\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.BackslashShouldBeAvoidedInAspNetRoutes>().WithBasePath(\"AspNet\");\n\n    private static IEnumerable<object[]> RouteAttributesWithAllTypesOfStrings =>\n        AttributesWithAllTypesOfStrings.Select(x => new object[] { ((string)x[0]).Replace(AttributePlaceholder, \"Route\"), x[1], x[2] });\n\n    public static string AttributesWithAllTypesOfStringsDisplayNameProvider(MethodInfo methodInfo, object[] values) =>\n        $\"{methodInfo.Name}_{(string)values[2]}\";\n\n#if NETFRAMEWORK\n    // ASP.NET 4x MVC 3 and 4 don't support attribute routing, nor MapControllerRoute and similar\n    public static IEnumerable<object[]> AspNet4xMvcVersionsUnderTest =>\n        [[\"5.2.7\"] /* Most used */, [TestConstants.NuGetLatestVersion]];\n\n    private static IEnumerable<MetadataReference> AspNet4xReferences(string aspNetMvcVersion) =>\n        MetadataReferenceFacade.SystemWeb                                          // For HttpAttributeMethod and derived attributes\n            .Concat(NuGetMetadataReference.MicrosoftAspNetMvc(aspNetMvcVersion));  // For Controller\n\n    [TestMethod]\n    [DynamicData(nameof(AspNet4xMvcVersionsUnderTest))]\n    public void BackslashShouldBeAvoidedInAspNetRoutes_AspNet4x_CS(string aspNetMvcVersion) =>\n        builderCS\n            .AddPaths(\"BackslashShouldBeAvoidedInAspNetRoutes.AspNet4x.cs\")\n            .AddReferences(AspNet4xReferences(aspNetMvcVersion))\n            .Verify();\n\n    [TestMethod]\n    [DynamicData(\n        nameof(RouteAttributesWithAllTypesOfStrings),\n        DynamicDataDisplayName = nameof(AttributesWithAllTypesOfStringsDisplayNameProvider),\n        DynamicDataDisplayNameDeclaringType = typeof(BackslashShouldBeAvoidedInAspNetRoutesTest))]\n    public void BackslashShouldBeAvoidedInAspNetRoutes_AspNet4x_CS_Latest(string actionDeclaration, bool compliant, string displayName)\n    {\n        actionDeclaration = actionDeclaration.Replace(AttributePlaceholder, \"Route\");\n        var builder = builderCS.AddReferences(AspNet4xReferences(\"5.2.7\")).WithOptions(LanguageOptions.CSharpLatest).AddSnippet($$\"\"\"\n            using System.Web.Mvc;\n\n            public class WithAllTypesOfStringsController : Controller\n            {\n                {{SlashAndBackslashConstants}}\n\n                {{(compliant ? actionDeclaration : actionDeclaration + \" // Noncompliant\")}}\n                public ActionResult Index() => View();\n            }\n            \"\"\");\n\n        if (compliant)\n        {\n            builder.VerifyNoIssues();\n        }\n        else\n        {\n            builder.Verify();\n        }\n    }\n\n    [TestMethod]\n    [DynamicData(nameof(AspNet4xMvcVersionsUnderTest))]\n    public void BackslashShouldBeAvoidedInAspNetRoutes_AspNet4x_VB(string aspNetMvcVersion) =>\n        builderVB\n            .AddPaths(\"BackslashShouldBeAvoidedInAspNetRoutes.AspNet4x.vb\")\n            .AddReferences(AspNet4xReferences(aspNetMvcVersion))\n            .Verify();\n#endif\n\n#if NET\n    private static IEnumerable<object[]> HttpMethodAttributesWithAllTypesOfStrings =>\n        AttributesWithAllTypesOfStrings.Zip(\n            [\"HttpGet\", \"HttpPost\", \"HttpPatch\", \"HttpHead\", \"HttpDelete\", \"HttpOptions\", \"HttpGet\", \"HttpPost\", \"HttpPatch\", \"HttpHead\"],\n            (attribute, httpMethod) => new object[] { ((string)attribute[0]).Replace(AttributePlaceholder, httpMethod), attribute[1], attribute[2] });\n\n    public static IEnumerable<object[]> AspNetCore2xVersionsUnderTest =>\n        [[\"2.0.4\"] /* Latest 2.0.x */, [\"2.2.0\"] /* 2nd most used */, [TestConstants.NuGetLatestVersion]];\n\n    private static IEnumerable<MetadataReference> AspNetCore2xReferences(string aspNetCoreVersion) =>\n        NuGetMetadataReference.MicrosoftAspNetCoreMvcCore(aspNetCoreVersion)                       // For Controller\n            .Concat(NuGetMetadataReference.MicrosoftAspNetCoreMvcViewFeatures(aspNetCoreVersion))  // For View\n            .Concat(NuGetMetadataReference.MicrosoftAspNetCoreMvcAbstractions(aspNetCoreVersion)); // For IActionResult\n\n    private static IEnumerable<MetadataReference> AspNetCore3AndAboveReferences =>\n        [\n            AspNetCoreMetadataReference.MicrosoftAspNetCore,                    // For WebApplication\n            AspNetCoreMetadataReference.MicrosoftExtensionsHostingAbstractions, // For IHost\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreHttpAbstractions,    // For HttpContext, RouteValueDictionary\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreHttpFeatures,\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcAbstractions,\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcCore,\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcRazorPages,       // For RazorPagesEndpointRouteBuilderExtensions.MapFallbackToPage\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcViewFeatures,\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreRouting,             // For IEndpointRouteBuilder\n        ];\n\n    [TestMethod]\n    public void BackslashShouldBeAvoidedInAspNetRoutes_CrossFilePartialClass_DoesNotThrow() =>\n        builderCS\n            .AddReferences(AspNetCore3AndAboveReferences)\n            .AddSnippet(\"\"\"\n                using System;\n\n                public partial class SomeComponent\n                {\n                    private TimeSpan _elapsedTime = TimeSpan.Zero;\n                }\n                \"\"\")\n            .AddSnippet(\"\"\"\n                using Microsoft.AspNetCore.Mvc;\n                using System;\n\n                public class MyController : Controller\n                {\n                    public IActionResult Index() => View();\n                }\n\n                public partial class SomeComponent\n                {\n                    public void Process()\n                    {\n                        Use(_elapsedTime);\n                    }\n\n                    private void Use(object value) { }\n                }\n                \"\"\")\n            .VerifyNoIssues();\n\n    [TestMethod]\n    [DynamicData(nameof(AspNetCore2xVersionsUnderTest))]\n    public void BackslashShouldBeAvoidedInAspNetRoutes_AspNetCore2x_CS(string aspNetCoreVersion) =>\n        builderCS\n            .AddPaths(\"BackslashShouldBeAvoidedInAspNetRoutes.AspNetCore2AndAbove.cs\")\n            .AddReferences(AspNetCore2xReferences(aspNetCoreVersion))\n            .Verify();\n\n    [TestMethod]\n    [DynamicData(\n        nameof(RouteAttributesWithAllTypesOfStrings),\n        DynamicDataDisplayName = nameof(AttributesWithAllTypesOfStringsDisplayNameProvider),\n        DynamicDataDisplayNameDeclaringType = typeof(BackslashShouldBeAvoidedInAspNetRoutesTest))]\n    public void BackslashShouldBeAvoidedInAspNetRoutes_AspNetCore2x_Route_CS_Latest(string actionDeclaration, bool compliant, string displayName) =>\n        TestAspNetCoreAttributeDeclaration(\n            builderCS.AddReferences(AspNetCore2xReferences(\"2.2.0\")).WithOptions(LanguageOptions.CSharpLatest),\n            actionDeclaration,\n            compliant);\n\n    [TestMethod]\n    [DynamicData(\n        nameof(HttpMethodAttributesWithAllTypesOfStrings),\n        DynamicDataDisplayName = nameof(AttributesWithAllTypesOfStringsDisplayNameProvider),\n        DynamicDataDisplayNameDeclaringType = typeof(BackslashShouldBeAvoidedInAspNetRoutesTest))]\n    public void BackslashShouldBeAvoidedInAspNetRoutes_AspNetCore2x_HttpMethods_CS_Latest(string actionDeclaration, bool compliant, string displayName) =>\n        TestAspNetCoreAttributeDeclaration(\n            builderCS.AddReferences(AspNetCore2xReferences(\"2.2.0\")).WithOptions(LanguageOptions.CSharpLatest),\n            actionDeclaration,\n            compliant);\n\n    [TestMethod]\n    [DynamicData(\n        nameof(RouteAttributesWithAllTypesOfStrings),\n        DynamicDataDisplayName = nameof(AttributesWithAllTypesOfStringsDisplayNameProvider),\n        DynamicDataDisplayNameDeclaringType = typeof(BackslashShouldBeAvoidedInAspNetRoutesTest))]\n    public void BackslashShouldBeAvoidedInAspNetRoutes_AspNetCore3AndAbove_Route_CS_Latest(string actionDeclaration, bool compliant, string displayName) =>\n        TestAspNetCoreAttributeDeclaration(\n            builderCS.AddReferences(AspNetCore3AndAboveReferences).WithOptions(LanguageOptions.CSharpLatest),\n            actionDeclaration,\n            compliant);\n\n    [TestMethod]\n    [DynamicData(\n        nameof(HttpMethodAttributesWithAllTypesOfStrings),\n        DynamicDataDisplayName = nameof(AttributesWithAllTypesOfStringsDisplayNameProvider),\n        DynamicDataDisplayNameDeclaringType = typeof(BackslashShouldBeAvoidedInAspNetRoutesTest))]\n    public void BackslashShouldBeAvoidedInAspNetRoutes_AspNetCore3AndAbove_HttpMethods_CS_Latest(string actionDeclaration, bool compliant, string displayName) =>\n        TestAspNetCoreAttributeDeclaration(\n            builderCS.AddReferences(AspNetCore3AndAboveReferences).WithOptions(LanguageOptions.CSharpLatest),\n            actionDeclaration,\n            compliant);\n\n    [TestMethod]\n    [DynamicData(nameof(AspNetCore2xVersionsUnderTest))]\n    public void BackslashShouldBeAvoidedInAspNetRoutes_AspNetCore2x_VB(string aspNetCoreVersion) =>\n        builderVB\n            .AddPaths(\"BackslashShouldBeAvoidedInAspNetRoutes.AspNetCore2x.vb\")\n            .AddReferences(AspNetCore2xReferences(aspNetCoreVersion))\n            .Verify();\n\n    [TestMethod]\n    [DynamicData(nameof(AspNetCore2xVersionsUnderTest))]\n    public void BackslashShouldBeAvoidedInAspNetRoutes_AspNetCore2x_CS_Latest(string aspNetCoreVersion) =>\n        builderCS\n            .AddPaths(\"BackslashShouldBeAvoidedInAspNetRoutes.AspNetCore2x.Latest.cs\")\n            .AddReferences(AspNetCore2xReferences(aspNetCoreVersion))\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void BackslashShouldBeAvoidedInAspNetRoutes_AspNetCore3AndAbove_CS() =>\n        builderCS\n            .AddPaths(\"BackslashShouldBeAvoidedInAspNetRoutes.AspNetCore2AndAbove.cs\")\n            .AddReferences(AspNetCore3AndAboveReferences)\n            .Verify();\n\n    [TestMethod]\n    public void BackslashShouldBeAvoidedInAspNetRoutes_AspNetCore3AndAbove_CS_Latest() =>\n        builderCS\n            .AddPaths(\"BackslashShouldBeAvoidedInAspNetRoutes.AspNetCore3AndAbove.Latest.cs\")\n            .AddReferences(AspNetCore3AndAboveReferences)\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void BackslashShouldBeAvoidedInAspNetRoutes_AspNetCore3AndAbove_VB() =>\n        builderVB\n            .AddPaths(\"BackslashShouldBeAvoidedInAspNetRoutes.AspNetCore3AndAbove.vb\")\n            .AddReferences(AspNetCore3AndAboveReferences)\n            .Verify();\n\n    [TestMethod]\n    public void BackslashShouldBeAvoidedInAspNetRoutes_AspNetCore8AndAbove_CS_Latest() =>\n        builderCS\n            .AddPaths(\"BackslashShouldBeAvoidedInAspNetRoutes.AspNetCore8AndAbove.Latest.cs\")\n            .AddReferences(AspNetCore3AndAboveReferences)\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void BackslashShouldBeAvoidedInAspNetRoutes_AspNetCore8AndAbove_VB() =>\n        builderVB\n            .AddPaths(\"BackslashShouldBeAvoidedInAspNetRoutes.AspNetCore8AndAbove.vb\")\n            .AddReferences(AspNetCore3AndAboveReferences)\n            .Verify();\n\n    private static void TestAspNetCoreAttributeDeclaration(VerifierBuilder builder, string attributeDeclaration, bool compliant)\n    {\n        builder = builder.AddSnippet($$\"\"\"\n            using Microsoft.AspNetCore.Mvc;\n\n            public class WithAllTypesOfStringsController : Controller\n            {\n                {{SlashAndBackslashConstants}}\n\n                {{(compliant ? attributeDeclaration : attributeDeclaration + \" // Noncompliant\")}}\n                public IActionResult Index() => View();\n            }\n            \"\"\");\n\n        if (compliant)\n        {\n            builder.VerifyNoIssues();\n        }\n        else\n        {\n            builder.Verify();\n        }\n    }\n#endif\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/AspNet/CallModelStateIsValidTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\n#if NET\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class CallModelStateIsValidTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<CallModelStateIsValid>()\n        .WithBasePath(\"AspNet\")\n        .AddReferences([\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcAbstractions,\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcCore,\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcViewFeatures,\n            ..NuGetMetadataReference.SystemComponentModelAnnotations(TestConstants.NuGetLatestVersion)\n        ]);\n\n    [TestMethod]\n    public void CallModelStateIsValid_CS() =>\n        builder.AddPaths(\"CallModelStateIsValid.cs\", \"CallModelStateIsValid.AutogeneratedController.cs\").Verify();\n\n    [TestMethod]\n    public void CallModelStateIsValid_CS_Latest() =>\n        builder.AddPaths(\"CallModelStateIsValid.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void CallModelStateIsValid_AssemblyLevelControllerAttribute_CS() =>\n        builder.AddSnippet(\"\"\"\n            using Microsoft.AspNetCore.Mvc;\n            using System.ComponentModel.DataAnnotations;\n\n            [assembly: ApiController]           // causes the ApiController attribute to be applied on every Controller class in the assembly\n\n            public class Movie\n            {\n                [Required] public string Title { get; set; }\n                [Range(1900, 2200)] public int Year { get; set; }\n            }\n\n            public class ControllerWithApiAttributeAtTheAssemblyLevel : ControllerBase\n            {\n                [HttpPost(\"/[controller]\")]\n                public string Add(Movie movie)  // Compliant - ApiController attribute is applied at the assembly level.\n                {\n                    return \"Hello!\";\n                }\n            }\n            \"\"\").VerifyNoIssues();\n\n    [TestMethod]\n    public void CallModelStateIsValid_FluentValidation_CS() =>\n        builder.AddSnippet(\"\"\"\n            using Microsoft.AspNetCore.Mvc;\n            using FluentValidation;\n\n            public class Movie\n            {\n                public string Title { get; set; }\n                public int Year { get; set; }\n            }\n\n            public class MovieValidator : AbstractValidator<Movie>\n            {\n              public MovieValidator()\n              {\n                RuleFor(x => x.Title).NotNull();\n                RuleFor(x => x.Year).InclusiveBetween(1900, 2100);\n              }\n            }\n\n            public class MovieController : ControllerBase\n            {\n                private IValidator<Movie> _validator;\n\n                public MovieController(IValidator<Movie> validator)\n                {\n                    _validator = validator;\n                }\n\n                [HttpPost(\"/[controller]\")]\n                public string Add(Movie movie)  // Compliant - uses FluentValidation\n                {\n                    if (!_validator.Validate(movie).IsValid)\n                    {\n                        return \"\";\n                    }\n                    return \"Hello!\";\n                }\n            }\n\n            [Controller]\n            public class PocoMovieController\n            {\n                private IValidator<Movie> _validator;\n\n                public PocoMovieController(IValidator<Movie> validator)\n                {\n                    _validator = validator;\n                }\n\n                [HttpPost(\"/[controller]\")]\n                public string Add(Movie movie)  // Compliant - uses FluentValidation\n                {\n                    if (!_validator.Validate(movie).IsValid)\n                    {\n                        return \"\";\n                    }\n                    return \"Hello!\";\n                }\n            }\n\n            public class NonValidatingMovieController : ControllerBase\n            {\n                [HttpPost(\"/[controller]\")]\n                public string Add(Movie movie)  // FN - the project references FluentValidation, but doesn't use it\n                {\n                    return \"Hello!\";\n                }\n            }\n            \"\"\").AddReferences(NuGetMetadataReference.FluentValidation()).VerifyNoIssues();\n\n    [TestMethod]\n    [DataRow(\"!ModelState.IsValid\")]\n    [DataRow(\"ModelState?.IsValid is false\")]\n    [DataRow(\"!ModelState!.IsValid\")]\n    [DataRow(\"ModelState!?.IsValid is false\")]\n    [DataRow(\"ModelState?.IsValid! is false\")]\n    [DataRow(\"ModelState is { IsValid: false }\")]\n    [DataRow(\"this is { ModelState.IsValid: false }\")]\n    [DataRow(\"this is { ModelState: { IsValid: false } }\")]\n    [DataRow(\"this is { ModelState: { IsValid: not true } }\")]\n    [DataRow(\"ModelState.ValidationState != ModelValidationState.Valid\")]\n    [DataRow(\"ModelState.ValidationState == ModelValidationState.Invalid\")]\n    [DataRow(\"ModelState is { ValidationState: ModelValidationState.Invalid }\")]\n    public void CallModelStateIsValid_ValidatingState_CS(string condition) =>\n        builder.AddSnippet($$\"\"\"\n            using Microsoft.AspNetCore.Mvc;\n            using Microsoft.AspNetCore.Mvc.ModelBinding;\n            using System.ComponentModel.DataAnnotations;\n\n            public class Movie\n            {\n                [Required] public string Title { get; set; }\n                [Range(1900, 2200)] public int Year { get; set; }\n            }\n\n            public class MovieController : ControllerBase\n            {\n                [HttpPost(\"/[controller]\")]\n                public IActionResult Add(Movie movie)  // Compliant\n                {\n                    if ({{condition}})\n                    {\n                        return BadRequest();\n                    }\n                    return Ok();\n                }\n            }\n            \"\"\").WithOptions(LanguageOptions.FromCSharp10).VerifyNoIssues();\n}\n\n#endif\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/AspNet/ControllersHaveMixedResponsibilitiesTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n#if NET\n\n[TestClass]\npublic class ControllersHaveMixedResponsibilitiesTest\n{\n    private readonly VerifierBuilder builder =\n        new VerifierBuilder<ControllersHaveMixedResponsibilities>().AddReferences(References).WithBasePath(\"AspNet\");\n\n    private static IEnumerable<MetadataReference> References =>\n    [\n        AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcAbstractions,\n        AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcCore,\n        AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcViewFeatures,\n        CoreMetadataReference.SystemComponentModel, // For IServiceProvider\n        .. NuGetMetadataReference.MicrosoftExtensionsDependencyInjectionAbstractions(\"8.0.1\"), // For IServiceProvider extensions\n    ];\n\n    [TestMethod]\n    public void ControllersHaveMixedResponsibilities_CS() =>\n        builder\n            .AddPaths(\"ControllersHaveMixedResponsibilities.Latest.cs\", \"ControllersHaveMixedResponsibilities.Latest.Partial.cs\")\n            .WithLanguageVersion(LanguageVersion.Latest)\n            .Verify();\n}\n\n#endif\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/AspNet/ControllersReuseClientTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n#if NET\n\n[TestClass]\npublic class ControllersReuseClientTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<ControllersReuseClient>()\n        .WithBasePath(\"AspNet\")\n        .AddReferences(\n        [\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcAbstractions,\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcCore,\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcViewFeatures,\n            .. MetadataReferenceFacade.SystemThreadingTasks,\n            .. NuGetMetadataReference.SystemNetHttp(),\n            .. NuGetMetadataReference.MicrosoftExtensionsHttp()\n        ]);\n\n    [TestMethod]\n    public void ControllersReuseClient_CS() =>\n        builder\n            .AddPaths(\"ControllersReuseClient.cs\")\n            .Verify();\n\n    [TestMethod]\n    public void ControllersReuseClient_CS8() =>\n        builder\n            .AddPaths(\"ControllersReuseClient.CSharp8.cs\")\n            .WithOptions(LanguageOptions.FromCSharp8)\n            .Verify();\n\n    [TestMethod]\n    public void ControllersReuseClient_CS9() =>\n        builder\n            .AddPaths(\"ControllersReuseClient.CSharp9.cs\")\n            .WithOptions(LanguageOptions.FromCSharp9)\n            .Verify();\n\n    [TestMethod]\n    public void ControllersReuseClient_CS12() =>\n        builder\n            .AddPaths(\"ControllerReuseClient.CSharp12.cs\")\n            .WithOptions(LanguageOptions.FromCSharp12).Verify();\n}\n#endif\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/AspNet/RouteTemplateShouldNotStartWithSlashTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class RouteTemplateShouldNotStartWithSlashTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.RouteTemplateShouldNotStartWithSlash>().WithBasePath(\"AspNet\");\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.RouteTemplateShouldNotStartWithSlash>().WithBasePath(\"AspNet\");\n\n#if NET\n    [TestMethod]\n    public void RouteTemplateShouldNotStartWithSlash_CS() =>\n        builderCS\n            .AddPaths(\"RouteTemplateShouldNotStartWithSlash.AspNetCore.cs\", \"RouteTemplateShouldNotStartWithSlash.AspNetCore.PartialAutogenerated.cs\")\n            .WithConcurrentAnalysis(false)\n            .AddReferences(AspNetCoreMetadataReference.BasicReferences)\n            .Verify();\n\n    [DataRow(\"\"\"[HttpGet(\"/Index1\")]\"\"\", \"\", false)]\n    [DataRow(\"\"\"[Route(\"/Index2\")]\"\"\", \"\", false)]\n    [DataRow(\"\"\"[HttpGet(\"\\\\Index1\")]\"\"\", \"\", true)]\n    [DataRow(\"\"\"[Route(\"\\\\Index2\")]\"\"\", \"\", true)]\n    [DataRow(\"\"\"[HttpGet(\"Index1/SubPath\")]\"\"\", \"\", true)]\n    [DataRow(\"\"\"[Route(\"Index2/SubPath\")]\"\"\", \"\", true)]\n    [DataRow(\"\"\"[Route(\"/IndexA\")]\"\"\", \"\"\"[Route(\"/IndexB\")]\"\"\", false)]\n    [DataRow(\"\"\"[Route(\"/IndexC\")]\"\"\", \"\"\"[HttpGet(\"/IndexD\")]\"\"\", false)]\n    [TestMethod]\n    public void RouteTemplateShouldNotStartWithSlash_RouteAttributes(string firstAttribute, string secondAttribute, bool compliant)\n    {\n        var builder = builderCS.AddReferences(AspNetCoreMetadataReference.BasicReferences)\n            .AddSnippet($$\"\"\"\n                using Microsoft.AspNetCore.Mvc;\n                using Microsoft.AspNetCore.Mvc.Routing;\n\n                [Route(\"[controller]\")]\n                public class BasicsController : Controller {{(compliant ? string.Empty : \" // Noncompliant\")}}\n                {\n                    {{firstAttribute}}{{(compliant ? string.Empty : \" // Secondary\")}}\n                    {{secondAttribute}}{{(compliant || string.IsNullOrEmpty(secondAttribute) ? string.Empty : \" // Secondary\")}}\n                    public ActionResult SomeAction() => View();\n                }\n                \"\"\");\n\n        if (compliant)\n        {\n            builder.VerifyNoIssues();\n        }\n        else\n        {\n            builder.Verify();\n        }\n    }\n\n    [DataRow(\"\"\"[Route(template: @\"/[action]\", Name = \"a\", Order = 42)]\"\"\")]\n    [DataRow(\"\"\"[RouteAttribute(@\"/[action]\")]\"\"\")]\n    [DataRow(\"\"\"[Microsoft.AspNetCore.Mvc.RouteAttribute(@\"/[action]\")]\"\"\")]\n    [DataRow(\"\"\"[method:Route(@\"/[action]\")]\"\"\")]\n    [DataRow(\"\"\"[HttpGet(\"/IndexGet\")]\"\"\")]\n    [DataRow(\"\"\"[HttpPost(\"/IndexPost\")]\"\"\")]\n    [DataRow(\"\"\"[HttpPut(\"/IndexPut\")]\"\"\")]\n    [DataRow(\"\"\"[HttpDelete(\"/IndexDelete\")]\"\"\")]\n    [DataRow(\"\"\"[HttpPatch(\"/IndexPatch\")]\"\"\")]\n    [DataRow(\"\"\"[HttpHead(\"/IndexHead\")]\"\"\")]\n    [DataRow(\"\"\"[HttpOptions(\"/IndexOptions\")]\"\"\")]\n    [TestMethod]\n    public void RouteTemplateShouldNotStartWithSlash_Attributes(string attribute)\n    {\n        var builder = builderCS.AddReferences(AspNetCoreMetadataReference.BasicReferences)\n            .AddSnippet($$\"\"\"\n                using Microsoft.AspNetCore.Mvc;\n                using Microsoft.AspNetCore.Mvc.Routing;\n\n                public class BasicsController : Controller  // Noncompliant\n                {\n                    {{attribute}} // Secondary\n                    public ActionResult SomeAction() => View();\n                }\n                \"\"\");\n        builder.Verify();\n    }\n\n    [DataRow(\"\"\"(@\"/[action]\")\"\"\", false)]\n    [DataRow(\"\"\"(\"/[action]\")\"\"\", false)]\n    [DataRow(\"\"\"(\"\\u002f[action]\")\"\"\", false)]\n    [DataRow(\"\"\"($\"/{ConstA}/[action]\")\"\"\", false)]\n    [DataRow(\"\"\"\"(\"\"\"/[action]\"\"\")\"\"\"\", false)]\n    [DataRow(\"\"\"\"\"\"(\"\"\"\"/[action]\"\"\"\")\"\"\"\"\"\", false)]\n    [DataRow(\"\"\"\"($$\"\"\"/{{ConstA}}/[action]\"\"\")\"\"\"\", false)]\n    [DataRow(\"\"\"(@\"/[action]\", Name = \"a\", Order = 42)\"\"\", false)]\n    [DataRow(\"\"\"($\"{ConstA}/[action]\")\"\"\", true)]\n    [DataRow(\"\"\"($\"{ConstSlash}[action]\")\"\"\", false)]\n    [TestMethod]\n    public void RouteTemplateShouldNotStartWithSlash_WithAllTypesOfStrings(string attributeParameter, bool compliant)\n    {\n        var builder = builderCS\n            .AddReferences(AspNetCoreMetadataReference.BasicReferences)\n            .WithOptions(LanguageOptions.FromCSharp11)\n            .AddSnippet($$\"\"\"\n                using Microsoft.AspNetCore.Mvc;\n                using Microsoft.AspNetCore.Mvc.Routing;\n\n                public class BasicsController : Controller {{(compliant ? string.Empty : \" // Noncompliant\")}}\n                {\n                    private const string ConstA = \"A\";\n                    private const string ConstSlash = \"/\";\n\n                    [Route{{attributeParameter}}] {{(compliant ? string.Empty : \" // Secondary\")}}\n                    public ActionResult SomeAction() => View();\n                }\n                \"\"\");\n\n        if (compliant)\n        {\n            builder.VerifyNoIssues();\n        }\n        else\n        {\n            builder.Verify();\n        }\n    }\n\n    [TestMethod]\n    public void RouteTemplateShouldNotStartWithSlash_VB() =>\n        builderVB\n            .AddPaths(\"RouteTemplateShouldNotStartWithSlash.AspNetCore.vb\")\n            .AddReferences(AspNetCoreMetadataReference.BasicReferences)\n            .Verify();\n\n    [TestMethod]\n    public void RouteTemplateShouldNotStartWithSlash_CSharp12() =>\n        builderCS\n            .AddPaths(\"RouteTemplateShouldNotStartWithSlash.AspNetCore.CSharp12.cs\")\n            .WithOptions(LanguageOptions.FromCSharp12)\n            .AddReferences(AspNetCoreMetadataReference.BasicReferences)\n            .Verify();\n\n#endif\n\n#if NETFRAMEWORK\n    // ASP.NET 4x MVC 3 and 4 don't support attribute routing, nor MapControllerRoute and similar\n    public static IEnumerable<object[]> AspNet4xMvcVersionsUnderTest => [[\"5.2.7\"] /* Most used */, [TestConstants.NuGetLatestVersion]];\n\n    private static IEnumerable<MetadataReference> AspNet4xReferences(string aspNetMvcVersion) =>\n        MetadataReferenceFacade.SystemWeb\n            .Concat(NuGetMetadataReference.MicrosoftAspNetMvc(aspNetMvcVersion));\n\n    [TestMethod]\n    [DynamicData(nameof(AspNet4xMvcVersionsUnderTest))]\n    public void RouteTemplateShouldNotStartWithSlash_CS(string aspNetMvcVersion) =>\n        builderCS\n            .AddPaths(\"RouteTemplateShouldNotStartWithSlash.AspNet4x.cs\", \"RouteTemplateShouldNotStartWithSlash.AspNet4x.PartialAutogenerated.cs\")\n            .WithConcurrentAnalysis(false)\n            .AddReferences(AspNet4xReferences(aspNetMvcVersion))\n            .Verify();\n\n    [TestMethod]\n    [DynamicData(nameof(AspNet4xMvcVersionsUnderTest))]\n    public void RouteTemplateShouldNotStartWithSlash_VB(string aspNetMvcVersion) =>\n        builderVB\n            .AddPaths(\"RouteTemplateShouldNotStartWithSlash.AspNet4x.vb\")\n            .AddReferences(AspNet4xReferences(aspNetMvcVersion))\n            .Verify();\n\n    [DataRow(\"/Index2\", false)]\n    [DataRow(@\"\\Index2\", true)]\n    [DataRow(\"Index1/SubPath\", true)]\n    [TestMethod]\n    public void RouteTemplateShouldNotStartWithSlash_WithHttpAttribute(string attributeParameter, bool compliant)\n    {\n        var builder = builderCS.AddReferences(AspNet4xReferences(\"5.2.7\")).AddSnippet($$\"\"\"\n            using System.Web.Mvc;\n\n            [Route(\"[controller]\")]\n            public class BasicsController : Controller {{(compliant ? string.Empty : \" // Noncompliant\")}}\n            {\n                [HttpGet]\n                [Route(@\"{{attributeParameter}}\")] {{(compliant ? string.Empty : \" // Secondary\")}}\n                public ActionResult SomeAction() => View();\n            }\n            \"\"\");\n\n        if (compliant)\n        {\n            builder.VerifyNoIssues();\n        }\n        else\n        {\n            builder.Verify();\n        }\n    }\n\n    [DataRow(\"\"\"[Route(template: @\"/[action]\", Name = \"a\", Order = 42)]\"\"\", false)]\n    [DataRow(\"\"\"[Route(template: @\"[action]\", Name = \"/a\", Order = 42)]\"\"\", true)]\n    [DataRow(\"\"\"[RouteAttribute(@\"/[action]\")]\"\"\", false)]\n    [DataRow(\"\"\"[RouteAttribute(@\"/[action]\")]\"\"\", false)]\n    [DataRow(\"\"\"[System.Web.Mvc.RouteAttribute(@\"/[action]\")]\"\"\", false)]\n    [DataRow(\"\"\"[method:Route(@\"/[action]\")]\"\"\", false)]\n    [TestMethod]\n    public void RouteTemplateShouldNotStartWithSlash_WithAttributeSyntaxVariations(string attribute, bool compliant)\n    {\n        var builder = builderCS.AddReferences(AspNet4xReferences(\"5.2.7\"))\n            .WithOptions(LanguageOptions.FromCSharp11)\n            .AddSnippet($$\"\"\"\n                using System.Web.Mvc;\n\n                [Route(\"[controller]\")]\n                public class BasicsController : Controller {{(compliant ? string.Empty : \" // Noncompliant\")}}\n                {\n                    {{attribute}} {{(compliant ? string.Empty : \" // Secondary\")}}\n                    public ActionResult SomeAction() => View();\n                }\n                \"\"\");\n        if (compliant)\n        {\n            builder.VerifyNoIssues();\n        }\n        else\n        {\n            builder.Verify();\n        }\n    }\n\n    [DataRow(\"\"\"(@\"/[action]\")\"\"\", false)]\n    [DataRow(\"\"\"(\"/[action]\")\"\"\", false)]\n    [DataRow(\"\"\"(\"\\u002f[action]\")\"\"\", false)]\n    [DataRow(\"\"\"($\"/{ConstA}/[action]\")\"\"\", false)]\n    [DataRow(\"\"\"\"(\"\"\"/[action]\"\"\")\"\"\"\", false)]\n    [DataRow(\"\"\"\"\"\"(\"\"\"\"/[action]\"\"\"\")\"\"\"\"\"\", false)]\n    [DataRow(\"\"\"\"($$\"\"\"/{{ConstA}}/[action]\"\"\")\"\"\"\", false)]\n    [DataRow(\"\"\"(@\"/[action]\", Name = \"a\", Order = 42)\"\"\", false)]\n    [DataRow(\"\"\"($\"{ConstA}/[action]\")\"\"\", true)]\n    [DataRow(\"\"\"($\"{ConstSlash}[action]\")\"\"\", false)]\n    [TestMethod]\n    public void RouteTemplateShouldNotStartWithSlash_WithAllTypesOfStrings(string attributeParameter, bool compliant)\n    {\n        var builder = builderCS\n            .AddReferences(AspNet4xReferences(\"5.2.7\"))\n            .WithOptions(LanguageOptions.FromCSharp11)\n            .AddSnippet($$\"\"\"\n                using System.Web.Mvc;\n\n                [Route(\"[controller]\")]\n                public class BasicsController : Controller {{(compliant ? string.Empty : \" // Noncompliant\")}}\n                {\n                    private const string ConstA = \"A\";\n                    private const string ConstSlash = \"/\";\n\n                    [Route{{attributeParameter}}] {{(compliant ? string.Empty : \" // Secondary\")}}\n                    public ActionResult SomeAction() => View();\n                }\n                \"\"\");\n\n        if (compliant)\n        {\n            builder.VerifyNoIssues();\n        }\n        else\n        {\n            builder.Verify();\n        }\n    }\n#endif\n\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/AspNet/SpecifyRouteAttributeTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\n#if NET\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class SpecifyRouteAttributeTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<SpecifyRouteAttribute>()\n        .WithBasePath(\"AspNet\")\n        .WithOptions(LanguageOptions.FromCSharp12)\n        .AddReferences([\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcCore,\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcViewFeatures,\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcAbstractions\n        ]);\n\n    [TestMethod]\n    public void SpecifyRouteAttribute_CSharp12() =>\n        builder.AddPaths(\"SpecifyRouteAttribute.CSharp12.cs\").Verify();\n\n    [TestMethod]\n    public void SpecifyRouteAttribute_PartialClasses_CSharp12() =>\n        builder\n            .AddSnippet(\"\"\"\n                using Microsoft.AspNetCore.Mvc;\n\n                public partial class HomeController : Controller       // Noncompliant [first]\n                {\n                    [HttpGet(\"Test\")]\n                    public IActionResult Index() => View();            // Secondary [first, second]\n                }\n                \"\"\")\n            .AddSnippet(\"\"\"\n                using Microsoft.AspNetCore.Mvc;\n\n                public partial class HomeController : Controller { }   // Noncompliant [second]\n                \"\"\")\n            .Verify();\n\n    [TestMethod]\n    public void SpecifyRouteAttribute_PartialClasses_OneGenerated_CSharp12() =>\n        builder\n            .AddSnippet(\"\"\"\n                // <auto-generated/>\n                using Microsoft.AspNetCore.Mvc;\n\n                public partial class HomeController : Controller\n                {\n                    [HttpGet(\"Test\")]\n                    public IActionResult ActionInGeneratedCode() => View();     // Secondary\n                }\n                \"\"\")\n            .AddSnippet(\"\"\"\n                using Microsoft.AspNetCore.Mvc;\n\n                public partial class HomeController : Controller                // Noncompliant\n                {\n                    [HttpGet(\"Test\")]\n                    public IActionResult Index() => View();                     // Secondary\n                }\n                \"\"\")\n            .Verify();\n}\n\n#endif\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/AspNet/UseAspNetModelBindingTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n#if NET\n\n[TestClass]\npublic class UseAspNetModelBindingTest\n{\n    private readonly VerifierBuilder builderAspNetCore = new VerifierBuilder<UseAspNetModelBinding>()\n        .WithBasePath(\"AspNet\")\n        .WithOptions(LanguageOptions.CSharpLatest)\n        .AddReferences([\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcCore,\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreHttpAbstractions,\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcViewFeatures,\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcAbstractions,\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreHttpFeatures,\n            AspNetCoreMetadataReference.MicrosoftExtensionsPrimitives,\n        ]);\n\n    [TestMethod]\n    public void UseAspNetModelBinding_NoRegistrationIfNotAspNet() =>\n        new VerifierBuilder<UseAspNetModelBinding>().AddSnippet(string.Empty).VerifyNoIssues();\n\n    [TestMethod]\n    public void UseAspNetModelBinding_AspNetCore_CS_Latest() =>\n        builderAspNetCore.AddPaths(\"UseAspNetModelBinding_AspNetCore_Latest.cs\").Verify();\n\n    [TestMethod]\n    [DataRow(\"form.Files\", true)] // \"form\" is a parameter and as such IFormCollection binding was (probably) used which is an alternative to direct IFormFileCollection binding\n    [DataRow(\"form?.Files\", true)]\n    [DataRow(\"form!.Files\", true)]\n    [DataRow(\"request.Form.Files\", false)]\n    [DataRow(\"request.Form?.Files\", true)] // FN\n    [DataRow(\"request.Form!.Files\", false)]\n    [DataRow(\"Request.Form.Files\", false)]\n    [DataRow(\"Request.Form!.Files\", false)]\n    [DataRow(\"Request.Form?.Files\", true)] // FN\n    public void UseAspNetModelBinding_AspNetCore_FormFileAccess(string filesAccess, bool compliant)\n    {\n        var builder = builderAspNetCore.AddSnippet($$\"\"\"\"\n            using Microsoft.AspNetCore.Http;\n            using Microsoft.AspNetCore.Mvc;\n            using Microsoft.AspNetCore.Mvc.Filters;\n            using System;\n            using System.Linq;\n            using System.Threading.Tasks;\n\n            public class TestController : Controller\n            {\n                async Task NoncompliantKeyVariations(IFormCollection form, HttpRequest request)\n                {\n                    _ = {{filesAccess}}; // {{(compliant ? string.Empty : \"//Noncompliant\")}}\n                }\n            }\n            \"\"\"\");\n        if (compliant)\n        {\n            builder.VerifyNoIssues();\n        }\n        else\n        {\n            builder.Verify();\n        }\n    }\n\n    [TestMethod]\n    [DataRow(\"Form\")]\n    [DataRow(\"Query\")]\n    [DataRow(\"RouteValues\")]\n    [DataRow(\"Headers\")]\n    public void UseAspNetModelBinding_NonCompliantAccess(string property) =>\n        builderAspNetCore.AddSnippet($$\"\"\"\"\n            using Microsoft.AspNetCore.Http;\n            using Microsoft.AspNetCore.Mvc;\n            using Microsoft.AspNetCore.Mvc.Filters;\n            using System;\n            using System.Linq;\n            using System.Threading.Tasks;\n\n            public class TestController : Controller\n            {\n                async Task NoncompliantKeyVariations()\n                {\n                    _ = Request.{{property}}[@\"key\"];                                 // Noncompliant\n                    _ = Request.{{property}}.TryGetValue(@\"key\", out _);              // Noncompliant\n                    _ = Request.{{property}}[\"\"\"key\"\"\"];                              // Noncompliant\n                    _ = Request.{{property}}.TryGetValue(\"\"\"key\"\"\", out _);           // Noncompliant\n\n                    const string key = \"id\";\n                    _ = Request.{{property}}[key];                                    // Noncompliant\n                    _ = Request.{{property}}.TryGetValue(key, out _);                 // Noncompliant\n                    _ = Request.{{property}}[$\"prefix.{key}\"];                        // Noncompliant\n                    _ = Request.{{property}}.TryGetValue($\"prefix.{key}\", out _);     // Noncompliant\n                    _ = Request.{{property}}[$\"\"\"prefix.{key}\"\"\"];                    // Noncompliant\n                    _ = Request.{{property}}.TryGetValue($\"\"\"prefix.{key}\"\"\", out _); // Noncompliant\n\n                    _ = Request.{{property}}[key: \"id\"];                              // Noncompliant\n                    _ = Request.{{property}}.TryGetValue(value: out _, key: \"id\");    // Noncompliant\n                }\n\n                private static void HandleRequest(HttpRequest request)\n                {\n                    _ = request.{{property}}[\"id\"]; // Noncompliant: Containing type is a controller\n                    void LocalFunction()\n                    {\n                        _ = request.{{property}}[\"id\"]; // Noncompliant: Containing type is a controller\n                    }\n                    static void StaticLocalFunction(HttpRequest request)\n                    {\n                        _ = request.{{property}}[\"id\"]; // Noncompliant: Containing type is a controller\n                    }\n                }\n            }\n            \"\"\"\").Verify();\n\n    [TestMethod]\n    [CombinatorialData]\n    public void UseAspNetModelBinding_CompliantAccess(\n        [CombinatorialValues(\n            \"_ = {0}.Keys\",\n            \"_ = {0}.Count\",\n            \"foreach (var kvp in {0}) {{ }}\",\n            \"_ = {0}.Select(x => x);\",\n            \"_ = {0}[key];                    // Compliant: The accessed key is not a compile time constant\")] string statementFormat,\n        [CombinatorialValues(\"Request\", \"this.Request\", \"ControllerContext.HttpContext.Request\", \"request\")] string request,\n        [CombinatorialValues(\"Form\", \"Headers\", \"Query\", \"RouteValues\")] string property,\n        [CombinatorialValues(\"[FromForm]\", \"[FromQuery]\", \"[FromRoute]\", \"[FromHeader]\")] string attribute) =>\n        builderAspNetCore.AddSnippet($$\"\"\"\n            using Microsoft.AspNetCore.Http;\n            using Microsoft.AspNetCore.Mvc;\n            using Microsoft.AspNetCore.Mvc.Filters;\n            using System;\n            using System.Linq;\n            using System.Threading.Tasks;\n\n            public class TestController : Controller\n            {\n                async Task Compliant({{attribute}} string key, HttpRequest request)\n                {\n                    {{string.Format(statementFormat, $\"{request}.{property}\")}};\n                }\n            }\n            \"\"\").VerifyNoIssues();\n\n    [TestMethod]\n    [DataRow(\"Form\")]\n    [DataRow(\"Headers\")]\n    [DataRow(\"Query\")]\n    [DataRow(\"RouteValues\")]\n    public void UseAspNetModelBinding_DottedExpressions(string property) =>\n        builderAspNetCore.AddSnippet($$\"\"\"\n            using Microsoft.AspNetCore.Http;\n            using Microsoft.AspNetCore.Mvc;\n            using Microsoft.AspNetCore.Mvc.Filters;\n            using Microsoft.AspNetCore.Routing;\n            using System;\n            using System.Linq;\n            using System.Threading.Tasks;\n\n            public class TestController : Controller\n            {\n                HttpRequest ValidRequest => Request;\n                IFormCollection Form => Request.Form;\n                IHeaderDictionary Headers => Request.Headers;\n                IQueryCollection Query => Request.Query;\n                RouteValueDictionary RouteValues => Request.RouteValues;\n\n                async Task DottedExpressions()\n                {\n                    _ = (true ? Request : Request).{{property}}[\"id\"]; // Noncompliant\n                    _ = ValidatedRequest().{{property}}[\"id\"]; // Noncompliant\n                    _ = ValidRequest.{{property}}[\"id\"]; // Noncompliant\n                    _ = {{property}}[\"id\"];      // Noncompliant\n                    _ = this.{{property}}[\"id\"];                 // Noncompliant\n                    _ = new TestController().{{property}}[\"id\"]; // Noncompliant\n\n                    _ = this.Request.{{property}}[\"id\"]; // Noncompliant\n                    _ = Request?.{{property}}?[\"id\"]; // Noncompliant\n                    _ = Request?.{{property}}?.TryGetValue(\"id\", out _); // Noncompliant\n                    _ = Request.{{property}}?.TryGetValue(\"id\", out _); // Noncompliant\n                    _ = Request.{{property}}?.TryGetValue(\"id\", out _).ToString(); // Noncompliant\n                    _ = HttpContext.Request.{{property}}[\"id\"]; // Noncompliant\n                    _ = Request.HttpContext.Request.{{property}}[\"id\"]; // Noncompliant\n                    _ = this.ControllerContext.HttpContext.Request.{{property}}[\"id\"]; // Noncompliant\n                    var r1 = HttpContext.Request;\n                    _ = r1.{{property}}[\"id\"]; // Noncompliant\n                    var r2 = ControllerContext;\n                    _ = r2.HttpContext.Request.{{property}}[\"id\"]; // Noncompliant\n\n                    HttpRequest ValidatedRequest() => Request;\n                }\n            }\n            \"\"\").Verify();\n\n    [TestMethod]\n    [DataRow(\"public class MyController: Controller\")]\n    [DataRow(\"public class MyController: ControllerBase\")]\n    [DataRow(\"[Controller] public class My: Controller\")]\n    // [DataRow(\"public class MyController\")] FN: Poco controller are not detected\n    public void UseAspNetModelBinding_PocoController(string classDeclaration) =>\n        builderAspNetCore.AddSnippet($$\"\"\"\"\n            using Microsoft.AspNetCore.Http;\n            using Microsoft.AspNetCore.Mvc;\n            using Microsoft.AspNetCore.Mvc.Filters;\n            using System;\n            using System.Linq;\n            using System.Threading.Tasks;\n\n            {{classDeclaration}}\n            {\n                public async Task Action([FromServices]IHttpContextAccessor httpContextAccessor)\n                {\n                    _ = httpContextAccessor.HttpContext.Request.Form[\"id\"]; // Noncompliant\n                }\n            }\n            \"\"\"\").Verify();\n\n    [TestMethod]\n    [DataRow(\"public class My\")]\n    [DataRow(\"[NonController] public class My: Controller\")]\n    [DataRow(\"[NonController] public class MyController: Controller\")]\n    public void UseAspNetModelBinding_NoController(string classDeclaration) =>\n        builderAspNetCore.AddSnippet($$\"\"\"\"\n            using Microsoft.AspNetCore.Http;\n            using Microsoft.AspNetCore.Mvc;\n            using Microsoft.AspNetCore.Mvc.Filters;\n            using System;\n            using System.Linq;\n            using System.Threading.Tasks;\n\n            {{classDeclaration}}\n            {\n                public async Task Action([FromServices]IHttpContextAccessor httpContextAccessor)\n                {\n                    _ = httpContextAccessor.HttpContext.Request.Form[\"id\"]; // Compliant\n                }\n            }\n            \"\"\"\").VerifyNoIssues();\n\n    [TestMethod]\n    [DataRow(\"Form\")]\n    [DataRow(\"Headers\")]\n    [DataRow(\"Query\")]\n    [DataRow(\"RouteValues\")]\n    public void UseAspNetModelBinding_NoController_Properties(string property) =>\n        builderAspNetCore.AddSnippet($$\"\"\"\"\n            using Microsoft.AspNetCore.Http;\n            using Microsoft.AspNetCore.Mvc;\n            using Microsoft.AspNetCore.Mvc.Filters;\n            using System;\n            using System.Linq;\n            using System.Threading.Tasks;\n\n            static class HttpRequestExtensions\n            {\n                public static void Ext(this HttpRequest request)\n                {\n                    _ = request.{{property}}[\"id\"]; // Compliant: Not in a controller\n                }\n            }\n\n            class RequestService\n            {\n                public HttpRequest Request { get; }\n\n                public void HandleRequest(HttpRequest request)\n                {\n                    _ = Request.{{property}}[\"id\"]; // Compliant: Not in a controller\n                    _ = request.{{property}}[\"id\"]; // Compliant: Not in a controller\n                }\n            }\n            \"\"\"\").VerifyNoIssues();\n\n    [TestMethod]\n    [CombinatorialData]\n    public void UseAspNetModelBinding_InheritanceAccess(\n        [CombinatorialValues(\n            \": Controller\",\n            \": ControllerBase\",\n            \": MyBaseController\",\n            \": MyBaseBaseController\")]string baseList,\n        [CombinatorialValues(\n            \"\"\"_ = Request.Form[\"id\"]\"\"\",\n            \"\"\"_ = Request.Form.TryGetValue(\"id\", out var _)\"\"\",\n            \"\"\"_ = Request.Headers[\"id\"]\"\"\",\n            \"\"\"_ = Request.Query[\"id\"]\"\"\",\n            \"\"\"_ = Request.RouteValues[\"id\"]\"\"\")]string nonCompliantStatement) =>\n        builderAspNetCore.AddSnippet($$\"\"\"\"\n            using Microsoft.AspNetCore.Http;\n            using Microsoft.AspNetCore.Mvc;\n            using Microsoft.AspNetCore.Mvc.Filters;\n            using System;\n            using System.Linq;\n            using System.Threading.Tasks;\n\n            public class MyBaseController : ControllerBase { }\n            public class MyBaseBaseController : MyBaseController { }\n\n            public class MyTestController {{baseList}}\n            {\n                public void Action()\n                {\n                    {{nonCompliantStatement}}; // Noncompliant\n                }\n            }\n            \"\"\"\").Verify();\n}\n#endif\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/AssertionArgsShouldBePassedInCorrectOrderTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\nusing SonarAnalyzer.Test.Common;\n\nusing static SonarAnalyzer.TestFramework.MetadataReferences.NugetPackageVersions;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class AssertionArgsShouldBePassedInCorrectOrderTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<AssertionArgsShouldBePassedInCorrectOrder>();\n\n    [TestMethod]\n    [DataRow(MsTest.Ver11)]\n    [DataRow(MsTest.Ver311)]\n    [DataRow(TestConstants.NuGetLatestVersion)]\n    public void AssertionArgsShouldBePassedInCorrectOrder_MsTest(string testFwkVersion) =>\n        builder.AddPaths(\"AssertionArgsShouldBePassedInCorrectOrder.MsTest.cs\")\n            .AddReferences(NuGetMetadataReference.MSTestTestFramework(testFwkVersion))\n            .Verify();\n\n    [TestMethod]\n    public void AssertionArgsShouldBePassedInCorrectOrder_MsTest_Static() =>\n        builder.WithTopLevelStatements().AddReferences(NuGetMetadataReference.MSTestTestFramework(TestConstants.NuGetLatestVersion)).AddSnippet(\"\"\"\n            using static Microsoft.VisualStudio.TestTools.UnitTesting.Assert;\n            var str = \"\";\n            AreEqual(str, \"\"); // Noncompliant\n            \"\"\").Verify();\n\n    [TestMethod]\n    [DataRow(NUnit.Ver25)]\n    [DataRow(NUnit.Ver3Latest)] // Breaking changes in NUnit 4.0 would fail the test https://github.com/SonarSource/sonar-dotnet/issues/8409\n    public void AssertionArgsShouldBePassedInCorrectOrder_NUnit(string testFwkVersion) =>\n        builder.AddPaths(\"AssertionArgsShouldBePassedInCorrectOrder.NUnit.cs\")\n            .AddReferences(NuGetMetadataReference.NUnit(testFwkVersion))\n            .Verify();\n\n    [TestMethod]\n    public void AssertionArgsShouldBePassedInCorrectOrder_NUnit4() =>\n        builder.AddPaths(\"AssertionArgsShouldBePassedInCorrectOrder.NUnit4.cs\")\n            .AddReferences(NuGetMetadataReference.NUnit(NUnit.Ver4))\n            .Verify();\n\n    [TestMethod]\n    public void AssertionArgsShouldBePassedInCorrectOrder_NUnit_Static() =>\n        // Breaking changes in NUnit 4.0 would fail the test https://github.com/SonarSource/sonar-dotnet/issues/8409\n        builder.WithTopLevelStatements().AddReferences(NuGetMetadataReference.NUnit(NUnit.Ver3Latest)).AddSnippet(\"\"\"\n            using static NUnit.Framework.Assert;\n            var str = \"\";\n            AreEqual(str, \"\"); // Noncompliant\n            \"\"\").Verify();\n\n    [TestMethod]\n    [DataRow(XUnitVersions.Ver2)]\n    [DataRow(XUnitVersions.Ver253)]\n    public void AssertionArgsShouldBePassedInCorrectOrder_XUnit(string testFwkVersion) =>\n        builder.AddPaths(\"AssertionArgsShouldBePassedInCorrectOrder.Xunit.cs\")\n            .AddReferences(NuGetMetadataReference.XunitFramework(testFwkVersion)\n                            .Concat(MetadataReferenceFacade.NetStandard))\n            .Verify();\n\n    [TestMethod]\n    public void AssertionArgsShouldBePassedInCorrectOrder_XUnitV3() =>\n        builder\n            .AddPaths(\"AssertionArgsShouldBePassedInCorrectOrder.Xunit.cs\")\n            .AddPaths(\"AssertionArgsShouldBePassedInCorrectOrder.XunitV3.cs\")\n            .AddReferences(NuGetMetadataReference.XunitFrameworkV3())\n            .AddReferences(NuGetMetadataReference.SystemMemory(TestConstants.NuGetLatestVersion))\n            .AddReferences(MetadataReferenceFacade.NetStandard)\n            .AddReferences(MetadataReferenceFacade.SystemCollections)\n            .Verify();\n\n    [TestMethod]\n    public void AssertionArgsShouldBePassedInCorrectOrder_XUnit_Static() =>\n        builder.WithTopLevelStatements()\n               .AddReferences(NuGetMetadataReference.XunitFramework(XUnitVersions.Ver253))\n               .AddSnippet(\"\"\"\n                           using static Xunit.Assert;\n                           var str = \"\";\n                           Equal(str, \"\"); // Noncompliant\n                           \"\"\").Verify();\n\n    [TestMethod]\n    public void AssertionArgsShouldBePassedInCorrectOrder_NUnit4_AliasedNamespace() =>\n        builder.AddReferences(NuGetMetadataReference.NUnit(NUnit.Ver4)).AddSnippet(\"\"\"\n            using NUnit.Framework;\n            namespace Aliased\n            {\n                using Assert = NUnit.Framework.Legacy.ClassicAssert;\n                [TestFixture]\n                class Program\n                {\n                    [Test]\n                    public void Test(string str)\n                    {\n                        Assert.AreEqual(\"\", str); // Compliant\n                        Assert.AreEqual(str, \"\"); // Noncompliant\n                    }\n                }\n            }\n            \"\"\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/AssertionsShouldBeCompleteTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class AssertionsShouldBeCompleteTest\n{\n    private readonly VerifierBuilder fluentAssertions = new VerifierBuilder<AssertionsShouldBeComplete>()\n        .AddReferences(NuGetMetadataReference.FluentAssertions(\"6.10.0\"))\n        .AddReferences(MetadataReferenceFacade.SystemXml)\n        .AddReferences(MetadataReferenceFacade.SystemXmlLinq)\n        .AddReferences(MetadataReferenceFacade.SystemNetHttp)\n        .AddReferences(MetadataReferenceFacade.SystemData);\n\n    private readonly VerifierBuilder nfluent = new VerifierBuilder<AssertionsShouldBeComplete>()\n        .AddReferences(NuGetMetadataReference.NFluent(\"2.8.0\"));\n\n    private readonly VerifierBuilder nsubstitute = new VerifierBuilder<AssertionsShouldBeComplete>()\n        .AddReferences(NuGetMetadataReference.NSubstitute(\"5.0.0\"));\n\n    private readonly VerifierBuilder allFrameworks;\n\n    public AssertionsShouldBeCompleteTest() =>\n        allFrameworks = new VerifierBuilder<AssertionsShouldBeComplete>()\n            .AddReferences(fluentAssertions.References)\n            .AddReferences(nfluent.References)\n            .AddReferences(nsubstitute.References);\n\n    [TestMethod]\n    public void AssertionsShouldBeComplete_FluentAssertions_CSharp7() =>\n        fluentAssertions\n            // The overload resolution errors for s[0].Should() and collection.Should() are fixed in CSharp 7.3.\n            .WithOptions(ImmutableArray.Create<ParseOptions>(new CSharpParseOptions[] { new(LanguageVersion.CSharp7), new(LanguageVersion.CSharp7_1), new(LanguageVersion.CSharp7_2) }))\n            .AddPaths(\"AssertionsShouldBeComplete.FluentAssertions.CSharp7.cs\")\n            .Verify();\n\n    [TestMethod]\n    public void AssertionsShouldBeComplete_FluentAssertions_MissingParen() =>\n        fluentAssertions\n            .AddSnippet(\"\"\"\n                using FluentAssertions;\n                public class Test\n                {\n                    public void MissingParen()\n                    {\n                        var s = \"Test\";\n                        s.Should(;  // Error [CS1026]\n                    }\n                }\n                \"\"\")\n            .Verify();\n\n    [TestMethod]\n    public void AssertionsShouldBeComplete_FluentAssertions_CS_Latest() =>\n        fluentAssertions\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .AddPaths(\"AssertionsShouldBeComplete.FluentAssertions.Latest.cs\")\n            .WithConcurrentAnalysis(false)\n            .Verify();\n\n    [TestMethod]\n    public void AssertionsShouldBeComplete_NFluent_CSharp() =>\n        nfluent.AddTestReference().AddPaths(\"AssertionsShouldBeComplete.NFluent.cs\").Verify();\n\n    [TestMethod]\n    public void AssertionsShouldBeComplete_NFluent_CS_Latest() =>\n        nfluent.WithOptions(LanguageOptions.CSharpLatest).AddTestReference().AddPaths(\"AssertionsShouldBeComplete.NFluent.Latest.cs\").Verify();\n\n    [TestMethod]\n    public void AssertionsShouldBeComplete_NSubstitute_CS() =>\n        nsubstitute.AddPaths(\"AssertionsShouldBeComplete.NSubstitute.cs\").Verify();\n\n    [TestMethod]\n    public void AssertionsShouldBeComplete_AllFrameworks_CS() =>\n        allFrameworks.AddPaths(\"AssertionsShouldBeComplete.AllFrameworks.cs\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/AssignmentInsideSubExpressionTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class AssignmentInsideSubExpressionTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<AssignmentInsideSubExpression>();\n\n    [TestMethod]\n    public void AssignmentInsideSubExpression() =>\n        builder.AddPaths(\"AssignmentInsideSubExpression.cs\").Verify();\n\n    [TestMethod]\n    public void AssignmentInsideSubExpression_TopLevelStatements() =>\n        builder.AddPaths(\"AssignmentInsideSubExpression.TopLevelStatements.cs\").WithTopLevelStatements().WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void AssignmentInsideSubExpression_Latest() =>\n        builder.AddPaths(\"AssignmentInsideSubExpression.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/AsyncAwaitIdentifierTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class AsyncAwaitIdentifierTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<AsyncAwaitIdentifier>();\n\n    [TestMethod]\n    public void AsyncAwaitIdentifier() =>\n        builder.AddPaths(\"AsyncAwaitIdentifier.cs\").Verify();\n\n    [TestMethod]\n    public void AsyncAwaitIdentifier_CS_Latest() =>\n        builder.AddPaths(\"AsyncAwaitIdentifier.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/AsyncVoidMethodTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nusing static SonarAnalyzer.TestFramework.MetadataReferences.NugetPackageVersions;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class AsyncVoidMethodTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<AsyncVoidMethod>();\n\n    [TestMethod]\n    public void AsyncVoidMethod() =>\n        builder.AddPaths(\"AsyncVoidMethod.cs\")\n            .Verify();\n\n    [TestMethod]\n    public void AsyncVoidMethod_CS_Latest() =>\n        builder.AddPaths(\"AsyncVoidMethod.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .AddReferences(NuGetMetadataReference.MicrosoftVisualStudioQualityToolsUnitTestFramework)\n            .Verify();\n\n    [TestMethod]\n    [DataRow(MsTest.Ver11)]\n    [DataRow(MsTest.Ver12)]\n    [DataRow(MsTest.Ver311)]\n    [DataRow(Latest)]\n    public void AsyncVoidMethod_MsTestTestFramework(string testFwkVersion) =>\n        builder.AddPaths(\"AsyncVoidMethod.MsTestTestFramework.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .AddReferences(NuGetMetadataReference.MSTestTestFramework(testFwkVersion))\n            .WithConcurrentAnalysis(false)\n            .Verify();\n\n    [TestMethod]\n    public void AsyncVoidMethod_VsUtFramework() =>\n        builder.AddPaths(\"AsyncVoidMethod.VsUtFramework.cs\")\n            // MicrosoftVisualStudioQualityToolsUnitTestFramework is not compatible with Net7/C#11 so max is C#10\n            .WithOptions(LanguageOptions.FromCSharp10)\n            .AddReferences(NuGetMetadataReference.MicrosoftVisualStudioQualityToolsUnitTestFramework)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/AvoidDateTimeNowForBenchmarkingTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class AvoidDateTimeNowForBenchmarkingTest\n{\n    [TestMethod]\n    public void AvoidDateTimeNowForBenchmarking_CS() =>\n        new VerifierBuilder<CS.AvoidDateTimeNowForBenchmarking>().AddPaths(\"AvoidDateTimeNowForBenchmarking.cs\").Verify();\n\n    [TestMethod]\n    public void AvoidDateTimeNowForBenchmarking_VB() =>\n        new VerifierBuilder<VB.AvoidDateTimeNowForBenchmarking>().AddPaths(\"AvoidDateTimeNowForBenchmarking.vb\").WithOptions(LanguageOptions.FromVisualBasic14).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/AvoidExcessiveClassCouplingTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class AvoidExcessiveClassCouplingTest\n{\n    private readonly VerifierBuilder withThreshold0 = new VerifierBuilder().AddAnalyzer(() => new AvoidExcessiveClassCoupling { Threshold = 0 });\n    private readonly VerifierBuilder withThreshold1 = new VerifierBuilder().AddAnalyzer(() => new AvoidExcessiveClassCoupling { Threshold = 1 });\n\n    [TestMethod]\n    public void AvoidExcessiveClassCoupling() =>\n        withThreshold1.AddPaths(\"AvoidExcessiveClassCoupling.cs\").Verify();\n\n    [TestMethod]\n    public void AvoidExcessiveClassCoupling_Generic_No_Constraints() =>\n        withThreshold0.AddSnippet(\"\"\"\n            using System;\n            using System.Collections.Generic;\n            public class Generics1 // Noncompliant {{Split this class into smaller and more specialized ones to reduce its dependencies on other types from 1 to the maximum authorized 0 or less.}}\n            {\n                public void Foo<T, V>(IDictionary<T, V> dictionary) { } // +1 for dictionary\n            }\n            \"\"\").Verify();\n\n    [TestMethod]\n    public void AvoidExcessiveClassCoupling_Generic_With_Constraints() =>\n        withThreshold0.AddSnippet(\"\"\"\n            using System;\n            using System.Collections.Generic;\n            public class Generics1 // Noncompliant {{Split this class into smaller and more specialized ones to reduce its dependencies on other types from 4 to the maximum authorized 0 or less.}}\n            {\n                public void Foo1<T, V>(IDictionary<T, V> dictionary)  // +1 for IDictionary\n                    where T : IEnumerable<IDisposable> // +1 for IEnumerable, +1 for IDisposable\n                    where V : ICloneable // +1 for ICloneable\n                {\n                }\n            }\n            \"\"\").Verify();\n\n    [TestMethod]\n    public void AvoidExcessiveClassCoupling_Generic_Bounded() =>\n        withThreshold0.AddSnippet(\"\"\"\n            using System;\n            using System.Collections.Generic;\n            public class Generics1 // Noncompliant {{Split this class into smaller and more specialized ones to reduce its dependencies on other types from 3 to the maximum authorized 0 or less.}}\n            {\n                public void Foo(IDictionary<IDisposable, ICloneable> dictionary)  // +1 for IDictionary, +1 for IDisposable, +1 for ICloneable\n                {\n                }\n            }\n            \"\"\").Verify();\n\n    [TestMethod]\n    public void AvoidExcessiveClassCoupling_Generic_Bounded_Deep_Nesting() =>\n        withThreshold0.AddSnippet(\"\"\"\n            using System;\n            using System.Collections.Generic;\n            public class Generics1 // Noncompliant {{Split this class into smaller and more specialized ones to reduce its dependencies on other types from 6 to the maximum authorized 0 or less.}}\n            {\n                public void Foo(IList<ICollection<IEnumerable<IComparer<Stack<Queue<int>>>>>> dictionary)\n                // +1 for IList, +1 for ICollection, +1 for IEnumerable, +1 for IComparer, +1 for Stack, +1 for Queue\n                {\n                }\n            }\n            \"\"\").Verify();\n\n    [TestMethod]\n    public void AvoidExcessiveClassCoupling_Task_Not_Counted() =>\n        withThreshold0.AddSnippet(\"\"\"\n            using System.Threading.Tasks;\n            public class Tasks // Compliant, Task types are not counted\n            {\n                public void Foo<T>(Task task1, Task<T> task2) { }\n            }\n            \"\"\").VerifyNoIssues();\n\n    [TestMethod]\n    public void AvoidExcessiveClassCoupling_Action_Not_Counted() =>\n        withThreshold0.AddSnippet(\"\"\"\n            using System;\n            public class Actions // Compliant, Action types are not counted\n            {\n                public void Foo<T>(Action action1, Action<T> action2, Action<T, T> action3, Action<T, T, T> action4, Action<T, T, T, T> action5) { }\n            }\n            \"\"\").VerifyNoIssues();\n\n    [TestMethod]\n    public void AvoidExcessiveClassCoupling_Func_Not_Counted() =>\n        withThreshold0.AddSnippet(\"\"\"\n            using System;\n            public class Functions // Compliant, Func types are not counted\n            {\n                public void Foo<T>(Func<T> func1, Func<T, T> func2, Func<T, T, T> func3, Func<T, T, T, T> func4) { }\n            }\n            \"\"\").VerifyNoIssues();\n\n    [TestMethod]\n    public void AvoidExcessiveClassCoupling_Pointers_Not_Counted() =>\n        withThreshold0.AddSnippet(\"\"\"\n            using System;\n            public class Pointers // Compliant, pointers are not counted\n            {\n                public void Foo(int* pointer) { } // Error [CS0214]\n            }\n            \"\"\").Verify();\n\n    [TestMethod]\n    public void AvoidExcessiveClassCoupling_Enums_Not_Counted() =>\n        withThreshold0.AddSnippet(\"\"\"\n            using System;\n            public class Pointers // Compliant, enums are not counted\n            {\n                public ConsoleColor Foo(ConsoleColor c) { return ConsoleColor.Black; }\n            }\n            \"\"\").VerifyNoIssues();\n\n    [TestMethod]\n    public void AvoidExcessiveClassCoupling_Lazy_Not_Counted() =>\n        withThreshold0.AddSnippet(\"\"\"\n            using System;\n            using System.Collections.Generic;\n            public class Lazyness // Noncompliant {{Split this class into smaller and more specialized ones to reduce its dependencies on other types from 1 to the maximum authorized 0 or less.}}\n            {\n                public void Foo(Lazy<IEnumerable<int>> lazy) { } // +1 IEnumerable\n            }\n            \"\"\").Verify();\n\n    [TestMethod]\n    public void AvoidExcessiveClassCoupling_Fields_Are_Counted() =>\n        withThreshold0.AddSnippet(\"\"\"\n            using System.Collections.Generic;\n            public class Fields // Noncompliant {{Split this class into smaller and more specialized ones to reduce its dependencies on other types from 5 to the maximum authorized 0 or less.}}\n            {\n                // accessibility\n                private IList<int> c1;\n                public ICollection<int> c2;\n                internal IEnumerable<int> c3;\n                protected IEnumerator<int> c4;\n                // static\n                public static IEqualityComparer<int> c5;\n            }\n            \"\"\").Verify();\n\n    [TestMethod]\n    public void AvoidExcessiveClassCoupling_Properties_Are_Counted() =>\n        withThreshold0.AddSnippet(\"\"\"\n            using System.Collections.Generic;\n            public class Properties // Noncompliant {{Split this class into smaller and more specialized ones to reduce its dependencies on other types from 9 to the maximum authorized 0 or less.}}\n            {\n                // accessibility\n                private IList<int> C1 { get; set; }\n                public ICollection<int> C2 { get; set; }\n                internal IEnumerable<int> C3 { get; set; }\n                protected IEnumerator<int> C4 { get; set; }\n                // static\n                public static IEqualityComparer<int> C5 { get; set; }\n                // accessor bodies\n                public Stack<int> C6\n                {\n                    get\n                    {\n                        Queue<int> q;\n                        return null;\n                    }\n                    set\n                    {\n                        List<int> l;\n                    }\n                }\n                // expression body\n                public object C7 => new Dictionary<int, int>();\n            }\n            \"\"\").Verify();\n\n    [TestMethod]\n    public void AvoidExcessiveClassCoupling_Indexers_Are_Counted() =>\n        withThreshold0.AddSnippet(\"\"\"\n            using System.Collections.Generic;\n            public class Indexers // Noncompliant {{Split this class into smaller and more specialized ones to reduce its dependencies on other types from 6 to the maximum authorized 0 or less.}}\n            {\n                // accessibility\n                public IList<int> this[int i] { get { return null; } } // +1 IList\n                private ICollection<int> this[int i, int j] { get { return null; } } // +1 ICollection\n                protected IEnumerable<int> this[int i, int j, int k] { get { return null; } } // +1 IEnumerable\n                internal IEnumerator<int> this[int i, int j, int k, int l] { get { return null; } } // +1 IEnumerator\n                // parameters\n                public int this[IEqualityComparer<int> i, Stack<int> j] { get { return 0; } } // +1 IEqualityComparer, +1 Stack\n            }\n            \"\"\").Verify();\n\n    [TestMethod]\n    public void AvoidExcessiveClassCoupling_Events_Are_Counted() =>\n        withThreshold0.AddSnippet(\"\"\"\n            using System;\n            using System.Collections.Generic;\n            public class Events // Noncompliant {{Split this class into smaller and more specialized ones to reduce its dependencies on other types from 9 to the maximum authorized 0 or less.}}\n            {\n                // accessibility\n                private event EventHandler<IList<int>> e1; // +1 EventHandler, +1 IList\n                public event EventHandler<ICollection<int>> e2; // +1 ICollection\n                internal event EventHandler<IEnumerable<int>> e3; // +1 IEnumerable\n                protected event EventHandler<IEnumerator<int>> e4; // +1 IEnumerator\n                // static\n                public static event EventHandler<IEqualityComparer<int>> e5; // +1 IEqualityComparer\n                // accessor bodies\n                public event EventHandler<Stack<int>> E6 // +1 Stack\n                {\n                    add\n                    {\n                        Queue<int> q; // +1 Queue\n                    }\n                    remove\n                    {\n                        List<int> l; // +1 List\n                    }\n                }\n            }\n            \"\"\").Verify();\n\n    [TestMethod]\n    public void AvoidExcessiveClassCoupling_Methods_Are_Counted() =>\n        withThreshold0.AddSnippet(\"\"\"\n            using System;\n            using System.Collections.Generic;\n            using System.Diagnostics;\n            public class Methods // Noncompliant {{Split this class into smaller and more specialized ones to reduce its dependencies on other types from 10 to the maximum authorized 0 or less.}}\n            {\n                // accessibility\n                private void M1(IList<int> l1) { } // +1 IList\n                public void M2(ICollection<int> l1) { } // +1 ICollection\n                internal void M3(IEnumerable<int> l1) { } // +1 IEnumerable\n                protected void M4(IEnumerator<int> l1) { } // +1 IEnumerator\n                // return type\n                private IEqualityComparer<int> M5() { return null; } // +1 IEqualityComparer\n                // generic constraints\n                private void M6<T>() where T : Stack<int> { return; } // +1 Stack\n                // method body\n                private void M8()\n                {\n                    Queue<int> q; // +1 Queue\n                    Console.Clear(); // +1 Console\n            }\n                // expression body\n                private object M9() => new List<int>(); // +1 List\n                private void M10() => Debug.Write(1); // +1 Debug\n            }\n            \"\"\").Verify();\n\n    [TestMethod]\n    public void AvoidExcessiveClassCoupling_Inner_Classes_And_Structs_Are_Not_Counted() =>\n        withThreshold0.AddSnippet(\"\"\"\n            using System;\n            using System.Collections.Generic;\n            public class OuterClass // Noncompliant {{Split this class into smaller and more specialized ones to reduce its dependencies on other types from 1 to the maximum authorized 0 or less.}}\n            {\n                private void M1(IList<int> l1) { } // +1 IList\n\n                public class InnerClass // Noncompliant {{Split this class into smaller and more specialized ones to reduce its dependencies on other types from 1 to the maximum authorized 0 or less.}}\n                {\n                    private void M1(ICollection<int> l1) { } // +1 ICollection\n                }\n            }\n            public struct OuterStruct // Noncompliant {{Split this struct into smaller and more specialized ones to reduce its dependencies on other types from 1 to the maximum authorized 0 or less.}}\n            {\n                private void M1(IList<int> l1) { } // +1 IList\n\n                public struct InnerStruct // Noncompliant {{Split this struct into smaller and more specialized ones to reduce its dependencies on other types from 1 to the maximum authorized 0 or less.}}\n                {\n                    private void M1(ICollection<int> l1) { } // +1 ICollection\n                }\n            }\n            \"\"\").Verify();\n\n    [TestMethod]\n    public void AvoidExcessiveClassCoupling_Interface_Declaration() =>\n        withThreshold0.AddSnippet(\"\"\"\n            using System;\n            using System.Collections.Generic;\n            public interface I // Noncompliant {{Split this interface into smaller and more specialized ones to reduce its dependencies on other types from 1 to the maximum authorized 0 or less.}}\n            {\n                void M1(IList<int> l1); // +1 IList\n                // interfaces cannot contain other types\n            }\n            \"\"\").Verify();\n\n    [TestMethod]\n    public void AvoidExcessiveClassCoupling_Self_Reference() =>\n        withThreshold0.AddSnippet(\"\"\"\n            using System;\n            using System.Collections.Generic;\n            public class Self // Compliant, self references are not counted\n            {\n                void M1(Self other) { }\n            }\n            \"\"\").VerifyNoIssues();\n\n    [TestMethod]\n    public void AvoidExcessiveClassCoupling_Base_Classes_Interfaces_NotCounted() =>\n        withThreshold0.AddSnippet(\"\"\"\n            using System;\n            using System.Collections.Generic;\n            public class Base {}\n            public class Self // Noncompliant {{Split this class into smaller and more specialized ones to reduce its dependencies on other types from 2 to the maximum authorized 0 or less.}}\n                : Base, ICloneable\n            {\n                public object Clone() { return null; }\n            }\n            \"\"\").Verify();\n\n    [TestMethod]\n    public void AvoidExcessiveClassCoupling_Catch_Statements() =>\n        withThreshold0.AddSnippet(\"\"\"\n            using System;\n            using System.Collections.Generic;\n            public class Self // Noncompliant {{Split this class into smaller and more specialized ones to reduce its dependencies on other types from 2 to the maximum authorized 0 or less.}}\n            {\n                void M1()\n                {\n                    try { } catch (Exception) { } // +1 Exception\n                    try { } catch (Exception e) when (e is InvalidOperationException) { } // +1 InvalidOperationException\n                }\n            }\n            \"\"\").Verify();\n\n    [TestMethod]\n    public void AvoidExcessiveClassCoupling_Attributes() =>\n        withThreshold0.AddSnippet(\"\"\"\n            using System;\n            [Serializable]\n            public class Self // Compliant, attributes are not counted\n            {\n                [Obsolete]\n                void M1()\n                {\n                }\n            }\n            \"\"\").VerifyNoIssues();\n\n    [TestMethod]\n    public void AvoidExcessiveClassCoupling_Nameof() =>\n        withThreshold0.AddSnippet(\"\"\"\n            public class A // Compliant, types referenced by the nameof expression are not counted\n            {\n                public A()\n                {\n                    var s1 = nameof(System.Type);\n                    var s2 = nameof(System.Action);\n                }\n            }\n            \"\"\").VerifyNoIssues();\n\n    [TestMethod]\n    public void AvoidExcessiveClassCoupling_InRecord_Enums_Not_Counted() =>\n        withThreshold0.AddSnippet(\"\"\"\n            using System;\n            public record Pointers // Compliant, enums are not counted\n            {\n                public ConsoleColor Foo(ConsoleColor c) { return ConsoleColor.Black; }\n            }\n            \"\"\").WithOptions(LanguageOptions.FromCSharp9).VerifyNoIssues();\n\n    [TestMethod]\n    public void AvoidExcessiveClassCoupling_Base_Records_Interfaces_NotCounted() =>\n        withThreshold0.AddSnippet(\"\"\"\n            using System;\n            using System.Runtime.Serialization;\n            public record Base {}\n            public record Self // Noncompliant\n                : Base, ISerializable\n            {\n                public void GetObjectData(SerializationInfo info, StreamingContext context)\n                {\n                }\n            }\n            \"\"\").WithOptions(LanguageOptions.FromCSharp9).Verify();\n\n    [TestMethod]\n    public void AvoidExcessiveClassCoupling_Primitive_Types_Not_Counted() =>\n        withThreshold0.AddSnippet(\"\"\"\n            using System;\n            public class Types // Compliant, pointers are not counted\n            {\n                public void Foo(bool b1,\n                    byte b2, sbyte b3, int i1, uint i2, long i3, ulong i4,\n                    nint ni1, nuint ni2,\n                    IntPtr p1, UIntPtr p2,\n                    char c1, float d1,\n                    double d2, string s1,\n                    object o1) { }\n            }\n            \"\"\").WithOptions(LanguageOptions.FromCSharp9).VerifyNoIssues();\n\n    [TestMethod]\n    public void AvoidExcessiveClassCoupling_Implicit_Explicit_Operators() =>\n        withThreshold0.AddSnippet(\"\"\"\n            using System.IO;\n            public class WithConversionOperators // Noncompliant {{Split this class into smaller and more specialized ones to reduce its dependencies on other types from 3 to the maximum authorized 0 or less.}}\n            {\n                public static implicit operator Stream(WithConversionOperators x) => null;          // +1 Stream (return type); self not counted\n                public static explicit operator MemoryStream(WithConversionOperators x) => null;    // +1 MemoryStream (return type); self not counted\n                public static explicit operator WithConversionOperators(FileStream x) => null;      // self (not counted); +1 FileStream (parameter type)\n            }\n            \"\"\").Verify();\n\n    [TestMethod]\n    public void AvoidExcessiveClassCoupling_UserDefined_Delegates() =>\n        withThreshold0.AddSnippet(\"\"\"\n            using System.IO;\n            public delegate void MyCallback(Stream s);\n            public class WithUserDefinedDelegate // Noncompliant {{Split this class into smaller and more specialized ones to reduce its dependencies on other types from 2 to the maximum authorized 0 or less.}}\n            {\n                private MyCallback _cb;  // +1 MyCallback (user-defined delegate)\n                private FileStream _fs;  // +1 FileStream\n            }\n            \"\"\").Verify();\n\n    [TestMethod]\n    public void AvoidExcessiveClassCoupling_Extension_Methods() =>\n        withThreshold0.AddSnippet(\"\"\"\n            using System.IO;\n            public static class StreamExtensions // Noncompliant {{Split this class into smaller and more specialized ones to reduce its dependencies on other types from 2 to the maximum authorized 0 or less.}}\n            {\n                public static void Foo(this Stream s, FileStream fs) { } // +1 Stream (this-param), +1 FileStream (param)\n            }\n            \"\"\").Verify();\n\n    [TestMethod]\n    public void AvoidExcessiveClassCoupling_Extension_Method_Container_Not_Counted_On_Invocation() =>\n        withThreshold1.AddSnippet(\"\"\"\n            using System.IO;\n            public static class StreamExtensions // Compliant: 1 dep (Stream, from this-param)\n            {\n                public static void Foo(this Stream s) { }\n            }\n            public class InvokesExtensionMethod // Compliant: 1 dep (Stream, from param) — StreamExtensions not counted, otherwise 2\n            {\n                void M(Stream s) { s.Foo(); }\n            }\n            \"\"\").VerifyNoIssues();\n\n    [TestMethod]\n    public void AvoidExcessiveClassCoupling_Latest() =>\n        withThreshold1.AddPaths(\"AvoidExcessiveClassCoupling.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/AvoidExcessiveInheritanceTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class AvoidExcessiveInheritanceTest\n    {\n        private readonly VerifierBuilder defaultBuilder = new VerifierBuilder<AvoidExcessiveInheritance>();\n\n        [TestMethod]\n        public void AvoidExcessiveInheritance_DefaultValues() =>\n            defaultBuilder.AddPaths(\n                \"AvoidExcessiveInheritance_DefaultValues.cs\",\n                // The test cases are duplicated to make sure the rules can execute in a concurrent manner.\n                \"AvoidExcessiveInheritance_DefaultValues.Concurrent.cs\")\n                .WithAutogenerateConcurrentFiles(false)\n                .Verify();\n\n        [TestMethod]\n        public void AvoidExcessiveInheritance_DefaultValues_Records() =>\n            defaultBuilder.AddPaths(\n                \"AvoidExcessiveInheritance_DefaultValues.Records.cs\",\n                // The test cases are duplicated to make sure the rules can execute in a concurrent manner.\n                \"AvoidExcessiveInheritance_DefaultValues.Records.Concurrent.cs\")\n                .WithOptions(LanguageOptions.FromCSharp9)\n                .WithAutogenerateConcurrentFiles(false)\n                .Verify();\n\n        [TestMethod]\n        public void AvoidExcessiveInheritance_DefaultValues_FileScopedTypes() =>\n            defaultBuilder.AddPaths(\"AvoidExcessiveInheritance_DefaultValues.FileScopedTypes.cs\")\n                .WithOptions(LanguageOptions.FromCSharp11)\n                .Verify();\n\n        [TestMethod]\n        public void AvoidExcessiveInheritance_CustomValuesFullyNamedFilteredClass() =>\n            new VerifierBuilder()\n                .AddAnalyzer(() => CreateAnalyzerWithFilter(\"Tests.Diagnostics.SecondSubClass\"))\n                .AddPaths(\"AvoidExcessiveInheritance_CustomValues.cs\")\n                .WithAutogenerateConcurrentFiles(false)\n                .Verify();\n\n        [TestMethod]\n        public void AvoidExcessiveInheritance_CustomValuesWildcardFilteredClass() =>\n            new VerifierBuilder()\n                .AddAnalyzer(() => CreateAnalyzerWithFilter(\"Tests.Diagnostics.*SubClass\"))\n                .AddPaths(\"AvoidExcessiveInheritance_CustomValues.cs\")\n                .WithAutogenerateConcurrentFiles(false)\n                .Verify();\n\n        [TestMethod]\n        public void AvoidExcessiveInheritance_CustomValuesWildcardFilteredRecord() =>\n            new VerifierBuilder()\n                .AddAnalyzer(() => CreateAnalyzerWithFilter(\"Tests.Diagnostics.*SubRecord\"))\n                .AddPaths(\"AvoidExcessiveInheritance_CustomValues.Records.cs\")\n                .WithOptions(LanguageOptions.FromCSharp9)\n                .WithAutogenerateConcurrentFiles(false)\n                .Verify();\n\n        [TestMethod]\n        public void FilteredClasses_ByDefault_ShouldBeEmpty() =>\n            new AvoidExcessiveInheritance().FilteredClasses.Should().BeEmpty();\n\n        private static AvoidExcessiveInheritance CreateAnalyzerWithFilter(string filter) =>\n            new() { MaximumDepth = 2, FilteredClasses = filter };\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/AvoidLambdaExpressionInLoopsInBlazorTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\n#if NET\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class AvoidLambdaExpressionInLoopsInBlazorTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<AvoidLambdaExpressionInLoopsInBlazor>();\n\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    public void AvoidLambdaExpressionInLoopsInBlazor_Blazor() =>\n        builder.AddPaths(\"AvoidLambdaExpressionInLoopsInBlazor.razor\")\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Product))\n            .Verify();\n\n    [TestMethod]\n    public void AvoidLambdaExpressionInLoopsInBlazor_BlazorLoopsWithNoBody() =>\n        builder.AddPaths(\"AvoidLambdaExpressionInLoopsInBlazor.LoopsWithNoBody.razor\")\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Product))\n            .Verify();\n\n    [TestMethod]\n    public void AvoidLambdaExpressionInLoopsInBlazor_UsingRenderFragment() =>\n        builder.AddPaths(\"AvoidLambdaExpressionInLoopsInBlazor.RenderFragment.razor\", \"AvoidLambdaExpressionInLoopsInBlazor.RenderFragmentConsumer.razor\")\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Product))\n            .Verify();\n\n    [TestMethod]\n    public void AvoidLambdaExpressionInLoopsInBlazor_CS() =>\n        builder.AddPaths(\"AvoidLambdaExpressionInLoopsInBlazor.cs\")\n            .AddReferences(NuGetMetadataReference.MicrosoftAspNetCoreComponents(\"7.0.13\"))\n            .AddReferences(NuGetMetadataReference.MicrosoftAspNetCoreComponentsWeb(\"7.0.13\"))\n            .WithOptions(LanguageOptions.FromCSharp10)\n            .Verify();\n}\n\n#endif\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/AvoidUnsealedAttributesTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class AvoidUnsealedAttributesTest\n{\n    [TestMethod]\n    public void AvoidUnsealedAttributes_CS() =>\n        new VerifierBuilder<CS.AvoidUnsealedAttributes>().AddPaths(\"AvoidUnsealedAttributes.cs\").Verify();\n\n    [TestMethod]\n    public void AvoidUnsealedAttributes_VB() =>\n        new VerifierBuilder<VB.AvoidUnsealedAttributes>().AddPaths(\"AvoidUnsealedAttributes.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/BeginInvokePairedWithEndInvokeTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class BeginInvokePairedWithEndInvokeTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.BeginInvokePairedWithEndInvoke>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.BeginInvokePairedWithEndInvoke>();\n\n    [TestMethod]\n    public void BeginInvokePairedWithEndInvoke_CS() =>\n        builderCS.AddPaths(\"BeginInvokePairedWithEndInvoke.cs\").Verify();\n\n    [TestMethod]\n    public void BeginInvokePairedWithEndInvoke_CS_Latest() =>\n        builderCS.AddPaths(\"BeginInvokePairedWithEndInvoke.Latest.cs\", \"BeginInvokePairedWithEndInvoke.Latest.Partial.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void BeginInvokePairedWithEndInvoke_VB() =>\n        builderVB.AddPaths(\"BeginInvokePairedWithEndInvoke.vb\", \"BeginInvokePairedWithEndInvoke.Partial.vb\")\n            .WithOptions(LanguageOptions.FromVisualBasic14)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/BinaryOperationWithIdenticalExpressionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class BinaryOperationWithIdenticalExpressionsTest\n    {\n        private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.BinaryOperationWithIdenticalExpressions>();\n        private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.BinaryOperationWithIdenticalExpressions>();\n\n        [TestMethod]\n        public void BinaryOperationWithIdenticalExpressions_CS() =>\n            builderCS.AddPaths(\"BinaryOperationWithIdenticalExpressions.cs\").Verify();\n\n        [TestMethod]\n        public void BinaryOperationWithIdenticalExpressions_TestProject_CS() =>\n            builderCS.AddPaths(\"BinaryOperationWithIdenticalExpressions.cs\")\n                .AddTestReference()\n                .VerifyNoIssues();\n\n        [TestMethod]\n        public void BinaryOperationWithIdenticalExpressions_VB() =>\n            builderVB.AddPaths(\"BinaryOperationWithIdenticalExpressions.vb\").Verify();\n\n        [TestMethod]\n        public void BinaryOperationWithIdenticalExpressions_TestProject_VB() =>\n            builderVB.AddPaths(\"BinaryOperationWithIdenticalExpressions.vb\")\n                .AddTestReference()\n                .VerifyNoIssues();\n\n        [TestMethod]\n        public void BinaryOperationWithIdenticalExpressions_CS_Latest() =>\n            builderCS.AddPaths(\"BinaryOperationWithIdenticalExpressions.CSharpLatest.cs\")\n                .WithOptions(LanguageOptions.CSharpLatest)\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/BlazorQueryParameterRoutableComponentTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class BlazorQueryParameterRoutableComponentTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<BlazorQueryParameterRoutableComponent>();\n\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    public void BlazorQueryParameterRoutableComponent_Blazor() =>\n        builder.AddPaths(\"BlazorQueryParameterRoutableComponent.razor\")\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Product))\n            .Verify();\n\n    [TestMethod]\n    public void BlazorQueryParameterRoutableComponent_BlazorNoRoute() =>\n        builder.AddPaths(\"BlazorQueryParameterRoutableComponent.NoRoute.razor\")\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Product))\n            .Verify();\n\n    [TestMethod]\n    public void BlazorQueryParameterRoutableComponent_Partial() =>\n        builder.WithOptions(LanguageOptions.CSharpLatest)\n            .AddPaths(\n                \"BlazorQueryParameterRoutableComponent.Latest.Partial.razor\",\n                \"BlazorQueryParameterRoutableComponent.Latest.Partial.1.razor.cs\",\n                \"BlazorQueryParameterRoutableComponent.Latest.Partial.2.razor.cs\")\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Product))\n            .Verify();\n\n    [TestMethod]\n    public void BlazorQueryParameterRoutableComponent_CS() =>\n        builder.AddPaths(\"BlazorQueryParameterRoutableComponent.Compliant.cs\", \"BlazorQueryParameterRoutableComponent.Noncompliant.cs\")\n            .AddReferences(NuGetMetadataReference.MicrosoftAspNetCoreComponents(\"7.0.13\"))\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/BooleanCheckInvertedTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class BooleanCheckInvertedTest\n    {\n        private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.BooleanCheckInverted>();\n\n        [TestMethod]\n        public void BooleanCheckInverted_CS() =>\n            builderCS.AddPaths(\"BooleanCheckInverted.cs\").Verify();\n\n        [TestMethod]\n        public void BooleanCheckInverted_CS_CodeFix() =>\n            builderCS.AddPaths(\"BooleanCheckInverted.cs\")\n                .WithCodeFix<CS.BooleanCheckInvertedCodeFix>()\n                .WithCodeFixedPaths(\"BooleanCheckInverted.Fixed.cs\", \"BooleanCheckInverted.Fixed.Batch.cs\")\n                .VerifyCodeFix();\n\n        [TestMethod]\n        public void BooleanCheckInverted_VB() =>\n            new VerifierBuilder<VB.BooleanCheckInverted>().AddPaths(\"BooleanCheckInverted.vb\").WithOptions(LanguageOptions.FromVisualBasic14).Verify();\n\n        [TestMethod]\n        public void BooleanCheckInverted_CS_Latest() =>\n            builderCS\n                .WithOptions(LanguageOptions.CSharpLatest)\n                .WithConcurrentAnalysis(false)\n                .AddPaths(\"BooleanCheckInverted.Latest.cs\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/BooleanLiteralUnnecessaryTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class BooleanLiteralUnnecessaryTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.BooleanLiteralUnnecessary>();\n\n    [TestMethod]\n    public void BooleanLiteralUnnecessary_CS() =>\n        builderCS.AddPaths(\"BooleanLiteralUnnecessary.cs\").Verify();\n\n    [TestMethod]\n    public void BooleanLiteralUnnecessary_CodeFix_CS() =>\n        builderCS.AddPaths(\"BooleanLiteralUnnecessary.cs\")\n            .WithCodeFix<CS.BooleanLiteralUnnecessaryCodeFix>()\n            .WithCodeFixedPaths(\"BooleanLiteralUnnecessary.Fixed.cs\")\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void BooleanLiteralUnnecessary_Latest() =>\n        builderCS.AddPaths(\"BooleanLiteralUnnecessary.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void BooleanLiteralUnnecessary_CodeFix_Latest() =>\n        builderCS.AddPaths(\"BooleanLiteralUnnecessary.Latest.cs\")\n            .WithCodeFix<CS.BooleanLiteralUnnecessaryCodeFix>()\n            .WithCodeFixedPaths(\"BooleanLiteralUnnecessary.Latest.Fixed.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void BooleanLiteralUnnecessary_VB() =>\n        new VerifierBuilder<VB.BooleanLiteralUnnecessary>().AddPaths(\"BooleanLiteralUnnecessary.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/BreakOutsideSwitchTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class BreakOutsideSwitchTest\n    {\n        private readonly VerifierBuilder verifier = new VerifierBuilder<BreakOutsideSwitch>();\n\n        [TestMethod]\n        public void BreakOutsideSwitch() =>\n            verifier.AddPaths(\"BreakOutsideSwitch.cs\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/BypassingAccessibilityTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class BypassingAccessibilityTest\n    {\n        private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.BypassingAccessibility>();\n        private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.BypassingAccessibility>();\n\n        [TestMethod]\n        public void BypassingAccessibility_CS() =>\n            builderCS.AddPaths(\"BypassingAccessibility.cs\").Verify();\n\n        [TestMethod]\n        public void BypassingAccessibility_CSharp_Latest() =>\n            builderCS.AddPaths(\"BypassingAccessibility.Latest.cs\").WithTopLevelStatements().WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n        [TestMethod]\n        public void BypassingAccessibility_VB() =>\n            builderVB.AddPaths(\"BypassingAccessibility.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/CallToAsyncMethodShouldNotBeBlockingTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class CallToAsyncMethodShouldNotBeBlockingTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<CallToAsyncMethodShouldNotBeBlocking>();\n\n    [TestMethod]\n    public void CallToAsyncMethodShouldNotBeBlocking() =>\n        builder.AddPaths(\"CallToAsyncMethodShouldNotBeBlocking.cs\").AddReferences(NuGetMetadataReference.MicrosoftNetSdkFunctions()).Verify();\n\n    [TestMethod]\n    public void CallToAsyncMethodShouldNotBeBlocking_TopLevelStatements() =>\n        builder.AddPaths(\"CallToAsyncMethodShouldNotBeBlocking.TopLevelStatements.cs\").WithTopLevelStatements().Verify();\n\n    [TestMethod]\n    public void CallToAsyncMethodShouldNotBeBlocking_CS_Latest() =>\n        builder.AddPaths(\"CallToAsyncMethodShouldNotBeBlocking.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/CallerInformationParametersShouldBeLastTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class CallerInformationParametersShouldBeLastTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<CallerInformationParametersShouldBeLast>();\n\n    [TestMethod]\n    public void CallerInformationParametersShouldBeLast() =>\n        builder.AddPaths(\"CallerInformationParametersShouldBeLast.cs\").Verify();\n\n    [TestMethod]\n    public void CallerInformationParametersShouldBeLast_CS_Latest() =>\n        builder.AddPaths(\"CallerInformationParametersShouldBeLast.Latest.cs\", \"CallerInformationParametersShouldBeLast.Latest.Partial.cs\")\n            .WithTopLevelStatements()\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void CallerInformationParametersShouldBeLastInvalidSyntax() =>\n        builder.AddPaths(\"CallerInformationParametersShouldBeLastInvalidSyntax.cs\").WithLanguageVersion(LanguageVersion.CSharp7).WithConcurrentAnalysis(false).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/CastConcreteTypeToInterfaceTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class CastConcreteTypeToInterfaceTest\n    {\n        [TestMethod]\n        public void CastConcreteTypeToInterface() =>\n            new VerifierBuilder<CastConcreteTypeToInterface>().AddPaths(\"CastConcreteTypeToInterface.cs\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/CastShouldNotBeDuplicatedTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class CastShouldNotBeDuplicatedTest\n{\n    private static readonly VerifierBuilder Builder = new VerifierBuilder<CastShouldNotBeDuplicated>();\n\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    public void CastShouldNotBeDuplicated() =>\n        Builder.AddPaths(\"CastShouldNotBeDuplicated.cs\").Verify();\n\n    [TestMethod]\n    public void CastShouldNotBeDuplicated_CS_Latest() =>\n        Builder.AddPaths(\"CastShouldNotBeDuplicated.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n#if NET\n\n    [TestMethod]\n    public void CastShouldNotBeDuplicated_MvcView() =>\n        Builder\n        .AddSnippet(\"\"\"\n            public class Base {}\n            public class Derived: Base\n            {\n                public int Prop { get; set; }\n            }\n            \"\"\")\n        .AddPaths(\"CastShouldNotBeDuplicated.cshtml\")\n        .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Product))\n        .VerifyNoIssues();\n\n#endif\n\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/CatchEmptyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class CatchEmptyTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<CatchEmpty>();\n\n    [TestMethod]\n    public void CatchEmpty() =>\n        builder.AddPaths(\"CatchEmpty.cs\").Verify();\n\n    [TestMethod]\n    public void CatchEmpty_InTest() =>\n        builder.AddPaths(\"CatchEmpty.cs\").AddTestReference().VerifyNoIssues();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/CatchRethrowTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class CatchRethrowTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.CatchRethrow>();\n\n    [TestMethod]\n    public void CatchRethrow() =>\n        builderCS.AddPaths(\"CatchRethrow.cs\").Verify();\n\n    [TestMethod]\n    public void CatchRethrow_CodeFix() =>\n        builderCS.AddPaths(\"CatchRethrow.cs\")\n            .WithCodeFix<CS.CatchRethrowCodeFix>()\n            .WithCodeFixedPaths(\"CatchRethrow.Fixed.cs\")\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void CatchRethrow_VB() =>\n        new VerifierBuilder<VB.CatchRethrow>().AddPaths(\"CatchRethrow.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/CertificateValidationCheckTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class CertificateValidationCheckTest\n{\n    private static readonly VerifierBuilder WithReferences = new VerifierBuilder()\n        .AddReferences(MetadataReferenceFacade.SystemNetHttp)\n        .AddReferences(MetadataReferenceFacade.SystemSecurityCryptography)\n        .AddReferences(MetadataReferenceFacade.NetStandard);\n    private readonly VerifierBuilder builderCS = WithReferences.AddAnalyzer(() => new CS.CertificateValidationCheck());\n    private readonly VerifierBuilder builderVB = WithReferences.AddAnalyzer(() => new VB.CertificateValidationCheck());\n\n    [TestMethod]\n    public void CertificateValidationCheck_CS() =>\n        builderCS.AddPaths(\"CertificateValidationCheck.cs\").Verify();\n\n    [TestMethod]\n    public void CertificateValidationCheck_CS_Latest() =>\n        builderCS.AddPaths(\"CertificateValidationCheck.Latest.cs\", \"CertificateValidationCheck.Latest.Partial.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void CertificateValidationCheck_CS_TopLevelStatements() =>\n        builderCS.AddPaths(\"CertificateValidationCheck.TopLevelStatements.cs\").WithTopLevelStatements().Verify();\n\n    [TestMethod]\n    public void CertificateValidationCheck_VB() =>\n        builderVB.AddPaths(\"CertificateValidationCheck.vb\").Verify();\n\n    [TestMethod]\n    public void CreateParameterLookup_CS_ThrowsException()\n    {\n        var analyzer = new CS.CertificateValidationCheck();\n        Action a = () => analyzer.CreateParameterLookup(null, null);\n        a.Should().Throw<ArgumentException>();\n    }\n\n    [TestMethod]\n    public void CreateParameterLookup_VB_ThrowsException()\n    {\n        var analyzer = new VB.CertificateValidationCheck();\n        Action a = () => analyzer.CreateParameterLookup(null, null);\n        a.Should().Throw<ArgumentException>();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/CheckArgumentExceptionTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class CheckArgumentExceptionTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<CheckArgumentException>();\n\n    [TestMethod]\n    public void CheckArgumentException() =>\n        builder.AddPaths(\"CheckArgumentException.cs\").Verify();\n\n    [TestMethod]\n    public void CheckArgumentException_TopLevelStatements() =>\n        builder.AddPaths(\"CheckArgumentException.TopLevelStatements.cs\").WithTopLevelStatements().Verify();\n\n    [TestMethod]\n    public void CheckArgumentException_CS_Latest() =>\n        builder.AddPaths(\"CheckArgumentException.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/CheckFileLicenseTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class CheckFileLicenseTest\n    {\n        private const string SingleLineHeader = \"// Copyright (c) SonarSource. All Rights Reserved. Licensed under the LGPL License.  See License.txt in the project root for license information.\";\n        private const string MultiLineHeader = @\"/*\n * SonarQube, open source software quality management tool.\n * Copyright (C) 2008-2013 SonarSource\n * mailto:contact AT sonarsource DOT com\n *\n * SonarQube is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 3 of the License, or (at your option) any later version.\n *\n * SonarQube is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this program; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\n */\";\n        private const string MultiSingleLineCommentHeader = @\"//-----\n// MyHeader\n//-----\";\n        private const string HeaderForcingLineBreak = @\"//---\n\n\n\";\n        private const string SingleLineRegexHeader = @\"// Copyright \\(c\\) \\w*\\. All Rights Reserved\\. \" +\n            @\"Licensed under the LGPL License\\.  See License\\.txt in the project root for license information\\.\";\n        private const string MultiLineRegexHeader = @\"/\\*\n \\* SonarQube, open source software quality management tool\\.\n \\* Copyright \\(C\\) \\d\\d\\d\\d-\\d\\d\\d\\d SonarSource\n \\* mailto:contact AT sonarsource DOT com\n \\*\n \\* SonarQube is free software; you can redistribute it and/or\n \\* modify it under the terms of the GNU Lesser General Public\n \\* License as published by the Free Software Foundation; either\n \\* version 3 of the License, or \\(at your option\\) any later version\\.\n \\*\n \\* SonarQube is distributed in the hope that it will be useful,\n \\* but WITHOUT ANY WARRANTY; without even the implied warranty of\n \\* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE\\. See the GNU\n \\* Lesser General Public License for more details\\.\n \\*\n \\* You should have received a copy of the GNU Lesser General Public License\n \\* along with this program; if not, write to the Free Software Foundation,\n \\* Inc\\., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA\\.\n \\*/\";\n        private const string MultiLineRegexWithNewLine = \"//-{5}\\r\\n// MyHeader\\r\\n//-{5}\";\n        private const string MultiLineRegexWithDot = \"//-{5}.+// MyHeader.+//-{5}\";\n        private const string FailingSingleLineRegexHeader = \"[\";\n\n        [TestMethod]\n        public void CheckFileLicense_WhenUnlicensedFileStartingWithUsing_ShouldBeNoncompliant_CS() =>\n            Builder(SingleLineHeader).AddPaths(\"CheckFileLicense_NoLicenseStartWithUsing.cs\").Verify();\n\n        [TestMethod]\n        public void CheckFileLicense_WhenLicensedFileStartingWithUsing_ShouldBeCompliant_CS() =>\n            Builder(SingleLineHeader).AddPaths(\"CheckFileLicense_SingleLineLicenseStartWithUsing.cs\")\n                .WithConcurrentAnalysis(false)\n                .VerifyNoIssues();\n\n        [TestMethod]\n        public void CheckFileLicense_WhenLicensedFileStartingWithUsingAndUsingCustomValues_ShouldBeCompliant_CS() =>\n            Builder(SingleLineRegexHeader, true).AddPaths(\"CheckFileLicense_SingleLineLicenseStartWithUsing.cs\")\n                .WithConcurrentAnalysis(false)\n                .VerifyNoIssues();\n\n        [TestMethod]\n        public void CheckFileLicense_WhenLicensedWithMultilineCommentStartingWithUsing_ShouldBeCompliant_CS() =>\n            Builder(MultiLineHeader).AddPaths(\"CheckFileLicense_MultiLineLicenseStartWithUsing.cs\")\n                .WithConcurrentAnalysis(false)\n                .VerifyNoIssues();\n\n        [TestMethod]\n        public void CheckFileLicense_WhenLicensedWithMultilineCommentStartingWithUsingWithCustomValues_ShouldBeCompliant_CS() =>\n            Builder(MultiLineRegexHeader, true).AddPaths(\"CheckFileLicense_MultiLineLicenseStartWithUsing.cs\")\n                .WithConcurrentAnalysis(false)\n                .VerifyNoIssues();\n\n        [TestMethod]\n        public void CheckFileLicense_WhenNoLicenseStartingWithNamespace_ShouldBeNonCompliant_CS() =>\n            Builder(SingleLineHeader).AddPaths(\"CheckFileLicense_NoLicenseStartWithNamespace.cs\").Verify();\n\n        [TestMethod]\n        public void CheckFileLicense_WhenLicensedWithSingleLineCommentStartingWithNamespace_ShouldBeCompliant_CS() =>\n            Builder(SingleLineHeader).AddPaths(\"CheckFileLicense_SingleLineLicenseStartWithNamespace.cs\")\n                .WithConcurrentAnalysis(false)\n                .VerifyNoIssues();\n\n        [TestMethod]\n        public void CheckFileLicense_WhenLicensedWithSingleLineCommentStartingWithNamespaceAndUsingCustomValues_ShouldBeCompliant_CS() =>\n            Builder(SingleLineRegexHeader, true).AddPaths(\"CheckFileLicense_SingleLineLicenseStartWithNamespace.cs\")\n                .WithConcurrentAnalysis(false)\n                .VerifyNoIssues();\n\n        [TestMethod]\n        public void CheckFileLicense_WhenLicensedWithMultilineCommentStartingWithNamespace_ShouldBeCompliant_CS() =>\n            Builder(MultiLineHeader).AddPaths(\"CheckFileLicense_MultiLineLicenseStartWithNamespace.cs\")\n                .WithConcurrentAnalysis(false)\n                .VerifyNoIssues();\n\n        [TestMethod]\n        public void CheckFileLicense_WhenLicensedWithMultilineCommentStartingWithNamespaceAndUsingCustomValues_ShouldBeCompliant_CS() =>\n            Builder(MultiLineRegexHeader, true).AddPaths(\"CheckFileLicense_MultiLineLicenseStartWithNamespace.cs\")\n                .WithConcurrentAnalysis(false)\n                .VerifyNoIssues();\n\n        [TestMethod]\n        public void CheckFileLicense_WhenLicensedWithMultiSingleLineCommentStartingWithNamespaceAndNoRegex_ShouldBeCompliant_CS() =>\n            Builder(MultiSingleLineCommentHeader).AddPaths(\"CheckFileLicense_MultiSingleLineLicenseStartWithNamespace.cs\")\n                .WithConcurrentAnalysis(false)\n                .VerifyNoIssues();\n\n        [TestMethod]\n        public void CheckFileLicense_WhenLicensedWithMultiSingleLineCommentStartingWithAdditionalComments_ShouldBeCompliant_CS() =>\n            Builder(MultiSingleLineCommentHeader).AddPaths(\"CheckFileLicense_MultiSingleLineLicenseStartWithAdditionalComment.cs\")\n                .WithConcurrentAnalysis(false)\n                .VerifyNoIssues();\n\n        [TestMethod]\n        public void CheckFileLicense_WhenLicensedWithMultiSingleLineCommentStartingWithAdditionalCommentOnSameLine_ShouldBeNonCompliant_CS() =>\n            Builder(MultiSingleLineCommentHeader).AddPaths(\"CheckFileLicense_MultiSingleLineLicenseStartWithAdditionalCommentOnSameLine.cs\").Verify();\n\n        [TestMethod]\n        public void CheckFileLicense_WithForcingEmptyLines_ShouldBeNonCompliant_CS() =>\n            Builder(HeaderForcingLineBreak).AddPaths(\"CheckFileLicense_ForcingEmptyLinesKo.cs\").Verify();\n\n        [TestMethod]\n        public void CheckFileLicense_WithForcingEmptyLines_ShouldBeCompliant_CS() =>\n            Builder(HeaderForcingLineBreak).AddPaths(\"CheckFileLicense_ForcingEmptyLinesOk.cs\")\n                .WithConcurrentAnalysis(false)\n                .VerifyNoIssues();\n\n        [TestMethod]\n        public void CheckFileLicense_WhenLicensedWithMultiSingleLineCommentStartingWithNamespaceAndMultiLineRegexWithNewLine_ShouldBeCompliant_CS() =>\n            Builder(MultiLineRegexWithNewLine, true).AddPaths(\"CheckFileLicense_MultiSingleLineLicenseStartWithNamespace.cs\")\n                .WithConcurrentAnalysis(false)\n                .VerifyNoIssues();\n\n        [TestMethod]\n        public void CheckFileLicense_WhenLicensedWithMultiSingleLineCommentStartingWithNamespaceAndMultiLineRegexWithDot_ShouldBeCompliant_CS() =>\n            Builder(MultiLineRegexWithDot, true).AddPaths(\"CheckFileLicense_MultiSingleLineLicenseStartWithNamespace.cs\")\n                .WithConcurrentAnalysis(false)\n                .VerifyNoIssues();\n\n        [TestMethod]\n        public void CheckFileLicense_WhenEmptyFile_ShouldBeNonCompliant_CS() =>\n            // While we put Noncompliant annotation on 1st line of any file, in this case, the file needs to be empty\n            Builder(SingleLineHeader).AddPaths(\"CheckFileLicense_EmptyFile.cs\").Invoking(x => x.Verify()).Should().Throw<DiagnosticVerifierException>().WithMessage(\"\"\"\n                There are differences for CSharp7 CheckFileLicense_EmptyFile.cs:\n                  Line 1: Unexpected issue 'Add or update the header of this file.' Rule S1451\n\n                There is 1 more difference in CheckFileLicense_EmptyFile.Concurrent.cs\n\n                \"\"\");\n\n        [TestMethod]\n        public void CheckFileLicenseCodeFix_WhenThereIsAYearDifference_ShouldBeNonCompliant_CS() =>\n            Builder(MultiLineHeader).AddPaths(\"CheckFileLicense_YearDifference.cs\").Verify();\n\n        [TestMethod]\n        public void CheckFileLicense_WhenProvidingAnInvalidRegex_ShouldThrowException_CS()\n        {\n            var compilation = SolutionBuilder.CreateSolutionFromPath(@\"TestCases\\CheckFileLicense_NoLicenseStartWithUsing.cs\").Compile(LanguageOptions.CSharpLatest.ToArray()).Single();\n            var errors = DiagnosticVerifier.AnalyzerExceptions(compilation, new CS.CheckFileLicense { HeaderFormat = FailingSingleLineRegexHeader, IsRegularExpression = true });\n            errors.Should().ContainSingle().Which.GetMessage().Should()\n                .Contain(\"System.InvalidOperationException\")\n                .And.Contain(\"Invalid regular expression: \" + FailingSingleLineRegexHeader);\n        }\n\n        [TestMethod]\n        public void CheckFileLicense_WhenUsingComplexRegex_ShouldBeCompliant_CS() =>\n            Builder(@\"// <copyright file=\"\".*\\.cs\"\" company=\"\".*\"\">\\r\\n// Copyright \\(c\\) 2012 All Rights Reserved\\r\\n// </copyright>\\r\\n// <author>.*</author>\\r\\n// <date>.*</date>\\r\\n// <summary>.*</summary>\\r\\n\", true)\n                .AddPaths(\"CheckFileLicense_ComplexRegex.cs\")\n                .WithConcurrentAnalysis(false)\n                .VerifyNoIssues();\n\n        [TestMethod]\n        public void CheckFileLicense_WhenUsingMultilinesHeaderAsSingleLineString_ShouldBeCompliant_CS() =>\n            Builder(@\"// <copyright file=\"\"ProgramHeader2.cs\"\" company=\"\"My Company Name\"\">\\r\\n// Copyright (c) 2012 All Rights Reserved\\r\\n// </copyright>\\r\\n// <author>Name of the Author</author>\\r\\n// <date>08/22/2017 12:39:58 AM </date>\\r\\n// <summary>Class representing a Sample entity</summary>\\r\\n\", false)\n                .AddPaths(\"CheckFileLicense_ComplexRegex.cs\")\n                .WithConcurrentAnalysis(false)\n                .VerifyNoIssues();\n\n        [TestMethod]\n        public void CheckFileLicenseCodeFix_WhenNoLicenseStartWithNamespaceAndUsesDefaultValues_ShouldBeNoncompliant_CS() =>\n            new VerifierBuilder<CS.CheckFileLicense>()\n                .WithCodeFix<CS.CheckFileLicenseCodeFix>()\n                .AddPaths(\"CheckFileLicense_DefaultValues.cs\")\n                .WithCodeFixedPaths(\"CheckFileLicense_DefaultValues.Fixed.cs\")\n                .VerifyCodeFix();\n\n        [TestMethod]\n        public void CheckFileLicenseCodeFix_CSharp9_ShouldBeNoncompliant_CS() =>\n            new VerifierBuilder<CS.CheckFileLicense>()\n                .WithCodeFix<CS.CheckFileLicenseCodeFix>()\n                .AddPaths(\"CheckFileLicense_CSharp9.cs\")\n                .WithCodeFixedPaths(\"CheckFileLicense_CSharp9.Fixed.cs\")\n                .WithOptions(LanguageOptions.FromCSharp9)\n                .VerifyCodeFix();\n\n        [TestMethod]\n        public void CheckFileLicenseCodeFix_WhenNoLicenseStartingWithUsing_ShouldBeFixedAsExpected_CS() =>\n            Builder(SingleLineHeader)\n                .WithCodeFix<CS.CheckFileLicenseCodeFix>()\n                .AddPaths(\"CheckFileLicense_NoLicenseStartWithUsing.cs\")\n                .WithCodeFixedPaths(\"CheckFileLicense_NoLicenseStartWithUsing.Fixed.cs\")\n                .VerifyCodeFix();\n\n        [TestMethod]\n        public void CheckFileLicenseCodeFix_WhenNoLicenseStartingWithNamespace_ShouldBeFixedAsExpected_CS() =>\n            Builder(SingleLineHeader)\n                .WithCodeFix<CS.CheckFileLicenseCodeFix>()\n                .AddPaths(\"CheckFileLicense_NoLicenseStartWithNamespace.cs\")\n                .WithCodeFixedPaths(\"CheckFileLicense_NoLicenseStartWithNamespace.Fixed.cs\")\n                .VerifyCodeFix();\n\n        [TestMethod]\n        public void CheckFileLicenseCodeFix_WhenThereIsAYearDifference_ShouldBeFixedAsExpected_CS() =>\n            Builder(MultiLineHeader)\n                .WithCodeFix<CS.CheckFileLicenseCodeFix>()\n                .AddPaths(\"CheckFileLicense_YearDifference.cs\")\n                .WithCodeFixedPaths(\"CheckFileLicense_YearDifference.Fixed.cs\")\n                .VerifyCodeFix();\n\n        [TestMethod]\n        public void CheckFileLicenseCodeFix_WhenOutdatedLicenseStartingWithUsing_ShouldBeFixedAsExpected_CS() =>\n            Builder(MultiLineHeader)\n                .WithCodeFix<CS.CheckFileLicenseCodeFix>()\n                .AddPaths(\"CheckFileLicense_OutdatedLicenseStartWithUsing.cs\")\n                .WithCodeFixedPaths(\"CheckFileLicense_OutdatedLicenseStartWithUsing.Fixed.cs\")\n                .VerifyCodeFix();\n\n        [TestMethod]\n        public void CheckFileLicenseCodeFix_WhenOutdatedLicenseStartingWithNamespace_ShouldBeFixedAsExpected_CS() =>\n            Builder(MultiLineHeader)\n                .WithCodeFix<CS.CheckFileLicenseCodeFix>()\n                .AddPaths(\"CheckFileLicense_OutdatedLicenseStartWithNamespace.cs\")\n                .WithCodeFixedPaths(\"CheckFileLicense_OutdatedLicenseStartWithNamespace.Fixed.cs\")\n                .VerifyCodeFix();\n\n        [TestMethod]\n        public void CheckFileLicense_NullHeader_NoIssueReported_CS() =>\n            Builder(null).AddPaths(\"CheckFileLicense_NoLicenseStartWithNamespace.cs\").VerifyNoIssues();\n\n        // No need to duplicate all test cases from C#, because we are sharing the implementation\n        [TestMethod]\n        public void CheckFileLicense_NonCompliant_VB() =>\n            new VerifierBuilder<VB.CheckFileLicense>().AddPaths(\"CheckFileLicense_NonCompliant.vb\").Verify();\n\n        [TestMethod]\n        public void CheckFileLicense_Compliant_VB() =>\n            new VerifierBuilder().AddAnalyzer(() => new VB.CheckFileLicense\n            {\n                HeaderFormat = @\"Copyright \\(c\\) [0-9]+ All Rights Reserved\n\",\n                IsRegularExpression = true\n            })\n                .AddPaths(\"CheckFileLicense_Compliant.vb\")\n                .VerifyNoIssues();\n\n        private static VerifierBuilder Builder(string headerFormat, bool isRegularExpression = false) =>\n            new VerifierBuilder().AddAnalyzer(() => new CS.CheckFileLicense { HeaderFormat = headerFormat, IsRegularExpression = isRegularExpression });\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ClassAndMethodNameTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ClassAndMethodNameTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.ClassAndMethodName>();\n\n    [TestMethod]\n    public void ClassAndMethodName_CS() =>\n        builderCS.AddPaths(\"ClassAndMethodName.cs\", \"ClassAndMethodName.Partial.cs\")\n            .AddReferences(MetadataReferenceFacade.NetStandard21)\n            .WithConcurrentAnalysis(false)\n            .WithOptions(LanguageOptions.FromCSharp8)\n            .Verify();\n\n    [TestMethod]\n    public void ClassAndMethodName_InTestProject_CS() =>\n        builderCS.AddPaths(\"ClassAndMethodName.Tests.cs\").AddTestReference().WithOptions(LanguageOptions.FromCSharp8).Verify();\n\n    [TestMethod]\n    public void ClassAndMethodName_TopLevelStatement_CS() =>\n        builderCS.AddPaths(\"ClassAndMethodName.TopLevelStatement.cs\").WithTopLevelStatements().Verify();\n\n    [TestMethod]\n    public void ClassAndMethodName_TopLevelStatement_InTestProject_CS() =>\n        builderCS.AddPaths(\"ClassAndMethodName.TopLevelStatement.Test.cs\").AddTestReference().WithTopLevelStatements().Verify();\n\n    [TestMethod]\n    public void ClassAndMethodName_MethodName_CS_Latest() =>\n        builderCS.AddPaths(\"ClassAndMethodName.MethodName.Latest.cs\", \"ClassAndMethodName.MethodName.Latest.Partial.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void ClassAndMethodName_MethodName_InTestProject_CS_Latest() =>\n        builderCS.AddPaths(\"ClassAndMethodName.MethodName.Latest.cs\", \"ClassAndMethodName.MethodName.Latest.Partial.cs\").AddTestReference().WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    [DataRow(ProjectType.Product)]\n    [DataRow(ProjectType.Test)]\n    public void ClassAndMethodName_VB(ProjectType projectType) =>\n        new VerifierBuilder<VB.ClassName>().AddPaths(\"ClassAndMethodName.vb\").AddReferences(TestCompiler.ProjectTypeReference(projectType)).Verify();\n\n    [TestMethod]\n    [DataRow(ProjectType.Product)]\n    [DataRow(ProjectType.Test)]\n    public void ClassAndMethodName_MethodName(ProjectType projectType) =>\n        builderCS.AddPaths(\"ClassAndMethodName.MethodName.cs\", \"ClassAndMethodName.MethodName.Partial.cs\")\n            .AddReferences(TestCompiler.ProjectTypeReference(projectType))\n            .WithOptions(LanguageOptions.FromCSharp8)\n            .Verify();\n\n    [TestMethod]\n    [DataRow(\"foo\", \"foo\")]\n    [DataRow(\"Foo\", \"Foo\")]\n    [DataRow(\"FFF\", \"FFF\")]\n    [DataRow(\"FfF\", \"Ff\", \"F\")]\n    [DataRow(\"Ff9F\", \"Ff\", \"9\", \"F\")]\n    [DataRow(\"你好\", \"你\", \"好\")]\n    [DataRow(\"FFf\", \"F\", \"Ff\")]\n    [DataRow(\"\")]\n    [DataRow(\"FF9d\", \"FF\", \"9\", \"d\")]\n    [DataRow(\"y2x5__w7\", \"y\", \"2\", \"x\", \"5\", \"_\", \"_\", \"w\", \"7\")]\n    [DataRow(\"3%c#account\", \"3\", \"%\", \"c\", \"#\", \"account\")]\n    public void TestSplitToParts(string name, params string[] expectedParts) =>\n        CS.ClassAndMethodName.SplitToParts(name).Should().BeEquivalentTo(expectedParts);\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ClassNamedExceptionTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ClassNamedExceptionTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.ClassNamedException>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.ClassNamedException>();\n\n    [TestMethod]\n    public void ClassNamedException_CS() =>\n        builderCS\n            .AddPaths(\"ClassNamedException.cs\")\n            .Verify();\n\n    [TestMethod]\n    public void ClassNamedException_CS_Latest() =>\n        builderCS\n            .AddPaths(\"ClassNamedException.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .VerifyNoIssues();\n\n    [TestMethod]\n    public void ClassNamedException_VB() =>\n        builderVB\n            .AddPaths(\"ClassNamedException.vb\")\n            .Verify();\n\n#if NETFRAMEWORK\n\n    [TestMethod]\n    public void ClassNamedException_Interop_CS() =>\n        builderCS\n            .AddPaths(\"ClassNamedException.Interop.cs\")\n            .VerifyNoIssues();\n\n    [TestMethod]\n    public void ClassNamedException_Interop_VB() =>\n        builderVB\n            .AddPaths(\"ClassNamedException.Interop.vb\")\n            .VerifyNoIssues();\n\n#endif\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ClassNotInstantiatableTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ClassNotInstantiatableTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.ClassNotInstantiatable>();\n\n    [TestMethod]\n    public void ClassNotInstantiatable_CS() =>\n        builderCS.AddPaths(\"ClassNotInstantiatable.cs\").Verify();\n\n    [TestMethod]\n    public void ClassNotInstantiatable_CS_Latest() =>\n        builderCS.AddPaths(\"ClassNotInstantiatable.Latest.cs\", \"ClassNotInstantiatable.Latest.Partial.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void ClassNotInstantiatable_VB() =>\n        new VerifierBuilder<VB.ClassNotInstantiatable>().AddPaths(\"ClassNotInstantiatable.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ClassShouldNotBeEmptyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ClassShouldNotBeEmptyTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.ClassShouldNotBeEmpty>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.ClassShouldNotBeEmpty>();\n\n    [TestMethod]\n    public void ClassShouldNotBeEmpty_CS() =>\n        builderCS\n            .AddPaths(\"ClassShouldNotBeEmpty.cs\")\n            .Verify();\n\n    [TestMethod]\n    public void ClassShouldNotBeEmpty_VB() =>\n        builderVB\n            .AddPaths(\"ClassShouldNotBeEmpty.vb\")\n            .Verify();\n\n    [TestMethod]\n    public void ClassShouldNotBeEmpty_CS_Latest() =>\n        builderCS\n            .AddPaths(\"ClassShouldNotBeEmpty.Latest.cs\", \"ClassShouldNotBeEmpty.Latest.Partial.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n#if NET\n\n    [TestMethod]\n    public void ClassShouldNotBeEmpty_Inheritance_CS() =>\n        builderCS\n            .AddPaths(\"ClassShouldNotBeEmpty.Inheritance.cs\")\n            .AddReferences(AdditionalReferences())\n            .Verify();\n\n    [TestMethod]\n    public void ClassShouldNotBeEmpty_Inheritance_VB() =>\n        builderVB\n            .AddPaths(\"ClassShouldNotBeEmpty.Inheritance.vb\")\n            .AddReferences(AdditionalReferences())\n            .Verify();\n\n    private static MetadataReference[] AdditionalReferences() =>\n        [\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcAbstractions,\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcCore,\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcRazorPages\n        ];\n#endif\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ClassWithEqualityShouldImplementIEquatableTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ClassWithEqualityShouldImplementIEquatableTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<ClassWithEqualityShouldImplementIEquatable>();\n\n    [TestMethod]\n    public void ClassWithEqualityShouldImplementIEquatable() =>\n        builder.AddPaths(\"ClassWithEqualityShouldImplementIEquatable.cs\").Verify();\n\n    [TestMethod]\n    public void ClassWithEqualityShouldImplementIEquatable_CS_Latest() =>\n        builder.AddPaths(\"ClassWithEqualityShouldImplementIEquatable.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ClassWithOnlyStaticMemberTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ClassWithOnlyStaticMemberTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<ClassWithOnlyStaticMember>();\n\n    [TestMethod]\n    public void ClassWithOnlyStaticMember() =>\n        builder.AddPaths(\"ClassWithOnlyStaticMember.cs\").Verify();\n\n    [TestMethod]\n    public void ClassWithOnlyStaticMember_TopLevelStatements() =>\n        builder.AddPaths(\"ClassWithOnlyStaticMember.TopLevelStatements.cs\")\n            .WithTopLevelStatements()\n            .VerifyNoIssues();\n\n    [TestMethod]\n    public void ClassWithOnlyStaticMember_Latest() =>\n        builder.AddPaths(\"ClassWithOnlyStaticMember.Latest.cs\", \"ClassWithOnlyStaticMember.Latest.Partial.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/CloudNative/AzureFunctionsCatchExceptionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class AzureFunctionsCatchExceptionsTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<AzureFunctionsCatchExceptions>().WithBasePath(\"CloudNative\").AddReferences(NuGetMetadataReference.MicrosoftNetSdkFunctions());\n\n        [TestMethod]\n        public void AzureFunctionsCatchExceptions_CS() =>\n            builder.AddPaths(\"AzureFunctionsCatchExceptions.cs\").WithOptions(LanguageOptions.FromCSharp8).Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/CloudNative/AzureFunctionsLogFailuresTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class AzureFunctionsLogFailuresTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<AzureFunctionsLogFailures>().WithBasePath(\"CloudNative\").AddReferences(NuGetMetadataReference.MicrosoftNetSdkFunctions());\n\n        [TestMethod]\n        public void AzureFunctionsLogFailures_CS() =>\n            builder.AddPaths(\"AzureFunctionsLogFailures.cs\").Verify();\n\n        [TestMethod]\n        // Calls to LoggerExtensions.LogSomething extension methods\n        [DataRow(true, \"log.LogError(ex, string.Empty);\")]\n        [DataRow(true, \"log.LogCritical(ex, string.Empty);\")]\n        [DataRow(true, \"log.LogWarning(ex, string.Empty);\")]\n        [DataRow(true, \"log.LogInformation(ex, string.Empty);\")]\n        [DataRow(false, \"log.LogDebug(ex, string.Empty);\")]\n        [DataRow(false, \"log.LogTrace(ex, string.Empty);\")]\n        // LoggerExtensions.Log with LogLevel parameter\n        [DataRow(true, \"log.Log(LogLevel.Information, ex, string.Empty);\")]\n        [DataRow(true, \"log.Log(LogLevel.Warning, ex, string.Empty);\")]\n        [DataRow(true, \"log.Log(LogLevel.Error, ex, string.Empty);\")]\n        [DataRow(true, \"log.Log(LogLevel.Critical, ex, string.Empty);\")]\n        [DataRow(false, \"log.Log(LogLevel.Trace, ex, string.Empty);\")]\n        [DataRow(false, \"log.Log(LogLevel.Debug, ex, string.Empty);\")]\n        [DataRow(false, \"log.Log(LogLevel.None, ex, string.Empty);\")]\n        // Calls with complications in it\n        [DataRow(true, \"log.Log(LogLevel.Critical, string.Empty);\")] // It is not required to pass the exception to the log call\n        [DataRow(true, \"log.Log(exception: ex, message: string.Empty, logLevel: LogLevel.Error);\")] // Out of order named args\n        [DataRow(true, \"log.Log(message: string.Empty, logLevel: LogLevel.Error);\")]\n        [DataRow(true, @\"log.Log((LogLevel)Enum.Parse(typeof(LogLevel), \"\"Trace\"\"), string.Empty);\")] // call is compliant, if LogLevel is not known at compile time\n        // Calls to ILogger.Log\n        [DataRow(true, \"log.Log(LogLevel.Error, new EventId(), (object)null, ex, (s, e) => string.Empty);\")]\n        [DataRow(true, \"log.Log(eventId: new EventId(), state: (object)null, exception: ex, formatter: (s, e) => string.Empty, logLevel: LogLevel.Error);\")]\n        [DataRow(false, \"log.Log(eventId: new EventId(), state: (object)null, exception: ex, formatter: (s, e) => string.Empty, logLevel: LogLevel.Trace);\")]\n        // Receiver is complicated expression\n        [DataRow(true, \"((ILogger)log).Log(LogLevel.Critical, string.Empty);\")]\n        [DataRow(false, \"((ILogger)log).Log(LogLevel.Trace, string.Empty);\")]\n        [DataRow(true, \"new Func<ILogger>(()=>log)().Log(LogLevel.Critical, string.Empty);\")]\n        [DataRow(true, \"new Func<ILogger>(()=>log)().Log(LogLevel.Error, new EventId(), (object)null, ex, (s, e) => string.Empty);\")]\n        // Non logging methods\n        [DataRow(false, \"log.BeginScope(string.Empty, string.Empty);\")]\n        [DataRow(false, \"log.BeginScope<object>(null);\")]\n        [DataRow(false, \"log.IsEnabled(LogLevel.Warning);\")]\n        public void AzureFunctionsLogFailures_VerifyLoggerCalls(bool isCompliant, string loggerInvocation)\n        {\n            var snippet = builder.AddSnippet($$\"\"\"\n                using Microsoft.Azure.WebJobs;\n                using Microsoft.Extensions.Logging;\n                using System;\n\n                    public static class Function1\n                    {\n                        [FunctionName(\"Function1\")]\n                        public static void Run(ILogger log)\n                        {\n                            try { }\n                            catch(Exception ex) // {{(isCompliant ? \"Compliant\" : \"Noncompliant\")}}\n                            {\n                                {{loggerInvocation}} // {{(isCompliant ? string.Empty : \"Secondary\")}}\n                            }\n                        }\n                    }\n                \"\"\");\n            if (isCompliant)\n            {\n                snippet.VerifyNoIssues();\n            }\n            else\n            {\n                snippet.Verify();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/CloudNative/AzureFunctionsReuseClientsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules.CloudNative\n{\n    [TestClass]\n    public class AzureFunctionsReuseClientsTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<AzureFunctionsReuseClients>()\n            .WithBasePath(\"CloudNative\")\n            .AddReferences(NuGetMetadataReference.MicrosoftNetSdkFunctions())\n            .AddReferences(MetadataReferenceFacade.SystemThreadingTasks)\n            .AddReferences(NuGetMetadataReference.SystemNetHttp())\n            .AddReferences(NuGetMetadataReference.MicrosoftExtensionsHttp());\n\n        [TestMethod]\n        public void AzureFunctionsReuseClients_HttpClient_CS() =>\n            builder.AddPaths(\"AzureFunctionsReuseClients.HttpClient.cs\").Verify();\n\n        [TestMethod]\n        public void AzureFunctionsReuseClients_HttpClient_CSharp9() =>\n            builder.AddPaths(\"AzureFunctionsReuseClients.HttpClient.CSharp9.cs\").WithOptions(LanguageOptions.FromCSharp9).Verify();\n\n        [TestMethod]\n        public void AzureFunctionsReuseClients_DocumentClient_CS() =>\n            builder.AddPaths(\"AzureFunctionsReuseClients.DocumentClient.cs\")\n                .AddReferences(NuGetMetadataReference.MicrosoftAzureDocumentDB())\n                .Verify();\n\n        [TestMethod]\n        public void AzureFunctionsReuseClients_CosmosClient_CS() =>\n            builder.AddPaths(\"AzureFunctionsReuseClients.CosmosClient.cs\")\n                .AddReferences(NuGetMetadataReference.MicrosoftAzureCosmos())\n                .Verify();\n\n        [TestMethod]\n        public void AzureFunctionsReuseClients_ServiceBusV5_CS() =>\n            builder.AddPaths(\"AzureFunctionsReuseClients.ServiceBusV5.cs\")\n                .AddReferences(NuGetMetadataReference.MicrosoftAzureServiceBus())\n                .Verify();\n\n        [TestMethod]\n        public void AzureFunctionsReuseClients_ServiceBusV7_CS() =>\n            builder.AddPaths(\"AzureFunctionsReuseClients.ServiceBusV7.cs\")\n                .AddReferences(NuGetMetadataReference.AzureMessagingServiceBus())\n                .Verify();\n\n        [TestMethod]\n        public void AzureFunctionsReuseClients_Storage_CS() =>\n            builder.AddPaths(\"AzureFunctionsReuseClients.Storage.cs\")\n                .AddReferences(NuGetMetadataReference.AzureCore())\n                .AddReferences(NuGetMetadataReference.AzureStorageCommon())\n                .AddReferences(NuGetMetadataReference.AzureStorageBlobs())\n                .AddReferences(NuGetMetadataReference.AzureStorageQueues())\n                .AddReferences(NuGetMetadataReference.AzureStorageFilesShares())\n                .AddReferences(NuGetMetadataReference.AzureStorageFilesDataLake())\n                .Verify();\n\n        [TestMethod]\n        public void AzureFunctionsReuseClients_ArmClient_CS() =>\n            builder.AddPaths(\"AzureFunctionsReuseClients.ArmClient.cs\")\n                .AddReferences(NuGetMetadataReference.AzureCore())\n                .AddReferences(NuGetMetadataReference.AzureIdentity())\n                .AddReferences(NuGetMetadataReference.AzureResourceManager())\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/CloudNative/AzureFunctionsStatelessTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class AzureFunctionsStatelessTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<AzureFunctionsStateless>().WithBasePath(\"CloudNative\").AddReferences(NuGetMetadataReference.MicrosoftNetSdkFunctions());\n\n        [TestMethod]\n        public void AzureFunctionsStateless_CSharp8() =>\n            builder.AddPaths(\"AzureFunctionsStateless.cs\").WithOptions(LanguageOptions.FromCSharp8).Verify();\n\n        [TestMethod]\n        public void AzureFunctionsStateless_Latest() =>\n            builder.AddPaths(\"AzureFunctionsStateless.Latest.cs\", \"AzureFunctionsStateless.Latest.Partial.cs\")\n                .WithOptions(LanguageOptions.CSharpLatest)\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/CloudNative/DurableEntityInterfaceRestrictionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class DurableEntityInterfaceRestrictionsTest\n{\n#if NET\n    private readonly VerifierBuilder builder = new VerifierBuilder<DurableEntityInterfaceRestrictions>()\n        .WithBasePath(\"CloudNative\")\n        .AddReferences(NuGetMetadataReference.MicrosoftAzureWebJobsExtensionsDurableTask());\n\n    [TestMethod]\n    public void DurableEntityInterfaceRestrictions_CSharp11() =>\n        builder.AddPaths(\"DurableEntityInterfaceRestrictions.CSharp11.cs\")\n            .WithOptions(LanguageOptions.FromCSharp11)\n            .Verify();\n\n    [TestMethod]\n    public void DurableEntityInterfaceRestrictions_CS_NET() =>\n        builder.AddPaths(\"DurableEntityInterfaceRestrictions.cs\").Verify();\n\n#endif\n\n    [TestMethod]\n    public void DurableEntityInterfaceRestrictions_CS() =>\n        new VerifierBuilder<DurableEntityInterfaceRestrictions>()\n            .AddReferences(NuGetMetadataReference.MicrosoftAzureWebJobsExtensionsDurableTask(\"2.13.7\"))\n            .WithBasePath(\"CloudNative\")\n            .AddPaths(\"DurableEntityInterfaceRestrictions.cs\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/CognitiveComplexityTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class CognitiveComplexityTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder().AddAnalyzer(() => new CS.CognitiveComplexity { Threshold = 0, PropertyThreshold = 0 });\n    private readonly VerifierBuilder builderVB = new VerifierBuilder().AddAnalyzer(() => new VB.CognitiveComplexity { Threshold = 0, PropertyThreshold = 0 });\n\n    [TestMethod]\n    public void CognitiveComplexity_CS() =>\n        builderCS.AddPaths(\"CognitiveComplexity.cs\")\n            .WithOptions(LanguageOptions.FromCSharp8)\n            .Verify();\n\n    [TestMethod]\n    public void CognitiveComplexity_CS_Latest() =>\n        builderCS\n            .AddPaths(\"CognitiveComplexity.Latest.cs\")\n            .AddPaths(\"CognitiveComplexity.Latest.Partial.cs\")\n            .WithTopLevelStatements()\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void CognitiveComplexity_VB() => builderVB.AddPaths(\"CognitiveComplexity.vb\").Verify();\n\n    [TestMethod]\n    public void CognitiveComplexity_StackOverflow_CS()\n    {\n        if (!TestEnvironment.IsAzureDevOpsContext) // ToDo: Test throws OOM on Azure DevOps\n        {\n            builderCS.AddPaths(\"SyntaxWalker_InsufficientExecutionStackException.cs\").VerifyNoIssues();\n        }\n    }\n\n    [TestMethod]\n    public void CognitiveComplexity_StackOverflow_VB()\n    {\n        if (!TestEnvironment.IsAzureDevOpsContext) // ToDO: Test throws OOM on Azure DevOps\n        {\n            builderVB.AddPaths(\"SyntaxWalker_InsufficientExecutionStackException.vb\").VerifyNoIssues();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/CollectionEmptinessCheckingTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class CollectionEmptinessCheckingTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.CollectionEmptinessChecking>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.CollectionEmptinessChecking>();\n\n    [TestMethod]\n    public void CollectionEmptinessChecking_CS() =>\n        builderCS\n            .AddPaths(\"CollectionEmptinessChecking.cs\")\n            .Verify();\n\n    [TestMethod]\n    public void CollectionEmptinessChecking_VB() =>\n        builderVB\n            .AddPaths(\"CollectionEmptinessChecking.vb\")\n            .Verify();\n\n    [TestMethod]\n    public void CollectionEmptinessChecking_CodeFix_CS() =>\n        builderCS\n            .AddPaths(\"CollectionEmptinessChecking.cs\")\n            .WithCodeFix<CS.CollectionEmptinessCheckingCodeFix>()\n            .WithCodeFixedPaths(\"CollectionEmptinessChecking.Fixed.cs\")\n            .VerifyCodeFix();\n\n#if NET\n\n    [TestMethod]\n    public void CollectionEmptinessChecking_CS_Latest() =>\n        builderCS\n            .AddPaths(\"CollectionEmptinessChecking.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n#endif\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/CollectionPropertiesShouldBeReadOnlyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class CollectionPropertiesShouldBeReadOnlyTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<CollectionPropertiesShouldBeReadOnly>().AddReferences(MetadataReferenceFacade.SystemRuntimeSerialization);\n\n    [TestMethod]\n    public void CollectionPropertiesShouldBeReadOnly() =>\n        builder.AddPaths(\"CollectionPropertiesShouldBeReadOnly.cs\")\n            .Verify();\n\n    [TestMethod]\n    public void CollectionPropertiesShouldBeReadOnly_CS_Latest() =>\n        builder.AddPaths(\"CollectionPropertiesShouldBeReadOnly.Latest.cs\")\n            .WithTopLevelStatements()\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void CollectionPropertiesShouldBeReadOnly_Razor() =>\n        builder.AddPaths(\"CollectionPropertiesShouldBeReadOnly.razor\", \"CollectionPropertiesShouldBeReadOnly.razor.cs\")\n               .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/CollectionQuerySimplificationTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class CollectionQuerySimplificationTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<CollectionQuerySimplification>();\n\n    [TestMethod]\n    public void CollectionQuerySimplification() =>\n        builder.AddPaths(\"CollectionQuerySimplification.cs\")\n            .Verify();\n#if NETFRAMEWORK\n\n    [TestMethod]\n    public void CollectionQuerySimplification_NetFx() =>\n        builder.AddPaths(\"CollectionQuerySimplification.NetFx.cs\")\n            .AddReferences(FrameworkMetadataReference.SystemDataLinq)\n            .Verify();\n\n#endif\n\n#if NET\n\n    [TestMethod]\n    public void CollectionQuerySimplification_TopLevelStatements() =>\n        builder.AddPaths(\"CollectionQuerySimplification.TopLevelStatements.cs\")\n            .WithTopLevelStatements()\n            .Verify();\n\n    [TestMethod]\n    public void CollectionQuerySimplification_Latest() =>\n        builder.AddPaths(\"CollectionQuerySimplification.Latest.cs\")\n            .AddReferences(EntityFrameworkNetReferences())\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    private static IEnumerable<MetadataReference> EntityFrameworkNetReferences() =>\n        Enumerable.Empty<MetadataReference>()\n            .Concat(NuGetMetadataReference.MicrosoftEntityFrameworkCore(\"2.2.6\"))\n            .Concat(NuGetMetadataReference.MicrosoftEntityFrameworkCoreRelational(\"2.2.6\"))\n            .Concat(NuGetMetadataReference.EntityFramework(\"6.2.0\"))\n            .Concat(NuGetMetadataReference.SystemComponentModelTypeConverter());\n\n#endif\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/CollectionsShouldImplementGenericInterfaceTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class CollectionsShouldImplementGenericInterfaceTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<CollectionsShouldImplementGenericInterface>()\n            .AddReferences(MetadataReferenceFacade.SystemCollections)\n            .WithErrorBehavior(CompilationErrorBehavior.Ignore);    // It would be too tedious to implement all those interfaces\n\n        [TestMethod]\n        public void CollectionsShouldImplementGenericInterface() =>\n            builder.AddPaths(\"CollectionsShouldImplementGenericInterface.cs\").Verify();\n\n        [TestMethod]\n        public void CollectionsShouldImplementGenericInterface_Csharp9() =>\n            builder.AddPaths(\"CollectionsShouldImplementGenericInterface.CSharp9.cs\").WithOptions(LanguageOptions.FromCSharp9).Verify();\n\n        [TestMethod]\n        public void CollectionsShouldImplementGenericInterface_Csharp10() =>\n            builder.AddPaths(\"CollectionsShouldImplementGenericInterface.CSharp10.cs\").WithOptions(LanguageOptions.FromCSharp10).Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/CommentKeywordTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class CommentKeywordTest\n    {\n        private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.CommentKeyword>();\n        private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.CommentKeyword>();\n\n        [TestMethod]\n        [DataRow(ProjectType.Product)]\n        [DataRow(ProjectType.Test)]\n        public void CommentTodo_CS(ProjectType projectType) =>\n            builderCS.AddPaths(\"CommentTodo.cs\")\n                .AddReferences(TestCompiler.ProjectTypeReference(projectType))\n                .Verify();\n\n        [TestMethod]\n        [DataRow(ProjectType.Product)]\n        [DataRow(ProjectType.Test)]\n        public void CommentFixme_CS(ProjectType projectType) =>\n            builderCS.AddPaths(\"CommentFixme.cs\")\n                .AddReferences(TestCompiler.ProjectTypeReference(projectType))\n                .Verify();\n\n        [TestMethod]\n        [DataRow(ProjectType.Product)]\n        [DataRow(ProjectType.Test)]\n        public void CommentTodo_VB(ProjectType projectType) =>\n            builderVB.AddPaths(\"CommentTodo.vb\")\n                .AddReferences(TestCompiler.ProjectTypeReference(projectType))\n                .Verify();\n\n        [TestMethod]\n        [DataRow(ProjectType.Product)]\n        [DataRow(ProjectType.Test)]\n        public void CommentFixme_VB(ProjectType projectType) =>\n            builderVB.AddPaths(\"CommentFixme.vb\")\n                .AddReferences(TestCompiler.ProjectTypeReference(projectType))\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/CommentLineEndTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class CommentLineEndTest\n    {\n        [TestMethod]\n        public void CommentLineEnd() =>\n            new VerifierBuilder<CommentLineEnd>().AddPaths(\"CommentLineEnd.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/CommentedOutCodeTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class CommentedOutCodeTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<CommentedOutCode>();\n\n    [TestMethod]\n    public void CommentedOutCode_Nonconcurrent() =>\n        builder.AddPaths(\"CommentedOutCode_Nonconcurrent.cs\").WithConcurrentAnalysis(false).Verify();\n\n    [TestMethod]\n    public void CommentedOutCode() =>\n        builder.AddPaths(\"CommentedOutCode.cs\").Verify();\n\n    [TestMethod]\n    public void CommentedOutCode_NoDocumentation() =>\n        builder.AddPaths(\"CommentedOutCode.cs\")\n            .WithConcurrentAnalysis(false)\n            .WithOptions(ImmutableArray.Create<ParseOptions>(new CSharpParseOptions(documentationMode: DocumentationMode.None)))\n            .Verify();\n\n    [TestMethod]\n    public void CommentedOutCode_CodeFix_SingleLine() =>\n        builder.AddPaths(\"CommentedOutCode.SingleLine.ToFix.cs\")\n            .WithCodeFix<CommentedOutCodeCodeFix>()\n            .WithCodeFixedPaths(\"CommentedOutCode.SingleLine.Fixed.cs\")\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void CommentedOutCode_CodeFix_MultiLine() =>\n       builder.AddPaths(\"CommentedOutCode.MultiLine.ToFix.cs\")\n           .WithCodeFix<CommentedOutCodeCodeFix>()\n           .WithCodeFixedPaths(\"CommentedOutCode.MultiLine.Fixed.cs\")\n           .VerifyCodeFix();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/CommentsShouldNotBeEmptyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class CommentsShouldNotBeEmptyTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.CommentsShouldNotBeEmpty>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.CommentsShouldNotBeEmpty>();\n\n    [TestMethod]\n    public void CommentsShouldNotBeEmpty_CS() =>\n        builderCS.AddPaths(\"CommentsShouldNotBeEmpty.cs\").Verify();\n\n    [TestMethod]\n    public void CommentsShouldNotBeEmpty_CS1() =>\n        builderCS\n            .AddTestReference()\n            .AddPaths(\"CommentsShouldNotBeEmpty.cs\").VerifyNoIssues();\n\n    [TestMethod]\n    public void CommentsShouldNotBeEmpty_VB() =>\n        builderVB.AddPaths(\"CommentsShouldNotBeEmpty.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ComparableInterfaceImplementationTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ComparableInterfaceImplementationTest\n{\n    [TestMethod]\n    public void IComparableImplementation() =>\n        new VerifierBuilder<ComparableInterfaceImplementation>().AddPaths(\"ComparableInterfaceImplementation.cs\").Verify();\n\n    [TestMethod]\n    public void IComparableImplementation_Latest() =>\n        new VerifierBuilder<ComparableInterfaceImplementation>().AddPaths(\"ComparableInterfaceImplementation.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/CompareNaNTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class CompareNaNTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<CompareNaN>();\n\n        [TestMethod]\n        public void CompareNaN() =>\n            builder.AddPaths(\"CompareNaN.cs\").Verify();\n\n        [TestMethod]\n        public void CompareNaN_CS_Latest() =>\n            builder.AddPaths(\"CompareNaN.Latest.cs\")\n                .WithOptions(LanguageOptions.CSharpLatest)\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ConditionalSimplificationTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ConditionalSimplificationTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<ConditionalSimplification>();\n    private readonly VerifierBuilder codeFix = new VerifierBuilder<ConditionalSimplification>().WithCodeFix<ConditionalSimplificationCodeFix>();\n\n    [TestMethod]\n    public void ConditionalSimplification_BeforeCSharp8() =>\n        builder.AddPaths(\"ConditionalSimplification.BeforeCSharp8.cs\").WithOptions(LanguageOptions.BeforeCSharp8).Verify();\n\n    [TestMethod]\n    public void ConditionalSimplification_CSharp8() =>\n        builder.AddPaths(\"ConditionalSimplification.CSharp8.cs\").WithLanguageVersion(LanguageVersion.CSharp8).Verify();\n\n    [TestMethod]\n    public void ConditionalSimplification_CSharp8_CodeFix() =>\n        codeFix.AddPaths(\"ConditionalSimplification.CSharp8.cs\").WithLanguageVersion(LanguageVersion.CSharp8).WithCodeFixedPaths(\"ConditionalSimplification.CSharp8.Fixed.cs\").VerifyCodeFix();\n\n    [TestMethod]\n    public void ConditionalSimplification_FromCSharp8() =>\n        builder.AddPaths(\"ConditionalSimplification.FromCSharp8.cs\").WithOptions(LanguageOptions.FromCSharp8).Verify();\n\n    [TestMethod]\n    public void ConditionalSimplification_BeforeCSharp8_CodeFix() =>\n        codeFix.AddPaths(\"ConditionalSimplification.BeforeCSharp8.cs\")\n            .WithCodeFixedPaths(\"ConditionalSimplification.BeforeCSharp8.Fixed.cs\")\n            .WithOptions(LanguageOptions.BeforeCSharp8).VerifyCodeFix();\n\n    [TestMethod]\n    public void ConditionalSimplification_FromCSharp8_CodeFix() =>\n        codeFix.AddPaths(\"ConditionalSimplification.FromCSharp8.cs\")\n            .WithCodeFixedPaths(\"ConditionalSimplification.FromCSharp8.Fixed.cs\")\n            .WithOptions(LanguageOptions.FromCSharp8)\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void ConditionalSimplification_FromCSharp9() =>\n        builder.AddPaths(\"ConditionalSimplification.FromCSharp9.cs\").WithTopLevelStatements().Verify();\n\n    [TestMethod]\n    public void ConditionalSimplification_FromCSharp10() =>\n        builder.AddPaths(\"ConditionalSimplification.FromCSharp10.cs\")\n            .WithTopLevelStatements()\n            .WithOptions(LanguageOptions.FromCSharp10)\n            .AddReferences(NuGetMetadataReference.FluentAssertions(NugetPackageVersions.FluentAssertionsVersions.Ver7))\n            .AddReferences(MetadataReferenceFacade.SystemData)\n            .AddReferences(MetadataReferenceFacade.SystemNetHttp)\n            .AddReferences(MetadataReferenceFacade.SystemXml)\n            .AddReferences(MetadataReferenceFacade.SystemXmlLinq)\n            .Verify();\n\n    [TestMethod]\n    public void ConditionalSimplification_FromCSharp9_CodeFix() =>\n        codeFix.AddPaths(\"ConditionalSimplification.FromCSharp9.cs\")\n            .WithCodeFixedPaths(\"ConditionalSimplification.FromCSharp9.Fixed.cs\")\n            .WithTopLevelStatements()\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void ConditionalSimplification_FromCSharp10_CodeFix() =>\n        codeFix.AddPaths(\"ConditionalSimplification.FromCSharp10.cs\")\n            .WithCodeFixedPaths(\"ConditionalSimplification.FromCSharp10.Fixed.cs\")\n            .WithTopLevelStatements()\n            .WithOptions(LanguageOptions.FromCSharp10)\n            .AddReferences(NuGetMetadataReference.FluentAssertions(NugetPackageVersions.FluentAssertionsVersions.Ver7))\n            .AddReferences(MetadataReferenceFacade.SystemData)\n            .AddReferences(MetadataReferenceFacade.SystemNetHttp)\n            .AddReferences(MetadataReferenceFacade.SystemXml)\n            .AddReferences(MetadataReferenceFacade.SystemXmlLinq)\n            .VerifyCodeFix();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ConditionalStructureSameConditionTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class ConditionalStructureSameConditionTest\n    {\n        private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.ConditionalStructureSameCondition>();\n\n        public TestContext TestContext { get; set; }\n\n        [TestMethod]\n        public void ConditionalStructureSameCondition_CS() =>\n            builderCS.AddPaths(\"ConditionalStructureSameCondition.cs\").Verify();\n\n        [TestMethod]\n        public void ConditionalStructureSameCondition_CS_CSharp9() =>\n            builderCS.AddPaths(\"ConditionalStructureSameCondition.CSharp9.cs\")\n                .WithTopLevelStatements()\n                .Verify();\n\n        [TestMethod]\n        public void ConditionalStructureSameCondition_CS_CSharp10() =>\n            builderCS.AddPaths(\"ConditionalStructureSameCondition.CSharp10.cs\")\n                .WithOptions(LanguageOptions.FromCSharp10)\n                .Verify();\n\n        [TestMethod]\n        public void ConditionalStructureSameCondition_RazorFile_CorrectMessage() =>\n            builderCS.AddSnippet(\n                \"\"\"\n                @code\n                {\n                    public bool condition { get; set; }\n\n                    public void Method()\n                    {\n                        var b = true;\n                        if (b && condition)\n                        //  ^^^^^^^^^^^^^^ Secondary\n                        {\n                        }\n                        else if (b && condition) // Noncompliant {{This branch duplicates the one on line 8.}}\n                        //       ^^^^^^^^^^^^^^\n                        {\n                        }\n                    }\n                }\n                \"\"\",\n                \"SomeRazorFile.razor\")\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Product))\n            .Verify();\n\n        [TestMethod]\n        public void ConditionalStructureSameCondition_VisualBasic() =>\n            new VerifierBuilder<VB.ConditionalStructureSameCondition>().AddPaths(\"ConditionalStructureSameCondition.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ConditionalStructureSameImplementationTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ConditionalStructureSameImplementationTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.ConditionalStructureSameImplementation>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.ConditionalStructureSameImplementation>();\n\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    public void ConditionalStructureSameImplementation_If_CSharp() =>\n        builderCS.AddPaths(\"ConditionalStructureSameImplementation_If.cs\").Verify();\n\n    [TestMethod]\n    public void ConditionalStructureSameImplementation_Switch_CSharp() =>\n        builderCS.AddPaths(\"ConditionalStructureSameImplementation_Switch.cs\").Verify();\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/9637\n    [TestMethod]\n    [DataRow(\"nameof(first)\", \"nameof(first)\", false)]\n    [DataRow(\"nameof ( first ) \", \"nameof(first)\", false)]\n    [DataRow(\"nameof(first)\", \"nameof(second)\", true)]\n    [DataRow(\"first.ToLower()\", \"nameof(second)\", true)]\n    [DataRow(\"nameof(first)\", \"first.ToLower()\", true)]\n    public void ConditionalStructureSameImplementation_NameOf_CSharp(string firstExpression, string secondExpression, bool isCompliant)\n    {\n        var compliantComment = isCompliant ? string.Empty : \"// Noncompliant\";\n        var secondaryComment = isCompliant ? string.Empty : \"// Secondary\";\n        var builder = builderCS.AddSnippet($$\"\"\"\n            public class NameOfExpressions\n            {\n                public string Method(string first, string second)\n                {\n                    if (first.Length == 42)\n                    {                                   {{secondaryComment}}\n                        var ret = {{firstExpression}};\n                        return ret;\n                    }\n                    else if (second.Length == 42)\n                    {                                   {{compliantComment}}\n                        var ret = {{secondExpression}};\n                        return ret;\n                    }\n                    return \"\";\n                }\n            }\n            \"\"\");\n        if (isCompliant)\n        {\n            builder.VerifyNoIssues();\n        }\n        else\n        {\n            builder.Verify();\n        }\n    }\n\n    [TestMethod]\n    [DataRow(\"NameOf(first)\", \"NameOf(first)\", false)]\n    [DataRow(\"NameOf ( first ) \", \"NameOf(first)\", false)]\n    [DataRow(\"NameOf(first)\", \"NameOf(second)\", true)]\n    [DataRow(\"first.ToLower()\", \"NameOf(second)\", true)]\n    [DataRow(\"NameOf(first)\", \"first.ToLower()\", true)]\n    public void ConditionalStructureSameImplementation_SymbolCannotBeResolved_VB(string firstExpression, string secondExpression, bool isCompliant)\n    {\n        var compliantComment = isCompliant ? \"' Compliant\" : \"' Noncompliant\";\n        var builder = builderVB.AddSnippet($\"\"\"\n            Public Class NameOfExpressions\n                Public Function Method(first as String, second as String)\n                    If first.Length = 42 Then\n                        Dim ret = {firstExpression}\n                        Return ret\n                    ElseIf second.Length = 42 Then\n                        Dim ret = {secondExpression}  {compliantComment}\n                        Return ret\n                    End If\n                    Return \"\"\n                End Function\n            End Class\n            \"\"\");\n        if (isCompliant)\n        {\n            builder.VerifyNoIssues();\n        }\n        else\n        {\n            builder.Verify();\n        }\n    }\n\n    [TestMethod]\n    public void ConditionalStructureSameImplementation_If_VisualBasic() =>\n        builderVB.AddPaths(\"ConditionalStructureSameImplementation_If.vb\").Verify();\n\n    [TestMethod]\n    public void ConditionalStructureSameImplementation_Switch_VisualBasic() =>\n        builderVB.AddPaths(\"ConditionalStructureSameImplementation_Switch.vb\").Verify();\n\n    [TestMethod]\n    public void ConditionalStructureSameImplementation_If_CSharp_Latest() =>\n        builderCS.AddPaths(\"ConditionalStructureSameImplementation_If.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void ConditionalStructureSameImplementation_Switch_CSharp_Latest() =>\n        builderCS.AddPaths(\"ConditionalStructureSameImplementation_Switch.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void ConditionalStructureSameImplementation_RazorFile_CorrectMessage() =>\n        builderCS.AddSnippet(\n            \"\"\"\n            @code\n            {\n                public bool someCondition1 { get; set; }\n                public void DoSomething1() { }\n\n                public void Method()\n                {\n                    if (someCondition1)\n                    { // Secondary\n                        DoSomething1();\n                        DoSomething1();\n                    }\n                    else\n                    { // Noncompliant {{Either merge this branch with the identical one on line 9 or change one of the implementations.}}\n                        DoSomething1();\n                        DoSomething1();\n                    }\n                }\n            }\n            \"\"\",\n            \"SomeRazorFile.razor\")\n        .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Product))\n        .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ConditionalsShouldStartOnNewLineTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ConditionalsShouldStartOnNewLineTest\n{\n    [TestMethod]\n    public void ConditionalsShouldStartOnNewLine() =>\n        new VerifierBuilder<ConditionalsShouldStartOnNewLine>().AddPaths(\"ConditionalsShouldStartOnNewLine.cs\").Verify();\n#if NET\n\n    [TestMethod]\n    public void ConditionalsShouldStartOnNewLine_CS_Latest() =>\n        new VerifierBuilder<ConditionalsShouldStartOnNewLine>().AddPaths(\"ConditionalsShouldStartOnNewLine.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).VerifyNoIssues();\n\n#endif\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ConditionalsWithSameConditionTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class ConditionalsWithSameConditionTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<ConditionalsWithSameCondition>();\n\n        public TestContext TestContext { get; set; }\n\n        [TestMethod]\n        public void ConditionalsWithSameCondition() =>\n            builder.AddPaths(\"ConditionalsWithSameCondition.cs\").Verify();\n\n        [TestMethod]\n        public void ConditionalsWithSameCondition_CSharp9() =>\n            builder.AddPaths(\"ConditionalsWithSameCondition.CSharp9.cs\")\n                .WithOptions(LanguageOptions.FromCSharp9)\n                .Verify();\n\n        [TestMethod]\n        public void ConditionalsWithSameCondition_CSharp9_TopLevelStatements() =>\n            builder.AddPaths(\"ConditionalsWithSameCondition.CSharp9.TopLevelStatements.cs\")\n                .WithTopLevelStatements()\n                .Verify();\n\n        [TestMethod]\n        public void ConditionalsWithSameCondition_CSharp10() =>\n            builder.AddPaths(\"ConditionalsWithSameCondition.CSharp10.cs\")\n                .WithOptions(LanguageOptions.FromCSharp10)\n                .Verify();\n\n        [TestMethod]\n        public void ConditionalsWithSameCondition_RazorFile_CorrectMessage() =>\n            builder.AddSnippet(\n                \"\"\"\n                @code\n                {\n                    public void doTheThing(object o) { }\n\n                    public void Method(int a, int b)\n                    {\n                        if (a == b)\n                        {\n                            doTheThing(b);\n                        }\n                        if (a == b) // Noncompliant {{This condition was just checked on line 7.}}\n                        //  ^^^^^^\n                        {\n                            doTheThing(b);\n                        }\n                    }\n                }\n                \"\"\",\n                \"SomeRazorFile.razor\")\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Product))\n            .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ConstructorArgumentValueShouldExistTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ConstructorArgumentValueShouldExistTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.ConstructorArgumentValueShouldExist>();\n\n    [TestMethod]\n    public void ConstructorArgumentValueShouldExist_CS_Latest_Net() =>\n        builderCS.AddPaths(\"ConstructorArgumentValueShouldExist.Latest.cs\", \"ConstructorArgumentValueShouldExist.Latest.Partial.cs\")\n            .WithConcurrentAnalysis(false)\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .WithNetOnly()\n            .Verify();\n\n    [TestMethod]\n    public void ConstructorArgumentValueShouldExist_CS_NetFx() =>\n        builderCS.AddPaths(\"ConstructorArgumentValueShouldExist.cs\")\n            .AddReferences(MetadataReferenceFacade.SystemXaml)\n            .WithNetFrameworkOnly()\n            .Verify();\n\n    [TestMethod]\n    public void ConstructorArgumentValueShouldExist_VB_NetFx() =>\n        new VerifierBuilder<VB.ConstructorArgumentValueShouldExist>().AddPaths(\"ConstructorArgumentValueShouldExist.vb\")\n            .AddReferences(MetadataReferenceFacade.SystemXaml)\n            .WithNetFrameworkOnly()\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ConstructorOverridableCallTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ConstructorOverridableCallTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<ConstructorOverridableCall>();\n\n    [TestMethod]\n    public void ConstructorOverridableCall() =>\n        builder.AddPaths(\"ConstructorOverridableCall.cs\").Verify();\n\n    [TestMethod]\n    public void ConstructorOverridableCall_Latest() =>\n        builder.AddPaths(\"ConstructorOverridableCall.Latest.cs\", \"ConstructorOverridableCall.Latest.Partial.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void ConstructorOverridableCall_Nancy() =>\n        builder.AddPaths(\"ConstructorOverridableCall.Nancy.cs\").WithConcurrentAnalysis(false).VerifyNoIssues();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ConsumeValueTaskCorrectlyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ConsumeValueTaskCorrectlyTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<ConsumeValueTaskCorrectly>()\n        .AddReferences(MetadataReferenceFacade.SystemThreadingTasks)\n        .AddReferences(MetadataReferenceFacade.SystemMemory);\n\n    [TestMethod]\n    public void ConsumeValueTaskCorrectly() =>\n        builder.AddPaths(\"ConsumeValueTaskCorrectly.cs\").Verify();\n\n    [TestMethod]\n    public void ConsumeValueTaskCorrectly_CSharp_Latest() =>\n        builder.AddPaths(\"ConsumeValueTaskCorrectly.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ControlCharacterInStringTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ControlCharacterInStringTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<ControlCharacterInString>();\n\n    [TestMethod]\n    public void ControlCharacterInString_CSharp8() =>\n        builder.AddPaths(\"ControlCharacterInString.cs\").Verify();\n\n    [TestMethod]\n    public void ControlCharacterInString_Latest() =>\n        builder.AddPaths(\"ControlCharacterInString.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/CryptographicKeyShouldNotBeTooShortTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class CryptographicKeyShouldNotBeTooShortTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<CryptographicKeyShouldNotBeTooShort>().AddReferences(AdditionalReferences());\n\n    [TestMethod]\n    public void CryptographicKeyShouldNotBeTooShort() =>\n        builder.AddPaths(\"CryptographicKeyShouldNotBeTooShort.cs\").Verify();\n\n#if NETFRAMEWORK\n\n    [TestMethod]\n    public void CryptographicKeyShouldNotBeTooShort_NetFramework() =>\n        builder.AddPaths(\"CryptographicKeyShouldNotBeTooShort.BeforeNet7.cs\").Verify();\n\n#else\n\n    [TestMethod]\n    public void CryptographicKeyShouldNotBeTooShort_CS_Latest() =>\n        builder.AddPaths(\"CryptographicKeyShouldNotBeTooShort.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .WithTopLevelStatements()\n            .Verify();\n\n#endif\n\n    private static IEnumerable<MetadataReference> AdditionalReferences() =>\n        MetadataReferenceFacade.SystemSecurityCryptography\n\n#if NETFRAMEWORK\n\n            .Concat(NuGetMetadataReference.SystemSecurityCryptographyOpenSsl())\n\n#endif\n\n            .Concat(NuGetMetadataReference.BouncyCastle());\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DangerousGetHandleShouldNotBeCalledTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class DangerousGetHandleShouldNotBeCalledTest\n    {\n        private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.DangerousGetHandleShouldNotBeCalled>();\n        private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.DangerousGetHandleShouldNotBeCalled>();\n\n        [TestMethod]\n        public void DangerousGetHandleShouldNotBeCalled_CS() =>\n            builderCS.AddPaths(\"DangerousGetHandleShouldNotBeCalled.cs\")\n                .AddReferences(MetadataReferenceFacade.MicrosoftWin32Registry)\n                .Verify();\n\n        [TestMethod]\n        public void DangerousGetHandleShouldNotBeCalled_CS_CSharp9() =>\n            builderCS.AddPaths(\"DangerousGetHandleShouldNotBeCalled.CSharp9.cs\")\n                .AddReferences(MetadataReferenceFacade.MicrosoftWin32Registry)\n                .WithOptions(LanguageOptions.FromCSharp9)\n                .WithTopLevelStatements()\n                .Verify();\n\n        [TestMethod]\n        public void DangerousGetHandleShouldNotBeCalled_VB() =>\n            builderVB.AddPaths(\"DangerousGetHandleShouldNotBeCalled.vb\")\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DatabasePasswordsShouldBeSecureTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\n#if NET\n\nusing System.IO;\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class DatabasePasswordsShouldBeSecureTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<DatabasePasswordsShouldBeSecure>();\n\n        public TestContext TestContext { get; set; }\n\n        [TestMethod]\n        [DataRow(\"3.1.11\", \"3.19.80\")]\n        [DataRow(\"5.0.2\", \"5.21.1\")]\n        public void DatabasePasswordsShouldBeSecure_CS(string entityFrameworkCoreVersion, string oracleVersion) =>\n            builder.AddPaths(\"DatabasePasswordsShouldBeSecure.cs\")\n                .WithOptions(LanguageOptions.FromCSharp8)\n                .AddReferences(GetReferences(entityFrameworkCoreVersion, oracleVersion))\n                .Verify();\n\n        [TestMethod]\n        [DataRow(\"3.1.11\", \"3.19.80\")]\n        [DataRow(\"5.0.2\", \"5.21.1\")]\n        public void DatabasePasswordsShouldBeSecure_CS_Latest(string entityFrameworkCoreVersion, string oracleVersion) =>\n            builder.AddPaths(\"DatabasePasswordsShouldBeSecure.Latest.cs\")\n                .WithOptions(LanguageOptions.CSharpLatest)\n                .AddReferences(GetReferences(entityFrameworkCoreVersion, oracleVersion))\n                .Verify();\n\n        [TestMethod]\n        public void DatabasePasswordsShouldBeSecure_Net5_CS() =>\n            builder.AddPaths(\"DatabasePasswordsShouldBeSecure.Net5.cs\")\n                .WithOptions(LanguageOptions.FromCSharp8)\n                .AddReferences(GetReferences(\"5.0.2\", \"5.21.1\"))\n                .Verify();\n\n        [TestMethod]\n        public void DatabasePasswordsShouldBeSecure_NetCore3_CS() =>\n            builder.AddPaths(\"DatabasePasswordsShouldBeSecure.NetCore31.cs\")\n                .WithOptions(LanguageOptions.FromCSharp8)\n                .AddReferences(GetReferences(\"3.1.11\", \"3.19.80\"))\n                .Verify();\n\n        [TestMethod]\n        [DataRow(true, @\"TestCases\\WebConfig\\DatabasePasswordsShouldBeSecure\\Values\")]\n        [DataRow(false, @\"TestCases\\WebConfig\\DatabasePasswordsShouldBeSecure\\UnexpectedContent\")]\n        public void DatabasePasswordsShouldBeSecure_CS_WebConfig(bool expectIssues, string root)\n        {\n            var webConfigPath = GetWebConfigPath(root);\n            VerifyAdditionalFiles(expectIssues, webConfigPath);\n        }\n\n        [TestMethod]\n        public void DatabasePasswordsShouldBeSecure_CS_ExternalConnection()\n        {\n            var root = @\"TestCases\\WebConfig\\DatabasePasswordsShouldBeSecure\\ExternalConfig\";\n            var webConfigPath = GetWebConfigPath(root);\n            var externalConfigPath = Path.Combine(root, \"external.config\");\n            VerifyAdditionalFiles(false, webConfigPath, externalConfigPath);\n        }\n\n        [TestMethod]\n        public void DatabasePasswordsShouldBeSecure_CS_CorruptAndNonExistingWebConfigs_ShouldNotFail()\n        {\n            var root = @\"TestCases\\WebConfig\\DatabasePasswordsShouldBeSecure\\Corrupt\";\n            var missingDirectory = @\"TestCases\\WebConfig\\DatabasePasswordsShouldBeSecure\\NonExistingDirectory\";\n            var corruptFilePath = GetWebConfigPath(root);\n            var nonExistentFilePath = GetWebConfigPath(missingDirectory);\n            VerifyAdditionalFiles(false, corruptFilePath, nonExistentFilePath);\n        }\n\n        [TestMethod]\n        [DataRow(true, @\"TestCases\\AppSettings\\DatabasePasswordsShouldBeSecure\\Values\")]\n        [DataRow(false, @\"TestCases\\AppSettings\\DatabasePasswordsShouldBeSecure\\UnexpectedContent\\ArrayInside\")]\n        [DataRow(false, @\"TestCases\\AppSettings\\DatabasePasswordsShouldBeSecure\\UnexpectedContent\\EmptyArray\")]\n        [DataRow(false, @\"TestCases\\AppSettings\\DatabasePasswordsShouldBeSecure\\UnexpectedContent\\EmptyFile\")]\n        [DataRow(false, @\"TestCases\\AppSettings\\DatabasePasswordsShouldBeSecure\\UnexpectedContent\\WrongStructure\")]\n        [DataRow(false, @\"TestCases\\AppSettings\\DatabasePasswordsShouldBeSecure\\UnexpectedContent\\ConnectionStringComment\")]\n        [DataRow(false, @\"TestCases\\AppSettings\\DatabasePasswordsShouldBeSecure\\UnexpectedContent\\ValueKind\")]\n        [DataRow(false, @\"TestCases\\AppSettings\\DatabasePasswordsShouldBeSecure\\UnexpectedContent\\PropertyKinds\")]\n        [DataRow(false, @\"TestCases\\AppSettings\\DatabasePasswordsShouldBeSecure\\UnexpectedContent\\Null\")]\n        public void DatabasePasswordsShouldBeSecure_CS_AppSettings(bool expectIssues, string root)\n        {\n            var appSettingsPath = GetAppSettingsPath(root);\n            VerifyAdditionalFiles(expectIssues, appSettingsPath);\n        }\n\n        [TestMethod]\n        public void DatabasePasswordsShouldBeSecure_CS_CorruptAndNonExistingAppSettings_ShouldNotFail()\n        {\n            var root = @\"TestCases\\AppSettings\\DatabasePasswordsShouldBeSecure\\Corrupt\";\n            var missingDirectory = @\"TestCases\\AppSettings\\DatabasePasswordsShouldBeSecure\\NonExistingDirectory\";\n            var corruptFilePath = GetAppSettingsPath(root);\n            var nonExistentFilePath = GetAppSettingsPath(missingDirectory);\n            VerifyAdditionalFiles(false, corruptFilePath, nonExistentFilePath);\n        }\n\n        private static string GetWebConfigPath(string rootFolder) => Path.Combine(rootFolder, \"Web.config\");\n\n        private static string GetAppSettingsPath(string rootFolder) => Path.Combine(rootFolder, \"appsettings.json\");\n\n        private void VerifyAdditionalFiles(bool expectIssues, string additionalSourceFile, params string[] additionalFilesToAnalyze)\n        {\n            var withAdditionalSourceFiles = builder\n                .AddSnippet(\"// Nothing to see here\")\n                .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfigWithFilesToAnalyze(TestContext, additionalFilesToAnalyze.Append(additionalSourceFile).ToArray()))\n                .AddAdditionalSourceFiles(additionalSourceFile);\n            if (expectIssues)\n            {\n                withAdditionalSourceFiles.Verify();\n            }\n            else\n            {\n                withAdditionalSourceFiles.VerifyNoIssues();\n            }\n        }\n\n        private static IEnumerable<MetadataReference> GetReferences(string entityFrameworkCoreVersion, string oracleVersion) =>\n            Enumerable.Empty<MetadataReference>()\n                      .Concat(MetadataReferenceFacade.SystemData)\n                      .Concat(MetadataReferenceFacade.SystemComponentModelPrimitives)\n                      .Concat(NuGetMetadataReference.MicrosoftEntityFrameworkCore(entityFrameworkCoreVersion))\n                      .Concat(NuGetMetadataReference.MicrosoftEntityFrameworkCoreSqliteCore(entityFrameworkCoreVersion))\n                      .Concat(NuGetMetadataReference.MicrosoftEntityFrameworkCoreSqlServer(entityFrameworkCoreVersion))\n                      .Concat(NuGetMetadataReference.OracleEntityFrameworkCore(oracleVersion))\n                      .Concat(NuGetMetadataReference.MySqlDataEntityFrameworkCore())\n                      .Concat(NuGetMetadataReference.NpgsqlEntityFrameworkCorePostgreSQL(entityFrameworkCoreVersion));\n    }\n}\n\n#endif\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DateAndTimeShouldNotBeUsedasTypeForPrimaryKeyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class DateAndTimeShouldNotBeUsedAsTypeForPrimaryKeyTest\n{\n    private readonly VerifierBuilder verifierCS = CreateVerifier<CS.DateAndTimeShouldNotBeUsedAsTypeForPrimaryKey>();\n    private readonly VerifierBuilder verifierVB = CreateVerifier<VB.DateAndTimeShouldNotBeUsedAsTypeForPrimaryKey>();\n\n    [TestMethod]\n    public void DateAndTimeShouldNotBeUsedAsTypeForPrimaryKey_CS() =>\n        verifierCS.AddPaths(\"DateAndTimeShouldNotBeUsedAsTypeForPrimaryKey.cs\").Verify();\n\n    [TestMethod]\n    public void DateAndTimeShouldNotBeUsedAsTypeForPrimaryKey_VB() =>\n        verifierVB.AddPaths(\"DateAndTimeShouldNotBeUsedAsTypeForPrimaryKey.vb\").Verify();\n\n    [TestMethod]\n    public void DateAndTimeShouldNotBeUsedAsTypeForPrimaryKey_NoReferenceToEntityFramework_CS() =>\n        new VerifierBuilder<CS.DateAndTimeShouldNotBeUsedAsTypeForPrimaryKey>()\n            .AddPaths(\"DateAndTimeShouldNotBeUsedAsTypeForPrimaryKey.NoReferenceToEntityFramework.cs\")\n            .VerifyNoIssues();\n\n    [TestMethod]\n    public void DateAndTimeShouldNotBeUsedAsTypeForPrimaryKey_NoReferenceToEntityFramework_VB() =>\n        new VerifierBuilder<VB.DateAndTimeShouldNotBeUsedAsTypeForPrimaryKey>()\n            .AddPaths(\"DateAndTimeShouldNotBeUsedAsTypeForPrimaryKey.NoReferenceToEntityFramework.vb\")\n            .VerifyNoIssues();\n\n    [TestMethod]\n    public void DateAndTimeShouldNotBeUsedAsTypeForPrimaryKey_Latest() =>\n        verifierCS\n            .AddPaths(\"DateAndTimeShouldNotBeUsedAsTypeForPrimaryKey.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n#if NET\n\n    [TestMethod]\n    public void DateAndTimeShouldNotBeUsedAsTypeForPrimaryKey_EntityFrameworkCore_CS() =>\n        verifierCS.AddPaths(\"DateAndTimeShouldNotBeUsedAsTypeForPrimaryKey.EntityFrameworkCore.cs\").Verify();\n\n    [TestMethod]\n    public void DateAndTimeShouldNotBeUsedAsTypeForPrimaryKey_EntityFrameworkCore_VB() =>\n        verifierVB.AddPaths(\"DateAndTimeShouldNotBeUsedAsTypeForPrimaryKey.EntityFrameworkCore.vb\").WithOptions(LanguageOptions.FromVisualBasic14).Verify();\n\n    [TestMethod]\n    public void DateAndTimeShouldNotBeUsedAsTypeForPrimaryKey_FluentApi_CS() =>\n        verifierCS.AddPaths(\"DateAndTimeShouldNotBeUsedAsTypeForPrimaryKey.FluentApi.cs\").VerifyNoIssues();\n\n    [TestMethod]\n    public void DateAndTimeShouldNotBeUsedAsTypeForPrimaryKey_FluentApi_VB() =>\n        verifierVB.AddPaths(\"DateAndTimeShouldNotBeUsedAsTypeForPrimaryKey.FluentApi.vb\").VerifyNoIssues();\n\n#endif\n\n    private static VerifierBuilder CreateVerifier<TAnalyzer>()\n        where TAnalyzer : DiagnosticAnalyzer, new() =>\n        new VerifierBuilder<TAnalyzer>()\n            .AddReferences(NuGetMetadataReference.SystemComponentModelAnnotations())\n\n#if NET\n\n            .AddReferences(NuGetMetadataReference.MicrosoftEntityFrameworkCore(\"7.0.0\"))\n            .AddReferences(NuGetMetadataReference.MicrosoftEntityFrameworkCoreAbstractions(\"7.0.0\"));\n\n#else\n\n            .AddReferences(NuGetMetadataReference.MicrosoftEntityFramework(\"6.0.0\"));\n\n#endif\n\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DateTimeFormatShouldNotBeHardcodedTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class DateTimeFormatShouldNotBeHardcodedTest\n{\n    private readonly VerifierBuilder<CS.DateTimeFormatShouldNotBeHardcoded> builderCS = new();\n    private readonly VerifierBuilder<VB.DateTimeFormatShouldNotBeHardcoded> builderVB = new();\n\n    [TestMethod]\n    public void DateTimeFormatShouldNotBeHardcoded_CS() =>\n        builderCS.AddPaths(\"DateTimeFormatShouldNotBeHardcoded.cs\").Verify();\n\n    [TestMethod]\n    public void DateTimeFormatShouldNotBeHardcoded_VB() =>\n        builderVB.AddPaths(\"DateTimeFormatShouldNotBeHardcoded.vb\").WithOptions(LanguageOptions.FromVisualBasic14).Verify();\n\n#if NET\n\n    [TestMethod]\n    public void DateTimeFormatShouldNotBeHardcoded_CS_Latest() =>\n        builderCS\n            .AddPaths(\"DateTimeFormatShouldNotBeHardcoded.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void DateTimeFormatShouldNotBeHardcoded_NET_VB() =>\n        builderVB.AddPaths(\"DateTimeFormatShouldNotBeHardcoded.Net.vb\").Verify();\n\n#endif\n\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DeadStoresTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class DeadStoresTest\n{\n    private readonly VerifierBuilder sonarCfg = new VerifierBuilder()\n        .AddAnalyzer(() => new DeadStores(AnalyzerConfiguration.AlwaysEnabledWithSonarCfg))\n        .WithOptions(LanguageOptions.FromCSharp8)\n        .AddReferences(MetadataReferenceFacade.NetStandard21);\n\n    private readonly VerifierBuilder roslynCfg = new VerifierBuilder<DeadStores>()\n        .AddReferences(MetadataReferenceFacade.NetStandard21);\n\n    [TestMethod]\n    public void DeadStores_SonarCfg() =>\n        sonarCfg.AddPaths(\"DeadStores.SonarCfg.cs\").Verify();\n\n    [TestMethod]\n    public void DeadStores_RoslynCfg() =>\n        roslynCfg.AddPaths(\"DeadStores.RoslynCfg.cs\")\n            .WithOptions(LanguageOptions.FromCSharp8)\n            .Verify();\n\n    [TestMethod]\n    public void DeadStores_CS_Latest() =>\n        roslynCfg.AddPaths(\"DeadStores.Latest.cs\")\n            .WithTopLevelStatements()\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DebugAssertHasNoSideEffectsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class DebugAssertHasNoSideEffectsTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<DebugAssertHasNoSideEffects>();\n\n    [TestMethod]\n    public void DebugAssertHasNoSideEffects() =>\n        builder.AddPaths(\"DebugAssertHasNoSideEffects.cs\").Verify();\n\n    [TestMethod]\n    public void DebugAssertHasNoSideEffects_Latest() =>\n        builder.AddPaths(\"DebugAssertHasNoSideEffects.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .WithTopLevelStatements()\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DebuggerDisplayUsesExistingMembersTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class DebuggerDisplayUsesExistingMembersTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.DebuggerDisplayUsesExistingMembers>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.DebuggerDisplayUsesExistingMembers>();\n\n    [TestMethod]\n    public void DebuggerDisplayUsesExistingMembers_CS() =>\n        builderCS.AddPaths(\"DebuggerDisplayUsesExistingMembers.cs\").Verify();\n\n    [TestMethod]\n    public void DebuggerDisplayUsesExistingMembers_CSharp_Latest() =>\n        builderCS.AddPaths(\"DebuggerDisplayUsesExistingMembers.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void DebuggerDisplayUsesExistingMembers_VB() =>\n        builderVB.AddPaths(\"DebuggerDisplayUsesExistingMembers.vb\").WithOptions(LanguageOptions.FromVisualBasic14).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DeclareEventHandlersCorrectlyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class DeclareEventHandlersCorrectlyTest\n    {\n        [TestMethod]\n        public void DeclareEventHandlersCorrectly() =>\n            new VerifierBuilder<DeclareEventHandlersCorrectly>().AddPaths(\"DeclareEventHandlersCorrectly.cs\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DeclareTypesInNamespacesTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class DeclareTypesInNamespacesTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<CS.DeclareTypesInNamespaces>().WithAutogenerateConcurrentFiles(false);\n\n    [TestMethod]\n    public void DeclareTypesInNamespaces_CS() =>\n        builder.AddPaths(\"DeclareTypesInNamespaces.cs\", \"DeclareTypesInNamespaces2.cs\").Verify();\n\n    [TestMethod]\n    public void DeclareTypesInNamespaces_CS_Latest() =>\n        builder\n            .AddPaths(\"DeclareTypesInNamespaces.Latest.cs\", \"DeclareTypesInNamespaces.FileScopedNamespace.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void DeclareTypesInNamespaces_CS_TopLevelStatements() =>\n        builder\n            .AddPaths(\"DeclareTypesInNamespaces.TopLevelStatements.cs\", \"DeclareTypesInNamespaces.TopLevelStatements.Partial.cs\")\n            .WithTopLevelStatements()\n            .Verify();\n\n    [TestMethod]\n    public void DeclareTypesInNamespaces_VB() =>\n        new VerifierBuilder<VB.DeclareTypesInNamespaces>()\n            .AddPaths(\"DeclareTypesInNamespaces.vb\", \"DeclareTypesInNamespaces2.vb\")\n            .WithAutogenerateConcurrentFiles(false)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DefaultSectionShouldBeFirstOrLastTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class DefaultSectionShouldBeFirstOrLastTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<DefaultSectionShouldBeFirstOrLast>();\n\n        [TestMethod]\n        public void DefaultSectionShouldBeFirstOrLast() =>\n            builder.AddPaths(\"DefaultSectionShouldBeFirstOrLast.cs\").Verify();\n\n        [TestMethod]\n        public void DefaultSectionShouldBeFirstOrLast_CSharp9() =>\n            builder.AddPaths(\"DefaultSectionShouldBeFirstOrLast.CSharp9.cs\")\n                .WithTopLevelStatements()\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DelegateSubtractionTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class DelegateSubtractionTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<DelegateSubtraction>();\n\n        [TestMethod]\n        public void DelegateSubtraction() =>\n            builder.AddPaths(\"DelegateSubtraction.cs\").Verify();\n\n        [TestMethod]\n        public void DelegateSubtraction_CS_Latest() =>\n            builder.AddPaths(\"DelegateSubtraction.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n        [TestMethod]\n        public void DelegateSubtraction_TopLevelStatements() =>\n            builder.AddPaths(\"DelegateSubtraction.TopLevelStatements.cs\")\n                .WithTopLevelStatements()\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DisposableMemberInNonDisposableClassTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class DisposableMemberInNonDisposableClassTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<DisposableMemberInNonDisposableClass>();\n\n        [TestMethod]\n        public void DisposableMemberInNonDisposableClass() =>\n            builder.AddPaths(\"DisposableMemberInNonDisposableClass.cs\").WithOptions(LanguageOptions.FromCSharp8).Verify();\n\n#if NET\n\n        [TestMethod]\n        public void DisposableMemberInNonDisposableClass_CSharp9() =>\n            builder.AddPaths(\"DisposableMemberInNonDisposableClass.CSharp9.cs\").WithTopLevelStatements().Verify();\n\n        [TestMethod]\n        public void DisposableMemberInNonDisposableClass_IAsyncDisposable() => // IAsyncDisposable is available only on .Net Core\n            builder.AddPaths(\"DisposableMemberInNonDisposableClass.NetCore.cs\").Verify();\n\n#endif\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DisposableNotDisposedTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class DisposableNotDisposedTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<DisposableNotDisposed>();\n\n    [TestMethod]\n    public void DisposableNotDisposed() =>\n        builder.AddPaths(\"DisposableNotDisposed.cs\")\n            .AddReferences(MetadataReferenceFacade.SystemNetHttp)\n            .Verify();\n\n    [TestMethod]\n    public void DisposableNotDisposed_ILogger() =>\n        builder.AddPaths(\"DisposableNotDisposed.ILogger.cs\")\n            .AddReferences(NuGetMetadataReference.MicrosoftExtensionsLoggingPackages(TestConstants.NuGetLatestVersion).ToArray())\n            .VerifyNoIssues();\n\n    [TestMethod]\n    public void DisposableNotDisposed_TopLevelStatements() =>\n        builder.AddPaths(\"DisposableNotDisposed.TopLevelStatements.cs\")\n            .WithTopLevelStatements()\n            .Verify();\n\n    [TestMethod]\n    public void DisposableNotDisposed_Latest() =>\n        builder.AddPaths(\"DisposableNotDisposed.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .AddReferences(NuGetMetadataReference.FluentAssertions(NugetPackageVersions.FluentAssertionsVersions.Ver5))\n            .AddReferences(MetadataReferenceFacade.SystemNetHttp)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DisposableReturnedFromUsingTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class DisposableReturnedFromUsingTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<DisposableReturnedFromUsing>();\n\n    [TestMethod]\n    public void DisposableReturnedFromUsing() =>\n        builder.AddPaths(\"DisposableReturnedFromUsing.cs\")\n            .Verify();\n\n    [TestMethod]\n    public void DisposableReturnedFromUsing_TopLevelStatements() =>\n        builder.AddPaths(\"DisposableReturnedFromUsing.TopLevelStatements.cs\")\n            .WithTopLevelStatements()\n            .Verify();\n\n    [TestMethod]\n    public void DisposableReturnedFromUsing_Latest() =>\n        builder.AddPaths(\"DisposableReturnedFromUsing.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DisposableTypesNeedFinalizersTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class DisposableTypesNeedFinalizersTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<DisposableTypesNeedFinalizers>();\n\n        [TestMethod]\n        public void DisposableTypesNeedFinalizers() =>\n            builder.AddPaths(\"DisposableTypesNeedFinalizers.cs\").Verify();\n\n        [TestMethod]\n        public void DisposableTypesNeedFinalizers_CSharp9() =>\n            builder.AddPaths(\"DisposableTypesNeedFinalizers.CSharp9.cs\").WithOptions(LanguageOptions.FromCSharp9).Verify();\n\n        [TestMethod]\n        public void DisposableTypesNeedFinalizers_CSharp11() =>\n            builder.AddPaths(\"DisposableTypesNeedFinalizers.CSharp11.cs\").WithOptions(LanguageOptions.FromCSharp11).Verify();\n\n        [TestMethod]\n        public void DisposableTypesNeedFinalizers_InvalidCode() =>\n            builder.AddSnippet(\"\"\"\n                public class Foo_05 : IDisposable\n                {\n                    private HandleRef;\n                }\n                \"\"\").VerifyNoIssuesIgnoreErrors();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DisposeFromDisposeTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class DisposeFromDisposeTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<DisposeFromDispose>();\n\n        [TestMethod]\n        public void DisposeFromDispose_CSharp7_2() =>\n            // Readonly structs have been introduced in C# 7.2.\n            // In C# 8, readonly structs can be disposed of, and the behavior is different.\n            new VerifierBuilder<DisposeFromDispose>()\n                .AddPaths(\"DisposeFromDispose.CSharp7_2.cs\")\n                .WithLanguageVersion(LanguageVersion.CSharp7_2)\n                .Verify();\n\n        [TestMethod]\n        public void DisposeFromDispose_CSharp8() =>\n            builder.AddPaths(\"DisposeFromDispose.CSharp8.cs\").WithOptions(LanguageOptions.FromCSharp8).Verify();\n\n        [TestMethod]\n        public void DisposeFromDispose_CSharp9() =>\n            builder.AddPaths(\"DisposeFromDispose.CSharp9.Part1.cs\", \"DisposeFromDispose.CSharp9.Part2.cs\").WithTopLevelStatements().Verify();\n\n        [TestMethod]\n        public void DisposeFromDispose_CSharp10() =>\n            builder.AddPaths(\"DisposeFromDispose.CSharp10.cs\")\n                .WithTopLevelStatements()\n                .WithOptions(LanguageOptions.FromCSharp10)\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DisposeNotImplementingDisposeTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class DisposeNotImplementingDisposeTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<DisposeNotImplementingDispose>();\n\n    [TestMethod]\n    public void DisposeNotImplementingDispose() =>\n        builder.AddPaths(\"DisposeNotImplementingDispose.cs\").Verify();\n\n    [TestMethod]\n    public void DisposeNotImplementingDispose_TopLevelStatements() =>\n        builder.AddPaths(\"DisposeNotImplementingDispose.TopLevelStatements.cs\")\n            .WithTopLevelStatements()\n            .VerifyNoIssues();\n\n    [TestMethod]\n    public void DisposeNotImplementingDispose_Latest() =>\n        builder.AddPaths(\"DisposeNotImplementingDispose.Latest.cs\", \"DisposeNotImplementingDispose.Latest.Partial.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DoNotCallAssemblyGetExecutingAssemblyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class DoNotCallAssemblyGetExecutingAssemblyTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<DoNotCallAssemblyGetExecutingAssemblyMethod>();\n\n        [TestMethod]\n        public void DoNotCallAssemblyGetExecutingAssembly() =>\n            builder.AddPaths(\"DoNotCallAssemblyGetExecutingAssembly.cs\")\n                .Verify();\n\n        [TestMethod]\n        public void DoNotCallAssemblyGetExecutingAssembly_CSharp9() =>\n            builder.AddPaths(\"DoNotCallAssemblyGetExecutingAssembly.CSharp9.cs\")\n                .WithOptions(LanguageOptions.FromCSharp9)\n                .WithTopLevelStatements()\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DoNotCallAssemblyLoadInvalidMethodsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class DoNotCallAssemblyLoadInvalidMethodsTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<DoNotCallAssemblyLoadInvalidMethods>();\n\n    [TestMethod]\n    public void DoNotCallAssemblyLoadInvalidMethods() =>\n        builder.AddPaths(\"DoNotCallAssemblyLoadInvalidMethods.cs\")\n            .AddReferences(MetadataReferenceFacade.SystemSecurityPermissions)\n            .Verify();\n\n    [TestMethod]\n    public void DoNotCallAssemblyLoadInvalidMethods_CSharp9() =>\n        builder.AddPaths(\"DoNotCallAssemblyLoadInvalidMethods.CSharp9.cs\")\n            .WithOptions(LanguageOptions.FromCSharp9)\n            .WithTopLevelStatements()\n            .AddReferences(MetadataReferenceFacade.SystemSecurityPermissions)\n            .Verify();\n\n#if NETFRAMEWORK // The overloads with Evidence are obsolete on .Net Framework 4.8 and not available on .Net Core\n\n    [TestMethod]\n    public void DoNotCallAssemblyLoadInvalidMethods_EvidenceParameter() =>\n        builder.AddPaths(\"DoNotCallAssemblyLoadInvalidMethods.Evidence.cs\")\n            .Verify();\n\n#endif\n\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DoNotCallExitMethodsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class DoNotCallExitMethodsTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<DoNotCallExitMethods>();\n\n        [TestMethod]\n        public void DoNotCallExitMethods() =>\n            builder.AddPaths(\"DoNotCallExitMethods.cs\")\n                .AddReferences(MetadataReferenceFacade.SystemWindowsForms)\n                .Verify();\n\n        [TestMethod]\n        public void DoNotCallExitMethods_CSharp9() =>\n            builder.AddPaths(\"DoNotCallExitMethods.CSharp9.cs\")\n                .WithOptions(LanguageOptions.FromCSharp9)\n                .WithTopLevelStatements()\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DoNotCallGCCollectMethodTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class DoNotCallGCCollectMethodTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<DoNotCallGCCollectMethod>();\n\n    [TestMethod]\n    public void DoNotCallGCCollectMethod() =>\n        builder.AddPaths(\"DoNotCallGCCollectMethod.cs\")\n            .Verify();\n\n    [TestMethod]\n    public void DoNotCallGCCollectMethod_Latest() =>\n        builder.AddPaths(\"DoNotCallGCCollectMethod.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .WithTopLevelStatements()\n            .Verify();\n\n    [TestMethod]\n    public void DoNotCallGCCollectMethod_AD0001() =>\n        builder.AddPaths(\"DoNotCallGCCollectMethodAD0001.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .WithConcurrentAnalysis(false)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DoNotCallGCSuppressFinalizeTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class DoNotCallGCSuppressFinalizeTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<DoNotCallGCSuppressFinalize>();\n\n        [TestMethod]\n        public void DoNotCallGCSuppressFinalize() =>\n            builder.AddPaths(\"DoNotCallGCSuppressFinalize.cs\")\n                .Verify();\n\n#if NET\n\n        [TestMethod]\n        public void DoNotCallGCSuppressFinalize_NetCore() =>\n            builder.AddPaths(\"DoNotCallGCSuppressFinalize.NetCore.cs\")\n                .WithOptions(LanguageOptions.FromCSharp8)\n                .Verify();\n\n        [TestMethod]\n        public void DoNotCallGCSuppressFinalize_Net5() =>\n            builder.AddPaths(\"DoNotCallGCSuppressFinalize.Net5.cs\")\n                .WithOptions(LanguageOptions.FromCSharp9)\n                .Verify();\n\n#endif\n\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DoNotCatchNullReferenceExceptionTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class DoNotCatchNullReferenceExceptionTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<DoNotCatchNullReferenceException>();\n\n        [TestMethod]\n        public void DoNotCatchNullReferenceException() =>\n            builder.AddPaths(\"DoNotCatchNullReferenceException.cs\").Verify();\n\n        [TestMethod]\n        public void DoNotCatchNullReferenceException_CSharp9() =>\n            builder.AddPaths(\"DoNotCatchNullReferenceException.CSharp9.cs\")\n                .WithTopLevelStatements()\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DoNotCatchSystemExceptionTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class DoNotCatchSystemExceptionTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<DoNotCatchSystemException>();\n\n        [TestMethod]\n        public void DoNotCatchSystemException() =>\n            builder.AddReferences(NuGetMetadataReference.MicrosoftAzureWebJobsCore()).AddPaths(\"DoNotCatchSystemException.cs\").Verify();\n\n        [TestMethod]\n        public void DoNotCatchSystemException_CSharp9() =>\n            builder.AddPaths(\"DoNotCatchSystemException.CSharp9.cs\").WithTopLevelStatements().Verify();\n\n        [TestMethod]\n        public void DoNotCatchSystemException_CSharp10() =>\n            builder.AddPaths(\"DoNotCatchSystemException.CSharp10.cs\").WithOptions(LanguageOptions.FromCSharp10).WithTopLevelStatements().Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DoNotCheckZeroSizeCollectionTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class DoNotCheckZeroSizeCollectionTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.DoNotCheckZeroSizeCollection>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.DoNotCheckZeroSizeCollection>();\n\n    [TestMethod]\n    public void DoNotCheckZeroSizeCollection_CS() =>\n        builderCS.AddPaths(\"DoNotCheckZeroSizeCollection.cs\").Verify();\n\n    [TestMethod]\n    public void DoNotCheckZeroSizeCollection_CS_Latest() =>\n        builderCS.AddPaths(\"DoNotCheckZeroSizeCollection.Latest.cs\")\n            .WithTopLevelStatements()\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void DoNotCheckZeroSizeCollection_VB() =>\n        builderVB.AddPaths(\"DoNotCheckZeroSizeCollection.vb\").WithOptions(LanguageOptions.FromVisualBasic14).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DoNotCopyArraysInPropertiesTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class DoNotCopyArraysInPropertiesTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<DoNotCopyArraysInProperties>();\n\n    [TestMethod]\n    public void DoNotCopyArraysInProperties() =>\n        builder.AddPaths(\"DoNotCopyArraysInProperties.cs\").Verify();\n\n    [TestMethod]\n    public void DoNotCopyArraysInProperties_CS_Latest() =>\n        builder.AddPaths(\"DoNotCopyArraysInProperties.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DoNotDecreaseMemberVisibilityTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class DoNotDecreaseMemberVisibilityTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<DoNotDecreaseMemberVisibility>().WithAutogenerateConcurrentFiles(false);\n\n    [TestMethod]\n    public void DoNotDecreaseMemberVisibility() =>\n        builder.AddPaths(\"DoNotDecreaseMemberVisibility.cs\", \"DoNotDecreaseMemberVisibility.Concurrent.cs\").Verify();\n\n    [TestMethod]\n    public void DoNotDecreaseMemberVisibility_CS_Latest() =>\n        builder.AddPaths(\"DoNotDecreaseMemberVisibility.Latest.cs\", \"DoNotDecreaseMemberVisibility.Latest.Partial.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DoNotExposeListTTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class DoNotExposeListTTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<DoNotExposeListT>();\n\n    [TestMethod]\n    public void DoNotExposeListT() =>\n        builder.AddPaths(\"DoNotExposeListT.cs\")\n            .AddReferences(MetadataReferenceFacade.SystemXml)\n            .Verify();\n\n    [TestMethod]\n    public void DoNotExposeListT_Latest() =>\n        builder.AddPaths(\"DoNotExposeListT.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .WithTopLevelStatements()\n            .Verify();\n\n    [TestMethod]\n    public void DoNotExposeListT_InvalidCode() =>\n        builder.AddSnippet(\"\"\"\n            public class InvalidCode\n            {\n                public List<int> () => null;\n\n                public List<T> { get; set; }\n\n                public List<InvalidType> Method() => null;\n\n                public InvalidType Method2() => null;\n            }\n            \"\"\")\n            .VerifyNoIssuesIgnoreErrors();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DoNotHardcodeCredentialsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class DoNotHardcodeCredentialsTest\n{\n    private readonly VerifierBuilder builderCS = CreateVerifierCS();\n    private readonly VerifierBuilder builderVB = CreateVerifierVB();\n\n    public TestContext TestContext { get; set; }\n\n    internal static IEnumerable<MetadataReference> AdditionalReferences => MetadataReferenceFacade.SystemSecurityCryptography.Concat(MetadataReferenceFacade.SystemNetHttp);\n\n    [TestMethod]\n    public void DoNotHardcodeCredentials_CS_DefaultValues() =>\n        builderCS.AddPaths(\"DoNotHardcodeCredentials.DefaultValues.cs\").Verify();\n\n    [TestMethod]\n    public void DoNotHardcodeCredentials_CS_SecureString() =>\n        builderCS.AddPaths(\"DoNotHardcodeCredentials.SecureString.cs\").Verify();\n\n    [TestMethod]\n    public void DoNotHardcodeCredentials_VB_SecureString() =>\n        builderVB.AddPaths(\"DoNotHardcodeCredentials.SecureString.vb\").Verify();\n\n    [TestMethod]\n    public void DoNotHardcodeCredentials_CS_DefaultValues_Latest() =>\n        builderCS.AddPaths(\"DoNotHardcodeCredentials.DefaultValues.Latest.cs\").AddReferences(AdditionalReferences).WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void DoNotHardcodeCredentials_CS_CustomValues() =>\n        CreateVerifierCS(@\"kode,facal-faire,*,x\\*+?|}{][)(^$.# \").AddPaths(\"DoNotHardcodeCredentials.CustomValues.cs\").Verify();\n\n    [TestMethod]\n    public void DoNotHardcodeCredentials_CS_CustomValues_CaseInsensitive() =>\n        CreateVerifierCS(@\"KODE ,,,, FaCaL-FaIrE,*,x\\*+?|}{][)(^$.# \").AddPaths(\"DoNotHardcodeCredentials.CustomValues.cs\").Verify();\n\n    [TestMethod]\n    public void DoNotHardcodeCredentials_CS_WebConfig() =>\n        DoNotHardcodeCredentials_ExternalFiles(new CS.DoNotHardcodeCredentials(), \"WebConfig\", \"*.config\");\n\n    [TestMethod]\n    public void DoNotHardcodeCredentials_CS_LaunchSettings() =>\n        DoNotHardcodeCredentials_ExternalFiles(new CS.DoNotHardcodeCredentials(), \"LaunchSettings\", \"*.json\");\n\n    [TestMethod]\n    public void DoNotHardcodeCredentials_CS_AppSettings() =>\n        DoNotHardcodeCredentials_ExternalFiles(new CS.DoNotHardcodeCredentials(), \"AppSettings\", \"*.json\");\n\n    [TestMethod]\n    public void DoNotHardcodeCredentials_VB_DefaultValues() =>\n        builderVB.AddPaths(\"DoNotHardcodeCredentials.DefaultValues.vb\").WithOptions(LanguageOptions.FromVisualBasic14).Verify();\n\n    [TestMethod]\n    public void DoNotHardcodeCredentials_VB_CustomValues() =>\n        CreateVerifierVB(@\"kode,facal-faire,*,x\\*+?|}{][)(^$.# \").AddPaths(\"DoNotHardcodeCredentials.CustomValues.vb\").Verify();\n\n    [TestMethod]\n    public void DoNotHardcodeCredentials_VB_CustomValues_CaseInsensitive() =>\n        CreateVerifierVB(@\"KODE ,,,, FaCaL-FaIrE,*,x\\*+?|}{][)(^$.# \").AddPaths(\"DoNotHardcodeCredentials.CustomValues.vb\").Verify();\n\n    [TestMethod]\n    public void DoNotHardcodeCredentials_VB_WebConfig() =>\n        DoNotHardcodeCredentials_ExternalFiles(new VB.DoNotHardcodeCredentials(), \"WebConfig\", \"*.config\");\n\n    [TestMethod]\n    public void DoNotHardcodeCredentials_VB_LaunchSettings() =>\n        DoNotHardcodeCredentials_ExternalFiles(new VB.DoNotHardcodeCredentials(), \"LaunchSettings\", \"*.json\");\n\n    [TestMethod]\n    public void DoNotHardcodeCredentials_VB_AppSettings() =>\n        DoNotHardcodeCredentials_ExternalFiles(new VB.DoNotHardcodeCredentials(), \"AppSettings\", \"*.json\");\n\n    [TestMethod]\n    public void DoNotHardcodeCredentials_ConfiguredCredentialsAreRead()\n    {\n        var cs = new CS.DoNotHardcodeCredentials { CredentialWords = \"Lorem, ipsum\" };\n        cs.CredentialWords.Should().Be(\"Lorem, ipsum\");\n\n        var vb = new CS.DoNotHardcodeCredentials { CredentialWords = \"Lorem, ipsum\" };\n        vb.CredentialWords.Should().Be(\"Lorem, ipsum\");\n    }\n\n    private static VerifierBuilder CreateVerifierCS(string credentialWords = null) =>\n        new VerifierBuilder().AddAnalyzer(() => credentialWords is null\n                                                    ? new CS.DoNotHardcodeCredentials()\n                                                    : new CS.DoNotHardcodeCredentials { CredentialWords = credentialWords })\n            .AddReferences(AdditionalReferences);\n\n    private static VerifierBuilder CreateVerifierVB(string credentialWords = null) =>\n        new VerifierBuilder().AddAnalyzer(() => credentialWords is null\n                                                    ? new VB.DoNotHardcodeCredentials()\n                                                    : new VB.DoNotHardcodeCredentials { CredentialWords = credentialWords })\n            .AddReferences(AdditionalReferences);\n\n    private void DoNotHardcodeCredentials_ExternalFiles(DiagnosticAnalyzer analyzer, string testDirectory, string pattern)\n    {\n        var paths = Directory.GetFiles(@$\"TestCases\\{testDirectory}\\DoNotHardcodeCredentials\", pattern, SearchOption.AllDirectories);\n        paths.Should().NotBeEmpty();\n        new VerifierBuilder()\n            .AddAnalyzer(() => analyzer)\n            .AddSnippet(string.Empty) // Nothing to see here, C# and VB\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfigWithFilesToAnalyze(TestContext, paths))\n            .AddAdditionalSourceFiles(paths)\n            .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DoNotHardcodeSecretsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class DoNotHardcodeSecretsTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder().AddAnalyzer(() => new CS.DoNotHardcodeSecrets());\n    private readonly VerifierBuilder builderVB = new VerifierBuilder().AddAnalyzer(() => new VB.DoNotHardcodeSecrets());\n\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    public void DoNotHardcodeSecrets_DefaultValues_CS() =>\n        builderCS.AddPaths(\"DoNotHardcodeSecrets.cs\").Verify();\n\n    [TestMethod]\n    public void DoNotHardcodeSecrets_DefaultValues_CS_Latest() =>\n        builderCS.AddPaths(\"DoNotHardcodeSecrets.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void DoNotHardcodeSecrets_DefaultValues_VB() =>\n        builderVB.AddPaths(\"DoNotHardcodeSecrets.vb\").Verify();\n\n    [TestMethod]\n    public void DoNotHardcodeSecrets_WebConfig_CS() =>\n        DoNotHardcodeCredentials_ExternalFiles(builderCS, \"WebConfig\", \"*.config\");\n\n    [TestMethod]\n    public void DoNotHardcodeSecrets_WebConfig_VB() =>\n        DoNotHardcodeCredentials_ExternalFiles(builderVB, \"WebConfig\", \"*.config\");\n\n    [TestMethod]\n    public void DoNotHardcodeSecrets_AppSettings_CS() =>\n        DoNotHardcodeCredentials_ExternalFiles(builderCS, \"AppSettings\", \"*.json\");\n\n    [TestMethod]\n    public void DoNotHardcodeSecrets_AppSettings_VB() =>\n        DoNotHardcodeCredentials_ExternalFiles(builderVB, \"AppSettings\", \"*.json\");\n\n    [TestMethod]\n    public void DoNotHardcodeSecrets_LaunchSettings_CS() =>\n        DoNotHardcodeCredentials_ExternalFiles(builderCS, \"LaunchSettings\", \"*.json\");\n\n    [TestMethod]\n    public void DoNotHardcodeSecrets_LaunchSettings_VB() =>\n        DoNotHardcodeCredentials_ExternalFiles(builderVB, \"LaunchSettings\", \"*.json\");\n\n    private void DoNotHardcodeCredentials_ExternalFiles(VerifierBuilder builder, string testDirectory, string pattern)\n    {\n        var root = @$\"TestCases\\{testDirectory}\\DoNotHardcodeSecrets\";\n        var paths = Directory.GetFiles(root, pattern, SearchOption.AllDirectories);\n        paths.Should().NotBeEmpty();\n        builder\n            .AddSnippet(string.Empty)\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfigWithFilesToAnalyze(TestContext, paths))\n            .AddAdditionalSourceFiles(paths)\n            .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DoNotHideBaseClassMethodsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class DoNotHideBaseClassMethodsTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<DoNotHideBaseClassMethods>();\n\n    [TestMethod]\n    public void DoNotHideBaseClassMethods() =>\n        builder.AddPaths(\"DoNotHideBaseClassMethods.cs\", \"DoNotHideBaseClassMethods.Concurrent.cs\")\n            .WithAutogenerateConcurrentFiles(false)\n            .Verify();\n\n    [TestMethod]\n    public void DoNotHideBaseClassMethods_CS_Latest() =>\n        builder.AddPaths(\"DoNotHideBaseClassMethods.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .WithConcurrentAnalysis(false)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DoNotInstantiateSharedClassesTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class DoNotInstantiateSharedClassesTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.DoNotInstantiateSharedClasses>().AddReferences(MetadataReferenceFacade.SystemComponentModelComposition);\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.DoNotInstantiateSharedClasses>().AddReferences(MetadataReferenceFacade.SystemComponentModelComposition);\n\n    [TestMethod]\n    public void DoNotInstantiateSharedClasses_CS() =>\n        builderCS.AddPaths(\"DoNotInstantiateSharedClasses.cs\").Verify();\n\n    [TestMethod]\n    public void DoNotInstantiateSharedClasses_CS_InTest() =>\n        builderCS.AddPaths(\"DoNotInstantiateSharedClasses.cs\")\n            .AddTestReference()\n            .VerifyNoIssuesIgnoreErrors();\n\n    [TestMethod]\n    public void DoNotInstantiateSharedClasses_VB() =>\n        builderVB.AddPaths(\"DoNotInstantiateSharedClasses.vb\").Verify();\n\n    [TestMethod]\n    public void DoNotInstantiateSharedClasses_VB_InTest() =>\n        builderVB.AddPaths(\"DoNotInstantiateSharedClasses.vb\")\n            .AddTestReference()\n            .VerifyNoIssuesIgnoreErrors();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DoNotLockOnSharedResourceTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class DoNotLockOnSharedResourceTest\n    {\n        private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.DoNotLockOnSharedResource>();\n        private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.DoNotLockOnSharedResource>();\n\n        [TestMethod]\n        public void DoNotLockOnSharedResource_CS() =>\n            builderCS.AddPaths(\"DoNotLockOnSharedResource.cs\").Verify();\n\n        [TestMethod]\n        public void DoNotLockOnSharedResource_VB() =>\n            builderVB.AddPaths(\"DoNotLockOnSharedResource.vb\").Verify();\n\n        [TestMethod]\n        public void DoNotLockOnSharedResource_CS_Latest() =>\n            builderCS.AddPaths(\"DoNotLockOnSharedResource.Latest.cs\")\n                .WithOptions(LanguageOptions.CSharpLatest)\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DoNotLockWeakIdentityObjectsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class DoNotLockWeakIdentityObjectsTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<CS.DoNotLockWeakIdentityObjects>();\n\n        [TestMethod]\n        public void DoNotLockWeakIdentityObjects_CS() =>\n            builder.AddPaths(\"DoNotLockWeakIdentityObjects.cs\").Verify();\n\n        [TestMethod]\n        public void DoNotLockWeakIdentityObjects_Latest() =>\n            builder.AddPaths(\"DoNotLockWeakIdentityObjects.Latest.cs\")\n                .WithOptions(LanguageOptions.CSharpLatest)\n                .Verify();\n\n        [TestMethod]\n        public void DoNotLockWeakIdentityObjects_VB() =>\n            new VerifierBuilder<VB.DoNotLockWeakIdentityObjects>().AddPaths(\"DoNotLockWeakIdentityObjects.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DoNotMarkEnumsWithFlagsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class DoNotMarkEnumsWithFlagsTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<DoNotMarkEnumsWithFlags>();\n\n        [TestMethod]\n        public void DoNotMarkEnumsWithFlags() =>\n            builder.AddPaths(\"DoNotMarkEnumsWithFlags.cs\").Verify();\n\n        [TestMethod]\n        public void DoNotMarkEnumsWithFlags_InvalidEnumType() =>\n            builder.AddSnippet(\n\"\"\"\n[System.Flags]\npublic enum InvalidStringEnum : string // Noncompliant\n{\n    MyValue = \"toto\" // Secondary\n}\n\"\"\")\n                .WithErrorBehavior(CompilationErrorBehavior.Ignore)\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DoNotNestTernaryOperatorsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class DoNotNestTernaryOperatorsTest\n    {\n        private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.DoNotNestTernaryOperators>();\n        private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.DoNotNestTernaryOperators>();\n\n        [TestMethod]\n        public void DoNotNestTernaryOperators_CS() =>\n            builderCS.AddPaths(\"DoNotNestTernaryOperators.cs\").Verify();\n\n        [TestMethod]\n        public void DoNotNestTernaryOperators_VB() =>\n            builderVB.AddPaths(\"DoNotNestTernaryOperators.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DoNotNestTypesInArgumentsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class DoNotNestTypesInArgumentsTest\n{\n    [TestMethod]\n    public void DoNotNestTypesInArguments_CS() =>\n        new VerifierBuilder<DoNotNestTypesInArguments>()\n            .AddPaths(\"DoNotNestTypesInArguments.cs\")\n            .Verify();\n\n    [TestMethod]\n    public void DoNotNestTypesInArguments_CS_Latest() =>\n        new VerifierBuilder<DoNotNestTypesInArguments>()\n            .AddPaths(\"DoNotNestTypesInArguments.Latest.cs\", \"DoNotNestTypesInArguments.Latest.partial.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DoNotOverloadOperatorEqualTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class DoNotOverloadOperatorEqualTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<DoNotOverloadOperatorEqual>();\n\n    [TestMethod]\n    public void DoNotOverloadOperatorEqual() =>\n        builder.AddPaths(\"DoNotOverloadOperatorEqual.cs\").Verify();\n\n    [TestMethod]\n    public void DoNotOverloadOperatorEqual_Latest() =>\n        builder.AddPaths(\"DoNotOverloadOperatorEqual.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DoNotOverwriteCollectionElementsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class DoNotOverwriteCollectionElementsTest\n    {\n        private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.DoNotOverwriteCollectionElements>();\n        private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.DoNotOverwriteCollectionElements>();\n\n        [TestMethod]\n        public void DoNotOverwriteCollectionElements_CS() =>\n            builderCS.AddPaths(\"DoNotOverwriteCollectionElements.cs\").Verify();\n\n        [TestMethod]\n        public void DoNotOverwriteCollectionElements_VB() =>\n            builderVB.AddPaths(\"DoNotOverwriteCollectionElements.vb\").WithOptions(LanguageOptions.FromVisualBasic14).Verify();\n\n        [TestMethod]\n        public void DoNotOverwriteCollectionElements_CS_Latest() =>\n            builderCS.AddPaths(\"DoNotOverwriteCollectionElements.Latest.cs\")\n                .WithOptions(LanguageOptions.CSharpLatest)\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DoNotShiftByZeroOrIntSizeTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class DoNotShiftByZeroOrIntSizeTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<DoNotShiftByZeroOrIntSize>();\n\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    public void DoNotShiftByZeroOrIntSize() =>\n        builder.AddPaths(\"DoNotShiftByZeroOrIntSize.cs\").Verify();\n\n    [TestMethod]\n    public void DoNotShiftByZeroOrIntSize_CSharp9() =>\n        builder.AddPaths(\"DoNotShiftByZeroOrIntSize.CSharp9.cs\")\n            .WithTopLevelStatements()\n            .VerifyNoIssues();\n\n    [TestMethod]\n    public void DoNotShiftByZeroOrIntSize_CSharp10() =>\n        builder.AddPaths(\"DoNotShiftByZeroOrIntSize.CSharp10.cs\")\n            .WithOptions(LanguageOptions.FromCSharp10)\n            .Verify();\n\n    [TestMethod]\n    public void DoNotShiftByZeroOrIntSize_CSharp11() =>\n        builder.AddPaths(\"DoNotShiftByZeroOrIntSize.CSharp11.cs\")\n            .WithOptions(LanguageOptions.FromCSharp11)\n            .Verify();\n\n    [TestMethod]\n    public void DoNotShiftByZeroOrIntSize_RazorFile_CorrectMessage() =>\n        builder.AddSnippet(\n            \"\"\"\n            @code\n            {\n                public void Method()\n                {\n                    byte b = 1;\n                    b = (byte)(b << 10);\n                    b = (byte)(b << 10);\n                    b = 1 << 0;\n\n                    sbyte sb = 1;\n                    sb = (sbyte)(sb << 10);\n\n                    int i = 1 << 10;\n                    i = i << 32;  // Noncompliant\n                }\n            }\n            \"\"\",\n            \"SomeRazorFile.razor\")\n        .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Product))\n        .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DoNotTestThisWithIsOperatorTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class DoNotTestThisWithIsOperatorTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<DoNotTestThisWithIsOperator>();\n\n        [TestMethod]\n        public void DoNotTestThisWithIsOperator() =>\n            builder.AddPaths(\"DoNotTestThisWithIsOperator.cs\").Verify();\n\n        [TestMethod]\n        public void DoNotTestThisWithIsOperator_CSharp9() =>\n            builder.AddPaths(\"DoNotTestThisWithIsOperator.CSharp9.cs\")\n                .WithOptions(LanguageOptions.FromCSharp9)\n                .Verify();\n\n        [TestMethod]\n        public void DoNotTestThisWithIsOperator_CSharp10() =>\n            builder.AddPaths(\"DoNotTestThisWithIsOperator.CSharp10.cs\")\n                .WithOptions(LanguageOptions.FromCSharp10)\n                .Verify();\n\n        [TestMethod]\n        public void DoNotTestThisWithIsOperator_CSharp11() =>\n            builder.AddPaths(\"DoNotTestThisWithIsOperator.CSharp11.cs\")\n                .WithOptions(LanguageOptions.FromCSharp11)\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DoNotThrowFromDestructorsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class DoNotThrowFromDestructorsTest\n    {\n        private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.DoNotThrowFromDestructors>();\n\n        [TestMethod]\n        public void DoNotThrowFromDestructors_CS() =>\n            builderCS.AddPaths(\"DoNotThrowFromDestructors.cs\").Verify();\n\n        [TestMethod]\n        public void DoNotThrowFromDestructors_CS_CSharp9() =>\n            builderCS.AddPaths(\"DoNotThrowFromDestructors.CSharp9.cs\")\n                .WithOptions(LanguageOptions.FromCSharp9)\n                .Verify();\n\n        [TestMethod]\n        public void DoNotThrowFromDestructors_VB() =>\n            new VerifierBuilder<VB.DoNotThrowFromDestructors>().AddPaths(\"DoNotThrowFromDestructors.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DoNotUseByValTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class DoNotUseByValTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<DoNotUseByVal>();\n\n        [TestMethod]\n        public void DoNotUseByVal() =>\n            builder.AddPaths(\"DoNotUseByVal.vb\").Verify();\n\n        [TestMethod]\n        public void DoNotUseByValCodeFix() =>\n            builder.AddPaths(\"DoNotUseByVal.vb\")\n                .WithCodeFix<DoNotUseByValCodeFix>()\n                .WithCodeFixedPaths(\"DoNotUseByVal.Fixed.vb\")\n                .VerifyCodeFix();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DoNotUseCollectionInItsOwnMethodCallsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class DoNotUseCollectionInItsOwnMethodCallsTest\n{\n    [TestMethod]\n    public void DoNotUseCollectionInItsOwnMethodCalls() =>\n        new VerifierBuilder<DoNotUseCollectionInItsOwnMethodCalls>().AddPaths(\"DoNotUseCollectionInItsOwnMethodCalls.cs\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DoNotUseDateTimeNowTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class DoNotUseDateTimeNowTest\n{\n    [TestMethod]\n    public void DoNotUseDateTimeNow_CS() =>\n        new VerifierBuilder<CS.DoNotUseDateTimeNow>().AddPaths(\"DoNotUseDateTimeNow.cs\").Verify();\n\n    [TestMethod]\n    public void DoNotUseDateTimeNow_VB() =>\n        new VerifierBuilder<VB.DoNotUseDateTimeNow>().AddPaths(\"DoNotUseDateTimeNow.vb\").WithOptions(LanguageOptions.FromVisualBasic14).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DoNotUseIIfTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class DoNotUseIIfTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<DoNotUseIIf>();\n\n        [TestMethod]\n        public void DoNotUseIif() =>\n            builder.AddPaths(\"DoNotUseIIf.vb\").Verify();\n\n        [TestMethod]\n        public void DoNotUseIif_CodeFix() =>\n            builder.AddPaths(\"DoNotUseIIf.vb\")\n                .WithCodeFix<DoNotUseIIfCodeFix>()\n                .WithCodeFixedPaths(\"DoNotUseIIf.Fixed.vb\")\n                .VerifyCodeFix();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DoNotUseLiteralBoolInAssertionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\nusing SonarAnalyzer.Test.Common;\n\nusing static SonarAnalyzer.TestFramework.MetadataReferences.NugetPackageVersions;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class DoNotUseLiteralBoolInAssertionsTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<DoNotUseLiteralBoolInAssertions>();\n\n        [TestMethod]\n        [DataRow(MsTest.Ver11)]\n        [DataRow(MsTest.Ver311)]\n        [DataRow(TestConstants.NuGetLatestVersion)]\n        public void DoNotUseLiteralBoolInAssertions_MsTest(string testFwkVersion) =>\n            builder.AddPaths(\"DoNotUseLiteralBoolInAssertions.MsTest.cs\")\n                .AddReferences(NuGetMetadataReference.MSTestTestFramework(testFwkVersion))\n                .Verify();\n\n        [TestMethod]\n        [DataRow(NUnit.Ver25)]\n        [DataRow(NUnit.Ver3Latest)] // Breaking changes in NUnit 4.0 would fail the test https://github.com/SonarSource/sonar-dotnet/issues/8409\n        public void DoNotUseLiteralBoolInAssertions_NUnit(string testFwkVersion) =>\n            builder.AddPaths(\"DoNotUseLiteralBoolInAssertions.NUnit.cs\")\n                .AddReferences(NuGetMetadataReference.NUnit(testFwkVersion))\n                .Verify();\n\n        [TestMethod]\n        public void DoNotUseLiteralBoolInAssertions_NUnit4() =>\n            builder.AddPaths(\"DoNotUseLiteralBoolInAssertions.NUnit4.cs\")\n                .AddReferences(NuGetMetadataReference.NUnit(NUnit.Ver4))\n                .Verify();\n\n        [TestMethod]\n        [DataRow(\"2.0.0\")]\n        [DataRow(XUnitVersions.Ver253)]\n        public void DoNotUseLiteralBoolInAssertions_Xunit(string testFwkVersion) =>\n            builder.AddPaths(\"DoNotUseLiteralBoolInAssertions.Xunit.cs\")\n                .AddReferences(NuGetMetadataReference.XunitFramework(testFwkVersion))\n                .Verify();\n\n        [TestMethod]\n        public void DoNotUseLiteralBoolInAssertions_XunitV3() =>\n            builder\n                .AddPaths(\"DoNotUseLiteralBoolInAssertions.Xunit.cs\")\n                .AddPaths(\"DoNotUseLiteralBoolInAssertions.XunitV3.cs\")\n                .AddReferences(NuGetMetadataReference.XunitFrameworkV3(TestConstants.NuGetLatestVersion))\n                .AddReferences(NuGetMetadataReference.SystemMemory(TestConstants.NuGetLatestVersion))\n                .AddReferences(MetadataReferenceFacade.NetStandard)\n                .AddReferences(MetadataReferenceFacade.SystemCollections)\n                .Verify();\n\n        [TestMethod]\n        public void DoNotUseLiteralBoolInAssertions_NUnit4_AliasedNamespace() =>\n            builder.AddReferences(NuGetMetadataReference.NUnit(NUnit.Ver4)).AddSnippet(\"\"\"\n                namespace Aliased\n                {\n                    using Assert = NUnit.Framework.Legacy.ClassicAssert;\n                    class Foo\n                    {\n                        public void Test()\n                        {\n                            bool b = true;\n                            Assert.AreEqual(true, b); // Noncompliant\n                            Assert.AreEqual(b, b);    // Compliant\n                        }\n                    }\n                }\n                \"\"\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DoNotUseOutRefParametersTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class DoNotUseOutRefParametersTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<DoNotUseOutRefParameters>();\n\n        [TestMethod]\n        public void DoNotUseOutRefParameters() =>\n            builder.AddPaths(\"DoNotUseOutRefParameters.cs\").Verify();\n\n        [TestMethod]\n        public void DoNotUseOutRefParameters_CSharp9() =>\n            builder.AddPaths(\"DoNotUseOutRefParameters.CSharp9.cs\").WithOptions(LanguageOptions.FromCSharp9).Verify();\n\n        [TestMethod]\n        public void DoNotUseOutRefParameters_CSharp11() =>\n            builder.AddPaths(\"DoNotUseOutRefParameters.CSharp11.cs\").WithOptions(LanguageOptions.FromCSharp11).Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DoNotWriteToStandardOutputTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class DoNotWriteToStandardOutputTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<DoNotWriteToStandardOutput>();\n\n        [TestMethod]\n        public void DoNotWriteToStandardOutput() =>\n            builder.AddPaths(\"DoNotWriteToStandardOutput.cs\").Verify();\n\n        [TestMethod]\n        public void DoNotWriteToStandardOutput_ConditionalDirectives1() =>\n            builder.AddPaths(\"DoNotWriteToStandardOutput_Conditionals1.cs\")\n                .WithConcurrentAnalysis(false)\n                .Verify();\n\n        [TestMethod]\n        public void DoNotWriteToStandardOutput_ConditionalDirectives2() =>\n            builder.AddPaths(\"DoNotWriteToStandardOutput_Conditionals2.cs\")\n                .WithConcurrentAnalysis(false)\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DontMixIncrementOrDecrementWithOtherOperatorsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class DontMixIncrementOrDecrementWithOtherOperatorsTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<DontMixIncrementOrDecrementWithOtherOperators>();\n\n    [TestMethod]\n    public void DontMixIncrementOrDecrementWithOtherOperators() =>\n        builder.AddPaths(\"DontMixIncrementOrDecrementWithOtherOperators.cs\").Verify();\n\n    [TestMethod]\n    public void DontMixIncrementOrDecrementWithOtherOperators_Latest() =>\n        builder\n            .AddPaths(\"DontMixIncrementOrDecrementWithOtherOperators.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DontUseTraceSwitchLevelsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class DontUseTraceSwitchLevelsTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<DontUseTraceSwitchLevels>();\n\n    [TestMethod]\n    public void DontUseTraceSwitchLevels_CS() =>\n        builder.AddPaths(\"DontUseTraceSwitchLevels.cs\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/DontUseTraceWriteTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class DontUseTraceWriteTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<DontUseTraceWrite>();\n\n    [TestMethod]\n    public void DontUseTraceWrite_CS() =>\n        builder.AddPaths(\"DontUseTraceWrite.cs\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/EmptyMethodTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class EmptyMethodTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.EmptyMethod>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.EmptyMethod>();\n\n    [TestMethod]\n    public void EmptyMethod() =>\n        builderCS.AddPaths(\"EmptyMethod.cs\")\n            .WithOptions(LanguageOptions.FromCSharp8)\n            .AddReferences(MetadataReferenceFacade.NetStandard21)\n            .Verify();\n\n    [TestMethod]\n    public void EmptyMethod_CSharp9() =>\n        builderCS.AddPaths(\"EmptyMethod.CSharp9.cs\")\n            .WithTopLevelStatements()\n            .WithOptions(LanguageOptions.FromCSharp9)\n            .Verify();\n\n    [TestMethod]\n    public void EmptyMethod_CSharp9_CodeFix_Throw() =>\n        builderCS.WithCodeFix<CS.EmptyMethodCodeFix>()\n            .AddPaths(\"EmptyMethod.CSharp9.cs\")\n            .WithTopLevelStatements()\n            .WithCodeFixedPaths(\"EmptyMethod.CSharp9.Throw.Fixed.cs\")\n            .WithCodeFixTitle(CS.EmptyMethodCodeFix.TitleThrow)\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void EmptyMethod_CSharp9_CodeFix_Comment() =>\n        builderCS.WithCodeFix<CS.EmptyMethodCodeFix>()\n            .AddPaths(\"EmptyMethod.CSharp9.cs\")\n            .WithTopLevelStatements()\n            .WithCodeFixedPaths(\"EmptyMethod.CSharp9.Comment.Fixed.cs\")\n            .WithCodeFixTitle(CS.EmptyMethodCodeFix.TitleComment)\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void EmptyMethod_CS_Latest() =>\n        builderCS.AddPaths(\"EmptyMethod.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void EmptyMethod_CodeFix_Throw() =>\n        builderCS.WithCodeFix<CS.EmptyMethodCodeFix>()\n            .AddPaths(\"EmptyMethod.cs\")\n            .WithCodeFixedPaths(\"EmptyMethod.Throw.Fixed.cs\")\n            .WithCodeFixTitle(CS.EmptyMethodCodeFix.TitleThrow)\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void EmptyMethod_CodeFix_Comment() =>\n        builderCS.WithCodeFix<CS.EmptyMethodCodeFix>()\n            .AddPaths(\"EmptyMethod.cs\")\n            .WithCodeFixedPaths(\"EmptyMethod.Comment.Fixed.cs\")\n            .WithCodeFixTitle(CS.EmptyMethodCodeFix.TitleComment)\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void EmptyMethod_WithoutClosingBracket_CodeFix_Comment() =>\n        builderCS.WithCodeFix<CS.EmptyMethodCodeFix>()\n            .AddPaths(\"EmptyMethod.WithoutClosingBracket.cs\")\n            .WithCodeFixedPaths(\"EmptyMethod.WithoutClosingBracket.Comment.Fixed.cs\")\n            .WithCodeFixTitle(CS.EmptyMethodCodeFix.TitleComment)\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void EmptyMethod_VB() =>\n        builderVB.AddPaths(\"EmptyMethod.vb\").Verify();\n\n    [TestMethod]\n    public void EmptyMethod_WithVirtualOverride_RaisesIssueForMainProject_CS() =>\n        builderCS.AddPaths(\"EmptyMethod.OverrideVirtual.cs\").Verify();\n\n    [TestMethod]\n    public void EmptyMethod_WithVirtualOverride_DoesNotRaiseIssuesForTestProject_CS() =>\n        builderCS.AddPaths(\"EmptyMethod.OverrideVirtual.cs\").AddTestReference().VerifyNoIssues();\n\n    [TestMethod]\n    public void EmptyMethod_WithVirtualOverride_RaisesIssueForMainProject_VB() =>\n        builderVB.AddPaths(\"EmptyMethod.OverrideVirtual.vb\").Verify();\n\n    [TestMethod]\n    public void EmptyMethod_WithVirtualOverride_DoesNotRaiseIssuesForTestProject_VB() =>\n        builderVB.AddPaths(\"EmptyMethod.OverrideVirtual.vb\").AddTestReference().VerifyNoIssues();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/EmptyNamespaceTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class EmptyNamespaceTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<EmptyNamespace>();\n\n        [TestMethod]\n        public void EmptyNamespace() =>\n            builder.AddPaths(\"EmptyNamespace.cs\").Verify();\n\n        [TestMethod]\n        public void EmptyNamespace_CSharp10() =>\n            builder.AddPaths(\"EmptyNamespace.CSharp10.Empty.cs\", \"EmptyNamespace.CSharp10.NotEmpty.cs\")\n                .WithOptions(LanguageOptions.FromCSharp10)\n                .WithConcurrentAnalysis(false)\n                .Verify();\n\n        [TestMethod]\n        public void EmptyNamespace_CSharp10_CodeFix() =>\n            builder.AddPaths(\"EmptyNamespace.CSharp10.Empty.cs\")\n                .WithCodeFix<EmptyNamespaceCodeFix>()\n                .WithOptions(LanguageOptions.FromCSharp10)\n                .WithAutogenerateConcurrentFiles(false)\n                .WithCodeFixedPaths(\"EmptyNamespace.CSharp10.Fixed.cs\")\n                .VerifyCodeFix();\n\n        [TestMethod]\n        public void EmptyNamespace_CodeFix() =>\n            builder.AddPaths(\"EmptyNamespace.cs\")\n                .WithCodeFix<EmptyNamespaceCodeFix>()\n                .WithCodeFixedPaths(\"EmptyNamespace.Fixed.cs\", \"EmptyNamespace.Fixed.Batch.cs\")\n                .VerifyCodeFix();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/EmptyNestedBlockTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class EmptyNestedBlockTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.EmptyNestedBlock>();\n\n    [TestMethod]\n    public void EmptyNestedBlock_CS() =>\n        builderCS.AddPaths(\"EmptyNestedBlock.cs\", \"EmptyNestedBlock2.cs\")\n            .WithAutogenerateConcurrentFiles(false)\n            .Verify();\n\n    [TestMethod]\n    public void EmptyNestedBlock_CS_Latest() =>\n        builderCS.AddPaths(\"EmptyNestedBlock.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void EmptyNestedBlock_VB() =>\n        new VerifierBuilder<VB.EmptyNestedBlock>().AddPaths(\"EmptyNestedBlock.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/EmptyStatementTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class EmptyStatementTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<EmptyStatement>();\n        private readonly VerifierBuilder codeFix = new VerifierBuilder<EmptyStatement>().WithCodeFix<EmptyStatementCodeFix>();\n\n        [TestMethod]\n        public void EmptyStatement() =>\n            builder.AddPaths(\"EmptyStatement.cs\").Verify();\n\n        [TestMethod]\n        public void EmptyStatement_CS_TopLevelStatements() =>\n            builder.AddPaths(\"EmptyStatement.TopLevelStatements.cs\")\n                .WithTopLevelStatements()\n                .Verify();\n\n        [TestMethod]\n        public void EmptyStatement_CS_Latest() =>\n            builder.AddPaths(\"EmptyStatement.Latest.cs\")\n                .WithOptions(LanguageOptions.CSharpLatest)\n                .Verify();\n\n        [TestMethod]\n        public void EmptyStatement_CodeFix() =>\n            codeFix.AddPaths(\"EmptyStatement.cs\")\n                .WithCodeFixedPaths(\"EmptyStatement.Fixed.cs\")\n                .VerifyCodeFix();\n\n        [TestMethod]\n        public void EmptyStatement_CodeFix_CS_TopLevelStatements() =>\n            codeFix.AddPaths(\"EmptyStatement.TopLevelStatements.cs\")\n                .WithTopLevelStatements()\n                .WithCodeFixedPaths(\"EmptyStatement.TopLevelStatements.Fixed.cs\")\n                .VerifyCodeFix();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/EncryptionAlgorithmsShouldBeSecureTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class EncryptionAlgorithmsShouldBeSecureTest\n    {\n        private readonly VerifierBuilder<CS.EncryptionAlgorithmsShouldBeSecure> builderCS = new();\n        private readonly VerifierBuilder<VB.EncryptionAlgorithmsShouldBeSecure> builderVB = new();\n\n        [TestMethod]\n        public void EncryptionAlgorithmsShouldBeSecure_CS() =>\n            builderCS.AddPaths(@\"EncryptionAlgorithmsShouldBeSecure.cs\").AddReferences(GetAdditionalReferences()).Verify();\n\n        [TestMethod]\n        public void EncryptionAlgorithmsShouldBeSecure_CS_NetStandard21() =>\n            builderCS.AddPaths(@\"EncryptionAlgorithmsShouldBeSecure_NetStandard21.cs\").AddReferences(MetadataReferenceFacade.NetStandard21.Concat(GetAdditionalReferences())).Verify();\n\n        [TestMethod]\n        public void EncryptionAlgorithmsShouldBeSecure_VB() =>\n            builderVB.AddPaths(@\"EncryptionAlgorithmsShouldBeSecure.vb\").AddReferences(GetAdditionalReferences()).Verify();\n\n        [TestMethod]\n        public void EncryptionAlgorithmsShouldBeSecure_VB_NetStandard21() =>\n            builderVB.AddPaths(@\"EncryptionAlgorithmsShouldBeSecure_NetStandard21.vb\")\n                     .AddReferences(MetadataReferenceFacade.NetStandard21.Concat(GetAdditionalReferences()))\n                     .Verify();\n\n#if NET\n\n        [TestMethod]\n        public void EncryptionAlgorithmsShouldBeSecure_VB_NetStandard21_Net7() =>\n            builderVB.AddPaths(@\"EncryptionAlgorithmsShouldBeSecure_NetStandard21.Net7.vb\")\n                .WithOptions(LanguageOptions.VisualBasicLatest)\n                .AddReferences(MetadataReferenceFacade.NetStandard21.Concat(GetAdditionalReferences()))\n                .Verify();\n\n#else\n\n        [TestMethod]\n        public void EncryptionAlgorithmsShouldBeSecure_VB_NetStandard21_Net48() =>\n            builderVB.AddPaths(@\"EncryptionAlgorithmsShouldBeSecure_NetStandard21.Net48.vb\")\n                     .WithOptions(LanguageOptions.VisualBasicLatest)\n                     .AddReferences(MetadataReferenceFacade.NetStandard21.Concat(GetAdditionalReferences()))\n                     .Verify();\n\n#endif\n\n        private static IEnumerable<MetadataReference> GetAdditionalReferences() =>\n            MetadataReferenceFacade.SystemSecurityCryptography;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/EndStatementUsageTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class EndStatementUsageTest\n    {\n        [TestMethod]\n        public void EndStatementUsage() =>\n            new VerifierBuilder<EndStatementUsage>().AddPaths(\"EndStatementUsage.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/EnumNameHasEnumSuffixTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class EnumNameHasEnumSuffixTest\n    {\n        [TestMethod]\n        public void EnumNameHasEnumSuffix_CS() =>\n            new VerifierBuilder<CS.EnumNameHasEnumSuffix>().AddPaths(\"EnumNameHasEnumSuffix.cs\").Verify();\n\n        [TestMethod]\n        public void EnumNameHasEnumSuffix_VB() =>\n            new VerifierBuilder<VB.EnumNameHasEnumSuffix>().AddPaths(\"EnumNameHasEnumSuffix.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/EnumNameShouldFollowRegexTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class EnumNameShouldFollowRegexTest\n{\n    [TestMethod]\n    public void EnumNameShouldFollowRegex_CS() =>\n        new VerifierBuilder<CS.EnumNameShouldFollowRegex>().AddPaths(\"EnumNameShouldFollowRegex.cs\").Verify();\n\n    [TestMethod]\n    public void EnumNameShouldFollowRegex_VB() =>\n        new VerifierBuilder<VB.EnumNameShouldFollowRegex>().AddPaths(\"EnumNameShouldFollowRegex.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/EnumStorageNeedsToBeInt32Test.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class EnumStorageNeedsToBeInt32Test\n    {\n        [TestMethod]\n        public void EnumStorageNeedsToBeInt32() =>\n            new VerifierBuilder<EnumStorageNeedsToBeInt32>().AddPaths(\"EnumStorageNeedsToBeInt32.cs\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/EnumerableSumInUncheckedTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class EnumerableSumInUncheckedTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<EnumerableSumInUnchecked>();\n\n        [TestMethod]\n        public void EnumerableSumInUnchecked() =>\n            builder.AddPaths(\"EnumerableSumInUnchecked.cs\").Verify();\n\n        [TestMethod]\n        public void EnumerableSumInUnchecked_CSharp9() =>\n            builder.AddPaths(\"EnumerableSumInUnchecked.CSharp9.cs\").WithOptions(LanguageOptions.FromCSharp9).WithTopLevelStatements().Verify();\n\n        [TestMethod]\n        public void EnumerableSumInUnchecked_CSharp11() =>\n            builder.AddPaths(\"EnumerableSumInUnchecked.CSharp11.cs\").WithOptions(LanguageOptions.FromCSharp11).WithTopLevelStatements().Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/EnumerationValueNameTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class EnumerationValueNameTest\n    {\n        [TestMethod]\n        public void EnumerationValueName() =>\n            new VerifierBuilder<EnumerationValueName>().AddPaths(\"EnumerationValueName.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/EnumsShouldNotBeNamedReservedTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class EnumsShouldNotBeNamedReservedTest\n    {\n        [TestMethod]\n        public void EnumsShouldNotBeNamedReserved() =>\n            new VerifierBuilder<EnumsShouldNotBeNamedReserved>().AddPaths(\"EnumsShouldNotBeNamedReserved.cs\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/EqualityOnFloatingPointTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class EqualityOnFloatingPointTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<EqualityOnFloatingPoint>();\n\n    [TestMethod]\n    public void EqualityOnFloatingPoint() =>\n        builder.AddPaths(\"EqualityOnFloatingPoint.cs\").Verify();\n\n#if NET\n\n    [TestMethod]\n    public void EqualityOnFloatingPoint_CSharp11() =>\n        builder.AddPaths(\"EqualityOnFloatingPoint.CSharp11.cs\")\n            .AddReferences(new[] { CoreMetadataReference.SystemRuntime })\n            .WithOptions(LanguageOptions.FromCSharp11)\n            .Verify();\n\n#endif\n\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/EqualityOnModulusTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class EqualityOnModulusTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<EqualityOnModulus>();\n\n        [TestMethod]\n        public void EqualityOnModulus() =>\n            builder.AddPaths(\"EqualityOnModulus.cs\").Verify();\n\n        [TestMethod]\n        public void EqualityOnModulus_CSharp9() =>\n            builder.AddPaths(\"EqualityOnModulus.CSharp9.cs\").WithOptions(LanguageOptions.FromCSharp9).WithTopLevelStatements().Verify();\n\n        [TestMethod]\n        public void EqualityOnModulus_CSharp11() =>\n            builder.AddPaths(\"EqualityOnModulus.CSharp11.cs\").WithOptions(LanguageOptions.FromCSharp11).WithTopLevelStatements().Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/EquatableClassShouldBeSealedTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class EquatableClassShouldBeSealedTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<EquatableClassShouldBeSealed>();\n\n        [TestMethod]\n        public void EquatableClassShouldBeSealed() =>\n            builder.AddPaths(\"EquatableClassShouldBeSealed.cs\").Verify();\n\n        [TestMethod]\n        public void EquatableClassShouldBeSealed_CSharp9() =>\n            builder.AddPaths(\"EquatableClassShouldBeSealed.CSharp9.cs\")\n                .WithOptions(LanguageOptions.FromCSharp9)\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/EscapeLambdaParameterTypeNamedScopedTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class EscapeLambdaParameterTypeNamedScopedTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<EscapeLambdaParameterTypeNamedScoped>();\n\n    [TestMethod]\n    public void EscapeLambdaParameterTypeNamedScoped_TopLevelStatements_CSharp11_13() =>\n        builder.AddPaths(\"EscapeLambdaParameterTypeNamedScoped.TopLevelStatements.CSharp11-13.cs\")\n            .WithOptions(LanguageOptions.Between(LanguageVersion.CSharp11, LanguageVersion.CSharp13))\n            .WithTopLevelStatements()\n            .VerifyNoIssues();\n\n    [TestMethod]\n    public void EscapeLambdaParameterTypeNamedScoped_CSharp11_13() =>\n        builder.AddPaths(\"EscapeLambdaParameterTypeNamedScoped.CSharp11-13.cs\")\n            .WithOptions(LanguageOptions.Between(LanguageVersion.CSharp11, LanguageVersion.CSharp13))\n            .Verify();\n\n    [TestMethod]\n    public void EscapeLambdaParameterTypeNamedScoped_TopLevelStatements_Latest() =>\n        builder.AddPaths(\"EscapeLambdaParameterTypeNamedScoped.TopLevelStatements.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .WithTopLevelStatements()\n            .VerifyNoIssues();\n\n    [TestMethod]\n    public void EscapeLambdaParameterTypeNamedScoped_Latest() =>\n        builder.AddPaths(\"EscapeLambdaParameterTypeNamedScoped.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/EventHandlerDelegateShouldHaveProperArgumentsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class EventHandlerDelegateShouldHaveProperArgumentsTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<EventHandlerDelegateShouldHaveProperArguments>();\n\n    [TestMethod]\n    public void EventHandlerDelegateShouldHaveProperArguments() =>\n        builder.AddPaths(\"EventHandlerDelegateShouldHaveProperArguments.cs\").Verify();\n\n    [TestMethod]\n    public void EventHandlerDelegateShouldHaveProperArguments_Latest() =>\n        builder.AddPaths(\"EventHandlerDelegateShouldHaveProperArguments.Latest.cs\", \"EventHandlerDelegateShouldHaveProperArguments.Latest.Partial.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/EventHandlerNameTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class EventHandlerNameTest\n    {\n        [TestMethod]\n        public void EventHandlerName() =>\n            new VerifierBuilder<EventHandlerName>().AddPaths(\"EventHandlerName.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/EventNameContainsBeforeOrAfterTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class EventNameContainsBeforeOrAfterTest\n    {\n        [TestMethod]\n        public void EventNameContainsBeforeOrAfter() =>\n            new VerifierBuilder<EventNameContainsBeforeOrAfter>().AddPaths(\"EventNameContainsBeforeOrAfter.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/EventNameTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class EventNameTest\n    {\n        [TestMethod]\n        public void EventName() =>\n            new VerifierBuilder<EventName>().AddPaths(\"EventName.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ExceptionRethrowTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class ExceptionRethrowTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<ExceptionRethrow>();\n\n        [TestMethod]\n        public void ExceptionRethrow() =>\n            builder.AddPaths(\"ExceptionRethrow.cs\").Verify();\n\n        [TestMethod]\n        public void ExceptionRethrow_CodeFix() =>\n            builder.AddPaths(\"ExceptionRethrow.cs\")\n                .WithCodeFix<ExceptionRethrowCodeFix>()\n                .WithCodeFixedPaths(\"ExceptionRethrow.Fixed.cs\")\n                .VerifyCodeFix();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ExceptionShouldNotBeThrownFromUnexpectedMethodsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ExceptionShouldNotBeThrownFromUnexpectedMethodsTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<ExceptionShouldNotBeThrownFromUnexpectedMethods>();\n\n    [TestMethod]\n    public void ExceptionShouldNotBeThrownFromUnexpectedMethods() =>\n        builder.AddPaths(\"ExceptionShouldNotBeThrownFromUnexpectedMethods.cs\")\n            .WithOptions(LanguageOptions.FromCSharp8)\n            .Verify();\n\n    [TestMethod]\n    public void ExceptionShouldNotBeThrownFromUnexpectedMethods_Latest() =>\n        builder.AddPaths(\"ExceptionShouldNotBeThrownFromUnexpectedMethods.Latest.cs\", \"ExceptionShouldNotBeThrownFromUnexpectedMethods.Latest.Partial.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ExceptionsNeedStandardConstructorsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class ExceptionsNeedStandardConstructorsTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<ExceptionsNeedStandardConstructors>();\n\n        [TestMethod]\n        public void ExceptionsNeedStandardConstructors() =>\n            builder.AddPaths(\"ExceptionsNeedStandardConstructors.cs\").Verify();\n\n        [TestMethod]\n        public void ExceptionsNeedStandardConstructors_InvalidCode() =>\n            builder.AddSnippet(\"\"\"\n                public class  : Exception\n                {\n                    My_07_Exception() {}\n\n                    My_07_Exception(string message) { }\n\n                    My_07_Exception(string message, Exception innerException) {}\n\n                    My_07_Exception(SerializationInfo info, StreamingContext context) {}\n                }\n                \"\"\")\n                .VerifyNoIssuesIgnoreErrors();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ExceptionsShouldBeLoggedOrThrownTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ExceptionsShouldBeLoggedOrThrownTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<ExceptionsShouldBeLoggedOrThrown>();\n\n    [TestMethod]\n    public void ExceptionsShouldBeLoggedOrThrown_CS() =>\n        builder\n            .AddPaths(\"ExceptionsShouldBeLoggedOrThrown.cs\")\n            .AddReferences(NuGetMetadataReference.MicrosoftExtensionsLoggingAbstractions())\n            .Verify();\n\n    [TestMethod]\n    public void ExceptionsShouldBeLoggedOrThrown_Coalesce_CS() =>\n        builder\n            .AddSnippet(\"\"\"\n                using System;\n                using Microsoft.Extensions.Logging;\n\n                public class Program\n                {\n                    public void Method(ILogger logger, object x)\n                    {\n                        try { }\n                        catch (SystemException e)\n                        {\n                            logger.LogError(e, \"Message!\");\n                            x = x ?? throw e;\n                        }\n                    }\n                }\n                \"\"\")\n            .AddReferences(NuGetMetadataReference.MicrosoftExtensionsLoggingAbstractions())\n            .WithOptions(LanguageOptions.FromCSharp8)\n            .VerifyNoIssues();\n\n    [TestMethod]\n    public void ExceptionsShouldBeLoggedOrThrown_Log4net_CS() =>\n        builder\n            .AddSnippet(\"\"\"\n                using System;\n                using log4net;\n                using log4net.Util;\n\n                public class Program\n                {\n                    public void Method(ILog logger, string message)\n                    {\n                        try { }\n                        catch (AggregateException e)                                // Noncompliant\n                        {\n                            ILogExtensions.DebugExt(logger, \"Message\", e);          // Secondary\n                            throw;                                                  // Secondary\n                        }\n                        catch (Exception e)                                         // Noncompliant\n                        {\n                            logger.Debug(message, e);                               // Secondary\n                            throw;                                                  // Secondary\n                        }\n                    }\n                }\n                \"\"\")\n            .AddReferences(NuGetMetadataReference.Log4Net(\"2.0.8\", \"net45-full\"))\n            .Verify();\n\n    [TestMethod]\n    public void ExceptionsShouldBeLoggedOrThrown_NLog_CS() =>\n        builder\n            .AddSnippet(\"\"\"\n                using System;\n                using NLog;\n\n                public class Program\n                {\n                    public void Method(ILogger logger, string message)\n                    {\n                        try { }\n                        catch (ArgumentException e)                     // Noncompliant\n                        {\n                            logger.Debug(e, message);                   // Secondary\n                            throw;                                      // Secondary\n                        }\n                        catch (Exception e)                             // Noncompliant\n                        {\n                            ILoggerExtensions.Warn(logger, e, null);    // Secondary\n                            throw;                                      // Secondary\n                        }\n                    }\n                }\n                \"\"\")\n            .AddReferences(NuGetMetadataReference.NLog())\n            .Verify();\n\n    [TestMethod]\n    public void ExceptionsShouldBeLoggedOrThrown_CastleCore_CS() =>\n        builder\n            .AddSnippet(\"\"\"\n                using System;\n                using Castle.Core.Logging;\n\n                public class Program\n                {\n                    public void Method(ILogger logger, string message)\n                    {\n                        try { }\n                        catch (Exception e)                 // Noncompliant\n                        {\n                            logger.Debug(message, e);       // Secondary\n                            throw;                          // Secondary\n                        }\n                    }\n                }\n                \"\"\")\n            .AddReferences(NuGetMetadataReference.CastleCore())\n            .Verify();\n\n    [TestMethod]\n    public void ExceptionsShouldBeLoggedOrThrown_CommonLogging_CS() =>\n        builder\n            .AddSnippet(\"\"\"\n                using System;\n                using Common.Logging;\n\n                public class Program\n                {\n                    public void Method(ILog logger, string message)\n                    {\n                        try { }\n                        catch (Exception e)                 // Noncompliant\n                        {\n                            logger.Debug(message, e);       // Secondary\n                            throw;                          // Secondary\n                        }\n                    }\n                }\n                \"\"\")\n            .AddReferences(NuGetMetadataReference.CommonLoggingCore())\n            .Verify();\n\n    [TestMethod]\n    public void ExceptionsShouldBeLoggedOrThrown_Serilog_CS() =>\n        builder\n            .AddSnippet(\"\"\"\n                using System;\n                using Serilog;\n\n                public class Program\n                {\n                    public void Method(ILogger logger, string message)\n                    {\n                        try { }\n                        catch (AggregateException e)        // Noncompliant\n                        {\n                            Log.Debug(e, message);          // Secondary\n                            throw;                          // Secondary\n                        }\n                        catch (Exception e)                 // Noncompliant\n                        {\n                            logger.Debug(e, message);       // Secondary\n                            throw;                          // Secondary\n                        }\n                    }\n                }\n                \"\"\")\n            .AddReferences(NuGetMetadataReference.Serilog())\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ExceptionsShouldBeLoggedTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ExceptionsShouldBeLoggedTest\n{\n    private const string EventIdParameter = \"new EventId(1),\";\n    private const string LogLevelParameter = \"LogLevel.Warning,\";\n    private const string NoParameter = \"\";\n    private readonly VerifierBuilder builder = new VerifierBuilder<ExceptionsShouldBeLogged>();\n\n    [TestMethod]\n    public void ExceptionsShouldBeLogged_CS() =>\n        builder\n            .AddPaths(\"ExceptionsShouldBeLogged.cs\")\n            .AddReferences(NuGetMetadataReference.MicrosoftExtensionsLoggingAbstractions())\n            .Verify();\n\n    [TestMethod]\n    [DataRow(\"Log\", LogLevelParameter)]\n    [DataRow(\"Log\", LogLevelParameter, EventIdParameter)]\n    [DataRow(\"LogCritical\")]\n    [DataRow(\"LogCritical\", NoParameter, EventIdParameter)]\n    [DataRow(\"LogDebug\")]\n    [DataRow(\"LogDebug\", NoParameter, EventIdParameter)]\n    [DataRow(\"LogError\")]\n    [DataRow(\"LogError\", NoParameter, EventIdParameter)]\n    [DataRow(\"LogInformation\")]\n    [DataRow(\"LogInformation\", NoParameter, EventIdParameter)]\n    [DataRow(\"LogTrace\")]\n    [DataRow(\"LogTrace\", NoParameter, EventIdParameter)]\n    [DataRow(\"LogWarning\")]\n    [DataRow(\"LogWarning\", NoParameter, EventIdParameter)]\n    public void ExceptionsShouldBeLogged_MicrosoftExtensionsLogging_NonCompliant_CS(string methodName, string logLevel = \"\", string eventId = \"\") =>\n        builder.AddSnippet($$\"\"\"\n            using System;\n            using Microsoft.Extensions.Logging;\n            using Microsoft.Extensions.Logging.Abstractions;\n\n            public class Program\n            {\n                public void Method(ILogger logger, string message)\n                {\n                    try { }\n                    catch (Exception e)\n                    {\n                        logger.{{methodName}}({{logLevel}} {{eventId}} message);                        // Noncompliant\n                    }\n                    try { }\n                    catch (Exception e)\n                    {\n                        logger.{{methodName}}({{logLevel}} {{eventId}} e, message);                     // Compliant\n                    }\n                    try { }\n                    catch (Exception e)\n                    {\n                        LoggerExtensions.{{methodName}}(logger, {{logLevel}} {{eventId}} message);      // Noncompliant\n                    }\n                    try { }\n                    catch (Exception e)\n                    {\n                        LoggerExtensions.{{methodName}}(logger, {{logLevel}}{{eventId}} e, message);    // Compliant\n                    }\n                }\n            }\n            \"\"\")\n           .AddReferences(NuGetMetadataReference.MicrosoftExtensionsLoggingAbstractions())\n           .Verify();\n\n    [TestMethod]\n    [DataRow(\"Error\")]\n    [DataRow(\"Debug\")]\n    [DataRow(\"Fatal\")]\n    [DataRow(\"Info\")]\n    [DataRow(\"Trace\")]\n    [DataRow(\"Warn\")]\n    // https://github.com/castleproject/Core/blob/dca4ed09df545dd7512c82778127219795668d30/src/Castle.Core/Core/Logging/ILogger.cs\n    public void ExceptionsShouldBeLogged_CastleCore_CS(string methodName) =>\n        builder.AddSnippet($$\"\"\"\n            using System;\n            using System.Globalization;\n            using Castle.Core.Logging;\n\n            public class Program\n            {\n                public void Method(ILogger logger, string message)\n                {\n                    try { }\n                    catch (Exception e)\n                    {\n                        logger.{{methodName}}(message);                                     // Noncompliant\n                        logger.{{methodName}}Format(message);                               // Secondary\n                        logger.{{methodName}}Format(CultureInfo.CurrentCulture, message);   // Secondary\n                    }\n                    try { }\n                    catch (Exception e)\n                    {\n                        logger.{{methodName}}(message, e);                                     // Compliant\n                        logger.{{methodName}}Format(e, message);                               // Compliant\n                        logger.{{methodName}}Format(e, CultureInfo.CurrentCulture, message);   // Compliant\n                    }\n                }\n            }\n            \"\"\")\n           .AddReferences(NuGetMetadataReference.CastleCore())\n           .Verify();\n\n    [TestMethod]\n    [DataRow(\"Error\")]\n    [DataRow(\"Debug\")]\n    [DataRow(\"Fatal\")]\n    [DataRow(\"Info\")]\n    [DataRow(\"Trace\")]\n    [DataRow(\"Warn\")]\n    // https://www.fuget.org/packages/Common.Logging.Core/3.4.1/lib/netstandard1.0/Common.Logging.Core.dll/Common.Logging/ILog\n    public void ExceptionsShouldBeLogged_CommonLoggingCore_CS(string methodName) =>\n        builder.AddSnippet($$\"\"\"\n            using System;\n            using System.Globalization;\n            using Common.Logging;\n\n            public class Program\n            {\n                public void Method(ILog logger, string message)\n                {\n                    try { }\n                    catch (Exception e)\n                    {\n                        logger.{{methodName}}(\"Message\");                                           // Noncompliant\n                        logger.{{methodName}}(_ => { });                                            // Secondary\n                        logger.{{methodName}}(CultureInfo.CurrentCulture, _ => { });                // Secondary\n                        logger.{{methodName}}Format(\"Message\");                                     // Secondary\n                        logger.{{methodName}}Format(CultureInfo.CurrentCulture, \"Message\");         // Secondary\n                    }\n                    try { }\n                    catch (Exception e)\n                    {\n                        logger.{{methodName}}(\"Message\", e);\n                        logger.{{methodName}}(_ => { }, e);\n                        logger.{{methodName}}(CultureInfo.CurrentCulture, _ => { }, e);\n                        logger.{{methodName}}Format(\"Message\", e);\n                        logger.{{methodName}}Format(CultureInfo.CurrentCulture, \"Message\", e);\n                    }\n                }\n            }\n            \"\"\")\n            .AddReferences(NuGetMetadataReference.CommonLoggingCore())\n            .Verify();\n\n    [TestMethod]\n    [DataRow(\"Debug\")]\n    [DataRow(\"Error\")]\n    [DataRow(\"Fatal\")]\n    [DataRow(\"Info\")]\n    [DataRow(\"Warn\")]\n    // https://logging.apache.org/log4net/release/sdk/html/T_log4net_ILog.htm\n    public void ExceptionsShouldBeLogged_Log4net_CS(string methodName) =>\n        builder.AddSnippet($$\"\"\"\n            using System;\n            using System.Globalization;\n            using log4net;\n            using log4net.Util;\n\n            public class Program\n            {\n                public void Method(ILog logger, string message)\n                {\n                    try { }\n                    catch (Exception e)\n                    {\n                        logger.{{methodName}}(message);                                     // Noncompliant\n                        logger.{{methodName}}Ext(message);                                  // Secondary\n                        ILogExtensions.{{methodName}}Ext(logger, message);                  // Secondary\n                        logger.{{methodName}}Format(message);                               // Compliant - Format overloads do not take an exception.\n                        logger.{{methodName}}Format(CultureInfo.CurrentCulture, message);   // Compliant - Format overloads do not take an exception.\n                    }\n                    try { }\n                    catch (Exception e)\n                    {\n                        logger.{{methodName}}(message, e);                                  // Compliant\n                        logger.{{methodName}}Ext(message, e);                               // Compliant\n                        ILogExtensions.{{methodName}}Ext(logger, message, e);               // Compliant\n                    }\n                }\n            }\n            \"\"\")\n            .AddReferences(NuGetMetadataReference.Log4Net(\"3.0.1\", \"netstandard2.0\")) // After 3.0.2 they removed ILogExtensions.\n            .Verify();\n\n    [TestMethod]\n    [DataRow(\"ILogger\", \"Debug\")]\n    [DataRow(\"ILogger\", \"Error\")]\n    [DataRow(\"ILogger\", \"Fatal\")]\n    [DataRow(\"ILogger\", \"Info\")]\n    [DataRow(\"ILogger\", \"Trace\")]\n    [DataRow(\"ILogger\", \"Warn\")]\n    [DataRow(\"Logger\", \"Debug\")]\n    [DataRow(\"Logger\", \"Error\")]\n    [DataRow(\"Logger\", \"Fatal\")]\n    [DataRow(\"Logger\", \"Info\")]\n    [DataRow(\"Logger\", \"Trace\")]\n    [DataRow(\"Logger\", \"Warn\")]\n    // https://nlog-project.org/documentation/v5.0.0/html/Methods_T_NLog_Logger.htm\n    public void ExceptionsShouldBeLogged_NLog_CS(string type, string methodName) =>\n        builder.AddSnippet($$\"\"\"\n            using System;\n            using System.Globalization;\n            using NLog;\n\n            public class Program\n            {\n                public void Method({{type}} logger, string message, Object[] parameters)\n                {\n                    try { }\n                    catch (Exception e)\n                    {\n                        logger.{{methodName}}(\"Message\");                               // Noncompliant\n                        logger.{{methodName}}(\"Message\", parameters);                   // Secondary\n                        logger.{{methodName}}(CultureInfo.CurrentCulture, \"Message\");   // Secondary\n                        ILoggerExtensions.{{methodName}}(logger, null, null);           // Secondary\n                    }\n                    try { }\n                    catch (Exception e)\n                    {\n                        logger.{{methodName}}(e, \"Message\");\n                        logger.{{methodName}}(e, \"Message\", parameters);\n                        logger.{{methodName}}(e, CultureInfo.CurrentCulture, \"Message\");\n                        ILoggerExtensions.{{methodName}}(logger, null, null);\n                    }\n                }\n            }\n            \"\"\")\n           .AddReferences(NuGetMetadataReference.NLog())\n           .Verify();\n\n    [TestMethod]\n    public void ExceptionsShouldBeLogged_NLog_ILoggerBase_CS() =>\n        builder.AddSnippet(\"\"\"\n            using System;\n            using System.Globalization;\n            using NLog;\n\n            public class Program\n            {\n                public void Method(ILoggerBase logger, string message, Object[] parameters)\n                {\n                    try { }\n                    catch (Exception e)\n                    {\n                        logger.Log(LogLevel.Debug, \"Message\");                                          // Noncompliant\n                        logger.Log(LogLevel.Debug, CultureInfo.CurrentCulture, \"Message\");              // Secondary\n                        logger.Log<string>(LogLevel.Debug, \"Message\");                                  // Secondary\n                        logger.Log<string>(LogLevel.Debug, CultureInfo.CurrentCulture, \"Message\");      // Secondary\n                    }\n                    try { }\n                    catch (Exception e)\n                    {\n                        logger.Log(LogLevel.Debug, e, \"Message\");\n                        logger.Log(LogLevel.Debug, CultureInfo.CurrentCulture, \"Message\");\n                        logger.Log<string>(LogLevel.Debug, \"Message\");\n                        logger.Log<string>(LogLevel.Debug, CultureInfo.CurrentCulture, \"Message\");\n                    }\n                }\n            }\n            \"\"\")\n           .AddReferences(NuGetMetadataReference.NLog())\n           .Verify();\n\n    [TestMethod]\n    [DataRow(\"ConditionalDebug\")]\n    [DataRow(\"ConditionalTrace\")]\n    // https://nlog-project.org/documentation/v5.0.0/html/Methods_T_NLog_Logger.htm\n    public void ExceptionsShouldBeLogged_NLog_Conditional_CS(string methodName) =>\n        builder.AddSnippet($$\"\"\"\n            using System;\n            using System.Globalization;\n            using NLog;\n\n            public class Program\n            {\n                public void Method(Logger logger, string message, Object[] parameters)\n                {\n                    try { }\n                    catch (Exception e)\n                    {\n                        logger.{{methodName}}(\"Message\");                               // Noncompliant\n                        logger.{{methodName}}(CultureInfo.CurrentCulture, \"Message\");   // Secondary\n                        ILoggerExtensions.{{methodName}}(logger, \"Message\");            // Secondary\n                    }\n                    try { }\n                    catch (Exception e)\n                    {\n                        logger.{{methodName}}(e, \"Message\");\n                        logger.{{methodName}}(e, CultureInfo.CurrentCulture, \"Message\");\n                        ILoggerExtensions.{{methodName}}(logger, e, \"Message\");\n                    }\n                }\n            }\n            \"\"\")\n           .AddReferences(NuGetMetadataReference.NLog())\n           .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ExceptionsShouldBePublicTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ExceptionsShouldBePublicTest\n{\n    [TestMethod]\n    public void ExceptionsShouldBePublic_CS() =>\n        new VerifierBuilder<CS.ExceptionsShouldBePublic>()\n            .AddPaths(\"ExceptionsShouldBePublic.cs\")\n            .Verify();\n\n    [TestMethod]\n    public void ExceptionsShouldBePublic_VB() =>\n        new VerifierBuilder<VB.ExceptionsShouldBePublic>()\n            .AddPaths(\"ExceptionsShouldBePublic.vb\")\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ExceptionsShouldBeUsedTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class ExceptionsShouldBeUsedTest\n    {\n        [TestMethod]\n        public void ExceptionsShouldBeUsed() =>\n            new VerifierBuilder<ExceptionsShouldBeUsed>().AddPaths(\"ExceptionsShouldBeUsed.cs\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ExcludeFromCodeCoverageAttributesNeedJustificationTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ExcludeFromCodeCoverageAttributesNeedJustificationTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.ExcludeFromCodeCoverageAttributesNeedJustification>();\n\n#if NET\n\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.ExcludeFromCodeCoverageAttributesNeedJustification>();\n\n    [TestMethod]\n    public void ExcludeFromCodeCoverageAttributesNeedJustification_OnAssembly_CS() =>\n        builderCS.AddSnippet(\"[assembly:System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] // Noncompliant\").Verify();\n\n    [TestMethod]\n    public void ExcludeFromCodeCoverageAttributesNeedJustification_OnAssembly_VB() =>\n        builderVB.AddSnippet(\"<Assembly:System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage> ' Noncompliant\").Verify();\n\n    [TestMethod]\n    public void ExcludeFromCodeCoverageAttributesNeedJustification_CS() =>\n       builderCS.AddPaths(\"ExcludeFromCodeCoverageAttributesNeedJustification.cs\").Verify();\n\n    [TestMethod]\n    public void ExcludeFromCodeCoverageAttributesNeedJustification_CSharp9() =>\n        builderCS.AddPaths(\"ExcludeFromCodeCoverageAttributesNeedJustification.CSharp9.cs\").WithTopLevelStatements().Verify();\n\n    [TestMethod]\n    public void ExcludeFromCodeCoverageAttributesNeedJustification_CSharp10() =>\n        builderCS.AddPaths(\"ExcludeFromCodeCoverageAttributesNeedJustification.CSharp10.cs\").WithOptions(LanguageOptions.FromCSharp10).Verify();\n\n    [TestMethod]\n    public void ExcludeFromCodeCoverageAttributesNeedJustification_VB() =>\n        builderVB.AddPaths(\"ExcludeFromCodeCoverageAttributesNeedJustification.vb\").Verify();\n\n#else\n\n    [TestMethod]\n    public void ExcludeFromCodeCoverageAttributesNeedJustification_IgnoredForNet48() =>\n        builderCS.AddPaths(\"ExcludeFromCodeCoverageAttributesNeedJustification.Net48.cs\").Verify();\n\n#endif\n\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ExitStatementUsageTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ExitStatementUsageTest\n{\n    [TestMethod]\n    public void ExitStatementUsage() =>\n        new VerifierBuilder<ExitStatementUsage>().AddPaths(\"ExitStatementUsage.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ExpectedExceptionAttributeShouldNotBeUsedTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing static SonarAnalyzer.TestFramework.MetadataReferences.NugetPackageVersions;\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ExpectedExceptionAttributeShouldNotBeUsedTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.ExpectedExceptionAttributeShouldNotBeUsed>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.ExpectedExceptionAttributeShouldNotBeUsed>();\n\n    [TestMethod]\n    [DataRow(MsTest.Ver11)]\n    [DataRow(MsTest.Ver311)]\n    // Removed in V4 https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-mstest-migration-v3-v4#expectedexceptionattribute-api-is-removed\n    public void ExpectedExceptionAttributeShouldNotBeUsed_MsTest_CS(string testFwkVersion) =>\n        builderCS.AddPaths(\"ExpectedExceptionAttributeShouldNotBeUsed.MsTest.cs\")\n            .AddReferences(NuGetMetadataReference.MSTestTestFramework(testFwkVersion))\n            .Verify();\n\n    [TestMethod]\n    [DataRow(NUnit.Ver25)] // Lowest NUnit version available\n    [DataRow(NUnit.Ver27)] // Latest version of NUnit that contains the attribute\n    public void ExpectedExceptionAttributeShouldNotBeUsed_NUnit_CS(string testFwkVersion) =>\n        builderCS.AddPaths(\"ExpectedExceptionAttributeShouldNotBeUsed.NUnit.cs\")\n            .AddReferences(NuGetMetadataReference.NUnit(testFwkVersion))\n            .Verify();\n\n    [TestMethod]\n    [DataRow(\"3.0.0\")]\n    [DataRow(TestConstants.NuGetLatestVersion)]\n    [Description(\"Starting with version 3.0.0 the attribute was removed.\")]\n    public void ExpectedExceptionAttributeShouldNotBeUsed_NUnit_NoIssue_CS(string testFwkVersion) =>\n        builderCS.AddPaths(\"ExpectedExceptionAttributeShouldNotBeUsed.NUnit.cs\")\n            .AddReferences(NuGetMetadataReference.NUnit(testFwkVersion))\n            .WithErrorBehavior(CompilationErrorBehavior.Ignore)\n            .VerifyNoIssues();\n\n    [TestMethod]\n    [DataRow(MsTest.Ver11)]\n    [DataRow(MsTest.Ver311)]\n    public void ExpectedExceptionAttributeShouldNotBeUsed_MsTest_VB(string testFwkVersion) =>\n        builderVB.AddPaths(\"ExpectedExceptionAttributeShouldNotBeUsed.MsTest.vb\")\n            .AddReferences(NuGetMetadataReference.MSTestTestFramework(testFwkVersion))\n            .Verify();\n\n    [TestMethod]\n    [DataRow(\"2.5.7.10213\")]\n    [DataRow(\"2.6.7\")]\n    public void ExpectedExceptionAttributeShouldNotBeUsed_NUnit_VB(string testFwkVersion) =>\n        builderVB.AddPaths(\"ExpectedExceptionAttributeShouldNotBeUsed.NUnit.vb\")\n            .AddReferences(NuGetMetadataReference.NUnit(testFwkVersion))\n            .Verify();\n\n    [TestMethod]\n    [DataRow(\"3.0.0\")]\n    [DataRow(TestConstants.NuGetLatestVersion)]\n    [Description(\"Starting with version 3.0.0 the attribute was removed.\")]\n    public void ExpectedExceptionAttributeShouldNotBeUsed_NUnit_NoIssue_VB(string testFwkVersion) =>\n        builderVB.AddPaths(\"ExpectedExceptionAttributeShouldNotBeUsed.NUnit.vb\")\n            .AddReferences(NuGetMetadataReference.NUnit(testFwkVersion))\n            .WithErrorBehavior(CompilationErrorBehavior.Ignore)\n            .VerifyNoIssues();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ExpressionComplexityTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ExpressionComplexityTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder().AddAnalyzer(() => new CS.ExpressionComplexity { Maximum = 3 });\n\n    [TestMethod]\n    public void ExpressionComplexity_CSharp8() =>\n        builderCS.AddPaths(\"ExpressionComplexity.cs\")\n            .WithOptions(LanguageOptions.FromCSharp8)\n            .Verify();\n\n    [TestMethod]\n    [DataRow(\"==\")]\n    [DataRow(\"!=\")]\n    [DataRow(\"<\")]\n    [DataRow(\"<=\")]\n    [DataRow(\">\")]\n    [DataRow(\">=\")]\n    public void ExpressionComplexity_TransparentComparissionOperators(string @operator) =>\n        builderCS.AddSnippet($$$\"\"\"\n            class C\n            {\n                public void M()\n                {\n                    var x = true && true && (1 {{{@operator}}} (true ? 1 : 1));         // Compliant (Make sure, the @operator is not increasing complexity)\n                    var y = true && true && true && (1 {{{@operator}}} (true ? 1 : 1)); // Noncompliant {{Reduce the number of conditional operators (4) used in the expression (maximum allowed 3).}}\n                }\n            }\n            \"\"\")\n        .Verify();\n\n    [TestMethod]\n    [DataRow(\"o\", \"??\")]\n    [DataRow(\"i\", \"|\")]\n    [DataRow(\"i\", \"^\")]\n    [DataRow(\"i\", \"&\")]\n    [DataRow(\"i\", \">>\")]\n\n    [DataRow(\"i\", \">>>\")]\n\n    [DataRow(\"i\", \"<<\")]\n    [DataRow(\"i\", \"+\")]\n    [DataRow(\"i\", \"-\")]\n    [DataRow(\"i\", \"*\")]\n    [DataRow(\"i\", \"/\")]\n    [DataRow(\"i\", \"%\")]\n    public void ExpressionComplexity_TransparentBinaryOperators(string parameter, string @operator) =>\n        builderCS.AddSnippet($$\"\"\"\n            class C\n            {\n                public void M(int i, object o)\n                {\n                    var x = true && true && (({{parameter}} {{@operator}} (true ? {{parameter}} : {{parameter}})) == {{parameter}});         // Compliant\n                    var y = true && true && true && (({{parameter}} {{@operator}} (true ? {{parameter}} : {{parameter}})) == {{parameter}}); // Noncompliant\n                }\n            }\n            \"\"\")\n\n        .WithOptions(LanguageOptions.FromCSharp11)\n\n        .Verify();\n\n    [TestMethod]\n    public void ExpressionComplexity_CSharp9() =>\n        builderCS.AddPaths(\"ExpressionComplexity.CSharp9.cs\")\n            .WithTopLevelStatements()\n            .Verify();\n\n    [TestMethod]\n    public void ExpressionComplexity_CSharp10() =>\n        builderCS.AddPaths(\"ExpressionComplexity.CSharp10.cs\")\n            .WithTopLevelStatements()\n            .WithOptions(LanguageOptions.FromCSharp10)\n            .Verify();\n\n    [TestMethod]\n    public void ExpressionComplexity_CSharp11() =>\n        builderCS.AddPaths(\"ExpressionComplexity.CSharp11.cs\")\n            .WithTopLevelStatements()\n            .WithOptions(LanguageOptions.FromCSharp11)\n            .Verify();\n\n    [TestMethod]\n    public void ExpressionComplexity_VB() =>\n        new VerifierBuilder().AddAnalyzer(() => new VB.ExpressionComplexity { Maximum = 3 }).AddPaths(\"ExpressionComplexity.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ExtensionMethodShouldBeInSeparateNamespaceTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class ExtensionMethodShouldBeInSeparateNamespaceTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<ExtensionMethodShouldBeInSeparateNamespace>();\n\n        [TestMethod]\n        public void ExtensionMethodShouldBeInSeparateNamespace() =>\n            builder\n                .AddPaths(\"ExtensionMethodShouldBeInSeparateNamespace.cs\", \"ExtensionMethodShouldBeInSeparateNamespace.GeneratedCode.cs\")\n                .Verify();\n\n        [TestMethod]\n        public void ExtensionMethodShouldBeInSeparateNamespace_CSharp9() =>\n            builder.AddPaths(\"ExtensionMethodShouldBeInSeparateNamespace.CSharp9.cs\").WithTopLevelStatements().Verify();\n\n        [TestMethod]\n        public void ExtensionMethodShouldBeInSeparateNamespace_CSharp10() =>\n            builder\n                .AddPaths(\"ExtensionMethodShouldBeInSeparateNamespace.CSharp10.cs\")\n                .WithConcurrentAnalysis(false)\n                .WithOptions(LanguageOptions.FromCSharp10)\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ExtensionMethodShouldNotExtendObjectTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ExtensionMethodShouldNotExtendObjectTest\n{\n    [TestMethod]\n    public void ExtensionMethodShouldNotExtendObject_CS() =>\n        new VerifierBuilder<CS.ExtensionMethodShouldNotExtendObject>()\n        .AddPaths(\"ExtensionMethodShouldNotExtendObject.cs\")\n        .Verify();\n\n    [TestMethod]\n    public void ExtensionMethodShouldNotExtendObject_VB() =>\n        new VerifierBuilder<VB.ExtensionMethodShouldNotExtendObject>()\n        .AddPaths(\"ExtensionMethodShouldNotExtendObject.vb\")\n        .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/FieldShadowsParentFieldTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class FieldShadowsParentFieldTest\n    {\n        private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.FieldShadowsParentField>();\n        private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.FieldShadowsParentField>();\n\n        [TestMethod]\n        public void FieldShadowsParentField_CS() =>\n            builderCS.AddPaths(\"FieldShadowsParentField.cs\").Verify();\n\n        [TestMethod]\n        public void FieldShadowsParentField_VB() =>\n            builderVB.AddPaths(\"FieldShadowsParentField.vb\").Verify();\n\n        [TestMethod]\n        public void FieldShadowsParentField_DoesNotRaiseIssuesForTestProject_CS() =>\n            builderCS.AddPaths(\"FieldShadowsParentField.cs\")\n                .AddTestReference()\n                .VerifyNoIssues();\n\n        [TestMethod]\n        public void FieldShadowsParentField_DoesNotRaiseIssuesForTestProject_VB() =>\n            builderVB.AddPaths(\"FieldShadowsParentField.vb\")\n                .AddTestReference()\n                .VerifyNoIssues();\n\n        [TestMethod]\n        public void FieldShadowsParentField_CSharp9() =>\n            builderCS.AddPaths(\"FieldShadowsParentField.CSharp9.cs\")\n                .WithOptions(LanguageOptions.FromCSharp9)\n                .Verify();\n\n        [TestMethod]\n        public void FieldsShouldNotDifferByCapitalization_CShar9() =>\n            builderCS.AddPaths(\"FieldsShouldNotDifferByCapitalization.CSharp9.cs\")\n                .WithOptions(LanguageOptions.FromCSharp9)\n                .Verify();\n\n        [TestMethod]\n        [DataRow(ProjectType.Product)]\n        [DataRow(ProjectType.Test)]\n        public void FieldsShouldNotDifferByCapitalization_CS(ProjectType projectType) =>\n            builderCS.AddPaths(\"FieldsShouldNotDifferByCapitalization.cs\")\n                .AddReferences(TestCompiler.ProjectTypeReference(projectType))\n                .Verify();\n\n        [TestMethod]\n        [DataRow(ProjectType.Product)]\n        [DataRow(ProjectType.Test)]\n        public void FieldsShouldNotDifferByCapitalization_VB(ProjectType projectType) =>\n            builderVB.AddPaths(\"FieldsShouldNotDifferByCapitalization.vb\")\n                .AddReferences(TestCompiler.ProjectTypeReference(projectType))\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/FieldShouldBeReadonlyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class FieldShouldBeReadonlyTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<FieldShouldBeReadonly>();\n\n        [TestMethod]\n        public void FieldShouldBeReadonly() =>\n            builder.AddPaths(\"FieldShouldBeReadonly.cs\").WithOptions(LanguageOptions.FromCSharp8).Verify();\n\n        [TestMethod]\n        public void FieldShouldBeReadonly_Latest() =>\n            builder.AddPaths(\"FieldShouldBeReadonly.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n        [TestMethod]\n        public void FieldShouldBeReadonly_CodeFix() =>\n            builder.WithOptions(LanguageOptions.FromCSharp8)\n                .AddPaths(\"FieldShouldBeReadonly.cs\")\n                .WithCodeFixedPaths(\"FieldShouldBeReadonly.Fixed.cs\")\n                .WithCodeFix<FieldShouldBeReadonlyCodeFix>()\n                .VerifyCodeFix();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/FieldShouldNotBePublicTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class FieldShouldNotBePublicTest\n    {\n        private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.FieldShouldNotBePublic>();\n        private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.FieldShouldNotBePublic>();\n\n        [TestMethod]\n        public void FieldShouldNotBePublic_CS() =>\n            builderCS.AddPaths(\"FieldShouldNotBePublic.cs\").Verify();\n\n        [TestMethod]\n        public void FieldShouldNotBePublic_CS_CSharp9() =>\n            builderCS.AddPaths(\"FieldShouldNotBePublic.CSharp9.cs\").WithOptions(LanguageOptions.FromCSharp9).Verify();\n\n        [TestMethod]\n        public void FieldShouldNotBePublic_VB() =>\n            builderVB.AddPaths(\"FieldShouldNotBePublic.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/FieldsShouldBeEncapsulatedInPropertiesTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class FieldsShouldBeEncapsulatedInPropertiesTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<FieldsShouldBeEncapsulatedInProperties>();\n\n    [TestMethod]\n    public void FieldsShouldBeEncapsulatedInProperties() =>\n        builder.AddPaths(\"FieldsShouldBeEncapsulatedInProperties.cs\").Verify();\n\n    [TestMethod]\n    public void FieldsShouldBeEncapsulatedInProperties_Unity3D_Ignored() =>\n        builder.AddPaths(\"FieldsShouldBeEncapsulatedInProperties.Unity3D.cs\")\n            // Concurrent analysis puts fake Unity3D class into the Concurrent namespace\n            .WithConcurrentAnalysis(false)\n            .Verify();\n\n    [TestMethod]\n    public void FieldsShouldBeEncapsulatedInProperties_CSharp9() =>\n        builder.AddPaths(\"FieldsShouldBeEncapsulatedInProperties.CSharp9.cs\")\n            .WithOptions(LanguageOptions.FromCSharp9)\n            .Verify();\n\n    [TestMethod]\n    public void FieldsShouldBeEncapsulatedInProperties_CSharp12() =>\n        builder.AddPaths(\"FieldsShouldBeEncapsulatedInProperties.CSharp12.cs\")\n            .WithOptions(LanguageOptions.FromCSharp12)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/FileLinesTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class FileLinesTest\n    {\n        [TestMethod]\n        public void FileLines_CS() =>\n            new VerifierBuilder().AddAnalyzer(() => new CS.FileLines { Maximum = 10 }).AddPaths(\"FileLines20.cs\", \"FileLines9.cs\").WithAutogenerateConcurrentFiles(false).Verify();\n\n        [TestMethod]\n        public void FileLines_VB() =>\n            new VerifierBuilder().AddAnalyzer(() => new VB.FileLines { Maximum = 10 })\n                .AddPaths(\"FileLines20.vb\", \"FileLines9.vb\")\n                .WithAutogenerateConcurrentFiles(false)\n                .WithOptions(LanguageOptions.FromVisualBasic14)\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/FileShouldEndWithEmptyNewLineTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class FileShouldEndWithEmptyNewLineTest\n    {\n        [TestMethod]\n        public void FileShouldEndWithEmptyNewLine() =>\n            new VerifierBuilder<FileShouldEndWithEmptyNewLine>().AddPaths(\n                    \"FileShouldEndWithEmptyNewLine_EmptyLine.cs\",\n                    \"FileShouldEndWithEmptyNewLine_NoEmptyLine.cs\",\n                    \"FileShouldEndWithEmptyNewLine_EmptyFile.cs\")\n                .WithAutogenerateConcurrentFiles(false)\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/FinalizerShouldNotBeEmptyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class FinalizerShouldNotBeEmptyTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<FinalizerShouldNotBeEmpty>();\n\n        [TestMethod]\n        public void FinalizerShouldNotBeEmpty() =>\n            builder.AddPaths(\"FinalizerShouldNotBeEmpty.cs\").Verify();\n\n        [TestMethod]\n        public void FinalizerShouldNotBeEmpty_CSharp9() =>\n            builder.AddPaths(\"FinalizerShouldNotBeEmpty.CSharp9.cs\")\n                .WithOptions(LanguageOptions.FromCSharp9)\n                .Verify();\n\n        [TestMethod]\n        public void FinalizerShouldNotBeEmpty_InvalidCode() =>\n            builder.AddSnippet(\"\"\"\n                class Program4\n                {\n                    ~Program4() =>\n                }\n                \"\"\")\n                .VerifyNoIssuesIgnoreErrors();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/FindInsteadOfFirstOrDefaultTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class FindInsteadOfFirstOrDefaultTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.FindInsteadOfFirstOrDefault>().WithConcurrentAnalysis(false);\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.FindInsteadOfFirstOrDefault>();\n\n    [TestMethod]\n    public void FindInsteadOfFirstOrDefault_CS() =>\n        builderCS.AddPaths(\"FindInsteadOfFirstOrDefault.cs\").AddReferences(GetReferencesEntityFrameworkNetCore(\"7.0.5\")).Verify();\n\n    internal static IEnumerable<MetadataReference> GetReferencesEntityFrameworkNetCore(string entityFrameworkVersion) =>\n        Enumerable.Empty<MetadataReference>()\n            .Concat(NuGetMetadataReference.MicrosoftEntityFrameworkCore(entityFrameworkVersion))\n            .Concat(NuGetMetadataReference.MicrosoftEntityFrameworkCoreRelational(entityFrameworkVersion));\n\n#if NET\n\n    [TestMethod]\n    public void FindInsteadOfFirstOrDefault_Immutable_CS() =>\n        builderCS.AddPaths(\"FindInsteadOfFirstOrDefault.Immutable.cs\").AddReferences(MetadataReferenceFacade.SystemCollections).Verify();\n\n    [TestMethod]\n    public void FindInsteadOfFirstOrDefault_Net_CS() =>\n        builderCS.AddPaths(\"FindInsteadOfFirstOrDefault.Net.cs\").Verify();\n\n    [TestMethod]\n    public void FindInsteadOfFirstOrDefault_Net_VB() =>\n        builderVB.AddPaths(\"FindInsteadOfFirstOrDefault.Net.vb\").Verify();\n\n#endif\n\n    [TestMethod]\n    public void FindInsteadOfFirstOrDefault_Array_CS() =>\n        builderCS.AddPaths(\"FindInsteadOfFirstOrDefault.Array.cs\").Verify();\n\n    [TestMethod]\n    public void FindInsteadOfFirstOrDefault_VB() =>\n        builderVB.AddPaths(\"FindInsteadOfFirstOrDefault.vb\").WithOptions(LanguageOptions.FromVisualBasic14).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/FlagsEnumWithoutInitializerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class FlagsEnumWithoutInitializerTest\n    {\n        [TestMethod]\n        public void FlagsEnumWithoutInitializer_CS() =>\n            new VerifierBuilder<CS.FlagsEnumWithoutInitializer>().AddPaths(\"FlagsEnumWithoutInitializer.cs\").Verify();\n\n        [TestMethod]\n        public void FlagsEnumWithoutInitializer_VB() =>\n            new VerifierBuilder<VB.FlagsEnumWithoutInitializer>().AddPaths(\"FlagsEnumWithoutInitializer.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/FlagsEnumZeroMemberTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class FlagsEnumZeroMemberTest\n    {\n        [TestMethod]\n        public void FlagsEnumZeroMember_CS() =>\n            new VerifierBuilder<CS.FlagsEnumZeroMember>().AddPaths(\"FlagsEnumZeroMember.cs\").Verify();\n\n        [TestMethod]\n        public void FlagsEnumZeroMember_VB() =>\n            new VerifierBuilder<VB.FlagsEnumZeroMember>().AddPaths(\"FlagsEnumZeroMember.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ForLoopConditionAlwaysFalseTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class ForLoopConditionAlwaysFalseTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<ForLoopConditionAlwaysFalse>();\n\n        [TestMethod]\n        public void ForLoopConditionAlwaysFalse() =>\n            builder.AddPaths(\"ForLoopConditionAlwaysFalse.cs\").Verify();\n\n        [TestMethod]\n        public void ForLoopConditionAlwaysFalse_CSharp9() =>\n            builder.AddPaths(\"ForLoopConditionAlwaysFalse.CSharp9.cs\").WithOptions(LanguageOptions.FromCSharp9).Verify();\n\n        [TestMethod]\n        public void ForLoopConditionAlwaysFalse_CSharp11() =>\n            builder.AddPaths(\"ForLoopConditionAlwaysFalse.CSharp11.cs\").WithOptions(LanguageOptions.FromCSharp11).Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ForLoopCounterChangedTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ForLoopCounterChangedTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<ForLoopCounterChanged>();\n\n    [TestMethod]\n    public void ForLoopCounterChanged() =>\n        builder.AddPaths(\"ForLoopCounterChanged.cs\").Verify();\n\n    [TestMethod]\n    public void ForLoopCounterChanged_CS_Latest() =>\n        builder.AddPaths(\"ForLoopCounterChanged.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    [CombinatorialData]\n    public void ForLoopCounterChanged_VariableUsage(\n        [CombinatorialValues(true, false)] bool inInitializer,\n        [CombinatorialValues(true, false)] bool inCondition,\n        [CombinatorialValues(true, false)] bool inIncrementor)\n    {\n        var initializer = inInitializer ? \"i = 0\" : string.Empty;\n        var condition = inCondition ? \"i < 10\" : string.Empty;\n        var incrementor = inIncrementor ? \"i++\" : string.Empty;\n        var expectedRaise = inCondition && inIncrementor;\n        var noncompliant = expectedRaise ? \" // Noncompliant\" : string.Empty;\n\n        var declaration = inInitializer ? string.Empty : \"int i = 0;\";\n        var verifier = builder.AddSnippet($$\"\"\"\n            class C\n            {\n                void M()\n                {\n                    {{declaration}}\n                    for ({{(inInitializer ? \"int i = 0\" : initializer)}}; {{condition}}; {{incrementor}})\n                    {\n                        i = 5;{{noncompliant}}\n                    }\n                }\n            }\n            \"\"\");\n        if (expectedRaise)\n        {\n            verifier.Verify();\n        }\n        else\n        {\n            verifier.VerifyNoIssues();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ForLoopCounterConditionTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class ForLoopCounterConditionTest\n    {\n        [TestMethod]\n        public void ForLoopCounterCondition() =>\n            new VerifierBuilder<ForLoopCounterCondition>().AddPaths(\"ForLoopCounterCondition.cs\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ForLoopIncrementSignTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class ForLoopIncrementSignTest\n    {\n        [TestMethod]\n        public void ForLoopIncrementSign() =>\n            new VerifierBuilder<ForLoopIncrementSign>().AddPaths(\"ForLoopIncrementSign.cs\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ForeachLoopExplicitConversionTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ForeachLoopExplicitConversionTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<ForeachLoopExplicitConversion>();\n\n    [TestMethod]\n    public void ForeachLoopExplicitConversion() =>\n        builder.AddPaths(\"ForeachLoopExplicitConversion.cs\").Verify();\n\n    [TestMethod]\n    public void ForeachLoopExplicitConversion_CodeFix() =>\n        builder.WithCodeFix<ForeachLoopExplicitConversionCodeFix>()\n            .AddPaths(\"ForeachLoopExplicitConversion.cs\")\n            .WithCodeFixedPaths(\"ForeachLoopExplicitConversion.Fixed.cs\")\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void ForeachLoopExplicitConversion_CS_Latest() =>\n        builder.AddPaths(\"ForeachLoopExplicitConversion.Latest.cs\")\n            .WithAutogenerateConcurrentFiles(false)\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void ForeachLoopExplicitConversion_CS_Latest_CodeFix() =>\n        builder.WithCodeFix<ForeachLoopExplicitConversionCodeFix>()\n            .AddPaths(\"ForeachLoopExplicitConversion.Latest.cs\")\n            .WithCodeFixedPaths(\"ForeachLoopExplicitConversion.Latest.Fixed.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .VerifyCodeFix();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/FrameworkTypeNamingTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class FrameworkTypeNamingTest\n    {\n        [TestMethod]\n        public void FrameworkTypeNaming() =>\n            new VerifierBuilder<FrameworkTypeNaming>().AddPaths(\"FrameworkTypeNaming.cs\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/FunctionComplexityTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class FunctionComplexityTest\n    {\n        [TestMethod]\n        public void FunctionComplexity_CS() =>\n            CreateCSBuilder(3).AddPaths(\"FunctionComplexity.cs\").WithOptions(LanguageOptions.FromCSharp8).Verify();\n\n        [TestMethod]\n        public void FunctionComplexity_CS_Latest() =>\n            CreateCSBuilder(3).AddPaths(\"FunctionComplexity.Latest.cs\").WithTopLevelStatements().WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n        [TestMethod]\n        public void FunctionComplexity_InsufficientExecutionStack_CS()\n        {\n            if (!TestEnvironment.IsAzureDevOpsContext) // ToDo: Test doesn't work on Azure DevOps\n            {\n                CreateCSBuilder(3).AddPaths(\"SyntaxWalker_InsufficientExecutionStackException.cs\").VerifyNoIssues();\n            }\n        }\n\n        [TestMethod]\n        public void FunctionComplexity_VB() =>\n            new VerifierBuilder().AddAnalyzer(() => new VB.FunctionComplexity { Maximum = 3 })\n                .AddPaths(\"FunctionComplexity.vb\")\n                .Verify();\n\n        private static VerifierBuilder CreateCSBuilder(int maxComplexityScore) =>\n            new VerifierBuilder().AddAnalyzer(() => new CS.FunctionComplexity { Maximum = maxComplexityScore });\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/FunctionNameTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class FunctionNameTest\n    {\n        [TestMethod]\n        public void FunctionName() =>\n            new VerifierBuilder<FunctionName>().AddPaths(\"FunctionName.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/FunctionNestingDepthTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class FunctionNestingDepthTest\n    {\n        private readonly VerifierBuilder builderCS = new VerifierBuilder().AddAnalyzer(() => new CS.FunctionNestingDepth { Maximum = 3 });\n\n        [TestMethod]\n        public void FunctionNestingDepth_CS() =>\n            builderCS.AddPaths(\"FunctionNestingDepth.cs\").Verify();\n\n        [TestMethod]\n        public void FunctionNestingDepth_CS_CSharp9() =>\n            builderCS.AddPaths(\"FunctionNestingDepth.CSharp9.cs\")\n                .WithTopLevelStatements()\n                .Verify();\n\n        [TestMethod]\n        public void FunctionNestingDepth_VB() =>\n            new VerifierBuilder().AddAnalyzer(() => new VB.FunctionNestingDepth { Maximum = 3 }).AddPaths(\"FunctionNestingDepth.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/GenericInheritanceShouldNotBeRecursiveTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class GenericInheritanceShouldNotBeRecursiveTest\n    {\n        private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.GenericInheritanceShouldNotBeRecursive>();\n        private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.GenericInheritanceShouldNotBeRecursive>();\n\n        [TestMethod]\n        public void GenericInheritanceShouldNotBeRecursive_CS() =>\n            builderCS.AddPaths(\"GenericInheritanceShouldNotBeRecursive.cs\").Verify();\n\n        [TestMethod]\n        public void GenericInheritanceShouldNotBeRecursive_CSharp9() =>\n            builderCS.AddPaths(\"GenericInheritanceShouldNotBeRecursive.CSharp9.cs\").WithOptions(LanguageOptions.FromCSharp9).Verify();\n\n        [TestMethod]\n        public void GenericInheritanceShouldNotBeRecursive_VB() =>\n            builderVB.AddPaths(\"GenericInheritanceShouldNotBeRecursive.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/GenericLoggerInjectionShouldMatchEnclosingTypeTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class GenericLoggerInjectionShouldMatchEnclosingTypeTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<GenericLoggerInjectionShouldMatchEnclosingType>().AddReferences(NuGetMetadataReference.MicrosoftExtensionsLoggingAbstractions());\n\n    [TestMethod]\n    public void GenericLoggerInjectionShouldMatchEnclosingTypeTest_CS() =>\n        builder.AddPaths(\"GenericLoggerInjectionShouldMatchEnclosingType.cs\").Verify();\n\n#if NET\n\n    [TestMethod]\n    public void GenericLoggerInjectionShouldMatchEnclosingTypeTest_CS_Latest() =>\n        builder.AddPaths(\"GenericLoggerInjectionShouldMatchEnclosingType.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n#endif\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/GenericReadonlyFieldPropertyAssignmentTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class GenericReadonlyFieldPropertyAssignmentTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<GenericReadonlyFieldPropertyAssignment>();\n    private readonly VerifierBuilder codeFix = new VerifierBuilder<GenericReadonlyFieldPropertyAssignment>().WithCodeFix<GenericReadonlyFieldPropertyAssignmentCodeFix>();\n\n    [TestMethod]\n    public void GenericReadonlyFieldPropertyAssignment() =>\n        builder.AddPaths(\"GenericReadonlyFieldPropertyAssignment.cs\").WithOptions(LanguageOptions.FromCSharp8).Verify();\n\n    [TestMethod]\n    public void GenericReadonlyFieldPropertyAssignment_CS_Latest() =>\n        builder.AddPaths(\"GenericReadonlyFieldPropertyAssignment.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void GenericReadonlyFieldPropertyAssignment_CS_Latest_CodeFix_Remove_Statement() =>\n        codeFix.AddPaths(\"GenericReadonlyFieldPropertyAssignment.Latest.cs\")\n            .WithCodeFixedPaths(\"GenericReadonlyFieldPropertyAssignment.Latest.Remove.Fixed.cs\")\n            .WithCodeFixTitle(GenericReadonlyFieldPropertyAssignmentCodeFix.TitleRemove)\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void GenericReadonlyFieldPropertyAssignment_CodeFix_Remove_Statement() =>\n        codeFix.AddPaths(\"GenericReadonlyFieldPropertyAssignment.cs\")\n            .WithCodeFixedPaths(\"GenericReadonlyFieldPropertyAssignment.Remove.Fixed.cs\")\n            .WithCodeFixTitle(GenericReadonlyFieldPropertyAssignmentCodeFix.TitleRemove)\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void GenericReadonlyFieldPropertyAssignment_CodeFix_Add_Generic_Type_Constraint() =>\n        codeFix.AddPaths(\"GenericReadonlyFieldPropertyAssignment.cs\")\n            .WithCodeFixedPaths(\"GenericReadonlyFieldPropertyAssignment.AddConstraint.Fixed.cs\")\n            .WithCodeFixTitle(GenericReadonlyFieldPropertyAssignmentCodeFix.TitleAddClassConstraint)\n            .VerifyCodeFix();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/GenericTypeParameterEmptinessCheckingTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class GenericTypeParameterEmptinessCheckingTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<GenericTypeParameterEmptinessChecking>().AddReferences(MetadataReferenceFacade.SystemCollections);\n\n    [TestMethod]\n    public void GenericTypeParameterEmptinessChecking() =>\n        builder.AddPaths(\"GenericTypeParameterEmptinessChecking.cs\").Verify();\n\n    [TestMethod]\n    public void GenericTypeParameterEmptinessChecking_CS_Latest() =>\n        builder.AddPaths(\"GenericTypeParameterEmptinessChecking.Latest.cs\").WithTopLevelStatements().WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void GenericTypeParameterEmptinessChecking_CodeFix() =>\n        builder.AddPaths(\"GenericTypeParameterEmptinessChecking.cs\")\n            .WithCodeFix<GenericTypeParameterEmptinessCheckingCodeFix>()\n            .WithCodeFixedPaths(\"GenericTypeParameterEmptinessChecking.Fixed.cs\")\n            .VerifyCodeFix();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/GenericTypeParameterInOutTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class GenericTypeParameterInOutTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<GenericTypeParameterInOut>();\n\n    [TestMethod]\n    public void GenericTypeParameterInOut() =>\n        builder.AddPaths(\"GenericTypeParameterInOut.cs\").Verify();\n\n    [TestMethod]\n    public void GenericTypeParameterInOut_CS_Latest() =>\n        builder.AddPaths(\"GenericTypeParameterInOut.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/GenericTypeParameterUnusedTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class GenericTypeParameterUnusedTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<GenericTypeParameterUnused>();\n\n    [TestMethod]\n    public void GenericTypeParameterUnused() =>\n        builder.AddPaths(\"GenericTypeParameterUnused.cs\", \"GenericTypeParameterUnused.Partial.cs\").WithOptions(LanguageOptions.FromCSharp8).Verify();\n\n    [TestMethod]\n    public void GenericTypeParameterUnused_CS_Latest() =>\n        builder.AddPaths(\"GenericTypeParameterUnused.Latest.cs\", \"GenericTypeParameterUnused.Latest.Partial.cs\").WithTopLevelStatements().WithOptions(LanguageOptions.CSharpLatest).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/GenericTypeParametersRequiredTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class GenericTypeParametersRequiredTest\n    {\n        [TestMethod]\n        public void GenericTypeParametersRequired() =>\n            new VerifierBuilder<GenericTypeParametersRequired>().AddPaths(\"GenericTypeParametersRequired.cs\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/GetHashCodeEqualsOverrideTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class GetHashCodeEqualsOverrideTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<GetHashCodeEqualsOverride>().AddReferences(MetadataReferenceFacade.SystemComponentModelPrimitives);\n\n    [TestMethod]\n    public void GetHashCodeEqualsOverride() =>\n        builder.AddPaths(\"GetHashCodeEqualsOverride.cs\").Verify();\n\n    [TestMethod]\n    public void GetHashCodeEqualsOverride_CS_Latest() =>\n        builder.AddPaths(\"GetHashCodeEqualsOverride.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).VerifyNoIssues();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/GetHashCodeMutableTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class GetHashCodeMutableTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<GetHashCodeMutable>();\n\n    [TestMethod]\n    public void GetHashCodeMutable() =>\n        builder.AddPaths(\"GetHashCodeMutable.cs\").Verify();\n\n    [TestMethod]\n    public void GetHashCodeMutable_CS_Latest() =>\n        builder.AddPaths(\"GetHashCodeMutable.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void GetHashCodeMutable_CodeFix() =>\n        builder.WithCodeFix<GetHashCodeMutableCodeFix>()\n            .AddPaths(\"GetHashCodeMutable.cs\")\n            .WithCodeFixedPaths(\"GetHashCodeMutable.Fixed.cs\")\n            .VerifyCodeFix();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/GetTypeWithIsAssignableFromTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class GetTypeWithIsAssignableFromTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<GetTypeWithIsAssignableFrom>();\n\n    [TestMethod]\n    public void GetTypeWithIsAssignableFrom() =>\n        builder.AddPaths(\"GetTypeWithIsAssignableFrom.cs\").Verify();\n\n    [TestMethod]\n    public void GetTypeWithIsAssignableFrom_CS_Latest() =>\n        builder.AddPaths(\"GetTypeWithIsAssignableFrom.Latest.cs\")\n            .WithTopLevelStatements()\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void GetTypeWithIsAssignableFrom_CS_Latest_CodeFix() =>\n        builder.AddPaths(\"GetTypeWithIsAssignableFrom.Latest.cs\")\n            .WithCodeFix<GetTypeWithIsAssignableFromCodeFix>()\n            .WithCodeFixedPaths(\"GetTypeWithIsAssignableFrom.Latest.Fixed.cs\")\n            .WithTopLevelStatements()\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void GetTypeWithIsAssignableFrom_CodeFix() =>\n        builder.AddPaths(\"GetTypeWithIsAssignableFrom.cs\")\n            .WithCodeFix<GetTypeWithIsAssignableFromCodeFix>()\n            .WithCodeFixedPaths(\"GetTypeWithIsAssignableFrom.Fixed.cs\", \"GetTypeWithIsAssignableFrom.Fixed.Batch.cs\")\n            .VerifyCodeFix();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/GotoStatementTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class GotoStatementTest\n{\n    [TestMethod]\n    public void GotoStatement_CS() =>\n        new VerifierBuilder<CS.GotoStatement>().AddPaths(\"GotoStatement.cs\").Verify();\n\n    [TestMethod]\n    public void GotoStatement_VB() =>\n        new VerifierBuilder<VB.GotoStatement>().AddPaths(\"GotoStatement.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/GuardConditionOnEqualsOverrideTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class GuardConditionOnEqualsOverrideTest\n{\n    [TestMethod]\n    public void GuardConditionOnEqualsOverride() =>\n        new VerifierBuilder<GuardConditionOnEqualsOverride>().AddPaths(\"GuardConditionOnEqualsOverride.cs\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/Hotspots/ClearTextProtocolsAreSensitiveTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ClearTextProtocolsAreSensitiveTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder().WithBasePath(\"Hotspots\").AddAnalyzer(() => new ClearTextProtocolsAreSensitive(AnalyzerConfiguration.AlwaysEnabled));\n\n    internal static IEnumerable<MetadataReference> AdditionalReferences =>\n        MetadataReferenceFacade.SystemNetHttp\n            .Concat(MetadataReferenceFacade.SystemComponentModelPrimitives)\n            .Concat(MetadataReferenceFacade.SystemXml)\n            .Concat(MetadataReferenceFacade.SystemXmlLinq)\n            .Concat(MetadataReferenceFacade.SystemWeb);\n\n    [TestMethod]\n    public void ClearTextProtocolsAreSensitive() =>\n        builder.AddPaths(\"ClearTextProtocolsAreSensitive.cs\")\n            .AddReferences(AdditionalReferences)\n            .WithConcurrentAnalysis(false)\n            .Verify();\n\n#if NETFRAMEWORK\n\n    [TestMethod]\n    public void ClearTextProtocolsAreSensitive_NetFx() =>\n        builder.AddPaths(\"ClearTextProtocolsAreSensitive.NetFramework.cs\")\n            .AddReferences(FrameworkMetadataReference.SystemWebServices)\n            .Verify();\n\n#endif\n\n    [TestMethod]\n    public void ClearTextProtocolsAreSensitive_CS_Latest() =>\n        builder.AddPaths(\"ClearTextProtocolsAreSensitive.Latest.cs\")\n            .AddReferences(AdditionalReferences)\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void ClearTextProtocolsAreSensitive_CS_TopLevelStatements() =>\n        builder.AddPaths(\"ClearTextProtocolsAreSensitive.TopLevelStatements.cs\")\n            .AddReferences(AdditionalReferences)\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .WithTopLevelStatements()\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/Hotspots/CommandPathTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class CommandPathTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder().WithBasePath(\"Hotspots\")\n        .AddReferences(MetadataReferenceFacade.SystemDiagnosticsProcess)\n        .AddAnalyzer(() => new CS.CommandPath(AnalyzerConfiguration.AlwaysEnabled));\n\n    private readonly VerifierBuilder builderVB = new VerifierBuilder().WithBasePath(\"Hotspots\")\n        .AddReferences(MetadataReferenceFacade.SystemDiagnosticsProcess)\n        .AddAnalyzer(() => new VB.CommandPath(AnalyzerConfiguration.AlwaysEnabled));\n\n    [TestMethod]\n    public void CommandPath_CS() =>\n        builderCS.AddPaths(\"CommandPath.cs\").Verify();\n\n    [TestMethod]\n    public void CommandPath_CS_Latest() =>\n        builderCS.AddPaths(\"CommandPath.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void CommandPath_VB() =>\n        builderVB.AddPaths(\"CommandPath.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/Hotspots/ConfiguringLoggersTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class ConfiguringLoggersTest\n    {\n        private readonly VerifierBuilder builderCS = new VerifierBuilder().WithBasePath(\"Hotspots\").AddAnalyzer(() => new CS.ConfiguringLoggers(AnalyzerConfiguration.AlwaysEnabled));\n        private readonly VerifierBuilder builderVB = new VerifierBuilder().WithBasePath(\"Hotspots\").AddAnalyzer(() => new VB.ConfiguringLoggers(AnalyzerConfiguration.AlwaysEnabled));\n\n        [TestMethod]\n        public void ConfiguringLoggers_Log4Net_CS() =>\n            builderCS.AddPaths(\"ConfiguringLoggers_Log4Net.cs\")\n                .AddReferences(Log4NetReferences)\n                .Verify();\n\n        [TestMethod]\n        public void ConfiguringLoggers_Log4Net_VB() =>\n            builderVB.AddPaths(\"ConfiguringLoggers_Log4Net.vb\")\n                .AddReferences(Log4NetReferences)\n                .Verify();\n\n        [TestMethod]\n        public void ConfiguringLoggers_NLog_CS() =>\n            builderCS.AddPaths(\"ConfiguringLoggers_NLog.cs\")\n                .AddReferences(NLogReferences)\n                .Verify();\n\n        [TestMethod]\n        public void ConfiguringLoggers_NLog_VB() =>\n            builderVB.AddPaths(\"ConfiguringLoggers_NLog.vb\")\n                .AddReferences(NLogReferences)\n                .Verify();\n\n        [TestMethod]\n        public void ConfiguringLoggers_Serilog_CS() =>\n            builderCS.AddPaths(\"ConfiguringLoggers_Serilog.cs\")\n                .AddReferences(SeriLogReferences)\n                .Verify();\n\n        [TestMethod]\n        public void ConfiguringLoggers_Serilog_VB() =>\n            builderVB.AddPaths(\"ConfiguringLoggers_Serilog.vb\")\n                .AddReferences(SeriLogReferences)\n                .Verify();\n\n#if NET\n        [TestMethod]\n        public void ConfiguringLoggers_AspNetCore2_CS() =>\n            builderCS.AddPaths(\"ConfiguringLoggers_AspNetCore.cs\")\n                .AddReferences(AspNetCore2LoggingReferences)\n                .WithConcurrentAnalysis(false)\n                .Verify();\n\n        [TestMethod]\n        public void ConfiguringLoggers_AspNetCoreLatest_CS() =>\n            builderCS.AddPaths(\"ConfiguringLoggers_AspNetCore6.cs\")\n                .AddReferences(AspNetCoreLoggingReferences(TestConstants.NuGetLatestVersion))\n                .Verify();\n\n        [TestMethod]\n        public void ConfiguringLoggers_AspNetCore_VB() =>\n            builderVB.AddPaths(\"ConfiguringLoggers_AspNetCore.vb\")\n                .AddReferences(AspNetCore2LoggingReferences)\n                .Verify();\n#endif\n\n        internal static IEnumerable<MetadataReference> Log4NetReferences =>\n            // See: https://github.com/SonarSource/sonar-dotnet/issues/3548\n            NuGetMetadataReference.Log4Net(\"2.0.8\", \"net45-full\").Concat(MetadataReferenceFacade.SystemXml);\n\n        private static IEnumerable<MetadataReference> NLogReferences =>\n            NuGetMetadataReference.NLog();\n\n        private static IEnumerable<MetadataReference> SeriLogReferences =>\n            Enumerable.Empty<MetadataReference>()\n                .Concat(NuGetMetadataReference.Serilog(\"2.11.0\"))\n                .Concat(NuGetMetadataReference.SerilogSinksConsole(\"4.1.0\"));\n\n#if NET\n        private static IEnumerable<MetadataReference> AspNetCore2LoggingReferences =>\n            Enumerable.Empty<MetadataReference>()\n                .Concat(NuGetMetadataReference.MicrosoftAspNetCore(TestConstants.DotNetCore220Version))\n                .Concat(NuGetMetadataReference.MicrosoftAspNetCoreHosting(TestConstants.DotNetCore220Version))\n                .Concat(NuGetMetadataReference.MicrosoftAspNetCoreHostingAbstractions(TestConstants.DotNetCore220Version))\n                .Concat(NuGetMetadataReference.MicrosoftAspNetCoreHttpAbstractions(TestConstants.DotNetCore220Version))\n                .Concat(NuGetMetadataReference.MicrosoftExtensionsConfigurationAbstractions(TestConstants.DotNetCore220Version))\n                .Concat(NuGetMetadataReference.MicrosoftExtensionsOptions(TestConstants.DotNetCore220Version))\n                .Concat(NuGetMetadataReference.MicrosoftExtensionsLoggingPackages(TestConstants.DotNetCore220Version))\n                .Concat(new[] { AspNetCoreMetadataReference.MicrosoftExtensionsDependencyInjectionAbstractions });\n\n        private static IEnumerable<MetadataReference> AspNetCoreLoggingReferences(string version) =>\n            new[]\n                {\n                    AspNetCoreMetadataReference.MicrosoftAspNetCore,\n                    AspNetCoreMetadataReference.MicrosoftAspNetCoreHosting,\n                    AspNetCoreMetadataReference.MicrosoftAspNetCoreHostingAbstractions,\n                    AspNetCoreMetadataReference.MicrosoftAspNetCoreHttpAbstractions,\n                    AspNetCoreMetadataReference.MicrosoftExtensionsLoggingEventSource\n                }\n                .Concat(NuGetMetadataReference.MicrosoftExtensionsConfigurationAbstractions(version))\n                .Concat(NuGetMetadataReference.MicrosoftExtensionsOptions(version))\n                .Concat(NuGetMetadataReference.MicrosoftExtensionsLoggingPackages(version))\n                .Concat(NuGetMetadataReference.MicrosoftExtensionsDependencyInjectionAbstractions(version));\n\n#endif\n\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/Hotspots/CookieShouldBeHttpOnlyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class CookieShouldBeHttpOnlyTest\n{\n    private const string WebConfig = \"Web.config\";\n\n    private readonly VerifierBuilder builder = new VerifierBuilder().WithBasePath(\"Hotspots\").AddAnalyzer(() => new CookieShouldBeHttpOnly(AnalyzerConfiguration.AlwaysEnabled));\n\n    public TestContext TestContext { get; set; }\n\n    internal static IEnumerable<MetadataReference> AdditionalReferences => NuGetMetadataReference.Nancy();\n\n    [TestMethod]\n    public void CookieShouldBeHttpOnly_Nancy() =>\n        builder.AddPaths(\"CookieShouldBeHttpOnly_Nancy.cs\").AddReferences(AdditionalReferences).Verify();\n\n    [TestMethod]\n    public void CookieShouldBeHttpOnly_Latest() =>\n        builder.AddPaths(\"CookieShouldBeHttpOnly.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .AddReferences(NuGetMetadataReference.MicrosoftAspNetCoreHttpFeatures(TestConstants.NuGetLatestVersion))\n            .AddReferences(AdditionalReferences)\n            .Verify();\n\n    [TestMethod]\n    public void CookieShouldBeHttpOnly_TopLevelStatements() =>\n    builder.AddPaths(\"CookieShouldBeHttpOnly.TopLevelStatements.cs\")\n        .WithTopLevelStatements()\n        .WithOptions(LanguageOptions.CSharpLatest)\n        .AddReferences(NuGetMetadataReference.MicrosoftAspNetCoreHttpFeatures(TestConstants.NuGetLatestVersion))\n        .AddReferences(AdditionalReferences)\n        .Verify();\n\n    [TestMethod]\n    public void CookieShouldBeHttpOnly() =>\n        builder.AddPaths(\"CookieShouldBeHttpOnly.cs\").AddReferences(MetadataReferenceFacade.SystemWeb).WithNetFrameworkOnly().Verify();\n\n    [TestMethod]\n    [DataRow(@\"TestCases\\WebConfig\\CookieShouldBeHttpOnly\\HttpOnlyCookiesConfig\")]\n    [DataRow(@\"TestCases\\WebConfig\\CookieShouldBeHttpOnly\\Formatting\")]\n    public void CookieShouldBeHttpOnly_WithWebConfigValueSetToTrue(string root) =>\n        builder.AddPaths(\"CookieShouldBeHttpOnly_WithWebConfig.cs\")\n            .AddReferences(MetadataReferenceFacade.SystemWeb)\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfigWithFilesToAnalyze(TestContext, Path.Combine(root, WebConfig)))\n            .WithNetFrameworkOnly()\n            .Verify();\n\n    [TestMethod]\n    [DataRow(@\"TestCases\\WebConfig\\CookieShouldBeHttpOnly\\NonHttpOnlyCookiesConfig\")]\n    [DataRow(@\"TestCases\\WebConfig\\CookieShouldBeHttpOnly\\UnrelatedConfig\")]\n    [DataRow(@\"TestCases\\WebConfig\\CookieShouldBeHttpOnly\\ConfigWithoutAttribute\")]\n    public void CookieShouldBeHttpOnly_WithWebConfigValueSetToFalse(string root) =>\n        builder.AddPaths(\"CookieShouldBeHttpOnly.cs\")\n            .AddReferences(MetadataReferenceFacade.SystemWeb)\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfigWithFilesToAnalyze(TestContext, Path.Combine(root, WebConfig)))\n            .WithNetFrameworkOnly()\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/Hotspots/CookieShouldBeSecureTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class CookieShouldBeSecureTest\n{\n    private const string WebConfig = \"Web.config\";\n\n    private readonly VerifierBuilder builder = new VerifierBuilder().WithBasePath(\"Hotspots\").AddAnalyzer(() => new CookieShouldBeSecure(AnalyzerConfiguration.AlwaysEnabled));\n\n    public TestContext TestContext { get; set; }\n\n    internal static IEnumerable<MetadataReference> AdditionalReferences => NuGetMetadataReference.Nancy();\n\n    [TestMethod]\n    public void CookieShouldBeSecure_Nancy() =>\n        builder.AddPaths(\"CookieShouldBeSecure_Nancy.cs\").AddReferences(AdditionalReferences).Verify();\n\n    [TestMethod]\n    public void CookieShouldBeSecure_Latest() =>\n     builder.AddPaths(\"CookieShouldBeSecure.Latest.cs\")\n        .WithOptions(LanguageOptions.CSharpLatest)\n        .AddReferences(NuGetMetadataReference.MicrosoftAspNetCoreHttpFeatures(TestConstants.NuGetLatestVersion))\n        .AddReferences(AdditionalReferences)\n        .Verify();\n\n    [TestMethod]\n    public void CookieShouldBeSecure_TopLevelStatements() =>\n     builder.AddPaths(\"CookieShouldBeSecure.TopLevelStatements.cs\")\n        .WithOptions(LanguageOptions.CSharpLatest)\n        .WithTopLevelStatements()\n        .AddReferences(NuGetMetadataReference.MicrosoftAspNetCoreHttpFeatures(TestConstants.NuGetLatestVersion))\n        .AddReferences(AdditionalReferences)\n        .Verify();\n\n    [TestMethod]\n    public void CookieShouldBeSecure_NetFx() =>\n         builder.AddPaths(\"CookieShouldBeSecure.cs\")\n            .AddReferences(MetadataReferenceFacade.SystemWeb)\n            .WithNetFrameworkOnly()\n            .Verify();\n\n    [TestMethod]\n    [DataRow(@\"TestCases\\WebConfig\\CookieShouldBeSecure\\SecureCookieConfig\")]\n    [DataRow(@\"TestCases\\WebConfig\\CookieShouldBeSecure\\Formatting\")]\n    public void CookieShouldBeSecure_WithWebConfigValueSetToTrue(string root)\n    {\n        var webConfigPath = Path.Combine(root, WebConfig);\n        builder.AddPaths(\"CookieShouldBeSecure_WithWebConfig.cs\")\n            .AddReferences(MetadataReferenceFacade.SystemWeb)\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfigWithFilesToAnalyze(TestContext, webConfigPath))\n            .WithNetFrameworkOnly()\n            .Verify();\n    }\n\n    [TestMethod]\n    [DataRow(@\"TestCases\\WebConfig\\CookieShouldBeSecure\\NonSecureCookieConfig\")]\n    [DataRow(@\"TestCases\\WebConfig\\CookieShouldBeSecure\\UnrelatedConfig\")]\n    [DataRow(@\"TestCases\\WebConfig\\CookieShouldBeSecure\\ConfigWithoutAttribute\")]\n    public void CookieShouldBeSecure_WithWebConfigValueSetToFalse(string root)\n    {\n        var webConfigPath = Path.Combine(root, WebConfig);\n        builder.AddPaths(\"CookieShouldBeSecure.cs\")\n            .AddReferences(MetadataReferenceFacade.SystemWeb)\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfigWithFilesToAnalyze(TestContext, webConfigPath))\n            .WithNetFrameworkOnly()\n            .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/Hotspots/CreatingHashAlgorithmsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class CreatingHashAlgorithmsTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder().WithBasePath(\"Hotspots\")\n        .AddReferences(MetadataReferenceFacade.SystemSecurityCryptography)\n        .AddAnalyzer(() => new CS.CreatingHashAlgorithms(AnalyzerConfiguration.AlwaysEnabled));\n\n    private readonly VerifierBuilder builderVB = new VerifierBuilder().WithBasePath(\"Hotspots\")\n        .AddReferences(MetadataReferenceFacade.SystemSecurityCryptography)\n        .AddAnalyzer(() => new VB.CreatingHashAlgorithms(AnalyzerConfiguration.AlwaysEnabled));\n\n    [TestMethod]\n    public void CreatingHashAlgorithms_CS() =>\n        builderCS.AddPaths(\"CreatingHashAlgorithms.cs\").Verify();\n\n    [TestMethod]\n    public void CreatingHashAlgorithms_CS_Latest() =>\n    builderCS.AddPaths(\"CreatingHashAlgorithms.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void CreatingHashAlgorithms_CS_NetFx() =>\n    builderCS.AddPaths(\"CreatingHashAlgorithms.NetFramework.cs\").WithNetFrameworkOnly().Verify();\n\n    [TestMethod]\n    public void CreatingHashAlgorithms_VB() =>\n        builderVB.AddPaths(\"CreatingHashAlgorithms.vb\").Verify();\n\n    [TestMethod]\n    public void CreatingHashAlgorithms_VB_NET() =>\n    builderVB.AddPaths(\"CreatingHashAlgorithms.NET.vb\").WithNetOnly().Verify();\n\n    [TestMethod]\n    public void CreatingHashAlgorithms_VB_NetFx() =>\n        builderVB.AddPaths(\"CreatingHashAlgorithms.NetFramework.vb\").WithNetFrameworkOnly().Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/Hotspots/DeliveringDebugFeaturesInProductionTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class DeliveringDebugFeaturesInProductionTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder().WithBasePath(\"Hotspots\").AddAnalyzer(() => new CS.DeliveringDebugFeaturesInProduction(AnalyzerConfiguration.AlwaysEnabled));\n    private readonly VerifierBuilder builderVB = new VerifierBuilder().WithBasePath(\"Hotspots\").AddAnalyzer(() => new VB.DeliveringDebugFeaturesInProduction(AnalyzerConfiguration.AlwaysEnabled));\n\n    [TestMethod]\n    public void DeliveringDebugFeaturesInProduction_NetCore2_CS() =>\n        builderCS.AddPaths(\"DeliveringDebugFeaturesInProduction.NetCore2.cs\")\n            .AddReferences(AdditionalReferencesForAspNetCore2)\n            .Verify();\n\n    [TestMethod]\n    public void DeliveringDebugFeaturesInProduction_NetCore2_VB() =>\n        builderVB.AddPaths(\"DeliveringDebugFeaturesInProduction.NetCore2.vb\")\n            .AddReferences(AdditionalReferencesForAspNetCore2)\n            .Verify();\n\n#if NET\n\n    [TestMethod]\n    public void DeliveringDebugFeaturesInProduction_NetCore3_CS() =>\n        builderCS.AddPaths(\"DeliveringDebugFeaturesInProduction.NetCore3.cs\")\n            .AddReferences(AdditionalReferencesForAspNetCore3AndLater)\n            .Verify();\n\n    [TestMethod]\n    public void DeliveringDebugFeaturesInProduction_NetCore3_VB() =>\n        builderVB.AddPaths(\"DeliveringDebugFeaturesInProduction.NetCore3.vb\")\n            .AddReferences(AdditionalReferencesForAspNetCore3AndLater)\n            .Verify();\n\n    [TestMethod]\n    public void DeliveringDebugFeaturesInProduction_Net7_CS() =>\n        builderCS.AddPaths(\"DeliveringDebugFeaturesInProduction.Net7.cs\")\n            .WithTopLevelStatements()\n            .AddReferences([\n                AspNetCoreMetadataReference.MicrosoftAspNetCore,\n                AspNetCoreMetadataReference.MicrosoftAspNetCoreRouting,\n                AspNetCoreMetadataReference.MicrosoftAspNetCoreDiagnostics,\n                AspNetCoreMetadataReference.MicrosoftAspNetCoreHttpAbstractions,\n                AspNetCoreMetadataReference.MicrosoftAspNetCoreHostingAbstractions,\n                AspNetCoreMetadataReference.MicrosoftExtensionsHostingAbstractions])\n            .VerifyNoIssues();\n\n    private static IEnumerable<MetadataReference> AdditionalReferencesForAspNetCore3AndLater =>\n        new[]\n        {\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreDiagnostics,\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreHostingAbstractions,\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreHttpAbstractions,\n            AspNetCoreMetadataReference.MicrosoftExtensionsHostingAbstractions\n        };\n\n#endif\n\n    internal static IEnumerable<MetadataReference> AdditionalReferencesForAspNetCore2 =>\n        Enumerable.Empty<MetadataReference>()\n                  .Concat(MetadataReferenceFacade.NetStandard)\n                  .Concat(NuGetMetadataReference.MicrosoftAspNetCoreDiagnostics(TestConstants.DotNetCore220Version))\n                  .Concat(NuGetMetadataReference.MicrosoftAspNetCoreDiagnosticsEntityFrameworkCore(TestConstants.DotNetCore220Version))\n                  .Concat(NuGetMetadataReference.MicrosoftAspNetCoreHttpAbstractions(TestConstants.DotNetCore220Version))\n                  .Concat(NuGetMetadataReference.MicrosoftAspNetCoreHostingAbstractions(TestConstants.DotNetCore220Version));\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/Hotspots/DisablingCsrfProtectionTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\n#if NET\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class DisablingCsrfProtectionTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder().WithBasePath(\"Hotspots\")\n                                                                    .AddAnalyzer(() => new DisablingCsrfProtection(AnalyzerConfiguration.AlwaysEnabled))\n                                                                    .AddReferences(AdditionalReferences());\n\n    [TestMethod]\n    public void DisablingCsrfProtection_Latest() =>\n        builder.AddPaths(\"DisablingCsrfProtection.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    internal static IEnumerable<MetadataReference> AdditionalReferences() =>\n        [\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreMvc,\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcAbstractions,\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcCore,\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcViewFeatures,\n            AspNetCoreMetadataReference.MicrosoftExtensionsDependencyInjectionAbstractions\n        ];\n}\n\n#endif\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/Hotspots/DisablingRequestValidationTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Globalization;\nusing System.IO;\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class DisablingRequestValidationTest\n{\n    private const string AspNetMvcVersion = \"5.2.7\";\n    private const string WebConfig = \"Web.config\";\n\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    public void DisablingRequestValidation_CS() =>\n        CreateBuilderCS(AnalyzerConfiguration.AlwaysEnabled)\n            .AddPaths(\"DisablingRequestValidation.cs\")\n            .Verify();\n\n    [TestMethod]\n    public void DisablingRequestValidation_CS_Disabled() =>\n         CreateBuilderCS(AnalyzerConfiguration.Hotspot)\n            .AddPaths(\"DisablingRequestValidation.cs\")\n            .VerifyNoIssuesIgnoreErrors();\n\n    [TestMethod]\n    public void DisablingRequestValidation_CS_NoIssuesInTestCode() =>\n         CreateBuilderCS(AnalyzerConfiguration.AlwaysEnabled)\n            .AddPaths(\"DisablingRequestValidation.cs\")\n            .AddTestReference()\n            .VerifyNoIssuesIgnoreErrors();\n\n    [TestMethod]\n    [DataRow(true, @\"TestCases\\WebConfig\\DisablingRequestValidation\\Values\")]\n    [DataRow(true, @\"TestCases\\WebConfig\\DisablingRequestValidation\\Formatting\")]\n    [DataRow(false, @\"TestCases\\WebConfig\\DisablingRequestValidation\\UnexpectedContent\")]\n    public void DisablingRequestValidation_CS_WebConfig(bool expectIssues, string root)\n    {\n        var webConfigPath = Path.Combine(root, WebConfig);\n        VerifyAdditionalFiles(expectIssues, webConfigPath);\n    }\n\n    [TestMethod]\n    public void DisablingRequestValidation_CS_CorruptAndNonExistingWebConfigs()\n    {\n        var root = @\"TestCases\\WebConfig\\DisablingRequestValidation\\Corrupt\";\n        var nonexisting = @\"TestCases\\WebConfig\\DisablingRequestValidation\\NonExsitingDirectory\";\n        var corruptFilePath = Path.Combine(root, WebConfig);\n        var nonExistentFilePath = Path.Combine(nonexisting, WebConfig);\n        VerifyAdditionalFiles(false, corruptFilePath, nonExistentFilePath);\n    }\n\n    [TestMethod]\n    [DataRow(@\"TestCases\\WebConfig\\DisablingRequestValidation\\MultipleFiles\", \"SubFolder\")]\n    [DataRow(@\"TestCases\\WebConfig\\DisablingRequestValidation\\EdgeValues\", \"3.9\", \"5.6\")]\n    public void DisablingRequestValidation_CS_WebConfig_SubFolders(string rootDirectory, params string[] subFolders)\n    {\n        var newCulture = (CultureInfo)Thread.CurrentThread.CurrentCulture.Clone();\n        // decimal.TryParse() from the implementation might not recognize \"1.2\" under different culture\n        newCulture.NumberFormat.NumberDecimalSeparator = \",\";\n        using var scope = new CurrentCultureScope(newCulture);\n        42.42.ToString().Should().Be(\"42,42\");\n        var rootFile = Path.Combine(rootDirectory, WebConfig);\n        var filesToAnalyze = new List<string> { rootFile };\n        foreach (var subFolder in subFolders)\n        {\n            filesToAnalyze.Add(Path.Combine(rootDirectory, subFolder, WebConfig));\n        }\n        filesToAnalyze.Add(AnalysisScaffolding.CreateSonarProjectConfigWithFilesToAnalyze(TestContext, filesToAnalyze.ToArray()));\n        CreateBuilderCS(AnalyzerConfiguration.AlwaysEnabled)\n            .AddSnippet(\"// Nothing to see here\")\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfigWithFilesToAnalyze(TestContext, filesToAnalyze.ToArray()))\n            .AddAdditionalSourceFiles(filesToAnalyze.ToArray())\n            .Verify();\n    }\n\n    [TestMethod]\n    public void DisablingRequestValidation_CS_WebConfig_LowerCase()\n    {\n        var root = @\"TestCases\\WebConfig\\DisablingRequestValidation\\LowerCase\";\n        var webConfigPath = Path.Combine(root, \"web.config\");\n        VerifyAdditionalFiles(true, webConfigPath);\n    }\n\n    [TestMethod]\n    [DataRow(true, @\"TestCases\\WebConfig\\DisablingRequestValidation\\TransformCustom\\Web.Custom.config\")]\n    [DataRow(false, @\"TestCases\\WebConfig\\DisablingRequestValidation\\TransformDebug\\Web.Debug.config\")]\n    [DataRow(true, @\"TestCases\\WebConfig\\DisablingRequestValidation\\TransformRelease\\Web.Release.config\")]\n    public void DisablingRequestValidation_CS_WebConfig_Transformation(bool expectIssues, string configPath) =>\n        VerifyAdditionalFiles(expectIssues, configPath);\n\n    [TestMethod]\n    public void DisablingRequestValidation_VB() =>\n        CreateBuilderVB(AnalyzerConfiguration.AlwaysEnabled)\n            .AddPaths(\"DisablingRequestValidation.vb\")\n            .WithOptions(LanguageOptions.FromVisualBasic14)\n            .Verify();\n\n    [TestMethod]\n    public void DisablingRequestValidation_VB_Disabled() =>\n        CreateBuilderVB(AnalyzerConfiguration.Hotspot)\n            .AddPaths(\"DisablingRequestValidation.vb\")\n            .VerifyNoIssuesIgnoreErrors();\n\n    [TestMethod]\n    public void DisablingRequestValidation_VB_WebConfig()\n    {\n        var root = @\"TestCases\\WebConfig\\DisablingRequestValidation\\Values\";\n        var webConfigPath = Path.Combine(root, WebConfig);\n        CreateBuilderCS(AnalyzerConfiguration.AlwaysEnabled)\n            .AddSnippet(\"// Nothing to see here\")\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfigWithFilesToAnalyze(TestContext, webConfigPath))\n            .AddAdditionalSourceFiles(webConfigPath)\n            .Verify();\n    }\n\n    private static VerifierBuilder CreateBuilderCS(IAnalyzerConfiguration configuration) =>\n        new VerifierBuilder()\n            .WithBasePath(\"Hotspots\")\n            .AddAnalyzer(() => new CS.DisablingRequestValidation(configuration))\n            .AddReferences(NuGetMetadataReference.MicrosoftAspNetMvc(AspNetMvcVersion));\n\n    private static VerifierBuilder CreateBuilderVB(IAnalyzerConfiguration configuration) =>\n        new VerifierBuilder()\n            .WithBasePath(\"Hotspots\")\n            .AddAnalyzer(() => new VB.DisablingRequestValidation(configuration))\n            .AddReferences(NuGetMetadataReference.MicrosoftAspNetMvc(AspNetMvcVersion));\n\n    private void VerifyAdditionalFiles(bool expectIssues, string additionalSourceFile, params string[] additionalFilesToAnalyze)\n    {\n        var withAdditionalSourceFiles = CreateBuilderCS(AnalyzerConfiguration.AlwaysEnabled)\n            .AddSnippet(\"// Nothing to see here\")\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfigWithFilesToAnalyze(TestContext, additionalFilesToAnalyze.Append(additionalSourceFile).ToArray()))\n            .AddAdditionalSourceFiles(additionalSourceFile);\n        if (expectIssues)\n        {\n            withAdditionalSourceFiles.Verify();\n        }\n        else\n        {\n            withAdditionalSourceFiles.VerifyNoIssues();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/Hotspots/DoNotUseRandomTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class DoNotUseRandomTest\n{\n    [TestMethod]\n    public void DoNotUseRandom() =>\n        new VerifierBuilder().WithBasePath(\"Hotspots\").AddAnalyzer(() => new DoNotUseRandom(AnalyzerConfiguration.AlwaysEnabled))\n            .AddPaths(\"DoNotUseRandom.cs\")\n            .AddReferences(MetadataReferenceFacade.SystemSecurityCryptography)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/Hotspots/ExecutingSqlQueriesTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ExecutingSqlQueriesTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder().AddAnalyzer(() => new CS.ExecutingSqlQueries(AnalyzerConfiguration.AlwaysEnabled)).WithBasePath(\"Hotspots\");\n    private readonly VerifierBuilder builderVB = new VerifierBuilder().AddAnalyzer(() => new VB.ExecutingSqlQueries(AnalyzerConfiguration.AlwaysEnabled)).WithBasePath(\"Hotspots\");\n\n    [TestMethod]\n    public void ExecutingSqlQueries_CS_Dapper() =>\n        builderCS\n            .AddPaths(\"ExecutingSqlQueries.Dapper.cs\")\n            .AddReferences(MetadataReferenceFacade.SystemData)\n            .AddReferences(NuGetMetadataReference.Dapper())\n            .Verify();\n\n    [TestMethod]\n    public void ExecutingSqlQueries_CS_MySqlData() =>\n        builderCS\n            .AddPaths(\"ExecutingSqlQueries.MySqlData.cs\")\n            .AddReferences(MetadataReferenceFacade.SystemData)\n            .AddReferences(MetadataReferenceFacade.SystemComponentModelPrimitives)\n            .AddReferences(NuGetMetadataReference.Dapper(\"2.1.35\"))\n            .AddReferences(NuGetMetadataReference.MySqlData(\"9.0.0\"))\n            .Verify();\n\n    [TestMethod]\n    public void ExecutingSqlQueries_CS_EF6() =>\n        builderCS.AddPaths(\"ExecutingSqlQueries.EF6.cs\")\n            .AddReferences(NuGetMetadataReference.EntityFramework())\n            .Verify();\n\n    [TestMethod]\n    public void ExecutingSqlQueries_OrmLite_CS_810() =>\n        builderCS\n            .AddPaths(@\"ExecutingSqlQueries.OrmLite.cs\")\n            .AddReferences(MetadataReferenceFacade.SystemData)\n            // after 8.10 netfx breaks\n            .AddReferences(NuGetMetadataReference.ServiceStackOrmLite(\"8.10\"))\n            .Verify();\n\n    [TestMethod]\n    public void ExecutingSqlQueries_OrmLite_CS() =>\n    builderCS\n        .AddPaths(@\"ExecutingSqlQueries.OrmLite.cs\")\n        .AddReferences(MetadataReferenceFacade.SystemData)\n        .AddReferences(NuGetMetadataReference.ServiceStackOrmLite(TestConstants.NuGetLatestVersion))\n        .WithNetOnly()\n        .Verify();\n\n    [TestMethod]\n    public void ExecutingSqlQueries_NHibernate_CS() =>\n        builderCS\n            .AddPaths(\"ExecutingSqlQueries.NHibernate.cs\")\n            .AddReferences(NuGetMetadataReference.NHibernate(TestConstants.NuGetLatestVersion))\n            .Verify();\n\n    [TestMethod]\n    public void ExecutingSqlQueries_CS_AzureCosmos() =>\n        builderCS\n            .AddPaths(\"ExecutingSqlQueries.AzureCosmos.cs\")\n            .AddReferences(NuGetMetadataReference.MicrosoftAzureCosmos())\n            .Verify();\n\n    [TestMethod]\n    public void ExecutingSqlQueries_CS_MicrosoftDataSqlClient() =>\n        builderCS\n            .AddPaths(\"ExecutingSqlQueries.MicrosoftDataSqlClient.cs\")\n            .AddReferences(MetadataReferenceFacade.SystemData)\n            .AddReferences(MetadataReferenceFacade.SystemComponentModelPrimitives)\n            .AddReferences(NuGetMetadataReference.MicrosoftDataSqlClient())\n            .Verify();\n\n    [TestMethod]\n    public void ExecutingSqlQueries_CS_OracleManagedDataAccess() =>\n        builderCS\n            .AddPaths(\"ExecutingSqlQueries.OracleManagedDataAccess.cs\")\n            .AddReferences(MetadataReferenceFacade.SystemData)\n            .AddReferences(MetadataReferenceFacade.SystemComponentModelPrimitives)\n            .AddReferences(NuGetMetadataReference.OracleManagedDataAccessCore())\n            .Verify();\n\n    [TestMethod]\n    public void ExecutingSqlQueries_CS_EntityFrameworkCore2() =>\n        builderCS\n            .AddPaths(\"ExecutingSqlQueries.EntityFrameworkCore2.cs\")\n            .AddReferences(ReferencesEntityFrameworkNetCore(\"2.2.6\").Concat(NuGetMetadataReference.SystemComponentModelTypeConverter()))\n            .WithNetOnly()\n            .Verify();\n\n    [TestMethod]\n    public void ExecutingSqlQueries_CS_EntityFrameworkCore7() =>\n        builderCS\n            .AddPaths(\"ExecutingSqlQueries.EntityFrameworkCoreLatest.cs\")\n            .AddReferences(ReferencesEntityFrameworkNetCore(\"7.0.14\"))\n            .WithNetOnly()\n            .Verify();\n\n    [TestMethod]\n    public void ExecutingSqlQueries_CS_Latest() =>\n        builderCS.AddPaths(\"ExecutingSqlQueries.Latest.cs\")\n            .WithTopLevelStatements()\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .AddReferences(ReferencesEntityFrameworkNetCore(TestConstants.DotNetCore220Version).Concat(NuGetMetadataReference.MicrosoftDataSqliteCore()))\n            .Verify();\n\n    [TestMethod]\n    public void ExecutingSqlQueries_VB_EntityFrameworkCore2() =>\n        builderVB\n            .AddPaths(@\"ExecutingSqlQueries.EntityFrameworkCore2.vb\")\n            .WithOptions(LanguageOptions.FromVisualBasic15)\n            .AddReferences(ReferencesEntityFrameworkNetCore(TestConstants.DotNetCore220Version))\n            .Verify();\n\n    [TestMethod]\n    public void ExecutingSqlQueries_VB_EntityFrameworkCore7() =>\n        builderVB\n            .AddPaths(@\"ExecutingSqlQueries.EntityFrameworkCoreLatest.vb\")\n            .WithOptions(LanguageOptions.FromVisualBasic15)\n            .AddReferences(ReferencesEntityFrameworkNetCore(\"7.0.14\"))\n            .Verify();\n\n#if NETFRAMEWORK // System.Data.OracleClient.dll is not available on .Net Core\n\n    [TestMethod]\n    public void ExecutingSqlQueries_CS_Net46() =>\n        builderCS\n            .AddPaths(\"ExecutingSqlQueries.Net46.cs\")\n            .AddReferences(ReferencesNet46(TestConstants.NuGetLatestVersion))\n            .Verify();\n\n    [TestMethod]\n    public void ExecutingSqlQueries_VB_Net46() =>\n        builderVB\n            .AddPaths(\"ExecutingSqlQueries.Net46.vb\")\n            .WithOptions(LanguageOptions.FromVisualBasic15)\n            .AddReferences(ReferencesNet46(TestConstants.NuGetLatestVersion))\n            .Verify();\n\n    [TestMethod]\n    public void ExecutingSqlQueries_MonoSqlLite_Net46_CS() =>\n        builderCS\n            .AddPaths(\"ExecutingSqlQueries.Net46.MonoSqlLite.cs\")\n            .AddReferences(FrameworkMetadataReference.SystemData)\n            .AddReferences(NuGetMetadataReference.MonoDataSqlite())\n            .Verify();\n\n    [TestMethod]\n    public void ExecutingSqlQueries_MonoSqlLite_Net46_VB() =>\n        builderVB\n            .AddPaths(\"ExecutingSqlQueries.Net46.MonoSqlLite.vb\")\n            .AddReferences(FrameworkMetadataReference.SystemData)\n            .AddReferences(NuGetMetadataReference.MonoDataSqlite())\n            .WithOptions(LanguageOptions.FromVisualBasic14)\n            .Verify();\n\n    internal static IEnumerable<MetadataReference> ReferencesNet46(string sqlServerCeVersion) =>\n        MetadataReferenceFacade.NetStandard\n            .Concat(FrameworkMetadataReference.SystemData)\n            .Concat(FrameworkMetadataReference.SystemDataOracleClient)\n            .Concat(NuGetMetadataReference.SystemDataSqlServerCe(sqlServerCeVersion))\n            .Concat(NuGetMetadataReference.MySqlData(\"8.0.22\"))\n            .Concat(NuGetMetadataReference.MicrosoftDataSqliteCore())\n            .Concat(NuGetMetadataReference.SystemDataSQLiteCore());\n#endif\n\n    internal static IEnumerable<MetadataReference> ReferencesEntityFrameworkNetCore(string entityFrameworkVersion) =>\n    Enumerable.Empty<MetadataReference>()\n        .Concat(NuGetMetadataReference.MicrosoftEntityFrameworkCore(entityFrameworkVersion))\n        .Concat(NuGetMetadataReference.MicrosoftEntityFrameworkCoreRelational(entityFrameworkVersion));\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/Hotspots/ExpandingArchivesTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ExpandingArchivesTest\n{\n    internal static IEnumerable<MetadataReference> AdditionalReferences => MetadataReferenceFacade.SystemIoCompression;\n\n    [TestMethod]\n    public void ExpandingArchives_CS() =>\n        new VerifierBuilder().WithBasePath(\"Hotspots\").AddAnalyzer(() => new CS.ExpandingArchives(AnalyzerConfiguration.AlwaysEnabled))\n            .AddPaths(\"ExpandingArchives.cs\")\n            .AddReferences(AdditionalReferences)\n            .Verify();\n\n    [TestMethod]\n    public void ExpandingArchives_CS_Latest() =>\n        new VerifierBuilder().WithBasePath(\"Hotspots\").AddAnalyzer(() => new CS.ExpandingArchives(AnalyzerConfiguration.AlwaysEnabled))\n            .AddPaths(\"ExpandingArchives.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .AddReferences(AdditionalReferences)\n            .VerifyNoIssues();\n\n    [TestMethod]\n    public void ExpandingArchives_VB() =>\n        new VerifierBuilder().WithBasePath(\"Hotspots\").AddAnalyzer(() => new VB.ExpandingArchives(AnalyzerConfiguration.AlwaysEnabled))\n            .AddPaths(\"ExpandingArchives.vb\")\n            .AddReferences(AdditionalReferences)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/Hotspots/HardcodedIpAddressTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class HardcodedIpAddressTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder().AddAnalyzer(() => new CS.HardcodedIpAddress(AnalyzerConfiguration.AlwaysEnabled));\n    private readonly VerifierBuilder builderVB = new VerifierBuilder().AddAnalyzer(() => new VB.HardcodedIpAddress(AnalyzerConfiguration.AlwaysEnabled));\n\n    [TestMethod]\n    public void HardcodedIpAddress_CS() =>\n        builderCS.AddPaths(@\"Hotspots\\HardcodedIpAddress.cs\").Verify();\n\n    [TestMethod]\n    public void HardcodedIpAddress_CS_Latest() =>\n        builderCS.AddPaths(@\"Hotspots\\HardcodedIpAddress.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void HardcodedIpAddress_VB() =>\n        builderVB.AddPaths(@\"Hotspots\\HardcodedIpAddress.vb\").WithOptions(LanguageOptions.FromVisualBasic14).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/Hotspots/InsecureDeserializationTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class InsecureDeserializationTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder().AddAnalyzer(() => new InsecureDeserialization(AnalyzerConfiguration.AlwaysEnabled)).WithBasePath(\"Hotspots\");\n\n    [TestMethod]\n    public void InsecureDeserialization() =>\n        builder.AddPaths(\"InsecureDeserialization.cs\").Verify();\n\n    [TestMethod]\n    public void InsecureDeserialization_Latest() =>\n        builder.AddPaths(\"InsecureDeserialization.Latest.cs\", \"InsecureDeserialization.Latest.Partial.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/Hotspots/PermissiveCorsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class PermissiveCorsTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder()\n        .AddAnalyzer(() => new PermissiveCors(AnalyzerConfiguration.AlwaysEnabled))\n        .WithBasePath(@\"Hotspots\\\")\n        .AddReferences(AdditionalReferences);\n\n#if NET\n\n    internal static IEnumerable<MetadataReference> AdditionalReferences =>\n        [\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreCors,\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreHttpAbstractions,\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreHttpFeatures,\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreMvc,\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcAbstractions,\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcCore,\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcViewFeatures,\n            AspNetCoreMetadataReference.MicrosoftExtensionsDependencyInjectionAbstractions,\n            AspNetCoreMetadataReference.MicrosoftExtensionsPrimitives,\n            AspNetCoreMetadataReference.MicrosoftNetHttpHeadersHeaderNames\n        ];\n\n    [TestMethod]\n    public void PermissiveCors_Latest() =>\n        builder.AddPaths(\"PermissiveCors.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n#else\n\n    private static IEnumerable<MetadataReference> AdditionalReferences =>\n        NuGetMetadataReference.MicrosoftNetHttpHeaders(\"2.1.14\")\n                              .Concat(NuGetMetadataReference.MicrosoftAspNetMvc(TestConstants.NuGetLatestVersion))\n                              .Concat(NuGetMetadataReference.MicrosoftAspNetWebApiCors(TestConstants.NuGetLatestVersion))\n                              .Concat(NuGetMetadataReference.MicrosoftNetWebApiCore(TestConstants.NuGetLatestVersion))\n                              .Concat(FrameworkMetadataReference.SystemWeb)\n                              .Concat(FrameworkMetadataReference.SystemNetHttp);\n\n    [TestMethod]\n    public void PermissiveCors_AspNet_WebApi() =>\n        builder\n            .AddPaths(\"PermissiveCors.NetFramework.cs\")\n            .WithOptions(LanguageOptions.FromCSharp9)\n            .Verify();\n\n#endif\n\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/Hotspots/PubliclyWritableDirectoriesTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class PubliclyWritableDirectoriesTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder().AddAnalyzer(() => new CS.PubliclyWritableDirectories(AnalyzerConfiguration.AlwaysEnabled));\n    private readonly VerifierBuilder builderVB = new VerifierBuilder().AddAnalyzer(() => new VB.PubliclyWritableDirectories(AnalyzerConfiguration.AlwaysEnabled));\n\n    [TestMethod]\n    public void PubliclyWritableDirectories_CS() =>\n        builderCS.AddPaths(@\"Hotspots\\PubliclyWritableDirectories.cs\").Verify();\n\n    [TestMethod]\n    public void PubliclyWritableDirectories_CS_Latest() =>\n        builderCS.AddPaths(@\"Hotspots\\PubliclyWritableDirectories.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void PubliclyWritableDirectories_VB() =>\n        builderVB.AddPaths(@\"Hotspots\\PubliclyWritableDirectories.vb\").WithOptions(LanguageOptions.FromVisualBasic14).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/Hotspots/RequestsWithExcessiveLengthTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class RequestsWithExcessiveLengthTest\n    {\n        private readonly VerifierBuilder builderCS = new VerifierBuilder()\n                                                     .AddAnalyzer(() => new CS.RequestsWithExcessiveLength(AnalyzerConfiguration.AlwaysEnabled))\n                                                     .WithBasePath(@\"Hotspots\")\n                                                     .AddReferences(GetAdditionalReferences());\n\n        private readonly VerifierBuilder builderVB = new VerifierBuilder()\n                                                     .AddAnalyzer(() => new VB.RequestsWithExcessiveLength(AnalyzerConfiguration.AlwaysEnabled))\n                                                     .WithBasePath(@\"Hotspots\")\n                                                     .AddReferences(GetAdditionalReferences());\n\n        public TestContext TestContext { get; set; }\n\n        [TestMethod]\n        public void RequestsWithExcessiveLength_CS() =>\n            builderCS.AddPaths(@\"RequestsWithExcessiveLength.cs\").Verify();\n\n        [TestMethod]\n        public void RequestsWithExcessiveLength_CS_CustomValues() =>\n            new VerifierBuilder()\n                .AddAnalyzer(() => new CS.RequestsWithExcessiveLength(AnalyzerConfiguration.AlwaysEnabled) { FileUploadSizeLimit = 42 })\n                .AddPaths(@\"Hotspots\\RequestsWithExcessiveLength_CustomValues.cs\")\n                .AddReferences(GetAdditionalReferences())\n                .Verify();\n\n        [TestMethod]\n        public void RequestsWithExcessiveLength_CSharp_Latest() =>\n            builderCS\n                .AddPaths(\"RequestsWithExcessiveLength.Latest.cs\")\n                .AddReferences(OpenReadStreamReferences())\n                .WithConcurrentAnalysis(false)\n                .WithOptions(LanguageOptions.FromCSharp12)\n                .Verify();\n\n        [TestMethod]\n        public void RequestsWithExcessiveLength_CSharp_Latest_Params() =>\n            new VerifierBuilder()\n                .AddAnalyzer(() => new CS.RequestsWithExcessiveLength(AnalyzerConfiguration.AlwaysEnabled) { FileUploadSizeLimit = 1024 })\n                .WithBasePath(@\"Hotspots\")\n                .AddSnippet(\"\"\"\n                            using System;\n                            using System.Threading.Tasks;\n                            using Microsoft.AspNetCore.Components.Forms;\n                            public class TestCase\n                            {\n                                public static void OpenReadStream(IBrowserFile file, InputFileChangeEventArgs inputFileChange)\n                                {\n                                    file.OpenReadStream(); // Noncompliant - Default size is 500 KB\n\n                                    Parallel.ForEach(inputFileChange.GetMultipleFiles(9), file =>\n                                    {\n                                        file.OpenReadStream(1024 * 1024); // Noncompliant\n                                    });\n                                }\n                            }\n                            \"\"\")\n                .AddReferences(OpenReadStreamReferences())\n                .WithConcurrentAnalysis(false)\n                .WithOptions(LanguageOptions.FromCSharp12)\n                .Verify();\n\n        [TestMethod]\n        public void RequestsWithExcessiveLength_VB() =>\n            builderVB.AddPaths(@\"RequestsWithExcessiveLength.vb\").WithOptions(LanguageOptions.FromVisualBasic15).Verify();\n\n        [TestMethod]\n        public void RequestsWithExcessiveLength_VB_CustomValues() =>\n            new VerifierBuilder()\n                .AddAnalyzer(() => new VB.RequestsWithExcessiveLength(AnalyzerConfiguration.AlwaysEnabled) { FileUploadSizeLimit = 42 })\n                .AddPaths(@\"Hotspots\\RequestsWithExcessiveLength_CustomValues.vb\")\n                .AddReferences(GetAdditionalReferences())\n                .Verify();\n\n        [TestMethod]\n        [DataRow(true, @\"TestCases\\WebConfig\\RequestsWithExcessiveLength\\Values\\ContentLength\")]\n        [DataRow(false, @\"TestCases\\WebConfig\\RequestsWithExcessiveLength\\Values\\DefaultSettings\")]\n        [DataRow(true, @\"TestCases\\WebConfig\\RequestsWithExcessiveLength\\Values\\RequestLength\")]\n        [DataRow(true, @\"TestCases\\WebConfig\\RequestsWithExcessiveLength\\Values\\RequestAndContentLength\")]\n        [DataRow(false, @\"TestCases\\WebConfig\\RequestsWithExcessiveLength\\Values\\CornerCases\")]\n        [DataRow(false, @\"TestCases\\WebConfig\\RequestsWithExcessiveLength\\Values\\ValidValues\")]\n        [DataRow(false, @\"TestCases\\WebConfig\\RequestsWithExcessiveLength\\Values\\EmptySystemWeb\")]\n        [DataRow(false, @\"TestCases\\WebConfig\\RequestsWithExcessiveLength\\Values\\EmptySystemWebServer\")]\n        [DataRow(false, @\"TestCases\\WebConfig\\RequestsWithExcessiveLength\\Values\\SmallValues\")]\n        [DataRow(false, @\"TestCases\\WebConfig\\RequestsWithExcessiveLength\\Values\\InvalidConfig\")]\n        [DataRow(true, @\"TestCases\\WebConfig\\RequestsWithExcessiveLength\\Values\\NoSystemWeb\")]\n        [DataRow(true, @\"TestCases\\WebConfig\\RequestsWithExcessiveLength\\Values\\NoSystemWebServer\")]\n        [DataRow(false, @\"TestCases\\WebConfig\\RequestsWithExcessiveLength\\UnexpectedContent\")]\n        public void RequestsWithExcessiveLength_CS_WebConfig(bool expectIssues, string root)\n        {\n            var webConfigPath = GetWebConfigPath(root);\n            var withAdditionalSourceFiles = builderCS\n                .AddSnippet(\"// Nothing to see here\")\n                .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfigWithFilesToAnalyze(TestContext, webConfigPath))\n                .AddAdditionalSourceFiles(webConfigPath);\n            if (expectIssues)\n            {\n                withAdditionalSourceFiles.Verify();\n            }\n            else\n            {\n                withAdditionalSourceFiles.VerifyNoIssues();\n            }\n        }\n\n        [TestMethod]\n        public void RequestsWithExcessiveLength_CS_WebConfig_CustomParameterValue()\n        {\n            // Reproducer for https://github.com/SonarSource/sonar-dotnet/issues/7867\n            var webConfigPath = GetWebConfigPath(@\"TestCases\\WebConfig\\RequestsWithExcessiveLength\\Values\\ContentLength_Compliant\"); // 83886080\n            new VerifierBuilder()\n                .AddAnalyzer(() => new CS.RequestsWithExcessiveLength(AnalyzerConfiguration.AlwaysEnabled) { FileUploadSizeLimit = 83_8860_800 })\n                .AddReferences(GetAdditionalReferences())\n                .AddSnippet(\"// Nothing to see here\")\n                .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfigWithFilesToAnalyze(TestContext, webConfigPath))\n                .AddAdditionalSourceFiles(webConfigPath)\n                .VerifyNoIssues();\n        }\n\n        [TestMethod]\n        public void RequestsWithExcessiveLength_CS_CorruptAndNonExistingWebConfigs_ShouldNotFail()\n        {\n            const string root = @\"TestCases\\WebConfig\\RequestsWithExcessiveLength\\Corrupt\";\n            const string missingDirectory = @\"TestCases\\WebConfig\\RequestsWithExcessiveLength\\NonExistingDirectory\";\n            var corruptFilePath = GetWebConfigPath(root);\n            var nonExistingFilePath = GetWebConfigPath(missingDirectory);\n            builderCS\n                .AddSnippet(\"// Nothing to see here\")\n                .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfigWithFilesToAnalyze(TestContext, corruptFilePath, nonExistingFilePath))\n                .AddAdditionalSourceFiles(corruptFilePath)\n                .VerifyNoIssues();\n        }\n\n        internal static IEnumerable<MetadataReference> GetAdditionalReferences() =>\n            NuGetMetadataReference.MicrosoftAspNetCoreMvcCore(TestConstants.NuGetLatestVersion)\n                .Concat(NuGetMetadataReference.MicrosoftAspNetCoreMvcViewFeatures(TestConstants.NuGetLatestVersion));\n\n        private static string GetWebConfigPath(string rootFolder) => Path.Combine(rootFolder, \"Web.config\");\n\n        private static IEnumerable<MetadataReference> OpenReadStreamReferences() =>\n        [\n            ..NuGetMetadataReference.MicrosoftAspNetCoreComponentsWeb(),\n            ..MetadataReferenceFacade.SystemThreadingTasks,\n            ..MetadataReferenceFacade.SystemCollections\n        ];\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/Hotspots/UnsafeCodeBlocksTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class UnsafeCodeBlocksTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder().WithBasePath(\"Hotspots\").AddAnalyzer(() => new UnsafeCodeBlocks(AnalyzerConfiguration.AlwaysEnabled));\n\n    [TestMethod]\n    public void UnsafeCodeBlocks() =>\n        builder.AddPaths(\"UnsafeCodeBlocks.cs\").Verify();\n\n    [TestMethod]\n    public void UnsafeRecord() =>\n        builder.AddSnippet(\"\"\"\n            unsafe record MyRecord(byte* Pointer);  // Noncompliant\n            // Error@-1 [CS8908]\n            \"\"\")\n            .WithOptions(LanguageOptions.FromCSharp9)\n            .Verify();\n\n    [TestMethod]\n    public void UnsafeRecordStruct() =>\n        builder.AddSnippet(\"\"\"\n            unsafe record struct MyRecord(byte* Pointer); // Noncompliant\n            // Error@-1 [CS8908]\n            \"\"\")\n            .WithOptions(LanguageOptions.FromCSharp10)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/Hotspots/UsingNonstandardCryptographyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class UsingNonstandardCryptographyTest\n{\n    private readonly VerifierBuilder builderCS = CreateBuilder().AddAnalyzer(() => new CS.UsingNonstandardCryptography(AnalyzerConfiguration.AlwaysEnabled));\n    private readonly VerifierBuilder builderVB = CreateBuilder().AddAnalyzer(() => new VB.UsingNonstandardCryptography(AnalyzerConfiguration.AlwaysEnabled));\n\n    [TestMethod]\n    public void UsingNonstandardCryptography_CS() =>\n        builderCS.AddPaths(\"UsingNonstandardCryptography.cs\").Verify();\n\n    [TestMethod]\n    public void UsingNonstandardCryptography_CSharp9() =>\n        builderCS.AddPaths(\"UsingNonstandardCryptography.CSharp9.cs\").WithOptions(LanguageOptions.FromCSharp9).Verify();\n\n    [TestMethod]\n    public void UsingNonstandardCryptography_CSharp10() =>\n        builderCS.AddPaths(\"UsingNonstandardCryptography.CSharp10.cs\").WithOptions(LanguageOptions.FromCSharp10).Verify();\n\n    [TestMethod]\n    public void UsingNonstandardCryptography_CSharp12() =>\n        builderCS.AddPaths(\"UsingNonstandardCryptography.CSharp12.cs\").WithOptions(LanguageOptions.FromCSharp12).Verify();\n\n    [TestMethod]\n    public void UsingNonstandardCryptography_VB() =>\n        builderVB.AddPaths(\"UsingNonstandardCryptography.vb\").Verify();\n\n    private static VerifierBuilder CreateBuilder() =>\n        new VerifierBuilder().AddReferences(MetadataReferenceFacade.SystemSecurityCryptography).WithBasePath(\"Hotspots\");\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/IdentifiersNamedExtensionShouldBeEscapedTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class IdentifiersNamedExtensionShouldBeEscapedTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<IdentifiersNamedExtensionShouldBeEscaped>();\n\n    [TestMethod]\n    public void IdentifiersNamedExtensionShouldBeEscaped_BeforeCSharp14() =>\n        builder.AddPaths(\"IdentifiersNamedExtensionShouldBeEscaped.BeforeCSharp14.cs\")\n            .WithOptions(LanguageOptions.BeforeCSharp14)\n            .Verify();\n\n    [TestMethod]\n    public void IdentifiersNamedExtensionShouldBeEscaped_Latest() =>\n        builder.AddPaths(\"IdentifiersNamedExtensionShouldBeEscaped.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    // Type declarations are tested via parameterized tests to allow version-specific ranges\n    // (record struct requires C# 10+) and to keep the test case files focused on member-level cases.\n    // '$$' marks the position where '@' must be inserted to make the declaration compliant.\n    public static IEnumerable<object[]> TypeDeclarations() =>\n    [\n        [\"\"\"class $$extension { }\"\"\"],\n        [\"\"\"struct $$extension { }\"\"\"],\n        [\"\"\"interface $$extension { }\"\"\"],\n        [\"\"\"enum $$extension { }\"\"\"],\n        [\"\"\"delegate void $$extension();\"\"\"],\n        [\"\"\"class MyClass<$$extension> { }\"\"\"],\n        [\"\"\"using $$extension = System.Object;\"\"\"],\n        [\"\"\"record $$extension { }\"\"\"],\n        [\"\"\"record struct $$extension { }\"\"\"],\n    ];\n\n    [TestMethod]\n    [DynamicData(nameof(TypeDeclarations))]\n    public void IdentifiersNamedExtensionShouldBeEscaped_TypeDeclarations_CSharp10ToCSharp13(string declaration) =>\n        builder\n            .WithOptions(LanguageOptions.Between(LanguageVersion.CSharp10, LanguageVersion.CSharp13))\n            .AddSnippet($\"{declaration.Replace(\"$$\", string.Empty)} // Noncompliant\")\n            .Verify();\n\n    [TestMethod]\n    [DynamicData(nameof(TypeDeclarations))]\n    public void IdentifiersNamedExtensionShouldBeEscaped_TypeDeclarations_Latest(string declaration) =>\n        builder\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .AddSnippet($\"{declaration.Replace(\"$$\", string.Empty)} // Error [CS9306]\")\n            .Verify();\n\n    [TestMethod]\n    [DynamicData(nameof(TypeDeclarations))]\n    public void IdentifiersNamedExtensionShouldBeEscaped_TypeDeclarations_Compliant_CSharp10ToCSharp13(string declaration) =>\n        builder\n            .WithOptions(LanguageOptions.Between(LanguageVersion.CSharp10, LanguageVersion.CSharp13))\n            .AddSnippet(declaration.Replace(\"$$\", \"@\"))\n            .VerifyNoIssues();\n\n    [TestMethod]\n    [DynamicData(nameof(TypeDeclarations))]\n    public void IdentifiersNamedExtensionShouldBeEscaped_TypeDeclarations_Compliant_Latest(string declaration) =>\n        builder\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .AddSnippet(declaration.Replace(\"$$\", \"@\"))\n            .VerifyNoIssues();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/IdentifiersNamedFieldShouldBeEscapedTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class IdentifiersNamedFieldShouldBeEscapedTest\n{\n    private readonly VerifierBuilder builderCSharp9To13 = new VerifierBuilder<IdentifiersNamedFieldShouldBeEscaped>()\n        .WithOptions(LanguageOptions.Between(LanguageVersion.CSharp9, LanguageVersion.CSharp13))\n        .WithWarningsAsErrors(\"CS9258\"); // Does not fire in C# 9-13 — keep here so the test fails if it ever gets activated.\n\n    private readonly VerifierBuilder builderLatest = new VerifierBuilder<IdentifiersNamedFieldShouldBeEscaped>()\n        .WithOptions(LanguageOptions.CSharpLatest);\n\n    [TestMethod]\n    public void IdentifiersNamedFieldShouldBeEscaped_CSharp9_13() =>\n        builderCSharp9To13.AddPaths(\"IdentifiersNamedFieldShouldBeEscaped.CSharp9-13.cs\").Verify();\n\n    [TestMethod]\n    public void IdentifiersNamedFieldShouldBeEscaped_Latest() =>\n        builderLatest.AddPaths(\"IdentifiersNamedFieldShouldBeEscaped.Latest.cs\")\n            .WithWarningsAsErrors(\"CS9258\")\n            .Verify();\n\n    [TestMethod]\n    public void IdentifiersNamedFieldShouldBeEscaped_BeforeCSharp14() =>\n        new VerifierBuilder<IdentifiersNamedFieldShouldBeEscaped>()\n            .WithOptions(LanguageOptions.BeforeCSharp14)\n            .AddPaths(\"IdentifiersNamedFieldShouldBeEscaped.BeforeCSharp14.cs\")\n            .AddPaths(\"IdentifiersNamedFieldShouldBeEscaped.BeforeCSharp14.partial.cs\")\n            .WithAutogenerateConcurrentFiles(false)\n            .Verify();\n\n    // Declaration forms that raise CS9273 in C# 14 — S8367 should flag these in C# 9-13.\n    public static IEnumerable<object[]> CS9273LocalDeclarationForms() =>\n    [\n        // Variable declarations\n        [\"\"\"int x = 0, field = 0;\"\"\"],\n        [\"\"\"using var field = new System.IO.MemoryStream();\"\"\"],\n        [\"\"\"using (var field = new System.IO.MemoryStream()) { }\"\"\"],\n        // foreach\n        [\"\"\"foreach (var field in new int[0]) { }\"\"\"],\n        [\"\"\"foreach (var (field, _) in new (int, int)[0]) { }\"\"\"],\n        // catch\n        [\"\"\"try { } catch (Exception field) { }\"\"\"],\n        // Pattern and deconstruction variables\n        [\"\"\"int.TryParse(\"\", out var field);\"\"\"],\n        [\"\"\"var (field, _) = (0, 0);\"\"\"],\n        [\"\"\"(int field, int _) = (0, 0);\"\"\"],\n        // LINQ range variables\n        [\"\"\"var q = from field in new int[0] select 0;\"\"\"],\n        [\"\"\"var q = from x in new int[0] let field = 0 select x;\"\"\"],\n        [\"\"\"var q = from x in new int[0] join field in new int[0] on x equals 0 select x;\"\"\"],\n        [\"\"\"var q = from x in new int[0] join y in new int[0] on x equals y into field select x;\"\"\"],\n        [\"\"\"var q = from x in new int[0] group x by x into field select 0;\"\"\"],\n        [\"\"\"var q = from x in new int[0] select x into field select 0;\"\"\"],\n        // Local function\n        [\"\"\"int field() => 0;\"\"\"],\n    ];\n\n    // Declaration forms that do NOT raise CS9273 in C# 14 — S8367 will still flag these.\n    public static IEnumerable<object[]> NonCS9273LocalDeclarationForms() =>\n    [\n        [\"\"\"if (GetHashCode() is int field) { }\"\"\"],\n        [\"\"\"switch (GetHashCode()) { case int field: break; }\"\"\"],\n        [\"\"\"if (this is object { } field) { }\"\"\"],\n        [\"\"\"if ((0, 0) is (int field, _)) { }\"\"\"],\n    ];\n\n    [TestMethod]\n    [DynamicData(nameof(CS9273LocalDeclarationForms))]\n    public void IdentifiersNamedFieldShouldBeEscaped_CS9273LocalDeclarationForms_CSharp9_13(string statement)\n    {\n        statement += \" // Noncompliant\";\n        builderCSharp9To13.AddSnippet(WrapInAccessor(statement)).Verify();\n    }\n\n    [TestMethod]\n    [DynamicData(nameof(CS9273LocalDeclarationForms))]\n    public void IdentifiersNamedFieldShouldBeEscaped_CS9273LocalDeclarationForms_Latest(string statement)\n    {\n        statement += \" // Error [CS9273]\";\n        builderLatest.AddSnippet(WrapInAccessor(statement)).Verify();\n    }\n\n    [TestMethod]\n    [DynamicData(nameof(NonCS9273LocalDeclarationForms))]\n    public void IdentifiersNamedFieldShouldBeEscaped_NonCS9273LocalDeclarationForms_CSharp9_13(string statement)\n    {\n        // Although C# 14 does not raise CS9273 for these forms (likely a Roslyn oversight),\n        // S8367 flags them in C# 9-13 anyway since 'field' is equally ambiguous in these contexts.\n        statement += \" // Noncompliant\";\n        builderCSharp9To13.AddSnippet(WrapInAccessor(statement)).Verify();\n    }\n\n    [TestMethod]\n    [DynamicData(nameof(NonCS9273LocalDeclarationForms))]\n    public void IdentifiersNamedFieldShouldBeEscaped_NonCS9273LocalDeclarationForms_Latest(string statement) =>\n        builderLatest.AddSnippet(WrapInAccessor(statement)).VerifyNoIssues();\n\n    private static string WrapInAccessor(string statement) =>\n        $$\"\"\"\n        using System;\n        using System.Linq;\n        class C\n        {\n            private int field;\n            public int Value\n            {\n                get\n                {\n                    {{statement}}\n                    return 0;\n                }\n            }\n        }\n        \"\"\";\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/IfChainWithoutElseTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class IfChainWithoutElseTest\n    {\n        [TestMethod]\n        public void IfChainWithoutElse_CS() =>\n            new VerifierBuilder<CS.IfChainWithoutElse>().AddPaths(\"IfChainWithoutElse.cs\").Verify();\n\n        [TestMethod]\n        public void IfChainWithoutElse_VB() =>\n            new VerifierBuilder<VB.IfChainWithoutElse>().AddPaths(\"IfChainWithoutElse.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/IfCollapsibleTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class IfCollapsibleTest\n{\n    [TestMethod]\n    public void IfCollapsible_CS() =>\n        new VerifierBuilder<CS.IfCollapsible>().AddPaths(\"IfCollapsible.cs\").Verify();\n\n    [TestMethod]\n    public void IfCollapsible_VB() =>\n        new VerifierBuilder<VB.IfCollapsible>().AddPaths(\"IfCollapsible.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ImplementIDisposableCorrectlyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ImplementIDisposableCorrectlyTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<ImplementIDisposableCorrectly>();\n\n    [TestMethod]\n    public void ImplementIDisposableCorrectly() =>\n        builder.AddPaths(\"ImplementIDisposableCorrectly.cs\").WithOptions(LanguageOptions.FromCSharp8).Verify();\n\n    [TestMethod]\n    public void ImplementIDisposableCorrectly_CS_Latest() =>\n        builder.AddPaths(\"ImplementIDisposableCorrectly.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void ImplementIDisposableCorrectly_AbstractClass() =>\n        builder.AddPaths(\"ImplementIDisposableCorrectly.AbstractClass.cs\").Verify();\n\n    [TestMethod]\n    public void ImplementIDisposableCorrectly_PartialClassesInDifferentFiles() =>\n        builder.AddPaths(\"ImplementIDisposableCorrectlyPartial1.cs\", \"ImplementIDisposableCorrectlyPartial2.cs\").VerifyNoIssues();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ImplementISerializableCorrectlyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ImplementISerializableCorrectlyTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<ImplementISerializableCorrectly>();\n\n    [TestMethod]\n    public void ImplementISerializableCorrectly() =>\n        builder.AddPaths(\"ImplementISerializableCorrectly.cs\").Verify();\n\n    [TestMethod]\n    public void ImplementISerializableCorrectly_CS_Latest() =>\n        builder.AddPaths(\"ImplementISerializableCorrectly.Latest.cs\", \"ImplementISerializableCorrectly.Latest.Partial.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ImplementSerializationMethodsCorrectlyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ImplementSerializationMethodsCorrectlyTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.ImplementSerializationMethodsCorrectly>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.ImplementSerializationMethodsCorrectly>();\n\n    [TestMethod]\n    public void ImplementSerializationMethodsCorrectly_CS() =>\n        builderCS.AddPaths(\"ImplementSerializationMethodsCorrectly.cs\").Verify();\n\n    [TestMethod]\n    public void ImplementSerializationMethodsCorrectly_CS_Latest() =>\n        builderCS.AddPaths(\"ImplementSerializationMethodsCorrectly.Latest.cs\")\n            .WithTopLevelStatements()\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void ImplementSerializationMethodsCorrectly_CS_InvalidCode() =>\n        builderCS.AddSnippet(\"\"\"\n            [System.Serializable]\n            public class Foo\n            {\n                [System.OnDeserializing] // Error [CS0234, CS0234] Type or namespace name does not exist in the namespace 'System'\n                // Error@+5 [CS0548] Property or indexer must have at least one accessor\n                // Error@+4 [CS1001] Identifier expected\n                // Error@+3 [CS1014] A get or set accessor expected\n                // Error@+2 [CS0106] The modifier 'new' is not valid for this item\n                // Error@+1 [CS1520] Method must have a return type\n                public int  { throw new NotImplementedException(); } // Error [CS1513] {{} expected}}\n            }   // Error [CS1022] Type or namespace definition, or end-of-file expected\n            \"\"\")\n            .Verify();  // This one is difficult to do in the source file due to concurrent file generation\n\n    [TestMethod]\n    public void ImplementSerializationMethodsCorrectly_VB() =>\n        builderVB.AddPaths(\"ImplementSerializationMethodsCorrectly.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/IndentSingleLineFollowingConditionalTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class IndentSingleLineFollowingConditionalTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<IndentSingleLineFollowingConditional>();\n\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    public void IndentSingleLineFollowingConditional() =>\n        builder.AddPaths(\"IndentSingleLineFollowingConditional.cs\").Verify();\n\n    [TestMethod]\n    public void IndentSingleLineFollowingConditional_CS_Latest() =>\n        builder.AddPaths(\"IndentSingleLineFollowingConditional.Latest.cs\")\n            .WithTopLevelStatements()\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void IndentSingleLineFollowingConditional_RazorFile_CorrectMessage() =>\n        builder.AddSnippet(\"\"\"\n            @code\n            {\n                public int Method(int j)\n                {\n                    var total = 0;\n                    for(int i = 0; i < 10; i++) // Noncompliant {{Use curly braces or indentation to denote the code conditionally executed by this 'for'}}\n            //      ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n                    total = total + i;               // trivia not included in secondary location for single line statements...\n            //      ^^^^^^^^^^^^^^^^^^ Secondary\n\n                    if (j > 400)\n                        return 4;\n                    else if (j > 500) // Noncompliant {{Use curly braces or indentation to denote the code conditionally executed by this 'else if'}}\n            //      ^^^^^^^^^^^^^^^^^\n                return 5;\n            //  ^^^^^^^^^ Secondary\n\n                    return 1623;\n                }\n            }\n            \"\"\",\n            \"SomeRazorFile.razor\")\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Product))\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/IndexOfCheckAgainstZeroTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class IndexOfCheckAgainstZeroTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.IndexOfCheckAgainstZero>();\n\n    [TestMethod]\n    public void IndexOfCheckAgainstZero_CS() =>\n        builderCS.AddPaths(\"IndexOfCheckAgainstZero.cs\").Verify();\n\n    [TestMethod]\n    public void IndexOfCheckAgainstZero_CS_Latest() =>\n        builderCS.AddPaths(\"IndexOfCheckAgainstZero.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void IndexOfCheckAgainstZero_VB() =>\n        new VerifierBuilder<VB.IndexOfCheckAgainstZero>().AddPaths(\"IndexOfCheckAgainstZero.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/IndexedPropertyWithMultipleParametersTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class IndexedPropertyWithMultipleParametersTest\n    {\n        [TestMethod]\n        public void IndexedPropertyWithMultipleParameters() =>\n            new VerifierBuilder<IndexedPropertyWithMultipleParameters>().AddPaths(\"IndexedPropertyWithMultipleParameters.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/InfiniteRecursionTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text;\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class InfiniteRecursionTest\n{\n    private readonly VerifierBuilder sonarCfg = new VerifierBuilder()\n        .AddAnalyzer(() => new InfiniteRecursion(AnalyzerConfiguration.AlwaysEnabledWithSonarCfg))\n        .AddReferences(MetadataReferenceFacade.NetStandard21);\n\n    private readonly VerifierBuilder roslynCfg = new VerifierBuilder<InfiniteRecursion>()\n        .AddReferences(MetadataReferenceFacade.NetStandard21);\n\n    [TestMethod]\n    public void InfiniteRecursion_SonarCfg() =>\n        sonarCfg.AddPaths(\"InfiniteRecursion.SonarCfg.cs\")\n            .WithOptions(LanguageOptions.OnlyCSharp7)\n            .Verify();\n\n    [TestMethod]\n    public void InfiniteRecursion_RoslynCfg() =>\n        roslynCfg.AddPaths(\"InfiniteRecursion.RoslynCfg.cs\")\n            .Verify();\n\n    [TestMethod]\n    public void InfiniteRecursion_RoslynCfg_Latest() =>\n        roslynCfg.AddPaths(\"InfiniteRecursion.RoslynCfg.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/8977\n    [TestMethod]\n    public void InfiniteRecursion_RoslynCfg_8977()\n    {\n        const int rows = 4_000;\n        var code = new StringBuilder();\n        code.Append(\"\"\"\n            using UInt32Value = System.UInt32;\n            using StringValue = System.String;\n\n            public class WorksheetPart\n            {\n                public Worksheet Worksheet { get; set; }\n            }\n            public class Worksheet\n            {\n                public MarkupCompatibilityAttributes MCAttributes { get; set; }\n                public void AddNamespaceDeclaration(string alias, string xmlNamespace) { }\n                public void Append(SheetData sheetData1) { }\n            }\n            public class SheetData\n            {\n                public void Append(Row r) { }\n            }\n            public class MarkupCompatibilityAttributes\n            {\n                public string Ignorable { get; set; }\n            }\n            public class Row\n            {\n                public UInt32Value RowIndex { get; set; }\n                public ListValue<StringValue> Spans { get; set; }\n                public double DyDescent { get; set; }\n                public void Append(Cell c) { }\n            }\n            public class ListValue<T>\n            {\n                public string InnerText { get; set; }\n            }\n            public class Cell\n            {\n                public string CellReference { get; set; }\n                public UInt32Value StyleIndex { get; set; }\n                public void Append(CellValue c) { }\n            }\n            public class CellValue\n            {\n                public string Text { get; set; }\n            }\n\n            class Program\n            {\n                public static void Main() { }\n\n                void GenerateWorksheetPart1Content(WorksheetPart worksheetPart1)\n                {\n                    Worksheet worksheet1 = new Worksheet() { MCAttributes = new MarkupCompatibilityAttributes() { Ignorable = \"x14ac xr xr2 xr3\" } };\n                    worksheet1.AddNamespaceDeclaration(\"r\", \"http://schemas.openxmlformats.org/officeDocument/2006/relationships\");\n                    worksheet1.AddNamespaceDeclaration(\"mc\", \"http://schemas.openxmlformats.org/markup-compatibility/2006\");\n                    worksheet1.AddNamespaceDeclaration(\"x14ac\", \"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac\");\n                    worksheet1.AddNamespaceDeclaration(\"xr\", \"http://schemas.microsoft.com/office/spreadsheetml/2014/revision\");\n                    worksheet1.AddNamespaceDeclaration(\"xr2\", \"http://schemas.microsoft.com/office/spreadsheetml/2015/revision2\");\n                    worksheet1.AddNamespaceDeclaration(\"xr3\", \"http://schemas.microsoft.com/office/spreadsheetml/2016/revision3\");\n\n                    SheetData sheetData1 = new SheetData();\n            \"\"\");\n        for (var i = 1; i <= rows; i++)\n        {\n            code.Append($$\"\"\"\n                Row row{{i}} = new Row() { RowIndex = (UInt32Value)1U, Spans = new ListValue<StringValue>() { InnerText = \"1:1\" }, DyDescent = 0.25D };\n\n                Cell cell{{i}} = new Cell() { CellReference = \"A{{i}}\", StyleIndex = (UInt32Value)1U };\n                CellValue cellValue{{i}} = new CellValue();\n                cellValue{{i}}.Text = \"{{i}}\";\n\n                cell{{i}}.Append(cellValue{{i}});\n\n                row{{i}}.Append(cell{{i}});\n                \"\"\");\n        }\n        for (var i = 1; i <= rows; i++)\n        {\n            code.AppendLine($\"\"\"        sheetData1.Append(row{i});\"\"\");\n        }\n        code.Append(\"\"\"\"\n                    worksheet1.Append(sheetData1);\n                    worksheetPart1.Worksheet = worksheet1;\n                }\n            }\n            \"\"\"\");\n\n        roslynCfg.AddSnippet(code.ToString())\n            .WithOptions(LanguageOptions.FromCSharp8)\n            .VerifyNoIssues();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/InheritedCollidingInterfaceMembersTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class InheritedCollidingInterfaceMembersTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<InheritedCollidingInterfaceMembers>();\n\n    [TestMethod]\n    public void InheritedCollidingInterfaceMembers() =>\n        builder.AddPaths(\"InheritedCollidingInterfaceMembers.cs\").Verify();\n\n    [TestMethod]\n    public void InheritedCollidingInterfaceMembers_DifferentFileSizes() =>\n        builder.AddPaths(\"InheritedCollidingInterfaceMembers.DifferentFile.cs\", \"InheritedCollidingInterfaceMembers.AnotherFile.cs\").Verify();\n\n    [TestMethod]\n    public void InheritedCollidingInterfaceMembers_CS_Latest() =>\n        builder.AddPaths(\"InheritedCollidingInterfaceMembers.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/InitializeStaticFieldsInlineTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class InitializeStaticFieldsInlineTest\n{\n    [TestMethod]\n    public void InitializeStaticFieldsInline() =>\n        new VerifierBuilder<InitializeStaticFieldsInline>().AddPaths(\"InitializeStaticFieldsInline.cs\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/InsecureContentSecurityPolicyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\n#if NET\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class InsecureContentSecurityPolicyTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<InsecureContentSecurityPolicy>().AddReferences([\n        AspNetCoreMetadataReference.MicrosoftAspNetCore,\n        AspNetCoreMetadataReference.MicrosoftAspNetCoreHttpFeatures,\n        AspNetCoreMetadataReference.MicrosoftAspNetCoreHttpAbstractions,\n        AspNetCoreMetadataReference.MicrosoftExtensionsPrimitives]);\n\n    [TestMethod]\n    public void InsecureContentSecurityPolicy_CS() =>\n        builder.AddPaths(\"InsecureContentSecurityPolicy.cs\").Verify();\n\n    [TestMethod]\n    public void InsecureContentSecurityPolicy_CS_Latest() =>\n        builder.AddPaths(\"InsecureContentSecurityPolicy.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n}\n\n#endif\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/InsecureEncryptionAlgorithmTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class InsecureEncryptionAlgorithmTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.InsecureEncryptionAlgorithm>().AddReferences(AdditionalReferences());\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.InsecureEncryptionAlgorithm>().AddReferences(AdditionalReferences());\n\n    [TestMethod]\n    public void InsecureEncryptionAlgorithm_MainProject_CS() =>\n        builderCS.AddPaths(\"InsecureEncryptionAlgorithm.cs\").Verify();\n\n    [TestMethod]\n    public void InsecureEncryptionAlgorithm_DoesNotRaiseIssuesForTestProject_CS() =>\n        builderCS.AddPaths(\"InsecureEncryptionAlgorithm.cs\").AddTestReference().VerifyNoIssuesIgnoreErrors();\n\n    [TestMethod]\n    public void InsecureEncryptionAlgorithm_CS_Latest() =>\n        builderCS.AddPaths(\"InsecureEncryptionAlgorithm.Latest.cs\").WithTopLevelStatements().WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void InsecureEncryptionAlgorithm_VB() =>\n        builderVB.AddPaths(\"InsecureEncryptionAlgorithm.vb\").Verify();\n\n    [TestMethod]\n    public void InsecureEncryptionAlgorithm_VB_Latest() =>\n        builderVB.AddPaths(\"InsecureEncryptionAlgorithm.Latest.vb\").WithOptions(LanguageOptions.VisualBasicLatest).VerifyNoIssues();\n\n    private static IEnumerable<MetadataReference> AdditionalReferences() =>\n        MetadataReferenceFacade.SystemSecurityCryptography.Concat(NuGetMetadataReference.BouncyCastle());\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/InsecureTemporaryFilesCreationTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class InsecureTemporaryFilesCreationTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.InsecureTemporaryFilesCreation>();\n\n    [TestMethod]\n    public void InsecureTemporaryFilesCreation_CS() =>\n        builderCS.AddPaths(\"InsecureTemporaryFilesCreation.cs\").Verify();\n\n    [TestMethod]\n    public void InsecureTemporaryFilesCreation_CS_Latest() =>\n        builderCS.AddPaths(\"InsecureTemporaryFilesCreation.Latest.cs\").WithTopLevelStatements().WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void InsecureTemporaryFilesCreation_VB() =>\n        new VerifierBuilder<VB.InsecureTemporaryFilesCreation>().AddPaths(\"InsecureTemporaryFilesCreation.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/InsteadOfAnyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class InsteadOfAnyTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.InsteadOfAny>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.InsteadOfAny>();\n\n    [TestMethod]\n    public void InsteadOfAny_CS() =>\n        builderCS.AddPaths(\"InsteadOfAny.cs\").Verify();\n\n    [TestMethod]\n    public void InsteadOfAny_CS_Latest() =>\n        builderCS.AddPaths(\"InsteadOfAny.Latest.cs\")\n            .WithTopLevelStatements()\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .AddReferences(MetadataReferenceFacade.SystemCollections)\n            .Verify();\n\n    [TestMethod]\n    public void InsteadOfAny_CS_EntityFramework() =>\n        builderCS.AddPaths(\"InsteadOfAny.EntityFramework.Core.cs\")\n            .WithOptions(LanguageOptions.FromCSharp8)\n            .AddReferences(ReferencesEntityFrameworkNetCore())\n            .Verify();\n\n#if NETFRAMEWORK\n\n    [TestMethod]\n    public void InsteadOfAny_CS_EntityFramework_NetFx() =>\n        builderCS.AddPaths(\"InsteadOfAny.EntityFramework.Framework.cs\")\n            .AddReferences(NuGetMetadataReference.EntityFramework())\n            .VerifyNoIssues();\n\n#endif\n\n    [TestMethod]\n    public void ExistsInsteadOfAny_VB() =>\n        builderVB.AddPaths(\"InsteadOfAny.vb\").WithOptions(LanguageOptions.FromVisualBasic14).Verify();\n\n    [TestMethod]\n    public void InsteadOfAny_VB_EntityFramework() =>\n        builderVB.AddPaths(\"InsteadOfAny.EntityFramework.Core.vb\")\n            .AddReferences(ReferencesEntityFrameworkNetCore())\n            .Verify();\n\n    private static IEnumerable<MetadataReference> ReferencesEntityFrameworkNetCore() =>\n        Enumerable.Empty<MetadataReference>()\n            .Concat(NuGetMetadataReference.MicrosoftEntityFrameworkCoreRelational(\"2.2.6\"))\n            .Concat(NuGetMetadataReference.MicrosoftEntityFrameworkCore(\"2.2.6\"))\n            .Concat(NuGetMetadataReference.SystemComponentModelTypeConverter());\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/InterfaceMethodsShouldBeCallableByChildTypesTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class InterfaceMethodsShouldBeCallableByChildTypesTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<InterfaceMethodsShouldBeCallableByChildTypes>();\n\n        [TestMethod]\n        public void InterfaceMethodsShouldBeCallableByChildTypes() =>\n            builder.AddPaths(\"InterfaceMethodsShouldBeCallableByChildTypes.cs\").Verify();\n\n        [TestMethod]\n        public void InterfaceMethodsShouldBeCallableByChildTypes_CSharp9() =>\n            builder.AddPaths(\"InterfaceMethodsShouldBeCallableByChildTypes.CSharp9.cs\")\n                .WithOptions(LanguageOptions.FromCSharp9)\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/InterfaceNameTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class InterfaceNameTest\n    {\n        [TestMethod]\n        public void InterfaceName() =>\n            new VerifierBuilder<InterfaceName>().AddPaths(\"InterfaceName.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/InterfacesShouldNotBeEmptyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class InterfacesShouldNotBeEmptyTest\n    {\n        [TestMethod]\n        public void InterfacesShouldNotBeEmpty() =>\n            new VerifierBuilder<InterfacesShouldNotBeEmpty>().AddPaths(\"InterfacesShouldNotBeEmpty.cs\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/InvalidCastToInterfaceTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class InvalidCastToInterfaceTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.InvalidCastToInterface>();  // Syntax-based part of the rule, there also exists Sonar SE part\n\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.InvalidCastToInterface>()   // Syntax-based part only\n        .WithWarningsAsErrors(\"BC42322\");\n\n    [TestMethod]\n    [DataRow(ProjectType.Product)]\n    [DataRow(ProjectType.Test)]\n    public void InvalidCastToInterface_CS(ProjectType projectType) =>\n        builderCS.AddPaths(\"InvalidCastToInterface.cs\")\n            .AddReferences(TestCompiler.ProjectTypeReference(projectType).Union(MetadataReferenceFacade.NetStandard21))\n            .WithOptions(LanguageOptions.FromCSharp8)\n            .Verify();\n\n    [TestMethod]\n    public void InvalidCastToInterface_VB() =>\n        builderVB.AddPaths(\"InvalidCastToInterface.vb\").Verify();\n\n    [TestMethod]\n    public void InvalidCastToInterface_CS_Latest() =>\n        builderCS.AddPaths(\"InvalidCastToInterface.Latest.cs\").WithTopLevelStatements().WithOptions(LanguageOptions.CSharpLatest).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/InvocationResolvesToOverrideWithParamsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class InvocationResolvesToOverrideWithParamsTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<InvocationResolvesToOverrideWithParams>();\n\n    [TestMethod]\n    public void InvocationResolvesToOverrideWithParams()\n    {\n        var anotherAssembly = TestCompiler.CompileCS(\"\"\"\n            public class FromAnotherAssembly\n            {\n                protected int ProtectedOverload(object a, string b) => 42;\n                public int ProtectedOverload(string a, params string[] bs) => 42;\n\n                private protected int PrivateProtectedOverload(object a, string b) => 42;\n                public int PrivateProtectedOverload(string a, params string[] bs) => 42;\n\n                protected internal int ProtectedInternalOverload(object a, string b) => 42;\n                public int ProtectedInternalOverload(string a, params string[] bs) => 42;\n\n                internal int InternalOverload(object a, string b) => 42;\n                public int InternalOverload(string a, params string[] bs) => 42;\n            }\n            \"\"\").Model.Compilation.ToMetadataReference();\n        builder.AddPaths(\"InvocationResolvesToOverrideWithParams.cs\")\n            .AddReferences([anotherAssembly])\n            .Verify();\n    }\n\n    [TestMethod]\n    public void InvocationResolvesToOverrideWithParams_TopLevelStatements() =>\n        builder.AddPaths(\"InvocationResolvesToOverrideWithParams.TopLevelStatements.cs\").WithTopLevelStatements().Verify();\n\n    [TestMethod]\n    public void InvocationResolvesToOverrideWithParams_CS_Latest() =>\n        builder.AddPaths(\"InvocationResolvesToOverrideWithParams.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/IssueSuppressionTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class IssueSuppressionTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<IssueSuppression>();\n\n        [TestMethod]\n        public void IssueSuppression() =>\n            builder.AddPaths(\"IssueSuppression.cs\", \"IssueSuppression2.cs\").WithAutogenerateConcurrentFiles(false).Verify();\n\n        [TestMethod]\n        public void IssueSuppression_CSharp9() =>\n            builder.AddPaths(\"IssueSuppression.CSharp9.cs\").WithTopLevelStatements().Verify();\n\n        [TestMethod]\n        public void IssueSuppression_CSharp10() =>\n            builder.AddPaths(\"IssueSuppression.CSharp10.cs\").WithOptions(LanguageOptions.FromCSharp10).Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/JSInvokableMethodsShouldBePublicTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class JSInvokableMethodsShouldBePublicTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<JSInvokableMethodsShouldBePublic>().AddReferences(NuGetMetadataReference.MicrosoftJSInterop(\"7.0.14\"));\n\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    public void JSInvokableMethodsShouldBePublic_CS() =>\n        builder.AddPaths(\"JSInvokableMethodsShouldBePublic.cs\").Verify();\n\n    [TestMethod]\n    public void JSInvokableMethodsShouldBePublic_Razor() =>\n        builder\n            .AddPaths(\"JSInvokableMethodsShouldBePublic.razor\", \"JSInvokableMethodsShouldBePublic.razor.cs\")\n            .WithOptions(LanguageOptions.FromCSharp9)\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Product))\n            .Verify();\n\n    [TestMethod]\n    public void JSInvokableMethodsShouldBePublic_CS_Latest() =>\n        builder.AddPaths(\"JSInvokableMethodsShouldBePublic.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/JwtSignedTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class JwtSignedTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.JwtSigned>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.JwtSigned>();\n\n    [TestMethod]\n    public void JwtSigned_CS() =>\n        builderCS.AddPaths(\"JwtSigned.cs\")\n            .AddReferences(NuGetMetadataReference.JWT(\"6.1.0\"))\n            .Verify();\n\n    [TestMethod]\n    public void JwtSigned_JWTDecoderExtensions_CS() =>\n        builderCS.AddPaths(\"JwtSigned.Extensions.cs\")\n            .AddReferences(NuGetMetadataReference.JWT(\"7.3.1\"))\n            .Verify();\n\n    [TestMethod]\n    public void JwtSigned_CS_Latest() =>\n        builderCS.AddPaths(\"JwtSigned.Latest.cs\")\n            .WithTopLevelStatements()\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .AddReferences(NuGetMetadataReference.JWT(\"6.1.0\"))\n            .Verify();\n\n    [TestMethod]\n    public void JwtSigned_VB() =>\n        builderVB.AddPaths(\"JwtSigned.vb\")\n            .AddReferences(NuGetMetadataReference.JWT(\"6.1.0\"))\n            .Verify();\n\n    [TestMethod]\n    public void JwtSigned_JWTDecoderExtensions_VB() =>\n        builderVB.AddPaths(\"JwtSigned.Extensions.vb\")\n            .AddReferences(NuGetMetadataReference.JWT(\"7.3.1\"))\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/LdapConnectionShouldBeSecureTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class LdapConnectionShouldBeSecureTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<LdapConnectionShouldBeSecure>().AddReferences(MetadataReferenceFacade.SystemDirectoryServices);\n\n    [TestMethod]\n    public void LdapConnectionsShouldBeSecure() =>\n        builder.AddPaths(\"LdapConnectionShouldBeSecure.cs\").Verify();\n\n    [TestMethod]\n    public void LdapConnectionsShouldBeSecure_CS_Latest() =>\n        builder.AddPaths(\"LdapConnectionShouldBeSecure.Latest.cs\").WithTopLevelStatements().WithOptions(LanguageOptions.CSharpLatest).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/LineContinuationTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class LineContinuationTest\n    {\n        [TestMethod]\n        public void LineContinuation() =>\n            new VerifierBuilder<LineContinuation>().AddPaths(\"LineContinuation.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/LineLengthTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class LineLengthTest\n    {\n        [TestMethod]\n        public void LineLength_CS() =>\n            new VerifierBuilder().AddAnalyzer(() => new CS.LineLength { Maximum = 127 })\n                .AddPaths(\"LineLength.cs\")\n                .Verify();\n\n        [TestMethod]\n        public void LineLength_VB() =>\n            new VerifierBuilder().AddAnalyzer(() => new VB.LineLength { Maximum = 127 })\n                .AddPaths(\"LineLength.vb\")\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/LinkedListPropertiesInsteadOfMethodsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class LinkedListPropertiesInsteadOfMethodsTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.LinkedListPropertiesInsteadOfMethods>();\n\n    [TestMethod]\n    public void LinkedListPropertiesInsteadOfMethods_CS() =>\n        builderCS.AddPaths(\"LinkedListPropertiesInsteadOfMethods.cs\").Verify();\n\n    [TestMethod]\n    public void LinkedListPropertiesInsteadOfMethods_CS_CodeFix() =>\n        builderCS.AddPaths(\"LinkedListPropertiesInsteadOfMethods.cs\")\n            .WithCodeFix<CS.LinkedListPropertiesInsteadOfMethodsCodeFix>()\n            .WithCodeFixedPaths(\"LinkedListPropertiesInsteadOfMethods.Fixed.cs\")\n            .VerifyCodeFix();\n\n    [TestMethod]\n    [DataRow(\"First\")]\n    [DataRow(\"Last\")]\n    public void LinkedListPropertiesInsteadOfMethods_TopLevelStatements(string name) =>\n        builderCS.AddSnippet($$$\"\"\"\n            using System.Collections.Generic;\n            using System.Linq;\n\n            var data = new LinkedList<int>();\n\n            data.{{{name}}}(); // Noncompliant {{'{{{name}}}' property of 'LinkedList' should be used instead of the '{{{name}}}()' extension method.}}\n            //   {{{new string('^', name.Length)}}}\n\n            data.{{{name}}}(x => x > 0);            // Compliant\n            _ = data.{{{name}}}.Value;              // Compliant\n            data.Count();                           // Compliant\n            data.Append(1).{{{name}}}().ToString(); // Compliant\n            data?.{{{name}}}().ToString();          // Noncompliant\n\n            \"\"\").WithTopLevelStatements().Verify();\n\n    [TestMethod]\n    public void LinkedListPropertiesInsteadOfMethods_VB() =>\n        new VerifierBuilder<VB.LinkedListPropertiesInsteadOfMethods>().AddPaths(\"LinkedListPropertiesInsteadOfMethods.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/LiteralSuffixUpperCaseTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class LiteralSuffixUpperCaseTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<LiteralSuffixUpperCase>()\n        .WithWarningsAsErrors(\"CS0078\");\n\n    [TestMethod]\n    public void LiteralSuffixUpperCase() =>\n        builder.AddPaths(\"LiteralSuffixUpperCase.cs\").Verify();\n\n    [TestMethod]\n    public void LiteralSuffixUpperCase_CodeFix() =>\n        builder.AddPaths(\"LiteralSuffixUpperCase.cs\")\n            .WithCodeFix<LiteralSuffixUpperCaseCodeFix>()\n            .WithCodeFixedPaths(\"LiteralSuffixUpperCase.Fixed.cs\")\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void LiteralSuffixUpperCase_CS_Latest() =>\n        builder.AddPaths(\"LiteralSuffixUpperCase.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/LiteralsShouldNotBePassedAsLocalizedParametersTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class LiteralsShouldNotBePassedAsLocalizedParametersTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<LiteralsShouldNotBePassedAsLocalizedParameters>().AddReferences(MetadataReferenceFacade.SystemComponentModelPrimitives);\n\n        [TestMethod]\n        public void LiteralsShouldNotBePassedAsLocalizedParameters() =>\n            builder.AddPaths(\"LiteralsShouldNotBePassedAsLocalizedParameters.cs\").Verify();\n\n        [TestMethod]\n        public void LiteralsShouldNotBePassedAsLocalizedParameters_CSharp9() =>\n            builder.AddPaths(\"LiteralsShouldNotBePassedAsLocalizedParameters.CSharp9.cs\").WithTopLevelStatements().Verify();\n\n        [TestMethod]\n        public void LiteralsShouldNotBePassedAsLocalizedParameters_CSharp10() =>\n            builder.AddPaths(\"LiteralsShouldNotBePassedAsLocalizedParameters.CSharp10.cs\").WithOptions(LanguageOptions.FromCSharp10).Verify();\n\n        [TestMethod]\n        public void LiteralsShouldNotBePassedAsLocalizedParameters_CSharp11() =>\n            builder.AddPaths(\"LiteralsShouldNotBePassedAsLocalizedParameters.CSharp11.cs\").WithOptions(LanguageOptions.FromCSharp11).Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/LocalVariableNameTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class LocalVariableNameTest\n    {\n        [TestMethod]\n        public void LocalVariableName() =>\n            new VerifierBuilder<LocalVariableName>().AddPaths(\"LocalVariableName.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/LockedFieldShouldBeReadonlyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class LockedFieldShouldBeReadonlyTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<LockedFieldShouldBeReadonly>();\n\n    [TestMethod]\n    public void LockedFieldShouldBeReadonly_CS() =>\n        builder.AddPaths(\"LockedFieldShouldBeReadonly.cs\").Verify();\n\n    [TestMethod]\n    public void LockedFieldShouldBeReadonly_Latest() =>\n        builder\n            .AddPaths(\"LockedFieldShouldBeReadonly.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/LoggerFieldsShouldBePrivateStaticReadonlyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class LoggerFieldsShouldBePrivateStaticReadonlyTest\n{\n    private static readonly VerifierBuilder Builder = new VerifierBuilder<LoggerFieldsShouldBePrivateStaticReadonly>();\n\n    [TestMethod]\n    public void LoggerFieldsShouldBePrivateStaticReadonly_MicrosoftExtensionsLogging_CS() =>\n        Builder\n            .AddPaths(\"LoggerFieldsShouldBePrivateStaticReadonly.cs\")\n            .AddReferences(NuGetMetadataReference.MicrosoftExtensionsLoggingAbstractions())\n            .Verify();\n\n    [TestMethod]\n    public void LoggerFieldsShouldBePrivateStaticReadonly_CSharp8() =>\n        Builder\n            .AddSnippet(\"\"\"\n                using Microsoft.Extensions.Logging;\n\n                public class Program\n                {\n                    private protected static readonly ILogger logger;   // Noncompliant\n                    //                                        ^^^^^^\n                }\n\n                public interface Service\n                {\n                    static ILogger StaticLogger;\n                    protected internal static ILogger Logger;\n                    private static ILogger Test;\n                }\n                \"\"\")\n            .AddReferences(NuGetMetadataReference.MicrosoftExtensionsLoggingAbstractions())\n            .WithOptions(LanguageOptions.FromCSharp8)\n            .Verify();\n\n    [TestMethod]\n    public void LoggerFieldsShouldBePrivateStaticReadonly_Serilog_CS() =>\n        Builder\n            .AddSnippet(\"\"\"\n                using Serilog;\n\n                public class Program\n                {\n                    ILogger log1, log2;\n                    //      ^^^^ {{Make the logger 'log1' private static readonly.}}\n                    //            ^^^^ @-1 {{Make the logger 'log2' private static readonly.}}\n                }\n                \"\"\")\n            .AddReferences(NuGetMetadataReference.Serilog())\n            .Verify();\n\n    [TestMethod]\n    public void LoggerFieldsShouldBePrivateStaticReadonly_NLog_CS() =>\n        Builder\n            .AddSnippet(\"\"\"\n                using NLog;\n\n                public class Program\n                {\n                    ILogger log1, log2;\n                    //      ^^^^ {{Make the logger 'log1' private static readonly.}}\n                    //            ^^^^ @-1 {{Make the logger 'log2' private static readonly.}}\n\n                    Logger log3;        // Noncompliant\n                    ILoggerBase log4;   // Noncompliant\n                    MyLogger log5;      // Noncompliant\n                }\n                public class MyLogger : Logger { }\n                \"\"\")\n            .AddReferences(NuGetMetadataReference.NLog())\n            .Verify();\n\n    [TestMethod]\n    public void LoggerFieldsShouldBePrivateStaticReadonly_log4net_CS() =>\n        Builder\n            .AddSnippet(\"\"\"\n                using log4net;\n                using log4net.Core;\n                using log4net.Repository.Hierarchy;\n\n                public class Program\n                {\n                    ILog log1,log2;\n                    //   ^^^^ {{Make the logger 'log1' private static readonly.}}\n                    //        ^^^^ @-1 {{Make the logger 'log2' private static readonly.}}\n\n                    ILogger log3;                           // Noncompliant\n                    Logger log4;                            // Noncompliant\n                    MyLogger log5;                          // Noncompliant\n                }\n                public class MyLogger : Logger\n                {\n                    public MyLogger(string name) : base(name) { }\n                }\n                \"\"\")\n            .AddReferences(NuGetMetadataReference.Log4Net(TestConstants.NuGetLatestVersion, \"netstandard2.0\"))\n            .Verify();\n\n    [TestMethod]\n    public void LoggerFieldsShouldBePrivateStaticReadonly_CastleCore_CS() =>\n        Builder\n            .AddSnippet(\"\"\"\n                using Castle.Core.Logging;\n\n                public class Program\n                {\n                    ILogger log;                            // Noncompliant {{Make the logger 'log' private static readonly.}}\n                    //      ^^^\n                }\n                \"\"\")\n            .AddReferences(NuGetMetadataReference.CastleCore())\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/LoggerMembersNamesShouldComplyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class LoggerMembersNamesShouldComplyTest\n{\n    private static readonly VerifierBuilder Builder = new VerifierBuilder<LoggerMembersNamesShouldComply>();\n\n    [TestMethod]\n    [DataRow(\"log\")]\n    [DataRow(\"_log\")]\n    [DataRow(\"Log\")]\n    [DataRow(\"_Log\")]\n    [DataRow(\"logger\")]\n    [DataRow(\"_logger\")]\n    [DataRow(\"Logger\")]\n    [DataRow(\"_Logger\")]\n    [DataRow(\"instance\")]\n    [DataRow(\"Instance\")]\n    public void LoggerMembersNamesShouldComply_Compliant_CS(string name) =>\n        Builder.AddSnippet($$\"\"\"\n            using System;\n            using Microsoft.Extensions.Logging;\n\n            public class One\n            {\n                ILogger {{name}};                       // Compliant\n            }\n            public class Two\n            {\n                ILogger<string> {{name}} { get; set; }  // Compliant\n            }\n            \"\"\")\n            .AddReferences(NuGetMetadataReference.MicrosoftExtensionsLoggingAbstractions())\n            .VerifyNoIssues();\n\n    [TestMethod]\n    public void LoggerMembersNamesShouldComply_MicrosoftExtensionsLogging_CS() =>\n        Builder.AddSnippet(\"\"\"\n            using System;\n            using Microsoft.Extensions.Logging;\n\n            public class Program\n            {\n                string mylogger;                        // Compliant\n\n                ILogger _log2;                          // Noncompliant {{Rename this field '_log2' to match the regular expression '^_?[Ll]og(ger)?$'.}}\n                ILogger<Program> mylog { get; set; }    // Noncompliant {{Rename this property 'mylog' to match the regular expression '^_?[Ll]og(ger)?$'.}}\n                //               ^^^^^\n\n                ILogger myLogger, _Log2, _logger;\n                //      ^^^^^^^^ {{Rename this field 'myLogger' to match the regular expression '^_?[Ll]og(ger)?$'.}}\n                //                ^^^^^ @-1 {{Rename this field '_Log2' to match the regular expression '^_?[Ll]og(ger)?$'.}}\n            }\n            \"\"\")\n            .AddReferences(NuGetMetadataReference.MicrosoftExtensionsLoggingAbstractions())\n            .Verify();\n\n    [TestMethod]\n    public void LoggerMembersNamesShouldComply_Serilog_CS() =>\n        Builder.AddSnippet(\"\"\"\n            using Serilog;\n\n            public class Program\n            {\n                string mylogger;                        // Compliant\n                ILogger _Logger;                        // Compliant\n                ILogger log;                            // Compliant\n\n                ILogger _log2;                          // Noncompliant {{Rename this field '_log2' to match the regular expression '^_?[Ll]og(ger)?$'.}}\n                ILogger mylog { get; set; }             // Noncompliant {{Rename this property 'mylog' to match the regular expression '^_?[Ll]og(ger)?$'.}}\n                //      ^^^^^\n\n                ILogger myLogger, _Log2, _logger;\n                //      ^^^^^^^^ {{Rename this field 'myLogger' to match the regular expression '^_?[Ll]og(ger)?$'.}}\n                //                ^^^^^ @-1 {{Rename this field '_Log2' to match the regular expression '^_?[Ll]og(ger)?$'.}}\n            }\n            \"\"\")\n            .AddReferences(NuGetMetadataReference.Serilog())\n            .Verify();\n\n    [TestMethod]\n    public void LoggerMembersNamesShouldComply_NLog_CS() =>\n        Builder.AddSnippet(\"\"\"\n            using NLog;\n\n            public class Program\n            {\n                string mylogger;                        // Compliant\n                ILogger _Logger;                        // Compliant\n                ILoggerBase log;                        // Compliant\n\n                MyLogger _log2;                         // Noncompliant {{Rename this field '_log2' to match the regular expression '^_?[Ll]og(ger)?$'.}}\n                ILoggerBase my_logger;                  // Noncompliant {{Rename this field 'my_logger' to match the regular expression '^_?[Ll]og(ger)?$'.}}\n                Logger mylog { get; set; }              // Noncompliant {{Rename this property 'mylog' to match the regular expression '^_?[Ll]og(ger)?$'.}}\n                //     ^^^^^\n\n                ILogger myLogger, _Log2, _logger;\n                //      ^^^^^^^^ {{Rename this field 'myLogger' to match the regular expression '^_?[Ll]og(ger)?$'.}}\n                //                ^^^^^ @-1 {{Rename this field '_Log2' to match the regular expression '^_?[Ll]og(ger)?$'.}}\n            }\n            public class MyLogger : Logger { }\n            \"\"\")\n            .AddReferences(NuGetMetadataReference.NLog())\n            .Verify();\n\n    [TestMethod]\n    public void LoggerMembersNamesShouldComply_log4net_CS() =>\n        Builder.AddSnippet(\"\"\"\n            using log4net;\n            using log4net.Core;\n            using log4net.Repository.Hierarchy;\n\n            public class Program\n            {\n                string mylogger;                        // Compliant\n                ILog log;                               // Compliant\n                ILogger _Logger;                        // Compliant\n                Logger _log;                            // Compliant\n\n                ILogger _log2;                          // Noncompliant {{Rename this field '_log2' to match the regular expression '^_?[Ll]og(ger)?$'.}}\n                ILog my_logger;                         // Noncompliant {{Rename this field 'my_logger' to match the regular expression '^_?[Ll]og(ger)?$'.}}\n                Logger mylog { get; set; }              // Noncompliant {{Rename this property 'mylog' to match the regular expression '^_?[Ll]og(ger)?$'.}}\n                //     ^^^^^\n\n                MyLogger myLogger, _Log2, _logger;\n                //       ^^^^^^^^ {{Rename this field 'myLogger' to match the regular expression '^_?[Ll]og(ger)?$'.}}\n                //                 ^^^^^ @-1 {{Rename this field '_Log2' to match the regular expression '^_?[Ll]og(ger)?$'.}}\n            }\n            public class MyLogger : Logger\n            {\n                public MyLogger(string name) : base(name) { }\n            }\n            \"\"\")\n            .AddReferences(NuGetMetadataReference.Log4Net(TestConstants.NuGetLatestVersion, \"netstandard2.0\"))\n            .Verify();\n\n    [TestMethod]\n    public void LoggerMembersNamesShouldComply_CastleCore_CS() =>\n        Builder.AddSnippet(\"\"\"\n            using Castle.Core.Logging;\n\n            public class Program\n            {\n                string mylogger;                        // Compliant\n                ILogger log;                            // Compliant\n\n                ILogger _log2;                          // Noncompliant {{Rename this field '_log2' to match the regular expression '^_?[Ll]og(ger)?$'.}}\n                ILogger mylog { get; set; }             // Noncompliant {{Rename this property 'mylog' to match the regular expression '^_?[Ll]og(ger)?$'.}}\n                //      ^^^^^\n\n                ILogger myLogger, _Log2, _logger;\n                //      ^^^^^^^^ {{Rename this field 'myLogger' to match the regular expression '^_?[Ll]og(ger)?$'.}}\n                //                ^^^^^ @-1 {{Rename this field '_Log2' to match the regular expression '^_?[Ll]og(ger)?$'.}}\n            }\n            \"\"\")\n            .AddReferences(NuGetMetadataReference.CastleCore())\n            .Verify();\n\n    [TestMethod]\n    public void LoggerMembersNamesShouldComply_Parameterized_CS() =>\n        new VerifierBuilder()\n            .AddAnalyzer(() => new LoggerMembersNamesShouldComply { Format = \"^chocolate$\" })\n            .AddSnippet(\"\"\"\n                using System;\n                using Microsoft.Extensions.Logging;\n\n                public class Program\n                {\n                    ILogger chocolate;                      // Compliant\n                    ILogger running;                        // Noncompliant {{Rename this field 'running' to match the regular expression '^chocolate$'.}}\n                }\n                \"\"\")\n            .AddReferences(NuGetMetadataReference.MicrosoftExtensionsLoggingAbstractions())\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/LoggersShouldBeNamedForEnclosingTypeTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class LoggersShouldBeNamedForEnclosingTypeTest\n{\n    private static readonly VerifierBuilder Builder = new VerifierBuilder<LoggersShouldBeNamedForEnclosingType>();\n\n    [TestMethod]\n    public void LoggersShouldBeNamedForEnclosingType_CS() =>\n        Builder\n            .AddPaths(\"LoggersShouldBeNamedForEnclosingType.cs\")\n            .AddReferences(NuGetMetadataReference.MicrosoftExtensionsLoggingPackages(TestConstants.NuGetLatestVersion))\n            .Verify();\n\n    [TestMethod]\n    public void LoggersShouldBeNamedForEnclosingType_TopLevelStatements_CS() =>\n        Builder\n            .AddSnippet(\"\"\"\n                using Microsoft.Extensions.Logging;\n\n                ILoggerFactory factory = null;\n\n                factory.CreateLogger<int>();                       // Compliant\n                factory.CreateLogger(typeof(int).Name);            // Compliant\n                factory.CreateLogger(nameof(RandomType));          // Compliant\n\n                class RandomType { }\n                \"\"\")\n            .AddReferences(NuGetMetadataReference.MicrosoftExtensionsLoggingAbstractions())\n            .WithTopLevelStatements()\n            .VerifyNoIssues();\n\n    [TestMethod]\n    public void LoggersShouldBeNamedForEnclosingType_NLog_CS() =>\n        Builder\n            .AddPaths(\"LoggersShouldBeNamedForEnclosingType.NLog.cs\")\n            .AddReferences(NuGetMetadataReference.NLog(\"5.5.0\"))\n            .Verify();\n\n    [TestMethod]\n    public void LoggersShouldBeNamedForEnclosingType_Log4net_CS() =>\n        Builder\n            .AddSnippet(\"\"\"\n                using System.Reflection;\n                using log4net;\n\n                public class EnclosingType\n                {\n                    void Method(Assembly assembly)\n                    {\n                        LogManager.GetLogger(nameof(EnclosingType));                    // Compliant\n                        LogManager.GetLogger(typeof(EnclosingType).Name);               // Compliant\n\n                        LogManager.GetLogger(nameof(AnotherType));                      // Noncompliant {{Update this logger to use its enclosing type.}}\n                        //                          ^^^^^^^^^^^\n                        LogManager.GetLogger(typeof(AnotherType).Name);                 // Noncompliant\n                        //                          ^^^^^^^^^^^\n\n                        // These methods are not tracked\n                        LogManager.GetLogger(nameof(AnotherType), nameof(AnotherType)); // Compliant\n                        LogManager.GetLogger(nameof(AnotherType), typeof(AnotherType)); // Compliant\n                        LogManager.GetLogger(assembly, nameof(AnotherType));            // Compliant\n                        LogManager.GetLogger(assembly, typeof(AnotherType));            // Compliant\n                    }\n                }\n\n                class AnotherType : EnclosingType { }\n                \"\"\")\n            .AddReferences(NuGetMetadataReference.Log4Net(\"2.0.8\", \"net45-full\"))\n            .Verify();\n\n#if NET\n\n    [TestMethod]\n    public void LoggersShouldBeNamedForEnclosingType_NLogLatest_CS() =>\n        Builder\n            .AddPaths(\"LoggersShouldBeNamedForEnclosingType.NLog.cs\")\n            .AddReferences(NuGetMetadataReference.NLog())\n            .Verify();\n\n#endif\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/LoggingArgumentsShouldBePassedCorrectlyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class LoggingArgumentsShouldBePassedCorrectlyTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<LoggingArgumentsShouldBePassedCorrectly>();\n\n    [TestMethod]\n    public void LoggingArgumentsShouldBePassedCorrectly_CS() =>\n        builder.AddPaths(\"LoggingArgumentsShouldBePassedCorrectly.cs\").AddReferences(NuGetMetadataReference.MicrosoftExtensionsLoggingAbstractions()).Verify();\n\n    [TestMethod]\n    [DataRow(\"LogCritical\")]\n    [DataRow(\"LogDebug\")]\n    [DataRow(\"LogError\")]\n    [DataRow(\"LogInformation\")]\n    [DataRow(\"LogTrace\")]\n    [DataRow(\"LogWarning\")]\n    public void LoggingArgumentsShouldBePassedCorrectly_MicrosoftExtensionsLogging_NonCompliant_CS(string methodName) =>\n        builder.AddSnippet($$\"\"\"\n            using System;\n            using Microsoft.Extensions.Logging;\n            using Microsoft.Extensions.Logging.Abstractions;\n\n            public class Program\n            {\n                public void Method(ILogger logger, Exception e)\n                {\n                    logger.{{methodName}}(\"Expected exception.\");\n                    logger.{{methodName}}(e, \"Expected exception.\");\n                    logger.{{methodName}}(null, \"Expected exception.\", e);                                                                     // FN\n                    logger.{{methodName}}(new EventId(), \"Expected exception.\");\n                    logger.{{methodName}}(new EventId(), e, \"Expected exception.\");\n                    LoggerExtensions.{{methodName}}(logger, \"Expected exception.\");\n                    LoggerExtensions.{{methodName}}(logger, new EventId(), e, \"Expected exception.\");\n\n                    logger.{{methodName}}(new EventId(), e, \"Expected exception.\", e, new EventId(), LogLevel.Critical);                       // Noncompliant (log level)\n                                                                                                                                               // Secondary @-1\n                    logger.{{methodName}}(new EventId(), \"Expected exception.\", e, new EventId(), LogLevel.Critical);                          // Noncompliant (exception, log level)\n                                                                                                                                               // Secondary @-1\n                                                                                                                                               // Secondary @-2\n                    logger.{{methodName}}(e, \"Expected exception.\", e, new EventId(), LogLevel.Critical);                                      // Noncompliant (event id, log level)\n                                                                                                                                               // Secondary @-1\n                                                                                                                                               // Secondary @-2\n                    logger.{{methodName}}(\"Expected exception.\", e, new EventId(), LogLevel.Critical);                                         // Noncompliant (exception, event id, log level)\n                                                                                                                                               // Secondary @-1\n                                                                                                                                               // Secondary @-2\n                                                                                                                                               // Secondary @-3\n                    LoggerExtensions.{{methodName}}(logger, \"Expected exception.\", e, new EventId(), LogLevel.Critical);                       // Noncompliant (exception, event id, log level)\n                                                                                                                                               // Secondary @-1\n                                                                                                                                               // Secondary @-2\n                                                                                                                                               // Secondary @-3\n                    LoggerExtensions.{{methodName}}(logger, new EventId(), e, \"Expected exception.\", e, new EventId(), LogLevel.Critical);     // Noncompliant (log level)\n                                                                                                                                               // Secondary @-1\n                }\n            }\n            \"\"\")\n            .AddReferences(NuGetMetadataReference.MicrosoftExtensionsLoggingAbstractions())\n            .Verify();\n\n    [TestMethod]\n    public void LoggingArgumentsShouldBePassedCorrectly_MicrosoftExtensionsLogging_Log_CS() =>\n        builder.AddSnippet(\"\"\"\n            using System;\n            using Microsoft.Extensions.Logging;\n            using Microsoft.Extensions.Logging.Abstractions;\n\n            public class Program\n            {\n                public void Method(ILogger logger, Exception e)\n                {\n                    logger.Log(LogLevel.Warning, \"Expected exception.\");\n                    logger.Log(LogLevel.Warning, e, \"Expected exception.\");\n                    logger.Log(LogLevel.Warning, new EventId(), \"Expected exception.\");\n                    logger.Log(LogLevel.Warning, new EventId(), e, \"Expected exception.\");\n                    LoggerExtensions.Log(logger, LogLevel.Warning, \"Expected exception.\");\n                    LoggerExtensions.Log(logger, LogLevel.Warning, new EventId(), e, \"Expected exception.\");\n\n                    logger.Log(LogLevel.Warning, new EventId(), e, \"Expected exception.\", e, new EventId(), LogLevel.Critical);\n                    logger.Log(LogLevel.Warning, new EventId(), \"Expected exception.\", e, new EventId(), LogLevel.Critical);                          // Noncompliant (exception)\n                                                                                                                                                      // Secondary @-1\n                    logger.Log(LogLevel.Warning, e, \"Expected exception.\", e, new EventId(), LogLevel.Critical);                                      // Noncompliant (event id)\n                                                                                                                                                      // Secondary @-1\n                    logger.Log(LogLevel.Warning, \"Expected exception.\", e, new EventId(), LogLevel.Critical);                                         // Noncompliant (exception, event id)\n                                                                                                                                                      // Secondary @-1\n                                                                                                                                                      // Secondary @-2\n                    LoggerExtensions.Log(logger, LogLevel.Warning, \"Expected exception.\", e, new EventId(), LogLevel.Critical);                       // Noncompliant (exception, event id)\n                                                                                                                                                      // Secondary @-1\n                                                                                                                                                      // Secondary @-2\n                    LoggerExtensions.Log(logger, LogLevel.Warning, new EventId(), e, \"Expected exception.\", e, new EventId(), LogLevel.Critical);\n                }\n            }\n            \"\"\")\n            .AddReferences(NuGetMetadataReference.MicrosoftExtensionsLoggingAbstractions())\n            .Verify();\n\n    [TestMethod]\n    [DataRow(\"DebugFormat\")]\n    [DataRow(\"ErrorFormat\")]\n    [DataRow(\"FatalFormat\")]\n    [DataRow(\"InfoFormat\")]\n    [DataRow(\"TraceFormat\")]\n    [DataRow(\"WarnFormat\")]\n    public void LoggingArgumentsShouldBePassedCorrectly_CastleCore_CS(string methodName) =>\n        builder.AddSnippet($$\"\"\"\n            using System;\n            using System.Globalization;\n            using Castle.Core.Logging;\n\n            public class Program\n            {\n                public void Method(ILogger logger, string message, Exception e)\n                {\n                    logger.{{methodName}}(message);                                       // Compliant\n                    logger.{{methodName}}(message, e);                                    // Noncompliant\n                                                                                          // Secondary @-1\n                    logger.{{methodName}}(CultureInfo.CurrentCulture, message);           // Compliant\n                    logger.{{methodName}}(CultureInfo.CurrentCulture, message, e);        // Noncompliant\n                                                                                          // Secondary @-1\n                    logger.{{methodName}}(e, message);                                    // Compliant\n                    logger.{{methodName}}(e, message, e);                                 // Compliant\n                    logger.{{methodName}}(e, CultureInfo.CurrentCulture, message);        // Compliant\n                    logger.{{methodName}}(e, CultureInfo.CurrentCulture, message, e);     // Compliant\n                }\n            }\n            \"\"\")\n            .AddReferences(NuGetMetadataReference.CastleCore())\n            .Verify();\n\n    [TestMethod]\n    [DataRow(\"Log\", \"LogLevel.Debug,\", \"\")]\n    [DataRow(\"Debug\")]\n    [DataRow(\"ConditionalDebug\")]\n    [DataRow(\"Error\")]\n    [DataRow(\"Fatal\")]\n    [DataRow(\"Info\")]\n    [DataRow(\"Trace\")]\n    [DataRow(\"ConditionalTrace\")]\n    [DataRow(\"Warn\")]\n    public void LoggingArgumentsShouldBePassedCorrectly_NLog_CS(string methodName, string logLevel = \"\", string logLevelExpectation = \"// Secondary @-2\") =>\n        builder.AddSnippet($$\"\"\"\n            using System;\n            using System.Globalization;\n            using NLog;\n\n            public class Program\n            {\n                public void Method(Logger logger, Exception e)\n                {\n                    logger.{{methodName}}({{logLevel}} e);                                                    // Compliant\n                    logger.{{methodName}}({{logLevel}} CultureInfo.CurrentCulture, e);                        // Compliant\n                    logger.{{methodName}}({{logLevel}} e, \"Message!\");                                        // Compliant\n                    logger.{{methodName}}({{logLevel}} e, \"Message!\", e);                                     // Compliant\n                    logger.{{methodName}}({{logLevel}} e, CultureInfo.CurrentCulture, \"Message!\", e);         // Compliant\n                    logger.{{methodName}}({{logLevel}} CultureInfo.CurrentCulture, \"Message!\", 1, 2, 3, e);   // Noncompliant\n                                                                                                              // Secondary @-1\n                    logger.{{methodName}}({{logLevel}} \"Message!\");                                           // Compliant\n                    logger.{{methodName}}({{logLevel}} \"Message!\", 1, 2, 3, e);                               // Noncompliant\n                                                                                                              // Secondary @-1\n                    logger.{{methodName}}({{logLevel}} \"Message!\", e);                                        // Noncompliant\n                                                                                                              // Secondary @-1\n                    logger.{{methodName}}({{logLevel}} CultureInfo.CurrentCulture, \"Message!\", e);            // Noncompliant\n                                                                                                              // Secondary @-1\n                    logger.{{methodName}}<int>({{logLevel}} \"Message!\", 1);                                   // Compliant\n                    logger.{{methodName}}<Exception>({{logLevel}} \"Message!\", e);                             // Noncompliant\n                                                                                                              // Secondary @-1\n                    logger.{{methodName}}({{logLevel}}CultureInfo.CurrentCulture, \"Message!\", 1, e);          // Noncompliant\n                                                                                                              // Secondary @-1\n                    logger.{{methodName}}({{logLevel}} \"Message!\", 1, e);                                     // Noncompliant\n                                                                                                              // Secondary @-1\n                    logger.{{methodName}}({{logLevel}} CultureInfo.CurrentCulture, \"Message!\", 1, 2, e);      // Noncompliant\n                                                                                                              // Secondary @-1\n                    logger.{{methodName}}({{logLevel}} \"Message!\", 1, LogLevel.Debug, e);                     // Noncompliant\n                                                                                                              // Secondary @-1\n                                                                                                              {{logLevelExpectation}}\n                    ILoggerExtensions.{{methodName}}(logger, {{logLevel}} e, null);                           // Compliant\n                }\n            }\n            \"\"\")\n            .AddReferences(NuGetMetadataReference.NLog())\n            .Verify();\n\n    [TestMethod]\n    [DataRow(\"ConditionalDebug\")]\n    [DataRow(\"ConditionalTrace\")]\n    public void LoggingArgumentsShouldBePassedCorrectly_NLog_ConditionalExtensions_CS(string methodName) =>\n        builder.AddSnippet($$\"\"\"\n            using System;\n            using System.Globalization;\n            using NLog;\n\n            public class Program\n            {\n                public void Method(Logger logger, Exception e)\n                {\n                    ILoggerExtensions.{{methodName}}(logger, e);                                                    // Compliant\n                    ILoggerExtensions.{{methodName}}(logger, CultureInfo.CurrentCulture, e);                        // Compliant\n                    ILoggerExtensions.{{methodName}}(logger, e, \"Message!\");                                        // Compliant\n                    ILoggerExtensions.{{methodName}}(logger, e, \"Message!\", e);                                     // Compliant\n                    ILoggerExtensions.{{methodName}}(logger, e, CultureInfo.CurrentCulture, \"Message!\", e);         // Compliant\n                    ILoggerExtensions.{{methodName}}(logger, CultureInfo.CurrentCulture, \"Message!\", 1, 2, 3, e);   // Noncompliant\n                                                                                                                    // Secondary @-1\n                    ILoggerExtensions.{{methodName}}(logger, \"Message!\");                                           // Compliant\n                    ILoggerExtensions.{{methodName}}(logger, \"Message!\", 1, 2, 3, e);                               // Noncompliant\n                                                                                                                    // Secondary @-1\n                    ILoggerExtensions.{{methodName}}(logger, \"Message!\", e);                                        // Noncompliant\n                                                                                                                    // Secondary @-1\n                    ILoggerExtensions.{{methodName}}(logger, CultureInfo.CurrentCulture, \"Message!\", e);            // Noncompliant\n                                                                                                                    // Secondary @-1\n                    ILoggerExtensions.{{methodName}}<int>(logger, \"Message!\", 1);                                   // Compliant\n                    ILoggerExtensions.{{methodName}}<Exception>(logger, \"Message!\", e);                             // Noncompliant\n                                                                                                                    // Secondary @-1\n                    ILoggerExtensions.{{methodName}}(logger, CultureInfo.CurrentCulture, \"Message!\", 1, e);         // Noncompliant\n                                                                                                                    // Secondary @-1\n                    ILoggerExtensions.{{methodName}}(logger, \"Message!\", 1, e);                                     // Noncompliant\n                                                                                                                    // Secondary @-1\n                    ILoggerExtensions.{{methodName}}(logger, CultureInfo.CurrentCulture, \"Message!\", 1, 2, e);      // Noncompliant\n                                                                                                                    // Secondary @-1\n                    ILoggerExtensions.{{methodName}}(logger, \"Message!\", 1, 2, e);                                  // Noncompliant\n                                                                                                                    // Secondary @-1\n                }\n            }\n            \"\"\")\n            .AddReferences(NuGetMetadataReference.NLog())\n            .Verify();\n\n    [TestMethod]\n    [DataRow(\"Debug\")]\n    [DataRow(\"Error\")]\n    [DataRow(\"Fatal\")]\n    [DataRow(\"Information\")]\n    [DataRow(\"Verbose\")]\n    [DataRow(\"Warning\")]\n    public void LoggingArgumentsShouldBePassedCorrectly_Serilog_CS(string methodName) =>\n        builder.AddSnippet($$\"\"\"\n            using System;\n            using Serilog;\n\n            public class Program\n            {\n                public void Method(ILogger logger, string message, Exception e)\n                {\n                    Log.{{methodName}}(\"Message!\");\n                    Log.{{methodName}}(\"Message!\", e);                                   // Noncompliant\n                                                                                         // Secondary @-1\n                    Log.{{methodName}}<int>(\"Message!\", 1);\n                    Log.{{methodName}}<Exception>(\"Message!\", e);                        // Noncompliant\n                                                                                         // Secondary @-1\n                    Log.{{methodName}}<int, Exception>(\"Message!\", 1, e);                // Noncompliant\n                                                                                         // Secondary @-1\n                    Log.{{methodName}}<int, Exception, bool>(\"Message!\", 1, e, true);    // Noncompliant\n                                                                                         // Secondary @-1\n                    Log.{{methodName}}(\"Message!\", 1, 2, 3, e, true);                    // Noncompliant\n                                                                                         // Secondary @-1\n                    Log.{{methodName}}(e, \"Message\");\n                    Log.{{methodName}}<Exception>(e, \"Message\", e);\n                    Log.{{methodName}}<int, Exception>(e, \"Message\", 1, e);\n                    Log.{{methodName}}<int, Exception, bool>(e, \"Message\", 1, e, true);\n                    Log.{{methodName}}(e, \"Message!\", 1, 2, 3, e, true);\n                }\n            }\n            \"\"\")\n            .AddReferences(NuGetMetadataReference.Serilog())\n            .Verify();\n\n    [TestMethod]\n    public void LoggingArgumentsShouldBePassedCorrectly_Serilog_Write_CS() =>\n    builder.AddSnippet(\"\"\"\n        using System;\n        using Serilog;\n        using Serilog.Events;\n\n        public class Program\n        {\n            public void Method(LogEvent logEvent, LogEventLevel level, Exception exception)\n            {\n                Log.Write(logEvent);\n                Log.Write(level, \"Message\");\n                Log.Write(level, \"Message\", level);\n                Log.Write(level, \"Message\", 1);\n                Log.Write(level, \"Message\", level, exception);                      // Noncompliant\n                                                                                    // Secondary @-1\n                Log.Write(level, \"Message\", 1, exception, 2);                       // Noncompliant\n                                                                                    // Secondary @-1\n                Log.Write(level, \"Message\", level, exception, 1, 2);                // Noncompliant\n                                                                                    // Secondary @-1\n                Log.Write(level, exception, \"Message\");\n                Log.Write(level, exception, \"Message\", level);\n                Log.Write(level, exception, \"Message\", level, exception);\n                Log.Write(level, exception, \"Message\", level, exception, 1);\n                Log.Write(level, exception, \"Message\", level, exception, 1, 2);\n            }\n        }\n        \"\"\")\n        .AddReferences(NuGetMetadataReference.Serilog())\n        .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/LoggingTemplatePlaceHoldersShouldBeInOrderTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\nusing SonarAnalyzer.CSharp.Rules.MessageTemplates;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class LoggingTemplatePlaceHoldersShouldBeInOrderTest\n{\n    private static readonly VerifierBuilder Builder = new VerifierBuilder<MessageTemplateAnalyzer>().WithOnlyDiagnostics(LoggingTemplatePlaceHoldersShouldBeInOrder.S6673);\n\n    [TestMethod]\n    public void LoggingTemplatePlaceHoldersShouldBeInOrder_CS() =>\n        Builder.AddReferences(NuGetMetadataReference.MicrosoftExtensionsLoggingAbstractions())\n            .AddPaths(\"LoggingTemplatePlaceHoldersShouldBeInOrder.cs\")\n            .Verify();\n\n    [TestMethod]\n    [DataRow(\"LogCritical\")]\n    [DataRow(\"LogDebug\")]\n    [DataRow(\"LogError\")]\n    [DataRow(\"LogInformation\")]\n    [DataRow(\"LogTrace\")]\n    [DataRow(\"LogWarning\")]\n    public void LoggingTemplatePlaceHoldersShouldBeInOrder_MicrosoftExtensionsLogging_CS(string methodName) =>\n        Builder.AddReferences(NuGetMetadataReference.MicrosoftExtensionsLoggingAbstractions())\n            .AddSnippet($$\"\"\"\n                using System;\n                using Microsoft.Extensions.Logging;\n\n                public class Program\n                {\n                    public void Method(ILogger logger, int first, int second)\n                    {\n                        logger.{{methodName}}(\"{First} {Second}\", first, second);   // Compliant\n                        logger.{{methodName}}(\"{First} {Second}\", second, first);   // Noncompliant\n                                                                                    // Secondary @-1\n                    }\n                }\n                \"\"\").Verify();\n\n    [TestMethod]\n    [DataRow(\"Debug\")]\n    [DataRow(\"Error\")]\n    [DataRow(\"Information\")]\n    [DataRow(\"Fatal\")]\n    [DataRow(\"Warning\")]\n    [DataRow(\"Verbose\")]\n    public void LoggingTemplatePlaceHoldersShouldBeInOrder_Serilog_CS(string methodName) =>\n        Builder.AddReferences(NuGetMetadataReference.Serilog(TestConstants.NuGetLatestVersion))\n            .AddSnippet($$\"\"\"\n                using Serilog;\n                using Serilog.Events;\n\n                public class Program\n                {\n                    public void Method(ILogger logger, int first, int second)\n                    {\n                        logger.{{methodName}}(\"{First} {Second}\", first, second);   // Compliant\n                        logger.{{methodName}}(\"{First} {Second}\", second, first);   // Noncompliant\n                                                                                    // Secondary @-1\n                    }\n                }\n                \"\"\").Verify();\n\n    [TestMethod]\n    [DataRow(\"Debug\")]\n    [DataRow(\"ConditionalDebug\")]\n    [DataRow(\"Error\")]\n    [DataRow(\"Fatal\")]\n    [DataRow(\"Info\")]\n    [DataRow(\"Trace\")]\n    [DataRow(\"ConditionalTrace\")]\n    [DataRow(\"Warn\")]\n    public void LoggingTemplatePlaceHoldersShouldBeInOrder_NLog_CS(string methodName) =>\n        Builder.AddReferences(NuGetMetadataReference.NLog(TestConstants.NuGetLatestVersion))\n            .AddSnippet($$\"\"\"\n                using NLog;\n\n                public class Program\n                {\n                    public void Method(ILogger iLogger, Logger logger, MyLogger myLogger, int first, int second)\n                    {\n                        iLogger.{{methodName}}(\"{First} {Second}\", first, second);  // Compliant\n                        iLogger.{{methodName}}(\"{First} {Second}\", second, first);  // Noncompliant\n                                                                                    // Secondary @-1\n\n                        logger.{{methodName}}(\"{First} {Second}\", first, second);   // Compliant\n                        logger.{{methodName}}(\"{First} {Second}\", second, first);   // Noncompliant\n                                                                                    // Secondary @-1\n\n                        myLogger.{{methodName}}(\"{First} {Second}\", first, second); // Compliant\n                        myLogger.{{methodName}}(\"{First} {Second}\", second, first); // Noncompliant\n                                                                                    // Secondary @-1\n                    }\n                }\n\n                public class MyLogger : Logger { }\n                \"\"\").Verify();\n\n    [TestMethod]\n    public void LoggingTemplatePlaceHoldersShouldBeInOrder_FakeLoggerWithSameName() =>\n        Builder.AddSnippet(\"\"\"\n            public class Program\n            {\n                public void Method(ILogger logger, int first, int second)\n                {\n                    logger.Info(\"{First} {Second}\", first, second);     // Compliant\n                    logger.Info(\"{First} {Second}\", second, first);     // Compliant - the method is not from any of the known logging frameworks\n                }\n            }\n\n            public interface ILogger\n            {\n                void Info(string message, params object[] args);\n            }\n            \"\"\").VerifyNoIssues();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/LoopsAndLinqTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class LoopsAndLinqTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<LoopsAndLinq>();\n\n    [TestMethod]\n    public void LoopsAndLinq_CS() =>\n        builder.AddPaths(\"LoopsAndLinq.cs\")\n            .AddReferences(MetadataReferenceFacade.SystemData)\n            .Verify();\n\n    [TestMethod]\n    public void LoopsAndLinq_CS_Latest() =>\n        builder.AddPaths(\"LoopsAndLinq.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/LooseFilePermissionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class LooseFilePermissionsTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder().AddAnalyzer(() => new CS.LooseFilePermissions());\n    private readonly VerifierBuilder builderVB = new VerifierBuilder().AddAnalyzer(() => new VB.LooseFilePermissions());\n\n    [TestMethod]\n    public void LooseFilePermissions_Windows_CS() =>\n        builderCS.AddPaths(\"LooseFilePermissions.Windows.cs\").Verify();\n\n    [TestMethod]\n    public void LooseFilePermissions_Windows_VB() =>\n        builderVB.AddPaths(\"LooseFilePermissions.Windows.vb\").Verify();\n\n    [TestMethod]\n    public void LooseFilePermissions_Windows_CSharp9() =>\n        builderCS.AddPaths(\"LooseFilePermissions.Windows.CSharp9.cs\")\n            .WithTopLevelStatements()\n            .Verify();\n\n    [TestMethod]\n    public void LooseFilePermissions_Windows_CSharp10() =>\n        builderCS.AddPaths(\"LooseFilePermissions.Windows.CSharp10.cs\")\n            .WithTopLevelStatements()\n            .WithOptions(LanguageOptions.FromCSharp10)\n            .Verify();\n\n    [TestMethod]\n    public void LooseFilePermissions_Windows_CSharp11() =>\n        builderCS.AddPaths(\"LooseFilePermissions.Windows.CSharp11.cs\")\n            .WithTopLevelStatements()\n            .WithOptions(LanguageOptions.FromCSharp11)\n            .Verify();\n\n    [TestMethod]\n    public void LooseFilePermissions_Windows_CSharp12() =>\n        builderCS.AddPaths(\"LooseFilePermissions.Windows.CSharp12.cs\")\n            .WithOptions(LanguageOptions.FromCSharp12)\n            .Verify();\n\n    [TestMethod]\n    public void LooseFilePermissions_Unix_CS() =>\n        builderCS.AddPaths(\"LooseFilePermissions.Unix.cs\")\n            .AddReferences(NuGetMetadataReference.MonoPosixNetStandard())\n            .Verify();\n\n    [TestMethod]\n    public void LooseFilePermissions_Unix_VB() =>\n        builderVB.AddPaths(\"LooseFilePermissions.Unix.vb\")\n            .AddReferences(NuGetMetadataReference.MonoPosixNetStandard())\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/LossOfFractionInDivisionTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class LossOfFractionInDivisionTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<LossOfFractionInDivision>();\n\n    [TestMethod]\n    public void LossOfFractionInDivision() =>\n        builder.AddPaths(\"LossOfFractionInDivision.cs\").Verify();\n\n    [TestMethod]\n    public void LossOfFractionInDivision_CS_Latest() =>\n        builder.AddPaths(\"LossOfFractionInDivision.Latest.cs\").WithTopLevelStatements().WithOptions(LanguageOptions.CSharpLatest).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/MagicNumberShouldNotBeUsedTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class MagicNumberShouldNotBeUsedTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<MagicNumberShouldNotBeUsed>();\n\n        [TestMethod]\n        public void MagicNumberShouldNotBeUsed() =>\n            builder.AddPaths(\"MagicNumberShouldNotBeUsed.cs\").Verify();\n\n        [TestMethod]\n        public void MagicNumberShouldNotBeUsed_CSharp11() =>\n            builder.AddPaths(\"MagicNumberShouldNotBeUsed.CSharp11.cs\").WithOptions(LanguageOptions.FromCSharp11).WithTopLevelStatements().Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/MarkAssemblyWithAssemblyVersionAttributeTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class MarkAssemblyWithAssemblyVersionAttributeTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.MarkAssemblyWithAssemblyVersionAttribute>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.MarkAssemblyWithAssemblyVersionAttribute>();\n\n    [TestMethod]\n    public void MarkAssemblyWithAssemblyVersionAttribute_CS() =>\n        builderCS.AddPaths(\"MarkAssemblyWithAssemblyVersionAttribute.cs\").WithConcurrentAnalysis(false).VerifyNoIssues();\n\n    [TestMethod]\n    public void MarkAssemblyWithAssemblyVersionAttributeRazor_CS() =>\n        builderCS\n            .AddPaths(\"MarkAssemblyWithAssemblyVersionAttributeRazor.cs\")\n            .WithConcurrentAnalysis(false)\n            .AddReferences(GetAspNetCoreRazorReferences())\n            .VerifyNoIssues();\n\n    [TestMethod]\n    public void MarkAssemblyWithAssemblyVersionAttribute_CS_Concurrent() =>\n        builderCS\n            .AddPaths(\"MarkAssemblyWithAssemblyVersionAttribute.cs\", \"MarkAssemblyWithAssemblyVersionAttributeRazor.cs\")\n            .AddReferences(GetAspNetCoreRazorReferences())\n            .WithAutogenerateConcurrentFiles(false)\n            .VerifyNoIssues();\n\n    [TestMethod]\n    public void MarkAssemblyWithAssemblyVersionAttributeNoncompliant_CS() =>\n        builderCS.AddPaths(\"MarkAssemblyWithAssemblyVersionAttributeNoncompliant.cs\")\n            .WithConcurrentAnalysis(false)\n            .Verify();\n\n    [TestMethod]\n    public void MarkAssemblyWithAssemblyVersionAttributeNoncompliant_NoTargets_ShouldNotRaise_CS() =>\n        // False positive. No assembly gets generated when Microsoft.Build.NoTargets is referenced.\n        builderCS.AddSnippet(\"// Noncompliant ^1#0 {{Provide an 'AssemblyVersion' attribute for assembly 'project0'.}}\")\n            .AddReferences(NuGetMetadataReference.MicrosoftBuildNoTargets())\n            .WithConcurrentAnalysis(false)\n            .Verify();\n\n    [TestMethod]\n    public void MarkAssemblyWithAssemblyVersionAttribute_VB() =>\n        builderVB.AddPaths(\"MarkAssemblyWithAssemblyVersionAttribute.vb\").WithConcurrentAnalysis(false).VerifyNoIssues();\n\n    [TestMethod]\n    public void MarkAssemblyWithAssemblyVersionAttributeRazor_VB() =>\n        builderVB\n            .AddPaths(\"MarkAssemblyWithAssemblyVersionAttributeRazor.vb\")\n            .WithConcurrentAnalysis(false)\n            .AddReferences(GetAspNetCoreRazorReferences())\n            .VerifyNoIssues();\n\n    [TestMethod]\n    public void MarkAssemblyWithAssemblyVersionAttribute_VB_Concurrent() =>\n        builderVB\n            .AddPaths(\"MarkAssemblyWithAssemblyVersionAttribute.vb\", \"MarkAssemblyWithAssemblyVersionAttributeRazor.vb\")\n            .AddReferences(GetAspNetCoreRazorReferences())\n            .WithAutogenerateConcurrentFiles(false)\n            .VerifyNoIssues();\n\n    [TestMethod]\n    public void MarkAssemblyWithAssemblyVersionAttributeNoncompliant_VB() =>\n        builderVB.AddPaths(\"MarkAssemblyWithAssemblyVersionAttributeNoncompliant.vb\")\n            .WithConcurrentAnalysis(false)\n            .Verify();\n\n    [TestMethod]\n    public void MarkAssemblyWithAssemblyVersionAttributeNoncompliant_NoTargets_ShouldNotRaise_VB() =>\n        // False positive. No assembly gets generated when Microsoft.Build.NoTargets is referenced.\n        builderVB.AddSnippet(\"' Noncompliant ^1#0 {{Provide an 'AssemblyVersion' attribute for assembly 'project0'.}}\")\n            .AddReferences(NuGetMetadataReference.MicrosoftBuildNoTargets())\n            .WithConcurrentAnalysis(false)\n            .Verify();\n\n    private static IEnumerable<MetadataReference> GetAspNetCoreRazorReferences() =>\n        NuGetMetadataReference.MicrosoftAspNetCoreMvcRazorRuntime(TestConstants.NuGetLatestVersion);\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/MarkAssemblyWithAttributeUsageAttributeTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class MarkAssemblyWithAttributeUsageAttributeTest\n{\n    [TestMethod]\n    public void RequireAttributeUsageAttribute() =>\n        new VerifierBuilder<RequireAttributeUsageAttribute>().AddPaths(@\"RequireAttributeUsageAttribute.cs\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/MarkAssemblyWithClsCompliantAttributeTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class MarkAssemblyWithClsCompliantAttributeTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.MarkAssemblyWithClsCompliantAttribute>().WithConcurrentAnalysis(false);\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.MarkAssemblyWithClsCompliantAttribute>().WithConcurrentAnalysis(false);\n\n    [TestMethod]\n    public void MarkAssemblyWithClsCompliantAttribute_CS() =>\n        builderCS.AddPaths(@\"MarkAssemblyWithClsCompliantAttribute.cs\").VerifyNoIssues();\n\n    [TestMethod]\n    public void MarkAssemblyWithClsCompliantAttribute_VB() =>\n        builderVB.AddPaths(@\"MarkAssemblyWithClsCompliantAttribute.vb\").VerifyNoIssues();\n\n    [TestMethod]\n    public void MarkAssemblyWithClsCompliantAttributeNoncompliant_CS() =>\n        builderCS.AddPaths(@\"MarkAssemblyWithClsCompliantAttributeNoncompliant.cs\").Verify();\n\n    [TestMethod]\n    public void MarkAssemblyWithClsCompliantAttributeNoncompliant_VB() =>\n        builderVB.AddPaths(@\"MarkAssemblyWithClsCompliantAttributeNoncompliant.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/MarkAssemblyWithComVisibleAttributeTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class MarkAssemblyWithComVisibleAttributeTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.MarkAssemblyWithComVisibleAttribute>().WithConcurrentAnalysis(false);\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.MarkAssemblyWithComVisibleAttribute>().WithConcurrentAnalysis(false);\n\n    [TestMethod]\n    public void MarkAssemblyWithComVisibleAttribute_CS() =>\n        builderCS.AddPaths(@\"MarkAssemblyWithComVisibleAttribute.cs\").VerifyNoIssues();\n\n    [TestMethod]\n    public void MarkAssemblyWithComVisibleAttribute_VB() =>\n        builderVB.AddPaths(@\"MarkAssemblyWithComVisibleAttribute.vb\").VerifyNoIssues();\n\n    [TestMethod]\n    public void MarkAssemblyWithComVisibleAttributeNoncompliant_CS() =>\n        builderCS.AddPaths(@\"MarkAssemblyWithComVisibleAttributeNoncompliant.cs\").Verify();\n\n    [TestMethod]\n    public void MarkAssemblyWithComVisibleAttributeNoncompliant_VB() =>\n        builderVB.AddPaths(@\"MarkAssemblyWithComVisibleAttributeNoncompliant.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/MarkAssemblyWithNeutralResourcesLanguageAttributeTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class MarkAssemblyWithNeutralResourcesLanguageAttributeTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<MarkAssemblyWithNeutralResourcesLanguageAttribute>().WithConcurrentAnalysis(false);\n\n        [TestMethod]\n        public void MarkAssemblyWithNeutralResourcesLanguageAttribute_HasResx_HasAttribute_Compliant() =>\n            builder.AddPaths(\"MarkAssemblyWithNeutralResourcesLanguageAttribute.cs\", @\"Resources\\SomeResources.Designer.cs\", @\"Resources\\AnotherResources.Designer.cs\").VerifyNoIssues();\n\n        [TestMethod]\n        public void MarkAssemblyWithNeutralResourcesLanguageAttribute_NoResx_HasAttribute_Compliant() =>\n            builder.AddPaths(\"MarkAssemblyWithNeutralResourcesLanguageAttribute.cs\").VerifyNoIssues();\n\n        [TestMethod]\n        public void MarkAssemblyWithNeutralResourcesLanguageAttribute_HasResx_HasInvalidAttribute_Noncompliant() =>\n            builder.AddPaths(\"MarkAssemblyWithNeutralResourcesLanguageAttributeNonCompliant.Invalid.cs\", @\"Resources\\SomeResources.Designer.cs\").Verify();\n\n        [TestMethod]\n        public void MarkAssemblyWithNeutralResourcesLanguageAttribute_HasResx_NoAttribute_Noncompliant() =>\n            builder.AddPaths(\"MarkAssemblyWithNeutralResourcesLanguageAttributeNonCompliant.cs\", @\"Resources\\SomeResources.Designer.cs\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/MarkWindowsFormsMainWithStaThreadTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class MarkWindowsFormsMainWithStaThreadTest\n    {\n        private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.MarkWindowsFormsMainWithStaThread>().WithConcurrentAnalysis(false);\n        private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.MarkWindowsFormsMainWithStaThread>().WithConcurrentAnalysis(false);\n\n        [TestMethod]\n        public void MarkWindowsFormsMainWithStaThread_CS() =>\n            builderCS\n                .AddPaths(\"MarkWindowsFormsMainWithStaThread.cs\")\n                .WithOutputKind(OutputKind.WindowsApplication)\n                .AddReferences(MetadataReferenceFacade.SystemWindowsForms)\n                .Verify();\n\n        [TestMethod]\n        public void MarkWindowsFormsMainWithStaThread_VB() =>\n            builderVB\n                .AddPaths(\"MarkWindowsFormsMainWithStaThread.vb\")\n                .WithOutputKind(OutputKind.WindowsApplication)\n                .AddReferences(MetadataReferenceFacade.SystemWindowsForms)\n                .Verify();\n\n        [TestMethod]\n        public void MarkWindowsFormsMainWithStaThread_ClassLibrary_CS() =>\n            builderCS\n                .AddPaths(\"MarkWindowsFormsMainWithStaThread.cs\")\n                .WithErrorBehavior(CompilationErrorBehavior.Ignore)\n                .WithOutputKind(OutputKind.DynamicallyLinkedLibrary)\n                .AddReferences(MetadataReferenceFacade.SystemWindowsForms)\n                .VerifyNoIssues();\n\n        [TestMethod]\n        public void MarkWindowsFormsMainWithStaThread_ClassLibrary_VB() =>\n            builderVB\n                .AddPaths(\"MarkWindowsFormsMainWithStaThread.vb\")\n                .WithOutputKind(OutputKind.DynamicallyLinkedLibrary)\n                .AddReferences(MetadataReferenceFacade.SystemWindowsForms)\n                .VerifyNoIssuesIgnoreErrors();\n\n        [TestMethod]\n        public void MarkWindowsFormsMainWithStaThread_CS_NoWindowsForms() =>\n            builderCS\n                .AddPaths(\"MarkWindowsFormsMainWithStaThread_NoWindowsForms.cs\")\n                .WithOutputKind(OutputKind.WindowsApplication)\n                .Verify();\n\n        [TestMethod]\n        public void MarkWindowsFormsMainWithStaThread_VB_NoWindowsForms() =>\n            builderVB\n                .AddPaths(\"MarkWindowsFormsMainWithStaThread_NoWindowsForms.vb\")\n                .WithOutputKind(OutputKind.WindowsApplication)\n                .VerifyNoIssuesIgnoreErrors();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/MemberInitializedToDefaultTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class MemberInitializedToDefaultTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<MemberInitializedToDefault>();\n\n    [TestMethod]\n    public void MemberInitializedToDefault() =>\n        builder.AddPaths(\"MemberInitializedToDefault.cs\").Verify();\n\n    [TestMethod]\n    public void MemberInitializedToDefault_CodeFix() =>\n        builder\n        .WithCodeFix<MemberInitializedToDefaultCodeFix>()\n        .AddPaths(\"MemberInitializedToDefault.cs\")\n        .WithCodeFixedPaths(\"MemberInitializedToDefault.Fixed.cs\")\n        .VerifyCodeFix();\n\n    [TestMethod]\n    public void MemberInitializedToDefault_CSharp8() =>\n        builder.AddPaths(\"MemberInitializedToDefault.CSharp8.cs\").WithOptions(LanguageOptions.FromCSharp8).VerifyNoIssues();\n\n    [TestMethod]\n    public void MemberInitializedToDefault_CSharp9() =>\n        builder.AddPaths(\"MemberInitializedToDefault.CSharp9.cs\").WithOptions(LanguageOptions.FromCSharp9).Verify();\n\n    [TestMethod]\n    public void MemberInitializedToDefault_CSharp10() =>\n        builder.AddPaths(\"MemberInitializedToDefault.CSharp10.cs\").WithOptions(LanguageOptions.FromCSharp10).Verify();\n\n    [TestMethod]\n    public void MemberInitializedToDefault_CSharp11() =>\n        builder.AddPaths(\"MemberInitializedToDefault.CSharp11.cs\").WithOptions(LanguageOptions.FromCSharp11).Verify();\n\n    [TestMethod]\n    public void MemberInitializedToDefault_CSharp11_CodeFix() =>\n        builder\n        .WithCodeFix<MemberInitializedToDefaultCodeFix>()\n        .AddPaths(\"MemberInitializedToDefault.CSharp11.cs\")\n        .WithCodeFixedPaths(\"MemberInitializedToDefault.CSharp11.Fixed.cs\")\n        .WithOptions(LanguageOptions.FromCSharp11)\n        .VerifyCodeFix();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/MemberInitializerRedundantTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class MemberInitializerRedundantTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<MemberInitializerRedundant>();\n    private readonly VerifierBuilder builderSonarCfg = new VerifierBuilder().AddAnalyzer(() => new MemberInitializerRedundant(AnalyzerConfiguration.AlwaysEnabledWithSonarCfg));\n\n    [TestMethod]\n    public void MemberInitializerRedundant_RoslynCfg() =>\n        builder.AddPaths(@\"MemberInitializerRedundant.cs\").WithOptions(LanguageOptions.FromCSharp8).Verify();\n\n    [TestMethod]\n    public void MemberInitializerRedundant_RoslynCfg_FlowCaptureOperationNotSupported() =>\n        builder.AddPaths(@\"MemberInitializerRedundant.RoslynCfg.FlowCaptureBug.cs\").WithOptions(LanguageOptions.FromCSharp8).VerifyNoIssues();\n\n    [TestMethod]\n    public void MemberInitializerRedundant_SonarCfg() =>\n        builderSonarCfg.AddPaths(@\"MemberInitializerRedundant.cs\").WithOptions(LanguageOptions.FromCSharp8).Verify();\n\n    [TestMethod]\n    public void MemberInitializerRedundant_CodeFix() =>\n        builder\n            .WithCodeFix<MemberInitializedToDefaultCodeFix>()\n            .AddPaths(\"MemberInitializerRedundant.cs\")\n            .WithCodeFixedPaths(\"MemberInitializerRedundant.Fixed.cs\")\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void MemberInitializerRedundant_CS_Latest() =>\n        builder.AddPaths(\"MemberInitializerRedundant.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void MemberInitializerRedundant_CS_Latest_CodeFix() =>\n        builder\n            .WithCodeFix<MemberInitializedToDefaultCodeFix>()\n            .AddPaths(\"MemberInitializerRedundant.Latest.cs\")\n            .WithCodeFixedPaths(\"MemberInitializerRedundant.Latest.Fixed.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .VerifyCodeFix();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/MemberOverrideCallsBaseMemberTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class MemberOverrideCallsBaseMemberTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<MemberOverrideCallsBaseMember>();\n\n    [TestMethod]\n    public void MemberOverrideCallsBaseMember() =>\n        builder.AddPaths(\"MemberOverrideCallsBaseMember.cs\").Verify();\n\n    [TestMethod]\n    public void MemberOverrideCallsBaseMember_Latest() =>\n        builder.AddPaths(\"MemberOverrideCallsBaseMember.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void MemberOverrideCallsBaseMember_Latest_CodeFix() =>\n        builder.AddPaths(\"MemberOverrideCallsBaseMember.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .WithCodeFix<MemberOverrideCallsBaseMemberCodeFix>()\n            .WithCodeFixedPaths(\"MemberOverrideCallsBaseMember.Latest.Fixed.cs\")\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void MemberOverrideCallsBaseMember_CodeFix() =>\n        builder.AddPaths(\"MemberOverrideCallsBaseMember.cs\")\n            .WithCodeFix<MemberOverrideCallsBaseMemberCodeFix>()\n            .WithCodeFixedPaths(\"MemberOverrideCallsBaseMember.Fixed.cs\")\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void MemberOverrideCallsBaseMember_ToString()\n    {\n        var toString = \"public override string ToString() => base.ToString();\";\n        toString +=\n#if NET\n            \"// Noncompliant {{Remove this method 'ToString' to simply inherit its behavior.}}\";\n#elif NETFRAMEWORK\n            \"// FN. ToString has a [__DynamicallyInvokable] attribute in .Net framework\";\n#endif\n        builder.AddSnippet($$\"\"\"\n                            class Test\n                            {\n                                {{toString}}\n                            }\n            \"\"\")\n#if NET\n            .Verify();\n#elif NETFRAMEWORK\n            .VerifyNoIssues();\n#endif\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/MemberShadowsOuterStaticMemberTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class MemberShadowsOuterStaticMemberTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<MemberShadowsOuterStaticMember>();\n\n    [TestMethod]\n    public void MemberShadowsOuterStaticMember() =>\n        builder.AddPaths(\"MemberShadowsOuterStaticMember.cs\").Verify();\n\n    [TestMethod]\n    public void MemberShadowsOuterStaticMember_Latest() =>\n        builder.AddPaths(\"MemberShadowsOuterStaticMember.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/MemberShouldBeStaticTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class MemberShouldBeStaticTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<MemberShouldBeStatic>();\n\n    [TestMethod]\n    [DataRow(\"1.0.0\", \"3.0.20105.1\")]\n    [DataRow(TestConstants.NuGetLatestVersion, TestConstants.NuGetLatestVersion)]\n    public void MemberShouldBeStatic(string aspnetCoreVersion, string aspnetVersion) =>\n        builder.AddPaths(\"MemberShouldBeStatic.cs\")\n            .AddReferences(NuGetMetadataReference.MicrosoftAspNetCoreMvcWebApiCompatShim(aspnetCoreVersion)\n            .Concat(NuGetMetadataReference.MicrosoftAspNetMvc(aspnetVersion))\n            .Concat(NuGetMetadataReference.MicrosoftAspNetCoreMvcCore(aspnetCoreVersion))\n            .Concat(NuGetMetadataReference.MicrosoftAspNetCoreMvcViewFeatures(aspnetCoreVersion))\n            .Concat(NuGetMetadataReference.MicrosoftAspNetCoreRoutingAbstractions(aspnetCoreVersion)))\n            .Verify();\n\n    [TestMethod]\n    public void MemberShouldBeStatic_WinForms() =>\n        builder.AddPaths(\"MemberShouldBeStatic.WinForms.cs\").AddReferences(MetadataReferenceFacade.SystemWindowsForms).Verify();\n\n    [TestMethod]\n    public void MemberShouldBeStatic_Xaml() =>\n        builder.AddPaths(\"MemberShouldBeStatic.Xaml.cs\").AddReferences(MetadataReferenceFacade.PresentationFramework).Verify();\n\n    [TestMethod]\n    public void MemberShouldBeStatic_Latest() =>\n        builder.AddPaths(\"MemberShouldBeStatic.Latest.cs\")\n            .AddPaths(\"MemberShouldBeStatic.Latest.Partial.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .WithTopLevelStatements()\n            .Verify();\n\n    [TestMethod]\n    public void MemberShouldBeStatic_HttpApplication() =>\n        builder.AddSnippet(\"\"\"\n\n            public class HttpApplication1 : System.Web.HttpApplication // Error [CS0234]\n            {\n            public int Foo() => 0;\n\n            protected int FooFoo() => 0; // Noncompliant\n            }\n            \"\"\").Verify();\n\n    [TestMethod]\n    public void MemberShouldBeStatic_InvalidCode() =>\n        // Handle invalid code causing NullReferenceException: https://github.com/SonarSource/sonar-dotnet/issues/819\n        builder.AddSnippet(\"\"\"\n                           public class Class7\n                           {\n                               public async Task<Result<T> Function<T>(Func<Task<Result<T>>> f)\n                               {\n                                   Result<T> result;\n                                   result = await f();\n                                   return result;\n                               }\n                           }\n            \"\"\")\n            .VerifyNoAD0001();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/MemberShouldNotHaveConflictingTransparencyAttributesTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class MemberShouldNotHaveConflictingTransparencyAttributesTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<MemberShouldNotHaveConflictingTransparencyAttributes>();\n\n    [TestMethod]\n    public void MemberShouldNotHaveConflictingTransparencyAttributes() =>\n        builder.AddPaths(\"MemberShouldNotHaveConflictingTransparencyAttributes.cs\", \"MemberShouldNotHaveConflictingTransparencyAttributes.Partial.cs\").Verify();\n\n    [TestMethod]\n    public void MemberShouldNotHaveConflictingTransparencyAttributes_AssemblyLevel() =>\n        builder.AddPaths(\"MemberShouldNotHaveConflictingTransparencyAttributes.AssemblyLevel.cs\").WithConcurrentAnalysis(false).Verify();\n\n    [TestMethod]\n    public void MemberShouldNotHaveConflictingTransparencyAttributes_CS_Latest() =>\n        builder.AddPaths(\"MemberShouldNotHaveConflictingTransparencyAttributes.Latest.cs\", \"MemberShouldNotHaveConflictingTransparencyAttributes.Latest.Partial.cs\")\n            .WithConcurrentAnalysis(false)\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/MessageTemplatesShouldBeCorrectTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class MessageTemplatesShouldBeCorrectTest\n{\n    private static readonly VerifierBuilder Builder = new VerifierBuilder<MessageTemplatesShouldBeCorrect>();\n\n    [TestMethod]\n    public void MessageTemplatesShouldBeCorrect_CS() =>\n        Builder\n        .AddReferences(NuGetMetadataReference.MicrosoftExtensionsLoggingAbstractions())\n        .AddPaths(\"MessageTemplatesShouldBeCorrect.cs\")\n        .Verify();\n\n    [TestMethod]\n    [DataRow(\"LogCritical\", \"\")]\n    [DataRow(\"LogDebug\", \"\")]\n    [DataRow(\"LogError\", \"\")]\n    [DataRow(\"LogInformation\", \"\")]\n    [DataRow(\"LogTrace\", \"\")]\n    [DataRow(\"LogWarning\", \"\")]\n    [DataRow(\"Log\", \"LogLevel.Information,\")]\n    public void MessageTemplatesShouldBeCorrect_MicrosoftExtensionsLogging_CS(string methodName, string logLevel) =>\n        Builder\n        .AddReferences(NuGetMetadataReference.MicrosoftExtensionsLoggingAbstractions())\n        .AddSnippet($$$\"\"\"\n            using System;\n            using Microsoft.Extensions.Logging;\n\n            public class Program\n            {\n                public void Method(ILogger logger, string user)\n                {\n                    Console.WriteLine(\"Login failed for {User\", user);                                  // Compliant\n                    logger.{{{methodName}}}({{{logLevel}}} \"Login failed for {User}\", user);            // Compliant\n\n                    logger.{{{methodName}}}({{{logLevel}}} \"{\", user);                                  // Noncompliant\n                    LoggerExtensions.{{{methodName}}}(logger, {{{logLevel}}} \"{\", user);                // Noncompliant\n                }\n            }\n            \"\"\")\n        .Verify();\n\n    [TestMethod]\n    [DataRow(\"Debug\", \"\")]\n    [DataRow(\"Error\", \"\")]\n    [DataRow(\"Information\", \"\")]\n    [DataRow(\"Fatal\", \"\")]\n    [DataRow(\"Warning\", \"\")]\n    [DataRow(\"Verbose\", \"\")]\n    [DataRow(\"Write\", \"LogEventLevel.Verbose,\")]\n    public void MessageTemplatesShouldBeCorrect_Serilog_CS(string methodName, string logEventLevel) =>\n        Builder\n        .AddReferences(NuGetMetadataReference.Serilog())\n        .AddSnippet($$$\"\"\"\n            using System;\n            using Serilog;\n            using Serilog.Events;\n\n            public class Program\n            {\n                public void Method(ILogger logger, string user)\n                {\n                    Console.WriteLine(\"Login failed for {User\", user);                                     // Compliant\n                    logger.{{{methodName}}}({{{logEventLevel}}} \"Login failed for {User}\", user);          // Compliant\n\n                    logger.{{{methodName}}}({{{logEventLevel}}} \"{\", user);                                // Noncompliant\n                    Log.{{{methodName}}}({{{logEventLevel}}} \"{\", user);                                   // Noncompliant\n                }\n            }\n            \"\"\")\n        .Verify();\n\n    [TestMethod]\n    [DataRow(\"Debug\")]\n    [DataRow(\"ConditionalDebug\")]\n    [DataRow(\"Error\")]\n    [DataRow(\"Fatal\")]\n    [DataRow(\"Info\")]\n    [DataRow(\"Trace\")]\n    [DataRow(\"ConditionalTrace\")]\n    [DataRow(\"Warn\")]\n    public void MessageTemplatesShouldBeCorrect_NLog_CS(string methodName) =>\n        Builder\n        .AddReferences(NuGetMetadataReference.NLog())\n        .AddSnippet($$$\"\"\"\n            using System;\n            using NLog;\n\n            public class Program\n            {\n                public void Method(ILogger iLogger, Logger logger, MyLogger myLogger, string user)\n                {\n                    Console.WriteLine(\"Login failed for {User\", user);                  // Compliant\n                    logger.{{{methodName}}}(\"Login failed for {User}\", user);           // Compliant\n\n                    iLogger.{{{methodName}}}(\"{\", user);                                // Noncompliant\n                    logger.{{{methodName}}}(\"{\", user);                                 // Noncompliant\n                    myLogger.{{{methodName}}}(\"{\", user);                               // Noncompliant\n                }\n            }\n            public class MyLogger : Logger { }\n            \"\"\")\n        .Verify();\n\n    [TestMethod]\n    [DataRow(\"ConditionalDebug\")]\n    [DataRow(\"ConditionalTrace\")]\n    public void MessageTemplatesShouldBeCorrect_NLog_ConditionalExtensions_CS(string methodName) =>\n        Builder\n        .AddReferences(NuGetMetadataReference.NLog())\n        .AddSnippet($$$\"\"\"\n            using System;\n            using NLog;\n\n            public class Program\n            {\n                public void Method(ILogger iLogger, string user)\n                {\n                    Console.WriteLine(\"Login failed for {User\", user);                  // Compliant\n\n                    ILoggerExtensions.{{{methodName}}}(iLogger, \"{\", user);             // Noncompliant\n                }\n            }\n            public class MyLogger : Logger { }\n            \"\"\")\n        .Verify();\n\n    [TestMethod]\n    public void MessageTemplatesShouldBeCorrect_Latest() =>\n        Builder.AddPaths(\"MessageTemplatesShouldBeCorrect.Latest.cs\")\n            .AddReferences(NuGetMetadataReference.MicrosoftExtensionsLoggingAbstractions())\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/MethodOverloadOptionalParameterTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class MethodOverloadOptionalParameterTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<MethodOverloadOptionalParameter>();\n\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    public void MethodOverloadOptionalParameter() =>\n        builder.AddPaths(\"MethodOverloadOptionalParameter.cs\").AddReferences(MetadataReferenceFacade.NetStandard21).WithOptions(LanguageOptions.FromCSharp8).Verify();\n\n    [TestMethod]\n    public void MethodOverloadOptionalParameter_CS_Latest() =>\n        builder.AddPaths(\"MethodOverloadOptionalParameter.Latest.cs\", \"MethodOverloadOptionalParameter.Latest.Partial.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void MethodOverloadOptionalParameter_Razor() =>\n        builder.AddSnippet(\n            \"\"\"\n            @code\n            {\n                void Print2(string[] messages) { }\n                void Print2(string[] messages, string delimiter = \"\\n\") { } // Noncompliant {{This method signature overlaps the one defined on line 3, the default parameter value can't be used.}};\n                //                             ^^^^^^^^^^^^^^^^^^^^^^^\n            }\n            \"\"\",\n            \"SomeRazorFile.razor\")\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Product))\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/MethodOverloadsShouldBeGroupedTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class MethodOverloadsShouldBeGroupedTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.MethodOverloadsShouldBeGrouped>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.MethodOverloadsShouldBeGrouped>();\n\n    [TestMethod]\n    public void MethodOverloadsShouldBeGrouped_CS() =>\n        builderCS.AddPaths(\"MethodOverloadsShouldBeGrouped.cs\").Verify();\n\n    [TestMethod]\n    public void MethodOverloadsShouldBeGrouped_CS_Latest() =>\n        builderCS.AddPaths(\"MethodOverloadsShouldBeGrouped.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void MethodOverloadsShouldBeGrouped_VB() =>\n        builderVB.AddPaths(\"MethodOverloadsShouldBeGrouped.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/MethodOverrideAddsParamsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class MethodOverrideAddsParamsTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<MethodOverrideAddsParams>();\n\n    [TestMethod]\n    public void MethodOverrideAddsParams() =>\n        builder.AddPaths(\"MethodOverrideAddsParams.cs\").WithOptions(LanguageOptions.FromCSharp8).AddReferences(MetadataReferenceFacade.NetStandard21).Verify();\n\n    [TestMethod]\n    public void MethodOverrideAddsParams_CS_Latest() =>\n        builder.AddPaths(\"MethodOverrideAddsParams.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void MethodOverrideAddsParams_CodeFix() =>\n        builder\n            .WithCodeFix<MethodOverrideAddsParamsCodeFix>()\n            .AddPaths(\"MethodOverrideAddsParams.cs\")\n            .WithCodeFixedPaths(\"MethodOverrideAddsParams.Fixed.cs\")\n            .VerifyCodeFix();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/MethodOverrideChangedDefaultValueTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class MethodOverrideChangedDefaultValueTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<MethodOverrideChangedDefaultValue>();\n\n    [TestMethod]\n    public void MethodOverrideChangedDefaultValue() =>\n        builder.AddPaths(\"MethodOverrideChangedDefaultValue.cs\")\n            .AddReferences(MetadataReferenceFacade.NetStandard21)\n            .WithOptions(LanguageOptions.FromCSharp8)\n            .Verify();\n\n    [TestMethod]\n    public void MethodOverrideChangedDefaultValue_CS_Latest() =>\n        builder.AddPaths(\"MethodOverrideChangedDefaultValue.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void MethodOverrideChangedDefaultValue_CS_Latest_CodeFix() =>\n        builder.AddPaths(\"MethodOverrideChangedDefaultValue.Latest.cs\")\n            .WithCodeFix<MethodOverrideChangedDefaultValueCodeFix>()\n            .WithCodeFixedPaths(\"MethodOverrideChangedDefaultValue.Latest.Fixed.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void MethodOverrideChangedDefaultValue_CodeFix_Synchronize() =>\n        builder.AddPaths(\"MethodOverrideChangedDefaultValue.cs\")\n            .WithCodeFix<MethodOverrideChangedDefaultValueCodeFix>()\n            .WithCodeFixedPaths(\"MethodOverrideChangedDefaultValue.Synchronize.Fixed.cs\", \"MethodOverrideChangedDefaultValue.Synchronize.Fixed.Batch.cs\")\n            .WithCodeFixTitle(MethodOverrideChangedDefaultValueCodeFix.TitleGeneral)\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void MethodOverrideChangedDefaultValue_CodeFix_Remove() =>\n        builder.AddPaths(\"MethodOverrideChangedDefaultValue.cs\")\n            .WithCodeFix<MethodOverrideChangedDefaultValueCodeFix>()\n            .WithCodeFixedPaths(\"MethodOverrideChangedDefaultValue.Remove.Fixed.cs\")\n            .WithCodeFixTitle(MethodOverrideChangedDefaultValueCodeFix.TitleExplicitInterface)\n            .VerifyCodeFix();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/MethodOverrideNoParamsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class MethodOverrideNoParamsTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<MethodOverrideNoParams>();\n\n    [TestMethod]\n    public void MethodOverrideNoParams() =>\n        builder.AddPaths(\"MethodOverrideNoParams.cs\").Verify();\n\n    [TestMethod]\n    public void MethodOverrideNoParams_CS_Latest() =>\n        builder.AddPaths(\"MethodOverrideNoParams.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void MethodOverrideNoParams_CodeFix() =>\n        builder.WithCodeFix<MethodOverrideNoParamsCodeFix>()\n            .AddPaths(\"MethodOverrideNoParams.cs\")\n            .WithCodeFixedPaths(\"MethodOverrideNoParams.Fixed.cs\")\n            .VerifyCodeFix();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/MethodParameterMissingOptionalTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class MethodParameterMissingOptionalTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<MethodParameterMissingOptional>();\n\n    [TestMethod]\n    public void MethodParameterMissingOptional() =>\n        builder.AddPaths(\"MethodParameterMissingOptional.cs\").Verify();\n\n    [TestMethod]\n    public void MethodParameterMissingOptional_TopLevelStatements() =>\n        builder.AddPaths(\"MethodParameterMissingOptional.TopLevelStatements.cs\").WithTopLevelStatements().Verify();\n\n    [TestMethod]\n    public void MethodParameterMissingOptional_CS_Latest() =>\n    builder.AddPaths(\"MethodParameterMissingOptional.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void MethodParameterMissingOptional_CodeFix() =>\n        builder\n            .WithCodeFix<MethodParameterMissingOptionalCodeFix>()\n            .AddPaths(\"MethodParameterMissingOptional.cs\")\n            .WithCodeFixedPaths(\"MethodParameterMissingOptional.Fixed.cs\")\n            .VerifyCodeFix();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/MethodParameterUnusedTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class MethodParameterUnusedTest\n{\n    private readonly VerifierBuilder sonarCS = new VerifierBuilder().AddAnalyzer(() => new CS.MethodParameterUnused(AnalyzerConfiguration.AlwaysEnabledWithSonarCfg));\n    private readonly VerifierBuilder roslynCS = new VerifierBuilder<CS.MethodParameterUnused>();   // Default constructor uses Roslyn CFG\n\n    [TestMethod]\n    public void MethodParameterUnused_CS_SonarCfg() =>\n        sonarCS.AddPaths(\"MethodParameterUnused.SonarCfg.cs\").Verify();\n\n    [TestMethod]\n    public void MethodParameterUnused_CS_RoslynCfg() =>\n        roslynCS.AddPaths(\"MethodParameterUnused.RoslynCfg.cs\").Verify();\n\n    [TestMethod]\n    public void MethodParameterUnused_CodeFix_CS() =>\n        roslynCS.AddPaths(\"MethodParameterUnused.RoslynCfg.cs\")\n            .WithCodeFix<CS.MethodParameterUnusedCodeFix>()\n            .WithCodeFixedPaths(\"MethodParameterUnused.RoslynCfg.Fixed.cs\")\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void MethodParameterUnused_DoubleCompilation_CS()\n    {\n        // https://github.com/SonarSource/sonar-dotnet/issues/5491\n        const string code = \"\"\"\n            public class Sample\n            {\n                private void Method(int arg) =>\n                    arg.ToString();\n            }\n            \"\"\";\n        var compilation1 = roslynCS.AddSnippet(code).WithLanguageVersion(Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp7).Compile().Single();\n        var compilation2 = compilation1.WithAssemblyName(\"Different-Compilation-Reusing-Same-Nodes\");\n        // Modified compilation should not reuse cached CFG, because symbols from method would not be equal to symbols from the other CFG.\n        Analyze(compilation1).Should().BeEmpty();\n        Analyze(compilation2).Should().BeEmpty();\n\n        ImmutableArray<Diagnostic> Analyze(Compilation compilation) =>\n            compilation.WithAnalyzers(roslynCS.Analyzers.Select(x => x()).ToImmutableArray()).GetAllDiagnosticsAsync(default).Result;\n    }\n\n    [TestMethod]\n    public void MethodParameterUnused_VB() =>\n        new VerifierBuilder<VB.MethodParameterUnused>().AddPaths(\"MethodParameterUnused.vb\").WithOptions(LanguageOptions.FromVisualBasic14).Verify();\n\n    [TestMethod]\n    public void MethodParameterUnused_CS_RoslynCfg_Latest() =>\n        roslynCS\n            .AddPaths(\"MethodParameterUnused.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    // https://github.com/SonarSource/sonar-dotnet/issues/8988\n    public void MethodParameterUnused_GeneratedCode_CS() =>\n        roslynCS\n            .AddSnippet(\"\"\"\n                using System.CodeDom.Compiler;\n\n                [GeneratedCode(\"TestTool\", \"Version\")]\n                public partial class Generated\n                {\n                    private partial void M(int a, int unused);\n                }\n                \"\"\")\n            .AddSnippet(\"\"\"\n                using System;\n\n                public partial class Generated\n                {\n                    private partial void M(int a, int unused) // Compliant\n                    {\n                        Console.WriteLine(a);\n                    }\n                }\n                \"\"\")\n            .WithOptions(LanguageOptions.FromCSharp9)\n            .VerifyNoIssues();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/MethodShouldBeNamedAccordingToSynchronicityTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\nusing static SonarAnalyzer.TestFramework.MetadataReferences.NugetPackageVersions;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class MethodShouldBeNamedAccordingToSynchronicityTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<MethodShouldBeNamedAccordingToSynchronicity>();\n\n    [TestMethod]\n    [DataRow(\"4.0.0\")]\n    [DataRow(TestConstants.NuGetLatestVersion)]\n    public void MethodShouldBeNamedAccordingToSynchronicity(string tasksVersion) =>\n        builder.AddPaths(\"MethodShouldBeNamedAccordingToSynchronicity.cs\")\n            .AddReferences(MetadataReferenceFacade.SystemThreadingTasksExtensions(tasksVersion)\n                .Union(NuGetMetadataReference.MicrosoftAspNetSignalRCore())\n                .Union(MetadataReferenceFacade.SystemComponentModelPrimitives))\n            .Verify();\n\n    [TestMethod]\n    [DataRow(\"3.0.20105.1\")]\n    [DataRow(TestConstants.NuGetLatestVersion)]\n    public void MethodShouldBeNamedAccordingToSynchronicity_MVC(string mvcVersion) =>\n        builder.AddPaths(\"MethodShouldBeNamedAccordingToSynchronicity.MVC.cs\").AddReferences(NuGetMetadataReference.MicrosoftAspNetMvc(mvcVersion)).VerifyNoIssues();\n\n    [TestMethod]\n    [DataRow(\"2.0.4\", \"2.0.3\")]\n    [DataRow(TestConstants.NuGetLatestVersion, TestConstants.NuGetLatestVersion)]\n    public void MethodShouldBeNamedAccordingToSynchronicity_MVC_Core(string aspNetCoreMvcVersion, string aspNetCoreRoutingVersion) =>\n        builder.AddPaths(\"MethodShouldBeNamedAccordingToSynchronicity.MVC.Core.cs\")\n            .AddReferences(NuGetMetadataReference.MicrosoftAspNetCoreMvcCore(aspNetCoreMvcVersion)\n                .Concat(NuGetMetadataReference.MicrosoftAspNetCoreMvcViewFeatures(aspNetCoreMvcVersion))\n                .Concat(NuGetMetadataReference.MicrosoftAspNetCoreRoutingAbstractions(aspNetCoreRoutingVersion)))\n            .Verify();\n\n    [TestMethod]\n    [DataRow(MsTest.Ver11)]\n    [DataRow(MsTest.Ver311)]\n    [DataRow(Latest)]\n    public void MethodShouldBeNamedAccordingToSynchronicity_MsTest(string testFwkVersion) =>\n        builder.AddPaths(\"MethodShouldBeNamedAccordingToSynchronicity.MsTest.cs\").AddReferences(NuGetMetadataReference.MSTestTestFramework(testFwkVersion)).VerifyNoIssues();\n\n    [TestMethod]\n    [DataRow(NUnit.Ver25)]\n    [DataRow(Latest)]\n    public void MethodShouldBeNamedAccordingToSynchronicity_NUnit(string testFwkVersion) =>\n        builder.AddPaths(\"MethodShouldBeNamedAccordingToSynchronicity.NUnit.cs\").AddReferences(NuGetMetadataReference.NUnit(testFwkVersion)).VerifyNoIssues();\n\n    [TestMethod]\n    [DataRow(\"2.0.0\")]\n    [DataRow(TestConstants.NuGetLatestVersion)]\n    public void MethodShouldBeNamedAccordingToSynchronicity_Xunit(string testFwkVersion) =>\n        builder.AddPaths(\"MethodShouldBeNamedAccordingToSynchronicity.Xunit.cs\").AddReferences(NuGetMetadataReference.XunitFramework(testFwkVersion)).VerifyNoIssues();\n\n    [TestMethod]\n    public void MethodShouldBeNamedAccordingToSynchronicity_CSharp8() =>\n        builder.AddPaths(\"MethodShouldBeNamedAccordingToSynchronicity.CSharp8.cs\").WithOptions(LanguageOptions.FromCSharp8).AddReferences(MetadataReferenceFacade.NetStandard21).Verify();\n\n    [TestMethod]\n    public void MethodShouldBeNamedAccordingToSynchronicity_CSharp11() =>\n        builder.AddPaths(\"MethodShouldBeNamedAccordingToSynchronicity.CSharp11.cs\")\n            .WithOptions(LanguageOptions.FromCSharp11)\n            .AddReferences(NuGetMetadataReference.MicrosoftAspNetSignalRCore())\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/MethodShouldNotOnlyReturnConstantTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class MethodShouldNotOnlyReturnConstantTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<MethodShouldNotOnlyReturnConstant>();\n\n    [TestMethod]\n    public void MethodShouldNotOnlyReturnConstant() =>\n        builder.AddPaths(\"MethodShouldNotOnlyReturnConstant.cs\").Verify();\n\n    [TestMethod]\n    public void MethodShouldNotOnlyReturnConstant_CS_Latest() =>\n        builder.AddPaths(\"MethodShouldNotOnlyReturnConstant.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/MethodsShouldNotHaveIdenticalImplementationsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class MethodsShouldNotHaveIdenticalImplementationsTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.MethodsShouldNotHaveIdenticalImplementations>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.MethodsShouldNotHaveIdenticalImplementations>();\n\n    [TestMethod]\n    public void MethodsShouldNotHaveIdenticalImplementations() =>\n        builderCS.AddPaths(\"MethodsShouldNotHaveIdenticalImplementations.cs\").Verify();\n\n    [TestMethod]\n    [CombinatorialData]\n    public void MethodsShouldNotHaveIdenticalImplementations_MethodTypeParameters(\n        [CombinatorialValues(\"\", \"where T: struct\", \"where T: class\", \"where T: unmanaged\", \"where T: new()\", \"where T: class, new()\")] string constraint1,\n        [CombinatorialValues(\"\", \"where T: struct\", \"where T: class\", \"where T: unmanaged\", \"where T: new()\", \"where T: class, new()\")] string constraint2)\n    {\n        var nonCompliant = constraint1 == constraint2;\n        var builder = builderCS.AddSnippet($$\"\"\"\n            using System;\n            public static class TypeConstraints\n            {\n                public static bool Compare1<T>(T? value1, T value2) {{constraint1}} {{(nonCompliant ? \"// Secondary\" : string.Empty)}}\n                {\n                    Console.WriteLine(value1);\n                    Console.WriteLine(value2);\n                    return true;\n                }\n\n                public static bool Compare2<T>(T? value1, T value2) {{constraint2}} {{(nonCompliant ? \"// Noncompliant\" : string.Empty)}}\n                {\n                    Console.WriteLine(value1);\n                    Console.WriteLine(value2);\n                    return true;\n                }\n            }\n            \"\"\").WithOptions(LanguageOptions.FromCSharp9);\n        if (nonCompliant)\n        {\n            builder.Verify();\n        }\n        else\n        {\n            builder.VerifyNoIssues();\n        }\n    }\n\n    [TestMethod]\n    [DataRow(\"where T: IEquatable<T>, IComparable\", \"where T: System.IComparable, IEquatable<T>\")]\n    [DataRow(\"where T: List<IEquatable<T>>, IList<T>, IComparable\", \"where T: List<IEquatable<T>>, IComparable, IList<T>\")]\n    public void MethodsShouldNotHaveIdenticalImplementations_MethodTypeParameters_NonCompliant(string constraint1, string constraint2) =>\n        builderCS.AddSnippet($$\"\"\"\n            using System;\n            using System.Collections.Generic;\n            public static class TypeConstraints\n            {\n                public static bool Compare1<T>(T? value1, T value2) {{constraint1}} // Secondary\n                {\n                    Console.WriteLine(value1);\n                    Console.WriteLine(value2);\n                    return true;\n                }\n\n                public static bool Compare2<T>(T? value1, T value2) {{constraint2}} // Noncompliant\n                {\n                    Console.WriteLine(value1);\n                    Console.WriteLine(value2);\n                    return true;\n                }\n            }\n            \"\"\").WithOptions(LanguageOptions.FromCSharp9).Verify();\n\n    [TestMethod]\n    [DataRow(\"\", \"\")]\n    [DataRow(\"where TKey: TValue\", \"where TKey: TValue\")]\n    [DataRow(\"where TKey: TValue where TValue: IComparable\", \"where TKey: TValue where TValue: IComparable\")]\n    [DataRow(\"where TKey: IEquatable<TValue> where TValue: IComparable\", \"where TKey: IEquatable<TValue> where TValue: IComparable\")]\n    [DataRow(\"where TKey: struct\", \"where TKey: struct\")]\n    [DataRow(\"where TKey: struct where TValue: class\", \"where TKey: struct where TValue: class\")]\n    [DataRow(\"where TValue: class where TKey: struct\", \"where TKey: struct where TValue: class\")]\n    [DataRow(\"where TKey: class\", \"where TKey: class\")]\n    [DataRow(\"where TKey: unmanaged\", \"where TKey: unmanaged\")]\n    [DataRow(\"where TKey: new()\", \"where TKey: new()\")]\n    [DataRow(\"where TKey: IEquatable<TKey>, IComparable\", \"where TKey: System.IComparable, IEquatable<TKey>\")]\n    [DataRow(\"where TKey: IEquatable<TKey>, IComparable where TValue: IComparable\", \" where TValue: System.IComparable where TKey: System.IComparable, IEquatable<TKey>\")]\n    public void MethodsShouldNotHaveIdenticalImplementations_MethodTypeParameters_Dictionary_NonCompliant(string constraint1, string constraint2) =>\n        builderCS.AddSnippet($$\"\"\"\n            using System;\n            using System.Collections.Generic;\n            public static class TypeConstraints\n            {\n                public static bool Test1<TKey, TValue>(IDictionary<TKey, TValue> dict) {{constraint1}} // Secondary\n                {\n                    Console.WriteLine(dict);\n                    Console.WriteLine(dict);\n                    return true;\n                }\n\n                public static bool Test2<TValue, TKey>(IDictionary<TKey, TValue> dict) {{constraint2}} // Noncompliant\n                {\n                    Console.WriteLine(dict);\n                    Console.WriteLine(dict);\n                    return true;\n                }\n            }\n            \"\"\").WithOptions(LanguageOptions.FromCSharp9).Verify();\n\n    [TestMethod]\n    [DataRow(\"Of TKey, TValue\", \"Of TKey, TValue\")]\n    [DataRow(\"Of TKey As Structure, TValue\", \"Of TKey As Structure, TValue\")]\n    [DataRow(\"Of TKey As Structure, TValue As Class\", \"Of TKey As Structure, TValue As Class\")]\n    [DataRow(\"Of TValue As Class, TKey As Structure\", \"Of TKey As Structure, TValue As Class\")]\n    [DataRow(\"Of TKey As {Class}, TValue\", \"Of TKey As Class, TValue\")]\n    [DataRow(\"Of TKey As {New}, TValue\", \"Of TKey As New, TValue\")]\n    [DataRow(\"Of TKey As {IEquatable(Of TKey), IComparable}, TValue\", \"Of TKey As {System.IComparable, IEquatable(Of TKey)}, TValue\")]\n    [DataRow(\"Of TKey As {IEquatable(Of TKey), IComparable}, TValue As IComparable\", \"Of TValue As IComparable, TKey As {System.IComparable, IEquatable(Of TKey)}\")]\n    public void MethodsShouldNotHaveIdenticalImplementations_MethodTypeParameters_Dictionary_VB_NonCompliant(string constraint1, string constraint2) =>\n        builderVB.AddSnippet($$\"\"\"\n            Imports System\n            Imports System.Collections.Generic\n\n            Class TypeConstraints\n                Function Test1({{constraint1}})(dict As IDictionary(Of TKey, TValue)) As Boolean ' Secondary\n                    Console.WriteLine(dict)\n                    Console.WriteLine(dict)\n                    Return True\n                End Function\n\n                Function Test2({{constraint2}})(dict As IDictionary(Of TKey, TValue)) As Boolean ' Noncompliant\n                    Console.WriteLine(dict)\n                    Console.WriteLine(dict)\n                    Return True\n                End Function\n            End Class\n            \"\"\").Verify();\n\n    [TestMethod]\n    [DataRow(\"\", \"where TKey: struct\")]\n    [DataRow(\"where TKey: struct\", \"\")]\n    [DataRow(\"where TKey: struct\", \"where TKey: class\")]\n    [DataRow(\"where TKey: struct where TValue: class\", \"where TKey: class where TValue: class\")]\n    [DataRow(\"where TValue: class where TKey: struct\", \"where TKey: class where TValue: struct\")]\n    [DataRow(\"where TKey: class\", \"where TKey: class, new()\")]\n    [DataRow(\"where TKey: unmanaged\", \"where TKey: struct\")]\n    [DataRow(\"where TKey: new()\", \"where TKey: IComparable, new()\")]\n    [DataRow(\"where TKey: IEquatable<TKey>, IComparable\", \"where TKey: System.IComparable\")]\n    [DataRow(\"where TKey: IEquatable<TKey>, IComparable where TValue: IComparable\", \" where TKey: System.IComparable where TValue: System.IComparable, IEquatable<TKey>\")]\n    public void MethodsShouldNotHaveIdenticalImplementations_MethodTypeParameters_Dictionary_Compliant(string constraint1, string constraint2) =>\n        builderCS.AddSnippet($$\"\"\"\n            using System;\n            using System.Collections.Generic;\n            public static class TypeConstraints\n            {\n                public static bool Test1<TKey, TValue>(IDictionary<TKey, TValue> dict) {{constraint1}}\n                {\n                    Console.WriteLine(dict);\n                    Console.WriteLine(dict);\n                    return true;\n                }\n\n                public static bool Test2<TValue, TKey>(IDictionary<TKey, TValue> dict) {{constraint2}}\n                {\n                    Console.WriteLine(dict);\n                    Console.WriteLine(dict);\n                    return true;\n                }\n            }\n            \"\"\").WithOptions(LanguageOptions.FromCSharp9).VerifyNoIssues();\n\n    [TestMethod]\n    [DataRow(\"Of TKey, TValue\", \"Of TKey, TValue As Structure\")]\n    [DataRow(\"Of TKey, TValue As Class\", \"Of TKey, TValue As Structure\")]\n    [DataRow(\"Of TKey As Structure, TValue\", \"Of TKey, TValue As Structure\")]\n    [DataRow(\"Of TKey As {New, IComparable}, TValue\", \"Of TKey As New, TValue\")]\n    public void MethodsShouldNotHaveIdenticalImplementations_MethodTypeParameters_Dictionary_VB_Compliant(string constraint1, string constraint2) =>\n        builderVB.AddSnippet($$\"\"\"\n            Imports System\n            Imports System.Collections.Generic\n\n            Class TypeConstraints\n                Function Test1({{constraint1}})(dict As IDictionary(Of TKey, TValue)) As Boolean\n                    Console.WriteLine(dict)\n                    Console.WriteLine(dict)\n                    Return True\n                End Function\n\n                Function Test2({{constraint2}})(dict As IDictionary(Of TKey, TValue)) As Boolean\n                    Console.WriteLine(dict)\n                    Console.WriteLine(dict)\n                    Return True\n                End Function\n            End Class\n            \"\"\").VerifyNoIssues();\n\n    [TestMethod]\n    [DataRow(\"\")]\n    [DataRow(\"where TKey: struct\")]\n    [DataRow(\"where TKey: struct where TValue: class\")]\n    [DataRow(\"where TValue: class where TKey: struct\")]\n    [DataRow(\"where TKey: class\")]\n    [DataRow(\"where TKey: unmanaged\")]\n    [DataRow(\"where TKey: new()\")]\n    [DataRow(\"where TKey: IEquatable<TKey>, IComparable\")]\n    [DataRow(\"where TKey: IEquatable<TKey>, IComparable where TValue: IComparable\")]\n    [DataRow(\"where TKey: TValue\")]\n    [DataRow(\"where TKey: TValue where TValue: IComparable\")]\n    [DataRow(\"where TKey: IEquatable<TValue> where TValue: IComparable\")]\n    public void MethodsShouldNotHaveIdenticalImplementations_ClassTypeParameters_Dictionary_NonCompliant(string constraint) =>\n        builderCS.AddSnippet($$\"\"\"\n            using System;\n            using System.Collections.Generic;\n            public class TypeConstraints<TKey, TValue> {{constraint}}\n            {\n                public static bool Test1(IDictionary<TKey, TValue> dict) // Secondary\n                {\n                    Console.WriteLine(dict);\n                    Console.WriteLine(dict);\n                    return true;\n                }\n\n                public static bool Test2(IDictionary<TKey, TValue> dict) // Noncompliant\n                {\n                    Console.WriteLine(dict);\n                    Console.WriteLine(dict);\n                    return true;\n                }\n            }\n            \"\"\").WithOptions(LanguageOptions.FromCSharp9).Verify();\n\n    [TestMethod]\n    [DataRow(\"where TSelf: IEqualityOperators<TSelf, TSelf, TResult>\")]\n    [DataRow(\"where TSelf: IEqualityOperators<TSelf, TSelf, TResult>, TResult\")]\n    [DataRow(\"where TSelf: IEqualityOperators<TSelf, TSelf, TResult> where TResult: IEqualityOperators<TSelf, TSelf, TResult>\")]\n    [DataRow(\"where TSelf: IComparisonOperators<TSelf, TSelf, TResult>\")]\n    [DataRow(\"where TSelf: IComparisonOperators<TSelf, TSelf, TResult>, TResult\")]\n    public void MethodsShouldNotHaveIdenticalImplementations_SelfTypes_NonCompliant(string constraint) =>\n        builderCS.AddSnippet($$\"\"\"\n            using System;\n            using System.Numerics;\n            public class TypeConstraints\n            {\n                public static bool Test1<TSelf, TResult>(IEqualityOperators<TSelf, TSelf, TResult> x) {{constraint}} // Secondary\n                {\n                    Console.WriteLine(x);\n                    Console.WriteLine(x);\n                    return true;\n                }\n\n                public static bool Test2<TSelf, TResult>(IEqualityOperators<TSelf, TSelf, TResult> x) {{constraint}}  // Noncompliant\n                {\n                    Console.WriteLine(x);\n                    Console.WriteLine(x);\n                    return true;\n                }\n            }\n            \"\"\").WithOptions(LanguageOptions.FromCSharp9).Verify();\n\n    [TestMethod]\n    public void MethodsShouldNotHaveIdenticalImplementations_TopLevelStatements() =>\n        builderCS.AddPaths(\"MethodsShouldNotHaveIdenticalImplementations.TopLevelStatements.cs\").WithTopLevelStatements().Verify();\n\n    [TestMethod]\n    public void MethodsShouldNotHaveIdenticalImplementations_CS_Latest() =>\n        builderCS.AddPaths(\"MethodsShouldNotHaveIdenticalImplementations.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void MethodsShouldNotHaveIdenticalImplementations_VB() =>\n        builderVB.AddPaths(\"MethodsShouldNotHaveIdenticalImplementations.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/MethodsShouldNotHaveTooManyLinesTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class MethodsShouldNotHaveTooManyLinesTest\n{\n    [TestMethod]\n    public void MethodsShouldNotHaveTooManyLines_DefaultValues_CS() =>\n        new VerifierBuilder<CS.MethodsShouldNotHaveTooManyLines>().AddPaths(\"MethodsShouldNotHaveTooManyLines_DefaultValues.cs\").Verify();\n\n    [TestMethod]\n    public void MethodsShouldNotHaveTooManyLines_CustomValues_CS() =>\n        CreateCSBuilder(2).AddPaths(\"MethodsShouldNotHaveTooManyLines_CustomValues.cs\").Verify();\n\n    [TestMethod]\n    public void MethodsShouldNotHaveTooManyLines_LocalFunctions() =>\n        CreateCSBuilder(5).AddPaths(\"MethodsShouldNotHaveTooManyLines.LocalFunctions.cs\").WithOptions(LanguageOptions.FromCSharp8).Verify();\n\n    [TestMethod]\n    public void MethodsShouldNotHaveTooManyLines_LocalFunctions_CSharp9() =>\n        CreateCSBuilder(5).AddPaths(\"MethodsShouldNotHaveTooManyLines.LocalFunctions.CSharp9.cs\").WithOptions(LanguageOptions.FromCSharp9).Verify();\n\n    [TestMethod]\n    public void MethodsShouldNotHaveTooManyLines_CustomValues_CSharp9() =>\n        CreateCSBuilder(2).AddPaths(\"MethodsShouldNotHaveTooManyLines_CustomValues.CSharp9.cs\").WithTopLevelStatements().Verify();\n\n    [TestMethod]\n    public void MethodsShouldNotHaveTooManyLines_CustomValues_CSharp10() =>\n        CreateCSBuilder(2).AddPaths(\"MethodsShouldNotHaveTooManyLines_CustomValues.CSharp10.cs\").WithOptions(LanguageOptions.FromCSharp10).Verify();\n\n    [TestMethod]\n    public void MethodsShouldNotHaveTooManyLines_CSharp9_NoUsing() =>\n        CreateCSBuilder(2).AddSnippet(@\"\nint i = 1; i++;\n\nvoid LocalFunction() // Noncompliant {{This local function has 4 lines, which is greater than the 2 lines authorized.}}\n{\ni++;\ni++;\ni++;\ni++;\n}\")\n        .WithOptions(LanguageOptions.FromCSharp9)\n        .WithOutputKind(OutputKind.ConsoleApplication)\n        .Verify();\n\n    [TestMethod]\n    public void MethodsShouldNotHaveTooManyLines_CSharp9_Valid() =>\n        CreateCSBuilder(4)\n            .AddSnippet(\"\"\"\n                int i = 1; i++;\n                i++;\n                i++;\n                i++;\n                \"\"\")\n            .WithOptions(LanguageOptions.FromCSharp9)\n            .WithOutputKind(OutputKind.ConsoleApplication)\n            .VerifyNoIssues();\n\n    [TestMethod]\n    public void MethodsShouldNotHaveTooManyLines_DoesntReportInTest_CS() =>\n        new VerifierBuilder<CS.MethodsShouldNotHaveTooManyLines>().AddPaths(\"MethodsShouldNotHaveTooManyLines_DefaultValues.cs\")\n        .AddTestReference()\n        .VerifyNoIssues();\n\n    [TestMethod]\n    public void MethodsShouldNotHaveTooManyLines_InvalidSyntax_CS() =>\n        CreateCSBuilder(2)\n            .AddSnippet(\"\"\"\n                public class Foo\n                {\n                    public string ()\n                    {\n                        return \"f\";\n                    }\n                }\n                \"\"\")\n            .VerifyNoIssuesIgnoreErrors();\n\n    [TestMethod]\n    [DataRow(1)]\n    [DataRow(0)]\n    [DataRow(-1)]\n    public void MethodsShouldNotHaveTooManyLines_InvalidMaxThreshold_CS(int max)\n    {\n        var compilation = SolutionBuilder.CreateSolutionFromPath(@\"TestCases\\MethodsShouldNotHaveTooManyLines_CustomValues.cs\")\n            .Compile(LanguageOptions.CSharpLatest.ToArray()).Single();\n        var errors = DiagnosticVerifier.AnalyzerExceptions(compilation, new CS.MethodsShouldNotHaveTooManyLines { Max = max });\n        errors.Should().OnlyContain(x => x.GetMessage(null).Contains(\"Invalid rule parameter: maximum number of lines = \")).And.HaveCount(12);\n    }\n\n    [TestMethod]\n    public void MethodsShouldNotHaveTooManyLines_DefaultValues_VB() =>\n        new VerifierBuilder<VB.MethodsShouldNotHaveTooManyLines>().AddPaths(\"MethodsShouldNotHaveTooManyLines_DefaultValues.vb\").Verify();\n\n    [TestMethod]\n    public void MethodsShouldNotHaveTooManyLines_CustomValues_VB() =>\n        new VerifierBuilder().AddAnalyzer(() => new VB.MethodsShouldNotHaveTooManyLines { Max = 2 })\n        .AddPaths(\"MethodsShouldNotHaveTooManyLines_CustomValues.vb\")\n        .Verify();\n\n    [TestMethod]\n    public void MethodsShouldNotHaveTooManyLines_DoesntReportInTest_VB() =>\n        new VerifierBuilder<VB.MethodsShouldNotHaveTooManyLines>().AddPaths(\"MethodsShouldNotHaveTooManyLines_DefaultValues.vb\")\n        .AddTestReference()\n        .VerifyNoIssues();\n\n    [TestMethod]\n    [DataRow(1)]\n    [DataRow(0)]\n    [DataRow(-1)]\n    public void MethodsShouldNotHaveTooManyLines_InvalidMaxThreshold_VB(int max)\n    {\n        var compilation = SolutionBuilder.CreateSolutionFromPath(@\"TestCases\\MethodsShouldNotHaveTooManyLines_CustomValues.vb\")\n            .Compile(LanguageOptions.VisualBasicLatest.ToArray()).Single();\n        var errors = DiagnosticVerifier.AnalyzerExceptions(compilation, new VB.MethodsShouldNotHaveTooManyLines { Max = max });\n        errors.Should().OnlyContain(x => x.GetMessage(null).Contains(\"Invalid rule parameter: maximum number of lines = \")).And.HaveCount(7);\n    }\n\n    private static VerifierBuilder CreateCSBuilder(int maxLines) =>\n        new VerifierBuilder().AddAnalyzer(() => new CS.MethodsShouldNotHaveTooManyLines { Max = maxLines });\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/MethodsShouldUseBaseTypesTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class MethodsShouldUseBaseTypesTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<MethodsShouldUseBaseTypes>();\n\n        [TestMethod]\n        public void MethodsShouldUseBaseTypes_Internals()\n        {\n            const string code1 = \"\"\"\n                internal interface IFoo\n                {\n                    bool IsFoo { get; }\n                }\n\n                public class Foo : IFoo\n                {\n                    public bool IsFoo { get; set; }\n                }\n                \"\"\";\n            const string code2 = \"\"\"\n                internal class Bar\n                {\n                    public void MethodOne(Foo foo)\n                    {\n                        var x = foo.IsFoo;\n                    }\n                }\n                \"\"\";\n            var solution = SolutionBuilder.Create()\n                .AddProject(AnalyzerLanguage.CSharp)\n                .AddSnippet(code1)\n                .Solution\n                .AddProject(AnalyzerLanguage.CSharp)\n                .AddProjectReference(sln => sln.ProjectIds[0])\n                .AddSnippet(code2)\n                .Solution;\n            foreach (var compilation in solution.Compile())\n            {\n                DiagnosticVerifier.Verify(compilation, [new MethodsShouldUseBaseTypes()], CompilationErrorBehavior.Default, null, [], []);\n            }\n        }\n\n        [TestMethod]\n        public void MethodsShouldUseBaseTypes() =>\n            // There are two files provided (identical) in order to be able to test the rule behavior in concurrent environment.\n            // The rule is executed concurrently if there are at least 2 syntax trees.\n            builder.AddPaths(\"MethodsShouldUseBaseTypes.cs\", \"MethodsShouldUseBaseTypes.Concurrent.cs\").WithAutogenerateConcurrentFiles(false).Verify();\n\n        [TestMethod]\n        public void MethodsShouldUseBaseTypes_CSharp8() =>\n            builder.AddPaths(\"MethodsShouldUseBaseTypes.CSharp8.cs\").WithAutogenerateConcurrentFiles(false).WithOptions(LanguageOptions.FromCSharp8).Verify();\n\n        [TestMethod]\n        public void MethodsShouldUseBaseTypes_Controllers() =>\n            builder.AddPaths(\"MethodsShouldUseBaseTypes.AspControllers.cs\")\n                .AddReferences(NuGetMetadataReference.MicrosoftAspNetCoreMvcCore(TestConstants.NuGetLatestVersion))\n                .Verify();\n        [TestMethod]\n        public void MethodsShouldUseBaseTypes_CSharp9() =>\n            builder.AddPaths(\"MethodsShouldUseBaseTypes.CSharp9.cs\").WithTopLevelStatements().Verify();\n\n        [TestMethod]\n        public void MethodsShouldUseBaseTypes_InvalidCode() =>\n            builder.AddSnippet(\"\"\"\n                using System;\n                using System.Collections;\n                using System.Collections.Generic;\n                using System.Linq;\n\n                public class Foo\n                {\n                    private void FooBar(IList<int> , IList<string>)\n                    {\n                        a.ToList();\n                    }\n\n                    // New test case - code doesn't compile but was making analyzer crash\n                    private void Foo(IList<int> a, IList<string> a)\n                    {\n                        a.ToList();\n                    }\n                }\n                \"\"\").VerifyNoIssuesIgnoreErrors();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/MultilineBlocksWithoutBraceTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class MultilineBlocksWithoutBraceTest\n{\n    private static readonly VerifierBuilder Builder = new VerifierBuilder<MultilineBlocksWithoutBrace>();\n\n    [TestMethod]\n    public void MultilineBlocksWithoutBrace() =>\n        Builder.AddPaths(\"MultilineBlocksWithoutBrace.cs\").Verify();\n\n    [TestMethod]\n    public void MultilineBlocksWithoutBrace_Latest() =>\n        Builder\n            .AddPaths(\"MultilineBlocksWithoutBrace.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/MultipleVariableDeclarationTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class MultipleVariableDeclarationTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.MultipleVariableDeclaration>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.MultipleVariableDeclaration>();\n\n    [TestMethod]\n    public void MultipleVariableDeclaration_CS() =>\n        builderCS.AddPaths(\"MultipleVariableDeclaration.cs\").Verify();\n\n    [TestMethod]\n    public void MultipleVariableDeclaration_VB() =>\n        builderVB.AddPaths(\"MultipleVariableDeclaration.vb\").Verify();\n\n    [TestMethod]\n    public void MultipleVariableDeclaration_CodeFix_CS_WrongIndentation() =>\n        builderCS.WithCodeFix<CS.MultipleVariableDeclarationCodeFix>()\n                 .AddPaths(\"MultipleVariableDeclaration.WrongIndentation.cs\")\n                 .WithCodeFixedPaths(\"MultipleVariableDeclaration.WrongIndentation.Fixed.cs\")\n                 .VerifyCodeFix();\n\n    [TestMethod]\n    public void MultipleVariableDeclaration_CodeFix_CS() =>\n        builderCS.WithCodeFix<CS.MultipleVariableDeclarationCodeFix>()\n                 .AddPaths(\"MultipleVariableDeclaration.cs\")\n                 .WithCodeFixedPaths(\"MultipleVariableDeclaration.Fixed.cs\")\n                 .VerifyCodeFix();\n\n    [TestMethod]\n    public void MultipleVariableDeclaration_CodeFix_VB() =>\n        builderVB.WithCodeFix<VB.MultipleVariableDeclarationCodeFix>()\n                 .AddPaths(\"MultipleVariableDeclaration.vb\")\n                 .WithCodeFixedPaths(\"MultipleVariableDeclaration.Fixed.vb\")\n                 .VerifyCodeFix();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/MutableFieldsShouldNotBePublicReadonlyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class MutableFieldsShouldNotBePublicReadonlyTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<MutableFieldsShouldNotBePublicReadonly>();\n\n    [TestMethod]\n    public void PublicMutableFieldsShouldNotBeReadonly() =>\n        builder.AddPaths(\"MutableFieldsShouldNotBePublicReadonly.cs\").AddReferences(NuGetMetadataReference.SystemCollectionsImmutable(\"1.3.0\")).Verify();\n\n    [TestMethod]\n    public void PublicMutableFieldsShouldNotBeReadonly_CS_Latest() =>\n        builder.AddPaths(\"MutableFieldsShouldNotBePublicReadonly.Latest.cs\")\n            .AddReferences(MetadataReferenceFacade.SystemCollections)\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/MutableFieldsShouldNotBePublicStaticTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class MutableFieldsShouldNotBePublicStaticTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<MutableFieldsShouldNotBePublicStatic>();\n\n    [TestMethod]\n    public void MutableFieldsShouldNotBePublicStatic() =>\n        builder.AddPaths(\"MutableFieldsShouldNotBePublicStatic.cs\").AddReferences(NuGetMetadataReference.SystemCollectionsImmutable(\"1.3.0\")).Verify();\n\n    [TestMethod]\n    public void MutableFieldsShouldNotBePublicStatic_CS_Latest() =>\n        builder.AddPaths(\"MutableFieldsShouldNotBePublicStatic.Latest.cs\")\n            .AddReferences(MetadataReferenceFacade.SystemCollections)\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/NameOfShouldBeUsedTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing RoslynCS = Microsoft.CodeAnalysis.CSharp;\nusing RoslynVB = Microsoft.CodeAnalysis.VisualBasic;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class NameOfShouldBeUsedTest\n    {\n        private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.NameOfShouldBeUsed>();\n        private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.NameOfShouldBeUsed>();\n\n        [TestMethod]\n        public void NameOfShouldBeUsed_CSharp6() =>\n            builderCS.AddPaths(\"NameOfShouldBeUsed.cs\").WithOptions(LanguageOptions.FromCSharp6).Verify();\n\n        [TestMethod]\n        public void NameOfShouldBeUsed_CSharp5() =>\n            builderCS.AddPaths(\"NameOfShouldBeUsed.cs\")\n            .WithLanguageVersion(RoslynCS.LanguageVersion.CSharp5)\n            .WithErrorBehavior(CompilationErrorBehavior.Ignore)\n            .VerifyNoIssues();\n\n        [TestMethod]\n        public void NameOfShouldBeUsed_CSharp11() =>\n            builderCS.AddPaths(\"NameOfShouldBeUsed.CSharp11.cs\").WithOptions(LanguageOptions.FromCSharp11).Verify();\n\n        [TestMethod]\n        public void NameOfShouldBeUsed_FromVB14() =>\n            builderVB.AddPaths(\"NameOfShouldBeUsed.vb\").WithOptions(LanguageOptions.FromVisualBasic14).Verify();\n\n        [TestMethod]\n        public void NameOfShouldBeUsed_VB12() =>\n            builderVB.AddPaths(\"NameOfShouldBeUsed.vb\")\n            .WithLanguageVersion(RoslynVB.LanguageVersion.VisualBasic12)\n            .WithErrorBehavior(CompilationErrorBehavior.Ignore)\n            .VerifyNoIssues();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/NamedPlaceholdersShouldBeUniqueTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\nusing SonarAnalyzer.CSharp.Rules.MessageTemplates;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class NamedPlaceholdersShouldBeUniqueTest\n{\n    private static readonly IEnumerable<MetadataReference> LoggingReferences =\n        NuGetMetadataReference.MicrosoftExtensionsLoggingAbstractions()\n        .Concat(NuGetMetadataReference.NLog())\n        .Concat(NuGetMetadataReference.Serilog());\n\n    private static readonly VerifierBuilder Builder = new VerifierBuilder<MessageTemplateAnalyzer>()\n        .AddReferences(LoggingReferences)\n        .WithOnlyDiagnostics(NamedPlaceholdersShouldBeUnique.S6677);\n\n    [TestMethod]\n    public void NamedPlaceholdersShouldBeUnique_CS() =>\n        Builder.AddPaths(\"NamedPlaceholdersShouldBeUnique.cs\").Verify();\n\n    [TestMethod]\n    [DataRow(\"LogCritical\")]\n    [DataRow(\"LogDebug\")]\n    [DataRow(\"LogError\")]\n    [DataRow(\"LogInformation\")]\n    [DataRow(\"LogTrace\")]\n    [DataRow(\"LogWarning\")]\n    public void NamedPlaceholdersShouldBeUnique_MicrosoftExtensionsLogging_CS(string methodName) =>\n        Builder.AddSnippet($$\"\"\"\n            using System;\n            using Microsoft.Extensions.Logging;\n\n            public class Program\n            {\n                public void Method(ILogger logger, MyLogger myLogger, int arg)\n                {\n                    logger.{{methodName}}(\"Hey {foo} and {bar}\", arg, arg);                       // Compliant\n                    logger.{{methodName}}(\"Hey {foo} and {foo}\", arg, arg);                       // Noncompliant\n                                                                                                  // Secondary @-1\n\n                    myLogger.{{methodName}}(\"Hey {foo} and {bar}\", arg, arg);                     // Compliant\n                    myLogger.{{methodName}}(\"Hey {foo} and {foo}\", arg, arg);                     // Noncompliant\n                                                                                                  // Secondary @-1\n                }\n            }\n\n            public class MyLogger : ILogger\n            {\n                public IDisposable BeginScope<TState>(TState state) => null;\n                public bool IsEnabled(LogLevel logLevel) => true;\n                public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter) { }\n            }\n            \"\"\").Verify();\n\n    [TestMethod]\n    [DataRow(\"Debug\")]\n    [DataRow(\"Error\")]\n    [DataRow(\"Information\")]\n    [DataRow(\"Fatal\")]\n    [DataRow(\"Warning\")]\n    [DataRow(\"Verbose\")]\n    public void NamedPlaceholdersShouldBeUnique_Serilog_CS(string methodName) =>\n        Builder.AddSnippet($$\"\"\"\n            using Serilog;\n            using Serilog.Events;\n\n            public class Program\n            {\n                public void Method(ILogger logger, int arg)\n                {\n                    logger.{{methodName}}(\"Hey {foo} and {bar}\", arg, arg);                       // Compliant\n                    logger.{{methodName}}(\"Hey {foo} and {foo}\", arg, arg);                       // Noncompliant\n                                                                                                  // Secondary @-1\n\n                    Log.{{methodName}}(\"Hey {foo} and {bar}\", arg, arg);                          // Compliant\n                    Log.{{methodName}}(\"Hey {foo} and {foo}\", arg, arg);                          // Noncompliant\n                                                                                                  // Secondary @-1\n\n                    Log.Logger.{{methodName}}(\"Hey {foo} and {bar}\", arg, arg);                   // Compliant\n                    Log.Logger.{{methodName}}(\"Hey {foo} and {foo}\", arg, arg);                   // Noncompliant\n                                                                                                  // Secondary @-1\n                }\n            }\n            \"\"\").Verify();\n\n    [TestMethod]\n    [DataRow(\"Debug\")]\n    [DataRow(\"Error\")]\n    [DataRow(\"Information\")]\n    [DataRow(\"Fatal\")]\n    [DataRow(\"Warning\")]\n    [DataRow(\"Verbose\")]\n    public void NamedPlaceholdersShouldBeUnique_Serilog_Derived_CS(string methodName) =>\n    Builder.AddSnippet($$\"\"\"\n            using Serilog;\n            using Serilog.Events;\n            using Serilog.Core;\n\n            public class Program\n            {\n                public void Method(Logger logger, int arg)\n                {\n                    logger.{{methodName}}(\"Hey {foo} and {bar}\", arg, arg);                       // Compliant\n                    logger.{{methodName}}(\"Hey {foo} and {foo}\", arg, arg);                       // Noncompliant\n                                                                                                  // Secondary @-1\n                }\n            }\n            \"\"\").Verify();\n\n    [TestMethod]\n    [DataRow(\"Debug\")]\n    [DataRow(\"ConditionalDebug\")]\n    [DataRow(\"Error\")]\n    [DataRow(\"Fatal\")]\n    [DataRow(\"Info\")]\n    [DataRow(\"Trace\")]\n    [DataRow(\"ConditionalTrace\")]\n    [DataRow(\"Warn\")]\n    public void NamedPlaceholdersShouldBeUnique_NLog_CS(string methodName) =>\n        Builder.AddSnippet($$\"\"\"\n            using NLog;\n\n            public class Program\n            {\n                public void Method(ILogger iLogger, Logger logger, MyLogger myLogger, int arg)\n                {\n                    iLogger.{{methodName}}(\"Hey {foo} and {bar}\", arg, arg);      // Compliant\n                    iLogger.{{methodName}}(\"Hey {foo} and {foo}\", arg, arg);      // Noncompliant\n                                                                                  // Secondary @-1\n\n                    logger.{{methodName}}(\"Hey {foo} and {bar}\", arg, arg);       // Compliant\n                    logger.{{methodName}}(\"Hey {foo} and {foo}\", arg, arg);       // Noncompliant\n                                                                                  // Secondary @-1\n\n                    myLogger.{{methodName}}(\"Hey {foo} and {bar}\", arg, arg);     // Compliant\n                    myLogger.{{methodName}}(\"Hey {foo} and {foo}\", arg, arg);     // Noncompliant\n                                                                                  // Secondary @-1\n                }\n            }\n            public class MyLogger : Logger { }\n            \"\"\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/NamespaceNameTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class NamespaceNameTest\n    {\n        [TestMethod]\n        public void NamespaceName() =>\n            new VerifierBuilder<NamespaceName>().AddPaths(\"NamespaceName.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/NativeMethodsShouldBeWrappedTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class NativeMethodsShouldBeWrappedTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<NativeMethodsShouldBeWrapped>();\n\n    [TestMethod]\n    public void NativeMethodsShouldBeWrapped() =>\n        builder.AddPaths(\"NativeMethodsShouldBeWrapped.cs\").Verify();\n\n    [TestMethod]\n    public void NativeMethodsShouldBeWrapped_TopLevelStatements() =>\n        builder.AddPaths(\"NativeMethodsShouldBeWrapped.TopLevelStatements.cs\").WithTopLevelStatements().Verify();\n\n    // NativeMethodsShouldBeWrapped.Latest.SourceGenerator.cs contains the code as generated by the SourceGenerator. To regenerate it:\n    // * Take the code from NativeMethodsShouldBeWrapped.Latest.cs\n    // * Copy it to a new .Net 7 project\n    // * Press F12 on any of the partial methods\n    // * Copy the result to NativeMethodsShouldBeWrapped.Latest.SourceGenerator.cs\n    [TestMethod]\n    public void NativeMethodsShouldBeWrapped_CS_Latest() =>\n        builder\n            .AddPaths(\"NativeMethodsShouldBeWrapped.Latest.cs\")\n            .AddPaths(\"NativeMethodsShouldBeWrapped.Latest.SourceGenerator.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .WithConcurrentAnalysis(false)\n            .Verify();\n\n    [TestMethod]\n    public void NativeMethodsShouldBeWrapped_InvalidCode() =>\n        builder.AddSnippet(\"\"\"\n            public class InvalidSyntax\n            {\n                extern public void Extern1  // Error [CS0670, CS0106, CS1002]\n                extern public void Extern2; // Error [CS0670, CS0106]\n                extern private void Extern3(int x);\n                public void Wrapper         // Error [CS0547, CS0548]\n                {\n                    Extern3(x);             // Error [CS1014, CS1513, CS8124, CS1519]\n                }\n                public void Wrapper(        // Error [CS0106, CS8107, CS8803, CS8805, CS8112, CS1001]\n                {\n                    Extern3(x);             // Error [CS0246, CS1003, CS0246, CS8124, CS1001, CS1026, CS1001]\n                }                           // Error [CS1022]\n                public void Wrapper()       // Error [CS0106, CS0128]\n                {\n                    Extern3(x);             // Error [CS0103, CS0103]\n                }\n            }                               // Error [CS1022]\n            \"\"\").WithLanguageVersion(LanguageVersion.CSharp7).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/NegatedIsExpressionTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class NegatedIsExpressionTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<NegatedIsExpression>();\n\n        [TestMethod]\n        public void NegatedIsExpression() =>\n            builder.AddPaths(\"NegatedIsExpression.vb\").Verify();\n\n        [TestMethod]\n        public void NegatedIsExpression_CodeFix() =>\n            builder.WithCodeFix<NegatedIsExpressionCodeFix>()\n                .AddPaths(\"NegatedIsExpression.vb\")\n                .WithCodeFixedPaths(\"NegatedIsExpression.Fixed.vb\")\n                .VerifyCodeFix();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/NestedCodeBlockTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class NestedCodeBlockTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<NestedCodeBlock>();\n\n    [TestMethod]\n    public void NestedCodeBlock() =>\n        builder.AddPaths(\"NestedCodeBlock.cs\").Verify();\n\n    [TestMethod]\n    public void NestedCodeBlock_TopLevelStatements() =>\n        builder.AddPaths(\"NestedCodeBlock.TopLevelStatements.cs\").WithTopLevelStatements().Verify();\n\n    [TestMethod]\n    public void NestedCodeBlock_CS_Latest() =>\n        builder.AddPaths(\"NestedCodeBlock.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/NoExceptionsInFinallyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class NoExceptionsInFinallyTest\n{\n    [TestMethod]\n    public void NoExceptionsInFinally_CS() =>\n        new VerifierBuilder<CS.NoExceptionsInFinally>().AddPaths(\"NoExceptionsInFinally.cs\").Verify();\n\n    [TestMethod]\n    public void NoExceptionsInFinally_VB() =>\n        new VerifierBuilder<VB.NoExceptionsInFinally>().AddPaths(\"NoExceptionsInFinally.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/NonAsyncTaskShouldNotReturnNullTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class NonAsyncTaskShouldNotReturnNullTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<CS.NonAsyncTaskShouldNotReturnNull>();\n\n    [TestMethod]\n    public void NonAsyncTaskShouldNotReturnNull_CS() =>\n        builder.AddPaths(\"NonAsyncTaskShouldNotReturnNull.cs\").WithOptions(LanguageOptions.FromCSharp8).Verify();\n\n    [TestMethod]\n    public void NonAsyncTaskShouldNotReturnNull__CS_Latest() =>\n        builder\n            .AddPaths(\"NonAsyncTaskShouldNotReturnNull.Latest.cs\")\n            .AddPaths(\"NonAsyncTaskShouldNotReturnNull.Latest.Partial.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void NonAsyncTaskShouldNotReturnNull_VB() =>\n        new VerifierBuilder<VB.NonAsyncTaskShouldNotReturnNull>().AddPaths(\"NonAsyncTaskShouldNotReturnNull.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/NonDerivedPrivateClassesShouldBeSealedTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class NonDerivedPrivateClassesShouldBeSealedTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<NonDerivedPrivateClassesShouldBeSealed>();\n\n    [TestMethod]\n    public void NonDerivedPrivateClassesShouldBeSealed_CS() =>\n        builder.AddPaths(\"NonDerivedPrivateClassesShouldBeSealed.cs\", \"NonDerivedPrivateClassesShouldBeSealed_PartialClass.cs\").Verify();\n\n    [TestMethod]\n    public void NonDerivedPrivateClassesShouldBeSealed_CS_Latest() =>\n         builder.AddPaths(\"NonDerivedPrivateClassesShouldBeSealed.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/NonFlagsEnumInBitwiseOperationTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class NonFlagsEnumInBitwiseOperationTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<NonFlagsEnumInBitwiseOperation>();\n\n    [TestMethod]\n    public void NonFlagsEnumInBitwiseOperation() =>\n        builder.AddPaths(\"NonFlagsEnumInBitwiseOperation.cs\").AddReferences(MetadataReferenceFacade.SystemComponentModelPrimitives).Verify();\n\n    [TestMethod]\n    public void NonFlagsEnumInBitwiseOperation_CodeFix() =>\n        builder.WithCodeFix<NonFlagsEnumInBitwiseOperationCodeFix>()\n            .AddPaths(\"NonFlagsEnumInBitwiseOperation.cs\")\n            .WithCodeFixedPaths(\"NonFlagsEnumInBitwiseOperation.Fixed.cs\")\n            .VerifyCodeFix();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/NormalizeStringsToUppercaseTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class NormalizeStringsToUppercaseTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<NormalizeStringsToUppercase>();\n\n        [TestMethod]\n        public void NormalizeStringsToUppercase() =>\n            builder.AddPaths(\"NormalizeStringsToUppercase.cs\").Verify();\n\n        [TestMethod]\n        public void NormalizeStringsToUppercase_CSharp11() =>\n            builder.AddPaths(\"NormalizeStringsToUppercase.CSharp11.cs\")\n            .WithOptions(LanguageOptions.FromCSharp11)\n            .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/NotAssignedPrivateMemberTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class NotAssignedPrivateMemberTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<NotAssignedPrivateMember>();\n\n    [TestMethod]\n    public void NotAssignedPrivateMember() =>\n        builder.AddPaths(\"NotAssignedPrivateMember.cs\").Verify();\n\n    [TestMethod]\n    public void NotAssignedPrivateMember_Latest() =>\n        builder\n            .AddPaths(\"NotAssignedPrivateMember.Latest.cs\")\n            .AddPaths(\"NotAssignedPrivateMember.Latest.Partial.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void NotAssignedPrivateMember_Razor() =>\n        builder.AddPaths(\"NotAssignedPrivateMember.razor\", \"NotAssignedPrivateMember.razor.cs\").VerifyNoIssues();\n\n    [TestMethod]\n    public void NotAssignedPrivateMember_IndexingMovableFixedBuffer() =>\n        builder.AddSnippet(\"\"\"\n            unsafe struct FixedArray\n            {\n                private fixed int a[42]; // Compliant, because of the fixed modifier\n\n                private int[] b; // Noncompliant\n\n                void M()\n                {\n                    a[0] = 42;\n                    b[0] = 42;\n                }\n            }\n            \"\"\").WithLanguageVersion(LanguageVersion.CSharp7_3).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/NumberPatternShouldBeRegularTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class NumberPatternShouldBeRegularTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<NumberPatternShouldBeRegular>();\n\n        [TestMethod]\n        public void NumberPatternShouldBeRegular_BeforeCSharp7() =>\n            builder.AddPaths(\"NumberPatternShouldBeRegular.cs\").WithOptions(LanguageOptions.BeforeCSharp7).WithErrorBehavior(CompilationErrorBehavior.Ignore).VerifyNoIssues();\n\n        [TestMethod]\n        public void NumberPatternShouldBeRegular_FromCSharp7() =>\n            builder.AddPaths(\"NumberPatternShouldBeRegular.cs\").WithOptions(LanguageOptions.FromCSharp7).Verify();\n\n        [TestMethod]\n        public void NumberPatternShouldBeRegular_FromCSharp9() =>\n            builder.AddPaths(\"NumberPatternShouldBeRegular.CSharp9.cs\").WithTopLevelStatements().Verify();\n\n        [TestMethod]\n        [DataRow(\"1_1_1\", \"Group size of 1\")]\n        [DataRow(\"123_12\", \"First group is bigger then the second\")]\n        [DataRow(\"1234_123_123\", \"First group is bigger then the others\")]\n        [DataRow(\"123_123_12_123\", \"Another group has a different size\")]\n        [DataRow(\"1_123.123_1234\", \"Last decimal group is bigger\")]\n        [DataRow(\".123_123_1234\", \"No group before the dot\")]\n        [DataRow(\"0xFF_FF_FFF_FF\", \"3rd group is bigger\")]\n        [DataRow(\"0xFF_FF_FFF\", \"Last group bigger than 2\")]\n        [DataRow(\"0xFFFF_FFFF_FFFFF\", \"Last group bigger than 4\")]\n        [DataRow(\"0xFFFF_FFFF_FFFFF\", \"Last group bigger than 4\")]\n        [DataRow(\"1.234_5678E2\", \"Exponential format with bigger last group\")]\n        [DataRow(\"____\", \"Only underscores\")]\n        [DataRow(\"__.__\", \"Only underscores and a dot\")]\n        [DataRow(\"0xFF___FF___FF\", \"Multiple _'s as separator\")]\n        [DataRow(\"0xFF________FF___FF\", \"Multiple irregular _'s as separator\")]\n        public void HasIrregularPattern(string numericToken, string message) => Assert.IsTrue(NumberPatternShouldBeRegular.HasIrregularPattern(numericToken), message);\n\n        [TestMethod]\n        [DataRow(\".123_123_123_1\", \"No group before the dot\")]\n        [DataRow(\"123\", \"No group character\")]\n        [DataRow(\"1_123_123LU\", \"With LU suffix\")]\n        [DataRow(\"2_123_123lu\", \"With lu suffix\")]\n        [DataRow(\"3_123_123lU\", \"With lU suffix\")]\n        [DataRow(\"1_123_123UL\", \"With UL suffix\")]\n        [DataRow(\"2_123_123ul\", \"With ul suffix\")]\n        [DataRow(\"1_123_123L\", \"With L suffix\")]\n        [DataRow(\"1.1.1\", \"Two dots\")]\n        [DataRow(\"0b1010_1010\", \"With binary prefix\")]\n        [DataRow(\"0xFF_FF_12\", \"With hexadecimal prefix\")]\n        [DataRow(\"0xFF_FF_E2\", \"With hexadecimal prefix with E but not exponential\")]\n        [DataRow(\"1_123_123\", \"first group smaller\")]\n        [DataRow(\"123_123_123\", \"All blocks equal size\")]\n        [DataRow(\"1_123.123_123\", \"All decimal groups have the same size\")]\n        [DataRow(\"1_123.123_123_12\", \"Last decimal group is smaller\")]\n        [DataRow(\"1_123.1234567\", \"Only one group of decimals\")]\n        [DataRow(\"1.234_567E2\", \"Scientific format with regular size\")]\n        [DataRow(\"1.234_5E2\", \"Scientific format with smaller last group\")]\n        [DataRow(\"134.45E-2f\", \"Scientific format f suffix\")]\n        [DataRow(\"134.45E12M\", \"Scientific format M suffix\")]\n        [DataRow(\"1.0\", \"Simple floating point\")]\n        [DataRow(\"3D\", \"Floating point with D suffix\")]\n        [DataRow(\"4d\", \"Floating point with d suffix\")]\n        [DataRow(\"5M\", \"Floating point with M suffix\")]\n        [DataRow(\"6m\", \"Floating point with m suffix\")]\n        [DataRow(\"3_000.5F\", \"Floating point with group size\")]\n        public void HasRegularPattern(string numericToken, string message) => Assert.IsFalse(NumberPatternShouldBeRegular.HasIrregularPattern(numericToken), message);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ObjectCreatedDroppedTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ObjectCreatedDroppedTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<ObjectCreatedDropped>();\n\n    [TestMethod]\n    public void ObjectCreatedDropped() =>\n        builder.AddPaths(\"ObjectCreatedDropped.cs\").Verify();\n\n    [TestMethod]\n    public void ObjectCreatedDropped_CS_Latest() =>\n        builder.AddPaths(\"ObjectCreatedDropped.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void ObjectCreatedDropped_InTest() =>\n       builder.AddPaths(\"ObjectCreatedDropped.cs\").AddTestReference().VerifyNoIssues();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ObsoleteAttributesTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ObsoleteAttributesTest\n{\n    private readonly VerifierBuilder explanationNeededCS;\n    private readonly VerifierBuilder explanationNeededVB;\n    private readonly VerifierBuilder removeCS;\n    private readonly VerifierBuilder removeVB;\n\n    public ObsoleteAttributesTest()\n    {\n        var analyzerCs = new CS.ObsoleteAttributes();\n        var builderCs = new VerifierBuilder().AddAnalyzer(() => analyzerCs);\n        explanationNeededCS = builderCs.WithOnlyDiagnostics(analyzerCs.ExplanationNeededRule);\n        removeCS = builderCs.WithOnlyDiagnostics(analyzerCs.RemoveRule);\n\n        var analyzerVb = new VB.ObsoleteAttributes();\n        var builderVb = new VerifierBuilder().AddAnalyzer(() => analyzerVb);\n        explanationNeededVB = builderVb.WithOnlyDiagnostics(analyzerVb.ExplanationNeededRule);\n        removeVB = builderVb.WithOnlyDiagnostics(analyzerVb.RemoveRule);\n    }\n\n    [TestMethod]\n    public void ObsoleteAttributesNeedExplanation_CS() =>\n       explanationNeededCS.AddPaths(\"ObsoleteAttributesNeedExplanation.cs\").Verify();\n\n    [TestMethod]\n    public void ObsoleteAttributesNeedExplanation_CS_Latest() =>\n        explanationNeededCS\n            .AddPaths(\"ObsoleteAttributesNeedExplanation.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .WithTopLevelStatements()\n            .Verify();\n\n    [TestMethod]\n    public void ObsoleteAttributesNeedExplanation_VB14() =>\n        explanationNeededVB.AddPaths(\"ObsoleteAttributesNeedExplanation.VB14.vb\").WithOptions(LanguageOptions.FromVisualBasic14).Verify();\n\n    [TestMethod]\n    public void ObsoleteAttributesNeedExplanation_VB() =>\n        explanationNeededVB.AddPaths(\"ObsoleteAttributesNeedExplanation.vb\").Verify();\n\n    [TestMethod]\n    public void RemoveObsoleteCode_CS() =>\n        removeCS.AddPaths(\"RemoveObsoleteCode.cs\").Verify();\n\n    [TestMethod]\n    public void RemoveObsoleteCode_Latest() =>\n        removeCS.AddPaths(\"RemoveObsoleteCode.Latest.cs\")\n            .WithTopLevelStatements()\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void RemoveObsoleteCode_VB() =>\n        removeVB.AddPaths(\"RemoveObsoleteCode.vb\").Verify();\n\n    [TestMethod]\n    // All attribute targets of [Obsolete]\n    [DataRow(\"bool field;\")]                   // AttributeTargets.Field\n    [DataRow(\"event EventHandler SomeEvent;\")] // AttributeTargets.Event\n    [DataRow(\"bool Prop { get; set; }\")]       // AttributeTargets.Property\n    [DataRow(\"void Method() { }\")]             // AttributeTargets.Method\n    [DataRow(\"class C { }\")]                   // AttributeTargets.Class\n    [DataRow(\"struct S { }\")]                  // AttributeTargets.Struct\n    [DataRow(\"interface I { }\")]               // AttributeTargets.Interface\n    [DataRow(\"enum E { A }\")]                  // AttributeTargets.Enum\n    [DataRow(\"public Test() { }\")]             // AttributeTargets.Constructor\n    [DataRow(\"delegate void Del();\")]          // AttributeTargets.Delegate\n    [DataRow(\"int this[int i] => 1;\")]         // Indexer\n    public void RemoveObsoleteCode_AttributeTargetTest_CS(string attributeTargetDeclaration)\n    {\n        removeCS.AddSnippet(WrapInTestCode(string.Empty)).VerifyNoIssues();\n        removeCS.AddSnippet(WrapInTestCode(\"[Obsolete] // Noncompliant\")).Verify();\n        removeCS.AddSnippet(WrapInTestCode(\"[Custom]\")).VerifyNoIssues();\n        removeCS.AddSnippet(WrapInTestCode(\"\"\"\n            [Obsolete] // Noncompliant\n            [Custom]\n            \"\"\")).Verify();\n\n        string WrapInTestCode(string attribute) =>\n            $$\"\"\"\n            using System;\n\n            [AttributeUsage(AttributeTargets.All)]\n            public sealed class CustomAttribute: Attribute\n            {\n            }\n\n            public class Test\n            {\n                {{attribute}}\n                {{attributeTargetDeclaration}}\n            }\n            \"\"\";\n    }\n\n    [TestMethod]\n    // All attribute targets of [Obsolete]\n    [DataRow(\"Private field As Boolean\")]        // AttributeTargets.Field\n    [DataRow(\"Event SomeEvent As EventHandler\")] // AttributeTargets.Event\n    [DataRow(\"Property Prop As Boolean\")]        // AttributeTargets.Property\n    [DataRow(\"\"\"\n            Private Sub Method()\n            End Sub\n        \"\"\")]                                    // AttributeTargets.Method\n    [DataRow(\"\"\"\n            Class C\n            End Class\n        \"\"\")]                                    // AttributeTargets.Class\n    [DataRow(\"\"\"\n            Structure S\n            End Structure\n        \"\"\")]                                    // AttributeTargets.Struct\n    [DataRow(\"\"\"\n            Interface I\n            End Interface\n        \"\"\")]                                    // AttributeTargets.Interface\n    [DataRow(\"\"\"\n            Enum E\n                A\n            End Enum\n        \"\"\")]                                    // AttributeTargets.Enum\n    [DataRow(\"\"\"\n            Public Sub New()\n            End Sub\n        \"\"\")]                                    // AttributeTargets.Constructor\n    [DataRow(\"Delegate Sub Del()\")]              // AttributeTargets.Delegate\n    [DataRow(\"\"\"\n            Default ReadOnly Property Item(ByVal i As Integer) As Integer\n                Get\n                    Return 1\n                End Get\n            End Property\n        \"\"\")]                                    // Indexer\n    public void RemoveObsoleteCode_AttributeTargetTest_VB(string attributeTargetDeclaration)\n    {\n        removeVB.AddSnippet(WrapInTestCode(string.Empty)).VerifyNoIssues();\n        removeVB.AddSnippet(WrapInTestCode(\"<Obsolete> ' Noncompliant\")).Verify();\n        removeVB.AddSnippet(WrapInTestCode(\"<Custom>\")).VerifyNoIssues();\n        removeVB.AddSnippet(WrapInTestCode(\"\"\"\n            <Obsolete> ' Noncompliant\n            <Custom>\n            \"\"\")).Verify();\n\n        string WrapInTestCode(string attribute) =>\n            $$\"\"\"\n            Imports System\n\n            <AttributeUsage(AttributeTargets.All)>\n            Public NotInheritable Class CustomAttribute\n                Inherits Attribute\n            End Class\n\n            Public Class Test\n                {{attribute}}\n                {{attributeTargetDeclaration}}\n            End Class\n            \"\"\";\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/OnErrorStatementTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class OnErrorStatementTest\n    {\n        [TestMethod]\n        public void OnErrorStatement() =>\n            new VerifierBuilder<OnErrorStatement>().AddPaths(\"OnErrorStatement.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/OperatorOverloadsShouldHaveNamedAlternativesTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class OperatorOverloadsShouldHaveNamedAlternativesTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<OperatorOverloadsShouldHaveNamedAlternatives>();\n\n        [TestMethod]\n        public void OperatorOverloadsShouldHaveNamedAlternatives() =>\n            builder.AddPaths(\"OperatorOverloadsShouldHaveNamedAlternatives.cs\").Verify();\n\n        [TestMethod]\n        public void OperatorOverloadsShouldHaveNamedAlternatives_CSharp9() =>\n            builder.AddPaths(\"OperatorOverloadsShouldHaveNamedAlternatives.CSharp9.cs\").WithOptions(LanguageOptions.FromCSharp9).Verify();\n\n        [TestMethod]\n        public void OperatorOverloadsShouldHaveNamedAlternatives_CSharp11() =>\n            builder.AddPaths(\"OperatorOverloadsShouldHaveNamedAlternatives.CSharp11.cs\").WithOptions(LanguageOptions.FromCSharp11).Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/OperatorsShouldBeOverloadedConsistentlyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class OperatorsShouldBeOverloadedConsistentlyTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<OperatorsShouldBeOverloadedConsistently>();\n\n    [TestMethod]\n    public void OperatorsShouldBeOverloadedConsistently() =>\n        builder.AddPaths(\"OperatorsShouldBeOverloadedConsistently.cs\").Verify();\n\n    [TestMethod]\n    public void OperatorsShouldBeOverloadedConsistently_CS_Latest() =>\n        builder.AddPaths(\"OperatorsShouldBeOverloadedConsistently.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/OptionExplicitOnTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.VisualBasic;\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class OptionExplicitOnTest\n{\n    [TestMethod]\n    public void OptionExplicitOn_IsOffForProject() =>\n        CreateBuilder(\"' Noncompliant ^1#0 {{Configure 'Option Explicit On' for assembly 'project0'.}}\", false).Verify();\n\n    [TestMethod]\n    public void OptionExplicitOn_IsOff() =>\n        CreateBuilder(\"Option Explicit Off ' Noncompliant ^1#19 {{Change this to 'Option Explicit On'.}}\", true).Verify();\n\n    [TestMethod]\n    public void OptionExplicitOn_IsOn() =>\n        CreateBuilder(\"Option Explicit On\", true).VerifyNoIssues();\n\n    [TestMethod]\n    public void OptionExplicitOn_IsMissing() =>\n        CreateBuilder(\"Option Strict Off\", true).VerifyNoIssues();\n\n    [TestMethod]\n    public void OptionExplicitOn_Concurrent()  =>\n        CreateBuilder(false)\n            .AddSnippet(\"' Noncompliant ^1#0 {{Configure 'Option Explicit On' for assembly 'project0'.}}\")\n            .AddSnippet(\"Option Explicit Off ' Noncompliant ^1#19 {{Change this to 'Option Explicit On'.}}\")\n            .WithConcurrentAnalysis(true)\n            .Verify();\n\n    private static VerifierBuilder CreateBuilder(string snippet, bool optionExplicit) =>\n        CreateBuilder(optionExplicit).AddSnippet(snippet);\n\n    private static VerifierBuilder CreateBuilder(bool optionExplicit) =>\n        new VerifierBuilder<OptionExplicitOn>().WithCompilationOptionsCustomization(x => ((VisualBasicCompilationOptions)x).WithOptionExplicit(optionExplicit));\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/OptionStrictOnTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.VisualBasic;\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class OptionStrictOnTest\n    {\n        [TestMethod]\n        public void OptionStrictOn_IsOff_ForProject() =>\n            CreateBuilder(\"' Noncompliant ^1#0 {{Configure 'Option Strict On' for assembly 'project0'.}}\", OptionStrict.Off).Verify();\n\n        [TestMethod]\n        public void OptionStrictOn_IsCustom_ForProject() =>\n            CreateBuilder(\"' Noncompliant ^1#0 {{Configure 'Option Strict On' for assembly 'project0'.}}\", OptionStrict.Custom).Verify();\n\n        [TestMethod]\n        public void OptionStrictOn_IsOff() =>\n            CreateBuilder(\"Option Strict Off ' Noncompliant ^1#17 {{Change this to 'Option Strict On'.}}\", OptionStrict.On).Verify();\n\n        [TestMethod]\n        public void OptionStrictOn_IsOn() =>\n            CreateBuilder(\"Option Strict On ' Compliant\", OptionStrict.On).VerifyNoIssues();\n\n        [TestMethod]\n        public void OptionStrictOn_Concurrent() =>\n            CreateBuilder(OptionStrict.On)\n                .AddSnippet(\"Option Strict Off ' Noncompliant ^1#17 {{Change this to 'Option Strict On'.}}\")\n                .AddSnippet(\"Option Strict On ' Compliant\")\n                .WithConcurrentAnalysis(true)\n                .Verify();\n\n        private static VerifierBuilder CreateBuilder(string snippet, OptionStrict optionStrict) =>\n            CreateBuilder(optionStrict).AddSnippet(snippet);\n\n        private static VerifierBuilder CreateBuilder(OptionStrict optionStrict) =>\n            new VerifierBuilder<OptionStrictOn>().WithCompilationOptionsCustomization(x => ((VisualBasicCompilationOptions)x).WithOptionStrict(optionStrict));\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/OptionalParameterNotPassedToBaseCallTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class OptionalParameterNotPassedToBaseCallTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.OptionalParameterNotPassedToBaseCall>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.OptionalParameterNotPassedToBaseCall>();\n\n    [TestMethod]\n    public void OptionalParameterNotPassedToBaseCall_CS() =>\n        builderCS.AddPaths(\"OptionalParameterNotPassedToBaseCall.cs\").Verify();\n\n    [TestMethod]\n    public void OptionalParameterNotPassedToBaseCall_CS_Latest() =>\n        builderCS.AddPaths(\"OptionalParameterNotPassedToBaseCall.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void OptionalParameterNotPassedToBaseCall_VB() =>\n        builderVB.AddPaths(\"OptionalParameterNotPassedToBaseCall.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/OptionalParameterTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class OptionalParameterTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.OptionalParameter>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.OptionalParameter>();\n\n    [TestMethod]\n    public void OptionalParameter_CS() =>\n        builderCS.AddPaths(\"OptionalParameter.cs\").Verify();\n\n    [TestMethod]\n    public void OptionalParameter_VB() =>\n        builderVB.AddPaths(\"OptionalParameter.vb\").Verify();\n\n#if NET\n\n    [TestMethod]\n    public void OptionalParameter_CS_Web() =>\n        builderCS.AddPaths(\"OptionalParameter.Web.cs\")\n            .AddReferences(AspNetCoreMetadataReference.BasicReferences).Verify();\n\n    [TestMethod]\n    public void OptionalParameter_CSharp10() =>\n        builderCS.AddPaths(\"OptionalParameter.CSharp10.cs\").WithOptions(LanguageOptions.FromCSharp10).VerifyNoIssues();\n\n    [TestMethod]\n    public void OptionalParameter_CSharp11() =>\n        builderCS.AddPaths(\"OptionalParameter.CSharp11.cs\").WithOptions(LanguageOptions.FromCSharp11).Verify();\n\n#endif\n\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/OptionalParameterWithDefaultValueTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class OptionalParameterWithDefaultValueTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<OptionalParameterWithDefaultValue>();\n\n    [TestMethod]\n    public void OptionalParameterWithDefaultValue() =>\n        builder.AddPaths(\"OptionalParameterWithDefaultValue.cs\").Verify();\n\n    [TestMethod]\n    public void OptionalParameterWithDefaultValue_CS_Latest() =>\n        builder.AddPaths(\"OptionalParameterWithDefaultValue.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void OptionalParameterWithDefaultValue_CodeFix() =>\n        builder.WithCodeFix<OptionalParameterWithDefaultValueCodeFix>()\n            .AddPaths(\"OptionalParameterWithDefaultValue.cs\")\n            .WithCodeFixedPaths(\"OptionalParameterWithDefaultValue.Fixed.cs\")\n            .VerifyCodeFix();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/OptionalRefOutParameterTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class OptionalRefOutParameterTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<OptionalRefOutParameter>();\n\n    [TestMethod]\n    public void OptionalRefOutParameter() =>\n        builder.AddPaths(\"OptionalRefOutParameter.cs\").Verify();\n\n    [TestMethod]\n    public void OptionalRefOutParameter_TopLevelStatements() =>\n        builder.AddPaths(\"OptionalRefOutParameter.TopLevelStatements.cs\").WithTopLevelStatements().Verify();\n\n    [TestMethod]\n    public void OptionalRefOutParameter_CS_Latest() =>\n        builder.AddPaths(\"OptionalRefOutParameter.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void OptionalRefOutParameter_CodeFix() =>\n        builder.WithCodeFix<OptionalRefOutParameterCodeFix>()\n            .AddPaths(\"OptionalRefOutParameter.cs\")\n            .WithCodeFixedPaths(\"OptionalRefOutParameter.Fixed.cs\")\n            .VerifyCodeFix();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/OrderByRepeatedTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class OrderByRepeatedTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<OrderByRepeated>();\n\n    [TestMethod]\n    public void OrderByRepeated() =>\n        builder.AddPaths(\"OrderByRepeated.cs\").Verify();\n\n    [TestMethod]\n    public void OrderByRepeated_CodeFix() =>\n        builder\n            .WithCodeFix<OrderByRepeatedCodeFix>()\n            .AddPaths(\"OrderByRepeated.cs\")\n            .WithCodeFixedPaths(\"OrderByRepeated.Fixed.cs\")\n            .VerifyCodeFix();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/OverrideGetHashCodeOnOverridingEqualsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class OverrideGetHashCodeOnOverridingEqualsTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<OverrideGetHashCodeOnOverridingEquals>();\n\n    [TestMethod]\n    public void OverrideGetHashCodeOnOverridingEquals() =>\n        builder.AddPaths(\"OverrideGetHashCodeOnOverridingEquals.cs\").Verify();\n\n    [TestMethod]\n    public void OverrideGetHashCodeOnOverridingEquals_CS_Latest() =>\n        builder.AddPaths(\"OverrideGetHashCodeOnOverridingEquals.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).VerifyNoIssues();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/PInvokesShouldNotBeVisibleTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class PInvokesShouldNotBeVisibleTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<PInvokesShouldNotBeVisible>();\n\n        [TestMethod]\n        public void PInvokesShouldNotBeVisible() =>\n            builder.AddPaths(\"PInvokesShouldNotBeVisible.cs\").Verify();\n\n        [TestMethod]\n        public void PInvokesShouldNotBeVisible_CSharp9() =>\n            builder.AddPaths(\"PInvokesShouldNotBeVisible.CSharp9.cs\")\n                .WithOptions(LanguageOptions.FromCSharp9)\n                .Verify();\n\n        [TestMethod]\n        public void PInvokesShouldNotBeVisible_CSharp11() =>\n            builder.AddPaths(\"PInvokesShouldNotBeVisible.CSharp11.cs\")\n                .WithOptions(LanguageOptions.FromCSharp11)\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ParameterAssignedToTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ParameterAssignedToTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.ParameterAssignedTo>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.ParameterAssignedTo>();\n\n    [TestMethod]\n    public void ParameterAssignedTo_CS() =>\n        builderCS.AddPaths(\"ParameterAssignedTo.cs\").Verify();\n\n    [TestMethod]\n    public void ParameterAssignedTo_CS_Latest() =>\n        builderCS\n            .AddPaths(\"ParameterAssignedTo.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .WithTopLevelStatements()\n            .Verify();\n\n    [TestMethod]\n    public void ParameterAssignedTo_VB() =>\n        builderVB.AddPaths(\"ParameterAssignedTo.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ParameterNameMatchesOriginalTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ParameterNameMatchesOriginalTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.ParameterNameMatchesOriginal>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.ParameterNameMatchesOriginal>();\n\n    [TestMethod]\n    public void ParameterNameMatchesOriginal_CS() =>\n        builderCS.AddPaths(\"ParameterNameMatchesOriginal.cs\")\n            .AddReferences(MetadataReferenceFacade.NetStandard21)\n            .Verify();\n\n    [TestMethod]\n    public void ParameterNameMatchesOriginal_CS_Latest() =>\n        builderCS\n            .AddPaths(\"ParameterNameMatchesOriginal.Latest.cs\")\n            .AddPaths(\"ParameterNameMatchesOriginal.Latest.Partial.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void ParameterNameMatchesOriginal_VB() =>\n        builderVB.AddPaths(\"ParameterNameMatchesOriginal.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ParameterNameTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ParameterNameTest\n{\n    [TestMethod]\n    public void ParameterName() =>\n        new VerifierBuilder<ParameterName>().AddPaths(\"ParameterName.vb\").Verify();\n\n    [TestMethod]\n    public void ParameterName_CustomPattern() =>\n        new VerifierBuilder().AddAnalyzer(() => new ParameterName { Pattern = \"^Prefix[A-Z].*\" }).AddPaths(\"ParameterName.CustomPattern.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ParameterNamesShouldNotDuplicateMethodNamesTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class ParameterNamesShouldNotDuplicateMethodNamesTest\n    {\n        [TestMethod]\n        public void ParameterNamesShouldNotDuplicateMethodNames_CSharp8() =>\n            new VerifierBuilder<ParameterNamesShouldNotDuplicateMethodNames>().AddPaths(\"ParameterNamesShouldNotDuplicateMethodNames.cs\")\n                .WithOptions(LanguageOptions.FromCSharp8)\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ParameterTypeShouldMatchRouteTypeConstraintTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ParameterTypeShouldMatchRouteTypeConstraintTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<ParameterTypeShouldMatchRouteTypeConstraint>();\n\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    public void ParameterTypeShouldMatchRouteTypeConstraint_Blazor() =>\n        builder.AddPaths(\"ParameterTypeShouldMatchRouteTypeConstraint.razor\")\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Product))\n            .Verify();\n\n    [TestMethod]\n    public void ParameterTypeShouldMatchRouteTypeConstraint_Partial() =>\n        builder.AddPaths(\"ParameterTypeShouldMatchRouteTypeConstraint.Partial.razor\", \"ParameterTypeShouldMatchRouteTypeConstraint.Partial.razor.cs\")\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Product))\n            .Verify();\n\n    [TestMethod]\n    public void ParameterTypeShouldMatchRouteTypeConstraint_CS() =>\n        builder.AddPaths(\"ParameterTypeShouldMatchRouteTypeConstraint.cs\")\n            .AddReferences(NuGetMetadataReference.MicrosoftAspNetCoreComponents(\"7.0.13\"))\n            .Verify();\n\n    [TestMethod]\n    public void ParameterTypeShouldMatchRouteTypeConstraint_CS_Latest() =>\n    builder.AddPaths(\"ParameterTypeShouldMatchRouteTypeConstraint.cs\")\n        .AddReferences(NuGetMetadataReference.MicrosoftAspNetCoreComponents(\"7.0.13\"))\n        .WithOptions(LanguageOptions.CSharpLatest)\n        .Verify();\n\n    [TestMethod]\n    public void ParameterTypeShouldMatchRouteTypeConstraint_Conversion() =>\n        builder.AddPaths(\"ParameterTypeShouldMatchRouteTypeConstraint.Conversion.razor\")\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Product))\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ParameterValidationInAsyncShouldBeWrappedTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class ParameterValidationInAsyncShouldBeWrappedTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<ParameterValidationInAsyncShouldBeWrapped>();\n\n        [TestMethod]\n        public void ParameterValidationInAsyncShouldBeWrapped() =>\n            builder.AddPaths(\"ParameterValidationInAsyncShouldBeWrapped.cs\").Verify();\n\n        [TestMethod]\n        public void ParameterValidationInAsyncShouldBeWrapped_CSharp10() =>\n            builder.AddPaths(\"ParameterValidationInAsyncShouldBeWrapped.CSharp10.cs\")\n                .WithOptions(LanguageOptions.FromCSharp10)\n                .Verify();\n\n        [TestMethod]\n        public void ParameterValidationInAsyncShouldBeWrapped_CSharp11() =>\n            builder.AddPaths(\"ParameterValidationInAsyncShouldBeWrapped.CSharp11.cs\")\n                .WithOptions(LanguageOptions.FromCSharp11)\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ParameterValidationInYieldShouldBeWrappedTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ParameterValidationInYieldShouldBeWrappedTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<ParameterValidationInYieldShouldBeWrapped>();\n\n    [TestMethod]\n    public void ParameterValidationInYieldShouldBeWrapped() =>\n        builder.AddPaths(\"ParameterValidationInYieldShouldBeWrapped.cs\").Verify();\n\n    [TestMethod]\n    public void ParameterValidationInYieldShouldBeWrapped_CS_Latest() =>\n        builder.AddPaths(\"ParameterValidationInYieldShouldBeWrapped.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ParametersCorrectOrderTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ParametersCorrectOrderTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.ParametersCorrectOrder>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.ParametersCorrectOrder>();\n\n    [TestMethod]\n    public void ParametersCorrectOrder() =>\n        builderCS.AddPaths(\"ParametersCorrectOrder.cs\").Verify();\n\n    [TestMethod]\n    public void ParametersCorrectOrder_CS_Latest() =>\n        builderCS.AddPaths(\"ParametersCorrectOrder.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void ParametersCorrectOrder_InvalidCode_CS() =>\n        builderCS.AddSnippet(\"\"\"\n            public class Foo\n            {\n                public void Bar()\n                {\n                    new Foo\n                    new ()\n                    new System. ()\n                }\n            }\n            \"\"\").VerifyNoIssuesIgnoreErrors();\n\n    [TestMethod]\n    public void ParametersCorrectOrder_VB() =>\n        builderVB.AddPaths(\"ParametersCorrectOrder.vb\").Verify();\n\n    [TestMethod]\n    public void ParametersCorrectOrder_InvalidCode_VB() =>\n        builderVB.AddSnippet(\"\"\"\n            Public Class Foo\n                Public Sub Bar()\n                    Dim x = New ()\n                    Dim y = New System. ()\n                End Sub\n            End Class\n            \"\"\").VerifyNoIssuesIgnoreErrors();\n\n    [TestMethod]\n    public async Task ParametersCorrectOrder_SecondaryLocationsOutsideCurrentCompilation()\n    {\n        var library = TestCompiler.CompileCS(\"\"\"\n            public static class Library\n            {\n                public static void Method(int a, int b) { }\n            }\n            \"\"\").Model.Compilation;\n        var usage = TestCompiler.CompileCS(\"\"\"\n            public class Usage\n            {\n                public void Method()\n                {\n                    int a = 4, b = 2;\n                    Library.Method(b, a);\n                }\n            }\n            \"\"\", library.ToMetadataReference()).Model.Compilation;\n        var diagnostics = await usage.WithAnalyzers([new CS.ParametersCorrectOrder()]).GetAnalyzerDiagnosticsAsync();\n        diagnostics.Should().ContainSingle().Which.Id.Should().Be(\"S2234\", \"we don't want AD0001 here\");\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/PartCreationPolicyShouldBeUsedWithExportAttributeTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class PartCreationPolicyShouldBeUsedWithExportAttributeTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.PartCreationPolicyShouldBeUsedWithExportAttribute>()\n            .AddReferences(MetadataReferenceFacade.SystemComponentModelComposition);\n\n    [TestMethod]\n    public void PartCreationPolicyShouldBeUsedWithExportAttribute_CS() =>\n        builderCS.AddPaths(\"PartCreationPolicyShouldBeUsedWithExportAttribute.cs\").WithConcurrentAnalysis(false).Verify();\n\n    [TestMethod]\n    public void PartCreationPolicyShouldBeUsedWithExportAttribute_UnresolvedSymbol_CS() =>\n        builderCS.AddSnippet(\"\"\"\n            [UnresolvedAttribute] // Error [CS0246, CS0246]\n            class Bar { }\n            \"\"\")\n            .Verify();\n\n    [TestMethod]\n    public void PartCreationPolicyShouldBeUsedWithExportAttribute_CS_Latest() =>\n        builderCS.AddPaths(\"PartCreationPolicyShouldBeUsedWithExportAttribute.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void PartCreationPolicyShouldBeUsedWithExportAttribute_VB() =>\n        new VerifierBuilder<VB.PartCreationPolicyShouldBeUsedWithExportAttribute>().AddPaths(\"PartCreationPolicyShouldBeUsedWithExportAttribute.vb\")\n            .AddReferences(MetadataReferenceFacade.SystemComponentModelComposition)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/PartialMethodNoImplementationTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class PartialMethodNoImplementationTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<PartialMethodNoImplementation>();\n\n    [TestMethod]\n    public void PartialMethodNoImplementation() =>\n        builder.AddPaths(\"PartialMethodNoImplementation.cs\").Verify();\n\n    [TestMethod]\n    public void PartialMethodNoImplementation_CS_Latest() =>\n        builder.AddPaths(\"PartialMethodNoImplementation.Latest.cs\", \"PartialMethodNoImplementation.Latest.Partial.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/PasswordsShouldBeStoredCorrectlyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class PasswordsShouldBeStoredCorrectlyTest\n{\n    private static readonly VerifierBuilder Builder = new VerifierBuilder<PasswordsShouldBeStoredCorrectly>();\n\n#if NET\n    [TestMethod]\n    public void PasswordsShouldBeStoredCorrectly_CS_Core() =>\n        Builder\n            .WithOptions(LanguageOptions.FromCSharp8)\n            .AddPaths(\"PasswordsShouldBeStoredCorrectly.Core.cs\")\n            .AddReferences([\n                AspNetCoreMetadataReference.MicrosoftExtensionsIdentityCore,\n                AspNetCoreMetadataReference.MicrosoftAspNetCoreCryptographyKeyDerivation,\n                ..MetadataReferenceFacade.SystemSecurityCryptography,\n            ])\n            .Verify();\n#endif\n\n    [TestMethod]\n    public void PasswordsShouldBeStoredCorrectly_CS_PasswordHasherOptions() =>\n        Builder\n            .WithOptions(LanguageOptions.FromCSharp9)\n            .AddReferences(NuGetMetadataReference.MicrosoftAspNetIdentity())\n            .AddSnippet(\"\"\"\n                using Microsoft.AspNet.Identity;\n\n                class Testcases\n                {\n                   void Method()\n                   {\n                        var _ = new PasswordHasherOptions();                    // Noncompliant {{PasswordHasher does not support state-of-the-art parameters. Use Rfc2898DeriveBytes instead.}}\n                        //      ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n                        PasswordHasherOptions x = new();                        // Noncompliant\n                        //                        ^^^^^\n                        _ = new PasswordHasherOptions() {};                     // Noncompliant\n                        //  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n                        _ = new PasswordHasherOptions { IterationCount = 42 };  // Noncompliant\n                        //  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n                        _ = new Derived();                                      // Noncompliant\n                        //  ^^^^^^^^^^^^^\n                   }\n                }\n\n                public class Derived: PasswordHasherOptions { }\n                \"\"\")\n            .Verify();\n\n    [TestMethod]\n    public void PasswordsShouldBeStoredCorrectly_CS_Rfc2898DeriveBytes() =>\n        Builder\n            .AddReferences(MetadataReferenceFacade.SystemSecurityCryptography)\n            .AddSnippet(\"\"\"\n                using System.Security.Cryptography;\n                class Testcases\n                {\n                    const int ITERATIONS = 100_000;\n\n                    void Method(int iterations, byte[] bs, HashAlgorithmName han)\n                    {\n                        new Rfc2898DeriveBytes(\"password\", bs);                             // Noncompliant\n                        new Rfc2898DeriveBytes(\"password\", 42);                             // Noncompliant\n                        new Rfc2898DeriveBytes(bs, bs, 42);                                 // Noncompliant\n                    //  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n                        new Rfc2898DeriveBytes(iterations: 42, salt: bs, password: bs);     // Noncompliant {{Use at least 100,000 iterations and a state-of-the-art digest algorithm here.}}\n                    //  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n                        new Rfc2898DeriveBytes(\"password\", bs, 42);                         // Noncompliant\n                        new Rfc2898DeriveBytes(\"password\", 42, 42);                         // Noncompliant\n                        new Rfc2898DeriveBytes(bs, bs, 42, han);                            // Noncompliant {{Use at least 100,000 iterations here.}}\n                    //                                 ^^\n                        new Rfc2898DeriveBytes(\"password\", bs, 42, han);                    // Noncompliant\n                        new Rfc2898DeriveBytes(\"password\", 42, 42, han);                    // Noncompliant\n                        new Rfc2898DeriveBytes(bs, bs, ITERATIONS);                         // Noncompliant\n                        new Rfc2898DeriveBytes(\"\", bs, ITERATIONS);                         // Noncompliant\n                        new Rfc2898DeriveBytes(\"\", 42, ITERATIONS);                         // Noncompliant\n                    //  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n                        new Rfc2898DeriveBytes(bs, bs, iterations, han);                    // Compliant\n                        new Rfc2898DeriveBytes(bs, bs, ITERATIONS, han);                    // Compliant\n                        new Rfc2898DeriveBytes(\"\", bs, ITERATIONS, han);                    // Compliant\n                        new Rfc2898DeriveBytes(\"\", 42, ITERATIONS, han);                    // Compliant\n\n                        var x = new Rfc2898DeriveBytes(bs, bs, ITERATIONS, han);\n                        x.IterationCount = 1;                                               // Noncompliant {{Use at least 100,000 iterations here.}}\n                    //  ^^^^^^^^^^^^^^^^\n\n                        x.IterationCount = 100_042;                                         // Compliant\n\n                        new Rfc2898DeriveBytes(bs, bs, ITERATIONS, han)\n                        {\n                            IterationCount = 42                                             // Noncompliant {{Use at least 100,000 iterations here.}}\n                    //      ^^^^^^^^^^^^^^\n                        };\n                    }\n\n                    void MakeItUnsafe(Rfc2898DeriveBytes password)\n                    {\n                        password.IterationCount = 1;                                        // Noncompliant {{Use at least 100,000 iterations here.}}\n                    //  ^^^^^^^^^^^^^^^^^^^^^^^\n                    }\n                }\n                \"\"\")\n            .Verify();\n\n    [TestMethod]\n    public void PasswordsShouldBeStoredCorrectly_CS_BouncyCastle_Generate() =>\n        Builder\n            .AddReferences(NuGetMetadataReference.BouncyCastle())\n            .AddSnippet(\"\"\"\n                using Org.BouncyCastle.Crypto.Generators;\n\n                class Testcases\n                {\n                    const int COST = 12;\n\n                    void Method(char[] cs, byte[] bs)\n                    {\n                        OpenBsdBCrypt.Generate(cs, bs, 4);                          // Noncompliant {{Use a cost factor of at least 12 here.}}\n                        OpenBsdBCrypt.Generate(cost: 4, password: cs, salt: bs);    // Noncompliant\n                        OpenBsdBCrypt.Generate(\"\", cs, bs, 4);                      // Noncompliant\n                        //                                 ^\n                        OpenBsdBCrypt.Generate(\n                            cost: 4,                                                // Noncompliant\n                        //  ^^^^^^^\n                            version: \"\",\n                            password: cs,\n                            salt: bs);\n\n                        OpenBsdBCrypt.Generate(cs, bs, COST);                       // Compliant\n                        OpenBsdBCrypt.Generate(cs, bs, 42);                         // Compliant\n                        OpenBsdBCrypt.Generate(\"\", cs, bs, COST);                   // Compliant\n                        OpenBsdBCrypt.Generate(\"\", cs, bs, 42);                     // Compliant\n                        OpenBsdBCrypt.Generate(\n                            cost: 42,                                                // Compliant\n                            version: \"\",\n                            password: cs,\n                            salt: bs);\n\n                        BCrypt.Generate(bs, bs, 4);                                  // Noncompliant\n                        //                      ^\n                        BCrypt.Generate(bs, bs, COST);                               // Compliant\n                    }\n                }\n                \"\"\")\n            .Verify();\n\n    [TestMethod]\n    public void PasswordsShouldBeStoredCorrectly_CS_BouncyCastle_Init() =>\n        Builder\n            .AddReferences(NuGetMetadataReference.BouncyCastle())\n            .AddSnippet(\"\"\"\n                using Org.BouncyCastle.Crypto;\n                using Org.BouncyCastle.Crypto.Generators;\n\n                class Testcases\n                {\n                    const int ITERATIONS = 100_000;\n\n                    void Method(byte[] bs, PbeParametersGenerator baseGen, Pkcs5S2ParametersGenerator gen, int iterations)\n                    {\n                        baseGen.Init(bs, bs, 42);                                       // Noncompliant {{Use at least 100,000 iterations here.}}\n                    //                       ^^\n                        gen.Init(iterationCount: 42, password: bs, salt: bs);           // Noncompliant\n                    //           ^^^^^^^^^^^^^^^^^^\n\n                        baseGen.Init(bs, bs, ITERATIONS);                               // Compliant\n                        gen.Init(iterationCount: iterations, password: bs, salt: bs);   // Compliant\n                    }\n                }\n                \"\"\")\n            .Verify();\n\n    [TestMethod]\n    public void PasswordsShouldBeStoredCorrectly_CS_BouncyCastle_Generate_SCrypt() =>\n        Builder\n            .AddReferences(NuGetMetadataReference.BouncyCastle())\n            .AddSnippet(\"\"\"\n                using Org.BouncyCastle.Crypto.Generators;\n\n                class Testcases\n                {\n                    void Method(byte[] bs, int p)\n                    {\n                        SCrypt.Generate(bs, bs, 1 << 12, 8, p, 32);         // Compliant\n\n                        SCrypt.Generate(bs, bs, 1 << 11, 42, p, 42);        // Noncompliant {{Use a cost factor of at least 2 ^ 12 for N here.}}\n                        //                      ^^^^^^^\n                        SCrypt.Generate(bs, bs, 1 << 12, 7, p, 42);         // Noncompliant {{Use a memory factor of at least 8 for r here.}}\n                        //                               ^\n                        SCrypt.Generate(bs, bs, 1 << 12, 42, p, 31);        // Noncompliant {{Use an output length of at least 32 for dkLen here.}}\n                        //                                      ^^\n\n                        SCrypt.Generate(bs, bs, 1 << 11, 7, p, 31);\n                        //                      ^^^^^^^ {{Use a cost factor of at least 2 ^ 12 for N here.}}\n                        //                               ^ @-1 {{Use a memory factor of at least 8 for r here.}}\n                        //                                     ^^ @-2 {{Use an output length of at least 32 for dkLen here.}}\n                    }\n                }\n                \"\"\")\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/PointersShouldBePrivateTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class PointersShouldBePrivateTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<PointersShouldBePrivate>();\n\n        [TestMethod]\n        public void PointersShouldBePrivate() =>\n            builder.AddPaths(\"PointersShouldBePrivate.cs\").Verify();\n\n        [TestMethod]\n        public void PointersShouldBePrivate_CSharp9() =>\n            builder.AddPaths(\"PointersShouldBePrivate.CSharp9.cs\").WithOptions(LanguageOptions.FromCSharp9).Verify();\n\n        [TestMethod]\n        public void PointersShouldBePrivate_CSharp11() =>\n            builder.AddPaths(\"PointersShouldBePrivate.CSharp11.cs\").WithOptions(LanguageOptions.FromCSharp11).Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/PreferGuidEmptyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class PreferGuidEmptyTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.PreferGuidEmpty>().WithOptions(LanguageOptions.FromCSharp8);\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.PreferGuidEmpty>();\n\n    [TestMethod]\n    public void PreferGuidEmpty_CS() =>\n        builderCS.AddPaths(\"PreferGuidEmpty.cs\").Verify();\n\n    [TestMethod]\n    public void PreferGuidEmpty_CS_Latest() =>\n        builderCS.AddPaths(\"PreferGuidEmpty.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void PreferGuidEmpty_VB() =>\n        builderVB.AddPaths(\"PreferGuidEmpty.vb\").Verify();\n\n    [TestMethod]\n    public void PreferGuidEmpty_CodeFix_CS() =>\n        builderCS.AddPaths(\"PreferGuidEmpty.cs\").WithCodeFix<CS.PreferGuidEmptyCodeFix>().WithCodeFixedPaths(\"PreferGuidEmpty.Fixed.cs\").VerifyCodeFix();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/PreferJaggedArraysOverMultidimensionalTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class PreferJaggedArraysOverMultidimensionalTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<PreferJaggedArraysOverMultidimensional>();\n\n    [TestMethod]\n    public void PreferJaggedArraysOverMultidimensional() =>\n        builder.AddPaths(\"PreferJaggedArraysOverMultidimensional.cs\").Verify();\n\n    [TestMethod]\n    public void PreferJaggedArraysOverMultidimensional_Latest() =>\n        builder\n            .AddPaths(\"PreferJaggedArraysOverMultidimensional.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/PrivateConstantFieldNameTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class PrivateConstantFieldNameTest\n    {\n        [TestMethod]\n        public void PrivateConstantFieldName() =>\n            new VerifierBuilder<PrivateConstantFieldName>().AddPaths(\"PrivateConstantFieldName.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/PrivateFieldNameTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class PrivateFieldNameTest\n    {\n        [TestMethod]\n        public void PrivateFieldName() =>\n            new VerifierBuilder<PrivateFieldName>().AddPaths(\"PrivateFieldName.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/PrivateFieldUsedAsLocalVariableTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class PrivateFieldUsedAsLocalVariableTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<PrivateFieldUsedAsLocalVariable>();\n\n    [TestMethod]\n    public void PrivateFieldUsedAsLocalVariable() =>\n        builder.AddPaths(\"PrivateFieldUsedAsLocalVariable.cs\")\n            .Verify();\n\n    [TestMethod]\n    public void PrivateFieldUsedAsLocalVariable_CS_Latest() =>\n        builder.AddPaths(\"PrivateFieldUsedAsLocalVariable.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/PrivateSharedReadonlyFieldNameTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class PrivateSharedReadonlyFieldNameTest\n    {\n        [TestMethod]\n        public void PrivateSharedReadonlyFieldName() =>\n            new VerifierBuilder<PrivateSharedReadonlyFieldName>().AddPaths(\"PrivateSharedReadonlyFieldName.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/PrivateStaticMethodUsedOnlyByNestedClassTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class PrivateStaticMethodUsedOnlyByNestedClassTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<PrivateStaticMethodUsedOnlyByNestedClass>();\n\n    [TestMethod]\n    public void PrivateStaticMethodUsedOnlyByNestedClass_CS() =>\n        builder\n            .AddPaths(\"PrivateStaticMethodUsedOnlyByNestedClass.cs\")\n            .Verify();\n\n    [TestMethod]\n    public void PrivateStaticMethodUsedOnlyByNestedClass_CS_Latest() =>\n        builder\n            .AddPaths(\"PrivateStaticMethodUsedOnlyByNestedClass.CSharpLatest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/PropertiesAccessCorrectFieldTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class PropertiesAccessCorrectFieldTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.PropertiesAccessCorrectField>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.PropertiesAccessCorrectField>();\n\n    private static IEnumerable<MetadataReference> AdditionalReferences =>\n        NuGetMetadataReference.MvvmLightLibs(\"5.4.1.1\")\n            .Concat(MetadataReferenceFacade.WindowsBase)\n            .Concat(MetadataReferenceFacade.PresentationFramework);\n\n    [TestMethod]\n    public void PropertiesAccessCorrectField_CS() =>\n        builderCS.AddPaths(\"PropertiesAccessCorrectField.cs\").AddReferences(AdditionalReferences).Verify();\n\n    [TestMethod]\n    public void PropertiesAccessCorrectField_CS_Latest() =>\n        builderCS.AddPaths(\"PropertiesAccessCorrectField.Latest.cs\", \"PropertiesAccessCorrectField.Latest.Partial.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void PropertiesAccessCorrectField_CS_NetFramework() =>\n        builderCS.AddPaths(\"PropertiesAccessCorrectField.NetFramework.cs\").AddReferences(AdditionalReferences).WithNetFrameworkOnly().VerifyNoIssues();\n\n    [TestMethod]\n    public void PropertiesAccessCorrectField_VB_NetFramework() =>\n        builderVB.AddPaths(\"PropertiesAccessCorrectField.NetFramework.vb\").AddReferences(AdditionalReferences).WithNetFrameworkOnly().VerifyNoIssues();\n\n    [TestMethod]\n    public void PropertiesAccessCorrectField_VB() =>\n        builderVB.AddPaths(\"PropertiesAccessCorrectField.vb\").AddReferences(AdditionalReferences).WithOptions(LanguageOptions.FromVisualBasic14).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/PropertiesShouldBePreferredTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class PropertiesShouldBePreferredTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<PropertiesShouldBePreferred>();\n\n        [TestMethod]\n        public void PropertiesShouldBePreferred() =>\n            builder.AddPaths(\"PropertiesShouldBePreferred.cs\").AddReferences(MetadataReferenceFacade.SystemThreadingTasks).Verify();\n\n        [TestMethod]\n        public void PropertiesShouldBePreferred_CSharp9() =>\n            builder.AddPaths(\"PropertiesShouldBePreferred.CSharp9.cs\").WithOptions(LanguageOptions.FromCSharp9).Verify();\n\n        [TestMethod]\n        public void PropertiesShouldBePreferred_CSharp10() =>\n            builder.AddPaths(\"PropertiesShouldBePreferred.CSharp10.cs\").WithOptions(LanguageOptions.FromCSharp10).Verify();\n\n        [TestMethod]\n        public void PropertiesShouldBePreferred_CSharp11() =>\n            builder.AddPaths(\"PropertiesShouldBePreferred.CSharp11.cs\").WithOptions(LanguageOptions.FromCSharp11).Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/PropertyGetterWithThrowTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class PropertyGetterWithThrowTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.PropertyGetterWithThrow>();\n\n    [TestMethod]\n    public void PropertyGetterWithThrow_CS() =>\n        builderCS.AddPaths(\"PropertyGetterWithThrow.cs\").Verify();\n\n    [TestMethod]\n    public void PropertyGetterWithThrow_VB() =>\n        new VerifierBuilder<VB.PropertyGetterWithThrow>().AddPaths(\"PropertyGetterWithThrow.vb\").Verify();\n\n    [TestMethod]\n    public void PropertyGetterWithThrow_CS_Latest() =>\n        builderCS.AddPaths(\"PropertyGetterWithThrow.Latest.cs\", \"PropertyGetterWithThrow.Latest.Partial.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/PropertyNameTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class PropertyNameTest\n    {\n        [TestMethod]\n        public void PropertyName() =>\n            new VerifierBuilder<PropertyName>().AddPaths(\"PropertyName.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/PropertyNamesShouldNotMatchGetMethodsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class PropertyNamesShouldNotMatchGetMethodsTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<PropertyNamesShouldNotMatchGetMethods>();\n\n    [TestMethod]\n    public void PropertyNamesShouldNotMatchGetMethods() =>\n        builder.AddPaths(\"PropertyNamesShouldNotMatchGetMethods.cs\").Verify();\n\n    [TestMethod]\n    public void PropertyNamesShouldNotMatchGetMethods_InvalidCode() =>\n        builder.AddSnippet(\"\"\"\n            public class Sample\n            {\n                // Missing identifier on purpose\n                public int { get; }\n                public int () { return 42; }\n            }\n            \"\"\").VerifyNoIssuesIgnoreErrors();\n\n    [TestMethod]\n    public void PropertyNamesShouldNotMatchGetMethods_Latest() =>\n        builder\n            .AddPaths(\n                \"PropertyNamesShouldNotMatchGetMethods.Latest.cs\",\n                \"PropertyNamesShouldNotMatchGetMethods.Latest.Partial1.g.cs\",\n                \"PropertyNamesShouldNotMatchGetMethods.Latest.Partial2.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/PropertyToAutoPropertyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class PropertyToAutoPropertyTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<PropertyToAutoProperty>();\n\n    [TestMethod]\n    public void PropertyToAutoProperty() =>\n        builder.AddPaths(\"PropertyToAutoProperty.cs\").Verify();\n\n    [TestMethod]\n    public void PropertyToAutoProperty_Latest() =>\n        builder.AddPaths(\"PropertyToAutoProperty.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/PropertyWithArrayTypeTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class PropertyWithArrayTypeTest\n    {\n        [TestMethod]\n        public void PropertyWithArrayType() =>\n            new VerifierBuilder<PropertyWithArrayType>().AddPaths(\"PropertyWithArrayType.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/PropertyWriteOnlyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class PropertyWriteOnlyTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.PropertyWriteOnly>();\n\n    [TestMethod]\n    public void PropertyWriteOnly_CS() =>\n        builderCS.AddPaths(\"PropertyWriteOnly.cs\").Verify();\n\n    [TestMethod]\n    public void PropertyWriteOnly_CS_Latest() =>\n        builderCS.AddPaths(\"PropertyWriteOnly.Latest.cs\", \"PropertyWriteOnly.Latest.Partial.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void PropertyWriteOnly_VB() =>\n        new VerifierBuilder<VB.PropertyWriteOnly>().AddPaths(\"PropertyWriteOnly.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ProvideDeserializationMethodsForOptionalFieldsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ProvideDeserializationMethodsForOptionalFieldsTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.ProvideDeserializationMethodsForOptionalFields>();\n\n    [TestMethod]\n    public void ProvideDeserializationMethodsForOptionalFields_CS() =>\n        builderCS.AddPaths(\"ProvideDeserializationMethodsForOptionalFields.cs\").Verify();\n\n    [TestMethod]\n    public void ProvideDeserializationMethodsForOptionalFields_CS_Latest() =>\n        builderCS.AddPaths(\"ProvideDeserializationMethodsForOptionalFields.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void ProvideDeserializationMethodsForOptionalFields_VB() =>\n        new VerifierBuilder<VB.ProvideDeserializationMethodsForOptionalFields>().AddPaths(\"ProvideDeserializationMethodsForOptionalFields.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/PublicConstantFieldNameTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class PublicConstantFieldNameTest\n    {\n        [TestMethod]\n        public void PublicConstantFieldName() =>\n            new VerifierBuilder<PublicConstantFieldName>().AddPaths(\"PublicConstantFieldName.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/PublicConstantFieldTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class PublicConstantFieldTest\n    {\n        private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.PublicConstantField>();\n\n        [TestMethod]\n        public void PublicConstantField_CSharp() =>\n            builderCS.AddPaths(\"PublicConstantField.cs\").Verify();\n\n        [TestMethod]\n        public void PublicConstantField_CSharp9() =>\n            builderCS.AddPaths(\"PublicConstantField.CSharp9.cs\")\n                .WithOptions(LanguageOptions.FromCSharp9)\n                .Verify();\n\n        [TestMethod]\n        public void PublicConstantField_CSharp10() =>\n            builderCS.AddPaths(\"PublicConstantField.CSharp10.cs\")\n                .WithOptions(LanguageOptions.FromCSharp10)\n                .Verify();\n\n        [TestMethod]\n        public void PublicConstantField_VB() =>\n            new VerifierBuilder<VB.PublicConstantField>().AddPaths(\"PublicConstantField.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/PublicFieldNameTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class PublicFieldNameTest\n    {\n        [TestMethod]\n        public void PublicFieldName() =>\n            new VerifierBuilder<PublicFieldName>().AddPaths(\"PublicFieldName.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/PublicMethodWithMultidimensionalArrayTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class PublicMethodWithMultidimensionalArrayTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.PublicMethodWithMultidimensionalArray>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.PublicMethodWithMultidimensionalArray>();\n\n    [TestMethod]\n    public void PublicMethodWithMultidimensionalArray_CS() =>\n        builderCS.AddPaths(\"PublicMethodWithMultidimensionalArray.cs\").Verify();\n\n    [TestMethod]\n    public void PublicMethodWithMultidimensionalArray_CS_Latest() =>\n        builderCS.AddPaths(\"PublicMethodWithMultidimensionalArray.Latest.cs\", \"PublicMethodWithMultidimensionalArray.Latest.Partial.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void PublicMethodWithMultidimensionalArray_VB() =>\n        builderVB.AddPaths(\"PublicMethodWithMultidimensionalArray.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/PublicSharedReadonlyFieldNameTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class PublicSharedReadonlyFieldNameTest\n    {\n        [TestMethod]\n        public void PublicSharedReadonlyFieldName() =>\n            new VerifierBuilder<PublicSharedReadonlyFieldName>().AddPaths(\"PublicSharedReadonlyFieldName.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/PureAttributeOnVoidMethodTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class PureAttributeOnVoidMethodTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.PureAttributeOnVoidMethod>();\n\n    [TestMethod]\n    public void PureAttributeOnVoidMethod_CS() =>\n        builderCS.AddPaths(\"PureAttributeOnVoidMethod.cs\").Verify();\n\n    [TestMethod]\n    public void PureAttributeOnVoidMethod_CSharpLatest() =>\n        builderCS.AddPaths(\"PureAttributeOnVoidMethod.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void PureAttributeOnVoidMethod_TopLevelStatements() =>\n        builderCS.AddPaths(\"PureAttributeOnVoidMethod.TopLevelStatements.cs\").WithTopLevelStatements().Verify();\n\n    [TestMethod]\n    public void PureAttributeOnVoidMethod_VB() =>\n        new VerifierBuilder<VB.PureAttributeOnVoidMethod>().AddPaths(\"PureAttributeOnVoidMethod.vb\").Verify();\n\n    [TestMethod]\n    public void PureAttributeOnVoidMethod_CSharp7() =>\n        builderCS.AddPaths(\"PureAttributeOnVoidMethod.CSharp7.cs\").WithOptions(LanguageOptions.OnlyCSharp7).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/RedundancyInConstructorDestructorDeclarationTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class RedundancyInConstructorDestructorDeclarationTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<RedundancyInConstructorDestructorDeclaration>();\n        private readonly VerifierBuilder codeFixBuilderRemoveBaseCall = new VerifierBuilder<RedundancyInConstructorDestructorDeclaration>()\n            .WithCodeFix<RedundancyInConstructorDestructorDeclarationCodeFix>()\n            .WithCodeFixTitle(RedundancyInConstructorDestructorDeclarationCodeFix.TitleRemoveBaseCall);\n        private readonly VerifierBuilder codeFixBuilderRemoveConstructor = new VerifierBuilder<RedundancyInConstructorDestructorDeclaration>()\n            .WithCodeFix<RedundancyInConstructorDestructorDeclarationCodeFix>()\n            .WithCodeFixTitle(RedundancyInConstructorDestructorDeclarationCodeFix.TitleRemoveConstructor);\n\n        [TestMethod]\n        public void RedundancyInConstructorDestructorDeclaration() =>\n            builder.AddPaths(\"RedundancyInConstructorDestructorDeclaration.cs\").Verify();\n\n        [TestMethod]\n        public void RedundancyInConstructorDestructorDeclaration_CSharp9() =>\n            builder.AddPaths(\"RedundancyInConstructorDestructorDeclaration.CSharp9.cs\")\n                .WithOptions(LanguageOptions.FromCSharp9)\n                .Verify();\n\n        [TestMethod]\n        public void RedundancyInConstructorDestructorDeclaration_CSharp10() =>\n            builder.AddPaths(\"RedundancyInConstructorDestructorDeclaration.CSharp10.cs\")\n                .WithOptions(LanguageOptions.FromCSharp10)\n                .Verify();\n\n        [TestMethod]\n        public void RedundancyInConstructorDestructorDeclaration_CSharp11() =>\n            builder.AddPaths(\"RedundancyInConstructorDestructorDeclaration.CSharp11.cs\")\n                .WithOptions(LanguageOptions.FromCSharp11)\n                .Verify();\n\n        [TestMethod]\n        public void RedundancyInConstructorDestructorDeclaration_CSharp12() =>\n            builder.AddPaths(\"RedundancyInConstructorDestructorDeclaration.CSharp12.cs\")\n                .WithOptions(LanguageOptions.FromCSharp12)\n                .Verify();\n\n        [TestMethod]\n        public void RedundancyInConstructorDestructorDeclaration_CodeFix_CSharp9() =>\n            codeFixBuilderRemoveBaseCall.AddPaths(\"RedundancyInConstructorDestructorDeclaration.CSharp9.cs\")\n                .WithCodeFixedPaths(\"RedundancyInConstructorDestructorDeclaration.CSharp9.Fixed.cs\")\n                .WithOptions(LanguageOptions.FromCSharp9)\n                .VerifyCodeFix();\n\n        [TestMethod]\n        public void RedundancyInConstructorDestructorDeclaration_CodeFix_CSharp10() =>\n            codeFixBuilderRemoveConstructor.AddPaths(\"RedundancyInConstructorDestructorDeclaration.CSharp10.cs\")\n                .WithCodeFixedPaths(\"RedundancyInConstructorDestructorDeclaration.CSharp10.Fixed.cs\")\n                .WithOptions(LanguageOptions.FromCSharp10)\n                .VerifyCodeFix();\n\n        [TestMethod]\n        public void RedundancyInConstructorDestructorDeclaration_CodeFix_CSharp11() =>\n            codeFixBuilderRemoveConstructor.AddPaths(\"RedundancyInConstructorDestructorDeclaration.CSharp11.cs\")\n                .WithCodeFixedPaths(\"RedundancyInConstructorDestructorDeclaration.CSharp11.Fixed.cs\")\n                .WithOptions(LanguageOptions.FromCSharp11)\n                .VerifyCodeFix();\n\n        [TestMethod]\n        public void RedundancyInConstructorDestructorDeclaration_CodeFix_BaseCall() =>\n            codeFixBuilderRemoveBaseCall.AddPaths(\"RedundancyInConstructorDestructorDeclaration.cs\")\n                .WithCodeFixedPaths(\"RedundancyInConstructorDestructorDeclaration.BaseCall.Fixed.cs\")\n                .VerifyCodeFix();\n\n        [TestMethod]\n        public void RedundancyInConstructorDestructorDeclaration_CodeFix_Constructor() =>\n            codeFixBuilderRemoveConstructor.AddPaths(\"RedundancyInConstructorDestructorDeclaration.cs\")\n                .WithCodeFixedPaths(\"RedundancyInConstructorDestructorDeclaration.Constructor.Fixed.cs\")\n                .VerifyCodeFix();\n\n        [TestMethod]\n        public void RedundancyInConstructorDestructorDeclaration_CodeFix_Destructor() =>\n            new VerifierBuilder<RedundancyInConstructorDestructorDeclaration>()\n                .WithCodeFix<RedundancyInConstructorDestructorDeclarationCodeFix>()\n                .AddPaths(\"RedundancyInConstructorDestructorDeclaration.cs\")\n                .WithCodeFixedPaths(\"RedundancyInConstructorDestructorDeclaration.Destructor.Fixed.cs\")\n                .WithCodeFixTitle(RedundancyInConstructorDestructorDeclarationCodeFix.TitleRemoveDestructor)\n                .VerifyCodeFix();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/RedundantArgumentTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class RedundantArgumentTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<RedundantArgument>();\n    private readonly VerifierBuilder codeFixBuilder = new VerifierBuilder<RedundantArgument>().WithCodeFix<RedundantArgumentCodeFix>();\n\n    [TestMethod]\n    public void RedundantArgument() =>\n        builder.AddPaths(\"RedundantArgument.cs\").Verify();\n\n    [TestMethod]\n    public void RedundantArgument_TopLevelStatements() =>\n        builder.AddPaths(\"RedundantArgument.TopLevelStatements.cs\").WithTopLevelStatements().Verify();\n\n    [TestMethod]\n    public void RedundantArgument_Latest() =>\n        builder.AddPaths(\"RedundantArgument.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void RedundantArgument_CodeFix_No_Named_Arguments() =>\n        codeFixBuilder.AddPaths(\"RedundantArgument.cs\").WithCodeFixedPaths(\"RedundantArgument.NoNamed.Fixed.cs\").WithCodeFixTitle(RedundantArgumentCodeFix.TitleRemove).VerifyCodeFix();\n\n    [TestMethod]\n    public void RedundantArgument_CodeFix_Named_Arguments() =>\n        codeFixBuilder.AddPaths(\"RedundantArgument.cs\").WithCodeFixedPaths(\"RedundantArgument.Named.Fixed.cs\").WithCodeFixTitle(RedundantArgumentCodeFix.TitleRemoveWithNameAdditions).VerifyCodeFix();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/RedundantCastTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class RedundantCastTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<RedundantCast>();\n\n    private static IEnumerable<(string Snippet, bool CompliantWithFlowState, bool CompliantWithoutFlowState)> NullableTestData =>\n    [\n        (\"\"\"_ = (string)\"Test\";\"\"\", false, false),\n        (\"\"\"_ = (string?)\"Test\";\"\"\", true, false),\n        (\"\"\"_ = (string)null;\"\"\", true, true),\n        (\"\"\"_ = (string?)null;\"\"\", true, true),\n        (\"\"\"_ = (string)nullable;\"\"\", true, false),\n        (\"\"\"_ = (string?)nullable;\"\"\", false, false),\n        (\"\"\"_ = (string)nonNullable;\"\"\", false, false),\n        (\"\"\"_ = (string?)nonNullable;\"\"\", true, false),\n        (\"\"\"_ = nullable as string;\"\"\", true, false),\n        (\"\"\"_ = nonNullable as string;\"\"\", false, false),\n        (\"\"\"if (nullable != null) _ = (string)nullable;\"\"\", false, false),\n        (\"\"\"if (nullable != null) _ = (string?)nullable;\"\"\", true, false),\n        (\"\"\"if (nullable != null) _ = nullable as string;\"\"\", false, false),\n        (\"\"\"if (nonNullable == null) _ = (string)nonNullable;\"\"\", true, false),\n        (\"\"\"if (nonNullable == null) _ = (string?)nonNullable;\"\"\", false, false),\n        (\"\"\"if (nonNullable == null) _ = nonNullable as string;\"\"\", true, false),\n        (\"\"\"_ = (string)default!;\"\"\", true, true),\n        (\"\"\"_ = (string)(default)!;\"\"\", true, true),\n        (\"\"\"_ = (string)((default)!);\"\"\", true, true),\n        (\"\"\"_ = (string)(default!);\"\"\", true, true),\n        (\"\"\"_ = (string)(default(string));\"\"\", true, false),\n        (\"\"\"_ = (string)(default(string)!);\"\"\", false, false),\n        (\"\"\"_ = (string?)(default(string));\"\"\", false, false),\n        (\"\"\"_ = (string?)(default(string)!);\"\"\", true, false),\n    ];\n\n    private static IEnumerable<object[]> NullableTestDataWithFlowState => NullableTestData.Select(x => new object[] { x.Snippet, x.CompliantWithFlowState });\n\n    private static IEnumerable<object[]> NullableTestDataWithoutFlowState => NullableTestData.Select(x => new object[] { x.Snippet, x.CompliantWithoutFlowState });\n\n    [TestMethod]\n    public void RedundantCast() =>\n        builder.AddPaths(\"RedundantCast.cs\").Verify();\n\n    [TestMethod]\n    public void RedundantCast_Latest() =>\n        builder.AddPaths(\"RedundantCast.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void RedundantCast_CodeFix() =>\n        builder.AddPaths(\"RedundantCast.cs\").WithCodeFix<RedundantCastCodeFix>().WithCodeFixedPaths(\"RedundantCast.Fixed.cs\").VerifyCodeFix();\n\n    [TestMethod]\n    public void RedundantCast_DefaultLiteral() =>\n        builder.AddSnippet(\"\"\"\n            using System;\n            public static class MyClass\n            {\n                public static void RunAction(Action action)\n                {\n                    bool myBool = (bool)default; // FN - the cast is unneeded\n                    RunFunc(() => { action(); return default; }, (bool)default); // should not raise because of the generic the cast is mandatory\n                    RunFunc<bool>(() => { action(); return default; }, (bool)default); // FN - the cast is unneeded\n                }\n\n                 public static T RunFunc<T>(Func<T> func, T returnValue = default) => returnValue;\n            }\n            \"\"\").WithLanguageVersion(LanguageVersion.CSharp7_1).VerifyNoIssues();\n\n    [TestMethod]\n    [DataRow(\"IEnumerable<string?>\", \"IEnumerable<string>\", false)]\n    [DataRow(\"IEnumerable<string>\", \"IEnumerable<string?>\", false)]\n    [DataRow(\"IEnumerable<string?>\", \"IEnumerable<string?>\", true)]\n    [DataRow(\"IEnumerable<int>\", \"IEnumerable<int?>\", false)]\n    [DataRow(\"IEnumerable<Nullable<int>>\", \"IEnumerable<int?>\", true)]\n    [DataRow(\"IEnumerable<int?>\", \"IEnumerable<Nullable<int>>\", true)]\n    [DataRow(\"IEnumerable<Nullable<int>>\", \"IEnumerable<Nullable<int>>\", true)]\n    [DataRow(\"IDictionary<string, KeyValuePair<string, string?>>\", \"IDictionary<string, KeyValuePair<string, string>>\", false)]\n    [DataRow(\"IDictionary<string, KeyValuePair<string?, string>>?\", \"IDictionary<string, KeyValuePair<string, string>>?\", false)]\n    [DataRow(\"IDictionary<string, KeyValuePair<string?, string?>>?\", \"IDictionary<string, KeyValuePair<string?, string?>>?\", true)]\n    [DataRow(\"int?\", \"Nullable<int>\", true)]\n    [DataRow(\"Nullable<int>\", \"int?\", true)]\n    [DataRow(\"IEnumerable<IEnumerable<int>?>\", \"IEnumerable<IEnumerable<int>?>\", true)]\n    [DataRow(\"IEnumerable<IEnumerable<int>?>\", \"IEnumerable<IEnumerable<int>>\", false)]\n    [DataRow(\"IEnumerable<IEnumerable<int>>\", \"IEnumerable<IEnumerable<int>?>\", false)]\n    [DataRow(\"IEnumerable<T?>\", \"IEnumerable<T>\", false)]\n    [DataRow(\"IEnumerable<T>\", \"IEnumerable<T?>\", false)]\n    [DataRow(\"IEnumerable<TClass?>\", \"IEnumerable<TClass>\", false)]\n    [DataRow(\"IEnumerable<TClass>\", \"IEnumerable<TClass?>\", false)]\n    [DataRow(\"IEnumerable<TStruct>\", \"IEnumerable<TStruct?>\", false)]\n    [DataRow(\"IEnumerable<Nullable<TStruct>>\", \"IEnumerable<TStruct?>\", true)]\n    [DataRow(\"IEnumerable<TStruct?>\", \"IEnumerable<Nullable<TStruct>>\", true)]\n    [DataRow(\"IEnumerable<string>\", \"IEnumerable<object>\", false)]\n    [DataRow(\"IEnumerable<object>\", \"IEnumerable<string>\", false)]\n    [DataRow(\"List<int>\", \"IntList\", true)]\n    [DataRow(\"IntList\", \"List<int>\", true)]\n    [DataRow(\"List<string>\", \"StringList\", true)]\n    [DataRow(\"StringList\", \"List<string>\", true)]\n    [DataRow(\"List<string?>\", \"StringList\", false)]\n    [DataRow(\"StringList\", \"List<string?>\", false)]\n    [DataRow(\"List<string?>\", \"NullableStringList\", true)]\n    [DataRow(\"NullableStringList\", \"List<string?>\", true)]\n    [DataRow(\"List<string>\", \"NullableStringList\", false)]\n    [DataRow(\"NullableStringList\", \"List<string>\", false)]\n    [DataRow(\"string?\", \"string?\", true)]\n    [DataRow(\"string\", \"string\", true)]\n    [DataRow(\"string?\", \"string\", false)]\n    [DataRow(\"string\", \"string?\", false)]\n    public void RedundantCast_TypeArgumentAnnotations(string expressionType, string targetType, bool expected)\n    {\n        var verifier = builder.AddSnippet($$\"\"\"\n            #nullable enable\n\n            using System;\n            using System.Collections.Generic;\n            using System.Linq;\n            using IntList = System.Collections.Generic.List<int>;\n            using StringList = System.Collections.Generic.List<string>;\n            using NullableStringList = System.Collections.Generic.List<string?>;\n\n            class TypeArguments<T, TStruct, TClass>\n                where TStruct : struct\n                where TClass : class\n            {\n                public void Test({{expressionType}} expression)\n                {\n                    _ = ({{targetType}})expression; // {{(expected ? \"Noncompliant\" : string.Empty)}}\n                }\n            }\n            \"\"\").WithLanguageVersion(LanguageVersion.CSharp9);\n        if (expected)\n        {\n            verifier.Verify();\n        }\n        else\n        {\n            verifier.VerifyNoIssues();\n        }\n    }\n\n    [TestMethod]\n    [DynamicData(nameof(NullableTestDataWithFlowState))]\n    public void RedundantCast_NullableEnabled(string snippet, bool compliant) =>\n        VerifyNullableTests(snippet, \"enable\", compliant);\n\n    [TestMethod]\n    [DynamicData(nameof(NullableTestDataWithFlowState))]\n    public void RedundantCast_NullableWarnings(string snippet, bool compliant) =>\n        VerifyNullableTests(snippet, \"enable warnings\", compliant);\n\n    [TestMethod]\n    [DynamicData(nameof(NullableTestDataWithoutFlowState))]\n    public void RedundantCast_NullableDisabled(string snippet, bool compliant) =>\n        VerifyNullableTests(snippet, \"disable\", compliant);\n\n    [TestMethod]\n    [DynamicData(nameof(NullableTestDataWithoutFlowState))]\n    public void RedundantCast_NullableAnnotations(string snippet, bool compliant) =>\n        VerifyNullableTests(snippet, \"enable annotations\", compliant);\n\n    private void VerifyNullableTests(string snippet, string nullableContext, bool compliant)\n    {\n        var code = $$\"\"\"\n            #nullable {{nullableContext}}\n            void Test(string nonNullable, string? nullable)\n            {\n                {{snippet}} // {{compliant switch { true => \"Compliant\", false => \"Noncompliant\" }}}\n            }\n            \"\"\";\n        var snippetVerifier = builder.AddSnippet(code).WithTopLevelStatements();\n        if (compliant)\n        {\n            snippetVerifier.VerifyNoIssues();\n        }\n        else\n        {\n            snippetVerifier.Verify();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/RedundantConditionalAroundAssignmentTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class RedundantConditionalAroundAssignmentTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<RedundantConditionalAroundAssignment>();\n    private readonly VerifierBuilder codeFixBuilder = new VerifierBuilder<RedundantConditionalAroundAssignment>().WithCodeFix<RedundantConditionalAroundAssignmentCodeFix>();\n\n    [TestMethod]\n    public void RedundantConditionalAroundAssignment() =>\n        builder.AddPaths(\"RedundantConditionalAroundAssignment.cs\").Verify();\n\n    [TestMethod]\n    public void RedundantConditionalAroundAssignment_CodeFix() =>\n        codeFixBuilder.AddPaths(\"RedundantConditionalAroundAssignment.cs\")\n            .WithCodeFixedPaths(\"RedundantConditionalAroundAssignment.Fixed.cs\")\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void RedundantConditionalAroundAssignment_Latest() =>\n         builder.AddPaths(\"RedundantConditionalAroundAssignment.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void RedundantConditionalAroundAssignment_Latest_CodeFix() =>\n        codeFixBuilder.AddPaths(\"RedundantConditionalAroundAssignment.Latest.cs\")\n            .WithCodeFixedPaths(\"RedundantConditionalAroundAssignment.Latest.Fixed.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .VerifyCodeFix();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/RedundantDeclarationTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class RedundantDeclarationTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<RedundantDeclaration>();\n    private readonly VerifierBuilder codeFixBuilder = new VerifierBuilder<RedundantDeclaration>().WithCodeFix<RedundantDeclarationCodeFix>();\n\n    [TestMethod]\n    public void RedundantDeclaration() =>\n        builder.AddPaths(\"RedundantDeclaration.cs\")\n            .WithOptions(LanguageOptions.BeforeCSharp10)\n            .Verify();\n\n    [TestMethod]\n    public void RedundantDeclaration_UnusedLambdaParameters_BeforeCSharp9() =>\n        builder.AddSnippet(@\"using System; public class C { public void M() { Action<int, int> a = (p1, p2) => { }; /* Compliant - Lambda discard parameters have been introduced in C# 9 */ } }\")\n            .WithOptions(LanguageOptions.BeforeCSharp9)\n            .VerifyNoIssues();\n\n    [TestMethod]\n    public void RedundantDeclaration_CSharp9() =>\n        builder.AddPaths(\"RedundantDeclaration.CSharp9.cs\")\n            .WithTopLevelStatements()\n            .WithLanguageVersion(Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp9)\n            .Verify();\n\n    [TestMethod]\n    public void RedundantDeclaration_CSharp9_CodeFix_TitleRedundantParameterName() =>\n        codeFixBuilder.AddPaths(\"RedundantDeclaration.CSharp9.cs\")\n            .WithCodeFixedPaths(\"RedundantDeclaration.CSharp9.Fixed.cs\")\n            .WithCodeFixTitle(RedundantDeclarationCodeFix.TitleRedundantParameterName)\n            .WithLanguageVersion(Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp9)\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void RedundantDeclaration_CSharp10() =>\n        builder.AddPaths(\"RedundantDeclaration.CSharp10.cs\")\n            .WithOptions(LanguageOptions.FromCSharp10)\n            .Verify();\n\n    [TestMethod]\n    public void RedundantDeclaration_CSharp10_CodeFix_ExplicitDelegate() =>\n        codeFixBuilder.AddPaths(\"RedundantDeclaration.CSharp10.cs\")\n            .WithCodeFixedPaths(\"RedundantDeclaration.CSharp10.Fixed.cs\")\n            .WithCodeFixTitle(RedundantDeclarationCodeFix.TitleRedundantExplicitDelegate)\n            .WithOptions(LanguageOptions.FromCSharp10)\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void RedundantDeclaration_CSharp12() =>\n        builder.AddPaths(\"RedundantDeclaration.CSharp12.cs\")\n            .WithOptions(LanguageOptions.FromCSharp12)\n            .Verify();\n\n    [TestMethod]\n    public void RedundantDeclaration_CSharp12_CodeFix_ArraySize() =>\n        codeFixBuilder.AddPaths(\"RedundantDeclaration.CSharp12.cs\")\n            .WithCodeFix<RedundantDeclarationCodeFix>()\n            .WithCodeFixTitle(RedundantDeclarationCodeFix.TitleRedundantArraySize)\n            .WithCodeFixedPaths(\"RedundantDeclaration.CSharp12.ArraySize.Fixed.cs\")\n            .WithOptions(LanguageOptions.FromCSharp12)\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void RedundantDeclaration_CSharp12_CodeFix_LambdaParameterType() =>\n        codeFixBuilder.AddPaths(\"RedundantDeclaration.CSharp12.cs\")\n            .WithCodeFix<RedundantDeclarationCodeFix>()\n            .WithCodeFixTitle(RedundantDeclarationCodeFix.TitleRedundantLambdaParameterType)\n            .WithCodeFixedPaths(\"RedundantDeclaration.CSharp12.LambdaParameterType.Fixed.cs\")\n            .WithOptions(LanguageOptions.FromCSharp12)\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void RedundantDeclaration_CodeFix_ArraySize() =>\n        codeFixBuilder.AddPaths(\"RedundantDeclaration.cs\")\n            .WithCodeFixedPaths(\"RedundantDeclaration.ArraySize.Fixed.cs\")\n            .WithCodeFixTitle(RedundantDeclarationCodeFix.TitleRedundantArraySize)\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void RedundantDeclaration_CodeFix_ArrayType() =>\n        codeFixBuilder.AddPaths(\"RedundantDeclaration.cs\")\n            .WithCodeFixedPaths(\"RedundantDeclaration.ArrayType.Fixed.cs\")\n            .WithCodeFixTitle(RedundantDeclarationCodeFix.TitleRedundantArrayType)\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void RedundantDeclaration_CodeFix_DelegateParameterList() =>\n        codeFixBuilder.AddPaths(\"RedundantDeclaration.cs\")\n            .WithCodeFixedPaths(\"RedundantDeclaration.DelegateParameterList.Fixed.cs\")\n            .WithCodeFixTitle(RedundantDeclarationCodeFix.TitleRedundantDelegateParameterList)\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void RedundantDeclaration_CodeFix_ExplicitDelegate() =>\n        codeFixBuilder.AddPaths(\"RedundantDeclaration.cs\")\n            .WithCodeFixedPaths(\"RedundantDeclaration.ExplicitDelegate.Fixed.cs\")\n            .WithCodeFixTitle(RedundantDeclarationCodeFix.TitleRedundantExplicitDelegate)\n            .WithOptions(LanguageOptions.BeforeCSharp10)\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void RedundantDeclaration_CodeFix_ExplicitNullable() =>\n        codeFixBuilder.AddPaths(\"RedundantDeclaration.cs\")\n            .WithCodeFixedPaths(\"RedundantDeclaration.ExplicitNullable.Fixed.cs\")\n            .WithCodeFixTitle(RedundantDeclarationCodeFix.TitleRedundantExplicitNullable)\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void RedundantDeclaration_CodeFix_LambdaParameterType() =>\n        codeFixBuilder.AddPaths(\"RedundantDeclaration.cs\")\n            .WithCodeFixedPaths(\"RedundantDeclaration.LambdaParameterType.Fixed.cs\")\n            .WithCodeFixTitle(RedundantDeclarationCodeFix.TitleRedundantLambdaParameterType)\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void RedundantDeclaration_CodeFix_ObjectInitializer() =>\n        codeFixBuilder.AddPaths(\"RedundantDeclaration.cs\")\n            .WithCodeFixedPaths(\"RedundantDeclaration.ObjectInitializer.Fixed.cs\")\n            .WithCodeFixTitle(RedundantDeclarationCodeFix.TitleRedundantObjectInitializer)\n            .VerifyCodeFix();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/RedundantExitSelectTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class RedundantExitSelectTest\n    {\n        [TestMethod]\n        public void RedundantExitSelect() =>\n            new VerifierBuilder<RedundantExitSelect>().AddPaths(\"RedundantExitSelect.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/RedundantInheritanceListTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class RedundantInheritanceListTest\n    {\n        private readonly VerifierBuilder rule = new VerifierBuilder<RedundantInheritanceList>();\n        private readonly VerifierBuilder codeFix = new VerifierBuilder<RedundantInheritanceList>().WithCodeFix<RedundantInheritanceListCodeFix>();\n\n        [TestMethod]\n        public void RedundantInheritanceList() =>\n            rule.AddPaths(\"RedundantInheritanceList.cs\").Verify();\n\n        [TestMethod]\n        public void RedundantInheritanceList_CSharp9() =>\n            rule.AddPaths(\"RedundantInheritanceList.CSharp9.cs\").WithOptions(LanguageOptions.FromCSharp9).Verify();\n\n        [TestMethod]\n        public void RedundantInheritanceList_CSharp9_CodeFix() =>\n            codeFix.AddPaths(\"RedundantInheritanceList.CSharp9.cs\")\n                .WithCodeFixedPaths(\"RedundantInheritanceList.CSharp9.Fixed.cs\")\n                .WithOptions(LanguageOptions.FromCSharp9)\n                .VerifyCodeFix();\n\n        [TestMethod]\n        public void RedundantInheritanceList_CSharp10() =>\n            rule.AddPaths(\"RedundantInheritanceList.CSharp10.cs\").WithOptions(LanguageOptions.FromCSharp10).Verify();\n\n        [TestMethod]\n        public void RedundantInheritanceList_CSharp10_CodeFix() =>\n            codeFix.AddPaths(\"RedundantInheritanceList.CSharp10.cs\")\n                .WithCodeFixedPaths(\"RedundantInheritanceList.CSharp10.Fixed.cs\")\n                .WithOptions(LanguageOptions.FromCSharp10)\n                .VerifyCodeFix();\n\n        [TestMethod]\n        public void RedundantInheritanceList_CodeFix() =>\n            codeFix.AddPaths(\"RedundantInheritanceList.cs\")\n                .WithCodeFixedPaths(\"RedundantInheritanceList.Fixed.cs\")\n                .VerifyCodeFix();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/RedundantJumpStatementTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class RedundantJumpStatementTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<RedundantJumpStatement>();\n\n    [TestMethod]\n    public void RedundantJumpStatement() =>\n        builder.AddPaths(\"RedundantJumpStatement.cs\")\n            .Verify();\n\n    [TestMethod]\n    public void RedundantJumpStatement_Latest() =>\n        builder.AddPaths(\"RedundantJumpStatement.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void RedundantJumpStatement_TopLevelStatements() =>\n        builder.AddPaths(\"RedundantJumpStatement.TopLevelStatements.cs\")\n            .WithTopLevelStatements()\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/RedundantModifierTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class RedundantModifierTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<RedundantModifier>();\n\n        [TestMethod]\n        public void RedundantModifier() =>\n            builder.AddPaths(\"RedundantModifier.cs\").Verify();\n\n        [TestMethod]\n        public void RedundantModifier_Unsafe_CodeFix() =>\n            builder.AddPaths(\"RedundantModifier.cs\")\n                .WithCodeFix<RedundantModifierCodeFix>()\n                .WithCodeFixedPaths(\"RedundantModifier.Fixed.Unsafe.cs\")\n                .WithCodeFixTitle(RedundantModifierCodeFix.TitleUnsafe)\n                .VerifyCodeFix();\n\n        [TestMethod]\n        public void RedundantModifier_Checked_CodeFix() =>\n            builder.AddPaths(\"RedundantModifier.cs\")\n                .WithCodeFix<RedundantModifierCodeFix>()\n                .WithCodeFixedPaths(\"RedundantModifier.Fixed.Checked.cs\")\n                .WithCodeFixTitle(RedundantModifierCodeFix.TitleChecked)\n                .VerifyCodeFix();\n\n        [TestMethod]\n        public void RedundantModifier_Partial_CodeFix() =>\n            builder.AddPaths(\"RedundantModifier.cs\")\n                .WithCodeFix<RedundantModifierCodeFix>()\n                .WithCodeFixedPaths(\"RedundantModifier.Fixed.Partial.cs\")\n                .WithCodeFixTitle(RedundantModifierCodeFix.TitlePartial)\n                .VerifyCodeFix();\n\n        [TestMethod]\n        public void RedundantModifier_Sealed_CodeFix() =>\n            builder.AddPaths(\"RedundantModifier.cs\")\n                .WithCodeFix<RedundantModifierCodeFix>()\n                .WithCodeFixedPaths(\"RedundantModifier.Fixed.Sealed.cs\")\n                .WithCodeFixTitle(RedundantModifierCodeFix.TitleSealed)\n                .VerifyCodeFix();\n\n#if NETFRAMEWORK\n        [TestMethod]\n        public void RedundantModifier_Preprocessor()\n        {\n            var options = new CSharpParseOptions();\n            builder.AddPaths(\"RedundantModifier.Preprocessor.NetFx.cs\")\n                .WithLanguageVersion(LanguageVersion.CSharp13)\n                .AddReferences(MetadataReferenceFacade.RegularExpressions)\n                .WithOptions([options.WithPreprocessorSymbols(\"NETFRAMEWORK\")])\n                .Verify();\n        }\n#endif\n\n#if NET\n        [TestMethod]\n        public void RedundantModifier_Preprocessor() =>\n            builder.AddPaths(\"RedundantModifier.Preprocessor.Net.cs\", \"RedundantModifier.Preprocessor.Net.Partial.cs\")\n                .WithLanguageVersion(LanguageVersion.CSharp13)\n                .AddReferences(MetadataReferenceFacade.RegularExpressions)\n                .VerifyNoIssues();\n\n        [TestMethod]\n        public void RedundantModifier_Latest() =>\n            builder.AddPaths(\"RedundantModifier.Latest.cs\", \"RedundantModifier.Latest.Partial.cs\")\n                .WithOptions(LanguageOptions.CSharpLatest)\n                .Verify();\n\n        [TestMethod]\n        public void RedundantModifier_Checked_CodeFix_Latest() =>\n            builder.AddPaths(\"RedundantModifier.Latest.cs\")\n                .WithCodeFix<RedundantModifierCodeFix>()\n                .WithCodeFixedPaths(\"RedundantModifier.Latest.Fixed.Checked.cs\")\n                .WithOptions(LanguageOptions.CSharpLatest)\n                .WithCodeFixTitle(RedundantModifierCodeFix.TitleChecked)\n                .VerifyCodeFix();\n\n        [TestMethod]\n        public void RedundantModifier_Partial_CodeFix_Latest() =>\n            builder.AddPaths(\"RedundantModifier.Latest.cs\")\n                .WithCodeFix<RedundantModifierCodeFix>()\n                .WithCodeFixedPaths(\"RedundantModifier.Latest.Fixed.Partial.cs\")\n                .WithOptions(LanguageOptions.CSharpLatest)\n                .WithCodeFixTitle(RedundantModifierCodeFix.TitlePartial)\n                .VerifyCodeFix();\n\n        [TestMethod]\n        public void RedundantModifier_Sealed_CodeFix_Latest() =>\n            builder.AddPaths(\"RedundantModifier.Latest.cs\")\n                .WithCodeFix<RedundantModifierCodeFix>()\n                .WithCodeFixedPaths(\"RedundantModifier.Latest.Fixed.Sealed.cs\")\n                .WithOptions(LanguageOptions.CSharpLatest)\n                .WithCodeFixTitle(RedundantModifierCodeFix.TitleSealed)\n                .VerifyCodeFix();\n\n        [TestMethod]\n        public void RedundantModifier_Unsafe_CodeFix_Latest() =>\n            builder.AddPaths(\"RedundantModifier.Latest.cs\")\n                .WithCodeFix<RedundantModifierCodeFix>()\n                .WithCodeFixedPaths(\"RedundantModifier.Latest.Fixed.Unsafe.cs\")\n                .WithOptions(LanguageOptions.CSharpLatest)\n                .WithCodeFixTitle(RedundantModifierCodeFix.TitleUnsafe)\n                .VerifyCodeFix();\n\n#endif\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/RedundantNullCheckTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class RedundantNullCheckTest\n    {\n        private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.RedundantNullCheck>();\n        private readonly VerifierBuilder codeFixbuilderCS = new VerifierBuilder<CS.RedundantNullCheck>().WithCodeFix<CS.RedundantNullCheckCodeFix>();\n\n        [TestMethod]\n        public void RedundantNullCheck_CS() =>\n            builderCS.AddPaths(\"RedundantNullCheck.cs\").Verify();\n\n        [TestMethod]\n        public void RedundantNullCheck_CS_CodeFix() =>\n            codeFixbuilderCS.AddPaths(\"RedundantNullCheck.cs\")\n                .WithCodeFixedPaths(\"RedundantNullCheck.Fixed.cs\", \"RedundantNullCheck.Fixed.Batch.cs\")\n                .VerifyCodeFix();\n\n        [TestMethod]\n        public void RedundantNullCheck_CSharp9() =>\n            builderCS.AddPaths(\"RedundantNullCheck.CSharp9.cs\")\n                .WithTopLevelStatements()\n                .Verify();\n\n        [TestMethod]\n        public void RedundantNullCheck_CSharp10() =>\n            builderCS.AddPaths(\"RedundantNullCheck.CSharp10.cs\")\n                .WithTopLevelStatements()\n                .WithOptions(LanguageOptions.FromCSharp10)\n                .Verify();\n\n        [TestMethod]\n        public void RedundantNullCheck_CSharp11() =>\n            builderCS.AddPaths(\"RedundantNullCheck.CSharp11.cs\")\n                .WithOptions(LanguageOptions.FromCSharp11)\n                .VerifyNoIssues();\n\n        [TestMethod]\n        public void RedundantNullCheck_CSharp9_CodeFix() =>\n            codeFixbuilderCS.AddPaths(\"RedundantNullCheck.CSharp9.cs\")\n                .WithCodeFixedPaths(\"RedundantNullCheck.CSharp9.Fixed.cs\")\n                .WithTopLevelStatements()\n                .VerifyCodeFix();\n\n        [TestMethod]\n        public void RedundantNullCheck_CSharp10_CodeFix() =>\n            codeFixbuilderCS.AddPaths(\"RedundantNullCheck.CSharp10.cs\")\n                .WithCodeFixedPaths(\"RedundantNullCheck.CSharp10.Fixed.cs\")\n                .WithTopLevelStatements()\n                .WithOptions(LanguageOptions.FromCSharp10)\n                .VerifyCodeFix();\n\n        [TestMethod]\n        public void RedundantNullCheck_VB() =>\n            new VerifierBuilder<VB.RedundantNullCheck>().AddPaths(\"RedundantNullCheck.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/RedundantNullableTypeComparisonTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class RedundantNullableTypeComparisonTest\n    {\n        [TestMethod]\n        public void RedundantNullableTypeComparison() =>\n            new VerifierBuilder<RedundantNullableTypeComparison>().AddPaths(\"RedundantNullableTypeComparison.cs\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/RedundantParenthesesObjectCreationTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class RedundantParenthesesObjectCreationTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<RedundantParenthesesObjectsCreation>();\n\n        [TestMethod]\n        public void RedundantParenthesesObjectCreation() =>\n            builder.AddPaths(\"RedundantParenthesesObjectCreation.cs\")\n                .Verify();\n\n        [TestMethod]\n        public void RedundantParenthesesObjectCreation_CSharp9() =>\n            builder.AddPaths(\"RedundantParenthesesObjectCreation.CSharp9.cs\")\n                .WithTopLevelStatements()\n                .WithOptions(LanguageOptions.FromCSharp9)\n                .Verify();\n\n        [TestMethod]\n        public void RedundantParenthesesObjectCreation_CSharp10() =>\n            builder.AddPaths(\"RedundantParenthesesObjectCreation.CSharp10.cs\")\n                .WithOptions(LanguageOptions.FromCSharp10)\n                .Verify();\n\n        [TestMethod]\n        public void RedundantParenthesesObjectCreation_CSharp11() =>\n            builder.AddPaths(\"RedundantParenthesesObjectCreation.CSharp11.cs\")\n                .WithOptions(LanguageOptions.FromCSharp11)\n                .Verify();\n\n        [TestMethod]\n        public void RedundantParenthesesObjectCreation_CodeFix() =>\n            builder.AddPaths(\"RedundantParenthesesObjectCreation.cs\")\n                .WithCodeFix<RedundantParenthesesCodeFix>()\n                .WithCodeFixedPaths(\"RedundantParenthesesObjectCreation.Fixed.cs\")\n                .VerifyCodeFix();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/RedundantParenthesesTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class RedundantParenthesesTest\n    {\n        [TestMethod]\n        public void RedundantParentheses_CS() =>\n            new VerifierBuilder<CS.RedundantParentheses>().AddPaths(\"RedundantParenthesesExpression.cs\").Verify();\n\n        [TestMethod]\n        public void RedundantParentheses_VB() =>\n            new VerifierBuilder<VB.RedundantParentheses>().AddPaths(\"RedundantParentheses.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/RedundantPropertyNamesInAnonymousClassTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class RedundantPropertyNamesInAnonymousClassTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<RedundantPropertyNamesInAnonymousClass>();\n\n        [TestMethod]\n        public void RedundantPropertyNamesInAnonymousClass() =>\n            builder.AddPaths(\"RedundantPropertyNamesInAnonymousClass.cs\").Verify();\n\n        [TestMethod]\n        public void RedundantPropertyNamesInAnonymousClass_Latest() =>\n            builder.AddPaths(\"RedundantPropertyNamesInAnonymousClass.Latest.cs\", \"RedundantPropertyNamesInAnonymousClass.Latest.Partial.cs\")\n                .WithOptions(LanguageOptions.CSharpLatest)\n                .Verify();\n\n        [TestMethod]\n        public void RedundantPropertyNamesInAnonymousClass_CodeFix() =>\n            builder.AddPaths(\"RedundantPropertyNamesInAnonymousClass.cs\")\n                .WithCodeFix<RedundantPropertyNamesInAnonymousClassCodeFix>()\n                .WithCodeFixedPaths(\"RedundantPropertyNamesInAnonymousClass.Fixed.cs\")\n                .VerifyCodeFix();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/RedundantToArrayCallTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class RedundantToArrayCallTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<RedundantToArrayCall>();\n        private readonly VerifierBuilder builderWithCodeFix = new VerifierBuilder<RedundantToArrayCall>().WithCodeFix<RedundantToArrayCallCodeFix>();\n\n        [TestMethod]\n        public void RedundantToArrayCall() =>\n            builder.AddPaths(\"RedundantToArrayCall.cs\").Verify();\n\n        [TestMethod]\n        public void RedundantToArrayCall_CodeFix() =>\n            builderWithCodeFix\n                .AddPaths(\"RedundantToArrayCall.cs\")\n                .WithCodeFixedPaths(\"RedundantToArrayCall.Fixed.cs\")\n                .VerifyCodeFix();\n\n        [TestMethod]\n        public void RedundantToArrayCall_CSharp11() =>\n            builder.AddPaths(\"RedundantToArrayCall.CSharp11.cs\").WithOptions(LanguageOptions.FromCSharp11).Verify();\n\n        [TestMethod]\n        public void RedundantToArrayCall_CSharp11_CodeFix() =>\n            builderWithCodeFix\n                .AddPaths(\"RedundantToArrayCall.CSharp11.cs\")\n                .WithOptions(LanguageOptions.FromCSharp11)\n                .WithCodeFixedPaths(\"RedundantToArrayCall.CSharp11.Fixed.cs\")\n                .VerifyCodeFix();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/RedundantToStringCallTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class RedundantToStringCallTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<RedundantToStringCall>();\n\n        [TestMethod]\n        public void RedundantToStringCall() =>\n            builder.AddPaths(\"RedundantToStringCall.cs\").Verify();\n\n        [TestMethod]\n        public void RedundantToStringCall_CSharp9() =>\n            builder.AddPaths(\"RedundantToStringCall.CSharp9.cs\")\n                .WithOptions(LanguageOptions.FromCSharp9)\n                .Verify();\n\n        [TestMethod]\n        public void RedundantToStringCall_CSharp10() =>\n            builder.AddPaths(\"RedundantToStringCall.CSharp10.cs\")\n                .WithOptions(LanguageOptions.FromCSharp10)\n                .Verify();\n\n        [TestMethod]\n        public void RedundantToStringCall_CSharp11() =>\n            builder.AddPaths(\"RedundantToStringCall.CSharp11.cs\")\n                .WithOptions(LanguageOptions.FromCSharp11)\n                .Verify();\n\n        [TestMethod]\n        public void RedundantToStringCall_CodeFix() =>\n            builder.AddPaths(\"RedundantToStringCall.cs\")\n                .WithCodeFix<RedundantToStringCallCodeFix>()\n                .WithCodeFixedPaths(\"RedundantToStringCall.Fixed.cs\")\n                .VerifyCodeFix();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ReferenceEqualityCheckWhenEqualsExistsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class ReferenceEqualityCheckWhenEqualsExistsTest\n    {\n        [TestMethod]\n        public void ReferenceEqualityCheckWhenEqualsExists() =>\n            new VerifierBuilder<ReferenceEqualityCheckWhenEqualsExists>()\n                .AddPaths(\"ReferenceEqualityCheckWhenEqualsExists.cs\", \"ReferenceEqualityCheckWhenEqualsExists2.cs\")\n                .WithAutogenerateConcurrentFiles(false)\n                .WithWarningsAsErrors(\"CS0253\")\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ReferenceEqualsOnValueTypeTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class ReferenceEqualsOnValueTypeTest\n    {\n        [TestMethod]\n        public void ReferenceEqualsOnValueType() =>\n            new VerifierBuilder<ReferenceEqualsOnValueType>().AddPaths(\"ReferenceEqualsOnValueType.cs\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/RegularExpressions/RegexMustHaveValidSyntaxTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class RegexMustHaveValidSyntaxTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.RegexMustHaveValidSyntax>()\n        .WithBasePath(\"RegularExpressions\")\n        .AddReferences(MetadataReferenceFacade.RegularExpressions)\n        .AddReferences(NuGetMetadataReference.SystemComponentModelAnnotations());\n\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.RegexMustHaveValidSyntax>()\n        .WithBasePath(\"RegularExpressions\")\n        .AddReferences(MetadataReferenceFacade.RegularExpressions)\n        .AddReferences(NuGetMetadataReference.SystemComponentModelAnnotations());\n\n    [TestMethod]\n    public void RegexMustHaveValidSyntax_CS() =>\n        builderCS.AddPaths(\"RegexMustHaveValidSyntax.cs\").Verify();\n\n    [TestMethod]\n    public void RegexMustHaveValidSyntax_CS_Latest() =>\n        builderCS.AddPaths(\"RegexMustHaveValidSyntax.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void RegexMustHaveValidSyntax_VB() =>\n        builderVB.AddPaths(\"RegexMustHaveValidSyntax.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/RequireAttributeUsageAttributeTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class RequireAttributeUsageAttributeTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<RequireAttributeUsageAttribute>();\n\n    [TestMethod]\n    public void RequireAttributeUsageAttribute() =>\n        builder.AddPaths(\"RequireAttributeUsageAttribute.cs\").Verify();\n\n    [TestMethod]\n    public void RequireAttributeUsageAttribute_CSharp11() =>\n        builder.AddPaths(\"RequireAttributeUsageAttribute.CSharp11.cs\")\n            .WithOptions(LanguageOptions.FromCSharp11)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ReturnEmptyCollectionInsteadOfNullTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ReturnEmptyCollectionInsteadOfNullTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<ReturnEmptyCollectionInsteadOfNull>();\n\n    [TestMethod]\n    public void ReturnEmptyCollectionInsteadOfNull() =>\n        builder.AddPaths(\"ReturnEmptyCollectionInsteadOfNull.cs\")\n            .AddReferences(MetadataReferenceFacade.SystemXml)\n            .Verify();\n\n    [TestMethod]\n    public void ReturnEmptyCollectionInsteadOfNull_Latest() =>\n        builder.AddPaths(\"ReturnEmptyCollectionInsteadOfNull.Latest.cs\")\n            .AddReferences(MetadataReferenceFacade.SystemCollections)\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void ReturnEmptyCollectionInsteadOfNull_TopLevelStatements() =>\n        builder.AddPaths(\"ReturnEmptyCollectionInsteadOfNull.TopLevelStatements.cs\")\n            .WithTopLevelStatements()\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ReturnTypeNamedPartialShouldBeEscapedTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ReturnTypeNamedPartialShouldBeEscapedTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<ReturnTypeNamedPartialShouldBeEscaped>();\n\n    [TestMethod]\n    public void ReturnTypeNamedPartialShouldBeEscaped_CSharp8_13() =>\n        builder.AddPaths(\"ReturnTypeNamedPartialShouldBeEscaped.CSharp8-13.cs\")\n            .WithOptions(LanguageOptions.Between(LanguageVersion.CSharp8, LanguageVersion.CSharp13))\n            .Verify();\n\n    [TestMethod]\n    public void ReturnTypeNamedPartialShouldBeEscaped_TopLevelStatements_CSharp9_13() =>\n        builder.AddPaths(\"ReturnTypeNamedPartialShouldBeEscaped.TopLevelStatements.CSharp9-13.cs\")\n            .WithOptions(LanguageOptions.Between(LanguageVersion.CSharp9, LanguageVersion.CSharp13))\n            .WithTopLevelStatements()\n            .Verify();\n\n    [TestMethod]\n    public void ReturnTypeNamedPartialShouldBeEscaped_TopLevelStatements_Latest() =>\n        builder.AddPaths(\"ReturnTypeNamedPartialShouldBeEscaped.TopLevelStatements.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .WithTopLevelStatements()\n            .Verify();\n\n    [TestMethod]\n    public void ReturnTypeNamedPartialShouldBeEscaped_CS_Latest() =>\n        builder.AddPaths(\"ReturnTypeNamedPartialShouldBeEscaped.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ReturnValueIgnoredTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ReturnValueIgnoredTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<ReturnValueIgnored>();\n\n    [TestMethod]\n    public void ReturnValueIgnored() =>\n        builder.AddPaths(\"ReturnValueIgnored.cs\").Verify();\n\n    [TestMethod]\n    public void ReturnValueIgnored_Latest() =>\n        builder.AddPaths(\"ReturnValueIgnored.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .AddReferences(MetadataReferenceFacade.SystemCollections)\n            .Verify();\n\n    [TestMethod]\n    public void ReturnValueIgnored_TopLevelStatements() =>\n        builder.AddPaths(\"ReturnValueIgnored.TopLevelStatements.cs\")\n            .AddReferences(MetadataReferenceFacade.SystemCollections)\n            .WithTopLevelStatements()\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ReversedOperatorsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ReversedOperatorsTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.ReversedOperators>();\n\n    [TestMethod]\n    public void ReversedOperators_CS() =>\n        builderCS.AddPaths(\"ReversedOperators.cs\").Verify();\n\n    [TestMethod]\n    public void ReversedOperators_CS_Latest() =>\n        builderCS.AddPaths(\"ReversedOperators.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void ReversedOperators_TopLevelStatements() =>\n        builderCS.AddPaths(\"ReversedOperators.TopLevelStatements.cs\")\n            .WithTopLevelStatements()\n            .Verify();\n\n    [TestMethod]\n    public void ReversedOperators_VB() =>\n        new VerifierBuilder<VB.ReversedOperators>().AddPaths(\"ReversedOperators.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/RightCurlyBraceStartsLineTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class RightCurlyBraceStartsLineTest\n    {\n        [TestMethod]\n        public void RightCurlyBraceStartsLine() =>\n            new VerifierBuilder<RightCurlyBraceStartsLine>().AddPaths(\"RightCurlyBraceStartsLine.cs\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/SecurityPInvokeMethodShouldNotBeCalledTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class SecurityPInvokeMethodShouldNotBeCalledTest\n    {\n        private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.SecurityPInvokeMethodShouldNotBeCalled>();\n\n        [TestMethod]\n        public void SecurityPInvokeMethodShouldNotBeCalled_CS() =>\n            builderCS.AddPaths(\"SecurityPInvokeMethodShouldNotBeCalled.cs\").Verify();\n\n        [TestMethod]\n        public void SecurityPInvokeMethodShouldNotBeCalled_CSharp11() =>\n            builderCS.AddPaths(\"SecurityPInvokeMethodShouldNotBeCalled.CSharp11.cs\").WithOptions(LanguageOptions.FromCSharp11).Verify();\n\n        [TestMethod]\n        public void SecurityPInvokeMethodShouldNotBeCalled_CSharp12() =>\n            builderCS.AddPaths(\"SecurityPInvokeMethodShouldNotBeCalled.CSharp12.cs\").WithOptions(LanguageOptions.FromCSharp12).Verify();\n\n        [TestMethod]\n        public void SecurityPInvokeMethodShouldNotBeCalled_VB() =>\n            new VerifierBuilder<VB.SecurityPInvokeMethodShouldNotBeCalled>().AddPaths(\"SecurityPInvokeMethodShouldNotBeCalled.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/SelfAssignmentTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class SelfAssignmentTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.SelfAssignment>();\n\n    [TestMethod]\n    public void SelfAssignment_CS() =>\n        builderCS.AddPaths(\"SelfAssignment.cs\").Verify();\n\n    [TestMethod]\n    public void SelfAssignment_CS_Latest() =>\n        builderCS.AddPaths(\"SelfAssignment.Latest.cs\", \"SelfAssignment.Latest.Partial.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void SelfAssignment_CS_TopLevelStatements() =>\n        builderCS.AddPaths(\"SelfAssignment.TopLevelStatements.cs\")\n            .WithTopLevelStatements()\n            .WithOptions(LanguageOptions.FromCSharp10)\n            .Verify();\n\n    [TestMethod]\n    public void SelfAssignment_VB() =>\n        new VerifierBuilder<VB.SelfAssignment>().AddPaths(\"SelfAssignment.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/SerializationConstructorsShouldBeSecuredTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class SerializationConstructorsShouldBeSecuredTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<SerializationConstructorsShouldBeSecured>().AddReferences(MetadataReferenceFacade.SystemSecurityPermissions);\n\n    [TestMethod]\n    public void SerializationConstructorsShouldBeSecured() =>\n        builder.AddPaths(\"SerializationConstructorsShouldBeSecured.cs\").WithConcurrentAnalysis(false).Verify();\n\n    [TestMethod]\n    public void SerializationConstructorsShouldBeSecured_CSharp9() =>\n        builder.AddPaths(\"SerializationConstructorsShouldBeSecured.CSharp9.cs\").WithConcurrentAnalysis(false).WithOptions(LanguageOptions.FromCSharp9).Verify();\n\n    [TestMethod]\n    public void SerializationConstructorsShouldBeSecured_InvalidCode() =>\n        builder.AddSnippet(\"\"\"\n            [Serializable]\n                public partial class InvalidCode : ISerializable\n                {\n                    [FileIOPermissionAttribute(SecurityAction.Demand, Unrestricted = true)]\n                    [ZoneIdentityPermission(SecurityAction.Demand, Unrestricted = true)]\n                    public InvalidCode() { }\n\n                    protected (SerializationInfo info, StreamingContext context) { }\n\n                    public void GetObjectData(SerializationInfo info, StreamingContext context) { }\n                }\n            \"\"\").VerifyNoIssuesIgnoreErrors();\n\n    [TestMethod]\n    public void SerializationConstructorsShouldBeSecured_NoAssemblyAttribute() =>\n        builder.AddPaths(\"SerializationConstructorsShouldBeSecured_NoAssemblyAttribute.cs\").VerifyNoIssues();\n\n    [TestMethod]\n    public void SerializationConstructorsShouldBeSecured_PartialClasses() =>\n        builder.AddPaths(\"SerializationConstructorsShouldBeSecured_Part1.cs\", \"SerializationConstructorsShouldBeSecured_Part2.cs\").WithConcurrentAnalysis(false).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/SetLocaleForDataTypesTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class SetLocaleForDataTypesTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<SetLocaleForDataTypes>().AddReferences(MetadataReferenceFacade.SystemData);\n\n        [TestMethod]\n        public void SetLocaleForDataTypes() =>\n            builder.AddPaths(\"SetLocaleForDataTypes.cs\")\n                .Verify();\n\n        [TestMethod]\n        public void SetLocaleForDataTypes_CSharp9() =>\n            builder.AddPaths(\"SetLocaleForDataTypes.CSharp9.cs\")\n                .WithTopLevelStatements()\n                .WithOptions(LanguageOptions.FromCSharp9)\n                .Verify();\n\n        [TestMethod]\n        public void SetLocaleForDataTypes_CSharp10() =>\n            builder.AddPaths(\"SetLocaleForDataTypes.CSharp10.cs\")\n                .WithTopLevelStatements()\n                .WithOptions(LanguageOptions.FromCSharp10)\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/SetPropertiesInsteadOfMethodsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class SetPropertiesInsteadOfMethodsTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.SetPropertiesInsteadOfMethods>();\n\n    [TestMethod]\n    public void SetPropertiesInsteadOfMethods_CS() =>\n        builderCS.AddPaths(\"SetPropertiesInsteadOfMethods.cs\").Verify();\n\n    [TestMethod]\n    public void SetPropertiesInsteadOfMethods_CS_Latest() =>\n        builderCS.AddPaths(\"SetPropertiesInsteadOfMethods.Latest.cs\")\n            .WithTopLevelStatements()\n            .AddReferences(MetadataReferenceFacade.SystemCollections)\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void SetPropertiesInsteadOfMethods_VB() =>\n        new VerifierBuilder<VB.SetPropertiesInsteadOfMethods>().AddPaths(\"SetPropertiesInsteadOfMethods.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ShiftDynamicNotIntegerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class ShiftDynamicNotIntegerTest\n    {\n        private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.ShiftDynamicNotInteger>();\n\n        [TestMethod]\n        public void ShiftDynamicNotInteger_CS() =>\n            builderCS.AddPaths(\"ShiftDynamicNotInteger.cs\").Verify();\n\n        [TestMethod]\n        public void ShiftDynamicNotInteger_CSharp9() =>\n            builderCS.AddPaths(\"ShiftDynamicNotInteger.CSharp9.cs\")\n                .WithTopLevelStatements()\n                .Verify();\n\n        [TestMethod]\n        public void ShiftDynamicNotInteger_CSharp11() =>\n            builderCS.AddPaths(\"ShiftDynamicNotInteger.CSharp11.cs\")\n                .WithOptions(LanguageOptions.FromCSharp11)\n                .Verify();\n\n        [TestMethod]\n        public void ShiftDynamicNotInteger_VB() =>\n            new VerifierBuilder<VB.ShiftDynamicNotInteger>().AddPaths(\"ShiftDynamicNotInteger.vb\", \"ShiftDynamicNotInteger2.vb\").WithAutogenerateConcurrentFiles(false).Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ShouldImplementExportedInterfacesTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class ShouldImplementExportedInterfacesTest\n    {\n        private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.ShouldImplementExportedInterfaces>().AddReferences(MetadataReferenceFacade.SystemComponentModelComposition);\n\n        [TestMethod]\n        public void ShouldImplementExportedInterfaces_CS() =>\n            builderCS.AddPaths(\"ShouldImplementExportedInterfaces.cs\").Verify();\n\n        [TestMethod]\n        public void ShouldImplementExportedInterfaces_SystemComposition_CS() =>\n            builderCS.AddPaths(\"ShouldImplementExportedInterfaces.System.Composition.cs\").AddReferences(MetadataReferenceFacade.SystemCompositionAttributedModel).Verify();\n\n        [TestMethod]\n        public void ShouldImplementExportedInterfaces_Partial() =>\n            builderCS.AddPaths(\"ShouldImplementExportedInterfaces_Part1.cs\", \"ShouldImplementExportedInterfaces_Part2.cs\").Verify();\n\n        [TestMethod]\n        public void ShouldImplementExportedInterfaces_CSharp9() =>\n            builderCS.AddPaths(\"ShouldImplementExportedInterfaces.CSharp9.cs\").WithOptions(LanguageOptions.FromCSharp9).Verify();\n\n        [TestMethod]\n        public void ShouldImplementExportedInterfaces_VB() =>\n            new VerifierBuilder<VB.ShouldImplementExportedInterfaces>()\n                .AddReferences(MetadataReferenceFacade.SystemComponentModelComposition)\n                .AddPaths(\"ShouldImplementExportedInterfaces.vb\")\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/SimpleDoLoopTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class SimpleDoLoopTest\n    {\n        [TestMethod]\n        public void SimpleDoLoop() =>\n            new VerifierBuilder<SimpleDoLoop>().AddPaths(\"SimpleDoLoop.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/SingleStatementPerLineTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class SingleStatementPerLineTest\n    {\n        public TestContext TestContext { get; set; }\n\n        private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.SingleStatementPerLine>();\n\n        [TestMethod]\n        public void SingleStatementPerLine_CS() =>\n            builderCS.AddPaths(\"SingleStatementPerLine.cs\").Verify();\n\n        [TestMethod]\n        public void SingleStatementPerLine_CSharp9() =>\n            builderCS.AddPaths(\"SingleStatementPerLine.CSharp9.cs\")\n                .WithTopLevelStatements()\n                .Verify();\n\n        [TestMethod]\n        public void SingleStatementPerLine_Razor() =>\n            builderCS.AddSnippet(\n\"\"\"\n@if (true) { @currentCount } <!-- FN -->\n@if (true) { <p>Test</p> } <!-- FN -->\n\n@code\n{\n    private int currentCount = 0;\n    void DoSomething(bool flag) { if (flag) Console.WriteLine(\"Test\"); } // Noncompliant\n}\n\"\"\",\n\"SomeRazorFile.razor\")\n                .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Product))\n                .Verify();\n\n        [TestMethod]\n        public void SingleStatementPerLine_VB() =>\n            new VerifierBuilder<VB.SingleStatementPerLine>().AddPaths(\"SingleStatementPerLine.vb\", \"SingleStatementPerLine2.vb\").WithAutogenerateConcurrentFiles(false).Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/SpecifyIFormatProviderOrCultureInfoTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class SpecifyIFormatProviderOrCultureInfoTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<SpecifyIFormatProviderOrCultureInfo>();\n\n    [TestMethod]\n    public void SpecifyIFormatProviderOrCultureInfo() =>\n        builder.AddPaths(\"SpecifyIFormatProviderOrCultureInfo.cs\").Verify();\n\n    [TestMethod]\n    public void SpecifyIFormatProviderOrCultureInfo_BeforeCSharp13() =>\n        builder.AddSnippet(\"\"\"\n            using System;\n\n            class C\n            {\n                void M()\n                {\n                    string.Format(\"bla\");                                      // Noncompliant\n                    string.Format(\"%s %s\", \"foo\", \"bar\", \"quix\", \"hi\", \"bye\"); // Noncompliant\n                }\n            }\n            \"\"\")\n            .WithOptions(LanguageOptions.BeforeCSharp13)\n            .Verify();\n\n#if NET\n    [TestMethod]\n    public void SpecifyIFormatProviderOrCultureInfo_CS_Latest() =>\n        builder\n            .AddPaths(\"SpecifyIFormatProviderOrCultureInfo.Latest.cs\")\n            .AddReferences(MetadataReferenceFacade.SystemNetPrimitives)\n            .Verify();\n\n    // Repro https://sonarsource.atlassian.net/browse/NET-230\n    [TestMethod]\n    public void SpecifyIFormatProviderOrCultureInfo_FromCSharp13() =>\n        builder.AddSnippet(\"\"\"\n            using System;\n\n            string.Format(\"bla\");                                      // FN\n            string.Format(\"%s %s\", \"foo\", \"bar\", \"quix\", \"hi\", \"bye\"); // FN\n            \"\"\")\n            .WithOptions(LanguageOptions.FromCSharp13)\n            .WithTopLevelStatements()\n            .VerifyNoIssues();\n#endif\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/SpecifyStringComparisonTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class SpecifyStringComparisonTest\n    {\n        [TestMethod]\n        public void SpecifyStringComparison() =>\n            new VerifierBuilder<SpecifyStringComparison>().AddPaths(\"SpecifyStringComparison.cs\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/SpecifyTimeoutOnRegexTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class SpecifyTimeoutOnRegexTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder()\n        .AddAnalyzer(() => new CS.SpecifyTimeoutOnRegex(AnalyzerConfiguration.AlwaysEnabled))\n        .WithBasePath(\"Hotspots\")\n        .AddReferences(MetadataReferenceFacade.RegularExpressions)\n        .AddReferences(NuGetMetadataReference.SystemComponentModelAnnotations());\n\n    private readonly VerifierBuilder builderVB = new VerifierBuilder()\n        .AddAnalyzer(() => new VB.SpecifyTimeoutOnRegex(AnalyzerConfiguration.AlwaysEnabled))\n        .WithBasePath(\"Hotspots\")\n        .AddReferences(MetadataReferenceFacade.RegularExpressions)\n        .AddReferences(NuGetMetadataReference.SystemComponentModelAnnotations());\n\n    [TestMethod]\n    public void SpecifyTimeoutOnRegex_CS() =>\n        builderCS.AddPaths(\"SpecifyTimeoutOnRegex.cs\").Verify();\n\n    [TestMethod]\n    public void SpecifyTimeoutOnRegex_CS_Latest() =>\n        builderCS.AddPaths(\"SpecifyTimeoutOnRegex.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void SpecifyTimeoutOnRegex_DefaultMatchTimeout() =>\n        builderCS.AddPaths(\"SpecifyTimeoutOnRegex.DefaultMatchTimeout.cs\").WithTopLevelStatements().Verify();\n\n    [TestMethod]\n    public void SpecifyTimeoutOnRegex_VB() =>\n        builderVB.AddPaths(\"SpecifyTimeoutOnRegex.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/SqlKeywordsDelimitedBySpaceTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class SqlKeywordsDelimitedBySpaceTest\n{\n    private static readonly VerifierBuilder Builder = new VerifierBuilder<SqlKeywordsDelimitedBySpace>()\n        .AddReferences(NuGetMetadataReference.SystemDataSqlClient());\n\n    [TestMethod]\n    public void SqlKeywordsDelimitedBySpace_Csharp8() =>\n        Builder.AddPaths(\"SqlKeywordsDelimitedBySpace.cs\")\n            .WithOptions(LanguageOptions.FromCSharp8)\n            .Verify();\n\n    [TestMethod]\n    public void SqlKeywordsDelimitedBySpace_UsingInsideNamespace() =>\n        Builder.AddPaths(\"SqlKeywordsDelimitedBySpace_InsideNamespace.cs\")\n            .WithConcurrentAnalysis(false)\n            .Verify();\n\n    [TestMethod]\n    public void SqlKeywordsDelimitedBySpace_DefaultNamespace() =>\n        Builder.AddPaths(\"SqlKeywordsDelimitedBySpace_DefaultNamespace.cs\")\n            .AddTestReference()\n            .VerifyNoIssues();\n\n    [TestMethod]\n    public void SqlKeywordsDelimitedBySpace_CSharp10_GlobalUsings() =>\n        Builder.AddPaths(\"SqlKeywordsDelimitedBySpace.CSharp10.GlobalUsing.cs\", \"SqlKeywordsDelimitedBySpace.CSharp10.GlobalUsingConsumer.cs\")\n            .WithOptions(LanguageOptions.FromCSharp10)\n            .WithConcurrentAnalysis(false)\n            .VerifyNoIssues();\n\n    [TestMethod]\n    public void SqlKeywordsDelimitedBySpace_CSharp10_FileScopesNamespace() =>\n        Builder.AddPaths(\"SqlKeywordsDelimitedBySpace.CSharp10.FileScopedNamespaceDeclaration.cs\")\n            .WithOptions(LanguageOptions.FromCSharp10)\n            .WithConcurrentAnalysis(false)\n            .Verify();\n\n    [TestMethod]\n    public void SqlKeywordsDelimitedBySpace_Latest() =>\n        Builder.AddPaths(\"SqlKeywordsDelimitedBySpace.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .WithConcurrentAnalysis(false)\n            .Verify();\n\n    [DataRow(\"System.Data\")]\n    [DataRow(\"System.Data.SqlClient\")]\n    [DataRow(\"System.Data.SQLite\")]\n    [DataRow(\"System.Data.SqlServerCe\")]\n    [DataRow(\"System.Data.Entity\")]\n    [DataRow(\"System.Data.Odbc\")]\n    [DataRow(\"Dapper\")]\n    [DataRow(\"Microsoft.Data.SqlClient\")]\n    [DataRow(\"Microsoft.Data.Sqlite\")]\n    [DataRow(\"NHibernate\")]\n    [DataRow(\"PetaPoco\")]\n    [TestMethod]\n    public void SqlKeywordsDelimitedBySpace_DotnetFramework(string sqlNamespace) =>\n        Builder\n            .AddReferences(MetadataReferenceFacade.SystemData)\n            .AddReferences(NuGetMetadataReference.Dapper())\n            .AddReferences(NuGetMetadataReference.EntityFramework())\n            .AddReferences(NuGetMetadataReference.MicrosoftDataSqlClient())\n            .AddReferences(NuGetMetadataReference.MicrosoftDataSqliteCore())\n            .AddReferences(NuGetMetadataReference.MicrosoftSqlServerCompact())\n            .AddReferences(NuGetMetadataReference.NHibernate())\n            .AddReferences(NuGetMetadataReference.PetaPocoCompiled())\n            .AddReferences(NuGetMetadataReference.SystemDataOdbc())\n            .AddReferences(NuGetMetadataReference.SystemDataSQLiteCore())\n            .AddSnippet($@\"\nusing {sqlNamespace};\nnamespace TestNamespace\n{{\n    public class Test\n    {{\n        private string field = \"\"SELECT * FROM table\"\" +\n            \"\"WHERE col =\"\" + // Noncompliant\n            \"\"val\"\";\n    }}\n}}\").Verify();\n\n    [DataRow(\"System.Data.SqlClient\")]\n    [DataRow(\"System.Data.OracleClient\")]\n    [DataRow(\"Microsoft.EntityFrameworkCore\")]\n    [DataRow(\"ServiceStack.OrmLite\")]\n    [TestMethod]\n    public void SqlKeywordsDelimitedBySpace_DotnetCore(string sqlNamespace) =>\n        Builder\n            .AddReferences(MetadataReferenceFacade.SystemData)\n            .AddReferences(NuGetMetadataReference.MicrosoftEntityFrameworkCore(\"2.2.0\"))\n            .AddReferences(NuGetMetadataReference.ServiceStackOrmLite())\n            .AddReferences(NuGetMetadataReference.SystemDataOracleClient())\n            .AddSnippet($@\"\nusing {sqlNamespace};\nnamespace TestNamespace\n{{\n    public class Test\n    {{\n        private string field = \"\"SELECT * FROM table\"\" +\n            \"\"WHERE col =\"\" + // Noncompliant\n            \"\"val\"\";\n    }}\n}}\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/StaticFieldInGenericClassTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class StaticFieldInGenericClassTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<StaticFieldInGenericClass>();\n\n    [TestMethod]\n    public void StaticFieldInGenericClass() =>\n        builder.AddPaths(\"StaticFieldInGenericClass.cs\").Verify();\n\n    [TestMethod]\n    public void StaticFieldInGenericClass_Latest() =>\n        builder.AddPaths(\"StaticFieldInGenericClass.Latest.cs\", \"StaticFieldInGenericClass.Latest.Partial.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/StaticFieldInitializerOrderTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class StaticFieldInitializerOrderTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<StaticFieldInitializerOrder>();\n\n    [TestMethod]\n    public void StaticFieldInitializerOrder() =>\n        builder.AddPaths(\"StaticFieldInitializerOrder.cs\", \"StaticFieldInitializerOrder.Partial.cs\")\n            .Verify();\n\n    [TestMethod]\n    public void StaticFieldInitializerOrder_Latest() =>\n        builder.AddPaths(\"StaticFieldInitializerOrder.Latest.cs\", \"StaticFieldInitializerOrder.Latest.Partial.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/StaticFieldVisibleTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class StaticFieldVisibleTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<StaticFieldVisible>();\n\n    [TestMethod]\n    public void StaticFieldVisible() =>\n        builder.AddPaths(\"StaticFieldVisible.cs\").Verify();\n\n    [TestMethod]\n    public void StaticFieldVisible_Latest() =>\n        builder.AddPaths(\"StaticFieldVisible.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/StaticFieldWrittenFromInstanceConstructorTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class StaticFieldWrittenFromInstanceConstructorTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<StaticFieldWrittenFromInstanceConstructor>();\n\n    [TestMethod]\n    public void StaticFieldWrittenFromInstanceConstructor() =>\n        builder.AddPaths(\"StaticFieldWrittenFromInstanceConstructor.cs\").Verify();\n\n    [TestMethod]\n    public void StaticFieldWrittenFromInstanceConstructor_Latest() =>\n        builder.AddPaths(\"StaticFieldWrittenFromInstanceConstructor.Latest.cs\", \"StaticFieldWrittenFromInstanceConstructor.Latest.Partial.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/StaticFieldWrittenFromInstanceMemberTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class StaticFieldWrittenFromInstanceMemberTest\n{\n    private readonly VerifierBuilder<StaticFieldWrittenFromInstanceMember> builder = new();\n\n    [TestMethod]\n    public void StaticFieldWrittenFromInstanceMember() =>\n        builder.AddPaths(\"StaticFieldWrittenFromInstanceMember.cs\").Verify();\n\n    [TestMethod]\n    public void StaticFieldWrittenFromInstanceMember_Latest() =>\n        builder.AddPaths(\"StaticFieldWrittenFromInstanceMember.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void StaticFieldWrittenFromInstanceMember_Latest_TopLevelStatements() =>\n        builder.AddPaths(\"StaticFieldWrittenFromInstanceMember.TopLevelStatements.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .WithTopLevelStatements()\n            .VerifyNoIssues();\n\n    [TestMethod]\n    public async Task SecondaryIssueInReferencedCompilation()\n    {\n        var firstClass = \"\"\"\n            public class Foo\n            {\n                public static int Count = 0; // Secondary\n            }\n            \"\"\";\n\n        var secondClass = \"\"\"\n            public class Bar\n            {\n                public int Increment() => Foo.Count++;\n            }\n            \"\"\";\n\n        var analyzers = ImmutableArray<DiagnosticAnalyzer>.Empty.Add(new StaticFieldWrittenFromInstanceMember());\n        var firstCompilation = CreateCompilation(CSharpSyntaxTree.ParseText(firstClass), \"First\").WithAnalyzers(analyzers).Compilation;\n        var secondCompilation = CreateCompilation(CSharpSyntaxTree.ParseText(secondClass), \"Second\")\n            .AddReferences(firstCompilation.ToMetadataReference())\n            .WithAnalyzers(analyzers);\n\n        var result = await secondCompilation.GetAnalyzerDiagnosticsAsync();\n\n        firstCompilation.GetDiagnostics().Should().BeEmpty();\n        result.Should().BeEquivalentTo(new[] { new { Id = \"S2696\", AdditionalLocations = Array.Empty<Location>() } });\n        result.Single().GetMessage().Should().StartWith(\"Make the enclosing instance method 'static' or remove this set on the 'static' field.\");\n    }\n\n    private static CSharpCompilation CreateCompilation(SyntaxTree tree, string name) =>\n        CSharpCompilation\n            .Create(name, options: new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary))\n            .AddReferences(MetadataReference.CreateFromFile(typeof(string).Assembly.Location))\n            .AddSyntaxTrees(tree);\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/StaticSealedClassProtectedMembersTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class StaticSealedClassProtectedMembersTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<StaticSealedClassProtectedMembers>();\n\n        [TestMethod]\n        public void StaticSealedClassProtectedMembers() =>\n            builder.AddPaths(\"StaticSealedClassProtectedMembers.cs\").Verify();\n\n        [TestMethod]\n        public void StaticSealedClassProtectedMembers_Latest() =>\n            builder.AddPaths(\"StaticSealedClassProtectedMembers.Latest.cs\", \"StaticSealedClassProtectedMembers.Latest.Partial.cs\")\n                .WithOptions(LanguageOptions.CSharpLatest)\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/StreamReadStatementTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class StreamReadStatementTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<StreamReadStatement>();\n\n    [TestMethod]\n    public void StreamReadStatement() =>\n        builder.AddPaths(\"StreamReadStatement.cs\").Verify();\n\n    [TestMethod]\n    public void StreamReadStatement_Latest() =>\n        builder.AddPaths(\"StreamReadStatement.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/StringConcatenationInLoopTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class StringConcatenationInLoopTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.StringConcatenationInLoop>();\n\n    [TestMethod]\n    public void StringConcatenationInLoop_CS() =>\n        builderCS.AddPaths(\"StringConcatenationInLoop.cs\").Verify();\n\n    [TestMethod]\n    public void StringConcatenationInLoop_CS_Latest() =>\n        builderCS.AddPaths(\"StringConcatenationInLoop.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void StringConcatenationInLoop_VB() =>\n        new VerifierBuilder<VB.StringConcatenationInLoop>().AddPaths(\"StringConcatenationInLoop.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/StringConcatenationWithPlusTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class StringConcatenationWithPlusTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<StringConcatenationWithPlus>().AddReferences(MetadataReferenceFacade.SystemXml.Concat(MetadataReferenceFacade.SystemXmlLinq));\n\n        [TestMethod]\n        public void StringConcatenationWithPlus() =>\n            builder.AddPaths(\"StringConcatenationWithPlus.vb\").Verify();\n\n        [TestMethod]\n        public void StringConcatenationWithPlus_CodeFix() =>\n            builder.AddPaths(\"StringConcatenationWithPlus.vb\")\n                .WithCodeFix<StringConcatenationWithPlusCodeFix>()\n                .WithCodeFixedPaths(\"StringConcatenationWithPlus.Fixed.vb\")\n                .VerifyCodeFix();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/StringFormatValidatorTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class StringFormatValidatorTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<StringFormatValidator>();\n\n        [TestMethod]\n        [DataRow(ProjectType.Product)]\n        [DataRow(ProjectType.Test)]\n        public void StringFormatValidator_RuntimeExceptionFree(ProjectType projectType) =>\n            builder.AddPaths(\"StringFormatValidator.RuntimeExceptionFree.cs\")\n                .AddReferences(TestCompiler.ProjectTypeReference(projectType))\n                .Verify();\n\n        [TestMethod]\n        [DataRow(ProjectType.Product)]\n        [DataRow(ProjectType.Test)]\n        public void StringFormatValidator_TypoFree(ProjectType projectType) =>\n            builder.AddPaths(\"StringFormatValidator.TypoFree.cs\")\n                .AddReferences(TestCompiler.ProjectTypeReference(projectType))\n                .Verify();\n\n        [TestMethod]\n        public void StringFormatValidator_EdgeCases() =>\n            builder.AddPaths(\"StringFormatValidator.EdgeCases.cs\").Verify();\n\n        [TestMethod]\n        [DataRow(ProjectType.Product)]\n        [DataRow(ProjectType.Test)]\n        public void StringFormatValidator_RuntimeExceptionFree_CSharp11(ProjectType projectType) =>\n            builder.AddPaths(\"StringFormatValidator.RuntimeExceptionFree.CSharp11.cs\")\n                .AddReferences(TestCompiler.ProjectTypeReference(projectType))\n                .WithOptions(LanguageOptions.FromCSharp11)\n                .Verify();\n\n        [TestMethod]\n        [DataRow(ProjectType.Product)]\n        [DataRow(ProjectType.Test)]\n        public void StringFormatValidator_TypoFree_CSharp11(ProjectType projectType) =>\n            builder.AddPaths(\"StringFormatValidator.TypoFree.CSharp11.cs\")\n                .AddReferences(TestCompiler.ProjectTypeReference(projectType))\n                .WithOptions(LanguageOptions.FromCSharp11)\n                .Verify();\n\n        [TestMethod]\n        public void StringFormatValidator_Latest() =>\n            builder.AddPaths(\"StringFormatValidator.Latest.cs\")\n                .AddReferences(TestCompiler.ProjectTypeReference(ProjectType.Product))\n                .WithOptions(LanguageOptions.CSharpLatest)\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/StringLiteralShouldNotBeDuplicatedTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class StringLiteralShouldNotBeDuplicatedTest\n{\n#if NET\n    private static readonly ImmutableArray<MetadataReference> DapperReferences = [\n        CoreMetadataReference.SystemDataCommon,\n        CoreMetadataReference.SystemComponentModelPrimitives,\n        ..NuGetMetadataReference.Dapper(),\n        ..NuGetMetadataReference.SystemDataSqlClient()\n    ];\n#endif\n\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.StringLiteralShouldNotBeDuplicated>();\n\n    [TestMethod]\n    public void StringLiteralShouldNotBeDuplicated_CS() =>\n        builderCS\n            .AddPaths(\"StringLiteralShouldNotBeDuplicated.cs\", \"StringLiteralShouldNotBeDuplicated.Partial.cs\")\n            .AddReferences(NuGetMetadataReference.EntityFramework())\n            .Verify();\n\n#if NET\n\n    [TestMethod]\n    public void StringLiteralShouldNotBeDuplicated_CS_Latest() =>\n        builderCS.AddPaths(\"StringLiteralShouldNotBeDuplicated.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .AddReferences(NuGetMetadataReference.MicrosoftEntityFrameworkCoreRelational(\"2.2.6\"))\n            .AddReferences(NuGetMetadataReference.MicrosoftEntityFrameworkCore(\"2.2.6\"))\n            .Verify();\n\n    [TestMethod]\n    public void StringLiteralShouldNotBeDuplicated_CS_WithTopLevelStatements() =>\n        builderCS.AddPaths(\"StringLiteralShouldNotBeDuplicated.WithTopLevelStatements.cs\")\n            .WithTopLevelStatements()\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void StringLiteralShouldNotBeDuplicated_CS_Dapper() =>\n        builderCS.AddPaths(\"StringLiteralShouldNotBeDuplicated.Dapper.cs\")\n            .AddReferences(DapperReferences)\n            .VerifyNoIssues();\n\n    [TestMethod]\n    public void StringLiteralShouldNotBeDuplicated_VB_Dapper() =>\n        new VerifierBuilder<VB.StringLiteralShouldNotBeDuplicated>()\n            .AddPaths(\"StringLiteralShouldNotBeDuplicated.Dapper.vb\")\n            .AddReferences(DapperReferences)\n            .VerifyNoIssues();\n\n#endif\n\n    [TestMethod]\n    public void StringLiteralShouldNotBeDuplicated_Attributes_CS() =>\n        new VerifierBuilder().AddAnalyzer(() => new CS.StringLiteralShouldNotBeDuplicated { Threshold = 2 })\n            .AddPaths(\"StringLiteralShouldNotBeDuplicated_Attributes.cs\")\n            .WithConcurrentAnalysis(false)\n            .Verify();\n\n    [TestMethod]\n    public void StringLiteralShouldNotBeDuplicated_VB() =>\n        new VerifierBuilder<VB.StringLiteralShouldNotBeDuplicated>()\n            .AddPaths(\"StringLiteralShouldNotBeDuplicated.vb\")\n            .Verify();\n\n    [TestMethod]\n    public void StringLiteralShouldNotBeDuplicated_Attributes_VB() =>\n        new VerifierBuilder().AddAnalyzer(() => new VB.StringLiteralShouldNotBeDuplicated() { Threshold = 2 })\n            .AddPaths(\"StringLiteralShouldNotBeDuplicated_Attributes.vb\")\n            .WithConcurrentAnalysis(false)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/StringOffsetMethodsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class StringOffsetMethodsTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<StringOffsetMethods>();\n\n    [TestMethod]\n    public void StringOffsetMethods() =>\n        builder.AddPaths(\"StringOffsetMethods.cs\").Verify();\n\n    [TestMethod]\n    public void StringOffsetMethods_Latest() =>\n        builder.AddPaths(\"StringOffsetMethods.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/StringOperationWithoutCultureTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class StringOperationWithoutCultureTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<StringOperationWithoutCulture>();\n\n    [TestMethod]\n    public void StringOperationWithoutCulture() =>\n        builder.AddPaths(\"StringOperationWithoutCulture.cs\").Verify();\n\n    [TestMethod]\n    public void StringOperationWithoutCulture_CSharp10() =>\n        builder.AddPaths(\"StringOperationWithoutCulture.CSharp10.cs\")\n        .WithOptions(LanguageOptions.FromCSharp10)\n        .VerifyNoIssues();\n\n    [TestMethod]\n    public void StringOperationWithoutCulture_CSharp11() =>\n        builder.AddPaths(\"StringOperationWithoutCulture.CSharp11.cs\")\n        .WithOptions(LanguageOptions.FromCSharp11)\n        .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/StringOrIntegralTypesForIndexersTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class StringOrIntegralTypesForIndexersTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<StringOrIntegralTypesForIndexers>();\n\n        [TestMethod]\n        public void StringOrIntegralTypesForIndexers_CSharp8() =>\n            builder.AddPaths(\"StringOrIntegralTypesForIndexers.cs\")\n                .AddReferences(MetadataReferenceFacade.NetStandard21)\n                .WithOptions(LanguageOptions.FromCSharp8)\n                .Verify();\n\n        [TestMethod]\n        public void StringOrIntegralTypesForIndexers_Latest() =>\n            builder.AddPaths(\"StringOrIntegralTypesForIndexers.Latest.cs\", \"StringOrIntegralTypesForIndexers.Latest.Partial.cs\")\n                .WithOptions(LanguageOptions.CSharpLatest)\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/SuppressFinalizeUselessTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class SuppressFinalizeUselessTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<SuppressFinalizeUseless>();\n\n        [TestMethod]\n        public void SuppressFinalizeUseless() =>\n            builder.AddPaths(\"SuppressFinalizeUseless.cs\").Verify();\n\n        [TestMethod]\n        public void SuppressFinalizeUseless_CSharp9() =>\n            builder.AddPaths(\"SuppressFinalizeUseless.CSharp9.cs\")\n                .WithTopLevelStatements()\n                .Verify();\n\n        [TestMethod]\n        public void SuppressFinalizeUseless_CodeFix() =>\n            builder.AddPaths(\"SuppressFinalizeUseless.cs\")\n                .WithCodeFix<SuppressFinalizeUselessCodeFix>()\n                .WithCodeFixedPaths(\"SuppressFinalizeUseless.Fixed.cs\")\n                .VerifyCodeFix();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/SwaggerActionReturnTypeTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n#if NET\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class SwaggerActionReturnTypeTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<SwaggerActionReturnType>()\n        .WithOptions(LanguageOptions.FromCSharp11)\n        .AddReferences([\n            ..NuGetMetadataReference.SwashbuckleAspNetCoreAnnotations(),\n            ..NuGetMetadataReference.SwashbuckleAspNetCoreSwagger(),\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreHttpAbstractions,\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreHttpResults,\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcCore,\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcViewFeatures,\n            AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcAbstractions,\n        ]);\n\n    [TestMethod]\n    public void SwaggerActionReturnType_CS() =>\n        builder.AddPaths(\"SwaggerActionReturnType.cs\").Verify();\n\n    [TestMethod]\n    [DataRow(\"\"\"Ok(bar)\"\"\")]\n    [DataRow(\"\"\"Created(\"uri\", bar)\"\"\")]\n    [DataRow(\"\"\"Created(new Uri(\"uri\"), bar)\"\"\")]\n    [DataRow(\"\"\"CreatedAtAction(\"actionName\", bar)\"\"\")]\n    [DataRow(\"\"\"CreatedAtAction(\"actionName\", null, bar)\"\"\")]\n    [DataRow(\"\"\"CreatedAtAction(\"actionName\", \"controllerName\", null, bar)\"\"\")]\n    [DataRow(\"\"\"CreatedAtRoute(\"routeName\", bar)\"\"\")]\n    [DataRow(\"\"\"CreatedAtRoute(\"default(object)\", bar)\"\"\")]\n    [DataRow(\"\"\"CreatedAtRoute(\"routeName\", null, bar)\"\"\")]\n    [DataRow(\"\"\"Accepted(bar)\"\"\")]\n    [DataRow(\"\"\"Accepted(\"uri\", bar)\"\"\")]\n    [DataRow(\"\"\"Accepted(new Uri(\"uri\"), bar)\"\"\")]\n    [DataRow(\"\"\"AcceptedAtAction(\"actionName\", bar)\"\"\")]\n    [DataRow(\"\"\"AcceptedAtAction(\"actionName\", \"controllerName\", bar)\"\"\")]\n    [DataRow(\"\"\"AcceptedAtAction(\"actionName\", \"controllerName\", null, bar)\"\"\")]\n    [DataRow(\"\"\"AcceptedAtRoute(\"routeName\", null, bar)\"\"\")]\n    [DataRow(\"\"\"AcceptedAtRoute(default(object), bar)\"\"\")]\n    public void SwaggerActionReturnType_IActionResult(string invocation) =>\n        builder\n            .AddSnippet($$\"\"\"\n                using System;\n                using Microsoft.AspNetCore.Mvc;\n\n                [ApiController]\n                public class Foo : Controller\n                {\n                    [HttpGet(\"a\")]\n                    public IActionResult Method() =>    // Noncompliant\n                        {{invocation}};                 // Secondary\n\n                    private Bar bar = new();\n                }\n\n                public class Bar {}\n                \"\"\")\n            .Verify();\n\n    [TestMethod]\n    [DataRow(\"\"\"Accepted(\"uri\")\"\"\")]\n    [DataRow(\"\"\"Accepted(uri)\"\"\")]\n    public void SwaggerActionReturnType_IActionResult_Compliant(string invocation) =>\n        builder\n            .AddSnippet($$\"\"\"\n                using System;\n                using Microsoft.AspNetCore.Mvc;\n\n                [ApiController]\n                public class Foo : Controller\n                {\n                    [HttpGet(\"a\")]\n                    public IActionResult Method() =>\n                        {{invocation}};\n\n                    private Bar bar = new();\n                    private Uri uri;\n                }\n\n                public class Bar {}\n                \"\"\")\n            .VerifyNoIssues();\n\n    [TestMethod]\n    [DataRow(\"\"\"Results.Ok(bar)\"\"\")]\n    [DataRow(\"\"\"Results.Ok((object) bar)\"\"\")]\n    [DataRow(\"\"\"Results.Ok(bar)\"\"\")]\n    [DataRow(\"\"\"Results.Created(\"uri\", bar)\"\"\")]\n    [DataRow(\"\"\"Results.Created(\"uri\", (object) bar)\"\"\")]\n    [DataRow(\"\"\"Results.Created(new Uri(\"uri\"), bar)\"\"\")]\n    [DataRow(\"\"\"Results.Created(new Uri(\"uri\"), (object) bar)\"\"\")]\n    [DataRow(\"\"\"Results.CreatedAtRoute(value: (object) bar)\"\"\")]\n    [DataRow(\"\"\"Results.CreatedAtRoute(\"\", null, (object) bar)\"\"\")]\n    [DataRow(\"\"\"Results.CreatedAtRoute(value: bar)\"\"\")]\n    [DataRow(\"\"\"Results.CreatedAtRoute(\"\", null, bar)\"\"\")]\n    [DataRow(\"\"\"Results.Accepted(\"uri\", bar)\"\"\")]\n    [DataRow(\"\"\"Results.Accepted(\"uri\", (object) bar)\"\"\")]\n    [DataRow(\"\"\"Results.AcceptedAtRoute(value: (object) bar)\"\"\")]\n    [DataRow(\"\"\"Results.AcceptedAtRoute(\"\", null, (object) bar)\"\"\")]\n    [DataRow(\"\"\"Results.AcceptedAtRoute(value: bar)\"\"\")]\n    [DataRow(\"\"\"Results.AcceptedAtRoute(\"\", null, bar)\"\"\")]\n    public void SwaggerActionReturnType_IResult(string invocation) =>\n        builder\n            .AddSnippet($$\"\"\"\n                using System;\n                using Microsoft.AspNetCore.Mvc;\n                using Microsoft.AspNetCore.Http;\n\n                [ApiController]\n                public class Foo : Controller\n                {\n                    [HttpGet(\"a\")]\n                    public IResult Method() =>    // Noncompliant\n                        {{invocation}};           // Secondary\n\n                    private Bar bar = new();\n                }\n\n                public class Bar {}\n                \"\"\")\n            .Verify();\n\n    [TestMethod]\n    public void ApiConventionType_AssemblyLevel() =>\n        builder\n            .AddSnippet(\"\"\"\n                using Microsoft.AspNetCore.Mvc;\n\n                [assembly: ApiConventionType(typeof(DefaultApiConventions))]\n                namespace MyNameSpace;\n\n                [ApiController]\n                public class Foo : Controller\n                {\n                    [HttpGet(\"a\")]\n                    public IActionResult Method() => Ok(bar); // Compliant\n                    private Bar bar = new();\n                }\n\n                public class Bar {}\n                \"\"\")\n            .VerifyNoIssues();\n}\n\n#endif\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/SwitchCaseFallsThroughToDefaultTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class SwitchCaseFallsThroughToDefaultTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<SwitchCaseFallsThroughToDefault>();\n\n    [TestMethod]\n    public void SwitchCaseFallsThroughToDefault() =>\n        builder.AddPaths(\"SwitchCaseFallsThroughToDefault.cs\").Verify();\n\n    [TestMethod]\n    public void SwitchCaseFallsThroughToDefault_TopLevelStatements() =>\n        builder.AddPaths(\"SwitchCaseFallsThroughToDefault.TopLevelStatements.cs\")\n            .WithTopLevelStatements()\n            .Verify();\n\n    [TestMethod]\n    public void SwitchCaseFallsThroughToDefault_CodeFix() =>\n        builder.AddPaths(\"SwitchCaseFallsThroughToDefault.cs\")\n            .WithCodeFix<SwitchCaseFallsThroughToDefaultCodeFix>()\n            .WithCodeFixedPaths(\"SwitchCaseFallsThroughToDefault.Fixed.cs\")\n            .VerifyCodeFix();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/SwitchCasesMinimumThreeTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class SwitchCasesMinimumThreeTest\n    {\n        [TestMethod]\n        public void SwitchCasesMinimumThree_CSharp8() =>\n            new VerifierBuilder<CS.SwitchCasesMinimumThree>().AddPaths(\"SwitchCasesMinimumThree.cs\")\n                .WithOptions(LanguageOptions.FromCSharp8)\n                .Verify();\n\n        [TestMethod]\n        public void SwitchCasesMinimumThree_VB() =>\n            new VerifierBuilder<VB.SwitchCasesMinimumThree>().AddPaths(\"SwitchCasesMinimumThree.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/SwitchDefaultClauseEmptyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class SwitchDefaultClauseEmptyTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<SwitchDefaultClauseEmpty>();\n\n        [TestMethod]\n        public void SwitchDefaultClauseEmpty() =>\n            builder.AddPaths(\"SwitchDefaultClauseEmpty.cs\").Verify();\n\n        [TestMethod]\n        public void SwitchDefaultClauseEmpty_CodeFix() =>\n            builder.AddPaths(\"SwitchDefaultClauseEmpty.cs\")\n                .WithCodeFix<SwitchDefaultClauseEmptyCodeFix>()\n                .WithCodeFixedPaths(\"SwitchDefaultClauseEmpty.Fixed.cs\")\n                .VerifyCodeFix();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/SwitchSectionShouldNotHaveTooManyStatementsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class SwitchSectionShouldNotHaveTooManyStatementsTest\n    {\n        [TestMethod]\n        public void SwitchSectionShouldNotHaveTooManyStatements_DefaultValue_CS() =>\n            new VerifierBuilder<CS.SwitchSectionShouldNotHaveTooManyStatements>().AddPaths(\"SwitchSectionShouldNotHaveTooManyStatements_DefaultValue.cs\").Verify();\n\n        [TestMethod]\n        public void SwitchSectionShouldNotHaveTooManyStatements_CustomValue_CSharp8() =>\n            new VerifierBuilder().AddAnalyzer(() => new CS.SwitchSectionShouldNotHaveTooManyStatements { Threshold = 1 })\n                .AddPaths(\"SwitchSectionShouldNotHaveTooManyStatements_CustomValue.cs\")\n                .WithOptions(LanguageOptions.FromCSharp8)\n                .Verify();\n\n        [TestMethod]\n        public void SwitchSectionShouldNotHaveTooManyStatements_DefaultValue_VB() =>\n            new VerifierBuilder<VB.SwitchSectionShouldNotHaveTooManyStatements>().AddPaths(\"SwitchSectionShouldNotHaveTooManyStatements_DefaultValue.vb\").Verify();\n\n        [TestMethod]\n        public void SwitchSectionShouldNotHaveTooManyStatements_CustomValue_VB() =>\n            new VerifierBuilder().AddAnalyzer(() => new VB.SwitchSectionShouldNotHaveTooManyStatements { Threshold = 1 })\n                .AddPaths(\"SwitchSectionShouldNotHaveTooManyStatements_CustomValue.vb\")\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/SwitchShouldNotBeNestedTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class SwitchShouldNotBeNestedTest\n    {\n        [TestMethod]\n        public void SwitchShouldNotBeNested_CSharp8() =>\n            new VerifierBuilder<CS.SwitchShouldNotBeNested>().AddPaths(\"SwitchShouldNotBeNested.cs\")\n                .WithOptions(LanguageOptions.FromCSharp8)\n                .Verify();\n\n        [TestMethod]\n        public void SwitchShouldNotBeNested_VB() =>\n            new VerifierBuilder<VB.SwitchShouldNotBeNested>().AddPaths(\"SwitchShouldNotBeNested.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/SwitchWithoutDefaultTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class StringConcatenationInLoopSwitchWithoutDefaultTest\n    {\n        [TestMethod]\n        public void SwitchWithoutDefault_CS() =>\n            new VerifierBuilder<CS.SwitchWithoutDefault>().AddPaths(\"SwitchWithoutDefault.cs\").Verify();\n\n        [TestMethod]\n        public void SwitchWithoutDefault_VB() =>\n            new VerifierBuilder<VB.SwitchWithoutDefault>().AddPaths(\"SwitchWithoutDefault.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/TabCharacterTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class TabCharacterTest\n    {\n        [TestMethod]\n        public void TabCharacter_CS() =>\n            new VerifierBuilder<CS.TabCharacter>().AddPaths(\"TabCharacter.cs\").Verify();\n\n        [TestMethod]\n        public void TabCharacter_VB() =>\n            new VerifierBuilder<VB.TabCharacter>().AddPaths(\"TabCharacter.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/TaskConfigureAwaitTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class TaskConfigureAwaitTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<TaskConfigureAwait>();\n\n#if NETFRAMEWORK\n\n    [TestMethod]\n    public void TaskConfigureAwait_NetFx() =>\n        builder.AddPaths(\"TaskConfigureAwait.NetFx.cs\").Verify();\n\n#else\n\n    [TestMethod]\n    public void TaskConfigureAwait_NetCore() =>\n        builder.AddPaths(\"TaskConfigureAwait.NetCore.cs\").VerifyNoIssues();\n\n#endif\n\n    [TestMethod]\n    public void TaskConfigureAwait_ConsoleApp() =>\n        builder.AddSnippet(\"\"\"\n            using System.Threading.Tasks;\n\n            public static class EntryPoint\n            {\n                public async static Task Main() => await Task.Delay(1000); // Compliant\n            }\n            \"\"\")\n            .WithOutputKind(OutputKind.ConsoleApplication)\n            .WithOptions(LanguageOptions.FromCSharp8)\n            .VerifyNoIssues();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/TestClassShouldHaveTestMethodTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\nusing static SonarAnalyzer.TestFramework.MetadataReferences.NugetPackageVersions;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class TestClassShouldHaveTestMethodTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<TestClassShouldHaveTestMethod>();\n\n    [TestMethod]\n    [DataRow(NUnit.Ver25)]\n    [DataRow(NUnit.Ver3Latest)] // Breaking changes in NUnit 4.0 would fail the test https://github.com/SonarSource/sonar-dotnet/issues/8409\n    public void TestClassShouldHaveTestMethod_NUnit(string testFwkVersion) =>\n        builder\n            .AddPaths(\"TestClassShouldHaveTestMethod.NUnit.cs\")\n            .AddReferences(NuGetMetadataReference.NUnit(testFwkVersion))\n            .Verify();\n\n    [TestMethod]\n    public void TestClassShouldHaveTestMethod_NUnit4() =>\n        builder\n            .AddPaths(\"TestClassShouldHaveTestMethod.NUnit4.cs\")\n            .AddReferences(NuGetMetadataReference.NUnit(NUnit.Ver4))\n            .Verify();\n\n    [TestMethod]\n    [DataRow(\"3.0.0\")]\n    [DataRow(TestConstants.NuGetLatestVersion)]\n    public void TestClassShouldHaveTestMethod_NUnit3(string testFwkVersion) =>\n        builder\n            .AddPaths(\"TestClassShouldHaveTestMethod.NUnit3.cs\")\n            .AddReferences(NuGetMetadataReference.NUnit(testFwkVersion))\n            .Verify();\n\n    [TestMethod]\n    [DataRow(MsTest.Ver11)]\n    [DataRow(MsTest.Ver311)]\n    [DataRow(Latest)]\n    public void TestClassShouldHaveTestMethod_MSTest(string testFwkVersion) =>\n        builder\n            .AddPaths(\"TestClassShouldHaveTestMethod.MsTest.cs\")\n            .AddReferences(NuGetMetadataReference.MSTestTestFramework(testFwkVersion))\n            .Verify();\n\n    [TestMethod]\n    public void TestClassShouldHaveTestMethod_Latest() =>\n        builder\n            .AddPaths(\"TestClassShouldHaveTestMethod.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .AddReferences(NuGetMetadataReference.MSTestTestFramework(TestConstants.NuGetLatestVersion))\n            .AddReferences(NuGetMetadataReference.NUnit(TestConstants.NuGetLatestVersion))\n            .Verify();\n\n    [TestMethod]\n    public void TestClassShouldHaveTestMethod_NUnit4_AliasedNamespace() =>\n        builder.AddReferences(NuGetMetadataReference.NUnit(NUnit.Ver4)).AddSnippet(\"\"\"\n            using NUnit.Framework;\n            namespace Aliased\n            {\n                using Assert = NUnit.Framework.Legacy.ClassicAssert;\n                [TestFixture]\n                class ClassTest1 // Noncompliant\n                {\n                }\n                [TestFixture]\n                public class ClassTest2\n                {\n                    [TestCaseSource(\"DivideCases\")]\n                    public void DivideTest(int n, int d, int q)\n                    {\n                        Assert.AreEqual(q, n / d);\n                    }\n                    static object[] DivideCases = { new object[] { 12, 3, 4 } };\n                }\n            }\n            \"\"\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/TestMethodShouldContainAssertionTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\nusing SonarAnalyzer.Test.Common;\n\nusing static SonarAnalyzer.TestFramework.MetadataReferences.NugetPackageVersions;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class TestMethodShouldContainAssertionTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<TestMethodShouldContainAssertion>();\n\n    [TestMethod]\n    [DataRow(MsTest.Ver11)]\n    [DataRow(MsTest.Ver311)]\n    [DataRow(Latest)]\n    public void TestMethodShouldContainAssertion_MSTest_Common(string testFwkVersion) =>\n        WithTestReferences(NuGetMetadataReference.MSTestTestFramework(testFwkVersion))\n            .AddPaths(\"TestMethodShouldContainAssertion.MsTest.Common.cs\", \"TestMethodShouldContainAssertion.MsTest.AnotherFile.cs\")\n            .Verify();\n\n    [TestMethod]\n    public void TestMethodShouldContainAssertion_MSTest_V3() =>\n        WithTestReferences(NuGetMetadataReference.MSTestTestFrameworkV3)\n            .AddPaths(\"TestMethodShouldContainAssertion.MsTest.V3.cs\", \"TestMethodShouldContainAssertion.MsTest.AnotherFile.cs\")\n            .VerifyNoIssues();\n\n    [TestMethod]\n    public void TestMethodShouldContainAssertion_MSTest_Latest() =>\n        WithTestReferences(NuGetMetadataReference.MSTestTestFramework(TestConstants.NuGetLatestVersion))\n            .AddPaths(\"TestMethodShouldContainAssertion.MsTest.Latest.cs\", \"TestMethodShouldContainAssertion.MsTest.AnotherFile.cs\")\n            .Verify();\n\n    [TestMethod]\n    [DataRow(NUnit.Ver3, FluentAssertionsVersions.Ver7, Latest)]\n    [DataRow(NUnit.Ver3Latest, FluentAssertionsVersions.Ver5, Latest)] // Breaking changes in NUnit 4.0 would fail the test https://github.com/SonarSource/sonar-dotnet/issues/8409\n    [DataRow(NUnit.Ver3Latest, FluentAssertionsVersions.Ver7, Latest)] // Breaking changes in NUnit 4.0 would fail the test https://github.com/SonarSource/sonar-dotnet/issues/8409\n    public void TestMethodShouldContainAssertion_NUnit(string testFwkVersion, string fluentVersion, string nSubstituteVersion) =>\n        WithTestReferences(NuGetMetadataReference.NUnit(testFwkVersion), fluentVersion, nSubstituteVersion).AddPaths(\"TestMethodShouldContainAssertion.NUnit.cs\").Verify();\n\n    [TestMethod]\n    public void TestMethodShouldContainAssertion_NUnit4() =>\n        WithTestReferences(NuGetMetadataReference.NUnit(NUnit.Ver4)).AddPaths(\"TestMethodShouldContainAssertion.NUnit4.cs\").Verify();\n\n    [TestMethod]\n    [DataRow(NUnit.Ver25)]\n    [DataRow(NUnit.Ver27)]\n    public void TestMethodShouldContainAssertion_NUnit_V2Specific(string testFwkVersion) =>\n        WithTestReferences(NuGetMetadataReference.NUnit(testFwkVersion)).AddSnippet(\"\"\"\n            using System;\n            using NUnit.Framework;\n\n            [TestFixture]\n            public class Foo\n            {\n                [TestCase]\n                [ExpectedException(typeof(Exception))]\n                public void TestCase4()\n                {\n                    var x = System.IO.File.Open(\"\", System.IO.FileMode.Open);\n                }\n\n                [Theory]\n                [ExpectedException(typeof(Exception))]\n                public void Theory4()\n                {\n                    var x = System.IO.File.Open(\"\", System.IO.FileMode.Open);\n                }\n\n                [TestCaseSource(\"Foo\")]\n                [ExpectedException(typeof(Exception))]\n                public void TestCaseSource4()\n                {\n                    var x = System.IO.File.Open(\"\", System.IO.FileMode.Open);\n                }\n\n                [Test]\n                [ExpectedException(typeof(Exception))]\n                public void Test4()\n                {\n                    var x = System.IO.File.Open(\"\", System.IO.FileMode.Open);\n                }\n            }\n            \"\"\").VerifyNoIssues();\n\n    [TestMethod]\n    [DataRow(XUnitVersions.Ver2, FluentAssertionsVersions.Ver7, Latest)]\n    [DataRow(XUnitVersions.Ver253, FluentAssertionsVersions.Ver7, Latest)]\n    public void TestMethodShouldContainAssertion_Xunit(string testFwkVersion, string fluentVersion, string nSubstituteVersion) =>\n        WithTestReferences(NuGetMetadataReference.XunitFramework(testFwkVersion), fluentVersion, nSubstituteVersion).AddPaths(\"TestMethodShouldContainAssertion.Xunit.cs\").Verify();\n\n    [TestMethod]\n    public void TestMethodShouldContainAssertion_Xunit_Legacy() =>\n        WithTestReferences(NuGetMetadataReference.XunitFrameworkV1).AddPaths(\"TestMethodShouldContainAssertion.Xunit.Legacy.cs\").Verify();\n\n    [TestMethod]\n    public void TestMethodShouldContainAssertion_XunitV3() =>\n        WithTestReferences(NuGetMetadataReference.XunitFrameworkV3(TestConstants.NuGetLatestVersion))\n            .AddPaths(\"TestMethodShouldContainAssertion.Xunit.cs\")\n            .AddPaths(\"TestMethodShouldContainAssertion.XunitV3.cs\")\n            .AddReferences(NuGetMetadataReference.SystemMemory(TestConstants.NuGetLatestVersion))\n            .AddReferences(MetadataReferenceFacade.NetStandard)\n            .AddReferences(MetadataReferenceFacade.SystemCollections)\n            .Verify();\n\n    [TestMethod]\n    [DataRow(NUnit.Ver25, FluentAssertionsVersions.Ver1)]\n    [DataRow(NUnit.Ver25, FluentAssertionsVersions.Ver4)]\n    public void TestMethodShouldContainAssertion_NUnit_FluentAssertionsLegacy(string testFwkVersion, string fluentVersion) =>\n        WithTestReferences(NuGetMetadataReference.NUnit(testFwkVersion), fluentVersion).AddSnippet(\"\"\"\n            using System;\n            using FluentAssertions;\n            using NUnit.Framework;\n\n            [TestFixture]\n            public class Foo\n            {\n               [Test]\n               public void Test1() // Noncompliant\n               {\n                   var x = 42;\n               }\n\n               [Test]\n               public void ShouldThrowTest()\n               {\n                   Action act = () => { throw new Exception(); };\n                   act.ShouldThrow<Exception>();\n               }\n\n               [Test]\n               public void ShouldNotThrowTest()\n               {\n                   Action act = () => { throw new Exception(); };\n                   act.ShouldNotThrow<Exception>();\n               }\n            }\n            \"\"\").Verify();\n\n    [TestMethod]\n    public void TestMethodShouldContainAssertion_NUnit_NFluentLegacy() =>\n       WithTestReferences(NuGetMetadataReference.NUnit(NUnit.Ver25), nFluentVersion: \"1.3.1\").AddSnippet(\"\"\"\n           using System;\n           using NFluent;\n           using NUnit.Framework;\n\n           [TestFixture]\n           public class Foo\n           {\n               [Test]\n               public void Test1()\n               {\n                   throw new NFluent.FluentCheckException(\"You failed me!\");\n               }\n           }\n           \"\"\").VerifyNoIssues();\n\n    [TestMethod]\n    public void TestMethodShouldContainAssertion_Moq() =>\n        WithTestReferences(NuGetMetadataReference.MSTestTestFramework(Latest)).AddPaths(\"TestMethodShouldContainAssertion.Moq.cs\").Verify();\n\n    [TestMethod]\n    [DataRow(MsTest.Ver11)]\n    [DataRow(MsTest.Ver311)]\n    [DataRow(Latest)]\n    public void TestMethodShouldContainAssertion_CustomAssertionMethod_Common(string version) =>\n        builder.AddPaths(\"TestMethodShouldContainAssertion.Custom.Common.cs\").AddReferences(NuGetMetadataReference.MSTestTestFramework(version)).Verify();\n\n    [TestMethod]\n    public void TestMethodShouldContainAssertion_CustomAssertionMethod_V3() =>\n        builder.AddPaths(\"TestMethodShouldContainAssertion.Custom.V3.cs\").AddReferences(NuGetMetadataReference.MSTestTestFrameworkV3).VerifyNoIssues();\n\n    [TestMethod]\n    public void TestMethodShouldContainAssertion_FsCheck_XUnit() =>\n        WithTestReferences(NuGetMetadataReference.FsCheckXunit(Latest))\n            .AddPaths(\"TestMethodShouldContainAssertion.XUnit.FsCheck.cs\")\n            .VerifyNoIssues();\n\n    [TestMethod]\n    public void TestMethodShouldContainAssertion_FsCheck_NUnit() =>\n        WithTestReferences(NuGetMetadataReference.FsCheckNunit(Latest))\n            .AddPaths(\"TestMethodShouldContainAssertion.NUnit.FsCheck.cs\")\n            .VerifyNoIssues();\n\n    [TestMethod]\n    public void TestMethodShouldContainAssertion_CodeGenerator() =>\n        builder\n            .AddPaths(\"TestMethodShouldContainAssertion.SourceGenerators.cs\")\n            .AddReferences(NuGetMetadataReference.MSTestTestFramework(TestConstants.NuGetLatestVersion))\n            .AddReferences(NuGetMetadataReference.MicrosoftCodeAnalysisCSharp())\n            .AddReferences(NuGetMetadataReference.MicrosoftCodeAnalysisCSharpSourceGeneratorsTesting())\n            .AddReferences(NuGetMetadataReference.MicrosoftCodeAnalysisAnalyzerTesting())\n            .WithOptions(LanguageOptions.FromCSharp13)\n            .Verify();\n\n    [TestMethod]\n    public void TestMethodShouldContainAssertion_Latest() =>\n        builder.AddPaths(\"TestMethodShouldContainAssertion.Latest.cs\")\n            .AddReferences(NuGetMetadataReference.MSTestTestFrameworkV1)\n            .AddReferences(NuGetMetadataReference.XunitFramework(Latest))\n            .AddReferences(NuGetMetadataReference.NUnit(Latest))\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void TestMethodShouldContainAssertion_NUnit4_AliasedNamespace() =>\n        WithTestReferences(NuGetMetadataReference.NUnit(NUnit.Ver4)).AddSnippet(\"\"\"\n            using NUnit.Framework;\n            namespace Aliased\n            {\n                using Assert = NUnit.Framework.Legacy.ClassicAssert;\n                [TestFixture]\n                class TestAliased\n                {\n                    [Test]\n                    public void Test1() // Noncompliant\n                    {\n                        var x = 42;\n                    }\n                    [Test]\n                    public void Test2()\n                    {\n                        var x = 42;\n                        Assert.AreEqual(x, 42);\n                    }\n                }\n            }\n            \"\"\").Verify();\n\n    internal static VerifierBuilder WithTestReferences(IEnumerable<MetadataReference> testFrameworkReference,\n                                                       string fluentVersion = FluentAssertionsVersions.Ver7,\n                                                       string nSubstituteVersion = Latest,\n                                                       string nFluentVersion = Latest,\n                                                       string shouldlyVersion = Latest,\n                                                       string moqVersion = Latest) =>\n        new VerifierBuilder<TestMethodShouldContainAssertion>()\n            .AddReferences(testFrameworkReference)\n            .AddReferences(NuGetMetadataReference.FluentAssertions(fluentVersion))\n            .AddReferences(NuGetMetadataReference.NSubstitute(nSubstituteVersion))\n            .AddReferences(NuGetMetadataReference.NFluent(nFluentVersion))\n            .AddReferences(NuGetMetadataReference.Shouldly(shouldlyVersion))\n            .AddReferences(NuGetMetadataReference.Moq(moqVersion))\n            .AddReferences(MetadataReferenceFacade.SystemData)\n            .AddReferences(MetadataReferenceFacade.SystemNetHttp)\n            .AddReferences(MetadataReferenceFacade.SystemXml)\n            .AddReferences(MetadataReferenceFacade.SystemXmlLinq)\n            .AddReferences(MetadataReferenceFacade.SystemThreadingTasks);\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/TestMethodShouldHaveCorrectSignatureTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\nusing static SonarAnalyzer.TestFramework.MetadataReferences.NugetPackageVersions;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class TestMethodShouldHaveCorrectSignatureTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<TestMethodShouldHaveCorrectSignature>();\n\n    [TestMethod]\n    [DataRow(MsTest.Ver11)]\n    [DataRow(MsTest.Ver37)]\n    public void TestMethodShouldHaveCorrectSignature_MsTest_Legacy(string testFwkVersion) =>\n        builder.AddPaths(\"TestMethodShouldHaveCorrectSignature.MsTest.Legacy.cs\")\n            .AddReferences(NuGetMetadataReference.MSTestTestFramework(testFwkVersion))\n            .Verify();\n\n    [TestMethod]\n    [DataRow(MsTest.Ver38)]\n    [DataRow(MsTest.Ver311)]\n    [DataRow(Latest)]\n    public void TestMethodShouldHaveCorrectSignature_MsTest(string testFwkVersion) =>\n        builder.AddPaths(\"TestMethodShouldHaveCorrectSignature.MsTest.cs\")\n            .AddReferences(NuGetMetadataReference.MSTestTestFramework(testFwkVersion))\n            .Verify();\n\n    [TestMethod]\n    [DataRow(NUnit.Ver25)]\n    [DataRow(Latest)]\n    public void TestMethodShouldHaveCorrectSignature_NUnit(string testFwkVersion) =>\n        builder.AddPaths(\"TestMethodShouldHaveCorrectSignature.NUnit.cs\")\n            .AddReferences(NuGetMetadataReference.NUnit(testFwkVersion))\n            .Verify();\n\n    [TestMethod]\n    [DataRow(\"2.0.0\")]\n    [DataRow(TestConstants.NuGetLatestVersion)]\n    public void TestMethodShouldHaveCorrectSignature_Xunit(string testFwkVersion) =>\n        builder.AddPaths(\"TestMethodShouldHaveCorrectSignature.Xunit.cs\")\n            .AddReferences(NuGetMetadataReference.XunitFramework(testFwkVersion))\n            .Verify();\n\n    [TestMethod]\n    public void TestMethodShouldHaveCorrectSignature_Xunit_Legacy() =>\n        builder.AddPaths(\"TestMethodShouldHaveCorrectSignature.Xunit.Legacy.cs\")\n            .AddReferences(NuGetMetadataReference.XunitFrameworkV1)\n            .Verify();\n\n    [TestMethod]\n    public void TestMethodShouldHaveCorrectSignature_XunitV3() =>\n        builder.AddPaths(\"TestMethodShouldHaveCorrectSignature.Xunit.cs\")\n            .AddReferences(NuGetMetadataReference.XunitFrameworkV3(TestConstants.NuGetLatestVersion))\n            .AddReferences(NuGetMetadataReference.SystemMemory(TestConstants.NuGetLatestVersion))\n            .AddReferences(MetadataReferenceFacade.NetStandard)\n            .AddReferences(MetadataReferenceFacade.SystemCollections)\n            .Verify();\n\n    [TestMethod]\n    public void TestMethodShouldHaveCorrectSignature_MSTest_Miscellaneous() =>\n        // Additional test cases e.g. partial classes, and methods with multiple faults.\n        // We have to specify a test framework for the tests, but it doesn't really matter which\n        // one, so we're using MSTest and only testing a single version.\n        builder.AddPaths(\"TestMethodShouldHaveCorrectSignature.Misc.cs\")\n            .AddReferences(NuGetMetadataReference.MSTestTestFrameworkV1)\n            .Verify();\n\n    [TestMethod]\n    public void TestMethodShouldHaveCorrectSignature_Latest() =>\n        builder.AddPaths(\"TestMethodShouldHaveCorrectSignature.Latest.cs\")\n            .AddReferences(NuGetMetadataReference.MSTestTestFrameworkV1)\n            .AddReferences(NuGetMetadataReference.XunitFramework(TestConstants.NuGetLatestVersion))\n            .AddReferences(NuGetMetadataReference.NUnit(TestConstants.NuGetLatestVersion))\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/TestMethodShouldNotBeIgnoredTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\nusing static SonarAnalyzer.TestFramework.MetadataReferences.NugetPackageVersions;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class TestMethodShouldNotBeIgnoredTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<TestMethodShouldNotBeIgnored>()\n        .AddReferences(NuGetMetadataReference.MSTestTestFramework(TestConstants.NuGetLatestVersion));\n\n    [TestMethod]\n    public void TestMethodShouldNotBeIgnored_MsTest_Legacy() =>\n        new VerifierBuilder<TestMethodShouldNotBeIgnored>()\n            .AddReferences(NuGetMetadataReference.MSTestTestFrameworkV1)\n            .AddPaths(\"TestMethodShouldNotBeIgnored.MsTest.cs\")\n            .WithErrorBehavior(CompilationErrorBehavior.Ignore) // IgnoreAttribute doesn't contain any reason param\n            .Verify();\n\n    [TestMethod]\n    [DataRow(MsTest.Ver12)]\n    [DataRow(MsTest.Ver311)]\n    [DataRow(Latest)]\n    public void TestMethodShouldNotBeIgnored_MsTest(string testFwkVersion) =>\n        new VerifierBuilder<TestMethodShouldNotBeIgnored>()\n            .AddPaths(\"TestMethodShouldNotBeIgnored.MsTest.cs\")\n            .AddReferences(NuGetMetadataReference.MSTestTestFramework(testFwkVersion))\n            .Verify();\n\n    [TestMethod]\n    public void TestMethodShouldNotBeIgnored_MsTest_InvalidCases() =>\n        builder.AddSnippet(\"\"\"\n            using Microsoft.VisualStudio.TestTools.UnitTesting;\n            namespace Tests.Diagnostics.TestMethods\n            {\n                [ThisDoesNotExist]\n                public class MsTestClass3\n                {\n                }\n\n                [Ignore]\n            }\n            \"\"\")\n            .VerifyNoIssuesIgnoreErrors();\n\n    [TestMethod]\n    [DataRow(NUnit.Ver25)]\n    [DataRow(NUnit.Ver27)]\n    public void TestMethodShouldNotBeIgnored_NUnit_V2(string testFwkVersion) =>\n        builder.AddPaths(\"TestMethodShouldNotBeIgnored.NUnit.V2.cs\")\n            .AddReferences(NuGetMetadataReference.NUnit(testFwkVersion))\n            .Verify();\n\n    [TestMethod]\n    [DataRow(\"3.0.0\")] // Ignore without reason no longer exist\n    [DataRow(TestConstants.NuGetLatestVersion)]\n    public void TestMethodShouldNotBeIgnored_NUnit(string testFwkVersion) =>\n        builder.AddPaths(\"TestMethodShouldNotBeIgnored.NUnit.cs\").AddReferences(NuGetMetadataReference.NUnit(testFwkVersion)).Verify();\n\n    [TestMethod]\n    [DataRow(\"2.0.0\")]\n    [DataRow(TestConstants.NuGetLatestVersion)]\n    public void TestMethodShouldNotBeIgnored_Xunit(string testFwkVersion) =>\n        builder.AddPaths(\"TestMethodShouldNotBeIgnored.Xunit.cs\").AddReferences(NuGetMetadataReference.XunitFramework(testFwkVersion)).VerifyNoIssues();\n\n    [TestMethod]\n    public void TestMethodShouldNotBeIgnored_Xunit_v1() =>\n        builder.AddPaths(\"TestMethodShouldNotBeIgnored.Xunit.v1.cs\").AddReferences(NuGetMetadataReference.XunitFrameworkV1).VerifyNoIssues();\n\n    [TestMethod]\n    public void TestMethodShouldNotBeIgnored_Latest() =>\n        builder.AddPaths(\"TestMethodShouldNotBeIgnored.Latest.cs\")\n            .AddReferences(NuGetMetadataReference.XunitFrameworkV1)\n            .AddReferences(NuGetMetadataReference.NUnit(TestConstants.NuGetLatestVersion))\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/TestsShouldNotUseThreadSleepTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Test.Common;\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class TestsShouldNotUseThreadSleepTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.TestsShouldNotUseThreadSleep>()\n        .AddReferences(NuGetMetadataReference.NUnit(TestConstants.NuGetLatestVersion))\n        .AddReferences(NuGetMetadataReference.MSTestTestFramework(TestConstants.NuGetLatestVersion))\n        .AddReferences(NuGetMetadataReference.XunitFramework(XUnitVersions.Ver253));\n\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.TestsShouldNotUseThreadSleep>()\n        .AddReferences(NuGetMetadataReference.NUnit(TestConstants.NuGetLatestVersion))\n        .AddReferences(NuGetMetadataReference.MSTestTestFramework(TestConstants.NuGetLatestVersion))\n        .AddReferences(NuGetMetadataReference.XunitFramework(XUnitVersions.Ver253));\n\n    [TestMethod]\n    public void TestsShouldNotUseThreadSleep_CS() =>\n        builderCS.AddPaths(\"TestsShouldNotUseThreadSleep.cs\").Verify();\n\n    [TestMethod]\n    public void TestsShouldNotUseThreadSleep_VB() =>\n        builderVB.AddPaths(\"TestsShouldNotUseThreadSleep.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ThisShouldNotBeExposedFromConstructorsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class ThisShouldNotBeExposedFromConstructorsTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<ThisShouldNotBeExposedFromConstructors>();\n\n        [TestMethod]\n        public void ThisShouldNotBeExposedFromConstructors() =>\n            builder.AddPaths(\"ThisShouldNotBeExposedFromConstructors.cs\").Verify();\n\n        [TestMethod]\n        public void ThisShouldNotBeExposedFromConstructors_CSharp9() =>\n            builder.AddPaths(\"ThisShouldNotBeExposedFromConstructors.CSharp9.cs\")\n                .WithOptions(LanguageOptions.FromCSharp9)\n                .Verify();\n\n        [TestMethod]\n        public void ThisShouldNotBeExposedFromConstructors_CSharp10() =>\n            builder.AddPaths(\"ThisShouldNotBeExposedFromConstructors.CSharp10.cs\")\n                .WithOptions(LanguageOptions.FromCSharp10)\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ThreadResumeOrSuspendShouldNotBeCalledTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ThreadResumeOrSuspendShouldNotBeCalledTest\n{\n    [TestMethod]\n    public void ThreadResumeOrSuspendShouldNotBeCalled_CS() =>\n        new VerifierBuilder<CS.ThreadResumeOrSuspendShouldNotBeCalled>().AddPaths(\"ThreadResumeOrSuspendShouldNotBeCalled.cs\").Verify();\n\n    [TestMethod]\n    public void ThreadResumeOrSuspendShouldNotBeCalled_VB() =>\n        new VerifierBuilder<VB.ThreadResumeOrSuspendShouldNotBeCalled>().AddPaths(\"ThreadResumeOrSuspendShouldNotBeCalled.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ThreadStaticNonStaticFieldTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ThreadStaticNonStaticFieldTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<ThreadStaticNonStaticField>();\n\n    [TestMethod]\n    public void ThreadStaticNonStaticField() =>\n        builder.AddPaths(\"ThreadStaticNonStaticField.cs\").Verify();\n\n    [TestMethod]\n    public void ThreadStaticNonStaticField_Latest() =>\n        builder.AddPaths(\"ThreadStaticNonStaticField.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void ThreadStaticNonStaticField_CodeFix() =>\n        builder.WithCodeFix<ThreadStaticNonStaticFieldCodeFix>()\n            .AddPaths(\"ThreadStaticNonStaticField.cs\")\n            .WithCodeFixedPaths(\"ThreadStaticNonStaticField.Fixed.cs\")\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void ThreadStaticNonStaticField_Latest_CodeFix() =>\n        builder.WithCodeFix<ThreadStaticNonStaticFieldCodeFix>()\n            .AddPaths(\"ThreadStaticNonStaticField.Latest.cs\")\n            .WithCodeFixedPaths(\"ThreadStaticNonStaticField.Latest.Fixed.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .VerifyCodeFix();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ThreadStaticWithInitializerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ThreadStaticWithInitializerTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<ThreadStaticWithInitializer>();\n\n    [TestMethod]\n    public void ThreadStaticWithInitializer() =>\n        builder.AddPaths(\"ThreadStaticWithInitializer.cs\").Verify();\n\n    [TestMethod]\n    public void ThreadStaticWithInitializer_Latest() =>\n        builder.AddPaths(\"ThreadStaticWithInitializer.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ThrowReservedExceptionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ThrowReservedExceptionsTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.ThrowReservedExceptions>();\n\n    [TestMethod]\n    public void ThrowReservedExceptions_CS() =>\n        builderCS.AddPaths(\"ThrowReservedExceptions.cs\").Verify();\n\n    [TestMethod]\n    public void ThrowReservedExceptions_CS_Latest() =>\n        builderCS.AddPaths(\"ThrowReservedExceptions.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void ThrowReservedExceptions_VB() =>\n        new VerifierBuilder<VB.ThrowReservedExceptions>().AddPaths(\"ThrowReservedExceptions.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ToStringShouldNotReturnNullTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ToStringShouldNotReturnNullTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.ToStringShouldNotReturnNull>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.ToStringShouldNotReturnNull>();\n\n    [TestMethod]\n    public void ToStringShouldNotReturnNull_CS() =>\n        builderCS.AddPaths(\"ToStringShouldNotReturnNull.cs\").Verify();\n\n    [TestMethod]\n    public void ToStringShouldNotReturnNull_TopLevelStatements() =>\n        builderCS\n            .WithTopLevelStatements()\n            .AddPaths(\"ToStringShouldNotReturnNull.TopLevelStatements.cs\")\n            .VerifyNoIssues();\n\n    [TestMethod]\n    public void ToStringShouldNotReturnNull_CS_Latest() =>\n        builderCS\n            .AddPaths(\"ToStringShouldNotReturnNull.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void ToStringShouldNotReturnNull_VB() =>\n        builderVB.AddPaths(\"ToStringShouldNotReturnNull.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/TooManyGenericParametersTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class TooManyGenericParametersTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<TooManyGenericParameters>();\n\n    [TestMethod]\n    public void TooManyGenericParameters_DefaultValues() =>\n        builder.AddPaths(\"TooManyGenericParameters.DefaultValues.cs\").Verify();\n\n    [TestMethod]\n    public void TooManyGenericParameters_Latest() =>\n        builder.AddPaths(\"TooManyGenericParameters.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void TooManyGenericParameters_TopLevelStatements() =>\n        builder.AddPaths(\"TooManyGenericParameters.TopLevelStatements.cs\").WithTopLevelStatements().Verify();\n\n    [TestMethod]\n    public void TooManyGenericParameters_CustomValues() =>\n        new VerifierBuilder()\n            .AddAnalyzer(() => new TooManyGenericParameters { MaxNumberOfGenericParametersInClass = 4, MaxNumberOfGenericParametersInMethod = 4 })\n            .AddPaths(\"TooManyGenericParameters.CustomValues.cs\")\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/TooManyLabelsInSwitchTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class TooManyLabelsInSwitchTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder().AddAnalyzer(() => new CS.TooManyLabelsInSwitch() { Maximum = 2 });\n\n    [TestMethod]\n    public void TooManyLabelsInSwitch_CS() =>\n        builderCS.AddPaths(\"TooManyLabelsInSwitch.cs\")\n            .WithOptions(LanguageOptions.FromCSharp8)\n            .Verify();\n\n    [TestMethod]\n    public void TooManyLabelsInSwitch_CS_Latest() =>\n        builderCS.AddPaths(\"TooManyLabelsInSwitch.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void TooManyLabelsInSwitch_VB() =>\n        new VerifierBuilder().AddAnalyzer(() => new VB.TooManyLabelsInSwitch() { Maximum = 2 })\n            .AddPaths(\"TooManyLabelsInSwitch.vb\")\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/TooManyLoggingCallsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class TooManyLoggingCallsTest\n{\n    private readonly VerifierBuilder defaultBuilder = new VerifierBuilder<TooManyLoggingCalls>();\n\n    private readonly VerifierBuilder configuredBuilder = new VerifierBuilder().AddAnalyzer(() => new TooManyLoggingCalls\n    {\n        DebugThreshold = 1,\n    });\n\n    private readonly VerifierBuilder misconfiguredBuilder = new VerifierBuilder().AddAnalyzer(() => new TooManyLoggingCalls\n    {\n        DebugThreshold = 0,\n        ErrorThreshold = -1,\n    });\n\n    [TestMethod]\n    public void TooManyLoggingCalls_CS() =>\n        defaultBuilder.AddReferences(NuGetMetadataReference.MicrosoftExtensionsLoggingAbstractions())\n            .AddPaths(\"TooManyLoggingCalls.cs\")\n            .Verify();\n\n    [TestMethod]\n    public void TooManyLoggingCalls_TopLevelStatements_CS() =>\n        defaultBuilder.AddReferences(NuGetMetadataReference.MicrosoftExtensionsLoggingAbstractions())\n            .WithTopLevelStatements()\n            .AddSnippet(\"\"\"\n                using Microsoft.Extensions.Logging;\n                using Microsoft.Extensions.Logging.Abstractions;\n\n                var logger = NullLogger.Instance;\n\n                logger.LogError(\"Error 1\");         // Noncompliant\n                logger.LogError(\"Error 2\");         // Secondary\n\n                logger.LogWarning(\"Warn 1\");        // Compliant\n                \"\"\").Verify();\n\n    [TestMethod]\n    public void TooManyLoggingCalls_CastleCoreLogging_CS() =>\n        defaultBuilder.AddReferences(NuGetMetadataReference.CastleCore())\n            .AddPaths(\"TooManyLoggingCalls.Castle.Core.Logging.cs\")\n            .Verify();\n\n    [TestMethod]\n    public void TooManyLoggingCalls_Log4Net_CS() =>\n        defaultBuilder.AddReferences(NuGetMetadataReference.Log4Net(\"2.0.8\", \"net45-full\"))\n            .AddPaths(\"TooManyLoggingCalls.Log4Net.cs\")\n            .Verify();\n\n    [TestMethod]\n    public void TooManyLoggingCalls_MicrosoftExtensionsLogging_CS() =>\n        defaultBuilder.AddReferences(NuGetMetadataReference.MicrosoftExtensionsLoggingAbstractions())\n            .AddPaths(\"TooManyLoggingCalls.Microsoft.Extensions.Logging.cs\")\n            .Verify();\n\n    [TestMethod]\n    public void TooManyLoggingCalls_NLog_CS() =>\n        defaultBuilder.AddReferences(NuGetMetadataReference.NLog())\n        .AddPaths(\"TooManyLoggingCalls.NLog.cs\")\n        .Verify();\n\n    [TestMethod]\n    public void TooManyLoggingCalls_Serilog_CS() =>\n        defaultBuilder.AddReferences(NuGetMetadataReference.Serilog())\n            .AddPaths(\"TooManyLoggingCalls.Serilog.cs\")\n            .Verify();\n\n    [TestMethod]\n    public void TooManyLoggingCalls_ConfiguredThresholds_CS() =>\n        configuredBuilder.AddReferences(NuGetMetadataReference.MicrosoftExtensionsLoggingAbstractions())\n            .AddSnippet(\"\"\"\n                using Microsoft.Extensions.Logging;\n\n                public class Program\n                {\n                    public void Method(ILogger logger)\n                    {\n                        // The threshold was set to 1\n                        logger.LogDebug(\"Debug 1\");     // Noncompliant {{Reduce the number of Debug logging calls within this code block from 2 to the 1 allowed.}}\n                        logger.LogDebug(\"Debug 2\");     // Secondary\n\n                        // The threshold was not configured, so it remains the default 1\n                        logger.LogError(\"Error 1\");     // Noncompliant {{Reduce the number of Error logging calls within this code block from 2 to the 1 allowed.}}\n                        logger.LogError(\"Error 2\");     // Secondary\n                    }\n                }\n                \"\"\").Verify();\n\n    [TestMethod]\n    public void TooManyLoggingCalls_MisconfiguredThresholds_CS() =>\n        misconfiguredBuilder.AddReferences(NuGetMetadataReference.MicrosoftExtensionsLoggingAbstractions())\n            .AddSnippet(\"\"\"\n                using Microsoft.Extensions.Logging;\n\n                public class Program\n                {\n                    public void Method(ILogger logger)\n                    {\n                        // The threshold was set to 0\n                        logger.LogDebug(\"Debug 1\");     // Noncompliant {{Reduce the number of Debug logging calls within this code block from 1 to the 0 allowed.}}\n\n                        // The threshold was misconfigured to -1, so it's using 0 as threshold\n                        logger.LogError(\"Error 1\");     // Noncompliant {{Reduce the number of Error logging calls within this code block from 1 to the 0 allowed.}}\n                    }\n                }\n                \"\"\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/TooManyParametersTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class TooManyParametersTest\n{\n    private readonly VerifierBuilder builderCSMax3 = new VerifierBuilder().AddAnalyzer(() => new CS.TooManyParameters { Maximum = 3 });\n    private readonly VerifierBuilder builderVBMax3 = new VerifierBuilder().AddAnalyzer(() => new VB.TooManyParameters { Maximum = 3 });\n\n    [TestMethod]\n    public void TooManyParameters_CS_CustomValues() =>\n        builderCSMax3.AddPaths(\"TooManyParameters_CustomValues.cs\")\n            .WithOptions(LanguageOptions.FromCSharp8)\n            .Verify();\n\n    [TestMethod]\n    public void TooManyParameters_CS_CustomValues_TopLevelStatements() =>\n         builderCSMax3.AddPaths(\"TooManyParameters_CustomValues.TopLevelStatements.cs\")\n            .WithTopLevelStatements()\n            .Verify();\n\n    [TestMethod]\n    public void TooManyParameters_CS_CustomValues_Latest() =>\n        builderCSMax3.AddPaths(\"TooManyParameters_CustomValues.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void TooManyParameters_VB_CustomValues() =>\n        builderVBMax3.AddPaths(\"TooManyParameters_CustomValues.vb\").Verify();\n\n    [TestMethod]\n    public void TooManyParameters_CS_DefaultValues() =>\n        new VerifierBuilder<CS.TooManyParameters>().AddPaths(\"TooManyParameters_DefaultValues.cs\")\n            .WithOptions(LanguageOptions.FromCSharp8)\n            .Verify();\n\n    [TestMethod]\n    public void TooManyParameters_VB_DefaultValues() =>\n        new VerifierBuilder<VB.TooManyParameters>().AddPaths(\"TooManyParameters_DefaultValues.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/TrackNotImplementedExceptionTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class TrackNotImplementedExceptionTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<TrackNotImplementedException>();\n\n        [TestMethod]\n        public void TrackNotImplementedException_CSharp8() =>\n            builder.AddPaths(\"TrackNotImplementedException.cs\")\n                .AddReferences(MetadataReferenceFacade.NetStandard21)\n                .WithOptions(LanguageOptions.FromCSharp8)\n                .Verify();\n\n        [TestMethod]\n        public void TrackNotImplementedException_CSharp11() =>\n            builder.AddPaths(\"TrackNotImplementedException.CSharp11.cs\")\n                .WithOptions(LanguageOptions.FromCSharp11)\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/TryStatementsWithIdenticalCatchShouldBeMergedTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class TryStatementsWithIdenticalCatchShouldBeMergedTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<TryStatementsWithIdenticalCatchShouldBeMerged>();\n\n        public TestContext TestContext { get; set; }\n\n        [TestMethod]\n        public void TryStatementsWithIdenticalCatchShouldBeMerged() =>\n            builder.AddPaths(\"TryStatementsWithIdenticalCatchShouldBeMerged.cs\").Verify();\n\n        [TestMethod]\n        public void TryStatementsWithIdenticalCatchShouldBeMerged_RazorFile_CorrectMessage() =>\n            builder.AddSnippet(\n                \"\"\"\n                @using System;\n                @code\n                {\n                    public void Method()\n                    {\n                        try { }\n                        catch (Exception)\n                        {\n                        }\n                        finally { }\n\n                        try { } // Noncompliant {{Combine this 'try' with the one starting on line 6.}}\n                        catch (Exception)\n                        {\n                        }\n                        finally { }\n                    }\n                }\n                \"\"\",\n                \"SomeRazorFile.razor\")\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Product))\n            .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/TypeExaminationOnSystemTypeTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class TypeExaminationOnSystemTypeTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<TypeExaminationOnSystemType>();\n\n    [TestMethod]\n    public void TypeExaminationOnSystemType() =>\n        builder.AddPaths(\"TypeExaminationOnSystemType.cs\").Verify();\n\n    [TestMethod]\n    public void TypeExaminationOnSystemType_TopLevelStatements() =>\n        builder.AddPaths(\"TypeExaminationOnSystemType.TopLevelStatements.cs\")\n            .WithTopLevelStatements()\n            .WithOptions(LanguageOptions.FromCSharp12)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/TypeMemberVisibilityTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class TypeMemberVisibilityTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<TypeMemberVisibility>();\n\n    [TestMethod]\n    public void TypeMemberVisibility_CS() =>\n        builder.AddPaths(\"TypeMemberVisibility.cs\").Verify();\n\n    [TestMethod]\n    public void TypeMemberVisibility_Latest() =>\n        builder.AddPaths(\"TypeMemberVisibility.Latest.cs\", \"TypeMemberVisibility.Latest.Partial.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/TypeNamesShouldNotMatchNamespacesTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class TypeNamesShouldNotMatchNamespacesTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<TypeNamesShouldNotMatchNamespaces>();\n\n        [TestMethod]\n        public void TypeNamesShouldNotMatchNamespaces() =>\n            builder.AddPaths(\"TypeNamesShouldNotMatchNamespaces.cs\").Verify();\n\n        [TestMethod]\n        public void TypeNamesShouldNotMatchNamespaces_CSharp9() =>\n            builder.AddPaths(\"TypeNamesShouldNotMatchNamespaces.CSharp9.cs\").WithOptions(LanguageOptions.FromCSharp9).Verify();\n\n        [TestMethod]\n        public void TypeNamesShouldNotMatchNamespaces_CSharp10() =>\n            builder.AddPaths(\"TypeNamesShouldNotMatchNamespaces.CSharp10.cs\").WithOptions(LanguageOptions.FromCSharp10).Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/TypeParameterNameTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class TypeParameterNameTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<TypeParameterName>();\n\n        [TestMethod]\n        public void TypeParameterName_S119() =>\n            builder.WithOnlyDiagnostics(TypeParameterName.S119)\n                   .AddPaths(\"TypeParameterName.vb\")\n                   .Verify();\n\n        [TestMethod]\n        public void TypeParameterName_S2373() =>\n            builder.WithOnlyDiagnostics(TypeParameterName.S2373)\n                   .AddPaths(\"TypeParameterName.vb\")\n                   .Verify();\n\n        [TestMethod]\n        public void TypeParameterName_S119_CustomRegex() =>\n            new VerifierBuilder().AddAnalyzer(() => new TypeParameterName { Pattern = \"^[A-Z]{2}\\\\d{2}$\" })\n                   .WithOnlyDiagnostics(TypeParameterName.S119)\n                   .AddPaths(\"TypeParameterName_CustomRegex.vb\")\n                   .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/TypesShouldNotExtendOutdatedBaseTypesTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class TypesShouldNotExtendOutdatedBaseTypesTest\n{\n    [TestMethod]\n    public void TypesShouldNotExtendOutdatedBaseTypes() =>\n        new VerifierBuilder<TypesShouldNotExtendOutdatedBaseTypes>()\n            .AddPaths(\"TypesShouldNotExtendOutdatedBaseTypes.cs\")\n            .AddReferences(MetadataReferenceFacade.SystemXml.Concat(MetadataReferenceFacade.SystemCollections))\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UnaryPrefixOperatorRepeatedTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class UnaryPrefixOperatorRepeatedTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.UnaryPrefixOperatorRepeated>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.UnaryPrefixOperatorRepeated>();\n\n    [TestMethod]\n    public void UnaryPrefixOperatorRepeated() =>\n        builderCS.AddPaths(\"UnaryPrefixOperatorRepeated.cs\").Verify();\n\n    [TestMethod]\n    public void UnaryPrefixOperatorRepeated_CS_TopLevelStatements() =>\n        builderCS.AddPaths(\"UnaryPrefixOperatorRepeated.TopLevelStatements.cs\")\n            .WithTopLevelStatements()\n            .Verify();\n\n    [TestMethod]\n    public void UnaryPrefixOperatorRepeated_CS_Latest() =>\n        builderCS.AddPaths(\"UnaryPrefixOperatorRepeated.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void UnaryPrefixOperatorRepeated_CodeFix() =>\n        builderCS.WithCodeFix<UnaryPrefixOperatorRepeatedCodeFix>()\n            .AddPaths(\"UnaryPrefixOperatorRepeated.cs\")\n            .WithCodeFixedPaths(\"UnaryPrefixOperatorRepeated.Fixed.cs\")\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void UnaryPrefixOperatorRepeated_VB() =>\n        builderVB.AddPaths(\"UnaryPrefixOperatorRepeated.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UnchangedLocalVariablesShouldBeConstTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class UnchangedLocalVariablesShouldBeConstTest\n{\n    private readonly VerifierBuilder verifier = new VerifierBuilder<UnchangedLocalVariablesShouldBeConst>();\n\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    public void UnchangedLocalVariablesShouldBeConst() =>\n        verifier.AddPaths(\"UnchangedLocalVariablesShouldBeConst.cs\").Verify();\n\n    [TestMethod]\n    public void UnchangedLocalVariablesShouldBeConst_CSharp7() =>\n        verifier.AddSnippet(\"\"\"\n                            public class Test{\n\n                                public void Message()\n                                {\n                                    var s1 = \"Test\";                              // Noncompliant {{Add the 'const' modifier to 's1', and replace 'var' with 'string'.}}\n                                    string s2 = $\"This is a {nameof(Message)}\";   // Compliant - constant string interpolation is only valid in C# 10 and above\n                                    var s3 = $\"This is a {nameof(Message)}\";      // Compliant - constant string interpolation is only valid in C# 10 and above\n                                    var s4 = \"This is a\" + $\" {nameof(Message)}\"; // Compliant - constant string interpolation is only valid in C# 10 and above\n                                    var s5 = $@\"This is a {nameof(Message)}\";     // Compliant - constant string interpolation is only valid in C# 10 and above\n                                }\n                            }\n                            \"\"\")\n        .WithOptions(LanguageOptions.OnlyCSharp7).Verify();\n\n#if NET\n\n    [TestMethod]\n    public void UnchangedLocalVariablesShouldBeConst_TopLevelStatements() =>\n        verifier.AddPaths(\"UnchangedLocalVariablesShouldBeConst.TopLevelStatements.cs\")\n        .WithOptions(LanguageOptions.CSharpLatest)\n        .WithTopLevelStatements()\n        .Verify();\n\n    [TestMethod]\n    public void UnchangedLocalVariablesShouldBeConst_Latest() =>\n        verifier.AddPaths(\"UnchangedLocalVariablesShouldBeConst.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .WithWarningsAsErrors(\"CS9193\")\n            .Verify();\n\n    [TestMethod]\n    public void UnchangedLocalVariablesShouldBeConst_CshtmlIdeGenerated() =>\n        verifier.AddPaths(\"UnchangedLocalVariablesShouldBeConst.cshtml.ide.g.cs\")\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Product))\n            .WithConcurrentAnalysis(false) // With concurrent analysis the issues are not raised\n            .AddReferences(\n            [\n                AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcCore,\n                AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcViewFeatures,\n                AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcRazor,\n                AspNetCoreMetadataReference.MicrosoftAspNetCoreMvcAbstractions,\n                ..NuGetMetadataReference.MicrosoftExtensionsConfigurationAbstractions(\"9.0.1\"),\n                ..NuGetMetadataReference.MicrosoftAspNetCoreMvcRazorRuntime(\"2.3.0\"),\n            ])\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n#endif\n\n    [TestMethod]\n    public void UnchangedLocalVariablesShouldBeConst_InvalidCode() =>\n        verifier.AddSnippet(\"\"\"\n            // invalid code\n            public void Test_TypeThatCannotBeConst(int arg) // Error [CS0106, CS8805] \n            {\n                System.Random random = 1; // Error [CS0029]\n            }\n\n            // invalid code\n            public void (int arg) // Error [CS0116, CS0119, CS1525, CS1073, CS1002]\n            {\n                int intVar = 1; // Noncompliant\n            }\n            \"\"\").WithOptions(LanguageOptions.FromCSharp9).Verify();\n\n    [TestMethod]\n    public void UnchangedLocalVariablesShouldBeConst_Fix() =>\n        verifier\n            .AddPaths(\"UnchangedLocalVariablesShouldBeConst.ToFix.cs\")\n            .WithCodeFixedPaths(\"UnchangedLocalVariablesShouldBeConst.Fixed.cs\")\n            .WithCodeFix<UnchangedLocalVariablesShouldBeConstCodeFix>()\n            .VerifyCodeFix();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UnconditionalJumpStatementTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class UnconditionalJumpStatementTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.UnconditionalJumpStatement>();\n\n    [TestMethod]\n    public void UnconditionalJumpStatement() =>\n        builderCS.AddPaths(\"UnconditionalJumpStatement.cs\").Verify();\n\n    [TestMethod]\n    public void UnconditionalJumpStatement_CSharpLatest() =>\n        builderCS.AddPaths(\"UnconditionalJumpStatement.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void UnconditionalJumpStatement_VB() =>\n        new VerifierBuilder<VB.UnconditionalJumpStatement>().AddPaths(\"UnconditionalJumpStatement.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UninvokedEventDeclarationTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class UninvokedEventDeclarationTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<UninvokedEventDeclaration>();\n\n    [TestMethod]\n    public void UninvokedEventDeclaration() =>\n        builder.AddPaths(\"UninvokedEventDeclaration.cs\")\n            .Verify();\n\n    [TestMethod]\n    public void UninvokedEventDeclaration_CSharpLatest() =>\n        builder.AddPaths(\"UninvokedEventDeclaration.Latest.cs\", \"UninvokedEventDeclaration.Latest.Partial.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UnnecessaryBitwiseOperationTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class UnnecessaryBitwiseOperationTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.UnnecessaryBitwiseOperation>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.UnnecessaryBitwiseOperation>();\n\n    [TestMethod]\n    public void UnnecessaryBitwiseOperation_CS() =>\n        builderCS.AddPaths(\"UnnecessaryBitwiseOperation.cs\").Verify();\n\n    [TestMethod]\n    public void UnnecessaryBitwiseOperation_CS_TopLevelStatements() =>\n        builderCS.AddPaths(\"UnnecessaryBitwiseOperation.TopLevelStatements.cs\")\n            .WithTopLevelStatements()\n            .Verify();\n\n    [TestMethod]\n    public void UnnecessaryBitwiseOperation_CS_Latest() =>\n        builderCS.AddPaths(\"UnnecessaryBitwiseOperation.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void UnnecessaryBitwiseOperation_CS_CodeFix() =>\n        builderCS.AddPaths(\"UnnecessaryBitwiseOperation.cs\")\n            .WithCodeFix<CS.UnnecessaryBitwiseOperationCodeFix>()\n            .WithCodeFixedPaths(\"UnnecessaryBitwiseOperation.Fixed.cs\")\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void UnnecessaryBitwiseOperation_VB() =>\n        builderVB.AddPaths(\"UnnecessaryBitwiseOperation.vb\").Verify();\n\n    [TestMethod]\n    public void UnnecessaryBitwiseOperation_VB_CodeFix() =>\n        builderVB.AddPaths(\"UnnecessaryBitwiseOperation.vb\")\n            .WithCodeFix<VB.UnnecessaryBitwiseOperationCodeFix>()\n            .WithCodeFixedPaths(\"UnnecessaryBitwiseOperation.Fixed.vb\")\n            .VerifyCodeFix();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UnnecessaryMathematicalComparisonTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class UnnecessaryMathematicalComparisonTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.UnnecessaryMathematicalComparison>()\n        .WithWarningsAsErrors(\"CS0652\");\n\n    [TestMethod]\n    public void UnnecessaryMathematicalComparison_CS() =>\n        builderCS.AddPaths(\"UnnecessaryMathematicalComparison.cs\").Verify();\n\n    [TestMethod]\n    public void UnnecessaryMathematicalComparison_CSharpLatest() =>\n        builderCS.AddPaths(\"UnnecessaryMathematicalComparison.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UnnecessaryUsingsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class UnnecessaryUsingsTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<UnnecessaryUsings>()\n        .AddReferences(MetadataReferenceFacade.MicrosoftWin32Primitives)\n        .AddReferences(MetadataReferenceFacade.SystemSecurityCryptography)\n        .WithWarningsAsErrors(\"CS0105\");\n\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    public void UnnecessaryUsings() =>\n        builder.AddPaths(\"UnnecessaryUsings.cs\", \"UnnecessaryUsings2.cs\", \"UnnecessaryUsingsFNRepro.cs\").WithAutogenerateConcurrentFiles(false).Verify();\n\n    [TestMethod]\n    public void UnnecessaryUsings_InheritedProperty() =>\n        builder.AddPaths(\"UnnecessaryUsings.InheritedPropertyBase.cs\", \"UnnecessaryUsings.InheritedPropertyChild.cs\", \"UnnecessaryUsings.InheritedPropertyUsage.cs\")\n            .WithAutogenerateConcurrentFiles(false)\n            .VerifyNoIssues();\n\n#if NET\n\n    [TestMethod]\n    public void UnnecessaryUsings_CSharp10_GlobalUsings() =>\n        builder.AddPaths(\"UnnecessaryUsings.CSharp10.Global.cs\", \"UnnecessaryUsings.CSharp10.Consumer.cs\").WithTopLevelStatements().WithOptions(LanguageOptions.FromCSharp10).Verify();\n\n    [TestMethod]\n    [DataRow(\"_ViewImports.cshtml\")]\n    [DataRow(\"_viewimports.cshtml\")]\n    [DataRow(\"_viEwiMpoRts.cshtml\")]\n    public void UnnecessaryUsings_RazorViewImportsCshtmlFile_NoIssueReported(string fileName) =>\n        builder\n            .AddSnippet(@\"@using System.Text.Json;\", fileName)\n            .AddReferences(NuGetMetadataReference.SystemTextJson(\"7.0.4\"))\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Product))\n            .VerifyNoIssues();\n\n    [TestMethod]\n    [DataRow(\"_Imports.razor\")]\n    [DataRow(\"_imports.razor\")]\n    [DataRow(\"_iMpoRts.razor\")]\n    public void UnnecessaryUsings_RazorImportsRazorFile_NoIssueReported(string fileName) =>\n        builder\n            .AddSnippet(@\"@using System.Text.Json;\", fileName)\n            .AddReferences(NuGetMetadataReference.SystemTextJson(\"7.0.4\"))\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Product))\n            .VerifyNoIssues();\n\n    [TestMethod]\n    [DataRow(\"RandomFile_ViewImports.cshtml\")]\n    [DataRow(\"RandomFile_Imports.cshtml\")]\n    [DataRow(\"_Imports.cshtml\")]\n    public void UnnecessaryUsings_RazorViewImportsSimilarCshtmlFile_IssuesReported(string fileName) =>\n        builder\n            .AddSnippet(\"@using System.Linq;\", \"_ViewImports.cshtml\")\n            .AddSnippet(@\"@using System.Text.Json; @* Noncompliant *@\", fileName)\n            .AddReferences(NuGetMetadataReference.SystemTextJson(\"7.0.4\"))\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Product))\n            .Verify();\n\n    [TestMethod]\n    [DataRow(\"RandomFile_ViewImports.razor\")]\n    [DataRow(\"RandomFile_Imports.razor\")]\n    [DataRow(\"_ViewImports.razor\")]\n    public void UnnecessaryUsings_RazorViewImportsSimilarRazorFile_IssuesReported(string fileName) =>\n        builder\n            .AddSnippet(\"@using System.Linq;\", \"_Imports.razor\")\n            .AddSnippet(@\"@using System.Text.Json; @* Noncompliant *@\", fileName)\n            .AddReferences(NuGetMetadataReference.SystemTextJson(\"7.0.4\"))\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Product))\n            .Verify();\n\n    [TestMethod]\n    [DataRow(\"_ViewImports.cs\")]\n    [DataRow(\"_Imports.cs\")]\n    public void UnnecessaryUsings_RazorViewImportsSimilarCSFile_IssuesReported(string fileName) =>\n        builder.AddSnippet(@\"using System.Text; // Noncompliant\", fileName).Verify();\n\n    [TestMethod]\n    public void UnnecessaryUsings_CSharp10_FileScopedNamespace() =>\n        builder.AddPaths(\"UnnecessaryUsings.CSharp10.FileScopedNamespace.cs\").WithOptions(LanguageOptions.FromCSharp10).WithConcurrentAnalysis(false).Verify();\n\n    [TestMethod]\n    public void UnnecessaryUsings_CodeFix_CSharp10_FileScopedNamespace() =>\n        builder.AddPaths(\"UnnecessaryUsings.CSharp10.FileScopedNamespace.cs\")\n            .WithOptions(LanguageOptions.FromCSharp10)\n            .WithCodeFix<UnnecessaryUsingsCodeFix>()\n            .WithCodeFixedPaths(\"UnnecessaryUsings.CSharp10.FileScopedNamespace.Fixed.cs\")\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void UnnecessaryUsings_CSharp9() =>\n        builder.AddPaths(\"UnnecessaryUsings.CSharp9.cs\").WithTopLevelStatements().Verify();\n\n    [TestMethod]\n    public void UnnecessaryUsings_TupleDeconstruct_NetCore() =>\n        builder.AddPaths(\"UnnecessaryUsings.TupleDeconstruct.NetCore.cs\").Verify();\n\n    [TestMethod]\n    public void UnnecessaryUsings_CSharp12() =>\n        builder.AddPaths(\"UnnecessaryUsings.CSharp12.cs\").WithOptions(LanguageOptions.FromCSharp12).VerifyNoIssues();\n\n#elif NETFRAMEWORK\n\n    [TestMethod]\n    public void UnnecessaryUsings_TupleDeconstruct_NetFx() =>\n        builder.AddPaths(\"UnnecessaryUsings.TupleDeconstruct.NetFx.cs\").Verify();\n\n#endif\n\n    [TestMethod]\n    public void UnnecessaryUsings_CodeFix() =>\n        builder.AddPaths(\"UnnecessaryUsings.cs\")\n            .WithCodeFix<UnnecessaryUsingsCodeFix>()\n            .WithCodeFixedPaths(\"UnnecessaryUsings.Fixed.cs\", \"UnnecessaryUsings.Fixed.Batch.cs\")\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void UnnecessaryUsings_DocumentationModeNone() =>\n        builder\n            .AddSnippet(\"\"\"\n                using System; // Noncompliant FP, used by cref https://sonarsource.atlassian.net/browse/NET-1950\n\n                namespace SonarAnalyzer.Experiments.CSharp\n                {\n                    public enum S1128\n                    {\n                        /// <summary><see cref=\"DateTime\"/></summary>\n                        DateTimeValue,\n                    }\n                }\n                \"\"\")\n            .WithOptions(ImmutableArray.Create<ParseOptions>(new CSharpParseOptions(documentationMode: DocumentationMode.None)))\n            .Verify();\n\n    [TestMethod]\n    public void EquivalentNameSyntax_Equals_Object()\n    {\n        var main = new EquivalentNameSyntax(SyntaxFactory.IdentifierName(\"Lorem\"));\n        object same = new EquivalentNameSyntax(SyntaxFactory.IdentifierName(\"Lorem\"));\n        object different = new EquivalentNameSyntax(SyntaxFactory.IdentifierName(\"Ipsum\"));\n\n        main.Equals(same).Should().BeTrue();\n        main.Equals(null).Should().BeFalse();\n        main.Equals(\"different type\").Should().BeFalse();\n        main.Equals(different).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void EquivalentNameSyntax_Equals_EquivalentNameSyntax()\n    {\n        var main = new EquivalentNameSyntax(SyntaxFactory.IdentifierName(\"Lorem\"));\n        var same = new EquivalentNameSyntax(SyntaxFactory.IdentifierName(\"Lorem\"));\n        var different = new EquivalentNameSyntax(SyntaxFactory.IdentifierName(\"Ipsum\"));\n\n        main.Equals(same).Should().BeTrue();\n        main.Equals(null).Should().BeFalse();\n        main.Equals(different).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void NamespaceComparer_MatchesAncestors_WhenDefaultEqualityDoesNot()\n    {\n        var compiler = new SnippetCompiler(\"\"\"\n            namespace System.IO\n            {\n                class C\n                {\n                    Exception e;\n                }\n            }\n            \"\"\");\n        var fromDeclaration = compiler.NamespaceSymbol(\"IO\").ContainingNamespace;\n        var fromType = compiler.Symbol<ISymbol>(compiler.Nodes<IdentifierNameSyntax>().Single(x => x.Identifier.Text == \"Exception\")).ContainingNamespace;\n\n        // Both represent \"System\" but Roslyn returns a merged namespace from the declaration chain vs a per-assembly namespace from ContainingNamespace\n        fromDeclaration.GetHashCode().Should().NotBe(fromType.GetHashCode());\n        fromDeclaration.Equals(fromType).Should().BeFalse();\n\n        NamespaceComparer.Instance.GetHashCode(fromDeclaration).Should().Be(NamespaceComparer.Instance.GetHashCode(fromType));\n        NamespaceComparer.Instance.Equals(fromDeclaration, fromType).Should().BeTrue();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UnsignedTypesUsageTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class UnsignedTypesUsageTest\n    {\n        [TestMethod]\n        public void UnsignedTypesUsage() =>\n             new VerifierBuilder<UnsignedTypesUsage>().AddPaths(\"UnsignedTypesUsage.vb\").Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UnusedPrivateMemberTest.Constructors.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Test.Rules;\n\npublic partial class UnusedPrivateMemberTest\n{\n    [TestMethod]\n    public void UnusedPrivateMember_Constructor_Accessibility() =>\n        builder.AddSnippet(@\"\npublic class PrivateConstructors\n{\n    private PrivateConstructors(int i) { var x = 5; } // Noncompliant {{Remove the unused private constructor 'PrivateConstructors'.}}\n//          ^^^^^^^^^^^^^^^^^^^\n    static PrivateConstructors() { var x = 5; }\n\n    private class InnerPrivateClass // Noncompliant\n    {\n        internal InnerPrivateClass(int i) { var x = 5; } // Noncompliant\n        protected InnerPrivateClass(string s) { var x = 5; } // Noncompliant\n        protected internal InnerPrivateClass(double d) { var x = 5; } // Noncompliant\n        public InnerPrivateClass(char c) { var x = 5; } // Noncompliant\n    }\n\n    private class OtherPrivateClass // Noncompliant\n    {\n        private OtherPrivateClass() { var x = 5; } // Noncompliant\n    }\n}\n\npublic class NonPrivateMembers\n{\n    internal NonPrivateMembers(int i) { var x = 5; }\n    protected NonPrivateMembers(string s) { var x = 5; }\n    protected internal NonPrivateMembers(double d) { var x = 5; }\n    public NonPrivateMembers(char c) { var x = 5; }\n\n    public class InnerPublicClass\n    {\n        internal InnerPublicClass(int i) { var x = 5; }\n        protected InnerPublicClass(string s) { var x = 5; }\n        protected internal InnerPublicClass(double d) { var x = 5; }\n        public InnerPublicClass(char c) { var x = 5; }\n    }\n}\n\").Verify();\n\n    [TestMethod]\n    public void UnusedPrivateMember_Constructor_DirectReferences() =>\n        builder.AddSnippet(\"\"\"\n            public abstract class PrivateConstructors\n            {\n                public class Constructor1\n                {\n                    public static readonly Constructor1 Instance = new Constructor1();\n                    private Constructor1() { var x = 5; }\n                }\n\n                public class Constructor2\n                {\n                    public Constructor2(int a) { }\n                    private Constructor2() { var x = 5; } // Compliant - FN\n                }\n\n                public class Constructor3\n                {\n                    public Constructor3(int a) : this() { }\n                    private Constructor3() { var x = 5; }\n                }\n\n                public class Constructor4\n                {\n                    static Constructor4() { var x = 5; }\n                }\n            }\n\n            \"\"\").VerifyNoIssues();\n\n    [TestMethod]\n    public void UnusedPrivateMember_Constructor_Inheritance() =>\n        builder.AddSnippet(@\"\npublic class Inheritance\n{\n    private abstract class BaseClass1\n    {\n        protected BaseClass1() { var x = 5; }\n    }\n\n    private class DerivedClass1 : BaseClass1 // Noncompliant {{Remove the unused private class 'DerivedClass1'.}}\n    {\n        public DerivedClass1() : base() { }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/1398\n    private abstract class BaseClass2\n    {\n        protected BaseClass2() { var x = 5; }\n    }\n\n    private class DerivedClass2 : BaseClass2 // Noncompliant {{Remove the unused private class 'DerivedClass2'.}}\n    {\n        public DerivedClass2() { }\n    }\n}\n\").Verify();\n\n    [TestMethod]\n    public void UnusedPrivateMember_Empty_Constructors() =>\n        builder.AddSnippet(\"\"\"\n            public class PrivateConstructors\n            {\n                private PrivateConstructors(int i) { } // Compliant, empty ctors are reported from another rule\n            }\n\n            \"\"\").VerifyNoIssues();\n\n    [TestMethod]\n    public void UnusedPrivateMember_Illegal_Interface_Constructor() =>\n        // While typing code in IDE, we can end up in a state where an interface has a constructor defined.\n        // Even though this results in a compiler error (CS0526), IDE will still trigger rules on the interface.\n        builder.AddSnippet(@\"\npublic interface IInterface\n{\n    // UnusedPrivateMember rule does not trigger AD0001 error from NullReferenceException\n    IInterface() {} // Error [CS0526]\n}\n\").Verify();\n\n    [TestMethod]\n    [DataRow(\"private\", \"Remove the unused private constructor 'Foo'.\")]\n    [DataRow(\"protected\", \"Remove unused constructor of private type 'Foo'.\")]\n    [DataRow(\"internal\", \"Remove unused constructor of private type 'Foo'.\")]\n    [DataRow(\"public\", \"Remove unused constructor of private type 'Foo'.\")]\n    public void UnusedPrivateMember_NonPrivateConstructorInPrivateClass(string accessModifier, string expectedMessage) =>\n        builder.AddSnippet($$$\"\"\"\npublic class Some\n{\n    private class Foo // Noncompliant\n    {\n        {{{accessModifier}}} Foo() // Noncompliant {{{{{expectedMessage}}}}}\n        {\n            var a = 1;\n        }\n    }\n}\n\"\"\").Verify();\n\n    [TestMethod]\n    public void UnusedPrivateMember_RecordPositionalConstructor() =>\n        builder.AddSnippet(\"\"\"\n            // https://github.com/SonarSource/sonar-dotnet/issues/5381\n            public abstract record Foo\n            {\n                Foo(string value)\n                {\n                    Value = value;\n                }\n\n                public string Value { get; }\n\n                public sealed record Bar(string Value) : Foo(Value);\n            }\n            \"\"\").WithOptions(LanguageOptions.FromCSharp9).VerifyNoIssues();\n\n    [TestMethod]\n    public void UnusedPrivateMember_NonExistentRecordPositionalConstructor() =>\n    builder.AddSnippet(@\"\npublic abstract record Foo\n{\n    public sealed record Bar(string Value) : RandomRecord(Value); // Error [CS0246, CS1729] no suitable method found to override\n}\").WithOptions(LanguageOptions.FromCSharp10).Verify();\n\n    // Tests private nested sealed class with [Export] attribute - a valid MEF pattern used in VS extensions\n    // Production example: https://github.com/NoahRic/EditorItemTemplates/blob/master/ClassifierTemplate.cs\n    [TestMethod]\n    public void UnusedPrivateMember_Constructor_MefExportOnType() =>\n        builder.AddSnippet(\"\"\"\n            using System.ComponentModel.Composition;\n\n            public interface IFormatter\n            {\n                string Format(string input);\n            }\n\n            public class FormatterContainer\n            {\n                [Export(typeof(IFormatter))]\n                private sealed class MefExportedFormatter : IFormatter // Compliant - MEF exported type\n                {\n                    private readonly string _prefix;\n\n                    MefExportedFormatter() => _prefix = \"Formatted: \"; // Compliant - MEF instantiates via reflection\n\n                    public string Format(string input) => _prefix + input;\n                }\n            }\n            \"\"\")\n            .AddReferences(MetadataReferenceFacade.SystemComponentModelComposition)\n            .VerifyNoIssues();\n\n    // Tests InheritedExport on interface - implementing classes automatically inherit the export\n    // Per MS docs: \"an interface can be decorated with an InheritedExport attribute at the interface level,\n    // and that export along with any associated metadata will be inherited by any implementing classes\"\n    // Source: https://learn.microsoft.com/en-us/dotnet/framework/mef/attributed-programming-model-overview-mef\n    [TestMethod]\n    public void UnusedPrivateMember_Constructor_MefInheritedExportOnInterface() =>\n        builder.AddSnippet(\"\"\"\n            using System.ComponentModel.Composition;\n\n            [InheritedExport(typeof(IClassifier))]\n            public interface IClassifier\n            {\n                string Classify(string input);\n            }\n\n            public class ClassifierContainer\n            {\n                private sealed class SimpleClassifier : IClassifier // Compliant - implements InheritedExport interface\n                {\n                    private readonly string _prefix;\n\n                    SimpleClassifier() => _prefix = \"Classified: \"; // Compliant - MEF instantiates via reflection\n\n                    public string Classify(string input) => _prefix + input;\n                }\n            }\n            \"\"\")\n            .AddReferences(MetadataReferenceFacade.SystemComponentModelComposition)\n            .VerifyNoIssues();\n\n    // Tests InheritedExport on base class - subclasses automatically inherit and provide the same export\n    // Per MS docs: \"a part can export itself by using the InheritedExport attribute.\n    // Subclasses of the part will inherit and provide the same export, including contract name and contract type\"\n    // Source: https://learn.microsoft.com/en-us/dotnet/framework/mef/attributed-programming-model-overview-mef\n    [TestMethod]\n    public void UnusedPrivateMember_Constructor_MefInheritedExportOnBaseClass() =>\n        builder.AddSnippet(\"\"\"\n            using System.ComponentModel.Composition;\n\n            [InheritedExport(typeof(HandlerBase))]\n            public abstract class HandlerBase\n            {\n                public abstract string Handle(string input);\n            }\n\n            public class HandlerContainer\n            {\n                private sealed class SimpleHandler : HandlerBase // Compliant - derives from InheritedExport base\n                {\n                    private readonly string _tag;\n\n                    SimpleHandler() => _tag = \"[handled] \"; // Compliant - MEF instantiates via reflection\n\n                    public override string Handle(string input) => _tag + input;\n                }\n            }\n            \"\"\")\n            .AddReferences(MetadataReferenceFacade.SystemComponentModelComposition)\n            .VerifyNoIssues();\n\n    // Tests MEF2 (System.Composition) Export attribute - same pattern as MEF1 but from the newer lightweight composition API\n    [TestMethod]\n    public void UnusedPrivateMember_Constructor_Mef2ExportOnType() =>\n        builder.AddSnippet(\"\"\"\n            using System.Composition;\n\n            public interface IProcessor\n            {\n                string Process(string input);\n            }\n\n            public class ProcessorContainer\n            {\n                [Export(typeof(IProcessor))]\n                private sealed class SimpleProcessor : IProcessor // Compliant - MEF2 exported type\n                {\n                    private readonly string _suffix;\n\n                    SimpleProcessor() => _suffix = \" [processed]\"; // Compliant - MEF2 instantiates via reflection\n\n                    public string Process(string input) => input + _suffix;\n                }\n            }\n            \"\"\")\n            .AddReferences(MetadataReferenceFacade.SystemCompositionAttributedModel)\n            .VerifyNoIssues();\n\n    // Tests custom attribute derived from ExportAttribute - MEF recognizes derived export attributes\n    // Per MS docs: custom attributes inheriting from ExportAttribute can include metadata as properties\n    // Source: https://learn.microsoft.com/en-us/dotnet/framework/mef/attributed-programming-model-overview-mef\n    [TestMethod]\n    public void UnusedPrivateMember_Constructor_MefCustomExportAttribute() =>\n        builder.AddSnippet(\"\"\"\n            using System.ComponentModel.Composition;\n\n            public class MyCustomExportAttribute : ExportAttribute { }\n\n            public class PluginContainer\n            {\n                [MyCustomExport]\n                private sealed class CustomPlugin // Compliant - custom Export-derived attribute\n                {\n                    CustomPlugin() { var x = 1; } // Compliant - MEF instantiates via reflection\n                }\n            }\n            \"\"\")\n            .AddReferences(MetadataReferenceFacade.SystemComponentModelComposition)\n            .VerifyNoIssues();\n\n    // Tests InheritedExport on generic interface - implementing classes inherit the export\n    // MEF supports generic types: https://www.codeproject.com/Articles/323919/MEF-Generics\n    [TestMethod]\n    public void UnusedPrivateMember_Constructor_MefInheritedExportOnGenericInterface() =>\n        builder.AddSnippet(\"\"\"\n            using System.ComponentModel.Composition;\n\n            [InheritedExport(typeof(IHandler<>))]\n            public interface IHandler<T>\n            {\n                void Handle(T item);\n            }\n\n            public class Container\n            {\n                private sealed class StringHandler : IHandler<string> // Compliant - implements InheritedExport generic interface\n                {\n                    StringHandler() { var x = 1; } // Compliant - MEF instantiates via reflection\n                    public void Handle(string item) { }\n                }\n            }\n            \"\"\")\n            .AddReferences(MetadataReferenceFacade.SystemComponentModelComposition)\n            .VerifyNoIssues();\n\n    // Tests InheritedExport on generic base class - derived classes inherit the export\n    [TestMethod]\n    public void UnusedPrivateMember_Constructor_MefInheritedExportOnGenericBaseClass() =>\n        builder.AddSnippet(\"\"\"\n            using System.ComponentModel.Composition;\n\n            [InheritedExport(typeof(ProcessorBase<>))]\n            public abstract class ProcessorBase<T>\n            {\n                public abstract void Process(T item);\n            }\n\n            public class Container\n            {\n                private sealed class IntProcessor : ProcessorBase<int> // Compliant - derives from InheritedExport generic base\n                {\n                    IntProcessor() { var x = 1; } // Compliant - MEF instantiates via reflection\n                    public override void Process(int item) { }\n                }\n            }\n            \"\"\")\n            .AddReferences(MetadataReferenceFacade.SystemComponentModelComposition)\n            .VerifyNoIssues();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UnusedPrivateMemberTest.Fields.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Test.Rules;\n\npublic partial class UnusedPrivateMemberTest\n{\n    [TestMethod]\n    public void UnusedPrivateMember_Field_Accessibility() =>\n        builder.AddSnippet(\"\"\"\n            public class PrivateMembers\n            {\n                private int privateField; // Noncompliant {{Remove the unused private field 'privateField'.}}\n            //  ^^^^^^^^^^^^^^^^^^^^^^^^^\n                private static int privateStaticField; // Noncompliant\n\n                private class InnerPrivateClass // Noncompliant\n                {\n                    internal int internalField; // Noncompliant\n                    protected int protectedField; // Noncompliant\n                    protected internal int protectedInternalField; // Noncompliant\n                    public int publicField; // Noncompliant\n                    internal static int internalStaticField; // Noncompliant\n                    protected static int protectedStaticField; // Noncompliant\n                    protected internal static int protectedInternalStaticField; // Noncompliant\n                    public static int publicStaticField; // Noncompliant\n                }\n            }\n\n            public class NonPrivateMembers\n            {\n                internal int internalField;\n                protected int protectedField;\n                protected internal int protectedInternalField;\n                public int publicField;\n                internal static int internalStaticField;\n                protected static int protectedStaticField;\n                protected internal static int protectedInternalStaticField;\n                public static int publicStaticField;\n\n                public class InnerPublicClass\n                {\n                    internal int internalField;\n                    protected int protectedField;\n                    protected internal int protectedInternalField;\n                    public int publicField;\n                    internal static int internalStaticField;\n                    protected static int protectedStaticField;\n                    protected internal static int protectedInternalStaticField;\n                    public static int publicStaticField;\n                }\n            }\n            \"\"\").Verify();\n\n    [TestMethod]\n    public void UnusedPrivateMember_Field_MultipleDeclarations() =>\n        builder.AddSnippet(\"\"\"\n            public class PrivateMembers\n            {\n                private int x, y, z; // Noncompliant {{Remove the unused private field 'x'.}}\n            //  ^^^^^^^^^^^^^^^^^^^^\n\n                private int a, b, c;\n            //              ^ {{Remove the unused private field 'a'.}}\n            //                    ^ @-1 {{Remove the unused private field 'c'.}}\n\n                public int Method1() => b;\n            }\n            \"\"\").Verify();\n\n    [TestMethod]\n    public void UnusedPrivateMember_Fields_DirectReferences() =>\n        builder.AddSnippet(\"\"\"\n            using System;\n\n            public class FieldUsages\n            {\n                private int field1; // Noncompliant {{Remove this unread private field 'field1' or refactor the code to use its value.}}\n                private int field2; // Noncompliant {{Remove this unread private field 'field2' or refactor the code to use its value.}}\n                private int field3; // Noncompliant {{Remove this unread private field 'field3' or refactor the code to use its value.}}\n                private int field4;\n                private int field5;\n                private int field6;\n                public int Method1()\n                {\n                    field1 = 0;\n                    this.field2 = 0;\n                    int.TryParse(\"1\", out field3);\n                    Console.Write(field4);\n                    Func<int> x = () => field5;\n                    return field6;\n                }\n\n                private int field7;\n                public int ExpressionBodyMethod() => field7;\n\n                private static int field8;\n                public int Property { get; set; } = field8;\n\n                public FieldUsages(int number) { }\n\n                private static int field9;\n                public FieldUsages() : this(field9) { }\n\n                private int field10;\n                private int field11; // Compliant nameof(field11)\n                public object Method2()\n                {\n                    var x = new[] { field10 };\n                    var name = nameof(field11);\n                    return null;\n                }\n            }\n            \"\"\").Verify();\n\n    [TestMethod]\n    public void UnusedPrivateMember_Fields_StructLayout() =>\n        builder.AddSnippet(\"\"\"\n            // https://github.com/SonarSource/sonar-dotnet/issues/6912\n            using System.Runtime.InteropServices;\n\n            public class Foo\n            {\n                [StructLayout(LayoutKind.Sequential)]\n                private struct NetResource\n                {\n                    public string LocalName; // Compliant: Unused members in a struct with StructLayout attribute are compliant\n                    public string RemoteName;\n                }\n\n                [DllImport(\"mpr.dll\")]\n                private static extern int WNetAddConnection2(NetResource netResource, string password, string username, int flags);\n\n                public void Bar()\n                {\n                    var netResource = new NetResource\n                    {\n                        RemoteName = \"foo\"\n                    };\n                    WNetAddConnection2(netResource, \"password\", \"username\", 0);\n                }\n            }\n            \"\"\").VerifyNoIssues();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UnusedPrivateMemberTest.Methods.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Test.Rules;\n\npublic partial class UnusedPrivateMemberTest\n{\n    [TestMethod]\n    public void UnusedPrivateMember_Method_Accessibility() =>\n        builder.AddSnippet(@\"\npublic class PrivateMembers\n{\n    private int PrivateMethod() { return 0; } // Noncompliant {{Remove the unused private method 'PrivateMethod'.}}\n//              ^^^^^^^^^^^^^\n    private static int PrivateStaticMethod() { return 0; } // Noncompliant\n\n    private class InnerPrivateClass // Noncompliant\n    {\n        internal int InternalMethod() { return 0; } // Noncompliant\n        protected int ProtectedMethod() { return 0; } // Noncompliant\n        protected internal int ProtectedInternalMethod() { return 0; } // Noncompliant\n        public int PublicMethod() { return 0; } // Noncompliant\n        internal static int InternalStaticMethod() { return 0; } // Noncompliant\n        protected static int ProtectedStaticMethod() { return 0; } // Noncompliant\n        protected internal static int ProtectedInternalStaticMethod() { return 0; } // Noncompliant\n        public static int PublicStaticMethod() { return 0; } // Noncompliant\n    }\n}\n\npublic class NonPrivateMembers\n{\n    internal int InternalMethod() { return 0; }\n    protected int ProtectedMethod() { return 0; }\n    protected internal int ProtectedInternalMethod() { return 0; }\n    public int PublicMethod() { return 0; }\n    internal static int InternalStaticMethod() { return 0; }\n    protected static int ProtectedStaticMethod() { return 0; }\n    protected internal static int ProtectedInternalStaticMethod() { return 0; }\n    public static int PublicStaticMethod() { return 0; }\n\n    public class InnerPublicClass\n    {\n        internal int InternalMethod() { return 0; }\n        protected int ProtectedMethod() { return 0; }\n        protected internal int ProtectedInternalMethod() { return 0; }\n        public int PublicMethod() { return 0; }\n        internal static int InternalStaticMethod() { return 0; }\n        protected static int ProtectedStaticMethod() { return 0; }\n        protected internal static int ProtectedInternalStaticMethod() { return 0; }\n        public static int PublicStaticMethod() { return 0; }\n    }\n}\n\npublic interface IInterface\n{\n    int InterfaceMethod();\n}\n\npublic class InterfaceImpl : IInterface\n{\n    int IInterface.InterfaceMethod() => 0;\n}\n\").Verify();\n\n    [TestMethod]\n    public void UnusedPrivateMember_Methods_DirectReferences() =>\n        builder.AddSnippet(\"\"\"\n            using System;\n            using System.Linq;\n            public class MethodUsages\n            {\n                private int Method1() { return 0; }\n                private int Method2() { return 0; }\n                private int Method3() { return 0; }\n                private int Method4() { return 0; }\n                private int Method5() { return 0; }\n                private int Method6() { return 0; }\n                private int Method7() { return 0; }\n                public int Test1(MethodUsages other)\n                {\n                    int i;\n                    i = Method1();\n                    i = this.Method2();\n                    Console.Write(Method3());\n                    new MethodUsages().Method4();\n                    Func<int> x = () => Method5();\n                    other.Method6();\n                    return Method7();\n                }\n\n                private int Method8() { return 0; }\n                public int ExpressionBodyMethod() => Method8();\n\n                private static int Method9() { return 0; }\n                public MethodUsages(int number) { }\n                public MethodUsages() : this(Method9()) { }\n\n                private int Method10() { return 0; }\n                private int Method11() { return 0; }\n                public object Test2()\n                {\n                    var x = new[] { Method10() };\n                    var name = nameof(Method11);\n                    return null;\n                }\n\n                private int Method12(int i) { return 0; }\n                public void Test3()\n                {\n                    new[] { 1, 2, 3 }.Select(Method12);\n                }\n            }\n\n            \"\"\").VerifyNoIssues();\n\n    [TestMethod]\n    public void UnusedPrivateMember_Methods_Main() =>\n        builder.AddSnippet(@\"\nusing System.Threading.Tasks;\npublic class NewClass1\n{\n    // See https://github.com/SonarSource/sonar-dotnet/issues/888\n    static async Task Main() { } // Compliant - valid main method since C# 7.1\n}\n\npublic class NewClass2\n{\n    static async Task<int> Main() { return 1; } // Compliant - valid main method since C# 7.1\n}\n\npublic class NewClass3\n{\n    static async Task Main(string[] args) { } // Compliant - valid main method since C# 7.1\n}\n\npublic class NewClass4\n{\n    static async Task<int> Main(string[] args) { return 1; } // Compliant - valid main method since C# 7.1\n}\n\npublic class NewClass5\n{\n    static async Task<string> Main(string[] args) { return \"\"a\"\"; } // Noncompliant\n}\n\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UnusedPrivateMemberTest.Properties.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Test.Rules;\n\npublic partial class UnusedPrivateMemberTest\n{\n    [TestMethod]\n    public void UnusedPrivateMember_Property_Accessibility() =>\n        builder.AddSnippet(@\"\npublic class PrivateMembers\n{\n    private int PrivateProperty { get; set; } // Noncompliant {{Remove the unused private property 'PrivateProperty'.}}\n//              ^^^^^^^^^^^^^^^\n    private static int PrivateStaticProperty { get; set; } // Noncompliant\n    private int this[string i] { get { return 5; } set { } } // Noncompliant\n\n    private class InnerPrivateClass // Noncompliant\n    {\n        internal int InternalProperty { get; set; } // Noncompliant\n        protected int ProtectedProperty { get; set; } // Noncompliant\n        protected internal int ProtectedInternalProperty { get; set; } // Noncompliant\n        public int PublicProperty { get; set; } // Noncompliant\n        internal static int InternalStaticProperty { get; set; } // Noncompliant\n        protected static int ProtectedStaticProperty { get; set; } // Noncompliant\n        protected internal static int ProtectedInternalStaticProperty { get; set; } // Noncompliant\n        public static int PublicStaticProperty { get; set; } // Noncompliant\n    }\n}\n\npublic class NonPrivateMembers\n{\n    internal int InternalProperty { get; set; }\n    protected int ProtectedProperty { get; set; }\n    protected internal int ProtectedInternalProperty { get; set; }\n    public int PublicProperty { get; set; }\n    internal static int InternalStaticProperty { get; set; }\n    protected static int ProtectedStaticProperty { get; set; }\n    protected internal static int ProtectedInternalStaticProperty { get; set; }\n    public static int PublicStaticProperty { get; set; }\n\n    public class InnerPublicClass\n    {\n        internal int InternalProperty { get; set; }\n        protected int ProtectedProperty { get; set; }\n        protected internal int ProtectedInternalProperty { get; set; }\n        public int PublicProperty { get; set; }\n        internal static int InternalStaticProperty { get; set; }\n        protected static int ProtectedStaticProperty { get; set; }\n        protected internal static int ProtectedInternalStaticProperty { get; set; }\n        public static int PublicStaticProperty { get; set; }\n    }\n}\n\npublic interface IInterface\n{\n    int InterfaceProperty { get; set; }\n}\n\npublic class InterfaceImpl : IInterface\n{\n    int IInterface.InterfaceProperty { get { return 0; } set { } }\n}\n\").Verify();\n\n    [TestMethod]\n    public void UnusedPrivateMember_Properties_DirectReferences() =>\n        builder.AddSnippet(\"\"\"\n            using System;\n            public class PropertyUsages\n            {\n                private int Property1 { get; set; }\n                private int Property2 { get; set; }\n                private int Property4 { get; set; }\n                private int Property5 { get; set; }\n                private int Property6 { get; set; }\n                public int Method1(PropertyUsages other)\n                {\n                    Property1 = 0;\n                    this.Property2 = 0;\n                    ((Property4)) = 0;\n                    Console.Write(Property4);\n                    new PropertyUsages().Property5 = 0;\n                    Func<int> x = () => Property5;\n                    other.Property6 = 0;\n                    return Property6;\n                }\n\n                private int Property7 { get; set; } = 0;\n                public int ExpressionBodyMethod() => Property7;\n\n                private static int Property8 { get; set; } = 0;\n                public int SomeProperty { get; set; } = Property8;\n\n                private static int Property9 { get; set; }\n                static PropertyUsages()\n                {\n                    Property9 = 0;\n                }\n                public PropertyUsages(int number) { }\n                public PropertyUsages() : this(Property9) { }\n\n                private int Property10 { get; set; }\n                private int Property11 { get; set; }\n                public object Method2()\n                {\n                    if ((Property10 = 0) == 0) { }\n                    var x = new[] { Property10 };\n                    var name = nameof(Property11);\n                    return null;\n                }\n\n                private int this[string i] { get { return 5; } set { } }\n                public void Method3()\n                {\n                    var x = this[\"5\"];\n                    this[\"5\"] = 10;\n                }\n\n                private int Property12 { get; set; } = 42; // FN\n            }\n            \"\"\").VerifyNoIssues();\n\n    [TestMethod]\n    public void UnusedPrivateMember_Properties_Accessors() =>\n        builder.AddSnippet(@\"\nusing System;\npublic class PropertyUsages\n{\n    public int AProperty { private get; set; } // Noncompliant {{Remove the unused private getter 'get_AProperty'.}}\n    public int BProperty { get; private set; } // Noncompliant {{Remove the unused private setter 'set_BProperty'.}}\n    public int CProperty { internal get; set; } // Compliant\n    public int DProperty { get; internal set; } // Compliant\n    public int EProperty { protected get; set; } // Compliant\n    public int E2Property { get; protected set; } // Compliant\n    public int FProperty { get; private set; } // Compliant\n    public int GProperty { private get; set; } // Noncompliant {{Remove the unused private getter 'get_GProperty'.}}\n    public int HProperty { get; private set; } // Noncompliant {{Remove the unused private setter 'set_HProperty'.}}\n    public int IProperty { private get; set; } // Compliant\n    public int JProperty { get; private set; } // Compliant: both read and write\n    public int KProperty { private get; set; } // Compliant: both read and write\n    public int LProperty { get; private set; } // FN: private set is used in the constructor, not necessary\n    protected int MProperty { private get; set; } // Noncompliant {{Remove the unused private getter 'get_MProperty'.}}\n\n    public PropertyUsages()\n    {\n        LProperty = 42;\n    }\n\n    public void Method()\n    {\n        FProperty = HProperty;\n        GProperty = IProperty;\n\n        JProperty = KProperty;\n        KProperty = JProperty;\n    }\n\n    public interface ISomeInterface\n    {\n        string Something { get; }\n        string SomethingElse { get; }\n    }\n\n    public class SomeClass : ISomeInterface\n    {\n        public string Something { get; private set; } // Compliant\n        public string SomethingElse { get; private set; } // Noncompliant\n\n        public void Method(string str)\n        {\n            Something = str;\n        }\n    }\n}\n\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UnusedPrivateMemberTest.Types.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Test.Rules;\n\npublic partial class UnusedPrivateMemberTest\n{\n    [TestMethod]\n    public void UnusedPrivateMember_Types_Accessibility() =>\n        builder.AddSnippet(@\"\npublic class PrivateTypes\n{\n    private class InnerPrivateClass // Noncompliant {{Remove the unused private class 'InnerPrivateClass'.}}\n    {\n        protected class ProtectedClass { } // Noncompliant\n        protected internal class ProtectedInternalClass { } // Noncompliant\n        public class PublicClass { } // Noncompliant\n    }\n\n    private class PrivateClass { } // Noncompliant\n//                ^^^^^^^^^^^^\n    internal class InternalClass { } // Noncompliant\n\n    private struct PrivateStruct { } // Noncompliant\n    internal struct InternalStruct { } // Noncompliant\n}\n\npublic class NonPrivateTypes\n{\n    protected class ProtectedClass { }\n    protected internal class ProtectedInternalClass { }\n    public class PublicClass { }\n\n    protected struct ProtectedStruct { }\n    protected internal struct ProtectedInternalStruct { }\n    public struct PublicStruct { }\n}\n\").Verify();\n\n    [TestMethod]\n    public void UnusedPrivateMember_Types_InternalsVisibleTo() =>\n        builder.AddSnippet(@\"\n[assembly:System.Runtime.CompilerServices.InternalsVisibleTo(\"\"\"\")]\npublic class PrivateTypes\n{\n    private class PrivateClass { } // Noncompliant\n    internal class InternalClass { } // Compliant, internal types are not reported when InternalsVisibleTo is present\n}\n\").Verify();\n\n    [TestMethod]\n    public void UnusedPrivateMember_Types_Internals() =>\n        builder.AddSnippet(\"\"\"\n            // https://github.com/SonarSource/sonar-dotnet/issues/1225\n            // https://github.com/SonarSource/sonar-dotnet/issues/904\n            using System;\n            public class Class1\n            {\n                public void Method1()\n                {\n                    var x = Sample.Constants.X;\n                }\n            }\n\n            public class Sample\n            {\n                internal class Constants\n                {\n                    public const int X = 5;\n                }\n            }\n            \"\"\").VerifyNoIssues();\n\n    [TestMethod]\n    public void UnusedPrivateMember_Types_DirectReferences() =>\n        builder.AddSnippet(@\"\nusing System.Linq;\npublic class PrivateTypes\n{\n    private class PrivateClass1 { }\n    private class PrivateClass2 { }\n    private class PrivateClass3 { }\n    private class PrivateClass4 { }\n    private class PrivateClass5 // When Method() is removed, this class will raise issue\n    {\n        public void Method() // Noncompliant\n        {\n            var x = new PrivateClass5();\n        }\n    }\n    public void Test1()\n    {\n        var x = new PrivateClass1();\n        var t = typeof(PrivateClass2);\n        var n = nameof(PrivateClass3);\n\n        var o = new object[0];\n        o.OfType<PrivateClass4>();\n    }\n}\n\").Verify();\n\n    [TestMethod]\n    public void UnusedPrivateMember_SupportTypeKinds() =>\n        builder.AddSnippet(@\"\npublic class PrivateTypes\n{\n    private class MyPrivateClass { } // Noncompliant\n    private struct MyPrivateStruct { } // Noncompliant\n    private enum MyPrivateEnum { } // Noncompliant\n    private interface MyPrivateInterface { } // Noncompliant\n    private delegate int MyPrivateDelegate(int x, int y); // Noncompliant\n\n    public class MyPublicClass { }\n    public struct MyPublicStruct { }\n    public enum MyPublicEnum { }\n    public interface MyPublicInterface { }\n    public delegate int MyPublicDelegate(int x, int y);\n\n    private class Something : MyPublicInterface {}\n\n    public void Foo()\n    {\n        new MyPublicClass();\n        new MyPublicStruct();\n        new MyPublicEnum();\n        new Something();\n\n        MyPublicDelegate handler = PerformCalculation;\n    }\n\n    public static int PerformCalculation(int x, int y) => x + y;\n}\n\").Verify();\n\n    // Tests that private types implementing InheritedExport interfaces are not flagged as unused\n    // Per MS docs: \"an interface can be decorated with an InheritedExport attribute at the interface level,\n    // and that export along with any associated metadata will be inherited by any implementing classes\"\n    // Source: https://learn.microsoft.com/en-us/dotnet/framework/mef/attributed-programming-model-overview-mef\n    [TestMethod]\n    public void UnusedPrivateMember_Types_MefInheritedExportOnInterfaceTypeNotRemovable() =>\n        builder.AddSnippet(\"\"\"\n            using System.ComponentModel.Composition;\n\n            [InheritedExport(typeof(IPlugin))]\n            public interface IPlugin { }\n\n            public class Outer\n            {\n                private class MyPlugin : IPlugin { } // Compliant - implements InheritedExport interface\n            }\n            \"\"\")\n            .AddReferences(MetadataReferenceFacade.SystemComponentModelComposition)\n            .VerifyNoIssues();\n\n    // Tests that private types inheriting from InheritedExport base classes are not flagged as unused\n    // Per MS docs: \"a part can export itself by using the InheritedExport attribute.\n    // Subclasses of the part will inherit and provide the same export, including contract name and contract type\"\n    // Source: https://learn.microsoft.com/en-us/dotnet/framework/mef/attributed-programming-model-overview-mef\n    [TestMethod]\n    public void UnusedPrivateMember_Types_MefInheritedExportOnBaseClassTypeNotRemovable() =>\n        builder.AddSnippet(\"\"\"\n            using System.ComponentModel.Composition;\n\n            [InheritedExport(typeof(HandlerBase))]\n            public abstract class HandlerBase { }\n\n            public class Outer\n            {\n                private class MyHandler : HandlerBase { } // Compliant - derives from InheritedExport base class\n            }\n            \"\"\")\n            .AddReferences(MetadataReferenceFacade.SystemComponentModelComposition)\n            .VerifyNoIssues();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UnusedPrivateMemberTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing FluentAssertions.Extensions;\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic partial class UnusedPrivateMemberTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<UnusedPrivateMember>();\n\n    [TestMethod]\n    public void UnusedPrivateMember_DebuggerDisplay_Attribute() =>\n        builder.AddSnippet(\"\"\"\n            // https://github.com/SonarSource/sonar-dotnet/issues/1195\n            [System.Diagnostics.DebuggerDisplay(\"{field1}\", Name = \"{Property1} {Property3}\", Type = \"{Method1()}\")]\n            public class MethodUsages\n            {\n               private int field1;\n               private int field2; // Noncompliant\n               private int Property1 { get; set; }\n               private int Property2 { get; set; } // Noncompliant\n               private int Property3 { get; set; }\n               private int Method1() { return 0; }\n               private int Method2() { return 0; } // Noncompliant\n\n               public void Method()\n               {\n                   var x = Property3;\n               }\n            }\n            \"\"\").Verify();\n\n    [TestMethod]\n    public void UnusedPrivateMember_Members_With_Attributes_Are_Not_Removable() =>\n        builder.AddSnippet(\"\"\"\n            using System;\n            public class FieldUsages\n            {\n                [Obsolete]\n                private int field1;\n\n                [Obsolete]\n                private int Property1 { get; set; }\n\n                [Obsolete]\n                private int Method1() { return 0; }\n\n                [Obsolete]\n                private class Class1 { }\n            }\n            \"\"\").VerifyNoIssues();\n\n    [TestMethod]\n    public void UnusedPrivateMember_Assembly_Level_Attributes() =>\n        builder.AddSnippet(\"\"\"\n            [assembly: System.Reflection.AssemblyCompany(Foo.Constants.AppCompany)]\n            public static class Foo\n            {\n                internal static class Constants // Compliant, detect usages from assembly level attributes.\n                {\n                    public const string AppCompany = \"foo\";\n                }\n            }\n            \"\"\").VerifyNoIssues();\n\n    [TestMethod]\n    public void UnusedPrivateMemberWithPartialClasses() =>\n        builder.AddPaths(\"UnusedPrivateMember.part1.cs\", \"UnusedPrivateMember.part2.cs\").Verify();\n\n    [TestMethod]\n    public void UnusedPrivateMember_Methods_EventHandler() =>\n        // Event handler methods are not reported because in WPF an event handler\n        // could be added through XAML and no warning will be generated if the\n        // method is removed, which could lead to serious problems that are hard\n        // to diagnose.\n        builder.AddSnippet(\"\"\"\n            using System;\n            public class NewClass\n            {\n               private void Handler(object sender, EventArgs e) { } // Compliant\n            }\n            public partial class PartialClass\n            {\n               private void Handler(object sender, EventArgs e) { } // intentional False Negative\n            }\n            \"\"\").VerifyNoIssues();\n\n    [TestMethod]\n    public void UnusedPrivateMember_Unity3D_Ignored() =>\n        builder.AddSnippet(\"\"\"\n            // https://github.com/SonarSource/sonar-dotnet/issues/159\n            public class UnityMessages1 : UnityEngine.MonoBehaviour\n            {\n                private void SomeMethod(bool hasFocus) { } // Compliant\n            }\n\n            public class UnityMessages2 : UnityEngine.ScriptableObject\n            {\n                private void SomeMethod(bool hasFocus) { } // Compliant\n            }\n\n            public class UnityMessages3 : UnityEditor.AssetPostprocessor\n            {\n                private void SomeMethod(bool hasFocus) { } // Compliant\n            }\n\n            public class UnityMessages4 : UnityEditor.AssetModificationProcessor\n            {\n                private void SomeMethod(bool hasFocus) { } // Compliant\n            }\n\n            // Unity3D does not seem to be available as a nuget package and we cannot use the original classes\n            namespace UnityEngine\n            {\n                public class MonoBehaviour { }\n                public class ScriptableObject { }\n            }\n            namespace UnityEditor\n            {\n                public class AssetPostprocessor { }\n                public class AssetModificationProcessor { }\n            }\n            \"\"\").VerifyNoIssues();\n\n    [TestMethod]\n    public void EntityFrameworkMigration_Ignored() =>\n        builder.AddSnippet(\"\"\"\n            namespace EntityFrameworkMigrations\n            {\n                using Microsoft.EntityFrameworkCore.Migrations;\n\n                public class SkipMigration : Migration\n                {\n                    private void SomeMethod(bool condition) { } // Compliant\n\n                    protected override void Up(MigrationBuilder migrationBuilder) { }\n                }\n            }\n            \"\"\")\n        .AddReferences(EntityFrameworkCoreReferences(\"7.0.14\"))\n        .VerifyNoIssues();\n\n    [TestMethod]\n    [DataRow(ProjectType.Product)]\n    [DataRow(ProjectType.Test)]\n    public void UnusedPrivateMember(ProjectType projectType) =>\n        builder.AddPaths(\"UnusedPrivateMember.cs\").AddReferences(TestCompiler.ProjectTypeReference(projectType)).Verify();\n\n    [TestMethod]\n    public void UnusedPrivateMember_CS_Latest() =>\n        builder.AddPaths(\"UnusedPrivateMember.Latest.cs\", \"UnusedPrivateMember.Latest.Partial.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .AddReferences(MetadataReferenceFacade.NetStandard21)\n            .AddReferences(MetadataReferenceFacade.MicrosoftExtensionsDependencyInjectionAbstractions)\n            .Verify();\n\n    [TestMethod]\n    public void UnusedPrivateMember_TopLevelStatements() =>\n        builder.AddPaths(\"UnusedPrivateMember.TopLevelStatements.cs\").WithTopLevelStatements().Verify();\n\n#if NET\n\n    [TestMethod]\n    public void UnusedPrivateMemeber_EntityFramework_DontRaiseOnUnusedEntityPropertiesPrivateSetters() =>\n        builder.AddSnippet(\"\"\"\n            // Repro https://github.com/SonarSource/sonar-dotnet/issues/9416\n            using Microsoft.EntityFrameworkCore;\n\n            internal class MyContext : DbContext\n            {\n                public DbSet<Blog> Blogs { get; set; }\n            }\n\n            public class Blog\n            {\n                public Blog(int id, string name)\n                {\n                    Name = name;\n                }\n\n                public int Id { get; private set; }         // Noncompliant FP\n                public string Name { get; private set; }\n            }\n            \"\"\")\n        .AddReferences(NuGetMetadataReference.MicrosoftEntityFrameworkCore(\"8.0.6\"))\n        .Verify();\n#endif\n\n    [TestMethod]\n    public void UnusedPrivateMember_CodeFix() =>\n        builder.AddPaths(\"UnusedPrivateMember.cs\")\n            .WithCodeFix<UnusedPrivateMemberCodeFix>()\n            .WithCodeFixedPaths(\"UnusedPrivateMember.Fixed.cs\", \"UnusedPrivateMember.Fixed.Batch.cs\")\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void UnusedPrivateMember_UsedInGeneratedFile() =>\n        builder.AddPaths(\"UnusedPrivateMember.CalledFromGenerated.cs\", \"UnusedPrivateMember.Generated.cs\").VerifyNoIssues();\n\n    [TestMethod]\n    public void UnusedPrivateMember_Performance() =>\n        // Once the NuGet packages are downloaded, the time to execute the analyzer on the given file is\n        // about ~1 sec. It was reduced from ~11 min by skipping Guids when processing ObjectCreationExpression.\n        // The threshold is set here to 30 seconds to avoid flaky builds due to slow build agents or network connections.\n        builder.AddPaths(\"UnusedPrivateMember.Performance.cs\")\n            .AddReferences(EntityFrameworkCoreReferences(\"5.0.12\"))   // The latest before 6.0.0 for .NET 6 that has Linq versioning collision issue\n            .Invoking(x => x.VerifyNoIssues())\n            .ExecutionTime().Should().BeLessOrEqualTo(30.Seconds());\n\n    private static ImmutableArray<MetadataReference> EntityFrameworkCoreReferences(string entityFrameworkVersion) =>\n        MetadataReferenceFacade.NetStandard\n            .Concat(NuGetMetadataReference.MicrosoftEntityFrameworkCoreSqlServer(entityFrameworkVersion))\n            .Concat(NuGetMetadataReference.MicrosoftEntityFrameworkCoreRelational(entityFrameworkVersion))\n            .ToImmutableArray();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UnusedReturnValueTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class UnusedReturnValueTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<UnusedReturnValue>();\n\n    [TestMethod]\n    public void UnusedReturnValue() =>\n        builder.AddPaths(\"UnusedReturnValue.cs\", \"UnusedReturnValue.Partial.cs\").Verify();\n\n    [TestMethod]\n    public void UnusedReturnValue_CS_Latest() =>\n        builder.AddPaths(\"UnusedReturnValue.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void UnusedReturnValue_CS_TopLevelStatements() =>\n        builder.AddPaths(\"UnusedReturnValue.TopLevelStatements.cs\").WithTopLevelStatements().WithOptions(LanguageOptions.FromCSharp10).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UnusedStringBuilderTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class UnusedStringBuilderTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.UnusedStringBuilder>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.UnusedStringBuilder>();\n\n    [TestMethod]\n    public void UnusedStringBuilder_CS() =>\n        builderCS.AddPaths(\"UnusedStringBuilder.cs\").Verify();\n\n    [TestMethod]\n    public void UnusedStringBuilder_VB() =>\n        builderVB.AddPaths(\"UnusedStringBuilder.vb\").WithOptions(LanguageOptions.FromVisualBasic14).Verify();\n\n    [TestMethod]\n    public void UnusedStringBuilder_CS_Latest() =>\n        builderCS.AddPaths(\"UnusedStringBuilder.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    [DataRow(\"\", false)]\n    [DataRow(\"sb.ToString();\", true)]\n    [DataRow(\"\"\"var a = sb.Append(\"\").Append(\"\").Append(\"\").Append(\"\").ToString().ToLower();\"\"\", true)]\n    [DataRow(\"sb.CopyTo(0, new char[1], 0, 1);\", true)]\n    [DataRow(\"sb.GetChunks();\", true)]\n    [DataRow(\"var a = sb[0];\", true)]\n    [DataRow(\"\"\"sb?.Append(\"\").ToString().ToLower();\"\"\", false)] // FP see https://github.com/SonarSource/sonar-dotnet/issues/6743\n    [DataRow(\"sb?.ToString().ToLower();\", false)] // FP\n    [DataRow(\"\"\"@sb.Append(\"\").ToString();\"\"\", true)]\n    [DataRow(\"sb.Remove(sb.Length - 1, 1);\", true)]\n    [DataRow(\"var a = sb.Length;\", true)]\n    [DataRow(\"var a = sb.Capacity;\", false)]\n    [DataRow(\"var a = sb.MaxCapacity;\", false)]\n    [DataRow(\"\"\"var a = $\"{sb} is ToStringed here\";\"\"\", true)]\n    [DataRow(\"var a = sb;\", true)]\n    public void UnusedStringBuilder_TopLevelStatements(string expression, bool compliant)\n    {\n        var code = $$\"\"\"\n            using System.Text;\n\n            var sb = new StringBuilder(); // {{(compliant ? \"Compliant\" : \"Noncompliant\")}}\n            {{expression}}\n            \"\"\";\n        var builder = builderCS.AddSnippet(code).WithTopLevelStatements();\n        if (compliant)\n        {\n            builder.VerifyNoIssues();\n        }\n        else\n        {\n            builder.Verify();\n        }\n    }\n\n    [TestMethod]\n    [DataRow(\"\", false)]\n    [DataRow(\"sb.ToString();\", true)]\n    [DataRow(\"\"\"var a = sb.Append(\"\").Append(\"\").Append(\"\").Append(\"\").ToString().ToLower();\"\"\", true)]\n    [DataRow(\"sb.CopyTo(0, new char[1], 0, 1);\", true)]\n    [DataRow(\"var a = sb[0];\", true)]\n    [DataRow(\"\"\"sb?.Append(\"\").ToString().ToLower();\"\"\", false)] // FP see https://github.com/SonarSource/sonar-dotnet/issues/6743\n    [DataRow(\"sb?.ToString();\", false)] // FP\n    [DataRow(\"\"\"@sb.Append(\"\").ToString();\"\"\", true)]\n    [DataRow(\"sb.Remove(sb.Length - 1, 1);\", true)]\n    [DataRow(\"var a = sb.Length;\", true)]\n    [DataRow(\"var a = sb.Capacity;\", false)]\n    [DataRow(\"var a = sb.MaxCapacity;\", false)]\n    [DataRow(\"\"\"var a = $\"{sb} is ToStringed here\";\"\"\", true)]\n    [DataRow(\"var a = sb;\", true)]\n#if NET\n    [DataRow(\"sb.GetChunks();\", true)]\n#endif\n    public void UnusedStringBuilder_CSExpressionsTest(string expression, bool compliant)\n    {\n        var code = $$\"\"\"\n            using System.Text;\n\n            public class MyClass\n            {\n                public void MyMethod()\n                {\n                    var sb = new StringBuilder(); // {{(compliant ? \"Compliant\" : \"Noncompliant\")}}\n                    {{expression}}\n                }\n            }\n            \"\"\";\n        var builder = builderCS.AddSnippet(code);\n        if (compliant)\n        {\n            builder.VerifyNoIssues();\n        }\n        else\n        {\n            builder.Verify();\n        }\n    }\n\n    [TestMethod]\n    [DataRow(\"\", false)]\n    [DataRow(\"sb.ToString()\", true)]\n    [DataRow(\"\"\"Dim a = sb.Append(\"\").Append(\"\").Append(\"\").Append(\"\").ToString().ToLower()\"\"\", true)]\n    [DataRow(\"sb.CopyTo(0, New Char(0) {}, 0, 1)\", true)]\n    [DataRow(\"Dim a = sb(0)\", true)]\n    [DataRow(\"\"\"sb?.Append(\"\").ToString().ToLower()\"\"\", false)] // FP see https://github.com/SonarSource/sonar-dotnet/issues/6743\n    [DataRow(\"sb?.ToString().ToLower()\", false)] // FP\n    [DataRow(\"\"\"sb.Append(\"\").ToString()\"\"\", true)]\n    [DataRow(\"sb.Remove(sb.Length - 1, 1)\", true)]\n    [DataRow(\"\"\"Dim a = $\"{sb} is ToStringed here\" \"\"\", true)]\n    [DataRow(\"Dim a = sb.Length\", true)]\n    [DataRow(\"Dim a = sb.Capacity\", false)]\n    [DataRow(\"Dim a = sb.MaxCapacity\", false)]\n    [DataRow(\"Dim a = SB.ToString()\", true)]\n    [DataRow(\"Dim a = sb.TOSTRING()\", true)]\n    [DataRow(\"Dim a = sb.LENGTH\", true)]\n    [DataRow(\"Dim a = sb\", true)]\n#if NET\n    [DataRow(\"sb.GetChunks()\", true)]\n#endif\n    public void UnusedStringBuilder_VBExpressionsTest(string expression, bool compliant)\n    {\n        var code = $$\"\"\"\n            Imports System.Text\n\n            Public Class [MyClass]\n                Public Sub MyMethod()\n                    Dim sb = New StringBuilder() ' {{(compliant ? \"Compliant\" : \"Noncompliant\")}}\n                    {{expression}}\n                End Sub\n            End Class\n            \"\"\";\n        var builder = builderVB.AddSnippet(code);\n        if (compliant)\n        {\n            builder.VerifyNoIssues();\n        }\n        else\n        {\n            builder.Verify();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UriShouldNotBeHardcodedTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class UriShouldNotBeHardcodedTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.UriShouldNotBeHardcoded>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.UriShouldNotBeHardcoded>();\n\n    [TestMethod]\n    public void UriShouldNotBeHardcoded_CS() =>\n        builderCS.AddPaths(\"UriShouldNotBeHardcoded.cs\").Verify();\n\n    [TestMethod]\n    public void UriShouldNotBeHardcoded_CS_Exceptions() =>\n        builderCS\n            .AddPaths(\"UriShouldNotBeHardcoded.Exceptions.cs\")\n            .AddReferences(MetadataReferenceFacade.SystemXml)\n            .Verify();\n\n    [TestMethod]\n    public void UriShouldNotBeHardcoded_CS_Latest() =>\n        builderCS.AddPaths(\"UriShouldNotBeHardcoded.Latest.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    [DataRow(\"3.0.20105.1\")]\n    [DataRow(TestConstants.NuGetLatestVersion)]\n    public void UriShouldNotBeHardcoded_CS_VirtualPath_AspNet(string aspNetMvcVersion) =>\n        builderCS\n            .AddPaths(\"UriShouldNotBeHardcoded.AspNet.cs\")\n            .AddReferences(MetadataReferenceFacade.SystemWeb.Concat(NuGetMetadataReference.MicrosoftAspNetMvc(aspNetMvcVersion)))\n            .WithNetFrameworkOnly()\n            .Verify();\n\n    [TestMethod]\n    [DataRow(\"2.0.4\", \"2.0.3\", \"2.1.1\")]\n    [DataRow(\"2.2.0\", \"2.2.0\", \"2.2.0\")]\n    public void UriShouldNotBeHardcoded_CS_VirtualPath_AspNetCore(string aspNetCoreMvcVersion, string aspNetCoreRoutingVersion, string netHttpHeadersVersion) =>\n        builderCS\n            .AddPaths(\"UriShouldNotBeHardcoded.AspNetCore.cs\")\n            .AddReferences(AdditionalReferences(aspNetCoreMvcVersion, aspNetCoreRoutingVersion, netHttpHeadersVersion))\n            .Verify();\n\n    [TestMethod]\n    public void UriShouldNotBeHardcoded_VB() =>\n        builderVB.AddPaths(\"UriShouldNotBeHardcoded.vb\").Verify();\n\n    private static IEnumerable<MetadataReference> AdditionalReferences(string aspNetCoreMvcVersion, string aspNetCoreRoutingVersion, string netHttpHeadersVersion) =>\n        NuGetMetadataReference.MicrosoftAspNetCoreMvcCore(aspNetCoreMvcVersion)\n            // for Controller\n            .Concat(NuGetMetadataReference.MicrosoftAspNetCoreMvcViewFeatures(aspNetCoreMvcVersion))\n            // for IActionResult\n            .Concat(NuGetMetadataReference.MicrosoftAspNetCoreMvcAbstractions(aspNetCoreMvcVersion))\n            // for IRouter and VirtualPathData\n            .Concat(NuGetMetadataReference.MicrosoftAspNetCoreRoutingAbstractions(aspNetCoreRoutingVersion))\n            // for IRouteBuilder\n            .Concat(NuGetMetadataReference.MicrosoftAspNetCoreRouting(aspNetCoreRoutingVersion))\n            .Concat(NuGetMetadataReference.MicrosoftNetHttpHeaders(netHttpHeadersVersion));\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UseAwaitableMethodTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class UseAwaitableMethodTest\n{\n    private const string EntityFrameworkVersion = \"7.0.18\";\n\n    private readonly VerifierBuilder builder = new VerifierBuilder<UseAwaitableMethod>();\n\n    [TestMethod]\n    public void UseAwaitableMethod_CS() =>\n        builder.AddPaths(\"UseAwaitableMethod.cs\").AddReferences(MetadataReferenceFacade.SystemXml).Verify();\n\n    [TestMethod]\n    public void UseAwaitableMethod_Moq() =>\n        builder.AddPaths(\"UseAwaitableMethod.Moq.cs\").AddReferences(NuGetMetadataReference.Moq(TestConstants.NuGetLatestVersion)).Verify();\n\n    [TestMethod]\n    public void UseAwaitableMethod_Sockets() =>\n        builder.AddPaths(\"UseAwaitableMethod_Sockets.cs\").AddReferences(MetadataReferenceFacade.SystemNetPrimitives).AddReferences(MetadataReferenceFacade.SystemNetSockets).Verify();\n\n    [TestMethod]\n    public void UseAwaitableMethod_CS_TopLevelStatements() =>\n        builder.AddPaths(\"UseAwaitableMethod.TopLevelStatements.cs\").WithTopLevelStatements().Verify();\n\n    [TestMethod]\n    public void UseAwaitableMethod_CS_Latest() =>\n        builder.AddPaths(\"UseAwaitableMethod.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n#if NET\n    [TestMethod]\n    public void UseAwaitableMethod_EF() =>\n        builder\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .AddReferences([CoreMetadataReference.SystemComponentModelTypeConverter, CoreMetadataReference.SystemDataCommon])\n            .AddReferences(NuGetMetadataReference.MicrosoftEntityFrameworkCore(EntityFrameworkVersion))\n            .AddReferences(NuGetMetadataReference.MicrosoftEntityFrameworkCoreRelational(EntityFrameworkVersion))\n            .AddReferences(NuGetMetadataReference.MicrosoftEntityFrameworkCoreSqlServer(EntityFrameworkVersion))\n            .AddPaths(\"UseAwaitableMethod_EF.cs\")\n            .Verify();\n#endif\n\n    [TestMethod]\n    public void UseAwaitableMethod_MongoDb() =>\n        builder.AddPaths(\"UseAwaitableMethod_MongoDBDriver.cs\").AddReferences(NuGetMetadataReference.MongoDBDriver()).WithOptions(LanguageOptions.CSharpLatest).VerifyNoIssues();\n\n    // Starting from FluentValidation 12, the library support only net8 and newer\n    [TestMethod]\n    public void UseAwaitableMethod_FluentValidation11() =>\n        builder.AddPaths(\"UseAwaitableMethod_FluentValidation.cs\").AddReferences(NuGetMetadataReference.FluentValidation(\"11.11.0\")).Verify();\n\n    [TestMethod]\n    public void UseAwaitableMethod_FluentValidationLatest() =>\n        builder.AddPaths(\"UseAwaitableMethod_FluentValidation.cs\").AddReferences(NuGetMetadataReference.FluentValidation()).WithNetOnly().Verify();\n\n    [TestMethod]\n    public void UseAwaitableMethod_DbDataReader() =>\n        builder.AddPaths(\"UseAwaitableMethod_DbDataReader.cs\").AddReferences(MetadataReferenceFacade.SystemData).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UseCharOverloadOfStringMethodsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class UseCharOverloadOfStringMethodsTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.UseCharOverloadOfStringMethods>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.UseCharOverloadOfStringMethods>();\n\n#if NETFRAMEWORK\n\n    [TestMethod]\n    public void UseCharOverloadOfStringMethods_CS() =>\n        builderCS.AddPaths(\"UseCharOverloadOfStringMethods.Framework.cs\").Verify();\n\n    [TestMethod]\n    public void UseCharOverloadOfStringMethods_VB() =>\n        builderVB.AddPaths(\"UseCharOverloadOfStringMethods.Framework.vb\").VerifyNoIssues();\n\n#else\n\n    [TestMethod]\n    public void UseCharOverloadOfStringMethods_CS() =>\n        builderCS.AddPaths(\"UseCharOverloadOfStringMethods.cs\").Verify();\n\n    [TestMethod]\n    public void UseCharOverloadOfStringMethods_CS_Latest() =>\n        builderCS.AddPaths(\"UseCharOverloadOfStringMethods.Latest.cs\")\n        .WithOptions(LanguageOptions.CSharpLatest)\n        .Verify();\n\n    [TestMethod]\n    public void UseCharOverloadOfStringMethods_VB() =>\n        builderVB.AddPaths(\"UseCharOverloadOfStringMethods.vb\").Verify();\n\n    [TestMethod]\n    public void UseCharOverloadOfStringMethods_CS_Fix() =>\n        builderCS\n        .WithCodeFix<CS.UseCharOverloadOfStringMethodsCodeFix>()\n        .AddPaths(\"UseCharOverloadOfStringMethods.ToFix.cs\")\n        .WithCodeFixedPaths(\"UseCharOverloadOfStringMethods.Fixed.cs\")\n        .VerifyCodeFix();\n\n#endif\n\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UseConstantLoggingTemplateTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class UseConstantLoggingTemplateTest\n{\n    private readonly VerifierBuilder builder = CreateVerifier<CS.UseConstantLoggingTemplate>();\n\n    [TestMethod]\n    public void UseConstantLoggingTemplate_CS() =>\n        builder.AddPaths(\"UseConstantLoggingTemplate.cs\").Verify();\n\n    [TestMethod]\n    [DataRow(\"Debug\")]\n    [DataRow(\"Debug\")]\n    [DataRow(\"Error\")]\n    [DataRow(\"Fatal\")]\n    [DataRow(\"Info\")]\n    [DataRow(\"Trace\")]\n    [DataRow(\"Warn\")]\n    public void UseConstantLoggingTemplate_CastleCoreLogging_CS(string methodName) =>\n        builder.AddSnippet($$\"\"\"\n            using Castle.Core.Logging;\n\n            public class Program\n            {\n                public void Method(ILogger logger, int arg)\n                {\n                    logger.{{methodName}}(\"Message\");            // Compliant\n                    logger.{{methodName}}($\"{arg}\");             // Noncompliant\n                    logger.{{methodName}}Format(\"{Arg}\", arg);   // Compliant\n                    logger.{{methodName}}Format($\"{arg}\");       // Noncompliant\n                }\n            }\n            \"\"\").Verify();\n\n    [TestMethod]\n    [DataRow(\"Debug\")]\n    [DataRow(\"Error\")]\n    [DataRow(\"Fatal\")]\n    [DataRow(\"Info\")]\n    [DataRow(\"Warn\")]\n    public void UseConstantLoggingTemplate_Log4Net_CS(string methodName) =>\n        builder.AddSnippet($$\"\"\"\n            using System;\n            using log4net;\n\n            public class Program\n            {\n                public void Method(ILog logger, int arg)\n                {\n                    logger.{{methodName}}(\"Message\");               // Compliant\n                    logger.{{methodName}}($\"{arg}\");                // Noncompliant\n                    logger.{{methodName}}Format(\"Arg: {0}\", arg);   // Compliant\n                    logger.{{methodName}}Format($\"{arg}\");          // Noncompliant\n                }\n\n                //https://github.com/SonarSource/sonar-dotnet/issues/9547\n                void Repro_9547(ILog logger, string filePath, Exception ex)\n                {\n                  logger.{{methodName}}($\"Error while loading file '{filePath}'!\", ex); // Compliant\n                }\n            }\n            \"\"\").Verify();\n\n    [TestMethod]\n    [DataRow(\"Log\", \"LogLevel.Warning,\")]\n    [DataRow(\"LogCritical\")]\n    [DataRow(\"LogDebug\")]\n    [DataRow(\"LogError\")]\n    [DataRow(\"LogInformation\")]\n    [DataRow(\"LogTrace\")]\n    [DataRow(\"LogWarning\")]\n    public void UseConstantLoggingTemplate_MicrosoftExtensionsLogging_CS(string methodName, string logLevel = \"\") =>\n        builder.AddSnippet($$\"\"\"\n            using Microsoft.Extensions.Logging;\n\n            public class Program\n            {\n                public void Method(ILogger logger, int arg)\n                {\n                    logger.{{methodName}}({{logLevel}} \"Message\");    // Compliant\n                    logger.{{methodName}}({{logLevel}} $\"{arg}\");     // Noncompliant\n                }\n            }\n            \"\"\").Verify();\n\n    [TestMethod]\n    [DataRow(\"ConditionalDebug\")]\n    [DataRow(\"ConditionalTrace\")]\n    [DataRow(\"Debug\")]\n    [DataRow(\"Error\")]\n    [DataRow(\"Fatal\")]\n    [DataRow(\"Info\")]\n    [DataRow(\"Log\", \"LogLevel.Warn,\")]\n    [DataRow(\"Trace\")]\n    [DataRow(\"Warn\")]\n    public void UseConstantLoggingTemplate_NLog_CS(string methodName, string logLevel = \"\") =>\n        builder.AddSnippet($$\"\"\"\n            using NLog;\n\n            public class Program\n            {\n                public void Method(ILogger logger, int arg)\n                {\n                    logger.{{methodName}}({{logLevel}} \"Message\");       // Compliant\n                    logger.{{methodName}}({{logLevel}} $\"{arg}\");        // Noncompliant\n                }\n            }\n            \"\"\").Verify();\n\n    public void UseConstantLoggingTemplate_NLog_AdditionalLoggers_CS() =>\n        builder.AddSnippet(\"\"\"\n            using NLog;\n\n            public class Program\n            {\n                public void Method(ILoggerBase logger, NullLogger nullLogger, int arg)\n                {\n                    logger.Log(LogLevel.Warn, \"Message\");       // Compliant\n                    logger.Log(LogLevel.Warn, $\"{arg}\");        // Noncompliant\n\n                    nullLogger.Log(LogLevel.Warn, \"Message\");   // Compliant\n                    nullLogger.Log(LogLevel.Warn, $\"{arg}\");    // Noncompliant\n                }\n            }\n            \"\"\").Verify();\n\n    [TestMethod]\n    [DataRow(\"Debug\")]\n    [DataRow(\"Error\")]\n    [DataRow(\"Fatal\")]\n    [DataRow(\"Information\")]\n    [DataRow(\"Verbose\")]\n    [DataRow(\"Warning\")]\n    public void UseConstantLoggingTemplate_Serilog_CS(string methodName) =>\n        builder.AddSnippet($$\"\"\"\n            using Serilog;\n\n            public class Program\n            {\n                public void Method(ILogger logger, int arg)\n                {\n                    logger.{{methodName}}(\"Message without argument\");             // Compliant\n                    logger.{{methodName}}(\"The argument is {@Argument}\", arg);     // Compliant\n                    logger.{{methodName}}($\"The argument is {arg}\");               // Noncompliant\n\n                    Log.{{methodName}}(\"Message without argument\");                // Compliant\n                    Log.{{methodName}}(\"The argument is {@Argument}\", arg);        // Compliant\n                    Log.{{methodName}}($\"The argument is {arg}\");                  // Noncompliant\n                }\n            }\n            \"\"\").Verify();\n\n    private static VerifierBuilder CreateVerifier<TAnalyzer>()\n        where TAnalyzer : DiagnosticAnalyzer, new() =>\n        new VerifierBuilder<TAnalyzer>()\n            .AddReferences(NuGetMetadataReference.MicrosoftExtensionsLoggingPackages(TestConstants.NuGetLatestVersion))\n            .AddReferences(NuGetMetadataReference.CastleCore(TestConstants.NuGetLatestVersion))\n            .AddReferences(NuGetMetadataReference.Serilog())\n            .AddReferences(NuGetMetadataReference.Log4Net(\"2.0.8\", \"net45-full\"))\n            .AddReferences(NuGetMetadataReference.NLog());\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UseConstantsWhereAppropriateTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class UseConstantsWhereAppropriateTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<UseConstantsWhereAppropriate>();\n\n        [TestMethod]\n        public void UseConstantsWhereAppropriate() =>\n             builder.AddPaths(\"UseConstantsWhereAppropriate.cs\").Verify();\n\n        [TestMethod]\n        public void UseConstantsWhereAppropriate_CSharp11() =>\n             builder.AddPaths(\"UseConstantsWhereAppropriate.CSharp11.cs\").WithOptions(LanguageOptions.FromCSharp11).Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UseCurlyBracesTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class UseCurlyBracesTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<UseCurlyBraces>();\n\n        [TestMethod]\n        public void UseCurlyBraces() =>\n            builder.AddPaths(\"UseCurlyBraces.cs\").Verify();\n\n        [TestMethod]\n        public void UseCurlyBraces_FromCSharp7() =>\n            builder.AddPaths(\"UseCurlyBraces.CSharp7.cs\")\n                .WithOptions(LanguageOptions.FromCSharp7)\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UseDateTimeOffsetInsteadOfDateTimeTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class UseDateTimeOffsetInsteadOfDateTimeTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.UseDateTimeOffsetInsteadOfDateTime>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.UseDateTimeOffsetInsteadOfDateTime>();\n\n    [TestMethod]\n    public void UseDateTimeInsteadOfDateTimeOffset_CS() =>\n        builderCS.AddPaths(\"UseDateTimeOffsetInsteadOfDateTime.cs\").Verify();\n\n#if NET\n\n    [TestMethod]\n    public void UseDateTimeInsteadOfDateTimeOffset_CSharp9() =>\n        builderCS.AddPaths(\"UseDateTimeOffsetInsteadOfDateTime.CSharp9.cs\").WithTopLevelStatements().Verify();\n\n    [TestMethod]\n    public void UseDateTimeInsteadOfDateTimeOffset_VB_Net() =>\n        builderVB.AddPaths(\"UseDateTimeOffsetInsteadOfDateTime.Net.vb\").Verify();\n\n#endif\n\n    [TestMethod]\n    public void UseDateTimeInsteadOfDateTimeOffset_VB() =>\n        builderVB.AddPaths(\"UseDateTimeOffsetInsteadOfDateTime.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UseFindSystemTimeZoneByIdTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class UseFindSystemTimeZoneByIdTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.UseFindSystemTimeZoneById>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.UseFindSystemTimeZoneById>();\n\n#if NET\n\n    [TestMethod]\n    public void UseFindSystemTimeZoneById_Net_CS() =>\n        builderCS.AddReferences(NuGetMetadataReference.TimeZoneConverter())\n            .AddPaths(\"UseFindSystemTimeZoneById.Net.cs\")\n            .Verify();\n\n    [TestMethod]\n    public void UseFindSystemTimeZoneById_Net_VB() =>\n        builderVB.AddReferences(NuGetMetadataReference.TimeZoneConverter())\n            .AddPaths(\"UseFindSystemTimeZoneById.Net.vb\")\n            .Verify();\n\n    [TestMethod]\n    public void UseFindSystemTimeZoneById_Net_WithoutReference_DoesNotRaise_CS() =>\n        builderCS.AddPaths(\"UseFindSystemTimeZoneById.Net.cs\")\n            .WithErrorBehavior(CompilationErrorBehavior.Ignore)\n            .VerifyNoIssues();\n\n    [TestMethod]\n    public void UseFindSystemTimeZoneById_Net_WithoutReference_DoesNotRaise_VB() =>\n        builderVB.AddPaths(\"UseFindSystemTimeZoneById.Net.vb\")\n            .WithErrorBehavior(CompilationErrorBehavior.Ignore)\n            .VerifyNoIssues();\n\n#else\n\n    [TestMethod]\n    public void UseFindSystemTimeZoneById_CS() =>\n        builderCS.AddReferences(NuGetMetadataReference.TimeZoneConverter())\n            .AddPaths(\"UseFindSystemTimeZoneById.cs\").VerifyNoIssues();\n\n    [TestMethod]\n    public void UseFindSystemTimeZoneById_VB() =>\n        builderVB.AddReferences(NuGetMetadataReference.TimeZoneConverter())\n            .AddPaths(\"UseFindSystemTimeZoneById.vb\").VerifyNoIssues();\n\n#endif\n\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UseGenericEventHandlerInstancesTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class UseGenericEventHandlerInstancesTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<UseGenericEventHandlerInstances>();\n\n        [TestMethod]\n        public void UseGenericEventHandlerInstances() =>\n            builder.AddPaths(\"UseGenericEventHandlerInstances.cs\")\n                .Verify();\n\n        [TestMethod]\n        public void UseGenericEventHandlerInstances_CSharp9() =>\n            builder.AddPaths(\"UseGenericEventHandlerInstances.CSharp9.cs\")\n                .WithOptions(LanguageOptions.FromCSharp9)\n                .Verify();\n\n        [TestMethod]\n        public void UseGenericEventHandlerInstances_CSharp11() =>\n            builder.AddPaths(\"UseGenericEventHandlerInstances.CSharp11.cs\")\n                .WithOptions(LanguageOptions.FromCSharp11)\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UseGenericWithRefParametersTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class UseGenericWithRefParametersTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<UseGenericWithRefParameters>();\n\n    [TestMethod]\n    public void UseGenericWithRefParameters() =>\n        builder.AddPaths(\"UseGenericWithRefParameters.cs\").Verify();\n\n    [TestMethod]\n    public void UseGenericWithRefParameters_InvalidCode() =>\n        builder.AddSnippet(\"\"\"\n            public void (ref object o1)\n            {\n            }\n            \"\"\")\n            .VerifyNoIssuesIgnoreErrors();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UseIFormatProviderForParsingDateAndTimeTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Globalization;\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class UseIFormatProviderForParsingDateAndTimeTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.UseIFormatProviderForParsingDateAndTime>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.UseIFormatProviderForParsingDateAndTime>();\n\n    [TestMethod]\n    public void UseIFormatProviderForParsingDateAndTime_CS() =>\n        builderCS.AddPaths(\"UseIFormatProviderForParsingDateAndTime.cs\").Verify();\n\n    [TestMethod]\n    public void UseIFormatProviderForParsingDateAndTime_VB() =>\n        builderVB.AddPaths(\"UseIFormatProviderForParsingDateAndTime.vb\").Verify();\n\n#if NET\n\n    [TestMethod]\n    [DataRow(nameof(DateTime), nameof(DateTimeStyles))]\n    [DataRow(nameof(DateTimeOffset), nameof(DateTimeStyles))]\n    [DataRow(nameof(TimeSpan), nameof(TimeSpanStyles))]\n    [DataRow(nameof(DateOnly), nameof(DateTimeStyles))]\n    [DataRow(nameof(TimeOnly), nameof(DateTimeStyles))]\n    public void UseIFormatProviderForParsingDateAndTime__MethodOverloads_CS(string temporalTypeName, string styleTypeName) =>\n        builderCS.AddSnippet($$$\"\"\"\nusing System;\nusing System.Globalization;\n\nclass Test\n{\n    void ParseOverloads()\n    {\n        {{{temporalTypeName}}}.Parse(\"01/02/2000\");                                           // Noncompliant\n\n        {{{temporalTypeName}}}.Parse(\"01/02/2000\", null);                                     // Noncompliant\n        {{{temporalTypeName}}}.Parse(\"01/02/2000\", CultureInfo.InvariantCulture);             // Compliant\n\n        {{{temporalTypeName}}}.Parse(\"01/02/2000\".AsSpan(), null);                            // Noncompliant\n        {{{temporalTypeName}}}.Parse(\"01/02/2000\".AsSpan(), CultureInfo.InvariantCulture);    // Compliant\n\n        {{{temporalTypeName}}}.Parse(\"01/02/2000\", null);                                     // Noncompliant\n        {{{temporalTypeName}}}.Parse(\"01/02/2000\", CultureInfo.InvariantCulture);             // Compliant\n\n        {{{temporalTypeName}}}.Parse(\"01/02/2000\".AsSpan(), null);                            // Noncompliant\n        {{{temporalTypeName}}}.Parse(\"01/02/2000\".AsSpan(), CultureInfo.InvariantCulture);    // Compliant\n    }\n\n    void ParseExactOverloads()\n    {\n        {{{temporalTypeName}}}.ParseExact(\"01/02/2000\", \"dd/MM/yyyy\", null);                                                                           // Noncompliant\n        {{{temporalTypeName}}}.ParseExact(\"01/02/2000\", \"dd/MM/yyyy\", CultureInfo.InvariantCulture);                                                   // Compliant\n\n        {{{temporalTypeName}}}.ParseExact(\"01/02/2000\".AsSpan(), \"dd/MM/yyyy\".AsSpan(), null);                                                         // Noncompliant\n        {{{temporalTypeName}}}.ParseExact(\"01/02/2000\".AsSpan(), \"dd/MM/yyyy\".AsSpan(), CultureInfo.InvariantCulture);                                 // Compliant\n\n        {{{temporalTypeName}}}.ParseExact(\"01/02/2000\", \"dd/MM/yyyy\", null, {{{styleTypeName}}}.None);                                                 // Noncompliant\n        {{{temporalTypeName}}}.ParseExact(\"01/02/2000\", \"dd/MM/yyyy\", CultureInfo.InvariantCulture, {{{styleTypeName}}}.None);                         // Compliant\n\n        {{{temporalTypeName}}}.ParseExact(\"01/02/2000\", new[] { \"dd/MM/yyyy\", \"dd MM yyyy\" }, null, {{{styleTypeName}}}.None);                         // Noncompliant\n        {{{temporalTypeName}}}.ParseExact(\"01/02/2000\", new[] { \"dd/MM/yyyy\", \"dd MM yyyy\" }, CultureInfo.InvariantCulture, {{{styleTypeName}}}.None); // Compliant\n    }\n\n    void TryParseOverloads()\n    {\n        {{{temporalTypeName}}} parsedDate;\n\n        {{{temporalTypeName}}}.TryParse(\"01/02/2000\", out parsedDate);                                          // Noncompliant\n        {{{temporalTypeName}}}.TryParse(\"01/02/2000\".AsSpan(), out parsedDate);                                 // Noncompliant\n\n        {{{temporalTypeName}}}.TryParse(\"01/02/2000\", null, out parsedDate);                                    // Noncompliant\n        {{{temporalTypeName}}}.TryParse(\"01/02/2000\", CultureInfo.InvariantCulture, out parsedDate);            // Compliant\n\n        {{{temporalTypeName}}}.TryParse(\"01/02/2000\".AsSpan(), null, out parsedDate);                           // Noncompliant\n        {{{temporalTypeName}}}.TryParse(\"01/02/2000\".AsSpan(), CultureInfo.InvariantCulture, out parsedDate);   // Compliant\n    }\n\n    void TryParseExactOverloads()\n    {\n        {{{temporalTypeName}}} parsedDate;\n\n        {{{temporalTypeName}}}.TryParseExact(\"01/02/2000\", \"dd/MM/yyyy\", null, {{{styleTypeName}}}.None, out parsedDate);                                                              // Noncompliant\n        {{{temporalTypeName}}}.TryParseExact(\"01/02/2000\", \"dd/MM/yyyy\", CultureInfo.InvariantCulture, {{{styleTypeName}}}.None, out parsedDate);                                      // Compliant\n\n        {{{temporalTypeName}}}.TryParseExact(\"01/02/2000\".AsSpan(), \"dd/MM/yyyy\", null, {{{styleTypeName}}}.None, out parsedDate);                                                     // Noncompliant\n        {{{temporalTypeName}}}.TryParseExact(\"01/02/2000\".AsSpan(), \"dd/MM/yyyy\", CultureInfo.InvariantCulture, {{{styleTypeName}}}.None, out parsedDate);                             // Compliant\n\n        {{{temporalTypeName}}}.TryParseExact(\"01/02/2000\", new[] { \"dd/MM/yyyy\", \"dd MM yyyy\" }, null, {{{styleTypeName}}}.None, out parsedDate);                                      // Noncompliant\n        {{{temporalTypeName}}}.TryParseExact(\"01/02/2000\", new[] { \"dd/MM/yyyy\", \"dd MM yyyy\" }, CultureInfo.InvariantCulture, {{{styleTypeName}}}.None, out parsedDate);              // Compliant\n\n        {{{temporalTypeName}}}.TryParseExact(\"01/02/2000\".AsSpan(), new[] { \"dd/MM/yyyy\", \"dd MM yyyy\" }, null, {{{styleTypeName}}}.None, out parsedDate);                             // Noncompliant\n        {{{temporalTypeName}}}.TryParseExact(\"01/02/2000\".AsSpan(), new[] { \"dd/MM/yyyy\", \"dd MM yyyy\" }, CultureInfo.InvariantCulture, {{{styleTypeName}}}.None, out parsedDate);     // Compliant\n    }\n}\n\"\"\").Verify();\n\n    [TestMethod]\n    [DataRow(nameof(DateTime), nameof(DateTimeStyles))]\n    [DataRow(nameof(DateTimeOffset), nameof(DateTimeStyles))]\n    [DataRow(nameof(TimeSpan), nameof(TimeSpanStyles))]\n    [DataRow(nameof(DateOnly), nameof(DateTimeStyles))]\n    [DataRow(nameof(TimeOnly), nameof(DateTimeStyles))]\n    public void UseIFormatProviderForParsingDateAndTime__MethodOverloads_VB(string temporalTypeName, string styleTypeName) =>\n        builderVB.AddSnippet($$$\"\"\"\nImports System.Globalization\n\nClass Test\n    Sub ParseOverloads()\n        {{{temporalTypeName}}}.Parse(\"01/02/2000\")                                           ' Noncompliant\n\n        {{{temporalTypeName}}}.Parse(\"01/02/2000\", Nothing)                                  ' Noncompliant\n        {{{temporalTypeName}}}.Parse(\"01/02/2000\", CultureInfo.InvariantCulture)             ' Compliant\n\n        {{{temporalTypeName}}}.Parse(\"01/02/2000\".AsSpan(), Nothing)                         ' Noncompliant\n        {{{temporalTypeName}}}.Parse(\"01/02/2000\".AsSpan(), CultureInfo.InvariantCulture)    ' Compliant\n\n        {{{temporalTypeName}}}.Parse(\"01/02/2000\", Nothing)                                  ' Noncompliant\n        {{{temporalTypeName}}}.Parse(\"01/02/2000\", CultureInfo.InvariantCulture)             ' Compliant\n\n        {{{temporalTypeName}}}.Parse(\"01/02/2000\".AsSpan(), Nothing)                         ' Noncompliant\n        {{{temporalTypeName}}}.Parse(\"01/02/2000\".AsSpan(), CultureInfo.InvariantCulture)    ' Compliant\n    End Sub\n\n    Sub ParseExactOverloads()\n        {{{temporalTypeName}}}.ParseExact(\"01/02/2000\", \"dd/MM/yyyy\", Nothing)                                                                ' Noncompliant\n        {{{temporalTypeName}}}.ParseExact(\"01/02/2000\", \"dd/MM/yyyy\", CultureInfo.InvariantCulture)                                           ' Compliant\n\n        {{{temporalTypeName}}}.ParseExact(\"01/02/2000\".AsSpan(), \"dd/MM/yyyy\".AsSpan(), Nothing)                                              ' Noncompliant\n        {{{temporalTypeName}}}.ParseExact(\"01/02/2000\".AsSpan(), \"dd/MM/yyyy\".AsSpan(), CultureInfo.InvariantCulture)                         ' Compliant\n\n        {{{temporalTypeName}}}.ParseExact(\"01/02/2000\", \"dd/MM/yyyy\", Nothing, {{{styleTypeName}}}.None)                                      ' Noncompliant\n        {{{temporalTypeName}}}.ParseExact(\"01/02/2000\", \"dd/MM/yyyy\", CultureInfo.InvariantCulture, {{{styleTypeName}}}.None)                 ' Compliant\n\n        {{{temporalTypeName}}}.ParseExact(\"01/02/2000\", {\"dd/MM/yyyy\", \"dd MM yyyy\"}, Nothing, {{{styleTypeName}}}.None)                      ' Noncompliant\n        {{{temporalTypeName}}}.ParseExact(\"01/02/2000\", {\"dd/MM/yyyy\", \"dd MM yyyy\"}, CultureInfo.InvariantCulture, {{{styleTypeName}}}.None) ' Compliant\n    End Sub\n\n    Sub TryParseOverloads()\n        Dim parsedDate As {{{temporalTypeName}}}\n\n        {{{temporalTypeName}}}.TryParse(\"01/02/2000\", parsedDate)                                        ' Noncompliant\n        {{{temporalTypeName}}}.TryParse(\"01/02/2000\".AsSpan(), parsedDate)                               ' Noncompliant\n\n        {{{temporalTypeName}}}.TryParse(\"01/02/2000\", Nothing, parsedDate)                               ' Noncompliant\n        {{{temporalTypeName}}}.TryParse(\"01/02/2000\", CultureInfo.InvariantCulture, parsedDate)          ' Compliant\n\n        {{{temporalTypeName}}}.TryParse(\"01/02/2000\".AsSpan(), Nothing, parsedDate)                      ' Noncompliant\n        {{{temporalTypeName}}}.TryParse(\"01/02/2000\".AsSpan(), CultureInfo.InvariantCulture, parsedDate) ' Compliant\n    End Sub\n\n    Sub TryParseExactOverloads()\n        Dim parsedDate As {{{temporalTypeName}}}\n\n        {{{temporalTypeName}}}.TryParseExact(\"01/02/2000\", \"dd/MM/yyyy\", Nothing, {{{styleTypeName}}}.None, parsedDate)                                                ' Noncompliant\n        {{{temporalTypeName}}}.TryParseExact(\"01/02/2000\", \"dd/MM/yyyy\", CultureInfo.InvariantCulture, {{{styleTypeName}}}.None, parsedDate)                           ' Compliant\n\n        {{{temporalTypeName}}}.TryParseExact(\"01/02/2000\".AsSpan(), \"dd/MM/yyyy\", Nothing, {{{styleTypeName}}}.None, parsedDate)                                       ' Noncompliant\n        {{{temporalTypeName}}}.TryParseExact(\"01/02/2000\".AsSpan(), \"dd/MM/yyyy\", CultureInfo.InvariantCulture, {{{styleTypeName}}}.None, parsedDate)                  ' Compliant\n\n        {{{temporalTypeName}}}.TryParseExact(\"01/02/2000\", {\"dd/MM/yyyy\", \"dd MM yyyy\"}, Nothing, {{{styleTypeName}}}.None, parsedDate)                                ' Noncompliant\n        {{{temporalTypeName}}}.TryParseExact(\"01/02/2000\", {\"dd/MM/yyyy\", \"dd MM yyyy\"}, CultureInfo.InvariantCulture, {{{styleTypeName}}}.None, parsedDate)           ' Compliant\n\n        {{{temporalTypeName}}}.TryParseExact(\"01/02/2000\".AsSpan(), {\"dd/MM/yyyy\", \"dd MM yyyy\"}, Nothing, {{{styleTypeName}}}.None, parsedDate)                       ' Noncompliant\n        {{{temporalTypeName}}}.TryParseExact(\"01/02/2000\".AsSpan(), {\"dd/MM/yyyy\", \"dd MM yyyy\"}, CultureInfo.InvariantCulture, {{{styleTypeName}}}.None, parsedDate)  ' Compliant\n    End Sub\nEnd Class\n\"\"\").Verify();\n\n#endif\n\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UseIndexingInsteadOfLinqMethodsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class UseIndexingInsteadOfLinqMethodsTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.UseIndexingInsteadOfLinqMethods>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.UseIndexingInsteadOfLinqMethods>();\n\n    [TestMethod]\n    public void UseIndexingInsteadOfLinqMethods_CS() =>\n        builderCS.AddPaths(\"UseIndexingInsteadOfLinqMethods.cs\").Verify();\n\n    [TestMethod]\n    public void UseIndexingInsteadOfLinqMethods_VB() =>\n        builderVB.AddPaths(\"UseIndexingInsteadOfLinqMethods.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UseLambdaParameterInConcurrentDictionaryTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class UseLambdaParameterInConcurrentDictionaryTest\n{\n    [TestMethod]\n    public void UseLambdaParameterInConcurrentDictionary_CSharp8() =>\n        new VerifierBuilder<CS.UseLambdaParameterInConcurrentDictionary>().AddPaths(\"UseLambdaParameterInConcurrentDictionary.CSharp8.cs\")\n            .AddReferences(MetadataReferenceFacade.SystemCollections)\n            .WithOptions(LanguageOptions.FromCSharp8)\n            .Verify();\n\n    [TestMethod]\n    public void UseLambdaParameterInConcurrentDictionary_VB() =>\n        new VerifierBuilder<VB.UseLambdaParameterInConcurrentDictionary>().AddPaths(\"UseLambdaParameterInConcurrentDictionary.vb\")\n            .WithOptions(LanguageOptions.FromVisualBasic14)\n            .AddReferences(MetadataReferenceFacade.SystemCollections)\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UseNumericLiteralSeparatorTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class UseNumericLiteralSeparatorTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<UseNumericLiteralSeparator>();\n\n        [TestMethod]\n        public void UseNumericLiteralSeparator_BeforeCSharp7() =>\n            builder.AddPaths(\"UseNumericLiteralSeparator.cs\")\n                .WithErrorBehavior(CompilationErrorBehavior.Ignore)\n                .WithOptions(LanguageOptions.BeforeCSharp7)\n                .VerifyNoIssues();\n\n        [TestMethod]\n        public void UseNumericLiteralSeparator_FromCSharp7() =>\n            builder.AddPaths(\"UseNumericLiteralSeparator.cs\")\n                .WithOptions(LanguageOptions.FromCSharp7)\n                .Verify();\n\n        [TestMethod]\n        public void UseNumericLiteralSeparator_CSharp9() =>\n            builder.AddPaths(\"UseNumericLiteralSeparator.CSharp9.cs\")\n                .WithTopLevelStatements()\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UseParamsForVariableArgumentsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class UseParamsForVariableArgumentsTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<UseParamsForVariableArguments>();\n\n    [TestMethod]\n    public void UseParamsForVariableArguments() =>\n        builder.AddPaths(\"UseParamsForVariableArguments.cs\")\n            .Verify();\n\n    [TestMethod]\n    public void UseParamsForVariableArguments_CSharpLatest() =>\n        builder.AddPaths(\"UseParamsForVariableArguments.Latest.cs\", \"UseParamsForVariableArguments.Latest.Partial.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UsePascalCaseForNamedPlaceHoldersTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing SonarAnalyzer.CSharp.Rules;\nusing SonarAnalyzer.CSharp.Rules.MessageTemplates;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class UsePascalCaseForNamedPlaceHoldersTest\n{\n    private static readonly IEnumerable<MetadataReference> LoggingReferences =\n        NuGetMetadataReference.MicrosoftExtensionsLoggingAbstractions()\n        .Concat(NuGetMetadataReference.NLog())\n        .Concat(NuGetMetadataReference.Serilog());\n\n    private static readonly VerifierBuilder Builder = new VerifierBuilder<MessageTemplateAnalyzer>()\n        .AddReferences(LoggingReferences)\n        .WithOnlyDiagnostics(UsePascalCaseForNamedPlaceHolders.S6678);\n\n    [TestMethod]\n    public void UsePascalCaseForNamedPlaceHolders_CS() =>\n        Builder.AddPaths(\"UsePascalCaseForNamedPlaceHolders.cs\").Verify();\n\n    [TestMethod]\n    public void UsePascalCaseForNamedPlaceHolders_Latest_CS() =>\n        Builder.AddPaths(\"UsePascalCaseForNamedPlaceHolders.Latest.cs\").WithLanguageVersion(LanguageVersion.Latest).Verify();\n\n    [TestMethod]\n    [DataRow(\"LogCritical\")]\n    [DataRow(\"LogDebug\")]\n    [DataRow(\"LogError\")]\n    [DataRow(\"LogInformation\")]\n    [DataRow(\"LogTrace\")]\n    [DataRow(\"LogWarning\")]\n    public void UsePascalCaseForNamedPlaceHolders_MicrosoftExtensionsLogging_CS(string methodName) =>\n        Builder.AddSnippet($$\"\"\"\n            using System;\n            using Microsoft.Extensions.Logging;\n\n            public class Program\n            {\n                public void Method(ILogger logger, int arg)\n                {\n                    logger.{{methodName}}(\"Arg: {Arg}\", arg);       // Compliant\n                    logger.{{methodName}}(\"Arg: {arg}\", arg);       // Noncompliant\n                                                                    // Secondary @-1\n                }\n            }\n            \"\"\").Verify();\n\n    [TestMethod]\n    [DataRow(\"Debug\")]\n    [DataRow(\"Error\")]\n    [DataRow(\"Information\")]\n    [DataRow(\"Fatal\")]\n    [DataRow(\"Warning\")]\n    [DataRow(\"Verbose\")]\n    public void UsePascalCaseForNamedPlaceHolders_Serilog_CS(string methodName) =>\n        Builder.AddSnippet($$\"\"\"\n            using Serilog;\n            using Serilog.Events;\n\n            public class Program\n            {\n                public void Method(ILogger logger, int arg)\n                {\n                    logger.{{methodName}}(\"Arg: {Arg}\", arg);       // Compliant\n                    logger.{{methodName}}(\"Arg: {arg}\", arg);       // Noncompliant\n                                                                    // Secondary @-1\n                }\n            }\n            \"\"\").Verify();\n\n    [TestMethod]\n    [DataRow(\"Debug\")]\n    [DataRow(\"ConditionalDebug\")]\n    [DataRow(\"Error\")]\n    [DataRow(\"Fatal\")]\n    [DataRow(\"Info\")]\n    [DataRow(\"Trace\")]\n    [DataRow(\"ConditionalTrace\")]\n    [DataRow(\"Warn\")]\n    public void UsePascalCaseForNamedPlaceHolders_NLog_CS(string methodName) =>\n        Builder.AddSnippet($$\"\"\"\n            using NLog;\n\n            public class Program\n            {\n                public void Method(ILogger iLogger, Logger logger, MyLogger myLogger, int arg)\n                {\n                    logger.{{methodName}}(\"Arg: {Arg}\", arg);       // Compliant\n                    logger.{{methodName}}(\"Arg: {arg}\", arg);       // Noncompliant\n                                                                    // Secondary @-1\n                }\n            }\n            public class MyLogger : Logger { }\n            \"\"\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UseReturnStatementTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class UseReturnStatementTest\n{\n    [TestMethod]\n    public void UseReturnStatement() =>\n        new VerifierBuilder<UseReturnStatement>().AddPaths(\"UseReturnStatement.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UseShortCircuitingOperatorTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class UseShortCircuitingOperatorTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.UseShortCircuitingOperator>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.UseShortCircuitingOperator>();\n\n    [TestMethod]\n    public void UseShortCircuitingOperators_VB() =>\n        builderVB.AddPaths(\"UseShortCircuitingOperator.vb\").Verify();\n\n    [TestMethod]\n    public void UseShortCircuitingOperators_VB_CodeFix() =>\n        builderVB.WithCodeFix<VB.UseShortCircuitingOperatorCodeFix>().AddPaths(\"UseShortCircuitingOperator.vb\").WithCodeFixedPaths(\"UseShortCircuitingOperator.Fixed.vb\").VerifyCodeFix();\n\n    [TestMethod]\n    public void UseShortCircuitingOperators_CS() =>\n        builderCS.AddPaths(\"UseShortCircuitingOperator.cs\").Verify();\n\n    [TestMethod]\n    public void UseShortCircuitingOperators_CS_Latest() =>\n    builderCS.AddPaths(\"UseShortCircuitingOperator.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void UseShortCircuitingOperators_CS_TopLevelStatements() =>\n        builderCS.AddPaths(\"UseShortCircuitingOperator.TopLevelStatements.cs\").WithTopLevelStatements().Verify();\n\n    [TestMethod]\n    public void UseShortCircuitingOperators_CS_TopLevelStatements_CodeFix() =>\n        builderCS.WithCodeFix<CS.UseShortCircuitingOperatorCodeFix>().AddPaths(\"UseShortCircuitingOperator.TopLevelStatements.cs\").WithCodeFixedPaths(\"UseShortCircuitingOperator.TopLevelStatements.Fixed.cs\").WithTopLevelStatements().VerifyCodeFix();\n\n    [TestMethod]\n    public void UseShortCircuitingOperators_CS_CodeFix() =>\n        builderCS.WithCodeFix<CS.UseShortCircuitingOperatorCodeFix>().AddPaths(\"UseShortCircuitingOperator.cs\").WithCodeFixedPaths(\"UseShortCircuitingOperator.Fixed.cs\").VerifyCodeFix();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UseStringCreateTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class UseStringCreateTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.UseStringCreate>();\n\n#if NET6_0_OR_GREATER\n\n    [TestMethod]\n    public void UseStringCreate_CSharp10() =>\n        builderCS.AddPaths(\"UseStringCreate.CSharp10.cs\")\n            .WithOptions(LanguageOptions.FromCSharp10)\n            .Verify();\n\n#else\n\n    [TestMethod]\n    public void UseStringCreate() =>\n        builderCS.AddPaths(\"UseStringCreate.cs\").Verify();\n\n#endif\n\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UseStringIsNullOrEmptyTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class UseStringIsNullOrEmptyTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder<UseStringIsNullOrEmpty>();\n\n        [TestMethod]\n        public void UseStringNullOrEmpty() =>\n            builder.AddPaths(\"UseStringIsNullOrEmpty.cs\").Verify();\n\n        [TestMethod]\n        public void UseStringNullOrEmpty_CSharp10() =>\n            builder.AddPaths(\"UseStringIsNullOrEmpty.CSharp10.cs\")\n                .WithOptions(LanguageOptions.FromCSharp10)\n                .Verify();\n\n        [TestMethod]\n        public void UseStringNullOrEmpty_CSharp11() =>\n            builder.AddPaths(\"UseStringIsNullOrEmpty.CSharp11.cs\")\n                .WithOptions(LanguageOptions.FromCSharp11)\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UseTestableTimeProviderTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class UseTestableTimeProviderTest\n    {\n        [TestMethod]\n        public void UseTestableTimeProvider_CS() =>\n             new VerifierBuilder()\n                .AddAnalyzer(() => new CS.UseTestableTimeProvider())\n                .AddPaths(\"UseTestableTimeProvider.cs\")\n                .Verify();\n\n        [TestMethod]\n        public void UseTestableTimeProvider_VB() =>\n             new VerifierBuilder()\n                .AddAnalyzer(() => new VB.UseTestableTimeProvider())\n                .AddPaths(\"UseTestableTimeProvider.vb\")\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UseTrueForAllTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class UseTrueForAllTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.UseTrueForAll>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.UseTrueForAll>();\n\n    [TestMethod]\n    public void UseTrueForAll_CS() =>\n        builderCS.AddPaths(\"UseTrueForAll.cs\").Verify();\n\n    [TestMethod]\n    public void UseTrueForAll_CS_Immutable() =>\n        builderCS.AddPaths(\"UseTrueForAll.Immutable.cs\").AddReferences(MetadataReferenceFacade.SystemCollections).Verify();\n\n    [TestMethod]\n    public void UseTrueForAll_VB() =>\n        builderVB.AddPaths(\"UseTrueForAll.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UseUnixEpochTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class UseUnixEpochTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.UseUnixEpoch>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.UseUnixEpoch>();\n\n#if NETFRAMEWORK\n\n    [TestMethod]\n    public void UseUnixEpoch_Framework_CS() =>\n        builderCS.AddPaths(\"UseUnixEpoch.Framework.cs\").VerifyNoIssues();\n\n    [TestMethod]\n    public void UseUnixEpoch_Framework_VB() =>\n        builderVB.AddPaths(\"UseUnixEpoch.Framework.vb\").VerifyNoIssues();\n\n#else\n\n    [TestMethod]\n    public void UseUnixEpoch_CS() =>\n        builderCS.AddPaths(\"UseUnixEpoch.cs\").Verify();\n\n    [TestMethod]\n    public void UseUnixEpoch_CSharp9() =>\n        builderCS\n            .AddPaths(\"UseUnixEpoch.CSharp9.cs\")\n            .WithTopLevelStatements()\n            .Verify();\n\n    [TestMethod]\n    public void UseUnixEpoch_VB() =>\n        builderVB.AddPaths(\"UseUnixEpoch.vb\").Verify();\n\n    [TestMethod]\n    public void UseUnixEpoch_CodeFix_CS() =>\n        builderCS\n            .AddPaths(\"UseUnixEpoch.cs\")\n            .WithCodeFix<CS.UseUnixEpochCodeFix>()\n            .WithCodeFixedPaths(\"UseUnixEpoch.Fixed.cs\")\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void UseUnixEpoch_CodeFix_CSharp9() =>\n        builderCS\n            .AddPaths(\"UseUnixEpoch.CSharp9.cs\")\n            .WithCodeFix<CS.UseUnixEpochCodeFix>()\n            .WithCodeFixedPaths(\"UseUnixEpoch.CSharp9.Fixed.cs\")\n            .WithTopLevelStatements()\n            .VerifyCodeFix();\n\n    [TestMethod]\n    public void UseUnixEpoch_CodeFix_VB() =>\n        builderVB\n            .AddPaths(\"UseUnixEpoch.vb\")\n            .WithCodeFix<VB.UseUnixEpochCodeFix>()\n            .WithCodeFixedPaths(\"UseUnixEpoch.Fixed.vb\")\n            .VerifyCodeFix();\n\n#endif\n\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UseUriInsteadOfStringTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class UseUriInsteadOfStringTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<UseUriInsteadOfString>().AddReferences(MetadataReferenceFacade.SystemDrawing);\n\n    [TestMethod]\n    [DataRow(ProjectType.Product)]\n    [DataRow(ProjectType.Test)]\n    public void UseUriInsteadOfString(ProjectType projectType) =>\n        builder.AddPaths(\"UseUriInsteadOfString.cs\").AddReferences(TestCompiler.ProjectTypeReference(projectType)).Verify();\n\n    [TestMethod]\n    public void UseUriInsteadOfString_TopLevelStatements() =>\n        builder.AddPaths(\"UseUriInsteadOfString.TopLevelStatements.cs\")\n            .WithTopLevelStatements()\n            .Verify();\n\n    [TestMethod]\n    public void UseUriInsteadOfString_Latest() =>\n        builder.AddPaths(\"UseUriInsteadOfString.Latest.cs\", \"UseUriInsteadOfString.Latest.Partial.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void UseUriInsteadOfString_InvalidCode() =>\n        builder.AddSnippet(@\"\npublic class NoMembers\n{\n}\n\npublic class InvalidCode : NoMembers\n{\n    public override string UriProperty { get; set; }    // Error [CS0115] 'Bar.UriProperty': no suitable method found to override\n    public override string UriMethod() => \"\"\"\";         // Error [CS0115] 'Bar.UriMethod()': no suitable method found to override\n\n    public void Main()\n    {\n        Uri.TryCreate(new object(), UriKind.Absolute, out result); // Compliant - invalid code\n        // Error@-1 [CS0103 ]The name 'UriKind' does not exist in the current context\n        // Error@-2 [CS0103] The name 'Uri' does not exist in the current context\n        // Error@-3 [CS0103] The name 'result' does not exist in the current context\n    }\n}\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UseValueParameterTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class UseValueParameterTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<UseValueParameter>();\n\n    [TestMethod]\n    public void UseValueParameter() =>\n        builder.AddPaths(\"UseValueParameter.cs\").Verify();\n\n    [TestMethod]\n    public void UseValueParameter_CS_Latest() =>\n        builder.AddPaths(\"UseValueParameter.Latest.cs\", \"UseValueParameter.Latest.Partial.cs\")\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .Verify();\n\n    [TestMethod]\n    public void UseValueParameter_InvalidCode() =>\n        builder.AddSnippet(\"\"\"\n            public int Foo\n            {\n                get => someField;   // Error [CS0103]\n                set =>              // Noncompliant\n                                    // Error@-1 [CS1002]\n                                    // Error@-2 [CS1525]\n            }\n            \"\"\")\n            .Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UseWhereBeforeOrderByTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class UseWhereBeforeOrderByTest\n{\n    [TestMethod]\n    public void UseWhereBeforeOrderBy_CS() =>\n        new VerifierBuilder<CS.UseWhereBeforeOrderBy>().AddPaths(\"UseWhereBeforeOrderBy.cs\").Verify();\n\n    [TestMethod]\n    public void UseWhereBeforeOrderBy_VB() =>\n        new VerifierBuilder<VB.UseWhereBeforeOrderBy>().AddPaths(\"UseWhereBeforeOrderBy.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UseWhileLoopInsteadTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class UseWhileLoopInsteadTest\n{\n    [TestMethod]\n    public void UseWhileLoopInstead() =>\n        new VerifierBuilder<UseWhileLoopInstead>().AddPaths(\"UseWhileLoopInstead.cs\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/UseWithStatementTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class UseWithStatementTest\n    {\n        [TestMethod]\n        public void UseWithStatement() =>\n            new VerifierBuilder().AddAnalyzer(() => new UseWithStatement() { MinimumSeriesLength = 2 })\n                .AddPaths(\"UseWithStatement.vb\")\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/Utilities/AnalysisWarningAnalyzerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\nusing SonarAnalyzer.CFG.Common;\nusing SonarAnalyzer.Core.AnalysisContext;\nusing SonarAnalyzer.Core.Rules;\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class AnalysisWarningAnalyzerTest\n{\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    [DataRow(LanguageNames.CSharp, true)]\n    [DataRow(LanguageNames.CSharp, false)]\n    [DataRow(LanguageNames.VisualBasic, true)]\n    [DataRow(LanguageNames.VisualBasic, false)]\n    public void AnalysisWarning_MSBuildSupportedScenario_NoWarning(string languageName, bool isAnalyzerEnabled)\n    {\n        var expectedPath = ExecuteAnalyzer(languageName, isAnalyzerEnabled, RoslynVersion.VS2017MajorVersion, RoslynVersion.MinimalSupportedMajorVersion); // Using production value that is lower than our UT Roslyn version\n        File.Exists(expectedPath).Should().BeFalse(\"Analysis warning file should not be generated.\");\n    }\n\n    [TestMethod]\n    [DataRow(LanguageNames.CSharp)]\n    [DataRow(LanguageNames.VisualBasic)]\n    public void AnalysisWarning_MSBuild14UnsupportedScenario_GenerateWarning(string languageName)\n    {\n        var expectedPath = ExecuteAnalyzer(languageName, true, 1000, 1001); // Requiring too high Roslyn version => we're under unsupported scenario\n        File.Exists(expectedPath).Should().BeTrue();\n        File.ReadAllText(expectedPath).Should().Be(\"\"\"[{\"text\": \"The analysis using MsBuild 14 is no longer supported and the analysis with MsBuild 15 is deprecated. Please update your pipeline to MsBuild 16 or higher.\"}]\"\"\");\n    }\n\n    [TestMethod]\n    [DataRow(LanguageNames.CSharp)]\n    [DataRow(LanguageNames.VisualBasic)]\n    public void AnalysisWarning_MSBuild15DeprecatedScenario_GenerateWarning(string languageName)\n    {\n        var expectedPath = ExecuteAnalyzer(languageName, true, RoslynVersion.VS2017MajorVersion, 1000); // Requiring too high Roslyn version => we're under unsupported scenario\n        File.Exists(expectedPath).Should().BeTrue();\n        File.ReadAllText(expectedPath).Should().Be(\"\"\"[{\"text\": \"The analysis using MsBuild 15 is deprecated. Please update your pipeline to MsBuild 16 or higher.\"}]\"\"\");\n    }\n\n    [TestMethod]\n    [DataRow(LanguageNames.CSharp)]\n    [DataRow(LanguageNames.VisualBasic)]\n    public void AnalysisWarning_LockFile_PathShouldBeReused(string languageName)\n    {\n        var expectedPath = ExecuteAnalyzer(languageName, true, RoslynVersion.VS2017MajorVersion, 1000);\n        // Lock file and run it for 2nd time\n        using var lockedFile = new FileStream(expectedPath, FileMode.Open, FileAccess.Write, FileShare.None);\n        ExecuteAnalyzer(languageName, true, RoslynVersion.VS2017MajorVersion, 1000).Should().Be(expectedPath, \"path should be reused and analyzer should not fail\");\n    }\n\n    [TestMethod]\n    [DataRow(LanguageNames.CSharp)]\n    [DataRow(LanguageNames.VisualBasic)]\n    public void AnalysisWarning_FileExceptions_AreIgnored(string languageName)\n    {\n        // This will not create the output directory, causing an exception in the File.WriteAllText(...)\n        var expectedPath = ExecuteAnalyzer(languageName, true, 500, 1000, false);  // Requiring too high Roslyn version => we're under unsupported scenario\n        File.Exists(expectedPath).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void VirtualProperties()\n    {\n        var sut = new TestAnalysisWarningAnalyzer_NoOverrides();\n        sut.PublicVS2017MajorVersion.Should().Be(2);\n        sut.PublicMinimalSupportedRoslynVersion.Should().Be(3);\n    }\n\n    private string ExecuteAnalyzer(string languageName, bool isAnalyzerEnabled, int vs2017MajorVersion, int minimalSupportedRoslynVersion, bool createDirectory = true)\n    {\n        var language = AnalyzerLanguage.FromName(languageName);\n        var analysisOutPath = TestFiles.TestPath(TestContext, @$\"{languageName}\\.sonarqube\\out\");\n        var projectOutPath = Path.GetFullPath(Path.Combine(analysisOutPath, \"0\", \"output-language\"));\n        if (createDirectory)\n        {\n            Directory.CreateDirectory(analysisOutPath);\n        }\n        UtilityAnalyzerBase analyzer = language.LanguageName switch\n        {\n            LanguageNames.CSharp => new TestAnalysisWarningAnalyzer_CS(isAnalyzerEnabled, vs2017MajorVersion, minimalSupportedRoslynVersion, projectOutPath),\n            LanguageNames.VisualBasic => new TestAnalysisWarningAnalyzer_VB(isAnalyzerEnabled, vs2017MajorVersion, minimalSupportedRoslynVersion, projectOutPath),\n            _ => throw new UnexpectedLanguageException(language)\n        };\n        new VerifierBuilder().AddAnalyzer(() => analyzer).AddSnippet(string.Empty).VerifyNoIssues(); // Nothing to analyze, just make it run\n        return Path.Combine(analysisOutPath, \"AnalysisWarnings.MsBuild.json\");\n    }\n\n    private sealed class TestAnalysisWarningAnalyzer_CS : CS.AnalysisWarningAnalyzer\n    {\n        private readonly bool isAnalyzerEnabled;\n        private readonly string outPath;\n\n        protected override int VS2017MajorVersion { get; }\n        protected override int MinimalSupportedRoslynVersion { get; }\n\n        public TestAnalysisWarningAnalyzer_CS(bool isAnalyzerEnabled, int vs2017MajorVersion, int minimalSupportedRoslynVersion, string outPath)\n        {\n            this.isAnalyzerEnabled = isAnalyzerEnabled;\n            VS2017MajorVersion = vs2017MajorVersion;\n            MinimalSupportedRoslynVersion = minimalSupportedRoslynVersion;\n            this.outPath = outPath;\n        }\n\n        protected override UtilityAnalyzerParameters ReadParameters(IAnalysisContext context) =>\n            base.ReadParameters(context) with { IsAnalyzerEnabled = isAnalyzerEnabled, OutPath = outPath };\n    }\n\n    private sealed class TestAnalysisWarningAnalyzer_VB : VB.AnalysisWarningAnalyzer\n    {\n        private readonly bool isAnalyzerEnabled;\n        private readonly string outPath;\n\n        protected override int VS2017MajorVersion { get; }\n        protected override int MinimalSupportedRoslynVersion { get; }\n\n        public TestAnalysisWarningAnalyzer_VB(bool isAnalyzerEnabled, int vs2017MajorVersion, int minimalSupportedRoslynVersion, string outPath)\n        {\n            this.isAnalyzerEnabled = isAnalyzerEnabled;\n            VS2017MajorVersion = vs2017MajorVersion;\n            MinimalSupportedRoslynVersion = minimalSupportedRoslynVersion;\n            this.outPath = outPath;\n        }\n\n        protected override UtilityAnalyzerParameters ReadParameters(IAnalysisContext context) =>\n            base.ReadParameters(context) with { IsAnalyzerEnabled = isAnalyzerEnabled, OutPath = outPath };\n    }\n\n    private sealed class TestAnalysisWarningAnalyzer_NoOverrides : AnalysisWarningAnalyzerBase\n    {\n        public int PublicVS2017MajorVersion => VS2017MajorVersion;\n        public int PublicMinimalSupportedRoslynVersion => MinimalSupportedRoslynVersion;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/Utilities/CopyPasteTokenAnalyzerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\nusing SonarAnalyzer.Core.AnalysisContext;\nusing SonarAnalyzer.Core.Rules;\nusing SonarAnalyzer.Protobuf;\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class CopyPasteTokenAnalyzerTest\n{\n    private const string BasePath = @\"Utilities\\CopyPasteTokenAnalyzer\\\";\n\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    public void Verify_Unique_CS() =>\n        Verify(\"Unique.cs\", x =>\n        {\n            x.Should().HaveCount(102);\n            x.Count(token => token.TokenValue == \"$str\").Should().Be(9);\n            x.Count(token => token.TokenValue == \"$num\").Should().Be(1);\n            x.Count(token => token.TokenValue == \"$char\").Should().Be(2);\n        });\n\n    [TestMethod]\n    public void Verify_Unique_CSharp11() =>\n        Verify(\"Unique.Csharp11.cs\", x =>\n        {\n            x.Should().HaveCount(155);\n            x.Count(token => token.TokenValue == \"$str\").Should().Be(16);\n            x.Count(token => token.TokenValue == \"$num\").Should().Be(1);\n            x.Count(token => token.TokenValue == \"$char\").Should().Be(2);\n        });\n\n    [TestMethod]\n    public void Verify_Unique_CSharp12() =>\n        Verify(\"Unique.Csharp12.cs\", x =>\n        {\n            x.Should().HaveCount(81);\n            x.Count(token => token.TokenValue == \"$str\").Should().Be(4);\n            x.Count(token => token.TokenValue == \"$num\").Should().Be(4);\n            x.Count(token => token.TokenValue == \"$char\").Should().Be(4);\n        });\n\n    [TestMethod]\n    public void Verify_Unique_VB() =>\n        Verify(\"Unique.vb\", x =>\n        {\n            x.Should().HaveCount(88);\n            x.Where(token => token.TokenValue == \"$str\").Should().HaveCount(3);\n            x.Where(token => token.TokenValue == \"$num\").Should().HaveCount(7);\n            x.Should().ContainSingle(token => token.TokenValue == \"$char\");\n        });\n\n    [TestMethod]\n    public void Verify_Duplicated_CS() =>\n        Verify(\"Duplicated.cs\", x =>\n        {\n            x.Should().HaveCount(39);\n            x.Where(token => token.TokenValue == \"$num\").Should().HaveCount(2);\n        });\n\n    [TestMethod]\n    public void Verify_Duplicated_CS_GlobalUsings() =>\n        CreateBuilder(ProjectType.Product, \"Duplicated.CSharp10.cs\")\n            .VerifyUtilityAnalyzer<CopyPasteTokenInfo>(x =>\n            {\n                x.Should().ContainSingle();\n                var info = x.Single();\n                info.FilePath.Should().Be(Path.Combine(BasePath, \"Duplicated.CSharp10.cs\"));\n                info.TokenInfo.Should().HaveCount(39);\n                info.TokenInfo.Where(token => token.TokenValue == \"$num\").Should().HaveCount(2);\n            });\n\n    [TestMethod]\n    public void Verify_DuplicatedDifferentLiterals_CS() =>\n        Verify(\"DuplicatedDifferentLiterals.cs\", x =>\n        {\n            x.Should().HaveCount(39);\n            x.Where(token => token.TokenValue == \"$num\").Should().HaveCount(2);\n        });\n\n    [TestMethod]\n    public void Verify_NotRunForTestProject_CS() =>\n        CreateBuilder(ProjectType.Test, \"DuplicatedDifferentLiterals.cs\").VerifyUtilityAnalyzerProducesEmptyProtobuf();\n\n    [TestMethod]\n    [DataRow(\"Unique.cs\")]\n    [DataRow(\"SomethingElse.cs\")]\n    public void Verify_UnchangedFiles(string unchangedFileName) =>\n        CreateBuilder(ProjectType.Product, \"Unique.cs\")\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfigWithUnchangedFiles(TestContext, BasePath + unchangedFileName))\n            .VerifyUtilityAnalyzer<TokenTypeInfo>(x => x.Should().NotBeEmpty());\n\n    private void Verify(string fileName, Action<IReadOnlyList<CopyPasteTokenInfo.Types.TokenInfo>> verifyTokenInfo) =>\n        CreateBuilder(ProjectType.Product, fileName)\n            .VerifyUtilityAnalyzer<CopyPasteTokenInfo>(x =>\n                {\n                    x.Should().ContainSingle();\n                    var info = x.Single();\n                    info.FilePath.Should().Be(Path.Combine(BasePath, fileName));\n                    verifyTokenInfo(info.TokenInfo);\n                });\n\n    [TestMethod]\n    [DataRow(\"Razor.razor\")]\n    [DataRow(\"Razor.cshtml\")]\n    public void Verify_NoMetricsAreComputedForRazorFiles(string fileName) =>\n        CreateBuilder(ProjectType.Product, fileName)\n            .VerifyUtilityAnalyzer<CopyPasteTokenInfo>(x => x.Select(token => Path.GetFileName(token.FilePath)).Should().BeEmpty());\n\n    private VerifierBuilder CreateBuilder(ProjectType projectType, string fileName)\n    {\n        var testRoot = BasePath + TestContext.TestName;\n        var language = AnalyzerLanguage.FromPath(fileName);\n        UtilityAnalyzerBase analyzer = language.LanguageName switch\n        {\n            LanguageNames.CSharp => new TestCopyPasteTokenAnalyzer_CS(testRoot, projectType == ProjectType.Test),\n            LanguageNames.VisualBasic => new TestCopyPasteTokenAnalyzer_VB(testRoot, projectType == ProjectType.Test),\n            _ => throw new UnexpectedLanguageException(language)\n        };\n        return new VerifierBuilder()\n            .AddAnalyzer(() => analyzer)\n            .AddPaths(fileName)\n            .WithBasePath(BasePath)\n            .WithOptions(LanguageOptions.Latest(language))\n            .WithProtobufPath(@$\"{testRoot}\\token-cpd.pb\");\n    }\n\n    // We need to set protected properties and this class exists just to enable the analyzer without bothering with additional files with parameters\n    private sealed class TestCopyPasteTokenAnalyzer_CS : CS.CopyPasteTokenAnalyzer\n    {\n        private readonly string outPath;\n        private readonly bool isTestProject;\n\n        public TestCopyPasteTokenAnalyzer_CS(string outPath, bool isTestProject)\n        {\n            this.outPath = outPath;\n            this.isTestProject = isTestProject;\n        }\n\n        protected override UtilityAnalyzerParameters ReadParameters(IAnalysisContext context) =>\n            base.ReadParameters(context) with { IsAnalyzerEnabled = true, OutPath = outPath, IsTestProject = isTestProject };\n    }\n\n    private sealed class TestCopyPasteTokenAnalyzer_VB : VB.CopyPasteTokenAnalyzer\n    {\n        private readonly string outPath;\n        private readonly bool isTestProject;\n\n        public TestCopyPasteTokenAnalyzer_VB(string outPath, bool isTestProject)\n        {\n            this.outPath = outPath;\n            this.isTestProject = isTestProject;\n        }\n\n        protected override UtilityAnalyzerParameters ReadParameters(IAnalysisContext context) =>\n            base.ReadParameters(context) with { IsAnalyzerEnabled = true, OutPath = outPath, IsTestProject = isTestProject };\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/Utilities/FileMetadataAnalyzerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\nusing SonarAnalyzer.Core.AnalysisContext;\nusing SonarAnalyzer.Core.Rules;\nusing SonarAnalyzer.CSharp.Rules;\nusing SonarAnalyzer.Protobuf;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class FileMetadataAnalyzerTest\n{\n    private const string BasePath = @\"Utilities\\FileMetadataAnalyzer\\\";\n\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    [DataRow(ProjectType.Product)]\n    [DataRow(ProjectType.Test)]\n    public void Autogenerated(ProjectType projectType)\n    {\n        var autogeneratedProjectFiles = new[]\n        {\n            \"autogenerated_comment.cs\",\n            \"autogenerated_comment2.cs\",\n            \"class.designer.cs\",\n            \"class.g.cs\",\n            \"class.g.something.cs\",\n            \"class.generated.cs\",\n            \"class_generated.cs\",\n            \"compiler_generated.cs\",\n            \"compiler_generated_attr.cs\",\n            \"debugger_non_user_code.cs\",\n            \"debugger_non_user_code_attr.cs\",\n            \"generated_code_attr.cs\",\n            \"generated_code_attr_local_function.cs\",\n            \"generated_code_attr2.cs\",\n            \"TEMPORARYGENERATEDFILE_class.cs\"\n        };\n        VerifyAllFilesAreGenerated(projectType, autogeneratedProjectFiles, autogeneratedProjectFiles);\n    }\n\n    [TestMethod]\n    [DataRow(ProjectType.Product)]\n    [DataRow(ProjectType.Test)]\n    public void NotAutogenerated(ProjectType projectType)\n    {\n        var notAutogeneratedFiles = new[]\n        {\n            \"normal_file.cs\",\n            \"generated_region.cs\",\n            \"generated_region_2.cs\"\n        };\n        CreateBuilder(projectType, notAutogeneratedFiles)\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, projectType))\n            .VerifyUtilityAnalyzer<FileMetadataInfo>(x =>\n                x.Should().BeEquivalentTo(notAutogeneratedFiles.Select(expected => new FileMetadataInfo\n                {\n                    IsGenerated = false,\n                    FilePath = BasePath + expected,\n                })));\n    }\n\n    [TestMethod]\n    [DataRow(true)]\n    [DataRow(false)]\n    public void CreateMessage_NoEncoding_SetsEmptyString(bool isTestProject)\n    {\n        var tree = Substitute.For<SyntaxTree>();\n        tree.FilePath.Returns(\"File.Generated.cs\");    // Generated to simplify mocking for GeneratedCodeRecognizer\n        tree.Encoding.Returns(x => null);\n        var model = TestCompiler.CompileCS(string.Empty).Model;\n        var sut = new TestFileMetadataAnalyzer(null, isTestProject);\n\n        sut.TestCreateMessage(UtilityAnalyzerParameters.Default, tree, model).Encoding.Should().BeEmpty();\n    }\n\n    [TestMethod]\n    [DataRow(\"class.generated.cs\", 0)]\n    [DataRow(\"SomethingElse.cs\", 1)]\n    public void Verify_UnchangedFiles(string unchangedFileName, int expectedFileCount) =>\n        CreateBuilder(ProjectType.Product, \"class.generated.cs\")\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfigWithUnchangedFiles(TestContext, BasePath + unchangedFileName))\n            .VerifyUtilityAnalyzer<FileMetadataInfo>(x => x.Should().HaveCount(expectedFileCount));\n\n    [TestMethod]\n    [DataRow(\"Razor.razor\")]\n    [DataRow(\"Razor.cshtml\")]\n    public void Verify_RazorFilesAreIgnored(string fileName) =>\n        CreateBuilder(ProjectType.Product, fileName)\n            .VerifyUtilityAnalyzer<FileMetadataInfo>(x =>\n                x.Select(fileInfo => Path.GetFileName(fileInfo.FilePath)).Should().BeEmpty());    // There are more files on some PCs: JSExports.g.cs, LibraryImports.g.cs, JSImports.g.cs\n\n    private void VerifyAllFilesAreGenerated(ProjectType projectType, string[] projectFiles, string[] autogeneratedFiles) =>\n        CreateBuilder(projectType, projectFiles)\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, projectType))\n            .VerifyUtilityAnalyzer<FileMetadataInfo>(x =>\n            {\n                x.Should().AllBeEquivalentTo(new { IsGenerated = true });\n                x.Should().SatisfyRespectively(autogeneratedFiles.Select<string, Action<FileMetadataInfo>>(expected => actual => actual.FilePath.EndsWith(expected)));\n            });\n\n    private VerifierBuilder CreateBuilder(ProjectType projectType, params string[] projectFiles)\n    {\n        var testRoot = BasePath + TestContext.TestName;\n        return new VerifierBuilder()\n            .AddAnalyzer(() => new TestFileMetadataAnalyzer(testRoot, projectType == ProjectType.Test))\n            .AddPaths(projectFiles)\n            .WithBasePath(BasePath)\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .WithProtobufPath(@$\"{testRoot}\\file-metadata.pb\");\n    }\n\n    // We need to set protected properties and this class exists just to enable the analyzer without bothering with additional files with parameters\n    private sealed class TestFileMetadataAnalyzer : FileMetadataAnalyzer\n    {\n        private readonly string outPath;\n        private readonly bool isTestProject;\n\n        public TestFileMetadataAnalyzer(string outPath, bool isTestProject)\n        {\n            this.outPath = outPath;\n            this.isTestProject = isTestProject;\n        }\n\n        protected override UtilityAnalyzerParameters ReadParameters(IAnalysisContext context) =>\n            base.ReadParameters(context) with { IsAnalyzerEnabled = true, OutPath = outPath, IsTestProject = isTestProject };\n\n        public FileMetadataInfo TestCreateMessage(UtilityAnalyzerParameters parameters, SyntaxTree tree, SemanticModel model) =>\n            CreateMessage(parameters, tree, model);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/Utilities/LogAnalyzerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.AnalysisContext;\nusing SonarAnalyzer.Core.Rules;\nusing SonarAnalyzer.Protobuf;\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class LogAnalyzerTest\n    {\n        private const string BasePath = @\"Utilities\\LogAnalyzer\\\";\n\n        public TestContext TestContext { get; set; }\n\n        [TestMethod]\n        public void LogCompilationMessages_CS() =>\n            Verify(new[] { \"Normal.cs\", \"Second.cs\" }, VerifyCompilationMessagesConcurrentRuleExecution);\n\n        [TestMethod]\n        public void LogCompilationMessages_CS_NonConcurrent()\n        {\n            using var scope = new EnvironmentVariableScope() { EnableConcurrentAnalysis = false };\n            Verify(new[] { \"Normal.cs\", \"Second.cs\" }, VerifyCompilationMessagesNonConcurrentRuleExecution);\n        }\n\n        [TestMethod]\n        public void LogCompilationMessages_VB() =>\n            Verify(new[] { \"Normal.vb\", \"Second.vb\" }, VerifyCompilationMessagesConcurrentRuleExecution);\n\n        [TestMethod]\n        public void LogAutogenerated_CS() =>\n            Verify(new[] { \"Normal.cs\", \"GeneratedByName.generated.cs\", \"GeneratedByContent.cs\" }, VerifyGenerated);\n\n        [TestMethod]\n        public void LogAutogenerated_VB() =>\n            Verify(new[] { \"Normal.vb\", \"GeneratedByName.generated.vb\", \"GeneratedByContent.vb\" }, VerifyGenerated);\n\n        [TestMethod]\n        public void LogAutogenerated_CsHtml()\n        {\n            const string fileName = \"Generated_cshtml.g.cs\";\n            CreateBuilder(fileName)\n                .VerifyUtilityAnalyzer<LogInfo>(x => x.Should().NotContain(x => x.Text.IndexOf(fileName, StringComparison.OrdinalIgnoreCase) != -1));\n        }\n\n        [TestMethod]\n        public void LogAutogenerated_Razor() =>\n            CreateBuilder(\"Generated_razor.g.cs\")\n                .VerifyUtilityAnalyzer<LogInfo>(x => x.Select(x => x.Text).Should().Contain($\"File 'Utilities\\\\LogAnalyzer\\\\Generated_razor.g.cs' was recognized as razor generated\"));\n\n        [TestMethod]\n        [DataRow(\"GeneratedByName.generated.cs\", 0)]\n        [DataRow(\"SomethingElse.cs\", 1)]\n        public void Verify_UnchangedFiles(string unchangedFileName, int expectedGeneratedFiles) =>\n            CreateBuilder(\"GeneratedByName.generated.cs\")\n                .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfigWithUnchangedFiles(TestContext, BasePath + unchangedFileName))\n                .VerifyUtilityAnalyzer<LogInfo>(x => x.Where(info => info.Text.Contains(\"generated\")).Should().HaveCount(expectedGeneratedFiles));\n\n        private void Verify(string[] paths, Action<IReadOnlyList<LogInfo>> verifyProtobuf) =>\n            CreateBuilder(paths).VerifyUtilityAnalyzer(verifyProtobuf);\n\n        private VerifierBuilder CreateBuilder(params string[] paths)\n        {\n            var testRoot = BasePath + TestContext.TestName;\n            var language = AnalyzerLanguage.FromPath(paths.First());\n            UtilityAnalyzerBase analyzer = language.LanguageName switch\n            {\n                LanguageNames.CSharp => new TestLogAnalyzer_CS(testRoot),\n                LanguageNames.VisualBasic => new TestLogAnalyzer_VB(testRoot),\n                _ => throw new UnexpectedLanguageException(language)\n            };\n            return new VerifierBuilder()\n                .AddAnalyzer(() => analyzer)\n                .AddPaths(paths)\n                .WithBasePath(BasePath)\n                .WithProtobufPath(@$\"{testRoot}\\log.pb\");\n        }\n\n        private static void VerifyCompilationMessagesNonConcurrentRuleExecution(IReadOnlyList<LogInfo> messages) =>\n            VerifyCompilationMessagesBase(messages, \"disabled\");\n\n        private static void VerifyCompilationMessagesConcurrentRuleExecution(IReadOnlyList<LogInfo> messages) =>\n            VerifyCompilationMessagesBase(messages, \"enabled\");\n\n        private static void VerifyCompilationMessagesBase(IReadOnlyList<LogInfo> messages, string expectedConcurrencyMessage)\n        {\n            VerifyRoslynVersion(messages);\n            VerifyLanguageVersion(messages);\n            VerifyConcurrentExecution(messages, expectedConcurrencyMessage);\n        }\n\n        private static void VerifyRoslynVersion(IReadOnlyList<LogInfo> messages)\n        {\n            messages.Should().NotBeEmpty();\n            var versionMessage = messages.SingleOrDefault(x => x.Text.Contains(\"Roslyn version\"));\n            versionMessage.Should().NotBeNull();\n            versionMessage.Severity.Should().Be(LogSeverity.Info);\n            versionMessage.Text.Should().MatchRegex(@\"^Roslyn version: \\d+(\\.\\d+){3}\");\n            var version = new Version(versionMessage.Text.Substring(16));\n            version.Should().BeGreaterThan(new Version(3, 0));  // Avoid 1.0.0.0\n        }\n\n        private static void VerifyLanguageVersion(IReadOnlyList<LogInfo> messages)\n        {\n            messages.Should().NotBeEmpty();\n            var versionMessage = messages.SingleOrDefault(x => x.Text.Contains(\"Language version\"));\n            versionMessage.Should().NotBeNull();\n            versionMessage.Severity.Should().Be(LogSeverity.Info);\n            versionMessage.Text.Should().MatchRegex(@\"^Language version: (Preview|(CSharp|VisualBasic)\\d+)\");\n        }\n\n        private static void VerifyConcurrentExecution(IReadOnlyList<LogInfo> messages, string expectedConcurrencyMessage)\n        {\n            messages.Should().NotBeEmpty();\n            var executionState = messages.SingleOrDefault(x => x.Text.Contains(\"Concurrent execution: \"));\n            executionState.Should().NotBeNull();\n            executionState.Severity.Should().Be(LogSeverity.Info);\n            executionState.Text.Should().Be($\"Concurrent execution: {expectedConcurrencyMessage}\");\n        }\n\n        private static void VerifyGenerated(IReadOnlyList<LogInfo> messages)\n        {\n            messages.Should().NotBeEmpty();\n            messages.FirstOrDefault(x => x.Text.Contains(\"Normal.\")).Should().BeNull();\n\n            var generatedByName = messages.SingleOrDefault(x => x.Text.Contains(\"GeneratedByName.generated.\"));\n            generatedByName.Should().NotBeNull();\n            generatedByName.Severity.Should().Be(LogSeverity.Debug);\n            generatedByName.Text.Should().Match(@\"File 'Utilities\\LogAnalyzer\\GeneratedByName.generated.*' was recognized as generated\");\n\n            var generatedByContent = messages.SingleOrDefault(x => x.Text.Contains(\"GeneratedByContent.\"));\n            generatedByContent.Should().NotBeNull();\n            generatedByContent.Severity.Should().Be(LogSeverity.Debug);\n            generatedByContent.Text.Should().Match(@\"File 'Utilities\\LogAnalyzer\\GeneratedByContent.*' was recognized as generated\");\n        }\n\n        // We need to set protected properties and this class exists just to enable the analyzer without bothering with additional files with parameters\n        private sealed class TestLogAnalyzer_CS : CS.LogAnalyzer\n        {\n            private readonly string outPath;\n\n            public TestLogAnalyzer_CS(string outPath)\n            {\n                this.outPath = outPath;\n            }\n\n            protected override UtilityAnalyzerParameters ReadParameters(IAnalysisContext context) =>\n                base.ReadParameters(context) with { IsAnalyzerEnabled = true, OutPath = outPath, IsTestProject = false };\n        }\n\n        private sealed class TestLogAnalyzer_VB : VB.LogAnalyzer\n        {\n            private readonly string outPath;\n\n            public TestLogAnalyzer_VB(string outPath)\n            {\n                this.outPath = outPath;\n            }\n\n            protected override UtilityAnalyzerParameters ReadParameters(IAnalysisContext context) =>\n                base.ReadParameters(context) with { IsAnalyzerEnabled = true, OutPath = outPath, IsTestProject = false };\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/Utilities/MethodDeclarationInfoComparerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Rules;\nusing SonarAnalyzer.Protobuf;\n\nnamespace SonarAnalyzer.Test.Rules.Utilities;\n\n[TestClass]\npublic class MethodDeclarationInfoComparerTest\n{\n    [TestMethod]\n    [DataRow(\"type\", \"method\", \"type\", \"method\", true)]\n    [DataRow(\"Type\", \"method\", \"type\", \"method\", false)] // Case-sensitive\n    [DataRow(\"type\", \"Method\", \"type\", \"method\", false)] // Case-sensitive\n    [DataRow(\"type\", \"method\", \"type\", \"method2\", false)]\n    [DataRow(\"type\", \"method\", \"type2\", \"method\", false)]\n    public void Equals(string firstType, string firstMethod, string secondType, string secondMethod, bool expected)\n    {\n        var first = new MethodDeclarationInfo { TypeName = firstType, MethodName = firstMethod };\n        var second = new MethodDeclarationInfo { TypeName = secondType, MethodName = secondMethod };\n        var sut = new MethodDeclarationInfoComparer();\n\n        sut.Equals(first, second).Should().Be(expected);\n    }\n\n    [TestMethod]\n    public void Equals_Null()\n    {\n        var sut = new MethodDeclarationInfoComparer();\n\n        sut.Equals(null, null).Should().BeTrue();\n        sut.Equals(new MethodDeclarationInfo(), null).Should().BeFalse();\n        sut.Equals(null, new MethodDeclarationInfo()).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void GetHashCode_EqualForObjectsWithTheSameProperties()\n    {\n        var first = new MethodDeclarationInfo { TypeName = \"type\", MethodName = \"method\" };\n        var second = new MethodDeclarationInfo { TypeName = \"type\", MethodName = \"method\" };\n        var sut = new MethodDeclarationInfoComparer();\n\n        sut.GetHashCode(first).Should().Be(sut.GetHashCode(second));\n    }\n\n    [TestMethod]\n    public void GetHashCode_DifferentForObjectsWithDifferentProperties()\n    {\n        var first = new MethodDeclarationInfo { TypeName = \"type\", MethodName = \"method\" };\n        var second = new MethodDeclarationInfo { TypeName = \"different type\", MethodName = \"method\" };\n        var third = new MethodDeclarationInfo { TypeName = \"different type\", MethodName = \"different method\" };\n        var sut = new MethodDeclarationInfoComparer();\n\n        sut.GetHashCode(first).Should().NotBe(sut.GetHashCode(second));\n        sut.GetHashCode(first).Should().NotBe(sut.GetHashCode(third));\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/Utilities/MetricsAnalyzerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\nusing SonarAnalyzer.Core.AnalysisContext;\nusing SonarAnalyzer.Core.Rules;\nusing SonarAnalyzer.CSharp.Rules;\nusing SonarAnalyzer.Protobuf;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class MetricsAnalyzerTest\n{\n    private const string BasePath = @\"Utilities\\MetricsAnalyzer\\\";\n    private const string AllMetricsFileName = \"AllMetrics.cs\";\n    private const string RazorFileName = \"Razor.razor\";\n    private const string CsHtmlFileName = \"Razor.cshtml\";\n    private const string CSharpLatestFileName = \"Metrics.Latest.cs\";\n    private const string ImportsRazorFileName = \"_Imports.razor\";\n\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    public void VerifyMetrics() =>\n        CreateBuilder(false, AllMetricsFileName)\n            .VerifyUtilityAnalyzer<MetricsInfo>(messages =>\n                {\n                    messages.Should().ContainSingle();\n                    var metrics = messages.Single();\n                    metrics.FilePath.Should().Be(Path.Combine(BasePath, AllMetricsFileName));\n                    metrics.ClassCount.Should().Be(4);\n                    metrics.CodeLine.Should().HaveCount(24);\n                    metrics.CognitiveComplexity.Should().Be(1);\n                    metrics.Complexity.Should().Be(2);\n                    metrics.ExecutableLines.Should().HaveCount(5);\n                    metrics.FunctionCount.Should().Be(1);\n                    metrics.NoSonarComment.Should().ContainSingle();\n                    metrics.NonBlankComment.Should().ContainSingle();\n                    metrics.StatementCount.Should().Be(5);\n                });\n\n    [TestMethod]\n    public void VerifyMetrics_Razor() =>\n        CreateBuilder(false, RazorFileName, \"Component.razor\")\n            .VerifyUtilityAnalyzer<MetricsInfo>(messages =>\n                {\n                    var orderedMessages = messages.OrderBy(x => x.FilePath, StringComparer.InvariantCulture).ToArray();\n                    orderedMessages.Select(x => Path.GetFileName(x.FilePath)).Should().BeEquivalentTo(RazorFileName, \"Component.razor\");\n\n                    var metrics = messages.Single(x => x.FilePath.EndsWith(RazorFileName));\n\n                    metrics.ClassCount.Should().Be(1);\n                    metrics.CodeLine.Should().BeEquivalentTo([1, 2, 3, 5, 8, 10, 13, 15, 16, 17, 19, 22, 23, 24, 26, 28, 29, 32, 33, 34, 36, 37, 39, 40, 43]);\n                    metrics.CognitiveComplexity.Should().Be(3);\n                    metrics.Complexity.Should().Be(4);\n                    metrics.ExecutableLines.Should().BeEquivalentTo([3, 5, 13, 15, 17, 24, 28, 29, 32, 36, 39, 43]); // This is incorrect, see https://sonarsource.atlassian.net/browse/NET-2052\n                    metrics.FunctionCount.Should().Be(1);\n                    metrics.NoSonarComment.Should().BeEmpty();\n                    metrics.NonBlankComment.Should().BeEquivalentTo([7, 8, 10, 15, 21, 22, 23, 28, 29, 32, 33, 36, 37, 38]);\n                    metrics.StatementCount.Should().Be(13); // This is incorrect, see https://sonarsource.atlassian.net/browse/NET-2052\n                });\n\n    [TestMethod]\n    // This is incorrect, see see https://sonarsource.atlassian.net/browse/NET-2052\n    public void VerifyMetrics_Razor_Usings() =>\n        CreateBuilder(false, ImportsRazorFileName)\n            .VerifyUtilityAnalyzer<MetricsInfo>(messages =>\n                {\n                    var orderedMessages = messages.OrderBy(x => x.FilePath, StringComparer.InvariantCulture).ToArray();\n                    orderedMessages.Select(x => Path.GetFileName(x.FilePath)).Should().BeEquivalentTo(ImportsRazorFileName);\n\n                    var metrics = messages.Single(x => x.FilePath.EndsWith(ImportsRazorFileName));\n\n                    metrics.ClassCount.Should().Be(0);\n                    metrics.CodeLine.Should().BeEquivalentTo([1, 2, 4, 5]);  // FN: this file has only 3 lines. See: https://github.com/SonarSource/sonar-dotnet/issues/9288 and https://sonarsource.atlassian.net/browse/NET-2052\n                    metrics.CognitiveComplexity.Should().Be(0);\n                    metrics.Complexity.Should().Be(1);\n                    metrics.ExecutableLines.Should().BeEquivalentTo(Array.Empty<int>());\n                    metrics.FunctionCount.Should().Be(0);\n                    metrics.NoSonarComment.Should().BeEmpty();\n                    metrics.NonBlankComment.Should().BeEquivalentTo(Array.Empty<int>());\n                    metrics.StatementCount.Should().Be(0);\n                });\n\n    [TestMethod]\n    public void VerifyMetrics_CsHtml() =>\n        CreateBuilder(false, CsHtmlFileName)\n            .VerifyUtilityAnalyzer<MetricsInfo>(x =>\n                // There should be no metrics messages for the cshtml files.\n                x.Select(x => Path.GetFileName(x.FilePath)).Should().BeEmpty());\n\n    [TestMethod]\n    public void VerifyMetrics_Latest() =>\n        CreateBuilder(false, CSharpLatestFileName)\n            .VerifyUtilityAnalyzer<MetricsInfo>(messages =>\n                {\n                    messages.Should().ContainSingle();\n                    var metrics = messages.Single();\n                    metrics.ClassCount.Should().Be(4);\n                    metrics.CodeLine.Should().HaveCount(41);\n                    metrics.CognitiveComplexity.Should().Be(2);\n                    metrics.Complexity.Should().Be(9);\n                    metrics.ExecutableLines.Should().HaveCount(8); // 7, 9, 11, 23, 25, 35, 36, 44\n                    metrics.FunctionCount.Should().Be(6);\n                    metrics.NoSonarComment.Should().BeEmpty();\n                    metrics.NonBlankComment.Should().ContainSingle();\n                    metrics.StatementCount.Should().Be(8);\n                });\n\n    [TestMethod]\n    public void Verify_NotRunForTestProject() =>\n        CreateBuilder(true, AllMetricsFileName).VerifyUtilityAnalyzerProducesEmptyProtobuf();\n\n    [TestMethod]\n    [DataRow(AllMetricsFileName, true)]\n    [DataRow(\"SomethingElse.cs\", false)]\n    public void Verify_UnchangedFiles(string unchangedFileName, bool expectedProtobufIsEmpty)\n    {\n        var builder = CreateBuilder(false, AllMetricsFileName)\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfigWithUnchangedFiles(TestContext, BasePath + unchangedFileName));\n        if (expectedProtobufIsEmpty)\n        {\n            builder.VerifyUtilityAnalyzerProducesEmptyProtobuf();\n        }\n        else\n        {\n            builder.VerifyUtilityAnalyzer<TokenTypeInfo>(x => x.Should().NotBeEmpty());\n        }\n    }\n\n    private VerifierBuilder CreateBuilder(bool isTestProject, params string[] fileNames)\n    {\n        var testRoot = BasePath + TestContext.TestName;\n        return new VerifierBuilder()\n            .AddAnalyzer(() => new TestMetricsAnalyzer(testRoot, isTestProject))\n            .AddPaths(fileNames)\n            .WithBasePath(BasePath)\n            .WithOptions(LanguageOptions.CSharpLatest)\n            .WithProtobufPath(@$\"{testRoot}\\metrics.pb\");\n    }\n\n    // We need to set protected properties and this class exists just to enable the analyzer without bothering with additional files with parameters\n    private sealed class TestMetricsAnalyzer : MetricsAnalyzer\n    {\n        private readonly string outPath;\n        private readonly bool isTestProject;\n\n        public TestMetricsAnalyzer(string outPath, bool isTestProject)\n        {\n            this.outPath = outPath;\n            this.isTestProject = isTestProject;\n        }\n\n        protected override UtilityAnalyzerParameters ReadParameters(IAnalysisContext context) =>\n            base.ReadParameters(context) with { IsAnalyzerEnabled = true, OutPath = outPath, IsTestProject = isTestProject };\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/Utilities/SymbolReferenceAnalyzerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\nusing SonarAnalyzer.Core.AnalysisContext;\nusing SonarAnalyzer.Core.Rules;\nusing SonarAnalyzer.Protobuf;\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class SymbolReferenceAnalyzerTest\n{\n    private const string BasePath = @\"Utilities\\SymbolReferenceAnalyzer\\\";\n\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    [DataRow(ProjectType.Product)]\n    [DataRow(ProjectType.Test)]\n    public void Verify_Method_PreciseLocation_CS(ProjectType projectType) =>\n        Verify(\"Method.cs\", projectType, x =>\n        {\n            x.Select(x => x.Declaration.StartLine).Should().BeEquivalentTo([1, 3, 5, 7]);   // class 'Sample' on line 1, method 'Method' on line 3, method 'method' on line 5 and method 'Go' on line 7\n            var methodDeclaration = x.Single(x => x.Declaration.StartLine == 3);\n            methodDeclaration.Declaration.Should().BeEquivalentTo(new TextRange { StartLine = 3, EndLine = 3, StartOffset = 16, EndOffset = 22 });\n            methodDeclaration.Reference.Should().Equal(new TextRange { StartLine = 9, EndLine = 9, StartOffset = 8, EndOffset = 14 });\n        });\n\n    [TestMethod]\n    [DataRow(ProjectType.Product)]\n    [DataRow(ProjectType.Test)]\n    public void Verify_Method_PreciseLocation_VB(ProjectType projectType) =>\n        Verify(\"Method.vb\", projectType, x =>\n        {\n            x.Select(x => x.Declaration.StartLine).Should().BeEquivalentTo([1, 3, 6, 10]);\n\n            var procedureDeclaration = x.Single(x => x.Declaration.StartLine == 3);\n            procedureDeclaration.Declaration.Should().BeEquivalentTo(new TextRange { StartLine = 3, EndLine = 3, StartOffset = 15, EndOffset = 21 });\n            procedureDeclaration.Reference.Should().BeEquivalentTo(\n                [\n                    new TextRange { StartLine = 11, EndLine = 11, StartOffset = 8, EndOffset = 14 },\n                    new TextRange { StartLine = 13, EndLine = 13, StartOffset = 8, EndOffset = 14 }\n                ]);\n\n            var functionDeclaration = x.Single(x => x.Declaration.StartLine == 6);\n            functionDeclaration.Declaration.Should().BeEquivalentTo(new TextRange { StartLine = 6, EndLine = 6, StartOffset = 13, EndOffset = 23 });\n            functionDeclaration.Reference.Should().Equal(new TextRange { StartLine = 12, EndLine = 12, StartOffset = 8, EndOffset = 18 });\n        });\n\n    [TestMethod]\n    [DataRow(ProjectType.Product)]\n    [DataRow(ProjectType.Test)]\n    public void Verify_Event_CS(ProjectType projectType) =>\n        Verify(\"Event.cs\", projectType, 6, 5, 9, 10);\n\n    [TestMethod]\n    [DataRow(ProjectType.Product)]\n    [DataRow(ProjectType.Test)]\n    public void Verify_Event_VB(ProjectType projectType) =>\n        Verify(\"Event.vb\", projectType, 4, 3, 6, 8, 11);\n\n    [TestMethod]\n    [DataRow(\"Field.cs\", ProjectType.Product)]\n    [DataRow(\"Field.cs\", ProjectType.Test)]\n    [DataRow(\"Field.ReservedKeyword.cs\", ProjectType.Product)]\n    [DataRow(\"Field.ReservedKeyword.cs\", ProjectType.Test)]\n    [DataRow(\"Field.EscapedNonKeyword.cs\", ProjectType.Product)]\n    [DataRow(\"Field.EscapedNonKeyword.cs\", ProjectType.Test)]\n    public void Verify_Field_CS(string fileName, ProjectType projectType) =>\n        Verify(fileName, projectType, 4, 3, 7, 8);\n\n    [TestMethod]\n    [DataRow(ProjectType.Product)]\n    [DataRow(ProjectType.Test)]\n    public void Verify_Field_EscapedSequences_CS(ProjectType projectType) =>\n        Verify(\"Field.EscapedSequences.cs\", projectType, 3, 3, 7, 8, 9, 10, 11, 12);\n\n    [TestMethod]\n    [DataRow(ProjectType.Product)]\n    [DataRow(ProjectType.Test)]\n    public void Verify_MissingDeclaration_CS(ProjectType projectType) =>\n        Verify(\"MissingDeclaration.cs\", projectType, 1, 3);\n\n    [TestMethod]\n    [DataRow(\"Field.vb\", ProjectType.Product)]\n    [DataRow(\"Field.vb\", ProjectType.Test)]\n    [DataRow(\"Field.ReservedKeyword.vb\", ProjectType.Product)]\n    [DataRow(\"Field.ReservedKeyword.vb\", ProjectType.Test)]\n    [DataRow(\"Field.EscapedNonKeyword.vb\", ProjectType.Product)]\n    [DataRow(\"Field.EscapedNonKeyword.vb\", ProjectType.Test)]\n    public void Verify_Field_VB(string fileName, ProjectType projectType) =>\n        Verify(fileName, projectType, 4, 3, 6, 7);\n\n    [TestMethod]\n    [DataRow(ProjectType.Product)]\n    [DataRow(ProjectType.Test)]\n    public void Verify_Tuples_CS(ProjectType projectType) =>\n        Verify(\"Tuples.cs\", projectType, 4, 7, 8);\n\n    [TestMethod]\n    [DataRow(ProjectType.Product)]\n    [DataRow(ProjectType.Test)]\n    public void Verify_Tuples_VB(ProjectType projectType) =>\n        Verify(\"Tuples.vb\", projectType, 4, 4, 8);\n\n    [TestMethod]\n    [DataRow(ProjectType.Product)]\n    [DataRow(ProjectType.Test)]\n    public void Verify_LocalFunction_CS(ProjectType projectType) =>\n        Verify(\"LocalFunction.cs\", projectType, 4, 7, 5);\n\n    [TestMethod]\n    [DataRow(ProjectType.Product)]\n    [DataRow(ProjectType.Test)]\n    public void Verify_Method_CS(ProjectType projectType) =>\n        Verify(\"Method.cs\", projectType, 4, 3, 9);\n\n    [TestMethod]\n    [DataRow(ProjectType.Product)]\n    [DataRow(ProjectType.Test)]\n    public void Verify_Method_Partial_CS(ProjectType projectType)\n    {\n        var builder = CreateBuilder(projectType, \"Method_Partial1.cs\", \"Method_Partial2.cs\");\n        builder.VerifyUtilityAnalyzer<SymbolReferenceInfo>(x => x.OrderBy(x => x.FilePath).Should().SatisfyRespectively(\n            p1 =>\n            {\n                p1.FilePath.Should().Be(@\"Utilities\\SymbolReferenceAnalyzer\\Method_Partial1.cs\");\n                p1.Reference.Should().HaveCount(7, because: \"a class, 5 partial methods, and a referencing method are declared\");\n\n                var unimplementedReference = p1.Reference[1];\n                unimplementedReference.Declaration.StartLine.Should().Be(5, because: \"the Unimplemented() method is declared here\");\n                unimplementedReference.Reference.Should().ContainSingle(because: \"the method is referenced inside Reference1() once\").Subject.StartLine.Should().Be(14, because: \"The reference to Unimplemented() happens here\");\n\n                var implemented1Reference = p1.Reference[2];\n                implemented1Reference.Declaration.StartLine.Should().Be(6, because: \"the Implemented1() method is declared here\");\n                implemented1Reference.Reference.Should().ContainSingle(because: \"the method is referenced inside Reference1() once\").Subject.StartLine.Should().Be(15, because: \"The reference to Implemented1() happens here\");\n\n                var implemented2Reference = p1.Reference[3];\n                implemented2Reference.Declaration.StartLine.Should().Be(7, because: \"the Implemented2() method is declared here\");\n                implemented2Reference.Reference.Should().ContainSingle(because: \"the method is referenced inside Reference1() once\").Subject.StartLine.Should().Be(16, because: \"The reference to Implemented2() happens here\");\n\n                var declaredAndImplementedReference = p1.Reference[4];\n                declaredAndImplementedReference.Declaration.StartLine.Should().Be(9, because: \"the DeclaredAndImplemented() method is declared here\");\n                declaredAndImplementedReference.Reference.Should().ContainSingle(because: \"the method is referenced inside Reference1() once\").Subject.StartLine.Should().Be(18, because: \"The reference to DeclaredAndImplemented() happens here\");\n\n                var declaredAndImplementedReference2 = p1.Reference[5];\n                declaredAndImplementedReference2.Declaration.StartLine.Should().Be(10, because: \"the DeclaredAndImplemented() method is implemented here\");\n                declaredAndImplementedReference2.Reference.Should().ContainSingle(because: \"the method is referenced inside Reference1() once\").Subject.StartLine.Should().Be(18, because: \"The reference to DeclaredAndImplemented() happens here\");\n            },\n            p2 =>\n            {\n                p2.FilePath.Should().Be(@\"Utilities\\SymbolReferenceAnalyzer\\Method_Partial2.cs\");\n                p2.Reference.Should().HaveCount(4, because: \"a class, 2 partial methods, and a referencing method are declared\");\n\n                var implemented1Reference = p2.Reference[1];\n                implemented1Reference.Declaration.StartLine.Should().Be(5, because: \"the Implemented1() method is declared here\");\n                implemented1Reference.Reference.Should().ContainSingle(because: \"the method is referenced inside Reference2() once\").Subject.StartLine.Should().Be(11, because: \"The reference to Implemented1() happens here\");\n\n                var implemented2Reference = p2.Reference[2];\n                implemented2Reference.Declaration.StartLine.Should().Be(6, because: \"the Implemented2() method is declared here\");\n                implemented2Reference.Reference.Should().ContainSingle(because: \"the method is referenced inside Reference2() once\").Subject.StartLine.Should().Be(12, because: \"The reference to Implemented2() happens here\");\n            }));\n    }\n\n    [TestMethod]\n    [DataRow(\"NamedType.cs\", ProjectType.Product)]\n    [DataRow(\"NamedType.cs\", ProjectType.Test)]\n    [DataRow(\"NamedType.ReservedKeyword.cs\", ProjectType.Product)]\n    [DataRow(\"NamedType.ReservedKeyword.cs\", ProjectType.Test)]\n    public void Verify_NamedType_CS(string fileName, ProjectType projectType) =>\n        Verify(fileName, projectType, 4, 3, 7);\n\n    [TestMethod]\n    [DataRow(\"NamedType.vb\", ProjectType.Product)]\n    [DataRow(\"NamedType.vb\", ProjectType.Test)]\n    [DataRow(\"NamedType.ReservedKeyword.vb\", ProjectType.Product)]\n    [DataRow(\"NamedType.ReservedKeyword.vb\", ProjectType.Test)]\n    public void Verify_NamedType_VB(string fileName, ProjectType projectType) =>\n        Verify(fileName, projectType, 5, 1, 4, 4, 5);\n\n    [TestMethod]\n    [DataRow(\"Parameter.cs\", ProjectType.Product)]\n    [DataRow(\"Parameter.cs\", ProjectType.Test)]\n    [DataRow(\"Parameter.ReservedKeyword.cs\", ProjectType.Product)]\n    [DataRow(\"Parameter.ReservedKeyword.cs\", ProjectType.Test)]\n    public void Verify_Parameter_CS(string fileName, ProjectType projectType) =>\n        Verify(fileName, projectType, 4, 4, 6, 7);\n\n    [TestMethod]\n    [DataRow(\"Parameter.vb\", ProjectType.Product)]\n    [DataRow(\"Parameter.vb\", ProjectType.Test)]\n    [DataRow(\"Parameter.ReservedKeyword.vb\", ProjectType.Product)]\n    [DataRow(\"Parameter.ReservedKeyword.vb\", ProjectType.Test)]\n    public void Verify_Parameter_VB(string fileName, ProjectType projectType) =>\n        Verify(fileName, projectType, 4, 4, 5, 6);\n\n    [TestMethod]\n    [DataRow(\"Property.cs\", ProjectType.Product)]\n    [DataRow(\"Property.cs\", ProjectType.Test)]\n    [DataRow(\"Property.FieldKeyword.cs\", ProjectType.Product)]\n    [DataRow(\"Property.FieldKeyword.cs\", ProjectType.Test)]\n    public void Verify_Property_CS(string fileName, ProjectType projectType) =>\n        Verify(fileName, projectType, 5, 3, 9, 10);\n\n    [TestMethod]\n    [DataRow(ProjectType.Product)]\n    [DataRow(ProjectType.Test)]\n    public void Verify_ExtensionKeyword_CS(ProjectType projectType) =>\n        Verify(\"ExtensionKeyword.cs\", projectType, 5, 3, 5, 10);\n\n    [TestMethod]\n    [DataRow(ProjectType.Product)]\n    [DataRow(ProjectType.Test)]\n    public void Verify_Property_Partial_CS(ProjectType projectType)\n    {\n        var builder = CreateBuilder(projectType, \"Property_Partial1.cs\", \"Property_Partial2.cs\");\n        builder.VerifyUtilityAnalyzer<SymbolReferenceInfo>(x => x.OrderBy(x => x.FilePath).Should().SatisfyRespectively(\n            p1 =>\n            {\n                p1.FilePath.Should().Be(@\"Utilities\\SymbolReferenceAnalyzer\\Property_Partial1.cs\");\n                p1.Reference.Should().HaveCount(5, because: \"a class, three properties, and a method are declared\");\n                var secondReference = p1.Reference[1];\n                secondReference.Declaration.StartLine.Should().Be(5, because: \"the property is declared here\");\n                secondReference.Reference.Should().ContainSingle(because: \"the property is referenced inside Reference1() once\").Subject.StartLine.Should().Be(12, because: \"The reference to Property happens here\");\n\n                var declaredAndImplementedReference = p1.Reference[2];\n                declaredAndImplementedReference.Declaration.StartLine.Should().Be(7, because: \"the DeclaredAndImplemented property is declared here\");\n                declaredAndImplementedReference.Reference.Should().ContainSingle(because: \"the method is referenced inside Reference1() once\").Subject.StartLine.Should().Be(13, because: \"The reference to DeclaredAndImplemented happens here\");\n\n                var declaredAndImplementedReference2 = p1.Reference[3];\n                declaredAndImplementedReference2.Declaration.StartLine.Should().Be(8, because: \"the DeclaredAndImplemented property is implemented here\");\n                declaredAndImplementedReference2.Reference.Should().ContainSingle(because: \"the method is referenced inside Reference1() once\").Subject.StartLine.Should().Be(13, because: \"The reference to DeclaredAndImplemented happens here\");\n            },\n            p2 =>\n            {\n                p2.FilePath.Should().Be(@\"Utilities\\SymbolReferenceAnalyzer\\Property_Partial2.cs\");\n                p2.Reference.Should().HaveCount(3, because: \"a class, a property, and a method are declared\");\n                var secondReference = p2.Reference[1];\n                secondReference.Declaration.StartLine.Should().Be(5, because: \"the property is declared here\");\n                secondReference.Reference.Should().ContainSingle(because: \"the property is referenced inside Reference2() once\").Subject.StartLine.Should().Be(9, because: \"The reference to Property happens here\");\n            }));\n    }\n\n    [TestMethod]\n    [DataRow(ProjectType.Product)]\n    [DataRow(ProjectType.Test)]\n    public void Verify_Constructor_Partial_CS(ProjectType projectType) =>\n        CreateBuilder(projectType, \"PartialConstructor.cs\", \"PartialConstructor.Partial.cs\")\n            .VerifyUtilityAnalyzer<SymbolReferenceInfo>(x =>\n                x.OrderBy(x => x.FilePath)\n                    .Should().SatisfyRespectively(\n                    x =>\n                    {\n                        x.FilePath.Should().Be(@\"Utilities\\SymbolReferenceAnalyzer\\PartialConstructor.cs\");\n                        VerifyReferences(x.Reference, 2, 1);\n                        VerifyReferences(x.Reference, 2, 3);\n                    },\n                    x =>\n                    {\n                        x.FilePath.Should().Be(@\"Utilities\\SymbolReferenceAnalyzer\\PartialConstructor.Partial.cs\");\n                        VerifyReferences(x.Reference, 3, 1);\n                        VerifyReferences(x.Reference, 3, 8);\n                        VerifyReferences(x.Reference, 3, 10, 11);\n                    }));\n\n    [TestMethod]\n    [DataRow(ProjectType.Product)]\n    [DataRow(ProjectType.Test)]\n    public void Verify_Event_Partial_CS(ProjectType projectType) =>\n    CreateBuilder(projectType, \"PartialEvent.cs\", \"PartialEvent.Partial.cs\")\n        .VerifyUtilityAnalyzer<SymbolReferenceInfo>(x =>\n            x.OrderBy(x => x.FilePath)\n                .Should().SatisfyRespectively(\n                x =>\n                {\n                    x.FilePath.Should().Be(@\"Utilities\\SymbolReferenceAnalyzer\\PartialEvent.cs\");\n                    VerifyReferences(x.Reference, 6, 3);\n                    VerifyReferences(x.Reference, 6, 5);\n                    VerifyReferences(x.Reference, 6, 6);\n                },\n                x =>\n                {\n                    x.FilePath.Should().Be(@\"Utilities\\SymbolReferenceAnalyzer\\PartialEvent.Partial.cs\");\n                    VerifyReferences(x.Reference, 2, 3);\n                    VerifyReferences(x.Reference, 2, 7);\n                }));\n\n    [TestMethod]\n    [DataRow(ProjectType.Product)]\n    [DataRow(ProjectType.Test)]\n    public void Verify_Property_VB(ProjectType projectType) =>\n        Verify(\"Property.vb\", projectType, 5, 3, 6, 7, 8);\n\n    [TestMethod]\n    [DataRow(ProjectType.Product)]\n    [DataRow(ProjectType.Test)]\n    public void Verify_TypeParameter_CS(ProjectType projectType) =>\n        Verify(\"TypeParameter.cs\", projectType, 5, 2, 4, 6);\n\n    [TestMethod]\n    [DataRow(ProjectType.Product)]\n    [DataRow(ProjectType.Test)]\n    public void Verify_TypeParameter_VB(ProjectType projectType) =>\n        Verify(\"TypeParameter.vb\", projectType, 5, 2, 4, 5);\n\n    [TestMethod]\n    public void Verify_TokenThreshold() =>\n        // In TokenThreshold.cs there are 40009 tokens which is more than the current limit of 40000\n        Verify(\"TokenThreshold.cs\", ProjectType.Product, _ => { }, false);\n\n    [TestMethod]\n    [DataRow(\"Method.cs\", true)]\n    [DataRow(\"SomethingElse.cs\", false)]\n    public void Verify_UnchangedFiles(string unchangedFileName, bool expectedProtobufIsEmpty)\n    {\n        var builder = CreateBuilder(ProjectType.Product, \"Method.cs\").WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfigWithUnchangedFiles(TestContext, BasePath + unchangedFileName));\n        if (expectedProtobufIsEmpty)\n        {\n            builder.VerifyUtilityAnalyzerProducesEmptyProtobuf();\n        }\n        else\n        {\n            builder.VerifyUtilityAnalyzer<SymbolReferenceInfo>(x => x.Should().NotBeEmpty());\n        }\n    }\n\n    [TestMethod]\n    public void Verify_Razor() =>\n        CreateBuilder(ProjectType.Product, \"Razor.razor\", \"Razor.razor.cs\", \"RazorComponent.razor\", \"ToDo.cs\", \"Razor.cshtml\")\n            .WithConcurrentAnalysis(false)\n            .VerifyUtilityAnalyzer<SymbolReferenceInfo>(x =>\n                {\n                    var orderedSymbols = x.OrderBy(x => x.FilePath, StringComparer.InvariantCulture).ToArray();\n                    orderedSymbols.Select(x => Path.GetFileName(x.FilePath)).Should().BeEquivalentTo(\"Razor.razor\", \"Razor.razor.cs\", \"RazorComponent.razor\", \"ToDo.cs\");\n                    orderedSymbols[0].FilePath.Should().EndWith(\"Razor.razor\");\n\n                    VerifyReferences(orderedSymbols[0].Reference, 10, 14, 5, 7, 21, 49);        // currentCount\n                    VerifyReferences(orderedSymbols[0].Reference, 10, 17, 11, 21, 22);          // IncrementAmount\n                    VerifyReferences(orderedSymbols[0].Reference, 10, 19, 9, 53);               // IncrementCount\n                    VerifyReferences(orderedSymbols[0].Reference, 10, 35, 35);                  // x\n                    VerifyReferences(orderedSymbols[0].Reference, 10, 38, 29, 35);              // todos\n                    VerifyReferences(orderedSymbols[0].Reference, 10, 40, 26);                  // AddTodo\n                    VerifyReferences(orderedSymbols[0].Reference, 10, 42);                      // x\n                    VerifyReferences(orderedSymbols[0].Reference, 10, 43);                      // y\n                    VerifyReferences(orderedSymbols[0].Reference, 10, 45, 42);                  // LocalMethod\n                    VerifyReferences(orderedSymbols[0].Reference, 10, 58, 52);                  // AdditionalAttributes\n\n                    VerifyReferencesColumns(orderedSymbols[0].Reference, 14, 5, 5, 19, 31);     // currentCount: line 5\n                    VerifyReferencesColumns(orderedSymbols[0].Reference, 14, 7, 7, 1, 13);      // currentCount: line 7\n                    VerifyReferencesColumns(orderedSymbols[0].Reference, 14, 21, 21, 8, 20);    // currentCount: line 21\n                    VerifyReferencesColumns(orderedSymbols[0].Reference, 14, 49, 49, 26, 38);   // currentCount: line 49\n\n                    orderedSymbols[1].FilePath.Should().EndWith(\"RazorComponent.razor\");        // RazorComponent.razor\n                    // https://github.com/SonarSource/sonar-dotnet/issues/8417\n                    // before dotnet 8.0.5  SDK: Declaration (1,0) - (1,17) Reference (1,6) - (1,23) <- Overlapping\n                    // Declaration of TSomeVeryLongName is placed starting at index 0 (ignoring \"@typeparam \")\n                    // Reference \"where TSomeVeryLongName\" is placed starting at index 6 (ignoring \"@typeparam TSomeVeryLongName \")\n                    VerifyReferences(orderedSymbols[1].Reference, 1, 1, 1);\n                    orderedSymbols[1].Reference.Single().Reference.Single().Should().BeEquivalentTo(new TextRange { StartLine = 1, EndLine = 1, StartOffset = 35, EndOffset = 52 });\n                });\n\n    [TestMethod]\n    [DataRow(ProjectType.Product)]\n    [DataRow(ProjectType.Test)]\n    public void Verify_PrimaryConstructor_PreciseLocation_CSharp12(ProjectType projectType) =>\n        Verify(\"PrimaryConstructor.cs\", projectType, x =>\n        {\n            x.Select(x => x.Declaration.StartLine).Should().BeEquivalentTo([1, 3, 6, 6, 8, 8, 10, 11, 12, 14, 17, 17, 19, 20, 21, 21, 23, 23, 25]);\n\n            var primaryCtorParameter = x.Single(x => x.Declaration.StartLine == 8 && x.Declaration.StartOffset == 19); // b1, primary ctor\n            primaryCtorParameter.Declaration.Should().BeEquivalentTo(new TextRange { StartLine = 8, EndLine = 8, StartOffset = 19, EndOffset = 21 });\n            primaryCtorParameter.Reference.Should().BeEquivalentTo(\n                [\n                    new TextRange { StartLine = 10, EndLine = 10, StartOffset = 24, EndOffset = 26 }, // Field\n                    new TextRange { StartLine = 11, EndLine = 11, StartOffset = 41, EndOffset = 43 }, // Property\n                    new TextRange { StartLine = 12, EndLine = 12, StartOffset = 21, EndOffset = 23 }  // b1\n                ]);\n\n            var ctorDeclaration = x.Single(x => x.Declaration.StartLine == 17 && x.Declaration.StartOffset == 6); // B\n            ctorDeclaration.Reference.Should().BeEmpty(); // FN, not reporting constructor 'B' and 'this' (line 21)\n\n            var fieldNameEqualToParameter = x.Single(x => x.Declaration.StartLine == 12 && x.Declaration.StartOffset == 16); // b1, field\n            fieldNameEqualToParameter.Reference.Should().Equal(\n                new TextRange { StartLine = 14, EndLine = 14, StartOffset = 20, EndOffset = 22 }); // b1, returned by Method\n\n            var ctorParameterDeclaration = x.Single(x => x.Declaration.StartLine == 21 && x.Declaration.StartOffset == 17); // b1, internal ctor\n            ctorParameterDeclaration.Reference.Should().Equal(\n                new TextRange { StartLine = 21, EndLine = 21, StartOffset = 36, EndOffset = 38 }); // b1, this parameter\n\n            var primaryCtorParameterB = x.Single(x => x.Declaration.StartLine == 17 && x.Declaration.StartOffset == 12); // b1, primary ctor B\n            primaryCtorParameterB.Reference.Should().BeEquivalentTo(\n                [\n                    new TextRange { StartLine = 19, EndLine = 19, StartOffset = 24, EndOffset = 26 }, // Field\n                    new TextRange { StartLine = 20, EndLine = 20, StartOffset = 41, EndOffset = 43 }, // Property\n                    new TextRange { StartLine = 25, EndLine = 25, StartOffset = 20, EndOffset = 22 }  // returned by Method\n                ]);\n\n            var classADeclaration = x.Single(x => x.Declaration.StartLine == 1 && x.Declaration.StartOffset == 13); // A\n            classADeclaration.Reference.Should().BeEquivalentTo(\n                [\n                    new TextRange { StartLine = 6, EndLine = 6, StartOffset = 34, EndOffset = 35 },  // primary ctor default parameter\n                    new TextRange { StartLine = 23, EndLine = 23, StartOffset = 25, EndOffset = 26 } // lambda default parameter\n                ]);\n\n            var constFieldDeclaration = x.Single(x => x.Declaration.StartLine == 3 && x.Declaration.StartOffset == 21); // I\n            constFieldDeclaration.Reference.Should().BeEquivalentTo(\n                [\n                    new TextRange { StartLine = 6, EndLine = 6, StartOffset = 36, EndOffset = 37 },  // primary ctor default parameter\n                    new TextRange { StartLine = 23, EndLine = 23, StartOffset = 27, EndOffset = 28 } // lambda default parameter\n                ]);\n        });\n\n    private void Verify(string fileName, ProjectType projectType, int expectedDeclarationCount, int assertedDeclarationLine, params int[] assertedDeclarationLineReferences) =>\n        Verify(fileName, projectType, x => VerifyReferences(x, expectedDeclarationCount, assertedDeclarationLine, assertedDeclarationLineReferences));\n\n    private void Verify(string fileName,\n                        ProjectType projectType,\n                        Action<IReadOnlyList<SymbolReferenceInfo.Types.SymbolReference>> verifyReference,\n                        bool isMessageExpected = true) =>\n        CreateBuilder(projectType, fileName)\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, projectType))\n            .VerifyUtilityAnalyzer<SymbolReferenceInfo>(x =>\n                {\n                    x.Should().HaveCount(isMessageExpected ? 1 : 0);\n\n                    if (isMessageExpected)\n                    {\n                        var info = x.Single();\n                        info.FilePath.Should().Be(Path.Combine(BasePath, fileName));\n                        verifyReference(info.Reference);\n                    }\n                });\n\n    private VerifierBuilder CreateBuilder(ProjectType projectType, params string[] fileNames)\n    {\n        var testRoot = BasePath + TestContext.TestName;\n        var language = AnalyzerLanguage.FromPath(fileNames[0]);\n        UtilityAnalyzerBase analyzer = language.LanguageName switch\n        {\n            LanguageNames.CSharp => new TestSymbolReferenceAnalyzer_CS(testRoot, projectType == ProjectType.Test),\n            LanguageNames.VisualBasic => new TestSymbolReferenceAnalyzer_VB(testRoot, projectType == ProjectType.Test),\n            _ => throw new UnexpectedLanguageException(language)\n        };\n        return new VerifierBuilder()\n            .AddAnalyzer(() => analyzer)\n            .AddPaths(fileNames)\n            .WithBasePath(BasePath)\n            .WithOptions(LanguageOptions.Latest(language))\n            .WithProtobufPath(@$\"{testRoot}\\symrefs.pb\");\n    }\n\n    private static void VerifyReferences(IReadOnlyList<SymbolReferenceInfo.Types.SymbolReference> references,\n                                         int expectedDeclarationCount,\n                                         int assertedDeclarationLine,\n                                         params int[] assertedDeclarationLineReferences)\n    {\n        references.Where(x => x.Declaration is not null).Should().HaveCount(expectedDeclarationCount);\n        references.Should().ContainSingle(x => x.Declaration.StartLine == assertedDeclarationLine).Subject.Reference.Select(x => x.StartLine)\n                  .Should().BeEquivalentTo(assertedDeclarationLineReferences);\n    }\n\n    private static void VerifyReferencesColumns(IReadOnlyList<SymbolReferenceInfo.Types.SymbolReference> symbolReference,\n                                                int declarationLine,\n                                                int startLine,\n                                                int endLine,\n                                                int startOffset,\n                                                int endOffset) =>\n        symbolReference.Should().ContainSingle(x => x.Declaration.StartLine == declarationLine).Subject.Reference\n            .Should().ContainSingle(x => x.StartLine == startLine && x.EndLine == endLine && x.StartOffset == startOffset && x.EndOffset == endOffset);\n\n    // We need to set protected properties and this class exists just to enable the analyzer without bothering with additional files with parameters\n    private sealed class TestSymbolReferenceAnalyzer_CS : CS.SymbolReferenceAnalyzer\n    {\n        private readonly string outPath;\n        private readonly bool isTestProject;\n\n        public TestSymbolReferenceAnalyzer_CS(string outPath, bool isTestProject)\n        {\n            this.outPath = outPath;\n            this.isTestProject = isTestProject;\n        }\n\n        protected override UtilityAnalyzerParameters ReadParameters(IAnalysisContext context) =>\n            base.ReadParameters(context) with { IsAnalyzerEnabled = true, OutPath = outPath, IsTestProject = isTestProject };\n    }\n\n    private sealed class TestSymbolReferenceAnalyzer_VB : VB.SymbolReferenceAnalyzer\n    {\n        private readonly string outPath;\n        private readonly bool isTestProject;\n\n        public TestSymbolReferenceAnalyzer_VB(string outPath, bool isTestProject)\n        {\n            this.outPath = outPath;\n            this.isTestProject = isTestProject;\n        }\n\n        protected override UtilityAnalyzerParameters ReadParameters(IAnalysisContext context) =>\n            base.ReadParameters(context) with { IsAnalyzerEnabled = true, OutPath = outPath, IsTestProject = isTestProject };\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/Utilities/TelemetryAnalyzerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\nusing Microsoft.CodeAnalysis.Text;\nusing CodeAnalysisCS = Microsoft.CodeAnalysis.CSharp;\nusing CodeAnalysisVB = Microsoft.CodeAnalysis.VisualBasic;\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class TelemetryAnalyzerTest\n{\n    private const string BasePath = @\"Utilities\\TelemetryAnalyzer\";\n\n    private static int testNumber = 0;\n\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    [DataRow(CodeAnalysisCS.LanguageVersion.CSharp7)]\n    [DataRow(CodeAnalysisCS.LanguageVersion.CSharp8)]\n    [DataRow(CodeAnalysisCS.LanguageVersion.CSharp9)]\n    [DataRow(CodeAnalysisCS.LanguageVersion.CSharp10)]\n    [DataRow(CodeAnalysisCS.LanguageVersion.CSharp11)]\n    [DataRow(CodeAnalysisCS.LanguageVersion.CSharp12)]\n    [DataRow(CodeAnalysisCS.LanguageVersion.CSharp13)]\n    public async Task TelemetryAnalyzer_CreateAnalysisMessages_ValidData_CS(CodeAnalysisCS.LanguageVersion langVersion)\n    {\n        var telemetry = await Telemetry_CS(langVersion);\n        telemetry.Should().Be(new Protobuf.Telemetry\n        {\n            LanguageVersion = langVersion.ToString(),\n            ProjectFullPath = \"A.csproj\",\n        });\n        telemetry.LanguageVersion.Should().StartWith(\"CSharp\");\n    }\n\n    [TestMethod]\n    public async Task TelemetryAnalyzer_CreateAnalysisMessages_InvalidLanguageVersion_CS()\n    {\n        var telemetry = await Telemetry_CS((CodeAnalysisCS.LanguageVersion)99999);\n        telemetry.Should().Be(new Protobuf.Telemetry\n        {\n            LanguageVersion = \"99999\",\n            ProjectFullPath = \"A.csproj\",\n        });\n    }\n\n    [TestMethod]\n    [DataRow(CodeAnalysisVB.LanguageVersion.VisualBasic15_3)]\n    [DataRow(CodeAnalysisVB.LanguageVersion.VisualBasic15_5)]\n    [DataRow(CodeAnalysisVB.LanguageVersion.VisualBasic11)]\n    [DataRow(CodeAnalysisVB.LanguageVersion.VisualBasic12)]\n    [DataRow(CodeAnalysisVB.LanguageVersion.VisualBasic14)]\n    [DataRow(CodeAnalysisVB.LanguageVersion.VisualBasic15)]\n    [DataRow(CodeAnalysisVB.LanguageVersion.VisualBasic16)]\n    public async Task TelemetryAnalyzer_CreateAnalysisMessages_ValidData_VB(CodeAnalysisVB.LanguageVersion langVersion)\n    {\n        var telemetry = await Telemetry_VB(langVersion);\n        telemetry.Should().Be(new Protobuf.Telemetry\n        {\n            LanguageVersion = langVersion.ToString(),\n            ProjectFullPath = \"A.vbproj\",\n        });\n        telemetry.LanguageVersion.Should().StartWith(\"VisualBasic\");\n    }\n\n    [TestMethod]\n    public async Task TelemetryAnalyzer_CreateAnalysisMessages_InvalidLanguageVersion_VB()\n    {\n        var telemetry = await Telemetry_VB((CodeAnalysisVB.LanguageVersion)99999);\n        telemetry.Should().Be(new Protobuf.Telemetry\n        {\n            LanguageVersion = \"99999\",\n            ProjectFullPath = \"A.vbproj\",\n        });\n    }\n\n    [TestMethod]\n    public async Task TelemetryAnalyzer_CreateAnalysisMessages_MissingProjectName()\n    {\n        var telemetry = await Telemetry_CS(CodeAnalysisCS.LanguageVersion.CSharp12, null);\n        telemetry.Should().Be(new Protobuf.Telemetry\n        {\n            LanguageVersion = \"CSharp12\",\n            ProjectFullPath = string.Empty,\n        });\n    }\n\n    private async Task<Protobuf.Telemetry> Telemetry_CS(CodeAnalysisCS.LanguageVersion languageVersion, string projectName = \"A.csproj\")\n    {\n        var syntaxTrees = new[] { CodeAnalysisCS.SyntaxFactory.ParseSyntaxTree(string.Empty, CodeAnalysisCS.CSharpParseOptions.Default.WithLanguageVersion(languageVersion)) };\n        var compilation = CodeAnalysisCS.CSharpCompilation.Create(null, syntaxTrees);\n        var outPath = Path.Combine(BasePath, TestContext.TestName, Interlocked.Increment(ref testNumber).ToString());\n\n        var compilationWithAnalyzer = compilation.WithAnalyzers(\n            [new CS.TelemetryAnalyzer()],\n            new AnalyzerOptions([SonarProjectConfigXmlMock(projectName, outPath), SonarLintXmlMock()]));\n        var result = await compilationWithAnalyzer.GetAnalysisResultAsync(CancellationToken.None);\n        result.GetAllDiagnostics().Should().BeEmpty();\n        return ParseTelemetryProtobuf(Path.Combine(outPath, \"output-cs\", \"telemetry.pb\"));\n    }\n\n    private async Task<Protobuf.Telemetry> Telemetry_VB(CodeAnalysisVB.LanguageVersion languageVersion, string projectName = \"A.vbproj\")\n    {\n        var syntaxTrees = new[] { CodeAnalysisVB.SyntaxFactory.ParseSyntaxTree(string.Empty, CodeAnalysisVB.VisualBasicParseOptions.Default.WithLanguageVersion(languageVersion)) };\n        var compilation = CodeAnalysisVB.VisualBasicCompilation.Create(null, syntaxTrees);\n        var outPath = Path.Combine(BasePath, TestContext.TestName, Interlocked.Increment(ref testNumber).ToString());\n\n        var compilationWithAnalyzer = compilation.WithAnalyzers(\n            [new VB.TelemetryAnalyzer()],\n            new AnalyzerOptions([SonarProjectConfigXmlMock(projectName, outPath), SonarLintXmlMock()]));\n        var result = await compilationWithAnalyzer.GetAnalysisResultAsync(CancellationToken.None);\n        result.GetAllDiagnostics().Should().BeEmpty();\n        return ParseTelemetryProtobuf(Path.Combine(outPath, \"output-vbnet\", \"telemetry.pb\"));\n    }\n\n    private Protobuf.Telemetry ParseTelemetryProtobuf(string protobufFilePath)\n    {\n        File.Exists(protobufFilePath).Should().BeTrue();\n        TestContext.AddResultFile(protobufFilePath); // Including the file in the test results\n        using var protoFile = File.Open(protobufFilePath, FileMode.Open);\n        return Protobuf.Telemetry.Parser.ParseDelimitedFrom(protoFile);\n    }\n\n    private static AdditionalText SonarLintXmlMock()\n    {\n        var sonarLint = Substitute.For<AdditionalText>();\n        sonarLint.Path.Returns(\"SonarLint.xml\");\n        sonarLint.GetText().Returns(SourceText.From(\"\"\"\n            <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n            <AnalysisInput/>\n            \"\"\"));\n        return sonarLint;\n    }\n\n    private static AdditionalText SonarProjectConfigXmlMock(string projectName, string outPath)\n    {\n        var config = Substitute.For<AdditionalText>();\n        config.Path.Returns(\"SonarProjectConfig.xml\");\n        config.GetText().Returns(SourceText.From($\"\"\"\n            <?xml version=\"1.0\" encoding=\"utf-8\"?>\n            <SonarProjectConfig xmlns=\"http://www.sonarsource.com/msbuild/analyzer/2021/1\">\n              <AnalysisConfigPath>SonarQubeAnalysisConfig.xml</AnalysisConfigPath>\n              {(projectName is not null ? $\"<ProjectPath>{projectName}</ProjectPath>\" : string.Empty)}\n              {(outPath is not null ? $\"<OutPath>{outPath}</OutPath>\" : string.Empty)}\n            </SonarProjectConfig>\n            \"\"\"));\n        return config;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/Utilities/TestMethodDeclarationsAnalyzerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\nusing SonarAnalyzer.Core.AnalysisContext;\nusing SonarAnalyzer.Core.Rules;\nusing SonarAnalyzer.Protobuf;\n\nnamespace SonarAnalyzer.Test.Rules.Utilities;\n\n[TestClass]\npublic class TestMethodDeclarationsAnalyzerTest\n{\n    private const string BasePath = @\"Utilities\\MethodDeclarationsAnalyzer\\\";\n\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    public void VerifyMethodDeclarations_ShouldGenerateMetrics_AvoidGeneratedFiles() =>\n        CreateCSharpBuilder(isTestProject: true, \"TestMethodDeclarations.Generated.g.cs\")\n            .VerifyUtilityAnalyzer<MethodDeclarationsInfo>(x => x.Should().BeEmpty());\n\n    [TestMethod]\n    public void VerifyMethodDeclarations_TestCode_CSharp() =>\n        CreateCSharpBuilder(isTestProject: true, \"TestMethodDeclarations.cs\", \"TestMethodDeclarations.Partial.cs\")\n            .VerifyUtilityAnalyzer<MethodDeclarationsInfo>(x =>\n            {\n                x.Should().HaveCount(2);\n                var firstFileDeclarations = x.OrderBy(declaration => declaration.FilePath).First();\n                firstFileDeclarations.AssemblyName.Should().Be(\"project0\");\n                firstFileDeclarations.FilePath.Should().Be(Path.Combine(BasePath, \"TestMethodDeclarations.cs\"));\n                firstFileDeclarations.MethodDeclarations.Should().BeEquivalentTo([\n                    new MethodDeclarationInfo { TypeName = \"Samples.CSharp.Address\", MethodName = \"GetZipCode\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.CSharp.BaseClass\", MethodName = \"BaseClassMethod\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.CSharp.BaseClass\", MethodName = \"Method\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.CSharp.Company\", MethodName = \"GetCompanyName\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.CSharp.DerivedClass\", MethodName = \"Method\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.CSharp.DerivedClass\", MethodName = \"BaseClassMethod\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.CSharp.Employee\", MethodName = \"GetEmployeeName\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.CSharp.FileClass\", MethodName = \"Method\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.CSharp.GenericClass\", MethodName = \"Method\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.CSharp.LocalFunctions\", MethodName = \"Main\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.CSharp.MultipleLevelInheritance\", MethodName = \"BaseClassMethod\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.CSharp.MultipleLevelInheritance\", MethodName = \"Method\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.CSharp.MultipleLevelInheritance\", MethodName = \"MultipleLevelInheritanceMethod\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.CSharp.IInterfaceWithTestDeclarations\", MethodName = \"GetZipCode\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.CSharp.MultipleMethods\", MethodName = \"Method1\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.CSharp.MultipleMethods\", MethodName = \"Method2\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.CSharp.NoModifiers\", MethodName = \"Method\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.CSharp.Overloads\", MethodName = \"Method\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.CSharp.PartialClass\", MethodName = \"BaseClassMethod\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.CSharp.PartialClass\", MethodName = \"Method\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.CSharp.PartialClass\", MethodName = \"InFirstFile\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.CSharp.PartialClass\", MethodName = \"PartialMethod\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.CSharp.Person\", MethodName = \"GetFullName\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.CSharp.Visibility\", MethodName = \"InternalMethod\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.CSharp.Visibility\", MethodName = \"NoAccessModifierMethod\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.CSharp.Visibility\", MethodName = \"PrivateMethod\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.CSharp.Visibility\", MethodName = \"PrivateProtectedMethod\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.CSharp.Visibility\", MethodName = \"ProtectedInternalMethod\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.CSharp.Visibility\", MethodName = \"ProtectedMethod\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.CSharp.Visibility\", MethodName = \"PublicMethod\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.CSharp.Visibility.InternalClass\", MethodName = \"Method\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.CSharp.Visibility.PrivateClass\", MethodName = \"Method\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.CSharp.WithGenericMethod\", MethodName = \"Method\" },\n                ]);\n                var secondFileDeclarations = x.OrderBy(declaration => declaration.FilePath).Skip(1).First();\n                secondFileDeclarations.AssemblyName.Should().Be(\"project0\");\n                secondFileDeclarations.FilePath.Should().Be(Path.Combine(BasePath, \"TestMethodDeclarations.Partial.cs\"));\n                secondFileDeclarations.MethodDeclarations.Should().BeEquivalentTo([\n                    new MethodDeclarationInfo { TypeName = \"Samples.CSharp.PartialClass\", MethodName = \"PartialMethod\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.CSharp.PartialClass\", MethodName = \"InSecondFile\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.CSharp.PartialClass\", MethodName = \"BaseClassMethod\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.CSharp.PartialClass\", MethodName = \"Method\" }\n                ]);\n            });\n\n    [TestMethod]\n    public void VerifyMethodDeclarations_TestCode_GlobalNamespace_CSharp() =>\n        CreateCSharpBuilder(isTestProject: true, \"TestMethodDeclarations.GlobalNamespace.cs\")\n            .VerifyUtilityAnalyzer<MethodDeclarationsInfo>(x =>\n            {\n                x.Should().HaveCount(1);\n                var fileDeclarations = x.OrderBy(declaration => declaration.FilePath).First();\n                fileDeclarations.AssemblyName.Should().Be(\"project0\");\n                fileDeclarations.FilePath.Should().Be(Path.Combine(BasePath, \"TestMethodDeclarations.GlobalNamespace.cs\"));\n                fileDeclarations.MethodDeclarations.Should().BeEquivalentTo([\n                    new MethodDeclarationInfo { TypeName = \"TestClass\", MethodName = \"TestMethod\" }\n                ]);\n            });\n\n    [TestMethod]\n    public void VerifyMethodDeclarations_TestCode_GlobalNamespace_VB() =>\n        CreateVisualBasicBuilder(isTestProject: true, \"TestMethodDeclarations.GlobalNamespace.vb\")\n            .VerifyUtilityAnalyzer<MethodDeclarationsInfo>(x =>\n            {\n                x.Should().HaveCount(1);\n                var fileDeclarations = x.OrderBy(declaration => declaration.FilePath).First();\n                fileDeclarations.AssemblyName.Should().Be(\"project0\");\n                fileDeclarations.FilePath.Should().Be(Path.Combine(BasePath, \"TestMethodDeclarations.GlobalNamespace.vb\"));\n                fileDeclarations.MethodDeclarations.Should().BeEquivalentTo([\n                    new MethodDeclarationInfo { TypeName = \"TestClass\", MethodName = \"TestMethod\" }\n                ]);\n            });\n\n    [TestMethod]\n    public void VerifyMethodDeclarations_MainCode_CSharp() =>\n        CreateCSharpBuilder(isTestProject: false, \"TestMethodDeclarations.cs\", \"TestMethodDeclarations.Partial.cs\").VerifyUtilityAnalyzer<MethodDeclarationsInfo>(x => { x.Should().BeEmpty(); });\n\n    [TestMethod]\n    public void VerifyMethodDeclarations_NoDeclarations_CSharp() =>\n        CreateCSharpBuilder(isTestProject: true, \"TestMethodDeclarations.NoMethods.cs\").VerifyUtilityAnalyzer<MethodDeclarationsInfo>(x => { x.Should().BeEmpty(); });\n\n    [TestMethod]\n    public void VerifyMethodDeclarations_TestCode_VB() =>\n        CreateVisualBasicBuilder(isTestProject: true, \"TestMethodDeclarations.vb\", \"TestMethodDeclarations.Partial.vb\")\n            .VerifyUtilityAnalyzer<MethodDeclarationsInfo>(x =>\n            {\n                x.Should().HaveCount(2);\n                var firstFileDeclarations = x.OrderBy(declaration => declaration.FilePath).First();\n                firstFileDeclarations.AssemblyName.Should().Be(\"project0\");\n                firstFileDeclarations.FilePath.Should().Be(Path.Combine(BasePath, \"TestMethodDeclarations.Partial.vb\"));\n                firstFileDeclarations.MethodDeclarations.Should().BeEquivalentTo([\n                    new MethodDeclarationInfo { TypeName = \"Samples.VB.PartialClass\", MethodName = \"InSecondFile\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.VB.PartialClass\", MethodName = \"PartialMethod\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.VB.PartialClass\", MethodName = \"BaseClassMethod\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.VB.PartialClass\", MethodName = \"Method\" }\n                ]);\n\n                var secondFileDeclarations = x.OrderBy(declaration => declaration.FilePath).Skip(1).First();\n                secondFileDeclarations.AssemblyName.Should().Be(\"project0\");\n                secondFileDeclarations.FilePath.Should().Be(Path.Combine(BasePath, \"TestMethodDeclarations.vb\"));\n                secondFileDeclarations.MethodDeclarations.Should().BeEquivalentTo([\n                    new MethodDeclarationInfo { TypeName = \"Samples.VB.Address\", MethodName = \"GetZipCode\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.VB.BaseClass\", MethodName = \"BaseClassMethod\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.VB.BaseClass\", MethodName = \"Method\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.VB.DerivedClass\", MethodName = \"Method\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.VB.DerivedClass\", MethodName = \"BaseClassMethod\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.VB.GenericClass\", MethodName = \"Method\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.VB.MultipleLevelInheritance\", MethodName = \"MultipleLevelInheritanceMethod\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.VB.MultipleLevelInheritance\", MethodName = \"Method\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.VB.MultipleLevelInheritance\", MethodName = \"BaseClassMethod\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.VB.IInterfaceWithTestDeclarations\", MethodName = \"GetZipCode\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.VB.MultipleMethods\", MethodName = \"Method1\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.VB.MultipleMethods\", MethodName = \"Method2\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.VB.NoModifiers\", MethodName = \"Method\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.VB.OverloadedMethods\", MethodName = \"Method\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.VB.PartialClass\", MethodName = \"InFirstFile\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.VB.PartialClass\", MethodName = \"PartialMethod\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.VB.PartialClass\", MethodName = \"BaseClassMethod\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.VB.PartialClass\", MethodName = \"Method\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.VB.Person\", MethodName = \"GetFullName\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.VB.Visibility\", MethodName = \"FriendMethod\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.VB.Visibility\", MethodName = \"NoAccessModifierMethod\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.VB.Visibility\", MethodName = \"PrivateMethod\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.VB.Visibility\", MethodName = \"PrivateProtectedMethod\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.VB.Visibility\", MethodName = \"ProtectedFriendMethod\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.VB.Visibility\", MethodName = \"ProtectedMethod\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.VB.Visibility\", MethodName = \"PublicMethod\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.VB.Visibility.FriendClass\", MethodName = \"Method\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.VB.Visibility.PrivateClass\", MethodName = \"Method\" },\n                    new MethodDeclarationInfo { TypeName = \"Samples.VB.WithGenericMethod\", MethodName = \"Method\" },\n                ]);\n            });\n\n    [TestMethod]\n    public void VerifyMethodDeclarations_MainCode_VB() =>\n        CreateVisualBasicBuilder(isTestProject: false, \"TestMethodDeclarations.vb\", \"TestMethodDeclarations.Partial.vb\").VerifyUtilityAnalyzer<MethodDeclarationsInfo>(x => { x.Should().BeEmpty(); });\n\n    [TestMethod]\n    public void VerifyMethodDeclarations_NoDeclarations_VB() =>\n        CreateVisualBasicBuilder(isTestProject: true, \"TestMethodDeclarations.NoMethods.vb\").VerifyUtilityAnalyzer<MethodDeclarationsInfo>(x => { x.Should().BeEmpty(); });\n\n    private VerifierBuilder CreateCSharpBuilder(bool isTestProject, params string[] fileNames) =>\n        CreateBuilder(LanguageOptions.CSharpLatest, new TestMetricsAnalyzerCSharp(GetFilePath(), isTestProject), fileNames);\n\n    private VerifierBuilder CreateVisualBasicBuilder(bool isTestProject, params string[] fileNames) =>\n        CreateBuilder(LanguageOptions.VisualBasicLatest, new TestMetricsAnalyzerVisualBasic(GetFilePath(), isTestProject), fileNames);\n\n    private VerifierBuilder CreateBuilder(ImmutableArray<ParseOptions> parseOptions, DiagnosticAnalyzer analyzer, string[] fileNames) =>\n        new VerifierBuilder()\n            .AddAnalyzer(() => analyzer)\n            .AddPaths(fileNames)\n            .WithBasePath(BasePath)\n            .WithOptions(parseOptions)\n            .AddTestReference()\n            .WithProtobufPath(@$\"{GetFilePath()}\\test-method-declarations.pb\");\n\n    private string GetFilePath() => Path.Combine(BasePath, TestContext.TestName!);\n\n    private sealed class TestMetricsAnalyzerCSharp(string outPath, bool isTestProject) : SonarAnalyzer.CSharp.Rules.TestMethodDeclarationsAnalyzer\n    {\n        protected override UtilityAnalyzerParameters ReadParameters(IAnalysisContext context) =>\n            base.ReadParameters(context) with { IsAnalyzerEnabled = true, OutPath = outPath, IsTestProject = isTestProject };\n    }\n\n    private sealed class TestMetricsAnalyzerVisualBasic(string outPath, bool isTestProject) : SonarAnalyzer.VisualBasic.Rules.TestMethodDeclarationsAnalyzer\n    {\n        protected override UtilityAnalyzerParameters ReadParameters(IAnalysisContext context) =>\n            base.ReadParameters(context) with { IsAnalyzerEnabled = true, OutPath = outPath, IsTestProject = isTestProject };\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/Utilities/TokenTypeAnalyzerTest.Classifier.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Test.Rules;\n\npublic partial class TokenTypeAnalyzerTest\n{\n    [TestMethod]\n    public void ClassClassifications() =>\n        ClassifierTestHarness.AssertTokenTypes(\"\"\"\n            [k:using] [u:System];\n            [k:public] [k:class] [t:Test]\n            {\n                [c:// SomeComment]\n                [k:public] [t:Test]() { }\n\n                [c:/// <summary>\n                /// A Prop\n                /// </summary>\n            ]   [k:int] [u:Prop] { [k:get]; }\n                [k:void] [u:Method]<[t:T]>([t:T] [u:t]) [k:where] [t:T]: [k:class], [t:IComparable], [u:System].[u:Collections].[t:IComparer]\n                {\n                    [k:var] [u:i] = [n:1];\n                    var s = [s:\"Hello\"];\n                    [t:T] [u:local] = [k:default];\n                }\n            [u:}]\n            \"\"\");\n\n    [TestMethod]\n    [DataRow(\"\"\" [s:\"Text\"] \"\"\")]\n    [DataRow(\"\"\" [s:\"\"] \"\"\")]\n    [DataRow(\"\"\" [s:\"  \"] \"\"\")]\n    [DataRow(\"\"\" [s:@\"\"] \"\"\")]\n    [DataRow(\"\"\" [s:$\"]{true}[s:\"] \"\"\")]\n    [DataRow(\"\"\" [s:$\"][s:  ]{true}[s:   ][s:\"] \"\"\")]\n    [DataRow(\"\"\" [s:$@\"]{true}[s:\"] \"\"\")]\n    [DataRow(\"\"\"\" [s:\"\"\" \"\"\"] \"\"\"\")]\n    [DataRow(\"\"\"\" [s:$\"\"\"]{true}[s:\"\"\"] \"\"\"\")]\n    [DataRow(\"\"\"\" [s:$\"\"\"][s:   ]{true}[s:   ][s:\"\"\"] \"\"\"\")]\n    public void StringClassClassification(string stringExpression) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            public class Test\n            {\n                void Method()\n                {\n                    string s = {{stringExpression}};\n                }\n            }\n            \"\"\", allowSemanticModel: false);\n\n    [TestMethod]\n    public void IdentifierToken_QueryComprehensions() =>\n        ClassifierTestHarness.AssertTokenTypes(\"\"\"\n            using System.Linq;\n            public class Test {\n                public void M()\n                {\n                    _ = from [u:i] in new int[0]\n                        let [u:j] = i\n                        join [u:k] in new int[0] on i equals k into [u:l]\n                        select l into [u:m]\n                        select m;\n                }\n            }\n            \"\"\", allowSemanticModel: false);\n\n    [TestMethod]\n    public void IdentifierToken_VariableDeclarator() =>\n        ClassifierTestHarness.AssertTokenTypes(\"\"\"\n            public class Test {\n                int [u:i] = 0, [u:j] = 0;\n                public void M()\n                {\n                    int [u:k], [u:l];\n                }\n            }\n            \"\"\", false);\n\n    [TestMethod]\n    public void IdentifierToken_LabeledStatement() =>\n        ClassifierTestHarness.AssertTokenTypes(\"\"\"\n            public class Test {\n                public void M()\n                {\n                    goto Label;\n            [u:Label]:\n                    ;\n                }\n            }\n            \"\"\", allowSemanticModel: false);\n\n    [TestMethod]\n    public void IdentifierToken_Catch() =>\n        ClassifierTestHarness.AssertTokenTypes(\"\"\"\n            public class Test {\n                public void M()\n                {\n                    try { }\n                    catch(System.Exception [u:ex]) { }\n                }\n            }\n            \"\"\", allowSemanticModel: false);\n\n    [TestMethod]\n    public void IdentifierToken_ForEach() =>\n        ClassifierTestHarness.AssertTokenTypes(\"\"\"\n            public class Test {\n                public void M()\n                {\n                    foreach(var [u:i] in new int[0])\n                    {\n                    }\n                }\n            }\n            \"\"\", allowSemanticModel: false);\n\n    [TestMethod]\n    public void IdentifierToken_MethodParameterConstructorDestructorLocalFunctionPropertyEvent() =>\n        ClassifierTestHarness.AssertTokenTypes(\"\"\"\n            public class Test {\n                public int [u:Prop] { get; set; }\n                public event System.EventHandler [u:TestEventField];\n                public event System.EventHandler [u:TestEventDeclaration] { add { } remove { } }\n                public [t:Test]() { }\n                public void [u:Method]<[t:T]>(int [u:parameter]) { }\n                ~[t:Test]()\n                {\n                    void [u:LocalFunction]() { }\n                }\n            }\n            \"\"\", allowSemanticModel: false);\n\n    [TestMethod]\n    public void IdentifierToken_BaseTypeDelegateEnumMember() =>\n        ClassifierTestHarness.AssertTokenTypes(\"\"\"\n            public class [t:TestClass] { }\n            public struct [t:TestStruct] { }\n            public record [t:TestRecord] { }\n            public record struct [t:TestRecordStruct] { }\n            public delegate void [t:TestDelegate]();\n            public enum [t:TestEnum] { [u:EnumMember] }\n            \"\"\", allowSemanticModel: false);\n\n    [TestMethod]\n    public void IdentifierToken_TupleDesignation() =>\n        ClassifierTestHarness.AssertTokenTypes(\"\"\"\n            class Test\n            {\n                void M()\n                {\n                    [k:var] ([u:i], [u:j]) = (1, 2);\n                    (int [u:i], int [u:j]) [u:t];\n                }\n            }\n            \"\"\", allowSemanticModel: false);\n\n    [TestMethod]\n    public void IdentifierToken_FunctionPointerUnmanagedCallingConvention() =>\n        ClassifierTestHarness.AssertTokenTypes(\"\"\"\n            unsafe class Test\n            {\n                void M(delegate* unmanaged[[u:Cdecl]]<int, int> m) { }\n            }\n            \"\"\", allowSemanticModel: false);\n\n    [TestMethod]\n    public void IdentifierToken_ExternAlias() =>\n        ClassifierTestHarness.AssertTokenTypes(\"\"\"\n            extern alias [u:ThisIsAnAlias];\n            public class Test {\n            }\n            \"\"\", allowSemanticModel: false, ignoreCompilationErrors: true);\n\n    [TestMethod]\n    public void IdentifierToken_AccessorDeclaration() =>\n        ClassifierTestHarness.AssertTokenTypes(\"\"\"\n            public class Test {\n                public string Property { [u:unknown]; }\n            }\n            \"\"\", allowSemanticModel: false, ignoreCompilationErrors: true);\n\n    [TestMethod]\n    [DataRow(\"assembly\")]\n    [DataRow(\"module\")]\n    [DataRow(\"event\")]\n    [DataRow(\"field\")]\n    [DataRow(\"method\")]\n    [DataRow(\"param\")]\n    [DataRow(\"property\")]\n    [DataRow(\"return\")]\n    [DataRow(\"type\")]\n    [DataRow(\"typevar\")]\n    public void IdentifierToken_AttributeTargetSpecifier_Keyword(string specifier) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            [[k:{{specifier}}]:System.Obsolete]\n            public class Test {\n            }\n            \"\"\", allowSemanticModel: false, ignoreCompilationErrors: true);\n\n    [TestMethod]\n    public void IdentifierToken_AttributeTargetSpecifier_UnknownSpecifier() =>\n        ClassifierTestHarness.AssertTokenTypes(\"\"\"\n            [[k:unknown]:System.Obsolete]\n            public class Test {\n            }\n            \"\"\", allowSemanticModel: false, ignoreCompilationErrors: true);\n\n    [TestMethod]\n    [DataRow(\"using [u:System];\", false)]\n    [DataRow(\"using [u:System].[u:Collections].[u:Generic];\", false)]\n    [DataRow(\"using [k:global]::[u:System].[u:Collections].[u:Generic];\", false)]\n    [DataRow(\"using [t:X] = System.Math;\", true)]\n    [DataRow(\"using X = [u:System].Math;\", true)]\n    [DataRow(\"using X = System.[t:Math];\", true)]\n    [DataRow(\"using X = [t:InGlobalNamespace];\", true)]\n    [DataRow(\"using X = [k:global]::[t:InGlobalNamespace];\", true)]\n    [DataRow(\"using [u:X] = System.Collections;\", true)]\n    [DataRow(\"using X = [u:System].Collections;\", true)]\n    [DataRow(\"using X = System.[u:Collections];\", true)]\n    [DataRow(\"using [k:static] [u:System].[t:Math];\", true)]\n    [DataRow(\"using [k:static] [u:System].[u:Collections].[u:Generic].[t:List]<[k:int]>;\", true)]\n    [DataRow(\"using [k:static] [u:System].[u:Collections].[u:Generic].[t:List]<[u:System].[u:Collections].[u:Generic].[t:List]<[k:int]>>;\", true)]\n    [DataRow(\"using [k:static] [u:System].[u:Collections].[u:Generic].[t:HashSet]<[k:int]>.[t:Enumerator];\", true)]\n#if NET\n    [DataRow(\"using [u:System].[u:Buffers];\", false)]\n#endif\n    public void IdentifierToken_Usings(string usings, bool allowSemanticModel = true) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            {{usings}}\n\n            class InGlobalNamespace { }\n            \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"namespace [u:A] { }\", false)]\n    [DataRow(\"namespace [u:A].[u:B] { }\", false)]\n    [DataRow(\"namespace [u:A];\", false)]\n    [DataRow(\"namespace [u:A].[u:B];\", false)]\n    public void IdentifierToken_Namespaces(string syntax, bool allowSemanticModel = true) =>\n        ClassifierTestHarness.AssertTokenTypes(syntax, allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"class TypeParameter: [t:List]<[t:Exception]> { }\", false)]\n    // We cannot be sure without calling the model but we assume this will rarely be a type\n    [DataRow(\"class TypeParameter: System.Collections.Generic.[t:List]<System.[t:Exception]> { }\", false)]\n    [DataRow(\"class TypeParameter: [u:System].[u:Collections].[u:Generic].List<[u:System].Exception> { }\", true)]\n    [DataRow(\"class TypeParameter: [t:List]<[t:List]<[t:Exception]>> { }\", false)]\n    [DataRow(\"class TypeParameter: [t:Outer].Inner { }\", true)]\n    [DataRow(\"class TypeParameter: Outer.[t:Inner] { }\", false)]\n    [DataRow(\"class TypeParameter: [t:HashSet]<[t:List]<[k:int]>> { }\", false)]\n    [DataRow(\"class TypeParameter<T> : [t:List]<T> where T: [t:List]<[t:Exception]> { }\", false)]\n    [DataRow(\"class TypeParameter<[t:T]> : List<[t:T]> where [t:T]: List<Exception> { }\", false)]\n    [DataRow(\"class TypeParameter<[t:T1], [t:T2]> where [t:T1] : class where [t:T2] : [t:T1], new() { }\", false)]\n    public void IdentifierToken_TypeParameters(string syntax, bool allowSemanticModel = true) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            using System;\n            using System.Collections.Generic;\n            class Outer { public class Inner { } }\n            {{syntax}}\n            \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"class [t:BaseTypeList]: System.[t:Exception] { }\", false)]\n    [DataRow(\"class BaseTypeList: [u:System].Exception { }\", true)]\n    [DataRow(\"class BaseTypeList: Outer.[t:Inner] { }\", false)]\n    [DataRow(\"class BaseTypeList: [t:Outer].Inner { }\", true)]\n    [DataRow(\"\"\"\n             class BaseTypeList: [t:IFormattable], [t:IFormatProvider]\n             {\n                public object? GetFormat(Type? formatType) => default;\n                public string ToString(string? format, IFormatProvider? formatProvider) => default;\n             }\n             \"\"\", false)]\n    public void IdentifierToken_BaseTypeList(string syntax, bool allowSemanticModel = true) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            using System;\n            class Outer { public class Inner { } }\n            {{syntax}}\n            \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"class\", false)]\n    [DataRow(\"struct\", false)]\n    [DataRow(\"record\", false)]\n    [DataRow(\"record struct\", false)]\n#if NET\n    [DataRow(\"interface\", false)]\n#endif\n    public void IdentifierToken_BaseTypeList_DifferentTypeKind(string syntax, bool allowSemanticModel = true) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            {{syntax}} X : System.[t:IFormattable]\n            {\n                public string ToString(string? format, System.IFormatProvider? formatProvider) => null;\n            }\n            \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"_ = typeof(System.[t:Exception]);\", false)]\n    [DataRow(\"_ = typeof([u:System].Exception);\", true)]\n    [DataRow(\"_ = typeof([u:System].[u:Collections].[u:Generic].[t:Dictionary]<,>);\", true)]\n    [DataRow(\"_ = typeof([t:Inner]);\", false)]\n    [DataRow(\"_ = typeof([t:C].[t:Inner]);\", true)]\n    [DataRow(\"_ = typeof([t:Int32][]);\", false)]\n    [DataRow(\"_ = typeof([t:Int32]*);\", false)]\n    [DataRow(\"_ = typeof([k:delegate]*<[t:Int32], void>);\", false)]\n    public void IdentifierToken_TypeOf(string syntax, bool allowSemanticModel = true) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            using System;\n            using System.Collections.Generic;\n            public class C\n            {\n                void TypeOf() { {{syntax}} }\n                public class Inner { }\n            }\n            \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"[t:Exception]\", false)]\n    [DataRow(\"[u:System].Exception\", true)]\n    [DataRow(\"System.[t:Exception]\", false)]\n    [DataRow(\"[t:List]<[t:Int32]>\", false)]\n    [DataRow(\"[t:List]<[t:Int32]>\", false)]\n    [DataRow(\"[t:HashSet]<[t:Int32]>.[t:Enumerator]\", false)]\n    [DataRow(\"System.Collections.Generic.[t:HashSet]<[t:Int32]>.[t:Enumerator]\", false)]\n    [DataRow(\"[u:System].[u:Collections].[u:Generic].HashSet<Int32>.Enumerator\", true)]\n    public void IdentifierToken_TypeInDeclaration(string type, bool allowSemanticModel = true) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            using System;\n            using System.Collections.Generic;\n            public class C\n            {\n                void Parameter({{type}} parameter)\n                {\n                }\n            }\n            \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"_ = nameof([t:Exception]);\", true)]\n    [DataRow(\"_ = nameof([u:System].[t:Exception]);\", true)]\n    [DataRow(\"_ = nameof([t:Dictionary]<[t:Int32], [t:Exception]>);\", true)]\n    [DataRow(\"_ = nameof([t:Dictionary]<[t:Int32], [u:System].[t:Exception]>);\", true)]\n    [DataRow(\"_ = nameof([u:System].[u:Collections].[u:Generic]);\", true)]\n    [DataRow(\"_ = nameof([u:NameOf]);\", true)]\n    [DataRow(\"_ = nameof([t:DateTimeKind].[u:Utc]);\", true)]\n    [DataRow(\"_ = nameof([t:Inner]);\", true)]\n    [DataRow(\"_ = nameof([t:C].[t:Inner]);\", true)]\n    public void IdentifierToken_NameOf(string syntax, bool allowSemanticModel = true) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            using System;\n            using System.Collections.Generic;\n            public class C\n            {\n                void NameOf() { {{syntax}} }\n                public class Inner { }\n            }\n            \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"_ = [k:value];\", true)]\n    [DataRow(\"_ = this.[u:value];\", false)]\n    [DataRow(\"int [u:Value] = 0; _ = [u:Value]++;\", false)]\n    [DataRow(\"_ = nameof([k:value]);\", true)]\n    [DataRow(\"_ = nameof([k:value].ToString);\", true)]\n    [DataRow(\"_ = [k:value].ToString();\", true)]\n    [DataRow(\"_ = [k:value].InnerException.InnerException;\", true)]\n    [DataRow(\"_ = [k:value]?.InnerException.InnerException;\", true)]\n    [DataRow(\"_ = [k:value].InnerException?.InnerException;\", true)]\n    [DataRow(\"_ = [k:value]?.InnerException?.InnerException;\", true)]\n    [DataRow(\"_ = [k:value] ?? new Exception();\", true)]\n    public void IdentifierToken_ValueInPropertySetter(string valueAccess, bool allowSemanticModel = true) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            using System;\n            using System.Collections.Generic;\n            public class C\n            {\n                private int value;\n\n                Exception Property\n                {\n                    set\n                    {\n                        {{valueAccess}}\n                    }\n                }\n            }\n            \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"_ = [k:value];\", true)]\n    [DataRow(\"_ = this.[u:value];\", false)]\n    [DataRow(\"int [u:Value] = 0; _ = [u:Value]++;\", false)]\n    public void IdentifierToken_ValueInIndexerSetter(string valueAccess, bool allowSemanticModel = true) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            using System;\n            using System.Collections.Generic;\n            public class C\n            {\n                private int value;\n\n                int this[int i]\n                {\n                    set\n                    {\n                        {{valueAccess}}\n                    }\n                }\n            }\n            \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"_ = [k:value];\", true)]\n    [DataRow(\"_ = this.[u:value];\", false)]\n    public void IdentifierToken_ValueInEventAddRemove(string valueAccess, bool allowSemanticModel = true) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            using System;\n            using System.Collections.Generic;\n            public class C\n            {\n                private int value;\n\n                event EventHandler SomeEvent\n                {\n                    add\n                    {\n                        {{valueAccess}}\n                    }\n                    remove\n                    {\n                        {{valueAccess}}\n                    }\n                }\n            }\n            \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"_ = [u:value];\", true)]\n    [DataRow(\"_ = this.[u:value];\", false)]\n    [DataRow(\"ValueMethod([u:value]: 1);\", true)] // could be false, but it is an edge case not worth investing.\n    [DataRow(\"ValueMethod(value: [u:value]);\", true)]\n    public void IdentifierToken_ValueInOtherPlaces(string valueAccess, bool allowSemanticModel = true) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            using System;\n            using System.Collections.Generic;\n            public class C\n            {\n                private int value;\n                public void M()\n                {\n                    int value = 0;\n                    {{valueAccess}}\n                }\n                public void ValueMethod(int value) { }\n            }\n            \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"[n:42] is [t:Int32].[u:MinValue]\", true)]                                          // IsPattern\n    [DataRow(\"ex is [t:ArgumentException]\", true)]\n    [DataRow(\"ex is [u:System].[t:ArgumentException]\", true)]\n    [DataRow(\"ex is [t:ArgumentException] [u:argEx]\", false)]\n    [DataRow(\"ex is ArgumentException { InnerException: [t:InvalidOperationException] }\", true)] // ConstantPattern: could also be a constant\n    [DataRow(\"ex is ArgumentException { HResult: [t:Int32].[u:MinValue] }\", true)]               // ConstantPattern: could also be a type\n    [DataRow(\"ex is ArgumentException { HResult: [n:2] }\", true)]\n    [DataRow(\"ex is ArgumentException { [u:InnerException]: [t:InvalidOperationException] { } }\", false)] // RecursivePattern.Type\n    [DataRow(\"ex is ArgumentException { [u:InnerException].[u:InnerException]: [t:InvalidOperationException] { } [u:inner] }\", true)] // TODO false, InnerException.InnerException can be classified without semModel\n    [DataRow(\"ex as [t:ArgumentException]\", false)]\n    [DataRow(\"ex as [u:System].ArgumentException\", true)]\n    [DataRow(\"([t:ArgumentException])ex\", false)]\n    [DataRow(\"([u:System].ArgumentException)ex\", true)]\n#if NET\n    [DataRow(\"new object[0] is [[t:Exception]];\", true)]\n    [DataRow(\"new object[0] is [[t:Int32].[u:MinValue]];\", true)]\n#endif\n    public void IdentifierToken_Expressions(string expression, bool allowSemanticModel = true) =>\n        ClassifierTestHarness.AssertTokenTypes(\n            $$\"\"\"\n              using System;\n              using System.Collections.Generic;\n              public class Test\n              {\n                  public void M(Exception ex)\n                  {\n                      var x = {{expression}};\n                  }\n              }\n              \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"([k:string], [t:Exception]) => true,\", true)]\n    [DataRow(\"\"\"([s:\"\"], [k:null]) => true,\"\"\", true)]\n    [DataRow(\"\"\"([s:\"\"], [k:var] b) => true,\"\"\", true)]\n    [DataRow(\"([t:String] a, [t:Exception] b) => 1,\", true)]\n    [DataRow(\"([u:System].[t:String] a, [u:System].[t:Exception] b) => 1,\", true)]\n    [DataRow(\"([t:HashSet]<[t:Int32]> a, null) => 1,\", true)]\n    [DataRow(\"([t:List]<[t:List]<[t:Int32]>> a, null) => 1,\", true)]\n    [DataRow(\"([t:Test].[t:Inner], null) => 1,\", true)]\n    [DataRow(\"([t:Inner], null) => 1,\", true)]\n    [DataRow(\"([u:first]: [t:Inner], [u:second]: null) => 1,\", true)]\n    [DataRow(\"\"\"(\"\", [t:ArgumentException] { HResult: > 2 }) => true,\"\"\", false)]\n    [DataRow(\"(([t:Int32], System.[t:String], Int32.[u:MaxValue]), second: null) => 1,\", true)]\n    public void IdentifierToken_Tuples(string switchBranch, bool allowSemanticModel = true) =>\n        ClassifierTestHarness.AssertTokenTypes(\n            $$\"\"\"\n              using System;\n              using System.Collections.Generic;\n              public class Test\n              {\n                  public void M(Object o, Exception exception)\n                  {\n                      var x = (first: o, second: exception) switch\n                      {\n                          {{switchBranch}}\n                          _ => default,\n                      };\n                  }\n                  public class Inner { }\n              }\n              \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"([t:String] s1, [t:String] s2)\", false)]\n    [DataRow(\"([u:System].String s1, int i)\", true)]\n    [DataRow(\"(([t:String] s, [k:int] i), [t:Boolean] b)\", false)]\n    public void IdentifierToken_TupleDeclaration(string tupleDeclaration, bool allowSemanticModel = true) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            using System;\n            public class Test\n            {\n                public {{tupleDeclaration}} M() => default;\n            }\n            \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"[t:Exception] ex;\", false)]\n    [DataRow(\"[u:System].Exception ex;\", true)]\n    [DataRow(\"[t:List]<[t:Exception]> ex;\", false)]\n    [DataRow(\"List<[u:System].Exception> ex;\", true)]\n    [DataRow(\"[k:var] i = 1;\", false)]\n    [DataRow(\"[k:dynamic] i = 1;\", false)]\n    public void IdentifierToken_LocalDeclaration(string declaration, bool allowSemanticModel = true) =>\n        ClassifierTestHarness.AssertTokenTypes(\n            $$\"\"\"\n              using System;\n              using System.Collections.Generic;\n              public class Test\n              {\n                  public void M()\n                  {\n                      {{declaration}}\n                  }\n              }\n              \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"__refvalue([u:tf], Exception)\", false)]\n    [DataRow(\"__refvalue(tf, [t:Exception])\", false)]\n    [DataRow(\"__refvalue(tf, [u:System].Exception)\", true)]\n    [DataRow(\"__refvalue(tf, System.[t:Exception])\", false)]\n    public void IdentifierToken_Type_RefValue(string refValueExpression, bool allowSemanticModel = true) =>\n        ClassifierTestHarness.AssertTokenTypes(\n            $$\"\"\"\n              using System;\n\n              public class Test\n              {\n                  public void M(TypedReference tf)\n                  {\n                      Exception tfValue = {{refValueExpression}};\n                  }\n              }\n              \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"default([t:Exception])\", false)]\n    [DataRow(\"default([u:System].Exception)\", true)]\n    public void IdentifierToken_Type_DefaultValue(string defaultValueExpression, bool allowSemanticModel = true) =>\n        ClassifierTestHarness.AssertTokenTypes(\n            $$\"\"\"\n              using System;\n\n              public class Test\n              {\n                  public void M()\n                  {\n                      var x = {{defaultValueExpression}};\n                  }\n              }\n              \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"sizeof([t:Int32])\", false)]\n    [DataRow(\"sizeof([u:System].Int32)\", true)]\n    public void IdentifierToken_Type_SizeOfValue(string sizeOfExpression, bool allowSemanticModel = true) =>\n        ClassifierTestHarness.AssertTokenTypes(\n            $$\"\"\"\n              using System;\n\n              public class Test\n              {\n                  public void M()\n                  {\n                      var x = {{sizeOfExpression}};\n                  }\n              }\n              \"\"\", allowSemanticModel);\n\n#if NET\n\n    [TestMethod]\n    [DataRow(\"stackalloc [t:Int32][2]\", false)]\n    [DataRow(\"stackalloc [u:System].Int32[2]\", true)]\n    [DataRow(\"stackalloc [t:Int32]\", false, true)] // compilation error. Type can not be resolved (must be an array type)\n    public void IdentifierToken_Type_StackAlloc(string stackAllocExpression, bool allowSemanticModel = true, bool ignoreCompilationErrors = false) =>\n        ClassifierTestHarness.AssertTokenTypes(\n            $$\"\"\"\n              using System;\n\n              public class Test\n              {\n                  public void M()\n                  {\n                      Span<int> x = {{stackAllocExpression}};\n                  }\n              }\n              \"\"\", allowSemanticModel, ignoreCompilationErrors);\n\n    [TestMethod]\n    [DataRow(\"[t:Int32]\", false)]\n    [DataRow(\"[t:Int32]?\", false)]\n    [DataRow(\"System.[t:Int32]\", false)]\n    [DataRow(\"System.Nullable<[t:Int32]>\", false)]\n    [DataRow(\"[t:T]\", false)]\n    public void IdentifierToken_Type_Ref(string refTypeName, bool allowSemanticModel = true) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            using System;\n\n            public class Test<T>\n            {\n                {{refTypeName}} item;\n\n                public ref {{refTypeName}} M()\n                {\n                    return ref item;\n                }\n            }\n            \"\"\", allowSemanticModel);\n\n#endif\n\n    [TestMethod]\n    [DataRow(\"\"\"\n        from [t:Int32] x in c\n        select x\n        \"\"\", false)]\n    [DataRow(\"\"\"\n        from [u:System].Int32 x in c\n        select x\n        \"\"\", true)]\n    [DataRow(\"\"\"\n        from x in c\n        join [t:Int32] y in c on x equals y into g\n        select g\n        \"\"\", false)]\n    public void IdentifierToken_Type_QueryComprehensions(string query, bool allowSemanticModel = true) =>\n    ClassifierTestHarness.AssertTokenTypes(\n        $$\"\"\"\n              using System;\n              using System.Linq;\n\n              public class Test\n              {\n                  public void M()\n                  {\n                      var c = new long[0];\n                      _ = {{query}};\n                  }\n              }\n              \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"[t:Int32]\", false)]\n    [DataRow(\"[u:System].Int32\", true)]\n    public void IdentifierToken_Type_ForEach(string forEachVariableType, bool allowSemanticModel = true) =>\n        ClassifierTestHarness.AssertTokenTypes(\n            $$\"\"\"\n              using System;\n\n              public class Test\n              {\n                  public void M()\n                  {\n                      foreach ({{forEachVariableType}} x in new int[0]) { }\n                  }\n              }\n              \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"[t:Exception]\", false)]\n    [DataRow(\"[u:System].Exception\", true)]\n    public void IdentifierToken_Type_Catch(string catchType, bool allowSemanticModel = true) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            using System;\n\n            public class Test\n            {\n                public void M()\n                {\n                    try { }\n                    catch ({{catchType}} ex) { }\n                }\n            }\n            \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"[t:Int32]\", false)]\n    [DataRow(\"[u:System].Int32\", true)]\n    public void IdentifierToken_Type_DelegateDeclaration(string returnType, bool allowSemanticModel = true) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            using System;\n\n            delegate {{returnType}} M();\n            \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"[t:Int32]\", false)]\n    [DataRow(\"[u:System].Int32\", true)]\n    public void IdentifierToken_Type_MethodDeclaration(string returnType, bool allowSemanticModel = true) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            using System;\n\n            public class Test\n            {\n                public {{returnType}} M() => default;\n            }\n            \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"[t:Int32]\", false)]\n    [DataRow(\"[u:System].Int32\", true)]\n    public void IdentifierToken_Type_OperatorDeclaration(string returnType, bool allowSemanticModel = true) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            using System;\n\n            public class Test\n            {\n                public static {{returnType}} operator + (Test x) => default;\n            }\n            \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"public static explicit operator [t:Int32](Test x)\", false)]\n    [DataRow(\"public static explicit operator [u:System].Int32(Test x)\", true)]\n    [DataRow(\"public static implicit operator [t:Int32](Test x)\", false)]\n    [DataRow(\"public static implicit operator [u:System].Int32(Test x)\", true)]\n    public void IdentifierToken_Type_ConversionOperatorDeclaration(string conversion, bool allowSemanticModel = true) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            using System;\n\n            public class Test\n            {\n                {{conversion}} => default;\n            }\n            \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"public [t:Int32] Prop { get; set; }\", false)]\n    [DataRow(\"public [t:Int32] Prop { get => 1; set { } }\", false)]\n    [DataRow(\"public [t:Int32] this[int index] { get => 1; set { } }\", false)]\n    [DataRow(\"public event [t:EventHandler] E;\", false)]\n    [DataRow(\"public event [t:EventHandler] E { add { }  remove { } }\", false)]\n    public void IdentifierToken_Type_PropertyDeclaration(string property, bool allowSemanticModel = true) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            using System;\n\n            public class Test\n            {\n                {{property}}\n            }\n            \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"public [k:partial] [t:Int32] Prop { get; set; }\", \"public [k:partial] Int32 Prop { get => 1; set { } }\")]\n    [DataRow(\"public partial [t:Int32] this[int index] { get; set; }\", \"public partial Int32 this[int index] { get => 1; set { } }\")]\n    public void IdentifierToken_Type_PartialPropertyDeclaration(string propertyDeclaration, string propertyImplementation) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            using System;\n\n            public partial class Test\n            {\n                {{propertyDeclaration}}\n            }\n            public partial class Test\n            {\n                {{propertyImplementation}}\n            }\n            \"\"\");\n\n    [TestMethod]\n    [DataRow(\"[t:Int32]\", false)]\n    [DataRow(\"[u:System].Int32\", true)]\n    public void IdentifierToken_Type_LocalFunction(string returnType, bool allowSemanticModel = true) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            using System;\n\n            public class Test\n            {\n                public void M()\n                {\n                    {{returnType}} LocalFunction() => default;\n                }\n            }\n            \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"[t:Int32]\", false)]\n    [DataRow(\"[u:System].Int32\", true)]\n    public void IdentifierToken_Type_ParenthesizedLambda(string returnType, bool allowSemanticModel = true) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            using System;\n\n            public class Test\n            {\n                public void M()\n                {\n                    var _ = {{returnType}}() => default;\n                }\n            }\n            \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"[[t:Obsolete]]\", false)]\n    [DataRow(\"[[u:System].Obsolete]\", true)]\n    public void IdentifierToken_Type_Attribute(string attributeDeclaration, bool allowSemanticModel = true) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            using System;\n\n            {{attributeDeclaration}}\n            public class Test\n            {\n            }\n            \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"[t:IFormattable]\", false)]\n    [DataRow(\"[u:System].IFormattable\", true)]\n    public void IdentifierToken_Type_ExplicitInterfaceSpecifier(string interfaceName, bool allowSemanticModel = true) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            using System;\n\n            public class Test: IFormattable\n            {\n                string {{interfaceName}}.ToString(string? format, IFormatProvider? formatProvider) => default;\n            }\n            \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"[t:Int32]?\", false)]\n    [DataRow(\"[u:System].Int32?\", true)]\n    [DataRow(\"[k:int]?\", false)]\n    [DataRow(\"[t:IDisposable]?\", false)]\n    [DataRow(\"[t:IDisposable]?[]\", false)]\n    [DataRow(\"[t:IDisposable]?[]?\", false)]\n    public void IdentifierToken_Type_Nullable(string typeName, bool allowSemanticModel = true) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            #nullable enable\n\n            using System;\n\n            public class Test\n            {\n                {{typeName}} someField;\n            }\n            \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"[k:global]::[t:Test]\", false)]\n    [DataRow(\"[k:global]::[u:System].Int32\", true)]\n    [DataRow(\"[k:global]::System.[t:Int32]\", false)]\n    public void IdentifierToken_Type_Global(string typeName, bool allowSemanticModel = true) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            using System;\n\n            public class Test\n            {\n                {{typeName}} M() => default;\n            }\n            \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"[u:aInstance]\", false)]                              // Some simple identifier syntax in an ordinary expression context must be boud to a field/property/local or something else that produces a value, but it can not be a type\n    [DataRow(\"[u:ToString]()\", false)]                             // Some simple invocation syntax in an ordinary expression. A type can not be invoked.\n    [DataRow(\"aInstance.InstanceProp.[u:InstanceProp]\", false)]    // Most right can not be a type in an ordinary expression context\n    [DataRow(\"[u:aInstance].[u:InstanceProp].InstanceProp\", true)] // Could be types\n    [DataRow(\"[t:A].StaticProp\", true)]                            // Here it starts with a type\n    [DataRow(\"A.[u:StaticProp]\", false)]                           // Most right hand side can not be a type\n    [DataRow(\"[t:A].[t:B].[u:StaticProp].InstanceProp\", true)]     // Mixture: some nested types and then properties\n    [DataRow(\"A.B.StaticProp.[u:InstanceProp]\", false)]            // The most right hand side\n    [DataRow(\"A.B.[u:StaticProp]?.[u:InstanceProp]\", false)]       // Can not be a type on the left side of a ?.\n    [DataRow(\"[u:Prop]?.[u:InstanceProp]?.[u:InstanceProp]\", false)] // Can not be a type on the left side of a ?. or on the right\n    [DataRow(\"global::[t:A].StaticProp\", true)]                    // Can be a namespace or type\n    [DataRow(\"this.[u:Prop]\", false)]                              // Right of this: must be a property/field\n    [DataRow(\"int.[u:MaxValue]\", false)]                           // Right of pre-defined type: must be a property/field because pre-defined types do not have nested types\n    [DataRow(\"this.[u:Prop].[u:InstanceProp].[u:InstanceProp]\", false)] // must be properties or fields\n    [DataRow(\"(true ? Prop : Prop).[u:InstanceProp].[u:InstanceProp]\", false)] // Right of some expression: must be properties or fields\n    [DataRow(\"[t:A]<int>.StaticProp\", true)] // TODO: false, Generic name. Must be a type because not in an invocation context, like A<int>()\n    [DataRow(\"A<int>.[u:StaticProp]\", false)] // Most right hand side\n    [DataRow(\"A<int>.[u:StaticProp].InstanceProp\", true)] // Not the right hand side, could be a nested type\n    [DataRow(\"A<int>.[t:B].StaticProp\", true)] // Not the right hand side, is a nested type\n    [DataRow(\"[t:A]<int>.[u:StaticProp]?.[u:InstanceProp]\", true)] // TODO: false, Can all be infered from the positions\n    [DataRow(\"[t:A]<int>.[t:B]<int>.[u:StaticProp]\", true)] // TODO: false, Generic names must be types and StaticProp is most right hand side\n    [DataRow(\"[t:A]<int>.[u:StaticM]<int>().[u:InstanceProp]\", true)] // TODO: false, A must be a type StaticM is invoked and InstanceProp is after the invocation\n    [DataRow(\"A<int>.StaticM<int>().[u:InstanceProp].InstanceProp\", false)] // Is right from invocation\n    public void IdentifierToken_SimpleMemberAccess_InOrdinaryExpression(string memberAccessExpression, bool allowSemanticModel) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            public class A\n            {\n                public static A StaticProp { get; }\n                public A InstanceProp { get; }\n                public A this[int i] => new A();\n\n                public class B\n                {\n                    public static A StaticProp { get; }\n                }\n            }\n\n            public class A<TA> : A\n            {\n                public A<TA> InstanceProp { get; }\n                public static A<TA> StaticProp { get; }\n\n                public class B<TB> : B\n                {\n                    public static B<TB> StaticProp { get; }\n                    public A<TM> M<TM>() => new A<TM>();\n                    public static A<TM> StaticM<TM>() => new A<TM>();\n                }\n\n                public A<TM> M<TM>() => new A<TM>();\n                public static A<TM> StaticM<TM>() => new A<TM>();\n            }\n\n            public class Test\n            {\n                public A Prop { get; }\n                public void M()\n                {\n                    var aInstance = new A<int>();\n                    // Ordinary expression context: no typeof(), no nameof(), no ExpressionColon (in pattern) or the like\n                    _ = {{memberAccessExpression}};\n                }\n            }\n            \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"M([u:MethodGroup]<int>);\", false)]\n    [DataRow(\"M([u:MethodGroup]<T>);\", false)]\n    [DataRow(\"M(C<T>.[u:StaticMethodGroup]<T>);\", false)]\n    [DataRow(\"global::[u:System].Diagnostics.Debug.WriteLine(\\\"Message\\\");\", true)]\n    [DataRow(\"global::System.Diagnostics.[t:Debug].WriteLine(\\\"Message\\\");\", true)]\n    [DataRow(\"M([t:C]<T>.StaticMethodGroup<T>);\", true)] // TODO false, must be a type\n    public void IdentifierToken_SimpleMemberAccess_GenericMethodGroup(string invocation, bool allowSemanticModel) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            using System;\n\n            public class C<T> {\n                public void M(Action a)\n                {\n                    {{invocation}}\n                }\n\n                public void MethodGroup<TM>() { }\n\n                public static void StaticMethodGroup<TM>() { }\n            }\n            \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"_ = [u:i];\")]\n    [DataRow(\"[u:i] = [u:i] + [u:i];\")]\n    [DataRow(\"_ = [u:i].[u:ToString]().[u:ToString]();\")]          // Heuristic: \"i\" is lower case and identified as \"not a type\".\n    [DataRow(\"_ = [u:ex].[u:InnerException].[u:InnerException];\")] // Heuristic: \"ex\" is lower case and identified as \"not a type\".\n    [DataRow(\"_ = [u:ex]?.[u:ToString]();\")]\n    [DataRow(\"_ = ([u:ex] ?? new Exception()).[u:ToString]();\")]\n    [DataRow(\"[u:ex] ??= new Exception();\")]\n    [DataRow(\"_ = String.Format([k:string].[u:Empty], [u:i]);\")]\n    [DataRow(\"_ = [u:ex] is ArgumentException { };\")]\n    [DataRow(\"_ = [u:i] == [u:i] ? [u:b] : ![u:b];\")]\n    [DataRow(\"if ([u:i] == [u:i]) { }\")]\n    [DataRow(\"if ([u:b]) { }\")]\n    [DataRow(\"switch ([u:i]) { }\")]\n    [DataRow(\"_ = [u:i] switch { _ => true };\")]\n    [DataRow(\"foreach (var [u:e] in [u:l]) { }\")]\n    [DataRow(\"for(int [u:x] = 0; [u:b]; [u:x]++) { }\")]\n    [DataRow(\"while([u:b]) { }\")]\n    [DataRow(\"do i++; while([u:b]);\")]\n    [DataRow(\"_ = l.[u:Where]([u:x] => [u:x] == null);\")]\n    [DataRow(\"_ = ([u:i], [u:i]);\")]\n    [DataRow(\"_ = int.TryParse(string.Empty, out [u:i]);\")]\n    [DataRow(\"_ = new int[[u:i]];\")]\n    [DataRow(\"await [u:t];\")]\n    [DataRow(\"_ = unchecked([u:i] + [u:i]);\")]\n    [DataRow(\"_ = [u:l][[u:i]];\")]\n    [DataRow(\"_ = (byte)([u:i]);\")]\n    [DataRow(\"_ = new { [u:A] = [u:i] };\")]\n    [DataRow(\"\"\"\n        _ = from [u:x] in [u:l]\n            select x;\n        \"\"\")]\n    [DataRow(\"\"\"\n        _ = from [u:x] in [u:l]\n            let [u:y] = [u:x]\n            join [u:z] in [u:l] on [u:x] equals [u:z]\n            where [u:x] == [u:z]\n            orderby [u:x], [u:z]\n            select new { [u:x], Y = [u:y] };\n        \"\"\")]\n    [DataRow(\"_ = ([u:i]);\")]\n    [DataRow(\"_ = +[u:i];\")]\n    [DataRow(\"_ = ++[u:i];\")]\n    [DataRow(\"_ = -[u:i];\")]\n    [DataRow(\"_ = --[u:i];\")]\n    [DataRow(\"_ = ~[u:i];\")]\n    [DataRow(\"_ = ![u:b];\")]\n    [DataRow(\"_ = [u:i]++;\")]\n    [DataRow(\"_ = [u:i]--;\")]\n    [DataRow(\"_ = [u:l]!;\")]\n    [DataRow(\"_ = [u:i] + [u:i];\")]\n    [DataRow(\"_ = [u:i] - [u:i];\")]\n    [DataRow(\"_ = [u:i] / [u:i];\")]\n    [DataRow(\"_ = [u:i] * [u:i];\")]\n    [DataRow(\"_ = [u:i] % [u:i];\")]\n    [DataRow(\"_ = [u:i] >> [u:i];\")]\n    [DataRow(\"_ = [u:i] << [u:i];\")]\n    [DataRow(\"_ = [u:b] && [u:b];\")]\n    [DataRow(\"_ = [u:b] || [u:b];\")]\n    [DataRow(\"_ = [u:i] & [u:i];\")]\n    [DataRow(\"_ = [u:i] | [u:i];\")]\n    [DataRow(\"_ = [u:i] ^ [u:i];\")]\n    [DataRow(\"_ = [u:i] == [u:i];\")]\n    [DataRow(\"_ = [u:i] != [u:i];\")]\n    [DataRow(\"_ = [u:i] < [u:i];\")]\n    [DataRow(\"_ = [u:i] <= [u:i];\")]\n    [DataRow(\"_ = [u:i] > [u:i];\")]\n    [DataRow(\"_ = [u:i] >= [u:i];\")]\n    [DataRow(\"_ = [u:i] is iConst;\")] // iConst could be a type\n    [DataRow(\"_ = [u:ex] as [t:ArgumentException];\")]\n    [DataRow(\"_ = [u:ex] ?? [u:ex];\")]\n    [DataRow(\"i += [u:i];\")]\n    [DataRow(\"i -= [u:i];\")]\n    [DataRow(\"i *= [u:i];\")]\n    [DataRow(\"i /= [u:i];\")]\n    [DataRow(\"i %= [u:i];\")]\n    [DataRow(\"i &= [u:i];\")]\n    [DataRow(\"i ^= [u:i];\")]\n    [DataRow(\"i |= [u:i];\")]\n    [DataRow(\"i >>= [u:i];\")]\n    [DataRow(\"i <<= [u:i];\")]\n    [DataRow(\"ex ??= [u:ex];\")]\n    [DataRow(\"Func<int> _ = delegate() { return [u:i]; };\")] // Illustration: There is an AnonymousMethodExpressionSyntax.ExpressionBody property, but it is never set. Only block syntax is allowed.\n    [DataRow(\"Func<int> _ = () => [u:i];\")]\n    [DataRow(\"Func<int, int> _ = [u:i] => [u:i];\")]\n    [DataRow(\"_ = [u:b] ? 1 : throw [u:ex];\")]\n    [DataRow(\"_ = ex switch { _ when [u:b] => true };\")]\n    [DataRow(\"_ = i switch { [u:iConst] => true };\", true)] // could be a type\n    [DataRow(\"_ = i switch { >[u:iConst] => [u:b] };\")]\n    [DataRow(\"\"\"_ = $\"{[u:i]}\";\"\"\")]\n    [DataRow(\"\"\"_ = $\"{[u:i]:000}\";\"\"\")]\n    [DataRow(\"\"\"_ = $\"{[u:i],[u:iConst]}\";\"\"\")]\n    [DataRow(\"\"\"\n        switch(i)\n        {\n            case 42:\n                goto case [u:iConst];\n            case iConst:\n                break;\n        }\n        \"\"\")]\n    [DataRow(\"\"\"\n        switch(AttributeTargets.Assembly)\n        {\n            case AttributeTargets.Class:\n                goto case AttributeTargets.[u:Enum];\n            case AttributeTargets.Enum:\n                break;\n        }\n        \"\"\")]\n    [DataRow(\"\"\"\n        goto [u:label];\n        label: ;\n        \"\"\")]\n    [DataRow(\"return [u:i];\")]\n    [DataRow(\"throw [u:ex];\")]\n    [DataRow(\"IEnumerable<int> YieldReturn() { yield return [u:i]; }\")]\n    [DataRow(\"using(var x = [u:d]);\")]\n    [DataRow(\"lock([u:d]);\")]\n    [DataRow(\"try { } catch when ([u:b]) { }\")]\n    public void IdentifierToken_SingleExpressionIdentifier(string statement, bool allowSemanticModel = false) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            using System;\n            using System.Collections.Generic;\n            using System.Linq;\n            using System.Threading.Tasks;\n\n            public class Test\n            {\n                public async Task<int> M()\n                {\n                    const int iConst = 0;\n                    var b = true;\n                    var i = 0;\n                    var ex = new Exception();\n                    var l = new List<Exception>();\n                    Task t = null;\n                    IDisposable d = null;\n                    {{statement}}\n                    return 0;\n                }\n            }\n            \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [WorkItem(8388)] // https://github.com/SonarSource/sonar-dotnet/pull/8388\n    [DataRow(\"\"\"_ = [u:iPhone].Latest;\"\"\")]              // [u:iPhone] -> False classification because of heuristic. Should be t:\n    [DataRow(\"\"\"_ = [u:iPhone].[u:Latest];\"\"\")]          // [u:iPhone] -> False classification because of heuristic. Should be t:\n    [DataRow(\"\"\"[u:iPhone].[u:iPhone15Pro].[u:M]();\"\"\")] // [u:iPhone] -> False classification because of heuristic. Should be t:\n    [DataRow(\"\"\"[u:iPhone15Pro].[u:M]();\"\"\")]            // Correct\n    public void IdentifierToken_MemberAccess_FalseClassification(string statement) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            public class iPhone\n            {\n                public static iPhone iPhone15Pro;\n                public static iPhone Latest;\n\n                public void M()\n                {\n                    {{statement}}\n                }\n            }\n            \"\"\", allowSemanticModel: false);\n#if NET\n\n    [TestMethod]\n    [DataRow(\"_ = [u:r] with { [u:A] = [u:iConst] };\", false)]\n    [DataRow(\"_ = [u:r] is ([u:iConst], [t:Int32]);\", true)] // semantic model must be called for iConst and Int32\n    [DataRow(\"_ = [u:l][^[u:iConst]];\", false)]\n    [DataRow(\"_ = [u:a][[u:iConst]..^([u:iConst]-1)];\", false)]\n    [DataRow(\"foreach((var [u:x], int [u:y]) in ts);\", false)]\n    [DataRow(\"foreach(var ([u:x], [u:y]) in ts);\", false)]\n    public void IdentifierToken_SingleExpressionIdentifier_NetCore(string statement, bool allowSemanticModel) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            using System;\n            using System.Collections.Generic;\n            using System.Linq;\n            using System.Threading.Tasks;\n\n            public record R(int A, int B);\n\n            public class Test\n            {\n                public async Task M()\n                {\n                    const int iConst = 0;\n                    var l = new List<Exception>();\n                    var ts = new (int, int)[0];\n                    var a = new int[0];\n                    var r = new R(1, 1);\n                    {{statement}}\n                }\n            }\n            \"\"\", allowSemanticModel);\n\n#endif\n\n    [TestMethod]\n    [DataRow(\"[Obsolete([u:sConst])]\")]\n    [DataRow(\"[AttributeUsage(AttributeTargets.All, AllowMultiple = [u:bConst])]\")]\n    [DataRow(\"[AttributeUsage([t:AttributeTargets].All, AllowMultiple = [u:bConst])]\", true)]\n    public void IdentifierToken_SingleExpressionIdentifier_Attribute(string attribute, bool allowSemanticModel = false) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            using System;\n            using System.Collections.Generic;\n            using System.Linq;\n            using System.Threading.Tasks;\n\n            {{attribute}}\n            public class TestAttribute: Attribute\n            {\n                const string sConst =\"Test\";\n                const bool bConst = true;\n            }\n            \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"[u:System]\", true)]\n    [DataRow(\"[t:Exception]\", true)]\n    [DataRow(\"[t:List]<[t:Int32]>\", true)] // TODO false, generic names are always types in nameof\n    [DataRow(\"[t:HashSet]<[t:Int32]>.Enumerator\", true)]\n    [DataRow(\"HashSet<Int32>.[t:Enumerator]\", true)]\n    [DataRow(\"[u:System].[u:Linq].[t:Enumerable].[u:Where]\", true)]\n    public void IdentifierToken_SimpleMemberAccess_NameOf(string memberaccess, bool allowSemanticModel) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            using System;\n            using System.Collections.Generic;\n            public class C\n            {\n                public void M()\n                {\n                    _ = nameof({{memberaccess}});\n                }\n            }\n            \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"{ [u:InnerException].[u:InnerException]: {} }\", true)] // TODO false, in SubpatternSyntax.ExpressionColon context. Must be properties\n    [DataRow(\"{ [u:InnerException].[u:InnerException].[u:Data]: {} }\", true)] // TODO false, in SubpatternSyntax.ExpressionColon context. Must be properties\n    public void IdentifierToken_SimpleMemberAccess_ExpressionColon(string pattern, bool allowSemanticModel) =>\n        // found in SubpatternSyntax.ExpressionColon\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            using System;\n            using System.Collections.Generic;\n            public class C\n            {\n                public void M(Exception ex)\n                {\n                    _ = ex is {{pattern}};\n                }\n            }\n            \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"[t:Int32]\", true)]\n    [DataRow(\"[u:i]\", true)]\n    [DataRow(\"[t:Int32].[u:MaxValue]\", true)]\n    [DataRow(\"[u:System].[t:Int32]\", true)]\n    [DataRow(\"[t:T]\", true)]\n    [DataRow(\"[t:HashSet]<int>.[t:Enumerator]\", true)]\n    [DataRow(\"not [t:Int32]\", true)]\n    [DataRow(\"not [u:i]\", true)]\n    [DataRow(\"not [t:Int32].[u:MaxValue]\", true)]\n    [DataRow(\"not [u:System].[t:Int32]\", true)]\n    public void IdentifierToken_SimpleMemberAccess_Is(string pattern, bool allowSemanticModel) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            using System;\n            using System.Collections.Generic;\n            public class C\n            {\n                public void M<T>(object o)\n                {\n                    const int i = 42;\n                    _ = o is {{pattern}};\n                }\n            }\n            \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"[t:Int32]\", true)]\n    [DataRow(\"[u:i]\", true)]\n    [DataRow(\"[t:Int32].[u:MaxValue]\", true)]\n    [DataRow(\"[u:System].[t:Int32].[u:MaxValue]\", true)]\n    [DataRow(\"not [t:Int32]\", true)]\n    [DataRow(\"not [u:i]\", true)]\n    [DataRow(\"not [t:Int32].[u:MaxValue]\", true)]\n    [DataRow(\"not [u:System].[t:Int32]\", true)]\n    public void IdentifierToken_SimpleMemberAccess_SwitchArm(string pattern, bool allowSemanticModel) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            using System;\n            using System.Collections.Generic;\n            public class C\n            {\n                public void M(object o)\n                {\n                    const int i = 42;\n                    switch(o)\n                    {\n                        case {{pattern}}: break;\n                    }\n                }\n            }\n            \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"[t:Int32]\", true)]\n    [DataRow(\"[u:i]\", true)]\n    [DataRow(\"[t:Int32].[u:MaxValue]\", true)]\n    [DataRow(\"[u:System].[t:Int32].[u:MaxValue]\", true)]\n    [DataRow(\"not [t:Int32]\", true)]\n    [DataRow(\"not [u:i]\", true)]\n    [DataRow(\"not [t:Int32].[u:MaxValue]\", true)]\n    [DataRow(\"not [u:System].[t:Int32]\", true)]\n    public void IdentifierToken_SimpleMemberAccess_SwitchExpression(string pattern, bool allowSemanticModel) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            using System;\n            using System.Collections.Generic;\n            public class C\n            {\n                public void M(object o)\n                {\n                    const int i = 42;\n                    _ = o switch\n                    {\n                        {{pattern}} => true,\n                    };\n                }\n            }\n            \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"[k:scoped] ref S s2 = ref s1;\", false)]\n    [DataRow(\"scoped ref [t:S] s2 = ref s1;\", false)]\n    [DataRow(\"ref [t:S] s2 = ref s1;\", false)]\n    [DataRow(\"scoped [t:S] s2 = s1;\", false)]\n    [DataRow(\"[k:scoped] [k:ref] [k:readonly] [t:S] [u:s2] = [k:ref] [u:s1];\", false)]\n    [DataRow(\"[k:int] [u:scoped] = 1;\", false)]\n    public void IdentifierToken_Scoped_Local(string localDeclaration, bool allowSemanticModel) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            using System;\n\n            public ref struct S { }\n\n            public class C\n            {\n                public void M(ref S s1)\n                {\n                    {{localDeclaration}}\n                }\n            }\n            \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"[k:scoped] ref S s\", false)]\n    [DataRow(\"scoped ref [t:S] s\", false)]\n    [DataRow(\"ref [t:S] s\", false)]\n    [DataRow(\"scoped [t:S] s\", false)]\n    [DataRow(\"[k:scoped] [k:ref] [t:S] [u:s]\", false)]\n    [DataRow(\"[k:int] [u:scoped]\", false)]\n    public void IdentifierToken_Scoped_Parameter(string parameterDeclaration, bool allowSemanticModel) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            using System;\n\n            public ref struct S { }\n\n            public class C\n            {\n                public void M({{parameterDeclaration}})\n                {\n                }\n            }\n            \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"var d = [u:dateTimePointer]->Date;\", false)]\n    [DataRow(\"var d = dateTimePointer->[u:Date];\", false)]\n    [DataRow(\"var d = (*[u:dateTimePointer]).Date;\", false)]\n    [DataRow(\"var d = (*dateTimePointer).[u:Date];\", false)]\n    [DataRow(\"var d = [u:dateTimePointer][0];\", false)]\n    [DataRow(\"[u:dateTimePointer][0] = *(&[u:dateTimePointer][0]);\", false)]\n    [DataRow(\"[t:Int32]* iPointer;\", false)]\n    [DataRow(\"[t:Int32]?* iPointer;\", false)]\n    [DataRow(\"[t:Int32]?** iPointerPointer;\", false)]\n    [DataRow(\"[t:Nullable]<[t:Int32]>** iPointerPointer;\", false)]\n    [DataRow(\"[u:System].Int32* iPointer;\", true)]\n    [DataRow(\"System.[t:Int32]* iPointer;\", false)]\n    [DataRow(\"[k:void]* voidPointer;\", false)]\n    [DataRow(\"DateTime d = default; M(&[u:d]);\", false)]\n    [DataRow(\"[t:DateTime]** dt = &[u:dateTimePointer];\", false)]\n    [DataRow(\"_ = (*(&[u:dateTimePointer]))->Date;\", false)]\n    [DataRow(\"_ = (**(&[u:dateTimePointer])).Date;\", false)]\n    public void IdentifierToken_Unsafe_Pointers(string statement, bool allowSemanticModel) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            using System;\n            public class C\n            {\n                public unsafe void M(DateTime* dateTimePointer)\n                {\n                    {{statement}}\n                }\n            }\n            \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    [DataRow(\"[k:int] @int;\", false)]\n    [DataRow(\"[k:volatile] [t:@volatile] [u:@volatile];\", false)]\n    [DataRow(\"[t:Int32] [u:@someName];\", false)]\n    public void IdentifierToken_KeywordEscaping(string fieldDeclaration, bool allowSemanticModel) =>\n        ClassifierTestHarness.AssertTokenTypes($$\"\"\"\n            using System;\n\n            public class @volatile { }\n            \n            public class C\n            {\n                {{fieldDeclaration}}\n            }\n            \"\"\", allowSemanticModel);\n\n    [TestMethod]\n    public void CSharp12Syntax_Classification() =>\n        ClassifierTestHarness.AssertTokenTypes(\"\"\"\n            using System;\n\n            class PrimaryConstructor([t:Int32] [u:i] = [n:1])\n            {\n                public PrimaryConstructor(int a1, int a2) : [k:this]([u:a1])\n                {\n                    var f = ([t:Int32] [u:i] = [n:1]) => i;\n                }\n            }\n            \"\"\");\n\n#if NET\n    [TestMethod]\n    public void KeywordToken_AllowsAntiConstraintAndParameterModifiers() =>\n        ClassifierTestHarness.AssertTokenTypes(\"\"\"\n            class Allows<T> where T: [k:allows] [k:ref] [k:struct]\n            {\n                public void M1([k:scoped] [t:T] [u:t])\n                { }\n                public void M1([k:ref] [k:readonly] T t)\n                { }\n                public void M2([k:in] T t)\n                { }\n            }\n            \"\"\");\n#endif\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/Utilities/TokenTypeAnalyzerTest.ClassifierTestHarness.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing Microsoft.CodeAnalysis.Text;\nusing SonarAnalyzer.Protobuf;\nusing static SonarAnalyzer.CSharp.Rules.TokenTypeAnalyzer;\nusing Match = System.Text.RegularExpressions.Match;\n\nnamespace SonarAnalyzer.Test.Rules;\n\npublic partial class TokenTypeAnalyzerTest\n{\n    private static class ClassifierTestHarness\n    {\n        private const int TokenAnnotationChars = 4; // [u:]\n        private const int PrefixTokenAnnotationChars = 3; // [u:\n        private static readonly Regex TokenTypeRegEx = new(TokenGroups(\n            TokenGroup(TokenType.Keyword, \"k\"),\n            TokenGroup(TokenType.NumericLiteral, \"n\"),\n            TokenGroup(TokenType.StringLiteral, \"s\"),\n            TokenGroup(TokenType.TypeName, \"t\"),\n            TokenGroup(TokenType.Comment, \"c\"),\n            TokenGroup(TokenType.UnknownTokentype, \"u\")));\n\n        public static void AssertTokenTypes(string code, bool allowSemanticModel = true, bool ignoreCompilationErrors = false)\n        {\n            var (tree, model, expectedTokens) = ParseTokens(code, ignoreCompilationErrors);\n            model = allowSemanticModel ? model : null; // The TokenClassifier will throw if the semantic model is used.\n            var tokenClassifier = new TokenClassifier(model, false);\n            var triviaClassifier = new TriviaClassifier();\n            expectedTokens.Should().SatisfyRespectively(expectedTokens.Select(\n                (Func<ExpectedToken, Action<ExpectedToken>>)(_ => token => CheckClassifiedToken(tokenClassifier, triviaClassifier, tree, token))));\n        }\n\n        private static void CheckClassifiedToken(TokenClassifier tokenClassifier, TriviaClassifier triviaClassifier, SyntaxTree tree, ExpectedToken expected)\n        {\n            var expectedLineSpan = tree.GetLocation(expected.Position).GetLineSpan();\n            var because = $$\"\"\"token with text \"{{expected.TokenText}}\" at position {{expectedLineSpan}} was marked as {{expected.TokenType}}\"\"\";\n            var (actualLocation, classification) = FindActual(tokenClassifier, triviaClassifier, tree, expected, because);\n            if (classification == null)\n            {\n                because = $$\"\"\"classification for token with text \"{{expected.TokenText}}\" at position {{expectedLineSpan}} is null\"\"\";\n                expected.TokenType.Should().Be(TokenType.UnknownTokentype, because);\n                actualLocation.SourceSpan.Should().Be(expected.Position, because);\n            }\n            else\n            {\n                classification.Should().Be(new TokenTypeInfo.Types.TokenInfo\n                {\n                    TokenType = expected.TokenType,\n                    TextRange = new TextRange\n                    {\n                        StartLine = expectedLineSpan.StartLinePosition.Line + 1,\n                        StartOffset = expectedLineSpan.StartLinePosition.Character,\n                        EndLine = expectedLineSpan.EndLinePosition.Line + 1,\n                        EndOffset = expectedLineSpan.EndLinePosition.Character,\n                    },\n                }, because);\n            }\n        }\n\n        private static (Location Location, TokenTypeInfo.Types.TokenInfo TokenInfo) FindActual(TokenClassifier tokenClassifier, TriviaClassifier triviaClassifier, SyntaxTree tree, ExpectedToken expected, string because)\n        {\n            if (expected.TokenType == TokenType.Comment)\n            {\n                var trivia = tree.GetRoot().FindTrivia(expected.Position.Start);\n                return (tree.GetLocation(trivia.FullSpan), triviaClassifier.ClassifyTrivia(trivia));\n            }\n            else\n            {\n                var token = tree.GetRoot().FindToken(expected.Position.Start);\n                var f = () => tokenClassifier.ClassifyToken(token);\n                var tokenInfo = f.Should().NotThrow($\"semanticModel should not be queried for {because}\").Which;\n                return (token.GetLocation(), tokenInfo);\n            }\n        }\n\n        private static (SyntaxTree Tree, SemanticModel Model, IReadOnlyCollection<ExpectedToken> ExpectedTokens) ParseTokens(string code, bool ignoreCompilationErrors = false)\n        {\n            var matches = TokenTypeRegEx.Matches(code);\n            var sb = new StringBuilder(code.Length);\n            var expectedTokens = new List<ExpectedToken>(matches.Count);\n            var lastMatchEnd = 0;\n            var match = 0;\n            foreach (var group in matches.Cast<Match>().Select(m => m.Groups.Cast<Group>().First(g => g.Success && g.Name != \"0\")))\n            {\n                var expectedTokenType = (TokenType)Enum.Parse(typeof(TokenType), group.Name);\n                var position = group.Index - (match * TokenAnnotationChars);\n                var length = group.Length - TokenAnnotationChars;\n                var tokenText = group.Value.Substring(PrefixTokenAnnotationChars, group.Value.Length - TokenAnnotationChars);\n                expectedTokens.Add(new ExpectedToken(expectedTokenType, tokenText, new TextSpan(position, length)));\n\n                sb.Append(code.Substring(lastMatchEnd, group.Index - lastMatchEnd));\n                sb.Append(tokenText);\n                lastMatchEnd = group.Index + group.Length;\n                match++;\n            }\n            sb.Append(code.Substring(lastMatchEnd));\n            var (tree, model) = ignoreCompilationErrors ? TestCompiler.CompileIgnoreErrorsCS(sb.ToString()) : TestCompiler.CompileCS(sb.ToString());\n            return (tree, model, expectedTokens);\n        }\n\n        private static string TokenGroups(params string[] groups) =>\n            string.Join(\"|\", groups);\n\n        private static string TokenGroup(TokenType tokenType, string shortName) =>\n            $$\"\"\"(?'{{tokenType}}'\\[{{shortName}}\\:[^\\]]+\\])\"\"\";\n\n        private readonly record struct ExpectedToken(TokenType TokenType, string TokenText, TextSpan Position);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/Utilities/TokenTypeAnalyzerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\nusing SonarAnalyzer.Core.AnalysisContext;\nusing SonarAnalyzer.Core.Rules;\nusing SonarAnalyzer.Protobuf;\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic partial class TokenTypeAnalyzerTest\n{\n    private const string BasePath = @\"Utilities\\TokenTypeAnalyzer\\\";\n\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    [DataRow(ProjectType.Product)]\n    [DataRow(ProjectType.Test)]\n    public void Verify_MainTokens_CS(ProjectType projectType) =>\n        Verify(\"Tokens.cs\", projectType, x =>\n            {\n                x.Should().HaveCount(16);\n                x.Where(x => x.TokenType == TokenType.Keyword).Should().HaveCount(10);\n                x.Where(x => x.TokenType == TokenType.StringLiteral).Should().HaveCount(4);\n                x.Should().ContainSingle(x => x.TokenType == TokenType.TypeName);\n                x.Should().ContainSingle(x => x.TokenType == TokenType.NumericLiteral);\n            });\n\n    [TestMethod]\n    [DataRow(ProjectType.Product)]\n    [DataRow(ProjectType.Test)]\n    public void Verify_MainTokens_CS_Latest(ProjectType projectType) =>\n        Verify(\"Tokens.Latest.cs\", projectType, x =>\n            {\n                x.Should().HaveCount(94);\n                x.Where(x => x.TokenType == TokenType.Keyword).Should().HaveCount(58);\n                x.Where(x => x.TokenType == TokenType.StringLiteral).Should().HaveCount(20);\n                x.Where(x => x.TokenType == TokenType.NumericLiteral).Should().HaveCount(5);\n                x.Where(x => x.TokenType == TokenType.TypeName).Should().HaveCount(10);\n                x.Should().ContainSingle(x => x.TokenType == TokenType.Comment);\n            });\n\n    [TestMethod]\n    [DataRow(\"Razor.razor\")]\n    [DataRow(\"Razor.cshtml\")]\n    public void Verify_NoMetricsAreComputedForRazorFiles(string fileName) =>\n        CreateBuilder(ProjectType.Product, fileName)\n            .VerifyUtilityAnalyzer<TokenTypeInfo>(x => x.Select(x => Path.GetFileName(x.FilePath)).Should().BeEmpty());\n\n    [TestMethod]\n    [DataRow(ProjectType.Product)]\n    [DataRow(ProjectType.Test)]\n    public void Verify_MainTokens_VB(ProjectType projectType) =>\n        Verify(\"Tokens.vb\", projectType, x =>\n            {\n                x.Should().HaveCount(19);\n                x.Where(x => x.TokenType == TokenType.Keyword).Should().HaveCount(15);\n                x.Where(x => x.TokenType == TokenType.StringLiteral).Should().HaveCount(2);\n                x.Should().ContainSingle(x => x.TokenType == TokenType.TypeName);\n                x.Should().ContainSingle(x => x.TokenType == TokenType.NumericLiteral);\n            });\n\n    [TestMethod]\n    [DataRow(ProjectType.Product)]\n    [DataRow(ProjectType.Test)]\n    public void Verify_Identifiers_CS(ProjectType projectType) =>\n        Verify(\"Identifiers.cs\", projectType, x =>\n            {\n                x.Should().HaveCount(40);\n                x.Count(x => x.TokenType == TokenType.Keyword).Should().Be(29);\n                x.Count(x => x.TokenType == TokenType.TypeName).Should().Be(8);\n                x.Count(x => x.TokenType == TokenType.NumericLiteral).Should().Be(1);\n                x.Count(x => x.TokenType == TokenType.StringLiteral).Should().Be(2);\n            });\n\n    [TestMethod]\n    [DataRow(ProjectType.Product)]\n    [DataRow(ProjectType.Test)]\n    public void Verify_Identifiers_VB(ProjectType projectType) =>\n        Verify(\"Identifiers.vb\", projectType, x =>\n            {\n                x.Should().HaveCount(63);\n                x.Where(x => x.TokenType == TokenType.Keyword).Should().HaveCount(56);\n                x.Where(x => x.TokenType == TokenType.TypeName).Should().HaveCount(6);\n                x.Should().ContainSingle(x => x.TokenType == TokenType.NumericLiteral);\n            });\n\n    [TestMethod]\n    [DataRow(ProjectType.Product)]\n    [DataRow(ProjectType.Test)]\n    public void Verify_Trivia_CS(ProjectType projectType) =>\n        Verify(\"Trivia.cs\", projectType, x =>\n            {\n                x.Should().HaveCount(5);\n                x.Where(x => x.TokenType == TokenType.Comment).Should().HaveCount(4);\n                x.Should().ContainSingle(x => x.TokenType == TokenType.Keyword);\n            });\n\n    [TestMethod]\n    [DataRow(ProjectType.Product)]\n    [DataRow(ProjectType.Test)]\n    public void Verify_Trivia_VB(ProjectType projectType) =>\n        Verify(\"Trivia.vb\", projectType, x =>\n            {\n                x.Should().HaveCount(6);\n                x.Should().ContainSingle(x => x.TokenType == TokenType.Comment);\n                x.Where(x => x.TokenType == TokenType.Keyword).Should().HaveCount(4);\n            });\n\n    [TestMethod]\n    public void Verify_IdentifierTokenThreshold() =>\n        Verify(\"IdentifierTokenThreshold.cs\", ProjectType.Product, x =>\n            // IdentifierTokenThreshold.cs has 4001 identifiers which exceeds current threshold of 4000. Due to this, the identifiers are not classified\n            x.Should().NotContain(token => token.TokenType == TokenType.TypeName));\n\n    [TestMethod]\n    [DataRow(\"Tokens.cs\", true)]\n    [DataRow(\"SomethingElse.cs\", false)]\n    public void Verify_UnchangedFiles(string unchangedFileName, bool expectedProtobufIsEmpty)\n    {\n        var builder = CreateBuilder(ProjectType.Product, \"Tokens.cs\")\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfigWithUnchangedFiles(TestContext, BasePath + unchangedFileName));\n        if (expectedProtobufIsEmpty)\n        {\n            builder.VerifyUtilityAnalyzerProducesEmptyProtobuf();\n        }\n        else\n        {\n            builder.VerifyUtilityAnalyzer<TokenTypeInfo>(x => x.Should().NotBeEmpty());\n        }\n    }\n\n    private void Verify(string fileName, ProjectType projectType, Action<IReadOnlyList<TokenTypeInfo.Types.TokenInfo>> verifyTokenInfo) =>\n        CreateBuilder(projectType, fileName)\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, projectType))\n            .VerifyUtilityAnalyzer<TokenTypeInfo>(x =>\n                {\n                    x.Should().ContainSingle();\n                    var info = x.Single();\n                    info.FilePath.Should().Be(Path.Combine(BasePath, fileName));\n                    verifyTokenInfo(info.TokenInfo);\n                });\n\n    private VerifierBuilder CreateBuilder(ProjectType projectType, string fileName)\n    {\n        var testRoot = BasePath + TestContext.TestName;\n        var language = AnalyzerLanguage.FromPath(fileName);\n        UtilityAnalyzerBase analyzer = language.LanguageName switch\n        {\n            LanguageNames.CSharp => new TestTokenTypeAnalyzer_CS(testRoot, projectType == ProjectType.Test),\n            LanguageNames.VisualBasic => new TestTokenTypeAnalyzer_VB(testRoot, projectType == ProjectType.Test),\n            _ => throw new UnexpectedLanguageException(language)\n        };\n        return new VerifierBuilder()\n            .AddAnalyzer(() => analyzer)\n            .AddPaths(fileName)\n            .WithBasePath(BasePath)\n            .WithOptions(LanguageOptions.Latest(language))\n            .WithProtobufPath(@$\"{testRoot}\\token-type.pb\");\n    }\n\n    // We need to set protected properties and this class exists just to enable the analyzer without bothering with additional files with parameters\n    private sealed class TestTokenTypeAnalyzer_CS : CS.TokenTypeAnalyzer\n    {\n        private readonly string outPath;\n        private readonly bool isTestProject;\n\n        public TestTokenTypeAnalyzer_CS(string outPath, bool isTestProject)\n        {\n            this.outPath = outPath;\n            this.isTestProject = isTestProject;\n        }\n\n        protected override UtilityAnalyzerParameters ReadParameters(IAnalysisContext context) =>\n            base.ReadParameters(context) with { IsAnalyzerEnabled = true, OutPath = outPath, IsTestProject = isTestProject };\n    }\n\n    private sealed class TestTokenTypeAnalyzer_VB : VB.TokenTypeAnalyzer\n    {\n        private readonly string outPath;\n        private readonly bool isTestProject;\n\n        public TestTokenTypeAnalyzer_VB(string outPath, bool isTestProject)\n        {\n            this.outPath = outPath;\n            this.isTestProject = isTestProject;\n        }\n\n        protected override UtilityAnalyzerParameters ReadParameters(IAnalysisContext context) =>\n            base.ReadParameters(context) with { IsAnalyzerEnabled = true, OutPath = outPath, IsTestProject = isTestProject };\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/Utilities/UtilityAnalyzerBaseTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.Text;\nusing Microsoft.CodeAnalysis.VisualBasic;\nusing SonarAnalyzer.Core.AnalysisContext;\nusing SonarAnalyzer.Core.Rules;\n\nnamespace SonarAnalyzer.Test.Rules.Utilities;\n\n[TestClass]\npublic class UtilityAnalyzerBaseTest\n{\n    private const string DefaultSonarProjectConfig = @\"TestResources\\SonarProjectConfig\\Path_Windows\\SonarProjectConfig.xml\";\n    private const string DefaultProjectOutFolderPath = @\"TestResources\\ProjectOutFolderPath.txt\";\n\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    [DataRow(LanguageNames.CSharp, DefaultProjectOutFolderPath, @\"path\\output-cs\")]\n    [DataRow(LanguageNames.VisualBasic, DefaultProjectOutFolderPath, @\"path\\output-vbnet\")]\n    [DataRow(LanguageNames.CSharp, DefaultSonarProjectConfig, @\"C:\\foo\\bar\\.sonarqube\\out\\0\\output-cs\")]\n    [DataRow(LanguageNames.VisualBasic, DefaultSonarProjectConfig, @\"C:\\foo\\bar\\.sonarqube\\out\\0\\output-vbnet\")]\n    public void ReadConfig_OutPath(string language, string additionalPath, string expectedOutPath)\n    {\n        // We do not test what is read from the SonarLint file, but we need it\n        var utilityAnalyzer = new TestUtilityAnalyzer(language, @\"TestResources\\SonarLintXml\\All_properties_cs\\SonarLint.xml\", additionalPath);\n\n        utilityAnalyzer.Parameters.OutPath.Should().Be(expectedOutPath);\n        utilityAnalyzer.Parameters.IsAnalyzerEnabled.Should().BeTrue();\n    }\n\n    [TestMethod]\n    [DataRow(DefaultProjectOutFolderPath, DefaultSonarProjectConfig)]\n    [DataRow(DefaultSonarProjectConfig, DefaultProjectOutFolderPath)]\n    public void ReadConfig_OutPath_FromSonarProjectConfig_HasPriority(string firstFile, string secondFile)\n    {\n        // We do not test what is read from the SonarLint file, but we need it\n        var utilityAnalyzer = new TestUtilityAnalyzer(LanguageNames.CSharp, @\"TestResources\\SonarLintXml\\All_properties_cs\\SonarLint.xml\", firstFile, secondFile);\n\n        utilityAnalyzer.Parameters.OutPath.Should().Be(@\"C:\\foo\\bar\\.sonarqube\\out\\0\\output-cs\");\n        utilityAnalyzer.Parameters.IsAnalyzerEnabled.Should().BeTrue();\n    }\n\n    [TestMethod]\n    [DataRow(LanguageNames.CSharp, true)]\n    [DataRow(LanguageNames.CSharp, false)]\n    [DataRow(LanguageNames.VisualBasic, true)]\n    [DataRow(LanguageNames.VisualBasic, false)]\n    public void ReadsSettings_AnalyzeGenerated(string language, bool analyzeGenerated)\n    {\n        var sonarLintXmlPath = AnalysisScaffolding.CreateSonarLintXml(TestContext, language: language, analyzeGeneratedCode: analyzeGenerated);\n        var utilityAnalyzer = new TestUtilityAnalyzer(language, sonarLintXmlPath, DefaultSonarProjectConfig);\n\n        utilityAnalyzer.Parameters.AnalyzeGeneratedCode.Should().Be(analyzeGenerated);\n        utilityAnalyzer.Parameters.IsAnalyzerEnabled.Should().BeTrue();\n    }\n\n    [TestMethod]\n    [DataRow(LanguageNames.CSharp, true)]\n    [DataRow(LanguageNames.CSharp, false)]\n    [DataRow(LanguageNames.VisualBasic, true)]\n    [DataRow(LanguageNames.VisualBasic, false)]\n    public void ReadsSettings_IgnoreHeaderComments(string language, bool ignoreHeaderComments)\n    {\n        var sonarLintXmlPath = AnalysisScaffolding.CreateSonarLintXml(TestContext, language: language, ignoreHeaderComments: ignoreHeaderComments);\n        var utilityAnalyzer = new TestUtilityAnalyzer(language, sonarLintXmlPath, DefaultSonarProjectConfig);\n\n        utilityAnalyzer.Parameters.IgnoreHeaderComments.Should().Be(ignoreHeaderComments);\n        utilityAnalyzer.Parameters.IsAnalyzerEnabled.Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void NoSonarLintXml_AnalyzerNotEnabled()\n    {\n        new TestUtilityAnalyzer(LanguageNames.CSharp, DefaultProjectOutFolderPath).Parameters.IsAnalyzerEnabled.Should().BeFalse();\n        new TestUtilityAnalyzer(LanguageNames.CSharp, DefaultSonarProjectConfig).Parameters.IsAnalyzerEnabled.Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void NoOutputPath_AnalyzerNotEnabled() =>\n        new TestUtilityAnalyzer(LanguageNames.CSharp, AnalysisScaffolding.CreateSonarLintXml(TestContext, analyzeGeneratedCode: true)).Parameters.IsAnalyzerEnabled.Should().BeFalse();\n\n    [TestMethod]\n    public void GetTextRange()\n    {\n        var fileLinePositionSpan = new FileLinePositionSpan(\n            \"path\",\n            new LinePosition(55, 42),\n            new LinePosition(99, 9313));\n\n        var result = UtilityAnalyzerBase.ToTextRange(fileLinePositionSpan);\n        result.Should().NotBeNull();\n        // line number in SQ starts from 1, Roslyn starts from 0\n        result.StartLine.Should().Be(55 + 1);\n        result.StartOffset.Should().Be(42);\n        result.EndLine.Should().Be(99 + 1);\n        result.EndOffset.Should().Be(9313);\n    }\n\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    private class TestUtilityAnalyzer : UtilityAnalyzerBase\n    {\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => throw new NotSupportedException();\n        public UtilityAnalyzerParameters Parameters { get; }\n\n        public TestUtilityAnalyzer(string language, params string[] additionalPaths) : base(\"S9999-test\", \"Title\")\n        {\n            var additionalFiles = additionalPaths.Select(x => new AnalyzerAdditionalFile(x)).ToImmutableArray<AdditionalText>();\n            Compilation compilation = language switch\n            {\n                LanguageNames.CSharp => CSharpCompilation.Create(null),\n                LanguageNames.VisualBasic => VisualBasicCompilation.Create(null),\n                _ => throw new InvalidOperationException($\"Unexpected {nameof(language)}: {language}\")\n            };\n            var context = new CompilationAnalysisContext(compilation, new AnalyzerOptions(additionalFiles), null, null, default);\n            Parameters = ReadParameters(new SonarCompilationReportingContext(AnalysisScaffolding.CreateSonarAnalysisContext(), context));\n        }\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            throw new NotSupportedException();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ValueTypeShouldImplementIEquatableTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ValueTypeShouldImplementIEquatableTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.ValueTypeShouldImplementIEquatable>();\n    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.ValueTypeShouldImplementIEquatable>();\n\n    [TestMethod]\n    public void ValueTypeShouldImplementIEquatable_CS() =>\n        builderCS.AddPaths(\"ValueTypeShouldImplementIEquatable.cs\").WithOptions(LanguageOptions.FromCSharp8).Verify();\n\n    [TestMethod]\n    public void ValueTypeShouldImplementIEquatable_CSharp10() =>\n        builderCS.AddPaths(\"ValueTypeShouldImplementIEquatable.CSharp10.cs\").WithOptions(LanguageOptions.FromCSharp10).VerifyNoIssues();\n\n    [TestMethod]\n    public void ValueTypeShouldImplementIEquatable_VB() =>\n        builderVB.AddPaths(\"ValueTypeShouldImplementIEquatable.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/ValuesUselesslyIncrementedTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class ValuesUselesslyIncrementedTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<ValuesUselesslyIncremented>();\n\n    [TestMethod]\n    public void ValuesUselesslyIncremented() =>\n        builder.AddPaths(\"ValuesUselesslyIncremented.cs\").Verify();\n\n    [TestMethod]\n    public void ValuesUselesslyIncremented_TopLevelStatements() =>\n        builder.AddPaths(\"ValuesUselesslyIncremented.TopLevelStatements.cs\").WithTopLevelStatements().Verify();\n\n    [TestMethod]\n    public void ValuesUselesslyIncremented_CS_Latest() =>\n        builder.AddPaths(\"ValuesUselesslyIncremented.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/VariableShadowsFieldTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class VariableShadowsFieldTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<VariableShadowsField>();\n\n    [TestMethod]\n    public void VariableShadowsField() =>\n        builder.AddPaths(\"VariableShadowsField.cs\").Verify();\n\n    [TestMethod]\n    public void VariableShadowsField_TopLevelStatements() =>\n        builder.AddPaths(\"VariableShadowsField.TopLevelStatements.cs\").WithTopLevelStatements().Verify();\n\n    [TestMethod]\n    public void VariableShadowsField_CS_Latest() =>\n        builder.AddPaths(\"VariableShadowsField.Latest.cs\", \"VariableShadowsField.Latest.Partial.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/VariableUnusedTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class VariableUnusedTest\n{\n    private readonly VerifierBuilder builderCS = new VerifierBuilder<CS.VariableUnused>();\n\n    [TestMethod]\n    public void VariableUnused_CS() =>\n        builderCS.AddPaths(\"VariableUnused.cs\").Verify();\n\n    [TestMethod]\n    public void VariableUnused_CS_TopLevelStatements() =>\n        builderCS.AddPaths(\"VariableUnused.TopLevelStatements.cs\").WithTopLevelStatements().Verify();\n\n    [TestMethod]\n    public void VariableUnused_CS_Latest() =>\n        builderCS.AddPaths(\"VariableUnused.Latest.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void VariableUnused_VB() =>\n        new VerifierBuilder<VB.VariableUnused>().AddPaths(\"VariableUnused.vb\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/VirtualEventFieldTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class VirtualEventFieldTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<VirtualEventField>();\n\n    [TestMethod]\n    public void VirtualEventField() =>\n        builder.AddPaths(\"VirtualEventField.cs\").Verify();\n\n    [TestMethod]\n    public void VirtualEventField_Latest() =>\n        builder.AddPaths(\"VirtualEventField.Latest.cs\", \"VirtualEventField.Latest.Partial.cs\").WithOptions(LanguageOptions.CSharpLatest).Verify();\n\n    [TestMethod]\n    public void VirtualEventField_Latest_CodeFix() =>\n        builder.WithCodeFix<VirtualEventFieldCodeFix>().AddPaths(\"VirtualEventField.Latest.cs\").WithCodeFixedPaths(\"VirtualEventField.Latest.Fixed.cs\").WithOptions(LanguageOptions.CSharpLatest).VerifyCodeFix();\n\n    [TestMethod]\n    public void VirtualEventField_CodeFix() =>\n        builder.WithCodeFix<VirtualEventFieldCodeFix>().AddPaths(\"VirtualEventField.cs\").WithCodeFixedPaths(\"VirtualEventField.Fixed.cs\").VerifyCodeFix();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/WcfMissingContractAttributeTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class WcfMissingContractAttributeTest\n    {\n        [TestMethod]\n        public void WcfMissingContractAttribute() =>\n            new VerifierBuilder<WcfMissingContractAttribute>().AddPaths(\"WcfMissingContractAttribute.cs\")\n                .AddReferences(MetadataReferenceFacade.SystemServiceModel)\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/WcfNonVoidOneWayTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class WcfNonVoidOneWayTest\n    {\n        [TestMethod]\n        public void WcfNonVoidOneWay_CS() =>\n            new VerifierBuilder<CS.WcfNonVoidOneWay>().AddPaths(\"WcfNonVoidOneWay.cs\")\n                .AddReferences(MetadataReferenceFacade.SystemServiceModel)\n                .Verify();\n\n        [TestMethod]\n        public void WcfNonVoidOneWay_VB() =>\n            new VerifierBuilder<VB.WcfNonVoidOneWay>().AddPaths(\"WcfNonVoidOneWay.vb\")\n                .AddReferences(MetadataReferenceFacade.SystemServiceModel)\n                .Verify();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/WeakSslTlsProtocolsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class WeakSslTlsProtocolsTest\n    {\n        private readonly VerifierBuilder builderCS = WithReferences(new VerifierBuilder<CS.WeakSslTlsProtocols>());\n        private readonly VerifierBuilder builderVB = WithReferences(new VerifierBuilder<VB.WeakSslTlsProtocols>());\n\n        [TestMethod]\n        public void WeakSslTlsProtocols_CSharp() =>\n            builderCS.AddPaths(\"WeakSslTlsProtocols.cs\").WithOptions(LanguageOptions.FromCSharp8).Verify();\n\n        [TestMethod]\n        public void WeakSslTlsProtocols_CSharp12() =>\n            builderCS.AddPaths(\"WeakSslTlsProtocols.CSharp12.cs\").WithOptions(LanguageOptions.FromCSharp12).Verify();\n\n        [TestMethod]\n        public void WeakSslTlsProtocols_VB() =>\n            builderVB.AddPaths(\"WeakSslTlsProtocols.vb\").Verify();\n\n        private static VerifierBuilder WithReferences(VerifierBuilder builder) =>\n            builder.AddReferences(MetadataReferenceFacade.SystemNetHttp).AddReferences(MetadataReferenceFacade.SystemSecurityCryptography);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/XMLSignatureCheckTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class XmlSignatureCheckTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<XmlSignatureCheck>()\n        .AddReferences(MetadataReferenceFacade.SystemXml)\n        .AddReferences(MetadataReferenceFacade.SystemSecurityCryptography)\n        .AddReferences(NuGetMetadataReference.SystemSecurityCryptographyXml());\n\n    [TestMethod]\n    public void XmlSignatureCheck_CS() =>\n        builder.AddPaths(\"XMLSignatureCheck.cs\").Verify();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Rules/XmlExternalEntityShouldNotBeParsedTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules\n{\n    [TestClass]\n    public class XmlExternalEntityShouldNotBeParsedTest\n    {\n        private readonly VerifierBuilder builder = new VerifierBuilder()\n            .AddReferences(MetadataReferenceFacade.SystemXml)\n            .AddReferences(MetadataReferenceFacade.SystemData)\n            .AddReferences(MetadataReferenceFacade.SystemXmlLinq)\n            .AddReferences(NuGetMetadataReference.MicrosoftWebXdt());\n\n        [DataRow(NetFrameworkVersion.After452, \"XmlExternalEntityShouldNotBeParsed_XmlDocument.cs\")]\n        [DataRow(NetFrameworkVersion.Probably35, \"XmlExternalEntityShouldNotBeParsed_XmlDocument_Net35.cs\")]\n        [DataRow(NetFrameworkVersion.Between4And451, \"XmlExternalEntityShouldNotBeParsed_XmlDocument_Net4.cs\")]\n        [DataRow(NetFrameworkVersion.Unknown, \"XmlExternalEntityShouldNotBeParsed_XmlDocument_UnknownFrameworkVersion.cs\")]\n        [TestMethod]\n        public void XmlExternalEntityShouldNotBeParsed_XmlDocument(NetFrameworkVersion version, string testFilePath) =>\n            WithAnalyzer(version).AddPaths(testFilePath).Verify();\n\n#if NET\n\n        [TestMethod]\n        public void XmlExternalEntityShouldNotBeParsed_XmlDocument_CSharp9() =>\n            WithAnalyzer(NetFrameworkVersion.After452).AddPaths(\"XmlExternalEntityShouldNotBeParsed_XmlDocument_CSharp9.cs\").WithTopLevelStatements().Verify();\n\n        [TestMethod]\n        public void XmlExternalEntityShouldNotBeParsed_XmlDocument_CSharp10() =>\n            WithAnalyzer(NetFrameworkVersion.After452)\n                .AddPaths(\"XmlExternalEntityShouldNotBeParsed_XmlDocument_CSharp10.cs\")\n                .WithOptions(LanguageOptions.FromCSharp10)\n                .WithTopLevelStatements()\n                .Verify();\n\n#endif\n\n        [DataRow(NetFrameworkVersion.After452, \"XmlExternalEntityShouldNotBeParsed_XmlTextReader.cs\")]\n        [DataRow(NetFrameworkVersion.Probably35, \"XmlExternalEntityShouldNotBeParsed_XmlTextReader_Net35.cs\")]\n        [DataRow(NetFrameworkVersion.Between4And451, \"XmlExternalEntityShouldNotBeParsed_XmlTextReader_Net4.cs\")]\n        [DataRow(NetFrameworkVersion.Unknown, \"XmlExternalEntityShouldNotBeParsed_XmlTextReader_UnknownFrameworkVersion.cs\")]\n        [TestMethod]\n        public void XmlExternalEntityShouldNotBeParsed_XmlTextReader(NetFrameworkVersion version, string testFilePath) =>\n            WithAnalyzer(version).AddPaths(testFilePath).WithOptions(LanguageOptions.FromCSharp8).Verify();\n\n#if NET\n\n        [TestMethod]\n        public void XmlExternalEntityShouldNotBeParsed_XmlTextReader_CSharp9() =>\n            WithAnalyzer(NetFrameworkVersion.After452).AddPaths(\"XmlExternalEntityShouldNotBeParsed_XmlTextReader_CSharp9.cs\").WithTopLevelStatements().Verify();\n\n        [TestMethod]\n        public void XmlExternalEntityShouldNotBeParsed_XmlTextReader_CSharp10() =>\n            WithAnalyzer(NetFrameworkVersion.After452).AddPaths(\"XmlExternalEntityShouldNotBeParsed_XmlTextReader_CSharp10.cs\").WithOptions(LanguageOptions.FromCSharp10).Verify();\n\n#endif\n\n        [DataRow(NetFrameworkVersion.After452, \"XmlExternalEntityShouldNotBeParsed_AlwaysSafe.cs\")]\n        [DataRow(NetFrameworkVersion.Unknown, \"XmlExternalEntityShouldNotBeParsed_AlwaysSafe.cs\")]\n        [TestMethod]\n        public void XmlExternalEntityShouldNotBeParsed_AlwaysSafe(NetFrameworkVersion version, string testFilePath) =>\n            WithAnalyzer(version).AddPaths(testFilePath).Verify();\n\n        [DataRow(NetFrameworkVersion.Probably35, \"XmlExternalEntityShouldNotBeParsed_XmlReader_Net35.cs\")]\n        [DataRow(NetFrameworkVersion.Between4And451, \"XmlExternalEntityShouldNotBeParsed_XmlReader_Net4.cs\")]\n        [DataRow(NetFrameworkVersion.After452, \"XmlExternalEntityShouldNotBeParsed_XmlReader_Net452.cs\")]\n        [DataRow(NetFrameworkVersion.Unknown, \"XmlExternalEntityShouldNotBeParsed_XmlReader_Net452.cs\")]\n        [TestMethod]\n        public void XmlExternalEntityShouldNotBeParsed_XmlReader(NetFrameworkVersion version, string testFilePath) =>\n            WithAnalyzer(version).AddPaths(testFilePath).Verify();\n\n#if NET\n\n        [TestMethod]\n        public void XmlExternalEntityShouldNotBeParsed_XmlReader_CSharp9() =>\n            WithAnalyzer(NetFrameworkVersion.After452).AddPaths(\"XmlExternalEntityShouldNotBeParsed_XmlReader_CSharp9.cs\").WithTopLevelStatements().Verify();\n\n        [TestMethod]\n        public void XmlExternalEntityShouldNotBeParsed_XPathDocument_CSharp9() =>\n            WithAnalyzer(NetFrameworkVersion.After452).AddPaths(\"XmlExternalEntityShouldNotBeParsed_XPathDocument_CSharp9.cs\").WithTopLevelStatements().Verify();\n\n#endif\n\n        [DataRow(NetFrameworkVersion.Probably35, \"XmlExternalEntityShouldNotBeParsed_XPathDocument_Net35.cs\")]\n        [DataRow(NetFrameworkVersion.Between4And451, \"XmlExternalEntityShouldNotBeParsed_XPathDocument_Net4.cs\")]\n        [DataRow(NetFrameworkVersion.After452, \"XmlExternalEntityShouldNotBeParsed_XPathDocument_Net452.cs\")]\n        [DataRow(NetFrameworkVersion.Unknown, \"XmlExternalEntityShouldNotBeParsed_XPathDocument_Net452.cs\")]\n        [TestMethod]\n        public void XmlExternalEntityShouldNotBeParsed_XPathDocument(NetFrameworkVersion version, string testFilePath) =>\n            WithAnalyzer(version).AddPaths(testFilePath).Verify();\n\n        [TestMethod]\n        public void XmlExternalEntityShouldNotBeParsed_NoCrashOnExternalParameterUse() =>\n            WithAnalyzer(NetFrameworkVersion.After452)\n                .AddPaths(\"XmlExternalEntityShouldNotBeParsed_XmlReader_ExternalParameter.cs\", \"XmlExternalEntityShouldNotBeParsed_XmlReader_ParameterProvider.cs\")\n                .Verify();\n\n        private VerifierBuilder WithAnalyzer(NetFrameworkVersion version)\n        {\n            var fxVersion = Substitute.For<NetFrameworkVersionProvider>();\n            fxVersion.Version(Arg.Any<Compilation>()).Returns(version);\n            return builder.AddAnalyzer(() => new XmlExternalEntityShouldNotBeParsed(fxVersion));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/SonarAnalyzer.Test.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFrameworks>net48;net10.0</TargetFrameworks>\n    <IsPackable>false</IsPackable>\n    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>\n    <GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"NSubstitute\" Version=\"5.3.0\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Compile Remove=\"TestCases\\**\\*\" />\n    <None Include=\"TestCases\\**\\*\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <Content Include=\"TestResources\\**\\*\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\SonarAnalyzer.TestFramework\\SonarAnalyzer.TestFramework.csproj\" />\n    <ProjectReference Include=\"..\\..\\src\\SonarAnalyzer.CFG\\SonarAnalyzer.CFG.csproj\" />\n    <ProjectReference Include=\"..\\..\\src\\SonarAnalyzer.Core\\SonarAnalyzer.Core.csproj\">\n      <Aliases>global,common</Aliases>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\src\\SonarAnalyzer.CSharp\\SonarAnalyzer.CSharp.csproj\">\n      <Aliases>global,csharp</Aliases>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\src\\SonarAnalyzer.CSharp.Core\\SonarAnalyzer.CSharp.Core.csproj\" />\n    <ProjectReference Include=\"..\\..\\src\\SonarAnalyzer.VisualBasic\\SonarAnalyzer.VisualBasic.csproj\">\n      <Aliases>global,vbnet</Aliases>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\src\\SonarAnalyzer.VisualBasic.Core\\SonarAnalyzer.VisualBasic.Core.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Using Include=\"FluentAssertions\" />\n\t  <Using Include=\"Microsoft.CodeAnalysis\" />\n\t  <Using Include=\"Microsoft.CodeAnalysis.Diagnostics\" />\n    <Using Include=\"Microsoft.VisualStudio.TestTools.UnitTesting\" />\n    <Using Include=\"Combinatorial.MSTest\" />\n    <Using Include=\"NSubstitute\" />\n    <Using Include=\"SonarAnalyzer.Core.Analyzers\" />\n    <Using Include=\"SonarAnalyzer.Core.Common\" />\n    <Using Include=\"SonarAnalyzer.Core.Configuration\" />\n    <Using Include=\"SonarAnalyzer.Core.Extensions\" />\n    <Using Include=\"SonarAnalyzer.Core.Semantics\" />\n    <Using Include=\"SonarAnalyzer.ShimLayer\" />\n    <Using Include=\"SonarAnalyzer.TestFramework.Analyzers\" />\n    <Using Include=\"SonarAnalyzer.TestFramework.Build\" />\n    <Using Include=\"SonarAnalyzer.TestFramework.Common\" />\n    <Using Include=\"SonarAnalyzer.TestFramework.Extensions\" />\n    <Using Include=\"SonarAnalyzer.TestFramework.MetadataReferences\" />\n    <Using Include=\"SonarAnalyzer.TestFramework.Verification\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Syntax/Extensions/IfStatementSyntaxExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing SonarAnalyzer.CSharp.Syntax.Extensions;\n\nnamespace SonarAnalyzer.Test.Syntax.Extensions;\n\n[TestClass]\npublic class IfStatementSyntaxExtensions\n{\n    private const string Source = \"\"\"\n        class TestClass\n        {\n            public void DoSomething(){}\n\n            public void IfMethod()\n            {\n                if (true)\n                    DoSomething();\n                else if (true)\n                    DoSomething();\n                else\n                {\n                    if(true)\n                        DoSomething();\n                    else\n                        DoSomething();\n                }\n            }\n\n            public void NonChainedIfMethod()\n            {\n                if (true)\n                    DoSomething();\n                else\n                {\n                    DoSomething();\n                    if(true)\n                        DoSomething();\n                }\n            }\n\n            public void NonChainedIfDifferentIfFirstStatement()\n            {\n                if (true)\n                    DoSomething();\n                else\n                {\n                    if (false)\n                        DoSomething();\n                    DoSomething();\n                    if(true)\n                        DoSomething();\n                }\n            }\n        }\n        \"\"\";\n    private MethodDeclarationSyntax ifMethod;\n\n    [TestInitialize]\n    public void TestSetup() =>\n        ifMethod = CSharpSyntaxTree.ParseText(Source).GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().First(x => x.Identifier.ValueText == \"IfMethod\");\n\n    [TestMethod]\n    public void GetPrecedingIfsInConditionChain()\n    {\n        var ifStatements = ifMethod.DescendantNodes().OfType<IfStatementSyntax>().ToList();\n        var precedingIfStatements = new List<IfStatementSyntax>();\n        foreach (var ifStatement in ifStatements)\n        {\n            var sut = ifStatement.PrecedingIfsInConditionChain();\n            sut.Should().BeEquivalentTo(precedingIfStatements);\n            precedingIfStatements.Add(ifStatement);\n        }\n    }\n\n    [TestMethod]\n    public void GetPrecedingStatementsInConditionChain()\n    {\n        var ifStatements = ifMethod.DescendantNodes().OfType<IfStatementSyntax>().ToList();\n        var precedingStatements = new List<StatementSyntax>();\n        foreach (var ifStatement in ifStatements)\n        {\n            var sut = ifStatement.PrecedingStatementsInConditionChain();\n            sut.Should().BeEquivalentTo(precedingStatements);\n            precedingStatements.Add(ifStatement.Statement);\n        }\n    }\n\n    [TestMethod]\n    public void GetPrecedingConditionsInConditionChain()\n    {\n        var ifStatements = ifMethod.DescendantNodes().OfType<IfStatementSyntax>().ToList();\n        var precedingConditions = new List<ExpressionSyntax>();\n        foreach (var ifStatement in ifStatements)\n        {\n            var sut = ifStatement.PrecedingConditionsInConditionChain();\n            sut.Should().BeEquivalentTo(precedingConditions);\n            precedingConditions.Add(ifStatement.Condition);\n        }\n    }\n\n    [TestMethod]\n    public void GetPrecedingSections_Empty()\n    {\n        var sections = ifMethod.DescendantNodes().OfType<SwitchSectionSyntax>().ToList();\n\n        sections.FirstOrDefault().PrecedingSections().Should().BeEmpty();\n    }\n\n    [TestMethod]\n    public void GetPrecedingIfsNonChainedIsEmpty()\n    {\n        var nonChained = CSharpSyntaxTree.ParseText(Source).GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().First(x => x.Identifier.ValueText == \"NonChainedIfMethod\");\n        var ifStatements = nonChained.DescendantNodes().OfType<IfStatementSyntax>().ToList();\n        foreach (var ifStatement in ifStatements)\n        {\n            var sut = ifStatement.PrecedingIfsInConditionChain();\n            sut.Should().BeEmpty();\n        }\n    }\n\n    [TestMethod]\n    public void GetPrecedingIfsNonChainedDifferentIfIsEmpty()\n    {\n        var nonChained = CSharpSyntaxTree.ParseText(Source).GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().First(x => x.Identifier.ValueText == \"NonChainedIfDifferentIfFirstStatement\");\n        var lastIf = nonChained.DescendantNodes().OfType<IfStatementSyntax>().Last();\n\n        var sut = lastIf.PrecedingIfsInConditionChain();\n        sut.Should().BeEmpty();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Syntax/Extensions/SwitchSectionSyntaxExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing SonarAnalyzer.CSharp.Syntax.Extensions;\n\nnamespace SonarAnalyzer.Test.Syntax.Extensions;\n\n[TestClass]\npublic class SwitchSectionSyntaxExtensionsTest\n{\n    private const string Source = \"\"\"\n        class TestClass\n        {\n            public void DoSomething(){}\n\n            public void SwitchMethod()\n            {\n                var i = 5;\n                switch(i)\n                {\n                    case 3:\n                        DoSomething();\n                        break;\n                    case 5:\n                        DoSomething();\n                        break;\n                    default:\n                        DoSomething();\n                        break;\n                }\n            }\n        }\n        \"\"\";\n\n    private MethodDeclarationSyntax switchMethod;\n\n    [TestInitialize]\n    public void TestSetup() =>\n        switchMethod = CSharpSyntaxTree.ParseText(Source).GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().First(x => x.Identifier.ValueText == \"SwitchMethod\");\n\n    [TestMethod]\n    public void GetPrecedingSections()\n    {\n        var sections = switchMethod.DescendantNodes().OfType<SwitchSectionSyntax>().ToList();\n\n        sections.Last().PrecedingSections().Should().HaveCount(2);\n        sections.First().PrecedingSections().Should().BeEmpty();\n        sections.Last().PrecedingSections().First().Should().BeEquivalentTo(sections.First());\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Syntax/Extensions/SyntaxNodeExtensionsTest.CSharp.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing SonarAnalyzer.CSharp.Core.Syntax.Extensions;\nusing SonarAnalyzer.CSharp.Syntax.Extensions;\n\nnamespace SonarAnalyzer.Test.Syntax.Extensions;\n\n[TestClass]\npublic class SyntaxNodeExtensionsTest\n{\n    [TestMethod]\n    public void NoDirectives()\n    {\n        var source = \"\"\"\n            class Sample\n            {\n                void Main(){}\n            }\n            \"\"\";\n        var node = GetMainNode(source);\n        var activeSections = node.ActiveConditionalCompilationSections();\n\n        activeSections.Should().NotBeNull();\n        activeSections.Should().BeEmpty();\n    }\n\n    [TestMethod]\n    public void ActiveBlocks_NonNestedIfs()\n    {\n        var source = \"\"\"\n            #define BLOCK1\n            #define BLOCK2\n            #define BLOCK3\n\n            namespace Test\n            {\n            #if BLOCK1\n            #endif\n\n            #if BLOCK2\n            #endif\n\n            #if true // literal block\n            #endif\n\n            #if BLOCK3\n\n                class Sample\n                {\n                    void Main() { }\n                }\n\n            #endif\n\n            #if BLOCK1\n            #endif\n\n            }\n            \"\"\";\n        var node = GetMainNode(source);\n        var activeSections = node.ActiveConditionalCompilationSections();\n\n        activeSections.Should().NotBeNull();\n        activeSections.Should().ContainSingle();\n        activeSections.Should().BeEquivalentTo(\"BLOCK3\");\n    }\n\n    [TestMethod]\n    public void ActiveBlocks_NestedIfs()\n    {\n        // Arrange\n        var source = \"\"\"\n            #define BLOCK1\n            #define BLOCK2\n            #define BLOCK3\n            #define BLOCK4\n\n            namespace Test\n            {\n            #if BLOCK1\n            #if BLOCK2\n            #if BLOCK3\n            #if BLOCK4 // opened and closed, so should not appear\n            #endif\n\n                class Sample\n                {\n                    void Main() { }\n                }\n\n            #endif\n            #endif\n            #endif\n\n            #if BLOCK1\n            #endif\n\n            }\n            \"\"\";\n        var node = GetMainNode(source);\n        var activeSections = node.ActiveConditionalCompilationSections();\n\n        activeSections.Should().NotBeNull();\n        activeSections.Should().HaveCount(3);\n        activeSections.Should().BeEquivalentTo(\"BLOCK1\", \"BLOCK2\", \"BLOCK3\");\n    }\n\n    [TestMethod]\n    public void ActiveBlocks_DirectivesInLeadingTrivia()\n    {\n        var source = \"\"\"\n            #define BLOCK1\n            #define BLOCK2\n            #define BLOCK3\n\n            namespace Test\n            {\n                public class Sample\n                {\n            // trivia\n            #if BLOCK2\n            // more trivia\n            #if true // literal block\n            // more trivia\n            #endif\n            #if BLOCK3\n            // more trivia\n                    void Main() { }\n                }\n\n            #endif\n            #endif\n\n            #if BLOCK1\n            #endif\n\n            }\n            \"\"\";\n        var node = GetMainNode(source);\n        var activeSections = node.ActiveConditionalCompilationSections();\n\n        activeSections.Should().NotBeNull();\n        activeSections.Should().BeEquivalentTo(\"BLOCK2\", \"BLOCK3\");\n    }\n\n    [TestMethod]\n    public void ActiveBlocks_ElseInPrecedingCode()\n    {\n        var source = \"\"\"\n            #define BLOCK2\n\n            #if BLOCK1\n            #else\n\n            #if BLOCK2\n            #else\n            #elseif BLOCK3\n            #endif\n\n            #endif\n\n            #if BLOCK2\n            namespace Test\n            {\n                class Sample\n                {\n                    void Main() { }\n                }\n            }\n            #endif\n            \"\"\";\n        var node = GetMainNode(source);\n        var activeSections = node.ActiveConditionalCompilationSections();\n\n        activeSections.Should().NotBeNull();\n        activeSections.Should().BeEquivalentTo(\"BLOCK2\");\n    }\n\n    [TestMethod]\n    public void ActiveBlocks_NegativeConditions_InIf()\n    {\n        var source = \"\"\"\n            namespace Test\n            {\n            #if !BLOCK1\n                class Sample\n                {\n                    void Main() { }\n                }\n            #else\n            #endif\n            }\n            \"\"\";\n        var node = GetMainNode(source);\n        var activeSections = node.ActiveConditionalCompilationSections();\n\n        activeSections.Should().NotBeNull();\n        activeSections.Should().BeEmpty();\n    }\n\n    [TestMethod]\n    public void ActiveBlocks_NegativeConditions_InElse()\n    {\n        var source = \"\"\"\n            #define BLOCK1\n\n            namespace Test\n            {\n            #if !BLOCK1\n            #else\n                class Sample\n                {\n                    void Main() { }\n                }\n            #endif\n            }\n            \"\"\";\n        var node = GetMainNode(source);\n        var activeSections = node.ActiveConditionalCompilationSections();\n\n        activeSections.Should().NotBeNull();\n        activeSections.Should().BeEmpty();\n    }\n\n    [TestMethod]\n    public void ActiveBlocks_Else_FirstBranchIsActive()\n    {\n        var source = \"\"\"\n            #define BLOCK1\n\n            namespace Test\n            {\n            #if BLOCK1\n                class Sample\n                {\n                    void Main() { }\n            #else\n                class Sample\n                {\n                    void Main() {}\n            #endif\n            \"\"\";\n        var node = GetMainNode(source);\n        var activeSections = node.ActiveConditionalCompilationSections();\n\n        activeSections.Should().NotBeNull();\n        activeSections.Should().BeEquivalentTo(\"BLOCK1\");\n    }\n\n    [TestMethod]\n    public void ActiveBlocks_Else_SecondBranchIsActive()\n    {\n        var source = \"\"\"\n            #define BLOCK2\n\n            namespace Test\n            {\n            #if BLOCK1\n                class Sample\n                {\n                    void Main() { }\n            #else\n                class Sample\n                {\n                    void Main() {}\n            #endif\n            \"\"\";\n        var node = GetMainNode(source);\n        var activeSections = node.ActiveConditionalCompilationSections();\n\n        activeSections.Should().NotBeNull();\n        activeSections.Should().BeEmpty();\n    }\n\n    [TestMethod]\n    public void ActiveBlocks_Elif_FirstBranchIsActive()\n    {\n        var source = \"\"\"\n            #define BLOCK1\n            #define BLOCK2\n\n            namespace Test\n            {\n            #if BLOCK1\n                class Sample\n                {\n                    void Main() { }\n            #elif BLOCK2\n                class Sample\n                {\n                    void Main() {}\n            #endif\n                }\n            }\n            \"\"\";\n        var node = GetMainNode(source);\n        var activeSections = node.ActiveConditionalCompilationSections();\n\n        activeSections.Should().NotBeNull();\n        activeSections.Should().BeEquivalentTo(\"BLOCK1\");\n    }\n\n    [TestMethod]\n    public void ActiveBlocks_Elif_SecondBranchIsActive()\n    {\n        var source = \"\"\"\n            #define BLOCK2\n\n            namespace Test\n            {\n            #if BLOCK1\n                class Sample\n                {\n                    void Main() { }\n            #elif BLOCK2\n                class Sample\n                {\n                    void Main() {}\n            #endif\n                }\n            }\n            \"\"\";\n        var node = GetMainNode(source);\n        var activeSections = node.ActiveConditionalCompilationSections();\n\n        activeSections.Should().NotBeNull();\n        activeSections.Should().BeEquivalentTo(\"BLOCK2\");\n    }\n\n    [TestMethod]\n    public void ActiveBlocks_Elif_FirstBranchIsActive_InLeadingTrivia()\n    {\n        var source = \"\"\"\n            #define BLOCK1\n            #define BLOCK2\n\n            namespace Test\n            {\n                class Sample\n                {\n            #if BLOCK1\n                    void Main() { }\n            #elif BLOCK2\n                    void Main() {}\n            #endif\n                }\n            }\n            \"\"\";\n        var node = GetMainNode(source);\n        var activeSections = node.ActiveConditionalCompilationSections();\n\n        activeSections.Should().NotBeNull();\n        activeSections.Should().BeEquivalentTo(\"BLOCK1\");\n    }\n\n    [TestMethod]\n    public void ActiveBlocks_Elif_SecondBranchIsActive_InLeadingTrivia()\n    {\n        var source = \"\"\"\n            #define BLOCK2\n\n            namespace Test\n            {\n                class Sample\n                {\n            #if BLOCK1\n                    void Main() { }\n            #elif BLOCK2\n                    void Main() {}\n            #endif\n                }\n            }\n            \"\"\";\n        var node = GetMainNode(source);\n        var activeSections = node.ActiveConditionalCompilationSections();\n\n        activeSections.Should().NotBeNull();\n        activeSections.Should().BeEquivalentTo(\"BLOCK2\");\n    }\n\n    [TestMethod]\n    public void InactiveDirectives_ShouldBeIgnored()\n    {\n        var source = \"\"\"\n            #define BLOCK1\n            #define BLOCK2\n            #define BLOCK3\n            #define BLOCK4\n\n            namespace Test\n            {\n            #if INACTIVE1\n            #if BLOCK1  // inside inactive block -> ignored\n            #endif\n            #endif\n\n            #if BLOCK3\n                class Sample\n                {\n            #if BLOCK4\n            #if INACTIVE2\n            #if BLOCK2  // inside inactive block -> ignored\n            #endif\n            #endif\n                    void Main() { }\n                }\n\n            #endif\n\n            #if BLOCK1\n            #endif\n\n            }\n            \"\"\";\n        var node = GetMainNode(source);\n        var activeSections = node.ActiveConditionalCompilationSections();\n\n        activeSections.Should().NotBeNull();\n        activeSections.Should().BeEquivalentTo(\"BLOCK3\", \"BLOCK4\");\n    }\n\n    [TestMethod]\n    public void BadDirectives_ShouldBeIgnored()\n    {\n        var source = \"\"\"\n            #define BLOCK2\n\n            #if BLOCK1\n            #endif\n            #else // bad directive\n\n            #endif // bad directive\n\n            #if BLOCK2\n            #FOO // bad directive\n            namespace Test\n            {\n                class Sample\n                {\n            #BAR // bad directive\n                    void Main() { }\n                }\n            }\n            \"\"\";\n        var node = GetMainNode(source);\n        var activeSections = node.ActiveConditionalCompilationSections();\n\n        activeSections.Should().NotBeNull();\n        activeSections.Should().BeEquivalentTo(\"BLOCK2\");\n    }\n\n    [TestMethod]\n    public void GetName_CS()\n    {\n        const string code = \"\"\"\n            using System;\n            using C = System.Collections;\n            namespace MyNamespace.MyNamespaceNested\n            {\n                class Example\n                {\n                    delegate void MyDelegate();\n                    enum MyEnum { MyEnumValue };\n\n                    Example() { }\n                    ~Example() { }\n                    int MyProp { get; }\n\n                    unsafe ref byte Method<T>(byte[] input) where T: new()\n                    {\n                        int? i = null;\n                        int* iPtr;\n                        System.Exception qualified;\n                        global::System.Exception globalVar;\n                        input.ToString()?.ToString();\n                        Func<Action> fun = () => () => {};\n                        fun()();\n                        ref byte result = ref input[0];\n                        return ref result;\n                    }\n                    public static explicit operator int(Example e) => 0;\n                    public static int operator +(Example e) => 0;\n                    ref struct MyRefStruct { }\n                }\n            }\n            \"\"\";\n\n        var nodes = CSharpSyntaxTree.ParseText(code).GetRoot().DescendantNodes().ToArray();\n        Assert<AliasQualifiedNameSyntax>(\"System\");\n        Assert<ArrayTypeSyntax>(\"byte\");\n        Assert<BaseTypeDeclarationSyntax>(\"Example\", \"MyEnum\", \"MyRefStruct\");\n        Assert<ConstructorDeclarationSyntax>(\"Example\");\n        Assert<ConversionOperatorDeclarationSyntax>(\"int\");\n        Assert<DelegateDeclarationSyntax>(\"MyDelegate\");\n        Assert<DestructorDeclarationSyntax>(\"Example\");\n        Assert<EnumMemberDeclarationSyntax>(\"MyEnumValue\");\n        Assert<IdentifierNameSyntax>(\"System\", \"C\", \"System\", \"Collections\", \"MyNamespace\", \"MyNamespaceNested\", \"T\", \"System\", \"Exception\", \"global\", \"System\", \"Exception\", \"input\", \"ToString\", \"ToString\", \"Action\", \"fun\", \"input\", \"result\", \"Example\", \"Example\");\n        Assert<InvocationExpressionSyntax>(\"ToString\", \"ToString\", string.Empty, \"fun\");\n        Assert<MethodDeclarationSyntax>(\"Method\");\n        Assert<MemberAccessExpressionSyntax>(\"ToString\");\n        Assert<MemberBindingExpressionSyntax>(\"ToString\");\n        Assert<NamespaceDeclarationSyntax>(\"MyNamespaceNested\");\n        Assert<NullableTypeSyntax>(\"int\");\n        Assert<OperatorDeclarationSyntax>(\"+\");\n        Assert<ParameterSyntax>(\"input\", \"e\", \"e\");\n        Assert<PropertyDeclarationSyntax>(\"MyProp\");\n        Assert<PointerTypeSyntax>(\"int\");\n        Assert<PredefinedTypeSyntax>(\"void\", \"int\", \"int\", \"int\", \"int\", \"int\", \"byte\", \"byte\", \"byte\");\n        Assert<QualifiedNameSyntax>(\"Collections\", \"MyNamespaceNested\", \"Exception\", \"Exception\");\n        Assert<SimpleNameSyntax>(\"System\", \"C\", \"System\", \"Collections\", \"MyNamespace\", \"MyNamespaceNested\", \"T\", \"System\", \"Exception\", \"global\", \"System\", \"Exception\", \"input\", \"ToString\", \"ToString\", \"Func\", \"Action\", \"fun\", \"input\", \"result\", \"Example\", \"Example\");\n        Assert<TypeParameterConstraintClauseSyntax>(\"T\");\n        Assert<TypeParameterSyntax>(\"T\");\n        Assert<UsingDirectiveSyntax>(string.Empty, \"C\");\n        Assert<VariableDeclaratorSyntax>(\"i\", \"iPtr\", \"qualified\", \"globalVar\", \"fun\", \"result\");\n        Assert<RefTypeSyntax>(\"byte\", \"byte\");\n        Assert<ReturnStatementSyntax>(string.Empty);\n\n        void Assert<T>(params string[] expectedNames) where T : SyntaxNode =>\n            nodes.OfType<T>().Select(x => SyntaxNodeExtensionsCSharp.GetName(x)).Should().BeEquivalentTo(expectedNames, because: \"GetName for {0} should return the identifier\", typeof(T));\n    }\n\n    [TestMethod]\n    public void IsNullLiteral_Null_CS() =>\n        SyntaxNodeExtensionsCSharp.IsNullLiteral(null).Should().BeFalse();\n\n    private static MethodDeclarationSyntax GetMainNode(string source) =>\n        CSharpSyntaxTree.ParseText(source).GetRoot()\n            .DescendantNodes()\n            .OfType<MethodDeclarationSyntax>()\n            .First(x => x.Identifier.ValueText == \"Main\");\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Syntax/Utilities/EquivalenceCheckerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Syntax.Utilities;\nusing SonarAnalyzer.CSharp.Core.Syntax.Utilities;\nusing SonarAnalyzer.VisualBasic.Core.Syntax.Extensions;\nusing SonarAnalyzer.VisualBasic.Core.Syntax.Utilities;\nusing CS = Microsoft.CodeAnalysis.CSharp.Syntax;\nusing VB = Microsoft.CodeAnalysis.VisualBasic.Syntax;\n\nnamespace SonarAnalyzer.Test.Syntax.Utilities;\n\n[TestClass]\npublic class EquivalenceCheckerTest\n{\n    private const string CsSource = \"\"\"\n        namespace Test\n        {\n            class TestClass\n            {\n                int Property {get;set;}\n\n                public void Method1()\n                {\n                    var x = Property;\n                    Console.WriteLine(x);\n                }\n\n                public void Method2()\n                {\n                    var x = Property;\n                    Console.WriteLine(x);\n                }\n\n                public void Method3()\n                {\n                    var x = Property+2;\n                    Console.Write(x);\n                }\n\n                public void Method4()\n                {\n                    var x = Property-2;\n                    Console.Write(x);\n                }\n            }\n        }\n        \"\"\";\n\n    private const string VbSource = \"\"\"\n        Namespace Test\n\n            Class TestClass\n\n                Public Property Value As Integer\n\n                Public Sub Method1()\n                    If True Then\n                        Dim x As Integer = Value\n                        Console.WriteLine(x)\n                    End If\n                End Sub\n\n                Public Sub Method2()\n                    If True Then\n                        Dim x As Integer = Value\n                        Console.WriteLine(x)\n                    End If\n                End Sub\n\n                Public Sub Method3()\n                    If True Then\n                        Dim x As Integer = Value + 2\n                        Console.Write(x)\n                    End If\n                End Sub\n\n                Public Sub Method4()\n                    If True Then\n                        Dim x As Integer = Value - 2\n                        Console.Write(x)\n                    End If\n                End Sub\n\n            End Class\n\n        End Namespace\n        \"\"\";\n\n    private CSharpMethods csMethods;\n    private VisualBasicMethods vbMethods;\n\n    [TestInitialize]\n    public void TestSetup()\n    {\n        csMethods = new CSharpMethods(CsSource);\n        vbMethods = new VisualBasicMethods(VbSource);\n    }\n\n    [TestMethod]\n    public void AreEquivalent_Node_CS()\n    {\n        var result = CSharpEquivalenceChecker.AreEquivalent(csMethods.Method1, csMethods.Method2);\n        result.Should().BeTrue();\n\n        result = CSharpEquivalenceChecker.AreEquivalent(csMethods.Method1, csMethods.Method3);\n        result.Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void AreEquivalent_List_CS()\n    {\n        var result = CSharpEquivalenceChecker.AreEquivalent(csMethods.Method1.Statements, csMethods.Method2.Statements);\n        result.Should().BeTrue();\n\n        result = CSharpEquivalenceChecker.AreEquivalent(csMethods.Method1.Statements, csMethods.Method3.Statements);\n        result.Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void EqualityComparer_Node_CS()\n    {\n        var comparer = new CSharpSyntaxNodeEqualityComparer<CS.BlockSyntax>();\n\n        var result = comparer.Equals(csMethods.Method1, csMethods.Method2);\n        result.Should().BeTrue();\n\n        result = comparer.Equals(csMethods.Method1, csMethods.Method3);\n        result.Should().BeFalse();\n\n        var hashSet = new HashSet<CS.BlockSyntax>(new[] { csMethods.Method1, csMethods.Method2, csMethods.Method3 }, comparer);\n        hashSet.Should().HaveCount(2);\n        hashSet.Should().Contain(csMethods.Method1);\n        hashSet.Should().NotContain(csMethods.Method4);\n    }\n\n    [TestMethod]\n    public void EqualityComparer_List_CS()\n    {\n        var comparer = new CSharpSyntaxNodeEqualityComparer<CS.StatementSyntax>();\n\n        var result = comparer.Equals(csMethods.Method1.Statements, csMethods.Method2.Statements);\n        result.Should().BeTrue();\n\n        result = comparer.Equals(csMethods.Method1.Statements, csMethods.Method3.Statements);\n        result.Should().BeFalse();\n\n        var hashSet = new HashSet<SyntaxList<CS.StatementSyntax>>(new[] { csMethods.Method1.Statements, csMethods.Method2.Statements, csMethods.Method3.Statements }, comparer);\n        hashSet.Should().HaveCount(2);\n        hashSet.Should().Contain(csMethods.Method1.Statements);\n        hashSet.Should().NotContain(csMethods.Method4.Statements);\n    }\n\n    [TestMethod]\n    public void AreEquivalent_Node_VB()\n    {\n        var result = VisualBasicEquivalenceChecker.AreEquivalent(vbMethods.Method1.First(), vbMethods.Method2.First());\n        result.Should().BeTrue();\n\n        result = VisualBasicEquivalenceChecker.AreEquivalent(vbMethods.Method1.First(), vbMethods.Method3.First());\n        result.Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void AreEquivalent_List_VB()\n    {\n        var result = VisualBasicEquivalenceChecker.AreEquivalent(vbMethods.Method1, vbMethods.Method2);\n        result.Should().BeTrue();\n\n        result = VisualBasicEquivalenceChecker.AreEquivalent(vbMethods.Method1, vbMethods.Method3);\n        result.Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void EqualityComparer_Node_VB()\n    {\n        var comparer = new VisualBasicSyntaxNodeEqualityComparer<VB.StatementSyntax>();\n\n        var result = comparer.Equals(vbMethods.Method1.First(), vbMethods.Method2.First());\n        result.Should().BeTrue();\n\n        result = comparer.Equals(vbMethods.Method1.First(), vbMethods.Method3.First());\n        result.Should().BeFalse();\n\n        var hashSet = new HashSet<VB.StatementSyntax>(new[] { vbMethods.Method1.First(), vbMethods.Method2.First(), vbMethods.Method3.First() }, comparer);\n        hashSet.Should().HaveCount(2);\n        hashSet.Should().Contain(vbMethods.Method1.First());\n        hashSet.Should().NotContain(vbMethods.Method4.First());\n    }\n\n    [TestMethod]\n    public void EqualityComparer_List_VB()\n    {\n        var comparer = new VisualBasicSyntaxNodeEqualityComparer<VB.StatementSyntax>();\n\n        var result = comparer.Equals(vbMethods.Method1, vbMethods.Method2);\n        result.Should().BeTrue();\n\n        result = comparer.Equals(vbMethods.Method1, vbMethods.Method3);\n        result.Should().BeFalse();\n\n        var hashSet = new HashSet<SyntaxList<VB.StatementSyntax>>(new[] { vbMethods.Method1, vbMethods.Method2, vbMethods.Method3 }, comparer);\n        hashSet.Should().HaveCount(2);\n        hashSet.Should().Contain(vbMethods.Method1);\n        hashSet.Should().NotContain(vbMethods.Method4);\n    }\n\n    [TestMethod]\n    public void EqualityComparer_Node_CrossLanguage() =>\n        EquivalenceChecker.AreEquivalent(vbMethods.Method1.First(), csMethods.Method1, null).Should().BeFalse();\n\n    private class CSharpMethods\n    {\n        public readonly CS.BlockSyntax Method1;\n        public readonly CS.BlockSyntax Method2;\n        public readonly CS.BlockSyntax Method3;\n        public readonly CS.BlockSyntax Method4;\n\n        public CSharpMethods(string source)\n        {\n            var methods = Microsoft.CodeAnalysis.CSharp.CSharpSyntaxTree.ParseText(source).GetRoot().DescendantNodes().OfType<CS.MethodDeclarationSyntax>().ToArray();\n            Method1 = methods.Single(x => x.Identifier.ValueText == \"Method1\").Body;\n            Method2 = methods.Single(x => x.Identifier.ValueText == \"Method2\").Body;\n            Method3 = methods.Single(x => x.Identifier.ValueText == \"Method3\").Body;\n            Method4 = methods.Single(x => x.Identifier.ValueText == \"Method4\").Body;\n        }\n    }\n\n    private class VisualBasicMethods\n    {\n        public readonly SyntaxList<VB.StatementSyntax> Method1;\n        public readonly SyntaxList<VB.StatementSyntax> Method2;\n        public readonly SyntaxList<VB.StatementSyntax> Method3;\n        public readonly SyntaxList<VB.StatementSyntax> Method4;\n\n        public VisualBasicMethods(string source)\n        {\n            var methods = Microsoft.CodeAnalysis.VisualBasic.VisualBasicSyntaxTree.ParseText(source).GetRoot().DescendantNodes().OfType<VB.MethodBlockSyntax>().ToArray();\n            Method1 = methods.Single(x => x.GetIdentifierText() == \"Method1\").Statements;\n            Method2 = methods.Single(x => x.GetIdentifierText() == \"Method2\").Statements;\n            Method3 = methods.Single(x => x.GetIdentifierText() == \"Method3\").Statements;\n            Method4 = methods.Single(x => x.GetIdentifierText() == \"Method4\").Statements;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Syntax/Utilities/MethodParameterLookupTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Collections;\nusing SonarAnalyzer.Core.Syntax.Utilities;\nusing SonarAnalyzer.CSharp.Core.Syntax.Utilities;\nusing SonarAnalyzer.VisualBasic.Core.Syntax.Utilities;\nusing CSharpCodeAnalysis = Microsoft.CodeAnalysis.CSharp;\nusing CSharpSyntax = Microsoft.CodeAnalysis.CSharp.Syntax;\nusing VBCodeAnalysis = Microsoft.CodeAnalysis.VisualBasic;\nusing VBSyntax = Microsoft.CodeAnalysis.VisualBasic.Syntax;\n\nnamespace SonarAnalyzer.Test.Syntax.Utilities;\n\n[TestClass]\npublic class MethodParameterLookupTest\n{\n    private const string SourceCS = \"\"\"\n            namespace Test\n            {\n                class TestClass\n                {\n                    void Main()\n                    {\n                        DoNothing();\n                        DoSomething(1, true);\n                        DoSomething(b: true, a: 1);\n                        WithOptional(1);\n                        WithOptional(1, \"Ipsum\");\n                        WithOptional(opt: \"Ipsum\", a: 1);\n                        WithParams();\n                        WithParams(1, 2, 3);\n                    }\n\n                    void ThisShouldNotBeFoundInMain()\n                    {\n                        SpecialMethod(65535);\n                    }\n\n                    void DoNothing()\n                    {\n                    }\n\n                    void DoSomething(int a, bool b)\n                    {\n                    }\n\n                    void WithOptional(int a, string opt = \"Lorem\")\n                    {\n                    }\n\n                    void WithParams(params int[] arr)\n                    {\n                    }\n\n                    void SpecialMethod(int specialParameter)\n                    {\n                    }\n                }\n            }\n            \"\"\";\n\n    private const string SourceVB = \"\"\"\n            Module MainModule\n\n                Sub Main()\n                    DoNothing()\n                    DoSomething(1, True)\n                    WithOptional(1)\n                    WithOptional(1, \"Ipsum\")\n                    WithParams()\n                    WithParams(1, 2, 3)\n                End Sub\n\n                Sub ThisShouldNotBeFoundInMain()\n                    SpecialMethod(65535)\n                End Sub\n\n                Sub DoNothing()\n                End Sub\n\n                Sub DoSomething(a As Integer, b As Boolean)\n                End Sub\n\n                Sub WithOptional(a As Integer, Optional opt As String = \"Lorem\")\n                End Sub\n\n                Sub WithParams(ParamArray arr() As Integer)\n                End Sub\n\n                Sub SpecialMethod(SpecialParameter As Integer)\n                End Sub\n            End Module\n            \"\"\";\n\n    [TestMethod]\n    public void TestMethodParameterLookup_CS()\n    {\n        var c = new CSharpInspection(SourceCS);\n        c.CheckExpectedParameterMappings(0, \"DoNothing\", new { });\n        c.CheckExpectedParameterMappings(1, \"DoSomething\", new { a = 1, b = true });\n        c.CheckExpectedParameterMappings(2, \"DoSomething\", new { a = 1, b = true });\n        c.CheckExpectedParameterMappings(3, \"WithOptional\", new { a = 1 });\n        c.CheckExpectedParameterMappings(4, \"WithOptional\", new { a = 1, opt = \"Ipsum\" });\n        c.CheckExpectedParameterMappings(5, \"WithOptional\", new { a = 1, opt = \"Ipsum\" });\n        c.CheckExpectedParameterMappings(6, \"WithParams\", new { });\n        c.CheckExpectedParameterMappings(7, \"WithParams\", new { arr = new[] { 1, 2, 3 } });\n\n        c.MainInvocations.Length.Should().Be(8); // Self-Test of this test. If new Invocation is added to the Main(), this number has to be updated and test should be written for that case.\n    }\n\n    [TestMethod]\n    public void TestMethodParameterLookup_VB()\n    {\n        var c = new VisualBasicInspection(SourceVB);\n        c.CheckExpectedParameterMappings(0, \"DoNothing\", new { });\n        c.CheckExpectedParameterMappings(1, \"DoSomething\", new { a = 1, b = true });\n        c.CheckExpectedParameterMappings(2, \"WithOptional\", new { a = 1 });\n        c.CheckExpectedParameterMappings(3, \"WithOptional\", new { a = 1, opt = \"Ipsum\" });\n        c.CheckExpectedParameterMappings(4, \"WithParams\", new { });\n        c.CheckExpectedParameterMappings(5, \"WithParams\", new { arr = new[] { 1, 2, 3 } });\n\n        c.MainInvocations.Length.Should().Be(6); // Self-Test of this test. If new Invocation is added to the Main(), this number has to be updated and test should be written for that case.\n    }\n\n    [TestMethod]\n    public void TestMethodParameterLookup_CS_ThrowsException()\n    {\n        var c = new CSharpInspection(SourceCS);\n        var lookupThrow = c.CreateLookup(1, \"DoSomething\");\n\n        var invalidOperationEx = Assert.Throws<InvalidOperationException>(() => lookupThrow.TryGetNonParamsSyntax(lookupThrow.MethodSymbol.Parameters.Single(), out var argument));\n        invalidOperationEx.Message.Should().Be(\"Sequence contains more than one element\");\n\n        var argumentEx = Assert.Throws<ArgumentException>(() =>\n            lookupThrow.TryGetSymbol(CSharpCodeAnalysis.SyntaxFactory.LiteralExpression(CSharpCodeAnalysis.SyntaxKind.StringLiteralExpression), out var parameter));\n        argumentEx.Message.Should().StartWith(\"argument must be of type Microsoft.CodeAnalysis.CSharp.Syntax.ArgumentSyntax\");\n    }\n\n    [TestMethod]\n    public void TestMethodParameterLookup_VB_ThrowsException()\n    {\n        var c = new VisualBasicInspection(SourceVB);\n        var lookupThrow = c.CreateLookup(1, \"DoSomething\");\n\n        var invalidOperationEx = Assert.Throws<InvalidOperationException>(() => lookupThrow.TryGetNonParamsSyntax(lookupThrow.MethodSymbol.Parameters.Single(), out var argument));\n        invalidOperationEx.Message.Should().Be(\"Sequence contains more than one element\");\n\n        var argumentEx = Assert.Throws<ArgumentException>(() =>\n            lookupThrow.TryGetSymbol(VBCodeAnalysis.SyntaxFactory.StringLiteralExpression(VBCodeAnalysis.SyntaxFactory.StringLiteralToken(string.Empty, string.Empty)), out var parameter));\n        argumentEx.Message.Should().StartWith(\"argument must be of type Microsoft.CodeAnalysis.VisualBasic.Syntax.ArgumentSyntax\");\n    }\n\n    [TestMethod]\n    public void TestMethodParameterLookup_CS_ThrowsException_NonParams()\n    {\n        var c = new CSharpInspection(SourceCS);\n        var lookupThrow = c.CreateLookup(7, \"WithParams\");\n\n        var invalidOperationEx = Assert.Throws<InvalidOperationException>(() => lookupThrow.TryGetNonParamsSyntax(lookupThrow.MethodSymbol.Parameters.Single(), out var argument));\n        invalidOperationEx.Message.Should().Be(\"Cannot call TryGetNonParamsSyntax on ParamArray/params parameters.\");\n    }\n\n    [TestMethod]\n    public void TestMethodParameterLookup_VB_ThrowsException_NonParams()\n    {\n        var c = new VisualBasicInspection(SourceVB);\n        var lookupThrow = c.CreateLookup(5, \"WithParams\");\n\n        var invalidOperationEx = Assert.Throws<InvalidOperationException>(() => lookupThrow.TryGetNonParamsSyntax(lookupThrow.MethodSymbol.Parameters.Single(), out var argument));\n        invalidOperationEx.Message.Should().Be(\"Cannot call TryGetNonParamsSyntax on ParamArray/params parameters.\");\n    }\n\n    [TestMethod]\n    public void TestMethodParameterLookup_CS_MultipleCandidates()\n    {\n        var source = \"\"\"\n            namespace Test\n            {\n                class TestClass\n                {\n                    void Main(dynamic d) =>\n                        AmbiguousCall(d);\n\n                    void AmbiguousCall(int p) { }\n\n                    void AmbiguousCall(string p) { }\n                }\n            }\n            \"\"\";\n        var (tree, model) = TestCompiler.CompileCS(source);\n        var lookup = new CSharpMethodParameterLookup(tree.GetRoot().DescendantNodes().OfType<CSharpSyntax.InvocationExpressionSyntax>().Single(), model);\n\n        lookup.TryGetSyntax(\"p\", out var expressions).Should().BeTrue();\n        expressions.Should().BeEquivalentTo<object>(new[] { new { Identifier = new { ValueText = \"d\" } } });\n    }\n\n    [TestMethod]\n    public void TestMethodParameterLookup_VB_MultipleCandidates()\n    {\n        var source = \"\"\"\n            Module Test\n                Sub Main()\n                    Overloaded(42, \"\")\n                End Sub\n\n                Sub Overloaded(a As Integer, b As Boolean)\n                End Sub\n\n                Sub Overloaded(a As Integer, b As Integer)\n                End Sub\n            End Module\n            \"\"\";\n        var (tree, model) = TestCompiler.CompileIgnoreErrorsVB(source);\n        var lookup = new VisualBasicMethodParameterLookup(tree.GetRoot().DescendantNodes().OfType<VBSyntax.InvocationExpressionSyntax>().Single(), model);\n\n        lookup.TryGetSyntax(\"a\", out var expressions).Should().BeTrue();\n        expressions.Should().BeEquivalentTo<object>(new[] { new { Token = new { ValueText = \"42\" } } });\n    }\n\n    [TestMethod]\n    public void TestMethodParameterLookup_CS_MultipleCandidatesWithDifferentParameters()\n    {\n        var source = \"\"\"\n            namespace Test\n            {\n                class TestClass\n                {\n                    void Main(dynamic d) =>\n                        AmbiguousCall(d, d);\n\n                    void AmbiguousCall(int a, int b) { }\n\n                    void AmbiguousCall(string b, string a) { }\n                }\n            }\n            \"\"\";\n        var (tree, model) = TestCompiler.CompileCS(source);\n        var lookup = new CSharpMethodParameterLookup(tree.GetRoot().DescendantNodes().OfType<CSharpSyntax.InvocationExpressionSyntax>().Single(), model);\n\n        lookup.TryGetSyntax(\"a\", out var expressions).Should().BeFalse();\n        expressions.Should().BeEmpty();\n    }\n\n    [TestMethod]\n    public void TestMethodParameterLookup_VB_MultipleCandidatesWithDifferentParameters()\n    {\n        var source = \"\"\"\n            Module Test\n                Sub Main()\n                    Overloaded(42, \"\")\n                End Sub\n\n                Sub Overloaded(a As Integer, b As Integer)\n                End Sub\n\n                Sub Overloaded(b As Boolean, a As Boolean)\n                End Sub\n            End Module\n            \"\"\";\n        var (tree, model) = TestCompiler.CompileIgnoreErrorsVB(source);\n        var lookup = new VisualBasicMethodParameterLookup(tree.GetRoot().DescendantNodes().OfType<VBSyntax.InvocationExpressionSyntax>().Single(), model);\n\n        lookup.TryGetSyntax(\"a\", out var expressions).Should().BeFalse();\n        expressions.Should().BeEmpty();\n    }\n\n    [TestMethod]\n    public void TestMethodParameterLookup_CS_UnknownMethod()\n    {\n        var source = \"\"\"\n            namespace Test\n            {\n                class TestClass\n                {\n                    void Main()\n                    {\n                        UnknownMethod(42);\n                    }\n                }\n            }\n            \"\"\";\n        var (tree, model) = TestCompiler.CompileIgnoreErrorsCS(source);\n        var lookup = new CSharpMethodParameterLookup(tree.GetRoot().DescendantNodes().OfType<CSharpSyntax.InvocationExpressionSyntax>().Single(), model);\n\n        lookup.TryGetSyntax(\"p\", out var expressions).Should().BeFalse();\n        expressions.Should().BeEmpty();\n    }\n\n    [TestMethod]\n    public void TestMethodParameterLookup_VB_UnknownMethod()\n    {\n        var source = \"\"\"\n            Module Test\n                Sub Main()\n                    UnknownMethod(42)\n                End Sub\n            End Module\n            \"\"\";\n        var (tree, model) = TestCompiler.CompileIgnoreErrorsVB(source);\n        var lookup = new VisualBasicMethodParameterLookup(tree.GetRoot().DescendantNodes().OfType<VBSyntax.InvocationExpressionSyntax>().Single(), model);\n\n        lookup.TryGetSyntax(\"a\", out var expressions).Should().BeFalse();\n        expressions.Should().BeEmpty();\n    }\n\n    private abstract class InspectionBase<TArgumentSyntax, TInvocationSyntax>\n        where TArgumentSyntax : SyntaxNode\n        where TInvocationSyntax : SyntaxNode\n    {\n        public abstract TInvocationSyntax[] FindInvocationsIn(string name);\n        public abstract object ExtractArgumentValue(TArgumentSyntax argumentSyntax);\n        public abstract TArgumentSyntax[] GetArguments(TInvocationSyntax invocation);\n        public abstract MethodParameterLookupBase<TArgumentSyntax> CreateLookup(TInvocationSyntax invocation, IMethodSymbol method);\n\n        public SnippetCompiler Compiler { get; protected set; }\n        public TInvocationSyntax[] MainInvocations { get; protected set; }\n        public TArgumentSyntax SpecialArgument { get; private set; }\n        public IParameterSymbol SpecialParameter { get; private set; }\n\n        protected InspectionBase(string source, AnalyzerLanguage language)\n        {\n            Compiler = new SnippetCompiler(source, false, language);\n            MainInvocations = FindInvocationsIn(\"Main\");\n        }\n\n        public MethodParameterLookupBase<TArgumentSyntax> CreateLookup(int invocationIndex, string expectedMethod)\n        {\n            var invocation = MainInvocations[invocationIndex];\n            var method = Compiler.Model.GetSymbolInfo(invocation).Symbol as IMethodSymbol;\n            method.Name.Should().Be(expectedMethod);\n            return CreateLookup(invocation, method);\n        }\n\n        public void CheckExpectedParameterMappings(int invocationIndex, string expectedMethod, object expectedArguments)\n        {\n            var lookup = CreateLookup(invocationIndex, expectedMethod);\n            InspectTryGetSyntax(lookup, expectedArguments, lookup.MethodSymbol);\n            InspectTryGetSymbol(lookup, expectedArguments, GetArguments(MainInvocations[invocationIndex]));\n        }\n\n        protected void InitSpecial(TInvocationSyntax specialInvocation)\n        {\n            SpecialArgument = GetArguments(specialInvocation).Single();\n            SpecialParameter = (Compiler.Model.GetSymbolInfo(specialInvocation).Symbol as IMethodSymbol).Parameters.Single();\n        }\n\n        private void InspectTryGetSyntax(MethodParameterLookupBase<TArgumentSyntax> lookup, object expectedArguments, IMethodSymbol method)\n        {\n            lookup.TryGetSyntax(SpecialParameter, out var symbol).Should().Be(false);\n\n            foreach (var parameter in method.Parameters)\n            {\n                if (parameter.IsParams && lookup.TryGetSyntax(parameter, out var expressions))\n                {\n                    var expected = ExtractExpectedValue(expectedArguments, parameter.Name).Should().BeAssignableTo<IEnumerable>().Subject.Cast<object>();\n                    expressions.Select(x => ConstantValue(x)).Should().Equal(expected);\n                }\n                else if (!parameter.IsParams && lookup.TryGetNonParamsSyntax(parameter, out var expression))\n                {\n                    ConstantValue(expression).Should().Be(ExtractExpectedValue(expectedArguments, parameter.Name));\n                }\n                else if (!parameter.IsOptional && !parameter.IsParams)\n                {\n                    Assert.Fail($\"TryGetSyntax missing {parameter.Name}\");\n                } // Else it's OK\n            }\n        }\n\n        private void InspectTryGetSymbol(MethodParameterLookupBase<TArgumentSyntax> lookup, object expectedArguments, TArgumentSyntax[] arguments)\n        {\n            lookup.TryGetSymbol(SpecialArgument, out var parameter).Should().Be(false);\n\n            foreach (var argument in arguments)\n            {\n                if (lookup.TryGetSymbol(argument, out var symbol))\n                {\n                    var value = ExtractArgumentValue(argument);\n                    var expected = ExtractExpectedValue(expectedArguments, symbol.Name);\n                    if (symbol.IsParams)\n                    {\n                        // Expected contains all values {1, 2, 3} for ParamArray/params, but foreach is probing one at a time\n                        expected.Should().BeAssignableTo<IEnumerable>().Which.Cast<object>().Should().Contain(value);\n                    }\n                    else\n                    {\n                        value.Should().Be(expected);\n                    }\n                }\n                else\n                {\n                    Assert.Fail($\"TryGetParameterSymbol missing {argument.ToString()}\");\n                }\n            }\n        }\n\n        private static object ExtractExpectedValue(object expected, string name)\n        {\n            var pi = expected.GetType().GetProperty(name);\n            if (pi is null)\n            {\n                Assert.Fail($\"Parameter name {name} was not expected.\");\n            }\n            return pi.GetValue(expected, null);\n        }\n\n        private object ConstantValue(SyntaxNode node) =>\n            Compiler.Model.GetConstantValue(node).Value;\n    }\n\n    private class CSharpInspection : InspectionBase<CSharpSyntax.ArgumentSyntax, CSharpSyntax.InvocationExpressionSyntax>\n    {\n        public CSharpInspection(string source) : base(source, AnalyzerLanguage.CSharp) =>\n            InitSpecial(Compiler.Nodes<CSharpSyntax.InvocationExpressionSyntax>()\n                                .Single(x => x.Expression is CSharpSyntax.IdentifierNameSyntax identifier\n                                             && identifier.Identifier.ValueText == \"SpecialMethod\"));\n\n        public override CSharpSyntax.InvocationExpressionSyntax[] FindInvocationsIn(string name) =>\n            Compiler.Nodes<CSharpSyntax.MethodDeclarationSyntax>().Single(x => x.Identifier.ValueText == name).DescendantNodes().OfType<CSharpSyntax.InvocationExpressionSyntax>().ToArray();\n\n        public override CSharpSyntax.ArgumentSyntax[] GetArguments(CSharpSyntax.InvocationExpressionSyntax invocation) =>\n            invocation.ArgumentList.Arguments.ToArray();\n\n        public override object ExtractArgumentValue(CSharpSyntax.ArgumentSyntax argumentSyntax) =>\n            Compiler.Model.GetConstantValue(argumentSyntax.Expression).Value;\n\n        public override MethodParameterLookupBase<CSharpSyntax.ArgumentSyntax> CreateLookup(CSharpSyntax.InvocationExpressionSyntax invocation, IMethodSymbol method) =>\n            new CSharpMethodParameterLookup(invocation.ArgumentList, method);\n    }\n\n    private class VisualBasicInspection : InspectionBase<VBSyntax.ArgumentSyntax, VBSyntax.InvocationExpressionSyntax>\n    {\n        public VisualBasicInspection(string source) : base(source, AnalyzerLanguage.VisualBasic) =>\n            InitSpecial(Compiler.Nodes<VBSyntax.InvocationExpressionSyntax>()\n                                .Single(x => x.Expression is VBSyntax.IdentifierNameSyntax identifier\n                                             && identifier.Identifier.ValueText == \"SpecialMethod\"));\n\n        public override VBSyntax.InvocationExpressionSyntax[] FindInvocationsIn(string name) =>\n            Compiler.Nodes<VBSyntax.MethodBlockSyntax>().Single(x => x.SubOrFunctionStatement.Identifier.ValueText == \"Main\")\n                                                           .DescendantNodes().OfType<VBSyntax.InvocationExpressionSyntax>().ToArray();\n\n        public override VBSyntax.ArgumentSyntax[] GetArguments(VBSyntax.InvocationExpressionSyntax invocation) =>\n            invocation.ArgumentList.Arguments.ToArray();\n\n        public override MethodParameterLookupBase<VBSyntax.ArgumentSyntax> CreateLookup(VBSyntax.InvocationExpressionSyntax invocation, IMethodSymbol method) =>\n            new VisualBasicMethodParameterLookup(invocation.ArgumentList, Compiler.Model);\n\n        public override object ExtractArgumentValue(VBSyntax.ArgumentSyntax argumentSyntax) =>\n            Compiler.Model.GetConstantValue(argumentSyntax.GetExpression()).Value;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Syntax/Utilities/RemovableDeclarationCollectorTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.VisualBasic;\nusing Microsoft.CodeAnalysis.VisualBasic.Syntax;\nusing SonarAnalyzer.VisualBasic.Core.Syntax.Utilities;\nusing CodeAnalysisAccessibility = Microsoft.CodeAnalysis.Accessibility; // This is needed because there is an Accessibility namespace in the windows forms binaries.\n\nnamespace SonarAnalyzer.Test.Syntax.Utilities;\n\n[TestClass]\npublic class RemovableDeclarationCollectorTest\n{\n    [TestMethod]\n    public void RemovableFieldLikeDeclarations_SearchesInNestedTypes_VB()\n    {\n        const string code = \"\"\"\n            Public Class Sample\n\n                Public CompliantA, CompliantB As Integer\n                Public CompliantC As Integer\n\n                Private Class NestedClass\n\n                    Public FieldInNestedClass As Integer\n\n                End Class\n\n                Private Structure NestedStruct\n\n                    Public FieldInNestedStruct As Integer\n\n                End Structure\n\n            End Class\n            \"\"\";\n        var sut = CreateCollector(code);\n        var ret = sut.RemovableFieldLikeDeclarations(new[] { SyntaxKind.FieldDeclaration }.ToHashSet(), CodeAnalysisAccessibility.Public);\n        ret.Should().HaveCount(5);\n        ret.Select(x => x.Symbol.Name).Should().BeEquivalentTo(\"CompliantA\", \"CompliantB\", \"CompliantC\", \"FieldInNestedClass\", \"FieldInNestedStruct\");\n    }\n\n    [TestMethod]\n    public void RemovableDeclarations_VB()\n    {\n        const string code = \"\"\"\n            Public Class Base\n\n                Public Overridable Sub OverridableMethod_NotRemovable()\n                End Sub\n\n            End Class\n\n            Public Interface IBase\n\n                Sub InterfaceMethod_NotRemovable()\n\n            End Interface\n\n            Public Class Sample\n                Inherits Base\n                Implements IBase\n\n                Public Sub RemovableMethod()\n                End Sub\n\n                Public Overrides Sub OverridableMethod_NotRemovable()\n                End Sub\n\n                Public Sub InterfaceMethod_NotRemovable() Implements IBase.InterfaceMethod_NotRemovable\n                End Sub\n\n                <System.ComponentModel.Browsable(False)>\n                Public Sub WithAttributes_NotRemovable()\n                End Sub\n\n                Public Overridable Sub Overridable_NotRemovable()\n                End Sub\n\n                Public Interface INestedInterface\n\n                    Sub NestedInterfaceMethod_NotRemovable()\n\n                End Interface\n\n                Public MustInherit Class AbstractType\n\n                    Public MustOverride Sub Abstract_NotRemovable()\n\n                End Class\n\n            End Class\n            \"\"\";\n        var sut = CreateCollector(code);\n        var ret = sut.RemovableDeclarations(new[] { SyntaxKind.SubBlock, SyntaxKind.SubStatement }.ToHashSet(), CodeAnalysisAccessibility.Public);\n        ret.Should().ContainSingle();\n        ret.Single().Symbol.Name.Should().Be(\"RemovableMethod\");\n    }\n\n    [TestMethod]\n    public void IsRemovable_Null_ReturnsFalse() =>\n        VisualBasicRemovableDeclarationCollector.IsRemovable(null, CodeAnalysisAccessibility.Public).Should().BeFalse();\n\n    private static VisualBasicRemovableDeclarationCollector CreateCollector(string code)\n    {\n        var (tree, semanticModel) = TestCompiler.CompileVB(code, MetadataReferenceFacade.SystemComponentModelPrimitives.ToArray());\n        var type = tree.GetRoot().DescendantNodes().OfType<ClassBlockSyntax>().Single(x => x.ClassStatement.Identifier.ValueText == \"Sample\");\n        return new VisualBasicRemovableDeclarationCollector(semanticModel.GetDeclaredSymbol(type), semanticModel.Compilation);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Syntax/Utilities/SymbolUsageCollectorTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing SonarAnalyzer.CSharp.Syntax.Utilities;\n\nnamespace SonarAnalyzer.Test.Syntax.Utilities;\n\n[TestClass]\npublic class SymbolUsageCollectorTest\n{\n    [TestMethod]\n    public void VerifyUsagesBeingCollectedOnMatchingSyntaxNodes()\n    {\n        const string firstSnippet = \"\"\"\n            public class Foo\n            {\n                private int Field = 42;\n                public int FooMethod(int arg)\n                {\n                    Field += arg;\n                    return Field;\n                }\n            }\n            \"\"\";\n        const string secondSnippet = \"\"\"\n            public class Bar\n            {\n                private int Field = 42;\n                public int BarMethod()\n                {\n                    return Field;\n                }\n            }\n            \"\"\";\n        var firstCompilation = SolutionBuilder.Create().AddProject(AnalyzerLanguage.CSharp).AddSnippet(firstSnippet).GetCompilation();\n        var secondCompilation = SolutionBuilder.Create().AddProject(AnalyzerLanguage.CSharp).AddSnippet(secondSnippet).GetCompilation();\n\n        var firstTree = firstCompilation.SyntaxTrees.Single();\n        var fooMethod = firstTree.Single<MethodDeclarationSyntax>();\n        var firstCompilationModel = firstCompilation.GetSemanticModel(firstTree);\n        var firstCompilationFieldSymbol = firstCompilationModel.GetSymbolInfo(fooMethod.DescendantNodes().OfType<ReturnStatementSyntax>().Single().Expression).Symbol;\n        var firstCompilationKnownSymbols = new List<ISymbol> { firstCompilationFieldSymbol };\n\n        // compilation matches semantic model and syntax node\n        var firstCompilationUsageCollector = new SymbolUsageCollector(firstCompilation, firstCompilationKnownSymbols);\n        firstCompilationUsageCollector.Visit(fooMethod);\n        firstCompilationUsageCollector.UsedSymbols.Should().NotBeEmpty();\n        var firstCompilationUsedSymbols = firstCompilationUsageCollector.UsedSymbols;\n\n        // compilation doesn't match syntax node, since it belongs to another compilation\n        var secondTree = secondCompilation.SyntaxTrees.Single();\n        var barMethod = secondTree.Single<MethodDeclarationSyntax>();\n        firstCompilationUsageCollector.Visit(barMethod);\n        firstCompilationUsageCollector.UsedSymbols.Should().BeEquivalentTo(firstCompilationUsedSymbols);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Syntax/Utilities/SyntaxClassifierTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Core.Syntax.Extensions;\nusing SonarAnalyzer.CSharp.Core.Syntax.Utilities;\nusing SonarAnalyzer.VisualBasic.Core.Syntax.Extensions;\nusing SonarAnalyzer.VisualBasic.Core.Syntax.Utilities;\nusing CS = Microsoft.CodeAnalysis.CSharp;\nusing SyntaxCS = Microsoft.CodeAnalysis.CSharp.Syntax;\nusing SyntaxVB = Microsoft.CodeAnalysis.VisualBasic.Syntax;\nusing VB = Microsoft.CodeAnalysis.VisualBasic;\n\nnamespace SonarAnalyzer.Test.Syntax.Utilities;\n\n[TestClass]\npublic class SyntaxClassifierTest\n{\n    [TestMethod]\n    [DataRow(\"while (condition) { }\")]\n    [DataRow(\"while (a && (b || !condition)) { }\")]\n    [DataRow(\"do { } while (condition);\")]\n    [DataRow(\"do { } while (a && (b || !condition));\")]\n    [DataRow(\"for(; condition; ) { }\")]\n    [DataRow(\"for(; a && (b || !condition); ) { }\")]\n    public void IsInLoopCondition_Loops_CS(string code) =>\n        IsInLoopConditionCS(code).Should().BeTrue();\n\n    [TestMethod]\n    public void IsInLoopCondition_If_CS()\n    {\n        const string code = \"\"\"\n            while (a)\n            {\n                do\n                {\n                    if (condition)  // This is asserted\n                    {\n                    }\n                }\n                while (b);\n            }\n            \"\"\";\n        IsInLoopConditionCS(code).Should().BeFalse();\n    }\n\n    [TestMethod]\n    [DataRow(\"While Condition : End While\")]\n    [DataRow(\"While A AndAlso (B OrElse Not Condition) : End While\")]\n    [DataRow(\"Do While Condition : Loop\")]\n    [DataRow(\"Do While A AndAlso (B OrElse Not Condition) : Loop\")]\n    [DataRow(\"Do : Loop While Condition\")]\n    [DataRow(\"Do : Loop While Condition\")]\n    [DataRow(\"Do : Loop While A AndAlso (B OrElse Not Condition)\")]\n    [DataRow(\"Do : Loop Until Condition\")]\n    [DataRow(\"Do : Loop Until Condition\")]\n    [DataRow(\"Do : Loop Until A AndAlso (B OrElse Not Condition)\")]\n    [DataRow(\"Dim Condition As Integer : For Condition = 0 To 9 : Next\")]\n    [DataRow(\"Dim Condition As Integer : For Condition = 9 To 0 Step -1 : Next\")]\n    public void IsInLoopCondition_Loops_VB(string code) =>\n        IsInLoopConditionVB(code).Should().BeTrue();\n\n    [TestMethod]\n    public void IsInLoopCondition_If_VB()\n    {\n        const string code = \"\"\"\n            While A\n                Do\n                    If Condition Then   ' This is asserted\n                    End If\n                Loop While B\n            End While\n            \"\"\";\n        IsInLoopConditionVB(code).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void IsInLoopCondition_NestedInLambda()\n    {\n        const string code = \"\"\"\n            System.Action lambda = () =>\n            {\n                while(condition) { }\n            };\n            \"\"\";\n        IsInLoopConditionCS(code).Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void MemberAccessExpression_Null_CS() =>\n        CSharpSyntaxClassifier.Instance.MemberAccessExpression(CS.SyntaxFactory.IdentifierName(\"unexpectedNodeType\")).Should().BeNull();\n\n    [TestMethod]\n    public void MemberAccessExpression_Null_VB() =>\n        VisualBasicSyntaxClassifier.Instance.MemberAccessExpression(VB.SyntaxFactory.IdentifierName(\"unexpectedNodeType\")).Should().BeNull();\n\n    [TestMethod]\n    [DataRow(\"x => condition\")]\n    [DataRow(\"x => a && (b || !condition)\")]\n    [DataRow(\"_ => condition\")]\n    [DataRow(\"(item, index) => condition\")]\n    public void IsInLoopCondition_LambdaInLoop_CS(string lambda) =>\n        IsInLoopConditionCS($$\"\"\"while (Enumerable.Repeat(10, 10).Select({{lambda}}).Any()) { }\"\"\").Should().BeFalse();\n\n    [TestMethod]\n    [DataRow(\"Function(X) Condition\")]\n    [DataRow(\"Function(X) A AndAlso (B OrElse Not Condition)\")]\n    [DataRow(\"Function(Item, Index) Condition\")]\n    [DataRow(\"Function(X) \\n Return Condition \\n End Function\")]\n    public void IsInLoopCondition_LambdaInLoop_VB(string lambda) =>\n        IsInLoopConditionVB($$\"\"\"While Enumerable.Repeat(10, 10).Select({{lambda}}).Any() : End While\"\"\").Should().BeFalse();\n\n    private static bool IsInLoopConditionCS(string code) =>\n        CSharpSyntaxClassifier.Instance.IsInLoopCondition(CreateConditionCS(code));\n\n    private static bool IsInLoopConditionVB(string code) =>\n        VisualBasicSyntaxClassifier.Instance.IsInLoopCondition(CreateConditionVB(code));\n\n    private static SyntaxCS.IdentifierNameSyntax CreateConditionCS(string code)\n    {\n        var tree = TestCompiler.CompileCS($$\"\"\"\n            using System.Linq;\n            public class Sample\n            {\n                public void Method(bool a, bool b, bool condition)\n                {\n                    {{code}}\n                }\n            }\n            \"\"\").Tree;\n        return tree.GetRoot().DescendantNodes().OfType<SyntaxCS.IdentifierNameSyntax>().Single(x => x.NameIs(\"condition\"));\n    }\n\n    private static SyntaxVB.IdentifierNameSyntax CreateConditionVB(string code)\n    {\n        var tree = TestCompiler.CompileVB($$\"\"\"\n            Public Class Sample\n                Private A As Boolean, B As Boolean, Condition As Boolean\n\n                Public Sub Method()\n                    {{code}}\n                End Sub\n            End Class\n            \"\"\").Tree;\n        return tree.GetRoot().DescendantNodes().OfType<SyntaxVB.IdentifierNameSyntax>().Single(x => x.NameIs(\"Condition\"));\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AbstractClassToInterface.Latest.Partial.cs",
    "content": "﻿// <auto-generated />\nnamespace PartialProperties\n{\n    public abstract partial class PartialPropertyAbstractOnly\n    {\n        public abstract string City { get; }\n    }\n\n    public abstract partial class PartialPropertyPartial\n    {\n        public partial string Name { get => \"Kirk\"; }\n    }\n}\n\nnamespace CSharp14\n{\n    public abstract partial class PartialConstructor\n    {\n        public partial PartialConstructor() { }\n    }\n\n    public abstract partial class PartialEventTest\n    {\n        public partial event System.EventHandler<System.EventArgs> PartialEvent { add { } remove { } }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AbstractClassToInterface.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Records\n{\n    public abstract record Empty { }\n\n    public abstract record Animal // Noncompliant {{Convert this 'abstract' record to an interface.}}\n    {\n        public abstract void move();\n        public abstract void feed();\n    }\n\n    public record SomeBaseRecord { }\n\n    public abstract record Animal2 : SomeBaseRecord // Compliant\n    {\n        public abstract void move();\n        public abstract void feed();\n    }\n\n    public abstract record RecordWithProtectedAbstractMethod // Noncompliant\n    {\n        protected abstract void ProtectedMethod();\n    }\n\n    public abstract record Color\n    {\n        private int red = 0;\n        public int getRed() => red;\n    }\n\n    public interface AnimalCompliant\n    {\n        void move();\n        void feed();\n    }\n\n    public class ColorCompliant\n    {\n        private int red = 0;\n\n        private ColorCompliant()\n        { }\n\n        public int getRed() => red;\n    }\n\n    public abstract record LampCompliant\n    {\n\n        private bool switchLamp = false;\n\n        public abstract void glow();\n\n        public void flipSwitch()\n        {\n            switchLamp = !switchLamp;\n            if (switchLamp)\n            {\n                glow();\n            }\n        }\n    }\n\n    public abstract record View // Noncompliant {{Convert this 'abstract' record to an interface.}}\n    //                     ^^^^\n    {\n        public abstract string Content { get; }\n    }\n\n    public abstract record View2() // Compliant, has abstract and non abstract members\n    {\n        public abstract string Content { get; }\n        public abstract string Content1 { get; }\n        public string Content2 { get; }\n    }\n\n    public abstract record Record(string X);\n\n    public abstract record Record2(string X) // Compliant, this record has a propery X which is concrete\n    {\n        public abstract string Content { get; }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/9494\n    public abstract class AbstractClassWithStaticField      // TN for .NET Framework, FN for .NET Core / .NET (where interfaces can have static members)\n    {\n        protected static int _data;\n        public abstract void SomeMethod();\n    }\n}\n\nnamespace FileAccessibility\n{\n    file abstract class Empty\n    {\n    }\n\n    file abstract class OnlyAbstract    // Noncompliant {{Convert this 'abstract' class to an interface.}}\n    //                  ^^^^^^^^^^^^\n    {\n        public abstract void Move();\n    }\n\n    file abstract class Animal2 //Compliant\n    {\n        public abstract void Move();\n        string Foo() => \"FOO\";\n    }\n}\n\nnamespace PartialProperties\n{\n    public abstract partial class PartialPropertyAbstractOnly //Noncompliant {{Convert this 'abstract' class to an interface.}}\n    //                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    {\n        public abstract string Name { get; }\n    }\n\n    public abstract partial class PartialPropertyPartial\n    {\n        public partial string Name { get; }\n    }\n}\n\nnamespace Events\n{\n    public abstract class EventTest\n    {\n        public event System.EventHandler<System.EventArgs> AbstractEvent { add { } remove { } }\n    }\n\n    public abstract class AbstractEventTest\n    {\n        public abstract event System.EventHandler<System.EventArgs> AbstractEvent;\n    }\n}\n\nnamespace CSharp14\n{\n    public abstract partial class PartialConstructor\n    {\n        public partial PartialConstructor();\n    }\n\n    public abstract partial class PartialEventTest\n    {\n        public partial event System.EventHandler<System.EventArgs> PartialEvent;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AbstractClassToInterface.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\npublic abstract partial class PartialMixed\n{\n    public abstract void X();\n}\n\npublic abstract partial class PartialMixed\n{\n    public void Y() { }\n}\n\npublic abstract partial class PartialAbstract // Noncompliant\n{\n    public abstract void X();\n}\n\npublic abstract partial class PartialAbstract // Noncompliant\n{\n    public abstract void Y();\n}\n\npublic abstract class Empty\n{\n}\n\npublic abstract class Animal // Noncompliant {{Convert this 'abstract' class to an interface.}}\n//                    ^^^^^^\n{\n    public abstract void move();\n    public abstract void feed();\n}\n\npublic class SomeBaseClass { }\n\npublic abstract class Animal2 : SomeBaseClass // Compliant\n{\n    public abstract void move();\n    public abstract void feed();\n}\n\npublic abstract class Color\n{\n    private int red = 0;\n    private int green = 0;\n    private int blue = 0;\n\n    public int getRed()\n    {\n        return red;\n    }\n}\n\npublic interface AnimalCompliant\n{\n    void move();\n    void feed();\n}\n\npublic class ColorCompliant\n{\n    private int red = 0;\n    private int green = 0;\n    private int blue = 0;\n\n    private ColorCompliant()\n    {\n    }\n\n    public int getRed()\n    {\n        return red;\n    }\n}\n\npublic abstract class LampCompliant\n{\n    private bool switchLamp = false;\n\n    public abstract void glow();\n\n    public void flipSwitch()\n    {\n        switchLamp = !switchLamp;\n        if (switchLamp)\n        {\n            glow();\n        }\n    }\n}\n\npublic abstract class View // Noncompliant, should be an interface\n{\n    public abstract string Content { get; }\n}\n\npublic abstract class View2 // Compliant, has abstract and non abstract members\n{\n    public abstract string Content { get; }\n    public abstract string Content1 { get; }\n    public string Content2 { get; }\n}\n\npublic abstract class View2Derived : View2 // Compliant, still has abstract parts\n{\n    public string Content3 { get; }\n    public override string Content1 { get { return \"\"; } }\n}\n\npublic abstract class View3Derived : SomeUnknownType // Error [CS0246]\n{\n    public string Content3 { get; }\n    public override int Content1 { get { return 1; } }\n}\n\npublic abstract class WithStaticConstructor         // TN for .NET Framework, FN for .NET Core / .NET (where interfaces can have static constructors)\n{\n    public abstract void ToOverride();\n\n    static WithStaticConstructor()\n    {\n        // Do something here\n    }\n}\n\npublic abstract class WithNonStaticConstructor      // Compliant: the class has a non-static constructor, it cannot be converted to an interface\n{\n    public abstract void ToOverride();\n\n    public WithNonStaticConstructor()\n    {\n        // Do something here\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/9494\npublic abstract class AbstractClassWithField            // Compliant: the class has a field, it cannot be converted to an interface\n{\n    protected int _data;\n    public abstract void SomeMethod();\n}\n\npublic abstract class AbstractProtectedMethod           // Noncompliant\n{\n    protected abstract void SomeMethod();\n}\n\npublic abstract class AbstractProtectedInternalMethod   // Noncompliant\n{\n    protected internal abstract void SomeMethod();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AbstractTypesShouldNotHaveConstructors.Latest.Partial.cs",
    "content": "﻿namespace CSharp14\n{\n    public abstract partial class PartialConstructor\n    {\n        public partial PartialConstructor() { } // Noncompliant\n    }\n\n    public abstract partial class NonPartialConstructor\n    {\n\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AbstractTypesShouldNotHaveConstructors.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace CSharp12\n{\n    abstract class PrimaryConstructor(int i) // Compliant\n    {\n        public int I { get; set; } = i;\n    }\n}\n\nnamespace Records\n{\n    abstract record AbstractRecordOne\n    {\n        public string X { get; }\n\n        public AbstractRecordOne(string x) => (X) = (x); // Noncompliant\n    }\n\n    record RecordOne : AbstractRecordOne\n    {\n        public RecordOne(string x) : base(x) { } // Compliant\n    }\n\n    abstract record AbstractRecordTwo(string Y);\n\n    record RecordTwo(string Z) : AbstractRecordTwo(Z);\n\n    public abstract record Person(string Name, string Surname)\n    {\n        public Person(string name) : this(name, \"\") // Noncompliant\n        {\n        }\n    }\n\n    public struct MyStruct\n    {\n        public MyStruct(string s)\n        {\n        }\n    }\n}\n\nnamespace CSharp14\n{\n    public abstract partial class PartialConstructor\n    {\n        public partial PartialConstructor();\n    }\n\n    public abstract partial class NonPartialConstructor\n    {\n        public NonPartialConstructor() { }  // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AbstractTypesShouldNotHaveConstructors.TopLevelStatements.cs",
    "content": "﻿using System;\n\nConsole.WriteLine(\"Hello World!\");\n\nabstract class Base\n{\n    public Base() { } // Noncompliant {{Change the visibility of this constructor to 'protected'.}}\n\n    private Base(int i) { } // Compliant\n}\n\nabstract record AbstractRecordOne\n{\n    public string X { get; }\n\n    public AbstractRecordOne(string x) => (X) = (x); // Noncompliant\n}\n\nrecord RecordOne : AbstractRecordOne\n{\n    public RecordOne(string x) : base(x) { } // Compliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AbstractTypesShouldNotHaveConstructors.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        abstract class Base\n        {\n            public Base() // Noncompliant {{Change the visibility of this constructor to 'protected'.}}\n//          ^^^^^^\n            {\n                //...\n            }\n\n            private Base(int i) // Compliant\n            {\n\n            }\n\n            protected Base(int i, int j) // Compliant\n            {\n\n            }\n\n            internal Base(int i, int j, int k) // Noncompliant {{Change the visibility of this constructor to 'private protected'.}}\n            {\n\n            }\n\n            internal protected Base(int i, int j, int k, int l) // Noncompliant\n            {\n\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AllBranchesShouldNotHaveSameImplementation.CSharp9.cs",
    "content": "﻿using System;\n\nint b = 0;\n\nif (b == 0)  // Noncompliant {{Remove this conditional structure or edit its code blocks so that they're not all the same.}}\n{\n    DoSomething();\n}\nelse if (b == 1)\n{\n    DoSomething();\n}\nelse\n{\n    DoSomething();\n}\n\nvoid DoSomething()\n{\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AllBranchesShouldNotHaveSameImplementation.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class Program\n    {\n        public void IfElseCases(int b, int c)\n        {\n            if (b == 0)  // Noncompliant {{Remove this conditional structure or edit its code blocks so that they're not all the same.}}\n//          ^^\n            {\n                DoSomething();\n            }\n            else if (b == 1)\n            {\n                DoSomething();\n            }\n            else\n            {\n                DoSomething();\n            }\n\n            if (b == 0) // Noncompliant\n            {\n                if (c == 1) // Noncompliant\n//              ^^\n                {\n                    DoSomething();\n                }\n                else\n                {\n                    DoSomething();\n                }\n            }\n            else\n            {\n                if (c == 1) // Noncompliant\n                {\n                    DoSomething();\n                }\n                else\n                {\n                    DoSomething();\n                }\n            }\n\n            if (b == 0)\n            {\n                DoSomething();\n            }\n            else\n            {\n                DoSomethingElse();\n            }\n\n            if (b == 0) // Compliant - no else clause\n            {\n                DoSomething();\n            }\n            else if (b == 1)\n            {\n                DoSomething();\n            }\n        }\n\n        public void SwitchCases(int i)\n        {\n            switch (i) // Noncompliant {{Remove this conditional structure or edit its code blocks so that they're not all the same.}}\n//          ^^^^^^\n            {\n                case 1:\n                    DoSomething();\n                    break;\n                case 2:\n                    DoSomething();\n                    break;\n                case 3:\n                    DoSomething();\n                    break;\n                default:\n                    DoSomething();\n                    break;\n            }\n\n            switch (i) // Noncompliant\n            {\n                case 1:\n                    {\n                        DoSomething();\n                        break;\n                    }\n                case 2:\n                    {\n                        DoSomething();\n                        break;\n                    }\n                case 3:\n                    {\n                        DoSomething();\n                        break;\n                    }\n                default:\n                    {\n                        DoSomething();\n                        break;\n                    }\n            }\n\n            switch (i)\n            {\n                case 1:\n                    DoSomething();\n                    break;\n                default:\n                    DoSomethingElse();\n                    break;\n            }\n\n            switch (i) // Compliant - no default section\n            {\n                case 1:\n                    DoSomething();\n                    break;\n                case 2:\n                    DoSomething();\n                    break;\n                case 3:\n                    DoSomething();\n                    break;\n            }\n        }\n\n        public void TernaryCases(bool c, int a)\n        {\n            int b = a > 12 ? 4 : 4;  // Noncompliant {{This conditional operation returns the same value whether the condition is \"true\" or \"false\".}}\n//                  ^^^^^^^^\n\n            var x = 1 > 18 ? true : true; // Noncompliant\n            var y = 1 > 18 ? true : false;\n            y = 1 > 18 ? (true) : true; // Noncompliant\n            TernaryCases(1 > 18 ? (true) : true, a); // Noncompliant\n        }\n\n        private void DoSomething()\n        {\n        }\n\n        private void DoSomethingElse()\n        {\n        }\n\n        public int SwitchExpressionNoncompliant(string type) =>\n            type switch // Noncompliant {{Remove this conditional structure or edit its code blocks so that they're not all the same.}}\n//               ^^^^^^\n            {\n                \"a\" => GetNumber(),\n                \"b\" => GetNumber(),\n                _ => GetNumber()\n            };\n\n        public int SwitchExpressionNested(string type)\n        {\n            return type switch\n            {\n                \"a\" => GetNumber(),\n                _ => type switch // Noncompliant\n                {\n                        \"b\" => GetNumber(),\n                        \"c\" => GetNumber(),\n                        _ => GetNumber()\n                    }\n            };\n        }\n\n        public int GetNumber() => 42;\n\n        public int SwitchExpressionCompliant(string type)\n        {\n            var x = type switch // Compliant\n            {\n                \"a\" => 42,\n                \"b\" => type.Length,\n                _ => GetNumber(),\n            };\n            string y = type switch { }; // Compliant\n            var z = type switch { \"a\" => 42 }; // Compliant\n            var withoutDefault = type switch // Compliant, does not have the discard default arm\n            {\n                \"a\" => GetNumber(),\n                \"b\" => GetNumber(),\n                \"c\" => GetNumber(),\n                \"d\" => GetNumber(),\n                \"e\" => GetNumber(),\n            };\n            return x;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AllBranchesShouldNotHaveSameImplementation.vb",
    "content": "﻿Imports System\n\nNamespace Tests.Diagnostics\n    Public Class Program\n        Public Sub IfElseCases(b As Integer, c As Integer)\n            If b = 0 Then 'Noncompliant\n'           ^^\n                DoSomething()\n            ElseIf b = 1 Then\n                DoSomething()\n            Else\n                DoSomething()\n            End If\n\n            If b = 0 Then 'Noncompliant\n                If c = 1 Then 'Noncompliant\n                    DoSomething()\n                Else\n                    DoSomething()\n                End If\n            Else\n                If c = 1 Then 'Noncompliant\n                    DoSomething()\n                Else\n                    DoSomething()\n                End If\n            End If\n\n            If b = 0 Then\n                DoSomething()\n            Else\n                DoSomethingElse()\n            End If\n\n            If b = 0 Then 'Compliant, no else\n                DoSomething()\n            ElseIf b = 1 Then\n                DoSomething()\n            End If\n        End Sub\n\n        Public Sub SwitchCases(i As Integer)\n            Select Case i ' Noncompliant {{Remove this conditional structure or edit its code blocks so that they're not all the same.}}\n'           ^^^^^^\n                Case 1\n                    DoSomething()\n                Case 2\n                    DoSomething()\n                Case 3\n                    DoSomething()\n                Case Else\n                    DoSomething()\n            End Select\n\n            Select Case i ' Noncompliant\n                Case 1\n                    DoSomething()\n                    Exit Select\n                Case 2\n                    DoSomething()\n                    Exit Select\n                Case 3\n                    DoSomething()\n                    Exit Select\n                Case Else\n                    DoSomething()\n                    Exit Select\n            End Select\n\n            Select Case i\n                Case 1\n                    DoSomething()\n                Case Else\n                    DoSomethingElse()\n            End Select\n\n            Select Case i\n                Case 1\n                    DoSomething()\n                Case 2\n                    DoSomething()\n                Case 3\n                    DoSomething()\n            End Select\n        End Sub\n\n        Public Sub TernaryCases(ByVal c As Boolean)\n            Dim a As Integer = 1\n            Dim b As Integer = If(a > 12, 4, 4) 'Noncompliant {{This conditional operation returns the same value whether the condition is \"true\" or \"false\".}}\n'                              ^^\n            Dim x = If(1 > 18, True, True) 'Noncompliant\n            Dim y = If(1 > 18, True, False)\n            y = If(1 > 18, (True), True) 'Noncompliant\n            TernaryCases(If(1 > 18, (True), True)) 'Noncompliant\n        End Sub\n\n        Public Sub SingleLineIfCases(ByVal c As Boolean)\n            Dim x As Integer\n            If c Then x = 4 Else x = 4 'Noncompliant {{Remove this conditional structure or edit its code blocks so that they're not all the same.}}\n'           ^^\n            If c Then x = 0 Else x = 1\n        End Sub\n\n        Private Sub DoSomething()\n        End Sub\n\n        Private Sub DoSomethingElse()\n        End Sub\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AlwaysSetDateTimeKind.cs",
    "content": "﻿using System;\nusing System.Globalization;\nusing MyAlias = System.DateTime;\n\npublic class Program\n{\n    public void Noncompliant()\n    {\n        var dt = new DateTime(); // Noncompliant {{Provide the \"DateTimeKind\" when creating this object.}}\n        //       ^^^^^^^^^^^^^^\n        dt = new DateTime(1623); // Noncompliant\n        dt = new DateTime(1994, 07, 05); // Noncompliant\n        dt = new DateTime(1994, 07, 05, new GregorianCalendar()); // Noncompliant\n        dt = new DateTime(1994, 07, 05, 16, 23, 00); // Noncompliant\n        dt = new DateTime(1994, 07, 05, 16, 23, 00, new GregorianCalendar()); // Noncompliant\n        dt = new DateTime(1994, 07, 05, 16, 23, 00, 42); // Noncompliant\n        dt = new DateTime(1994, 07, 05, 16, 23, 00, 42, new GregorianCalendar()); // Noncompliant\n        dt = new DateTime(1994, 07, 05, 16, 23, 00, 42, new GregorianCalendar()); // Noncompliant\n        dt = new MyAlias(); // FN\n        dt = new System.DateTime(); // Noncompliant\n    }\n\n    public void Compliant()\n    {\n        var dt = new DateTime(1623, DateTimeKind.Unspecified);\n        dt = new DateTime(1994, 07, 05, 16, 23, 00, DateTimeKind.Local);\n        dt = new DateTime(1994, 07, 05, 16, 23, 00, 42, new GregorianCalendar(), DateTimeKind.Unspecified);\n        dt = new DateTime(1994, 07, 05, 16, 23, 00, 42, DateTimeKind.Utc);\n        dt = new DateTime(1994, 07, 05, 16, 23, 00, 42, new GregorianCalendar(), DateTimeKind.Unspecified);\n        dt = new DateTime(1994, 07, 05, 16, 23, 00, 42, DateTimeKind.Unspecified);\n        dt = new System.(1623); // Error [CS1001]\n    }\n}\n\npublic class FakeDateTime\n{\n    private class DateTime\n    {\n\n    }\n\n    private void Compliant()\n    {\n        var dt = new DateTime();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AlwaysSetDateTimeKind.vb",
    "content": "﻿Imports System.Globalization\nImports MyAlias = System.DateTime\n\nPublic Class Program\n\n    Public Sub Noncompliant()\n        Dim dt = New DateTime() ' Noncompliant {{Provide the \"DateTimeKind\" when creating this object.}}\n        '        ^^^^^^^^^^^^^^\n        dt = New Date() ' Noncompliant\n        dt = New dATEtIME() ' Noncompliant\n        dt = New DateTime(1623) ' Noncompliant\n        dt = New DateTime(1994, 7, 5) ' Noncompliant\n        dt = New DateTime(1994, 7, 5, New GregorianCalendar()) ' Noncompliant\n        dt = New DateTime(1994, 7, 5, 16, 23, 0) ' Noncompliant\n        dt = New DateTime(1994, 7, 5, 16, 23, 0, New GregorianCalendar()) ' Noncompliant\n        dt = New DateTime(1994, 7, 5, 16, 23, 0, 42) ' Noncompliant\n        dt = New DateTime(1994, 7, 5, 16, 23, 0, 42, New GregorianCalendar()) ' Noncompliant\n        dt = New DateTime(1994, 7, 5, 16, 23, 0, 42, New GregorianCalendar()) ' Noncompliant\n        dt = New MyAlias() ' FN\n        dt = New System.DateTime() ' Noncompliant\n    End Sub\n\n    Public Sub Compliant()\n        Dim dt = New DateTime(1623, DateTimeKind.Unspecified)\n        dt = New DateTime(1994, 7, 5, 16, 23, 0, DateTimeKind.Local)\n        dt = New DateTime(1994, 7, 5, 16, 23, 0, 42, New GregorianCalendar(), DateTimeKind.Unspecified)\n        dt = New DateTime(1994, 7, 5, 16, 23, 0, 42, DateTimeKind.Utc)\n        dt = New DateTime(1994, 7, 5, 16, 23, 0, 42, New GregorianCalendar(), DateTimeKind.Unspecified)\n        dt = New DateTime(1994, 7, 5, 16, 23, 0, 42, DateTimeKind.Unspecified)\n    End Sub\n\nEnd Class\n\nClass FakeDateTime\n\n    Private Class DateTime\n\n    End Class\n\n    Private Sub Compliant()\n        Dim dt = New DateTime()\n    End Sub\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AnonymousDelegateEventUnsubscribe.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    class AnonymousDelegateEventUnsubscribe\n    {\n        public delegate void ChangedEventHandler(object sender, EventArgs e);\n        public delegate void ChangedEventHandler2(object sender);\n        public event ChangedEventHandler Changed;\n        public event ChangedEventHandler2 Changed2;\n\n        void Test_LambdaDiscard_StaticLambda()\n        {\n            Changed += (_, _) => { };\n            Changed -= (_, _) => { }; //Noncompliant\n            Changed -= (_, _) => Console.WriteLine(); // Noncompliant\n            Changed -= static (_, _) => Console.WriteLine(\"x\"); // Noncompliant\n        }\n\n        void Test_LambdaDiscard_StaticLambda_Compliant()\n        {\n            ChangedEventHandler x = (_, _) => { };\n            Changed += x;\n            Changed -= x;\n\n            ChangedEventHandler2 y = static (sender) => { };\n            Changed2 += y;\n            Changed2 -= y;\n        }\n\n        public void NullConditionalAssignment(WithEvent obj)\n        {\n            obj?.Changed += (_, _) => { };\n            obj?.Changed -= (_, _) => { };                           // Noncompliant\n            obj?.Changed -= (_, _) => Console.WriteLine();           // Noncompliant\n            obj?.Changed -= static (_, _) => Console.WriteLine(\"x\"); // Noncompliant\n        }\n\n        public class WithEvent\n        {\n            public event ChangedEventHandler Changed;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AnonymousDelegateEventUnsubscribe.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    class AnonymousDelegateEventUnsubscribe\n    {\n        public delegate void ChangedEventHandler(object sender, EventArgs e);\n        public delegate void ChangedEventHandler2(object sender);\n        public event ChangedEventHandler Changed;\n        public event ChangedEventHandler2 Changed2;\n\n        void Test()\n        {\n            Changed += (obj, args) => { };\n            Changed -= (obj, args) => { }; //Noncompliant {{Unsubscribe with the same delegate that was used for the subscription.}}\n//                  ^^^^^^^^^^^^^^^^^^^^^\n\n            Changed -= (obj, args) => Console.WriteLine(); // Noncompliant - single statement\n//                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            Changed -= delegate (object sender, EventArgs e) { }; // Noncompliant\n            Changed2 -= delegate { }; // Noncompliant\n\n            ChangedEventHandler x = (obj, args) => { };\n            Changed -= x;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AppSettings/DatabasePasswordsShouldBeSecure/Corrupt/appsettings.json",
    "content": "﻿{\n  \"ConnectionStrings\": {\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AppSettings/DatabasePasswordsShouldBeSecure/UnexpectedContent/ArrayInside/appsettings.json",
    "content": "﻿{\n  \"ConnectionStrings\": [\n    {\"DefaultConnection\": \"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=\"}\n  ]\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AppSettings/DatabasePasswordsShouldBeSecure/UnexpectedContent/ConnectionStringComment/appsettings.json",
    "content": "﻿{\n  ////#if (IndividualLocalAuth)\n  //  \"ConnectionStrings\": {\n  ////#if (UseLocalDB)\n  //    \"DefaultConnection\": \"Server=(localdb)\"\n  ////#else\n  //    \"DefaultConnection\": \"DataSource=app.db;Cache=Shared\"\n  ////#endif\n  //  },\n  ////#endif\n  \"Logging\": {\n    \"LogLevel\": {\n      \"Default\": \"Information\",\n      \"Microsoft\": \"Warning\",\n      \"Microsoft.Hosting.Lifetime\": \"Information\"\n    }\n  },\n  \"AllowedHosts\": \"*\"\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AppSettings/DatabasePasswordsShouldBeSecure/UnexpectedContent/EmptyArray/appsettings.json",
    "content": "﻿[]\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AppSettings/DatabasePasswordsShouldBeSecure/UnexpectedContent/EmptyFile/appsettings.json",
    "content": "﻿"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AppSettings/DatabasePasswordsShouldBeSecure/UnexpectedContent/Null/appsettings.json",
    "content": "﻿{\n  \"ConnectionStrings\": null\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AppSettings/DatabasePasswordsShouldBeSecure/UnexpectedContent/PropertyKinds/appsettings.json",
    "content": "﻿{\n  \"ConnectionStrings\": {\n    \"myDb1\": \"Server=myServer;Database=myDb1;Trusted_Connection=True;\",\n    \"invalid1\": [\n      \"myServer\",\n      \"myDb1\"\n    ],\n    \"invalid2\": {\n      \"Server\": \"myServer\",\n      \"Database\": \"myDb1\"\n    },\n    \"invalid3\": null,\n    \"invalid4\": true\n  }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AppSettings/DatabasePasswordsShouldBeSecure/UnexpectedContent/ValueKind/appsettings.json",
    "content": "﻿{\n  \"ConnectionStrings\": \"Server=myServer;Database=myDb1;Trusted_Connection=True;\"\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AppSettings/DatabasePasswordsShouldBeSecure/UnexpectedContent/WrongStructure/appsettings.json",
    "content": "﻿{\n  \"NotAConnectionString\": {\n    \"DefaultConnection\": \"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=\"\n  }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AppSettings/DatabasePasswordsShouldBeSecure/Values/appsettings.json",
    "content": "﻿{\n  \"ConnectionStrings\": {\n    \"DefaultConnection\": \"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=\", /* Noncompliant */\n                       /* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */\n    \"SomeOtherConnection\": \"PASSWORD=\", /* FN */\n    \"UnsecureConnection\": \"Password=\", /* Noncompliant */\n    \"AnotherConnection\": \"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=FooBar\",\n    \"SecuredConnection\": \"Server=myServerAddress;Database=myDataBase;Integrated Security=True\"\n  }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AppSettings/DoNotHardcodeCredentials/Corrupt/AppSettings.json",
    "content": "﻿{\n  \"ConnectionStrings\": {\n    \"name\": \"Server=localhost; Database=Test; User=SA; Password=Secret123\",\n\n    <<< Corrupted, we don't raise here"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AppSettings/DoNotHardcodeCredentials/UnexpectedContent/AppSettings.json",
    "content": "﻿[\n  \"S101\",\n  \"S107\"\n]"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AppSettings/DoNotHardcodeCredentials/Valid/AppSettings.Custom.json",
    "content": "{\n  \"ConnectionStrings\": {\n    \"name\": \"Server=localhost; Database=Test; User=SA; Password=Secret123\" /* Noncompliant {{\"password\" detected here, make sure this is not a hard-coded credential.}} */\n  }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AppSettings/DoNotHardcodeCredentials/Valid/AppSettings.Development.json",
    "content": "{\n  \"ConnectionStrings\": {\n    \"name\": \"Server=localhost; Database=Test; User=SA; Password=Secret123\" /* Compliant, we don't raise in this file */\n  }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AppSettings/DoNotHardcodeCredentials/Valid/AppSettings.Production.json",
    "content": "{\n  \"ConnectionStrings\": {\n    \"name\": \"Server=localhost; Database=Test; User=SA; Password=Secret123\" /* Noncompliant {{\"password\" detected here, make sure this is not a hard-coded credential.}} */\n  }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AppSettings/DoNotHardcodeCredentials/Valid/AppSettings.json",
    "content": "{\n  \"ConnectionStrings\": {\n    \"fine\": \"\",\n    \"name\": \"Server=localhost; Database=Test; User=SA; Password=Secret123\", /* Noncompliant {{\"password\" detected here, make sure this is not a hard-coded credential.}} */\n    /*       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  */\n    /* Noncompliant@+2 */\n    \"multiline\":\n      \"Server=localhost; Database=Test; User=SA; Password=Secret123\",\n    \"empty\": \"Server=localhost; Database=Test; User=SA; Password=\", /* Compliant, should not raise on empty passwords */\n    \"nopwd\": \"Server=localhost; Database=Test; Integrated Security=True\" /* Compliant */\n  },\n  \"AppSettings\": {\n    \"connection\": \"Server=localhost; Database=Test; User=SA; Password=Secret123\", /* Noncompliant */\n    \"SomeUrl\": \"scheme://user:azerty123@domain.com\" /* Noncompliant {{Review this hard-coded URI, which may contain a credential.}}\" */\n  },\n  \"CustomSection\": {\n    \"CustomSubSection\": {\n      \"Connection\": \"Server=localhost; Database=Test; User=SA; Password=Secret123\" /* Noncompliant */\n    }\n  },\n  \"ValueArray\": [\n    \"InArray\",\n    \"Server=localhost; Database=Test; User=SA; Password=Secret123\", /* Noncompliant */\n    \"Good\",\n    \"Password=42\" /* Noncompliant */\n  ],\n  \"ObjectArray\": [\n    {\n      \"Nested\": \"Server=localhost; Database=Test; User=SA; Password=Secret123\", /* Noncompliant */\n      \"Simple\": \"Password=42\", /* Noncompliant */\n      \"Password\": \"42\", /* Noncompliant */\n      \"Compliant\": \"42\"\n    }\n  ],\n  \"Simple\": \"Password=42\", /* Noncompliant */\n  \"Password\": \"42\", /* Noncompliant */\n  \"password\": \"42\", /* Noncompliant */\n  \"Compliant\": \"42\",\n  \"Empty\": {\n    \"Password\": \"\" /* Compliant, this rule doesn't look for empty passwords */\n  },\n  \"NotSupported\": [\n    {\n      \"Password\": [ \"Not supported with nested arrays\" ]\n    },\n    {\n      \"Password\": { \"Key\": \"Not supported with nested object\" }\n    },\n    {\n      \"Password\": true\n    }\n  ],\n  \"NumberFields\": {\n    \"Field1\": 42,\n    \"Field2\": -42,\n    \"Int32Overflow\": 2147483648,\n    \"Int32Underflow\": -2147483649,\n    \"IntUnderFlow\": -2147483649,\n    \"LongOverflow\": 9223372036854775808,\n    \"LongUnderFlow\": -9223372036854775809,\n    \"Password\": 2147483648 /* FN */\n  }\n}\n/*\nCommented is not supported\n<add connectionString=\"Server=localhost; Database=Test; User=SA; Password=Secret123\"/>\n*/\n\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AppSettings/DoNotHardcodeCredentials/Valid/OtherFile.json",
    "content": "{\n  \"ConnectionStrings\": {\n    \"name\": \"Server=localhost; Database=Test; User=SA; Password=Secret123\" /* We don't inspect this file */\n  }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AppSettings/DoNotHardcodeSecrets/Corrupt/AppSettings.json",
    "content": "﻿{\n  \"ConnectionStrings\": {\n    \"name\": \"Server=localhost; Database=Test; User=SA; Credential=1IfHMPanImzX8ZxC-Ud6+YhXiLwlXq$f_-3v~.=\",\n\n    <<< Corrupted, we don't raise here"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AppSettings/DoNotHardcodeSecrets/UnexpectedContent/AppSettings.json",
    "content": "﻿[\n  \"S101\",\n  \"S107\"\n]"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AppSettings/DoNotHardcodeSecrets/Valid/AppSettings.Custom.json",
    "content": "{\n  \"ConnectionStrings\": {\n    \"name\": \"Server=localhost; Database=Test; User=SA; Credential=1IfHMPanImzX8ZxC-Ud6+YhXiLwlXq$f_-3v~.=\" /* Noncompliant {{\"Credential\" detected here, make sure this is not a hard-coded secret.}} */\n  }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AppSettings/DoNotHardcodeSecrets/Valid/AppSettings.Development.json",
    "content": "{\n  \"ConnectionStrings\": {\n    \"name\": \"Server=localhost; Database=Test; User=SA; Credential=1IfHMPanImzX8ZxC-Ud6+YhXiLwlXq$f_-3v~.=\" /* Compliant, we don't raise in this file */\n  }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AppSettings/DoNotHardcodeSecrets/Valid/AppSettings.Production.json",
    "content": "{\n  \"ConnectionStrings\": {\n    \"name\": \"Server=localhost; Database=Test; User=SA; Credential=1IfHMPanImzX8ZxC-Ud6+YhXiLwlXq$f_-3v~.=\" /* Noncompliant {{\"Credential\" detected here, make sure this is not a hard-coded secret.}} */\n  }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AppSettings/DoNotHardcodeSecrets/Valid/AppSettings.json",
    "content": "{\n  \"ConnectionStrings\": {\n    \"fine\": \"\",\n    \"name\": \"Server=localhost; Database=Test; User=SA; Credential=1IfHMPanImzX8ZxC-Ud6+YhXiLwlXq$f_-3v~.=\", /* Noncompliant {{\"Credential\" detected here, make sure this is not a hard-coded secret.}} */\n    /*       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  */\n    /* Noncompliant@+2 */\n    \"multiline\":\n      \"Server=localhost; Database=Test; User=SA; Credential=1IfHMPanImzX8ZxC-Ud6+YhXiLwlXq$f_-3v~.=\",\n    \"empty\": \"Server=localhost; Database=Test; User=SA; Password=\", /* Compliant, should not raise on empty passwords */\n    \"nopwd\": \"Server=localhost; Database=Test; Integrated Security=True\" /* Compliant */\n  },\n  \"AppSettings\": {\n    \"connection\": \"Server=localhost; Database=Test; User=SA; Credential=1IfHMPanImzX8ZxC-Ud6+YhXiLwlXq$f_-3v~.=\" /* Noncompliant */\n  },\n  \"CustomSection\": {\n    \"CustomSubSection\": {\n      \"Connection\": \"Server=localhost; Database=Test; User=SA; Credential=1IfHMPanImzX8ZxC-Ud6+YhXiLwlXq$f_-3v~.=\" /* Noncompliant */\n    }\n  },\n  \"ValueArray\": [\n    \"InArray\",\n    \"Server=localhost; Database=Test; User=SA; Credential=1IfHMPanImzX8ZxC-Ud6+YhXiLwlXq$f_-3v~.=\", /* Noncompliant */\n    \"Good\",\n    \"Auth=rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\" /* Noncompliant */\n  ],\n  \"ObjectArray\": [\n    {\n      \"Nested\": \"Server=localhost; Database=Test; User=SA; Credential=1IfHMPanImzX8ZxC-Ud6+YhXiLwlXq$f_-3v~.=\", /* Noncompliant */\n      \"Simple\": \"Credential=1IfHMPanImzX8ZxC-Ud6+YhXiLwlXq$f_-3v~.=\", /* Noncompliant */\n      \"Credential\": \"1IfHMPanImzX8ZxC-Ud6+YhXiLwlXq$f_-3v~.=\", /* Noncompliant */\n      \"Compliant\": \"1IfHMPanImzX8ZxC-Ud6+YhXiLwlXq$f_-3v~.=\"\n    }\n  ],\n  \"Simple\": \"Credential=1IfHMPanImzX8ZxC-Ud6+YhXiLwlXq$f_-3v~.=\", /* Noncompliant */\n  \"Credential\": \"1IfHMPanImzX8ZxC-Ud6+YhXiLwlXq$f_-3v~.=\", /* Noncompliant */\n  \"credential\": \"1IfHMPanImzX8ZxC-Ud6+YhXiLwlXq$f_-3v~.=\", /* Noncompliant */\n  \"Compliant\": \"1IfHMPanImzX8ZxC-Ud6+YhXiLwlXq$f_-3v~.=\",\n  \"Empty\": {\n    \"Token\": \"\" /* Compliant, this rule doesn't look for empty Tokens */\n  },\n  \"NotSupported\": [\n    {\n      \"Token\": [ \"1IfHMPanImzX8ZxC-Ud6+YhXiLwlXq$f_-3v~.=\" ] /*Not supported with nested arrays*/\n    },\n    {\n      \"Token\": { \"Key\": \"1IfHMPanImzX8ZxC-Ud6+YhXiLwlXq$f_-3v~.=\" } /*Not supported with nested object*/\n    },\n    {\n      \"Password\": true\n    }\n  ],\n  \"NumberFields\": {\n    \"Field1\": 42,\n    \"Field2\": -42,\n    \"Int32Overflow\": 2147483648,\n    \"Int32Underflow\": -2147483649,\n    \"IntUnderFlow\": -2147483649,\n    \"LongOverflow\": 9223372036854775808,\n    \"LongUnderFlow\": -9223372036854775809,\n    \"credential\": 2147483648\n  }\n}\n/*\nCommented is not supported\n<add connectionString=\"Server=localhost; Database=Test; User=SA; Credential=1IfHMPanImzX8ZxC-Ud6+YhXiLwlXq$f_-3v~.=\"/>\n*/\n\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AppSettings/DoNotHardcodeSecrets/Valid/OtherFile.json",
    "content": "{\n  \"ConnectionStrings\": {\n    \"name\": \"Server=localhost; Database=Test; User=SA; Credential=1IfHMPanImzX8ZxC-Ud6+YhXiLwlXq$f_-3v~.=\" /* We don't inspect this file */\n  }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ArgumentSpecifiedForCallerInfoParameter.Latest.cs",
    "content": "﻿using System.Runtime.CompilerServices;\nusing System.Diagnostics;\n\nnamespace Tests.Diagnostics\n{\n    public class ArgumentSpecifiedForCallerInfoParameter\n    {\n        public void TraceMessage(bool condition, [CallerArgumentExpression(\"condition\")] string expression = null)\n        {\n        }\n\n        void MyMethod()\n        {\n            TraceMessage(true, \"condition\");        // Noncompliant\n            TraceMessage(true);                     // Compliant\n            TraceMessage(true, expression: \"aaaa\"); // Noncompliant\n        }\n    }\n\n    public interface ISomeInterface\n    {\n        static abstract bool StaticVirtualMembersInInterfaces(bool flag, [CallerFilePath] string filePath = null);\n    }\n\n    public class SomeTestClass : ISomeInterface\n    {\n        public static bool StaticVirtualMembersInInterfaces(bool flag, [CallerFilePath] string filePath = null) => true;\n    }\n\n    public class SomeTestClass2 : ISomeInterface\n    {\n        public static bool StaticVirtualMembersInInterfaces(bool flag, [CallerFilePath] string filePath = null) => false;\n    }\n\n    public class SomeOtherClass\n    {\n        void MyMethod<T>(T someTestClass) where T : ISomeInterface\n        {\n            T.StaticVirtualMembersInInterfaces(true, \"C:\");                     // Noncompliant\n            T.StaticVirtualMembersInInterfaces(false, filePath: \"Something\");   // Noncompliant\n            T.StaticVirtualMembersInInterfaces(true);                           // Compliant\n        }\n    }\n\n    // https://sonarsource.atlassian.net/browse/NET-1295\n    public class Repro_NET1252\n    {\n        void MyMethod()\n        {\n            Debug.Assert(true, \"message\");  // Compliant, Debug.Assert is excluded\n        }\n    }\n\n    public static class Extensions\n    {\n        extension(ArgumentSpecifiedForCallerInfoParameter obj)\n        {\n            void CallingFromExtension()\n            {\n                obj.TraceMessage(true, \"condition\");        // Noncompliant\n                obj.TraceMessage(true);                     // Compliant\n                obj.TraceMessage(true, expression: \"aaaa\"); // Noncompliant\n            }\n        }\n\n        extension (ExtensionHasCallerInfo obj)\n        {\n            public bool ArgumentSpecifiedInExtension(bool flag, [CallerFilePath] string filePath = null) => true;\n        }\n    }\n\n    public class ExtensionHasCallerInfo\n    {\n        void Test()\n        {\n            var instance = new ExtensionHasCallerInfo();\n            instance.ArgumentSpecifiedInExtension(true, \"C:\");                      // Noncompliant\n            instance.ArgumentSpecifiedInExtension(false, filePath: \"Something\");    // Noncompliant\n            instance.ArgumentSpecifiedInExtension(true);                            // Compliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ArgumentSpecifiedForCallerInfoParameter.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Runtime.CompilerServices;\n\nnamespace Tests.Diagnostics\n{\n    class ArgumentSpecifiedForCallerInfoParameter\n    {\n        void TraceMessage(string message,\n            [CallerMemberName] string memberName = \"\",\n            [CallerFilePath] string filePath = \"\",\n            [CallerLineNumber] int lineNumber = 0)\n        {\n            /* ... */\n        }\n\n        void MyMethod()\n        {\n            TraceMessage(\"my message\", \"MyMethod\");       // Compliant \"memberName\" can be specified by the caller (e.g. raising OnPropertyChanged for another property in WPF)\n            TraceMessage(\"my message\");                   // Compliant\n            TraceMessage(\"my message\", filePath: \"aaaa\"); // Noncompliant\n            //                         ^^^^^^^^^^^^^^^^\n            TraceMessage(\"my message\", lineNumber: 42);   // Noncompliant\n            TraceMessage(\"my message\",\n                filePath: \"aaaa\",                         // Noncompliant\n                lineNumber: 42);                          // Noncompliant\n        }\n\n        void PassThrough(string message,\n            [CallerMemberName] string memberName = \"\",\n            [CallerFilePath] string filePath = \"\",\n            [CallerLineNumber] int lineNumber = 0)\n        {\n            TraceMessage(message, memberName, filePath, lineNumber); // Compliant\n            TraceMessage(message, filePath: memberName);             // Noncompliant parameters are switched\n            TraceMessage(message, memberName: filePath);             // Compliant \"memberName\" can be specified\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ArrayCovariance.CSharp9.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    abstract class Fruit { }\n    class Apple : Fruit { }\n    class Orange : Fruit { }\n\n    class Program\n    {\n        static void TargetTypedConditional(bool isTrue, Apple[] apples, Fruit[] givenFruits)\n        {\n            Fruit[] fruits1 = isTrue\n                ? new Apple[1] // Noncompliant {{Refactor the code to not rely on potentially unsafe array conversions.}}\n//                ^^^^^^^^^^^^\n                : new Orange[1]; // Noncompliant {{Refactor the code to not rely on potentially unsafe array conversions.}}\n//                ^^^^^^^^^^^^^\n\n            Fruit[] fruits2 = apples ?? givenFruits; // Noncompliant\n//                            ^^^^^^\n\n            Fruit[] fruits3 = givenFruits ?? apples; // Noncompliant\n//                                           ^^^^^^\n\n            AddToBasket(apples ?? givenFruits); // Noncompliant\n//                      ^^^^^^\n\n            AddToBasket(isTrue ? new Apple[1] : new Orange[1]); // Noncompliant\n                                                                // Noncompliant@-1\n\n            fruits1 = isTrue ? new Apple[1] : new Orange[1]; // Noncompliant\n                                                             // Noncompliant@-1\n            fruits1 = apples ?? givenFruits; // Noncompliant\n\n            fruits1 = (Fruit[])(isTrue ? new Apple[1] : new Orange[1]); // Noncompliant\n                                                                        // Noncompliant@-1\n            fruits1 = (Fruit[])(apples ?? givenFruits); // Noncompliant\n        }\n\n        static void AddToBasket(Fruit[] fruits)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ArrayCovariance.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    abstract class Fruit { }\n    class Apple : Fruit { }\n    class Orange : Fruit { }\n\n    class Program\n    {\n        // Error@+1 [CS0029]\n        public static object[] os = new int[0]; // Noncompliant {{Refactor the code to not rely on potentially unsafe array conversions.}}\n//                                  ^^^^^^^^^^\n        public static object[] os2 = new object[0];\n\n        static void Main(string[] args)\n        {\n            Fruit[] fruits = new Apple[1]; // Noncompliant - array covariance is used\n//                           ^^^^^^^^^^^^\n            fruits = new Apple[1]; // Noncompliant\n            FillWithOranges(fruits);\n            var fruits2 = new Apple[1];\n            FillWithOranges(fruits2); // Noncompliant\n            var fruits3 = (Fruit[])new Apple[1]; // Noncompliant\n        }\n\n        static void FillWithOranges(Fruit[] fruits)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ArrayCreationLongSyntax.Fixed.vb",
    "content": "﻿Module Module1\n\n    Sub Main()\n        Dim foo = {\"a\", \"b\", \"c\"} ' Fixed\n        foo = New String() {} ' Compliant\n        Dim foo2 = {}\n        foo2 = {\"a\", \"b\", \"c\"}\n        Dim foo3 = New A() {New B()} ' Compliant\n        foo3 = {New B(), New A()} ' Fixed\n\n        Dim myObjects As Object() = New Object(3) {} ' Compliant\n\n        Dim guidStrings As String\n        For Each guidString As String In guidStrings.Split({\";\"c}) ' Fixed\n        Next\n\n        myObjects = {} ' Fixed\n        myObjects = New UnknownType() {1, 2, 3}     ' Error [BC30002]: Type 'UnknownType' is not defined\n    End Sub\n\nEnd Module\n\nClass A\n\nEnd Class\n\nClass B\n    Inherits A\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ArrayCreationLongSyntax.vb",
    "content": "﻿Module Module1\n\n    Sub Main()\n        Dim foo = New String() {\"a\", \"b\", \"c\"} ' Noncompliant {{Use an array literal here instead.}}\n        '         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        foo = New String() {} ' Compliant\n        Dim foo2 = {}\n        foo2 = {\"a\", \"b\", \"c\"}\n        Dim foo3 = New A() {New B()} ' Compliant\n        foo3 = New A() {New B(), New A()} ' Noncompliant\n\n        Dim myObjects As Object() = New Object(3) {} ' Compliant\n\n        Dim guidStrings As String\n        For Each guidString As String In guidStrings.Split(New Char() {\";\"c}) ' Noncompliant\n        Next\n\n        myObjects = New Object() {} ' Noncompliant\n        myObjects = New UnknownType() {1, 2, 3}     ' Error [BC30002]: Type 'UnknownType' is not defined\n    End Sub\n\nEnd Module\n\nClass A\n\nEnd Class\n\nClass B\n    Inherits A\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ArrayDesignatorOnVariable.Fixed.vb",
    "content": "﻿Module Module1\n    Sub Main()\n        Dim foo As String() ' Fixed\n        Dim foo3(5) As String() ' Fixed\n        Dim numbers1(4) As Integer\n        Dim numbers2 = New Integer() {1, 2, 4, 8}\n        ReDim Preserve numbers1(15)\n        Dim matrix(5, 5) As Double\n        Dim matrix2 As Double(,) ' Fixed\n        Dim matrix3 As Double(,)\n        ' Fixed\n        Dim matrix4()(),\n            aaa As Double\n        Dim matrix5 As Double()()\n        Dim sales As Double()() = New Double(11)() {}\n    End Sub\nEnd Module\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ArrayDesignatorOnVariable.vb",
    "content": "﻿Module Module1\n    Sub Main()\n        Dim foo() As String ' Noncompliant {{Move the array designator from the variable to the type.}}\n'           ^^^^^\n        Dim foo3(5)() As String ' Noncompliant\n        Dim numbers1(4) As Integer\n        Dim numbers2 = New Integer() {1, 2, 4, 8}\n        ReDim Preserve numbers1(15)\n        Dim matrix(5, 5) As Double\n        Dim matrix2(,) As Double ' Noncompliant\n        Dim matrix3 As Double(,)\n        ' Noncompliant@+1\n        Dim matrix4()(),\n            aaa As Double\n        Dim matrix5 As Double()()\n        Dim sales As Double()() = New Double(11)() {}\n    End Sub\nEnd Module\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ArrayInitializationMultipleStatements.vb",
    "content": "﻿Module Module1\n    Sub Main()\n        Const i As Integer = 0\n        Dim f2(i) As String ' Noncompliant {{Refactor this code to use the '... = {}' syntax.}}\n'       ^^^^^^^^^^^^^^^^^^^\n        f2(0) = \"foo\"\n        Dim f As String\n        Dim foo(1) As String      ' Noncompliant\n        foo(0) = \"foo\"\n        foo(1) = \"bar\"\n        foo = {\"foo\", \"bar\"}  ' Compliant\n\n        Dim foo2 As String(), foo4 As String() = {},\n            foo3(1) As String   'compliant, not a single VarDeclarator in the declaration\n        foo3(0) = \"foo\"\n        foo2(0) = \"foo\"\n        foo2(1) = \"bar\"\n\n        Dim f3(3) As String\n        f3(0) = \"foo\"\n        f3(2) = \"foo\"\n\n        Dim f4(1) As String ' Noncompliant\n        f4(-1) = \"foo\"\n        f4(0) = \"foo\"\n        f4(1) = \"foo\"\n    End Sub\nEnd Module\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ArrayPassedAsParams.Latest.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Runtime.CompilerServices;\n\nconst int a = 1;\nint[] array = [2, 3];\n\nvar class1 = new MyClass(1, [1, 2, 3]);             // Noncompliant\n_ = new MyClass(1, []);                             // Noncompliant\n\n// repro for https://github.com/SonarSource/sonar-dotnet/issues/8510\n_ = new MyClass(1, [a, .. array]);                  // Compliant\n\n_ = new MyClass2([1], [1, 2, 3]);                   // Noncompliant\n_ = new MyClass2([1, 2, 3], 1);\n\n_ = new MyClass3([1, 2, 3], [4, 5, 6]);             // Compliant: jagged array\n\n_ = new MyClass4(class1, new(1, [1, .. array]));    // Compliant\n_ = new MyClass4([class1, new(1, [1, .. array])]);  // Noncompliant, outer collection raises, despite the nested spread operator\n//               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nMyClass5 s = new(1, new int[] { 2, 3 }); // Noncompliant\n//                  ^^^^^^^^^^^^^^^^^^\nMyClass5 s1 = new(1, 2, 3); // Compliant\n\nA(new int[] { 1, 2 });  // Noncompliant\nA([1]);                 // Noncompliant\nA(1, 2);                // Compliant\nA(2);                   // Compliant\nB(new int[] { 1, 2 });  // Noncompliant\nB([1]);                 // Noncompliant\nB(1, 2);                // Compliant\nB(2);                   // Compliant\nC(new int[] { 1, 2 });  // Noncompliant\nC([1]);                 // Noncompliant\nC(1, 2);                // Compliant\nC(2);                   // Compliant\nD(new int[] { 1, 2 });  // Noncompliant\nD([1]);                 // Noncompliant\nD(1, 2);                // Compliant\nD(2);                   // Compliant\nI(MyImmutableArray.Create<int>(new int[] { 1, 2 }));  // Compliant\nI(MyImmutableArray.Create<int>([1, 2]));              // Compliant\nI([1, 2]);              // Noncompliant\nI(2);                   // Compliant\n\nstatic bool A(params int[] array) => true;\nstatic bool B(params Span<int> span) => true;\nstatic bool C(params ReadOnlySpan<int> span) => true;\nstatic bool D(params IEnumerable<int> enumerable) => true;\nstatic bool E(params IReadOnlyCollection<int> readonlyCollection) => true;\nstatic bool F(params IReadOnlyList<int> readonlyList) => true;\nstatic bool G(params ICollection<int> collection) => true;\nstatic bool H(params IList<int> list) => true;\nstatic bool I(params MyImmutableArray<int> collectionBuilder) => true;\n\nclass MyClass(int a, params int[] args);\nclass MyClass2(int[] a, params int[] args);\nclass MyClass3(params int[][] args);\nclass MyClass4(params MyClass[] args);\nclass MyClass5\n{\n    public MyClass5(int a, params int[] args) { }\n}\n\nstatic class MyImmutableArray\n{\n    public static MyImmutableArray<T> Create<T>(ReadOnlySpan<T> items) => [];\n}\n\n[CollectionBuilder(typeof(MyImmutableArray), \"Create\")]\npublic struct MyImmutableArray<T> : IEnumerable<T>\n{\n    IEnumerator<T> IEnumerable<T>.GetEnumerator() => default!;\n    IEnumerator IEnumerable.GetEnumerator() => default!;\n}\n\n// Reproducer for https://github.com/SonarSource/sonar-dotnet/issues/6977\npublic class Repro6977_CollectionExpression\n{\n    class ParamsAttribute : Attribute\n    {\n        public ParamsAttribute(params string[] values) { }\n        public ParamsAttribute(int a, string b, params string[] values) { }\n    }\n\n    internal enum Foo\n    {\n        [Params([\"1\", \"2\" ])] // Noncompliant\n        Red,\n\n        [Params(\"1\", \"2\")]\n        Yellow\n    }\n}\n\npublic class ImplicitSpanConversion\n{\n    public static void Test(string[] myArray)\n    {\n        DoSomething(new string[] { \"s1\", \"s2\" });   // Noncompliant {{Remove this array creation and simply pass the elements.}}\n        //          ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        DoSomething(new string[] { \"s1\" });         // Noncompliant\n        DoSomething(new[] { \"s1\" });                // Noncompliant\n        DoSomething(new string[] { });              // Noncompliant\n        DoSomething(\"s1\");                          // Compliant\n        DoSomething(\"s1\", \"s2\");                    // Compliant\n        DoSomething(myArray);                       // Compliant\n        DoSomething(new string[12]);                // Compliant\n        DoSomething([\"1\", \"2\", \"3\"]);               // Noncompliant\n        DoSomething([\"1\", \"2\", \"3\"].ToArray());     // Compliant\n                                                    // Error@-1 [CS9176] There is no target type for the collection expression.\n    }\n\n    public static void DoSomething(params Span<string> arr) { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ArrayPassedAsParams.cs",
    "content": "﻿using System;\nusing System.Globalization;\n\npublic class Program\n{\n    public void Base(string[] myArray)\n    {\n        Method(new string[] { \"s1\", \"s2\" }); // Noncompliant {{Remove this array creation and simply pass the elements.}}\n//             ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        Method(new string[] { \"s1\" }); // Noncompliant\n        Method(new[] { \"s1\" }); // Noncompliant\n        Method(new string[] { }); // Noncompliant\n        Method(\"s1\");           // Compliant\n        Method(\"s1\", \"s2\");     // Compliant\n        Method(myArray);        // Compliant\n        Method(new string[12]); // Compliant\n\n        Method2(1, new string[] { \"s1\", \"s2\" }); // Noncompliant {{Remove this array creation and simply pass the elements.}}\n//                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        Method2(1, new string[] { \"s1\" }); // Noncompliant\n        Method2(1, \"s1\");           // Compliant\n        Method2(1, \"s1\", \"s2\");     // Compliant\n        Method2(1, myArray);        // Compliant\n        Method2(1, new string[12]); // Compliant\n\n        Method3(new string[] { \"s1\", \"s2\" }); // Compliant\n        Method3(new string[] { \"s1\", \"s2\" }, \"s1\"); // Compliant\n        Method3(new string[] { \"s1\", \"s2\" }, new string[12]); // Compliant\n        Method3(new string[] { \"s1\", \"s2\" }, new string[] { \"s1\", \"s2\" }); // Noncompliant\n//                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        Method3(null, null);        // Compliant\n        Method4(new[] { \"s1\" });   // Compliant\n        Method4(new[] { \"s1\", \"s2\" }); // Compliant\n\n        Method3(args: new string[] { \"s1\", \"s2\" }, a: new string[12]); // Compliant (if you specifically require the arguments to be passed in this order there is no way of making this compliant, thus we shouldn't raise)\n        Method3(args: new string[12], a: new string[] { \"s1\", \"s2\" }); // Compliant\n\n        var s = new MyClass(1, new int[] { 2, 3 }); // Noncompliant\n//                             ^^^^^^^^^^^^^^^^^^\n        var s1 = new MyClass(1, 2, 3); // Compliant\n        s1 = new MyClass(args: new int[] { 2, 3 }, a: 1); // Compliant (if you specifically require the arguments to be passed in this order there is no way of making this compliant, thus we shouldn't raise)\n        var s2 = new MyOtherClass(args: new int[12], a: new int[] { 2, 3 }); // Compliant\n\n        var s3 = new IndexerClass();\n        var indexer1 = s3[new int[] { 1, 2 }]; // FN\n        var indexer2 = s3?[new int[] { 1, 2 }]; // FN\n        var indexer3 = s3[1, 2]; // Compliant\n    }\n\n    public void Method(params string[] args) { }\n\n    public void Method2(int a, params string[] args) { }\n\n    public void Method3(string[] a, params string[] args) { }\n\n    public void Method4(object[] a, params object[] args) { }\n\n    public void Method5(params string[] a, params string[] args) { } // Error [CS0231]\n}\n\npublic class MyClass\n{\n    public MyClass(int a, params int[] args) { }\n}\n\npublic class MyOtherClass\n{\n    public MyOtherClass(int[] a, params int[] args) { }\n}\n\npublic class IndexerClass\n{\n    public int this[params int[] i] => 1;\n}\n\npublic class Repro6894\n{\n    //Reproducer for https://github.com/SonarSource/sonar-dotnet/issues/6894\n\n    public void Method(params object[] args) { }\n    public void MethodMixed(int i, params object[] args) { }\n    public void MethodArray(params Array[] args) { }\n    public void MethodJaggedArray(params int[][] args) { }\n    public void MethodImplicitArray(params string[] args) { }\n\n    public void CallMethod(dynamic d)\n    {\n        Method(new String[] { \"1\", \"2\" });                                      // Noncompliant, elements in args: [\"1\", \"2\"]\n                                                                                // The argument given for a parameter array can be a single expression that is implicitly convertible (§10.2) to the parameter array type.\n                                                                                // In this case, the parameter array acts precisely like a value parameter.\n                                                                                // see: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/classes#14625-parameter-arrays\n        Method(new object[] { new int[] { 1, 2 } });                            // FN, elements in args: [System.Int32[]]\n        Method(new int[] { 1, 2, 3, });                                         // Compliant, Elements in args: [System.Int32[]]\n        Method(new String[] { \"1\", \"2\" }, new String[] { \"1\", \"2\" });           // Compliant, elements in args: [System.String[], System.String[]]\n        Method(new String[] { \"1\", \"2\" }, new int[] { 1, 2 });                    // Compliant, elements in args: [System.String[], System.Int32[]]\n        MethodMixed(1, new String[] { \"1\", \"2\" });                              // Noncompliant\n        MethodArray(new String[] { \"1\", \"2\" }, new String[] { \"1\", \"2\" });      // Compliant, elements in args: [System.String[], System.String[]]\n        MethodArray(new int[] { 1, 2 }, new int[] { 1, 2 });                    // Compliant, elements in args: [System.Int32[], System.Int32[]]\n        MethodJaggedArray(new int[] { 1, 2 });                                  // Compliant: jagged array [System.Object[]]\n        Method(d);                                                              // Compliant\n        Method(\"Hello\", 2);                                                     // Compliant\n        string.Format(CultureInfo.InvariantCulture, \"{0}.{1}\", new object[] { \"\", new object() });\n        MethodImplicitArray(new[] { \"Hello\", \"Hi\" });                           // Noncompliant , Implicit array creation\n        Method(new[] { 1, 2, 3, });                                             // Compliant, Elements in args: [System.Int32[]]\n        Method(new[,] { { 1, 2 } });                                            // Compliant, Elements in args: [System.Int32[,]]\n        Method(new object[] { null });                                          // Compliant\n        Method(new object[,] { { null } });                                     // Compliant\n        Method(new[,] { { new object() } });                                    // Compliant\n        Method(new object[][] { new[] { new object() } });                      // Compliant\n    }\n}\n\n// Reproducer for https://github.com/SonarSource/sonar-dotnet/issues/6893\npublic class Repro6893\n{\n    public void Method(int a, params object[] argumentArray) { }\n\n    public void CallMethod()\n    {\n        Method(a: 1, argumentArray: new int[] { 1, 2 }); // Compliant\n    }\n}\n\n// Reproducer for https://github.com/SonarSource/sonar-dotnet/issues/6977\npublic class Repro6977\n{\n    class ParamsAttribute : Attribute\n    {\n        public ParamsAttribute(params string[] values) { }\n        public ParamsAttribute(int a, string b, params string[] values) { }\n        public ParamsAttribute() { }\n        public string Name { get; set; }\n        public object Other { get; set; }\n    }\n\n    internal enum Foo\n    {\n        [Params(new[] { \"1\", \"2\" })] // Noncompliant\n        Red,\n\n        [Params(\"1\", \"2\")]\n        Yellow,\n\n        [Params(a: 1, b: \"hello\", values : new[] { \"1\", \"2\" })] // Noncompliant\n        Blue,\n\n        [Params(a: 1, values: new[] { \"1\", \"2\" }, b: \"hello\")]  // FN\n        Green,\n\n        [Params]\n        Violet,\n\n        [Params(Name = \"hello\", Other = new[] { \"1\", \"2\" })] // Compliant, this is setting Properties\n        Indigo,\n\n        [Params(a: 1, b: \"hello\", values: new[] { \"1\", \"2\" }, Name = \"hello\")] // Compliant. Before C# 7.2 the 'correct' version does not compile \n        Orange,\n\n        [Params(1,\"hello\", new[] { \"1\", \"2\" }, Name = \"hello\")] // Compliant FN \n        Grun,\n\n        [Params(1, \"hello\", \"1\", \"2\", Name = \"hello\")] // Compliant \n        OtherGrun\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ArrayPassedAsParams.vb",
    "content": "﻿\nPublic Class Program\n    Public Sub Base(ByVal myArray As String())\n        Method(New String() {\"s1\", \"s2\"}) ' Noncompliant {{Remove this array creation and simply pass the elements.}}\n        '      ^^^^^^^^^^^^^^^^^^^^^^^^^\n        Method(New String() {\"s1\"}) ' Noncompliant\n        Method(\"s1\")               ' Compliant\n        Method(\"s1\", \"s2\")         ' Compliant\n        Method(myArray)            ' Compliant\n        Method(New String(11) {})  ' Compliant\n\n        Method2(1, New String() {\"s1\", \"s2\"}) ' Noncompliant {{Remove this array creation and simply pass the elements.}}\n        '          ^^^^^^^^^^^^^^^^^^^^^^^^^\n        Method2(1, New String() {\"s1\"}) ' Noncompliant\n        Method2(1, \"s1\")                ' Compliant\n        Method2(1, \"s1\", \"s2\")          ' Compliant\n        Method2(1, myArray)             ' Compliant\n        Method2(1, New String(11) {})   ' Compliant\n\n        Method3(New String() {\"s1\", \"s2\"}, \"s1\") ' Compliant\n        Method3(New String() {\"s1\", \"s2\"}, New String(11) {}) ' Compliant\n        Method3(New String() {\"s1\", \"s2\"}, New String() {\"s1\", \"s2\"}) ' Noncompliant\n        '                                  ^^^^^^^^^^^^^^^^^^^^^^^^^\n        Method3(Nothing, Nothing) ' Compliant\n\n        Method3(args:=New String() {\"s1\", \"s2\"}, a:=New String(11) {}) ' Error [BC30587] Named argument cannot match a ParamArray parameter\n        Method3(args:=New String(11) {}, a:=New String() {\"s1\", \"s2\"}) ' Error [BC30587] Named argument cannot match a ParamArray parameter\n\n        Dim s = New [MyClass](1, New Integer() {2, 3}) ' Noncompliant\n        '                        ^^^^^^^^^^^^^^^^^^^^\n        Dim s1 = New [MyClass](1, 2, 3) ' Compliant\n        s1 = New [MyClass](args:=New Integer() {2, 3}, a:=1) ' Error [BC30587] Named argument cannot match a ParamArray parameter\n        Dim s2 = New MyOtherClass(args:=New Integer(11) {}, a:=New Integer() {2, 3}) ' Error [BC30587] Named argument cannot match a ParamArray parameter\n\n        Dim s3 = Prop(New String() {\"s1\", \"s2\"}) ' FN\n        Dim s4 = Prop(\"s1\", \"s2\") ' Compliant\n    End Sub\n\n    Public Sub Method(ParamArray args As String())\n    End Sub\n\n    Public Sub Method2(ByVal a As Integer, ParamArray args As String())\n    End Sub\n\n    Public Sub Method3(ByVal a As String(), ParamArray args As String())\n    End Sub\n\n    Public Sub Method4(ParamArray a As String(), ParamArray args As String()) 'Error [BC30192]\n    End Sub\n\n    Public ReadOnly Property Prop(ParamArray param() As String) As Integer\n        Get\n        End Get\n    End Property\n\nEnd Class\n\nPublic Class [MyClass]\n    Public Sub New(ByVal a As Integer, ParamArray args As Integer())\n    End Sub\nEnd Class\n\nPublic Class MyOtherClass\n    Public Sub New(ByVal a As Integer(), ParamArray args As Integer())\n    End Sub\nEnd Class\n\nPublic Class Repro6894\n    'Reproducer for https://github.com/SonarSource/sonar-dotnet/issues/6894\n\n    Public Sub Method(ParamArray args As Object())\n    End Sub\n\n    Public Sub MethodArray(ParamArray args As Array())\n    End Sub\n\n    Public Sub MethodJaggedArray(ParamArray args As Integer()())\n    End Sub\n\n    Public Sub CallMethod()\n        Method(New String() {\"1\", \"2\"})                                 ' Noncompliant, elements in args: [\"1\", \"2\"]\n                                                                        ' The argument given for a parameter array can be a single expression that is implicitly convertible (§10.2) to the parameter array type.\n                                                                        ' In this case, the parameter array acts precisely like a value parameter.\n                                                                        ' see: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/classes#14625-parameter-arrays\n        Method({\"1\", \"2\"})                                              ' FN\n        Method(New Object() {New Integer() {1, 2}})                     ' FN, elements in args: [System.Int32[]]\n        Method(New Integer() {1, 2, 3})                                 ' Compliant, Elements in args: [System.Int32[]]\n        Method(New String() {\"1\", \"2\"}, New String() {\"1\", \"2\"})        ' Compliant, elements in args: [System.String[], System.String[]]\n        Method(New String() {\"1\", \"2\"}, New Integer() {1, 2})           ' Compliant, elements in args: [System.String[], System.Int32[]]\n        MethodArray(New String() {\"1\", \"2\"}, New String() {\"1\", \"2\"})   ' Compliant, elements in args: [System.String[], System.String[]]\n        MethodArray(New Integer() {1, 2}, New Integer() {1, 2})         ' Compliant, elements in args: [System.Int32[], System.Int32[]]\n        MethodArray({1, 2}, {1, 2})                                     ' Compliant, elements in args: [System.Int32[], System.Int32[]]\n\n        MethodJaggedArray(New Integer() {1, 2})                         ' Compliant: jagged array [System.Object[]]\n    End Sub\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AspNet/AnnotateApiActionsWithHttpVerb.cs",
    "content": "﻿using Microsoft.AspNetCore.Http;\nusing Microsoft.AspNetCore.Mvc;\nusing Microsoft.AspNetCore.Mvc.Routing;\nusing System;\nusing System.Collections.Generic;\n\nnamespace Baseline\n{\n    [ApiController]\n    public class NoncompliantController : ControllerBase\n    {\n        [Route(\"foo\")]\n        public string FooGet() => \"Hi\";                // Noncompliant {{REST API controller actions should be annotated with the appropriate HTTP verb attribute.}}\n        //            ^^^^^^\n\n        public int FooPost([FromBody] string id) =>    // Noncompliant\n            StatusCodes.Status200OK;\n    }\n\n    [ApiController]\n    public class CompliantController : ControllerBase\n    {\n        [HttpGet(\"foo\")]\n        public string Get() => \"Hi\";\n\n        [HttpPut(\"foo\")]\n        public int Put([FromBody] string id) =>\n            StatusCodes.Status200OK;\n\n        [HttpPost(\"foo\")]\n        public int Post([FromBody] string id) =>\n            StatusCodes.Status200OK;\n\n        [HttpDelete(\"foo\")]\n        public int Delete([FromBody] string id) =>\n            StatusCodes.Status200OK;\n\n        [HttpPatch(\"foo\")]\n        public int Patch([FromBody] string id) =>\n            StatusCodes.Status200OK;\n\n        [HttpHead(\"foo\")]\n        public int Head([FromBody] string id) =>\n            StatusCodes.Status200OK;\n\n        [Route(\"foo\")]\n        [HttpOptions]\n        public int Options([FromBody] string id) =>\n            StatusCodes.Status200OK;\n\n        [AcceptVerbs(\"GET\", \"POST\")]\n        [Route(\"test\")]\n        public int AcceptVerbs([FromBody] string id) =>\n            StatusCodes.Status200OK;\n\n        [Route(\"Error\")]\n        [ApiExplorerSettings(IgnoreApi = true)]\n        public int IgnoresApi([FromBody] string id) =>\n            StatusCodes.Status200OK;\n    }\n}\n\nnamespace CustomHttpMethods\n{\n    [ApiController]\n    public class CompliantController : ControllerBase\n    {\n        [Route(\"foo\")]\n        [MyHttpGet]\n        public int MyGet(string id) =>\n            StatusCodes.Status200OK;\n\n        [Route(\"foo\")]\n        [MyHttpMethod]\n        public int MyMethod() =>\n            StatusCodes.Status200OK;\n    }\n\n    public class MyHttpGetAttribute : HttpGetAttribute { }\n\n    public class MyHttpMethodAttribute : HttpMethodAttribute\n    {\n        public MyHttpMethodAttribute() : base(null) { }\n    }\n}\n\nnamespace ApiExplorer\n{\n    [ApiController]\n    [ApiExplorerSettings(IgnoreApi = true)]\n    public class ExcludedFromOpenApiController : ControllerBase\n    {\n        [Route(\"foo\")]\n        public string FooGet() => \"Hi\";\n\n        public int FooPost([FromBody] string id) =>\n            StatusCodes.Status200OK;\n    }\n\n    [ApiController]\n    [ApiExplorerSettings(IgnoreApi = false)]\n    public class MarkedWithApiExplorerButIgnoreApiSpecifiedAsFalse : ControllerBase\n    {\n        [Route(\"foo\")]\n        public string FooGet() => \"hi\";    // Noncompliant\n    }\n\n    [ApiController]\n    [ApiExplorerSettings]\n    public class MarkedWithApiExplorerButIgnoreApiUnspecified : ControllerBase\n    {\n        [Route(\"foo\")]\n        public string FooGet() => \"hi\";    // Noncompliant\n    }\n\n    [ApiController]\n    [ApiExplorerSettings(GroupName = \"group\")]\n    public class MarkedWithApiExplorerButIgnoreApiUnspecified2 : ControllerBase\n    {\n        [Route(\"foo\")]\n        public string FooGet() => \"hi\";    // Noncompliant\n    }\n\n    namespace CustomApiExplorer\n    {\n        class MyApiExplorerSettingsAttribute : ApiExplorerSettingsAttribute { }\n\n        [ApiController]\n        [MyApiExplorerSettings(IgnoreApi = true)]\n        public class MarkedWithMyApiExplorer : ControllerBase\n        {\n            [Route(\"foo\")]\n            public string FooGet() => \"hi\";\n        }\n\n        [ApiController]\n        [MyApiExplorerSettings(IgnoreApi = false)]\n        public class MarkedWithMyApiExplorerButIgnoreApiSpecifiedAsFalse : ControllerBase\n        {\n            [Route(\"foo\")]\n            public string FooGet() => \"hi\"; // Noncompliant\n        }\n\n        [ApiController]\n        [MyApiExplorerSettings()]\n        public class MarkedWithMyApiExplorerButIgnoreApiUnspecified : ControllerBase\n        {\n            [Route(\"foo\")]\n            public string FooGet() => \"hi\"; // Noncompliant\n        }\n    }\n}\n\nnamespace Visibility\n{\n    [ApiController]\n    internal class NotPublicClass : ControllerBase\n    {\n        [Route(\"foo\")]\n        public string FooGet() => \"Hi\";\n    }\n\n    [ApiController]\n    public class NotPublicMethod : ControllerBase\n    {\n        [Route(\"foo\")]\n        protected string FooGet() => \"Hi\";\n    }\n}\n\nnamespace ControllerAnnotations\n{\n    [ApiController]\n    [Controller]\n    public class AnnotatedAsController\n    {\n        [Route(\"foo\")]\n        public string FooGet() => \"hi\";    // Noncompliant\n    }\n\n    [NonController]\n    [ApiController]\n    public class NotAController : ControllerBase\n    {\n        [Route(\"foo\")]\n        public string FooGet() => \"Hi\";\n    }\n\n    [ApiController]\n    [Controller]\n    [NonController]\n    public class AnnotatedAsControllerAndNonController\n    {\n        [Route(\"foo\")]\n        public string FooGet() => \"hi\";\n    }\n\n    public class NotApiController : ControllerBase\n    {\n        [Route(\"foo\")]\n        public string FooGet() => \"hi\";\n    }\n\n    [Controller]\n    public class NotApiController2\n    {\n        [Route(\"foo\")]\n        public string FooGet() => \"hi\";\n    }\n\n    [MyApiController]\n    public class AnnotatedWithCustomApiController : ControllerBase\n    {\n        [Route(\"foo\")]\n        public string FooGet() => \"hi\";   // Noncompliant\n    }\n\n    class MyApiControllerAttribute : ApiControllerAttribute { }\n}\n\nnamespace Inheritance\n{\n    [ApiController]\n    public class NotDerivingController\n    {\n        [Route(\"foo\")]\n        public string FooGet() => \"hi\";\n    }\n\n    [ApiController]\n    public class DerivingController : Controller\n    {\n        [Route(\"foo\")]\n        public string Foo() => \"hi\"; // Noncompliant\n\n        public string Get() => \"hi\"; // Noncompliant\n    }\n\n    [ApiController]\n    public class DerivingMyController : MyController\n    {\n        [Route(\"foo\")]\n        public string Foo() => \"hi\"; // Noncompliant\n\n        public string Get() => \"hi\"; // Noncompliant\n    }\n\n    public class MyController : Controller { }\n\n    [ApiController]\n    public abstract class BaseController : ControllerBase\n    {\n        [Route(\"foo\")]\n        public virtual string BaseHasNoMethod() => \"hi\"; // Noncompliant\n\n        [HttpGet(\"foo\")]\n        public virtual string BaseHasMethod() => \"hi\";\n\n        [AcceptVerbs(\"GET\")]\n        public virtual string BaseHasAcceptVerbs() => \"hi\";\n\n        [ApiExplorerSettings()]\n        public virtual string BaseHasApiExplorerSettingsWithoutIgnoring() => \"hi\"; // Noncompliant\n\n        [ApiExplorerSettings(IgnoreApi = true)]\n        public virtual string BaseHasApiExplorerSettingsIgnoring() => \"hi\";\n\n        public abstract string BaseAbstractMethod();\n    }\n\n    public class ImplementationNoBehaviorChangeController : BaseController\n    {\n        public override string BaseHasNoMethod() => \"hi\"; // Noncompliant\n\n        public override string BaseHasMethod() => \"hi\";\n\n        public override string BaseHasAcceptVerbs() => \"hi\";\n\n        public override string BaseHasApiExplorerSettingsWithoutIgnoring() => \"hi\"; // Noncompliant\n\n        public override string BaseHasApiExplorerSettingsIgnoring() => \"hi\";\n\n        public override string BaseAbstractMethod() => \"hi\"; // Noncompliant\n    }\n\n    public class ImplementationBehaviorChangedController : BaseController\n    {\n        [HttpGet]\n        public override string BaseHasNoMethod() => \"hi\";\n\n        public override string BaseHasAcceptVerbs() => \"hi\";\n\n        [ApiExplorerSettings(IgnoreApi = true)]\n        public override string BaseHasApiExplorerSettingsWithoutIgnoring() => \"hi\";\n\n        [ApiExplorerSettings(IgnoreApi = false)]\n        public override string BaseHasApiExplorerSettingsIgnoring() => \"hi\"; // Noncompliant\n\n        [HttpGet]\n        public override string BaseAbstractMethod() => \"hi\";\n    }\n}\n\nnamespace CustomHttpAttribute\n{\n    // https://sonarsource.atlassian.net/browse/NET-3606\n    [ApiController]\n    public class CompliantController : ControllerBase\n    {\n        [HttpRouteGet(\"foo\")]\n        public int MyGet(string id) =>         // Noncompliant FP: the attribute implements IActionHttpMethodProvider\n            StatusCodes.Status200OK;\n    }\n\n    public class HttpRouteGetAttribute : Attribute, IActionHttpMethodProvider\n    {\n        public HttpRouteGetAttribute(string template) => Template = template;\n\n        public IEnumerable<string> HttpMethods => new List<string> { \"GET\" };\n        public string Template { get; }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AspNet/ApiControllersShouldNotDeriveDirectlyFromController.cs",
    "content": "﻿using Microsoft.AspNetCore.Mvc;\nusing Microsoft.AspNetCore.Mvc.Filters;\nusing System;\n\nclass ChildAttribute : ApiControllerAttribute { }\nclass GrandChildAttribute : ChildAttribute { }\n\npublic class ParentController : Controller { }\npublic class ParentControllerBase : ControllerBase { }\n\npublic class ChildController : ParentController { }\npublic class ChildControllerBase : ParentControllerBase { }\n\nnamespace SimpleCases\n{\n    [ApiController]\n    public class Baseline : Controller { }  // Noncompliant {{Inherit from ControllerBase instead of Controller.}}\n    //                      ^^^^^^^^^^\n\n    [ApiController]\n    public class ControllerWithInterface : Controller, ITestInterface { } // Noncompliant\n    //                                     ^^^^^^^^^^\n\n    [ApiController]\n    public class ChildOfBase : ControllerBase { }       // Compliant\n\n    public class WithoutAttribute : Controller { }      // Compliant\n\n    public class PocoController { }                     // Compliant\n\n    [ApiController]\n    public class PocoWithApiAttribute { }               // Compliant\n\n    [Controller]\n    public class PocoWithControllerAttribute { }        // Compliant\n\n    [ApiController]\n    [Controller]\n    public class PocoWithBothAttributes { }             // Compliant, this is a very rare case, found <10 hits for [Controller] on SG\n\n    [ApiController]\n    [NonController]\n    public class NotAController : Controller { }        // Compliant, [NonController] is excluded\n\n    [ApiController]\n    internal class Internal : Controller { }            // Compliant, only raises at public methods\n\n    public interface ITestInterface { }\n}\n\nnamespace SpecialAttributeUsages\n{\n    [type: ApiController]\n    public class WithType : Controller { }          // Noncompliant\n    //                      ^^^^^^^^^^\n    [ApiControllerAttribute]\n    public class WithSuffix : Controller { }        // Noncompliant\n    //                        ^^^^^^^^^^\n    [ApiController()]\n    public class WithParentheses : Controller { }   // Noncompliant\n    //                             ^^^^^^^^^^\n    [type: ApiControllerAttribute()]\n    public class Everything : Controller { }        // Noncompliant\n    //                        ^^^^^^^^^^\n}\n\nnamespace Inheritance\n{\n    [ApiController]\n    public class Child : ParentController { }            // Compliant, we only check direct inheritance from \"Controller\"\n\n    [ApiController]\n    public class GrandChild : ChildController { }        // Compliant\n\n    [ApiController]\n    public class NoInheritance { }                       // Compliant\n}\n\nnamespace CustomAttribute\n{\n    [ChildAttribute]\n    public class UsesChildAttribute : Controller { }                 // Noncompliant\n    //                                ^^^^^^^^^^\n\n    [GrandChildAttribute]\n    public class UsesGrandChildAttribute : Controller { }            // Noncompliant\n    //                                     ^^^^^^^^^^\n\n    [ChildAttribute]\n    public class UsesChildAttributeBase : ControllerBase { }         // Compliant\n\n    [GrandChildAttribute]\n    public class UsesGrandChildAttributeBase : ControllerBase { }    // Compliant\n}\n\nnamespace Partial\n{\n    [ApiController]\n    public partial class Partial { }\n    public partial class Partial : Controller { }                  // Noncompliant\n    //                             ^^^^^^^^^^\n\n    [ApiController]\n    public partial class PartialBase { }\n    public partial class PartialBase : ControllerBase { }          // Compliant\n\n    [ApiController]\n    public partial class PartialDoubleInheritance : Controller { } // Noncompliant\n    //                                              ^^^^^^^^^^\n\n    public partial class PartialDoubleInheritance : Controller { } // Noncompliant\n    //                                              ^^^^^^^^^^\n\n}\n\nnamespace Nested\n{\n    public class Outer\n    {\n        [ApiController]\n        public class Inner : Controller { }   // Compliant, is in nested class - not accessible from the user.\n    }\n}\n\nnamespace MemberUsages\n{\n    [ApiController]\n    public class OverrideViewInvocation : Controller    // Compliant\n    {\n        public object Foo() => this.View();             // overrides and uses View\n        public override ViewResult View() => null;\n    }\n\n    [ApiController]\n    public class FakeViewInvocation : Controller        // FN, it's not an actual view\n    {\n        public object Foo() => this.View();             // hides View, does not override it\n        public ViewResult View() => null;\n    }\n\n    [ApiController]\n    public class BaseViewInvocation : Controller        // Compliant\n    {\n        public object Foo() => base.View();             // uses Controller.View\n        public ViewResult View() => null;\n    }\n\n    [ApiController]\n    public partial class Partial { }\n    public partial class Partial : Controller { }       // Compliant\n    public partial class Partial\n    {\n        public object Foo() => View();\n    }\n\n    [ApiController]\n    public class MemberReference : Controller               // Compliant\n    {\n        public Func<ViewResult> NotCalled() => this.View;   // nothing is invoked, but the dependency is used.\n    }\n\n    [ApiController]\n    public class NameOf : Controller          // Compliant\n    {\n        public object Foo() => nameof(View); // same as above\n    }\n\n    [ApiController]\n    public class PassByName : Controller                // Compliant\n    {\n        public void Foo() => ExpectsAction(View);\n        public void ExpectsAction(Func<ViewResult> func)\n        {\n            // here func could be invoked or not.\n        }\n    }\n\n    [ApiController]\n    public class PassByLambda : Controller              // Compliant\n    {\n        public void Foo() => ExpectsAction(() => View());\n        public void ExpectsAction(Func<ViewResult> func)\n        {\n            // here func could be invoked or not.\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AspNet/ApiControllersShouldNotDeriveDirectlyFromControllerCodeFix.Fixed.cs",
    "content": "﻿using Microsoft.AspNetCore.Mvc;\nusing Microsoft.AspNetCore.Mvc.Filters;\nusing System;\n\nnamespace CodeFixCases\n{\n    [ApiController]\n    public class Baseline : ControllerBase { }\n\n\n    [ApiController]\n    public class SimpleController : ControllerBase { } // Fixed\n\n    [ApiController]\n    public class CodeFixRespectsCommentsController : ControllerBase /* I'm a small comment and I wish to be respected */ { } // Fixed\n\n    [ApiController]\n    public class CodeFixRespectsCommentsAlsoHasInterfaceController : ControllerBase /* Ditto */, ITestInterface { } // Fixed\n\n    [ApiController]\n    public class ControllerWithInterface : ControllerBase, ITestInterface { } // Fixed\n\n    public interface ITestInterface { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AspNet/ApiControllersShouldNotDeriveDirectlyFromControllerCodeFix.cs",
    "content": "﻿using Microsoft.AspNetCore.Mvc;\nusing Microsoft.AspNetCore.Mvc.Filters;\nusing System;\n\nnamespace CodeFixCases\n{\n    [ApiController]\n    public class Baseline : ControllerBase { }\n\n\n    [ApiController]\n    public class SimpleController : Controller { } // Noncompliant\n\n    [ApiController]\n    public class CodeFixRespectsCommentsController : Controller /* I'm a small comment and I wish to be respected */ { } // Noncompliant\n\n    [ApiController]\n    public class CodeFixRespectsCommentsAlsoHasInterfaceController : Controller /* Ditto */, ITestInterface { } // Noncompliant\n\n    [ApiController]\n    public class ControllerWithInterface : Controller, ITestInterface { } // Noncompliant\n\n    public interface ITestInterface { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AspNet/AvoidUnderPosting.AutogeneratedModel.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\n// Repro https://github.com/SonarSource/sonar-dotnet/issues/9260\n// Also related to https://github.com/SonarSource/sonar-dotnet/issues/8876\npublic partial class AutogeneratedModel\n{\n    public int Property  // Noncompliant, FP - we should not raise in autogenerated classes.\n    {\n        get;\n        set;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AspNet/AvoidUnderPosting.Latest.Partial.cs",
    "content": "﻿using System.Text.Json.Serialization;\n\nnamespace CSharp13\n{\n    public partial class PartialPropertyClass\n    {\n        public partial int PartialProperty  // Noncompliant\n        {\n            get;\n            set;\n        }\n\n        public partial int HasAttributePartialProperty // Compliant\n        {\n            get;\n            set;\n        }\n\n        [JsonRequired]\n        public partial int HasAttributePartialPropertyOther // Compliant\n        {\n            get;\n            set;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AspNet/AvoidUnderPosting.Latest.cs",
    "content": "﻿using Microsoft.AspNetCore.Mvc;\nusing System;\nusing System.ComponentModel.DataAnnotations;\nusing System.Text.Json.Serialization;\n\nnamespace CSharp12\n{\n    public class ModelWithPrimaryConstructor(int vp, int rvp, int nvp)\n    {\n        public int ValueProperty { get; set; } = vp;                        // Compliant: no parameterless constructor, type cannot be used for Model Binding\n    }\n\n    public class ModelWithPrimaryAndParameterlessConstructor(int vp, int rvp, int nvp)\n    {\n        public ModelWithPrimaryAndParameterlessConstructor() : this(0, 0, 0) { }\n        public int ValueProperty { get; set; } = vp;                        // Compliant - the property has default value\n    }\n\n    public class DerivedFromController : Controller\n    {\n        [HttpPost] public IActionResult Create(ModelWithPrimaryConstructor model) => View(model);\n        [HttpDelete] public IActionResult Remove(ModelWithPrimaryAndParameterlessConstructor model) => View(model);\n    }\n}\n\nnamespace Repro9275\n{\n    // Repro https://github.com/SonarSource/sonar-dotnet/issues/9275\n    public class Model\n    {\n        public int ValueProperty { get; set; }              // Noncompliant\n\n        [Custom]\n        public int ValuePropertyAnnotatedWithCustomAttribute { get; set; } // Noncompliant\n\n        [JsonRequired]                                      // Compliant - the property is annotated with JsonRequiredAttribute\n        public int AnotherValueProperty { get; set; }\n\n        public required int RequiredProperty { get; set; }  // Compliant - because the property has the required modifier\n    }\n\n    public class DerivedFromController : Controller\n    {\n        [HttpPost] public IActionResult Create(Model model) => View(model);\n    }\n\n    public class CustomAttribute : Attribute { }\n}\n\nnamespace CSharp9\n{\n    // https://learn.microsoft.com/en-us/aspnet/core/mvc/models/model-binding#constructor-binding-and-record-types\n    public record RecordModel(\n        int ValueProperty,                                                         // Noncompliant\n        [property: JsonRequired] int RequiredValueProperty,                        // Without the property prefix the attribute would have been applied to the constructor parameter instead\n        [Range(0, 2)] int RequiredValuePropertyWithoutPropertyPrefix,              // Noncompliant, FP the attribute is applied on the parameter and still works for the property see: https://github.com/SonarSource/sonar-dotnet/issues/9363\n        int? NullableValueProperty,\n        int PropertyWithDefaultValue = 42);\n\n    public class ModelUsedInController\n    {\n        public int PropertyWithInit { get; init; }                                  // Noncompliant\n    }\n\n    public class DerivedFromController : Controller\n    {\n        [HttpGet] public IActionResult Read(RecordModel model) => View(model);\n        [HttpPost] public IActionResult Create(ModelUsedInController model) => View(model);\n    }\n}\n\nnamespace CSharp8\n{\n    namespace NullableReferences\n    {\n        public class ModelUsedInController\n        {\n            #nullable enable\n            public string NonNullableReferenceProperty { get; set; }  // Compliant - the JSON serializer will throw an exception if the value is missing from the request\n            public object AnotherNonNullableReferenceProperty { get; set; }\n            [Required] public string RequiredNonNullableReferenceProperty { get; set; }\n            public string? NullableReferenceProperty { get; set; }\n            public int ValueProperty { get; set; }                // Noncompliant\n            public int? NullableValueProperty { get; set; }\n            #nullable disable\n            public string ReferenceProperty { get; set; }\n            public object AnotherReferenceProperty { get; set; }\n            public int? AnotherNullableValueProperty { get; set; }\n        }\n\n        public class DerivedFromController : Controller\n        {\n            [HttpPost]\n            public IActionResult Create(ModelUsedInController model)\n            {\n                return View(model);\n            }\n        }\n    }\n\n    namespace CustomGenerics\n    {\n        public class GenericType<TNoContstraint, TClass, TStruct, TNotNull>\n            where TClass : class\n            where TStruct : struct\n            where TNotNull : notnull\n        {\n            public TNoContstraint NoConstraintProperty { get; set; }\n            public TClass ClassProperty { get; set; }\n            public TStruct StructProperty { get; set; }                             // Noncompliant\n            [JsonRequired] public TStruct RequiredStructProperty { get; set; }\n            public TStruct? NullableStructProperty { get; set; }\n            public TNotNull NotNullProperty { get; set; }                           // Noncompliant\n        }\n\n        public class ControllerClass : Controller\n        {\n            [HttpPost] public IActionResult Create(GenericType<object, string, int, DateTime> model) => View(model);\n        }\n    }\n}\n\nnamespace CSharp13\n{\n    public partial class PartialPropertyClass\n    {\n        private int _testProperty { get; set; }\n        public int TestProperty //Noncompliant\n        {\n            get { return _testProperty; }\n            set { _testProperty = value; }\n        }\n\n        private int _partialProperty;\n        public partial int PartialProperty // Compliant - raises on the definition\n        {\n            get => _partialProperty;\n            set { _partialProperty = value; }\n        }\n\n        [JsonRequired]\n        public partial int HasAttributePartialProperty // Compliant\n        {\n            get => _partialProperty;\n            set { }\n        }\n        public partial int HasAttributePartialPropertyOther // Compliant\n        {\n            get => _partialProperty;\n            set { }\n        }\n    }\n\n    public class DerivedFromController : Controller\n    {\n        [HttpPost]\n        public IActionResult Create(PartialPropertyClass model)\n        {\n            return View(model);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AspNet/AvoidUnderPosting.cs",
    "content": "﻿using Microsoft.AspNetCore.Mvc;\nusing Microsoft.AspNetCore.Mvc.ModelBinding;\nusing Microsoft.AspNetCore.Mvc.ModelBinding.Validation;\nusing Newtonsoft.Json;\nusing System.Text.Json.Serialization;\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel.DataAnnotations;\nusing System.ComponentModel.Design;\n\nnamespace Basics\n{\n    public class ClassNotUsedInRequests\n    {\n        int ValueProperty { get; set; }                                             // Compliant\n    }\n\n    public class ModelUsedInController\n    {\n        public int ValueProperty { get; set; }                                      // Noncompliant {{Value type property used as input in a controller action should be nullable, required or annotated with the JsonRequiredAttribute to avoid under-posting.}}\n//                 ^^^^^^^^^^^^^\n        public int? NullableValueProperty { get; set; }\n        [Required] public int RequiredValueProperty { get; set; }                   // Noncompliant, RequiredAttribute has no effect on value types\n        [Range(0, 10)] public int ValuePropertyWithRangeValidation { get; set; }    // Compliant\n        [Required] public int? RequiredNullableValueProperty { get; set; }\n        [JsonProperty(Required = Required.Always)] public int JsonRequiredValuePropertyAlways { get; set; }              // Compliant\n        [JsonProperty(Required = Required.AllowNull)] public int JsonRequiredValuePropertyAllowNull { get; set; }        // Compliant\n        [JsonProperty(Required = Required.DisallowNull)] public int JsonRequiredValuePropertyDisallowNull { get; set; }  // Noncompliant\n        [JsonProperty] public int JsonRequiredValuePropertyDefault { get; set; }                                         // Noncompliant\n        [Newtonsoft.Json.JsonIgnore] public int JsonIgnoredProperty { get; set; }                                        // Compliant\n        [Newtonsoft.Json.JsonRequired] public int JsonRequiredNewtonsoftValueProperty { get; set; }                      // Compliant\n        [System.Text.Json.Serialization.JsonRequired] public int JsonRequiredValueProperty { get; set; }                 // Compliant\n        [System.Text.Json.Serialization.JsonIgnore] public int JsonIgnoreValueProperty { get; set; }                     // Compliant\n        [JsonProperty(Required = Required.AllowNull)] [FromQuery] public int PropertyWithMultipleAttributesCompliant { get; set; }   // Compliant\n        [Required] [FromQuery] public int PropertyWithMultipleAttributesNonCompliant { get; set; }   // Noncompliant\n        public int PropertyWithPrivateSetter { get; private set; }\n        protected int ProtectedProperty { get; set; }\n        internal int InternalProperty { get; set; }\n        protected internal int ProtectedInternalProperty { get; set; }\n        private int PrivateProperty { get; set; }\n        public int PropertyWithDefaultValue { get; set; } = 42;\n        public int ReadOnlyProperty => 42;\n        public int field = 42;\n\n        public (int, int) ImplicitTuple { get; set; }                               // Compliant - tuple types are not supported in model binding\n        public Tuple<int, int> TupleProperty { get; set; }\n        public ValueTuple<int, int> ValueTupleProperty { get; set; }\n\n        public string ReferenceProperty { get; set; }\n        public dynamic DynamicProprty { get; set; }\n    }\n\n    public class NoDefaultConstructor\n    {\n        public int ValueProperty { get; set; }                                      // Compliant - non-record types cannot be used in model binding without having a default constructor\n\n        public NoDefaultConstructor(int arg)\n        {\n        }\n    }\n\n    public class ExplicitDefaultConstructor\n    {\n        public int ValueProperty { get; set; }                                      // Noncompliant\n\n        public ExplicitDefaultConstructor()\n        {\n        }\n\n        public ExplicitDefaultConstructor(int arg)\n        {\n        }\n    }\n\n    public class DerivedFromController : Controller\n    {\n        [HttpPost] public IActionResult Create(ModelUsedInController model) => View(model);\n        [HttpPut] public IActionResult Update(NoDefaultConstructor model) => View(model);\n        [HttpDelete] public IActionResult Remove(ExplicitDefaultConstructor model) => View(model);\n        private void NotActionMethod(ClassNotUsedInRequests arg) { }\n    }\n}\n\nnamespace HttpVerbs\n{\n    public class SingleModel { public int Property { get; set; } }          // Noncompliant\n    public class MultipleModel { public int Property { get; set; } }        // Noncompliant\n    public class VerbModel { public int Property { get; set; } }            // Noncompliant\n    public class MultipleVerbsModel { public int Property { get; set; } }   // Noncompliant\n\n    [ApiController]\n    [Route(\"api/[controller]\")]\n    public class DecoratedWithApiControlerAttribute : ControllerBase\n    {\n        [HttpGet]\n        public int Single(SingleModel model) => 42;\n\n        [HttpGet]\n        [HttpPost]\n        [HttpPut]\n        [HttpDelete]\n        public int Multiple(MultipleModel model) => 42;\n\n        [AcceptVerbs(\"POST\")]\n        public int Verb(VerbModel model) => 42;\n\n        [AcceptVerbs(\"GET\", \"POST\", \"PUT\", \"DELETE\")]\n        public int MultipleVerbs(MultipleVerbsModel model) => 42;\n    }\n}\n\nnamespace ModelHierarchy\n{\n    public class Parent\n    {\n        public int ParentProperty { get; set; }         // Noncompliant\n    }\n\n    public class Child : Parent\n    {\n        public int ChildProperty { get; set; }          // Noncompliant\n    }\n\n    public class GrandChild : Child\n    {\n        public int GrandChildProperty { get; set; }     // Noncompliant\n    }\n\n    public class ControllerClass : Controller\n    {\n        [HttpPost] public IActionResult Create(GrandChild model) => View(model);\n        [HttpPost] public IActionResult Update(Parent model) => View(model);\n    }\n}\n\nnamespace CompositeModels\n{\n    public class Model\n    {\n        public int Property { get; set; }               // Noncompliant\n        public Model SameModel { get; set; }\n        public AnotherModel AnotherModel { get; set; }\n    }\n\n    public class AnotherModel\n    {\n        public int AnotherProperty { get; set; }        // Noncompliant\n        public Model Model { get; set; }\n    }\n\n    public class ControllerClass : Controller\n    {\n        [HttpPost] public IActionResult Create(Model model) => View(model);\n    }\n}\n\nnamespace Collections\n{\n    public class ArrayItem { public int Property { get; set; } }                // Noncompliant\n    public class NestedArrayItem { public int Property { get; set; } }          // Noncompliant\n    public class EnumerableItem { public int Property { get; set; } }           // Noncompliant\n    public class ListItem { public int Property { get; set; } }                 // Noncompliant\n    public class DictionaryKeyItem { public int Property { get; set; } }        // Noncompliant\n    public class DictionaryValueItem { public int Property { get; set; } }      // Noncompliant\n    public class NestedCollectionItem { public int Property { get; set; } }     // Noncompliant\n\n    public class ControllerClass : Controller\n    {\n        [HttpPost] public IActionResult CreateArray(ArrayItem[] model) => View(model);\n        [HttpPost] public IActionResult CreateNestedArray(NestedArrayItem[] model) => View(model);\n        [HttpPost] public IActionResult CreateEnumerable(IEnumerable<EnumerableItem> model) => View(model);\n        [HttpPost] public IActionResult CreateList(List<ListItem> model) => View(model);\n        [HttpPost] public IActionResult CreateDictionary(Dictionary<DictionaryKeyItem, DictionaryValueItem> model) => View(model);\n        [HttpPost] public IActionResult CreateNestedCollection(Dictionary<string, IEnumerable<NestedCollectionItem[]>> model) => View(model);\n    }\n}\n\nnamespace GenericModelWithTypeConstraint\n{\n    public class MyController : ControllerBase\n    {\n        public void Create(Model<Developer> model)\n        {\n        }\n    }\n\n    public class Model<T> where T : Person\n    {\n        public T Person { get; set; }\n    }\n\n    public abstract class Person\n    {\n        public int Age { get; set; }                    // Noncompliant\n    }\n\n    public class Developer : Person\n    {\n        public string ProgramingLanguage { get; set; }\n        public int WorkExperienceInYears { get; set; }  // Noncompliant\n    }\n}\n\nnamespace RecursiveTypeConstraint\n{\n    public class MyController : ControllerBase\n    {\n        public void Create(MyModel model)\n        {\n        }\n    }\n\n    public class Model<T> where T : Model<T>\n    {\n        public Model<T> SubModel { get; set; }\n        public int ValueProperty { get; set; }          // Noncompliant\n    }\n\n    public class MyModel : Model<MyModel>\n    {\n    }\n}\n\nnamespace ValidateNeverOnCustomType\n{\n    public class NotVisited\n    {\n        public int Prop { get; set; }                                           // Compliant\n    }\n\n    public class Model\n    {\n        [ValidateNever] public NotVisited NotVisited { get; set; }\n        [ValidateNever] public int NotValidatedValueProperty { get; set; }      // Compliant\n    }\n\n    [ValidateNever]\n    public class NeverValidatedModel\n    {\n        public int ValueProperty { get; set; }                                  // Compliant\n    }\n\n    public class RegularModel\n    {\n        public int ValueProperty { get; set; }                                  // Compliant\n    }\n\n    public class CustomController : Controller\n    {\n        [HttpGet] public IActionResult Get(NeverValidatedModel model) => View(model);\n        [HttpPost] public IActionResult Post(Model model) => View(model);\n        [HttpPut] public IActionResult Put([ValidateNever] RegularModel model) => View(model);\n    }\n}\n\nnamespace MutlipleModelsInSameAction\n{\n    public class Model1\n    {\n        public int ValueProperty { get; set; }                                  // Noncompliant\n    }\n\n    public class Model2\n    {\n        public int ValueProperty { get; set; }                                  // Noncompliant\n    }\n\n    public class CustomController : Controller\n    {\n        [HttpPost] public IActionResult Post(Model1 model1, int other, Model2 model2) => View(model1);\n    }\n}\n\nnamespace Interfaces\n{\n    public interface IPerson\n    {\n        int Age { get; set; }                                                   // Noncompliant\n    }\n\n    public class Model\n    {\n        public IPerson Person { get; set; }\n    }\n\n    public class CustomController : Controller\n    {\n        [HttpPost] public IActionResult Post(Model model) => View(model);\n    }\n}\n\nnamespace GeneralTypes\n{\n    public class CustomController : Controller\n    {\n        [HttpPost] public IActionResult PostObject(object model) => View(model);\n        [HttpPost] public IActionResult PostString(string model) => View(model);\n        [HttpPost] public IActionResult PostDynamic(dynamic model) => View(model);\n    }\n}\n\nnamespace ModelIsAutogenerated\n{\n    public class HasAutogeneratedModelController : Controller\n    {\n        [HttpGet]\n        public int Single(AutogeneratedModel model) => 42;\n    }\n}\n\npublic partial class AutogeneratedModel\n{\n    public bool IsProperty // Noncompliant\n    {\n        get;\n        set;\n    }\n}\n\nnamespace UsingBindNeverAttribute\n{\n    public class ModelWithBindNeverProperty\n    {\n        [BindNever] public int ValueProperty { get; set; }\n    }\n\n    [BindNever]\n    public class EntireModelWithBindNeverAttribute\n    {\n        public int ValueProperty { get; set; }\n    }\n\n    public class CustomController : Controller\n    {\n        [HttpGet] public IActionResult Get(ModelWithBindNeverProperty model) => View(model);\n        [HttpPost] public IActionResult Post(EntireModelWithBindNeverAttribute model) => View(model);\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/9690\nnamespace Repro_GH9690\n{\n    public class DataModel\n    {\n        [BindRequired]\n        public int PasswordMinLength { get; set; } // Compliant\n    }\n\n    public class DataModelController : Controller\n    {\n        [HttpPost]\n        public IActionResult Post([FromBody] DataModel model) => View(model);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AspNet/BackslashShouldBeAvoidedInAspNetRoutes.AspNet4x.cs",
    "content": "﻿using System.Web.Mvc;\nusing System;\n\n[Route(@\"A\\[controller]\")]    // Noncompliant {{Replace '\\' with '/'.}}\n//     ^^^^^^^^^^^^^^^^^\npublic class BackslashOnControllerUsingVerbatimStringController : Controller { }\n\n[Route(\"A\\\\[controller]\")]    // Noncompliant {{Replace '\\' with '/'.}}\n//     ^^^^^^^^^^^^^^^^^\npublic class BackslashOnControllerUsingEscapeCharacterController : Controller { }\n\n[Route(\"A\\\\[controller]\\\\B\")] // Noncompliant {{Replace '\\' with '/'.}}\n//     ^^^^^^^^^^^^^^^^^^^^\npublic class MultipleBackslashesOnController : Controller { }\n\npublic class BackslashOnActionUsingVerbatimStringController : Controller\n{\n    [Route(@\"A\\[action]\")]    // Noncompliant {{Replace '\\' with '/'.}}\n    //     ^^^^^^^^^^^^^\n    public ActionResult Index() => View();\n}\n\npublic class BackslashOnActionUsingEscapeCharacterController : Controller\n{\n    [Route(\"A\\\\[action]\")]    // Noncompliant\n    //     ^^^^^^^^^^^^^\n    public ActionResult Index() => View();\n}\n\npublic class MultipleBackslashesOnActionController : Controller\n{\n    [Route(\"A\\\\[action]\\\\B\")] // Noncompliant\n    //     ^^^^^^^^^^^^^^^^\n    public ActionResult Index() => View();\n}\n\n[Route(\"\\\\[controller]\")]    // Noncompliant\n//     ^^^^^^^^^^^^^^^^\npublic class RouteOnControllerStartingWithBackslashController : Controller { }\n\npublic class AController : Controller\n{\n    //[Route(\"A\\\\[action]\")]  // Compliant: commented out\n    public ActionResult WithoutRouteAttribute() => View();\n\n    [Route(\"A\\\\[action]\", Name = \"a\", Order = 3)] // Noncompliant\n    public ActionResult WithOptionalAttributeParameters() => View();\n\n    [RouteAttribute(\"A\\\\[action]\")] // Noncompliant\n    public ActionResult WithAttributeSuffix() => View();\n\n    [System.Web.Mvc.RouteAttribute(\"A\\\\[action]\")] // Noncompliant\n    public ActionResult WithFullQualifiedName() => View();\n\n    [Route(\"A\\\\[action]\")]  // Noncompliant\n    [Route(\"B\\\\[action]\")]  // Noncompliant\n    [Route(\"C/[action]\")]   // Compliant: forward slash is used\n    public ActionResult WithMultipleRoutes() => View();\n\n    [Route(\"A%5C[action]\")] // Compliant: URL-escaped backslash is used\n    public ActionResult WithUrlEscapedBackslash() => View();\n\n    [Route(\"A/{s:regex(^(?!index\\\\b)[[a-zA-Z0-9-]]+$)}.html\")]                 // Compliant: backslash is in regex\n    public ActionResult WithRegexContainingBackslashInLookahead()  => View();\n\n    [Route(\"A/{s:datetime:regex(\\\\d{{4}}-\\\\d{{2}}-\\\\d{{4}})}/B\")]              // Compliant: backslash is in regex\n    public ActionResult WithRegexContainingBackslashInMetaEscape() => View();\n\n    [Route(\"A\\\\{s:regex(.*)\\\\[action]\")]                                       // Noncompliant\n    public ActionResult WithFirstBackslashBeforeFirstRegex() => View();\n\n    [Route(\"{s:regex(.*)\\\\[action]\")]                                          // FN: the backslash is not in the regex\n    public ActionResult WithFirstBackslashAfterFirstRegex() => View();\n\n    [Route(\"{s:regex([^\\\\\\\\]*)\\\\[action]\")]                                    // FN: the second backslash is not in the regex\n    public ActionResult WithSecondBackslashNotInRegex() => View();\n\n    [Route(\"{s:regex([^\\\\\\\\]*)/regex([^\\\\\\\\]*)\")]                              // Compliant: both backslashes are in the regex\n    public ActionResult WithTwoBackslashesInRegex() => View();\n}\n\nnamespace WithAliases\n{\n    using MyRoute = RouteAttribute;\n    using ASP = System.Web;\n\n    [MyRoute(@\"A\\[controller]\")]            // Noncompliant\n    public class WithAliasedRouteAttributeController : Controller { }\n\n    [ASP.Mvc.RouteAttribute(\"A\\\\[action]\")] // Noncompliant\n    public class WithFullQualifiedPartiallyAliasedNameController : Controller { }\n}\n\nnamespace WithFakeRouteAttribute\n{\n    [Route(@\"A\\[controller]\")]      // Compliant: not a real RouteAttribute\n    public class AControllerController : Controller { }\n\n    [AttributeUsage(AttributeTargets.Class)]\n    public class RouteAttribute : Attribute\n    {\n        public RouteAttribute(string template) { }\n    }\n}\n\nclass WithTuples\n{\n    void Test()\n    {\n        var tuple = (1, \"A\\\\[controller]\"); // Compliant: the argument is not in a method invocation\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/9193\nnamespace AttributeWithNamedArgument\n{\n    [AttributeUsage(AttributeTargets.All)]\n    public class MyAttribute : Attribute\n    {\n        public string Name { get; set; }\n    }\n\n    public class MyController : Controller\n    {\n        [MyAttribute(Name = \"Display HR\\\\Recruitment report\")]\n        public const string Text = \"ABC\";\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AspNet/BackslashShouldBeAvoidedInAspNetRoutes.AspNet4x.vb",
    "content": "﻿Imports System\nImports System.Web.Mvc\n\n<Route(\"A\\[controller]\")>   ' Noncompliant ^8#16 {{Replace '\\' with '/'.}}\nPublic Class BackslashOnController\n    Inherits Controller\nEnd Class\n\n<Route(\"A\\[controller]\\B\")> ' Noncompliant ^8#18 {{Replace '\\' with '/'.}}\nPublic Class MultipleBackslashesOnController\n    Inherits Controller\nEnd Class\n\nPublic Class BackslashOnActionController\n    Inherits Controller\n\n    <Route(\"A\\[action]\")>   ' Noncompliant ^12#12 {{Replace '\\' with '/'.}}\n    Public Function Index() As ActionResult\n        Return View()\n    End Function\nEnd Class\n\nPublic Class MultipleBackslashesOnActionController\n    Inherits Controller\n\n    <Route(\"A\\[action]\\B\")> ' Noncompliant ^12#14 {{Replace '\\' with '/'.}}\n    Public Function Index() As ActionResult\n        Return View()\n    End Function\nEnd Class\n\n<Route(\"\\[controller]\")>    ' Noncompliant\nPublic Class RouteOnControllerStartingWithBackslashController\n    Inherits Controller\nEnd Class\n\nPublic Class AController\n    Inherits Controller\n\n    Public Function WithoutRouteAttribute() As ActionResult             ' Compliant\n        Return View()\n    End Function\n\n    <Route(\"A\\[action]\", Name:=\"a\", Order:=3)>                          ' Noncompliant\n    Public Function WithOptionalAttributeParameters() As ActionResult\n        Return View()\n    End Function\n\n    <RouteAttribute(\"A\\[action]\")>                                      ' Noncompliant\n    Public Function WithAttributeSuffix() As ActionResult\n        Return View()\n    End Function\n\n    <System.Web.Mvc.RouteAttribute(\"A\\[action]\")>                       ' Noncompliant\n    Public Function WithFullQualifiedName() As ActionResult\n        Return View()\n    End Function\n\n    <Route(\"A\\[action]\")>                                               ' Noncompliant\n    <Route(\"B\\[action]\")>                                               ' Noncompliant\n    <Route(\"C/[action]\")>                                               ' Compliant: forward slash is used\n    Public Function WithMultipleRoutes() As ActionResult\n        Return View()\n    End Function\n\n    <Route(\"A%5C[action]\")>                                             ' Compliant: URL-escaped backslash is used\n    Public Function WithUrlEscapedBackslash() As ActionResult\n        Return View()\n    End Function\n\n    <Route(\"A/{s:regex(^(?!index\\b)[[a-zA-Z0-9-]]+$)}.html\")>           ' Compliant: backslash is in regex\n    Public Function WithRegexContainingBackslashInLookahead() As ActionResult\n        Return View()\n    End Function\n\n    <Route(\"A/{s:datetime:regex(\\d{{4}}-\\d{{2}}-\\d{{4}})}/B\")>          ' Compliant: backslash is in regex\n    Public Function WithRegexContainingBackslashInMetaEscape() As ActionResult\n        Return View()\n    End Function\nEnd Class\n\n' https://github.com/SonarSource/sonar-dotnet/issues/9193\nNamespace AttributeWithNamedArgument\n    <AttributeUsage(AttributeTargets.All)>\n    Public Class MyAttribute\n        Inherits Attribute\n        Public Property Name As String\n    End Class\n\n    Public Class MyController\n        Inherits Controller\n        <MyAttribute(Name:=\"Display HR\\Recruitment report\")>\n        Public Const Text As String = \"ABC\"\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AspNet/BackslashShouldBeAvoidedInAspNetRoutes.AspNetCore2AndAbove.cs",
    "content": "﻿using Microsoft.AspNetCore.Mvc;\nusing Microsoft.AspNetCore.Mvc.Routing;\nusing System;\nusing System.Diagnostics.CodeAnalysis;\n\n[Route(@\"A\\[controller]\")]    // Noncompliant {{Replace '\\' with '/'.}}\n//     ^^^^^^^^^^^^^^^^^\npublic class BackslashOnControllerUsingVerbatimString : Controller { }\n\n[Route(\"A\\\\[controller]\")]    // Noncompliant {{Replace '\\' with '/'.}}\n//     ^^^^^^^^^^^^^^^^^\npublic class BackslashOnControllerUsingEscapeCharacter : Controller { }\n\n[Route(\"A\\\\[controller]\\\\B\")] // Noncompliant {{Replace '\\' with '/'.}}\n//     ^^^^^^^^^^^^^^^^^^^^\npublic class MultipleBackslashesOnController : Controller { }\n\npublic class BackslashOnActionUsingVerbatimString : Controller\n{\n    [Route(@\"A\\[action]\")]    // Noncompliant {{Replace '\\' with '/'.}}\n    //     ^^^^^^^^^^^^^\n    public IActionResult Index() => View();\n}\n\npublic class BackslashOnActionUsingEscapeCharacter : Controller\n{\n    [Route(\"A\\\\[action]\")]    // Noncompliant\n    //     ^^^^^^^^^^^^^\n    public IActionResult Index() => View();\n}\n\npublic class MultipleBackslashesOnAction : Controller\n{\n    [Route(\"A\\\\[action]\\\\B\")] // Noncompliant\n    //     ^^^^^^^^^^^^^^^^\n    public IActionResult Index() => View();\n}\n\n[Route(\"\\\\[controller]\")]    // Noncompliant\n//     ^^^^^^^^^^^^^^^^\npublic class RouteOnControllerStartingWithBackslash : Controller { }\n\npublic class AController : Controller\n{\n    //[Route(\"A\\\\[action]\")]  // Compliant: commented out\n    public IActionResult WithoutRouteAttribute() => View();\n\n    [Route(\"A\\\\[action]\", Name = \"a\", Order = 3)] // Noncompliant\n    public IActionResult WithOptionalAttributeParameters() => View();\n\n    [Route(\"A/[action]\", Name = @\"a\\b\", Order = 3)] // Compliant: backslash is on the name\n    public IActionResult WithBackslashInRouteName() => View();\n\n    [RouteAttribute(\"A\\\\[action]\")] // Noncompliant\n    public IActionResult WithAttributeSuffix() => View();\n\n    [Microsoft.AspNetCore.Mvc.RouteAttribute(\"A\\\\[action]\")] // Noncompliant\n    public IActionResult WithFullQualifiedName() => View();\n\n    [Route(\"A\\\\[action]\")]  // Noncompliant\n    [Route(\"B\\\\[action]\")]  // Noncompliant\n    [Route(\"C/[action]\")]   // Compliant: forward slash is used\n    public IActionResult WithMultipleRoutes() => View();\n\n    [Route(\"A%5C[action]\")] // Compliant: URL-escaped backslash is used\n    public IActionResult WithUrlEscapedBackslash() => View();\n\n    [Route(\"A/{s:regex(^(?!index\\\\b)[[a-zA-Z0-9-]]+$)}.html\")]\n    public IActionResult WithRegexContainingBackslashInLookahead(string s)  => View();  // Compliant: backslash is in regex\n\n    [Route(\"A/{s:datetime:regex(\\\\d{{4}}-\\\\d{{2}}-\\\\d{{4}})}/B\")]\n    public IActionResult WithRegexContainingBackslashInMetaEscape(string s)  => View(); // Compliant: backslash is in regex\n}\n\nnamespace WithAliases\n{\n    using MyRoute = RouteAttribute;\n    using ASP = Microsoft.AspNetCore;\n\n    [MyRoute(@\"A\\[controller]\")]            // Noncompliant\n    public class WithAliasedRouteAttribute : Controller { }\n\n    [ASP.Mvc.RouteAttribute(\"A\\\\[action]\")] // Noncompliant\n    public class WithFullQualifiedPartiallyAliasedName : Controller { }\n}\n\nnamespace WithFakeRouteAttribute\n{\n    [Route(@\"A\\[controller]\")]      // Compliant: not a real RouteAttribute\n    public class AController : Controller { }\n\n    [AttributeUsage(AttributeTargets.Class)]\n    public class RouteAttribute : Attribute\n    {\n        public RouteAttribute(string template) { }\n    }\n}\n\nclass WithUserDefinedSyntaxRouteParameter\n{\n    const string RouteConst = \"Route\";\n\n    void Test()\n    {\n        StringSyntaxWithRouteParameter(\"\\\\\");                          // Noncompliant\n        StringSyntaxWithRouteParameterAfterOtherParameter(\"\\\\\", \"\\\\\"); // Noncompliant\n        //                                                      ^^^^\n        StringSyntaxWithRouteConstParameter(\"\\\\\");                     // Noncompliant\n        StringSyntaxWithNonRouteParameter(\"\\\\\");                       // Compliant\n        StringSyntaxWithRouteWrongCaseParameter(\"\\\\\");                 // Compliant\n        StringSyntaxWithNullParameter(\"\\\\\");                           // Compliant\n        StringSyntaxWithEmptyStringParameter(\"\\\\\");                    // Compliant\n        MultipleStringSyntaxWithRouteParameterValidFirst(\"\\\\\");        // Noncompliant\n        MultipleStringSyntaxWithRouteParameterInvalidFirst(\"\\\\\");      // FN: only the first StringSyntax is considered\n        NoStringSyntax(\"\\\\\");                                          // Compliant\n    }\n\n    private void StringSyntaxWithRouteParameter([StringSyntax(\"Route\")]string route) { }\n    private void StringSyntaxWithRouteParameterAfterOtherParameter(string anotherParameter, [StringSyntax(\"Route\")]string route) { }\n    private void StringSyntaxWithRouteConstParameter([StringSyntax(RouteConst)]string route) { }\n    private void StringSyntaxWithNonRouteParameter([StringSyntax(\"NotRoute\")]string route) { }\n    private void StringSyntaxWithRouteWrongCaseParameter([StringSyntax(\"route\")]string route) { }\n    private void StringSyntaxWithNullParameter([StringSyntax(null)]string route) { }\n    private void StringSyntaxWithEmptyStringParameter([StringSyntax(\"\")]string route) { }\n    private void MultipleStringSyntaxWithRouteParameterValidFirst([StringSyntax(\"Route\")][StringSyntax(\"route\")]string route) { }   // Error [CS0579]\n    private void MultipleStringSyntaxWithRouteParameterInvalidFirst([StringSyntax(\"route\")][StringSyntax(\"Route\")]string route) { } // Error [CS0579]\n    private void NoStringSyntax(string route) { }\n}\n\nclass InheritingFromFakeControllerDoesntInfluenceRouteCheck\n{\n    [NonController]\n    [Route(@\"A\\[controller]\")]    // Noncompliant\n    public class NotAController : Controller { }\n\n    public class Controller { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AspNet/BackslashShouldBeAvoidedInAspNetRoutes.AspNetCore2x.Latest.cs",
    "content": "﻿using Microsoft.AspNetCore.Mvc;\nusing Microsoft.AspNetCore.Mvc.Routing;\nusing System;\nusing System.Diagnostics.CodeAnalysis;\n\nclass ControllerRequirementsDontInfluenceRouteCheck\n{\n    [NonController]\n    [Route(@\"A\\[controller]\")]    // Noncompliant\n    public class NotAController : Controller { }\n\n    [Route(@\"A\\[controller]\")]    // Noncompliant\n    public class ControllerWithoutControllerSuffix : Controller { }\n\n    [Controller]\n    [Route(@\"A\\[controller]\")]    // Noncompliant\n    public class ControllerWithControllerAttribute : Controller { }\n\n    [Route(@\"A\\[controller]\")]    // Noncompliant\n    internal class InternalController : Controller { }\n\n    [Route(@\"A\\[controller]\")]    // Noncompliant\n    protected class ProtectedController : Controller { }\n\n    [Route(@\"A\\[controller]\")]    // Noncompliant\n    private protected class PrivateProtectedController : Controller { }\n\n    [Route(@\"A\\[controller]\")]    // Noncompliant\n    public class  ControllerWithoutParameterlessConstructor : Controller\n    {\n        public ControllerWithoutParameterlessConstructor(int i) { }\n    }\n    [Route(@\"A\\e\\[controller]\")]    // Noncompliant\n    public class ControllerWithEscapeChar : Controller { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AspNet/BackslashShouldBeAvoidedInAspNetRoutes.AspNetCore2x.vb",
    "content": "﻿Imports Microsoft.AspNetCore.Mvc\n\n<Route(\"A\\[controller]\")>   ' Noncompliant ^8#16 {{Replace '\\' with '/'.}}\nPublic Class BackslashOnController : Inherits Controller : End Class\n\n<Route(\"A\\[controller]\\B\")> ' Noncompliant ^8#18 {{Replace '\\' with '/'.}}\nPublic Class MultipleBackslashesOnController : Inherits Controller : End Class\n\nPublic Class BackslashOnActionController\n    Inherits Controller\n\n    <Route(\"A\\[action]\")>   ' Noncompliant ^12#12 {{Replace '\\' with '/'.}}\n    Public Function Index() As IActionResult\n        Return View()\n    End Function\nEnd Class\n\nPublic Class MultipleBackslashesOnActionController\n    Inherits Controller\n\n    <Route(\"A\\[action]\\B\")> ' Noncompliant ^12#14 {{Replace '\\' with '/'.}}\n    Public Function Index() As IActionResult\n        Return View()\n    End Function\nEnd Class\n\n<Route(\"\\[controller]\")>    ' Noncompliant\nPublic Class RouteOnControllerStartingWithBackslashController\n    Inherits Controller\nEnd Class\n\nPublic Class AController\n    Inherits Controller\n\n    ' [Route(\"A\\\\[action]\")] ' Compliant: commented out\n    Public Function WithoutRouteAttribute() As IActionResult\n        Return View()\n    End Function\n\n    <Route(\"A\\[action]\", Name:=\"a\", Order:=3)>   ' Noncompliant\n    Public Function WithOptionalAttributeParameters() As IActionResult\n        Return View()\n    End Function\n\n    <Route(\"A/[action]\", Name:=\"a\\b\", Order:=3)> ' Compliant: backslash is on the name\n    Public Function WithBackslashInRouteName() As IActionResult\n        Return View()\n    End Function\n\n    <RouteAttribute(\"A\\[action]\")>               ' Noncompliant\n    Public Function WithAttributeSuffix() As IActionResult\n        Return View()\n    End Function\n\n    <Microsoft.AspNetCore.Mvc.RouteAttribute(\"A\\[action]\")> ' Noncompliant\n    Public Function WithFullQualifiedName() As IActionResult\n        Return View()\n    End Function\n\n    <Route(\"A\\[action]\")>   ' Noncompliant\n    <Route(\"B\\[action]\")>   ' Noncompliant\n    <Route(\"C/[action]\")>   ' Compliant: forward slash is used\n    Public Function WithMultipleRoutes() As IActionResult\n        Return View()\n    End Function\n\n    <Route(\"A%5C[action]\")> ' Compliant: URL-escaped backslash is used\n    Public Function WithUrlEscapedBackslash() As IActionResult\n        Return View()\n    End Function\n\n    <Route(\"A/{s:regex(^(?!index\\b)[[a-zA-Z0-9-]]+$)}.html\")>  ' Compliant: backslash is in regex\n    Public Function WithRegexContainingBackslashInLookahead(ByVal s As String) As IActionResult\n        Return View()\n    End Function\n\n    <Route(\"A/{s:datetime:regex(\\d{{4}}-\\d{{2}}-\\d{{4}})}/B\")> ' Compliant: backslash is in regex\n    Public Function WithRegexContainingBackslashInMetaEscape(ByVal s As String) As IActionResult\n        Return View()\n    End Function\nEnd Class\n\nPublic Class WithAllTypesOfStringsController\n    Inherits Controller\n\n    Private Const AConstStringIncludingABackslash As String = \"A\\\"\n    Private Const AConstStringNotIncludingABackslash As String = \"A/\"\n\n    <Route(AConstStringIncludingABackslash)>    ' Noncompliant\n    Public Function WithConstStringIncludingABackslash() As IActionResult\n        Return View()\n    End Function\n\n    <Route(AConstStringNotIncludingABackslash)> ' Compliant\n    Public Function WithConstStringNotIncludingABackslash() As IActionResult\n        Return View()\n    End Function\nEnd Class\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AspNet/BackslashShouldBeAvoidedInAspNetRoutes.AspNetCore3AndAbove.Latest.cs",
    "content": "﻿using Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Http;\nusing Microsoft.AspNetCore.Mvc.Routing;\nusing Microsoft.AspNetCore.Routing;\nusing System;\nusing System.Threading.Tasks;\n\nclass WithAllControllerEndpointRouteBuilderExtensionsMethods\n{\n    private const string ASlash = \"/\";\n    private const string ABackslash = @\"\\\";\n\n    void MapControllerRoute(WebApplication app)\n    {\n        const string ASlashLocal = \"A\";\n        const string ABackslashLocal = @\"\\\";\n\n        app.MapControllerRoute(\"default\", \"{controller=Home}\\\\{action=Index}/{id?}\");                  // Noncompliant\n        app.MapControllerRoute(\"default\", @\"{controller=Home}\\\\{action=Index}/{id?}\");                 // Noncompliant\n        app.MapControllerRoute(\"default\", \"{controller=Home}/{action=Index}/{id?}\");                   // Compliant\n\n        app.MapControllerRoute(\"default\", $$\"\"\"{controller=Home}{{ABackslash}}{action=Index}\"\"\");      // Noncompliant\n        app.MapControllerRoute(\"default\", $$\"\"\"{controller=Home}{{ASlash}}{action=Index}\"\"\");          // Compliant\n        app.MapControllerRoute(\"default\", $$\"\"\"{controller=Home}{{ABackslashLocal}}{action=Index}\"\"\"); // Noncompliant\n        app.MapControllerRoute(\"default\", $$\"\"\"{controller=Home}{{ASlashLocal}}{action=Index}\"\"\");     // Compliant\n\n        app.MapControllerRoute(\n            name: \"default\",\n            pattern: \"{controller=Home}\\\\{action=Index}/{id?}\", // Noncompliant\n            defaults: new { controller = \"Home\", action = \"Index\" });\n        app.MapControllerRoute(\n            name: \"default\",\n            pattern: \"{controller=Home}\\e\\\\{action=Index}/{id?}\", // Noncompliant\n            defaults: new { controller = \"Home\", action = \"Index\" });\n        app.MapControllerRoute(\n            name: \"default\",\n            pattern: \"{controller=Home}\\e{action=Index}/{id?}\", // Compliant\n            defaults: new { controller = \"Home\", action = \"Index\" });\n        app.MapControllerRoute(\n            pattern: \"{controller=Home}\\\\{action=Index}/{id?}\", // Noncompliant\n            name: \"default\",\n            defaults: new { controller = \"Home\", action = \"Index\" });\n\n        ControllerEndpointRouteBuilderExtensions.MapControllerRoute(app, \"default\", \"{controller=Home}\\\\{action=Index}/{id?}\"); // Noncompliant\n    }\n\n    void OtherMethods(WebApplication app)\n    {\n        app.MapAreaControllerRoute(\"default\", \"area\", \"{controller=Home}\\\\{action=Index}/{id?}\");             // Noncompliant\n        //                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        app.MapFallbackToAreaController(\"{controller=Home}\\\\{action=Index}\", \"action\", \"controller\", \"area\"); // Noncompliant\n        app.MapFallbackToAreaController(\"\\\\action\", \"\\\\controller\", \"\\\\area\");                                // Compliant\n        app.MapFallbackToController(@\"\\action\", @\"\\controller\");                                              // Compliant\n        app.MapFallbackToController(\"{controller=Home}\\\\{action=Index}\", \"\\\\action\", \"\\\\controller\");         // Noncompliant\n        //                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        app.MapDynamicControllerRoute<ATransformer>(\"{controller=Home}\\\\{action=Index}\");                     // Noncompliant\n        app.MapDynamicControllerRoute<ATransformer>(\"{controller=Home}\\\\{action=Index}\", new object());       // Noncompliant\n        app.MapDynamicControllerRoute<ATransformer>(\"{controller=Home}\\\\{action=Index}\", new object(), 3);    // Noncompliant\n    }\n\n    private sealed class ATransformer : DynamicRouteValueTransformer\n    {\n        public override ValueTask<RouteValueDictionary> TransformAsync(HttpContext httpContext, RouteValueDictionary values) => throw new NotImplementedException();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AspNet/BackslashShouldBeAvoidedInAspNetRoutes.AspNetCore3AndAbove.vb",
    "content": "﻿Imports Microsoft.AspNetCore.Builder\n\nClass WithAllControllerEndpointRouteBuilderExtensionsMethods\n    Private Sub MapControllerRoute(ByVal app As WebApplication)\n        app.MapControllerRoute(name:=\"default\", pattern:=\"{controller=Home}\\{action=Index}/{id?}\")          ' Noncompliant\n        app.MapControllerRoute(\"default\", \"{controller=Home}\\{action=Index}/{id?}\")                         ' Noncompliant\n        app.MapAreaControllerRoute(\"default\", \"area\", \"{controller=Home}\\{action=Index}/{id?}\")             ' Noncompliant\n        app.MapFallbackToAreaController(\"{controller=Home}\\{action=Index}\", \"action\", \"controller\", \"area\") ' Noncompliant\n        app.MapFallbackToAreaController(\"\\action\", \"\\controller\", \"\\area\")                                  ' Compliant\n        app.MapFallbackToController(\"\\action\", \"\\controller\")                                               ' Compliant\n        app.MapFallbackToController(\"{controller=Home}\\{action=Index}\", \"\\action\", \"\\controller\")           ' Noncompliant\n\n        ControllerEndpointRouteBuilderExtensions.MapControllerRoute(app, \"default\", \"{controller=Home}\\{action=Index}/{id?}\")  ' Noncompliant\n    End Sub\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AspNet/BackslashShouldBeAvoidedInAspNetRoutes.AspNetCore8AndAbove.Latest.cs",
    "content": "﻿using Microsoft.AspNetCore.Builder;\n\nclass WithAllControllerEndpointRouteBuilderExtensionsMethods\n{\n    // MapFallbackToPage decorates the pattern with StringSyntax(\"Route\") since ASP.NET Core 8.0.0\n    void MapFallbackToPage(WebApplication app)\n    {\n        app.MapFallbackToPage(\"\\\\action\");                                    // Compliant\n        app.MapFallbackToPage(\"{controller=Home}\\\\{action=Index}\", \"\\\\page\"); // Noncompliant\n        //                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        app.MapFallbackToPage(\"\\eaction\");                                    // Compliant\n        app.MapFallbackToPage(\"{controller=Home}\\\\\\e{action=Index}\", \"\\e\\\\page\"); // Noncompliant\n\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AspNet/BackslashShouldBeAvoidedInAspNetRoutes.AspNetCore8AndAbove.vb",
    "content": "﻿Imports Microsoft.AspNetCore.Builder\n\nClass WithAllControllerEndpointRouteBuilderExtensionsMethods\n    ' MapFallbackToPage decorates the pattern with StringSyntax(\"Route\") since ASP.NET Core 8.0.0\n    Private Sub MapControllerRoute(ByVal app As WebApplication)\n        app.MapFallbackToPage(\"\\action\")                                   ' Compliant\n        app.MapFallbackToPage(\"{controller=Home}\\{action=Index}\", \"\\page\") ' Noncompliant\n        '                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    End Sub\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AspNet/CallModelStateIsValid.AutogeneratedController.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\n// Repro https://github.com/SonarSource/sonar-dotnet/issues/9260\n// Also related to https://github.com/SonarSource/sonar-dotnet/issues/8876\nusing Microsoft.AspNetCore.Mvc;\n\npublic partial class AutogeneratedController : Controller\n{\n    // Repro for https://github.com/SonarSource/sonar-dotnet/issues/9261\n    // this will be fixed once https://github.com/SonarSource/sonar-dotnet/issues/8876 is fixed\n    [HttpPost]\n    public void Post(int id) { } // Noncompliant, FP we should not raise in autogenerated code.\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AspNet/CallModelStateIsValid.Latest.cs",
    "content": "﻿using Microsoft.AspNetCore.Mvc;\n\nnamespace Repro_NET1044\n{\n    public class PositionalPatternClause : Controller\n    {\n        public int Pattern((int X, int Y) tuple) => // Noncompliant\n            tuple switch\n            {\n                (_, _) => 42     // This was throwing NullReferenceException\n            };\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AspNet/CallModelStateIsValid.cs",
    "content": "﻿using System.ComponentModel.DataAnnotations;\nusing System.Runtime.CompilerServices;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.AspNetCore.Mvc;\nusing Microsoft.AspNetCore.Mvc.Filters;\n\npublic class NonCompliantController : ControllerBase\n{\n    [HttpGet(\"/[controller]\")]\n    public string Get([Required, FromQuery] string id)                          // Noncompliant {{ModelState.IsValid should be checked in controller actions.}}\n    //            ^^^\n    {\n        return \"Hello!\";\n    }\n\n    [HttpPost(\"/[controller]\")]\n    public string Post(Movie movie)                                             // Noncompliant\n    {\n        return \"Hello!\";\n    }\n\n    [HttpPut(\"/[controller]\")]\n    public string Put(Movie movie)                                              // Noncompliant\n    {\n        return \"Hello!\";\n    }\n\n    [HttpDelete(\"/[controller]\")]\n    public string Delete(Movie movie)                                           // Noncompliant\n    {\n        return \"Hello!\";\n    }\n\n    [HttpPatch(\"/[controller]\")]\n    public string Patch(Movie movie)                                            // Noncompliant\n    {\n        return \"Hello!\";\n    }\n\n    [HttpGet]\n    [HttpPost]\n    [HttpPut]\n    [HttpDelete]\n    [HttpPatch]\n    [Route(\"/[controller]/mix\")]\n    public string Mix([Required, FromQuery, EmailAddress] string email)         // Noncompliant\n    {\n        return \"Hello!\";\n    }\n\n    [AcceptVerbs(\"GET\")]\n    [Route(\"/[controller]/accept-verbs\")]\n    public string AGet([Required] string id)                                    // Noncompliant\n    {\n        return \"Hello!\";\n    }\n\n    [AcceptVerbs(\"POST\")]\n    [Route(\"/[controller]/accept-verbs\")]\n    public string APost(Movie movie)                                            // Noncompliant\n    {\n        return \"Hello!\";\n    }\n\n    [AcceptVerbs(\"PUT\")]\n    [Route(\"/[controller]/accept-verbs\")]\n    public string APut(Movie movie)                                             // Noncompliant\n    {\n        return \"Hello!\";\n    }\n\n    [AcceptVerbs(\"DELETE\")]\n    [Route(\"/[controller]/accept-verbs\")]\n    public string ADelete(Movie movie)                                          // Noncompliant\n    {\n        return \"Hello!\";\n    }\n\n    [AcceptVerbs(\"PATCH\")]\n    [Route(\"/[controller]/accept-verbs\")]\n    public string APatch(Movie movie)                                           // Noncompliant\n    {\n        return \"Hello!\";\n    }\n\n    [AcceptVerbs(\"GET\", \"POST\", \"PUT\", \"DELETE\", \"PATCH\")]\n    [Route(\"/[controller]/many\")]\n    public string Many([Required, FromQuery, EmailAddress] string email)        // Noncompliant\n    {\n        return \"Hello!\";\n    }\n\n    [HttpGet(\"/[controller]/list\")]\n    public string[] List() => null;                                             // Compliant\n\n    [HttpGet(\"/[controller]/listasync\")]\n    public Task<string[]> ListAsync(CancellationToken token) => null;           // Compliant\n}\n\n[ApiController]\npublic class ControllerWithApiAttributeAtTheClassLevel : ControllerBase\n{\n    [HttpPost(\"/[controller]\")]\n    public string Add(Movie movie)                                              // Compliant, ApiController attribute is applied at the class level.\n    {\n        return \"Hello!\";\n    }\n}\n\npublic class BaseClassHasApiControllerAttribute : ControllerWithApiAttributeAtTheClassLevel\n{\n    [HttpDelete(\"/[controller]\")]\n    public string Remove(Movie movie)                                           // Compliant, base class is decorated with the ApiController attribute\n    {\n        return \"Hello!\";\n    }\n}\n\n[Controller]\npublic class ControllerThatDoesNotInheritFromControllerBase\n{\n    [HttpPost(\"/[controller]\")]\n    public string Add(Movie movie)                                              // Compliant, ModelState is not available in this context.\n    {\n        return \"Hello!\";\n    }\n}\n\npublic class SimpleController\n{\n    [HttpPost(\"/[controller]\")]\n    public string Add(Movie movie)                                              // Compliant, ModelState is not available in this context.\n    {\n        return \"Hello!\";\n    }\n}\n\npublic class CompliantController : ControllerBase\n{\n    [HttpGet(\"/[controller]\")]\n    public string Get([Required, FromQuery] string id)                          // Compliant\n    {\n        if (!ModelState.IsValid)\n        {\n            return null;\n        }\n        return \"Hello\";\n    }\n\n    [HttpGet(\"/[controller]/GetNoParam\")]\n    public string GetNoParam()                                                  // Compliant\n    {\n        return \"Hello\";\n    }\n\n    [HttpPost(\"/[controller]\")]\n    public string Post([Required, FromBody] string id)                          // Compliant\n    {\n        var state = ModelState;\n        if (!state.IsValid)\n        {\n            return null;\n        }\n        return \"Hello\";\n    }\n}\n\n[ValidateModel]\npublic class ControllerClassWithActionFilter : ControllerBase\n{\n    [HttpPost(\"/[controller]/create\")]\n    public string Create(Movie movie)                                           // Compliant, Controller class is decorated with an Action Filter\n    {\n        return \"Hello!\";\n    }\n}\n\npublic class ControllerMethodsWithActionFilter : ControllerBase\n{\n    [ValidateModel]\n    [HttpPost(\"/[controller]/create\")]\n    public string Create(Movie movie)                                           // Compliant, Controller action is decorated with an Action Filter\n    {\n        return \"Hello!\";\n    }\n}\n\npublic class Movie\n{\n    [Required]\n    public string Title { get; set; }\n\n    [Range(1900, 2200)]\n    public int Year { get; set; }\n}\n\npublic class ValidateModelAttribute : ActionFilterAttribute\n{\n    public override void OnActionExecuting(ActionExecutingContext context)\n    {\n        if (!context.ModelState.IsValid)\n        {\n            context.Result = new BadRequestObjectResult(context.ModelState);\n        }\n    }\n}\n\npublic class ControllerCallsTryValidate : ControllerBase\n{\n    [HttpPost]\n    public string CallsTryValidateModel1([Required] string email)               // Compliant, calls TryValidateModel\n    {\n        return TryValidateModel(email) ? \"Hi!\" : \"Hello!\";\n    }\n\n    [HttpPost]\n    public string CallsTryValidateModel([Required] string email)                // Compliant, calls TryValidateModel\n    {\n        return TryValidateModel(email, \"prefix\") ? \"Hi!\" : \"Hello!\";\n    }\n}\n\npublic class ControllerCallsTryValidateOverride : ControllerBase\n{\n    public override bool TryValidateModel(object model) => true;\n    public override bool TryValidateModel(object model, string prefix) => true;\n\n    [HttpPost]\n    public string CallsTryValidateModel1([Required] string email)               // Compliant, calls TryValidateModel\n    {\n        return TryValidateModel(email) ? \"Hi!\" : \"Hello!\";\n    }\n\n    [HttpPost]\n    public string CallsTryValidateModel([Required] string email)                // Compliant, calls TryValidateModel\n    {\n        return TryValidateModel(email, \"prefix\") ? \"Hi!\" : \"Hello!\";\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/9325\nnamespace Repro_9325\n{\n    public class MyController : ControllerBase\n    {\n        [HttpGet(\"/[controller]\")]\n        public string Get([Required, FromQuery] string id)                      // Noncompliant - FP: the Model State is checked in a method that's called from the Controller Action\n        {\n            if (!CheckModelState())\n            {\n                return \"Error!\";\n            }\n            return \"Hello!\";\n        }\n\n        private bool CheckModelState() => ModelState.IsValid;\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/9262\nnamespace Repro_9262\n{\n    public class MyController : ControllerBase\n    {\n        [HttpGet(\"/[controller]\")]\n        public string OnlyIngoredTypes(string str, object obj, dynamic dyn)\n        {\n            return \"Hello!\";\n        }\n\n        [HttpGet(\"/[controller]\")]\n        public string WithValidationAttribute(string str, [Required] object obj, dynamic dyn)   // Noncompliant\n        {\n            return \"Hello!\";\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AspNet/ControllerReuseClient.CSharp12.cs",
    "content": "﻿using Microsoft.AspNetCore.Mvc;\nusing System;\nusing System.IO;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\n[ApiController]\n[Route(\"SomeRoute\")]\npublic class C(HttpClient client) : ControllerBase;\n\n[ApiController]\n[Route(\"SomeRoute\")]\npublic class D(HttpClient client) : C(new HttpClient())     // Compliant\n{\n    public D() : this(new HttpClient()) { }                 // Compliant\n    private HttpClient Client { get => new HttpClient(); }  // Noncompliant\n}\n\n[ApiController]\n[Route(\"SomeRoute\")]\npublic class E : C\n{\n    public E() : base(new HttpClient()) { }                 // Compliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AspNet/ControllersHaveMixedResponsibilities.Latest.Partial.cs",
    "content": "﻿using Microsoft.AspNetCore.Mvc;\nusing TestInstrumentation.ResponsibilitySpecificServices;\n\nnamespace CSharp13\n{\n    public partial class WithFieldBackedPartialProperties : ControllerBase // Noncompliant\n    {\n        public partial IS1 S1 { get; }\n        public partial IS2 S2 { get; init; }\n    }\n\n    public partial class WithPartialIndexer : ControllerBase // Noncompliant\n    {\n        public partial int this[int i] { get; set; } \n\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AspNet/ControllersHaveMixedResponsibilities.Latest.cs",
    "content": "﻿using Microsoft.AspNetCore.Mvc;\nusing Microsoft.Extensions.DependencyInjection;\nusing System;\nusing TestInstrumentation.ResponsibilitySpecificServices;\nusing TestInstrumentation.WellKnownInterfacesExcluded;\nusing TestInstrumentation;\nusing WithInjectionViaNormalConstructor;\nusing System.Runtime.CompilerServices;\nusing WithInjectionViaPrimaryConstructors.TwoActions;\n\n// Remark: secondary messages are asserted extensively, to ensure that grouping is done correctly and deterministically.\n\nnamespace TestInstrumentation\n{\n    public interface IServiceWithAnAPI { void Use(); }\n\n    public abstract class ServiceWithAnApi : IServiceWithAnAPI { public void Use() { } }\n\n    // These interfaces have been kept to simulate the actual ones, from MediatR, AutoMapper, etc.\n    // For performance reasons, the analyzer ignores namespace and assembly, and only consider the name.\n    // While that may comes with some false positives, the likelihood of that happening is very low.\n    namespace WellKnownInterfacesExcluded\n    {\n        public interface ILogger<T> : IServiceWithAnAPI { }         // From Microsoft.Extensions.Logging\n        public interface IHttpClientFactory : IServiceWithAnAPI { } // From Microsoft.Extensions.Http\n        public interface IMediator : IServiceWithAnAPI { }          // From MediatR\n        public interface IMapper : IServiceWithAnAPI { }            // From AutoMapper\n        public interface IConfiguration : IServiceWithAnAPI { }     // From Microsoft.Extensions.Configuration\n        public interface IBus : IServiceWithAnAPI { }               // From MassTransit\n        public interface IMessageBus : IServiceWithAnAPI { }        // From NServiceBus\n    }\n\n    namespace WellKnownInterfacesNotExcluded\n    {\n        public interface IOption<T> : IServiceWithAnAPI { } // From Microsoft.Extensions.Options\n    }\n\n    namespace ResponsibilitySpecificServices\n    {\n        public interface IS1 : IServiceWithAnAPI { }\n        public interface IS2 : IServiceWithAnAPI { }\n        public interface IS3 : IServiceWithAnAPI { }\n        public interface IS4 : IServiceWithAnAPI { }\n        public interface IS5 : IServiceWithAnAPI { }\n        public interface IS6 : IServiceWithAnAPI { }\n        public interface IS7 : IServiceWithAnAPI { }\n        public interface IS8 : IServiceWithAnAPI { }\n        public interface IS9 : IServiceWithAnAPI { }\n        public interface IS10 : IServiceWithAnAPI { }\n\n        public class Class1: ServiceWithAnApi, IS1 { }\n        public class Class2: ServiceWithAnApi, IS2 { }\n        public class Class3: ServiceWithAnApi, IS3 { }\n        public class Class4: ServiceWithAnApi, IS4 { }\n\n        public class Struct1: IS1 { public void Use() { } }\n        public class Struct2: IS2 { public void Use() { } }\n        public class Struct3: IS3 { public void Use() { } }\n        public class Struct4: IS4 { public void Use() { } }\n    }\n}\n\nnamespace WithInjectionViaPrimaryConstructors\n{\n    using TestInstrumentation.ResponsibilitySpecificServices;\n    using TestInstrumentation.WellKnownInterfacesExcluded;\n    using TestInstrumentation.WellKnownInterfacesNotExcluded;\n    using TestInstrumentation;\n\n    namespace AssertIssueLocationsAndMessage\n    {\n        // Noncompliant@+2 {{This controller has multiple responsibilities and could be split into 2 smaller controllers.}}\n        [ApiController]\n        public class TwoResponsibilities(IS1 s1, IS2 s2) : ControllerBase\n        {\n            public IActionResult A1() { s1.Use(); return Ok(); } // Secondary {{May belong to responsibility #1.}}\n            public IActionResult A2() { s2.Use(); return Ok(); } // Secondary {{May belong to responsibility #2.}}\n        }\n\n        [ApiController]\n        public class WithGenerics<T>(IS1 s1, IS2 s2) : ControllerBase // Noncompliant\n        //           ^^^^^^^^^^^^\n        {\n            public IActionResult GenericAction<U>() { s2.Use(); return Ok(); } // Secondary {{May belong to responsibility #1.}}\n            //                   ^^^^^^^^^^^^^\n            public IActionResult NonGenericAction() { s1.Use(); return Ok(); } // Secondary {{May belong to responsibility #2.}}\n            //                   ^^^^^^^^^^^^^^^^\n        }\n\n        [ApiController]\n        public class @event<T>(IS1 s1, IS2 s2) : ControllerBase // Noncompliant\n        //           ^^^^^^\n        {\n            public IActionResult @private() { s2.Use(); return Ok(); } // Secondary {{May belong to responsibility #1.}}\n            //                   ^^^^^^^^\n            public IActionResult @public() { s1.Use(); return Ok(); }  // Secondary {{May belong to responsibility #2.}}\n            //                   ^^^^^^^\n        }\n\n        [ApiController]\n        public class ThreeResponsibilities(IS1 s1, IS2 s2, IS3 s3) : ControllerBase // Noncompliant\n        //           ^^^^^^^^^^^^^^^^^^^^^\n        {\n            public IActionResult A1() { s1.Use(); return Ok(); } // Secondary {{May belong to responsibility #1.}}\n            public IActionResult A2() { s2.Use(); return Ok(); } // Secondary {{May belong to responsibility #2.}}\n            public IActionResult A3() { s3.Use(); return Ok(); } // Secondary {{May belong to responsibility #3.}}\n        }\n    }\n\n    namespace WithIOptions\n    {\n        // Compliant@+2: 4 deps injected, all well-known => 4 singletons sets, merged into one\n        [ApiController]\n        public class WellKnownDepsController(\n            ILogger<WellKnownDepsController> logger, IMediator mediator, IMapper mapper, IConfiguration configuration) : ControllerBase\n        {\n            public IActionResult A1() { logger.Use(); return Ok(); }\n            public IActionResult A2() { mediator.Use(); return Ok(); }\n            public IActionResult A3() { mapper.Use(); return Ok(); }\n            public IActionResult A4() { configuration.Use(); return Ok(); }\n        }\n\n        // Noncompliant@+2: 4 different Option<T> injected, that are not excluded\n        [ApiController]\n        public class FourDifferentOptionDepsController(\n            IOption<int> o1, IOption<string> o2, IOption<bool> o3, IOption<double> o4) : ControllerBase\n        {\n            public IActionResult A1() { o1.Use(); return Ok(); } // Secondary {{May belong to responsibility #1.}}\n            public IActionResult A2() { o2.Use(); return Ok(); } // Secondary {{May belong to responsibility #2.}}\n            public IActionResult A3() { o3.Use(); return Ok(); } // Secondary {{May belong to responsibility #3.}}\n            public IActionResult A4() { o4.Use(); return Ok(); } // Secondary {{May belong to responsibility #4.}}\n        }\n\n        // Compliant@+2: 5 different Option<T> injected, used in couples to form a single responsibility\n        [ApiController]\n        public class FourDifferentOptionDepsUsedInCouplesController(\n                   IOption<int> o1, IOption<string> o2, IOption<bool> o3, IOption<double> o4, IOption<int> o5) : ControllerBase\n        {\n            public IActionResult A1() { o1.Use(); o2.Use(); return Ok(); }\n            public IActionResult A2() { o2.Use(); o3.Use(); return Ok(); }\n            public IActionResult A3() { o3.Use(); o4.Use(); return Ok(); }\n            public IActionResult A4() { o4.Use(); o5.Use(); return Ok(); }\n        }\n\n        // Noncompliant@+2: 3 Option<T> deps injected, the rest are well-known dependencies (used as well as unused)\n        [ApiController]\n        public class ThreeOptionDepsController(\n            ILogger<ThreeOptionDepsController> logger, IMediator mediator, IMapper mapper, IConfiguration configuration,\n            IOption<int> o1, IOption<string> o2, IOption<bool> o3) : ControllerBase\n        {\n            public IActionResult A1() { o1.Use(); logger.Use(); return Ok(); }        // Secondary {{May belong to responsibility #1.}}\n            public IActionResult A2() { o2.Use(); mediator.Use(); return Ok(); }      // Secondary {{May belong to responsibility #2.}}\n            public IActionResult A3() { o3.Use(); configuration.Use(); return Ok(); } // Secondary {{May belong to responsibility #3.}}\n            public IActionResult A4() { logger.Use(); return Ok(); }\n        }\n    }\n\n    namespace TwoActions\n    {\n        // Noncompliant@+2: 2 specific deps injected, each used in a separate responsibility, plus well-known dependencies\n        [ApiController]\n        public class TwoSeparateResponsibilitiesPlusSharedWellKnown(\n            ILogger<TwoSeparateResponsibilitiesPlusSharedWellKnown> logger, IMediator mediator, IMapper mapper, IConfiguration configuration, IBus bus, IMessageBus messageBus,\n            IS1 s1, IS2 s2) : ControllerBase\n        {\n            public IActionResult A1() { logger.Use(); mediator.Use(); bus.Use(); configuration.Use(); s1.Use(); return Ok(); } // Secondary {{May belong to responsibility #1.}}\n            public IActionResult A2() { mediator.Use(); mapper.Use(); bus.Use(); configuration.Use(); s2.Use(); return Ok(); } // Secondary {{May belong to responsibility #2.}}\n        }\n\n        // Noncompliant@+2: 4 specific deps injected, two for A1 and two for A2\n        [ApiController]\n        public class FourSpecificDepsTwoForA1AndTwoForA2(\n            ILogger<FourSpecificDepsTwoForA1AndTwoForA2> logger, IMediator mediator, IMapper mapper,\n            IS1 s1, IS2 s2, IS3 s3, IS4 s4) : ControllerBase\n        {\n            public IActionResult A1() { logger.Use(); s1.Use(); s2.Use(); return Ok(); }                 // Secondary {{May belong to responsibility #1.}}\n            public IActionResult A2() { mediator.Use(); mapper.Use(); s3.Use(); s4.Use(); return Ok(); } // Secondary {{May belong to responsibility #2.}}\n        }\n\n        // Compliant@+1: 4 specific deps injected, two for A1 and two for A2, in non-API controller derived from Controller\n        public class FourSpecificDepsTwoForA1AndTwoForA2NonApiFromController(\n            ILogger<FourSpecificDepsTwoForA1AndTwoForA2NonApiFromController> logger, IMediator mediator, IMapper mapper,\n            IS1 s1, IS2 s2, IS3 s3, IS4 s4) : Controller\n        {\n            public void A1() { logger.Use(); s1.Use(); s2.Use(); }\n            public void A2() { mediator.Use(); mapper.Use(); s3.Use(); s4.Use(); }\n        }\n\n        // Noncompliant@+1: 4 specific deps injected, two for A1 and two for A2, in non-API controller derived from ControllerBase\n        public class FourSpecificDepsTwoForA1AndTwoForA2NonApiFromControllerBase(\n            ILogger<FourSpecificDepsTwoForA1AndTwoForA2NonApiFromControllerBase> logger, IMediator mediator, IMapper mapper,\n            IS1 s1, IS2 s2, IS3 s3, IS4 s4) : ControllerBase\n        {\n            public void A1() { logger.Use(); s1.Use(); s2.Use(); }                 // Secondary {{May belong to responsibility #1.}}\n            public void A2() { mediator.Use(); mapper.Use(); s3.Use(); s4.Use(); } // Secondary {{May belong to responsibility #2.}}\n        }\n\n        // Compliant@+2: 4 specific deps injected, two for A1 and two for A2, in an API controller marked as NonController\n        [ApiController]\n        [NonController] public class FourSpecificDepsTwoForA1AndTwoForA2NoController(\n            ILogger<FourSpecificDepsTwoForA1AndTwoForA2NoController> logger, IMediator mediator, IMapper mapper,\n            IS1 s1, IS2 s2, IS3 s3, IS4 s4) : ControllerBase\n        {\n            public IActionResult A1() { logger.Use(); s1.Use(); s2.Use(); return Ok(); }\n            public IActionResult A2() { mediator.Use(); mapper.Use(); s3.Use(); s4.Use(); return Ok(); }\n        }\n\n        // Noncompliant@+2: 4 specific deps injected, two for A1 and two for A2, in a PoCo controller with controller suffix\n        [ApiController]\n        public class FourSpecificDepsTwoForA1AndTwoForA2PoCoController(\n            ILogger<FourSpecificDepsTwoForA1AndTwoForA2PoCoController> logger, IMediator mediator, IMapper mapper,\n            IS1 s1, IS2 s2, IS3 s3, IS4 s4) : ControllerBase\n        {\n            public string A1() { logger.Use(); s1.Use(); s2.Use(); return \"Ok\"; }                 // Secondary {{May belong to responsibility #1.}}\n            public string A2() { mediator.Use(); mapper.Use(); s3.Use(); s4.Use(); return \"Ok\"; } // Secondary {{May belong to responsibility #2.}}\n        }\n\n        // Compliant@+1: 4 specific deps injected, two for A1 and two for A2, in a PoCo controller without controller suffix\n        public class PoCoControllerWithoutControllerSuffix(\n            ILogger<PoCoControllerWithoutControllerSuffix> logger, IMediator mediator, IMapper mapper,\n            IS1 s1, IS2 s2, IS3 s3, IS4 s4)\n        {\n            public string A1() { logger.Use(); s1.Use(); s2.Use(); return \"Ok\"; }\n            public string A2() { mediator.Use(); mapper.Use(); s3.Use(); s4.Use(); return \"Ok\"; }\n        }\n\n        // Noncompliant@+3: 4 specific deps injected, two for A1 and two for A2, in a PoCo controller without controller suffix but with [Controller] attribute\n        [ApiController]\n        [Controller]\n        public class PoCoControllerWithoutControllerSuffixWithControllerAttribute(\n            ILogger<PoCoControllerWithoutControllerSuffixWithControllerAttribute> logger, IMediator mediator, IMapper mapper,\n            IS1 s1, IS2 s2, IS3 s3, IS4 s4) : ControllerBase\n        {\n            public string A1() { logger.Use(); s1.Use(); s2.Use(); return \"Ok\"; }                 // Secondary {{May belong to responsibility #1.}}\n            public string A2() { mediator.Use(); mapper.Use(); s3.Use(); s4.Use(); return \"Ok\"; } // Secondary {{May belong to responsibility #2.}}\n        }\n\n        // Noncompliant@+2: 4 specific deps injected, two for A1 and two for A2, with responsibilities in a different order\n        [ApiController]\n        public class FourSpecificDepsTwoForA1AndTwoForA2DifferentOrderOfResponsibilities(\n            ILogger<FourSpecificDepsTwoForA1AndTwoForA2DifferentOrderOfResponsibilities> logger, IMediator mediator, IMapper mapper,\n            IS1 s1, IS2 s2, IS3 s3, IS4 s4) : ControllerBase\n        {\n            public IActionResult A2() { logger.Use(); s1.Use(); s2.Use(); return Ok(); }                 // Secondary {{May belong to responsibility #2.}}\n            public IActionResult A1() { mediator.Use(); mapper.Use(); s3.Use(); s4.Use(); return Ok(); } // Secondary {{May belong to responsibility #1.}}\n        }\n\n        // Noncompliant@+2: 4 specific deps injected, two for A1 and two for A2, with dependencies used in a different order\n        [ApiController]\n        public class FourSpecificDepsTwoForA1AndTwoForA2DifferentOrderOfDependencies(\n            ILogger<FourSpecificDepsTwoForA1AndTwoForA2DifferentOrderOfDependencies> logger, IMediator mediator, IMapper mapper,\n            IS1 s1, IS2 s2, IS3 s3, IS4 s4) : ControllerBase\n        {\n            public IActionResult A1() { logger.Use(); s2.Use(); s1.Use(); return Ok(); }                 // Secondary {{May belong to responsibility #1.}}\n            public IActionResult A2() { mediator.Use(); mapper.Use(); s3.Use(); s4.Use(); return Ok(); } // Secondary {{May belong to responsibility #2.}}\n        }\n\n        // Noncompliant@+2: 4 specific deps injected, three for A1 and one for A2\n        [ApiController]\n        public class FourSpecificDepsThreeForA1AndOneForA2(\n            ILogger<FourSpecificDepsThreeForA1AndOneForA2> logger, IMediator mediator, IMapper mapper,\n            IS1 s1, IS2 s2, IS3 s3, IS3 s4) : ControllerBase\n        {\n            public IActionResult A1() { logger.Use(); s1.Use(); s2.Use(); s3.Use(); return Ok(); } // Secondary {{May belong to responsibility #1.}}\n            public IActionResult A2() { mediator.Use(); mapper.Use(); s4.Use(); return Ok(); }     // Secondary {{May belong to responsibility #2.}}\n        }\n\n        // Compliant@+2: 4 specific deps injected, all for A1 and none for A2\n        [ApiController]\n        public class FourSpecificDepsFourForA1AndNoneForA2(\n            ILogger<FourSpecificDepsFourForA1AndNoneForA2> logger, IMediator mediator, IMapper mapper,\n            IS1 s1, IS2 s2, IS3 s3, IS3 s4) : ControllerBase\n        {\n            public IActionResult A1() { logger.Use(); mediator.Use(); s1.Use(); s2.Use(); s3.Use(); s4.Use(); return Ok(); }\n            public IActionResult A2() { mediator.Use(); mapper.Use(); return Ok(); }\n        }\n\n        // Compliant@+2: 4 specific deps injected, one in common between responsibility 1 and 2\n        [ApiController]\n        public class ThreeSpecificDepsOneInCommonBetweenA1AndA2(\n            ILogger<ThreeSpecificDepsOneInCommonBetweenA1AndA2> logger, IMediator mediator, IMapper mapper,\n            IS1 s1, IS2 s2, IS3 s3) : ControllerBase\n        {\n            public IActionResult A1() { logger.Use(); mediator.Use(); s1.Use(); s2.Use(); return Ok(); }\n            public IActionResult A2() { mediator.Use(); mapper.Use(); s2.Use(); s3.Use(); return Ok(); }\n        }\n    }\n\n    namespace ThreeActions\n    {\n        // Noncompliant@+2: 2 specific deps injected, each used in a separate responsibility\n        [ApiController]\n        public class ThreeResponsibilities(\n            ILogger<ThreeResponsibilities> logger, IMediator mediator, IMapper mapper,\n            IS1 s1, IS2 s2) : ControllerBase\n        {\n            public IActionResult A1() { logger.Use(); mediator.Use(); s1.Use(); return Ok(); } // Secondary {{May belong to responsibility #1.}}\n            public IActionResult A2() { mediator.Use(); mapper.Use(); s2.Use(); return Ok(); } // Secondary {{May belong to responsibility #2.}}\n            public IActionResult A3() { mapper.Use(); return Ok(); }\n        }\n\n        // Noncompliant@+2: 3 specific deps injected, each used in a separate responsibility, possibly multiple times\n        [ApiController]\n        public class UpToThreeSpecificDepsController(\n            ILogger<UpToThreeSpecificDepsController> logger, IMediator mediator, IMapper mapper,\n            IS1 s1, IS2 s2, IS3 s3) : ControllerBase\n        {\n            public IActionResult A1() { logger.Use(); s1.Use(); s1.Use(); return Ok(); }                           // Secondary {{May belong to responsibility #1.}}\n            public IActionResult A2() { logger.Use(); mapper.Use(); s2.Use(); s2.Use(); return Ok(); }             // Secondary {{May belong to responsibility #2.}}\n            public IActionResult A3() { mediator.Use(); mapper.Use(); s3.Use(); s3.Use(); s3.Use(); return Ok(); } // Secondary {{May belong to responsibility #3.}}\n        }\n\n        // Noncompliant@+2: 3 specific deps injected, each used in a separate responsibility\n        [ApiController]\n        public class ThreeResponsibilities2(\n            ILogger<ThreeResponsibilities2> logger, IMediator mediator, IMapper mapper,\n            IS1 s1, IS2 s2, IS3 s3) : ControllerBase\n        {\n            public IActionResult A1() { logger.Use(); mediator.Use(); s1.Use(); return Ok(); } // Secondary {{May belong to responsibility #1.}}\n            public IActionResult A2() { mediator.Use(); mapper.Use(); s2.Use(); return Ok(); } // Secondary {{May belong to responsibility #2.}}\n            public IActionResult A3() { s3.Use(); return Ok(); }                               // Secondary {{May belong to responsibility #3.}}\n        }\n\n        // Noncompliant@+2: 3 specific deps injected, forming a chain and an isolated action\n        [ApiController]\n        public class ThreeSpecificDepsFormingAChainAndAnIsolatedAction(\n            ILogger<ThreeSpecificDepsFormingAChainAndAnIsolatedAction> logger, IMediator mediator, IMapper mapper,\n            IS1 s1, IS2 s2, IS3 s3) : ControllerBase\n        {\n            // Chain: A1, A2 with s1 and s2\n            public IActionResult A1() { logger.Use(); mediator.Use(); s1.Use(); s2.Use(); return Ok(); } // Secondary {{May belong to responsibility #1.}}\n            public IActionResult A2() { mediator.Use(); mapper.Use(); s2.Use(); return Ok(); }           // Secondary {{May belong to responsibility #1.}}\n            // Isolated: A3 with s3\n            public IActionResult A3() { s3.Use(); return Ok(); }                                         // Secondary {{May belong to responsibility #2.}}\n        }\n\n        // Noncompliant@+2: 4 specific deps injected, two for A1, one for A2, and one for A3\n        [ApiController]\n        public class FourSpecificDepsTwoForA1OneForA2AndOneForA3(\n            ILogger<FourSpecificDepsTwoForA1OneForA2AndOneForA3> logger, IMediator mediator, IMapper mapper,\n            IS1 s1, IS2 s2, IS3 s3, IS4 s4) : ControllerBase\n        {\n            public IActionResult A1() { logger.Use(); mediator.Use(); s1.Use(); s2.Use(); return Ok(); } // Secondary {{May belong to responsibility #1.}}\n            public IActionResult A2() { mediator.Use(); mapper.Use(); s3.Use(); return Ok(); }           // Secondary {{May belong to responsibility #2.}}\n            public IActionResult A3() { s4.Use(); return Ok(); }                                         // Secondary {{May belong to responsibility #3.}}\n        }\n\n        // Noncompliant@+2: 4 specific deps injected, one for A1, one for A2, one for A3, one unused\n        [ApiController]\n        public class FourSpecificDepsOneForA1OneForA2OneForA3OneUnused(\n            ILogger<FourSpecificDepsOneForA1OneForA2OneForA3OneUnused> logger, IMediator mediator, IMapper mapper,\n            IS1 s1, IS2 s2, IS3 s3, IS4 s4) : ControllerBase\n        {\n            public IActionResult A1() { logger.Use(); mediator.Use(); s1.Use(); return Ok(); } // Secondary {{May belong to responsibility #1.}}\n            public IActionResult A2() { mediator.Use(); mapper.Use(); s2.Use(); return Ok(); } // Secondary {{May belong to responsibility #2.}}\n            public IActionResult A3() { s3.Use(); return Ok(); }                               // Secondary {{May belong to responsibility #3.}}\n        }\n\n        // Compliant@+2: 4 specific deps injected, forming a single 3-cycle\n        [ApiController]\n        public class FourSpecificDepsFormingACycle(\n            ILogger<FourSpecificDepsFormingACycle> logger, IMediator mediator, IMapper mapper,\n            IS1 s1, IS2 s2, IS3 s3, IS4 s4) : ControllerBase\n        {\n            // Cycle: A1, A2, A3\n            public IActionResult A1() { logger.Use(); mediator.Use(); s1.Use(); s2.Use(); return Ok(); }\n            public IActionResult A2() { mediator.Use(); mapper.Use(); s2.Use(); s3.Use(); return Ok(); }\n            public IActionResult A3() { s3.Use(); s4.Use(); s1.Use(); return Ok(); }\n        }\n    }\n\n    namespace SixActions\n    {\n        // Noncompliant@+2: 6 specific deps injected, forming 2 disconnected 3-cycles\n        [ApiController]\n        public class FourSpecificDepsFormingTwoDisconnectedCycles(\n            IS1 s1, IS2 s2, IS3 s3, IS4 s4, IS5 s5, IS6 s6) : ControllerBase\n        {\n            // Cycle 1: A1, A2, A3\n            public IActionResult A1() { s1.Use(); s2.Use(); return Ok(); } // Secondary {{May belong to responsibility #1.}}\n            public IActionResult A2() { s2.Use(); s3.Use(); return Ok(); } // Secondary {{May belong to responsibility #1.}}\n            public IActionResult A3() { s3.Use(); s1.Use(); return Ok(); } // Secondary {{May belong to responsibility #1.}}\n            // Cycle 2: A4, A5, A6 (disconnected from cycle 1)\n            public IActionResult A4() { s4.Use(); s5.Use(); return Ok(); } // Secondary {{May belong to responsibility #2.}}\n            public IActionResult A5() { s5.Use(); s6.Use(); return Ok(); } // Secondary {{May belong to responsibility #2.}}\n            public IActionResult A6() { s6.Use(); s4.Use(); return Ok(); } // Secondary {{May belong to responsibility #2.}}\n        }\n\n        // Compliant@+2: 5 specific deps injected, forming 2 connected 3-cycles\n        [ApiController]\n        public class FourSpecificDepsFormingTwoConnectedCycles(\n            IS1 s1, IS2 s2, IS3 s3, IS4 s4, IS5 s5) : ControllerBase\n        {\n            // Cycle 1: A1, A2, A3\n            public IActionResult A1() { s1.Use(); s2.Use(); return Ok(); }\n            public IActionResult A2() { s2.Use(); s3.Use(); return Ok(); }\n            public IActionResult A3() { s3.Use(); s1.Use(); return Ok(); }\n            // Cycle 2: A4, A5, A6 (connected to cycle 1 via s1)\n            public IActionResult A4() { s1.Use(); s4.Use(); return Ok(); }\n            public IActionResult A5() { s4.Use(); s5.Use(); return Ok(); }\n            public IActionResult A6() { s5.Use(); s1.Use(); return Ok(); }\n        }\n\n        // Compliant@+2: 4 specific deps injected, forming 2 3-cycles, connected by two dependencies (s1 and s2)\n        [ApiController]\n        public class FourSpecificDepsFormingTwoConnectedCycles2(\n            IS1 s1, IS2 s2, IS3 s3, IS4 s4) : ControllerBase\n        {\n            // Cycle 1: A1, A2, A3\n            public IActionResult A1() { s1.Use(); s2.Use(); return Ok(); }\n            public IActionResult A2() { s2.Use(); s3.Use(); return Ok(); }\n            public IActionResult A3() { s3.Use(); s1.Use(); return Ok(); }\n            // Cycle 2: A4, A5, A6\n            public IActionResult A4() { s1.Use(); s2.Use(); return Ok(); }\n            public IActionResult A5() { s2.Use(); s4.Use(); return Ok(); }\n            public IActionResult A6() { s4.Use(); s1.Use(); return Ok(); }\n        }\n\n        // Compliant@+2: 4 specific deps injected, forming 2 3-cycles, connected by action invocations\n        [ApiController]\n        public class FourSpecificDepsFormingTwoConnectedCycles3(\n            IS1 s1, IS2 s2, IS3 s3, IS4 s4, IS5 s5, IS6 s6) : ControllerBase\n        {\n            // Cycle 1: A1, A2, A3\n            public IActionResult A1() { s1.Use(); s2.Use(); return Ok(); }\n            public IActionResult A2() { s2.Use(); s3.Use(); return Ok(); }\n            public IActionResult A3() { s3.Use(); s1.Use(); return Ok(); }\n            // Cycle 2: A4, A5, A6, connected to cycle 1 via A1 invocation\n            public IActionResult A4() { A1(); s4.Use(); return Ok(); }\n            public IActionResult A5() { s5.Use(); s6.Use(); return Ok(); }\n            public IActionResult A6() { s6.Use(); s4.Use(); return Ok(); }\n        }\n\n        // Noncompliant@+2: 6 specific deps injected, forming 3 disconnected 2-cycles\n        [ApiController]\n        public class FourSpecificDepsFormingThreeDisconnectedCycles(\n            IS1 s1, IS2 s2, IS3 s3, IS4 s4, IS5 s5, IS6 s6) : ControllerBase\n        {\n            // Cycle 1: A1, A2\n            public IActionResult A1() { s1.Use(); s2.Use(); return Ok(); } // Secondary {{May belong to responsibility #1.}}\n            public IActionResult A2() { s2.Use(); s1.Use(); return Ok(); } // Secondary {{May belong to responsibility #1.}}\n            // Cycle 2: A3, A4\n            public IActionResult A3() { s3.Use(); s4.Use(); return Ok(); } // Secondary {{May belong to responsibility #2.}}\n            public IActionResult A4() { s4.Use(); s3.Use(); return Ok(); } // Secondary {{May belong to responsibility #2.}}\n            // Cycle 3: A5, A6\n            public IActionResult A5() { s5.Use(); s6.Use(); return Ok(); } // Secondary {{May belong to responsibility #3.}}\n            public IActionResult A6() { s6.Use(); s5.Use(); return Ok(); } // Secondary {{May belong to responsibility #3.}}\n        }\n\n        // Noncompliant@+2: 6 specific deps injected, forming 2 connected 2-cycles and 1 disconnected 2-cycle\n        [ApiController]\n        public class FourSpecificDepsFormingTwoConnectedCyclesAndOneDisconnectedCycle(\n            IS1 s1, IS2 s2, IS3 s3, IS4 s4, IS5 s5, IS6 s6) : ControllerBase\n        {\n            // Cycle 1: A1, A2\n            public IActionResult A1() { s1.Use(); s2.Use(); return Ok(); }       // Secondary {{May belong to responsibility #1.}}\n            public IActionResult A2() { s2.Use(); s1.Use(); return Ok(); }       // Secondary {{May belong to responsibility #1.}}\n            // Cycle 2: A3, A4, connected to cycle 1 via A1 invocation\n            public IActionResult A3() { A1(); s3.Use(); s4.Use(); return Ok(); } // Secondary {{May belong to responsibility #1.}}\n            public IActionResult A4() { s4.Use(); s3.Use(); return Ok(); }       // Secondary {{May belong to responsibility #1.}}\n            // Cycle 3: A5, A6\n            public IActionResult A5() { s5.Use(); s6.Use(); return Ok(); }       // Secondary {{May belong to responsibility #2.}}\n            public IActionResult A6() { s6.Use(); s5.Use(); return Ok(); }       // Secondary {{May belong to responsibility #2.}}\n        }\n\n        // Compliant@+2: 6 specific deps injected, forming 3 connected 2-cycles\n        [ApiController]\n        public class FourSpecificDepsFormingThreeConnectedCycles(\n            IS1 s1, IS2 s2, IS3 s3, IS4 s4, IS5 s5, IS6 s6) : ControllerBase\n        {\n            // Cycle 1: A1, A2\n            public IActionResult A1() { s1.Use(); s2.Use(); return Ok(); }\n            public IActionResult A2() { s2.Use(); s1.Use(); return Ok(); }\n            // Cycle 2: A3, A4, connected to cycle 1 via A1 invocation\n            public IActionResult A3() { A1(); s3.Use(); s4.Use(); return Ok(); }\n            public IActionResult A4() { s4.Use(); s3.Use(); return Ok(); }\n            // Cycle 3: A5, A6, connected to cycle 1 via A2 invocation\n            public IActionResult A5() { A2(); s5.Use(); s6.Use(); return Ok(); }\n            public IActionResult A6() { s6.Use(); s5.Use(); return Ok(); }\n        }\n\n        // Compliant@+2: 6 specific deps injected, forming 3 connected 2-cycles - transitivity of connection\n        [ApiController]\n        public class FourSpecificDepsFormingThreeConnectedCyclesTransitivity(\n                       IS1 s1, IS2 s2, IS3 s3, IS4 s4, IS5 s5, IS6 s6) : ControllerBase\n        {\n            // Cycle 1: A1, A2\n            public IActionResult A1() { s1.Use(); s2.Use(); return Ok(); }\n            public IActionResult A2() { s2.Use(); s1.Use(); return Ok(); }\n            // Cycle 2: A3, A4, connected to cycle 1 via A1 invocation\n            public IActionResult A3() { A1(); s3.Use(); s4.Use(); return Ok(); }\n            public IActionResult A4() { s4.Use(); s3.Use(); return Ok(); }\n            // Cycle 3: A5, A6, connected to cycle 1 via A2 invocation\n            public IActionResult A5() { A3(); s5.Use(); s6.Use(); return Ok(); }\n            public IActionResult A6() { s6.Use(); s5.Use(); return Ok(); }\n        }\n    }\n}\n\nnamespace WithInjectionViaNormalConstructor\n{\n    using TestInstrumentation.ResponsibilitySpecificServices;\n    using TestInstrumentation.WellKnownInterfacesExcluded;\n    using TestInstrumentation.WellKnownInterfacesNotExcluded;\n    using TestInstrumentation;\n\n    [ApiController]\n    public class WithFields : ControllerBase // Noncompliant\n    {\n        private readonly IS1 s1;\n        private IS2 s2;\n\n        public WithFields(IS1 s1, IS2 s2) { this.s1 = s1; this.s2 = s2; }\n\n        public void A1() { s1.Use(); } // Secondary {{May belong to responsibility #1.}}\n        public void A2() { s2.Use(); } // Secondary {{May belong to responsibility #2.}}\n    }\n\n    [ApiController]\n    public class WithDifferentVisibilities : ControllerBase // Noncompliant\n    {\n        private IS1 s1;\n        protected IS2 s2;\n        internal IS3 s3;\n        private protected IS4 s4;\n        protected internal IS5 s5;\n        public IS6 s6;\n\n        public WithDifferentVisibilities(IS1 s1, IS2 s2, IS3 s3, IS4 s4, IS5 s5, IS6 s6)\n        {\n            this.s1 = s1; this.s2 = s2; this.s3 = s3; this.s4 = s4; this.s5 = s5; this.s6 = s6;\n        }\n\n        private void A1() { s1.Use(); s2.Use(); }            // Secondary {{May belong to responsibility #1.}}\n        protected void A2() { s2.Use(); s1.Use(); }          // Secondary {{May belong to responsibility #1.}}\n        internal void A3() { s3.Use(); s4.Use(); }           // Secondary {{May belong to responsibility #2.}}\n        private protected void A4() { s4.Use(); s3.Use(); }  // Secondary {{May belong to responsibility #2.}}\n        protected internal void A5() { s5.Use(); s6.Use(); } // Secondary {{May belong to responsibility #3.}}\n        public void A6() { s6.Use(); s5.Use(); }             // Secondary {{May belong to responsibility #3.}}\n    }\n\n    [ApiController]\n    public class WithStaticFields : ControllerBase // Compliant, we don't take into account static fields and methods.\n    {\n        private static IS1 s1;\n        private static IS2 s2 = null;\n\n        public WithStaticFields(IS1 s1, IS2 s2) { WithStaticFields.s1 = s1; WithStaticFields.s2 = s2; }\n\n        static WithStaticFields() { s1 = S1.Instance; }\n\n        public void A1() { s1.Use(); }\n        public void A2() { s2.Use(); }\n\n        class S1 : IS1 { public void Use() { } public static IS1 Instance => new S1(); }\n    }\n\n    [ApiController]\n    public class WithAutoProperties : ControllerBase // Noncompliant\n    {\n        public IS1 S1 { get; }\n        public IS2 S2 { get; set; }\n        protected IS3 S3 { get; init; }\n        private ILogger<WithAutoProperties> S4 { get; init; } // Well-known\n\n        public WithAutoProperties(IS1 s1, IS2 s2, IS3 s3) { S1 = s1; S2 = s2; S3 = s3; }\n\n        public void A1() { S1.Use(); }           // Secondary {{May belong to responsibility #1.}}\n        public void A2() { S2.Use(); }           // Secondary {{May belong to responsibility #2.}}\n        public void A3() { S3.Use(); S2.Use(); } // Secondary {{May belong to responsibility #2.}}\n        public void A4() { S4.Use(); }           // Only well-known service used => Ignored\n    }\n\n    [ApiController]\n    public class WithFieldBackedProperties : ControllerBase // Noncompliant\n    {\n        private IS1 _s1;\n        private IS2 _s2;\n\n        public IS1 S1 { get => _s1; }\n        public IS2 S2 { get => _s2; init => _s2 = value; }\n\n        public WithFieldBackedProperties(IS1 s1, IS2 s2) { _s1 = s1; _s2 = s2; }\n\n        public void A1() { S1.Use(); } // Secondary {{May belong to responsibility #1.}}\n        public void A2() { S2.Use(); } // Secondary {{May belong to responsibility #2.}}\n    }\n\n    [ApiController]\n    public class WithMixedStorageMechanismsAndPropertyDependency : ControllerBase // Compliant: single responsibility\n    {\n        // Property dependency: A3 -> S3 -> { _s3, _s1 }\n        private IS1 _s1;\n        private IS3 _s3;\n\n        public IS2 S2 { get; set; }\n        public IS3 S3 { get => _s3; set { _s3 = value; _s1 = default; } }\n\n        public WithMixedStorageMechanismsAndPropertyDependency(IS1 s1, IS2 s2, IS3 s3) { _s1 = s1; S2 = s2; _s3 = s3; }\n\n        public void A1() { _s1.Use(); S2.Use(); }\n        public void A2() { S2.Use(); S3.Use(); }\n        public void A3() { S3.Use(); }\n    }\n\n    [ApiController]\n    public class WithMixedStorageMechanismsAndPropertyDependencyTransitivity : ControllerBase\n    {\n        // Property dependency transitivity: A4 -> S4 -> { _s4, S3 } -> { _s4, _s3, S2 }\n        private IS1 _s1;\n        private IS3 _s3;\n        private IS4 _s4;\n\n        public IS2 S2 { get; set; }\n        public IS3 S3 { get => _s3; set { _s3 = value; S2 = default; } } // Also resets S2\n        public IS4 S4 { get => _s4; set { _s4 = value; S3 = default; } } // Also resets S3\n\n        public WithMixedStorageMechanismsAndPropertyDependencyTransitivity(IS1 s1, IS2 s2, IS3 s3, IS4 s4)\n        { _s1 = s1; S2 = s2; _s3 = s3; _s4 = s4; }\n\n        public void A1() { _s1.Use(); S2.Use(); }\n        public void A2() { S2.Use(); S3.Use(); }\n        public void A3() { S3.Use(); _s1.Use(); }\n        public void A4() { S4.Use(); }\n    }\n\n    [ApiController]\n    public class WithLambdaCapturingService : ControllerBase // Noncompliant: s1Provider and s2Provider explicitly wrap services\n    {\n        private readonly Func<IS1> s1Provider;\n        private readonly Func<int, IS2> s2Provider;\n\n        public WithLambdaCapturingService(IS1 s1, IS2 s2) { s1Provider = () => s1; s2Provider = x => s2; }\n\n        public void A1() { s1Provider().Use(); }   // Secondary {{May belong to responsibility #1.}}\n        public void A2() { s2Provider(42).Use(); } // Secondary {{May belong to responsibility #2.}}\n    }\n\n    [ApiController]\n    public class WithNonPublicConstructor : ControllerBase // Noncompliant: ctor visibility is irrelevant\n    {\n        private readonly IS1 s1;\n        protected IS2 S2 { get; init; }\n\n        private WithNonPublicConstructor(IS1 s1, IS2 s2) { this.s1 = s1; this.S2 = s2; }\n\n        public void A1() { s1.Use(); s1.Use(); } // Secondary {{May belong to responsibility #1.}}\n        public void A2() { S2.Use(); }           // Secondary {{May belong to responsibility #2.}}\n    }\n\n    [ApiController]\n    public class WithCtorNotInitializingInjectedServices : ControllerBase // Noncompliant: initialization is irrelevant\n    {\n        private readonly IS1 s1;\n        internal IS2 s2;\n\n        public WithCtorNotInitializingInjectedServices(IS1 s1, IS2 s2) { }\n\n        public void A1() { s1.Use(); } // Secondary {{May belong to responsibility #1.}}\n        public void A2() { s2.Use(); } // Secondary {{May belong to responsibility #2.}}\n    }\n\n    [ApiController]\n    public class WithServicesNotInjectedAtAll : ControllerBase // Noncompliant: ctor injection is irrelevant\n    {\n        private IS1 s1;\n        private IS2 s2;\n\n        public WithServicesNotInjectedAtAll() { }\n\n        public void A1() { s1.Use(); } // Secondary {{May belong to responsibility #1.}}\n        public void A2() { s2.Use(); } // Secondary {{May belong to responsibility #2.}}\n    }\n\n    [ApiController]\n    public class WithServicesInitializedWithServiceProvider : ControllerBase // Noncompliant: service locator pattern is irrelevant\n    {\n        private readonly IS1 s1;\n        private readonly IS2 s2;\n\n        public WithServicesInitializedWithServiceProvider(IServiceProvider serviceProvider)\n        {\n            s1 = serviceProvider.GetRequiredService<IS1>();\n            s2 = serviceProvider.GetRequiredService<IS2>();\n        }\n\n        public void A1() { s1.Use(); } // Secondary {{May belong to responsibility #1.}}\n        public void A2() { s2.Use(); } // Secondary {{May belong to responsibility #2.}}\n    }\n\n    [ApiController]\n    public class WithServicesInitializedWithSingletons : ControllerBase // Noncompliant: singleton pattern is irrelevant\n    {\n        private readonly IS1 s1 = S1.Instance;\n        private readonly IS2 s2 = S2.Instance;\n\n        public void A1() { s1.Use(); } // Secondary {{May belong to responsibility #1.}}\n        public void A2() { s2.Use(); } // Secondary {{May belong to responsibility #2.}}\n\n        class S1 : IS1 { public void Use() { } public static IS1 Instance => new S1(); }\n        class S2 : IS2 { public void Use() { } public static IS2 Instance => new S2(); }\n    }\n\n    [ApiController]\n    public class WithServicesInitializedWithMixedStrategies : ControllerBase // Noncompliant\n    {\n        private readonly IS1 s1;\n        private readonly IS2 s2 = S2.Instance;\n        private readonly IS3 s3;\n\n        public WithServicesInitializedWithMixedStrategies(IS1 s1, IServiceProvider serviceProvider)\n        {\n            this.s1 = s1;\n            s3 = serviceProvider.GetRequiredService<IS3>();\n        }\n\n        public void A1() { s1.Use(); } // Secondary {{May belong to responsibility #1.}}\n        public void A2() { s2.Use(); } // Secondary {{May belong to responsibility #2.}}\n        public void A3() { s3.Use(); } // Secondary {{May belong to responsibility #3.}}\n\n        class S2 : IS2 { public void Use() { } public static IS2 Instance => new S2(); }\n    }\n\n    [ApiController]\n    public class WithAWellKnownInterfaceIncluded : ControllerBase // Noncompliant\n    {\n        private ILogger<WithAWellKnownInterfaceIncluded> Logger { get; }\n        private readonly IS1 s1;\n        private readonly IS2 s2 = S2.Instance;\n        private readonly IS3 s3;\n\n        public WithAWellKnownInterfaceIncluded(ILogger<WithAWellKnownInterfaceIncluded> logger, IS1 s1, IServiceProvider serviceProvider)\n        {\n            Logger = logger;\n            this.s1 = s1;\n            s3 = serviceProvider.GetRequiredService<IS3>();\n        }\n\n        public void A1() { Logger.Use(); s1.Use(); } // Secondary {{May belong to responsibility #1.}}\n        public void A2() { Logger.Use(); s2.Use(); } // Secondary {{May belong to responsibility #2.}}\n        public void A3() { Logger.Use(); s3.Use(); } // Secondary {{May belong to responsibility #3.}}\n\n        class S2 : IS2 { public void Use() { } public static IS2 Instance => new S2(); }\n    }\n}\n\n[ApiController]\npublic class WithHttpClientFactory : ControllerBase // Noncompliant\n{\n    private readonly IHttpClientFactory _httpClientFactory; // Well-known\n    private readonly IS1 s1;\n    private readonly IS2 s2;\n\n    public void A1() { _httpClientFactory.Use(); s1.Use(); } // Secondary {{May belong to responsibility #1.}}\n    public void A2() { _httpClientFactory.Use(); s2.Use(); } // Secondary {{May belong to responsibility #2.}}\n    public void A3() { _httpClientFactory.Use(); }\n}\n\n[ApiController]\npublic class WithUseInComplexBlocks : ControllerBase // Noncompliant\n{\n    IS1 s1; IS2 s2; IS3 s3; IS4 s4; IS5 s5; IS6 s6; IS7 s7; IS8 s8; IS9 s9; IS10 s10;\n\n    public void If()     // Secondary {{May belong to responsibility #2.}}\n    {\n        if (true) { s1.Use(); } else { if (false) { s2.Use(); } }\n    }\n\n    public void Switch() // Secondary {{May belong to responsibility #2.}}\n    {\n        switch (0) { case 0: s2.Use(); break; case 1: s3.Use(); break; }\n    }\n\n    public void For()    // Secondary {{May belong to responsibility #2.}}\n    {\n        for (int i = 0; i < 1; i++) { s1.Use(); s3.Use(); }\n    }\n\n    public void TryCatchFinally()      // Secondary {{May belong to responsibility #3.}}\n    {\n        try { s4.Use(); } catch { s5.Use(); } finally { try { s6.Use(); } catch { s4.Use(); } }\n    }\n\n    public void Using()                // Secondary {{May belong to responsibility #3.}}\n    {\n        using (new ADisposable()) { s5.Use(); s7.Use(); }\n    }\n\n    public void BlocksAndParentheses() // Secondary {{May belong to responsibility #1.}}\n    {\n        { { ((s8)).Use(); } }\n    }\n\n    public void NestedLocalFunctions() // Secondary {{May belong to responsibility #1.}}\n    {\n        void LocalFunction()\n        {\n            void NestedLocalFunction() { s8.Use(); }\n            s9.Use();\n        }\n\n        LocalFunction();\n        StaticLocalFunction(s10);\n\n        static void StaticLocalFunction(IS10 s10) { s10.Use(); }\n    }\n\n    class ADisposable : IDisposable { public void Dispose() { } }\n}\n\n[ApiController]\npublic class WithMethodsDependingOnEachOther : ControllerBase // Noncompliant\n{\n    IS1 s1; IS2 s2; IS3 s3; IS4 s4; IS5 s5; IS6 s6; IS7 s7;\n\n    // Chain: A2 to A1\n    void A1() { s1.Use(); }            // Secondary {{May belong to responsibility #1.}}\n    void A2() { s2.Use(); A1(); }      // Secondary {{May belong to responsibility #1.}}\n    void A3() { s2.Use(); }            // Secondary {{May belong to responsibility #1.}}\n    // 1-cycle A4 => no service used => ignore\n    void A4() { A4(); }\n    // 2-cycle A5, A6 => no service used => ignore\n    void A5() { A6(); }\n    void A6() { A5(); }\n    // 3-cycle A7, A8, A9 => no service used => ignore\n    void A7() { A8(); }\n    void A8() { A9(); }\n    void A9() { A7(); }\n    // 3-cycle A10, A11, A12 with A13 depending on A12 via s3\n    void A10() { A11(); }              // Secondary {{May belong to responsibility #2.}}\n    void A11() { A12(); }              // Secondary {{May belong to responsibility #2.}}\n    void A12() { A10(); s3.Use(); }    // Secondary {{May belong to responsibility #2.}}\n    void A13() { s3.Use(); }           // Secondary {{May belong to responsibility #2.}}\n    // 3-cycle A14, A15, A16 with chain A18 -> A15 via s4\n    void A14() { A15(); s4.Use(); }    // Secondary {{May belong to responsibility #3.}}\n    void A15() { A16(); }              // Secondary {{May belong to responsibility #3.}}\n    void A16() { A14(); }              // Secondary {{May belong to responsibility #3.}}\n    void A17() { s4.Use(); }           // Secondary {{May belong to responsibility #3.}}\n    // Independent method => no service used => ignore\n    void A18() { }\n    // Independent method with its own service\n    void A19() { s5.Use(); }           // Secondary {{May belong to responsibility #4.}}\n    // Two actions calling a third one\n    void A20() { A22(); }              // Secondary {{May belong to responsibility #5.}}\n    void A21() { A22(); }              // Secondary {{May belong to responsibility #5.}}\n    void A22() { s6.Use(); s7.Use(); } // Secondary {{May belong to responsibility #5.}}\n}\n\n[ApiController]\npublic class WithServiceProvidersInjectionCoupled : ControllerBase // Compliant: s1Provider and s2Provider are known to provide services\n{\n    private readonly Func<IS1> s1Provider;\n    private readonly Func<int, IS2> s2Provider;\n\n    public WithServiceProvidersInjectionCoupled(Func<IS1> s1Provider, Func<int, IS2> s2Provider)\n    {\n        this.s1Provider = s1Provider;\n        this.s2Provider = s2Provider;\n    }\n\n    public void A1() { s1Provider().Use(); var s2 = s2Provider(42); s2.Use(); }\n    public void A2() { (s2Provider(42)).Use(); }\n}\n\n[ApiController]\npublic class ApiController : ControllerBase { }\n\npublic class DoesNotInheritDirectlyFromControllerBase(IS1 s1, IS2 s2) : ApiController // Compliant, we report only in classes that inherit directly from ControllerBase\n{\n    public IActionResult A1() { s1.Use(); return Ok(); }\n    public IActionResult A2() { s2.Use(); return Ok(); }\n}\n\npublic class InheritsFromController(IS1 s1, IS2 s2) : Controller // Compliant, we report only in classes that inherit directly from ControllerBase\n{\n    public IActionResult A1() { s1.Use(); return Ok(); }\n    public IActionResult A2() { s2.Use(); return Ok(); }\n}\n\npublic abstract class AbstractController (IS1 s1, IS2 s2) : ControllerBase // Compliant, we don't report on abstract controllers\n{\n    public IActionResult A1() { s1.Use(); return Ok(); }\n    public IActionResult A2() { s2.Use(); return Ok(); }\n    public abstract IActionResult A3();\n}\n\n\n[ApiController]\npublic class WithServiceProvidersInjectionUsedInGroups : ControllerBase // Noncompliant\n{\n    private IS1 _s1;\n    private Func<bool, uint, Func<double>, IS5> _s5Provider;\n\n    private Func<IS2> S2Provider { get; }\n    private Func<int, IS3> S3Provider => i => null;\n    private Func<string, char, IS4> S4Provider { get; set; } = (s, c) => null;\n    private Func<bool, uint, Func<double>, IS5> S5Provider => _s5Provider;\n\n    public void A1() { _s1.Use(); }                                                             // Secondary {{May belong to responsibility #1.}}\n    public void A2() { S2Provider().Use(); S3Provider(42).Use(); }                              // Secondary {{May belong to responsibility #3.}}\n    public void A3() { S3Provider(42).Use(); }                                                  // Secondary {{May belong to responsibility #3.}}\n    public void A4() { S4Provider(\"42\", '4').Use(); _s5Provider(false, 3u, () => 42.0).Use(); } // Secondary {{May belong to responsibility #2.}}\n    public void A5() { _s5Provider(true, 3u, () => 42.0).Use(); }                               // Secondary {{May belong to responsibility #2.}}\n    public void A6() { S5Provider(true, 3u, () => 42.0).Use(); }                                // Secondary {{May belong to responsibility #2.}}\n}\n\n[ApiController]\npublic class WithServiceWrappersInjection : ControllerBase // Compliant: no way to know whether s2Invoker wraps a service\n{\n    private readonly Func<IS1> s1Provider;\n    private readonly Action s2Invoker;\n\n    public WithServiceWrappersInjection(Func<IS1> s1Provider, Action s2Invoker)\n    {\n        this.s1Provider = s1Provider;\n        this.s2Invoker = s2Invoker;\n    }\n\n    public void A1() { s1Provider().Use(); s2Invoker(); }\n    public void A2() { s2Invoker(); }\n}\n\n[ApiController]\npublic class WithLazyServicesInjection : ControllerBase // Noncompliant\n{\n    private readonly Lazy<IS1> s1Lazy;\n    private readonly Lazy<IS2> s2Lazy;\n    private readonly Lazy<IS3> s3Lazy;\n    private readonly IS4 s4;\n\n    public void A1() { s1Lazy.Value.Use(); s2Lazy.Value.Use(); } // Secondary {{May belong to responsibility #1.}}\n    public void A2() { s2Lazy.Value.Use(); s4.Use(); }           // Secondary {{May belong to responsibility #1.}}\n    public void A3() { s3Lazy.Value.Use(); }                     // Secondary {{May belong to responsibility #2.}}\n}\n\n[ApiController]\npublic class WithMixOfLazyServicesAndServiceProviders : ControllerBase // Noncompliant\n{\n    private readonly Lazy<IS1> s1Lazy;\n    private readonly Lazy<IS2> s2Lazy;\n    private readonly IS3 s3;\n    private readonly IS4 s4;\n    private readonly Func<IS5> s5Provider;\n    private readonly Func<IS6> s6Provider;\n\n    public void A1() { s1Lazy.Value.Use(); s3.Use(); }                                                  // Secondary {{May belong to responsibility #1.}}\n    public void A2() { s1Lazy.Value.Use(); s2Lazy.Value.Use(); }                                        // Secondary {{May belong to responsibility #1.}}\n    public void A3() { s4.Use(); var s5 = s5Provider(); s5.Use(); }                                     // Secondary {{May belong to responsibility #2.}}\n    public void A4() { s5Provider().Use(); var s6ProviderAlias = s6Provider(); s6ProviderAlias.Use(); } // Secondary {{May belong to responsibility #2.}}\n}\n\n[ApiController]\npublic class WithIApi : ControllerBase // Compliant\n{\n    private readonly IApi _api;\n\n    public WithIApi(IApi api) { _api = api; }\n\n    public void A1() { _api.Use(); }\n    public void A2() { _api.Use(); }\n\n    public interface IApi : IServiceWithAnAPI { }\n}\n\n[ApiController]\npublic class WithUnusedServices : ControllerBase // Compliant\n{\n    private readonly IS1 s1;\n    private readonly IS2 s2;\n    private readonly IS3 s3;\n    private readonly IS4 s4;\n\n    public void A1() { }\n    public void A2() { }\n    public void A3() { }\n    public void A4() { }\n}\n\n[ApiController]\npublic class WithUnusedAndUsedServicesFormingTwoGroups : ControllerBase // Compliant\n{\n    // s2, s3 and s4 form a non-singleton, but no action use any of them => the set is filtered out\n    private readonly IS1 s1;\n    private readonly IS2 s2;\n    private readonly IS3 s3;\n    private readonly IS4 s4;\n\n    public void A1() { s1.Use(); }\n}\n\n[ApiController]\npublic class WithUnusedAndUsedServicesFormingThreeGroups : ControllerBase // Noncompliant {{This controller has multiple responsibilities and could be split into 3 smaller controllers.}}\n{\n    private readonly IS1 s1;\n    private readonly IS2 s2;\n    private readonly IS3 s3;\n    private readonly IS4 s4;\n\n    public void A2() { s2.Use(); } // Secondary {{May belong to responsibility #1.}}\n    public void A3() { s3.Use(); } // Secondary {{May belong to responsibility #2.}}\n    public void A4() { s4.Use(); } // Secondary {{May belong to responsibility #3.}}\n}\n\n[ApiController]\npublic class WithMethodOverloads : ControllerBase // Noncompliant\n{\n    private readonly IS1 s1;\n    private readonly IS2 s2;\n    private readonly IS3 s3;\n    private readonly IS4 s4;\n    private readonly IS5 s5;\n    private readonly IS6 s6;\n\n    public void A1() { s1.Use(); }                // Secondary {{May belong to responsibility #1.}}\n    public void A1(int i) { s2.Use(); }           // Secondary {{May belong to responsibility #1.}}\n    public void A1(string s) { s3.Use(); }        // Secondary {{May belong to responsibility #1.}}\n    public void A1(int i, string s) { s4.Use(); } // Secondary {{May belong to responsibility #1.}}\n    public void A2() { s5.Use(); }                // Secondary {{May belong to responsibility #2.}}\n    public void A2(int i) { s6.Use(); }           // Secondary {{May belong to responsibility #2.}}\n}\n\n[ApiController]\npublic class WithIndexer : ControllerBase // Noncompliant\n{\n    private readonly IS1 s1;\n    private readonly IS2 s2;\n    private readonly IS3 s3;\n\n    public int this[int i] { get { s1.Use(); return 42; } set { s2.Use(); } } // Clamp A1 and A2 together\n\n    public void A1() { s1.Use(); } // Secondary {{May belong to responsibility #1.}}\n    public void A2() { s2.Use(); } // Secondary {{May belong to responsibility #1.}}\n    public void A3() { s3.Use(); } // Secondary {{May belong to responsibility #2.}}\n}\n\n[ApiController]\npublic class WithIndexerOverloads : ControllerBase // Noncompliant\n{\n    private readonly IS1 s1;\n    private readonly IS2 s2;\n    private readonly IS3 s3;\n    private readonly IS4 s4;\n    private readonly IS5 s5;\n\n    public int this[int i] { get { s1.Use(); return 42; } set { s2.Use(); } }  // Clamp A1 and A2 together\n    public int this[long i] { get { s3.Use(); return 42; } set { s4.Use(); } } // Clamp A1 and A2 together\n\n    public void A1() { s1.Use(); } // Secondary {{May belong to responsibility #1.}}\n    public void A2() { s2.Use(); } // Secondary {{May belong to responsibility #1.}}\n    public void A3() { s3.Use(); } // Secondary {{May belong to responsibility #1.}}\n    public void A4() { s4.Use(); } // Secondary {{May belong to responsibility #1.}}\n    public void A5() { s5.Use(); } // Secondary {{May belong to responsibility #2.}}\n}\n\n[ApiController]\npublic class WithIndexerArrow : ControllerBase // Noncompliant\n{\n    private readonly IS1ReturningInt s1;\n    private readonly IS2ReturningInt s2;\n    private readonly IS3ReturningInt s3;\n\n    public int this[int i] => 42 + s1.GetValue() + s2.GetValue(); // Clamp A1 and A2 together\n\n    public void A1() { s1.GetValue(); } // Secondary {{May belong to responsibility #1.}}\n    public void A2() { s2.GetValue(); } // Secondary {{May belong to responsibility #1.}}\n    public void A3() { s3.GetValue(); } // Secondary {{May belong to responsibility #2.}}\n\n    public interface IS1ReturningInt { int GetValue(); }\n    public interface IS2ReturningInt { int GetValue(); }\n    public interface IS3ReturningInt { int GetValue(); }\n}\n\n[ApiController]\npublic class WithClassInjection : ControllerBase // Noncompliant\n{\n    private readonly Class1 s1;\n    private readonly Class2 s2;\n    private readonly Class3 s3;\n\n    public void A1() { s1.Use(); }            // Secondary {{May belong to responsibility #1.}}\n    public void A2() { s2.Use(); }            // Secondary {{May belong to responsibility #2.}}\n    public void A3() { s3.Use(); }            // Secondary {{May belong to responsibility #1.}}\n    public void A4() { s3.Use(); s1.Use(); }  // Secondary {{May belong to responsibility #1.}}\n    public void A5() { }                      // No service used => ignore\n}\n\n[ApiController]\npublic class WithStructInjection : ControllerBase // Noncompliant\n{\n    private readonly Struct1 s1;\n    private readonly Struct2 s2;\n    private readonly Struct3 s3;\n\n    public void A1() { s1.Use(); }            // Secondary {{May belong to responsibility #1.}}\n    public void A2() { s2.Use(); }            // Secondary {{May belong to responsibility #2.}}\n    public void A3() { s3.Use(); }            // Secondary {{May belong to responsibility #1.}}\n    public void A4() { s3.Use(); s1.Use(); }  // Secondary {{May belong to responsibility #1.}}\n    public void A5() { }                      // No service used => ignore\n}\n\n[ApiController]\npublic class WithMixOfInjectionTypes : ControllerBase // Noncompliant\n{\n    private readonly IS1 interface1;\n    private readonly IS2 interface2;\n    private readonly Class1 class1;\n    private readonly Class2 class2;\n    private readonly Class3 class3;   // Unused\n    private readonly Struct1 struct1;\n    private readonly Struct2 struct2;\n    private readonly Struct3 struct3; // Unused\n\n    private readonly Lazy<IS1> lazy1;\n    private readonly Lazy<Class1> lazy2;\n    private readonly Lazy<Class2> lazy3;\n    private readonly Lazy<Struct1> lazy4;\n    private readonly Lazy<Struct2> lazy5;\n    private readonly Lazy<Lazy<IS1>> lazy6;\n    private readonly Lazy<Lazy<IS2>> lazy7; // Unused\n\n    private readonly Func<IS1> delegate1;\n    private readonly Func<Class1> delegate2;\n    private readonly Func<Struct1> delegate3;\n    private readonly Func<Func<IS1>> delegate4;\n    private readonly Func<Func<IS2>> delegate5; // Unused\n\n    public void A1() { interface1.Use(); class1.Use(); }                // Secondary {{May belong to responsibility #1.}}\n    public void A2() { interface2.Use(); class1.Use(); struct2.Use(); } // Secondary {{May belong to responsibility #1.}}\n    public void A3() { class2.Use(); }                                  // Secondary {{May belong to responsibility #4.}}\n    public void A4() { struct1.Use(); class2.Use(); _ = lazy4; }        // Secondary {{May belong to responsibility #4.}}\n    public void A5() { struct2.Use(); lazy1.Value.Use(); }              // Secondary {{May belong to responsibility #1.}}\n    public void A6() { _ = lazy1.Value; lazy3.Value.Use(); }            // Secondary {{May belong to responsibility #1.}}\n    public void A7() { _ = lazy3.ToString(); }                          // Secondary {{May belong to responsibility #1.}}\n    public void A8() { lazy4.Value.Use(); _ = lazy5.IsValueCreated; }   // Secondary {{May belong to responsibility #4.}}\n    public void A9() { _ = lazy6.GetHashCode(); delegate1().Use(); }    // Secondary {{May belong to responsibility #2.}}\n    public void A10() { _ = delegate2(); delegate3.Invoke().Use(); }    // Secondary {{May belong to responsibility #2.}}\n    public void A11() { _ = delegate1.Target; ((delegate3())).Use(); }  // Secondary {{May belong to responsibility #2.}}\n    public void A12() { _ = delegate4(); }                              // Secondary {{May belong to responsibility #3.}}\n    public void A13() { }                                               // No service used => ignored\n}\n\n[ApiController]\npublic class WithDestructor : ControllerBase // Noncompliant\n{\n    private readonly IS1 s1;\n    private readonly IS2 s2;\n\n    ~WithDestructor() { s1.Use(); s2.Use(); }\n\n    public void A1() { s1.Use(); } // Secondary {{May belong to responsibility #1.}}\n    public void A2() { s2.Use(); } // Secondary {{May belong to responsibility #2.}}\n}\n\npublic class NotAControllerForCoverage\n{\n    private readonly IS1 s1;\n    private readonly IS2 s2;\n}\n\nnamespace CSharp13\n{\n    //https://sonarsource.atlassian.net/browse/NET-509\n    [ApiController]\n    public partial class WithFieldBackedPartialProperties : ControllerBase // Noncompliant\n    {\n        private IS1 _s1;\n        private IS2 _s2;\n\n        public partial IS1 S1 { get => _s1; }\n        public partial IS2 S2 { get => _s2; init => _s2 = value; }\n\n        public WithFieldBackedPartialProperties(IS1 s1, IS2 s2) { _s1 = s1; _s2 = s2; }\n\n        public void A1() { S1.Use(); } // Secondary {{May belong to responsibility #1.}}\n                                       // Secondary @-1 {{May belong to responsibility #1.}}\n        public void A2() { S2.Use(); } // Secondary {{May belong to responsibility #2.}}\n                                       // Secondary @-1 {{May belong to responsibility #2.}}\n    }\n\n    [ApiController]\n    public partial class WithPartialIndexer : ControllerBase // Noncompliant\n    {\n        private readonly IS1 s1;\n        private readonly IS2 s2;\n        private readonly IS3 s3;\n\n        public partial int this[int i] { get { s1.Use(); return 42; } set { s2.Use(); } } // Clamp A1 and A2 together\n\n        public void A1() { s1.Use(); } // Secondary {{May belong to responsibility #1.}}\n                                       // Secondary @-1 {{May belong to responsibility #1.}}\n        public void A2() { s2.Use(); } // Secondary {{May belong to responsibility #1.}}\n                                       // Secondary @-1 {{May belong to responsibility #1.}}\n        public void A3() { s3.Use(); } // Secondary {{May belong to responsibility #2.}}\n                                       // Secondary @-1 {{May belong to responsibility #2.}}\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AspNet/ControllersReuseClient.CSharp9.cs",
    "content": "﻿using Microsoft.AspNetCore.Mvc;\nusing System;\nusing System.IO;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\n[ApiController]\n[Route(\"Hello\")]\npublic class SomeController : ControllerBase\n{\n    [HttpGet(\"foo\")]\n    public async Task<string> Foo()\n    {\n        HttpClient client = new();  // Noncompliant\n        return \"bar\";\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AspNet/ControllersReuseClient.Csharp8.cs",
    "content": "﻿using Microsoft.AspNetCore.Mvc;\nusing System;\nusing System.IO;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\n[ApiController]\npublic class SomeController : ControllerBase\n{\n    private readonly IHttpClientFactory _clientFactory;\n    private HttpClient clientField = new HttpClient();\n\n    [HttpGet(\"foo\")]\n    public async Task<string> Foo()\n    {\n        using var clientA = new HttpClient();                     // Noncompliant\n        //                  ^^^^^^^^^^^^^^^^\n        await clientA.GetStringAsync(\"\");\n\n        clientField ??= new HttpClient();                         // Compliant\n        using var pooledClient = _clientFactory.CreateClient();   // Compliant\n        _ = true switch { true => new HttpClient() };             // Compliant\n        return \"bar\";\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AspNet/ControllersReuseClient.cs",
    "content": "﻿using Microsoft.AspNetCore.Mvc;\nusing System;\nusing System.IO;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\n[ApiController]\n[Route(\"Hello\")]\npublic class SomeController : ControllerBase\n{\n    private readonly IHttpClientFactory _clientFactory;\n    private HttpClient clientField = new HttpClient();                                // Compliant, it can be reused between actions\n    private HttpClient ClientProperty { get; set; } = new HttpClient();               // Compliant, it can be reused between actions\n    private HttpClient ClientPropertyAccessorArrowClause { get => new HttpClient(); } // Noncompliant\n    private HttpClient ClientPropertyAccessorMethodBody { get { var anotherStatement = 1; return new HttpClient(); } } // Noncompliant\n    private HttpClient ClientPropertyAccessorArrow => new HttpClient();                                                // Noncompliant\n\n    public SomeController()\n    {\n        clientField = new HttpClient();                           // Compliant\n    }\n\n    [HttpGet(\"foo\")]\n    public async Task<string> Foo()\n    {\n        using (var clientB = new HttpClient())                    //Noncompliant {{Reuse HttpClient instances rather than create new ones with each controller action invocation.}}\n        //                   ^^^^^^^^^^^^^^^^\n        {\n            await clientB.GetStringAsync(\"\");\n        }\n\n        var client = new HttpClient();                            // Noncompliant\n        clientField = new HttpClient();                           // Noncompliant\n        ClientProperty = new HttpClient();                        // Noncompliant\n        var local = new HttpClient();                             // Noncompliant\n        local = new System.Net.Http.HttpClient();                 // Noncompliant\n        var fromStaticMethod = StaticCreateClient();              // FN - see https://github.com/SonarSource/rspec/pull/3847#discussion_r1559510167\n        var fromMethod = CreateClient();                          // FN - see https://github.com/SonarSource/rspec/pull/3847#discussion_r1559510167\n\n        local = ClientPropertyAccessorArrow;                      // Compliant\n        local = ClientPropertyAccessorArrow;                      // Compliant\n\n        // Lambda\n        _ = new Lazy<HttpClient>(() => new HttpClient());         // Noncompliant FP\n\n        // Conditional code\n        if (true)\n            _ = new HttpClient();                                 // Compliant\n        switch (true)\n        {\n            case true:\n                _ = new HttpClient();                             // Compliant\n                break;\n        }\n        _ = true ? new HttpClient() : null;                       // Compliant\n\n        return \"bar\";\n    }\n\n    private static HttpClient StaticCreateClient()\n    {\n        return new HttpClient();                                  // Compliant, we raise only in actions\n    }\n\n    private HttpClient CreateClient()\n    {\n        return new HttpClient();                                  // Compliant, we raise only in actions\n    }\n}\n\npublic class NotAController\n{\n    private HttpClient ClientPropertyAccessorArrow => new HttpClient();    // Compliant, it's not in a controller.\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AspNet/RouteTemplateShouldNotStartWithSlash.AspNet4x.PartialAutogenerated.cs",
    "content": "﻿// <auto-generated/>\nusing System.Web.Mvc;\n\n[Route(\"[controller]\")]\npublic partial class NonCompliantPartialController : Controller // This is non-compliant but primary issues are not reported on auto-generated classes\n{\n    [Route(\"/[action]\")]                                        // Secondary [first, second]\n    public ActionResult Index5() => View();\n\n    [Route(\"/SubPath/Index6_1\")]                               // Secondary [first, second]\n    [Route(\"/[controller]/Index6_2\")]                          // Secondary [first, second]\n    public ActionResult Index6() => View();\n}\n\n[Route(\"[controller]\")]\npublic partial class PartialCompliantController : Controller // This class makes its partial partial part in RouteTemplateShouldNotStartWithSlash.AspNet4x.cs compliant\n{\n    [Route(\"[action]\")]\n    public ActionResult Index4() => View();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AspNet/RouteTemplateShouldNotStartWithSlash.AspNet4x.cs",
    "content": "﻿using System.Web.Mvc;\n\n[Route(\"[controller]\")]\npublic class NoncompliantController : Controller // Noncompliant {{Change the paths of the actions of this controller to be relative and adapt the controller route accordingly.}}\n//           ^^^^^^^^^^^^^^^^^^^^^^\n{\n    [Route(\"/Index1\")]                  // Secondary\n//   ^^^^^^^^^^^^^^^^\n    public ActionResult Index1() => View();\n\n    [Route(\"/SubPath/Index2_1\")]        // Secondary\n//   ^^^^^^^^^^^^^^^^^^^^^^^^^^\n    [Route(\"/[controller]/Index2_2\")]   // Secondary\n//   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    public ActionResult Index2() => View();\n\n    [Route(\"/[action]\")]                // Secondary\n//   ^^^^^^^^^^^^^^^^^^\n    public ActionResult Index3() => View();\n\n    [Route(\"/SubPath/Index4_1\")]        // Secondary\n//   ^^^^^^^^^^^^^^^^^^^^^^^^^^\n    [Route(\"/[controller]/Index4_2\")]   // Secondary\n//   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    public ActionResult Index4() => View();\n}\n\n[RoutePrefix(\"[controller]\")]\npublic class NoncompliantWithRoutePrefixController : Controller // Noncompliant {{Change the paths of the actions of this controller to be relative and adapt the controller route accordingly.}}\n//           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n{\n    [Route(\"/Index1\")]                  // Secondary\n//   ^^^^^^^^^^^^^^^^\n    [Route(\"/Index1\")]                  // Secondary\n//   ^^^^^^^^^^^^^^^^\n    public ActionResult Index1() => View();\n}\n\n[Route(\"[controller]\")]\n[Route(\"[controller]/[action]\")]\npublic class NoncompliantMultiRouteController : Controller // Noncompliant {{Change the paths of the actions of this controller to be relative and adapt the controller route accordingly.}}\n//           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n{\n    [Route(\"/Index1\")]                  // Secondary\n//   ^^^^^^^^^^^^^^^^\n    public ActionResult Index1() => View();\n\n    [Route(\"/SubPath/Index2_1\")]        // Secondary\n//   ^^^^^^^^^^^^^^^^^^^^^^^^^^\n    [Route(\"/[controller]/Index2_2\")]   // Secondary\n//   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    public ActionResult Index2() => View();\n\n    [Route(\"/[action]\")]                // Secondary\n//   ^^^^^^^^^^^^^^^^^^\n    public ActionResult Index3() => View();\n}\n\n[Route(\"[controller]\")]\npublic class CompliantController : Controller // Compliant: at least one action has at least a relative route\n{\n    [Route(\"/Index1\")]\n    public ActionResult Index1() => View();\n\n    [Route(\"/SubPath/Index2\")]\n    public ActionResult Index2() => View();\n\n    [Route(\"/[action]\")]\n    public ActionResult Index3() => View();\n\n    [Route(\"/[controller]/Index4_1\")]\n    [Route(\"SubPath/Index4_2\")] // The relative route\n    public ActionResult Index4() => View();\n}\n\npublic class NoncompliantNoControllerRouteController : Controller // Noncompliant {{Change the paths of the actions of this controller to be relative and add a controller route with the common prefix.}}\n{\n    [Route(\"/Index1\")]                          // Secondary\n    public ActionResult Index1() => View();\n\n    [Route(\"/SubPath/Index2_1\")]                // Secondary\n    [Route(\"/[controller]/Index2_2\")]           // Secondary\n    public ActionResult Index2() => View();\n\n    [Route(\"/[action]\")]                        // Secondary\n    public ActionResult Index3() => View();\n}\n\npublic class CompliantNoControllerRouteNoActionRouteController : Controller // Compliant\n{\n    public ActionResult Index1() => View(); // Default route -> relative\n\n    [Route(\"/SubPath/Index2\")]\n    public ActionResult Index2() => View();\n\n    [Route(\"/[action]\")]\n    public ActionResult Index3() => View();\n\n    [Route(\"/SubPath/Index4_1\")]\n    [Route(\"/[controller]/Index4_2\")]\n    public ActionResult Index4() => View();\n}\n\npublic class CompliantNoControllerRouteEmptyActionRouteController : Controller // Compliant\n{\n    [Route]\n    public ActionResult Index1() => View(); // Empty route -> relative\n\n    [Route(\"/SubPath/Index2\")]\n    public ActionResult Index2() => View();\n\n    [Route(\"/[action]\")]\n    public ActionResult Index3() => View();\n\n    [Route(\"/SubPath/Index4_1\")]\n    [Route(\"/[controller]/Index4_2\")]\n    public ActionResult Index4() => View();\n}\n\npublic class ControllerWithoutActions : Controller // Compliant\n{\n    public int NotAnAction()\n    {\n        return 1;\n    }\n}\n\npublic class EmptyController : Controller { } // Compliant\n\npublic class NotAController { } // For coverage\n\nnamespace WithAliases\n{\n    using MyRoute = RouteAttribute;\n    using ASP = System.Web;\n\n    public class WithAliasedRouteAttributeController : Controller // Noncompliant\n    {\n        [MyRoute(@\"/[controller]\")] // Secondary\n        public ActionResult Index() => View();\n    }\n\n    public class WithFullQualifiedPartiallyAliasedNameController : Controller // Noncompliant\n    {\n        [ASP.Mvc.RouteAttribute(\"/[action]\")] // Secondary\n        public ActionResult Index() => View();\n    }\n}\n\n[Route(\"[controller]\")]\npublic partial class NonCompliantPartialController : Controller // Noncompliant [first]\n{\n    [Route(\"/Index1\")]                              // Secondary [first, second]\n    public ActionResult Index1() => View();\n\n    [Route(\"/SubPath/Index2_1\")]                    // Secondary [first, second]\n    [Route(\"/[controller]/Index2_2\")]               // Secondary [first, second]\n    public ActionResult Index2() => View();\n}\n\n[Route(\"[controller]\")]\npublic partial class NonCompliantPartialController : Controller // Noncompliant [second]\n{\n    [Route(\"/[action]\")]                            // Secondary [first, second]\n    public ActionResult Index3() => View();\n\n    [Route(\"/SubPath/Index4_1\")]                    // Secondary [first, second]\n\n    [Route(\"/[controller]/Index4_2\")]               // Secondary [first, second]\n    public ActionResult Index4() => View();\n}\n\n[Route(\"[controller]\")]\npublic partial class CompliantPartialController : Controller // Compliant, due to the other partial part of this class\n{\n    [Route(\"/Index1\")]\n    public ActionResult Index1() => View();\n\n    [Route(\"/SubPath/Index2\")]\n    public ActionResult Index2() => View();\n}\n\n[Route(\"[controller]\")]\npublic partial class CompliantPartialController : Controller\n{\n    [Route(\"[action]\")]\n    public ActionResult Index3() => View();\n}\n\n[Route(\"[controller]\")]\npublic partial class PartialCompliantController : Controller // Compliant - its autogenerated part has at least one compliant action\n{\n    [Route(\"/[action]\")]\n    public ActionResult Index3() => View();\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/9002\npublic class Repro_9002 : Controller        // Noncompliant\n{\n    [Route(\"~/B\")]                          // Secondary\n    public ActionResult Index() => View();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AspNet/RouteTemplateShouldNotStartWithSlash.AspNet4x.vb",
    "content": "﻿Imports System.Web.Mvc\n\n<Route(\"[controller]\")>\nPublic Class NoncompliantController     ' Noncompliant {{Change the paths of the actions of this controller to be relative and adapt the controller route accordingly.}}\n    Inherits Controller\n    <Route(\"/Index1\")>                  ' Secondary\n    Public Function Index1() As ActionResult\n        Return View()\n    End Function\n\n    <Route(\"/SubPath/Index2_1\")>        ' Secondary\n    <Route(\"/[controller]/Index2_2\")>   ' Secondary\n    Public Function Index2() As ActionResult\n        Return View()\n    End Function\n\n    <Route(\"/[action]\")>                ' Secondary\n    Public Function Index3() As ActionResult\n        Return View()\n    End Function\n\n    <Route(\"/SubPath/Index4_1\")>        ' Secondary\n    <Route(\"/[controller]/Index4_2\")>   ' Secondary\n    Public Function Index4() As ActionResult\n        Return View()\n    End Function\nEnd Class\n\n<RoutePrefix(\"[controller]\")>\nPublic Class NoncompliantWithRoutePrefixController ' Noncompliant {{Change the paths of the actions of this controller to be relative and adapt the controller route accordingly.}}\n    Inherits Controller\n    <Route(\"/Index1\")>                             ' Secondary\n    Public Function Index1() As ActionResult\n        Return View()\n    End Function\nEnd Class\n\n<Route(\"[controller]\")>\n<Route(\"[controller]/[action]\")>\nPublic Class NoncompliantMultiRouteController ' Noncompliant {{Change the paths of the actions of this controller to be relative and adapt the controller route accordingly.}}\n    Inherits Controller\n    <Route(\"/Index1\")>                        ' Secondary\n    Public Function Index1() As ActionResult\n        Return View()\n    End Function\n\n    <Route(\"/SubPath/Index2_1\")>              ' Secondary\n    <Route(\"/[controller]/Index2_2\")>         ' Secondary\n    Public Function Index2() As ActionResult\n        Return View()\n    End Function\n\n    <Route(\"/[action]\")>                      ' Secondary\n    Public Function Index3() As ActionResult\n        Return View()\n    End Function\nEnd Class\n\n<Route(\"[controller]\")>\nPublic Class CompliantController ' Compliant: at least one action has at least a relative route\n    Inherits Controller\n    <Route(\"/Index1\")>\n    Public Function Index1() As ActionResult\n        Return View()\n    End Function\n\n    <Route(\"/SubPath/Index2\")>\n    Public Function Index2() As ActionResult\n        Return View()\n    End Function\n\n    <Route(\"/[action]\")>\n    Public Function Index3() As ActionResult\n        Return View()\n    End Function\n\n    <Route(\"/[controller]/Index4_1\")>\n    <Route(\"SubPath/Index4_2\")> ' The relative route\n    Public Function Index4() As ActionResult\n        Return View()\n    End Function\nEnd Class\n\nPublic Class NoncompliantNoControllerRouteController ' Noncompliant {{Change the paths of the actions of this controller to be relative and add a controller route with the common prefix.}}\n    Inherits Controller\n    <Route(\"/Index1\")>                               ' Secondary\n    Public Function Index1() As ActionResult\n        Return View()\n    End Function\n\n    <Route(\"/SubPath/Index2_1\")>                     ' Secondary\n    <Route(\"/[controller]/Index2_2\")>                ' Secondary\n    Public Function Index2() As ActionResult\n        Return View()\n    End Function\n\n    <Route(\"/[action]\")>                             ' Secondary\n    Public Function Index3() As ActionResult\n        Return View()\n    End Function\nEnd Class\n\nPublic Class CompliantNoControllerRouteNoActionRouteController ' Compliant\n    Inherits Controller\n    Public Function Index1() As ActionResult\n        Return View()\n    End Function ' Default route -> relative\n\n    <Route(\"/SubPath/Index2\")>\n    Public Function Index2() As ActionResult\n        Return View()\n    End Function\n\n    <Route(\"/[action]\")>\n    Public Function Index3() As ActionResult\n        Return View()\n    End Function\n\n    <Route(\"/SubPath/Index4_1\")>\n    <Route(\"/[controller]/Index4_2\")>\n    Public Function Index4() As ActionResult\n        Return View()\n    End Function\nEnd Class\n\nPublic Class CompliantNoControllerRouteEmptyActionRouteController ' Compliant\n    Inherits Controller\n    <Route>\n    Public Function Index1() As ActionResult\n        Return View()\n    End Function ' Empty route -> relative\n\n    <Route(\"/SubPath/Index2\")>\n    Public Function Index2() As ActionResult\n        Return View()\n    End Function\n\n    <Route(\"/[action]\")>\n    Public Function Index3() As ActionResult\n        Return View()\n    End Function\n\n    <Route(\"/SubPath/Index4_1\")>\n    <Route(\"/[controller]/Index4_2\")>\n    Public Function Index4() As ActionResult\n        Return View()\n    End Function\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AspNet/RouteTemplateShouldNotStartWithSlash.AspNetCore.CSharp12.cs",
    "content": "﻿using Microsoft.AspNetCore.Mvc;\nusing Microsoft.AspNetCore.Mvc.Routing;\n\npublic class WithUserDefinedAttributeDerivedFromHttpMethodAttributeController : Controller // Noncompliant: MyHttpMethodAttribute derives from HttpMethodAttribute\n{\n    [MyHttpMethod(\"/Index\")] // Secondary\n    public IActionResult WithUserDefinedAttribute() => View();\n\n    private sealed class MyHttpMethodAttribute(string template) : HttpMethodAttribute([template]) { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AspNet/RouteTemplateShouldNotStartWithSlash.AspNetCore.PartialAutogenerated.cs",
    "content": "﻿// <auto-generated/>\nusing Microsoft.AspNetCore.Mvc;\nusing Microsoft.AspNetCore.Mvc.Routing;\n\n[Route(\"[controller]\")]\npublic partial class NoncompliantPartialAutogeneratedController : Controller // This is non-compliant but primary issues are not reported on auto-generated classes\n{\n    [HttpGet(\"/[action]\")]                      // Secondary\n    public IActionResult Index3() => View();\n\n    [HttpGet(\"/SubPath/Index4_1\")]              // Secondary\n    public IActionResult Index4() => View();\n}\n\n[Route(\"[controller]\")]\npublic partial class CompliantPartialAutogeneratedController : Controller // This class makes its partial partial part in RouteTemplateShouldNotStartWithSlash.AspNet4x.cs compliant\n{\n    [HttpGet(\"[action]\")]\n    public IActionResult Index3() => View();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AspNet/RouteTemplateShouldNotStartWithSlash.AspNetCore.cs",
    "content": "﻿using Microsoft.AspNetCore.Mvc;\nusing Microsoft.AspNetCore.Mvc.Routing;\n\n[Route(\"[controller]\")]\npublic class NoncompliantController : Controller // Noncompliant {{Change the paths of the actions of this controller to be relative and adapt the controller route accordingly.}}\n//           ^^^^^^^^^^^^^^^^^^^^^^\n{\n    [Route(\"/Index1\")]                  // Secondary {{Change this path to be relative to the controller route defined on class level.}}\n//   ^^^^^^^^^^^^^^^^\n    public IActionResult Index1() => View();\n\n    [Route(\"/SubPath/Index2\")]          // Secondary {{Change this path to be relative to the controller route defined on class level.}}\n//   ^^^^^^^^^^^^^^^^^^^^^^^^\n    public IActionResult Index2() => View();\n\n    [HttpGet(\"/[action]\")]              // Secondary {{Change this path to be relative to the controller route defined on class level.}}\n//   ^^^^^^^^^^^^^^^^^^^^\n    public IActionResult Index3() => View();\n\n    [HttpGet(\"/SubPath/Index4_1\")]      // Secondary {{Change this path to be relative to the controller route defined on class level.}}\n//   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    [HttpGet(\"/[controller]/Index4_2\")] // Secondary {{Change this path to be relative to the controller route defined on class level.}}\n//   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    public IActionResult Index4() => View();\n}\n\n[Route(\"[controller]\")]\n[Route(\"[controller]/[action]\")]\npublic class NoncompliantMultiRouteController : Controller // Noncompliant {{Change the paths of the actions of this controller to be relative and adapt the controller route accordingly.}}\n//           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n{\n    [Route(\"/Index1\")]                  // Secondary\n//   ^^^^^^^^^^^^^^^^\n    public IActionResult Index1() => View();\n\n    [Route(\"/SubPath/Index2\")]          // Secondary\n//   ^^^^^^^^^^^^^^^^^^^^^^^^\n    public IActionResult Index2() => View();\n\n    [HttpGet(\"/[action]\")]              // Secondary\n//   ^^^^^^^^^^^^^^^^^^^^\n    public IActionResult Index3() => View();\n\n    [HttpGet(\"/SubPath/Index4_1\")]      // Secondary\n//   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    [HttpGet(\"/[controller]/Index4_2\")] // Secondary\n//   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    public IActionResult Index4() => View();\n}\n\n[Route(\"[controller]\")]\npublic class CompliantController : Controller // Compliant: at least one action has at least a relative route\n{\n    [Route(\"/Index1\")]\n    public IActionResult Index1() => View();\n\n    [Route(\"/SubPath/Index2\")]\n    public IActionResult Index2() => View();\n\n    [HttpGet(\"/[action]\")]\n    public IActionResult Index3() => View();\n\n    [HttpGet(\"/[controller]/Index4_1\")]\n    [HttpGet(\"SubPath/Index4_2\")] // The relative route\n    public IActionResult Index4() => View();\n}\n\npublic class NoncompliantNoControllerRouteController : Controller // Noncompliant {{Change the paths of the actions of this controller to be relative and add a controller route with the common prefix.}}\n{\n    [Route(\"/Index1\")]                          // Secondary {{Add a controller route with a common prefix and change this path to be relative it.}}\n    public IActionResult Index1() => View();\n\n    [Route(\"/SubPath/Index2\")]                  // Secondary {{Add a controller route with a common prefix and change this path to be relative it.}}\n    public IActionResult Index2() => View();\n\n    [HttpGet(\"/[action]\")]                      // Secondary {{Add a controller route with a common prefix and change this path to be relative it.}}\n    public IActionResult Index3() => View();\n\n    [HttpGet(\"/SubPath/Index4_1\")]              // Secondary {{Add a controller route with a common prefix and change this path to be relative it.}}\n    [HttpGet(\"/[controller]/Index4_2\")]         // Secondary {{Add a controller route with a common prefix and change this path to be relative it.}}\n    public IActionResult Index4() => View();\n}\n\npublic class CompliantNoControllerRouteNoActionRouteController : Controller // Compliant\n{\n    public IActionResult Index1() => View(); // Conventional route -> relative\n\n    [Route(\"/SubPath/Index2\")]\n    public IActionResult Index2() => View();\n\n    [HttpGet(\"/[action]\")]\n    public IActionResult Index3() => View();\n\n    [HttpGet(\"/SubPath/Index4_1\")]\n    [HttpGet(\"/[controller]/Index4_2\")]\n    public IActionResult Index4() => View();\n}\n\npublic class CompliantNoControllerRouteEmptyActionRouteController : Controller // Compliant\n{\n    [HttpGet]\n    public IActionResult Index1() => View(); // Empty route template -> relative conventional routing\n\n    [Route(\"/SubPath/Index2\")]\n    public IActionResult Index2() => View();\n\n    [HttpGet(\"/[action]\")]\n    public IActionResult Index3() => View();\n\n    [HttpGet(\"/SubPath/Index4_1\")]\n    [HttpGet(\"/[controller]/Index4_2\")]\n    public IActionResult Index4() => View();\n}\n\nnamespace WithAliases\n{\n    using MyRoute = RouteAttribute;\n    using ASP = Microsoft.AspNetCore;\n\n    public class WithAliasedRouteAttributeController : Controller // Noncompliant\n    {\n        [MyRoute(@\"/[controller]\")] // Secondary\n        public IActionResult Index() => View();\n    }\n\n    public class WithFullQualifiedPartiallyAliasedNameController : Controller // Noncompliant\n    {\n        [ASP.Mvc.RouteAttribute(\"/[action]\")] // Secondary\n        public IActionResult Index() => View();\n    }\n}\n\npublic class MultipleActionsAllRoutesStartingWithSlash1Controller : Controller  // Noncompliant\n{\n    [HttpGet(\"/Index1\")] // Secondary\n    public IActionResult WithHttpAttribute() => View();\n\n    [Route(\"/Index2\")]   // Secondary\n    public IActionResult WithRouteAttribute() => View();\n}\n\npublic class MultipleActionsAllRoutesStartingWithSlash2Controller : Controller  // Noncompliant\n{\n    [HttpGet(\"/Index1\")] // Secondary\n    [HttpGet(\"/Index3\")] // Secondary\n    public IActionResult WithHttpAttributes() => View();\n\n    [Route(\"/Index2\")]   // Secondary\n    [Route(\"/Index4\")]   // Secondary\n    [HttpGet(\"/Index5\")] // Secondary\n    public IActionResult WithRouteAndHttpAttributes() => View();\n}\n\n[Route(\"[controller]\")]\npublic class MultipleActionsAllRoutesStartingWithSlash3Controller : Controller  // Noncompliant\n{\n    [HttpGet(\"/Index1\")] // Secondary\n    [HttpGet(\"/Index3\")] // Secondary\n    public IActionResult WithHttpAttributes() => View();\n\n    [Route(\"/Index2\")]   // Secondary\n    [Route(\"/Index4\")]   // Secondary\n    [HttpGet(\"/Index5\")] // Secondary\n    public IActionResult WithRouteAndHttpAttributes() => View();\n}\n\npublic class MultipleActionsSomeRoutesStartingWithSlash1Controller : Controller // Compliant: some routes are relative\n{\n    [HttpGet(\"Index1\")]\n    public IActionResult WithHttpAttribute() => View();\n\n    [Route(\"/Index2\")]\n    public IActionResult WithRouteAttribute() => View();\n}\n\npublic class MultipleActionsSomeRoutesStartingWithSlash2Controller : Controller // Compliant: some routes are relative\n{\n    [HttpGet(\"Index1\")]\n    [HttpGet(\"/Index1\")]\n    public IActionResult WithHttpAttributes() => View();\n\n    [Route(\"/Index2\")]\n    public IActionResult WithRouteAttribute() => View();\n}\n\npublic class MultipleActionsSomeRoutesStartingWithSlash3Controller : Controller // Compliant: some routes are relative\n{\n    [HttpGet(\"Index1\")]\n    [HttpPost(\"/Index1\")]\n    public IActionResult WithHttpAttributes() => View();\n\n    [Route(\"/Index2\")]\n    public IActionResult WithRouteAttribute() => View();\n}\n\n[NonController]\npublic class NotAController : Controller                    // Compliant: not a controller\n{\n    [Route(\"/Index1\")]\n    public IActionResult Index() => View();\n}\n\npublic class ControllerWithoutControllerSuffix : Controller // Noncompliant\n{\n    [Route(\"/Index1\")] // Secondary\n    public IActionResult Index() => View();\n}\n\n[Controller]\npublic class ControllerWithControllerAttribute : Controller // Noncompliant\n{\n    [Route(\"/Index1\")] // Secondary\n    public IActionResult Index() => View();\n}\n\npublic class ControllerWithoutParameterlessConstructor : Controller // Noncompliant\n{\n    public ControllerWithoutParameterlessConstructor(int i) { }\n\n    [Route(\"/Index1\")] // Secondary\n    public IActionResult Index() => View();\n}\n\nclass NonPublicController : Controller                         // Compliant, actions in non-public classes are not reachable\n{\n    [Route(\"/Index1\")]\n    public IActionResult Index() => View();\n}\n\n\npublic class ControllerRequirementsInfluenceActionsCheck\n{\n    internal class InternalController : Controller              // Compliant, nested classes are not reachable\n    {\n        [Route(\"/Index1\")]\n        public IActionResult Index() => View();\n    }\n\n    protected class ProtectedController : Controller            // Compliant, nested classes are not reachable\n    {\n        [Route(\"/Index1\")]\n        public IActionResult Index() => View();\n    }\n\n    public class PublicNestedController : Controller           // Compliant, actions in nested classes are not reachable\n    {\n        [Route(\"/Index1\")]\n        public IActionResult Index() => View();\n    }\n}\n\npublic struct AStruct\n{\n    public class PublicNestedController : Controller           // Compliant, actions in nested types are not reachable\n    {\n        [Route(\"/Index1\")]\n        public IActionResult Index() => View();\n    }\n}\n\n[Route(\"[controller]\")]\npublic partial class NoncompliantPartialController : Controller // Noncompliant [first]\n{\n    [Route(\"/Index1\")]                  // Secondary [first, second]\n    public IActionResult Index1() => View();\n\n    [Route(\"/SubPath/Index2\")]          // Secondary [first, second]\n    public IActionResult Index2() => View();\n}\n\n[Route(\"[controller]\")]\npublic partial class NoncompliantPartialController : Controller // Noncompliant [second]\n{\n    [HttpGet(\"/[action]\")]              // Secondary [first, second]\n    public IActionResult Index3() => View();\n\n    [HttpGet(\"/SubPath/Index4_1\")]      // Secondary [first, second]\n    public IActionResult Index4() => View();\n}\n\n[Route(\"[controller]\")]\npublic partial class CompliantPartialController : Controller // Compliant, due to the other partial part of this class\n{\n    [Route(\"/Index1\")]\n    public IActionResult Index1() => View();\n\n    [Route(\"/SubPath/Index2\")]\n    public IActionResult Index2() => View();\n}\n\n[Route(\"[controller]\")]\npublic partial class CompliantPartialController : Controller\n{\n    [HttpGet(\"[action]\")]\n    public IActionResult Index3() => View();\n}\n\n[Route(\"[controller]\")]\npublic partial class NoncompliantPartialAutogeneratedController : Controller // Noncompliant {{Change the paths of the actions of this controller to be relative and adapt the controller route accordingly.}}\n{\n    [Route(\"/Index1\")]                  // Secondary\n    public IActionResult Index1() => View();\n\n    [Route(\"/SubPath/Index2\")]          // Secondary\n    public IActionResult Index2() => View();\n}\n\n[Route(\"[controller]\")]\npublic partial class CompliantPartialAutogeneratedController : Controller // Compliant, as its autogenerated partial class is compliant\n{\n    [Route(\"/Index1\")]\n    public IActionResult Index1() => View();\n\n    [Route(\"/SubPath/Index2\")]\n    public IActionResult Index2() => View();\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/9002\npublic class Repro_9002 : Controller            // Noncompliant\n{\n    [Route(\"~/B\")]                              // Secondary\n    public IActionResult Index() => View();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AspNet/RouteTemplateShouldNotStartWithSlash.AspNetCore.vb",
    "content": "﻿Imports Microsoft.AspNetCore.Mvc\nImports Microsoft.AspNetCore.Mvc.Routing\nImports MyRoute = Microsoft.AspNetCore.Mvc.RouteAttribute\nImports ASP = Microsoft.AspNetCore\n\n<Route(\"[controller]\")>\nPublic Class NoncompliantController     ' Noncompliant {{Change the paths of the actions of this controller to be relative and adapt the controller route accordingly.}}\n    Inherits Controller\n    <Route(\"/Index1\")>                  ' Secondary\n    Public Function Index1() As IActionResult\n        Return View()\n    End Function\n\n    <Route(\"/SubPath/Index2\")>          ' Secondary\n    Public Function Index2() As IActionResult\n        Return View()\n    End Function\n\n    <HttpGet(\"/[action]\")>              ' Secondary\n    Public Function Index3() As IActionResult\n        Return View()\n    End Function\n\n    <HttpGet(\"/SubPath/Index4_1\")>      ' Secondary\n    <HttpGet(\"/[controller]/Index4_2\")> ' Secondary\n    Public Function Index4() As IActionResult\n        Return View()\n    End Function\nEnd Class\n\n<Route(\"[controller]\")>\n<Route(\"[controller]/[action]\")>\nPublic Class NoncompliantMultiRouteController ' Noncompliant {{Change the paths of the actions of this controller to be relative and adapt the controller route accordingly.}}\n    Inherits Controller\n    <Route(\"/Index1\")>                         ' Secondary\n    Public Function Index1() As IActionResult\n        Return View()\n    End Function\n\n    <Route(\"/SubPath/Index2\")>                  ' Secondary\n    Public Function Index2() As IActionResult\n        Return View()\n    End Function\n\n    <HttpGet(\"/[action]\")>                      ' Secondary\n    Public Function Index3() As IActionResult\n        Return View()\n    End Function\n\n    <HttpGet(\"/SubPath/Index4_1\")>             ' Secondary\n    <HttpGet(\"/[controller]/Index4_2\")>        ' Secondary\n    Public Function Index4() As IActionResult\n        Return View()\n    End Function\nEnd Class\n\n<Route(\"[controller]\")>\nPublic Class CompliantController ' Compliant: at least one action has at least a relative route\n    Inherits Controller\n    <Route(\"/Index1\")>\n    Public Function Index1() As IActionResult\n        Return View()\n    End Function\n\n    <Route(\"/SubPath/Index2\")>\n    Public Function Index2() As IActionResult\n        Return View()\n    End Function\n\n    <HttpGet(\"/[action]\")>\n    Public Function Index3() As IActionResult\n        Return View()\n    End Function\n\n    <HttpGet(\"/[controller]/Index4_1\")>\n    <HttpGet(\"SubPath/Index4_2\")> ' The relative route\n    Public Function Index4() As IActionResult\n        Return View()\n    End Function\nEnd Class\n\nPublic Class NoncompliantNoControllerRouteController ' Noncompliant {{Change the paths of the actions of this controller to be relative and add a controller route with the common prefix.}}\n    Inherits Controller\n    <Route(\"/Index1\")>                               ' Secondary\n    Public Function Index1() As IActionResult\n        Return View()\n    End Function\n\n    <Route(\"/SubPath/Index2\")>                       ' Secondary\n    Public Function Index2() As IActionResult\n        Return View()\n    End Function\n\n    <HttpGet(\"/[action]\")>                           ' Secondary\n    Public Function Index3() As IActionResult\n        Return View()\n    End Function\n\n    <HttpGet(\"/SubPath/Index4_1\")>                  ' Secondary\n    <HttpGet(\"/[controller]/Index4_2\")>             ' Secondary\n    Public Function Index4() As IActionResult\n        Return View()\n    End Function\nEnd Class\n\nPublic Class CompliantNoControllerRouteNoActionRouteController  ' Compliant\n    Inherits Controller\n    Public Function Index1() As IActionResult\n        Return View()\n    End Function ' Default route -> relative\n\n    <Route(\"/SubPath/Index2\")>\n    Public Function Index2() As IActionResult\n        Return View()\n    End Function\n\n    <HttpGet(\"/[action]\")>\n    Public Function Index3() As IActionResult\n        Return View()\n    End Function\n\n    <HttpGet(\"/SubPath/Index4_1\")>\n    <HttpGet(\"/[controller]/Index4_2\")>\n    Public Function Index4() As IActionResult\n        Return View()\n    End Function\nEnd Class\n\nPublic Class CompliantNoControllerRouteEmptyActionRouteController  ' Compliant\n    Inherits Controller\n    <HttpGet>\n    Public Function Index1() As IActionResult\n        Return View()\n    End Function ' Empty route -> relative\n\n    <Route(\"/SubPath/Index2\")>\n    Public Function Index2() As IActionResult\n        Return View()\n    End Function\n\n    <HttpGet(\"/[action]\")>\n    Public Function Index3() As IActionResult\n        Return View()\n    End Function\n\n    <HttpGet(\"/SubPath/Index4_1\")>\n    <HttpGet(\"/[controller]/Index4_2\")>\n    Public Function Index4() As IActionResult\n        Return View()\n    End Function\nEnd Class\n\nNamespace WithAliases\n\n    Public Class WithAliasedRouteAttributeController  ' Noncompliant\n        Inherits Controller\n        <MyRoute(\"/[controller]\")>                    ' Secondary\n        Public Function Index() As IActionResult\n            Return View()\n        End Function\n    End Class\n\n    Public Class WithFullQualifiedPartiallyAliasedNameController ' Noncompliant\n        Inherits Controller\n        <ASP.Mvc.RouteAttribute(\"/[action]\")>   ' Secondary\n        Public Function Index() As IActionResult\n            Return View()\n        End Function\n    End Class\nEnd Namespace\n\nPublic Class MultipleActionsAllRoutesStartingWithSlash1Controller ' Noncompliant\n    Inherits Controller\n    <HttpGet(\"/Index1\")>                                          ' Secondary\n    Public Function WithHttpAttribute() As IActionResult\n        Return View()\n    End Function\n\n    <Route(\"/Index2\")>                                            ' Secondary\n    Public Function WithRouteAttribute() As IActionResult\n        Return View()\n    End Function\nEnd Class\n\nPublic Class MultipleActionsAllRoutesStartingWithSlash2Controller ' Noncompliant\n    Inherits Controller\n    <HttpGet(\"/Index1\")>                                          ' Secondary\n    <HttpGet(\"/Index3\")>                                          ' Secondary\n    Public Function WithHttpAttributes() As IActionResult\n        Return View()\n    End Function\n\n    <Route(\"/Index2\")>                                            ' Secondary\n    <Route(\"/Index4\")>                                            ' Secondary\n    <HttpGet(\"/Index5\")>                                          ' Secondary\n    Public Function WithRouteAndHttpAttributes() As IActionResult\n        Return View()\n    End Function\nEnd Class\n\n<Route(\"[controller]\")>\nPublic Class MultipleActionsAllRoutesStartingWithSlash3Controller ' Noncompliant\n    Inherits Controller\n    <HttpGet(\"/Index1\")>                                          ' Secondary\n    <HttpGet(\"/Index3\")>                                          ' Secondary\n    Public Function WithHttpAttributes() As IActionResult\n        Return View()\n    End Function\n\n    <Route(\"/Index2\")>                                            ' Secondary\n    <Route(\"/Index4\")>                                            ' Secondary\n    <HttpGet(\"/Index5\")>                                          ' Secondary\n    Public Function WithRouteAndHttpAttributes() As IActionResult\n        Return View()\n    End Function\nEnd Class\n\nPublic Class MultipleActionsSomeRoutesStartingWithSlash1Controller ' Compliant: some routes are relativ\n    Inherits Controller\n    <HttpGet(\"Index1\")>\n    Public Function WithHttpAttribute() As IActionResult\n        Return View()\n    End Function\n\n    <Route(\"/Index2\")>\n    Public Function WithRouteAttribute() As IActionResult\n        Return View()\n    End Function\nEnd Class\n\nPublic Class MultipleActionsSomeRoutesStartingWithSlash2Controller ' Compliant: some routes are relative\n    Inherits Controller\n    <HttpGet(\"Index1\")>\n    <HttpGet(\"/Index1\")>\n    Public Function WithHttpAttributes() As IActionResult\n        Return View()\n    End Function\n\n    <Route(\"/Index2\")>\n    Public Function WithRouteAttribute() As IActionResult\n        Return View()\n    End Function\nEnd Class\n\nPublic Class MultipleActionsSomeRoutesStartingWithSlash3Controller ' Compliant: some routes are relative\n    Inherits Controller\n    <HttpGet(\"Index1\")>\n    <HttpPost(\"/Index1\")>\n    Public Function WithHttpAttributes() As IActionResult\n        Return View()\n    End Function\n\n    <Route(\"/Index2\")>\n    Public Function WithRouteAttribute() As IActionResult\n        Return View()\n    End Function\nEnd Class\n\n<NonController>\nPublic Class NotAController                     ' Compliant, not a controller\n    Inherits Controller\n    <Route(\"/Index1\")>\n    Public Function Index() As IActionResult\n        Return View()\n    End Function\nEnd Class\n\nPublic Class ControllerWithoutControllerSuffix  ' Noncompliant\n    Inherits Controller\n    <Route(\"/Index1\")>                          ' Secondary\n    Public Function Index() As IActionResult\n        Return View()\n    End Function\nEnd Class\n\n<Controller>\nPublic Class ControllerWithControllerAttribute  ' Noncompliant\n    Inherits Controller\n    <Route(\"/Index1\")>                          ' Secondary\n    Public Function Index() As IActionResult\n        Return View()\n    End Function\nEnd Class\n\nPublic Class ControllerWithoutParameterlessConstructor  ' Noncompliant\n    Inherits Controller\n    Public Sub New(i As Integer)\n    End Sub\n\n    <Route(\"/Index1\")>                                  ' Secondary\n    Public Function Index() As IActionResult\n        Return View()\n    End Function\nEnd Class\n\nPublic Class ControllerRequirementsInfluenceActionsCheck\n\n    Friend Class InternalController ' Compliant, actions in nested classes are not reachable\n        Inherits Controller\n        <Route(\"/Index1\")>\n        Public Function Index() As IActionResult\n            Return View()\n        End Function\n    End Class\n\n    Protected Class ProtectedController ' Compliant, actions in nested classes are not reachable\n        Inherits Controller\n        <Route(\"/Index1\")>\n        Public Function Index() As IActionResult\n            Return View()\n        End Function\n    End Class\n\nEnd Class\n\n' https://github.com/SonarSource/sonar-dotnet/issues/9002\nPublic Class Repro_9002                     ' Noncompliant\n    Inherits Controller\n    \n    <Route(\"~/B\")>                          ' Secondary\n    Public Function Index() As ActionResult\n        Return View()\n    End Function\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AspNet/SpecifyRouteAttribute.CSharp12.cs",
    "content": "﻿using Microsoft.AspNetCore.Http;\nusing Microsoft.AspNetCore.Mvc;\nusing Microsoft.AspNetCore.Mvc.Routing;\n\nusing MA = Microsoft.AspNetCore;\n\npublic class RouteTemplateIsNotSpecifiedController : Controller\n{\n    public IActionResult NoAttribute() => View();                               // Compliant\n\n    [HttpGet]\n    public IActionResult WithHttpGetAttribute() => View();                      // Compliant\n\n    [HttpGet()]\n    public IActionResult WithHttpGetAttributeWithParanthesis() => View();       // Compliant\n\n    [HttpGetAttribute]\n    public IActionResult WithFullAttributeName() => View();                     // Compliant\n\n    [Microsoft.AspNetCore.Mvc.HttpGet]\n    public IActionResult WithNamespaceAttribute() => View();                    // Compliant\n\n    [MA.Mvc.HttpGet]\n    public IActionResult WithAliasedNamespaceAttribute() => View();             // Compliant\n\n    [method: HttpGet]\n    public IActionResult WithScopedAttribute() => View();                       // Compliant\n\n    [HttpGet(\"/[controller]/[action]/{sortBy}\")]\n    public IActionResult AbsoluteUri1(string sortBy) => View();                 // Compliant, absolute uri\n\n    [HttpGet(\"~/[controller]/[action]/{sortBy}\")]\n    public IActionResult AbsoluteUri2(string sortBy) => View();                 // Compliant, absolute uri\n\n    public IActionResult Error() => View();                                     // Compliant\n}\n\npublic class RouteTemplatesAreSpecifiedController : Controller                  // Noncompliant [controller] {{Specify the RouteAttribute when an HttpMethodAttribute or RouteAttribute is specified at an action level.}}\n//           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n{\n    private const string ConstantRoute = \"ConstantRoute\";\n\n    [HttpGet(\"GetObject\")]\n    public IActionResult Get() => View();\n//                       ^^^ Secondary [controller]\n\n    [HttpGet(\"GetFirst\")]\n    [HttpGet(\"GetSecond\")]\n    public IActionResult GetMultipleTemplates() => View();                      // Secondary [controller] {{By specifying an HttpMethodAttribute or RouteAttribute here, you will need to specify the RouteAttribute at the class level.}}\n\n    [HttpGet(\"GetFirst\")]\n    [HttpPut(\"PutFirst\")]\n    public IActionResult MixGetAndPut() => View();                              // Secondary [controller] {{By specifying an HttpMethodAttribute or RouteAttribute here, you will need to specify the RouteAttribute at the class level.}}\n\n    [HttpGet(\"GetFirst\")]\n    [HttpPut()]\n    public IActionResult MixWithTemplateAndWithout() => View();                 // Secondary [controller] {{By specifying an HttpMethodAttribute or RouteAttribute here, you will need to specify the RouteAttribute at the class level.}}\n\n    [HttpGet()]\n    [HttpPut()]\n    public IActionResult MixWithoutTemplate() => View();\n\n    [HttpPost(\"CreateObject\")]\n    public IActionResult Post() => View();                                      // Secondary [controller] {{By specifying an HttpMethodAttribute or RouteAttribute here, you will need to specify the RouteAttribute at the class level.}}\n\n    [HttpPut(\"UpdateObject\")]\n    public IActionResult Put() => View();                                       // Secondary [controller] {{By specifying an HttpMethodAttribute or RouteAttribute here, you will need to specify the RouteAttribute at the class level.}}\n\n    [HttpDelete(\"DeleteObject\")]\n    public IActionResult Delete() => View();                                    // Secondary [controller] {{By specifying an HttpMethodAttribute or RouteAttribute here, you will need to specify the RouteAttribute at the class level.}}\n\n    [HttpPatch(\"PatchObject\")]\n    public IActionResult Patch() => View();                                     // Secondary [controller] {{By specifying an HttpMethodAttribute or RouteAttribute here, you will need to specify the RouteAttribute at the class level.}}\n\n    [HttpHead(\"Head\")]\n    public IActionResult HttpHead() => View();                                  // Secondary [controller] {{By specifying an HttpMethodAttribute or RouteAttribute here, you will need to specify the RouteAttribute at the class level.}}\n\n    [HttpOptions(\"Options\")]\n    public IActionResult HttpOptions() => View();                               // Secondary [controller] {{By specifying an HttpMethodAttribute or RouteAttribute here, you will need to specify the RouteAttribute at the class level.}}\n\n    [Route(\"details\")]\n    public IActionResult WithRoute() => View();                                 // Secondary [controller] {{By specifying an HttpMethodAttribute or RouteAttribute here, you will need to specify the RouteAttribute at the class level.}}\n\n    [Route(\"details\", Order = 1)]\n    public IActionResult WithRouteAndProperties1() => View();                   // Secondary [controller] {{By specifying an HttpMethodAttribute or RouteAttribute here, you will need to specify the RouteAttribute at the class level.}}\n\n    [Route(\"details\", Order = 1, Name = \"Details\")]\n    public IActionResult WithRouteAndProperties2() => View();                   // Secondary [controller] {{By specifying an HttpMethodAttribute or RouteAttribute here, you will need to specify the RouteAttribute at the class level.}}\n\n    [Route(\"details\", Name = \"Details\", Order = 1)]\n    public IActionResult WithRouteAndProperties3() => View();                   // Secondary [controller] {{By specifying an HttpMethodAttribute or RouteAttribute here, you will need to specify the RouteAttribute at the class level.}}\n\n    [Route(\"[controller]/List/{sortBy}/{direction}\")]\n    [HttpGet(\"[controller]/Search/{sortBy}/{direction}\")]\n    public IActionResult RouteAndMethodMix(string sortBy) => View();            // Secondary [controller] {{By specifying an HttpMethodAttribute or RouteAttribute here, you will need to specify the RouteAttribute at the class level.}}\n\n    [HttpGet(\"details\", Order = 1)]\n    public IActionResult MultipleProperties1() => View();                       // Secondary [controller] {{By specifying an HttpMethodAttribute or RouteAttribute here, you will need to specify the RouteAttribute at the class level.}}\n\n    [HttpGet(\"details\", Order = 1, Name = \"Details\")]\n    public IActionResult MultipleProperties2() => View();                       // Secondary [controller] {{By specifying an HttpMethodAttribute or RouteAttribute here, you will need to specify the RouteAttribute at the class level.}}\n\n    [HttpGet(\"details\", Name = \"Details\", Order = 1)]\n    public IActionResult MultipleProperties3() => View();                       // Secondary [controller] {{By specifying an HttpMethodAttribute or RouteAttribute here, you will need to specify the RouteAttribute at the class level.}}\n\n    [HttpGet(ConstantRoute)]\n    public IActionResult Constant() => View();                                  // Secondary [controller] {{By specifying an HttpMethodAttribute or RouteAttribute here, you will need to specify the RouteAttribute at the class level.}}\n\n    [HttpGet(\"\"\"\n             ConstantRoute\n             \"\"\")]\n    public IActionResult Constant2() => View();                                 // Secondary [controller] {{By specifying an HttpMethodAttribute or RouteAttribute here, you will need to specify the RouteAttribute at the class level.}}\n\n    [HttpGet($\"Route {ConstantRoute}\")]\n    public IActionResult Interpolation1() => View();                            // Secondary [controller] {{By specifying an HttpMethodAttribute or RouteAttribute here, you will need to specify the RouteAttribute at the class level.}}\n\n    [HttpGet($\"\"\"\n             {ConstantRoute}\n             \"\"\")]\n    public IActionResult Interpolation2() => View();                            // Secondary [controller] {{By specifying an HttpMethodAttribute or RouteAttribute here, you will need to specify the RouteAttribute at the class level.}}\n\n    [HttpGet(\"GetObject\")]\n    public ActionResult WithActionResult() => View();                           // Secondary [controller] {{By specifying an HttpMethodAttribute or RouteAttribute here, you will need to specify the RouteAttribute at the class level.}}\n\n    [Route(\" \")]\n    public IActionResult WithSpace() => View();                                 // Secondary [controller] {{By specifying an HttpMethodAttribute or RouteAttribute here, you will need to specify the RouteAttribute at the class level.}}\n\n    [Route(\"\\t\")]\n    public IActionResult WithTab() => View();                                   // Secondary [controller] {{By specifying an HttpMethodAttribute or RouteAttribute here, you will need to specify the RouteAttribute at the class level.}}\n\n    // [HttpPost(\"Comment\")]\n    public IActionResult Comment() => View();\n}\n\n[Route(\"api/[controller]\")]\npublic class WithRouteAttributeIsCompliantController : Controller\n{\n    [HttpGet(\"Test\")]\n    public IActionResult Index() => View();\n}\n\npublic class WithUserDefinedAttributeController : Controller                    // Noncompliant [customAttribute]\n{\n    [MyHttpMethod(\"Test\")]\n    public IActionResult Index() => View();                                     // Secondary [customAttribute]\n\n    private sealed class MyHttpMethodAttribute(string template) : HttpMethodAttribute([template]) { }\n}\n\npublic class WithCustomGetAttributeController : Controller                      // Noncompliant [custom-get-attribute]\n{\n    [HttpGet(\"Test\")]\n    public IActionResult Index() => View();                                     // Secondary [custom-get-attribute]\n\n    private sealed class HttpGetAttribute(string template) : HttpMethodAttribute([template]) { }\n}\n\npublic class WithCustomController : DerivedController                           // Noncompliant [derivedController]\n{\n    [HttpGet(\"Test\")]\n    public IActionResult Index() => View();                                     // Secondary [derivedController]\n}\n\n[Controller]\npublic class WithAttributeController                                            // Noncompliant [attribute-controller]\n{\n    [HttpGet(\"Test\")]\n    public string Index() => \"Hi!\";                                             // Secondary [attribute-controller]\n}\n\npublic class WithAttributeControllerUsingInheritanceController : Endpoint       // FN\n{\n    [HttpGet(\"Test\")]\n    public string Index() => \"Hi!\";                                             // FN\n}\n\npublic class NamedController                                                    // FN\n{\n    [HttpGet(\"Test\")]\n    public string Index() => \"Hi!\";                                             // FN\n}\n\n[NonController]\npublic class NonController\n{\n    [HttpGet(\"Test\")]\n    public string Index() => \"Hi!\";\n}\npublic class DerivedController : Controller { }\n\n[Controller]\npublic class Endpoint { }\n\n[Route(\"api/[controller]\")]\npublic class ControllerWithRouteAttribute : Controller { }\n\npublic class ControllerWithInheritedRoute : ControllerWithRouteAttribute            // Compliant, attribute is inherited\n{\n    [HttpGet(\"Test\")]                                                               // Route: api/ControllerWithInheritedRoute/Test\n    public string Index() => \"Hi!\";\n}\n\npublic class BaseControllerWithActionWithRoute : Controller                         // Noncompliant\n{\n    [HttpGet(\"Test\")]                                                               //Route: /Test (AmbiguousMatchException raised because of the override in ControllerOverridesActionWithRoute)\n    public virtual string Index() => \"Hi!\";                                         // Secondary\n\n    // Route: BaseControllerWithActionWithRoute/Index/1\n    public virtual string Index(int id) => \"Hi!\";                                   // Compliant\n}\n\npublic class ControllerOverridesActionWithRoute : BaseControllerWithActionWithRoute // Noncompliant\n{\n    // Route: /Test (AmbiguousMatchException raised because the base method is also in scope)\n    public override string Index() => \"Hi!\";                                        // Secondary\n\n    // Route: ControllerOverridesActionWithRoute/Index/1\n    public override string Index(int id) => \"Hi!\";                                  // Compliant\n}\n\n// Repro: https://github.com/SonarSource/sonar-dotnet/issues/8985\npublic sealed class ExtendedRouteAttribute() : RouteAttribute(\"[controller]/[action]\");\n\n[ExtendedRoute]\npublic class SomeController : ControllerBase    // Compliant - the route attribute template is set in the base class of ExtendedRouteAttribute\n{\n    [HttpGet(\"foo\")]\n    public string Foo() => \"Hi\";\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/9252\nnamespace AbstractControllerClass\n{\n    public abstract class BaseController : Controller   // Compliant - class is abstract\n    {\n        [HttpGet]\n        [Route(\"list\")]\n        public IActionResult List()\n        {\n            // ... load and return items\n            return View();\n        }\n    }\n\n    [Route(\"/api/user\")]\n    public sealed class UserController : BaseController\n    {\n        // other controller code\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AspNet/UseAspNetModelBinding_AspNetCore_Latest.cs",
    "content": "﻿using Microsoft.AspNetCore.Http;\nusing Microsoft.AspNetCore.Mvc;\nusing Microsoft.AspNetCore.Mvc.Filters;\nusing System;\nusing System.Linq;\nusing System.Threading.Tasks;\n\npublic class TestController : Controller\n{\n    private readonly string Key = \"id\";\n\n    public IActionResult Post(string key)\n    {\n        _ = Request.Form[\"id\"];                           // Noncompliant {{Use model binding instead of accessing the raw request data}}\n        //  ^^^^^^^^^^^^\n        _ = Request.Form.TryGetValue(\"id\", out _);        // Noncompliant {{Use model binding instead of accessing the raw request data}}\n        //  ^^^^^^^^^^^^^^^^^^^^^^^^\n        _ = Request.Form.ContainsKey(\"id\");               // Noncompliant {{Use model binding instead of accessing the raw request data}}\n        //  ^^^^^^^^^^^^^^^^^^^^^^^^\n        _ = Request.Headers[\"id\"];                        // Noncompliant {{Use model binding instead of accessing the raw request data}}\n        //  ^^^^^^^^^^^^^^^\n        _ = Request.Headers.TryGetValue(\"id\", out _);     // Noncompliant {{Use model binding instead of accessing the raw request data}}\n        //  ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        _ = Request.Headers.ContainsKey(\"id\");            // Noncompliant {{Use model binding instead of accessing the raw request data}}\n        //  ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        _ = Request.Query[\"id\"];                          // Noncompliant {{Use model binding instead of accessing the raw request data}}\n        //  ^^^^^^^^^^^^^\n        _ = Request.Query.TryGetValue(\"id\", out _);       // Noncompliant {{Use model binding instead of accessing the raw request data}}\n        //  ^^^^^^^^^^^^^^^^^^^^^^^^^\n        _ = Request.RouteValues[\"id\"];                    // Noncompliant {{Use model binding instead of accessing the raw request data}}\n        //  ^^^^^^^^^^^^^^^^^^^\n        _ = Request.RouteValues.TryGetValue(\"id\", out _); // Noncompliant {{Use model binding instead of accessing the raw request data}}\n        //  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        _ = Request.Form.Files;                           // Noncompliant {{Use IFormFile or IFormFileCollection binding instead}}\n        //  ^^^^^^^^^^^^^^^^^^\n        _ = Request.Form.File\\u0073;                      // Noncompliant {{Use IFormFile or IFormFileCollection binding instead}}\n        //  ^^^^^^^^^^^^^^^^^^^^^^^\n        _ = Request.Form.Files[\"file\"];                   // Noncompliant {{Use IFormFile or IFormFileCollection binding instead}}\n        //  ^^^^^^^^^^^^^^^^^^\n        _ = Request.Form.Files[key];                      // Noncompliant {{Use IFormFile or IFormFileCollection binding instead}}\n        //  ^^^^^^^^^^^^^^^^^^\n        _ = Request.Form.Files[0];                        // Noncompliant {{Use IFormFile or IFormFileCollection binding instead}}\n        //  ^^^^^^^^^^^^^^^^^^\n        _ = Request.Form.Files.Any();                     // Noncompliant {{Use IFormFile or IFormFileCollection binding instead}}\n        //  ^^^^^^^^^^^^^^^^^^\n        _ = Request.Form.Files.Count;                     // Noncompliant {{Use IFormFile or IFormFileCollection binding instead}}\n        //  ^^^^^^^^^^^^^^^^^^\n        _ = Request.Form.Files.GetFile(\"file\");           // Noncompliant {{Use IFormFile or IFormFileCollection binding instead}}\n        //  ^^^^^^^^^^^^^^^^^^\n        _ = Request.Form.Files.GetFiles(\"file\");          // Noncompliant {{Use IFormFile or IFormFileCollection binding instead}}\n        //  ^^^^^^^^^^^^^^^^^^\n        return default;\n    }\n\n    void MixedAccess_Form(string key)\n    {\n        _ = Request.Form[\"id\"]; // Compliant (a mixed access with constant and non-constant keys is compliant)\n        _ = Request.Form[key];  // Compliant\n    }\n\n    void MixedAccess_Form_Query(string key)\n    {\n        _ = Request.Form[\"id\"];  // Compliant (a mixed access with constant and non-constant keys is compliant)\n        _ = Request.Query[key];  // Compliant\n    }\n\n    void FalseNegatives()\n    {\n        string localKey = \"id\";\n        _ = Request.Form[localKey];                               // FN (Requires SE)\n        _ = Request.Form[Key];                                    // FN: Key is a readonly field with a constant initializer (Requires cross procedure SE)\n    }\n\n    void FormCollection(IFormCollection form)\n    {\n        _ = form[\"id\"]; // Compliant. Using IFormCollection is model binding\n    }\n\n    void WriteAccess()\n    {\n        Request.Headers[\"id\"] = \"Assignment\";                     // Compliant\n        Request.RouteValues[\"id\"] = \"Assignment\";                 // Compliant\n    }\n\n    async Task Compliant()\n    {\n        _ = Request.Cookies[\"cookie\"];        // Compliant: Cookies are not bound by default\n        _ = Request.QueryString;              // Compliant: Accessing the whole raw string is fine.\n    }\n\n    async Task CompliantFormAccess()\n    {\n        var form = await Request.ReadFormAsync(); // Compliant: This might be used for optimization purposes e.g. conditional form value access.\n        _ = form[\"id\"];\n    }\n}\n\npublic class CodeBlocksController : Controller\n{\n    public CodeBlocksController()\n    {\n        _ = Request.Form[\"id\"]; // Noncompliant\n    }\n\n    public CodeBlocksController(object o) => _ = Request.Form[\"id\"]; // Noncompliant\n\n    HttpRequest ValidRequest => Request;\n    IFormCollection Form => Request.Form;\n\n    string P1 => Request.Form[\"id\"]; // Noncompliant\n    string P2\n    {\n        get => Request.Form[\"id\"]; // Noncompliant\n    }\n    string P3\n    {\n        get\n        {\n            return Request.Form[\"id\"]; // Noncompliant\n        }\n    }\n    void M1() => _ = Request.Form[\"id\"]; // Noncompliant\n    void M2()\n    {\n        Func<string> f1 = () => Request.Form[\"id\"];  // Noncompliant\n        Func<object, string> f2 = x => Request.Form[\"id\"];  // Noncompliant\n        Func<object, string> f3 = delegate (object x) { return Request.Form[\"id\"]; };  // Noncompliant\n    }\n    void M3()\n    {\n        // see also parameterized test \"DottedExpressions\"\n        _ = Request.Form[\"id\"][0];      // Noncompliant\n        _ = Request?.Form[\"id\"][0];     // Noncompliant\n        _ = Request.Form?[\"id\"][0];     // Noncompliant\n        _ = Request?.Form?[\"id\"][0];    // Noncompliant\n        _ = Request.Form?[\"id\"][0];     // Noncompliant\n        _ = Request.Form![\"id\"][0];     // Noncompliant\n        _ = Request.Form!?[\"id\"][0];    // Noncompliant\n        _ = Request.Form[\"id\"]![0];     // Noncompliant\n\n        _ = Request.Form?[\"id\"][0][0];  // Noncompliant\n        _ = Request.Form?[\"id\"][0]?[0]; // Noncompliant\n        _ = Request.Form[\"id\"][0]?[0];  // Noncompliant\n    }\n    ~CodeBlocksController() => _ = Request.Form[\"id\"]; // Noncompliant\n}\n\npublic class OverridesController : Controller\n{\n    public void Action()\n    {\n        _ = Request.Form[\"id\"]; // Noncompliant \n    }\n    private void Undecidable(HttpContext context)\n    {\n        // Implementation: It might be difficult to distinguish between access to \"Request\" that originate from overrides vs. \"Request\" access that originate from action methods.\n        // This is especially true for \"Request\" which originate from parameters like here. We may need to redeclare such cases as FNs (see e.g HandleRequest above).\n        _ = context.Request.Form[\"id\"]; // Undecidable: request may originate from an action method (which supports binding), or from one of the following overrides (which don't).\n        _ = context.Request.Form[\"id\"][0];      \n        _ = context.Request?.Form[\"id\"][0];     \n        _ = context.Request.Form?[\"id\"][0];     \n        _ = context.Request?.Form?[\"id\"][0];    \n        _ = context.Request.Form?[\"id\"][0];     \n\n        _ = context.Request.Form?[\"id\"][0][0];  \n        _ = context.Request.Form?[\"id\"][0]?[0]; \n        _ = context.Request.Form[\"id\"][0]?[0];  \n    }\n    private void Undecidable(HttpRequest request)\n    {\n        _ = request.Form[\"id\"]; // Undecidable: request may originate from an action method (which supports binding), or from one of the following overloads (which don't).\n    }\n    public override void OnActionExecuted(ActionExecutedContext context)\n    {\n        _ = context.HttpContext.Request.Form[\"id\"]; // Compliant: Model binding is not supported here\n    }\n    public override void OnActionExecuting(ActionExecutingContext context)\n    {\n        _ = context.HttpContext.Request.Form[\"id\"]; // Compliant: Model binding is not supported here\n    }\n    public override Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)\n    {\n        _ = context.HttpContext.Request.Form[\"id\"]; // Compliant: Model binding is not supported here\n        return base.OnActionExecutionAsync(context, next);\n    }\n}\n\n[Controller]\npublic class PocoController : IActionFilter, IAsyncActionFilter\n{\n    public void OnActionExecuted(ActionExecutedContext context)\n    {\n        _ = context.HttpContext.Request.Form[\"id\"]; // Compliant: Model binding is not supported here\n    }\n    void IActionFilter.OnActionExecuted(Microsoft.AspNetCore.Mvc.Filters.ActionExecutedContext context)\n    {\n        _ = context.HttpContext.Request.Form[\"id\"]; // Compliant: Model binding is not supported here\n    }\n    public void OnActionExecuting(ActionExecutingContext context)\n    {\n        _ = context.HttpContext.Request.Form[\"id\"]; // Compliant: Model binding is not supported here\n    }\n    void IActionFilter.OnActionExecuting(ActionExecutingContext context)\n    {\n        _ = context.HttpContext.Request.Form[\"id\"]; // Compliant: Model binding is not supported here\n    }\n    public Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)\n    {\n        _ = context.HttpContext.Request.Form[\"id\"]; // Compliant: Model binding is not supported here\n        return Task.CompletedTask;\n    }\n    Task IAsyncActionFilter.OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)\n    {\n        _ = context.HttpContext.Request.Form[\"id\"]; // Compliant: Model binding is not supported here\n        return Task.CompletedTask;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AssertionArgsShouldBePassedInCorrectOrder.MsTest.cs",
    "content": "﻿using System;\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\n\nnamespace Tests.Diagnostics\n{\n    [TestClass]\n    class Program\n    {\n        [TestMethod]\n        public void Simple(string str, double d)\n        {\n            Assert.AreEqual(\"\", str);       // Compliant\n            Assert.AreEqual(str, \"\");       // Noncompliant {{Make sure these 2 arguments are in the correct order: expected value, actual value.}}\n            //              ^^^^^^^\n            Assert.AreEqual(42, d);         // Compliant\n            Assert.AreEqual(d, 42);         // Noncompliant\n            //              ^^^^^\n            Assert.AreNotEqual(\"\", str);    // Compliant\n            Assert.AreNotEqual(str, \"\");    // Noncompliant\n            //                 ^^^^^^^\n            Assert.AreNotEqual(42, d);      // Compliant\n            Assert.AreNotEqual(d, 42);      // Noncompliant\n            //                 ^^^^^\n            Assert.AreSame(\"\", str);        // Compliant\n            Assert.AreSame(str, \"\");        // Noncompliant\n            //             ^^^^^^^\n            Assert.AreSame(42, d);          // Compliant\n            Assert.AreSame(d, 42);          // Noncompliant\n            //             ^^^^^\n            Assert.AreNotSame(\"\", str);     // Compliant\n            Assert.AreNotSame(str, \"\");     // Noncompliant\n            //                ^^^^^^^\n            Assert.AreNotSame(42, d);       // Compliant\n            Assert.AreNotSame(d, 42);       // Noncompliant\n            //                ^^^^^\n\n            Assert.AreEqual(\"\", str, \"message\");    // Compliant\n            Assert.AreEqual(str, \"\", \"message\");    // Noncompliant\n            Assert.AreNotEqual(\"\", str, \"message\"); // Compliant\n            Assert.AreNotEqual(str, \"\", \"message\"); // Noncompliant\n            Assert.AreSame(\"\", str, \"message\");     // Compliant\n            Assert.AreSame(str, \"\", \"message\");     // Noncompliant\n            Assert.AreNotSame(\"\", str, \"message\");  // Compliant\n            Assert.AreNotSame(str, \"\", \"message\");  // Noncompliant\n\n            Assert.IsNull(str);\n        }\n\n        [TestMethod]\n        public void Dynamic()\n        {\n            dynamic d = 42;\n            Assert.AreEqual(d, 35);                    // Noncompliant\n            Assert.AreEqual(35, d);                    // Compliant\n            Assert.AreEqual(actual: d, expected: 35);  // Compliant\n            Assert.AreEqual(actual: 35, expected: d);  // Noncompliant\n        }\n\n        [TestMethod]\n        public void BrokeSyntax()\n        {\n            double d = 42;\n            Assert.Equual(d, 42);   // Error [CS0117]\n        }\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/6630\nnamespace Repro_6630\n{\n    [TestClass]\n    class Program\n    {\n        [TestMethod]\n        public void Foo()\n        {\n            var str = \"\";\n            Assert.AreEqual(actual: \"\", expected: str); // Noncompliant\n            Assert.AreEqual(expected: \"\", actual: str); // Compliant\n            Assert.AreEqual(actual: str, expected: \"\"); // Compliant\n            Assert.AreEqual(expected: str, actual: \"\"); // Noncompliant\n\n            Assert.AreNotEqual(actual: \"\", notExpected: str);   // Noncompliant\n            Assert.AreSame(actual: \"\", expected: str);          // Noncompliant\n            Assert.AreNotSame(actual: \"\", notExpected: str);    // Noncompliant\n\n            int d = 42;\n            Assert.AreEqual<int>(actual: 1, expected: d);           // Noncompliant\n            Assert.AreEqual(actual: null, expected: new Program()); // Noncompliant\n\n            Assert.AreEqual(message: \"\", expected: str, actual: \"\");    // Noncompliant\n            //                           ^^^^^^^^^^^^^^^^^^^^^^^^^\n            Assert.AreEqual(expected: str, message: \"\", actual: \"\");    // Noncompliant\n            //              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        }\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/6547\nnamespace Repro_6547\n{\n    [TestClass]\n    class Program\n    {\n        public enum Seasons { Spring, Summer, Autumn, Winter }\n\n        [TestMethod]\n        public void TestString()\n        {\n            string stringToTest = RetrieveString();\n            const string constString = \"Spring\";\n\n            Assert.AreEqual(expected: stringToTest, actual: constString); // Noncompliant\n            Assert.AreEqual(expected: constString, actual: stringToTest); // Compliant\n        }\n\n        [TestMethod]\n        public void TestEnum()\n        {\n            Seasons seasonToTest = RetrieveSeason();\n\n            Assert.AreEqual(expected: seasonToTest, actual: Seasons.Spring); // Noncompliant\n            Assert.AreEqual(expected: Seasons.Spring, actual: seasonToTest); // Compliant\n        }\n\n        public Seasons RetrieveSeason() => Seasons.Spring;\n        public string RetrieveString() => \"Spring\";\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AssertionArgsShouldBePassedInCorrectOrder.NUnit.cs",
    "content": "﻿using System;\nusing NUnit.Framework;\n\nnamespace Tests.Diagnostics\n{\n    [TestFixture]\n    class Program\n    {\n        void FakeAssert(object a, object b) { }\n\n        [Test]\n        public void Simple(string str, double d)\n        {\n            Assert.AreEqual(\"\", str);       // Compliant\n            Assert.AreEqual(str, \"\");       // Noncompliant {{Make sure these 2 arguments are in the correct order: expected value, actual value.}}\n            //              ^^^^^^^\n            Assert.AreEqual(42, d);         // Compliant\n            Assert.AreEqual(d, 42);         // Noncompliant\n            //              ^^^^^\n            Assert.AreNotEqual(\"\", str);    // Compliant\n            Assert.AreNotEqual(str, \"\");    // Noncompliant\n            //                 ^^^^^^^\n            Assert.AreNotEqual(42, d);      // Compliant\n            Assert.AreNotEqual(d, 42);      // Noncompliant\n            //                 ^^^^^\n            Assert.AreSame(\"\", str);        // Compliant\n            Assert.AreSame(str, \"\");        // Noncompliant\n            //             ^^^^^^^\n            Assert.AreSame(42, d);          // Compliant\n            Assert.AreSame(d, 42);          // Noncompliant\n            //             ^^^^^\n            Assert.AreNotSame(\"\", str);     // Compliant\n            Assert.AreNotSame(str, \"\");     // Noncompliant\n            //                ^^^^^^^\n            Assert.AreNotSame(42, d);       // Compliant\n            Assert.AreNotSame(d, 42);       // Noncompliant\n            //                ^^^^^\n\n            Assert.AreEqual(\"\", str, \"message\");    // Compliant\n            Assert.AreEqual(str, \"\", \"message\");    // Noncompliant\n            Assert.AreNotEqual(\"\", str, \"message\"); // Compliant\n            Assert.AreNotEqual(str, \"\", \"message\"); // Noncompliant\n            Assert.AreSame(\"\", str, \"message\");     // Compliant\n            Assert.AreSame(str, \"\", \"message\");     // Noncompliant\n            Assert.AreNotSame(\"\", str, \"message\");  // Compliant\n            Assert.AreNotSame(str, \"\", \"message\");  // Noncompliant\n\n            Assert.IsNull(str);\n            FakeAssert(d, 42);\n        }\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/6630\nnamespace Repro_6630\n{\n    [TestFixture]\n    class Program\n    {\n        [Test]\n        public void Foo()\n        {\n            var str = \"\";\n            Assert.AreEqual(actual: \"\", expected: str); // Noncompliant\n            Assert.AreEqual(expected: \"\", actual: str); // Compliant\n            Assert.AreEqual(actual: str, expected: \"\"); // Compliant\n            Assert.AreEqual(expected: str, actual: \"\"); // Noncompliant\n\n            Assert.AreNotEqual(actual: \"\", expected: str);  // Noncompliant\n            Assert.AreSame(actual: \"\", expected: str);      // Noncompliant\n            Assert.AreNotSame(actual: \"\", expected: str);   // Noncompliant\n\n            Assert.AreEqual(actual: null, expected: new Program()); // Noncompliant\n\n            Assert.AreEqual(message: \"\", expected: str, actual: \"\");    // Noncompliant\n            //                           ^^^^^^^^^^^^^^^^^^^^^^^^^\n            Assert.AreEqual(expected: str, message: \"\", actual: \"\");    // Noncompliant\n            //              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        }\n\n        [Test]\n        public void Dynamic()\n        {\n            dynamic d = 42;\n            Assert.AreEqual(d, 35);                    // Noncompliant\n            Assert.AreEqual(35, d);                    // Compliant\n            Assert.AreEqual(actual: d, expected: 35);  // Compliant\n            Assert.AreEqual(actual: 35, expected: d);  // Noncompliant\n        }\n\n        [Test]\n        public void BrokeSyntax()\n        {\n            double d = 42;\n            Assert.Equual(d, 42);   // Error [CS0117]\n        }\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/6547\nnamespace Repro_6547\n{\n    [TestFixture]\n    class Program\n    {\n        public enum Seasons { Spring, Summer, Autumn, Winter }\n\n        [Test]\n        public void TestString()\n        {\n            string stringToTest = RetrieveString();\n            const string constString = \"Spring\";\n\n            Assert.AreEqual(expected: stringToTest, actual: constString); // Noncompliant\n            Assert.AreEqual(expected: constString, actual: stringToTest); // Compliant\n        }\n\n        [Test]\n        public void TestEnum()\n        {\n            Seasons seasonToTest = RetrieveSeason();\n\n            Assert.AreEqual(expected: seasonToTest, actual: Seasons.Spring); //Noncompliant\n            Assert.AreEqual(expected: Seasons.Spring, actual: seasonToTest); // Compliant\n        }\n\n        public Seasons RetrieveSeason() => Seasons.Spring;\n        public string RetrieveString() => \"Spring\";\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AssertionArgsShouldBePassedInCorrectOrder.NUnit4.cs",
    "content": "using System;\nusing NUnit.Framework;\nusing NUnit.Framework.Legacy;\n\nnamespace Tests.Diagnostics\n{\n    [TestFixture]\n    class ProgramNUnit4\n    {\n        void FakeAssert(object a, object b) { }\n\n        [Test]\n        public void Simple(string str, double d)\n        {\n            ClassicAssert.AreEqual(\"\", str);       // Compliant\n            ClassicAssert.AreEqual(str, \"\");       // Noncompliant {{Make sure these 2 arguments are in the correct order: expected value, actual value.}}\n            //                     ^^^^^^^\n            ClassicAssert.AreEqual(42, d);         // Compliant\n            ClassicAssert.AreEqual(d, 42);         // Noncompliant\n            //                     ^^^^^\n            ClassicAssert.AreNotEqual(\"\", str);    // Compliant\n            ClassicAssert.AreNotEqual(str, \"\");    // Noncompliant\n            //                        ^^^^^^^\n            ClassicAssert.AreNotEqual(42, d);      // Compliant\n            ClassicAssert.AreNotEqual(d, 42);      // Noncompliant\n            //                        ^^^^^\n            ClassicAssert.AreSame(\"\", str);        // Compliant\n            ClassicAssert.AreSame(str, \"\");        // Noncompliant\n            //                    ^^^^^^^\n            ClassicAssert.AreSame(42, d);          // Compliant\n            ClassicAssert.AreSame(d, 42);          // Noncompliant\n            //                    ^^^^^\n            ClassicAssert.AreNotSame(\"\", str);     // Compliant\n            ClassicAssert.AreNotSame(str, \"\");     // Noncompliant\n            //                       ^^^^^^^\n            ClassicAssert.AreNotSame(42, d);       // Compliant\n            ClassicAssert.AreNotSame(d, 42);       // Noncompliant\n            //                       ^^^^^\n\n            ClassicAssert.AreEqual(\"\", str, \"message\");    // Compliant\n            ClassicAssert.AreEqual(str, \"\", \"message\");    // Noncompliant\n            ClassicAssert.AreNotEqual(\"\", str, \"message\"); // Compliant\n            ClassicAssert.AreNotEqual(str, \"\", \"message\"); // Noncompliant\n            ClassicAssert.AreSame(\"\", str, \"message\");     // Compliant\n            ClassicAssert.AreSame(str, \"\", \"message\");     // Noncompliant\n            ClassicAssert.AreNotSame(\"\", str, \"message\");  // Compliant\n            ClassicAssert.AreNotSame(str, \"\", \"message\");  // Noncompliant\n\n            ClassicAssert.IsNull(str);\n            FakeAssert(d, 42);\n        }\n    }\n}\n\nnamespace Repro_NUnit4_NamedArgs\n{\n    [TestFixture]\n    class Program\n    {\n        [Test]\n        public void Foo()\n        {\n            var str = \"\";\n            ClassicAssert.AreEqual(actual: \"\", expected: str);  // Noncompliant\n            ClassicAssert.AreEqual(expected: \"\", actual: str);  // Compliant\n            ClassicAssert.AreEqual(actual: str, expected: \"\");  // Compliant\n            ClassicAssert.AreEqual(expected: str, actual: \"\");  // Noncompliant\n\n            ClassicAssert.AreNotEqual(actual: \"\", expected: str); // Noncompliant\n            ClassicAssert.AreSame(actual: \"\", expected: str);     // Noncompliant\n            ClassicAssert.AreNotSame(actual: \"\", expected: str);  // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AssertionArgsShouldBePassedInCorrectOrder.Xunit.cs",
    "content": "﻿using System;\nusing Xunit;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        [Fact]\n        public void Simple(string str, double d)\n        {\n            Assert.Equal(\"\", str);       // Compliant\n            Assert.Equal(str, \"\");       // Noncompliant {{Make sure these 2 arguments are in the correct order: expected value, actual value.}}\n            //           ^^^^^^^\n            Assert.Equal(42, d);         // Compliant\n            Assert.Equal(d, 42);         // Noncompliant\n            //           ^^^^^\n            Assert.NotEqual(\"\", str);    // Compliant\n            Assert.NotEqual(str, \"\");    // Noncompliant\n            //              ^^^^^^^\n            Assert.NotEqual(42, d);      // Compliant\n            Assert.NotEqual(d, 42);      // Noncompliant\n            //              ^^^^^\n            Assert.Same(\"\", str);        // Compliant\n            Assert.Same(str, \"\");        // Noncompliant\n            //          ^^^^^^^\n            Assert.Same(42, d);          // Compliant\n            Assert.Same(d, 42);          // Noncompliant\n            //          ^^^^^\n            Assert.NotSame(\"\", str);     // Compliant\n            Assert.NotSame(str, \"\");     // Noncompliant\n            //             ^^^^^^^\n            Assert.NotSame(42, d);       // Compliant\n            Assert.NotSame(d, 42);       // Noncompliant\n            //             ^^^^^\n\n            Assert.Null(str);\n        }\n\n        [Fact]\n        public void Dynamic()\n        {\n            dynamic d = 42;\n            Assert.Equal(d, 35);                    // Noncompliant\n            Assert.Equal(35, d);                    // Compliant\n            Assert.Equal(actual: d, expected: 35);  // Compliant\n            Assert.Equal(actual: 35, expected: d);  // Noncompliant\n        }\n\n        [Fact]\n        public void BrokeSyntax()\n        {\n            double d = 42;\n            Assert.Equual(d, 42);   // Error [CS0117]\n        }\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/6630\nnamespace Repro_6630\n{\n    class Program\n    {\n        [Fact]\n        public void Foo()\n        {\n            var str = \"\";\n            Assert.Equal(actual: \"\", expected: str);    // Noncompliant\n            Assert.Equal(expected: \"\", actual: str);    // Compliant\n            Assert.Equal(actual: str, expected: \"\");    // Compliant\n            Assert.Equal(expected: str, actual: \"\");    // Noncompliant\n\n            Assert.Same(actual: \"\", expected: str);     // Noncompliant\n            Assert.NotSame(actual: \"\", expected: str);  // Noncompliant\n\n            int d = 42;\n            Assert.Equal<int>(actual: 1, expected: d);              // Noncompliant\n            Assert.Equal(actual: null, expected: new Program());    // Noncompliant\n\n            Assert.Equal(expected: str, actual: \"\");    // Noncompliant\n            //           ^^^^^^^^^^^^^^^^^^^^^^^^^\n        }\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/6547\nnamespace Repro_6547\n{\n    class Program\n    {\n        public enum Seasons { Spring, Summer, Autumn, Winter }\n\n        [Fact]\n        public void TestString()\n        {\n            string stringToTest = RetrieveString();\n            const string constString = \"Spring\";\n\n            Assert.Same(expected: stringToTest, actual: constString); // Noncompliant\n            Assert.Same(expected: constString, actual: stringToTest); // Compliant\n        }\n\n        [Fact]\n        public void TestEnum()\n        {\n            Seasons seasonToTest = RetrieveSeason();\n\n            Assert.Same(expected: seasonToTest, actual: Seasons.Spring); // Noncompliant\n            Assert.Same(expected: Seasons.Spring, actual: seasonToTest); // Compliant\n        }\n\n        public Seasons RetrieveSeason() => Seasons.Spring;\n        public string RetrieveString() => \"Spring\";\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AssertionArgsShouldBePassedInCorrectOrder.XunitV3.cs",
    "content": "﻿using System;\nusing Xunit;\n\nnamespace Tests.Diagnostics\n{\n    public class XUnitV3Tests\n    {\n        [Fact]\n        public void Simple(string str)\n        {\n            Assert.Equivalent(\"\", str);               // Compliant\n            Assert.Equivalent(str, \"\");               // Noncompliant {{Make sure these 2 arguments are in the correct order: expected value, actual value.}}\n\n            Assert.EquivalentWithExclusions(\"\", str); // Compliant\n            Assert.EquivalentWithExclusions(str, \"\"); // Noncompliant\n\n            Assert.StrictEqual(\"\", str);              // Compliant\n            Assert.StrictEqual(str, \"\");              // Noncompliant\n\n            Assert.NotStrictEqual(\"\", str);           // Compliant\n            Assert.NotStrictEqual(str, \"\");           // Noncompliant\n\n            Assert.Contains(\"\", str);                 // Compliant\n            Assert.Contains(str, \"\");                 // Noncompliant\n\n            Assert.DoesNotContain(\"\", str);           // Compliant\n            Assert.DoesNotContain(str, \"\");           // Noncompliant\n\n            Assert.StartsWith(\"\", str);               // Compliant\n            Assert.StartsWith(str, \"\");               // Noncompliant\n\n            Assert.EndsWith(\"\", str);                 // Compliant\n            Assert.EndsWith(str, \"\");                 // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AssertionsShouldBeComplete.AllFrameworks.cs",
    "content": "﻿using FluentAssertions;\nusing NFluent;\nusing NSubstitute;\nusing System;\n\nnamespace AllFrameworksTests\n{\n    internal class Tests\n    {\n        public void FluentAssertions(string s)\n        {\n            s.Should(); // Noncompliant\n        }\n\n        public void NFluent()\n        {\n            Check.That(0); // Noncompliant\n        }\n\n        public void NSubstitute(IComparable comparable)\n        {\n            comparable.Received(); // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AssertionsShouldBeComplete.FluentAssertions.CSharp7.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing FluentAssertions;\nusing FluentAssertions.Primitives;\n\npublic class Program\n{\n    public void StringAssertions()\n    {\n        var s = \"Test\";\n        s.Should();                   // Noncompliant {{Complete the assertion}}\n        //^^^^^^\n        s[0].Should();                // Error [CS0121] ambiguous calls\n                                      // Noncompliant@-1\n\n        s.Should().Be(\"Test\");        // Compliant\n    }\n\n    public void CollectionAssertions()\n    {\n        var collection = new[] { \"Test\", \"Test\" };\n        collection.Should();                               // Error [CS0121] ambiguous calls\n                                                           // Noncompliant@-1\n        collection.Should<string>();                       // Noncompliant\n\n        collection.Should<string>().Equal(\"Test\", \"Test\"); // Compliant\n    }\n\n    public void DictionaryAssertions()\n    {\n        var dict = new Dictionary<string, object>();\n        dict[\"A\"].Should();    // Noncompliant\n    }\n\n    public StringAssertions ReturnedByReturn()\n    {\n        var s = \"Test\";\n        return s.Should();     // Compliant\n    }\n\n    public StringAssertions ReturnedByArrow(string s) =>\n        s.Should();            // Compliant\n\n    public object ReturnedByArrowWithConversion(string s) =>\n        (object)s.Should();    // Compliant\n\n    public void CalledByArrow(string s) =>\n        s.Should();            // Noncompliant\n\n    public void Assigned()\n    {\n        var s = \"Test\";\n        var assertion = s.Should();  // Compliant\n        assertion = s.Should();      // Compliant\n    }\n\n    public void PassedAsArgument()\n    {\n        var s = \"Test\";\n        ValidateString(s.Should());  // Compliant\n    }\n    private void ValidateString(StringAssertions assertion) { }\n\n    public void UnreducedCall()\n    {\n        var s = \"Test\";\n        FluentAssertions.AssertionExtensions.Should(s); // Noncompliant\n    }\n\n    public void ReturnedInLambda()\n    {\n        Func<StringAssertions> a = () => \"Test\".Should();\n    }\n\n    public void CustomAssertions()\n    {\n        var custom = new Custom();\n        custom.Should();                    // Noncompliant The custom assertion derives from ReferenceTypeAssertions\n        custom.Should().BeCustomAsserted(); // Compliant\n    }\n\n    public void CustomStructAssertions()\n    {\n        var custom = new CustomStruct();\n        custom.Should();                    // Compliant Potential FN. CustomStructAssertion does not derive from ReferenceTypeAssertions and is not considered a custom validation.\n        custom.Should().BeCustomAsserted(); // Compliant\n    }\n}\n\npublic static class CustomAssertionExtension\n{\n    public static CustomAssertion Should(this Custom instance)\n        => new CustomAssertion(instance);\n}\n\npublic class CustomAssertion : ReferenceTypeAssertions<Custom, CustomAssertion>\n{\n    public CustomAssertion(Custom instance)\n        : base(instance)\n    {\n    }\n\n    protected override string Identifier => \"custom\";\n\n    public void BeCustomAsserted()\n    {\n        // Not implemented\n    }\n}\n\npublic class Custom { }\n\npublic static class CustomStructAssertionExtension\n{\n    public static CustomStructAssertion Should(this CustomStruct instance)\n        => new CustomStructAssertion(instance);\n}\n\npublic class CustomStructAssertion // Does not derive from ReferenceTypeAssertions\n{\n    public CustomStructAssertion(CustomStruct instance) { }\n\n    public void BeCustomAsserted()\n    {\n        // Not implemented\n    }\n}\n\npublic struct CustomStruct { }\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AssertionsShouldBeComplete.FluentAssertions.Latest.cs",
    "content": "﻿#nullable enable\n\nusing System;\nusing System.Collections.Generic;\nusing FluentAssertions;\nusing FluentAssertions.Primitives;\n\npublic class Program\n{\n    public void StringAssertions()\n    {\n        var s = \"Test\";\n        s.Should();              // Noncompliant\n        s?.Should();             // Noncompliant\n        s[0].Should();           // Noncompliant (no \"ambiguous calls\" compiler error as in C# 7)\n        s?[0].Should();          // Noncompliant\n        s.Should().Be(\"Test\");   // Compliant\n        s.Should()?.Be(\"Test\");  // Compliant\n        s.Should()!?.Be(\"Test\"); // Compliant\n    }\n\n    public void CollectionAssertions()\n    {\n        var collection = new[] { \"Test\", \"Test\" };\n        collection.Should(); // Noncompliant (no \"ambiguous calls\" compiler error as in C# 7)\n    }\n\n    public void DictAssertions()\n    {\n        var dict = new Dictionary<string, object>();\n        dict[\"A\"]?.Should();   // Noncompliant\n        //         ^^^^^^\n        dict?[\"A\"]?.Should();  // Noncompliant\n        //          ^^^^^^\n        dict?[\"A\"]!.Should();  // Noncompliant\n        //          ^^^^^^\n    }\n\n    public void LocalFunction()\n    {\n        var s = \"Test\";\n\n        StringAssertions ExpressionBodyLocalFunction() =>\n            s.Should();\n\n        void VoidReturningExpressionBodyLocalFunction() =>\n            s.Should();  // Noncompliant\n\n        StringAssertions ReturnLocalFunction()\n        {\n            return s.Should();\n        }\n    }\n\n    public StringAssertions PropertyArrow => \"Test\".Should();\n\n    public StringAssertions PropertyGetterArrow\n    {\n        get => \"Test\".Should();\n        set => \"Test\".Should(); // Noncompliant\n    }\n\n    public StringAssertions PropertyGetterReturn\n    {\n        get\n        {\n            return \"Test\".Should();\n        }\n    }\n\n    public void NullConditionalAssignment(Wrapper wrapper)\n    {\n        wrapper?.Result = \"test\".Should(); // Compliant https://sonarsource.atlassian.net/browse/NET-2671\n        wrapper.Result = \"test\".Should();  // Compliant\n    }\n\n    public class Wrapper\n    {\n        public StringAssertions? Result { get; set; }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AssertionsShouldBeComplete.NFluent.Latest.cs",
    "content": "﻿using System;\nusing System.Threading.Tasks;\nusing NFluent;\nusing static NFluent.Check;\n\npublic class Program\n{\n    public void CheckThat()\n    {\n        That(0);     // Noncompliant {{Complete the assertion}}\n    //  ^^^^\n        That<int>(); // Noncompliant\n\n        That(1).IsEqualTo(1);\n    }\n\n    public void NullConditionalAssignment(Wrapper wrapper)\n    {\n        wrapper?.Result = Check.That(1); // Compliant https://sonarsource.atlassian.net/browse/NET-2671\n        wrapper.Result = Check.That(1);  // Compliant\n    }\n\n    public class Wrapper\n    {\n        public ICheck<int> Result;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AssertionsShouldBeComplete.NFluent.cs",
    "content": "﻿using System;\nusing System.Threading.Tasks;\nusing NFluent;\n\npublic class Program\n{\n    public void CheckThat()\n    {\n        Check.That(0);     // Noncompliant {{Complete the assertion}}\n        //    ^^^^\n        Check.That<int>(); // Noncompliant\n\n        Check.That(1).IsEqualTo(1);\n    }\n\n    public void CheckThatEnum()\n    {\n        Check.ThatEnum(AttributeTargets.All); // Noncompliant {{Complete the assertion}}\n        //    ^^^^^^^^\n        Check.ThatEnum<AttributeTargets>(AttributeTargets.All);  // Noncompliant\n\n        Check.ThatEnum(AttributeTargets.All).IsEqualTo(AttributeTargets.All);\n    }\n\n    public void CheckThatCode()\n    {\n        Check.ThatCode(() => { });     // Noncompliant {{Complete the assertion}}\n        //    ^^^^^^^^\n        Check.ThatCode(() => 1);       // Noncompliant\n        Check.ThatCode(CheckThatCode); // Noncompliant\n\n        Check.ThatCode(() => { }).DoesNotThrow();\n    }\n\n    public async Task CheckThatAsyncCode()\n    {\n        Check.ThatAsyncCode(async () => await Task.CompletedTask); // Noncompliant {{Complete the assertion}}\n        //    ^^^^^^^^^^^^^\n        Check.ThatAsyncCode(async () => await Task.FromResult(1)); // Noncompliant\n        Check.ThatAsyncCode(CheckThatAsyncCode);                   // Noncompliant\n\n        Check.ThatAsyncCode(async () => await Task.CompletedTask).DoesNotThrow();\n    }\n\n    public async Task CheckThatDynamic(dynamic expando)\n    {\n        Check.ThatDynamic(1);       // Noncompliant {{Complete the assertion}}\n        //    ^^^^^^^^^^^\n        Check.ThatDynamic(expando); // Noncompliant\n\n        Check.ThatDynamic(1).IsNotNull();\n    }\n\n    public ICheck<int> CheckReturnedByReturn()\n    {\n        return Check.That(1);\n    }\n\n    public ICheck<int> CheckReturnedByExpressionBody() =>\n        Check.That(1);\n\n    public void AnonymousInvocation(Func<Action> a) =>\n        a()();\n}\n\nnamespace OtherCheck\n{\n    public static class Check\n    {\n        public static void That(int i) { }\n    }\n\n    public class Test\n    {\n        public void CheckThat()\n        {\n            Check.That(1); // Compliant. Not NFluent\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AssertionsShouldBeComplete.NSubstitute.cs",
    "content": "﻿using NSubstitute;\n\npublic interface ICommand\n{\n    void Execute();\n}\n\nnamespace NSubstituteTests\n{\n    internal class Tests\n    {\n        public void Received()\n        {\n            var command = Substitute.For<ICommand>();\n            command.Received();                         // Noncompliant {{Complete the assertion}}\n            //      ^^^^^^^^\n            command.Received(requiredNumberOfCalls: 2); // Noncompliant\n            command.Received<ICommand>();               // Noncompliant\n            SubstituteExtensions.Received(command);     // Noncompliant\n\n            command.Received().Execute();\n        }\n\n        public void DidNotReceive()\n        {\n            var command = Substitute.For<ICommand>();\n            command.DidNotReceive();           // Noncompliant {{Complete the assertion}}\n            //      ^^^^^^^^^^^^^\n            command.DidNotReceive<ICommand>(); // Noncompliant\n\n            command.DidNotReceive().Execute();\n        }\n\n        public void ReceivedWithAnyArgs()\n        {\n            var command = Substitute.For<ICommand>();\n            command.ReceivedWithAnyArgs();                         // Noncompliant {{Complete the assertion}}\n            //      ^^^^^^^^^^^^^^^^^^^\n            command.ReceivedWithAnyArgs(requiredNumberOfCalls: 2); // Noncompliant\n            command.ReceivedWithAnyArgs<ICommand>();               // Noncompliant\n\n            command.ReceivedWithAnyArgs().Execute();\n        }\n\n        public void DidNotReceiveWithAnyArgs()\n        {\n            var command = Substitute.For<ICommand>();\n            command.DidNotReceiveWithAnyArgs();           // Noncompliant {{Complete the assertion}}\n            //      ^^^^^^^^^^^^^^^^^^^^^^^^\n            command.DidNotReceiveWithAnyArgs<ICommand>(); // Noncompliant\n\n            command.DidNotReceiveWithAnyArgs().Execute();\n        }\n\n        public void ReceivedCalls()\n        {\n            var command = Substitute.For<ICommand>();\n            command.ReceivedCalls();           // Noncompliant {{Complete the assertion}}\n            //      ^^^^^^^^^^^^^\n            command.ReceivedCalls<ICommand>(); // Noncompliant\n\n            var calls = command.ReceivedCalls();\n        }\n    }\n}\n\nnamespace OtherReceived\n{\n    public static class OtherExtensions\n    {\n        public static void Received<T>(this T something) { }\n    }\n\n    public class Test\n    {\n        public void Received(ICommand command)\n        {\n            command.Received(); // Compliant. Other Received call\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AssignmentInsideSubExpression.Latest.cs",
    "content": "﻿using System;\nusing System.Threading.Tasks;\n\nnamespace Tests.Diagnostics\n{\n    public class CoalescingAssignment\n    {\n        public void Test()\n        {\n            int? val = null;\n            SomeMethod(val ??= 1); // Compliant, see e.g. https://stackoverflow.com/a/64666607\n            val ??= 1;\n\n            bool? value = null;\n            if (value ??= true) { } // Compliant, see. e.g. https://stackoverflow.com/a/64666607\n        }\n        void SomeMethod(int val) { }\n    }\n\n    public class AssignmentInsideSubExpression\n    {\n        void foo(int a)\n        {\n        }\n\n        void Foo()\n        {\n            int i = 0;\n\n            foo(i >>>= 1); // Noncompliant\n        }\n    }\n\n    // https://sonarsource.atlassian.net/browse/NET-1136\n    public class Bar\n    {\n        private async Task<int?> GetFooNullableAsyncTriggered() =>\n            await (a ??= _fooProvider.GetFooAsync()); // Compliant see e.g. https://stackoverflow.com/a/64666607\n\n        public class FooProvider\n        {\n            public Task<int?> GetFooAsync() => Task.FromResult<int?>(42);\n        }\n        private Task<int?> a;\n        private readonly FooProvider _fooProvider = new FooProvider();\n    }\n}\n\nnamespace CSharp14\n{\n    public class OverriddenCompoundAssignment\n    {\n        void Test()\n        {\n            var a = new C1 { Value = 1 };\n            SomeMethod(a += 1); // Noncompliant\n        }\n\n        void SomeMethod(C1 c) { }\n        class C1\n        {\n            public int Value;\n\n            public void operator +=(int x)\n            {\n                Value += x;\n            }\n        }\n    }\n\n    public class NullConditionalAssignment\n    {\n        void Test()\n        {\n            var a = new C2();\n            if ((bool)a?.Value = false) // Noncompliant\n            {\n\n            }\n\n            a?.Value = true;            // Compliant https://sonarsource.atlassian.net/browse/NET-2391\n            if (a is not null)\n            {\n                a.Value = true;        // Compliant\n            }\n        }\n        class C2\n        {\n            public bool Value;\n        }\n\n        public class Nesting\n        {\n            public Nesting Prop { get; set; }\n            public Nesting this[int index] { get { return new Nesting(); } set { } }\n        }\n\n        void CompliantTest()\n        {\n            var prop = new Nesting();\n            prop?.Prop = new Nesting();\n            prop?.Prop?.Prop = new Nesting();\n            prop?.Prop.Prop = new Nesting();\n            prop.Prop?.Prop = new Nesting();\n            prop.Prop?.Prop?.Prop = new Nesting();\n            prop?.Prop.Prop?.Prop = new Nesting();\n            prop?.Prop.Prop.Prop = new Nesting();\n            var indexer = new Nesting();\n            indexer?[0] = new Nesting();\n            indexer?[0]?[0] = new Nesting();\n            indexer?[0]?[0] = new Nesting();\n            indexer?[0]?[0]?[0] = new Nesting();\n            indexer?[0]?[0][0] = new Nesting();\n            indexer?[0][0]?[0] = new Nesting();\n            indexer[0]?[0]?[0] = new Nesting();\n            var mixed = new Nesting();\n            mixed?[0]?.Prop = new Nesting();\n            mixed?.Prop?[0] = new Nesting();\n            mixed?[0]?.Prop?[0] = new Nesting();\n            mixed?.Prop?[0]?.Prop = new Nesting();\n\n            Action dontMindMeIAmHappyLittleInnocentLambda = () =>\n            {\n                var prop = new Nesting();\n                prop?.Prop = new Nesting();  // Compliant\n            };\n        }\n\n        void NonCompliantTest()\n        {\n            var prop = new Nesting();\n            SomeMethod(prop?.Prop = new Nesting());             // Noncompliant\n            SomeMethod(prop?.Prop?.Prop = new Nesting());       // Noncompliant\n            SomeMethod(prop?.Prop.Prop = new Nesting());        // Noncompliant\n            SomeMethod(prop.Prop?.Prop = new Nesting());        // Noncompliant\n            SomeMethod(prop.Prop?.Prop?.Prop = new Nesting());  // Noncompliant\n            SomeMethod(prop?.Prop.Prop?.Prop = new Nesting());  // Noncompliant\n            SomeMethod(prop?.Prop?.Prop.Prop = new Nesting());  // Noncompliant\n            SomeMethod(prop?.Prop.Prop.Prop = new Nesting());   // Noncompliant\n            var indexer = new Nesting();\n            SomeMethod(indexer?[0] = new Nesting());            // Noncompliant\n            SomeMethod(indexer?[0]?[0] = new Nesting());        // Noncompliant\n            SomeMethod(indexer?[0]?[0] = new Nesting());        // Noncompliant\n            SomeMethod(indexer?[0]?[0]?[0] = new Nesting());    // Noncompliant\n            SomeMethod(indexer?[0]?[0][0] = new Nesting());     // Noncompliant\n            SomeMethod(indexer?[0][0]?[0] = new Nesting());     // Noncompliant\n            SomeMethod(indexer[0]?[0]?[0] = new Nesting());     // Noncompliant\n            var mixed = new Nesting();\n            SomeMethod(mixed?[0]?.Prop = new Nesting());        // Noncompliant\n            SomeMethod(mixed?.Prop?[0] = new Nesting());        // Noncompliant\n            SomeMethod(mixed?[0]?.Prop?[0] = new Nesting());    // Noncompliant\n            SomeMethod(mixed?.Prop?[0]?.Prop = new Nesting());  // Noncompliant\n\n            if ((prop?.Prop?.Prop.Prop = new Nesting())) { }    // Noncompliant\n                                                                // Error@-1 [CS0029]\n            if ((indexer?[0]?[0][0] = new Nesting())) { }       // Noncompliant\n                                                                // Error@-1 [CS0029]\n        }\n        void SomeMethod(Nesting nesting) { }\n\n        public class ConditionalAccessExpressionOutsideSubExpression\n        {\n            public void Test(Sample sample)\n            {\n                string mappingSpan = null;\n                sample?.Invoke(new Sample(mappingSpan = \"7\"));  // Noncompliant\n            }\n            public class Sample(string x)\n            {\n                public void Invoke(object b) { }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AssignmentInsideSubExpression.TopLevelStatements.cs",
    "content": "﻿using System.IO;\n\nvar topLevel = 0;\nMethod(topLevel = 42); // Noncompliant\nvar person = new { FirstName = \"Scott\", LastName = \"Hunter\", Age = 25 };\nvar otherPerson = person with { LastName = \"Hanselman\", Age = topLevel = 42 }; // Noncompliant\n\nvoid Method(int arg)\n{\n    var i = 0;\n    Method(i = 42); // Noncompliant\n}\n\nvoid WithRecordClone()\n{\n    var zero = new Record() { Value = 0 };\n    var answer = zero with { Value = 42 };\n    var badAnswer = zero with { Value = topLevel = 42 };  // Noncompliant\n\n    var one = new PositionalRecord(1) { Value = 1 };\n    var clone = one with { Value = 2 };\n    var badClone = one with { Value = topLevel = 2 };     // Noncompliant\n}\n\nvoid TargetTypedNew()\n{\n    Record r;\n    Method1(r = new());                // Noncompliant\n    PositionalRecord p;\n    Method2(p = new(42));              // Noncompliant\n\n    void Method1(Record arg) { }\n    void Method2(PositionalRecord arg) { }\n}\n\nvoid WithPositionalRecord()\n{\n    var x = 42;\n    new PositionalRecord(x);\n    new PositionalRecord(x = 42); // Noncompliant\n}\n\nasync void IsNotNull(StreamReader reader)\n{\n    string line;\n    // See: https://github.com/SonarSource/sonar-dotnet/issues/4264\n    while ((line = await reader.ReadLineAsync()) is not null)\n    {\n    }\n\n    while ((line = await reader.ReadLineAsync()) is null)\n    {\n    }\n}\n\nvoid WithRecordStructClone()\n{\n    var zero = new RecordStruct() { Value = 0 };\n    var answer = zero with { Value = 42 };\n    var badAnswer = zero with { Value = topLevel = 42 };  // Noncompliant\n\n    var one = new PositionalRecordStruct(1) { Value = 1 };\n    var clone = one with { Value = 2 };\n    var badClone = one with { Value = topLevel = 2 };     // Noncompliant\n}\n\nrecord Record\n{\n    public int Value { get; init; }\n}\n\nrecord PositionalRecord(int Input)\n{\n    public int Value { get; init; } = Input;\n\n    private void Method(int arg = 42)\n    {\n        var i = 0;\n        Method(i = 42); // Noncompliant\n    }\n\n    private void Method2()\n    {\n        int y, z;\n        var x = (y, z) = (16, 23);\n    }\n}\n\n// See https://github.com/SonarSource/sonar-dotnet/issues/4446\ninterface ICustomMsgQueue\n{\n    string? Pop();\n}\n\nclass MessageQueueUseCase\n{\n    void Process(ICustomMsgQueue queue)\n    {\n        string msg;\n        while ((msg = queue.Pop()) is not null)\n        {\n        }\n\n        do\n        {\n        } while ((msg = queue.Pop()) is null);\n    }\n}\n\nrecord struct RecordStruct\n{\n    public int Value { get; init; }\n}\n\nrecord struct PositionalRecordStruct(int Input)\n{\n    public int Value { get; init; } = Input;\n\n    private void Method(int arg = 42)\n    {\n        var i = 0;\n        Method(i = 42); // Noncompliant\n    }\n\n    private void Method2()\n    {\n        int y;\n        (y, var x) = (16, 23);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AssignmentInsideSubExpression.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\n\nnamespace Tests.Diagnostics\n{\n    public class AssignmentInsideSubExpression\n    {\n        void foo(int a)\n        {\n        }\n\n        void foo(bool a)\n        {\n        }\n\n        int foo(Func<int, int> f)\n        {\n            throw new Exception();\n        }\n\n        private class MyClass\n        {\n            public int MyField;\n        }\n\n        void Foo()\n        {\n            int i = 0;\n\n            foo(i = 42); // Noncompliant {{Extract the assignment of 'i' from this expression.}}\n//                ^\n            foo(i += 42); // Noncompliant\n            foo(i -= 42); // Noncompliant\n            foo(i *= 42); // Noncompliant\n            foo(i /= 42); // Noncompliant\n            foo(i %= 42); // Noncompliant\n            foo(i &= 1); // Noncompliant\n            foo(i ^= 1); // Noncompliant\n            foo(i |= 1); // Noncompliant\n            foo(i <<= 1); // Noncompliant\n            foo(i >>= 1); // Noncompliant\n//                ^^^\n\n            int? val = null;\n            foo(val ?? 1);\n\n            i = 42;\n            foo(i == 42);\n\n            foo(\n                (int xx) =>\n                {\n                    int a;\n                    a = 42;\n                    return a;\n                });\n\n            var b = true;\n\n            if (b = false) { } // Noncompliant\n//                ^\n            if ((b = false)) { } // Noncompliant  {{Extract the assignment of 'b' from this expression.}}\n            for (int j = 0; b &= false; j++) { } // Noncompliant\n            for (int j = 0; b == false; j++) { }\n\n            bool? value = null;\n            if (value ?? true) { }\n\n            // Fix S1121: NullReferenceException when while loop with assignment expression is within a for loop with no condition (#725)\n            for (;;)\n            {\n                while ((b = GetBool()) == true) { }\n            }\n\n            while (b &= false) { } // Noncompliant\n\n            do { } while (b &= false); // Noncompliant\n\n            while ((i = 1) == 1) { } // Compliant\n\n            do { } while ((i = 1) == 1); // Compliant\n\n            if (i == 0) i = 2;\n            if ((i = 1) <= 1) // Compliant\n            {\n            }\n            b = (i = 1) <= 1; // Noncompliant\n\n            var y = (b &= false) ? i : i * 2; // Noncompliant\n\n            string result = \"\";\n            if (!string.IsNullOrEmpty(result)) result = result + \" \";\n            var v1 = new Action(delegate { });\n            var v2 = new Action(delegate { var foo = 42; });\n            var v3 = new Func<object, object>((xx) => xx = 42);\n            var v4 = new Action<object>((xx) => { xx = 42; });\n            var v5 = new { MyField = 42 };\n            var v6 = new MyClass { MyField = 42 };\n            var v7 = new MyClass() { MyField = 42 };\n            var v8 = foo(xx => { xx = 42; return 0; });\n            var v9 = new MyClass { MyField = i = 42 }; // Noncompliant\n            var v10 = new MyClass() { MyField = i = 42 }; // Noncompliant\n\n            var index = 0;\n            new int[] { 0, 1, 2 }[index = 2] = 10; // Noncompliant\n            new int[] { 0, 1, 2 }[(index = 2)] = 10; // Noncompliant\n\n            var o = new object();\n            var oo = new object();\n\n            if (false && (oo = o) != null) // Compliant\n            { }\n\n            oo = (o) ?? (o = new object()); // Compliant\n            oo = (o) ?? (object)(o = new object()); // Compliant\n\n            oo = oo ?? (o = new object()); // Noncompliant\n            int xa = 0, xb = 0;\n            if ((xa = xb = 0) != 0) { }  // Compliant\n            int x = (xa = xb) + 5; // Noncompliant\n        }\n        public void TestMethod1()\n        {\n            var j = 5;\n            var k = 5;\n            var i = j =\n                k = 10;\n            i = j =\n                k = 10;\n        }\n\n        public bool GetBool() => true;\n    }\n\n    // See https://github.com/SonarSource/sonar-dotnet/issues/4446\n    abstract class WaitingInLoop\n    {\n        public async void Process()\n        {\n            bool evaluated;\n            while ((evaluated = await GetTask().ConfigureAwait(false))) // Noncompliant FP\n            {\n                // do processing\n            }\n        }\n\n        internal abstract Task<bool> GetTask();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AsyncAwaitIdentifier.Latest.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\n\nnamespace Tests.Diagnostics\n{\n    public class AsyncAwaitIdentifier\n    {\n        public void Cs9_nuint()\n        {\n            nuint await = 42; // Noncompliant\n        }\n\n        private static int GetDiscount(object p) => p switch\n        {\n            A => 0,\n            B await => 75, // Noncompliant\n            _ => 25\n        };\n    }\n\n    public class A { }\n    public class B { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AsyncAwaitIdentifier.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\n\nnamespace Tests.Diagnostics\n{\n    public class AsyncAwaitIdentifier\n    {\n        public AsyncAwaitIdentifier()\n        {\n            int async = 42; // Noncompliant {{Rename 'async' to not use a contextual keyword as an identifier.}}\n//              ^^^^^\n            int await = 42; // Noncompliant {{Rename 'await' to not use a contextual keyword as an identifier.}}\n\n            await = 42*2;\n        }\n\n        public void Foo(int async) // Noncompliant\n        {\n            var x = from await in new List<int>() {5,6,7 } // Noncompliant\n//                       ^^^^^\n            select await;\n        }\n\n        public static async Task<string> Foo(string a)\n        {\n            return await Foo(a);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AsyncVoidMethod.Latest.cs",
    "content": "﻿using System;\nusing System.Threading.Tasks;\n\n    public class Sample : EventArgs { }\n\n    public record EventHandlerCasesInRecord\n    {\n        async void MyMethod() // Noncompliant {{Return 'Task' instead.}}\n//            ^^^^\n        {\n            await Task.Run(() => Console.WriteLine(\"test\"));\n        }\n\n        async void MyMethod(object sender, EventArgs args)\n        {\n            await Task.Run(() => Console.WriteLine(\"test\"));\n        }\n\n        async void MyMethod1(object o, EventArgs e)\n        {\n            await Task.Run(() => Console.WriteLine(\"test\"));\n        }\n\n        async void MyMethod2(object o, Sample e)\n        {\n            await Task.Run(() => Console.WriteLine(\"test\"));\n        }\n\n        public event EventHandler<bool> MyEvent;\n\n        public EventHandlerCasesInRecord()\n        {\n            MyEvent += EventHandlerCases_MyEvent;\n        }\n\n        private async void EventHandlerCases_MyEvent(object sender, bool e)\n        {\n            await Task.Run(() => Console.WriteLine(\"test\"));\n        }\n\n        private async void NotAHandler(object sender) // Noncompliant\n//                    ^^^^\n        {\n            await Task.Run(() => Console.WriteLine(\"test\"));\n        }\n    }\n\n    public record EventHandlerCasesInPositionalRecord(string Param)\n    {\n        async void MyMethod() // Noncompliant\n        {\n            await Task.Run(() => Console.WriteLine(\"test\"));\n        }\n\n        async void MyMethod(object sender, EventArgs args)\n        {\n            await Task.Run(() => Console.WriteLine(\"test\"));\n        }\n\n        async void MyMethod1(object o, EventArgs e)\n        {\n            await Task.Run(() => Console.WriteLine(\"test\"));\n        }\n\n        async void MyMethod2(object o, Sample e)\n        {\n            await Task.Run(() => Console.WriteLine(\"test\"));\n        }\n\n        private async void NotAHandler(object sender) // Noncompliant\n        {\n            await Task.Run(() => Console.WriteLine(\"test\"));\n        }\n    }\n\n    public interface EventHandlerCasesInInterface\n    {\n        async void MyMethod() // Compliant because it can be implemented as a non async method\n        {\n            await Task.Run(() => Console.WriteLine(\"test\"));\n        }\n\n        async void MyMethod(object sender, EventArgs args)\n        {\n            await Task.Run(() => Console.WriteLine(\"test\"));\n        }\n\n        async void MyMethod1(object o, EventArgs e)\n        {\n            await Task.Run(() => Console.WriteLine(\"test\"));\n        }\n\n        async void MyMethod2(object o, Sample e)\n        {\n            await Task.Run(() => Console.WriteLine(\"test\"));\n        }\n\n        private async void NotAHandler(object sender) // Noncompliant\n        {\n            await Task.Run(() => Console.WriteLine(\"test\"));\n        }\n    }\n\n    public interface ISomeInterface\n    {\n        event EventHandler<bool> MyEvent;\n\n        public void SomeMethod()\n        {\n            MyEvent += EventHandlerCases_MyEvent;\n        }\n\n        private async void EventHandlerCases_MyEvent(object sender, bool e)\n        {\n            await Task.Run(() => Console.WriteLine(\"test\"));\n        }\n    }\n\n    public class Reproducer5432\n    {\n        public void SomeMethod()\n        {\n            var _timer = new System.Threading.Timer(RunOnceAsync);\n        }\n\n        private async void RunOnceAsync(object? _) // Compliant, see: https://github.com/SonarSource/sonar-dotnet/issues/5432\n        {\n        }\n    }\n\npublic record struct EventHandlerCasesInRecordStruct\n{\n    async void MyMethod() // Noncompliant {{Return 'Task' instead.}}\n//        ^^^^\n    {\n        await Task.Run(() => Console.WriteLine(\"test\"));\n    }\n\n    async void MyMethod(object sender, EventArgs args)\n    {\n        await Task.Run(() => Console.WriteLine(\"test\"));\n    }\n\n    async void MyMethod1(object o, EventArgs e)\n    {\n        await Task.Run(() => Console.WriteLine(\"test\"));\n    }\n\n    async void MyMethod2(object o, Sample e)\n    {\n        await Task.Run(() => Console.WriteLine(\"test\"));\n    }\n\n    public event EventHandler<bool> MyEvent;\n\n    public void SomeMethod()\n    {\n        MyEvent += EventHandlerCases_MyEvent;\n    }\n\n    private async void EventHandlerCases_MyEvent(object sender, bool e)\n    {\n        await Task.Run(() => Console.WriteLine(\"test\"));\n    }\n\n    private async void NotAHandler(object sender) // Noncompliant\n//                ^^^^\n    {\n        await Task.Run(() => Console.WriteLine(\"test\"));\n    }\n}\n\npublic record struct EventHandlerCasesInPositionalRecordStruct(string Param)\n{\n    async void MyMethod() // Noncompliant\n    {\n        await Task.Run(() => Console.WriteLine(\"test\"));\n    }\n\n    async void MyMethod(object sender, EventArgs args)\n    {\n        await Task.Run(() => Console.WriteLine(\"test\"));\n    }\n\n    async void MyMethod1(object o, EventArgs e)\n    {\n        await Task.Run(() => Console.WriteLine(\"test\"));\n    }\n\n    async void MyMethod2(object o, Sample e)\n    {\n        await Task.Run(() => Console.WriteLine(\"test\"));\n    }\n\n    private async void NotAHandler(object sender) // Noncompliant\n    {\n        await Task.Run(() => Console.WriteLine(\"test\"));\n    }\n}\n\npublic interface IVirtualMethodInterface\n{\n    static abstract void SomeMethod1();\n\n    static virtual async void SomeVirtualMethod() // Compliant (virtual member)\n    {\n        return;\n    }\n}\n\npublic class SomeClass : IVirtualMethodInterface\n{\n    public static async void SomeMethod1() // Compliant as it comes from the interface\n    {\n        return;\n    }\n\n    public static async void SomeMethod2() // Noncompliant\n    {\n        return;\n    }\n}\n\npublic static class Extensions\n{\n    extension(Sample e)\n    {\n        async void NonCompliant() // Noncompliant {{Return 'Task' instead.}}\n//            ^^^^\n        {\n            await Task.Run(() => Console.WriteLine(\"test\"));\n        }\n\n        async void Compliant(object sender, EventArgs args)\n        {\n            await Task.Run(() => Console.WriteLine(\"test\"));\n        }\n\n        async void NonCompliant(object sender)    // Noncompliant\n        {\n            await Task.Run(() => Console.WriteLine(\"test\"));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AsyncVoidMethod.MsTestTestFramework.cs",
    "content": "﻿using System;\nusing System.Threading.Tasks;\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\n\nnamespace Tests.Diagnostics\n{\n    [TestClass]\n    public class MyUnitTests // MSTest V2 has proper support for async so people should avoid async void\n    {\n        [AssemblyCleanup]\n        public static async void AssemblyCleanup() { } // Noncompliant\n\n        [AssemblyInitialize]\n        public static async void AssemblyInitialize() { } // Noncompliant\n\n        [ClassCleanup]\n        public static async void ClassCleanup() { } // Noncompliant\n\n        [ClassInitialize]\n        public static async void ClassInitialize() { } // Noncompliant\n\n        [TestCleanup]\n        public async void TestCleanup() { } // Noncompliant\n\n        [TestInitialize]\n        public async void TestInitialize() { } // Noncompliant\n\n        [TestMethod]\n        public async void MyTest() { } // Noncompliant\n    }\n\n    [TestClass]\n    public class MyOtherUnitTests\n    {\n        [AssemblyCleanup]\n        public static async Task AssemblyCleanup() { }\n\n        [AssemblyInitialize]\n        public static async Task AssemblyInitialize() { }\n\n        [ClassCleanup]\n        public static async Task ClassCleanup() { }\n\n        [ClassInitialize]\n        public static async Task ClassInitialize() { }\n\n        [TestCleanup]\n        public async Task TestCleanup() { }\n\n        [TestInitialize]\n        public async Task TestInitialize() { }\n\n        [TestMethod]\n        public async Task MyTest() { }\n    }\n}\n\nnamespace Net6Poc.AsyncVoidMethod\n{\n    internal class MsTestCases\n    {\n        [Generic<int>]\n        public static async void M() { } // Noncompliant\n    }\n\n    public class GenericAttribute<T> : TestMethodAttribute { }\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AsyncVoidMethod.VsUtFramework.cs",
    "content": "﻿\nusing System;\nusing System.Threading.Tasks;\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\n\nnamespace Tests.Diagnostics\n{\n    [TestClass]\n    public class MyUnitTests // MSTest V1 doesn't have proper support for async so people are forced to use async void\n    {\n        [AssemblyCleanup]\n        public static async void AssemblyCleanup() { }\n\n        [AssemblyInitialize]\n        public static async void AssemblyInitialize() { }\n\n        [ClassCleanup]\n        public static async void ClassCleanup() { }\n\n        [ClassInitialize]\n        public static async void ClassInitialize() { }\n\n        [TestCleanup]\n        public async void TestCleanup() { }\n\n        [TestInitialize]\n        public async void TestInitialize() { }\n\n        [TestMethod]\n        public async void MyTest() { } // Noncompliant\n    }\n\n    internal class MsTestCases\n    {\n        public void Method()\n        {\n            [TestMethod] async void Get1() => await Task.FromResult(1);\n            [TestMethod] async Task Get1s() => await Task.FromResult(1);\n            async void Get2() => await Task.FromResult(2); // Compliant - FN\n            async Task Get2s() => await Task.FromResult(2);\n\n            Action a = [TestMethod] async () => { };\n            Action b = async () => { };  // Compliant - FN\n            Action c = [TestMethod] async () => { };  // Compliant - FN\n            Func<Task> d = [TestMethod] async () => await Task.Delay(0);\n            Func<Task> e = async () => await Task.Delay(0);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AsyncVoidMethod.cs",
    "content": "﻿using System;\nusing System.Threading.Tasks;\n\nnamespace Tests.Diagnostics\n{\n    public class Foo : EventArgs { }\n\n    public class EventHandlerCases\n    {\n        async void MyMethod()   // Noncompliant {{Return 'Task' instead.}}\n//            ^^^^\n        {\n            await Task.Run(() => Console.WriteLine(\"test\"));\n        }\n\n        public virtual async void MyVirtualMethod() // Compliant as it is virtual\n        {\n            await Task.Run(() => Console.WriteLine(\"test\"));\n        }\n\n        async void MyMethod(object sender, EventArgs args)\n        {\n            await Task.Run(() => Console.WriteLine(\"test\"));\n        }\n\n        async void MyMethod2(object o, Foo e)\n        {\n            await Task.Run(() => Console.WriteLine(\"test\"));\n        }\n\n        void MyMethod3() { }\n\n        void MyMethod4(object sender, EventArgs args) { }\n\n        async Task<int> MyMethod5()\n        {\n            return 5;\n        }\n\n        public event EventHandler<bool> MyEvent;\n\n        public EventHandlerCases()\n        {\n            MyEvent += EventHandlerCases_MyEvent;\n        }\n\n        private async void EventHandlerCases_MyEvent(object sender, bool e)\n        {\n            await Task.Run(() => Console.WriteLine(\"test\"));\n        }\n\n        static async void OnValueChanged()  // Compliant, has OnXxx name\n        {\n        }\n\n        async void OnX() { }\n\n        async void O() { }          // Noncompliant\n        async void On() { }         // Noncompliant\n        async void Onboard() { }    // Noncompliant\n        async void ToX() { }        // Noncompliant\n        async void ONCAPS() { }     // Noncompliant\n        async void On3People() { }  // Noncompliant, 3People is not a valid event name\n        async void On_Underscore() { }  // Noncompliant\n        async void onEvent() { }    // Noncompliant\n\n        async void Onřád() { }      // Noncompliant\n        async void OnŘád() { }\n\n        async void OnΘ() { }        // Compliant, Uppercase Theta\n        async void Onθ() { }        // Noncompliant, Lowercase Theta\n\n\n        static async void OnEventNameChanged(BindableObject bindable, object oldValue, object newValue) // Compliant, Xamarin style, has OnXxx name\n        {\n            // Property changed implementation goes here\n        }\n\n        private async void ArbreDesClefs_ItemInvoked(TreeView sender, TreeViewItemInvokedEventArgs args) { }    // Compliant, doesn't have sender as object and doesn't inherit from EventArgs, but looks like it by argument names\n\n\n        // Substitute for reference to Xamarin.Forms, Windows.UI.Xaml.Controls\n        public class BindableObject { }\n        public class TreeView { }\n        public class TreeViewItemInvokedEventArgs { }   // Type doesn't inherit from event args\n    }\n\n    public struct EventHandlerCasesInStruct\n    {\n        async void MyMethod() // Noncompliant {{Return 'Task' instead.}}\n//            ^^^^\n        {\n            await Task.Run(() => Console.WriteLine(\"test\"));\n        }\n\n        async void MyMethod(object sender, EventArgs args)\n        {\n            await Task.Run(() => Console.WriteLine(\"test\"));\n        }\n\n        async void MyMethod1(object o, EventArgs e)\n        {\n            await Task.Run(() => Console.WriteLine(\"test\"));\n        }\n\n        async void MyMethod2(object o, Foo e)\n        {\n            await Task.Run(() => Console.WriteLine(\"test\"));\n        }\n\n        private async void NotAHandler(object sender) // Noncompliant\n//                    ^^^^\n        {\n            await Task.Run(() => Console.WriteLine(\"test\"));\n        }\n    }\n\n    public class UwpCases\n    {\n        // A lot of classes/interfaces in UWP do not inherit from EventArgs so we had to change the detection mechanism\n        // See issue https://github.com/SonarSource/sonar-dotnet/issues/704\n        private interface ISuspendingEventArgs { }\n\n        async void MyOtherMethod1(object o, ISuspendingEventArgs args)\n        {\n            await Task.Run(() => Console.WriteLine(\"test\"));\n        }\n\n        private async void OnSuspending(object sender, ISuspendingEventArgs e)\n        {\n            await Task.Run(() => Console.WriteLine(\"test\"));\n        }\n    }\n\n    public struct StructExample\n    {\n        event EventHandler<bool> MyEvent;\n\n        public void SomeMethod()\n        {\n            MyEvent += EventHandlerCases_MyEvent;\n        }\n\n        private async void EventHandlerCases_MyEvent(object sender, bool e)\n        {\n            await Task.Run(() => Console.WriteLine(\"test\"));\n        }\n    }\n\n    public class Reproducer5432\n    {\n        public delegate void CustomDelegate(int value);\n\n        public void SomeMethod()\n        {\n            var _timer = new System.Threading.Timer(RunOnceAsync);\n            _ = new DateTime { }; // For coverage, check constructor without an ArgumentList.\n\n            CallAction(Do);\n            CallDelegate(Do);\n        }\n\n        private void CallAction(Action<bool> action) { }\n\n        private void CallDelegate(CustomDelegate @delegate) { }\n\n        private async void RunOnceAsync(object _) { } // Compliant, see: https://github.com/SonarSource/sonar-dotnet/issues/5432\n\n        private async void Do(bool b) { }\n\n        private async void Do(int i) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AvoidDateTimeNowForBenchmarking.cs",
    "content": "﻿using System;\n\npublic class Program\n{\n    void Benchmark()\n    {\n        var start = DateTime.Now;\n        // Some method\n        Console.WriteLine($\"{(DateTime.Now - start).TotalMilliseconds} ms\"); // Noncompliant {{Avoid using \"DateTime.Now\" for benchmarking or timespan calculation operations.}}\n        //                    ^^^^^^^^^^^^^^^^^^^^\n\n        start = DateTime.Now;\n        // Some method\n        Console.WriteLine($\"{DateTime.Now.Subtract(start).TotalMilliseconds} ms\"); // Noncompliant\n        //                   ^^^^^^^^^^^^^^^^^^^^^\n    }\n\n    private const int MinRefreshInterval = 100;\n\n    void Timing()\n    {\n        var lastRefresh = DateTime.Now;\n        if ((DateTime.Now - lastRefresh).TotalMilliseconds > MinRefreshInterval) // Noncompliant\n        {\n            lastRefresh = DateTime.Now;\n            // Refresh\n        }\n    }\n\n    void Combinations(TimeSpan timeSpan, DateTime dateTime)\n    {\n        _ = (DateTime.Now - dateTime).Milliseconds; // Noncompliant\n        _ = DateTime.Now.Subtract(dateTime).Milliseconds; // Noncompliant\n\n        _ = (DateTime.Now - TimeSpan.FromSeconds(1)).Millisecond; // Compliant\n        _ = DateTime.Now.Subtract(TimeSpan.FromDays(1)).Millisecond; // Compliant\n\n        _ = (DateTime.Now - timeSpan).Millisecond; // Compliant\n        _ = DateTime.Now.Subtract(timeSpan).Millisecond; // Compliant\n\n        _ = (DateTime.UtcNow - dateTime).Milliseconds; // Compliant\n        _ = DateTime.UtcNow.Subtract(dateTime).Milliseconds; // Compliant\n\n        _ = (new DateTime(1) - dateTime).Milliseconds; // Compliant\n        _ = new DateTime(1).Subtract(dateTime).Milliseconds; // Compliant\n\n        void LocalMethod()\n        {\n            var sec = DateTime.Now;\n            // something\n            Console.WriteLine($\"{(DateTime.Now - sec).TotalMilliseconds} ms\"); // Noncompliant\n        }\n    }\n\n    private TimeSpan time;\n\n    public TimeSpan Time\n    {\n        get => time;\n        set\n        {\n            var start = DateTime.Now;\n            time = DateTime.Now - start; // Noncompliant\n        }\n    }\n\n    void SwitchExpression(DateTime start)\n    {\n        var a = 1;\n        switch (a)\n        {\n            case 1:\n                time = DateTime.Now - start - new TimeSpan(1); // Noncompliant\n                break;\n        }\n    }\n\n    void NonInLineDateTimeNow()\n    {\n        var start = DateTime.Now;\n        // Some method\n        var end = DateTime.Now;\n        var elapsedTime = end - start; // FN\n    }\n\n    void EdgeCases(DateTime dateTime, TimeSpan timeSpan)\n    {\n        (true ? DateTime.Now : new DateTime(1)).Subtract(dateTime); // FN\n        (true ? DateTime.Now : new DateTime(1)).Subtract(timeSpan); // Compliant\n\n        DateTime.Now.AddDays(1).Subtract(dateTime); // FN\n        DateTime.Now.Subtract(); // Error [CS1501]\n    }\n}\n\npublic class FakeDateTimeSubtract\n{\n    void MyMethod(System.DateTime dateTime)\n    {\n        _ = DateTime.Now.Subtract(dateTime).Milliseconds; // Compliant\n    }\n\n    public static class DateTime\n    {\n        public static System.DateTime Now { get; }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AvoidDateTimeNowForBenchmarking.vb",
    "content": "﻿Imports System\n\nPublic Class Program\n    Private Sub Benchmark()\n        Dim start = Date.Now\n        ' Some method\n        Console.WriteLine($\"{(Date.Now - start).TotalMilliseconds} ms\") ' Noncompliant {{Avoid using \"DateTime.Now\" for benchmarking or timespan calculation operations.}}\n        '                     ^^^^^^^^^^^^^^^^\n\n        start = Date.Now\n        ' Some method\n        Console.WriteLine($\"{Date.Now.Subtract(start).TotalMilliseconds} ms\") ' Noncompliant\n        '                    ^^^^^^^^^^^^^^^^^\n    End Sub\n\n    Private Const MinRefreshInterval As Integer = 100\n\n    Private Sub Timing()\n        Dim lastRefresh = Date.Now\n        If (Date.Now - lastRefresh).TotalMilliseconds > MinRefreshInterval Then ' Noncompliant\n            lastRefresh = Date.Now\n            ' Refresh\n        End If\n    End Sub\n\n    Private Sub Combinations(ByVal timeSpan As TimeSpan, ByVal dateTime As Date)\n        Dim a1 = (Date.Now - dateTime).Milliseconds         ' Noncompliant\n        Dim a2 = Date.Now.Subtract(dateTime).Milliseconds   ' Noncompliant\n\n        Dim b1 = (Date.Now - TimeSpan.FromSeconds(1)).Millisecond       ' Compliant\n        Dim b2 = Date.Now.Subtract(TimeSpan.FromDays(1)).Millisecond    ' Compliant\n\n        Dim c1 = (Date.Now - timeSpan).Millisecond              ' Compliant\n        Dim c2 = Date.Now.Subtract(timeSpan).Millisecond        ' Compliant\n\n        Dim d1 = (Date.UtcNow - dateTime).Milliseconds          ' Compliant\n        Dim d2 = Date.UtcNow.Subtract(dateTime).Milliseconds    ' Compliant\n\n        Dim e1 = (New DateTime(1) - dateTime).Milliseconds          ' Compliant\n        Dim e2 = New DateTime(1).Subtract(dateTime).Milliseconds    ' Compliant\n    End Sub\n\n    Private timeField As TimeSpan\n\n    Public Property Time As TimeSpan\n        Get\n            Return timeField\n        End Get\n        Set(ByVal value As TimeSpan)\n            Dim start = Date.Now\n            timeField = Date.Now - start ' Noncompliant\n        End Set\n    End Property\n\n    Private Sub SwitchExpression(ByVal start As Date)\n        Dim a = 1\n        Select Case a\n            Case 1\n                timeField = Date.Now - start - New TimeSpan(1) ' Noncompliant\n        End Select\n    End Sub\n\n    Private Sub NonInLineDateTimeNow()\n        Dim start = Date.Now\n        ' Some method\n        Dim [end] = Date.Now\n        Dim elapsedTime = [end] - start ' FN\n    End Sub\n\n    Private Sub EdgeCases(ByVal dateTime As Date, ByVal timeSpan As TimeSpan)\n        Call (If(True, Date.Now, New DateTime(1))).Subtract(dateTime) ' FN\n        Call (If(True, Date.Now, New DateTime(1))).Subtract(timeSpan) ' Compliant\n\n        Date.Now.AddDays(1).Subtract(dateTime) ' FN\n        Date.Now.Subtract() ' Error [BC30516]\n        Date.Now.Subtract ' Error [BC30516]\n\n        Date.Now.Subtract(dateTime) ' Noncompliant\n        Dim span = Date.Now - dateTime ' Noncompliant\n    End Sub\nEnd Class\n\nPublic Class FakeDateTimeSubtract\n    Private Sub MyMethod(ByVal dateTime As Date)\n        Dim a = FakeDateTimeSubtract.DateTime.Now.Subtract(dateTime).Milliseconds ' Compliant\n    End Sub\n\n    Public NotInheritable Class DateTime\n        Public Shared ReadOnly Property Now As Date\n    End Class\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AvoidExcessiveClassCoupling.Latest.cs",
    "content": "﻿using System;\nusing System.ComponentModel;\nusing System.IO;\nusing System.Collections.Generic;\n\nnamespace CSharp9\n{\n    public interface IFoo { }\n    class FooBase : IFoo { }\n    class Foo1 : FooBase { }\n    public struct MyStruct { }\n\n    public record FirstRecord { }\n    public record SecondRecord // Noncompliant {{Split this record into smaller and more specialized ones to reduce its dependencies on other types from 6 to the maximum authorized 1 or less.}}\n    {\n        private FirstRecord field1; // +1\n        private MyStruct field2; // +1\n        private Foo1 field3; // +1\n        private nuint field5; // Primitives don't count\n        private UIntPtr field6; // Primitives don't count\n\n        public SecondRecord(IFoo interfaceFoo) { } // +1\n\n        private static FooBase Property1 { get; } // +1\n\n        public FirstRecord FooMethod() => field1; // already in field1\n        public void BarMethod(Stream s) { } // +1\n    }\n\n    public record PositionalRecord(int Parameter) // Noncompliant {{Split this record into smaller and more specialized ones to reduce its dependencies on other types from 6 to the maximum authorized 1 or less.}}\n    {\n        private FirstRecord field1; // +1\n        private MyStruct field2; // +1\n        private Foo1 field3; // +1\n        private nuint field5; // Primitives don't count\n        private UIntPtr field6; // Primitives don't count\n\n        public PositionalRecord(IFoo interfaceFoo) : this(5) { } // +1\n\n        private static FooBase Property1 { get; } // +1\n\n        public FirstRecord FooMethod() => field1; // already in field1\n        public void BarMethod(Stream s) { } // +1\n    }\n\n    public record OutterRecord\n    {\n        InnerRecord whatever = new InnerRecord();\n\n        public record InnerRecord // Noncompliant\n        {\n            public Stream stream = new FileStream(\"\", FileMode.Open);\n        }\n    }\n}\n\nnamespace CSharp10\n{\n    public interface IFoo { }\n    class FooBase : IFoo { }\n    class Foo1 : FooBase { }\n    public struct MyStruct { }\n\n    public record struct FirstRecordStruct { }\n    public record struct SecondRecordStruct // Noncompliant {{Split this record into smaller and more specialized ones to reduce its dependencies on other types from 6 to the maximum authorized 1 or less.}}\n    //                   ^^^^^^^^^^^^^^^^^^\n    {\n        private FirstRecordStruct field1 = new FirstRecordStruct(); // +1\n        private MyStruct field2 = new MyStruct(); // +1\n        private Foo1 field3 = null; // +1\n        private nuint field5 = 42; // Primitives don't count\n\n        public SecondRecordStruct(IFoo interfaceFoo) { } // +1\n\n        private static FooBase Property1 { get; } // +1\n\n        public FirstRecordStruct FooMethod() => field1; // already in field1\n        public void BarMethod(Stream s) { } // +1\n    }\n\n    public record struct PositionalRecordStruct(int Parameter) // Noncompliant\n    {\n        private FirstRecordStruct field1 = new FirstRecordStruct(); // +1\n        private MyStruct field2 = new MyStruct(); // +1\n        private Foo1 field3 = null; // +1\n        private nuint field5 = 42; // Primitives don't count\n\n        public PositionalRecordStruct(IFoo interfaceFoo) : this(5) { } // +1\n\n        private static FooBase Property1 { get; } // +1\n\n        public FirstRecordStruct FooMethod() => field1; // already in field1\n        public void BarMethod(Stream s) { } // +1\n    }\n\n    public record struct OutterRecordStruct // Compliant: nested record struct types are not counted as dependencies of the outer type\n    {\n        public OutterRecordStruct() { }\n\n        InnerRecordStruct whatever = new InnerRecordStruct();\n\n        public record struct InnerRecordStruct // Noncompliant\n        {\n            public InnerRecordStruct() { }\n\n            public Stream stream = new FileStream(\"\", FileMode.Open);\n        }\n    }\n}\n\nnamespace CSharp11\n{\n    public interface IFoo { }\n    class FooBase : IFoo { }\n    class Foo : FooBase { }\n    public struct MyStruct { }\n\n    public class ZeroDependencies { } // Compliant\n\n    public class ZeroNonPrimitiveDependencies // Compliant\n    {\n        private nint nativeInt; // Primitives don't count\n        private nuint nativeUint; // Primitives don't count\n\n        private IntPtr intPtr; // Primitives don't count\n        private UIntPtr uIntPtr; // Primitives don't count\n\n        private void Method_IntPtr(IntPtr arg) { } // Primitives don't count\n        private void Method_UIntPtr(UIntPtr arg) { } // Primitives don't count\n        private void Method_nint(nint arg) { } // Primitives don't count\n        private void Method_nuint(nuint arg) { } // Primitives don't count\n    }\n\n    public class OneDependency // Compliant\n    {\n        private Foo foo; // +1\n\n        private nint nativeInt; // Primitives don't count\n        private nuint nativeUint; // Primitives don't count\n\n        private IntPtr intPtr; // Primitives don't count\n        private UIntPtr uIntPtr; // Primitives don't count\n\n        private class NestedClass // Noncompliant\n//                    ^^^^^^^^^^^\n        {\n            private Foo nestedFoo; // +1\n            private FooBase GetFooBase() => default; // +1\n        }\n    }\n\n    public class TwoDependencies // Noncompliant\n//               ^^^^^^^^^^^^^^^\n    {\n        private Foo foo; // +1\n        private MyStruct myStruct; // +1\n\n        private nint nativeInt; // Primitives don't count\n        private nuint nativeUint; // Primitives don't count\n\n        private IntPtr intPtr; // Primitives don't count\n        private UIntPtr uIntPtr; // Primitives don't count\n\n        private class NestedClass // Compliant\n        {\n            private IFoo nestedIFoo; // +1\n\n            private nint nativeInt; // Primitives don't count\n            private nuint nativeUint; // Primitives don't count\n\n            private IntPtr intPtr; // Primitives don't count\n            private UIntPtr uIntPtr; // Primitives don't count\n\n            private void DoWork(IFoo iFoo) { } // Already counted in private field\n        }\n\n        private class NestedEmptyClass // Compliant\n        {\n        }\n    }\n\n    public class ScopedRefParameterUsage // Noncompliant {{Split this class into smaller and more specialized ones to reduce its dependencies on other types from 2 to the maximum authorized 1 or less.}}\n    {\n        private Foo _foo;                  // +1 Foo\n        void M(scoped ref MyStruct p) { } // +1 MyStruct\n    }\n\n    // file-scoped types\n\n    file interface IFooFile { }\n    file class FooFileBase : IFooFile { }\n    file class FooFileClass1 : FooFileBase { }\n\n    file class FooSecond // Noncompliant {{Split this class into smaller and more specialized ones to reduce its dependencies on other types from 3 to the maximum authorized 1 or less.}}\n//             ^^^^^^^^^\n    {\n        private FooFileClass1 field2 = new FooFileClass1(); // +1\n        private FooFileBase field3 = null; // +1\n        private static FooBase Property1 { get; } // +1\n    }\n}\n\nnamespace CSharp13\n{\n    public interface IFoo { }\n    public class FooBase : IFoo { }\n    public class Foo1 : FooBase { }\n    public class Foo2 : FooBase { }\n    public struct MyStruct { }\n\n    public partial class Partial // Noncompliant {{Split this class into smaller and more specialized ones to reduce its dependencies on other types from 3 to the maximum authorized 1 or less.}}\n    {\n        public partial FooBase property { get; set; }\n        public MyStruct myStruct;\n        public Foo2 foo2;\n    }\n\n    public partial class Partial // Noncompliant {{Split this class into smaller and more specialized ones to reduce its dependencies on other types from 2 to the maximum authorized 1 or less.}}\n    {\n        public partial FooBase property\n        {\n            get => new Foo1();\n            set { }\n        }\n    }\n}\n\nnamespace CSharp14\n{\n    public class Foo1 { }\n\n    public static class Foo1Extensions // Compliant: 1 dep (Foo1)\n    {\n        extension(Foo1)\n        {\n            public static Foo1 Create() => new Foo1(); // +1 Foo1\n        }\n    }\n\n    public class UsesStaticExtension // Compliant: 1 dep (Foo1) — Foo1Extensions (container) is not counted\n    {\n        Foo1 M() => Foo1.Create(); // +1 Foo1\n    }\n}\n\nnamespace RuleExceptions\n{\n    // https://sonarsource.atlassian.net/browse/NET-3553\n    public static class CollectionExtensions // Noncompliant FP - static classes containing only extension methods should be exempt\n    {\n        public static bool IsNullOrEmpty(this IList<int> list) => list == null || list.Count == 0;           // +1 IList\n        public static bool IsNullOrEmpty(this ICollection<int> collection) => collection == null || collection.Count == 0; // +1 ICollection\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AvoidExcessiveClassCoupling.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing MyFileStream = System.IO.FileStream;\nusing FooBaseAlias = Tests.Diagnostics.FooBase;\n\nnamespace Tests.Diagnostics\n{\n    public interface IFoo { }\n    class FooBase : IFoo { }\n    class Foo1 : FooBase { }\n    public struct MyStruct { }\n    public interface ISelfReferencing<T> where T : ISelfReferencing<T> { }\n    public class OuterForGenericArg { public class Inner { } }\n\n    public abstract class TestCases // Noncompliant {{Split this class into smaller and more specialized ones to reduce its dependencies on other types from 8 to the maximum authorized 1 or less.}}\n//                        ^^^^^^^^^\n    {\n        // ================================================================================\n        // ==== FIELDS\n        // ================================================================================\n        private IFoo field1 = new FooBase();\n        private FooBase field2 = Method3();\n        private static IFoo field3 = Property1;\n        private int field4; // Primitives don't count\n        private MyStruct str;\n        private System.Threading.Tasks.Task myTask;\n        Action myAction;\n        Func<int> myFunct;\n        unsafe int* myPointer;\n\n\n        // ================================================================================\n        // ==== PROPERTIES\n        // ================================================================================\n        private static Foo1 Property1 { get; }\n\n        public IFoo Property2 { get; set; }\n\n        public IFoo Property3\n        {\n            get\n            {\n                return new FooBase();\n            }\n        }\n\n        public IFoo Property4\n        {\n            set\n            {\n                var x = value.ToString();\n            }\n        }\n\n        public IFoo Property5 => Method3();\n\n\n\n        // ================================================================================\n        // ==== EVENTS\n        // ================================================================================\n        public event EventHandler Event1\n        {\n            add\n            {\n                var x = Method3();\n            }\n            remove\n            {\n                IFoo xx = Method3();\n            }\n        }\n\n\n\n        // ================================================================================\n        // ==== CTORS\n        // ================================================================================\n        public TestCases()\n        {\n            var x = new object();\n            Stream y = new System.IO.FileStream(\"\", System.IO.FileMode.Open);\n        }\n\n\n\n        // ================================================================================\n        // ==== DTORS\n        // ================================================================================\n        ~TestCases()\n        {\n            Stream y;\n            y = new FileStream(\"\", FileMode.Open);\n        }\n\n\n\n        // ================================================================================\n        // ==== METHODS\n        // ================================================================================\n        IDisposable Method1(object o)\n        {\n            Stream y = new FileStream(\"\", FileMode.Open);\n            return y;\n        }\n\n        Stream Method2() => new FileStream(\"\", FileMode.Open);\n        private static FooBase Method3() => null;\n\n        protected abstract IFoo Method4();\n    }\n\n    public class OutterClass\n    {\n        InnerClass whatever = new InnerClass();\n\n        public class InnerClass // Noncompliant\n        {\n            public Stream stream = new FileStream(\"\", FileMode.Open);\n        }\n    }\n\n    public class WithConstraint<T> where T : IDisposable { } // Compliant\n    public class UnboundGenericUsage // Noncompliant {{Split this class into smaller and more specialized ones to reduce its dependencies on other types from 2 to the maximum authorized 1 or less.}}\n    {\n        void M() { _ = typeof(WithConstraint<>); } // +1 WithConstraint<T>, +1 IDisposable (constraint of unbound generic)\n    }\n\n    public class ThisMemberAccessUsage // Compliant\n    {\n        private Stream _s;\n        Stream M() => this._s; // coverage: this.X is not a simple name chain and adds no new dependencies\n    }\n\n    public class AliasInCastUsage // Noncompliant {{Split this class into smaller and more specialized ones to reduce its dependencies on other types from 2 to the maximum authorized 1 or less.}}\n    {\n        private Stream _s;                             // +1 Stream\n        void M(object obj) { var x = (MyFileStream)obj; } // +1 FileStream (via alias to BCL type)\n    }\n\n    public class AliasForUserDefinedTypeUsage // Noncompliant {{Split this class into smaller and more specialized ones to reduce its dependencies on other types from 2 to the maximum authorized 1 or less.}}\n    {\n        private Stream _s;                                // +1 Stream\n        void M(object obj) { var x = (FooBaseAlias)obj; } // +1 FooBase (via alias to user-defined type)\n    }\n\n    public class GlobalQualifiedCustomTypeUsage // Noncompliant {{Split this class into smaller and more specialized ones to reduce its dependencies on other types from 2 to the maximum authorized 1 or less.}}\n    {\n        private Stream _s;                               // +1 Stream\n        private global::Tests.Diagnostics.FooBase _fb;  // +1 FooBase (global:: qualified custom type)\n    }\n\n    public class ArrayInitializerUsage // Noncompliant {{Split this class into smaller and more specialized ones to reduce its dependencies on other types from 2 to the maximum authorized 1 or less.}}\n    {\n        private Stream _s;                             // +1 Stream\n        void M() { FooBase[] arr = null; }             // +1 FooBase (array element type via initializer ConvertedType)\n    }\n\n    public class PointerInitializerUsage // Noncompliant {{Split this class into smaller and more specialized ones to reduce its dependencies on other types from 2 to the maximum authorized 1 or less.}}\n    {\n        private Stream _s;                         // +1 Stream\n        unsafe void M() { MyStruct* ptr = null; } // +1 MyStruct (pointer initializer ConvertedType)\n    }\n\n    public class SelfReferencingGenericUsage // Compliant\n    {\n        void M() { _ = typeof(ISelfReferencing<>); } // +1 ISelfReferencing<T>; constraint loops back to ISelfReferencing<T> — deduped, no infinite recursion\n    }\n\n    public class SelfReferencingGenericUsage<T> where T : ISelfReferencing<T> // Compliant\n    {\n        // constraint T : ISelfReferencing<T> adds +1 ISelfReferencing<T>; T is ITypeParameterSymbol — filtered by ExpandGenericTypes, no infinite recursion\n    }\n\n    public class NullableWrapperUsage // Compliant\n    {\n        private MyStruct? field; // +1 MyStruct (Nullable<MyStruct> not counted separately)\n    }\n\n    public class ConstraintAndNestedTypeArgUsage<T> // Noncompliant {{Split this class into smaller and more specialized ones to reduce its dependencies on other types from 3 to the maximum authorized 1 or less.}}\n        where T : IFoo // +1 IFoo\n    {\n        void M()\n        {\n            _ = EqualityComparer<Dictionary<int, T>>.Default; // +1 EqualityComparer<T>, +1 Dictionary<TKey,TValue> via ExpandGenericTypes (int, T not counted)\n        }\n    }\n\n    public class GenericMethodTypeArgCounted // Noncompliant {{Split this class into smaller and more specialized ones to reduce its dependencies on other types from 6 to the maximum authorized 1 or less.}}\n    {\n        void M()\n        {\n            Method<IDisposable>();                           // +1 IDisposable\n            this.Method<ICloneable>();                       // +1 ICloneable\n            var list = new List<int>();                      // +1 List<T>\n            list.ConvertAll<IComparable>(x => null);         // +1 IComparable\n            Method<Dictionary<int, IFormattable>>();         // +1 Dictionary<TKey,TValue>, +1 IFormattable via ExpandGenericTypes (int not counted)\n        }\n        void Method<T>() { }\n    }\n\n    public class NestedTypeAsGenericArgUsage // Noncompliant {{Split this class into smaller and more specialized ones to reduce its dependencies on other types from 3 to the maximum authorized 1 or less.}}\n    {\n        private List<OuterForGenericArg.Inner> field; // +1 List<T>, +1 Inner, +1 OuterForGenericArg (ContainingType of Inner)\n    }\n\n    public class ChainedMemberAccessThroughPropertyUsage // Noncompliant {{Split this class into smaller and more specialized ones to reduce its dependencies on other types from 2 to the maximum authorized 1 or less.}}\n    {\n        private Stream _s;                                        // +1 Stream\n        void M() { System.Console.Out.WriteLine(\"hello\"); }      // +1 Console (Out is a property, not a type — must recurse deeper to find Console)\n    }\n\n    public class OuterWithNestedInterface // Compliant: nested interface types are not counted as dependencies of the outer type\n    {\n        InnerInterface whatever = null;\n\n        interface InnerInterface // Noncompliant {{Split this interface into smaller and more specialized ones to reduce its dependencies on other types from 2 to the maximum authorized 1 or less.}}\n        {\n            Stream M(FileStream fs); // +1 Stream, +1 FileStream\n        }\n    }\n\n    public class OuterWithNestedClass // Compliant: nested class types are not counted as dependencies of the outer type\n    {\n        InnerClass whatever = null;\n\n        class InnerClass // Noncompliant {{Split this class into smaller and more specialized ones to reduce its dependencies on other types from 2 to the maximum authorized 1 or less.}}\n        {\n            Stream field = null;    // +1 Stream\n            FileStream field2 = null; // +1 FileStream\n        }\n    }\n\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AvoidExcessiveInheritance_CustomValues.Records.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    record Record_0 { }\n    record Record_1 : Record_0 { }\n    record Record_2 : Record_1 { }\n    record Record_3 : Record_2 { } // Noncompliant {{This record has 3 parents which is greater than 2 authorized.}}\n    record SecondSubRecord : Record_3 { }  // Noncompliant {{This record has 4 parents which is greater than 2 authorized.}}\n    record ThirdSubRecord : SecondSubRecord { }\n    record FourthSubRecord : ThirdSubRecord { }\n    record FifthSubRecord : FourthSubRecord { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AvoidExcessiveInheritance_CustomValues.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    class Class_0 : Exception { }\n    class Class_1 : Class_0 { }\n    class Class_2 : Class_1 { }\n    class Class_3 : Class_2 { } // Noncompliant {{This class has 3 parents which is greater than 2 authorized.}}\n    class SecondSubClass : Class_3 { }  // Noncompliant {{This class has 4 parents which is greater than 2 authorized.}}\n    class ThirdSubClass : SecondSubClass { }\n    class FourthSubClass : ThirdSubClass { }\n    class FifthSubClass : FourthSubClass { }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AvoidExcessiveInheritance_DefaultValues.Concurrent.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace AppendedNamespaceForConcurrencyTest.Tests.Diagnostics\n{\n    public class BaseClass { }\n\n    public class DerivedClass_1 : BaseClass { }\n\n    public class DerivedClass_2 : DerivedClass_1 { }\n\n    public class DerivedClass_3 : DerivedClass_2 { }\n\n    public class DerivedClass_4 : DerivedClass_3 { }\n\n    public class DerivedClass_5 : DerivedClass_4 { }\n\n    public class DerivedClass_6 : DerivedClass_5 { } // Noncompliant {{This class has 6 parents which is greater than 5 authorized.}}\n//               ^^^^^^^^^^^^^^\n    public class DerivedClass_7 : DerivedClass_6 { } // Noncompliant {{This class has 7 parents which is greater than 5 authorized.}}\n//               ^^^^^^^^^^^^^^\n\n    public class SubClass_0 : Exception { }\n    public class SubClass_1 : SubClass_0 { }\n    public class SubClass_2 : SubClass_1 { }\n    public class SubClass_3 : SubClass_2 { }\n    public class SubClass_4 : SubClass_3 { }\n    public class SubClass_5 : SubClass_4 { }\n    public class SubClass_6 : SubClass_5 { } // Noncompliant {{This class has 6 parents which is greater than 5 authorized.}}\n//               ^^^^^^^^^^\n    public class SubClass_7 : SubClass_6 { } // Noncompliant {{This class has 7 parents which is greater than 5 authorized.}}\n//               ^^^^^^^^^^\n}\n\nnamespace AppendedNamespaceForConcurrencyTest.Tests\n{\n    public class Tests_5 : Tests.Diagnostics.DerivedClass_4 { }\n\n    public class Tests_6 : Tests.Diagnostics.DerivedClass_5 { } // Noncompliant\n\n    public class Tests_7 : Tests.Diagnostics.SubClass_5 { } // Noncompliant\n}\n\nnamespace AppendedNamespaceForConcurrencyTest.Tests.Foo.Bar.Baz\n{\n    public class Tests_5 : Tests.Diagnostics.DerivedClass_4 { }\n\n    public class Tests_6 : Tests.Diagnostics.DerivedClass_5 { } // Noncompliant\n\n    public class Tests_7 : Tests.Diagnostics.SubClass_5 { } // Noncompliant\n}\n\nnamespace SomeOtherNamespace\n{\n    public class Other_0 : AppendedNamespaceForConcurrencyTest.Tests.Diagnostics.SubClass_6 { }\n    public class Other_1 : Other_0 { }\n    public class Other_2 : Other_1 { }\n    public class Other_3 : Other_2 { }\n    public class Other_4 : Other_3 { }\n    public class Other_5 : Other_4 { }\n    public class Other_6 : Other_5 { } // Noncompliant  {{This class has 6 parents which is greater than 5 authorized.}}\n    public class Other_7 : Other_6 { } // Noncompliant  {{This class has 7 parents which is greater than 5 authorized.}}\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AvoidExcessiveInheritance_DefaultValues.FileScopedTypes.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    file class Class_0 { }\n    file class Class_1 : Class_0 { }\n    file class Class_2 : Class_1 { }\n    file class Class_3 : Class_2 { }\n    file class Class_4 : Class_3 { }\n    file class Class_5 : Class_4 { }\n    file class Class_6 : Class_5 { } // Noncompliant  {{This class has 6 parents which is greater than 5 authorized.}}\n    file class Class_7 : Class_6 { } // Noncompliant  {{This class has 7 parents which is greater than 5 authorized.}}\n\n    file record Record_0 { }\n    file record Record_1 : Record_0 { }\n    file record Record_2 : Record_1 { }\n    file record Record_3 : Record_2 { }\n    file record Record_4 : Record_3 { }\n    file record Record_5 : Record_4 { }\n    file record Record_6 : Record_5 { } // Noncompliant  {{This record has 6 parents which is greater than 5 authorized.}}\n    file record Record_7 : Record_6 { } // Noncompliant  {{This record has 7 parents which is greater than 5 authorized.}}\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AvoidExcessiveInheritance_DefaultValues.Records.Concurrent.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Runtime.Intrinsics.Arm;\n\nnamespace AppendedNamespaceForConcurrencyTest.Tests.Diagnostics\n{\n    public record BaseRecord { }\n}\n\nnamespace OtherRecordNamespace\n{\n    public record Record_0 : AppendedNamespaceForConcurrencyTest.Tests.Diagnostics.BaseRecord { }\n    public record Record_1 : Record_0 { }\n    public record Record_2 : Record_1 { }\n    public record Record_3 : Record_2 { }\n    public record Record_4 : Record_3 { }\n    public record Record_5 : Record_4 { }\n    public record Record_6 : Record_5 { } // Noncompliant  {{This record has 6 parents which is greater than 5 authorized.}}\n    public record Record_7 : Record_6 { } // Noncompliant  {{This record has 7 parents which is greater than 5 authorized.}}\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AvoidExcessiveInheritance_DefaultValues.Records.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Runtime.Intrinsics.Arm;\n\nnamespace Tests.Diagnostics\n{\n    public record BaseRecord { }\n}\n\nnamespace RecordNamespace\n{\n    public record Record_0 : Tests.Diagnostics.BaseRecord { }\n    public record Record_1 : Record_0 { }\n    public record Record_2 : Record_1 { }\n    public record Record_3 : Record_2 { }\n    public record Record_4 : Record_3 { }\n    public record Record_5 : Record_4 { }\n    public record Record_6 : Record_5 { } // Noncompliant  {{This record has 6 parents which is greater than 5 authorized.}}\n    public record Record_7 : Record_6 { } // Noncompliant  {{This record has 7 parents which is greater than 5 authorized.}}\n}\n\npublic record Record_0(string s);\npublic record Record_1(string s) : Record_0(s);\npublic record Record_2(string s) : Record_1(s);\npublic record Record_3(string s) : Record_2(s);\npublic record Record_4(string s) : Record_3(s);\npublic record Record_5(string s) : Record_4(s);\npublic record Record_6(string s) : Record_5(s); // Noncompliant  {{This record has 6 parents which is greater than 5 authorized.}}\npublic record Record_7(string s) : Record_6(s); // Noncompliant  {{This record has 7 parents which is greater than 5 authorized.}}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AvoidExcessiveInheritance_DefaultValues.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public class BaseClass { }\n\n    public class DerivedClass_1 : BaseClass { }\n\n    public class DerivedClass_2 : DerivedClass_1 { }\n\n    public class DerivedClass_3 : DerivedClass_2 { }\n\n    public class DerivedClass_4 : DerivedClass_3 { }\n\n    public class DerivedClass_5 : DerivedClass_4 { }\n\n    public class DerivedClass_6 : DerivedClass_5 { } // Noncompliant {{This class has 6 parents which is greater than 5 authorized.}}\n//               ^^^^^^^^^^^^^^\n    public class DerivedClass_7 : DerivedClass_6 { } // Noncompliant {{This class has 7 parents which is greater than 5 authorized.}}\n//               ^^^^^^^^^^^^^^\n\n    public class SubClass_0 : Exception { }\n    public class SubClass_1 : SubClass_0 { }\n    public class SubClass_2 : SubClass_1 { }\n    public class SubClass_3 : SubClass_2 { }\n    public class SubClass_4 : SubClass_3 { }\n    public class SubClass_5 : SubClass_4 { }\n    public class SubClass_6 : SubClass_5 { } // Noncompliant {{This class has 6 parents which is greater than 5 authorized.}}\n//               ^^^^^^^^^^\n    public class SubClass_7 : SubClass_6 { } // Noncompliant {{This class has 7 parents which is greater than 5 authorized.}}\n//               ^^^^^^^^^^\n}\n\nnamespace Tests\n{\n    public class Tests_5 : Tests.Diagnostics.DerivedClass_4 { }\n\n    public class Tests_6 : Tests.Diagnostics.DerivedClass_5 { } // Noncompliant\n\n    public class Tests_7 : Tests.Diagnostics.SubClass_5 { } // Noncompliant\n}\n\nnamespace Tests.Foo.Bar.Baz\n{\n    public class Tests_5 : Tests.Diagnostics.DerivedClass_4 { }\n\n    public class Tests_6 : Tests.Diagnostics.DerivedClass_5 { } // Noncompliant\n\n    public class Tests_7 : Tests.Diagnostics.SubClass_5 { } // Noncompliant\n}\n\nnamespace OtherNamespace\n{\n    public class Other_0 : Tests.Diagnostics.SubClass_6 { }\n    public class Other_1 : Other_0 { }\n    public class Other_2 : Other_1 { }\n    public class Other_3 : Other_2 { }\n    public class Other_4 : Other_3 { }\n    public class Other_5 : Other_4 { }\n    public class Other_6 : Other_5 { } // Noncompliant  {{This class has 6 parents which is greater than 5 authorized.}}\n    public class Other_7 : Other_6 { } // Noncompliant  {{This class has 7 parents which is greater than 5 authorized.}}\n}\n\npublic class Other_0 : Exception { }\npublic class Other_1 : Other_0 { }\npublic class Other_2 : Other_1 { }\npublic class Other_3 : Other_2 { }\npublic class Other_4 : Other_3 { }\npublic class Other_5 : Other_4 { }\npublic class Other_6 : Other_5 { } // Noncompliant  {{This class has 6 parents which is greater than 5 authorized.}}\npublic class Other_7 : Other_6 { } // Noncompliant  {{This class has 7 parents which is greater than 5 authorized.}}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AvoidLambdaExpressionInLoopsInBlazor.LoopsWithNoBody.razor",
    "content": "﻿@using Microsoft.AspNetCore.Components.Web\n@* https://github.com/SonarSource/sonar-dotnet/issues/8394 *@\n\n@foreach (var item in Buttons.Where(x => x.Id == \"idToFind\"))\n    if (item.Id == \"idToFind\")\n    {\n        <button @onclick=\"(e) => Reset(e)\">Reset #3</button> @* FN *@\n    }\n\n@for (int i = 0; i < Buttons.Count; i++)\n    @if (i % 2 == 0)\n    {\n        var buttonNumber = i;\n        <button @onclick=\"@(e => DoAction(e, Buttons[buttonNumber]))\"> @* FN *@\n            Button #@buttonNumber\n        </button>\n    }\n\n@{\n    var j = 0;\n    while (j < 5)\n        if (j % 2 == 0)\n        {\n            j += 2;\n            <button @onclick=\"(e) => Reset(e)\"> @* FN *@\n                Reset @j\n            </button>\n            j += 2;\n        }\n\n    do\n        if (j % 2 == 0)\n        {\n            <button @onclick=\"(e) => Reset(e)\"> @* FN *@\n                Reset @j\n            </button>\n            j += 2;\n        }\n    while (j < 10);\n}\n\n@foreach (var item in Buttons.Where(x => x.Id == \"idToFind\"))\n    @if (item.Id == \"idToFind\")\n    {\n        <button @onclick=\"(e) => Reset(e)\">Reset #3</button> @* FN *@\n    }\n    else if (item.Id == \"idToFind\")\n    {\n        <button @onclick=\"(e) => Reset(e)\">Reset #3</button> @* FN *@\n    }\n    else\n    {\n        <button @onclick=\"(e) => Reset(e)\">Reset #3</button> @* FN *@\n    }\n\n@foreach (var item in Buttons.Where(x => x.Id == \"idToFind\"))\n    @if (true)\n        @if (item.Id == \"idToFind\")\n        {\n            <button @onclick=\"(e) => Reset(e)\">Reset #3</button> @* FN *@\n        }\n\n@foreach (var item in Buttons.Where(x => x.Id == \"idToFind\"))\n    @switch(item.Id)\n    {\n        case \"idToFind\":\n            <button @onclick=\"(e) => Reset(e)\">Reset #3</button> @* FN *@\n            break;\n        default:\n        {\n            <button @onclick=\"(e) => Reset(e)\">Reset #4</button> @* FN *@\n            break;\n        }\n    }\n\n@foreach (var button in Buttons)\n{\n    {\n        <button @key=\"button.Id\" @onclick=\"(e) => button.Action(e)\"> @* Noncompliant, there is a direct block for the loop *@\n            Button #@button.Id\n        </button>\n    }\n}\n\n@code {\n    private List<Button> Buttons { get; } = new List<Button>();\n\n    private void DoAction(MouseEventArgs e, Button button) { }\n\n    private class Button\n    {\n        public string Id { get; } = Guid.NewGuid().ToString();\n        public Action<MouseEventArgs> Action { get; set; } = e => { };\n    }\n\n    private void Reset(MouseEventArgs mouseEventArgs) \n    { \n        foreach (var button in Buttons)\n        {\n            button.Action = e => { }; // Compliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AvoidLambdaExpressionInLoopsInBlazor.RenderFragment.razor",
    "content": "﻿@ChildContent\n\n@code\n{\n    [Parameter]\n    public Microsoft.AspNetCore.Components.RenderFragment ChildContent { get; set; }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AvoidLambdaExpressionInLoopsInBlazor.RenderFragmentConsumer.razor",
    "content": "﻿@using Microsoft.AspNetCore.Components.Web\n\n<AvoidLambdaExpressionInLoopsInBlazor_RenderFragment>\n    @foreach (var button in Buttons)\n    {\n        <button @key=\"button.Id\" @onclick=\"(e) => button.Action(e)\"> @* Noncompliant *@\n            Button #@button.Id\n        </button>\n    }\n    \n    @foreach (var button in Buttons.Where(x => x.Id == \"SomeId\")) @* Compliant *@\n    {\n        <button @key=\"button.Id\" @onclick=\"(e) => button.Action(e)\"> @* Noncompliant *@\n            Button #@button.Id\n        </button>\n    }\n</AvoidLambdaExpressionInLoopsInBlazor_RenderFragment>\n\n@code {\n    private List<Button> Buttons { get; } = new List<Button>();\n\n    private void DoAction(MouseEventArgs e, Button button) { }\n\n    private class Button\n    {\n        public string Id { get; } = Guid.NewGuid().ToString();\n        public Action<MouseEventArgs> Action { get; set; } = e => { };\n    }\n\n    private void Reset(MouseEventArgs mouseEventArgs)\n    {\n        Console.WriteLine($\"Reset from {mouseEventArgs}\");\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AvoidLambdaExpressionInLoopsInBlazor.cs",
    "content": "﻿using Microsoft.AspNetCore.Components;\nusing Microsoft.AspNetCore.Components.Rendering;\nusing Microsoft.AspNetCore.Components.Web;\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\n\nclass LambdaInLoopInMethod\n{\n    void Method()\n    {\n        for (int i = 0; i < 10; i++)\n        {\n            var a = () => { }; // Compliant - Not in blazor\n        }\n    }\n}\n\npublic class LambdaComponent : ComponentBase\n{\n    private List<Button> Buttons { get; } = new();\n\n    private class Button\n    {\n        public string? Id { get; } = Guid.NewGuid().ToString();\n        public Action<MouseEventArgs> Action { get; set; } = e => { };\n    }\n\n    protected override void BuildRenderTree(RenderTreeBuilder builder)\n    {\n        foreach (var button in Buttons)\n        {\n            builder.OpenElement(0, \"button\");\n            builder.AddAttribute(1, \"onclick\", EventCallback.Factory.Create<MouseEventArgs>(this, e => button.Action(e))); // Noncompliant\n            builder.SetKey(button.Id);\n            builder.AddMarkupContent(2, \"\\r\\n        Button \");\n            builder.AddContent(3, button.Id);\n            builder.CloseElement();\n        }\n\n        foreach (var button in Buttons)\n        {\n            builder.OpenElement(4, \"button\");\n            builder.AddAttribute(5, \"onclick\", new EventCallback(this, (MouseEventArgs e) => button.Action(e))); // Noncompliant\n            builder.SetKey(button.Id);\n            builder.AddMarkupContent(6, \"\\r\\n        Button \");\n            builder.AddContent(7, button.Id);\n            builder.CloseElement();\n        }\n\n        foreach (var button in Buttons)\n        {\n            builder.OpenElement(8, \"button\");\n            builder.AddAttribute(9, \"onclick\", (MouseEventArgs e) => button.Action(e)); // Noncompliant\n            builder.SetKey(button.Id);\n            builder.AddMarkupContent(10, \"\\r\\n        Button \");\n            builder.AddContent(11, button.Id);\n            builder.CloseElement();\n        }\n\n        foreach (var button in Buttons)\n        {\n            builder.OpenElement(8, \"button\");\n            builder.AddAttribute(9, \"onclick\", (MouseEventArgs e) => button.Action(e)); // Noncompliant\n            builder.SetKey(button.Id);\n            builder.AddMarkupContent(10, \"\\r\\n        Button \");\n            builder.AddContent(11, button.Id);\n            builder.CloseElement();\n        }\n\n        foreach (var button in Buttons)\n        {\n            builder.OpenElement(12, \"button\");\n            builder.AddMultipleAttributes(13, new Dictionary<string, object>()\n            {\n                { \"onclick\", (MouseEventArgs e) => button.Action(e) } // Noncompliant\n            });\n            builder.AddMarkupContent(14, \"\\r\\n        Button\");\n            builder.CloseElement();\n        }\n\n        foreach (var button in Buttons.OrderByDescending(x => x.Id)) { } // Compliant, the lambda is executed outside of the loop\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AvoidLambdaExpressionInLoopsInBlazor.razor",
    "content": "﻿@using Microsoft.AspNetCore.Components.Web\n\n@foreach (var button in Buttons)\n{\n    <button @key=\"button.Id\" @onclick=\"button.Action\"> @* Compliant *@\n        Button #@button.Id\n    </button>\n}\n\n@foreach (var button in Buttons)\n{\n    <button @key=\"button.Id\" @onclick=\"(e) => button.Action(e)\"> @* Noncompliant *@\n        Button #@button.Id\n    </button>\n}\n\n@for (int i = 0; i < Buttons.Count; i++)\n{\n    var buttonNumber = i;\n    <button @onclick=\"@(e => DoAction(e, Buttons[buttonNumber]))\"> @* Noncompliant *@\n        Button #@buttonNumber\n    </button>\n}\n\n@{\n    var j = 0;\n    while (j < 5)\n    {\n        j += 1;\n        <button @onclick=\"(e) => Reset(e)\"> @* Noncompliant *@\n            Reset @j\n        </button>\n    }\n\n    do\n    {\n        j += 1;\n        <button @onclick=\"(e) => Reset(e)\"> @* Noncompliant *@\n            Reset @j\n        </button>\n    } while (j < 10);\n}\n\n<button @onclick=\"(e) => Reset(e)\">Reset</button> @* Compliant *@\n\n@if (Buttons.Count > 0)\n{\n    <button @onclick=\"(e) => Reset(e)\">Reset #2</button> @* Compliant *@\n}\n\n@foreach (var button in Buttons.OrderByDescending(x => x.Id)) @* Compliant, the lambda is executed outside of the loop *@\n{\n    <p>@button.Id</p>\n}\n\n@code {\n    private List<Button> Buttons { get; } = new List<Button>();\n\n    private void DoAction(MouseEventArgs e, Button button) { }\n\n    private class Button\n    {\n        public string Id { get; } = Guid.NewGuid().ToString();\n        public Action<MouseEventArgs> Action { get; set; } = e => { };\n    }\n\n    private void Reset(MouseEventArgs mouseEventArgs) \n    { \n        foreach (var button in Buttons)\n        {\n            button.Action = e => { }; // Compliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AvoidUnsealedAttributes.cs",
    "content": "﻿using System;\n\npublic class MyAttribute : Attribute { } // Noncompliant {{Seal this attribute or make it abstract.}}\n//           ^^^^^^^^^^^\n\npublic class MyOtherAttribute : Attribute { } // Noncompliant\n\npublic sealed class Bar : Attribute { } // Compliant - sealed\n\n\npublic abstract class FooBar : Attribute { } // Compliant - abstract\n\npublic class NotAnAttribute { } // Compliant - not an attribute\n\npublic sealed class Attr : Attribute\n{\n    private class InnerAttr : Attribute // Compliant - private\n    {\n        public class InnerInnerAttr : Attribute { } // Compliant - effective accessibility is private\n    }\n\n    protected class InnerAttr2 : Attribute { } // Noncompliant\n}\n\npublic class { }    // Error [CS1001]  Identifier expected\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/AvoidUnsealedAttributes.vb",
    "content": "' Test framework can't assert location on 1st line\nPublic Class PublicAttribute ' Noncompliant {{Seal this attribute or make it abstract.}}\n    Inherits Attribute\n    '        ^^^^^^^^^^^^^^^ @-1\nEnd Class\n\nPublic NotInheritable Class SealedAttribute\n    Inherits Attribute ' Compliant\nEnd Class\n\nPublic MustInherit Class AbstractAttribute\n    Inherits Attribute ' Compliant\nEnd Class\n\nPublic Class NotAnAttribute ' Compliant - not an attribute\nEnd Class\n\nPublic Class Container\n\n    Protected Class ProtectedAttribute ' Noncompliant\n        Inherits Attribute\n    End Class\n\n    Private Class PrivateAttribute ' Compliant\n        Inherits Attribute\n\n        Public Class SubClassAttribute ' Compliant - effective accessibility is private\n            Inherits Attribute\n        End Class\n    End Class\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/BeginInvokePairedWithEndInvoke.Latest.Partial.cs",
    "content": "﻿using System;\n\npublic partial class CallerWrapperAnotherFile\n{\n    public partial void CallEndInvoke(IAsyncResult result) =>\n        caller.EndInvoke(result);\n\n    public partial void DoNothing(IAsyncResult result) { }\n}\n\npublic partial class CrossTreeCallbackField\n{\n    private AsyncCallback callbackFieldNoncompliant = new AsyncCallback(HandlerWithoutEndInvoke);\n\n    private static void HandlerWithoutEndInvoke(IAsyncResult result) { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/BeginInvokePairedWithEndInvoke.Latest.cs",
    "content": "﻿using System;\n\npublic delegate void AsyncMethodCaller(string name, int i);\n\nclass Program\n{\n    private static void BeginInvokeOnDelegateWithLambdaCallback_UnderscoreParam()\n    {\n        var caller = new AsyncMethodCaller(AsyncMethod);\n        // here the \"_\" is actually an identifier, not a discard parameter\n        caller.BeginInvoke(\"delegate\", 1, (_) => { }, null); // Noncompliant\n    }\n\n    private static void BeginInvokeAndEndInvokeOnDelegateWithWrapperCallbackAsPartialMethod1()\n    {\n        var caller = new AsyncMethodCaller(AsyncMethod);\n        var wrapper = new CallerWrapper(caller);\n        var callback = new AsyncCallback(wrapper.CallEndInvoke);\n        caller.BeginInvoke(\"delegate\", 1, callback, null); // Compliant, EndInvoke is called by wrapper.CallEndInvoke\n    }\n\n    private static void BeginInvokeAndEndInvokeOnDelegateWithWrapperCallbackAsPartialMethod2()\n    {\n        var caller = new AsyncMethodCaller(AsyncMethod);\n        var wrapper = new CallerWrapper(caller);\n        var callback = new AsyncCallback(wrapper.DoNothing);\n        caller.BeginInvoke(\"delegate\", 1, callback, null); // Noncompliant\n    }\n\n    private static void BeginInvokeAndEndInvokeOnDelegateWithWrapperCallbackAsPartialMethod3()\n    {\n        var caller = new AsyncMethodCaller(AsyncMethod);\n        var wrapper = new CallerWrapperNoImplementation(caller);\n        var callback = new AsyncCallback(wrapper.MissingImplementation);  // Error [CS0762] Cannot create delegate from method 'CallerWrapperNoImplementation.MissingImplementation(IAsyncResult)' because it is a partial method without an implementing declaration\n        caller.BeginInvoke(\"delegate\", 1, callback, null); // Noncompliant\n    }\n\n    private static void BeginInvokeAndEndInvokeOnDelegateWithWrapperCallbackAsPartialMethod4()\n    {\n        var caller = new AsyncMethodCaller(AsyncMethod);\n        var wrapper = new CallerWrapperAnotherFile(caller);\n        var callback = new AsyncCallback(wrapper.CallEndInvoke);\n        caller.BeginInvoke(\"delegate\", 1, callback, null); // Compliant, EndInvoke is called by wrapper.CallEndInvoke\n    }\n\n    private static void BeginInvokeAndEndInvokeOnDelegateWithWrapperCallbackAsPartialMethod5()\n    {\n        var caller = new AsyncMethodCaller(AsyncMethod);\n        var wrapper = new CallerWrapperAnotherFile(caller);\n        var callback = new AsyncCallback(wrapper.DoNothing);\n        caller.BeginInvoke(\"delegate\", 1, callback, null); // Noncompliant\n    }\n\n    private static void BeginInvokeAndEndInvokeOnDelegateWithWrapperCallbackAsPartialMethod6()\n    {\n        var caller = new AsyncMethodCaller(AsyncMethod);\n        var wrapper = new CallerWrapperAnotherFile(caller);\n        AsyncCallback callback = new (wrapper.DoNothing);\n        caller.BeginInvoke(\"delegate\", 1, callback, null); // Noncompliant\n    }\n\n    private static void AsyncMethod(string msg, int i) =>\n        Console.WriteLine($\"AsyncMethod: {msg} {i}\");\n}\n\npartial class CallerWrapper\n{\n    private AsyncMethodCaller caller;\n\n    public CallerWrapper(AsyncMethodCaller caller) =>\n        this.caller = caller;\n\n    public partial void CallEndInvoke(IAsyncResult result);\n\n    public partial void DoNothing(IAsyncResult result);\n}\n\npartial class CallerWrapper\n{\n    public partial void CallEndInvoke(IAsyncResult result) =>\n        caller.EndInvoke(result);\n\n    public partial void DoNothing(IAsyncResult result) { }\n}\n\npartial class CallerWrapperNoImplementation\n{\n    private AsyncMethodCaller caller;\n\n    public CallerWrapperNoImplementation(AsyncMethodCaller caller) =>\n        this.caller = caller;\n\n    public partial void MissingImplementation(IAsyncResult result); // Error [CS8795] Partial method 'CallerWrapperNoImplementation.MissingImplementation(IAsyncResult)' must have an implementation part because it has accessibility modifiers.\n}\n\npublic partial class CallerWrapperAnotherFile\n{\n    private AsyncMethodCaller caller;\n\n    public CallerWrapperAnotherFile(AsyncMethodCaller caller) =>\n        this.caller = caller;\n\n    public partial void CallEndInvoke(IAsyncResult result);\n\n    public partial void DoNothing(IAsyncResult result);\n}\n\npublic record FooRecord\n{\n    private AsyncMethodCaller caller = null;\n    public string field;\n\n    public FooRecord(string field)\n    {\n        this.field = field;\n        caller.BeginInvoke(\"FooStruct\", 42, null, null); // Noncompliant\n    }\n\n    private void BeginInvokeAndEndInvokeOnDelegateWithLambdaCallback1()\n    {\n        var caller = new AsyncMethodCaller(AsyncMethod);\n        caller.BeginInvoke(name: \"delegate\", 42, @object: null, callback: result => caller.EndInvoke(result)); // Compliant\n    }\n\n    private static void AsyncMethod(string msg, int i)\n    {\n        Console.WriteLine($\"AsyncMethod: {msg}\");\n    }\n}\n\npublic record PositionalRecord(string Property)\n{\n    private AsyncMethodCaller caller = null;\n    public string field;\n\n    public PositionalRecord(string field, string property) : this(property)\n    {\n        this.field = field;\n        this.Property = property;\n        caller.BeginInvoke(\"FooStruct\", 42, null, null); // Noncompliant\n    }\n\n    private void BeginInvokeAndEndInvokeOnDelegateWithLambdaCallback1()\n    {\n        var caller = new AsyncMethodCaller(AsyncMethod);\n        caller.BeginInvoke(name: \"delegate\", 42, @object: null, callback: result => caller.EndInvoke(result)); // Compliant\n    }\n\n    private static void AsyncMethod(string msg, int i)\n    {\n        Console.WriteLine($\"AsyncMethod: {msg}\");\n    }\n}\n\npublic record struct FooRecordStruct\n{\n    private AsyncMethodCaller caller = null;\n    public string field;\n\n    public FooRecordStruct(string field)\n    {\n        this.field = field;\n        caller.BeginInvoke(\"FooStruct\", 42, null, null); // Noncompliant\n    }\n\n    private void BeginInvokeAndEndInvokeOnDelegateWithLambdaCallback1()\n    {\n        var caller = new AsyncMethodCaller(AsyncMethod);\n        caller.BeginInvoke(name: \"delegate\", 42, @object: null, callback: result => caller.EndInvoke(result)); // Compliant\n    }\n\n    private static void AsyncMethod(string msg, int i)\n    {\n        Console.WriteLine($\"AsyncMethod: {msg}\");\n    }\n}\n\npublic record struct PositionalRecordStruct(string Property)\n{\n    private AsyncMethodCaller caller = null;\n    public string field = null;\n\n    public PositionalRecordStruct(string field, string property) : this(property)\n    {\n        this.field = field;\n        caller.BeginInvoke(\"FooStruct\", 42, null, null); // Noncompliant\n    }\n\n    private static void BeginInvokeAndEndInvokeOnDelegateWithLambdaCallback1()\n    {\n        var caller = new AsyncMethodCaller(AsyncMethod);\n        caller.BeginInvoke(name: \"delegate\", 42, @object: null, callback: result => caller.EndInvoke(result)); // Compliant\n    }\n\n    private static void AsyncMethod(string msg, int i)\n    {\n        Console.WriteLine($\"AsyncMethod: {msg}\");\n    }\n}\n\npublic delegate void OtherAsyncMethodCaller();\n\npublic interface ITestInterface\n{\n    static virtual void StaticVirtualMembersInInterfacesNoncompliant()\n    {\n        var caller = new OtherAsyncMethodCaller(Method);\n        caller.BeginInvoke(null, null); // Noncompliant\n\n        void Method()\n        { }\n    }\n\n    static virtual void StaticVirtualMembersInInterfacesCompliant()\n    {\n        var caller = new OtherAsyncMethodCaller(Method);\n        IAsyncResult result = caller.BeginInvoke(null, null); // Compliant\n        caller.EndInvoke(result);\n\n        void Method()\n        { }\n    }\n}\n\npublic interface ISomeInterface\n{\n    static abstract void StaticVirtualMembersInInterfaces();\n}\n\npublic class SomeClass : ISomeInterface\n{\n    public static void StaticVirtualMembersInInterfaces()\n    {\n        return;\n    }\n}\n\npublic class SomeOtherClass\n{\n    void TestMethodCompliant()\n    {\n        var caller = new OtherAsyncMethodCaller(SomeClass.StaticVirtualMembersInInterfaces);\n        IAsyncResult result = caller.BeginInvoke(null, null); // Compliant\n        caller.EndInvoke(result);\n    }\n\n    void TestMethodNonCompliant()\n    {\n        var caller = new OtherAsyncMethodCaller(SomeClass.StaticVirtualMembersInInterfaces);\n        caller.BeginInvoke(null, null); // Noncompliant\n    }\n}\n\npublic partial class CrossTreeCallbackField\n{\n    private AsyncMethodCaller caller = new AsyncMethodCaller(AsyncMethod);\n\n    private void TestCrossTreeCallbackFieldNoncompliant()\n    {\n        caller.BeginInvoke(\"delegate\", 1, callbackFieldNoncompliant, null); // Noncompliant\n    }\n\n    private static void AsyncMethod(string msg, int i) =>\n        Console.WriteLine($\"AsyncMethod: {msg} {i}\");\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/BeginInvokePairedWithEndInvoke.Partial.vb",
    "content": "﻿Imports System\n\nPartial Class CrossTreeCallbackFieldVB\n    Private CallbackFieldNoncompliant As New AsyncCallback(AddressOf HandlerWithoutEndInvoke)\n\n    Private Sub HandlerWithoutEndInvoke(Result As IAsyncResult)\n    End Sub\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/BeginInvokePairedWithEndInvoke.cs",
    "content": "﻿using System;\nusing System.Threading;\n\nnamespace Tests.Diagnostics\n{\n    public delegate void AsyncMethodCaller(String name);\n\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            BeginInvokeAndEndInvokeOnDelegateWithoutCallback();\n        }\n\n        private static void BeginInvokeOnDelegateWithoutCallback()\n        {\n            var caller = new AsyncMethodCaller(AsyncMethod);\n            caller.BeginInvoke(\"delegate\", /* callback */null, /* state */ null); // Noncompliant {{Pair this \"BeginInvoke\" with an \"EndInvoke\".}}\n            // https://docs.microsoft.com/en-us/dotnet/standard/asynchronous-programming-patterns/calling-synchronous-methods-asynchronously\n            // «Important: No matter which technique you use, always call EndInvoke to complete your asynchronous call.»\n        }\n\n        private static void BeginInvokeAndEndInvokeOnDelegateWithoutCallback()\n        {\n            Console.WriteLine(\"BeginInvokeAndEndInvokeOnDelegateWithoutCallback\");\n            var caller = new AsyncMethodCaller(AsyncMethod);\n            IAsyncResult result = caller.BeginInvoke(\"delegate\", /* callback */null, /* state */ null); // Compliant\n            caller.EndInvoke(result);\n        }\n\n        private static void BeginInvokeOnDelegateWithLambdaCallback1()\n        {\n            var caller = new AsyncMethodCaller(AsyncMethod);\n            caller.BeginInvoke(\"delegate\", result => { }, null); // Noncompliant\n        }\n\n        private static void BeginInvokeOnDelegateWithLambdaCallback2()\n        {\n            var caller = new AsyncMethodCaller(AsyncMethod);\n            var callback = new AsyncCallback(result => { });\n            caller.BeginInvoke(\"delegate\",  callback, null); // Noncompliant\n        }\n\n        private static void BeginInvokeAndEndInvokeOnDelegateWithLambdaCallback1()\n        {\n            var caller = new AsyncMethodCaller(AsyncMethod);\n            caller.BeginInvoke(name: \"delegate\", @object: null, callback: result => caller.EndInvoke(result)); // Compliant\n        }\n\n        private static void BeginInvokeAndEndInvokeOnDelegateWithLambdaCallback2()\n        {\n            var caller = new AsyncMethodCaller(AsyncMethod);\n            var callback = new AsyncCallback(result => caller.EndInvoke(result));\n            caller.BeginInvoke(\"delegate\", callback, null); // Compliant, EndInvoke is called by callback\n        }\n\n        private static void BeginInvokeOnDelegateWithDelegateCallback()\n        {\n            var caller = new AsyncMethodCaller(AsyncMethod);\n            caller.BeginInvoke(\"delegate\",  delegate(IAsyncResult result) { Console.WriteLine(); }, null); // Noncompliant\n        }\n\n        private static void BeginInvokeAndEndInvokeOnDelegateWithDelegateCallback()\n        {\n            var caller = new AsyncMethodCaller(AsyncMethod);\n            caller.BeginInvoke(\"delegate\",  delegate(IAsyncResult result) { caller.EndInvoke(result); }, null); // Compliant\n        }\n\n        private static void BeginInvokeAndEndInvokeOnDelegateWithVariableCallback()\n        {\n            var caller = new AsyncMethodCaller(AsyncMethod);\n            AsyncCallback callback = result => { caller.EndInvoke(result); };\n            caller.BeginInvoke(\"delegate\",  callback, null); // Compliant\n        }\n\n        private static void BeginInvokeAndEndInvokeOnDelegateWithStaticCallback1()\n        {\n            var caller = new AsyncMethodCaller(AsyncMethod);\n            var callback = new AsyncCallback(StaticCallEndInvoke);\n            caller.BeginInvoke(\"delegate\",  callback, null); // Compliant, EndInvoke is called by callback and it's StaticCallEndInvoke\n        }\n\n        private static void BeginInvokeAndEndInvokeOnDelegateWithStaticCallback2()\n        {\n            var caller = new AsyncMethodCaller(AsyncMethod);\n            caller.BeginInvoke(\"delegate\",  new AsyncCallback(StaticDoNothing), null); // Noncompliant\n        }\n\n        private static void BeginInvokeAndEndInvokeOnDelegateWithStaticCallback3()\n        {\n            var caller = new AsyncMethodCaller(AsyncMethod);\n            var callback = new AsyncCallback(StaticDoNothing);\n            caller.BeginInvoke(\"delegate\",  callback, null); // Noncompliant\n        }\n\n        private static void BeginInvokeOnDelegateWithCallbackAssignment()\n        {\n            var caller = new AsyncMethodCaller(AsyncMethod);\n            AsyncCallback callback;\n            callback = new AsyncCallback(StaticDoNothing);\n            caller.BeginInvoke(\"delegate\",  callback, null); // false-negative, we only look at the variable initialization and not at all its assignments\n        }\n\n        private static void BeginInvokeAndEndInvokeOnDelegateWithWrapperCallback1()\n        {\n            var caller = new AsyncMethodCaller(AsyncMethod);\n            var wrapper = new CallerWrapper(caller);\n            var callback = new AsyncCallback(wrapper.CallEndInvoke);\n            caller.BeginInvoke(\"delegate\",  callback, null); // Compliant, EndInvoke is called by wrapper.CallEndInvoke\n        }\n\n        private static void BeginInvokeAndEndInvokeOnDelegateWithWrapperCallback2()\n        {\n            var caller = new AsyncMethodCaller(AsyncMethod);\n            var wrapper = new CallerWrapper(caller);\n            var callback = new AsyncCallback(wrapper.DoNothing);\n            caller.BeginInvoke(\"delegate\",  callback, null); // Noncompliant\n        }\n\n        private static void BeginInvokeAndEndInvokeOnDelegateWithNonExistingCallback()\n        {\n            var caller = new AsyncMethodCaller(AsyncMethod);\n            var callback = new AsyncCallback(Console.WriteLine);\n            caller.BeginInvoke(\"delegate\",  callback, null); // Compliant\n        }\n\n        private static void BeginInvokeOnAnyClassButDelegate()\n        {\n            var notADelegate = new AnyClassWithOptionalEndInvoke();\n            var result = notADelegate.BeginInvoke(new AsyncMethodCaller(AsyncMethod));\n            // Compliant, NotADelegate class declared below does not required a call to EndInvoke\n            // Same as System.Windows.Forms.Control see\n            // https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.control.begininvoke?view=netframework-4.6\n            // «You can call EndInvoke to retrieve the return value from the delegate, if necessary, but this is not required.»\n        }\n\n        private static void AsyncMethod(string msg)\n        {\n            Console.WriteLine($\"AsyncMethod: {msg}\");\n        }\n\n        private static void StaticCallEndInvoke(IAsyncResult result)\n        {\n            AsyncMethodCaller caller = (AsyncMethodCaller) ((AsyncResult) result).AsyncDelegate;\n            caller.EndInvoke(result);\n        }\n\n        private static void StaticDoNothing(IAsyncResult result)\n        {\n        }\n\n        private static void EndInvokeOfDifferentAction()\n        {\n            Action a = () => { };\n            Action b = () => { };\n            AsyncCallback callback = b.EndInvoke;\n            a.BeginInvoke(callback, null); // FN\n        }\n\n        private static void BeginInvokeAndEndInvokeOnDifferentDelegateWithVariableCallback()\n        {\n            var caller = new AsyncMethodCaller(AsyncMethod);\n            var caller2 = new AsyncMethodCaller(AsyncMethod);\n            AsyncCallback callback = result => { caller2.EndInvoke(result); };\n            caller.BeginInvoke(\"delegate\", callback, null); // FN\n        }\n\n        public class CallerWrapper\n        {\n            private AsyncMethodCaller caller;\n\n            public  CallerWrapper(AsyncMethodCaller caller)\n            {\n                this.caller = caller;\n            }\n\n            public void CallEndInvoke(IAsyncResult result)\n            {\n                caller.EndInvoke(result);\n            }\n\n            public void DoNothing(IAsyncResult result)\n            {\n            }\n\n        }\n\n        public class AnyClassWithOptionalEndInvoke\n        {\n\n            public IAsyncResult BeginInvoke(AsyncMethodCaller method)\n            {\n                return method.BeginInvoke(\"NotADelegate\", result => { method.EndInvoke(result); }, null);\n            }\n\n            // It's not required to call EndInvoke after BeginInvoke on this class\n            public object EndInvoke(IAsyncResult asyncResult)\n            {\n                return null;\n            }\n\n        }\n\n        // Coverage\n        public class Foo\n        {\n            public static AsyncMethodCaller caller = new AsyncMethodCaller(AsyncMethod);\n            public IAsyncResult result = caller.BeginInvoke(\"Foo\", null, null); // Noncompliant\n            public Action action1 = delegate\n            {\n                caller.BeginInvoke(\"Foo\", null, null); // Noncompliant\n            };\n            public Action action2 = () =>\n            {\n                caller.BeginInvoke(\"Foo\", null, null); // Noncompliant\n            };\n            public Action<string> action3 = name =>\n            {\n                caller.BeginInvoke(name, null, null); // Noncompliant\n            };\n\n            public int prop\n            {\n                get\n                {\n                    caller.BeginInvoke(\"prop\", null, null); // Noncompliant\n                    return 0;\n                }\n            }\n\n            public static implicit operator int(Foo f)\n            {\n                caller.BeginInvoke(\"prop\", null, null); // Noncompliant\n                return 0;\n            }\n\n            public static Foo operator +(Foo b, Foo c)\n            {\n                caller.BeginInvoke(\"prop\", null, null); // Noncompliant\n                return new Foo();\n            }\n\n            static Foo()\n            {\n                caller.BeginInvoke(\"Foo\", null, null); // Noncompliant\n            }\n\n            public Foo()\n            {\n                caller.BeginInvoke(\"Foo\", null, null); // Noncompliant\n            }\n\n            public void Compliant()\n            {\n                IAsyncResult result = caller.BeginInvoke(\"method\", null, null); // Compliant\n                caller.EndInvoke(result);\n            }\n\n            public void Bar()\n            {\n                caller.BeginInvoke(\"Foo\", null, null); // Noncompliant\n            }\n\n            ~Foo()\n            {\n                caller.BeginInvoke(\"Foo\", null, null); // Noncompliant\n            }\n\n            private void InvokeSomethingElse()\n            {\n                var BeginInvoke = \"MemberBinding\";\n                var EndInvoke = \"MemberBinding\";\n                BeginInvoke.ToString();\n                EndInvoke.ToString();\n            }\n\n            public struct FooStruct\n            {\n                public string field;\n\n                public FooStruct(string field)\n                {\n                    this.field = field;\n                    caller.BeginInvoke(\"FooStruct\", null, null); // Noncompliant\n                }\n            }\n\n            public void Container()\n            {\n                IAsyncResult result = BeginInvokeHiddenInALocalFunction();\n                caller.EndInvoke(result);\n\n                IAsyncResult BeginInvokeHiddenInALocalFunction()\n                {\n                    return caller.BeginInvoke(\"method\", null, null); // Noncompliant\n                }\n            }\n        }\n\n        public class FakeProperty\n        {\n            private AsyncMethodCaller caller;\n\n            public int Prop\n            {\n                get\n                {\n                    caller.BeginInvoke(\"prop\", null, null); // FN, detection thinks that \"EndInvoke\" in setter is valid pair for this\n                    return 0;\n                }\n                set\n                {\n                    caller.EndInvoke(null);\n                }\n            }\n        }\n    }\n\n    // Dummy implementation of IAsyncResult compatible with both .Net Framework and .Net Core\n    internal class AsyncResult : IAsyncResult\n    {\n        public object AsyncState { get; }\n\n        public WaitHandle AsyncWaitHandle { get; }\n\n        public bool CompletedSynchronously { get; }\n\n        public bool IsCompleted { get; }\n\n        public virtual object AsyncDelegate { get; }\n    }\n\n    class ReproEndinvokeDelegate\n    {\n        public void BeginInvokeWithEndinvokeDelegate()\n        {\n            Action a = () => { };\n            a.BeginInvoke(a.EndInvoke, null); // Compliant\n        }\n\n        public void AsyncCallbackLocalVariable()\n        {\n            Action a = () => { };\n            AsyncCallback callback = a.EndInvoke;\n            a.BeginInvoke(callback, null); // Compliant\n        }\n\n        public void AsyncCallbackLocalVariableNotEndinvokeAccess()\n        {\n            Action a = () => { };\n            AsyncCallback callback = a.NotEndInvoke; // Error [CS1061]\n            a.BeginInvoke(callback, null); // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/BeginInvokePairedWithEndInvoke.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.Threading\n\nPublic Delegate Sub AsyncMethodCaller(Name As String)\n\nModule Common\n\n    Public Sub AsyncMethod(Msg As String)\n        Console.WriteLine($\"AsyncMethod: {Msg}\")\n    End Sub\n\n    Public Sub Main()\n        BeginInvokeAndEndInvokeOnDelegateWithoutCallback()\n    End Sub\n\n    Private Sub BeginInvokeOnDelegateWithoutCallbackSub()\n        Dim Caller As New AsyncMethodCaller(AddressOf AsyncMethod)\n        Caller.BeginInvoke(\"delegate\", Nothing, Nothing) ' Noncompliant {{Pair this \"BeginInvoke\" with an \"EndInvoke\".}}\n        ' https:'docs.microsoft.com/en-us/dotnet/standard/asynchronous-programming-patterns/calling-synchronous-methods-asynchronously\n        ' «Important: No matter which technique you use, always call EndInvoke to complete your asynchronous call.»\n    End Sub\n\n    Private Function BeginInvokeOnDelegateWithoutCallbackFunction() As String\n        Dim Caller As New AsyncMethodCaller(AddressOf AsyncMethod)\n        Caller.BeginInvoke(\"delegate\", Nothing, Nothing) ' Noncompliant {{Pair this \"BeginInvoke\" with an \"EndInvoke\".}}\n        ' https:'docs.microsoft.com/en-us/dotnet/standard/asynchronous-programming-patterns/calling-synchronous-methods-asynchronously\n        ' «Important: No matter which technique you use, always call EndInvoke to complete your asynchronous call.»\n    End Function\n\n    Private Sub BeginInvokeAndEndInvokeOnDelegateWithoutCallback()\n        Console.WriteLine(\"BeginInvokeAndEndInvokeOnDelegateWithoutCallback\")\n        Dim Caller As New AsyncMethodCaller(AddressOf AsyncMethod)\n        Dim Result As IAsyncResult = Caller.BeginInvoke(\"delegate\", Nothing, Nothing) ' Compliant\n        Caller.EndInvoke(Result)\n    End Sub\n\n    Private Sub BeginInvokeOnDelegateWithLambdaCallback1()\n        Dim Caller As New AsyncMethodCaller(AddressOf AsyncMethod)\n        Caller.BeginInvoke(\"delegate\", Sub(Result)          ' Noncompliant\n                                       End Sub, Nothing)\n    End Sub\n\n    Private Sub BeginInvokeOnDelegateWithLambdaCallback2()\n        Dim Caller As New AsyncMethodCaller(AddressOf AsyncMethod)\n        Dim Callback As New AsyncCallback(Sub(Result)\n                                          End Sub)\n        Caller.BeginInvoke(\"delegate\", Callback, Nothing) ' Noncompliant\n    End Sub\n\n    Private Sub BeginInvokeOnDelegateWithLambdaCallback3()\n        Dim Caller As New AsyncMethodCaller(AddressOf AsyncMethod)\n        Dim Callback As AsyncCallback = New AsyncCallback(Sub(Result)\n                                                          End Sub)\n        Caller.BeginInvoke(\"delegate\", Callback, Nothing) ' Noncompliant\n    End Sub\n\n    Private Sub BeginInvokeAndEndInvokeOnDelegateWithLambdaCallback1()\n        Dim Caller As New AsyncMethodCaller(AddressOf AsyncMethod)\n        Caller.BeginInvoke(Name:=\"delegate\", DelegateAsyncState:=Nothing, DelegateCallback:=Sub(Result) Caller.EndInvoke(Result))   ' Compliant\n        Caller.BeginInvoke(Name:=\"delegate\", DelegateAsyncState:=Nothing, DelegateCallback:=Sub(Result)                             ' Compliant\n                                                                                                Caller.EndInvoke(Result)\n                                                                                            End Sub)\n    End Sub\n\n    Private Sub BeginInvokeAndEndInvokeOnDelegateWithLambdaCallback2()\n        Dim Caller As New AsyncMethodCaller(AddressOf AsyncMethod)\n        Dim Callback As New AsyncCallback(Sub(Result) Caller.EndInvoke(Result))\n        Caller.BeginInvoke(\"delegate\", Callback, Nothing) ' Compliant, EndInvoke is called by Callback\n    End Sub\n\n    Private Sub BeginInvokeAndEndInvokeOnDelegateWithVariableCallback()\n        Dim Caller As New AsyncMethodCaller(AddressOf AsyncMethod)\n        Dim Callback As AsyncCallback = Sub(Result) Caller.EndInvoke(Result)\n        Caller.BeginInvoke(\"delegate\", Callback, Nothing) ' Compliant\n    End Sub\n\n    Private Sub BeginInvokeAndEndInvokeOnDelegateWithStaticCallback1()\n        Dim Caller As New AsyncMethodCaller(AddressOf AsyncMethod)\n        Dim Callback As New AsyncCallback(AddressOf SharedCallEndInvoke)\n        Caller.BeginInvoke(\"delegate\", Callback, Nothing) ' Compliant, EndInvoke is called by SharedCallEndInvoke\n    End Sub\n\n    Private Sub BeginInvokeAndEndInvokeOnDelegateWithStaticCallback2()\n        Dim Caller As New AsyncMethodCaller(AddressOf AsyncMethod)\n        Caller.BeginInvoke(\"delegate\", New AsyncCallback(AddressOf SharedDoNothing), Nothing) ' Noncompliant\n    End Sub\n\n    Private Sub BeginInvokeAndEndInvokeOnDelegateWithStaticCallback3()\n        Dim Caller As New AsyncMethodCaller(AddressOf AsyncMethod)\n        Dim Callback As New AsyncCallback(AddressOf SharedDoNothing)\n        Caller.BeginInvoke(\"delegate\", Callback, Nothing) ' Noncompliant\n    End Sub\n\n    Private Sub BeginInvokeOnDelegateWithCallbackAssignment()\n        Dim Caller As New AsyncMethodCaller(AddressOf AsyncMethod)\n        Dim Callback As AsyncCallback\n        Callback = New AsyncCallback(AddressOf SharedDoNothing)\n        Caller.BeginInvoke(\"delegate\", Callback, Nothing) ' false-negative, we only look at the variable initialization and not at all its assignments\n    End Sub\n\n    Private Sub BeginInvokeAndEndInvokeOnDelegateWithWrapperCallback1()\n        Dim Caller As New AsyncMethodCaller(AddressOf AsyncMethod)\n        Dim Wrapper As New CallerWrapper(Caller)\n        Dim Callback As New AsyncCallback(AddressOf Wrapper.CallEndInvoke)\n        Caller.BeginInvoke(\"delegate\", Callback, Nothing) ' Compliant, EndInvoke is called by wrapper.CallEndInvoke\n    End Sub\n\n    Private Sub BeginInvokeAndEndInvokeOnDelegateWithWrapperCallback2()\n        Dim Caller As New AsyncMethodCaller(AddressOf AsyncMethod)\n        Dim Wrapper As New CallerWrapper(Caller)\n        Dim Callback As New AsyncCallback(AddressOf Wrapper.DoNothing)\n        Caller.BeginInvoke(\"delegate\", Callback, Nothing) ' Noncompliant\n    End Sub\n\n    Private Sub BeginInvokeOnAnyClassButDelegate()\n        Dim NotADelegate As New AnyClassWithOptionalEndInvoke()\n        Dim Result As IAsyncResult = NotADelegate.BeginInvoke(New AsyncMethodCaller(AddressOf AsyncMethod))\n        ' Compliant, NotADelegate class declared below does not required a call to EndInvoke\n        ' Same as System.Windows.Forms.Control see\n        ' https:'docs.microsoft.com/en-us/dotnet/api/system.windows.forms.control.begininvoke?view=netframework-4.6\n        ' «You can call EndInvoke to retrieve the return value from the delegate, if necessary, but this is not required.»\n    End Sub\n\n    Private Sub SharedCallEndInvoke(Result As IAsyncResult)\n        Dim Caller As AsyncMethodCaller = DirectCast(DirectCast(Result, AsyncResult).AsyncDelegate, AsyncMethodCaller)\n        Caller.EndInvoke(Result)\n    End Sub\n\n    Private Sub SharedDoNothing(Result As IAsyncResult)\n    End Sub\n\n    Public Sub NullConditionalIndexing(List As List(Of Integer))\n        Dim Value As Integer = List?(0)\n    End Sub\n\nEnd Module\n\nPublic Class CallerWrapper\n\n    Private Caller As AsyncMethodCaller\n\n    Public Sub New(Caller As AsyncMethodCaller)\n        Me.Caller = Caller\n    End Sub\n\n    Public Sub CallEndInvoke(Result As IAsyncResult)\n        Caller.EndInvoke(Result)\n    End Sub\n\n    Public Sub DoNothing(Result As IAsyncResult)\n    End Sub\n\nEnd Class\n\nPublic Class AnyClassWithOptionalEndInvoke\n\n    Public Function BeginInvoke(Method As AsyncMethodCaller) As IAsyncResult\n        Return Method.BeginInvoke(\"NotADelegate\", Sub(ar) Method.EndInvoke(ar), Nothing)\n    End Function\n\n    ' It's not required to call EndInvoke after BeginInvoke on this class\n    Public Function EndInvoke(asyncResult As IAsyncResult) As Object\n        Return Nothing\n    End Function\n\nEnd Class\n\nPublic Module CommonMod\n\n    Public Caller As New AsyncMethodCaller(AddressOf AsyncMethod)\n    Public Result As IAsyncResult = Caller.BeginInvoke(\"Foo\", Nothing, Nothing)     ' Noncompliant\n    Public Property AutoProperty As IAsyncResult = Caller.BeginInvoke(\"Foo\", Nothing, Nothing)     ' Noncompliant\n\n    Public Class Fake\n\n        Public Sub Misleading()\n            Caller.EndInvoke(Nothing)\n        End Sub\n\n    End Class\n\nEnd Module\n\nPublic Class ForCoverage\n\n    Public Shared Caller As New AsyncMethodCaller(AddressOf AsyncMethod)\n    Public Result As IAsyncResult = Caller.BeginInvoke(\"Foo\", Nothing, Nothing)     ' Noncompliant\n    Public Property AutoProperty As IAsyncResult = Caller.BeginInvoke(\"Foo\", Nothing, Nothing)     ' Noncompliant\n\n    Public Action1 As Action = Sub()\n                                   Caller.BeginInvoke(\"Foo\", Nothing, Nothing)      ' Noncompliant\n                               End Sub\n\n    Public Action2 As Action = Sub() Caller.BeginInvoke(\"Foo\", Nothing, Nothing)    ' Noncompliant\n\n    Public Action3 As Action(Of String) = Function(Name) Caller.BeginInvoke(Name, Nothing, Nothing) ' Noncompliant\n\n    Public Action4 As Action(Of String) = Function(Name)\n                                              Return Caller.BeginInvoke(Name, Nothing, Nothing) ' Noncompliant\n                                          End Function\n\n    Public ReadOnly Property Prop As Integer\n        Get\n            Caller.BeginInvoke(\"prop\", Nothing, Nothing) ' Noncompliant\n        End Get\n    End Property\n\n    Public Property PropFake As Integer\n        Get\n            Caller.BeginInvoke(\"prop\", Nothing, Nothing) ' Noncompliant\n        End Get\n        Set(value As Integer)\n            Caller.EndInvoke(Nothing)\n        End Set\n    End Property\n\n    Public Custom Event CustomHandler As EventHandler\n        AddHandler(value As EventHandler)\n            Caller.BeginInvoke(\"prop\", Nothing, Nothing) ' Noncompliant\n        End AddHandler\n        RemoveHandler(value As EventHandler)\n            Caller.BeginInvoke(\"prop\", Nothing, Nothing) ' Noncompliant\n        End RemoveHandler\n        RaiseEvent(sender As Object, e As EventArgs)\n            Caller.EndInvoke(Nothing)\n        End RaiseEvent\n    End Event\n\n    Public Shared Widening Operator CType(F As ForCoverage) As Integer\n        Caller.BeginInvoke(\"prop\", Nothing, Nothing) ' Noncompliant\n    End Operator\n\n    Public Shared Operator +(a As ForCoverage, b As ForCoverage) As ForCoverage\n        Caller.BeginInvoke(\"prop\", Nothing, Nothing) ' Noncompliant\n    End Operator\n\n    Shared Sub New()\n        Caller.BeginInvoke(\"Foo\", Nothing, Nothing) ' Noncompliant\n    End Sub\n\n    Public Sub New()\n        Caller.BeginInvoke(\"Foo\", Nothing, Nothing) ' Noncompliant\n    End Sub\n\n    Public Sub Compliant()\n        Dim Result As IAsyncResult = Caller.BeginInvoke(\"method\", Nothing, Nothing) ' Compliant\n        Caller.EndInvoke(Result)\n    End Sub\n\n    Public Sub Bar()\n        Caller.BeginInvoke(\"Foo\", Nothing, Nothing) ' Noncompliant\n    End Sub\n\n    Protected Overrides Sub Finalize()\n        Caller.BeginInvoke(\"Foo\", Nothing, Nothing) ' Noncompliant\n    End Sub\n\n    Public Sub BeginInvoke()\n    End Sub\n\n    Private Sub EndInvoke()\n    End Sub\n\n    Public Sub BeginInvoke(Arg As String)\n    End Sub\n\n    Private Sub InvokeFakeMethod()\n        BeginInvoke()\n        BeginInvoke(\"Wrong parameter type\")\n        EndInvoke()\n    End Sub\n\n    Private Sub InvokeSomethingElse()\n        Dim BeginInvoke As String = \"MemberBinding\"\n        Dim EndInvoke As String = \"MemberBinding\"\n        BeginInvoke.ToString()\n        EndInvoke.ToString()\n    End Sub\n\n    Private Sub InvokeFromInvocation()\n        Caller.BeginInvoke(\"FromInvocation\", CreateCallback(), Nothing) 'Noncompliant\n    End Sub\n\n    Private Function CreateCallback() As AsyncCallback\n        Return Nothing\n    End Function\n\n    Public Structure FooStruct\n\n        Public Field As String\n\n        Public Sub New(Field As String)\n            Me.Field = Field\n            Caller.BeginInvoke(\"FooStruct\", Nothing, Nothing) ' Noncompliant\n        End Sub\n\n    End Structure\n\nEnd Class\n\n' Dummy implementation of IAsyncResult compatible with both .Net Framework and .Net Core\nFriend Class AsyncResult\n    Implements IAsyncResult\n\n    Public ReadOnly Property AsyncDelegate As Object\n\n    Public ReadOnly Property IsCompleted As Boolean Implements IAsyncResult.IsCompleted\n    Public ReadOnly Property AsyncWaitHandle As WaitHandle Implements IAsyncResult.AsyncWaitHandle\n    Public ReadOnly Property AsyncState As Object Implements IAsyncResult.AsyncState\n    Public ReadOnly Property CompletedSynchronously As Boolean Implements IAsyncResult.CompletedSynchronously\n\nEnd Class\n\nClass ReproEndinvokeDelegate\n\n    Public Sub BeginInvokeWithEndinvokeDelegate()\n        Dim A As Action = Sub() Return\n        A.BeginInvoke(AddressOf A.EndInvoke, Nothing) ' Compliant\n     End Sub\n\nEnd Class\n\nPartial Class CrossTreeCallbackFieldVB\n\n    Private Sub TestCrossTreeCallbackFieldNoncompliant()\n        Dim Caller As New AsyncMethodCaller(AddressOf CrossTreeAsyncMethod)\n        Caller.BeginInvoke(\"delegate\", CallbackFieldNoncompliant, Nothing) ' Noncompliant\n    End Sub\n\n    Private Shared Sub CrossTreeAsyncMethod(Msg As String)\n        Console.WriteLine($\"AsyncMethod: {Msg}\")\n    End Sub\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/BinaryOperationWithIdenticalExpressions.CSharpLatest.cs",
    "content": "﻿using System;\nusing System.Numerics;\n\nclass GenericMathFeatures\n{\n    void UnsignedRightShiftOperator()\n    {\n        int i = 1 >>> 1;\n        i = 1 >>> 0x1;\n        i = 2 >>> 2;\n    }\n\n    void OverloadableOperators()\n    {\n        var test1 = new MyClass<int>(3, 3);\n        var testSub = test1 - test1; // Noncompliant\n        // Secondary@-1\n    }\n}\n\npublic record MyClass<T>(T X, T Y) where T : ISubtractionOperators<T, T, T>\n{\n    public static MyClass<T> operator -(MyClass<T> left, MyClass<T> right) =>\n        left with\n        {\n            X = left.X - right.X,\n            Y = left.Y - right.Y\n        };\n}\n\npublic class OverriddenCompoundAssignment\n{\n    void Test()\n    {\n        var a = new C1();\n        a -= a;         // Noncompliant\n        // Secondary@-1\n\n        var b = a | a; // Noncompliant\n        // Secondary@-1\n    }\n\n    class C1\n    {\n        public int Value;\n\n        public void operator -=(C1 x)\n        {\n            Value += x.Value;\n        }\n\n        public static C1 operator |(C1 a, C1 b)\n        {\n            return new C1 { Value = a.Value + b.Value };\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/BinaryOperationWithIdenticalExpressions.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Tests.TestCases\n{\n    class Foo { }\n\n    class BinaryOperationWithIdenticalExpressions\n    {\n        public void doZ() { throw new Exception();}\n        public void doW() { throw new Exception();}\n        public void Test(bool a, bool b)\n        {\n            if (a == a)\n//                   ^ {{Correct one of the identical expressions on both sides of operator '=='.}}\n//              ^ Secondary@-1\n            {\n                doZ();\n            }\n\n            if (a == b || (a == /*comment*/ b))\n//                        ^^^^^^^^^^^^^^^^^^^^ {{Correct one of the identical expressions on both sides of operator '||'.}}\n//              ^^^^^^ Secondary@-1\n            {\n                doW();\n            }\n\n            int j = 5 / 5; //Noncompliant\n            // Secondary@-1\n            int k = 5 - 5; //Noncompliant\n            // Secondary@-1\n\n            int l = 5 | 5; // Noncompliant\n            // Secondary@-1\n            l |= (l); // Noncompliant\n            // Secondary@-1\n\n            int i = 1;\n\n            object.Equals(i, i);\n//                        ^ {{Change one instance of 'i' to a different value; comparing 'i' to itself always returns true.}}\n//                           ^ Secondary@-1\n\n            var o = new object();\n            o.Equals(o);\n//          ^ {{Change one instance of 'o' to a different value; comparing 'o' to itself always returns true.}}\n//                   ^ Secondary@-1\n\n            (new object()).Equals(new object());\n//          ^^^^^^^^^^^^^^ {{Change one instance of 'new object()' to a different value; comparing 'new object()' to itself always returns true.}}\n//                                ^^^^^^^^^^^^ Secondary@-1\n\n            Foo f = new Foo();\n            f.Equals(f); // Noncompliant\n            // Secondary@-1\n\n        }\n\n        public void CompliantCases()\n        {\n            int i = 1 << 1;\n            i = 1 << 0x1;\n            i = 2 << 2;\n            i = 2 + 2;\n            i = 2 * 2;\n\n            i = i;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/BinaryOperationWithIdenticalExpressions.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.Linq\nImports System.Text\nImports System.Threading.Tasks\n\nNamespace Tests.TestCases\n    Class BinaryOperationWithIdenticalExpressions\n        Public Sub doZ()\n        End Sub\n        Public Sub doW()\n        End Sub\n        Public Sub Test(a As Boolean, b As Boolean)\n\n            If (a = a) Then ' Noncompliant {{Correct one of the identical expressions on both sides of operator '='.}}\n'               ^^^^^\n                doZ()\n            End If\n\n            If a = b OrElse a = b Then ' Noncompliant {{Correct one of the identical expressions on both sides of operator 'OrElse'.}}\n                doW()\n            End If\n\n            Dim j = 5 / 5 ' Noncompliant\n            j = 5 \\ 5 ' Noncompliant\n            j = 5 Mod 5 ' Noncompliant\n            Dim k = 5 - 5 ' Noncompliant\n            Dim l = 5 * 5\n\n\n            Dim i = 1 << 1\n\n            i -= i ' Noncompliant\n            i += i\n            i /= i ' Noncompliant\n            i \\= i ' Noncompliant\n        End Sub\n    End Class\nEnd Namespace\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/BlazorQueryParameterRoutableComponent.Compliant.cs",
    "content": "﻿using Microsoft.AspNetCore.Components;\nusing System;\n\nnamespace EmptyProject\n{\n    [Route(\"/query-parameters\")]\n    class BlazorQueryParameterRoutableComponent_Compliant : ComponentBase\n    {\n        [Parameter]\n        [SupplyParameterFromQuery]\n        public int Number { get; set; } // Compliant\n\n        [Parameter, SupplyParameterFromQuery]\n        public int MyInt { get; set; } // Compliant\n\n        [Parameter]\n        public TimeSpan SupplyParameterFromQueryAttributeMissing { get; set; } // Compliant: missing [SupplyParameterFromQuery]\n\n        [SupplyParameterFromQuery]\n        public TimeSpan ParameterAttributeMissing { get; set; } // Compliant: missing [Parameter]\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/BlazorQueryParameterRoutableComponent.Latest.Partial.1.razor.cs",
    "content": "﻿using Microsoft.AspNetCore.Components;\nusing System;\n\nnamespace EmptyProject\n{\n    public partial class BlazorQueryParameterRoutableComponent_Latest_Partial : ComponentBase\n    {\n        [Parameter]\n        [SupplyParameterFromQuery]\n        public int Number { get; set; } // Compliant\n\n        // S6803 Compliant: the .razor part of the component defines the route\n        [Parameter]\n        [SupplyParameterFromQuery]\n        public TimeSpan TimeSpan { get; set; } // Noncompliant {{Query parameter type 'TimeSpan' is not supported.}}\n        //     ^^^^^^^^\n\n        [Parameter]\n        public TimeSpan TimeSpanParam { get; set; } // Compliant\n\n        public partial TimeSpan DefinedInBlazor { get => default; set { } } // Noncompliant {{Query parameter type 'TimeSpan' is not supported.}}\n\n        [Parameter]\n        [SupplyParameterFromQuery]\n        public partial TimeSpan ImplementedInBlazor { get; set; } // Noncompliant {{Query parameter type 'TimeSpan' is not supported.}}\n\n        [SupplyParameterFromQuery]\n        public partial TimeSpan MixedAttributes { get => default; set { } } // Noncompliant {{Query parameter type 'TimeSpan' is not supported.}}\n\n        [SupplyParameterFromQuery]\n        public partial TimeSpan MixedAttributesInPartials { get; set; } // Noncompliant {{Query parameter type 'TimeSpan' is not supported.}}\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/BlazorQueryParameterRoutableComponent.Latest.Partial.2.razor.cs",
    "content": "﻿using Microsoft.AspNetCore.Components;\nusing System;\n\nnamespace EmptyProject\n{\n    public partial class BlazorQueryParameterRoutableComponent_Latest_Partial\n    {\n        [Parameter]\n        public partial TimeSpan MixedAttributesInPartials { get => default; set { } } // Noncompliant {{Query parameter type 'TimeSpan' is not supported.}}\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/BlazorQueryParameterRoutableComponent.Latest.Partial.razor",
    "content": "﻿@namespace EmptyProject\n@page \"/component\"\n\n@code\n{\n    [Parameter]\n    [SupplyParameterFromQuery]\n    public partial TimeSpan DefinedInBlazor { get; set; } // Noncompliant {{Query parameter type 'TimeSpan' is not supported.}}\n\n    public partial TimeSpan ImplementedInBlazor { get => default; set { } } // Noncompliant {{Query parameter type 'TimeSpan' is not supported.}}\n\n    [Parameter]\n    public partial TimeSpan MixedAttributes { get; set; } // Noncompliant {{Query parameter type 'TimeSpan' is not supported.}}\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/BlazorQueryParameterRoutableComponent.NoRoute.razor",
    "content": "﻿@namespace EmptyProject\n\n@code {\n    [Parameter]\n    public bool BoolParam { get; set; } // Compliant\n\n    [Parameter]\n    public DateTime DateTimeParam { get; set; } // Compliant\n\n    [Parameter]\n    public decimal DecimalParam { get; set; } // Compliant\n\n    [Parameter]\n    public double DoubleParam { get; set; } // Compliant\n\n    [Parameter]\n    public float FloatParam { get; set; } // Compliant\n\n    [Parameter]\n    public Guid GuidParam { get; set; } // Compliant\n\n    [Parameter]\n    public int IntParam { get; set; } // Compliant\n\n    [Parameter]\n    public long LongParam { get; set; } // Compliant\n\n    [Parameter]\n    public string StringParam { get; set; } // Compliant\n\n    [Parameter]\n    public bool? NullableBoolParamShortForm { get; set; } // Compliant\n\n    [Parameter]\n    public Nullable<bool> NullableBoolParamLongForm { get; set; } // Compliant\n\n    [Parameter]\n    public bool?[] ArrayOfNullableBoolParamShortForm { get; set; } // Compliant\n\n    [Parameter]\n    public Nullable<bool>[] ArrayOfNullableBoolParamLongForm { get; set; } // Compliant\n\n    [Parameter]\n    public TimeSpan TimeSpan { get; set; } // Compliant\n\n    [Parameter]\n    public TimeSpan? NullableTimeSpan { get; set; } // Compliant\n\n    [Parameter]\n    public Nullable<TimeSpan> NullableTimeSpanLongForm { get; set; } // Compliant\n\n    [Parameter]\n    public TimeSpan[] TimeSpanArrayLongForm { get; set; } // Compliant\n\n    [Parameter]\n    public TimeSpan TimeSpanParam { get; set; } // Compliant\n\n    [Parameter]\n    public TimeSpan? NullableTimeSpanParam { get; set; } // Compliant\n\n    [Parameter]\n    public Nullable<TimeSpan> NullableTimeSpanLongFormParam { get; set; } // Compliant\n\n    [Parameter]\n    public TimeSpan[] TimeSpanArrayLongFormParam { get; set; } // Compliant\n\n    [Parameter]\n    [SupplyParameterFromQuery]\n    public bool Param { get; set; } // Noncompliant {{Component parameters can only receive query parameter values in routable components.}}\n    //          ^^^^^\n\n    [Parameter]\n    [SupplyParameterFromQuery]\n    public string MyString { get; set; } // Noncompliant\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/BlazorQueryParameterRoutableComponent.Noncompliant.cs",
    "content": "﻿using Microsoft.AspNetCore.Components;\nusing System;\n\nnamespace EmptyProject\n{\n    public class Nullable { }\n\n    class BlazorQueryParameterRoutableComponent_Noncompliant : ComponentBase\n    {\n        [Parameter]\n        [SupplyParameterFromQuery]\n        public int Number { get; set; } // Noncompliant {{Component parameters can only receive query parameter values in routable components.}}\n        //         ^^^^^^\n\n        [Parameter]\n        [SupplyParameterFromQuery]\n        public string MyString { get; set; } // Noncompliant\n    }\n\n    [Route(\"/my-route\")]\n    class BlazorQueryParameterRoutableComponent_Noncompliant_S6797 : ComponentBase\n    {\n        [Parameter]\n        [SupplyParameterFromQuery]\n        public Nullable Nullable { get; set; } // Noncompliant {{Query parameter type 'Nullable' is not supported.}}\n    }\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/BlazorQueryParameterRoutableComponent.razor",
    "content": "﻿@namespace EmptyProject\n@page \"/component\"\n\n<h3>Component</h3>\n\n@code {\n    [Parameter]\n    [SupplyParameterFromQuery] // Compliant\n    public bool Param { get; set; }\n\n    [Parameter]\n    public string SupplyParameterFromQueryAttributeMissing { get; set; } // Compliant: missing [SupplyParameterFromQuery]\n\n    [SupplyParameterFromQuery]\n    public string ParameterAttributeMissing { get; set; } // Compliant: missing [Parameter]    \n\n    public string SimpleProperty { get; set; } // Compliant: no parameters    \n\n    [Parameter]\n    [SupplyParameterFromQuery]\n    public bool BoolParam { get; set; } // Compliant\n\n    [Parameter]\n    [SupplyParameterFromQuery]\n    public DateTime DateTimeParam { get; set; } // Compliant\n\n    [Parameter]\n    [SupplyParameterFromQuery]\n    public decimal DecimalParam { get; set; } // Compliant\n\n    [Parameter]\n    [SupplyParameterFromQuery]\n    public double DoubleParam { get; set; } // Compliant\n\n    [Parameter]\n    [SupplyParameterFromQuery]\n    public float FloatParam { get; set; } // Compliant\n\n    [Parameter]\n    [SupplyParameterFromQuery]\n    public Guid GuidParam { get; set; } // Compliant\n\n    [Parameter]\n    [SupplyParameterFromQuery]\n    public int IntParam { get; set; } // Compliant\n\n    [Parameter]\n    [SupplyParameterFromQuery]\n    public long LongParam { get; set; } // Compliant\n\n    [Parameter]\n    [SupplyParameterFromQuery]\n    public string StringParam { get; set; } // Compliant\n\n    [Parameter]\n    [SupplyParameterFromQuery]\n    public bool? NullableBoolParamShortForm { get; set; } // Compliant\n\n    [Parameter]\n    [SupplyParameterFromQuery]\n    public Nullable<bool> NullableBoolParamLongForm { get; set; } // Compliant\n\n    [Parameter]\n    [SupplyParameterFromQuery]\n    public bool?[] ArrayOfNullableBoolParamShortForm { get; set; } // Compliant\n\n    [Parameter]\n    [SupplyParameterFromQuery]\n    public Nullable<bool>[] ArrayOfNullableBoolParamLongForm { get; set; } // Compliant\n\n    [Parameter]\n    public TimeSpan TimeSpanParam { get; set; } // Compliant\n\n    [Parameter]\n    public TimeSpan? NullableTimeSpanParam { get; set; } // Compliant\n\n    [Parameter]\n    public Nullable<TimeSpan> NullableTimeSpanLongFormParam { get; set; } // Compliant\n\n    [Parameter]\n    public TimeSpan[] TimeSpanArrayLongFormParam { get; set; } // Compliant\n\n    [Parameter]\n    [SupplyParameterFromQuery]\n    public TimeSpan TimeSpan { get; set; } // Noncompliant {{Query parameter type 'TimeSpan' is not supported.}}\n    //     ^^^^^^^^\n\n    [Parameter]\n    [SupplyParameterFromQuery]\n    public TimeSpan? NullableTimeSpan { get; set; } // Noncompliant {{Query parameter type 'TimeSpan' is not supported.}}\n    //     ^^^^^^^^^\n\n    [Parameter]\n    [SupplyParameterFromQuery]\n    public IList<TimeSpan> ListTimeSpan { get; set; } // Noncompliant {{Query parameter type 'IList' is not supported.}}\n    //     ^^^^^^^^^^^^^^^\n\n    [Parameter]\n    [SupplyParameterFromQuery]\n    public System.Tuple<bool, bool> SystemTupleForm { get; set; } // Noncompliant {{Query parameter type 'Tuple' is not supported.}}\n    //     ^^^^^^^^^^^^^^^^^^^^^^^^\n\n    [Parameter]\n    [SupplyParameterFromQuery]\n    public System.ValueTuple<bool, bool> ValueTupleForm { get; set; } // Noncompliant {{Query parameter type 'ValueTuple' is not supported.}}\n    //     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n    [Parameter]\n    [SupplyParameterFromQuery]\n    public (bool, bool) TupleForm { get; set; } // Noncompliant {{Query parameter type 'ValueTuple' is not supported.}}\n    //     ^^^^^^^^^^^^\n\n    [Parameter]\n    [SupplyParameterFromQuery]\n    public Nullable<TimeSpan> NullableTimeSpanLongForm { get; set; } // Noncompliant {{Query parameter type 'TimeSpan' is not supported.}}\n    //     ^^^^^^^^^^^^^^^^^^\n\n    [Parameter, SupplyParameterFromQuery]\n    public TimeSpan[] TimeSpanArrayLongForm { get; set; } // Noncompliant {{Query parameter type 'TimeSpan' is not supported.}}\n    //     ^^^^^^^^^^\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/BooleanCheckInverted.Fixed.Batch.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public class BooleanCheckInverted\n    {\n        public void Test()\n        {\n            var a = 2;\n            if (a != 2) // Fixed\n            {\n\n            }\n            bool b = a >= 10;  // Fixed\n            b = a > 10;  // Fixed\n            b = a <= 10;  // Fixed\n            b = a < 10;  // Fixed\n            b = a != 10;  // Fixed\n            b = a == 10;  // Fixed\n\n\n            if (a != 2)\n            {\n            }\n            b = (a >= 10);\n\n            var c = true && (new int[0].Length != 0); // Fixed\n\n            int[] args = { };\n            bool ba = !(args.Length != 0); // Fixed\n\n            SomeFunc(a < 10); // Fixed\n        }\n\n        public void TestNullables()\n        {\n            int? a = 5;\n\n            bool b = !(a < 5); // Compliant\n            b = !(a <= 5); // Compliant\n            b = !(a > 5); // Compliant\n            b = !(a >= 5); // Compliant\n            b = a != 5; // Fixed\n            b = a == 5; // Fixed\n        }\n\n        public void TestNaN(double d, float f)\n        {\n            bool b = !(d < 5);   // Compliant\n            b = !(d <= 5);       // Compliant\n            b = !(d > 5);        // Compliant\n            b = !(d >= 5);       // Compliant\n            b = d != 5;       // Fixed\n            b = d == 5;       // Fixed\n\n            b = !(f < 5);        // Compliant\n            b = f != 5;       // Fixed\n        }\n\n        public static void SomeFunc(bool x) { }\n\n        public static bool operator ==     (BooleanCheckInverted a, BooleanCheckInverted b)\n        {\n            return false;\n        }\n\n        public static bool operator !=(BooleanCheckInverted a, BooleanCheckInverted b)\n        {\n            return !(a==b); // Compliant\n        }\n\n        // Note that this is not the same as \"collection?.Count <= 0\" because when null is compared to a number, the result will always be false\n        public static bool IsNullOrEmpty<T>(IList<T> collection) => !(collection?.Count > 0); // Compliant\n\n        public static bool IsNullOrEmpty1(IList<int> collection) => !(collection?[0] > 0); // Compliant\n\n        public static bool IsNullOrEmpty2<T>(IList<T> collection) => !(0 < collection?.Count); // Compliant\n\n        public static bool IsNullOrEmpty3<T>(IList<T> collection) => !((0) < ((collection?.Count))); // Compliant\n\n        public static bool IsNullOrEmpty4<T>(IList<T> collection) => collection?.Count != 0; // Fixed\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/BooleanCheckInverted.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public class BooleanCheckInverted\n    {\n        public void Test()\n        {\n            var a = 2;\n            if (a != 2) // Fixed\n            {\n\n            }\n            bool b = a >= 10;  // Fixed\n            b = a > 10;  // Fixed\n            b = a <= 10;  // Fixed\n            b = a < 10;  // Fixed\n            b = a != 10;  // Fixed\n            b = a == 10;  // Fixed\n\n\n            if (a != 2)\n            {\n            }\n            b = (a >= 10);\n\n            var c = true && (new int[0].Length != 0); // Fixed\n\n            int[] args = { };\n            bool ba = args.Length == 0; // Fixed\n\n            SomeFunc(a < 10); // Fixed\n        }\n\n        public void TestNullables()\n        {\n            int? a = 5;\n\n            bool b = !(a < 5); // Compliant\n            b = !(a <= 5); // Compliant\n            b = !(a > 5); // Compliant\n            b = !(a >= 5); // Compliant\n            b = a != 5; // Fixed\n            b = a == 5; // Fixed\n        }\n\n        public void TestNaN(double d, float f)\n        {\n            bool b = !(d < 5);   // Compliant\n            b = !(d <= 5);       // Compliant\n            b = !(d > 5);        // Compliant\n            b = !(d >= 5);       // Compliant\n            b = d != 5;       // Fixed\n            b = d == 5;       // Fixed\n\n            b = !(f < 5);        // Compliant\n            b = f != 5;       // Fixed\n        }\n\n        public static void SomeFunc(bool x) { }\n\n        public static bool operator ==     (BooleanCheckInverted a, BooleanCheckInverted b)\n        {\n            return false;\n        }\n\n        public static bool operator !=(BooleanCheckInverted a, BooleanCheckInverted b)\n        {\n            return !(a==b); // Compliant\n        }\n\n        // Note that this is not the same as \"collection?.Count <= 0\" because when null is compared to a number, the result will always be false\n        public static bool IsNullOrEmpty<T>(IList<T> collection) => !(collection?.Count > 0); // Compliant\n\n        public static bool IsNullOrEmpty1(IList<int> collection) => !(collection?[0] > 0); // Compliant\n\n        public static bool IsNullOrEmpty2<T>(IList<T> collection) => !(0 < collection?.Count); // Compliant\n\n        public static bool IsNullOrEmpty3<T>(IList<T> collection) => !((0) < ((collection?.Count))); // Compliant\n\n        public static bool IsNullOrEmpty4<T>(IList<T> collection) => collection?.Count != 0; // Fixed\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/BooleanCheckInverted.Latest.cs",
    "content": "﻿#nullable enable\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Tests.Diagnostics\n{\n    public class BooleanCheckInvertedTests\n    {\n        public void NullableSuppression()\n        {\n            var a = 2;\n            _ = !(a == 2); // Noncompliant {{Use the opposite operator ('!=') instead.}}\n            //  ^^^^^^^^^\n\n            _ = !(a == 2)!; // Compliant FN\n\n            _ = !(a! == 2!); // Noncompliant\n            //  ^^^^^^^^^^^\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/BooleanCheckInverted.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public class BooleanCheckInverted\n    {\n        public void Test()\n        {\n            var a = 2;\n            if (!((a == 2))) // Noncompliant {{Use the opposite operator ('!=') instead.}}\n//              ^^^^^^^^^^^\n            {\n\n            }\n            bool b = !(a < 10);  // Noncompliant\n//                   ^^^^^^^^^\n            b = !(a <= 10);  // Noncompliant\n            b = !(a > 10);  // Noncompliant\n            b = !(a >= 10);  // Noncompliant\n            b = !(a == 10);  // Noncompliant\n            b = !(a != 10);  // Noncompliant\n\n\n            if (a != 2)\n            {\n            }\n            b = (a >= 10);\n\n            var c = true && !(new int[0].Length == 0); // Noncompliant\n\n            int[] args = { };\n            bool ba = !!(args.Length == 0); // Noncompliant\n\n            SomeFunc(!(a >= 10)); // Noncompliant\n        }\n\n        public void TestNullables()\n        {\n            int? a = 5;\n\n            bool b = !(a < 5); // Compliant\n            b = !(a <= 5); // Compliant\n            b = !(a > 5); // Compliant\n            b = !(a >= 5); // Compliant\n            b = !(a == 5); // Noncompliant\n            b = !(a != 5); // Noncompliant\n        }\n\n        public void TestNaN(double d, float f)\n        {\n            bool b = !(d < 5);   // Compliant\n            b = !(d <= 5);       // Compliant\n            b = !(d > 5);        // Compliant\n            b = !(d >= 5);       // Compliant\n            b = !(d == 5);       // Noncompliant\n            b = !(d != 5);       // Noncompliant\n\n            b = !(f < 5);        // Compliant\n            b = !(f == 5);       // Noncompliant\n        }\n\n        public static void SomeFunc(bool x) { }\n\n        public static bool operator ==     (BooleanCheckInverted a, BooleanCheckInverted b)\n        {\n            return false;\n        }\n\n        public static bool operator !=(BooleanCheckInverted a, BooleanCheckInverted b)\n        {\n            return !(a==b); // Compliant\n        }\n\n        // Note that this is not the same as \"collection?.Count <= 0\" because when null is compared to a number, the result will always be false\n        public static bool IsNullOrEmpty<T>(IList<T> collection) => !(collection?.Count > 0); // Compliant\n\n        public static bool IsNullOrEmpty1(IList<int> collection) => !(collection?[0] > 0); // Compliant\n\n        public static bool IsNullOrEmpty2<T>(IList<T> collection) => !(0 < collection?.Count); // Compliant\n\n        public static bool IsNullOrEmpty3<T>(IList<T> collection) => !((0) < ((collection?.Count))); // Compliant\n\n        public static bool IsNullOrEmpty4<T>(IList<T> collection) => !(collection?.Count == 0); // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/BooleanCheckInverted.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\n\nNamespace Tests.Diagnostics\n    Public Class BooleanCheckInverted\n        Public Sub Test()\n            Dim a = 2\n\n            If Not ((a = 2)) Then 'Noncompliant {{Use the opposite operator ('<>') instead.}}\n'              ^^^^^^^^^^^^^\n            End If\n\n            Dim b As Boolean = Not (a < 10) 'Noncompliant\n'                              ^^^^^^^^^^^^\n            b = Not (a <= 10) 'Noncompliant\n            b = Not (a > 10) 'Noncompliant\n            b = Not (a >= 10) 'Noncompliant\n            b = Not (a = 10) 'Noncompliant\n            b = Not (a <> 10) 'Noncompliant\n\n            If a <> 2 Then\n            End If\n\n            b = (a >= 10)\n\n            Dim c = True AndAlso Not (New Integer(-1) {}.Length = 0) 'Noncompliant\n\n            Dim args As Integer() = {}\n            Dim d = Not Not (args.Length = 0) 'Noncompliant\n\n            SomeFunc(Not (a >= 10)) 'Noncompliant\n        End Sub\n\n        Public Sub TestNullables()\n            Dim a As Integer? = 5\n            Dim b As Boolean = Not (a < 5) 'Compliant\n            b = Not (a <= 5) 'Compliant\n            b = Not (a > 5) 'Compliant\n            b = Not (a >= 5) 'Compliant\n            b = Not (a = 5) 'Noncompliant\n            b = Not (a <> 5) 'Noncompliant\n        End Sub\n\n        Public Sub TestNaN(d As Double, f As Single)\n            Dim b As Boolean = Not (d < 5) 'Compliant\n            b = Not (d <= 5) 'Compliant\n            b = Not (d > 5) 'Compliant\n            b = Not (d >= 5) 'Compliant\n            b = Not (d = 5) 'Noncompliant\n            b = Not (d <> 5) 'Noncompliant\n\n            b = Not (f < 5) 'Compliant\n            b = Not (f = 5) 'Noncompliant\n        End Sub\n\n        Public Shared Sub SomeFunc(ByVal x As Boolean)\n        End Sub\n\n        Public Shared Operator =(ByVal a As BooleanCheckInverted, ByVal b As BooleanCheckInverted) As Boolean\n            Return False\n        End Operator\n\n        Public Shared Operator <>(ByVal a As BooleanCheckInverted, ByVal b As BooleanCheckInverted) As Boolean\n            Return Not (a = b) 'Compliant\n        End Operator\n\n        Public Shared Function IsNullOrEmpty(Of T)(ByVal collection As IList(Of T)) As Boolean\n            Return Not (collection?.Count > 0) 'Compliant - not the same as \"collection?.Count <= 0\"\n        End Function\n\n        Public Shared Function IsNullOrEmpty1(ByVal collection As IList(Of Integer)) As Boolean\n            Return Not (collection?(0) > 0) 'Compliant - not the same as \"collection?(0) <= 0\"\n        End Function\n\n        Public Shared Function IsNullOrEmpty2(Of T)(ByVal collection As IList(Of T)) As Boolean\n            Return Not (0 < collection?.Count) 'Compliant - not the same as \"collection?.Count <= 0\"\n        End Function\n\n        Public Shared Function IsNullOrEmpty3(Of T)(ByVal collection As IList(Of T)) As Boolean\n            Return Not (((0)) < ((collection?.Count))) 'Compliant - not the same as \"collection?.Count <= 0\"\n        End Function\n\n        Public Shared Function IsNullOrEmpty4(Of T)(ByVal collection As IList(Of T)) As Boolean\n            Return Not (0 = collection?.Count) 'Noncompliant\n        End Function\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/BooleanLiteralUnnecessary.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Dynamic;\nusing System.Linq;\n\nnamespace Tests.Diagnostics\n{\n    public class BooleanLiteralUnnecessary\n    {\n        public BooleanLiteralUnnecessary(bool a, bool b, bool? c, Item item)\n        {\n            var z = true;   // Fixed\n            z = true;     // Fixed\n            z = false;     // Fixed\n            z = true;      // Fixed\n            z = true;      // Fixed\n            z = false;     // Fixed\n            z = false;      // Fixed\n            z = true;       // Fixed\n            z = false;      // Fixed\n            z = true;       // Fixed\n            z = false;      // Fixed\n            z = true;     // Fixed\n            z = false;      // Fixed\n            z = (false);    // Fixed\n            z = false;       // Fixed\n            z = true;      // Fixed\n            z = false;     // Fixed\n            z = true;      // Fixed\n            z = true;       // Fixed\n            z = false;      // Fixed\n            z = true;     // Fixed\n            z = false;      // Fixed\n\n            var x = false;                  // Fixed\n            x = true;              // Fixed\n            x = true;                     // Fixed\n            x = !a;                    // Fixed\n            x = !a;                    // Fixed\n\n            x = a;                // Fixed\n            x = a;                  // Fixed\n            x = a;                  // Fixed\n            x = a;                 // Fixed\n            x = !a;                  // Fixed\n            x = !a;                 // Fixed\n            x = a;                  // Fixed\n            x = false is a;                 // Error [CS9135]\n            x = true is a;                  // Error [CS9135]\n            x = a;                 // Fixed\n            x = !a;                  // Fixed\n            x = false;             // Fixed\n            x = false;             // Fixed\n            x = Foo();             // Fixed\n            x = Foo();             // Fixed\n            x = Foo();              // Fixed\n            x = Foo();              // Fixed\n            x = true;              // Fixed\n            x = true;              // Fixed\n            x = a == b;             // Fixed\n\n            x = a == Foo(((true)));             // Compliant\n            x = !a;                         // Compliant\n            x = Foo() && Bar();             // Compliant\n\n            var condition = false;\n            var exp = true;\n            var exp2 = true;\n\n            var booleanVariable = condition || exp; // Fixed\n            booleanVariable = !condition && exp; // Fixed\n            booleanVariable = !condition || exp; // Fixed\n            booleanVariable = condition && exp; // Fixed\n            booleanVariable = condition; // Fixed\n            booleanVariable = !condition; // Fixed\n            booleanVariable = condition ? true : true; // Compliant, this triggers another issue S2758\n            booleanVariable = condition ? throw new Exception() : true; // Compliant, we don't raise for throw expressions\n            booleanVariable = condition ? throw new Exception() : false; // Compliant, we don't raise for throw expressions\n\n            booleanVariable = condition ? exp : exp2;\n\n            b = !(x || booleanVariable); // Fixed\n\n            SomeFunc(true); // Fixed\n\n            if (c == true) //Compliant\n            { }\n            if (b) // Fixed\n            { }\n            if (!b) // Fixed\n            { }\n            if (c is true)  // Compliant\n            { }\n            if (c is false) // Compliant\n            { }\n\n            var d = true ? c : false;\n\n            var newItem = new Item\n            {\n                Required = !(item == null) && item.Required // Fixed\n\n            };\n        }\n\n        // https://github.com/SonarSource/sonar-dotnet/issues/2618\n        public void Repro_2618(Item item)\n        {\n            var booleanVariable = item is Item myItem && myItem.Required; // Fixed\n            booleanVariable = !(item is Item myItem2) || myItem2.Required; // Fixed\n        }\n\n        public static void SomeFunc(bool x) { }\n\n        private bool Foo()\n        {\n            return false;\n        }\n\n        private bool Foo(bool a)\n        {\n            return a;\n        }\n\n        private bool Bar()\n        {\n            return false;\n        }\n\n        private void M()\n        {\n            for (int i = 0; ; i++) // Fixed\n            {\n            }\n            for (int i = 0; false; i++)\n            {\n            }\n            for (int i = 0; ; i++)\n            {\n            }\n\n            var b = true;\n            for (int i = 0; b; i++)\n            {\n            }\n        }\n\n        private void IsPattern(bool a, bool c)\n        {\n            const bool b = true;\n            a = a is b;\n            a = (a is b) ? a : b;\n            a = (a is b && c) ? a : b;\n            a = a is b && c;\n\n            if (a is bool d\n                && a is var e)\n            { }\n        }\n\n        // Reproducer for https://github.com/SonarSource/sonar-dotnet/issues/4465\n        private class Repro4465\n        {\n            public int LiteralInTernaryCondition(bool condition, int result)\n            {\n                return condition == false\n                    ? result\n                    : throw new Exception();\n            }\n\n            public bool LiteralInTernaryBranch(bool condition)\n            {\n                return condition\n                    ? throw new Exception()\n                    : true;\n            }\n\n            public void ThrowExpressionIsIgnored(bool condition, int number)\n            {\n                var x = !condition ? throw new Exception() : false;\n                x = number > 0 ? throw new Exception() : false;\n                x = condition && condition ? throw new Exception() : false;\n                x = condition || condition ? throw new Exception() : false;\n                x = condition != true ? throw new Exception() : false;\n                x = condition is true ? throw new Exception() : false;\n            }\n        }\n\n        // https://github.com/SonarSource/sonar-dotnet/issues/7462\n        public void Repro_7462(object obj)\n        {\n            var a = !(obj == null) && (obj.ToString() == \"x\" || obj.ToString() == \"y\"); // Fixed\n        }\n    }\n\n    public class Item\n    {\n        public bool Required { get; set; }\n    }\n\n    public class SocketContainer\n    {\n        private IEnumerable<Socket> sockets;\n        public bool IsValid =>\n            sockets.All(x => x.IsStateValid == true); // Compliant, this failed when we compile with Roslyn 1.x\n    }\n\n    public class Socket\n    {\n        public bool? IsStateValid { get; set; }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/7999\n    class Repro7999CodeFixError\n    {\n        void Method(bool cond)\n        {\n            if (!cond) { }  // Fixed\n            if (cond) { }  // Fixed\n\n            if (cond) { }   // Fixed\n            if (!cond) { }   // Fixed\n\n            if (!cond) { }  // Fixed\n            if (cond) { }  // Fixed\n\n            if (cond) { }   // Fixed\n            if (!cond) { }   // Fixed\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/7792\n    class ObjectIsBool\n    {\n        void Object(object obj, Exception exc)\n        {\n            if (obj is true) { }\n            if (exc.Data[\"SomeKey\"] is true) { }\n        }\n\n        void ConvertibleToBool(IComparable comparable, IComparable<bool> comparableBool, IEquatable<bool> equatable, IConvertible convertible)\n        {\n            if (comparable is true) { }\n            if (comparableBool is true) { }\n            if (equatable is true) { }\n            if (convertible is true) { }\n        }\n    }\n\n    class MaybeBooleans\n    {\n        // https://github.com/SonarSource/sonar-dotnet/issues/8995\n        public void  Dynamic(dynamic bag) // The behavior of a dynamic object can be anything with respect to all kinds of accesses. See ViewBag below for a non-throwing implementation of an DynamicObject\n        {\n            if (bag.Flag) // Fixed\n                                  // if (null == true) can be evaluated at runtime, but\n                                  // if (null) not\n            { }\n        }\n        public void NullableBool(bool? flag)\n        {\n            if (flag == true)  // Compliant\n            { }\n            if (flag == false) // Compliant: bool? == false is not equivalent to !flag (null case differs)\n            { }\n            if (flag != true)  // Compliant: bool? != true is not equivalent to !flag (null case differs)\n            { }\n            if (flag != false) // Compliant: bool? != false is not equivalent to (bool)flag (null case differs)\n            { }\n        }\n\n        // https://github.com/SonarSource/sonar-dotnet/issues/8995\n        public void NullableStruct(YesNo? yesNo)\n        {\n            if (yesNo) // Fixed\n            { }\n        }\n\n        public struct YesNo\n        {\n            public static implicit operator bool(YesNo yesNo) => true;\n        }\n\n        // Mimics the (non-throwing) behavior of\n        // https://github.com/dotnet/aspnetcore/blob/1c8f20be1fc4e97044d7ca93edae3af528bc3521/src/Mvc/Mvc.ViewFeatures/src/DynamicViewData.cs#L13\n        // See https://github.com/SonarSource/sonar-dotnet/issues/8995\n        class ViewBag : DynamicObject\n        {\n            public override bool TryGetMember(GetMemberBinder binder, out object result)\n            {\n                result = null;\n                return true;\n            }\n            public override bool TrySetMember(SetMemberBinder binder, object value) => true;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/BooleanLiteralUnnecessary.Latest.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Tests.Diagnostics\n{\n    // Repro for: https://github.com/SonarSource/sonar-dotnet/issues/5013\n    public class CodeFixProviderRepro\n    {\n        public static bool Foo(string? x, bool y) => !(x == null) && y; // Fixed\n    }\n\n    // Reproducer for https://github.com/SonarSource/sonar-dotnet/issues/4465\n    public class Repro4465\n    {\n        public void Foo(string key)\n        {\n            var x = (key is null) ? throw new ArgumentNullException(nameof(key)) : false;\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/7792\n    class ConvertibleGenericTypes\n    {\n        void ConvertibleToBool<T1, T2, T3>(T1 unconstrained, T2 constrainedToStruct, T3 constrainedToBoolInterface)\n            where T2 : struct\n            where T3 : IComparable<bool>\n        {\n            if (unconstrained is true)\n            { }\n            if (constrainedToStruct is true)\n            { }\n            if (constrainedToBoolInterface is true)\n            { }\n        }\n    }\n\n    // Repro for: https://github.com/SonarSource/sonar-dotnet/issues/5219\n    public class Repro\n    {\n        void Reproducers(bool condition)\n        {\n            bool? v1 = condition ? true : null;\n\n            bool? v2 = condition ? null : true;\n\n            bool? v3 = condition ? true : SomeMethod();\n\n            bool? v4 = condition || SomeMethod2(); // Fixed\n\n            bool? v5 = condition || SomeMethod2();\n        }\n\n        public bool? SomeMethod()\n        {\n            return null;\n        }\n\n        public bool SomeMethod2()\n        {\n            return true;\n        }\n\n        // Reproducer for https://github.com/SonarSource/sonar-dotnet/issues/7688\n        void IsNotPattern(bool a, bool? b)\n        {\n            _ = true;          // Fixed\n            _ = true;          // Fixed\n            _ = false;           // Fixed\n            _ = false;         // Fixed\n            _ = true;     // Fixed\n            _ = false; // Fixed\n\n            _ = !a;     // Fixed\n            _ = !a;     // Fixed\n            _ = a; // Fixed\n\n            if (!a) // Fixed\n            { }\n            if (a) // Fixed\n            { }\n            if (b is not true)  // Compliant\n            { }\n            if (b is not false) // Compliant\n            { }\n            bool? ternary = b == false ? true : null; // Compliant: bool? == false in ternary condition is not equivalent to !b (null case differs)\n            if (a is { } myVar) // Compliant\n            { }\n\n            const bool c = true;\n            a = a is not c;\n            a = (a is not c) ? a : c;\n            a = (a is not c && a) ? a : c;\n            a = a is not c && a;\n\n            var x = a is not true ? throw new Exception() : false;\n        }\n\n        // https://github.com/SonarSource/sonar-dotnet/issues/2618\n        public void Repro_2618(Item item)\n        {\n            var booleanVariable = !(item is not Item myItem) && myItem.Required; // Fixed\n            booleanVariable = item is not Item myItem2 || myItem2.Required; // Fixed\n        }\n    }\n\n    public class Item\n    {\n        public bool Required { get; set; }\n    }\n\n    public class NullableWarningSuppression\n    {\n        public void Test(bool b)\n        {\n            _ = true;   // Fixed\n            _ = true;   // Fixed\n\n            _ = true!;   // Fixed\n            _ = false!;  // Fixed\n            _ = false!; // Fixed\n            _ = false!; // Fixed\n\n            _ = (false)!;   // Fixed\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/BooleanLiteralUnnecessary.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Tests.Diagnostics\n{\n    // Repro for: https://github.com/SonarSource/sonar-dotnet/issues/5013\n    public class CodeFixProviderRepro\n    {\n        public static bool Foo(string? x, bool y) => x == null ? false : y; // Noncompliant\n    }\n\n    // Reproducer for https://github.com/SonarSource/sonar-dotnet/issues/4465\n    public class Repro4465\n    {\n        public void Foo(string key)\n        {\n            var x = (key is null) ? throw new ArgumentNullException(nameof(key)) : false;\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/7792\n    class ConvertibleGenericTypes\n    {\n        void ConvertibleToBool<T1, T2, T3>(T1 unconstrained, T2 constrainedToStruct, T3 constrainedToBoolInterface)\n            where T2 : struct\n            where T3 : IComparable<bool>\n        {\n            if (unconstrained is true)\n            { }\n            if (constrainedToStruct is true)\n            { }\n            if (constrainedToBoolInterface is true)\n            { }\n        }\n    }\n\n    // Repro for: https://github.com/SonarSource/sonar-dotnet/issues/5219\n    public class Repro\n    {\n        void Reproducers(bool condition)\n        {\n            bool? v1 = condition ? true : null;\n\n            bool? v2 = condition ? null : true;\n\n            bool? v3 = condition ? true : SomeMethod();\n\n            bool? v4 = condition ? true : SomeMethod2(); // Noncompliant\n\n            bool? v5 = condition || SomeMethod2();\n        }\n\n        public bool? SomeMethod()\n        {\n            return null;\n        }\n\n        public bool SomeMethod2()\n        {\n            return true;\n        }\n\n        // Reproducer for https://github.com/SonarSource/sonar-dotnet/issues/7688\n        void IsNotPattern(bool a, bool? b)\n        {\n            _ = true is not false;          // Noncompliant {{Remove the unnecessary Boolean literal(s).}}\n            _ = false is not true;          // Noncompliant\n            _ = true is not true;           // Noncompliant\n            _ = false is not false;         // Noncompliant\n            _ = false is not not false;     // Noncompliant\n            _ = false is not not not false; // Noncompliant\n\n            _ = a is (not true);     // Noncompliant\n            _ = a is not (true);     // Noncompliant\n            _ = a is not (not true); // Noncompliant\n\n            if (a is not true) // Noncompliant\n            //    ^^^^^^^^^^^\n            { }\n            if (a is not false) // Noncompliant\n            //    ^^^^^^^^^^^^\n            { }\n            if (b is not true)  // Compliant\n            { }\n            if (b is not false) // Compliant\n            { }\n            bool? ternary = b == false ? true : null; // Compliant: bool? == false in ternary condition is not equivalent to !b (null case differs)\n            if (a is { } myVar) // Compliant\n            { }\n\n            const bool c = true;\n            a = a is not c;\n            a = (a is not c) ? a : c;\n            a = (a is not c && a) ? a : c;\n            a = a is not c && a;\n\n            var x = a is not true ? throw new Exception() : false;\n        }\n\n        // https://github.com/SonarSource/sonar-dotnet/issues/2618\n        public void Repro_2618(Item item)\n        {\n            var booleanVariable = item is not Item myItem ? false : myItem.Required; // Noncompliant\n            booleanVariable = item is not Item myItem2 ? true : myItem2.Required; // Noncompliant\n        }\n    }\n\n    public class Item\n    {\n        public bool Required { get; set; }\n    }\n\n    public class NullableWarningSuppression\n    {\n        public void Test(bool b)\n        {\n            _ = true || true!;   // Noncompliant {{Remove the unnecessary Boolean literal(s).}}\n            _ = true! || true;   // Noncompliant\n\n            _ = true! || true!;   // Noncompliant\n            _ = false! || true!;  // Noncompliant\n            _ = false! && false!; // Noncompliant\n            _ = false! || false!; // Noncompliant\n\n            _ = (false)! || (false!);   // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/BooleanLiteralUnnecessary.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Dynamic;\nusing System.Linq;\n\nnamespace Tests.Diagnostics\n{\n    public class BooleanLiteralUnnecessary\n    {\n        public BooleanLiteralUnnecessary(bool a, bool b, bool? c, Item item)\n        {\n            var z = true || ((true));   // Noncompliant {{Remove the unnecessary Boolean literal(s).}}\n//                       ^^^^^^^^^^^\n            z = (true) || true;     // Noncompliant\n//                     ^^^^^^^\n            z = false || false;     // Noncompliant (also S2589 and S1764)\n            z = true || false;      // Noncompliant\n            z = false || true;      // Noncompliant\n            z = false && false;     // Noncompliant\n            z = false && true;      // Noncompliant\n            z = true && true;       // Noncompliant\n            z = true && false;      // Noncompliant\n            z = true == true;       // Noncompliant\n            z = false == true;      // Noncompliant\n            z = false == false;     // Noncompliant\n            z = true == false;      // Noncompliant\n            z = (true == false);    // Noncompliant\n            z = true != true;       // Noncompliant (also S1764)\n            z = false != true;      // Noncompliant\n            z = false != false;     // Noncompliant\n            z = true != false;      // Noncompliant\n            z = true is true;       // Noncompliant\n            z = false is true;      // Noncompliant\n            z = false is false;     // Noncompliant\n            z = true is false;      // Noncompliant\n\n            var x = !true;                  // Noncompliant\n//                   ^^^^\n            x = true || false;              // Noncompliant\n            x = !false;                     // Noncompliant\n            x = (a == false)                // Noncompliant\n                && true;                    // Noncompliant\n            x = (a is false)                // Noncompliant\n                && true;                    // Noncompliant\n\n            x = a is (true);                // Noncompliant\n            x = a == true;                  // Noncompliant\n            x = a is true;                  // Noncompliant\n            x = a != false;                 // Noncompliant\n            x = a != true;                  // Noncompliant\n            x = false == a;                 // Noncompliant\n            x = true == a;                  // Noncompliant\n            x = false is a;                 // Error [CS9135]\n            x = true is a;                  // Error [CS9135]\n            x = false != a;                 // Noncompliant\n            x = true != a;                  // Noncompliant\n            x = false && Foo();             // Noncompliant\n//                    ^^^^^^^^\n            x = Foo() && false;             // Noncompliant\n//              ^^^^^^^^\n            x = true && Foo();             // Noncompliant\n//              ^^^^^^^\n            x = Foo() && true;             // Noncompliant\n//                    ^^^^^^^\n            x = Foo() || false;              // Noncompliant\n//                    ^^^^^^^^\n            x = false || Foo();              // Noncompliant\n//              ^^^^^^^^\n            x = Foo() || true;              // Noncompliant\n//              ^^^^^^^^\n            x = true || Foo();              // Noncompliant\n//                   ^^^^^^^^\n            x = a == true == b;             // Noncompliant\n\n            x = a == Foo(((true)));             // Compliant\n            x = !a;                         // Compliant\n            x = Foo() && Bar();             // Compliant\n\n            var condition = false;\n            var exp = true;\n            var exp2 = true;\n\n            var booleanVariable = condition ? ((true)) : exp; // Noncompliant\n//                                            ^^^^^^^^\n            booleanVariable = condition ? false : exp; // Noncompliant\n            booleanVariable = condition ? exp : true; // Noncompliant\n            booleanVariable = condition ? exp : false; // Noncompliant\n            booleanVariable = condition ? true : false; // Noncompliant\n            booleanVariable = !condition ? true : false; // Noncompliant\n            booleanVariable = condition ? true : true; // Compliant, this triggers another issue S2758\n            booleanVariable = condition ? throw new Exception() : true; // Compliant, we don't raise for throw expressions\n            booleanVariable = condition ? throw new Exception() : false; // Compliant, we don't raise for throw expressions\n\n            booleanVariable = condition ? exp : exp2;\n\n            b = x || booleanVariable ? false : true; // Noncompliant\n\n            SomeFunc(true || true); // Noncompliant\n\n            if (c == true) //Compliant\n            { }\n            if (b is true) // Noncompliant\n//                ^^^^^^^\n            { }\n            if (b is false) // Noncompliant\n//                ^^^^^^^^\n            { }\n            if (c is true)  // Compliant\n            { }\n            if (c is false) // Compliant\n            { }\n\n            var d = true ? c : false;\n\n            var newItem = new Item\n            {\n                Required = item == null ? false : item.Required // Noncompliant\n//                                        ^^^^^\n            };\n        }\n\n        // https://github.com/SonarSource/sonar-dotnet/issues/2618\n        public void Repro_2618(Item item)\n        {\n            var booleanVariable = item is Item myItem ? myItem.Required : false; // Noncompliant\n            booleanVariable = item is Item myItem2 ? myItem2.Required : true; // Noncompliant\n        }\n\n        public static void SomeFunc(bool x) { }\n\n        private bool Foo()\n        {\n            return false;\n        }\n\n        private bool Foo(bool a)\n        {\n            return a;\n        }\n\n        private bool Bar()\n        {\n            return false;\n        }\n\n        private void M()\n        {\n            for (int i = 0; true; i++) // Noncompliant\n            {\n            }\n            for (int i = 0; false; i++)\n            {\n            }\n            for (int i = 0; ; i++)\n            {\n            }\n\n            var b = true;\n            for (int i = 0; b; i++)\n            {\n            }\n        }\n\n        private void IsPattern(bool a, bool c)\n        {\n            const bool b = true;\n            a = a is b;\n            a = (a is b) ? a : b;\n            a = (a is b && c) ? a : b;\n            a = a is b && c;\n\n            if (a is bool d\n                && a is var e)\n            { }\n        }\n\n        // Reproducer for https://github.com/SonarSource/sonar-dotnet/issues/4465\n        private class Repro4465\n        {\n            public int LiteralInTernaryCondition(bool condition, int result)\n            {\n                return condition == false\n                    ? result\n                    : throw new Exception();\n            }\n\n            public bool LiteralInTernaryBranch(bool condition)\n            {\n                return condition\n                    ? throw new Exception()\n                    : true;\n            }\n\n            public void ThrowExpressionIsIgnored(bool condition, int number)\n            {\n                var x = !condition ? throw new Exception() : false;\n                x = number > 0 ? throw new Exception() : false;\n                x = condition && condition ? throw new Exception() : false;\n                x = condition || condition ? throw new Exception() : false;\n                x = condition != true ? throw new Exception() : false;\n                x = condition is true ? throw new Exception() : false;\n            }\n        }\n\n        // https://github.com/SonarSource/sonar-dotnet/issues/7462\n        public void Repro_7462(object obj)\n        {\n            var a = obj == null ? false : obj.ToString() == \"x\" || obj.ToString() == \"y\"; // Noncompliant\n        }\n    }\n\n    public class Item\n    {\n        public bool Required { get; set; }\n    }\n\n    public class SocketContainer\n    {\n        private IEnumerable<Socket> sockets;\n        public bool IsValid =>\n            sockets.All(x => x.IsStateValid == true); // Compliant, this failed when we compile with Roslyn 1.x\n    }\n\n    public class Socket\n    {\n        public bool? IsStateValid { get; set; }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/7999\n    class Repro7999CodeFixError\n    {\n        void Method(bool cond)\n        {\n            if (cond == false) { }  // Noncompliant\n            if (cond != false) { }  // Noncompliant\n\n            if (cond == true) { }   // Noncompliant\n            if (cond != true) { }   // Noncompliant\n\n            if (false == cond) { }  // Noncompliant\n            if (false != cond) { }  // Noncompliant\n\n            if (true == cond) { }   // Noncompliant\n            if (true != cond) { }   // Noncompliant\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/7792\n    class ObjectIsBool\n    {\n        void Object(object obj, Exception exc)\n        {\n            if (obj is true) { }\n            if (exc.Data[\"SomeKey\"] is true) { }\n        }\n\n        void ConvertibleToBool(IComparable comparable, IComparable<bool> comparableBool, IEquatable<bool> equatable, IConvertible convertible)\n        {\n            if (comparable is true) { }\n            if (comparableBool is true) { }\n            if (equatable is true) { }\n            if (convertible is true) { }\n        }\n    }\n\n    class MaybeBooleans\n    {\n        // https://github.com/SonarSource/sonar-dotnet/issues/8995\n        public void  Dynamic(dynamic bag) // The behavior of a dynamic object can be anything with respect to all kinds of accesses. See ViewBag below for a non-throwing implementation of an DynamicObject\n        {\n            if (bag.Flag == true) // Noncompliant FP: At runtime bag.Flag will return null if a \"ViewBag\" is passed.\n                                  // if (null == true) can be evaluated at runtime, but\n                                  // if (null) not\n            { }\n        }\n        public void NullableBool(bool? flag)\n        {\n            if (flag == true)  // Compliant\n            { }\n            if (flag == false) // Compliant: bool? == false is not equivalent to !flag (null case differs)\n            { }\n            if (flag != true)  // Compliant: bool? != true is not equivalent to !flag (null case differs)\n            { }\n            if (flag != false) // Compliant: bool? != false is not equivalent to (bool)flag (null case differs)\n            { }\n        }\n\n        // https://github.com/SonarSource/sonar-dotnet/issues/8995\n        public void NullableStruct(YesNo? yesNo)\n        {\n            if (yesNo == true) // Noncompliant FP: if (yesNo) does not compile CS0266: Cannot implicitly convert type 'YesNo?' to 'bool'.\n            { }\n        }\n\n        public struct YesNo\n        {\n            public static implicit operator bool(YesNo yesNo) => true;\n        }\n\n        // Mimics the (non-throwing) behavior of\n        // https://github.com/dotnet/aspnetcore/blob/1c8f20be1fc4e97044d7ca93edae3af528bc3521/src/Mvc/Mvc.ViewFeatures/src/DynamicViewData.cs#L13\n        // See https://github.com/SonarSource/sonar-dotnet/issues/8995\n        class ViewBag : DynamicObject\n        {\n            public override bool TryGetMember(GetMemberBinder binder, out object result)\n            {\n                result = null;\n                return true;\n            }\n            public override bool TrySetMember(SetMemberBinder binder, object value) => true;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/BooleanLiteralUnnecessary.vb",
    "content": "﻿Imports System.Collections.Generic\nImports System.Linq\n\nPublic Class BooleanLiteralUnnecessary\n\n  Public Sub New(ByVal a As Boolean, ByVal b As Boolean, ByVal c As Boolean?)\n    Dim condition = False\n    Dim exp = True\n    Dim exp2 = True\n\n    Dim z = True OrElse ((True)) ' Noncompliant (also S1764)\n    z = True Or ((True)) ' Noncompliant (also S1764)\n    z = False OrElse False ' Noncompliant (also S1764)\n    z = False AndAlso False ' Noncompliant (also S1764)\n    z = False And False ' Noncompliant (also S1764)\n    z = True AndAlso True ' Noncompliant (also S1764)\n    z = True And True ' Noncompliant (also S1764)\n    z = True = True ' Noncompliant (also S1764)\n    z = False = False ' Noncompliant (also S1764)\n    z = True <> True ' Noncompliant (also S1764)\n    z = False <> False ' Noncompliant (also S1764)\n    SomeFunc(True OrElse True) ' Noncompliant (also S1764)\n    Dim booleanVariable = If(condition, True, True) ' compliant (also S3923)\n\n    z = True OrElse False ' Noncompliant {{Remove the unnecessary Boolean literal(s).}}\n'            ^^^^^^^^^^^^\n    z = False OrElse True ' Noncompliant\n    z = False Or True ' Noncompliant\n    z = False AndAlso True ' Noncompliant\n    z = False And True ' Noncompliant\n    z = True AndAlso False ' Noncompliant\n    z = False = True ' Noncompliant\n'             ^^^^^^\n    z = True = False ' Noncompliant\n'       ^^^^^^\n    z = False <> True ' Noncompliant\n    z = True <> False ' Noncompliant\n    Dim x = Not True ' Noncompliant\n'               ^^^^\n    x = True OrElse False ' Noncompliant\n    x = Not False ' Noncompliant\n    x = Not True ' Noncompliant\n    x = (Not ((True))) ' Noncompliant\n    x = (a = False) AndAlso True\n'                   ^^^^^^^^^^^^\n'          ^^^^^^^@-1\n    x = a = True ' Noncompliant\n    x = a <> False ' Noncompliant\n    x = a <> True ' Noncompliant\n    x = False = a ' Noncompliant\n'       ^^^^^^^\n    x = True = a ' Noncompliant\n    x = False <> a ' Noncompliant\n'       ^^^^^^^^\n    x = True <> a ' Noncompliant\n'       ^^^^\n    x = False AndAlso Foo() ' Noncompliant\n'             ^^^^^^^^^^^^^\n    x = Foo() AndAlso False ' Noncompliant\n'       ^^^^^^^^^^^^^\n    x = Foo() And False ' Noncompliant\n'       ^^^^^^^^^\n    x = True AndAlso Foo() ' Noncompliant\n'       ^^^^^^^^^^^^\n    x = Foo() AndAlso True ' Noncompliant\n'             ^^^^^^^^^^^^\n    x = Foo() OrElse False ' Noncompliant\n'             ^^^^^^^^^^^^\n    x = Foo() Or False ' Noncompliant\n'             ^^^^^^^^\n    x = False OrElse Foo() ' Noncompliant\n'       ^^^^^^^^^^^^\n    x = Foo() OrElse True ' Noncompliant\n'       ^^^^^^^^^^^^\n    x = True OrElse Foo() ' Noncompliant\n'            ^^^^^^^^^^^^\n    x = a = True = b ' Noncompliant\n'         ^^^^^^\n\n    x = a = Foo2(((True))) ' compliant\n    x = Not a ' compliant\n    x = Foo() AndAlso Bar() ' compliant\n    booleanVariable = If(condition, ((True)), exp) ' Noncompliant\n'                                   ^^^^^^^^\n    booleanVariable = If(condition, False, exp) ' Noncompliant\n    booleanVariable = If(condition, exp, True) ' Noncompliant\n    booleanVariable = If(condition, exp, False) ' Noncompliant\n    booleanVariable = If(condition, True, False) ' Noncompliant\n    booleanVariable = If(condition, exp, exp2) ' ok\n    b = If(x OrElse booleanVariable, False, True) ' Noncompliant\n\n    If c = True Then\n    End If\n\n    Dim d = If(True, c, False)\n  End Sub\n\n  Public Shared Sub SomeFunc(ByVal x As Boolean)\n  End Sub\n\n  Private Function Foo() As Boolean\n    Return False\n  End Function\n\n  Private Function Foo2(ByVal a As Boolean) As Boolean\n    Return a\n  End Function\n\n  Private Function Bar() As Boolean\n    Return False\n  End Function\n\n  Private Sub M()\n    Dim i As Integer = 0\n\n    While True\n      i += 1\n    End While\n\n    i = 0\n\n    While False\n      i += 1\n    End While\n\n    i = 0\n\n    Dim b = True\n    i = 0\n    While b\n      i += 1\n    End While\n  End Sub\n\n  Sub Foo(exp As Boolean)\n    If BooleanMethod() = True Then ' Noncompliant\n'                      ^^^^^^\n    End If\n    If BooleanMethod() = False Then ' Noncompliant\n'                      ^^^^^^^\n    End If\n    If BooleanMethod() OrElse False Then ' Noncompliant\n'                      ^^^^^^^^^^^^\n    End If\n\n    DoSomething(Not False) ' Noncompliant\n    DoSomething(BooleanMethod() = True) ' Noncompliant\n\n    Dim booleanVariable = If(BooleanMethod(), True, False) ' Noncompliant\n'                                             ^^^^^^^^^^^\n    booleanVariable = If(BooleanMethod(), True, exp) ' Noncompliant\n'                                         ^^^^\n    booleanVariable = If(BooleanMethod(), False, exp) ' Noncompliant\n'                                         ^^^^^\n    booleanVariable = If(BooleanMethod(), exp, True) ' Noncompliant\n'                                              ^^^^\n    booleanVariable = If(BooleanMethod(), exp, False) ' Noncompliant\n'                                              ^^^^^\n  End Sub\n\n  Sub Bar(exp As Boolean)\n    If BooleanMethod() Then\n      ' ...\n    End If\n    If Not BooleanMethod() Then\n      ' ...\n    End If\n    If BooleanMethod() Then\n      ' ...\n    End If\n    DoSomething(True)\n    DoSomething(BooleanMethod())\n\n    Dim booleanVariable = BooleanMethod()\n    booleanVariable = BooleanMethod() OrElse exp\n    booleanVariable = Not BooleanMethod() AndAlso exp\n    booleanVariable = Not BooleanMethod() OrElse exp\n    booleanVariable = BooleanMethod() AndAlso exp\n  End Sub\n\n  Sub DoSomething(ByVal foo As Boolean)\n  End Sub\n\n  Function BooleanMethod() As Boolean\n        Return True\n    End Function\n\nEnd Class\n\nPublic Class SocketContainer\n  Private sockets As IEnumerable(Of Socket)\n\n  Public ReadOnly Property IsValid As Boolean\n    Get\n      Return sockets.All(Function(x) x.IsStateValid = True)\n    End Get\n  End Property\n\nEnd Class\n\nPublic Class Socket\n  Public Property IsStateValid As Boolean?\nEnd Class\n\n' Repro for: https://github.com/SonarSource/sonar-dotnet/issues/5219\nPublic Class Repro\n    Private Sub Reproducers(ByVal condition As Boolean)\n        Dim v1 As Boolean? = If(condition, True, Nothing)\n        Dim v2 As Boolean? = If(condition, Nothing, True)\n        Dim v3 As Boolean? = If(condition, True, SomeMethod())\n        Dim v4 As Boolean? = If(condition, True, SomeMethod2()) ' Noncompliant\n        Dim v5 As Boolean? = condition OrElse SomeMethod2()\n    End Sub\n\n    Public Function SomeMethod() As Boolean?\n        Return Nothing\n    End Function\n\n    Public Function SomeMethod2() As Boolean\n        Return True\n    End Function\nEnd Class\n\n' https://github.com/SonarSource/sonar-dotnet/issues/7792\nClass ObjectIsBool\n    Sub Method(obj As Object, exc As Exception)\n        If obj = True Then\n        End If\n        If exc.Data(\"SomeKey\") = True Then\n        End If\n    End Sub\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/BreakOutsideSwitch.cs",
    "content": "﻿using System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public class BreakOutsideSwitch\n    {\n        public BreakOutsideSwitch(int n)\n        {\n            while (true)\n            {\n                if (n == 10)\n                {\n                    break; // Noncompliant {{Refactor the code in order to remove this break statement.}}\n//                  ^^^^^^\n                }\n\n                n++;\n                break; // Noncompliant\n            }\n\n            while (n != 10)\n            {\n                n++;\n            }\n\n            switch (n)\n            {\n                case 0:\n                    break;\n                case 1:\n                    do\n                    {\n                        break; // Noncompliant\n                    }\n                    while (true);\n\n                    break;\n                case 2:\n                    foreach (var (a, b) in new (int, int)[0])\n                    {\n                        break; // Noncompliant\n                    }\n\n                    break;\n            }\n\n            foreach (var e in new List<int>())\n            {\n                break; // Noncompliant\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/BypassingAccessibility.Latest.cs",
    "content": "﻿using System.Reflection;\nusing System;\n\nType dynClass = Type.GetType(\"MyInternalClass\");\nBindingFlags bindingAttr = BindingFlags.NonPublic | BindingFlags.Static;\n//                         ^^^^^^^^^^^^^^^^^^^^^^   {{Make sure that this accessibility bypass is safe here.}}\nMethodInfo dynMethod = dynClass.GetMethod(\"Method\", bindingAttr);\ndynMethod.Invoke(dynClass, null);\n\nvoid Foo()\n{\n    BindingFlags bindingAttr = BindingFlags.NonPublic | BindingFlags.Static; // Noncompliant\n    Type.GetType(\"MyInternalClass\").GetMethod(\"Method\", bindingAttr).Invoke(null, null);\n}\n\npublic record Record\n{\n    private readonly BindingFlags bindingFlags = BindingFlags.NonPublic; // Noncompliant\n    public BindingFlags GetFlags { get; } = BindingFlags.NonPublic; // Noncompliant\n    public BindingFlags GetBindingFlags() => BindingFlags.NonPublic; // Noncompliant\n\n    void Foo()\n    {\n        Type.GetType(\"MyInternalClass\").GetMember(\"mymethod\", BindingFlags.NonPublic); // Noncompliant\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/8153\nnamespace Repro_8153\n{\n    using System.Runtime.CompilerServices;\n    using static System.Runtime.CompilerServices.UnsafeAccessorKind;\n    using UnsafeAccessorAttributeAlias = System.Runtime.CompilerServices.UnsafeAccessorAttribute;\n    using UnsafeAccessorKindAlias = System.Runtime.CompilerServices.UnsafeAccessorKind;\n\n    class ZeroOverheadMemberAccess\n    {\n        [UnsafeAccessor(UnsafeAccessorKind.StaticField, Name = \"aPrivateStaticField\")]        // FN\n        extern static ref string M1(UserData obj);\n\n        [UnsafeAccessor(UnsafeAccessorKind.Field, Name = nameof(UserData.aPublicField))]      // Compliant, the field is public.\n                                                                                              // A new rule is needed for this. See: https://github.com/SonarSource/sonar-dotnet/issues/8258\n        extern static ref string M2(UserData obj);\n\n        [UnsafeAccessorAttribute(UnsafeAccessorKind.Field, Name = \"aProtectedInternalField\")] // FN\n        extern static ref string M3(UserData obj);\n\n        [UnsafeAccessor(UnsafeAccessorKind.Field, Name = \"aProtectedField\")]                  // FN\n        extern static ref string M4(UserData obj);\n\n        [UnsafeAccessor(UnsafeAccessorKindAlias.Field, Name = \"aPrivateProtectedField\")]      // FN\n        extern static ref string M5(UserData obj);\n\n        [UnsafeAccessorAttributeAlias(UnsafeAccessorKind.Field, Name = \"aPrivateField\")]      // FN\n        extern static ref string M6(UserData obj);\n\n        [UnsafeAccessor(UnsafeAccessorKind.Field, Name = \"<APrivateProperty>k__BackingField\")]               // FN\n        extern static ref string M7(UserData obj);\n\n        [UnsafeAccessor(UnsafeAccessorKind.Field, Name = \"<APublicPropertyWithPrivateGet>k__BackingField\")]  // FN\n        extern static ref string M8(UserData obj);\n\n        [UnsafeAccessor(UnsafeAccessorKind.Constructor)] // FN\n        extern static UserData CallPrivateConstructor();\n\n        [UnsafeAccessor(UnsafeAccessorKind.Constructor)] // FN\n        extern static UserData CallDifferentPrivateConstructor(string s);\n\n        [UnsafeAccessor(UnsafeAccessorKind.Constructor)] // FN\n        extern static UserData CallProtectedConstructor(int i);\n\n        class UserData\n        {\n            private static int aPrivateStaticField;\n\n            public int aPublicField;\n            protected internal int aProtectedInternalField;\n            protected int aProtectedField;\n            private protected int aPrivateProtectedField;\n            private int aPrivateField;\n            private int APrivateProperty { get; }\n\n            private UserData() { }\n            private UserData(string s) { }\n            protected UserData(int i) { }\n\n            public int APublicPropertyWithPrivateGet { private get; set; }\n        }\n    }\n}\n\nnamespace StaticUsing\n{\n    using static System.Reflection.BindingFlags;\n\n    public class Test\n    {\n        public void M()\n        {\n            _ = NonPublic | Static; // Noncompliant\n            //  ^^^^^^^^^\n        }\n    }\n}\n\nnamespace Partials\n{\n    public partial class C\n    {\n        public partial BindingFlags Private { get; }\n    }\n\n    public partial class C\n    {\n        public partial BindingFlags Private =>\n            BindingFlags.NonPublic; // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/BypassingAccessibility.cs",
    "content": "﻿using System;\nusing System.Reflection;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        public void Test()\n        {\n            // RSPEC: https://jira.sonarsource.com/browse/RSPEC-3011\n            Type dynClass = Type.GetType(\"MyInternalClass\");\n            // Questionable. Using BindingFlags.NonPublic will return non-public members\n            BindingFlags bindingAttr = BindingFlags.NonPublic | BindingFlags.Static;\n//                                     ^^^^^^^^^^^^^^^^^^^^^^   {{Make sure that this accessibility bypass is safe here.}}\n            MethodInfo dynMethod = dynClass.GetMethod(\"mymethod\", bindingAttr);\n            object result = dynMethod.Invoke(dynClass, null);\n        }\n\n        public BindingFlags AdditionalChecks(System.Type t)\n        {\n            // Using other binding attributes should be ok\n            var bindingAttr = BindingFlags.Static | BindingFlags.CreateInstance | BindingFlags.DeclaredOnly |\n                 BindingFlags.ExactBinding | BindingFlags.GetField | BindingFlags.InvokeMethod; // et cetera...\n            var dynMeth = t.GetMember(\"mymethod\", bindingAttr);\n\n            // We don't detect casts to the forbidden value\n            var nonPublic = (BindingFlags)32;\n            dynMeth = t.GetMember(\"mymethod\", nonPublic);\n\n            Enum.TryParse<BindingFlags>(\"NonPublic\", out nonPublic);\n            dynMeth = t.GetMember(\"mymethod\", nonPublic);\n\n\n\n            bindingAttr = (((BindingFlags.NonPublic)) | BindingFlags.Static);\n//                           ^^^^^^^^^^^^^^^^^^^^^^\n\n            dynMeth = t.GetMember(\"mymethod\", (BindingFlags.NonPublic));\n//                                             ^^^^^^^^^^^^^^^^^^^^^^\n\n            const int val = (int)BindingFlags.NonPublic; // Noncompliant\n            return BindingFlags.NonPublic;  // Noncompliant\n        }\n\n        public const BindingFlags DefaultAccess = BindingFlags.OptionalParamBinding | BindingFlags.NonPublic;\n//                                                                                    ^^^^^^^^^^^^^^^^^^^^^^\n\n        private readonly BindingFlags access1 = BindingFlags.NonPublic;     // Noncompliant\n        public BindingFlags Access2 { get; } = BindingFlags.NonPublic;      // Noncompliant\n        public BindingFlags GetBindingFlags() => BindingFlags.NonPublic;    // Noncompliant\n    }\n\n    public class BindingFlagsImposter\n    {\n        public int NonPublic;\n    }\n\n    public class Derived\n    {\n        [Obsolete(nameof(BindingFlags.NonPublic))] // Compliant\n        public void DoWork(BindingFlagsImposter BindingFlags)\n        {\n            var a = System.Reflection.BindingFlags.NonPublic; // Noncompliant\n        }\n    }\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/BypassingAccessibility.vb",
    "content": "﻿Imports System\nImports System.Reflection\n\nNamespace Tests.TestCases\n    Class Foo\n        Public Sub Test()\n\n            ' RSPEC: https:'jira.sonarsource.com/browse/RSPEC-3011\n            Dim dynClass = Type.GetType(\"MyInternalClass\")\n            'Questionable.Using BindingFlags.NonPublic will return non-public members\n            Dim bindingAttr As BindingFlags = BindingFlags.NonPublic Or BindingFlags.Static\n'                                             ^^^^^^^^^^^^^^^^^^^^^^   {{Make sure that this accessibility bypass is safe here.}}\n\n            Dim dynMethod As MethodInfo = dynClass.GetMethod(\"mymethod\", bindingAttr)\n            Dim result = dynMethod.Invoke(dynClass, Nothing)\n\n        End Sub\n\n        Public Function AdditionalChecks(t As System.Type) As BindingFlags\n\n            ' Using other binding attributes should be ok\n            Dim bindingAttr = BindingFlags.Static Or BindingFlags.CreateInstance Or BindingFlags.DeclaredOnly Or\n                BindingFlags.ExactBinding Or BindingFlags.GetField Or BindingFlags.InvokeMethod ' et cetera...\n            Dim dynMeth = t.GetMember(\"mymethod\", bindingAttr)\n\n            ' We don't detect casts to the forbidden value\n            Dim nonPublic As BindingFlags = DirectCast(32, BindingFlags)\n            nonPublic = CType(32, BindingFlags)\n            dynMeth = t.GetMember(\"mymethod\", bindingAttr)\n\n            System.Enum.TryParse(Of BindingFlags)(\"NonPublic\", nonPublic)\n            dynMeth = t.GetMember(\"mymethod\", bindingAttr)\n\n\n            bindingAttr = (((BindingFlags.NonPublic)) Or BindingFlags.Static)\n'                            ^^^^^^^^^^^^^^^^^^^^^^\n\n            dynMeth = t.GetMember(\"mymethod\", (BindingFlags.NonPublic))\n'                                              ^^^^^^^^^^^^^^^^^^^^^^\n\n            Dim val As Integer = CType(BindingFlags.NonPublic, Integer) ' Noncompliant\n            Return BindingFlags.NonPublic ' Noncompliant\n        End Function\n\n\n        Public ReadOnly DefaultAccess As BindingFlags = BindingFlags.OptionalParamBinding Or BindingFlags.NonPublic\n'                                                                                            ^^^^^^^^^^^^^^^^^^^^^^\n        Private ReadOnly access1 = BindingFlags.NonPublic     ' Noncompliant\n\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CallToAsyncMethodShouldNotBeBlocking.Latest.cs",
    "content": "﻿using System;\nusing System.Threading;\nusing System.Threading.Tasks;\n\npublic interface ISomeInterface\n{\n    static abstract Task<string> StaticVirtualMembersInInterfaces();\n}\n\npublic class SomeClass : ISomeInterface\n{\n    public static Task<string> StaticVirtualMembersInInterfaces()\n    {\n        return Task.Run(() => \"Test\");\n    }\n}\n\npublic class TestClass\n{\n    void Method()\n    {\n        var x = SomeClass.StaticVirtualMembersInInterfaces().Result; // Noncompliant {{Replace this use of 'Task.Result' with 'await'.}}\n        SomeClass.StaticVirtualMembersInInterfaces().GetAwaiter().GetResult(); // Noncompliant\n\n        Task.Run(SomeClass.StaticVirtualMembersInInterfaces).GetAwaiter().GetResult(); // Compliant\n    }\n\n    [Obsolete(nameof(Thread.Sleep))] // Compliant\n    public async Task ExtendedScopeNameOfInAttribute_ThreadSleep()\n    {\n        await Task.Delay(42);\n    }\n\n    [Obsolete(nameof(Task<object>.Result))] // Compliant\n    public async Task ExtendedScopeNameOfInAttribute_TaskResult()\n    {\n        await Task.Delay(42);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CallToAsyncMethodShouldNotBeBlocking.TopLevelStatements.cs",
    "content": "﻿using System;\nusing System.Threading;\nusing System.Threading.Tasks;\n\n// All the calls from top level statements are allowed.\nvar x = GetFooAsync().Result;\nGetFooAsync().Wait();\nGetFooAsync().GetAwaiter().GetResult();\nTask.Delay(0).GetAwaiter().GetResult();\nTask.WaitAny(GetFooAsync());\nTask.WaitAll(GetFooAsync());\nThread.Sleep(10);\n\nTask<int> anotherTask = null;\nvar b = anotherTask.Result;\n\nTask Foo(Task<string> task)\n{\n    Action<Task<string>, object> continuation;\n    return task.ContinueWith(state: null, continuationAction: (Task<string> _, object _) =>\n    {\n        Task<int> anotherTask = null;\n        var b = anotherTask.Result;\n    });\n}\n\nstatic async Task<int> GetFooAsync()\n{\n    await Task.Delay(1000);\n\n    return 42;\n}\n\npublic class Test\n{\n    Task FooInClass(Task<string> task)\n    {\n        Action<Task<string>, object> continuation;\n        return task.ContinueWith(state: null, continuationAction: (Task<string> _, object _) =>\n        {\n            Task<int> anotherTask = null; // Pretend to compute something\n            var b = anotherTask.Result; // Noncompliant, this task is not safe inside ContinueWith\n        });\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CallToAsyncMethodShouldNotBeBlocking.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.Azure.WebJobs;\n\nnamespace Tests.Diagnostics\n{\n    public class Program\n    {\n        private static async Task<int> GetFooAsync()\n        {\n            await Task.Delay(1000);\n\n            return 42;\n        }\n\n        private static Task<string> GetNameAsync()\n        {\n            return Task.Run(() => \"George\");\n        }\n\n        void nop(int i) { }\n\n        public void ResultExamples()\n        {\n            var x = GetFooAsync().Result; // Noncompliant {{Replace this use of 'Task.Result' with 'await'.}}\n//                  ^^^^^^^^^^^^^^^^^^^^\n            GetFooAsync().GetAwaiter().GetResult(); // Noncompliant {{Replace this use of 'Task.GetAwaiter.GetResult' with 'await'.}}\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            Task.Delay(0).GetAwaiter().GetResult(); // Noncompliant\n\n            // Compliant - the following constructions don't cause deadlock\n            nop(Task.Run(GetFooAsync).Result);\n            Task.Run(GetFooAsync).GetAwaiter().GetResult();\n            Task.Factory.StartNew(GetFooAsync).GetAwaiter().GetResult();\n            Task.Factory.StartNew(GetFooAsync).Unwrap().GetAwaiter().GetResult();\n            nop((((Task.Factory.StartNew(GetFooAsync).Unwrap()))).Result);\n\n            // FP - the following cases should be valid\n            var y = GetNameAsync().Result; // Noncompliant\n            GetNameAsync().GetAwaiter().GetResult(); // Noncompliant\n        }\n\n        public void WaitExamples(UnrelatedType unrelated)\n        {\n            GetFooAsync().Wait(); // Noncompliant {{Replace this use of 'Task.Wait' with 'await'.}}\n//          ^^^^^^^^^^^^^^^^^^\n\n            // Compliant - the following constructions don't cause deadlock\n            Task.Run(GetFooAsync).Wait();\n            Task.Factory.StartNew(GetFooAsync).Wait();\n\n            // FP - the following cases should be valid\n            GetNameAsync().Wait(); // Noncompliant\n\n            unrelated.Wait();   // Compliant\n        }\n\n        private void WaitAnyExamples()\n        {\n            Task.WaitAny(GetFooAsync()); // Noncompliant {{Replace this use of 'Task.WaitAny' with 'await Task.WhenAny'.}}\n//          ^^^^^^^^^^^^\n        }\n\n        private void WaitAllExamples()\n        {\n            Task.WaitAll(GetFooAsync()); // Noncompliant {{Replace this use of 'Task.WaitAll' with 'await Task.WhenAll'.}}\n//          ^^^^^^^^^^^^\n        }\n\n        private async Task SleepAsync()\n        {\n            var name = nameof(Thread.Sleep);\n            Thread.Sleep(10); // Noncompliant {{Replace this use of 'Thread.Sleep' with 'await Task.Delay'.}}\n//          ^^^^^^^^^^^^\n        }\n\n        private void SleepVoid()\n        {\n            Thread.Sleep(10); // Compliant - method call is not async\n        }\n\n        private Task SleepTask()\n        {\n            Thread.Sleep(10); // Compliant - method call is not async\n\n            return Task.CompletedTask;\n        }\n\n        public static void Main(string[] args) // All of the calls from Main methods are allowed\n        {\n            var x = GetFooAsync().Result;\n            GetFooAsync().Wait();\n            GetFooAsync().GetAwaiter().GetResult();\n            Task.Delay(0).GetAwaiter().GetResult();\n            Task.WaitAny(GetFooAsync());\n            Task.WaitAll(GetFooAsync());\n            Thread.Sleep(10);\n        }\n\n        public void Run(Task<int> task)\n        {\n            Action<Task<int>> arg = (action) =>\n            {\n                var ret = action.Result; // Noncompliant FP, we do not track actions which are used on ContinueWith\n            };\n\n            task.ContinueWith(arg);\n\n            var safeTask = Task.FromResult(42);\n            var a = safeTask.Result; // Noncompliant FP, we don't track source of the task\n        }\n\n        // See https://github.com/SonarSource/sonar-dotnet/issues/2413\n        public Task<string> Run(Task<string> task)\n        {\n            // Action<Task<T>>\n            var a = task.ContinueWith(completedTask =>\n            {\n                var result = completedTask.Result; // Compliant, task is already completed at this point.\n            });\n\n            // Action<Task<T>, object>\n            var b = task.ContinueWith((completedTask, state) =>\n            {\n                var result = completedTask.Result; // Compliant, task is already completed at this point.\n            }, null);\n\n            // Func<Task<T>, object, TResult>\n            return task.ContinueWith((completedTask, state) =>\n            {\n                return completedTask.Result; // Compliant, task is already completed at this point.\n            }, null);\n        }\n\n        public Task<string> RunParenthesizedLambdaExpression(Task<string> task)\n        {\n            return task.ContinueWith((completedTask) =>\n            {\n                return completedTask.Result; // Compliant, task is already completed at this point.\n            });\n        }\n\n        public Task<string> TaskResultInFunctionCall(Task<string> task)\n        {\n            return task.ContinueWith(completedTask =>\n            {\n                return string.Format(\"Result: {0}\", completedTask.Result); // Compliant, task is already completed at this point.\n            });\n        }\n\n        public Task<string> MultipleTasks(Task<string> task)\n        {\n            return task.ContinueWith(completedTask =>\n            {\n                Task<int> anotherTask = null; // Pretend to compute something\n                var b = anotherTask.Result; // Noncompliant, this task is not safe inside ContinueWith\n\n                return string.Format(\"Result: {0}\", completedTask.Result); // Compliant, task is already completed at this point.\n            });\n        }\n\n        // See https://github.com/SonarSource/sonar-dotnet/issues/2794\n        public override string ToString()\n        {\n            return nameof(Task<object>.Result); // Compliant, nameof() does not execute async code.\n        }\n\n        static async Task AccessAwaited(string[] args)\n        {\n            var getValue1Task = GetValueTask(1);\n            var getValue2Task = GetValueTask(2);\n            var getValue3Task = GetValueTask(3);\n            var getValue4Task = GetValueTask(4);\n\n            await Task.WhenAll(getValue1Task).ConfigureAwait(false);\n            TimeSpan ts = TimeSpan.FromMilliseconds(150);\n            getValue2Task.Wait(ts);             // Noncompliant\n            Task.WaitAll(getValue3Task);        // Noncompliant\n            getValue4Task.RunSynchronously();   // Compliant FN\n\n            var result1 = getValue1Task.Result;  // Compliant, task is already completed at this point.\n            var result2 = getValue2Task.Result;  // Compliant, task is already completed at this point.\n            var result3 = getValue3Task.Result;  // Compliant, task is already completed at this point.\n            var result4 = getValue4Task.Result;  // Compliant, task is already completed at this point.\n        }\n\n        static async Task<int[]> AccessResultInLinq(Task<int>[] tasks)\n        {\n            await Task.WhenAll(tasks);\n            return tasks.Select(t => t.Result).ToArray(); // Noncompliant FP https://github.com/SonarSource/sonar-dotnet/issues/7053\n        }\n\n        static async Task<int> AccessResultInElementAccessor(Task<int>[] tasks)\n        {\n            await Task.WhenAll(tasks);\n            return tasks[0].Result; // Noncompliant FP https://github.com/SonarSource/sonar-dotnet/issues/7053\n        }\n\n        static async Task SubsequentChecksAreNotDisabledByAwait(string[] args)\n        {\n            var getValue1Task = GetValueTask(1);\n\n            await Task.WhenAll(getValue1Task).ConfigureAwait(false);\n            TimeSpan ts = TimeSpan.FromMilliseconds(150);\n            getValue1Task.Wait(ts);             // Noncompliant\n            Task.WaitAll(getValue1Task);        // Noncompliant\n\n            var result1 = getValue1Task.Result;  // Compliant, task is already completed at this point.\n        }\n\n        static async Task AccessAwaitedWaitAllFP(string[] args)\n        {\n            var getValue1Task = GetValueTask(1);\n            var getValue2Task = GetValueTask(2);\n            var getValue3Task = GetValueTask(3);\n            var getValue4Task = GetValueTask(4);\n\n            var tasks = new List<Task<int>>();\n            tasks.Add(getValue1Task);\n            tasks.Add(getValue2Task);\n\n            Task.WaitAll(tasks.ToArray());                             // Noncompliant\n            Task.WaitAll(new[] { getValue3Task, getValue4Task });      // Noncompliant\n\n            var result1 = getValue1Task.Result;                        // Noncompliant FP, task is already completed at this point.\n            var result2 = getValue2Task.Result;                        // Noncompliant FP, task is already completed at this point.\n            var result3 = getValue3Task.Result;                        // Noncompliant FP, task is already completed at this point.\n            var result4 = getValue4Task.Result;                        // Noncompliant FP, task is already completed at this point.\n        }\n\n        static async Task AccessNotAwaited(string[] args)\n        {\n            var getValue1Task = GetValueTask(1);\n            var getValue2Task = GetValueTask(2);\n            var getValue3Task = GetValueTask(3);\n            var getValue4Task = GetValueTask(4);\n            var getValue5Task = GetValueTask(5);\n            var getValue6Task = GetValueTask(6);\n            var getValue7Task = GetValueTask(7);\n            var getValue8Task = GetValueTask(8);\n\n            await Task.WhenAll(getValue1Task).ConfigureAwait(false);\n            // getValue2Task skipped\n\n            TimeSpan ts = TimeSpan.FromMilliseconds(150);\n            getValue3Task.Wait(ts);              // Noncompliant\n            // getValue4Task skipped\n\n            Task.WaitAll(getValue5Task);         // Noncompliant\n            // getValue6Task skipped\n\n            getValue7Task.RunSynchronously();\n            // getValue8Task skipped\n\n            var result1 = getValue1Task.Result;  // Compliant, task is already completed at this point.\n            var result2 = getValue2Task.Result;  // Noncompliant {{Replace this use of 'Task.Result' with 'await'.}}\n//                        ^^^^^^^^^^^^^^^^^^^^\n            var result3 = getValue3Task.Result;  // Compliant, task is already completed at this point.\n            var result4 = getValue4Task.Result;  // Noncompliant {{Replace this use of 'Task.Result' with 'await'.}}\n//                        ^^^^^^^^^^^^^^^^^^^^\n            var result5 = getValue5Task.Result;  // Compliant, task is already completed at this point.\n            var result6 = getValue6Task.Result;  // Noncompliant {{Replace this use of 'Task.Result' with 'await'.}}\n//                        ^^^^^^^^^^^^^^^^^^^^\n            var result7 = getValue7Task.Result;  // Compliant, task is already completed at this point.\n            var result8 = getValue8Task.Result;  // Noncompliant {{Replace this use of 'Task.Result' with 'await'.}}\n//                        ^^^^^^^^^^^^^^^^^^^^\n        }\n\n        static async Task NotAnAwait(string[] args)\n        {\n            var getValue1Task = GetValueTask(1);\n            var getValue2Task = GetValueTask(2);\n            await TaskLike.WhenAll(getValue1Task, getValue2Task);\n            await TaskLike.When(getValue1Task, getValue2Task);\n            var result1 = getValue1Task.Result;  // Noncompliant\n//                        ^^^^^^^^^^^^^^^^^^^^\n            var result2 = getValue2Task.Result;  // Noncompliant\n//                        ^^^^^^^^^^^^^^^^^^^^\n        }\n\n        static async Task NoAwaitAtAll(string[] args)\n        {\n            var getValue1Task = GetValueTask(1);\n            var getValue2Task = GetValueTask(2);\n            Console.Write(\"\");\n            var result1 = getValue1Task.Result;  // Noncompliant\n//                        ^^^^^^^^^^^^^^^^^^^^\n            var result2 = getValue2Task.Result;  // Noncompliant\n//                        ^^^^^^^^^^^^^^^^^^^^\n        }\n\n        static async Task BranchingWhenAll(string[] args, int intValue)\n        {\n            var getValue1Task = GetValueTask(1);\n            var getValue2Task = GetValueTask(2);\n\n            if (intValue == 41)\n            {\n                await TaskLike.WhenAll(getValue1Task, getValue2Task);\n            }\n            else\n            {\n                var result1 = getValue1Task.Result;  // Noncompliant\n//                            ^^^^^^^^^^^^^^^^^^^^\n                var result2 = getValue2Task.Result;  // Noncompliant\n//                            ^^^^^^^^^^^^^^^^^^^^\n            }\n        }\n\n        static async Task TaskFromResultFP(string[] args)\n        {\n            var getValue1Task = Task.FromResult(1);\n            var getValue2Task = Task.FromResult(2);\n            var result1 = getValue1Task.Result;  // Noncompliant FP, since Task.FromResult results completed task\n//                        ^^^^^^^^^^^^^^^^^^^^\n            var result2 = getValue2Task.Result;  // Noncompliant FP, since Task.FromResult results completed task\n//                        ^^^^^^^^^^^^^^^^^^^^\n\n            await Task.WhenAll(getValue1Task, getValue2Task).ConfigureAwait(false);\n        }\n\n        public static Task<int> GetValueTask(int num)\n        {\n            return Task.Run(() => num);\n        }\n\n        public void TaskIsNull(Task<long>[] arr)\n        {\n            Task.WaitAll(arr[0]);   // Noncompliant\n            var x = arr[0].Result;  // Noncompliant FP\n        }\n\n        public class TaskLike\n        {\n            public static Task WhenAll(params Task[] tasks) { return null; }\n            public static Task When(params Task[] tasks) { return null; }\n        }\n\n        [FunctionName(\"Sample\")]\n        public static void S6422_AzureFunction()\n        {\n            var x = GetFooAsync().Result; // Noncompliant {{Replace this use of 'Task.Result' with 'await'. Do not perform blocking operations in Azure Functions.}}\n        }\n    }\n\n    public class UnrelatedType\n    {\n        public void Wait() { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CallerInformationParametersShouldBeLast.Latest.Partial.cs",
    "content": "﻿using System;\nusing System.Runtime.CompilerServices;\n\npublic partial class PartialConstructorCompliantAttributeInImplementation\n{\n    public partial PartialConstructorCompliantAttributeInImplementation(string other, [CallerFilePath] string callerFilePath = \"\") { }\n};\n\npublic partial class PartialConstructorCompliantAttributeInDefinition\n{\n    public partial PartialConstructorCompliantAttributeInDefinition(string other, [CallerFilePath] string callerFilePath = \"\") { }\n};\n\npublic partial class PartialConstructorNonCompliantAttributeInImplementation\n{\n    public partial PartialConstructorNonCompliantAttributeInImplementation([CallerFilePath] string callerFilePath = \"\", string other = \"\") { } // Noncompliant\n};\n\npublic partial class PartialConstructorNonCompliantAttributeInDefinition\n{\n    public partial PartialConstructorNonCompliantAttributeInDefinition(string callerFilePath = \"\", string other = \"\") { }\n};\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CallerInformationParametersShouldBeLast.Latest.cs",
    "content": "﻿using System;\nusing System.Runtime.CompilerServices;\n\nvoid Local1([CallerFilePath] string callerFilePath = \"\") { }\nvoid Local2(string other, [CallerFilePath] string callerFilePath = \"\") { }\nvoid Local3([CallerFilePath] string callerFilePath = \"\", string other = \"\") { } // Noncompliant\n\nclass TestProgram\n{\n    public void OuterMethod() {\n        Local1();\n        Local2(\"\");\n        Local3();\n        Local4(\"\");\n        void Local1([CallerFilePath] string callerFilePath = \"\") { }\n        void Local2(string other, [CallerFilePath] string callerFilePath = \"\") { }\n        void Local3([CallerFilePath] string callerFilePath = \"\", string other = \"\") { } // Noncompliant\n        static void Local4(string first, [CallerFilePath] string callerFilePath = \"\", [CallerLineNumber] int callerLineNumber = 0, string other = \"\") { }\n        //                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        //                                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^@-1\n    }\n}\n\npublic static class Debug\n{\n    public static void AssertCompliant_01(bool condition, [CallerArgumentExpression(\"condition\")] string message = null) { }\n    public static void AssertCompliant_02(bool condition = true, [CallerArgumentExpression(\"condition\")] string message = null) { }\n    public static void AssertNoncompliant([CallerArgumentExpression(\"condition\")] string message = null, bool condition = true) { } // Noncompliant\n}\n\ninterface MyInterface\n{\n    static abstract void Method(string callerFilePath, string other);\n}\n\nclass DerivedClass : MyInterface\n{\n    public static void Method([CallerFilePath] string callerFilePath = \"\", string other = \"\") // Compliant, method from interface\n    {\n    }\n}\n\nclass PrimaryConstructorClassCompliant(string other, [CallerFilePath] string callerFilePath = \"\");\n\nclass PrimaryConstructorClassNoncompliant([CallerFilePath] string callerFilePath = \"\", string other = \"\"); // Noncompliant\n\nrecord PrimaryConstructorRecordNoncompliant([CallerFilePath] string callerFilePath = \"\", string other = \"\"); // Noncompliant\n\nrecord struct PrimaryConstructorRecordStructNoncompliant([CallerFilePath] string callerFilePath = \"\", string other = \"\"); // Noncompliant\n\n\npublic partial class PartialConstructorCompliantAttributeInImplementation\n{\n    public partial PartialConstructorCompliantAttributeInImplementation(string other, string callerFilePath = \"\");\n};\n\npublic partial class PartialConstructorCompliantAttributeInDefinition\n{\n    public partial PartialConstructorCompliantAttributeInDefinition(string other, string callerFilePath = \"\");\n};\n\npublic partial class PartialConstructorNonCompliantAttributeInImplementation\n{\n    public partial PartialConstructorNonCompliantAttributeInImplementation(string callerFilePath = \"\", string other = \"\");\n};\n\npublic partial class PartialConstructorNonCompliantAttributeInDefinition\n{\n    public partial PartialConstructorNonCompliantAttributeInDefinition([CallerFilePath] string callerFilePath = \"\", string other = \"\");       // FN https://sonarsource.atlassian.net/browse/NET-2705\n};\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CallerInformationParametersShouldBeLast.cs",
    "content": "﻿using System;\nusing System.Runtime.CompilerServices;\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        public void Method1(string callerFilePath) { }\n        public void Method2([CallerFilePath]string callerFilePath = \"\") { }\n        public void Method3(string other, [CallerFilePath]string callerFilePath = \"\") { }\n        public void Method4([CallerFilePath]string callerFilePath = \"\", string other = \"\") { } // Noncompliant {{Move 'callerFilePath' to the end of the parameter list.}}\n//                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        public void Method5([CallerFilePath]string callerFilePath = \"\", string other = \"\", [CallerLineNumber]int callerLineNumber = 0) { }\n//                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        public void Method6(string first, [CallerFilePath]string callerFilePath = \"\", [CallerLineNumber]int callerLineNumber = 0, string other = \"\") { }\n//                                                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n//                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @-1\n\n        public void Method7([CallerFilePath]string callerFilePath = \"\",\n//                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            [CallerLineNumber]int callerLineNumber = 0,\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            [CallerMemberName]string callerMemberName = \"\", string other = \"\") { }\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n        public void Method8([CallerMemberName]string callerMemberName = null,\n            [CallerFilePath]string callerFilePath = null, [CallerLineNumber]int callerLineNumber = 0) { }\n\n        public void Method9([System.Runtime.CompilerServices.CallerFilePath] string callerFilePath = \"\", string other = \"\") { } // Noncompliant\n\n        public void Method10([System.Runtime.CompilerServices.CallerFilePathAttribute] string callerFilePath = \"\", string other = \"\") { } // Noncompliant\n\n        public void Method11([CallerFilePathAttribute] string callerFilePath = \"\", string other = \"\") { } // Noncompliant\n\n        public Program([CallerFilePath]string callerFilePath = \"\", string other = \"\") { } // Noncompliant\n        public Program(int other, [CallerFilePath]string callerFilePath = \"\") { }\n\n        public delegate void Del([CallerFilePath] string callerFilePath = \"\", string other = \"\"); // Noncompliant (see also https://github.com/dotnet/csharplang/discussions/7267#discussioncomment-6141445)\n    }\n\n    class BaseClass\n    {\n        public virtual void Method1(string callerFilePath, string other) { }\n    }\n\n    interface MyInterface\n    {\n        void Method2(string callerFilePath, string other);\n    }\n\n    class DerivedClass : BaseClass, MyInterface\n    {\n        public override void Method1([CallerFilePath]string callerFilePath = \"\", string other = \"\") // Compliant, method overriden\n        {\n        }\n\n        public void Method2([CallerFilePath]string callerFilePath = \"\", string other = \"\") // Compliant, method from interface\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CallerInformationParametersShouldBeLastInvalidSyntax.cs",
    "content": "﻿using System;\nusing System.Runtime.CompilerServices;\nnamespace Tests.Diagnostics\n{\n    class InvalidSyntax\n    {\n        public void Method0() {}\n        public void () {}           // Error [CS1519, CS8124, CS1519, CS1519]\n        public void Method1( { }    // Error [CS1026]\n        public void Method2) { }    // Error [CS0670, CS1002, CS1022, CS1513]\n        public void Method3([CallerFilePath]) { }                           // Error [CS0106, CS8107, CS8803, CS8805, CS8107, CS4018, CS1001, CS1031]\n        public void Method4([CallerFilePath],string other) { }              // Error [CS0106, CS8107, CS4018, CS1001, CS1031]\n        public void Method5([CallerFilePath] string, string other) { }      // Error [CS0106, CS8107, CS4021, CS1001]\n        public void Method6([CallerFilePathAttribute string parameter) { }  // Error [CS0106, CS8107, CS1003, CS0246, CS0246, CS1003, CS1001, CS1003, CS1031]\n        // Error@+1 [CS0106, CS0128, CS8107, CS4017, CS8107, CS4021]\n        public void Method6([CallerLineNumber][CallerFilePath]string callerFilePath, string other) { } // Noncompliant\n    }   // Error [CS1022]\n}       // Error [CS1022]\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CastConcreteTypeToInterface.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public interface IMyInterface\n    {\n        void DoStuff();\n    }\n    public interface IMyInterface2\n    {\n    }\n\n    public class MyClass1 : IMyInterface\n    {\n        public int Data { get { return new Random().Next(); } }\n\n        public void DoStuff()\n        {\n            // TODO...\n        }\n    }\n\n    public static class DowncastExampleProgram\n    {\n        static void EntryPoint(IMyInterface interfaceRef)\n        {\n            MyClass1 class1 = (MyClass1)interfaceRef;  // Noncompliant {{Remove this cast and edit the interface to add the missing functionality.}}\n//                            ^^^^^^^^^^^^^^^^^^^^^^\n            int privateData = class1.Data;\n\n            class1 = interfaceRef as MyClass1;  // Noncompliant\n//                   ^^^^^^^^^^^^^^^^^^^^^^^^\n            if (class1 != null)\n            {\n                // ...\n            }\n\n            var interf = (IMyInterface2)interfaceRef;\n            interf = (IMyInterface2)class1;\n            var o = (object)interfaceRef;\n\n            IEnumerable<int> list = null;\n            var l = (List<int>)list; // Compliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CastShouldNotBeDuplicated.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing Person = (string name, string surname);\n\nnamespace Tests.Diagnostics\n{\n    class Fruit { public int Prop; }\n    class FruitList { public List<int> Prop; }\n    class Vegetable { }\n    struct Water { }\n    class Foo { public int x; }\n    class Complex { public object x; }\n\n    class Program\n    {\n        private object someField;\n\n        public void Foo(Object x, Object y)\n        {\n            var fruit = x as Fruit;\n            if (fruit is not Fruit) // Compliant, redundant condition, not related for the current rule\n            {\n            }\n\n            object o;\n            switch (x)                            // Noncompliant [switch-st-0] {{Remove this cast and use the appropriate variable.}}\n            //      ^\n            {\n                case Fruit m:                     // Secondary [switch-st-1]\n            //       ^^^^^^^\n                    o = (Fruit)m;                 // Noncompliant [switch-st-1] {{Remove this redundant cast.}}\n                    break;\n                case Vegetable t when t != null:  // Secondary [switch-st-2]\n                    o = (Vegetable)t;             // Noncompliant [switch-st-2] {{Remove this redundant cast.}}\n                    break;\n                case Water u:\n                    o = (Water)x;                 // Secondary [switch-st-0]\n                    break;\n                default:\n                    o = null;\n                    break;\n            }\n\n            if ((x, y) is (Fruit f1, Vegetable v1))   // Secondary\n            //             ^^^^^^^^\n            {\n                var ff1 = (Fruit)f1;                  // Noncompliant\n                //        ^^^^^^^^^\n            }\n\n            if ((x, y) is (Fruit f2, Vegetable v2))   // Secondary\n            {\n                var ff2 = (Vegetable)v2;              // Noncompliant\n            }\n\n            if ((x, y) is (Fruit f3, Vegetable v3))   // Noncompliant\n            {\n                var ff3 = (Fruit)x;                   // Secondary\n            }\n\n            if ((x, y) is (Fruit f4, Vegetable v4))   // Noncompliant\n            {\n                var ff4 = (Vegetable)y;               // Secondary\n            }\n\n            if ((x,y) is (Fruit f5, Vegetable v5, Vegetable v51)) // Error [CS8502]\n            {\n                var ff5 = (Fruit)x;\n            }\n\n            if (x is Fruit f6)          // Secondary\n            {\n                var ff6 = (Fruit)f6;    // Noncompliant {{Remove this redundant cast.}}\n                var fff6 = (Vegetable)x;\n            }\n\n            if (x is Fruit f7)          // Noncompliant {{Remove this cast and use the appropriate variable.}}\n            {\n                var ff7 = (Fruit)x;     // Secondary\n                var fff7 = (Vegetable)x;\n            }\n\n            if (x is UnknownFruit f8)   // Error [CS0246]\n            {\n                var ff8 = (Fruit)x;\n            }\n\n            if (x is Water f9)\n            {\n                var ff9 = (Fruit)x;\n            }\n\n            x is Fruit f0; // Error [CS0201]\n\n            if (x is not Water)\n            {\n                var xWater = (Water)x;\n            }\n            else if (x is not Fruit)\n            {\n                var xFruit = (Fruit)x;\n            }\n\n            var message = x switch                 // Noncompliant [switch-expression-1] {{Remove this cast and use the appropriate variable.}}\n            {\n                Fruit f10 =>                       // Secondary [switch-expression-2]\n            //  ^^^^^^^^^\n                    ((Fruit)f10).ToString(),       // Noncompliant [switch-expression-2] {{Remove this redundant cast.}}\n            //       ^^^^^^^^^^\n                Vegetable v11 =>                   // Secondary [switch-expression-3]\n                    ((Vegetable)v11).ToString(),   // Noncompliant [switch-expression-3]\n                (string left, string right) =>     // Secondary [switch-expression-4, switch-expression-5]\n                    (string) left + (string) right,// Noncompliant [switch-expression-4]\n                                                   // Noncompliant@-1 [switch-expression-5]\n                Water w12 =>\n                    ((Water)x).ToString(),         // Secondary [switch-expression-1]\n                Complex { x : Fruit apple } => \"apple\",\n                _ => \"More than 10\"\n            };\n\n            if ((x) is (Fruit f12, Vegetable v12))     // Noncompliant\n            {\n                var ff12 = (Vegetable)x;               // Secondary\n            }\n\n            Foo k = null;\n            if (k is { x : 0 })\n            {\n            }\n\n            if (x is (Water f13))                      // Noncompliant\n            {\n                var ff13 = (Water)x;                   // Secondary\n            }\n        }\n\n        public void Bar(object x, object y)\n        {\n            if (x is not Fruit)\n            {\n                var f1 = (Fruit)x; // Compliant - but will throw\n            }\n            else\n            {\n                var f2 = (Fruit)x; // Compliant\n            }\n\n            if (x is Fruit { Prop: 1 } tuttyFrutty)    // Secondary [property-pattern-1]\n                                                       // Noncompliant@-1 [property-pattern-2] {{Remove this cast and use the appropriate variable.}}\n            {\n                var aRealFruit = (Fruit)tuttyFrutty;   // Noncompliant [property-pattern-1] {{Remove this redundant cast.}}\n                var anotherFruit = (Fruit)x;           // Secondary [property-pattern-2]\n            }\n\n            var foo = new Complex();\n            if (foo is {x: Fruit f })                  // Secondary\n            //             ^^^^^^^\n            {\n                var something = (Fruit)f;              // Noncompliant\n                //              ^^^^^^^^\n            }\n\n            if ((x, y) is (1))                                 // Error[CS0029]\n            {\n            }\n\n            if ((x, y) is (R { SomeProperty: { Count: 5 } }))  // Error [CS0246]\n            {\n            }\n        }\n\n        public void FooBar(object x)\n        {\n            if (x is nuint)         // Noncompliant\n            {\n                var res = (nuint)x; // Secondary\n            }\n        }\n\n        public void Baz(object x, object y)\n        {\n            if ((x, y) is ((Fruit a, Fruit b), string v)) // Secondary\n                                                          // Secondary@-1\n                                                          // Secondary@-2\n            {\n                var a1 = (Fruit)a;                        // Noncompliant\n                var b1 = (Fruit)b;                        // Noncompliant\n                var v1 = (string)v;                       // Noncompliant\n            }\n\n            if (x is (Fruit or Vegetable))            // Noncompliant\n            {\n                var fruit = (Fruit)x;                 // Secondary\n            }\n\n            if (x is (Fruit or Vegetable))            // Noncompliant\n            {\n                var vegetable = (Vegetable)x;         // Secondary\n            }\n        }\n\n        public void NonExistingType()\n        {\n            if (x is Fruit f)                       // Error [CS0103]\n                                                    // Secondary@-1\n            {\n                var ff = (Fruit)f;                  // Noncompliant {{Remove this redundant cast.}}\n            }\n        }\n\n        // See https://github.com/SonarSource/sonar-dotnet/issues/2314\n        public void TakeIdentifierIntoAccount(object x)\n        {\n            if (x is Fruit)\n            {\n                Fruit f = new();\n                var c = (Fruit)f;\n            }\n        }\n\n        public void List(Object x, Object y)\n        {\n            if (x is FruitList { Prop.Count: 1 } tuttyFrutty)    // Secondary [property-pattern-4]\n                                                             // Noncompliant@-1 [property-pattern-3] {{Remove this cast and use the appropriate variable.}}\n            {\n                var aRealFruit = (FruitList)tuttyFrutty;         // Noncompliant [property-pattern-4] {{Remove this redundant cast.}}\n                var anotherFruit = (FruitList)x;                 // Secondary [property-pattern-3]\n            }\n        }\n\n    }\n}\n\nclass MyClass\n{\n    void ListPattern()\n    {\n        object[] numbers = { 1, 2, 3 };\n\n        if (numbers is [EmptyFruit fruit, 3, 3])     // Secondary\n//                      ^^^^^^^^^^^^^^^^\n        {\n            var ff1 = (EmptyFruit)fruit;             // Noncompliant\n        }\n\n        if (numbers is [double number, 3, 3])   // Secondary\n        {\n            var ff2 = (double)number;           // Noncompliant\n        }\n\n        if (numbers is [1, 2, 3] anotherNumber)\n        {\n            var ff3 = (object[])anotherNumber;  // FN it will probably require a rule redesign\n        }\n    }\n}\n\nclass EmptyFruit { }\n\nclass SomeClass\n{\n    private object obj;\n\n    public void SwitchStatement(object[] array)\n    {\n        switch (array)\n        {\n            case [EmptyFruit m, 2]: // Secondary\n//                ^^^^^^^^^^^^\n                obj = (EmptyFruit)m; // Noncompliant\n//                    ^^^^^^^^^^^^^\n                break;\n            default:\n                obj = null;\n                break;\n        }\n    }\n\n    public void SwitchExpression(object[] array) =>\n        obj = array switch\n        {\n            [EmptyFruit m, 2, 2] => // Secondary\n//           ^^^^^^^^^^^^\n                (EmptyFruit)m, // Noncompliant\n//              ^^^^^^^^^^^^^\n            _ => null\n        };\n}\n\nclass WithAliasAnyType\n{\n    void ValidCases(Person person)\n    {\n        _ = (Person)person;             // Compliant: not a duplicated cast\n    }\n\n    void InvalidCases(object obj)\n    {\n        if (obj is Person)              // Noncompliant\n        {\n            _ = (Person)obj;            // Secondary\n        }\n\n        if (obj is (string, string))    // FN: (string, string) and Person are equivalent\n        {\n            _ = (Person)obj;\n        }\n\n        if (obj is Person)              // FN: Person and (string, string) are equivalent\n        {\n            _ = ((string, string))obj;\n        }\n\n        if (obj is Person)              // FN: Person and (string ..., string) are equivalent\n        {\n            _ = ((string differentName1, string))obj;\n        }\n\n        if (obj is Person)              // FN: Person and (string, string ...) are equivalent\n        {\n            _ = ((string, string differentName2))obj;\n        }\n\n        if (obj is (string differentName1, string))  // FN: (string ..., string) and Person are equivalent\n        {\n            _ = (Person)obj;\n        }\n\n        if (obj is (string, string differentName2))  // FN: (string, string ...) and Person are equivalent\n        {\n            _ = (Person)obj;\n        }\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/223\nclass Repro_223\n{\n    void NumericTypes(object obj)\n    {\n        if (obj is int)             // Noncompliant\n        {\n            _ = (int)obj;           // Secondary\n        }\n\n        if (obj is double)          // Noncompliant\n        {\n            _ = (double)obj;        // Secondary\n        }\n\n        if (obj is ushort)          // Noncompliant\n        {\n            _ = (ushort)obj;        // Secondary\n        }\n    }\n\n    void NullableValueTypes(object obj)\n    {\n        if (obj is int?)            // Noncompliant\n        {\n            _ = (int?)obj;          // Secondary\n        }\n\n        if (obj is byte?)           // Noncompliant\n        {\n            _ = (byte?)obj;         // Secondary\n        }\n    }\n\n    void UsingLanguageKeywordAndFrameworkName(object obj)\n    {\n        if (obj is Nullable<int>)    // FN\n        {\n            _ = (int?)obj;\n        }\n\n        if (obj is int?)             // FN\n        {\n            _ = (Nullable<int>)obj;\n        }\n\n        if (obj is IntPtr)           // FN\n        {\n            _ = (nint)obj;\n        }\n\n        if (obj is nint)             // FN\n        {\n            _ = (IntPtr)obj;\n        }\n\n        if (obj is System.UIntPtr)   // FN\n        {\n            _ = (nuint)obj;\n        }\n    }\n\n    void Enums(object obj)\n    {\n        if (obj is AnEnum)      // Noncompliant\n        {\n            _ = (AnEnum)obj;    // Secondary\n        }\n\n        if (obj is AnEnum?)     // Noncompliant\n        {\n            _ = (AnEnum?)obj;   // Secondary\n        }\n    }\n\n    void UserDefinedStructs(object obj)\n    {\n        if (obj is AStruct)             // Noncompliant\n        {\n            _ = (AStruct)obj;           // Secondary\n        }\n\n        if (obj is ARecordStruct)       // Noncompliant\n        {\n            _ = (ARecordStruct)obj;     // Secondary\n        }\n\n        if (obj is AReadonlyRefStruct)      // Noncompliant, but irrelevant, because ref structs cannot be casted\n        {                                   // Error@+1 [CS0030] Cannot convert type 'object' to 'Repro_223.AReadonlyRefStruct'\n            _ = (AReadonlyRefStruct)obj;    // Secondary\n        }\n    }\n\n    enum AnEnum { Value1, Value2 }\n    struct AStruct { }\n    record struct ARecordStruct { }\n    readonly ref struct AReadonlyRefStruct { }\n}\n\npublic class FieldKeyword\n{\n    public string NonCompliant\n    {\n        get\n        {\n            if(field is string)       // Noncompliant\n            {\n                return (string)field; // Secondary\n            }\n            else\n            {\n                return (string)field;\n            }\n        }\n        set;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CastShouldNotBeDuplicated.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nclass Fruit\n{\n    public object Property => null;\n}\n\nstruct SomeStruct { }\n\nclass Program\n{\n    private object someField;\n\n    private object LocalProperty => null;\n\n    public void Foo(Object x)\n    {\n        if (x is Fruit)  // Noncompliant {{Replace this type-check-and-cast sequence to use pattern matching.}}\n        {\n            var f1 = (Fruit)x;\n//                   ^^^^^^^^ Secondary\n            var f2 = (Fruit)x;\n//                   ^^^^^^^^ Secondary\n        }\n\n        var f = x as Fruit;\n        if (x != null) // Compliant\n        {\n\n        }\n    }\n\n    public void IgnoreMemberAccess(Fruit arg)\n    {\n        var differentInstance = new Fruit();\n        var f = new Fruit();\n\n        if (arg.Property is Fruit)                  // Compliant, the cast is on a different instance\n        {\n            _ = (Fruit)differentInstance.Property;\n        }\n\n        // https://github.com/SonarSource/sonar-dotnet/issues/9491\n        if (arg.Property is Fruit)                  // Noncompliant\n        {\n            _ = ((Fruit)(arg.Property)).Property;   // Secondary\n        }\n\n        if (arg.Property is Fruit)                  // Noncompliant\n        {\n            _ = ((Fruit)((arg.Property))).Property; // Secondary\n        }\n\n        if (arg.Property is Fruit)                  // Noncompliant\n        {\n            _ = ((Fruit)arg.Property).Property;     // Secondary\n        }\n\n        if (f.Property is Fruit)                    // Compliant, the cast is on a different instance\n        {\n            _ = (Fruit)differentInstance.Property;\n        }\n\n        if (f.Property is Fruit)        // Noncompliant {{Replace this type-check-and-cast sequence to use pattern matching.}}\n        {\n            _ = (Fruit)f.Property;      // Secondary\n        }\n\n        if (LocalProperty is Fruit)     // Noncompliant {{Replace this type-check-and-cast sequence to use pattern matching.}}\n        {\n            _ = (Fruit)LocalProperty;   // Secondary\n        }\n    }\n\n    public void Bar(object x)\n    {\n        if (!(x is Fruit))\n        {\n            var f1 = (Fruit)x; // Compliant - but will throw\n        }\n        else\n        {\n            var f2 = (Fruit)x; // Compliant - FN\n        }\n\n    }\n\n    public void WithStructs(object x)\n    {\n        if (x is int)           // Noncompliant {{Replace this type-check-and-cast sequence to use pattern matching.}}\n        {\n            var res = (int)x;   // Secondary\n        }\n\n        if (x is SomeStruct)            // Noncompliant {{Replace this type-check-and-cast sequence to use pattern matching.}}\n        {\n            var res = (SomeStruct)x;    // Secondary\n        }\n    }\n\n    public void IsFollowedByAs(object x) {\n        if (x is Fruit)         // Noncompliant {{Replace this type-check-and-cast sequence to use pattern matching.}}\n        {\n            _ = x as Fruit;     // Secondary\n        }\n\n        if (x is Fruit)         // Compliant, \"==\" binary operator doesn't raise\n        {\n            _ = x == null;\n        }\n\n\n        if (x is SomeStruct?)       // Noncompliant {{Replace this type-check-and-cast sequence to use pattern matching.}}\n        {\n            _ = x as SomeStruct?;   // Secondary\n        }\n    }\n\n    public void IsFollowedByIs(object x) {\n        if (x is Fruit)         // Noncompliant {{Replace this type-check-and-cast sequence to use pattern matching.}}\n        {\n            _ = x is Fruit;     // Secondary\n        }\n\n\n        if (x is SomeStruct?)       // Noncompliant {{Replace this type-check-and-cast sequence to use pattern matching.}}\n        {\n            _ = x is SomeStruct?;   // Secondary\n        }\n    }\n\n    // See https://github.com/SonarSource/sonar-dotnet/issues/2314\n    public void TakeIdentifierIntoAccount(object x)\n    {\n        if (x is Fruit)\n        {\n            var f = new Fruit();\n            var c = (Fruit)f;\n        }\n\n        if (someField is Fruit) // Noncompliant {{Replace this type-check-and-cast sequence to use pattern matching.}}\n        {\n            var fruit = (Fruit)this.someField;\n//                      ^^^^^^^^^^^^^^^^^^^^^ Secondary\n        }\n\n        if (someField is Fruit) // Noncompliant\n        {\n            var fruit = ((Fruit)(this.someField));\n//                       ^^^^^^^^^^^^^^^^^^^^^^^ Secondary\n        }\n    }\n\n    public void UnknownFoo(object x)\n    {                                   // Error@+1 [CS0246]\n        if (x is UndefinedType)         // Noncompliant\n        {                               // Error@+1 [CS0246]\n            var c = (UndefinedType)x;   // Secondary\n        }\n    }\n}\n\npublic class Bar<T> { }\n\npublic class Foo<T>\n{\n    public void Process(object message)\n    {\n        if (message is Bar<T>/*comment*/)     // Noncompliant {{Replace this type-check-and-cast sequence to use pattern matching.}}\n        {\n            var sub = (Bar<T>/**/) message;   // Secondary\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CastShouldNotBeDuplicated.cshtml",
    "content": "﻿@* the next line is necessary for the razor generator to properly interpret the asp-for attribute *@\n@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers\n@model Base\n\n@if (Model is Derived) // Compliant\n{\n    <div>\n        <input class=\"form-control\" type=\"text\" asp-for=\"@(((Derived)Model).Prop)\" /> @* // Compliant *@\n        <span asp-validation-for=\"@(((Derived)Model).Prop)\" class=\"text-danger\"></span> @* // Compliant *@\n    </div>\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CatchEmpty.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Tests.TestCases\n{\n    class CatchEmpty\n    {\n        public void Test()\n        {\n            try\n            {\n\n            }\n            catch (Exception exc) // Compliant because of the comment\n            {\n                /*some comment here*/\n            }\n\n            try\n            {\n\n            }\n            catch (Exception exc) // Compliant because of the comment\n            {\n                // comment\n            }\n\n            try\n            {\n\n            }\n            catch (ArgumentException)\n            {\n                Console.WriteLine(\"log\");\n            }\n\n            try\n            {\n\n            }\n            catch (ArgumentException)\n            {\n            }\n            catch (Exception) { } //Noncompliant {{Handle the exception or explain in a comment why it can be ignored.}}\n//          ^^^^^^^^^^^^^^^^^^^^^\n\n            try\n            {\n\n            }\n            catch (ArgumentException)\n            {\n            }\n            catch //Noncompliant\n            {\n            }\n\n            try\n            {\n\n            }\n            catch (ArgumentException)\n            {\n            }\n            catch (Exception ex) when (ex is ArgumentException)  // Compliant\n            {\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CatchRethrow.Fixed.cs",
    "content": "﻿using System;\n\nnamespace Tests.TestCases\n{\n    class CatchRethrow\n    {\n        private void doSomething(  ) { throw new NotSupportedException()  ; }\n        public void Test()\n        {\n            var someWronglyFormatted =      45     ;\n            doSomething();\n            doSomething();\n            doSomething();\n\n            try\n            {\n                doSomething();\n            }\n            catch (ArgumentException)\n            {\n                throw;\n            }\n            catch\n            {\n                Console.WriteLine(\"\");\n                throw;\n            }\n\n            try\n            {\n                doSomething();\n            }\n            catch (NotSupportedException)\n            {\n                Console.WriteLine(\"\");\n                throw;\n            }\n\n            try\n            {\n                doSomething();\n            }\n            catch (ArgumentException) when (true)\n            {\n                throw;\n            }\n            catch (NotSupportedException)\n            {\n                Console.WriteLine(\"\");\n                throw;\n            }\n\n            try\n            {\n                doSomething();\n            }\n            finally\n            {\n\n            }\n\n            try\n            {\n                doSomething();\n            }\n            catch (NotImplementedException)\n            {\n                Console.WriteLine(\"\");\n                throw;\n            }\n\n            try\n            {\n                doSomething();\n            }\n            catch (ArgumentNullException)\n            {\n                throw;\n            }\n            catch (NotImplementedException)\n            {\n                Console.WriteLine(\"\");\n                throw;\n            }\n            catch (ArgumentException)\n            {\n                ;\n                throw;\n            }\n        }\n    }\n\n    // Reproducer for https://github.com/SonarSource/sonar-dotnet/issues/8199\n    public class Repro8199\n    {\n        public void SomeMethod() => throw new NotSupportedException();\n        public bool LogException(Exception ex) => false;\n\n        public void CatchWithFilter()\n        {\n            try\n            {\n                SomeMethod();\n            }\n            catch (Exception ex) when (LogException(ex))\n            {\n                throw;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CatchRethrow.cs",
    "content": "﻿using System;\n\nnamespace Tests.TestCases\n{\n    class CatchRethrow\n    {\n        private void doSomething(  ) { throw new NotSupportedException()  ; }\n        public void Test()\n        {\n            var someWronglyFormatted =      45     ;\n\n            try\n            {\n                doSomething();\n            }\n            catch (Exception exc) //Noncompliant\n            {\n                throw;\n            }\n\n            try\n            {\n                doSomething();\n            }\n            catch (ArgumentException) { throw; } //Noncompliant {{Add logic to this catch clause or eliminate it and rethrow the exception automatically.}}\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n            try\n            {\n                doSomething();\n            }\n            catch (ArgumentException) //Noncompliant\n            {\n                throw;\n            }\n            catch (NotSupportedException) //Noncompliant\n            {\n                throw;\n            }\n\n            try\n            {\n                doSomething();\n            }\n            catch (ArgumentException)\n            {\n                throw;\n            }\n            catch\n            {\n                Console.WriteLine(\"\");\n                throw;\n            }\n\n            try\n            {\n                doSomething();\n            }\n            catch (ArgumentException) // Noncompliant\n            {\n                throw;\n            }\n            catch (NotSupportedException)\n            {\n                Console.WriteLine(\"\");\n                throw;\n            }\n\n            try\n            {\n                doSomething();\n            }\n            catch (ArgumentException) when (true)\n            {\n                throw;\n            }\n            catch (NotSupportedException)\n            {\n                Console.WriteLine(\"\");\n                throw;\n            }\n\n            try\n            {\n                doSomething();\n            }\n            catch (NotSupportedException) //Noncompliant\n            {\n                throw;\n            }\n            finally\n            {\n\n            }\n\n            try\n            {\n                doSomething();\n            }\n            catch (ArgumentNullException) //Noncompliant\n            {\n                throw;\n            }\n            catch (NotImplementedException)\n            {\n                Console.WriteLine(\"\");\n                throw;\n            }\n            catch (ArgumentException) //Noncompliant\n            {\n                throw;\n            }\n            catch //Noncompliant\n            {\n                throw;\n            }\n\n            try\n            {\n                doSomething();\n            }\n            catch (ArgumentNullException)\n            {\n                throw;\n            }\n            catch (NotImplementedException)\n            {\n                Console.WriteLine(\"\");\n                throw;\n            }\n            catch (ArgumentException)\n            {\n                ;\n                throw;\n            }\n            catch(SystemException) //Noncompliant\n            {\n                throw;\n            }\n            catch //Noncompliant\n            {\n                throw;\n            }\n        }\n    }\n\n    // Reproducer for https://github.com/SonarSource/sonar-dotnet/issues/8199\n    public class Repro8199\n    {\n        public void SomeMethod() => throw new NotSupportedException();\n        public bool LogException(Exception ex) => false;\n\n        public void CatchWithFilter()\n        {\n            try\n            {\n                SomeMethod();\n            }\n            catch (Exception ex) when (LogException(ex))\n            {\n                throw;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CatchRethrow.vb",
    "content": "﻿Imports System\n\nNamespace Tests.TestCases\n    Class CatchRethrow\n        Private Sub doSomething()\n            Throw New NotSupportedException()\n        End Sub\n\n        Public Sub Test()\n            Dim someWronglyFormatted = 45\n\n            Try\n                doSomething()\n            Catch exc As Exception 'Noncompliant\n                Throw\n            End Try\n\n            Try\n                doSomething()\n            Catch exc As ArgumentException 'Noncompliant\n                Throw\n            End Try\n\n            Try\n                doSomething()\n            Catch exc As ArgumentException 'Noncompliant\n                Throw\n            Catch exc As NotSupportedException 'Noncompliant\n                Throw\n            End Try\n\n            Try\n                doSomething()\n            Catch exc As ArgumentException\n                Throw\n            Catch\n                Console.WriteLine(\"\")\n                Throw\n            End Try\n\n            Try\n                doSomething()\n            Catch exc As ArgumentException 'Noncompliant\n                Throw\n            Catch exc As NotSupportedException\n                Console.WriteLine(\"\")\n                Throw\n            End Try\n\n            Try\n                doSomething()\n            Catch exc As ArgumentException When True\n                Throw\n            Catch exc As NotSupportedException\n                Console.WriteLine(\"\")\n                Throw\n            End Try\n\n            Try\n                doSomething()\n            Catch exc As ArgumentException When True\n                Throw\n            End Try\n\n            Try\n                doSomething()\n            Catch exc As NotSupportedException 'Noncompliant\n                Throw\n            Finally\n            End Try\n\n            Try\n                doSomething()\n            Catch exc As ArgumentNullException 'Noncompliant\n                Throw\n            Catch exc As NotImplementedException\n                Console.WriteLine(\"\")\n                Throw\n            Catch exc As ArgumentException 'Noncompliant\n                Throw\n            Catch 'Noncompliant\n                Throw\n            End Try\n\n            Try\n                doSomething()\n            Catch exc As ArgumentNullException 'Noncompliant\n                Throw\n            Catch exc As NotImplementedException\n                Console.WriteLine(\"\")\n                Throw\n            Catch exc As SystemException 'Noncompliant\n                Throw\n            Catch 'Noncompliant\n                Throw\n            End Try\n        End Sub\n    End Class\n\n    ' Reproducer for https://github.com/SonarSource/sonar-dotnet/issues/8199\n    Public Class Repro8163\n        Public Sub SomeMethod()\n            Throw New NotSupportedException()\n        End Sub\n\n        Public Function LogException(ex As Exception) As Boolean\n            Return False\n        End Function\n\n        Public Sub CatchWithFilter()\n            Try\n                SomeMethod()\n            Catch ex As Exception When LogException(ex)\n                Throw\n            End Try\n        End Sub\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CertificateValidationCheck.Latest.Partial.cs",
    "content": "﻿using System;\nusing System.Net;\nusing System.Net.Security;\nusing System.Security.Cryptography.X509Certificates;\n\n// See https://github.com/SonarSource/sonar-dotnet/issues/4415\npublic partial class PartialClass\n{\n    public static partial RemoteCertificateValidationCallback FindInvalid()\n    {\n        return (sender, certificate, chain, SslPolicyErrors) => true;\n        //                                                      ^^^^ Secondary {{This function trusts all certificates.}}\n    }\n}\n\n// Cross-file static method callback test case\npublic static class CertValidatorCrossFile\n{\n    public static RemoteCertificateValidationCallback GetNoncompliantCallback()\n    {\n        return InvalidValidation;  // Secondary [flow-crossfile] {{This function trusts all certificates.}}\n    }\n\n    public static RemoteCertificateValidationCallback GetCompliantCallback()\n    {\n        return CompliantValidation;\n    }\n\n    private static bool InvalidValidation(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)\n    {\n        return true;  // Secondary [flow-crossfile] {{This function trusts all certificates.}}\n    }\n\n    private static bool CompliantValidation(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)\n    {\n        return sslPolicyErrors == SslPolicyErrors.None;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CertificateValidationCheck.Latest.cs",
    "content": "﻿using System;\nusing System.Net;\nusing System.Net.Security;\nusing System.Security.Cryptography.X509Certificates;\n\ninterface ICertValidation\n{\n    HttpWebRequest CreateRQ()\n    {\n        return (HttpWebRequest) WebRequest.Create(\"http://localhost\");\n    }\n\n    public void InitAsArgument(RemoteCertificateValidationCallback callback)\n    {\n        CreateRQ().ServerCertificateValidationCallback += callback; // Noncompliant\n    }\n\n    static void Execute(ICertValidation certValidation)\n    {\n        certValidation.InitAsArgument((sender, certificate, chain, SslPolicyErrors) => true);\n        //                                                                             ^^^^ Secondary {{This function trusts all certificates.}}\n    }\n}\n\nclass StaticLocalFunctionCase\n{\n    public void Foo()\n    {\n        InitAsArgument((sender, certificate, chain, SslPolicyErrors) => true);  // Secondary\n\n        static HttpWebRequest CreateRQ() => (HttpWebRequest)System.Net.HttpWebRequest.Create(\"http://localhost\");\n\n        static void InitAsArgument(RemoteCertificateValidationCallback callback) =>\n            CreateRQ().ServerCertificateValidationCallback += callback; // Noncompliant\n    }\n}\n\nrecord CertificateValidationChecks\n{\n    void DirectAddHandlers()\n    {\n        CreateRQ().ServerCertificateValidationCallback += (_, _, _, _) => true;\n//                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ {{Enable server certificate validation on this SSL/TLS connection}}\n//                                                                        ^^^^ Secondary@-1 {{This function trusts all certificates.}}\n\n        CreateRQ().ServerCertificateValidationCallback += (sender, _, _, SslPolicyErrors) => false;\n\n        // static\n        //Secondary@+1\n        CreateRQ().ServerCertificateValidationCallback += static (_, _, chain, SslPolicyErrors) => { return true; };    //Noncompliant\n    }\n\n    record InnerAssignmentRecord\n    {\n\n        public void InitAsArgument(RemoteCertificateValidationCallback callback)\n        {\n            CreateRQ().ServerCertificateValidationCallback += callback;  //Noncompliant\n        }\n\n    }\n\n    record NeighbourAssignmentRecord\n    {\n        public void Init(RemoteCertificateValidationCallback callback)\n        {\n            //Assignment from sibling class in nested tree\n            new InnerAssignmentRecord().InitAsArgument((sender, certificate, chain, SslPolicyErrors) => true);  //Secondary\n        }\n    }\n\n    void ConstructorArguments()\n    {\n        OptionalConstructorArguments optA = new(this, cb: InvalidValidation);   // Noncompliant [flow-invalid-1]\n        OptionalConstructorArguments optB = new(this, cb: CompliantValidation);\n\n        using (var ms = new System.IO.MemoryStream())\n        using (System.Net.Security.SslStream ssl = new(ms, true, (sender, chain, certificate, SslPolicyErrors) => true)) // Noncompliant\n                                                                                                                         // Secondary@-1\n        {\n        }\n    }\n\n    record OptionalConstructorArguments\n    {\n        public OptionalConstructorArguments(object owner, int a = 0, int b = 0, RemoteCertificateValidationCallback cb = null)\n        {\n\n        }\n    }\n\n    void DelegateReturnedByFunction()\n    {\n        CreateRQ().ServerCertificateValidationCallback += FindInvalid(false);       //Noncompliant [flow-FindInvalid]\n        CreateRQ().ServerCertificateValidationCallback += FindLambdaValidator();    //Noncompliant [flow-lambda]\n    }\n\n    static RemoteCertificateValidationCallback FindLambdaValidator()\n    {\n        return (_, _, _, _) => true;        //Secondary [flow-lambda]\n    }\n\n    static RemoteCertificateValidationCallback FindInvalid(bool useDelegate)   //All paths return noncompliant\n    {\n        if (useDelegate)\n        {\n            return InvalidValidation;                                  //Secondary [flow-FindInvalid]\n        }\n        else\n        {\n            return (sender, certificate, chain, SslPolicyErrors) => true;   //Secondary [flow-FindInvalid]\n        }\n    }\n\n    void GenericHandlerSignature()\n    {\n        //Generic signature check without RemoteCertificateValidationCallback\n        var ShouldTrigger = new RelatedSignatureType();\n        ShouldTrigger.Callback += InvalidValidation;                                           //Noncompliant [flow-invalid-2]\n        ShouldTrigger.Callback += CompliantValidation;\n\n        var ShouldNotTrigger = new NonrelatedSignatureType();\n        ShouldNotTrigger.Callback += (sender, chain, certificate, SslPolicyErrors) => true;   //Compliant, because signature types are not in expected order for validation\n        ShouldNotTrigger.Callback += (sender, chain, certificate, SslPolicyErrors) => false;\n    }\n\n    void DelegateReturnedByProperty()\n    {\n        CreateRQ().ServerCertificateValidationCallback += DelegateProperty;\n    }\n\n    static RemoteCertificateValidationCallback DelegateProperty\n    {\n        get\n        {\n            return (_, _, _, _) => true;   //False negative\n        }\n    }\n\n    static HttpWebRequest CreateRQ()\n    {\n        return (HttpWebRequest)System.Net.HttpWebRequest.Create(\"http://localhost\");\n    }\n\n    static bool InvalidValidation(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)\n    {\n        return true;    //Secondary [flow-invalid-1, flow-invalid-2, flow-FindInvalid]\n    }\n\n    static bool CompliantValidation(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)\n    {\n        return false; //Compliant\n    }\n}\n\nrecord AssignmentPositionalRecord(string Value)\n{\n    HttpWebRequest CreateRQ()\n    {\n        return (HttpWebRequest)System.Net.HttpWebRequest.Create(Value);\n    }\n\n    public void InitAsArgument(RemoteCertificateValidationCallback callback)\n    {\n        CreateRQ().ServerCertificateValidationCallback += callback;  //Noncompliant\n    }\n\n    static void Execute()\n    {\n        new AssignmentPositionalRecord(\"http://localhost\").InitAsArgument((sender, certificate, chain, SslPolicyErrors) => true);  //Secondary\n    }\n}\n\npublic partial class PartialClass\n{\n    public static partial RemoteCertificateValidationCallback FindInvalid();\n\n    HttpWebRequest CreateRQ()\n    {\n        return (HttpWebRequest)System.Net.HttpWebRequest.Create(\"http://localhost\");\n    }\n\n    public void Init()\n    {\n        CreateRQ().ServerCertificateValidationCallback += FindInvalid();  // Noncompliant\n    }\n\n    static void Execute()\n    {\n        new PartialClass().Init();\n    }\n}\n\npublic class NullConditionalAssignment\n{\n    void GenericHandlerSignature()\n    {\n        var ShouldTrigger = new RelatedSignatureType();\n        ShouldTrigger?.Callback += InvalidValidation;                                          // Noncompliant [flow-invalid-3]\n        ShouldTrigger?.Callback += CompliantValidation;\n\n        var ShouldNotTrigger = new NonrelatedSignatureType();\n        ShouldNotTrigger?.Callback += (sender, chain, certificate, SslPolicyErrors) => true;   // Compliant, because signature types are not in expected order for validation\n        ShouldNotTrigger?.Callback += (sender, chain, certificate, SslPolicyErrors) => false;\n    }\n\n    static bool InvalidValidation(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)\n    {\n        return true;    //Secondary [flow-invalid-3]\n    }\n\n    static bool CompliantValidation(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)\n    {\n        return false; //Compliant\n    }\n}\n\n\nrecord RelatedSignatureType\n{\n    public Func<NonrelatedSignatureType, X509Certificate2, X509Chain, SslPolicyErrors, Boolean> Callback { get; set; }\n}\n\nrecord NonrelatedSignatureType\n{\n    //Parameters are in order, that we do not inspect\n    public Func<NonrelatedSignatureType, X509Chain, X509Certificate2, SslPolicyErrors, Boolean> Callback { get; set; }\n}\n\n// Cross-file static method callback test case\npublic class CrossFileStaticMethodTest\n{\n    public void TestCrossFileCallbacks()\n    {\n        using var ms = new System.IO.MemoryStream();\n        using var sslNoncompliant = new SslStream(ms, false, CertValidatorCrossFile.GetNoncompliantCallback()); // Noncompliant [flow-crossfile]\n        using var sslCompliant = new SslStream(ms, false, CertValidatorCrossFile.GetCompliantCallback());\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CertificateValidationCheck.TopLevelStatements.cs",
    "content": "﻿\nusing System;\nusing System.Net;\nusing System.Net.Security;\nusing System.Security.Cryptography.X509Certificates;\n\nCreateRQ().ServerCertificateValidationCallback += (sender, certificate, chain, SslPolicyErrors) // Noncompliant\n    => { return true; };    // Secondary {{This function trusts all certificates.}}\n\nstatic HttpWebRequest CreateRQ() // static local function\n{\n    return (HttpWebRequest)System.Net.HttpWebRequest.Create(\"http://localhost\");\n}\n\n\n// See https://github.com/SonarSource/sonar-dotnet/issues/4405\nvoid InitAsArgument(RemoteCertificateValidationCallback callback)\n{\n    CreateRQ().ServerCertificateValidationCallback += callback; // Noncompliant\n}\n\nInitAsArgument((sender, certificate, chain, SslPolicyErrors) => true);  // Secondary\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CertificateValidationCheck.cs",
    "content": "﻿\nusing System;\nusing System.Collections.Generic;\nusing System.Net;\nusing System.Net.Http;\nusing System.Net.Security;\nusing System.Security.Cryptography.X509Certificates;\n\nnamespace Tests.Diagnostics\n{\n    class CertificateValidationChecks\n    {\n        void FalseNegatives()\n        {\n            //Values from properties are not inspected at all\n            CreateRQ().ServerCertificateValidationCallback += FalseNegativeValidatorWithProperty;\n            CreateRQ().ServerCertificateValidationCallback += DelegateProperty;\n            //Values from overriden operators are not inspected at all\n            CreateRQ().ServerCertificateValidationCallback += new CertificateValidationChecks() + 42; //Operator + is overriden to return delegate.\n            //Specific cases\n            CreateRQ().ServerCertificateValidationCallback += FalseNegativeException;\n        }\n\n        void DirectAddHandlers()\n        {\n            //Inline version\n            CreateRQ().ServerCertificateValidationCallback += (sender, certificate, chain, SslPolicyErrors) => true;\n            //         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ {{Enable server certificate validation on this SSL/TLS connection}}\n            //                                                                                                 ^^^^ Secondary@-1 {{This function trusts all certificates.}}\n            //Secondary@+1 {{This function trusts all certificates.}}\n            CreateRQ().ServerCertificateValidationCallback += (sender, certificate, chain, SslPolicyErrors) => (((true)));    //Noncompliant\n            CreateRQ().ServerCertificateValidationCallback += (sender, certificate, chain, SslPolicyErrors) => false;\n            CreateRQ().ServerCertificateValidationCallback += (sender, certificate, chain, SslPolicyErrors) => certificate.Subject == \"Test\";\n\n            //Lambda block syntax\n            //Secondary@+1 {{This function trusts all certificates.}}\n            CreateRQ().ServerCertificateValidationCallback += (sender, certificate, chain, SslPolicyErrors) => { return true; };    //Noncompliant\n            CreateRQ().ServerCertificateValidationCallback += (sender, certificate, chain, SslPolicyErrors) =>                      //Noncompliant\n            {\n                return true;    //Secondary {{This function trusts all certificates.}}\n            };\n            CreateRQ().ServerCertificateValidationCallback += (sender, certificate, chain, SslPolicyErrors) =>\n            {\n                return false;\n            };\n\n            //With variable\n            var rq = CreateRQ();\n            rq.ServerCertificateValidationCallback += InvalidValidation;            //Noncompliant [flow2]\n\n            //Without variable\n            CreateRQ().ServerCertificateValidationCallback += InvalidValidation;    //Noncompliant [flow3]\n\n            //Assignment syntax = instead of +=\n            CreateRQ().ServerCertificateValidationCallback = InvalidValidation;    //Noncompliant  [flow4]\n            CreateRQ().ServerCertificateValidationCallback = (sender, certificate, chain, SslPolicyErrors) => { return true; };    //Noncompliant\n                                                                                                                                   //Secondary@-1 {{This function trusts all certificates.}}\n            CreateRQ().ServerCertificateValidationCallback += LocalFunction; // FN\n            bool LocalFunction(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) => true;\n\n            //Do not test this one. It's .NET Standard 2.1 target only. It should work since we're hunting RemoteCertificateValidationCallback and method signature\n            //var ws = new System.Net.WebSockets.ClientWebSocket();\n            //ws.Options.RemoteCertificateValidationCallback += InvalidValidation;\n\n            //Do not test this one. It's .NET Standard 2.1 target only. It should work since we're hunting RemoteCertificateValidationCallback and method signature\n            //var sslOpts = new System.Net.Security.SslClientAuthentication();\n            //Security.SslClientAuthenticationOptions.RemoteCertificateValidationCallback;\n        }\n\n        void MultipleHandlers()\n        {\n            ServicePointManager.ServerCertificateValidationCallback += CompliantValidation;\n            ServicePointManager.ServerCertificateValidationCallback += CompliantValidationPositiveA;\n            ServicePointManager.ServerCertificateValidationCallback += InvalidValidation;                          //Noncompliant [flow5]\n            ServicePointManager.ServerCertificateValidationCallback += CompliantValidationPositiveB;\n            ServicePointManager.ServerCertificateValidationCallback += CompliantValidationNegative;\n            ServicePointManager.ServerCertificateValidationCallback += AdvInvalidTry;                              //Noncompliant [flow6]\n            ServicePointManager.ServerCertificateValidationCallback += AdvInvalidWithTryObstacles;                 //Noncompliant [flow7]\n            ServicePointManager.ServerCertificateValidationCallback += AdvCompliantWithTryObstacles;\n            ServicePointManager.ServerCertificateValidationCallback += AdvInvalidWithObstacles;                    //Noncompliant [flow8]\n            ServicePointManager.ServerCertificateValidationCallback += AdvCompliantWithObstacles;\n            ServicePointManager.ServerCertificateValidationCallback += AdvCompliantWithException;\n            ServicePointManager.ServerCertificateValidationCallback += AdvCompliantWithExceptionAndRethrow;\n        }\n\n        void GenericHandlerSignature()\n        {\n            var httpHandler = new HttpClientHandler();          //This is not RemoteCertificateValidationCallback delegate type, but Func<...>\n            httpHandler.ServerCertificateCustomValidationCallback += InvalidValidation;            //Noncompliant [flow9]\n            httpHandler.ServerCertificateCustomValidationCallback += HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;    // Noncompliant [flow19]\n                                                                                                                                        // Secondary@-1 [flow19] {{This function trusts all certificates.}}\n\n            //Generic signature check without RemoteCertificateValidationCallback\n            var ShouldTrigger = new RelatedSignatureType();\n            ShouldTrigger.Callback += InvalidValidation;                                           //Noncompliant [flow10]\n            ShouldTrigger.Callback += CompliantValidation;\n\n            var ShouldNotTrigger = new NonrelatedSignatureType();\n            ShouldNotTrigger.Callback += (sender, chain, certificate, SslPolicyErrors) => true;   //Compliant, because signature types are not in expected order for validation\n            ShouldNotTrigger.Callback += (sender, chain, certificate, SslPolicyErrors) => false;\n        }\n\n        void PassedAsArgument()\n        {\n            RemoteCertificateValidationCallback SingleAssignmentCB, FalseNegativeCB, CompliantCB, DeclarationAssignmentCompliantCB = null;\n            if (true)\n            {\n                //If there's only one Assignment, we will inspect it\n                //Secondary@+1 [flow0] {{This function trusts all certificates.}}\n                SingleAssignmentCB = InvalidValidationAsArgument;                   //Secondary [flow1] {{This function trusts all certificates.}}\n                FalseNegativeCB = InvalidValidation;                                //Compliant due to false negative, the second assignment is after usage of the variable\n                CompliantCB = InvalidValidation;                                    //Compliant due to further logic and more assingments\n            }\n            if (true) //Environment.ComputerName, Environment.CommandLine, Debugger.IsAttached, Config.TestEnvironment\n            {\n                CompliantCB = null;                                                 //Compliant, there are more assignments, so there is a logic\n                DeclarationAssignmentCompliantCB = InvalidValidation;               //This is compliant due to the more assignments, first one is in variable initialization\n            }\n            //Secondary@+1 [flow0] {{This function trusts all certificates.}}\n            InitAsArgument(SingleAssignmentCB);                                     //Secondary [flow1] {{This function trusts all certificates.}}\n            InitAsArgument(FalseNegativeCB);\n            InitAsArgument(CompliantCB);\n            InitAsArgument(DeclarationAssignmentCompliantCB);\n            FalseNegativeCB = null;                                                 //False negative due to more assignments, but this one is after variable usage.\n\n            InitAsArgument(InvalidValidationAsArgument);                            //Secondary [flow0, flow1] {{This function trusts all certificates.}}\n            InitAsArgument((sender, certificate, chain, SslPolicyErrors) => false);\n            InitAsArgument((sender, certificate, chain, SslPolicyErrors) => true);  //Secondary [flow0, flow1] {{This function trusts all certificates.}}\n\n            InitAsArgumentRecursive(InvalidValidation, 1);                          //Secondary [flow17] {{This function trusts all certificates.}}\n            InitAsOptionalArgument();\n\n            //Call in nested class from root (this)\n            new InnerAssignmentClass().InitAsArgument((sender, certificate, chain, SslPolicyErrors) => true);  // Secondary {{This function trusts all certificates.}}\n        }\n\n        void DelegateReturnedByFunction(HttpClientHandler httpHandler)\n        {\n            CreateRQ().ServerCertificateValidationCallback += FindInvalid(false);       //Noncompliant [flow11]\n            CreateRQ().ServerCertificateValidationCallback += FindInvalid();            //Noncompliant [flow12]\n            CreateRQ().ServerCertificateValidationCallback += FindLambdaValidator();    //Noncompliant [flow13]\n            CreateRQ().ServerCertificateValidationCallback += FindCompliant(true);\n            CreateRQ().ServerCertificateValidationCallback += FindCompliantRecursive(3);\n            CreateRQ().ServerCertificateValidationCallback += FindInvalidRecursive(3);  //Noncompliant [flow14]\n\n            httpHandler.ServerCertificateCustomValidationCallback += FindDangerous();   //Noncompliant [flow20]\n        }\n\n        void ConstructorArguments()\n        {\n            var optA = new OptionalConstructorArguments(this, cb: InvalidValidation);   //Noncompliant [flow15]\n            var optB = new OptionalConstructorArguments(this, cb: CompliantValidation);\n\n            using (var ms = new System.IO.MemoryStream())\n            {\n                using (var ssl = new System.Net.Security.SslStream(ms, true, (sender, chain, certificate, SslPolicyErrors) => true))\n                //                                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ {{Enable server certificate validation on this SSL/TLS connection}}\n                //                                                                                                            ^^^^ Secondary@-1 {{This function trusts all certificates.}}\n                {\n                }\n                using (var ssl = new System.Net.Security.SslStream(ms, true, InvalidValidation))   //Noncompliant [flow16]\n                {\n                }\n                using (var ssl = new System.Net.Security.SslStream(ms, true, CompliantValidation))\n                {\n                }\n            }\n        }\n\n        #region Helpers\n\n        void InitAsArgument(RemoteCertificateValidationCallback Callback)   //This double-assigment will fire the seconday for each occurence twice\n        {\n            var cb = Callback;                                              //Secondary [flow1] {{This function trusts all certificates.}}\n            CreateRQ().ServerCertificateValidationCallback += Callback;     //Noncompliant [flow0]\n            CreateRQ().ServerCertificateValidationCallback += cb;           //Noncompliant [flow1]\n        }\n\n        void InitAsOptionalArgument(RemoteCertificateValidationCallback Callback = null)\n        {\n            CreateRQ().ServerCertificateValidationCallback += Callback;     //Compliant, it is called without argument\n        }\n\n        void InitAsArgumentRecursive(RemoteCertificateValidationCallback Callback, int cnt)\n        {\n            if (cnt == 0)\n                CreateRQ().ServerCertificateValidationCallback += Callback;     //Noncompliant [flow17]\n            else\n                InitAsArgumentRecursive(Callback, cnt - 1);\n        }\n\n        void InitAsArgumentRecursiveNoInvocation(RemoteCertificateValidationCallback Callback, int cnt)\n        {\n            if (cnt == 0)\n            {\n                CreateRQ().ServerCertificateValidationCallback += Callback;     //Compliant, no one is invoking this\n            }\n            else\n            {\n                InitAsArgumentRecursiveNoInvocation(Callback, cnt - 1);\n            }\n        }\n\n        static HttpWebRequest CreateRQ()\n        {\n            return (HttpWebRequest)System.Net.HttpWebRequest.Create(\"http://localhost\");\n        }\n\n        bool IsValid(X509Certificate crt)\n        {\n            return crt.Subject == \"Test\";   //We do not inspect inner logic, yet\n        }\n\n        void Log(X509Certificate crt)\n        {\n            //Pretend to do some logging\n        }\n\n        #endregion\n\n        #region Basic Validators\n\n        static bool InvalidValidation(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)\n        {\n            return true;    //Secondary [flow2, flow3, flow4, flow5, flow9, flow10, flow11, flow12, flow14, flow15, flow16, flow17] {{This function trusts all certificates.}}\n        }\n\n        bool InvalidValidationAsArgument(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)\n        {\n            return true;    //Secondary [flow0, flow0, flow1, flow1] {{This function trusts all certificates.}}\n        }\n\n        static bool CompliantValidation(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)\n        {\n            return false; //Compliant\n        }\n\n        bool CompliantValidationPositiveA(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)\n        {\n            if (certificate.Subject == \"Test\")\n            {\n                return true;    //Compliant, checks were done\n            }\n            else\n            {\n                return false;\n            }\n        }\n\n\n        bool CompliantValidationPositiveB(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)\n        {\n            return certificate.Subject == \"Test\";\n        }\n\n        bool CompliantValidationNegative(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)\n        {\n            if (certificate.Subject != \"Test\")\n            {\n                return false;\n            }\n            else if (DateTime.Parse(certificate.GetExpirationDateString()) < DateTime.Now)\n            {\n                return false;\n            }\n            else\n            {\n                return true;\n            }\n        }\n\n        #endregion\n\n        #region Advanced Validators\n\n        bool AdvInvalidTry(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)\n        {\n            try\n            {\n                System.Diagnostics.Trace.WriteLine(certificate.Subject);\n                return true; //Secondary [flow6] {{This function trusts all certificates.}}\n            }\n            catch (Exception ex)\n            {\n                System.Diagnostics.Trace.WriteLine(ex.Message);\n                return true; //Secondary [flow6] {{This function trusts all certificates.}}\n            }\n        }\n\n        bool AdvInvalidWithTryObstacles(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)\n        {\n            try\n            {\n                Console.WriteLine(\"Log something\");\n                System.Diagnostics.Trace.WriteLine(\"Log something\");\n                Log(certificate);\n\n                return true; //Secondary [flow7] {{This function trusts all certificates.}}\n            }\n            catch (Exception ex)\n            {\n                System.Diagnostics.Trace.WriteLine(ex.Message);\n            }\n            return true; //Secondary [flow7] {{This function trusts all certificates.}}\n        }\n\n        bool AdvCompliantWithTryObstacles(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)\n        {\n            try\n            {\n                Console.WriteLine(\"Log something\");\n                System.Diagnostics.Trace.WriteLine(\"Log something\");\n                Log(certificate);\n\n                return true; //Compliant, since Log(certificate) can also do some validation and throw exception resulting in return false. It's bad practice, but compliant.\n            }\n            catch (Exception ex)\n            {\n                System.Diagnostics.Trace.WriteLine(ex.Message);\n            }\n            return false;\n        }\n\n        bool AdvInvalidWithObstacles(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)\n        {\n            Console.WriteLine(\"Log something\");\n            System.Diagnostics.Trace.WriteLine(\"Log something\");\n            Log(certificate);\n\n            return true; //Secondary [flow8] {{This function trusts all certificates.}}\n        }\n\n        bool AdvCompliantWithObstacles(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)\n        {\n            Console.WriteLine(\"Log something\");\n            System.Diagnostics.Trace.WriteLine(\"Log something\");\n            Log(certificate);\n            return IsValid(certificate);\n        }\n\n        bool AdvCompliantWithException(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)\n        {\n            if (certificate.Subject != \"test\")\n            {\n                throw new InvalidOperationException(\"You shall not pass!\");\n            }\n            return true;    //Compliant, uncaught exception is thrown above\n        }\n\n        bool AdvCompliantWithExceptionAndRethrow(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)\n        {\n            try\n            {\n                if (certificate.Subject != \"test\")\n                {\n                    throw new InvalidOperationException(\"You shall not pass!\");\n                }\n                return true;    //Compliant due to throw logic\n            }\n            catch\n            {\n                //Log\n                throw;\n            }\n            return true;        //Compliant due to throw logic\n        }\n\n        #endregion\n\n        #region Find Validators\n\n        static RemoteCertificateValidationCallback FindInvalid()\n        {\n            return InvalidValidation;                                      //Secondary [flow12] {{This function trusts all certificates.}}\n        }\n\n        static RemoteCertificateValidationCallback FindLambdaValidator()\n        {\n            return (sender, certificate, chain, SslPolicyErrors) => true;        //Secondary [flow13] {{This function trusts all certificates.}}\n        }\n\n        static Func<HttpRequestMessage, X509Certificate2, X509Chain, SslPolicyErrors, Boolean> FindDangerous()\n        {\n            return HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;        //Secondary [flow20] {{This function trusts all certificates.}}\n        }\n\n        static RemoteCertificateValidationCallback FindInvalid(bool useDelegate)   //All paths return noncompliant\n        {\n            if (useDelegate)\n            {\n                return InvalidValidation;                                  //Secondary [flow11] {{This function trusts all certificates.}}\n            }\n            else\n            {\n                return (sender, certificate, chain, SslPolicyErrors) => true;   //Secondary [flow11] {{This function trusts all certificates.}}\n            }\n        }\n\n        static RemoteCertificateValidationCallback FindCompliant(bool Compliant)    //At least one path returns compliant => there is a logic and it is considered compliant\n        {\n            if (Compliant)\n            {\n                return null;\n            }\n            else\n            {\n                return (sender, certificate, chain, SslPolicyErrors) => true;\n            }\n        }\n\n        static RemoteCertificateValidationCallback FindCompliantRecursive(int Index)\n        {\n            if (Index <= 0)\n            {\n                return CompliantValidation;\n            }\n            else\n            {\n                return FindCompliantRecursive(Index - 1);\n            }\n        }\n\n        static RemoteCertificateValidationCallback FindInvalidRecursive(int Index)\n        {\n            if (Index <= 0)\n            {\n                return InvalidValidation;                                  //Secondary [flow14] {{This function trusts all certificates.}}\n            }\n            else\n            {\n                return FindInvalidRecursive(Index - 1);\n            }\n        }\n\n        #endregion\n\n        #region False negatives\n\n        static RemoteCertificateValidationCallback DelegateProperty\n        {\n            get\n            {\n                return (sender, certificate, chain, SslPolicyErrors) => true;   //False negative\n            }\n        }\n\n        static bool FalseNegativeValidatorWithProperty(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)\n        {\n            return TrueProperty;    //False negative\n        }\n\n        static bool TrueProperty\n        {\n            get\n            {\n                return true;        //False negative\n            }\n        }\n\n        public static RemoteCertificateValidationCallback operator +(CertificateValidationChecks instance, int number)\n        {\n            return (sender, certificate, chain, SslPolicyErrors) => true;\n        }\n\n        bool FalseNegativeException(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)\n        {\n            try\n            {\n                if (certificate.Subject != \"test\")\n                {\n                    throw new InvalidOperationException(\"You shall not pass! But you will anyway.\");\n                }\n                return true;    //False negative\n            }\n            catch   //All exceptions are cought, even those throw from inner DoValidation(crt).. helpers\n            {\n                //Log, no throw\n            }\n            return true;        //False negative\n        }\n\n        #endregion\n\n        #region Nested classes\n\n        class RelatedSignatureType\n        {\n            public Func<NonrelatedSignatureType, X509Certificate2, X509Chain, SslPolicyErrors, Boolean> Callback { get; set; }\n        }\n\n        class NonrelatedSignatureType\n        {\n            //Parameters are in order, that we do not inspect\n            public Func<NonrelatedSignatureType, X509Chain, X509Certificate2, SslPolicyErrors, Boolean> Callback { get; set; }\n        }\n\n        class OptionalConstructorArguments\n        {\n            public OptionalConstructorArguments(object owner, int a = 0, int b = 0, RemoteCertificateValidationCallback cb = null)\n            {\n            }\n        }\n\n        class InnerAssignmentClass\n        {\n            public void InitAsArgument(RemoteCertificateValidationCallback callback)\n            {\n                CertificateValidationChecks.CreateRQ().ServerCertificateValidationCallback += callback; //Noncompliant\n            }\n\n            public void InitAsParamsArgument(params RemoteCertificateValidationCallback[] callbacks)\n            {\n                CertificateValidationChecks.CreateRQ().ServerCertificateValidationCallback += callbacks;  //Error [CS0029]\n            }\n        }\n\n        class NeighbourAssignmentClass\n        {\n            public void Init(RemoteCertificateValidationCallback callback)\n            {\n                //Assignment from sibling class in nested tree\n                new InnerAssignmentClass().InitAsArgument((sender, certificate, chain, SslPolicyErrors) => true);  //Secondary {{This function trusts all certificates.}}\n            }\n        }\n\n        #endregion\n\n    }\n\n    class LocalFunctionCase\n    {\n        public void Foo()\n        {\n            InitAsArgument((sender, certificate, chain, SslPolicyErrors) => true);  // Secondary {{This function trusts all certificates.}}\n\n            HttpWebRequest CreateRQ()\n            {\n                return (HttpWebRequest)System.Net.HttpWebRequest.Create(\"http://localhost\");\n            }\n\n            void InitAsArgument(RemoteCertificateValidationCallback callback)\n            {\n                CreateRQ().ServerCertificateValidationCallback += callback; // Noncompliant\n            }\n        }\n    }\n\n    // See https://github.com/SonarSource/sonar-dotnet/issues/4404\n    struct AssignmentStruct\n    {\n        HttpWebRequest CreateRQ()\n        {\n            return (HttpWebRequest)System.Net.HttpWebRequest.Create(\"http://localhost\");\n        }\n\n        public void InitAsArgument(RemoteCertificateValidationCallback callback)\n        {\n            CreateRQ().ServerCertificateValidationCallback += callback; // Noncompliant\n        }\n\n        static void Execute()\n        {\n            new AssignmentStruct().InitAsArgument((sender, certificate, chain, SslPolicyErrors) => true);\n//                                                                                                 ^^^^ Secondary {{This function trusts all certificates.}}\n        }\n    }\n\n    // See https://github.com/SonarSource/sonar-dotnet/issues/4710\n    public static class ReproFor4710\n    {\n        public static void SomeMethodWithNameofCall()\n        {\n            Console.WriteLine(nameof(SomeMethodWithNameofCall));\n        }\n\n        public static void RestoreCertificateValidation(RemoteCertificateValidationCallback prevValidator)\n        {\n            ServicePointManager.ServerCertificateValidationCallback = prevValidator;\n        }\n    }\n\n    public static class UnknownTypeUSage\n    {\n        public static void SomeMethod(RemoteCertificateValidationCallback validator)\n        {\n            UnknownType.RestoreCertificateValidation(validator); // Error [CS0103]\n        }\n\n        public static void RestoreCertificateValidation(RemoteCertificateValidationCallback prevValidator)\n        {\n            ServicePointManager.ServerCertificateValidationCallback = prevValidator;\n        }\n    }\n\n    public class SomeClass\n    {\n        void MultipleHandlers()\n        {\n            var httpHandler = new HttpClientHandler();\n\n            httpHandler.ServerCertificateCustomValidationCallback = ChainValidator(httpHandler.ServerCertificateCustomValidationCallback);\n        }\n\n        private static Func<HttpRequestMessage, X509Certificate2, X509Chain, SslPolicyErrors, bool> ChainValidator(Func<HttpRequestMessage, X509Certificate2, X509Chain, SslPolicyErrors, bool> previousValidator)\n        {\n\n            Func<HttpRequestMessage, X509Certificate2, X509Chain, SslPolicyErrors, bool> chained =\n                (request, certificate, chain, sslPolicyErrors) =>\n                {\n                    if (sslPolicyErrors == SslPolicyErrors.None)\n                    {\n                        return previousValidator(request, certificate, chain, sslPolicyErrors);\n                    }\n                    return false;\n                };\n            return chained;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CertificateValidationCheck.vb",
    "content": "﻿\nImports System\nImports System.Net\nImports System.Net.Http\nImports System.Net.Security\nImports System.Security.Cryptography.X509Certificates\n\nNamespace Tests.TestCases\n\n    Class CertificateValidationChecks\n\n        Private Sub FalseNegatives()\n            'Values from properties are not inspected at all\n            CreateRQ.ServerCertificateValidationCallback = AddressOf FalseNegativeValidatorWithProperty\n            CreateRQ.ServerCertificateValidationCallback = DelegateProperty\n            'Values from overriden operators are not inspected at all\n            CreateRQ.ServerCertificateValidationCallback = New CertificateValidationChecks() + 42 'Operator + is overriden to return delegate.\n            'VB Specific syntax with return variable, codepaths are not inspected\n            CreateRQ.ServerCertificateValidationCallback = AddressOf FalseNegativeVBSpecific\n            CreateRQ.ServerCertificateValidationCallback = FindFalseNegativeVBSpecific()\n            'Specific cases\n            CreateRQ.ServerCertificateValidationCallback = AddressOf FalseNegativeException\n        End Sub\n\n        Private Sub DirectAddHandlers()\n            'Inline version\n            CreateRQ().ServerCertificateValidationCallback = Function(sender, certificate, chain, SslPolicyErrors) True\n            '          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ {{Enable server certificate validation on this SSL/TLS connection}}\n            '                                                                                                      ^^^^ Secondary@-1 {{This function trusts all certificates.}}\n            'Secondary@+1 {{This function trusts all certificates.}}\n            CreateRQ().ServerCertificateValidationCallback = Function(sender, certificate, chain, SslPolicyErrors) (((True)))   'Noncompliant\n            CreateRQ().ServerCertificateValidationCallback = Function(sender, certificate, chain, SslPolicyErrors) False\n            CreateRQ().ServerCertificateValidationCallback = Function(sender, certificate, chain, SslPolicyErrors) certificate.Subject = \"Test\"\n\n            'Lambda block syntax\n            CreateRQ().ServerCertificateValidationCallback = Function(sender, certificate, chain, SslPolicyErrors)                       'Noncompliant\n                                                                 Return True    'Secondary {{This function trusts all certificates.}}\n                                                             End Function\n            CreateRQ().ServerCertificateValidationCallback = Function(sender, certificate, chain, SslPolicyErrors)\n                                                                 Return False\n                                                             End Function\n\n            'With variable\n            Dim rq As HttpWebRequest = CreateRQ()\n            rq.ServerCertificateValidationCallback = AddressOf InvalidValidation            'Noncompliant\n\n            'Without variable\n            CreateRQ().ServerCertificateValidationCallback = AddressOf InvalidValidation    'Noncompliant\n\n            'Assignment syntax = instead of =\n            CreateRQ().ServerCertificateValidationCallback = AddressOf InvalidValidation    'Noncompliant\n            CreateRQ().ServerCertificateValidationCallback = Function(sender, certificate, chain, SslPolicyErrors) True     'Noncompliant\n            'Secondary@-1\n\n            'VB Specific cases with return variable\n            CreateRQ().ServerCertificateValidationCallback = AddressOf CompliantVBSpecific\n            CreateRQ().ServerCertificateValidationCallback = AddressOf InvalidVBSpecific    'Noncompliant\n\n            'Do not test this one. It's .NET Standard 2.1 target only. It should work since we're hunting RemoteCertificateValidationCallback and method signature\n            'var ws = new System.Net.WebSockets.ClientWebSocket()\n            'ws.Options.RemoteCertificateValidationCallback = InvalidValidation\n\n            'Do not test this one. It's .NET Standard 2.1 target only. It should work since we're hunting RemoteCertificateValidationCallback and method signature\n            'var sslOpts = new System.Net.Security.SslClientAuthentication()\n            'Security.SslClientAuthenticationOptions.RemoteCertificateValidationCallback\n        End Sub\n\n        Private Sub MultipleHandlers()\n            ServicePointManager.ServerCertificateValidationCallback = AddressOf CompliantValidation\n            ServicePointManager.ServerCertificateValidationCallback = AddressOf CompliantValidationPositiveA\n            ServicePointManager.ServerCertificateValidationCallback = AddressOf InvalidValidation                       'Noncompliant\n            ServicePointManager.ServerCertificateValidationCallback = AddressOf CompliantValidationPositiveB\n            ServicePointManager.ServerCertificateValidationCallback = AddressOf CompliantValidationNegative\n            ServicePointManager.ServerCertificateValidationCallback = AddressOf AdvInvalidTry                           'Noncompliant\n            ServicePointManager.ServerCertificateValidationCallback = AddressOf AdvInvalidWithTryObstacles              'Noncompliant\n            ServicePointManager.ServerCertificateValidationCallback = AddressOf AdvCompliantWithTryObstacles\n            ServicePointManager.ServerCertificateValidationCallback = AddressOf AdvInvalidWithObstacles                 'Noncompliant\n            ServicePointManager.ServerCertificateValidationCallback = AddressOf AdvCompliantWithObstacles\n            ServicePointManager.ServerCertificateValidationCallback = AddressOf AdvCompliantWithException\n            ServicePointManager.ServerCertificateValidationCallback = AddressOf AdvCompliantWithExceptionAndRethrow\n        End Sub\n\n        Private Sub GenericHandlerSignature()\n            Dim Handler As New HttpClientHandler()          'This is not RemoteCertificateValidationCallback delegate type, but Func<...>\n            Handler.ServerCertificateCustomValidationCallback = AddressOf InvalidValidation            'Noncompliant\n            ' Secondary@+1\n            Handler.ServerCertificateCustomValidationCallback = Handler.DangerousAcceptAnyServerCertificateValidator            'Noncompliant\n            ' Secondary@+1\n            Handler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator  'Noncompliant\n\n            'Generic signature check without RemoteCertificateValidationCallback\n            Dim ShouldTrigger As New RelatedSignatureType()\n            ShouldTrigger.Callback = AddressOf InvalidValidation                                           'Noncompliant\n            ShouldTrigger.Callback = AddressOf CompliantValidation\n\n            Dim ShouldNotTrigger As New NonrelatedSignatureType()\n            ShouldNotTrigger.Callback = Function(sender, chain, certificate, SslPolicyErrors) True   'Compliant, because signature types are not in expected order for validation\n            ShouldNotTrigger.Callback = Function(sender, chain, certificate, SslPolicyErrors) False\n        End Sub\n\n        Private Sub PassedAsArgument()\n            Dim SingleAssignmentCB, FalseNegativeCB, CompliantCB As RemoteCertificateValidationCallback\n            Dim DeclarationAssignmentCompliantCB As RemoteCertificateValidationCallback = Nothing\n            If True Then\n                'If there's only one Assignment, we will inspect it\n                'Secondary@+1\n                SingleAssignmentCB = AddressOf InvalidValidationAsArgument              'Secondary\n                FalseNegativeCB = AddressOf InvalidValidation                           'Compliant due to false negative, the second assignment is after usage of the variable\n                CompliantCB = AddressOf InvalidValidation                               'Compliant due to further logic and more assingments\n            End If\n            If True Then 'Environment.ComputerName, Environment.CommandLine, Debugger.IsAttached, Config.TestEnvironment\n                CompliantCB = Nothing                                                   'Compliant, there are more assignments, so there is a logic\n                DeclarationAssignmentCompliantCB = AddressOf InvalidValidation          'This is compliant due to the more assignments, first one is in variable initialization\n            End If\n            'Secondary@+1\n            iNITaSaRGUMENT(SingleAssignmentCB)                                          'Secondary\n            InitAsArgument(FalseNegativeCB)\n            InitAsArgument(CompliantCB)\n            InitAsArgument(DeclarationAssignmentCompliantCB)\n            FalseNegativeCB = Nothing                                                   'False negative due to more assignments, but this one is after variable usage.\n            'Secondary@+1\n            InitAsArgument(AddressOf InvalidValidationAsArgument)                       'Secondary\n            InitAsArgument(Function(sender, certificate, chain, SslPolicyErrors) False)\n            InitAsArgument(Function(sender, certificate, chain, SslPolicyErrors) True)  'Secondary\n            'Secondary@-1\n            InitAsArgumentRecursive(AddressOf InvalidValidation, 1)                     'Secondary\n            InitAsOptionalArgument()\n\n            'Call in nested class from root (this)\n            Dim Inner As New InnerAssignmentClass\n            Inner.InitAsArgument(Function(sender, certificate, chain, SslPolicyErrors) True)  'Secondary\n        End Sub\n\n        Private Sub DelegateReturnedByFunction(Handler As HttpClientHandler)\n            CreateRQ.ServerCertificateValidationCallback = FindInvalid(False)           'Noncompliant\n            CreateRQ.ServerCertificateValidationCallback = FindInvalid()                'Noncompliant\n            CreateRQ.ServerCertificateValidationCallback = FindLambdaValidator()        'Noncompliant\n            CreateRQ.ServerCertificateValidationCallback = FindCompliant(True)\n            CreateRQ.ServerCertificateValidationCallback = FindCompliantRecursive(3)\n            CreateRQ.ServerCertificateValidationCallback = FindInvalidRecursive(3)      'Noncompliant\n            Handler.ServerCertificateCustomValidationCallback = FindDangerous()         'Noncompliant\n            'Specific cases for VB.NET\n            CreateRQ.ServerCertificateValidationCallback = FindInvalidVBSpecific()      'Noncompliant\n            CreateRQ.ServerCertificateValidationCallback = FindCompliant(True)\n        End Sub\n\n        Private Sub ConstructorArguments()\n            Dim optA As New OptionalConstructorArguments(Me, cb:=AddressOf InvalidValidation)                 'Noncompliant\n            Dim optB As New OptionalConstructorArguments(Me, cb:=AddressOf CompliantValidation)\n\n            Using ms As New System.IO.MemoryStream\n                Using ssl As New System.Net.Security.SslStream(ms, True, Function(sender, chain, certificate, SslPolicyErrors) True)\n                    '                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n                    '                                                                                                          ^^^^ Secondary@-1\n                End Using\n                Using ssl As New System.Net.Security.SslStream(ms, True, AddressOf InvalidValidation)   'Noncompliant\n                End Using\n                Using ssl As New System.Net.Security.SslStream(ms, True, AddressOf CompliantValidation)\n                End Using\n            End Using\n        End Sub\n\n#Region \"Helpers\"\n\n        Private Sub InitAsArgument(Callback As RemoteCertificateValidationCallback)   'This double-assigment will fire the seconday for each occurence twice\n            Dim cb As RemoteCertificateValidationCallback = Callback    'Secondary\n            CreateRQ.ServerCertificateValidationCallback = Callback     'Noncompliant\n            CreateRQ.ServerCertificateValidationCallback = cb           'Noncompliant\n        End Sub\n\n        Private Sub InitAsOptionalArgument(Optional Callback As RemoteCertificateValidationCallback = Nothing)\n            CreateRQ().ServerCertificateValidationCallback = Callback     'Compliant, it is called without argument\n        End Sub\n\n        Private Sub InitAsArgumentRecursive(Callback As RemoteCertificateValidationCallback, Cnt As Integer)\n            If Cnt = 0 Then\n                CreateRQ().ServerCertificateValidationCallback = Callback     'Noncompliant\n            Else\n                InitAsArgumentRecursive(Callback, Cnt - 1)\n            End If\n        End Sub\n\n        Private Sub InitAsArgumentRecursiveNoInvocation(Callback As RemoteCertificateValidationCallback, Cnt As Integer)\n            If Cnt = 0 Then\n                CreateRQ().ServerCertificateValidationCallback = Callback     'Compliant, no one is invoking this\n            Else\n                InitAsArgumentRecursiveNoInvocation(Callback, Cnt - 1)\n            End If\n        End Sub\n\n        Public Shared Function CreateRQ() As HttpWebRequest\n            Return DirectCast(HttpWebRequest.Create(\"http:'localhost\"), HttpWebRequest)\n        End Function\n\n        Private Function IsValid(Crt As X509Certificate) As Boolean\n            Return Crt.Subject = \"Test\"   'We do not inspect inner logic, yet\n        End Function\n\n        Private Sub Log(Crt As X509Certificate)\n            'Pretend to do some logging\n        End Sub\n\n#End Region\n\n#Region \"Basic Validators\"\n\n        Private Function InvalidValidation(Sender As Object, Certificate As X509Certificate, Chain As X509Chain, PolicyErrors As SslPolicyErrors) As Boolean\n            Return True    'Secondary\n            'Secondary@-1\n            'Secondary@-2\n            'Secondary@-3\n            'Secondary@-4\n            'Secondary@-5\n            'Secondary@-6\n            'Secondary@-7\n            'Secondary@-8\n            'Secondary@-9\n            'Secondary@-10\n            'Secondary@-11\n            'Secondary@-12\n        End Function\n\n        Private Function InvalidValidationAsArgument(Sender As Object, Certificate As X509Certificate, Chain As X509Chain, PolicyErrors As SslPolicyErrors) As Boolean\n            Return True    'Secondary\n            'Secondary@-1\n            'Secondary@-2\n            'Secondary@-3\n        End Function\n\n        Private Function CompliantValidation(Sender As Object, Certificate As X509Certificate, Chain As X509Chain, PolicyErrors As SslPolicyErrors) As Boolean\n            Return False 'Compliant\n        End Function\n\n        Private Function CompliantValidationPositiveA(Sender As Object, Certificate As X509Certificate, Chain As X509Chain, PolicyErrors As SslPolicyErrors) As Boolean\n            If Certificate.Subject = \"Test\" Then\n                Return True 'Compliant, checks were done\n            Else\n                Return False\n            End If\n        End Function\n\n        Private Function CompliantValidationPositiveB(Sender As Object, Certificate As X509Certificate, Chain As X509Chain, PolicyErrors As SslPolicyErrors) As Boolean\n            Return Certificate.Subject = \"Test\"\n        End Function\n\n        Private Function CompliantValidationNegative(Sender As Object, Certificate As X509Certificate, Chain As X509Chain, PolicyErrors As SslPolicyErrors) As Boolean\n            If Certificate.Subject <> \"Test\" Then\n                Return False\n            ElseIf DateTime.Parse(Certificate.GetExpirationDateString()) < DateTime.Now Then\n                Return False\n            Else\n                Return True\n            End If\n        End Function\n\n        Private Function CompliantVBSpecific(Sender As Object, Certificate As X509Certificate, Chain As X509Chain, PolicyErrors As SslPolicyErrors) As Boolean\n            If Certificate.Subject <> \"Test\" Then\n                CompliantVBSpecific = False\n            ElseIf DateTime.Parse(Certificate.GetExpirationDateString()) < DateTime.Now Then\n                CompliantVBSpecific = False\n            Else\n                CompliantVBSpecific = True\n            End If\n        End Function\n\n        Private Function InvalidVBSpecific(Sender As Object, Certificate As X509Certificate, Chain As X509Chain, PolicyErrors As SslPolicyErrors) As Boolean\n            If Certificate.Subject <> \"Test\" Then\n                InvalidVBSpecific = True            'Secondary\n            ElseIf DateTime.Parse(Certificate.GetExpirationDateString()) < DateTime.Now Then\n                InvalidVBSpecific = True            'Secondary\n            Else\n                InvalidVBSpecific = True            'Secondary\n            End If\n        End Function\n\n        Private Function FalseNegativeVBSpecific(Sender As Object, Certificate As X509Certificate, Chain As X509Chain, PolicyErrors As SslPolicyErrors) As Boolean\n            FalseNegativeVBSpecific = False\n            FalseNegativeVBSpecific = False\n            FalseNegativeVBSpecific = True    'False negative, all assigned values are currently considered as possible return values\n        End Function\n\n#End Region\n\n#Region \"Advanced Validators\"\n\n        Private Function AdvInvalidTry(Sender As Object, Certificate As X509Certificate, Chain As X509Chain, PolicyErrors As SslPolicyErrors) As Boolean\n            Try\n                System.Diagnostics.Trace.WriteLine(Certificate.Subject)\n                Return True 'Secondary\n            Catch ex As Exception\n                System.Diagnostics.Trace.WriteLine(ex.Message)\n                Return True 'Secondary\n            End Try\n        End Function\n\n        Private Function AdvInvalidWithTryObstacles(Sender As Object, Certificate As X509Certificate, Chain As X509Chain, PolicyErrors As SslPolicyErrors) As Boolean\n            Try\n                Console.WriteLine(\"Log something\")\n                System.Diagnostics.Trace.WriteLine(\"Log something\")\n                Log(Certificate)\n\n                Return True 'Secondary\n            Catch ex As Exception\n                System.Diagnostics.Trace.WriteLine(ex.Message)\n            End Try\n            Return True 'Secondary\n        End Function\n\n        Private Function AdvCompliantWithTryObstacles(Sender As Object, Certificate As X509Certificate, Chain As X509Chain, PolicyErrors As SslPolicyErrors) As Boolean\n            Try\n                Console.WriteLine(\"Log something\")\n                System.Diagnostics.Trace.WriteLine(\"Log something\")\n                Log(Certificate)\n\n                Return True 'Compliant, since Log(certificate) can also do some validation and throw exception resulting in return false. It's bad practice, but compliant.\n            Catch ex As Exception\n                System.Diagnostics.Trace.WriteLine(ex.Message)\n            End Try\n            Return False\n        End Function\n\n        Private Function AdvInvalidWithObstacles(Sender As Object, Certificate As X509Certificate, Chain As X509Chain, PolicyErrors As SslPolicyErrors) As Boolean\n            Console.WriteLine(\"Log something\")\n            System.Diagnostics.Trace.WriteLine(\"Log something\")\n            Log(Certificate)\n\n            Return True 'Secondary\n        End Function\n\n        Private Function AdvCompliantWithObstacles(Sender As Object, Certificate As X509Certificate, Chain As X509Chain, PolicyErrors As SslPolicyErrors) As Boolean\n            Console.WriteLine(\"Log something\")\n            System.Diagnostics.Trace.WriteLine(\"Log something\")\n            Log(Certificate)\n            Return IsValid(Certificate)\n        End Function\n\n        Private Function AdvCompliantWithException(Sender As Object, Certificate As X509Certificate, Chain As X509Chain, PolicyErrors As SslPolicyErrors) As Boolean\n            If Certificate.Subject <> \"test\" Then Throw New InvalidOperationException(\"You shall not pass!\")\n            Return True ' Compliant, uncaught exception Is thrown above\n        End Function\n\n        Private Function AdvCompliantWithExceptionAndRethrow(Sender As Object, Certificate As X509Certificate, Chain As X509Chain, PolicyErrors As SslPolicyErrors) As Boolean\n            Try\n                If Certificate.Subject <> \"test\" Then\n                    Throw New InvalidOperationException(\"You shall not pass!\")\n                End If\n                Return True     'Compliant due to Throw logic\n            Catch\n                'Log\n                Throw\n            End Try\n            Return True         'Compliant due to Throw logic\n        End Function\n\n#End Region\n\n#Region \"Find Validators\"\n\n        Private Function FindInvalid() As RemoteCertificateValidationCallback\n            Return AddressOf InvalidValidation                                      'Secondary\n        End Function\n\n        Private Function FindLambdaValidator() As RemoteCertificateValidationCallback\n            Return Function(sender, certificate, chain, SslPolicyErrors) True       'Secondary\n        End Function\n\n        Private Function FindDangerous() As Func(Of HttpRequestMessage, X509Certificate2, X509Chain, SslPolicyErrors, Boolean)\n            Return HttpClientHandler.DangerousAcceptAnyServerCertificateValidator   'Secondary\n        End Function\n\n        Private Function FindInvalid(UseDelegate As Boolean) As RemoteCertificateValidationCallback   'All paths return noncompliant\n            If UseDelegate Then\n                Return AddressOf InvalidValidation                                  'Secondary\n            Else\n                Return Function(sender, certificate, chain, SslPolicyErrors) True   'Secondary\n            End If\n        End Function\n\n        Private Function FindCompliant(Compliant As Boolean) As RemoteCertificateValidationCallback     'At least one path returns compliant => there is a logic and it is considered compliant\n            If Compliant Then\n                Return Nothing\n            Else\n                Return Function(sender, certificate, chain, SslPolicyErrors) True\n            End If\n        End Function\n\n        Private Function FindCompliantRecursive(Index As Integer) As RemoteCertificateValidationCallback\n            If Index <= 0 Then\n                Return AddressOf CompliantValidation\n            Else\n                Return FindCompliantRecursive(Index - 1)\n            End If\n        End Function\n\n        Private Function FindInvalidRecursive(Index As Integer) As RemoteCertificateValidationCallback\n            If Index <= 0 Then\n                Return AddressOf InvalidValidation                                  'Secondary\n            Else\n                Return FindInvalidRecursive(Index - 1)\n            End If\n        End Function\n\n        Private Function FindInvalidVBSpecific() As RemoteCertificateValidationCallback\n            Dim NotUsed As RemoteCertificateValidationCallback = Nothing\n            NotUsed = AddressOf CompliantValidation\n            FindInvalidVBSpecific = AddressOf InvalidValidation                                      'Secondary\n        End Function\n\n        Private Function FindCompliantVBSpecific(Compliant As Boolean) As RemoteCertificateValidationCallback     'At least one path returns compliant => there is a logic and it is considered compliant\n            If Compliant Then\n                Return Nothing  'Combination of return statement and return variable\n            Else\n                FindCompliantVBSpecific = Function(sender, certificate, chain, SslPolicyErrors) True\n            End If\n        End Function\n\n        Private Function FindFalseNegativeVBSpecific() As RemoteCertificateValidationCallback\n            FindFalseNegativeVBSpecific = Nothing\n            FindFalseNegativeVBSpecific = Function(sender, certificate, chain, SslPolicyErrors) True    'False negative, all assignments are considered as returns\n        End Function\n\n        Private Function FalseNegativeException(Sender As Object, Certificate As X509Certificate, Chain As X509Chain, PolicyErrors As SslPolicyErrors) As Boolean\n            Try\n                If Certificate.Subject <> \"test\" Then Throw New InvalidOperationException(\"You shall not pass! But you will anyway.\")\n                Return True 'False negative\n            Catch   'All exceptions are cought, even those throw from inner DoValidation(crt).. helpers\n                'Log, no rethrow\n            End Try\n            Return True     'False negative\n        End Function\n\n#End Region\n\n#Region \"False negatives\"\n\n        Private ReadOnly Property DelegateProperty As RemoteCertificateValidationCallback\n            Get\n                Return Function(sender, certificate, chain, SslPolicyErrors) True   'False negative\n            End Get\n        End Property\n\n        Private Function FalseNegativeValidatorWithProperty(Sendera As Object, Certificate As X509Certificate, Chain As X509Chain, PolicyErrors As SslPolicyErrors) As Boolean\n            Return TrueProperty    'False negative\n        End Function\n\n        Private ReadOnly Property TrueProperty As Boolean\n            Get\n                Return True 'False negative\n            End Get\n        End Property\n\n        Public Shared Operator +(Instance As CertificateValidationChecks, Number As Integer) As RemoteCertificateValidationCallback\n            Return Function(sender, certificate, chain, SslPolicyErrors) True\n        End Operator\n\n#End Region\n\n#Region \"Nested classes\"\n\n        Class RelatedSignatureType\n\n            Public Property Callback As Func(Of NonrelatedSignatureType, X509Certificate2, X509Chain, SslPolicyErrors, Boolean)\n\n        End Class\n\n        Class NonrelatedSignatureType\n\n            'Parameters are in order, that we do not inspect\n            Public Property Callback As Func(Of NonrelatedSignatureType, X509Chain, X509Certificate2, SslPolicyErrors, Boolean)\n\n        End Class\n\n        Class OptionalConstructorArguments\n\n            Public Sub New(Owner As Object, Optional A As Integer = 0, Optional b As Integer = 0, Optional cb As RemoteCertificateValidationCallback = Nothing)\n\n            End Sub\n\n        End Class\n\n        Class InnerAssignmentClass\n\n            Public Sub InitAsArgument(Callback As RemoteCertificateValidationCallback)\n                CertificateValidationChecks.CreateRQ().ServerCertificateValidationCallback = Callback 'Noncompliant\n            End Sub\n\n        End Class\n\n        Class NeighbourAssignmentClass\n\n            Public Sub Init(Callback As RemoteCertificateValidationCallback)\n                'Assignment from sibling class in nested tree\n                Dim Value As New InnerAssignmentClass()\n                Value.InitAsArgument(Function(sender, certificate, chain, SslPolicyErrors) True)  'Secondary\n            End Sub\n\n        End Class\n\n#End Region\n\n    End Class\n\n    Module RootForNestedNeighbours\n\n        Sub NeighbourAssignmentWithoutClass()\n            'Assignment from sibling method in nested tree\n            Dim Value As New InnerAssignmentClass()\n            Value.InitAsArgument(Function(sender, certificate, chain, SslPolicyErrors) True)  'Secondary\n        End Sub\n\n        Class InnerAssignmentClass\n\n            Public Sub InitAsArgument(Callback As RemoteCertificateValidationCallback)\n                CertificateValidationChecks.CreateRQ().ServerCertificateValidationCallback = Callback 'Noncompliant\n            End Sub\n\n        End Class\n\n        Class NeighbourAssignmentClass\n\n            Public Sub Init(Callback As RemoteCertificateValidationCallback)\n                'Assignment from sibling class in nested tree\n                Dim Value As New InnerAssignmentClass()\n                Value.InitAsArgument(Function(sender, certificate, chain, SslPolicyErrors) True)  'Secondary\n            End Sub\n\n        End Class\n\n        Public Structure S\n            Private Sub DelegateReturnedByFunction(Handler As HttpClientHandler)\n                CreateRQ.ServerCertificateValidationCallback = FindInvalid() 'Noncompliant\n            End Sub\n\n            Private Shared Function CreateRQ() As HttpWebRequest\n                Return DirectCast(HttpWebRequest.Create(\"http:'localhost\"), HttpWebRequest)\n            End Function\n\n            Private Function FindInvalid() As RemoteCertificateValidationCallback\n                Return AddressOf InvalidValidation 'Secondary\n            End Function\n\n            Private Function InvalidValidation(Sender As Object, Certificate As X509Certificate, Chain As X509Chain, PolicyErrors As SslPolicyErrors) As Boolean\n                Return True 'Secondary\n            End Function\n        End Structure\n\n    End Module\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CheckArgumentException.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nrecord CSharp9\n{\n    void Foo1(int a)\n    {\n        throw new ArgumentNullException(\"foo\"); // Noncompliant {{The parameter name 'foo' is not declared in the argument list.}}\n    }\n\n    void Foo3(int a)\n    {\n        ArgumentException exception = new (\"a\", \"foo\"); // Noncompliant\n        throw exception;\n    }\n\n    void Foo4(int a)\n    {\n        Action<int, int> res =\n            (_, _) =>\n            {\n                throw new ArgumentNullException(\"_\");\n                // https://github.com/SonarSource/sonar-dotnet/issues/8319\n                throw new ArgumentNullException(\"a\"); // Noncompliant FP - we are just looking at most direct parent definition\n            };\n    }\n\n    public int Foo9\n    {\n        init\n        {\n            throw new ArgumentNullException(\"value\");\n            throw new ArgumentNullException(\"foo\");   // Noncompliant\n            throw new ArgumentNullException(\"Foo9\");\n        }\n    }\n\n    public string this[int a, int b]\n    {\n        init\n        {\n            throw new ArgumentNullException(\"a\");\n            throw new ArgumentNullException(\"value\");\n        }\n    }\n\n    void ComplexCase(int a)\n    {\n        Action<int> simple = b =>\n            {\n                Action<int, int> parenthesized = (_, _) =>\n                {\n                    throw new ArgumentNullException(\"a\"); // Noncompliant\n                };\n            };\n    }\n}\n\nclass ReproForIssue2488\n{\n    private string input;\n    public string Response\n    {\n        get => \"\";\n        init => this.input = value ?? throw new ArgumentNullException(nameof(value));\n    }\n    public string Request\n    {\n        get => this.input;\n        init => this.input = value ?? throw new ArgumentNullException(nameof(this.Request));\n    }\n\n    public string Request2\n    {\n        get => this.input;\n        init => this.input = value ?? throw new ArgumentNullException(nameof(Request2));\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/4423\npublic class Repro_4423\n{\n    public void InsideLocalFunction_Static(string methodArg)\n    {\n        Something(null);\n\n        static void Something(string localArg)\n        {\n            throw new ArgumentNullException(nameof(localArg));   // Compliant\n            throw new ArgumentNullException(nameof(methodArg));  // Noncompliant, this method even doesn't see methodArg value\n        }\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/5094\npublic record Data(string Code, string Name)\n{\n    public string Code { get; } = Code ?? throw new ArgumentNullException(nameof(Code)); // Compliant - Code is a record parameter\n    public string GetName()\n    {\n        return Name ?? throw new ArgumentNullException(nameof(Name)); // Compliant - Name is a record parameter\n    }\n\n    public string GetNameLambda() => Name ?? throw new ArgumentNullException(nameof(Name)); // Compliant - Name is a record parameter\n}\n\npublic class TestClass\n{\n    public static string ClassProperty { get; }\n\n    public record TestRecord()\n    {\n        public string RecordProperty { get; } = ClassProperty ?? throw new ArgumentNullException(nameof(ClassProperty)); // Noncompliant\n    }\n}\n\npublic record R(string Prop)\n{\n    public class TestClass\n    {\n        public static string ClassProperty { get; }\n\n        public string RecordProperty { get; } = ClassProperty ?? throw new ArgumentNullException(nameof(Prop)); // Noncompliant\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/5226\npublic class Repro_5226\n{\n    public void OnePositionalOneNamedCompliant(int a)\n    {\n        throw new ArgumentOutOfRangeException(nameof(a), message: \"Sample message\");\n    }\n\n    public void OnePositionalOneNamedNonCompliant(int a)\n    {\n        throw new ArgumentOutOfRangeException(\"randomString\", message: nameof(a)); // Noncompliant\n    }\n\n    public void ShuffledPositions1(int a)\n    {\n        throw new ArgumentOutOfRangeException(\"randomString\", actualValue: \"\", nameof(a)); // Noncompliant\n    }\n\n    public void ShuffledPositions2(int a)\n    {\n        throw new ArgumentOutOfRangeException(\"randomString\", message: nameof(a), actualValue: \"\"); // Noncompliant\n    }\n\n    public void ShuffledPositions3(int a)\n    {\n        throw new ArgumentOutOfRangeException(nameof(a), message: \"randomString\", actualValue: \"\");\n    }\n}\n\nclass CSharp10\n{\n    public const string Part1 = \"One\";\n    public const string Part2 = \"Two\";\n    public const string ParamName = $\"{Part1}{Part2}\";\n    public const string WrongParamName = $\"{Part2}{Part1}\";\n\n    void Foo1(int OneTwo)\n    {\n        throw new ArgumentNullException(ParamName); // Compliant\n    }\n\n    void Foo2(int OneTwo)\n    {\n        throw new ArgumentNullException(WrongParamName); // Noncompliant\n    }\n}\n\n\n// Reproducer for https://github.com/SonarSource/sonar-dotnet/issues/7714\npublic class PrimaryConstructor(string s, string q)\n{\n    private readonly string _s = s ?? throw new ArgumentNullException(nameof(s)); // Compliant: s is a class parameter\n\n    public string GetQ()\n    {\n        ArgumentNullException.ThrowIfNull(s, \"something\"); // FN\n        ArgumentNullException.ThrowIfNull(s, nameof(q)); // Compliant\n        return q ?? throw new ArgumentNullException(nameof(q)); // Compliant: q is a class parameter\n    }\n\n    public string GetQLambda() => q ?? throw new ArgumentNullException(nameof(q)); // Compliant: q is a class parameter\n}\n\npublic struct PrimaryConstructorStruct(string s, string q)\n{\n    private readonly string _s = s ?? throw new ArgumentNullException(nameof(s)); // Compliant: s is a class parameter\n\n    public string GetQ()\n    {\n        return q ?? throw new ArgumentNullException(nameof(q)); // Compliant: q is a class parameter\n    }\n\n    public string GetQLambda() => q ?? throw new ArgumentNullException(nameof(q)); // Compliant: q is a class parameter\n}\n\npublic class PrimaryConstructor2(string Prop)\n{\n    public class TestClass\n    {\n        public static string B { get; }\n\n        // https://github.com/SonarSource/sonar-dotnet/issues/8319\n        public string A { get; } = B ?? throw new ArgumentNullException(nameof(Prop)); // Noncompliant FP: we are checking only the first parent (TestClass) \n    }\n}\n\npublic static class Extensions\n{\n    extension(IEnumerable<string> source)\n    {\n        public void InExtension()\n        {\n            if (source == null)\n                throw new ArgumentNullException(\"source\");  // Compliant\n        }\n    }\n\n    public static void Compliant(this IEnumerable<string> source)\n    {\n        if (source == null)\n            throw new ArgumentNullException(\"source\");      // Compliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CheckArgumentException.TopLevelStatements.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nif (args == null)\n{\n    throw new ArgumentException(); // Noncompliant {{Use a constructor overloads that allows a more meaningful exception message to be provided.}}\n    throw new ArgumentNullException(\"foo\"); // Noncompliant {{The parameter name 'foo' is not declared in the argument list.}}\n    throw new ArgumentException(\"args\", \"message\"); // Noncompliant {{ArgumentException constructor arguments have been inverted.}}\n    throw new ArgumentException(\"message\", \"args\");\n    throw new ArgumentNullException(\"args\");\n}\n\nif (args.Length > 0)\n{\n    foreach (var arg in args)\n    {\n        Console.WriteLine(arg);\n    }\n}\n\nvoid LocalFunction(string localArg)\n{\n    throw new ArgumentNullException(nameof(localArg));  // Compliant\n    throw new ArgumentNullException(nameof(args));      // Noncompliant\n}\n\nstatic void StaticLocalFunction(string localArg)\n{\n    throw new ArgumentNullException(nameof(localArg));  // Compliant\n    throw new ArgumentNullException(nameof(args));      // Noncompliant, this method even doesn't see args value\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CheckArgumentException.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public class CustomArgumentException : ArgumentException\n    {\n        public CustomArgumentException()\n        {\n        }\n        public CustomArgumentException(string message)\n            : base(message)\n        {\n        }\n        public CustomArgumentException(string message, Exception inner)\n            : base(message, inner)\n        {\n        }\n\n        public CustomArgumentException(string message, string paramName)\n            : base(message, paramName)\n        {\n        }\n        public CustomArgumentException(string message, string paramName, Exception inner)\n            : base(message, paramName, inner)\n        {\n        }\n    }\n\n    class Program\n    {\n        public int Bar { get; set; }\n\n        void Foo(int a)\n        {\n            throw new ArgumentException(); // Noncompliant {{Use a constructor overloads that allows a more meaningful exception message to be provided.}}\n            throw new ArgumentException { Source = null }; // Noncompliant\n            throw new ArgumentNullException(); // Noncompliant\n            throw new ArgumentOutOfRangeException(); // Noncompliant\n            throw new DuplicateWaitObjectException(); // Noncompliant\n            throw new CustomArgumentException(); // Compliant - ignored from analysis\n        }\n\n        void Foo0(int a)\n        {\n            var exception = new ArgumentNullException(); // Noncompliant\n            throw exception;\n        }\n\n        void Foo1(int a)\n        {\n            throw new ArgumentException(\"foo\"); // Compliant - foo is the message\n\n            throw new ArgumentNullException(\"foo\"); // Noncompliant {{The parameter name 'foo' is not declared in the argument list.}}\n            throw new ArgumentOutOfRangeException(\"foo\"); // Noncompliant\n            throw new DuplicateWaitObjectException(\"foo\"); // Noncompliant\n        }\n\n        void Foo2(int a)\n        {\n            throw new ArgumentException(\"a\", \"foo\"); // Noncompliant {{ArgumentException constructor arguments have been inverted.}}\n            throw new ArgumentNullException(\"foo\", \"a\"); // Noncompliant {{ArgumentException constructor arguments have been inverted.}}\n            throw new ArgumentOutOfRangeException(\"foo\", \"a\"); // Noncompliant\n            throw new DuplicateWaitObjectException(\"foo\", \"a\"); // Noncompliant\n        }\n\n        void Foo3(int a, Program p)\n        {\n            throw new ArgumentException(\"foo\", \"a\");\n            throw new ArgumentException(\"foo\", \"p.Bar\");\n            throw new ArgumentException(\"foo\", \"p.Test\"); // Compliant - cannot detect if sub-element exists\n            throw new ArgumentException(\"foo\", \"test.Test\"); // Noncompliant\n            throw new ArgumentNullException(\"a\", \"foo\");\n            throw new ArgumentOutOfRangeException(\"a\", \"foo\");\n            throw new DuplicateWaitObjectException(\"a\", \"foo\");\n        }\n\n        void Foo4(int a)\n        {\n            var paramName = \"foo\";\n            throw new ArgumentNullException(paramName); // Compliant because we can't validate non const-string\n            throw new ArgumentOutOfRangeException(paramName); // Compliant because we can't validate non const-string\n            throw new DuplicateWaitObjectException(paramName); // Compliant because we can't validate non const-string\n        }\n\n        void Foo5(int a)\n        {\n            const string paramName = \"a\";\n            throw new ArgumentNullException(paramName); // Compliant\n            throw new ArgumentOutOfRangeException(paramName); // Compliant\n            throw new DuplicateWaitObjectException(paramName); // Compliant\n        }\n\n        void Foo6(int a, int @b)\n        {\n            throw new ArgumentNullException(nameof(a));\n            throw new ArgumentNullException(nameof(Foo5)); // Noncompliant\n            throw new ArgumentOutOfRangeException(nameof(Foo5)); // Noncompliant\n            throw new DuplicateWaitObjectException(nameof(Foo5)); // Noncompliant\n\n            throw new ArgumentNullException(\"a\");\n            throw new ArgumentNullException(\"@a\"); // Noncompliant\n            throw new ArgumentNullException(nameof(a));\n            throw new ArgumentNullException(nameof(@a));\n            throw new ArgumentNullException(\"b\");\n            throw new ArgumentNullException(nameof(b));\n            throw new ArgumentNullException(nameof(@b));\n        }\n\n        void Foo7(int a)\n        {\n            Action<int> res =\n                i =>\n                {\n                    throw new ArgumentNullException(\"i\");\n                    // https://github.com/SonarSource/sonar-dotnet/issues/8319\n                    throw new ArgumentNullException(\"a\"); // Noncompliant FP - we are just looking at most direct parent definition\n                    throw new ArgumentOutOfRangeException(\"a\"); // Noncompliant FP\n                    throw new DuplicateWaitObjectException(\"a\"); // Noncompliant FP\n                };\n        }\n\n        void Foo8(int a)\n        {\n            Action<int, int> res =\n                (i, j) =>\n                {\n                    throw new ArgumentNullException(\"i\");\n                    // https://github.com/SonarSource/sonar-dotnet/issues/8319\n                    throw new ArgumentNullException(\"a\"); // Noncompliant FP - we are just looking at most direct parent definition\n                    throw new ArgumentOutOfRangeException(\"a\"); // Noncompliant FP\n                    throw new DuplicateWaitObjectException(\"a\"); // Noncompliant FP\n                };\n        }\n\n        void NullMessage(string item, int Length)\n        {\n            string item2;\n            throw new ArgumentOutOfRangeException(nameof(item), item, null);\n            throw new ArgumentOutOfRangeException(nameof(item2), item2, null); // Noncompliant\n            throw new ArgumentOutOfRangeException(nameof(item2.Length), Length, null); // Compliant, just weird\n        }\n\n        public int Foo9\n        {\n            get\n            {\n                throw new ArgumentNullException(\"value\"); // Noncompliant\n            }\n            set\n            {\n                throw new ArgumentNullException(\"value\"); // Compliant - value exists in property setters\n                throw new ArgumentNullException(\"foo\"); // Noncompliant\n                throw new ArgumentNullException(\"Foo9\"); // Compliant - it's a property name\n            }\n        }\n\n        public string this[int a, int b]\n        {\n            get\n            {\n                throw new ArgumentNullException(\"a\");\n                throw new ArgumentNullException(\"value\"); // Noncompliant\n            }\n            set\n            {\n                throw new ArgumentNullException(\"a\");\n                throw new ArgumentNullException(\"value\");\n            }\n        }\n\n        void ComplexCase(int a)\n        {\n            Action<int> simple = b =>\n                {\n                    Action<int, int> parenthesized = (c, d) =>\n                    {\n                        throw new ArgumentNullException(\"a\"); // Noncompliant\n                        throw new ArgumentNullException(\"b\"); // Noncompliant\n                    };\n                };\n        }\n\n        void Bar2(int a)\n        {\n            // See https://github.com/SonarSource/sonar-dotnet/issues/1867\n            throw new ArgumentNullException(null, string.Empty); // Noncompliant {{The parameter name '' is not declared in the argument list.}}\n        }\n\n        void Bar3(int a)\n        {\n            // See https://github.com/SonarSource/sonar-dotnet/issues/1867\n            throw new ArgumentNullException(\"\", string.Empty); // Noncompliant {{The parameter name '' is not declared in the argument list.}}\n        }\n\n        void Bar4(int a)\n        {\n            // See https://github.com/SonarSource/sonar-dotnet/issues/1867\n            throw new ArgumentNullException(\"   \", string.Empty); // Noncompliant {{The parameter name '   ' is not declared in the argument list.}}\n        }\n    }\n\n    class ReproForIssue2488\n    {\n        private string input;\n        public string Response\n        {\n            get => \"\";\n            set => this.input = value ?? throw new ArgumentNullException(nameof(value));\n        }\n        public string Request\n        {\n            get => this.input;\n            set => this.input = value ?? throw new ArgumentNullException(nameof(this.Request));\n        }\n\n        public string Request2\n        {\n            get => this.input;\n            set => this.input = value ?? throw new ArgumentNullException(nameof(Request2));\n        }\n    }\n\n    class ReproForIssue2469\n    {\n        public bool this[string a] => throw new ArgumentNullException(nameof(a)); // Compliant\n        public bool this[int a] => throw new ArgumentNullException(\"c\"); // Noncompliant\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/4180\n    public class Repro_4180\n    {\n        private string field = null;\n        public void Method(MissingType argument) // Error [CS0246]\n        {\n            var str = \"xxx\";\n            throw new ArgumentNullException(nameof(argument));  // Compliant. Was FP until Roslyn 3.11.0 / VS 16.10.1.\n            throw new ArgumentNullException(nameof(str));       // Noncompliant {{The parameter name 'str' is not declared in the argument list.}}\n            throw new ArgumentNullException(nameof(field));     // Noncompliant {{The parameter name 'field' is not declared in the argument list.}}\n            throw new ArgumentNullException(nameof(argument.argument)); // Compliant\n            throw new ArgumentNullException(nameof(str.argument));      // Error [CS1061] Compliant, argument is missing member without a symbol\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/4423\n    public class Repro_4423\n    {\n        public void InsideLocalFunction()\n        {\n            Something(null);\n\n            void Something(string localArg)\n            {\n                throw new ArgumentNullException(nameof(localArg));   // Compliant\n            }\n        }\n\n        public void ValidationDoneByLocalMethod(string methodArg)\n        {\n            ValidateLocal();\n\n            void ValidateLocal()\n            {\n                if (methodArg == null)\n                {\n                    throw new ArgumentNullException(nameof(methodArg)); // Noncompliant FP, we should add this specific pattern as an exception (see: https://community.sonarsource.com/t/s3928-with-local-function-false-positive-or-expected-behavior/56003)\n                }\n            }\n        }\n\n        public void LocalMethodValidatingMethodArgument(string methodArg)\n        {\n            ValidateLocal();\n            SendItToSomewhere(ValidateLocal, \"Definitely not null\"); // This scenario makes the ValidateLocal non-compliant\n\n            void ValidateLocal()\n            {\n                if (methodArg == null)\n                {\n                    throw new ArgumentNullException(nameof(methodArg));   // Noncompliant\n                }\n            }\n        }\n\n        public void SendItToSomewhere(Action a, string methodArg)\n        {\n            if(methodArg != null)\n            {\n                a(); // This would throw very confusing message: Value cannot be null. (Parameter 'methodArg')'\n            }\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/5226\n    public class Repro_5226\n    {\n        public void NamedInverted(int a)\n        {\n            throw new ArgumentOutOfRangeException(paramName: nameof(a), message: \"Sample message\");\n        }\n\n        public void NamedNotInverted(int a)\n        {\n            throw new ArgumentOutOfRangeException(message: \"Sample message\", paramName: nameof(a));\n        }\n\n        public void ShuffledPositions(int a)\n        {\n            throw new ArgumentOutOfRangeException(actualValue: nameof(a), message: \"Sample message\", paramName: \"randomString\"); // Noncompliant\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/8319\n    public class Repro_8319\n    {\n        public void Bar(int x)\n        {\n            Wrapper(() =>\n            {\n                throw new ArgumentException(\"blah\", nameof(x)); // Noncompliant FP\n            });\n        }\n\n        static void Wrapper(Action action) => action();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CheckFileLicense_CSharp9.Fixed.cs",
    "content": "﻿/*\n * <Your-Product-Name>\n * Copyright (c) <Year-From>-<Year-To> <Your-Company-Name>\n *\n * Please configure this header in your SonarCloud/SonarQube quality profile.\n * You can also set it in SonarLint.xml additional file for SonarLint or standalone NuGet analyzer.\n */\n\nusing System; // Fixed\n\nConsole.WriteLine(\"Hello, World!\");\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CheckFileLicense_CSharp9.cs",
    "content": "﻿using System; // Noncompliant\n\nConsole.WriteLine(\"Hello, World!\");\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CheckFileLicense_ComplexRegex.cs",
    "content": "﻿// <copyright file=\"ProgramHeader2.cs\" company=\"My Company Name\">\n// Copyright (c) 2012 All Rights Reserved\n// </copyright>\n// <author>Name of the Author</author>\n// <date>08/22/2017 12:39:58 AM </date>\n// <summary>Class representing a Sample entity</summary>\n\nnamespace SonarAnalyzer.Test.TestCases\n{\n    class CheckFileLicense_ComplexRegex\n    {\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CheckFileLicense_Compliant.vb",
    "content": "﻿' Copyright (c) 2018 All Rights Reserved\n\nImports System\nImports System.Collections.Generic\nImports System.Linq\nImports System.Text\n\nNamespace Tests.TestCases\n    Class Foo\n        Public Sub Test()\n\n        End Sub\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CheckFileLicense_DefaultValues.Fixed.cs",
    "content": "﻿/*\n * <Your-Product-Name>\n * Copyright (c) <Year-From>-<Year-To> <Your-Company-Name>\n *\n * Please configure this header in your SonarCloud/SonarQube quality profile.\n * You can also set it in SonarLint.xml additional file for SonarLint or standalone NuGet analyzer.\n */\n\nnamespace SonarAnalyzer.Test.TestCases // Fixed\n{\n    class Foo\n    {\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CheckFileLicense_DefaultValues.cs",
    "content": "﻿namespace SonarAnalyzer.Test.TestCases // Noncompliant\n{\n    class Foo\n    {\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CheckFileLicense_EmptyFile.cs",
    "content": "﻿"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CheckFileLicense_ForcingEmptyLinesKo.cs",
    "content": "﻿//---\n\n// Too early\nnamespace Tests.Diagnostics // Noncompliant@-3 {{Add or update the header of this file.}}\n{\n    public class Foo\n    {\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CheckFileLicense_ForcingEmptyLinesOk.cs",
    "content": "﻿//---\n\n\nnamespace Tests.Diagnostics // Compliant\n{\n    public class Foo\n    {\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CheckFileLicense_MultiLineLicenseStartWithNamespace.cs",
    "content": "﻿/*\n * SonarQube, open source software quality management tool.\n * Copyright (C) 2008-2013 SonarSource\n * mailto:contact AT sonarsource DOT com\n *\n * SonarQube is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 3 of the License, or (at your option) any later version.\n *\n * SonarQube is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this program; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\n */\nnamespace Tests.Diagnostics // Compliant\n{\n    public class Foo\n    {\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CheckFileLicense_MultiLineLicenseStartWithUsing.cs",
    "content": "﻿/*\n * SonarQube, open source software quality management tool.\n * Copyright (C) 2008-2013 SonarSource\n * mailto:contact AT sonarsource DOT com\n *\n * SonarQube is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 3 of the License, or (at your option) any later version.\n *\n * SonarQube is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this program; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\n */\nusing System; // Compliant\n\nnamespace Tests.Diagnostics\n{\n    public class UnlicensedFile\n    {\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CheckFileLicense_MultiSingleLineLicenseStartWithAdditionalComment.cs",
    "content": "﻿//-----\n// MyHeader\n//-----\n// This header does...\n\nnamespace Tests.Diagnostics // Compliant\n{\n    public class Foo\n    {\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CheckFileLicense_MultiSingleLineLicenseStartWithAdditionalCommentOnSameLine.cs",
    "content": "﻿//-----\n// MyHeader\n//----- More text on same line\nnamespace Tests.Diagnostics // Noncompliant@-3 {{Add or update the header of this file.}}\n{\n    public class Foo\n    {\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CheckFileLicense_MultiSingleLineLicenseStartWithNamespace.cs",
    "content": "﻿//-----\n// MyHeader\n//-----\nnamespace Tests.Diagnostics // Compliant\n{\n    public class Foo\n    {\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CheckFileLicense_NoLicenseStartWithNamespace.Fixed.cs",
    "content": "﻿// Copyright (c) SonarSource. All Rights Reserved. Licensed under the LGPL License.  See License.txt in the project root for license information.\nnamespace Tests.Diagnostics // Fixed\n{\n    public class Foo\n    {\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CheckFileLicense_NoLicenseStartWithNamespace.cs",
    "content": "﻿namespace Tests.Diagnostics // Noncompliant {{Add or update the header of this file.}}\n{\n    public class Foo\n    {\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CheckFileLicense_NoLicenseStartWithUsing.Fixed.cs",
    "content": "﻿// Copyright (c) SonarSource. All Rights Reserved. Licensed under the LGPL License.  See License.txt in the project root for license information.\nusing System;\n\nnamespace Tests.Diagnostics\n{\n    public class Foo\n    {\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CheckFileLicense_NoLicenseStartWithUsing.cs",
    "content": "﻿// Noncompliant {{Add or update the header of this file.}}\n\n\n\nusing System;\n\nnamespace Tests.Diagnostics\n{\n    public class Foo\n    {\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CheckFileLicense_NonCompliant.vb",
    "content": "﻿Imports System ' Noncompliant {{Add or update the header of this file.}}\nImports System.Collections.Generic\nImports System.Linq\nImports System.Text\n\nNamespace Tests.TestCases\n    Class Foo\n        Public Sub Test()\n\n\t\tEnd Sub\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CheckFileLicense_OutdatedLicenseStartWithNamespace.Fixed.cs",
    "content": "﻿/*\n * SonarQube, open source software quality management tool.\n * Copyright (C) 2008-2013 SonarSource\n * mailto:contact AT sonarsource DOT com\n *\n * SonarQube is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 3 of the License, or (at your option) any later version.\n *\n * SonarQube is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this program; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\n */\nnamespace Tests.Diagnostics // Fixed\n{\n    public class Foo\n    {\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CheckFileLicense_OutdatedLicenseStartWithNamespace.cs",
    "content": "﻿// Copyright (c) SonarSource.\n\n\n\n\n\n\n\n\n\n\n\n\nnamespace Tests.Diagnostics // Noncompliant@-13 {{Add or update the header of this file.}}\n{\n    public class Foo\n    {\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CheckFileLicense_OutdatedLicenseStartWithUsing.Fixed.cs",
    "content": "﻿/*\n * SonarQube, open source software quality management tool.\n * Copyright (C) 2008-2013 SonarSource\n * mailto:contact AT sonarsource DOT com\n *\n * SonarQube is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 3 of the License, or (at your option) any later version.\n *\n * SonarQube is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this program; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\n */\nusing System; // Fixed\n\nnamespace Tests.Diagnostics\n{\n    public class Foo\n    {\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CheckFileLicense_OutdatedLicenseStartWithUsing.cs",
    "content": "﻿// Copyright (c) SonarSource.\nusing System; // Noncompliant {{Add or update the header of this file.}}\n\nnamespace Tests.Diagnostics\n{\n    public class Foo\n    {\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CheckFileLicense_SingleLineLicenseStartWithNamespace.cs",
    "content": "﻿// Copyright (c) SonarSource. All Rights Reserved. Licensed under the LGPL License.  See License.txt in the project root for license information.\nnamespace Tests.Diagnostics // Compliant\n{\n    public class Foo\n    {\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CheckFileLicense_SingleLineLicenseStartWithUsing.cs",
    "content": "﻿// Copyright (c) SonarSource. All Rights Reserved. Licensed under the LGPL License.  See License.txt in the project root for license information.\nusing System; // Compliant\n\nnamespace Tests.Diagnostics\n{\n    public class Foo\n    {\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CheckFileLicense_YearDifference.Fixed.cs",
    "content": "﻿/*\n * SonarQube, open source software quality management tool.\n * Copyright (C) 2008-2013 SonarSource\n * mailto:contact AT sonarsource DOT com\n *\n * SonarQube is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 3 of the License, or (at your option) any later version.\n *\n * SonarQube is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this program; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\n */\nnamespace Tests.Diagnostics // Fixed\n{\n    public class Foo\n    {\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CheckFileLicense_YearDifference.cs",
    "content": "﻿/*\n * SonarQube, open source software quality management tool.\n * Copyright (C) 2008-2012 SonarSource\n * mailto:contact AT sonarsource DOT com\n *\n * SonarQube is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 3 of the License, or (at your option) any later version.\n *\n * SonarQube is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this program; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\n */\nnamespace Tests.Diagnostics // Noncompliant@-19 {{Add or update the header of this file.}}\n{\n    public class Foo\n    {\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ClassAndMethodName.MethodName.Latest.Partial.cs",
    "content": "﻿namespace CSharp14\n{\n    public partial class PartialEvents\n    {\n        public partial event System.EventHandler NonCCCOmpliant { add { } remove { } }   // Compliant\n        public partial event System.EventHandler ThisIsCompliant { add { } remove { } }  // Compliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ClassAndMethodName.MethodName.Latest.cs",
    "content": "﻿namespace CSharp9\n{\n    public interface IMyInterface\n    {\n        void foo(); // Noncompliant {{Rename method 'foo' to match pascal case naming rules, consider using 'Foo'.}}\n//           ^^^\n        void Foo();\n    }\n\n    public record FooRecord : IMyInterface\n    {\n        void a() { } // Noncompliant\n        void A() { } // Сompliant\n        void foo() { } // Noncompliant\n        void IMyInterface.foo() { } // Compliant, we can't change it\n        void Foo() { }\n        void IMyInterface.Foo() { }\n\n        void Do_Some_Test() { }\n        void Do_Some_Test_() { } // Noncompliant\n        void ____() { } // Noncompliant {{Rename method '____' to match pascal case naming rules, trim underscores from the name.}}\n\n        protected void Application_Start() { } // FN for a record\n\n        public int MyPPPProperty { get; set; } // Noncompliant {{Rename property 'MyPPPProperty' to match pascal case naming rules, consider using 'MyPppProperty'.}}\n\n        public void 你好() { }\n\n        public int ArrowedProperty2\n        {\n            get => 41;\n            init => foo();\n        }\n    }\n\n    public record PositionalRecord(string Value)\n    {\n        void a() { } // Noncompliant\n        void A() { } // Сompliant\n        void foo() { } // Noncompliant\n        void Foo() { } // Сompliant\n    }\n\n    public record Base\n    {\n        public virtual void foo() { } // Noncompliant\n    }\n    public record Derived : Base\n    {\n        public override void foo() // Compliant\n        {\n            base.foo();\n        }\n    }\n\n    public record WithLocalFunctions\n    {\n        public void Method()\n        {\n            void foo() { } // Noncompliant {{Rename local function 'foo' to match pascal case naming rules, consider using 'Foo'.}}\n\n            static void Do_Some_Test_() { } // Noncompliant {{Rename local function 'Do_Some_Test_' to match pascal case naming rules, trim underscores from the name.}}\n        }\n    }\n}\nnamespace t1\n{\n    record FSM // Noncompliant {{Rename record 'FSM' to match pascal case naming rules, consider using 'Fsm'.}}\n    {\n    }\n    record FSM2(string Param); // Noncompliant\n}\nnamespace t4\n{\n    record AbcDEFgh { } // Compliant\n    record Ab4DEFgh { } // Compliant\n    record Ab4DEFGh { } // Noncompliant\n\n    record _AbABaa { }  // Noncompliant\n\n    record 你好 { }      // Compliant\n\n    record AbcDEFgh2(string Param); // Compliant\n    record Ab4DEFgh2(string Param); // Compliant\n    record Ab4DEFGh2(string Param); // Noncompliant\n\n    record _AbABaa2(string Param);  // Noncompliant\n\n    record 你好2(string Param);      // Compliant\n}\n\nnamespace TestSuffixes\n{\n    record IEnumerableExtensionsTest { }              // Noncompliant  {{Rename record 'IEnumerableExtensionsTest' to match pascal case naming rules, consider using 'EnumerableExtensionsTest'.}}\n    record IEnumerableExtensionsTests { }             // Noncompliant\n\n    record IEnumerableExtensionsTest2(string Param);  // Noncompliant\n    record IEnumerableExtensionsTests2(string Param); // Noncompliant\n}\n\nnamespace CSharp11\n{\n    public interface IMyInterface\n    {\n        static abstract void foo(); // Noncompliant {{Rename method 'foo' to match pascal case naming rules, consider using 'Foo'.}}\n//                           ^^^\n        static abstract void Foo();\n    }\n\n    public record FooRecord : IMyInterface\n    {\n        static void IMyInterface.foo() { } // Compliant, we can't change it\n        static void IMyInterface.Foo() { }\n    }\n}\nnamespace CSharp10.t1\n{\n    record struct FSM // Noncompliant {{Rename record struct 'FSM' to match pascal case naming rules, consider using 'Fsm'.}}\n    //            ^^^\n    {\n    }\n    record struct FSM2(string Param); // Noncompliant\n}\nnamespace CSharp10.t4\n{\n    record struct AbcDEFgh { } // Compliant\n    record struct Ab4DEFgh { } // Compliant\n    record struct Ab4DEFGh { } // Noncompliant\n\n    record struct _AbABaa { }  // Noncompliant\n\n    record struct 你好 { }      // Compliant\n\n    record struct AbcDEFgh2(string Param); // Compliant\n    record struct Ab4DEFgh2(string Param); // Compliant\n    record struct Ab4DEFGh2(string Param); // Noncompliant\n\n    record struct _AbABaa2(string Param);  // Noncompliant\n\n    record struct 你好2(string Param);      // Compliant\n}\n\nnamespace CSharp10.TestSuffixes\n{\n    record struct IEnumerableExtensionsTest { }              // Noncompliant\n    record struct IEnumerableExtensionsTests { }             // Noncompliant\n\n    record struct IEnumerableExtensionsTest2(string Param);  // Noncompliant\n    record struct IEnumerableExtensionsTests2(string Param); // Noncompliant\n}\n\nnamespace CSharp13\n{\n    public partial class PartialPropertyClass\n    {\n        public partial int MyPPPProperty { get; set; } // Noncompliant {{Rename property 'MyPPPProperty' to match pascal case naming rules, consider using 'MyPppProperty'.}}\n        public partial int OtherPartialProperty { get; set; }\n    }\n\n    public partial class PartialPropertyClass\n    {\n        public partial int MyPPPProperty // Noncompliant\n        {\n            get => 42;\n            set { }\n        }\n        public partial int OtherPartialProperty // Compliant\n        {\n            get => 42;\n            set { }\n        }\n    }\n}\n\nnamespace CSharp14\n{\n    public static class Extensions\n    {\n        extension(int number)\n\n        {\n            public static bool NonCCCOmpliant() => false;   // Noncompliant\n            public static bool ThisIsCompliant() => true;   // Compliant\n\n            public static bool NonCCCOmpliantProp => false; // Noncompliant\n            public static bool ThisIsCompliantProp => true; // Compliant\n        }\n    }\n\n    public class Events\n    {\n        public event System.EventHandler NonCCCOmpliant;    // Compliant FN\n        public event System.EventHandler ThisIsCompliant;   // Compliant\n    }\n\n    public partial class PartialEvents\n    {\n        public partial event System.EventHandler NonCCCOmpliant;  // Compliant\n        public partial event System.EventHandler ThisIsCompliant; // Compliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ClassAndMethodName.MethodName.Partial.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace Tests.Diagnostics\n{\n    public partial class SomeClass\n    {\n        partial void MY_METHOD();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ClassAndMethodName.MethodName.cs",
    "content": "﻿namespace Tests.Diagnostics\n{\n    public interface IMyInterface\n    {\n        void foo(); // Noncompliant {{Rename method 'foo' to match pascal case naming rules, consider using 'Foo'.}}\n//           ^^^\n        void Foo();\n    }\n\n    public class FooClass : IMyInterface\n    {\n        void a() { } // Noncompliant\n        void A() { } // Compliant\n        void foo() { } // Noncompliant\n        void IMyInterface.foo() { } // Compliant, we can't change it\n        void Foo() { }\n        void IMyInterface.Foo() { }\n\n        void\n        bar() // Noncompliant\n        { }\n\n        public event MyEventHandler foo_bar;\n        public delegate void MyEventHandler();\n\n        void Do_Some_Test() { }\n        void Do_Some_Test_() { } // Noncompliant\n        void ____() { } // Noncompliant {{Rename method '____' to match pascal case naming rules, trim underscores from the name.}}\n        protected void Application_Start() { }\n\n        [System.Runtime.InteropServices.DllImport(\"User32.dll\")]\n        public static extern int ____MessageBox(int h, string m, string c, int type); // Compliant\n\n        public int MyPPPProperty { get; set; } // Noncompliant {{Rename property 'MyPPPProperty' to match pascal case naming rules, consider using 'MyPppProperty'.}}\n\n        public void Should_define_convention_that_returns_metadata_module_type() { } // Compliant\n\n        public void Should_Define_Convention_That_Returns_Metadata_Module_Type() { } // Compliant\n\n        public void Should_return_JSON_serialized_querystring() { } // Compliant\n\n        public void IsLocal_should_return_true_if_userHostAddr_is_localhost_IPV4() { } // Compliant\n\n        public void 你好() { }\n\n        public void Łódź() { }\n\n        public int ArrowedMethod() => 42;\n\n        public int ArrowedProperty1 => 42;\n\n        public int ArrowedProperty2\n        {\n            get => 41;\n            set => bar();\n        }\n    }\n\n    [System.Runtime.InteropServices.ComImport(),\n     System.Runtime.InteropServices.Guid(\"00000000-0000-0000-0000-000000000001\")]\n    public abstract class MMMM\n    {\n        public abstract void MMMMMethod(); // Compliant\n    }\n\n    public class Base\n    {\n        public virtual void foo() { } // Noncompliant\n    }\n    public class Derived : Base\n    {\n        public override void foo() // Compliant\n        {\n            base.foo();\n        }\n    }\n\n    public partial class SomeClass\n    {\n        partial void MY_METHOD()\n        {\n        }\n    }\n\n    // See https://github.com/SonarSource/sonar-dotnet/issues/2290\n    public class AllowTwoLettersAcronyms\n    {\n        public void IOStream() { }\n        public void AddUIIntegrationTypes() { }\n        public void MyEOF() { } // Noncompliant\n        public void MyEOFile() { }\n    }\n\n    public class WithLocalFunctions\n    {\n        public void Method()\n        {\n            void foo() { } // Noncompliant {{Rename local function 'foo' to match pascal case naming rules, consider using 'Foo'.}}\n\n            static void Do_Some_Test_() { } // Noncompliant {{Rename local function 'Do_Some_Test_' to match pascal case naming rules, trim underscores from the name.}}\n        }\n    }\n\n    public class Invalid\n    {\n        public int () => 42; // Error [CS1519,CS8124,CS1519]\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ClassAndMethodName.Partial.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace Tests.Diagnostics\n{\n    public partial class ELN { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ClassAndMethodName.Tests.cs",
    "content": "﻿interface I_Foo { }\ninterface I_I_Foo { }\n\ninterface i_foo { } // Noncompliant {{Rename interface 'i_foo' to match pascal case naming rules, consider using 'II_Foo'.}}\n\nclass Ab_Cd_Ef { }\nclass Foo_2 { }\n\nclass IFoo_2 { } // Noncompliant {{Rename class 'IFoo_2' to match pascal case naming rules, consider using 'Foo_2'.}}\nclass _Foo { } // Noncompliant {{Rename class '_Foo' to match pascal case naming rules, trim underscores from the name.}}\nclass Foo_ { } // Noncompliant {{Rename class 'Foo_' to match pascal case naming rules, trim underscores from the name.}}\n\nclass myClass_bar // Noncompliant {{Rename class 'myClass_bar' to match pascal case naming rules, consider using 'MyClass_Bar'.}}\n{\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ClassAndMethodName.TopLevelStatement.Test.cs",
    "content": "﻿using System;\nConsole.WriteLine(\"\");\n\nclass Foo_Bar { }\nclass inner_class { } // Noncompliant {{Rename class 'inner_class' to match pascal case naming rules, consider using 'Inner_Class'.}}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ClassAndMethodName.TopLevelStatement.cs",
    "content": "﻿using System;\n\nConsole.WriteLine(\"Hello, World!\");\n\nclass InnerClass { }\n\nclass inner_class { } // Noncompliant {{Rename class 'inner_class' to match pascal case naming rules, consider using 'Innerclass'.}}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ClassAndMethodName.cs",
    "content": "﻿using System;\nusing System.Runtime.InteropServices;\n\nnamespace t1\n{\n    class FSM // Noncompliant {{Rename class 'FSM' to match pascal case naming rules, consider using 'Fsm'.}}\n//        ^^^\n    {\n    }\n\n    static class IEnumerableExtensions // Compliant\n    {\n    }\n\n    class foo // Noncompliant {{Rename class 'foo' to match pascal case naming rules, consider using 'Foo'.}}\n    {\n    }\n}\nnamespace t2\n{\n    interface foo // Noncompliant {{Rename interface 'foo' to match pascal case naming rules, consider using 'IFoo'.}}\n    {\n    }\n\n    interface Foo // Noncompliant  {{Rename interface 'Foo' to match pascal case naming rules, consider using 'IFoo'.}}\n    {\n    }\n\n    interface IFoo\n    {\n    }\n\n    interface IIFoo\n    {\n    }\n\n    interface I\n    {\n    }\n\n    interface II\n    {\n    }\n\n    interface IIIFoo // Compliant\n    {\n    }\n\n    interface IWithDefaultMembers\n    {\n        public void foo() { } // Noncompliant {{Rename method 'foo' to match pascal case naming rules, consider using 'Foo'.}}\n    }\n}\nnamespace t3\n{\n    partial class Foo\n    {\n    }\n\n    class MyClass\n    {\n        class I\n        {\n        }\n    }\n\n    class IFoo2 // Noncompliant {{Rename class 'IFoo2' to match pascal case naming rules, consider using 'Foo2'.}}\n    {\n    }\n\n    class Foo_2 { } // Noncompliant {{Rename class 'Foo_2' to match pascal case naming rules, consider using 'Foo2'.}}\n\n    class Iden42TityFoo\n    {\n    }\n\n    partial class\n    Foo\n    {\n    }\n\n    partial class\n    AbClass_Bar // Noncompliant {{Rename class 'AbClass_Bar' to match pascal case naming rules, consider using 'AbClassBar'.}}\n    {\n    }\n\n    struct ILMarker // Compliant\n    {\n\n    }\n\n    [System.Runtime.InteropServices.ComImport(),\n     System.Runtime.InteropServices.Guid(\"00000000-0000-0000-0000-000000000001\")]\n    internal interface SVsLog  // Compliant\n    {\n    }\n\n    class IILMarker { } // Noncompliant {{Rename class 'IILMarker' to match pascal case naming rules, consider using 'IilMarker'.}}\n}\nnamespace t4\n{\n    interface IILMarker { } // Compliant\n\n    interface ITVImageScraper { }\n\n    class A4 { }\n    class AA4 { }\n\n    class AbcDEFgh { } // Compliant\n    class Ab4DEFgh { } // Compliant\n    class Ab4DEFGh { } // Noncompliant {{Rename class 'Ab4DEFGh' to match pascal case naming rules, consider using 'Ab4DefGh'.}}\n\n    class TTTestClassTTT { }// Noncompliant {{Rename class 'TTTestClassTTT' to match pascal case naming rules, consider using 'TtTestClassTtt'.}}\n    class TTT44 { }// Noncompliant\n    class ABCDEFGHIJK { }// Noncompliant\n    class Abcd4a { }// Noncompliant\n\n    class A_B_C { } // Noncompliant\n\n    class AB { } // Compliant\n    class AbABaa { } // Compliant\n    class _AbABaa { } // Noncompliant {{Rename class '_AbABaa' to match pascal case naming rules, trim underscores from the name.}}\n    class AbABaa_ { } // Noncompliant {{Rename class 'AbABaa_' to match pascal case naming rules, trim underscores from the name.}}\n\n    class 你好 { } // Compliant\n}\n\nnamespace Tests.Diagnostics\n{\n    public partial class ELN { } // Compliant because the other subpart is generated\n}\n\nnamespace AnotherNamespace\n{\n    class IOStream { }\n    class MyIOStream { }\n    class AddUIIntegration { }\n    class TokenEOF { } // Noncompliant - 3 upper case letters\n    class EOFile { }  // Compliant because 2 upper case letters + 1 for the next word\n}\n\nnamespace TestSuffixes\n{\n    // https://github.com/SonarSource/sonar-dotnet/issues/3268\n    class IEnumerableExtensionsTest { } // Compliant, classes ending with \"Test\" or \"Tests\" should not be reported\n    class IEnumerableExtensionsTests { } // Compliant, classes ending with \"Test\" or \"Tests\" should not be reported\n\n    struct IStructTest { } // Noncompliant, structs are not considered as test classes\n    struct IStructTests { } // Noncompliant, structs are not considered as test classes\n\n    interface BadPrefixTest { } // Noncompliant, interfaces are not considered as test classes\n    interface BadPrefixTests { } // Noncompliant, interfaces are not considered as test classes\n\n    class _UnderscoreTest { } // Noncompliant, even when ending with Test\n    class _UnderscoreTests { } // Noncompliant, even when ending with Tests\n\n    class NormalTest { }\n    class NormalTests { }\n\n    class IMassiveProtest { } // Noncompliant, this doesn't count as Test class\n    class IMassiveProtests { } // Noncompliant, this doesn't count as Test class\n\n    class IEnumerableTEST { } // Noncompliant, this doesn't count as Test class\n    class IEnumerableTESTS { } // Noncompliant, this doesn't count as Test class\n    class IEnumerableTestS { } // Noncompliant, this doesn't count as Test class (upper S sufix)\n\n    class ITest { } // Noncompliant, this doesn't count as Test class\n    class ITests { } // Noncompliant, this doesn't count as Test class\n\n    class IfTest { }\n    class IfTests { }\n\n    class XTest { }\n    class XTests { }\n}\n\nnamespace FPRepros\n{\n    // https://github.com/SonarSource/sonar-dotnet/issues/4086\n    public class StructWithDllImportRepro\n    {\n        [DllImport(\"kernel32.dll\", SetLastError = true, ExactSpelling = true)]\n        private static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, out IMAGE_NT_HEADERS32 lpBuffer, int nSize, IntPtr lpNumberOfBytesRead);\n\n        [StructLayout(LayoutKind.Sequential)]\n        public struct IMAGE_NT_HEADERS32 // Noncompliant FP\n        {\n            public UInt32 Signature;\n            public static int SizeOf = Marshal.SizeOf(typeof(IMAGE_NT_HEADERS32));\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/7238\n    public class B2b // Noncompliant {{Rename class 'B2b' to match pascal case naming rules, consider using 'B2B'.}}\n    { }\n\n    public class B2bSomethingCalculator // Noncompliant FP\n    { }\n\n    public class L10nService // Noncompliant FP\n    { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ClassAndMethodName.vb",
    "content": "﻿Namespace Tests.Diagnostics\n    Public Class myClassName ' Noncompliant {{Rename this class to match the regular expression: '^([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?$'.}}\n'                ^^^^^^^^^^^\n    End Class\n\n    Public Class [myClassName1] ' Noncompliant\n'                ^^^^^^^^^^^^^^\n    End Class\n\n    Public Class [my_Class_Name1] ' Noncompliant\n'                ^^^^^^^^^^^^^^^^\n    End Class\n\n    Class MyClassName2\n\n    End Class\n\n    Public Structure myStructName ' Compliant\n    End Structure\n\n    Public Interface myInterfaceName ' Compliant\n    End Interface\n\n    Public Module myModuleName ' Compliant\n    End Module\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ClassNamedException.Interop.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.Serialization;\nusing System;\n\nclass UnamanagedException: System.Runtime.InteropServices._Exception // Compliant - allows access to System.Exception members from unmanaged code\n{\n    public string Message => \"\";\n    public string StackTrace => \"\";\n    public string HelpLink { get => \"\"; set => _ = value; }\n    public string Source { get => \"\"; set => _ = value; }\n    public Exception InnerException => null;\n    public MethodBase TargetSite => null;\n    public Exception GetBaseException() => null;\n\n    public void GetObjectData(SerializationInfo info, StreamingContext context)\n    {\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ClassNamedException.Interop.vb",
    "content": "﻿Imports System\nImports System.Reflection\nImports System.Runtime.InteropServices\nImports System.Runtime.Serialization\n\nClass UnamangedException ' Compliant - allows access to System.Exception members from unmanaged code\n    Implements System.Runtime.InteropServices._Exception\n\n    Public ReadOnly Property Message As String Implements _Exception.Message\n        Get\n            Return \"\"\n        End Get\n    End Property\n\n    Public ReadOnly Property StackTrace As String Implements _Exception.StackTrace\n        Get\n            Return \"\"\n        End Get\n    End Property\n\n    Public Property HelpLink As String Implements _Exception.HelpLink\n        Get\n            Return \"\"\n        End Get\n        Set(value As String)\n        End Set\n    End Property\n\n    Public Property Source As String Implements _Exception.Source\n        Get\n            Return \"\"\n        End Get\n        Set(value As String)\n        End Set\n    End Property\n\n    Public ReadOnly Property InnerException As Exception Implements _Exception.InnerException\n        Get\n            Return Nothing\n        End Get\n    End Property\n\n    Public ReadOnly Property TargetSite As MethodBase Implements _Exception.TargetSite\n        Get\n            Return Nothing\n        End Get\n    End Property\n\n    Public Sub GetObjectData(info As SerializationInfo, context As StreamingContext) Implements _Exception.GetObjectData\n    End Sub\n\n    Public Function GetBaseException() As Exception Implements _Exception.GetBaseException\n        Return Nothing\n    End Function\n\n    Private Function _Exception_ToString() As String Implements _Exception.ToString\n        Return \"\"\n    End Function\n\n    Private Function _Exception_Equals(obj As Object) As Boolean Implements _Exception.Equals\n        Return False\n    End Function\n\n    Private Function _Exception_GetHashCode() As Integer Implements _Exception.GetHashCode\n        Return 0\n    End Function\n\n    Private Function _Exception_GetType() As Type Implements _Exception.GetType\n        Return Nothing\n    End Function\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ClassNamedException.Latest.cs",
    "content": "﻿record RecordException { } // Compliant - records cannot inherit from Exception, and this rule only deals with regular classes\nrecord struct RecordStructException { } // Compliant - records cannot inherit from Exception, and this rule only deals with regular classes\nrecord class RecordClassException { }   // Compliant - records cannot inherit from Exception, and this rule only deals with regular classes\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ClassNamedException.cs",
    "content": "﻿using System;\n\nclass CustomException { }                                        // Noncompliant {{Rename this class to remove \"Exception\" or correct its inheritance.}}\n//    ^^^^^^^^^^^^^^^\nclass Customexception { }                                        // Noncompliant\nclass CustomEXCEPTION { }                                        // Noncompliant\n\nclass ExceptionHandler { }                                       // Compliant - \"Exception\" is not at end of the name of the class\nclass SimpleExceptionClass { }\nclass SimpleClass { }\n\nclass OuterClass\n{\n    class InnerException { }                                     // Noncompliant\n}\n\nclass GenericClassDoesNotExtendException<T> { }                  // Noncompliant\n//    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nclass GenericClassExtendsException<T> : Exception { }            // Compliant\nclass SimpleGenericClass<T> { }                                  // Compliant - \"Exception\" is not in the name of the class\n\ninterface IEmptyInterfaceException { }                           // Compliant - interfaces cannot inherit from Exception\nstruct StructException { }                                       // Compliant - structs cannot inherit from Exception\nenum EnumException { }                                           // Compliant - enums cannot inherit from Exception\n\nclass ExtendsException: Exception { }                            // Compliant - direct subclass of Exception\nclass AlsoExtendsIt : Exception { }                              // Compliant - it'd be better to have \"Exception\" at the end, but this rule doesn't deal with that\nclass ImplementsAnInterfaceAndExtendsException:\n    Exception, IEmptyInterfaceException { }\nclass ExtendsNullReferenceException : NullReferenceException { } // Compliant - indirect subclass of Exception\n\nclass ExtendsCustomException: CustomException { }                // Noncompliant - CustomException is not an Exception subclass\n\npartial class PartialClassDoesNotExtendException { }             // Noncompliant\n\npartial class PartialClassExtendsException { }                   // Compliant - the other part of the class extends Exception\npartial class PartialClassExtendsException: Exception { }\n\nstatic class StaticException { }                                 // Noncompliant - the static class should be renamed, as it cannot inherit from Exception\n\nclass { }                                                        // Error [CS1001]\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ClassNamedException.vb",
    "content": "﻿Imports System\n\nClass CustomException                            ' Noncompliant {{Rename this class to remove \"Exception\" or correct its inheritance.}}\n    ' ^^^^^^^^^^^^^^^\nEnd Class\n\nClass ExceptionHandler                           ' Compliant - \"Exception\" is not at end of the name of the class\nEnd Class\n\nClass SimpleExceptionClass\nEnd Class\n\nClass SimpleClass\nEnd Class\n\nClass SimpleException\n    Inherits Exception\nEnd Class\n\nClass OuterClass\n    Class InnerException                         ' Noncompliant\n    End Class\nEnd Class\n\nClass GenericClassDoesNotExtendException(Of T)   ' Noncompliant\n    ' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nEnd Class\n\nClass GenericClassExtendsException(Of T)         ' Compliant\n    Inherits Exception\nEnd Class\n\nClass SimpleGenericClass(Of T)                   ' Compliant - \"Exception\" is not in the name of the class\nEnd Class\n\nInterface IEmptyInterfaceException               ' Compliant - interfaces cannot inherit from Exception\nEnd Interface\n\nStructure StructException                        ' Compliant - structures cannot inherit from Exception\nEnd Structure\n\nEnum EnumException                               ' Compliant - enums cannot inherit from Exception\n    EnumMember\nEnd Enum\n\nClass ExtendsException                           ' Compliant - direct subclass of Exception\n    Inherits Exception\nEnd Class\n\nClass AlsoExtendsIt                              ' Compliant - it'd be better to have \"Exception\" at the end, but this rule doesn't deal with that\n    Inherits Exception\nEnd Class\n\nClass ImplementsAnInterfaceAndExtendsException\n    Inherits Exception\n    Implements IEmptyInterfaceException\nEnd Class\n\nClass ExtendsNullReferenceException              ' Compliant - indirect subclass of Exception\n    Inherits NullReferenceException\nEnd Class\n\nClass ExtendsCustomException                     ' Noncompliant - CustomException is not an Exception subclass\n    Inherits CustomException\nEnd Class\n\nPartial Class PartialClassDoesNotExtendException ' Noncompliant\nEnd Class\n\nPartial Class PartialClassExtendsException       ' Compliant - the other part of the class extends Exception\nEnd Class\n\nPartial Class PartialClassExtendsException\n    Inherits Exception\nEnd Class\n\nModule StaticException                           ' Noncompliant - the module should be renamed, as it cannot inherit from Exception\nEnd Module\n\nModule                                           ' Error [BC30179,BC30203]\nEnd Module\n\nClass                                            ' Error [BC30179,BC30203]\nEnd Class\n\n\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ClassNotInstantiatable.Latest.Partial.cs",
    "content": "﻿namespace CSharp14\n{\n    partial class PartialPublicConstructor\n    {\n        public partial PartialPublicConstructor() { }\n    }\n\n    partial class PartialPrivateConstructor // Noncompliant\n    {\n        private partial PartialPrivateConstructor() { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ClassNotInstantiatable.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\n\nnamespace CSharp9\n{\n    public record Person(string FirstName, string LastName); // Compliant\n\n    public record EmptyRecord { } // Compliant\n\n    public record Person1 // Noncompliant {{This record can't be instantiated; make its constructor 'public'.}}\n    {\n        public string FirstName { get; }\n\n        private Person1() { }\n    }\n\n    public record Person2 // Noncompliant {{This record can't be instantiated; make at least one of its constructors 'public'.}}\n    {\n        public string FirstName { get; }\n\n        private Person2() { }\n        private Person2(string first) => FirstName = first;\n    }\n\n    public sealed record Person3 // Compliant\n    {\n        public string FirstName { get; init; }\n\n        private Person3() { }\n        public static Person3 Instance => new Person3();\n    }\n\n    public record Person4(string FirstName) // Compliant\n    {\n        private Person4() : this(\"\") { }\n    }\n\n    public record Person5(string FirstName) // Compliant\n    {\n        public Person5() : this(\"\") { }\n    }\n\n    public record StaticUsage // Noncompliant\n    {\n        private StaticUsage() { }\n        public static void M() { }\n    }\n\n    public record OuterRecord // Compliant\n    {\n        private OuterRecord() { }\n\n        public record Intermediate\n        {\n            public record Nested : OuterRecord // Noncompliant\n            {\n                private Nested() { }\n            }\n        }\n    }\n\n    public record MyGenericRecord<T>\n    {\n        private MyGenericRecord() { }\n        public record Nested : MyGenericRecord<int> { }\n    }\n\n    public class MyGenericRecord2<T>\n    {\n        private MyGenericRecord2() { }\n        public object Create() => new MyGenericRecord2<int>();\n    }\n\n    public class MyAttribute : System.Attribute { }\n\n    [My]\n    public record WithAttribute1\n    {\n        private WithAttribute1() { }\n    }\n\n    public record WithAttribute2\n    {\n        [My]\n        private WithAttribute2() { }\n    }\n\n    public class Foo\n    {\n        public static readonly Foo Instance = new();\n\n        public bool IsActive => true;\n\n        private Foo() { }\n    }\n\n    public class Baz { }\n\n    public class Bar  // Noncompliant\n    {\n        public static readonly Baz Instance = new();\n\n        public bool IsActive => true;\n\n        private Bar() { }\n    }\n}\n\nnamespace CSharp11\n{\n    file record Person(string FirstName, string LastName); // Compliant\n\n    file record Person1 // Noncompliant {{This record can't be instantiated; make its constructor 'public'.}}\n    {\n        public string FirstName { get; }\n        private Person1() { }\n    }\n\n    file class Baz { }\n\n    file class Bar  // Noncompliant\n    {\n        private Bar() { }\n    }\n}\n\nnamespace CSharp14\n{\n    partial class PartialPublicConstructor\n    {\n        public partial PartialPublicConstructor();\n    }\n\n    partial class PartialPrivateConstructor // Noncompliant {{This class can't be instantiated; make its constructor 'public'.}}\n    {\n        private partial PartialPrivateConstructor();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ClassNotInstantiatable.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\n\nnamespace Tests.Diagnostics\n{\n    public class Class0\n    {\n        public void M() { }\n    }\n\n    public class Class1 // Noncompliant {{This class can't be instantiated; make its constructor 'public'.}}\n//               ^^^^^^\n    {\n        private Class1() { }\n    }\n    public sealed class Class1b // Noncompliant {{This class can't be instantiated; make at least one of its constructors 'public'.}}\n    {\n        private Class1b() { }\n        private Class1b(int i) { }\n        public void M() { }\n    }\n\n    public class Class2 // Compliant, suggested solution of S1118\n    {\n        private Class2() { }\n\n        public static void M() { }\n    }\n\n    public sealed class Class3 // Compliant\n    {\n        private Class3() { }\n\n        public void M() { }\n        public static Class3 instance => new Class3();\n    }\n\n    public sealed class Class4 // Compliant\n    {\n        public void M() { }\n    }\n\n    public class Class6 // Compliant\n    {\n        private Class6() { }\n\n        public class Intermediate\n        {\n            public class Nested : Class6 // Noncompliant\n            {\n                private Nested()\n                {\n\n                }\n            }\n        }\n    }\n\n    public sealed class Class7 // Noncompliant\n    {\n        private Class7() { }\n\n        public void M() { }\n        public static Class0 instance => new Class0();\n    }\n\n    public class MyClassGeneric<T>\n    {\n        private MyClassGeneric()\n        {\n\n        }\n        public class Nested : MyClassGeneric<int> { }\n    }\n\n    public class MyClassGeneric2<T>\n    {\n        private MyClassGeneric2()\n        {\n\n        }\n        public object Create()\n        {\n            return new MyClassGeneric2<int>();\n        }\n    }\n\n    public class MyAttribute : System.Attribute { }\n\n    [My]\n    public class WithAttribute1\n    {\n        private WithAttribute1()\n        {\n        }\n    }\n\n    public class WithAttribute2\n    {\n        [My]\n        private WithAttribute2()\n        {\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/3329\n    public class Repro_3329 : System.Runtime.InteropServices.SafeHandle // Compliant, instance will be created by PInvoke of DllImport\n    {\n        private Repro_3329() : base(IntPtr.Zero, true) { }\n\n        protected override bool ReleaseHandle() => true;\n        public override bool IsInvalid => true;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ClassNotInstantiatable.vb",
    "content": "﻿Imports System.Collections.Generic\nImports System.Linq\nImports System.Threading.Tasks\n\nNamespace Tests.Diagnostics\n    Public Class Class0\n        Public Sub M()\n        End Sub\n    End Class\n\n    Public Class Class1 ' Noncompliant {{This class can't be instantiated; make its constructor 'public'.}}\n'                ^^^^^^\n        Private Sub New()\n        End Sub\n    End Class\n\n    Public NotInheritable Class Class1b ' Noncompliant {{This class can't be instantiated; make at least one of its constructors 'public'.}}\n        Private Sub New()\n        End Sub\n\n        Private Sub New(ByVal i As Integer)\n        End Sub\n\n        Public Sub M()\n        End Sub\n    End Class\n\n    Public Class Class2 ' Compliant, suggested solution of S1118\n        Private Sub New()\n        End Sub\n\n        Public Shared Sub M()\n        End Sub\n    End Class\n\n    Public NotInheritable Class Class3 ' Compliant\n        Private Sub New()\n        End Sub\n\n        Public Sub M()\n        End Sub\n\n        Public Shared ReadOnly Property instance As Class3\n            Get\n                Return New Class3()\n            End Get\n        End Property\n    End Class\n\n    Public NotInheritable Class Class4 ' Compliant\n        Public Sub M()\n        End Sub\n    End Class\n\n    Public Class Class6 ' Compliant\n        Private Sub New()\n        End Sub\n\n        Public Class Intermediate\n            Public Class Nested ' Noncompliant\n                Inherits Class6\n\n                Private Sub New()\n                End Sub\n            End Class\n        End Class\n    End Class\n\n    Public Class MyClassGeneric(Of T)\n        Private Sub New()\n        End Sub\n\n        Public Class Nested\n            Inherits MyClassGeneric(Of Integer)\n        End Class\n    End Class\n\n    Public Class MyClassGeneric2(Of T)\n        Private Sub New()\n        End Sub\n\n        Public Function Create() As Object\n            Return New MyClassGeneric2(Of Integer)()\n        End Function\n    End Class\n\n    Public Class MyAttribute\n        Inherits System.Attribute\n    End Class\n\n    <My>\n    Public Class WithAttribute1\n        Private Sub New()\n        End Sub\n    End Class\n\n    Public Class WithAttribute2\n        <My>\n        Private Sub New()\n        End Sub\n    End Class\n\n    ' https//github.com/SonarSource/sonar-dotnet/issues/3329\n    Public Class Repro_3329 ' Compliant, instance will be created by PInvoke of DllImport\n        Inherits System.Runtime.InteropServices.SafeHandle\n\n        Private Sub New()\n            MyBase.New(System.IntPtr.Zero, True)\n        End Sub\n\n        Public Overrides ReadOnly Property IsInvalid As Boolean\n            Get\n            End Get\n        End Property\n\n        Protected Overrides Function ReleaseHandle() As Boolean\n        End Function\n\n    End Class\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ClassShouldNotBeEmpty.Inheritance.cs",
    "content": "﻿using Microsoft.AspNetCore.Mvc;\nusing Microsoft.AspNetCore.Mvc.RazorPages;\nusing System;\n\nnamespace Compliant\n{\n    class DefaultImplementation : AbstractBaseWithoutAbstractMethods { } // Compliant - the class will use the default implementation of DefaultMethod\n    class CustomException : Exception { }                                // Compliant - empty exception classes are allowed, the name of the class already provides information\n    class CustomAttribute : Attribute { }                                // Compliant - empty attribute classes are allowed, the name of the class already provides information\n    class EmptyPageModel : PageModel { }                                 // Compliant - an empty PageModel can be fully functional, the C# code can be in the cshtml file\n    class CustomActionResult : ActionResult { }                          // Compliant - an empty action result can still provide information by its name\n}\n\nnamespace NonCompliant\n{\n    class SubClass : BaseClass { }                                       // Noncompliant - not derived from any special base class\n}\n\nnamespace Ignore\n{\n    class NoImplementation : AbstractBaseWithAbstractMethods { }         // Error [CS0534]- abstract methods should be implemented\n}\n\nclass BaseClass\n{\n    int Prop => 42;\n}\n\nabstract class AbstractBaseWithAbstractMethods\n{\n    public abstract void AbstractMethod();\n}\n\nabstract class AbstractBaseWithoutAbstractMethods\n{\n    public virtual void DefaultMethod() { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ClassShouldNotBeEmpty.Inheritance.vb",
    "content": "﻿Imports Microsoft.AspNetCore.Mvc\nImports Microsoft.AspNetCore.Mvc.RazorPages\nImports System\n\nNamespace Compliant\n\n    Class DefaultImplementation         ' Compliant - the class will use the default implementation of DefaultMethod\n        Inherits AbstractBaseWithoutAbstractMethods\n    End Class\n\n    Public Class CustomException        ' Compliant - empty exception classes are allowed, the name of the class already provides information\n        Inherits Exception\n    End Class\n\n    Public Class CustomAttribute        ' Compliant - empty attribute classes are allowed, the name of the class already provides information\n        Inherits Exception\n    End Class\n\n    Public Class EmptyPageModel         ' Compliant - an empty PageModel can be fully functional, the VB code can be in the vbhtml file\n        Inherits PageModel\n    End Class\n\n    Public Class CustomActionResult     ' Compliant - an empty action result can still provide information by its name\n        Inherits ActionResult\n    End Class\n\nEnd Namespace\n\nNamespace NonComplaint\n\n    Public Class SubClass               ' Noncompliant - not derived from any special base class\n        Inherits BaseClass\n    End Class\n\nEnd Namespace\n\nNamespace Ignore\n\n    Class NoImplementation              ' Error [BC30610]- abstract methods should be implemented\n        Inherits AbstractBaseWithAbstractMethods\n    End Class\n\nEnd Namespace\n\nPublic Class BaseClass\n    Private ReadOnly Property Prop As Integer\n        Get\n            Return 42\n        End Get\n    End Property\nEnd Class\n\nMustInherit Class AbstractBaseWithAbstractMethods\n    Public MustOverride Sub AbstractMethod()\nEnd Class\n\nMustInherit Class AbstractBaseWithoutAbstractMethods\n    Public Overridable Sub DefaultMethod()\n    End Sub\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ClassShouldNotBeEmpty.Latest.Partial.cs",
    "content": "﻿using System;\n\npublic partial class PartialConstructor\n{\n    public partial PartialConstructor() { }\n}\n\npublic partial class PartialEvent\n{\n    public partial event EventHandler MyEvent { add { } remove { }  }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ClassShouldNotBeEmpty.Latest.cs",
    "content": "﻿using System;\n\nnamespace Compliant\n{\n    record RecordWithParameters(int Parameter);\n\n    record RecordWithProperty\n    {\n        int SomeProperty => 42;\n    }\n\n    record RecordWithField\n    {\n        int SomeField = 42;\n    }\n    record RecordWithMethod\n    {\n        void Method() { }\n    }\n    record RecordWithMethodOverride\n    {\n        public override string ToString() => \"\";\n    }\n    record RecordWithIndexer\n    {\n        int this[int index] => 42;\n    }\n    record RecordWithDelegate\n    {\n        delegate void MethodDelegate();\n    }\n    record RecordWithEvent\n    {\n        event EventHandler CustomEvent;\n    }\n\n    record NotEmptyGenericRecord<T>(T RecordMember);\n\n    record NotEmptyGenericRecordWithContraint<T>(T RecordMember) where T : class;\n\n    record EmptyRecordProvidingParameterToBase() : RecordWithParameters(42);\n}\n\nnamespace Noncompliant\n{\n    record EmptyRecord();                                        // Noncompliant {{Remove this empty record, write its code or make it an \"interface\".}}\n    //     ^^^^^^^^^^^\n    record EmptyRecordWithEmptyBody() { };                       // Noncompliant\n\n    record EmptyChildWithoutBrackets : EmptyRecord;              // Noncompliant\n\n    record EmptyChildRecord() : EmptyRecord();                   // Noncompliant\n\n    record EmptyGenericRecord<T>();                              // Noncompliant\n    //     ^^^^^^^^^^^^^^^^^^\n    record EmptyGenericRecordWithContraint<T>() where T : class; // Noncompliant\n\n    record ConstructorIsPublicAlready : EmptyRecord { }          // Noncompliant\n\n    record BaseRecordWithProtectedConstructor\n    {\n        protected BaseRecordWithProtectedConstructor() { }\n    }\n\n    record WidensConstructorVisibility : BaseRecordWithProtectedConstructor { } // Compliant\n}\n\nnamespace Ignore\n{\n    partial record EmptyPartialRecord(); // Compliant - partial classes are ignored, so partial record classes are ignored as well\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/7709\nnamespace Repro_7709\n{\n    interface IMarker { }\n    record ImplementsMarker : IMarker { }\n    record ImplementsEmptyRecordAndMarker : Noncompliant.EmptyRecord, IMarker { }\n}\n\nnamespace Compliant\n{\n    record class NotEmptyRecordClass1(int RecordMember);\n    record class NotEmptyRecordClass2()\n    {\n        int RecordMember => 42;\n    };\n}\nnamespace NonCompliant\n{\n\n    record class EmptyRecordClass();                           // Noncompliant {{Remove this empty record, write its code or make it an \"interface\".}}\n    //           ^^^^^^^^^^^^^^^^\n    record class EmptyRecordClassWithEmptyBody() { };          // Noncompliant\n\n    record class EmptyChildWithoutBrackets : EmptyRecordClass; // Noncompliant\n}\nnamespace Ignored\n{\n    record struct EmptyRecordStruct();                  // Compliant - this rule only deals with classes\n    record struct EmptyRecordStructWithEmptyBody() { }; // Compliant - this rule only deals with classes\n}\n\nnamespace Compliant\n{\n    class ChildClass() : BaseClass(42) { } // Compliant\n\n    class ChildClassWithParameters(int value) : BaseClass(value) { } // Compliant\n\n    class BaseClass(int value) { }\n}\n\nnamespace Noncompliant\n{\n    class ChildClass() : BaseClass() { } // Noncompliant\n\n    class BaseClass()\n    {\n        public int Value { get; init; }\n    }\n}\n\npublic partial class PartialConstructor\n{\n    public partial PartialConstructor();\n}\n\npublic partial class PartialEvent\n{\n    public partial event EventHandler MyEvent;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ClassShouldNotBeEmpty.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\n\nnamespace Compliant\n{\n    class ClassWithProperty\n    {\n        int SomeProperty => 42;\n    }\n    class ClassWithField\n    {\n        int SomeField = 42;\n    }\n    class ClassWithMethod\n    {\n        void Method() { }\n    }\n    class ClassWithIndexer\n    {\n        int this[int index] => 42;\n    }\n    class ClassWithDelegate\n    {\n        delegate void MethodDelegate();\n    }\n    class ClassWithEvent\n    {\n        event EventHandler CustomEvent;\n    }\n\n    class GenericNotEmpty<T>\n    {\n        void Method(T arg) { }\n    }\n\n    class GenericNotEmptyWithConstraints<T>\n        where T : class\n    {\n        void Method(T arg) { }\n    }\n\n    partial class PartialNotEmpty\n    {\n        int Prop => 42;\n    }\n\n    partial class PartialEmpty { }               // Compliant - Source Generators and some frameworks use empty partial classes as placeholders\n\n    [ComVisible(true)]\n    class ClassWithAttribute { }                 // Compliant - types with attributes are ignored\n\n    [ComVisible(true), Obsolete]\n    class ClassWithMultipleAttributes { }\n\n    class OuterClass\n    {\n        class InnerEmpty1 { }                    // Noncompliant\n        private class InnerEmpty2 { }            // Noncompliant\n        protected class InnerEmpty3 { }          // Noncompliant\n        internal class InnerEmpty4 { }           // Noncompliant\n        protected internal class InnerEmpty5 { } // Noncompliant\n        public class InnerEmpty6 { }             // Noncompliant\n\n        public class InnerEmptyWithComments      // Noncompliant\n        {\n            // Some comment\n        }\n\n        class InnerNonEmpty\n        {\n            public int SomeProperty => 42;\n        }\n    }\n\n    class IntegerList : List<int> { }             // Compliant - creates a more specific type without adding new members to it (similar to using the typedef keyword in C/C++)\n    class StringLookup<T> : Dictionary<string, T> { }\n    interface IIntegerSet<T> : ISet<int> { }\n\n    class Conditional                            // Compliant - it's not empty when the given symbol is defined\n    {\n#if NOTDEFINED\n    public override string ToString()\n    {\n        return \"Debug Text\";\n    }\n#endif\n    }\n}\n\nnamespace NonCompliant\n{\n    class Empty { }                              // Noncompliant {{Remove this empty class, write its code or make it an \"interface\".}}\n    //    ^^^^^\n\n    public class PublicEmpty { }                 // Noncompliant\n\n    internal class InternalEmpty { }             // Noncompliant\n\n    class EmptyWithComments                      // Noncompliant\n    {\n        // Some comment\n    }\n\n    static class StaticEmpty { }                 // Noncompliant\n\n    abstract class AbstractEmpty { }             // Noncompliant\n\n    class GenericEmpty<T> { }                    // Noncompliant\n    //    ^^^^^^^^^^^^\n    class GenericEmptyWithConstraints<T>         // Noncompliant\n        where T : class { }\n}\n\nnamespace Ignore\n{\n    class { }                                    // Error [CS1001]\n\n    []                                           // Error [CS1001]\n    class AttributeError { }\n\n    interface IMarker { }                        // Compliant - this rule only deals with classes\n\n    class ImplementsMarker : IMarker { }         // Compliant - implements a marker interface\n\n    struct EmptyStruct { }                       // Compliant - this rule only deals with classes\n\n    enum EmptyEnum { }                           // Compliant - this rule only deals with classes\n\n    class SomeCommand { }                        // Compliant, ignored because of the suffix\n    class SomeEvent { }                          // Compliant, ignored because of the suffix\n    class SomeMessage { }                        // Compliant, ignored because of the suffix\n    class Some_Command { }                       // Compliant, ignored because of the suffix\n    class SomeQuery { }                          // Compliant, ignored because of the suffix, https://github.com/SonarSource/sonar-dotnet/issues/9241\n    class Someevent { }                          // Noncompliant\n    class SOMEMESSAGE { }                        // Noncompliant\n    class SomeCommandHandler { }                 // Noncompliant\n    class MessageHandler { }                     // Noncompliant\n    class Command { }                            // Compliant, ignored because of the suffix\n    class Event { }                              // Compliant, ignored because of the suffix\n    class Message { }                            // Compliant, ignored because of the suffix\n    class Query { }                              // Compliant, ignored because of the suffix\n\n\n    class AssemblyDoc { }                        // Compliant, used for DefaultDocumentation tool\n    class NamespaceDoc { }                       // compliant, used for DefaultDocumentation tool\n}\n\nnamespace ConstructorAccessibility\n{\n    public class PublicClassWithPublicConstructor { public PublicClassWithPublicConstructor() { } }\n    public class PublicClassWithInternalConstructor { internal PublicClassWithInternalConstructor() { } }\n    public class PublicClassWithProtectedConstructor { protected PublicClassWithProtectedConstructor() { } }\n    internal class InternalClassWithPublicConstructor { public InternalClassWithPublicConstructor() { } }\n    internal class InternalClassWithInternalConstructor { internal InternalClassWithInternalConstructor() { } }\n    internal class InternalClassWithProtectedConstructor { protected InternalClassWithProtectedConstructor() { } }\n\n    public class ConstructorIsPublicAlready1 : PublicClassWithPublicConstructor { }             // Noncompliant\n    public class WidensConstructorAccessibility1 : PublicClassWithInternalConstructor { }       // Compliant\n    public class WidensConstructorAccessibility2 : PublicClassWithProtectedConstructor { }      // Compliant\n\n    internal class ConstructorIsPublicAlready2 : PublicClassWithPublicConstructor { }           // Noncompliant\n    internal class ConstructorIsInternalAlready1 : PublicClassWithInternalConstructor { }       // Noncompliant\n    internal class WidensConstructorAccessibility3 : PublicClassWithProtectedConstructor { }    // Compliant\n    internal class ConstructorIsInternalAlready2 : InternalClassWithPublicConstructor { }       // Noncompliant\n    internal class ConstructorIsInternalAlready3 : InternalClassWithInternalConstructor { }     // Noncompliant\n    internal class WidensConstructorAccessibility4 : InternalClassWithProtectedConstructor { }  // Compliant\n\n    public class ClassWithNestedClasses\n    {\n        protected class ProtectedClassWithPublicConstructor { public ProtectedClassWithPublicConstructor() { } }\n        protected class ProtectedClassWithInternalConstructor { internal ProtectedClassWithInternalConstructor() { } }\n        protected class ProtectedClassWithProtectedConstructor { protected ProtectedClassWithProtectedConstructor() { } }\n        private class PrivateClassWithPublicConstructor { public PrivateClassWithPublicConstructor() { } }\n        private class PrivateClassWithInternalConstructor { internal PrivateClassWithInternalConstructor() { } }\n        private class PrivateClassWithProtectedConstructor { protected PrivateClassWithProtectedConstructor() { } }\n\n        protected class ConstructorIsPublicAlready3 : PublicClassWithPublicConstructor { }              // Noncompliant\n        protected class WidensConstructorAccessibility5 : PublicClassWithInternalConstructor { }        // Compliant\n        protected class ConstructorIsProtectedAlready1 : PublicClassWithProtectedConstructor { }        // Noncompliant\n        protected class ConstructorIsProtectedAlready2 : ProtectedClassWithPublicConstructor { }        // Noncompliant\n        protected class WidensConstructorAccessibility6 : ProtectedClassWithInternalConstructor { }     // Compliant\n        protected class ConstructorIsProtectedAlready3 : ProtectedClassWithProtectedConstructor { }     // Noncompliant\n\n        private class PrivateClass1 : PublicClassWithPublicConstructor { }                              // Noncompliant\n        private class PrivateClass2 : PublicClassWithInternalConstructor { }                            // Noncompliant\n        private class PrivateClass3 : PublicClassWithProtectedConstructor { }                           // Noncompliant\n        private class PrivateClass4 : InternalClassWithPublicConstructor { }                            // Noncompliant\n        private class PrivateClass5 : InternalClassWithInternalConstructor { }                          // Noncompliant\n        private class PrivateClass6 : InternalClassWithProtectedConstructor { }                         // Noncompliant\n        private class PrivateClass7 : ProtectedClassWithPublicConstructor { }                           // Noncompliant\n        private class PrivateClass8 : ProtectedClassWithInternalConstructor { }                         // Noncompliant\n        private class PrivateClass9 : ProtectedClassWithProtectedConstructor { }                        // Noncompliant\n        private class PrivateClass10 : ProtectedClassWithPublicConstructor { }                          // Noncompliant\n        private class PrivateClass11 : ProtectedClassWithInternalConstructor { }                        // Noncompliant\n        private class PrivateClass12 : ProtectedClassWithProtectedConstructor { }                       // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ClassShouldNotBeEmpty.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.Runtime.InteropServices\n\nNamespace Compliant\n    Public Class PublicEmpty                            ' Noncompliant\n    End Class\n\n    Friend Class InternalEmpty                          ' Noncompliant\n    End Class\n\n    Class EmptyWithComments                             ' Noncompliant\n        ' Some comment\n    End Class\n\n    Class ClassWithProperty\n        Private ReadOnly Property SomeProperty As Integer\n            Get\n                Return 42\n            End Get\n        End Property\n    End Class\n\n    Class ClassWithField\n        Private SomeField As Integer = 42\n    End Class\n\n    Class ClassWithMethod\n        Private Sub Method()\n        End Sub\n    End Class\n\n    Class ClassWithIndexer\n        Private ReadOnly Property Item(index As Integer) As Integer\n            Get\n                Return 42\n            End Get\n        End Property\n    End Class\n\n    Class ClassWithDelegate\n        Delegate Sub MethodDelegate()\n    End Class\n\n    Class ClassWithEvent\n        Private Event CustomEvent As EventHandler\n    End Class\n\n    Class GenericNotEmpty(Of T)\n        Private Sub Method(arg As T)\n        End Sub\n    End Class\n\n    Class GenericNotEmptyWithConstraints(Of T As Class)\n        Private Sub Method(arg As T)\n        End Sub\n    End Class\n\n    Class IntegerList                                   ' Compliant - creates a more specific type without adding new members to it (similar to using the typedef keyword in C/C++)\n        Inherits List(Of Integer)\n    End Class\n\n    Class StringLookup(Of T)\n        Inherits Dictionary(Of String, T)\n    End Class\n\n    Interface IIntegerSet(Of T)\n        Inherits ISet(Of Integer)\n    End Interface\n\n    <ComVisible(True)>\n    Class ClassWithAttribute                            ' Compliant - types with attributes are ignored\n    End Class\n\n    <ComVisible(True), Obsolete>\n    Class ClassWithMultipleAttributes\n    End Class\n\n    Partial Class PartialEmpty                          ' Compliant - Source Generators and some frameworks use empty partial classes as placeholders\n    End Class\n\n    Partial Class PartialNotEmpty\n        Public ReadOnly Property Prop As Integer\n            Get\n                Return 42\n            End Get\n        End Property\n    End Class\n\n    Class Conditional                                   ' Compliant - it's not empty when the given symbol is defined\n#If NOTDEFINED Then\n    Public Overrides Function ToString() As String\n        Return \"Debug Text\"\n    End Function\n#End If\n    End Class\n\nEnd Namespace\n\nNamespace NonCompliant\n\n    Class Empty                                         ' Noncompliant {{Remove this empty class, write its code or make it an \"interface\".}}\n        ' ^^^^^\n    End Class\n\n    Class OuterClass\n\n        Class InnerEmpty1                               ' Noncompliant\n        End Class\n\n        Private Class InnerEmpty2                       ' Noncompliant\n        End Class\n\n        Protected Class InnerEmpty3                     ' Noncompliant\n        End Class\n\n        Friend Class InnerEmpty4                        ' Noncompliant\n        End Class\n\n        Protected Friend Class InnerEmpty5              ' Noncompliant\n        End Class\n\n        Public Class InnerEmpty6                        ' Noncompliant\n        End Class\n\n        Public Class InnerEmptyWithComments             ' Noncompliant\n            ' Some comment\n        End Class\n\n        Class InnerNonEmpty\n            Public ReadOnly Property SomeProperty As Integer\n                Get\n                    Return 42\n                End Get\n            End Property\n        End Class\n    End Class\n\n    Class GenericEmpty(Of T)                            ' Noncompliant\n        ' ^^^^^^^^^^^^\n    End Class\n\n    Class GenericEmptyWithConstraints(Of T As Class)    ' Noncompliant\n    End Class\n\n    MustInherit Class AbstractEmpty                     ' Noncompliant\n    End Class\n\nEnd Namespace\n\nNamespace Ignore\n\n    Class                                               ' Error [BC30203]\n    End Class\n\n    <>                                                  ' Error [BC30203]\n    Class AttributeError                                ' Noncompliant\n    End Class\n\n    Interface IMarker                                   ' Compliant - this rule only deals with classes\n    End Interface\n\n    Class ImplementsMarker                              ' Compliant - implements a marker interface\n        Implements IMarker\n    End Class\n\n    Structure EmptyStruct                               ' Compliant - this rule only deals with classes\n    End Structure\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ClassWithEqualityShouldImplementIEquatable.Latest.cs",
    "content": "﻿class MyCompliantClass // Noncompliant\n{\n    public bool Equals(MyCompliantClass other)\n    {\n        return false;\n    }\n}\n\npublic sealed record C // Compliant, records implement IEquatable by design\n{\n    public bool Equals(C other)\n    {\n        return false;\n    }\n}\n\npublic class Sample { }\n\npublic static class ClassicExtensions // Compliant, extension methods doesn't allow you to implement an interface\n{\n    public static bool Equals(this Sample self, Sample other)\n    {\n        return false;\n    }\n}\n\npublic static class NewExtensions // Compliant, extension methods doesn't allow you to implement an interface\n{\n    extension(Sample sample)\n    {\n        bool Equals(Sample other)\n        {\n            return false;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ClassWithEqualityShouldImplementIEquatable.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    class MyCompliantClass : IEquatable<MyCompliantClass> // Compliant\n    {\n        public bool Equals(MyCompliantClass other)\n        {\n            return false;\n        }\n    }\n\n    class ClassWithEqualsT // Noncompliant {{Implement 'IEquatable<ClassWithEqualsT>'.}}\n//        ^^^^^^^^^^^^^^^^\n    {\n        public bool Equals(ClassWithEqualsT other)\n        {\n            return false;\n        }\n    }\n\n    public class Foo\n    {\n        protected bool Equals(Foo other)\n        {\n            return false;\n        }\n\n        public override bool Equals(object other)\n        {\n            return false;\n        }\n    }\n\n    public sealed class Bar : MyEquatable<Bar> // Compliant\n    {\n        public new bool Equals(Bar other) => false;\n    }\n\n    public sealed class FooBar : MyEquatable<Bar> // Compliant - does not define the \"Equals<FooBar>\" method\n    {\n        public new bool Equals(Bar other) => false;\n    }\n\n    public sealed class BarBar : MyEquatable<Bar> // Noncompliant\n    {\n        public new bool Equals(Bar other) => false;\n        public new bool Equals(BarBar other) => false;\n    }\n\n    public sealed class BarFoo : MyEquatable<Bar>, IEquatable2<BarFoo> // Compliant\n    {\n        public new bool Equals(Bar other) => false;\n        public new bool Equals(BarFoo other) => false;\n    }\n\n    public abstract class MyEquatable<T> : IEquatable<T>\n            where T : MyEquatable<T>\n    {\n        public bool Equals(T other) => true;\n    }\n\n    public interface IEquatable2<T> : IEquatable<T> { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ClassWithOnlyStaticMember.Latest.Partial.cs",
    "content": "﻿namespace CSharp13\n{\n    public partial class PartialStaticProperty //Noncompliant {{Add a 'protected' constructor or the 'static' keyword to the class declaration.}}\n    {\n        public static partial string Prop { get => \"fourty-two\"; set { } }\n    }\n}\n\nnamespace CSharp14\n{\n    public partial class StaticPartialConstructor // Noncompliant {{Add a 'protected' constructor or the 'static' keyword to the class declaration.}}\n    {\n        static partial StaticPartialConstructor(); // Error [CS0267]\n        // Error@-1 [CS0111]\n        public static string Prop { get; set; }\n    }\n\n    public partial class StaticPartialEvent // Noncompliant {{Add a 'protected' constructor or the 'static' keyword to the class declaration.}}\n    {\n        public static partial event System.EventHandler<System.EventArgs> PartialEvent { add { } remove { } }\n    }\n    public partial class PartialConstructor\n    {\n        partial PartialConstructor() { }\n    }\n\n    public partial class InstancePartialEvent\n    {\n        public partial event System.EventHandler<System.EventArgs> PartialEvent { add { } remove { } }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ClassWithOnlyStaticMember.Latest.cs",
    "content": "﻿\npublic interface IVirtualMethods\n{\n    virtual static string StaticVirtualMembersInInterfaces(string s1, string s2) => s1 + s2;\n    \n    virtual static string Prop { get; set; }\n}\n\npublic class VirtualMethods : IVirtualMethods // Compliant, classes that implement interfaces cannot be static\n{\n\n}\n\npublic interface IAbstractMethods\n{\n    static abstract bool StaticVirtualMembersInInterfaces();\n}\n\npublic class AbstractMethods : IAbstractMethods // Compliant, classes that implement interfaces cannot be static\n{\n    public static bool StaticVirtualMembersInInterfaces() => true;\n}\n\npublic class PrimaryCtorClass() // Noncompliant {{Remove this primary constructor.}}\n{\n    public static string Concatenate(string s1, string s2)\n    {\n        return s1 + s2;\n    }\n\n    public static string Prop { get; set; }\n}\n\npublic class PrimaryCtorClassWithParams(int i) // Compliant There is a captured parameter for the instance \n{\n    public static string Concatenate(string s1, string s2)\n    {\n        return s1 + s2;\n    }\n}\n\nnamespace CSharp13\n{\n    public partial class PartialStaticProperty // Noncompliant {{Add a 'protected' constructor or the 'static' keyword to the class declaration.}}\n    {\n        public static partial string Prop { get; set; }\n    }\n}\n\nnamespace CSharp14\n{\n    public static class TestClass\n    {\n        extension(TestClass)\n        {\n            public static string Prop => \"42\";\n        }\n    }\n\n    public class StaticFieldKeyword // Noncompliant {{Add a 'protected' constructor or the 'static' keyword to the class declaration.}}\n    {\n        public static int Prop { get => field++; set => field++; }\n    }\n\n    public class FieldKeyword\n    {\n        public int Prop { get => field++; set => field++; }\n    }\n\n    public partial class StaticPartialConstructor // Noncompliant {{Add a 'protected' constructor or the 'static' keyword to the class declaration.}}\n    {\n        static partial StaticPartialConstructor();    // Error [CS0267]\n    }\n\n    public partial class PartialConstructor\n    {\n        partial PartialConstructor();\n    }\n\n    public partial class StaticPartialEvent // Noncompliant {{Add a 'protected' constructor or the 'static' keyword to the class declaration.}}\n    {\n        public static partial event System.EventHandler<System.EventArgs> PartialEvent;\n    }\n\n    public partial class InstancePartialEvent\n    {\n        public partial event System.EventHandler<System.EventArgs> PartialEvent;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ClassWithOnlyStaticMember.TopLevelStatements.cs",
    "content": "﻿var x = 1; // top level statement\n\npublic record StringUtils // Compliant. We should not encourage people to use records as helper classes.\n{\n    public static string Concatenate(string s1, string s2)\n    {\n        return s1 + s2;\n    }\n    public static string Prop { get; set; }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ClassWithOnlyStaticMember.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public interface IMyInterface\n    {\n\n    }\n\n    public struct MyStruct // Compliant, we don't care about structs\n    {\n        public static string Concatenate(string s1, string s2)\n        {\n            return s1 + s2;\n        }\n        public static string Prop { get; set; }\n    }\n\n    public class StringUtils // Noncompliant {{Add a 'protected' constructor or the 'static' keyword to the class declaration.}}\n//               ^^^^^^^^^^^\n    {\n        public static string Concatenate(string s1, string s2)\n        {\n            return s1 + s2;\n        }\n        public static string Prop { get; set; }\n    }\n\n    public sealed class StringUtils22 //Noncompliant\n    {\n        public static string Concatenate(string s1, string s2)\n        {\n            return s1 + s2;\n        }\n        public static string Prop { get; set; }\n    }\n\n    public class StringUtilsAsBase\n    {\n        public StringUtilsAsBase() //Noncompliant {{Hide this public constructor by making it 'protected'.}}\n        { }\n        public static string Concatenate(string s1, string s2)\n        {\n            return s1 + s2;\n        }\n        public static string Prop { get; set; }\n    }\n\n    public sealed class SealedStringUtilsAsBase\n    {\n        public SealedStringUtilsAsBase() //Noncompliant {{Hide this public constructor by making it 'private'.}}\n        { }\n        public static string Concatenate(string s1, string s2)\n        {\n            return s1 + s2;\n        }\n        public static string Prop { get; set; }\n    }\n\n\n    public class BaseClass //Compliant, has no methods at all\n    { }\n\n    public class StringUtilsDerived : BaseClass\n    {\n        public static string Concatenate(string s1, string s2)\n        {\n            return s1 + s2;\n        }\n        public static string Prop { get; set; }\n    }\n\n    public interface IInterface\n    { }\n    public class StringUtilsIf : IInterface\n    {\n        public static string Concatenate(string s1, string s2)\n        {\n            return s1 + s2;\n        }\n        public static string Prop { get; set; }\n    }\n\n    public static class StringUtils2\n    {\n        public static string Concatenate(string s1, string s2)\n        {\n            return s1 + s2;\n        }\n    }\n\n    public class StringUtils3\n    {\n        protected StringUtils3()\n        {\n        }\n        public static string Concatenate(string s1, string s2)\n        {\n            return s1 + s2;\n        }\n    }\n\n    public class StringUtils4\n    {\n        public static StringUtils4 Concatenate()\n        {\n            return null;\n        }\n    }\n    public class StringUtils5\n    {\n        public static void Concatenate(StringUtils5 p)\n        {\n        }\n    }\n    public class StringUtils6\n    {\n        public static StringUtils6 Prop { get; set; }\n    }\n\n    public class StringUtils7\n    {\n        public static StringUtils7 Field;\n    }\n\n    public abstract class AbstractClass\n    {\n        public static int Answer() => 42;\n    }\n\n    public class TestClass // Noncompliant {{Add a 'protected' constructor or the 'static' keyword to the class declaration.}}\n    {\n        public static void SomeMethod() { }\n        public static string Prop { get; set; }\n    }\n\n    public class AnotherTestClass : TestClass // FN\n    {\n\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CloudNative/AzureFunctionsCatchExceptions.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\nusing Microsoft.Azure.WebJobs;\n\npublic class AnotherAttribute : Attribute\n{\n    public AnotherAttribute(string name) { }\n}\n\npublic static class Functions\n{\n    private const int ConstantInt = 42;\n\n    delegate void VoidDelegate();\n\n    public static void NotAnAzureFunction()     // Compliant\n    {\n        DoSomething();\n    }\n\n    [Another(\"Something\")]\n    public static void WithAnotherAttribute()   // Compliant\n    {\n        DoSomething();\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void NoTryCatch_Body(int arg)         // Noncompliant {{Wrap Azure Function body in try/catch block.}}\n    //                 ^^^^^^^^^^^^^^^\n    {\n        DoSomething();\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void NoTryCatch_Arrow() =>            // Noncompliant\n        DoSomething();\n\n    [FunctionName(\"Sample\")]\n    public static async Task<string> NoTryCatchAsync()  // Noncompliant\n    {\n        return DoSomething();\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void Empty()\n    {\n        // Compliant. Nothing to see here\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void Unreachable()                    // Noncompliant\n    {\n        return;\n        DoSomething();  // This invocation is unreachable, but still considered - this is not a SE rule.\n    }\n\n    [FunctionName(\"Sample\")]\n    public static async Task<int> Harmless()\n    {\n        Action notInvokedParenthesizedLambda = () => { DoSomething(); };    // Compliant, not invoked\n        Action<int> notInvokedSimpleLambda = x => { DoSomething(); };       // Compliant, not invoked\n        VoidDelegate notInvokedAnonymousMethod = delegate                   // Compliant, not invoked\n        {\n            DoSomething();\n        };\n\n        var ret = 42 + ConstantInt;\n        ret -= int.MaxValue;\n        return ret;\n\n        string LocalNotInvoked() =>                     // Compliant, not invoked\n            DoSomething();\n\n        static string StaticLocalNotInvoked() =>        // Compliant, not invoked\n            DoSomething();\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void PropertyAccess(ICollection<int> items, NonStatic instance)   // This is considered compliant for simplicity. Properties should not throw.\n    {\n        if (items.Count == 0)\n        {\n            return;\n        }\n        instance.Property = 42;\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void TryFinally()   // Noncompliant\n    {\n        try\n        {\n            DoSomething();\n        }\n        finally\n        {\n        }\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void TryFinally_WithMethod()   // Noncompliant\n    {\n        try\n        {\n        }\n        finally\n        {\n            DoSomething();\n        }\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void InvocationInCatch_All()\n    {\n        try\n        {\n        }\n        catch\n        {\n            DoSomething();\n        }\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void InvocationInCatch_Specific() // Compliant, because the risky stuff is happening only in catch\n    {\n        try\n        {\n        }\n        catch (NullReferenceException)\n        {\n            DoSomething();  // This is compliant, because it can be the desired logging.\n        }\n    }\n\n    private static string DoSomething() => null;    // Compliant, btw\n}\n\npublic static class AttributeVariants\n{\n    [FunctionNameAttribute(\"ClassName\")]\n    public static void ClassName()          // Noncompliant\n    {\n        DoSomething();\n    }\n\n    [Microsoft.Azure.WebJobs.FunctionNameAttribute(\"NamespaceName\")]\n    public static void NamespaceName()      // Noncompliant\n    {\n        DoSomething();\n    }\n\n    [global::Microsoft.Azure.WebJobs.FunctionNameAttribute(\"GlobalName\")]\n    public static void GlobalName()         // Noncompliant\n    {\n        DoSomething();\n    }\n\n    private static void DoSomething() { }\n}\n\npublic static class CatchScenarios\n{\n    [FunctionName(\"Sample\")]\n    public static void OuterCatch()\n    {\n        try\n        {\n            var i = 42;\n            DoSomething();\n        }\n        catch (Exception ex)\n        {\n        }\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void OuterCatchFullName()\n    {\n        try\n        {\n            var i = 42;\n            DoSomething();\n        }\n        catch (System.Exception ex)\n        {\n        }\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void OuterCatchGlobalName()\n    {\n        try\n        {\n            var i = 42;\n            DoSomething();\n        }\n        catch (global::System.Exception ex)\n        {\n        }\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void OuterCatchNoVariable()\n    {\n        try\n        {\n            var i = 42;\n            DoSomething();\n        }\n        catch (Exception)\n        {\n        }\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void OuterCatchNoType()\n    {\n        try\n        {\n            var i = 42;\n            DoSomething();\n        }\n        catch\n        {\n        }\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void OuterCatchSpecific()   // Noncompliant\n    {\n        try\n        {\n            var i = 42;\n            DoSomething();\n        }\n        catch (NullReferenceException ex)\n        {\n        }\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void OuterCatchSpecificAndAll()\n    {\n        try\n        {\n            var i = 42;\n            DoSomething();\n        }\n        catch (NullReferenceException ex)\n        {\n        }\n        catch (Exception ex)\n        {\n        }\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void OuterCatchSpecificAndAll_When()   // Noncompliant\n    {\n        try\n        {\n            var i = 42;\n            DoSomething();\n        }\n        catch (NullReferenceException ex)\n        {\n        }\n        catch (Exception ex) when (ex is ArgumentNullException)\n        {\n        }\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void OuterCatchWhen()   // Noncompliant\n    {\n        try\n        {\n            var i = 42;\n            DoSomething();\n        }\n        catch (Exception ex) when (ex is ArgumentNullException)\n        {\n        }\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void OuterCatchWhenAlwaysTrue()   // Noncompliant FP, we don't support constant condition tracking\n    {\n        try\n        {\n            var i = 42;\n            DoSomething();\n        }\n        catch (Exception ex) when (true)\n        {\n        }\n    }\n\n    private static void DoSomething() { }\n}\n\npublic static class NestedTry\n{\n    [FunctionName(\"Sample\")]\n    public static void NestedCatch(int arg)  // Compliant\n    {\n        if (arg == 42)\n        {\n            try\n            {\n                DoSomething();\n            }\n            catch\n            {\n            }\n        }\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void NestedCatch_Multi(int arg)  // Compliant\n    {\n        if (arg == 42)\n        {\n            try\n            {\n                DoSomething();\n            }\n            catch\n            {\n            }\n        }\n        else\n        {\n            try\n            {\n                DoSomething();\n            }\n            catch\n            {\n            }\n        }\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void NestedCatch_Deep(int arg)  // Compliant\n    {\n        if (arg == 42)\n        {\n            if (arg != 0)\n            {\n                while (true)\n                {\n                    try\n                    {\n                        DoSomething();\n                    }\n                    catch\n                    {\n                    }\n                    break;\n                }\n            }\n        }\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void InvocationOutside_BeforeTry(int arg)   // Noncompliant\n    {\n        if (arg == 42)\n        {\n            DoSomething();\n            try\n            {\n                DoSomething();\n            }\n            catch\n            {\n            }\n        }\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void InvocationOutside_BeforeIf(int arg)   // Noncompliant\n    {\n        DoSomething();\n        if (arg == 42)\n        {\n            try\n            {\n                DoSomething();\n            }\n            catch\n            {\n            }\n        }\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void InvocationOutside_AfterTry(int arg)   // Noncompliant\n    {\n        if (arg == 42)\n        {\n            try\n            {\n                DoSomething();\n            }\n            catch\n            {\n            }\n            DoSomething();\n        }\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void InvocationOutside_AfterIf(int arg)   // Noncompliant\n    {\n        if (arg == 42)\n        {\n            try\n            {\n                DoSomething();\n            }\n            catch\n            {\n            }\n        }\n        DoSomething();\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void InvocationOutside_NestedDeep(int arg)  // Noncompliant\n    {\n        if (arg == 42)\n        {\n            if (arg != 0)\n            {\n                while (true)\n                {\n                    try\n                    {\n                        DoSomething();\n                    }\n                    catch\n                    {\n                    }\n                    DoSomething();\n                    break;\n                }\n            }\n        }\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void NestedTry_OuterSpecificInnerAll()\n    {\n        try\n        {\n            try\n            {\n                DoSomething();\n            }\n            catch\n            {\n            }\n        }\n        catch(InvalidOperationException)\n        {\n        }\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void NestedTry_InCatch()\n    {\n        try\n        {\n        }\n        catch\n        {\n            try\n            {\n                DoSomething();\n            }\n            catch\n            {\n            }\n        }\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void NestedTry_InFinally()\n    {\n        try\n        {\n        }\n        finally\n        {\n            try\n            {\n                DoSomething();\n            }\n            catch\n            {\n            }\n        }\n    }\n\n    private static void DoSomething() { }\n}\n\npublic class NonStatic\n{\n    public int Property { get; set; }\n\n    [FunctionName(\"Sample\")]\n    public void InstanceMethod()         // Noncompliant\n    {\n        DoSomething();\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void StaticMethod()   // Noncompliant\n    {\n        DoSomething();\n    }\n\n    private static void DoSomething() { }\n}\n\npublic class ConditionalAccess\n{\n    public int Property { get; set; }\n\n    [FunctionName(\"Sample\")]\n    public static void OnArgument(ConditionalAccess arg)    // Noncompliant\n    {\n        arg?.DoSomething();\n    }\n\n    [FunctionName(\"Sample\")]\n    public void OnInvocation_Method()       // Noncompliant\n    {\n        DoSomething()?.DoSomething();\n    }\n\n    [FunctionName(\"Sample\")]\n    public void OnInvocation_Property()     // Noncompliant\n    {\n        var value = DoSomething()?.Property;\n    }\n\n    private ConditionalAccess DoSomething() => null;\n}\n\npublic class Foo\n{\n\n    // Repro for https://github.com/SonarSource/sonar-dotnet/issues/5995\n    [FunctionName(nameof(CheckLicense))]\n    public async Task CheckLicense()\n    {\n        try\n        {\n            //check authorization\n        }\n        catch (Exception e)\n        {\n        }\n    }\n\n    [FunctionName(\"Sample\")]\n    public async Task NameOfOutsideTry()\n    {\n        var x = nameof(NameOfOutsideTry);\n        try\n        {\n        }\n        catch (Exception e)\n        {\n        }\n    }\n\n    [FunctionName(\"Sample\")]\n    public async Task NameOfOutsideTryWithNameOfMethodInScope() // Noncompliant\n    {\n        var x = nameof(NameOfOutsideTryWithNameOfMethodInScope);\n        try\n        {\n        }\n        catch (Exception e)\n        {\n        }\n\n        string nameof(Func<Task> x) => \"\";\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CloudNative/AzureFunctionsLogFailures.cs",
    "content": "﻿namespace AzureFunctionLogFailuresTests\n{\n    using Microsoft.AspNetCore.Http;\n    using Microsoft.AspNetCore.Mvc;\n    using Microsoft.Azure.WebJobs;\n    using Microsoft.Azure.WebJobs.Extensions.Http;\n    using Microsoft.Extensions.Logging;\n    using Microsoft.Extensions.Logging.Abstractions;\n    using System;\n    using System.IO;\n    using System.Threading.Tasks;\n    using ILoggerAlias = Microsoft.Extensions.Logging.ILogger;\n\n    public static class LogInCatchClause\n    {\n        [FunctionName(\"Sample\")]\n        public static void EmptyCatchClause(ILogger log)\n        {\n            try { }\n            catch { } // Noncompliant {{Log exception via ILogger with LogLevel Information, Warning, Error, or Critical.}}\n//          ^^^^^\n        }\n\n        [FunctionName(\"Sample\")]\n        public static void LogLevelInvalid(ILogger log)\n        {\n            try { }\n            catch // Noncompliant\n//          ^^^^^\n            {\n                log.LogTrace(string.Empty);        // Secondary\n//              ^^^^^^^^^^^^^^^^^^^^^^^^^^\n                log.LogDebug(string.Empty);        // Secondary\n            }\n        }\n\n        [FunctionName(\"Sample\")]\n        public static void LogExceptionInCatchClause(ILogger log)\n        {\n            try { }\n            catch (Exception ex) // Compliant\n            {\n                log.LogError(ex, \"\");\n            }\n        }\n\n        [FunctionName(\"Sample\")]\n        public static void LogExceptionInCatchClauseWithErrorAndTrace(ILogger log)\n        {\n            try { }\n            catch (Exception ex) // Compliant\n            {\n                log.LogTrace(ex, \"\");\n                log.LogError(ex, \"\");\n                log.LogTrace(ex, \"\");\n            }\n        }\n\n        public static void MissingFunctionNameAttribute(ILogger log)\n        {\n            try { }\n            catch { } // Compliant. Not an AzureFunction\n        }\n\n        [FunctionName(\"Sample\")]\n        public static void LogExceptionInWrappedLogger(ILogger log)\n        {\n            try { }\n            catch (Exception ex) // Compliant\n            {\n                var nullLogger = NullLogger.Instance;\n                nullLogger.Log(LogLevel.Error, new EventId(), (object)null, ex, (s, e) => string.Empty);\n            }\n        }\n\n        [FunctionName(\"Sample\")]\n        public static void LogExceptionLoggedInLocalFunction(ILogger log)\n        {\n            try { }\n            catch (Exception ex) // FN. Any call to \"log\" is considered valid. Reachability is not considered.\n            {\n                void Log() => log.LogError(\"\");\n            }\n        }\n\n        [FunctionName(\"Sample\")]\n        public static void LogExceptionLoggedInLambda(ILogger log)\n        {\n            try { }\n            catch (Exception ex) // FN. Any call to \"log\" is considered valid. Reachability is not considered.\n            {\n                Action x = () => log.LogError(\"\");\n            }\n        }\n\n        [FunctionName(\"Sample\")]\n        public static void LogExceptionLoggedInAnonymousFunction(ILogger log)\n        {\n            try { }\n            catch (Exception ex) // FN. Any call to \"log\" is considered valid. Reachability is not considered.\n            {\n                Action x = delegate () { log.LogError(\"\"); };\n            }\n        }\n\n        [FunctionName(\"Sample\")]\n        public static void LogExceptionIsPassedInLambda(ILogger log)\n        {\n            try { }\n            catch (Exception ex) // FN. Any call to \"log\" is considered valid. Reachability is not considered.\n            {\n                DoNothing(() => log.LogError(\"\"));\n            }\n\n            void DoNothing(Action a) { }\n        }\n\n        [FunctionName(\"Sample\")]\n        public static void LogExceptionLoggedInUnreachableCode(ILogger log)\n        {\n            try { }\n            catch (Exception ex) // FN. log in unreachable code.\n            {\n                return;\n                log.LogError(\"\");\n            }\n        }\n\n        [FunctionName(\"Sample\")]\n        public static void LogExceptionNotEveryCodePathContainsLog(ILogger log)\n        {\n            try { }\n            catch (Exception ex) // FN. Not every code path contains a log\n            {\n                var i = 100;\n                if (i == 42)\n                {\n                    log.LogError(\"\");\n                }\n            }\n        }\n\n        [FunctionName(\"Sample\")]\n        public static void LogExceptionFromWebApi(ILogger log)\n        {\n            try { }\n            catch (Exception ex) // Compliant. Microsoft.Azure.WebJobs adds an extension method \"LogMetric\". It is in scope when the standard AzureFunction is scaffolded in VS, but we only take extension methods comming from the logging package into account.\n            {\n                log.LogMetric(\"Metric\", 5);\n            }\n        }\n\n        [FunctionName(\"Sample\")]\n        public static void LogExceptionToUndefinedMethod(ILogger log)\n        {\n            try { }\n            catch (Exception ex) // Noncompliant.\n            {\n                log.Undefined(); // Error [CS1061] ILogger' does not contain a definition for 'Undefined'\n            }\n        }\n\n        [FunctionName(\"Sample\")]\n        public static void CallLogIsEnabled(ILogger log)\n        {\n            try { }\n            catch (Exception ex) // Noncompliant.\n            {\n                log.IsEnabled(LogLevel.Error); // Secondary\n            }\n        }\n\n        [FunctionName(\"Sample\")]\n        public static void LogExceptionInNestedCatch(ILogger log)\n        {\n            try { }\n            catch (Exception ex) // FN. The outer block should contain a log call too\n            {\n                try { }\n                catch\n                {\n                    log.LogError(\"\");\n                }\n            }\n        }\n\n        [FunctionName(\"Sample\")]\n        public static void LoggerGetsPassedToFunction(ILogger log)\n        {\n            try { }\n            catch (Exception ex)\n            {\n                LoggerHelper(log); // Compliant. We don't follow the call, but we assume some decent logging takes place, if the logger gets passed along.\n            }\n        }\n\n        [FunctionName(\"Sample\")]\n        public static void WrappedLoggerGetsPassedToFunction(ILogger log)\n        {\n            try { }\n            catch (Exception ex)\n            {\n                LoggerHelper(NullLogger.Instance); // Compliant. Some ILogger is passed\n            }\n        }\n\n        [FunctionName(\"Sample\")]\n        public static void CustomExtensionMethod(ILogger log)\n        {\n            try { }\n            catch (Exception ex)\n            {\n                log.LogInformationCustomExtension(\"\"); // Compliant. Custom extension methods are considered compliant.\n            }\n        }\n\n        [FunctionName(\"Sample\")]\n        public static void NoILoggerInTheEntryPoint([HttpTrigger(AuthorizationLevel.Function, \"get\", \"post\", Route = null)] HttpRequest req)\n        {\n            try { }\n            catch (Exception ex) // Compliant. No (optional) ILogger parameter in the entry point.\n            {\n            }\n        }\n\n        [FunctionName(\"Sample\")]\n        public static void LogWithLogLevelTrace(ILogger log)\n        {\n            try { }\n            catch (Exception ex) // Noncompliant\n            {\n                log.Log(LogLevel.Trace, string.Empty); // Secondary\n            }\n        }\n\n        [FunctionName(\"Sample\")]\n        public static void LogWithLogLevelError(ILogger log)\n        {\n            try { }\n            catch (Exception ex)\n            {\n                log.Log(LogLevel.Error, string.Empty); // Compliant\n            }\n        }\n\n        [FunctionName(\"Sample\")]\n        public static void LogWithNonConstantLogLevel(ILogger log)\n        {\n            try { }\n            catch (Exception ex)\n            {\n                var logLevel = ex.InnerException == null ? LogLevel.Debug : LogLevel.Trace;\n                log.Log(logLevel, string.Empty); // Compliant. Non-constant LogLevels are considered valid.\n            }\n        }\n\n        private static void LoggerHelper(ILogger logger) { }\n    }\n\n    // https://docs.microsoft.com/en-us/azure/azure-functions/functions-dotnet-dependency-injection\n    public class DependencyInjectionField\n    {\n        private readonly ILogger logger;\n\n        // Scenario: ILogger service was registered in FunctionsStartup and inject via constructor injection:\n        // In FunctionsStartup: public override void Configure(IFunctionsHostBuilder builder) => builder.Services.Add<ILogger>(...);\n        // Here: public DependencyInjectionField(ILogger logger) => this.logger = logger;\n\n        [FunctionName(\"Sample\")]\n        public void InjectedLoggerIsUsed()\n        {\n            try { }\n            catch\n            {\n                logger.LogError(\"\"); // Compliant\n            }\n        }\n\n        [FunctionName(\"Sample\")]\n        public void InjectedLoggerFieldIsNotUsed()\n        {\n            try { }\n            catch { } // Noncompliant\n        }\n    }\n\n    public class DependencyInjectionProperty\n    {\n        protected ILogger Logger { get; }\n\n        [FunctionName(\"Sample\")]\n        public void InjectedLoggerPropertyIsNotUsed()\n        {\n            try { }\n            catch { } // Noncompliant\n        }\n    }\n\n    public class DependencyInjectionMethod\n    {\n        private ILogger Logger() => null;\n\n        [FunctionName(\"Sample\")]\n        public void InjectedLoggerMethodIsNotUsed()\n        {\n            try { }\n            catch { } // Compliant. An ILogger retreivable via a method call is not a supported scenario.\n        }\n    }\n\n    public class DerivedViaProperty : DependencyInjectionProperty\n    {\n        [FunctionName(\"Sample\")]\n        public void InjectedLoggerFromBaseIsNotUsed()\n        {\n            try { }\n            catch { } // Noncompliant. ILogger is accessible via the property in the base class.\n        }\n    }\n\n    public class DerivedViaField : DependencyInjectionField\n    {\n        [FunctionName(\"Sample\")]\n        public void InjectedLoggerFromBaseIsNotAccessible()\n        {\n            try { }\n            catch { } // Compliant. ILogger is a private field in the base class and not accessible.\n        }\n    }\n\n    public class GenericLogger\n    {\n        private ILogger<GenericLogger> logger;\n\n        [FunctionName(\"Sample\")]\n        public void InjectedLoggerFromBaseIsNotUsed()\n        {\n            try { }\n            catch { } // Noncompliant\n        }\n    }\n\n    public class UseILoggerAlias\n    {\n        private ILoggerAlias logger;\n\n        [FunctionName(\"Sample\")]\n        public void InjectedAliasedILogger()\n        {\n            try { }\n            catch { } // Noncompliant\n        }\n    }\n\n    // See https://blog.stephencleary.com/2020/06/a-new-pattern-for-exception-logging.html\n    public static class LogInExceptionFilter\n    {\n        [FunctionName(\"Sample\")]\n        public static void LogExceptionInExceptionFilter(ILogger log)\n        {\n            try { }\n            catch (Exception ex) when (True(() => log.LogError(ex, \"\"))) // Compliant\n            {\n            }\n        }\n\n        [FunctionName(\"Sample\")]\n        public static void LogExceptionInExceptionFilterWrongLogLevel(ILogger log)\n        {\n            try { }\n            catch (Exception ex) when              // Noncompliant\n                (True(() => log.LogTrace(ex, \"\"))) // Secondary\n//                          ^^^^^^^^^^^^^^^^^^^^\n            {\n            }\n        }\n\n        [FunctionName(\"Sample\")]\n        public static void LogExceptionInExceptionFilterCustomExtensionMethod(ILogger log)\n        {\n            try { }\n            catch (Exception ex) when              // Compliant\n                (log.LogInformationCustomExtension(\"\"))\n            {\n            }\n        }\n\n        [FunctionName(\"Sample\")]\n        public static void LogExceptionInExceptionFilterLocalLambdaCapture(ILogger log)\n        {\n            Func<bool> exceptionFilter = () => { log.LogError(\"\"); return true; };\n            try { }\n            catch (Exception ex) when (exceptionFilter()) // Noncompliant. FP\n            {\n            }\n        }\n\n        [FunctionName(\"Sample\")]\n        public static void LogExceptionInExceptionFilterLocalFunctionOutsideCatchCapturesILogger(ILogger log)\n        {\n            try { }\n            catch (Exception ex) when (ExceptionFilter()) // Noncompliant. FP\n            {\n            }\n\n            bool ExceptionFilter() { log.LogError(\"\"); return true; }\n        }\n\n        private static bool True(Action a) => true; // Takes the logging call executes it and returns true for the exception filter.\n    }\n\n    public static class CustomLoggerExtensions\n    {\n        public static bool LogInformationCustomExtension(this ILogger logger, string message) => true;\n    }\n\n    namespace CustomILogger\n    {\n        public interface ILogger { void LogError(string message); }\n\n        public class CustomILoggerStaticEntryPoint\n        {\n            [FunctionName(\"Sample\")]\n            public static void CustomLoggerIsCompliant(ILogger log)\n            {\n                try { }\n                catch { } // Compliant. log is not from Microsoft.Extensions.Logging\n            }\n        }\n\n        public class CustomILoggerDependencyInjection\n        {\n            protected ILogger Logger() => null;\n\n            [FunctionName(\"Sample\")]\n            public void CustomILoggerInScopeIsMustNotBeCalled()\n            {\n                try { }\n                catch { } // Compliant.\n            }\n        }\n    }\n\n    namespace CustomLogger\n    {\n        public class CustomLogger : ILogger\n        {\n            public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter) { }\n            public bool IsEnabled(LogLevel logLevel) => true;\n            public IDisposable BeginScope<TState>(TState state) => null;\n\n            public void SomeOtherMethodOnCustomLogger() { }\n            public void Log(LogLevel logLevel, string message) { }\n            public void Log(string message) { }\n        }\n\n        public static class CustomLoggerExtensions\n        {\n            public static void LogTrace(this CustomLogger logger) { }\n            public static void LogError(this CustomLogger logger) { }\n            public static void SomeExtensionMethod(this CustomLogger logger) { }\n        }\n\n        public class CustomLoggerStaticEntryPoint\n        {\n            [FunctionName(\"Sample\")]\n            public static void CustomLoggerIsCompliant()\n            {\n                try { }\n                catch\n                {\n                    var logger = new CustomLogger();\n                    logger.Log(LogLevel.Error, default(EventId), state: (object)null, exception: null, formatter: (o, ex) => String.Empty); // Compliant. Some ILogger.Log method is called.\n                }\n            }\n\n            [FunctionName(\"Sample\")]\n            public static void CustomLoggerIsInScopeButNotCalled()\n            {\n                var logger = new CustomLogger();\n                try { }\n                catch { } // FN. ILogger is in scope, but locals are ignored.\n            }\n\n            [FunctionName(\"Sample\")]\n            public static void CustomParameterLoggerIsInScopeButNotCalled(CustomLogger logger)\n            {\n                try { }\n                catch { } // Noncompliant\n            }\n\n            [FunctionName(\"Sample\")]\n            public static void CustomParameterLoggerIsInScopeAndCalled(CustomLogger logger)\n            {\n                try { }\n                catch\n                {\n                    logger.Log(LogLevel.Error, default(EventId), state: (object)null, exception: null, formatter: (o, ex) => String.Empty); // Compliant.\n                }\n            }\n\n            [FunctionName(\"Sample\")]\n            public static void CustomParameterLoggerIsInScopeButCalledWithInsufficentLogLevel(CustomLogger logger)\n            {\n                try { }\n                catch // Noncompliant\n                {\n                    logger.Log(LogLevel.Trace, default(EventId), state: (object)null, exception: null, formatter: (o, ex) => String.Empty); // Secondary\n                }\n            }\n\n            [FunctionName(\"Sample\")]\n            public static void CustomParameterLoggerIsInScopeAndSomeNonInterfaceLogMethodIsCalledWithInsufficentLogLevel(CustomLogger logger)\n            {\n                try { }\n                catch // Noncompliant\n                {\n                    logger.Log(LogLevel.Trace, \"\"); // Secondary\n                }\n            }\n\n            [FunctionName(\"Sample\")]\n            public static void CustomParameterLoggerIsInScopeAndSomeNonInterfaceLogMethodIsCalledWithSufficentLogLevel(CustomLogger logger)\n            {\n                try { }\n                catch\n                {\n                    logger.Log(LogLevel.Error, \"\"); // Compliant\n                }\n            }\n\n            [FunctionName(\"Sample\")]\n            public static void CustomParameterLoggerIsInScopeAndSomeNonInterfaceLogMethodIsCalledWithoutLogLevelArgument(CustomLogger logger)\n            {\n                try { }\n                catch\n                {\n                    logger.Log(\"\"); // Compliant\n                }\n            }\n        }\n\n        public class CustomLoggerDependencyInjection\n        {\n            private readonly CustomLogger _logger;\n\n            [FunctionName(\"Sample\")]\n            public void CustomLoggerInScopeMustBeCalled()\n            {\n                try { }\n                catch { } // Noncompliant.\n            }\n\n            [FunctionName(\"Sample\")]\n            public void CustomLoggerLogCalled()\n            {\n                try { }\n                catch\n                {\n                    _logger.Log(LogLevel.Error, default(EventId), state: (object)null, exception: null, formatter: (o, ex) => String.Empty); // Compliant.\n                }\n            }\n\n            [FunctionName(\"Sample\")]\n            public void CustomLoggerLogCalledWithUnsufficientLogLevel()\n            {\n                try { }\n                catch // Noncompliant\n                {\n                    _logger.Log(LogLevel.Trace, default(EventId), state: (object)null, exception: null, formatter: (o, ex) => String.Empty); // Secondary\n                }\n            }\n\n            [FunctionName(\"Sample\")]\n            public void CustomLoggerOtherMethodCalled()\n            {\n                try { }\n                catch\n                {\n                    _logger.SomeOtherMethodOnCustomLogger(); // Compliant. Any other call is considered as valid logging\n                }\n            }\n\n            [FunctionName(\"Sample\")]\n            public void CustomLoggerNonLoggingMethodIsEnabledFromILogger()\n            {\n                try { }\n                catch // Noncompliant\n                {\n                    _logger.IsEnabled(LogLevel.Error); // Secondary\n                }\n            }\n\n            [FunctionName(\"Sample\")]\n            public void CustomLoggerNonLoggingMethodBeginScopeFromILogger()\n            {\n                try { }\n                catch // Noncompliant\n                {\n                    _logger.BeginScope((object)null); // Secondary\n                }\n            }\n\n            [FunctionName(\"Sample\")]\n            public void CustomLoggerOtherExtensionMethodCalled()\n            {\n                try { }\n                catch\n                {\n                    _logger.SomeExtensionMethod(); // Compliant. Any unknown extension method is considered as valid logging\n                }\n            }\n\n            [FunctionName(\"Sample\")]\n            public void CustomLoggerSpecialNamedExtensionInvalidMethodCalled()\n            {\n                try { }\n                catch\n                {\n                    _logger.LogTrace(); // Special named extension methods are only considered if they are defined in Microsoft.Extensions.Logging.LoggerExtensions\n                }\n            }\n\n            [FunctionName(\"Sample\")]\n            public void CustomLoggerSpecialNamedExtensionValidMethodCalled()\n            {\n                try { }\n                catch\n                {\n                    _logger.LogError(); // Compliant.\n                }\n            }\n        }\n    }\n\n    namespace ImplicitILoggerImpl\n    {\n        public class CustomLogger : ILogger\n        {\n            void ILogger.Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter) { }\n            bool ILogger.IsEnabled(LogLevel logLevel) => true;\n            IDisposable ILogger.BeginScope<TState>(TState state) => null;\n        }\n\n        public class CustomLoggerDependencyInjection\n        {\n            private readonly CustomLogger _logger;\n\n            [FunctionName(\"Sample\")]\n            public void CastedToILoggerCallsLogError()\n            {\n                try { }\n                catch\n                {\n                    ((ILogger)_logger).LogError(\"\"); // Compliant.\n                }\n            }\n\n            [FunctionName(\"Sample\")]\n            public void CastedToILoggerCallsLogTrace()\n            {\n                try { }\n                catch // Noncompliant.\n                {\n                    ((ILogger)_logger).LogTrace(\"\"); // Secondary\n                }\n            }\n\n            [FunctionName(\"Sample\")]\n            public void CastedToILoggerCallsLogInstanceMethodWithLogLevelTrace()\n            {\n                try { }\n                catch // Noncompliant.\n                {\n                    ((ILogger)_logger).Log(LogLevel.Trace, default(EventId), (object)null, default(Exception), (s, ex) => string.Empty); // Secondary\n                }\n            }\n        }\n    }\n}\n\nnamespace AzureFunctionLogFailuresMissingUsingTests\n{\n    using Microsoft.AspNetCore.Http;\n    using Microsoft.AspNetCore.Mvc;\n    using Microsoft.Azure.WebJobs;\n    using Microsoft.Azure.WebJobs.Extensions.Http;\n    using Microsoft.Extensions.Logging.Abstractions;\n    using System;\n    using System.IO;\n    using System.Threading.Tasks;\n\n    public class LoggerNotInScopeStaticFunction\n    {\n        [FunctionName(\"Sample\")]\n        public static void ILoggerNotImported(ILogger log) // Error [CS0246]: The type or namespace name 'ILogger'\n        {\n            try { }\n            catch { } // Compliant\n        }\n    }\n\n    public class LoggerNotInScopeInstance\n    {\n        private ILogger log; // Error [CS0246]: The type or namespace name 'ILogger'\n\n        [FunctionName(\"Sample\")]\n        public void ILoggerNotImported()\n        {\n            try { }\n            catch { } // Compliant\n        }\n\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CloudNative/AzureFunctionsReuseClients.ArmClient.cs",
    "content": "﻿namespace FunctionApp1\n{\n    using Azure.Identity;\n    using Azure.ResourceManager;\n    using Microsoft.Azure.WebJobs;\n\n    public static class Function1\n    {\n        [FunctionName(\"Sample\")]\n        public static void Run()\n        {\n            var armClient = new ArmClient(new DefaultAzureCredential()); // Noncompliant {{Reuse client instances rather than creating new ones with each function invocation.}}\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CloudNative/AzureFunctionsReuseClients.CosmosClient.cs",
    "content": "﻿namespace FunctionApp1\n{\n    using Microsoft.Azure.Cosmos;\n    using Microsoft.Azure.WebJobs;\n\n    public static class Function1\n    {\n        [FunctionName(\"Sample\")]\n        public static void Run()\n        {\n            using (var client = new CosmosClient(\"connectionString\")) // Noncompliant {{Reuse client instances rather than creating new ones with each function invocation.}}\n//                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            {\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CloudNative/AzureFunctionsReuseClients.DocumentClient.cs",
    "content": "﻿namespace FunctionApp1\n{\n    using System;\n    using Microsoft.Azure.Documents.Client;\n    using Microsoft.Azure.WebJobs;\n\n    public static class Function1\n    {\n        [FunctionName(\"Sample\")]\n        public static void Run()\n        {\n            using (var client = new DocumentClient(new Uri(\"https://example.com\"), \"token\")) // Noncompliant {{Reuse client instances rather than creating new ones with each function invocation.}}\n//                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            {\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CloudNative/AzureFunctionsReuseClients.HttpClient.CSharp9.cs",
    "content": "﻿namespace DifferentAssignments\n{\n    using Microsoft.AspNetCore.Http;\n    using Microsoft.AspNetCore.Mvc;\n    using Microsoft.Azure.WebJobs;\n    using Microsoft.Azure.WebJobs.Extensions.Http;\n    using Microsoft.Extensions.Logging;\n    using System;\n    using System.Net.Http;\n    using System.Threading.Tasks;\n\n    public class FunctionApp1\n    {\n        private static HttpClient field;\n\n        [FunctionName(\"Sample\")]\n        public static void DifferentAssigments()\n        {\n            field ??= new HttpClient();                       // Compliant\n\n            var local = default(HttpClient);\n            local ??= new HttpClient();                       // FN, needs SE to be able to raise an issue.\n\n            _ = new HttpClient();                             // Noncompliant\n            using var localUsingStatement = new HttpClient(); // Noncompliant\n            HttpClient targetTypedNew = new();                // Noncompliant\n            field = new();                                    // Compliant\n\n            PassThrough(field = new());                       // Compliant\n        }\n\n        private static HttpClient PassThrough(HttpClient httpClient) => httpClient;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CloudNative/AzureFunctionsReuseClients.HttpClient.cs",
    "content": "﻿using Microsoft.AspNetCore.Http;\nusing Microsoft.AspNetCore.Mvc;\nusing Microsoft.Azure.WebJobs;\nusing Microsoft.Azure.WebJobs.Extensions.Http;\nusing Microsoft.Extensions.Logging;\nusing System;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nnamespace FunctionApp1\n{\n    public static class Function1\n    {\n        [FunctionName(\"DefaultSample\")]\n        public static async Task<IActionResult> Run(\n            [HttpTrigger(AuthorizationLevel.Function, \"get\", \"post\", Route = null)] HttpRequest req,\n            ILogger log)\n        {\n            var client = new HttpClient();  // Noncompliant {{Reuse client instances rather than creating new ones with each function invocation.}}\n//                       ^^^^^^^^^^^^^^^^\n            var result = await client.GetAsync(\"\");\n            return new OkObjectResult(\"\");\n        }\n    }\n}\n\nnamespace DifferentAssignments\n{\n    public class FunctionApp1\n    {\n        private static HttpClient client = new HttpClient(); // Compliant\n        private static readonly Lazy<HttpClient> lazyClient = new Lazy<HttpClient>(() => new HttpClient()); // Compliant\n        private static HttpClient parenthesesInInitialzer = (new HttpClient()); // Compliant\n        private static object castInInitialzer = (object)(new HttpClient());    // Compliant\n        private static object _lock = new object();\n        private static object someField;\n\n        protected static HttpClient ClientProperty { get; set; } = new HttpClient(); // Compliant\n        protected static Lazy<HttpClient> LazyClientProperty { get; set; } = new Lazy<HttpClient>(() => new HttpClient()); // Compliant\n\n        protected HttpClient ClientPropertyAccessor { get => new HttpClient(); } // FN\n        protected HttpClient ClientPropertyAccessorArrow => new HttpClient();    // FN\n\n        static FunctionApp1()\n        {\n            ClientProperty = new HttpClient(); // Compliant\n        }\n\n        [FunctionName(\"Sample\")]\n        public static void Assignments()\n        {\n            client = new HttpClient();                           // Compliant. The field is unconditionally assigned on each call, but we don't do SymbolicExecution analysis\n            FunctionApp1.client = new HttpClient();              // Compliant\n            ClientProperty = new HttpClient();                   // Compliant\n            FunctionApp1.ClientProperty = new HttpClient();      // Compliant\n            ClientProperty = (new HttpClient());                 // Compliant\n            someField = (object)(new HttpClient());              // Noncompliant FP. Some trickery to confuse the analyzer.\n            someField = (new HttpClient() as object);            // Noncompliant FP\n            client = PassThrough(new HttpClient());              // Noncompliant FP\n            client = client ?? new HttpClient();                 // Noncompliant FP\n            client = client == null ? new HttpClient() : client; // Compliant\n            PassThrough(new HttpClient());                       // Noncompliant\n            var local = new HttpClient();                        // Noncompliant\n            local = new System.Net.Http.HttpClient();            // Noncompliant\n            PassThrough(local = new HttpClient());               // Noncompliant\n            PassThrough(client = new HttpClient());              // Compliant\n            var otherClient = new UriBuilder();                  // Compliant\n        }\n\n        public static void NotAnAzureFunction()\n        {\n            var local = new HttpClient(); // Compliant\n        }\n\n        [FunctionName(\"Sample\")]\n        public static void AssignInCondition()\n        {\n            if (client == null)\n            {\n                client = new HttpClient(); // Compliant\n            }\n        }\n\n        [FunctionName(\"Sample\")]\n        public static void AssignInConditionWithLock()\n        {\n            if (client == null)\n            {\n                lock (_lock)\n                {\n                    if (client == null)\n                    {\n                        client = new HttpClient(); // Compliant\n                    }\n                }\n            }\n        }\n\n        [FunctionName(\"Sample\")]\n        public static void AssignWithClientFactory(IHttpClientFactory factory)\n        {\n            var local = factory.CreateClient(\"SomeName\"); // Compliant\n        }\n\n        [FunctionName(\"Sample\")]\n        public static void AssigntoLocal()\n        {\n            var local = new HttpClient(); // Noncompliant\n        }\n\n        [FunctionName(\"Sample\")]\n        public static void WrapInUsingBlock()\n        {\n            using (var local = new HttpClient()) // Noncompliant\n            {\n            }\n        }\n\n        [FunctionName(\"Sample\")]\n        public static void NoAssignment()\n        {\n            new HttpClient(); // Noncompliant\n        }\n\n        [FunctionName(\"Sample\")]\n        public static async Task NoAssignmentAndCall()\n        {\n            await new HttpClient().GetStringAsync(@\"http://example.com\"); // Noncompliant\n        }\n\n        [FunctionName(\"Sample\")]\n        public static async Task AssignmentOfInvocationResult()\n        {\n            someField = await new HttpClient().GetStringAsync(@\"http://example.com\"); // Noncompliant\n        }\n\n        private static HttpClient PassThrough(HttpClient httpClient) => httpClient;\n    }\n}\n\nnamespace DependencyInjection\n{\n    using Microsoft.AspNetCore.Http;\n    using Microsoft.AspNetCore.Mvc;\n    using Microsoft.Azure.WebJobs;\n    using Microsoft.Azure.WebJobs.Extensions.Http;\n    using Microsoft.Extensions.Logging;\n    using System;\n    using System.Net.Http;\n    using System.Threading.Tasks;\n\n    public class FunctionApp1\n    {\n        private HttpClient clientField = new HttpClient();                     // Compliant\n        private HttpClient ClientProperty { get; set; } = new HttpClient();    // Compliant\n        private HttpClient ClientPropertyAccessor { get => new HttpClient(); } // FN\n        private HttpClient ClientPropertyAccessorArrow => new HttpClient();    // FN\n\n        public FunctionApp1(HttpClient httpClient)\n        {\n            clientField = httpClient;    // Compliant\n            ClientProperty = httpClient; // Compliant\n        }\n\n        public FunctionApp1()\n        {\n            clientField = new HttpClient();    // FN. HttpClient should be injected. This is more related to DI than AzureFunctions and should therefore not be detected here.\n            ClientProperty = new HttpClient(); // FN\n        }\n\n        [FunctionName(\"Sample\")]\n        public void Assignments()\n        {\n            clientField = new HttpClient();           // Noncompliant\n            ClientProperty = new HttpClient();        // Noncompliant\n            var local = new HttpClient();             // Noncompliant\n            local = new System.Net.Http.HttpClient(); // Noncompliant\n            local = ClientPropertyAccessor;           // FN\n            var otherClient = new UriBuilder();       // Compliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CloudNative/AzureFunctionsReuseClients.ServiceBusV5.cs",
    "content": "﻿namespace FunctionApp1\n{\n    using Microsoft.Azure.ServiceBus;\n    using Microsoft.Azure.ServiceBus.Management;\n    using Microsoft.Azure.WebJobs;\n\n    public static class Function1\n    {\n        [FunctionName(\"Sample\")]\n        public static void Run()\n        {\n            var queue = new QueueClient(\"connectionString\", \"entityPath\");                           // Noncompliant {{Reuse client instances rather than creating new ones with each function invocation.}}\n            var session = new SessionClient(\"connectionString\", \"entityPath\");                       // Noncompliant\n            var topic = new TopicClient(\"connectionString\", \"entityPath\");                           // Noncompliant\n            var subscription = new SubscriptionClient(\"connectionString\", \"topic\", \"subscription\");  // Noncompliant\n            var management = new ManagementClient(\"connectionString\");                               // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CloudNative/AzureFunctionsReuseClients.ServiceBusV7.cs",
    "content": "﻿namespace FunctionApp1\n{\n    using Azure.Messaging.ServiceBus;\n    using Azure.Messaging.ServiceBus.Administration;\n    using Microsoft.Azure.WebJobs;\n\n    public static class Function1\n    {\n        [FunctionName(\"Sample\")]\n        public static void Run()\n        {\n            var serviceBus = new ServiceBusClient(\"connectionString\");          // Noncompliant {{Reuse client instances rather than creating new ones with each function invocation.}}\n            var admin = new ServiceBusAdministrationClient(\"connectionString\"); // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CloudNative/AzureFunctionsReuseClients.Storage.cs",
    "content": "﻿namespace FunctionApp1\n{\n    using Azure.Storage.Blobs;\n    using Azure.Storage.Blobs.Specialized;\n    using Azure.Storage.Files.DataLake;\n    using Azure.Storage.Files.Shares;\n    using Azure.Storage.Queues;\n    using Microsoft.Azure.WebJobs;\n\n    public static class Function1\n    {\n        [FunctionName(\"Sample\")]\n        public static void Run()\n        {\n            // The compliant clients usually pick up parameters from the request to pass to the constructor. They can not be made reusable.\n            var blobService = new BlobServiceClient(\"connectionString\");                    // Noncompliant\n            var blobContainer = new BlobContainerClient(\"connectionString\", \"container\");   // Compliant\n            var blob = new BlobClient(\"connectionString\", \"container\", \"blob\");             // Compliant\n            var appendBlob = new AppendBlobClient(\"connectionString\", \"container\", \"blob\"); // Compliant\n            var blockBlob = new BlockBlobClient(\"connectionString\", \"container\", \"blob\");   // Compliant\n            var pageBlob = new PageBlobClient(\"connectionString\", \"container\", \"blob\");     // Compliant\n\n            var queueService = new QueueServiceClient(\"connectionString\"); // Noncompliant\n            var queue = new QueueClient(\"connectionString\", \"queueName\");  // Compliant\n\n            var shareService = new ShareServiceClient(\"connectionString\");                                   // Noncompliant\n            var share = new ShareClient(\"connectionString\", \"shareName\");                                    // Compliant\n            var shareDirectory = new ShareDirectoryClient(\"connectionString\", \"shareName\", \"directoryPath\"); // Compliant\n            var shareFile = new ShareFileClient(\"connectionString\", \"shareName\", \"filePath\");                // Compliant\n\n            var dataLakeService = new DataLakeServiceClient(\"connectionString\");                                       // Noncompliant\n            var dataLakeDirectory = new DataLakeDirectoryClient(\"connectionString\", \"fileSystemName\", \"direcoryPath\"); // Compliant\n            var dataLakeFile = new DataLakeFileClient(\"connectionString\", \"fileSystemName\", \"filePath\");               // Compliant\n            var dataLakePath = new DataLakePathClient(\"connectionString\", \"fileSystemName\", \"path\");                   // Compliant\n            var dataLakeFileSystem = new DataLakeFileSystemClient(\"connectionString\", \"fileSystemName\");               // Compliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CloudNative/AzureFunctionsStateless.Latest.Partial.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\nusing Microsoft.Azure.WebJobs;\n\npublic static partial class StaticPartialClass\n{\n    public static partial int PartialProperty { get { return 42; } set { } }\n\n    public static partial void Update(int value) =>\n        PartialProperty = value; //Noncompliant\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CloudNative/AzureFunctionsStateless.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\nusing Microsoft.Azure.WebJobs;\n\npublic static class AzureFunctionsStatic\n{\n    public static int Field;\n\n    [FunctionName(\"Sample\")]\n    public static void SideEffects()\n    {\n        WithArg(Field >>>= 1); // Noncompliant\n    }\n\n    private static void WithArg(int value) { }\n}\n\npublic static partial class StaticPartialClass\n{\n    public static partial int PartialProperty { get; set; }\n    [FunctionName(\"Sample\")]\n    public static partial void Update(int value);\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CloudNative/AzureFunctionsStateless.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\nusing Microsoft.Azure.WebJobs;\n\npublic class AnotherAttribute : Attribute\n{\n    public AnotherAttribute(string name) { }\n}\n\npublic static class StaticClass\n{\n    public static int Property { get; set; }\n    public static int Field;\n\n    public static void Update(int value) =>\n        Property = value;\n}\n\npublic class InstanceClass\n{\n    public int PropertyInstance { get; set; }\n    public int FieldInstance;\n\n    public static int PropertyStatic { get; set; }\n    public static int FieldStatic;\n\n    public static void UpdateStatic(int value) =>\n        PropertyStatic = value;\n\n    public void UpdateInstance(int value) =>\n        PropertyInstance = value;\n}\n\nnamespace Inside.Namespace\n{\n    public static class Something\n    {\n        public static int Field;\n    }\n}\n\npublic static class AzureFunctionsStatic\n{\n    public static int Property { get; set; }\n    public static int Field;\n    public static int[] Array;\n    public static object FieldObj;\n\n    [Another(\"Something\")]\n    public static void WithAnotherAttribute()   // Compliant\n    {\n        Property = 42;\n    }\n\n    public static void NoAttribute()\n    {\n        StaticClass.Property = 42;              // Compliant\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void Write(int arg, object argObject)\n    {\n        var local = 0;\n        arg = 42;\n\n        Property = 42;          // Noncompliant {{Do not modify a static state from Azure Function.}}\n        Field = 42;             // Noncompliant {{Do not modify a static state from Azure Function.}}\n        Array[0] = 42;          // Noncompliant {{Do not modify a static state from Azure Function.}}\n\n        Property = local;       // Noncompliant\n        Field = local;          // Noncompliant\n\n        Property = Calculate(); // Noncompliant\n        Field = Calculate();    // Noncompliant\n\n        StaticClass.Update(42);             // Not tracked, we don't analyze cross-procedure\n        StaticClass.Field = 42;             // Noncompliant {{Do not modify a static state from Azure Function.}}\n        StaticClass.Property = 42;          // Noncompliant {{Do not modify a static state from Azure Function.}}\n//      ^^^^^^^^^^^^^^^^^^^^\n        AzureFunctionsStatic.Array[0] = 42; // Noncompliant {{Do not modify a static state from Azure Function.}}\n//      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n        InstanceClass.UpdateStatic(42);     // Not tracked, we don't analyze cross-procedure\n        InstanceClass.PropertyStatic = 42;  // Noncompliant\n        InstanceClass.FieldStatic = 42;     // Noncompliant\n\n        Inside.Namespace.Something.Field = 42;           // Noncompliant\n        global::Inside.Namespace.Something.Field = 42;   // Noncompliant\n//      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n        var o = new InstanceClass();\n        o.UpdateInstance(42);\n        o.PropertyInstance = 42;    // Compliant, not static\n        o.FieldInstance = 42;\n\n        FieldObj = 42;              // Noncompliant\n        FieldObj = new object();    // Noncompliant\n        FieldObj = argObject;       // Noncompliant\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void WriteArrow() =>\n        Property = 42;      // Noncompliant\n\n    [FunctionName(\"Sample\")]\n    public static async Task<string> AsyncTask()\n    {\n        Property = 42;      // Noncompliant\n        return null;\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void ReadLocal()\n    {\n        var a = Property;\n        var b = Field;\n        var c = Array[0];\n        if (Property == 0) { }\n        if (Field == 0) { }\n        if (Array[0] == 0) { }\n        WithArg(Property);\n        WithArg(Field);\n        WithArg(Array[0]);\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void SideEffects()\n    {\n        var a = Field = 42;         // Noncompliant\n        if ((Field = 42) == 0) { }  // Noncompliant\n        if (Field++ == 0) { }       // Noncompliant\n        if ((Field += 1) == 0) { }  // Noncompliant\n        WithArg(Field++);           // Noncompliant\n        WithArg(Field += 1);        // Noncompliant\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void RefOut()\n    {\n        WithRef(ref Field);         // Noncompliant {{Do not modify a static state from Azure Function.}}\n        WithOut(out Field);         // Noncompliant\n        WithOut(value: out Field);  // Noncompliant\n        WithOut(outOfOrder: 0, value: out Field);   // Noncompliant\n        //                                ^^^^^\n\n        var local = 0;\n        WithRef(ref local);\n        WithOut(out local);\n        WithOut(value: out local);\n        WithOut(outOfOrder: 0, value: out local);\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void Nested()\n    {\n        // We don't care if it's used or not. It probably is when it exists.\n        Action parenthesized = () => { Property = 42; };    // Noncompliant\n        Action<int> b = simple => { Property = 42; };       // Noncompliant\n\n        void LocalFunction()\n        {\n            Property = 42;      // Noncompliant\n        }\n    }\n\n    private static int Calculate() =>\n        0;\n\n    private static void WithArg(int value) { }\n\n    private static void WithRef(ref int value) =>\n        value = 0;\n\n    private static void WithOut(out int value) =>\n        value = 0;\n\n    private static void WithOut(out int value, int outOfOrder) =>\n        value = 0;\n\n}\n\npublic class AzureFunctionsInstance\n{\n    [FunctionName(\"Sample\")]\n    public static void Write()\n    {\n        StaticClass.Property = 42;  // Noncompliant\n    }\n}\n\npublic static class Operators\n{\n    private static int Field;\n    private static int[] Array;\n    private static object FieldObj;\n\n    [FunctionName(\"Sample\")]\n    public static void Unary()\n    {\n        Field++;    // Noncompliant\n        Field--;    // Noncompliant\n        ++Field;    // Noncompliant\n        --Field;    // Noncompliant\n        //^^^^^\n        Array[0]++; // Noncompliant\n        ++Array[0]; // Noncompliant\n\n        for (; Field < 100; Field++) { }    // Noncompliant\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void CompoundAssignment(object arg)\n    {\n        Field += 42;        // Noncompliant\n        Field -= 42;        // Noncompliant\n        Field *= 42;        // Noncompliant\n        Field /= 42;        // Noncompliant\n        Field %= 42;        // Noncompliant\n        Field &= 42;        // Noncompliant\n        Field |= 42;        // Noncompliant\n        Field ^= 42;        // Noncompliant\n        Field >>= 42;       // Noncompliant\n        Field <<= 42;       // Noncompliant\n        FieldObj ??= arg;   // Noncompliant\n\n        var a = FieldObj ?? arg;    // Compliant\n    }\n}\n\npublic static class Collections\n{\n    private static IList<int> List = new List<int>();\n    private static ISet<int> HSet = new HashSet<int>();\n    private static IDictionary<int, int> Dict = new Dictionary<int, int>();\n    private static int[] Array = { 0, 1, 2 };\n\n    [FunctionName(\"Sample\")]\n    public static void Add()\n    {\n        List.Add(42);       // FN\n        HSet.Add(42);       // FN\n        Dict.Add(42, 42);   // FN\n        Dict[0] = 42;       // Noncompliant\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void Remove()\n    {\n        List.Remove(42);    // FN\n        List.RemoveAt(0);   // FN\n        HSet.Remove(42);    // FN\n        Dict.Remove(42);    // FN\n    }\n\n    [FunctionName(\"Sample\")]\n    public static void Update()\n    {\n        List[0] = 42;       // Noncompliant\n        Dict[0] = 42;       // Noncompliant\n        Array[0] = 42;      // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CloudNative/DurableEntityInterfaceRestrictions.CSharp11.cs",
    "content": "﻿using System;\nusing System.Threading.Tasks;\nusing Microsoft.Azure.WebJobs.Extensions.DurableTask;\n\npublic interface IStaticVirtualMembersInInterfaces\n{\n    static virtual bool Method(string firstParam, string secondParam) => firstParam == secondParam;\n}\n\npublic interface IStaticVirtualMembersInInterfacesCompliant\n{\n    static virtual void Method(string firstParam) => Console.WriteLine(firstParam);\n}\n\npublic class UseDurableEntityContext\n{\n    private readonly IDurableEntityContext context;\n    private readonly EntityId id;\n\n    public void Overloads()\n    {\n        context.SignalEntity<IStaticVirtualMembersInInterfaces>(id, x => { });          // Noncompliant {{Use valid entity interface. IStaticVirtualMembersInInterfaces contains method \"Method\" with 2 parameters. Zero or one are allowed.}}\n        context.SignalEntity<IStaticVirtualMembersInInterfacesCompliant>(id, x => { }); // Compliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CloudNative/DurableEntityInterfaceRestrictions.cs",
    "content": "﻿using System;\nusing System.Threading.Tasks;\nusing Microsoft.Azure.WebJobs.Extensions.DurableTask;\n\npublic interface IValid\n{\n    void VoidNoArg();\n    void VoidArgInt(int count);\n    void VoidArgStr(string name);\n\n    Task TaskNoArg();\n    Task TaskArg(int count);\n\n    Task<int> TaskIntNoArg();\n    Task<int> TaskIntArg(int count);\n\n    Task<string> TaskStrNoArg();\n    Task<string> TaskStrArg(int count);\n}\n\npublic interface IEmpty\n{\n    // This is invalid and will throw\n}\n\npublic interface IInheritsEmptyWithValid : IEmpty\n{\n    void Valid();\n}\n\npublic interface IInheritsValidIsEmpty : IValid\n{\n    // Do not add anything => still valid\n}\n\npublic interface IInheritsValidIsEmpty2 : IInheritsValidIsEmpty\n{\n    // Do not add anything => still valid - another level of nesting\n}\n\npublic interface IInheritsEmptyIsEmpty : IEmpty\n{\n    // This is invalid and will throw\n}\n\npublic interface IInheritsInvalid : IInvalid\n{\n    void SomethingValid();\n}\n\npublic interface IInvalid : IMoreArguments\n{\n    // Just rename to have nice name for general tests below\n}\n\npublic interface IMoreArguments\n{\n    void Valid();\n    void Method(int first, string second);\n}\n\npublic interface IReturnsInt\n{\n    void Valid();\n    int Method();\n}\n\npublic interface IReturnsTaskArray\n{\n    void Valid();\n    Task[] Method();\n}\n\npublic interface IReturnsObject\n{\n    void Valid();\n    object Method();\n}\n\npublic interface IGenericInterface<T>\n{\n    void Valid();\n    void Method(T arg);\n}\n\npublic interface IGenericMethod\n{\n    void Valid();\n    void Method<T>(T arg);\n}\n\npublic interface IProperty\n{\n    void Valid();\n    int Value { get; }\n}\n\npublic interface IIndexer\n{\n    void Valid();\n    int this[int index] { get; set; }\n}\n\npublic interface IEvent\n{\n    void Valid();\n    event EventHandler<EventArgs> Event;\n}\n\npublic class NotInterfaceClass { }\npublic struct NotInterfaceStruct { }\n\npublic class UseDurableEntityClient\n{\n    private readonly IDurableEntityClient client;\n    private readonly EntityId id;\n\n    public async Task UnrelatedMethods()\n    {\n        await client.ReadEntityStateAsync<IInvalid>(id);    // T is a type of the returned data. It's not an entity interface.\n        await client.SignalEntityAsync(id, \"name\");         // Always compliant, same name but not generic\n    }\n\n    public async Task Compliant()\n    {\n        await client.SignalEntityAsync<IValid>(id, x => { });\n        await client.SignalEntityAsync<IInheritsEmptyWithValid>(id, x => { });\n        await client.SignalEntityAsync<IInheritsValidIsEmpty>(id, x => { });\n        await client.SignalEntityAsync<IInheritsValidIsEmpty2>(id, x => { });\n    }\n\n    public async Task Overloads()\n    {\n        await client.SignalEntityAsync<IInvalid>(id, x => { });                 // Noncompliant\n        await client.SignalEntityAsync<IInvalid>(\"id\", x => { });               // Noncompliant\n        await client.SignalEntityAsync<IInvalid>(id, DateTime.Now, x => { });   // Noncompliant\n        await client.SignalEntityAsync<IInvalid>(\"id\", DateTime.Now, x => { }); // Noncompliant\n        //           ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    }\n\n    public async Task Reasons()\n    {\n        await client.SignalEntityAsync<IEmpty>(id, x => { });                   // Noncompliant {{Use valid entity interface. IEmpty is empty.}}\n        await client.SignalEntityAsync<IInheritsEmptyIsEmpty>(id, x => { });    // Noncompliant {{Use valid entity interface. IInheritsEmptyIsEmpty is empty.}}\n        await client.SignalEntityAsync<IInheritsInvalid>(id, x => { });         // Noncompliant {{Use valid entity interface. IInheritsInvalid contains method \"Method\" with 2 parameters. Zero or one are allowed.}}\n        await client.SignalEntityAsync<IInvalid>(id, x => { });                 // Noncompliant {{Use valid entity interface. IInvalid contains method \"Method\" with 2 parameters. Zero or one are allowed.}}\n        await client.SignalEntityAsync<IMoreArguments>(id, x => { });           // Noncompliant {{Use valid entity interface. IMoreArguments contains method \"Method\" with 2 parameters. Zero or one are allowed.}}\n        await client.SignalEntityAsync<IReturnsInt>(id, x => { });              // Noncompliant {{Use valid entity interface. IReturnsInt contains method \"Method\" with invalid return type. Only \"void\", \"Task\" and \"Task<T>\" are allowed.}}\n        await client.SignalEntityAsync<IReturnsTaskArray>(id, x => { });        // Noncompliant {{Use valid entity interface. IReturnsTaskArray contains method \"Method\" with invalid return type. Only \"void\", \"Task\" and \"Task<T>\" are allowed.}}\n        await client.SignalEntityAsync<IReturnsObject>(id, x => { });           // Noncompliant {{Use valid entity interface. IReturnsObject contains method \"Method\" with invalid return type. Only \"void\", \"Task\" and \"Task<T>\" are allowed.}}\n        await client.SignalEntityAsync<IGenericInterface<int>>(id, x => { });   // Noncompliant {{Use valid entity interface. IGenericInterface is generic.}}\n        await client.SignalEntityAsync<IGenericMethod>(id, x => { });           // Noncompliant {{Use valid entity interface. IGenericMethod contains generic method \"Method\".}}\n        await client.SignalEntityAsync<IProperty>(id, x => { });                // Noncompliant {{Use valid entity interface. IProperty contains property \"Value\". Only methods are allowed.}}\n        await client.SignalEntityAsync<IIndexer>(id, x => { });                 // Noncompliant {{Use valid entity interface. IIndexer contains property \"this[]\". Only methods are allowed.}}\n        await client.SignalEntityAsync<IEvent>(id, x => { });                   // Noncompliant {{Use valid entity interface. IEvent contains event \"Event\". Only methods are allowed.}}\n        await client.SignalEntityAsync<NotInterfaceClass>(id, x => { });        // Noncompliant {{Use valid entity interface. NotInterfaceClass is not an interface.}}\n        await client.SignalEntityAsync<NotInterfaceStruct>(id, x => { });       // Noncompliant {{Use valid entity interface. NotInterfaceStruct is not an interface.}}\n    }\n\n    public async Task WithTypeParameter<T>()\n    {\n        await client.SignalEntityAsync<T>(id, x => { });    // Compliant, we can't tell what T is\n    }\n\n    public async Task FromDurableClient(IDurableClient inheritedClient)\n    {\n        await inheritedClient.SignalEntityAsync<IInvalid>(id, x => { });                 // Noncompliant\n    }\n}\n\npublic class UseDurableOrchestrationContext\n{\n    private readonly IDurableOrchestrationContext context;\n    private readonly EntityId id;\n\n    public void UnrelatedMethods()\n    {\n        context.GetInput<IInvalid>();\n    }\n\n    public void Overloads()\n    {\n        context.CreateEntityProxy<IInvalid>(id);        // Noncompliant {{Use valid entity interface. IInvalid contains method \"Method\" with 2 parameters. Zero or one are allowed.}}\n        context.CreateEntityProxy<IInvalid>(\"key\");     // Noncompliant\n        //      ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    }\n\n    public void Errors()\n    {\n        context.CreateEntityProxy<>(\"key\");             // Error [CS0305]: Using the generic method group 'CreateEntityProxy' requires 1 type arguments\n        context.CreateEntityProxy<Undefined>(\"key\");    // Error [CS0246]: The type or namespace name 'Undefined' could not be found\n        undefined.CreateEntityProxy<IInvalid>(\"key\");   // Error [CS0103]: The type or namespace name 'undefined' could not be found\n    }\n}\n\npublic class UseDurableEntityContext\n{\n    private readonly IDurableEntityContext context;\n    private readonly EntityId id;\n\n    public void Overloads()\n    {\n        context.SignalEntity<IInvalid>(id, x => { });                 // Noncompliant\n        context.SignalEntity<IInvalid>(\"id\", x => { });               // Noncompliant\n        context.SignalEntity<IInvalid>(id, DateTime.Now, x => { });   // Noncompliant\n        context.SignalEntity<IInvalid>(\"id\", DateTime.Now, x => { }); // Noncompliant\n    }\n}\n\npublic class AnotherType\n{\n    public void SignalEntityAsync<T>() { }\n    public void SignalEntityAsync<TFirst, TSecond>() { }\n\n    private static void Use(AnotherType client)\n    {\n        client.SignalEntityAsync<IInvalid>();           // Compliant, wrong type\n        client.SignalEntityAsync<IInvalid, IInvalid>(); // For coverage\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CognitiveComplexity.Latest.Partial.cs",
    "content": "﻿public partial class PartialProperty\n{\n    public partial int Property\n    {\n        get =>            // Noncompliant  {{Refactor this accessor to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n            true ? 0 : 1; // Secondary\n        set { }\n    }\n}\n\n\npublic partial class PartialConstructor\n{\n    public partial PartialConstructor() // Noncompliant  {{Refactor this constructor to reduce its Cognitive Complexity from 1 to the 0 allowed.}} \n    {\n        var x = true ? 1 : 0;           // Secondary\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CognitiveComplexity.Latest.cs",
    "content": "﻿// Noncompliant {{Refactor this top-level file to reduce its Cognitive Complexity from 9 to the 0 allowed.}}\nusing System;\nusing System.Collections.Generic;\n\nif (1 == 2) // Secondary  {{+1}}\n{\n\n}\nelse if (1 == 3) // Secondary  {{+1}}\n{\n\n}\nelse // Secondary  {{+1}}\n{\n}\n\nvoid LocalFunction()\n{\n    if (true) // Secondary  {{+2 (incl 1 for nesting)}}\n    {\n        return;\n    }\n}\n\n// Static local functions are excluded from the complexity computation of method\n// that they are nested in. They have their own complexity score as independent methods.\n// See issue https://github.com/SonarSource/sonar-dotnet/issues/5625\nstatic void StaticLocalFunction(int x) // Noncompliant {{Refactor this static local function to reduce its Cognitive Complexity from 4 to the 0 allowed.}}\n{\n    if (x == 1) // Secondary  {{+2 (incl 1 for nesting)}}\n    {\n        Console.WriteLine(x);\n    }\n    else if (x == 2) // Secondary  {{+1}}\n    {\n        Console.WriteLine(x);\n    }\n    else // Secondary  {{+1}}\n    {\n        return;\n    }\n}\n\nstring SwitchExpressionPatterns(object o) =>\n    o switch // we should propertly count the complexity of the inner patterns\n             // Secondary@-1  {{+2 (incl 1 for nesting)}}\n    {\n        string s => s.ToString(),\n        float => \"float\",\n        < 400 and > 30 => \"between 30 and 400\",  // Secondary  {{+1}}\n        0 or 1 => \"0 or 1\",  // Secondary  {{+1}}\n        null => \"null\",\n        not null => \"not null\",\n    };\n\nrecord MyRecord\n{\n    string aField;\n    string IfInProperty\n    {\n        init // Noncompliant {{Refactor this accessor to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n        {\n            if (true)\n//          ^^ Secondary {{+1}}\n            {\n                aField = \"\";\n            }\n        }\n    }\n\n    bool Prop => aField == null || aField is { Length: 5 }; // Noncompliant {{Refactor this property to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n                                                          //                                                           Secondary@-1 {{+1}}\n}\n\nclass AndOrConditionsComplexity\n{\n    bool SimpleNot(object o) => // should be 0\n        o is not string;\n\n    void And(int o) // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 2 to the 0 allowed.}}\n    {\n        if (o is > 0 and <= 10)\n//      ^^ Secondary {{+1}}\n//                   ^^^ Secondary@-1 {{+1}}\n            Console.WriteLine(\"More than 0 but less than or equal to 10\");\n    }\n\n    bool AndOr(int o) => // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 2 to the 0 allowed.}}\n        o is < 500 and > 300 or 1;\n    //             ^^^ Secondary {{+1}}\n    //                       ^^ Secondary@-1 {{+1}}\n\n    bool ChainedConditions(int number) => // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n        number is 1 or 2 or 4 or 5;\n    //              ^^ Secondary {{+1}}\n\n    bool ChainedConditionsWithParentheses(int number) => // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n        number is 1 or 2 or 4 or (5 or 6);\n    //              ^^ Secondary {{+1}}\n\n    bool ChainedSimilarConditionsWithParentheses(int one, int two) => // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 3 to the 0 allowed.}}\n        (one is 1 or 2 or 4 or 5) || (two is 3 or 5);\n    //            ^^ Secondary {{+1}}\n    //                            ^^ Secondary@-1 {{+1}}\n    //                                         ^^ Secondary@-2 {{+1}}\n\n    bool ChainedDifferentConditionsWithParentheses(int one, int? two) => // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 3 to the 0 allowed.}}\n        (one is 1 or 2 or 4 or 5) || (two is not null and 5);\n    //            ^^ Secondary {{+1}}\n    //                            ^^ Secondary@-1 {{+1}}\n    //                                                ^^^ Secondary@-2 {{+1}}\n\n    bool AndOrNot(object o) => // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 3 to the 0 allowed.}}\n        o is < 500 and > 300 or not (string or double);\n    //             ^^^ Secondary {{+1}}\n    //                       ^^ Secondary@-1 {{+1}}\n    //                                      ^^ Secondary@-2 {{+1}}\n}\n\nclass StaticLambda\n{\n    private Action<int> act = // Noncompliant {{Refactor this field to reduce its Cognitive Complexity from 2 to the 0 allowed.}}\n        static x =>\n        {\n            if (x > 0)\n//          ^^ Secondary {{+2 (incl 1 for nesting)}}\n            {\n\n            }\n        };\n}\n\nabstract class Fruit { public List<int> Prop; }\nclass Apple : Fruit { }\nclass Orange : Fruit { }\n\nclass TestProgram\n{\n    static void TargetTypedConditional(bool isTrue, Apple[] apples, Fruit[] givenFruits) // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n    {\n        Fruit[] fruits1 = isTrue ? new Apple[1] : new Orange[1];\n        //                       ^ Secondary {{+1}}\n        Fruit[] fruits2 = apples ?? givenFruits;\n        Fruit[] fruits3 = givenFruits ?? apples;\n    }\n}\n\nrecord Record\n{\n    Fruit aField;\n    bool Prop => aField == null || aField is { Prop.Count: 5 }; // Noncompliant {{Refactor this property to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n    //                                                           Secondary@-1 {{+1}}\n\n    public void SomeMethod()\n    {\n        int x;\n\n        (x, var y) = (16, 23);\n\n        var (a, b) = (16, 23);\n\n        var j = (a, b) = (23, 16);\n    }\n}\n\nclass MethodsComplexity\n{\n    void ListPattern() // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n    {\n        object[] numbers = { 1, 2, 3 };\n\n        if (numbers is [_, > 3, 3])\n//      ^^ Secondary {{+1}}\n        {\n            Console.WriteLine(\"Test\");\n        }\n    }\n}\n\npublic interface IStaticVirtualMembersInInterfaces\n{\n    static virtual void Method(string firstParam, string secondParam) // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n    {\n        if (firstParam == secondParam)\n//      ^^ Secondary {{+1}}\n        {\n            Console.WriteLine(firstParam.ToString());\n        }\n    }\n}\n\nclass LocalFunctionTest\n{\n    void Foo(int x) // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 4 to the 0 allowed.}}\n    {\n        if (x == 0) // Secondary  {{+1}}\n        {\n            return;\n        }\n\n        void LocalFunction(int x)\n        {\n            if (x == 0) // Secondary\n            {\n                Console.WriteLine(x);\n            }\n            else // Secondary\n            {\n                return;\n            }\n        }\n\n        // Static local functions are excluded from the complexity computation of method\n        // that they are nested in. They have their own complexity score as independent methods.\n        // See issue https://github.com/SonarSource/sonar-dotnet/issues/5625\n        static void StaticLocalFunction(int x) // Noncompliant  {{Refactor this static local function to reduce its Cognitive Complexity from 3 to the 0 allowed.}}\n        {\n            if (x == 0) // Secondary {{+2 (incl 1 for nesting)}}\n            {\n                Console.WriteLine(x);\n            }\n            else // Secondary {{+1}}\n            {\n                return;\n            }\n        }\n    }\n}\n\npublic partial class PartialProperty\n{\n    public partial int Property { get; set; }\n}\n\npublic static class Extensions\n{\n    extension(Extensions)\n    {\n        public static int Prop\n        {\n            get =>              // Noncompliant  {{Refactor this accessor to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n                true ? 0 : 1;   // Secondary\n            set { }\n        }\n\n        public static bool Where() { return true ? true : false; } // Noncompliant\n                                                                   // Secondary@-1\n    }\n}\n\npublic class FieldKeyWord\n{\n    public int Prop\n    {\n        get =>                  // Noncompliant  {{Refactor this accessor to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n            field == 1 ? 1 : 0; // Secondary\n    }\n}\n\npublic partial class PartialConstructor\n{\n    public partial PartialConstructor();\n}\n\npublic class NullConditionalAssignment\n{\n    public class FieldClass\n    {\n        public int value;\n    }\n    public FieldClass Prop\n    {\n        get => new();\n        set =>                                           // Noncompliant  {{Refactor this accessor to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n            true ? field?.value = 10 : field?.value = 0; // Secondary\n                                                         // Error@-1 [CS0201]\n    }\n\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CognitiveComplexity.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Tests.Diagnostics\n{\n    class MethodsComplexity\n    {\n        void Zero() { }\n\n        void If() // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n        {\n            if (true)\n//          ^^ Secondary {{+1}}\n            {\n\n            }\n        }\n\n        void IfElseIfElse() // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 3 to the 0 allowed.}}\n        {\n            if (1 == 2)\n//          ^^ Secondary {{+1}}\n            {\n\n            }\n            else if (1 == 3)\n//          ^^^^ Secondary {{+1}}\n            {\n\n            }\n            else\n//          ^^^^ Secondary {{+1}}\n            {\n            }\n        }\n\n        void IfNestedInElse() // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 4 to the 0 allowed.}}\n        {\n            if (true)\n//          ^^ Secondary {{+1}}\n            {\n\n            }\n            else\n//          ^^^^ Secondary {{+1}}\n            {\n                if (false)\n//              ^^ Secondary {{+2 (incl 1 for nesting)}}\n                {\n                }\n            }\n        }\n\n        void IfElseNestedInIf() // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 4 to the 0 allowed.}}\n        {\n            if (true)\n//          ^^ Secondary {{+1}}\n            {\n                if (true)\n//              ^^ Secondary {{+2 (incl 1 for nesting)}}\n                {\n\n                }\n                else\n//              ^^^^ Secondary {{+1}}\n                {\n\n                }\n            }\n        }\n\n        void MultipleIfNested() // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 6 to the 0 allowed.}}\n        {\n            if (true)\n//          ^^ Secondary {{+1}}\n                if (true)\n//              ^^ Secondary {{+2 (incl 1 for nesting)}}\n                    if (true)\n//                  ^^ Secondary {{+3 (incl 2 for nesting)}}\n                    {\n\n                    }\n        }\n\n        void Switch() // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n        {\n            switch (10)\n//          ^^^^^^ Secondary {{+1}}\n            {\n                case 1:\n                    break;\n                case 2:\n                    break;\n                default:\n                    break;\n            }\n        }\n\n        void NestedSwitch() // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 3 to the 0 allowed.}}\n        {\n            if (true)\n//          ^^ Secondary {{+1}}\n            {\n                switch (10)\n//              ^^^^^^ Secondary {{+2 (incl 1 for nesting)}}\n                {\n                    case 1:\n                        break;\n                    case 2:\n                        break;\n                    default:\n                        break;\n                }\n            }\n        }\n\n        void SwitchWithNestedIf() // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 3 to the 0 allowed.}}\n        {\n            switch (10)\n//          ^^^^^^ Secondary {{+1}}\n            {\n                case 0:\n                    if (true)\n//                  ^^ Secondary {{+2 (incl 1 for nesting)}}\n                    {\n\n                    }\n                    break;\n                default:\n                    break;\n            }\n        }\n\n        void SwitchExpression(int count) // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n        {\n            var x = count switch\n//                        ^^^^^^ Secondary {{+1}}\n            {\n                0 => \"zero\",\n                _ => \"other\"\n            };\n        }\n\n        void NestedSwitchExpression(bool first, bool second) // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 3 to the 0 allowed.}}\n        {\n            var x = first switch\n//                        ^^^^^^ Secondary {{+1}}\n            {\n                true => second switch\n//                             ^^^^^^ Secondary {{+2 (incl 1 for nesting)}}\n                {\n                    true => 1,\n                    false => 2\n                },\n                _ => 3\n            };\n        }\n\n        void MultipleSwitchExpression(bool first, bool second) // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 2 to the 0 allowed.}}\n        {\n            var x = first switch\n//                        ^^^^^^ Secondary {{+1}}\n            {\n                true => 1,\n                _ => 2\n            };\n\n            x = second switch\n//                     ^^^^^^ Secondary {{+1}}\n            {\n                true => 3,\n                _ => 4\n            };\n        }\n\n        void TernaryOperator() // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n        {\n            var t = true ? 0 : 1;\n//                       ^ Secondary {{+1}}\n        }\n\n        void NestedTernaryOperator() // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 3 to the 0 allowed.}}\n        {\n            if (true)\n//          ^^ Secondary {{+1}}\n            {\n                var t = true ? 0 : 1;\n//                           ^ Secondary {{+2 (incl 1 for nesting)}}\n            }\n        }\n\n        void NullConditional() // Compliant - Null conditional operators should be ignored\n        {\n            var a = new int[1];\n\n            var b = a?.Length;\n            var c = a?[0];\n        }\n\n        void NullCoalescence() // Compliant - Null coalescence operators should be ignored\n        {\n            bool? value = null;\n\n            value ??= true;\n        }\n\n        void NullCoalescenceAssignment() // Compliant - Null coalescence operators should be ignored\n        {\n            bool? value = null;\n\n            value ??= true;\n        }\n\n        void TernaryOperatorWihtInnerTernayOperator() // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 3 to the 0 allowed.}}\n        {\n            var t = true ? false ? -1 : 0 : 1;\n//                       ^ Secondary {{+1}}\n//                               ^ Secondary@-1 {{+2 (incl 1 for nesting)}}\n        }\n\n        void While() // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n        {\n            while (true)\n//          ^^^^^ Secondary {{+1}}\n            {\n\n            }\n        }\n\n        void NestedWhile() // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 3 to the 0 allowed.}}\n        {\n            if (true)\n//          ^^ Secondary {{+1}}\n            {\n                while (true)\n//              ^^^^^ Secondary {{+2 (incl 1 for nesting)}}\n                {\n\n                }\n            }\n        }\n\n        void For() // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n        {\n            for (int i = 0; i < 10; i++)\n//          ^^^ Secondary {{+1}}\n            {\n\n            }\n        }\n\n        void NestedFor() // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 3 to the 0 allowed.}}\n        {\n            if (true)\n//          ^^ Secondary {{+1}}\n            {\n                for (int i = 0; i < 10; i++)\n//              ^^^ Secondary {{+2 (incl 1 for nesting)}}\n                {\n\n                }\n            }\n        }\n\n        void Foreach() // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n        {\n            foreach (var item in Enumerable.Empty<int>())\n//          ^^^^^^^ Secondary {{+1}}\n            {\n            }\n        }\n\n        void NestedForeach() // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 3 to the 0 allowed.}}\n        {\n            if (true)\n//          ^^ Secondary {{+1}}\n            {\n                foreach (var item in Enumerable.Empty<int>())\n//              ^^^^^^^ Secondary {{+2 (incl 1 for nesting)}}\n                {\n                }\n            }\n        }\n\n        void DoWhile() // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n        {\n            do\n//          ^^ Secondary {{+1}}\n            {\n\n            } while (true);\n        }\n\n        void NestedDoWhile() // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 3 to the 0 allowed.}}\n        {\n            if (true)\n//          ^^ Secondary {{+1}}\n            {\n                do\n//              ^^ Secondary {{+2 (incl 1 for nesting)}}\n                {\n\n                } while (true);\n            }\n        }\n\n        void TryCatch() // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n        {\n            try\n            {\n\n            }\n            catch (Exception)\n//          ^^^^^ Secondary {{+1}}\n            {\n                throw;\n            }\n        }\n\n        void TryCatchIf() // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 3 to the 0 allowed.}}\n        {\n            try\n            {\n\n            }\n            catch (Exception)\n//          ^^^^^ Secondary {{+1}}\n            {\n                if (true)\n//              ^^ Secondary {{+2 (incl 1 for nesting)}}\n                {\n                    throw;\n                }\n            }\n        }\n\n        void NestedTryCatch() // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 3 to the 0 allowed.}}\n        {\n            if (true)\n//          ^^ Secondary {{+1}}\n            {\n                try\n                {\n\n                }\n                catch (Exception)\n//              ^^^^^ Secondary {{+2 (incl 1 for nesting)}}\n                {\n                    throw;\n                }\n            }\n        }\n\n        void TryCatchFinally() // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n        {\n            try\n            {\n\n            }\n            catch (Exception)\n//          ^^^^^ Secondary {{+1}}\n            {\n                throw;\n            }\n            finally\n            {\n\n            }\n        }\n\n        void TryFinally()\n        {\n            try\n            {\n\n            }\n            finally\n            {\n\n            }\n        }\n\n        void EmptyMethodBody() => Console.Write(\"\");\n\n        bool IfMethodBody(bool a, bool b, bool c) => a && b || c;\n//           ^^^^^^^^^^^^ {{Refactor this method to reduce its Cognitive Complexity from 2 to the 0 allowed.}}\n//                                                     ^^ Secondary@-1 {{+1}}\n//                                                          ^^ Secondary@-2 {{+1}}\n\n        void MethodWithInnerMethod() // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 2 to the 0 allowed.}}\n        {\n            void InnerMethod() // Inner method increase the nesting by 1\n            {\n                if (true)\n//              ^^ Secondary {{+2 (incl 1 for nesting)}}\n                {\n\n                }\n            }\n        }\n    }\n\n    class PropertiesComplexity\n    {\n        string SimpleProperty\n        {\n            get;\n            set;\n        }\n\n        private string foo;\n        string Foo\n        {\n            get { return foo; }\n            set { foo = value; }\n        }\n\n        string IfInProperty\n        {\n            get // Noncompliant {{Refactor this accessor to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n            {\n                if (true)\n//              ^^ Secondary {{+1}}\n                {\n                    return \"foo\";\n                }\n            }\n        }\n\n        string IfInPropertyGetSet\n        {\n            get // Noncompliant {{Refactor this accessor to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n            {\n                if (true)\n//              ^^ Secondary {{+1}}\n                {\n                    return \"foo\";\n                }\n            }\n            set // Noncompliant {{Refactor this accessor to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n            {\n                if (true)\n//              ^^ Secondary {{+1}}\n                {\n                    foo = value;\n                }\n            }\n        }\n\n        string ArrowedProperty => string.Empty;\n    }\n\n    class EventsComplexity\n    {\n        event EventHandler Bar;\n        event EventHandler Foo\n        {\n            add // Noncompliant {{Refactor this accessor to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n            {\n                if (true)\n//              ^^ Secondary {{+1}}\n                {\n                    Bar += value;\n                }\n            }\n            remove // Noncompliant {{Refactor this accessor to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n            {\n                if (true)\n//              ^^ Secondary {{+1}}\n                {\n                    Bar -= value;\n                }\n            }\n        }\n    }\n\n    class ConstructorsComplexity\n    {\n        ConstructorsComplexity()\n        {\n\n        }\n\n        ConstructorsComplexity(string foo) // Noncompliant {{Refactor this constructor to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n        {\n            if (foo == null)\n//          ^^ Secondary {{+1}}\n            {\n                throw new ArgumentNullException();\n            }\n        }\n    }\n\n    class DestructorsComplexity\n    {\n        ~DestructorsComplexity()\n        {\n\n        }\n    }\n\n    class DestructorsComplexity2\n    {\n        ~DestructorsComplexity2() // Noncompliant {{Refactor this destructor to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n        {\n            if (true)\n//          ^^ Secondary {{+1}}\n            {\n\n            }\n        }\n    }\n\n    class OperatorsComplexity\n    {\n        public static OperatorsComplexity operator +(OperatorsComplexity left, OperatorsComplexity right)\n        {\n            return null;\n        }\n\n        public static OperatorsComplexity operator -(OperatorsComplexity left, OperatorsComplexity right) // Noncompliant {{Refactor this operator to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n        {\n            if (true)\n//          ^^ Secondary {{+1}}\n            {\n\n            }\n            return null;\n        }\n    }\n\n    class RecursionsComplexity\n    {\n        void DirectRecursionComplexity()\n//           ^^^^^^^^^^^^^^^^^^^^^^^^^ {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n//           ^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary@-1 {{+1 (recursion)}}\n        {\n            DirectRecursionComplexity();\n        }\n\n        void DirectRecursionComplexity_DifferentArguments()\n        {\n            DirectRecursionComplexity_DifferentArguments(1); // This is not recursion, no complexity increase\n        }\n\n        void DirectRecursionComplexity_DifferentArguments(int arg)\n        {\n        }\n\n        void IndirectRecursionComplexity()\n        {\n            TmpIndirectRecursion();\n        }\n\n        void TmpIndirectRecursion()\n        {\n            IndirectRecursionComplexity();\n        }\n\n        void IndirectRecursionFromLocalLambda()\n//           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n//           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary@-1 {{+1 (recursion)}}\n        {\n            Action act = () => IndirectRecursionFromLocalLambda();\n            act();\n        }\n    }\n\n    class AndOrConditionsComplexity\n    {\n        void SimpleAnd()\n        {\n            var a = true;\n        }\n\n        void SimpleAnd2() // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n        {\n            var a = true && false;\n//                       ^^ Secondary {{+1}}\n        }\n\n        void SimpleOr() // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n        {\n            var a = true || false;\n//                       ^^ Secondary {{+1}}\n        }\n\n        void SimpleNot()\n        {\n            var a = !true;\n        }\n\n        void AndOr() // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 2 to the 0 allowed.}}\n        {\n            var a = true && false || true;\n//                       ^^ Secondary {{+1}}\n//                                ^^ Secondary@-1 {{+1}}\n        }\n\n        void AndOrIf(bool a, bool b, bool c, bool d, bool e, bool f) // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 4 to the 0 allowed.}}\n        {\n            if (a\n//          ^^ Secondary {{+1}}\n                && b && c\n//              ^^ Secondary {{+1}}\n                || d || e\n//              ^^ Secondary {{+1}}\n                && f)\n//              ^^ Secondary {{+1}}\n            {\n\n            }\n        }\n\n        void AndNotIf(bool a, bool b, bool c, bool d) // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 2 to the 0 allowed.}}\n        {\n            var res =\n                a\n                &&\n//              ^^ Secondary {{+1}}\n                !(b && c)\n//                  ^^ Secondary {{+1}}\n                && d;\n        }\n\n        void AndOrNot1(bool a, bool b, bool c, bool d) // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 3 to the 0 allowed.}}\n        {\n            var res =\n                d\n                ||\n//              ^^ Secondary {{+1}}\n                a\n                &&\n//              ^^ Secondary {{+1}}\n                (!b || !c);\n//                  ^^ Secondary {{+1}}\n        }\n\n        void AndOrNot2(bool a, bool b, bool c, bool d) // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 3 to the 0 allowed.}}\n        {\n            var res =\n                a\n                &&\n//              ^^ Secondary {{+1}}\n                (!b || !c)\n//                  ^^ Secondary {{+1}}\n                || d;\n//              ^^ Secondary {{+1}}\n        }\n\n        void AndNot3(bool a, bool b, bool c, bool d) // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 2 to the 0 allowed.}}\n        {\n            var res = a && d && !(b && c);\n//                      ^^ Secondary {{+1}}\n//                                  ^^ Secondary@-1 {{+1}}\n        }\n\n        void AndNotParenthesis(bool a, bool b, bool c) // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 2 to the 0 allowed.}}\n        {\n            var res =\n                a\n                &&\n//              ^^ Secondary {{+1}}\n                !(((b && c)));\n//                    ^^ Secondary {{+1}}\n        }\n\n        void ChainedConditionsWithParentheses(bool a, bool b, bool c, bool d) // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n        {\n            var res = a && b && (c && d);\n//                      ^^ Secondary {{+1}}\n        }\n    }\n\n    class GotoComplexity\n    {\n        void Foo() // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n        {\n            goto Outer;\n//          ^^^^ Secondary {{+1}}\n            Outer:\n            Console.WriteLine();\n        }\n\n        void Bar() // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 3 to the 0 allowed.}}\n        {\n            switch (5)\n//          ^^^^^^ Secondary {{+1}}\n            {\n                case 1000:\n                    goto case 100;\n//                  ^^^^ Secondary {{+2 (incl 1 for nesting)}}\n                case 100:\n                    break;\n                default:\n                    break;\n            }\n        }\n    }\n\n    class LambdasComplexity\n    {\n        private Action<int> act = // Noncompliant {{Refactor this field to reduce its Cognitive Complexity from 2 to the 0 allowed.}}\n            x =>\n            {\n                if (x > 0)\n//              ^^ Secondary {{+2 (incl 1 for nesting)}}\n                {\n\n                }\n            };\n\n        private Func<int, string> act2 = // Noncompliant {{Refactor this field to reduce its Cognitive Complexity from 2 to the 0 allowed.}}\n            x =>\n            {\n                if (x > 0)\n//              ^^ Secondary {{+2 (incl 1 for nesting)}}\n                {\n\n                }\n                return \"\";\n            };\n\n        void SimpleFunc()\n        {\n            Func<int, string> func = x => \"\";\n        }\n\n        void BlockFunc()\n        {\n            Func<int, string> func = x =>\n            {\n                return \"\";\n            };\n        }\n\n        void IfFunc() // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 2 to the 0 allowed.}}\n        {\n            Func<int, string> func =\n                x =>\n                {\n                    if (x > 0)\n//                  ^^ Secondary {{+2 (incl 1 for nesting)}}\n                    {\n                        return \"\";\n                    }\n\n                    return \"\";\n                };\n        }\n\n        void SimpleAction()\n        {\n            Action<string> act = x => Console.Write(x);\n        }\n\n        void BlockAction()\n        {\n            Action<string> func = x =>\n            {\n                Console.Write(x);\n            };\n        }\n\n        void IfAction() // Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 2 to the 0 allowed.}}\n        {\n            Action<int> func =\n                x =>\n                {\n                    if (x > 0)\n//                  ^^ Secondary {{+2 (incl 1 for nesting)}}\n                    {\n                    }\n                };\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CognitiveComplexity.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.Linq\n\nNamespace Tests.Diagnostics\n\n  Class MethodsComplexity\n\n    Private Sub Zero()\n\n    End Sub\n\n    Private Sub SimpleIf() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n      If True Then\n'     ^^ Secondary {{+1}}\n      End If\n    End Sub\n\n    Private Sub SingleLineIf() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n      Dim i = 1\n      If True Then i = 2\n'     ^^ Secondary {{+1}}\n    End Sub\n\n    Private Sub IfElseIfElse() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 3 to the 0 allowed.}}\n      If (1 = 2) Then\n'     ^^ Secondary {{+1}}\n      ElseIf (1 = 3) Then\n'     ^^^^^^ Secondary {{+1}}\n      Else\n'     ^^^^ Secondary {{+1}}\n      End If\n    End Sub\n\n    Private Sub SingleLineIfElse() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n      Dim i = 1\n      If True Then i = 2 Else i = 3\n'     ^^ Secondary {{+1}}\n    End Sub\n\n    Private Sub TernaryInsideSingleLineIf() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 3 to the 0 allowed.}}\n      Dim i = 1\n      If True Then i = If(False, 3, 2)\n'     ^^ Secondary {{+1}}\n'                      ^^ Secondary@-1 {{+2 (incl 1 for nesting)}}\n    End Sub\n\n    Private Sub TernaryInsideSingleLineElse() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 3 to the 0 allowed.}}\n      Dim i = 1\n      If True Then i = 2 Else i = If(False, 3, 2)\n'     ^^ Secondary {{+1}}\n'                                 ^^ Secondary@-1 {{+2 (incl 1 for nesting)}}\n    End Sub\n\n    Private Sub IfNestedInElse() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 4 to the 0 allowed.}}\n      If True Then\n'     ^^ Secondary {{+1}}\n      Else\n'     ^^^^ Secondary {{+1}}\n        If False Then\n'       ^^ Secondary {{+2 (incl 1 for nesting)}}\n        End If\n      End If\n    End Sub\n\n    Private Sub IfElseNestedInIf() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 4 to the 0 allowed.}}\n      If True Then\n'     ^^ Secondary {{+1}}\n        If True Then\n'       ^^ Secondary {{+2 (incl 1 for nesting)}}\n        Else\n'       ^^^^ Secondary {{+1}}\n        End If\n      End If\n    End Sub\n\n    Private Sub MultipleIfNested() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 6 to the 0 allowed.}}\n      If True Then\n'     ^^ Secondary {{+1}}\n        If True Then\n'       ^^ Secondary {{+2 (incl 1 for nesting)}}\n          If True Then\n'         ^^ Secondary {{+3 (incl 2 for nesting)}}\n          End If\n        End If\n      End If\n    End Sub\n\n    Private Sub Switch() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n      Select Case (10)\n'     ^^^^^^ Secondary {{+1}}\n        Case 1\n        Case 2\n      End Select\n    End Sub\n\n    Private Sub NestedSwitch() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 3 to the 0 allowed.}}\n      If True Then\n'     ^^ Secondary {{+1}}\n        Select Case (10)\n'       ^^^^^^ Secondary {{+2 (incl 1 for nesting)}}\n          Case 1\n          Case 2\n        End Select\n      End If\n    End Sub\n\n    Private Sub SwitchWithNestedIf() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 3 to the 0 allowed.}}\n      Select Case (10)\n'     ^^^^^^ Secondary {{+1}}\n        Case 0\n          If True Then\n'         ^^ Secondary {{+2 (incl 1 for nesting)}}\n          End If\n      End Select\n    End Sub\n\n    Private Sub TernaryOperator() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n      Dim t = If(True, 0, 1)\n'             ^^ Secondary {{+1}}\n    End Sub\n\n    Private Sub NestedTernaryOperator() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 3 to the 0 allowed.}}\n      If True Then\n'     ^^ Secondary {{+1}}\n          Dim t = If(Nothing, 1)\n'                 ^^ Secondary {{+2 (incl 1 for nesting)}}\n      End If\n    End Sub\n\n    Private Sub TernaryOperatorWithInnerTernayOperator() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 3 to the 0 allowed.}}\n      Dim t = If(True, If(False, 3, 2), 1)\n'             ^^ Secondary {{+1}}\n'                      ^^ Secondary@-1 {{+2 (incl 1 for nesting)}}\n    End Sub\n\n    Private Sub Whilee() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n      While True\n'     ^^^^^ Secondary {{+1}}\n      End While\n    End Sub\n\n    Private Sub NestedWhile() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 3 to the 0 allowed.}}\n      While True\n'     ^^^^^ Secondary {{+1}}\n        While True\n'       ^^^^^ Secondary {{+2 (incl 1 for nesting)}}\n        End While\n      End While\n    End Sub\n\n    Private Sub Forr() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n      For i As Integer = 1 To 10\n'     ^^^ Secondary {{+1}}\n      Next\n    End Sub\n\n    Private Sub NestedFor() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 3 to the 0 allowed.}}\n      For i As Integer = 1 To 10\n'     ^^^ Secondary {{+1}}\n        For j As Integer = 1 To 10\n'       ^^^ Secondary {{+2 (incl 1 for nesting)}}\n        Next\n      Next\n    End Sub\n\n    Private Function Foreach() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n      For Each item In Enumerable.Empty(Of Integer)\n'     ^^^ Secondary {{+1}}\n      Next\n    End Function\n\n    Private Function ForeachNoParens ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n      For Each item In Enumerable.Empty(Of Integer)\n'     ^^^ Secondary {{+1}}\n      Next\n    End Function\n\n    Private Sub NestedForeach() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 3 to the 0 allowed.}}\n      For Each item1 In Enumerable.Empty(Of Integer)\n'     ^^^ Secondary {{+1}}\n        For Each item2 In Enumerable.Empty(Of Integer)\n'       ^^^ Secondary {{+2 (incl 1 for nesting)}}\n        Next\n      Next\n    End Sub\n\n    Private Sub DoUntil() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n      Do Until True\n'     ^^ Secondary {{+1}}\n      Loop\n    End Sub\n\n    Private Sub NestedDoUntil() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 3 to the 0 allowed.}}\n      Do Until True\n'     ^^ Secondary {{+1}}\n        Do Until True\n'       ^^ Secondary {{+2 (incl 1 for nesting)}}\n        Loop\n      Loop\n    End Sub\n\n    Private Sub TryCatch() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n      Try\n      Catch ex As Exception\n'     ^^^^^ Secondary {{+1}}\n        Throw\n      End Try\n    End Sub\n\n    Private Sub TryCatchIf() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 3 to the 0 allowed.}}\n      Try\n      Catch ex  As Exception\n'     ^^^^^ Secondary {{+1}}\n        If True Then\n'       ^^ Secondary {{+2 (incl 1 for nesting)}}\n          Throw\n        End If\n      End Try\n    End Sub\n\n    Private Sub NestedTryCatch() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 3 to the 0 allowed.}}\n      If True Then\n'     ^^ Secondary {{+1}}\n        Try\n        Catch ex  As Exception\n'       ^^^^^ Secondary {{+2 (incl 1 for nesting)}}\n            Throw\n        End Try\n      End If\n    End Sub\n\n    Private Sub TryCatchFinally() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n      Try\n      Catch ex  As Exception\n'     ^^^^^ Secondary {{+1}}\n        Throw\n      Finally\n      End Try\n    End Sub\n\n    Private Sub TryFinally()\n      Try\n      Finally\n      End Try\n    End Sub\n\n    Private Sub EmptySubBody()\n    End Sub\n\n    Private Function EmptyFunctionBody()\n    End Function\n  End Class\n\n  Class PropertiesComplexity\n\n  Private Property SimpleProperty As String\n      Get\n      End Get\n      Set\n      End Set\n    End Property\n\n    Private _foo As String\n\n    Private Property Foo As String\n      Get\n        Return Me._foo\n      End Get\n      Set\n        Me._foo = Value\n      End Set\n    End Property\n\n    Private ReadOnly Property IfInProperty As String\n      Get ' Noncompliant {{Refactor this accessor to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n        If True Then\n'       ^^ Secondary {{+1}}\n          Return \"foo\"\n        End If\n\n      End Get\n    End Property\n\n    Private Property IfInPropertyGetSet As String\n      Get ' Noncompliant {{Refactor this accessor to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n        If True Then\n'       ^^ Secondary {{+1}}\n          Return \"foo\"\n        End If\n\n      End Get\n      Set ' Noncompliant {{Refactor this accessor to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n        If True Then\n'       ^^ Secondary {{+1}}\n          Me.foo = Value\n        End If\n      End Set\n    End Property\n  End Class\n\n  Class EventsComplexity\n    ' vb.net does not support event accessors\n  End Class\n\n  Class ConstructorsComplexity\n\n    Private Sub New()\n      MyBase.New\n    End Sub\n\n    Private Sub New(ByVal foo As String) ' Noncompliant {{Refactor this constructor to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n      MyBase.New\n      If (foo Is Nothing) Then\n'     ^^ Secondary {{+1}}\n        Throw New ArgumentNullException()\n      End If\n\n    End Sub\n  End Class\n\n  Class DestructorsComplexity1\n    Protected Overrides Sub Finalize()\n    End Sub\n  End Class\n  Class DestructorsComplexity2\n    Protected Overrides Sub Finalize() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n      If (True) Then\n'     ^^ Secondary {{+1}}\n      End If\n    End Sub\n  End Class\n\n  Class OperatorsComplexity1\n    Public Shared Operator +(ByVal left As OperatorsComplexity1, ByVal right As OperatorsComplexity1) As OperatorsComplexity1\n      Return Nothing\n    End Operator\n  End Class\n  Class OperatorsComplexity2\n    Public Shared Operator +(ByVal left As OperatorsComplexity2, ByVal right As OperatorsComplexity2) As OperatorsComplexity2 ' Noncompliant {{Refactor this operator to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n      If (True) Then\n'     ^^ Secondary {{+1}}\n      End If\n      Return Nothing\n    End Operator\n\n  End Class\n\n  Class RecursionsComplexity\n\n    Private Sub DirectRecursionComplexityArg(ByVal arg As Integer)\n'               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n'               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary@-1 {{+1 (recursion)}}\n      DirectRecursionComplexityArg(arg)\n    End Sub\n\n    Private Sub DirectRecursionComplexityMe()\n'               ^^^^^^^^^^^^^^^^^^^^^^^^^^^ {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n'               ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary@-1 {{+1 (recursion)}}\n      Me.DirectRecursionComplexityMe()\n    End Sub\n\n    Private Overloads Sub DirectRecursionComplexity_DifferentArguments()\n      DirectRecursionComplexity_DifferentArguments(1)\n      ' This is not recursion, no complexity increase\n    End Sub\n\n    Private Overloads Sub DirectRecursionComplexity_DifferentArguments(ByVal arg As Integer)\n    End Sub\n\n    Private Sub IndirectRecursionComplexity() ' FN\n      TmpIndirectRecursion()\n      GetMe().IndirectRecursionComplexity()\n    End Sub\n\n    Private Sub TmpIndirectRecursion()\n      IndirectRecursionComplexity()\n    End Sub\n\n    Private Function GetMe() As RecursionsComplexity\n      Return Me\n    End Function\n\n    Private Function IndirectRecursionFromLocalLambda()\n'                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n'                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary@-1 {{+1 (recursion)}}\n      Dim act = Function() IndirectRecursionFromLocalLambda()\n      act\n    End Function\n  End Class\n\n\n  Class AndOrConditionsComplexity\n\n    Private Sub Simple()\n      Dim a = True\n    End Sub\n\n    Private Sub SimpleAnd() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n      Dim a = True And False\n'                  ^^^ Secondary {{+1}}\n    End Sub\n\n    Private Sub SimpleAndAlso() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n      Dim a = True AndAlso False\n'                  ^^^^^^^ Secondary {{+1}}\n    End Sub\n\n    Private Sub SimpleOr() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n      Dim a = (True Or False)\n'                   ^^ Secondary {{+1}}\n    End Sub\n\n    Private Sub SimpleOrElse() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n      Dim a = (True OrElse False)\n'                   ^^^^^^ Secondary {{+1}}\n    End Sub\n\n    Private Sub SimpleNot()\n      Dim a = Not True\n    End Sub\n\n    Private Sub AndOr() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 2 to the 0 allowed.}}\n      Dim a = (True And False) Or True\n'                   ^^^ Secondary {{+1}}\n'                              ^^ Secondary@-1 {{+1}}\n    End Sub\n\n    Private Sub AndAlsoOrElse() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 2 to the 0 allowed.}}\n      Dim a = (True AndAlso False) OrElse True\n'                   ^^^^^^^ Secondary {{+1}}\n'                                  ^^^^^^ Secondary@-1 {{+1}}\n    End Sub\n\n    Private Sub AndOrIf() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 4 to the 0 allowed.}}\n      Dim a, b, c, d, e, f As Boolean\n      If (a And b And c Or d Or e And f) Then\n'     ^^ Secondary {{+1}}\n'           ^^^ Secondary@-1 {{+1}}\n'                       ^^ Secondary@-2 {{+1}}\n'                                 ^^^ Secondary@-3 {{+1}}\n      End If\n    End Sub\n\n    Private Sub AndAlsoOrElseIf() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 4 to the 0 allowed.}}\n      Dim a, b, c, d, e, f As Boolean\n      If (a AndAlso b AndAlso c OrElse d OrElse e AndAlso f) Then\n'     ^^ Secondary {{+1}}\n'           ^^^^^^^ Secondary@-1 {{+1}}\n'                               ^^^^^^ Secondary@-2 {{+1}}\n'                                                 ^^^^^^^ Secondary@-3 {{+1}}\n      End If\n    End Sub\n\n    Private Sub AndNot() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 2 to the 0 allowed.}}\n      Dim a, b, c, d As Boolean\n      Dim res = a And Not (b And c) And d\n'                 ^^^ Secondary {{+1}}\n'                            ^^^ Secondary@-1 {{+1}}\n    End Sub\n\n    Private Sub AndAlsoNot() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 2 to the 0 allowed.}}\n      Dim a, b, c, d As Boolean\n      Dim res = a AndAlso Not (b AndAlso c) AndAlso d\n'                 ^^^^^^^ Secondary {{+1}}\n'                                ^^^^^^^ Secondary@-1 {{+1}}\n    End Sub\n\n    Private Sub OrAndNotOr() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 3 to the 0 allowed.}}\n      Dim a, b, c, d As Boolean\n      Dim res = d Or a And (Not b Or Not c)\n'                 ^^ Secondary {{+1}}\n'                      ^^^ Secondary@-1 {{+1}}\n'                                 ^^ Secondary@-2 {{+1}}\n    End Sub\n\n    Private Sub OrElseAndNot() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 3 to the 0 allowed.}}\n      Dim a, b, c, d As Boolean\n      Dim res = d OrElse a And (Not b OrElse Not c)\n'                 ^^^^^^ Secondary {{+1}}\n'                          ^^^ Secondary@-1 {{+1}}\n'                                     ^^^^^^ Secondary@-2 {{+1}}\n    End Sub\n\n    Private Sub AndOrNot2() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 3 to the 0 allowed.}}\n      Dim a, b, c, d As Boolean\n      Dim res = a And (Not b Or Not c) Or d\n'                 ^^^ Secondary {{+1}}\n'                            ^^ Secondary@-1 {{+1}}\n'                                      ^^ Secondary@-2 {{+1}}\n    End Sub\n\n    Private Sub AndNot3() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 2 to the 0 allowed.}}\n      Dim a, b, c, d As Boolean\n      Dim res = a And d And Not (b And c)\n'                 ^^^ Secondary {{+1}}\n'                                  ^^^ Secondary@-1 {{+1}}\n    End Sub\n\n    Private Sub AndNotParenthesis() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 2 to the 0 allowed.}}\n      Dim a, b, c As Boolean\n      Dim res = a And Not (((b And c)))\n'                 ^^^ Secondary {{+1}}\n'                              ^^^ Secondary@-1 {{+1}}\n    End Sub\n\n    Private Sub ChainedConditionsWithParentheses() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n      Dim a, b, c, d As Boolean\n      Dim res = a AndAlso b AndAlso (c AndAlso d)\n'                 ^^^^^^^ Secondary {{+1}}\n    End Sub\n\n  End Class\n\n  Class GotoComplexity\n    Private Sub Foo() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 1 to the 0 allowed.}}\n      GoTo Outer\n'     ^^^^ Secondary {{+1}}\n  Outer:\n      Console.WriteLine()\n    End Sub\n\n    Private Sub Bar() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 3 to the 0 allowed.}}\n      Select Case (5)\n'     ^^^^^^ Secondary {{+1}}\n        Case 1000\n          GoTo Inner\n'         ^^^^ Secondary {{+2 (incl 1 for nesting)}}\n        Case 100\n          Inner:\n      End Select\n\n    End Sub\n  End Class\n\n  Class LambdasComplexity\n\n    Private act1 As Action(Of Integer) = Function(x As Integer) ' Noncompliant {{Refactor this field to reduce its Cognitive Complexity from 2 to the 0 allowed.}}\n                                            If (x > 5)\n'                                           ^^ Secondary {{+2 (incl 1 for nesting)}}\n                                            End If\n                                        End Function\n\n    Private act2 As Func(Of Integer, String) = Function(x As Integer) ' Noncompliant {{Refactor this field to reduce its Cognitive Complexity from 2 to the 0 allowed.}}\n                                                If (x > 5)\n'                                               ^^ Secondary {{+2 (incl 1 for nesting)}}\n                                                End If\n                                                Return \"\"\n                                            End Function\n\n    Private Sub SimpleFunc()\n      Dim func = Function(num As Integer) num + 1\n    End Sub\n\n    Private Sub BlockFun()\n      Dim func As Func(Of Integer, String) = Function(x As Integer)\n                                              Return \"\"\n                                            End Function\n    End Sub\n\n    Private Sub IfFunc() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 2 to the 0 allowed.}}\n      Dim func As Func(Of Integer, String) = Function(x As Integer)\n                                                  If (x > 0) Then\n'                                                 ^^ Secondary {{+2 (incl 1 for nesting)}}\n                                                    Return \"\"\n                                                  End If\n                                                  Return \"\"\n                                             End Function\n    End Sub\n\n    Private Sub SimpleAction()\n      Dim act = Sub(x) Console.WriteLine(x)\n    End Sub\n\n    Private Sub BlockAction()\n      Dim act As Action(Of String) = Sub(x)\n                                          Console.Write(x)\n                                     End Sub\n    End Sub\n\n    Private Sub IfAction() ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 2 to the 0 allowed.}}\n      Dim func As Action(Of Integer) = Sub(x As Integer)\n                                          If (x > 0) Then\n'                                         ^^ Secondary {{+2 (incl 1 for nesting)}}\n                                              Console.Write(x)\n                                          End If\n                                       End Sub\n    End Sub\n\n\n    Private Sub IfActionNoParens ' Noncompliant {{Refactor this method to reduce its Cognitive Complexity from 2 to the 0 allowed.}}\n      Dim func As Action(Of Integer) = Sub(x As Integer)\n                                          If (x > 0) Then\n'                                         ^^ Secondary {{+2 (incl 1 for nesting)}}\n                                              Console.Write(x)\n                                          End If\n                                       End Sub\n    End Sub\n\n\n  End Class\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CollectionEmptinessChecking.Fixed.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\n\nnamespace Tests.Diagnostics\n{\n    public class CollectionEmptinessChecking\n    {\n        private static bool HasContent1(IEnumerable<string> l)\n        {\n            return l.Any(); // Fixed\n        }\n        private static bool HasContent1b(IEnumerable<string> l)\n        {\n            return l.Any(); // Fixed\n        }\n        private static bool HasContent2(List<string> l)\n        {\n            return l.Any(); // Fixed\n        }\n        private static bool HasContent2b(List<string> l)\n        {\n            return l.Any();    // Fixed\n                               // Error@-1 [CS0034]\n        }\n        private static bool IsNotEmpty1(List<string> l)\n        {\n            return l.Any(); // Fixed\n        }\n        private static bool IsNotEmpty2(List<string> l)\n        {\n            return l.Any(); // Fixed\n        }\n        private static bool IsEmpty1(List<string> l)\n        {\n            return !l.Any(); // Fixed\n        }\n        private static bool IsEmpty2(List<string> l)\n        {\n            return !l.Any(); // Fixed\n        }\n        private static bool IsEmpty2b(List<string> l)\n        {\n            return !l.Any(); // Fixed\n        }\n        private static bool IsEmpty4(List<string> l)\n        {\n            return !l.Any(); // Fixed\n        }\n        private static bool IsEmpty4b(List<string> l)\n        {\n            return !l.Any(); // Fixed\n        }\n        private static bool HasContentWithCondition(List<int> numbers)\n        {\n            return numbers.Any(n => n % 2 == 0); // Fixed\n        }\n        private static bool IsEmptyWithCondition(List<int> numbers)\n        {\n            return !numbers.Any(n => n % 2 == 0); // Fixed\n        }\n        public static bool WithReferencedCondition(int[] n)\n        {\n            return !n.Any(Include); // Fixed\n        }\n        static bool Include(int n)\n        {\n            return n == 17;\n        }\n    }\n\n    public class NotAsExtension\n    {\n        bool IsEmpty(int[] n)\n        {\n            return !n.Any(); // Fixed\n        }\n        bool HasAny(int[] n)\n        {\n            return n.Any(); // Fixed\n        }\n        bool RightExpression(int[] n)\n        {\n            return n.Any(); // Fixed\n        }\n        bool WithCondition(int[] n)\n        {\n            return !n.Any(x => x != 2); // Fixed\n        }\n        bool NotAnIdentifier(string str)\n        {\n            return str.Trim().Any(); // Fixed\n        }\n    }\n\n    public class Complex\n    {\n        bool Nested(string[] words)\n        {\n            return words.Any(w => !w.Any(ch => ch == 'Q'));\n        }\n        bool Composed(int[] a, int[] b, int[] c)\n        {\n            return a.Any() && !b.Any() && c.Any();\n        }\n    }\n\n    public class Compliant\n    {\n        bool Any(List<string> list)\n        {\n            return list.Any();\n        }\n        bool NotAny(List<string> list)\n        {\n            return !list.Any();\n        }\n        bool NotAnExtension(Compliant model)\n        {\n            return model.Count() == 0;\n        }\n        bool NotAMethod(int value)\n        {\n            return value != 0;\n        }\n        bool SizeDepedent(int[] numbers)\n        {\n            return numbers.Count() != 2\n                || numbers.Count(n => n % 2 == 1) == 3\n                || 1 != numbers.Count()\n                || 1 == numbers.Count(n => n % 2 == 0)\n                || Enumerable.Count(numbers) > 1\n                || 42 < Enumerable.Count(numbers);\n        }\n        bool Undefined(object model)\n        {\n            return model.Count(); // Error[CS0411]\n        }\n\n        int Count() { return 42; }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CollectionEmptinessChecking.Latest.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing System;\n\npublic static class Enumerable\n{\n    // Extension block\n    extension<TSource>(IEnumerable<TSource> source) // extension members for IEnumerable<TSource>\n    {\n        public bool IsEmpty => !source.Any();       // Compliant\n        public bool HasCount => source.Count() > 0; // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CollectionEmptinessChecking.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\n\nnamespace Tests.Diagnostics\n{\n    public class CollectionEmptinessChecking\n    {\n        private static bool HasContent1(IEnumerable<string> l)\n        {\n            return l.Count() > 0; // Noncompliant {{Use '.Any()' to test whether this 'IEnumerable<string>' is empty or not.}}\n            //       ^^^^^\n        }\n        private static bool HasContent1b(IEnumerable<string> l)\n        {\n            return 0 < l.Count(); // Noncompliant\n        }\n        private static bool HasContent2(List<string> l)\n        {\n            return l.Count() >= 0x1; // Noncompliant\n        }\n        private static bool HasContent2b(List<string> l)\n        {\n            return 1UL <= l.Count();    // Noncompliant\n                                        // Error@-1 [CS0034]\n        }\n        private static bool IsNotEmpty1(List<string> l)\n        {\n            return l.Count() != 0; // Noncompliant\n        }\n        private static bool IsNotEmpty2(List<string> l)\n        {\n            return 0 != l.Count(); // Noncompliant\n        }\n        private static bool IsEmpty1(List<string> l)\n        {\n            return l.Count() == 0; // Noncompliant\n        }\n        private static bool IsEmpty2(List<string> l)\n        {\n            return l.Count() <= 0; // Noncompliant\n        }\n        private static bool IsEmpty2b(List<string> l)\n        {\n            return 0 >= l.Count(); // Noncompliant\n        }\n        private static bool IsEmpty4(List<string> l)\n        {\n            return l.Count() < 1; // Noncompliant\n        }\n        private static bool IsEmpty4b(List<string> l)\n        {\n            return 1 > l.Count(); // Noncompliant\n        }\n        private static bool HasContentWithCondition(List<int> numbers)\n        {\n            return numbers.Count(n => n % 2 == 0) > 0; // Noncompliant\n        }\n        private static bool IsEmptyWithCondition(List<int> numbers)\n        {\n            return numbers.Count(n => n % 2 == 0) == 0; // Noncompliant\n        }\n        public static bool WithReferencedCondition(int[] n)\n        {\n            return n.Count(Include) == 0; // Noncompliant\n        }\n        static bool Include(int n)\n        {\n            return n == 17;\n        }\n    }\n\n    public class NotAsExtension\n    {\n        bool IsEmpty(int[] n)\n        {\n            return Enumerable.Count(n) == 0; // Noncompliant\n            //                ^^^^^\n        }\n        bool HasAny(int[] n)\n        {\n            return Enumerable.Count(n) > 0; // Noncompliant\n        }\n        bool RightExpression(int[] n)\n        {\n            return 0 < Enumerable.Count(n); // Noncompliant\n        }\n        bool WithCondition(int [] n)\n        {\n            return Enumerable.Count(n, x => x != 2) == 0; // Noncompliant\n        }\n        bool NotAnIdentifier(string str)\n        {\n            return Enumerable.Count(str.Trim()) > 0; // Noncompliant\n        }\n    }\n\n    public class Complex\n    {\n        bool Nested(string[] words)\n        {\n            return words.Count(w => w.Count(ch => ch == 'Q') == 0) > 0;\n            //           ^^^^^                  {{Use '.Any()' to test whether this 'IEnumerable<string>' is empty or not.}}\n            //                        ^^^^^ @-1 {{Use '.Any()' to test whether this 'IEnumerable<char>' is empty or not.}}\n        }\n        bool Composed(int[] a, int[] b, int[] c)\n        {\n            return a.Count() > 0 && b.Count() == 0 && c.Count() > 0;\n            //       ^^^^^                                        {{Use '.Any()' to test whether this 'IEnumerable<int>' is empty or not.}}\n            //                        ^^^^^                   @-1 {{Use '.Any()' to test whether this 'IEnumerable<int>' is empty or not.}}\n            //                                          ^^^^^ @-2 {{Use '.Any()' to test whether this 'IEnumerable<int>' is empty or not.}}\n        }\n    }\n\n    public class Compliant\n    {\n        bool Any(List<string> list)\n        {\n            return list.Any();\n        }\n        bool NotAny(List<string> list)\n        {\n            return !list.Any();\n        }\n        bool NotAnExtension(Compliant model)\n        {\n            return model.Count() == 0;\n        }\n        bool NotAMethod(int value)\n        {\n            return value != 0;\n        }\n        bool SizeDepedent(int[] numbers)\n        {\n            return numbers.Count() != 2\n                || numbers.Count(n => n % 2 == 1) == 3\n                || 1 != numbers.Count()\n                || 1 == numbers.Count(n => n % 2 == 0)\n                || Enumerable.Count(numbers) > 1\n                || 42 < Enumerable.Count(numbers);\n        }\n        bool Undefined(object model)\n        {\n            return model.Count(); // Error[CS0411]\n        }\n\n        int Count() { return 42; }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CollectionEmptinessChecking.vb",
    "content": "﻿Imports System.Collections.Generic\nImports System.Linq\n\nNamespace Tests.Diagnostics\n\n    Public Class CollectionEmptinessChecking\n\n        Private Function HasContent1(l As IEnumerable(Of String)) As Boolean\n            Return l.Count() > 0 ' Noncompliant {{Use '.Any()' to test whether this 'IEnumerable(Of String)' is empty or not.}}\n            '        ^^^^^\n        End Function\n\n        Private Function HasContent1b(l As IEnumerable(Of String)) As Boolean\n            Return 0 < l.Count() ' Noncompliant\n        End Function\n\n        Private Function HasContent2(l As IEnumerable(Of String)) As Boolean\n            Return Enumerable.Count(l) >= &HE1 ' FN. Hexadecimals are not picked up.\n        End Function\n\n        Private Function HasContent2b(l As IEnumerable(Of String)) As Boolean\n            Return 1UL <= Enumerable.Count(l) ' Noncompliant\n        End Function\n\n        Private Function IsNotEmpty1(l As IEnumerable(Of String)) As Boolean\n            Return l.Count() <> 0 ' Noncompliant\n        End Function\n\n        Private Function IsNotEmpty2(l As IEnumerable(Of String)) As Boolean\n            Return 0 <> l.Count() ' Noncompliant\n        End Function\n\n        Private Function IsEmpty1(l As IEnumerable(Of String)) As Boolean\n            Return l.Count() = 0 ' Noncompliant\n        End Function\n\n        Private Function IsEmpty2(l As IEnumerable(Of String)) As Boolean\n            Return l.Count() <= 0 ' Noncompliant\n        End Function\n\n        Private Function IsEmpty2b(l As IEnumerable(Of String)) As Boolean\n            Return 0 >= l.Count() ' Noncompliant\n        End Function\n\n        Private Function IsEmpty4(l As IEnumerable(Of String)) As Boolean\n            Return l.Count() < 1 ' Noncompliant\n        End Function\n\n        Private Function IsEmpty4b(l As IEnumerable(Of String)) As Boolean\n            Return 1 > l.Count() ' Noncompliant\n        End Function\n\n        Private Function HasContentWithCondition(numbers As IEnumerable(Of Integer)) As Boolean\n            Return numbers.Count(AddressOf IsNegative) > 0 ' Noncompliant\n        End Function\n\n        Private Function IsEmptyWithCondition(numbers As IEnumerable(Of Integer)) As Boolean\n            Return numbers.Count(AddressOf IsNegative) = 0 ' Noncompliant\n        End Function\n\n        Private Function SizeDepedentCheck(numbers As Integer()) As Boolean\n            Return numbers.Count() <> 2 ' Compliant \n        End Function\n\n        Private Shared Function IsNegative(n As Integer) As Boolean\n            Return n < 0\n        End Function\n    End Class\n\n    Public Class Compliant\n\n        Function Any(list As List(Of String)) As Boolean\n            Return list.Any()\n        End Function\n\n        Function NotAny(list As List(Of String)) As Boolean\n            Return Not list.Any()\n        End Function\n\n        Function NotAnExtension(model As Compliant) As Boolean\n            Return model.Count() = 0\n        End Function\n\n        Function NotAMethod(value As Integer) As Boolean\n            Return value <> 0\n        End Function\n\n        Function SizeDepedent(numbers As Integer()) As Boolean\n            Return numbers.Count() <> 2 OrElse\n                numbers.Count(AddressOf IsNegative) = 3 OrElse\n                1 <> numbers.Count() OrElse\n                1 = numbers.Count(AddressOf IsNegative) OrElse\n                Enumerable.Count(numbers) > 1 OrElse\n                42 < Enumerable.Count(numbers)\n        End Function\n\n        Function Undefined(model As Date) As Boolean\n            Return model.Count() ' Error[BC30456]\n        End Function\n\n        Function Count() As Integer\n            Return 42\n        End Function\n\n        Shared Function IsNegative(n As Integer) As Boolean\n            Return n < 0\n        End Function\n\n    End Class\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CollectionPropertiesShouldBeReadOnly.Latest.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Collections.Specialized;\nusing System.Runtime.Serialization;\n\nvar x = 1;\n\npublic record TestRecord\n{\n    private List<string> list;\n\n    public ArrayList NongenericList { get; set; } // Noncompliant {{Make the 'NongenericList' property read-only by removing the property setter or making it private.}}\n//                   ^^^^^^^^^^^^^^\n    protected ICollection<string> GenericCollectionProtected { get; set; } // Noncompliant\n\n    public ICollection<string> GenericCollectionNoSetAuto { get; }\n    public ICollection<string> GenericCollectionInit { get; init; }\n}\n\n// Ignore collections marked with DataMember attribute: https://github.com/SonarSource/sonar-dotnet/issues/795\n[DataContract]\npublic record Message\n{\n    [DataMember]\n    public Dictionary<string, string> Properties { get; set; }\n}\n\n// Ignore collections marked with Serializable attribute: https://github.com/SonarSource/sonar-dotnet/issues/2762\n[Serializable]\npublic record SerializableMessage\n{\n    public Dictionary<string, string> Properties { get; set; }\n}\n\npublic abstract record S4004Base\n{\n    public abstract IDictionary<object, object> Items { get; set; } // Noncompliant\n}\n\npublic record S4004Abstract : S4004Base\n{\n    public override IDictionary<object, object> Items { get; set; } // Compliant enforced by base (https://github.com/SonarSource/sonar-dotnet/issues/2606)\n}\n\npublic interface IS4004\n{\n    IDictionary<object, object> Items { get; set; } // Noncompliant\n\n    ICollection<string> CollectionInit { get; init; }\n}\n\npublic record S4004InterfaceImplicit : IS4004\n{\n    public IDictionary<object, object> Items { get; set; }  // Compliant enforced by interface (https://github.com/SonarSource/sonar-dotnet/issues/2606)\n\n    public ICollection<string> CollectionInit { get; init; }\n}\n\nnamespace CSharp11\n{\n    public interface IS4004\n    {\n        static abstract IDictionary<object, object> Items { get; set; } // Noncompliant\n        static abstract ICollection<string> CollectionInit { get; }\n    }\n\n    public class S4004InterfaceImplicit : IS4004\n    {\n        public static IDictionary<object, object> Items { get; set; }  // Compliant enforced by interface (https://github.com/SonarSource/sonar-dotnet/issues/2606)\n\n        public static ICollection<string> CollectionInit { get; }\n    }\n}\n\nnamespace CSharp13\n{\n    public class NewCollectionTypes\n    {\n        public OrderedDictionary<string, string> OrderedDictionary { get; set; } // Noncompliant\n        public ReadOnlySet<string> ReadonlySet { get; set; }                     // Noncompliant\n    }\n\n    public interface INewCollectionTypes\n    {\n        public OrderedDictionary<string, string> OrderedDictionary { get; set; } // Noncompliant\n        public ReadOnlySet<string> ReadonlySet { get; set; }                     // Noncompliant\n    }\n\n    public partial class PartialProperties\n    {\n        public partial List<string> MyList { get; set; } // Noncompliant\n    }\n\n    public partial class PartialProperties\n    {\n        private List<string> _value = null;\n\n        public partial List<string> MyList { get => _value; set => _value = value;  } // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CollectionPropertiesShouldBeReadOnly.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Runtime.Serialization;\n\nnamespace Tests.Diagnostics\n{\n    public class Program\n    {\n        private List<string> list;\n\n        public ArrayList NongenericList { get; set; } // Noncompliant {{Make the 'NongenericList' property read-only by removing the property setter or making it private.}}\n//                       ^^^^^^^^^^^^^^\n        public ICollection NongenericCollection { get; set; } // Noncompliant {{Make the 'NongenericCollection' property read-only by removing the property setter or making it private.}}\n        public IEnumerable NongenericEnumerable { get; set; }\n        public List<string> GenericList { get; set; } // Noncompliant\n        public ICollection<string> GenericCollection { get; set; } // Noncompliant\n        public IEnumerable<string> GenericEnumerable { get; set; }\n\n        protected ICollection<string> GenericCollectionProtected { get; set; } // Noncompliant\n\n        internal ICollection<string> GenericCollectionInternal { get; set; }\n        private ICollection<string> GenericCollectionPrivate { get; set; }\n\n        public ICollection<string> GenericCollectionNoSetAuto { get; }\n        public ICollection<string> GenericCollectionNoSet { get { return list; } }\n        public ICollection<string> GenericCollectionArrow => list;\n        public ICollection<string> GenericCollectionPrivateSet { get; private set; }\n        public ICollection<string> GenericCollectionInternalSet { get; internal set; }\n        public string StringProperty { get; set; }\n        public string[] ArrayProperty { get; set; }\n        public System.Security.PermissionSet PermissionSetProperty { get; set; }\n\n        private class PrivateClass\n        {\n            public ArrayList NongenericList { get; set; }\n        }\n\n        internal class InternalClass\n        {\n            public ArrayList NongenericList { get; set; }\n        }\n\n        private interface PrivateInterface\n        {\n            ArrayList NongenericList { get; set; }\n        }\n    }\n\n    public interface PublicInterface\n    {\n        ArrayList NongenericList { get; set; } // Noncompliant\n        List<string> GenericList { get; set; } // Noncompliant\n    }\n\n    // Ignore collections marked with DataMember attribute: https://github.com/SonarSource/sonar-dotnet/issues/795\n    [DataContract]\n    public class Message\n    {\n        [DataMember]\n        public string Id { get; set; }\n\n        [DataMember]\n        public string MessageBody { get; set; }\n\n        [DataMember]\n        public Dictionary<string, string> Properties { get; set; }\n\n        [System.Runtime.Serialization.DataMember]\n        public List<int> Values { get; set; }\n    }\n\n    // Ignore collections marked with Serializable attribute: https://github.com/SonarSource/sonar-dotnet/issues/2762\n    [Serializable]\n    public class SerializableMessage\n    {\n        public Dictionary<string, string> Properties { get; set; }\n\n        public List<int> Values { get; set; }\n    }\n\n    public abstract class S4004Base\n    {\n        public abstract IDictionary<object, object> Items { get; set; } // Noncompliant\n    }\n\n    public class S4004Abstract : S4004Base\n    {\n        public override IDictionary<object, object> Items { get; set; } // Compliant enforced by base (https://github.com/SonarSource/sonar-dotnet/issues/2606)\n    }\n\n    public interface IS4004\n    {\n        IDictionary<object, object> Items { get; set; } // Noncompliant\n    }\n\n    public class S4004InterfaceImplicit : IS4004\n    {\n        public IDictionary<object, object> Items { get; set; }  // Compliant enforced by interface (https://github.com/SonarSource/sonar-dotnet/issues/2606)\n    }\n\n    public class S4004InterfaceExplicit : IS4004\n    {\n        IDictionary<object, object> IS4004.Items { get; set; }  // Compliant enforced by interface (https://github.com/SonarSource/sonar-dotnet/issues/2606)\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CollectionPropertiesShouldBeReadOnly.razor",
    "content": "﻿@page \"/Sample\"\n@namespace TestSamples\n\n<p>Test</p>\n\n@code {\n    [Parameter]\n    public Dictionary<string, object> Items { get; set; } = new Dictionary<string, object>(); // Compliant\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CollectionPropertiesShouldBeReadOnly.razor.cs",
    "content": "﻿using Microsoft.AspNetCore.Components;\nusing System.Collections.Generic;\n\nnamespace TestSamples\n{\n    public partial class Sample\n    {\n        [Parameter]\n        public Dictionary<string, object> Attributes { get; set; } = new Dictionary<string, object>(); // Compliant\n\n        public Dictionary<string, object> Items { get; set; } = new Dictionary<string, object>(); // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CollectionQuerySimplification.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Collections;\nusing System.Linq;\n\n// https://github.com/SonarSource/sonar-dotnet/issues/3604\npublic class EntityFrameworkReproGH3604\n{\n    public class MyEntity\n    {\n        public int Id { get; set; }\n    }\n\n    public class MyDbContext : Microsoft.EntityFrameworkCore.DbContext\n    {\n        public Microsoft.EntityFrameworkCore.DbSet<MyEntity> MyEntities { get; set; }\n    }\n\n    public void GetEntitiesFromEntityFrameworkCoreDbContext(MyDbContext dbContext)\n    {\n        _ = dbContext.MyEntities.OrderBy(v => v.Id).ToList().Where(SomeTest).ToList(); // Noncompliant {{Use 'AsEnumerable' here instead.}}\n        //                                          ^^^^^^\n        _ = dbContext.MyEntities.ToList().Where(SomeTest).ToList(); // Noncompliant {{Use 'AsEnumerable' here instead.}}\n        //                       ^^^^^^\n        _ = (from v in dbContext.MyEntities\n             orderby v.Id\n             select v).ToList().Where(SomeTest).ToList(); // Noncompliant {{Use 'AsEnumerable' here instead.}}\n        //             ^^^^^^\n    }\n\n    public void GetEntitiesFromEntityFrameworkCoreDbSet(Microsoft.EntityFrameworkCore.DbSet<MyEntity> entities)\n    {\n        _ = entities.OrderBy(v => v.Id).ToList().Where(SomeTest).ToList(); // Noncompliant {{Use 'AsEnumerable' here instead.}}\n        //                              ^^^^^^\n        _ = entities.ToList().Where(SomeTest).ToList(); // Noncompliant {{Use 'AsEnumerable' here instead.}}\n        //           ^^^^^^\n        _ = (from v in entities\n             orderby v.Id\n             select v).ToList().Where(SomeTest).ToList(); // Noncompliant {{Use 'AsEnumerable' here instead.}}\n        //             ^^^^^^\n    }\n\n    public void GetEntitiesFromEntityFrameworkDbSet_TEntity(System.Data.Entity.DbSet<MyEntity> entities)\n    {\n        _ = entities.OrderBy(v => v.Id).ToList().Where(SomeTest).ToList(); // Noncompliant {{Use 'AsEnumerable' here instead.}}\n        //                              ^^^^^^\n        _ = entities.ToList().Where(SomeTest).ToList(); // Noncompliant {{Use 'AsEnumerable' here instead.}}\n        //           ^^^^^^\n        _ = (from v in entities\n             orderby v.Id\n             select v).ToList().Where(SomeTest).ToList(); // Noncompliant {{Use 'AsEnumerable' here instead.}}\n        //             ^^^^^^\n    }\n\n    public void GetEntitiesFromEntityFrameworkDbSet(System.Data.Entity.DbSet entities)\n    {\n        _ = entities.Cast<MyEntity>().OrderBy(v => v.Id).ToList().Where(SomeTest).ToList(); // Noncompliant {{Use 'AsEnumerable' here instead.}}\n        //                                               ^^^^^^\n        _ = entities.Cast<MyEntity>().ToList().Where(SomeTest).ToList(); // Noncompliant {{Use 'AsEnumerable' here instead.}}\n        //                            ^^^^^^\n    }\n\n    public void GetEntitiesFromEntityFrameworkObjectQuery_TEntity(System.Data.Entity.Core.Objects.ObjectQuery<MyEntity> entities)\n    {\n        _ = entities.OrderBy(v => v.Id).ToList().Where(SomeTest).ToList(); // Noncompliant {{Use 'AsEnumerable' here instead.}}\n        //                              ^^^^^^\n        _ = entities.ToList().Where(SomeTest).ToList(); // Noncompliant {{Use 'AsEnumerable' here instead.}}\n        //           ^^^^^^\n        _ = (from v in entities\n             orderby v.Id\n             select v).ToList().Where(SomeTest).ToList(); // Noncompliant {{Use 'AsEnumerable' here instead.}}\n        //             ^^^^^^\n    }\n\n    public bool SomeTest(MyEntity entity)\n    {\n        return true;\n    }\n}\n\n\nnamespace CSharp14\n{\n    public static class Extensions\n    {\n        extension<TSource>(IEnumerable<TSource> source)\n        {\n            public bool NonCompliantProp => !source.ToList().Any(); // Noncompliant\n            public bool CompliantProp => !source.Any();\n\n            public bool NonCompliantMethod() { return source.Select(x => x as object).Any(x => x != null); }    // Noncompliant\n            public bool CompliantMethod() { return source.OfType<object>().Any(x => x != null); }\n        }\n    }\n\n    public class FieldKeyword\n    {\n        public IEnumerable<string> NonCompliantProp\n        {\n            get { return field.ToList().Select(x => x.ToString()); }    // Noncompliant\n            set { }\n        }\n\n        public IEnumerable<string> CompliantProp\n        {\n            get { return field.Select(x => x.ToString()); }\n            set { }\n        }\n    }\n\n    public class NullConditionalAssignment\n    {\n        public void Test(List<string> strings)\n        {\n            var x = new Tester();\n\n            x?.collection = strings.Where(x => x is string).Any();  // Noncompliant\n        }\n        public class Tester\n        {\n            public bool collection;\n        }\n    }\n\n    public class SimpleLambdaParameters\n    {\n        delegate bool OutTest<T>(string text, out T result);\n        delegate bool InTest<T>(in T value);\n\n        public void Test(List<string> source)\n        {\n            OutTest<int> outTest = (text, out result) => int.TryParse(text, out result);\n            InTest<string> inTest = (in value) => value.Length > 42;\n\n            var NoncompliantOut = source.Where(x => outTest(x, out var result)).Any();   // Noncompliant\n            var CompliantOut = source.Any(x => outTest(x, out var result));\n\n            var NoncompliantIn = source.Where(x => inTest(in x)).Any();   // Noncompliant\n            var CompliantIn = source.Any(x => inTest(in x));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CollectionQuerySimplification.NetFx.cs",
    "content": "﻿using System.Linq;\n\npublic class MyEntity\n{\n    public int Id { get; set; }\n}\n\npublic class DataLinq\n{\n    public void GetEntitiesFromLinqToSqlTable(System.Data.Linq.Table<MyEntity> entities)\n    {\n        _ = entities.OrderBy(v => v.Id).ToList().Where(SomeTest).ToList(); // Noncompliant {{Use 'AsEnumerable' here instead.}}\n        //                              ^^^^^^\n        _ = entities.ToList().Where(SomeTest).ToList(); // Noncompliant {{Use 'AsEnumerable' here instead.}}\n        //           ^^^^^^\n    }\n\n    public bool SomeTest(MyEntity entity)\n    {\n        return true;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CollectionQuerySimplification.TopLevelStatements.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Collections;\nusing System.Linq;\n\nList<object> list = null;\n\nlist.Select(static (element, col) => element is Int32 and > 21).Any(element => element != null); // Compliant\nlist.Select((object _, int _) => 1).Any(element => element != null); // Compliant\n\nlist.Select((element, col) => element as object).Any(element => element != null);  //Noncompliant {{Use 'OfType<object>()' here instead.}}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CollectionQuerySimplification.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Collections;\nusing System.Linq;\n\nnamespace Tests.Diagnostics\n{\n    public class CollectionQuerySimplification\n    {\n        public CollectionQuerySimplification(List<object> coll)\n        {\n            var x = coll.Select(element => element as object).Any(element => element != null);  // Noncompliant {{Use 'OfType<object>()' here instead.}}\n//                       ^^^^^^\n            var x4 = coll.Select(element => element as object).Any(element => element == null);\n            var x2 = coll.Select(element => element as object).Any(element => null != element);  // Noncompliant {{Use 'OfType<object>()' here instead.}}\n            //            ^^^^^^\n            var x3 = coll.Select(element => element as IList<int>).Any(element => element.Count != 0); // Compliant\n            x = coll.Select((element) => ((element as object))).Any(element => (element != null) && CheckCondition(element) && true);  // Noncompliant use OfType\n            x = coll.Select(element => ((element as object))).Any(element => (element != null) && CheckCondition(element) && true);  // Noncompliant use OfType\n            var y = coll.Where(element => element is object).Select(element => element as object); // Noncompliant use OfType\n//                       ^^^^^\n            y = coll.Where(element => element is object).Select(element => element as object[]);\n            y = coll.Where(element => element is object).Select(element => (object)element); // Noncompliant use OfType\n            x = coll.Where(element => element == null).Any();  // Noncompliant use Any([expression])\n//                   ^^^^^\n            var z = coll.Where(element => element == null).Count();  // Noncompliant {{Drop 'Where' and move the condition into the 'Count'.}}\n            z = Enumerable.Count(coll.Where(element => element == null));  // Noncompliant\n            z = Enumerable.Count(Enumerable.Where(coll, element => element == null));  // Noncompliant\n            y = coll.Select(element => element as object);\n            y = coll.ToList().Select(element => element as object); // Noncompliant\n            y = coll\n                .ToList()  // Noncompliant {{Drop this useless call to 'ToList' or replace it by 'AsEnumerable' if you are using LINQ to Entities.}}\n//               ^^^^^^\n                .ToArray() // Noncompliant {{Drop this useless call to 'ToArray' or replace it by 'AsEnumerable' if you are using LINQ to Entities.}}\n                .Select(element => element as object);\n\n            y = coll\n                .AsEnumerable()\n                .Where(e => e == null);\n\n            var z2 = coll\n                .Select(element => element as object)\n                .ToList();\n\n            var c = coll.Count(); //Noncompliant\n//                       ^^^^^\n            c = coll.OfType<object>().Count();\n\n            x = Enumerable.Select(coll, element => element as object).Any(element => element != null); //Noncompliant\n            x = Enumerable.Any(Enumerable.Select(coll, element => element as object), element => element != null); //Noncompliant\n\n            coll.ToList().AsEnumerable(); // Compliant, we ignore AsEnumerable() as it is somewhat cleaner way to cast to IEnumerable<T> and has no side effects\n        }\n\n        public bool CheckCondition(object x)\n        {\n            return true;\n        }\n\n        public void Method(IEnumerable<int> ints)\n        {\n            var x = ints.ToList().AsReadOnly(); // compliant, AsReadOnly is defined on List<>\n        }\n    }\n\n    public partial struct SyntaxList<TNode> : IReadOnlyList<TNode>, IEquatable<SyntaxList<TNode>>\n    {\n        public int Count => 0;\n\n        public TNode this[int index] => default(TNode);\n\n        public void Method(IEnumerable<TNode> ints)\n        {\n            CreateList(ints.Where(x => true).ToList());\n        }\n        private static SyntaxList<TNode> CreateList(List<TNode> items) => default(SyntaxList<TNode>);\n\n        public IEnumerator<TNode> GetEnumerator() => null;\n\n        IEnumerator IEnumerable.GetEnumerator() => null;\n\n        public bool Equals(SyntaxList<TNode> other) => true;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CollectionsShouldImplementGenericInterface.CSharp10.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\n\nnamespace Tests.Diagnostics\n{\n    record struct TestRecordStruct_01 : IList { } // Noncompliant {{Refactor this collection to implement 'System.Collections.Generic.IList<T>'.}}\n    //            ^^^^^^^^^^^^^^^^^^^\n\n    record struct TestRecordStruct_02 : IEnumerable { } // Noncompliant\n    record struct TestRecordStruct_03 : ICollection { } // Noncompliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CollectionsShouldImplementGenericInterface.CSharp9.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\n\nnamespace Tests.Diagnostics\n{\n    record TestRecord_01 : CollectionBase { } // Noncompliant {{Refactor this collection to implement 'System.Collections.ObjectModel.Collection<T>'.}}\n    //     ^^^^^^^^^^^^^\n\n    record TestRecord_02 : IList { }       // Noncompliant\n    record TestRecord_03 : IEnumerable { } // Noncompliant\n    record TestRecord_04 : ICollection { } // Noncompliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CollectionsShouldImplementGenericInterface.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\n\nnamespace Tests.Diagnostics\n{\n    class TestClass_CollectionBase : CollectionBase { } // Noncompliant {{Refactor this collection to implement 'System.Collections.ObjectModel.Collection<T>'.}}\n    //    ^^^^^^^^^^^^^^^^^^^^^^^^\n    class TestClass_IList : IList { }                   // Noncompliant {{Refactor this collection to implement 'System.Collections.Generic.IList<T>'.}}\n    class TestClass_IEnumerable : IEnumerable { }       // Noncompliant {{Refactor this collection to implement 'System.Collections.Generic.IEnumerable<T>'.}}\n    class TestClass_ICollection : ICollection { }       // Noncompliant {{Refactor this collection to implement 'System.Collections.Generic.ICollection<T>'.}}\n\n    class TestClass_TwoInterfaces : IEnumerable, ICollection { } // Noncompliant {{Refactor this collection to implement 'System.Collections.Generic.IEnumerable<T>'.}}\n    // Noncompliant@-1 {{Refactor this collection to implement 'System.Collections.Generic.ICollection<T>'.}}\n\n    class TestClass_NonGenericAndGenericCollection : IEnumerable, ICollection<string> { }\n    class TestClass_GenericAndNonGeneric : ICollection<string>, IEnumerable { }\n    class TestClass_NonGenericAndIList : IEnumerable, IList<string> { }\n    class TestClass_NonGenericAndGeneric : IEnumerable, IEnumerable<string> { }\n    class TestClass_GenericBaseAndNonGeneric : Collection<string>, IEnumerable { }\n    class TestClass_WithTypeParameter_1<T> : IEnumerable, IList<T> { }\n    class TestClass_WithTypeParameter_2<T> : IEnumerable, ICollection, ICollection<T> { }\n\n    class TestClass_MultipleInterfaces : IEnumerable, IList, IEnumerable<string> { }\n    class TestClass_NoInterfaces { }\n\n    class TestClass_UnrelatedBaseClass : Exception { }\n    class TestClass_UnrelatedInterface : IEqualityComparer { }\n    class TestClass_WithCompilerError : IList, InvalidType { } // Noncompliant\n\n    struct TestStruct_NongenericIList : IList { }              // Noncompliant\n    struct TestStruct_NonGenericIEnumerable : IEnumerable { }  // Noncompliant\n\n    class BaseClassEnumerable : IEnumerable<int> { }\n    class Derived : BaseClassEnumerable, IEnumerable { } // Noncompliant FP: Interfaces in base classes are ignored.\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CommentFixme.cs",
    "content": "﻿using System;\n\n/*\nhello\nfixme -  // Noncompliant\nFIXME */ // Noncompliant\n\n// Noncompliant: hello FIXME world\n\n// ok\n\n// Noncompliant@+3\n///\n/// <summary>\n/// FIXME -\n/// </summary>\n\n// Noncompliant@+2\n/**\nfixMe -\n*/\n\n// The following should be compliant:\n// aaaFIXME000\n\n// Noncompliant@+1\n// !FIXME!\n\n/*FIXME*/ // Noncompliant\n//^^^^^\n\n/**\n*/\nnamespace Tests.Diagnostics\n{\n    class FixMe\n    {\n        public FixMe()\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CommentFixme.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.Linq\nImports System.Text\n\nNamespace Tests.TestCases\n    ''' <summary>\n    ''' FIXME: Do something ' Noncompliant\n    ''' </summary>\n    Class Foo\n        Public Sub Test() ' FIXME\n'                           ^^^^^\n\n        End Sub\n    End Class\n\n    Class FixMe\n        Sub FixMe()\n\n        End Sub\n    End Class\nEnd Namespace 'fixme ' Noncompliant\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CommentLineEnd.vb",
    "content": "﻿Module Module1\n  Sub Main() ' Noncompliant multiple words  \n'            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    ' Compliant multiple words\n    System.Console.WriteLine(\"Hello, world!\") ' Noncompliant - My first program! ' cont\n    System.Console.WriteLine(\"Hello, world!\") ' Compliant\n    ' Compliant multiple words\n\n    End Sub\nEnd Module"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CommentTodo.cs",
    "content": "﻿using System;\n\n/*\nhello\ntodo -  // Noncompliant\nTODO */ // Noncompliant\n\n// Noncompliant: hello TODO world\n\n// ok\n\n\n// Noncompliant@+3\n///\n/// <summary>\n/// TODO -\n/// </summary>\n\n// Noncompliant@+2\n/**\ntoDo -\n*/\n\n// The following should be compliant:\n// aaaTODO000\n\n// Noncompliant@+1\n// !TODO!\n\n/*TODO*/ // Noncompliant\n//^^^^\n\n/**\n*/\nnamespace Tests.Diagnostics\n{\n    class Todo\n    {\n        public Todo()\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CommentTodo.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.Linq\nImports System.Text\n\nNamespace Tests.TestCases\n    ''' <summary>\n    ''' TODO: Do something ' Noncompliant\n    ''' </summary>\n    Class Foo\n        Public Sub Test() ' TODO ' Noncompliant\n'                           ^^^^\n\n        End Sub\n    End Class\n\n    Class Todo\n        Sub Todo() ' this is not a ctor\n        End Sub\n    End Class\nEnd Namespace 'todo ' Noncompliant\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CommentedOutCode.MultiLine.Fixed.cs",
    "content": "﻿class Fixes\n{\n    int SingleLine() { return 42; }\n\n    int SingleLineWithSpacing() { return 42; }\n\n    /*  Multi lines with a mix like\n     *  return 42;\n     *  are not removed.\n     */\n\n    int SeperateLine() { return 42; }\n\n    int WithinLine() { return 42; }\n\n    int MultipleLines() { return 42; }\n\n    int MultipleLinesWithSpace()\n    {\n        return 42;\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/8819\nclass Repro_8819\n{\n    void IncorrectRemovalOfNewLine()\n    {\n        // Sentence before        // Sentence after\n    }\n\n    void CorrectRemovalOfCommentedOutLine()\n    {\n        var aStatement = \"Hello, World!\";\n        // Sentence after\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CommentedOutCode.MultiLine.ToFix.cs",
    "content": "﻿/* return \"Some code at the start of a file\".Trim(); */\n/*\n{\n    int SingleLine() { return 42; }\n}\n*/\nclass Fixes\n{\n    int SingleLine() { return 42; }/* return 42; */\n\n    int SingleLineWithSpacing() { return 42; }              /* return 42; */\n\n    /*  Multi lines with a mix like\n     *  return 42;\n     *  are not removed.\n     */\n\n    int SeperateLine() { return 42; }\n    /* return 42;*/\n\n    int /* return 17; */ WithinLine() { return 42; }\n\n    int MultipleLines() { return 42; }\n    /*\n     {\n         return 42;\n     }\n     */\n\n    int MultipleLinesWithSpace()\n    {\n        /*\n         *\n         * return 17;\n         *\n         */\n        return 42;\n    }\n}\n/* Console.WriteLine(\"End Of file\"); */\n\n// https://github.com/SonarSource/sonar-dotnet/issues/8819\nclass Repro_8819\n{\n    void IncorrectRemovalOfNewLine()\n    {\n        // Sentence before\n        /* var x = 42;\n         * var y = 42;\n         */\n        // Sentence after\n    }\n\n    void CorrectRemovalOfCommentedOutLine()\n    {\n        var aStatement = \"Hello, World!\";\n        /* var x = 42;\n         * var y = 42;\n         */\n        // Sentence after\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CommentedOutCode.SingleLine.Fixed.cs",
    "content": "﻿// Leading single line comment.\nclass Fixes\n{\n    int SingleLine() { return 42; }\n\n    int SingleLineWithSpacing() { return 42; }\n\n    int SeperateLine() { return 42; }\n\n    int MultipleLines() { return 42; }\n    // Trailing single line comment.\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/8819\nclass Repro_8819\n{\n    void IncorrectRemovalOfNewLine()\n    {\n        // Sentence before        // Sentence after\n    }\n\n    void CorrectRemovalOfCommentedOutLine()\n    {\n        var aStatement = \"Hello, World!\";\n        // Sentence after\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CommentedOutCode.SingleLine.ToFix.cs",
    "content": "﻿// return \"Some code at the start of a file\".Trim();\n// Leading single line comment.\nclass Fixes\n{\n    int SingleLine() { return 42; }// return 42;\n\n    int SingleLineWithSpacing() { return 42; }              // return 42;\n\n    int SeperateLine() { return 42; }\n    // return 42;\n\n    int MultipleLines() { return 42; }\n    // int OldImplementation()\n    // {\n    //     return 42;\n    // }\n    // Trailing single line comment.\n}\n// Console.WriteLine(\"End Of file\");\n\n// https://github.com/SonarSource/sonar-dotnet/issues/8819\nclass Repro_8819\n{\n    void IncorrectRemovalOfNewLine()\n    {\n        // Sentence before\n        // var x = 42;\n        // Sentence after\n    }\n\n    void CorrectRemovalOfCommentedOutLine()\n    {\n        var aStatement = \"Hello, World!\";\n        // var x = 42;\n        // Sentence after\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CommentedOutCode.cs",
    "content": "﻿// Copyright © 2011 - Present RealDimensions Software, LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// Noncompliant {{Remove this commented out code.}} : ;\nusing System;\n\n// Noncompliant: ;\nusing System;\n// Noncompliant@+1\n// {\nusing System;\n// Noncompliant@+1\n// }\nusing System;\n// Noncompliant@+1\n// ;}\nusing System;\n// Noncompliant@+1\n// ; }\nusing System;\n// foo ; {} bar\nusing System;\n// ; {} foo\nusing System;\n// Noncompliant: ++\nusing System;\n// Noncompliant: for    ( .. i != 5\nusing System;\n// Noncompliant: if ( 1==2\nusing System;\n// Noncompliant: while( i > 5\nusing System;\n// Noncompliant: catch(\nusing System;\n// Noncompliant: switch(\nusing System;\n// Noncompliant@+1\n// try{\nusing System;\n// Noncompliant@+1\n// else{\nusing System;\n// &&\n// ||\n// && &&\n// && ||\nusing System;\n// Noncompliant: && && &&\nusing System;\n// Noncompliant: || || ||\nusing System;\n// Noncompliant: || && ||\nusing System;\n/*\n\n    hello\n\n    // Noncompliant: ;\n\n    ; world\n\n    || && ||\n\n    ;\n\n*/\n\n// Noncompliant: Console.WriteLine(\"Hello, world!\");\n// Console.WriteLine(\"Hello, world!\");\n// Console.WriteLine(\"Hello, world!\");\n\n// Console.WriteLine(\"Hello, world!\");\n\n/*\n\n\n\n\n    // Noncompliant: Console.WriteLine();\n\n\n    Console.WriteLine();\n    */\n\nnamespace Tests.Diagnostics\n{\n\n\n    /// <summary>\n    /// ...\n    /// </summary>\n    /// <code>\n    /// Console.WriteLine(\"Hello, world!\");\n    /// </code>\n    public class CommentedOutCode\n    {\n        // https://sonarsource.atlassian.net/browse/NET-3164\n        void SentenceWithSemicolon()\n        {\n            _ = \"separator\";\n            // * read the configuration file;\n\n            _ = \"separator\";\n            // - validate the input parameters;\n\n            _ = \"separator\";\n            // -> process the remaining items;\n\n            _ = \"separator\";\n            // => transform the data accordingly;\n\n            _ = \"separator\";\n            // => the computed value or null;\n\n            _ = \"separator\";\n            // 1. process the remaining items;\n\n            _ = \"separator\"; // Noncompliant@+1\n            // => null;\n\n            _ = \"separator\";\n            // if the listener fails to start, it gets disposed;\n\n            _ = \"separator\";\n            // for all intents and purposes, this will be removed;\n\n            _ = \"separator\";\n            // while the application is running, monitor the logs;\n\n            _ = \"separator\";\n            // return to the previous state if necessary;\n\n            _ = \"separator\";\n            // throw an exception if validation fails;\n\n            _ = \"separator\";\n            //Automatically initialized to false;\n\n            _ = \"separator\";\n            //Only act upon the failure, if it comes from a currently known child;\n\n            _ = \"separator\";\n            //todo: bounded priority mailbox;\n\n            _ = \"separator\";\n            //TODO: return deploy;\n\n            _ = \"separator\"; // Noncompliant@+1\n            // return result;\n\n            _ = \"separator\"; // Noncompliant@+1\n            // int x;\n\n            _ = \"separator\"; // Noncompliant@+1\n            // throw ex;\n\n            _ = \"separator\"; // Noncompliant@+1\n            // throw new NotImplementedException;\n\n            _ = \"separator\"; // Noncompliant@+1\n            // using static System;\n\n            _ = \"separator\"; // Noncompliant@+1\n            // yield return value;\n\n            /* foo */\n            SentenceWithSemicolon();\n            SentenceWithSemicolon(); /* foo */\n\n            // Noncompliant: Console.WriteLine(\"Hello, world!\");\n            // Console.WriteLine(\"Hello, world!\");\n            // Console.WriteLine(\"Hello, world!\");\n\n            // Console.WriteLine(\"Hello, world!\"); //this is compliant, as there is code above and newline above\n\n            SentenceWithSemicolon();\n            /// Console.WriteLine(\"Hello, world!\");\n            ///\n            ///\n\n\n            /// The C++ access level for a member function, e.g. private\n            ///\n\n            SentenceWithSemicolon();\n            // Noncompliant: Debug.Assert(this.MemberTypeName != null == storage.HasFlag(StorageClass.Member));\n            //\n            //if (storage.HasFlag(StorageClass.Member))\n            //{\n            // output |= this.MemberTypeName.DisplayOn(builder, s);\n            // builder.Append(CppNameBuilder.NameSeparator);\n            // // Not trailing space wanted\n            // output = false;\n            //}\n\n            // FP: Short phrases with fewer than 3 words are not recognized as natural language sentences and are still flagged.\n            _ = \"separator\"; // Noncompliant@+1 FP\n            // process items;\n\n            // FP: Natural language that starts with a statement keyword followed by a code keyword is still flagged.\n            _ = \"separator\"; // Noncompliant@+1 FP\n            // return null if the value is not found;\n\n            // FN: Code where the second word is not in CodeKeywords is treated as a sentence and not detected.\n            _ = \"separator\";\n            // FN: extern alias MyAlias;\n        }\n\n\n        int a; // Noncompliant: Console.WriteLine();\n        int b; // Noncompliant: Console.WriteLine();\n\n        // this should be compliant:\n        // does *not* overwrite file if (still) exists\n\n        //  https://github.com/SonarSource/sonar-dotnet/issues/2772\n        int c;\n        // It's just a URL and it is not an interpolated string\n        // http://localhost:7071/runtime/webhooks/EventGrid?functionName={functionname}\n\n        int rx;\n        // regex{2,5}\n        int d;\n        // {this, is, a ,set}\n        int e;\n        // Noncompliant@+1\n        // {this, is, a ,set; }\n        int f;\n        // Noncompliant@+1\n        // {Command();}\n        int g;\n        // Noncompliant@+1\n        // {Command(); }\n        int h;\n        // Noncompliant@+1\n        // int Method() { }\n        int i;\n        // Noncompliant@+1\n        // int Method() {}\n        int j;\n        // Compliant, not a C# code, but a data sample\n        // { \"json\": \"fragment\" }\n    }\n\n    /**\n        <summary>\n        ...\n        </summary>\n        <code>\n        Console.WriteLine(\"Hello, world!\");\n        </code>\n    */\n    public class CommentedOutCode2\n    {\n    }\n\n    // Some C++ reference\n    class X { }\n    // Some c++ reference\n    class Y { }\n    // Somec++ reference\n    class Z { }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/8819\nclass Repro_8819\n{\n    void LineTerminators()\n    {\n        // Remark: separators are required to consider comments as independent sentences\n\n        _ = \"separator\";\n        // Natural language sentence with semicolon at the end;\n\n        _ = \"separator\"; // Noncompliant@+1 FP\n        // Natural language sentence with open-brace at the end{\n\n        _ = \"separator\";\n        // Natural language sentence preceding sentence with semicolon at the end\n        // Natural language sentence with semicolon at the end;\n\n        _ = \"separator\";\n        // Natural language sentence with escaped semicolon at the end;\n        // Natural language sentence following sentence with escaped semicolon at the end\n\n        _ = \"separator\"; // Compliant: Natural language sentence with semicolon and escaped space at the end; \\u0020\n        _ = \"separator\"; // Compliant: Natural language sentence with semicolon and multiple escaped spaces at the end; \\u0020\\u0020\n        _ = \"separator\"; // Compliant: Natural language sentence with escaped semicolon at the end\\u003B\n        _ = \"separator\"; // Compliant: Natural language sentence with escaped open-brace at the end\\u007B\n        _ = \"separator\"; // Compliant: Natural language sentence with escaped close-brace at the end\\u007D\n        _ = \"separator\"; // Compliant: Natural language sentence with semicolon; in the middle\n        _ = \"separator\"; // Compliant: Natural language sentence with colon at the end:\n        _ = \"separator\"; // Compliant: Natural language sentence with comma at the end,\n        _ = \"separator\"; // Compliant: Natural language sentence with period at the end.\n        _ = \"separator\"; // Compliant: Natural language sentence with close-brace at the end}\n\n        _ = \"separator\"; // Noncompliant@+1 FP\n        // The empty set is indicated either with ∅ or with {}\n    }\n\n    void CommentedOutCommentsSeparatedByEmptyLine()\n    {\n        // Noncompliant: var x = 42;\n\n        // FN: var y = 3;\n    }\n\n    void CommentedOutCommentsSeparatedByMultiLineComment()\n    {\n        // Noncompliant: var x = 42;\n        /* A multiline comment  between the two commented-out blocks */\n        // Noncompliant: var y = 42;\n    }\n\n    void CommentedOutCommentsSeparatedByBlock()\n    {\n        // Noncompliant: var x = 42;\n        { }\n        // Noncompliant: var y = 42;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CommentedOutCode_Nonconcurrent.cs",
    "content": "﻿// Copyright © 2011 - Present RealDimensions Software, LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// Noncompliant {{Remove this commented out code.}} : ;\nusing System;\n\n// Noncompliant: ;\nusing System;\n// Noncompliant@+1\n// {\nusing System;\n// Noncompliant@+1\n// }\nusing System;\n// Noncompliant@+1\n// ;}\nusing System;\n// Noncompliant@+1\n// ; }\nusing System;\n// foo ; {} bar\nusing System;\n// ; {} foo\nusing System;\n// Noncompliant: ++\nusing System;\n// Noncompliant: for    ( .. i != 5\nusing System;\n// Noncompliant: if ( 1==2\nusing System;\n// Noncompliant: while( i > 5\nusing System;\n// Noncompliant: catch(\nusing System;\n// Noncompliant: switch(\nusing System;\n// Noncompliant@+1\n// try{\nusing System;\n// Noncompliant@+1\n// else{\nusing System;\n// &&\n// ||\n// && &&\n// && ||\nusing System;\n// Noncompliant: && && &&\nusing System;\n// Noncompliant: || || ||\nusing System;\n// Noncompliant: || && ||\nusing System;\n/*\n\n    hello\n\n    // Noncompliant: ;\n\n    ; world\n\n    || && ||\n\n    ;\n\n*/\n\n// Noncompliant: Console.WriteLine(\"Hello, world!\");\n// Console.WriteLine(\"Hello, world!\");\n// Console.WriteLine(\"Hello, world!\");\n\n// Console.WriteLine(\"Hello, world!\");\n\n/*\n\n\n\n\n    // Noncompliant: Console.WriteLine();\n\n\n    Console.WriteLine();\n    */\n\nnamespace Tests.Diagnostics\n{\n\n\n    /// <summary>\n    /// ...\n    /// </summary>\n    /// <code>\n    /// Console.WriteLine(\"Hello, world!\");\n    /// </code>\n    public class CommentedOutCode\n    {\n        public void M()\n        {\n            /* foo */\n            M();\n            M(); /* foo */\n\n            // Noncompliant: Console.WriteLine(\"Hello, world!\");\n            // Console.WriteLine(\"Hello, world!\");\n            // Console.WriteLine(\"Hello, world!\");\n\n            // Console.WriteLine(\"Hello, world!\"); //this is compliant, as there is code above and newline above\n\n            M();\n            /// Console.WriteLine(\"Hello, world!\");\n            ///\n            ///\n\n\n            /// The C++ access level for a member function, e.g. private\n            ///\n\n            M();\n            // Noncompliant: Debug.Assert(this.MemberTypeName != null == storage.HasFlag(StorageClass.Member));\n            //\n            //if (storage.HasFlag(StorageClass.Member))\n            //{\n            // output |= this.MemberTypeName.DisplayOn(builder, s);\n            // builder.Append(CppNameBuilder.NameSeparator);\n            // // Not trailing space wanted\n            // output = false;\n            //}\n        }\n\n\n        int a; // Noncompliant: Console.WriteLine();\n        int b; // Noncompliant: Console.WriteLine();\n\n        // this should be compliant:\n        // does *not* overwrite file if (still) exists\n\n        //  https://github.com/SonarSource/sonar-dotnet/issues/2772\n        int c;\n        // It's just a URL and it is not an interpolated string\n        // http://localhost:7071/runtime/webhooks/EventGrid?functionName={functionname}\n\n        int rx;\n        // regex{2,5}\n        int d;\n        // {this, is, a ,set}\n        int e;\n        // Noncompliant@+1\n        // {this, is, a ,set; }\n        int f;\n        // Noncompliant@+1\n        // {Command();}\n        int g;\n        // Noncompliant@+1\n        // {Command(); }\n        int h;\n        // Noncompliant@+1\n        // int Method() { }\n        int i;\n        // Noncompliant@+1\n        // int Method() {}\n        int j;\n        // Compliant, not a C# code, but a data sample\n        // { \"json\": \"fragment\" }\n    }\n\n    /**\n        <summary>\n        ...\n        </summary>\n        <code>\n        Console.WriteLine(\"Hello, world!\");\n        </code>\n    */\n    public class CommentedOutCode2\n    {\n    }\n\n    // Some C++ reference\n    class X { }\n    // Some c++ reference\n    class Y { }\n    // Somec++ reference\n    class Z { }\n}\n\n// While editing, it is possible to have a multiline comment trivia that does not contain the closing '*/' yet.\npublic class A { }\n// Noncompliant@+3\n// Error@+1 [CS1035]: End-of-file found, '*/' expected\n/*\n * { DoSomething(); }\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CommentsShouldNotBeEmpty.cs",
    "content": "﻿using System;\n\n[Obsolete] // Ipsem Lorum\npublic class SingleLine //\n// hey\n\n// Noncompliant@-3 (inline comment)\n{ // Ipsem Lorum\n             //\n\n    // Noncompliant@-2 (a lot of whitespace before)\n\n    //\n\n    // Noncompliant@-2 (a lot of whitespace after)\n\n    // *\n    // Ipsem Lorum\n    //\n\n    // hey\n    //\n    //\n    //\n\n    //\n    //\n    // hey\n    //\n    //\n    //\n\n    //\n    //\n    //\n    // hey\n    //\n    //\n    //\n\n\n    //\n\n    // Noncompliant @-2\n\n    // \\r\n\n    // \\n\n\n    // \\r\\n\n\n    // \\t\n\n    // z̶̤͚̅̍a̷͈̤̪͌͛̈ļ̷̈͐͝g̸̰̈́͂̆o̴̓̏͜\n\n    // /**/\n\n    // ///\n\n    // //\n\n    // /** */\n\n    //\n    //\n    // hey\n    //\n    //\n    // there\n    //\n    //\n\n    //\n    //\n    //\n    /// text\n    // Noncompliant@-4\n    // Secondary@-4\n    // Secondary@-4\n\n    //\n    //\n    //\n    /*\n     * text\n     */\n    // Noncompliant@-6\n    // Secondary@-6\n    // Secondary@-6\n\n    //\n    //\n    //\n    /**\n     * text\n     */\n    // Noncompliant@-6\n    // Secondary@-6\n    // Secondary@-6\n\n    void Method()\n    {\n        // Noncompliant@+4 {{Remove this empty comment}}\n        // Secondary@+4    {{Remove this empty comment}}\n        // Secondary@+4    {{Remove this empty comment}}\n\n        //\n        //\n        //\n        var x = 42; //\n        //\n        //\n        //\n\n        // Noncompliant@-5\n        // Noncompliant@-5\n        // Secondary@-5\n        // Secondary@-5\n\n        //\n        //\n        // hello\n        //\n        //\n        var y = 42; //\n        //\n        //\n        //\n        // there\n\n        // Noncompliant@-6\n\n        //\n    } //\n    //\n\n    // Noncompliant@-4\n    // Noncompliant@-4\n    // Noncompliant@-4\n}\n\n[Obsolete] /// Ipsem Lorum\npublic class SingleLineDocumentation ///\n// Noncompliant@-1 (inline comment)\n{\n            ///\n    // Noncompliant@-1 (a lot of whitespace before)\n\n    ///\n    // Noncompliant@-1 (a lot of whitespace after)\n\n    ///\n    /// *\n    /// Ipsem Lorum\n    /// \\\\n\n    ///\n\n    ///\n    /// hey there\n\n    /// hey there\n    /// text\n    ///\n\n    /// ///\n\n    /// //\n\n    /// /* */\n\n    /// /** */\n\n    /// \\r\n\n    /// \\n\n\n    /// \\r\\n\n\n    /// \\t\n\n    /// z̶̤͚̅̍a̷͈̤̪͌͛̈ļ̷̈͐͝g̸̰̈́͂̆o̴̓̏͜\n\n    ///\n    ///\n    ///\n    // Noncompliant @-3\n}\n\n[Obsolete] /* Ipsem Lorum */\n[Serializable] /**/\n// Noncompliant @-1 (inline comment)\npublic class MultiLine /* */\n// Noncompliant @-1 (inline comment)\n{\n            /* */\n    // Noncompliant@-1 (a lot of whitespace before)\n\n    /*      */\n    // Noncompliant@-1 (a lot of whitespace inside)\n\n    /**/\n    // Noncompliant@-1 (a lot of whitespace after)\n\n    // Noncompliant@+1\n    /*\n     *\n     */\n\n    // Noncompliant@+1\n    /*\n     *\n     */\n\n    // Noncompliant@+1\n    /*\n     *\n     *\n     *\n     */\n\n\n    // Noncompliant@+1\n    /*\n\n     */\n\n    // Noncompliant@+1\n    /*\n\n\n\n     */\n\n    /* hey\n     */\n\n    /*\n     there */\n\n    /* hey\n     *\n     */\n\n    /*\n     *\n     there */\n\n    /*\n\n    Ipsem Lorum\n    \\n\n    */\n\n    /*\n    hey there\n    */\n\n    /*\n     //\n     */\n\n    /*\n     ///\n    */\n\n    /*\n    \\r\n    */\n\n    /*\n    \\n\n    */\n\n    /*\n    \\r\\n\n    */\n\n    /*\n    \\t\n    */\n\n    /*\n    z̶̤͚̅̍a̷͈̤̪͌͛̈ļ̷̈͐͝g̸̰̈́͂̆o̴̓̏͜\n    */\n}\n\n[Obsolete] /** Ipsem Lorum */\n[Serializable] /***/\n// Noncompliant @-1 (inline comment)\npublic class MultiLineDocumentation /** */\n// Noncompliant @-1 (inline comment)\n{\n            /** */\n    // Noncompliant@-1 (a lot of whitespace before)\n\n    /**      */\n    // Noncompliant@-1 (a lot of whitespace inside)\n\n    /***/\n    // Noncompliant@-1 (a lot of whitespace after)\n\n    // Noncompliant@+1\n    /**\n     *\n     */\n\n    // Noncompliant@+1\n    /**\n     *\n     *\n     *\n     */\n\n\n    // Noncompliant@+1\n    /**\n\n     */\n\n    // Noncompliant@+1\n    /**\n\n\n\n     */\n\n    /** hey\n     */\n\n    /**\n     there */\n\n    /** hey\n     *\n     */\n\n    /**\n     *\n     there */\n\n    /**\n\n    Ipsem Lorum\n    \\n\n    */\n\n    /**\n    hey there\n    */\n\n    /**\n     //\n     */\n\n    /**\n     ///\n    */\n\n    /**\n    \\r\n    */\n\n    /**\n    \\n\n    */\n\n    /**\n    \\r\\n\n    */\n\n    /**\n    \\t\n    */\n\n    /**\n    z̶̤͚̅̍a̷͈̤̪͌͛̈ļ̷̈͐͝g̸̰̈́͂̆o̴̓̏͜\n    */\n}\n\n//\n// hey\n//\n//\n// there\n//\n\n///\n/// hey\n///\n/// there\n///\n\n\n// Noncompliant@+4\n// Secondary@+4\n// Secondary@+4\n\n//\n//\n//\n\n// Noncompliant@+1\n///\n///\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CommentsShouldNotBeEmpty.vb",
    "content": "﻿Public Class Testcases\n\n    Public Sub Comment() '\n\n        ' Noncompliant@-2 (inline comment)\n\n        Dim x = 42 'Ipsem Lorum\n        Dim y = 42 ' Ipsem Lorum\n        Dim z = 42 '\n\n        ' Noncompliant@-2\n\n        Dim a = 42 '''Ipsem Lorum\n        Dim b = 42 ''' Ipsem Lorum\n        Dim c = 42 '''\n\n        '\n\n        ' Noncompliant@-2 (whitespace)\n\n\n        '\n        '\n        '\n        ' hey\n\n        ' hey\n        '\n        '\n        '\n\n\n        '\n        '\n        '\n        '\n\n        ' Noncompliant@-5\n        ' Secondary@-5\n        ' Secondary@-5\n        ' Secondary@-5\n\n        ' Noncompliant@+2\n\n        '\n\n        '\n        '\n        '\n\n        ' Noncompliant@-4\n        ' Secondary@-4\n        ' Secondary@-4\n\n        ' *\n        ' Ipsem Lorum\n        'Ipsem Lorum\n        '\n\n        '\n\n        ' Noncompliant @-2\n\n        ' \\r\n\n        ' \\n\n\n        ' \\r\\n\n\n        ' \\t\n\n        ' z̶̤͚̅̍a̷͈̤̪͌͛̈ļ̷̈͐͝g̸̰̈́͂̆o̴̓̏͜\n\n        ' '''\n\n        ''''\n\n        ' '\n\n        ''\n\n        ''''''\n\n        '\n        '\n        '\n        ''' Ipsem Lorum\n        ' Noncompliant@-4\n        ' Secondary@-4\n        ' Secondary@-4\n    End Sub\n\n    Public Sub DocumentationComment()\n        '''\n        ' Noncompliant@-1 (whitespace)\n\n        ''' *\n        ''' Ipsem Lorum\n        '''Ipsem Lorum\n        '''\n\n        ''' Ipsem Lorum\n\n        '''Ipsem Lorum\n\n        '''\n        ' Noncompliant @-1\n\n        ' Noncompliant @+1\n        '''\n        '''\n        '''\n\n        ''' \\r\n\n        ''' \\n\n\n        ''' \\r\\n\n\n        ''' \\t\n\n        ''' z̶̤͚̅̍a̷͈̤̪͌͛̈ļ̷̈͐͝g̸̰̈́͂̆o̴̓̏͜\n\n        ''' '''\n\n        ''' '\n    End Sub\n\nEnd Class\n'\n' hey\n'\n'\n' there\n'\n\n'''\n''' hey\n'''\n''' there\n'''\n\n\n\n'\n'\n'\n\n' Noncompliant@-4\n' Secondary@-4\n' Secondary@-4\n\n' Noncompliant@+1\n'''\n'''\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ComparableInterfaceImplementation.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics.RecordTests\n{\n    public record RecordMissingAll : IComparable // Noncompliant {{When implementing IComparable, you should also override <, <=, >, and >=.}}\n//                ^^^^^^^^^^^^^^^^\n    {\n        public int CompareTo(object obj) => 0;\n    }\n\n    public record RecordMissingOperators : IComparable<RecordMissingOperators> // Noncompliant {{When implementing IComparable<T>, you should also override <, <=, >, and >=.}}\n//                ^^^^^^^^^^^^^^^^^^^^^^\n    {\n        public int CompareTo(RecordMissingOperators other) => 0;\n    }\n\n    public record RecordMissingLessThan : IComparable // Noncompliant {{When implementing IComparable, you should also override < and >.}}\n//                ^^^^^^^^^^^^^^^^^^^^^\n    {\n        public int CompareTo(object obj) => 0;\n\n        public static bool operator >=(RecordMissingLessThan left, RecordMissingLessThan right) => true;\n        public static bool operator <=(RecordMissingLessThan left, RecordMissingLessThan right) => true;\n    }\n\n    public record RecordCompliant : IComparable // Compliant record auto-generates ==, !=, Equals\n    {\n        public int CompareTo(object obj) => 0;\n\n        public static bool operator <(RecordCompliant left, RecordCompliant right) => true;\n        public static bool operator >(RecordCompliant left, RecordCompliant right) => true;\n        public static bool operator <=(RecordCompliant left, RecordCompliant right) => true;\n        public static bool operator >=(RecordCompliant left, RecordCompliant right) => true;\n    }\n\n    public record DerivedRecordCompliant : RecordCompliant, IComparable // Compliant\n    {\n    }\n}\n\nnamespace Tests.Diagnostics.RecordStructTests\n{\n    public record struct RecordStructMissingAll : IComparable // Noncompliant {{When implementing IComparable, you should also override <, <=, >, and >=.}}\n//                       ^^^^^^^^^^^^^^^^^^^^^^\n    {\n        public int CompareTo(object obj) => 0;\n    }\n\n    public record struct RecordStructMissingOperators : IComparable<RecordStructMissingOperators> // Noncompliant {{When implementing IComparable<T>, you should also override <, <=, >, and >=.}}\n//                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    {\n        public int CompareTo(RecordStructMissingOperators other) => 0;\n    }\n\n    public record struct RecordStructMissingLessThan : IComparable // Noncompliant {{When implementing IComparable, you should also override < and >.}}\n//                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    {\n        public int CompareTo(object obj) => 0;\n\n        public static bool operator >=(RecordStructMissingLessThan left, RecordStructMissingLessThan right) => true;\n        public static bool operator <=(RecordStructMissingLessThan left, RecordStructMissingLessThan right) => true;\n    }\n\n    public record struct RecordStructCompliant : IComparable // Compliant record auto-generates ==, !=, Equals\n    {\n        public int CompareTo(object obj) => 0;\n\n        public static bool operator <(RecordStructCompliant left, RecordStructCompliant right) => true;\n        public static bool operator >(RecordStructCompliant left, RecordStructCompliant right) => true;\n        public static bool operator <=(RecordStructCompliant left, RecordStructCompliant right) => true;\n        public static bool operator >=(RecordStructCompliant left, RecordStructCompliant right) => true;\n    }\n}\n\nnamespace Tests.Diagnostics.PrivateRecordTests\n{\n    public class ContainerWithPrivateRecords\n    {\n        private record PrivateRecordComparable : IComparable // Compliant - private nested\n        {\n            public int CompareTo(object obj) => 0;\n        }\n\n        private record struct PrivateRecordStructComparable : IComparable // Compliant - private nested\n        {\n            public int CompareTo(object obj) => 0;\n        }\n\n        private record PrivateGenericRecordComparable : IComparable<PrivateGenericRecordComparable> // Compliant - private nested\n        {\n            public int CompareTo(PrivateGenericRecordComparable other) => 0;\n        }\n\n        private record struct PrivateGenericRecordStructComparable : IComparable<PrivateGenericRecordStructComparable> // Compliant - private nested\n        {\n            public int CompareTo(PrivateGenericRecordStructComparable other) => 0;\n        }\n    }\n\n    internal record InternalRecordComparable : IComparable<InternalRecordComparable> // Noncompliant {{When implementing IComparable<T>, you should also override <, <=, >, and >=.}}\n//                  ^^^^^^^^^^^^^^^^^^^^^^^^\n    {\n        public int CompareTo(InternalRecordComparable other) => 0;\n    }\n\n    internal record struct InternalRecordStructComparable : IComparable<InternalRecordStructComparable> // Noncompliant {{When implementing IComparable<T>, you should also override <, <=, >, and >=.}}\n//                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    {\n        public int CompareTo(InternalRecordStructComparable other) => 0;\n    }\n}\n\nnamespace Tests.Diagnostics.FileScopedTypeTests\n{\n    // https://sonarsource.atlassian.net/browse/NET-3698\n    // file-scoped types are only visible within the declaring file, so comparison operators are unreachable\n\n    file readonly struct FileStruct(int n) : IComparable<FileStruct> // Noncompliant FP - file-scoped type\n    {\n        private readonly int Value = n;\n        public int CompareTo(FileStruct other) => Value.CompareTo(other.Value);\n    }\n\n    file class FileClass : IComparable<FileClass> // Noncompliant FP - file-scoped type\n    {\n        public int CompareTo(FileClass other) => 0;\n    }\n\n    file record struct FileRecordStruct(int Value) : IComparable<FileRecordStruct> // Noncompliant FP - file-scoped type\n    {\n        public int CompareTo(FileRecordStruct other) => Value.CompareTo(other.Value);\n    }\n\n    file record FileRecord(int Value) : IComparable<FileRecord> // Noncompliant FP - file-scoped type\n    {\n        public int CompareTo(FileRecord other) => Value.CompareTo(other.Value);\n    }\n\n    file class FileClassNonGeneric : IComparable // Noncompliant FP - file-scoped type\n    {\n        public int CompareTo(object obj) => 0;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ComparableInterfaceImplementation.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics.ComparableInterfaceImplementation\n{\n    public class Compliant : IComparable // Compliant\n    {\n        public string Name { get; set; }\n\n        public int CompareTo(object obj)\n        {\n            return Compare(this, obj as Compliant);\n        }\n\n        private static int Compare(Compliant left, Compliant right)\n        {\n            if (left == null && right == null)\n            {\n                return 0;\n            }\n\n            if (left == null)\n            {\n                return -1;\n            }\n\n            if (right == null)\n            {\n                return 1;\n            }\n\n            return left.Name.CompareTo(right.Name);\n        }\n\n        public override bool Equals(object obj)\n        {\n            var other = obj as Compliant;\n            return other != null && this.Name != other.Name;\n        }\n\n        public static bool operator ==(Compliant left, Compliant right)\n        {\n            return left.Equals(right);\n        }\n\n        public static bool operator !=(Compliant left, Compliant right)\n        {\n            return !(left == right);\n        }\n\n        public static bool operator <(Compliant left, Compliant right)\n        {\n            return Compare(left, right) < 0;\n        }\n\n        public static bool operator >(Compliant left, Compliant right)\n        {\n            return Compare(left, right) > 0;\n        }\n\n        public static bool operator >=(Compliant left, Compliant right)\n        {\n            return Compare(left, right) >= 0;\n        }\n\n        public static bool operator <=(Compliant left, Compliant right)\n        {\n            return Compare(left, right) <= 0;\n        }\n    }\n\n    public class DerivedCompliant : Compliant, IComparable // Compliant\n    {\n    }\n\n    public class MissingEquals : IComparable // Noncompliant {{When implementing IComparable, you should also override Equals.}}\n//               ^^^^^^^^^^^^^\n    {\n        public string Name { get; set; }\n\n        public int CompareTo(object obj)\n        {\n            return Compare(this, obj as MissingEquals);\n        }\n\n        private static int Compare(MissingEquals left, MissingEquals right)\n        {\n            if (left == null && right == null)\n            {\n                return 0;\n            }\n\n            if (left == null)\n            {\n                return -1;\n            }\n\n            if (right == null)\n            {\n                return 1;\n            }\n\n            return left.Name.CompareTo(right.Name);\n        }\n\n        public static bool operator ==(MissingEquals left, MissingEquals right)\n        {\n            return left.Equals(right);\n        }\n\n        public static bool operator !=(MissingEquals left, MissingEquals right)\n        {\n            return !(left == right);\n        }\n\n        public static bool operator <(MissingEquals left, MissingEquals right)\n        {\n            return Compare(left, right) < 0;\n        }\n\n        public static bool operator >(MissingEquals left, MissingEquals right)\n        {\n            return Compare(left, right) > 0;\n        }\n        public static bool operator >=(MissingEquals left, MissingEquals right)\n        {\n            return Compare(left, right) >= 0;\n        }\n\n        public static bool operator <=(MissingEquals left, MissingEquals right)\n        {\n            return Compare(left, right) <= 0;\n        }\n\n    }\n\n    public class DifferentEquals : IComparable // Noncompliant {{When implementing IComparable, you should also override Equals.}}\n//               ^^^^^^^^^^^^^^^\n    {\n        public string Name { get; set; }\n\n        public int CompareTo(object obj)\n        {\n            return Compare(this, obj as DifferentEquals);\n        }\n\n        private static int Compare(DifferentEquals left, DifferentEquals right)\n        {\n            if (left == null && right == null)\n            {\n                return 0;\n            }\n\n            if (left == null)\n            {\n                return -1;\n            }\n\n            if (right == null)\n            {\n                return 1;\n            }\n\n            return left.Name.CompareTo(right.Name);\n        }\n\n        public bool Equals(object obj, string someParam)\n        {\n            var other = obj as DifferentEquals;\n            return other != null && this.Name != other.Name;\n        }\n\n        public bool Equals(object obj)\n        {\n            return true;\n        }\n\n        public bool Equals()\n        {\n            return true;\n        }\n\n        public bool Equals { get; set; } // Error [CS0102]\n\n        public bool Equals => true; // Error [CS0102]\n\n        public bool Equals() => true; // Error [CS0102,CS0111]\n\n        public static bool operator ==(DifferentEquals left, DifferentEquals right)\n        {\n            return left.Equals(right);\n        }\n\n        public static bool operator !=(DifferentEquals left, DifferentEquals right)\n        {\n            return !(left == right);\n        }\n\n        public static bool operator <(DifferentEquals left, DifferentEquals right)\n        {\n            return Compare(left, right) < 0;\n        }\n\n        public static bool operator >(DifferentEquals left, DifferentEquals right)\n        {\n            return Compare(left, right) > 0;\n        }\n\n        public static bool operator >=(DifferentEquals left, DifferentEquals right)\n        {\n            return Compare(left, right) >= 0;\n        }\n\n        public static bool operator <=(DifferentEquals left, DifferentEquals right)\n        {\n            return Compare(left, right) <= 0;\n        }\n    }\n\n    public class MissingGreaterThan : IComparable // Noncompliant {{When implementing IComparable, you should also override < and >.}}\n//               ^^^^^^^^^^^^^^^^^^\n    {\n        public string Name { get; set; }\n\n        public int CompareTo(object obj)\n        {\n            return Compare(this, obj as MissingGreaterThan);\n        }\n\n        private static int Compare(MissingGreaterThan left, MissingGreaterThan right)\n        {\n            if (left == null && right == null)\n            {\n                return 0;\n            }\n\n            if (left == null)\n            {\n                return -1;\n            }\n\n            if (right == null)\n            {\n                return 1;\n            }\n\n            return left.Name.CompareTo(right.Name);\n        }\n\n        public override bool Equals(object obj)\n        {\n            var other = obj as MissingGreaterThan;\n            return other != null && this.Name != other.Name;\n        }\n\n        public static bool operator ==(MissingGreaterThan left, MissingGreaterThan right)\n        {\n            return left.Equals(right);\n        }\n\n        public static bool operator !=(MissingGreaterThan left, MissingGreaterThan right)\n        {\n            return !(left == right);\n        }\n\n        public static bool operator >=(MissingGreaterThan left, MissingGreaterThan right)\n        {\n            return Compare(left, right) >= 0;\n        }\n\n        public static bool operator <=(MissingGreaterThan left, MissingGreaterThan right)\n        {\n            return Compare(left, right) <= 0;\n        }\n    }\n\n    public class MissingNotEqual : IComparable // Noncompliant {{When implementing IComparable, you should also override == and !=.}}\n//               ^^^^^^^^^^^^^^^\n    {\n        public string Name { get; set; }\n\n        public int CompareTo(object obj)\n        {\n            return Compare(this, obj as MissingNotEqual);\n        }\n\n        private static int Compare(MissingNotEqual left, MissingNotEqual right)\n        {\n            if (left == null && right == null)\n            {\n                return 0;\n            }\n\n            if (left == null)\n            {\n                return -1;\n            }\n\n            if (right == null)\n            {\n                return 1;\n            }\n\n            return left.Name.CompareTo(right.Name);\n        }\n\n        public override bool Equals(object obj)\n        {\n            var other = obj as MissingNotEqual;\n            return other != null && this.Name != other.Name;\n        }\n\n        public static bool operator <(MissingNotEqual left, MissingNotEqual right)\n        {\n            return Compare(left, right) < 0;\n        }\n\n        public static bool operator >(MissingNotEqual left, MissingNotEqual right)\n        {\n            return Compare(left, right) > 0;\n        }\n\n        public static bool operator >=(MissingNotEqual left, MissingNotEqual right)\n        {\n            return Compare(left, right) >= 0;\n        }\n\n        public static bool operator <=(MissingNotEqual left, MissingNotEqual right)\n        {\n            return Compare(left, right) <= 0;\n        }\n    }\n\n    public class MissingGreaterThanOrEqualTo : IComparable // Noncompliant {{When implementing IComparable, you should also override >=.}}\n//               ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    {\n        public string Name { get; set; }\n\n        public int CompareTo(object obj)\n        {\n            return Compare(this, obj as MissingGreaterThanOrEqualTo);\n        }\n\n        private static int Compare(MissingGreaterThanOrEqualTo left, MissingGreaterThanOrEqualTo right)\n        {\n            if (left == null && right == null)\n            {\n                return 0;\n            }\n\n            if (left == null)\n            {\n                return -1;\n            }\n\n            if (right == null)\n            {\n                return 1;\n            }\n\n            return left.Name.CompareTo(right.Name);\n        }\n\n        public override bool Equals(object obj)\n        {\n            var other = obj as MissingNotEqual;\n            return other != null && this.Name != other.Name;\n        }\n\n        public static bool operator <(MissingGreaterThanOrEqualTo left, MissingGreaterThanOrEqualTo right)\n        {\n            return Compare(left, right) < 0;\n        }\n\n        public static bool operator >(MissingGreaterThanOrEqualTo left, MissingGreaterThanOrEqualTo right)\n        {\n            return Compare(left, right) > 0;\n        }\n\n        public static bool operator ==(MissingGreaterThanOrEqualTo left, MissingGreaterThanOrEqualTo right)\n        {\n            return left.Equals(right);\n        }\n\n        public static bool operator !=(MissingGreaterThanOrEqualTo left, MissingGreaterThanOrEqualTo right)\n        {\n            return !(left == right);\n        }\n\n        public static bool operator <=(MissingGreaterThanOrEqualTo left, MissingGreaterThanOrEqualTo right) // Error [CS0216]\n        {\n            return Compare(left, right) <= 0;\n        }\n    }\n\n    public class MissingLessThanOrEqualTo : IComparable // Noncompliant {{When implementing IComparable, you should also override <=.}}\n//               ^^^^^^^^^^^^^^^^^^^^^^^^\n    {\n        public string Name { get; set; }\n\n        public int CompareTo(object obj)\n        {\n            return Compare(this, obj as MissingLessThanOrEqualTo);\n        }\n\n        private static int Compare(MissingLessThanOrEqualTo left, MissingLessThanOrEqualTo right)\n        {\n            if (left == null && right == null)\n            {\n                return 0;\n            }\n\n            if (left == null)\n            {\n                return -1;\n            }\n\n            if (right == null)\n            {\n                return 1;\n            }\n\n            return left.Name.CompareTo(right.Name);\n        }\n\n        public override bool Equals(object obj)\n        {\n            var other = obj as MissingNotEqual;\n            return other != null && this.Name != other.Name;\n        }\n\n        public static bool operator <(MissingLessThanOrEqualTo left, MissingLessThanOrEqualTo right)\n        {\n            return Compare(left, right) < 0;\n        }\n\n        public static bool operator >(MissingLessThanOrEqualTo left, MissingLessThanOrEqualTo right)\n        {\n            return Compare(left, right) > 0;\n        }\n\n        public static bool operator ==(MissingLessThanOrEqualTo left, MissingLessThanOrEqualTo right)\n        {\n            return left.Equals(right);\n        }\n\n        public static bool operator !=(MissingLessThanOrEqualTo left, MissingLessThanOrEqualTo right)\n        {\n            return !(left == right);\n        }\n\n        public static bool operator >=(MissingLessThanOrEqualTo left, MissingLessThanOrEqualTo right) // Error [CS0216]\n        {\n            return Compare(left, right) >= 0;\n        }\n    }\n\n    public struct Struct : IComparable // Noncompliant {{When implementing IComparable, you should also override Equals, ==, !=, <, <=, >, and >=.}}\n    {\n        public int CompareTo(object obj)\n        {\n            return 0;\n        }\n    }\n}\n\nnamespace Tests.Diagnostics.ComparableGenericInterfaceImplementation\n{\n    public class Compliant : IComparable<Compliant> // Compliant\n    {\n        public string Name { get; set; }\n\n        public int CompareTo(Compliant obj)\n        {\n            return Compare(this, obj);\n        }\n\n        private static int Compare(Compliant left, Compliant right)\n        {\n            if (left == null && right == null)\n            {\n                return 0;\n            }\n\n            if (left == null)\n            {\n                return -1;\n            }\n\n            if (right == null)\n            {\n                return 1;\n            }\n\n            return left.Name.CompareTo(right.Name);\n        }\n\n        public override bool Equals(object obj)\n        {\n            var other = obj as Compliant;\n            return other != null && this.Name != other.Name;\n        }\n\n        public static bool operator ==(Compliant left, Compliant right)\n        {\n            return left.Equals(right);\n        }\n\n        public static bool operator !=(Compliant left, Compliant right)\n        {\n            return !(left == right);\n        }\n\n        public static bool operator <(Compliant left, Compliant right)\n        {\n            return Compare(left, right) < 0;\n        }\n\n        public static bool operator >(Compliant left, Compliant right)\n        {\n            return Compare(left, right) > 0;\n        }\n        public static bool operator >=(Compliant left, Compliant right)\n        {\n            return Compare(left, right) >= 0;\n        }\n\n        public static bool operator <=(Compliant left, Compliant right)\n        {\n            return Compare(left, right) <= 0;\n        }\n\n    }\n\n    public class MissingEquals : IComparable<MissingEquals> // Noncompliant {{When implementing IComparable<T>, you should also override Equals.}}\n//               ^^^^^^^^^^^^^\n    {\n        public string Name { get; set; }\n\n        public int CompareTo(MissingEquals obj)\n        {\n            return Compare(this, obj);\n        }\n\n        private static int Compare(MissingEquals left, MissingEquals right)\n        {\n            if (left == null && right == null)\n            {\n                return 0;\n            }\n\n            if (left == null)\n            {\n                return -1;\n            }\n\n            if (right == null)\n            {\n                return 1;\n            }\n\n            return left.Name.CompareTo(right.Name);\n        }\n\n        public static bool operator ==(MissingEquals left, MissingEquals right)\n        {\n            return left.Equals(right);\n        }\n\n        public static bool operator !=(MissingEquals left, MissingEquals right)\n        {\n            return !(left == right);\n        }\n\n        public static bool operator <(MissingEquals left, MissingEquals right)\n        {\n            return Compare(left, right) < 0;\n        }\n\n        public static bool operator >(MissingEquals left, MissingEquals right)\n        {\n            return Compare(left, right) > 0;\n        }\n\n        public static bool operator >=(MissingEquals left, MissingEquals right)\n        {\n            return Compare(left, right) >= 0;\n        }\n\n        public static bool operator <=(MissingEquals left, MissingEquals right)\n        {\n            return Compare(left, right) <= 0;\n        }\n    }\n\n    public class DifferentEquals : IComparable<DifferentEquals> // Noncompliant {{When implementing IComparable<T>, you should also override Equals.}}\n//               ^^^^^^^^^^^^^^^\n    {\n        public string Name { get; set; }\n\n        public int CompareTo(DifferentEquals obj)\n        {\n            return Compare(this, obj);\n        }\n\n        private static int Compare(DifferentEquals left, DifferentEquals right)\n        {\n            if (left == null && right == null)\n            {\n                return 0;\n            }\n\n            if (left == null)\n            {\n                return -1;\n            }\n\n            if (right == null)\n            {\n                return 1;\n            }\n\n            return left.Name.CompareTo(right.Name);\n        }\n\n        public bool Equals(object obj, string someParam)\n        {\n            var other = obj as DifferentEquals;\n            return other != null && this.Name != other.Name;\n        }\n\n        public bool Equals(object obj)\n        {\n            return true;\n        }\n\n        public static bool operator ==(DifferentEquals left, DifferentEquals right)\n        {\n            return left.Equals(right);\n        }\n\n        public static bool operator !=(DifferentEquals left, DifferentEquals right)\n        {\n            return !(left == right);\n        }\n\n        public static bool operator <(DifferentEquals left, DifferentEquals right)\n        {\n            return Compare(left, right) < 0;\n        }\n\n        public static bool operator >(DifferentEquals left, DifferentEquals right)\n        {\n            return Compare(left, right) > 0;\n        }\n\n        public static bool operator >=(DifferentEquals left, DifferentEquals right)\n        {\n            return Compare(left, right) >= 0;\n        }\n\n        public static bool operator <=(DifferentEquals left, DifferentEquals right)\n        {\n            return Compare(left, right) <= 0;\n        }\n    }\n\n    public class MissingGreaterThan : IComparable<MissingGreaterThan> // Noncompliant {{When implementing IComparable<T>, you should also override < and >.}}\n//               ^^^^^^^^^^^^^^^^^^\n    {\n        public string Name { get; set; }\n\n        public int CompareTo(MissingGreaterThan obj)\n        {\n            return Compare(this, obj);\n        }\n\n        private static int Compare(MissingGreaterThan left, MissingGreaterThan right)\n        {\n            if (left == null && right == null)\n            {\n                return 0;\n            }\n\n            if (left == null)\n            {\n                return -1;\n            }\n\n            if (right == null)\n            {\n                return 1;\n            }\n\n            return left.Name.CompareTo(right.Name);\n        }\n\n        public override bool Equals(object obj)\n        {\n            var other = obj as MissingGreaterThan;\n            return other != null && this.Name != other.Name;\n        }\n\n        public static bool operator ==(MissingGreaterThan left, MissingGreaterThan right)\n        {\n            return left.Equals(right);\n        }\n\n        public static bool operator !=(MissingGreaterThan left, MissingGreaterThan right)\n        {\n            return !(left == right);\n        }\n\n        public static bool operator >=(MissingGreaterThan left, MissingGreaterThan right)\n        {\n            return Compare(left, right) >= 0;\n        }\n\n        public static bool operator <=(MissingGreaterThan left, MissingGreaterThan right)\n        {\n            return Compare(left, right) <= 0;\n        }\n    }\n\n    public class MissingNotEqual : IComparable<MissingNotEqual> // Noncompliant {{When implementing IComparable<T>, you should also override == and !=.}}\n//               ^^^^^^^^^^^^^^^\n    {\n        public string Name { get; set; }\n\n        public int CompareTo(MissingNotEqual obj)\n        {\n            return Compare(this, obj);\n        }\n\n        private static int Compare(MissingNotEqual left, MissingNotEqual right)\n        {\n            if (left == null && right == null)\n            {\n                return 0;\n            }\n\n            if (left == null)\n            {\n                return -1;\n            }\n\n            if (right == null)\n            {\n                return 1;\n            }\n\n            return left.Name.CompareTo(right.Name);\n        }\n\n        public override bool Equals(object obj)\n        {\n            var other = obj as MissingNotEqual;\n            return other != null && this.Name != other.Name;\n        }\n\n        public static bool operator <(MissingNotEqual left, MissingNotEqual right)\n        {\n            return Compare(left, right) < 0;\n        }\n\n        public static bool operator >(MissingNotEqual left, MissingNotEqual right)\n        {\n            return Compare(left, right) > 0;\n        }\n\n        public static bool operator >=(MissingNotEqual left, MissingNotEqual right)\n        {\n            return Compare(left, right) >= 0;\n        }\n\n        public static bool operator <=(MissingNotEqual left, MissingNotEqual right)\n        {\n            return Compare(left, right) <= 0;\n        }\n    }\n\n    public class MissingGreaterThanOrEqualTo : IComparable<MissingGreaterThanOrEqualTo> // Noncompliant {{When implementing IComparable<T>, you should also override >=.}}\n//               ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    {\n        public string Name { get; set; }\n\n        public int CompareTo(MissingGreaterThanOrEqualTo obj)\n        {\n            return Compare(this, obj);\n        }\n\n        private static int Compare(MissingGreaterThanOrEqualTo left, MissingGreaterThanOrEqualTo right)\n        {\n            if (left == null && right == null)\n            {\n                return 0;\n            }\n\n            if (left == null)\n            {\n                return -1;\n            }\n\n            if (right == null)\n            {\n                return 1;\n            }\n\n            return left.Name.CompareTo(right.Name);\n        }\n\n        public override bool Equals(object obj)\n        {\n            var other = obj as MissingNotEqual;\n            return other != null && this.Name != other.Name;\n        }\n\n        public static bool operator <(MissingGreaterThanOrEqualTo left, MissingGreaterThanOrEqualTo right)\n        {\n            return Compare(left, right) < 0;\n        }\n\n        public static bool operator >(MissingGreaterThanOrEqualTo left, MissingGreaterThanOrEqualTo right)\n        {\n            return Compare(left, right) > 0;\n        }\n\n        public static bool operator ==(MissingGreaterThanOrEqualTo left, MissingGreaterThanOrEqualTo right)\n        {\n            return left.Equals(right);\n        }\n\n        public static bool operator !=(MissingGreaterThanOrEqualTo left, MissingGreaterThanOrEqualTo right)\n        {\n            return !(left == right);\n        }\n\n        public static bool operator <=(MissingGreaterThanOrEqualTo left, MissingGreaterThanOrEqualTo right) // Error [CS0216]\n        {\n            return Compare(left, right) <= 0;\n        }\n    }\n\n    public class MissingLessThanOrEqualTo : IComparable<MissingLessThanOrEqualTo> // Noncompliant {{When implementing IComparable<T>, you should also override <=.}}\n//               ^^^^^^^^^^^^^^^^^^^^^^^^\n    {\n        public string Name { get; set; }\n\n        public int CompareTo(MissingLessThanOrEqualTo obj)\n        {\n            return Compare(this, obj);\n        }\n\n        private static int Compare(MissingLessThanOrEqualTo left, MissingLessThanOrEqualTo right)\n        {\n            if (left == null && right == null)\n            {\n                return 0;\n            }\n\n            if (left == null)\n            {\n                return -1;\n            }\n\n            if (right == null)\n            {\n                return 1;\n            }\n\n            return left.Name.CompareTo(right.Name);\n        }\n\n        public override bool Equals(object obj)\n        {\n            var other = obj as MissingNotEqual;\n            return other != null && this.Name != other.Name;\n        }\n\n        public static bool operator <(MissingLessThanOrEqualTo left, MissingLessThanOrEqualTo right)\n        {\n            return Compare(left, right) < 0;\n        }\n\n        public static bool operator >(MissingLessThanOrEqualTo left, MissingLessThanOrEqualTo right)\n        {\n            return Compare(left, right) > 0;\n        }\n\n        public static bool operator ==(MissingLessThanOrEqualTo left, MissingLessThanOrEqualTo right)\n        {\n            return left.Equals(right);\n        }\n\n        public static bool operator !=(MissingLessThanOrEqualTo left, MissingLessThanOrEqualTo right)\n        {\n            return !(left == right);\n        }\n\n        public static bool operator >=(MissingLessThanOrEqualTo left, MissingLessThanOrEqualTo right) // Error [CS0216]\n        {\n            return Compare(left, right) >= 0;\n        }\n    }\n}\n\nnamespace Tests.Diagnostics.BothInterfacesImplementation\n{\n    public class NonCompliant : IComparable, IComparable<NonCompliant> // Noncompliant {{When implementing IComparable or IComparable<T>, you should also override Equals, ==, !=, <, <=, >, and >=.}}\n    {\n        public string Name { get; set; }\n\n        public int CompareTo(object obj)\n        {\n            return 0;\n        }\n\n        public int CompareTo(NonCompliant obj)\n        {\n            return Compare(this, obj);\n        }\n\n        private static int Compare(NonCompliant left, NonCompliant right)\n        {\n            if (left == null && right == null)\n            {\n                return 0;\n            }\n\n            if (left == null)\n            {\n                return -1;\n            }\n\n            if (right == null)\n            {\n                return 1;\n            }\n\n            return left.Name.CompareTo(right.Name);\n        }\n    }\n}\n\n// https://sonarsource.atlassian.net/browse/NET-3053\npublic class ContainerWithPrivateTypes\n{\n    private class PrivateComparable : IComparable           // Compliant - Nested private types are compliant\n    {\n        public int CompareTo(object obj) => 0;\n    }\n\n    private struct PrivateComparableStruct : IComparable    // Compliant\n    {\n        public int CompareTo(object obj) => 0;\n    }\n\n    private sealed class PrivateGenericComparable : IComparable<PrivateGenericComparable> // Compliant\n    {\n        public int CompareTo(PrivateGenericComparable other) => 0;\n    }\n\n    private class PrivateBothComparable : IComparable, IComparable<PrivateBothComparable> // Compliant\n    {\n        public int CompareTo(object obj) => 0;\n        public int CompareTo(PrivateBothComparable other) => 0;\n    }\n}\n\ninternal class InternalComparable : IComparable<InternalComparable> // Noncompliant {{When implementing IComparable<T>, you should also override Equals, ==, !=, <, <=, >, and >=.}}\n{\n    public int CompareTo(InternalComparable other) => 0;\n}\n\ninternal struct InternalComparableStruct : IComparable<InternalComparableStruct> // Noncompliant {{When implementing IComparable<T>, you should also override Equals, ==, !=, <, <=, >, and >=.}}\n{\n    public int CompareTo(InternalComparableStruct other) => 0;\n}\n\ninternal class InternalContainerWithNestedPrivate\n{\n    private class NestedPrivateComparable : IComparable // Compliant because private\n    {\n        public int CompareTo(object obj) => 0;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CompareNaN.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nclass CompareNaN\n{\n    void ListPattern()\n    {\n        var baseCase = 2 == double.NaN; // Noncompliant\n\n        double[] numbers = new double[] { 1, double.NaN };\n        var listPattern1 = numbers is [not double.NaN, double.NaN]; // Compliant, IsPattern is excluded, works as expected\n        var listPattern2 = numbers is not [not double.NaN, double.NaN]; // Compliant, IsPattern is excluded, works as expected\n    }\n}\n\n\nclass NullConditionalAssignment\n{\n    class MyClass\n    {\n        public bool Valid { get; set; }\n    }\n    public void TestMethod()\n    {\n        var obj = new MyClass();\n        double number = 42;\n        obj?.Valid = double.NaN >= number;  // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CompareNaN.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    struct Point { public float X; public float Y; }\n    class CompareNaN\n    {\n        void TestDouble()\n        {\n            var a = double.NaN;\n\n            if (a == double.NaN) // Noncompliant {{Use double.IsNaN() instead.}}\n            {\n                Console.WriteLine(\"a is not a number\");\n            }\n\n            if (a != double.NaN) // Noncompliant {{Use double.IsNaN() instead.}}\n            {\n                Console.WriteLine(\"a is a number\");\n            }\n\n            double number = 42;\n            var greaterThan = number > double.NaN; // Noncompliant {{Do not compare a number with double.NaN.}}\n            var greaterThan2 = double.NaN > number; // Noncompliant\n\n            var greaterOrEqual = number >= double.NaN; // Noncompliant\n            var greaterOrEqual2 = double.NaN >= number; // Noncompliant\n\n            var lessThan = number < double.NaN; // Noncompliant\n            var lessThan2 = double.NaN < number; // Noncompliant\n\n            var lessOrEqualThan = number <= double.NaN; // Noncompliant\n            var lessOrEqualThan2 = double.NaN <= number; // Noncompliant\n\n            var isPattern = 42D is double.NaN; // Compliant, IsPattern is excluded, works as expected\n        }\n\n        void TestFloat()\n        {\n            var a = float.NaN;\n\n            if (a == float.NaN) // Noncompliant {{Use float.IsNaN() instead.}}\n            {\n                Console.WriteLine(\"a is not a number\");\n            }\n\n            if (a != float.NaN) // Noncompliant {{Use float.IsNaN() instead.}}\n            {\n                Console.WriteLine(\"a is a number\");\n            }\n\n            if (a != a) // Compliant\n            {\n                Console.WriteLine(\"a is not a number\");\n            }\n\n            int b = 5;\n            if (new Point().X != b) // Compliant\n            {\n                Console.WriteLine(\"this is ok\");\n            }\n\n            float number = 42;\n            var greaterThan = number > float.NaN; // Noncompliant {{Do not compare a number with float.NaN.}}\n            var greaterThan2 = float.NaN > number; // Noncompliant\n\n            var greaterOrEqual = number >= float.NaN; // Noncompliant\n            var greaterOrEqual2 = float.NaN >= number; // Noncompliant\n\n            var lessThan = number < float.NaN; // Noncompliant\n            var lessThan2 = float.NaN < number; // Noncompliant\n\n            var lessOrEqualThan = number <= float.NaN; // Noncompliant\n            var lessOrEqualThan2 = float.NaN <= number; // Noncompliant\n\n            var isPattern = 42F is float.NaN; // Compliant, IsPattern is excluded, works as expected\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ConditionalSimplification.BeforeCSharp8.Fixed.cs",
    "content": "﻿using System.Collections.Generic;\n\nnamespace Tests.TestCases\n{\n    class ConditionalSimplification\n    {\n        void NullCoalesceAssignment(object a, object b)\n        {\n            //??= can be used from C# 8 only\n            a = a ?? b;                 // Compliant, this time\n            a = a ?? b;    // Fixed\n            a = a ?? b;    // Fixed\n\n            a = a ?? b;\n\n            bool? value = null;\n            value = value ?? false;\n\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/4962\n    class FPRepro_4962\n    {\n        public static string TestFunction(string key1, string key2)\n        {\n            var dictionary1 = new Dictionary<string, string>();\n            var dictionary2 = new Dictionary<string, string>();\n\n            string value;\n            if (string.IsNullOrEmpty(key1)) dictionary2.TryGetValue(key2, out value);\n            else dictionary1.TryGetValue(key1, out value);\n\n            return value;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ConditionalSimplification.BeforeCSharp8.cs",
    "content": "﻿using System.Collections.Generic;\n\nnamespace Tests.TestCases\n{\n    class ConditionalSimplification\n    {\n        void NullCoalesceAssignment(object a, object b)\n        {\n            //??= can be used from C# 8 only\n            a = a ?? b;                 // Compliant, this time\n            a = a != null ? (a) : b;    // Noncompliant {{Use the '??' operator here.}}\n            a = null == a ? b : (a);    // Noncompliant {{Use the '??' operator here.}}\n\n            if (a == null) // Noncompliant {{Use the '??' operator here.}}\n            {\n                a = b;\n            }\n\n            bool? value = null;\n            if (value == null)  // Noncompliant {{Use the '??' operator here.}}\n                value = false;\n\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/4962\n    class FPRepro_4962\n    {\n        public static string TestFunction(string key1, string key2)\n        {\n            var dictionary1 = new Dictionary<string, string>();\n            var dictionary2 = new Dictionary<string, string>();\n\n            string value;\n            if (string.IsNullOrEmpty(key1)) dictionary2.TryGetValue(key2, out value);\n            else dictionary1.TryGetValue(key1, out value);\n\n            return value;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ConditionalSimplification.CSharp8.Fixed.cs",
    "content": "﻿public class TestCases\n{\n    public void SameBaseType(bool condition)\n    {\n        object x;\n        X o = null;\n        if (o == null) // Compliant, target type conditionals are supported only from C# 9\n        {\n            x = new Y();\n        }\n        else\n        {\n            x = o;\n        }\n\n        o ??= new X(); // Fixed\n\n        Base elem;\n        if (condition) // Compliant, target type conditionals are supported only from C# 9\n        {\n            elem = new A();\n        }\n        else\n        {\n            elem = new B();\n        }\n    }\n\n    class X { }\n    class Y { }\n    class Base { }\n    class A : Base { }\n    class B : Base { }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/4607\npublic class Example\n{\n    public string Foo { get; set; }\n    public string Bar { get; set; }\n\n    public Example Fallback(Example other)\n    {\n        return new Example\n        {\n            Foo = Foo ?? other.Foo, // Compliant, cannot be changed\n            Bar = Bar ?? other.Bar  // Compliant, cannot be changed\n        };\n    }\n}\n\n// https://community.sonarsource.com/t/134362\nclass Repro_134362\n{\n    public void Method(bool condition1, bool condition2)\n    {\n        string s1 = string.Empty;\n        if (condition1) // Compliant, we don't raise if one of the if branches contains ternary\n                        // Otherwise the fix, raises S3358\n        {\n            s1 = \"some value\";\n        }\n        else\n        {\n            s1 = $\"other value {(condition2 ? \"suffix1\" : \"suffix2\")}\";\n        }\n    }\n\n    public void Method2(bool condition1, bool condition2)\n    {\n        string s1 = string.Empty;\n        if (condition1) // Compliant, we don't raise if one of the if branches contains ternary\n                        // Otherwise the fix, raises S3358\n        {\n            s1 = \"some value\";\n        }\n        else\n        {\n            s1 = condition2 ? \"suffix1\" : \"suffix2\";\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ConditionalSimplification.CSharp8.cs",
    "content": "﻿public class TestCases\n{\n    public void SameBaseType(bool condition)\n    {\n        object x;\n        X o = null;\n        if (o == null) // Compliant, target type conditionals are supported only from C# 9\n        {\n            x = new Y();\n        }\n        else\n        {\n            x = o;\n        }\n\n        o = o ?? new X(); // Noncompliant {{Use the '??=' operator here.}}\n\n        Base elem;\n        if (condition) // Compliant, target type conditionals are supported only from C# 9\n        {\n            elem = new A();\n        }\n        else\n        {\n            elem = new B();\n        }\n    }\n\n    class X { }\n    class Y { }\n    class Base { }\n    class A : Base { }\n    class B : Base { }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/4607\npublic class Example\n{\n    public string Foo { get; set; }\n    public string Bar { get; set; }\n\n    public Example Fallback(Example other)\n    {\n        return new Example\n        {\n            Foo = Foo ?? other.Foo, // Compliant, cannot be changed\n            Bar = Bar ?? other.Bar  // Compliant, cannot be changed\n        };\n    }\n}\n\n// https://community.sonarsource.com/t/134362\nclass Repro_134362\n{\n    public void Method(bool condition1, bool condition2)\n    {\n        string s1 = string.Empty;\n        if (condition1) // Compliant, we don't raise if one of the if branches contains ternary\n                        // Otherwise the fix, raises S3358\n        {\n            s1 = \"some value\";\n        }\n        else\n        {\n            s1 = $\"other value {(condition2 ? \"suffix1\" : \"suffix2\")}\";\n        }\n    }\n\n    public void Method2(bool condition1, bool condition2)\n    {\n        string s1 = string.Empty;\n        if (condition1) // Compliant, we don't raise if one of the if branches contains ternary\n                        // Otherwise the fix, raises S3358\n        {\n            s1 = \"some value\";\n        }\n        else\n        {\n            s1 = condition2 ? \"suffix1\" : \"suffix2\";\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ConditionalSimplification.FromCSharp10.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing FluentAssertions;\n\nFruit a = null;\nvar y = a switch\n{\n    null => 1,\n    { Prop.Count: 1 } => 0 // Fixed\n};\n\nclass Fruit { public List<int> Prop; }\n\nclass FPRepro_5789\n{\n    // https://github.com/SonarSource/sonar-dotnet/issues/5789\n    public void SomeMethod()\n    {\n        double from = 16;\n        double to = 23;\n        int x = 1;\n        double y = 1;\n        var dt = DateTime.Now;\n        var sut = TimeSpan.MaxValue;\n        if (sut.Ticks > 0)\n            Convert.ToChar(x);\n        else\n            Convert.ToChar(y);\n        if (sut.Ticks > 0)\n            sut.Should().BeGreaterThan(TimeSpan.FromMilliseconds(from)).And.BeLessThan(TimeSpan.FromMilliseconds(to));\n        else\n            sut.Should().BeGreaterThan(TimeSpan.FromMilliseconds(to)).And.BeLessThan(TimeSpan.FromMilliseconds(from));\n\n        sut.Should().BeGreaterThan(TimeSpan.FromMilliseconds(from)).And.BeLessThan(sut.Ticks > 0 ? TimeSpan.FromMilliseconds(to) : TimeSpan.FromMilliseconds(from));\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ConditionalSimplification.FromCSharp10.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing FluentAssertions;\n\nFruit a = null;\nvar y = a switch\n{\n    null => 1,\n    not not {Prop.Count: 1 } => 0 // Noncompliant {{Simplify negation here.}}\n//  ^^^^^^^^^^^^^^^^^^^^^^^^\n};\n\nclass Fruit { public List<int> Prop; }\n\nclass FPRepro_5789\n{\n    // https://github.com/SonarSource/sonar-dotnet/issues/5789\n    public void SomeMethod()\n    {\n        double from = 16;\n        double to = 23;\n        int x = 1;\n        double y = 1;\n        var dt = DateTime.Now;\n        var sut = TimeSpan.MaxValue;\n        if (sut.Ticks > 0)\n            Convert.ToChar(x);\n        else\n            Convert.ToChar(y);\n        if (sut.Ticks > 0)\n            sut.Should().BeGreaterThan(TimeSpan.FromMilliseconds(from)).And.BeLessThan(TimeSpan.FromMilliseconds(to));\n        else\n            sut.Should().BeGreaterThan(TimeSpan.FromMilliseconds(to)).And.BeLessThan(TimeSpan.FromMilliseconds(from));\n\n        if (sut.Ticks > 0) // Noncompliant\n            sut.Should().BeGreaterThan(TimeSpan.FromMilliseconds(from)).And.BeLessThan(TimeSpan.FromMilliseconds(to));\n        else\n            sut.Should().BeGreaterThan(TimeSpan.FromMilliseconds(from)).And.BeLessThan(TimeSpan.FromMilliseconds(from));\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ConditionalSimplification.FromCSharp8.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Tests.TestCases\n{\n    class ConditionalSimplification\n    {\n        object Identity(object o)\n        {\n            return o;\n        }\n        object IdentityAnyOtherMethod(object o)\n        {\n            return o;\n        }\n        int Test(object a, object b, object y, bool condition)\n        {\n            object x;\n\n            x = a ?? b/*some other comment*/;\n\n            x = a ?? b;  // Fixed\n            x = a != null ? a : a;  // Compliant, triggers S2758\n\n            int i = 5;\n            var z = i == null ? 4 : i; //can't be converted\n\n            x = Identity(y ?? new object());  // Fixed\n\n            a ??= b;                 // Fixed\n            a ??= b;    // Fixed\n            a ??= b;    // Fixed\n            a ??= b;               // Fixed\n            a ??= b;             // Fixed\n            a ??= b;    // Fixed\n\n            x = a ?? b;\n            x = a ?? b;\n            x = y ?? new object();\n            x = condition ? a : b;\n\n            x = condition ? a : b;\n\n            x = a ?? b;\n\n            x = condition ? Identity(new object()) : IdentityAnyOtherMethod(y);\n\n            Identity(condition ? new object() : y);\n\n            return condition ? 1 : 2;\n\n            if (condition)\n                return 1;\n            else if (condition) //Compliant\n                return 2;\n            else\n                return 3;\n\n            //This will be CodeFix-ed\n            a ??= b;\n\n            if (a != null)\n            {\n                a = b;\n            }\n\n            bool? value = null;\n            value ??= false;  //This will be CodeFix-ed and this comment should be preserved\n\n            var yyy = new Y();\n            x = condition ? Identity(new Y()) : Identity(yyy);\n\n            x = condition ? Identity(new Y()) : Identity(new X());\n\n            // Removing space from \"if (\" on next line will fail the test.\n            // https://github.com/SonarSource/sonar-dotnet/issues/3064\n            Identity(yyy ?? new Y());\n\n            Identity(yyy ?? new Y());\n\n            x = condition ? Identity(new Y()) : Identity(yyy);\n\n            Base elem;\n            elem = condition ? new A() : null;\n            if (condition) // Non-compliant, but not handled because of the type difference\n            {\n                elem = new A();\n            }\n            else\n            {\n                elem = new NonExistentType(); // Error [CS0246]\n            }\n\n            if (condition) // Non-compliant, but not handled because of the type difference\n            {\n                elem = new NonExistentType(); // Error [CS0246]\n            }\n            else\n            {\n                elem = new A();\n            }\n\n            elem = false ? null : (null);\n\n            if (condition)\n            {\n                Undefined(new object());    // Error [CS0103]: The name 'Undefined' does not exist in the current context\n            }\n            else\n            {\n                Undefined(y);               // Error [CS0103]: The name 'Undefined' does not exist in the current context\n            }\n\n            if (condition)\n            {\n                WithIntArg(42);\n            }\n            else\n            {\n                WithIntArg(new object());   // Error [CS1503]: Argument 1: cannot convert from 'object' to 'int'\n            }\n\n            if (condition)\n            {\n                Identity(new object());\n            }\n            else\n            {\n                x = null;\n            }\n        }\n\n        object WithIntArg(int arg) => null;\n\n        object IsNull1(object a, object b)\n        {\n            return a ?? b;\n        }\n\n        object IsNull2(object a, object b)\n        {\n            return a ?? b;\n        }\n\n        // we ignore lambdas because of type resolution for conditional expressions, see CS0173\n        Action LambdasAreIgnored(bool condition, object a, Action action)\n        {\n            Action myAction;\n            if (false)\n            {\n                myAction = () => { };\n            }\n            else\n            {\n                myAction = () => { Console.WriteLine(); };\n            }\n\n            if (condition)\n            {\n                return () => X();\n            }\n            else\n            {\n                return () => Y();\n            }\n\n            if (condition)\n            {\n                Task.Run(() => X());\n            }\n            else\n            {\n                Task.Run(() => Y());\n            }\n\n            if (condition)\n            {\n                Bar(s => true);\n            }\n            else\n            {\n                Bar(s => false);\n            }\n\n            // if one arg is lambda, ignore\n            if (condition)\n            {\n                Foo(1, \"2\", () => X());\n            }\n            else\n            {\n                Foo(1, \"2\", () => Y());\n            }\n\n            Action x;\n            if (action != null)\n            {\n                x = action;\n            }\n            else\n            {\n                x = () => Y();\n            }\n            return null;\n        }\n\n        void X() { }\n        void Y() { }\n        void Foo(int a, string b, Action c) { }\n        void Bar(Func<int, bool> func) { }\n    }\n\n    class X { }\n    class Y { }\n\n    class Base { }\n    class A : Base { }\n    class B : Base { }\n\n    class T\n    {\n        public static void XXX()\n        {\n            string name = \"foobar\";\n\n            if (name == \"\")\n            {\n                Bar(name, null);\n            }\n            else\n            {\n                Bar(name, true);\n            }\n\n            Bar(name, name == \"\" ? false : true);\n        }\n\n        private static void Bar(string name, bool? value) { }\n    }\n}\n\npublic class Repro_3468\n{\n    public int NestedTernary(bool condition1, bool condition2, int a, int b, int c)\n    {\n        if (condition1) // Compliant, changing this will lead to nested conditionals\n        {\n            return condition2 ? a : b;\n        }\n        else\n        {\n            return c;\n        }\n    }\n\n    public int NestedExpressionWithTernary(bool condition1, bool condition2, int a, int b, int c)\n    {\n        if (condition1) // Compliant, changing this will lead to nested conditionals\n        {\n            return 10 + (condition2 ? a : b);\n        }\n        else\n        {\n            return c;\n        }\n    }\n\n    public int NestedSwitch(bool condition1, bool condition2, int a, int b, int c)\n    {\n        if (condition1) // Compliant, changing this will lead to nested conditionals\n        {\n            return condition2 switch\n            {\n                true => a,\n                false => b\n            };\n        }\n        else\n        {\n            return c;\n        }\n    }\n\n    public int NestedExpressionWithSwitch(bool condition1, bool condition2, int a, int b, int c)\n    {\n        if (condition1) // Compliant, changing this will lead to nested conditionals\n        {\n            return 10 + condition2 switch\n            {\n                true => a,\n                false => b\n            };\n        }\n        else\n        {\n            return c;\n        }\n    }\n\n    public int? NestedNullCoalescing(bool condition, int? a, int b)\n    {\n        return condition ? b : a ?? b;\n    }\n\n    public int? NestedNullCoalescingAssignment(bool condition, int? a, int b)\n    {\n        return condition ? b : a ??= b;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ConditionalSimplification.FromCSharp8.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Tests.TestCases\n{\n    class ConditionalSimplification\n    {\n        object Identity(object o)\n        {\n            return o;\n        }\n        object IdentityAnyOtherMethod(object o)\n        {\n            return o;\n        }\n        int Test(object a, object b, object y, bool condition)\n        {\n            object x;\n\n            if (a != null) // Noncompliant {{Use the '??' operator here.}}\n//          ^^\n            {\n                /*some comment*/\n                x = a;\n            }\n            else\n            {\n                x = b/*some other comment*/;\n            }\n\n            x = a != null ? (a) : b;  // Noncompliant {{Use the '??' operator here.}}\n//              ^^^^^^^^^^^^^^^^^^^\n            x = a != null ? a : a;  // Compliant, triggers S2758\n\n            int i = 5;\n            var z = i == null ? 4 : i; //can't be converted\n\n            x = (y == null) ? Identity(new object()) : Identity(y);  // Noncompliant {{Use the '??' operator here.}}\n//              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n            a = a ?? b;                 // Noncompliant {{Use the '??=' operator here.}}\n//          ^^^^^^^^^^\n            a = a != null ? (a) : b;    // Noncompliant {{Use the '??=' operator here.}}\n//          ^^^^^^^^^^^^^^^^^^^^^^^\n            a = null == a ? b : (a);    // Noncompliant {{Use the '??=' operator here.}}\n            a = (a ?? b);               // Noncompliant {{Use the '??=' operator here.}}\n            a = ((a ?? b));             // Noncompliant {{Use the '??=' operator here.}}\n            a = ((null == a ? b : (a)));    // Noncompliant {{Use the '??=' operator here.}}\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n            x = a ?? b;\n            x = a ?? b;\n            x = y ?? new object();\n            x = condition ? a : b;\n\n            if (condition) // Noncompliant {{Use the '?:' operator here.}}\n            {\n                x = a;\n            }\n            else\n            {\n                x = b;\n            }\n\n            if ((a != null)) // Noncompliant {{Use the '??' operator here.}}\n            {\n                x = a;\n            }\n            else\n            {\n                x = b;\n            }\n\n            if (condition) // Noncompliant\n            {\n                x = Identity(new object());\n            }\n            else\n            {\n                x = IdentityAnyOtherMethod(y);\n            }\n\n            if (condition) // Noncompliant\n            {\n                Identity(new object());\n            }\n            else\n            {\n                Identity(y);\n            }\n\n            if (condition) // Noncompliant\n            {\n                return 1;\n            }\n            else\n            {\n                return 2;\n            }\n\n            if (condition)\n                return 1;\n            else if (condition) //Compliant\n                return 2;\n            else\n                return 3;\n\n            //This will be CodeFix-ed\n            if (a == null) // Noncompliant {{Use the '??=' operator here.}}\n            {\n                a = b;\n            }\n\n            if (a != null)\n            {\n                a = b;\n            }\n\n            bool? value = null;\n            if (value == null)  // Noncompliant {{Use the '??=' operator here.}}\n                value = false;  //This will be CodeFix-ed and this comment should be preserved\n\n            var yyy = new Y();\n            if (condition) //Noncompliant\n            {\n                x = Identity(new Y());\n            }\n            else\n            {\n                x = Identity(yyy);\n            }\n\n            if (condition) //Noncompliant\n            {\n                x = Identity(new Y());\n            }\n            else\n            {\n                x = Identity(new X());\n            }\n\n            // Removing space from \"if (\" on next line will fail the test.\n            // https://github.com/SonarSource/sonar-dotnet/issues/3064\n            if (yyy == null) // Noncompliant\n            {\n                Identity(new Y());\n            }\n            else\n            {\n                Identity(yyy);\n            }\n\n            if (((yyy == null))) // Noncompliant\n                Identity(new Y());\n            else\n                Identity(((yyy)));\n\n            if (condition) //Noncompliant\n                x = Identity(new Y());\n            else\n                x = Identity(yyy);\n\n            Base elem;\n            if (condition) // Noncompliant\n            {\n                elem = new A();\n            }\n            else\n            {\n                elem = null;\n            }\n            if (condition) // Non-compliant, but not handled because of the type difference\n            {\n                elem = new A();\n            }\n            else\n            {\n                elem = new NonExistentType(); // Error [CS0246]\n            }\n\n            if (condition) // Non-compliant, but not handled because of the type difference\n            {\n                elem = new NonExistentType(); // Error [CS0246]\n            }\n            else\n            {\n                elem = new A();\n            }\n\n            if (false) // Noncompliant\n            {\n                elem = null;\n            }\n            else\n            {\n                elem = (null);\n            }\n\n            if (condition)\n            {\n                Undefined(new object());    // Error [CS0103]: The name 'Undefined' does not exist in the current context\n            }\n            else\n            {\n                Undefined(y);               // Error [CS0103]: The name 'Undefined' does not exist in the current context\n            }\n\n            if (condition)\n            {\n                WithIntArg(42);\n            }\n            else\n            {\n                WithIntArg(new object());   // Error [CS1503]: Argument 1: cannot convert from 'object' to 'int'\n            }\n\n            if (condition)\n            {\n                Identity(new object());\n            }\n            else\n            {\n                x = null;\n            }\n        }\n\n        object WithIntArg(int arg) => null;\n\n        object IsNull1(object a, object b)\n        {\n            if (a == null)  // Noncompliant\n            {\n                return b;\n            }\n            else\n            {\n                return a;\n            }\n        }\n\n        object IsNull2(object a, object b)\n        {\n            if (a != null)  // Noncompliant\n            {\n                return a;\n            }\n            else\n            {\n                return b;\n            }\n        }\n\n        // we ignore lambdas because of type resolution for conditional expressions, see CS0173\n        Action LambdasAreIgnored(bool condition, object a, Action action)\n        {\n            Action myAction;\n            if (false)\n            {\n                myAction = () => { };\n            }\n            else\n            {\n                myAction = () => { Console.WriteLine(); };\n            }\n\n            if (condition)\n            {\n                return () => X();\n            }\n            else\n            {\n                return () => Y();\n            }\n\n            if (condition)\n            {\n                Task.Run(() => X());\n            }\n            else\n            {\n                Task.Run(() => Y());\n            }\n\n            if (condition)\n            {\n                Bar(s => true);\n            }\n            else\n            {\n                Bar(s => false);\n            }\n\n            // if one arg is lambda, ignore\n            if (condition)\n            {\n                Foo(1, \"2\", () => X());\n            }\n            else\n            {\n                Foo(1, \"2\", () => Y());\n            }\n\n            Action x;\n            if (action != null)\n            {\n                x = action;\n            }\n            else\n            {\n                x = () => Y();\n            }\n            return null;\n        }\n\n        void X() { }\n        void Y() { }\n        void Foo(int a, string b, Action c) { }\n        void Bar(Func<int, bool> func) { }\n    }\n\n    class X { }\n    class Y { }\n\n    class Base { }\n    class A : Base { }\n    class B : Base { }\n\n    class T\n    {\n        public static void XXX()\n        {\n            string name = \"foobar\";\n\n            if (name == \"\")\n            {\n                Bar(name, null);\n            }\n            else\n            {\n                Bar(name, true);\n            }\n\n            if (name == \"\") // Noncompliant\n            {\n                Bar(((name)), ((false)));\n            }\n            else\n            {\n                Bar(name, true);\n            }\n        }\n\n        private static void Bar(string name, bool? value) { }\n    }\n}\n\npublic class Repro_3468\n{\n    public int NestedTernary(bool condition1, bool condition2, int a, int b, int c)\n    {\n        if (condition1) // Compliant, changing this will lead to nested conditionals\n        {\n            return condition2 ? a : b;\n        }\n        else\n        {\n            return c;\n        }\n    }\n\n    public int NestedExpressionWithTernary(bool condition1, bool condition2, int a, int b, int c)\n    {\n        if (condition1) // Compliant, changing this will lead to nested conditionals\n        {\n            return 10 + (condition2 ? a : b);\n        }\n        else\n        {\n            return c;\n        }\n    }\n\n    public int NestedSwitch(bool condition1, bool condition2, int a, int b, int c)\n    {\n        if (condition1) // Compliant, changing this will lead to nested conditionals\n        {\n            return condition2 switch\n            {\n                true => a,\n                false => b\n            };\n        }\n        else\n        {\n            return c;\n        }\n    }\n\n    public int NestedExpressionWithSwitch(bool condition1, bool condition2, int a, int b, int c)\n    {\n        if (condition1) // Compliant, changing this will lead to nested conditionals\n        {\n            return 10 + condition2 switch\n            {\n                true => a,\n                false => b\n            };\n        }\n        else\n        {\n            return c;\n        }\n    }\n\n    public int? NestedNullCoalescing(bool condition, int? a, int b)\n    {\n        if (condition) // Noncompliant\n        {\n            return b;\n        }\n        else\n        {\n            return a ?? b;\n        }\n    }\n\n    public int? NestedNullCoalescingAssignment(bool condition, int? a, int b)\n    {\n        if (condition) // Noncompliant\n        {\n            return b;\n        }\n        else\n        {\n            return a ??= b;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ConditionalSimplification.FromCSharp9.Fixed.cs",
    "content": "﻿using System;\n\nApple a = null, b = null;\nint c = 42;\nbool condition = false;\n\na ??= b; // Fixed\na ??= b; // Fixed\n\nApple x;\nif (a is not null) // Compliant\n{\n    x = a;\n}\nelse\n{\n    x = c; // Error [CS0029]\n}\n\nx = a ?? b;\n\nx = a ?? b;\n\na ??= b;\n\na ??= Identity(new()); // Fixed\nb = Identity(a ?? new()); // Fixed\na ??= new(); // Fixed\na = a is not null ? Wrong(a, b) : Identity(new()); // Error [CS0103]\na = a is not null ? Identity(new()) : Wrong(a, b); // Error [CS0103]\na = a is not null ? Identity(a) : IdentityOther(a, b);\n\nvar p = a is null; // Fixed\nvar q = a is not null; // Fixed\nvar r = a is not null; // Fixed\nvar s = a is null; // Fixed\nif (a is null) // Fixed\n{\n}\n\nint v = 0;\nif (v is not 1)\n{\n    v = 1;\n}\n\nswitch (a)\n{\n    case not null:\n        break;\n    case null: // Fixed\n        break;\n}\n\nvar y = a switch\n{\n    not null => 1,\n    null => 0 // Fixed\n};\n\nFruit elem;\nelem = condition ? new Apple() : new Orange();\n\nApple Identity(Apple o) => o;\nApple IdentityOther(Apple first, Apple second) => second;\n\n// we ignore lambdas because of type resolution for conditional expressions, see CS0173\nAction<int, int> LambdasAreIgnored(bool condition)\n{\n    Action<int, int> myAction;\n    if (condition)\n    {\n        myAction = static (int i, int j) => { };\n    }\n    else\n    {\n        myAction = static (_, _) => { Console.WriteLine(); };\n    }\n    return myAction;\n}\n\nint NestedExpressionWithSwitch(bool condition, int a, int b)\n{\n    if (condition) // Compliant, changing this will lead to nested conditionals\n    {\n        return a switch\n        {\n            > 10 => 1,\n            < 10 => 2,\n            10 => 3\n        };\n    }\n    else\n    {\n        return b;\n    }\n}\n\nabstract class Fruit { }\nclass Apple : Fruit { }\nclass Orange : Fruit { }\n\n// https://sonarsource.atlassian.net/browse/NET-3554\npublic class Repro_NET3554\n{\n    class Result<T>\n    {\n        public static implicit operator Result<T>(T value) => new Result<T>();\n        public static implicit operator Result<T>(string error) => new Result<T>();\n        private Result() { }\n    }\n\n    Result<T> Method<T>(T value) where T : class\n    {\n        // Proposed fix is giving \"CS0019: Operator '??' cannot be applied to operands of type 'T' and 'string'\"\n        return value ?? \"Value is null\"; // Fixed\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ConditionalSimplification.FromCSharp9.cs",
    "content": "﻿using System;\n\nApple a = null, b = null;\nint c = 42;\nbool condition = false;\n\na = a is not null ? (a) : b; // Noncompliant a ??= b;\na = a is null ? (b) : a; // Noncompliant a ??= b;\n\nApple x;\nif (a is not null) // Compliant\n{\n    x = a;\n}\nelse\n{\n    x = c; // Error [CS0029]\n}\n\nif (a is not null) // Noncompliant {{Use the '??' operator here.}}\n{\n    x = a;\n}\nelse\n{\n    x = b;\n}\n\nif (a is (not null)) // Noncompliant {{Use the '??' operator here.}}\n{\n    x = a;\n}\nelse\n{\n    x = b;\n}\n\nif (a is null) // Noncompliant {{Use the '??=' operator here.}}\n{\n    a = b;\n}\n\na = (a is not null) ? a : Identity(new()); // Noncompliant {{Use the '??=' operator here.}}\nb = (a is not null) ? Identity(a) : Identity(new()); // Noncompliant {{Use the '??' operator here.}}\na = a ?? new(); // Noncompliant {{Use the '??=' operator here.}}\na = a is not null ? Wrong(a, b) : Identity(new()); // Error [CS0103]\na = a is not null ? Identity(new()) : Wrong(a, b); // Error [CS0103]\na = a is not null ? Identity(a) : IdentityOther(a, b);\n\nvar p = a is not not null; // Noncompliant {{Simplify negation here.}}\n//           ^^^^^^^^^^^^\nvar q = a is not not not null; // Noncompliant {{Simplify negation here.}}\n//           ^^^^^^^^^^^^^^^^\nvar r = a is not not not not not null; // Noncompliant {{Simplify negation here.}}\nvar s = a is not not not not not not null; // Noncompliant {{Simplify negation here.}}\nif (a is not not null) // Noncompliant {{Simplify negation here.}}\n//       ^^^^^^^^^^^^\n{\n}\n\nint v = 0;\nif (v is not 1)\n{\n    v = 1;\n}\n\nswitch (a)\n{\n    case not null:\n        break;\n    case not not null: // Noncompliant {{Simplify negation here.}}\n//       ^^^^^^^^^^^^\n        break;\n}\n\nvar y = a switch\n{\n    not null => 1,\n    not not null => 0 // Noncompliant {{Simplify negation here.}}\n//  ^^^^^^^^^^^^\n};\n\nFruit elem;\nif (condition) // Noncompliant {{Use the '?:' operator here.}}\n{\n    elem = new Apple();\n}\nelse\n{\n    elem = new Orange();\n}\n\nApple Identity(Apple o) => o;\nApple IdentityOther(Apple first, Apple second) => second;\n\n// we ignore lambdas because of type resolution for conditional expressions, see CS0173\nAction<int, int> LambdasAreIgnored(bool condition)\n{\n    Action<int, int> myAction;\n    if (condition)\n    {\n        myAction = static (int i, int j) => { };\n    }\n    else\n    {\n        myAction = static (_, _) => { Console.WriteLine(); };\n    }\n    return myAction;\n}\n\nint NestedExpressionWithSwitch(bool condition, int a, int b)\n{\n    if (condition) // Compliant, changing this will lead to nested conditionals\n    {\n        return a switch\n        {\n            > 10 => 1,\n            < 10 => 2,\n            10 => 3\n        };\n    }\n    else\n    {\n        return b;\n    }\n}\n\nabstract class Fruit { }\nclass Apple : Fruit { }\nclass Orange : Fruit { }\n\n// https://sonarsource.atlassian.net/browse/NET-3554\npublic class Repro_NET3554\n{\n    class Result<T>\n    {\n        public static implicit operator Result<T>(T value) => new Result<T>();\n        public static implicit operator Result<T>(string error) => new Result<T>();\n        private Result() { }\n    }\n\n    Result<T> Method<T>(T value) where T : class\n    {\n        // Proposed fix is giving \"CS0019: Operator '??' cannot be applied to operands of type 'T' and 'string'\"\n        return value == null ? \"Value is null\" : value; // Noncompliant FP - implicit conversion to Result<T> makes the ternary valid, but ?? cannot be applied to 'T' and 'string'\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ConditionalStructureSameCondition.CSharp10.cs",
    "content": "﻿using System.Collections.Generic;\n\nabstract class SomeClass\n{\n    public List<int> SomeField;\n\n    public void Somemethod()\n    {\n        SomeClass f = null;\n\n        if (f is { SomeField.Count: 42 }) // Secondary [flow1]\n        {\n        }\n        else if (f is { SomeField.Count: 42 }) // Noncompliant [flow1]\n        {\n        }\n\n        if (f is { SomeField.Count: 16 })\n        {\n        }\n        else if (f is { SomeField.Count: 23 })\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ConditionalStructureSameCondition.CSharp9.cs",
    "content": "﻿using System.Collections.Generic;\n\nobject o;\nint i;\n\nvoid SimpleTest()\n{\n    if (o is not null) // Secondary [flow1]\n//      ^^^^^^^^^^^^^\n    {\n        // foo\n    }\n    else if (o is not null) // Noncompliant [flow1] {{This branch duplicates the one on line 8.}}\n    {\n        var x = 1;\n    }\n}\n\nvoid Test(Apple a, Orange b, bool cond)\n{\n    if (i is > 0 and < 100) // Secondary [flow2,flow3]\n    {\n\n    }\n    else if (i is > 0 and < 100) // Noncompliant [flow2]\n    {\n\n    }\n    else if (i is < 0 or > 100) // Secondary [flow4]\n    {\n\n    }\n    else if (i is > 0 and < 100) // Noncompliant [flow3]\n    {\n\n    }\n    else if (i is < 0 or > 100) // Noncompliant [flow4]\n    {\n\n    }\n\n    Fruit f;\n    if ((f = cond ? a : b) is Orange) // Secondary [flow5]\n    {\n    }\n    else if ((f = cond ? a : b) is Orange) // Noncompliant [flow5]\n    {\n    }\n\n    if (f is { Sweetness: 42 }) // Secondary [flow6]\n    {\n    }\n    else if (f is { Sweetness: 42 }) // Noncompliant [flow6]\n    {\n    }\n\n    if (f is { Checks: { Count: 42 } }) // Secondary [flow7]\n    {\n    }\n    else if (f is { Checks: { Count: 42 } }) // Noncompliant [flow7]\n    {\n    }\n}\n\nvoid AnotherTest(object o)\n{\n    if (o is not null) { }  // Secondary\n    else if (o != null) { } // Noncompliant\n\n    if (o is null) { }      // Secondary\n    else if (o == null) { } // Noncompliant\n}\n\nabstract class Fruit\n{\n    public int Sweetness;\n    public List<int> Checks;\n}\nclass Apple : Fruit { }\nclass Orange : Fruit { }\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ConditionalStructureSameCondition.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Tests.TestCases\n{\n    class ConditionalStructureSameCondition1\n    {\n        public bool condition { get; set; }\n        public bool condition1 { get; set; }\n        public bool condition2 { get; set; }\n\n        public void SimpleTest()\n        {\n            var b = true;\n            if (b && condition)\n//              ^^^^^^^^^^^^^^ Secondary\n            {\n\n            }\n            else if (b && condition) // Noncompliant {{This branch duplicates the one on line 18.}}\n//                   ^^^^^^^^^^^^^^\n            {\n\n            }\n        }\n\n        public void Test()\n        {\n            var b = true;\n            if (b && condition)\n//              ^^^^^^^^^^^^^^ Secondary\n//              ^^^^^^^^^^^^^^ Secondary@-1\n//              ^^^^^^^^^^^^^^ Secondary@-2\n            {\n\n            }\n            else if (b && condition) // Noncompliant {{This branch duplicates the one on line 33.}}\n//                   ^^^^^^^^^^^^^^\n            {\n\n            }\n            else if (b && condition) // Noncompliant\n            {\n\n            }\n            else if (!b && condition)\n//                   ^^^^^^^^^^^^^^^ Secondary\n            {\n\n            }\n            else if (b && /*some comment*/ condition) // Noncompliant\n            {\n\n            }\n            else if (!b && condition) // Noncompliant\n            {\n\n            }\n\n            if (condition1)\n//              ^^^^^^^^^^ Secondary\n            {\n            }\n            else if (condition1) // Noncompliant\n            {\n            }\n\n            if (condition2)\n            {\n            }\n            else if (condition1)\n//                   ^^^^^^^^^^ Secondary\n            {\n            }\n            else if (condition1) // Noncompliant\n            {\n            }\n\n            if (condition1)\n//              ^^^^^^^^^^ Secondary\n            {\n            }\n            else if (condition2)\n            {\n            }\n            else if (condition1) // Noncompliant\n            {\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ConditionalStructureSameCondition.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.Linq\nImports System.Text\nImports System.Threading.Tasks\n\nNamespace Tests.TestCases\n    Class ConditionalStructureSameCondition1\n        Public Property condition As Boolean\n            Get\n\n            End Get\n            Set(value As Boolean)\n\n            End Set\n        End Property\n        Public Sub Test()\n            Dim b = True\n\n            If b Then Exit Sub Else Exit Sub\n\n            If (b AndAlso condition) Then\n                ' empty\n            ElseIf b AndAlso condition Then ' Noncompliant {{This branch duplicates the one on line 22.}}\n                ' empty\n            ElseIf b AndAlso condition Then ' Noncompliant\n                ' empty\n            ElseIf Not b AndAlso condition Then\n                ' empty\n                ' Noncompliant@+1\n            ElseIf b AndAlso condition _\n                Then\n                ' empty\n                ' Noncompliant@+1\n            ElseIf Not b AndAlso _\n                condition Then\n                ' empty\n            End If\n        End Sub\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ConditionalStructureSameImplementation_If.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace CSharp14\n{\n    class FieldKeyword\n    {\n        public int Name\n        {\n            get\n            {\n                if(field is 1)\n                {                       // Secondary\n                    field = field + 1;\n                }\n                else if(field is 20)\n                {                       // Noncompliant\n                    field = field + 1;  // Secondary@-1\n                }\n                else if (field is 50)\n                {                       // Noncompliant\n                    field = field + 1;\n                }\n                else if(field is 42)    // Compliant\n                {\n                    field = 42;\n                }\n                return field;\n            }\n            set { }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ConditionalStructureSameImplementation_If.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Tests.TestCases\n{\n    class ConditionalStructureSameCondition_If\n    {\n        public bool someCondition1 { get; set; }\n        public bool someCondition2 { get; set; }\n        public bool someCondition3 { get; set; }\n\n        public void DoSomething1() { }\n        public void DoSomething2() { }\n\n        public void Test_SingleLineBlocks()\n        {\n            if (someCondition1)\n            {\n                DoSomething1(); // Compliant, ignore single line blocks\n            }\n            else\n            {\n                DoSomething1();\n            }\n\n            if (someCondition1)\n                DoSomething1(); // Compliant, ignore single line blocks\n            else\n                DoSomething1();\n        }\n\n        public void Test_MultilineBlocks()\n        {\n            if (someCondition1)\n            { // Secondary\n                DoSomething1();\n                DoSomething1();\n            }\n            else\n            { // Noncompliant\n                DoSomething1();\n                DoSomething1();\n            }\n\n            if (someCondition1)\n            { // Secondary\n                // Secondary@-1\n                DoSomething1();\n                DoSomething1();\n            }\n            else if (someCondition2)\n            { // Noncompliant\n                DoSomething1();\n                DoSomething1();\n            }\n            else if (someCondition3)\n            {\n                DoSomething2();\n            }\n            else\n            { // Noncompliant\n                DoSomething1();\n                DoSomething1();\n            }\n\n            if (someCondition1)\n            { // Secondary\n                // Secondary@-1\n                DoSomething1();\n                DoSomething1();\n            }\n            else if (someCondition2)\n            { // Noncompliant\n                DoSomething1();\n                DoSomething1();\n            }\n            else\n            {// Noncompliant\n                DoSomething1();\n                DoSomething1();\n            }\n        }\n\n        public void Test_Overloads()\n        {\n            int foo = 0;\n            if (someCondition1)\n            {\n                foo++;\n                foo = foo.FooInt(); // FN\n            }\n            else\n            {\n                foo++;\n                foo = IntExtension.FooInt(foo);\n            }\n        }\n\n        // https://github.com/SonarSource/sonar-dotnet/issues/1255\n        public void ExceptionOfException(int a)\n        {\n            if (a == 1)\n            { // Secondary [Exception]\n                DoSomething1();\n            }\n            else if (a == 2)\n            { // Noncompliant [Exception]\n                DoSomething1();\n            }\n        }\n\n        public void Exception(int a)\n        {\n            if (a >= 0 && a < 10)\n            {\n                DoSomething1();\n            }\n            else if (a >= 10 && a < 20)\n            {\n                DoSomething2();\n            }\n            else if (a >= 20 && a < 50)\n            {\n                DoSomething1();\n            }\n        }\n\n        public bool ElseIfChain(int s)\n        {\n            if (s == 0)\n            { // Secondary [IfChain1]\n                DoSomething1();\n                return true;\n            }\n            else if (s > 0 && s < 11)\n            { // Noncompliant [IfChain1]\n                DoSomething1();\n                return true;\n            }\n            else if (s > 11 && s < 20)\n            {\n                DoSomething2();\n                return true;\n            }\n\n            if (s == 0)\n            { // Secondary [IfChain2]\n                DoSomething1();\n            }\n            else if (s > 0 && s < 11)\n            { // Noncompliant [IfChain2]\n                // Secondary@-1 [IfChain3]\n                DoSomething1();\n            }\n            else if (s > 11 && s < 20)\n            { // Noncompliant [IfChain3]\n                DoSomething1();\n            }\n\n            if (s == 0)\n            {   // Compliant\n                DoSomething1();\n            }\n            else\n            {\n                if (s > 0 && s < 11)\n                {   // Compliant\n                    DoSomething1();\n                }\n                else\n                {\n                    if (s > 11 && s < 20)\n                    {   // Compliant\n                        DoSomething1();\n                    }\n                    else\n                    {\n                        DoSomething2();\n                    }\n                }\n            }\n\n            if (s == 0)\n            {   // Secondary [NestedIfChain]\n                // Secondary@-1 [NestedIfChain2]\n                DoSomething1();\n                DoSomething1();\n            }\n            else\n            {\n                if (s > 0 && s < 11)\n                {   // Noncompliant [NestedIfChain]\n                    DoSomething1();\n                    DoSomething1();\n\n                }\n                else\n                {\n                    if (s > 11 && s < 20)\n                    {// Noncompliant [NestedIfChain2]\n\n                        DoSomething1();\n                        DoSomething1();\n                    }\n                }\n            }\n\n            if (s == 0)\n            {   // Compliant as the DoSomething2() call breaks the conditional chain\n                DoSomething1();\n                DoSomething1();\n            }\n            else\n            {\n                DoSomething2();\n                if (s > 0 && s < 11)\n                {   // Compliant\n                    DoSomething1();\n                    DoSomething1();\n                }\n            }\n                return false;\n        }\n    }\n\n    public static class IntExtension\n    {\n        public static int FooInt(this int a) => 0;\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/9637\npublic class UnresolvedSymbols\n{\n    public string Method(string first, string second)\n    {\n        if (first.Length == 42)\n        {\n            var ret = UnknownMethod();  // Error [CS0103]\n            return ret;\n        }\n        else if (second.Length == 42)\n        {\n            var ret = UnknownMethod();  // Error [CS0103]\n            return ret;\n        }\n        return \"\";\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ConditionalStructureSameImplementation_If.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.Linq\nImports System.Text\nImports System.Threading.Tasks\n\nNamespace Tests.TestCases\n    Class ConditionalStructureSameCondition_If\n        Function Test(someCondition1 As Boolean, someCondition2 As Boolean) As Object\n            If (someCondition1) Then\n                DoSomething1()\n            Else\n                DoSomething1() ' Compliant, single line implementation is ignored\n            End If\n\n            If someCondition1 Then DoSomething1() Else DoSomething1() ' Noncompliant\n'                                                      ^^^^^^^^^^^^^^\n            If someCondition1 Then DoSomething1() Else DoSomething2() : DoSomething1()\n\n            If (someCondition1) Then\n                DoSomething1()\n                DoSomething1()\n            ElseIf (someCondition2) Then\n                DoSomething1()\n                DoSomething2()\n            ElseIf (someCondition2) Then\n                DoSomething1() ' Noncompliant {{Either merge this branch with the identical one on line 24 or change one of the implementations.}}\n                DoSomething2()\n            ElseIf (someCondition2) Then\n                DoSomething1() ' Noncompliant {{Either merge this branch with the identical one on line 24 or change one of the implementations.}}\n                DoSomething2()\n            Else\n                DoSomething1() ' Noncompliant {{Either merge this branch with the identical one on line 21 or change one of the implementations.}}\n                DoSomething1()\n            End If\n\n            If (someCondition1) Then\n                DoSomething1()\n            ElseIf (someCondition2) Then\n                DoSomething1() ' Compliant, single line\n            Else\n                DoSomething1() ' Compliant, single line\n            End If\n\n            If (someCondition1) Then\n                DoSomething2()\n                Return DoSomething1()\n            ElseIf (someCondition2) Then\n                DoSomething2()\n                Return DoSomething1() ' Compliant, single line\n            Else\n                DoSomething2()\n                Return DoSomething1() ' Compliant, single line\n            End If\n        End Function\n\n        Private Function DoSomething1\n            Return Nothing\n        End Function\n\n        Private Function DoSomething2\n            Return Nothing\n        End Function\n\n        Public Sub ExceptionOfException(a As Integer)\n            If a = 1 Then\n                DoSomething1()\n            ElseIf a = 2 Then\n                DoSomething1() ' Noncompliant\n            End If\n        End Sub\n\n        Public Sub Exception(a As Integer)\n            If a >= 0 AndAlso a < 10 Then\n                DoSomething1()\n            ElseIf a >= 10 AndAlso a < 20 Then\n                DoSomething2()\n            ElseIf a >= 20 AndAlso a < 50 ' Compliant\n                DoSomething1()\n            End If\n        End Sub\n    End Class\nEnd Namespace\n\n' https://github.com/SonarSource/sonar-dotnet/issues/9637\nPublic Class UnresolvedSymbols\n    Public Function Method(first As String, second As String)\n        If first.Length = 42 Then\n            Dim ret = UnknownMethod()   ' Error [BC30451]\n            Return ret\n        ElseIf second.Length = 42 Then  ' Noncompliant@+1\n            Dim ret = UnknownMethod()   ' Error [BC30451]\n            Return ret\n        End If\n        Return \"\"\n    End Function\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ConditionalStructureSameImplementation_Switch.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Tests.TestCases\n{\n    class ConditionalStructureSameCondition_Switch\n    {\n        public int SwitchExpression(int a)\n        {\n            return a switch\n            {\n                10 => a * 2,\n                20 => a * 2,\n                50 => a * 2,\n            };\n        }\n\n    }\n}\n\nnamespace CShar14\n{\n    class FieldKeyword\n    {\n        public int Name\n        {\n            get\n            {\n                switch (field)\n                {\n                    case 1:                 // Secondary\n                        field = field + 1;\n                        break;\n                    case 20:                // Noncompliant\n                                            // Secondary@-1\n                        field = field + 1;\n                        break;\n                    case 50:                // Noncompliant\n                        field = field + 1;\n                        break;\n                    case 42:                // Compliant\n                        field = 42;\n                        break;\n                }\n                return field;\n            }\n            set { }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ConditionalStructureSameImplementation_Switch.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Tests.TestCases\n{\n    class ConditionalStructureSameCondition_Switch\n    {\n        public int prop { get; set; }\n        private void doTheRest() { throw new NotSupportedException(); }\n        private void DoSomething() { throw new NotSupportedException(); }\n        private void DoSomething(int i) { throw new NotSupportedException(); }\n        private void DoSomethingDifferent() { throw new NotSupportedException(); }\n        private void DoSomething2() { throw new NotSupportedException(); }\n\n        public void Test_SingleLine()\n        {\n            var i = 5;\n            switch (i)\n            {\n                case 1:\n                    DoSomething(prop);\n                    break;\n                case 2:\n                    DoSomethingDifferent();\n                    break;\n                case 3:\n                    DoSomething(prop);\n                    break;\n                case 4:\n                    {\n                        DoSomething2();\n                    }\n                    break;\n                case 5:\n                    {\n                        DoSomething2();\n                        break;\n                    }\n\n                default:\n                    DoSomething(prop);\n                    break;\n            }\n\n            switch (i)\n            {\n                case 1:\n                case 3:\n                    DoSomething();\n                    break;\n                case 2:\n                    DoSomethingDifferent();\n                    break;\n                default:\n                    doTheRest();\n                    break;\n            }\n        }\n\n        public void Test_Multiline()\n        {\n            var i = 5;\n            switch (i)\n            {\n                case 1: // Secondary\n                    // Secondary@-1\n                    DoSomething(prop);\n                    DoSomething(prop);\n                    break;\n                case 2:\n                    DoSomethingDifferent();\n                    break;\n                case 3:  // Noncompliant\n                    DoSomething(prop);\n                    DoSomething(prop);\n                    break;\n                case 4: // Secondary\n                    {\n                        DoSomething2();\n                        DoSomething2();\n\n                        break;\n                    }\n                case 5: // Noncompliant\n                    {\n                        DoSomething2();\n                        DoSomething2();\n\n                        break;\n                    }\n                case 6: // Secondary;\n                    {\n                        DoSomething2();\n                    }\n                    {\n                        DoSomething2();\n                    }\n                    break;\n\n                case 7: // Noncompliant\n                    {\n                        DoSomething2();\n                    }\n                    {\n                        DoSomething2();\n                    }\n                    break;\n\n                default: // Noncompliant\n                    DoSomething(prop);\n                    DoSomething(prop);\n                    break;\n            }\n\n            int k = 0;\n            switch (i)\n            {\n                case 1:\n                case 3:\n                    DoSomething();\n                    DoSomething();\n                    break;\n                case 2:\n                    DoSomethingDifferent();\n                    DoSomethingDifferent();\n                    break;\n                case 4:\n                    k++;\n                    DoSomething();\n                    DoSomethingDifferent();\n                    break;\n                case 5:\n                    k++;\n                    DoSomethingDifferent();\n                    DoSomething();\n                    break;\n                default:\n                    doTheRest();\n                    doTheRest();\n                    break;\n            }\n        }\n\n        public int SwitchDifferentBranchDifferentOverloads(object o)\n        {\n            int result = 1;\n            switch (o)\n            {\n                case float a: // Compliant\n                    result++;\n                    result = ValueConverter.ToInt32(a);\n                    break;\n                case bool a: // Compliant - ValueConverter.ToInt32 is an overload.\n                    result++;\n                    result = ValueConverter.ToInt32(a);\n                    break;\n                case int a: // // Secondary\n                    result++;\n                    result = ValueConverter.ToInt32(true);\n                    break;\n                case double a: // Noncompliant\n                    result++;\n                    result = ValueConverter.ToInt32(true);\n                    break;\n                case string a:\n                    var flag = true;\n                    result++;\n                    result = ValueConverter.ToInt32(flag);\n                    break;\n                default:\n                    throw new InvalidOperationException(\"Unsupported array type\");\n            }\n            return result;\n        }\n\n        public static class ValueConverter\n        {\n            public static int ToInt32(float f) => 0;\n            public static int ToInt32(bool b) => 0;\n        }\n\n        public int SwitchDifferentSameAction(object o)\n        {\n            int result = 1;\n            Action action = () => { };\n            switch (o)\n            {\n                case float a: // Secondary\n                    result++;\n                    action();\n                    break;\n                case bool a: // Noncompliant\n                    result++;\n                    action();\n                    break;\n                case int a:\n                    result++;\n                    action.Invoke(); // FN - it's the same actions but invoked in a different way.\n                    break;\n                default:\n                    throw new InvalidOperationException(\"Unsupported array type\");\n            }\n            return result;\n        }\n\n        public int SwitchDifferentSameExtensionMethod(object o)\n        {\n            int result = 1;\n            switch (o)\n            {\n                case float a:\n                    result++;\n                    result = result.FooInt(\"\"); // FN - it's the same method with the same input invoked in different ways.\n                    break;\n                case bool a:\n                    result++;\n                    result = IntExtension.FooInt(result, \"\");\n                    break;\n                default:\n                    throw new InvalidOperationException(\"Unsupported array type\");\n            }\n            return result;\n        }\n\n        public void ExceptionOfException(int a)\n        {\n            switch (a)\n            {\n                case 1:  // Secondary [Exception]\n                    DoSomething();\n                    break;\n                case 2: // Noncompliant [Exception]\n                    DoSomething();\n                    break;\n            }\n\n            switch (a)\n            {\n                case 1:\n                    DoSomething();\n                    break;\n                case 2:\n                    DoSomething();\n                    break;\n                default:\n                    DoSomething();\n                    break;\n            }\n        }\n\n        public void Exception(int a)\n        {\n            switch (a)\n            {\n                case 10:\n                    DoSomething();\n                    break;\n                case 20:\n                    DoSomething2();\n                    break;\n                case 50:\n                    DoSomething();\n                    break;\n            }\n\n            switch (a)\n            {\n                case 10:\n                    DoSomething();\n                    break;\n                case 20:\n                    DoSomething2();\n                    break;\n                case 50:\n                    DoSomething();\n                    break;\n                default:\n                    DoSomething2();\n                    break;\n            }\n        }\n\n    }\n\n    public static class IntExtension\n    {\n        public static int FooInt(this int a, string s) => 0;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ConditionalStructureSameImplementation_Switch.vb",
    "content": "﻿Namespace Tests.TestCases\n\n    Class ConditionalStructureSameCondition_Switch\n        Public Sub Test(i As Integer, prop As Object)\n\n            Select Case (i)\n\n                Case 1\n                    doSomething(prop)\n                Case 2\n                    doSomethingDifferent()\n                Case 3\n                    doSomething(prop) ' Compliant, single line\n                Case 4\n                    doSomething2()\n                    doSomething2()\n\n\n                Case 5\n\n                    'some comment here and there\n                    doSomething2() ' Noncompliant {{Either merge this case with the identical one on line 15 or change one of the implementations.}}\n                    doSomething2()\n\n                Case Else\n                    doSomething(prop) ' Compliant, single line\n\n            End Select\n        End Sub\n\n        Private Function doSomething(data As Object)\n            Return Nothing\n        End Function\n        Private Function doSomethingDifferent()\n            Return Nothing\n        End Function\n        Private Function doSomething2()\n            Return Nothing\n        End Function\n\n        Private Function ExceptionOfException(a As Integer)\n            Select Case a\n                Case 1\n                    doSomething2()\n                Case 2\n                    doSomething2() ' Noncompliant\n            End Select\n        End Function\n\n        Public Sub Exception(a As Integer)\n            Select Case True\n                Case a >= 0 AndAlso a < 10\n                    doSomething2()\n                Case a >= 10 AndAlso a < 20\n                    doSomethingDifferent()\n                Case a >= 20 AndAlso a < 50\n                    doSomething2()\n            End Select\n        End Sub\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ConditionalsShouldStartOnNewLine.Latest.cs",
    "content": "﻿using System;\n\nclass NullConditionalAssignmnet\n{\n    class MyClass\n    {\n        public bool Valid { get; set; }\n    }\n\n    public void TestMethod()\n    {\n        var obj = new MyClass();\n\n        if(true)\n        {\n        } obj?.Valid = true;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ConditionalsShouldStartOnNewLine.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        void Foo()\n        {\n            if (true)\n            {\n            } if (true)\n//            ^^ Noncompliant {{Move this 'if' to a new line or add the missing 'else'.}}\n//          ^ Secondary@-1\n            {\n            }\n\n\n            if (true)\n            {\n                // ...\n            }\n            else if (true)\n            {\n                //...\n            }\n\n            if (true)\n            {\n                // ...\n            }\n\n            if (true)\n            {\n                //...\n            }\n\n            Action a = () => { };\n            {} a(); if (true) { }\n\n            /*}*/  if (true)\n            {\n            } /* else */ if (true) { } // Noncompliant\n// Secondary@-1\n\n            else { } { if (true)\n                {\n\n                }\n            }\n\n\n            if (true) {\n            } else if (true) {\n            }\n\n            if (true)\n            {\n            }\n            if (true)\n            {\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ConditionalsWithSameCondition.CSharp10.cs",
    "content": "﻿using System.Collections.Generic;\n\nclass ConditionalsWithSameCondition\n{\n    public void Foo()\n    {\n        Fruit f = null;\n\n        if (f is { Property.Count: >= 5 }) { }\n        if (f is { Property.Count: >= 5 }) { } // Noncompliant\n    }\n}\n\nclass Fruit\n{\n    public List<int> Property { get; }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ConditionalsWithSameCondition.CSharp9.TopLevelStatements.cs",
    "content": "﻿using System;\n\nint a = 0, b = 1;\n\nif (a == b) { Foo(); }\nif (a == b) { Bar(); } // Noncompliant\n\nif (args[0] == args[1])\n{\n    Foo();\n}\n\nif (args[0] == args[1]) // Noncompliant\n{\n    Bar();\n}\n\nvoid Foo() { }\nvoid Bar() { }\n\nswitch (b)\n{\n    case > 2:\n        break;\n}\nswitch (b) // Noncompliant\n{\n    case > 2:\n        break;\n}\n\nstring c = null;\nif (c is null)\n{\n    DoTheThing(c);\n}\nif (c is null) // Noncompliant {{This condition was just checked on line 33.}}\n{\n    DoTheThing(c);\n}\nif (c is not null) // Compliant\n{\n    DoTheThing(c);\n}\n\nif (c is \"banana\") // Compliant, c might be updated in the previous if\n{\n    c += \"a\";\n}\nif (c is \"banana\") // Compliant, c might be updated in the previous if\n{\n    c = \"\";\n}\nif (c is \"banana\") // Compliant, c might be updated in the previous if\n{\n    c = \"\";\n}\n\nint i = 0;\nif (i is > 0 and < 100)\n{\n    DoTheThing(i);\n}\nif (i is > 0 and < 100) // Noncompliant {{This condition was just checked on line 60.}}\n{\n    DoTheThing(i);\n}\n\nFruit f = null;\nbool cond = false;\nif (f is Apple)\n{\n    f = cond ? new Apple() : new Orange();\n}\nif (f is Apple) // Compliant as f may change\n{\n    f = cond ? new Apple() : new Orange();\n}\n\nif (f is null) { }\nif (f is null) { }  // Noncompliant\n\nchar ch = 'x';\nif (ch is >= 'a' and <= 'z') { }\nif (ch is >= 'a' and <= 'z') { } // Noncompliant\nif (ch is <= 'z' and >= 'a') { } // FN, rule is syntax based. Only null check equivalence is currenty supported in CSharpEquivalenceChecker\n\nif (ch is (>= 'a' and <= 'z') or (>= 'A' and <= 'Z') or '.' or '?') { }\nif (ch is (>= 'a' and <= 'z') or (>= 'A' and <= 'Z') or '.' or '?') { } // Noncompliant\nif (ch is (>= 'a' and <= 'z') or (>= 'A' and <= 'Z') or '?' or '.') { } // FN, rule is syntax based. Only null check equivalence is currenty supported in CSharpEquivalenceChecker\nif (ch is (>= 'A' and <= 'Z') or (>= 'a' and <= 'z') or '?' or '.') { } // FN, rule is syntax based. Only null check equivalence is currenty supported in CSharpEquivalenceChecker\n\nif (f is not null) { }\nif (f is not not not null) { }  // Noncompliant, same meaning\nif (f != null) { }              // Noncompliant, same meaning\n\nif (f is null) { }\nif (f == null) { }          // Noncompliant, same meaning\nif (!(f is not null)) { }   // Noncompliant, same meaning\n\nif (!(f is null)) { }\nif (f != null) { }          // Noncompliant, same meaning\nif (f is not not null) { }  // Compliant, equal to f == null\n\nif (f is Apple) { }\nif (f is Apple) { }   // Noncompliant\n\nif (f is Apple or Orange) { }\nif (f is Apple or Orange) { }   // Noncompliant\nif (f is Orange or Apple) { }   // FN, rule is syntax based. Only null check equivalence is currenty supported in CSharpEquivalenceChecker\n\nif (f is not Apple) { }\nif (f is not Apple) { } // Noncompliant\n\nif (f is { Size: >= 5, Value: 0 }) { }\nif (f is { Size: >= 5, Value: 0 }) { } // Noncompliant\nif (f is { Value: 0, Size: >= 5 }) { } // FN, rule is syntax based. Only null check equivalence is currenty supported in CSharpEquivalenceChecker\n\nif (f is { Size: >= 5 }) { }\nif (f is not { Size: < 5 }) { } // FN, rule is syntax based. Only null check equivalence is currenty supported in CSharpEquivalenceChecker\n\nvoid DoTheThing(object o) { }\n\nvoid PositionalPattern(Apple a)\n{\n    if (a is (\"Sweet\", \"Red\"))\n    {\n    }\n    if (a is (\"Sweet\", \"Red\")) // Noncompliant\n    {\n    }\n    if (a is { Taste: \"Sweet\", Color: \"Red\" }) // FN, rule is syntax based. Only null check equivalence is currenty supported in CSharpEquivalenceChecker\n    {\n    }\n}\nabstract class Fruit\n{\n    public int Size { get; }\n    public int Value { get; }\n}\n\nclass Apple : Fruit\n{\n    public string Taste;\n    public string Color;\n    public void Deconstruct(out string x, out string y) => (x, y) = (Taste, Color);\n\n    void FunctionInClassAndTopLevelStatement(Apple a)\n    {\n        if (a is (\"Sweet\", \"Red\"))\n        {\n        }\n        if (a is (\"Sweet\", \"Red\")) // Noncompliant\n        {\n        }\n    }\n}\n\nclass Orange : Fruit { }\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ConditionalsWithSameCondition.CSharp9.cs",
    "content": "﻿class ConditionalsWithSameCondition\n{\n    public void Foo()\n    {\n        string c = null;\n        if (c is null)\n        {\n            doTheThing(c);\n        }\n        if (c is null) // Noncompliant {{This condition was just checked on line 6.}}\n        {\n            doTheThing(c);\n        }\n        if (c is not null) // Compliant\n        {\n            doTheThing(c);\n        }\n\n        if (c is \"banana\") // Compliant, c might be updated in the previous if\n        {\n            c += \"a\";\n        }\n        if (c is \"banana\") // Compliant, c might be updated in the previous if\n        {\n            c = \"\";\n        }\n        if (c is \"banana\") // Compliant, c might be updated in the previous if\n        {\n            c = \"\";\n        }\n\n        int i = 0;\n        if (i is > 0 and < 100)\n        {\n            doTheThing(i);\n        }\n        if (i is > 0 and < 100) // Noncompliant {{This condition was just checked on line 33.}}\n        {\n            doTheThing(i);\n        }\n\n        Fruit f = null;\n        bool cond = false;\n        if (f is Apple)\n        {\n            f = cond ? new Apple() : new Orange();\n        }\n        if (f is Apple) // Compliant as f may change\n        {\n            f = cond ? new Apple() : new Orange();\n        }\n\n        if (f is null) { }\n        if (f is null) { }  // Noncompliant\n\n        char ch = 'x';\n        if (ch is >= 'a' and <= 'z') { }\n        if (ch is >= 'a' and <= 'z') { } // Noncompliant\n        if (ch is <= 'z' and >= 'a') { } // FN, rule is syntax based. Only null check equivalence is currenty supported in CSharpEquivalenceChecker\n\n        if (ch is (>= 'a' and <= 'z') or (>= 'A' and <= 'Z') or '.' or '?') { }\n        if (ch is (>= 'a' and <= 'z') or (>= 'A' and <= 'Z') or '.' or '?') { } // Noncompliant\n        if (ch is (>= 'a' and <= 'z') or (>= 'A' and <= 'Z') or '?' or '.') { } // FN, rule is syntax based. Only null check equivalence is currenty supported in CSharpEquivalenceChecker\n        if (ch is (>= 'A' and <= 'Z') or (>= 'a' and <= 'z') or '?' or '.') { } // FN, rule is syntax based. Only null check equivalence is currenty supported in CSharpEquivalenceChecker\n\n        if (f is not null) { }\n        if (f is not not not null) { }  // Noncompliant, same meaning\n        if (f != null) { }              // Noncompliant, same meaning\n\n        if (f is null) { }\n        if (f == null) { }          // Noncompliant, same meaning\n        if (!(f is not null)) { }   // Noncompliant, same meaning\n\n        if (!(f is null)) { }\n        if (f != null) { }          // Noncompliant, same meaning\n        if (f is not not null) { }  // Compliant, equal to f == null\n\n        if (f is Apple) { }\n        if (f is Apple) { }   // Noncompliant\n\n        if (f is Apple or Orange) { }\n        if (f is Apple or Orange) { }   // Noncompliant\n        if (f is Orange or Apple) { }   // FN, rule is syntax based. Only null check equivalence is currenty supported in CSharpEquivalenceChecker\n\n        if (f is not Apple) { }\n        if (f is not Apple) { } // Noncompliant\n\n        if (f is { Size: >= 5, Value: 0 }) { }\n        if (f is { Size: >= 5, Value: 0 }) { } // Noncompliant\n        if (f is { Value: 0, Size: >= 5 }) { } // FN, rule is syntax based. Only null check equivalence is currenty supported in CSharpEquivalenceChecker\n\n        if (f is { Size: >= 5 }) { }\n        if (f is not { Size: < 5 }) { } // FN, rule is syntax based. Only null check equivalence is currenty supported in CSharpEquivalenceChecker\n    }\n\n    void doTheThing(object o) { }\n\n    public void PositionalPattern(Apple a)\n    {\n        if (a is (\"Sweet\", \"Red\"))\n        {\n        }\n        if (a is (\"Sweet\", \"Red\")) // Noncompliant\n        {\n        }\n        if (a is { Taste: \"Sweet\", Color: \"Red\" }) // FN, rule is syntax based. Only null check equivalence is currenty supported in CSharpEquivalenceChecker\n        {\n        }\n    }\n}\n\nabstract class Fruit\n{\n    public int Size { get; }\n    public int Value { get; }\n}\n\nclass Apple : Fruit\n{\n    public string Taste;\n    public string Color;\n    public void Deconstruct(out string x, out string y) => (x, y) = (Taste, Color);\n}\n\nclass Orange : Fruit { }\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ConditionalsWithSameCondition.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Tests.TestCases\n{\n    class ConditionalsWithSameCondition\n    {\n        public void doTheThing(object o)\n        {\n        }\n\n        public int a { get; set; }\n        public int b { get; set; }\n        public int c { get; set; }\n        public void Test()\n        {\n            if (a == b)\n            {\n                doTheThing(b);\n            }\n            if (a == b) // Noncompliant {{This condition was just checked on line 20.}}\n//              ^^^^^^\n            {\n                doTheThing(b);\n            }\n            if (a == b) // Noncompliant\n            {\n                doTheThing(b);\n            }\n            if (a == c)\n            {\n                doTheThing(c);\n                c = 5;\n            }\n            if (a == c) // Compliant, c might be updated in the previous if\n            {\n                c++;\n            }\n            if (a == c) // Compliant, c might be updated in the previous if\n            {\n                ++c;\n            }\n            if (a == c) // Compliant, c might be updated in the previous if\n            {\n                ++c;\n            }\n\n            if (a == b && a == c) { }\n            if (a == b && a == c) { } // Noncompliant\n            if (a == c && a == b) { } // Compliant, even when the semantics is the same as the previous one. Properties or invocations can have side effects on the result.\n        }\n\n        public void TestSw()\n        {\n            switch (a)\n            {\n                case 1:\n                    break;\n            }\n            switch (a) // Noncompliant {{This condition was just checked on line 58.}}\n            {\n                case 2:\n                    break;\n            }\n        }\n\n        public void EquivalentChecksForNull(object o)\n        {\n            if (o == null) { }\n            if (null == o) { }      // Noncompliant, same meaning\n            if (!!(o == null)) { }  // Noncompliant, same meaning\n            if (!(o != null)) { }   // Noncompliant, same meaning\n            if (!(null != o)) { }   // Noncompliant, same meaning\n        }\n    }\n\n    public class Coverage\n    {\n        private string name;\n\n        public void AssignedToFieldWithSameName(string name)\n        {\n            if (name == name)\n            {\n                this.name = null;\n            }\n            if (name == name) { } // Noncompliant\n        }\n\n        public void Undefined(string sameAsUndefinedField)\n        {\n            if (sameAsUndefinedField == sameAsUndefinedField)\n            {\n                this.sameAsUndefinedField = null; // Error [CS1061]: 'Coverage' does not contain a definition for 'sameAsUndefinedField'\n            }\n            if (sameAsUndefinedField == sameAsUndefinedField) { } // Noncompliant\n        }\n\n        public void NameMismatch(string otherName)\n        {\n            if (otherName == otherName)\n            {\n                this.name = null;\n            }\n            if (otherName == otherName) { } // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ConstructorArgumentValueShouldExist.Latest.Partial.cs",
    "content": "﻿using System;\nusing System.Windows.Markup;\n\nnamespace CSharp13\n{\n    public partial class MyExtension3 : MarkupExtension\n    {\n        public partial object Value1 // Compliant\n        {\n            get => new object();\n            set { }\n        }\n    }\n}\n\nnamespace CSharp14\n{\n    public partial class NonCompliantPartialConstructor : MarkupExtension\n    {\n        public partial NonCompliantPartialConstructor(object value1) { Value1 = value1; }\n        public override object ProvideValue(IServiceProvider serviceProvider) => null;\n    }\n\n    public partial class CompliantPartialConstructor : MarkupExtension\n    {\n        public partial CompliantPartialConstructor(object value1) { Value1 = value1; }\n        public override object ProvideValue(IServiceProvider serviceProvider) => null;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ConstructorArgumentValueShouldExist.Latest.cs",
    "content": "﻿using System;\nusing System.Windows.Markup;\n\npublic class MyExtension3 : MarkupExtension\n{\n    public MyExtension3(object value1) { Value1 = value1; }\n\n    [ConstructorArgument(\"value2\")]  // Noncompliant {{Change this 'ConstructorArgumentAttribute' value to match one of the existing constructors arguments.}}\n    public object Value1 { get; set; }\n\n    public override object ProvideValue(IServiceProvider serviceProvider) => null;\n}\n\n// This is fake scaffolding to avoid .NET 5 reference issue.\n// https://github.com/SonarSource/sonar-dotnet/issues/3425\nnamespace System.Windows.Markup\n{\n    public interface IServiceProvider { }\n\n    public abstract class MarkupExtension\n    {\n        public abstract object ProvideValue(IServiceProvider serviceProvider);\n    }\n\n    public class ConstructorArgumentAttribute : Attribute\n    {\n        public ConstructorArgumentAttribute(string argumentName) { }\n    }\n}\n\nnamespace CSharp13\n{\n    //https://sonarsource.atlassian.net/browse/NET-553\n    public partial class MyExtension3 : MarkupExtension\n    {\n        public MyExtension3(object value1) { Value1 = value1; }\n        public override object ProvideValue(IServiceProvider serviceProvider) => null;\n        [ConstructorArgument(\"value2\")] // Noncompliant\n        public partial object Value1 { get; set; }\n    }\n}\n\nnamespace CSharp14\n{\n    public partial class NonCompliantPartialConstructor : MarkupExtension\n    {\n        public partial NonCompliantPartialConstructor(object value1);\n        [ConstructorArgument(\"value2\")]     // Noncompliant\n        public object Value1 { get; set; }\n    }\n\n    public partial class CompliantPartialConstructor : MarkupExtension\n    {\n        public partial CompliantPartialConstructor(object value1);\n        [ConstructorArgument(\"value1\")]\n        public object Value1 { get; set; }\n    }\n\n    public static class NonCompliantExtensions\n    {\n\n        extension(NonCompliantStaticExtensionProperty ext)\n        {\n            [ConstructorArgument(\"value2\")]             // Noncompliant\n            public static object Value1 => 42;\n        }\n\n        extension(NonCompliantInstanceExtensionProperty ext)\n        {\n            [ConstructorArgument(\"value2\")]             // Noncompliant\n            public object Value1 => 42;\n        }\n    }\n\n    public static class CompliantExtensions\n    {\n        extension(CompliantStaticExtensionProperty ext)\n        {\n            [ConstructorArgument(\"value1\")]             // Noncompliant FP https://sonarsource.atlassian.net/browse/NET-2696\n            public static object Value1 => 42;\n        }\n\n        extension(CompliantInstanceExtensionProperty ext)\n        {\n            [ConstructorArgument(\"value1\")]             // Noncompliant FP https://sonarsource.atlassian.net/browse/NET-2696\n            public object Value1 => 42;\n        }\n    }\n\n    public class NonCompliantStaticExtensionProperty : MarkupExtension\n    {\n        public NonCompliantStaticExtensionProperty(object value1) { this.Value1 = value1; }   // Error [CS0176] {{Member 'NonCompliantExtensions.extension(NonCompliantStaticExtensionProperty).Value1' cannot be accessed with an instance reference; qualify it with a type name instead}}\n        public override object ProvideValue(IServiceProvider serviceProvider) => null;\n    }\n\n    public class NonCompliantInstanceExtensionProperty : MarkupExtension\n    {\n        public NonCompliantInstanceExtensionProperty(object value1) { this.Value1 = value1; } // Error [CS0200] {{Property or indexer 'NonCompliantExtensions.extension(NonCompliantInstanceExtensionProperty).Value1' cannot be assigned to -- it is read only}}\n        public override object ProvideValue(IServiceProvider serviceProvider) => null;\n    }\n\n\n    public class CompliantStaticExtensionProperty : MarkupExtension\n    {\n        public CompliantStaticExtensionProperty(object value1) { this.Value1 = value1; }      // Error [CS0176] {{Member 'CompliantExtensions.extension(CompliantStaticExtensionProperty).Value1' cannot be accessed with an instance reference; qualify it with a type name instead}}\n        public override object ProvideValue(IServiceProvider serviceProvider) => null;\n    }\n\n    public class CompliantInstanceExtensionProperty : MarkupExtension\n    {\n        public CompliantInstanceExtensionProperty(object value1) { this.Value1 = value1; }    // Error [CS0200] {{Property or indexer 'CompliantExtensions.extension(CompliantInstanceExtensionProperty).Value1' cannot be assigned to -- it is read only}}\n        public override object ProvideValue(IServiceProvider serviceProvider) => null;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ConstructorArgumentValueShouldExist.cs",
    "content": "﻿using System;\nusing System.Windows.Markup;\n\nnamespace Tests.Diagnostics\n{\n    public class MyExtension1 : MarkupExtension\n    {\n        public MyExtension1(object value1) { Value1 = value1; }\n\n        [ConstructorArgument(\"value1\")]\n        public object Value1 { get; set; }\n\n        public override object ProvideValue(IServiceProvider serviceProvider) => null;\n    }\n\n    public class MyExtension2 : MarkupExtension\n    {\n        public MyExtension2(object value1) { Value1 = value1; }\n\n        [System.Windows.Markup.ConstructorArgument(\"value1\")]\n        public object Value1 { get; set; }\n\n        public override object ProvideValue(IServiceProvider serviceProvider) => null;\n    }\n\n    public class MyExtension3 : MarkupExtension\n    {\n        public MyExtension3(object value1) { Value1 = value1; }\n\n        [ConstructorArgument(\"value2\")]  // Noncompliant {{Change this 'ConstructorArgumentAttribute' value to match one of the existing constructors arguments.}}\n//                           ^^^^^^^^\n        public object Value1 { get; set; }\n\n        public override object ProvideValue(IServiceProvider serviceProvider) => null;\n    }\n\n    public class MyExtension4 : MarkupExtension\n    {\n        public MyExtension4(object value1) { Value1 = value1; }\n\n        [ConstructorArgument] // Error [CS7036] - Invalid syntax - argument is mandatory - do not raise\n        public object Value1 { get; set; }\n\n        public override object ProvideValue(IServiceProvider serviceProvider) => null;\n    }\n\n    public class MyExtension5 : MarkupExtension\n    {\n        public MyExtension5(object value1) { Value1 = value1; }\n\n        [ConstructorArgument(\"foo\")] // Noncompliant\n        [ConstructorArgument(\"bar\")] // Noncompliant\n                                     // Error@-1 [CS0579] - Invalid syntax - only 1 attribute allowed\n        public object Value1 { get; set; }\n\n        public override object ProvideValue(IServiceProvider serviceProvider) => null;\n    }\n\n    public class MyExtension6 : MarkupExtension\n    {\n        public MyExtension6(object value1) { Value1 = value1; }\n\n        [ConstructorArgument(\"v1\", \"v2\")] // Error [CS1729] - 'ConstructorArgumentAttribute' does not contain a constructor that takes 2 arguments\n        public object Value1 { get; set; }\n\n        public override object ProvideValue(IServiceProvider serviceProvider) => null;\n    }\n\n    public class MyExtension7 : MarkupExtension\n    {\n        public MyExtension7(object value1) { Value1 = value1; }\n\n        [ConstructorArgument] // Error [CS7036]\n        public object Value1 { get; set; }\n\n        public override object ProvideValue(IServiceProvider serviceProvider) => null;\n    }\n\n    public class MyExtension8 : MarkupExtension\n    {\n        public MyExtension8(object value1) { Value1 = value1; }\n\n        [ConstructorArgument()] // Error [CS7036]\n        public object Value1 { get; set; }\n\n        public override object ProvideValue(IServiceProvider serviceProvider) => null;\n    }\n\n    public class MyExtension9 : MarkupExtension\n    {\n        public MyExtension9(object value1) { Value1 = value1; }\n\n        [ConstructorArgument(Property = \"Test\")] // Error [CS7036]\n                                                 // Error@-1 [CS0246]\n        public object Value1 { get; set; }\n\n        public override object ProvideValue(IServiceProvider serviceProvider) => null;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ConstructorArgumentValueShouldExist.vb",
    "content": "﻿Imports System\nImports System.Windows.Markup\n\nNamespace Tests.Diagnostics\n\n    Public Class MyExtension0\n        Inherits MarkupExtension\n\n        Public Overrides Function ProvideValue(serviceProvider As IServiceProvider) As Object\n            Return Nothing\n        End Function\n\n        Public Sub New\n            Value1 = value1\n        End Sub\n\n        <ConstructorArgument(\"value1\")> ' Noncompliant {{Change this 'ConstructorArgumentAttribute' value to match one of the existing constructors arguments.}}\n        Public Property Value1 As Object\n    End Class\n\n    Public Class MyExtension1\n        Inherits MarkupExtension\n\n        Public Overrides Function ProvideValue(serviceProvider As IServiceProvider) As Object\n            Return Nothing\n        End Function\n\n        Public Sub New(ByVal value1 As Object)\n            Value1 = value1\n        End Sub\n\n        <ConstructorArgument(\"value1\")>\n        Public Property Value1 As Object\n    End Class\n\n    Public Class MyExtension2\n        Inherits MarkupExtension\n\n        Public Overrides Function ProvideValue(serviceProvider As IServiceProvider) As Object\n            Return Nothing\n        End Function\n\n        Public Sub New(ByVal value1 As Object)\n            Value1 = value1\n        End Sub\n\n        <System.Windows.Markup.ConstructorArgument(\"value1\")>\n        Public Property Value1 As Object\n    End Class\n\n    Public Class MyExtension3\n        Inherits MarkupExtension\n\n        Public Overrides Function ProvideValue(serviceProvider As IServiceProvider) As Object\n            Return Nothing\n        End Function\n\n        Public Sub New(ByVal value1 As Object)\n            Value1 = value1\n        End Sub\n\n        <ConstructorArgument(\"value2\")> ' Noncompliant {{Change this 'ConstructorArgumentAttribute' value to match one of the existing constructors arguments.}}\n        Public Property Value1 As Object\n'                            ^^^^^^^^ @-1\n    End Class\n\n    Public Class MyExtension4\n        Inherits MarkupExtension\n\n        Public Overrides Function ProvideValue(serviceProvider As IServiceProvider) As Object\n            Return Nothing\n        End Function\n\n        Public Sub New(ByVal value1 As Object)\n            Value1 = value1\n        End Sub\n\n        ' Apparently, case matters, even in VB\n        <ConstructorArgument(\"VaLUe1\")> ' Noncompliant {{Change this 'ConstructorArgumentAttribute' value to match one of the existing constructors arguments.}}\n        Public Property Value1 As Object\n'                            ^^^^^^^^ @-1\n    End Class\n\n    Public Class MyExtension5\n        Inherits MarkupExtension\n\n        Public Overrides Function ProvideValue(serviceProvider As IServiceProvider) As Object\n            Return Nothing\n        End Function\n\n        Public Sub New(ByVal value1 As Object)\n            Value1 = value1\n        End Sub\n\n        <ConstructorArgument> ' Error [BC30455] Invalid syntax - argument is mandatory - do not raise\n        Public Property Value1 As Object\n    End Class\n\n    Public Class MyExtension6\n        Inherits MarkupExtension\n\n        Public Overrides Function ProvideValue(serviceProvider As IServiceProvider) As Object\n            Return Nothing\n        End Function\n\n        Public Sub New(ByVal value1 As Object)\n            Value1 = value1\n        End Sub\n\n        <ConstructorArgument(\"foo\")> ' Compliant\n        <ConstructorArgument(\"bar\")> ' Compliant\n                                     ' Error@-2 [BC32035] Invalid syntax - only 1 attribute allowed\n        Public Property Value1 As Object\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ConstructorOverridableCall.Latest.Partial.cs",
    "content": "﻿using System;\nnamespace CSharp14\n{\n    public abstract partial class PartialConstructor\n    {\n        public partial PartialConstructor(PartialConstructor other)\n        {\n            DoSomething();          // Noncompliant {{Remove this call from a constructor to the overridable 'DoSomething' method.}}\n//          ^^^^^^^^^^^\n            this.DoSomething();     // Noncompliant\n            other.DoSomething();    // Compliant\n\n            var a = this;\n            a.DoSomething();        // Not recognized\n\n            var action = new Action(() => { DoSomething(); });\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ConstructorOverridableCall.Latest.cs",
    "content": "﻿namespace CSharp14\n{\n    public abstract partial class PartialConstructor\n    {\n        public partial PartialConstructor(PartialConstructor other);\n\n        public abstract void DoSomething();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ConstructorOverridableCall.Nancy.cs",
    "content": "﻿using System;\n\nnamespace  Nancy\n{\n    // Shim of a Nancy module\n    // https://github.com/NancyFx/Nancy/wiki/Exploring-the-nancy-module\n    public class NancyModule\n    {\n        public virtual void Get<T>(string path, Func<dynamic, T> action) { }\n    }\n}\n\npublic class SampleModule : Nancy.NancyModule\n{\n    public SampleModule()\n    {\n        Get(\"/\", _ => \"Hello World!\"); // Compliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ConstructorOverridableCall.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public abstract class ParentAbstract\n    {\n        protected ParentAbstract(ParentAbstract other)\n        {\n            DoSomething();  // Noncompliant {{Remove this call from a constructor to the overridable 'DoSomething' method.}}\n//          ^^^^^^^^^^^\n            this.DoSomething();  // Noncompliant\n            other.DoSomething(); // Compliant\n\n            var a = this;\n            a.DoSomething(); // Not recognized\n\n            var action = new Action(() => { DoSomething(); });\n        }\n\n        public abstract void DoSomething();\n    }\n\n    public class Parent\n    {\n        public Parent()\n        {\n            DoSomething();  // Noncompliant\n            DoSomething2();\n\n            var action = new Action(() => { DoSomething(); });\n        }\n\n        public virtual void DoSomething() // can be overridden\n        {\n\n        }\n        public void DoSomething2()\n        {\n\n        }\n    }\n\n    public class Child : Parent\n    {\n        private string foo;\n\n        public Child(string foo) // leads to call DoSomething() in Parent constructor which triggers a NullReferenceException as foo has not yet been initialized\n        {\n            this.foo = foo;\n        }\n\n        public override void DoSomething()\n        {\n            Console.WriteLine(this.foo.Length);\n        }\n    }\n\n    public class BaseClass\n    {\n        public BaseClass(int a)\n        {\n        }\n\n        public virtual int DoSomething() { return 0; }\n        public virtual int DoSomething(int a) { return 0; }\n    }\n\n    public class InlineBaseThisCall : BaseClass\n    {\n        public InlineBaseThisCall() : this(DoSomething()) { } // Error [CS0120]\n        public InlineBaseThisCall(int a) : base(DoSomething(a)) { } // Error [CS0120]\n    }\n\n    // https://sonarsource.atlassian.net/browse/NET-1318\n    public class LocalFuncion : BaseClass\n    {\n        public LocalFuncion() : base(0)\n        {\n            Local();\n\n            void Local()\n            {\n                DoSomething(); // FN\n            }\n        }\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/6245\nnamespace Tests.Diagnostics.Repro_6245\n{\n    public class Class1\n    {\n        public Class1()\n        {\n            DoSomething(); // Noncompliant\n        }\n\n        public virtual void DoSomething() { }\n    }\n\n    public class ClassA2 : Class1\n    {\n        public ClassA2()\n        {\n            DoSomething(); // Noncompliant\n        }\n    }\n\n    public class ClassA3 : ClassA2\n    {\n        public string Name { get; set; }\n\n        public ClassA3(string name)\n        {\n            Name = name;\n            DoSomething(); // Noncompliant\n        }\n\n        public override void DoSomething()\n        {\n            Console.WriteLine($\"{Name} is null at this point\");\n        }\n    }\n\n    public class ClassB2 : Class1\n    {\n        public ClassB2()\n        {\n            DoSomething(); // Compliant\n        }\n\n        public sealed override void DoSomething() { }\n    }\n\n    public class ClassB3 : ClassB2\n    {\n        public string Name { get; set; }\n\n        public ClassB3(string name)\n        {\n            Name = name;\n        }\n    }\n\n    public sealed class ClassC2 : Class1\n    {\n        public ClassC2()\n        {\n            DoSomething(); // Compliant\n        }\n\n        public override void DoSomething() { }\n    }\n\n    public sealed class ClassD2 : Class1\n    {\n        public ClassD2()\n        {\n            DoSomething(); // Compliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ConsumeValueTaskCorrectly.Latest.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Threading.Tasks;\n\n// Repro for https://github.com/SonarSource/sonar-dotnet/issues/6779\nclass Repro_FN_6779\n{\n    class SomeService\n    {\n        public ValueTask DoThing1() => ValueTask.CompletedTask;\n        public ValueTask DoThing2() => ValueTask.CompletedTask;\n    }\n\n    class Consumer\n    {\n        public async Task ConsumeTasks()\n        {\n            var service = new SomeService();\n\n            // The reason seems to be that 'GetLeftMostIdentifier' uses 'service' instead of 'service.DoThing1' as the identifier.\n            // Invocation -> SimpleMember -> Invocation -> SimpleMember\n            var thing1 = service.DoThing1().AsTask(); // Noncompliant FP\n            var thing2 = service.DoThing2().AsTask();\n//                       ^^^^^^^ Secondary\n        }\n    }\n}\n\n\n// Repro for https://github.com/SonarSource/sonar-dotnet/issues/9661\nclass Test\n{\n    static ValueTask<string> MethodAsync(ValueTask<string> task) =>\n        task.IsCompletedSuccessfully\n            ? ValueTask.FromResult<string>(task.Result) // Noncompliant, FP\n            : AnotherMethodAsync(task);\n\n    static async ValueTask<string> AnotherMethodAsync(ValueTask<string> task) =>\n        await task;\n}\n\n\nnamespace CSharp14\n{\n    public class NullConditionalAssignment\n    {\n        async Task Method()\n        {\n            var a = new Tester();\n            ValueTask<int> NonCompliant = new ValueTask<int>(42);\n\n            a?.Test = await NonCompliant;   // Noncompliant\n            a?.Test = await NonCompliant;   // Secondary\n\n            ValueTask<int> Compliant = new ValueTask<int>(42);\n            a?.Test = await Compliant;     // Compliant\n        }\n\n        public class Tester\n        {\n            public int Test;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ConsumeValueTaskCorrectly.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Threading.Tasks;\n\nnamespace Tests.Diagnostics\n{\n    class ValueTaskProvider\n    {\n        public ValueTask<int> ReadAsync() => new ValueTask<int>();\n        public void Foo(int x) { }\n\n    }\n\n    class Tests\n    {\n        // see https://devblogs.microsoft.com/dotnet/understanding-the-whys-whats-and-whens-of-valuetask/\n        // and https://docs.microsoft.com/en-us/dotnet/api/system.threading.tasks.valuetask-1?view=netstandard-2.1\n\n        public async void Foo1(ValueTaskProvider stream)\n        {\n            var valueTask = stream.ReadAsync();\n            var once = await valueTask; // Noncompliant {{Refactor this 'ValueTask' usage to consume it only once.}}\n//                           ^^^^^^^^^\n            var twice = await valueTask;\n//                            ^^^^^^^^^ Secondary {{The 'ValueTask' is consumed here again}}\n        }\n\n        public void Foo2(ValueTaskProvider stream)\n        {\n            var valueTask = stream.ReadAsync();\n            var once = valueTask.AsTask(); // Noncompliant\n            var twice = valueTask.AsTask(); // Secondary {{The 'ValueTask' is consumed here again}}\n        }\n\n        public async void Foo3(ValueTaskProvider stream)\n        {\n            var valueTask = stream.ReadAsync();\n            var once = await valueTask; // Noncompliant {{Refactor this 'ValueTask' usage to consume it only once.}}\n//                           ^^^^^^^^^\n            var twice = valueTask.AsTask();\n//                      ^^^^^^^^^ Secondary\n        }\n\n        public async void Foo4(ValueTaskProvider stream)\n        {\n            var valueTask = stream.ReadAsync();\n            var once = valueTask.AsTask(); // Noncompliant\n            var twice = await valueTask; // Secondary\n\n        }\n\n        public void Foo5(ValueTaskProvider stream)\n        {\n            var valueTask = stream.ReadAsync();\n            var once = valueTask.Result; // Noncompliant {{Refactor this 'ValueTask' usage to consume the result only if the operation has completed successfully.}}\n//                     ^^^^^^^^^\n        }\n\n        public void Foo6(ValueTaskProvider stream)\n        {\n            var valueTask = stream.ReadAsync();\n            var once = valueTask.GetAwaiter().GetResult(); // Noncompliant\n        }\n\n        public void Foo7(ValueTaskProvider stream)\n        {\n            int bytesRead = 0;\n            ValueTask<int> valueTask = stream.ReadAsync();\n            if (valueTask.IsCompletedSuccessfully)\n            {\n                // because they're called after completed successfully, we don't count them\n                bytesRead = valueTask.Result;\n            }\n\n            if (bytesRead > 9)\n            {\n                bytesRead = valueTask.Result; // FN - it is checked above and we don't use the CFG to verify the blocks\n            }\n        }\n\n        public void Foo8(ValueTask<object> valueTask)\n        {\n            if (valueTask.IsCompletedSuccessfully)\n            {\n                // because they're called after completed successfully, we don't count them\n                var bytesRead = valueTask.Result; // FN\n                var once = valueTask.GetAwaiter().GetResult(); // FN\n            }\n        }\n\n        public void Foo9(ValueTaskProvider stream)\n        {\n            int bytesRead;\n            ValueTask<int> valueTask = stream.ReadAsync();\n            if (valueTask.IsCompletedSuccessfully)\n            {\n                // because they're called after completed successfully, we don't count them\n                var once = valueTask.GetAwaiter().GetResult(); // FN\n                bytesRead = valueTask.Result; // FN\n            }\n        }\n\n        public void Foo10(ValueTaskProvider stream)\n        {\n            int bytesRead;\n            ValueTask<int> valueTask = stream.ReadAsync();\n            if (valueTask.IsCompletedSuccessfully)\n            {\n                // because they're called after completed successfully, we don't count them\n                var once = valueTask.GetAwaiter().GetResult(); // FN\n                var twice = valueTask.GetAwaiter().GetResult(); // FN\n            }\n        }\n\n        public async void Foo11(ValueTaskProvider stream, bool b, string s, int o)\n        {\n            var valueTask = stream.ReadAsync();\n            var once = await valueTask; // Noncompliant\n            if (b)\n            {\n                while (o > 0)\n                {\n                    if (o == 10)\n                    {\n                        return;\n                    }\n                    if (s.Contains(o + \"\"))\n                    {\n                        stream.Foo(await valueTask); // Secondary\n                    }\n                    --o;\n                }\n            }\n        }\n\n        public void Foo12(ValueTaskProvider stream)\n        {\n            var valueTask = stream.ReadAsync();\n            if (valueTask.IsCompleted) // we don't know if it's successful\n            {\n                var once = valueTask.Result; // Noncompliant\n            }\n        }\n\n        public void Foo13(ValueTaskProvider stream)\n        {\n            var valueTask = stream.ReadAsync();\n            if (valueTask.IsCompleted) // we don't know if it's successful\n            {\n                var once = valueTask.GetAwaiter().GetResult(); // Noncompliant\n            }\n        }\n\n        // two different symbols , one bad , one ok\n        public async void Foo14(ValueTaskProvider stream)\n        {\n            var firstValueTask = stream.ReadAsync();\n            var once = firstValueTask.GetAwaiter().GetResult(); // Noncompliant\n\n            int bytesRead;\n            ValueTask<int> secondReadTask = stream.ReadAsync();\n            if (secondReadTask.IsCompletedSuccessfully)\n            {\n                bytesRead = secondReadTask.Result; // Compliant, has completed successfully\n            }\n            else\n            {\n                bytesRead = await secondReadTask;\n            }\n        }\n\n        // two different symbols , both bad\n        public void Foo15(ValueTaskProvider stream)\n        {\n            var firstValueTask = stream.ReadAsync();\n            var firstValueTaskR1 = firstValueTask.AsTask(); // Noncompliant\n            var firstValueTaskR2 = firstValueTask.AsTask(); // Secondary\n\n            var secondValueTask = stream.ReadAsync();\n            var secondValueTaskR1 = secondValueTask.AsTask(); // Noncompliant\n            var secondValueTaskR2 = secondValueTask.AsTask(); // Secondary\n        }\n\n        public void Foo16()\n        {\n            var stream = new ValueTaskProvider();\n            var awaiter = stream.ReadAsync().GetAwaiter();\n            awaiter.GetResult(); // Noncompliant\n        }\n\n        public async void Foo17(ValueTask<string> valueTask)\n        {\n            string x;\n            if (!valueTask.IsCompletedSuccessfully)\n            {\n                x = await valueTask; // Noncompliant\n                x = await valueTask; // Secondary\n            }\n        }\n\n        public async void Foo18(ValueTask<string> valueTask)\n        {\n            string x;\n            x = await valueTask; // Noncompliant\n            x = valueTask.Result; // Secondary\n// Noncompliant@-1\n            if (!valueTask.IsCompletedSuccessfully)\n            {\n                 x = await valueTask; // Secondary\n            }\n            x = valueTask.Result; // FN , after if\n        }\n\n        public void FooFalseNegative(ValueTaskProvider stream)\n        {\n            int bytesRead;\n            ValueTask<int> valueTask = stream.ReadAsync();\n            GetResult(valueTask); // FN - we don't inspect inside the method body\n            GetResult(valueTask); // FN\n        }\n\n        public async void FooFalseNegative2(ValueTask<string> valueTask)\n        {\n            string x;\n            if (!valueTask.IsCompletedSuccessfully)\n            {\n                 x = await valueTask;\n            }\n            x = valueTask.Result; // FN - checked above in the if, we are blind now\n            x = valueTask.Result; // FN\n            x = valueTask.Result; // FN\n            x = valueTask.Result; // FN\n        }\n\n        private async Task<int> GetResult(ValueTask<int> valueTask) => await valueTask;\n\n        public async void Compliant1(ValueTaskProvider stream)\n        {\n            var valueTask = stream.ReadAsync();\n            var once = await valueTask;\n        }\n\n        public void Compliant2(ValueTaskProvider stream)\n        {\n            var valueTask = stream.ReadAsync();\n            var once = valueTask.AsTask();\n        }\n\n        public void Compliant3(ValueTaskProvider stream)\n        {\n            var valueTask = stream.ReadAsync();\n            if (valueTask.IsCompletedSuccessfully)\n            {\n                var once = valueTask.Result;\n            }\n        }\n\n        public void Compliant4(ValueTask<int> valueTask)\n        {\n            if (valueTask.IsCompletedSuccessfully)\n            {\n                var once = valueTask.GetAwaiter().GetResult();\n            }\n        }\n\n        public async void Compliant5(ValueTaskProvider stream, bool b, string s, int o)\n        {\n            var valueTask = stream.ReadAsync();\n            var once = await valueTask;\n            if (b)\n            {\n                while (o > 0)\n                {\n                    if (o == 10)\n                    {\n                        return;\n                    }\n                    if (valueTask.IsCompletedSuccessfully)\n                    {\n                        valueTask.GetAwaiter().GetResult();\n                    }\n                    --o;\n                }\n            }\n        }\n\n        public async void Compliant6(ValueTaskProvider stream)\n        {\n            int bytesRead;\n            ValueTask<int> readTask = stream.ReadAsync();\n            if (readTask.IsCompletedSuccessfully)\n            {\n                bytesRead = readTask.Result; // Compliant, has completed successfully\n            }\n            else\n            {\n                bytesRead = await readTask;\n            }\n        }\n\n        public async void Compliant7(ValueTaskProvider stream)\n        {\n            int result = await stream.ReadAsync();\n\n            result = await stream.ReadAsync().ConfigureAwait(false);\n\n            Task<int> t = stream.ReadAsync().AsTask();\n            var r1 = t.Result;\n            var r2 = t.Result;\n            var r3 = await t;\n            var r4 = await t;\n\n            var valueTask = stream.ReadAsync();\n            var task = valueTask.AsTask();\n            var t1 = task.Result;\n            var t2 = task.Result;\n        }\n\n        public async void Compliant8(ValueTask<string> valueTask)\n        {\n            string x;\n            if (!valueTask.IsCompletedSuccessfully)\n            {\n                 x = await valueTask;\n            }\n            x = valueTask.Result;\n        }\n    }\n\n    class DifferentSyntaxes\n    {\n        public void Foo1(ValueTask<string> valueTask)\n        {\n            LocalMethod();\n\n            async void LocalMethod()\n            {\n                var once = await valueTask; // Noncompliant\n                var twice = await valueTask; // Secondary\n            }\n        }\n\n        public int Foo2(ValueTask<int> valueTask) => valueTask.Result; // Noncompliant\n\n        private ValueTask<int> valueTask;\n        public int Property\n        {\n            get => this.valueTask.Result; // Noncompliant\n        }\n\n\n        public string Foo3(ValueTask<string> valueTask)\n        {\n            System.Func<string> anonMethod = () => valueTask.Result; // Noncompliant\n\n            return anonMethod();\n        }\n\n        public DifferentSyntaxes(ValueTaskProvider stream)\n        {\n            var valueTask = stream.ReadAsync();\n            var once = valueTask.Result; // Noncompliant\n        }\n\n\n        ~DifferentSyntaxes()\n        {\n            var once = this.valueTask.Result; // Noncompliant\n        }\n\n        public static implicit operator int(DifferentSyntaxes f)\n        {\n            return f.valueTask.Result; // Noncompliant\n        }\n\n        public static DifferentSyntaxes operator -(DifferentSyntaxes b, DifferentSyntaxes c)\n        {\n            c.valueTask.GetAwaiter().GetResult(); // FN\n            return null;\n        }\n\n        public static DifferentSyntaxes operator +(DifferentSyntaxes b, DifferentSyntaxes c)\n        {\n            var once = b.valueTask.Result; // Noncompliant\n            return null;\n        }\n    }\n\n    class StressTest\n    {\n        public async void Foo18(ValueTask<string> valueTask)\n        {\n            string x;\n            x = await valueTask; // Noncompliant\n            x = await valueTask; // Secondary\n            x = valueTask.Result; // Secondary\n// Noncompliant@-1\n            x = valueTask.Result; // Secondary\n// Noncompliant@-1\n\n            x = await valueTask; // Secondary\n            x = await valueTask; // Secondary\n            if (true && false && !valueTask.IsCompletedSuccessfully)\n                x = await valueTask; // Secondary\n\n            x = await valueTask; // Secondary\n            x = await valueTask; // Secondary\n            x = valueTask.Result;\n            x = valueTask.Result;\n            x = valueTask.Result;\n            x = valueTask.Result;\n\n            x = valueTask.Result;\n            if (!valueTask.IsCompletedSuccessfully)\n                if (!valueTask.IsCompletedSuccessfully)\n                    if (!valueTask.IsCompletedSuccessfully)\n                         x = await valueTask; // Secondary\n\n        }\n    }\n\n    // https://sonarsource.atlassian.net/browse/NET-1360\n    internal class Repro_1360\n    {\n        public static async Task MethodCallChain()\n        {\n            var stream = new ValueTaskProvider();\n            var t1 = stream.ReadAsync().AsTask(); // Noncompliant FP ReadAsync returns a new ValueTask on each invocation. t1 and t2 are not the same\n            var t2 = stream.ReadAsync().AsTask(); // Secondary\n\n            await Task.WhenAll(t1, t2);\n        }\n\n        public static async Task StaticMethodCallChain()\n        {\n            var t1 = Repro_1360.StaticValueTask().AsTask(); // Noncompliant FP\n            var t2 = Repro_1360.StaticValueTask().AsTask(); // Secondary\n\n            await Task.WhenAll(t1, t2);\n        }\n\n        public static async Task MethodCallChainThreeMethods()\n        {\n            var t1 = Repro_1360.Factory().InstanceValueTask().AsTask(); // Compliant\n            var t2 = Repro_1360.Factory().InstanceValueTask().AsTask();\n\n            await Task.WhenAll(t1, t2);\n        }\n\n        public static async Task MethodCallChainTwoMethods()\n        {\n            var c = Repro_1360.Factory();\n            var t1 = c.InstanceValueTask().AsTask(); // Noncompliant FP\n            var t2 = c.InstanceValueTask().AsTask(); // Secondary\n\n            await Task.WhenAll(t1, t2);\n        }\n\n        public ValueTask<int> InstanceValueTask() => new ValueTask<int>(1);\n        public static ValueTask<int> StaticValueTask() => new ValueTask<int>(1);\n        public static Repro_1360 Factory() => new Repro_1360();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CryptographicKeyShouldNotBeTooShort.BeforeNet7.cs",
    "content": "﻿using Org.BouncyCastle.Asn1.Nist;\nusing Org.BouncyCastle.Asn1.Sec;\nusing Org.BouncyCastle.Asn1.TeleTrust;\nusing Org.BouncyCastle.Asn1.X9;\nusing Org.BouncyCastle.Crypto.Generators;\nusing Org.BouncyCastle.Crypto.Parameters;\nusing Org.BouncyCastle.Math;\nusing Org.BouncyCastle.Security;\nusing System;\nusing System.Security.Cryptography;\n\nnamespace Tests.Diagnostics\n{\n    public class Program\n    {\n        public void ConstArgumentResolution()\n        {\n            var ec3 = new ECDsaOpenSsl();\n            ec3.GenerateKey(ECCurve.NamedCurves.brainpoolP192t1); // Noncompliant {{Use a key length of at least 224 bits for EC cipher algorithm.}}\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CryptographicKeyShouldNotBeTooShort.Latest.cs",
    "content": "﻿using System;\nusing System.Security.Cryptography;\n\nvar x = new RSACryptoServiceProvider(); // Noncompliant {{Use a key length of at least 2048 bits for RSA cipher algorithm.}}\nRSACryptoServiceProvider y = new(); // Noncompliant\n\nrecord TestRecord\n{\n    private const int validKeySizeConst = 2048;\n    private const int invalidKeySizeConst = 1024;\n\n    private static readonly int validKeySize = 2048;\n    private static readonly int invalidKeySize = 1024;\n\n    public void ConstArgumentResolution()\n    {\n        const int localValidSize = 2048;\n        new RSACryptoServiceProvider();                    // Noncompliant {{Use a key length of at least 2048 bits for RSA cipher algorithm.}}\n        new RSACryptoServiceProvider(new CspParameters()); // Noncompliant - has default key size of 1024\n        new RSACryptoServiceProvider(new ());              // Error [CS0121]\n        new RSACryptoServiceProvider(2048);\n        new RSACryptoServiceProvider(localValidSize);\n        new RSACryptoServiceProvider(validKeySizeConst);\n        new RSACryptoServiceProvider(validKeySize);\n        new RSACryptoServiceProvider(invalidKeySize);      // Noncompliant\n\n        const int localInvalidSize = 1024;\n        new RSACryptoServiceProvider(1024);        // Noncompliant {{Use a key length of at least 2048 bits for RSA cipher algorithm.}}\n//      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        new RSACryptoServiceProvider(1024, new()); // Noncompliant\n        new RSACryptoServiceProvider(invalidKeySizeConst); // Noncompliant\n        new RSACryptoServiceProvider(localInvalidSize);    // Noncompliant\n\n        RSACryptoServiceProvider provider;\n        provider = new ();                                 // Noncompliant {{Use a key length of at least 2048 bits for RSA cipher algorithm.}}\n        provider = new (new CspParameters());              // Noncompliant - has default key size of 1024\n//                 ^^^^^^^^^^^^^^^^^^^^^^^^^\n        provider = new (new ());                           // Error [CS0121]\n        provider = new (2048);\n        provider = new (localValidSize);\n        provider = new (validKeySizeConst);\n        provider = new (validKeySize);\n        provider = new (invalidKeySize);                   // Noncompliant\n\n        var malformed = new UnknownCryptoServiceProvider();// Error [CS0246]\n    }\n\n    public void KeySize()\n    {\n        ECDiffieHellmanCng ec1 = new();\n        ec1.KeySize = 512;\n        ec1.KeySize = 128; // OK - because this is not a valid key size for this object\n\n        DSACng dsa1 = new();\n        dsa1.KeySize = 512; // Noncompliant {{Use a key length of at least 2048 bits for DSA cipher algorithm.}}\n    }\n\n    public void GenerateKey()\n    {\n        ECDiffieHellmanCng ec1 = new();\n        ec1.GenerateKey(ECCurve.NamedCurves.brainpoolP160r1); // Noncompliant {{Use a key length of at least 224 bits for EC cipher algorithm.}}\n\n        ECDsaCng ec2 = new();\n        ec2.GenerateKey(ECCurve.NamedCurves.brainpoolP160t1); // Noncompliant {{Use a key length of at least 224 bits for EC cipher algorithm.}}\n\n        ECDsaOpenSsl ec3 = new();\n        ec3.GenerateKey(ECCurve.NamedCurves.brainpoolP192t1); // Noncompliant {{Use a key length of at least 224 bits for EC cipher algorithm.}}\n\n        ECDsaOpenSsl ec4 = new();\n        ec4?.GenerateKey(ECCurve.NamedCurves.brainpoolP192t1); // Noncompliant {{Use a key length of at least 224 bits for EC cipher algorithm.}}\n        ec4!.GenerateKey(ECCurve.NamedCurves.brainpoolP192t1); // Noncompliant {{Use a key length of at least 224 bits for EC cipher algorithm.}}\n    }\n\n    // Repro https://sonarsource.atlassian.net/browse/NET-233\n    public void CngKeyCreationOption()\n    {\n        CngKeyCreationParameters compliantParams = new CngKeyCreationParameters\n        {\n            KeyCreationOptions = CngKeyCreationOptions.None,\n            Parameters = { new CngProperty(\"Length\", BitConverter.GetBytes(2048), CngPropertyOptions.None) } // Compliant\n        };\n        CngKey cngkey1 = CngKey.Create(CngAlgorithm.Rsa, null, compliantParams);\n\n        CngKeyCreationParameters noncompliantParams1 = new CngKeyCreationParameters\n        {\n            KeyCreationOptions = CngKeyCreationOptions.PreferVbs,\n            Parameters = { new CngProperty(\"Length\", BitConverter.GetBytes(1024), CngPropertyOptions.None) } // FN\n        };\n        CngKey cngkey2 = CngKey.Create(CngAlgorithm.Rsa, null, noncompliantParams1);\n\n        CngKeyCreationParameters noncompliantParams2 = new CngKeyCreationParameters\n        {\n            KeyCreationOptions = CngKeyCreationOptions.RequireVbs,\n            Parameters = { new CngProperty(\"Length\", BitConverter.GetBytes(validKeySize), CngPropertyOptions.None) } // Compliant\n        };\n        CngKey cngkey3 = CngKey.Create(CngAlgorithm.Rsa, null, noncompliantParams2);\n\n        CngKeyCreationParameters noncompliantParams3 = new CngKeyCreationParameters\n        {\n            KeyCreationOptions = CngKeyCreationOptions.UsePerBootKey,\n            Parameters = { new CngProperty(\"Length\", BitConverter.GetBytes(invalidKeySize), CngPropertyOptions.None) } // FN\n        };\n        CngKey cngkey4 = CngKey.Create(CngAlgorithm.Rsa, null, noncompliantParams3);\n    }\n}\n\npublic class NullConditionalAssignment\n{\n    public void CompliantKeySizeSet()\n    {\n        var dsa1 = new DSACng();\n        dsa1?.KeySize = 3072;\n\n        var dsa2 = new DSAOpenSsl();\n        dsa2?.KeySize = 3072;\n    }\n\n    public void NoncompliantKeySizeSet()\n    {\n        var dsa1 = new DSACng();\n        dsa1?.KeySize = 512; // FN https://sonarsource.atlassian.net/browse/NET-2698\n\n        var dsa2 = new DSACryptoServiceProvider(); // Noncompliant\n        dsa2?.KeySize = 2048; // FN https://sonarsource.atlassian.net/browse/NET-2698\n\n        var dsa3 = new DSAOpenSsl();\n        dsa3?.KeySize = 1024; // FN https://sonarsource.atlassian.net/browse/NET-2698\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/CryptographicKeyShouldNotBeTooShort.cs",
    "content": "﻿using Org.BouncyCastle.Asn1.Nist;\nusing Org.BouncyCastle.Asn1.Sec;\nusing Org.BouncyCastle.Asn1.TeleTrust;\nusing Org.BouncyCastle.Asn1.X9;\nusing Org.BouncyCastle.Crypto.Generators;\nusing Org.BouncyCastle.Crypto.Parameters;\nusing Org.BouncyCastle.Math;\nusing Org.BouncyCastle.Security;\nusing System;\nusing System.Security.Cryptography;\n\nnamespace Tests.Diagnostics\n{\n    public class Program\n    {\n        private const int validKeySizeConst = 2048;\n        private const int invalidKeySizeConst = 1024;\n\n        private static readonly int validKeySize = 2048;\n        private static readonly int invalidKeySize = 1024;\n\n        public void ConstArgumentResolution()\n        {\n            const int localValidSize = 2048;\n            new RSACryptoServiceProvider(); // Noncompliant {{Use a key length of at least 2048 bits for RSA cipher algorithm.}}\n            new RSACryptoServiceProvider(new CspParameters()); // Noncompliant - has default key size of 1024\n            new RSACryptoServiceProvider(2048);\n            new RSACryptoServiceProvider(localValidSize);\n            new RSACryptoServiceProvider(validKeySizeConst);\n            new RSACryptoServiceProvider(validKeySize);\n            new RSACryptoServiceProvider(invalidKeySize); // Noncompliant\n\n            const int localInvalidSize = 1024;\n            new RSACryptoServiceProvider(1024); // Noncompliant {{Use a key length of at least 2048 bits for RSA cipher algorithm.}}\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            new RSACryptoServiceProvider(1024, new CspParameters()); // Noncompliant\n            new RSACryptoServiceProvider(invalidKeySizeConst); // Noncompliant\n            new RSACryptoServiceProvider(localInvalidSize); // Noncompliant\n\n            // https://github.com/SonarSource/sonar-dotnet/issues/6341\n            new RSACryptoServiceProvider { PersistKeyInCsp = false }; // Noncompliant\n        }\n    }\n\n    public class SystemSecurityCryptographyDSA\n    {\n        public void DefaultConstructors(CspParameters cspParameters)\n        {\n            var dsa1 = new DSACng(); // Compliant - default is 2048\n            var dsa2 = new DSACryptoServiceProvider(); // Noncompliant - default is 1024\n            var dsa3 = new DSACryptoServiceProvider(cspParameters); // Noncompliant - default is 1024\n            var dsa4 = new DSAOpenSsl(); // Compliant - default is 2048\n        }\n\n        public void CompliantKeySizeConstructors()\n        {\n            var dsa1 = new DSACng(3072);\n            var dsa2 = new DSAOpenSsl(2048);\n        }\n\n        public void NonCompliantKeySizeConstructors(CspParameters parameters)\n        {\n            var dsa1 = new DSACng(512); // Noncompliant {{Use a key length of at least 2048 bits for DSA cipher algorithm.}}\n            var dsa2 = new DSACryptoServiceProvider(512); // Noncompliant {{Use a key length of at least 2048 bits for DSA cipher algorithm.}}\n            var dsa3 = new DSACryptoServiceProvider(1024, parameters); // Noncompliant\n            var dsa4 = new DSACryptoServiceProvider(3072); // Noncompliant - this is not valid\n            var dsa5 = new DSACryptoServiceProvider(2048, parameters); // Noncompliant - this is not valid\n            var dsa6 = new DSAOpenSsl(1024); // Noncompliant\n        }\n\n        public void CompliantKeySizeSet()\n        {\n            var dsa1 = new DSACng();\n            dsa1.KeySize = 3072;\n\n            var dsa2 = new DSAOpenSsl();\n            dsa2.KeySize = 3072;\n        }\n\n        public void NoncompliantKeySizeSet()\n        {\n            var dsa1 = new DSACng();\n            dsa1.KeySize = 512; // Noncompliant {{Use a key length of at least 2048 bits for DSA cipher algorithm.}}\n\n            var dsa2 = new DSACryptoServiceProvider(); // Noncompliant\n            dsa2.KeySize = 2048; // Noncompliant {{Use a key length of at least 2048 bits for DSA cipher algorithm. This assignment does not update the underlying key size.}}\n//          ^^^^^^^^^^^^^^^^^^^\n            var dsa3 = new DSAOpenSsl();\n            dsa3.KeySize = 1024; // Noncompliant\n        }\n\n        public void CompliantCreate()\n        {\n            var dsa1 = DSA.Create();\n            var dsa2 = DSA.Create(2048);\n            var dsa3 = DSA.Create(3072);\n        }\n\n        public void NoncompliantCreate()\n        {\n            var dsa1 = DSA.Create(512); // Noncompliant {{Use a key length of at least 2048 bits for DSA cipher algorithm.}}\n            var dsa2 = DSA.Create(1024); // Noncompliant {{Use a key length of at least 2048 bits for DSA cipher algorithm.}}\n//                     ^^^^^^^^^^^^^^^^\n        }\n    }\n\n    public class SystemSecurityCryptographyRSA\n    {\n\n        public void DefaultConstructors()\n        {\n            var rsa1 = new RSACng(); // Compliant - default is 2048\n            var rsa2 = new RSACryptoServiceProvider(); // Noncompliant - default is 1024\n            var rsa3 = new RSAOpenSsl(); // Compliant - default is 2048\n        }\n\n        public void CompliantKeySizeConstructors(CspParameters parameters)\n        {\n            var rsa1 = new RSACng(2048);\n            var rsa2 = new RSACryptoServiceProvider(2048);\n            var rsa3 = new RSACryptoServiceProvider(3072, parameters);\n            var rsa4 = new RSAOpenSsl(3072);\n        }\n\n        public void NonCompliantKeySizeConstructors(CspParameters parameters)\n        {\n            var rsa1 = new RSACng(1024); // Noncompliant {{Use a key length of at least 2048 bits for RSA cipher algorithm.}}\n            var rsa2 = new RSACryptoServiceProvider(512); // Noncompliant\n            var rsa3 = new RSACryptoServiceProvider(1024, parameters); // Noncompliant\n            var rsa4 = new RSAOpenSsl(512); // Noncompliant {{Use a key length of at least 2048 bits for RSA cipher algorithm.}}\n        }\n\n        public void CompliantKeySizeSet()\n        {\n            var rsa1 = new RSACng();\n            rsa1.KeySize = 2048;\n\n            var rsa2 = new RSAOpenSsl();\n            rsa2.KeySize = 3072;\n        }\n\n        public void NoncompliantKeySizeSet()\n        {\n            var rsa1 = new RSACng();\n            rsa1.KeySize = 1024; // Noncompliant {{Use a key length of at least 2048 bits for RSA cipher algorithm.}}\n\n            var rsa3 = new RSACryptoServiceProvider(); // Noncompliant\n            rsa3.KeySize = 2048; // Noncompliant {{Use a key length of at least 2048 bits for RSA cipher algorithm. This assignment does not update the underlying key size.}}\n\n            var rsa4 = new RSAOpenSsl();\n            rsa4.KeySize = 512; // Noncompliant\n        }\n\n        public void CompliantCreate()\n        {\n            var rsa1 = RSA.Create();\n            var rsa2 = RSA.Create(2048);\n            var rsa3 = RSA.Create(3072);\n        }\n\n        public void NoncompliantCreate()\n        {\n            var rsa1 = RSA.Create(512); // Noncompliant {{Use a key length of at least 2048 bits for RSA cipher algorithm.}}\n            var rsa2 = RSA.Create(1024); // Noncompliant {{Use a key length of at least 2048 bits for RSA cipher algorithm.}}\n        }\n    }\n\n    public class SystemSecurityCryptographyEC\n    {\n        public void CompliantConstructors()\n        {\n            var ec1 = new ECDiffieHellmanCng(); // Compliant - default EC key size is 521\n            var ec2 = new ECDsaCng(); // Compliant - default EC key size is 521\n            var ec3 = new ECDsaOpenSsl(); // Compliant - default EC key size is 521\n\n            // Valid key sizes are 256, 384, and 521 bits.\n            var ec4 = new ECDiffieHellmanCng(256);\n            var ec5 = new ECDsaCng(384);\n            var ec6 = new ECDsaOpenSsl(521);\n            var ec7 = new ECDsaOpenSsl((IntPtr)128);\n\n            var ec8 = new ECDiffieHellmanCng(ECCurve.NamedCurves.brainpoolP384r1);\n            var ec9 = new ECDsaCng(ECCurve.NamedCurves.brainpoolP384t1);\n            var ec10 = new ECDsaOpenSsl(ECCurve.NamedCurves.brainpoolP512r1);\n        }\n\n        public void NonCompliantConstructors()\n        {\n            var ec1 = new ECDiffieHellmanCng(ECCurve.NamedCurves.brainpoolP192r1); // Noncompliant {{Use a key length of at least 224 bits for EC cipher algorithm.}}\n            var ec2 = new ECDsaCng(ECCurve.NamedCurves.brainpoolP160t1); // Noncompliant {{Use a key length of at least 224 bits for EC cipher algorithm.}}\n            var ec3 = new ECDsaOpenSsl(ECCurve.NamedCurves.brainpoolP192t1); // Noncompliant\n        }\n\n        public void CompliantKeySizeSet()\n        {\n            var ec1 = new ECDiffieHellmanCng();\n            ec1.KeySize = 512;\n            ec1.KeySize = 128; // OK - because this is not a valid key size for this object\n\n            var ec2 = new ECDsaCng();\n            ec2.KeySize = 512;\n            ec2.KeySize = 64; // OK - because this is not a valid key size for this object\n\n            var ec3 = new ECDsaOpenSsl();\n            ec3.KeySize = 512;\n            ec3.KeySize = 12; // OK - because this is not a valid key size for this object\n        }\n\n        public void CompliantGenerateKey()\n        {\n            var ec1 = new ECDiffieHellmanCng();\n            ec1.GenerateKey(ECCurve.NamedCurves.brainpoolP224r1);\n            ec1.GenerateKey(ECCurve.NamedCurves.nistP256);\n\n            var ec2 = new ECDsaCng();\n            ec2.GenerateKey(ECCurve.NamedCurves.brainpoolP256r1);\n            ec2.GenerateKey(ECCurve.NamedCurves.nistP384);\n\n            var ec3 = new ECDsaOpenSsl();\n            ec3.GenerateKey(ECCurve.NamedCurves.brainpoolP384t1);\n            ec3.GenerateKey(ECCurve.NamedCurves.nistP521);\n        }\n\n        public void NoncompliantGenerateKey()\n        {\n            var ec1 = new ECDiffieHellmanCng();\n            ec1.GenerateKey(ECCurve.NamedCurves.brainpoolP160r1); // Noncompliant {{Use a key length of at least 224 bits for EC cipher algorithm.}}\n\n            var ec2 = new ECDsaCng();\n            ec2.GenerateKey(ECCurve.NamedCurves.brainpoolP160t1); // Noncompliant {{Use a key length of at least 224 bits for EC cipher algorithm.}}\n        }\n\n        public void CompliantCreate()\n        {\n            var ec1 = ECDiffieHellman.Create();\n            var ec2 = ECDiffieHellman.Create(ECCurve.NamedCurves.brainpoolP256r1);\n            var ec3 = ECDiffieHellman.Create(ECCurve.NamedCurves.nistP256);\n\n            var ec4 = ECDsa.Create();\n            var ec5 = ECDsa.Create(ECCurve.NamedCurves.brainpoolP384t1);\n            var ec6 = ECDsa.Create(ECCurve.NamedCurves.nistP521);\n        }\n\n        public void NoncompliantCreate()\n        {\n            var ec1 = ECDiffieHellman.Create(ECCurve.NamedCurves.brainpoolP192t1); // Noncompliant {{Use a key length of at least 224 bits for EC cipher algorithm.}}\n            var ec2 = ECDsa.Create(ECCurve.NamedCurves.brainpoolP160r1); // Noncompliant {{Use a key length of at least 224 bits for EC cipher algorithm.}}\n        }\n    }\n\n    public class SystemSecurityCryptographyAES\n    {\n        public void CompliantAES()\n        {\n            AesManaged aes1 = new AesManaged\n            {\n                KeySize = 128, // Compliant\n                BlockSize = 128,\n                Mode = CipherMode.CBC,\n                Padding = PaddingMode.PKCS7\n            };\n\n            AesCryptoServiceProvider aes2 = new AesCryptoServiceProvider();\n            aes2.KeySize = 128; // Compliant\n\n            AesCng aes3 = new AesCng();\n            aes3.KeySize = 128; // Compliant\n\n            AesManaged aes4 = new AesManaged\n            {\n                KeySize = 64, // OK - ignore as it is not possible to create AES instance with smaller than 128 key size\n                BlockSize = 128,\n                Mode = CipherMode.CBC,\n                Padding = PaddingMode.PKCS7\n            };\n\n            AesCryptoServiceProvider aes5 = new AesCryptoServiceProvider();\n            aes5.KeySize = 64; // OK - ignore as it is not possible to create AES instance with smaller than 128 key size\n\n            AesCng aes6 = new AesCng();\n            aes6.KeySize = 64; // OK - ignore as it is not possible to create AES instance with smaller than 128 key size\n        }\n    }\n\n    public class BouncyCastleCryptography\n    {\n        public void CompliantParametersGenerator()\n        {\n            var pGen1 = new DHParametersGenerator();\n            pGen1.Init(2048, 10, new SecureRandom()); // Compliant\n\n            var pGen2 = new DsaParametersGenerator();\n            pGen2.Init(2048, 80, new SecureRandom()); // Compliant\n\n            var kp1 = new ECKeyPairGenerator(); // OK - ignore for now\n\n            var kp2 = new DsaKeyPairGenerator();\n            var d2 = new DsaParameters(new BigInteger(\"2\"), new BigInteger(\"2\"), new BigInteger(\"2\")); // FN\n            var r2 = new DsaKeyGenerationParameters(new SecureRandom(), d2);\n            kp2.Init(r2);\n\n            var kp3 = new RsaKeyPairGenerator();\n            var r3 = new RsaKeyGenerationParameters(new BigInteger(\"2\"), new SecureRandom(), 2048, 5); // Compliant\n            kp3.Init(r3);\n        }\n\n        public void NoncompliantParametersGenerator(int arg)\n        {\n            var pGen1 = new DHParametersGenerator();\n            pGen1.Init(1024, 10, new SecureRandom()); // Noncompliant {{Use a key length of at least 2048 bits for DH cipher algorithm.}}\n\n            var pGen2 = new DsaParametersGenerator();\n            pGen2.Init(1024, 80, new SecureRandom()); // Noncompliant {{Use a key length of at least 2048 bits for DSA cipher algorithm.}}\n\n            var kp3 = new RsaKeyPairGenerator();\n            var r3 = new RsaKeyGenerationParameters(new BigInteger(\"1\"), new SecureRandom(), 1024, 5); // Noncompliant {{Use a key length of at least 2048 bits for RSA cipher algorithm.}}\n            kp3.Init(r3);\n\n            pGen1.Init(arg, 10, new SecureRandom());     // Compliant\n            var keySize = 4096;\n            pGen1.Init(keySize, 10, new SecureRandom()); // Compliant\n            keySize = 1024;\n            pGen1.Init(keySize, 10, new SecureRandom()); // Noncompliant\n        }\n\n        public void CompliantGetByName()\n        {\n            X9ECParameters curve = null;\n\n            curve = SecNamedCurves.GetByName(\"secp224k1\"); // Compliant\n            curve = SecNamedCurves.GetByName(\"secp224r1\"); // Compliant\n            curve = SecNamedCurves.GetByName(\"secp256k1\"); // Compliant\n            curve = SecNamedCurves.GetByName(\"secp256r1\"); // Compliant\n            curve = SecNamedCurves.GetByName(\"secp384r1\"); // Compliant\n            curve = SecNamedCurves.GetByName(\"secp521r1\"); // Compliant\n            curve = SecNamedCurves.GetByName(\"sect233k1\"); // Compliant\n            curve = SecNamedCurves.GetByName(\"sect233r1\"); // Compliant\n            curve = SecNamedCurves.GetByName(\"sect239k1\"); // Compliant\n            curve = SecNamedCurves.GetByName(\"sect283k1\"); // Compliant\n            curve = SecNamedCurves.GetByName(\"sect283r1\"); // Compliant\n            curve = SecNamedCurves.GetByName(\"sect409k1\"); // Compliant\n            curve = SecNamedCurves.GetByName(\"sect409r1\"); // Compliant\n            curve = SecNamedCurves.GetByName(\"sect571k1\"); // Compliant\n            curve = SecNamedCurves.GetByName(\"sect571r1\"); // Compliant\n\n            curve = X962NamedCurves.GetByName(\"prime239v1\"); // Compliant\n            curve = X962NamedCurves.GetByName(\"prime239v2\"); // Compliant\n            curve = X962NamedCurves.GetByName(\"prime239v3\"); // Compliant\n            curve = X962NamedCurves.GetByName(\"prime256v1\"); // Compliant\n            curve = X962NamedCurves.GetByName(\"c2tnb239v1\"); // Compliant\n            curve = X962NamedCurves.GetByName(\"c2tnb239v2\"); // Compliant\n            curve = X962NamedCurves.GetByName(\"c2tnb239v3\"); // Compliant\n            curve = X962NamedCurves.GetByName(\"c2pnb272w1\"); // Compliant\n            curve = X962NamedCurves.GetByName(\"c2pnb304w1\"); // Compliant\n            curve = X962NamedCurves.GetByName(\"c2tnb359v1\"); // Compliant\n            curve = X962NamedCurves.GetByName(\"c2pnb368w1\"); // Compliant\n            curve = X962NamedCurves.GetByName(\"c2tnb431r1\"); // Compliant\n\n            curve = TeleTrusTNamedCurves.GetByName(\"brainpoolp224r1\"); // Compliant\n            curve = TeleTrusTNamedCurves.GetByName(\"brainpoolp224t1\"); // Compliant\n            curve = TeleTrusTNamedCurves.GetByName(\"brainpoolp256r1\"); // Compliant\n            curve = TeleTrusTNamedCurves.GetByName(\"brainpoolp256t1\"); // Compliant\n            curve = TeleTrusTNamedCurves.GetByName(\"brainpoolp320r1\"); // Compliant\n            curve = TeleTrusTNamedCurves.GetByName(\"brainpoolp320t1\"); // Compliant\n            curve = TeleTrusTNamedCurves.GetByName(\"brainpoolp384r1\"); // Compliant\n            curve = TeleTrusTNamedCurves.GetByName(\"brainpoolp384t1\"); // Compliant\n            curve = TeleTrusTNamedCurves.GetByName(\"brainpoolp512r1\"); // Compliant\n            curve = TeleTrusTNamedCurves.GetByName(\"brainpoolp512t1\"); // Compliant\n\n            curve = SecNamedCurves.GetByName(\"GostR3410-2001-CryptoPro-A\"); // Compliant\n            curve = SecNamedCurves.GetByName(\"GostR3410-2001-CryptoPro-XchB\"); // Compliant\n            curve = SecNamedCurves.GetByName(\"GostR3410-2001-CryptoPro-XchA\"); // Compliant\n            curve = SecNamedCurves.GetByName(\"GostR3410-2001-CryptoPro-C\"); // Compliant\n            curve = SecNamedCurves.GetByName(\"GostR3410-2001-CryptoPro-B\"); // Compliant\n\n            curve = NistNamedCurves.GetByName(\"B-233\"); // Compliant\n            curve = NistNamedCurves.GetByName(\"B-283\"); // Compliant\n            curve = NistNamedCurves.GetByName(\"B-409\"); // Compliant\n            curve = NistNamedCurves.GetByName(\"B-571\"); // Compliant\n            curve = NistNamedCurves.GetByName(\"K-233\"); // Compliant\n            curve = NistNamedCurves.GetByName(\"K-283\"); // Compliant\n            curve = NistNamedCurves.GetByName(\"K-409\"); // Compliant\n            curve = NistNamedCurves.GetByName(\"K-571\"); // Compliant\n            curve = NistNamedCurves.GetByName(\"P-224\"); // Compliant\n            curve = NistNamedCurves.GetByName(\"P-256\"); // Compliant\n            curve = NistNamedCurves.GetByName(\"P-384\"); // Compliant\n            curve = NistNamedCurves.GetByName(\"P-521\"); // Compliant\n\n            curve = ECNamedCurveTable.GetByName(\"prime239v1\"); // Compliant\n            curve = ECNamedCurveTable.GetByName(\"secp224k1\"); // Compliant\n            curve = ECNamedCurveTable.GetByName(\"c2tnb239v1\"); // Compliant\n            curve = ECNamedCurveTable.GetByName(\"brainpoolp320t1\"); // Compliant\n            curve = ECNamedCurveTable.GetByName(\"GostR3410-2001-CryptoPro-XchA\"); // Compliant\n            curve = ECNamedCurveTable.GetByName(\"P-521\"); // Compliant\n            curve = ECNamedCurveTable.GetByName(\"RandomString\"); // Compliant\n        }\n\n        public void NoncompliantGetByName(string arg)\n        {\n            X9ECParameters curve = null;\n\n            // Elliptic curves always have the key length as part of their names. Rule implementation looks for this\n            // key length pattern, so that all curves with a key length smaller than 224 will raise an issue\n            curve = SecNamedCurves.GetByName(\"secp192k1\"); // Noncompliant {{Use a key length of at least 224 bits for EC cipher algorithm.}}\n            curve = SecNamedCurves.GetByName(\"secp192r1\"); // Noncompliant\n            curve = SecNamedCurves.GetByName(\"sect163k1\"); // Noncompliant\n            curve = SecNamedCurves.GetByName(\"sect163r1\"); // Noncompliant\n            curve = SecNamedCurves.GetByName(\"sect163r2\"); // Noncompliant\n            curve = SecNamedCurves.GetByName(\"sect193r1\"); // Noncompliant\n            curve = SecNamedCurves.GetByName(\"sect193r2\"); // Noncompliant\n\n            curve = X962NamedCurves.GetByName(\"prime192v1\"); // Noncompliant\n            curve = X962NamedCurves.GetByName(\"prime192v2\"); // Noncompliant\n            curve = X962NamedCurves.GetByName(\"prime192v3\"); // Noncompliant\n            curve = X962NamedCurves.GetByName(\"c2pnb163v1\"); // Noncompliant\n            curve = X962NamedCurves.GetByName(\"c2pnb163v2\"); // Noncompliant\n            curve = X962NamedCurves.GetByName(\"c2pnb163v3\"); // Noncompliant\n            curve = X962NamedCurves.GetByName(\"c2pnb176w1\"); // Noncompliant\n            curve = X962NamedCurves.GetByName(\"c2tnb191v1\"); // Noncompliant\n            curve = X962NamedCurves.GetByName(\"c2tnb191v2\"); // Noncompliant\n            curve = X962NamedCurves.GetByName(\"c2tnb191v3\"); // Noncompliant\n            curve = X962NamedCurves.GetByName(\"c2pnb208w1\"); // Noncompliant\n\n            curve = TeleTrusTNamedCurves.GetByName(\"brainpoolp160r1\"); // Noncompliant\n            curve = TeleTrusTNamedCurves.GetByName(\"brainpoolp160t1\"); // Noncompliant\n            curve = TeleTrusTNamedCurves.GetByName(\"brainpoolp192r1\"); // Noncompliant\n            curve = TeleTrusTNamedCurves.GetByName(\"brainpoolp192t1\"); // Noncompliant\n\n            curve = NistNamedCurves.GetByName(\"B-163\"); // Noncompliant\n            curve = NistNamedCurves.GetByName(\"K-163\"); // Noncompliant\n            curve = NistNamedCurves.GetByName(\"P-192\"); // Noncompliant\n\n            curve = ECNamedCurveTable.GetByName(\"secp192k1\"); // Noncompliant\n            curve = ECNamedCurveTable.GetByName(\"c2pnb208w1\"); // Noncompliant\n            curve = ECNamedCurveTable.GetByName(\"brainpoolp192t1\"); // Noncompliant\n            curve = ECNamedCurveTable.GetByName(\"B-163\"); // Noncompliant\n\n            ECNamedCurveTable.GetByName(arg);       // Compliant\n            var variable = \"RandomString\";\n            ECNamedCurveTable.GetByName(variable);  // Compliant\n            variable = \"B-163\";\n            ECNamedCurveTable.GetByName(variable);  // Noncompliant\n        }\n    }\n\n    public class CustomCryptography : RSA\n    {\n        public void UseCompliantKeyLength()\n        {\n            this.KeySize = 2048;\n        }\n\n        public void UseNoncompliantKeyLength()\n        {\n            this.KeySize = 1024; // Noncompliant {{Use a key length of at least 2048 bits for RSA cipher algorithm.}}\n            KeySize = 1024; // FN - we only look at MemberAccessExpressionSyntax for simplicity\n        }\n\n        public override RSAParameters ExportParameters(bool includePrivateParameters)\n        {\n            throw new NotImplementedException();\n        }\n\n        public override void ImportParameters(RSAParameters parameters)\n        {\n            throw new NotImplementedException();\n        }\n    }\n\n    public class CustomClassWithSameMethods\n    {\n        public int KeySize { get; set; }\n\n        public void Create() { }\n        public void Create(int value) { }\n        public void Create(ECCurve value) { }\n        public void Create(string value) { }\n        public void GenerateKey() { }\n        public void GenerateKey(ECCurve value) { }\n        public void GenerateKey(string value) { }\n        public void GetByName() { }\n        public void GetByName(string value) { }\n        public void GetByName(bool value) { }\n        public void Init() { }\n        public void Init(int value) { }\n        public void Init(string value) { }\n        public void AnotherMethod() { }\n\n        public void Test()\n        {\n            this.Create();\n            this.Create(64);\n            this.Create(ECCurve.NamedCurves.brainpoolP160t1);\n            this.Create(\"brainpoolP160t1\");\n\n            this.GenerateKey();\n            this.GenerateKey(ECCurve.NamedCurves.brainpoolP160t1);\n            this.GenerateKey(\"brainpoolP160t1\");\n\n            this.GetByName();\n            this.GetByName(\"brainpoolP160t1\");\n            this.GetByName(true);\n\n            this.Init();\n            this.Init(64);\n            this.Init(\"64\");\n\n            this.AnotherMethod();\n            var KeySize = 64;\n            this.KeySize = 64;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DangerousGetHandleShouldNotBeCalled.CSharp9.cs",
    "content": "﻿using System;\nusing System.Runtime.InteropServices;\n\nSafeHandle handle = null;\nIntPtr dangerousHandle = handle.DangerousGetHandle(); // Noncompliant {{Refactor the code to remove this use of 'SafeHandle.DangerousGetHandle'.}}\n\nrecord R\n{\n    IntPtr Foo(SafeHandle handle) => handle.DangerousGetHandle(); // Noncompliant\n\n    Func<SafeHandle, IntPtr> StaticLambda() => (SafeHandle h) => h.DangerousGetHandle(); // Noncompliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DangerousGetHandleShouldNotBeCalled.cs",
    "content": "﻿using System;\nusing System.Runtime.InteropServices;\nusing Microsoft.Win32;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        private static IntPtr GetRegistryKeyHandle(RegistryKey rKey)\n        {\n            Type registryKeyType = typeof(RegistryKey);\n\n            System.Reflection.FieldInfo fieldInfo =\n                registryKeyType.GetField(\"hkey\", System.Reflection.BindingFlags.NonPublic |\n                System.Reflection.BindingFlags.Instance);\n\n            if (fieldInfo != null)\n            {\n                SafeHandle handle = (SafeHandle)fieldInfo.GetValue(rKey);\n                IntPtr dangerousHandle = handle.DangerousGetHandle(); // Noncompliant {{Refactor the code to remove this use of 'SafeHandle.DangerousGetHandle'.}}\n//                                              ^^^^^^^^^^^^^^^^^^\n                IntPtr dangerousHandle2 = (((handle))).DangerousGetHandle(); // Noncompliant\n                IntPtr? dangerousHandle3 = handle?.DangerousGetHandle(); // Noncompliant\n                DangerousGetHandle();\n                return dangerousHandle;\n            }\n\n            return IntPtr.Zero;\n        }\n\n        private static IntPtr DangerousGetHandle()\n        {\n            return IntPtr.Zero;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DangerousGetHandleShouldNotBeCalled.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.Linq\nImports System.Text\nImports System.Runtime.InteropServices\n\nModule Tests\n\n  Sub Dangerous(fieldInfo As System.Reflection.FieldInfo)\n    Dim handle As SafeHandle = CType(fieldInfo.GetValue(fieldInfo), SafeHandle)\n    Dim dangerousHandle As IntPtr = handle.DangerousGetHandle() ' Noncompliant {{Refactor the code to remove this use of 'SafeHandle.DangerousGetHandle'.}}\n'                                          ^^^^^^^^^^^^^^^^^^\n    handle.DangerousGetHandle() ' Noncompliant\n  End Sub\n\n  Public Sub Test(bar As Bar)\n    Dim dangerousHandle As IntPtr = bar.DangerousHandle() ' compliant\n  End Sub\n\n  Class Bar\n    Sub Test()\n      DangerousHandle()\n    End Sub\n    Function DangerousHandle() As IntPtr\n    End Function\n  End Class\nEnd Module\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DatabasePasswordsShouldBeSecure.Latest.cs",
    "content": "﻿namespace TestFrameworkExtensions\n{\n    using System.Data.Common;\n    using Microsoft.EntityFrameworkCore;\n\n    public class NoncompliantDbContext : DbContext\n    {\n        private DbContextOptionsBuilder builder;\n\n        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)\n        {\n            optionsBuilder.UseSqlite(\"\"\"Password=Server=myServerAddress\"\"\"); // Compliant, inside we only look at 'Password=;'\n            optionsBuilder.UseSqlServer(\"\"\"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=\"\"\"); // Noncompliant {{Use a secure password when connecting to this database.}}\n\n            string[] test = new string[] { \"FirstTest\", \"SecondTest\" };\n\n            optionsBuilder.UseSqlServer($\"\"\"Server={test[0]};Database=myDataBase;User Id=myUsername;Password=\"\"\"); // Noncompliant\n\n            optionsBuilder.UseSqlServer($\"Server={test\n                [0]};Database=myDataBase;User Id=myUsername;Password=\"); // Noncompliant@-1 {{Use a secure password when connecting to this database.}}\n            optionsBuilder.UseSqlServer($\"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password={test\n                [1]}\"); // Compliant\n\n            optionsBuilder.UseSqlServer($$\"\"\"Server={{test\n                [0]}};Database=myDataBase;User Id=myUsername;Password=\"\"\"); // Noncompliant@-1\n            optionsBuilder.UseSqlServer($$\"\"\"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password={{test\n                [1]}}\"\"\"); // Compliant\n\n            var charLiteralEscape = '\\e';\n            optionsBuilder.UseSqlServer(\"Server=Server;Password=\" + \"\\e\"); // Compliant\n            optionsBuilder.UseSqlServer(\"Server=Server;Password=\" + \"\\easda\"); // Compliant\n            optionsBuilder.UseSqlServer(\"Server=Server;Password=\" + charLiteralEscape); // Compliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DatabasePasswordsShouldBeSecure.Net5.cs",
    "content": "﻿namespace TestFrameworkExtensions\n{\n    using Microsoft.EntityFrameworkCore;\n\n    public class NoncompliantDbContext : DbContext\n    {\n        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)\n        {\n            optionsBuilder.UseSqlServer();\n            optionsBuilder.UseNpgsql();\n            optionsBuilder.UseSqlite();\n            optionsBuilder.UseOracle();\n            optionsBuilder.UseMySQL(); // Error [CS1501]\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DatabasePasswordsShouldBeSecure.NetCore31.cs",
    "content": "﻿namespace TestFrameworkExtensions\n{\n    using Microsoft.EntityFrameworkCore;\n\n    public class NoncompliantDbContext : DbContext\n    {\n        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)\n        {\n            optionsBuilder.UseSqlServer(); // Error [CS1501]\n            optionsBuilder.UseNpgsql(); // Error [CS1501]\n            optionsBuilder.UseSqlite(); // Error [CS1501]\n            optionsBuilder.UseOracle(); // Error [CS1501]\n            optionsBuilder.UseMySQL(); // Error [CS1501]\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DatabasePasswordsShouldBeSecure.cs",
    "content": "﻿namespace TestFrameworkExtensions\n{\n    using System.Data.Common;\n    using Microsoft.EntityFrameworkCore;\n\n    public class NoncompliantDbContext : DbContext\n    {\n        private DbContextOptionsBuilder builder;\n        private DbContextOptionsBuilder getBuilder() => null;\n\n        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)\n        {\n            optionsBuilder.UseSqlServer(\"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=\"); // Noncompliant {{Use a secure password when connecting to this database.}}\n            optionsBuilder.UseNpgsql(\"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=\"); // Noncompliant\n            optionsBuilder.UseMySQL(\"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=\"); // Noncompliant\n            optionsBuilder.UseSqlite(\"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=\"); // Noncompliant\n            optionsBuilder.UseOracle(\"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=\"); // Noncompliant\n\n            builder.UseSqlServer(\"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=\"); // Noncompliant\n            builder.UseNpgsql(\"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=\"); // Noncompliant\n            builder.UseMySQL(\"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=\"); // Noncompliant\n            builder.UseOracle(\"aPassword=\"); // Noncompliant FP\n            builder.UseMySQL(\"aPassword=;\"); // Noncompliant FP\n\n            optionsBuilder.UseSqlServer(sqlServerOptionsAction: null, connectionString: \"Password=\"); // Noncompliant\n\n            getBuilder().UseSqlServer(\"Password=\"); // Noncompliant\n\n            optionsBuilder.UseSqlite(\"Password=Server=myServerAddress\"); // Compliant, inside we only look at 'Password=;'\n            builder.UseMySQL(\"Password=password\"); // compliant, not empty\n\n            optionsBuilder.UseSqlServer(\"Server=myServerAddress;Database=myDataBase;Integrated Security=False;Password=\"); // Noncompliant\n            optionsBuilder.UseSqlServer(\"Server=myServerAddress;Database=myDataBase;Integrated Security=false;Password=\"); // Noncompliant\n            optionsBuilder.UseSqlServer(\"Server=myServerAddress;Database=myDataBase;Trusted_Connection=no;Password=\"); // Noncompliant\n            optionsBuilder.UseSqlServer(\"Server=myServerAddress;Database=myDataBase;Trusted_Connection=foo;Password=\"); // Noncompliant\n            optionsBuilder.UseSqlServer(\"Server=myServerAddress;Database=myDataBase;Integrated Security=maybe;Password=\"); // Noncompliant\n        }\n\n        protected void Method(DbContextOptionsBuilder<NoncompliantDbContext> genericBuilder)\n        {\n            genericBuilder.UseSqlServer(\"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=\"); // Noncompliant\n            genericBuilder.UseNpgsql(npgsqlOptionsAction: null, connectionString: \"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=\"); // Noncompliant\n            genericBuilder.UseMySQL(MySQLOptionsAction: null, connectionString: \"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=\"); // Noncompliant\n        }\n\n        public void ExplicitInvocation(DbContextOptionsBuilder optionsBuilder)\n        {\n            SqlServerDbContextOptionsExtensions.UseSqlServer(optionsBuilder, \"Password=\"); // Noncompliant\n        }\n\n        public void StringConcatAndInterpolation(string a)\n        {\n            builder.UseSqlServer(\"x\" + \"y\" + \"Password=\"); // Noncompliant\n            builder.UseSqlServer(\"x\" + \"y\" + \"Password=;\"); // Noncompliant\n            builder.UseOracle(\"x\" + \"y\" + \"Password=;\" + \"z\"); // Noncompliant\n            builder.UseSqlServer(\"x\" + \"y\" + \"a;Password=;y\" + \"z\"); // Noncompliant\n            builder.UseSqlServer(\"x\" + \"y\" + \"Password=\" + a);\n            builder.UseSqlServer(\"x\" + \"y\" + \"Password=\" + \"\"); // FN, edge case\n            builder.UseSqlServer(\"x\" + \"y\" + \"Password=\" + \";\"); // FN, edge case\n            builder.UseSqlite(\"x\" + \"y\" + \"Password=;\" + a); // Noncompliant\n            builder.UseNpgsql($\"Server={a};Database={a};User Id={a};Password=\"); // Noncompliant\n            builder.UseOracle($\"Server={a};Database={a};User Id={a};Password=;Something={a}\"); // Noncompliant\n            builder.UseSqlite($\"Server={a};Database={a}\" + $\";User Id={a};Password=;Foo\" + $\"Something={a}\"); // Noncompliant\n\n            builder.UseNpgsql($\"Server={a};Database={a};User Id={a};Password={a}\"); // compliant\n            builder.UseNpgsql($\"Server={a};Database={a};User Id={a};Password=\" + a); // compliant\n\n            // This FP is tolerated in order to keep the implementation simple\n            builder.UseSqlServer(\"Password=\\\"\"); // Noncompliant FP\n            builder.UseSqlServer(\"Password=\\\"mypassword\\\"\"); // compliant, not empty\n        }\n\n        private const string USED_CONNECT_STRING = \"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=\"; // FN\n        private const string NOT_USED = \"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=\";\n        public void ConstantPropagation()\n        {\n            var used = \"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=\";\n            var notUsed = \"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=\";\n            builder.UseMySQL(used);\n            builder.UseNpgsql(USED_CONNECT_STRING);\n        }\n\n        public void MethodResult()\n        {\n            builder.UseMySQL(BuildConnection()); // FN\n            static string BuildConnection() => \"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=\";\n        }\n\n        public void Compliant(DbContextOptionsBuilder optionsBuilder, string password, DbConnection dbConnection)\n        {\n            // https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/connection-string-syntax#windows-authentication\n            optionsBuilder.UseSqlServer(\"Server=myServerAddress;Database=myDataBase;Integrated Security=SSPI\");\n            optionsBuilder.UseSqlServer(\"Server=myServerAddress;Database=myDataBase;Integrated Security=True\");\n            optionsBuilder.UseSqlServer(\"Server=myServerAddress;Database=myDataBase;Trusted_Connection=true\");\n            optionsBuilder.UseSqlServer(\"Server=myServerAddress;Database=myDataBase;Trusted_Connection=yes\");\n\n            optionsBuilder.UseSqlServer(\"Password=Foo\"); // not empty\n            optionsBuilder.UseSqlServer(\"Password = \"); // FN, has spaces\n\n            // Integrated Security overrides, not vulnerable.\n            // We don't actually map the correct parameters to the provider, we keep things simple (and may have FNs)\n            optionsBuilder.UseSqlServer(\"Server=myServerAddress;Database=myDataBase;Integrated Security=SSPI;Password=\");\n            optionsBuilder.UseSqlServer(\"Server=myServerAddress;Database=myDataBase;Integrated Security=true;Password=;\");\n            optionsBuilder.UseSqlServer(\"Server=myServerAddress;Database=myDataBase;Integrated SECURITY=TRUE;Password=;\");\n            optionsBuilder.UseMySQL(\"Server=myServerAddress;Database=myDataBase;Integrated Security=yes;Password=;\"); // FN, \"yes\" is for OracleClient\n            optionsBuilder.UseNpgsql(\"Server=myServerAddress;Database=myDataBase;Trusted_Connection=yes;Password=;\");\n            optionsBuilder.UseNpgsql(\"Server=myServerAddress;Database=myDataBase;TRUSTED_CONNECTION=YES;Password=;\");\n            optionsBuilder.UseSqlite(\"Server=myServerAddress;Database=myDataBase;Password=;Trusted_Connection=yes\");\n            optionsBuilder.UseSqlServer(\"Server=myServerAddress;Database=myDataBase;Password=;Trusted_Connection=True\");\n            optionsBuilder.UseSqlServer(\"Server=myServerAddress;Database=myDataBase;Password=;Trusted Connection=True\");\n            optionsBuilder.UseSqlServer(\"Server=myServerAddress;Database=myDataBase;Password=;Integrated Security=true\");\n            optionsBuilder.UseSqlServer(\"Server=myServerAddress;Database=myDataBase;Password=;Trusted Connection=Yes\");\n            optionsBuilder.UseSqlServer(\"Server=myServerAddress;Database=myDataBase;Password=;Integrated Security=yes\");\n            optionsBuilder.UseSqlServer(\"Server=myServerAddress;Database=myDataBase;Password=;Integrated Security=SSPI\");\n            optionsBuilder.UseSqlServer(\"Server=myServerAddress;Database=myDataBase;Password=;Trusted_Connection=True\");\n            optionsBuilder.UseSqlServer(\"Server=myServerAddress;Database=myDataBase;Password=;Integrated_Security=true\");\n            optionsBuilder.UseSqlServer(\"Server=myServerAddress;Database=myDataBase;Password=;Trusted_Connection=Yes\");\n            optionsBuilder.UseSqlServer(\"Server=myServerAddress;Database=myDataBase;Password=;Integrated_Security=yes\");\n            optionsBuilder.UseSqlServer(\"Server=myServerAddress;Database=myDataBase;Password=;Integrated_Security=sspi\");\n            optionsBuilder.UseSqlServer(\"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=myPassword\");\n\n            optionsBuilder.UseSqlServer(\"Server=myServerAddress;Database=myDataBase;Integrated Security=False;Password=123\");\n            optionsBuilder.UseSqlServer(\"Server=myServerAddress;Database=myDataBase;Trusted_Connection=no;Password=123\");\n\n            optionsBuilder.UseSqlite(dbConnection);\n        }\n    }\n}\n\nnamespace CustomCode\n{\n    using Microsoft.EntityFrameworkCore;\n\n    public static class OptionsBuilderExtensions\n    {\n        public static DbContextOptionsBuilder UseSqlServer(this DbContextOptionsBuilder optionsBuilder, string connectionString) => optionsBuilder;\n        public static DbContextOptionsBuilder UseNpgsql(this DbContextOptionsBuilder optionsBuilder, string connectionString) => optionsBuilder;\n        public static DbContextOptionsBuilder UseMySQL(this DbContextOptionsBuilder optionsBuilder, string connectionString) => optionsBuilder;\n    }\n\n    public class Foo\n    {\n        public void UseSqlServer(string connectionString) { }\n    }\n}\n\nnamespace TestCustomCode\n{\n    using CustomCode;\n\n    public class CustomCodeSameName : Microsoft.EntityFrameworkCore.DbContext\n    {\n        Foo foo;\n        protected override void OnConfiguring(Microsoft.EntityFrameworkCore.DbContextOptionsBuilder optionsBuilder)\n        {\n            optionsBuilder.UseSqlServer(\"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=\");\n            optionsBuilder.UseNpgsql(\"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=\");\n            optionsBuilder.UseMySQL(\"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=\");\n            Foo(\"Password=\");\n            Foo(\"Password=;\");\n            Foo($\"Password=;\");\n            Foo(\"a\" + \"Password=;\" + \"a\");\n\n            foo.UseSqlServer(\"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=\");\n        }\n\n        void Foo(string s) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DateAndTimeShouldNotBeUsedasTypeForPrimaryKey.EntityFrameworkCore.cs",
    "content": "﻿using Microsoft.EntityFrameworkCore;\nusing System;\n\n// DateOnly and TimeOnly types are available in .NET 6+\nclass TemporalTypes\n{\n    class DateOnlyKey\n    {\n        public DateOnly Id { get; set; }            // Noncompliant\n    }\n\n    class TimeOnlyKey\n    {\n        public TimeOnly Id { get; set; }            // Noncompliant\n    }\n}\n\nclass ClassWithPrimaryKeyAttribute\n{\n    // The PrimaryKey attribute was introduced in Entity Framework 7.0.\n    // While it's possible to create a key for a single property with this attribute, it's mainly created to create composite keys.\n    [PrimaryKey(nameof(KeyProperty))]\n    class PrimaryKeyWithSingleProperty\n    {\n        public DateTime KeyProperty { get; set; }   // FN - possible, but unlikely scenario\n    }\n\n    [PrimaryKey(nameof(DateProperty), nameof(IntProperty))]\n    class PrimaryKeyWithMultipleProperties\n    {\n        public DateTime DateProperty { get; set; }  // Compliant - the rule will not raise warnings when a temporal type is part of a composite key\n        public int IntProperty { get; set; }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DateAndTimeShouldNotBeUsedasTypeForPrimaryKey.EntityFrameworkCore.vb",
    "content": "﻿Imports Microsoft.EntityFrameworkCore\nImports System\n\n' DateOnly and TimeOnly types are available in .NET 6+\nClass TemporalTypes\n    Class DateOnlyKey\n        Public Property Id As DateOnly            ' Noncompliant\n    End Class\n\n    Class TimeOnlyKey\n        Public Property Id As TimeOnly            ' Noncompliant\n    End Class\nEnd Class\n\nClass ClassWithPrimaryKeyAttribute\n    ' The PrimaryKey attribute was introduced in Entity Framework 7.0.\n    ' While it's possible to create a key for a single property with this attribute, it's mainly created to create composite keys.\n    <PrimaryKey(NameOf(PrimaryKeyWithSingleProperty.KeyProperty))>\n    Class PrimaryKeyWithSingleProperty\n        Public Property KeyProperty As Date   ' FN - possible, but unlikely scenario\n    End Class\n\n    <PrimaryKey(NameOf(PrimaryKeyWithMultipleProperties.DateProperty), NameOf(PrimaryKeyWithMultipleProperties.IntProperty))>\n    Class PrimaryKeyWithMultipleProperties\n        Public Property DateProperty As Date  ' Compliant - the rule will not raise warnings when a temporal type is part of a composite key\n        Public Property IntProperty As Integer\n    End Class\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DateAndTimeShouldNotBeUsedasTypeForPrimaryKey.FluentApi.cs",
    "content": "﻿using System;\nusing Microsoft.EntityFrameworkCore;\n\nclass FluentApi\n{\n    class PersonDbContext: DbContext\n    {\n        public DbSet<Person> People { get; set; }\n\n        protected override void OnModelCreating(ModelBuilder modelBuilder)\n        {\n            modelBuilder.Entity<Person>()\n                .HasKey(x => x.DateOfBirth);\n        }\n    }\n\n    class Person\n    {\n        public DateTime DateOfBirth { get; set; }       // FN - keys created with the Fluent API are too complex to track\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DateAndTimeShouldNotBeUsedasTypeForPrimaryKey.FluentApi.vb",
    "content": "﻿Imports Microsoft.EntityFrameworkCore\nImports System\n\nClass FluentApi\n    Class PersonDbContext\n        Inherits DbContext\n        Public Property People As DbSet(Of Person)\n\n        Protected Overrides Sub OnModelCreating(ByVal modelBuilder As ModelBuilder)\n            modelBuilder.Entity(Of Person)().HasKey(Function(x) x.DateOfBirth)\n        End Sub\n    End Class\n\n    Class Person\n        Public Property DateOfBirth As Date       ' FN - keys created with the Fluent API are too complex to track\n    End Class\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DateAndTimeShouldNotBeUsedasTypeForPrimaryKey.Latest.cs",
    "content": "﻿using System;\n\n// Record types aren't appropriate to use as entities,\n// as Entity Framework depends on reference equality.\n// https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/types/records\nrecord RecordEntity\n{\n    public DateTime Id { get; set; } // Compliant\n}\n\nclass Entity { }\n\nstatic class Extensions\n{\n    extension(Entity entity)\n    {\n        public DateTime Id { get => default; set { } }  // Compliant\n    }\n}\n\nclass FieldKeyWord\n{\n    public DateTime Id  // Noncompliant\n    {\n        get => field;\n        set => field = value;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DateAndTimeShouldNotBeUsedasTypeForPrimaryKey.NoReferenceToEntityFramework.cs",
    "content": "﻿using System;\n\nclass Entity\n{\n    public DateTime EntityId { get; set; }  // Compliant - the Entity Framework library is not referenced\n}\n\nclass DateTimeKey\n{\n    public DateTime Id { get; set; }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DateAndTimeShouldNotBeUsedasTypeForPrimaryKey.NoReferenceToEntityFramework.vb",
    "content": "﻿Imports System\n\nClass Entity\n    Public Property EntityId As Date  ' Compliant - the Entity Framework library is not referenced\nEnd Class\n\nClass DateTimeKey\n    Public Property Id As Date\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DateAndTimeShouldNotBeUsedasTypeForPrimaryKey.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.ComponentModel.DataAnnotations;\nusing System.ComponentModel.DataAnnotations.Schema;\nusing System.Security.Permissions;\nusing DateTimeAlias = System.DateTime;\nusing KeyAttributeAlias = System.ComponentModel.DataAnnotations.KeyAttribute;\n\nclass TemporalTypes\n{\n    class Entity\n    {\n        public DateTime EntityId { get; set; }          // Noncompliant {{'DateTime' should not be used as a type for primary keys}}\n        //     ^^^^^^^^\n    }\n\n    class DateTimeKey\n    {\n        public DateTime Id { get; set; }                // Noncompliant\n    }\n\n    class DateTimeOffsetKey\n    {\n        public DateTimeOffset Id { get; set; }          // Noncompliant {{'DateTimeOffset' should not be used as a type for primary keys}}\n    }\n\n    class TimeSpanKey\n    {\n        public TimeSpan Id { get; set; }                // Noncompliant {{'TimeSpan' should not be used as a type for primary keys}}\n    }\n\n    class DateTimeNoKey\n    {\n        public DateTime Identifier { get; set; }        // Compliant - only Id and [class-name]Id is recognized as key by Entity Framework\n    }\n\n    class DifferentCasing\n    {\n        public DateTime ID { get; set; }                // Noncompliant\n    }\n\n    class TemporalTypeWithFullName\n    {\n        public System.DateTime Id { get; set; }         // Noncompliant\n    }\n\n    class AliasedTemporalType\n    {\n        public DateTimeAlias Id { get; set; }           // FN - the chance of using a type aliased temporal type as a database key is slim, so we don't cover it to improve performance\n    }\n}\n\nclass NonTemporalTypes\n{\n    class IntKey\n    {\n        public int Id { get; set; }                     // Compliant - not a temporal type\n    }\n\n    class GuidKey\n    {\n        public Guid Id { get; set; }\n    }\n\n    class StringKey\n    {\n        public string Id { get; set; }\n    }\n}\n\nclass Attributes\n{\n    class SingleKeyAttribute\n    {\n        [Key]\n        public DateTime KeyProperty { get; set; }       // Noncompliant\n    }\n\n    class KeyAndOtherAttributes\n    {\n        [Key, Column(\"KeyColumn\")]\n        public DateTime KeyProperty { get; set; }       // Noncompliant\n    }\n\n    class KeyAndOtherAttributeLists\n    {\n        [Column(\"KeyColumn\")]\n        [Key]\n        public DateTime KeyProperty { get; set; }       // Noncompliant\n    }\n\n    class KeyWithAttributeName\n    {\n        [KeyAttribute]\n        public DateTime KeyProperty { get; set; }       // Noncompliant\n    }\n\n    class KeyAttributeWithFullName\n    {\n        [System.ComponentModel.DataAnnotations.KeyAttribute]\n        public DateTime KeyProperty { get; set; }       // Noncompliant\n    }\n\n    class AliasedKeyAttribute\n    {\n        [KeyAttributeAlias]\n        public DateTime KeyProperty { get; set; }       // FN - we don't cover aliased attributes to improve the analzyer's performance\n    }\n\n    class NoKeyAttribute\n    {\n        [Column(\"KeyColumn\")]\n        public DateTime KeyProperty { get; set; }       // Compliant - not marked with Key attribute and not called Id or [ClassName]Id\n    }\n\n    class ForeignKeyRelationship\n    {\n        class Author\n        {\n            [Key]\n            public DateTime DateOfBirth { get; set; }   // Noncompliant\n            public ICollection<Book> Books { get; set; }\n        }\n\n        class Book\n        {\n            public string Title { get; set; }\n            public Author Author { get; set; }\n            [ForeignKey(\"Author\")]\n            public DateTime AuthorFK { get; set; }      // Compliant - only raise where the key is declared\n        }\n    }\n}\n\nclass PropertyTypes\n{\n    class NotProperties\n    {\n        public DateTime id;                             // Compliant - only properties are validated\n        public DateTime Id() => DateTime.Now;\n    }\n\n    class StaticProperty\n    {\n        public static DateTime Id { get; set; }         // Compliant - static properties cannot be keys\n    }\n\n    static class StaticPropertyInStaticClass\n    {\n        public static DateTime Id { get; set; }\n    }\n\n    class NotPublicProperty\n    {\n        [Key]\n        internal DateTime Identifier { get; set; }      // Compliant - Entity Framework only maps public properties to keys\n    }\n\n    class NotReadWriteProperty\n    {\n        public DateTime Id => DateTime.Now;             // Compliant - not a read/write property\n    }\n\n    class FullProperty\n    {\n        private DateTime id;\n        public DateTime Id                              // Noncompliant\n        {\n            get => id;\n            private set => id = value;                  // Note: private setters are supported by Entity Framework (private getters are not)\n        }\n    }\n}\n\nclass NonClassTypes\n{\n    struct StructEntity\n    {\n        public DateTime Id { get; set; }                // Compliant - struct types cannot be directly mapped to tables in Entity Framework\n    }\n\n    interface IEntity\n    {\n        DateTime Id { get; set; }                       // Compliant - issue will be raised in the implementing class\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DateAndTimeShouldNotBeUsedasTypeForPrimaryKey.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.ComponentModel.DataAnnotations\nImports System.ComponentModel.DataAnnotations.Schema\nImports DateTimeAlias = System.DateTime\nImports KeyAttributeAlias = System.ComponentModel.DataAnnotations.KeyAttribute\n\nClass TemporalTypes\n    Class Entity\n        Public Property EntityId As Date              ' Noncompliant {{'Date' should not be used as a type for primary keys}}\n        '                           ^^^^\n    End Class\n\n    Class DateTimeKey\n        Public Property Id As Date                    ' Noncompliant\n    End Class\n\n    Class DateTimeOffsetKey\n        Public Property Id As DateTimeOffset          ' Noncompliant {{'DateTimeOffset' should not be used as a type for primary keys}}\n    End Class\n\n    Class TimeSpanKey\n        Public Property Id As TimeSpan                ' Noncompliant {{'TimeSpan' should not be used as a type for primary keys}}\n    End Class\n\n    Class DateTimeNoKey\n        Public Property Identifier As Date            ' Compliant - only Id and [class-name]Id is recognized as key by Entity Framework\n    End Class\n\n    Class DifferentCasingForProprtyName\n        Public Property ID As Date                    ' Noncompliant\n    End Class\n\n    Class DifferentCasingForProprtyType\n        Public Property Id As Date                    ' Noncompliant\n    End Class\n\n    Class TemporalTypeWithFullName\n        Public Property Id As Date                    ' Noncompliant\n    End Class\n\n    Class AliasedTemporalType\n        Public Property Id As DateTimeAlias           ' FN - the chance of using a type aliased temporal type as a database key is slim, so we don't cover it to improve performance\n    End Class\nEnd Class\n\nClass NonTemporalTypes\n    Class IntKey\n        Public Property Id As Integer                 ' Compliant - not a temporal type\n    End Class\n\n    Class GuidKey\n        Public Property Id As Guid\n    End Class\n\n    Class StringKey\n        Public Property Id As String\n    End Class\nEnd Class\n\nClass Attributes\n    Class SingleKeyAttribute\n        <Key>\n        Public Property KeyProperty As Date           ' Noncompliant\n    End Class\n\n    Class KeyAndOtherAttributes\n        <Key, Column(\"KeyColumn\")>\n        Public Property KeyProperty As Date           ' Noncompliant\n    End Class\n\n    Class KeyAndOtherAttributeLists\n        <Column(\"KeyColumn\")>\n        <Key>\n        Public Property KeyProperty As Date           ' Noncompliant\n    End Class\n\n    Class KeyWithAttributeName\n        <KeyAttribute>\n        Public Property KeyProperty As Date           ' Noncompliant\n    End Class\n\n    Class KeyAttributeWithFullName\n        <ComponentModel.DataAnnotations.KeyAttribute>\n        Public Property KeyProperty As Date           ' Noncompliant\n    End Class\n\n    Class KeyAttributeWithDifferentCasing\n        <KEY>\n        Public Property KeyProperty As Date           ' Noncompliant\n    End Class\n\n    Class AliasedKeyAttribute\n        <KeyAttributeAlias>\n        Public Property KeyProperty As Date           ' FN - we don't cover aliased attributes to improve the analzyer's performance\n    End Class\n\n    Class NoKeyAttribute\n        <Column(\"KeyColumn\")>\n        Public Property KeyProperty As Date           ' Compliant - not marked with Key attribute and not called Id or [ClassName]Id\n    End Class\n\n    Class ForeignKeyRelationship\n        Class Author\n            <Key>\n            Public Property DateOfBirth As Date       ' Noncompliant\n            Public Property Books As ICollection(Of Book)\n        End Class\n\n        Class Book\n            Public Property Title As String\n            Public Property Author As Author\n            <ForeignKey(\"Author\")>\n            Public Property AuthorFK As Date          ' Compliant - only raise where the key is declared\n        End Class\n    End Class\nEnd Class\n\nClass PropertyTypes\n    Class NotProperties\n        Public idField As Date                        ' Compliant - only properties are validated\n        Public Function Id() As Date\n            Return Date.Now\n        End Function\n    End Class\n\n    Class StaticProperty\n        Public Shared Property Id As Date             ' Compliant - shared properties cannot be keys\n    End Class\n\n    NotInheritable Class StaticPropertyInStaticClass\n        Public Shared Property Id As Date\n    End Class\n\n    Class ImplicitPublicProperty\n        Property Id As Date                           ' Noncompliant\n    End Class\n\n    Class NotPublicProperty\n        <Key>\n        Friend Property Identifier As Date            ' Compliant - Entity Framework only maps public properties to keys\n    End Class\n\n    Class NotReadWriteProperty\n        Public ReadOnly Property Id As Date           ' Compliant - not a read/write property\n            Get\n                Return Date.Now\n            End Get\n        End Property\n    End Class\n\n    Class FullProperty\n        Private idField As Date\n        Public Property Id As Date                    ' Noncompliant\n            Get\n                Return idField\n            End Get\n            Private Set(ByVal value As Date)          ' Note: private setters are supported by Entity Framework (private getters are not)\n                idField = value\n            End Set\n        End Property\n    End Class\nEnd Class\n\nClass NonClassTypes\n    Structure StructEntity\n        Public Property Id As Date                    ' Compliant - struct types cannot be directly mapped to tables in Entity Framework\n    End Structure\n\n    Interface IEntity\n        Property Id As Date                           ' Compliant - issue will be raised in the implementing class\n    End Interface\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DateTimeFormatShouldNotBeHardcoded.Latest.cs",
    "content": "﻿using System;\nusing System.Globalization;\n\npublic class DateTimeFormatShouldNotBeHardcoded\n{\n    public void Noncompliant(DateOnly dateOnly, TimeOnly timeOnly)\n    {\n        var stringRepresentation = dateOnly.ToString(\"dd/MM/yyyy\"); // Noncompliant\n        stringRepresentation = timeOnly.ToString(\"HH:mm:ss\"); // Noncompliant\n        stringRepresentation = timeOnly.ToString(\"HH:mm:ss\\e\"); // Noncompliant\n    }\n\n    public void Compliant(DateOnly dateOnly, TimeOnly timeOnly)\n    {\n        var stringRepresentation = dateOnly.ToString(CultureInfo.GetCultureInfo(\"es-MX\"));\n        stringRepresentation = timeOnly.ToString(CultureInfo.GetCultureInfo(\"es-MX\"));\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DateTimeFormatShouldNotBeHardcoded.Net.vb",
    "content": "﻿Imports System\nImports System.Globalization\n\nPublic Class DateTimeFormatShouldNotBeHardcoded\n    Public Sub Noncompliant(ByVal dateOnly As DateOnly, ByVal timeOnly As TimeOnly)\n        Dim stringRepresentation = dateOnly.ToString(\"dd/MM/yyyy\") ' Noncompliant\n        stringRepresentation = timeOnly.ToString(\"HH:mm:ss\") ' Noncompliant\n    End Sub\n\n    Public Sub Compliant(ByVal dateOnly As DateOnly, ByVal timeOnly As TimeOnly)\n        Dim stringRepresentation = dateOnly.ToString(CultureInfo.GetCultureInfo(\"es-MX\"))\n        stringRepresentation = timeOnly.ToString(CultureInfo.GetCultureInfo(\"es-MX\"))\n    End Sub\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DateTimeFormatShouldNotBeHardcoded.cs",
    "content": "﻿using System;\nusing System.Globalization;\n\npublic class DateTimeFormatShouldNotBeHardcoded\n{\n    private string Format = $\"dd/MM\";\n\n    public void Noncompliant(DateTimeOffset dateTimeOffset, TimeSpan timeSpan)\n    {\n        var stringRepresentation = DateTime.UtcNow.ToString(\"dd/MM/yyyy HH:mm:ss\"); // Noncompliant {{Do not hardcode the format specifier.}}\n//                                                          ^^^^^^^^^^^^^^^^^^^^^\n        stringRepresentation = DateTime.UtcNow.ToString(\"dd/MM/yyyy HH:mm:ss\", CultureInfo.GetCultureInfo(\"es-MX\")); // Noncompliant\n        stringRepresentation = DateTime.Now.ToString(provider: CultureInfo.GetCultureInfo(\"es-MX\"), format: \"dd/MM/yyyy HH:mm:ss\"); // Noncompliant\n        stringRepresentation = DateTime.UtcNow.ToString(Format); // Noncompliant\n\n        var stringFormat = string.Format(\"{0:yy/MM/dd}\", DateTime.Now); // FN\n        Console.WriteLine(\"{0:HH:mm}\", DateTime.Now); // FN\n\n        stringRepresentation = dateTimeOffset.ToString(\"dd/MM/yyyy HH:mm:ss\"); // Noncompliant\n        stringRepresentation = timeSpan.ToString(@\"dd\\.hh\\:mm\\:ss\"); // Noncompliant\n\n        var chainedInvocations = DateTime.UtcNow.AddDays(1).ToString(\"dd/MM/yyyy\").EndsWith(\"1\"); // Noncompliant\n        (true ? new DateTime(1) : new DateTime(1)).ToString(\"dd/MM/yyyy\"); // Noncompliant\n        MyMethod().ToString(\"dd/MM/yyy\");  // Noncompliant\n        DateTime MyMethod() => new DateTime(1);\n        new DateTime(1).ToString(\"dd/MM/yyy\"); // Noncompliant\n    }\n\n    public void Compliant(DateTimeOffset dateTimeOffset, TimeSpan timeSpan)\n    {\n        var stringRepresentation = DateTime.UtcNow.ToString(CultureInfo.GetCultureInfo(\"es-MX\"));\n        stringRepresentation = DateTime.UtcNow.ToString(CultureInfo.InvariantCulture);\n        stringRepresentation = DateTime.UtcNow.ToString(\"d\");\n        stringRepresentation = DateTime.UtcNow.ToString(\"d\", CultureInfo.GetCultureInfo(\"es-MX\"));\n        stringRepresentation = dateTimeOffset.ToString(CultureInfo.GetCultureInfo(\"es-MX\"));\n        stringRepresentation = timeSpan.ToString(\"d\");\n        stringRepresentation = DateTime.UtcNow.ToString();\n\n        MyDate.ToString(\"dd/MM/yyy\");\n    }\n\n    static class MyDate\n    {\n        public static string ToString(string str) => str;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DateTimeFormatShouldNotBeHardcoded.vb",
    "content": "﻿Imports System\nImports System.Globalization\n\nPublic Class DateTimeFormatShouldNotBeHardcoded\n    Private Format As String = $\"dd/MM\"\n\n    Public Sub Noncompliant(ByVal dateTimeOffset As DateTimeOffset, ByVal timeSpan As TimeSpan)\n        Dim stringRepresentation = DateTime.UtcNow.ToString(\"dd/MM/yyyy HH:mm:ss\") ' Noncompliant {{Do not hardcode the format specifier.}}\n        '                                                   ^^^^^^^^^^^^^^^^^^^^^\n        stringRepresentation = DateTime.UtcNow.ToString(\"dd/MM/yyyy HH:mm:ss\", CultureInfo.GetCultureInfo(\"es-MX\")) ' Noncompliant\n        stringRepresentation = DateTime.UtcNow.ToString(Format) ' FN\n        Dim stringFormat = String.Format(\"{0:yy/MM/dd}\", DateTime.Now) ' FN\n        Console.WriteLine(\"{0:HH:mm}\", DateTime.Now) ' FN\n        stringRepresentation = dateTimeOffset.ToString(\"dd/MM/yyyy HH:mm:ss\") ' Noncompliant\n        stringRepresentation = timeSpan.ToString(\"dd\\.hh\\:mm\\:ss\") ' Noncompliant\n    End Sub\n\n    Public Sub Compliant(ByVal dateTimeOffset As DateTimeOffset, ByVal timeSpan As TimeSpan)\n        Dim stringRepresentation = DateTime.UtcNow.ToString(CultureInfo.GetCultureInfo(\"es-MX\"))\n        stringRepresentation = DateTime.UtcNow.ToString(CultureInfo.InvariantCulture)\n        stringRepresentation = DateTime.UtcNow.ToString(\"d\")\n        stringRepresentation = DateTime.UtcNow.ToString(\"d\", CultureInfo.GetCultureInfo(\"es-MX\"))\n        stringRepresentation = dateTimeOffset.ToString(CultureInfo.GetCultureInfo(\"es-MX\"))\n        stringRepresentation = timeSpan.ToString(\"d\")\n        stringRepresentation = dATEtIME.Now.tOsTRING\n        stringRepresentation = dateTimeOffset.ToString()\n\n        MyDate.ToString(\"dd/MM/yyy\")\n    End Sub\n\n    Class MyDate\n        Shared Function ToString(ByVal str As String) As String\n            Return str\n        End Function\n    End Class\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DeadStores.Latest.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Threading.Tasks;\nusing System;\n\n\n// TopLevelStatements:\n// This should do the trick: CheckForDeadStores(c, c.SemanticModel.GetDeclaredSymbol(c.Node), firstGlobalStatement)\n// but registering for CompilationUnit triggers the analysis twice, causing duplicates.\nvar x = 100; // FN, we don't register for CompilationUnit yet.\nx = 1;       // FN\n(x, int y) = ReturnIntTuple(); // FN\nstring str = \"\";   // FN\nstr = \"\"\"Test2\"\"\"; // FN\nFoo(str);\n\nvoid UnsignedShiftRightAssignment()\n{\n    int i = 0;\n    i >>>= 5; // Noncompliant\n}\n\nvoid RawStringLiterals(string param)\n{\n    param = \"\"\"Test\"\"\";      // Noncompliant\n\n    string x = \"\"; // Compliant, ignored value\n    x = \"\"\"Test2\"\"\";\n    Foo(x);\n\n    string y = \"\"\"Test1\"\"\"; // Noncompliant\n    y = \"\"\"Test2\"\"\";\n    Foo(y);\n}\n\nvoid MultilineRawStringLiterals(string param)\n{\n    param = \"\"\" \n        This\n        is\n        multiline\n        \"\"\"; // Noncompliant@-4\n\n    string x = \"\"\"\n\n        \"\"\"; // Compliant (empty multi-line)\n    x = \"\"\"\n        Something\n        \"\"\";\n\n    string z = \"\"\"\n        Something\n        \"\"\"; // Noncompliant@-2\n    z = \"\"\"\n        \n        \"\"\";\n\n    string y = \"\"\"\n        This\n        is\n        multiline\n        \"\"\"; // Noncompliant@-4\n    y = \"\"\"\n        This\n        is\n        also\n        multiline\n        \"\"\";\n\n    Foo(x);\n    Foo(y);\n    Foo(z);\n}\n\nvoid InterpolatedRawStringLiterals(string param)\n{\n    string aux = \"\"\"Test\"\"\";\n    string auxMultiline = \"\"\"\n        This\n        is\n        multiline\n        \"\"\";\n\n    param = $\"\"\"{aux}Test\"\"\";      // Noncompliant\n    param = $\"\"\"{auxMultiline}Test\"\"\";      // Noncompliant\n    param = $\"\"\"\n        {aux}\n        Test\n        \"\"\";      // Noncompliant@-3\n    param = $\"\"\"\n        {auxMultiline}\n        Test\n        \"\"\";      // Noncompliant@-3\n\n    string empty = \"\";\n    string x = $\"\"\"{empty}\"\"\"; // Noncompliant  string interpolation values are intentionally not evaluated\n    x = $\"\"\"{empty}Test\"\"\";\n    Foo(x);\n\n    string emptyMultiline = \"\"\"\n\n        \"\"\";\n    string q = $\"\"\"{emptyMultiline}\"\"\"; // Noncompliant  string interpolation values are intentionally not evaluated\n    q = $\"\"\"{emptyMultiline}Test\"\"\";\n    Foo(q);\n\n    string y = $\"\"\"\n        Test1{aux}\n        \"\"\"; // Noncompliant@-2\n    y = $\"\"\"\n        Test2{aux}\n        \"\"\";\n    Foo(y);\n}\n\nvoid NewlinesInStringInterpolation(string param)\n{\n    string aux = \"Test\";\n    param = $\"{aux\n        .ToUpper()}\"; // Noncompliant@-1\n    param = $\"{aux\n        .ToUpper()}\";\n    Foo(param);\n\n    string empty = \"\";\n    string x = $\"{empty +\n        empty}\"; // Noncompliant@-1 string interpolation values are intentionally not evaluated\n    x = \"Test\";\n    Foo(x);\n}\n\nvoid IgnoredValues()\n{\n    string emptyMultilineRawStringLiteral = $$\"\"\"\n\n        \"\"\"; // Compliant\n    emptyMultilineRawStringLiteral = \"other\";\n\n    Foo(emptyMultilineRawStringLiteral);\n}\n\nstatic (int a, int b) ReturnIntTuple()\n{\n    return (1, 2);\n}\n\nstatic (int, (int, (int, int))) ReturnNestedTuple()\n{\n    return (1, (2, (3, 4)));\n}\n\nstatic int ReturnAnInt()\n{\n    return 10;\n}\n\nvoid DoStuffWithInts()\n{\n    int x = ReturnAnInt();\n    (x, int y) = ReturnIntTuple(); // Noncompliant {{Remove this useless assignment to local variable 'x'.}}\n//  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n}\n\nvoid MultipleAssignmentInSingleDeconstruction()\n{\n    int x = 1;\n    (x, x, (x, x)) = (1, 2, (3, 4));\n//  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^      {{Remove this useless assignment to local variable 'x'.}}\n//  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  @-1 {{Remove this useless assignment to local variable 'x'.}}\n//  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  @-2 {{Remove this useless assignment to local variable 'x'.}}\n//  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  @-3 {{Remove this useless assignment to local variable 'x'.}}\n}\n\nvoid ReAssignmentDeconstruction()\n{\n    int x = 1;\n    (x, x, (x, x)) = (x, x, (x, x)); // Noncompliant [issue1, issue2, issue3, issue4]\n}\n\nvoid ReAssignmentDeconstructionFromMethodCall()\n{\n    (_, (var _, (int x, var _))) = ReturnNestedTuple();\n    (x, _) = ReturnNestedTuple();    // Noncompliant\n}\n\nvoid DoStuffWithIntsAgain()\n{\n    int? x = null;\n    (x, int y) = ReturnIntTuple();   // Noncompliant\n}\n\nvoid TwoAssigments()\n{\n    int a, b, c = 0;\n    (a, (b, c)) = (1, (2, 3));\n//  ^^^^^^^^^^^^^^^^^^^^^^^^^  Noncompliant    {{Remove this useless assignment to local variable 'a'.}}\n//  ^^^^^^^^^^^^^^^^^^^^^^^^^  Noncompliant@-1 {{Remove this useless assignment to local variable 'b'.}}\n//  ^^^^^^^^^^^^^^^^^^^^^^^^^  Noncompliant@-2 {{Remove this useless assignment to local variable 'c'.}}\n}\n\nvoid DoSimplerStuffWithIntsAgain()\n{\n    int x;\n    (x, var y) = (1, 2); // Noncompliant\n}\n\nAction<int, int, int> StaticLambda() =>\n    static (int a, int _, int _) =>\n    {\n        a = 200; // FN\n        (a, int b) = ReturnIntTuple(); // FN\n    };\n\nvoid ReassignAfter()\n{\n    int x;\n    (x, var y) = (1, 2); // Noncompliant\n    x = 2;\n    Console.WriteLine(x);\n}\n\nvoid TargetTypedNew()\n{\n    Decimal d = new(100f);  // Noncompliant\n    d = new(2f);            // Noncompliant\n}\n\nvoid NativeInts(nuint param)\n{\n    param = 1;      // Noncompliant\n\n    nuint zero = 0; // Compliant, ignored value\n    zero = 1;\n    Foo(zero);\n\n    nint minusOne = -1; // Compliant, ignored value\n    minusOne = 1;\n    Foo(minusOne);\n\n    nint one = 1;       // Compliant, ignored value\n    one = 2;\n    Foo(one);\n\n    nint two = 2;       // Noncompliant\n    two = 3;\n    Foo(two);\n}\n\n// https://sonarsource.atlassian.net/browse/NET-2976\nvoid DefaultLiteral()\n{\n    int i = default; // Compliant\n    i = 42;\n    Foo(i);\n\n    string s = default; // Compliant\n    s = \"value\";\n    Foo(s);\n\n    object o = default; // Compliant\n    o = new object();\n    Foo(o);\n\n    bool b = default; // Compliant\n    b = true;\n    Foo(b);\n\n    IntPtr ptr = default; // Compliant\n    ptr = new IntPtr(42);\n    Foo(ptr);\n\n    UIntPtr uptr = default; // Compliant\n    uptr = new UIntPtr(42);\n    Foo(uptr);\n\n    Guid guid = default; // Compliant\n    guid = Guid.NewGuid();\n    Foo(guid);\n}\n\n// https://sonarsource.atlassian.net/browse/NET-2976\nvoid TypeSpecificDefaultValues()\n{\n    IntPtr ptr = IntPtr.Zero; // Compliant\n    ptr = new IntPtr(42);\n    Foo(ptr);\n\n    UIntPtr uptr = UIntPtr.Zero; // Compliant\n    uptr = new UIntPtr(42);\n    Foo(uptr);\n\n    Guid id = Guid.Empty; // Compliant\n    id = Guid.NewGuid();\n    Foo(id);\n}\n\nvoid PatternMatch(object param)\n{\n    object a = param;\n    if (a is not null)\n    {\n        a = null; // Compliant\n        Foo(a);\n    }\n\n    int i = 100;\n    if (i is not > 50 and < 200)\n    {\n        i = 2;\n        Foo(i);\n    }\n}\n\nvoid PatternMatchFalseNegative(int a, int b)\n{\n    if (b is not 5)\n    {\n        a = 1;  // Noncompliant\n    }\n    else if (b is 5)\n    {\n        a = 2;  // Noncompliant\n    }\n\n    var c = 5;\n    switch (c)\n    {\n        case < 5:\n            c = 6; // Noncompliant\n            break;\n        case >= 5:\n            c = 7; // Noncompliant\n            break;\n    }\n}\n\nAction<int, int, int> AnotherStaticLambda() =>\n    static (int a, int _, int _) =>\n{\n    a = 100;        // FN, muted\n    int b = 100;    // FN, muted\n    b = 1;          // FN, muted\n};\n\nvoid Foo(object o) { }\n\npublic class C\n{\n\n    public static void Log() { }\n    unsafe void FunctionPointer()\n    {\n        delegate*<void> ptr1 = &C.Log;  // Noncompliant\n        ptr1 = &C.Log;                  // Noncompliant\n    }\n\n    Action<int, int, int> StaticLambda() =>\n        static (int a, int _, int _) =>\n        {\n            a = 100;        // Noncompliant\n            int b = 100;    // Noncompliant\n            b = 1;          // Noncompliant\n        };\n\n}\n\nrecord R\n{\n    public R(int x)\n    {\n        x = 1; // Noncompliant\n    }\n\n    int x;\n    public int InitProperty\n    {\n        init\n        {\n            value = 1;      // Noncompliant\n            int a = 100;    // Noncompliant\n            a = 2;          // Noncompliant\n        }\n    }\n}\n\nclass UnsafeContexts\n{\n    //https://sonarsource.atlassian.net/browse/NET-404\n    IEnumerable<int> IteratorTests(int test)\n    {\n        unsafe\n        {\n            ref int x = ref test; \n            x = default;            // Compliant FN\n        }\n        yield return 1;\n        local();\n        async void local()\n        {\n            unsafe\n            {\n                int* p = null;\n                p = (int*)10;   // Noncompliant\n            }\n            await Task.Yield();\n        }\n    }\n}\n\nstatic class Extensions\n{\n    extension(string s)\n    {\n        void Method()\n        {\n            var x = \"unused\";   // Noncompliant\n            x = \"new value\";    // Noncompliant\n        }\n    }\n}\n\nclass FieldKeyword\n{\n    string Property\n    {\n        get => field;\n        set\n        {\n            field = \"unused\";       // Compliant: not a local variable\n            field = \"new value\";    // Compliant: not a local variable\n        }\n    }\n}\n\npartial class Partial\n{\n    partial event EventHandler Event;\n    partial Partial();\n}\n\npartial class Partial\n{\n    partial event EventHandler Event\n    {\n        add\n        {\n\n            var x = \"unused\";   // Noncompliant\n            x = \"new value\";    // Noncompliant\n        }\n        remove\n        {\n            var x = \"unused\";   // Noncompliant\n            x = \"new value\";    // Noncompliant\n        }\n    }\n    partial Partial()\n    {\n        var x = \"unused\";       // Noncompliant\n        x = \"new value\";        // Noncompliant\n    }\n}\n\nclass Sample\n{\n    string Property { get; set; }\n\n    void Method(Sample s)\n    {\n        s?.Property = \"unused\";     // Compliant: not a local variable\n        s?.Property = \"new value\";  // Compliant: not a local variable\n    }\n}\n\nclass CustomCompoundAssignment\n{\n    public int Value;\n\n    public void operator +=(int x)\n    {\n        Value += x;\n    }\n\n    void Method(CustomCompoundAssignment x)\n    {\n        x += 1;     // Noncompliant\n        x = null;   // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DeadStores.RoslynCfg.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.Versioning;\n\nnamespace Tests.Diagnostics\n{\n    public class Resource : IDisposable\n    {\n        private const int constZero = 0;\n\n        public void Dispose()\n        {\n        }\n        public int DoSomething()\n        {\n            return 1;\n        }\n        public int DoSomethingElse()\n        {\n            return 5;\n        }\n\n        public void IgnoredValues()\n        {\n            var stringEmpty = string.Empty; // Compliant\n            stringEmpty = \"other\";\n\n            string stringNull = null;   // Compliant\n            stringNull = \"other\";\n\n            var boolFalse = false;      // Compliant\n            boolFalse = true;\n\n            var boolTrue = true;        // Compliant\n            boolTrue = false;\n\n            object objectNull = null;   // Compliant\n            objectNull = new object();\n\n            var intZero = 0;            // Compliant\n            intZero = 42;\n\n            var intOne = 1;             // Compliant\n            intOne = 42;\n\n            var intMinusOne = -1;       // Compliant\n            intMinusOne = 42;\n\n            var intPlusOne = +1;        // Compliant\n            intPlusOne = 42;\n\n            const int constMinusOne = -1;\n            int fromLocalConstant = constMinusOne;  // Compliant\n            fromLocalConstant = 42;\n\n            int fromClassConstant = constZero;      // Compliant\n            fromClassConstant = 42;\n\n            const string constEmpty = \"\";\n            string fromConstantEmpty = constEmpty;  // Compliant\n            fromConstantEmpty = \"other\";\n\n            var fromCast = (string)null;            // Compliant\n            fromCast = \"other\";\n\n            var emptyStringLiteral = \"\"; // Compliant\n            emptyStringLiteral = \"other\";\n\n            var emptyInterpolatedStringLiteral = $\"\"; // Compliant\n            emptyInterpolatedStringLiteral = \"other\";\n\n            // Variables should be used in order the rule to trigger\n            Console.WriteLine(\"\", stringEmpty, stringNull, boolFalse, boolTrue, objectNull, intZero, intOne, intMinusOne, intPlusOne, fromLocalConstant, fromClassConstant, fromConstantEmpty, fromCast, emptyStringLiteral, emptyInterpolatedStringLiteral);\n        }\n\n        private void NonignoredValues()\n        {\n            var stringZero = \"0\";       // Noncompliant, this is not ignored\n            stringZero = \"other\";\n            var stringOne = \"1\";        // Noncompliant, this is not ignored\n            stringOne = \"other\";\n            var stringMinusOne = \"-1\";  // Noncompliant, this is not ignored\n            stringMinusOne = \"other\";\n\n            var isZero = 1 - 1;         // Noncompliant, this is not ignored\n            isZero = 42;\n\n            var isEmpty = \"\" + \"\";      // Noncompliant, this is not ignored\n            isEmpty = \"other\";\n\n            const string constNotEmpty = \"Something\";\n            string fromConstantNotEmpty = constNotEmpty;  // Noncompliant, this is not ignored\n            fromConstantNotEmpty = \"other\";\n\n            Console.WriteLine(\"\", stringZero, stringOne, stringMinusOne, isZero, isEmpty, fromConstantNotEmpty);\n        }\n\n        public void ExpressionResultsInConstantIgnoredValue()\n        {\n            var boolFalse = 0 != 0;     // Noncompliant, only explicit 'false' is ignored by the rule\n            boolFalse = true;\n\n            var boolTrue = 0 == 0;      // Noncompliant\n            boolTrue = false;\n\n            var intZero = 1 - 1;        // Noncompliant\n            intZero = 42;\n\n            var intOne = 0 + 1;         // Noncompliant\n            intOne = 42;\n\n            var intMinusOne = 0 - 1;    // Noncompliant\n            intMinusOne = 42;\n\n            // Variables should be used in order the rule to trigger\n            Console.WriteLine(\"\", boolFalse, boolTrue, intZero, intOne, intMinusOne);\n        }\n\n        public void Defaults()\n        {\n            var s = default(string);    // Compliant\n            s = \"\";\n\n            var b = default(bool);      // Compliant\n            b = true;\n\n            var o = default(object);    // Compliant\n            o = new object();\n\n            var i = default(int);       // Compliant\n            i = 42;\n\n            // Variables should be used in order the rule to trigger\n            Console.WriteLine(\"\", s, b, o, i);\n        }\n\n        // https://sonarsource.atlassian.net/browse/NET-2976\n        public void TypeSpecificDefaultValues()\n        {\n            IntPtr ptr = IntPtr.Zero; // Compliant\n            ptr = new IntPtr(42);\n            Console.WriteLine(ptr);\n\n            UIntPtr uptr = UIntPtr.Zero; // Compliant\n            uptr = new UIntPtr(42);\n            Console.WriteLine(uptr);\n\n            Guid id = Guid.Empty; // Compliant\n            id = Guid.NewGuid();\n            Console.WriteLine(id);\n        }\n\n    }\n\n    public class DeadStores\n    {\n        public int Property { get; set; }\n\n        int doSomething() => 1;\n        int doSomethingElse() => 1;\n\n        void calculateRate(int a, int b)\n        {\n            b = doSomething(); // {{Remove this useless assignment to local variable 'b'.}}\n//          ^^^^^^^^^^^^^^^^^\n\n            int i, j;\n            i = a + 12;\n            i += i + 2; // Noncompliant\n            i = 5;\n            j = i;\n            i                           // Noncompliant; retrieved value overwritten in for loop\n                = doSomething();\n            for (i = 0; i < j + 10; i++)\n            {\n                //  ...\n            }\n\n            if ((i = doSomething()) == 5 ||\n                (i = doSomethingElse()) == 5)\n            {\n                i += 5; // Noncompliant\n            }\n\n            var resource = new Resource(); // Noncompliant; retrieved value not used\n            using (resource = new Resource())\n            {\n                resource.DoSomething();\n            }\n\n            var x       // Noncompliant\n                = 10;\n            var y =\n                x = 11; // Noncompliant\n            Console.WriteLine(y);\n\n            int k = 12; // Noncompliant\n            X(out k);   // Compliant, not reporting on out parameters\n        }\n        void X(out int i) { i = 10; }   // Compliant out parameter\n\n        void calculateRate2(int a, int b)\n        {\n            var x = 0;  // Compliant, ignored value\n            x = 1;      // Noncompliant\n            try\n            {\n                x = 11; // Noncompliant\n                x = 12;\n                Console.Write(x);\n                x = 13; // Noncompliant\n            }\n            catch (Exception)\n            {\n                x = 21; // Noncompliant\n                x = 22;\n                Console.Write(x);\n                x = 23; // Noncompliant\n            }\n            x = 31; // Noncompliant\n        }\n\n        void storeI(int i) { }\n\n        void calculateRate3(int a, int b)\n        {\n            int i;\n\n            i = doSomething();\n            i += a + b;\n            storeI(i);\n\n            for (i = 0; i < 10; i++)\n            {\n                //  ...\n            }\n        }\n\n        int pow(int a, int b)\n        {\n            if (b == 0)\n            {\n                return 0;\n            }\n            int x = a;\n            for (int i = 1; i < b; i++)\n            {\n                x = x * a;  //Not detected yet, we are in a loop, Dead store because the last return statement should return x instead of returning a\n            }\n            return a;\n        }\n\n        public void Assignment(DeadStores sender)\n        {\n            // Compliant cases\n            sender.Property += 42;\n            sender.Property = 42;\n            Property += 42;\n            Property = 42;\n            undefined += 42;    // Error [CS0103]: The name 'undefined' does not exist in the current context\n            undefined = 42;     // Error [CS0103]: The name 'undefined' does not exist in the current context\n\n            var captured = 10;\n            Action a = () => { Console.WriteLine(captured); };\n            captured += 11;     // Not reporting on captured local variables\n            a();\n\n            var add = 40;\n            add += 2;\n            Use(add);\n            add += 100;     // Noncompliant\n\n            var sub = 40;\n            sub -= 2;\n            Use(sub);\n            sub -= 100;     // Noncompliant\n\n            var mul = 40;\n            mul *= 2;\n            Use(mul);\n            mul *= 100;     // Noncompliant\n\n            var div = 40;\n            div /= 2;\n            Use(div);\n            div /= 100;     // Noncompliant\n\n            var mod = 40;\n            mod += 2;\n            Use(mod);\n            mod %= 100;     // Noncompliant\n\n            var and = false;\n            and &= true;\n            Use(and);\n            and &= false;   // Noncompliant\n\n            var or = false;\n            or |= false;\n            Use(or);\n            or |= true;     // Noncompliant\n\n            var xor = 40;\n            xor ^= 2;\n            Use(xor);\n            xor ^= 100;     // Noncompliant\n\n            var left = 40;\n            left <<= 2;\n            Use(left);\n            left <<= 100;   // Noncompliant\n\n            var right = 40;\n            right >>= 2;\n            Use(right);\n            right >>= 100;  // Noncompliant\n\n            string coa = SomeString();\n            coa ??= SomeString();\n            Use(coa);\n            coa ??= SomeString();  // Noncompliant\n        }\n\n        public void Unary()\n        {\n            var value = 41;\n            value++;\n            Use(value);\n            value++;      // Noncompliant\n            value = 41;\n\n            ++value;\n            Use(value);\n            ++value;      // Noncompliant\n            value = 41;\n\n            value--;\n            Use(value);\n            value--;      // Noncompliant\n            value = 41;\n\n            --value;\n            Use(value);\n            --value;      // Noncompliant\n            value = 41;\n\n            Use(value);\n        }\n\n        public void LoopControlVariable()\n        {\n            foreach (var unused in Enumerable.Range(1, 10))  // Compliant, this rule should not raise on unused variables\n            {\n                Console.Write(\"-\");\n            }\n            foreach (var used in Enumerable.Range(1, 10))\n            {\n                Use(used);\n            }\n            for (var i = 0; i < 10; i++)\n            {\n                Console.Write(\"-\");\n            }\n            for (var i = 0; i < 10; i++)\n            {\n                Use(i);\n            }\n        }\n\n        public void Discard(int arg)\n        {\n            _ = arg;\n            _ = 42;\n        }\n\n        private void Use(int arg) { }\n        private void Use(bool arg) { }\n        private void Use(string arg) { }\n        private string SomeString() => null;\n\n        public void Switch()\n        {\n            const int c = 5; // Compliant\n            var b = 5;\n            switch (b)\n            {\n                case 6:\n                    b = 5; // Noncompliant\n                    break;\n                case 7:\n                    b = 56; // Noncompliant\n                    break;\n                case c:\n                    break;\n            }\n\n            b = 7;\n            Console.Write(b);\n            b += 7; // Noncompliant\n        }\n\n        public int Switch1(int x)\n        {\n            var b = 0; // Compliant, ignored value\n            switch (x)\n            {\n                case 6:\n                    b = 5;\n                    break;\n                case 7:\n                    b = 56;\n                    break;\n                default:\n                    b = 0;\n                    break;\n            }\n\n            return b;\n        }\n\n        public int Switch2(int x)\n        {\n            var b = 0; // Compliant\n            switch (x)\n            {\n                case 6:\n                    b = 5;\n                    break;\n                case 7:\n                    b = 56;\n                    break;\n            }\n\n            return b;\n        }\n\n        private int MyProp\n        {\n            get\n            {\n                var i = 10;\n                Console.WriteLine(i);\n                i++; // Noncompliant\n                i = 12;\n                ++i; // Noncompliant\n                i = 12;\n                var a = ++i;    // Noncompliant {{Remove this useless assignment to local variable 'i'.}}\n                return a;\n            }\n        }\n\n        private int MyProp2\n        {\n            get\n            {\n                var i = 10; // Noncompliant\n                if (nameof(((i))) == \"i\") // Error [CS8081]\n                {\n                    i = 11;\n                }\n                else\n                {\n                    i = 12;\n                }\n                Console.WriteLine(i);\n\n                return 42;\n            }\n        }\n\n        public List<int> Method(int i)\n        {\n            var l = new List<int>();\n\n            Func<List<int>> func = () =>\n            {\n                return (l = new List<int>(new[] { i }));\n            };\n\n            var x = l; // Noncompliant\n            x = null;  // Noncompliant\n\n            return func();\n        }\n\n        public List<int> Method2(int i)\n        {\n            var l = new List<int>();\n            return (() =>       // Error [CS0149] - no method name\n            {\n                var k = 10;     // Noncompliant\n                k = 12;         // Noncompliant\n                return (l = new List<int>(new[] { i })); // l captured here\n            })();\n        }\n\n        public List<int> Method3(int i)\n        {\n            bool f = false;\n            if (true || (f = false))\n            {\n                if (f) { }\n            }\n\n            return null;\n        }\n\n        public List<int> Method4(int i)\n        {\n            bool f;\n            f = true;\n            if (true || (f = false))\n            {\n                if (f) { }\n            }\n\n            return null;\n        }\n\n        public List<int> Method5(out int i, ref int j)\n        {\n            i = 10; // Compliant, out parameter\n\n            j = 11;\n            if (j == 11)\n            {\n                j = 12; // Compliant, ref parameter\n            }\n\n            return null;\n        }\n        public void Method5Call1(out int i)\n        {\n            int x = 10;\n            Method5(out i, ref x);\n        }\n\n        public void Method5Call2()\n        {\n            int x;\n            Method5Call1(out x); // Compliant, reporting on this can be considered false positive, although it's not.\n        }\n\n        public int UsedAsOutInstance()\n        {\n            var list = new List<int>(); // Noncompliant\n            if (InvokeOut(out list))\n            {\n                return list.Count;\n            }\n            else\n            {\n                return 0;\n            }\n\n            bool InvokeOut(out List<int> list)\n            {\n                list = null;\n                return true;\n            }\n        }\n\n\n        public List<int> Method6()\n        {\n            var i = 10;\n            Action a = () => { Console.WriteLine(i); };\n            i = 11;     // Not reporting on captured local variables\n            a();\n\n            return null;\n        }\n\n        public List<int> Method7_Foreach()\n        {\n            foreach (var item in new int[0])\n            {\n                Console.WriteLine(item);\n            }\n\n            foreach (var    // Compliant, this rule should not raise on unused variables\n                item\n                in new int[0])\n            {\n            }\n\n            return null;\n        }\n\n        private void ForEach_AssignedBefore_UsedAfter(string[] args)\n        {\n            var value = 42;\n            foreach (var arg in args)\n            {\n                Console.WriteLine(\"Something else\");\n            }\n            Use(value);\n        }\n\n        private void ForEach_AssignedBefore_UsedAfterNested(string[] args)\n        {\n            foreach(var outer in args)\n            {\n                var value = 42;\n                foreach (var inner in args)\n                {\n                    Console.WriteLine(\"Something else\");\n                }\n                Use(value);\n            }\n        }\n\n        private int ForEach_AssignedIn_UsedAfter(string[] args)\n        {\n            var value = -1;\n            foreach (var arg in args)\n            {\n                if (arg == null)\n                    value = 0;\n            }\n            return value;\n        }\n\n        private void ForEach_AssignedIn_UsedAfter_Nested(string[] args)\n        {\n            foreach(var outer in args)\n            {\n                var ret = false;\n                foreach (var inner in args)\n                {\n                    if (inner == null)\n                        ret = true;\n                }\n                Use(ret);\n            }\n        }\n\n        private void ForEach_NestedLock_AssignedIn_UsedAfter(string[] args)\n        {\n            lock (args)\n            {\n                var ret = false;\n                foreach (var arg in args)\n                {\n                    if (arg == null)\n                        ret = true;\n                }\n                Use(ret);\n            }\n        }\n\n        public void Unused()\n        {\n            var x = 5;  // Compliant, S1481 already reports on unused.\n\n            var y = 5;  // Noncompliant\n            y = 6;      // Noncompliant\n\n            string f;\n            f = \"something\"; // Noncompliant\n        }\n\n        // https://github.com/SonarSource/sonar-dotnet/issues/4937\n        private void ConditionalEvaluation(bool b1, bool b2, object coalesce, object coalesceAssignment)\n        {\n            var x = false;  // Compliant ignored value\n            x = true;       // Noncompliant\n            x = b1 && b2;   // Noncompliant\n            x = b1 || b2;   // Noncompliant\n            coalesce = coalesce ?? \"Value\";   // Noncompliant\n            coalesceAssignment ??= \"Value\";   // Noncompliant\n        }\n\n        private void SimpleAssignment()\n        {\n            var x = 42; // Noncompliant\n            (x) = 42;   // Noncompliant\n            x = 42;     // Noncompliant\n\n            var y = 0;  // Compliant, ignored value\n            (y) = 42;   // Noncompliant\n            y = 42;     // Noncompliant\n        }\n\n        private void Arrow(int arg) =>\n            arg = 42; // Noncompliant\n\n        public int ArrowProperty\n        {\n            get => 42;\n            set => value = 42;  // Noncompliant\n        }\n\n        private class NameOfTest\n        {\n            private int MyProp2\n            {\n                get\n                {\n                    var i = 10; // Compliant\n                    if (nameof(((i))) == \"i\")\n                    {\n                        i = 11;\n                    }\n                    else\n                    {\n                        i = 12;\n                    }\n                    Console.WriteLine(i);\n\n                    return 0;\n                }\n            }\n\n            private static string nameof(int i)\n            {\n                return \"some text\";\n            }\n        }\n\n        private class ActorBase\n        {\n            public virtual int Create()\n            {\n                var number = 5;\n                try\n                {\n                    return 0;\n                }\n                catch\n                {\n                    return number;\n                }\n            }\n        }\n    }\n\n    public class CSharp8\n    {\n\n        public interface IWithDefaultImplementation\n        {\n            decimal Count { get; set; }\n            decimal Price { get; set; }\n\n            //Default interface methods\n            decimal Total(decimal discount)\n            {\n                decimal bias;\n                bias = 42.42M;   // Noncompliant\n                bias = 0;\n                var ret = bias + Count * Price * (1 - discount);\n                discount = 0;   // Noncompliant\n                return ret;\n            }\n        }\n\n        public class StaticLocalFunctions\n        {\n            public int DoSomething(int a)\n            {\n                static int LocalFunction(int x)\n                {\n                    int seed;\n                    seed = 1;       // Noncompliant\n                    seed = 42;\n                    return x + seed;\n                }\n\n                return LocalFunction(a);\n            }\n        }\n\n        public class SwitchExpressions\n        {\n            int Compute(int a, bool isOK)\n            {\n                var state = a;  //Compliant, it is used inside switch expression\n                state = isOK switch\n                {\n                    true => (state + 1) % 4,\n                    false => state\n                };\n                return state;\n            }\n        }\n\n        public class NullCoalescingAssignment\n        {\n            int[] Compute(int[] arr)\n            {\n                var lst = arr;    //Compliant\n                var unused = arr;\n                lst ??= new int[0];\n                unused ??= new int[0];  // Noncompliant\n                return lst;\n            }\n        }\n\n    }\n\n    public class AkkaSnippet\n    {\n        internal void OnlyFinally(object actor)\n        {\n            try\n            {\n                Foo(actor);\n            }\n            finally\n            {\n                actor = null; // Noncompliant\n            }\n        }\n\n        internal void OnlyFinally_WithTryInside(object actor)\n        {\n            try\n            {\n                Foo(actor);\n            }\n            finally\n            {\n                try\n                {\n                    actor = null; // Noncompliant\n                }\n                catch\n                {\n                    Foo(null);\n                }\n            }\n        }\n\n        internal void Finally_Followed_By_Deadstore(object actor)\n        {\n            try\n            {\n                Foo(actor);\n            }\n            finally\n            {\n                actor = null;   // Noncompliant\n            }\n            actor = null;       // Noncompliant\n        }\n\n        internal void SnippetTwo(object actor)\n        {\n            try\n            {\n                Foo(actor);\n            }\n            catch (Exception)\n            {\n                actor = null; // Noncompliant\n            }\n            Foo(null);\n        }\n\n        internal void SnippetThree(object actor, int i)\n        {\n            try\n            {\n                Foo(actor);\n            }\n            catch (Exception) when (i == 1)\n            {\n                actor = null; // Noncompliant\n            }\n            finally\n            {\n                actor = null; // Noncompliant\n            }\n        }\n\n        private void Foo(object obj) { }\n    }\n\n    public class ReproGithubIssue2311\n    {\n        private void SwitchCaseWithWhenAndLocalScope(object sender, DateTimeKind e)\n        {\n            var tab = new string(' ', 2);\n            switch (e)\n            {\n                case DateTimeKind.Local:\n                    {\n                        Console.WriteLine(tab);\n                        break;\n                    }\n\n                case DateTimeKind.Unspecified when tab == \"  \":\n                    {\n                        break;\n                    }\n            }\n        }\n\n        private void SwitchCaseWithLocalScope(object sender, DateTimeKind e)\n        {\n            var tab = new string(' ', 2);\n            switch (e)\n            {\n                case DateTimeKind.Local:\n                    {\n                        Console.WriteLine(tab);\n                        break;\n                    }\n\n                case DateTimeKind.Unspecified:\n                    {\n                        break;\n                    }\n            }\n        }\n\n        private void SwitchCase(object sender, DateTimeKind e)\n        {\n            var tab = new string(' ', 2);\n            switch (e)\n            {\n                case DateTimeKind.Utc:\n                    Console.WriteLine(tab);\n                    break;\n\n                case DateTimeKind.Unspecified:\n                    break;\n            }\n        }\n    }\n\n    class NullConditionalOperatorInTry\n    {\n        private void Method(bool condition)\n        {\n            var i = 5;          // Noncompliant    FP\n            M(i += 1, i += 1);  // the first one is an FP, the second a TP\n        //    ^^^^^^               Noncompliant\n        //            ^^^^^^       Noncompliant@-1\n        }\n\n        void M(int i, int j)\n        {\n            Console.WriteLine(i);\n            Console.WriteLine(j);\n        }\n    }\n\n    class ObjectInitializer\n    {\n        public int ID { get; set; }\n\n        void Method()\n        {\n            var x = new ObjectInitializer();     // Noncompliant\n            x = new ObjectInitializer { ID = 1 };\n            x.Method();\n        }\n    }\n\n    class TernaryInTry\n    {\n        void Method(out string param, string param2)\n        {\n            var s = \"\";     // FN\n            s = param2 switch\n            {\n                \"a\" => \"a\",\n                _ => \"b\"\n            };\n            param = s;\n        }\n    }\n\n    class OutParameter\n    {\n        void Method(out string param)\n        {\n            var s = \"\";     // FN\n            Method(out s);\n            param = s;\n        }\n    }\n\n    public class ReproGithubIssue697\n    {\n        private bool DoStuff() => true;\n\n        public void Foo()\n        {\n            bool shouldCatch = false;   // Compliant, ignored value\n            try\n            {\n                shouldCatch = true; // ok, is read in catch filter\n                throw new InvalidOperationException(\"bar\");\n            }\n            catch (Exception) when (shouldCatch)\n            {\n                Console.WriteLine(\"Error\");\n            }\n        }\n\n        public void Bar(bool cond)\n        {\n            bool shouldCatch = false;   // Compliant, ignored value\n            try\n            {\n                DoStuff();\n                shouldCatch = true; // ok, read in catch filter\n                if (cond)\n                {\n                    throw new InvalidOperationException(\"bar\");\n                }\n            }\n            catch (Exception) when (shouldCatch)\n            {\n                Console.WriteLine(\"Error\");\n            }\n        }\n\n    }\n\n    public class ReproGithubIssue2393\n    {\n        public static void RetryOnException(int retries)\n        {\n            var attempts = 0;\n            do\n            {\n                try\n                {\n                    attempts++;\n                    DoNothing();\n                    break;\n                }\n                catch (Exception ex)    // Compliant, this rule should not raise on unused variables\n                {\n                    if (attempts > retries)\n                        throw;\n                }\n            } while (true);\n        }\n\n        public static void ComplexRetryOnException(int retries)\n        {\n            var attempts = 0;\n            try\n            {\n                do\n                {\n                    if (retries > 0)\n                    {\n                        DoNothing();\n                        try\n                        {\n                            attempts++;\n                            DoNothing();\n                            break;\n                        }\n                        catch (ArgumentException ex)    // Compliant, this rule should not raise on unused variables\n                        {\n                            DoNothing();\n                        }\n                    }\n                } while (true);\n            }\n            catch (Exception ex)\n            {\n                ex = null;              // Noncompliant\n                if (attempts > retries)\n                    throw;\n                DoNothing();\n            }\n        }\n\n        public void LoopWithFinally()\n        {\n            bool isFirst = true;\n            foreach (var i in Enumerable.Range(1, 10))  // Compliant, this rule should not raise on unused variables\n            {\n                try\n                {\n                    DoNothing(isFirst);\n                }\n                finally\n                {\n                    isFirst = false; // is used in DoNothing, after loop\n                }\n            }\n        }\n\n        private static void DoNothing() { }\n        private static void DoNothing(bool b) { }\n    }\n\n    public static class ReproIssues\n    {\n        // https://github.com/SonarSource/sonar-dotnet/issues/2760\n        public static long WithNonIgnored_Declaration(string path)\n        {\n            long length = 42; // Compliant, FileInfo can throw and function can return this value\n            try\n            {\n                length = new System.IO.FileInfo(path).Length;\n            }\n            catch (Exception e)\n            {\n                Console.WriteLine(e);\n            }\n            return length;\n        }\n\n        public static long WithNonIgnored_Assignment(string path)\n        {\n            long length;\n            length = 42; // Compliant, FileInfo can throw and function can return this value\n            try\n            {\n                length = new System.IO.FileInfo(path).Length;\n            }\n            catch (Exception e)\n            {\n                Console.WriteLine(e);\n            }\n            return length;\n        }\n\n        // https://github.com/SonarSource/sonar-dotnet/issues/2596\n        public static long WithConstantValue(string path)\n        {\n            const int unknownfilelength = -1;\n            long length = unknownfilelength; // Compliant, ignored value\n            try\n            {\n                length = new System.IO.FileInfo(path).Length;\n            }\n            catch (Exception e)\n            {\n                Console.WriteLine(e);\n            }\n            return length;\n        }\n\n        public static long WithMinus1(string path)\n        {\n            long length = -1;   // Compliant, ignored value\n            try\n            {\n                length = new System.IO.FileInfo(path).Length;\n            }\n            catch (Exception e)\n            {\n                Console.WriteLine(e);\n            }\n            return length;\n        }\n\n        const int UNKNOWN = -1;\n        public static long WithClassConstant(string path)\n        {\n            long length = UNKNOWN; // Compliant, ignored value\n            try\n            {\n                length = new System.IO.FileInfo(path).Length;\n            }\n            catch (Exception e)\n            {\n                Console.WriteLine(e);\n            }\n            return length;\n        }\n\n        // https://github.com/SonarSource/sonar-dotnet/issues/2598\n        public static string WithCastedNull(string path)\n        {\n            var length = (string)null; // Compliant, ignored value\n            try\n            {\n                length = new System.IO.FileInfo(path).Length.ToString();\n            }\n            catch (Exception e)\n            {\n                Console.WriteLine(e);\n            }\n            return length;\n        }\n\n        public static string WithDefault(string path)\n        {\n            string length = default(string);    // Compliant, ignored value\n            try\n            {\n                length = new System.IO.FileInfo(path).Length.ToString();\n            }\n            catch (Exception e)\n            {\n                Console.WriteLine(e);\n            }\n            return length;\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/2600\n    public class FooBarBaz\n    {\n        public int Start()\n        {\n            const int x = -1;\n            int exitCode = x;           // Compliant, ignored value\n            Exception exception = null; // Compliant, ignored value\n\n            try\n            {\n                Archive();\n\n                exitCode = 1;\n            }\n            catch (SystemException e)\n            {\n                exception = e; // Noncompliant\n            }\n\n            return exitCode;\n        }\n\n        public void Archive() { }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/2426\n    public class ReproGithubIssue2426\n    {\n        public int VarPatternCheck(string value)\n        {\n            switch (value)\n            {\n                case var x when x == \"one\":\n                    return 1;\n\n                default:\n                    return 0;\n            }\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/2607\n    public class Verify2607\n    {\n        public static void DeadStore(int[] array)\n        {\n            var x = 0;      // Compliant, ignored value\n            x = array[^1];  // Noncompliant\n            try\n            {\n                x = 11;     // Noncompliant\n                x = 12;\n                Console.Write(x);\n                x = 13;     // Noncompliant\n            }\n            catch (Exception)\n            {\n                x = 21;     // Noncompliant\n                x = 22;\n                Console.Write(x);\n                x = 23;     // Noncompliant\n            }\n            x = 31;         // Noncompliant\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/3094\n    public class TupleReturn\n    {\n        public static (int foo, int bar) M(string text)\n        {\n            int b = int.Parse(text);\n            return (1, b);\n        }\n\n        public void UnusedTuple()\n        {\n            (int x, int y) t = (1, 2); // Compliant, rule shouldn't raise on unused because S1481 does.\n        }\n\n        public void UsedTuple()\n        {\n            (int x, int y) t = (1, 2); // Noncompliant\n            t = (0, 0);\n            Use(t);\n        }\n\n        private void Use((int, int) t) { }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/3126\n    public class Issue_3126\n    {\n        public string VariableDeclarator_WithLocalFunction()\n        {\n            string buffer = \"Value\"; // Compliant\n            return Local();\n\n            string Local()\n            {\n                return buffer;\n            }\n        }\n\n        public string Assignment_WithLocalFunction()\n        {\n            string buffer;\n            buffer = \"Value\"; // Compliant\n            return Local();\n\n            string Local()\n            {\n                return buffer;\n            }\n        }\n\n        public int PrefixExpression_WithLocalFunction()\n        {\n            var count = 0;\n            ++count;        // Compliant\n            return Local();\n\n            int Local()\n            {\n                return count;\n            }\n        }\n\n        public int PostfixExpression_WithLocalFunction()\n        {\n            var count = 0;\n            count++;        // Compliant\n            return Local();\n\n            int Local()\n            {\n                return count;\n            }\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/3304\n    public class Repro_3304\n    {\n        public void WithRefKeyword(int[] values)\n        {\n            ref int value = ref values[0];  // Compliant, because `value` keeps the reference to `values[0]`, and below `default` is actually assigned to `values[0]`\n            value = default;                // Compliant, because it's ref variable and value is propagated somewhere\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/3348\n    public class Repro_3348\n    {\n        public int Indices(int[] values)\n        {\n            var index = 2; // Compliant, value is used in Indice\n            return values[^index];\n        }\n\n        public int[] Ranges(int[] values)\n        {\n            var first = 2; // Compliant, value is used in Range\n            var last = 22; // Compliant, value is used in Range\n            return values[first..last];\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/3719\n    public class Repro_3719\n    {\n        public void UseVariableInLocalPredicate()\n        {\n            bool usedBool = BoolInitializer(true); // Compliant, value is used in local predicate function\n            var list = new List<bool>();\n            list.Where(LocalPredicate);\n\n            bool LocalPredicate(bool input)\n            {\n                return usedBool && input;\n            }\n\n            bool BoolInitializer(bool value)\n            {\n                return value;\n            }\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/2303\n    public class Repro_2303\n    {\n        public void WithRefKeywrod()\n        {\n            Span<int> span = new[] { 42 };\n            int j = 0;\n\n            foreach (ref var e in span)\n            {\n                e = j--; // Compliant because of ref keyword\n            }\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/2766\n    public class Repro_2766\n    {\n        public int WithTryCatch()\n        {\n            var name = string.Empty;    // Compliant, ignored value\n            try\n            {\n                var values = GetValues();\n                name = values.name; // Compliant, DoWork can throw\n\n                DoWork();\n                return 5;\n            }\n            catch (Exception e)\n            {\n                Console.WriteLine($\"{name}: {e}\");\n                throw;\n            }\n        }\n\n        private (string name, int count) GetValues() => (\"foo\", 1);\n\n        private void DoWork() => throw new InvalidOperationException(\"bang\");\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/2761\n    public class Repro_2761\n    {\n        public static void CreateDirectory(string directory)\n        {\n            const int CopyWaitInterval = 250;\n            bool created = false;               // Compliant, ignored value\n            int attempts = 10;\n\n            do\n            {\n                try\n                {\n                    System.IO.Directory.CreateDirectory(directory);\n                    created = true;\n                }\n                catch (UnauthorizedAccessException)\n                {\n                    if (attempts == 0)\n                    {\n                        throw;\n                    }\n                }\n\n                if (!created)   // Compliant\n                {\n                    --attempts;\n                }\n            } while (!created); // Compliant\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/4948\n    public class Repro_4948\n    {\n        private bool condition;\n\n        public void UsedInFinally()\n        {\n            int value = 42; // Compliant\n            try\n            {\n                SomethingThatCanThrow();\n                value = 0;\n            }\n            finally\n            {\n                Use(value);\n            }\n        }\n\n        public void UsedInFinally_NestedInLambda()\n        {\n            try\n            {\n                Action a = () =>\n                {\n                    int value = 42; // Compliant\n                    try\n                    {\n                        SomethingThatCanThrow();\n                        value = 0;\n                    }\n                    finally\n                    {\n                        Use(value);\n                    }\n                };\n            }\n            finally\n            {\n            }\n        }\n\n        public void UsedInFinally_Throw()\n        {\n            var value = 42; // Compliant\n            try\n            {\n                throw new Exception();\n            }\n            finally\n            {\n                Use(value);\n            }\n        }\n\n        public void UsedInFinally_Throw_FilteredCatch()\n        {\n            var value = 42; // Compliant\n            try\n            {\n                throw new Exception();\n            }\n            catch (FormatException)\n            {\n                value = 42;\n            }\n            catch when (condition)\n            {\n                value = 42;\n            }\n            finally\n            {\n                Use(value);\n            }\n        }\n\n        public void UsedInFinally_Throw_CatchAll()\n        {\n            var value = 42; // Noncompliant\n            try\n            {\n                throw new Exception();\n            }\n            catch\n            {\n                value = 0;\n            }\n            finally\n            {\n                Use(value);\n            }\n        }\n\n        // https://sonarsource.atlassian.net/browse/NET-2346\n        public void UsedInFinally_AfterOtherAssignment()\n        {\n            int value = 42;\n            try\n            {\n                SomethingThatCanThrow();\n            }\n            catch (Exception ex)\n            {\n                value = 0; // Compliant\n                throw;\n            }\n            finally\n            {\n                object o;\n                o = \"\"; // Noncompliant TP. Any assignment (also `var s = \"\";` or `var o = new object();`) hides the usage of `value` in the next line\n                Use(value);\n            }\n        }\n\n        private void SomethingThatCanThrow() { }\n        private void Use(int arg) { }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/4949\n    public class Repro_4949\n    {\n        public void TryReturns_Loop()\n        {\n            var counter = 0;\n            while (counter < 5)\n            {\n                counter++;  // Compliant\n                try\n                {\n                    SomethingThatCanThrow();\n                    return;\n                }\n                catch (TimeoutException)\n                {\n                    // Continue loop to the next try\n                }\n            }\n        }\n\n        private void SomethingThatCanThrow() { }\n    }\n}\n\npublic class PeachValidation\n{\n    // https://github.com/SonarSource/sonar-dotnet/issues/9466\n    public int ReadInFinallyAfterCatch()\n    {\n        var value = 0;\n        try\n        {\n            CanThrow();\n            value = 42;\n        }\n        catch\n        {\n            value = 1;\n            throw;\n        }\n        finally\n        {\n            Log(value);\n        }\n        return value;\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/9467\n    public int ReadAfterCatchAll_WithType(bool condition)\n    {\n        var value = 100;    // used after catch all\n        try\n        {\n            CanThrow();\n            if (condition)\n            {\n                CanThrow();\n            }\n            value = 200;\n        }\n        catch (Exception exc)\n        {\n        }\n        return value;\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/9467\n    public int ReadAfterCatchAll_NoType(bool condition)\n    {\n        var value = 100;    // used after catch all\n        try\n        {\n            CanThrow();\n            if (condition)\n            {\n                CanThrow();\n            }\n            value = 200;\n        }\n        catch (Exception exc)\n        {\n        }\n        return value;\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/9467\n    public void ReadInCatch_WithBranching(bool condition)\n    {\n        var value = 100;    // used in catch\n        try\n        {\n            value = CanThrow();\n            if (condition)\n            {\n                CanThrow();\n            }\n            else\n            {\n                CanThrow();\n            }\n        }\n        catch\n        {\n            Log(value);\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/9468\n    public void NestedCatchAndRethrow()\n    {\n        var value = 100;\n        try\n        {\n            try\n            {\n                CanThrow();\n            }\n            catch\n            {\n                value = 200;  // Compliant, catch rethrows and moves to the next catch.\n                throw;\n            }\n        }\n        catch\n        {\n            Log(value);\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/9471\n    void AssignmentInTernary(bool condition, string st)\n    {\n        string st2 = condition ? st = \"Hi\" : \"Hello\"; // Compliant\n        Console.WriteLine(st);\n        Console.WriteLine(st2);\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/9472\n    void AssignmentInSwitch()\n    {\n        char ch;\n        switch (ch = GetAChar())   // Compliant\n        {\n            case 'A':\n                break;\n            case 'B':\n                Console.WriteLine(ch);\n                break;\n            default:\n                Console.WriteLine(\"Something\");\n                break;\n        }\n        char GetAChar() => 'c';\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/9473\n    void ReassignAfterUsing(IDisposable data)\n    {\n        using (data = Something()) // Compliant - if Something() throws, value will be used directly in Console.WriteLine(data);\n        {\n            data = Something();\n        }\n        Console.WriteLine(data);\n\n        IDisposable Something() => null;\n    }\n\n    private int CanThrow() =>\n        throw new Exception();\n\n    private void Log(int value) { }\n\n    void LoopInsideTryCatch(List<object> list, bool condition)\n    {\n        object value  = null;\n        try\n        {\n            while (condition)\n            {\n                value  = list.FirstOrDefault(); // Compliant, it's used in catch\n            }\n        }\n        catch (Exception e)\n        {\n            Console.WriteLine(value );\n        }\n    }\n\n    void LoopInsideTryCatch_Finally(List<object> list, bool condition)\n    {\n        object value = null;\n        try\n        {\n            while (condition)\n            {\n                value = list.FirstOrDefault(); // Compliant, it's used in finally\n            }\n        }\n        catch { }\n        finally\n        {\n            Console.WriteLine(value);\n        }\n    }\n\n    void LoopAndBranchingInsideTryCatch_Finally(List<object> list, bool condition)\n    {\n        object arg1 = null;\n        object arg2 = null;\n        object arg3 = null;\n        object arg4 = null;\n        try\n        {\n            while (condition)\n            {\n                arg1 = list.FirstOrDefault();   // Compliant, it's used in catch\n                if (list.Count > 10)\n                {\n                    arg2 = arg1;                // Compliant, it's used in catch\n                    foreach (var item in list)\n                    {\n                        arg3 = item;            // Compliant, it's used in catch\n                        try\n                        {\n                            foreach (var innerItem in list)\n                            {\n                                arg4 = item;    // Compliant, it's used in catch\n                            }\n                        }\n                        catch { throw; }       // this propagates the livein - liveout to the outer catch\n                    }\n                }\n            }\n        }\n        catch\n        {\n            Console.WriteLine(arg1);\n            Console.WriteLine(arg2);\n            Console.WriteLine(arg3);\n            Console.WriteLine(arg4);\n        }\n    }\n\n    void VariableReassignedInCatch()\n    {\n        var usedInCatch = 0;\n        Method(0);\n        try\n        {\n            Method(1);\n            try\n            {\n                usedInCatch = 1;\n                Method(2);\n            }\n            catch\n            {\n                Method(usedInCatch); // This can throw again\n                usedInCatch = 2;     // If Method(3) throws the variable will be used in the outer catch\n                Method(3);\n            }\n        }\n        catch\n        {\n            Method(usedInCatch);\n            Method(4);\n        }\n    }\n\n    void VariableUsedInOuterFinally(bool condition)\n    {\n        var usedInOuterFinally = 0;\n        try\n        {\n            usedInOuterFinally = 1;\n            Method(0);\n            try\n            {\n                Method(1);\n            }\n            finally\n            {\n                usedInOuterFinally = 2; // Compliant - used in outer finally\n                Method(2);\n            }\n        }\n        catch (Exception ex)\n        {\n            try\n            {\n                Method(3);\n            }\n            finally\n            {\n                Method(usedInOuterFinally);\n            }\n        }\n    }\n\n    void Method(int arg) { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DeadStores.SonarCfg.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.Versioning;\n\nnamespace Tests.Diagnostics\n{\n    public class Resource : IDisposable\n    {\n        public void Dispose()\n        {\n        }\n        public int DoSomething()\n        {\n            return 1;\n        }\n        public int DoSomethingElse()\n        {\n            return 5;\n        }\n\n        public void IgnoredValues()\n        {\n            var stringEmpty = string.Empty; // Compliant\n            stringEmpty = \"other\";\n\n            string stringNull = null; // Compliant\n            stringNull = \"other\";\n\n            var boolFalse = false; // Compliant\n            boolFalse = true;\n\n            var boolTrue = true; // Compliant\n            boolTrue = false;\n\n            object objectNull = null; // Compliant\n            objectNull = new object();\n\n            var intZero = 0; // Compliant\n            intZero = 42;\n\n            var intOne = 1; // Compliant\n            intOne = 42;\n\n            var intMinusOne = -1; // Compliant\n            intMinusOne = 42;\n\n            var intPlusOne = +1; // Compliant\n            intPlusOne = 42;\n\n            var emptyStringLiteral = \"\"; // Compliant\n            emptyStringLiteral = \"other\";\n\n            var emptyInterpolatedStringLiteral = $\"\"; // Compliant\n            emptyInterpolatedStringLiteral = \"other\";\n\n            // Variables should be used in order the rule to trigger\n            Console.WriteLine(\"\", emptyStringLiteral, emptyInterpolatedStringLiteral, stringEmpty, stringNull, boolFalse, boolTrue,\n                objectNull, intZero, intOne, intMinusOne, intPlusOne);\n        }\n\n        public void ExpressionResultsInConstantIgnoredValue()\n        {\n            var boolFalse = 0 != 0;     // Noncompliant, only explicit 'false' is ignored by the rule\n            boolFalse = true;\n\n            var boolTrue = 0 == 0;      // Noncompliant\n            boolTrue = false;\n\n            var intZero = 1 - 1;        // Noncompliant\n            intZero = 42;\n\n            var intOne = 0 + 1;         // Noncompliant\n            intOne = 42;\n\n            var intMinusOne = 0 - 1;    // Noncompliant\n            intMinusOne = 42;\n\n            // Variables should be used in order the rule to trigger\n            Console.WriteLine(\"\", boolFalse, boolTrue, intZero, intOne, intMinusOne);\n        }\n\n        public void Defaults()\n        {\n            var s = default(string); // Compliant\n            s = \"\";\n\n            var b = default(bool); // Compliant\n            b = true;\n\n            var o = default(object); // Compliant\n            o = new object();\n\n            var i = default(int); // Compliant\n            i = 42;\n\n            // Variables should be used in order the rule to trigger\n            Console.WriteLine(\"\", s, b, o, i);\n        }\n\n        // https://sonarsource.atlassian.net/browse/NET-2976\n        public void TypeSpecificDefaultValues()\n        {\n            IntPtr ptr = IntPtr.Zero; // Compliant\n            ptr = new IntPtr(42);\n            Console.WriteLine(ptr);\n\n            UIntPtr uptr = UIntPtr.Zero; // Compliant\n            uptr = new UIntPtr(42);\n            Console.WriteLine(uptr);\n\n            Guid id = Guid.Empty; // Compliant\n            id = Guid.NewGuid();\n            Console.WriteLine(id);\n        }\n    }\n\n    public class DeadStores\n    {\n        public int Property { get; set; }\n\n        int doSomething() => 1;\n        int doSomethingElse() => 1;\n\n        void calculateRate(int a, int b)\n        {\n            b = doSomething(); // Noncompliant {{Remove this useless assignment to local variable 'b'.}}\n//            ^^^^^^^^^^^^^^^\n\n            int i, j;\n            i = a + 12;\n            i += i + 2; // Noncompliant\n            i = 5;\n            j = i;\n            i\n                = doSomething(); // Noncompliant; retrieved value overwritten in for loop\n            for (i = 0; i < j + 10; i++)\n            {\n                //  ...\n            }\n\n            if ((i = doSomething()) == 5 ||\n                (i = doSomethingElse()) == 5)\n            {\n                i += 5; // Noncompliant\n            }\n\n            var resource = new Resource(); // Noncompliant; retrieved value not used\n            using (resource = new Resource())\n            {\n                resource.DoSomething();\n            }\n\n            var x\n                = 10; // Noncompliant\n            var y =\n                x = 11; // Noncompliant\n            Console.WriteLine(y);\n\n            int k = 12; // Noncompliant\n            X(out k);   // Compliant, not reporting on out parameters\n        }\n        void X(out int i) { i = 10; }\n\n        void calculateRate2(int a, int b)\n        {\n            var x = 0;\n            x = 1; // Noncompliant\n            try\n            {\n                x = 11; // Noncompliant\n                x = 12;\n                Console.Write(x);\n                x = 13; // Noncompliant\n            }\n            catch (Exception)\n            {\n                x = 21; // Noncompliant\n                x = 22;\n                Console.Write(x);\n                x = 23; // Noncompliant\n            }\n            x = 31; // Noncompliant\n        }\n\n        void storeI(int i) { }\n\n        void calculateRate3(int a, int b)\n        {\n            int i;\n\n            i = doSomething();\n            i += a + b;\n            storeI(i);\n\n            for (i = 0; i < 10; i++)\n            {\n                //  ...\n            }\n        }\n\n        int pow(int a, int b)\n        {\n            if (b == 0)\n            {\n                return 0;\n            }\n            int x = a;\n            for (int i = 1; i < b; i++)\n            {\n                x = x * a;  //Not detected yet, we are in a loop, Dead store because the last return statement should return x instead of returning a\n            }\n            return a;\n        }\n\n        public void Assignment(DeadStores sender)\n        {\n            // Compliant cases\n            sender.Property += 42;\n            sender.Property = 42;\n            Property += 42;\n            Property = 42;\n            undefined += 42;    // Error [CS0103]: The name 'undefined' does not exist in the current context\n            undefined = 42;     // Error [CS0103]: The name 'undefined' does not exist in the current context\n\n            var captured = 10;\n            Action a = () => { Console.WriteLine(captured); };\n            captured += 11;     // Not reporting on captured local variables\n\n            var add = 40;\n            add += 2;\n            Use(add);\n            add += 100;     // Noncompliant\n\n            var sub = 40;\n            sub -= 2;\n            Use(sub);\n            sub -= 100;     // Noncompliant\n\n            var mul = 40;\n            mul *= 2;\n            Use(mul);\n            mul *= 100;     // Noncompliant\n\n            var div = 40;\n            div /= 2;\n            Use(div);\n            div /= 100;     // Noncompliant\n\n            var mod = 40;\n            mod += 2;\n            Use(mod);\n            mod %= 100;     // Noncompliant\n\n            var and = false;\n            and &= true;\n            Use(and);\n            and &= false;   // Noncompliant\n\n            var or = false;\n            or |= false;\n            Use(or);\n            or |= true;     // Noncompliant\n\n            var xor = 40;\n            xor ^= 2;\n            Use(xor);\n            xor ^= 100;     // Noncompliant\n\n            var left = 40;\n            left <<= 2;\n            Use(left);\n            left <<= 100;   // Noncompliant\n\n            var right = 40;\n            right >>= 2;\n            Use(right);\n            right >>= 100;  // Noncompliant\n\n            string coa = SomeString();\n            coa ??= SomeString();\n            Use(coa);\n            coa ??= SomeString();  // Noncompliant\n\n        }\n\n        private void Use(int arg) { }\n        private void Use(bool arg) { }\n        private void Use(string arg) { }\n        private string SomeString() => null;\n\n        public void Switch()\n        {\n            const int c = 5; // Compliant\n            var b = 5;\n            switch (b)\n            {\n                case 6:\n                    b = 5; // Noncompliant\n                    break;\n                case 7:\n                    b = 56; // Noncompliant\n                    break;\n                case c:\n                    break;\n            }\n\n            b = 7;\n            Console.Write(b);\n            b += 7; // Noncompliant\n        }\n\n        public int Switch1(int x)\n        {\n            var b = 0; // Compliant\n            switch (x)\n            {\n                case 6:\n                    b = 5;\n                    break;\n                case 7:\n                    b = 56;\n                    break;\n                default:\n                    b = 0;\n                    break;\n            }\n\n            return b;\n        }\n\n        public int Switch2(int x)\n        {\n            var b = 0; // Compliant\n            switch (x)\n            {\n                case 6:\n                    b = 5;\n                    break;\n                case 7:\n                    b = 56;\n                    break;\n            }\n\n            return b;\n        }\n\n        private int MyProp\n        {\n            get\n            {\n                var i = 10;\n                Console.WriteLine(i);\n                i++; // Noncompliant\n                i = 12;\n                ++i; // Noncompliant\n                i = 12;\n                var a = ++i;\n                return a;\n            }\n        }\n\n        private int MyProp2\n        {\n            get\n            {\n                var i = 10; // Noncompliant\n                if (nameof(((i))) == \"i\") // Error [CS8081]\n                {\n                    i = 11;\n                }\n                else\n                {\n                    i = 12;\n                }\n                Console.WriteLine(i);\n\n                return 42;\n            }\n        }\n\n        public List<int> Method(int i)\n        {\n            var l = new List<int>();\n\n            Func<List<int>> func = () =>\n            {\n                return (l = new List<int>(new[] { i }));\n            };\n\n            var x = l; // Noncompliant\n            x = null;  // Noncompliant\n\n            return func();\n        }\n\n        public List<int> Method2(int i)\n        {\n            var l = new List<int>(); // Compliant, not reporting on captured variables\n\n            return (() => // Error [CS0149] - no method name\n            {\n                var k = 10; // Noncompliant\n                k = 12; // Noncompliant\n                return (l = new List<int>(new[] { i })); // l captured here\n            })();\n        }\n\n        public List<int> Method3(int i)\n        {\n            bool f = false;\n            if (true || (f = false))\n            {\n                if (f) { }\n            }\n\n            return null;\n        }\n\n        public List<int> Method4(int i)\n        {\n            bool f;\n            f = true;\n            if (true || (f = false))\n            {\n                if (f) { }\n            }\n\n            return null;\n        }\n\n        public List<int> Method5(out int i, ref int j)\n        {\n            i = 10; // Compliant, out parameter\n\n            j = 11;\n            if (j == 11)\n            {\n                j = 12; // Compliant, ref parameter\n            }\n\n            return null;\n        }\n        public void Method5Call1(out int i)\n        {\n            int x = 10;\n            Method5(out i, ref x);\n        }\n\n        public void Method5Call2()\n        {\n            int x;\n            Method5Call1(out x); // Compliant, reporting on this can be considered false positive, although it's not.\n        }\n\n        public List<int> Method6()\n        {\n            var i = 10;\n            Action a = () => { Console.WriteLine(i); };\n            i = 11;     // Not reporting on captured local variables\n            a();\n\n            return null;\n        }\n\n        public List<int> Method7_Foreach()\n        {\n            foreach (var item in new int[0])\n            {\n                Console.WriteLine(item);\n            }\n\n            foreach (var\n                item // A new value is assigned here, which is not used. But we are not reporting on it.\n                in new int[0])\n            {\n            }\n\n            return null;\n        }\n\n        public void Unused()\n        {\n            var x = 5; // Compliant, S1481 already reports on it.\n\n            var y = 5; // Noncompliant\n            y = 6; // Noncompliant\n        }\n\n        private void SimpleAssignment(bool b1, bool b2)\n        {\n            var x = false;  // Compliant\n            (x) = b1 && b2; // Noncompliant\n            x = b1 && b2;   // Noncompliant\n        }\n\n        private class NameOfTest\n        {\n            private int MyProp2\n            {\n                get\n                {\n                    var i = 10; // Compliant\n                    if (nameof(((i))) == \"i\")\n                    {\n                        i = 11;\n                    }\n                    else\n                    {\n                        i = 12;\n                    }\n                    Console.WriteLine(i);\n\n                    return 0;\n                }\n            }\n\n            private static string nameof(int i)\n            {\n                return \"some text\";\n            }\n        }\n\n        private class ActorBase\n        {\n            public virtual int Create()\n            {\n                var number = 5;\n                try\n                {\n                    return 0;\n                }\n                catch\n                {\n                    return number;\n                }\n            }\n        }\n    }\n\n    public class CSharp8\n    {\n\n        public interface IWithDefaultImplementation\n        {\n            decimal Count { get; set; }\n            decimal Price { get; set; }\n\n            //Default interface methods\n            decimal Total(decimal discount)\n            {\n                decimal bias;\n                bias = 42.42M;   // Noncompliant\n                bias = 0;\n                var ret = bias + Count * Price * (1 - discount);\n                discount = 0;   // Noncompliant\n                return ret;\n            }\n\n        }\n\n        public class StaticLocalFunctions\n        {\n            public int DoSomething(int a)\n            {\n                static int LocalFunction(int x)\n                {\n                    int seed;\n                    seed = 1;       // Noncompliant\n                    seed = 42;\n                    return x + seed;\n                }\n\n                return LocalFunction(a);\n            }\n        }\n\n        public class SwitchExpressions\n        {\n            int Compute(int a, bool isOK)\n            {\n                var state = a;  //Compliant, it is used inside switch expression\n                state = isOK switch\n                {\n                    true => (state + 1) % 4,\n                    false => state\n                };\n                return state;\n            }\n        }\n\n        public class NullCoalescingAssignment\n        {\n            int[] Compute(int[] arr)\n            {\n                var lst = arr;    //Compliant\n                var unused = arr;\n                lst ??= new int[0];\n                unused ??= new int[0]; //Noncompliant\n                return lst;\n            }\n        }\n\n    }\n\n    public class AkkaSnippet\n    {\n        internal void OnlyFinally(object actor)\n        {\n            try\n            {\n                Foo(actor);\n            }\n            finally\n            {\n                actor = null; // Noncompliant\n            }\n        }\n\n        internal void OnlyFinally_WithTryInside(object actor)\n        {\n            try\n            {\n                Foo(actor);\n            }\n            finally\n            {\n                try\n                {\n                    actor = null; // Noncompliant\n                }\n                catch\n                {\n                    Foo(null);\n                }\n            }\n        }\n\n        internal void Finally_Followed_By_Deadstore(object actor)\n        {\n            try\n            {\n                Foo(actor);\n            }\n            finally\n            {\n                actor = null;   // Noncompliant\n            }\n            actor = null;       // Noncompliant\n        }\n\n        internal void SnippetTwo(object actor)\n        {\n            try\n            {\n                Foo(actor);\n            }\n            catch (Exception)\n            {\n                actor = null; // Noncompliant\n            }\n            Foo(null);\n        }\n\n        internal void SnippetThree(object actor, int i)\n        {\n            try\n            {\n                Foo(actor);\n            }\n            catch (Exception) when (i == 1)\n            {\n                actor = null; // Noncompliant\n            }\n            finally\n            {\n                actor = null; // Noncompliant\n            }\n        }\n\n        private void Foo(object obj) { }\n    }\n\n    public class ReproGithubIssue2311\n    {\n        private void SwitchCaseWithWhenAndLocalScope(object sender, DateTimeKind e)\n        {\n            var tab = new string(' ', 2);\n            switch (e)\n            {\n                case DateTimeKind.Local:\n                    {\n                        Console.WriteLine(tab);\n                        break;\n                    }\n\n                case DateTimeKind.Unspecified when tab == \"  \":\n                    {\n                        break;\n                    }\n            }\n        }\n\n        private void SwitchCaseWithLocalScope(object sender, DateTimeKind e)\n        {\n            var tab = new string(' ', 2);\n            switch (e)\n            {\n                case DateTimeKind.Local:\n                    {\n                        Console.WriteLine(tab);\n                        break;\n                    }\n\n                case DateTimeKind.Unspecified:\n                    {\n                        break;\n                    }\n            }\n        }\n\n        private void SwitchCase(object sender, DateTimeKind e)\n        {\n            var tab = new string(' ', 2);\n            switch (e)\n            {\n                case DateTimeKind.Utc:\n                    Console.WriteLine(tab);\n                    break;\n\n                case DateTimeKind.Unspecified:\n                    break;\n            }\n        }\n    }\n\n    public class ReproGithubIssue697\n    {\n        private bool DoStuff() => true;\n\n        public void Foo()\n        {\n            bool shouldCatch = false;\n            try\n            {\n                shouldCatch = true; // ok, is read in catch filter\n                throw new InvalidOperationException(\"bar\");\n            }\n            catch (Exception) when (shouldCatch)\n            {\n                Console.WriteLine(\"Error\");\n            }\n        }\n\n        public void Bar(bool cond)\n        {\n            bool shouldCatch = false;\n            try\n            {\n                DoStuff();\n                shouldCatch = true; // ok, read in catch filter\n                if (cond)\n                {\n                    throw new InvalidOperationException(\"bar\");\n                }\n            }\n            catch (Exception) when (shouldCatch)\n            {\n                Console.WriteLine(\"Error\");\n            }\n        }\n\n    }\n\n    public class ReproGithubIssue2393\n    {\n        public static void RetryOnException(int retries)\n        {\n            var attempts = 0;\n            do\n            {\n                try\n                {\n                    attempts++;\n                    DoNothing();\n                    break;\n                }\n                catch (Exception ex)\n                {\n                    if (attempts > retries)\n                        throw;\n                }\n            } while (true);\n        }\n\n        public static void ComplexRetryOnException(int retries)\n        {\n            var attempts = 0;\n            try\n            {\n                do\n                {\n                    if (retries > 0)\n                    {\n                        DoNothing();\n                        try\n                        {\n                            attempts++;\n                            DoNothing();\n                            break;\n                        }\n                        catch (ArgumentException ex)\n                        {\n                            DoNothing();\n                        }\n                    }\n                } while (true);\n            }\n            catch (Exception ex)\n            {\n                if (attempts > retries)\n                    throw;\n                DoNothing();\n            }\n        }\n\n        public void Bar()\n        {\n            bool isFirst = true;\n            foreach (var i in System.Linq.Enumerable.Range(1, 10))\n            {\n                try\n                {\n                    DoNothing(isFirst);\n                }\n                finally\n                {\n                    isFirst = false; // is used in DoNothing, after loop\n                }\n            }\n        }\n\n        private static void DoNothing() { }\n        private static void DoNothing(bool b) { }\n    }\n\n    public static class ReproIssues\n    {\n        // https://github.com/SonarSource/sonar-dotnet/issues/2596\n        public static long WithConstantValue(string path)\n        {\n            const int unknownfilelength = -1;\n            long length = unknownfilelength; // Noncompliant FP\n            try\n            {\n                length = new System.IO.FileInfo(path).Length;\n            }\n            catch (Exception e)\n            {\n                Console.WriteLine(e);\n            }\n            return length;\n        }\n\n        public static long WithMinus1(string path)\n        {\n            long length = -1;\n            try\n            {\n                length = new System.IO.FileInfo(path).Length;\n            }\n            catch (Exception e)\n            {\n                Console.WriteLine(e);\n            }\n            return length;\n        }\n\n        const int UNKNOWN = -1;\n        public static long WithClassConstant(string path)\n        {\n            long length = UNKNOWN; // Noncompliant FP\n            try\n            {\n                length = new System.IO.FileInfo(path).Length;\n            }\n            catch (Exception e)\n            {\n                Console.WriteLine(e);\n            }\n            return length;\n        }\n\n        // https://github.com/SonarSource/sonar-dotnet/issues/2598\n        public static string WithCastedNull(string path)\n        {\n            var length = (string)null; // Noncompliant FP\n            try\n            {\n                length = new System.IO.FileInfo(path).Length.ToString();\n            }\n            catch (Exception e)\n            {\n                Console.WriteLine(e);\n            }\n            return length;\n        }\n\n        public static string WithDefault(string path)\n        {\n            string length = default(string);\n            try\n            {\n                length = new System.IO.FileInfo(path).Length.ToString();\n            }\n            catch (Exception e)\n            {\n                Console.WriteLine(e);\n            }\n            return length;\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/2600\n    public class FooBarBaz\n    {\n        public int Start()\n        {\n            const int x = -1;\n            int exitCode = x; // Noncompliant FP\n            Exception exception = null;\n\n            try\n            {\n                Archive();\n\n                exitCode = 1;\n            }\n            catch (SystemException e)\n            {\n                exception = e; // Noncompliant\n            }\n\n            return exitCode;\n        }\n\n        public void Archive() { }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/2426\n    public class ReproGithubIssue2426\n    {\n        public int VarPatternCheck(string value)\n        {\n            switch (value)\n            {\n                case var x when x == \"one\":\n                    return 1;\n\n                default:\n                    return 0;\n            }\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/2607\n    public class Verify2607\n    {\n        public static void DeadStore(int[] array)\n        {\n            var x = 0;\n            x = array[^1]; // Noncompliant\n            try\n            {\n                x = 11; // Noncompliant\n                x = 12;\n                Console.Write(x);\n                x = 13; // Noncompliant\n            }\n            catch (Exception)\n            {\n                x = 21; // Noncompliant\n                x = 22;\n                Console.Write(x);\n                x = 23; // Noncompliant\n            }\n            x = 31; // Noncompliant\n        }\n    }\n\n    // issue https://github.com/SonarSource/sonar-dotnet/issues/3094\n    public class TupleReturn\n    {\n        public static (int foo, int bar) M(string text)\n        {\n            int b = int.Parse(text);\n            return (1, b);\n        }\n\n        public void UnusedTuple_FalseNegative()\n        {\n            (int x, int y) t = (1, 2); // Compliant - FN, tuples are not yet covered: https://github.com/SonarSource/sonar-dotnet/issues/2933\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/3126\n    public class Issue_3126\n    {\n        public string VariableDeclarator_WithLocalFunction()\n        {\n            string buffer = \"Value\"; // Compliant\n            return Local();\n\n            string Local()\n            {\n                return buffer;\n            }\n        }\n\n        public string Assignment_WithLocalFunction()\n        {\n            string buffer;\n            buffer = \"Value\"; // Compliant\n            return Local();\n\n            string Local()\n            {\n                return buffer;\n            }\n        }\n\n        public int PrefixExpression_WithLocalFunction()\n        {\n            var count = 0;\n            ++count;        // Compliant\n            return Local();\n\n            int Local()\n            {\n                return count;\n            }\n        }\n\n        public int PostfixExpression_WithLocalFunction()\n        {\n            var count = 0;\n            count++;        // Compliant\n            return Local();\n\n            int Local()\n            {\n                return count;\n            }\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/3304\n    public class Repro_3304\n    {\n        public void WithRefKeyword(int[] values)\n        {\n            ref int value = ref values[0];  // Compliant, because `value` keeps the reference to `values[0]`, and below `default` is actually assigned to `values[0]`\n            value = default;                // Compliant, because it's ref variable and value is propagated somewhere\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/3348\n    public class Repro_3348\n    {\n        public int Indices(int[] values)\n        {\n            var index = 2; // Compliant, value is used in Indice\n            return values[^index];\n        }\n\n        public int[] Ranges(int[] values)\n        {\n            var first = 2; // Compliant, value is used in Range\n            var last = 22; // Compliant, value is used in Range\n            return values[first..last];\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/3719\n    public class Repro_3719\n    {\n        public void UseVariableInLocalPredicate()\n        {\n            bool usedBool = BoolInitializer(true); // Compliant, value is used in local predicate function\n            var list = new List<bool>();\n            list.Where(LocalPredicate);\n\n            bool LocalPredicate(bool input)\n            {\n                return usedBool && input;\n            }\n\n            bool BoolInitializer(bool value)\n            {\n                return value;\n            }\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/2303\n    public class Repro_2303\n    {\n        public void WithRefKeywrod()\n        {\n            Span<int> span = new[] { 42 };\n            int j = 0;\n\n            foreach (ref var e in span)\n            {\n                e = j--; // Compliant because of ref keyword\n            }\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/2766\n    public class Repro_2766\n    {\n        public int WithTryCatch()\n        {\n            var name = string.Empty;\n            try\n            {\n                var values = GetValues();\n                name = values.name; // Noncompliant FP, DoWork can throw\n\n                DoWork();\n                return 5;\n            }\n            catch (Exception e)\n            {\n                Console.WriteLine($\"{name}: {e}\");\n                throw;\n            }\n        }\n\n        private (string name, int count) GetValues() => (\"foo\", 1);\n\n        private void DoWork() => throw new InvalidOperationException(\"bang\");\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/2761\n    public class Repro_2761\n    {\n        public static void CreateDirectory(string directory)\n        {\n            const int CopyWaitInterval = 250;\n            bool created = false;\n            int attempts = 10;\n\n            do\n            {\n                try\n                {\n                    System.IO.Directory.CreateDirectory(directory);\n                    created = true;\n                }\n                catch (UnauthorizedAccessException)\n                {\n                    if (attempts == 0)\n                    {\n                        throw;\n                    }\n                }\n\n                if (!created)   // Compliant\n                {\n                    --attempts;\n                }\n            } while (!created); // Compliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DebugAssertHasNoSideEffects.Latest.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\n\n\nvar foo = new Foo();\nDebug.Assert(foo.Put()); // Noncompliant\nDebug.Assert(foo.Contains(\"a\"));\n\nrecord R\n{\n    R(Foo foo)\n    {\n        Debug.Assert(foo.Put()); // Noncompliant\n        Debug.Assert(foo.Contains(\"a\"));\n    }\n\n    Foo f;\n    string Property\n    {\n        init\n        {\n            Debug.Assert(f.Put()); // Noncompliant\n            Debug.Assert(f.Contains(value));\n        }\n    }\n}\n\nclass Foo\n{\n    public bool Contains(string arg) => true;\n    public bool Put() => true;\n}\n\nclass ConditionalAssignment\n{\n    bool boolField;\n    void Method(ConditionalAssignment x)\n    {\n        Debug.Assert((x?.boolField = false) ?? false);  // FN\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DebugAssertHasNoSideEffects.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\n\nnamespace Tests.Diagnostics\n{\n    class Foo\n    {\n        public Foo Me() => null;\n\n        public bool Contains(string arg) => true;\n        public bool DoStuff() => true;\n        public bool Destroy() => true;\n        public bool Remove(string arg) => true;\n        public bool RemoveMe() => true;\n        public bool Delete() => true;\n        public bool Put() => true;\n        public bool Set() => true;\n        public bool Add() => true;\n        public bool Pop() => true;\n        public bool Update() => true;\n        public bool Retain() => true;\n        public bool Insert() => true;\n        public bool Push() => true;\n        public bool Append() => true;\n        public bool Clear() => true;\n        public bool Dequeue() => true;\n        public bool Enqueue() => true;\n        public bool Dispose() => true;\n        public bool CanAddItem() => true;\n        public bool SetEquals() => true;\n    }\n\n    class Program\n    {\n        public void Test()\n        {\n            var foo = new Foo();\n\n            Debug.Assert(true);\n            Debug.Fail(\"message\");\n            Debug.Assert(foo.Contains(\"a\"));\n            Debug.Assert(foo.DoStuff());\n            Debug.Assert(foo.Destroy());\n            Debug.Assert(foo.CanAddItem());\n            Debug.Assert(foo.SetEquals());\n\n            Debug.Assert(foo.Remove(\"a\")); // Noncompliant {{Expressions used in 'Debug.Assert' should not produce side effects.}}\n//                      ^^^^^^^^^^^^^^^^^\n            Debug.Assert((foo?.Remove(\"a\")).Value); // Noncompliant\n//                      ^^^^^^^^^^^^^^^^^^^^^^^^^^\n            Debug.Assert(foo.RemoveMe()); // Noncompliant\n\n            Debug.Assert(foo.Delete()); // Noncompliant\n            Debug.Assert(foo.Put()); // Noncompliant\n            Debug.Assert(foo.Set()); // Noncompliant\n            Debug.Assert(foo.Add()); // Noncompliant\n            Debug.Assert(foo.Pop()); // Noncompliant\n            Debug.Assert(foo.Update()); // Noncompliant\n            Debug.Assert(foo.Retain()); // Noncompliant\n            Debug.Assert(foo.Insert()); // Noncompliant\n            Debug.Assert(foo.Push()); // Noncompliant\n            Debug.Assert(foo.Append()); // Noncompliant\n            Debug.Assert(foo.Clear()); // Noncompliant\n            Debug.Assert(foo.Dequeue()); // Noncompliant\n            Debug.Assert(foo.Enqueue()); // Noncompliant\n            Debug.Assert(foo.Dispose()); // Noncompliant\n\n            Debug.Assert((foo.Me()?.Me().Clear()).Value); // Noncompliant\n\n            var b = true;\n            Debug.Assert(b = false);    // FN NET-2619\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DebuggerDisplayUsesExistingMembers.Latest.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing Somewhere;\n\nclass RawStringLiterals\n{\n    int SomeProperty => 1;\n    int SomeField = 2;\n\n    [DebuggerDisplay(\"\"\"{SomeProperty}\"\"\")] int ExistingMemberTripleQuotes => 1;\n    [DebuggerDisplay(\"\"\"\"{SomeField}\"\"\"\")] int ExistingMemberQuadrupleQuotes => 1;\n    [DebuggerDisplay(\"\"\"\n        Some text{SomeField}\n        \"\"\")] int ExistingMultiLine => 1;\n    [DebuggerDisplay($$\"\"\"\"\"\n        Some text{SomeField}\n        \"\"\"\"\")] int ExistingMultiLineInterpolated => 1;\n\n    [DebuggerDisplay(\"\"\"{Nonexistent}\"\"\")] int NonexistentTripleQuotes => 1;      // Noncompliant\n    //               ^^^^^^^^^^^^^^^^^^^\n    [DebuggerDisplay(\"\"\"\"{Nonexistent}\"\"\"\")] int NonexistentQuadrupleQuotes => 1; // Noncompliant\n    //               ^^^^^^^^^^^^^^^^^^^^^\n    [DebuggerDisplay(\"\"\"\n        Some text{Nonexistent}\n        \"\"\")] int NonexistentMultiLine1 => 1;                                     // Noncompliant@-2^22#46\n    [DebuggerDisplay(\"\"\"\n        Some text{Some\n        Property}\n        \"\"\")] int NonexistentMultiLine2 => 1;                                     // Noncompliant@-3\n    [DebuggerDisplay($$\"\"\"\"\"\n        Some text{Nonexistent}\n        \"\"\"\"\")] int NonexistentMultiLineInterpolated => 1;                        // Noncompliant@-2\n}\n\npublic class AccessModifiers\n{\n    public class BaseClass\n    {\n        private protected int PrivateProtectedProperty => 1;\n\n        [DebuggerDisplay(\"{PrivateProtectedProperty}\")] // Compliant\n        public int SomeProperty => 1;\n\n        [DebuggerDisplay(\"{Nonexistent}\")]              // Noncompliant\n        public int OtherProperty => 1;\n    }\n\n    public class SubClass : BaseClass\n    {\n        [DebuggerDisplay(\"{PrivateProtectedProperty}\")] // Compliant\n        public int OtherProperty => 1;\n    }\n}\n\n[DebuggerDisplay(\"{RecordProperty}\")]\npublic record SomeRecord(int RecordProperty)\n{\n    [DebuggerDisplay(\"{RecordProperty}\")] public record struct RecordStruct1(int RecordStructProperty);       // Noncompliant\n    [DebuggerDisplay(\"{RecordStructProperty}\")] public record struct RecordStruct2(int RecordStructProperty); // Compliant, RecordStructProperty is a property\n\n    [DebuggerDisplay(\"{RecordProperty}\")] public record NestedRecord1(int NestedRecordProperty);       // Noncompliant\n    [DebuggerDisplay(\"{NestedRecordProperty}\")] public record NestedRecord2(int NestedRecordProperty); // Compliant, NestedRecordProperty is a property\n}\n\n[DebuggerDisplay(\"{RecordProperty1} bla bla {RecordProperty2}\")]\npublic record struct SomeRecordStruct(int RecordProperty1, string RecordProperty2)\n{\n    [DebuggerDisplay(\"{RecordProperty}\")]            // Noncompliant\n    public class NestedClass1\n    {\n        [DebuggerDisplay(\"{NestedClassProperty}\")]\n        public int NestedClassProperty => 1;\n    }\n\n    [DebuggerDisplay(\"{NestedClassProperty}\")]\n    public class NestedClass2\n    {\n        [DebuggerDisplay(\"{NestedClassProperty}\")]\n        public int NestedClassProperty => 1;\n    }\n}\n\npublic class ConstantInterpolatedStrings\n{\n    [DebuggerDisplay($\"{{{nameof(SomeProperty)}}}\")]\n    [DebuggerDisplay($\"{{{nameof(NotAProperty)}}}\")] // FN: constant interpolated strings not supported\n    public int SomeProperty => 1;\n\n    public class NotAProperty { }\n}\n\npublic interface DefaultInterfaceImplementations\n{\n    [DebuggerDisplay(\"{OtherProperty}\")]\n    [DebuggerDisplay(\"{OtherPropertyImplemented}\")]\n    [DebuggerDisplay(\"{Nonexistent}\")]               // Noncompliant\n    int WithNonexistentProperty => 1;\n\n    string OtherProperty { get; }\n    string OtherPropertyImplemented => \"Something\";\n}\n\npublic partial class PartialProperty\n{\n    public partial string UserName { get; set; }\n}\n\n[DebuggerDisplay(\"{Name}\")] // Noncompliant\npublic partial class PartialProperty\n{\n    private string _userName;\n    public partial string UserName { get => _userName; set { } }\n}\n\n[DebuggerDisplay(\"{UserName}\")] // Compliant\npublic partial class OtherPartialProperty\n{\n    public partial string UserName { get; set; }\n}\n\npublic partial class OtherPartialProperty\n{\n    private string _userName;\n    public partial string UserName { get => _userName; set { } }\n}\n\npublic class EscapeChar\n{\n    //https://sonarsource.atlassian.net/browse/NET-359\n    [DebuggerDisplay(\"{Non\\existent}\")] // Noncompliant {{'{Non\u001bxistent}' is not a valid expression. CS1073: Unexpected token '\u001b'.}}\n    public int SomeProperty => 1;\n\n    [DebuggerDisplay(\"Test:\\e {AnotherProperty}\")] // Compliant\n    public int AnotherProperty => 1;\n\n    [DebuggerDisplay(\"Hello\\e {Nonexistent}\")] // Noncompliant\n    public int SomeOtherProperty => 1;\n\n    [DebuggerDisplay(\"{Nonexistent}\")] // Noncompliant\n    public int OtherProperty => 1;\n}\n\n[DebuggerDisplay(\"\"\"{Method()}\"\"\")]                                                       // Compliant\n[DebuggerDisplay(\"\"\"{Nonexistent()}\"\"\")]                                                  // Noncompliant\n[DebuggerDisplay(\"\"\"{Property switch { true => \"Yes\", false => \"No\" } }\"\"\")]              // Compliant\n[DebuggerDisplay(\"\"\"{Nonexistent switch { true => \"Yes\", false => \"No\" } }\"\"\")]           // Noncompliant\n[DebuggerDisplay(\"\"\"{Property switch { true => Nonexistent, false => \"No\" } }\"\"\")]        // Noncompliant\n[DebuggerDisplay(\"\"\"{Property switch { true => \"Yes\", false => Nonexistent } }\"\"\")]       // Noncompliant\n[DebuggerDisplay(\"\"\"{Property switch { true => \"Yes\", false => Nonexistent } ,  nq }\"\"\")] // Noncompliant\n[DebuggerDisplay(\"\"\"{Property switch { true => \"Yes\", false => Method() } } , nq \"\"\")]    // Compliant\n[DebuggerDisplay(\"\"\"{Property switch { int i => i } }\"\"\")]                                // Compliant\n[DebuggerDisplay(\"\"\"{Property switch { int i => Nonexistent } }\"\"\")]                      // FN. The variable designation int i suppresses the processing\n[DebuggerDisplay(\"\"\"{Property is object o && o.ToString() == string.Empty}\"\"\")]           // Compliant\npublic class Expressions\n{\n    public object Property { get; }\n    private string Method() => \"\";\n}\n\n[DebuggerDisplay(\"{this.ExtensionMethod()}\")]                       // Compliant regular extension methods are compatible with DebuggerDisplay NET-2620\n[DebuggerDisplay(\"{this.ExtensionBlockMethod()}\")]                  // Compliant extension block members are compatible with DebuggerDisplay\n[DebuggerDisplay(\"{this.ExtensionProperty}\")]                       // Compliant extension block members are compatible with DebuggerDisplay\n[DebuggerDisplay(\"{this.BaseExtensionMethod()}\")]                   // Compliant regular extension methods are compatible with DebuggerDisplay NET-2620\n[DebuggerDisplay(\"{this.BaseExtensionBlockMethod()}\")]              // Compliant extension block members are compatible with DebuggerDisplay\n[DebuggerDisplay(\"{this.BaseExtensionProperty}\")]                   // Compliant extension block members are compatible with DebuggerDisplay\n[DebuggerDisplay(\"{this.ExtensionPropertyButNotOnSampleType}\")]     // Noncompliant\n[DebuggerDisplay(\"{this.ExtensionMethodButNotOnSampleType()}\")]     // Noncompliant\n[DebuggerDisplay(\"{\\\"baseType\\\".StringExtensionProp}\")]             // Compliant extension block members are compatible with DebuggerDisplay\n[DebuggerDisplay(\"{\\\"baseType\\\".StringExtensionMethod()}\")]         // Compliant extension block members are compatible with DebuggerDisplay\n[DebuggerDisplay(\"{\\\"baseType\\\".StringExtensionProp}\")]             // Compliant extension block members are compatible with DebuggerDisplay\n[DebuggerDisplay(\"{StaticClass.StaticExtensionProp}\")]              // Compliant extension block members are compatible with DebuggerDisplay\n[DebuggerDisplay(\"{StaticClass.StaticExtensionMethod()}\")]          // Compliant extension block members are compatible with DebuggerDisplay\nclass Sample : Base { }\n\npublic class Base { }\n\nstatic class Extensions\n{\n    public static string BaseExtensionMethod(this Base b) => \"Extension is declared on base class\";\n    extension(Base b)\n    {\n        public string BaseExtensionProperty => \"Extension Property\";\n        public string BaseExtensionBlockMethod() => \"Extension Method in Extension Block\";\n    }\n    public static string ExtensionMethod(this Sample s) => \"Regular Extension Method\";\n    extension(Sample s)\n    {\n        public string ExtensionProperty => \"Extension Property\";\n        public string ExtensionBlockMethod() => \"Extension Method in Extension Block\";\n    }\n\n    extension(string s)\n    {\n        public string StringExtensionProp => \"Extension Property\";\n        public string StringExtensionMethod() => \"Extension Method\";\n    }\n\n    extension(Exception e)\n    {\n        \n        public string ExtensionPropertyButNotOnSampleType => \"Extension Property\";\n        public string ExtensionMethodButNotOnSampleType() => \"Extension Method in Extension Block\";\n    }\n\n    extension(StaticClass)\n    {\n        public static string StaticExtensionProp => \"42\";\n        public static string StaticExtensionMethod() => \"42\";\n    }\n}\n\nstatic class StaticClass { }\n\nnamespace Somewhere\n{\n    using SomewhereElse;\n    [DebuggerDisplay(\"{this.ExtensionMethod()}\")]           // Noncompliant When a static member is outside of the type's namespace DebuggerDisplay will be: \"error CS1061: 'BadSample' does not contain a definition for 'ExtensionMethod'\"\n    [DebuggerDisplay(\"{this.ExtensionBlockMethod()}\")]      // Noncompliant When a static member is outside of the type's namespace DebuggerDisplay will be: \"error CS1061: 'BadSample' does not contain a definition for 'ExtensionBlockMethod'\"\n    [DebuggerDisplay(\"{this.ExtensionProperty}\")]           // Noncompliant When a static member is outside of the type's namespace DebuggerDisplay will be: \"error CS1061: 'BadSample' does not contain a definition for 'ExtensionProperty'\"\n    class BadSample { }\n\n}\n\nnamespace SomewhereElse\n{\n    static class Extensions\n    {\n        public static string ExtensionMethod(this BadSample s) => \"Regular Extension Method\";\n        extension(BadSample s)\n        {\n            public string ExtensionProperty => \"Extension Property\";\n            public string ExtensionBlockMethod() => \"Extension Method in Extension Block\";\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DebuggerDisplayUsesExistingMembers.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\n\nclass PropertiesAndFields\n{\n    const string ConstantWithoutInvalidMembers = \"Something\";\n    const string ConstantWithInvalidMember = \"{Nonexistent}\";\n    const string ConstantFragment1 = \"{Non\";\n    const string ConstantFragment2 = \"existent}\";\n\n    int SomeProperty => 1;\n    int SomeField = 2;\n    string[] DeclaredNamespaces = new string[0];\n\n    [DebuggerDisplayAttribute(\"Hardcoded text\")] int WithSuffix => 1;\n    [System.Diagnostics.DebuggerDisplay(\"Hardcoded text\")] int WithNamespace => 1;\n    [DebuggerDisplay(value: \"Hardcoded text\")] int WithExplicitParameterName => 1;\n\n    [DebuggerDisplay(null)] int WithEmptyArgList => 1;\n    [DebuggerDisplay(\"\")] int WithEmptyFormat => 1;\n    [DebuggerDisplay(ConstantWithoutInvalidMembers)] int WithFormatAsConstant1 => 1;\n    [DebuggerDisplay(nameof(ConstantWithoutInvalidMembers))] int WithFormatAsNameOf => 1;\n\n    [DebuggerDisplay(\"{SomeProperty}\")] int WithExistingProperty => 1;\n    [DebuggerDisplay(\"{SomeField}\")] int WithExistingField => 1;\n    [DebuggerDisplay(@\"{SomeField}\")] int WithExistingFieldVerbatim => 1;\n    [DebuggerDisplay(@\"Some text\n        {SomeField}\")] int WithExistingFieldVerbatimMultiLine => 1;\n\n    [DebuggerDisplay(\"{1 + 1}\")] int WithNoMemberReferenced1 => 1;\n    [DebuggerDisplay(@\"{\"\"1\"\" + \"\"1\"\"}\")] int WithNoMemberReferenced2 => 1;\n\n    [DebuggerDisplay(\"{Nonexistent}\")] int WithNonexistentMember1 => 1;                          // Noncompliant {{'Nonexistent' doesn't exist in this context.}}\n    //               ^^^^^^^^^^^^^^^\n    [DebuggerDisplay(\"1 + {Nonexistent}\")] int WithNonexistentMember2 => 1;                      // Noncompliant {{'Nonexistent' doesn't exist in this context.}}\n    //               ^^^^^^^^^^^^^^^^^^^\n    [DebuggerDisplay(\"{Nonexistent1} bla bla {Nonexistent2}\")] int WithMultipleNonexistent => 1; // Noncompliant {{'Nonexistent1' doesn't exist in this context.}}\n    //               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    [DebuggerDisplay(@\"{Nonexistent}\")] int WithNonexistentMemberVerbatim => 1;                  // Noncompliant {{'Nonexistent' doesn't exist in this context.}}\n    [DebuggerDisplay(@\"Some text\n        {Nonexistent}\")] int WithNonexistentMemberVerbatimMultiLine1 => 1;                       // Noncompliant@-1^22#34 {{'Nonexistent' doesn't exist in this context.}}\n    [DebuggerDisplay(@\"Some text {Some\n        Property}\")] int WithNonexistentMemberVerbatimMultiLine2 => 1;                           // Noncompliant@-1\n    [DebuggerDisplay(@\"Some text {(ParseError1}\")] int ParseError1 => 1;                         // Noncompliant {{'{(ParseError1}' is not a valid expression. CS1026: ) expected.}}\n    [DebuggerDisplay(@\"Some text {int}\")] int ParseError2 => 1;                                  // Noncompliant {{'{int}' is not a valid expression. CS1525: Invalid expression term 'int'.}}\n    [DebuggerDisplay(@\"{ | ParseError3}\")] int ParseError3 => 1;                                 // Noncompliant {{'{ | ParseError3}' is not a valid expression. CS1525: Invalid expression term '|'.}}\n    [DebuggerDisplay(@\"{ ! ParseValid}\")] int ParseValid => 1;                                   // Compliant\n\n    [DebuggerDisplay(ConstantWithInvalidMember)] int WithFormatAsConstant2 => 1;                            // Noncompliant\n    [DebuggerDisplay(\"{Non\" + \"Existent}\")] int WithFormatAsConcatenationOfLiterals => 1;                   // Noncompliant\n    [DebuggerDisplay(\"{Non\"\n        + \"Existent}\")] int WithFormatAsConcatenationOfLiteralsMultiLine => 1;                              // Noncompliant@-1\n    [DebuggerDisplay(ConstantFragment1 + ConstantFragment2)] int WithFormatAsConcatenationOfConstants => 1; // Noncompliant\n\n    [DebuggerDisplay(\"{this.NonexistentProperty}\")] int PropertyWithExplicitThis => 1;                      // Noncompliant\n    [DebuggerDisplay(\"{Me.NonexistentField}\")] int FieldWithExplicitThis => 1;                              // Noncompliant {{'Me' doesn't exist in this context.}}\n    [DebuggerDisplay(\"{!NonexistentProperty}\")] int UnaryExpression1 => 1;                                  // Noncompliant {{'NonexistentProperty' doesn't exist in this context.}}\n    [DebuggerDisplay(\"{NonexistentProperty!}\")] int UnaryExpression2 => 1;                                  // Noncompliant {{'NonexistentProperty' doesn't exist in this context.}}\n    [DebuggerDisplay(\"{1 + NonexistentProperty}\")] int BinaryExpression => 1;                               // Noncompliant\n    [DebuggerDisplay(\"{(1 + 1 + (1 + NonexistentProperty))}\")] int NestedBinaryExpression => 1;             // Noncompliant\n    [DebuggerDisplay(\"{NonexistentProperty ? 1 : 0}\")] int TernaryInCondition => 1;                         // Noncompliant\n    [DebuggerDisplay(\"{true ? NonexistentProperty : 0}\")] int TernaryInTrue => 1;                           // Noncompliant\n    [DebuggerDisplay(\"{true ? 1 : NonexistentProperty}\")] int TernaryInFalse => 1;                          // Noncompliant\n    [DebuggerDisplay(\"{true ? 1 : (true ? 0 : 1 + NonexistentProperty)}\")] int TernaryNested => 1;          // Noncompliant\n    [DebuggerDisplay(\"{Math.Abs(SomeProperty)}\")] int StaticMemberAccess => 1;                              // Noncompliant {{'Math' doesn't exist in this context.}} FP\n    [DebuggerDisplay(\"CsdlSemanticsModel({string.Join(\\\",\\\", DeclaredNamespaces)})\")] int ExpressionWithDoubleQuotes => 1; // Compliant https://sonarsource.atlassian.net/browse/NET-646\n}\n\n[DebuggerDisplay(\"{this.ToString()}\")]     // Compliant, valid when debugging a C# project\n[DebuggerDisplay(\"{this.Nonexistent()}\")]  // Noncompliant\n[DebuggerDisplay(\"{Me.ToString()}\")]       // Noncompliant, valid when debugging a VB.NET project but not in C#\n[DebuggerDisplay(\"{Nonexistent}\")]         // Noncompliant\npublic enum TopLevelEnum { One, Two, Three }\n\n[DebuggerDisplay(\"{SomeProperty}\")]\n[DebuggerDisplay(\"{SomeField}\")]\n[DebuggerDisplay(\"{Nonexistent}\")]      // Noncompliant\npublic class NestedTypes\n{\n    int SomeProperty => 1;\n    int SomeField = 1;\n\n    [DebuggerDisplay(\"{ExistingProperty}\")]\n    [DebuggerDisplay(\"{ExistingField}\")]\n    [DebuggerDisplay(\"{SomeProperty}\")] // Noncompliant\n    [DebuggerDisplay(\"{SomeField}\")]    // Noncompliant\n    public class NestedClass\n    {\n        int ExistingProperty => 1;\n        int ExistingField => 1;\n    }\n\n    [DebuggerDisplay(\"{ExistingProperty}\")]\n    [DebuggerDisplay(\"{ExistingField}\")]\n    [DebuggerDisplay(\"{SomeProperty}\")] // Noncompliant\n    [DebuggerDisplay(\"{SomeField}\")]    // Noncompliant\n    public struct NestedStruct\n    {\n        int ExistingProperty => 1;\n        int ExistingField => 1;\n    }\n\n    [DebuggerDisplay(\"{42}\")]\n    [DebuggerDisplay(\"{SomeProperty}\")] // Noncompliant\n    [DebuggerDisplay(\"{SomeField}\")]    // Noncompliant\n    public enum NestedEnum { One, Two, Three }\n}\n\npublic class Delegates\n{\n    int ExistingProperty => 1;\n\n    [DebuggerDisplay(\"{ExistingProperty}\")] // Noncompliant\n    [DebuggerDisplay(\"{42}\")]\n    public delegate void Delegate1();\n}\n\npublic class Indexers\n{\n    int ExistingProperty => 1;\n    int ExistingField => 1;\n\n    [DebuggerDisplay(\"{ExistingProperty}\")]\n    [DebuggerDisplay(\"{ExistingField}\")]\n    [DebuggerDisplay(\"{Nonexistent}\")] // Noncompliant\n    int this[int i] => 1;\n}\n\n[DebuggerDisplay(\"{SomeProperty}\"), DebuggerDisplay(\"{SomeField}\"), DebuggerDisplay(\"{Nonexistent}\")] // Noncompliant\n//                                                                                  ^^^^^^^^^^^^^^^\npublic class MultipleAttributes\n{\n    int SomeProperty => 1;\n    int SomeField = 1;\n\n    [DebuggerDisplay(\"{SomeProperty}\"), DebuggerDisplay(\"{SomeField}\"), DebuggerDisplay(\"{Nonexistent}\")] // Noncompliant\n    //                                                                                  ^^^^^^^^^^^^^^^\n    int OtherProperty1 => 1;\n\n    [DebuggerDisplay(\"{Nonexistent1}\"), DebuggerDisplay(\"{Nonexistent2}\")]\n    //               ^^^^^^^^^^^^^^^^\n    //                                                  ^^^^^^^^^^^^^^^^@-1\n    int OtherProperty2 => 1;\n\n    [DebuggerDisplay(\"{Nonexistent1}\")][DebuggerDisplay(\"{Nonexistent2}\")]\n    //               ^^^^^^^^^^^^^^^^\n    //                                                  ^^^^^^^^^^^^^^^^@-1\n    int OtherProperty3 => 1;\n}\n\npublic class CaseSensitivity\n{\n    int SOMEPROPERTY => 1;\n    int SomeProperty => 1;\n\n    [DebuggerDisplay(\"{SOMEPROPERTY}\")]\n    [DebuggerDisplay(\"{SomeProperty}\")]\n    [DebuggerDisplay(\"{someProperty}\")] // Noncompliant\n    [DebuggerDisplay(\"{someproperty}\")] // Noncompliant\n    int OtherProperty => 1;\n}\n\npublic class NonAlphanumericChars\n{\n    int Aa1_뿓 => 1;\n\n    [DebuggerDisplay(\"{Aa1_뿓}\")]\n    [DebuggerDisplay(\"{Aa1_㤬}\")] // Noncompliant {{'Aa1_㤬' doesn't exist in this context.}}\n    int SomeProperty1 => 1;\n}\n\npublic class Whitespaces\n{\n    [DebuggerDisplay(\"{ SomeProperty}\")]\n    [DebuggerDisplay(\"{SomeProperty }\")]\n    [DebuggerDisplay(\"{\\tSomeProperty}\")]\n    [DebuggerDisplay(\"{\\tSomeProperty\\t}\")]\n    [DebuggerDisplay(\"{ Nonexistent}\")]    // Noncompliant {{'Nonexistent' doesn't exist in this context.}}\n    [DebuggerDisplay(\"{Nonexistent }\")]    // Noncompliant {{'Nonexistent' doesn't exist in this context.}}\n    [DebuggerDisplay(\"{\\tNonexistent}\")]   // Noncompliant {{'Nonexistent' doesn't exist in this context.}}\n    [DebuggerDisplay(\"{\\tNonexistent\\t}\")] // Noncompliant {{'Nonexistent' doesn't exist in this context.}}\n    int SomeProperty => 1;\n}\n\npublic class NoQuotesModifier\n{\n    [DebuggerDisplay(\"{SomeProperty,nq}\")]\n    [DebuggerDisplay(\"{SomeProperty ,nq}\")]\n    [DebuggerDisplay(\"{SomeProperty, nq}\")]\n    [DebuggerDisplay(\"{SomeProperty,nq }\")]\n    [DebuggerDisplay(\"{Nonexistent,nq}\")]  // Noncompliant {{'Nonexistent' doesn't exist in this context.}}\n    [DebuggerDisplay(\"{Nonexistent ,nq}\")] // Noncompliant {{'Nonexistent' doesn't exist in this context.}}\n    [DebuggerDisplay(\"{Nonexistent, nq}\")] // Noncompliant {{'Nonexistent' doesn't exist in this context.}}\n    [DebuggerDisplay(\"{Nonexistent,nq }\")] // Noncompliant {{'Nonexistent' doesn't exist in this context.}}\n    int SomeProperty => 1;\n}\n\npublic class OtherModifier\n{\n    [DebuggerDisplay(\"{SomeProperty,d}\")]     // Compliant https://sonarsource.atlassian.net/browse/NET-646\n    [DebuggerDisplay(\"{SomeProperty,raw}\")]   // Compliant https://sonarsource.atlassian.net/browse/NET-646\n    [DebuggerDisplay(\"{SomeProperty,asdf}\")]  // Compliant, the qualifiers are not specified in the documentation. We assume any word is valid here\n    [DebuggerDisplay(\"{SomeProperty, asdf}\")] // Compliant\n    [DebuggerDisplay(\"{Nonexistent,asdf}\")]   // Noncompliant {{'Nonexistent' doesn't exist in this context.}}\n    [DebuggerDisplay(\"{Nonexistent, asdf}\")]  // Noncompliant {{'Nonexistent' doesn't exist in this context.}}\n    [DebuggerDisplay(\"{Nonexistent, a12f}\")]  // Noncompliant {{'{Nonexistent, a12f}' is not a valid expression. CS1073: Unexpected token ','.}}\n    int SomeProperty => 1;\n}\n\npublic class OptionalAttributeParameter\n{\n    [DebuggerDisplay(\"{SomeProperty}\", Name = \"Any name\")]\n    [DebuggerDisplay(\"{Nonexistent}\", Name = \"Any name\")]                                              // Noncompliant {{'Nonexistent' doesn't exist in this context.}}\n    //               ^^^^^^^^^^^^^^^\n    [DebuggerDisplay(\"{Nonexistent}\", Name = \"Any name\", Type = nameof(OptionalAttributeParameter))]   // Noncompliant\n    //               ^^^^^^^^^^^^^^^\n    [DebuggerDisplay(\"{Nonexistent}\", Name = \"Any name\", Target = typeof(OptionalAttributeParameter))] // Noncompliant\n    //               ^^^^^^^^^^^^^^^\n    int SomeProperty => 1;\n}\n\npublic class Inheritance\n{\n    public class BaseClass\n    {\n        int SomeProperty => 1;\n    }\n\n    public class SubClass : BaseClass\n    {\n        [DebuggerDisplay(\"{SomeProperty}\")] // Compliant, defined in base class\n        int OtherProperty => 1;\n    }\n}\n\npublic class AccessModifiers\n{\n    public class BaseClass\n    {\n        public int PublicProperty => 1;\n        internal int InternalProperty => 1;\n        protected int ProtectedProperty => 1;\n        private int PrivateProperty => 1;\n\n        [DebuggerDisplay(\"{PublicProperty}\")]\n        [DebuggerDisplay(\"{InternalProperty}\")]\n        [DebuggerDisplay(\"{ProtectedProperty}\")]\n        [DebuggerDisplay(\"{PrivateProperty}\")]\n        int SomeProperty => 1;\n    }\n\n    public class SubClass : BaseClass\n    {\n        [DebuggerDisplay(\"{PublicProperty}\")]\n        [DebuggerDisplay(\"{InternalProperty}\")]\n        [DebuggerDisplay(\"{ProtectedProperty}\")]\n        [DebuggerDisplay(\"{PrivateProperty}\")]\n        int OtherProperty => 1;\n    }\n}\n\npublic class AttributeTargets\n{\n    [global:DebuggerDisplay(\"{Nonexistent}\")]    // Noncompliant, attribute at global level, referencing a non-existent member\n    [assembly: DebuggerDisplay(\"{Nonexistent}\")] // Noncompliant, attribute at assembly level, referencing a non-existent member\n    [field: DebuggerDisplay(\"{Nonexistent}\")]    // Noncompliant, attribute ignored, still referencing a non-existent member\n    [property: DebuggerDisplay(\"{Nonexistent}\")] // Noncompliant, attribute taken into account\n    int SomeProperty => 1;\n}\n\npublic class InvalidAttributes\n{\n    [DebuggerDisplay] int NoArgs => 1;                                         // Error [CS7036]\n    [DebuggerDisplay(Type = nameof(InvalidAttributes))] int MissingValue => 1; // Error [CS7036]\n}\n\nnamespace WithTypeAlias\n{\n    using DebuggerDisplayAlias = System.Diagnostics.DebuggerDisplayAttribute;\n\n    public class Test\n    {\n        [DebuggerDisplayAlias(\"{Nonexistent}\")] int WithAlias => 1; // FN: Aliases are not supported for performance reasons\n    }\n}\n\n// https://sonarsource.atlassian.net/browse/NET-575\npublic class Repo_Net575\n{\n    [DebuggerDisplay(\"{Property}\",\n        Name = \"{Nonexistent}\",  // Noncompliant {{'Nonexistent' doesn't exist in this context.}}\n        Type = \"{Nonexistent}\")] // Noncompliant\n    public int Property { get; }\n\n    [DebuggerDisplay(\"{Property1}\",\n        Type = \"{Type}\")] // Noncompliant TP https://sonarsource.atlassian.net/browse/NET-646 (Checked in VS: \"Type\" can not be evaluated by the compiler)\n    public int Property1 { get; }\n}\n\n// Noncompliant@+1 {{'Error' doesn't exist in this context.}}\n[DebuggerDisplay(@\"\n    Some text\n    {\n        Property == 0\n            ? Error\n            : \"\"Okay\"\"\n    }\n\")]\npublic class Multiline\n{\n    public int Property { get; }\n}\n\n[DebuggerDisplay(\"{this.Recurse}\")]\n[DebuggerDisplay(\"{Recurse}\")]\n[DebuggerDisplay(\"{Recurse.Recurse}\")]\n[DebuggerDisplay(\"{Recurse.Recurse.Recurse}\")]\n[DebuggerDisplay(\"{Recurse.Recurse.Method()}\")]\n[DebuggerDisplay(\"{Recurse.Method().Recurse}\")]\n[DebuggerDisplay(\"{Method().Recurse.Recurse}\")]         // Compliant\n[DebuggerDisplay(\"{Nonexistent.Recurse.Recurse}\")]      // Noncompliant\n[DebuggerDisplay(\"{this.Nonexistent.Recurse.Recurse}\")] // Noncompliant\n[DebuggerDisplay(\"{Recurse.Nonexistent.Recurse}\")]      // Compliant: Only the most left hand side of a member access is detected\n[DebuggerDisplay(\"{Recurse.Recurse.Nonexistent}\")]      // Compliant\n[DebuggerDisplay(\"{Nonexistent?.Recurse}\")]             // Noncompliant\n[DebuggerDisplay(\"{Recurse ?? Recurse}\")]               // Compliant\n[DebuggerDisplay(\"{Nonexistent ?? Recurse}\")]           // Noncompliant\n[DebuggerDisplay(\"{Recurse ?? Nonexistent}\")]           // Noncompliant\npublic class Recursion\n{\n    public Recursion Recurse { get; }\n    public Recursion Method() { return Recurse; }\n}\n\n[DebuggerDisplay(\"{this.VoidMethod()}\")]           // Noncompliant\n[DebuggerDisplay(\"{this.VoidMethod().Value}\")]     // Noncompliant\npublic class VoidTest\n{\n    public void VoidMethod() { }\n}\n\n[DebuggerDisplay(\"{StaticClass}\")]                                          // Compliant Static types within the same namespace are in scope\n[DebuggerDisplay(\"{StaticClass.StaticField}\")]                              // Compliant\n[DebuggerDisplay(\"{StaticClass.StaticProp}\")]                               // Compliant\n[DebuggerDisplay(\"{StaticClass.StaticMethod()}\")]                           // Compliant\n[DebuggerDisplay(\"{StaticClass..ctor}\")]                                    // FN https://sonarsource.atlassian.net/browse/NET-2942\n[DebuggerDisplay(\"{NestedStaticClassTest.NestedStaticClass.StaticField}\")]  // Compliant\n[DebuggerDisplay(\"{this.StaticMethod()}\")]                                  // Noncompliant\n[DebuggerDisplay(\"{this.StaticField}\")]                                     // Noncompliant\n[DebuggerDisplay(\"{this.StaticProp}\")]                                      // Noncompliant\npublic class StaticClassTest { }\n\npublic static class StaticClass\n{\n    public static string StaticField = \"42\";\n    public static string StaticProp => \"42\";\n    public static string StaticMethod() => \"42\";\n}\n\n[DebuggerDisplay(\"{this.NestedStaticClass.StaticField}\")]       // Compliant Static types within the same namespace are in scope\n[DebuggerDisplay(\"{this.NestedStaticClass.StaticField}\")]       // Compliant\n[DebuggerDisplay(\"{this.NestedStaticClass.StaticProp}\")]        // Compliant\n[DebuggerDisplay(\"{this.NestedStaticClass.StaticMethod()}\")]    // Compliant\npublic class NestedStaticClassTest\n{\n\n    public static class NestedStaticClass\n    {\n        public static string StaticField = \"42\";\n        public static string StaticProp => \"42\";\n        public static string StaticMethod() => \"42\";\n    }\n}\n\n[DebuggerDisplay(\"{this..ctor\")]                  // FN https://sonarsource.atlassian.net/browse/NET-2942\n[DebuggerDisplay(\"{this.<Name>k__BackingField}\")] // Noncompliant {{'{this.<Name>k__BackingField}' is not a valid expression. CS1001: Identifier expected.}}\npublic class ImplicitMembers\n{\n    public string Name { get; set; } = \"Jack\";\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DebuggerDisplayUsesExistingMembers.vb",
    "content": "﻿Imports System\nImports System.Diagnostics\n\nPublic Class TestOnPropertiesAndFields\n    Const ConstantWithoutInvalidMembers As String = \"Something\"\n    Const ConstantWithInvalidMember As String = \"{Nonexistent}\"\n    Const ConstantFragment1 As String = \"{Non\"\n    Const ConstantFragment2 As String = \"Existent}\"\n\n    Public Property SomeProperty As Integer\n    Public SomeField As Integer\n\n    <DebuggerDisplayAttribute(\"Hardcoded text\")> Property WithSuffix As Integer\n    <System.Diagnostics.DebuggerDisplay(\"Hardcoded text\")> Property WithNamespace As Integer\n    <Global.System.Diagnostics.DebuggerDisplay(\"Hardcoded text\")> Property WithGlobal As Integer\n\n    <DebuggerDisplay(Nothing)> Property WithEmptyArgList As Integer\n    <DebuggerDisplay(\"\")> Property WithEmptyFormat As Integer\n    <DebuggerDisplay(ConstantWithoutInvalidMembers)> Property WithFormatAsConstant1 As Integer\n    <DebuggerDisplay(NameOf(ConstantWithoutInvalidMembers))> Property WithFormatAsNameOf As Integer\n\n    <DebuggerDisplay(\"{SomeProperty}\")> Property WithExistingProperty As Integer\n    <DebuggerDisplay(\"{SomeField}\")> Property WithExistingField As Integer\n    <DebuggerDisplay(\"{SomeField}\")> Property WithExistingFieldVerbatim As Integer\n    <DebuggerDisplay(\"{1 + 1}\")> Property WithNoMemberReferenced1 As Integer\n    <DebuggerDisplay(\"{\"\"1\"\" + \"\"1\"\"}\")> Property WithNoMemberReferenced2 As Integer\n\n    <DebuggerDisplay(\"{Nonexistent}\")> Property WithNonexistentMember1 As Integer                             ' Noncompliant {{'Nonexistent' doesn't exist in this context.}}\n    '                ^^^^^^^^^^^^^^^\n    <DebuggerDisplay(\"1 + {Nonexistent}\")> Property WithNonexistentMember2 As Integer                         ' Noncompliant {{'Nonexistent' doesn't exist in this context.}}\n    '                ^^^^^^^^^^^^^^^^^^^\n    <DebuggerDisplay(\"{Nonexistent1} bla bla {Nonexistent2}\")> Property WithMultipleNonexistent As Integer    ' Noncompliant {{'Nonexistent1' doesn't exist in this context.}}\n    '                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    <DebuggerDisplay(\"{Nonexistent}\")> Property WithNonexistentMemberVerbatim As Integer                      ' Noncompliant {{'Nonexistent' doesn't exist in this context.}}\n    '                ^^^^^^^^^^^^^^^\n    <System.Diagnostics.DebuggerDisplay(\"{Nonexistent}\")> Property WithNamespaceAndNonexistent As Integer     ' Noncompliant {{'Nonexistent' doesn't exist in this context.}}\n    '                                   ^^^^^^^^^^^^^^^\n    <Global.System.Diagnostics.DebuggerDisplay(\"{Nonexistent}\")> Property WithGlobalAndNonexistent As Integer ' Noncompliant {{'Nonexistent' doesn't exist in this context.}}\n    '                                          ^^^^^^^^^^^^^^^\n\n    <DebuggerDisplay(ConstantWithInvalidMember)> Property WithFormatAsConstant2 As Integer                            ' Noncompliant\n    <DebuggerDisplay(\"{Non\" & \"Existing}\")> Property WithFormatAsConcatenationOfLiterals As Integer                   ' Noncompliant\n    <DebuggerDisplay(ConstantFragment1 & ConstantFragment2)> Property WithFormatAsConcatenationOfConstants As Integer ' Noncompliant\n\n    <DebuggerDisplay(\"{Me.NonexistentProperty}\")> Property PropertyWithExplicitThis As Integer                        ' FN: \"Me.\" not supported (valid when debugging a VB.NET project)\n    <DebuggerDisplay(\"{this.NonexistentField}\")> Property FieldWithExplicitThis As Integer                            ' FN: \"this.\" not supported (valid when debugging a C# project)\n    <DebuggerDisplay(\"{1 + NonexistentProperty}\")> Property ContainingInvalidMembers As Integer                       ' FN: expressions not supported\nEnd Class\n\n<DebuggerDisplay(\"{Me.ToString()}\")>    ' Compliant, valid when debugging a VB.NET project\n<DebuggerDisplay(\"{this.ToString()}\")>  ' Compliant, valid when debugging a C# project\n<DebuggerDisplay(\"{Nonexistent}\")>      ' Noncompliant\nPublic Enum TopLevelEnum\n    One\n    Two\n    Three\nEnd Enum\n\n<DebuggerDisplay(\"{SomeProperty}\")>\n<DebuggerDisplay(\"{SomeField}\")>\n<DebuggerDisplay(\"{Nonexistent}\")>      ' Noncompliant\nPublic Class TestOnNestedTypes\n    Public Property SomeProperty As Integer\n    Public SomeField As Integer\n\n    <DebuggerDisplay(\"{ExistingProperty}\")>\n    <DebuggerDisplay(\"{ExistingField}\")>\n    <DebuggerDisplay(\"{SomeProperty}\")> ' Noncompliant\n    <DebuggerDisplay(\"{SomeField}\")>    ' Noncompliant\n    Public Class NestedClass\n        Property ExistingProperty As Integer\n        Property ExistingField As Integer\n    End Class\n\n    <DebuggerDisplay(\"{ExistingProperty}\")>\n    <DebuggerDisplay(\"{ExistingField}\")>\n    <DebuggerDisplay(\"{SomeProperty}\")> ' Noncompliant\n    <DebuggerDisplay(\"{SomeField}\")>    ' Noncompliant\n    Public Structure NestedStruct\n        Property ExistingProperty As Integer\n        Property ExistingField As Integer\n    End Structure\n\n    Public Enum NestedEnum\n        One\n        Two\n        Three\n    End Enum\nEnd Class\n\nClass TestOnDelegates\n    Property ExistingProperty As Integer\n\n    <DebuggerDisplay(\"{ExistingProperty}\")> ' Noncompliant\n    <DebuggerDisplay(\"{42}\")>\n    Delegate Sub Delegate1()\nEnd Class\n\nClass TestOnIndexers\n    Public Property ExistingProperty As Integer\n    Public ExistingField As Integer\n\n    <DebuggerDisplay(\"{ExistingProperty}\")>\n    <DebuggerDisplay(\"{ExistingField}\")>\n    <DebuggerDisplay(\"{Nonexistent}\")> ' Noncompliant\n    Default Property Item(ByVal i As Integer) As Integer\n        Get\n            Return 1\n        End Get\n        Set(value As Integer)\n        End Set\n    End Property\nEnd Class\n\n<DebuggerDisplay(\"{SomeProperty}\"), DebuggerDisplay(\"{SomeField}\"), DebuggerDisplay(\"{Nonexistent}\")> ' Noncompliant\nClass TestMultipleAttributes\n    '                                                                               ^^^^^^^^^^^^^^^@-1\n\n    Public Property SomeProperty As Integer\n    Public SomeField As Integer = 1\n\n    <DebuggerDisplay(\"{SomeProperty}\"), DebuggerDisplay(\"{SomeField}\"), DebuggerDisplay(\"{Nonexistent}\")> Property OtherProperty1 As Integer ' Noncompliant\n    '                                                                                   ^^^^^^^^^^^^^^^\n\n    <DebuggerDisplay(\"{Nonexistent1}\"), DebuggerDisplay(\"{Nonexistent2}\")> Property OtherProperty2 As Integer\n    '                ^^^^^^^^^^^^^^^^\n    '                                                   ^^^^^^^^^^^^^^^^@-1\n\n    <DebuggerDisplay(\"{Nonexistent1}\")> <DebuggerDisplay(\"{Nonexistent2}\")> Property OtherProperty3 As Integer\n    '                ^^^^^^^^^^^^^^^^\n    '                                                    ^^^^^^^^^^^^^^^^@-1\nEnd Class\n\nClass SupportCaseInsensitivity\n    Property SomeProperty As Integer = 1\n\n    <DebuggerDisplay(\"{SOMEPROPERTY}\")>\n    <DebuggerDisplay(\"{SomeProperty}\")>\n    <DebuggerDisplay(\"{someProperty}\")>\n    <DebuggerDisplay(\"{someproperty}\")>\n    Property OtherProperty As Integer\nEnd Class\n\nClass SupportNonAlphanumericChars\n    Property Aa1_뿓 As Integer\n\n    <DebuggerDisplay(\"{Aa1_뿓}\")>\n    <DebuggerDisplay(\"{Aa1_㤬}\")> ' Noncompliant {{'Aa1_㤬' doesn't exist in this context.}}\n    Property SomeProperty1 As Integer\nEnd Class\n\nClass SupportWhitespaces\n    <DebuggerDisplay(\"{ SomeProperty}\")>\n    <DebuggerDisplay(\"{SomeProperty }\")>\n    <DebuggerDisplay(\"{\" & vbTab & \"SomeProperty}\")>\n    <DebuggerDisplay(\"{\" & vbTab & \"SomeProperty\" & vbTab & \"}\")>\n    <DebuggerDisplay(\"{ Nonexistent}\")>                          ' Noncompliant {{'Nonexistent' doesn't exist in this context.}}\n    <DebuggerDisplay(\"{Nonexistent }\")>                          ' Noncompliant {{'Nonexistent' doesn't exist in this context.}}\n    <DebuggerDisplay(\"{\" & vbTab & \"Nonexistent}\")>              ' Noncompliant\n    <DebuggerDisplay(\"{\" & vbTab & \"Nonexistent\" & vbTab & \"}\")> ' Noncompliant\n    Property SomeProperty As Integer\nEnd Class\n\nClass SupportNq\n    <DebuggerDisplay(\"{SomeProperty,nq}\")>\n    <DebuggerDisplay(\"{SomeProperty ,nq}\")>\n    <DebuggerDisplay(\"{SomeProperty, nq}\")>\n    <DebuggerDisplay(\"{SomeProperty,nq }\")>\n    <DebuggerDisplay(\"{Nonexistent,nq}\")>  ' Noncompliant\n    <DebuggerDisplay(\"{Nonexistent ,nq}\")> ' Noncompliant\n    <DebuggerDisplay(\"{Nonexistent, nq}\")> ' Noncompliant\n    <DebuggerDisplay(\"{Nonexistent,nq }\")> ' Noncompliant\n    Property SomeProperty As Integer\nEnd Class\n\nClass SupportOptionalAttributeParameter\n    <DebuggerDisplay(\"{SomeProperty}\", Name:=\"Any name\")>\n    <DebuggerDisplay(\"{Nonexistent}\", Name:=\"Any name\")>                                                     ' Noncompliant\n    <DebuggerDisplay(\"{Nonexistent}\", Name:=\"Any name\", Type:=NameOf(SupportOptionalAttributeParameter))>    ' Noncompliant\n    <DebuggerDisplay(\"{Nonexistent}\", Name:=\"Any name\", Target:=GetType(SupportOptionalAttributeParameter))> ' Noncompliant\n    Property SomeProperty As Integer\n    '                ^^^^^^^^^^^^^^^@-3\n    '                ^^^^^^^^^^^^^^^@-3\n    '                ^^^^^^^^^^^^^^^@-3\nEnd Class\n\nClass SupportInheritance\n    Class BaseClass\n        Property SomeProperty As Integer\n    End Class\n\n    Class SubClass\n        Inherits BaseClass\n\n        <DebuggerDisplay(\"{SomeProperty}\")> ' Compliant, defined in base class\n        Property OtherProperty As Integer\n    End Class\nEnd Class\n\nClass SupportAccessModifiers\n    Class BaseClass\n        Public Property PublicProperty As Integer\n        Friend Property InternalProperty As Integer\n        Protected Property ProtectedProperty As Integer\n        Private Property PrivateProperty As Integer\n\n        <DebuggerDisplay(\"{PublicProperty}\")>\n        <DebuggerDisplay(\"{InternalProperty}\")>\n        <DebuggerDisplay(\"{ProtectedProperty}\")>\n        <DebuggerDisplay(\"{PrivateProperty}\")>\n        Property SomeProperty As Integer\n    End Class\n\n    Class SubClass\n        Inherits BaseClass\n\n        <DebuggerDisplay(\"{PublicProperty}\")>\n        <DebuggerDisplay(\"{InternalProperty}\")>\n        <DebuggerDisplay(\"{ProtectedProperty}\")>\n        <DebuggerDisplay(\"{PrivateProperty}\")>\n        Property OtherProperty As Integer\n    End Class\nEnd Class\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DeclareEventHandlersCorrectly.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public delegate void EventHandler1(object s);\n    public delegate int EventHandler2(object s, EventArgs e);\n    public delegate void EventHandler3(int sender, EventArgs e);\n    public delegate void EventHandler4(object sender, int e);\n    public delegate void EventHandler5(object sender, EventArgs args);\n    public delegate void EventHandler6(object wrongName, EventArgs e);\n\n    public delegate void potentiallyCorrectEventHandler<T>(object sender, T e);\n\n    public delegate void CorrectEventHandler1(object sender, EventArgs e);\n    public delegate void CorrectEventHandler2<T>(object sender, T e) where T : EventArgs;\n\n    public class Foo<TEventArgs> where TEventArgs : EventArgs\n    {\n        public event EventHandler1 Event1; // Noncompliant {{Change the signature of that event handler to match the specified signature.}}\n//                   ^^^^^^^^^^^^^\n        public event EventHandler2 Event2; // Noncompliant\n        public event EventHandler3 Event3; // Noncompliant\n        public event EventHandler4 Event4; // Noncompliant\n        public event EventHandler5 Event5; // Noncompliant\n        public event EventHandler6 Event6; // Noncompliant\n        public event potentiallyCorrectEventHandler<Object> Event7; // Noncompliant\n\n        public event NonExistentType Event8; // Error[CS0246]\n        public event NamedType Event9; // Error[CS0066]\n\n        public event EventHandler1 Event1AsProperty // Noncompliant {{Change the signature of that event handler to match the specified signature.}}\n//                   ^^^^^^^^^^^^^\n        {\n            add { }\n            remove { }\n        }\n\n        public event CorrectEventHandler1 CorrectEvent;\n        public event CorrectEventHandler2<EventArgs> CorrectEvent2;\n        public event CorrectEventHandler2<TEventArgs> CorrectEvent3;\n        public event potentiallyCorrectEventHandler<EventArgs> CorrectEvent4;\n        public event potentiallyCorrectEventHandler<TEventArgs> CorrectEvent5;\n\n        public class NamedType { }\n    }\n\n    public class Bar<TEventArgs1, TEventArgs2, TParamWithoutConstraint>\n        where TEventArgs1 : EventArgs\n        where TEventArgs2 : TEventArgs1\n    {\n        public event EventHandler<TEventArgs1> CorrectEvent1;\n        public event EventHandler<TEventArgs2> CorrectEvent2;\n\n        public event EventHandler<TParamWithoutConstraint> IncorrectEvent; // Noncompliant\n    }\n}\n\n// Reproducer of https://github.com/SonarSource/sonar-dotnet/issues/3453\nnamespace Repro3453\n{\n    public class ProviderChangedEventArgs : EventArgs { }\n\n    public delegate void ProviderChangedEventHandler(object sender, ProviderChangedEventArgs args);\n\n    public interface ILocalizationProvider\n    {\n        event ProviderChangedEventHandler ProviderChanged1; // Noncompliant\n        event ProviderChangedEventHandler ProviderChanged2; // Noncompliant\n    }\n\n    public abstract class BaseClass\n    {\n        public abstract event ProviderChangedEventHandler ProviderChanged3; // Noncompliant\n        public abstract event ProviderChangedEventHandler ProviderChanged4; // Noncompliant\n    }\n\n    public class Repro3453 : BaseClass, ILocalizationProvider\n    {\n        public event ProviderChangedEventHandler ProviderChanged1;\n        public event ProviderChangedEventHandler ProviderChanged2\n        {\n            add { }\n            remove { }\n        }\n\n        public override event ProviderChangedEventHandler ProviderChanged3;\n        public override event ProviderChangedEventHandler ProviderChanged4\n        {\n            add { }\n            remove { }\n        }\n\n        public event ProviderChangedEventHandler NonOverridenNotFromInterfaceEvent1; // Noncompliant\n        public event ProviderChangedEventHandler NonOverridenNotFromInterfaceEvent2 // Noncompliant\n        {\n            add { }\n            remove { }\n        }\n    }\n\n    public class DisposableClass : IDisposable\n    {\n        public event ProviderChangedEventHandler ProviderChanged1; // Noncompliant\n        public event ProviderChangedEventHandler ProviderChanged2 // Noncompliant\n        {\n            add { }\n            remove { }\n        }\n\n        public void Dispose()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DeclareTypesInNamespaces.FileScopedNamespace.cs",
    "content": "﻿namespace FileScopedNamespace;\n\nclass Foo { }   // Compliant\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DeclareTypesInNamespaces.Latest.cs",
    "content": "﻿record PositionalRecord(string FirstParam, string SecondParam); // Noncompliant\n\nrecord struct RecordStruct              // Noncompliant\n{\n    record struct InnerRecordStruct;    // Compliant: we want to report only on the outer record\n}\n\nrecord class RecordClass                // Noncompliant\n{\n    record class InnerRecordClass;      // Compliant: we want to report only on the outer record\n}\n\ninterface InterfaceWithInnerType        // Noncompliant\n{\n    interface InnerInterface { }        // Compliant: we want to report only on the outer record\n}\n\nstatic class Extensions                 // Noncompliant\n{\n    extension(string s) { }             // Compliant: not a type\n}\n\nnamespace Tests.Diagnostics\n{\n    record PositionalRecordInNamespace(string FirstParam, string SecondParam);\n\n    record struct RecordStructInNamespace;\n\n    record class RecordClassInNamespace;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DeclareTypesInNamespaces.TopLevelStatements.Partial.cs",
    "content": "﻿// reproducer for https://github.com/SonarSource/sonar-dotnet/issues/6836\npublic partial class Program { } // Noncompliant, FP this is partial class for the class Program generated by the compiler when using top-level statements\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DeclareTypesInNamespaces.TopLevelStatements.cs",
    "content": "﻿var x = 1;\n\npublic partial class Program { } // Compliant: https://github.com/SonarSource/sonar-dotnet/issues/5660\n\nclass Foo // Noncompliant {{Move 'Foo' into a named namespace.}}\n{\n    class InnerFoo { } // Compliant: we want to report only on the outer class\n}\n\nnamespace Tests.Diagnostics\n{\n    class Program { }   // Compliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DeclareTypesInNamespaces.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\npublic class Foo // Noncompliant {{Move 'Foo' into a named namespace.}}\n{\n    class InnerFoo // Compliant - we want to report only on the outer class\n    {\n    }\n}\n\npublic struct Bar // Noncompliant {{Move 'Bar' into a named namespace.}}\n{\n    struct InnerBar // Compliant - we want to report only on the outer struct\n    {\n    }\n\n    enum InnerEnu // Compliant - we want to report only on outer enum\n    {\n    }\n}\n\npublic enum Enu // Noncompliant {{Move 'Enu' into a named namespace.}}\n{\n    Test\n}\n\nnamespace Tests.Diagnostics\n{\n    class Program { }\n\n    struct MyStruct { }\n\n    public interface MyInt { }\n\n    public enum Enu\n    {\n        Test\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DeclareTypesInNamespaces.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\n\nPublic Class Foo ' Noncompliant {{Move 'Foo' into a named namespace.}}\n    Class InnerFoo ' Compliant - we want to report only on the outer class\n    End Class\nEnd Class\n\nPublic Structure Bar ' Noncompliant {{Move 'Bar' into a named namespace.}}\n    Structure InnerBar ' Compliant - we want to report only on the outer struct\n    End Structure\n\n    Public Enum InnerEnu ' Compliant - we want to report only on outer enum\n        Test\n    End Enum\nEnd Structure\n\nPublic Interface Int ' Noncompliant {{Move 'Int' into a named namespace.}}\n    Interface InnerInt ' Compliant - we want to report only on the outer interface\n    End Interface\nEnd Interface\n\nPublic Enum Enu ' Noncompliant {{Move 'Enu' into a named namespace.}}\n    Test\nEnd Enum\n\nNamespace Tests.Diagnostics\n    Class Program\n    End Class\n\n    Structure MyStruct\n    End Structure\n\n    Public Enum MyEnu\n        Test\n    End Enum\n\n    Public Interface MyInt\n    End Interface\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DeclareTypesInNamespaces2.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\npublic class Foo2 // Noncompliant {{Move 'Foo2' into a named namespace.}}\n{\n    class InnerFoo // Compliant - we want to report only on the outer class\n    {\n    }\n}\n\npublic struct Bar2 // Noncompliant {{Move 'Bar2' into a named namespace.}}\n{\n    struct InnerBar // Compliant - we want to report only on the outer struct\n    {\n    }\n\n    enum InnerEnu // Compliant - we want to report only on outer enum\n    {\n    }\n}\n\npublic enum Enu2 // Noncompliant {{Move 'Enu2' into a named namespace.}}\n{\n    Test\n}\n\nnamespace Tests.Diagnostics2\n{\n    class Program { }\n\n    struct MyStruct { }\n\n    public interface MyInt { }\n\n    public enum Enu\n    {\n        Test\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DeclareTypesInNamespaces2.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\n\nPublic Class Foo2 ' Noncompliant {{Move 'Foo2' into a named namespace.}}\n    Class InnerFoo ' Compliant - we want to report only on the outer class\n    End Class\nEnd Class\n\nPublic Structure Bar2 ' Noncompliant {{Move 'Bar2' into a named namespace.}}\n    Structure InnerBar ' Compliant - we want to report only on the outer struct\n    End Structure\n\n    Public Enum InnerEnu ' Compliant - we want to report only on outer enum\n        Test\n    End Enum\nEnd Structure\n\nPublic Interface Int2 ' Noncompliant {{Move 'Int2' into a named namespace.}}\n    Interface InnerInt ' Compliant - we want to report only on the outer interface\n    End Interface\nEnd Interface\n\nPublic Enum Enu2 ' Noncompliant {{Move 'Enu2' into a named namespace.}}\n    Test\nEnd Enum\n\nNamespace Tests.Diagnostics2\n    Class Program\n    End Class\n\n    Structure MyStruct\n    End Structure\n\n    Public Enum MyEnu\n        Test\n    End Enum\n\n    Public Interface MyInt\n    End Interface\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DefaultSectionShouldBeFirstOrLast.CSharp9.cs",
    "content": "﻿switch (args[0])\n{\n    case \"a\":\n        break;\n    default: // Noncompliant {{Move this 'default:' case to the beginning or end of this 'switch' statement.}}\n//  ^^^^^^^^\n        break;\n    case \"b\":\n        break;\n}\n\nswitch (args[0])\n{\n    default: // Compliant - first section\n        break;\n\n    case \"a\":\n        break;\n}\n\nswitch (args[0])\n{\n    case \"a\":\n        break;\n    default: // Compliant - last section\n        break;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DefaultSectionShouldBeFirstOrLast.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class Program\n    {\n        public void Foo(int a)\n        {\n            switch (a)\n            {\n                case 0:\n                    break;\n                default: // Compliant - last section\n                    break;\n            }\n\n            switch (a)\n            {\n                default: // Compliant - first section\n                    break;\n\n                case 0:\n                    break;\n            }\n\n            switch (a)\n            {\n                case 0:\n                    break;\n                default: // Noncompliant {{Move this 'default:' case to the beginning or end of this 'switch' statement.}}\n//              ^^^^^^^^\n                    break;\n                case 1:\n                    break;\n            }\n\n            switch (a)\n            {\n            }\n\n            switch (a)\n            {\n                case 42:\n                    break;\n            }\n\n            switch (a)\n            {\n                default:\n                    break;\n            }\n\n            switch (a)\n            {\n                case 0:\n                    break;\n                case 1:\n                default:\n                    break;\n            }\n\n            switch (a)\n            {\n                case 0:\n                default:\n                    break;\n            }\n\n            switch (a)\n            {\n                case 0:\n                    break;\n                case 1:\n                default: // Noncompliant\n                    break;\n                case 2:\n                    break;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DelegateSubtraction.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\nusing static DelegateSubtraction;\n\npublic class DelegateSubtraction\n{\n    public delegate void MyDelegate();\n\n    private static void Test()\n    {\n        MyDelegate first, second, third, fourth;\n        first = () => Console.Write(\"1\");\n        second = () => Console.Write(\"2\");\n        third = () => Console.Write(\"3\");\n        fourth = () => Console.Write(\"4\");\n\n        MyDelegate chain1234 = first + second + third + fourth; // Compliant - chain sequence = \"1234\"\n        MyDelegate chain12 = chain1234 - third - fourth; // Compliant - chain sequence = \"12\"\n        chain12 = chain1234 - (third + third) - fourth; // Noncompliant {{Review this subtraction of a chain of delegates: it may not work as you expect.}}\n//                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n        // The chain sequence of \"chain23\" will be \"1234\" instead of \"23\"!\n        // Indeed, the sequence \"1234\" does not contain the subsequence \"14\", so nothing is subtracted\n        // (but note that \"1234\" contains both the \"1\" and \"4\" subsequences)\n        MyDelegate chain23 = chain1234 - (first + fourth); // Noncompliant\n\n        chain23(); // will print \"1234\"!\n\n        chain23 = chain1234 - first - (fourth); // Compliant - \"1\" is first removed, followed by \"4\"\n\n        chain23(); // will print \"23\"\n\n        chain23 -= first + fourth; // Noncompliant\n        chain23 -= (first); // Compliant\n\n        unsafe\n        {\n            GCHandle pinnedArray = GCHandle.Alloc(new object(), GCHandleType.Pinned);\n            IntPtr pointer = pinnedArray.AddrOfPinnedObject();\n\n            int* a = (int*)pointer.ToPointer();\n            int* b = (int*)pointer.ToPointer();\n            var zero = a - b;\n        }\n    }\n}\nrecord R\n{\n    MyDelegate first, second, third, fourth;\n    string Property\n    {\n        init\n        {\n            MyDelegate chain1234 = first + second + third + fourth; // Compliant - chain sequence = \"1234\"\n            MyDelegate chain12 = chain1234 - third - fourth; // Compliant - chain sequence = \"12\"\n            chain12 = chain1234 - (third + third) - fourth; // Noncompliant {{Review this subtraction of a chain of delegates: it may not work as you expect.}}\n        }\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/8467\nclass Repro_8467\n{\n    void SwitchStatement(Action action)\n    {\n        action -= 1 switch // Noncompliant FP\n        {\n            1 => action,\n            2 => action,\n        };\n    }\n}\n\n\npublic partial class PartialProperty\n{\n    public partial MyDelegate first  => () => Console.Write(\"1\"); \n    public partial MyDelegate second => () => Console.Write(\"2\");\n    public partial MyDelegate third => () => Console.Write(\"3\");\n    public partial MyDelegate fourth => () => Console.Write(\"4\");\n\n    public void TestPartialProperties()\n    {\n        MyDelegate chain1234 = first + second + third + fourth; // Compliant - chain sequence = \"1234\"\n        MyDelegate chain12 = chain1234 - third - fourth; // Compliant - chain sequence = \"12\"\n        chain12 = chain1234 - (third + third) - fourth; // Noncompliant {{Review this subtraction of a chain of delegates: it may not work as you expect.}}\n        MyDelegate chain23 = chain1234 - (first + fourth); // Noncompliant\n\n        chain23(); // will print \"1234\"!\n\n        chain23 = chain1234 - first - (fourth); // Compliant - \"1\" is first removed, followed by \"4\"\n\n        chain23(); // will print \"23\"\n\n        chain23 -= first + fourth; // Noncompliant\n        chain23 -= (first); // Compliant\n    }\n}\n\npublic partial class PartialProperty\n{\n    public partial MyDelegate first { get; }\n    public partial MyDelegate second { get; }\n    public partial MyDelegate third { get; }\n    public partial MyDelegate fourth { get; }\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DelegateSubtraction.TopLevelStatements.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\n\nMyDelegate first, second, third, fourth;\nfirst = () => Console.Write(\"1\");\nsecond = () => Console.Write(\"2\");\nthird = () => Console.Write(\"3\");\nfourth = () => Console.Write(\"4\");\n\nMyDelegate chain1234 = first + second + third + fourth; // Compliant - chain sequence = \"1234\"\nMyDelegate chain12 = chain1234 - third - fourth; // Compliant - chain sequence = \"12\"\nchain12 = chain1234 - (third + third) - fourth; // Noncompliant {{Review this subtraction of a chain of delegates: it may not work as you expect.}}\n//        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\npublic delegate void MyDelegate();\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DelegateSubtraction.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\n\npublic class DelegateSubtraction\n{\n    public delegate void MyDelegate();\n\n    private static void Test()\n    {\n        MyDelegate first, second, third, fourth;\n        first = () => Console.Write(\"1\");\n        second = () => Console.Write(\"2\");\n        third = () => Console.Write(\"3\");\n        fourth = () => Console.Write(\"4\");\n\n        MyDelegate chain1234 = first + second + third + fourth; // Compliant - chain sequence = \"1234\"\n        MyDelegate chain12 = chain1234 - third - fourth; // Compliant - chain sequence = \"12\"\n        chain12 = chain1234 - (third + third) - fourth; // Noncompliant {{Review this subtraction of a chain of delegates: it may not work as you expect.}}\n//                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n        // The chain sequence of \"chain23\" will be \"1234\" instead of \"23\"!\n        // Indeed, the sequence \"1234\" does not contain the subsequence \"14\", so nothing is subtracted\n        // (but note that \"1234\" contains both the \"1\" and \"4\" subsequences)\n        MyDelegate chain23 = chain1234 - (first + fourth); // Noncompliant\n\n        chain23(); // will print \"1234\"!\n\n        chain23 = chain1234 - first - (fourth); // Compliant - \"1\" is first removed, followed by \"4\"\n\n        chain23(); // will print \"23\"\n\n        chain23 -= first + fourth; // Noncompliant\n        chain23 -= (first); // Compliant\n\n        MyDelegate chain14 = first + fourth;    // creates a new MyDelegate instance which is a list under the covers\n        chain23 = chain1234 - chain14;          // FN: (first + fourth) doesn't exist in chain1234 - NET-2639\n\n        unsafe\n        {\n            GCHandle pinnedArray = GCHandle.Alloc(new object(), GCHandleType.Pinned);\n            IntPtr pointer = pinnedArray.AddrOfPinnedObject();\n\n            int* a = (int*)pointer.ToPointer();\n            int* b = (int*)pointer.ToPointer();\n            var zero = a - b;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DisposableMemberInNonDisposableClass.CSharp9.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Threading.Tasks;\n\nFileStream fs = new FileStream(\"\", FileMode.Open); // Compliant, not a class member\n\npublic class ResourceHolder   // Noncompliant {{Implement 'IDisposable' in this class and use the 'Dispose' method to call 'Dispose' on 'fs'.}}\n//           ^^^^^^^^^^^^^^\n{\n    protected FileStream fs;\n    public void OpenResource(string path)\n    {\n        this.fs = new FileStream(path, FileMode.Open);\n    }\n    public void CloseResource()\n    {\n        this.fs.Close();\n    }\n}\n\npublic record RecordInit\n{\n    protected FileStream fs;\n    public FileStream FsProp\n    {\n        init\n        {\n            FsProp = new FileStream(\"\", FileMode.Open);\n        }\n    }\n}\n\npublic record RecordConstruct // Noncompliant {{Implement 'IDisposable' in this class and use the 'Dispose' method to call 'Dispose' on 'fs'.}}\n{\n    protected FileStream fs;\n    public RecordConstruct()\n    {\n        fs = new FileStream(\"\", FileMode.Open);\n    }\n}\n\npublic record RecordDispose : IDisposable\n{\n    protected FileStream fs;\n    public RecordDispose()\n    {\n        fs = new FileStream(\"\", FileMode.Open);\n    }\n    public void Dispose()\n    {\n        this.fs.Dispose();\n    }\n}\n\npartial class PartialMethod1 : IDisposable\n{\n    private readonly IDisposable _disposable = new FileStream(\"a\", FileMode.Open);\n    public partial void Dispose();\n    partial void MyDispose();\n}\n\npartial class PartialMethod1\n{\n    public partial void Dispose() => MyDispose();\n    partial void MyDispose() => _disposable.Dispose();\n}\n\npartial class PartialMethod2 // Noncompliant\n{\n    public partial void Dispose();\n    partial void MyDispose();\n}\n\npartial class PartialMethod2 // Noncompliant\n{\n    private readonly IDisposable _disposable = new FileStream(\"a\", FileMode.Open);\n    public partial void Dispose() => MyDispose();\n    partial void MyDispose() => _disposable.Dispose();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DisposableMemberInNonDisposableClass.NetCore.cs",
    "content": "﻿using System;\nusing System.Threading;\nusing System.Threading.Tasks;\n\npublic class TestClass : IAsyncDisposable\n{\n    private CancellationTokenSource cancellationTokenSource;\n\n    public Task MethodAsync()\n    {\n        this.cancellationTokenSource = new CancellationTokenSource();\n        return Task.Delay(1000, this.cancellationTokenSource.Token);\n    }\n\n    public ValueTask DisposeAsync()\n    {\n        this.cancellationTokenSource?.Dispose();\n        return new ValueTask();\n    }\n}\n\npublic class C1 // Noncompliant, needs to implement IDisposable or IAsyncDisposable\n{\n    private IAsyncDisposable disposable;\n\n    public void Init() => disposable = new AsyncDisposable();\n}\n\npublic class C2 : IAsyncDisposable // Implements IAsyncDisposable\n{\n    private IAsyncDisposable disposable;\n\n    public void Init() => disposable = new AsyncDisposable();\n\n    public ValueTask DisposeAsync() => disposable.DisposeAsync();\n}\n\npublic class AsyncDisposable : IAsyncDisposable\n{\n    public ValueTask DisposeAsync() => new ValueTask();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DisposableMemberInNonDisposableClass.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Threading.Tasks;\n\n\nnamespace Tests.Diagnostics\n{\n    public class ResourceHolder   // Noncompliant {{Implement 'IDisposable' in this class and use the 'Dispose' method to call 'Dispose' on 'fs'.}}\n//               ^^^^^^^^^^^^^^\n    {\n        private FileStream fs;  // This member is never Disposed\n        public void OpenResource(string path)\n        {\n            this.fs = new FileStream(path, FileMode.Open);\n        }\n        public void CloseResource()\n        {\n            this.fs.Close();\n        }\n    }\n\n    public class ResourceHolder2 : IDisposable\n    {\n        protected FileStream fs;\n        public void OpenResource(string path)\n        {\n            this.fs = new FileStream(path, FileMode.Open);\n        }\n        public void CloseResource()\n        {\n            this.fs.Close();\n        }\n\n        public void Dispose() // FN, it does not dispose fs\n        {\n        }\n    }\n\n    public abstract class ResourceHolder3 // Noncompliant\n    {\n        protected FileStream fs;\n\n        protected ResourceHolder3(string path)\n        {\n            this.fs = new FileStream(path, FileMode.Open);\n        }\n\n        public virtual void Dispose()\n        {\n        }\n    }\n\n    public class ResourceHolder4 : ResourceHolder3 // Compliant; it doesn't have its own field\n    {\n        ResourceHolder4(string path) : base(path) { }\n        public void OpenResource(string path)\n        {\n            this.fs = new FileStream(path, FileMode.Open);\n        }\n        public void CloseResource()\n        {\n            this.fs.Close();\n        }\n    }\n\n    public class ResourceHolder5 : ResourceHolder2 //Compliant\n    {\n    }\n\n    public class ObserverVsOwner // Noncompliant {{Implement 'IDisposable' in this class and use the 'Dispose' method to call 'Dispose' on 'fs2' and 'fs3'.}}\n    {\n        protected FileStream fs, fs2 = new FileStream(\"eee\", FileMode.Open), fs3; // Only fs will be compliant\n        public FileStream Stream\n        {\n            get { return fs; }\n            set { fs = value; }\n        }\n        public ObserverVsOwner(string path)\n        {\n            fs3 = new FileStream(path, FileMode.Open);\n        }\n    }\n\n    public class TestWithTasks // Noncompliant {{Implement 'IDisposable' in this class and use the 'Dispose' method to call 'Dispose' on 't2'.}}\n    {\n        // Tasks are IDisposable who usually don't really need to be disposed, but they are typicall create with a factory\n        Task t1 = Task.Run(() => { Console.WriteLine(\"Who did that?\"); });\n        Task t2 = new Task(() => { Console.WriteLine(\"Not me!\"); });\n    }\n\n    public class ExpressionBodied // Noncompliant {{Implement 'IDisposable' in this class and use the 'Dispose' method to call 'Dispose' on 'fs'.}}\n    {\n        protected FileStream fs;\n        ExpressionBodied(int i) => fs = new FileStream(\"eee\", FileMode.Open);\n    }\n\n    public interface IService\n    {\n\n    }\n\n    public ref struct DisposableStruct // Compliant - FN\n    {\n        private FileStream fs;  // This member is never Disposed\n\n        public void OpenResource(string path)\n        {\n            this.fs = new FileStream(path, FileMode.Open);\n        }\n    }\n\n    //See https://github.com/SonarSource/sonar-dotnet/issues/2957\n    public class Repro_2957 // Noncompliant {{Implement 'IDisposable' in this class and use the 'Dispose' method to call 'Dispose' on '_disposable'.}}\n    {\n        private readonly IDisposable _disposable;\n\n        public Repro_2957()\n        {\n            _disposable = new DisposableStuff();\n        }\n\n        private sealed class DisposableStuff : IDisposable\n        {\n            public void Dispose() { }\n        }\n    }\n\n    partial class PartialMethod1 : IDisposable\n    {\n        private readonly IDisposable _disposable = new FileStream(\"a\", FileMode.Open);\n        public void Dispose()\n        {\n            MyDispose();\n        }\n        partial void MyDispose();\n    }\n\n    partial class PartialMethod1 : IDisposable\n    {\n        partial void MyDispose()\n        {\n            _disposable.Dispose();\n        }\n    }\n\n    partial class PartialMethod2 // Noncompliant\n    {\n        private readonly IDisposable _disposable = new FileStream(\"a\", FileMode.Open);\n        public void Dispose()\n        {\n            MyDispose();\n        }\n        partial void MyDispose();\n    }\n\n    partial class PartialMethod2 // Noncompliant\n    {\n        partial void MyDispose()\n        {\n            _disposable.Dispose();\n        }\n    }\n\n    partial class PartialMethod3 : IDisposable\n    {\n        private readonly IDisposable _disposable = new FileStream(\"a\", FileMode.Open);\n        public void Dispose()\n        {\n            MyDispose();\n        }\n        partial void MyDispose();\n    }\n\n    partial class PartialMethod3\n    {\n        partial void MyDispose()\n        {\n            _disposable.Dispose();\n        }\n    }\n\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DisposableNotDisposed.ILogger.cs",
    "content": "﻿using Microsoft.Extensions.Logging;\nusing System;\n\npublic class DisposableNotDisposed_ILogger\n{\n    public void ILoggerTests(ILogger logger)\n    {\n        var scope1 = logger.BeginScope(\"Test\");                                // FN. Non-compliant {{Dispose 'scope1' when it is no longer needed.}} \n        using (var scope2 = logger.BeginScope(\"Test\"))                         // Compliant\n        { };\n        var scope3 = logger.BeginScope<string>(null);                          // FN\n        var scope4 = logger.BeginScope(\"messageFormat\", 1);                    // FN. extension method\n        var scope5 = LoggerExtensions.BeginScope(logger, \"messageFormat\", 1);  // FN. extension method\n    }\n\n    public void ILoggerTCategoryNameTests(ILogger<DisposableNotDisposed_ILogger> logger)\n    {\n        var scope1 = logger.BeginScope(\"Test\"); // FN\n    }\n\n    public void DisposedInFinally(ILogger logger)\n    {\n        IDisposable loggerScope = null;\n        try\n        {\n            loggerScope = logger.BeginScope(\"Test\"); // Compliant\n        }\n        finally\n        {\n            loggerScope.Dispose();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DisposableNotDisposed.Latest.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Net;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing FluentAssertions.Execution;\n\npublic class DisposableNotDisposedAsync\n{\n    private FileStream field_fs1 = new FileStream(@\"c:\\foo.txt\", FileMode.Open);    // Compliant - disposed in a public async method\n    private FileStream field_fs2 = File.Open(@\"c:\\foo.txt\", FileMode.Open);         // Compliant - disposed in a public async method\n    private FileStream field_fs3 = new FileStream(@\"c:\\foo.txt\", FileMode.Open);    // FN - the method which disposes it is private, and it's not referenced anywhere\n    private FileStream field_fs4 = new FileStream(@\"c:\\foo.txt\", FileMode.Open);    // Compliant - disposed in a public async ValueTask method\n    private FileStream field_fs5 = new FileStream(@\"c:\\foo.txt\", FileMode.Open);    // Compliant - disposed in a public ValueTask method (without async/await)\n    private FileStream field_fs6 = new FileStream(@\"c:\\foo.txt\", FileMode.Open);    // Compliant - disposed in a public ValueTask method (without async/await)\n\n    public async Task DisposeAsynchronously()\n    {\n        await using (var fs = new FileStream(@\"c:\\foo.txt\", FileMode.Open))         // Compliant - automatically disposed with the async using block\n        {\n            // do nothing\n        }\n\n        FileStream fs2;\n        await using (fs2 = new FileStream(@\"c:\\foo.txt\", FileMode.Open))\n        {\n            // do nothing\n        }\n\n        FileStream fs3 = new FileStream(@\"c:\\foo.txt\", FileMode.Open);\n        await using (fs3)\n        {\n            // do nothing\n        }\n\n        FileStream fs4 = new FileStream(@\"c:\\foo.txt\", FileMode.Open);\n        await using (fs4.ConfigureAwait(false))\n        {\n            // do nothing\n        }\n\n        FileStream fs5;\n        await using ((fs5 = new FileStream(@\"c:\\foo.txt\", FileMode.Open)).ConfigureAwait(false))\n        {\n            var fs5_1 = new FileStream(@\"c:\\foo.txt\", FileMode.Open);               // Noncompliant\n            fs5_1 = new FileStream(@\"c:\\foo.txt\", FileMode.Open);                   // Noncompliant\n\n            using (var fs5_2 = new FileStream(@\"c:\\foo.txt\", FileMode.Open))\n            {\n                fs5_1 = new FileStream(@\"c:\\foo.txt\", FileMode.Open);               // Noncompliant\n            }\n        }\n\n        FileStream fs6;\n        await using ((fs6 = File.Open(@\"c:\\foo.txt\", FileMode.Open)).ConfigureAwait(false))\n        {\n            // do nothing\n        }\n\n        FileStream fs7 = new FileStream(@\"c:\\foo.txt\", FileMode.Open);\n        await using (var ignored = fs7.ConfigureAwait(false))\n            ;\n\n        FileStream fs8 = new FileStream(@\"c:\\foo.txt\", FileMode.Open);\n        await using var ignored2 = fs8.ConfigureAwait(false);\n\n        using var fs9 = new FileStream(@\"c:\\foo.txt\", FileMode.Open);\n\n        await using var fs10 = new FileStream(@\"c:\\foo.txt\", FileMode.Open);\n\n        await using var fs11 = File.Open(@\"c:\\foo.txt\", FileMode.Open);\n\n        var fs12 = new FileStream(@\"c:\\foo.txt\", FileMode.Open);                     // Compliant - asynchronously disposed manually\n        await fs12.DisposeAsync();\n    }\n\n    public async Task SomePublicAsyncMethod()\n    {\n        await field_fs1.DisposeAsync().ConfigureAwait(false);\n        await field_fs2.DisposeAsync();\n    }\n\n    private async Task SomePrivateAsyncMethod()\n    {\n        await field_fs3.DisposeAsync();\n    }\n\n    public async ValueTask SomePublicAsyncMethodWithValueTask()\n    {\n        await field_fs4.DisposeAsync();\n    }\n\n    public ValueTask SomePublicMethodWithValueTask()\n    {\n        return field_fs5.DisposeAsync();\n    }\n\n    public ValueTask AnotherPublicValueTaskMethod() => field_fs6.DisposeAsync();\n}\n\npublic sealed class ImplementsAsyncDisposable : IAsyncDisposable\n{\n    private readonly FileStream stream;\n\n    public ImplementsAsyncDisposable()\n    {\n        stream = new FileStream(@\"c:\\foo.txt\", FileMode.Open);                      // Compliant - see GitHub issue: https://github.com/SonarSource/sonar-dotnet/issues/5879\n    }\n\n    public async ValueTask DisposeAsync()\n    {\n        await stream.DisposeAsync();\n    }\n}\n\npublic class AsyncDisposableTest\n{\n    private ImplementsAsyncDisposable stream = new ImplementsAsyncDisposable();     // Compliant - the rule only tracks specific IDisposable / IAsyncDisposable types\n}\n\npublic class FluentAssertionsTest\n{\n    public void FluentAssertionTypes()\n    {\n        var scope = new AssertionScope();                                           // Noncompliant\n        var s = new FluentAssertions.Execution.AssertionScope();                    // Noncompliant\n\n        using var _ = new AssertionScope();\n        using (var disposed = new AssertionScope())\n        {\n        }\n    }\n}\n\npublic ref struct Struct\n{\n    public void Dispose()\n    {\n    }\n}\n\npublic class Consumer\n{\n    public void Method()\n    {\n        using var x = new Struct();\n        var y = new Struct();                                                       // Noncompliant\n    }\n}\n\nclass Foo\n{\n    public void Bar(object cond)\n    {\n        var fs = new FileStream(\"\", FileMode.Open); // FN, not disposed on all paths\n        if (cond is 5)\n        {\n            fs.Dispose();\n        }\n        else if (cond is not 599)\n        {\n            fs.Dispose();\n        }\n    }\n\n    public void Lambdas()\n    {\n        Action<int, int> a = static (int v, int w) => {\n            var fs = new FileStream(\"\", FileMode.Open); // Noncompliant\n        };\n        Action<int, int> b = (_, _) => {\n            var fs = new FileStream(\"\", FileMode.Open);\n            fs.Dispose();\n        };\n        Action<int, int> с = static (int v, int w) => {\n            FileStream fs = new(\"\", FileMode.Open); // Noncompliant\n        };\n        Action<int, int> в = (_, _) => {\n            FileStream fs = new(\"\", FileMode.Open);\n            fs.Dispose();\n        };\n    }\n}\n\nrecord MyRecord\n{\n    private FileStream field_fs1; // Compliant - not instantiated\n    public FileStream field_fs2 = new FileStream(@\"c:\\foo.txt\", FileMode.Open); // Compliant - public\n    private FileStream field_fs3 = new FileStream(@\"c:\\foo.txt\", FileMode.Open); // Noncompliant {{Dispose 'field_fs3' when it is no longer needed.}}\n    private FileStream field_fs4 = new FileStream(@\"c:\\foo.txt\", FileMode.Open); // Compliant - disposed\n    private FileStream field_fs5 = new(@\"c:\\foo.txt\", FileMode.Open); // Noncompliant {{Dispose 'field_fs5' when it is no longer needed.}}\n\n    private FileStream backing_field1;\n    public FileStream Prop1\n    {\n        init\n        {\n            backing_field1 = new FileStream(\"\", FileMode.Open); // Noncompliant\n        }\n    }\n\n    private FileStream backing_field2;\n    public FileStream Prop2\n    {\n        init\n        {\n            backing_field2 = new(\"\", FileMode.Open); // Noncompliant\n        }\n    }\n\n    public void Foo()\n    {\n        field_fs4.Dispose();\n\n        FileStream fs5; // Compliant - used properly\n        using (fs5 = new FileStream(@\"c:\\foo.txt\", FileMode.Open))\n        {\n            // do nothing but dispose\n        }\n\n        using (fs5 = new(@\"c:\\foo.txt\", FileMode.Open))\n        {\n            // do nothing but dispose\n        }\n\n        FileStream fs1 = new(@\"c:\\foo.txt\", FileMode.Open);        // Noncompliant\n        var fs2 = File.Open(@\"c:\\foo.txt\", FileMode.Open);         // Noncompliant - instantiated with factory method\n        var s = new WebClient();                                   // Noncompliant - another tracked type\n    }\n}\n\npublic class DisposableNotDisposed\n{\n    private struct InnerStruct\n    {\n        public InnerStruct() { }\n\n        private FileStream inner_field_fs1 = new FileStream(@\"c:\\foo.txt\", FileMode.Open); // Noncompliant - should be reported on once\n    }\n}\n\nclass FieldKeyWord\n{\n    public FileStream FS\n    {\n        get => field;\n        private set => field = value;\n    } = new(@\"c:\\foo.txt\", FileMode.Open);  // Compliant: technically `field` is a private field but this is like an auto-property, which is out of scope\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DisposableNotDisposed.TopLevelStatements.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Net;\nusing System.Threading;\nusing System.Threading.Tasks;\n\nvar fs0 = new FileStream(@\"c:\\foo.txt\", FileMode.Open); // Noncompliant\nFileStream fs1 = new(@\"c:\\foo.txt\", FileMode.Open);     // Noncompliant\n\nvar fs2 = new FileStream(@\"c:\\foo.txt\", FileMode.Open); // Compliant, passed to a method\nNoOperation(fs2);\n\nFileStream fs3; // Compliant - not instantiated\nusing var fs5 = new FileStream(@\"c:\\foo.txt\", FileMode.Open); // Compliant\n\nusing FileStream fs6 = new(@\"c:\\foo.txt\", FileMode.Open); // Compliant\n\nvoid NoOperation(object x) { }\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DisposableNotDisposed.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Net;\nusing System.Net.Sockets;\nusing System.Threading;\n\nnamespace Tests.Diagnostics\n{\n    public class DisposableNotDisposed\n    {\n        private FileStream field_fs1; // Compliant - not instantiated\n        public FileStream field_fs2 = new FileStream(@\"c:\\foo.txt\", FileMode.Open); // Compliant - public\n        private FileStream field_fs3 = new FileStream(@\"c:\\foo.txt\", FileMode.Open); // Noncompliant {{Dispose 'field_fs3' when it is no longer needed.}}\n//                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        private FileStream field_fs4 = new FileStream(@\"c:\\foo.txt\", FileMode.Open); // Compliant - disposed\n        private FileStream field_fs5;\n        private FileStream field_fs6;\n        private object field_fs7;\n        private FileStream field_fs8 = new FileStream(@\"c:\\foo.txt\", FileMode.Open); // Compliant - passed to method using this\n        FileStream field_fs9 = new FileStream(@\"c:\\foo.txt\", FileMode.Open); // Noncompliant - effectively private\n        private FileStream field_fs10 = new FileStream(@\"c:\\foo.txt\", FileMode.Open); // Compliant - aliased in constructor initializer\n\n        private TcpListener listener = new TcpListener(9000); // Compliant, not IDisposable\n\n        private class InnerClass\n        {\n            private FileStream inner_field_fs1 = new FileStream(@\"c:\\foo.txt\", FileMode.Open); // Noncompliant - should be reported on once\n        }\n\n        private FileStream Return()\n        {\n            var fs = new FileStream(@\"c:\\foo.txt\", FileMode.Open); // Compliant - returned\n            return fs;\n        }\n\n        public DisposableNotDisposed() : this(field_fs10) // Error [CS0120]\n        {\n        }\n\n        public DisposableNotDisposed(FileStream fs)\n        {\n            var fs1 = new FileStream(@\"c:\\foo.txt\", FileMode.Open); // Noncompliant - directly instantiated with new\n            var fs2 = File.Open(@\"c:\\foo.txt\", FileMode.Open); // Noncompliant - instantiated with factory method\n            Stream fs3 = new FileStream(@\"c:\\foo.txt\", FileMode.Open); // Noncompliant - declaration type should not matter\n            var s = new WebClient(); // Noncompliant - another tracked type\n\n            var fs4 = new FileStream(@\"c:\\foo.txt\", FileMode.Open); // Compliant - passed to a method\n            NoOperation(fs4);\n\n            FileStream fs5; // Compliant - used properly\n            using (fs5 = new FileStream(@\"c:\\foo.txt\", FileMode.Open))\n            {\n                // do nothing but dispose\n            }\n\n            using (var fs6 = new FileStream(@\"c:\\foo.txt\", FileMode.Open)) // Compliant - used properly\n            {\n                // do nothing but dispose\n            }\n\n            FileStream fs6_1 = new FileStream(@\"c:\\foo.txt\", FileMode.Open);\n            using (fs6_1)\n            {\n                // do nothing but dispose\n            }\n\n            var fs7 = new FileStream(@\"c:\\foo.txt\", FileMode.Open); // Compliant - Dispose()\n            fs7.Dispose();\n\n            var fs8 = new FileStream(@\"c:\\foo.txt\", FileMode.Open); // Compliant - Close()\n            fs8.Close();\n\n            var fs9 = new FileStream(@\"c:\\foo.txt\", FileMode.Open); // Compliant - disposed using elvis operator\n            fs9?.Dispose();\n\n            FileStream fs10 = fs; // Compliant - not instantiated directly\n\n            var fs11 = new FileStream(@\"c:\\foo.txt\", FileMode.Open); // Compliant - aliased\n            var newFs = fs11;\n\n            var fs12 = new BufferedStream(fs); // Compliant - constructed from another stream\n            var fs13 = new StreamReader(fs); // Compliant - constructed from another stream\n\n            var fs14 = new FileStream(@\"c:\\foo.txt\", FileMode.Open); // Compliant - passed to another method (or constructor)\n            var fs15 = new BufferedStream(fs14); // Compliant - not tracked\n\n            var fs16 = new FileStream(@\"c:\\foo.txt\", FileMode.Open); // Compliant - aliased\n            var myAnonymousType = new { SomeField = fs16 };\n\n            FileStream fs17; // Compliant - no initializer, should not fail\n\n            FileStream\n                fs18 = new FileStream(@\"c:\\foo.txt\", FileMode.Open), // Noncompliant - test issue location\n                fs19; // Compliant - not instantiated\n\n            FileStream fs20 = new FileStream(@\"c:\\foo.txt\", FileMode.Open); // Compliant - aliased\n            Stream fs21;\n            fs21 = fs20;\n\n            FileStream fs22;\n            fs22 = new FileStream(@\"c:\\foo.txt\", FileMode.Open); // Noncompliant\n\n            field_fs4.Dispose();\n\n            field_fs5 = new FileStream(@\"c:\\foo.txt\", FileMode.Open); // Noncompliant\n\n            NoOperation(field_fs6);\n            field_fs6 = new FileStream(@\"c:\\foo.txt\", FileMode.Open); // FN - field_fs6 is re-assigned a new FileStream (and not disposed) after passing it to a method\n\n            field_fs7 = new FileStream(@\"c:\\foo.txt\", FileMode.Open); // Noncompliant - even if field_fs7's type is object\n\n            NoOperation(this.field_fs8);\n\n            var tokenSource1 = new CancellationTokenSource(); // Noncompliant\n            var tokenSource2 = CancellationTokenSource.CreateLinkedTokenSource(CancellationToken.None, CancellationToken.None); // Noncompliant\n            var tokenSource3 = CancellationTokenSource.CreateLinkedTokenSource(CancellationToken.None, CancellationToken.None); // Compliant, disposed\n            tokenSource3.Dispose();\n        }\n\n        private void Conditions(bool cond, string x)\n        {\n            var fs1 = new FileStream(@\"c:\\foo.txt\", FileMode.Open); // FN - not disposed on all paths\n            if (cond)\n            {\n                fs1.Dispose();\n            }\n        }\n\n        private void NoOperation(FileStream fs)\n        {\n            // do nothing\n        }\n    }\n\n    public class Empty\n    {\n    }\n\n    public sealed class ImplementsDisposable : IDisposable\n    {\n        private readonly FileStream stream;\n\n        public ImplementsDisposable()\n        {\n            stream = new FileStream(@\"c:\\foo.txt\", FileMode.Open);              // Compliant\n        }\n\n        public void Dispose()\n        {\n            stream.Dispose();\n        }\n    }\n\n    public class DisposableTest\n    {\n        private ImplementsDisposable stream = new ImplementsDisposable();     // Compliant - the rule only tracks specific IDisposable / IAsyncDisposable types\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/8365\n    class Repro_8365\n    {\n        void NotDisposed(string filePath)\n        {\n            FileStream fileStream = File.OpenRead(filePath); // FN\n        }\n\n        void Disposed(string filePath)\n        {\n            FileStream fileStream = File.OpenRead(filePath); // Compliant\n            fileStream.Dispose();\n        }\n    }\n\n    public class Repro_8336_1 : IDisposable\n    {\n        private readonly CancellationTokenSource source;\n\n        public Repro_8336_1() =>\n            source = new CancellationTokenSource(); // Compliant\n\n        public void Dispose() =>\n             source.Dispose();\n    }\n\n    public class Repro_8336_2 : IDisposable\n    {\n        private readonly CancellationTokenSource source;\n\n        public Repro_8336_2() =>\n            source = new CancellationTokenSource(); // Noncompliant\n\n        public void Dispose()\n        {\n            // Did we forget to dispose something here?\n        }\n    }\n\n    // NET-3282: https://sonarsource.atlassian.net/browse/NET-3282\n    public class Repro_ExplicitIDisposableCast : IDisposable\n    {\n        private readonly CancellationTokenSource source;\n\n        public Repro_ExplicitIDisposableCast() =>\n            source = new CancellationTokenSource(); // Noncompliant - FP: disposed via explicit cast to IDisposable\n\n        public void Dispose()\n        {\n            ((IDisposable)source).Dispose();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DisposableReturnedFromUsing.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Text;\n\nrecord R\n{\n    public FileStream Method(string path)\n    {\n        using var fs1 = File.Create(path); // Noncompliant {{Remove the 'using' statement; it will cause automatic disposal of 'fs1'.}}\n\n        using var fs2 = File.Create(path);\n\n        return fs1;\n    }\n}\n\npublic class DisposableReturnedFromUsing\n{\n    public FileStream Method(string path)\n    {\n        using var fs1 = File.Create(path); // Noncompliant {{Remove the 'using' statement; it will cause automatic disposal of 'fs1'.}}\n//      ^^^^^\n\n        using var fs2 = File.Create(path);\n\n        return fs1;\n    }\n\n    public FileStream MethodSingleNoncompliantVariables(string path)\n    {\n        // Noncompliant@+1 {{Remove the 'using' statement; it will cause automatic disposal of 'fs1'.}}\n        using FileStream fs1 = File.Create(path), fs2 = File.Create(path);\n\n        if (path != null)\n            return fs1;\n        return null;\n    }\n\n    public FileStream MethodMultipleNoncompliantVariables(string path)\n    {\n        // Noncompliant@+1 {{Remove the 'using' statement; it will cause automatic disposal of 'fs1' and 'fs2'.}}\n        using FileStream fs1 = File.Create(path), fs2 = File.Create(path);\n\n        if (path != null)\n            return fs1;\n        return fs2;\n    }\n\n    public FileStream MethodWithSwitch(string x)\n    {\n        using var fs1 = File.Create(x);\n        var result = x switch\n        {\n            \"\" => fs1,\n            \"1\" => null\n        };\n        return result; // FN, we don't track aliasing\n    }\n\n    public ref struct Struct\n    {\n        public void Dispose()\n        {\n        }\n    }\n\n    public Struct Foo()\n    {\n        using (var disposableRefStruct = new Struct()) // Noncompliant {{Remove the 'using' statement; it will cause automatic disposal of 'disposableRefStruct'.}}\n        {\n            return disposableRefStruct;\n        }\n    }\n\n    public Struct Bar()\n    {\n        using var disposableRefStruct = new Struct(); // Noncompliant\n\n        return disposableRefStruct;\n    }\n\n    public Struct FooBar()\n    {\n        using var notReturnedDisposableRefStruct = new Struct();\n        var notUsingRefStruct = new Struct();\n        return notUsingRefStruct;\n    }\n\n    public Struct BarFoo()\n    {\n        using var foo = new Struct(); // FN - we do not track alias variables\n        var bar = foo;\n        return bar;\n    }\n}\n\nclass ConditionalAssignment\n{\n    FileStream stream;\n\n    FileStream Method(ConditionalAssignment x)\n    {\n        using (x?.stream = File.Create(\"\"))\n        {\n            return x.stream;    // FN NET-2640\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DisposableReturnedFromUsing.TopLevelStatements.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Text;\n\nFileStream WriteToFile(string path, string text)\n{\n    using (var fs = File.Create(path)) // Noncompliant {{Remove the 'using' statement; it will cause automatic disposal of 'fs'.}}\n    {\n        var bytes = Encoding.UTF8.GetBytes(text);\n        fs.Write(bytes, 0, bytes.Length);\n        return fs;\n    }\n}\n\nFileStream WriteToFile4(string text)\n{\n    var f = new Func<FileStream>(static () =>\n    {\n        using var fs = File.Create(\"\"); // Noncompliant\n        return fs;\n    });\n    var fs = f();\n    var bytes = Encoding.UTF8.GetBytes(text);\n    fs.Write(bytes, 0, bytes.Length);\n    return fs;\n}\n\nFileStream Method(string x, object y)\n{\n    using var fs1 = File.Create(x);\n    var result = y switch\n    {\n        > 0 and < 10 => fs1,\n        not null => null\n    };\n    return result; // FN, we don't track aliasing\n}\n\nFileStream TargetTypedNew()\n{\n    using FileStream fs1 = new(@\"c:\\foo.txt\", FileMode.Open); // Noncompliant\n    return fs1;\n}\n\nFileStream TargetTypedNew2()\n{\n    using (FileStream fs1 = new(@\"c:\\foo.txt\", FileMode.Open)) // Noncompliant\n    {\n        return fs1;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DisposableReturnedFromUsing.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Text;\n\nnamespace Tests.Diagnostics\n{\n    public class DisposableReturnedFromUsing\n    {\n        FileStream stream;\n\n        public FileStream WriteToFile(string path, string text)\n        {\n            using (var fs = File.Create(path)) // Noncompliant {{Remove the 'using' statement; it will cause automatic disposal of 'fs'.}}\n//          ^^^^^\n            {\n                var bytes = Encoding.UTF8.GetBytes(text);\n                fs.Write(bytes, 0, bytes.Length);\n                return fs;\n            }\n        }\n\n        private FileStream fs;\n        public FileStream WriteToFile2(string path, string text)\n        {\n            using (fs = File.Create(path)) // Noncompliant\n            {\n                var bytes = Encoding.UTF8.GetBytes(text);\n                fs.Write(bytes, 0, bytes.Length);\n                return fs;\n            }\n        }\n\n        public FileStream WriteToFile3(string path, string text)\n        {\n            var fs = File.Create(path);\n            var bytes = Encoding.UTF8.GetBytes(text);\n            fs.Write(bytes, 0, bytes.Length);\n            return fs;\n        }\n\n        public void WriteToFile4(string path, string text)\n        {\n            using (fs = File.Create(path))\n            {\n                var f = new Func<FileStream>(() =>\n                {\n                    return fs;\n                });\n                f();\n\n                var bytes = Encoding.UTF8.GetBytes(text);\n                fs.Write(bytes, 0, bytes.Length);\n            }\n        }\n\n        FileStream Method(DisposableReturnedFromUsing x)\n        {\n            using (x.stream = File.Create(\"\"))\n            {\n                return x.stream;    // FN NET-2640\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DisposableTypesNeedFinalizers.CSharp11.cs",
    "content": "﻿using System;\nusing System.Runtime.InteropServices;\n\npublic record Foo : IDisposable // Noncompliant {{Implement a finalizer that calls your 'Dispose' method.}}\n{\n    private nint myResource;\n    private bool disposed = false;\n\n    protected virtual void Dispose(bool disposing) { }\n\n    public void Dispose()\n    {\n        Dispose(true);\n    }\n}\n\npublic record Bar : IDisposable // Compliant\n{\n    private nint myResource;\n    private bool disposed = false;\n\n    protected virtual void Dispose(bool disposing) { }\n\n    public void Dispose()\n    {\n        Dispose(true);\n    }\n\n    ~Bar()\n    {\n        Dispose(false);\n    }\n}\n\npublic record RecordWithParamsNoFinalizer(string X) : IDisposable // Noncompliant {{Implement a finalizer that calls your 'Dispose' method.}}\n{\n    private nint myResource;\n    private bool disposed = false;\n\n    protected virtual void Dispose(bool disposing) { }\n\n    public void Dispose()\n    {\n        Dispose(true);\n    }\n}\n\npublic record RecordWithParamsWithFinalizer(string X) : IDisposable // Compliant\n{\n    protected virtual void Dispose(bool disposing) { }\n\n    public void Dispose()\n    {\n        Dispose(true);\n    }\n\n    ~RecordWithParamsWithFinalizer()\n    {\n        Dispose(false);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DisposableTypesNeedFinalizers.CSharp9.cs",
    "content": "﻿using System;\nusing System.Runtime.InteropServices;\n\npublic record Foo : IDisposable // Noncompliant {{Implement a finalizer that calls your 'Dispose' method.}}\n{\n    private IntPtr myResource;\n    private bool disposed = false;\n\n    protected virtual void Dispose(bool disposing) { }\n\n    public void Dispose()\n    {\n        Dispose(true);\n    }\n}\n\npublic record Bar : IDisposable // Compliant\n{\n    private IntPtr myResource;\n    private bool disposed = false;\n\n    protected virtual void Dispose(bool disposing) { }\n\n    public void Dispose()\n    {\n        Dispose(true);\n    }\n\n    ~Bar()\n    {\n        Dispose(false);\n    }\n}\n\npublic record RecordWithParamsNoFinalizer(string X) : IDisposable // Noncompliant {{Implement a finalizer that calls your 'Dispose' method.}}\n{\n    private IntPtr myResource;\n    private bool disposed = false;\n\n    protected virtual void Dispose(bool disposing) { }\n\n    public void Dispose()\n    {\n        Dispose(true);\n    }\n}\n\npublic record RecordWithParamsWithFinalizer(string X) : IDisposable // Compliant\n{\n    protected virtual void Dispose(bool disposing) { }\n\n    public void Dispose()\n    {\n        Dispose(true);\n    }\n\n    ~RecordWithParamsWithFinalizer()\n    {\n        Dispose(false);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DisposableTypesNeedFinalizers.cs",
    "content": "﻿using System;\nusing System.Runtime.InteropServices;\n\nnamespace MyLibrary\n{\n    namespace RspecExample\n    {\n        public class Foo : IDisposable // Noncompliant {{Implement a finalizer that calls your 'Dispose' method.}}\n//                   ^^^\n        {\n            private IntPtr myResource;\n            private bool disposed = false;\n\n            protected virtual void Dispose(bool disposing)\n            {\n                if (!disposed)\n                {\n                    // Dispose of resources held by this instance.\n                    FreeResource(myResource); // Error [CS0103] - method doesn't exist\n                    disposed = true;\n\n                    // Suppress finalization of this disposed instance.\n                    if (disposing)\n                    {\n                        GC.SuppressFinalize(this);\n                    }\n                }\n            }\n\n            public void Dispose()\n            {\n                Dispose(true);\n            }\n        }\n        public class Foo_Compliant : IDisposable // Error [CS0535]\n        {\n            private IntPtr myResource;\n            private bool disposed = false;\n\n            protected virtual void Dispose(bool disposing) { }\n\n            ~Foo_Compliant()\n            {\n                Dispose(false);\n            }\n        }\n    }\n\n    // Error@+1 [CS0535]\n    public class Foo_01 : IDisposable // Noncompliant\n    {\n        private UIntPtr myResource;\n    }\n\n    // Error@+1 [CS0535]\n    public class Foo_02 : IDisposable // Noncompliant\n    {\n        private UIntPtr myResource;\n    }\n\n    // Error@+1 [CS0535]\n    public class Foo_03 : IDisposable // Noncompliant\n    {\n        private HandleRef myResource;\n    }\n\n    public class Foo_04 : IDisposable // Noncompliant\n    {\n        private HandleRef myResource;\n\n        public void Dispose() {}\n    }\n\n    public class Foo_06 : IDisposable // Error [CS0535]\n    {\n        private object myResource;\n    }\n\n    public class Foo_07\n    {\n        private HandleRef myResource;\n\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DisposeFromDispose.CSharp10.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\n\nFileStream fs; // top level statement\n\nvoid CleanUp()\n{\n    fs.Dispose();\n}\n\nrecord struct R1 : IDisposable\n{\n    private FileStream fs;\n\n    public void OpenResource(string path) => this.fs = new FileStream(path, FileMode.Open);\n    public void CloseResource() => this.fs.Close();\n    public void CleanUp() => this.fs.Dispose(); // Noncompliant {{Move this 'Dispose' call into this class' own 'Dispose' method.}}\n    public void Dispose() { }\n}\n\nrecord struct R2 : IDisposable\n{\n    private FileStream Fs { get; set; }\n\n    public void OpenResource(string path) => this.Fs = new FileStream(path, FileMode.Open);\n    public void CloseResource() => this.Fs.Close();\n    public void CleanUp() => this.Fs.Dispose(); // FN. Properties are not considered.\n    public void Dispose() { }\n}\n\npublic record struct PositionalRecordStruct(FileStream fs) : IDisposable\n{\n    public void CloseResource() => this.fs.Close();\n    public void CleanUp() => this.fs.Dispose(); // Compliant. FileStream fs is a public property\n    public void Dispose() { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DisposeFromDispose.CSharp7_2.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq.Expressions;\n\nnamespace Tests.Diagnostics\n{\n    public readonly ref struct ReadonlyDisposableRefStruct\n    {\n        private readonly FileStream fs;\n\n        public ReadonlyDisposableRefStruct(string path)\n        {\n            this.fs = new FileStream(path, FileMode.Open);\n        }\n\n        public void CloseResource()\n        {\n            this.fs.Close();\n        }\n\n        public void CleanUp()\n        {\n            this.fs.Dispose(); // Compliant - disposable ref structs came with C# 8\n        }\n\n        public void Dispose()\n        {\n        }\n    }\n\n    public ref struct DisposableRefStruct\n    {\n        private FileStream fs;\n\n        public void OpenResource(string path)\n        {\n            this.fs = new FileStream(path, FileMode.Open);\n        }\n\n        public void CloseResource()\n        {\n            this.fs.Close();\n        }\n\n        public void CleanUp()\n        {\n            this.fs.Dispose(); // Compliant - disposable ref structs came with C# 8\n        }\n\n        public void Dispose()\n        {\n        }\n    }\n\n    public class OuterClass : IDisposable\n    {\n        private Stream stream;\n\n        class InnerClass : IDisposable\n        {\n            public void M(OuterClass outter)\n            {\n                outter.stream.Dispose(); // Compliant\n            }\n\n            public void Dispose() { }\n        }\n\n        public void Dispose() { }\n    }\n\n    public class BaseClass : IDisposable\n    {\n        protected Stream stream;\n\n        public void Dispose() { }\n\n    }\n\n    public class Derived : BaseClass, IDisposable\n    {\n        public void Cleanup() => stream.Dispose(); // Compliant\n    }\n\n    public class Conditional: IDisposable\n    {\n        private Stream fs;\n\n        private void MemberBinding()\n        {\n            fs?.Dispose();                             // Noncompliant {{Move this 'Dispose' call into this class' own 'Dispose' method.}}\n        }\n\n        private void ThisMemberBinding()\n        {\n            this.fs?.Dispose();                        // Noncompliant\n        }\n\n        private void ThisAndMemberBinding()\n        {\n            this?.fs?.Dispose();                       // Noncompliant\n        }\n\n        private void Ternary()\n        {\n            (fs == null ? null : fs)?.Dispose();       // Compliant\n        }\n\n        private void InvocationWithoutName()\n        {\n            Func<Action> f = () => () => fs.Dispose(); // Noncompliant\n            f()();                                     // Compliant\n        }\n\n        public void Dispose() { }\n    }\n\n    public class DisposedInDispose: IDisposable\n    {\n        Stream fs;\n\n        public void Cleanup() => fs.Dispose(); // Compliant. fs is also disposed in Dispose\n        public void Dispose() => fs.Dispose();\n    }\n\n    public class DisposedInImplicitDispose : IDisposable\n    {\n        Stream fs;\n\n        public void Cleanup() => fs.Dispose();\n        void IDisposable.Dispose() => fs.Dispose();\n    }\n\n    public class OtherDisposedInDispose : IDisposable\n    {\n        Stream fs1;\n        Stream fs2;\n\n        public void Cleanup() => fs1.Dispose(); // Noncompliant\n        public void Dispose() => fs2.Dispose();\n    }\n\n    public class NotIDisposeDisposeInDispose : IDisposable\n    {\n        NotIDisposeDisposeInDispose d;\n        public void Dispose(bool someParam) { }   // other overload\n        public void Cleanup() => d.Dispose();     // Noncompliant\n        public void Dispose() => d.Dispose(true);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DisposeFromDispose.CSharp8.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\n\nnamespace Tests.Diagnostics\n{\n    public class ResourceHolder : IDisposable\n    {\n        private FileStream fs;\n        public void OpenResource(string path)\n        {\n            this.fs = new FileStream(path, FileMode.Open);\n        }\n        public void CloseResource()\n        {\n            this.fs.Close();\n        }\n\n        public void CleanUp()\n        {\n            this.fs.Dispose(); // Noncompliant {{Move this 'Dispose' call into this class' own 'Dispose' method.}}\n//                  ^^^^^^^\n        }\n\n        public void Dispose()\n        {\n            // method added to satisfy demands of interface\n        }\n    }\n    public class NonDisposable\n    {\n        private FileStream fs;\n        public void OpenResource(string path)\n        {\n            this.fs = new FileStream(path, FileMode.Open);\n        }\n\n        public void CleanUp()\n        {\n            this.fs.Dispose(); // Compliant; class is not IDisposable\n        }\n    }\n\n    public class ResourceHolder2 : IDisposable\n    {\n        private FileStream fs;\n        public void OpenResource(string path)\n        {\n            this.fs = new FileStream(path, FileMode.Open);\n        }\n        public void CloseResource()\n        {\n            var stream = new MemoryStream();\n            stream.Dispose();\n\n            this.fs.Close();\n        }\n        public void CloseResource2()\n        {\n            var stream = new MemoryStream();\n            stream.Dispose();\n\n            this.fs.Close();\n        }\n\n        public void Dispose()\n        {\n            var a = new Action(() =>\n            {\n                this.fs.Dispose(); //Noncompliant\n            });\n        }\n    }\n    public class Class : IDisposable\n    {\n        FileStream fs;\n\n        public Class()\n        {\n            fs = new FileStream(\"\", FileMode.Append);\n        }\n\n        void IDisposable.Dispose()\n        {\n            fs.Dispose(); // Compliant, do not report here\n        }\n    }\n\n    public ref struct DisposableRefStruct\n    {\n        private FileStream fs;\n\n        public void OpenResource(string path)\n        {\n            this.fs = new FileStream(path, FileMode.Open);\n        }\n\n        public void CloseResource()\n        {\n            this.fs.Close();\n        }\n\n        public void CleanUp()\n        {\n            this.fs.Dispose(); // Noncompliant\n        }\n\n        public void Dispose()\n        {\n        }\n    }\n\n    public readonly ref struct ReadonlyDisposableRefStruct\n    {\n        private readonly FileStream fs;\n\n        public ReadonlyDisposableRefStruct(string path)\n        {\n            this.fs = new FileStream(path, FileMode.Open);\n        }\n\n        public void CloseResource()\n        {\n            this.fs.Close();\n        }\n\n        public void CleanUp()\n        {\n            this.fs.Dispose(); // Noncompliant\n        }\n\n        public void Dispose()\n        {\n        }\n    }\n\n    public ref struct FakeDisposableRefStruct\n    {\n        private FileStream fs;\n\n        public void OpenResource(string path)\n        {\n            this.fs = new FileStream(path, FileMode.Open);\n        }\n\n        public void CloseResource()\n        {\n            this.fs.Close();\n        }\n\n        public void CleanUp()\n        {\n            this.fs.Dispose(); // Compliant - the Dispose method is not accessible\n        }\n\n        private void Dispose()\n        {\n        }\n    }\n\n    public struct DisposableStruct : IDisposable\n    {\n        private FileStream fs;\n        public void OpenResource(string path)\n        {\n            this.fs = new FileStream(path, FileMode.Open);\n        }\n        public void CloseResource()\n        {\n            this.fs.Close();\n        }\n\n        public void CleanUp()\n        {\n            this.fs.Dispose(); // Noncompliant\n        }\n\n        public void Dispose()\n        {\n            // method added to satisfy demands of interface\n        }\n    }\n\n    public struct DisposableStructCorrect : IDisposable\n    {\n        private FileStream fs;\n        public void OpenResource(string path)\n        {\n            this.fs = new FileStream(path, FileMode.Open);\n        }\n        public void CloseResource()\n        {\n            this.fs.Close();\n        }\n\n        public void Dispose()\n        {\n            this.fs.Dispose(); // compliant\n        }\n    }\n\n    public ref struct MyTestDisposableRefStruct\n    {\n        public void Dispose()\n        {\n        }\n    }\n\n    public ref struct RefStructResourceHolder\n    {\n        // ref structs can only be fields in other ref structs\n\n        private MyTestDisposableRefStruct foo;\n\n        public void OpenResource(string path)\n        {\n            this.foo = new MyTestDisposableRefStruct();\n        }\n\n        public void CleanUp()\n        {\n            this.foo.Dispose(); // Noncompliant\n        }\n\n        public void Dispose()\n        {\n            // this method makes this struct a disposable ref struct in C# 8\n        }\n    }\n\n    public ref struct NotDisposableRefStruct\n    {\n        public void Dispose(bool shouldDispose)\n        {\n        }\n        public string Dispose()\n        {\n            return \"\";\n        }\n    }\n\n    public ref struct NotDisposableRefStructHolder1\n    {\n        private NotDisposableRefStruct foo;\n\n        public void OpenResource(string path)\n        {\n            this.foo = new NotDisposableRefStruct();\n        }\n\n        public void CleanUp()\n        {\n            this.foo.Dispose(true); // Ok\n        }\n        public void Dispose()\n        {\n        }\n    }\n\n    public ref struct NotDisposableRefStructHolder2\n    {\n        private NotDisposableRefStruct foo;\n\n        public void OpenResource(string path)\n        {\n            this.foo = new NotDisposableRefStruct();\n        }\n\n        public void CleanUp()\n        {\n            var x = foo.Dispose(); // Ok\n        }\n        public void Dispose()\n        {\n        }\n    }\n\n\n\n    public ref struct AnotherDisposableRefStruct\n    {\n        public void Dispose() { }\n        public void Dispose(bool x) { }\n        public void Dispose<T>() { }\n        public void AnotherMethod() { }\n    }\n\n    public ref struct AnotherDisposableRefStructHolder1\n    {\n        private AnotherDisposableRefStruct foo;\n\n        public void Cleanup()\n        {\n            this.foo.Dispose(); // Noncompliant\n        }\n\n        public void Dispose()\n        {\n            foo.Dispose(true);\n        }\n    }\n\n    public ref struct AnotherDisposableRefStructHolder2\n    {\n        private AnotherDisposableRefStruct foo;\n\n        public void Cleanup()\n        {\n            this.foo.AnotherMethod(); // ok\n        }\n\n        public void Dispose()\n        {\n        }\n    }\n\n    public ref struct AnotherDisposableRefStructHolder3\n    {\n        private AnotherDisposableRefStruct foo;\n\n        public void Cleanup()\n        {\n            this.foo.Dispose(true); // ok\n        }\n\n        public void Dispose()\n        {\n        }\n    }\n\n    public ref struct AnotherDisposableRefStructHolder4\n    {\n        private AnotherDisposableRefStruct foo;\n\n        public void Cleanup()\n        {\n            this.foo.Dispose<string>(); // ok\n        }\n\n        public void Dispose()\n        {\n        }\n    }\n\n    public class NullSupression: IDisposable\n    {\n        private Stream fs;\n\n        private void NullSupressionOperator()\n        {\n            fs!.Dispose();  // Noncompliant {{Move this 'Dispose' call into this class' own 'Dispose' method.}}\n        }\n\n        private void NullSupressionAndNullCoalescing()\n        {\n            fs!?.Dispose(); // Noncompliant\n        }\n\n        private void ThisNullSupressionAndNullCoalescing()\n        {\n            this!.fs?.Dispose(); // Noncompliant\n        }\n\n        public void Dispose() { }\n\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DisposeFromDispose.CSharp9.Part1.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\n\nFileStream fs; // top level statement\n\nvoid CleanUp()\n{\n    fs.Dispose();\n}\n\nrecord R1 : IDisposable\n{\n    private FileStream fs;\n\n    public void OpenResource(string path) => this.fs = new FileStream(path, FileMode.Open);\n    public void CloseResource() => this.fs.Close();\n    public void CleanUp() => this.fs.Dispose(); // Noncompliant {{Move this 'Dispose' call into this class' own 'Dispose' method.}}\n\n    public void Dispose() { }\n}\n\nrecord R2 : IDisposable\n{\n    private FileStream fs;\n\n    public void OpenResource(string path) => this.fs = new FileStream(path, FileMode.Open);\n    public void Dispose() => this.fs.Dispose(); // Compliant\n}\n\npublic ref partial struct DisposableRefStruct1\n{\n    private FileStream fs;\n    public void OpenResource(string path) => this.fs = new FileStream(path, FileMode.Open);\n    public void CleanUp() => this.fs.Dispose(); // Noncompliant\n\n    public partial void Dispose();\n}\n\npublic ref partial struct DisposableRefStruct1\n{\n    public partial void Dispose() { }\n}\n\npublic ref partial struct DisposableRefStruct2\n{\n    private FileStream fs;\n    public void OpenResource(string path) => this.fs = new FileStream(path, FileMode.Open);\n    public void CleanUp() => this.fs.Dispose(); // Noncompliant\n    public partial void Dispose();\n}\n\npublic ref partial struct DisposableRefStruct2\n{\n    public partial void Dispose() => this.fs.Dispose(); // Compliant\n}\n\npublic partial class ResourceHolder : IDisposable\n{\n    public partial void CleanUp() =>\n        this.fs.Dispose(); // Compliant. See also test case DisposedInDispose in CSharp7_2\n\n    public partial void Dispose() =>\n        this.fs.Dispose();\n}\n\npublic partial class ResourceHolder2 : IDisposable\n{\n    public void CleanUp() =>\n        this.fs.Dispose(); // Compliant. See also test case DisposedInDispose in CSharp7_2\n}\n\npublic partial class ResourceHolder3 : IDisposable\n{\n    public partial void CleanUp() =>\n        this.fs.Dispose(); // Compliant. See also test case DisposedInDispose in CSharp7_2\n\n    public partial void Dispose();\n}\n\npublic partial class ResourceHolder4 : IDisposable\n{\n    public void CleanUp() =>\n        this.fs.Dispose(); // Noncompliant. \"Dispose\" implementation does not dispose fs.\n\n    public partial void Dispose();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DisposeFromDispose.CSharp9.Part2.cs",
    "content": "﻿using System;\nusing System.IO;\n\npublic partial class ResourceHolder : IDisposable\n{\n    private FileStream fs;\n\n    public partial void CleanUp();\n\n    public partial void Dispose();\n}\n\npublic partial class ResourceHolder2 : IDisposable\n{\n    private FileStream fs;\n\n    public void Dispose() =>\n        this.fs.Dispose();\n}\n\npublic partial class ResourceHolder3 : IDisposable\n{\n    private FileStream fs;\n\n    public partial void CleanUp();\n\n    public partial void Dispose() =>\n        this.fs.Dispose();\n}\n\npublic partial class ResourceHolder4 : IDisposable\n{\n    private FileStream fs;\n\n    public partial void Dispose() { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DisposeNotImplementingDispose.Latest.Partial.cs",
    "content": "﻿public partial record MyPartial3\n{\n    public partial void Dispose() { }  // Secondary [another-file]\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DisposeNotImplementingDispose.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\n\npublic ref struct RefStruct\n{\n    public void Dispose() // ok\n    {\n    }\n}\n\npublic record R\n{\n    void Dispose() { } //Noncompliant {{Either implement 'IDisposable.Dispose', or totally rename this method to prevent confusion.}}\n}\n\npublic record GarbageDisposalExceptionBase : IDisposable\n{\n    protected virtual void Dispose(bool disposing)\n    {\n        //...\n    }\n    public void Dispose()\n    {\n        Dispose(true);\n        GC.SuppressFinalize(this);\n    }\n}\n\npublic partial record MyPartial\n{\n    public partial void Dispose();   // Noncompliant\n}\n\npublic partial record MyPartial\n{\n    public partial void Dispose() { } // Secondary\n}\n\npublic partial record MyPartial2 : IDisposable\n{\n    public partial void Dispose();\n}\n\npublic partial record MyPartial2 : IDisposable\n{\n    public partial void Dispose() { }\n}\n\npublic partial record MyPartial3\n{\n    public partial void Dispose();   // Noncompliant [another-file]\n}\n\npublic ref partial struct PartialRefStruct\n{\n    public partial void Dispose(); // ok\n}\n\npublic ref partial struct PartialRefStruct\n{\n    public partial void Dispose() { } // ok\n}\n\npublic record struct Struct\n{\n    public void Dispose() // Noncompliant {{Either implement 'IDisposable.Dispose', or totally rename this method to prevent confusion.}}\n    {\n    }\n}\n\npublic struct DisposableStruct : IDisposable\n{\n    public DisposableStruct() { }\n    public void Dispose() { }\n}\n\npublic record struct PositionalRecordStruct(string Value)\n{\n    public void Dispose() // Noncompliant {{Either implement 'IDisposable.Dispose', or totally rename this method to prevent confusion.}}\n    {\n    }\n}\n\npublic record struct DisposablePositionalRecordStruct(string Value) : IDisposable\n{\n    public void Dispose() { }\n}\n\npublic interface IStaticAbstractMethod\n{\n    static abstract void Dispose(); // Noncompliant {{Either implement 'IDisposable.Dispose', or totally rename this method to prevent confusion.}}\n}\n\npublic interface IStaticVirtualMethod\n{\n    static virtual void Dispose() { } // Noncompliant {{Either implement 'IDisposable.Dispose', or totally rename this method to prevent confusion.}}\n}\n\nclass Sample { }\n\nstatic class Extensions\n{\n    extension(Sample s)\n    {\n        void Dispose() { }  // Compliant FP NET-2712\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DisposeNotImplementingDispose.TopLevelStatements.cs",
    "content": "﻿using System;\n\nvoid Dispose() { } // top level local function, compliant\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DisposeNotImplementingDispose.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\n\nnamespace Tests.Diagnostics\n{\n    public interface IMine\n    {\n        void Dispose(); //Noncompliant {{Either implement 'IDisposable.Dispose', or totally rename this method to prevent confusion.}}\n//           ^^^^^^^\n    }\n\n    public interface IMine2 : IDisposable\n    {\n        void Dispose(); //Noncompliant {{Either implement 'IDisposable.Dispose', or totally rename this method to prevent confusion.}}\n    }\n\n    public class Mine0 : IDisposable\n    {\n        public void Dispose() { }\n    }\n\n    public class Mine1 : IMine\n    {\n        public void Dispose() { }\n    }\n    public class Mine2 : IMine2\n    {\n        public void Dispose() { }\n    }\n\n    public class Mine3 : ISomeUnknown // Error [CS0246] - unknown type\n    {\n        public void Dispose() { }\n    }\n\n    public class Mine4 : ISomeUnknown, ISomeUnknown2 // Error [CS0246,CS0246] - unknown type\n    {\n        public void Dispose() { }\n    }\n\n    public class GarbageDisposal\n    {\n        private int Dispose()  // Noncompliant\n        {\n            // ...\n            return 42;\n        }\n\n        private void Dummy()\n        {\n\n        }\n    }\n    public class GarbageDisposalExceptionBase : IDisposable\n    {\n        protected virtual void Dispose(bool disposing)\n        {\n            //...\n        }\n        public void Dispose()\n        {\n            Dispose(true);\n            GC.SuppressFinalize(this);\n        }\n    }\n\n    public class GarbageDisposalException : GarbageDisposalExceptionBase\n    {\n        protected override void Dispose(bool disposing)\n        {\n            //...\n        }\n    }\n\n    public class NoRealDisposalDone : IDisposable\n    {\n        private void Dummy() { }\n\n        public void Dispose()\n        {\n            Dummy();\n            NotExists();  // Error [CS0103]\n        }\n    }\n\n    public class GarbageDisposalException2 : SomeUnknownType // Error [CS0246] - unknown type\n    {\n        protected override void Dispose(bool disposing)\n        {\n            //...\n        }\n    }\n\n    public class MyStream : Stream\n    {\n        public override bool CanRead { get; }\n        public override bool CanSeek { get; }\n        public override bool CanWrite { get; }\n        public override long Length { get; }\n        public override long Position { get; set; }\n\n        public override void Flush()\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public override int Read(byte[] buffer, int offset, int count)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public override long Seek(long offset, SeekOrigin origin)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public override void SetLength(long value)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public override void Write(byte[] buffer, int offset, int count)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        protected override void Dispose(bool disposing)\n        {\n\n        }\n    }\n\n    public partial class MyPartial\n    {\n    }\n\n    public partial class MyPartial\n    {\n        void Dispose() { }  // Noncompliant\n    }\n\n    public struct Struct\n    {\n        public void Dispose() // Noncompliant {{Either implement 'IDisposable.Dispose', or totally rename this method to prevent confusion.}}\n        {\n        }\n    }\n\n    public struct DisposableStruct : IDisposable\n    {\n        public void Dispose()\n        {\n        }\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/9679\nnamespace Repro_9679\n{\n    public static class DisposableExtensions\n    {\n        public static void Dispose<T>(this Lazy<T> lazy) // Compliant\n            where T : class, IDisposable\n        {\n            if (lazy.IsValueCreated)\n            {\n                lazy.Value.Dispose();\n            }\n        }\n    }\n}\n\n// https://sonarsource.atlassian.net/browse/NET-2257\nnamespace Repro_NET_2257\n{\n    public class Parent : IDisposable\n    {\n        public virtual void Dispose()\n        {\n            // Do nothing\n        }\n    }\n\n    public class Child : Parent\n    {\n        public override void Dispose()\n        {\n            Dispose(true);\n            GC.SuppressFinalize(this);\n        }\n\n        protected virtual void Dispose(bool flag)  // Noncompliant FP, if the user has no access to the parent class, they have no choice but to implement this method in their own class\n        {\n            // Do nothing\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotCallAssemblyGetExecutingAssembly.CSharp9.cs",
    "content": "﻿using System.Reflection;\n\nAssembly assem = Assembly.GetExecutingAssembly(); // Noncompliant - If there are other types defined in the program, calling\n                                                  // 'typeof(CustomClass).Assembly' will achieve the same result.\n\nassem = typeof(Assembly).Assembly; // Compliant\n\nrecord R\n{\n    public void Foo()\n    {\n        Assembly assem = Assembly.GetExecutingAssembly(); // Noncompliant\n        assem = typeof(R).Assembly; // Compliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotCallAssemblyGetExecutingAssembly.cs",
    "content": "﻿using System;\nusing System.Reflection;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        public static void Main()\n        {\n            Assembly assem = Assembly.GetExecutingAssembly(); // Noncompliant\n            Console.WriteLine(\"Assembly name: {0}\", assem.FullName);\n\n            assem = typeof(Program).Assembly; // Compliant\n            Console.WriteLine(\"Assembly name: {0}\", assem.FullName);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotCallAssemblyLoadInvalidMethods.CSharp9.cs",
    "content": "﻿using System.Configuration.Assemblies;\nusing System.Reflection;\nusing System.Security.Policy;\nusing static System.Reflection.Assembly;\n\nAssembly.LoadFrom(\"a.dll\"); // Noncompliant {{Replace this call to 'Assembly.LoadFrom' with 'Assembly.Load'.}}\nAssembly.LoadFrom(\"a.dll\", new byte[] { }, AssemblyHashAlgorithm.MD5); // Noncompliant\nLoadFrom(\"a.dll\"); // Noncompliant\nAssembly.LoadFile(@\"c:\\foo\\a.dll\"); // Noncompliant {{Replace this call to 'Assembly.LoadFile' with 'Assembly.Load'.}}\nLoadFile(\"a.dll\"); // Noncompliant\nAssembly.LoadWithPartialName(\"a.dll\"); // Noncompliant {{Replace this call to 'Assembly.LoadWithPartialName' with 'Assembly.Load'.}}\nLoadWithPartialName(\"a.dll\"); // Noncompliant\n\nAssembly.Load(\"a.dll\"); // Compliant\n\nrecord R\n{\n    public void Foo()\n    {\n        Assembly.LoadFrom(\"a.dll\"); // Noncompliant {{Replace this call to 'Assembly.LoadFrom' with 'Assembly.Load'.}}\n        Assembly.Load(\"a.dll\"); // Compliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotCallAssemblyLoadInvalidMethods.Evidence.cs",
    "content": "﻿namespace Tests.Diagnostics\n{\n    using System.Configuration.Assemblies;\n    using System.Reflection;\n    using System.Security.Policy;\n    using static System.Reflection.Assembly;\n\n    public class Program\n    {\n        void Load()\n        {\n            Assembly.LoadFrom(\"a.dll\", new Evidence()); // Noncompliant {{Replace this call to 'Assembly.LoadFrom' with 'Assembly.Load'.}}\n//                   ^^^^^^^^\n            Assembly.LoadFrom(\"a.dll\", new Evidence(), new byte[] { }, AssemblyHashAlgorithm.MD5); // Noncompliant\n            Assembly.LoadFile(@\"c:\\foo\\a.dll\", new Evidence()); // Noncompliant\n            Assembly.LoadWithPartialName(\"a.dll\", new Evidence()); // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotCallAssemblyLoadInvalidMethods.cs",
    "content": "﻿namespace Tests.Diagnostics\n{\n    using System.Configuration.Assemblies;\n    using System.Reflection;\n    using System.Security.Policy;\n    using static System.Reflection.Assembly;\n\n    public class Program\n    {\n        void AssemblyLoadFrom()\n        {\n            Assembly.LoadFrom(\"a.dll\"); // Noncompliant {{Replace this call to 'Assembly.LoadFrom' with 'Assembly.Load'.}}\n//                   ^^^^^^^^\n            Assembly.LoadFrom(\"a.dll\", new byte[] { }, AssemblyHashAlgorithm.MD5); // Noncompliant\n            LoadFrom(\"a.dll\"); // Noncompliant\n        }\n\n        void AssemblyLoadFile()\n        {\n            Assembly.LoadFile(@\"c:\\foo\\a.dll\"); // Noncompliant {{Replace this call to 'Assembly.LoadFile' with 'Assembly.Load'.}}\n//                   ^^^^^^^^\n            LoadFile(\"a.dll\"); // Noncompliant\n        }\n\n        void AssemblyLoadWithPartialName()\n        {\n            Assembly.LoadWithPartialName(\"a.dll\"); // Noncompliant {{Replace this call to 'Assembly.LoadWithPartialName' with 'Assembly.Load'.}}\n//                   ^^^^^^^^^^^^^^^^^^^\n            LoadWithPartialName(\"a.dll\"); // Noncompliant\n        }\n    }\n}\n\nnamespace Repro\n{\n    using System;\n    using System.Reflection;\n\n    // https://sonarsource.atlassian.net/browse/NET-2099\n    public class NET2099\n    {\n        private static Assembly OnAssemblyResolve(object sender, ResolveEventArgs args)\n        {\n            return Assembly.LoadFrom(\"NonexistentDLL\");\n        }\n\n        private static Assembly OnTypeResolve(object sender, ResolveEventArgs args)\n        {\n            return Assembly.LoadFrom(\"NonexistentDLL\"); // FN\n        }\n\n        private static Assembly OnResourceResolve(object sender, ResolveEventArgs args)\n        {\n            return Assembly.LoadFrom(\"NonexistentDLL\"); // FN\n        }\n\n        private static Assembly OnReflectionOnlyAssemblyResolve(object sender, ResolveEventArgs args)\n        {\n            return Assembly.LoadFrom(\"NonexistentDLL\"); // FN\n        }\n\n        static void Main()\n        {\n            AppDomain.CurrentDomain.AssemblyResolve += OnAssemblyResolve;\n            AppDomain.CurrentDomain.AssemblyResolve += LocalOnAssemblyResolve;\n            AppDomain.CurrentDomain.AssemblyResolve += delegate(object sender, ResolveEventArgs args)\n            {\n                return Assembly.LoadFrom(\"NonexistentDLL\");\n            };\n            AppDomain.CurrentDomain.AssemblyResolve += (sender, args) =>\n            {\n                return Assembly.LoadFrom(\"NonexistentDLL\");\n            };\n\n            AppDomain.CurrentDomain.TypeResolve += OnTypeResolve;\n            AppDomain.CurrentDomain.ResourceResolve += OnResourceResolve;\n            AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve += OnReflectionOnlyAssemblyResolve;\n\n            Assembly LocalOnAssemblyResolve(object sender, ResolveEventArgs args)\n            {\n                return Assembly.LoadFrom(\"NonexistentDLL\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotCallExitMethods.CSharp9.cs",
    "content": "﻿using System;\n\nEnvironment.Exit(0); // Compliant\n\nAction asd = () => Environment.Exit(0); // Noncompliant\n\nvoid LocalFunction()\n{\n    Environment.Exit(0); // Noncompliant\n}\n\nrecord R\n{\n    public void Foo() => Environment.Exit(0); // Noncompliant\n\n    public string Prop\n    {\n        init => Environment.Exit(0); // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotCallExitMethods.cs",
    "content": "﻿using System;\nusing System.Threading.Tasks;\nusing System.Windows.Forms;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        public void Foo()\n        {\n            Environment.Exit(0); // Noncompliant {{Remove this call to 'Environment.Exit' or ensure it is really required.}}\n//                      ^^^^\n            System.Windows.Forms.Application.Exit(); // Noncompliant {{Remove this call to 'Application.Exit' or ensure it is really required.}}\n//                                           ^^^^\n            Application.Exit();\n        }\n\n        public int FooProperty\n        {\n            get\n            {\n                Environment.Exit(0); // Noncompliant\n                return 0;\n            }\n            set\n            {\n                Environment.Exit(0); // Noncompliant\n            }\n        }\n\n        public static void Bar()\n        {\n            Baz();\n\n            int x = 1;\n\n            void Baz()\n            {\n                Environment.Exit(0); // Noncompliant\n            }\n        }\n    }\n\n    class MyProgram\n    {\n        public static void Main()\n        {\n            Environment.Exit(0); // Compliant - inside Main\n\n            Foo();\n\n            int x = 1;\n\n            void Foo()\n            {\n                Environment.Exit(0); // Compliant - inside Main\n            }\n        }\n    }\n\n    class MyProgram1\n    {\n        public static async Task<int> Main(string[] args)\n        {\n            Environment.Exit(0); // Compliant - inside Main\n\n            return 1;\n        }\n    }\n\n    class MyProgram2\n    {\n        public static int Main(string[] args)\n        {\n            Environment.Exit(0); // Compliant - inside Main\n\n            return 0;\n        }\n    }\n\n    static class Application\n    {\n        public static void Exit()\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotCallGCCollectMethod.Latest.cs",
    "content": "﻿using System;\nusing static System.GC;\nGC.Collect(); // Noncompliant {{Refactor the code to remove this use of 'GC.Collect'.}}\nGC.Collect(2, GCCollectionMode.Optimized); // Noncompliant\nCollect(); // Noncompliant\n\nrecord R\n{\n    void Foo() => GC.Collect(); // Noncompliant\n    string Prop\n    {\n        init => GC.Collect(); // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotCallGCCollectMethod.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    using static System.GC;\n\n    class Program\n    {\n        void Foo()\n        {\n            GC.Collect(); // Noncompliant {{Refactor the code to remove this use of 'GC.Collect'.}}\n//             ^^^^^^^\n            GC.Collect(2, GCCollectionMode.Optimized); // Noncompliant\n\n            Collect(); // Noncompliant\n\n            // Repro for: https://github.com/SonarSource/sonar-dotnet/issues/9687\n            GC.GetTotalMemory(true);  // Noncompliant {{Refactor the code to remove this use of 'GC.GetTotalMemory'.}}\n            GC.GetTotalMemory(false); // Compliant\n            GC.GetTotalMemory(forceFullCollection: true); // Noncompliant\n            GC.GetTotalMemory(forceFullCollection: false); // Compliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotCallGCCollectMethodAD0001.cs",
    "content": "﻿// We need to define a custom GC class in the System namespace to simulate the AD0001\nnamespace System;\n\npublic class GC\n{\n    long GetTotalMemory(); // Error [CS0501]\n\n    void Foo() =>\n        GetTotalMemory(); // Noncompliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotCallGCSuppressFinalize.Net5.cs",
    "content": "﻿using System;\nusing System.Threading.Tasks;\n\n// https://github.com/SonarSource/sonar-dotnet/issues/3639\nrecord R1 : IAsyncDisposable\n{\n    public void Method() => GC.SuppressFinalize(this); // Noncompliant\n\n    public async ValueTask DisposeAsync()\n    {\n        await DisposeAsyncCore();\n        GC.SuppressFinalize(this); // Compliant, see: https://docs.microsoft.com/en-us/dotnet/standard/garbage-collection/implementing-disposeasync#the-disposeasync-method\n    }\n\n    protected virtual ValueTask DisposeAsyncCore() => default;\n}\n\nrecord R2 : IDisposable\n{\n    public string Prop\n    {\n        init => GC.SuppressFinalize(this); // Noncompliant\n    }\n\n    public void Dispose()\n    {\n        GC.SuppressFinalize(this); // Compliant\n    }\n\n    public async ValueTask DisposeAsync()\n    {\n        await DisposeAsyncCore();\n        GC.SuppressFinalize(this); // Noncompliant - ok; it does not implement IAsyncDisposable\n    }\n\n    protected virtual ValueTask DisposeAsyncCore() => default;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotCallGCSuppressFinalize.NetCore.cs",
    "content": "﻿using System;\nusing System.Threading.Tasks;\n\nnamespace Tests.Diagnostics\n{\n    // https://github.com/SonarSource/sonar-dotnet/issues/3639\n    public class Implicit : IAsyncDisposable\n    {\n        public void Method()\n        {\n            GC.SuppressFinalize(this); // Noncompliant\n        }\n\n        public async ValueTask DisposeAsync()\n        {\n            await DisposeAsyncCore();\n\n            GC.SuppressFinalize(this); // Compliant, see: https://docs.microsoft.com/en-us/dotnet/standard/garbage-collection/implementing-disposeasync#the-disposeasync-method\n        }\n\n        protected virtual ValueTask DisposeAsyncCore() => default;\n    }\n\n    public class Explicit : IAsyncDisposable\n    {\n        public void Method()\n        {\n            GC.SuppressFinalize(this); // Noncompliant\n        }\n\n        async ValueTask IAsyncDisposable.DisposeAsync()\n        {\n            await DisposeAsyncCore();\n\n            GC.SuppressFinalize(this); // Compliant, see: https://docs.microsoft.com/en-us/dotnet/standard/garbage-collection/implementing-disposeasync#the-disposeasync-method\n        }\n\n        protected virtual ValueTask DisposeAsyncCore() => default;\n    }\n\n    public class FakeA\n    {\n        public async ValueTask DisposeAsync()\n        {\n            await DisposeAsyncCore();\n\n            GC.SuppressFinalize(this); // Noncompliant - ok; it does not implement IAsyncDisposable\n        }\n\n        public async ValueTask DisposeAsync(bool argument)\n        {\n            await DisposeAsyncCore();\n\n            GC.SuppressFinalize(this); // Noncompliant - ok; it does not implement IAsyncDisposable\n        }\n\n        protected virtual ValueTask DisposeAsyncCore() => default;\n    }\n\n    public class FakeB\n    {\n        public async void DisposeAsync()\n        {\n            await DisposeAsyncCore();\n\n            GC.SuppressFinalize(this); // Noncompliant - ok; it does not implement IAsyncDisposable\n        }\n\n        protected virtual ValueTask DisposeAsyncCore() => default;\n    }\n\n    public class FakeInterface : IFake\n    {\n        public async ValueTask DisposeAsync()\n        {\n            await DisposeAsyncCore();\n\n            GC.SuppressFinalize(this); // Noncompliant - ok; it does not implement IAsyncDisposable\n        }\n\n        protected virtual ValueTask DisposeAsyncCore() => default;\n    }\n\n    public interface IFake\n    {\n        ValueTask DisposeAsync();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotCallGCSuppressFinalize.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    class FooNotIDisposable\n    {\n        Action x = () => GC.SuppressFinalize(new object()); // Noncompliant\n\n        void Foo()\n        {\n            GC.SuppressFinalize(this); // Noncompliant {{Do not call 'GC.SuppressFinalize'.}}\n//             ^^^^^^^^^^^^^^^^\n        }\n    }\n\n    class FooDisposable : IDisposable\n    {\n        void Foo()\n        {\n            GC.SuppressFinalize(this); // Noncompliant\n        }\n\n        public void Dispose()\n        {\n            Dispose(true);\n            GC.SuppressFinalize(this); // Compliant\n        }\n\n        protected virtual void Dispose(bool disposing)\n        {\n            GC.SuppressFinalize(this); // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotCatchNullReferenceException.CSharp9.cs",
    "content": "﻿using System;\n\ntry\n{\n    return args[0].Length;\n}\ncatch (NullReferenceException nre) // Noncompliant {{Do not catch NullReferenceException; test for null instead.}}\n{\n    throw;\n}\n\ntry\n{\n    return args[0].Length;\n}\ncatch (Exception e) when (((e is NullReferenceException))) // Noncompliant\n{\n    throw;\n}\n\ntry\n{\n    return args[0].Length;\n}\ncatch (Exception e) when (((e is not NullReferenceException))) // Compliant\n{\n    throw;\n}\n\nrecord R\n{\n    int i;\n    public string P\n    {\n        init\n        {\n            try\n            {\n                i = value.Length;\n            }\n            catch (NullReferenceException e) // Noncompliant\n            {\n                throw;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotCatchNullReferenceException.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        int Foo(string s)\n        {\n            try\n            {\n                return s.Length;\n            }\n            catch (NullReferenceException nre) // Noncompliant {{Do not catch NullReferenceException; test for null instead.}}\n//                 ^^^^^^^^^^^^^^^^^^^^^^\n            {\n                throw;\n            }\n        }\n\n        void Bar(Action doSomething, Action<NullReferenceException> logException)\n        {\n            try\n            {\n                doSomething();\n            }\n            catch (NullReferenceException nre) // Noncompliant\n            {\n                logException(nre);\n                throw;\n            }\n        }\n\n        int FooBar(string s)\n        {\n            try\n            {\n                return s.Length;\n            }\n            catch (Exception e) when (((e is NullReferenceException))) // Noncompliant\n            {\n                throw;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotCatchSystemException.CSharp10.cs",
    "content": "﻿using System;\nusing System.IO;\n\ntry { }\ncatch (Exception e) when (e is not FileNotFoundException { Message.Length: 5 }) // Noncompliant\n{\n    // do something\n}\n\ntry { }\ncatch (Exception e) when (e is FileNotFoundException { Message.Length: 42 })\n{\n    // do something\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotCatchSystemException.CSharp9.cs",
    "content": "﻿using System;\nusing System.IO;\n\ntry { }\ncatch (Exception e) { } // Noncompliant {{Catch a list of specific exception subtype or use exception filters instead.}}\n\ntry { }\ncatch (Exception e) when (e is FileNotFoundException or is IOException)\n{\n}\n\ntry { }\ncatch (Exception e) when (e is not FileNotFoundException)                     // Noncompliant\n{\n    // do something\n}\n\ntry { }\ncatch (Exception e) when (e is not FileNotFoundException and not IOException) // Noncompliant\n{\n    // do something\n}\n\ntry { }\ncatch (Exception e) when (e is FileNotFoundException {})\n{\n    // do something\n}\n\nrecord R\n{\n    string P\n    {\n        init\n        {\n            try { }\n            catch (Exception e) { } // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotCatchSystemException.cs",
    "content": "﻿using System;\nusing System.IO;\n\nnamespace Tests.Diagnostics\n{\n    public class DummyType : Exception { }\n\n    class Program\n    {\n        public void Method()\n        {\n            try\n            {\n                // do something that might throw a FileNotFoundException or IOException\n            }\n            catch (Exception e) // Noncompliant {{Catch a list of specific exception subtype or use exception filters instead.}}\n//                 ^^^^^^^^^\n            {\n                // log exception ...\n            }\n\n            try\n            {\n                // do something\n            }\n            catch (Exception e) when (e is FileNotFoundException || e is IOException)\n            {\n                // do something\n            }\n\n            try\n            {\n                // do something\n            }\n            catch (Exception e)\n            {\n                if (e is FileNotFoundException || e is IOException)\n                {\n                    // do something\n                }\n                else\n                {\n                    throw;\n                }\n            }\n\n            try { }\n            catch (Exception e)\n            {\n                throw;\n            }\n\n            try { }\n            catch (Exception e)\n            {\n                throw e;\n            }\n\n            try { }\n            catch (Exception) // Noncompliant\n            {\n                new Exception();\n            }\n\n            try { }\n            catch (IOException)\n            {\n                new Exception();\n            }\n\n            try { }\n            catch (Exception e)\n            {\n                throw new Exception();\n            }\n\n            try { }\n            catch // Noncompliant\n//          ^^^^^\n            {\n            }\n\n            try { }\n            catch (DummyType)\n            {\n                throw;\n            }\n        }\n    }\n}\n\nnamespace AzureFunction\n{\n    using Microsoft.Azure.WebJobs;\n\n    class Program\n    {\n        [FunctionName(\"Sample\")]\n        public void Method()\n        {\n            try { }\n            catch (Exception e) { } // Compliant. Don't raise for AzureFunctions because it contradicts S6421.\n\n            try { }\n            catch (Exception) { }   // Compliant.\n\n            try { }\n            catch { }               // Compliant.\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotCheckZeroSizeCollection.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Collections.Specialized;\nusing System.Linq;\n\nconst int localConst_Zero = 0;\nvar someEnumerable = new List<string>();\nvar anotherEnumerable = new List<string>();\n\nvar result = someEnumerable.Count() >= 0; // Noncompliant {{The 'Count' of 'IEnumerable<T>' always evaluates as 'True' regardless the size.}}\n\nif (someEnumerable.Count() is >= 0) // Noncompliant {{The 'Count' of 'IEnumerable<T>' always evaluates as 'True' regardless the size.}}\n//                            ^^^^\n{\n}\n\nif (someEnumerable.Count() is >= localConst_Zero) // Noncompliant\n{\n}\n\nif (((someEnumerable.Count()), anotherEnumerable.Count()) is ( >= 0, // Noncompliant\n//                                                             ^^^^\n    >= 0)) // Noncompliant\n//  ^^^^\n{\n}\n\nif (someEnumerable.Count() is < 0) { } // Noncompliant\nif (someEnumerable.Count() is < localConst_Zero) { } // Noncompliant\nif (someEnumerable.Count() is >= 0 or 1) { } // Noncompliant\nif (someEnumerable.Count() is not >= 0) { } // Noncompliant\nif (someEnumerable.Count() is <= -1) { } // Noncompliant - AlwaysFalse\nif (someEnumerable.Count() is > -17) { } // Noncompliant - AlwaysTrue\nif (someEnumerable.Count() is { } _) { } // Compliant - Not a comparision\n\nint variable = 42;\n\nvar x = args.Length switch\n{\n    >= 0 => 1, // Noncompliant\n//  ^^^^\n    < 0 => 2, // Noncompliant\n};\n\nx = (args.Length, variable) switch\n{\n    ( >= 0, 4) => 1, // Noncompliant\n//    ^^^^\n    ( >= 0, 2) => 2, // Noncompliant\n    _ => 3,\n};\n\nvar y = someEnumerable.Count() switch\n{\n    1 => 1,\n    2 => 2,\n    >= 0 => 3, // Noncompliant\n    < -2 => 4, // Noncompliant\n    _ => 5,\n};\n\nList<string> list = new();\nvar z = list.Count switch\n{\n    1 => 1,\n    not >= 0 => 2, // Noncompliant\n    not < 0 => 3   // Noncompliant\n};\n\nswitch (list.Count)\n{\n    case >= 0: // Noncompliant\n//       ^^^^\n        break;\n    case -42:\n        break;\n    default:\n        break;\n}\n\nvar r = new R();\n\nif (r is R { SomeProperty: { Length: >= 0 } }) // Noncompliant\n//                                   ^^^^\n{\n}\n\nif (r is R { SomeProperty: { Length: not >= 0 } }) // Error [CS8518] `An expression of type 'R' can never match the provided pattern\n                                                   // Noncompliant@-1\n{\n}\n\nif (r is R { SomeProperty: { Length: >= 42 } })\n{\n}\n\nif (r is R { SomeProperty: { Rank: >= 0 } })\n{\n}\n\nint a = 1, b = 2, c = 3;\n\nif ((a, b) is (1)) // Error[CS0029]\n{\n}\n\nif ((a, b) is (R { SomeProperty: { Count: 5 } })) // Error[CS8121]\n{\n}\n\nif ((a, b, c) is (1, 2)) // Error[CS8502]\n{\n}\n\nif ((a, b, c) is (1, 2, 3, 4)) // Error[CS8502]\n{\n}\n\nvar r2 = new R();\n\nif (r2 is R { SomeProperty.Length: >= 0 }) // Noncompliant\n{\n}\n\nif (r2 is R { SomeOtherProperty.SomeProperty.LongLength: >= 0 }) // Noncompliant\n{\n}\n\nif (r2 is R { SomeOtherProperty.SomeProperty.Rank: >= 0 }) // Compliant\n{\n}\n\nif (r2 is R { SomeProperty.Length: not >= 0 }) // Error [CS8518] - this case is now covered by the compiler -> `An expression of type 'R' can never match the provided pattern`\n                                               // Noncompliant@-1\n{\n}\n\nif (r2 is R { SomeProperty.Length: >= 42 })\n{\n}\n\nif (r2 is R {  :  52 }) // Error [CS1001, CS8503]\n{\n}\n\nrecord R\n{\n    public string[] SomeProperty { get; set; }\n\n    public R SomeOtherProperty { get; set; }\n\n    List<string> Prop\n    {\n        init\n        {\n            if (value.Count < 0) { }   // Noncompliant\n            if (value.Count < -1) { }  // Noncompliant\n            if (0 > value.Count) { }   // Noncompliant\n            if (-42 > value.Count) { } // Noncompliant\n            if (value.Count >= 0) { }  // Noncompliant {{The 'Count' of 'ICollection' always evaluates as 'True' regardless the size.}}\n            if (value.Count == 0) { }\n            if (value.Count == 1) { }\n        }\n    }\n}\n\nclass CSharp13\n{\n    void NewCollectionTypes(OrderedDictionary<int, int> orderedDictionary, ReadOnlySet<int> readonlySet)\n    {\n        _ = orderedDictionary.Count >= 0; // Noncompliant\n        _ = readonlySet.Count >= 0;       // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotCheckZeroSizeCollection.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Tests.Diagnostics\n{\n    class FooProperty\n    {\n        public int Length => 0;\n\n        public int LongLength => 0;\n\n        public int Count => 0;\n    }\n\n    class FooMethod\n    {\n        public int Count() => 0;\n    }\n\n    class DummyHolder\n    {\n        public List<string> Enumerable;\n        public List<string> GetEnumerable() { return null; }\n\n        public string[] Array;\n        public string[] GetArray() { return null; }\n\n        public DummyHolder Holder;\n        public DummyHolder GetHolder() { return null; }\n    }\n\n    class Program\n    {\n        const double ConstField_Double_Zero = 0;\n        const int ConstField_Zero = 0;\n        const int ConstField_NonZero = 1;\n\n        public void TestCountMethod()\n        {\n            const int localConst_Zero = 0;\n            const int localConst_NonZero = 1;\n            int localVariable = 0;\n            bool result;\n\n            var someEnumerable = new List<string>();\n\n            result = someEnumerable.Count() >= 0; // Noncompliant {{The 'Count' of 'IEnumerable<T>' always evaluates as 'True' regardless the size.}}\n            //       ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            result = someEnumerable.Count(foo => true) >= 0; // Noncompliant\n            result = someEnumerable?.Count() >= 0; // Noncompliant\n\n            result = someEnumerable.Count() >= 1;\n            result = someEnumerable.Count() >= localVariable;\n            result = someEnumerable.Count() >= -1; // Noncompliant {{The 'Count' of 'IEnumerable<T>' always evaluates as 'True' regardless the size.}}\n            result = someEnumerable.Count() <= 0;\n            result = someEnumerable.Count() < 0; // Noncompliant {{The 'Count' of 'IEnumerable<T>' always evaluates as 'False' regardless the size.}}\n            result = 0 >= someEnumerable.Count();\n\n            result = someEnumerable.Count() >= localConst_Zero; // Noncompliant\n            result = someEnumerable.Count() >= ConstField_NonZero;\n            result = someEnumerable.Count() >= ConstField_Zero; // Noncompliant\n            result = someEnumerable.Count() >= localConst_NonZero;\n            result = someEnumerable.Count() >= ConstField_Double_Zero; // Compliant, double is ignored, arguably FN\n\n            result = (someEnumerable.Count()) >= (0); // Noncompliant\n            result = ((((someEnumerable).Count())) >= ((0))); // Noncompliant\n            //        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            result = 0 <= someEnumerable.Count(); // Noncompliant\n            //       ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n            result = result.ToString() == \"Not integer\";\n            result = (localVariable = 42) != -1;\n\n            if ((localVariable = 42) != -1) { }\n\n            var nonEnumerable = new FooMethod();\n            result = nonEnumerable.Count() >= 0;\n        }\n\n        public void TestComplexAccess()\n        {\n            var someArray = new string[0];\n            var someEnumerable = new List<string>();\n            var holder = new DummyHolder();\n\n            bool result;\n            result = holder.GetHolder().GetHolder().GetArray().Count() >= 0; // Noncompliant\n            result = holder.GetHolder()?.GetHolder()?.GetArray()?.Length >= 0; // Noncompliant\n            result = holder.GetHolder()?.GetHolder().Holder.Array.Length >= 0; // Noncompliant\n            result = holder.GetHolder()?.GetHolder().Holder.Enumerable.Count(foo => true) >= 0; // Noncompliant\n            result = (holder.GetHolder()?.GetHolder())?.GetArray()?.Length >= 0; // Noncompliant\n        }\n\n        public void TestCountProperty()\n        {\n            var someCollection = new List<string>();\n            bool result = someCollection.Count >= 0; // Noncompliant {{The 'Count' of 'ICollection' always evaluates as 'True' regardless the size.}}\n            //            ^^^^^^^^^^^^^^^^^^^^^^^^^\n\n            var nonCollection = new FooProperty();\n            result = nonCollection.Count >= 0;\n        }\n\n        public void TestLengthProperty()\n        {\n            var someArray = new string[0];\n            bool result;\n\n            result = someArray.Length >= 0; // Noncompliant {{The 'Length' of 'Array' always evaluates as 'True' regardless the size.}}\n            //       ^^^^^^^^^^^^^^^^^^^^^\n\n            result = someArray.LongLength >= 0; // Noncompliant {{The 'LongLength' of 'Array' always evaluates as 'True' regardless the size.}}\n            //       ^^^^^^^^^^^^^^^^^^^^^^^^^\n\n            var nonArray = new FooProperty();\n            result = nonArray.Length >= 0;\n            result = nonArray.LongLength >= 0;\n        }\n\n        private void TestInterfacesAndReadonlyCollections(IList<int> list, ICollection<int> collection, IReadOnlyCollection<int> readonlyCollection, IReadOnlyList<int> readonlyList)\n        {\n            SortedSet<double> sortedSet = new SortedSet<double>();\n\n            bool result;\n\n            result = list.Count >= 0; // Noncompliant\n\n            result = collection.Count >= 0; // Noncompliant\n\n            result = readonlyCollection.Count >= 0; // Noncompliant\n\n            result = readonlyList.Count >= 0; // Noncompliant\n\n            result = sortedSet.Count >= 0; // Noncompliant\n        }\n    }\n\n    class OnString\n    {\n        static bool LengthWithoutMeaning(string str)\n        {\n            return str.Length < -3; // Noncompliant {{The 'Length' of 'String' always evaluates as 'False' regardless the size.}}\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotCheckZeroSizeCollection.vb",
    "content": "﻿Imports System.Collections.Generic\nImports System.Linq\n\nNamespace Tests.Diagnostics\n    Class FooProperty\n        Public ReadOnly Property Length() As Integer\n            Get\n                Return 0\n            End Get\n        End Property\n\n        Public ReadOnly Property LongLength() As Integer\n            Get\n                Return 0\n            End Get\n        End Property\n\n        Public ReadOnly Property Count() As Integer\n            Get\n                Return 0\n            End Get\n        End Property\n    End Class\n\n    Class FooMethod\n        Public Function Count() As Integer\n            Return 0\n        End Function\n    End Class\n\n    Class DummyHolder\n        Public Enumerable As List(Of String)\n        Public Function GetEnumerable() As List(Of String)\n            Return Nothing\n        End Function\n\n        Public Array As String()\n        Public Function GetArray() As String()\n            Return Nothing\n        End Function\n\n        Public Holder As DummyHolder\n        Public Function GetHolder() As DummyHolder\n            Return Nothing\n        End Function\n    End Class\n\n    Class Program\n        Const ConstField_Zero As Integer = 0\n        Const ConstField_NonZero As Integer = 1\n\n        Public Sub TestCountMethod()\n            Const LocalConst_Zero As Integer = 0\n            Const LocalConst_NonZero As Integer = 1\n            Dim LocalVariable As Integer = 0\n            Dim Result As Boolean\n\n            Dim SomeEnumerable As IEnumerable(Of String) = New List(Of String)()\n\n            Result = Enumerable.Count(SomeEnumerable) >= 0 ' Noncompliant {{The 'Count' of 'IEnumerable(Of T)' always evaluates as 'True' regardless the size.}}\n            '        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            Result = SomeEnumerable.Count(Function(foo) True) >= 0 ' Noncompliant {{The 'Count' of 'IEnumerable(Of T)' always evaluates as 'True' regardless the size.}}\n            Result = SomeEnumerable?.Count() >= 0 ' Noncompliant\n            Result = SomeEnumerable.Count() >= 1\n            Result = SomeEnumerable.Count() >= LocalVariable\n            Result = SomeEnumerable.Count() >= -1 ' Noncompliant {{The 'Count' of 'IEnumerable(Of T)' always evaluates as 'True' regardless the size.}}\n            Result = SomeEnumerable.Count() <= 0\n            Result = SomeEnumerable.Count() < 0 ' Noncompliant {{The 'Count' of 'IEnumerable(Of T)' always evaluates as 'False' regardless the size.}}\n            Result = 0 >= SomeEnumerable.Count()\n\n            Result = SomeEnumerable.Count() >= LocalConst_Zero ' Noncompliant\n            Result = SomeEnumerable.Count() >= ConstField_NonZero\n            Result = SomeEnumerable.Count() >= ConstField_Zero ' Noncompliant\n            Result = SomeEnumerable.Count() >= LocalConst_NonZero\n\n            Result = (SomeEnumerable.Count()) >= (0) ' Noncompliant\n            Result = ((((SomeEnumerable).Count())) >= ((0))) ' Noncompliant\n            '         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            Result = 0 <= SomeEnumerable.Count() ' Noncompliant\n            '        ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            Dim NonEnumerable = New FooMethod()\n            Result = NonEnumerable.Count() >= 0\n        End Sub\n\n        Public Sub TestComplexAccess()\n            Dim SomeArray = New String(-1) {}\n            Dim SomeEnumerable = New List(Of String)()\n            Dim Holder = New DummyHolder()\n\n            Dim Result As Boolean\n            Result = Holder.GetHolder().GetHolder().GetArray().Count() >= 0 ' Noncompliant\n            Result = Holder.GetHolder()?.GetHolder()?.GetArray()?.Length >= 0 ' Noncompliant\n            Result = Holder.GetHolder()?.GetHolder().Holder.Array.Length >= 0 ' Noncompliant\n            Result = Holder.GetHolder().GetHolder().Holder.Enumerable.AsEnumerable.Count(Function(foo) True) >= 0 ' Noncompliant\n            Result = (Holder.GetHolder()?.GetHolder())?.GetArray()?.Length >= 0 ' Noncompliant\n        End Sub\n\n        Public Sub TestCountProperty()\n            Dim SomeCollection = New List(Of String)()\n            Dim Result As Boolean = SomeCollection.Count >= 0 ' Noncompliant {{The 'Count' of 'ICollection' always evaluates as 'True' regardless the size.}}\n            '                       ^^^^^^^^^^^^^^^^^^^^^^^^^\n            Dim NonCollection = New FooProperty()\n            Result = NonCollection.Count >= 0\n        End Sub\n\n        Public Sub TestLengthProperty()\n            Dim SomeArray = New String(-1) {}\n            Dim Result As Boolean\n\n            Result = SomeArray.Length >= 0 ' Noncompliant {{The 'Length' of 'Array' always evaluates as 'True' regardless the size.}}\n            '        ^^^^^^^^^^^^^^^^^^^^^\n            Result = SomeArray.LongLength >= 0 ' Noncompliant {{The 'LongLength' of 'Array' always evaluates as 'True' regardless the size.}}\n            '        ^^^^^^^^^^^^^^^^^^^^^^^^^\n            Dim NonArray = New FooProperty()\n            Result = NonArray.Length >= 0\n            Result = NonArray.LongLength >= 0\n        End Sub\n\n        Public Sub TestInterfacesAndReadonlyCollections(List As IList(Of Integer), Collection As ICollection(Of Integer), ReadonlyCollection As IReadOnlyCollection(Of Integer), ReadonlyList As IReadOnlyList(Of Integer))\n            Dim Result As Boolean\n            Dim SortedSet As New SortedSet(Of Double)\n\n            Result = List.Count >= 0 ' Noncompliant\n\n            Result = Collection.Count >= 0 ' Noncompliant\n\n            Result = ReadonlyCollection.Count >= 0 ' Noncompliant\n\n            Result = ReadonlyList.Count >= 0 ' Noncompliant\n\n            Result = SortedSet.Count >= 0 ' Noncompliant\n        End Sub\n\n    End Class\n\n    Class OnString\n        Shared Function LengthWithoutMeaning(str As String) As Boolean\n            Return str.Length < -3 ' Noncompliant {{The 'Length' of 'String' always evaluates as 'False' regardless the size.}}\n        End Function\n    End Class\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotCopyArraysInProperties.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Collections.ObjectModel;\n\nrecord R\n{\n    private static string[] staticStrings = new string[] { \"a\", \"b\", \"c\" };\n    private string[] stringArray = new string[10];\n    public string[] Property1\n    {\n        get { return (string[])stringArray.Clone(); } // Noncompliant {{Refactor 'Property1' into a method, properties should not copy collections.}}\n\n        init { stringArray = (string[])staticStrings.Clone(); }\n    }\n\n    private List<string> foo = new();\n    public IEnumerable<string> Property2\n    {\n        get => foo.ToArray();\n    }\n\n    public string[] Property3\n    {\n        init => stringArray = value.ToArray();\n    }\n}\n\nclass TestCase\n{\n    private string[] stringArray = new string[10];\n    private List<string> stringList = new();\n    private HashSet<int> intSet = new();\n\n    public string[] Property1\n    {\n        get { return [..stringArray]; } // FN\n    }\n\n    public string[][] Property2\n    {\n        get { return [stringArray]; } // FN\n    }\n\n    public List<string> Property3 => new(stringArray);\n//                                   ^^^^^^^^^^^^^^^^ Noncompliant {{Refactor 'Property3' into a method, properties should not copy collections.}}\n\n    public HashSet<int> Property4\n    {\n        get { return new(intSet); } // Noncompliant\n    }\n\n    public List<string> Property5 => new List<string>(stringList);\n//                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant {{Refactor 'Property5' into a method, properties should not copy collections.}}\n\n    public LinkedList<string> Property6 => new(stringArray);\n//                                         ^^^^^^^^^^^^^^^^ Noncompliant {{Refactor 'Property6' into a method, properties should not copy collections.}}\n\n    public List<string> CompliantNewWithCapacity => new(10);\n}\n\n\nclass CSharp13Enumerables\n{\n    private ReadOnlySet<int> _setWrapper;\n\n    public int[] SetWrapper\n    {\n        get { return _setWrapper.ToArray(); } // Noncompliant\n    }\n\n    public List<int> SetWrapperTwo\n    {\n        get { return _setWrapper.ToList(); } // Noncompliant\n    }\n\n    private OrderedDictionary<int, string> _orderedDict;\n\n    public List<KeyValuePair<int, string>> OrderedDict\n    {\n        get { return _orderedDict.ToList(); } // Noncompliant\n    }\n\n    public KeyValuePair<int, string>[] OrderedDictDict\n    {\n        get { return _orderedDict.ToArray<KeyValuePair<int, string>>(); } // Noncompliant\n    }\n}\n\npublic partial class PartialProperty\n{\n    private string[] stringArray = new string[10];\n    public partial string[] Property1 { get; }\n    public partial IEnumerable<string> Property2 { get; }\n    public partial IEnumerable<string> Property3 { get; }\n    public partial IEnumerable<string> Property4 { get; }\n    public partial IEnumerable<string> Property5 { get; }\n    public partial string[] Property6 { get; }\n    public partial string[] Property7 { get; }\n    public partial string[] CompliantLazyInitialization1 { get; }\n    public partial string[] CompliantLazyInitialization2 { get; }\n    public partial string[] CompliantCloneInSetter { get; set; }\n}\n\npublic partial class PartialProperty\n{\n    public partial string[] Property1\n    {\n        get { return (string[])stringArray.Clone(); } // Noncompliant\n    }\n\n    public partial IEnumerable<string> Property2\n    {\n        get { return stringArray.ToArray(); } // Noncompliant\n    }\n\n    public partial IEnumerable<string> Property3\n    {\n        get { return stringArray.ToList(); } // Noncompliant\n    }\n\n    public partial IEnumerable<string> Property4 => stringArray.ToList(); // Noncompliant\n\n    public partial IEnumerable<string> Property5 => stringArray.Where(s => s != null).ToList(); // Noncompliant\n\n    public partial string[] Property6 => (string[])stringArray.Clone(); // Noncompliant\n\n    public partial string[] Property7\n    {\n        get => stringArray.ToArray(); // Noncompliant\n    }\n\n    public partial string[] CompliantLazyInitialization1\n    {\n        get { return stringArray ?? (stringArray = (string[])stringArray.Clone()); }\n    }\n\n    public partial string[] CompliantLazyInitialization2\n    {\n        get\n        {\n            var value = stringArray.ToArray();\n            return value;\n        }\n    }\n\n    public partial string[] CompliantCloneInSetter\n    {\n        get { return null; }\n        set { stringArray = (string[])stringArray.Clone(); }\n    }\n\n    public string[] CloneInMethod()\n    {\n        return (string[])stringArray.Clone();\n    }\n\n}\n\nstatic class Extensions\n{\n    extension(Extensions)\n    {\n        static List<int> Property => new int[1].ToList();   // Noncompliant\n    }\n}\n\nclass FieldKeyword\n{\n    List<int> Property\n    {\n        get => field.ToList();          // Noncompliant\n        set => field = value.ToList();  // Compliant\n    }\n}\n\nclass NullCoalesceAssignment\n{\n    private string[] stringArray;\n    private List<string> stringList;\n    private static string[] staticStrings = new string[] { \"a\", \"b\", \"c\" };\n\n    public string[] LazyInitializationWithCoalesceAssignment\n    {\n        get { return stringArray ??= (string[])staticStrings.Clone(); } // Compliant\n    }\n\n    public List<string> LazyInitializationListWithCoalesceAssignment\n    {\n        get { return stringList ??= new List<string>(staticStrings); } // Compliant\n    }\n\n    public string[] LazyInitializationArrow => stringArray ??= (string[])staticStrings.Clone(); // Compliant\n}\n\nclass DictionaryTypes\n{\n    private Dictionary<int, string> dict = new();\n    private SortedDictionary<int, string> sortedDict = new();\n    private SortedList<int, string> sortedList = new();\n\n    public Dictionary<int, string> DictProperty => new Dictionary<int, string>(dict);\n//                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant {{Refactor 'DictProperty' into a method, properties should not copy collections.}}\n\n    public SortedDictionary<int, string> SortedDictProperty => new SortedDictionary<int, string>(sortedDict);\n//                                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant {{Refactor 'SortedDictProperty' into a method, properties should not copy collections.}}\n\n    public SortedList<int, string> SortedListProperty => new SortedList<int, string>(sortedList);\n//                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant {{Refactor 'SortedListProperty' into a method, properties should not copy collections.}}\n\n    public Dictionary<int, string> DictPropertyWithCapacity => dict;                    // Compliant\n\n    public SortedDictionary<int, string> SortedDictPropertyWithComparer => sortedDict;  // Compliant\n\n    public SortedList<int, string> SortedListPropertyWithCapacity => sortedList;        // Compliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotCopyArraysInProperties.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Linq;\n\nnamespace Tests.Diagnostics\n{\n    class NotCompliantCases\n    {\n        private string[] stringArray = new string[10];\n        private List<string> stringList = new List<string>();\n        private HashSet<int> intSet = new HashSet<int>();\n\n        public string[] Property1\n        {\n            get { return (string[])stringArray.Clone(); }\n//                                 ^^^^^^^^^^^^^^^^^ Noncompliant {{Refactor 'Property1' into a method, properties should not copy collections.}}\n        }\n\n        public IEnumerable<string> Property2\n        {\n            get { return stringArray.ToArray(); }\n//                       ^^^^^^^^^^^^^^^^^^^ Noncompliant {{Refactor 'Property2' into a method, properties should not copy collections.}}\n        }\n\n        public IEnumerable<string> Property3\n        {\n            get { return stringArray.ToList(); }\n//                       ^^^^^^^^^^^^^^^^^^ Noncompliant {{Refactor 'Property3' into a method, properties should not copy collections.}}\n        }\n\n        public IEnumerable<string> Property4 => stringArray.ToList();\n//                                              ^^^^^^^^^^^^^^^^^^ Noncompliant {{Refactor 'Property4' into a method, properties should not copy collections.}}\n\n        public IEnumerable<string> Property5 => stringArray.Where(s => s != null).ToList();\n//                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant {{Refactor 'Property5' into a method, properties should not copy collections.}}\n\n        public string[] Property6 => (string[])stringArray.Clone(); // Noncompliant\n\n        public string[] Property7\n        {\n            get => stringArray.ToArray(); // Noncompliant\n        }\n\n        public List<string> Property8\n        {\n            get { return new List<string>(stringArray); }\n//                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant {{Refactor 'Property8' into a method, properties should not copy collections.}}\n        }\n\n        public List<string> Property9 => new List<string>(stringList);\n//                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant {{Refactor 'Property9' into a method, properties should not copy collections.}}\n\n        public HashSet<int> Property10\n        {\n            get => new HashSet<int>(intSet); // Noncompliant\n        }\n\n        public List<string> Property11 => new List<string>(stringArray.Where(s => s != null));\n//                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant {{Refactor 'Property11' into a method, properties should not copy collections.}}\n    }\n\n    class CompliantCases\n    {\n        private static string[] staticStrings = new string[] { \"a\", \"b\", \"c\" };\n\n        private string[] stringArray;\n        private List<string> stringList;\n\n        public string[] LazyInitialization1\n        {\n            get { return stringArray ?? (stringArray = (string[])staticStrings.Clone()); } // Compliant\n        }\n\n        public string[] LazyInitialization2\n        {\n            get\n            {\n                var value = staticStrings.ToArray();\n                return value;\n            }\n        }\n\n        public List<string> LazyInitialization3\n        {\n            get { return stringList ?? (stringList = new List<string>(staticStrings)); } // Compliant\n        }\n\n        public List<string> CopyNotInReturn\n        {\n            get\n            {\n                var value = new List<string>(staticStrings); // FN\n                return value;\n            }\n        }\n\n        public string[] CloneInSetter\n        {\n            get { return null; }\n            set { stringArray = (string[])staticStrings.Clone(); }\n        }\n\n        public List<string> NewCollectionInSetter\n        {\n            get { return null; }\n            set { stringList = new List<string>(staticStrings); }\n        }\n\n        public string[] CloneInMethod()\n        {\n            return (string[])stringArray.Clone();\n        }\n\n        public List<string> NewCollectionInMethod()\n        {\n            return new List<string>(stringArray);\n        }\n\n        public List<string> NewCollectionFromLiteral => new List<string> { \"a\", \"b\", \"c\" };\n\n        public List<string> NewCollectionWithCapacity => new List<string>(10);\n\n        public Func<string[]> ReturningLambdaThatCopies => () => stringArray.ToArray();                             // Compliant\n\n        public Func<int, string[]> ReturningLambdaWithParameterThatCopies => x => stringArray.ToArray();            // Compliant\n\n        public Func<string[]> ReturningAnonymousMethodThatCopies => delegate { return stringArray.ToArray(); };     // Compliant\n\n        public string[] ReturningFromLocalFunction\n        {\n            get\n            {\n                return Local();\n\n                string[] Local() => stringArray.ToArray();                                                          // Compliant\n            }\n        }\n\n        public ReadOnlyCollection<string> ReadOnlyCollectionWrapper => new ReadOnlyCollection<string>(stringArray); // Compliant ReadOnlyCollection is a wrapper, not a copy\n\n        public Parent ParentWrapper => new Parent(stringArray);                                                     // Compliant Not a known copying collection\n    }\n\n    class Parent\n    {\n        private string[] children;\n        public Parent(string[] children) => this.children = children;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotDecreaseMemberVisibility.Concurrent.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace AppendedNamespaceForConcurrencyTest.MyLibrary\n{\n    class A\n    {\n        public void Method_01(int count) { }\n\n        public void Method_02(int count) { }\n\n        public void Method_03(int count) { }\n\n        protected void Method_04(int count) { }\n\n        public void Method_05(int count, string foo, params object[] args) { }\n\n        public void Method_06<T>(T count) { }\n\n        public virtual void Method_07(int count) { }\n\n        public virtual void Method_08(int count) { }\n\n        public void Method_09(int count) { }\n\n        // No method 10\n\n        public void Method_11<T>(int count) { }\n\n        public void Method_12<T, V>(T obj, V obj2) { }\n\n        public void Method_13<T, V>(T obj, IEnumerable<V> obj2) { }\n\n        public void Method_14(int count) { }\n\n        public void Method_15(out int count) { count = 2; }\n\n        public void Method_16(ref int count) { }\n\n        public virtual void Method_17(int count) { }\n\n\n        public int Property_01 { get; set; }\n\n        public int Property_02 { get; set; }\n\n        public int Property_03 { get; private set; }\n\n        public int Property_04 { get; }\n\n        public int Property_05 { get; set; }\n\n        public int Property_06 { get; set; }\n\n        public virtual int Property_07 { get; set; }\n\n        public virtual int Property_08 { get; set; }\n\n        public virtual int Property_09 { get; set; }\n\n        public int Property_10 { get; set; }\n    }\n\n    class B : A\n    {\n    }\n\n    class C : B\n    {\n        private void Method_01(int count) { } // Noncompliant {{This member hides 'AppendedNamespaceForConcurrencyTest.MyLibrary.A.Method_01(int)'. Make it non-private or seal the class.}}\n//                   ^^^^^^^^^\n\n        protected void Method_02(int count) { } // Noncompliant\n\n        void Method_03(int count) { } // Noncompliant\n\n        private void Method_04(int count) { } // Noncompliant\n\n        private void Method_05(int something, string something2, params object[] someArgs) { } // Noncompliant\n\n        private void Method_06<T>(T count) { } // Noncompliant\n\n        // Error@+1 [CS0621]\n        private virtual void Method_07(int count) { }  // Noncompliant\n\n        // Error@+1 [CS0621,CS0507]\n        private override void Method_08(int count) { } // Noncompliant\n\n        private new void Method_09(int count) { }\n\n        private void Method_10(int count) { }\n\n        private void Method_11<V>(int count) { } // Noncompliant\n\n        private void Method_12<V, T>(T obj, V obj2) { } // Noncompliant\n\n        private void Method_13<V, T>(T obj, IEnumerable<T> obj2) { } // Noncompliant\n\n        private void Method_14(int count) { } // Noncompliant\n\n        private void Method_15(int count) { }\n\n        private void Method_16(out int count) { count = 2; }\n\n        // Error@+1 [CS0621,CS0507]\n        private override void Method_17(int count) { } // Noncompliant\n\n\n        private int Property_01 { get; set; } // Noncompliant\n\n        public int Property_02 { private get; set; } // Noncompliant\n\n        private int Property_03 { get; set; } // Noncompliant\n\n        public int Property_04 { get; private set; }\n\n        public int Property_05 { get; } // Noncompliant\n\n        private int Property_06 { get; } // Noncompliant\n\n        int i;\n\n        // Note this cannot be auto-property, as it is a compiler error.\n        public override int Property_07 { get { return i; } }\n\n        // Error@+1 [CS0507] - cannot change modifier\n        public override int Property_08 { get { return i; } private set { i = value; } } // Noncompliant\n\n        public override int Property_09 { get; } // Error [CS8080].\n\n        private string Property_10 { get; set; } // Noncompliant, return type is irrelevant for method resolution\n    }\n\n    class Foo\n    {\n        public void Method_01(int count) { }\n    }\n\n    sealed class Bar : Foo\n    {\n        private void Method_01(int count) { }\n    }\n}\n\nnamespace AppendedNamespaceForConcurrencyTest.OtherNamespace\n{\n    public class Class1\n    {\n        internal void SomeMethod(string s) { }\n    }\n\n    public class Class2 : Class1\n    {\n        private void SomeMethod(string s) { } // Noncompliant\n    }\n}\n\nnamespace AppendedNamespaceForConcurrencyTest.SomeNamespace\n{\n    public class Class3 : AppendedNamespaceForConcurrencyTest.OtherNamespace.Class1\n    {\n        private void SomeMethod(string s) { }\n    }\n}\n\nnamespace AppendedNamespaceForConcurrencyTest.FalsePositiveOnIndexers\n{\n    public class BaseClass\n    {\n        public int this[int index]\n        {\n            get { return index; }\n            set { }\n        }\n    }\n\n    public class DescendantClass : BaseClass\n    {\n        public int this[string name] // Compliant, parameters are of different types\n        {\n            get { return name.Length; }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotDecreaseMemberVisibility.Latest.Partial.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace PartialMembers\n{\n    public partial class DescendantClass : BaseClass\n    {\n        private partial int Property_01 { get; } // Noncompliant\n        //                  ^^^^^^^^^^^\n        private partial int this[int index] { get; } // Noncompliant\n        //                  ^^^^\n        private partial event EventHandler SomeEvent;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotDecreaseMemberVisibility.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace MyLibrary\n{\n    public interface IMyInterface\n    {\n        public static virtual void MyMethod() { }\n    }\n\n    public interface IMyOtherInterface : IMyInterface\n    {\n        private static void MyMethod() { }\n    }\n\n    public class MyClass<T> where T : IMyOtherInterface\n    {\n        public MyClass(IMyOtherInterface other)\n        {\n            T.MyMethod(); // Compliant, the method from IMyInterface is called\n        }\n    }\n\n    record A\n    {\n        public void Method_01(int count) { }\n\n        public void Method_02(int count) { }\n\n        public void Method_03(int count) { }\n\n        protected void Method_04(int count) { }\n\n        public void Method_05(int count, string foo, params object[] args) { }\n\n        public void Method_06<T>(T count) { }\n\n        public virtual void Method_07(int count) { }\n\n        public virtual void Method_08(int count) { }\n\n        public void Method_09(int count) { }\n\n        // No method 10\n\n        public void Method_11<T>(int count) { }\n\n        public void Method_12<T, V>(T obj, V obj2) { }\n\n        public void Method_13<T, V>(T obj, IEnumerable<V> obj2) { }\n\n        public void Method_14(int count) { }\n\n        public void Method_15(out int count) { count = 2; }\n\n        public void Method_16(ref int count) { }\n\n        public virtual void Method_17(int count) { }\n\n\n        public int Property_01 { get; init; }\n\n        public int Property_02 { get; init; }\n\n        public int Property_03 { get; private set; }\n\n        public int Property_04 { get; }\n\n        public int Property_05 { get; init; }\n\n        public int Property_06 { get; init; }\n\n        public virtual int Property_07 { get; init; }\n\n        public virtual int Property_08 { get; init; }\n\n        public virtual int Property_09 { get; init; }\n\n        public int Property_10 { get; init; }\n\n        public int Property_11 { get; init; }\n    }\n\n    record B : A\n    {\n    }\n\n    record C : B\n    {\n        private void Method_01(int count) { } // Noncompliant {{This member hides 'MyLibrary.A.Method_01(int)'. Make it non-private or seal the class.}}\n\n        protected void Method_02(int count) { } // Noncompliant\n\n        void Method_03(int count) { } // Noncompliant\n\n        private void Method_04(int count) { } // Noncompliant\n\n        private void Method_05(int something, string something2, params object[] someArgs) { } // Noncompliant\n\n        private void Method_06<T>(T count) { } // Noncompliant\n\n        // Error@+1 [CS0621]\n        private virtual void Method_07(int count) { }  // Noncompliant\n\n        // Error@+1 [CS0621,CS0507]\n        private override void Method_08(int count) { }  // Noncompliant\n\n        private new void Method_09(int count) { }\n\n        private void Method_10(int count) { }\n\n        private void Method_11<V>(int count) { } // Noncompliant\n\n        private void Method_12<V, T>(T obj, V obj2) { } // Noncompliant\n\n        private void Method_13<V, T>(T obj, IEnumerable<T> obj2) { } // Noncompliant\n\n        private void Method_14(int count) { } // Noncompliant\n\n        private void Method_15(int count) { }\n\n        private void Method_16(out int count) { count = 2; }\n\n        // Error@+1 [CS0621,CS0507]\n        private override void Method_17(int count) { } // Noncompliant\n\n\n        private int Property_01 { get; init; } // Noncompliant\n\n        public int Property_02 { private get; init; } // Noncompliant\n\n        private int Property_03 { get; init; } // Noncompliant\n\n        public int Property_04 { get; private init; }\n\n        public int Property_05 { get; } // Noncompliant\n\n        private int Property_06 { get; } // Noncompliant\n\n        int i;\n\n        // Note this cannot be auto-property, as it is a compiler error.\n        public override int Property_07 { get { return i; } }\n\n        // Error@+1 [CS0507] - cannot change modifier\n        public override int Property_08 { get { return i; } private init { i = value; } } // Noncompliant\n\n        public override int Property_09 { get; } // Error [CS8080]\n\n        private string Property_10 { get; init; } // Noncompliant, return type is irrelevant for method resolution\n\n        public int Property_11 { get; protected init; } // Noncompliant\n    }\n\n    record Foo\n    {\n        public void Method_01(int count) { }\n    }\n\n    sealed record Bar : Foo\n    {\n        private void Method_01(int count) { }\n    }\n}\n\nnamespace PositionalRecords\n{\n    record FooBase(string X)\n    {\n        public void Method(int count) { }\n    }\n\n    record Foo(string X) : FooBase(X)\n    {\n        private void Method(int count) { } // Noncompliant {{This member hides 'PositionalRecords.FooBase.Method(int)'. Make it non-private or seal the class.}}\n    }\n}\n\nnamespace OtherNamespace\n{\n    public record Class1\n    {\n        internal void SomeMethod(string s) { }\n    }\n\n    public record Class2 : Class1\n    {\n        private void SomeMethod(string s) { } // Noncompliant\n    }\n}\n\nnamespace SomeNamespace\n{\n    public record Class3 : OtherNamespace.Class1\n    {\n        private void SomeMethod(string s) { }\n    }\n}\n\nnamespace Indexers\n{\n    public record BaseClass\n    {\n        public int this[int index]\n        {\n            get { return index; }\n            set { }\n        }\n    }\n\n    public record DescendantClass : BaseClass\n    {\n        public int this[string name] // Compliant, parameters are of different types\n        {\n            get { return name.Length; }\n        }\n    }\n}\n\nnamespace PartialMembers\n{\n    public class BaseClass\n    {\n        public int Property_01 { get; }\n        public int this[int index]\n        {\n            get { return index; }\n        }\n        public event EventHandler SomeEvent;\n    }\n\n    public partial class DescendantClass : BaseClass\n    {\n        private partial int Property_01 { get { return 1; } }               // Noncompliant\n        //                  ^^^^^^^^^^^\n        private partial int this[int index] { get { return index + 1; } }   // Noncompliant\n        //                  ^^^^\n        private partial event EventHandler SomeEvent { add { } remove { } } // Noncompliant\n        //                                 ^^^^^^^^^\n    }\n\n    // https://sonarsource.atlassian.net/browse/NET-368\n    public class AnotherClass : BaseClass\n    {\n        private int this[int index] // Noncompliant\n        {\n            get { return index + 1; }\n        }\n    }\n}\n\nnamespace DefaultInterfaceMembers\n{\n    public interface IFoo\n    {\n        public void SomeMethod(int count) { }\n    }\n\n    public interface IBar : IFoo\n    {\n        private void SomeMethod(int count) { }\n    }\n\n    public class Consumer\n    {\n        public Consumer(IBar bar)\n        {\n            bar.SomeMethod(1); // Compliant, the method from IFoo is called\n        }\n    }\n}\n\nnamespace Extensions\n{\n    class Base\n    {\n        public void SomeMethod(int count) { }\n    }\n    class Derived : Base { }\n\n    static class Extensions\n    {\n        extension(Derived d)\n        {\n            private void SomeMethod(int count) { }  // Compliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotDecreaseMemberVisibility.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace MyLibrary\n{\n    class A\n    {\n        public void Method_01(int count) { }\n\n        public void Method_02(int count) { }\n\n        public void Method_03(int count) { }\n\n        protected void Method_04(int count) { }\n\n        public void Method_05(int count, string foo, params object[] args) { }\n\n        public void Method_06<T>(T count) { }\n\n        public virtual void Method_07(int count) { }\n\n        public virtual void Method_08(int count) { }\n\n        public void Method_09(int count) { }\n\n        // No method 10\n\n        public void Method_11<T>(int count) { }\n\n        public void Method_12<T, V>(T obj, V obj2) { }\n\n        public void Method_13<T, V>(T obj, IEnumerable<V> obj2) { }\n\n        public void Method_14(int count) { }\n\n        public void Method_15(out int count) { count = 2; }\n\n        public void Method_16(ref int count) { }\n\n        public virtual void Method_17(int count) { }\n\n\n        public int Property_01 { get; set; }\n\n        public int Property_02 { get; set; }\n\n        public int Property_03 { get; private set; }\n\n        public int Property_04 { get; }\n\n        public int Property_05 { get; set; }\n\n        public int Property_06 { get; set; }\n\n        public virtual int Property_07 { get; set; }\n\n        public virtual int Property_08 { get; set; }\n\n        public virtual int Property_09 { get; set; }\n\n        public int Property_10 { get; set; }\n    }\n\n    class B : A\n    {\n    }\n\n    class C : B\n    {\n        private void Method_01(int count) { } // Noncompliant {{This member hides 'MyLibrary.A.Method_01(int)'. Make it non-private or seal the class.}}\n//                   ^^^^^^^^^\n\n        protected void Method_02(int count) { } // Noncompliant\n\n        void Method_03(int count) { } // Noncompliant\n\n        private void Method_04(int count) { } // Noncompliant\n\n        private void Method_05(int something, string something2, params object[] someArgs) { } // Noncompliant\n\n        private void Method_06<T>(T count) { } // Noncompliant\n\n        // Error@+1 [CS0621]\n        private virtual void Method_07(int count) { } // Noncompliant\n\n        // Error@+1 [CS0621, CS0507]\n        private override void Method_08(int count) { } // Noncompliant\n\n        private new void Method_09(int count) { }\n\n        private void Method_10(int count) { }\n\n        private void Method_11<V>(int count) { } // Noncompliant\n\n        private void Method_12<V, T>(T obj, V obj2) { } // Noncompliant\n\n        private void Method_13<V, T>(T obj, IEnumerable<T> obj2) { } // Noncompliant\n\n        private void Method_14(int count) { } // Noncompliant\n\n        private void Method_15(int count) { }\n\n        private void Method_16(out int count) { count = 2; }\n\n        // Error@+1 [CS0621,CS0507]\n        private override void Method_17(int count) { } // Noncompliant\n\n\n        private int Property_01 { get; set; } // Noncompliant\n\n        public int Property_02 { private get; set; } // Noncompliant\n\n        private int Property_03 { get; set; } // Noncompliant\n\n        public int Property_04 { get; private set; }\n\n        public int Property_05 { get; } // Noncompliant\n\n        private int Property_06 { get; } // Noncompliant\n\n        int i;\n\n        // Note this cannot be auto-property, as it is a compiler error.\n        public override int Property_07 { get { return i; } }\n\n        // Error@+1 [CS0507] - cannot change modifier\n        public override int Property_08 { get { return i; } private set { i = value; } } // Noncompliant\n\n        public override int Property_09 { get; } // Error [CS8080]\n\n        private string Property_10 { get; set; } // Noncompliant, return type is irrelevant for method resolution\n    }\n\n    class Foo\n    {\n        public void Method_01(int count) { }\n    }\n\n    sealed class Bar : Foo\n    {\n        private void Method_01(int count) { }\n    }\n}\n\nnamespace OtherNamespace\n{\n    public class Class1\n    {\n        internal void SomeMethod(string s) { }\n    }\n\n    public class Class2 : Class1\n    {\n        private void SomeMethod(string s) { } // Noncompliant\n    }\n}\n\nnamespace SomeNamespace\n{\n    public class Class3 : OtherNamespace.Class1\n    {\n        private void SomeMethod(string s) { }\n    }\n}\n\nnamespace FalsePositiveOnIndexers\n{\n    public class BaseClass\n    {\n        public int this[int index]\n        {\n            get { return index; }\n            set { }\n        }\n    }\n\n    public class DescendantClass : BaseClass\n    {\n        public int this[string name] // Compliant, parameters are of different types\n        {\n            get { return name.Length; }\n        }\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/8666\nnamespace Repro_8666\n{\n    public class BaseClass\n    {\n        protected virtual void DoSomething(IEnumerable<int> numbers) { }\n    }\n\n    public class DerivedClass : BaseClass\n    {\n        private void DoSomething(IEnumerable<string> numbers) { }   // Noncompliant - FP: the method in the derived class has different arguments\n    }\n}\n\nnamespace Events\n{\n    public class Class1\n    {\n        internal event EventHandler SomeEvent;\n        internal event EventHandler SomeEvent2;\n    }\n\n    public class Class2 : Class1\n    {\n        private event EventHandler SomeEvent // Noncompliant\n        //                         ^^^^^^^^^\n        {\n            add { }\n            remove { }\n        }\n\n        private event EventHandler SomeEvent2; // Compliant FN: EventFieldDeclaration not supported yet.\n    }\n\n    public class Class3 : Class1\n    {\n        private new event EventHandler SomeEvent // Compliant: new keyword used to hide base class event\n        {\n            add { }\n            remove { }\n        }\n\n        public new event EventHandler SomeEvent2; // Compliant: new keyword used to hide base class event\n    }\n\n    public class Class4\n    {\n        public virtual event EventHandler SomeEvent;\n        public virtual event EventHandler SomeEvent2;\n    }\n\n    public class Class5 : Class4\n    {\n        public override event EventHandler SomeEvent // Compliant: override base class event\n        {\n            add { }\n            remove { }\n        }\n\n        public override event EventHandler SomeEvent2; // Compliant: override base class event\n    }\n}\n\nnamespace ExtensionMethods\n{\n    class Base\n    {\n        public void SomeMethod(int count) { }\n    }\n    class Derived : Base { }\n\n    static class Extensions\n    {\n        private static void SomeMethod(this Derived d, int count) { }   // Compliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotExposeListT.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nvar x = 1;\n\nList<int> Foo() => new();\n\npublic interface IMust\n{\n    public abstract List<string> InterfaceMethod();         // Noncompliant\n}\n\npublic abstract class Base\n{\n    public abstract List<string> Method();                  // Noncompliant\n    public abstract List<string> Property { get; }          // Noncompliant\n}\n\npublic class Overriding : Base, IMust\n{\n    public override List<string> Method() => null;      // Compliant, can't change the return type\n    public override List<string> Property => null;      // Compliant, can't change the return type\n\n    List<string> IMust.InterfaceMethod() => null;       // Compliant, can't change the return type\n}\n\npublic class Bar<T>\n{\n    public List<T> Method1<T>(T arg) => null; // Noncompliant\n}\n\npublic record R<T>\n{\n    public List<T> Method1<T>(T arg) => null; // Noncompliant {{Refactor this method to use a generic collection designed for inheritance.}}\n\n    private List<T> Method2<T>(T arg) => null;\n\n    private object Method3(int arg) => null;\n\n    public List<int> Method4(List<string> someParam) => null;\n//         ^^^^^^^^^ Noncompliant\n//                           ^^^^^^^^^^^^ Noncompliant@-1\n\n    public List<T> field, field2;\n//         ^^^^^^^ Noncompliant {{Refactor this field to use a generic collection designed for inheritance.}}\n\n    public List<int> Property { get; init; }\n//         ^^^^^^^^^ Noncompliant {{Refactor this property to use a generic collection designed for inheritance.}}\n\n    public R(List<R<int>> bars) { } // Noncompliant  {{Refactor this constructor to use a generic collection designed for inheritance.}}\n\n    public void Foo()\n    {\n        Action<List<int>> x = static x => { };\n    }\n}\n\npublic record R2(List<int> Property);  // FN #6416\n\npublic partial class PartialProperties\n{\n    public partial List<int> Result { get; set; } // Noncompliant\n}\n\npublic partial class PartialProperties\n{\n    public partial List<int> Result { get => null; set { } } // Noncompliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotExposeListT.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Xml.Serialization;\n\nnamespace Tests.Diagnostics\n{\n    public class Bar<T>\n    {\n        public List<T> Method1<T>(T arg) => null;\n//             ^^^^^^^ Noncompliant {{Refactor this method to use a generic collection designed for inheritance.}}\n\n        private List<T> Method2<T>(T arg) => null;\n\n        private object Method3(int arg) => null;\n\n        public List<int> Method4(List<string> someParam) => null;\n//             ^^^^^^^^^ Noncompliant\n//                               ^^^^^^^^^^^^ Noncompliant@-1\n\n        public IList<int> Method5(ICollection<string> someParam) => null;\n\n        public List<T> field, field2;\n//             ^^^^^^^ Noncompliant {{Refactor this field to use a generic collection designed for inheritance.}}\n\n        public List<int> Property { get; set; }\n//             ^^^^^^^^^ Noncompliant {{Refactor this property to use a generic collection designed for inheritance.}}\n\n        public Bar(List<Bar<int>> bars) { } // Noncompliant  {{Refactor this constructor to use a generic collection designed for inheritance.}}\n\n        protected List<int> ProtectedMethod() => null; // Noncompliant\n\n\n        protected internal List<int> ProtectedInternalMethod() => null; // Noncompliant\n\n        internal List<int> InternalMethod() => null;\n\n        internal List<int> InternalProperty { get; set; }\n\n        public void Foo()\n        {\n            Action<List<int>> x = (List<int> y) => { };\n        }\n\n        // https://github.com/SonarSource/sonar-dotnet/issues/3728\n        [XmlElement(ElementName = \"Names\")]\n        public List<string> _DoNotUse_Names_Property => null;\n\n        [XmlElementAttribute(ElementName = \"Names\")]\n        public List<string> _DoNotUse_Names_FullAttribute => null;\n\n        [XmlElement(ElementName = \"Names\")]\n        public List<string> _DoNotUse_Names_Field = null;\n\n        [XmlAttribute(AttributeName = \"Names\")]\n        public List<string> _DoNotUse_Names_Attribute => null;  // Noncompliant, exception doesn't apply to other Xml attributes\n\n        [XmlIgnore]\n        public List<string> _DoNotUse_Names_Ignore => null;     // Noncompliant, if you don't need to serialize it, don't expose it.\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotHardcodeCredentials.CustomValues.cs",
    "content": "﻿using System;\nusing System.Net;\nusing System.Security;\nusing System.Security.Cryptography;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        public void Test()\n        {\n            string passWord = @\"foo\"; // Compliant\n            string passKode = \"a\"; // Noncompliant {{\"kode\" detected here, make sure this is not a hard-coded credential.}}\n            string passKodeKode = \"a\"; // Noncompliant\n            string passKoDe = \"a\"; // Compliant\n\n            string x = \"kode=a;kode=a\"; // Noncompliant\n            string x1 = \"facal-faire=a;kode=a\"; // Noncompliant\n            string x2 = @\"x\\*+?|}{][)(^$.# =something\"; // Noncompliant {{\"x\\*+?|}{][)(^$.#\" detected here, make sure this is not a hard-coded credential.}}\n        }\n\n        public void StandardAPI(SecureString secureString, string nonHardcodedPassword, byte[] byteArray, CspParameters cspParams)\n        {\n            var networkCredential = new NetworkCredential();\n            networkCredential.Password = nonHardcodedPassword;\n            networkCredential.Domain = \"hardcodedDomain\";\n            new NetworkCredential(\"username\", secureString);\n            new NetworkCredential(\"username\", nonHardcodedPassword, \"domain\");\n            new PasswordDeriveBytes(nonHardcodedPassword, byteArray);\n            new PasswordDeriveBytes(new byte[] {1}, byteArray, cspParams);\n\n            new NetworkCredential(\"username\", \"hardcoded\"); // Noncompliant\n            networkCredential.Password = \"hardcoded\"; // Noncompliant\n            new PasswordDeriveBytes(\"hardcoded\", byteArray, cspParams); // Noncompliant\n        }\n    }\n\n    public class NoWordBound\n    {\n        // This used to be an FN because the regex matched on word boundaries.\n        public void Method()\n        {\n            string x = \"*=something\"; // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotHardcodeCredentials.CustomValues.vb",
    "content": "﻿Imports System\nImports System.Net\nImports System.Security\nImports System.Security.Cryptography\n\nNamespace Tests.Diagnostics\n    Class Program\n        Public Sub Test()\n            Dim passWord As String = \"foo\"\n            Dim passKode As String = \"a\" 'Noncompliant {{\"kode\" detected here, make sure this is not a hard-coded credential.}}\n            Dim passKodeKode As String = \"a\" 'Noncompliant\n            Dim passKoDe As String = \"a\"    ' Error [BC30288] Local variable 'passKoDe' is already declared in the current block\n            Dim x As String = \"kode=a;kode=a\" 'Noncompliant\n            Dim x1 As String = \"facal-faire=a;kode=a\" 'Noncompliant\n            Dim x2 As String = \"x\\*+?|}{][)(^$.# =something\" ' Noncompliant {{\"x\\*+?|}{][)(^$.#\" detected here, make sure this is not a hard-coded credential.}}\n        End Sub\n\n        Public Sub StandardAPI(secureString As SecureString, nonHardcodedPassword As String, byteArray As Byte(), cspParams As CspParameters)\n            Dim networkCredential = New NetworkCredential()\n            networkCredential.Password = nonHardcodedPassword\n            networkCredential.Domain = \"hardcodedDomain\"\n            networkCredential = New NetworkCredential(\"username\", secureString)\n            networkCredential = New NetworkCredential(\"username\", nonHardcodedPassword, \"domain\")\n            Dim passwordDeriveBytes = New PasswordDeriveBytes(nonHardcodedPassword, byteArray)\n            passwordDeriveBytes = New PasswordDeriveBytes(New Byte() {1}, byteArray, \"strHashName\", 1)\n\n            networkCredential = New NetworkCredential(\"username\", \"hardcoded\", \"domain\") 'Noncompliant\n            networkCredential.Password = \"hardcoded\" 'Noncompliant\n            passwordDeriveBytes = New PasswordDeriveBytes(\"hardcoded\", byteArray, \"strHashName\", 1, cspParams) 'Noncompliant\n        End Sub\n    End Class\n\n    Class NoWordBound\n        ' This used to be an FN because the regex matched on word boundaries.\n        Public Sub Test()\n            Dim x As String = \"*=something\" ' Noncompliant\n        End Sub\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotHardcodeCredentials.DefaultValues.Latest.cs",
    "content": "﻿using System;\n\nnamespace CSharp8\n{\n    class Program\n    {\n        private static string SomeMethod() => null;\n\n        public void Concatenations()\n        {\n            var secret = SomeMethod();\n\n            // Reassigned\n            secret ??= \"hardcoded\";\n            var a = \"Server = localhost; Database = Test; User = SA; Password = \" + secret;         // Compliant: this is not symbolic execution rule and ConstantValueFinder cannot detect that.\n            var b = \"Server = localhost; Database = Test; User = SA; Password = secret\";            // Noncompliant\n        }\n    }\n}\n\nnamespace CSharp10\n{\n    class Program\n    {\n        public void Test()\n        {\n            const string part1 = \"Password\";\n            const string part2 = \"123\";\n            const string randomString = \"RandomValue\";\n            const string noncompliant = $\"{part1}={part2}\"; // Noncompliant\n            const string compliant = $\"{randomString}={part2}\";\n        }\n    }\n}\n\nnamespace CSharp11\n{\n    class Tests\n    {\n        void RawStringLiterals()\n        {\n            const string part1 = \"\"\"Password\"\"\";\n            const string part2 = \"\"\"123\"\"\";\n            const string randomString = \"\"\"\n            Random\n            Value\n            Url\n        \"\"\";\n            const string noncompliant = $\"\"\"{part1}={part2}\"\"\"; // Noncompliant\n            const string compliant = $\"\"\"{randomString}={part2}\"\"\";\n        }\n\n        void Utf8StringLiterals()\n        {\n            ReadOnlySpan<byte> DBConnectionString0;  // Don't crash if initializer is not present.\n            var DBConnectionString1 = \"Server=localhost; Database=Test; User=SA; Password=Secret123\"u8;     // Noncompliant\n            var DBConnectionString2 = \"\"\"Server=localhost; Database=Test; User=SA; Password=Secret123\"\"\"u8; // Noncompliant\n            var DBConnectionString3 = \"\"\"\n        Server=localhost; Database=Test; User=SA; Password=Secret123\n        \"\"\"u8; // Noncompliant@-2\n            var DBConnectionString4 = \"Server=localhost; Database=Test; User=SA; Password=Secret123\"u8.ToArray(); // Noncompliant\n            var DBConnectionString5 = \"Server=localhost; Database=Test; User=SA; Password=Secret123\"u8.Slice(0);  // Compliant. Only \"ToArray\" is supported\n            var DBConnectionString6 = \"Server=localhost; Database=Test; User=SA; \\u0050assword=Secret123\"u8;      // Noncompliant \\u0050 is letter 'P'\n\n        }\n\n        void NewlinesInStringInterpolation(string someInput)\n        {\n            const string test1 = \"test1\";\n            const string test2 = \"test2\";\n            string noncompliant = $\"Server = localhost; Database = Test; User = SA; Password ={test1\n                + test2}\"; // Noncompliant@-1\n            string noncompliantRawString = $$\"\"\"Server = localhost; Database = Test; User = SA; Password ={{test1\n                + test2}}\"\"\"; // Noncompliant@-1\n        }\n    }\n}\n\nnamespace CSharp12\n{\n    class PrimaryConstructor(string ctorParam = \"Password=123\") // Noncompliant\n    {\n        public void Test(string methodParam = \"Password=123\") // Noncompliant\n        {\n            var lambda = (string lambdaParam = \"Password=123\") => lambdaParam; // FN\n        }\n    }\n}\n\nnamespace CSharp13\n{\n    class EscapeSequence\n    {\n        void Examples() \n        {\n            var DBConnectionString1 = \"Server=localhost; Database=Test; User=SA; Password=Secret123\"; // Noncompliant\n            var DBConnectionString2 = \"Server=localhost; Database=Test; User=SA;\\ePassword=Secret\";   // Noncompliant\n            var DBConnectionString3 = \"\\ePassword=123\";       // Noncompliant\n            var DBConnectionString4 = \"\\u001bPassword=123\";   // Noncompliant\n            var DBConnectionString6 = \"Password\\e=123\";       // Compliant\n            var DBConnectionString7 = \"Password\\u001b=123\";   // Compliant\n            var DBConnectionString8 = \"Password=\\e123\";       // Noncompliant\n            var DBConnectionString9 = \"Password=\\u001b123\";   // Noncompliant\n            var DBConnectionString10 = \"Password=123\\e\";      // Noncompliant\n            var DBConnectionString11 = \"Password=123\\u001b\";  // Noncompliant\n            var DBConnectionString12 = \"Passwor\\e=123\";       // Compliant\n            var DBConnectionString13 = \"Passwor\\u001b=123\";   // Compliant\n        }   \n    }\n}\n\npublic class NullConditionalAssignment\n{\n    public class Sample\n    {\n        public string ConnectionString { get; set; }\n    }\n    public void Test(Sample sample)\n    {\n        sample?.ConnectionString = \"Server=localhost; Database=Test; User=SA; Password=Secret123\";  // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotHardcodeCredentials.DefaultValues.cs",
    "content": "﻿using System;\nusing System.Net;\nusing System.Security;\nusing System.Security.Cryptography;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        public const string DBConnectionString = \"Server=localhost; Database=Test; User=SA; Password=Secret123\";    // Noncompliant {{\"password\" detected here, make sure this is not a hard-coded credential.}}\n        public const string EditPasswordPageUrlToken = \"{Account.EditPassword.PageUrl}\"; // Compliant\n\n        private const string secretConst = \"constantValue\";\n        private string secretField = \"literalValue\";\n        private string secretFieldConst = secretConst;\n        private string secretFieldUninitialized;\n        private string secretFieldNull = null;\n        private string secretFieldMethod = SomeMethod();\n        private string invalidField = invalidField; // // Error [CS0236] A field initializer cannot reference the non-static field, method, or property\n\n        private static string SomeMethod() => \"\";\n\n        public void Test(string user)\n        {\n            string password = @\"foo\"; // Noncompliant {{\"password\" detected here, make sure this is not a hard-coded credential.}}\n//                 ^^^^^^^^^^^^^^^^^\n\n            string foo, passwd = \"a\"; // Noncompliant {{\"passwd\" detected here, make sure this is not a hard-coded credential.}}\n//                      ^^^^^^^^^^^^\n\n            string pwdPassword = \"a\"; // Noncompliant {{\"pwd and password\" detected here, make sure this is not a hard-coded credential.}}\n\n            string foo2 = @\"Password=123\"; // Noncompliant\n            string multiline = // Noncompliant\n                @\"Server=A;\n                User=B;\n                Password=123\";\n\n            string multiline_OK =\n                @\"Password detected here,\n                make sure this is not\n                a hard-coded credential.\";\n\n            string bar;\n            bar = \"Password=p\"; // Noncompliant\n//          ^^^^^^^^^^^^^^^^^^\n\n            object obj;\n            obj = \"Password=p\"; // Compliant, only assignment to string is inspected\n\n            foo = \"password\";\n            foo = \"password=\";\n            foo = \"passwordpassword\";\n            foo = \"foo=1;password=1\";   // Noncompliant\n            foo = \"foo=1password=1\";    // Noncompliant {{\"password\" detected here, make sure this is not a hard-coded credential.}}\n            foo = \"\";                   // Compliant\n            foo = \"userpassword=1\";     // Noncompliant {{\"password\" detected here, make sure this is not a hard-coded credential.}}\n            foo = \"passwordfield=1\";    // Compliant\n            foo = \"user_password=1\";    // Noncompliant\n            foo = \"user-password=1\";    // Noncompliant\n            foo = \"user/password=1\";    // Noncompliant\n            foo = \"password:1\";         // Compliant\n\n            var something1 = (foo = \"foo\") + (bar = \"bar\");\n            var something2 = (foo = \"foo\") + (bar = \"password=123\"); // Noncompliant\n            var something3 = (foo = \"foo\") + (bar = \"password\");\n            var something4 = (foo = \"foo\") + (bar = \"123=password\");\n\n            string myPassword1 = null;\n            string myPassword2 = \"\";\n            string myPassword3 = \"        \";\n            string myPassword4 = @\"foo\"; // Noncompliant\n            string query2 = \"password=hardcoded;user='\" + user + \"'\"; // Noncompliant\n        }\n\n        public void DefaultKeywords()\n        {\n            string password = \"a\";       // Noncompliant\n            string x1 = \"password=a\";    // Noncompliant\n\n            string passwd = \"a\";         // Noncompliant\n            string x2 = \"passwd=a\";      // Noncompliant\n\n            string pwd = \"a\";            // Noncompliant\n            string x3 = \"pwd=a\";         // Noncompliant\n\n            string passphrase = \"a\";     // Noncompliant\n            string x4 = \"passphrase=a\";  // Noncompliant\n        }\n\n        public void Constants()\n        {\n            const string ConnectionString = \"Server=localhost; Database=Test; User=SA; Password=Secret123\";                     // Noncompliant\n            const string ConnectionStringWithSpaces = \"Server=localhost; Database=Test; User=SA; Password   =   Secret123\";     // Noncompliant\n            const string inTheMiddle = \"Server=localhost; Database=Test; User=SA; Password=Secret123; Application Name=Sonar\";  // Noncompliant\n            const string withSemicolon = @\"Server=localhost; Database=Test; User=SA; Password=\"\"Secret;'123\"\"\";                 // Noncompliant\n            const string withApostroph = @\"Server=localhost; Database=Test; User=SA; Password='Secret\"\"123\";                    // Noncompliant\n            const string Password = \"Secret123\";  // Noncompliant\n\n            const string LoginName = \"Admin\";\n            const string Localhost = \"localhost\";\n        }\n\n        public void Concatenations(string arg)\n        {\n            var secretVariable = \"literalValue\";\n            var secretVariableConst = secretConst;\n            string secretVariableNull = null;\n            var secretVariableMethod = SomeMethod();\n            string a;\n\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" + \"hardcoded\";        // Noncompliant\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" + secretConst;        // Noncompliant\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" + secretField;        // Noncompliant\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" + secretFieldConst;   // Noncompliant\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" + secretVariable;     // Noncompliant\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" + secretVariableConst;// Noncompliant\n\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" + secretFieldUninitialized;   // Compliant, not initialized to constant\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" + secretFieldNull;            // Compliant, not initialized to constant\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" + secretVariableNull;         // Compliant, not initialized to constant\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" + secretVariableMethod;       // Compliant, not initialized to constant\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" + arg;                        // Compliant, not initialized to constant\n\n            const string passwordPrefixConst = \"Password = \";       // Compliant by its name\n            var passwordPrefixVariable = \"Password = \";             // Compliant by its name\n            a = \"Server = localhost;\" + \" Database = Test; User = SA; Password = \" + secretConst;                   // Noncompliant\n            a = \"Server = localhost;\" + \" Database = Test; User = SA; Pa\" + \"ssword = \" + secretConst;              // FN, we don't track all concatenations to avoid duplications\n            a = \"Server = localhost;\" + \" Database = Test; User = SA; \" + passwordPrefixConst + secretConst;        // Noncompliant\n            a = \"Server = localhost;\" + \" Database = Test; User = SA; \" + passwordPrefixVariable + secretConst;     // Noncompliant\n            a = \"Server = localhost;\" + \" Database = Test; User = SA; Password = \" + secretConst + \" suffix\";       // Noncompliant\n            //  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            a = SomeMethod() + \" Database = Test; User = SA; Password = \" + secretConst + \" suffix\";                // Noncompliant\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" + secretConst + arg + \" suffix\";      // Noncompliant\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" + arg + secretConst + \" suffix\";      // Compliant\n            a = secretConst + \"Server = localhost; Database = Test; User = SA; Password = \" + arg;                  // Compliant\n            a = \"Server = localhost; Database = Test; User = SA; \" + SomeMethod() + secretConst;                    // Compliant\n\n            // Reassigned\n            arg += \"Literal\";\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" + arg;                    // Compliant, += is not a constant propagating operation\n            secretVariableMethod = \"literal\";\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" + secretVariableMethod;   // Noncompliant\n            arg = \"literal\";\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" + arg;                    // Noncompliant\n            secretVariable = SomeMethod();\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" + secretVariable;         // Compliant\n\n            var invalidVariable = invalidVariable; // Error [CS0841] Cannot use local variable invalid before it's declared\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" + invalidVariable;        // Compliant, test to avoid infinite recursion\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" + invalidField;           // Compliant, test to avoid infinite recursion\n        }\n\n        public void Interpolations(string arg)\n        {\n            var secretVariable = \"literalValue\";\n            string a;\n            a = $\"Server = localhost; Database = Test; User = SA; Password = {secretConst}\";        // Noncompliant\n            a = $\"Server = localhost; Database = Test; User = SA; Password = {secretField}\";        // Noncompliant\n            a = $\"Server = localhost; Database = Test; User = SA; Password = {secretVariable}\";     // Noncompliant\n            a = $\"Server = localhost; Database = Test; User = SA; Password = {arg}\";                // Compliant\n            a = $\"Server = localhost; Database = Test; User = SA; Password = {arg}{secretConst}\";   // Compliant\n            a = $@\"Server = localhost; Database = Test; User = SA; Password = {secretConst}\";       // Noncompliant\n        }\n\n        public void StringFormat(string arg, IFormatProvider formatProvider, string[] arr)\n        {\n            var secretVariable = \"literalValue\";\n            string a;\n            a = String.Format(\"Server = localhost; Database = Test; User = SA; Password = {0}\", secretConst);           // Noncompliant\n            a = String.Format(\"Server = localhost; Database = Test; User = SA; Password = {1}\", null, secretConst);     // Noncompliant\n            a = String.Format(\"Server = localhost; Database = Test; User = SA; Password = {1}\", null, secretField);     // Noncompliant\n            a = String.Format(\"Server = localhost; Database = Test; User = SA; Password = {2}\", 0, 0, secretVariable);  // Noncompliant\n            a = String.Format(\"Server = localhost; Database = Test; User = SA; Password = {0}\", arg);                   // Compliant\n            a = String.Format(@\"Server = localhost; Database = Test; User = SA; Password = {0}\", secretConst);          // Noncompliant\n            a = String.Format(formatProvider, \"Database = Test; User = SA; Password = {0}\", secretConst);               // Compliant, we can't simulate formatProvider behavior\n            a = String.Format(\"Server = localhost; Database = Test; User = SA; Password = {0}\", arr);                   // Compliant\n            a = String.Format(\"Server = localhost; Database = Test; User = SA; Password = {invalid}\", secretConst);     // Compliant, the format is invalid and we should not raise\n            a = String.Format(\"Server = localhost; Database = Test; User = SA; Password = invalid {0\", secretConst);    // Compliant, the format is invalid and we should not raise\n            a = String.Format(\"Server = localhost; Database = Test; User = SA; Password = {0:#,0.00}\", arg);            // Compliant\n            a = String.Format(\"Server = localhost; Database = Test; User = SA; Password = {0}{1}{2}\", arg);             // Compliant\n            a = String.Format(\"Server = localhost; Database = Test; User = SA; Password = hardcoded\");                  // Noncompliant\n            a = String.Format(\"Server = localhost; Database = Test; User = {0}; Password = hardcoded\", arg);            // Noncompliant\n            a = String.Format(\"Server = localhost; Database = Test; User = SA; Password = {1}{0}\", arg, secretConst);   // Noncompliant\n            a = String.Format(\"Server = localhost; Database = Test; User = SA; Password = {0}{1}\", arg, secretConst);   // Compliant\n            a = String.Format(\"{0} Argument 1 is not used\",\"Hello\", \"User = SA; Password = hardcoded\");                 // Compliant\n\n            a = String.Format(arg0: secretConst, format: \"Server = localhost; Database = Test; User = SA; Password = {0}\");  // FN, not supported\n        }\n\n        public void RefVariable()\n        {\n            var secret = \"hardcoded\";\n            FillRef(ref secret);\n            var a = \"Server = localhost; Database = Test; User = SA; Password = \" + secret;   // Compliant\n        }\n\n        private void FillRef(ref string arg) =>\n            arg = SomeMethod();\n\n        public void StandardAPI(SecureString secureString, string nonHardcodedPassword, byte[] byteArray, CspParameters cspParams)\n        {\n            const string secretLocalConst = \"hardcodedSecret\";\n            var secretVariable = \"literalValue\";\n            var secretVariableConst = secretConst;\n            string secretVariableNull = null;\n            var secretVariableMethod = SomeMethod();\n            var networkCredential = new NetworkCredential();\n            networkCredential.Password = nonHardcodedPassword;\n            networkCredential.Domain = \"hardcodedDomain\";\n\n            new NetworkCredential(\"username\", secureString);\n            new NetworkCredential(\"username\", nonHardcodedPassword);\n            new NetworkCredential(\"username\", secureString, \"domain\");\n            new NetworkCredential(\"username\", nonHardcodedPassword, \"domain\");\n\n            new PasswordDeriveBytes(nonHardcodedPassword, byteArray);\n            new PasswordDeriveBytes(new byte[] { 1 }, byteArray);\n            new PasswordDeriveBytes(nonHardcodedPassword, byteArray, cspParams);\n            new PasswordDeriveBytes(new byte[] { 1 }, byteArray, cspParams);\n            new PasswordDeriveBytes(nonHardcodedPassword, byteArray, \"strHashName\", 1);\n            new PasswordDeriveBytes(new byte[] { 1 }, byteArray, \"strHashName\", 1);\n            new PasswordDeriveBytes(nonHardcodedPassword, byteArray, \"strHashName\", 1, cspParams);\n            new PasswordDeriveBytes(new byte[] { 1 }, byteArray, \"strHashName\", 1, cspParams);\n\n            new NetworkCredential(\"username\", secretConst);         // Noncompliant {{Please review this hard-coded password.}}\n            new NetworkCredential(\"username\", secretLocalConst);    // Noncompliant {{Please review this hard-coded password.}}\n            new NetworkCredential(\"username\", secretField);         // Noncompliant\n            new NetworkCredential(\"username\", secretFieldConst);    // Noncompliant\n            new NetworkCredential(\"username\", secretVariable);      // Noncompliant\n            new NetworkCredential(\"username\", secretVariableConst); // Noncompliant\n            new NetworkCredential(\"username\", \"hardcoded\");         // Noncompliant {{Please review this hard-coded password.}}\n            new NetworkCredential(\"username\", \"hardcoded\", \"domain\");   // Noncompliant {{Please review this hard-coded password.}}\n            networkCredential.Password = \"hardcoded\";               // Noncompliant\n            networkCredential.Password = secretVariable;            // Noncompliant\n            networkCredential.Password = secretField;               // Noncompliant\n            new PasswordDeriveBytes(\"hardcoded\", byteArray);        // Noncompliant {{Please review this hard-coded password.}}\n            new PasswordDeriveBytes(\"hardcoded\", byteArray, cspParams);                     // Noncompliant {{Please review this hard-coded password.}}\n            new PasswordDeriveBytes(\"hardcoded\", byteArray, \"strHashName\", 1);              // Noncompliant {{Please review this hard-coded password.}}\n            new PasswordDeriveBytes(\"hardcoded\", byteArray, \"strHashName\", 1, cspParams);   // Noncompliant {{Please review this hard-coded password.}}\n\n            // Compliant\n            new NetworkCredential(\"username\", secretFieldUninitialized);\n            new NetworkCredential(\"username\", secretFieldNull);\n            new NetworkCredential(\"username\", secretFieldMethod);\n            new NetworkCredential(\"username\", secretVariableNull);\n            new NetworkCredential(\"username\", secretVariableMethod);\n            networkCredential.Password = secretVariableMethod;\n            networkCredential.Password = secretFieldMethod;\n        }\n\n        public void CompliantParameterUse(string pwd)\n        {\n            string query1 = \"password=?\";\n            string query2 = \"password=:password\";\n            string query3 = \"password=:param\";\n            string query4 = \"password='\" + pwd + \"'\";\n            string query5 = \"password={0}\";\n            string query6 = \"password=;user=;\";\n            string query7 = \"password=:password;user=:user;\";\n            string query8 = \"password=?;user=?;\";\n            string query9 = @\"Server=myServerName\\myInstanceName;Database=myDataBase;Password=:myPassword;User Id=:username;\";\n            using (var conn = OpenConn(\"Server = localhost; Database = Test; User = SA; Password = ?\")) { }\n            using (var conn = OpenConn(\"Server = localhost; Database = Test; User = SA; Password = :password\")) { }\n            using (var conn = OpenConn(\"Server = localhost; Database = Test; User = SA; Password = {0}\")) { }\n            using (var conn = OpenConn(\"Server = localhost; Database = Test; User = SA; Password = \")) { }\n        }\n\n        public void WordInVariableNameAndValue()\n        {\n            // It's compliant when the word is used in name AND the value.\n            const string PASSWORD = \"Password\";\n            const string Password_Input = \"[id='password']\";\n            const string PASSWORD_PROPERTY = \"custom.password\";\n            const string TRUSTSTORE_PASSWORD = \"trustStorePassword\";\n            const string CONNECTION_PASSWORD = \"connection.password\";\n            const string RESET_PASSWORD = \"/users/resetUserPassword\";\n            const string RESET_PASSWORD_CS = \"/uzivatel/resetovat-heslo\"; // Noncompliant, \"heslo\" means \"password\", but we don't translate SEO friendly URL for all languages\n\n            string passwordKey = \"Password\";\n            string passwordProperty = \"config.password.value\";\n            string passwordName = \"UserPasswordValue\";\n            string password = \"Password\";\n            string pwd = \"pwd\";\n            var expression = (password = \"Password\") + (pwd = \"pwd\");\n\n            string myPassword = \"pwd\"; // Noncompliant, different value from word list is used\n        }\n\n        public void UriWithUserInfo(string pwd, string domain)\n        {\n            string n1 = \"scheme://user:azerty123@domain.com\"; // Noncompliant {{Review this hard-coded URI, which may contain a credential.}}\n            string n2 = \"scheme://user:With%20%3F%20Encoded@domain.com\";            // Noncompliant\n            string n3 = \"scheme://user:With!$&'()*+,;=OtherCharacters@domain.com\";  // Noncompliant\n            string n4 = \"scheme://user:Pa$$word:With:Colons@domain.com\";            // Noncompliant\n            string n5 = \"scheme://user:azerty123@\" + domain;                        // Noncompliant\n\n            string c1 = \"scheme://user:\" + pwd + \"@domain.com\";\n            string c2 = \"scheme://user:@domain.com\";\n            string c3 = \"scheme://user@domain.com:80\";\n            string c4 = \"scheme://user@domain.com\";\n            string c5 = \"scheme://domain.com/user:azerty123\";\n            string c6 = String.Format(\"scheme://user:{0}@domain.com\", pwd);\n            string c7 = $\"scheme://user:{pwd}@domain.com\";\n            string c8 = $\"scheme://user:{secretConst}@domain.com\";  // Noncompliant\n\n            string e1 = \"scheme://admin:admin@domain.com\";      // Compliant exception, user and password are the same\n            string e2 = \"scheme://abc:abc@domain.com\";          // Compliant exception, user and password are the same\n            string e3 = \"scheme://a%20;c:a%20;c@domain.com\";    // Compliant exception, user and password are the same\n            string e4 = \"scheme://user:;@domain.com\";           // Compliant exception for implementation purposes\n\n            string html1 = // Noncompliant\n@\"This is article http://login:secret@www.example.com\nEmail: info@example.com\nPhone: +0000000\";\n\n            string html2 =\n@\"This is article http://www.example.com\nEmail: info@example.com\nPhone: +0000000\";\n\n            string html3 = \"This is article http://www.example.com Email: info@example.com Phone: +0000000\";\n            string html4 = \"This is article http://www.example.com<br>Email:info@example.com<br>Phone:+0000000\";\n            string html5 = \"This is article http://user:secret@www.example.com<br>Email:info@example.com<br>Phone:+0000000\"; // Noncompliant\n        }\n\n        public void LiteralAsArgument(string pwd, string server)\n        {\n            using (var conn = new SqlConnection(\"Server = localhost; Database = Test; User = SA; Password = Secret123\")) { } // Noncompliant\n            using (var conn = OpenConn(\"Server = localhost; Database = Test; User = SA; Password = Secret123\")) { } // Noncompliant\n            using (var conn = OpenConn(\"Server = \" + server + \"; Database = Test; User = SA; Password = Secret123\")) { } // Noncompliant\n\n            using (var conn = OpenConn(\"password\")) { }\n            using (var conn = OpenConn(\"Server = localhost; Database = Test; User = SA; Password = \" + pwd)) { }\n        }\n\n        private SqlConnection OpenConn(string connectionString)\n        {\n            var ret = new SqlConnection(connectionString);\n            ret.Open();\n            return ret;\n        }\n\n        public string SecretConnectionStringProperty\n        {\n            get\n            {\n                return \"Server = localhost; Database = Test; User = SA; Password = Secret123\"; // Noncompliant\n            }\n        }\n\n        public string SecretConnectionStringProperty_OK\n        {\n            get\n            {\n                return \"Nothing to see here\";\n            }\n        }\n\n        public string SecretConnectionStringProperty2 => \"Server = localhost; Database = Test; User = SA; Password = Secret123\"; // Noncompliant\n        public string SecretConnectionStringProperty2_OK => \"Nothing to see here\";\n\n        public string SecretConnectionStringProperty3 { get; } = \"Server = localhost; Database = Test; User = SA; Password = Secret123\"; // Noncompliant\n        public string SecretConnectionStringProperty3_OK { get; } = \"Nothing to see here\";\n\n        public string SecretConnectionStringFunction()\n        {\n            return \"Server = localhost; Database = Test; User = SA; Password = Secret123\"; // Noncompliant\n        }\n\n        public string SecretConnectionStringFunction_OK()\n        {\n            return \"Nothing to see here\";\n        }\n\n        public string SecretConnectionStringFunction2() => \"Server = localhost; Database = Test; User = SA; Password = Secret123\"; // Noncompliant\n        public string SecretConnectionStringFunction2_OK() => \"Nothing to see here\";\n\n        public string SecretConnectionStringFunction3() => @\"Server = localhost; Database = Test; User = SA; Password = Secret123\"; // Noncompliant\n        public string SecretConnectionStringFunction3_OK() => @\"Nothing to see here\";\n    }\n\n    class SqlConnection : IDisposable\n    {\n        public SqlConnection(string connectionString) { }\n        public void Open() { }\n        public void Dispose() { }\n    }\n\n    class FalseNegatives\n    {\n        private string password;\n\n        public void Foo(string user)\n        {\n            this.password = \"foo\"; // False Negative\n            Configuration.Password = \"foo\"; // False Negative\n            this.password = Configuration.Password = \"foo\"; // False Negative\n            string query1 = \"password=':crazy;secret';user=xxx\"; // Noncompliant\n        }\n\n        class Configuration\n        {\n            public static string Password { get; set; }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotHardcodeCredentials.DefaultValues.vb",
    "content": "﻿Imports System\nImports System.Net\nImports System.Security\nImports System.Security.Cryptography\n\nNamespace Tests.Diagnostics\n\n    Class Program\n\n        Public Const DBConnectionString As String = \"Server=localhost; Database=Test; User=SA; Password=Secret123\"    ' Noncompliant\n        Public Const EditPasswordPageUrlToken As String = \"{Account.EditPassword.PageUrl}\" ' Compliant\n\n        Private Const SecretConst As String = \"constantValue\"\n        Private SecretField As String = \"literalValue\"\n        Dim SecretFieldConst As String = SecretConst\n        Private SecretFieldUninitialized As String\n        Private SecretFieldNull As String = Nothing\n        Private SecretFieldMethod As String = SomeMethod()\n\n        Private Shared Function SomeMethod() As String\n            Return \"\"\n        End Function\n\n        Public Sub Test(User As String)\n            Dim password As String = \"foo\" 'Noncompliant {{\"password\" detected here, make sure this is not a hard-coded credential.}}\n            '   ^^^^^^^^^^^^^^^^^^^^^^^^^^\n            Dim foo As String, passwd As String = \"a\" 'Noncompliant {{\"passwd\" detected here, make sure this is not a hard-coded credential.}}\n            '                  ^^^^^^^^^^^^^^^^^^^^^^\n            Dim pwdPassword As String = \"a\"     'Noncompliant {{\"pwd and password\" detected here, make sure this is not a hard-coded credential.}}\n            Dim foo2 As String = \"Password=123\" 'Noncompliant\n            Dim bar As String\n            bar = \"Password=p\" 'Noncompliant ^13#18\n\n            Dim obj As Object\n            obj = \"Password=p\" ' Compliant, only assignment To String Is inspected\n\n            foo = \"password\"\n            foo = \"password=\"\n            foo = \"passwordpassword\"\n            foo = \"foo=1;password=1\"    'Noncompliant\n            foo = \"foo=1password=1\"     'Noncompliant\n            foo = \"userpassword=1\"      'Noncompliant\n            foo = \"passwordfield=1\"     'Compliant\n\n            Dim myPassword1 As String = Nothing\n            Dim myPassword2 As String = \"\"\n            Dim myPassword3 As String = \"   \"\n            Dim myPassword4 As String = \"foo\" 'Noncompliant\n            Dim query2 As String = \"password=hardcoded;user='\" + User + \"'\" ' Noncompliant\n        End Sub\n\n        Public Sub DefaultKeywords()\n            Dim password As String = \"a\"       ' Noncompliant\n            Dim x1 As String = \"password=a\"    ' Noncompliant\n\n            Dim passwd As String = \"a\"         ' Noncompliant\n            Dim x2 As String = \"passwd=a\"      ' Noncompliant\n\n            Dim pwd As String = \"a\"            ' Noncompliant\n            Dim x3 As String = \"pwd=a\"         ' Noncompliant\n\n            Dim passphrase As String = \"a\"     ' Noncompliant\n            Dim x4 As String = \"passphrase=a\"  ' Noncompliant\n        End Sub\n\n        Public Sub Constants()\n            Const ConnectionString As String = \"Server=localhost; Database=Test; User=SA; Password=Secret123\"    ' Noncompliant\n            Const ConnectionStringWithSpaces As String = \"Server=localhost; Database=Test; User=SA; Password   =   Secret123\"    ' Noncompliant\n            Const Password As String = \"Secret123\"  ' Noncompliant\n\n            Const LoginName As String = \"Admin\"\n            Const Localhost As String = \"localhost\"\n        End Sub\n\n        Public Sub Concatenations(Arg As String)\n            Dim SecretVariable As String = \"literalValue\"\n            Dim SecretVariableConst As String = SecretConst\n            Dim SecretVariableNull As String = Nothing\n            Dim SecretVariableMethod As String = SomeMethod()\n            Dim a As String\n\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" & \"hardcoded\"           ' Noncompliant\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" + \"hardcoded\"           ' Noncompliant\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" & SecretConst           ' Noncompliant\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" + SecretConst           ' Noncompliant\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" & SecretField           ' Noncompliant\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" + SecretField           ' Noncompliant\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" & SecretFieldConst      ' Noncompliant\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" & SecretVariable        ' Noncompliant\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" + SecretVariable        ' Noncompliant\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" & SecretVariableConst   ' Noncompliant\n\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" & SecretFieldUninitialized  ' Compliant, not initialized to constant\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" & SecretFieldNull           ' Compliant, not initialized to constant\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" & SecretVariableNull        ' Compliant, not initialized to constant\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" & SecretVariableMethod      ' Compliant, not initialized to constant\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" & Arg                       ' Compliant, not initialized to constant\n\n            Const PasswordPrefixConst As String = \"Password = \"         ' Compliant by it's name\n            Dim PasswordPrefixVariable As String = \"Password = \"        ' Compliant by it's name\n            a = \"Server = localhost;\" & \" Database = Test; User = SA; Password = \" & SecretConst                ' Noncompliant\n            a = \"Server = localhost;\" + \" Database = Test; User = SA; Password = \" + SecretConst                ' Noncompliant\n            a = \"Server = localhost;\" & \" Database = Test; User = SA; Pa\" & \"ssword = \" & SecretConst           ' FN, we don't track all concatenations to avoid duplications\n            a = \"Server = localhost;\" & \" Database = Test; User = SA; \" & PasswordPrefixConst & SecretConst     ' Noncompliant\n            a = \"Server = localhost;\" & \" Database = Test; User = SA; \" & PasswordPrefixVariable & SecretConst  ' Noncompliant\n            a = \"Server = localhost;\" & \" Database = Test; User = SA; Password = \" & SecretConst & \" suffix\"    ' Noncompliant\n            '   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            a = SomeMethod() & \" Database = Test; User = SA; Password = \" & SecretConst & \" suffix\"             ' Noncompliant\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" & SecretConst & Arg & \" suffix\"   ' Noncompliant\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" & Arg & SecretConst & \" suffix\"   ' Compliant\n            a = SecretConst & \"Server = localhost; Database = Test; User = SA; Password = \" & Arg               ' Compliant\n            a = \"Server = localhost; Database = Test; User = SA; \" & SomeMethod() & SecretConst                 ' Compliant\n\n            ' Reassigned\n            Arg &= \"Literal\"\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" & Arg                     ' Compliant, &= is not a constant propagating operation\n            SecretVariableMethod = \"literal\"\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" & SecretVariableMethod    ' Noncompliant\n            Arg = \"literal\"\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" & Arg                     ' Noncompliant\n            SecretVariable = SomeMethod()\n            a = \"Server = localhost; Database = Test; User = SA; Password = \" & SecretVariable          ' Compliant\n        End Sub\n\n        Public Sub Interpolations(Arg As String)\n            Dim SecretVariable As String = \"literalValue\"\n            Dim a As String\n            a = $\"Server = localhost; Database = Test; User = SA; Password = {SecretConst}\"         ' Noncompliant\n            a = $\"Server = localhost; Database = Test; User = SA; Password = {SecretField}\"         ' Noncompliant\n            a = $\"Server = localhost; Database = Test; User = SA; Password = {SecretVariable}\"      ' Noncompliant\n            a = $\"Server = localhost; Database = Test; User = SA; Password = {Arg}\"                 ' Compliant\n            a = $\"Server = localhost; Database = Test; User = SA; Password = {Arg}{SecretConst}\"    ' Compliant\n        End Sub\n\n        Public Sub StringFormat(Arg As String, FormatProvider As IFormatProvider, Arr() As String)\n            Dim SecretVariable As String = \"literalValue\"\n            Dim a As String\n\n            a = String.Format(\"Server = localhost; Database = Test; User = SA; Password = {0}\", SecretConst)            ' Noncompliant\n            a = String.Format(\"Server = localhost; Database = Test; User = SA; Password = {1}\", Nothing, SecretConst)   ' Noncompliant\n            a = String.Format(\"Server = localhost; Database = Test; User = SA; Password = {1}\", Nothing, SecretField)   ' Noncompliant\n            a = String.Format(\"Server = localhost; Database = Test; User = SA; Password = {2}\", 0, 0, SecretVariable)   ' Noncompliant\n            a = String.Format(\"Server = localhost; Database = Test; User = SA; Password = {0}\", Arg)                    ' Compliant\n            a = String.Format(FormatProvider, \"Database = Test; User = SA; Password = {0}\", SecretConst)                ' Compliant, we can't simulate formatProvider behavior\n            a = String.Format(\"Server = localhost; Database = Test; User = SA; Password = {0}\", Arr)                    ' Compliant\n            a = String.Format(\"Server = localhost; Database = Test; User = SA; Password = {invalid}\", SecretConst)      ' Compliant, the format is invalid and we should not raise\n            a = String.Format(\"Server = localhost; Database = Test; User = SA; Password = invalid {0\", SecretConst)     ' Compliant, the format is invalid and we should not raise\n            a = String.Format(\"Server = localhost; Database = Test; User = SA; Password = {0:#,0.00}\", Arg)             ' Compliant\n            a = String.Format(\"Server = localhost; Database = Test; User = SA; Password = {0}{1}{2}\", Arg)              ' Compliant\n            a = String.Format(\"Server = localhost; Database = Test; User = SA; Password = hardcoded\")                   ' Noncompliant\n            a = String.Format(\"Server = localhost; Database = Test; User = {0}; Password = hardcoded\", Arg)             ' Noncompliant\n            a = String.Format(\"Server = localhost; Database = Test; User = SA; Password = {1}{0}\", Arg, SecretConst)    ' Noncompliant\n            a = String.Format(\"Server = localhost; Database = Test; User = SA; Password = {0}{1}\", Arg, SecretConst)    ' Compliant\n            a = String.Format(\"{0} Argument 1 is not used\", \"Hello\", \"User = SA; Password = hardcoded\")                 ' Compliant\n\n            a = String.Format(arg0:=SecretConst, format:=\"Server = localhost; Database = Test; User = SA; Password = {0}\")  ' FN, not supported\n        End Sub\n\n        Private Sub ByRefVariable()\n            Dim Secret As String = \"hardcoded\"\n            FillByRef(Secret)\n            Dim A As String = \"Server = localhost; Database = Test; User = SA; Password = \" & Secret   ' Noncompliant FP\n        End Sub\n\n        Private Sub FillByRef(ByRef Arg As String)\n            Arg = SomeMethod()\n        End Sub\n\n        Public Sub StandardAPI(secureString As SecureString, nonHardcodedPassword As String, byteArray As Byte(), cspParams As CspParameters)\n            Const SecretLocalConst As String = \"hardcodedSecret\"\n            Dim SecretVariable As String = \"literalValue\"\n            Dim SecretVariableConst As String = SecretConst\n            Dim SecretVariableNull As String = Nothing\n            Dim SecretVariableMethod As String = SomeMethod()\n            Dim networkCredential = New NetworkCredential()\n            networkCredential.Password = nonHardcodedPassword\n            networkCredential.Domain = \"hardcodedDomain\"\n\n            networkCredential = New NetworkCredential(\"username\", secureString)\n            networkCredential = New NetworkCredential(\"username\", nonHardcodedPassword)\n            networkCredential = New NetworkCredential(\"username\", secureString, \"domain\")\n            networkCredential = New NetworkCredential(\"username\", nonHardcodedPassword, \"domain\")\n\n            Dim passwordDeriveBytes = New PasswordDeriveBytes(nonHardcodedPassword, byteArray)\n            passwordDeriveBytes = New PasswordDeriveBytes(New Byte() {1}, byteArray)\n            passwordDeriveBytes = New PasswordDeriveBytes(nonHardcodedPassword, byteArray, cspParams)\n            passwordDeriveBytes = New PasswordDeriveBytes(New Byte() {1}, byteArray, cspParams)\n            passwordDeriveBytes = New PasswordDeriveBytes(nonHardcodedPassword, byteArray, \"strHashName\", 1)\n            passwordDeriveBytes = New PasswordDeriveBytes(New Byte() {1}, byteArray, \"strHashName\", 1)\n            passwordDeriveBytes = New PasswordDeriveBytes(nonHardcodedPassword, byteArray, \"strHashName\", 1, cspParams)\n            passwordDeriveBytes = New PasswordDeriveBytes(New Byte() {1}, byteArray, \"strHashName\", 1, cspParams)\n\n            networkCredential = New NetworkCredential(\"username\", SecretConst)           ' Noncompliant {{Please review this hard-coded password.}}\n            networkCredential = New NetworkCredential(\"username\", SecretLocalConst)      ' Noncompliant {{Please review this hard-coded password.}}\n            networkCredential = New NetworkCredential(\"username\", SecretField)           ' Noncompliant\n            networkCredential = New NetworkCredential(\"username\", SecretFieldConst)      ' Noncompliant\n            networkCredential = New NetworkCredential(\"username\", SecretVariable)        ' Noncompliant\n            networkCredential = New NetworkCredential(\"username\", SecretVariableConst)   ' Noncompliant\n            networkCredential = New NetworkCredential(\"username\", \"hardcoded\")           ' Noncompliant {{Please review this hard-coded password.}}\n            networkCredential = New NetworkCredential(\"username\", \"hardcoded\", \"domain\") ' Noncompliant {{Please review this hard-coded password.}}\n            networkCredential.Password = \"hardcoded\"                                     ' Noncompliant {{Please review this hard-coded password.}}\n            networkCredential.Password = SecretField                                     ' Noncompliant\n            networkCredential.Password = SecretVariable                                  ' Noncompliant\n            passwordDeriveBytes = New PasswordDeriveBytes(\"hardcoded\", byteArray)                               'Noncompliant {{Please review this hard-coded password.}}\n            passwordDeriveBytes = New PasswordDeriveBytes(\"hardcoded\", byteArray, cspParams)                    'Noncompliant {{Please review this hard-coded password.}}\n            passwordDeriveBytes = New PasswordDeriveBytes(\"hardcoded\", byteArray, \"strHashName\", 1)             'Noncompliant {{Please review this hard-coded password.}}\n            passwordDeriveBytes = New PasswordDeriveBytes(\"hardcoded\", byteArray, \"strHashName\", 1, cspParams)  'Noncompliant {{Please review this hard-coded password.}}\n\n            ' Compliant\n            networkCredential = New NetworkCredential(\"username\", SecretFieldUninitialized)\n            networkCredential = New NetworkCredential(\"username\", SecretFieldNull)\n            networkCredential = New NetworkCredential(\"username\", SecretFieldMethod)\n            networkCredential = New NetworkCredential(\"username\", SecretVariableNull)\n            networkCredential = New NetworkCredential(\"username\", SecretVariableMethod)\n            networkCredential.Password = SecretFieldMethod\n            networkCredential.Password = SecretVariableMethod\n        End Sub\n\n        Public Sub CompliantParameterUse(pwd As String)\n            Dim query1 As String = \"password=?\"\n            Dim query2 As String = \"password=:password\"\n            Dim query3 As String = \"password=:param\"\n            Dim query4 As String = \"password='\" + pwd + \"'\"\n            Dim query5 As String = \"password='\" & pwd & \"'\"\n            Dim query6 As String = \"password={0}\"\n            Dim query7 As String = \"password=;user=;\"\n            Dim query8 As String = \"password=:password;user=:user;\"\n            Dim query9 As String = \"password=?;user=?;\"\n            Dim query10 As String = \"Server=myServerName\\myInstanceName;Database=myDataBase;Password=:myPassword;User Id=:username;\"\n            Using Conn As New SqlConnection(\"Server = localhost; Database = Test; User = SA; Password = ?\")\n            End Using\n            Using Conn As New SqlConnection(\"Server = localhost; Database = Test; User = SA; Password = :password\")\n            End Using\n            Using Conn As New SqlConnection(\"Server = localhost; Database = Test; User = SA; Password = {0}\")\n            End Using\n            Using Conn As New SqlConnection(\"Server = localhost; Database = Test; User = SA; Password = \")\n            End Using\n        End Sub\n\n        Public Sub WordInConstantNameAndValue()\n            ' It's compliant when the word is used in name AND the value.\n            Const PASSWORD As String = \"Password\"\n            Const Password_Input As String = \"[id='password']\"\n            Const PASSWORD_PROPERTY As String = \"custom.password\"\n            Const TRUSTSTORE_PASSWORD As String = \"trustStorePassword\"\n            Const CONNECTION_PASSWORD As String = \"connection.password\"\n            Const RESET_PASSWORD As String = \"/users/resetUserPassword\"\n            Const RESET_PASSWORD_CS As String = \"/uzivatel/resetovat-heslo\" ' Noncompliant, \"heslo\" means \"password\", but we don't translate SEO friendly URL for all languages\n        End Sub\n\n        Public Sub WordInVariableNameAndValue()\n            ' It's compliant when the word is used in name AND the value.\n            Dim PasswordKey As String = \"Password\"\n            Dim PasswordProperty As String = \"config.password.value\"\n            Dim PasswordName As String = \"UserPasswordValue\"\n            Dim Password As String = \"Password\"\n            Dim pwd As String = \"pwd\"\n\n            Dim myPassword As String = \"pwd\"    ' Noncompliant, different value from word list is used\n        End Sub\n\n        Public Sub UriWithUserInfo(Pwd As String, Domain As String)\n            Dim n1 As String = \"scheme://user:azerty123@domain.com\" ' Noncompliant {{Review this hard-coded URI, which may contain a credential.}}\n            Dim n2 As String = \"scheme://user:With%20%3F%20Encoded@domain.com\"              ' Noncompliant\n            Dim n3 As String = \"scheme://user:With!$&'()*+,;=OtherCharacters@domain.com\"    ' Noncompliant\n            Dim n4 As String = \"scheme://user:azerty123@\" + Domain  ' Noncompliant\n            Dim n5 As String = \"scheme://user:azerty123@\" & Domain  ' Noncompliant\n\n            Dim c1 As String = \"scheme://user:\" + Pwd + \"@domain.com\"\n            Dim c2 As String = \"scheme://user:\" & Pwd & \"@domain.com\"\n            Dim c3 As String = \"scheme://user:@domain.com\"\n            Dim c4 As String = \"scheme://user@domain.com:80\"\n            Dim c5 As String = \"scheme://user@domain.com\"\n            Dim c6 As String = \"scheme://domain.com/user:azerty123\"\n            Dim c7 As String = String.Format(\"scheme://user:{0}@domain.com\", Pwd)\n            Dim c8 As String = $\"scheme://user:{Pwd}@domain.com\"\n            Dim c9 As String = $\"scheme://user:{SecretConst}@domain.com\"    ' Noncompliant\n\n            Dim e1 As String = \"scheme://admin:admin@domain.com\"    ' Compliant exception, user and password are the same\n            Dim e2 As String = \"scheme://abc:abc@domain.com\"        ' Compliant exception, user and password are the same\n            Dim e3 As String = \"scheme://a%20;c:a%20;c@domain.com\"  ' Compliant exception, user and password are the same\n            Dim e4 As String = \"scheme://user:;@domain.com\"         ' Compliant exception for implementation purposes\n\n            Dim html1 As String = ' Noncompliant\n\"This is article http://login:secret@www.example.com\nEmail: info@example.com\nPhone: +0000000\"\n\n            Dim html2 As String =\n\"This is article http://www.example.com\nEmail: info@example.com\nPhone: +0000000\"\n\n            Dim html3 As String = \"This is article http://www.example.com Email: info@example.com Phone: +0000000\"\n            Dim html4 As String = \"This is article http://www.example.com<br>Email:info@example.com<br>Phone:+0000000\"\n            Dim html5 As String = \"This is article http://user:secret@www.example.com<br>Email:info@example.com<br>Phone:+0000000\" ' Noncompliant\n        End Sub\n\n        Public Sub LiteralAsArgument(pwd As String, server As String)\n            Using Conn As New SqlConnection(\"Server = localhost; Database = Test; User = SA; Password = Secret123\")  ' Noncompliant\n            End Using\n            Using Conn As SqlConnection = OpenConn(\"Server = localhost; Database = Test; User = SA; Password = Secret123\") ' Noncompliant\n            End Using\n            Using Conn As New SqlConnection(\"Server = \" + server + \"; Database = Test; User = SA; Password = Secret123\") ' Noncompliant\n            End Using\n            Using Conn As New SqlConnection(\"Server = \" & server & \"; Database = Test; User = SA; Password = Secret123\") ' Noncompliant\n            End Using\n\n            Using OpenConn(\"password\")\n            End Using\n            Using Conn As New SqlConnection(\"Server = localhost; Database = Test; User = SA; Password = \" + pwd)\n            End Using\n            Using Conn As New SqlConnection(\"Server = localhost; Database = Test; User = SA; Password = \" & pwd)\n            End Using\n        End Sub\n\n        Private Function OpenConn(connectionString As String) As SqlConnection\n            Dim Ret As New SqlConnection(connectionString)\n            Ret.Open()\n            Return Ret\n        End Function\n\n        Public ReadOnly Property ConnectionStringProperty As String\n            Get\n                Return \"Server = localhost; Database = Test; User = SA; Password = Secret123\" ' Noncompliant\n            End Get\n        End Property\n\n        Public ReadOnly Property ConnectionStringProperty_OK As String\n            Get\n                Return \"Nothing to see here\"\n            End Get\n        End Property\n\n        Public ReadOnly Property ConnectionStringProperty2 As String = \"Server = localhost; Database = Test; User = SA; Password = Secret123\" ' Noncompliant\n        Public ReadOnly Property ConnectionStringProperty2_OK As String = \"Nothing to see here\"\n\n        Public Function ConnectionStringFunction() As String\n            Return \"Server = localhost; Database = Test; User = SA; Password = Secret123\" ' Noncompliant\n        End Function\n\n        Public Function ConnectionStringFunction_OK() As String\n            Return \"Nothing to see here\"\n        End Function\n\n    End Class\n\n    Public Class SqlConnection\n        Implements IDisposable\n\n        Public Sub New(ConnStr As String)\n        End Sub\n\n        Public Sub Open()\n        End Sub\n\n        Public Sub Dispose() Implements IDisposable.Dispose\n        End Sub\n\n    End Class\n\n    Class FalseNegatives\n        Private password As String\n\n        Public Sub Foo(user As String)\n            Me.password = \"foo\" ' False Negative\n            Configuration.Password = \"foo\" ' False Negative\n            Me.password = Configuration.Password = \"foo\" ' False Negative\n            Dim query1 As String = \"password=':crazy;secret';user=xxx\" ' Noncompliant\n        End Sub\n\n        Class Configuration\n            Public Shared Property Password As String\n        End Class\n    End Class\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotHardcodeCredentials.SecureString.cs",
    "content": "﻿using System;\nusing System.Security;\n\nnamespace Tests.Diagnostics\n{\n    class Issue_7323\n    {\n        // https://github.com/SonarSource/sonar-dotnet/issues/7323\n        public void Noncompliant()\n        {\n            using (SecureString securePwd = new SecureString())\n            {\n                for (int i = 0; i < \"AP@ssw0rd\".Length; i++)\n                {\n                    securePwd.AppendChar(\"AP@ssw0rd\"[i]); // Noncompliant {{Please review this hard-coded password.}}\n                }\n\n                // Do something with securePwd\n            }\n        }\n\n        public void Compliant(String password)\n        {\n            using (SecureString securePwd = new SecureString())\n            {\n                for (int i = 0; i < password.Length; i++)\n                {\n                    securePwd.AppendChar(password[i]); // Compliant\n                }\n\n                // Do something with securePwd\n            }\n        }\n    }\n\n    class Tests\n    {\n        public void Characters()\n        {\n            using (var securePwd = new SecureString())\n            {\n                securePwd.AppendChar('P'); // Noncompliant\n                securePwd.AppendChar('a'); // Noncompliant\n                securePwd.AppendChar('s'); // Noncompliant\n                securePwd.AppendChar('s'); // Noncompliant\n                var w = 'w';\n                securePwd.AppendChar(w);   // FN\n            }\n        }\n\n        public void Constant()\n        {\n            const string keyword = \"AP@ssw0rd\";\n            using (SecureString securePwd = new SecureString())\n            {\n                for (int i = 0; i < keyword.Length; i++)\n                {\n                    securePwd.AppendChar(keyword[i]); // Noncompliant\n                }\n\n                // Do something with securePwd\n            }\n        }\n\n        public void ForEachOverString()\n        {\n            using (SecureString securePwd = new SecureString())\n            {\n                foreach (var c in \"AP@ssw0rd\")\n                {\n                    securePwd.AppendChar(c); // Noncompliant\n                }\n\n                // Do something with securePwd\n            }\n        }\n\n        public void FromUnmodifiedVariable_ForLoop()\n        {\n            var keyword = \"AP@ssw0rd\";\n            using (SecureString securePwd = new SecureString())\n            {\n                for (int i = 0; i < keyword.Length; i++)\n                {\n                    securePwd.AppendChar(keyword[i]); // Noncompliant\n                }\n            }\n        }\n\n        public void FromUnmodifiedVariable_ForEachLoop()\n        {\n            var keyword = \"AP@ssw0rd\";\n            using (SecureString securePwd = new SecureString())\n            {\n                foreach(var c in keyword)\n                {\n                    securePwd.AppendChar(c); // Noncompliant\n                }\n            }\n        }\n\n        public void FromBytes()\n        {\n            var bytes = new byte[] { 80, 97, 115, 115, 119, 111, 114, 100 };\n            using (SecureString securePwd = new SecureString())\n            {\n                for (int i = 0; i < bytes.Length; i++)\n                {\n                    securePwd.AppendChar(Convert.ToChar(bytes[i])); // FN.\n                }\n            }\n        }\n\n        public void FromCharArray()\n        {\n            var chars = new char[] { 'P', 'a', 's', 's', 'w', 'o', 'r', 'd' };\n            using (SecureString securePwd = new SecureString())\n            {\n                for (int i = 0; i < chars.Length; i++)\n                {\n                    securePwd.AppendChar(chars[i]); // FN.\n                }\n            }\n        }\n    }\n\n    class AppendCharFromOtherType\n    {\n        void AppendChar(char c) { }\n\n        void Test()\n        {\n            var other = new AppendCharFromOtherType();\n            const string keyword = \"AP@ssw0rd\";\n            for (int i = 0; i < keyword.Length; i++)\n            {\n                other.AppendChar(keyword[i]); // Compliant. Not SecureString.AppendChar\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotHardcodeCredentials.SecureString.vb",
    "content": "﻿Imports System\nImports System.Security\n\nNamespace Tests.Diagnostics\n    Class Issue_7323\n        Public Sub Noncompliant()\n            Using securePwd As SecureString = New SecureString()\n                For i As Integer = 0 To \"AP@ssw0rd\".Length - 1\n                    securePwd.AppendChar(\"AP@ssw0rd\"(i)) ' Noncompliant {{Please review this hard-coded password.}}\n                Next\n            End Using\n        End Sub\n\n        Public Sub Compliant(ByVal password As String)\n            Using securePwd As SecureString = New SecureString()\n                For i As Integer = 0 To password.Length - 1\n                    securePwd.AppendChar(password(i))\n                Next\n            End Using\n        End Sub\n    End Class\n\n    Class Tests\n        Public Sub Characters()\n            Using securePwd = New SecureString()\n                securePwd.AppendChar(\"P\"c) ' Noncompliant\n                securePwd.AppendChar(\"a\"c) ' Noncompliant\n                securePwd.AppendChar(\"s\"c) ' Noncompliant\n                securePwd.AppendChar(\"s\"c) ' Noncompliant\n                Dim w = \"w\"c\n                securePwd.AppendChar(w)    ' FN\n            End Using\n        End Sub\n\n        Public Sub Constant()\n            Const keyword As String = \"AP@ssw0rd\"\n            Using securePwd As SecureString = New SecureString()\n\n                For i As Integer = 0 To keyword.Length - 1\n                    securePwd.AppendChar(keyword(i)) ' Noncompliant\n                Next\n            End Using\n        End Sub\n\n        Public Sub ForEachOverString()\n            Using securePwd As SecureString = New SecureString()\n                For Each c In \"AP@ssw0rd\"\n                    securePwd.AppendChar(c) ' Noncompliant\n                Next\n            End Using\n        End Sub\n\n        Public Sub FromUnmodifiedVariable_ForLoop()\n            Dim keyword = \"AP@ssw0rd\"\n            Using securePwd As SecureString = New SecureString()\n\n                For i As Integer = 0 To keyword.Length - 1\n                    securePwd.AppendChar(keyword(i)) ' Noncompliant\n                Next\n            End Using\n        End Sub\n\n        Public Sub FromUnmodifiedVariable_ForEachLoop()\n            Dim keyword = \"AP@ssw0rd\"\n            Using securePwd As SecureString = New SecureString()\n\n                For Each c In keyword\n                    securePwd.AppendChar(c) ' Noncompliant\n                Next\n            End Using\n        End Sub\n\n        Public Sub FromBytes()\n            Dim bytes = New Byte() {80, 97, 115, 115, 119, 111, 114, 100}\n            Using securePwd As SecureString = New SecureString()\n                For i As Integer = 0 To bytes.Length - 1\n                    securePwd.AppendChar(Convert.ToChar(bytes(i))) ' FN.\n                Next\n            End Using\n        End Sub\n\n        Public Sub FromCharArray()\n            Dim chars = New Char() {\"P\"c, \"a\"c, \"s\"c, \"s\"c, \"w\"c, \"o\"c, \"r\"c, \"d\"c}\n            Using securePwd As SecureString = New SecureString()\n                For i As Integer = 0 To chars.Length - 1\n                    securePwd.AppendChar(chars(i)) ' FN.\n                Next\n            End Using\n        End Sub\n\n        Public Sub FromExpression()\n            Dim chars = New Char() { \"P\"c, \"a\"c, \"s\"c, \"s\"c }\n            Using securePwd As SecureString = New SecureString()\n                For i As Integer = 0 To chars.Length - 1\n                    securePwd.AppendChar(\"a\"c + chars(i)) ' FN.\n                Next\n            End Using\n        End Sub\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotHardcodeSecrets.Latest.cs",
    "content": "﻿using System;\n\npublic class Sample\n{\n    private string auth;\n\n    public void ConditionalAssignment(Sample arg)\n    {\n        arg?.auth = \"rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\";  // Noncompliant\n    }\n\n    public string Auth\n    {\n        get => field;\n        set => field = \"rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\";  // Noncompliant\n    }\n\n    public string WillNotRaise\n    {\n        get => field;\n        set => field = \"rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\";  // Compliant, name does not match\n    }\n}\n\npublic class FieldWithBody\n{\n    public string Auth\n    {\n        get => field;\n        set { field = \"rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\"; }  // Noncompliant\n    }\n}\n\npublic static class Extensions\n{\n    private const string auth = \"rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\";  // Noncompliant\n\n    extension(Exception ex)\n    {\n        public void ShhShh()\n        {\n            string auth = \"rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\";  // Noncompliant\n        }\n\n        public void StaticShhShh()\n        {\n            string auth = \"rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\";  // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotHardcodeSecrets.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\npublic class Program\n{\n    string auth = \"rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\";  // Noncompliant {{\"auth\" detected here, make sure this is not a hard-coded secret.}}\n//                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    string authWithBackSlash = \"rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\";  // Noncompliant\n    string authStartBackSlash = @\"\\mf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\"; //Compliant starts with backslash\n    string authBackSlashIsEscape = \"rf6acB24J//1FZLRrKpj\\tmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\"; // Compliant has escape char\n\n    string willNotRaise = \"rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\"; // Compliant, name doesn't match\n    string authLowEntropy = \"aaaaaaaaaaaaaaaaaaaa\"; // Compliant, low entropy\n\n    string secret = \"1IfHMPanImzX8ZxC-Ud6+YhXiLwlXq$f_-3v~.=\" + \"1IfHMPanImzX8ZxC-Ud6+YhXiLwlXq$f_-3v~.=\";     // Noncompliant\n    string token = \"1IfHMPanImzX8ZxC-Ud6+YhXiLwlXq$f_-3v~.=\";      // Noncompliant\n    string credential = \"1IfHMPanImzX8ZxC-Ud6+YhXiLwlXq$f_-3v~.=\"; // Noncompliant\n    string api_key = \"1IfHMPanImzX8ZxC-Ud6+YhXiLwlXq$f_-3v~.=\";    // Noncompliant\n\n    string END_TOKEN = \"EndGlobalSection\"; // Compliant\n    string AccessControlAllowCredentials = \"Access-Control-Allow-Credentials\"; // Compliant\n    string AuthenticatorApp = \"OrchardCore.Users.2FA.AuthenticatorApp\"; // Compliant\n    string BackOfficeTwoFactorRememberMeAuthenticationType = \"UmbracoTwoFactorRememberMeCookie\"; // Compliant\n    string RequestVerificationToken = \"__RequestVerificationToken\";\n    string TokenPasswordResetCode = \"PasswordResetCode\"; // Compliant\n    string AuthenticationServiceName = \"marketplacecommerceanalytics\";\n    string XAmzSecurityToken = \"X-Amz-Security-Token\";\n    string ProductPublicKeyToken = \"31bf3856ad364e35\"; // Compliant, in Banlist\n    static string OfficialDesktopPublicKeyToken = \"b03f5f7f11d50a3a\"; // Compliant, in Banlist\n    string VisualBasicAssemblyPublicKeyToken = \"PublicKeyToken=\" + OfficialDesktopPublicKeyToken; // Compliant as it has 'Token' in name AND in value\n\n    string varStrings = \"PublicKeyToken=31bf3856ad364e35;\"; // Compliant, in Banlist\n    string varStringer = \"PublicKeyToken=31bf3856ad364e35; Secret=31bf3856ad364e35\"; // Noncompliant\n\n    string varString = \"token=rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\"; // Noncompliant {{\"token\" detected here, make sure this is not a hard-coded secret.}}\n    string secretString = \"token=rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\"; // Noncompliant {{\"secretString\" detected here, make sure this is not a hard-coded secret.}}\n\n    public class Test\n    {\n        Scaffold api = new Scaffold();\n        string p_auth = \"rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\";  // Noncompliant\n\n        string x_auth { get; set; } = \"rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\";  // Noncompliant\n\n        string y_auth\n        {\n            get => \"rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\";  // Noncompliant\n            set => y_auth = \"rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\";  // Noncompliant\n        }\n\n        string z_auth\n        {\n            get\n            {\n                return \"rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\";  // FN\n            }\n            set\n            {\n                z_auth = \"rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\";  // Noncompliant\n            }\n        }\n\n        public void SeaShark7VariableDeclaration()\n        {\n            api.key = \"1IfHMPanImzX8ZxC-Ud6+YhXiLwlXq$f_-3v~.=\"; // Compliant\n\n            var d_auth = \"rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\";  // Noncompliant\n            d_auth += \"rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\";  // Noncompliant\n            d_auth = \"rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\";  // Noncompliant\n\n            var c_auth = \"a\";\n            c_auth = c_auth + \"rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\";  // Compliant does not compile to a constant\n\n            var authToken = \"\";\n            var shouldNotRaise = \":)\";\n            if (authToken == \"31bf3856ad364e35\") {}// Noncompliant\n            else if (\"b03f5f7f11d50a3a\" == authToken) {} // Noncompliant\n            else if(shouldNotRaise == \"31bf3856ad364e35\") {} // Compliant\n            else if(\"31bf3856ad364e35\" == shouldNotRaise) {} // Compliant\n            if (\"31bf3856ad364e35\".Equals(authToken)){ } // Noncompliant\n            if (authToken.Equals(\"31bf3856ad364e35\")) { } // Noncompliant\n            if (\"31bf3856ad364e35\".Equals(shouldNotRaise)){ } // Compliant\n            if (shouldNotRaise.Equals(\"31bf3856ad364e35\")) { } // Compliant\n\n            \"AuthToken\".Equals(\"31bf3856ad364e35\"); // Compliant\n            authToken.Equals(shouldNotRaise); // Compliant\n            shouldNotRaise.Equals(null); // Compliant\n            \"AuthToken\".Equals(null); // Compliant\n\n            \"31bf3856ad364e35\".Equals(authToken, StringComparison.CurrentCulture);      // Noncompliant\n            authToken.Equals(\"31bf3856ad364e35\", StringComparison.CurrentCulture);      // Noncompliant\n\n            var bar = new Bar();\n            var foo = new Foo();\n\n            if (bar.test.test.ShouldNotRaise.Equals(\"31bf3856ad364e35\")) { }        // Compliant\n            if(\"31bf3856ad364e35\".Equals(bar.test.test.ShouldNotRaise)) { }         // Compliant\n            if (bar.test.test.Token.Equals(\"31bf3856ad364e35\")) { }                 // Noncompliant\n            if(\"31bf3856ad364e35\".Equals(bar.test.test.Token)) { }                  // Noncompliant\n\n            if (foo.GetToken().Equals(\"31bf3856ad364e35\")) { }                      // Compliant not string.Equals\n            if (foo.GetAuthToken().Equals(\"31bf3856ad364e35\")) { }                  // Noncompliant\n            if (\"31bf3856ad364e35\".Equals(foo.GetToken())) { }                      // Noncompliant\n            if (foo.GetToken().test.Equals(\"31bf3856ad364e35\")) { }                 // Compliant\n            if (\"31bf3856ad364e35\".Equals(foo.GetToken().test)) { }                 // Compliant\n\n            string.Equals(\"31bf3856ad364e35\", authToken);                                                           // Compliant FN\n            string.Equals(authToken, \"31bf3856ad364e35\");                                                           // Compliant FN\n            string.Equals(\"31bf3856ad364e35\", authToken, StringComparison.CurrentCulture);                          // Compliant FN\n            string.Equals(comparisonType: StringComparison.CurrentCulture, a: \"31bf3856ad364e35\", b: authToken);    // Compliant FN\n            StringComparer.InvariantCulture.Equals(\"31bf3856ad364e35\", authToken);                                  // Compliant FN\n            StringComparer.InvariantCulture.Equals(authToken, \"31bf3856ad364e35\");                                  // Compliant FN\n            EqualityComparer<string>.Default.Equals(\"31bf3856ad364e35\", authToken);                                 // Compliant FN\n            EqualityComparer<string>.Default.Equals(authToken, \"31bf3856ad364e35\");                                 // Compliant FN\n            if (\"31bf3856ad364e35\" is \"authToken\") { }                                                              // Compliant FN\n            if(\"authToken\" is \"31bf3856ad364e35\") { }                                                               // Compliant FN\n            switch (authToken)\n            {\n                case \"31bf3856ad364e35\":                                                                            // Compliant FN\n                    break;\n            }\n        }\n    }\n\n    public class Foo\n    {\n        public Bar GetToken() => new Bar();\n        public string GetAuthToken() => \"31bf3856ad364e35\";\n    }\n\n    public class Bar\n    {\n        public Bar test = new Bar();\n        public string ShouldNotRaise;\n        public string Token;\n    }\n\n    public class Scaffold\n    {\n        public string key { get; set; }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotHardcodeSecrets.vb",
    "content": "﻿\nPublic Class NamesAndValues\n\n    Private Auth As String = \"rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\"  ' Noncompliant {{\"Auth\" detected here, make sure this is not a hard-coded secret.}}\n    '                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    Private AuthWithBackSlash As String = \"rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\"        ' Noncompliant\n    Private AuthStartBackSlash As String = \"\\mf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\"     ' Compliant starts with backslash\n    Private AuthBackSlashIsEscape As String = \"rf6acB24J//1FZLRrKpj\\tmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\"  ' Compliant has escape char\n\n    Private WillNotRaise As String = \"rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\"             ' Compliant, name does not match\n    Private AuthLowEntropy As String = \"aaaaaaaaaaaaaaaaaaaa\"                   ' Compliant, low entropy\n\n    Private Secret As String = \"1IfHMPanImzX8ZxC-Ud6+YhXiLwlXq$f_-3v~.=\" + \"1IfHMPanImzX8ZxC-Ud6+YhXiLwlXq$f_-3v~.=\"    ' Noncompliant\n    Private Token As String = \"1IfHMPanImzX8ZxC-Ud6+YhXiLwlXq$f_-3v~.=\"         ' Noncompliant\n    Private Credential As String = \"1IfHMPanImzX8ZxC-Ud6+YhXiLwlXq$f_-3v~.=\"    ' Noncompliant\n    Private Api_Key As String = \"1IfHMPanImzX8ZxC-Ud6+YhXiLwlXq$f_-3v~.=\"       ' Noncompliant\n\n    Private END_TOKEN As String = \"EndGlobalSection\"                                        ' Compliant\n    Private AccessControlAllowCredentials As String = \"Access-Control-Allow-Credentials\"    ' Compliant\n    Private AuthenticatorApp As String = \"OrchardCore.Users.2FA.AuthenticatorApp\"           ' Compliant\n    Private BackOfficeTwoFactorRememberMeAuthenticationType As String = \"UmbracoTwoFactorRememberMeCookie\" ' Compliant\n    Private RequestVerificationToken As String = \"__RequestVerificationToken\"\n    Private TokenPasswordResetCode As String = \"PasswordResetCode\"                          ' Compliant\n    Private AuthenticationServiceName As String = \"marketplacecommerceanalytics\"\n    Private XAmzSecurityToken As String = \"X-Amz-Security-Token\"\n    Private ProductPublicKeyToken As String = \"31bf3856ad364e35\"                            ' Compliant, in Banlist\n    Private Shared OfficialDesktopPublicKeyToken As String = \"b03f5f7f11d50a3a\"             ' Compliant, In Banlist\n    Private VisualBasicAssemblyPublicKeyToken_Ampersant As String = \"PublicKeyToken=\" & OfficialDesktopPublicKeyToken   ' Compliant as it has 'Token' in name AND in value\n    Private VisualBasicAssemblyPublicKeyToken_Plus As String = \"PublicKeyToken=\" + OfficialDesktopPublicKeyToken        ' Compliant as it has 'Token' in name AND in value\n\n    Private VarStrings As String = \"PublicKeyToken=31bf3856ad364e35;\"                            ' Compliant, in Banlist\n    Private VarStringer As String = \"PublicKeyToken=31bf3856ad364e35; Secret=31bf3856ad364e35\"   ' Noncompliant\n\n    Private VarString As String = \"token=rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\"      ' Noncompliant {{\"token\" detected here, make sure this is not a hard-coded secret.}}\n    Private SecretString As String = \"token=rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\"   ' Noncompliant {{\"SecretString\" detected here, make sure this is not a hard-coded secret.}}\n\nEnd Class\n\nPublic Class Usages\n\n    Private Api As New Scaffold()\n    Public Field_Auth As String = \"rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\"                    ' Noncompliant\n    Public Property AutoProperty_Auth As String = \"rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\"    ' Noncompliant\n\n    Public Property Property_auth As String\n        Get\n            Return \"rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\"           ' FN\n        End Get\n        Set(value As String)\n            Field_Auth = \"rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\"     ' Noncompliant\n        End Set\n    End Property\n\n    Public Sub Concat()\n        Api.Key = \"1IfHMPanImzX8ZxC-Ud6+YhXiLwlXq$f_-3v~.=\"     ' Compliant\n\n        Dim d_auth As String = \"rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\"   ' Noncompliant\n        d_auth += \"rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\"                ' Noncompliant\n        d_auth &= \"rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\"                ' Noncompliant\n        d_auth = \"rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\"                 ' Noncompliant\n\n        Dim c_auth As String = \"a\"\n        c_auth = c_auth + \"rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\"        ' Compliant does not compile to a constant\n        c_auth = c_auth & \"rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\"        ' Compliant does not compile to a constant\n\n    End Sub\n\n    Public Sub Comparison()\n        Dim AuthToken As String = \"\"\n        Dim ShouldNotRaise As String = \":)\"\n        If AuthToken = \"31bf3856ad364e35\" Then                      ' Noncompliant\n        ElseIf \"b03f5f7f11d50a3a\" = AuthToken Then                  ' Noncompliant\n        ElseIf ShouldNotRaise = \"31bf3856ad364e35\" Then             ' Compliant\n        ElseIf \"31bf3856ad364e35\" = ShouldNotRaise Then             ' Compliant\n        End If\n        If \"31bf3856ad364e35\".Equals(AuthToken) Then : End If       ' Noncompliant\n        If AuthToken.Equals(\"31bf3856ad364e35\") Then : End If       ' Noncompliant\n        If \"31bf3856ad364e35\".Equals(ShouldNotRaise) Then : End If  ' Compliant\n        If ShouldNotRaise.Equals(\"31bf3856ad364e35\") Then : End If  ' Compliant\n\n        If \"31bf3856ad364e35\" Is \"authToken\" Then : End If                                                      ' Compliant FN\n        If \"authToken\" Is \"31bf3856ad364e35\" Then : End If                                                      ' Compliant FN\n        Select Case AuthToken\n            Case \"31bf3856ad364e35\"                                                                             ' Compliant FN\n        End Select\n    End Sub\n\n    Public Sub EqualsMethods()\n        Dim AuthToken As String = \"\"\n        Dim ShouldNotRaise As String = \":)\"\n        Dim Bool As Boolean = \"AuthToken\".Equals(\"31bf3856ad364e35\") ' Compliant\n        AuthToken.Equals(ShouldNotRaise)    ' Compliant\n        ShouldNotRaise.Equals(Nothing)      ' Compliant\n        Bool = \"AuthToken\".Equals(Nothing)  ' Compliant\n\n        Bool = \"31bf3856ad364e35\".Equals(AuthToken, StringComparison.CurrentCulture)    ' Noncompliant\n        AuthToken.Equals(\"31bf3856ad364e35\", StringComparison.CurrentCulture)           ' Noncompliant\n\n        Dim Values As New CustomValues\n        Dim Provider As New CustomProvider\n\n        If Values.Test.Test.ShouldNotRaise.Equals(\"31bf3856ad364e35\") Then : End If     ' Compliant\n        If \"31bf3856ad364e35\".Equals(Values.Test.Test.ShouldNotRaise) Then : End If     ' Compliant\n        If Values.Test.Test.Token.Equals(\"31bf3856ad364e35\") Then : End If              ' Noncompliant\n        If \"31bf3856ad364e35\".Equals(Values.Test.Test.Token) Then : End If              ' Noncompliant\n\n        If Provider.GetToken().Equals(\"31bf3856ad364e35\") Then : End If                 ' Compliant not String.Equals\n        If Provider.GetAuthToken().Equals(\"31bf3856ad364e35\") Then : End If             ' Noncompliant\n        If \"31bf3856ad364e35\".Equals(Provider.GetToken()) Then : End If                 ' Noncompliant\n        If Provider.GetToken().Test.Equals(\"31bf3856ad364e35\") Then : End If            ' Compliant\n        If \"31bf3856ad364e35\".Equals(Provider.GetToken().Test) Then : End If            ' Compliant\n\n        String.Equals(\"31bf3856ad364e35\", AuthToken)                                                            ' Compliant FN\n        String.Equals(AuthToken, \"31bf3856ad364e35\")                                                            ' Compliant FN\n        String.Equals(\"31bf3856ad364e35\", AuthToken, StringComparison.CurrentCulture)                           ' Compliant FN\n        String.Equals(comparisonType:=StringComparison.CurrentCulture, a:=\"31bf3856ad364e35\", b:=AuthToken)     ' Compliant FN\n        StringComparer.InvariantCulture.Equals(\"31bf3856ad364e35\", AuthToken)                                   ' Compliant FN\n        StringComparer.InvariantCulture.Equals(AuthToken, \"31bf3856ad364e35\")                                   ' Compliant FN\n        EqualityComparer(Of String).Default.Equals(\"31bf3856ad364e35\", AuthToken)                               ' Compliant FN\n        EqualityComparer(Of String).Default.Equals(AuthToken, \"31bf3856ad364e35\")                               ' Compliant FN\n    End Sub\n\nEnd Class\n\nPublic Class CustomProvider\n\n    Public Function GetToken() As CustomValues\n        Return New CustomValues\n    End Function\n\n    Public Function GetAuthToken() As String\n        Return \"31bf3856ad364e35\"\n    End Function\n\nEnd Class\n\nPublic Class CustomValues\n\n    Public Test As New CustomValues\n    Public ShouldNotRaise As String\n    Public Token As String\n\nEnd Class\n\nPublic Class Scaffold\n\n    Public Property Key As String\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotHideBaseClassMethods.Concurrent.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace AppendedNamespaceForConcurrencyTest.MyLibrary\n{\n    class Foo\n    {\n        public void SomePublicMethod(string s1, string s2) { }\n\n        protected void SomeProtectedMethod(string s1, string s2) { }\n\n        private void SomePrivateMethod(string s1, string s2) { }\n\n        public void GenericMethod<T>(T s1, string s2) { }\n\n        public void GenericMethod2<T>(IEnumerable<T> s1, string s2) { }\n    }\n\n    class Bar : Foo\n    {\n        public void SomePublicMethod(string s1, object s2) { } // Noncompliant {{Remove or rename that method because it hides 'AppendedNamespaceForConcurrencyTest.MyLibrary.Foo.SomePublicMethod(string, string)'.}}\n//                  ^^^^^^^^^^^^^^^^\n        protected void SomeProtectedMethod(string s1, object o2) { } // Noncompliant\n\n        private void SomePrivateMethod(string s1, object o2) { }\n\n        public void SomePublicMethod(string s1, string s2) { }\n\n        public void GenericMethod<TType>(TType s1, object s2) { } // Noncompliant\n\n        public void GenericMethod2<T>(IEnumerable<T> s1, object s2) { } // Noncompliant\n    }\n\n    class Bar2 : Foo\n    {\n    }\n\n    class Bar3 : Bar2\n    {\n        public void SomePublicMethod(string s1, object o2) { } // Noncompliant\n    }\n\n\n    class MultipleOverloadsBase\n    {\n        public bool Method1(object obj) => true;\n\n        public bool Method1(string obj) => true;\n    }\n\n    class MultipleOverloadsDerived : MultipleOverloadsBase\n    {\n        public bool Method1(object obj) => true;\n    }\n}\n\nnamespace AppendedNamespaceForConcurrencyTest.OtherNamespace\n{\n    class Class1\n    {\n        internal void SomeMethod(string s) { }\n    }\n\n    class Class2 : Class1\n    {\n        void SomeMethod(object s) { } // Noncompliant\n    }\n}\n\nnamespace AppendedNamespaceForConcurrencyTest.MyNamespace\n{\n    class Class3 : AppendedNamespaceForConcurrencyTest.OtherNamespace.Class1\n    {\n        void SomeMethod(object s) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotHideBaseClassMethods.Latest.cs",
    "content": "﻿using System.Collections.Generic;\n\nnamespace MyLibrary\n{\n    public record Base\n    {\n        public void SomePublicMethod(string s1, string s2) { }\n\n        public void AnotherPublicMethod(string s1, string s2) { }\n\n        protected void SomeProtectedMethod(string s1, string s2) { }\n\n        protected void SomeProtectedMethod(string s1, int s2) { }\n\n        private void SomePrivateMethod(string s1, string s2) { }\n\n        public void GenericMethod<T>(T s1, string s2) { }\n\n        public void GenericMethod2<T>(IEnumerable<T> s1, string s2) { }\n    }\n\n    record Bar : Base\n    {\n        public void SomePublicMethod(string s1, object s2) { } // Noncompliant {{Remove or rename that method because it hides 'MyLibrary.Base.SomePublicMethod(string, string)'.}}\n        protected void SomeProtectedMethod(string s1, object o2) { } // Noncompliant\n\n        private void SomePrivateMethod(string s1, object o2) { }\n\n        public void SomePublicMethod(string s1, string s2) { }\n\n        public void GenericMethod<TType>(TType s1, object s2) { } // Noncompliant\n\n        public void GenericMethod2<T>(IEnumerable<T> s1, object s2) { } // Noncompliant\n    }\n\n    record Bar2 : Base\n    {\n    }\n\n    record Bar3 : Bar2\n    {\n        public void SomePublicMethod(string s1, object o2) { } // Noncompliant\n    }\n\n\n    record MultipleOverloadsBase\n    {\n        public bool Method1(object obj) => true;\n\n        public bool Method1(string obj) => true;\n    }\n\n    record MultipleOverloadsDerived : MultipleOverloadsBase\n    {\n        public bool Method1(object obj) => true;\n    }\n\n    record PrimaryConstructorBase(string X)\n    {\n        public void Method(string s1) { }\n    }\n\n    record Derived(string X) : PrimaryConstructorBase(X)\n    {\n        public void Method(object s1) { } // Noncompliant {{Remove or rename that method because it hides 'MyLibrary.PrimaryConstructorBase.Method(string)'.}}\n    }\n\n    interface IMyInterface\n    {\n        static virtual string SomeMethod(string s1, string s2) => $\"{s1}{s2}\";\n    }\n\n    class IMyClass : IMyInterface\n    {\n        static string SomeMethod(string s1, object s2) => \"With object\"; // Compliant\n    }\n}\n\nnamespace OtherNamespace\n{\n    record Class1\n    {\n        internal void SomeMethod(string s) { }\n    }\n\n    record Class2 : Class1\n    {\n        void SomeMethod(object s) { } // Noncompliant\n    }\n}\n\nnamespace MyNamespace\n{\n    record Class3 : OtherNamespace.Class1\n    {\n        void SomeMethod(object s) { }\n    }\n}\n\npublic static class Extensions\n{\n    public static void SomePublicMethod(MyLibrary.Base sender, string s1, object s2) { } // Compliant, it's an extension method\n\n    extension(MyLibrary.Base sender)\n    {\n        public void AnotherPublicMethod(string s1, string s2) { } // Compliant, it's an extension method\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotHideBaseClassMethods.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace MyLibrary\n{\n    class Foo\n    {\n        public void SomePublicMethod(string s1, string s2) { }\n\n        protected void SomeProtectedMethod(string s1, string s2) { }\n\n        private void SomePrivateMethod(string s1, string s2) { }\n\n        public void GenericMethod<T>(T s1, string s2) { }\n\n        public void GenericMethod2<T>(IEnumerable<T> s1, string s2) { }\n    }\n\n    class Bar : Foo\n    {\n        public void SomePublicMethod(string s1, object s2) { } // Noncompliant {{Remove or rename that method because it hides 'MyLibrary.Foo.SomePublicMethod(string, string)'.}}\n//                  ^^^^^^^^^^^^^^^^\n        protected void SomeProtectedMethod(string s1, object o2) { } // Noncompliant\n\n        private void SomePrivateMethod(string s1, object o2) { }\n\n        public void SomePublicMethod(string s1, string s2) { }\n\n        public void GenericMethod<TType>(TType s1, object s2) { } // Noncompliant\n\n        public void GenericMethod2<T>(IEnumerable<T> s1, object s2) { } // Noncompliant\n    }\n\n    class Bar2 : Foo\n    {\n    }\n\n    class Bar3 : Bar2\n    {\n        public void SomePublicMethod(string s1, object o2) { } // Noncompliant\n    }\n\n\n    class MultipleOverloadsBase\n    {\n        public bool Method1(object obj) => true;\n\n        public bool Method1(string obj) => true;\n    }\n\n    class MultipleOverloadsDerived : MultipleOverloadsBase\n    {\n        public bool Method1(object obj) => true;\n    }\n}\n\nnamespace OtherNamespace\n{\n    class Class1\n    {\n        internal void SomeMethod(string s) { }\n    }\n\n    class Class2 : Class1\n    {\n        void SomeMethod(object s) { } // Noncompliant\n    }\n}\n\nnamespace MyNamespace\n{\n    class Class3 : OtherNamespace.Class1\n    {\n        void SomeMethod(object s) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotInstantiateSharedClasses.cs",
    "content": "﻿using System.ComponentModel.Composition;\n\nnamespace Tests.Diagnostics\n{\n    [PartCreationPolicy(CreationPolicy.Shared)]\n    class SharedClass {}\n\n    [System.ComponentModel.Composition.PartCreationPolicy(System.ComponentModel.Composition.CreationPolicy.Shared)]\n    class SharedClassFullNamespace { }\n\n    [PartCreationPolicy(CreationPolicy.NonShared)]\n    class NonSharedClass { }\n\n    [PartCreationPolicy(CreationPolicy.Any)]\n    class AnyClass { }\n\n    [PartCreationPolicy(Foo)] // Error [CS0103] - Foo doesn't exist\n    class InvalidAttrParameter { }\n\n    [PartCreationPolicy()] // Error [CS7036]\n    class NoAttrParameter { }\n\n    class NoAttr { }\n\n    class Program\n    {\n        public void Bar()\n        {\n            new SharedClass(); // Noncompliant {{Refactor this code so that it doesn't invoke the constructor of this class.}}\n//          ^^^^^^^^^^^^^^^^^\n            new SharedClassFullNamespace(); // Noncompliant\n            new NonSharedClass();\n            new AnyClass();\n            new InvalidAttrParameter();\n            new NoAttrParameter();\n            new NoAttr();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotInstantiateSharedClasses.vb",
    "content": "﻿Imports System.ComponentModel.Composition\n\nNamespace Tests.Diagnostics\n    <PartCreationPolicy(CreationPolicy.Shared)>\n    Class SharedClass\n    End Class\n\n    <System.ComponentModel.Composition.PartCreationPolicy(System.ComponentModel.Composition.CreationPolicy.Shared)>\n    Class SharedClassFullNamespace\n    End Class\n\n    <PartCreationPolicy(CreationPolicy.NonShared)>\n    Class NonSharedClass\n    End Class\n\n    <PartCreationPolicy(CreationPolicy.Any)>\n    Class AnyClass\n    End Class\n\n    ' Error@+1 [BC30451] - Foo doesn't exist\n    <PartCreationPolicy(Foo)>\n    Class InvalidAttrParameter\n    End Class\n\n    ' Error@+1 [BC30455] Argument not specified for parameter 'creationPolicy' of ...\n    <PartCreationPolicy()>\n    Class NoAttrParameter\n    End Class\n\n    Class NoAttr\n    End Class\n\n    Class Program\n        Sub Foo()\n            Dim x1 = New SharedClass() ' Noncompliant {{Refactor this code so that it doesn't invoke the constructor of this class.}}\n'                    ^^^^^^^^^^^^^^^^^\n            Dim x2 = New SharedClassFullNamespace() ' Noncompliant\n            Dim x3 = New NonSharedClass()\n            Dim x4 = New AnyClass()\n            Dim x5 = New InvalidAttrParameter()\n            Dim x6 = New NoAttrParameter()\n            Dim x7 = New NoAttr()\n        End Sub\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotLockOnSharedResource.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Threading;\n\nnamespace Tests.Diagnostics\n{\n    public class LockOnThisOrType(string myStringField)\n    {\n        public void RawStringLiterals()\n        {\n            lock (\"\"\"foo\"\"\") // Noncompliant\n            { }\n        }\n\n        void NewlinesInStringInterpolation()\n        {\n            string s = \"test\";\n            lock ($\"{s\n                .ToUpper()}\")\n            { }\n            // Noncompliant@-3\n        }\n\n        public void MyLockingMethod()\n        {\n            lock (myStringField) // Noncompliant\n            { }\n        }\n\n        public void EscapeChar()\n        {\n            lock (\"\\e\") // Noncompliant\n            { }\n        }\n    }\n\n    public class LockOnLockType\n    {\n        private Lock _lock;\n        public void LockOnLock()\n        {\n            lock (_lock) // Compliant\n            { }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotLockOnSharedResource.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public class LockOnThisOrType\n    {\n        private string myStringField;\n\n        public void MyLockingMethod()\n        {\n            lock (this) // Noncompliant\n//                ^^^^\n            {\n                // ...\n            }\n\n            lock (lockObj)\n            {\n                // ...\n            }\n\n            lock (typeof(LockOnThisOrType)) // Noncompliant\n//                ^^^^^^^^^^^^^^^^^^^^^^^^\n            {\n                // ...\n            }\n            lock ((new LockOnThisOrType()).GetType()) // Noncompliant {{Lock on a dedicated object instance instead.}}\n            {\n                // ...\n            }\n            lock (\"foo\") // Noncompliant\n            {\n            }\n            lock (myStringField) // Noncompliant\n            {\n            }\n        }\n\n        object lockObj = new object();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotLockOnSharedResource.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\n\nNamespace Tests.Diagnostics\n    Public Class LockOnThisOrType\n        Dim MyStringField As String\n\n        Public Sub MyLockingMethod()\n            SyncLock Me ' Noncompliant {{Lock on a dedicated object instance instead.}}\n'                    ^^\n            End SyncLock\n\n            SyncLock lockObj\n            End SyncLock\n\n            SyncLock GetType(LockOnThisOrType) ' Noncompliant\n'                    ^^^^^^^^^^^^^^^^^^^^^^^^^\n            End SyncLock\n\n            SyncLock (New LockOnThisOrType()).[GetType]() ' Noncompliant\n'                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            End SyncLock\n\n            SyncLock (\"foo\") ' Noncompliant\n            End SyncLock\n\n            SyncLock (MyStringField) ' Noncompliant\n\n            End SyncLock\n\n        End Sub\n\n        Dim lockObj As New Object()\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotLockWeakIdentityObjects.Latest.cs",
    "content": "﻿using System;\nusing System.Threading;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        private string rawStringLiterals = \"\"\"some value\"\"\";\n\n        private void Test()\n        {\n            lock (rawStringLiterals) { } // Noncompliant\n        }\n    }\n\n    public class LockOnLockType\n    {\n        private Lock _lock;\n        public void LockOnLock()\n        {\n            lock (_lock) // Compliant\n            { }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotLockWeakIdentityObjects.cs",
    "content": "﻿using System;\nusing System.Reflection;\nusing System.Threading;\n\nnamespace Tests.Diagnostics\n{\n    class DoNotLockWeakIdentityObjects\n    {\n        private object synchronized = new object();\n        private MarshalByRefObject marshalByRefObject = new Timer(null);\n        private Timer marshalByRefObjectDerivate = new Timer(null);\n        private ExecutionEngineException executionEngineException = new ExecutionEngineException();\n        private OutOfMemoryException outOfMemoryException = new OutOfMemoryException();\n        private StackOverflowException stackOverflowException = new StackOverflowException();\n        private string aString = \"some value\";\n        private MemberInfo memberInfo = typeof(string).GetProperty(\"Length\");\n        private ParameterInfo parameterInfo = typeof(string).GetMethod(\"Equals\").ReturnParameter;\n        private Thread thread = new Thread((ThreadStart)null);\n\n        private void Test()\n        {\n            lock (synchronized) { } // Compliant\n\n            lock (marshalByRefObject) { } // Noncompliant {{Replace this lock on 'MarshalByRefObject' with a lock against an object that cannot be accessed across application domain boundaries.}}\n//                ^^^^^^^^^^^^^^^^^^\n            lock (marshalByRefObjectDerivate) { } // Noncompliant {{Replace this lock on 'Timer' with a lock against an object that cannot be accessed across application domain boundaries.}}\n            lock (executionEngineException) { } // Noncompliant\n            lock (outOfMemoryException) { } // Noncompliant\n            lock (stackOverflowException) { } // Noncompliant\n            lock (aString) { } // Noncompliant\n            lock (memberInfo) { } // Noncompliant\n            lock (parameterInfo) { } // Noncompliant\n            lock (thread) { } // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotLockWeakIdentityObjects.vb",
    "content": "﻿Imports System\nImports System.Reflection\nImports System.Threading\n\nPublic Class DoNotLockWeakIdentityObjects\n\n    Private synchronized As New Object()\n    Private marshalByRefObject As MarshalByRefObject = New Timer(Nothing)\n    Private marshalByRefObjectDerivate As New Timer(Nothing)\n    Private executionEngineException As New ExecutionEngineException()\n    Private outOfMemoryException As New OutOfMemoryException()\n    Private stackOverflowException As New StackOverflowException()\n    Private aString As String = \"some value\"\n    Private memberInfo As MemberInfo = GetType(String).GetProperty(\"Length\")\n    Private parameterInfo As ParameterInfo = GetType(String).GetMethod(\"Equals\").ReturnParameter\n    Private thread As New Thread(DirectCast(Nothing, ThreadStart))\n\n    Public Sub Test()\n        SyncLock synchronized ' Compliant\n        End SyncLock\n\n        SyncLock marshalByRefObject ' Noncompliant {{Replace this lock on 'MarshalByRefObject' with a lock against an object that cannot be accessed across application domain boundaries.}}\n            '    ^^^^^^^^^^^^^^^^^^\n        End SyncLock\n        SyncLock marshalByRefObjectDerivate ' Noncompliant {{Replace this lock on 'Timer' with a lock against an object that cannot be accessed across application domain boundaries.}}\n        End SyncLock\n        SyncLock executionEngineException   ' Noncompliant\n        End SyncLock\n        SyncLock outOfMemoryException       ' Noncompliant\n        End SyncLock\n        SyncLock stackOverflowException     ' Noncompliant\n        End SyncLock\n        SyncLock aString        ' Noncompliant\n        End SyncLock\n        SyncLock memberInfo     ' Noncompliant\n        End SyncLock\n        SyncLock parameterInfo  ' Noncompliant\n        End SyncLock\n        SyncLock thread         ' Noncompliant\n        End SyncLock\n    End Sub\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotMarkEnumsWithFlags.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public enum NoFlags // Compliant - no flags attribute\n    {\n        None = 0,\n        Something = 3\n    }\n\n    [FlagsAttribute]\n    public enum Color // Compliant - only power of 2 values\n    {\n        None = 0,\n        Red = 1,\n        Orange = 2,\n        Yellow = 4\n    }\n\n    [FlagsAttribute]\n    public enum Days\n    {\n        None = 0,\n        Monday = 1,\n        Tuesday = 2,\n        Wednesday = 4,\n        Thursday = 8,\n        Friday = 16,\n        All = Monday | Tuesday | Wednesday | Thursday | Friday    // Compliant - combination of other values\n    }\n\n    [FlagsAttribute]\n    public enum Color2 // Noncompliant {{Remove the 'FlagsAttribute' from this enum.}}\n//              ^^^^^^\n    {\n        None = 0,\n        Red = 1,\n        Orange = 3,\n//      ^^^^^^^^^^ Secondary {{Enum value is not a power of two.}}\n        Yellow = 4\n    }\n\n    [FlagsAttribute]\n    public enum Color3 // Compliant - values are automatically set with power of 2 values\n    {\n        None,\n        Red,\n        Orange,\n        Yellow = 4\n    }\n\n    [FlagsAttribute]\n    public enum Color4\n    {\n        None = 4,\n        Red = 8,\n        Orange = 16,\n        Yellow = 12\n    }\n\n    [Flags]\n    public enum NegativeValues\n    {\n        Default = 0,\n        A = -2,\n        B = -4,\n        C = 1 << 31, // It overflows and becomes negative: https://github.com/SonarSource/sonar-dotnet/issues/7991\n        D = A | B,\n        E = 2,\n        F = D | E\n    }\n\n    [Flags]\n    public enum HugeValues: ulong // Noncompliant\n    {\n        Max = ulong.MaxValue // Secondary\n    }\n\n    [Flags]\n    enum EnumFoo { }\n\n    [Flags]\n    enum EnumFoo2 // Noncompliant\n    {\n        a = 2,\n        b = 4,\n        c = 4,\n        d = 10 // Secondary\n    }\n\n    [Flags]\n    enum EnumFoo3\n    {\n        N1 = 1,\n        N2 = 2,\n        N3 = N1 | N2,\n        N4 = 4,\n        N5 = N4 | N1,\n        N6 = N4 | N2\n    }\n\n    [Flags]\n    enum EnumFoo4 // Noncompliant\n    {\n        N1 = 1,\n        N2 = 2,\n        N3 = N1 | N2,\n        N5 = 5 // Secondary\n    }\n}\n\nnamespace DifferentBaseType\n{\n    [Flags]\n    public enum EByte : byte\n    {\n        A = 1,\n        B = 2,\n        C = A | B\n    }\n\n    [Flags]\n    public enum ESByte : sbyte\n    {\n        A = -2,\n        B = 2,\n        C = A | B\n    }\n\n    [Flags]\n    public enum EShort : short\n    {\n        A = -2,\n        B = 2,\n        C = A | B\n    }\n\n    [Flags]\n    public enum EUShort : ushort\n    {\n        A = 1,\n        B = 2,\n        C = A | B\n    }\n\n    [Flags]\n    public enum EInt : int\n    {\n        A = -2,\n        B = 2,\n        C = A | B\n    }\n\n    [Flags]\n    public enum EUInt : uint\n    {\n        A = 1,\n        B = 2,\n        C = A | B\n    }\n\n    [Flags]\n    public enum ELong : long\n    {\n        A = -2,\n        B = 2,\n        C = A | B\n    }\n\n    [Flags]\n    public enum EULong : ulong\n    {\n        A = 1,\n        B = 2,\n        C = A | B\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotNestTernaryOperators.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        public bool Foo()\n        {\n            var b = System.Environment.NewLine?.ToString();\n            return true ? FooImpl(true, false) : true;\n        }\n\n        public bool FooImpl(bool isMale, bool isMarried)\n        {\n            var x = isMale ? \"Mr. \" : isMarried ? \"Mrs. \" : \"Miss \";  // Noncompliant {{Extract this nested ternary operation into an independent statement.}}\n//                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n            var x2 = isMale ? \"Mr. \" : isMarried ? \"Mrs. \" : true ? \"Miss \" : \"what? \";\n//                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant\n//                                                           ^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant@-1\n\n            var x3 = isMale ? \"Mr. \" :\n                 isMarried // Noncompliant\n                ? \"Mrs. \"\n                : \"Miss \";\n\n            var lambda1 = true // Compliant. Nested in Lambda is valid\n                ? new Func<string>(() => true ? \"a\" : \"b\")\n                : new Func<string>(() => true ? \"c\" : \"d\");\n\n            var lambda2 = true\n                ? new Func<string, string>(s => true ? \"a\" : \"b\")\n                : new Func<string, string>(s => true ? \"c\" : \"d\");\n\n            var lambda3 = new Func<string, string>(s => isMale ? \"Mr. \" : isMarried ? \"Mrs. \" : \"Miss \"); // Noncompliant\n\n            return false;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotNestTernaryOperators.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.Linq\nImports System.Text\n\nNamespace Tests.TestCases\n    Class Foo\n        Public Function Foo() As Boolean\n            Dim b = System.Environment.NewLine\n            Return If(True, FooImpl(True, False), True)\n        End Function\n\n        Public Function FooImpl(ByVal isMale As Boolean, ByVal isMarried As Boolean) As Boolean\n            Dim x = If(isMale, \"Mr. \", If(isMarried, \"Mrs. \", \"Miss \")) ' Noncompliant {{Extract this nested If operator into independent If...Then...Else statements.}}\n'                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            Dim x2 = If(isMale, \"Mr. \", If(isMarried, \"Mrs. \", If(True, \"Miss \", \"what? \")))\n'                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant\n'                                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant@-1\n            Dim x3 = If(isMale, \"Mr. \",\n                If(isMarried, \"Mrs. \", \"Miss \"))\n'               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant\n\n            Dim x4 = If(isMale, Function() \"Mr.\", Function() If(isMarried, \"Mrs.\", \"Miss\")) ' Compliant. Ternary expressions in lambdas are not considered nested.\n            Dim x5 = If(isMale, Sub() PrintGreeting(\"Mr.\"),  Sub() PrintGreeting(If(isMarried, \"Mrs.\", \"Miss\")))\n            Dim x6 = If(isMale, Function()\n                                    Return \"Mr.\"\n                                End Function,\n                                Function()\n                                    Return If(isMarried, \"Mrs.\", \"Miss\")\n                                End Function)\n            Dim x7 = If(isMale, Sub()\n                                    PrintGreeting(\"Mr.\")\n                                End Sub,\n                                Sub()\n                                    PrintGreeting(If(isMarried, \"Mrs.\", \"Miss\"))\n                                End Sub)\n\n        End Function\n\n        Private Sub PrintGreeting(greeting As String)\n        End Sub\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotNestTypesInArguments.Latest.cs",
    "content": "﻿using System.Collections.Generic;\n\nnamespace Partial\n{\n    public partial class A\n    {\n        private partial void M(IDictionary<IList<int>, IList<string>> args) { } // Noncompliant\n    }\n}\n\npublic class B\n{\n    public void Nullable(Dictionary<List<int>?, string>? args) { } // Noncompliant\n\n    public void Ref(ref ICollection<ICollection<int>> arg) { } // Noncompliant\n\n    public void Ref(ref ICollection<int> arg) { }\n\n    public void In(in ICollection<ICollection<int>> arg) { } // Noncompliant\n\n    public void In(in ICollection<int> arg) { }\n\n    public void Functions()\n    {\n        static void Func1(ICollection<ICollection<int>> arg) { }; // Noncompliant\n\n        static void Func2(ICollection<int> arg) { };\n    }\n}\n\npublic interface ISome\n{\n    void M(IList<IList<int>> arg); // Noncompliant\n}\n\npublic abstract record Some\n{\n    public abstract void M2(IList<IList<int>> arg); // Noncompliant\n} \n\npublic record C : Some, ISome\n{\n    public void M(IList<IList<int>> arg) { }\n\n    public override void M2(IList<IList<int>> arg) { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotNestTypesInArguments.Latest.partial.cs",
    "content": "﻿using System.Collections.Generic;\n\nnamespace Partial\n{\n    public partial class A\n    {\n        private partial void M(IDictionary<IList<int>, IList<string>> args); // Noncompliant;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotNestTypesInArguments.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq.Expressions;\nusing System.Threading.Tasks;\n\nusing ComplexType = System.Collections.Generic.ICollection<System.Collections.Generic.ICollection<System.Collections.Generic.ICollection<int>>>;\n\npublic class GlobalClass<T> { }\n\nnamespace MyLibrary\n{\n    public class Foo\n    {\n        public delegate void Delegate(IList<IList<int>> arg);\n\n        public void DoSomething(ICollection<ICollection<int>> outerCollect) { } // Noncompliant {{Refactor this method to remove the nested type argument.}}\n//                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        public void Method_NoArgs() { }\n        public void Method_Array(object[] arg) { }\n        public void GenericMethod_Array<T>(T[] arg) { }\n        public void Method_ListOfArrays(List<object[]> arg) { }\n        public void Method_ArrayOfLists(List<object>[] arg) { }\n\n        public void Method_DeepGeneric<T>(Tuple<object, Tuple<List<T>, object>> arg) { } // Noncompliant\n        public void Method_DeepMethod(Tuple<object, List<List<object>>> arg) { } // Noncompliant\n\n        public void Method_MultiArgs(List<List<object>> arg1,\n//                                   ^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant\n                                     List<object> arg2,\n                                     List<object[]>[] arg3,\n                                     Tuple<List<object>, object> arg4) { }\n//                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant\n        public void Method_ArraysAndGenerics(ICollection<ICollection<ICollection<int>[]>[]> arg) { }\n//                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant\n\n        public void Method_NestedExpression(Expression<ICollection<int>[]>[] arg) { }\n\n        public void Method_NestedFunc(Func<ICollection<int>> arg) { }\n        public void Method_NestedFunc1(Func<ICollection<int>, ICollection<int>> arg) { }\n        public void Method_NestedFunc2(Func<ICollection<int>, ICollection<int>, ICollection<int>> arg) { }\n        public void Method_NestedFunc3(Func<ICollection<int>, ICollection<int>, ICollection<int>, ICollection<int>> arg) { }\n        public void Method_NestedFunc4(Func<ICollection<int>, ICollection<int>, ICollection<int>, ICollection<int>, ICollection<int>> arg) { }\n        public void Method_NestedFunc16(Func<ICollection<int>, ICollection<int>, ICollection<int>, ICollection<int>, ICollection<int>, ICollection<int>, ICollection<int>, ICollection<int>, ICollection<int>, ICollection<int>, ICollection<int>, ICollection<int>, ICollection<int>, ICollection<int>, ICollection<int>, ICollection<int>, ICollection<int>> arg) { }\n        public void Method_NestedFuncArrays(Func<ICollection<int>[], List<object>>[] arg) { }\n\n        public void Method_NestedFunc_Level2(Func<ICollection<ICollection<int>>> arg) { } // Noncompliant\n\n        public void Method_NestedAction(Action arg) { }\n        public void Method_NestedAction1(Action<ICollection<int>> arg) { }\n        public void Method_NestedAction2(Action<ICollection<int>, ICollection<int>> arg) { }\n        public void Method_NestedAction3(Action<ICollection<int>, ICollection<int>, ICollection<int>> arg) { }\n        public void Method_NestedAction4(Action<ICollection<int>, ICollection<int>, ICollection<int>, ICollection<int>> arg) { }\n        public void Method_NestedAction16(Action<ICollection<int>, ICollection<int>, ICollection<int>, ICollection<int>, ICollection<int>, ICollection<int>, ICollection<int>, ICollection<int>, ICollection<int>, ICollection<int>, ICollection<int>, ICollection<int>, ICollection<int>, ICollection<int>, ICollection<int>, ICollection<int>> arg) { }\n        public void Method_NestedActionArrays(Action<ICollection<int>[], List<object>>[] arg) { }\n\n        public void Method_NestedAction_Level2(Action<ICollection<ICollection<int>>> arg) { } // Noncompliant\n\n        public void Method_AnonymousMethod()\n        {\n            Delegate x = delegate (IList<IList<int>> arg) { };\n        }\n\n        public void Method_Tuple((List<int>, List<string>) arg) { }\n        public void Method_TupleList(List<(int, string)> arg) { }\n        public void Method_TupleNested((Task<List<int>>, Task<List<int>>) data) { } // Noncompliant\n        public void Method_TupleListNested(List<(Task<int>, Task<string>)> args) { } //Noncompliant\n\n        public void Method_Alias(global::GlobalClass<GlobalClass<int>> arg) { } // Noncompliant\n        public void Method_QualifiedName(System.Collections.Generic.List<System.Collections.Generic.List<int>> arg) { } // Noncompliant\n        public void Method_QualifiedNameWithAlias(global::System.Collections.Generic.List<IEnumerable<int>> arg) { } // Noncompliant\n\n        public void Method_Generic<T>(List<List<List<T>>> arg) { } // Noncompliant\n\n        public void Method_WithUsing(ComplexType arg) { } // Compliant, alias is used to hide complexity\n\n        public void Method_Out(out ICollection<ICollection<int>> arg) { arg = null; } // Noncompliant\n        public void Method_Out_Compliant(out ICollection<int> arg) { arg = null; }\n    }\n\n    public class WithLocalFunctions\n    {\n        public void Method()\n        {\n            void DoSomething(ICollection<ICollection<int>> outerCollect) { } // Noncompliant\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/3277\n    public class Repro_3277\n    {\n        public void QuestionMark(List<int?> list)\n        {\n        }\n\n        public void Explicit(List<Nullable<int>> list) // Noncompliant, there's a nice way out of this\n        {\n        }\n    }\n\n    // https://community.sonarsource.com/t/s3342-and-s4017-complains-on-user-code-while-implementing-external-interface/120432\n    namespace Repro_120432\n    {\n        public abstract class External\n        {\n            public abstract void DoWork(IDictionary<String, IList<string>> data); // Noncompliant\n        }\n\n        public class UserCode : External\n        {\n            public override void DoWork(IDictionary<String, IList<string>> data) { }\n        }\n    }\n\n    namespace Inheritance\n    {\n        public interface IAbstractClassInterface\n        {\n            void AbstractInterfaceMethod(Task<IList<int>> data); // Noncompliant\n        }\n\n        public interface IImplicit\n        {\n            void ImplicitMethod(Task<IList<int>> data); // Noncompliant\n        }\n\n        public interface IExplicit\n        {\n            void ExplicitMethod(Task<IList<int>> data); // Noncompliant\n        }\n\n        public abstract class AbstractClass : IAbstractClassInterface\n        {\n            public abstract void AbstractInterfaceMethod(Task<IList<int>> data);\n\n            public abstract void AbstractClassMethod(Task<IList<int>> data); // Noncompliant\n\n            public virtual void VirtualMethod(Task<IList<int>> data) { } // Noncompliant\n\n            public void ShadowedMethod(Task<IList<int>> data) { } // Noncompliant\n        }\n\n        public class DerivedClass : AbstractClass, IImplicit, IExplicit\n        {\n            public void ImplicitMethod(Task<IList<int>> data) { }\n\n            void IExplicit.ExplicitMethod(Task<IList<int>> data) { }\n\n            public override void AbstractInterfaceMethod(Task<IList<int>> data) { }\n\n            public override void AbstractClassMethod(Task<IList<int>> data) { }\n\n            public override void VirtualMethod(Task<IList<int>> data) { } // Noncompliant\n\n            public new void ShadowedMethod(Task<IList<int>> data) { } // Noncompliant, 'new' hides the base method but does not force this signature.\n        }\n\n        public struct Struct : IImplicit, IExplicit\n        {\n            public void ImplicitMethod(Task<IList<int>> data) { }\n\n            void IExplicit.ExplicitMethod(Task<IList<int>> data) { }\n        }\n    }\n\n    namespace Operators\n    {\n        class Noncompliant<T>\n        {\n            public static implicit operator Noncompliant<T>(List<List<List<T>>> value) // Noncompliant\n            {\n                throw new NotImplementedException();\n            }\n\n            public static explicit operator Noncompliant<T>(Noncompliant<List<T>> obj) // Noncompliant\n            {\n                throw new NotImplementedException();\n            }\n        }\n\n        class Compliant<T>\n        {\n            public static implicit operator Compliant<T>(List<T> value)\n            {\n                throw new NotImplementedException();\n            }\n\n            public static explicit operator Compliant<T>(HashSet<T> obj)\n            {\n                throw new NotImplementedException();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotOverloadOperatorEqual.Latest.cs",
    "content": "﻿using Extensions;\nusing System.Numerics;\n\nrecord MyType\n{\n    public static MyType operator ==(MyType x, MyType y) // Error [CS0111]\n    {\n        return null;\n    }\n\n    public static MyType operator !=(MyType x, MyType y) => null; // Error [CS0111]\n}\n\nclass MyClass : IEqualityOperators<MyClass, MyClass, MyClass>\n{\n    public static MyClass operator ==(MyClass? left, MyClass? right) => new MyClass(); // Compliant \n    \n    public static MyClass operator !=(MyClass? left, MyClass? right) => new MyClass();\n}\n\nnamespace Extensions\n{\n    class Sample { }\n\n    static class Extensions\n    {\n        extension(Sample)\n        {\n            public static bool operator ==(Sample left, Sample right) => true;  // FN NET-2709\n            public static bool operator !=(Sample left, Sample right) => true;\n        }\n    }\n}\n\nclass CustomCompoundAssignment\n{\n    public int Value;\n\n    public void operator +=(int x) => Value += x;\n    public static bool operator ==(CustomCompoundAssignment left, CustomCompoundAssignment right) => true;  // Noncompliant\n    public static bool operator !=(CustomCompoundAssignment left, CustomCompoundAssignment right) => true;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotOverloadOperatorEqual.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    class MyType\n    {\n        public static MyType operator ==(MyType x, MyType y) // Noncompliant {{Remove this overload of 'operator =='.}}\n//                                    ^^\n        {\n            return null;\n        }\n\n        public static MyType operator !=(MyType x, MyType y)\n        {\n            return null;\n        }\n    }\n\n    class MyTypeWithAdditionOverload\n    {\n        public static MyTypeWithAdditionOverload operator +(MyTypeWithAdditionOverload x, MyTypeWithAdditionOverload y)\n        {\n            return new MyTypeWithAdditionOverload();\n        }\n\n        public static bool operator ==(MyTypeWithAdditionOverload x, MyTypeWithAdditionOverload y) // Compliant\n        {\n            return false;\n        }\n\n        public static bool operator !=(MyTypeWithAdditionOverload x, MyTypeWithAdditionOverload y)\n        {\n            return false;\n        }\n    }\n\n    class MyTypeWithSubstractionOverload\n    {\n        public static MyTypeWithSubstractionOverload operator -(MyTypeWithSubstractionOverload x, MyTypeWithSubstractionOverload y)\n        {\n            return new MyTypeWithSubstractionOverload();\n        }\n\n        public static bool operator ==(MyTypeWithSubstractionOverload x, MyTypeWithSubstractionOverload y) // Compliant\n        {\n            return false;\n        }\n\n        public static bool operator !=(MyTypeWithSubstractionOverload x, MyTypeWithSubstractionOverload y)\n        {\n            return false;\n        }\n    }\n\n    struct ComparableTypeMyStruct\n    {\n        public static bool operator ==(ComparableTypeMyStruct x, ComparableTypeMyStruct y) // Compliant\n        {\n            return false;\n        }\n\n        public static bool operator !=(ComparableTypeMyStruct x, ComparableTypeMyStruct y)\n        {\n            return false;\n        }\n    }\n\n    class GenericComparableType : IComparable<GenericComparableType>\n    {\n        public int CompareTo(GenericComparableType other)\n        {\n            throw new NotImplementedException();\n        }\n\n        public static bool operator ==(GenericComparableType x, GenericComparableType y) // Compliant\n        {\n            return false;\n        }\n\n        public static bool operator !=(GenericComparableType x, GenericComparableType y)\n        {\n            return false;\n        }\n    }\n\n    class ComparableType : IComparable\n    {\n        public int CompareTo(object obj)\n        {\n            throw new NotImplementedException();\n        }\n\n        public static bool operator ==(ComparableType x, ComparableType y) // Compliant\n        {\n            return false;\n        }\n\n        public static bool operator !=(ComparableType x, ComparableType y)\n        {\n            return false;\n        }\n    }\n\n    class EquatableType : IEquatable<EquatableType>\n    {\n        public bool Equals(EquatableType other)\n        {\n            throw new NotImplementedException();\n        }\n\n        public static bool operator ==(EquatableType x, EquatableType y) // Compliant\n        {\n            return false;\n        }\n\n        public static bool operator !=(EquatableType x, EquatableType y)\n        {\n            return false;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotOverwriteCollectionElements.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nclass CSharp11\n{\n    Dictionary<string, int> dictionary = new();\n\n    void OverwriteDictionary()\n    {\n        dictionary[\"\"\"a\"\"\"] = 1; // Secondary {{The index/key set here gets set again later.}}\n        dictionary[\"\"\"a\"\"\"] = 2; // Noncompliant\n    }\n\n    void OverwriteArray()\n    {\n        string[] array = new string[2];\n        array[0] = \"\"\"a\"\"\"; // Secondary  {{The index/key set here gets set again later.}}\n        array[1] = \"\"\"b\"\"\";\n        array[0] = \"\"\"c\"\"\"; // Noncompliant\n    }\n\n    void SameIndexOnArray(CustomIndexer obj)\n    {\n        obj[\"\"\"foo\"\"\"] = 42; // Compliant, not a collection or dictionary\n        obj[\"\"\"foo\"\"\"] = 42; // Compliant, not a collection or dictionary\n    }\n\n    public class CustomIndexer\n    {\n        public int this[string key]\n        {\n            get { return 1; }\n            set { }\n        }\n    }\n}\n\nclass CSharp13\n{\n    OrderedDictionary<string, int> orderedDictionary = new();\n\n    void NewCollectionTypes()\n    {\n        orderedDictionary[\"\"\"a\"\"\"] = 1; // Secondary\n        orderedDictionary[\"\"\"a\"\"\"] = 2; // Noncompliant\n    }\n}\n\nclass CSharp14\n{\n    void NullConditionalAccess(List<CSharp14> items)\n    {\n        items?[0] = null;\n        items?[0] = new CSharp14(); // FN NET-2710\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotOverwriteCollectionElements.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    class TestCases\n    {\n        public IDictionary<int, int> dictionaryField;\n\n        void SameIndexOnDictionary(Dictionary<int, int> dict)\n        {\n            dict[0] = 42; // Secondary  {{The index/key set here gets set again later.}}\n//          ^^^^^^^^^^^^^\n            dict[0] = 42; // Noncompliant {{Verify this is the index/key that was intended; a value has already been set for it.}}\n//          ^^^^^^^^^^^^^\n        }\n\n        void SameIndexOnArray(int[] array)\n        {\n            array[0] = 42; // Secondary  {{The index/key set here gets set again later.}}\n            array[0] = 42; // Noncompliant\n        }\n\n        void Parenthesis_Indexer(int[] array)\n        {\n            array[(0)] = 42; // Secondary\n            (array)[0] = 42; // Noncompliant\n        }\n\n        void Parenthesis_Invocation(Dictionary<int, int> dict)\n        {\n            dict.Add((0), 42); // Secondary\n            (dict).Add(0, 42); // Noncompliant\n        }\n\n        void SameIndexOnList(List<int> list)\n        {\n            list[0] = 42; // Secondary\n            list[0] = 42; // Noncompliant\n        }\n\n        void ListAdd(List<int> list)\n        {\n            // #2674 List.Add method should not raise any issue when used with same elements\n            list.Add(42);\n            list.Add(42);\n        }\n\n        void ICollectionAdd(ICollection<int> collection)\n        {\n            // #2674 List.Add method should not raise any issue when used with same elements\n            collection.Add(42);\n            collection.Add(42);\n        }\n\n        void SameIndexOnArray(CustomIndexerOneArg obj)\n        {\n            obj[\"foo\"] = 42; // Compliant, not a collection or dictionary\n            obj[\"foo\"] = 42; // Compliant, not a collection or dictionary\n        }\n\n        void SameIndexOnArray(CustomIndexerMultiArg obj)\n        {\n            obj[\"s\", 1, 1.0] = 42; // Compliant, not a collection or dictionary\n            obj[\"s\", 1, 1.0] = 42; // Compliant, not a collection or dictionary\n        }\n\n        void SameIndexSpacedOut(string[] names)\n        {\n            names[0] = \"a\"; // Secondary\n            names[1] = \"b\";\n            names[0] = \"c\"; // Noncompliant\n        }\n\n        void NonSequentialAccessOnSameIndex(int[] values)\n        {\n            int index = 0;\n            values[0] = 1;\n            index++;\n            values[0] = 2; // FN - We only take consecutive element access\n        }\n\n        void NonConstantConsecutiveIndexAccess(int[] values)\n        {\n            int index = 0;\n            values[index] = 1; // Secondary\n            values[index] = 2; // Noncompliant\n        }\n\n        void IncrementDecrementIndexAccess(int[] values)\n        {\n            int index = 0;\n            values[index++] = 1;\n            values[index++] = 2;\n\n            values[index--] = 1;\n            values[index--] = 2;\n\n            values[++index] = 1;\n            values[++index] = 2;\n\n            values[--index] = 1;\n            values[--index] = 2;\n        }\n\n        void IDictionaryAdd(IDictionary<int, int> dict)\n        {\n            dict.Add(0, 0); // Secondary\n//          ^^^^^^^^^^^^^^^\n            dict.Add(0, 1); // Noncompliant\n//          ^^^^^^^^^^^^^^^\n        }\n\n        void DictionaryAdd(Dictionary<int, int> dict)\n        {\n            dict.Add(0, 0); // Secondary\n            dict.Add(0, 1); // Noncompliant\n        }\n\n        void ListRemove(List<int> list)\n        {\n            list.Remove(0);\n            list.Remove(0); // Ignore methods that do not add/set items\n            list[0] = 1; // Compliant\n        }\n\n        void IDictionaryAddOnMultiMemberAccess(TestCases c)\n        {\n            c.dictionaryField.Add(0, 0); // Secondary\n            c.dictionaryField.Add(0, 1); // Noncompliant\n        }\n\n        void IDictionaryAddWithThis()\n        {\n            this.dictionaryField.Add(0, 0); // Secondary\n            this.dictionaryField.Add(0, 1); // Noncompliant\n        }\n\n        void DoNotReportOnNonDictionaryAdd(CustomAdd c)\n        {\n            c.Add(0, 1);\n            c.Add(0, 2); // Compliant this is not on a dictionary\n        }\n\n        void AccessOnMethodCall()\n        {\n            GetArray()[0] = 1;\n            GetArray()[0] = 2;\n        }\n\n        int[] GetArray()\n        {\n            return new int[1];\n        }\n\n        void InitTowns(IDictionary<string, string> towns, string y)\n        {\n            towns.Add(y, \"Boston\"); // Secondary\n            towns[y] = \"Paris\"; // Noncompliant, https://github.com/SonarSource/sonar-dotnet/issues/1908\n        }\n\n        void MemberBinding(IDictionary<string, string> dictionary)\n        {\n            dictionary?.Add(\"a\", \"b\"); // Secondary\n            dictionary?.Add(\"a\", \"b\"); // Noncompliant\n        }\n    }\n\n    class InheritanceTest : Dictionary<int, int>\n    {\n        void AddToBaseField()\n        {\n            base.Add(0, 0); // Secondary\n            base.Add(0, 1); // Noncompliant\n        }\n\n        void MyAdd()\n        {\n            this.Add(0, 0); // Secondary\n            this.Add(0, 1); // Noncompliant\n        }\n\n        void IncrementDecrementInvocation(Dictionary<int, int> dict)\n        {\n            int index = 0;\n            dict.Add(index++, 1);\n            dict.Add(index++, 2);\n\n            dict.Add(index--, 1);\n            dict.Add(index--, 2);\n\n            dict.Add(++index, 1);\n            dict.Add(++index, 2);\n\n            dict.Add(--index, 1);\n            dict.Add(--index, 2);\n        }\n    }\n\n    public class RegressionTests\n    {\n        private RegressionTests instance1;\n        private RegressionTests instance2;\n        private RegressionTests instance3;\n\n        public Dictionary<string, string> Map { get; }\n\n        // See https://github.com/SonarSource/sonar-dotnet/issues/1967\n        public void NullReference()\n        {\n            var act = new Action<int, int>((x, y) => x++);\n            var dict = new Dictionary<int, int>();\n\n            act(0, 1); // Some invocation that's not a method, but still have two arguments\n            dict.Add(0, 0); // Secondary\n            dict.Add(0, 1); // Noncompliant\n        }\n\n        public void Foo()\n        {\n            instance1.Map.Add(\"currentColor\", \"#FFFF0000\");\n            instance2.Map.Add(\"currentColor\", \"#FF00FF00\");\n        }\n\n        public void Bar()\n        {\n            Map.Add(\"currentColor\", \"#FFFF0000\"); // Secondary\n            Map.Add(\"currentColor\", \"#FF00FF00\"); // Noncompliant\n        }\n\n        public void FooBar()\n        {\n            MyTestClass1.Map.Add(\"currentColor\", \"#FFFF0000\");\n            MyTestClass2.Map.Add(\"currentColor\", \"#FF00FF00\");\n        }\n    }\n\n    public static class MyTestClass1\n    {\n        public static Dictionary<string, string> Map { get; }\n    }\n\n    public static class MyTestClass2\n    {\n        public static Dictionary<string, string> Map { get; }\n    }\n\n    public class CustomIndexerOneArg\n    {\n        public int this[string key]\n        {\n            get { return 1; }\n            set { }\n        }\n    }\n\n    public class CustomIndexerMultiArg\n    {\n        public int this[string s, int i, double d]\n        {\n            get { return 1; }\n            set { }\n        }\n    }\n\n    public class CustomAdd\n    {\n        public void Add(int a, int b) { }\n    }\n\n    public class TestSameClassMultipleInstance\n    {\n        public class MyContainer\n        {\n            public Dictionary<string, string> dictionaryField;\n            public static Dictionary<string, string> publicStaticDictionaryField = new Dictionary<string, string>();\n            private static Dictionary<string, string> staticDictionary = new Dictionary<string, string>();\n            public Dictionary<string, string> StaticDictionary\n            {\n                get => staticDictionary;\n            }\n            public MyContainer()\n            {\n                dictionaryField = new Dictionary<string, string>();\n            }\n        }\n\n        public void Foo()\n        {\n            var dict1 = new MyContainer();\n            var dict2 = new MyContainer();\n\n            dict1.dictionaryField.Add(\"prop1\", \"1\");\n            dict2.dictionaryField.Add(\"prop1\", \"2\"); // ok, different instance\n\n            dict1.StaticDictionary.Add(\"static\", \"a\");\n            dict2.StaticDictionary.Add(\"static\", \"b\"); // FN, same instance\n\n            MyContainer.publicStaticDictionaryField.Add(\"x\", \"x\"); // Secondary\n            MyContainer.publicStaticDictionaryField.Add(\"x\", \"x1\"); // Noncompliant\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/4178\n    public class Repro\n    {\n        public void DifferentObjectSameProperty()\n        {\n            var first = new ClassWithListProperty();\n            var second = new ClassWithListProperty();\n\n            first.IntList[0] = 1;\n            first.IntList2[0] = 11;\n            second.IntList[0] = 2;\n            second.IntList2[0] = 22;\n        }\n\n        public void SamePropertyDifferentIndex()\n        {\n            var first = new ClassWithListProperty();\n\n            first.IntList[0] = 1;\n            first.IntList[1] = 2; // ok, different index\n        }\n\n        public void FNBecauseOfTheOrder()\n        {\n            var first = new ClassWithListProperty();\n\n            first.IntList[0] = 1;\n            first.IntList2[1] = 2;\n            first.IntList[0] = 3; // FN\n            first.IntList2[1] = 4; // FN\n        }\n\n        public void NoncompliantWithSameIndex()\n        {\n            var first = new ClassWithListProperty();\n\n            first.IntList[0] = 1; // Secondary\n            first.IntList[0] = 3; // Noncompliant\n            first.IntList2[1] = 2; // Secondary\n            first.IntList2[1] = 4; // Noncompliant\n        }\n\n        public void DifferentIndexes()\n        {\n            var first = new ClassWithListProperty();\n\n            first.IntList[0] = 1;\n            first.IntList2[1] = 2;\n            first.IntList[1] = 3;\n            first.IntList2[0] = 4;\n        }\n\n        public void CompliantDeeplyNested()\n        {\n            var first = new ClassWithNested();\n            var second = new ClassWithNested();\n\n            first.Alpha.IntList[0] = 1;\n            first.Alpha.IntList2[0] = 11;\n            first.Beta.IntList[0] = 1111;\n            first.Beta.IntList2[0] = 11111;\n            second.Alpha.IntList[0] = 2;\n            second.Alpha.IntList2[0] = 22;\n            second.Beta.IntList[0] = 222;\n            second.Beta.IntList2[0] = 2222;\n        }\n\n        public void NonCompliantDeeplyNested()\n        {\n            var first = new ClassWithNested();\n            var second = new ClassWithNested();\n\n            first.Alpha.IntList[0] = 1; // Secondary\n            first.Alpha.IntList[0] = 2; // Noncompliant\n            first.Beta.IntList[0] = 3;\n            first.Beta.IntList2[0] = 4;\n            second.Alpha.IntList[0] = 5;\n            second.Alpha.IntList2[0] = 6;\n            second.Beta.IntList[1] = 7; // FN\n            second.Beta.IntList2[0] = 8;\n            second.Beta.IntList[1] = 9; // FN\n            first.Beta.IntList[3] = 10;\n            second.Beta.IntList[3] = 11;\n        }\n\n        private class ClassWithListProperty\n        {\n            public List<int> IntList { get; set; }\n            public List<int> IntList2 { get; set; }\n        }\n\n        private class ClassWithNested\n        {\n            public ClassWithListProperty Alpha { get; set; }\n            public ClassWithListProperty Beta { get; set; }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotOverwriteCollectionElements.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.Linq\nImports System.Text\n\nNamespace Tests.TestCases\n\n    Class TestCases\n\n        Public Shared dictionaryField As IDictionary(Of Integer, Integer)\n        Public Shared dictionaryField2 As IDictionary(Of Integer, Integer)\n        Public fooList() As Foo\n\n        Private Sub SameIndexOnDictionaryItem(ByVal dict As Dictionary(Of Integer, Integer))\n            dict.Item(0) = 0 ' Secondary {{The index/key set here gets set again later.}}\n'           ^^^^^^^^^^^^^^^^\n            dict.Item(0) = 1 ' Noncompliant {{Verify this is the index/key that was intended; a value has already been set for it.}}\n'           ^^^^^^^^^^^^^^^^\n        End Sub\n\n        Private Sub MeUsage()\n            Me.dictionaryField.Item(0) = 1 ' Secondary {{The index/key set here gets set again later.}}\n            Me.dictionaryField.Item(0) = 1 ' Noncompliant\n        End Sub\n\n        Private Sub MyClassUsage()\n            MyClass.dictionaryField.Item(0) = 1 ' Secondary\n            MyClass.dictionaryField.Item(0) = 1 ' Noncompliant\n        End Sub\n\n        Private Sub Parenthesis_Indexer(ByVal array() As Integer)\n            array((0)) = 0  ' Secondary\n            array(0) = 1    ' Noncompliant\n        End Sub\n\n        Private Sub Parenthesis_Invocation(ByVal dict As Dictionary(Of Integer, Integer))\n            dict((0)) = 0       ' Secondary\n            dict.Add((0), 1)    ' Noncompliant\n        End Sub\n\n        Private Sub SameIndexOnArray1(ByVal array() As Integer)\n            array(0) = 0 ' Secondary\n            array(0) = 1 ' Noncompliant\n        End Sub\n\n        Private Sub SameIndexOnArray2(ByVal array() As Integer)\n            array(0) = 1                ' Secondary\n            array(0) = (array(0) + 1)   ' Noncompliant\n        End Sub\n\n        Private Sub SameIndexOnArray3(ByVal obj As CustomIndexerOneArg)\n            obj(\"foo\") = 0\n            obj(\"foo\") = 1 ' Compliant, obj is not a collection\n        End Sub\n\n        Private Sub SameIndexOnArray4(ByVal obj As CustomIndexerMultiArg)\n            obj(\"s\", 1, 1) = 0\n            obj(\"s\", 1, 1) = 1 ' Compliant obj is not a dictionary\n        End Sub\n\n        Private Sub SameIndexOnList(ByVal list As List(Of Integer))\n            list(0) = 0 ' Secondary\n            list(0) = 1 ' Noncompliant\n        End Sub\n\n        Private Sub ListAdd(ByVal list As List(Of String))\n            '#2674 List.Add method should not raise any issue when used with same elements\n            list.Add(\"MyText\")\n            list.Add(\"MyText\")\n        End Sub\n\n        Private Sub ICollectionAdd(collection As ICollection(Of String))\n            '#2674 List.Add method should not raise any issue when used with same elements\n            collection.Add(\"MyText\")\n            collection.Add(\"MyText\")\n        End Sub\n\n        Private Sub SameIndexSpacedOut(ByVal names() As String)\n            names(\"a\") = \"a\" ' Secondary\n            names(\"b\") = \"b\"\n            names(\"a\") = \"c\" ' Noncompliant\n        End Sub\n\n        Private Sub NonSequentialAccessOnSameIndex(ByVal values() As Integer)\n            Dim index As Integer = 0\n            values(0) = 1\n            index = (index + 1)\n            values(0) = 2 ' FN - We only take consecutive element access\n        End Sub\n\n        Private Sub NonConstantConsecutiveIndexAccess(ByVal values() As Integer)\n            Dim index As Integer = 0\n            values(index) = 1 ' Secondary\n            values(index) = 2 ' Noncompliant\n        End Sub\n\n        Private Sub IDictionaryAdd(ByVal dict As IDictionary(Of Integer, Integer))\n            dict.Add(0, 0) ' Secondary\n'           ^^^^^^^^^^^^^^\n            dict.Add(0, 1) ' Noncompliant\n'           ^^^^^^^^^^^^^^\n        End Sub\n\n        Private Sub IDictionaryAddLowercase(ByVal dict As IDictionary(Of Integer, Integer))\n            dict.add(0, 0) ' Secondary\n'           ^^^^^^^^^^^^^^\n            dict.add(0, 1) ' Noncompliant\n'           ^^^^^^^^^^^^^^\n        End Sub\n\n        Private Sub IDictionaryAddMixedCase(ByVal dict As IDictionary(Of Integer, Integer))\n            dict.add(0, 0) ' Secondary\n'           ^^^^^^^^^^^^^^\n            dict.ADD(0, 1) ' Noncompliant\n'           ^^^^^^^^^^^^^^\n        End Sub\n\n        Private Sub DictionaryAdd(ByVal dict As Dictionary(Of Integer, Integer))\n            dict.Add(0, 0) ' Secondary\n            dict.Add(0, 1) ' Noncompliant\n        End Sub\n\n        Private Sub IDictionaryAddOnMultiMemberAccess(ByVal c As TestCases)\n            ' The below code will throw an ArgumentException at runtime\n            c.dictionaryField.Add(0, 0) ' Secondary\n            c.dictionaryField.Add(0, 1) ' Noncompliant\n        End Sub\n\n        Private Sub DoNotReportOnNonDictionaryAdd(ByVal c As CustomAddItem)\n            c.Add(0, 1)\n            c.Add(0, 2) ' Compliant this is not on a dictionary\n        End Sub\n\n        Private Sub MeWithDifferent()\n            Me.dictionaryField(0) = 1 ' Compliant\n            Me.dictionaryField2(0) = 1 ' Compliant\n        End Sub\n\n        Private Sub MyClassWithDifferent()\n            MyClass.dictionaryField(0) = 1 ' Compliant\n            MyClass.dictionaryField2(0) = 1 ' Compliant\n        End Sub\n\n        Private Sub ArrayFields()\n            fooList(0).FooField = 1\n            fooList(0).BarField = 1\n            AddHandler fooList(0).Ev1, AddressOf Handler\n            AddHandler fooList(0).Ev2, AddressOf Handler\n        End Sub\n\n        Private Sub Handler()\n        End Sub\n\n        Private Sub ConditionalAccess1()\n            dictionaryField.Add(0, 1) ' Secondary\n            dictionaryField?.Add(0, 1) ' Noncompliant\n        End Sub\n\n        Private Sub ConditionalAccess2()\n            dictionaryField?.Add(0, 1) ' Secondary\n            dictionaryField.Add(0, 1) ' Noncompliant\n        End Sub\n\n    End Class\n\n    Class InheritTestCases\n        Inherits TestCases\n\n        Private Sub BaseSame()\n            MyBase.dictionaryField(0) = 1 ' Secondary\n            MyBase.dictionaryField(0) = 1 ' Noncompliant\n        End Sub\n\n        Private Sub BaseDifferent()\n            MyBase.dictionaryField(0) = 1 ' Compliant\n            MyBase.dictionaryField2(0) = 1 ' Compliant\n        End Sub\n\n    End Class\n\n    Class Foo\n\n        Public FooField\n        Public BarField\n        Public Event Ev1()\n        Public Event Ev2()\n\n    End Class\n\n    Class CustomIndexerOneArg\n\n        Default Property Item(ByVal key As String) As Integer\n            Get\n                Return 1\n            End Get\n            Set\n\n            End Set\n        End Property\n\n    End Class\n\n    Class CustomIndexerMultiArg\n\n        Default Property Item(ByVal s As String, ByVal i As Integer, ByVal d As Double) As Integer\n            Get\n                Return 1\n            End Get\n            Set\n\n            End Set\n        End Property\n\n    End Class\n\n    Class CustomAddItem\n\n        Public Sub Add(ByVal a As Integer, ByVal b As Integer)\n        End Sub\n\n    End Class\n\n    'See https://github.com/SonarSource/sonar-dotnet/issues/2235\n    Class NullReferenceReproducer\n\n        Sub FooBar()\n            Bar ' AD0001 NullReferenceException in GetFirstArgumentExpression\n        End Sub\n\n        Public Sub Bar()\n        End Sub\n\n    End Class\n\n    'See https://github.com/SonarSource/sonar-dotnet/issues/4178\n    Class Repro\n\n        Public Sub DifferentObjectSameProperty()\n            Dim First As New ClassWithListProperty\n            Dim Second As New ClassWithListProperty\n\n            First.IntList(0) = 1\n            First.IntList2(0) = 11\n            Second.IntList(0) = 2\n            Second.IntList2(0) =22\n        End Sub\n\n        Public Sub SamePropertyDifferentIndex()\n            Dim First As New ClassWithListProperty\n            First.IntList(0) = 1\n            First.IntList(1) = 2 ' ok, different index\n        End Sub\n\n        Public Sub FNBecauseOfTheOrder()\n            Dim First As New ClassWithListProperty\n\n            First.IntList(0) = 1\n            First.IntList2(1) = 2\n            First.IntList(0) = 3 ' FN\n            First.IntList2(1) = 4 ' FN\n        End Sub\n\n        Public Sub NoncompliantWithSameIndex()\n            Dim First As New ClassWithListProperty\n            First.IntList(0) = 1 ' Secondary\n            First.IntList(0) = 3 ' Noncompliant\n            First.IntList2(1) = 2 ' Secondary\n            First.IntList2(1) = 4 ' Noncompliant\n        End Sub\n\n        Public Sub DifferentIndexes()\n            Dim First As New ClassWithListProperty\n\n            First.IntList(0) = 1\n            First.IntList2(1) = 2\n            First.IntList(1) = 3\n            First.IntList2(0) = 4\n        End Sub\n\n        Public Sub CompliantDeeplyNested()\n            Dim First As New ClassWithNested\n            Dim Second As New ClassWithNested\n\n            First.Alpha.IntList(0) = 1\n            First.Alpha.IntList2(0) = 11\n            First.Beta.IntList(0) = 1111\n            First.Beta.IntList2(0) = 11111\n            Second.Alpha.IntList(0) = 2\n            Second.Alpha.IntList2(0) = 22\n            Second.Beta.IntList(0) = 222\n            Second.Beta.IntList2(0) = 2222\n        End Sub\n\n        Public Sub NonCompliantDeeplyNested()\n            Dim First As New ClassWithNested\n            Dim Second As New ClassWithNested\n\n            First.Alpha.IntList(0) = 1 ' Secondary\n            First.Alpha.IntList(0) = 2 ' Noncompliant\n            First.Beta.IntList(0) = 3\n            First.Beta.IntList2(0) = 4\n            Second.Alpha.IntList(0) = 5\n            Second.Alpha.IntList2(0) = 6\n            Second.Beta.IntList(1) = 7 ' FN\n            Second.Beta.IntList2(0) = 8\n            Second.Beta.IntList(1) = 9 ' FN\n            First.Beta.IntList(3) = 10\n            Second.Beta.IntList(3) = 11\n        End Sub\n\n        Private Class ClassWithListProperty\n\n            Public ReadOnly Property IntList As List(Of Int32)\n                Get\n                    Return Nothing\n                End Get\n            End Property\n\n            Public ReadOnly Property IntList2 As List(Of Int32)\n                Get\n                    Return Nothing\n                End Get\n            End Property\n\n        End Class\n\n        Private Class ClassWithNested\n\n            Public ReadOnly Property Alpha As ClassWithListProperty\n                Get\n                    Return Nothing\n                End Get\n            End Property\n\n            Public ReadOnly Property Beta As ClassWithListProperty\n                Get\n                    Return Nothing\n                End Get\n            End Property\n\n        End Class\n\n    End Class\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotShiftByZeroOrIntSize.CSharp10.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    class Foo\n    {\n        public void RightShift()\n        {\n            int i = 0;\n            (int a, i) = (0, i >> 0); // Noncompliant {{Remove this useless shift by 0.}}\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotShiftByZeroOrIntSize.CSharp11.cs",
    "content": "﻿using System;\n\nclass Program\n{\n    void UnsignedRightShiftOperator(int i, ulong q)\n    {\n        i = i >>> 60; // Noncompliant\n        i = i >>> 31; // Compliant\n        i >>>= 40; // Noncompliant\n\n        q = q >>> 64; // Noncompliant\n        q = q >>> 0; // Compliant\n        q >>>= 70; // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotShiftByZeroOrIntSize.CSharp9.cs",
    "content": "﻿using System;\n\n// Native Integers can be either 32b or 64b depending on the underlying system.\n// It's best not to raise, to avoid FPs.\n\nnint i = 1 << 10;\n\ni = 1 << 32;  // FN, 1 is Int32\ni = (nint)1 << 32;  // Compliant\n\ni = i << 32; // Compliant\ni = i >> 32; // Compliant\ni = i << 48; // Compliant\ni = i << 63; // Compliant\n\ni = i << 64; // Compliant\ni = i >> 64; // Compliant\ni = i << 128; // Compliant\n\nnuint ui = 1 << 10;\n\nui = 1 << 32; // FN, 1 is Int32\nui = (nuint)1 << 32; // Compliant\n\nui = ui << 32; // Compliant\nui = ui << 48; // Compliant\nui = ui << 63; // Compliant\n\nui = ui << 64; // Compliant\nui = ui << 72; // Compliant\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotShiftByZeroOrIntSize.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    class Foo\n    {\n        private void Test()\n        {\n            byte b = 1;\n            b = (byte)(b << 10);\n            b = (byte)(b << 10);\n            b = 1 << 0;\n\n            sbyte sb = 1;\n            sb = (sbyte)(sb << 10);\n\n            int i = 1 << 10;\n            i = i << 32;  // Noncompliant\n            uint ui = 1 << 32; // Noncompliant\n            Int32 i32 = 1 << 32; // Noncompliant\n            Int64 i64 = 1 << 32;\n            Int64 i642 = 1 << 64; // Noncompliant\n\n            long l = 1 << 32;\n            l = 1 << 64; // Noncompliant {{Remove this useless shift by 64.}}\n            ulong ul = 1 << 64; // Noncompliant\n            ul = 1 << 65; // Noncompliant {{Correct this shift; shift by 1 instead.}}\n\n            ul <<= 0;\n            ul <<= 1025; // Noncompliant {{Correct this shift; shift by 1 instead.}}\n            ul <<= \"I am not an integer\"; // Error [CS0019]\n\n            b <<= 16;\n            b <<= 17;\n\n            int value =\n                      (b & 0xff) << 56 // Noncompliant {{Either promote shift target to a larger integer type or shift by 24 instead.}}\n                    | (b & 0xff) << 48 // Noncompliant {{Either promote shift target to a larger integer type or shift by 16 instead.}}\n                    | (b & 0xff) << 40 // Noncompliant {{Either promote shift target to a larger integer type or shift by 8 instead.}}\n                    | (b & 0xff) << 32 // Noncompliant {{Either promote shift target to a larger integer type or shift by less than 32 instead.}}\n                    | (b & 0xff) << 24\n                    | (b & 0xff) << 16\n                    | (b & 0xff) << 8\n                    | (b & 0xff) << 0;\n        }\n\n        private void NonIntegerTypes()\n        {\n            object o = 1 << 1024; // Compliant\n            IDoNotExist e = 1 << 1024; // Compliant // Error [CS0246]\n\n            double d = 1 << 1024; // Compliant\n            float f = 1 << 1024; // Compliant\n            decimal m = 1 << 1024; // Compliant\n            Single s = 1 << 1024; // Compliant\n        }\n\n\n        private int Property\n        {\n            get { return 1 << 0; } // Noncompliant\n            set { int i = 1 << 0; } // Noncompliant\n        }\n\n        private void Lambda()\n        {\n            Func<int> x = () => 1 << 0; // Noncompliant\n        }\n\n        private void ParanthesesAttack()\n        {\n            int i;\n            i = (1) << 0; // Noncompliant\n\n\n            i = (((1))) << 0; // Noncompliant\n\n\n            i = 1 << (0); // Noncompliant\n\n\n            i = 1 << (((0))); // Noncompliant\n\n\n            (((i))) = (((1))) << (((0))); // Noncompliant\n\n\n            (((i))) <<= (((0))); // Noncompliant\n        }\n\n        public byte Next() => 1;\n\n        public int GetInt()\n        {\n            return (short)(((Next() & 0xff) << 24)\n                        | ((Next() & 0xff) << 16)\n                        | ((Next() & 0xff) << 8)\n                        | ((Next() & 0xff) << 0));\n        }\n\n        private int RightShift()\n        {\n            // Error@+1 [CS0165] - use of unassigned var\n            int i = i >> 60; // Noncompliant {{Correct this shift; '60' is larger than the type size.}}\n            i >>= 60; // Noncompliant {{Correct this shift; '60' is larger than the type size.}}\n            int i2 = i >> 31; // Compliant\n            // Error@+1 [CS0165] - use of unassigned var\n            ulong ul = ul >> 64; // Noncompliant {{Correct this shift; '64' is larger than the type size.}}\n            i = i >> 0; // Compliant\n\n\n            i = i >> 0; // Noncompliant {{Remove this useless shift by 0.}}\n\n\n            ul = ul >> 32; // Compliant\n            ul = ul << 0;  // Compliant\n\n\n            ul = ul << 32; // Compliant\n            ul = ul >> 0;  // Compliant\n\n            return 42;\n        }\n\n        // See https://github.com/SonarSource/sonar-dotnet/issues/2016\n        private void ImproveShiftingBehavior()\n        {\n            short x = 12;\n            short result_01 = (short)(x >> 1);\n            short result_17 = (short)(x >> 17);\n            short result_33 = (short)(x >> 33); // Noncompliant\n        }\n    }\n}\n\n// https://sonarsource.atlassian.net/browse/NET-1122\nnamespace Enums\n{\n    enum Int8Enum : byte\n    {\n        One = 1,\n        Two = 1 << 1,\n        Three = 1 << 7,\n        Four = unchecked((byte)(1 << 9)), // FN\n        Five = (byte)(1 << 9), // Error [CS0221]\n        Six = unchecked((byte)(Three << 2)), // FN\n        Seven = Three << 2, // Error [CS0031]\n    }\n\n    enum Int16Enum : short\n    {\n        One = 1,\n        Two = 1 << 1,\n        Three = 1 << 13,\n        Four = unchecked((short)(1 << 17)), // FN\n        Five = (short)(1 << 17), // Error [CS0221]\n        Six = unchecked((short)(Three << 2)), // FN\n        Seven = Three << 2, // Error [CS0031]\n    }\n\n    enum Int32Enum : int\n    {\n        One = 1,\n        Two = 1 << 1,\n        Three = 1 << 31,\n        Four = 1 << 33, // FN\n        Five = Three << 2, // FN\n    }\n\n    enum Int64Enum : long\n    {\n        One = 1,\n        Two = 1 << 1,\n        Three = 1 << 63,\n        Four = 1 << 65, // FN\n        Five = Three << 2, // FN\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotTestThisWithIsOperator.CSharp10.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        public List<int> MyProperty { get; set; }\n\n        public Program(object o, object i)\n        {\n            if (this is Program { MyProperty.Count: 2 }) // Noncompliant\n//              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            {\n            }\n\n            if (o is Program and { MyProperty.Count: 2 })\n            {\n            }\n\n            switch (this) // Noncompliant\n            {\n                case Program { MyProperty.Count: 5 }: // Secondary\n//                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n                    break;\n                default:\n                    break;\n            }\n\n            var result = this switch // Noncompliant\n            {\n                Program { MyProperty.Count: 5 } => 1, // Secondary\n//              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n                _ => 3\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotTestThisWithIsOperator.CSharp11.cs",
    "content": "﻿using System;\nusing System.Collections;\n\nnamespace Tests.Diagnostics\n{\n    public class SomeClass : ArrayList\n    {\n        public void SomeMethod()\n        {\n            var a = this is [1, 2, 3]; // Noncompliant\n\n            switch (this) // Noncompliant, switch statement\n            {\n                case [1, 2, 3]: // Secondary\n                    return;\n                case [4, 5, 6]: // Secondary\n                    return;\n                default:\n                    break;\n            }\n\n            var res = this switch // Noncompliant, switch expression\n            {\n                [1, 2, 3] => 1, // Secondary\n                [4, 5, 6] => 2, // Secondary\n                _ => 42\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotTestThisWithIsOperator.CSharp9.cs",
    "content": "﻿using System;\nusing System.Collections;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        public int MyProperty { get; set; }\n        public object MyProperty2 { get; set; }\n\n        public Program(object o, object i)\n        {\n            if (this is Program and { MyProperty: 2 }) // Noncompliant\n//              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            {\n            }\n\n            if (this is not IDisposable) // Noncompliant {{Offload the code that's conditional on this type test to the appropriate subclass and remove the condition.}}\n//              ^^^^^^^^^^^^^^^^^^^^^^^\n            {\n            }\n\n            if (o is not IDisposable)\n            {\n            }\n\n            if (o is Program)\n            {\n            }\n\n            if (this is null) // Compliant as it does not check the type.\n            {\n\n            }\n\n            if (this is not null) // Compliant as it does not check the type.\n            {\n\n            }\n\n            if (this is Program or IDisposable) // Noncompliant\n            {\n            }\n\n            if (this is Program and IDisposable) // Noncompliant\n            {\n            }\n\n            if (this is not null and (IDisposable or Program))  // Noncompliant\n            {\n            }\n\n            if (o is not null and (IDisposable or Program))\n            {\n            }\n\n            if (this is var variable) // Compliant\n            {\n            }\n\n            if (this is { MyProperty: 5 }) // Compliant as it does not check the type\n            {\n            }\n\n            if (this is ({ MyProperty: 5 })) // Compliant as it does not check the type\n            {\n            }\n\n            if (this is not { MyProperty: 5 })\n            {\n            }\n\n            if (this is { MyProperty: 5 })\n            {\n                if (this is Program) // Noncompliant\n                {\n                }\n            }\n\n            if (this is Program p) // Noncompliant\n            {\n            }\n\n            if (this is { MyProperty: int prop1 and > 5 }) // Compliant\n            {\n            }\n\n            if (this is Program { MyProperty: int prop2 and > 5 } e) // Noncompliant\n            {\n            }\n\n            if (this is { MyProperty2: IDisposable }) // Compliant\n            {\n            }\n\n            switch (this) // Compliant\n            {\n                case { MyProperty: 5 }:\n                    break;\n                case { MyProperty: 3 }:\n                case null:\n                    break;\n                case not null:\n                    break;\n            }\n\n            switch (this) // Noncompliant Offload the code that's conditional on this type test to the appropriate subclass and remove the condition.\n//                  ^^^^\n            {\n                case IDisposable: // Secondary\n//                   ^^^^^^^^^^^\n                    break;\n                default:\n                    break;\n            }\n\n            switch (this) // Noncompliant\n            {\n                case IEnumerable enumerable: // Secondary\n//                   ^^^^^^^^^^^^^^^^^^^^^^\n                    break;\n                default:\n                    break;\n            }\n\n            switch (this) // Noncompliant\n            {\n                case Program { MyProperty: 5 }: // Secondary\n//                   ^^^^^^^^^^^^^^^^^^^^^^^^^\n                    break;\n                default:\n                    break;\n            }\n\n            switch (o)\n            {\n                case IDisposable:\n                    break;\n                case IEnumerable:\n                    break;\n                default:\n                    break;\n            }\n\n            var result = (((this))) switch // Noncompliant Offload the code that's conditional on this type test to the appropriate subclass and remove the condition.\n//                       ^^^^^^^^^^\n            {\n                IDisposable => 1, // Secondary\n//              ^^^^^^^^^^^\n                IEnumerable => 2, // Secondary\n//              ^^^^^^^^^^^\n                _ => 3\n            };\n\n            result = this switch // Noncompliant\n//                   ^^^^\n            {\n                IDisposable disposable => 1, // Secondary\n//              ^^^^^^^^^^^^^^^^^^^^^^\n                _ => 3\n            };\n\n            result = this switch // Noncompliant\n            {\n                Program { MyProperty: 5 } => 1, // Secondary\n//              ^^^^^^^^^^^^^^^^^^^^^^^^^\n                _ => 3\n            };\n\n            result = this switch // Compliant\n            {\n                { MyProperty: 5 } => 1,\n                { MyProperty: 3 } => 2,\n                null => 4,\n                not null => 5\n            };\n\n            result = o switch\n            {\n                IDisposable => 1,\n                IEnumerable => 2,\n                _ => 3\n            };\n\n            if ((o, (this, i)) is (Program, (Program, Program))) // FN\n            {\n            }\n\n            switch ((this, o, i)) // FN\n            {\n                case (Program, Program, Program):\n                    break;\n                default:\n                    break;\n            }\n        }\n\n        public bool SomeMethod(object o)\n        {\n            if (this is { MyProperty: 5 })\n            {\n                return this is Program { MyProperty: 5 }; // Noncompliant\n            }\n\n            switch (this)\n            {\n                case { MyProperty: 5 }:\n                    return this is Program { MyProperty: 5 }; // Noncompliant\n                default:\n                    break;\n            }\n\n            switch (o)\n            {\n                case IDisposable:\n                    {\n                        return this is Program { MyProperty: 5 }; // Noncompliant\n                    }\n                case IEnumerable:\n                    break;\n                default:\n                    break;\n            }\n\n            var result = this switch\n            {\n                { MyProperty: 5 } => this is Program { MyProperty: 5 }, // Noncompliant\n//                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n                { MyProperty: 3 } => this is Program { MyProperty: 3 }, // Noncompliant\n                _ => false\n            };\n\n            return false;\n        }\n    }\n\n    record R\n    {\n        void Foo()\n        {\n            if (this is IDisposable) // Noncompliant {{Offload the code that's conditional on this type test to the appropriate subclass and remove the condition.}}\n//              ^^^^^^^^^^^^^^^^^^^\n            {\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotTestThisWithIsOperator.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        public Program(object o)\n        {\n            if (this is IDisposable) // Noncompliant {{Offload the code that's conditional on this type test to the appropriate subclass and remove the condition.}}\n//              ^^^^^^^^^^^^^^^^^^^\n            {\n            }\n\n            if (((((this)))) is IDisposable) // Noncompliant {{Offload the code that's conditional on this type test to the appropriate subclass and remove the condition.}}\n//              ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            {\n            }\n\n            if (o is IDisposable)\n            {\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotThrowFromDestructors.CSharp9.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    record Program\n    {\n        public void Foo() => throw new Exception(); // Compliant\n\n        public Program()\n        {\n            throw new Exception(); // Compliant, ctor covered by S3877\n        }\n\n        ~Program()\n        {\n            throw new Exception(); // Noncompliant {{Remove this 'throw' statement.}}\n//          ^^^^^^^^^^^^^^^^^^^^^^\n\n            void Inner()\n            {\n                throw new Exception(); // Noncompliant\n            };\n\n            try\n            {\n                throw new Exception(); // Noncompliant, generally a bad idea to throw and catch in the same method\n            }\n            catch (Exception)\n            {\n            }\n\n            try\n            {\n                Foo();\n            }\n            catch (Exception)\n            {\n                throw; // Noncompliant, rethrowing has the same effect as throwing\n            }\n        }\n    }\n\n    record C\n    {\n        ~C() => throw new Exception(); // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotThrowFromDestructors.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        public void Foo()\n        {\n            throw new Exception(); // Compliant\n        }\n\n        public Program()\n        {\n            throw new Exception(); // Compliant, ctor covered by S3877\n        }\n\n        ~Program()\n        {\n            throw new Exception(); // Noncompliant {{Remove this 'throw' statement.}}\n//          ^^^^^^^^^^^^^^^^^^^^^^\n\n            void Inner()\n            {\n                throw new Exception(); // Noncompliant, C# 7+\n            };\n\n            try\n            {\n                throw new Exception(); // Noncompliant, generally a bad idea to throw and catch in the same method\n            }\n            catch (Exception)\n            {\n            }\n\n            try\n            {\n                Foo();\n            }\n            catch (Exception)\n            {\n                throw; // Noncompliant, rethrowing has the same effect as throwing\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotThrowFromDestructors.vb",
    "content": "﻿Imports System\n\nNamespace Tests.Diagnostics\n    Class Program\n\n        Public Sub Foo()\n            Throw New Exception()\n        End Sub\n\n        Public Sub FooNoParens\n            Throw New Exception()\n        End Sub\n\n        Public Sub New()\n            Throw New Exception()\n        End Sub\n\n        Protected Overrides Overloads Sub fiNAliZE()\n            Throw New Exception() ' Noncompliant {{Remove this 'Throw' statement.}}\n'           ^^^^^^^^^^^^^^^^^^^^^\n            Try\n                Throw New Exception() ' Noncompliant\n            Catch __unusedException1__ As Exception\n            End Try\n\n            Try\n                Foo()\n            Catch __unusedException1__ As Exception\n                Throw ' Noncompliant\n            End Try\n        End Sub\n    end class\n\n    Class NoViolation1\n        Protected Sub Finalize(i As Integer)\n            Throw New Exception()\n        End Sub\n    End Class\n    Class NoViolation2\n        Sub Finalize()\n            Throw New Exception()\n        End Sub\n    End Class\n    Class NoViolation3\n        Protected Sub Finalize(Of T)()\n            Throw New Exception()\n        End Sub\n    End Class\n    Class NoViolation4\n        Protected Function Finalize() As Integer\n            Throw New Exception()\n        End Function\n    End Class\nEnd Namespace\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotUseByVal.Fixed.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.Linq\nImports System.Text\n\nNamespace Tests.TestCases\n    Class Foo\n        Public Function NoByVal(parameter As String) As String ' Compliant\n            Return parameter\n        End Function\n\n        Public Function OptionalNoByVal(Optional parameter As String = \"Default\") As String ' Compliant\n            Return parameter\n        End Function\n\n        Public Function WithByVal(byValParameter As String) As String ' Fixed\n            Return byValParameter\n        End Function\n\n        Public Function SecondParameter(parameter As String, byValParameter As String) As String ' Fixed\n            Return byValParameter\n        End Function\n\n        Public Function OptionalWithByVal(Optional byValParameter As String = \"Default\") As String ' Fixed\n            Return byValParameter\n        End Function\n\n        Public Function NoByRef(ByRef parameter As String) As String ' Compliant\n            Return parameter\n        End Function\n\n        Public Function OptionalNoByRef(Optional ByRef parameter As String = \"Default\") As String ' Compliant\n            Return parameter\n        End Function\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotUseByVal.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.Linq\nImports System.Text\n\nNamespace Tests.TestCases\n    Class Foo\n        Public Function NoByVal(parameter As String) As String ' Compliant\n            Return parameter\n        End Function\n\n        Public Function OptionalNoByVal(Optional parameter As String = \"Default\") As String ' Compliant\n            Return parameter\n        End Function\n\n        Public Function WithByVal(ByVal byValParameter As String) As String ' Noncompliant {{Remove this redundant 'ByVal' modifier.}}\n'                                 ^^^^^\n            Return byValParameter\n        End Function\n\n        Public Function SecondParameter(parameter As String, ByVal byValParameter As String) As String ' Noncompliant\n'                                                            ^^^^^\n            Return byValParameter\n        End Function\n\n        Public Function OptionalWithByVal(Optional ByVal byValParameter As String = \"Default\") As String ' Noncompliant\n            Return byValParameter\n        End Function\n\n        Public Function NoByRef(ByRef parameter As String) As String ' Compliant\n            Return parameter\n        End Function\n\n        Public Function OptionalNoByRef(Optional ByRef parameter As String = \"Default\") As String ' Compliant\n            Return parameter\n        End Function\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotUseCollectionInItsOwnMethodCalls.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Tests.Diagnostics\n{\n    class Program : IEqualityComparer<int>\n    {\n        public bool Equals(int left, int right) => left == right;\n\n        public int GetHashCode(int obj) => 42;\n\n        void UnexpectedBehavior()\n        {\n            var list = new List<int>();\n            var set = new HashSet<int>();\n\n            list.AddRange(list);           // Compliant, see: https://sonarsource.atlassian.net/browse/NET-1729\n            list.Concat(list);             // Compliant, see: https://sonarsource.atlassian.net/browse/NET-1729\n            Enumerable.Concat(list, list); // Compliant, see: https://sonarsource.atlassian.net/browse/NET-1729\n        }\n\n        void AlwaysSameCollection()\n        {\n            var list = new List<int>();\n            var set = new HashSet<int>();\n\n            list.Union(list); // Noncompliant {{Change one instance of 'list' to a different value; This operation always produces the same collection.}}\n            // Secondary@-1\n            list.Union(list, this); // Noncompliant\n            // Secondary@-1\n            Enumerable.Union(list, list); // Noncompliant\n            // Secondary@-1\n            list.Intersect(list); // Noncompliant\n            // Secondary@-1\n            Enumerable.Intersect(list, list); // Noncompliant\n            // Secondary@-1\n            set.UnionWith(set); // Noncompliant\n            // Secondary@-1\n            set.IntersectWith(set); // Noncompliant\n            // Secondary@-1\n        }\n\n        void AlwaysEmptyCollection()\n        {\n            var list = new List<int>();\n            var set = new HashSet<int>();\n\n            list.Except(list); // Noncompliant {{Change one instance of 'list' to a different value; This operation always produces an empty collection.}}\n            // Secondary@-1\n            Enumerable.Except(list, list); // Noncompliant\n            // Secondary@-1\n            set.ExceptWith(set); // Noncompliant\n            // Secondary@-1\n            set.SymmetricExceptWith(set); // Noncompliant\n            // Secondary@-1\n        }\n\n        void AlwaysTrue()\n        {\n            var list = new List<int>();\n            var set = new HashSet<int>();\n\n            list.SequenceEqual(list); // Noncompliant {{Change one instance of 'list' to a different value; Comparing to itself always returns true.}}\n            // Secondary@-1\n            Enumerable.SequenceEqual(list, list); // Noncompliant\n            // Secondary@-1\n            set.IsSubsetOf(set); // Noncompliant\n            // Secondary@-1\n            set.IsSupersetOf(set); // Noncompliant\n            // Secondary@-1\n            set.Overlaps(set); // Noncompliant\n            // Secondary@-1\n            set.SetEquals(set); // Noncompliant\n            // Secondary@-1\n        }\n\n        void AlwaysFalse()\n        {\n            var set = new HashSet<int>();\n\n            set.IsProperSubsetOf(set); // Noncompliant {{Change one instance of 'set' to a different value; Comparing to itself always returns false.}}\n            // Secondary@-1\n            set.IsProperSupersetOf(set); // Noncompliant\n            // Secondary@-1\n        }\n\n        void ValidCases()\n        {\n            var list1 = new List<int>();\n            var list2 = new List<int>();\n            var set1 = new HashSet<int>();\n            var set2 = new HashSet<int>();\n\n            list1.AddRange(list2);\n            list1.Concat(list2);\n            Enumerable.Concat(list1, list2);\n\n            list1.Union(list2);\n            list1.Union(list2, this);\n            Enumerable.Union(list1, list2);\n            list1.Intersect(list2);\n            Enumerable.Intersect(list1, list2);\n            set1.UnionWith(set2);\n\n            list1.SequenceEqual(list2);\n            Enumerable.SequenceEqual(list1, list2);\n\n            list1.Except(list2);\n            Enumerable.Except(list1, list2);\n            set1.ExceptWith(set2);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotUseDateTimeNow.cs",
    "content": "﻿using System;\nusing System.Linq;\nusing static System.DateTime;\nusing AliasedDateTime = System.DateTime;\n\nclass Test\n{\n    void TestCases()\n    {\n        var currentTime = DateTime.Now;                                             // Noncompliant {{Use UTC when recording DateTime instants}}\n        //                ^^^^^^^^^^^^\n        currentTime = System.DateTime.Now;                                          // Noncompliant\n        currentTime = Now;                                                          // FN\n        currentTime = AliasedDateTime.Now;                                          // Noncompliant\n\n        var today = DateTime.Today;                                                 // Noncompliant - same as DateTime.Now, but the the time is set to 00:00:00\n\n        var currentTimeWithOffset = DateTimeOffset.Now;                             // Compliant - DateTimeOffset stores the time zone\n        currentTimeWithOffset = DateTimeOffset.UtcNow;\n\n        currentTime = DateTimeOffset.Now.DateTime;                                  // Noncompliant - same as DateTime.Now\n        currentTime = DateTimeOffset.UtcNow.DateTime;                               // Compliant - same as DateTime.UtcNow\n\n        var currentDate = DateTimeOffset.Now.Date;                                  // Noncompliant - same as DateTime.Now.Date\n        currentDate = DateTimeOffset.UtcNow.Date;                                   // Compliant - same as DateTime.UtcNow.Date\n\n        currentDate = DateTime.Now.AddDays(1);                                      // Noncompliant\n        currentDate = (DateTime.Now).AddDays(1);                                    // Noncompliant\n        currentDate = DateTime.Now + TimeSpan.FromDays(1);                          // Noncompliant\n\n        if (DateTime.Now > currentTime)                                             // Noncompliant\n        {\n        }\n\n        var hours = Enumerable.Range(0, 10).Select(x => DateTime.Now.AddHours(x));  // Noncompliant\n\n        void InnerMethod()\n        {\n            var now = DateTime.Now;                                                 // Noncompliant\n        }\n\n        var propertyName = nameof(DateTime.Now);                                    // Compliant - the value of the property is not used\n    }\n}\n\nclass CustomTypeCalledDateTime\n{\n    public struct DateTime\n    {\n        public static DateTime Now => new DateTime();\n    }\n\n    CustomTypeCalledDateTime()\n    {\n        _ = DateTime.Now;                                                           // Compliant - this is not System.DateTime\n    }\n}\n\nclass FakeNameOf\n{\n    string nameof(object o) => \"\";\n\n    void UsesFakeNameOfMethod()\n    {\n        nameof(DateTime.Now);                                                       // FN\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotUseDateTimeNow.vb",
    "content": "﻿Imports System\nImports System.Linq\nImports System.DateTime\nImports AliasedDateTime = System.DateTime\n\nClass Test\n    Private Sub TestCases()\n        Dim currentTime = DateTime.Now                                                      ' Noncompliant {{Use UTC when recording DateTime instants}}\n        '                 ^^^^^^^^^^^^\n        currentTime = Date.Now                                                              ' Noncompliant\n        currentTime = Date.Now                                                              ' Noncompliant\n        currentTime = System.DateTime.Now                                                   ' Noncompliant\n        currentTime = DateTime.Now                                                          ' Noncompliant\n        currentTime = Now                                                                   ' FN\n        currentTime = AliasedDateTime.Now                                                   ' Noncompliant\n\n        Dim today = DateTime.Today                                                          ' Noncompliant - same as DateTime.Now, but the the time is set to 00:00:00\n\n        Dim currentTimeWithOffset = DateTimeOffset.Now                                      ' Compliant - DateTimeOffset stores the time zone\n        currentTimeWithOffset = DateTimeOffset.UtcNow\n\n        currentTime = DateTimeOffset.Now.DateTime                                           ' Noncompliant - same as DateTime.Now\n        currentTime = DateTimeOffset.UtcNow.DateTime                                        ' Compliant - same as DateTime.UtcNow\n\n        Dim currentDate = DateTimeOffset.Now.Date                                           ' Noncompliant - same as DateTime.Now.Date\n        currentDate = DateTimeOffset.UtcNow.Date                                            ' Compliant - same as DateTime.UtcNow.Date\n\n        currentDate = DateTime.Now.AddDays(1)                                               ' Noncompliant\n        currentDate = DateTime.Now.AddDays(1)                                               ' Noncompliant\n        currentDate = DateTime.Now + TimeSpan.FromDays(1)                                   ' Noncompliant\n\n        If DateTime.Now > currentTime Then                                                  ' Noncompliant\n        End If\n\n        Dim hours = Enumerable.Range(0, 10).Select(Function(x) DateTime.Now.AddHours(x))    ' Noncompliant\n\n        Dim propertyName = NameOf(DateTime.Now)                                             ' Compliant\n    End Sub\nEnd Class\n\nClass CustomTypeCalledDateTime\n    Public Structure DateTime\n        Public Shared ReadOnly Property Now As DateTime\n            Get\n                Return New DateTime()\n            End Get\n        End Property\n    End Structure\n\n    Private Sub New()\n        Dim instant = DateTime.Now                                                          ' Compliant - this is not System.DateTime\n    End Sub\nEnd Class\n\nClass FakeNameOf\n    Private Function [nameof](o As Object) As String\n        Return \"\"\n    End Function\n\n    Private Sub UsesFakeNameOfMethod()\n        [nameof](Date.Now)                                                                  ' Noncompliant\n    End Sub\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotUseIIf.Fixed.vb",
    "content": "﻿Imports Microsoft.VisualBasic\n\nNamespace Tests.TestCases\n    Class Foo\n        Public Sub IIf_Should_Not_Be_Used()\n            Dim obj As Object = If(Date.Now.Year = 1999, \"Lets party!\", \"Lets party like it is 1999!\") ' Fixed\n        End Sub\n    End Class\n    Class Bar\n        Public Sub Method_With_Same_Name()\n            Dim obj As Object = IIf(Date.Now.Year = 1999, \"Lets party!\", \"Lets party like it is 1999!\")\n        End Sub\n        Public Function IIf(condition As Boolean, arg1 As Object, arg2 As Object) As Object\n            If (condition) Then\n                Return arg1\n            End If\n            Return arg2\n        End Function\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotUseIIf.vb",
    "content": "﻿Imports Microsoft.VisualBasic\n\nNamespace Tests.TestCases\n    Class Foo\n        Public Sub IIf_Should_Not_Be_Used()\n            Dim obj As Object = IIf(Date.Now.Year = 1999, \"Lets party!\", \"Lets party like it is 1999!\") ' Noncompliant {{Use the 'If' operator here instead of 'IIf'.}}\n'                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        End Sub\n    End Class\n    Class Bar\n        Public Sub Method_With_Same_Name()\n            Dim obj As Object = IIf(Date.Now.Year = 1999, \"Lets party!\", \"Lets party like it is 1999!\")\n        End Sub\n        Public Function IIf(condition As Boolean, arg1 As Object, arg2 As Object) As Object\n            If (condition) Then\n                Return arg1\n            End If\n            Return arg2\n        End Function\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotUseLiteralBoolInAssertions.MsTest.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\n\nnamespace Tests.Diagnostics\n{\n    class Foo\n    {\n        public void Test()\n        {\n            bool b = true;\n\n            Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(true, b); // Noncompliant\n            Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreNotEqual(true, b); // Noncompliant\n            Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreSame(true, b); // Noncompliant\n            Microsoft.VisualStudio.TestTools.UnitTesting.Assert.IsFalse(true); // Noncompliant\n            Microsoft.VisualStudio.TestTools.UnitTesting.Assert.IsTrue(true); // Noncompliant\n            Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(false, b); // Noncompliant\n            Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(b, false); // Noncompliant\n            Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(true, false); // Noncompliant\n            Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(b, b);\n\n            Debug.Assert(false); // Noncompliant\n            System.Diagnostics.Debug.Assert(true); // Noncompliant {{Remove or correct this assertion.}}\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n            System.Diagnostics.Debug.Assert(b);\n\n            bool? x = false;\n            Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(false, x); // Compliant, since the comparison triggers a conversion\n\n            Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(); // Error [CS1501] (code coverage)\n            Foo(); // Error [CS1955] (code coverage)\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotUseLiteralBoolInAssertions.NUnit.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    class Foo\n    {\n        public void Test()\n        {\n            bool b = true;\n\n            NUnit.Framework.Assert.AreEqual(true, b); // Noncompliant\n            NUnit.Framework.Assert.AreNotEqual(true, b); // Noncompliant\n            NUnit.Framework.Assert.AreNotSame(true, b); // Noncompliant\n            NUnit.Framework.Assert.AreSame(true, b); // Noncompliant\n            NUnit.Framework.Assert.False(true); // Noncompliant\n            NUnit.Framework.Assert.IsFalse(true); // Noncompliant\n            NUnit.Framework.Assert.IsTrue(true); // Noncompliant\n            NUnit.Framework.Assert.That(true); // Noncompliant\n            NUnit.Framework.Assert.True(true); // Noncompliant\n            NUnit.Framework.Assert.AreEqual(false, b); // Noncompliant\n            NUnit.Framework.Assert.AreEqual(b, false); // Noncompliant\n            NUnit.Framework.Assert.AreEqual(true, false); // Noncompliant\n\n            NUnit.Framework.Assert.AreEqual(b, b);\n\n            bool? x = false;\n            NUnit.Framework.Assert.AreEqual(false, x); // Compliant, since the comparison triggers a conversion\n            NUnit.Framework.Assert.AreEqual(x, false); // Compliant, since the comparison triggers a conversion\n\n            int i = 1;\n            NUnit.Framework.Assert.AreEqual(i, false); // Noncompliant\n            NUnit.Framework.Assert.AreEqual(false, i); // Noncompliant\n            NUnit.Framework.Assert.AreEqual(); // Error [CS1501] (code coverage)\n\n            FooBar(); // Error [CS0103] (code coverage)\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotUseLiteralBoolInAssertions.NUnit4.cs",
    "content": "using System;\nusing NUnit.Framework.Legacy;\n\nnamespace Tests.Diagnostics\n{\n    class FooNUnit4\n    {\n        public void Test()\n        {\n            bool b = true;\n\n            ClassicAssert.AreEqual(true, b);    // Noncompliant\n            ClassicAssert.AreNotEqual(true, b); // Noncompliant\n            ClassicAssert.AreNotSame(true, b);  // Noncompliant\n            ClassicAssert.AreSame(true, b);     // Noncompliant\n            ClassicAssert.False(true);          // Noncompliant\n            ClassicAssert.IsFalse(true);        // Noncompliant\n            ClassicAssert.IsTrue(true);         // Noncompliant\n            ClassicAssert.True(true);           // Noncompliant\n            ClassicAssert.AreEqual(false, b);   // Noncompliant\n            ClassicAssert.AreEqual(b, false);   // Noncompliant\n            ClassicAssert.AreEqual(true, false); // Noncompliant\n\n            ClassicAssert.AreEqual(b, b);\n\n            bool? x = false;\n            ClassicAssert.AreEqual(false, x); // Compliant, since the comparison triggers a conversion\n            ClassicAssert.AreEqual(x, false); // Compliant, since the comparison triggers a conversion\n\n            int i = 1;\n            ClassicAssert.AreEqual(i, false); // Noncompliant\n            ClassicAssert.AreEqual(false, i); // Noncompliant\n            ClassicAssert.AreEqual();         // Error [CS1501] (code coverage)\n\n            FooBar(); // Error [CS0103] (code coverage)\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotUseLiteralBoolInAssertions.Xunit.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    class Foo\n    {\n        public void Test()\n        {\n            bool b = true;\n\n            Xunit.Assert.Equal(true, b); // Noncompliant\n            Xunit.Assert.NotEqual(true, b); // Noncompliant\n            Xunit.Assert.Same(true, b); // Noncompliant\n            Xunit.Assert.StrictEqual(true, b); // Noncompliant\n            Xunit.Assert.NotSame(true, b); // Noncompliant\n            Xunit.Assert.Equal(false, b); // Noncompliant\n            Xunit.Assert.Equal(b, false); // Noncompliant\n            Xunit.Assert.Equal(true, false); // Noncompliant\n\n            Xunit.Assert.Equal(b, b);\n            Xunit.Assert.True(true); // FN\n            Xunit.Assert.False(false); // FN\n\n            // There is no Assert.Fail in Xunit. Assert.True(false) or Assert.False(true) are ways to simulate it.\n            Xunit.Assert.True(false); // Compliant\n            Xunit.Assert.False(true); // Compliant\n\n            bool? x = false;\n            Xunit.Assert.Equal(false, x); // Compliant, since the comparison triggers a conversion\n\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotUseLiteralBoolInAssertions.XunitV3.cs",
    "content": "﻿using System;\nusing Xunit;\n\nnamespace Tests.Diagnostics\n{\n    class XUnitV3Tests\n    {\n        public void Test()\n        {\n            bool b = true;\n\n            Assert.Equal(true, b);          // Noncompliant\n            Assert.NotEqual(true, b);       // Noncompliant\n            Assert.Same(true, b);           // Noncompliant\n            Assert.NotSame(true, b);        // Noncompliant\n            Assert.StrictEqual(true, b);    // Noncompliant\n            Assert.NotStrictEqual(true, b); // Noncompliant\n            Assert.Equivalent(true, b);     // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotUseOutRefParameters.CSharp11.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public class S3874 : I3874\n    {\n        public static void SetRef(ref I3874 obj) // compliant because this is interface implementation\n        {\n            obj = new S3874();\n        }\n\n        public static void SetOut(out I3874 obj) // compliant because this is interface implementation\n        {\n            obj = new S3874();\n        }\n    }\n\n    public interface I3874\n    {\n        static abstract void SetRef(ref I3874 obj); // Noncompliant\n        static abstract void SetOut(out I3874 obj); // Noncompliant\n    }\n\n    public interface DefaultInterfaceImplementations\n    {\n        private void PrivateRefInst(ref int i) { }    // Compliant because not public\n        private static void PrivateRef(ref int i) { } // Compliant because not public\n        void RefInst(ref int i) { }                   // Noncompliant\n        void OutInst(out int i) { i = 1; }            // Noncompliant\n        static void Ref(ref int i) { }                // Noncompliant\n        static void Out(out int i) { i = 1; }         // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotUseOutRefParameters.CSharp9.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public interface IProgram\n    {\n        void Method1(out string value);\n//                   ^^^ {{Consider refactoring this method in order to remove the need for this 'out' modifier.}}\n        void Method2(ref string value);\n//                   ^^^ {{Consider refactoring this method in order to remove the need for this 'ref' modifier.}}\n        bool TryMethod2(out string value);\n    }\n\n    public abstract record AbstractRecord\n    {\n        public abstract void Method1(out string value); // Noncompliant\n        public abstract void Method2(ref string value); // Noncompliant\n        public abstract bool TryMethod2(out string value);\n    }\n\n    public record OverridenRecord : AbstractRecord\n    {\n        public override void Method1(out string value) { value = \"a\"; }\n        public override void Method2(ref string value) { }\n        public override bool TryMethod2(out string value) { value = \"a\"; return true; }\n    }\n\n    internal record InternalRecord\n    {\n        public void Method1(out string value) { value = \"a\"; }\n        public void Method2(ref string value) { }\n        public bool TryMethod2(out string value) { value = \"a\"; return true; }\n    }\n\n    public record Record\n    {\n        public void Method1(out string value1, out string value2) { value1 = \"a\"; value2 = \"a\"; }\n//                          ^^^\n//                                             ^^^ Noncompliant@-1\n\n        public void Method2(ref string value) { }// Noncompliant\n\n        public bool TryMethod2(out string value) { value = \"a\"; return true; }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotUseOutRefParameters.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n\n    public interface IProgram\n    {\n        void Method1(out string value);\n//                   ^^^ {{Consider refactoring this method in order to remove the need for this 'out' modifier.}}\n        void Method2(ref string value);\n//                   ^^^ {{Consider refactoring this method in order to remove the need for this 'ref' modifier.}}\n        void TryMethod(out string value);\n//                     ^^^ {{Consider refactoring this method in order to remove the need for this 'out' modifier.}}\n        bool TryMethod1(ref string value);\n//                      ^^^ {{Consider refactoring this method in order to remove the need for this 'ref' modifier.}}\n        bool TryMethod2(out string value);\n    }\n\n    public abstract class AbstractProgram\n    {\n        public abstract void Method1(out string value); // Noncompliant\n        public abstract void Method2(ref string value); // Noncompliant\n        public abstract void TryMethod(out string value); // Noncompliant\n        public abstract bool TryMethod1(ref string value); // Noncompliant\n        public abstract bool TryMethod2(out string value);\n    }\n\n    public class OverridenProgram : AbstractProgram\n    {\n        public override void Method1(out string value) { value = \"a\"; }\n        public override void Method2(ref string value) { }\n        public override void TryMethod(out string value) { value = \"a\"; }\n        public override bool TryMethod1(ref string value) { return false; }\n        public override bool TryMethod2(out string value) { value = \"a\"; return true; }\n    }\n\n    internal class InternalProgram\n    {\n        public void Method1(out string value) { value = \"a\"; }\n        public void Method2(ref string value) { }\n        public void TryMethod(out string value) { value = \"a\"; }\n        public bool TryMethod1(ref string value) { return false; }\n        public bool TryMethod2(out string value) { value = \"a\"; return true; }\n    }\n\n    public class Program\n    {\n        public void Method1(out string value1, out string value2) { value1 = \"a\"; value2 = \"a\"; }\n//                          ^^^\n//                                             ^^^ Noncompliant@-1\n\n        public void Method1(out string value) { value = \"a\"; } // Noncompliant\n\n        public void Method2(ref string value) { }// Noncompliant\n\n        public void TryMethod(out string value) { value = \"a\"; } // Noncompliant\n\n        public bool TryMethod1(ref string value) { return true; } // Noncompliant\n\n        public bool TryMethod2(out string value) { value = \"a\"; return true; }\n    }\n\n    // See https://github.com/SonarSource/sonar-dotnet/issues/2344\n    public class S3874 : I3874\n    {\n        public void SetRef(ref I3874 obj) // compliant because this is interface implementation\n        {\n            obj = new S3874();\n        }\n\n        public void SetOut(out I3874 obj) // compliant because this is interface implementation\n        {\n            obj = new S3874();\n        }\n    }\n\n    public interface I3874\n    {\n        void SetRef(ref I3874 obj); // Noncompliant\n        void SetOut(out I3874 obj); // Noncompliant\n    }\n\n\n    public class Person\n    {\n        public string FirstName { get; set; }\n        public string MiddleName { get; set; }\n        public string LastName { get; set; }\n\n        public Person(string fname, string mname, string lname)\n        {\n            FirstName = fname;\n            MiddleName = mname;\n            LastName = lname;\n        }\n\n        public void Deconstruct(out string fname, out string lname) // Compliant,\n                                                                    // https://docs.microsoft.com/en-us/dotnet/csharp/fundamentals/functional/deconstruct#user-defined-types\n        {\n            fname = FirstName;\n            lname = LastName;\n        }\n\n        public void Deconstruct(out string fname, out string lname, string notAnOutParam) // in Deconstruct all parameters have to be out parameteres.\n//                              ^^^\n//                                                ^^^ Noncompliant@-1\n        {\n            fname = FirstName;\n            lname = LastName + notAnOutParam;\n        }\n\n        public static void Deconstruct(out string foo) { foo = \"foo\"; } // Noncompliant\n        public static int Deconstruct(ref int bar) { return bar; } // Noncompliant\n        public static void Method(string foo)\n        {\n            LocalMethod(foo);\n            void LocalMethod(string outFoo)\n            {\n                outFoo = \"foo\";\n            }\n        }\n    }\n\n    public static class PersonExtention\n    {\n        public static void Deconstruct(this Person p, out string fname, out string lname) // Compliant - it's a deconstruct method for class Person\n        {\n            fname = p.FirstName;\n            lname = p.LastName;\n        }\n\n        public static void Deconstruct(this Person p, out string fname, out string lname, string notAnOutParameter) // in Deconstruct all parameters have to be out parameteres.\n//                                                    ^^^\n//                                                                      ^^^ Noncompliant@-1\n        {\n            fname = p.FirstName;\n            lname = p.LastName + notAnOutParameter;\n        }\n\n        public static int Deconstruct(this Person p, out int bar) { bar = 1; return bar; } // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotWriteToStandardOutput.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\n\nnamespace Tests.Diagnostics\n{\n    public class ConsoleLogging\n    {\n        private static byte[] GenerateKey(byte[] key)\n        {\n            Console.WriteLine(\"debug key = {0}\", BitConverter.ToString(key)); //Noncompliant {{Remove this logging statement.}}\n//          ^^^^^^^^^^^^^^^^^\n\n            Console.WriteLine(); //Noncompliant\n//          ^^^^^^^^^^^^^^^^^\n\n            Console.Write(\"debug key = {0}\", BitConverter.ToString(key)); //Noncompliant\n//          ^^^^^^^^^^^^^\n\n            Console.Write(true); //Noncompliant\n//          ^^^^^^^^^^^^^\n\n            Console.ReadKey();\n            System.Diagnostics.Debug.WriteLine(\"debug key = {0}\", BitConverter.ToString(key));\n            return key;\n        }\n\n        public static void LogDebug(string message) =>\n            Console.WriteLine(message); // Noncompliant\n\n        private static void NestedMethod()\n        {\n            var s = GetData();\n            string GetData()\n            {\n                Console.Write(true); // Noncompliant\n                return \"data\";\n            }\n        }\n\n        private string property1;\n        public string Property1\n        {\n            get\n            {\n                Console.WriteLine(\"Property1 read\"); // Noncompliant\n                return property1;\n            }\n            set\n            {\n                Console.WriteLine(\"Property1 written\"); // Noncompliant\n                property1 = value;\n            }\n        }\n    }\n\n    internal class Exceptions_MethodLevelConditionals\n    {\n        [System.Diagnostics.Conditional(\"Wrong conditional\")] // Error [CS0633]\n        public static void LogDebugA(string message)\n        {\n            Console.WriteLine(); // Noncompliant - wrong conditional\n//          ^^^^^^^^^^^^^^^^^\n        }\n\n        [System.Diagnostics.Conditional(\"DEBUG\")]\n        public static void LogDebugB(string message)\n        {\n            Console.WriteLine(); // compliant - in debug-only method\n        }\n\n        [System.Diagnostics.Conditional(\"debug\")] // wrong case\n        public static void LogDebugC(string message)\n        {\n            Console.WriteLine(); // Noncompliant - wrong case\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotWriteToStandardOutput_Conditionals1.cs",
    "content": "﻿#define DEBUG\n#define debug\n#define BLOCK1\n\nusing System;\n\nnamespace Tests.Diagnostics\n{\n    class Tests\n    {\n\n#if DEBUG\n        public void Method1()\n        {\n            Console.WriteLine(\"Hello World\"); // compliant - in a debug section\n        }\n#else\n        public void DoStuff()\n        {\n            Console.WriteLine(\"Hello World\"); // won't be processed - nodes aren't active\n        }\n#endif\n\n#if debug\n        public void DoStuff()\n        {\n            Console.WriteLine(\"Hello World\");  // Noncompliant\n        }\n#endif\n\n#if BLOCK1\n        public void Method2()\n        {\n            Console.WriteLine(\"Hello World\"); // Noncompliant\n        }\n#endif\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DoNotWriteToStandardOutput_Conditionals2.cs",
    "content": "﻿#define DEBUG\nusing System;\n\nnamespace Tests.Diagnostics\n{\n    class Tests\n    {\n\n#if !DEBUG\n        public void Method1()\n        {\n            Console.WriteLine(\"Hello World\"); // won't be processed - nodes aren't active\n        }\n#else\n        public void DoStuff()\n        {\n            Console.WriteLine(\"Hello World\"); // Noncompliant: false-positive (we don't handle logical operators in debug blocks)\n        }\n#endif\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DontMixIncrementOrDecrementWithOtherOperators.Latest.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class Program\n    {\n        public void Foo()\n        {\n            nint val1 = 0;\n            nint val2 = 0;\n\n            var result = ++val1 + val2; // Noncompliant {{Extract this increment operation into a dedicated statement.}}\n//                       ^^\n            result = val1++ - 1; // Noncompliant\n            result = 2 * val2++; // Noncompliant\n            result = val2++ / 4; // Noncompliant\n            result = --val1 % 2; // Noncompliant {{Extract this decrement operation into a dedicated statement.}}\n\n            result = ++val1 * ++val2;\n//                   ^^ Noncompliant\n//                            ^^ Noncompliant@-1\n\n            result = (++val2) + 1; // Noncompliant - even with parenthesis\n\n            var text = \"issue on line \" + val1++ + \" not expected.\"; // Noncompliant - even on string concat\n\n            val1++;\n            val2--;\n            var res = val1 + val2;\n            var other = val2 / 4;\n\n            nuint val3 = 0;\n            var result2 = (++val3) + 1; // Noncompliant\n        }\n\n        public void Foo2()\n        {\n            int a;\n            int b = 10;\n            (a, int c) = (1, 2 + b++); // Noncompliant\n        }\n\n        public void IntPtrArithmeticOperations()\n        {\n            IntPtr val1 = 0;\n            IntPtr val2 = 0;\n\n            var result = ++val1 + val2; // Noncompliant {{Extract this increment operation into a dedicated statement.}}\n//                       ^^\n            result = val1++ - 1; // Noncompliant\n            result = 2 * val2++; // Noncompliant\n            result = val2++ / 4; // Noncompliant\n            result = --val1 % 2; // Noncompliant {{Extract this decrement operation into a dedicated statement.}}\n\n            result = ++val1 * ++val2;\n//                   ^^ Noncompliant\n//                            ^^ Noncompliant@-1\n\n            result = (++val2) + 1; // Noncompliant - even with parenthesis\n\n            var text = \"issue on line \" + val1++ + \" not expected.\"; // Noncompliant - even on string concat\n\n            val1++;\n            val2--;\n            var res = val1 + val2;\n            var other = val2 / 4;\n\n            nuint val3 = 0;\n            var result2 = (++val3) + 1; // Noncompliant\n        }\n\n        public void UnsignedIntPtrArithmeticOperations()\n        {\n            UIntPtr val1 = 0;\n            UIntPtr val2 = 0;\n\n            var result = ++val1 + val2; // Noncompliant {{Extract this increment operation into a dedicated statement.}}\n//                       ^^\n            result = val1++ - 1; // Noncompliant\n            result = 2 * val2++; // Noncompliant\n            result = val2++ / 4; // Noncompliant\n            result = --val1 % 2; // Noncompliant {{Extract this decrement operation into a dedicated statement.}}\n\n            result = ++val1 * ++val2;\n//                   ^^ Noncompliant\n//                            ^^ Noncompliant@-1\n\n            result = (++val2) + 1; // Noncompliant - even with parenthesis\n\n            var text = \"issue on line \" + val1++ + \" not expected.\"; // Noncompliant - even on string concat\n\n            val1++;\n            val2--;\n            var res = val1 + val2;\n            var other = val2 / 4;\n\n            nuint val3 = 0;\n            var result2 = (++val3) + 1; // Noncompliant\n        }\n\n        // https://sonarsource.atlassian.net/browse/NET-487\n        public void ObjectInitializer()\n        {\n            var i = 42;\n            DataBuffer buffer = new()\n            {\n                [i++] = 1, // FN\n                [++i] = 2, // FN\n\n                [i--] = 3, // FN\n                [--i] = 4, // FN\n            };\n        }\n    }\n\n    public class DataBuffer\n    {\n        public int this[Index index]\n        {\n            get => 1;\n            set { /* not relevant */ }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DontMixIncrementOrDecrementWithOtherOperators.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class Program\n    {\n        public void Foo()\n        {\n            int val1 = 0;\n            long val2 = 0;\n\n            var result = ++val1 + val2; // Noncompliant {{Extract this increment operation into a dedicated statement.}}\n//                       ^^\n            result = val1++ - 1; // Noncompliant\n            result = 2 * val2++; // Noncompliant\n            result = val2++ / 4; // Noncompliant\n            result = --val1 % 2; // Noncompliant {{Extract this decrement operation into a dedicated statement.}}\n\n            result = ++val1 * ++val2;\n//                   ^^ Noncompliant\n//                            ^^ Noncompliant@-1\n\n            result = (++val2) + 1; // Noncompliant - even with parenthesis\n\n            var text = \"issue on line \" + val1++ + \" not expected.\"; // Noncompliant - even on string concat\n\n            val1++;\n            val2--;\n            var res = val1 + val2;\n            var other = val2 / 4;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DontUseTraceSwitchLevels.cs",
    "content": "﻿using System.Diagnostics;\nusing AliasedTrace = System.Diagnostics.Trace;\nusing AliasedTraceSwitch = System.Diagnostics.TraceSwitch;\n\npublic class Program\n{\n    private TraceSwitch _traceSwitch;\n\n    public void Noncompliant_TraceIfMethods(bool condition)\n    {\n        Trace.WriteIf(condition, \"Message\");                    // Compliant\n        Trace.WriteLineIf(condition, \"Message\");\n\n        Trace.WriteIf(_traceSwitch.TraceError, \"Message\");      // Noncompliant {{'Trace.WriteIf' should not be used with 'TraceSwitch' levels.}}\n        //            ^^^^^^^^^^^^^^^^^^^^^^^\n        Trace.WriteLineIf(_traceSwitch.TraceError, \"Message\");  // Noncompliant {{'Trace.WriteLineIf' should not be used with 'TraceSwitch' levels.}}\n    }\n\n    public void Compliant_TraceMethods(string arg)\n    {\n        Trace.Write(\"Message\");\n        Trace.Write(\"Message\", \"Category\");\n\n        Trace.WriteLine(\"Message\");\n        Trace.WriteLine(\"Message\", \"Category\");\n\n        Trace.TraceError(\"Message\");\n        Trace.TraceError(\"Message: {0}\", arg);\n\n        Trace.TraceInformation(\"Message\");\n        Trace.TraceInformation(\"Message: {0}\", arg);\n\n        Trace.TraceWarning(\"Message\");\n        Trace.TraceWarning(\"Message: {0}\", arg);\n    }\n\n    public void WriteIf_Overloads(bool condition)\n    {\n        Trace.WriteIf(_traceSwitch.TraceError, \"Message\");                  // Noncompliant\n        Trace.WriteIf(_traceSwitch.TraceError, 42);                         // Noncompliant\n        Trace.WriteIf(_traceSwitch.TraceError, \"Message\", \"Category\");      // Noncompliant\n        Trace.WriteIf(_traceSwitch.TraceError, 42, \"Category\");             // Noncompliant\n\n        Trace.WriteLineIf(_traceSwitch.TraceError, \"Message\");              // Noncompliant\n        Trace.WriteLineIf(_traceSwitch.TraceError, 42);                     // Noncompliant\n        Trace.WriteLineIf(_traceSwitch.TraceError, \"Message\", \"Category\");  // Noncompliant\n        Trace.WriteLineIf(_traceSwitch.TraceError, 42, \"Category\");         // Noncompliant\n    }\n\n    public void TraceSwitch_Properties(bool condition)\n    {\n        Trace.WriteIf(_traceSwitch.TraceError, \"Message\");                  // Noncompliant\n        Trace.WriteIf(_traceSwitch.TraceInfo, \"Message\");                   // Noncompliant\n        Trace.WriteIf(_traceSwitch.TraceVerbose, \"Message\");                // Noncompliant\n        Trace.WriteIf(_traceSwitch.TraceWarning, \"Message\");                // Noncompliant\n        Trace.WriteIf(_traceSwitch.Level == TraceLevel.Error, \"Message\");   // Noncompliant\n        Trace.WriteIf(_traceSwitch.Level != TraceLevel.Off, \"Message\");     // Noncompliant\n    }\n\n    public void Not_TraceClass(string arg)\n    {\n        Debug.WriteIf(_traceSwitch.TraceError, \"Message\");                  // Compliant - the method is not from the System.Diagnostics.Trace class\n        Debug.WriteIf(_traceSwitch.TraceError, \"Message: {0}\", arg);\n        Debug.WriteLineIf(_traceSwitch.TraceError, \"Message\");\n        Debug.WriteLineIf(_traceSwitch.TraceError, \"Message: {0}\", arg);\n    }\n\n    public void Aliased_Trace(AliasedTraceSwitch aliasedTraceSwitch)\n    {\n        AliasedTrace.WriteIf(aliasedTraceSwitch.TraceError, \"Message\");     // Noncompliant\n        AliasedTrace.WriteLineIf(aliasedTraceSwitch.TraceError, \"Message\"); // Noncompliant\n    }\n\n    public void Custom_TraceSwitch(CustomTraceSwitch customTraceSwitch)\n    {\n        AliasedTrace.WriteIf(customTraceSwitch.TraceError, \"Message\");      // Noncompliant\n        AliasedTrace.WriteLineIf(customTraceSwitch.TraceError, \"Message\");  // Noncompliant\n    }\n\n    public class CustomTraceSwitch : TraceSwitch\n    {\n        public CustomTraceSwitch(string displayName, string description) : base(displayName, description)\n        {\n        }\n    }\n}\n\nnamespace MyNamespace\n{\n    public class Test\n    {\n        private System.Diagnostics.TraceSwitch _regularTraceSwitch;\n        private TraceSwitch _fakeTraceSwitch;\n\n        public void Using_CustomClass(string arg)\n        {\n            Trace.WriteIf(_regularTraceSwitch.TraceError, \"Message\");                   // Compliant - the method is not from the System.Diagnostics.Trace class\n            Trace.WriteIf(_regularTraceSwitch.TraceError, \"Message: {0}\", arg);\n            Trace.WriteLineIf(_regularTraceSwitch.TraceError, \"Message\");\n            Trace.WriteLineIf(_regularTraceSwitch.TraceError, \"Message: {0}\", arg);\n\n            System.Diagnostics.Trace.WriteIf(_fakeTraceSwitch.TraceError, \"Message\");   // Compliant - the TraceSwitch object in the if statement is not an instance of the System.Diagnostics.TraceSwitch class\n            System.Diagnostics.Trace.WriteIf(_fakeTraceSwitch.TraceError, \"Message: {0}\", arg);\n            System.Diagnostics.Trace.WriteLineIf(_fakeTraceSwitch.TraceError, \"Message\");\n            System.Diagnostics.Trace.WriteLineIf(_fakeTraceSwitch.TraceError, \"Message: {0}\", arg);\n        }\n    }\n\n    public static class Trace\n    {\n        public static void WriteIf(bool condition, string message) { }\n        public static void WriteIf(bool condition, string message, params object[] args) { }\n        public static void WriteLineIf(bool condition, string message) { }\n        public static void WriteLineIf(bool condition, string message, params object[] args) { }\n    }\n\n    public class TraceSwitch\n    {\n        public bool TraceError { get; }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/DontUseTraceWrite.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing AliasedTrace = System.Diagnostics.Trace;\n\npublic class Program\n{\n    public void Noncompliant_TraceMethods()\n    {\n        Trace.Write(\"Message\");             // Noncompliant {{Avoid using Trace.Write, use instead methods that specify the trace event type.}}\n//            ^^^^^\n        Trace.WriteLine(\"Message\");         // Noncompliant {{Avoid using Trace.WriteLine, use instead methods that specify the trace event type.}}\n    }\n\n    public void Compliant_TraceMethods(string arg)\n    {\n        Trace.WriteIf(true, \"Message\");\n        Trace.WriteLineIf(true, \"Message\");\n\n        Trace.TraceError(\"Message\");\n        Trace.TraceError(\"Message: {0}\", arg);\n\n        Trace.TraceInformation(\"Message\");\n        Trace.TraceInformation(\"Message: {0}\", arg);\n\n        Trace.TraceWarning(\"Message\");\n        Trace.TraceWarning(\"Message: {0}\", arg);\n\n        Trace.Write(\"Message\", \"Category\");             // Compliant - the developer wants to use a specific category, other than the predefined ones\n        Trace.Write(42, \"Category\");\n\n        Trace.WriteLine(\"Message\", \"Category\");\n        Trace.WriteLine(42, \"Category\");\n    }\n\n    public void Write_Overloads()\n    {\n        Trace.Write(\"Message\");                         // Noncompliant\n        Trace.Write(42);                                // Noncompliant\n\n        Trace.WriteLine(\"Message\");                     // Noncompliant\n        Trace.WriteLine(42);                            // Noncompliant\n    }\n\n    public void Not_TraceClass(string arg)\n    {\n        Console.Write(\"Message\");\n        Console.Write(\"Message: {0}\", arg);\n        Console.WriteLine(\"Message\");\n        Console.WriteLine(\"Message: {0}\", arg);\n\n        Debug.Write(\"Message\");\n        Debug.Write(\"Message: {0}\", arg);\n        Debug.WriteLine(\"Message\");\n        Debug.WriteLine(\"Message: {0}\", arg);\n    }\n\n    public void Aliased_Trace()\n    {\n        AliasedTrace.Write(\"Message\");                  // Noncompliant\n        AliasedTrace.WriteLine(\"Message\");              // Noncompliant\n    }\n}\n\nnamespace MyNamespace\n{\n    public class Test\n    {\n        public void Using_CustomTraceClass(string arg)\n        {\n            Trace.Write(\"Message\");                     // Compliant - the method is not from the System.Diagnostics.Trace class\n            Trace.Write(\"Message: {0}\", arg);\n            Trace.WriteLine(\"Message\");\n            Trace.WriteLine(\"Message: {0}\", arg);\n        }\n    }\n\n    public static class Trace\n    {\n        public static void Write(string message) { }\n        public static void Write(string message, params object[] args) { }\n        public static void WriteLine(string message) { }\n        public static void WriteLine(string message, params object[] args) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EmptyMethod.CSharp9.Comment.Fixed.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\nvoid Empty()\n{\n    // Method intentionally left empty.\n} // Fixed\n\nvoid WithComment()\n{\n    // because\n}\n\nvoid WithTrailingComment()\n{// because\n\n}\n\nvoid NotEmpty()\n{\n    Console.WriteLine();\n}\n\nint Lambda(int x) => x;\n\nrecord EmptyMethod\n{\n    void F2()\n    {\n        // Do nothing because of X and Y.\n    }\n\n    void F3()\n    {\n        Console.WriteLine();\n    }\n\n    [Conditional(\"DEBUG\")]\n    void F4()    // Fixed\n    {\n        // Method intentionally left empty.\n    }\n\n    protected virtual void F5()\n    {\n    }\n\n    extern void F6();\n\n    [DllImport(\"avifil32.dll\")]\n    private static extern void F7();\n\n    void F8()\n    {\n        void F9() // Fixed\n        {\n            // Method intentionally left empty.\n        }\n    }\n}\n\nabstract record MyR\n{\n    void F1()\n    {\n        // Method intentionally left empty.\n    } // Fixed\n    public abstract void F2();\n}\n\nrecord MyR2 : MyR\n{\n    public override void F2()\n    {\n    }\n}\n\nclass M\n{\n    [ModuleInitializer]\n    internal static void M1() // Fixed\n    {\n        // Method intentionally left empty.\n    }\n\n    [ModuleInitializer]\n    internal static void M2()\n    {\n        // reason\n    }\n\n    [ModuleInitializer]\n    internal static void M3()\n    {\n        Console.WriteLine();\n    }\n}\n\nnamespace D\n{\n    partial class C\n    {\n        public partial void Foo();\n        public partial void Bar();\n        public partial void Qix();\n    }\n\n    partial class C\n    {\n        public partial void Foo()\n        {\n            // Method intentionally left empty.\n        } // Fixed\n\n        public partial void Bar()\n        {\n            // comment\n        }\n\n        public partial void Qix()\n        {\n            Console.WriteLine();\n        }\n    }\n}\n\nclass PropertyAccessors\n{\n    int NonEmptyInitProp { init { int x; } }\n    int EmptyInitProp {\n        init\n        {\n            // Method intentionally left empty.\n        }\n    }                   // Fixed\n    int EmptyInitPropWithGet { get => 42; init\n        {\n            // Method intentionally left empty.\n        }\n    } // Fixed\n    int AutoInitPropWithGet { get; init; }           // Compliant, auto-implemented, so not-empty\n\n    int NonEmptySetProp { set { int x; } }\n    int EmptySetProp {\n        set\n        {\n            // Method intentionally left empty.\n        }\n    }                     // Fixed\n    int EmptySetPropWithGet { get => 42; set\n        {\n            // Method intentionally left empty.\n        }\n    }   // Fixed\n    int AutoSetPropWithGet { get; set; }             // Compliant, auto-implemented, so not-empty\n\n    class Base\n    {\n        protected virtual int VirtualEmptyInitProp { init { } }  // Compliant, virtual\n    }\n\n    class Inherited : Base\n    {\n        protected override int VirtualEmptyInitProp {\n            init\n            {\n                // Method intentionally left empty.\n            }\n        } // Fixed\n    }\n\n    class Hidden : Base\n    {\n        protected new int VirtualEmptyInitProp {\n            init\n            {\n                // Method intentionally left empty.\n            }\n        }      // Fixed\n    }\n}\n\nclass EmptyProperty\n{\n    int EmptyProp { } // Error [CS0548] property or indexer must have at least one accessor\n}\n\nclass LocalFunction\n{\n    void FirstLevelInMethod()\n    {\n        void NonEmpty() { int i; }              // Compliant\n        void Empty()\n        {\n            // Method intentionally left empty.\n        }                        // Fixed\n        static void EmptyStatic()\n        {\n            // Method intentionally left empty.\n        }           // Fixed\n        extern static void EmptyExternStatic(); // Compliant, no body\n        unsafe void EmptyUnsafe()\n        {\n            // Method intentionally left empty.\n        }           // Fixed\n        async void EmptyAsync()\n        {\n            // Method intentionally left empty.\n        }             // Fixed\n    }\n\n    void NestedInMethod()\n    {\n        void FirstLevelLocalFunction()\n        {\n            void NonEmpty() { int i; }          // Compliant\n            void Empty()\n            {\n                // Method intentionally left empty.\n            }                    // Fixed\n\n            void SecondLevelLocalFunction()     // Compliant, contains a local functions\n            {\n                void NonEmpty() { int i; }      // Compliant\n                void Empty()\n                {\n                    // Method intentionally left empty.\n                }                // Fixed\n            }\n        }\n    }\n\n    int FirstLevelInAccessor\n    {\n        set\n        {\n            void NonEmpty() { int i; }              // Compliant\n            void Empty()\n            {\n                // Method intentionally left empty.\n            }                        // Fixed\n            static void EmptyStatic()\n            {\n                // Method intentionally left empty.\n            }           // Fixed\n            extern static void EmptyExternStatic(); // Compliant, no body\n            unsafe void EmptyUnsafe()\n            {\n                // Method intentionally left empty.\n            }           // Fixed\n            async void EmptyAsync()\n            {\n                // Method intentionally left empty.\n            }             // Fixed\n        }\n    }\n\n    int NestedInAccessor\n    {\n        init\n        {\n            void FirstLevelLocalFunction()\n            {\n                void NonEmpty() { int i; }          // Compliant\n                void Empty()\n                {\n                    // Method intentionally left empty.\n                }                    // Fixed\n\n                void SecondLevelLocalFunction()     // Compliant, contains local functions\n                {\n                    void NonEmpty() { int i; }      // Compliant\n                    void Empty()\n                    {\n                        // Method intentionally left empty.\n                    }                // Fixed\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EmptyMethod.CSharp9.Throw.Fixed.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\nvoid Empty() { throw new NotSupportedException(); } // Fixed\n\nvoid WithComment()\n{\n    // because\n}\n\nvoid WithTrailingComment()\n{// because\n\n}\n\nvoid NotEmpty()\n{\n    Console.WriteLine();\n}\n\nint Lambda(int x) => x;\n\nrecord EmptyMethod\n{\n    void F2()\n    {\n        // Do nothing because of X and Y.\n    }\n\n    void F3()\n    {\n        Console.WriteLine();\n    }\n\n    [Conditional(\"DEBUG\")]\n    void F4()    // Fixed\n    {\n        throw new NotSupportedException();\n    }\n\n    protected virtual void F5()\n    {\n    }\n\n    extern void F6();\n\n    [DllImport(\"avifil32.dll\")]\n    private static extern void F7();\n\n    void F8()\n    {\n        void F9() // Fixed\n        {\n            throw new NotSupportedException();\n        }\n    }\n}\n\nabstract record MyR\n{\n    void F1()\n    {\n        throw new NotSupportedException();\n    } // Fixed\n    public abstract void F2();\n}\n\nrecord MyR2 : MyR\n{\n    public override void F2()\n    {\n    }\n}\n\nclass M\n{\n    [ModuleInitializer]\n    internal static void M1() // Fixed\n    {\n        throw new NotSupportedException();\n    }\n\n    [ModuleInitializer]\n    internal static void M2()\n    {\n        // reason\n    }\n\n    [ModuleInitializer]\n    internal static void M3()\n    {\n        Console.WriteLine();\n    }\n}\n\nnamespace D\n{\n    partial class C\n    {\n        public partial void Foo();\n        public partial void Bar();\n        public partial void Qix();\n    }\n\n    partial class C\n    {\n        public partial void Foo()\n        {\n            throw new NotSupportedException();\n        } // Fixed\n\n        public partial void Bar()\n        {\n            // comment\n        }\n\n        public partial void Qix()\n        {\n            Console.WriteLine();\n        }\n    }\n}\n\nclass PropertyAccessors\n{\n    int NonEmptyInitProp { init { int x; } }\n    int EmptyInitProp { init { throw new NotSupportedException(); } }                   // Fixed\n    int EmptyInitPropWithGet { get => 42; init { throw new NotSupportedException(); } } // Fixed\n    int AutoInitPropWithGet { get; init; }           // Compliant, auto-implemented, so not-empty\n\n    int NonEmptySetProp { set { int x; } }\n    int EmptySetProp { set { throw new NotSupportedException(); } }                     // Fixed\n    int EmptySetPropWithGet { get => 42; set { throw new NotSupportedException(); } }   // Fixed\n    int AutoSetPropWithGet { get; set; }             // Compliant, auto-implemented, so not-empty\n\n    class Base\n    {\n        protected virtual int VirtualEmptyInitProp { init { } }  // Compliant, virtual\n    }\n\n    class Inherited : Base\n    {\n        protected override int VirtualEmptyInitProp { init { throw new NotSupportedException(); } } // Fixed\n    }\n\n    class Hidden : Base\n    {\n        protected new int VirtualEmptyInitProp { init { throw new NotSupportedException(); } }      // Fixed\n    }\n}\n\nclass EmptyProperty\n{\n    int EmptyProp { } // Error [CS0548] property or indexer must have at least one accessor\n}\n\nclass LocalFunction\n{\n    void FirstLevelInMethod()\n    {\n        void NonEmpty() { int i; }              // Compliant\n        void Empty() { throw new NotSupportedException(); }                        // Fixed\n        static void EmptyStatic() { throw new NotSupportedException(); }           // Fixed\n        extern static void EmptyExternStatic(); // Compliant, no body\n        unsafe void EmptyUnsafe() { throw new NotSupportedException(); }           // Fixed\n        async void EmptyAsync() { throw new NotSupportedException(); }             // Fixed\n    }\n\n    void NestedInMethod()\n    {\n        void FirstLevelLocalFunction()\n        {\n            void NonEmpty() { int i; }          // Compliant\n            void Empty() { throw new NotSupportedException(); }                    // Fixed\n\n            void SecondLevelLocalFunction()     // Compliant, contains a local functions\n            {\n                void NonEmpty() { int i; }      // Compliant\n                void Empty() { throw new NotSupportedException(); }                // Fixed\n            }\n        }\n    }\n\n    int FirstLevelInAccessor\n    {\n        set\n        {\n            void NonEmpty() { int i; }              // Compliant\n            void Empty() { throw new NotSupportedException(); }                        // Fixed\n            static void EmptyStatic() { throw new NotSupportedException(); }           // Fixed\n            extern static void EmptyExternStatic(); // Compliant, no body\n            unsafe void EmptyUnsafe() { throw new NotSupportedException(); }           // Fixed\n            async void EmptyAsync() { throw new NotSupportedException(); }             // Fixed\n        }\n    }\n\n    int NestedInAccessor\n    {\n        init\n        {\n            void FirstLevelLocalFunction()\n            {\n                void NonEmpty() { int i; }          // Compliant\n                void Empty() { throw new NotSupportedException(); }                    // Fixed\n\n                void SecondLevelLocalFunction()     // Compliant, contains local functions\n                {\n                    void NonEmpty() { int i; }      // Compliant\n                    void Empty() { throw new NotSupportedException(); }                // Fixed\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EmptyMethod.CSharp9.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\nvoid Empty() { } // Noncompliant\n\nvoid WithComment()\n{\n    // because\n}\n\nvoid WithTrailingComment()\n{// because\n\n}\n\nvoid NotEmpty()\n{\n    Console.WriteLine();\n}\n\nint Lambda(int x) => x;\n\nrecord EmptyMethod\n{\n    void F2()\n    {\n        // Do nothing because of X and Y.\n    }\n\n    void F3()\n    {\n        Console.WriteLine();\n    }\n\n    [Conditional(\"DEBUG\")]\n    void F4()    // Noncompliant {{Add a nested comment explaining why this method is empty, throw a 'NotSupportedException' or complete the implementation.}}\n    {\n    }\n\n    protected virtual void F5()\n    {\n    }\n\n    extern void F6();\n\n    [DllImport(\"avifil32.dll\")]\n    private static extern void F7();\n\n    void F8()\n    {\n        void F9() // Noncompliant\n        {\n\n        }\n    }\n}\n\nabstract record MyR\n{\n    void F1() { } // Noncompliant\n    public abstract void F2();\n}\n\nrecord MyR2 : MyR\n{\n    public override void F2()\n    {\n    }\n}\n\nclass M\n{\n    [ModuleInitializer]\n    internal static void M1() // Noncompliant\n    {\n    }\n\n    [ModuleInitializer]\n    internal static void M2()\n    {\n        // reason\n    }\n\n    [ModuleInitializer]\n    internal static void M3()\n    {\n        Console.WriteLine();\n    }\n}\n\nnamespace D\n{\n    partial class C\n    {\n        public partial void Foo();\n        public partial void Bar();\n        public partial void Qix();\n    }\n\n    partial class C\n    {\n        public partial void Foo() { } // Noncompliant\n\n        public partial void Bar()\n        {\n            // comment\n        }\n\n        public partial void Qix()\n        {\n            Console.WriteLine();\n        }\n    }\n}\n\nclass PropertyAccessors\n{\n    int NonEmptyInitProp { init { int x; } }\n    int EmptyInitProp { init { } }                   // Noncompliant\n    int EmptyInitPropWithGet { get => 42; init { } } // Noncompliant\n    //                                    ^^^^\n    int AutoInitPropWithGet { get; init; }           // Compliant, auto-implemented, so not-empty\n\n    int NonEmptySetProp { set { int x; } }\n    int EmptySetProp { set { } }                     // Noncompliant\n    int EmptySetPropWithGet { get => 42; set { } }   // Noncompliant\n    //                                   ^^^\n    int AutoSetPropWithGet { get; set; }             // Compliant, auto-implemented, so not-empty\n\n    class Base\n    {\n        protected virtual int VirtualEmptyInitProp { init { } }  // Compliant, virtual\n    }\n\n    class Inherited : Base\n    {\n        protected override int VirtualEmptyInitProp { init { } } // Noncompliant\n    }\n\n    class Hidden : Base\n    {\n        protected new int VirtualEmptyInitProp { init { } }      // Noncompliant\n    }\n}\n\nclass EmptyProperty\n{\n    int EmptyProp { } // Error [CS0548] property or indexer must have at least one accessor\n}\n\nclass LocalFunction\n{\n    void FirstLevelInMethod()\n    {\n        void NonEmpty() { int i; }              // Compliant\n        void Empty() { }                        // Noncompliant\n        static void EmptyStatic() { }           // Noncompliant\n        extern static void EmptyExternStatic(); // Compliant, no body\n        unsafe void EmptyUnsafe() { }           // Noncompliant\n        async void EmptyAsync() { }             // Noncompliant\n    }\n\n    void NestedInMethod()\n    {\n        void FirstLevelLocalFunction()\n        {\n            void NonEmpty() { int i; }          // Compliant\n            void Empty() { }                    // Noncompliant\n\n            void SecondLevelLocalFunction()     // Compliant, contains a local functions\n            {\n                void NonEmpty() { int i; }      // Compliant\n                void Empty() { }                // Noncompliant\n            }\n        }\n    }\n\n    int FirstLevelInAccessor\n    {\n        set\n        {\n            void NonEmpty() { int i; }              // Compliant\n            void Empty() { }                        // Noncompliant\n            static void EmptyStatic() { }           // Noncompliant\n            extern static void EmptyExternStatic(); // Compliant, no body\n            unsafe void EmptyUnsafe() { }           // Noncompliant\n            async void EmptyAsync() { }             // Noncompliant\n        }\n    }\n\n    int NestedInAccessor\n    {\n        init\n        {\n            void FirstLevelLocalFunction()\n            {\n                void NonEmpty() { int i; }          // Compliant\n                void Empty() { }                    // Noncompliant\n\n                void SecondLevelLocalFunction()     // Compliant, contains local functions\n                {\n                    void NonEmpty() { int i; }      // Compliant\n                    void Empty() { }                // Noncompliant\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EmptyMethod.Comment.Fixed.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.Runtime.InteropServices;\nusing System.Runtime.CompilerServices;\n\nnamespace Tests.Diagnostics\n{\n    public class EmptyMethod\n    {\n        void F2()\n        {\n            // Do nothing because of X and Y.\n        }\n\n        void F3()\n        {\n            Console.WriteLine();\n        }\n\n        [Conditional(\"DEBUG\")]\n        void F4()    // Fixed\n        {\n            // Method intentionally left empty.\n        }\n\n        public void ConditionalCompilation()\n        {\n#if SomeThing\n            Console.WriteLine();\n#endif\n        }\n\n        public void ConditionalCompilationEmpty() // Fixed\n        {\n            // Method intentionally left empty.\n        }\n\n        public void EmptyRegionTrivia() // Fixed\n        {\n            // Method intentionally left empty.\n        }\n\n        protected virtual void F5()\n        {\n        }\n\n        extern void F6();\n\n        [DllImport(\"avifil32.dll\")]\n        private static extern void F7();\n    }\n\n    public abstract class MyClass\n    {\n        public void F1()\n        {\n            // Method intentionally left empty.\n        } // Fixed\n\n        public abstract void F2();\n    }\n\n    public class MyClass5 : MyClass\n    {\n        public override void F2()\n        {\n        }\n    }\n\n    public interface IInterface\n    {\n        public void F1() { } // Compliant, implemented interface methods are virtual by default\n\n        public virtual void F2() { }\n\n        public abstract void F3();\n    }\n\n    public class WithProp\n    {\n        public string Prop\n        {\n            set\n            {\n                // Method intentionally left empty.\n            } // Fixed\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/7629\n    public class Repro_7629\n    {\n        interface Interface_7629\n        {\n            void MyMethod();\n        }\n\n        class MyClass_7629 : Interface_7629\n        {\n            public void MyMethod() { } // Compliant\n        }\n    }\n\n    interface FirstInterface\n    {\n        public void Explicit();\n        public void SameMethod();\n    }\n\n    interface SecondInterface\n    {\n        public void SameMethod();\n    }\n\n    class TestClass : FirstInterface, SecondInterface\n    {\n        void FirstInterface.Explicit() { } // Compliant\n        public void SameMethod() { } // Compliant\n    }\n\n    public class Awaitable : INotifyCompletion\n    {\n        public Awaitable GetAwaiter() => this;\n\n        public void GetResult()\n        {\n            // Method intentionally left empty.\n        }         // Fixed\n        public bool IsCompleted => !true;\n        public void OnCompleted(Action continuation) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EmptyMethod.Latest.cs",
    "content": "﻿using System.Runtime.InteropServices;\n\ninterface IMyInterface\n{\n    static virtual void StaticVirtualMethod() // Compliant (empty virtual method)\n    {\n\n    }\n\n    static abstract void StaticAbstractMethod();\n}\n\nclass MyClass : IMyInterface\n{\n    public static void StaticVirtualMethod() { } // Compliant\n\n    public static void StaticAbstractMethod() { } // Compliant\n}\n\npublic unsafe partial class Externals\n{\n    [LibraryImport(\"ole32.dll\")]\n    private static partial void F();  // Compliant\n\n    // Code usually generated by the source generator:\n    [System.Runtime.InteropServices.DllImportAttribute(\"ole32.dll\", EntryPoint = \"F\", ExactSpelling = true)]\n    private static extern partial void F(); // Compliant\n}\n\nabstract class WithModifiers\n{\n    public unsafe required int X { set { } }              // Noncompliant\n    public virtual int Y { get => 42;  private set { } }  // Noncompliant\n    public abstract int Z { get; private protected set; } // Compliant: no body\n}\n\npublic struct S\n{\n    public S() // Compliant - This will replace the default constructor\n    {\n    }\n}\n\npublic partial class PartialProperty\n{\n    public partial int Property_01 { set; } \n}\n\npublic partial class PartialProperty\n{\n    public partial int Property_01 { set { } } // Noncompliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EmptyMethod.OverrideVirtual.cs",
    "content": "﻿public class FooBase\n{\n    public virtual void Method()\n    {\n\n    }\n}\n\npublic class FooImpl: FooBase\n{\n    public override void Method() // Noncompliant\n    {\n\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EmptyMethod.OverrideVirtual.vb",
    "content": "﻿Public Class FooBase\n    Public Overridable Sub Method()\n    End Sub\nEnd Class\n\nPublic Class FooImpl\n    Inherits FooBase\n\n    Public Overrides Sub Method() ' Noncompliant\n    End Sub\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EmptyMethod.Throw.Fixed.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.Runtime.InteropServices;\nusing System.Runtime.CompilerServices;\n\nnamespace Tests.Diagnostics\n{\n    public class EmptyMethod\n    {\n        void F2()\n        {\n            // Do nothing because of X and Y.\n        }\n\n        void F3()\n        {\n            Console.WriteLine();\n        }\n\n        [Conditional(\"DEBUG\")]\n        void F4()    // Fixed\n        {\n            throw new NotSupportedException();\n        }\n\n        public void ConditionalCompilation()\n        {\n#if SomeThing\n            Console.WriteLine();\n#endif\n        }\n\n        public void ConditionalCompilationEmpty() // Fixed\n        {\n            throw new NotSupportedException();\n#if SomeThing\n#endif\n        }\n\n        public void EmptyRegionTrivia() // Fixed\n        {\n            throw new NotSupportedException();\n            #region\n            #endregion\n        }\n\n        protected virtual void F5()\n        {\n        }\n\n        extern void F6();\n\n        [DllImport(\"avifil32.dll\")]\n        private static extern void F7();\n    }\n\n    public abstract class MyClass\n    {\n        public void F1()\n        {\n            throw new NotSupportedException();\n        } // Fixed\n\n        public abstract void F2();\n    }\n\n    public class MyClass5 : MyClass\n    {\n        public override void F2()\n        {\n        }\n    }\n\n    public interface IInterface\n    {\n        public void F1() { } // Compliant, implemented interface methods are virtual by default\n\n        public virtual void F2() { }\n\n        public abstract void F3();\n    }\n\n    public class WithProp\n    {\n        public string Prop\n        {\n            set\n            {\n                throw new NotSupportedException();\n            } // Fixed\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/7629\n    public class Repro_7629\n    {\n        interface Interface_7629\n        {\n            void MyMethod();\n        }\n\n        class MyClass_7629 : Interface_7629\n        {\n            public void MyMethod() { } // Compliant\n        }\n    }\n\n    interface FirstInterface\n    {\n        public void Explicit();\n        public void SameMethod();\n    }\n\n    interface SecondInterface\n    {\n        public void SameMethod();\n    }\n\n    class TestClass : FirstInterface, SecondInterface\n    {\n        void FirstInterface.Explicit() { } // Compliant\n        public void SameMethod() { } // Compliant\n    }\n\n    public class Awaitable : INotifyCompletion\n    {\n        public Awaitable GetAwaiter() => this;\n\n        public void GetResult()\n        {\n            throw new NotSupportedException();\n        }         // Fixed\n        public bool IsCompleted => !true;\n        public void OnCompleted(Action continuation) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EmptyMethod.WithoutClosingBracket.Comment.Fixed.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.Runtime.InteropServices;\n\nnamespace Tests.Diagnostics\n{\n    public class EmptyMethod\n    {\n        void F1() // Fixed\n        {\n            // Method intentionally left empty.\n        }\n\n        void F2() // Fixed\n        {\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EmptyMethod.WithoutClosingBracket.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.Runtime.InteropServices;\n\nnamespace Tests.Diagnostics\n{\n    public class EmptyMethod\n    {\n        void F1() // Noncompliant\n        {\n        }\n\n        void F2() // Noncompliant\n        {\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EmptyMethod.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.Runtime.InteropServices;\nusing System.Runtime.CompilerServices;\n\nnamespace Tests.Diagnostics\n{\n    public class EmptyMethod\n    {\n        void F2()\n        {\n            // Do nothing because of X and Y.\n        }\n\n        void F3()\n        {\n            Console.WriteLine();\n        }\n\n        [Conditional(\"DEBUG\")]\n        void F4()    // Noncompliant {{Add a nested comment explaining why this method is empty, throw a 'NotSupportedException' or complete the implementation.}}\n        {\n        }\n\n        public void ConditionalCompilation()\n        {\n#if SomeThing\n            Console.WriteLine();\n#endif\n        }\n\n        public void ConditionalCompilationEmpty() // Noncompliant\n        {\n#if SomeThing\n#endif\n        }\n\n        public void EmptyRegionTrivia() // Noncompliant\n        {\n            #region\n            #endregion\n        }\n\n        protected virtual void F5()\n        {\n        }\n\n        extern void F6();\n\n        [DllImport(\"avifil32.dll\")]\n        private static extern void F7();\n    }\n\n    public abstract class MyClass\n    {\n        public void F1() { } // Noncompliant\n//                  ^^\n\n        public abstract void F2();\n    }\n\n    public class MyClass5 : MyClass\n    {\n        public override void F2()\n        {\n        }\n    }\n\n    public interface IInterface\n    {\n        public void F1() { } // Compliant, implemented interface methods are virtual by default\n\n        public virtual void F2() { }\n\n        public abstract void F3();\n    }\n\n    public class WithProp\n    {\n        public string Prop\n        {\n            set { } // Noncompliant\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/7629\n    public class Repro_7629\n    {\n        interface Interface_7629\n        {\n            void MyMethod();\n        }\n\n        class MyClass_7629 : Interface_7629\n        {\n            public void MyMethod() { } // Compliant\n        }\n    }\n\n    interface FirstInterface\n    {\n        public void Explicit();\n        public void SameMethod();\n    }\n\n    interface SecondInterface\n    {\n        public void SameMethod();\n    }\n\n    class TestClass : FirstInterface, SecondInterface\n    {\n        void FirstInterface.Explicit() { } // Compliant\n        public void SameMethod() { } // Compliant\n    }\n\n    public class Awaitable : INotifyCompletion\n    {\n        public Awaitable GetAwaiter() => this;\n\n        public void GetResult() { }         // Noncompliant FP https://sonarsource.atlassian.net/browse/NET-2935\n        public bool IsCompleted => !true;\n        public void OnCompleted(Action continuation) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EmptyMethod.vb",
    "content": "﻿Imports System\nImports System.Diagnostics\nImports System.Runtime.InteropServices\n\nModule Foo\n' The tests do not track location because it would introduce a comment inside the body (and the issue would not be raised)\n\n' Noncompliant@+1 {{Add a nested comment explaining why this method is empty, throw a 'NotSupportedException' or complete the implementation.}}\n  Function EmptyFunc()\n  End Function\n\n  Sub Exception1()\n    Throw New NotImplementedException\n  End Sub\n\n' Noncompliant@+1 {{Add a nested comment explaining why this method is empty, throw a 'NotSupportedException' or complete the implementation.}}\n  Sub EmptySub()\n  End Sub\n\n  Function Exception2()\n    Throw New NotSupportedException\n  End Function\n\n  Function Exception3()\n        Throw            ' Error [BC30666] 'Throw' statement cannot omit operand outside a 'Catch' statement or inside a 'Finally' statement.'\n    End Function\n\n    Sub Comment1()\n        ' foo\n    End Sub\n\n    Function Comment2()\n        ' foo\n    End Function\n\n    Sub Ok1()\n        Console.ReadKey()\n    End Sub\n\n    Function Ok2()\n        Return \"bar\"\n    End Function\n\n    ' Noncompliant@+1\n    Function Incomplete1()      ' Error [BC30027] 'End Function' expected.\n\n  Function Incomplete2()        ' Error [BC30289, BC30027] Statement cannot appear within a method body. End of method assumed\n        Return \"bar\"\n\n' Noncompliant@+1\n    Sub Incomplete3()           ' Error [BC30026, BC30289] 'End Sub' expected.\n\n  Function Incomplete4()        ' Error [BC30289] 'End Function' expected.\n        Thr                     ' Error [BC30451] 'Thr' is not declared. It may be inaccessible due to its protection level\n    End Function\n\nEnd Module\n\nModule Bar\n    MustInherit Class FooBar\n        MustOverride Sub Foo1()\n        Overridable Sub Foo2()\n        End Sub\n        ' Noncompliant@+1\n        Function Foo3()\n        End Function\n    End Class\n\n    Class BarQix\n        Inherits FooBar\n        Public Overrides Sub Foo1()\n        End Sub\n        ' Noncompliant@+1\n        Public Overrides Sub Foo2()\n        End Sub\n        ' Noncompliant@+1\n        Public Shadows Function Foo3()\n        End Function\n    End Class\n\n    Public Class FooQix\n        Inherits FooBar\n        Public Overrides Sub Foo1()\n            Throw New NotImplementedException()\n        End Sub\n        Public Overrides Sub Foo2()\n            MyBase.Foo2()\n        End Sub\n        Public Shadows Function Foo3()\n            ' x\n        End Function\n    End Class\n\n    Public Class Externals\n\n        <DllImport(\"FOO.DLL\")>\n        Private Shared Function External1(ByVal Handle As IntPtr) As IntPtr\n        End Function\n\n        <DllImport(\"FOO.DLL\")>\n        Private Shared Sub External2(ByVal Handle As IntPtr)\n        End Sub\n\n        Declare Function External3 Lib \"foo.dll\" Alias \"FooBar\" (ByVal lpBuffer As String) As Integer\n\n        ' Noncompliant@+2\n        <Conditional(\"DEBUG\"), Conditional(\"TEST1\")>\n        Sub OtherAttribute1()\n        End Sub\n\n        ' Noncompliant@+2\n        <DllI         ' Error [BC30636] >' expected.'\n        Private Shared Sub OtherAttribute2(ByVal Handle As IntPtr)\n      End Sub\n\n    End Class\nEnd Module\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EmptyNamespace.CSharp10.Empty.cs",
    "content": "﻿namespace Tests.Diagnostics; // Noncompliant\nusing System;\nusing System.Diagnostics;\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EmptyNamespace.CSharp10.Fixed.cs",
    "content": "﻿"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EmptyNamespace.CSharp10.NotEmpty.cs",
    "content": "﻿namespace Tests.Diagnostics;\n\npublic class EmptyNamespace { }\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EmptyNamespace.Fixed.Batch.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\n\nnamespace Tests.Diagnostics\n{\n    /*1*/\n    public class EmptyNamespace\n    {\n\n    }\n}\n\nnamespace Tests.Diagnostics\n{\n    /*3*/\n    using M = Math;\n}\n\nnamespace Y\n{\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EmptyNamespace.Fixed.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\n\nnamespace Tests.Diagnostics\n{\n    /*1*/\n    public class EmptyNamespace\n    {\n\n    }\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EmptyNamespace.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\n\nnamespace Tests.Diagnostics\n{\n    /*1*/\n    public class EmptyNamespace\n    {\n\n    }\n}\n\nnamespace Tests.Diagnostics // Noncompliant {{Remove this empty namespace.}}\n{\n    /*2*/\n    using M = Math;\n}\n\nnamespace Tests.Diagnostics\n{\n    /*3*/\n    using M = Math;\n    namespace MyNamespace // Noncompliant\n    {\n        /*4*/\n    }\n}\n\n  namespace X { } // Noncompliant\n//^^^^^^^^^^^^^^^\n\nnamespace Y\n{\n    namespace Z // Noncompliant\n    {\n\n    }\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EmptyNestedBlock.Latest.cs",
    "content": "﻿public struct S\n{\n    public S() // Compliant - This will replace the default constructor\n    {\n    }\n}\n\npublic partial class PartialProperty\n{\n    private partial int Property_01 { set; }\n}\n\npublic partial class PartialProperty\n{\n    private partial int Property_01 { set { } } // Noncompliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EmptyNestedBlock.cs",
    "content": "﻿#define MY_VAL\n\nusing System;\nusing System.Diagnostics;\n\nnamespace Tests.Diagnostics\n{\n    public class EmptyNestedBlock\n    {\n        public EmptyNestedBlock()\n        {\n        }\n\n        ~EmptyNestedBlock()\n        {\n        }\n\n        void F1(bool b)\n        {\n            var a = b;\n\n            for (int i = 0; i < 42; i++) { }  // Noncompliant\n//                                       ^^^\n            for (int i = 0; i < 42; i++) ;\n            for (int i = 0; i < 42; i++) { Console.WriteLine(i); }\n\n            try { } // Noncompliant {{Either remove or fill this block of code.}}\n            catch (Exception e)\n            {\n                // Ignore\n            }\n            catch { } // Noncompliant\n            finally { } // Noncompliant\n\n            if (a) { /* Do nothing because of X and Y */ }\n            if (a)\n            {\n                // TODO\n            }\n            if (a) { } // Noncompliant\n\n            switch (a) { /* This comment doesn't count */ } // Noncompliant\n\n            switch (a)\n            {\n                case true:\n                    break;\n                default:\n                    break;\n            }\n\n            while (a) { } // Noncompliant\n\n            while (a)\n            {\n                // FIXME\n            }\n\n            while (a)\n            {\n                a = false;\n            }\n\n            unsafe { } // Noncompliant\n\n            var foo1 = new Action<object>(x => { });\n            var foo2 = new Action<object>((x) => { });\n            var foo3 = new Action(delegate { });\n\n            if (a)\n            {\n                if (a)\n                {\n                    if (a) { } // Noncompliant\n                    switch (a) { /* This comment doesn't count */ } // Noncompliant\n                    while (a)\n                    {\n                        for (int i = 0; i < 42; i++) { }  // Noncompliant\n                    }\n                }\n            }\n        }\n\n        void F2()\n        {\n        }\n\n        // See: https://github.com/SonarSource/sonar-dotnet/issues/4540\n        public void ConditionalCompilation(object obj)\n        {\n            {\n#if DEBUG\n                Trace.WriteLine(\"message\");\n#endif\n            }\n\n            {\n#if MY_VAL\n                Trace.WriteLine(\"message\");\n#endif\n            }\n\n            if (true)\n            {\n#if DEBUG\n#endif\n            } // Noncompliant@-3\n        }\n    }\n\n    public class EmptyClass\n    {\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EmptyNestedBlock.vb",
    "content": "﻿Imports System\nImports System.Diagnostics\n\nNamespace Tests.Diagnostics\n\n  Public Class Customer\n    Public Property Name As String\n  End Class\n\n  Public Class EmptyNestedBlock\n\n    Public Sub New()\n    End Sub\n\n    Protected Overrides Sub Finalize()\n    End Sub\n\n    Private Sub F1(ByVal b As Boolean)\n\n      Dim a = b\n      Dim theCustomer As New Customer\n\n      With theCustomer\n      End With\n'     ^^^^^^^^^^^^^^^^ Noncompliant@-1 {{Either remove or fill this block of code.}}\n\n      With theCustomer\n        ' Some comment\n      End With\n\n      With theCustomer\n        .Name = \"Foo\"\n      End With\n\n      For i As Integer = 0 To 42 - 1\n      Next\n'     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant@-1 {{Either remove or fill this block of code.}}\n\n      For i As Integer = 0 To 42 - 1  ' Noncompliant\n\n      Next\n\n      For i As Integer = 0 To 42 - 1\n        ' Comment\n      Next\n\n      For i As Integer = 0 To 42 - 1\n        i = i + 1\n      Next\n\n      Dim numbers() As Integer = {1, 4, 7}\n\n      For Each number As Integer In numbers\n      Next\n'     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant@-1\n\n      For Each number As Integer In numbers\n        'Comment\n      Next\n\n      For Each number As Integer In numbers\n        Console.Write(number)\n      Next\n\n      While a <= 10\n      End While\n'     ^^^^^^^^^^^^^ Noncompliant@-1\n\n      While a <= 10\n        a = a + 1\n      End While\n\n      Do\n      Loop\n'     ^^ Noncompliant@-1\n\n      Do\n        ' Stuff\n      Loop\n\n      Do\n        a = a + 1\n      Loop\n\n      Do While a <= 10\n      Loop\n'     ^^^^^^^^^^^^^^^^ Noncompliant@-1\n\n      Do While a <= 10\n        a = a + 1\n      Loop\n\n      Do Until a <= 10 ' Noncompliant\n      Loop\n\n      Do Until a <= 10\n        ' Comment\n      Loop\n\n      Do ' Noncompliant\n      Loop While a <= 10\n\n      Do\n        a = a + 1\n      Loop While a <= 10\n\n      Do ' Noncompliant\n      Loop Until a <= 10\n\n      Do\n        a = a + 1\n      Loop Until a <= 10\n\n      Using reader As System.IO.TextReader = System.IO.File.OpenText(\"log.txt\")\n\n      End Using\n'     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant@-2\n\n      Using reader As System.IO.TextReader = System.IO.File.OpenText(\"log.txt\")\n        ' TODO\n      End Using\n\n      Using reader As System.IO.TextReader = System.IO.File.OpenText(\"log.txt\")\n        a = a + 1\n      End Using\n\n      Try ' Noncompliant\n      Catch e As ArgumentException\n        ' Ignore as it has this comment\n      Catch e As FormatException ' Noncompliant\n      Catch\n      Finally\n      End Try\n'     ^^^^^ Noncompliant@-2\n'     ^^^^^^^ Noncompliant@-2\n\n      Try\n        a = a + 1\n      Finally  ' Noncompliant\n      End Try\n\n      Try ' Noncompliant\n      Catch\n        ' comment\n      End Try\n\n      Try\n        a = a + 1\n      Catch  ' Noncompliant\n      Catch\n        a = a + 1\n      Catch  ' Noncompliant\n      Catch  ' Noncompliant\n      End Try\n\n      Try\n        ' nothing\n      Finally\n        ' nothing\n      End Try\n\n      If a Then\n        ' Ignore as it has this comment\n      End If\n\n      If a Then\n      End If\n'     ^^^^^^^^^ Noncompliant@-1\n\n      If a Then ' Noncompliant\n\n      End If\n\n      If a Then\n        ' Ignore as it has this comment\n      Else ' Noncompliant\n      End If\n\n      If a Then ' Noncompliant\n      Else\n        a = a + 1\n      End If\n\n      If a Then\n        ' Ignore as it has this comment\n      ElseIf a Then\n\n      End If\n'     ^^^^^^^^^^^^^ Noncompliant@-2\n\n      If a Then ' Noncompliant\n      ElseIf a Then ' Noncompliant\n      ElseIf a Then ' Noncompliant\n      Else ' Noncompliant\n      End If\n\n      If a Then\n        ' comment\n      ElseIf a Then\n        ' comment\n      ElseIf a Then\n        a = a + 1\n      Else\n        ' comment\n      End If\n\n      Select Case a ' Noncompliant\n      End Select\n\n      Select Case a ' Noncompliant\n        ' Comment does not matter\n      End Select\n\n      Select Case a\n        Case True\n        Case Else\n      End Select\n\n      Dim foo1 = New Action(Of Object)(Sub(x)\n                                       End Sub)\n      Dim foo2 = Sub() Console.WriteLine()\n      Dim foo3 = New Action(Sub()\n                            End Sub)\n      Dim foo4 = Function(num As Integer) num\n    End Sub\n\n    Private Sub F2()\n    End Sub\n\n    Private Sub InnerBlocks()\n      Dim a = True\n      If a Then\n        Select Case a ' Noncompliant\n        End Select\n        Try\n          Do ' Noncompliant\n          Loop\n        Finally\n          For i As Integer = 0 To 42 - 1\n            Do ' Noncompliant\n            Loop Until a <= 10\n          Next\n        End Try\n      End If\n    End Sub\n\n    Public Sub ConditionalCompilation(a As Boolean)\n        If a Then\n#If DEBUG\n            Trace.WriteLine(\"message\")\n#End If\n        End If\n\n        If a Then\n#If DEBUG\n#End If\n        End If ' Noncompliant@-3\n    End Sub\n\n  End Class\n\n  Public Class EmptyClass\n  End Class\n\n  Delegate Sub FooDelegate()\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EmptyNestedBlock2.cs",
    "content": "﻿#define MY_VAL\n\nusing System;\nusing System.Diagnostics;\n\nnamespace AppendedNamespaceForConcurrencyTest.Tests.Diagnostics\n{\n    public class EmptyNestedBlock\n    {\n        public EmptyNestedBlock()\n        {\n        }\n\n        ~EmptyNestedBlock()\n        {\n        }\n\n        void F1(bool b)\n        {\n            var a = b;\n\n            for (int i = 0; i < 42; i++) { }  // Noncompliant\n//                                       ^^^\n            for (int i = 0; i < 42; i++) ;\n            for (int i = 0; i < 42; i++) { Console.WriteLine(i); }\n\n            try { } // Noncompliant {{Either remove or fill this block of code.}}\n            catch (Exception e)\n            {\n                // Ignore\n            }\n            catch { } // Noncompliant\n            finally { } // Noncompliant\n\n            if (a) { /* Do nothing because of X and Y */ }\n            if (a)\n            {\n                // TODO\n            }\n            if (a) { } // Noncompliant\n\n            switch (a) { /* This comment doesn't count */ } // Noncompliant\n\n            switch (a)\n            {\n                case true:\n                    break;\n                default:\n                    break;\n            }\n\n            while (a) { } // Noncompliant\n\n            while (a)\n            {\n                // FIXME\n            }\n\n            while (a)\n            {\n                a = false;\n            }\n\n            unsafe { } // Noncompliant\n\n            var foo1 = new Action<object>(x => { });\n            var foo2 = new Action<object>((x) => { });\n            var foo3 = new Action(delegate { });\n\n            if (a)\n            {\n                if (a)\n                {\n                    if (a) { } // Noncompliant\n                    switch (a) { /* This comment doesn't count */ } // Noncompliant\n                    while (a)\n                    {\n                        for (int i = 0; i < 42; i++) { }  // Noncompliant\n                    }\n                }\n            }\n        }\n\n        void F2()\n        {\n        }\n\n        // See: https://github.com/SonarSource/sonar-dotnet/issues/4540\n        public void ConditionalCompilation(object obj)\n        {\n            {\n#if DEBUG\n                Trace.WriteLine(\"message\");\n#endif\n            }\n\n            {\n#if MY_VAL\n                Trace.WriteLine(\"message\");\n#endif\n            }\n\n            if (true)\n            {\n#if DEBUG\n#endif\n            } // Noncompliant@-3\n        }\n    }\n\n    public class EmptyClass\n    {\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EmptyStatement.Fixed.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class EmptyStatement\n    {\n        public int MyField;\n\n        public EmptyStatement()\n        {\n\n            Console.WriteLine();\n            while (true)\n                ; // Compliant - empty statement is the body of a loop, excluded from S1116\n        }\n\n        // loop bodies are excluded\n        public void LoopBodyExclusions()\n        {\n            for (int i = 0; i < 10; i++) ; // Compliant\n            while (true) ; // Compliant\n            do ; while (true); // Compliant\n        }\n\n        public void EmptyStatementInsideBlock()\n        {\n            while (true)\n            {\n\n            }\n        }\n\n        public void EmptyStatementAfterLoop()\n        {\n            for (int i = 0; i < 10; i++)\n            {\n                Console.WriteLine(i);\n            }\n\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EmptyStatement.Latest.cs",
    "content": "﻿using System;\n\ninterface IMyInterface\n{\n    static virtual void StaticVirtualMethod()\n    {\n        ; // Noncompliant\n    }\n\n    static abstract void StaticAbstractMethod();\n}\n\nclass MyClass : IMyInterface\n{\n    public static void StaticVirtualMethod()\n    {\n        ; // Noncompliant\n    }\n\n    public static void StaticAbstractMethod()\n    {\n        ; // Noncompliant\n    }\n}\n\npublic partial class PartialProperty\n{\n    private partial int Property_01 { set; }\n}\n\npublic partial class PartialProperty\n{\n    private partial int Property_01 { set {; } } // Noncompliant\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EmptyStatement.TopLevelStatements.Fixed.cs",
    "content": "﻿using System;\n\n; // Fixed\n; // Fixed\nConsole.WriteLine();\nwhile (true)\n    ; // Compliant: loop bodies are excluded\n\nrecord R\n{\n    string P\n    {\n        init\n        {\n\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EmptyStatement.TopLevelStatements.cs",
    "content": "﻿using System;\n\n; // Noncompliant {{Remove this empty statement.}}\n; // Noncompliant\nConsole.WriteLine();\nwhile (true)\n    ; // Compliant: loop bodies are excluded\n\nrecord R\n{\n    string P\n    {\n        init\n        {\n            ; // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EmptyStatement.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class EmptyStatement\n    {\n        public int MyField;\n\n        public EmptyStatement()\n        {\n            ; // Noncompliant {{Remove this empty statement.}}\n            ; // Noncompliant\n            ; // Noncompliant\n            ; // Noncompliant\n            ; // Noncompliant\n            Console.WriteLine();\n            while (true)\n                ; // Compliant - empty statement is the body of a loop, excluded from S1116\n        }\n\n        // loop bodies are excluded\n        public void LoopBodyExclusions()\n        {\n            for (int i = 0; i < 10; i++) ; // Compliant\n            while (true) ; // Compliant\n            do ; while (true); // Compliant\n        }\n\n        public void EmptyStatementInsideBlock()\n        {\n            while (true)\n            {\n                ; // Noncompliant - empty statement inside a block, not the direct body\n            }\n        }\n\n        public void EmptyStatementAfterLoop()\n        {\n            for (int i = 0; i < 10; i++)\n            {\n                Console.WriteLine(i);\n            }\n            ; // Noncompliant - standalone empty statement, not a loop body\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EncryptionAlgorithmsShouldBeSecure.cs",
    "content": "﻿using System;\nusing System.Security.Cryptography;\n\nnamespace Tests.Diagnostics\n{\n    class SecureAesCheck\n    {\n        AesManaged field1 = new AesManaged(); // Noncompliant\n        AesManaged Property1 { get; set; } = new AesManaged(); // Noncompliant\n\n        void CtorSetsAllowedValue(byte[] key1)\n        {\n            // none\n        }\n\n        void CtorSetsNotAllowedValue()\n        {\n            new AesManaged(); // Noncompliant {{Use secure mode and padding scheme.}}\n        }\n\n        void InitializerSetsAllowedValue()\n        {\n            // none\n        }\n\n        void InitializerSetsNotAllowedValue()\n        {\n            new AesManaged() { Mode = CipherMode.CBC }; // Noncompliant\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            new AesManaged() { Mode = CipherMode.CFB }; // Noncompliant\n            new AesManaged() { Mode = CipherMode.CTS }; // Noncompliant\n            new AesManaged() { Mode = CipherMode.ECB }; // Noncompliant\n            new AesManaged() { Mode = CipherMode.OFB }; // Noncompliant\n        }\n\n        void PropertySetsNotAllowedValue()\n        {\n            var c = new AesManaged(); // Noncompliant\n            c.Mode = CipherMode.CBC; // Noncompliant, we will be raising twice\n            c.Mode = CipherMode.CFB; // Noncompliant, we will be raising twice\n            c.Mode = CipherMode.CTS; // Noncompliant, we will be raising twice\n            c.Mode = CipherMode.ECB; // Noncompliant, we will be raising twice\n            c.Mode = CipherMode.OFB; // Noncompliant, we will be raising twice\n        }\n\n        void PropertySetsAllowedValue(bool foo)\n        {\n            // none\n        }\n    }\n\n    class RSAEncryptionPaddingTest\n    {\n        RSACryptoServiceProvider rsaProvider = new RSACryptoServiceProvider();\n        private bool trueField = true;\n        private bool falseField = false;\n\n        void InvocationSetsAllowedValue(byte[] data, RSAEncryptionPadding padding, RSA genericRSA)\n        {\n            rsaProvider.Encrypt(data, true);        // OAEP Padding is used (second parameter set to true)\n            rsaProvider.Encrypt(data, trueField);   // OAEP Padding is used (second parameter set to true)\n            rsaProvider.Decrypt(data, false);       // Only raise on Encrypt method\n            rsaProvider.Encrypt(fOAEP: true, rgb: data);\n            rsaProvider.Encrypt(data, System.Security.Cryptography.RSAEncryptionPadding.OaepSHA1);\n            rsaProvider.Encrypt(data, RSAEncryptionPadding.OaepSHA256);\n            rsaProvider.Encrypt(padding: padding, data: data); // we don't know which padding is actually used here so we do not raise the issue\n\n            genericRSA.Encrypt(data, RSAEncryptionPadding.OaepSHA256);\n\n            //Reassigned\n            trueField = false;\n            rsaProvider.Encrypt(data, trueField);   // Noncompliant\n        }\n\n        void InvocationSetsNotAllowedValue(byte[] data, RSA genericRSA)\n        {\n            rsaProvider.Encrypt(data, false);               // Noncompliant {{Use secure mode and padding scheme.}}\n            rsaProvider.Encrypt(data, falseField);          // Noncompliant\n            rsaProvider.Encrypt(fOAEP: false, rgb: data);   // Noncompliant\n            rsaProvider.Encrypt(data, System.Security.Cryptography.RSAEncryptionPadding.Pkcs1); // Noncompliant\n            rsaProvider.Encrypt(data, RSAEncryptionPadding.Pkcs1);  // Noncompliant\n\n            genericRSA.Encrypt(data, RSAEncryptionPadding.Pkcs1);   // Noncompliant\n\n            //Reassigned\n            falseField = true;\n            rsaProvider.Encrypt(data, falseField);          // Compliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EncryptionAlgorithmsShouldBeSecure.vb",
    "content": "﻿Imports System\nImports System.Security.Cryptography\n\nNamespace Tests.Diagnostics\n\n    Class SecureAesCheck\n\n        Private field1 As AesManaged = New AesManaged() ' Noncompliant\n        Private Property Property1 As AesManaged = New AesManaged() ' Noncompliant\n\n        Private Sub CtorSetsAllowedValue(ByVal key1 As Byte())\n            ' none\n        End Sub\n\n        Private Sub CtorSetsNotAllowedValue()\n            Dim aesManaged = New AesManaged() ' Noncompliant {{Use secure mode and padding scheme.}}\n        End Sub\n\n        Private Sub InitializerSetsAllowedValue()\n            ' none\n        End Sub\n\n        Private Sub InitializerSetsNotAllowedValue()\n            Dim aesManaged = New AesManaged() With {.Mode = CipherMode.CBC} ' Noncompliant\n            '                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            aesManaged = New AesManaged() With {.Mode = CipherMode.CFB} ' Noncompliant\n            aesManaged = New AesManaged() With {.Mode = CipherMode.CTS} ' Noncompliant\n            aesManaged = New AesManaged() With {.Mode = CipherMode.ECB} ' Noncompliant\n            aesManaged = New AesManaged() With {.Mode = CipherMode.OFB} ' Noncompliant\n        End Sub\n\n        Private Sub PropertySetsNotAllowedValue()\n            Dim c = New AesManaged() ' Noncompliant\n            c.Mode = CipherMode.CBC ' Noncompliant\n            c.Mode = CipherMode.CFB ' Noncompliant\n            c.Mode = CipherMode.CTS ' Noncompliant\n            c.Mode = CipherMode.ECB ' Noncompliant\n            c.Mode = CipherMode.OFB ' Noncompliant\n        End Sub\n\n        Private Sub PropertySetsAllowedValue(ByVal foo As Boolean)\n            ' none\n        End Sub\n\n    End Class\n\n    Class RSAEncryptionPaddingTest\n\n        Private rsaProvider As RSACryptoServiceProvider = New RSACryptoServiceProvider()\n        Private TrueField As Boolean = True\n        Private FalseField As Boolean = False\n\n        Private Sub InvocationSetsAllowedValue(ByVal data As Byte(), ByVal padding As RSAEncryptionPadding, ByVal genericRSA As RSA)\n            rsaProvider.Encrypt(data, True)\n            rsaProvider.Encrypt(data, TrueField)\n            rsaProvider.Decrypt(data, False)\n            rsaProvider.Encrypt(fOAEP:=True, rgb:=data)\n            rsaProvider.Encrypt(data, System.Security.Cryptography.RSAEncryptionPadding.OaepSHA1)\n            rsaProvider.Encrypt(data, RSAEncryptionPadding.OaepSHA256)\n            rsaProvider.Encrypt(padding:=padding, data:=data)\n\n            genericRSA.Encrypt(data, RSAEncryptionPadding.OaepSHA256)\n\n            ' Reassigned\n            TrueField = False\n            rsaProvider.Encrypt(data, TrueField)            ' Noncompliant\n        End Sub\n\n        Private Sub InvocationSetsNotAllowedValue(ByVal data As Byte(), ByVal genericRSA As RSA)\n            rsaProvider.Encrypt(data, False)                ' Noncompliant\n            rsaProvider.Encrypt(data, FalseField)           ' Noncompliant\n            rsaProvider.Encrypt(fOAEP:=False, rgb:=data)    ' Noncompliant\n            rsaProvider.Encrypt(data, System.Security.Cryptography.RSAEncryptionPadding.Pkcs1) ' Noncompliant\n            rsaProvider.Encrypt(data, RSAEncryptionPadding.Pkcs1) ' Noncompliant\n\n            genericRSA.Encrypt(data, RSAEncryptionPadding.Pkcs1) ' Noncompliant\n\n            'Reassigned\n            FalseField = True\n            rsaProvider.Encrypt(data, FalseField)           ' Compliant\n        End Sub\n\n    End Class\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EncryptionAlgorithmsShouldBeSecure_NetStandard21.Net48.vb",
    "content": "﻿Imports System\nImports System.Security.Cryptography\n\nNamespace Tests.Diagnostics\n    Class RSAEncryptionPaddingTest\n        Private rsaProvider As RSACryptoServiceProvider = New RSACryptoServiceProvider()\n\n        Private Sub InvocationSetsAllowedValue(ByVal data As Byte(), ByVal padding As RSAEncryptionPadding, ByVal genericRSA As RSA)\n            Dim bytesWritten = Nothing\n            rsaProvider.TryEncrypt(data, Nothing, RSAEncryptionPadding.OaepSHA256, bytesWritten)\n\n            genericRSA.Encrypt(data, RSAEncryptionPadding.OaepSHA256)\n            genericRSA.TryEncrypt(data, Nothing, RSAEncryptionPadding.OaepSHA256, bytesWritten)\n        End Sub\n\n        Private Sub InvocationSetsNotAllowedValue(ByVal data As Byte(), ByVal genericRSA As RSA)\n            Dim bytesWritten = Nothing\n            rsaProvider.TryEncrypt(data, Nothing, RSAEncryptionPadding.Pkcs1, bytesWritten) ' Noncompliant\n\n            genericRSA.Encrypt(data, RSAEncryptionPadding.Pkcs1) ' Noncompliant\n            genericRSA.TryEncrypt(data, Nothing, RSAEncryptionPadding.Pkcs1, bytesWritten) ' Noncompliant\n        End Sub\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EncryptionAlgorithmsShouldBeSecure_NetStandard21.Net7.vb",
    "content": "﻿Imports System.Security.Cryptography\n\nClass RSAEncryptionPaddingTest\n    Private rsaProvider As RSACryptoServiceProvider = New RSACryptoServiceProvider()\n\n    Private Sub InvocationSetsAllowedValue(ByVal data As Byte(), ByVal padding As RSAEncryptionPadding, ByVal genericRSA As RSA)\n        Dim bytesWritten As Integer\n        rsaProvider.TryEncrypt(data, Nothing, RSAEncryptionPadding.OaepSHA256, bytesWritten)\n\n        genericRSA.Encrypt(data, RSAEncryptionPadding.OaepSHA256)\n        genericRSA.TryEncrypt(data, Nothing, RSAEncryptionPadding.OaepSHA256, bytesWritten)\n    End Sub\n\n    Private Sub InvocationSetsNotAllowedValue(ByVal data As Byte(), ByVal genericRSA As RSA)\n        Dim bytesWritten As Integer\n        rsaProvider.TryEncrypt(data, Nothing, RSAEncryptionPadding.Pkcs1, bytesWritten) ' Noncompliant\n\n        genericRSA.Encrypt(data, RSAEncryptionPadding.Pkcs1)                            ' Noncompliant\n        genericRSA.TryEncrypt(data, Nothing, RSAEncryptionPadding.Pkcs1, bytesWritten)  ' Noncompliant\n    End Sub\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EncryptionAlgorithmsShouldBeSecure_NetStandard21.cs",
    "content": "﻿using System;\nusing System.Security.Cryptography;\n\nnamespace Tests.Diagnostics\n{\n    class SecureAesCheck\n    {\n        AesManaged field1 = new AesManaged(); // Noncompliant\n        AesManaged Property1 { get; set; } = new AesManaged(); // Noncompliant\n\n        void CtorSetsAllowedValue(byte[] key1, ReadOnlySpan<byte> key2)\n        {\n            new AesGcm(key1);\n            new AesGcm(key2);\n        }\n\n        void CtorSetsNotAllowedValue()\n        {\n            new AesManaged(); // Noncompliant {{Use secure mode and padding scheme.}}\n        }\n\n        void InitializerSetsAllowedValue()\n        {\n            // none\n        }\n\n        void InitializerSetsNotAllowedValue()\n        {\n            new AesManaged() { Mode = CipherMode.CBC }; // Noncompliant\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            new AesManaged() { Mode = CipherMode.CFB }; // Noncompliant\n            new AesManaged() { Mode = CipherMode.CTS }; // Noncompliant\n            new AesManaged() { Mode = CipherMode.ECB }; // Noncompliant\n            new AesManaged() { Mode = CipherMode.OFB }; // Noncompliant\n        }\n\n        void PropertySetsNotAllowedValue()\n        {\n            var c = new AesManaged(); // Noncompliant\n            c.Mode = CipherMode.CBC; // Noncompliant, we will be raising twice\n            c.Mode = CipherMode.CFB; // Noncompliant, we will be raising twice\n            c.Mode = CipherMode.CTS; // Noncompliant, we will be raising twice\n            c.Mode = CipherMode.ECB; // Noncompliant, we will be raising twice\n            c.Mode = CipherMode.OFB; // Noncompliant, we will be raising twice\n        }\n\n        void PropertySetsAllowedValue(bool foo)\n        {\n            // none\n        }\n    }\n\n    class RSAEncryptionPaddingTest\n    {\n        RSACryptoServiceProvider rsaProvider = new RSACryptoServiceProvider();\n\n        void InvocationSetsAllowedValue(byte[] data, RSAEncryptionPadding padding, RSA genericRSA)\n        {\n            rsaProvider.Encrypt(data, true); // OAEP Padding is used (second parameter set to true)\n            rsaProvider.Decrypt(data, false); // Only raise on Encrypt method\n            rsaProvider.Encrypt(fOAEP: true, rgb: data);\n            rsaProvider.Encrypt(data, System.Security.Cryptography.RSAEncryptionPadding.OaepSHA1);\n            rsaProvider.Encrypt(data, RSAEncryptionPadding.OaepSHA256);\n            rsaProvider.TryEncrypt(data, null, RSAEncryptionPadding.OaepSHA256, out var bytesWritten1);\n            rsaProvider.Encrypt(padding: padding, data: data); // we don't know which padding is actually used here so we do not raise the issue\n\n            genericRSA.Encrypt(data, RSAEncryptionPadding.OaepSHA256);\n            genericRSA.TryEncrypt(data, null, RSAEncryptionPadding.OaepSHA256, out var bytesWritten2);\n        }\n\n        void InvocationSetsNotAllowedValue(byte[] data, RSA genericRSA)\n        {\n            rsaProvider.Encrypt(data, false); // Noncompliant {{Use secure mode and padding scheme.}}\n            rsaProvider.Encrypt(fOAEP: false, rgb: data); // Noncompliant\n            rsaProvider.Encrypt(data, System.Security.Cryptography.RSAEncryptionPadding.Pkcs1); // Noncompliant\n            rsaProvider.Encrypt(data, RSAEncryptionPadding.Pkcs1); // Noncompliant\n            rsaProvider.TryEncrypt(data, null, RSAEncryptionPadding.Pkcs1, out var bytesWritten1); // Noncompliant\n\n            genericRSA.Encrypt(data, RSAEncryptionPadding.Pkcs1); // Noncompliant\n            genericRSA.TryEncrypt(data, null, RSAEncryptionPadding.Pkcs1, out var bytesWritten2); // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EncryptionAlgorithmsShouldBeSecure_NetStandard21.vb",
    "content": "﻿Imports System\nImports System.Security.Cryptography\n\nNamespace Tests.Diagnostics\n    Class SecureAesCheck\n        Private field1 As AesManaged = New AesManaged() ' Noncompliant\n        Private Property Property1 As AesManaged = New AesManaged() ' Noncompliant\n\n        Private Sub CtorSetsAllowedValue(ByVal key As Byte())\n            Dim aesGcm1 = New AesGcm(key)\n        End Sub\n\n        Private Sub CtorSetsNotAllowedValue()\n            Dim aesManaged = New AesManaged() ' Noncompliant {{Use secure mode and padding scheme.}}\n        End Sub\n\n        Private Sub InitializerSetsAllowedValue()\n            ' none\n        End Sub\n\n        Private Sub InitializerSetsNotAllowedValue()\n            Dim aesManaged = New AesManaged() With {.Mode = CipherMode.CBC} ' Noncompliant\n'                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            aesManaged = New AesManaged() With {.Mode = CipherMode.CFB} ' Noncompliant\n            aesManaged = New AesManaged() With {.Mode = CipherMode.CTS} ' Noncompliant\n            aesManaged = New AesManaged() With {.Mode = CipherMode.ECB} ' Noncompliant\n            aesManaged = New AesManaged() With {.Mode = CipherMode.OFB} ' Noncompliant\n        End Sub\n\n        Private Sub PropertySetsNotAllowedValue()\n            Dim c = New AesManaged() ' Noncompliant\n            c.Mode = CipherMode.CBC ' Noncompliant\n            c.Mode = CipherMode.CFB ' Noncompliant\n            c.Mode = CipherMode.CTS ' Noncompliant\n            c.Mode = CipherMode.ECB ' Noncompliant\n            c.Mode = CipherMode.OFB ' Noncompliant\n        End Sub\n\n        Private Sub PropertySetsAllowedValue(ByVal foo As Boolean)\n            ' none\n        End Sub\n    End Class\n\n    Class RSAEncryptionPaddingTest\n        Private rsaProvider As RSACryptoServiceProvider = New RSACryptoServiceProvider()\n\n        Private Sub InvocationSetsAllowedValue(ByVal data As Byte(), ByVal padding As RSAEncryptionPadding, ByVal genericRSA As RSA)\n            rsaProvider.Encrypt(data, True)\n            rsaProvider.Decrypt(data, False)\n            rsaProvider.Encrypt(fOAEP:=True, rgb:=data)\n            rsaProvider.Encrypt(data, System.Security.Cryptography.RSAEncryptionPadding.OaepSHA1)\n            rsaProvider.Encrypt(data, RSAEncryptionPadding.OaepSHA256)\n            rsaProvider.Encrypt(padding:=padding, data:=data)\n        End Sub\n\n        Private Sub InvocationSetsNotAllowedValue(ByVal data As Byte(), ByVal genericRSA As RSA)\n            rsaProvider.Encrypt(data, False) ' Noncompliant\n            rsaProvider.Encrypt(fOAEP:=False, rgb:=data) ' Noncompliant\n            rsaProvider.Encrypt(data, System.Security.Cryptography.RSAEncryptionPadding.Pkcs1) ' Noncompliant\n            rsaProvider.Encrypt(data, RSAEncryptionPadding.Pkcs1) ' Noncompliant\n        End Sub\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EndStatementUsage.vb",
    "content": "﻿Module Module1\n    Sub Print(ByVal str As String)\n        Try\n\n            ' Error@+1 [BC30615] 'End' statement cannot be used in class library projects\n            End ' Noncompliant{{Remove this call to 'End' or ensure it is really required.}}\n'           ^^^\n\n\n            Dim a As Integer\n\n        Finally\n            ' do something important here\n\n        End Try\n    End Sub\nEnd Module\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EnumNameHasEnumSuffix.cs",
    "content": "﻿namespace Tests.Diagnostics\n{\n    public enum MyEnum //Noncompliant {{Rename this enumeration to remove the 'Enum' suffix.}}\n//              ^^^^^^\n    {\n        Value\n    }\n    public enum MyFlags //Noncompliant {{Rename this enumeration to remove the 'Flags' suffix.}}\n    {\n        Value\n    }\n    public enum MyEnum2\n    {\n        Value\n    }\n    public class ClassEnum\n    {\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EnumNameHasEnumSuffix.vb",
    "content": "﻿Namespace Tests.Diagnostics\n    Public Enum MyEnum ' Noncompliant {{Rename this enumeration to remove the 'Enum' suffix.}}\n'               ^^^^^^\n        Value\n    End Enum\n    Public Enum MyFlags ' Noncompliant\n        Value\n    End Enum\n    Public Enum MyEnum2\n        Value\n    End Enum\n    Public Class ClassEnum\n    End Class\nEnd Namespace"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EnumNameShouldFollowRegex.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public enum MyEnum\n    {\n        Value\n    }\n    public enum myEnum // Noncompliant {{Rename the enumeration 'myEnum' to match the regular expression: '^([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?$'.}}\n//              ^^^^^^\n    {\n        Value\n    }\n    public enum MyEnumTTTT // Noncompliant\n    {\n        Value\n    }\n    [Flags]\n    public enum MyFlagEnums\n    {\n        Value\n    }\n    [Flags]\n    public enum MyFlagEnum // Noncompliant {{Rename the enumeration 'MyFlagEnum' to match the regular expression: '^([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?s$'.}}\n//              ^^^^^^^^^^\n    {\n        Value\n    }\n    [Flags]\n    public enum myFlagEnums // Noncompliant\n    {\n        Value\n    }\n    [Flags]\n    public enum MyFlagEnumTTTTs // Noncompliant\n    {\n        Value\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EnumNameShouldFollowRegex.vb",
    "content": "﻿Imports System\n\nNamespace Tests.Diagnostics\n    Public Enum MyEnum\n        Value\n    End Enum\n    Public Enum myEnum2 ' Noncompliant {{Rename the enumeration 'myEnum2' to match the regular expression: '^([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?$'.}}\n'               ^^^^^^^\n        Value\n    End Enum\n    Public Enum MyEnumTTTT ' Noncompliant\n        Value\n    End Enum\n    <Flags()>\n    Public Enum MyFlagEnums\n        Value\n    End Enum\n    <Flags()>\n    Public Enum MyFlagEnum ' Noncompliant {{Rename the enumeration 'MyFlagEnum' to match the regular expression: '^([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?s$'.}}\n'               ^^^^^^^^^^\n        Value\n    End Enum\n    <Flags()>\n    Public Enum myFlagEnums2 ' Noncompliant\n        Value\n    End Enum\n    <Flags()>\n    Public Enum MyFlagEnumTTTTs ' Noncompliant\n        Value\n    End Enum\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EnumStorageNeedsToBeInt32.cs",
    "content": "﻿using System;\n\nnamespace MyLibrary\n{\n    public enum Visibility : sbyte // Noncompliant {{Change this enum storage to 'Int32'.}}\n//              ^^^^^^^^^^\n    {\n        Visible = 0,\n        Invisible = 1,\n    }\n\n    public enum Byte : byte { }  // Noncompliant\n    public enum Short : short { } // Noncompliant\n    public enum UShort : ushort { }  // Noncompliant\n\n    public enum Default { } // Compliant\n    public enum IntAlias : int { } // Compliant\n    public enum Int : System.Int32 { } // Compliant\n    public enum Long : long { } // Compliant\n    public enum ULong : ulong { } // Compliant\n    public enum UInt : uint { }  // Compliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EnumerableSumInUnchecked.CSharp11.cs",
    "content": "﻿using System;\nusing System.Linq;\nusing System.Collections.Generic;\n\nList<IntPtr> list1 = new();\nList<UIntPtr> list2 = new();\nint res;\n\nres = unchecked(list1.Sum(e => (int)e));  // Noncompliant {{Refactor this code to handle 'OverflowException'.}}\nres = unchecked(list2.Sum(e => (int)e));  // Noncompliant {{Refactor this code to handle 'OverflowException'.}}\n\nunchecked\n{\n    res = list1.Sum(e => (int)e);  // Noncompliant {{Refactor this code to handle 'OverflowException'.}}\n    res = list2.Sum(e => (int)e);  // Noncompliant {{Refactor this code to handle 'OverflowException'.}}\n\n    try\n    {\n        res = list1.Sum(e => (int)e);  // Compliant\n        res = list2.Sum(e => (int)e);  // Compliant\n    }\n    catch (Exception ex)\n    {\n    }\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EnumerableSumInUnchecked.CSharp9.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nList<int> list = new();\nint d = unchecked(list.Sum());  // Noncompliant {{Refactor this code to handle 'OverflowException'.}}\nunchecked\n{\n    int e = list.Sum();  // Noncompliant\n    e = Enumerable.Sum(list); // Noncompliant\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EnumerableSumInUnchecked.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Tests.Diagnostics\n{\n    public class EnumerableSumInUnchecked\n    {\n        public void Test(List<int> list, List<float> list2)\n        {\n            int a = list.Sum();  // Compliant\n\n            int d = unchecked(list.Sum());  // Noncompliant {{Refactor this code to handle 'OverflowException'.}}\n//                                 ^^^\n\n            unchecked\n            {\n                int e = list.Sum();  // Noncompliant\n//                           ^^^\n\n                e = Enumerable.Sum(list); // Noncompliant\n//                             ^^^\n\n                float floatSum = list2.Sum(); // Compliant\n            }\n\n            checked\n            {\n                int e = list.Sum();  // Compliant\n            }\n\n            unchecked\n            {\n                try\n                {\n                    int e = list.Sum();\n                }\n                catch (System.OverflowException e)\n                {\n                    // exception handling...\n                }\n            }\n\n            var l = new List<double>();\n            unchecked\n            {\n                var x = l.Sum();  // Compliant, it's on double\n            }\n\n            var l2 = new List<Nullable<long>>();\n            unchecked\n            {\n                var y = l2.Sum(ll => ll);  // Noncompliant\n            }\n\n            // coverage\n            list.Count();\n            MySum();\n            unchecked\n            {\n                MySum();\n            }\n        }\n\n        void MySum() { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EnumerationValueName.vb",
    "content": "﻿Namespace Tests.Diagnostics\n    Public Enum MyEnum\n        Value\n        v               ' Noncompliant\n        ValueVVV = 42   ' Noncompliant\n    End Enum\nEnd Namespace"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EnumsShouldNotBeNamedReserved.cs",
    "content": "﻿using System;\n\nnamespace MyLibrary\n{\n    public enum Color\n    {\n        None,\n        Red,\n        Orange,\n        Yellow,\n        ReservedColor  // Noncompliant {{Remove or rename this enum member.}}\n//      ^^^^^^^^^^^^^\n    }\n\n    public enum Reserved\n    {\n        None,\n        reservedcolor,\n        reserved, // Noncompliant\n        fooReserved // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EqualityOnFloatingPoint.CSharp11.cs",
    "content": "﻿using System;\nusing System.Numerics;\nusing System.Runtime.InteropServices;\n\npublic class EqualityOnFloatingPoint\n{\n    bool HalfEqual(Half first, Half second) =>\n        first == second;    // Noncompliant {{Do not check floating point equality with exact values, use a range instead.}}\n    //        ^^\n\n    bool NFloatEqual(NFloat first, NFloat second) =>\n        first == second; // Noncompliant\n\n    bool IsEpsilon<T>(T value) where T : IFloatingPointIeee754<T> =>\n        value == T.Epsilon; // Noncompliant\n\n    bool IsPi<T>(T value) where T : IFloatingPointIeee754<T> =>\n        value <= T.Pi && ((value >= T.Pi)); // Noncompliant\n\n    bool IsNotE<T>(T value) where T : IFloatingPointIeee754<T> =>\n        value > T.E || ((value < T.E)); // Noncompliant\n\n    bool AreEqual<T>(T first, T second) where T : IFloatingPointIeee754<T> =>\n        first == second; // Noncompliant\n\n    bool Equal<T>(T first, T second) where T : IBinaryFloatingPointIeee754<T> =>\n        first == second; // Noncompliant\n}\n\npublic class ReportSpecificMessage_NaN\n{\n    void HalfNaN(Half h)\n    {\n        _ = h == Half.NaN; // Noncompliant {{Do not check floating point equality with exact values, use 'Half.IsNaN()' instead.}}\n        //    ^^\n        h = Half.NaN;      // Compliant, not a comparison\n    }\n\n    void NFloatNaN(NFloat nf)\n    {\n        _ = nf == System.Runtime.InteropServices.NFloat.NaN; // Noncompliant {{Do not check floating point equality with exact values, use 'NFloat.IsNaN()' instead.}}\n        _ = nf == NFloat.NaN;                                // Noncompliant {{Do not check floating point equality with exact values, use 'NFloat.IsNaN()' instead.}}\n    }\n\n    public void M<T>(T t) where T : IFloatingPointIeee754<T>\n    {\n        if (t == T.NaN) { } // Noncompliant {{Do not check floating point equality with exact values, use 'T.IsNaN()' instead.}}\n        if (T.IsNaN(t)) { } // Compliant\n    }\n}\n\npublic class ReportSpecificMessage_Infinities\n{\n    void HalfInfinities(Half h)\n    {\n        _ = h == Half.PositiveInfinity; // Noncompliant {{Do not check floating point equality with exact values, use 'Half.IsPositiveInfinity()' instead.}}\n        _ = Half.NegativeInfinity == h; // Noncompliant {{Do not check floating point equality with exact values, use 'Half.IsNegativeInfinity()' instead.}}\n    }\n\n    void NFloatInfinities(NFloat nf)\n    {\n        _ = nf == NFloat.PositiveInfinity; // Noncompliant {{Do not check floating point equality with exact values, use 'NFloat.IsPositiveInfinity()' instead.}}\n        _ = NFloat.NegativeInfinity == nf; // Noncompliant {{Do not check floating point equality with exact values, use 'NFloat.IsNegativeInfinity()' instead.}}\n    }\n}\n\nnamespace TestWithUsingStatic\n{\n    using static System.Runtime.InteropServices.NFloat;\n\n    public class ReportSpecificMessage\n    {\n        public void WithUsingStatic(double d)\n        {\n            _ = d == NaN;          // Noncompliant {{Do not check floating point equality with exact values, use 'IsNaN()' instead.}}\n            _ = NaN == d;          // Noncompliant {{Do not check floating point equality with exact values, use 'IsNaN()' instead.}}\n            _ = NaN == NaN;        // Noncompliant {{Do not check floating point equality with exact values, use 'IsNaN()' instead.}}\n            _ = NaN == float.NaN;  // Noncompliant {{Do not check floating point equality with exact values, use 'NFloat.IsNaN()' instead.}}\n            _ = double.NaN == NaN; // Noncompliant {{Do not check floating point equality with exact values, use 'double.IsNaN()' instead.}}\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EqualityOnFloatingPoint.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Runtime.Versioning;\n\npublic class EqualityOnFloatingPoint\n{\n    void Test(float f, double d1, double d2, dynamic dyn)\n    {\n        if (dyn == 3.14) { }        // FN. {{Do not check floating point equality with exact values, use a range instead.}}\n        if (f == 3.14F) { }         // Noncompliant {{Do not check floating point equality with exact values, use a range instead.}}\n        //    ^^\n        if (f != 3.14F) { }         // Noncompliant {{Do not check floating point inequality with exact values, use a range instead.}}\n        if (d1 == d2) { }           // Noncompliant\n        if (d1 < 0 || d1 > 1) { }   // Compliant no indirect inequality test\n\n        var b = d1 == 3.14;                   // Noncompliant\n        if (true && f >= 3.146) { }           // Compliant no indirect equality test\n        if (f <= 3.146 && ((f >= 3.146))) { } // Noncompliant indirect equality test\n        if (3.146 >= f && 3.146 <= f) { }     // Noncompliant indirect equality test\n        if (f <= 3.146 && 3.146 <= f) { }     // FN. Equivalent to the case above but not detected\n        if (3.146 >= f && 3.146 < f) { }      // Compliant no indirect equality test\n        if (f <= 3.146 && f > 3.146) { }      // Compliant no indirect equality test\n\n        var i = 3;\n        if (i <= 3 && i >= 3) { }             // Compliant: integer\n        if (i < 4 || i > 4) { }               // Compliant: integer\n        if (f < 3.146 || f > 3.146) { }       // Noncompliant indirect inequality test\n        if (3.146 > f || 3.146 < f) { }       // Noncompliant indirect inequality test\n        if (3.146 > f || f > 3.146) { }       // FN. Equivalent to the case above but not detected\n        if (f < 3.146 || f >= 3.146) { }      // Compliant no indirect inequality\n        if (3.146 > f || 3.146 <= f) { }      // Compliant no indirect inequality test\n\n        if (f <= 3.146 && true && f >= 3.146) { } // Not recognized\n        if (Math.Sign(f) == 0) { }                // Compliant\n\n        float f1 = 0.0F;\n        if ((System.Math.Sign(f1) == 0)) { }      // Compliant\n    }\n}\n\npublic class ReportSpecificMessage_NaN\n{\n    public void WithDoubleEquality(int iPar, double dPar, float fPar)\n    {\n        double d = 1.0;\n\n        if (d == double.NaN) { }      // Noncompliant {{Do not check floating point equality with exact values, use 'double.IsNaN()' instead.}}\n        _ = d == double.NaN;          // Noncompliant {{Do not check floating point equality with exact values, use 'double.IsNaN()' instead.}}\n        _ = double.NaN == d;          // Noncompliant {{Do not check floating point equality with exact values, use 'double.IsNaN()' instead.}}\n        _ = double.NaN == double.NaN; // Noncompliant {{Do not check floating point equality with exact values, use 'double.IsNaN()' instead.}}\n        _ = iPar == double.NaN;       // Noncompliant {{Do not check floating point equality with exact values, use 'double.IsNaN()' instead.}}\n        _ = dPar == double.NaN;       // Noncompliant {{Do not check floating point equality with exact values, use 'double.IsNaN()' instead.}}\n        _ = fPar == double.NaN;       // Noncompliant {{Do not check floating point equality with exact values, use 'double.IsNaN()' instead.}}\n        _ = float.NaN == double.NaN;  // Noncompliant {{Do not check floating point equality with exact values, use 'double.IsNaN()' instead.}}\n        _ = double.NaN == float.NaN;  // Noncompliant {{Do not check floating point equality with exact values, use 'double.IsNaN()' instead.}}\n    }\n\n    public void WithDoubleInequality(int iPar, double dPar, float fPar)\n    {\n        double d = 1.0;\n\n        if (d != double.NaN) { }      // Noncompliant {{Do not check floating point inequality with exact values, use 'double.IsNaN()' instead.}}\n        _ = d != double.NaN;          // Noncompliant {{Do not check floating point inequality with exact values, use 'double.IsNaN()' instead.}}\n        _ = double.NaN != d;          // Noncompliant {{Do not check floating point inequality with exact values, use 'double.IsNaN()' instead.}}\n        _ = double.NaN != double.NaN; // Noncompliant {{Do not check floating point inequality with exact values, use 'double.IsNaN()' instead.}}\n        _ = iPar != double.NaN;       // Noncompliant {{Do not check floating point inequality with exact values, use 'double.IsNaN()' instead.}}\n        _ = dPar != double.NaN;       // Noncompliant {{Do not check floating point inequality with exact values, use 'double.IsNaN()' instead.}}\n        _ = fPar != double.NaN;       // Noncompliant {{Do not check floating point inequality with exact values, use 'double.IsNaN()' instead.}}\n        _ = float.NaN != double.NaN;  // Noncompliant {{Do not check floating point inequality with exact values, use 'double.IsNaN()' instead.}}\n        _ = double.NaN != float.NaN;  // Noncompliant {{Do not check floating point inequality with exact values, use 'double.IsNaN()' instead.}}\n    }\n\n    public void WithFloat(int iPar, float fPar)\n    {\n        float f = 1.0f;\n        _ = f == float.NaN;    // Noncompliant {{Do not check floating point equality with exact values, use 'float.IsNaN()' instead.}}\n        _ = f != float.NaN;    // Noncompliant {{Do not check floating point inequality with exact values, use 'float.IsNaN()' instead.}}\n        _ = iPar == float.NaN; // Noncompliant {{Do not check floating point equality with exact values, use 'float.IsNaN()' instead.}}\n        _ = fPar == float.NaN; // Noncompliant {{Do not check floating point equality with exact values, use 'float.IsNaN()' instead.}}\n        _ = iPar != float.NaN; // Noncompliant {{Do not check floating point inequality with exact values, use 'float.IsNaN()' instead.}}\n        _ = fPar != float.NaN; // Noncompliant {{Do not check floating point inequality with exact values, use 'float.IsNaN()' instead.}}\n    }\n\n    public void WithDoublePascalCase()\n    {\n        Double d = 1.0;\n        _ = d == Double.NaN;        // Noncompliant {{Do not check floating point equality with exact values, use 'double.IsNaN()' instead.}}\n        _ = d == System.Double.NaN; // Noncompliant {{Do not check floating point equality with exact values, use 'double.IsNaN()' instead.}}\n        _ = d != Double.NaN;        // Noncompliant {{Do not check floating point inequality with exact values, use 'double.IsNaN()' instead.}}\n        _ = d != System.Double.NaN; // Noncompliant {{Do not check floating point inequality with exact values, use 'double.IsNaN()' instead.}}\n    }\n\n    public void WithSingle()\n    {\n        Single f = 3.14159f;\n        _ = f == Single.NaN;         // Noncompliant {{Do not check floating point equality with exact values, use 'float.IsNaN()' instead.}}\n        _ = f == System.Single.NaN;  // Noncompliant {{Do not check floating point equality with exact values, use 'float.IsNaN()' instead.}}\n        _ = f != Single.NaN;         // Noncompliant {{Do not check floating point inequality with exact values, use 'float.IsNaN()' instead.}}\n        _ = f != System.Single.NaN;  // Noncompliant {{Do not check floating point inequality with exact values, use 'float.IsNaN()' instead.}}\n    }\n}\n\npublic class ReportSpecificMessage_Infinities\n{\n    public void WithDouble(double d)\n    {\n        _ = d == double.PositiveInfinity; // Noncompliant {{Do not check floating point equality with exact values, use 'double.IsPositiveInfinity()' instead.}}\n        _ = double.PositiveInfinity != d; // Noncompliant {{Do not check floating point inequality with exact values, use 'double.IsPositiveInfinity()' instead.}}\n        _ = d == double.NegativeInfinity; // Noncompliant {{Do not check floating point equality with exact values, use 'double.IsNegativeInfinity()' instead.}}\n        _ = double.NegativeInfinity != d; // Noncompliant {{Do not check floating point inequality with exact values, use 'double.IsNegativeInfinity()' instead.}}\n    }\n\n    public void WithFloat(float f)\n    {\n        _ = f == float.PositiveInfinity; // Noncompliant {{Do not check floating point equality with exact values, use 'float.IsPositiveInfinity()' instead.}}\n        _ = float.PositiveInfinity != f; // Noncompliant {{Do not check floating point inequality with exact values, use 'float.IsPositiveInfinity()' instead.}}\n        _ = f == float.NegativeInfinity; // Noncompliant {{Do not check floating point equality with exact values, use 'float.IsNegativeInfinity()' instead.}}\n        _ = float.NegativeInfinity != f; // Noncompliant {{Do not check floating point inequality with exact values, use 'float.IsNegativeInfinity()' instead.}}\n    }\n\n    public void WithDoublePascalCase(Double d)\n    {\n        _ = Double.PositiveInfinity == d;        // Noncompliant {{Do not check floating point equality with exact values, use 'double.IsPositiveInfinity()' instead.}}\n        _ = d == System.Double.NegativeInfinity; // Noncompliant {{Do not check floating point equality with exact values, use 'double.IsNegativeInfinity()' instead.}}\n    }\n\n    public void WithSingle(Single f)\n    {\n        _ = Single.PositiveInfinity == f;        // Noncompliant {{Do not check floating point equality with exact values, use 'float.IsPositiveInfinity()' instead.}}\n        _ = f == System.Single.NegativeInfinity; // Noncompliant {{Do not check floating point equality with exact values, use 'float.IsNegativeInfinity()' instead.}}\n    }\n}\n\nnamespace TestsWithTypeAliases\n{\n    using DoubleAlias = Double;\n\n    public class ReportSpecificMessage\n    {\n        public void WithDoubleAlias()\n        {\n            DoubleAlias d = 1.674927471E-27;\n            _ = d == DoubleAlias.NaN;     // Noncompliant {{Do not check floating point equality with exact values, use 'DoubleAlias.IsNaN()' instead.}}\n            if (d == double.NaN) { }      // Noncompliant {{Do not check floating point equality with exact values, use 'DoubleAlias.IsNaN()' instead.}}\n        }\n    }\n}\n\nnamespace TestWithUsingStatic\n{\n    using static System.Double;\n\n    public class ReportSpecificMessage\n    {\n        public void WithUsingStatic(double d)\n        {\n            _ = d == NaN;          // Noncompliant {{Do not check floating point equality with exact values, use 'IsNaN()' instead.}}\n            _ = NaN == d;          // Noncompliant {{Do not check floating point equality with exact values, use 'IsNaN()' instead.}}\n            _ = NaN == NaN;        // Noncompliant {{Do not check floating point equality with exact values, use 'IsNaN()' instead.}}\n            _ = NaN == float.NaN;  // Noncompliant {{Do not check floating point equality with exact values, use 'double.IsNaN()' instead.}}\n            _ = double.NaN == NaN; // Noncompliant {{Do not check floating point equality with exact values, use 'double.IsNaN()' instead.}}\n        }\n\n        public void WithLocalVar(double d)\n        {\n            var NaN = 5;\n            _ = d == NaN;   // Noncompliant {{Do not check floating point equality with exact values, use a range instead.}}\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EqualityOnModulus.CSharp11.cs",
    "content": "﻿using System;\nusing System.Numerics;\n\nnint nInt = 2;\nnuint nUInt = 3;\nIntPtr intPtr = 4;\nUIntPtr uIntPtr = 5;\n\nbool result;\n\nresult = nInt % 2 == 42; // Noncompliant {{The result of this modulus operation may not be positive.}}\nresult = nInt % 2 != 42; // Noncompliant {{The result of this modulus operation may not be positive.}}\nresult = nInt % 2 == -42; // Noncompliant {{The result of this modulus operation may not be negative.}}\nresult = nInt % 2 != -42; // Noncompliant {{The result of this modulus operation may not be negative.}}\nresult = nInt % 2 != 0; // Compliant\n\nresult = intPtr % 2 == 42; // Noncompliant {{The result of this modulus operation may not be positive.}}\nresult = intPtr % 2 != 42; // Noncompliant {{The result of this modulus operation may not be positive.}}\nresult = intPtr % 2 == -42; // Noncompliant {{The result of this modulus operation may not be negative.}}\nresult = intPtr % 2 != -42; // Noncompliant {{The result of this modulus operation may not be negative.}}\nresult = intPtr % 2 != 0; // Compliant\n\nresult = nUInt % 2 == 42; // Compliant\nresult = nUInt % 2 != 42; // Compliant\n\nresult = uIntPtr % 2 == 42; // Compliant\nresult = uIntPtr % 2 != 42; // Compliant\n\nbool ModulusOperator<TSelf>(TSelf parameter) where TSelf : IModulusOperators<TSelf, int, int>\n    => parameter % 2 == 42; // Noncompliant {{The result of this modulus operation may not be positive.}}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EqualityOnModulus.CSharp9.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnint x = 100;\nvar y = x % 2 == 1; // Noncompliant; if x is negative, x % 2 == -1\ny = x % 2 != -1; // Noncompliant {{The result of this modulus operation may not be negative.}}\ny = 1 == x % 2; // Noncompliant {{The result of this modulus operation may not be positive.}}\n\nnuint unsignedX = 100;\nvar xx = unsignedX % 4 == 1;\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EqualityOnModulus.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Tests.Diagnostics\n{\n    public class EqualityCheckOnModulus\n    {\n        public void isOdd(int x)\n        {\n            var y = x%2 == 1; // Noncompliant; if x is negative, x % 2 == -1\n//                  ^^^^^^^^\n            y = x%2 != -1; // Noncompliant {{The result of this modulus operation may not be negative.}}\n            y = 1 == x % 2; // Noncompliant {{The result of this modulus operation may not be positive.}}\n            y = x%2 != 0;\n            y = 1 == (x % 2); // Noncompliant {{The result of this modulus operation may not be positive.}}\n            y = Math.Abs(x % 2) == 1;\n\n            var unsignedY = 54U;\n\n            var xx = unsignedY % 4 == 1; // Compliant\n\n            var array = new[] {1};\n            y = array.Length % 2 == 1; // Compliant: array Length is > 0;\n            y = array.LongLength % 2 == 1; // Compliant: array Length is > 0;\n\n            IEnumerable<int> enumerable = array;\n            y = enumerable.Count() % 2 == 1; // Compliant - IEnumerable Count is > 0;\n            y = enumerable.LongCount() % 2 == 1; // Compliant - IEnumerable LongCount is > 0;\n            y = enumerable.Average() % 2 == 1; // Noncompliant\n\n            var list = new List<int>();\n            y = list.Count % 2 == 1; // Compliant - Count property is > 0;\n            y = list.Capacity % 2 == 1; // Compliant - Capacityproperty is > 0;\n\n            var someString = \"HelloImAWhale\";\n            y = someString.Length % 2 == 1; // Compliant - Length property is > 0;\n\n            y = FakeCount() % 2 == 1; // Noncompliant\n\n            IEnumerable<long> enumerableLong = new List<long>();\n            y = (enumerableLong.Count() % 2) == 1; // Compliant\n            y = enumerableLong.Count() % 2 == 1; // Compliant - IEnumerable Count is > 0;\n            y = enumerableLong.LongCount() % 2 == 1; // Compliant - IEnumerable LongCount is > 0;\n\n            var fakeList = new FakeList();\n            y = fakeList.Count() % 2 == 1; // Compliant - Count property is inherited from List and is > 0;\n            y = fakeList.Count(1) % 2 == 1; // Noncompliant - Count method is not inherited from List\n        }\n\n        public int FakeCount() => -1;\n    }\n\n    public class FakeList : List<int> {\n        public int Count(int i) { return i; }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EquatableClassShouldBeSealed.CSharp9.cs",
    "content": "﻿using System;\n\npublic record R\n{\n    public bool Equals(R other) => true; // Error [CS8872]\n}\n\npublic sealed record Q\n{\n    public bool Equals(Q other) => true; // Compliant\n}\n\npublic record RecordWithVirtualEquals : IEquatable<RecordWithVirtualEquals> // Compliant\n{\n    public virtual bool Equals(RecordWithVirtualEquals other) => true;\n}\n\npublic abstract record RecordWithAbstractEquals : IEquatable<RecordWithAbstractEquals> // Compliant\n{\n    public abstract bool Equals(RecordWithAbstractEquals other);\n}\n\npublic record R1(string x); // Compliant\npublic record R2(string x, string y) : R1(x); // Compliant\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EquatableClassShouldBeSealed.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class ClassWithVirtualEquals : IEquatable<ClassWithVirtualEquals> // Compliant\n    {\n        public virtual bool Equals(ClassWithVirtualEquals other) => true;\n    }\n\n    public abstract class ClassWithAbstractEquals : IEquatable<ClassWithAbstractEquals> // Compliant\n    {\n        public abstract bool Equals(ClassWithAbstractEquals other);\n    }\n\n    public abstract class ClassWithNonAbstractEquals : IEquatable<ClassWithAbstractEquals> // Noncompliant\n    {\n        public bool Equals(ClassWithAbstractEquals other) => true;\n    }\n\n    public sealed class SealedClassImplementsIEquatable : IEquatable<SealedClassImplementsIEquatable> // Compliant\n    {\n        public bool Equals(SealedClassImplementsIEquatable other) => true;\n    }\n\n    public class ClassImplementsIEquatable : IEquatable<ClassImplementsIEquatable> // Noncompliant {{Seal class 'ClassImplementsIEquatable' or implement 'IEqualityComparer<T>' instead.}}\n//               ^^^^^^^^^^^^^^^^^^^^^^^^^\n    {\n        public bool Equals(ClassImplementsIEquatable other) => true;\n    }\n\n    public class ClassProperlyImplementsIEquatable : IEquatable<ClassProperlyImplementsIEquatable> // Noncompliant\n    {\n        public bool Equals(ClassProperlyImplementsIEquatable other) => true;\n    }\n\n    public class ClassHasEqualsMethod // Noncompliant\n    {\n        public bool Equals(ClassHasEqualsMethod other) => true;\n    }\n\n    public class ComplexClass : IEquatable<ComplexClass>, IEquatable<ClassHasEqualsMethod> // Noncompliant\n    {\n        public virtual bool Equals(ComplexClass other) => true;\n        public bool Equals(ClassHasEqualsMethod other) => true;\n    }\n\n    public abstract class BaseClass : IEquatable<BaseClass> // Noncompliant\n    {\n        public bool Equals(BaseClass other) => false;\n    }\n\n    public class SubClass : BaseClass { }\n    public class SubSubClass : SubClass { }\n\n    public class Foo { }\n\n    public class Bar : Foo, IEquatable<Bar> // Noncompliant\n    {\n        public bool Equals(Bar other) => false;\n    }\n\n    internal class InternalClass : IEquatable<InternalClass> // Compliant because internal\n    {\n        public bool Equals(InternalClass other) => false;\n\n        private class PrivateClass : IEquatable<PrivateClass> // Compliant because private\n        {\n            public bool Equals(PrivateClass other) => false;\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/4446\n    public abstract class AbstractBase\n    {\n        public string X { get; set; }\n        public override bool Equals(object obj) => obj is AbstractBase ab && Equals(ab);\n        private bool Equals(AbstractBase other) => other?.X == this.X;\n        public override int GetHashCode() => 0;\n    }\n\n    public class Derived : AbstractBase\n    {\n        public string Y { get; set; }\n        public override bool Equals(object obj) => obj is Derived ab && Equals(ab);\n        private bool Equals(Derived other) => other.Y == this.Y && base.Equals(other);\n        public override int GetHashCode() => 0;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EscapeLambdaParameterTypeNamedScoped.CSharp11-13.cs",
    "content": "﻿namespace TypeNamedScoped\n{\n    using System;\n    using System.Collections.Generic;\n    using System.Threading.Tasks;\n\n    class LambdaParameters\n    {\n        delegate scoped Delegate();\n\n        void Noncompliant()\n        {\n            var x1 = (scoped a) => { }; // Noncompliant {{'scoped' should be escaped when used as a type name in lambda parameters}}\n            //        ^^^^^^\n\n            var x2 = (scoped[] a) => { }; // Noncompliant\n            //        ^^^^^^\n\n            var x3 = (scoped<int> a) => { }; // Noncompliant\n            //        ^^^^^^\n\n            var x4 = (scoped? a) => { }; // Noncompliant\n            //        ^^^^^^\n\n            var x5 = static (scoped a) => { }; // Noncompliant\n\n            var x6 = async (scoped a) => Task.CompletedTask; // Noncompliant\n\n            var x7 = (scoped a, scoped b) => { };\n            //        ^^^^^^\n            //                  ^^^^^^ @-1\n\n            var x8 = (scoped a) => (scoped b) => { };\n            //        ^^^^^^\n            //                      ^^^^^^ @-1\n\n            var x9 = (scoped[,] a) => { }; // Noncompliant\n            //        ^^^^^^\n\n            var x10 = (scoped[][] a) => { }; // Noncompliant\n            //         ^^^^^^\n\n            var x11 = (scoped<int>[] a) => { }; // Noncompliant\n            //         ^^^^^^\n\n            var x12 = (scoped<int>? a) => { }; // Noncompliant\n            //         ^^^^^^\n\n            var x13 = (scoped?[] a) => { }; // Noncompliant\n            //         ^^^^^^\n\n            var x14 = (scoped[]? a) => { }; // Noncompliant\n            //         ^^^^^^\n\n            var x15 = (scoped<int>[,] a) => { }; // Noncompliant\n            //         ^^^^^^\n\n            var x16 = (scoped<int>[][] a) => { }; // Noncompliant\n            //         ^^^^^^\n\n            var x17 = (scoped<int>?[] a) => { }; // Noncompliant\n            //         ^^^^^^\n\n            var x18 = (scoped<int>[]? a) => { }; // Noncompliant\n            //         ^^^^^^\n\n            Action<int> x19 = (scoped) => { }; // Noncompliant\n            //                 ^^^^^^\n\n            Action<int, int> x20 = (a, scoped) => { }; // Noncompliant\n            //                         ^^^^^^\n        }\n\n        void Compliant()\n        {\n            var x1 = (@scoped s) => { };\n\n            var x2 = (TypeNamedScoped.scoped s) => { };\n\n            var x3 = (global::TypeNamedScoped.scoped s) => { };\n\n            var x4 = (List<scoped> s) => { };\n\n            var x5 = ((scoped, scoped) s) => { };\n\n            var x6 = (@scoped? a) => { };\n\n            var x7 = static (@scoped a) => { };\n\n            var x8 = async (@scoped a) => Task.CompletedTask;\n\n            var x9 = (int scoped) => { };\n\n            Action<@scoped> x10 = delegate (@scoped s) { };\n\n            var x11 = () => { };\n\n            Action<int> x12 = (@scoped) => { };\n\n            Action<int> x13 = scoped => { };\n\n            Action<int, int> x14 = (a, @scoped) => { };\n\n            var x15 = (@scoped<int> a) => { };\n\n            var x16 = (@scoped<int>? a) => { };\n        }\n    }\n\n    class @scoped { }\n    class @scoped<T> { }\n}\n\nnamespace ScopedModifier\n{\n    class LambdaParameters\n    {\n        delegate void Delegate(scoped scoped scoped);\n        delegate void Delegate2(scoped scoped);\n        delegate void DelegateRef(scoped ref @scoped s);\n        delegate void DelegateIn(scoped in @scoped s);\n        delegate void DelegateOut(scoped out @scoped s);\n\n        void Compliant()\n        {\n            var x1 = (scoped global::ScopedModifier.scoped s) => { };\n            var x2 = (scoped ScopedModifier.scoped s) => { };\n\n            Delegate x3 = (scoped @scoped s) => { };\n\n            Delegate x4 = delegate (scoped s) { };\n            Delegate x5 = delegate (scoped scoped s) { };\n\n            Delegate2 x6 = delegate (scoped s) { };\n            Delegate2 x7 = delegate (scoped scoped s) { };\n\n            DelegateRef x8 = (scoped ref @scoped s) => { };\n            DelegateIn x9 = (scoped in @scoped s) => { };\n            DelegateOut x10 = (scoped out @scoped s) => { s = default; };\n        }\n\n        void Noncompliant()\n        {\n            Delegate x1 = (scoped scoped s) => { }; // Noncompliant\n            //                    ^^^^^^\n\n            DelegateRef x2 = (scoped ref scoped s) => { }; // Noncompliant\n            //                           ^^^^^^\n\n            DelegateIn x3 = (scoped in scoped s) => { }; // Noncompliant\n            //                         ^^^^^^\n\n            DelegateOut x4 = (scoped out scoped s) => { s = default; }; // Noncompliant\n            //                           ^^^^^^\n\n            Delegate x5 = (scoped scoped) => { }; // Noncompliant\n            //             ^^^^^^\n        }\n\n        unsafe void Pointer()\n        {\n            var x1 = (@scoped* s) => { };\n            var x2 = (scoped* s) => { }; // Noncompliant\n        }\n    }\n\n    ref struct @scoped { }\n    ref struct @scoped<T> { }\n}\n\nnamespace AliasedScoped\n{\n    using @scoped = System.Int32;\n    using System.Collections.Generic;\n\n    class LambdaParameters\n    {\n        void Noncompliant()\n        {\n            var x1 = (scoped a) => { }; // Noncompliant\n\n            var x2 = (scoped[] a) => { }; // Noncompliant\n\n            var x3 = (scoped? a) => { }; // Noncompliant\n\n            var x4 = (scoped[]? a) => { }; // Noncompliant\n        }\n\n        void Compliant()\n        {\n            var x1 = (@scoped s) => { };\n\n            var x2 = (List<scoped> s) => { };\n\n            var x3 = ((scoped, scoped) s) => { };\n\n            var x4 = (@scoped? a) => { };\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EscapeLambdaParameterTypeNamedScoped.Latest.cs",
    "content": "﻿// The structure of this file must mirror EscapeLambdaParameterTypeNamedScoped.CSharp11-13.cs\n// Both files must be kept in sync — add new test cases to both files.\n// Annotations differ: C# 14 emits compiler errors for all noncompliant cases instead of S8381 diagnostics.\n\nnamespace TypeNamedScoped\n{\n    using System;\n    using System.Collections.Generic;\n    using System.Threading.Tasks;\n\n    class LambdaParameters\n    {\n        delegate scoped Delegate();\n\n        void Noncompliant()\n        {\n            var x1 = (scoped a) => { }; // Error [CS8917]\n\n            var x2 = (scoped[] a) => { }; // Error [CS0119, CS0443, CS0103, CS1002, CS1026, CS1513, CS1002]\n\n            var x3 = (scoped<int> a) => { }; // Error [CS0119, CS0119, CS0103, CS1002, CS1026, CS1002, CS1513]\n\n            var x4 = (scoped ? a) => { }; // Error [CS0119, CS0103, CS1003, CS1525, CS1003, CS1002]\n\n            var x5 = static (scoped a) => { }; // Error [CS8917]\n\n            var x6 = async (scoped a) => Task.CompletedTask; // Error [CS8917]\n\n            var x7 = (scoped a, scoped b) => { }; // Error [CS8917]\n\n            var x8 = (scoped a) => (scoped b) => { }; // Error [CS8917]\n\n            var x9 = (scoped[,] a) => { }; // Error [CS0119, CS0443, CS0443, CS0103, CS1002, CS1026, CS1002, CS1513]\n\n            var x10 = (scoped[][] a) => { }; // Error [CS0119, CS0443, CS0443, CS0103, CS1002, CS1026, CS1002, CS1513]\n\n            var x11 = (scoped<int>[] a) => { }; // Error [CS0119, CS0443, CS0103, CS1002, CS1026, CS1002, CS1513]\n\n            var x12 = (scoped<int> ? a) => { }; // Error [CS0119, CS0103, CS1003, CS1525, CS1003, CS1002]\n\n            var x13 = (scoped?[] a) => { }; // Error [CS0119, CS0443, CS0103, CS1002, CS1026, CS1002, CS1513]\n\n            var x14 = (scoped[]? a) => { }; // Error [CS0119, CS0443, CS0103, CS1003, CS1525, CS1003, CS1002]\n\n            var x15 = (scoped<int>[,] a) => { };   // Error [CS0119, CS0443, CS0443, CS0103, CS1002, CS1026, CS1002, CS1513]\n\n            var x16 = (scoped<int>[][] a) => { }; // Error [CS0119, CS0443, CS0443, CS0103, CS1002, CS1026, CS1002, CS1513]\n\n            var x17 = (scoped<int>?[] a) => { };   // Error [CS0119, CS0443, CS0103, CS1002, CS1026, CS1002, CS1513]\n\n            var x18 = (scoped<int>[]? a) => { }; // Error [CS0119, CS0443, CS0103, CS1003, CS1525, CS1003, CS1002]\n\n            Action<int> x19 = (scoped) => { }; // Error [CS9048, CS1001]\n\n            Action<int, int> x20 = (a, scoped) => { }; // Error [CS9048, CS1001]\n\n        }\n\n        void Compliant()\n        {\n            var x1 = (@scoped s) => { };\n\n            var x2 = (TypeNamedScoped.scoped s) => { };\n\n            var x3 = (global::TypeNamedScoped.scoped s) => { };\n\n            var x4 = (List<scoped> s) => { };\n\n            var x5 = ((scoped, scoped) s) => { };\n\n            var x6 = (@scoped? a) => { };\n\n            var x7 = static (@scoped a) => { };\n\n            var x8 = async (@scoped a) => Task.CompletedTask;\n\n            var x9 = (int scoped) => { };\n\n            Action<@scoped> x10 = delegate (@scoped s) { };\n\n            var x11 = () => { };\n\n            Action<int> x12 = (@scoped) => { };\n\n            Action<int> x13 = scoped => { };\n\n            Action<int, int> x14 = (a, @scoped) => { };\n\n            var x15 = (@scoped<int> a) => { };\n\n            var x16 = (@scoped<int>? a) => { };\n        }\n    }\n\n    class @scoped { }\n\n    class @scoped<T> { }\n}\n\nnamespace ScopedModifier\n{\n    class LambdaParameters\n    {\n        delegate void Delegate(scoped scoped scoped);\n        delegate void Delegate2(scoped scoped);\n        delegate void DelegateRef(scoped ref @scoped s);\n        delegate void DelegateIn(scoped in @scoped s);\n        delegate void DelegateOut(scoped out @scoped s);\n\n        void Compliant()\n        {\n            var x1 = (scoped global::ScopedModifier.scoped s) => { };\n            var x2 = (scoped ScopedModifier.scoped s) => { };\n\n            Delegate x3 = (scoped @scoped s) => { };\n\n            Delegate x4 = delegate (scoped s) { };\n            Delegate x5 = delegate (scoped scoped s) { };\n\n            Delegate2 x6 = delegate (scoped s) { };\n            Delegate2 x7 = delegate (scoped scoped s) { };\n\n            DelegateRef x8 = (scoped ref @scoped s) => { };\n            DelegateIn x9 = (scoped in @scoped s) => { };\n            DelegateOut x10 = (scoped out @scoped s) => { s = default; };\n        }\n\n        void Noncompliant()\n        {\n            Delegate x1 = (scoped scoped s) => { }; // Error [CS1107]\n\n            DelegateRef x2 = (scoped ref scoped s) => { }; // Error [CS1107]\n\n            DelegateIn x3 = (scoped in scoped s) => { }; // Error [CS1107]\n\n            DelegateOut x4 = (scoped out scoped s) => { s = default; }; //Error [CS1107]\n\n            Delegate x5 = (scoped scoped) => { };\n\n        }\n\n        unsafe void Pointer()\n        {\n            var x1 = (@scoped* s) => { };\n            var x2 = (scoped* s) => { }; // Error [CS0119, CS0103, CS1003, CS1002]\n        }\n    }\n\n    ref struct @scoped { }\n    ref struct @scoped<T> { }\n}\n\nnamespace AliasedScoped\n{\n    using @scoped = System.Int32;\n    using System.Collections.Generic;\n\n    class LambdaParameters\n    {\n        void Noncompliant()\n        {\n            var x1 = (scoped a) => { }; // Error [CS8917]\n\n            var x2 = (scoped[] a) => { }; // Error [CS0119, CS0443, CS0103, CS1002, CS1026, CS1002, CS1513]\n\n            var x3 = (scoped? a) => { }; // Error [CS0119, CS0103, CS1003, CS1525, CS1003, CS1002]\n\n            var x4 = (scoped[]? a) => { }; // Error [CS0119, CS0443, CS0103, CS1003, CS1525, CS1003, CS1002]\n        }\n\n        void Compliant()\n        {\n            var x1 = (@scoped s) => { };\n\n            var x2 = (List<scoped> s) => { };\n\n            var x3 = ((scoped, scoped) s) => { };\n\n            var x4 = (@scoped? a) => { };\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EscapeLambdaParameterTypeNamedScoped.TopLevelStatements.CSharp11-13.cs",
    "content": "﻿var x1 = (scoped global::scoped s) => { };\n\nvar x2 = (scoped global::scoped<int> s) => { };\n\nref struct @scoped { }\n\nref struct @scoped<T> { }\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EscapeLambdaParameterTypeNamedScoped.TopLevelStatements.Latest.cs",
    "content": "﻿var x1 = (scoped global::scoped s) => { };\n\nvar x2 = (scoped global::scoped<int> s) => { };\n\nref struct @scoped { }\n\nref struct @scoped<T> { }\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EventHandlerDelegateShouldHaveProperArguments.Latest.Partial.cs",
    "content": "﻿using System;\n\npartial record R\n{\n    public event EventHandler SomeEvent;\n    public static event EventHandler SomeStaticEvent;\n\n    protected partial void OnFoo(EventArgs e);\n}\n\npartial class PartialEvents\n{\n    partial event EventHandler PartialEvent;\n    static partial event EventHandler PartialStaticEvent;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EventHandlerDelegateShouldHaveProperArguments.Latest.cs",
    "content": "﻿using System;\n\npartial record R\n{\n    protected partial void OnFoo(EventArgs e)\n    {\n        SomeEvent?.Invoke(this, e);\n        SomeEvent?.Invoke(null, e); // Noncompliant {{Make the sender on this event invocation not null.}}\n//                ^^^^^^^^^^^^^^^^\n        SomeEvent?.Invoke(this, null); // Noncompliant {{Use 'EventArgs.Empty' instead of null as the event args of this event invocation.}}\n        SomeEvent?.Invoke(null, null); // Noncompliant\n                                       // Noncompliant@-1\n\n        SomeStaticEvent?.Invoke(null, e);\n        SomeStaticEvent?.Invoke(this, e); // Noncompliant {{Make the sender on this static event invocation null.}}\n        SomeStaticEvent?.Invoke(null, null); // Noncompliant {{Use 'EventArgs.Empty' instead of null as the event args of this event invocation.}}\n        SomeStaticEvent?.Invoke(this, null); // Noncompliant\n                                             // Noncompliant@-1\n\n        SomeEvent(null, e); // Noncompliant\n        SomeStaticEvent(null, null); // Noncompliant\n    }\n}\n\ninterface IMyInterface\n{\n    static virtual event EventHandler VirtualEvent;\n\n    static virtual void VirtualMethod<T>(object sender, EventArgs e) where T : IMyInterface\n    {\n        T.VirtualEvent.Invoke(null, null);      // Noncompliant\n        VirtualEvent.Invoke(null, null);        // Noncompliant\n        T.VirtualEvent.Invoke(null, e);         // Compliant\n        VirtualEvent.Invoke(null, e);           // Compliant\n    }\n}\n\npartial class PartialEvents\n{\n    EventHandler handler;\n    static EventHandler staticHandler;\n    partial event EventHandler PartialEvent { add => handler += value; remove => handler -= value; }\n    static partial event EventHandler PartialStaticEvent { add => staticHandler += value; remove => staticHandler -= value; }\n\n    void Method(EventArgs e)\n    {\n        PartialEvent?.Invoke(null, e);          // Error [CS0079] The event 'PartialEvents.PartialEvent' can only appear on the left hand side of += or -=\n        PartialStaticEvent?.Invoke(this, e);    // Error [CS0079] The event 'PartialEvents.PartialStaticEvent' can only appear on the left hand side of += or -=\n        handler?.Invoke(null, e);               // Compliant\n        handler?.Invoke(null, null);            // Noncompliant\n        staticHandler?.Invoke(this, e);         // Compliant\n        staticHandler?.Invoke(this, null);      // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EventHandlerDelegateShouldHaveProperArguments.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    class Foo\n    {\n        public EventHandler Bar { get; }\n    }\n\n    class Program\n    {\n        public event EventHandler SomeEvent;\n        public static event EventHandler SomeStaticEvent;\n\n        protected void OnFoo(EventArgs e)\n        {\n            SomeEvent?.Invoke(this, e);\n            SomeEvent?.Invoke(null, e); // Noncompliant {{Make the sender on this event invocation not null.}}\n//                    ^^^^^^^^^^^^^^^^\n            SomeEvent?.Invoke(this, null); // Noncompliant {{Use 'EventArgs.Empty' instead of null as the event args of this event invocation.}}\n            SomeEvent?.Invoke(null, null); // Noncompliant\n                                           // Noncompliant@-1\n\n            SomeEvent(null, e); // Noncompliant {{Make the sender on this event invocation not null.}}\n//          ^^^^^^^^^^^^^^^^^^\n            SomeEvent.Invoke(this, e);\n\n            SomeStaticEvent?.Invoke(null, e);\n            SomeStaticEvent?.Invoke(this, e); // Noncompliant {{Make the sender on this static event invocation null.}}\n            SomeStaticEvent?.Invoke(null, null); // Noncompliant {{Use 'EventArgs.Empty' instead of null as the event args of this event invocation.}}\n            SomeStaticEvent?.Invoke(this, null); // Noncompliant\n                                                 // Noncompliant@-1\n\n            SomeStaticEvent(this, e); // Noncompliant {{Make the sender on this static event invocation null.}}\n\n\n            SomeEvent?.Invoke(default(object), e); // Compliant - we don't handle default(T)\n            SomeEvent?.Invoke(this, default(EventArgs)); // Compliant - we don't handle default(T)\n        }\n\n        public event EventHandler<ResolveEventArgs> SomeOtherEvent;\n\n        protected void OnBar(ResolveEventArgs e)\n        {\n            SomeOtherEvent?.Invoke(null, e); // Noncompliant\n        }\n\n        protected void OnFooBar(EventArgs e)\n        {\n            SomeEvent(); // Error [CS7036] - Invalid syntax\n            SomeEvent(null, null, null); // Error [CS1593] - Invalid syntax\n        }\n\n        protected void OnEvent()\n        {\n            Foo foo = new Foo();\n\n            foo?.Bar?.Invoke(this, EventArgs.Empty); // Should not cause a StackOverflow\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EventHandlerName.vb",
    "content": "﻿Namespace Tests.Diagnostics\n    Module Module1\n        ' Error@+1 [BC30506]\n        Sub subJect__SomeEvent() Handles X.SomeEvent   ' Noncompliant - two underscores\n        End Sub\n        ' Error@+1 [BC30506]\n        Sub subJect_SomeEvent() Handles X.SomeEvent    ' Compliant\n        End Sub\n\n        ' Error@+1 [BC30506]\n        Sub SubbJect_SomeEvent() Handles X.SomeEvent    ' Compliant\n        End Sub\n\n        ' Error@+1 [BC30506]\n        Sub OnMyButtonClicked() Handles X.SomeEvent    ' Compliant\n        End Sub\n        ' Error@+1 [BC30506]\n        Sub oonMyButtonClicked() Handles X.SomeEvent    ' Noncompliant\n        End Sub\n    End Module\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EventName.vb",
    "content": "﻿Namespace Tests.Diagnostics\n    Module Module1\n        Event fooEvent() ' Noncompliant\n        Event FooEvent2() ' Compliant\n        Event FooEvent2XX() ' Compliant\n    End Module\nEnd Namespace"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/EventNameContainsBeforeOrAfter.vb",
    "content": "﻿Imports System\nClass Foo\n    Event BeforeClose() ' Noncompliant {{Rename this event to remove the 'Before' prefix.}}\n'         ^^^^^^^^^^^\n    Event afterClose()  ' Noncompliant\n    Event Closing()\n    Public Custom Event BeforeClose2 As EventHandler ' Noncompliant\n        AddHandler(ByVal value As EventHandler)\n            Me.Events.AddHandler(Me.EventServerChange, value) ' Error [BC30456,BC30456]\n        End AddHandler\n\n\n        RemoveHandler(ByVal value As EventHandler)\n            Me.Events.RemoveHandler(Me.EventServerChange, value) ' Error [BC30456,BC30456]\n        End RemoveHandler\n\n\n        RaiseEvent(ByVal sender As Object, ByVal e As System.EventArgs)\n            CType(Me.Events(Me.EventServerChange), EventHandler).Invoke(sender, e) ' Error [BC30456,BC30456]\n        End RaiseEvent\n    End Event\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ExceptionRethrow.Fixed.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class ExceptionType1 : Exception { }\n    public class ExceptionType2 : Exception { }\n\n    public class ExceptionRethrow\n    {\n        public void Test()\n        {\n            try\n            { }\n            catch (ExceptionType1 exc)\n            {\n                Console.WriteLine(exc);\n                throw; // Fixed\n                throw;\n            }\n            catch (ExceptionType2 exc)\n            {\n                throw new Exception(\"My custom message\", exc);  // Compliant; stacktrace preserved\n            }\n\n            try\n            { }\n            catch (Exception)\n            {\n                throw;\n            }\n\n            try\n            {\n            }\n            catch (Exception exception)\n            {\n                try\n                {\n                    throw; // Fixed\n                }\n                catch (Exception exc)\n                {\n                    throw; // Fixed\n                    throw exception;\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ExceptionRethrow.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class ExceptionType1 : Exception { }\n    public class ExceptionType2 : Exception { }\n\n    public class ExceptionRethrow\n    {\n        public void Test()\n        {\n            try\n            { }\n            catch (ExceptionType1 exc)\n            {\n                Console.WriteLine(exc);\n                throw exc; // Noncompliant {{Consider using 'throw;' to preserve the stack trace.}}\n//              ^^^^^^^^^^\n                throw;\n            }\n            catch (ExceptionType2 exc)\n            {\n                throw new Exception(\"My custom message\", exc);  // Compliant; stacktrace preserved\n            }\n\n            try\n            { }\n            catch (Exception)\n            {\n                throw;\n            }\n\n            try\n            {\n            }\n            catch (Exception exception)\n            {\n                try\n                {\n                    throw exception; // Noncompliant\n                }\n                catch (Exception exc)\n                {\n                    throw exc; // Noncompliant\n                    throw exception;\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ExceptionShouldNotBeThrownFromUnexpectedMethods.Latest.Partial.cs",
    "content": "﻿using System;\n\npartial class PartialClass\n{\n    partial PartialClass();\n\n    partial event EventHandler PartialEvent;\n\n    static partial event EventHandler StaticPartialEvent;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ExceptionShouldNotBeThrownFromUnexpectedMethods.Latest.cs",
    "content": "﻿using System;\nusing System.Runtime.CompilerServices;\n\nnamespace Tests.CustomType\n{\n    public class ModuleInitializerAttribute : Attribute { }\n\n    public class Foo\n    {\n        [ModuleInitializer]\n        internal static void M1()\n        {\n            throw new Exception(); // Compliant - the attribute is not in the System.Runtime.CompilerServices namespace\n        }\n    }\n}\n\nrecord Record1 : IDisposable\n{\n    static Record1() => throw new NotImplementedException(); // Compliant (allowed exception)\n    public void Dispose()\n    {\n        throw new NotImplementedException(); // Compliant (allowed exception)\n    }\n}\n\nrecord Record2 : IDisposable\n{\n    static Record2() => throw new Exception(); // Noncompliant {{Remove this 'throw' expression.}}\n//                      ^^^^^^^^^^^^^^^^^^^^^\n\n    [ModuleInitializer]\n    internal static void M1()\n    {\n        throw new Exception(); // Noncompliant\n    }\n\n    [Obsolete]\n    [System.Runtime.CompilerServices.ModuleInitializerAttribute]\n    internal static void M2() => throw new Exception(); // Noncompliant\n\n    [Obsolete]\n    internal static void M3() => throw new Exception(); // Compliant - different attribute\n\n    [Obsolete(\"This attribute has arguments.\", true)]\n    internal static void M4() => throw new Exception(); // Compliant - different attribute\n\n    event EventHandler OnSomething\n    {\n        add\n        {\n            throw new Exception(); // Noncompliant\n        }\n        remove\n        {\n            throw new InvalidOperationException(); // Compliant - allowed exception\n        }\n    }\n\n    event EventHandler OnSomeArrow\n    {\n        add => throw new Exception(); // Noncompliant\n        remove => throw new InvalidOperationException(); // Compliant - allowed exception\n    }\n\n    public override string ToString()\n    {\n        throw new Exception(); // Noncompliant\n    }\n\n    public void Dispose()\n    {\n        throw new Exception(); // Noncompliant\n    }\n}\n\ninterface IMyInterface\n{\n    static virtual event EventHandler VirtualEvent\n    {\n        add => throw new Exception(); // Noncompliant\n        remove => throw new InvalidOperationException(); // Compliant - allowed exception\n    }\n\n    static abstract event EventHandler AbstractEvent;\n}\n\nclass MyClass : IMyInterface\n{\n    public static event EventHandler AbstractEvent\n    {\n        add => throw new Exception(); // Noncompliant\n        remove => throw new InvalidOperationException(); // Compliant - allowed exception\n    }\n}\n\npartial class PartialClass\n{\n    partial PartialClass() => throw new Exception();    // Compliant\n\n    partial event EventHandler PartialEvent\n    {\n        add => throw new Exception();                   // Noncompliant\n        remove { throw new Exception(); }               // Noncompliant\n    }\n\n    static partial event EventHandler StaticPartialEvent\n    {\n        add { throw new Exception(); }                  // Noncompliant\n        remove => throw new Exception();                // Noncompliant\n    }\n}\n\nnamespace Extensions\n{\n    class Sample { }\n\n    static class Extensions\n    {\n        extension(Sample)\n        {\n            public static bool operator ==(Sample a, Sample b)\n            {\n                throw new Exception(); // Noncompliant\n            }\n\n            public static bool operator !=(Sample a, Sample b)\n            {\n                throw new Exception(); // Noncompliant\n            }\n        }\n\n        extension(Sample s)\n        {\n            public bool Equals(object obj) => throw new Exception();    // Compliant NET-2707\n            public int GetHashCode() => throw new Exception();          // Compliant\n            public string ToString() { throw new Exception(); }         // Compliant\n            public void Dispose() { throw new Exception(); }            // Compliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ExceptionShouldNotBeThrownFromUnexpectedMethods.cs",
    "content": "﻿using System;\n\nclass ValidProgram : IDisposable\n{\n    static ValidProgram()\n    {\n        throw new NotImplementedException();\n    }\n\n    event EventHandler OnSomething\n    {\n        add\n        {\n            throw new NotImplementedException();\n        }\n        remove\n        {\n            throw new NotImplementedException();\n        }\n    }\n\n    event EventHandler OnSomething1\n    {\n        add\n        {\n            throw new InvalidOperationException(); // Compliant\n        }\n        remove\n        {\n            throw new InvalidOperationException(); // Compliant\n        }\n    }\n\n    event EventHandler OnSomething2\n    {\n        add\n        {\n            throw new NotSupportedException(); // Compliant\n        }\n        remove\n        {\n            throw new NotSupportedException(); // Compliant\n        }\n    }\n\n    event EventHandler OnSomething3\n    {\n        add\n        {\n            throw new ArgumentException(); // Compliant\n        }\n        remove\n        {\n            throw new ArgumentException(); // Compliant\n        }\n    }\n\n    public override bool Equals(object obj)\n    {\n        throw new NotImplementedException();\n    }\n\n    public override int GetHashCode()\n    {\n        throw new NotImplementedException();\n    }\n\n    public override string ToString()\n    {\n        throw new NotImplementedException();\n    }\n\n    public void Dispose()\n    {\n        throw new NotImplementedException();\n    }\n\n    public static bool operator ==(ValidProgram a, ValidProgram b)\n    {\n        throw new NotImplementedException();\n    }\n\n    public static bool operator !=(ValidProgram a, ValidProgram b)\n    {\n        throw new NotImplementedException();\n    }\n\n    public static bool operator >=(ValidProgram a, ValidProgram b)\n    {\n        throw new NotImplementedException();\n    }\n\n    public static bool operator <=(ValidProgram a, ValidProgram b)\n    {\n        throw new NotImplementedException();\n    }\n\n    public static bool operator >(ValidProgram a, ValidProgram b)\n    {\n        throw new NotImplementedException();\n    }\n\n    public static bool operator <(ValidProgram a, ValidProgram b)\n    {\n        throw new NotImplementedException();\n    }\n\n    public static implicit operator byte(ValidProgram d)\n    {\n        throw new NotImplementedException();\n    }\n}\n\nclass ValidRethrowProgram : IDisposable\n{\n    static ValidRethrowProgram()\n    {\n        try\n        {\n        }\n        catch (Exception)\n        {\n            throw;\n        }\n    }\n\n    event EventHandler OnSomething\n    {\n        add\n        {\n            try\n            {\n            }\n            catch (Exception)\n            {\n                throw;\n            }\n        }\n        remove\n        {\n            try\n            {\n            }\n            catch (Exception)\n            {\n                throw;\n            }\n        }\n    }\n\n    public override bool Equals(object obj)\n    {\n        try\n        {\n        }\n        catch (Exception)\n        {\n            throw;\n        }\n\n        return true;\n    }\n\n    public static bool operator ==(ValidRethrowProgram a, ValidRethrowProgram b) // Error [CS0216] - no != operator\n    {\n        try\n        {\n        }\n        catch (Exception)\n        {\n            throw;\n        }\n\n        return true;\n    }\n\n    public void Dispose() { }\n}\n\nclass InvalidProgram : IDisposable\n{\n    static InvalidProgram()\n    {\n        throw new Exception(); // Noncompliant {{Remove this 'throw' statement.}}\n//      ^^^^^^^^^^^^^^^^^^^^^^\n    }\n\n    event EventHandler OnSomething\n    {\n        add\n        {\n            throw new Exception(); // Noncompliant\n        }\n        remove\n        {\n            throw new Exception(); // Noncompliant\n        }\n    }\n\n    public override bool Equals(object obj)\n    {\n        throw new Exception(); // Noncompliant\n    }\n\n    public override int GetHashCode()\n    {\n        throw new Exception(); // Noncompliant\n    }\n\n    public override string ToString()\n    {\n        throw new Exception(); // Noncompliant\n    }\n\n    public void Dispose()\n    {\n        throw new Exception(); // Noncompliant\n    }\n\n    public static bool operator ==(InvalidProgram a, InvalidProgram b)\n    {\n        throw new Exception(); // Noncompliant\n    }\n\n    public static bool operator !=(InvalidProgram a, InvalidProgram b)\n    {\n        throw new Exception(); // Noncompliant\n    }\n\n    public static bool operator >=(InvalidProgram a, InvalidProgram b)\n    {\n        throw new Exception(); // Noncompliant\n    }\n\n    public static bool operator <=(InvalidProgram a, InvalidProgram b)\n    {\n        throw new Exception(); // Noncompliant\n    }\n\n    public static bool operator >(InvalidProgram a, InvalidProgram b)\n    {\n        throw new Exception(); // Noncompliant\n    }\n\n    public static bool operator <(InvalidProgram a, InvalidProgram b)\n    {\n        throw new Exception(); // Noncompliant\n    }\n\n    public static implicit operator byte(InvalidProgram d)\n    {\n        throw new Exception(); // Noncompliant\n    }\n}\n\nref struct DisposableRefStruct\n{\n    public void Dispose()\n    {\n        throw new Exception(); // Noncompliant\n    }\n}\n\nclass ArrowMethods : IDisposable\n{\n    static ArrowMethods() => throw new Exception(); // Noncompliant\n    public void Dispose() => throw new Exception(); // Noncompliant\n    public static bool operator ==(ArrowMethods a, ArrowMethods b) => throw new Exception(); // Noncompliant\n    public static bool operator !=(ArrowMethods a, ArrowMethods b) => throw new Exception(); // Noncompliant\n    event EventHandler OnSomething\n    {\n        add => throw new Exception(); // Noncompliant\n        remove => throw new Exception(); // Noncompliant\n    }\n    public static implicit operator byte(ArrowMethods d) => throw new Exception(); // Noncompliant\n\n    private string name;\n    public override string ToString() =>\n        string.IsNullOrEmpty(name)\n            ? name == \"x\"\n                ? throw new NotImplementedException()\n                : \"y\"\n            : throw new ArgumentException(\"...\"); // Noncompliant\n}\n\nclass CompliantArrowMethods : IDisposable\n{\n    static CompliantArrowMethods() => throw new NotImplementedException();\n    public void Dispose() => throw new NotImplementedException();\n    public static bool operator ==(CompliantArrowMethods a, CompliantArrowMethods b) => throw new NotImplementedException();\n    public static bool operator !=(CompliantArrowMethods a, CompliantArrowMethods b) => throw new NotImplementedException();\n    event EventHandler OnSomething\n    {\n        add => throw new InvalidOperationException();\n        remove => throw new ArgumentException();\n    }\n\n    static void Foo() => throw new Exception();\n\n    private string name;\n    public override string ToString() =>\n        string.IsNullOrEmpty(name)\n            ? name == \"x\"\n                ? throw new NotImplementedException()\n                : \"y\"\n            : throw new NotImplementedException(\"...\");\n}\n\nclass MultipleExceptions\n{\n    public override string ToString()\n    {\n        if (Foo())\n        {\n            if (Foo())\n            {\n                throw new Exception(); // Noncompliant\n            }\n            throw new Exception(); // FN only the first is reported\n        }\n        else\n        {\n            throw new Exception(); // FN only the first is reported\n        }\n    }\n    bool Foo() => true;\n}\n\nclass CodeCoverage : IDisposable\n{\n    static CodeCoverage() => throw new UnknownException(); // Error [CS0246]\n    public void Dispose()\n    {\n        throw new UnknownException(); // Error [CS0246]\n    }\n    public override bool Equals(object obj)\n    {\n        Dispose();\n        return true;\n    }\n    public override int GetHashCode() => 0;\n}\n\npublic struct S\n{\n    static S()\n    {\n        throw new Exception(); // Noncompliant\n    }\n}\n\nclass Equatable : IEquatable<S>\n{\n    public bool Equals(S other) => throw new Exception();   // Noncompliant\n    public bool Equals(string s) => throw new Exception();  // Compliant\n}\n\nnamespace Extensions\n{\n    class Sample { }\n\n    static class Extensions\n    {\n        public static bool Equals(this Sample x, object obj) => throw new Exception();  // Compliant\n        public static int GetHashCode(this Sample x) => throw new Exception();          // Compliant\n        public static string ToString(this Sample x) { throw new Exception(); }         // Compliant\n        public static void Dispose(this Sample x) { throw new Exception(); }            // Compliant\n    }\n}\n\nclass Sample : ICustom<Sample>\n{\n    public bool Equals(Sample s) => throw new Exception(); // Compliant\n}\ninterface ICustom<T>\n{\n    bool Equals(T t);\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ExceptionsNeedStandardConstructors.cs",
    "content": "﻿using System;\nusing System.Runtime.Serialization;\n\nnamespace MyLibrary\n{\n    public class MyException : Exception // Noncompliant {{Implement the missing constructors for this exception.}}\n//               ^^^^^^^^^^^\n    {\n        public MyException()\n        {\n        }\n    }\n\n    public class My_01_Exception : Exception // Noncompliant\n    {\n        My_01_Exception() {}\n\n        My_01_Exception(string message) { }\n\n        My_01_Exception(string message, Exception innerException) {}\n\n        My_01_Exception(SerializationInfo info, StreamingContext context) {}\n    }\n\n    public class My_02_Exception : Exception // Compliant\n    {\n        public My_02_Exception() { }\n\n        public My_02_Exception(string message) { }\n\n        public My_02_Exception(string message, Exception innerException) { }\n\n        public My_02_Exception(SerializationInfo info, StreamingContext context) { } // optional serialization constructor (should be protected)\n    }\n\n    public class My_03_Exception : Exception // Compliant\n    {\n        public My_03_Exception() { }\n\n        public My_03_Exception(string message) { }\n\n        public My_03_Exception(string message, Exception innerException) { }\n\n        private My_03_Exception(SerializationInfo info, StreamingContext context) { }  // optional serialization constructor (should be protected)\n    }\n\n    public sealed class My_04_Exception : Exception // Compliant\n    {\n        public My_04_Exception() { }\n\n        public My_04_Exception(string message) { }\n\n        public My_04_Exception(string message, Exception innerException) { }\n\n        protected My_04_Exception(SerializationInfo info, StreamingContext context) { }  // optional serialization constructor (should be private)\n    }\n\n    public sealed class My_05_Exception : Exception\n    {\n        public My_05_Exception() { }\n\n        public My_05_Exception(string message) { }\n\n        public My_05_Exception(string message, Exception innerException) { }\n\n        private My_05_Exception(SerializationInfo info, StreamingContext context) { }\n    }\n\n    public sealed class My_06_Exception : Exception // Compliant\n    {\n        public My_06_Exception() { }\n\n        public My_06_Exception(string message) { }\n\n        public My_06_Exception(string message, Exception innerException) { }\n\n        public My_06_Exception(SerializationInfo info, StreamingContext context) { } // optional serialization constructor (should be protected)\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ExceptionsShouldBeLogged.cs",
    "content": "﻿using System;\nusing Microsoft.Extensions.Logging;\nusing Microsoft.Extensions.Logging.Abstractions;\n\n// Logging methods from: https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loggerextensions?view=dotnet-plat-ext-8.0\npublic class TestCases\n{\n    private readonly ILogger logger = new Logger<TestCases>(new NullLoggerFactory());\n\n    public void MultipleLogsInTheSameCatch()\n    {\n        try { }\n        catch (Exception e)\n        {\n            logger.LogWarning(new EventId(1), e, \"Message!\");\n            logger.LogWarning(new EventId(1), e, \"Message!\");\n        }\n\n        try { }\n        catch (DivideByZeroException e)\n        {\n            logger.LogWarning(new EventId(1), e, \"Message!\");\n            logger.LogInformation(new EventId(1), \"Message!\");      // Compliant - the exception has been loged already\n        }\n        catch (Exception e)\n        {\n            logger.LogWarning(new EventId(1), e, \"Message!\");\n            if (true)\n            {\n                logger.LogInformation(new EventId(1), \"Message!\");  // Compliant - the exception has been loged already\n            }\n        }\n\n        try { }\n        catch (Exception e)\n        {\n            logger.LogWarning(new EventId(1), \"Message!\");          // Noncompliant {{Logging in a catch clause should pass the caught exception as a parameter.}}\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            logger.LogWarning(new EventId(1), \"Message!\");\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary {{Logging in a catch clause should pass the caught exception as a parameter.}}\n        }\n    }\n\n    public void NoLogsInCatch()\n    {\n        try { }\n        catch (Exception e)\n        {\n        }\n    }\n\n    public void CallingMethodToLog()\n    {\n        try { }\n        catch (Exception e)\n        {\n            Log();\n        }\n    }\n\n    private void Log()\n    {\n        logger.LogCritical(\"Message!\"); // Compliant - we do not check this\n    }\n\n    public void LogFromLambda()\n    {\n        try { }\n        catch (AggregateException e)\n        {\n            Call(() => logger.LogCritical(\"Message!\"));             // FN - to avoid noise\n        }\n        catch (Exception e)\n        {\n            Call(() => logger.LogCritical(e, \"Message!\"));\n        }\n\n        try { }\n        catch (Exception e)\n        {\n            Action<string> LogCritical = (string message) => { };\n            LogCritical(\"Message\");                                 // Compliant\n        }\n    }\n\n    private void Call(Action action)\n    {\n        action();\n    }\n\n    private void LogFromMultipleCatchBlocks()\n    {\n        try { }\n        catch (DivideByZeroException)\n        {\n            LoggerExtensions.LogCritical(logger, \"Message!\"); // Noncompliant\n        }\n        catch (AggregateException)\n        {\n            LoggerExtensions.LogCritical(logger, \"Message!\"); // Noncompliant\n        }\n        catch (ApplicationException e)\n        {\n            LoggerExtensions.LogCritical(logger, e, \"Message!\");\n        }\n    }\n\n    private void LogFromNestedCatchBlocks(Exception wrongException)\n    {\n        try { }\n        catch (Exception e)\n        {\n            logger.LogWarning(\"Message!\");                      // Noncompliant\n            logger.LogWarning(wrongException, \"Message!\");\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary\n            try { }\n            catch (DivideByZeroException)\n            {\n                logger.LogCritical(\"Message!\");                 // Noncompliant\n            }\n            catch (AggregateException e1)\n            {\n                logger.LogCritical(e, \"Message!\");              // Noncompliant - wrong exception\n            }\n            catch (ArgumentException e2)\n            {\n                logger.LogCritical(wrongException, \"Message!\"); // Compliant - caught exception is logged in the next line\n                logger.LogCritical(e2, \"Message!\");\n            }\n            catch (Exception e3)\n            {\n                logger.LogCritical(e3, \"Message!\");\n            }\n        }\n    }\n\n    private void ReAssignment()\n    {\n        try { }\n        catch (Exception e)\n        {\n            var other = e;\n            logger.LogWarning(other, \"Message!\");     // Noncompliant - FP\n        }\n    }\n\n    private void Filtering()\n    {\n        try { }\n        catch (Exception e) when (e is InvalidCastException)\n        {\n            logger.LogWarning(e, \"Message!\");\n        }\n        catch (Exception e) when (e is DivideByZeroException divideByZeroException)\n        {\n            logger.LogWarning(divideByZeroException, \"Message!\");\n        }\n        catch (Exception e) when (e is InvalidOperationException invalidOperationException || e is InvalidTimeZoneException invalidTimeZoneException)\n        {\n            logger.LogWarning(e, \"Message!\");                                           // Compliant - the exception is logged (even if it has other names)\n        }\n\n        try { }\n        catch (Exception e) when (e is InvalidCastException)\n        {\n            logger.LogWarning(\"Message!\");                                              // Noncompliant\n        }\n        catch (Exception e) when (e is DivideByZeroException divideByZeroException)\n        {\n            logger.LogWarning(divideByZeroException, \"Message!\");                       // Compliant\n        }\n    }\n\n    public void LogFromCatchBlockWithNoException()\n    {\n        try { }\n        catch\n        {\n            logger.LogCritical(\"Message!\");           // Noncompliant\n        }\n    }\n\n    public void LogFromIfStatement()\n    {\n        try { }\n        catch (DivideByZeroException e)\n        {\n            if (true)\n            {\n                logger.LogCritical(\"Message!\");       // Noncompliant\n            }\n        }\n        catch (Exception e)\n        {\n            if (true)\n            {\n                logger.LogCritical(e, \"Message!\");\n            }\n        }\n    }\n\n    public void LogFromSwitchStatement(bool condition)\n    {\n        try { }\n        catch (DivideByZeroException e)\n        {\n            switch (condition)\n            {\n                case true:\n                    logger.LogCritical(\"Message!\");   // Noncompliant\n                    break;\n            }\n        }\n        catch (Exception e)\n        {\n            switch (condition)\n            {\n                case true:\n                    logger.LogCritical(e, \"Message!\");\n                    break;\n            }\n        }\n    }\n\n    public void LogFromCustomLogger()\n    {\n        try { }\n        catch\n        {\n            new CustomLogger().LogCritical(\"Message!\");\n        }\n    }\n\n    public void LogOutsideCatchStatement()\n    {\n        logger.LogCritical(\"Message!\");\n    }\n\n    public void ILoggerImplementation(NullLogger logger)\n    {\n        try { }\n        catch (Exception e)\n        {\n            logger.LogCritical(\"Message!\");     // Noncompliant\n        }\n        try { }\n        catch (Exception e)\n        {\n            logger.LogCritical(e, \"Message!\");  // Compliant\n        }\n    }\n\n    public void PartialLogging()\n    {\n        try { }\n        catch (Exception e)\n        {\n            logger.LogWarning(new EventId(1), e.StackTrace, \"Message!\");        // Noncompliant\n            logger.LogWarning(new EventId(1), (e.Message != null).ToString());\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary\n        }\n    }\n\n    public void LogInnerException()\n    {\n        try { }\n        catch (Exception e)\n        {\n            logger.LogWarning(new EventId(1), e.InnerException, \"Message!\");                    // Compliant\n            logger.LogWarning(new EventId(1), e?.InnerException, \"Message!\");\n            logger.LogWarning(new EventId(1), e.InnerException.InnerException, \"Message!\");\n            logger.LogWarning(new EventId(1), (Exception)e.InnerException, \"Message!\");\n        }\n    }\n\n    public void LogFromCatchWithoutExceptionType()\n    {\n        try { }\n        catch\n        {\n            logger.LogWarning(\"Message!\");                                          // Noncompliant\n        }\n    }\n\n    public class CustomLogger\n    {\n        public void LogCritical(string message) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ExceptionsShouldBeLoggedOrThrown.cs",
    "content": "﻿using System;\nusing Microsoft.Extensions.Logging;\n\npublic class ExceptionsShouldBeEitherLoggedOrThrown\n{\n    public void Generic(ILogger<ExceptionsShouldBeEitherLoggedOrThrown> logger)\n    {\n        try\n        {\n        }\n        catch (DivideByZeroException divideByZeroException)             // The exception is only logged.\n        {\n            logger.LogError(divideByZeroException, \"Message!\");\n        }\n        catch (OverflowException exception)                             // The exception is only thrown\n        {\n            throw;\n        }\n        catch (FormatException exception)                               // The exception is only thrown\n        {\n            throw exception;\n        }\n        catch (ArithmeticException exception)                           // The exception is not logged\n        {\n            logger.LogError(null, \"Message!\");\n            throw;\n        }\n        catch (RankException exception)                                 // Logging a different exception\n        {\n            logger.LogError(new Exception(\"hello\"), \"Message!\");\n            throw;\n        }\n        catch (AggregateException exception)                            // Logging a different exception\n        {\n            logger.LogError(exception, \"Message!\");\n            throw new Exception();\n        }\n        catch (InvalidOperationException loggedMultipleTimes)           // Noncompliant {{Either log this exception and handle it, or rethrow it with some contextual information.}}\n        {\n            logger.LogError(loggedMultipleTimes, \"Message!\");\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary {{Logging statement.}}\n            logger.LogInformation(loggedMultipleTimes, \"Message!\");\n            throw;\n//          ^^^^^^ Secondary {{Thrown exception.}}\n        }\n        catch (ArgumentException misplaced)                             // Noncompliant\n        {\n            logger.LogError(\"Message!\", misplaced);                     // Secondary\n            throw;                                                      // Secondary\n        }\n        catch (InvalidCastException invalidCastException)               // Noncompliant\n        {\n            logger.LogError(invalidCastException, \"Message!\");          // Secondary\n            throw invalidCastException;                                 // Secondary\n        }\n        catch (Exception ex)                                            // Noncompliant\n        {\n            logger.LogError(ex, \"Message!\");                            // Secondary\n            throw;                                                      // Secondary\n        }\n    }\n\n    public void NonGeneric(ILogger logger)\n    {\n        try {}\n        catch (Exception ex)                                            // Noncompliant\n        {\n            logger.LogError(ex, \"Message!\");                            // Secondary\n            throw;                                                      // Secondary\n        }\n    }\n\n    public void Nested(ILogger logger)\n    {\n        try {}\n        catch (Exception outer)                                         // FN - Only the main catch body is visited\n        {\n            try {}\n            catch (Exception inner)\n            {\n                logger.LogError(outer, \"Message\");\n            }\n\n            try {}\n            catch (Exception inner)                                     // Noncompliant\n            {\n                logger.LogError(inner, \"Message\");                      // Secondary\n                throw;                                                  // Secondary\n            }\n\n            throw;\n        }\n\n        try {}\n        catch (Exception outer)\n        {\n            logger.LogError(outer, \"Message!\");\n            try {}\n            catch (Exception inner)\n            {\n                throw;\n            }\n        }\n\n        try {}\n        catch (Exception outer)                                         // FN - Only the main catch body is visited\n        {\n            logger.LogError(outer, \"Message!\");\n            try {}\n            catch (Exception inner)\n            {\n                throw outer;\n            }\n        }\n\n        try { }\n        catch (Exception outer)                                         // Noncompliant\n        {\n            try { }\n            finally\n            {\n                logger.LogError(outer, \"message\");                      // Secondary\n                throw outer;                                            // Secondary\n            }\n        }\n    }\n\n    public void NoCatch(ILogger logger, Exception exception)\n    {\n        logger.LogError(exception, \"Message!\");                         // Compliant - there is not catch block\n        throw exception;\n    }\n\n    public void Filtering(ILogger logger)\n    {\n        try {}\n        catch (Exception ex) when (ex is DivideByZeroException d)       // Noncompliant\n        {\n            logger.LogError(ex, \"Message!\");                            // Secondary\n            throw;                                                      // Secondary\n        }\n\n        try {}\n        catch (Exception ex) when (ex is DivideByZeroException d)       // FN\n        {\n            logger.LogError(ex, \"Message!\");\n            throw d;\n        }\n    }\n\n    private void With(CustomLogger logger)\n    {\n        try { }\n        catch (Exception exception)                                     // The exception is only logged.\n        {\n            logger.LogError(exception, \"Message!\");\n        }\n    }\n\n    public void LoggingFromAnotherMethod(ILogger logger)\n    {\n        try { }\n        catch (Exception e)                                             // FN\n        {\n            Log(logger, e);\n            throw;\n        }\n    }\n\n    private void Log(ILogger logger, Exception e)\n    {\n        logger.LogCritical(\"Message!\");                                 // Compliant - we do not check this\n        throw e;\n    }\n\n    public void LogFromLambda(ILogger logger)\n    {\n        try { }\n        catch (Exception e)                                             // FN - to avoid noise in other lambda cases\n        {\n            Call(() => logger.LogCritical(e, \"Message!\"));\n            throw;\n        }\n\n        try { }\n        catch (Exception e)\n        {\n            Action<Exception, string> LogCritical = (Exception ex, string message) => { };\n            LogCritical(e, \"Message\");\n            throw;\n        }\n\n        try\n        { }\n        catch (Exception exception)\n        {\n            Action x = () => { throw exception; };\n            logger.LogError(exception, \"Message\");\n        }\n\n        try\n        { }\n        catch (Exception exception)\n        {\n            Action x = () => { logger.LogError(exception, \"Message\"); };\n            throw exception;\n        }\n    }\n\n    private void ReAssignment(ILogger logger)\n    {\n        try { }\n        catch (InvalidOperationException e)                             // FN\n        {\n            var other = e;\n            logger.LogWarning(other, \"Message!\");\n            throw;\n        }\n        catch (Exception e)                                             // FN\n        {\n            var other = e;\n            logger.LogWarning(other, \"Message!\");\n            throw e;\n        }\n    }\n\n    public void LogPartial_Compliant(ILogger logger)\n    {\n        try { }\n        catch (Exception e)\n        {\n            logger.LogWarning(\"Message!\" + e.Message);\n            logger.LogWarning(e.Message);\n            logger.LogWarning(e?.InnerException, \"Message!\");\n            logger.LogWarning(e.InnerException.InnerException, \"Message!\");\n            logger.LogWarning((Exception)e.InnerException, \"Message!\");\n\n            throw;\n        }\n    }\n    public void LogPartial_Notcompliant(ILogger logger)\n    {\n        try { }\n        catch (InvalidCastException e)                                  // Noncompliant\n        {\n            logger.LogWarning(e.InnerException, \"Message!\");            // Secondary\n            throw;                                                      // Secondary\n        }\n    }\n\n    public void MultipleThrows(ILogger logger)\n    {\n        try { }\n        catch (InvalidCastException e)                                  // Noncompliant\n        {\n            logger.LogWarning(e.InnerException, \"Message!\");            // Secondary\n            throw new Exception();\n            throw;                                                      // Secondary\n        }\n\n        try { }\n        catch (InvalidCastException e)                                  // Noncompliant\n        {\n            logger.LogWarning(e.InnerException, \"Message!\");            // Secondary\n            throw new Exception();\n            throw e;                                                      // Secondary\n        }\n\n        try { }\n        catch (InvalidCastException e)                                  // Noncompliant\n        {\n            logger.LogWarning(e.InnerException, \"Message!\");            // Secondary\n            throw;                                                      // Secondary\n            throw new Exception();\n        }\n    }\n\n    public void LogFromCatchWithoutException(ILogger logger)\n    {\n        try { }\n        catch\n        {\n            logger.LogWarning(\"Message! Stack trace: {StackTrace}\", new System.Diagnostics.StackTrace());\n            throw;\n        }\n    }\n\n    public void Branches(ILogger logger, bool condition, object x)\n    {\n        try { }\n        catch (InvalidOperationException e)                     // FN\n        {\n            if (condition)\n            {\n                logger.LogError(e, \"Message!\");\n                throw;\n            }\n        }\n        catch (ArgumentException e)                             // Compliant - conditional\n        {\n            logger.LogError(e, \"Message!\");\n            if (condition)\n            {\n                throw;\n            }\n        }\n        catch (AggregateException e)                            // Compliant - conditional\n        {\n            if (condition)\n            {\n                logger.LogError(e, \"Message!\");\n            }\n            throw;\n        }\n        catch (ApplicationException e)                          // Compliant - conditional\n        {\n            if (condition)\n            {\n                logger.LogError(e, \"Message!\");\n            }\n            else\n            {\n                throw;\n            }\n        }\n        catch (FormatException e)                               // Noncompliant\n        {\n            if (condition)\n            {\n            }\n            logger.LogError(e, \"Message!\");                     // Secondary\n            throw;                                              // Secondary\n        }\n        catch (OverflowException e)                             // Compliant - conditional\n        {\n            switch (condition)\n            {\n                case true:\n                    logger.LogError(e, \"Message!\");\n                    break;\n                case false:\n                    throw;\n            }\n        }\n        catch (Exception e)\n        {\n            logger.LogError(e, \"Message!\");\n            x = condition ? 42 : throw e;\n        }\n    }\n\n    private void Call(Action action)\n    {\n        action();\n    }\n\n    private class CustomLogger : ILogger\n    {\n        public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter) { }\n\n        public bool IsEnabled(LogLevel logLevel) => true;\n\n        public IDisposable BeginScope<TState>(TState state) => null;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ExceptionsShouldBePublic.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\npublic class PublicException : Exception // Compliant\n{\n}\n\ninternal class InternalException : Exception\n//             ^^^^^^^^^^^^^^^^^ Noncompliant {{Make this exception 'public'.}}\n{\n}\n\nclass InternalException2 : Exception\n//    ^^^^^^^^^^^^^^^^^^ Noncompliant {{Make this exception 'public'.}}\n{\n}\n\npublic class PublicContainer // Compliant\n{\n    public class PublicException : Exception // Compliant\n    {\n    }\n\n    private class PrivateClass // Compliant\n    {\n    }\n\n    internal class InternalException : Exception\n//                 ^^^^^^^^^^^^^^^^^ Noncompliant {{Make this exception 'public'.}}\n    {\n    }\n\n    class InternalException2 : Exception\n//        ^^^^^^^^^^^^^^^^^^ Noncompliant {{Make this exception 'public'.}}\n    {\n    }\n\n    protected class ProtectedException : OutOfMemoryException // Compliant\n    {\n    }\n\n    private class PrivateException2 : Exception\n//                ^^^^^^^^^^^^^^^^^ Noncompliant {{Make this exception 'public'.}}\n    {\n    }\n}\n\ninternal class InternalContainer // Compliant\n{\n    public class PublicException : Exception\n//               ^^^^^^^^^^^^^^^ Noncompliant {{Make this exception 'public'.}}\n    {\n    }\n\n    private class PrivateClass // Compliant\n    {\n    }\n\n    protected class ProtectedClass // Compliant\n    {\n    }\n\n    internal class InternalException : OutOfMemoryException // Compliant\n    {\n    }\n\n    protected class ProtectedException : OutOfMemoryException // Compliant\n    {\n    }\n\n    class InternalException2 : ApplicationException\n//        ^^^^^^^^^^^^^^^^^^ Noncompliant {{Make this exception 'public'.}}\n    {\n    }\n\n    private class PrivateException2 : Exception\n//                ^^^^^^^^^^^^^^^^^ Noncompliant {{Make this exception 'public'.}}\n    {\n    }\n}\n\ninternal class LastException : MiddleException { }\npublic class MiddleException : FirstException { }\npublic class FirstException : Exception { }\n\nnamespace ShouldNotThrow\n{\n    public class /* Missing identifier */ : Exception { } // Error [CS1001]\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ExceptionsShouldBePublic.vb",
    "content": "﻿Imports System.Collections.Generic\n\nPublic Class PublicException ' Compliant\n    Inherits Exception\nEnd Class\n\nFriend Class InternalException\n    '        ^^^^^^^^^^^^^^^^^ Noncompliant {{Make this exception 'Public'.}}\n    Inherits Exception\nEnd Class\n\nClass ImplicitAccessibilityException\n    ' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant {{Make this exception 'Public'.}}\n    Inherits Exception\n\nEnd Class\n\nPublic Class PublicContainer\n    Public Class PublicException ' Compliant\n        Inherits Exception\n    End Class\n\n    Private Class PrivateClass ' Compliant, no exception\n    End Class\n\n    Friend Class InternalException ' Noncompliant\n        Inherits Exception\n    End Class\n\n    Class ImplicitAccessibilityException ' Compliant\n        Inherits Exception\n    End Class\n\n    Protected Class InheritsFromOtherException ' Compliant\n        Inherits DivideByZeroException\n    End Class\n\n    Private Class PrivateException ' Noncompliant\n        Inherits Exception\n    End Class\nEnd Class\n\nFriend Class InternalContainer\n    Public Class PublicException\n        '        ^^^^^^^^^^^^^^^ Noncompliant {{Make this exception 'Public'.}}\n        Inherits Exception\n    End Class\n\n    Private Class PrivateClassn ' Compliant\n    End Class\n\n    Protected Class ProtectedClass ' Compliant\n    End Class\n\n    Friend Class InternalException\n        Inherits DivideByZeroException ' Compliant\n    End Class\n\n    Protected Class ProtectedException ' Compliant\n        Inherits DivideByZeroException\n    End Class\n\n    Class ImplicitAccessibilityException ' Noncompliant\n        Inherits ApplicationException\n    End Class\n\n    Private Class PrivateException ' Noncompliant\n        Inherits Exception\n    End Class\nEnd Class\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ExceptionsShouldBeUsed.cs",
    "content": "﻿using System;\nusing System.Linq;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public class CustomEx : Exception\n    {\n    }\n\n    class ExceptionsShouldBeUsed\n    {\n        void NotCompliant()\n        {\n            new Exception(); // Noncompliant {{Throw this exception or remove this useless statement.}}\n            new CustomEx(); // Noncompliant\n            new ArgumentOutOfRangeException(); // Noncompliant\n        }\n\n        Exception Compliant()\n        {\n            var a = new Exception();\n            var b = a = new Exception();\n            field = new Exception();\n            Property = new Exception();\n            Foo(new Exception());\n            if (new Exception() != null) { }\n            return new Exception();\n            throw new Exception();\n            new ExceptionsShouldBeUsed(); // for coverage\n        }\n\n        void Foo(Exception ex) { }\n\n        Exception CompliantArrow() => new Exception();\n\n        Exception CompliantPropertyArrow => new Exception();\n\n        void CompliantOut(out Exception e)\n        {\n            e = new Exception();\n            Func<Exception> f = () => new Exception();\n            var array = new[] { new Exception() };\n        }\n\n        IEnumerable<Exception> CompliantYield()\n        {\n            yield return new Exception();\n        }\n\n        Exception field;\n        Exception Property { get; set; }\n        void Method(Exception e) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ExcludeFromCodeCoverageAttributesNeedJustification.CSharp10.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Linq;\n\nclass NonCompliant\n{\n    public void Method(IEnumerable<int> collection)\n    {\n        [ExcludeFromCodeCoverage] int Get() => 1; // Noncompliant\n\n        _ = collection.Select([ExcludeFromCodeCoverage] (x) => x + 1); // Noncompliant\n\n        Action a = [ExcludeFromCodeCoverage] () => { }; // Noncompliant\n\n        Action x = true\n            ? ([ExcludeFromCodeCoverage] () => { }) // Noncompliant\n            : [ExcludeFromCodeCoverage] () => { }; // Noncompliant\n\n        Call([ExcludeFromCodeCoverage(Justification = \"justification\")] (x) => { });\n    }\n\n    private void Call(Action<int> action) => action(1);\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ExcludeFromCodeCoverageAttributesNeedJustification.CSharp9.cs",
    "content": "﻿using System.Diagnostics.CodeAnalysis;\nusing System;\n\n[ExcludeFromCodeCoverage] // Noncompliant\nvoid LocalMethod() { }\n\n[ExcludeFromCodeCoverage] // Noncompliant\nstatic void StaticLocalMethod() { }\n\n[ExcludeFromCodeCoverage] // Noncompliant {{Add a justification.}}\npublic record Record\n{\n    public void Method()\n    {\n        [ExcludeFromCodeCoverage] // Noncompliant\n        static void LocalMethod() { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ExcludeFromCodeCoverageAttributesNeedJustification.cs",
    "content": "﻿using System;\nusing System.Diagnostics.CodeAnalysis;\nusing Alias = System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute;\n\n[ExcludeFromCodeCoverage] // Noncompliant ^2#23 {{Add a justification.}}\nclass Noncompliant\n{\n    [ExcludeFromCodeCoverage()] // Noncompliant\n    void WithBrackets() { }\n\n    [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] // Noncompliant\n    void FullyDeclaredNamespace() { }\n\n    [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] // Noncompliant\n    void GloballyDeclaredNamespace() { }\n\n    [ExcludeFromCodeCoverage(Justification = null)] // Noncompliant\n    void WithNull() { }\n\n    [ExcludeFromCodeCoverage(Justification = \"\")] // Noncompliant\n    void WithEmptyString() { }\n\n    [ExcludeFromCodeCoverage(Justification = \"  \")] // Noncompliant\n    void WithWhiteSpace() { }\n\n    [Alias(Justification = \"\")] // Noncompliant\n    void WithAlias() { }\n\n    [ExcludeFromCodeCoverage] // Noncompliant\n    [CLSCompliant(false)]\n    uint Multiple() { return 0; }\n\n    [ExcludeFromCodeCoverage, CLSCompliant(false)]\n//   ^^^^^^^^^^^^^^^^^^^^^^^\n    uint Combined() { return 0; }\n\n    [ExcludeFromCodeCoverage] // Noncompliant\n    Noncompliant() { }\n\n    [ExcludeFromCodeCoverage] // Noncompliant\n    void Method() { }\n\n    [ExcludeFromCodeCoverage] // Noncompliant\n    event EventHandler Event;\n}\n\ninterface IInterface\n{\n    [ExcludeFromCodeCoverage] // Noncompliant\n    void Method();\n}\n\n[ExcludeFromCodeCoverage] // Noncompliant\nstruct ProgramStruct\n{\n    [ExcludeFromCodeCoverage] // Noncompliant\n    void Method() { }\n}\n\n[ExcludeFromCodeCoverage(Justification = \"justification\")]\nclass Compliant\n{\n    [ExcludeFromCodeCoverage(Justification = \"justification\")]\n    Compliant() { }\n\n    [ExcludeFromCodeCoverage(Justification = \"justification\")]\n    void Method() { }\n\n    [ExcludeFromCodeCoverage(Justification = \"justification\")]\n    string Property { get; set; }\n\n    [ExcludeFromCodeCoverage(Justification = \"justification\")]\n    event EventHandler Event;\n}\n\ninterface IComplaintInterface\n{\n    [ExcludeFromCodeCoverage(Justification = \"justification\")]\n    void Method();\n}\n\n[ExcludeFromCodeCoverage(Justification = \"justification\")]\nstruct ComplaintStruct\n{\n    [ExcludeFromCodeCoverage(Justification = \"justification\")]\n    void Method() { }\n}\n\nclass NotApplicable\n{\n    [CLSCompliant(false)]\n    enum Enum { foo, bar }\n\n    NotApplicable() { }\n\n    void Method() { }\n\n    int Property { get; set; }\n\n    int Field;\n\n    event EventHandler Event;\n\n    delegate void Delegate();\n\n    [OtherNamespace.ExcludeFromCodeCoverage]\n    void SameName() { }\n}\n\nnamespace OtherNamespace\n{\n    public class ExcludeFromCodeCoverageAttribute : Attribute { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ExcludeFromCodeCoverageAttributesNeedJustification.net48.cs",
    "content": "﻿using System;\nusing System.Diagnostics.CodeAnalysis;\n\n[ExcludeFromCodeCoverage]\nclass Ignores\n{\n    [ExcludeFromCodeCoverage(Justification = \"not existing\")] // Error[CS0246]\n    void JustifcationDoesNotExist() { }\n\n    [ExcludeFromCodeCoverage()] // Compliant: \"Justification\" property was added in .Net 5\n    void WithBrackets() { }\n\n    [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]\n    void FullyDeclaredNamespace() { }\n\n    [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]\n    void GloballyDeclaredNamespace() { }\n\n    [ExcludeFromCodeCoverage]\n    [CLSCompliant(false)]\n    uint Multiple() { return 0; }\n\n    [ExcludeFromCodeCoverage, CLSCompliant(false)]\n    uint Combined() { return 0; }\n\n    [ExcludeFromCodeCoverage]\n    Ignores() { }\n\n    [ExcludeFromCodeCoverage]\n    void Method() { }\n\n    [ExcludeFromCodeCoverage]\n    event EventHandler Event;\n}\n\ninterface IInterface\n{\n    [ExcludeFromCodeCoverage]\n    void Method();\n}\n\n[ExcludeFromCodeCoverage]\nstruct ProgramStruct\n{\n    [ExcludeFromCodeCoverage]\n    void Method() { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ExcludeFromCodeCoverageAttributesNeedJustification.vb",
    "content": "﻿' Commented line for concurrent namespace\nImports System.Diagnostics.CodeAnalysis\nImports [Alias] = System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute\n\n' Noncompliant@+1 ^2#23 {{Add a justification.}}\n<ExcludeFromCodeCoverage>\nClass Noncompliant\n    <ExcludeFromCodeCoverage()> Sub WithBrackets() ' Noncompliant^6#25\n    End Sub\n\n    ' Noncompliant@+1\n    <System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage>\n    Sub FullyDeclaredNamespace()\n    End Sub\n\n    ' Noncompliant@+1\n    <Global.System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage>\n    Sub GloballyDeclaredNamespace()\n    End Sub\n\n    ' Noncompliant@+1\n    <[Alias](Justification:=\"\")>\n    Sub WithAlias()\n    End Sub\n\n    ' Noncompliant@+1\n    <ExcludeFromCodeCoverage(Justification:=Nothing)>\n    Sub WithNothing()\n    End Sub\n\n    ' Noncompliant@+1\n    <ExcludeFromCodeCoverage(Justification:=\"\")>\n    Sub WithEmptyString()\n    End Sub\n\n    ' Noncompliant@+1\n    <ExcludeFromCodeCoverage(Justification:=\"  \")>\n    Sub WithWhiteSpace()\n    End Sub\n\n    ' Noncompliant@+1\n    <ExcludeFromCodeCoverage>\n    <CLSCompliant(False)>\n    Function Multiple() As UInteger\n        Return 0\n    End Function\n\n    ' Noncompliant@+1\n    <ExcludeFromCodeCoverage, CLSCompliant(False)> Function Combined() As UInteger\n        Return 0\n    End Function\n\n    ' Noncompliant@+1\n    <ExcludeFromCodeCoverage>\n    Sub New()\n    End Sub\n\n    ' Noncompliant@+1\n    <ExcludeFromCodeCoverage>\n    Sub Method()\n    End Sub\n\n    ' Noncompliant@+1\n    <ExcludeFromCodeCoverage>\n    Property [Property] As Integer\n\n    ' Noncompliant@+1\n    <ExcludeFromCodeCoverage>\n    Event [Event] As EventHandler\n\nEnd Class\n\nInterface IInterface\n    ' Noncompliant@+1\n    <ExcludeFromCodeCoverage>\n    Sub Method()\nEnd Interface\n\n' Noncompliant@+1\n<ExcludeFromCodeCoverage>\nStructure ProgramStruct\n    ' Noncompliant@+1\n    <ExcludeFromCodeCoverage>\n    Sub Method()\n    End Sub\nEnd Structure\n\n<ExcludeFromCodeCoverage(Justification:=\"justification\")>\nClass Compliant\n\n    <ExcludeFromCodeCoverage(Justification:=\"justification\")>\n    Sub New()\n    End Sub\n\n    <ExcludeFromCodeCoverage(Justification:=\"justification\")>\n    Sub Method()\n    End Sub\n\n    <ExcludeFromCodeCoverage(Justification:=\"justification\")>\n    Property [Property] As String\n\n    <ExcludeFromCodeCoverage(Justification:=\"justification\")>\n    Event [Event] As EventHandler\nEnd Class\n\nInterface IComplaintInterface\n    <ExcludeFromCodeCoverage(Justification:=\"justification\")>\n    Sub Method()\nEnd Interface\n\n<ExcludeFromCodeCoverage(Justification:=\"justification\")>\nStructure ComplaintStruct\n    <ExcludeFromCodeCoverage(Justification:=\"justification\")>\n    Sub Method()\n    End Sub\nEnd Structure\n\nClass NotApplicable\n\n    Sub New()\n    End Sub\n\n    Sub Method()\n    End Sub\n\n    Property [Property] As Integer\n\n    Event [Event] As EventHandler\n\n    <NotSystem.ExcludeFromCodeCoverageAttribute>\n    Sub SameName()\n    End Sub\nEnd Class\n\nNamespace NotSystem\n    Public Class ExcludeFromCodeCoverageAttribute\n        Inherits Attribute\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ExitStatementUsage.vb",
    "content": "﻿Imports System\nImports System.Diagnostics\n\nClass MyClass1\n    Public Sub MySub(condition As Boolean)\n        If condition Then\n            Exit Sub                  ' Noncompliant {{Remove this 'Exit' statement.}}\n'           ^^^^^^^^\n        End If\n        If condition Then\n            Return\n        End If\n\n        Dim number As Integer = 2\n        Select Case number\n            Case 1 To 5\n                Exit Select           ' Compliant, not in scope of this rule\n                Debug.WriteLine(\"Between 1 and 5, inclusive\")\n        End Select\n\n        For index = 1 To 10\n            If index = 5 Then\n                Exit For            ' Compliant, not in scope of this rule. S1227 about \"break;\" was deprecated\n            End If\n\n            Do\n                Do While True\n                    Exit Do         ' Compliant, not in scope of this rule. S1227 about \"break;\" was deprecated\n                Loop\n\n                Exit Do             ' Compliant, not in scope of this rule. S1227 about \"break;\" was deprecated\n            Loop\n            ' ...\n        Next\n    End Sub\n\n    Function MyFunction() As Object\n        ' ...\n        MyFunction = 42\n        Exit Function              ' Noncompliant\n    End Function\n\n    Private newPropertyValue As String\n    Public Property NewProperty() As String\n        Get\n            Exit Property          ' Noncompliant\n            Return newPropertyValue\n        End Get\n        Set(ByVal value As String)\n            Try\n                Exit Try           ' Compliant, not in scope of this rule. S1227 about \"break;\" was deprecated\n            Catch ex As Exception\n\n            End Try\n            newPropertyValue = value\n        End Set\n    End Property\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ExpectedExceptionAttributeShouldNotBeUsed.MsTest.cs",
    "content": "﻿using System;\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        [TestMethod]\n        [ExpectedException(typeof(ArgumentNullException))]  // Noncompliant\n        public void TestFoo1()\n        {\n            var x = true;\n            x.ToString();\n        }\n\n        [TestMethod]\n        [ExpectedExceptionAttribute(typeof(ArgumentNullException))]  // Noncompliant\n        public void WithAttributeSuffix()\n        {\n            var x = true;\n            x.ToString();\n        }\n\n        [TestMethod]\n        [Microsoft.VisualStudio.TestTools.UnitTesting.ExpectedException(typeof(ArgumentNullException))]  // Noncompliant\n        public void FullyQualifiedAttribute()\n        {\n            var x = true;\n            x.ToString();\n        }\n\n        [TestMethod]\n        [Unrelated.ExpectedException(typeof(ArgumentNullException))]  // Noncompliant - FP\n        public void UnrelatedAttribute()\n        {\n            var x = true;\n            x.ToString();\n        }\n\n        [TestMethod]\n        [ExpectedException(typeof(ArgumentNullException))] // Compliant - one line\n        public void TestFoo3()\n        {\n            new object().ToString();\n        }\n\n        [TestMethod]\n        [ExpectedException(typeof(ArgumentNullException))] // FN\n        public void TestMultilineFalseNegative()\n        {\n            {\n                new object().ToString();\n                new object().ToString();\n                new object().ToString();\n            }\n        }\n\n        [TestMethod]\n        [ExpectedException(typeof(ArgumentNullException))]  // Compliant - one line\n        public string TestFoo5() => new object().ToString();\n\n        [TestMethod]\n        public void TestFoo7()\n        {\n            bool callFailed = false;\n            try\n            {\n                //...\n            }\n            catch (ArgumentNullException)\n            {\n                callFailed = true;\n            }\n        }\n\n        [TestMethod]\n        public void TestWithThrowsAssertation()\n        {\n            object o = new object();\n            Assert.ThrowsException<ArgumentNullException>(() => o.ToString());\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/8300\n    class Repro_8300\n    {\n        [TestMethod]\n        [ExpectedException(typeof(InvalidOperationException))] // Compliant - using ExpectedException makes the test more readable\n        public void AssertInFinally()\n        {\n            Console.ForegroundColor = ConsoleColor.Red;\n            try\n            {\n                throw new InvalidOperationException();\n            }\n            finally\n            {\n                Assert.AreEqual(ConsoleColor.Black, Console.ForegroundColor);\n            }\n        }\n\n        [TestMethod]\n        [ExpectedException(typeof(InvalidOperationException))] // Noncompliant\n        public void NoAssertInFinally()\n        {\n            Console.ForegroundColor = ConsoleColor.Red;\n            try\n            {\n                throw new InvalidOperationException();\n            }\n            finally\n            {\n                Console.WriteLine(\"No Assert\");\n            }\n        }\n\n        [TestMethod]\n        [ExpectedException(typeof(InvalidOperationException))] // Noncompliant\n        public void NoAssertInCatch()\n        {\n            Console.ForegroundColor = ConsoleColor.Red;\n            try\n            {\n                throw new InvalidOperationException();\n            }\n            catch (InvalidOperationException e)\n            {\n                Console.ForegroundColor = ConsoleColor.Black;\n            }\n        }\n\n        [TestMethod]\n        [ExpectedException(typeof(InvalidOperationException))] // Compliant\n        public void AssertInCatch()\n        {\n            Console.ForegroundColor = ConsoleColor.Red;\n            try\n            {\n                throw new InvalidOperationException();\n            }\n            catch (InvalidOperationException e)\n            {\n                Assert.AreEqual(ConsoleColor.Black, Console.ForegroundColor);\n            }\n        }\n\n        [TestMethod]\n        [ExpectedException(typeof(InvalidOperationException))] // Compliant\n        public void AssertInAllCatch()\n        {\n            Console.ForegroundColor = ConsoleColor.Red;\n            try\n            {\n                throw new InvalidOperationException();\n            }\n            catch\n            {\n                Assert.AreEqual(ConsoleColor.Black, Console.ForegroundColor);\n            }\n        }\n\n        [TestMethod]\n        [ExpectedException(typeof(InvalidOperationException))] // Compliant\n        public void AssertInAllCatch_InvocationBeforeAssert()\n        {\n            Console.ForegroundColor = ConsoleColor.Red;\n            try\n            {\n                throw new InvalidOperationException();\n            }\n            catch\n            {\n                Console.WriteLine(\"An invocation before Assert\");\n                Assert.AreEqual(ConsoleColor.Black, Console.ForegroundColor);\n            }\n        }\n\n        [TestMethod]\n        [ExpectedException(typeof(InvalidOperationException))] // Compliant\n        public void AssertInAllCatch_InvocationAfterAssert()\n        {\n            Console.ForegroundColor = ConsoleColor.Red;\n            try\n            {\n                throw new InvalidOperationException();\n            }\n            catch\n            {\n                Assert.AreEqual(ConsoleColor.Black, Console.ForegroundColor);\n                Console.WriteLine(\"An invocation after Assert\");\n            }\n        }\n\n        [TestMethod]\n        [ExpectedException(typeof(InvalidOperationException))] // Compliant\n        public void AssertInFinallyWithCatch()\n        {\n            Console.ForegroundColor = ConsoleColor.Red;\n            try\n            {\n                throw new InvalidOperationException();\n            }\n            catch (InvalidOperationException e)\n            {\n                Console.WriteLine(Console.ForegroundColor);\n            }\n            finally\n            {\n                Assert.AreEqual(ConsoleColor.Black, Console.ForegroundColor);\n            }\n        }\n\n        [TestMethod]\n        [ExpectedException(typeof(InvalidOperationException))] // Compliant\n        public void AssertInCatchWithFinally()\n        {\n            Console.ForegroundColor = ConsoleColor.Red;\n            try\n            {\n                throw new InvalidOperationException();\n            }\n            catch (InvalidOperationException e)\n            {\n                Assert.AreEqual(ConsoleColor.Black, Console.ForegroundColor);\n            }\n            finally\n            {\n                Console.WriteLine(Console.ForegroundColor);\n            }\n        }\n    }\n}\n\nnamespace Unrelated\n{\n    [AttributeUsage(AttributeTargets.Method)]\n    public class ExpectedExceptionAttribute : Attribute\n    {\n        public Type ExceptionType { get; private set; }\n\n        public ExpectedExceptionAttribute(Type exceptionType)\n        {\n            ExceptionType = exceptionType;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ExpectedExceptionAttributeShouldNotBeUsed.MsTest.vb",
    "content": "﻿Imports System\nImports Microsoft.VisualStudio.TestTools.UnitTesting\n\nPublic Class ExceptionTests\n\n    ' Noncompliant@+2\n    <TestMethod>\n    <ExpectedException(GetType(DivideByZeroException))>\n    Public Sub ExpectedExceptionAttrbutesShouldNotBeUsedOnSub()\n        Dim instance As Integer = 42\n        instance.ToString()\n    End Sub\n\n    <TestMethod>\n    <ExpectedExceptionAttribute(GetType(ArgumentNullException))>  ' Noncompliant\n    Public Sub WithAttributeSuffix()\n        Dim x As Boolean = True\n        x.ToString()\n    End Sub\n\n    <TestMethod>\n    <Microsoft.VisualStudio.TestTools.UnitTesting.ExpectedException(GetType(ArgumentNullException))>  ' Noncompliant\n    Public Sub FullyQualifiedAttribute()\n        Dim x As Boolean = True\n        x.ToString()\n    End Sub\n\n    <TestMethod>\n    <Unrelated.ExpectedException(GetType(ArgumentNullException))>  ' Noncompliant - FPgit\n    Public Sub UnrelatedAttribute()\n        Dim x As Boolean = True\n        x.ToString()\n    End Sub\n\n    ' Noncompliant@+2\n    <TestMethod>\n    <ExpectedException(GetType(DivideByZeroException))>\n    Public Function ExpectedExceptionAttrbutesShouldNotBeUsedOnFunction() As String\n        Dim instance As Integer = 42\n        Return instance.ToString()\n    End Function\n\n    ' Compliant - one line\n    <TestMethod>\n    <ExpectedException(GetType(DivideByZeroException))>\n    Public Sub ExpectedExceptionAttrbuteAllowedForSingleLineSub()\n        Throw New NotImplementedException()\n    End Sub\n\n    ' Compliant - one line\n    <TestMethod>\n    <ExpectedException(GetType(DivideByZeroException))>\n    Public Function ExpectedExceptionAttrbuteAllowedForSingleLineFunction() As Integer\n        Return 42\n    End Function\nEnd Class\n\n' https://github.com/SonarSource/sonar-dotnet/issues/8300\nClass Repro_8300\n    <TestMethod>\n    <ExpectedException(GetType(InvalidOperationException))> ' Compliant - using ExpectedException makes the test more readable\n    Public Sub AssertInFinally()\n        Console.ForegroundColor = ConsoleColor.Red\n        Try\n            Throw New InvalidOperationException()\n        Finally\n            Assert.AreEqual(ConsoleColor.Black, Console.ForegroundColor)\n        End Try\n    End Sub\n\n    <TestMethod>\n    <ExpectedException(GetType(InvalidOperationException))> ' Noncompliant\n    Public Sub NoAssertInFinally()\n        Console.ForegroundColor = ConsoleColor.Red\n        Try\n            Throw New InvalidOperationException()\n        Finally\n            Console.WriteLine(\"No Assert\")\n        End Try\n    End Sub\n\n    <TestMethod>\n    <ExpectedException(GetType(InvalidOperationException))> ' Noncompliant\n    Public Sub NoAssertInCatch()\n        Console.ForegroundColor = ConsoleColor.Red\n        Try\n            Throw New InvalidOperationException()\n        Catch e As InvalidOperationException\n            Console.ForegroundColor = ConsoleColor.Black\n        End Try\n    End Sub\n\n    <TestMethod>\n    <ExpectedException(GetType(InvalidOperationException))> ' Compliant\n    Public Sub AssertInCatch()\n        Console.ForegroundColor = ConsoleColor.Red\n        Try\n            Throw New InvalidOperationException()\n        Catch e As InvalidOperationException\n            Assert.AreEqual(ConsoleColor.Black, Console.ForegroundColor)\n        End Try\n    End Sub\n\n    <TestMethod>\n    <ExpectedException(GetType(InvalidOperationException))> ' Compliant\n    Public Sub AssertInAllCatch()\n        Console.ForegroundColor = ConsoleColor.Red\n        Try\n            Throw New InvalidOperationException()\n        Catch\n            Assert.AreEqual(ConsoleColor.Black, Console.ForegroundColor)\n        End Try\n    End Sub\n\n    <TestMethod>\n    <ExpectedException(GetType(InvalidOperationException))> ' Compliant\n    Public Sub AssertInAllCatch_InvocationBeforeAssert()\n        Console.ForegroundColor = ConsoleColor.Red\n        Try\n            Throw New InvalidOperationException()\n        Catch\n            Console.WriteLine(\"An invocation before Assert\")\n            Assert.AreEqual(ConsoleColor.Black, Console.ForegroundColor)\n        End Try\n    End Sub\n\n    <TestMethod>\n    <ExpectedException(GetType(InvalidOperationException))> ' Compliant\n    Public Sub AssertInAllCatch_InvocationAfterAssert()\n        Console.ForegroundColor = ConsoleColor.Red\n        Try\n            Throw New InvalidOperationException()\n        Catch\n            Assert.AreEqual(ConsoleColor.Black, Console.ForegroundColor)\n            Console.WriteLine(\"An invocation after Assert\")\n        End Try\n    End Sub\n\n    <TestMethod>\n    <ExpectedException(GetType(InvalidOperationException))> ' Compliant\n    Public Sub AssertInFinallyWithCatch()\n        Console.ForegroundColor = ConsoleColor.Red\n        Try\n            Throw New InvalidOperationException()\n        Catch e As InvalidOperationException\n            Console.WriteLine(Console.ForegroundColor)\n        Finally\n            Assert.AreEqual(ConsoleColor.Black, Console.ForegroundColor)\n        End Try\n    End Sub\n\n    <TestMethod>\n    <ExpectedException(GetType(InvalidOperationException))> ' Compliant\n    Public Sub AssertInCatchWithFinally()\n        Console.ForegroundColor = ConsoleColor.Red\n        Try\n            Throw New InvalidOperationException()\n        Catch e As InvalidOperationException\n            Assert.AreEqual(ConsoleColor.Black, Console.ForegroundColor)\n        Finally\n            Console.WriteLine(Console.ForegroundColor)\n        End Try\n    End Sub\nEnd Class\n\nNamespace Unrelated\n    <AttributeUsage(AttributeTargets.Method)>\n    Public Class ExpectedExceptionAttribute\n        Inherits Attribute\n\n        Public ReadOnly Property ExceptionType As Type\n\n        Public Sub New(exceptionType As Type)\n            Me.ExceptionType = exceptionType\n        End Sub\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ExpectedExceptionAttributeShouldNotBeUsed.NUnit.cs",
    "content": "﻿using System;\nusing NUnit.Framework;\n\nnamespace Tests.Diagnostics\n{\n    [TestFixture]\n    class Program\n    {\n        [Test]\n        [NUnit.Framework.ExpectedException(typeof(ArgumentNullException))]  // Noncompliant\n        public void TestFoo2()\n        {\n            var x = true;\n            x.ToString();\n        }\n\n        [Test]\n        [NUnit.Framework.ExpectedException(typeof(ArgumentNullException))]  // Compliant - one line\n        public void TestFoo4()\n        {\n            new object().ToString();\n        }\n\n        [Test]\n        [NUnit.Framework.ExpectedException(typeof(ArgumentNullException))]  // Compliant - one line\n        public string TestFoo6() => new object().ToString();\n\n        [Test]\n        public void TestFoo8()\n        {\n            bool callFailed = false;\n            try\n            {\n                //...\n            }\n            catch (ArgumentNullException)\n            {\n                callFailed = true;\n            }\n        }\n\n        [Test]\n        [NUnit.Framework.ExpectedException(typeof(ArgumentNullException))]\n        public void NoBody() // Error [CS0501,CS1002]\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/8300\n    class Repro_8300\n    {\n        [Test]\n        [NUnit.Framework.ExpectedException(typeof(InvalidOperationException))] // Compliant - using ExpectedException makes the test more readable\n        public void AssertInFinally()\n        {\n            Console.ForegroundColor = ConsoleColor.Red;\n            try\n            {\n                throw new InvalidOperationException();\n            }\n            finally\n            {\n                Assert.AreEqual(ConsoleColor.Black, Console.ForegroundColor);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ExpectedExceptionAttributeShouldNotBeUsed.NUnit.vb",
    "content": "﻿Imports System\nImports NUnit.Framework\n\nPublic Class ExceptionTests\n\n    ' Noncompliant@+2\n    <Test>\n    <ExpectedException(GetType(DivideByZeroException))>\n    Public Sub ExpectedExceptionAttrbutesShouldNotBeUsedOnSub()\n        Dim instance As Integer = 42\n        instance.ToString()\n    End Sub\n\n    ' Noncompliant@+2\n    <Test>\n    <ExpectedException(GetType(DivideByZeroException))>\n    Public Function ExpectedExceptionAttrbutesShouldNotBeUsedOnFunction() As String\n        Dim instance As Integer = 42\n        Return instance.ToString()\n    End Function\n\n    ' Compliant - one line\n    <Test>\n    <ExpectedException(GetType(DivideByZeroException))>\n    Public Sub ExpectedExceptionAttrbuteAllowedForSingleLineSub()\n        Throw New NotImplementedException()\n    End Sub\n\n    ' Compliant - one line\n    <Test>\n    <ExpectedException(GetType(DivideByZeroException))>\n    Public Function ExpectedExceptionAttrbuteAllowedForSingleLineFunction() As Integer\n        Return 42\n    End Function\n\nEnd Class\n\nPublic Interface ISomeInterface\n    Sub SomeSub()\nEnd Interface\n\nPublic MustInherit Class AbstractClass\n    Protected MustOverride Function AbstractFunction() As Boolean\nEnd Class\n\n' https://github.com/SonarSource/sonar-dotnet/issues/8300\nClass Repro_8300\n    <Test>\n    <ExpectedException(GetType(InvalidOperationException))>\n    Public Sub AssertInFinally()\n        Console.ForegroundColor = ConsoleColor.Red\n        Try\n            Throw New InvalidOperationException()\n        Finally\n            Assert.AreEqual(ConsoleColor.Black, Console.ForegroundColor)\n        End Try\n    End Sub\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ExpressionComplexity.CSharp10.cs",
    "content": "﻿using System;\n\nobject x = new SomeClass();\n\nif (x is SomeClass { SomeProperty.Length: 1 } or SomeClass { SomeProperty.Length: 2 } or SomeClass { SomeProperty.Length: 3 } or SomeClass { SomeProperty.Length: 4 } or SomeClass { SomeProperty.Length: 5 }) { } // Noncompliant\n\nif (x is SomeClass { SomeProperty.Length: 1 } and SomeClass { SomeProperty.Length: 1 } and SomeClass { SomeProperty.Length: 1 } and SomeClass { SomeProperty.Length: 1 } and SomeClass { SomeProperty.Length: 1 }) { } // Noncompliant\n\nswitch (x)\n{\n    case SomeClass { SomeProperty.Length: 1 } and SomeClass { SomeProperty.Length: 1 } and SomeClass { SomeProperty.Length: 1 } and SomeClass { SomeProperty.Length: 1 } and SomeClass { SomeProperty.Length: 1 }: // Noncompliant\n        break;\n    case SomeClass { SomeProperty.Length: 6 }:\n        break;\n    default:\n        break;\n}\n\npublic class SomeClass\n{\n    public int[] SomeProperty { get; }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ExpressionComplexity.CSharp11.cs",
    "content": "﻿using System;\n\n_ = new[] { 1, 2, 3 } is [1 or 2 or 3 or 4 or 5 or 6, _, _]; // Noncompliant\n_ = new[] { 1, 2, 3 } is [1 or 2 or 3, 1 or 2 or 3, _]; // Compliant\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ExpressionComplexity.CSharp9.cs",
    "content": "﻿using System;\n\nvar d1 = true && false && true && false && true && true; // Noncompliant\n\nobject x = null;\n\nif (x is true or true or true or true or true) { } // Noncompliant\n\nif (x is true and true and true and true and true) { } // Noncompliant\n\nif (x is 10 or 20 or 40 or 50 or 60 or 70) { } // Noncompliant\n\nif (x is < 10 or < 20 or < 30 and (40 or 50 or 60)) { } // Noncompliant\n\nswitch (x)\n{\n    case true and true and true and true and true and true: // Noncompliant\n        break;\n    case false:\n        break;\n    default:\n        break;\n}\n\nvar y = x switch\n{\n    true and true and true and true and true and true => 1, // Noncompliant\n    false => 2,\n};\n_ = x is true and not (false or false or false or false); // Noncompliant {{Reduce the number of conditional operators (4) used in the expression (maximum allowed 3).}}\n//       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ny = x switch\n{\n    int => 1,\n    string => 1,\n    decimal => 1,\n    true => 1,\n    false => 0\n};\n\n_ = new Exception() is ArgumentException // Compliant\n{\n    Message: \"A\" or \"B\" or \"C\",\n    ParamName: \"D\" or \"E\" or \"F\",\n};\n\n_ = new Exception() is ArgumentException // Compliant\n{\n    Message: \"A\" or \"B\" or \"C\",\n    InnerException:\n    {\n        Message: \"D\" or \"E\" or \"F\",\n    }\n};\n\ntry\n{\n}\ncatch (Exception e) when (e is ArgumentNullException or ArgumentOutOfRangeException or DuplicateWaitObjectException or DivideByZeroException or NotFiniteNumberException or OverflowException) // Noncompliant\n{\n    throw;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ExpressionComplexity.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Linq;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public class ExpressionComplexity\n    {\n        public bool M()\n        {\n            var a1 = false;\n            var b1 = false ? (true ? (false ? (true ? 1 : 0) : 0) : 0) : 1; // Noncompliant\n//                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n            var c1 = (!(true || false || true || false || false)); // Noncompliant {{Reduce the number of conditional operators (4) used in the expression (maximum allowed 3).}}\n            //       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n            var d1 = true && false && true && false && true && true; // Noncompliant\n            var d2 = true && !(false && true && false) && !true && true; // Noncompliant\n\n            bool? v1 = null, v2 = null, v3 = null, v4 = null, v5 = null;\n\n            var h = v1 ??= v2 ??= v3 ??= v4 ??= v5; // Noncompliant\n\n            var m = true && true && true && call(true && true && true && true && true, true, true) && true;\n            //                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                          [iss1] {{Reduce the number of conditional operators (4) used in the expression (maximum allowed 3).}}\n            //      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @-1 [iss2] {{Reduce the number of conditional operators (4) used in the expression (maximum allowed 3).}}\n\n            call(\n                a =>\n                a = ((a1 ? false : true) || a1 || true && false && true || false)); // Noncompliant\n\n            var n = (true && true && true) == (true && true && true); // Noncompliant\n            n = true && true && true && (((true ? new object() : new object()) as bool?) ?? true); // Compliant. The ? : expression is inside the binary as expression. The as expression starts a new root.\n\n            for (var i = a1 ? (b1==0 ? (c1 ? (d1 ? 1 : 1) : 1) : 1) : 1; i < 1; i++) {} // Noncompliant\n\n            bool[] foo = {\n                true && true && true && true && true, // Noncompliant\n                true && true && true && true\n            };\n\n            var foo2 = new List<bool>\n            {\n                true && true && true && true && true, // Noncompliant\n                true && true && true && true\n            };\n\n            var x = new Dictionary<string, bool>\n            {\n                { \"a\", true && true && true && true && true }, // Noncompliant\n                { \"b\", true && true && true && true }\n            };\n\n            var e2 = true | false | true | false;\n\n            var a2 = false ? (true ? (false ? 1 : 0) : 0) : 1;\n            var a3 = (true && true && true && true) ? true : true;                 // Noncompliant\n            var a4 = true ? (true && true && true && true) : true;                 // Noncompliant\n            var a5 = true ? true : (true && true && true && true);                 // Noncompliant\n            var a6 = true ? true ? true ? true ? true : true : true : true : true; // Noncompliant\n            var a7 = true ? true ? true ? true : true : true : true && true;       // Noncompliant\n\n            var foo3 = new Action(delegate () {\n                bool a = true && true;\n                bool b = true && true;\n                bool c = true && true;\n                bool d = true && true;\n                bool e = true && true;\n                bool f = true && true && true && true && true; // Noncompliant\n            });\n\n            var f2 = new Foo2 {\n                a = true && true,\n                b = true && true,\n                c = true && true,\n                d = true && true,\n            };\n\n            var cnt = 42;\n            switch (cnt)\n            {\n                case 0:\n                case 1:\n                case 2:\n                case 3:\n                case 4:\n                case 5:\n                case 6:\n                case 7:\n                case 8:\n                case 9:\n                    break;\n            }\n\n            return call(\n                true && true && true,\n                true && true && true,\n                true && // Noncompliant\n                true &&\n                true &&\n                true &&\n                true &&\n                true);\n        }\n\n        private bool call(bool v1, bool v2, bool v3)\n        {\n            throw new NotImplementedException();\n        }\n\n        private bool call(Func<object, object> p0)\n        {\n            throw new NotImplementedException();\n        }\n    }\n\n    public class Foo2\n    {\n        public bool a { get; set; }\n        public bool b { get; set; }\n        public bool d { get; set; }\n        public bool c { get; set; }\n    }\n}\n\n// https://sonarsource.atlassian.net/browse/USER-1097\npublic class Repro_NET2428\n{\n    public string Prop1 { get; }\n    public string Prop2 { get; }\n    public string Prop3 { get; }\n    public string Prop4 { get; }\n    public string Prop5 { get; }\n\n    public Repro_NET2428(string prop1, string prop2, string prop3, string prop4, string prop5)\n    {\n        Prop1 = prop1;\n        Prop2 = prop2;\n        Prop3 = prop3;\n        Prop4 = prop4;\n        Prop5 = prop5;\n    }\n\n    public override bool Equals(object obj)\n    {\n        var other = obj as Repro_NET2428;\n        return this.Prop1.Equals(other.Prop1, StringComparison.OrdinalIgnoreCase)   // Compliant\n               && this.Prop2.Equals(other.Prop2, StringComparison.OrdinalIgnoreCase)\n               && this.Prop3.Equals(other.Prop3, StringComparison.OrdinalIgnoreCase)\n               && this.Prop4.Equals(other.Prop4, StringComparison.OrdinalIgnoreCase)\n               && this.Prop5.Equals(other.Prop5, StringComparison.OrdinalIgnoreCase);\n    }\n}\n\npublic class With_IEquatable : System.IEquatable<With_IEquatable>\n{\n    public string A { get; }\n    public string B { get; }\n    public string C { get; }\n    public string D { get; }\n\n    bool System.IEquatable<With_IEquatable>.Equals(With_IEquatable other) =>\n        other != null\n        && A == other.A\n        && B == other.B\n        && C == other.C\n        && D == other.D; // Compliant - explicit IEquatable<T>.Equals implementation\n\n    public static bool Equals(With_IEquatable a, With_IEquatable b) =>\n        a != null && b != null // Noncompliant\n        && a.A == b.A\n        && a.B == b.B\n        && a.C == b.C\n        && a.D == b.D;\n}\n\npublic struct With_Struct : System.IEquatable<With_Struct>\n{\n    public int A { get; }\n    public int B { get; }\n    public int C { get; }\n    public int D { get; }\n    public int E { get; }\n\n    public bool Equals(With_Struct other) =>\n        A == other.A\n        && B == other.B\n        && C == other.C\n        && D == other.D\n        && E == other.E; // Compliant\n}\n\npublic class With_MixedOperators : System.IEquatable<With_MixedOperators>\n{\n    public string A { get; }\n    public string B { get; }\n    public string C { get; }\n    public string D { get; }\n\n    public bool Equals(With_MixedOperators other) =>\n        ((string.IsNullOrEmpty(A) && string.IsNullOrEmpty(other.A)) || string.Equals(A, other.A)) // Compliant - mixed && and || inside Equals\n        && string.Equals(B, other.B)\n        && string.Equals(C, other.C)\n        && ((string.IsNullOrEmpty(D) && string.IsNullOrEmpty(other.D)) || string.Equals(D, other.D));\n}\n\npublic class With_GenericEquals<T, Y> : System.IEquatable<With_GenericEquals<T, Y>>\n{\n    public T A { get; }\n    public Y B { get; }\n    public string C { get; }\n    public string D { get; }\n\n    public bool Equals(With_GenericEquals<T, Y> other) =>\n        other != null\n        && System.Collections.Generic.EqualityComparer<T>.Default.Equals(A, other.A) // Compliant - generic type Equals\n        && System.Collections.Generic.EqualityComparer<Y>.Default.Equals(B, other.B)\n        && string.Equals(C, other.C)\n        && string.Equals(D, other.D);\n}\n\n// https://sonarsource.atlassian.net/browse/NET-2438 - Equals helper not formally overriding Object.Equals or implementing IEquatable<T>\npublic class With_PrivateEqualsHelper\n{\n    public string A { get; }\n    public string B { get; }\n    public string C { get; }\n    public string D { get; }\n\n    private bool Equals(With_PrivateEqualsHelper other) =>\n        (ReferenceEquals(A, other.A) || string.Equals(A, other.A)) // Noncompliant\n        && (ReferenceEquals(B, other.B) || string.Equals(B, other.B))\n        && (ReferenceEquals(C, other.C) || string.Equals(C, other.C))\n        && (ReferenceEquals(D, other.D) || string.Equals(D, other.D));\n\n    public override bool Equals(object obj) =>\n        obj is With_PrivateEqualsHelper other && Equals(other);\n}\n\n// Equals method where the class does not implement IEquatable<T>\npublic class With_EqualsWithoutInterface\n{\n    public string A { get; }\n    public string B { get; }\n    public string C { get; }\n    public string D { get; }\n    public string E { get; }\n\n    public bool Equals(With_EqualsWithoutInterface other) =>\n        other != null // Noncompliant\n        && string.Equals(A, other.A)\n        && string.Equals(B, other.B)\n        && string.Equals(C, other.C)\n        && string.Equals(D, other.D)\n        && string.Equals(E, other.E);\n}\n\n// Equals method where IEquatable is implemented for a base type, not the concrete type\npublic interface IMyRepresentation { }\n\npublic class With_EqualsForBaseType : IMyRepresentation, System.IEquatable<IMyRepresentation>\n{\n    public string A { get; }\n    public string B { get; }\n    public string C { get; }\n    public string D { get; }\n    public string E { get; }\n\n    public bool Equals(With_EqualsForBaseType other) =>\n        other != null // Noncompliant\n        && string.Equals(A, other.A)\n        && string.Equals(B, other.B)\n        && string.Equals(C, other.C)\n        && string.Equals(D, other.D)\n        && string.Equals(E, other.E);\n\n    public bool Equals(IMyRepresentation other) =>  // Compliant - implements IEquatable<IMyRepresentation>.Equals\n        other is With_EqualsForBaseType typed && Equals(typed);\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ExpressionComplexity.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\n\nNamespace NS\n    Class CL\n        Sub Method(b As Boolean)\n            Dim xx = True Or False Or True\n            xx = True Or False Or True OrElse False Xor False ' Noncompliant {{Reduce the number of conditional operators (4) used in the expression (maximum allowed 3).}}\n\n            Method(\n                True Or False Or True OrElse False Xor False) ' Noncompliant\n\n            Dim funcLambda = Function(x)\n                                 Return True Or False Or True OrElse False Xor False ' Noncompliant\n                             End Function\n\n            funcLambda = Function(x)\n                             Return True Or False\n                         End Function\n\n            Dim subLambda = Sub(x)\n                                Console.Write(\n                                        True Or False Or True OrElse False Xor False) ' Noncompliant\n                            End Sub\n\n            subLambda = Sub(x)\n                            Console.Write(\n                                        True Or False Or True OrElse False)\n                        End Sub\n\n            funcLambda = Function(x) True Or False Or True OrElse False Xor False ' Noncompliant\n'                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n            subLambda = Sub(x) Console.Write(\n                                        True Or False Or True OrElse False Xor False) ' Noncompliant\n\n            ' Noncompliant@+2\n            Dim namedCust = New Customer With {\n                .IsMale = True Or False Or True OrElse False Xor False,\n                .IsFemale = False Or True\n            }\n\n            If b OrElse b OrElse b OrElse b OrElse _\n                b OrElse b OrElse b OrElse b OrElse b Then ' Noncompliant@-1\n                b = True\n            End If\n            If b OrElse b OrElse Not (b OrElse Not b OrElse b) Then ' Noncompliant {{Reduce the number of conditional operators (4) used in the expression (maximum allowed 3).}}\n                b = True\n            End If\n        End Sub\n    End Class\n\n    Class Customer\n        Property IsMale As Boolean\n        Property IsFemale As Boolean\n    End Class\n\n    ' https://sonarsource.atlassian.net/browse/USER-1097\n    Class VBEqualsTest\n        Property A As String\n        Property B As String\n        Property C As String\n        Property D As String\n\n        Public Overrides Function Equals(obj As Object) As Boolean\n            Dim other = TryCast(obj, VBEqualsTest)\n            Return other IsNot Nothing AndAlso A = other.A AndAlso B = other.B AndAlso C = other.C AndAlso D = other.D ' Compliant\n        End Function\n    End Class\n\n    Class VBEqualsTestTyped\n        Implements System.IEquatable(Of VBEqualsTestTyped)\n\n        Property A As String\n        Property B As String\n        Property C As String\n        Property D As String\n        Property E As String\n\n        Public Function Equals(other As VBEqualsTestTyped) As Boolean Implements System.IEquatable(Of VBEqualsTestTyped).Equals\n            Return other IsNot Nothing AndAlso A = other.A AndAlso B = other.B AndAlso C = other.C AndAlso D = other.D AndAlso E = other.E ' Compliant\n        End Function\n    End Class\n\n    Class VBEqualsTestTypedRenamedMethod\n        Implements System.IEquatable(Of VBEqualsTestTypedRenamedMethod)\n\n        Property A As String\n        Property B As String\n        Property C As String\n        Property D As String\n        Property E As String\n\n        Public Function MyEquals(other As VBEqualsTestTypedRenamedMethod) As Boolean Implements System.IEquatable(Of VBEqualsTestTypedRenamedMethod).Equals\n            Return other IsNot Nothing AndAlso A = other.A AndAlso B = other.B AndAlso C = other.C AndAlso D = other.D AndAlso E = other.E ' Compliant - method name doesn't matter, it still implements IEquatable.Equals\n        End Function\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ExtensionMethodShouldBeInSeparateNamespace.CSharp10.cs",
    "content": "﻿namespace X;\n\npublic record class Record { }\npublic record struct RecordStruct { }\n\npublic static class GlobalExtensions\n{\n    public static void Bar(this Record r) { } // Noncompliant\n    public static void Bar(this RecordStruct r) { } // Compliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ExtensionMethodShouldBeInSeparateNamespace.CSharp9.cs",
    "content": "﻿var isTopLevelFile = true;\n\npublic record GlobalRecord { }\npublic struct GlobalStruct { }\n\npublic static class GlobalExtensions\n{\n    public static void Bar(this GlobalRecord r) { } // Noncompliant\n    public static void Bar(this GlobalStruct r) { } // compliant\n}\n\nnamespace MyLibrary\n{\n    public record Foo { }\n}\nnamespace Helpers\n{\n    public static class MyExtensions\n    {\n        public static void Bar(this MyLibrary.Foo foo) { }\n        public static void Bar(this GlobalRecord foo) { }\n    }\n}\nnamespace Same\n{\n    public record R { }\n    public static class Extensions\n    {\n        public static void Bar(this R r) {  } // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ExtensionMethodShouldBeInSeparateNamespace.GeneratedCode.cs",
    "content": "[System.CodeDom.Compiler.GeneratedCodeAttribute(\"xsd\", \"4.8.3928.0\")]\npublic abstract partial class GenClass\n{\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ExtensionMethodShouldBeInSeparateNamespace.cs",
    "content": "﻿using System;\n\nclass GlobalClass\n{\n}\n\nstruct GlobalStruct\n{\n}\n\nstatic class GlobalNamespaceClass\n{\n    static void Qux(this GlobalClass i) // Noncompliant\n    {\n    }\n\n    static void Quux(this SomeNonExistingClass snec) // Error [CS0246] ErrorType is considered as part of global namespace but we don't want to report on it\n    {\n    }\n\n    static void Strux(this GlobalStruct s) { } // Compliant\n}\n\nnamespace SomeNamespace\n{\n    class Program\n    {\n        static class SubClass\n        {\n            // Error@+1 [CS1109] - extensions method can't be on inner classes\n            static void Foobar(this Program p) // Noncompliant\n            {\n            }\n        }\n    }\n\n    static class Helpers1\n    {\n        static void Foo(this Program p) // Noncompliant {{Either move this extension to another namespace or move the method inside the class itself.}}\n//                  ^^^\n        { }\n    }\n}\n\nnamespace SomeOtherNamespace\n{\n    static class Helpers2\n    {\n        static void Bar(this SomeNamespace.Program p) // Compliant\n        {\n        }\n\n        static void Baz(this SomeNonExistingClass snec) // Error [CS0246] - unknown type\n        {\n        }\n    }\n}\n\nnamespace OtherPackageNamespace\n{\n    public interface IFoo { }\n\n    public enum FooBar { }\n\n    public struct FooQux { }\n\n    public class Outer\n    {\n        public interface IBaz { }\n\n        public enum BazBar { }\n\n        public struct BazQux { }\n\n    }\n\n    public static class FooHelpers\n    {\n        public static void FooInterface(this IFoo foo) // Compliant\n        {\n        }\n\n        public static void BazInterface(this Outer.IBaz foo) // Compliant\n        {\n        }\n\n        public static void FooEnum(this FooBar foo) // Compliant\n        {\n        }\n\n        public static void BazEnum(this Outer.BazBar foo) // Compliant\n        {\n        }\n\n        public static void FooStruct(this FooQux foo) // Compliant\n        {\n        }\n\n        public static void BazStruct(this Outer.BazQux foo) // Compliant\n        {\n        }\n\n        public static T FooGeneric<T>(this T foo) // Compliant\n        {\n            return default(T);\n        }\n    }\n\n}\n\ninternal static class GenClassExtensions\n{\n    public static void SetSyncLaterError(this GenClass foo) { } // Compliant, see: https://github.com/SonarSource/sonar-dotnet/issues/5457\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ExtensionMethodShouldNotExtendObject.cs",
    "content": "﻿using System;\n\nstatic class Compliant\n{\n    static void ExtendsValueType(this int i) { }\n    static int ExtendsWithArguments(this int i, int n)\n    {\n        return i + n;\n    }\n    static void ExtendsReferenceType(this Exception i) { }\n\n    static void NotAnExtension(object o) { }\n}\n\nstatic class NonCompliant\n{\n    static void ExtendsObject(this object obj) // Noncompliant {{Refactor this extension to extend a more concrete type.}}\n    //          ^^^^^^^^^^^^^\n    {\n    }\n\n    static void ExtendsWithArguments(this object obj, int other) { } // Noncompliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ExtensionMethodShouldNotExtendObject.vb",
    "content": "﻿Imports System.Runtime.CompilerServices\n\nModule Compliant\n    <Extension>\n    Sub ExtendsValueType(i As Integer)\n    End Sub\n\n    <Extension>\n    Function ExtendsWithArguments(i As Integer, n As Integer) As Integer\n        Return i + n\n    End Function\n\n    <Extension>\n    Sub ExtendsReferenceType(obj As Exception)\n    End Sub\n\n    Sub NotAnExtension(obj As Object)\n    End Sub\n\n    Function NotAnExtension(obj As Object, other As Object) As Object\n        Return other\n    End Function\nEnd Module\n\nModule Noncompliant\n    <Extension>\n    Sub ExtendsObject(obj As Object) ' Noncompliant {{Refactor this extension to extend a more concrete type.}}\n'       ^^^^^^^^^^^^^\n    End Sub\n\n    <Extension>\n    Function ExtendsObject(obj As Object, other As Object) As Object ' Noncompliant\n        Return other\n    End Function\n\n    <ExtensionAttribute>\n    Sub ExtendsWithLongName(obj As Object) ' Noncompliant\n    End Sub\n\n    <Extension>\n    <DebuggerStepThrough>\n    Public Sub MultipleAttributes(obj As Object) ' Noncompliant\n    End Sub\n\n    <Extension, DebuggerStepThrough>\n    Public Sub MultipleConbinedAttributes(obj As Object) ' Noncompliant\n    End Sub\n\n    <System.Runtime.CompilerServices.ExtensionAttribute>\n    Public Sub FullName(Arg As Object)          ' Noncompliant\n    End Sub\n\n    <Runtime.CompilerServices.ExtensionAttribute>\n    Public Sub ImplicitSystem(Arg As Object)    ' Noncompliant\n    End Sub\n\n    <System.Runtime.CompilerServices.Extension>\n    Public Sub ImplicitAttribute(Arg As Object) ' Noncompliant\n    End Sub\n\n    <Runtime.CompilerServices.Extension>\n    Public Sub ImplicitSystemAndAttribute(Arg As Object)    ' Noncompliant\n    End Sub\n\nEnd Module\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FieldShadowsParentField.CSharp9.cs",
    "content": "﻿public record Fruit\n{\n    protected int ripe;\n    protected static int leafs;\n}\n\npublic record Raspberry : Fruit\n{\n    private bool ripe;  // Noncompliant {{'ripe' is the name of a field in 'Fruit'.}}\n    protected static int leafs; // Compliant, static is ignored\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FieldShadowsParentField.cs",
    "content": "﻿using System;\n\nnamespace Tests.TestCases\n{\n    public class Fruit\n    {\n        protected int ripe;\n        protected static int leafs;\n    }\n\n    public class Raspberry : Fruit\n    {\n        private bool ripe;  // Noncompliant {{'ripe' is the name of a field in 'Fruit'.}}\n//                   ^^^^\n        protected static int leafs; // Compliant, static is ignored\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/3393\nnamespace Repro_3393\n{\n    public class Animal { }\n    public class Dog : Animal { }\n\n    public class AnimalContainer\n    {\n        protected readonly Animal animal;\n    }\n\n    public class DogContainer : AnimalContainer\n    {\n        private new readonly Dog animal; // Compliant, modifier \"new\" is used to explicitly declare the intention\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FieldShadowsParentField.vb",
    "content": "Public Class Fruit\n\n    Protected Ripe As Integer\n    Protected First, Second As Integer\n    Protected Shared Leafs As Integer\n    Protected Shadowed As Integer\n\nEnd Class\n\nPublic Class Raspberry\n    Inherits Fruit\n\n    Private Ripe As Boolean  ' Noncompliant {{'Ripe' is the name of a field in 'Fruit'.}}\n    '       ^^^^\n    Protected FirstIsDifferent, Second As Integer  ' Noncompliant {{'Second' is the name of a field in 'Fruit'.}}\n\n    Protected Shared Leafs As Integer       ' Compliant, shared is ignored\n    Protected Shadows Shadowed As Integer   ' Compliant, it's explicitly marked as Shadows\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FieldShouldBeReadonly.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public class Mod\n    {\n        public static void DoSomething(ref int x)\n        {\n        }\n        public static void DoSomething2(out int x)\n        {\n            x = 6;\n        }\n    }\n\n    class Person\n    {\n        private readonly int _birthYear;  // Fixed\n        readonly int _birthMonth = 3;  // Fixed\n        int _birthDay = 31;  // Compliant, the setter action references it\n        int _birthDay2 = 31;  // Compliant, it is used in a delegate\n        int _birthDay3 = 31;  // Compliant, it is passed as ref outside the ctor\n        int _birthDay4 = 31;  // Compliant, it is passed as out outside the ctor\n        int _legSize = 3;\n        int _legSize2 = 3;\n        int _handSize = 3;\n        int _handSize2 = 3;\n        int _neverUsed;\n\n        private readonly Action<int> setter;\n\n        Person(int birthYear)\n        {\n            setter = i => { _birthDay = i; };\n\n            System.Threading.Thread t1 = new System.Threading.Thread\n                (delegate()\n                {\n                    _birthDay2 = 42;\n                });\n            t1.Start();\n\n            _birthYear = birthYear;\n        }\n\n        private void M()\n        {\n            Mod.DoSomething(ref this._birthDay3);\n            Mod.DoSomething2(out _birthDay4);\n        }\n\n        public int LegSize\n        {\n            get\n            {\n                _legSize2++;\n                return _legSize;\n            }\n            set { _legSize = value; }\n        }\n\n        public int HandSize\n        {\n            get\n            {\n                --_handSize2;\n                return _handSize;\n            }\n            set { _handSize = value; }\n        }\n    }\n\n    partial class Partial\n    {\n        private int i; // Non-compliant, but not reported now because of the partial\n    }\n    partial class Partial\n    {\n        public Partial()\n        {\n            i = 42;\n        }\n    }\n\n    class X\n    {\n        private int x; // Compliant\n        private int y; // Compliant\n        private readonly int z = 10; // Fixed\n        private readonly int w = 10; // Fixed\n        private int a, b; // Fixed\n//                           Fixed\n        public X()\n        {\n            new X().x = 12;\n            var xx = new X();\n            Modif(ref xx.y);\n\n            Modif(ref (z));\n            this.w = 42;\n            a = 42;\n            b = 42;\n        }\n\n        private void Modif(ref int i) { }\n    }\n\n    struct X1Struct\n    {\n        public Y1 y;\n    }\n    class X1Class\n    {\n        public Y1 y;\n    }\n    struct Y1\n    {\n        public string z;\n    }\n\n    class MyClass\n    {\n        private X1Struct x; // Compliant\n        // See https://github.com/SonarSource/sonar-dotnet/issues/2291\n        private X1Struct y; // Compliant - could be set as readonly but this changes the behavior of the field\n        private readonly IntPtr myPtr; // Fixed\n\n        private readonly X1Class z; // Fixed\n\n        private bool field = false;\n\n        public MyClass()\n        {\n            x = new X1Struct();\n            y = new X1Struct();\n            z = new X1Class();\n            myPtr = new IntPtr(12);\n            (this.y.y).z = \"a\";\n            (this.z.y).z = \"a\";\n            if (this.field)\n            { }\n        }\n\n        public void M()\n        {\n            (this.x.y).z = \"a\";\n            (this.z.y).z = \"a\";\n        }\n\n        private class Nested\n        {\n            private readonly MyClass inst;\n            public Nested()\n            {\n                inst = new MyClass();\n            }\n            private void Method()\n            {\n                this.inst.field = false;\n            }\n        }\n    }\n\n    class Attributed\n    {\n        [My]\n        private int myField1; // Compliant because of the attribute\n\n        public Attributed()\n        {\n            myField1 = 42;\n        }\n    }\n\n    public class MyAttribute : Attribute { }\n\n    // See https://github.com/SonarSource/sonar-dotnet/issues/1009\n    // Issue with leading trivia not moved to the readonly modifier\n    public class MyClassWithField\n    {\n        #region Test\n        readonly string teststring = null; // Fixed\n        #endregion\n\n        public void Do()\n        {\n            var x = teststring;\n        }\n    }\n\n    [Serializable]\n    public class SerializableClass\n    {\n        private int field; // Compliant, containing class is marked with [Serializable]\n\n        public SerializableClass()\n        {\n            field = 5;\n        }\n    }\n\n    public class DerivedFromSerializable : SerializableClass\n    {\n        private readonly int otherField; // Fixed\n\n        public DerivedFromSerializable()\n        {\n            otherField = 5;\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/3339\n    public class NullCoalesceAssignment\n    {\n        private string value = null;\n\n        public void DoSomething()\n        {\n            value ??= \"Empty\";\n        }\n    }\n\n    public class TupleExpressionAssignment\n    {\n        private string a; // Compliant - set in tuple expression\n        private string b; // Compliant - set in tuple expression\n        private X1Struct x1; // Compliant - set in tuple expression\n        private X1Struct x2; // Compliant - set in tuple expression\n\n        public TupleExpressionAssignment()\n        {\n            a = string.Empty;\n            b = string.Empty;\n            x1 = new X1Struct();\n            x2 = new X1Struct();\n        }\n\n        public void SomeMethod()\n        {\n            (a, b) = NewValues();\n            ((this.x1.y).z, (this.x2.y).z) = NewValues();\n        }\n\n        private (string, string) NewValues() => (\"FOO\", \"Bar\");\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/9657\n    public struct StructWithThisReassignmentToDefaultInMethod\n    {\n        private int number;     // Compliant: the field's value is overwritten in the Reset() method (with the 'this = default' assignment)\n        public int Number => number;\n\n        public StructWithThisReassignmentToDefaultInMethod(int number)\n        {\n            this.number = number;\n        }\n\n        public void Reset()\n        {\n            this = default;\n        }\n    }\n\n    public struct StructWithThisReassignmentToNewInMethod\n    {\n        private int number;     // Compliant: the field's value is overwritten in the Reassign method\n        public int Number => number;\n\n        public StructWithThisReassignmentToNewInMethod(int number)\n        {\n            this.number = number;\n        }\n\n        public void ReAssign()\n        {\n            this = new StructWithThisReassignmentToNewInMethod(42);\n        }\n    }\n\n    public struct StructWithThisReassignmentInConstructor\n    {\n        private readonly int number;     // Fixed\n        public int Number => number;\n\n        public StructWithThisReassignmentInConstructor(int number)\n        {\n            this = default;\n            this.number = number;\n        }\n    }\n\n    public class NestedStructWithThisReassignment\n    {\n        private readonly int number;     // Fixed\n        public int Number => number;\n\n        public NestedStructWithThisReassignment(int number)\n        {\n            this.number = number;\n        }\n\n        public struct NestedStruct\n        {\n            private int number;\n            public int Number => number;\n\n            public NestedStruct(int number)\n            {\n                this.number = number;\n            }\n\n            public void Reset()\n            {\n                this = default;\n            }\n        }\n    }\n}\n\n// https://sonarsource.atlassian.net/browse/NET-691\nnamespace Repro_NET691\n{\n    public class MyClass\n    {\n        private readonly bool myField = true; // Fixed\n\n        public void ToggleField()\n        {\n            myField.Toggle();\n        }\n    }\n\n    public static class BoolExtension\n    {\n        public static void Toggle(this ref bool value)\n        {\n            value = !value;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FieldShouldBeReadonly.Latest.cs",
    "content": "﻿using System;\n\nrecord Person\n{\n    private int birthYear;     // Noncompliant {{Make 'birthYear' 'readonly'.}}\n    int birthMonth = 3;        // Noncompliant\n\n    int legSize1 = 3;\n    int legSize2 = 3;\n    bool usedInInit = false;\n\n    Person(int birthYear)\n    {\n        this.birthYear = birthYear;\n    }\n\n    public int LegSize\n    {\n        get\n        {\n            legSize2++;\n            return legSize1;\n        }\n        init\n        {\n            legSize1 = value;\n            usedInInit = true;\n        }\n    }\n}\n\nrecord PointerTypes\n{\n    private readonly nint _nint; // Compliant\n    private nint _nint2; // Compliant\n\n    private readonly nuint _nuint; // Compliant\n    private nuint _nuint2; // Compliant\n\n    private nint _nint3 = 42; // Noncompliant\n    private UIntPtr _nuint3 = 42; // Noncompliant\n\n    private IntPtr _nint4; // Compliant, used by a method\n    private IntPtr _nint5 = 42; // Compliant, ++ operation invoked\n\n    private nuint _nuint4; // Compliant, used by a property\n    private nuint _nuint5 = 42; // Compliant, -- operation invoked\n\n    nint _ref_nint = 42;  // Compliant, it is passed as ref outside the ctor\n    UIntPtr _out_nuint = 42;  // Compliant, it is passed as out outside the ctor\n\n    PointerTypes(nint nint1, nuint nuint1)\n    {\n        _nint = nint1;\n        _nuint = nuint1;\n    }\n\n    private void AssignValue()\n    {\n        _nint4 = 42;\n\n        _nint5++;\n        _nuint5--;\n    }\n\n    private UIntPtr Get_UIntPtr => _nuint4;\n\n    private void M()\n    {\n        Method_RefArgument(ref _ref_nint);\n        Method_OutArgument(out _out_nuint);\n    }\n\n    private void Method_RefArgument(ref nint v) { }\n    private void Method_OutArgument(out nuint v) { v = 42; }\n}\n\nclass Person2\n{\n    int somefield = 42; // Compliant\n    private readonly Action<int> setter;\n\n    Person2(int birthYear)\n    {\n        setter = i => { somefield >>>= i; };\n    }\n}\n\npublic class FieldReadOnly\n{\n    private int field = 42;  // Noncompliant\n\n    public int Property\n    {\n        get => @field;\n        set => field = value;\n    }\n}\n\npublic class FieldWriteOnly\n{\n    private int field = 42;\n\n    public int Property\n    {\n        get => field;\n        set => @field = value;\n    }\n}\n\npublic class NullConditionalAssignment\n{\n    private int value;  // Compliant\n\n    public void Assign() =>\n        this?.value = 100;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FieldShouldBeReadonly.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public class Mod\n    {\n        public static void DoSomething(ref int x)\n        {\n        }\n        public static void DoSomething2(out int x)\n        {\n            x = 6;\n        }\n    }\n\n    class Person\n    {\n        private int _birthYear;  // Noncompliant {{Make '_birthYear' 'readonly'.}}\n//                  ^^^^^^^^^^\n        int _birthMonth = 3;  // Noncompliant\n        int _birthDay = 31;  // Compliant, the setter action references it\n        int _birthDay2 = 31;  // Compliant, it is used in a delegate\n        int _birthDay3 = 31;  // Compliant, it is passed as ref outside the ctor\n        int _birthDay4 = 31;  // Compliant, it is passed as out outside the ctor\n        int _legSize = 3;\n        int _legSize2 = 3;\n        int _handSize = 3;\n        int _handSize2 = 3;\n        int _neverUsed;\n\n        private readonly Action<int> setter;\n\n        Person(int birthYear)\n        {\n            setter = i => { _birthDay = i; };\n\n            System.Threading.Thread t1 = new System.Threading.Thread\n                (delegate()\n                {\n                    _birthDay2 = 42;\n                });\n            t1.Start();\n\n            _birthYear = birthYear;\n        }\n\n        private void M()\n        {\n            Mod.DoSomething(ref this._birthDay3);\n            Mod.DoSomething2(out _birthDay4);\n        }\n\n        public int LegSize\n        {\n            get\n            {\n                _legSize2++;\n                return _legSize;\n            }\n            set { _legSize = value; }\n        }\n\n        public int HandSize\n        {\n            get\n            {\n                --_handSize2;\n                return _handSize;\n            }\n            set { _handSize = value; }\n        }\n    }\n\n    partial class Partial\n    {\n        private int i; // Non-compliant, but not reported now because of the partial\n    }\n    partial class Partial\n    {\n        public Partial()\n        {\n            i = 42;\n        }\n    }\n\n    class X\n    {\n        private int x; // Compliant\n        private int y; // Compliant\n        private int z = 10; // Noncompliant\n        private int w = 10; // Noncompliant\n        private int a, b; // Noncompliant\n//                           Noncompliant@-1\n        public X()\n        {\n            new X().x = 12;\n            var xx = new X();\n            Modif(ref xx.y);\n\n            Modif(ref (z));\n            this.w = 42;\n            a = 42;\n            b = 42;\n        }\n\n        private void Modif(ref int i) { }\n    }\n\n    struct X1Struct\n    {\n        public Y1 y;\n    }\n    class X1Class\n    {\n        public Y1 y;\n    }\n    struct Y1\n    {\n        public string z;\n    }\n\n    class MyClass\n    {\n        private X1Struct x; // Compliant\n        // See https://github.com/SonarSource/sonar-dotnet/issues/2291\n        private X1Struct y; // Compliant - could be set as readonly but this changes the behavior of the field\n        private IntPtr myPtr; // Noncompliant\n\n        private X1Class z; // Noncompliant\n\n        private bool field = false;\n\n        public MyClass()\n        {\n            x = new X1Struct();\n            y = new X1Struct();\n            z = new X1Class();\n            myPtr = new IntPtr(12);\n            (this.y.y).z = \"a\";\n            (this.z.y).z = \"a\";\n            if (this.field)\n            { }\n        }\n\n        public void M()\n        {\n            (this.x.y).z = \"a\";\n            (this.z.y).z = \"a\";\n        }\n\n        private class Nested\n        {\n            private readonly MyClass inst;\n            public Nested()\n            {\n                inst = new MyClass();\n            }\n            private void Method()\n            {\n                this.inst.field = false;\n            }\n        }\n    }\n\n    class Attributed\n    {\n        [My]\n        private int myField1; // Compliant because of the attribute\n\n        public Attributed()\n        {\n            myField1 = 42;\n        }\n    }\n\n    public class MyAttribute : Attribute { }\n\n    // See https://github.com/SonarSource/sonar-dotnet/issues/1009\n    // Issue with leading trivia not moved to the readonly modifier\n    public class MyClassWithField\n    {\n        #region Test\n        string teststring = null; // Noncompliant\n        #endregion\n\n        public void Do()\n        {\n            var x = teststring;\n        }\n    }\n\n    [Serializable]\n    public class SerializableClass\n    {\n        private int field; // Compliant, containing class is marked with [Serializable]\n\n        public SerializableClass()\n        {\n            field = 5;\n        }\n    }\n\n    public class DerivedFromSerializable : SerializableClass\n    {\n        private int otherField; // Noncompliant, Serializable attribute is not inherited\n\n        public DerivedFromSerializable()\n        {\n            otherField = 5;\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/3339\n    public class NullCoalesceAssignment\n    {\n        private string value = null;\n\n        public void DoSomething()\n        {\n            value ??= \"Empty\";\n        }\n    }\n\n    public class TupleExpressionAssignment\n    {\n        private string a; // Compliant - set in tuple expression\n        private string b; // Compliant - set in tuple expression\n        private X1Struct x1; // Compliant - set in tuple expression\n        private X1Struct x2; // Compliant - set in tuple expression\n\n        public TupleExpressionAssignment()\n        {\n            a = string.Empty;\n            b = string.Empty;\n            x1 = new X1Struct();\n            x2 = new X1Struct();\n        }\n\n        public void SomeMethod()\n        {\n            (a, b) = NewValues();\n            ((this.x1.y).z, (this.x2.y).z) = NewValues();\n        }\n\n        private (string, string) NewValues() => (\"FOO\", \"Bar\");\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/9657\n    public struct StructWithThisReassignmentToDefaultInMethod\n    {\n        private int number;     // Compliant: the field's value is overwritten in the Reset() method (with the 'this = default' assignment)\n        public int Number => number;\n\n        public StructWithThisReassignmentToDefaultInMethod(int number)\n        {\n            this.number = number;\n        }\n\n        public void Reset()\n        {\n            this = default;\n        }\n    }\n\n    public struct StructWithThisReassignmentToNewInMethod\n    {\n        private int number;     // Compliant: the field's value is overwritten in the Reassign method\n        public int Number => number;\n\n        public StructWithThisReassignmentToNewInMethod(int number)\n        {\n            this.number = number;\n        }\n\n        public void ReAssign()\n        {\n            this = new StructWithThisReassignmentToNewInMethod(42);\n        }\n    }\n\n    public struct StructWithThisReassignmentInConstructor\n    {\n        private int number;     // Noncompliant - assignment to this happens only in the constructor\n        public int Number => number;\n\n        public StructWithThisReassignmentInConstructor(int number)\n        {\n            this = default;\n            this.number = number;\n        }\n    }\n\n    public class NestedStructWithThisReassignment\n    {\n        private int number;     // Noncompliant - assignment to this happens only in the nested type\n        public int Number => number;\n\n        public NestedStructWithThisReassignment(int number)\n        {\n            this.number = number;\n        }\n\n        public struct NestedStruct\n        {\n            private int number;\n            public int Number => number;\n\n            public NestedStruct(int number)\n            {\n                this.number = number;\n            }\n\n            public void Reset()\n            {\n                this = default;\n            }\n        }\n    }\n}\n\n// https://sonarsource.atlassian.net/browse/NET-691\nnamespace Repro_NET691\n{\n    public class MyClass\n    {\n        private bool myField = true; // Noncompliant FP\n\n        public void ToggleField()\n        {\n            myField.Toggle();\n        }\n    }\n\n    public static class BoolExtension\n    {\n        public static void Toggle(this ref bool value)\n        {\n            value = !value;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FieldShouldNotBePublic.CSharp9.cs",
    "content": "﻿public record Sample\n{\n    public readonly double Pi3 = 3.14;  // Noncompliant {{Make 'Pi3' private.}}\n\n    public double Pi4 = 3.14;           // Noncompliant\n    private double Pi5 = 3.14;\n    protected double Pi6 = 3.14;\n    internal double Pi7 = 3.14;\n\n    public record InnerRecordPublic\n    {\n        public double Pi4 = 3.14;       // Noncompliant\n        private double Pi5 = 3.14;\n    }\n\n    private record InnerRecordPrivate\n    {\n        public double Pi4 = 3.14;       // Compliant in private type\n        private double Pi5 = 3.14;\n    }\n}\n\npublic class OuterClass\n{\n    public record InnerRecord\n    {\n        public double Pi4 = 3.14; // Noncompliant\n        private double Pi5 = 3.14;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FieldShouldNotBePublic.cs",
    "content": "﻿namespace Tests.TestCases\n{\n    public class MyClass\n    {\n        public static double Pi = 3.14;\n        public const double Pi2 = 3.14;\n        public readonly double Pi3 = 3.14; // Noncompliant {{Make 'Pi3' private.}}\n//                             ^^^\n        public double Pi4 = 3.14; // Noncompliant\n        private double Pi5 = 3.14;\n        protected double Pi6 = 3.14;\n        internal double Pi7 = 3.14;\n\n        public class MyPublicSubClass\n        {\n            public double Pi4 = 3.14; // Noncompliant\n            private double Pi5 = 3.14;\n            protected double Pi6 = 3.14;\n            internal double Pi7 = 3.14;\n        }\n\n        private class MyPrivateSubClass\n        {\n            public double Pi4 = 3.14;\n            private double Pi5 = 3.14;\n            protected double Pi6 = 3.14;\n            internal double Pi7 = 3.14;\n        }\n\n        protected class MyProtectedSubClass\n        {\n            public double Pi4 = 3.14;  // Noncompliant\n            private double Pi5 = 3.14;\n            protected double Pi6 = 3.14;\n            internal double Pi7 = 3.14;\n        }\n\n        internal class MyInternalSubClass\n        {\n            public double Pi4 = 3.14;\n            private double Pi5 = 3.14;\n            protected double Pi6 = 3.14;\n            internal double Pi7 = 3.14;\n        }\n    }\n\n    public struct MyStruct\n    {\n        public static double Pi = 3.14;\n        public const double Pi2 = 3.14;\n\n        public double Pi3;\n        private double Pi4;\n        internal double Pi5;\n\n        public struct MyPublicSubStruct\n        {\n            public double Pi4;\n            private double Pi5;\n            internal double Pi7;\n        }\n\n        private struct MyPrivateSubStruct\n        {\n            public double Pi4;\n            private double Pi5;\n            internal double Pi7;\n        }\n\n        internal struct MyInternalSubStruct\n        {\n            public double Pi4;\n            private double Pi5;\n            internal double Pi7;\n        }\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FieldShouldNotBePublic.vb",
    "content": "﻿Namespace Tests.TestCases\n    Public Class SomeClass\n        Public Shared Pi As Double = 3.14\n        Public Const Pi2 As Double = 3.14\n        Public ReadOnly Pi3 As Double = 3.14 ' Noncompliant {{Make 'Pi3' private.}}\n'                       ^^^\n        Public Pi4 As Double = 3.14 ' Noncompliant\n        Private Pi5 As Double = 3.14\n        Protected Pi6 As Double = 3.14\n        Friend Pi7 As Double = 3.14\n\n        Public Class MyPublicSubClass\n\n            Public Pi4 As Double = 3.14 ' Noncompliant\n            Private Pi5 As Double = 3.14\n            Protected Pi6 As Double = 3.14\n            Friend Pi7 As Double = 3.14\n        End Class\n\n        Private Class MyPrivateSubClass\n\n            Public Pi4 As Double = 3.14\n            Private Pi5 As Double = 3.14\n            Protected Pi6 As Double = 3.14\n            Friend Pi7 As Double = 3.14\n        End Class\n\n        Protected Class MyProtectedSubClass\n\n            Public Pi4 As Double = 3.14 ' Noncompliant\n            Private Pi5 As Double = 3.14\n            Protected Pi6 As Double = 3.14\n            Friend Pi7 As Double = 3.14\n        End Class\n\n        Friend Class MyInternalSubClass\n\n            Public Pi4 As Double = 3.14\n            Private Pi5 As Double = 3.14\n            Protected Pi6 As Double = 3.14\n            Friend Pi7 As Double = 3.14\n        End Class\n    End Class\n\n    Public Structure MyStruct\n        Public Shared Pi As Double = 3.14\n        Public Const Pi2 As Double = 3.14\n\n        Public Pi3 As Double\n        Private Pi4 As Double\n        Friend Pi5 As Double\n\n        Public Structure MyPublicSubStruct\n            Public Pi4 As Double\n            Private Pi5 As Double\n            Friend Pi7 As Double\n        End Structure\n\n        Private Structure MyPrivateSubStruct\n            Public Pi4 As Double\n            Private Pi5 As Double\n            Friend Pi7 As Double\n        End Structure\n\n        Friend Structure MyInternalSubStruct\n            Public Pi4 As Double\n            Private Pi5 As Double\n            Friend Pi7 As Double\n        End Structure\n    End Structure\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FieldsShouldBeEncapsulatedInProperties.CSharp12.cs",
    "content": "﻿public class PublicClass(int myValue, int notMyValue)\n{\n    public int myValue = 42; // Noncompliant {{Make this field 'private' and encapsulate it in a 'public' property.}}\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FieldsShouldBeEncapsulatedInProperties.CSharp9.cs",
    "content": "﻿public record PublicClass\n{\n    public int myValue = 42; // Noncompliant {{Make this field 'private' and encapsulate it in a 'public' property.}}\n\n    public readonly int MagicNumber = 42;\n    public const int AnotherMagicNumber = 998001;\n\n    private record PrivateClass\n    {\n        public int myValue = 42;\n    }\n\n    protected class ProtectedClass\n    {\n        public int myValue = 42; // Noncompliant\n    }\n}\n\ninternal record InternalClass\n{\n    public int myValue = 42;\n\n    public record InnerPublicRecord\n    {\n        public int mySubValue = 42;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FieldsShouldBeEncapsulatedInProperties.Unity3D.cs",
    "content": "﻿using System;\n\n// https://github.com/SonarSource/sonar-dotnet/issues/7522\npublic class UnityMonoBehaviour : UnityEngine.MonoBehaviour\n{\n    public int Field1; // Compliant\n}\n\npublic class UnityScriptableObject : UnityEngine.ScriptableObject\n{\n    public int Field1; // Compliant\n}\n\npublic class InvalidCustomSerializableClass1 : UnityEngine.Object\n{\n    public int Field1; // Noncompliant\n}\n\n[Serializable]\npublic class ValidCustomSerializableClass : UnityEngine.Object\n{\n    public int Field1; // Compliant\n}\n\n// Unity3D does not seem to be available as a nuget package and we cannot use the original classes\n// Cannot run this test case in Concurrent mode because of the Concurrent namespace\nnamespace UnityEngine\n{\n    public class MonoBehaviour { }\n    public class ScriptableObject { }\n    public class Object { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FieldsShouldBeEncapsulatedInProperties.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\n\nnamespace Tests.Diagnostics\n{\n    public class PublicClass\n    {\n        public int myValue = 42; // Noncompliant {{Make this field 'private' and encapsulate it in a 'public' property.}}\n\n        public readonly int MagicNumber = 42;\n        public const int AnotherMagicNumber = 998001;\n\n        private class PrivateClass\n        {\n            public int myValue = 42;\n\n            public readonly int MagicNumber = 42;\n            public const int A = 998001;\n        }\n\n        protected class ProtectedClass\n        {\n            public int myValue = 42; // Noncompliant\n\n            public readonly int MagicNumber = 42;\n            public const int B = 998001;\n        }\n    }\n\n    internal class InternalClass\n    {\n        public int myValue = 42;\n\n        public readonly int MagicNumber = 42;\n        public const int AnotherMagicNumber = 998001;\n\n        public class InnerPublicClass\n        {\n            public int mySubValue = 42;\n        }\n\n        private class PrivateClass\n        {\n            public int myValue = 42;\n\n            public readonly int MagicNumber = 42;\n            public const int A = 998001;\n        }\n\n        protected class ProtectedClass\n        {\n            public int myValue = 42;\n\n            public readonly int MagicNumber = 42;\n            public const int B = 998001;\n        }\n    }\n\n    public partial class PartialClass\n    {\n\n    }\n\n    partial class PartialClass\n    {\n        public int myValue = 0; // Noncompliant\n    }\n\n    public struct Struct\n    {\n        public ushort value; // Noncompliant\n    }\n\n    [StructLayout(LayoutKind.Explicit, Size = 16, CharSet = CharSet.Ansi)]\n    public struct InteropStruct\n    {\n        [FieldOffset(0)] public ushort value; // Compliant - for interop code\n    }\n\n    [StructLayout(LayoutKind.Sequential)]\n    public class InteropClass\n    {\n        public string value; // Compliant - for interop code\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/8504\n    [Serializable]\n    public class Repro_8504\n    {\n        public string type;     // Compliant\n        public string key;      // Compliant\n        [NonSerialized]\n        public string value;    // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FieldsShouldNotDifferByCapitalization.CSharp9.cs",
    "content": "﻿public record Fruit\n{\n    protected int flesh;\n    private int flesh_color;\n}\n\npublic record Raspberry : Fruit\n{\n    private int fLeSh;          // Noncompliant {{Rename this field; it may be confused with 'flesh' in 'Fruit'.}}\n    private static int FLESH;   // Noncompliant {{Rename this field; it may be confused with 'flesh' in 'Fruit'.}}\n    private static int FLESH_COLOR; // Compliant, base class field is private\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FieldsShouldNotDifferByCapitalization.cs",
    "content": "﻿using System;\n\nnamespace Tests.TestCases\n{\n    public class Fruit\n    {\n        protected int flesh;\n        private int flesh_color;\n    }\n\n    public class Raspberry : Fruit\n    {\n        private int fLeSh; // Noncompliant {{Rename this field; it may be confused with 'flesh' in 'Fruit'.}}\n        private static int FLESH; // Noncompliant {{Rename this field; it may be confused with 'flesh' in 'Fruit'.}}\n        private static int FLESH_COLOR; // Compliant, base class field is private\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FieldsShouldNotDifferByCapitalization.vb",
    "content": "﻿Public Class Fruit\n\n    Protected flesh As Integer\n    Protected fleshShared As Integer\n    Private flesh_color As Integer\n    Protected shadowed As Integer\n\nEnd Class\n\nPublic Class Raspberry\n    Inherits Fruit\n\n    Private fLeSh As Integer                ' Noncompliant {{Rename this field; it may be confused with 'flesh' in 'Fruit'.}}\n    Private Shared FLESHSHARED As Integer   ' Noncompliant {{Rename this field; it may be confused with 'fleshShared' in 'Fruit'.}}\n    Private Shared FLESH_COLOR As Integer   ' Compliant, base Class field Is Private\n\n    Protected Shadows Shadowed As Integer   'Compliant, the intention is explicit\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FileLines20.cs",
    "content": "﻿// Noncompliant {{This file has 20 lines, which is greater than 10 authorized. Split it into smaller files.}}\nnamespace Tests.Diagnostics\n{\n    public class FooBar\n    {\n        public FooBar()\n        {\n            System // Error [CS0120] - method call is not static\n                   .Collections\n                   .\n                   // WTF\n                   Generic\n\n                   .List<int>\n                   .\n                   // Who writes this kind of code!\n                   Enumerator\n\n                   .Equals(null);\n\n            var str = @\"\n                a\n                b\";\n        }\n    }\n}\n\n// hello\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FileLines20.vb",
    "content": "﻿' Noncompliant {{This file has 20 lines, which is greater than 10 authorized. Split it into smaller files.}}\nNamespace Tests.Diagnostics\n    Class FooBar\n        Sub New()\n            Dim x = New System.Collections.Generic.List(Of Integer)().Equals(Nothing)\n            x = New System.Collections.Generic.List(Of Integer)().Equals(Nothing)\n            x = New System.Collections.Generic.List(Of Integer)().Equals(Nothing)\n            x = New System.Collections.Generic.List(Of Integer)().Equals(Nothing)\n            x = New System.Collections.Generic.List(Of Integer)().Equals(Nothing)\n            x = New System.Collections.Generic.List(Of Integer)().Equals(Nothing)\n            x = New System.Collections.Generic.List(Of Integer)().Equals(Nothing)\n            x = New System.Collections.Generic.List(Of Integer)().Equals(Nothing)\n            x = New System.Collections.Generic.List(Of Integer)().Equals(Nothing)\n            x = New System.Collections.Generic.List(Of Integer)().Equals(Nothing)\n            x = New System.Collections.Generic.List(Of Integer)().Equals(Nothing)\n\n            Dim s As String = \"a\n                b\n                c\"\n        End Sub\n    End Class\n\nEnd Namespace\n\n\n' Some comment here\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FileLines9.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) 2014-2025 SonarSource SA\n * mailto:info AT sonarsource DOT com\n * This program is free software; you can redistribute it and/or\n * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace Tests.Diagnostics\n{\n    public class Foo /*\n        dsad\n        dsad\n        sad\n        sa\n        dasd\n        sa\n        dasd\n        sad\n        as\n        */\n    {\n        /// <summary>\n        ///\n        /// </summary>\n        public Foo() { // TEST\n            string multilineToken = @\"\n\n                \";\n} } }\n\n\n// hello\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FileLines9.vb",
    "content": "﻿' Fake CopyLeft message\n' that spans over multiple lines\n' mailto: contact AT sonarsource DOT com\n'\n' This program Is free software; you can redistribute it And/Or\n' modify it under the terms of the GNU Lesser General Public\n' License as published by the Free Software Foundation; either\n' version 3 of the License, Or (at your option) any later version.\n'\n' This program Is distributed in the hope that it will be useful,\n' but WITHOUT ANY WARRANTY; without even the implied warranty of\n' MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n' Lesser General Public License for more details.\n'\n' You should have received a copy of the GNU Lesser General Public License\n' along with this program; if Not, write to the Free Software Foundation,\n' Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\n\nNamespace Tests.Diagnostics\n    Class Foo\n        Sub New() ' TEST\n            ' HELLO\n            REM This is also a syntax for line comment\n        End Sub\n    End Class\n\nEnd Namespace\n\n\n' Some comment here\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FileShouldEndWithEmptyNewLine_EmptyFile.cs",
    "content": "﻿"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FileShouldEndWithEmptyNewLine_EmptyLine.cs",
    "content": "﻿using System;\n\nnamespace EmptyLine\n{\n    class Program\n    {\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FileShouldEndWithEmptyNewLine_NoEmptyLine.cs",
    "content": "﻿using System;\n\nnamespace NoEmptyLine\n{\n    class Program\n    {\n    }\n} // Noncompliant {{Add a new line at the end of the file 'FileShouldEndWithEmptyNewLine_NoEmptyLine.cs'.}}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FinalizerShouldNotBeEmpty.CSharp9.cs",
    "content": "﻿record Record1\n{\n    ~Record1() // Noncompliant {{Remove this empty finalizer.}}\n    {\n\n    }\n}\n\nrecord Record2\n{\n    ~Record2() // Noncompliant {{Remove this empty finalizer.}}\n    {\n        // Some comment\n    }\n}\n\nrecord Record3\n{\n    ~Record3() // Compliant\n    {\n        var something = 0;\n    }\n}\n\nrecord Record4\n{\n    bool value;\n\n    ~Record4() => value = false;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FinalizerShouldNotBeEmpty.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        ~Program() // Noncompliant {{Remove this empty finalizer.}}\n        {\n\n        }\n    }\n\n    class Program1\n    {\n        ~Program1() // Noncompliant {{Remove this empty finalizer.}}\n        {\n            // Some comment\n        }\n    }\n\n    class Program2\n    {\n        ~Program2() // Compliant\n        {\n            Console.WriteLine(\"foo\");\n        }\n    }\n\n    class Program3\n    {\n        ~Program3() => Console.WriteLine();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FindInsteadOfFirstOrDefault.Array.cs",
    "content": "using System.Linq;\nusing System;\n\npublic class FindInsteadOfFirstOrDefault\n{\n    public void ArrayType()\n    {\n        var data = new int[1];\n\n        data.FirstOrDefault(x => true); // Noncompliant {{\"Array.Find\" static method should be used instead of the \"FirstOrDefault\" extension method.}}\n        //   ^^^^^^^^^^^^^^\n        Array.Find(data, x => true); // Compliant\n\n        data.FirstOrDefault(); // Compliant\n\n        data.Select(x => x * 2).ToArray().FirstOrDefault(x => true); // Noncompliant\n        //                                ^^^^^^^^^^^^^^\n        Array.Find(data.Select(x => x * 2).ToArray(), x => true); // Compliant\n\n        int[] DoWork() => null;\n\n        DoWork().FirstOrDefault(x => true); // Noncompliant\n        //       ^^^^^^^^^^^^^^\n        Array.Find(DoWork(), x => true); // Compliant\n\n        _ = new Func<int[], int>(list => list.FirstOrDefault(x => true)); // Noncompliant\n        //                                    ^^^^^^^^^^^^^^\n\n        var lambda = new Func<int[]>(() => new int[1]);\n\n        lambda().FirstOrDefault(x => true); // Noncompliant\n        //       ^^^^^^^^^^^^^^\n        Array.Find(lambda(), x => true); // Compliant\n    }\n\n    public static void SpecialPattern(int[] data)\n    {\n        (true ? data : data).FirstOrDefault(x => true); // Noncompliant\n        //                   ^^^^^^^^^^^^^^\n        (data ?? data).FirstOrDefault(x => true); // Noncompliant\n        //             ^^^^^^^^^^^^^^\n        (data ?? (true ? data : data)).FirstOrDefault(x => true); // Noncompliant\n        //                             ^^^^^^^^^^^^^^\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FindInsteadOfFirstOrDefault.Immutable.cs",
    "content": "using System.Collections.Immutable;\nusing System.Linq;\nusing System;\n\npublic class FindInsteadOfFirstOrDefault\n{\n    public static class ImmutableHelperClass\n    {\n        public static ImmutableList<int> DoWorkReturnGroup() => null;\n        public static void DoWorkMethodGroup<T>(Func<Func<T, bool>, T> firstOrDefault) { }\n    }\n\n    public void ListBasic(ImmutableList<int> data)\n    {\n        data.FirstOrDefault(x => true); // Noncompliant {{\"Find\" method should be used instead of the \"FirstOrDefault\" extension method.}}\n        //   ^^^^^^^^^^^^^^\n        data.Find(x => true); // Compliant\n\n        data.FirstOrDefault(); // Compliant\n        data.FirstOrDefault(default(int)); // Compliant\n        data.FirstOrDefault(x => false, default(int)); // Compliant\n    }\n\n    public void ThroughLinq(ImmutableList<int> data)\n    {\n        data.Select(x => x * 2).ToList().FirstOrDefault(x => true); // Noncompliant\n        //                               ^^^^^^^^^^^^^^\n        data.Select(x => x * 2).ToList().Find(x => true); // Compliant\n    }\n\n    public void ThroughFunction()\n    {\n        ImmutableHelperClass.DoWorkReturnGroup().FirstOrDefault(x => true); // Noncompliant\n        //                                       ^^^^^^^^^^^^^^\n        ImmutableHelperClass.DoWorkReturnGroup().Find(x => true); // Compliant\n    }\n\n    public void ThroughLambda(Func<ImmutableList<int>> lambda)\n    {\n        lambda().FirstOrDefault(x => true); // Noncompliant\n        //       ^^^^^^^^^^^^^^\n        lambda().Find(x => true); // Compliant\n    }\n\n    public void WithinALambda()\n    {\n        _ = new Func<ImmutableList<int>, int>(list => list.FirstOrDefault(x => true)); // Noncompliant\n        //                                                 ^^^^^^^^^^^^^^\n    }\n\n    public void AsMethodGroup(ImmutableList<int> data)\n    {\n        ImmutableHelperClass.DoWorkMethodGroup<int>(data.FirstOrDefault); // FN, this raise as a SimpleAccessMemberExpression\n    }\n\n    public void Miscellaneous(ImmutableList<int> data)\n    {\n        _ = nameof(Enumerable.FirstOrDefault); // Compliant\n    }\n\n    public static void Nullable(ImmutableList<int> data = null)\n    {\n        data?.FirstOrDefault(x => true); // Noncompliant\n        //    ^^^^^^^^^^^^^^\n        data?.Find(x => true); // Compliant\n    }\n\n    public static void SpecialPattern(ImmutableList<int> list1, ImmutableList<int> list2, ImmutableList<int> list3)\n    {\n        (true ? list1 : list2).FirstOrDefault(x => true); // Noncompliant\n        //                     ^^^^^^^^^^^^^^\n        (list1 ?? list2).FirstOrDefault(x => true); // Noncompliant\n        //               ^^^^^^^^^^^^^^\n        (list1 ?? (true ? list2 : list3)).FirstOrDefault(x => true); // Noncompliant\n        //                                ^^^^^^^^^^^^^^\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FindInsteadOfFirstOrDefault.Net.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing System;\n\npublic class FindInsteadOfFirstOrDefault\n{\n    public void List(List<int> data)\n    {\n        data.FirstOrDefault(x => true);                 // Noncompliant\n        data.FirstOrDefault(default(int));              // Compliant\n        data.FirstOrDefault(x => false, default(int));  // Compliant\n    }\n\n    public void Array(int[] data)\n    {\n        data.FirstOrDefault(x => true);                 // Noncompliant\n        data.FirstOrDefault(default(int));              // Compliant\n        data.FirstOrDefault(x => false, default(int));  // Compliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FindInsteadOfFirstOrDefault.Net.vb",
    "content": "﻿Imports System.Collections.Generic\nImports System.Linq\nImports System\n\nPublic Class FindInsteadOfFirstOrDefault\n    Public Sub List(data As List(Of Integer))\n        Dim unused = data.FirstOrDefault(Function(x) True)  ' Noncompliant\n        unused = data.FirstOrDefault(0)                     ' Compliant\n        unused = data.FirstOrDefault(Function(x) False, 0)  ' Compliant\n    End Sub\n\n    Public Sub Array(data As Integer())\n        Dim unused = data.FirstOrDefault(Function(x) True)  ' Noncompliant\n        unused = data.FirstOrDefault(0)                     ' Compliant\n        unused = data.FirstOrDefault(Function(x) False, 0)  ' Compliant\n    End Sub\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FindInsteadOfFirstOrDefault.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Linq.Expressions;\n\npublic class FindInsteadOfFirstOrDefault\n{\n    public class Dummy\n    {\n        public object FirstOrDefault() => null;\n        public object FirstOrDefault(Func<int, bool> predicate) => null;\n    }\n\n    public class AnotherDummy\n    {\n        public object FirstOrDefault => null;\n    }\n\n    public void UnrelatedType(Dummy dummy, AnotherDummy anotherDummy)\n    {\n        dummy.FirstOrDefault(); // Compliant\n        dummy.FirstOrDefault(x => true); // Compliant\n\n        _ = anotherDummy.FirstOrDefault;\n\n        // Nullable\n        dummy?.FirstOrDefault(); // Compliant\n        dummy?.FirstOrDefault(x => true); // Compliant\n\n        _ = anotherDummy?.FirstOrDefault;\n    }\n\n    public class MyList : List<int>\n    {\n        public MyList Fluent() => this;\n    }\n\n    public class HiddenList : List<int>\n    {\n        public int? FirstOrDefault(Func<int, bool> predicate) => null;\n    }\n\n    public static class HelperClass\n    {\n        public static List<int> DoWorkReturnGroup() => null;\n        public static void DoWorkMethodGroup<T>(Func<Func<T, bool>, T> firstOrDefault) { }\n\n        public static bool FilterMethod(int nb) => true;\n    }\n\n    public bool FilterMethod(int nb) => true;\n\n    public void ListBasic(List<int> data)\n    {\n        data.FirstOrDefault(x => true); // Noncompliant {{\"Find\" method should be used instead of the \"FirstOrDefault\" extension method.}}\n        //   ^^^^^^^^^^^^^^\n        data.Find(x => true); // Compliant\n\n        data.FirstOrDefault(); // Compliant\n        data.FirstOrDefault(HelperClass.FilterMethod); // Noncompliant\n        //   ^^^^^^^^^^^^^^\n        data.FirstOrDefault(FilterMethod); // Noncompliant\n        //   ^^^^^^^^^^^^^^\n    }\n\n    public void ThroughLinq(List<int> data)\n    {\n        data.Select(x => x * 2).ToList().FirstOrDefault(x => true); // Noncompliant\n        //                               ^^^^^^^^^^^^^^\n        data.Select(x => x * 2).ToList().Find(x => true); // Compliant\n    }\n\n    public void ThroughFunction()\n    {\n        HelperClass.DoWorkReturnGroup().FirstOrDefault(x => true); // Noncompliant\n        //                              ^^^^^^^^^^^^^^\n        HelperClass.DoWorkReturnGroup().Find(x => true); // Compliant\n    }\n\n    public void ThroughLambda(Func<List<int>> lambda)\n    {\n        lambda().FirstOrDefault(x => true); // Noncompliant\n        //       ^^^^^^^^^^^^^^\n        lambda().Find(x => true); // Compliant\n    }\n\n    public void WithinALambda()\n    {\n        _ = new Func<List<int>, int>(list => list.FirstOrDefault(x => true)); // Noncompliant\n        //                                        ^^^^^^^^^^^^^^\n    }\n\n    public void AsMethodGroup(List<int> data)\n    {\n        HelperClass.DoWorkMethodGroup<int>(data.FirstOrDefault); // FN, this raise as a SimpleAccessMemberExpression\n    }\n\n    public void Miscellaneous(List<int> data)\n    {\n        _ = nameof(Enumerable.FirstOrDefault); // Compliant\n    }\n\n    public static void FirstOrdefaultNotHidden(MyList data)\n    {\n        data.FirstOrDefault(x => true); // Noncompliant\n        //   ^^^^^^^^^^^^^^\n        data.Find(x => true); // Compliant\n    }\n\n    public static void FirstOrdefaultHidden(HiddenList data)\n    {\n        data.FirstOrDefault(x => true); // Compliant\n        data.Find(x => true); // Compliant\n    }\n\n    public static void Nullable(List<int> data = null)\n    {\n        data?.FirstOrDefault(x => true); // Noncompliant\n        //    ^^^^^^^^^^^^^^\n        data?.Find(x => true); // Compliant\n    }\n\n    public static void SpecialPattern(List<int> data)\n    {\n        (true ? data : data).FirstOrDefault(x => true); // Noncompliant\n        //                   ^^^^^^^^^^^^^^\n        (data ?? data).FirstOrDefault(x => true); // Noncompliant\n        //             ^^^^^^^^^^^^^^\n        (data ?? (true ? data : data)).FirstOrDefault(x => true); // Noncompliant\n        //                             ^^^^^^^^^^^^^^\n    }\n\n    public static void FluentNullable(MyList data = null)\n    {\n        data.Fluent().Fluent().Fluent().Fluent().FirstOrDefault(x => true); // Noncompliant\n        //                                       ^^^^^^^^^^^^^^\n        data.Fluent().Fluent().Fluent().Fluent()?.FirstOrDefault(x => true); // Noncompliant\n        //                                        ^^^^^^^^^^^^^^\n        data.Fluent().Fluent().Fluent()?.Fluent().FirstOrDefault(x => true); // Noncompliant\n        //                                        ^^^^^^^^^^^^^^\n        data.Fluent().Fluent()?.Fluent().Fluent().FirstOrDefault(x => true); // Noncompliant\n        //                                        ^^^^^^^^^^^^^^\n        data.Fluent()?.Fluent().Fluent().Fluent().FirstOrDefault(x => true); // Noncompliant\n        //                                        ^^^^^^^^^^^^^^\n        data.Fluent().Fluent().Fluent()?.Fluent()?.FirstOrDefault(x => true); // Noncompliant\n        //                                         ^^^^^^^^^^^^^^\n        data.Fluent().Fluent()?.Fluent().Fluent()?.FirstOrDefault(x => true); // Noncompliant\n        //                                         ^^^^^^^^^^^^^^\n        data.Fluent().Fluent()?.Fluent()?.Fluent().FirstOrDefault(x => true); // Noncompliant\n        //                                         ^^^^^^^^^^^^^^\n        data.Fluent()?.Fluent().Fluent().Fluent()?.FirstOrDefault(x => true); // Noncompliant\n        //                                         ^^^^^^^^^^^^^^\n        data.Fluent()?.Fluent().Fluent()?.Fluent().FirstOrDefault(x => true); // Noncompliant\n        //                                         ^^^^^^^^^^^^^^\n        data.Fluent()?.Fluent()?.Fluent().Fluent().FirstOrDefault(x => true); // Noncompliant\n        //                                         ^^^^^^^^^^^^^^\n        data.Fluent().Fluent()?.Fluent()?.Fluent()?.FirstOrDefault(x => true); // Noncompliant\n        //                                          ^^^^^^^^^^^^^^\n        data.Fluent()?.Fluent().Fluent()?.Fluent()?.FirstOrDefault(x => true); // Noncompliant\n        //                                          ^^^^^^^^^^^^^^\n        data.Fluent()?.Fluent()?.Fluent().Fluent()?.FirstOrDefault(x => true); // Noncompliant\n        //                                          ^^^^^^^^^^^^^^\n        data.Fluent()?.Fluent()?.Fluent()?.Fluent().FirstOrDefault(x => true); // Noncompliant\n        //                                          ^^^^^^^^^^^^^^\n        data.Fluent()?.Fluent()?.Fluent()?.Fluent()?.FirstOrDefault(x => true); // Noncompliant\n        //                                           ^^^^^^^^^^^^^^\n    }\n}\n\npublic class ExpressionTree\n{\n    public void InExpressionTree()\n    {\n        Expression<Func<List<int>, int>> firstThree = list => list.FirstOrDefault(el => el == 3); // Compliant (IsInExpressionTree)\n    }\n\n    public List<string> Repro_7964(IQueryable<List<string>> values) =>                 // See https://github.com/SonarSource/sonar-dotnet/issues/7964\n        values.FirstOrDefault(p => p.FirstOrDefault(x => x.Equals(\"a\")) != null); // Compliant - usage in expression tree\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FindInsteadOfFirstOrDefault.vb",
    "content": "Imports System.Collections.Generic\nImports System.Linq\nImports System\n\nModule HelperClass\n    Function DoWorkReturnGroup() As List(Of Integer)\n        Return Nothing\n    End Function\n\n    Sub DoWorkMethodGroup(Of T)(firstOrDefault As Func(Of Func(Of T, Boolean), T))\n    End Sub\n\n    Function FilterMethod(nb As Integer) As Boolean\n        Return true\n    End Function\nEnd Module\n\nPublic Class FindInsteadOfFirstOrDefault\n    Public Class Dummy\n        Public Function FirstOrDefault() As Object\n            Return Nothing\n        End Function\n\n        Public Function FirstOrDefault(predicate As Func(Of Integer, Boolean)) As Object\n            Return Nothing\n        End Function\n    End Class\n\n    Public Class AnotherDummy\n        Public ReadOnly Property FirstOrDefault As Object\n            Get\n                Return Nothing\n            End Get\n        End Property\n    End Class\n\n    Public Sub UnrelatedType(ByVal dummy As Dummy, ByVal anotherDummy As AnotherDummy)\n        Dim unused = dummy.FirstOrDefault() ' Compliant\n        unused = dummy.FirstOrDefault(Function(x) True) ' Compliant\n\n        unused = anotherDummy.FirstOrDefault\n    End Sub\n\n    Public Class MyList\n        Inherits List(Of Integer)\n\n        Public Function Fluent() As MyList\n            Return Me\n        End Function\n    End Class\n\n    Public Class HiddenList\n        Inherits List(Of Integer)\n\n        Public Function FirstOrDefault(predicate As Func(Of Integer, Boolean)) As Integer?\n            Return Nothing\n        End Function\n    End Class\n\n    Public Function FilterMethod(nb As Integer) As Boolean\n        Return True\n    End Function\n\n    Public Sub ListBasic(ByVal data As List(Of Integer))\n        Dim unused = data.FirstOrDefault(Function(x) True) ' Noncompliant\n        '                 ^^^^^^^^^^^^^^\n        unused = data.Find(Function(x) True) ' Compliant\n\n        unused = data.FirstOrDefault() ' Compliant\n        unused = data.FirstOrDefault(AddressOf HelperClass.FilterMethod) ' Noncompliant\n        '             ^^^^^^^^^^^^^^\n        unused = data.FirstOrDefault(AddressOf FilterMethod) ' Noncompliant\n        '             ^^^^^^^^^^^^^^\n    End Sub\n\n    Public Sub ThroughLinq(data As List(Of Integer))\n        data.[Select](Function(x) x * 2).ToList().FirstOrDefault(Function(x) True) ' Noncompliant {{\"Find\" method should be used instead of the \"FirstOrDefault\" extension method.}}\n        '                                         ^^^^^^^^^^^^^^\n        data.[Select](Function(x) x * 2).ToList().Find(Function(x) True) ' Compliant\n    End Sub\n\n    Public Sub ThroughFunction()\n        Dim unused = HelperClass.DoWorkReturnGroup().FirstOrDefault(Function(x) True) ' Noncompliant\n        '                                            ^^^^^^^^^^^^^^\n        unused = HelperClass.DoWorkReturnGroup().Find(Function(x) True) ' Compliant\n    End Sub\n\n    Public Sub ThroughLambda(lambda As Func(Of List(Of Integer)))\n        Dim unused = lambda().FirstOrDefault(Function(x) True) ' Noncompliant\n        '                     ^^^^^^^^^^^^^^\n        unused = lambda().Find(Function(x) True) ' Compliant\n    End Sub\n\n    Public Sub WithinALambda()\n        Dim unused = New Func(Of List(Of Integer), Integer)(Function(list) list.FirstOrDefault(Function(x) True)) ' Noncompliant\n        '                                                                       ^^^^^^^^^^^^^^\n    End Sub\n\n    Public Sub AsMethodGroup(data As List(Of Integer))\n        HelperClass.DoWorkMethodGroup(Of Integer)(AddressOf data.FirstOrDefault) ' FN\n    End Sub\n\n    Public Sub SpecialPattern(data As List(Of Integer))\n        Dim unused = (If(True, data, data)).FirstOrDefault(Function(x) True) ' Noncompliant\n        '                                   ^^^^^^^^^^^^^^\n        unused = (If(data, data)).FirstOrDefault(Function(x) True) ' Noncompliant\n        '                         ^^^^^^^^^^^^^^\n        unused = (If(data, (If(True, data, data)))).FirstOrDefault(Function(x) True) ' Noncompliant\n        '                                           ^^^^^^^^^^^^^^\n    End Sub\n\n    Public Sub Fluent(data As MyList)\n        data.Fluent().Fluent().Fluent().Fluent().FirstOrDefault(Function(x) True) ' Noncompliant\n        '                                        ^^^^^^^^^^^^^^\n        data.Fluent().Fluent().Fluent().Fluent()?.FirstOrDefault(Function(x) True) ' Noncompliant\n        '                                         ^^^^^^^^^^^^^^\n        data.Fluent().Fluent().Fluent()?.Fluent().FirstOrDefault(Function(x) True) ' Noncompliant\n        '                                         ^^^^^^^^^^^^^^\n        data.Fluent().Fluent()?.Fluent().Fluent().FirstOrDefault(Function(x) True) ' Noncompliant\n        '                                         ^^^^^^^^^^^^^^\n        data.Fluent()?.Fluent().Fluent().Fluent().FirstOrDefault(Function(x) True) ' Noncompliant\n        '                                         ^^^^^^^^^^^^^^\n        data.Fluent().Fluent().Fluent()?.Fluent()?.FirstOrDefault(Function(x) True) ' Noncompliant\n        '                                          ^^^^^^^^^^^^^^\n        data.Fluent().Fluent()?.Fluent().Fluent()?.FirstOrDefault(Function(x) True) ' Noncompliant\n        '                                          ^^^^^^^^^^^^^^\n        data.Fluent().Fluent()?.Fluent()?.Fluent().FirstOrDefault(Function(x) True) ' Noncompliant\n        '                                          ^^^^^^^^^^^^^^\n        data.Fluent()?.Fluent().Fluent().Fluent()?.FirstOrDefault(Function(x) True) ' Noncompliant\n        '                                          ^^^^^^^^^^^^^^\n        data.Fluent()?.Fluent().Fluent()?.Fluent().FirstOrDefault(Function(x) True) ' Noncompliant\n        '                                          ^^^^^^^^^^^^^^\n        data.Fluent()?.Fluent()?.Fluent().Fluent().FirstOrDefault(Function(x) True) ' Noncompliant\n        '                                          ^^^^^^^^^^^^^^\n        data.Fluent().Fluent()?.Fluent()?.Fluent()?.FirstOrDefault(Function(x) True) ' Noncompliant\n        '                                           ^^^^^^^^^^^^^^\n        data.Fluent()?.Fluent().Fluent()?.Fluent()?.FirstOrDefault(Function(x) True) ' Noncompliant\n        '                                           ^^^^^^^^^^^^^^\n        data.Fluent()?.Fluent()?.Fluent().Fluent()?.FirstOrDefault(Function(x) True) ' Noncompliant\n        '                                           ^^^^^^^^^^^^^^\n        data.Fluent()?.Fluent()?.Fluent()?.Fluent().FirstOrDefault(Function(x) True) ' Noncompliant\n        '                                           ^^^^^^^^^^^^^^\n        data.Fluent()?.Fluent()?.Fluent()?.Fluent()?.FirstOrDefault(Function(x) True) ' Noncompliant\n        '                                            ^^^^^^^^^^^^^^\n    End Sub\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FlagsEnumWithoutInitializer.cs",
    "content": "﻿using System;\nnamespace Tests.Diagnostics\n{\n    [System.Flags]\n    enum FruitType    // Noncompliant {{Initialize all the members of this 'Flags' enumeration.}}\n//       ^^^^^^^^^\n    {\n        Banana,\n        Orange = 5,\n        Strawberry\n    }\n    enum FruitType2    // Compliant\n    {\n        Banana,\n        Orange,\n        Strawberry\n    }\n\n    [Flags]\n    enum FruitType3    // Compliant\n    {\n        Banana=1,\n        Orange =4,\n        Strawberry =5\n    }\n\n    [System.Flags]\n    enum FruitType4\n    {\n        Banana,\n        Orange,\n        Strawberry = 5\n    }\n\n    [System.Flags]\n    enum FruitType5\n    {\n        Banana,\n        Orange,\n        Strawberry\n    }\n\n    [System.Flags]\n    enum FruitType6 // Noncompliant\n    {\n        None,\n        Banana,\n        Orange,\n        Strawberry\n    }\n\n    [System.Flags]\n    enum FruitType7 // Noncompliant\n    {\n        Banana,\n        Orange,\n        Apple,\n        Pear,\n        Strawberry = 5\n    }\n\n    [System.Flags]\n    enum FruitType8 // Noncompliant\n    {\n        Banana = 1,\n        Orange,\n        Strawberry\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FlagsEnumWithoutInitializer.vb",
    "content": "﻿Namespace Tests.Diagnostics\n\n    <System.Flags()>\n    Enum FruitType    ' Noncompliant {{Initialize all the members of this 'Flags' enumeration.}}\n'        ^^^^^^^^^\n        Banana\n        Orange = 5\n        Strawberry\n    End Enum\n\n    Enum FruitType2    ' Compliant\n        Banana\n        Orange\n        Strawberry\n    End Enum\n\n    <System.Flags()>\n    Enum FruitType3\n        Banana = 1\n        Orange = 3\n        Strawberry = 4\n    End Enum\n\n    <System.Flags()>\n    Enum FruitType4\n        Banana\n        Orange\n        Strawberry = 4\n    End Enum\n\n    <System.Flags()>\n    Enum FruitType5\n        Banana\n        Orange\n        Strawberry\n    End Enum\n\n    <System.Flags()>\n    Enum FruitType6 ' Noncompliant\n        None\n        Banana\n        Orange\n        Strawberry\n    End Enum\nEnd Namespace"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FlagsEnumZeroMember.cs",
    "content": "﻿namespace Tests.Diagnostics\n{\n    [System.Flags]\n    enum X\n    {\n        Zero = 0, // Noncompliant {{Rename 'Zero' to 'None'.}}\n//      ^^^^^^^^\n        One = 1\n    }\n    [System.Flags]\n    enum Y\n    {\n        None = 0\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FlagsEnumZeroMember.vb",
    "content": "﻿Imports System\n\nNamespace Tests.Diagnostics\n\n    <System.Flags>\n    Enum F1\n        Zero = 0 'Noncompliant ^9#8 {{Rename 'Zero' to 'None'.}}\n        One = 1\n    End Enum\n\n    <Flags>\n    Enum F2\n        None = 0\n    End Enum\n\n    <Flags>\n    Enum F3\n        None = 0\n        Four = 4\n    End Enum\n\n    <Flags>\n    Enum F5 As ULong\n        First = ULong.MaxValue\n        Last = 0\n    End Enum\n\n    Enum NotFlags\n        Zero = 0\n        One = 1\n    End Enum\n\n    Enum NoZeroMember\n        First = 1\n        Second  'This has value 2\n    End Enum\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ForLoopConditionAlwaysFalse.CSharp11.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        void LoopTest(int x, int y)\n        {\n            for (IntPtr i = 9; i >= 5;) { } // Compliant\n            for (UIntPtr i = 9; i >= 5;) { } // Compliant\n\n            for (IntPtr b = 1; b < 1;) { } // Noncompliant\n            for (UIntPtr b = 1; b < 1;) { } // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ForLoopConditionAlwaysFalse.CSharp9.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        void LoopTest(int x, int y)\n        {\n            for (nint i = 9; i >= 5;) { } // Compliant\n            for (nuint i = 9; i >= 5;) { } // Compliant\n\n            for (nint b = 1; b < 1;) { } // Noncompliant\n            for (nuint b = 1; b < 1;) { } // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ForLoopConditionAlwaysFalse.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        void LoopTest(int x, int y)\n        {\n            for (var i = x; true;) { }\n            for (var i = x; false;) { } // Noncompliant {{This loop will never execute.}}\n            for (var i = x; !false;) { }\n            for (var i = x; !!false;) { } // Noncompliant\n            for (var i = x; true;) { }\n            for (var i = x; !true;) { } // Noncompliant\n            for (var i = x; ((!true));) { } // Noncompliant\n            for (var i = x; (!(!true));) { }\n            for (var i = x; !(!(!(true)));) { } // Noncompliant\n\n            for (var i = 1; i < 5;) { }\n            for (var i = 9; i < 5;) { } // Noncompliant\n            for (var i = 9; i > 5;) { }\n            for (var i = 1; i > 5;) { } // Noncompliant\n            for (var i = 1; i <= 5;) { }\n            for (var i = 9; i <= 5;) { } // Noncompliant\n            for (var i = 9; i >= 5;) { }\n            for (var i = 1; i >= 5;) { } // Noncompliant\n            for (var i = 1; i == 1;) { }\n            for (var i = 1; i == 2;) { } // Noncompliant\n            for (var i = 1; i != 2;) { }\n            for (var i = 1; i != 1;) { } // Noncompliant\n            for (var i = 1; i != x;) { }\n            for (var i = x; i < 5;) { }\n            for (var i = 1; i < x;) { }\n            for (var i = 1; i < -x;) { }\n\n            for (int a = 0, b = 1; a >= 0;) { }\n            for (int a = 0, b = 1; a >= 1;) { } // Noncompliant\n            for (int a = 0, b = 1; b >= 1;) { }\n            for (int a = 0, b = 1; b < 1;) { } // Noncompliant\n\n            int c = 0;\n            for (c = 1; c > 0;) { }\n            for (c = 1; c > 2;) { } // Noncompliant\n\n            for (var i = x; !(y == 1);) { }\n            for (x++; y < 5;) { }\n            for (int i; i < 5;) { }\n            for (var i = 1; ;) { }\n            for (var i = 0; i < 0x10;) { }\n            for (var i = 0; i > 0x10;) { } // Noncompliant\n            for (var i = 0; i < 0b10;) { }\n            for (var i = 1; i <= 0Xffff; i++) { }\n\n            var z = 0;\n            for (int i = 0; i < z; i++) { } // FN - we only check for literals in the condition\n            for (; z < 0; z++) { } // FN - we only check for initializers inside the loop statement\n\n            // Reproducer for https://github.com/SonarSource/sonar-dotnet/issues/5428\n            for (float n = 0.0F; n > -0.1F; n -= 0.005F) { } // Compliant\n            for (double n = 0.0; n > -0.1; n -= 0.005) { } // Compliant\n            for (var n = 0.0; n > -0.1; n -= 0.005) { } // Compliant\n            for (decimal n = 0.0M; n > -0.1M; n -= 0.005M) { } // Compliant\n\n            for (float n = -0.16F; n == -0.23F;) { } // Noncompliant\n            for (double n = -0.42; n != -0.42;) { } // Noncompliant\n            for (var n = 0.0; n <= -0.1; n -= 0.005) { } // Noncompliant\n            for (decimal n = 0.0M; n <= -0.1M; n -= 0.005M) { } // Noncompliant\n\n            for (var i = 9; i < 4 - 2;) { } // FN\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ForLoopCounterChanged.Latest.cs",
    "content": "﻿public struct S\n{\n    public void LoopCounterChange((int, int) t)\n    {\n        for (int i = 0; i < 42; i++)\n        {\n            (i, var j) = t; // Noncompliant {{Do not update the stop condition variable 'i' in the body of the for loop.}}\n//           ^\n            (_, i) = (1, 2); // Noncompliant {{Do not update the stop condition variable 'i' in the body of the for loop.}}\n            (_, (_, i, _)) = (1, (2, 3, 4)); // Noncompliant {{Do not update the stop condition variable 'i' in the body of the for loop.}}\n            (i, j) = (i, 2); // Noncompliant FP\n        }\n\n        for (int i = 0, j = 0; i < 42; i++, j++)\n        {\n            (i, j) = (1, 2); // Noncompliant\n//           ^\n        }\n\n        // loop variable shadowed in local function:\n        for (int i = 0; i < 42; i++)\n        {\n            void M(int i)\n            {\n                (i, _) = (1, 2); // Compliant, this \"i\" is not a loop variable\n            }\n\n        }\n\n        // Loop variable shadowed by re-declaration.\n        for (int i = 0; i < 42; i++)\n        {\n            var (i, j) = (1, 2);        // Error [CS0136] - FN - we still check for SonarLint as it analyzes also code with compile errors.\n            _ = (1, 2) is var (i, b);   // Error [CS0128] - FN - we still check for SonarLint as it analyzes also code with compile errors.\n        }\n\n        var z = (a: 1, b: 2);\n        for (var i = (a: 1, b: 2); i is (a: < 10, _); i = (++i.a, ++i.b))\n        {\n            i = (1, 1); // Noncompliant\n            i.a = 1;    // FN\n            z.a = 1;    // Compliant\n        }\n\n        for (var (i, j, _) = (0, 0, 0); i < 10; ++i, ++j)\n        {\n            i = 0;  // Noncompliant\n            _ = 0;  // Compliant. This discard does not refer to the other one.\n        }\n\n        for ((int i, int j, var _, _) = (0, 0, 0, 0); i < 10; ++i, ++j)\n        {\n            i = 0;  // Noncompliant\n            _ = 0;  // Compliant. This discard does not refer to the other ones.\n        }\n\n        int k, l, m;\n        for ((k, l) = (0, 0), m = 0; k < 10; ++k, ++l)\n        {\n            k = 0; // Noncompliant\n            m = 0; // Compliant\n        }\n\n        for (int i = 0; i < 42; i++)\n        {\n            int a = 10;\n            (a, var j) = t;\n        }\n    }\n\n    public void LocalNamedAsDiscard()\n    {\n        int i, _;\n        for ((i, _) = (0, 0); i < 10; ++i)\n        {\n            _ = 0; // Compliant.  _ is not in the stop condition (i < 10), even though it is a local reference\n        }\n    }\n}\n\npublic class SomeClass\n{\n    private int i;\n\n    // https://sonarsource.atlassian.net/browse/NET-2658\n    public void CSharp11Compound((int, int) t)\n    {\n        for (int i = 0; i < 42; i++)\n        {\n            i >>>= 1; // Noncompliant\n        }\n    }\n\n    // https://sonarsource.atlassian.net/browse/NET-3600\n    public void NullConditionalAssignment(SomeClass arg)\n    {\n        for (arg?.i = 0; arg.i < 3; arg.i++)\n        {\n            arg.i = 1; // FN\n        }\n    }\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ForLoopCounterChanged.cs",
    "content": "﻿namespace Tests.Diagnostics\n{\n    public class ForLoopCounterChanged\n    {\n        class Helper\n        {\n            public int i { get; set; }\n            public int[] j { get; set; }\n        }\n\n        public ForLoopCounterChanged()\n        {\n            for (int a2 = 0; a2 < 42; a2++)\n            {\n                a2 = 0; // Noncompliant {{Do not update the stop condition variable 'a2' in the body of the for loop.}}\n//              ^^\n            }\n\n            int a;\n            for (a = 0; a < 42; a++)\n            {\n                a = 0; // Noncompliant\n            }\n\n            for (int d = 0, e = 0; d < 42; d++)\n            {\n                a++;\n                d = 0; // Noncompliant\n                e = 0;  // Compliant: e is not a loop counter: neither in the condition, nor in the incrementor\n            }\n\n            int g;\n            for (int f = 0; f < 42; f++)\n            {\n                f = 0; // Noncompliant\n                g = 0;\n                for (g = 0; g < 42; g++)\n                {\n                    g = 0; // Noncompliant\n                    f = 0; // Noncompliant\n                }\n                f = 0; // Noncompliant\n                g = 0; // Compliant\n            }\n\n            g = 0;\n\n            for (int h = 0; h < 42; h++)\n            {\n                h = // Noncompliant\n                h = // Noncompliant\n                0;\n            }\n\n            g++;\n            ++g;\n            g = 0;\n\n            for (int i = 0; i < 42; i++)\n            {\n                i++; // Noncompliant\n                --i; // Noncompliant\n                ++i; // Noncompliant\n                i--; // Noncompliant\n                i = 1; // Noncompliant\n                i += 1; // Noncompliant\n                i -= 1; // Noncompliant\n                i *= 1; // Noncompliant\n                i /= 1; // Noncompliant\n                i %= 1; // Noncompliant\n                i &= 1; // Noncompliant\n                i |= 1; // Noncompliant\n                i ^= 1; // Noncompliant\n                i <<= 1; // Noncompliant\n                i >>= 1; // Noncompliant\n            }\n\n            for (int j = 0; j < 42; j++)\n            {\n                for (var k = 0; j++ < 42; k++) // Noncompliant\n                {\n                }\n            }\n\n            for (int i = 0; i < 42; i++)\n            {\n                var x = (int)i;\n            }\n\n            var s1 = new Helper { i = 0, j = new int[] { 0, 1 } };\n\n            for (s1.i = 0; s1.i < 3; s1.i++)\n            {\n                s1.i = 1; // FN\n                s1.j[0]++;\n            }\n\n            for (s1.j[1] = 0; s1.j[1] < 3; s1.j[1]++)\n            {\n                s1.i++;\n                s1.j[0]++;\n                s1.j[1]++; // Not detected\n            }\n\n            var a1 = new int[] { 0, 1 };\n\n            for (a1[0] = 0; a1[0] < 3; a1[0]++)\n            {\n                a1[0] = 1; // Not detected\n                a1[1] = 1;\n            }\n            {\n                int i = 0;\n                for (; i > 0; i++)\n                {\n                    i = 1; // Noncompliant\n                }\n\n                for (i = 0; i < 3; i++)\n                {\n                    s1.i = 1;\n                }\n            }\n\n            foreach (object element in new object[0])\n            {\n                var e = element;\n                e = null;\n            }\n\n            for (int readIndex = 0, writeIndex = 0; readIndex < 10; readIndex++)\n            {\n                writeIndex++; // Compliant\n            }\n\n            var limit = 10;\n            for (var i2 = 0; i2 < limit; i2++)\n            {\n                limit = 5; // Compliant - limit is not a loop counter (not in the incrementor)\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ForLoopCounterCondition.cs",
    "content": "﻿namespace Tests.Diagnostics\n{\n    public class ForLoopCounterCondition\n    {\n        private int someMethod(HelperClass o)\n        {\n            return o.Property;\n        }\n\n        public class HelperClass\n        {\n            public int Property { get; set; }\n        }\n\n        public int P;\n        public ForLoopCounterCondition()\n        {\n            int k, j = 3;\n            for (int i = 0; i < 10; i++)\n            {\n\n            }\n            for (P = 0; P < 10; P++)\n            {\n\n            }\n\n            for (int a = 0, b = 5; a + b < 10; a++, b += a)\n            {\n                //do some stuff\n            }\n\n            for (int i = 0; i < 5; )\n            {\n\n            }\n\n            for (int i = 0; i < 10; j++) //Noncompliant {{This loop's stop condition tests 'i' but the incrementer updates 'j'.}}\n//                          ^^^^^^\n            {\n\n            }\n            for (int i = 0; ; i++) //Noncompliant {{This loop's stop incrementer updates 'i' but the stop condition doesn't test any variables.}}\n            {\n\n            }\n\n            var o = new HelperClass();\n            for (k = 0; someMethod(o) < 10; P++, j++, o.Property--, someMethod(o)) //Compliant\n            {\n                o.Property = P;\n            }\n\n            for (k = 0; k < 10; o.Property--) //Noncompliant\n            {\n                o.Property = P;\n            }\n\n            for (k = 0; someMethod(o) < 10; o.Property--)\n            {\n                o.Property = P;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ForLoopIncrementSign.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class ForLoopIncrementSign\n    {\n        private int number = 10;\n\n        public void TestMethod(int x, int y, int z)\n        {\n            for (; ; ) { }\n            for (; x < y;) { }\n            for (; x < y ; z++) { }\n            for (int i=0; i < x; this.number++) { }\n\n\n            for (int i = x; i < y; i++) { }\n            for (int i = x; i > y; i++) { }\n//                                 ^^^ Noncompliant {{'i' is incremented and will never reach 'stop condition'.}}\n//                          ^^^^^ Secondary@-1\n            for (int i = x; i >= y; i++) { } // Noncompliant\n// Secondary@-1\n            for (int i = x; i < y; ++i) { }\n            for (int i = x; i > y; ++i) { } // Noncompliant\n// Secondary@-1\n            for (int i = x; i > y; --i) { }\n            for (int i = x; i < y; --i) { } // Noncompliant\n// Secondary@-1\n            for (int i = x; i > y; i--) { }\n            for (int i = x; i < y; --i) { }\n//                                 ^^^ Noncompliant {{'i' is decremented and will never reach 'stop condition'.}}\n//                          ^^^^^ Secondary@-1\n            for (int i = x; i <= y; i--) { } // Noncompliant\n// Secondary@-1\n\n            for (int i = x; y > i; i++) { }\n            for (int i = x; y < i; i++) { } // Noncompliant\n// Secondary@-1\n            for (int i = x; y <= i; i++) { } // Noncompliant\n// Secondary@-1\n\n            for (int i = x; y < i; i--) { }\n            for (int i = x; y > i; i--) { } // Noncompliant\n// Secondary@-1\n            for (int i = x; y >= i; i--) { } // Noncompliant\n// Secondary@-1\n\n            for (int i = x; x < y; i--) { }\n            for (int i = x; x > y; i--) { }\n\n            for (int i = x; i > y; i -= 1) { }\n            for (int i = x; i > y; i += 1) { } // Noncompliant\n// Secondary@-1\n\n            for (int i = x; i < y; i += 1) { }\n            for (int i = x; i < y; i -= 1) { } // Noncompliant\n// Secondary@-1\n\n            for (int i = x; i > y; i -= +1) { }\n            for (int i = x; i > y; i += -x) { }\n            for (int i = x; i > y; i += z) { }\n\n            for (int i = x; i > y; i = i - 1) { }\n            for (int i = x; i > y; i = i + 1) { } // Noncompliant\n// Secondary@-1\n\n            for (int i = x; i < y; i = i + 1) { }\n            for (int i = x; i < y; i = i - 1) { } // Noncompliant\n// Secondary@-1\n\n            for (int i = x; i > y; i = i + z) { }\n            for (int i = x; i > y; i = z + 1) { }\n            for (int i = x; i > y; i = i * 2) { }\n            for (int i = x; i > y; i = i - z) { }\n\n            var point = new Point();\n            for (int i = x; i > y; point.X = i + 1) { }\n            for (int i = x; i + 1 < y; i++) { }\n            for (int i = x; i < y;) { }\n            for (int i = x; i > y; Update()) { }\n            for (int i = x; Condition(); i++) { }\n            for (int i = x; ; i++) { }\n            for (int i = x; i < y && x > 2; i++) { }\n            for (int i = x; i < y && x > 2; i++, x++) { }\n            for (int i = 0, j = 0; i < y; i++) { }\n        }\n\n        private void Update()\n        {\n        }\n\n        private bool Condition()\n        {\n            return true;\n        }\n    }\n\n    public class Point\n    {\n        public int X { get; set; }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ForeachLoopExplicitConversion.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Tests.Diagnostics\n{\n    interface I { }\n    class A : I { }\n    class B : A { }\n    class ForeachLoopExplicitConversion\n    {\n        public void S(string s)\n        {\n            foreach (var item in s)\n            { }\n            foreach (int item in s)\n            { }\n            foreach (A item in s) // Compliant // Error [CS0030] - cannot convert\n            { }\n        }\n        public void M1(IEnumerable<int> enumerable)\n        {\n            foreach (int i in enumerable)\n            { }\n            foreach (var i in enumerable)\n            { }\n            foreach (object i in enumerable)\n            { }\n        }\n        public void M2(IEnumerable<A> enumerable)\n        {\n            foreach (A i in enumerable)\n            { }\n            foreach (var i in enumerable)\n            { }\n            foreach (B i in enumerable.OfType<B>()) // Fixed\n            { }\n        }\n        public void M3(A[] array)\n        {\n            foreach (A i in array)\n            { }\n            foreach (I i in array)\n            { }\n            foreach (B i in array.OfType<B>()) // Fixed\n            { }\n        }\n        public void M4(A[][] array)\n        {\n            foreach (A[] i in array)\n            { }\n            foreach (object[] i in array)\n            { }\n            foreach (var i in array)\n            { }\n            foreach (B[] i in array.OfType<B[]>()) // Fixed\n            { }\n        }\n        public void M5(ArrayList list)\n        {\n            foreach (A i in list)\n            { }\n            foreach (var i in list)\n            { }\n            foreach (object i in list)\n            { }\n            foreach (B i in list)\n            { }\n        }\n    }\n\n    public interface IMyInterface\n    { }\n\n    public class Base\n    {\n\n    }\n    public class Derived : Base, IMyInterface\n    { }\n\n    public class OtherType\n    {\n        public static implicit operator OtherType(Derived self)\n        {\n            return null;\n        }\n    }\n\n    class MyTest\n    {\n        public void Test()\n        {\n            foreach (Derived x in new Base[12].OfType<Derived>()) { } // Fixed\n            foreach (Derived x in new object[12]) { }\n\n            foreach (Derived x in new List<Base>().OfType<Derived>()) { } // Fixed\n            foreach (Derived x in new List<object>()) { }\n            foreach (Base x in new List<Derived>()) { }\n            foreach (Derived x in new List<IMyInterface>().OfType<Derived>()) { } // Fixed\n\n            foreach (Derived x in new ArrayList()) { }\n            //We decided to not add the necessary complexity to recognize the following corner case\n            foreach (OtherType x in new List<Base>()) { } // Compliant, although it can throw\n\n            foreach (OtherType x in new List<Derived>()) { }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ForeachLoopExplicitConversion.Latest.Fixed.cs",
    "content": "﻿global using System.Collections;\nglobal using System.Collections.Generic;\n\nnamespace Tests.Diagnostics;\n\nusing System;\nusing System.Linq;\n\npublic interface I { }\npublic class A : I { }\npublic class B : A { }\n\nrecord Record\n{\n    public void M2(IEnumerable<A> enumerable)\n    {\n        foreach (A i in enumerable)\n        { }\n        foreach (var i in enumerable)\n        { }\n        foreach (B i in enumerable.OfType<B>()) // Fixed\n        { }\n    }\n}\nrecord struct RecordStruct\n{\n    public void M3(A[] array)\n    {\n        foreach (A i in array)\n        { }\n        foreach (I i in array)\n        { }\n        foreach (B i in array.OfType<B>()) // Fixed\n        { }\n    }\n}\n\npublic class FieldKeyword\n{\n    public A[] Values\n    {\n        get\n        {\n            foreach (B b in field.OfType<B>())  // Fixed\n            { }\n            return [];\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ForeachLoopExplicitConversion.Latest.cs",
    "content": "﻿global using System.Collections;\nglobal using System.Collections.Generic;\n\nnamespace Tests.Diagnostics;\n\nusing System;\n\npublic interface I { }\npublic class A : I { }\npublic class B : A { }\n\nrecord Record\n{\n    public void M2(IEnumerable<A> enumerable)\n    {\n        foreach (A i in enumerable)\n        { }\n        foreach (var i in enumerable)\n        { }\n        foreach (B i in enumerable) // Noncompliant {{Either change the type of 'i' to 'A' or iterate on a generic collection of type 'B'.}}\n//               ^\n            { }\n    }\n}\nrecord struct RecordStruct\n{\n    public void M3(A[] array)\n    {\n        foreach (A i in array)\n        { }\n        foreach (I i in array)\n        { }\n        foreach (B i in array) // Noncompliant\n        { }\n    }\n}\n\npublic class FieldKeyword\n{\n    public A[] Values\n    {\n        get\n        {\n            foreach (B b in field)  // Noncompliant\n            { }\n            return [];\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ForeachLoopExplicitConversion.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    interface I { }\n    class A : I { }\n    class B : A { }\n    class ForeachLoopExplicitConversion\n    {\n        public void S(string s)\n        {\n            foreach (var item in s)\n            { }\n            foreach (int item in s)\n            { }\n            foreach (A item in s) // Compliant // Error [CS0030] - cannot convert\n            { }\n        }\n        public void M1(IEnumerable<int> enumerable)\n        {\n            foreach (int i in enumerable)\n            { }\n            foreach (var i in enumerable)\n            { }\n            foreach (object i in enumerable)\n            { }\n        }\n        public void M2(IEnumerable<A> enumerable)\n        {\n            foreach (A i in enumerable)\n            { }\n            foreach (var i in enumerable)\n            { }\n            foreach (B i in enumerable) // Noncompliant {{Either change the type of 'i' to 'A' or iterate on a generic collection of type 'B'.}}\n//                   ^\n            { }\n        }\n        public void M3(A[] array)\n        {\n            foreach (A i in array)\n            { }\n            foreach (I i in array)\n            { }\n            foreach (B i in array) // Noncompliant\n            { }\n        }\n        public void M4(A[][] array)\n        {\n            foreach (A[] i in array)\n            { }\n            foreach (object[] i in array)\n            { }\n            foreach (var i in array)\n            { }\n            foreach (B[] i in array) // Noncompliant\n            { }\n        }\n        public void M5(ArrayList list)\n        {\n            foreach (A i in list)\n            { }\n            foreach (var i in list)\n            { }\n            foreach (object i in list)\n            { }\n            foreach (B i in list)\n            { }\n        }\n    }\n\n    public interface IMyInterface\n    { }\n\n    public class Base\n    {\n\n    }\n    public class Derived : Base, IMyInterface\n    { }\n\n    public class OtherType\n    {\n        public static implicit operator OtherType(Derived self)\n        {\n            return null;\n        }\n    }\n\n    class MyTest\n    {\n        public void Test()\n        {\n            foreach (Derived x in new Base[12]) { } // Noncompliant\n            foreach (Derived x in new object[12]) { }\n\n            foreach (Derived x in new List<Base>()) { } // Noncompliant\n            foreach (Derived x in new List<object>()) { }\n            foreach (Base x in new List<Derived>()) { }\n            foreach (Derived x in new List<IMyInterface>()) { } // Noncompliant\n\n            foreach (Derived x in new ArrayList()) { }\n            //We decided to not add the necessary complexity to recognize the following corner case\n            foreach (OtherType x in new List<Base>()) { } // Compliant, although it can throw\n\n            foreach (OtherType x in new List<Derived>()) { }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FrameworkTypeNaming.cs",
    "content": "﻿using System;\nnamespace Tests.Diagnostics\n{\n    class MyAttribute : Attribute\n    {\n\n    }\n    class AttributeOne : Attribute // Noncompliant {{Make this class name end with 'Attribute'.}}\n//        ^^^^^^^^^^^^\n    {\n\n    }\n    class ExceptionOne : Exception // Noncompliant\n    {\n\n    }\n    class MyEventArgsOne : EventArgs // Noncompliant\n    {\n\n    }\n    class MyEventArgs\n    {\n\n    }\n\n    class ExceptionTwo : ExceptionOne // Compliant, the base class doesn't correspond to the naming convention\n    {\n\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FunctionComplexity.Latest.cs",
    "content": "﻿// Noncompliant [0]\nusing System.Dynamic;\n\nif (false) { }  // Secondary [0] {{+1}}\n\nvoid TopLevelLocalFunction()\n{\n    if (false) // Secondary [0] {{+1}}\n    { }\n    if (false) // Secondary [0] {{+1}}\n    { }\n    if (false) // Secondary [0] {{+1}}\n    { }\n}\n\n// Static local functions do not count in the overall top level statement cyclomatic complexity computation.\n// They are considered methods by themselves with their own complexity score.\n// See: https://github.com/SonarSource/sonar-dotnet/issues/5625\nstatic void StaticTopLevelLocalFunction() // Noncompliant [1]\n                                          // Secondary@-1 [1] {{+1}}\n{\n    if (false) // Secondary [1] {{+1}}\n    { }\n    if (false) // Secondary [1] {{+1}}\n    { }\n    if (false) // Secondary [1] {{+1}}\n    { }\n}\n\npublic record FunctionComplexity\n{\n    public void M1()\n    {\n        if (false)\n        { }\n        if (false)\n        { }\n    }\n\n    public void M2() // Noncompliant [2]\n                     // Secondary@-1 [2] {{+1}}\n    {\n        if (false) // Secondary [2] {{+1}}\n        { }\n        if (false) // Secondary [2] {{+1}}\n        { }\n        if (false) // Secondary [2] {{+1}}\n        { }\n    }\n\n    public bool PatternMatchingAnd(object arg) =>\n        //      ^^^^^^^^^^^^^^^^^^                    Noncompliant [3]\n        //      ^^^^^^^^^^^^^^^^^^                    Secondary@-1 [3] {{+1}}\n        arg is true\n            and true\n        //  ^^^                                       Secondary [3] {{+1}}\n            and true\n        //  ^^^                                       Secondary [3] {{+1}}\n            and true;\n        //  ^^^                                       Secondary [3] {{+1}}\n\n    public bool PatternMatchingOr(object arg) =>\n        //      ^^^^^^^^^^^^^^^^^                     Noncompliant [4]\n        //      ^^^^^^^^^^^^^^^^^                     Secondary@-1 [4] {{+1}}\n        arg is not true\n            or true\n        //  ^^                                        Secondary [4] {{+1}}\n            or true\n        //  ^^                                        Secondary [4] {{+1}}\n            or true;\n        //  ^^                                        Secondary [4] {{+1}}\n\n    public int Property\n    {\n        get\n        {\n            return 0;\n        }\n        init               // Noncompliant [5]\n                           // Secondary@-1 [5] {{+1}}\n        {\n            if (false)     // Secondary [5] {{+1}}\n            { }\n            if (false)     // Secondary [5] {{+1}}\n            { }\n            if (false)     // Secondary [5] {{+1}}\n            { }\n        }\n    }\n}\n\npublic struct A\n{\n    const string Prefix = \"_\";\n    const string Suffix = \"_\";\n\n    private (int, int) t = default;\n\n    public A()\n    {\n        int a;\n        (a, var b) = t;\n        const string z = $\"{Prefix} zzz {Suffix}\";\n    }\n}\n\npublic struct B\n{\n    const string Prefix = \"_\";\n    const string Suffix = \"_\";\n\n    private (int, int) t = default;\n\n    public B() // Noncompliant [6]\n               // Secondary@-1 [6]\n    {\n        int a;\n        if (false      // Secondary [6]\n            || true    // Secondary [6]\n            || false)  // Secondary [6]\n        {\n            (a, var b) = t;\n            const string z = $\"{Prefix} zzz {Suffix}\";\n        }\n    }\n}\n\npublic class LocalFunctions\n{\n    public void MethodWithLocalfunctions() // Noncompliant [7] {{The Cyclomatic Complexity of this method is 4 which is greater than 3 authorized.}}\n                                           // Secondary@-1 [7] {{+1}}\n    {\n        void LocalFunction()\n        {\n            if (false) // Secondary [7] {{+1}}\n            { }\n            if (false) // Secondary [7] {{+1}}\n            { }\n            if (false) // Secondary [7] {{+1}}\n            { }\n        }\n\n        static void StaticLocalFunctions() // Noncompliant [8] {{The Cyclomatic Complexity of this static local function is 5 which is greater than 3 authorized.}}\n                                           // Secondary@-1 [8] {{+1}}\n        {\n            if (false) // Secondary [8] {{+1}}\n            { }\n            if (false) // Secondary [8] {{+1}}\n            { }\n            if (false) // Secondary [8] {{+1}}\n            { }\n            if (false) // Secondary [8] {{+1}}\n            { }\n        }\n    }\n}\n\npublic partial class PartialProperty\n{\n    public partial int Property { get; set; }\n}\npublic partial class PartialProperty\n{\n    public partial int Property\n    {\n        get // Noncompliant [9] {{The Cyclomatic Complexity of this accessor is 4 which is greater than 3 authorized.}}\n            // Secondary@-1 [9]\n        {\n            if (true      // Secondary [9]\n                || false  // Secondary [9]\n                || true)  // Secondary [9]\n            {\n                return 0;\n            }\n        }\n        set { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FunctionComplexity.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class FunctionComplexity\n    {\n        private bool field;\n\n        public FunctionComplexity()\n//             ^^^^^^^^^^^^^^^^^^ Noncompliant [0] {{The Cyclomatic Complexity of this constructor is 4 which is greater than 3 authorized.}}\n//             ^^^^^^^^^^^^^^^^^^ Secondary@-1 [0] {{+1}}\n        {\n            if (false) { }\n//          ^^ Secondary [0] {{+1}}\n            if (false) { }\n//          ^^ Secondary [0] {{+1}}\n            if (false) { }\n//          ^^ Secondary [0] {{+1}}\n        }\n\n        ~FunctionComplexity()\n//       ^^^^^^^^^^^^^^^^^^ Noncompliant [1]\n//       ^^^^^^^^^^^^^^^^^^ Secondary@-1 [1] {{+1}}\n        {\n            if (false) { }\n//          ^^ Secondary [1] {{+1}}\n            if (false) { }\n//          ^^ Secondary [1] {{+1}}\n            if (false) { }\n//          ^^ Secondary [1] {{+1}}\n        }\n\n        public void M1()\n        {\n            if (false) { }\n            if (false) { }\n        }\n\n        public void M2() // Noncompliant [2]\n                         // Secondary@-1 [2] {{+1}}\n        {\n            if (false) { } // Secondary [2] {{+1}}\n            if (false) { } // Secondary [2] {{+1}}\n            if (false) { } // Secondary [2] {{+1}}\n        }\n\n        public int MyProperty\n        {\n            get // Noncompliant [3]\n                // Secondary@-1 [3] {{+1}}\n            {\n                if (false) { } // Secondary [3] {{+1}}\n                if (false) { } // Secondary [3] {{+1}}\n                if (false) { } // Secondary [3] {{+1}}\n                return 0;\n            }\n            set // Noncompliant [4]\n                // Secondary@-1 [4] {{+1}}\n            {\n                if (false) { } // Secondary [4] {{+1}}\n                if (false) { } // Secondary [4] {{+1}}\n                if (false) { } // Secondary [4] {{+1}}\n            }\n        }\n\n        public event EventHandler OnSomething\n        {\n            add // Noncompliant [5]\n                // Secondary@-1 [5] {{+1}}\n            {\n                if (false) { } // Secondary [5] {{+1}}\n                if (false) { } // Secondary [5] {{+1}}\n                if (false) { } // Secondary [5] {{+1}}\n            }\n            remove // Noncompliant [6]\n                   // Secondary@-1 [6] {{+1}}\n            {\n                if (false) { } // Secondary [6] {{+1}}\n                if (false) { } // Secondary [6] {{+1}}\n                if (false) { } // Secondary [6] {{+1}}\n            }\n        }\n\n        public static FunctionComplexity operator +(FunctionComplexity a) // Noncompliant [7]\n        // Secondary@-1 [7] {{+1}}\n        {\n            if (false) { } // Secondary [7] {{+1}}\n            if (false) { } // Secondary [7] {{+1}}\n            if (false) { } // Secondary [7] {{+1}}\n            return null;\n        }\n\n        public bool Method23(bool x) => x || x || x || x || x; // Noncompliant [8]\n        // Secondary@-1 [8] {{+1}}\n        // Secondary@-2 [8] {{+1}}\n        // Secondary@-3 [8] {{+1}}\n        // Secondary@-4 [8] {{+1}}\n        // Secondary@-5 [8] {{+1}}\n\n        public bool Prop => field || field || field || field || field; // Noncompliant [9]\n        // Secondary@-1 [9] {{+1}}\n        // Secondary@-2 [9] {{+1}}\n        // Secondary@-3 [9] {{+1}}\n        // Secondary@-4 [9] {{+1}}\n\n        private void Foo(Class c) // Noncompliant [10]\n                                  // Secondary@-1 [10] {{+1}}\n        {\n            var x = c?.Name?.ToString();\n//                   ^ Secondary [10] {{+1}}\n//                         ^ Secondary@-1 [10] {{+1}}\n\n            if (false) { } // Secondary [10] {{+1}}\n        }\n\n        private class Class\n        {\n            public string Name;\n        }\n\n        void NullCoalescenceAssignment() // Noncompliant [11]\n                                         // Secondary@-1 [11] {{+1}}\n        {\n            bool? v1 = null, v2 = null, v3 = null, v4 = null, v5 = null;\n\n            var h = v1 ??= v2 ??= v3 ??= v4 ??= v5;\n//                     ^^^ Secondary [11] {{+1}}\n//                            ^^^ Secondary@-1 [11] {{+1}}\n//                                   ^^^ Secondary@-2 [11] {{+1}}\n//                                          ^^^ Secondary@-3 [11] {{+1}}\n        }\n\n\n        public void MethodWithLocalfunction() // Noncompliant [12]\n                                              // Secondary@-1 [12] {{+1}}\n        {\n            void LocalFunction()\n            {\n                if (false) { }  // Secondary [12] {{+1}}\n                if (false) { }  // Secondary [12] {{+1}}\n                if (false) { }  // Secondary [12] {{+1}}\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FunctionComplexity.vb",
    "content": "﻿Namespace Tests.Diagnostics\n    Public Class FunctionComplexityVisualBasic\n        Public Sub New() ' Noncompliant {{The Cyclomatic Complexity of this constructor is 4 which is greater than 3 authorized.}}\n            If False Then\n\n            End If\n            If False Then\n\n            End If\n            If False Then\n\n            End If\n        End Sub\n\n        Public Sub S1() ' Compliant\n            If False Then\n\n            End If\n            If False Then\n\n            End If\n        End Sub\n\n        Public Sub S2()  ' Noncompliant\n            If False Then\n\n            End If\n            If False Then\n\n            End If\n            If False Then\n\n            End If\n        End Sub\n\n        Public Function F1() As Integer  ' Compliant\n            If False Then\n\n            End If\n            If False Then\n\n            End If\n            Return 0\n        End Function\n\n        Public Function F2() As Integer  ' Noncompliant\n            If False Then\n\n            End If\n            If False Then\n\n            End If\n            If False Then\n\n            End If\n            Return 0\n        End Function\n\n        Public Shared Operator ^(ByVal left As FunctionComplexityVisualBasic, ByVal right As FunctionComplexityVisualBasic) As Integer  ' Compliant\n            If False Then\n\n            End If\n            If False Then\n\n            End If\n            Return 0\n        End Operator\n\n        Public Shared Operator &(ByVal left As FunctionComplexityVisualBasic, ByVal right As FunctionComplexityVisualBasic) As Integer  ' Noncompliant\n            If False Then\n\n            End If\n            If False Then\n\n            End If\n            If False Then\n\n            End If\n            Return 0\n        End Operator\n\n        Public Property P1 As Integer\n            Get ' Compliant\n                If False Then\n\n                End If\n                If False Then\n\n                End If\n                Return 0\n            End Get\n            Set(value As Integer) ' Compliant\n                If False Then\n\n                End If\n                If False Then\n\n                End If\n            End Set\n        End Property\n\n        Public Property P2 As Integer\n            Get ' Noncompliant\n                If False Then\n\n                End If\n                If False Then\n\n                End If\n                If False Then\n\n                End If\n                If False Then\n\n                End If\n                Return 0\n            End Get\n            Set(value As Integer) ' Noncompliant\n                If False Then\n\n                End If\n                If False Then\n\n                End If\n                If False Then\n\n                End If\n                If False Then\n\n                End If\n            End Set\n        End Property\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FunctionName.vb",
    "content": "﻿Namespace Tests.Diagnostics\n\n    Module Module1\n        Sub bad_subroutine()                      ' Noncompliant\n        End Sub\n\n        Public Function Bad_Function() As Integer ' Noncompliant\n            Return 42\n        End Function\n\n        Sub GoodSubroutine()                      ' Compliant\n        End Sub\n\n        Public Function GoodFunction() As Integer ' Compliant\n            Return 42\n        End Function\n\n        Sub subject__SomeEvent() Handles Obj.Ev_Event ' Error [BC30506]\n        End Sub\n\n        Sub subject__SomeEvent22(sender As Object, args As System.EventArgs) ' Might be event handler\n        End Sub\n\n    End Module\n\n        Public MustInherit Class Base\n\n        Public MustOverride Function rqSomething1() As Object ' Noncompliant\n        Public MustOverride Sub rqSomething2() ' Noncompliant\n\n    End Class\n\n    Public Interface ISomething\n\n    Function rqFirst() As Object      ' Noncompliant\n    Function rqSecond() As Object     ' Noncompliant\n    Function rqThird() As Object      ' Noncompliant\n    Function rqFourth() As Object     ' Noncompliant\n    Sub rqFifth()                     ' Noncompliant\n    Sub rqSixth()                     ' Noncompliant\n    Sub rqSeventh()                   ' Noncompliant\n    Sub rqEight()                     ' Noncompliant\n    Sub ValidName()\n\n    End Interface\n\n    Public Class Sample\n        Inherits Base\n        Implements ISomething\n\n        Public Overrides Function rqSomething1() As Object ' Compliant as it is an override\n            Throw New NotImplementedException()\n        End Function\n\n        Public oVerRides Sub rqSomething2() ' Compliant as it is an override\n            Throw New NotImplementedException()\n        End Sub\n\n        Public Function rqFirst() As Object Implements ISomething.rqFirst   ' Compliant as it comes from the interface\n            Throw New NotImplementedException()\n        End Function\n\n        Public Function rqRenamed() As Object Implements ISomething.rqSecond   ' Noncompliant, because existing name doesn't match the interface member\n            Throw New NotImplementedException()\n        End Function\n\n        Public Function rqThird() As Object Implements ISomething.rqThird, ISomething.rqFourth ' Noncompliant, because it implements multiple functions\n            Throw New NotImplementedException()\n        End Function\n\n        Public Sub rqFifth() Implements ISomething.rqFifth ' Compliant as it comes from the interface\n            Throw New NotImplementedException()\n        End Sub\n\n        Public Sub GoodName() Implements ISomething.rqSixth ' Compliant as the rename is compliant\n            Throw New NotImplementedException()\n        End Sub\n\n        Public Sub VeryNiceRenaming() Implements ISomething.rqSeventh, ISomething.rqEight ' Compliant as the rename is compliant\n            Throw New NotImplementedException()\n        End Sub\n\n        Public Sub ValidName() Implements ISomething.ValidName ' Compliant\n            Throw New NotImplementedException()\n        End Sub\n\n        <System.Runtime.InteropServices.DllImport(\"foo.dll\")>\n        Public Shared Sub rqExtern(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer, ByVal p4 As Integer) ' Compliant as it is extern\n        End Sub\n\n        ' Error@+1 [BC31529]\n        <System.Runtime.InteropServices.DllImport(\"foo.dll\")>\n        Public Sub rqNotShared(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer, ByVal p4 As Integer) ' Noncompliant\n        End Sub\n\n        <Obsolete()>\n        Public Shared Sub rqNotDllImportAttribute(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer, ByVal p4 As Integer) ' Noncompliant\n        End Sub\n\n    End Class\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FunctionNestingDepth.CSharp9.cs",
    "content": "﻿do\n{\n    try\n    {\n        while (true)\n        {\n            if (true) { } // Noncompliant {{Refactor this code to not nest more than 3 control flow statements.}}\n        }\n    }\n    catch { }\n} while (true);\n\ndo\n{\n    try\n    {\n        if (true) { }\n    }\n    catch { }\n} while (true);\n\nvoid TopLevelLocalFunction()\n{\n    do\n    {\n        try\n        {\n            while (true)\n            {\n                if (true) { } // Noncompliant {{Refactor this code to not nest more than 3 control flow statements.}}\n            }\n        }\n        catch { }\n    } while (true);\n}\n\npublic record FunctionNestingDepth\n{\n    public void M1()\n    {\n        do\n        {\n            while (true)\n            {\n                if (true) { }\n            }\n        } while (true);\n\n        do\n        {\n            try\n            {\n                while (true)\n                {\n                    if (true) { } // Noncompliant {{Refactor this code to not nest more than 3 control flow statements.}}\n                }\n            }\n            catch { }\n        } while (true);\n    }\n\n    public int Property\n    {\n        get => 42;\n        init\n        {\n            if (true)\n            {\n                if (true)\n                {\n                    if (true)\n                    {\n                        if (true) { } // Noncompliant\n                    }\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FunctionNestingDepth.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class FunctionNestingDepth\n    {\n        public FunctionNestingDepth()\n        {\n            do\n            {\n                try\n                {\n                    while (true)\n                    {\n                        if (true) { } // Noncompliant {{Refactor this code to not nest more than 3 control flow statements.}}\n//                      ^^\n                    }\n                }\n                catch { }\n            } while (true);\n        }\n\n        ~FunctionNestingDepth()\n        {\n            do\n            {\n                try\n                {\n                    while (true)\n                    {\n                        foreach (var i in new string[] { }) { } // Noncompliant\n                    }\n                }\n                catch { }\n            } while (true);\n        }\n\n        public void M1()\n        {\n            {\n                if (true)\n                {\n                    while (true)\n                    {\n                        try { }\n                        catch { }\n                    }\n                }\n                if (true) { }\n                else if (true)\n                {\n                    if (true) { }\n                    else if (true)\n                    {\n                        do\n                        {\n                            do // Noncompliant\n                            {\n\n                            }\n                            while (true);\n                        }\n                        while (true);\n                    }\n                }\n                else if (true) { }\n            }\n        }\n\n        public void M2()\n        {\n            if (true)\n            {\n                if (true)\n                {\n                    if (true)\n                    {\n                        for (; ; ) // Noncompliant\n                        {\n                        }\n                    }\n                }\n            }\n        }\n\n        public int M3() => (new Func<int>(() =>\n        {\n            if (true)\n                if (true)\n                    if (true)\n                        if (true) // Noncompliant\n                            return 0;\n            return 42;\n        }))();\n\n        public int M4() => (new Func<int>(() =>\n        {\n            if (true)\n                if (true)\n                    if (true)\n                        return 0;\n            return 42;\n        }))();\n\n        public void SwitchStatement()\n        {\n            if (true)\n            {\n                switch (42)\n                {\n                    case 1:\n                        break;\n                    case 2:\n                        switch (42)\n                        {\n                            case 0:\n                                break;\n                            default:\n                                break;\n                        }\n                }\n            }\n            if (true)\n            {\n                switch (42)\n                {\n                    case 1:\n                        break;\n                    case 2:\n                        switch (42)\n                        {\n                            case 0:\n                                if (true) { }   // Noncompliant\n                                break;\n                            default:\n                                if (true) { }   // Noncompliant\n                                break;\n                        }\n                }\n            }\n        }\n\n        public int MyProperty\n        {\n            get\n            {\n                if (true)\n                {\n                    if (true)\n                    {\n                        if (true)\n                        {\n                            if (true) { } // Noncompliant\n                        }\n                    }\n                }\n                return 0;\n            }\n            set\n            {\n                if (true)\n                {\n                    if (true)\n                    {\n                        if (true)\n                        {\n                            if (true) { } // Noncompliant\n                        }\n                    }\n                }\n            }\n        }\n\n        public event EventHandler OnSomething\n        {\n            add\n            {\n                if (true)\n                {\n                    if (true)\n                    {\n                        if (true)\n                        {\n                            if (true) { } // Noncompliant\n                        }\n                    }\n                }\n            }\n            remove\n            {\n                if (true)\n                {\n                    if (true)\n                    {\n                        if (true)\n                        {\n                            if (true) { } // Noncompliant\n                        }\n                    }\n                }\n            }\n        }\n\n        public static FunctionNestingDepth operator +(FunctionNestingDepth a)\n        {\n            if (true)\n            {\n                if (true)\n                {\n                    if (true)\n                    {\n                        if (true) { } // Noncompliant\n                    }\n                }\n            }\n            return null;\n        }\n\n        public static void M5()\n        {\n            if (true)\n            {\n                if (true)\n                {\n                    if (true)\n                    {\n                        if (true)  // Noncompliant\n                        {\n                            if (true) // Compliant\n                            {\n\n                            }\n                        }\n                    }\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/FunctionNestingDepth.vb",
    "content": "﻿Imports System\n\nNamespace Tests.Diagnostics\n    Public Class FunctionNestingDepth\n\n        Public Sub New()\n            Do While True\n                Try\n                    While True\n                        If (True) Then  ' Noncompliant {{Refactor this code to not nest more than 3 control flow statements.}}\n'                       ^^\n                            Console.WriteLine()\n                        End If\n                    End While\n\n                Catch\n\n                End Try\n            Loop\n        End Sub\n\n        Protected Overrides Sub Finalize()\n            Do While True\n                Try\n                    While True\n                        For Each x In {1, 2, 3} ' Noncompliant {{Refactor this code to not nest more than 3 control flow statements.}}\n                        Next\n                    End While\n                Catch\n                End Try\n            Loop\n        End Sub\n\n        Public Sub M1()\n            If True Then\n                While True\n                    Try\n                    Catch\n                    End Try\n                End While\n\n                If (True) Then\n\n                ElseIf (True) Then\n                    If (True) Then\n                        Console.WriteLine()\n                    End If\n\n                ElseIf (True) Then\n                    Do\n                        Do ' Noncompliant\n                        Loop\n                    Loop\n\n                ElseIf (True) Then\n                End If\n            End If\n        End Sub\n\n        Public Sub M2()\n            If True Then\n                If (True) Then\n                    If (True) Then\n                        For i As Integer = 0 To 1 Step 0 ' Noncompliant\n\n                        Next\n                    End If\n                End If\n            End If\n        End Sub\n\n        Public Function M3() As Integer\n            Return (New Func(Of Integer)(Function() As Integer\n                                             If (True) Then\n                                                 If (True) Then\n                                                     If (True) Then\n\n                                                         If (True) Then ' Noncompliant\n                                                             Return 0\n                                                         End If\n                                                     End If\n                                                 End If\n                                             End If\n\n                                             Return 42\n\n                                         End Function))()\n        End Function\n\n        Public Sub SelectCase()\n            If True Then\n                Select Case 42\n                    Case 0 To 41\n                    Case 42\n                        Select Case 42\n                            Case 1\n                            Case Else\n                        End Select\n                End Select\n            End If\n\n            If True Then\n                Select Case 42\n                    Case 0 To 41\n                    Case 42\n                        Select Case 42\n                            Case 1\n                                If True Then    ' Noncompliant\n                                End If\n                            Case Else\n                                If True Then    ' Noncompliant\n                                End If\n                        End Select\n                End Select\n            End If\n        End Sub\n\n\n        Public Property MyProperty As Integer\n            Get\n                If (True) Then\n                    If (True) Then\n                        If (True) Then\n\n                            If (True) Then ' Noncompliant\n                                Return 0\n                            End If\n                        End If\n                    End If\n                End If\n\n                Return 42\n            End Get\n\n            Set\n                If (True) Then\n                    If (True) Then\n                        If (True) Then\n\n                            If (True) Then ' Noncompliant\n                            End If\n                        End If\n                    End If\n                End If\n            End Set\n        End Property\n\n        Public Custom Event OnSomething As EventHandler ' Error [BC31132]\n            AddHandler() ' Error [BC31133]\n                If (True) Then\n                    If (True) Then\n                        If (True) Then\n\n                            If (True) Then ' Noncompliant\n                            End If\n                        End If\n                    End If\n                End If\n            End AddHandler\n            RemoveHandler() ' Error [BC31133]\n                If (True) Then\n                    If (True) Then\n                        If (True) Then\n\n                            If (True) Then ' Noncompliant\n                            End If\n                        End If\n                    End If\n                End If\n            End RemoveHandler\n        End Event\n\n        Public Shared Operator +(ByVal h1 As FunctionNestingDepth,\n                             ByVal h2 As FunctionNestingDepth) As FunctionNestingDepth\n            If (True) Then\n                If (True) Then\n                    If (True) Then\n\n                        If (True) Then ' Noncompliant\n                        End If\n                    End If\n                End If\n            End If\n            Return New FunctionNestingDepth\n        End Operator\n\n        Public Sub M5()\n            If True Then\n                If (True) Then\n                    If (True) Then\n                        For i As Integer = 0 To 1 Step 0 ' Noncompliant\n                            If (True) Then ' Compliant\n\n                            End If\n                        Next\n                    End If\n                End If\n            End If\n        End Sub\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/GenericInheritanceShouldNotBeRecursive.CSharp9.cs",
    "content": "﻿record CA<T> { }\nrecord CB<T> { }\nrecord CC<T1, T2> { }\nrecord C0<T> : CA<C0<T>> { } // Compliant\nrecord C1<T> : CA<CB<C1<T>>> { } // Compliant\nrecord C2<T> : CA<C2<CB<T>>> { } // Noncompliant {{Refactor this record so that the generic inheritance chain is not recursive.}}\nrecord C3<T> : CA<C3<C3<T>>> { } // Noncompliant\nrecord C4<T> : CA<C4<CA<T>>> { } // Noncompliant\nrecord C5<T> : CC<C5<CA<T>>, CB<T>> { } // Noncompliant\nrecord C6<T> : CC<C5<CA<T>>, CB<T>> { } // Compliant\nrecord C7<T> : CA<CA<CA<CA<CA<CA<CA<CA<CA<CA<CA<CA<C7<CB<T>>>>>>>>>>>>>> { } // Noncompliant\nrecord C8<T>(string parameter) : CA<CA<CA<CA<CA<CA<CA<CA<CA<CA<CA<CA<C8<CB<T>>>>>>>>>>>>>> { } // Noncompliant\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/GenericInheritanceShouldNotBeRecursive.cs",
    "content": "﻿using System;\n\nnamespace Tests.ClassRecursion\n{\n    // some base classes\n    class CA<T> { }\n    class CB<T> { }\n    class CC<T1, T2> { }\n\n    class C0<T> : CA<C0<T>> { } // Compliant\n\n    class C1<T> : CA<CB<C1<T>>> { } // Compliant\n\n    class C2<T> : CA<C2<CB<T>>> { } // Noncompliant {{Refactor this class so that the generic inheritance chain is not recursive.}}\n//        ^^\n\n    class C3<T> : CA<C3<C3<T>>> { } // Noncompliant\n\n    class C4<T> : CA<C4<CA<T>>> { } // Noncompliant\n\n    class C5<T> : CC<C5<CA<T>>, CB<T>> { } // Noncompliant\n\n    class C6<T> : CC<C5<CA<T>>, CB<T>> { } // Compliant\n\n    class C7<T> : CA<CA<CA<CA<CA<CA<CA<CA<CA<CA<CA<CA<C7<CB<T>>>>>>>>>>>>>> { } // Noncompliant\n\n    // Error@+1 [CS0535]\n    class C8<T> : IComparable<C8<IEquatable<T>>> { } // Noncompliant\n}\n\nnamespace Tests.InterfaceRecursion\n{\n    // some base classes\n    interface IA<T> { }\n    interface IB<T> { }\n\n    interface I0<T> : IA<I0<T>> { } // Compliant\n\n    interface I1<T> : IA<IB<I1<T>>> { } // Compliant\n\n    interface I2<T> : I0<int>, IA<IB<I2<T>>> { } // Compliant\n\n    interface I3<T> : IA<I3<IB<T>>> { } // Noncompliant  {{Refactor this interface so that the generic inheritance chain is not recursive.}}\n\n    interface I4<T> : IA<I4<I4<T>>> { } // Noncompliant\n\n    interface I5<T> : IA<I5<IA<T>>> { } // Noncompliant\n\n    interface I6<T> : IA<IA<IA<IA<IA<IA<IA<IA<IA<IA<IA<IA<I6<IB<T>>>>>>>>>>>>>> { } // Noncompliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/GenericInheritanceShouldNotBeRecursive.vb",
    "content": "﻿Imports System\n\nNamespace Tests.ClassRecursion\n\n    ' some base classes\n    Class CA(Of T)\n    End Class\n\n    Class CB(Of T)\n    End Class\n\n    Class CC(Of T1, T2)\n    End Class\n\n    Class C0(Of T)\n        Inherits CA(Of C0(Of T))\n    End Class\n\n    Class C1(Of T) ' Compliant\n        Inherits CA(Of CB(Of C1 (Of T)))\n    End Class\n\n    Class C2(Of T) ' Noncompliant {{Refactor this Class so that the generic inheritance chain is not recursive.}}\n'         ^^\n        Inherits CA(Of C2(Of CB(Of T)))\n    End Class\n\n    Class C3(Of T) ' Noncompliant\n        Inherits CA(Of C3(Of C3(Of T)))\n    End Class\n\n    Class C4(Of T) ' Noncompliant\n        Inherits CA(Of C4(Of CA(Of T)))\n    End Class\n\n    Class C5(Of T) ' Noncompliant\n        Inherits CC(Of C5(Of CA(Of T)), CB(Of T))\n    End Class\n\n    Class C6(Of T) ' Compliant\n        Inherits CC(Of C5(Of CA(Of T)), CB(Of T))\n    End Class\n\n    Class C7(Of T) ' Noncompliant\n        Inherits CA(Of CA(Of CA(Of CA(Of CA(Of CA(Of CA(Of CA(Of CA(Of CA(Of C7(Of CB(Of T))))))))))))\n    End Class\n\n    Class C8(Of T) ' Noncompliant\n        Implements IComparable(Of C8(Of IEquatable(Of T)))\n        Public Function CompareTo(other As C8(Of IEquatable(Of T))) As Integer Implements IComparable(Of C8(Of IEquatable(Of T))).CompareTo\n            Throw New NotImplementedException()\n        End Function\n    End Class\nEnd Namespace\n\nNamespace Tests.InterfaceRecursion\n\n    ' some base classes\n    Interface IA(Of T)\n    End Interface\n\n    Interface IB(Of T)\n    End Interface\n\n    Interface I0(Of T) ' Compliant\n        Inherits IA(Of I0(Of T))\n    End Interface\n\n    Interface I1(Of T) ' Compliant\n        Inherits IA(Of IB(Of I1 (Of T)))\n    End Interface\n\n    Interface I2(Of T) ' Compliant\n        Inherits I0(Of T), IA(Of IB(Of I2(Of T)))\n    End Interface\n\n    Interface I3(Of T) ' Noncompliant\n        Inherits IA(Of I3(Of IB(Of T)))\n    End Interface\n\n    Interface I4(Of T) ' Noncompliant  {{Refactor this Interface so that the generic inheritance chain is not recursive.}}\n        Inherits IA(Of I4(Of I4(Of T)))\n    End Interface\n\n    Interface I5(Of T) ' Noncompliant\n        Inherits IA(Of I5(Of IA(Of T)))\n    End Interface\n\n    Interface I6(Of T) ' Noncompliant\n        Inherits IA(Of IA(Of IA(Of IA(Of IA(Of IA(Of IA(Of IA(Of IA(Of IA(Of IA(Of IA(Of I6(Of IB(Of T))))))))))))))\n    End Interface\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/GenericLoggerInjectionShouldMatchEnclosingType.Latest.cs",
    "content": "﻿using System;\nusing Microsoft.Extensions.Logging;\n\npublic partial class Correct\n{\n    partial Correct(ILogger<Correct> logger);\n    partial Correct(ILogger<Wrong> logger);\n}\n\npublic partial class Correct\n{\n    partial Correct(ILogger<Correct> logger) { }    // Compliant\n    partial Correct(ILogger<Wrong> logger) { }      // Noncompliant\n}\n\npublic class Wrong { }\n\n// Repro NET-2999\npublic class PrimaryConstructorCorrect(ILogger<PrimaryConstructorCorrect> logger);  // Compliant\npublic class PrimaryConstructorWrong(ILogger<Wrong> logger);                        // FN\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/GenericLoggerInjectionShouldMatchEnclosingType.cs",
    "content": "﻿using System;\nusing Microsoft.Extensions.Logging;\n\npublic class Correct : Base\n{\n    Correct(ILogger<Correct> logger) : base(logger) { }              // Compliant\n    Correct(ILogger<Correct> logger, ILogger<Correct> logger2) { }   // Compliant\n\n    Correct(Wrapper<Correct> logger) { }                             // Compliant\n    Correct(Wrapper<Wrong> logger) { }                               // Compliant\n    Correct(Wrapper<Correct> logger, Wrapper<Wrong> logger2) { }     // Compliant\n\n    Correct(ILogger<string> logger) { }                              // Noncompliant {{Update this logger to use its enclosing type.}}\n    //              ^^^^^^\n    Correct(ILogger<Wrong> logger) { }                               // Noncompliant\n    //              ^^^^^\n    Correct(ILogger<Base> logger) : base(logger) { }                 // Noncompliant, need exact type match\n    //              ^^^^\n    Correct(ILogger<Wrapper<Correct>> logger) { }                    // Noncompliant\n    //              ^^^^^^^^^^^^^^^^\n    Correct(ILogger<ILogger<Correct>> logger) { }                    // Noncompliant\n    //              ^^^^^^^^^^^^^^^^\n\n    Correct(ILogger<string> logger, ILogger<Wrong> logger2) { }\n    //              ^^^^^^ {{Update this logger to use its enclosing type.}}\n    //                                      ^^^^^ @-1 {{Update this logger to use its enclosing type.}}\n\n    Correct(ILogger<string> logger, ILogger<Correct> logger2, ILogger<ILogger<Correct>> logger3) { }\n    //              ^^^^^^ {{Update this logger to use its enclosing type.}}\n    //                                                                ^^^^^^^^^^^^^^^^ @-1 {{Update this logger to use its enclosing type.}}\n\n    Correct(Logger<Correct> logger, Logger<Wrong> logger2) { }\n    //                                     ^^^^^ {{Update this logger to use its enclosing type.}}\n\n    Correct(Logger logger) { } // Compliant, Logger is not a generic type\n}\n\npublic class Base\n{\n    public Base(ILogger<Base> logger) { }   // Compliant\n    public Base(ILogger<Wrong> logger) { }  // Noncompliant\n    public Base() { }\n}\n\npublic class Wrong { }\npublic class Wrapper<T> { }\n\npublic class Logger : Logger<int> { }\n\npublic class Logger<T> : ILogger<T>\n{\n    public IDisposable BeginScope<TState>(TState x) => null;\n    public bool IsEnabled(LogLevel x) => false;\n    void ILogger.Log<TState>(LogLevel x1, EventId x2, TState x3, Exception x4, Func<TState, Exception, string> x5) { }\n}\n\npublic class DerivedGeneric<T> : Generic<T> { }\n\npublic class Generic<T>\n{\n    Generic(ILogger<Generic<T>> logger) { }         // Compliant\n\n    Generic(ILogger<DerivedGeneric<T>> logger) { }  // Noncompliant, generic types do not match\n    Generic(ILogger<Generic<int>> logger) { }       // Noncompliant, generic argument types do not match\n    Generic(ILogger<T> logger) { }                  // Noncompliant\n    Generic(ILogger<int> logger) { }                // Noncompliant\n\n    public Generic() { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/GenericReadonlyFieldPropertyAssignment.AddConstraint.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Tests.TestCases\n{\n    interface IPoint\n    {\n        int X { get; set; }\n        int Y { get; set; }\n        string Tag { get; set; }\n    }\n\n    partial class PointManager<T> where T : class, IPoint\n    {\n        readonly T point;  // this could be a struct\n        public PointManager(T point)\n        {\n            this.point = point;\n            this.point.X = 1;       // Compliant, we are in the constructor\n            this.point.Tag ??= \"\";  // Compliant, we are in the constructor\n        }\n\n        public void MovePointVertically(int newX)\n        {\n            point.X = newX; //Fixed\n            point.X++; //Fixed\n            ++point.X; //Fixed\n            Console.WriteLine(point.X);\n            var i = point.X = newX; //Fixed\n            i = point.X++;          //Fixed\n            point.Tag ??= \"value\";  //Fixed\n        }\n    }\n\n    partial class PointManager<T> where T : class, IPoint\n    {\n\n    }\n\n    partial class PointManager<T>\n    {\n\n    }\n\n    class PointManager2<T> where T : class, IPoint\n    {\n        readonly T point;  // this can only be a class\n        public PointManager2(T point)\n        {\n            this.point = point;\n        }\n\n        public void MovePointVertically(int newX)\n        {\n            point.X = newX;  // this assignment is guaranteed to work\n            Console.WriteLine(point.X);\n        }\n    }\n\n    class PointManager3<T> where T : struct, IPoint\n    {\n        readonly T point;  // this could be a struct\n        public PointManager3(T point)\n        {\n            this.point = point;\n            this.point.X = 1; // Compliant, we are in the constructor\n        }\n\n        public void MovePointVertically(int newX)\n        {\n            point.X = newX; // Compliant // Error [CS1648]\n            point.X++;      // Compliant // Error [CS1648]\n            Console.WriteLine(point.X);\n        }\n    }\n\n    class P2<A, B> where A : class, IPoint where B : A\n    {\n        readonly A pointA;\n        readonly B pointB;\n\n        public P2(A a, B b)\n        {\n            this.pointA = a;\n            this.pointB = b;\n        }\n\n        public void Add(int i)\n        {\n            pointA.X += i;\n            pointB.X += i;   // Compliant\n        }\n    }\n\n    class SelfReferencing2<T> where T : SelfReferencing2<T>, IPoint\n    {\n        readonly T pointA;\n\n        public void Add(int i)\n        {\n            pointA.X += i; // Compliant\n        }\n    }\n\n    class PublicField<T> where T : IPoint\n    {\n        public readonly T point;\n    }\n\n    class PublicFieldAccessor<T> where T : class, IPoint\n    {\n        public PublicFieldAccessor()\n        {\n            var a = new PublicField<T>();\n            a.point.X = 1; // Fixed\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/GenericReadonlyFieldPropertyAssignment.Latest.Remove.Fixed.cs",
    "content": "﻿interface IPoint\n{\n    int X { get; set; }\n\n    int Y { get; set; }\n}\n\npartial record PointManager<T> where T : IPoint\n{\n    public partial PointManager(T point);   // Partial constructor\n}\n\npartial record PointManager<T> where T : IPoint\n{\n    public readonly T point;  // this could be a struct\n\n    public partial PointManager(T point) => this.point = point;\n\n    public void MovePointVertically(int newX)\n    {\n    }\n\n    public int X\n    {\n        get => point.X;\n        set => point.X = value; // Fixed\n    }\n\n    public void FixByRemove()\n    {\n    }\n\n    public void TupleAssignment((int, int) p)\n    {\n        (point.X, int y) = p; // Fixed\n    }\n\n    public void NestedTuples((int, int) p)\n    {\n        var tuple1 = ((p, 1), 2);\n        (((point.X, _), _), _) = tuple1; // Fixed\n        var tuple2 = ((1, p), 2);\n        ((_, (_, point.Y)), _) = tuple2; // Fixed\n    }\n\n    public void CompoundBitshift(int newX)\n    {\n    }\n\n    public void NullConditionalAssignment()\n    {\n        point?.Y = 42; // Fixed\n    }\n\n    public T FieldKeyword\n    {\n        get => field;\n        set => field.X = value.X; // Compliant, 'field' is the backing field of the property and is not readonly\n    }\n}\n\nrecord PointManagerCompliant<T> where T : class, IPoint\n{\n    public readonly T point;\n\n    public PointManagerCompliant(T point) => this.point = point;\n\n    public void MovePointVertically(int newX)\n    {\n        point.X = newX; // Compliant\n    }\n\n    public int X\n    {\n        get => point.X;\n        set => point.X = value; // Compliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/GenericReadonlyFieldPropertyAssignment.Latest.cs",
    "content": "﻿interface IPoint\n{\n    int X { get; set; }\n\n    int Y { get; set; }\n}\n\npartial record PointManager<T> where T : IPoint\n{\n    public partial PointManager(T point);   // Partial constructor\n}\n\npartial record PointManager<T> where T : IPoint\n{\n    public readonly T point;  // this could be a struct\n\n    public partial PointManager(T point) => this.point = point;\n\n    public void MovePointVertically(int newX)\n    {\n        point.X = newX; // Noncompliant - if point is a struct, then nothing happened\n    }\n\n    public int X\n    {\n        get => point.X;\n        set => point.X = value; // Noncompliant\n    }\n\n    public void FixByRemove()\n    {\n        point.X = 1; // Noncompliant. Needed for the fixer to remove at least one non-compliant diagnostic.\n    }\n\n    public void TupleAssignment((int, int) p)\n    {\n        (point.X, int y) = p; // Noncompliant {{Restrict 'point' to be a reference type or remove this assignment of 'X'; it is useless if 'point' is a value type.}}\n//       ^^^^^^^\n    }\n\n    public void NestedTuples((int, int) p)\n    {\n        var tuple1 = ((p, 1), 2);\n        (((point.X, _), _), _) = tuple1; // Noncompliant\n        var tuple2 = ((1, p), 2);\n        ((_, (_, point.Y)), _) = tuple2; // Noncompliant\n    }\n\n    public void CompoundBitshift(int newX)\n    {\n        point.X >>>= 4; // Noncompliant\n    }\n\n    public void NullConditionalAssignment()\n    {\n        point?.Y = 42; // Noncompliant\n    }\n\n    public T FieldKeyword\n    {\n        get => field;\n        set => field.X = value.X; // Compliant, 'field' is the backing field of the property and is not readonly\n    }\n}\n\nrecord PointManagerCompliant<T> where T : class, IPoint\n{\n    public readonly T point;\n\n    public PointManagerCompliant(T point) => this.point = point;\n\n    public void MovePointVertically(int newX)\n    {\n        point.X = newX; // Compliant\n    }\n\n    public int X\n    {\n        get => point.X;\n        set => point.X = value; // Compliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/GenericReadonlyFieldPropertyAssignment.Remove.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Tests.TestCases\n{\n    interface IPoint\n    {\n        int X { get; set; }\n        int Y { get; set; }\n        string Tag { get; set; }\n    }\n\n    partial class PointManager<T> where T : IPoint\n    {\n        readonly T point;  // this could be a struct\n        public PointManager(T point)\n        {\n            this.point = point;\n            this.point.X = 1;       // Compliant, we are in the constructor\n            this.point.Tag ??= \"\";  // Compliant, we are in the constructor\n        }\n\n        public void MovePointVertically(int newX)\n        {\n            Console.WriteLine(point.X);\n            var i = point.X = newX; //Fixed\n            i = point.X++;          //Fixed\n        }\n    }\n\n    partial class PointManager<T> where T : IPoint\n    {\n\n    }\n\n    partial class PointManager<T>\n    {\n\n    }\n\n    class PointManager2<T> where T : class, IPoint\n    {\n        readonly T point;  // this can only be a class\n        public PointManager2(T point)\n        {\n            this.point = point;\n        }\n\n        public void MovePointVertically(int newX)\n        {\n            point.X = newX;  // this assignment is guaranteed to work\n            Console.WriteLine(point.X);\n        }\n    }\n\n    class PointManager3<T> where T : struct, IPoint\n    {\n        readonly T point;  // this could be a struct\n        public PointManager3(T point)\n        {\n            this.point = point;\n            this.point.X = 1; // Compliant, we are in the constructor\n        }\n\n        public void MovePointVertically(int newX)\n        {\n            point.X = newX; // Compliant // Error [CS1648]\n            point.X++;      // Compliant // Error [CS1648]\n            Console.WriteLine(point.X);\n        }\n    }\n\n    class P2<A, B> where A : class, IPoint where B : A\n    {\n        readonly A pointA;\n        readonly B pointB;\n\n        public P2(A a, B b)\n        {\n            this.pointA = a;\n            this.pointB = b;\n        }\n\n        public void Add(int i)\n        {\n            pointA.X += i;\n            pointB.X += i;   // Compliant\n        }\n    }\n\n    class SelfReferencing2<T> where T : SelfReferencing2<T>, IPoint\n    {\n        readonly T pointA;\n\n        public void Add(int i)\n        {\n            pointA.X += i; // Compliant\n        }\n    }\n\n    class PublicField<T> where T : IPoint\n    {\n        public readonly T point;\n    }\n\n    class PublicFieldAccessor<T> where T : IPoint\n    {\n        public PublicFieldAccessor()\n        {\n            var a = new PublicField<T>();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/GenericReadonlyFieldPropertyAssignment.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Tests.TestCases\n{\n    interface IPoint\n    {\n        int X { get; set; }\n        int Y { get; set; }\n        string Tag { get; set; }\n    }\n\n    partial class PointManager<T> where T : IPoint\n    {\n        readonly T point;  // this could be a struct\n        public PointManager(T point)\n        {\n            this.point = point;\n            this.point.X = 1;       // Compliant, we are in the constructor\n            this.point.Tag ??= \"\";  // Compliant, we are in the constructor\n        }\n\n        public void MovePointVertically(int newX)\n        {\n            point.X = newX; //Noncompliant {{Restrict 'point' to be a reference type or remove this assignment of 'X'; it is useless if 'point' is a value type.}}\n//          ^^^^^^^\n            point.X++; //Noncompliant; if point is a struct, then nothing happened\n            ++point.X; //Noncompliant\n            Console.WriteLine(point.X);\n            var i = point.X = newX; //Noncompliant\n            i = point.X++;          //Noncompliant\n            point.Tag ??= \"value\";  //Noncompliant\n        }\n    }\n\n    partial class PointManager<T> where T : IPoint\n    {\n\n    }\n\n    partial class PointManager<T>\n    {\n\n    }\n\n    class PointManager2<T> where T : class, IPoint\n    {\n        readonly T point;  // this can only be a class\n        public PointManager2(T point)\n        {\n            this.point = point;\n        }\n\n        public void MovePointVertically(int newX)\n        {\n            point.X = newX;  // this assignment is guaranteed to work\n            Console.WriteLine(point.X);\n        }\n    }\n\n    class PointManager3<T> where T : struct, IPoint\n    {\n        readonly T point;  // this could be a struct\n        public PointManager3(T point)\n        {\n            this.point = point;\n            this.point.X = 1; // Compliant, we are in the constructor\n        }\n\n        public void MovePointVertically(int newX)\n        {\n            point.X = newX; // Compliant // Error [CS1648]\n            point.X++;      // Compliant // Error [CS1648]\n            Console.WriteLine(point.X);\n        }\n    }\n\n    class P2<A, B> where A : class, IPoint where B : A\n    {\n        readonly A pointA;\n        readonly B pointB;\n\n        public P2(A a, B b)\n        {\n            this.pointA = a;\n            this.pointB = b;\n        }\n\n        public void Add(int i)\n        {\n            pointA.X += i;\n            pointB.X += i;   // Compliant\n        }\n    }\n\n    class SelfReferencing2<T> where T : SelfReferencing2<T>, IPoint\n    {\n        readonly T pointA;\n\n        public void Add(int i)\n        {\n            pointA.X += i; // Compliant\n        }\n    }\n\n    class PublicField<T> where T : IPoint\n    {\n        public readonly T point;\n    }\n\n    class PublicFieldAccessor<T> where T : IPoint\n    {\n        public PublicFieldAccessor()\n        {\n            var a = new PublicField<T>();\n            a.point.X = 1; // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/GenericTypeParameterEmptinessChecking.Fixed.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Tests.Diagnostics\n{\n    public class A\n    {\n    }\n\n    public abstract class B\n    {\n    }\n\n    public interface Interface\n    {\n    }\n\n    public class GenericTypeParameterEmptinessChecking\n    {\n        public void M<T>(List<T> t)\n        {\n            if (object.Equals(t[0], default(T))) // Fixed\n            {\n            }\n        }\n        public void My(IEnumerable<B> analyzers)\n        {\n            if (analyzers.Any(x => x == null)) //compliant, B is a class\n            {\n            }\n        }\n        public void Mx(List<C> t) // Error [CS0246] - unknown type C\n        {\n            if (t.Any(x => x == null)) //compliant, we don't know anything about C\n            {\n            }\n        }\n\n        public void M2<T>(T t) where T : class\n        {\n            if (t == null)\n            {\n            }\n        }\n        public void M3<T>(T t) where T : Interface\n        {\n            if (object.Equals(t, default(T))) // Fixed\n            {\n            }\n            if (!object.Equals(t, default(T))) // Fixed\n            {\n            }\n        }\n        public void M4<T>(T t) where T : A\n        {\n            if (t == null)\n            {\n            }\n        }\n        public void M5<T>(T t) where T : C // Error [CS0246] - unknown type\n        {\n            if (t == null)\n            {\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/GenericTypeParameterEmptinessChecking.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nbool IsDefault<T>(T value)\n{\n    return value == null; // Noncompliant\n}\n\nbool IsDefault2<T>(T value)\n{\n    return object.Equals(value, default(T)); // Compliant\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/9493\nbool NotNullWithNullableType<T>(Func<T?> arg) where T : notnull\n{\n    T? t = arg();\n    return t == null; // Noncompliant - FP\n}\n\npublic record Record<T>\n{\n    public bool Mx(List<T> t)\n    {\n        return t.Any(x => x == null); // Noncompliant\n    }\n}\n\npublic record R<T> where T : class\n{\n    public bool Foo(List<T> t)\n    {\n        return t.Any(x => x == null); // Compliant\n    }\n\n    public bool Bar<Q>(List<Q> t) where Q : class => t.Any(x => x == null); // Compliant\n}\n\npublic class PrimaryConstructor<T>(T arg)\n{\n    public T Arg => arg;\n\n    public bool Method()\n    {\n        return arg == null; // Noncompliant\n    }\n\n    public T FieldKeyword\n    {\n        get;\n        set\n        {\n            if(field == null)   // Noncompliant\n            {\n            }\n        }\n    }\n}\n\npublic static class Extensions\n{\n    extension<T>(PrimaryConstructor<T> generic)\n    {\n        public bool Method()\n        {\n            return generic.Arg == null; // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/GenericTypeParameterEmptinessChecking.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Tests.Diagnostics\n{\n    public class A\n    {\n    }\n\n    public abstract class B\n    {\n    }\n\n    public interface Interface\n    {\n    }\n\n    public class GenericTypeParameterEmptinessChecking\n    {\n        public void M<T>(List<T> t)\n        {\n            if (t[0] == null) // Noncompliant {{Use a comparison to 'default(T)' instead or add a constraint to 'T' so that it can't be a value type.}}\n//                      ^^^^\n            {\n            }\n        }\n        public void My(IEnumerable<B> analyzers)\n        {\n            if (analyzers.Any(x => x == null)) //compliant, B is a class\n            {\n            }\n        }\n        public void Mx(List<C> t) // Error [CS0246] - unknown type C\n        {\n            if (t.Any(x => x == null)) //compliant, we don't know anything about C\n            {\n            }\n        }\n\n        public void M2<T>(T t) where T : class\n        {\n            if (t == null)\n            {\n            }\n        }\n        public void M3<T>(T t) where T : Interface\n        {\n            if (null == t) // Noncompliant\n            {\n            }\n            if (null != t) // Noncompliant\n            {\n            }\n        }\n        public void M4<T>(T t) where T : A\n        {\n            if (t == null)\n            {\n            }\n        }\n        public void M5<T>(T t) where T : C // Error [CS0246] - unknown type\n        {\n            if (t == null)\n            {\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/GenericTypeParameterInOut.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\n// https://github.com/SonarSource/sonar-dotnet/issues/1513\npublic interface ISample1<T> // Compliant, T cannot be in or out when used in a tuple\n{\n    (T, object) Process(T item);\n}\npublic interface ISample2<T> // Compliant, T cannot be in or out when used in a tuple\n{\n    void Process((T, object) item);\n}\npublic interface ISample3<T> // Noncompliant {{Add the 'in' keyword to parameter 'T' to make it 'contravariant'.}}\n{\n    void Process(T item);\n}\npublic interface ISample4<T> // Noncompliant {{Add the 'out' keyword to parameter 'T' to make it 'covariant'.}}\n{\n    T Process(object item);\n}\n\npublic static class Extensions\n{\n    extension<T>(ISample3<T> sample)\n    {\n        T Extension(T item) => item;    // Doesn't make the interface compliant\n    }\n\n    extension<T>(ISample4<T> sample)\n    {\n        T Extension(T item) => item;    // Doesn't make the interface compliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/GenericTypeParameterInOut.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    delegate int Deleg<T>(List<T> obj, T obj2);\n    delegate int Deleg2<T>(IEnumerable<T> obj, T obj2); //Noncompliant\n//                      ^\n    delegate int Deleg2Ok<in T>(IEnumerable<T> obj, T obj2);\n    delegate IEnumerable<T> Deleg3<T>(); //Noncompliant\n    delegate T Deleg4<out T>();\n    delegate Action<T> Deleg5<T>(); //Noncompliant\n    delegate T Deleg5<T, U>(int i, int j); //Noncompliant\n\n    interface IConsumer<T> // Noncompliant {{Add the 'in' keyword to parameter 'T' to make it 'contravariant'.}}\n    {\n        bool Eat(T fruit);\n        void Eat2(T fruit, T fruit1, int fruit2);\n        T Prop { set; }\n    }\n\n    interface IConsumerOk<in T>\n    {\n        bool Eat(T fruit);\n        void Eat2(T fruit, T fruit1, int fruit2);\n        T Prop { set; }\n    }\n\n    public delegate void SomeEventDelegate<in T>(object sender, T data);\n    interface IConsumer2<T> // Noncompliant\n    {\n        event SomeEventDelegate<T> SomeEvent;\n        T Eat();\n    }\n\n    interface IConsumer3<T> // Noncompliant\n    {\n        T M();\n        T Prop { get; }\n    }\n\n    interface IConsumer4<T> //Noncompliant\n    {\n        IEnumerable<T> M();\n    }\n    interface IConsumer5<T> //we don't report if it is not used\n    {\n        void M();\n    }\n    interface IException<T>\n    {\n        void M(ref T p);\n    }\n    interface IException2<T>\n    {\n        void M(out T p);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/GenericTypeParameterUnused.Latest.Partial.cs",
    "content": "﻿public partial class PartialConstructor<T>\n{\n    public partial PartialConstructor(T param) { }\n}\n\npublic partial class PartialEvent<T>  // Compliant\n{\n    partial event System.Action<int, T> SomeEvent\n    {\n        add { }\n        remove { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/GenericTypeParameterUnused.Latest.cs",
    "content": "﻿T Return<T>(T v) => v; // Compliant\n\nint Return2<T>(int v) => v; // Noncompliant\n\npublic interface Interface\n{\n    int Add<T>(int a, int b); // Compliant\n}\n\npublic interface AnotherInterface\n{\n    static int AddStatic<T>(int a, int b)               // Noncompliant\n    {\n        return a + b;\n    }\n\n    static abstract int AddAbstract<T>(int a, int b);   // Compliant\n\n    static virtual int AddVirtual<T>(int a, int b)      // Compliant: T might be used in implementation of the interface\n    {\n        return a + b;\n    }\n}\n\npublic record Record1 : Interface\n{\n    public int Add<T>(int a, int b) // Compliant, interface implementation\n    {\n        return 0;\n    }\n\n    T Return<T>(T v) => v; // Compliant\n\n    int Return<T>(int v) => v; // Noncompliant\n\n    public V DoStuff<T, V>(params V[] o) // Noncompliant\n    {\n        return o[0];\n    }\n}\n\npublic record Record1<T> // Noncompliant {{'T' is not used in the record.}}\n{\n}\n\npublic record Record2<T>(T X) // Compliant\n{\n}\n\npublic record Record3<T>(int X) // Noncompliant\n{\n}\n\npublic interface IUsedInBody<T>\n{\n    object WithDefaultImplementation() =>\n        default(T);\n}\n\npublic record struct R : Interface\n{\n    public int Add<T>(int a, int b) // Compliant, interface implementation\n    {\n        return 0;\n    }\n\n    T Return<T>(T v) => v; // Compliant\n\n    int Return<T>(int v) => v; // Noncompliant\n\n    public V DoStuff<T, V>(params V[] o) // Noncompliant\n    {\n        return o[0];\n    }\n}\n\npublic record struct RecordStruct1<T> // Noncompliant {{'T' is not used in the record.}}\n{\n}\n\npublic record struct RecordStruct2<T>(T X) // Compliant\n{\n}\n\npublic record struct RecordStruct3<T>(int X) // Noncompliant\n{\n}\n\npublic class InterfaceImplementation : AnotherInterface\n{\n    public static int AddAbstract<T>(int a, int b)      // Compliant: it is implementing the interface.\n    {\n        return 0;\n    }\n\n    public static int AddVirtual<T>(int a, int b)       // Compliant: it is implementing the interface.\n    {\n        return 0;\n    }\n}\n\npublic class Example<T>(T param) // Compliant\n{\n    bool IsNull() => param is null;\n}\n\npublic partial class PartialConstructor<T>  // Compliant\n{\n    public partial PartialConstructor(T param);\n}\n\npublic partial class PartialEvent<T>  // Compliant\n{\n    partial event System.Action<int, T> SomeEvent;\n}\n\npublic class NoncompliantWithExtensions<T> { }  // Noncompliant\n\npublic static class Extensions\n{\n    public static void FirstExtension<T>(NoncompliantWithExtensions<T> sender) { }  // Compliant, but doesn't make the class compliant\n\n    extension<T>(NoncompliantWithExtensions<T> sender)\n    {\n        T Extension(T item) => item;    // Doesn't make the class compliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/GenericTypeParameterUnused.Partial.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.IO;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\n\nnamespace Tests.Diagnostics\n{\n    public partial class PartialClass<T>\n    {\n        public void Find(T x) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/GenericTypeParameterUnused.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.IO;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\n\nnamespace Tests.Diagnostics\n{\n    public class NonGeneric\n    {\n\n    }\n\n    public interface Interface\n    {\n        int Add<T>(int a, int b); //Compliant\n    }\n\n    public class InterfaceImplementation : Interface, IDummyInterface // Error [CS0246] - IDummyInterface not found\n    {\n        public int Add<T>(int a, int b) //Compliant, it is implementing the interface.\n        {\n            return 0;\n        }\n\n        int IDummyInterface.MyMethod<T>(int a, int b) // Error [CS0246,CS0538] - Compliant, it is implementing the interface, although we don't know anything about it\n                                                      // Ignore@-1 CS0538\n        {\n            return 0;\n        }\n    }\n\n    public class MoreMath<T> // Noncompliant {{'T' is not used in the class.}}\n//                        ^\n    {\n        public int Add<T>(int a, int b) // Noncompliant; <T> is ignored\n        {\n            return a + b;\n        }\n    }\n\n    public class MoreMath2<T> : List<T>\n    {\n        public T Property { get; set; }\n        public int Add<T>(int a, int b) // Noncompliant; <T> is ignored\n        {\n            return a + b;\n        }\n\n        public int Substract<T>(int a, int b) => a - b; // Noncompliant\n    }\n    public class MoreMath3<T> : MoreMath2<T>\n    {\n    }\n\n    public class MoreMath4<T, T3> : MoreMath2<T> // Noncompliant\n    {\n    }\n\n    public class MoreMath5<T, T3> : MoreMath2<Dictionary<string, List<T>>>\n    {\n        public List<T3> DoStuff<T3>(List<T3> o)\n        {\n            return o;\n        }\n\n        public T3 DoStuff<T, T3>(params T3[] o) // Noncompliant\n        {\n            return o[0];\n        }\n    }\n\n    public abstract class MoreMath\n    {\n        public int Add(int a, int b)\n        {\n            return a + b;\n        }\n\n        public abstract int Do<T>(int a);\n    }\n\n    public class ComplexMath : MoreMath\n    {\n        public override int Do<T>(int a)\n        {\n            //don't use T here, but the method is still compliant because it is an override\n            return 1;\n        }\n    }\n\n    public partial class SomeClass<T>\n    {\n        private class Inner : List<T>\n        {\n        }\n    }\n\n    public partial class SomeClass<T>\n    {\n    }\n\n    public class MyNotReallyGenericClass<T> // Noncompliant\n        where T : class\n    {\n\n    }\n    public class MyCompliantSpecialGenericClass<T1, T2> // Compliant\n        where T1 : class\n        where T2 : T1\n    {\n        public void MyMethod(T2 p) { }\n    }\n\n    public class MyNonCompliantSpecialGenericClass<\n        T1, // Compliant, not recognized that it's a non used type parameter\n        T2> // Noncompliant\n        where T1 : class\n        where T2 : T1\n    {\n    }\n\n    public class WithLocalFunctions\n    {\n        public void Method()\n        {\n            // For local methods the only valid modifiers are async, static and unsafe\n            // https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/local-functions#local-function-syntax\n\n            void LocalFunctionNoTypeParameter() { }\n\n            void LocalFunctionUnusedParameter<T>() { } // Noncompliant\n\n            T LocalFunctionWithUsedTypeParameter<T>(T p) => p;\n\n            T LocalFunctionWithParameterUsedAsReturnType<T>(object o) => (T)o;\n\n            void LocalFunctionWithUsedTypeParameterNoReturn<T>(T o) { };\n\n            async Task<T> LocalAsyncFunctionWithUsedTypeParameter<T>(Task<T> v) => await v;\n\n            static void StaticLocalFunctionNoTypeParameter() { }\n\n            static void StaticLocalFunctionWithMultipleParamsAndUnusedTypeParameter<T1, T2, T3, T4, T5>(T1 a, T5 b, T5 c, T1 d) // Noncompliant {{'T2' is not used in the local function.}}\n                                                                                                                                // Noncompliant@-1 {{'T3' is not used in the local function.}}\n                                                                                                                                // Noncompliant@-2 {{'T4' is not used in the local function.}}\n            { }\n\n            static void StaticLocalFunctionWithParametersInDifferentOrder<T1, T2, T3, T4>(T4 a, T3 b, T2 c, T1 d) { }\n\n            static T3 StaticLocalFunctionWithUnusedTypeParameter<T, T3>(params T3[] o) // Noncompliant\n            {\n                return o[0];\n            }\n\n            static async Task<int> LocalStaticAsyncFunctionWithUnusedTypeParameter<T>() // Noncompliant\n            {\n                await Task.Delay(1);\n                return 1;\n            }\n\n            unsafe static void LocalStaticUnsafeFunctionWithUnusedTypeParameter<T>() { } // Noncompliant\n        }\n    }\n\n    public partial class PartialClass<T>\n    {\n    }\n\n    public class T\n    {\n        public void Method() {}\n    }\n\n    public class GenericClass<T> // Noncompliant\n    {\n        public void Method(Tests.Diagnostics.T x)\n        {\n            x.Method();\n        }\n    }\n\n    public struct SomeStruct<T> // Noncompliant\n    {\n        public int Add<T>(int a, int b) // Noncompliant; <T> is ignored\n        {\n            return a + b;\n        }\n    }\n\n    public struct StructUnused<T>   // Noncompliant {{'T' is not used in the struct.}}\n    {\n    }\n\n    public interface IUsedAsReturnType<T>\n    {\n        T Create();\n    }\n\n    public interface IUsedAsProperty<T>\n    {\n        T Value { get; set; }\n    }\n\n    public interface IUsedAsArgument<T>\n    {\n        object Create(T arg);\n    }\n\n    public interface IUnusedEmpty<T>    // Noncompliant {{'T' is not used in the interface.}}\n    {\n    }\n\n    public interface IUnused<T>         // Noncompliant\n    {\n        object Create();\n        object Create(object arg);\n        object Value { get; set; }\n    }\n\n    public interface IUnusedWithVariance<out T>         // Noncompliant\n    {\n    }\n\n    public interface IUnusedWithContravariance<in T>    // Noncompliant\n    {\n    }\n\n    public interface IUsedInBaseType<T> : IEnumerable<T>\n    {\n    }\n\n    public interface IUsedInTypeConstraint<T> where T : class   // Noncompliant\n    {\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/GenericTypeParametersRequired.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace MyLibrary\n{\n    public class GenericClass<V>\n    {\n        public V SomeMethod() { return default(V); }\n    }\n\n    public class MyClass\n    { }\n\n    public class Foo\n    {\n        public void MyMethod<T>()  // Noncompliant {{Refactor this method to use all type parameters in the parameter list to enable type inference.}}\n        //          ^^^^^^^^\n        {\n        }\n\n        public void MyMethod_02<MyClass>(MyClass foo) { }\n        public void MyMethod_03<T>(T foo, T foo2) { }\n        public void MyMethod_04<TValue, TKey>(TKey foo, TValue foo2) { }\n\n        public void MyMethod_05<TValue, TKey>(TKey foo) { } // Noncompliant\n        public void MyMethod_06<TValue, TKey>(TValue foo) { } // Noncompliant\n\n        public void MyMethod_09() { }\n        public void MyMethod_10(int i) { }\n        public void MyMethod_11(T i) { } // Error [CS0246]\n\n        public void MyMethod_12<T>(IEquatable<T> foo) { }\n        public void MyMethod_13<T, K>(Dictionary<K, T> foo) { }\n\n        public void MyMethod_14<T, V>(Tuple<List<List<V>>, Tuple<ISet<T>, T>> foo) { }\n\n        public void MyMethod_15<V>(params V[] p) { }\n        // Error@+1 [CS0246]\n        public void MyMethod_16<V>(params T[] p) { } // Noncompliant\n\n        public void MyMethod_17<V>(V[] p) { }\n        public void MyMethod_18<V>(MyClass[] p) { } // Noncompliant\n\n        public void MyMethod_19<V>(List<V[]> p) { }\n        public void MyMethod_20<V>(List<MyClass[]> p) { } // Noncompliant\n        public void MyMethod_21<V>(List<V>[] p) { }\n        // Error@+1 [CS0246]\n        public void MyMethod_22<V>(List<T>[] p) { } // Noncompliant\n\n        // See https://github.com/SonarSource/sonar-dotnet/issues/4548\n        public TKey MyMethod_08<TKey>() { return default(TKey); } // Noncompliant FP\n\n        public static T MyMethod_23<T>(string value) // Noncompliant FP\n        {\n            return (T) Convert.ChangeType(value, typeof(T));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/GetHashCodeEqualsOverride.Latest.cs",
    "content": "﻿public record Compliant\n{\n    private readonly int x;\n\n    public override int GetHashCode() => x.GetHashCode();\n}\n\npublic record BaseGetHashCodeUsed\n{\n    private readonly int x;\n\n    public override int GetHashCode() => x.GetHashCode() ^ base.GetHashCode(); // Althoug probably worng this is compliant with current rule since GetHashCode is not using references.\n}\n\npublic record WithParameters(string X)\n{\n    public override int GetHashCode() => X.GetHashCode();\n}\n\npublic static class Extensions\n{\n    extension(object sender)\n    {\n        public int GetHashCode() =>\n            sender.GetHashCode();   // Nonsense, but compliant. It's not a GetHashCode override\n\n        public bool Equals(object other) =>\n            sender.Equals(other);   // Nonsense, but compliant. It's not a Equals override\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/GetHashCodeEqualsOverride.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    class GetHashCodeEqualsOverride\n    {\n        private readonly int x;\n        public GetHashCodeEqualsOverride(int x)\n        {\n            this.x = x;\n        }\n\n        public bool Somemethod()\n        {\n            object obj = null;\n            if (base.Equals(obj)) // Compliant\n            {\n                return true;\n            }\n            if (base.Equals(obj)) // Compliant\n            {\n                return false;\n            }\n\n            return true;\n        }\n\n        public override int GetHashCode()\n        {\n            return x.GetHashCode() ^ base.GetHashCode(); //Noncompliant {{Remove this 'base' call to 'object.GetHashCode', which is directly based on the object reference.}}\n//                                   ^^^^^^^^^^^^^^^^^^\n        }\n        public override bool Equals(object obj)\n        {\n            if (base.Equals(obj)) //Compliant, guard condition\n            {\n                return true;\n            }\n\n            if (base.Equals(obj)) //Compliant, guard condition\n            {\n                return true;\n                return true;\n            }\n\n            if (base.Equals(obj)) //Noncompliant\n            {\n                return false;\n            }\n\n            if (true)\n            {\n                return base.Equals(obj); //Compliant\n            }\n\n            return base.Equals(obj); //Compliant\n        }\n\n        public override string ToString()\n        {\n            return base.ToString();\n        }\n    }\n\n    class GetHashCodeEqualsOverride1\n    {\n        private readonly int x;\n        public GetHashCodeEqualsOverride1(int x)\n        {\n            this.x = x;\n        }\n\n        public override bool Equals(object obj)\n        {\n            if (true)\n            {\n                return base.Equals(obj); //Noncompliant\n            }\n\n            return base.Equals(obj); // Compliant\n        }\n    }\n\n    class GetHashCodeEqualsOverride2\n    {\n        private readonly int x;\n        public GetHashCodeEqualsOverride2(int x)\n        {\n            this.x = x;\n        }\n        public override int GetHashCode()\n        {\n            return x.GetHashCode();\n        }\n    }\n\n    class GetHashCodeEqualsOverride3 : GetHashCodeEqualsOverride2\n    {\n        private readonly int x;\n        public GetHashCodeEqualsOverride3(int x) : base(x)\n        {\n            this.x = x;\n        }\n        public override int GetHashCode()\n        {\n            return x.GetHashCode() ^ base.GetHashCode();\n        }\n\n        public override string ToString()\n        {\n            return base.ToString();\n        }\n    }\n\n    class Base\n    { }\n\n    class Derived : Base\n    {\n        public override int GetHashCode()\n        {\n            return base.GetHashCode(); //Noncompliant, calls object.GetHashCode()\n        }\n    }\n\n    class DerivedWithExpressionBody : Base\n    {\n        public override int GetHashCode() => base.GetHashCode(); //Noncompliant, calls object.GetHashCode()\n        public override bool Equals(Object obj) => base.Equals(obj); // Noncompliant\n    }\n\n\n    /**\n     * If the method has been annotated with an attribute, we should not raise, because the only way to annotate the\n     * base behavior with an attribute is by overriding it.\n     */\n\n    class WithBrowsableAttribute\n    {\n        [Browsable(false)]\n        public override int GetHashCode()\n        {\n            return base.GetHashCode(); // Compliant, it's decorating the base behavior\n        }\n\n        [Browsable(true)]\n        public override bool Equals(Object obj)\n        {\n            return base.Equals(obj); // FN - the attribute isn't changing the default behavior\n        }\n    }\n\n    class WithEditorBrowsableFalseAttribute\n    {\n        [EditorBrowsable(EditorBrowsableState.Always)]\n        public override int GetHashCode()\n        {\n            return base.GetHashCode(); // FN - the attribute isn't changing the default behavior\n        }\n\n        [EditorBrowsable(EditorBrowsableState.Never)]\n        public override bool Equals(Object obj)\n        {\n            return base.Equals(obj); // Compliant, it's decorating the base behavior\n        }\n    }\n\n    class WithBothAttributes\n    {\n        [Browsable(false)]\n        [EditorBrowsable(EditorBrowsableState.Never)]\n        public override int GetHashCode() => base.GetHashCode(); // Compliant\n    }\n\n    class WithCustomAttribute\n    {\n        [MyAttribute]\n        public override int GetHashCode() => base.GetHashCode(); // Compliant, decorating the default behavior\n\n        [MyAttribute]\n        public override bool Equals(Object obj)\n        {\n            return base.Equals(obj); // Compliant, it's decorating the base behavior\n        }\n    }\n\n    public class MyAttribute : Attribute { }\n\n    // Testing different corner cases\n    class EqualsEmptyReturnBase\n    {\n        protected bool Equals(object first, object second) { return true; }\n    }\n\n    class EqualsEmptyReturn : EqualsEmptyReturnBase\n    {\n        public override bool Equals(Object obj)\n        {\n            Method();\n\n            Equals(obj);\n\n            if (base.Equals(obj, obj))\n            {\n            }\n\n            if (base.Equals(obj, obj) == false)\n            {\n            }\n\n            if (base.Equals(obj)) // Noncompliant\n            {\n                return; // Error [CS0126]\n            }\n\n            return; // Error [CS0126]\n        }\n\n        private void Method() { }\n    }\n\n    public class GetHashCodeInsideExpressions\n    {\n        private readonly IDictionary<string, dynamic> dictionary = new Dictionary<string, dynamic>();\n\n        public override int GetHashCode()\n        {\n            return dictionary != null ? dictionary.GetHashCode() : 0; // Compliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/GetHashCodeMutable.Fixed.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class AnyOther\n    {\n        public readonly int Field;\n    }\n\n    public class GetHashCodeMutable : AnyOther\n    {\n        public readonly DateTime birthday;\n        public const int Zero = 0;\n        public readonly int age;\n        public readonly string name;\n        int foo, bar;\n\n        public GetHashCodeMutable()\n        {\n        }\n\n        public override int GetHashCode() // Fixed\n        {\n            int hash = Zero;\n            hash += foo.GetHashCode();\n            hash += age.GetHashCode();\n            hash += this.name.GetHashCode();\n            hash += name.GetHashCode(); // Compliant, we already reported on this symbol\n            hash += this.birthday.GetHashCode();\n            hash += SomeMethod(Field);\n            return hash;\n        }\n        public int SomeMethod(int value)\n        {\n            int hash = Zero;\n            hash += this.age.GetHashCode();\n            return hash;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/GetHashCodeMutable.Latest.cs",
    "content": "﻿using System;\n\npublic record AnyOther\n{\n    public int Field;\n}\n\npublic record GetHashCodeMutable : AnyOther\n{\n    public readonly DateTime birthday;\n    public const int Zero = 0;\n    public int age;\n    public string name;\n    int foo, bar;\n\n    public override int GetHashCode() // Noncompliant {{Refactor 'GetHashCode' to not reference mutable fields.}}\n    {\n        int hash = Zero;\n        hash += foo.GetHashCode(); // Secondary {{Remove this use of 'foo' or make it 'readonly'.}}\n//              ^^^\n        hash += age.GetHashCode(); // Secondary {{Remove this use of 'age' or make it 'readonly'.}}\n        hash += this.name.GetHashCode(); // Secondary {{Remove this use of 'name' or make it 'readonly'.}}\n        hash += name.GetHashCode(); // Compliant, we already reported on this symbol\n        hash += this.birthday.GetHashCode();\n        hash += SomeMethod(Field); // Secondary {{Remove this use of 'Field' or make it 'readonly'.}}\n        return hash;\n    }\n\n    public int SomeMethod(int value)\n    {\n        int hash = Zero;\n        hash += this.age.GetHashCode();\n        return hash;\n    }\n}\n\npublic struct Struct\n{\n    public int Field;\n\n    // See https://github.com/SonarSource/sonar-dotnet/issues/8756\n    public override int GetHashCode() => Field; // Compliant, this is a value type.\n}\n\npublic record struct RecordStruct\n{\n    public int Field;\n\n    // See https://github.com/SonarSource/sonar-dotnet/issues/8756\n    public override int GetHashCode() => Field; // Compliant, this is a value type.\n}\n\nclass   // Error [CS1001] Identifier expected\n{\n    int i;\n    public override int GetHashCode()   // Noncompliant\n    {\n        return i;                       // Secondary\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/GetHashCodeMutable.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class AnyOther\n    {\n        public int Field;\n    }\n\n    public class GetHashCodeMutable : AnyOther\n    {\n        public readonly DateTime birthday;\n        public const int Zero = 0;\n        public int age;\n        public string name;\n        int foo, bar;\n\n        public GetHashCodeMutable()\n        {\n        }\n\n        public override int GetHashCode() // Noncompliant {{Refactor 'GetHashCode' to not reference mutable fields.}}\n        {\n            int hash = Zero;\n            hash += foo.GetHashCode(); // Secondary {{Remove this use of 'foo' or make it 'readonly'.}}\n//                  ^^^\n            hash += age.GetHashCode(); // Secondary {{Remove this use of 'age' or make it 'readonly'.}}\n            hash += this.name.GetHashCode(); // Secondary {{Remove this use of 'name' or make it 'readonly'.}}\n            hash += name.GetHashCode(); // Compliant, we already reported on this symbol\n            hash += this.birthday.GetHashCode();\n            hash += SomeMethod(Field); // Secondary {{Remove this use of 'Field' or make it 'readonly'.}}\n            return hash;\n        }\n        public int SomeMethod(int value)\n        {\n            int hash = Zero;\n            hash += this.age.GetHashCode();\n            return hash;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/GetTypeWithIsAssignableFrom.Fixed.Batch.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    class GetTypeWithIsAssignableFrom\n    {\n        void Test(bool b)\n        {\n            var expr1 = new GetTypeWithIsAssignableFrom();\n            var expr2 = new GetTypeWithIsAssignableFrom();\n\n            if (expr1.GetType()/*abcd*/.IsInstanceOfType(expr2 /*efgh*/)) // Fixed\n            { }\n            if (expr1.GetType().IsInstanceOfType(expr2)) // Compliant\n            { }\n\n            if (!(expr1 is GetTypeWithIsAssignableFrom)) // Fixed\n            { }\n            var x = expr1 is GetTypeWithIsAssignableFrom; // Fixed\n            if (expr1 != null) // Fixed\n            { }\n\n            if (typeof(GetTypeWithIsAssignableFrom).IsAssignableFrom(typeof(GetTypeWithIsAssignableFrom))) // Compliant\n            { }\n\n            var t1 = expr1.GetType();\n            var t2 = expr2.GetType();\n            if (t1.IsAssignableFrom(t2)) // Compliant\n            { }\n            if (t1.IsInstanceOfType(expr2)) // Fixed\n            { }\n\n            if (t1.IsAssignableFrom(typeof(GetTypeWithIsAssignableFrom))) // Compliant\n            { }\n\n            Test(t1.IsInstanceOfType(expr2)); // Fixed\n\n            if (expr1 is object) // Compliant - \"is object\" is a commonly used pattern for non-null check\n            { }\n\n            if (expr1 is System.Object) // Compliant - \"is object\" is a commonly used pattern for non-null check\n            { }\n        }\n    }\n    class Fruit { }\n    sealed class Apple : Fruit { }\n    class NonsealedBerry : Fruit { }\n\n    class Program\n    {\n        static void Main()\n        {\n            var apple = new Apple();\n            var berry = new NonsealedBerry();\n            var b = apple is Apple;       // Fixed\n            b = berry.GetType() == typeof(NonsealedBerry);  // Compliant, nonsealed class\n            b = apple is Apple;      // Fixed\n            b = apple is Apple; // Fixed\n            b = apple is Apple;      // Fixed\n            var appleType = typeof(Apple);\n            b = appleType.IsInstanceOfType(apple);    // Fixed\n\n            b = apple.GetType() == typeof(int?);    // Compliant\n\n            Fruit f = apple;\n            b = true && (f is Apple);   // Fixed\n            b = !(f is Apple);                 // Fixed\n            b = f as Apple == new Apple();\n\n            b = true && (apple != null); // Fixed\n            b = !(apple != null);          // Fixed\n            b = f is Apple;\n\n            var num = 5;\n            b = num is int?;\n            b = num is float;\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/3605\n    public class Repro_3605\n    {\n        public string StringProperty { get; set; }\n        public int IntProperty { get; set; }\n        public AnEnum EnumProperty { get; set; }\n\n        public const string stringField = \"Lorem Ipsum\";\n        public const int intField = 1;\n\n        public void Go(Repro_3605 value)\n        {\n            bool result = value.StringProperty is stringField; // Compliant, for pattern matching\n            result = value.IntProperty is intField;            // Compliant, for pattern matching\n            result = value.EnumProperty is AnEnum.Zero;        // Compliant, for pattern matching\n        }\n    }\n\n    public enum AnEnum\n    {\n        Zero = 0\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/6616\n    public class Repro_6616\n    {\n        public void IsInstanceOfType(object obj, Type t)\n        {\n            _ = obj is ISet<int>;                            // Fixed\n            _ = typeof(ISet<>).IsInstanceOfType(obj);                               // Compliant, unbonded generic type\n            _ = obj is IDictionary<int, int>;                // Fixed\n            _ = typeof(IDictionary<,>).IsInstanceOfType(obj);                       // Compliant, unbonded generic type\n            _ = obj is System.Collections.Generic.ISet<int>; // Fixed\n            _ = typeof(System.Collections.Generic.ISet<>).IsInstanceOfType(obj);    // Compliant, unbonded generic type\n\n            _ = t.IsInstanceOfType(obj);                                            // Compliant, not a typeof expression\n            t = typeof(ISet<>);\n            _ = t.IsInstanceOfType(obj);                                            // Compliant, not a typeof expression and value not tracked\n\n            // Error@+1 [CS7003] Unexpected use of an unbound generic name\n            _ = obj is ISet<ISet<>>;                         // Fixed\n            // Error@+1 [CS7003] Unexpected use of an unbound generic name\n            _ = obj is IDictionary<string, ISet<>>;          // Fixed\n        }\n\n        public void IsAssignableFrom(object obj, Type t1, Type t2)\n        {\n            _ = obj is HashSet<int>;                         // Fixed\n            _ = typeof(HashSet<>).IsAssignableFrom(obj.GetType());                            // Compliant, unbonded generic type\n            _ = obj is Dictionary<int, int>;                 // Fixed\n            _ = typeof(Dictionary<,>).IsAssignableFrom(obj.GetType());                        // Compliant, unbonded generic type\n            _ = obj is System.Collections.Generic.ISet<int>; // Fixed\n            _ = typeof(System.Collections.Generic.ISet<>).IsAssignableFrom(obj.GetType());    // Compliant, unbonded generic type\n\n            _ = t1.IsAssignableFrom(t2);                                                      // Compliant, not a typeof expression, nor having GetType as arg\n            t1 = typeof(ISet<>);\n            t2 = obj.GetType();\n            _ = t1.IsAssignableFrom(t2);                                                      // Compliant, not a typeof expression, nor having GetType as arg, and values not tracked\n\n            // Error@+1 [CS7003] Unexpected use of an unbound generic name\n            _ = obj is ISet<ISet<>>;                         // Fixed\n            // Error@+1 [CS7003] Unexpected use of an unbound generic name\n            _ = obj is IDictionary<string, ISet<>>;          // Fixed\n        }\n    }\n\n    public class Coverage\n    {\n        public void Foo()\n        {\n            var b = typeof(Apple).IsEquivalentTo(null);\n            this.IsInstanceOfType(\"x\");\n            this.IsAssignableFrom(\"x\");\n            this.GetType(null);\n            var c = this.GetType() == typeof(Apple);\n            var d = GetType() == null;\n        }\n\n        public bool IsInstanceOfType(string x) => true;\n        public bool IsAssignableFrom(string x) => true;\n        public bool GetType(object x) => true;\n        public Type GetType() => null;\n    }\n\n    public class CoverageWithErrors\n    {\n        public void Go(CoverageWithErrors arg)\n        {\n            bool b;\n            this.IsInstanceOfType(\"x\");                 // Error [CS1061]: 'Coverage2' does not contain a definition for 'IsInstanceOfType'\n            b = arg is UndefinedType;                   // Error [CS0246]: The type or namespace name 'UndefinedType' could not be found\n            b = undefined is CoverageWithErrors;        // Error [CS0103]: The name 'undefined' does not exist in the current context\n            b = arg.GetType() == typeof(UndefinedType); // Error [CS0246]: The type or namespace name 'UndefinedType' could not be found\n            b = arg.GetType() == typeof();              // Error [CS1031]: Type expected\n            b = arg.GetType() == typeof;                // Error [CS1031]: Type expected\n                                                        // Error@-1 [CS1003]: Syntax error, '(' expected\n                                                        // Error@-2 [CS1026]: ) expected\n        }\n    }\n\n    // UnityEngine.Object overloads == and !=. When compared with null it checks if the object was “destroyed” by the engine, not whether the actual reference is null.\n    public class Sample\n    {\n        public void Method(ISomething instance)\n        {\n            _ = !(instance is UnityEngine.Object);     // Fixed\n            _ = instance is UnityEngine.Object;     // Fixed\n            _ = !(instance is UnityEngine.Object);     // Fixed\n        }\n    }\n    // Unity3D is not available as a nuget package and we cannot use the original classes\n    namespace UnityEngine\n    {\n        public class Object { }\n    }\n    public interface ISomething { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/GetTypeWithIsAssignableFrom.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    class GetTypeWithIsAssignableFrom\n    {\n        void Test(bool b)\n        {\n            var expr1 = new GetTypeWithIsAssignableFrom();\n            var expr2 = new GetTypeWithIsAssignableFrom();\n\n            if (expr1.GetType()/*abcd*/.IsInstanceOfType(expr2 /*efgh*/)) // Fixed\n            { }\n            if (expr1.GetType().IsInstanceOfType(expr2)) // Compliant\n            { }\n\n            if (!(expr1 != null)) // Fixed\n            { }\n            var x = expr1 != null; // Fixed\n            if (expr1 != null) // Fixed\n            { }\n\n            if (typeof(GetTypeWithIsAssignableFrom).IsAssignableFrom(typeof(GetTypeWithIsAssignableFrom))) // Compliant\n            { }\n\n            var t1 = expr1.GetType();\n            var t2 = expr2.GetType();\n            if (t1.IsAssignableFrom(t2)) // Compliant\n            { }\n            if (t1.IsInstanceOfType(expr2)) // Fixed\n            { }\n\n            if (t1.IsAssignableFrom(typeof(GetTypeWithIsAssignableFrom))) // Compliant\n            { }\n\n            Test(t1.IsInstanceOfType(expr2)); // Fixed\n\n            if (expr1 is object) // Compliant - \"is object\" is a commonly used pattern for non-null check\n            { }\n\n            if (expr1 is System.Object) // Compliant - \"is object\" is a commonly used pattern for non-null check\n            { }\n        }\n    }\n    class Fruit { }\n    sealed class Apple : Fruit { }\n    class NonsealedBerry : Fruit { }\n\n    class Program\n    {\n        static void Main()\n        {\n            var apple = new Apple();\n            var berry = new NonsealedBerry();\n            var b = apple != null;       // Fixed\n            b = berry.GetType() == typeof(NonsealedBerry);  // Compliant, nonsealed class\n            b = apple != null;      // Fixed\n            b = apple != null; // Fixed\n            b = apple != null;      // Fixed\n            var appleType = typeof(Apple);\n            b = appleType.IsInstanceOfType(apple);    // Fixed\n\n            b = apple.GetType() == typeof(int?);    // Compliant\n\n            Fruit f = apple;\n            b = true && (f is Apple);   // Fixed\n            b = !(f is Apple);                 // Fixed\n            b = f as Apple == new Apple();\n\n            b = true && (apple != null); // Fixed\n            b = !(apple != null);          // Fixed\n            b = f is Apple;\n\n            var num = 5;\n            b = num is int?;\n            b = num is float;\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/3605\n    public class Repro_3605\n    {\n        public string StringProperty { get; set; }\n        public int IntProperty { get; set; }\n        public AnEnum EnumProperty { get; set; }\n\n        public const string stringField = \"Lorem Ipsum\";\n        public const int intField = 1;\n\n        public void Go(Repro_3605 value)\n        {\n            bool result = value.StringProperty is stringField; // Compliant, for pattern matching\n            result = value.IntProperty is intField;            // Compliant, for pattern matching\n            result = value.EnumProperty is AnEnum.Zero;        // Compliant, for pattern matching\n        }\n    }\n\n    public enum AnEnum\n    {\n        Zero = 0\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/6616\n    public class Repro_6616\n    {\n        public void IsInstanceOfType(object obj, Type t)\n        {\n            _ = obj is ISet<int>;                            // Fixed\n            _ = typeof(ISet<>).IsInstanceOfType(obj);                               // Compliant, unbonded generic type\n            _ = obj is IDictionary<int, int>;                // Fixed\n            _ = typeof(IDictionary<,>).IsInstanceOfType(obj);                       // Compliant, unbonded generic type\n            _ = obj is System.Collections.Generic.ISet<int>; // Fixed\n            _ = typeof(System.Collections.Generic.ISet<>).IsInstanceOfType(obj);    // Compliant, unbonded generic type\n\n            _ = t.IsInstanceOfType(obj);                                            // Compliant, not a typeof expression\n            t = typeof(ISet<>);\n            _ = t.IsInstanceOfType(obj);                                            // Compliant, not a typeof expression and value not tracked\n\n            // Error@+1 [CS7003] Unexpected use of an unbound generic name\n            _ = obj is ISet<ISet<>>;                         // Fixed\n            // Error@+1 [CS7003] Unexpected use of an unbound generic name\n            _ = obj is IDictionary<string, ISet<>>;          // Fixed\n        }\n\n        public void IsAssignableFrom(object obj, Type t1, Type t2)\n        {\n            _ = obj is HashSet<int>;                         // Fixed\n            _ = typeof(HashSet<>).IsAssignableFrom(obj.GetType());                            // Compliant, unbonded generic type\n            _ = obj is Dictionary<int, int>;                 // Fixed\n            _ = typeof(Dictionary<,>).IsAssignableFrom(obj.GetType());                        // Compliant, unbonded generic type\n            _ = obj is System.Collections.Generic.ISet<int>; // Fixed\n            _ = typeof(System.Collections.Generic.ISet<>).IsAssignableFrom(obj.GetType());    // Compliant, unbonded generic type\n\n            _ = t1.IsAssignableFrom(t2);                                                      // Compliant, not a typeof expression, nor having GetType as arg\n            t1 = typeof(ISet<>);\n            t2 = obj.GetType();\n            _ = t1.IsAssignableFrom(t2);                                                      // Compliant, not a typeof expression, nor having GetType as arg, and values not tracked\n\n            // Error@+1 [CS7003] Unexpected use of an unbound generic name\n            _ = obj is ISet<ISet<>>;                         // Fixed\n            // Error@+1 [CS7003] Unexpected use of an unbound generic name\n            _ = obj is IDictionary<string, ISet<>>;          // Fixed\n        }\n    }\n\n    public class Coverage\n    {\n        public void Foo()\n        {\n            var b = typeof(Apple).IsEquivalentTo(null);\n            this.IsInstanceOfType(\"x\");\n            this.IsAssignableFrom(\"x\");\n            this.GetType(null);\n            var c = this.GetType() == typeof(Apple);\n            var d = GetType() == null;\n        }\n\n        public bool IsInstanceOfType(string x) => true;\n        public bool IsAssignableFrom(string x) => true;\n        public bool GetType(object x) => true;\n        public Type GetType() => null;\n    }\n\n    public class CoverageWithErrors\n    {\n        public void Go(CoverageWithErrors arg)\n        {\n            bool b;\n            this.IsInstanceOfType(\"x\");                 // Error [CS1061]: 'Coverage2' does not contain a definition for 'IsInstanceOfType'\n            b = arg is UndefinedType;                   // Error [CS0246]: The type or namespace name 'UndefinedType' could not be found\n            b = undefined is CoverageWithErrors;        // Error [CS0103]: The name 'undefined' does not exist in the current context\n            b = arg.GetType() == typeof(UndefinedType); // Error [CS0246]: The type or namespace name 'UndefinedType' could not be found\n            b = arg.GetType() == typeof();              // Error [CS1031]: Type expected\n            b = arg.GetType() == typeof;                // Error [CS1031]: Type expected\n                                                        // Error@-1 [CS1003]: Syntax error, '(' expected\n                                                        // Error@-2 [CS1026]: ) expected\n        }\n    }\n\n    // UnityEngine.Object overloads == and !=. When compared with null it checks if the object was “destroyed” by the engine, not whether the actual reference is null.\n    public class Sample\n    {\n        public void Method(ISomething instance)\n        {\n            _ = !(instance is UnityEngine.Object);     // Fixed\n            _ = instance is UnityEngine.Object;     // Fixed\n            _ = !(instance is UnityEngine.Object);     // Fixed\n        }\n    }\n    // Unity3D is not available as a nuget package and we cannot use the original classes\n    namespace UnityEngine\n    {\n        public class Object { }\n    }\n    public interface ISomething { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/GetTypeWithIsAssignableFrom.Latest.Fixed.cs",
    "content": "﻿Apple apple = new();\nFruit f = apple;\n\nvar b = f is Apple;     // Compliant\nb = f is not Apple;     // Compliant\nb = apple.GetType() == typeof(int?);                // Compliant\nb = apple.GetType().IsInstanceOfType(f.GetType());  // Compliant\nb = !(f is Apple);         // Fixed\nb = !(f is Apple);         // Fixed\nb = f is Apple;     // Fixed\nb = !(f is Apple); // Fixed\nb = f as Apple is Apple { Size: 42 };   // Compliant\nb = f is Apple;        // Fixed\nb = true && (apple != null);   // Fixed\nb = !(apple != null);          // Fixed\n\nif (apple is { }) { }           // Compliant\n\nb = apple is (\"Sweet\", \"Red\");\nb = apple is { Taste: \"Sweet\", Color: \"Red\" };\n\nb = f as Apple is Apple { Prop.Length: 42 };   // Compliant\nb = !(f is Apple);         // Fixed\n\nrecord Fruit\n{\n    public int Size { get; }\n    public int[] Prop { get; }\n}\n\nsealed record Apple : Fruit\n{\n    public string Taste;\n    public string Color;\n    public void Deconstruct(out string x, out string y) => (x, y) = (Taste, Color);\n}\n\npublic class SomeClass : System.Collections.ArrayList\n{\n    public bool SomeMethod(SomeClass a)\n    {\n        return a is [SomeClass];\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/GetTypeWithIsAssignableFrom.Latest.cs",
    "content": "﻿Apple apple = new();\nFruit f = apple;\n\nvar b = f is Apple;     // Compliant\nb = f is not Apple;     // Compliant\nb = apple.GetType() == typeof(int?);                // Compliant\nb = apple.GetType().IsInstanceOfType(f.GetType());  // Compliant\nb = f as Apple == null;         // Noncompliant\nb = f as Apple is null;         // Noncompliant\nb = f as Apple is not null;     // Noncompliant\nb = f as Apple is not not not not null; // Noncompliant\nb = f as Apple is Apple { Size: 42 };   // Compliant\nb = f as Apple is Apple;        // Noncompliant\nb = true && (apple) is Apple;   // Noncompliant\nb = !(apple is Apple);          // Noncompliant\n\nif (apple is { }) { }           // Compliant\n\nb = apple is (\"Sweet\", \"Red\");\nb = apple is { Taste: \"Sweet\", Color: \"Red\" };\n\nb = f as Apple is Apple { Prop.Length: 42 };   // Compliant\nb = f as Apple == null;         // Noncompliant\n\nrecord Fruit\n{\n    public int Size { get; }\n    public int[] Prop { get; }\n}\n\nsealed record Apple : Fruit\n{\n    public string Taste;\n    public string Color;\n    public void Deconstruct(out string x, out string y) => (x, y) = (Taste, Color);\n}\n\npublic class SomeClass : System.Collections.ArrayList\n{\n    public bool SomeMethod(SomeClass a)\n    {\n        return a is [SomeClass];\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/GetTypeWithIsAssignableFrom.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    class GetTypeWithIsAssignableFrom\n    {\n        void Test(bool b)\n        {\n            var expr1 = new GetTypeWithIsAssignableFrom();\n            var expr2 = new GetTypeWithIsAssignableFrom();\n\n            if (expr1.GetType()/*abcd*/.IsAssignableFrom(expr2.GetType() /*efgh*/)) // Noncompliant {{Use the 'IsInstanceOfType()' method instead.}}\n//              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            { }\n            if (expr1.GetType().IsInstanceOfType(expr2)) // Compliant\n            { }\n\n            if (!typeof(GetTypeWithIsAssignableFrom).IsAssignableFrom(expr1.GetType())) // Noncompliant {{Use the 'is' operator instead.}}\n            { }\n            var x = typeof(GetTypeWithIsAssignableFrom).IsAssignableFrom(expr1.GetType()); // Noncompliant\n            if (expr1 is GetTypeWithIsAssignableFrom) // Noncompliant  {{Use a 'null' check instead.}}\n//              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            { }\n\n            if (typeof(GetTypeWithIsAssignableFrom).IsAssignableFrom(typeof(GetTypeWithIsAssignableFrom))) // Compliant\n            { }\n\n            var t1 = expr1.GetType();\n            var t2 = expr2.GetType();\n            if (t1.IsAssignableFrom(t2)) // Compliant\n            { }\n            if (t1.IsAssignableFrom(c: expr2.GetType())) // Noncompliant\n            { }\n\n            if (t1.IsAssignableFrom(typeof(GetTypeWithIsAssignableFrom))) // Compliant\n            { }\n\n            Test(t1.IsAssignableFrom(c: expr2.GetType())); // Noncompliant\n\n            if (expr1 is object) // Compliant - \"is object\" is a commonly used pattern for non-null check\n            { }\n\n            if (expr1 is System.Object) // Compliant - \"is object\" is a commonly used pattern for non-null check\n            { }\n        }\n    }\n    class Fruit { }\n    sealed class Apple : Fruit { }\n    class NonsealedBerry : Fruit { }\n\n    class Program\n    {\n        static void Main()\n        {\n            var apple = new Apple();\n            var berry = new NonsealedBerry();\n            var b = apple.GetType() == typeof(Apple);       // Noncompliant\n            b = berry.GetType() == typeof(NonsealedBerry);  // Compliant, nonsealed class\n            b = typeof(Apple).IsInstanceOfType(apple);      // Noncompliant\n            b = typeof(Apple).IsAssignableFrom(apple.GetType()); // Noncompliant\n            b = typeof(Apple).IsInstanceOfType(apple);      // Noncompliant\n            var appleType = typeof(Apple);\n            b = appleType.IsAssignableFrom(apple.GetType());    // Noncompliant\n\n            b = apple.GetType() == typeof(int?);    // Compliant\n\n            Fruit f = apple;\n            b = true && (((f as Apple)) != null);   // Noncompliant\n            b = f as Apple == null;                 // Noncompliant\n            b = f as Apple == new Apple();\n\n            b = true && ((apple)) is Apple; // Noncompliant\n            b = !(apple is Apple);          // Noncompliant\n            b = f is Apple;\n\n            var num = 5;\n            b = num is int?;\n            b = num is float;\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/3605\n    public class Repro_3605\n    {\n        public string StringProperty { get; set; }\n        public int IntProperty { get; set; }\n        public AnEnum EnumProperty { get; set; }\n\n        public const string stringField = \"Lorem Ipsum\";\n        public const int intField = 1;\n\n        public void Go(Repro_3605 value)\n        {\n            bool result = value.StringProperty is stringField; // Compliant, for pattern matching\n            result = value.IntProperty is intField;            // Compliant, for pattern matching\n            result = value.EnumProperty is AnEnum.Zero;        // Compliant, for pattern matching\n        }\n    }\n\n    public enum AnEnum\n    {\n        Zero = 0\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/6616\n    public class Repro_6616\n    {\n        public void IsInstanceOfType(object obj, Type t)\n        {\n            _ = typeof(ISet<int>).IsInstanceOfType(obj);                            // Noncompliant, bounded generic type\n            _ = typeof(ISet<>).IsInstanceOfType(obj);                               // Compliant, unbonded generic type\n            _ = typeof(IDictionary<int, int>).IsInstanceOfType(obj);                // Noncompliant, bounded generic type\n            _ = typeof(IDictionary<,>).IsInstanceOfType(obj);                       // Compliant, unbonded generic type\n            _ = typeof(System.Collections.Generic.ISet<int>).IsInstanceOfType(obj); // Noncompliant, bounded generic type\n            _ = typeof(System.Collections.Generic.ISet<>).IsInstanceOfType(obj);    // Compliant, unbonded generic type\n\n            _ = t.IsInstanceOfType(obj);                                            // Compliant, not a typeof expression\n            t = typeof(ISet<>);\n            _ = t.IsInstanceOfType(obj);                                            // Compliant, not a typeof expression and value not tracked\n\n            // Error@+1 [CS7003] Unexpected use of an unbound generic name\n            _ = typeof(ISet<ISet<>>).IsInstanceOfType(obj);                         // Noncompliant, FP: omitted type nested\n            // Error@+1 [CS7003] Unexpected use of an unbound generic name\n            _ = typeof(IDictionary<string, ISet<>>).IsInstanceOfType(obj);          // Noncompliant, FP: omitted type nested\n        }\n\n        public void IsAssignableFrom(object obj, Type t1, Type t2)\n        {\n            _ = typeof(HashSet<int>).IsAssignableFrom(obj.GetType());                         // Noncompliant, bounded generic type\n            _ = typeof(HashSet<>).IsAssignableFrom(obj.GetType());                            // Compliant, unbonded generic type\n            _ = typeof(Dictionary<int, int>).IsAssignableFrom(obj.GetType());                 // Noncompliant, bounded generic type\n            _ = typeof(Dictionary<,>).IsAssignableFrom(obj.GetType());                        // Compliant, unbonded generic type\n            _ = typeof(System.Collections.Generic.ISet<int>).IsAssignableFrom(obj.GetType()); // Noncompliant, bounded generic type\n            _ = typeof(System.Collections.Generic.ISet<>).IsAssignableFrom(obj.GetType());    // Compliant, unbonded generic type\n\n            _ = t1.IsAssignableFrom(t2);                                                      // Compliant, not a typeof expression, nor having GetType as arg\n            t1 = typeof(ISet<>);\n            t2 = obj.GetType();\n            _ = t1.IsAssignableFrom(t2);                                                      // Compliant, not a typeof expression, nor having GetType as arg, and values not tracked\n\n            // Error@+1 [CS7003] Unexpected use of an unbound generic name\n            _ = typeof(ISet<ISet<>>).IsAssignableFrom(obj.GetType());                         // Noncompliant, FP: omitted type nested\n            // Error@+1 [CS7003] Unexpected use of an unbound generic name\n            _ = typeof(IDictionary<string, ISet<>>).IsAssignableFrom(obj.GetType());          // Noncompliant, FP: omitted type nested\n        }\n    }\n\n    public class Coverage\n    {\n        public void Foo()\n        {\n            var b = typeof(Apple).IsEquivalentTo(null);\n            this.IsInstanceOfType(\"x\");\n            this.IsAssignableFrom(\"x\");\n            this.GetType(null);\n            var c = this.GetType() == typeof(Apple);\n            var d = GetType() == null;\n        }\n\n        public bool IsInstanceOfType(string x) => true;\n        public bool IsAssignableFrom(string x) => true;\n        public bool GetType(object x) => true;\n        public Type GetType() => null;\n    }\n\n    public class CoverageWithErrors\n    {\n        public void Go(CoverageWithErrors arg)\n        {\n            bool b;\n            this.IsInstanceOfType(\"x\");                 // Error [CS1061]: 'Coverage2' does not contain a definition for 'IsInstanceOfType'\n            b = arg is UndefinedType;                   // Error [CS0246]: The type or namespace name 'UndefinedType' could not be found\n            b = undefined is CoverageWithErrors;        // Error [CS0103]: The name 'undefined' does not exist in the current context\n            b = arg.GetType() == typeof(UndefinedType); // Error [CS0246]: The type or namespace name 'UndefinedType' could not be found\n            b = arg.GetType() == typeof();              // Error [CS1031]: Type expected\n            b = arg.GetType() == typeof;                // Error [CS1031]: Type expected\n                                                        // Error@-1 [CS1003]: Syntax error, '(' expected\n                                                        // Error@-2 [CS1026]: ) expected\n        }\n    }\n\n    // UnityEngine.Object overloads == and !=. When compared with null it checks if the object was “destroyed” by the engine, not whether the actual reference is null.\n    public class Sample\n    {\n        public void Method(ISomething instance)\n        {\n            _ = instance as UnityEngine.Object == null;     // Noncompliant FP https://sonarsource.atlassian.net/browse/NET-3017\n            _ = instance as UnityEngine.Object != null;     // Noncompliant FP\n            _ = instance as UnityEngine.Object is null;     // Noncompliant \n        }\n    }\n    // Unity3D is not available as a nuget package and we cannot use the original classes\n    namespace UnityEngine\n    {\n        public class Object { }\n    }\n    public interface ISomething { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/GotoStatement.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\npublic class GotoStatement\n{\n    void foo(int a)\n    {\n        var @goto = 5;\n\n        goto Label; //Noncompliant {{Remove this use of 'goto'.}}\n//      ^^^^\n\n        Label:\n        ;\n\n        int n = 5;\n        switch (n)\n        {\n            case 1:\n                break;\n            case 2:\n                goto default; //Noncompliant\n//              ^^^^\n            case 3:\n                goto case 1; //Noncompliant\n            default:\n                break;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/GotoStatement.vb",
    "content": "﻿Imports System\n\nPublic Class GotoStatement\n\n    Sub GotoStatement(condition As Boolean)\n\n        If condition Then\n            GoTo Label 'Noncompliant {{Remove this use of 'GoTo'.}}\n'           ^^^^\n        Else\n            Return\n        End If\n\nLabel:\n        Throw New Exception()\n\n    End Sub\n\n    Sub OnError()\n        On Error GoTo nextstep ' Compliant, handled by S2359\nnextstep:\n        System.Console.WriteLine(\"Error\")\n    End Sub\n\nEnd Class\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/GuardConditionOnEqualsOverride.cs",
    "content": "﻿namespace Tests.Diagnostics\n{\n    class Base\n    {\n        public override bool Equals(object other)\n        {\n            if (base.Equals(other)) // Okay; base is object\n            {\n                return true;\n            }\n\n            // do some checks here\n            return false;\n        }\n    }\n\n    class Derived : Base\n    {\n        public override bool Equals(object other)\n        {\n            if (base.Equals(other))  // Noncompliant {{Change this guard condition to call 'object.ReferenceEquals'.}}\n//              ^^^^^^^^^^^^^^^^^^\n            {\n                return true;\n            }\n\n            // do some checks here\n            return false;\n        }\n    }\n\n    class CornerCases\n    {\n        public int Foo\n        {\n            get\n            {\n                return 1;\n            }\n        }\n\n        public override bool Equals(object obj)\n        {\n            Method();\n\n            obj.Equals(obj);\n\n            return true;\n        }\n\n        private void Method() { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/ClearTextProtocolsAreSensitive.Latest.cs",
    "content": "﻿using System;\nusing System.Net;\nusing System.Net.Mail;\n\npublic class Usings\n{\n    public void Method()\n    {\n        using var wc = new WebClient();\n        wc.DownloadData(\"http://foo.com\"); // Noncompliant\n        wc.DownloadData(\"https://foo.com\");\n\n        using var notSet = new SmtpClient(\"host\", 25); // Noncompliant {{EnableSsl should be set to true.}}\n        using var constructorFalse = new SmtpClient(\"host\", 25) { EnableSsl = false }; // Noncompliant\n\n        using var constructor42 = new SmtpClient(\"host\", 25) { EnableSsl = 42 }; // Error [CS0029] Cannot implicitly convert type 'int' to 'bool'\n                                                                                 // Noncompliant@-1 FP\n\n        using var localhosting = new SmtpClient(\"localhosting\", 25); // Noncompliant\n        using var localhost = new SmtpClient(\"localhost\", 25); // Compliant due to well known value\n        using var loopback = new SmtpClient(\"127.0.0.1\", 25); // Compliant due to well known value\n        using var constructorTrue = new SmtpClient(\"host\", 25) { EnableSsl = true };\n\n        using var propertyTrue = new SmtpClient(\"host\", 25); // Compliant, property is set below\n        propertyTrue.EnableSsl = true;\n\n        using var propertyFalse = new SmtpClient(\"host\", 25); // Noncompliant {{EnableSsl should be set to true.}}\n        propertyFalse.EnableSsl = false;\n\n        using var setReset = new SmtpClient(\"host\", 25) { EnableSsl = true }; // FN - it is later set to false\n        setReset.EnableSsl = false;\n    }\n}\n\npublic record Record\n{\n    public string Address { get; init; } = \"http://foo.com\"; // Noncompliant\n\n    public void Method()\n    {\n        using var notSet = new SmtpClient(\"host\", 25); // Noncompliant {{EnableSsl should be set to true.}}\n        using SmtpClient targetNew = new (\"host\", 25); // Noncompliant\n        using SmtpClient targetNewWithInitializer = new(\"host\", 25) {EnableSsl = false }; // Noncompliant\n\n        new TelnetRecord(); // Noncompliant {{Using telnet protocol is insecure. Use ssh instead.}}\n    }\n}\n\npublic record TelnetRecord { }\n\npublic class Telnet { }\n\npublic record struct RecordStruct\n{\n    public string Address { get; init; } = \"http://foo.com\"; // Noncompliant\n\n    public RecordStruct() { }\n\n    public void Method()\n    {\n        new TelnetRecordStruct(); // Noncompliant {{Using telnet protocol is insecure. Use ssh instead.}}\n    }\n\n    public void SetValueAfterObjectInitialization()\n    {\n        var propertyTrue = new SmtpClient(\"host\", 25); // Compliant, property is set below\n        (propertyTrue.EnableSsl, var x1) = (true, 0);\n\n        var propertyFalse = new SmtpClient(\"host\", 25); // Noncompliant\n        (propertyFalse.EnableSsl, var x2) = (false, 0);\n    }\n}\n\npublic record struct TelnetRecordStruct { }\n\npublic class CSharp11\n{\n    void RawStringLiterals()\n    {\n        const string protocol1 = \"\"\"http://\"\"\";\n        const string protocol2 = \"\"\"https://\"\"\";\n        const string address = \"\"\"foo.com\"\"\";\n        const string noncompliant = $\"\"\"{protocol1}{address}\"\"\"; // Noncompliant\n        const string compliant = $\"\"\"{protocol2}{address}\"\"\";\n\n        const string a = \"\"\"http://foo.com\"\"\"; // Noncompliant {{Using http protocol is insecure. Use https instead.}}\n    }\n\n    void Utf8StringLiterals()\n    {\n        var b = \"http://foo.com\"u8; // Noncompliant\n        var c = \"\"\"http://foo.com\"\"\"u8; // Noncompliant\n        var d = \"\"\"\n    http://foo.com\n    \"\"\"u8; // Noncompliant@-2\n    }\n\n    void NewlinesInStringInterpolation()\n    {\n        const string protocol1 = \"http://\";\n        const string protocol2 = \"https://\";\n        const string address = \"foo.com\";\n        const string noncompliant = $\"{protocol1 + // Noncompliant\n            address}\";\n        const string compliant = $\"{protocol2 +\n            address}\";\n    }\n}\n\nclass PrimaryConstructor(string ctorParam = \"http://foo.com\") // Noncompliant\n{\n    void Method(string methodParam = \"http://foo.com\") // Noncompliant\n    {\n        var lambda = (string lambdaParam = \"http://foo.com\") => lambdaParam; // Noncompliant\n    }\n}\n\npublic class Telnet2 { }\n\npublic sealed class Repro\n{\n    public Telnet2[] GetTelnet() => CreateTelnets();\n\n    private static Telnet2[] CreateTelnets() => [new()]; // Noncompliant\n}\n\npublic class CSharp13\n{\n    // https://sonarsource.atlassian.net/browse/NET-450\n    void EscapeSequence()\n    {\n        _ = \"http:/\\e/example.com\";                 // FN\n        _ = \"ftp://anonymous@example.com\\e\";        // FN\n        _ = \"ftp://anonymo\\eus@example.com\";        // FN\n        _ = \"telnet://anonymous@example.com\\u001b\"; // FN\n        _ = \"ftp://anonymous@\\e\";                   // Noncompliant\n        _ = \"ftp://anonymous@\" + '\\e';              // Noncompliant\n    }\n}\n\npublic static class Extensions\n{\n    extension (string s)\n    {\n        public string CompliantProp => \"https://foo.com\";       // Compliant\n        public string NonCompliantProp => \"http://foo.com\";     // Noncompliant\n\n        public string CompliantMethod() => \"https://foo.com\";   // Compliant\n        public string NonCompliantMethod() => \"http://foo.com\";   // Noncompliant\n    }\n}\n\npublic class FieldKeyword\n{\n    public string Compliant { get { return \"https://foo.com\" + field; } set { field = \"https://foo.com\" + value; } }    // Compliant\n    public string NonCompliant\n    {\n        get { return \"http://foo.com\" + field; }    // Noncompliant\n        set { field = \"http://foo.com\" + value; } } // Noncompliant\n}\n\npublic class NullConditionalAssignment\n{\n    public class Sample\n    {\n        public string Url { get; set; }\n    }\n    public void SomeMethod(Sample sample)\n    {\n        sample?.Url = \"https://foo.com\";  // Compliant\n        sample?.Url = \"http://foo.com\";  // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/ClearTextProtocolsAreSensitive.NetFramework.cs",
    "content": "﻿using System.Web.Services;\nusing System.Web.Services.Protocols;\n\n// https://github.com/SonarSource/sonar-dotnet/issues/9017\npublic class MyWebService : WebService\n{\n    [SoapDocumentMethod(Action = \"http://www.contoso.com/GetUserName\")] // Noncompliant - FP\n    public string GetUserName() {\n        return User.Identity.Name;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/ClearTextProtocolsAreSensitive.TopLevelStatements.cs",
    "content": "﻿using System;\nusing System.Net;\nusing System.Net.Mail;\n\nconst string a = \"http://foo.com\"; // Noncompliant {{Using http protocol is insecure. Use https instead.}}\nconst string b = \"https://foo.com\";\n\nconst string e = @\"telnet://anonymous@foo.com\"; // Noncompliant {{Using telnet protocol is insecure. Use ssh instead.}}\nconst string f = @\"ssh://anonymous@foo.com\";\n\nstring i = $\"ftp://anonymous@foo.com\"; // Noncompliant {{Using ftp protocol is insecure. Use sftp, scp or ftps instead.}}\nstring l = $\"ftp://anonymous@127.0.0.1\";\n\nconst string protocol1 = \"http://\";\nconst string protocol2 = \"https://\";\nconst string address = \"foo.com\";\nconst string noncompliant = $\"{protocol1}{address}\"; // Noncompliant\nconst string compliant = $\"{protocol2}{address}\";\n\nstring nestedNoncompliant = $\"{$\"{protocol1}somtehing.\"}{address}\"; // Noncompliant\n// Noncompliant@-1\n\nvoid Method()\n{\n    var a = \"http://foo.com\"; // Noncompliant\n    var b = \"https://foo.com\";\n    var httpProtocolScheme = \"http://\"; // It's compliant when standalone\n    Telnet c = new(); // Noncompliant\n    Telnet d;\n    d = new();        // Noncompliant\n\n    var uri = new Uri(\"http://foo.com\"); // Noncompliant\n    var uriSafe = new Uri(\"https://foo.com\");\n\n    using var wc = new WebClient();\n    wc.DownloadData(\"http://foo.com\"); // Noncompliant\n    wc.DownloadData(\"https://foo.com\");\n}\n\npublic class Telnet { }\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/ClearTextProtocolsAreSensitive.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Net;\nusing System.Net.Mail;\nusing System.Windows.Markup;\nusing System.Xml;\nusing System.Xml.Linq;\nusing System.Xml.Serialization;\n\n[assembly: XmlnsPrefix(\"http://schemas.catelproject.com\", \"catel\")]\n[assembly: XmlnsDefinition(\"http://schemas.catelproject.com\", \"Catel.MVVM\")]\n[assembly: XmlnsCompatibleWith(\"http://www.adatum.com/2003/controls\", \"http://www.adatum.com/2005/controls\")]\n\nnamespace Tests.Diagnostics\n{\n    class ClearTextProtocols\n    {\n        private const string a = \"http://foo.com\"; // Noncompliant {{Using http protocol is insecure. Use https instead.}}\n        private const string b = \"https://foo.com\";\n        private const string c = \"http://localhost\";\n        private const string d = \"http://localhost/path/query?query=xxx\";\n        private const string e = \"http://foo.com/localhost/?query=xxx\"; // Noncompliant\n        private const string f = \"http://foo.com/path/?query=localhost\"; // Noncompliant\n        private const string g = \"http://127.0.0.1\";\n        private const string h = \"http://::1\";\n\n        private const string i = @\"telnet://anonymous@foo.com\"; // Noncompliant {{Using telnet protocol is insecure. Use ssh instead.}}\n        private const string j = @\"ssh://anonymous@foo.com\";\n        private const string k = @\"telnet://anonymous@localhost\";\n        private const string l = \"telnet://anonymous@127.0.0.1\";\n        private const string m = \"telnet://anonymous@::1\";\n\n        private readonly string n = $\"ftp://anonymous@foo.com\"; // Noncompliant {{Using ftp protocol is insecure. Use sftp, scp or ftps instead.}}\n        private readonly string o = $\"sftp://anonymous@foo.com\";\n        private readonly string p = $\"ftp://anonymous@localhost\";\n        private readonly string q = $\"ftp://anonymous@127.0.0.1\";\n        private readonly string r = $\"ftp://anonymous@::1\";\n\n        public void Method(string part, string user, string domain, string ftp)\n        {\n            var a = \"http://foo.com\"; // Noncompliant\n            var b = \"https://foo.com\";\n            var c = \"http://localservername\"; // Noncompliant, it's not a \"localhost\"\n            var d = \"http://localhosting\";\n            var e = \"See http://www.foo.com for more information\";\n            var httpProtocolScheme = \"http://\"; // It's compliant when standalone\n\n            var f = $\"ftp://anonymous@foo.com\"; // Noncompliant\n            var g = $\"ftp://{part}@foo.com\"; // Noncompliant\n            var h = \"ssh://anonymous@foo.com\";\n            var i = \"sftp://anonymous@foo.com\";\n            var ftpProtocolScheme = \"ftp://\"; // It's compliant when standalone\n            var j = \"ftp://\" + user + \"@foo.com\"; // Compliant - FN (protocol is compliant when standallone, check previous case)\n            var k = \"ftp://anonymous@\" + domain;// Noncompliant\n            var l = $\"ftp://anonymous@{domain}\"; // Noncompliant\n            var m = $\"{ftp}://anonymous@foo.com\"; // Compliant\n\n            var n = @\"telnet://anonymous@foo.com\"; // Noncompliant\n            var telnetProtocolScheme = \"telnet://\"; // It's compliant when standalone\n\n            var uri = new Uri(\"http://foo.com\"); // Noncompliant\n            var uriSafe = new Uri(\"https://foo.com\");\n\n        }\n\n        public void Ftp()\n        {\n            bool variable;\n            var notSet = (FtpWebRequest)WebRequest.Create(UntrackedSource()); // Compliant, FN\n\n            var setToFalse = (FtpWebRequest)WebRequest.Create(UntrackedSource());\n            setToFalse.EnableSsl = false;       // Noncompliant {{EnableSsl should be set to true.}}\n            variable = false;\n            setToFalse.EnableSsl = variable;    // Noncompliant\n\n            var setToTrue = (FtpWebRequest)WebRequest.Create(UntrackedSource());\n            setToTrue.EnableSsl = true;\n            variable = true;\n            setToFalse.EnableSsl = variable;\n        }\n\n        private string UntrackedSource() => string.Empty;\n\n        public void TelnetExample() // This line is compliant, even when it contains \"Telnet\" keyword\n        {\n            // Method names\n            var a1 = Telnet(); // Noncompliant\n            var a2 = TelnetClient(); // Noncompliant\n            var a3 = TcpTelnet40(); // Noncompliant\n            var a4 = TcpTelnetClient(); // Noncompliant\n            var a5 = Tcp_Telnet_Client(); // Noncompliant\n            var a6 = TelnetLocalMethod(); // Noncompliant\n\n            // Namespaces\n            var b1 = new Company.Telnet.Client(); // Noncompliant\n            var b2 = new Telnet.Stream(); // Noncompliant\n            var b3 = new Company.TcpTelnetClient.Implementation(); // Noncompliant\n            var b4 = Company.TcpTelnetClient.Implementation.Connect(); // Noncompliant\n\n            // Types\n            var c1 = new ClassNames.Telnet(); // Noncompliant\n            var c2 = new ClassNames.TelnetClient(); // Noncompliant\n            var c3 = new ClassNames.TcpTelnetClient(); // Noncompliant\n\n            // Class names\n            var d1 = TelNet();\n            var d2 = Telnetwork();\n            var d3 = HotelNetwork();\n\n            // Namespaces\n            var e1 = new Company.TelNet.Client();\n            var e2 = new TelNet.Stream();\n            var e3 = new Company.TcpTelnetwork.Implementation();\n            var e4 = Company.TcpTelnetwork.Implementation.Connect();\n\n            // Types\n            var f1 = new ClassNames.TelNet();\n            var f2 = new ClassNames.TelNet();\n            var f3 = new ClassNames.HotelNetwork();\n\n            string TelnetLocalMethod() => string.Empty;\n        }\n\n        private static Stream Telnet() => null;\n        private Stream TelnetClient() => null;\n        private Stream TcpTelnet40() => null; // With protocol version\n        private Stream TcpTelnetClient() => null;\n        private Stream Tcp_Telnet_Client() => null;\n        private static Stream TelNet() => null;\n        private Stream Telnetwork() => null;\n        private Stream HotelNetwork() => null;\n\n        private readonly List<string> links = new List<string>\n        {\n            \"http://foo.com\", // Noncompliant\n            \"Http://foo.com\", // Noncompliant\n            \"HTTP://foo.com\", // Noncompliant\n            \"https://foo.com\",\n            \"telnet://anonymous@foo.com\", // Noncompliant\n            \"TELNET://anonymous@foo.com\", // Noncompliant\n            \"ftp://anonymous@foo.com\", // Noncompliant\n            \"FTP://anonymous@foo.com\" // Noncompliant\n        };\n\n        private readonly List<string> commonlyUsedXmlDomains = new List<string>\n        {\n            \"http://www.w3.org\",\n            \"http://xml.apache.org\",\n            \"http://schemas.xmlsoap.org\",\n            \"http://schemas.openxmlformats.org\",\n            \"http://rdfs.org\",\n            \"http://purl.org\",\n            \"http://xmlns.com\",\n            \"http://schemas.google.com\",\n            \"http://schemas.microsoft.com\",\n            \"http://a9.com\",\n            \"http://ns.adobe.com\",\n            \"http://ltsc.ieee.org\",\n            \"http://docbook.org\",\n            \"http://graphml.graphdrawing.org\",\n            \"http://json-schema.org\",\n            \"http://www.sitemaps.org/schemas/sitemap/0.9\",\n            \"http://exslt.org/common\",\n            \"http://collations.microsoft.com\",\n            \"http://schemas.microsoft.com/framework/2003/xml/xslt/internal\",\n            \"http://docs.oasis-open.org/wss/2004/01/\",\n            \"http://ws-i.org/\",\n            \"http://schemas.android.com/apk/res/android\",\n            \"http://maven.apache.org/POM/4.0.0\",\n            \"http://www.omg.org/spec/UML/20131001\",\n            \"http://www.opengis.net/kml/2.2\",\n            \"http://www.itunes.com\",\n            \"http://www.itunes.com/dtds/podcast-1.0.dtd\",\n            \"http://email:password@subdomain.www.w3.org\",  // Noncompliant\n            \"http://domain.com/www.w3.org\",                // Noncompliant\n            \"http://domain.com/path?domain=www.w3.org\",    // Noncompliant\n            \"http://domain.com?q=www.w3.org\",              // Noncompliant\n            \"http://domain.com#www.w3.org\",                // Noncompliant\n            \"http://subdomain.www.w3.org\",                 // Noncompliant\n            \"http://subdomain.xml.apache.org\",             // Noncompliant\n            \"http://subdomain#www.itunes.com\",             // Noncompliant\n            \"http://subdomain.schemas.xmlsoap.org\",        // Noncompliant\n            \"http://subdomain.schemas.openxmlformats.org\", // Noncompliant\n            \"http://subdomain.rdfs.org\",                   // Noncompliant\n            \"http://subdomain.purl.org\",                   // Noncompliant\n            \"http://subdomain.xmlns.com\",                  // Noncompliant\n            \"http://subdomain.schemas.google.com\",         // Noncompliant\n            \"http://subdomain.schemas.microsoft.com\",      // Noncompliant\n            \"http://subdomain.a9.com\",                     // Noncompliant\n            \"http://subdomain.ns.adobe.com\",               // Noncompliant\n            \"http://subdomain.ltsc.ieee.org\",              // Noncompliant\n            \"http://subdomain.docbook.org\",                // Noncompliant\n            \"http://subdomain.graphml.graphdrawing.org\",   // Noncompliant\n            \"http://subdomain.json-schema.org\",            // Noncompliant\n        };\n\n        private readonly List<string> commonlyUsedExampleDomains = new List<string>\n        {\n            \"http://example.com\",\n            \"http://example.org\",\n            \"http://test.com\",\n            \"http://subdomain.example.com\",\n            \"http://subdomain.example.org\",\n            \"http://subdomain.test.com\",\n            \"http://email:password@subdomain.example.com\",\n            \"http://domain.com/example.com\",               // Noncompliant\n            \"http://domain.com/path?domain=example.com\",   // Noncompliant\n            \"http://domain.com?q=example.com\",             // Noncompliant\n            \"http://domain.com#example.com\",               // Noncompliant\n        };\n    }\n\n    [XmlRoot(ElementName = \"SonarProjectConfig\", Namespace = \"http://www.sonarsource.com/msbuild/analyzer/2021/1\")]\n    public class NamespaceLikeAssignment\n    {\n        private string NamespaceLikeField = \"http://www.sonarsource.com/msbuild/analyzer/2021/1\";\n        private string NamespaceLikeProperty { get; set; }\n\n        private string FooNamespace = \"http://www.sonarsource.com/msbuild/analyzer/2021/1\";\n        private string FOO_NAMESPACE { get; set; }\n\n        public void Foo(string namespaceLikeArgument)\n        {\n            var namespaceLikeVar = \"http://www.sonarsource.com/msbuild/analyzer/2021/1\";\n            namespaceLikeArgument = \"http://www.sonarsource.com/msbuild/analyzer/2021/1\";\n            NamespaceLikeField = \"http://www.sonarsource.com/msbuild/analyzer/2021/1\";\n            NamespaceLikeProperty = \"http://www.sonarsource.com/msbuild/analyzer/2021/1\";\n            FooNamespace = \"http://www.sonarsource.com/msbuild/analyzer/2021/1\";\n            FOO_NAMESPACE = \"http://www.sonarsource.com/msbuild/analyzer/2021/1\";\n        }\n\n        public void Bar(string NamespaceLikeArgument = \"http://www.sonarsource.com/msbuild/analyzer/2021/123\") { }\n    }\n\n    [MyAttribute(\"http://www.sonarsource.com/msbuild/analyzer/2021/123\")]  // Noncompliant\n    [XmlRoot(ElementName = \"SonarProjectConfig\", Namespace = \"ftp://a:a@foo.com/\")]  // Noncompliant\n    public class NamespaceLikeAssignment2\n    {\n        private string NamespaceLikeField = \"ftp://a:a@foo.com/\";  // Noncompliant\n        private string NamespaceLikeProperty { get; set; }\n\n\n        private string NamefooLikeField = \"http://www.sonarsource.com/msbuild/analyzer/2021/1\";  // Noncompliant\n        private string NamefooLikeProperty { get; set; }\n\n        public void Foo(string namefooLikeArgument, string namespaceLikeArgument = \"ftp://a:a@foo.com/\")  // Noncompliant\n        {\n            var namespaceLikeVar = \"ftp://a:a@foo.com/\";  // Noncompliant\n            namespaceLikeArgument = \"ftp://a:a@foo.com/\";  // Noncompliant\n            NamespaceLikeField = \"ftp://a:a@foo.com/\";  // Noncompliant\n            NamespaceLikeProperty = \"ftp://a:a@foo.com/\";  // Noncompliant\n\n            string[] namespaceArray = new string[1];\n            namespaceArray[0] = \"http://www.sonarsource.com/msbuild/analyzer/2021/1\";  // Noncompliant\n\n            var namefooLikeVar = \"http://www.sonarsource.com/msbuild/analyzer/2021/1\";  // Noncompliant\n            namefooLikeArgument = \"http://www.sonarsource.com/msbuild/analyzer/2021/1\";  // Noncompliant\n            NamefooLikeField = \"http://www.sonarsource.com/msbuild/analyzer/2021/1\";  // Noncompliant\n            NamefooLikeProperty = \"http://www.sonarsource.com/msbuild/analyzer/2021/1\";  // Noncompliant\n        }\n    }\n\n    public class MyAttribute : Attribute\n    {\n        public MyAttribute(string str) {\n        }\n    }\n\n    [XmlRoot(Namespace=XML_NAMESPACE)]\n    public class NamespaceInConstant {\n        public const string XML_NAMESPACE = \"http://x\";\n        public const string XML_FOOSPACE = \"http://x\";  // Noncompliant\n    }\n\n    public static class Constants {\n        public const String NAMESPACE1 = \"http://x\";\n        public const String FOOSPACE1 = \"http://x\";  // Noncompliant\n    }\n\n    [XmlType(Namespace = \"http://www.cpandl.com\")]\n    public class Serialize\n    {\n        [XmlElement(Namespace = \"http://www.cpandl.com\")]\n        public string Title;\n\n        [XmlAttribute(Namespace = \"http://www.cpandl.com\")]\n        public string Currency;\n    }\n\n    public class XmlSerializerTests\n    {\n        public void XmlSerializerTypes()\n        {\n            var ns = new XmlSerializerNamespaces();\n            ns.Add(\"books\", \"http://www.cpandl.com\");\n            ns.Add(\"money\", \"http://www.cohowinery.com\");\n        }\n\n        public class TestXmlSerializationWriter : XmlSerializationWriter\n        {\n            public void M()\n            {\n                this.WriteElementStringRaw(\"name\", \"http://www.cohowinery.com\", \"value\");\n            }\n\n            protected override void InitCallbacks() { }\n        }\n    }\n\n    public class xmlTests\n    {\n        public void XmlTypes()\n        {\n            var qn = new XmlQualifiedName(\"books\", \"http://www.cpandl.com\");\n            var nsManager = new XmlNamespaceManager(null);\n            nsManager.AddNamespace(\"prefix\", \"http://www.cpandl.com\");\n            nsManager.RemoveNamespace(\"prefix\", \"http://www.cpandl.com\");\n            nsManager.LookupPrefix(\"http://www.cpandl.com\");\n            var doc = new XmlDocument();\n            doc.CreateAttribute(\"prefix\", \"localName\", \"http://www.cpandl.com\");\n            doc.CreateElement(\"prefix\", \"localName\", \"http://www.cpandl.com\");\n            doc.CreateNode(\"nodeTypeString\", \"localName\", \"http://www.cpandl.com\");\n            using (XmlWriter writer = XmlWriter.Create(\"output.xml\"))\n            {\n                writer.WriteStartElement(\"localName\", \"http://www.cpandl.com\");\n                writer.WriteElementString(\"localName\", \"http://www.cpandl.com\", \"value\");\n                writer.WriteElementString(\"localName\", \"http://www.cpandl.com\"); // Noncompliant. uri is passed to the \"value\" parameter\n            }\n        }\n    }\n\n    public class XamlTests\n    {\n        public void XmlnsDictionaryTest()\n        {\n            var dict = new XmlnsDictionary();\n            dict.Add(\"prefix\", \"http://www.cpandl.com\");\n            dict.LookupPrefix(\"http://www.cpandl.com\");\n        }\n    }\n\n    public class XmlLinqTests\n    {\n        public void XNamespaceTest()\n        {\n            XNamespace.Get(\"http://www.cpandl.com\");\n            XNamespace ns = \"http://www.cpandl.com\"; // Noncompliant FP. Implicit conversion from string to XNamespace is not supported\n        }\n    }\n\n    public class ConstructorInitializerTest\n    {\n        public class Base\n        {\n            public Base(): this(\"http://www.cpandl.com\") // Noncompliant\n            { }\n            public Base(string name) {  }\n        }\n\n        public class Derived: Base\n        {\n            public Derived(): base(\"http://www.cpandl.com\") // Noncompliant\n            { }\n        }\n    }\n}\n\nnamespace Company.Telnet\n{\n    public class Client { }\n}\n\nnamespace Telnet\n{\n    public class Stream { }\n}\n\nnamespace Company.TcpTelnetClient\n{\n    public class Implementation\n    {\n        public static Stream Connect() => null;\n    }\n}\n\nnamespace ClassNames\n{\n    public class Telnet { }\n    public class TelnetClient { }\n    public class TcpTelnetClient { }\n}\n\nnamespace Company.TelNet\n{\n    public class Client { }\n}\n\nnamespace TelNet\n{\n    public class Stream { }\n}\n\nnamespace Company.TcpTelnetwork\n{\n    public class Implementation\n    {\n        public static Stream Connect() => null;\n    }\n}\n\nnamespace ClassNames\n{\n    public class TelNet { }\n    public class Telnetwork { }\n    public class HotelNetwork { }\n}\n\n// Fakes. This can be removed once the WPF framework and System.Xaml can be referenced\nnamespace System.Windows.Markup\n{\n    public sealed class XmlnsPrefixAttribute : Attribute\n    {\n        public XmlnsPrefixAttribute(string ns1, string ns2) { }\n    }\n    public sealed class XmlnsDefinitionAttribute : Attribute\n    {\n        public XmlnsDefinitionAttribute(string ns1, string ns2) { }\n    }\n    public sealed class XmlnsCompatibleWithAttribute : Attribute\n    {\n        public XmlnsCompatibleWithAttribute(string ns1, string ns2) { }\n    }\n    public class XmlnsDictionary\n    {\n        public void Add(string prefix, string xmlNamespace) => throw new NotImplementedException();\n        public string LookupPrefix(string xmlNamespace) => throw new NotImplementedException();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/CommandPath.Latest.cs",
    "content": "﻿using System.Diagnostics;\n\npublic class Program\n{\n    private const string fileName = \"file\";\n    private const string extension = \"exe\";\n    private const string compliantField = @$\"C:\\{fileName}.{extension}\";\n    private const string noncompliantField = @$\"{fileName}.{extension}\";\n\n    public void SomeMethod()\n    {\n        Process.Start(noncompliantField); // Noncompliant\n        Process.Start(compliantField);\n    }\n}\n\npublic class Program2\n{\n    private const string fileName = \"\"\"file\"\"\";\n    private const string extension = \"\"\"exe\"\"\";\n    private const string compliantField = $\"\"\"C:\\{fileName}.{extension}\"\"\";\n    private const string noncompliantField = $\"\"\"{fileName}.{extension}\"\"\";\n    private const string noncompliantNonInterpolatedField = \"\"\"file.exe\"\"\";\n\n    public void SomeMethod()\n    {\n        Process.Start(noncompliantField); // Noncompliant\n        Process.Start(compliantField);\n        Process.Start(noncompliantNonInterpolatedField); // Noncompliant\n    }\n}\n\nclass PrimaryConstructor(string ctorParam = \"file.exe\")\n{\n    void Method(string methodParam = \"file.exe\")\n    {\n        Process.Start(ctorParam); // FN\n        Process.Start(methodParam); // FN\n        var lambda = (string lambdaParam = \"file.exe\") => Process.Start(lambdaParam); // FN\n    }\n}\n\nclass NewEscapeSequence\n{\n    private const string fileName = \".\\efile\";\n\n    void EscapeSequence()\n    {\n        Process.Start(\".\\efile.fake\");   // Noncompliant\n        Process.Start(\"\\e/file.exe\");    // Noncompliant\n        Process.Start($\"{fileName}.exe\");   // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/CommandPath.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Security;\n\npublic class Program\n{\n    private string compliantField = @\"C:\\file.exe\";\n    private string noncompliantField = \"file.exe\";\n\n    private Process field = Process.Start(\"file.exe\");                      // Noncompliant\n    public Process PropertyRW { get; set; } = Process.Start(\"file.exe\");    // Noncompliant\n    public Process PropertyRO => Process.Start(\"file.exe\");                 // Noncompliant\n    public Process PropertyUnused { get; set; }     // For coverage\n\n    public void Invocations(SecureString password)\n    {\n        var compliantVariable = @\"C:\\file.exe\";\n        var noncompliantVariable = @\"file.exe\";\n        string nullVariable = null;\n        var startInfo = new ProcessStartInfo(\"bad.exe\");    // Noncompliant {{Make sure the \"PATH\" variable only contains fixed, unwriteable directories.}}\n        //              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n        // Compliant\n        Process.Start(startInfo);       // Not tracked here, it's already raised on the constructor\n        Process.Start(\"\");\n        Process.Start(nullVariable);\n        Process.Start(@\"C:\\file.exe\");\n        Process.Start(@\"C:\\file.exe\", \"arguments\");\n        Process.Start(@\"C:\\file.exe\", \"arguments\", \"userName\", password, \"domain\");\n        Process.Start(@\"C:\\file.exe\", \"userName\", password, \"domain\");\n        Process.Start(compliantField);\n        Process.Start(compliantVariable);\n        new ProcessStartInfo();\n        new ProcessStartInfo(@\"C:\\file.exe\");\n        new ProcessStartInfo(@\"C:\\file.exe\", \"arguments\");\n\n        Process.Start(\"file.exe\");                      // Noncompliant\n        Process.Start(\"file.exe\", \"arguments\");         // Noncompliant\n        Process.Start(\"file.exe\", \"arguments\", \"userName\", password, \"domain\"); // Noncompliant\n        Process.Start(\"file.exe\", \"userName\", password, \"domain\");              // Noncompliant\n        Process.Start(noncompliantField);               // Noncompliant\n        Process.Start(noncompliantVariable);            // Noncompliant\n        new ProcessStartInfo(\"file.exe\");               // Noncompliant\n        new ProcessStartInfo(\"file.exe\", \"arguments\");  // Noncompliant\n\n        // Reassignment\n        compliantField = noncompliantVariable;\n        Process.Start(compliantField);                  // Noncompliant\n        noncompliantVariable = compliantVariable;\n        Process.Start(noncompliantVariable);            // Compliant after reassignment\n    }\n\n    public void Properties(ProcessStartInfo arg)\n    {\n        arg.FileName = @\"C:\\file.exe\";\n        arg.FileName = \"file.exe\";              // Noncompliant\n\n        var psi = new ProcessStartInfo(@\"C:\\file.exe\");\n        psi.FileName = \"file.exe\";              // Noncompliant\n\n        psi = new ProcessStartInfo(\"bad.exe\");  // Noncompliant, later assignment is not tracked\n        psi.FileName = @\"C:\\file.exe\";\n\n        psi = new ProcessStartInfo() { FileName = @\"C:\\file.exe\" };\n        psi = new ProcessStartInfo { FileName = \"bad.exe\" };        // Noncompliant\n        psi = new ProcessStartInfo() { FileName = \"bad.exe\" };      // Noncompliant\n        psi = new ProcessStartInfo() { FileName = \"bad.exe\" };      // Noncompliant FP, value is reassigned later\n        psi.FileName = @\"C:\\file.exe\";\n\n        psi = new ProcessStartInfo() { FileName = \"bad.exe\" };     // Noncompliant\n        Process.Start(psi);\n        psi.FileName = @\"C:\\file.exe\";\n\n        psi = new ProcessStartInfo() { FileName = \"bad.exe\" };     // Noncompliant\n        Run(psi);\n        psi.FileName = @\"C:\\file.exe\";\n    }\n\n    private void Run(ProcessStartInfo psi) => Process.Start(psi);\n\n    public void PathFormat()\n    {\n        // Compliant prefixes\n        Process.Start(\"/file\");\n        Process.Start(\"/File\");\n        Process.Start(\"/dir/dir/dir/file\");\n        Process.Start(\"//////file\");        // Compliant, we don't validate the path format itself\n        Process.Start(\"/file.exe\");\n        Process.Start(\"./file.exe\");\n        Process.Start(\"../file.exe\");\n        Process.Start(\"c:\");\n        Process.Start(\"c:/file.exe\");\n        Process.Start(\"C:/file.exe\");\n        Process.Start(\"D:/file.exe\");\n        Process.Start(\"//server/file.exe\");\n        Process.Start(\"//server/dir/file.exe\");\n        Process.Start(\"//server/c$/file.exe\");\n        Process.Start(\"//10.0.0.1/dir/file.exe\");\n        Process.Start(@\"\\file.exe\");\n        Process.Start(@\"\\\\\\\\\\\\file\");        // Compliant, we don't validate the path format itself\n        Process.Start(@\".\\file.exe\");\n        Process.Start(@\"..\\file.exe\");\n        Process.Start(@\"c:\\file.exe\");\n        Process.Start(@\"C:\\file.exe\");\n        Process.Start(@\"C:file.exe\");       // Missing \"\\\" after drive letter: Valid relative path from current directory of the C: drive\n        Process.Start(@\"C:Dir\\file.exe\");   // Missing \"\\\" after drive letter: Valid relative path from current directory of the C: drive\n        Process.Start(@\"C:\\dir\\file.exe\");\n        Process.Start(@\"D:\\file.exe\");\n        Process.Start(@\"z:\\file.exe\");\n        Process.Start(@\"Z:\\file.exe\");\n        Process.Start(@\"\\\\server\\file.exe\");\n        Process.Start(@\"\\\\server\\dir\\file.exe\");\n        Process.Start(@\"\\\\server\\c$\\file.exe\");\n        Process.Start(@\"\\\\10.0.0.1\\dir\\file.exe\");\n        Process.Start(\"http://www.microsoft.com\");\n        Process.Start(\"https://www.microsoft.com\");\n        Process.Start(\"ftp://www.microsoft.com\");\n        // Compliant, custom protocols used to start an application\n        Process.Start(\"skype:echo123?call\");\n        Process.Start(\"AA:/file.exe\");\n        Process.Start(\"Ř:/file.exe\");\n        Process.Start(\"ř:/file.exe\");\n        Process.Start(@\"AA:\\file.exe\");\n        Process.Start(@\"Ř:\\file.exe\");\n        Process.Start(@\"ř:\\file.exe\");\n        Process.Start(\"0:/file.exe\");\n        Process.Start(@\"0:\\file.exe\");\n\n        Process.Start(\"file\");          // Noncompliant\n        Process.Start(\"file.exe\");      // Noncompliant\n        Process.Start(\"File.bat\");      // Noncompliant\n        Process.Start(\"dir/file.cmd\");  // Noncompliant\n        Process.Start(\"-file.com\");     // Noncompliant\n        Process.Start(\"@file.cpl\");     // Noncompliant\n        Process.Start(\"$file.dat\");     // Noncompliant\n        Process.Start(\".file.txt\");     // Noncompliant\n        Process.Start(\".|file.fake\");   // Noncompliant\n        Process.Start(\"~/file.exe\");    // Noncompliant\n        Process.Start(\"...file.exe\");   // Noncompliant\n        Process.Start(\".../file.exe\");  // Noncompliant\n        Process.Start(@\"...\\file.exe\"); // Noncompliant\n    }\n}\n\nnamespace CustomType\n{\n    public class ProcessStartInfo\n    {\n        public string FileName { get; set; }\n\n        public ProcessStartInfo(string fileName) { }\n\n        public static void Usage()\n        {\n            var psi = new ProcessStartInfo(\"bad.exe\");  // Compliant with this custom class\n            psi.FileName = \"file.exe\";                  // Compliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/CommandPath.vb",
    "content": "﻿Imports System.Collections.Generic\nImports System.Diagnostics\nImports System.Security\n\nPublic Class Program\n\n    Private CompliantField As String = \"C:\\file.exe\"\n    Private NoncompliantField As String = \"file.exe\"\n\n    Private Field As Process = Process.Start(\"file.exe\")                ' Noncompliant\n    Public Property PropertyRW As Process = Process.Start(\"file.exe\")   ' Noncompliant\n    Public Property PropertyUnused As Process       ' For coverage\n\n    Public Sub Invocations(Password As SecureString)\n        Dim CompliantVariable As String = \"C:\\file.exe\"\n        Dim NoncompliantVariable As String = \"file.exe\"\n        Dim NothingVariable As String = Nothing\n        Dim StartInfo As New ProcessStartInfo(\"bad.exe\")    ' Noncompliant {{Make sure the \"PATH\" variable only contains fixed, unwriteable directories.}}\n        '                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n        ' Compliant\n        Process.Start(StartInfo)       ' Not tracked here, it's already raised on the constructor\n        Process.Start(\"\")\n        Process.Start(NothingVariable)\n        Process.Start(\"C:\\file.exe\")\n        Process.Start(\"C:\\file.exe\", \"arguments\")\n        Process.Start(\"C:\\file.exe\", \"arguments\", \"userName\", Password, \"domain\")\n        Process.Start(\"C:\\file.exe\", \"userName\", Password, \"domain\")\n        Process.Start(CompliantField)\n        Process.Start(CompliantVariable)\n        StartInfo = New ProcessStartInfo()\n        StartInfo = New ProcessStartInfo(\"C:\\file.exe\")\n        StartInfo = New ProcessStartInfo(\"C:\\file.exe\", \"arguments\")\n\n        Process.Start(\"file.exe\")                       ' Noncompliant\n        Process.Start(\"file.exe\", \"arguments\")          ' Noncompliant\n        Process.Start(\"file.exe\", \"arguments\", \"userName\", Password, \"domain\")  ' Noncompliant\n        Process.Start(\"file.exe\", \"userName\", Password, \"domain\")               ' Noncompliant\n        Process.Start(NoncompliantField)                ' Noncompliant\n        Process.Start(NoncompliantVariable)             ' Noncompliant\n        StartInfo = New ProcessStartInfo(\"file.exe\")                ' Noncompliant\n        StartInfo = New ProcessStartInfo(\"file.exe\", \"arguments\")   ' Noncompliant\n\n        ' Reassignment\n        CompliantField = NoncompliantVariable\n        Process.Start(CompliantField)                   ' Noncompliant\n        NoncompliantVariable = CompliantVariable\n        Process.Start(NoncompliantVariable)             ' Compliant after reassignment\n    End Sub\n\n    Public Sub Properties(Arg As ProcessStartInfo)\n        Arg.FileName = \"C:\\file.exe\"\n        Arg.FileName = \"file.exe\"               ' Noncompliant\n\n        Dim psi As New ProcessStartInfo(\"C:\\file.exe\")\n        psi.FileName = \"file.exe\"               ' Noncompliant\n\n        psi = New ProcessStartInfo(\"bad.exe\")   ' Noncompliant, later assignment is not tracked\n        psi.FileName = \"C:\\file.exe\"\n\n        psi = New ProcessStartInfo() With {.FileName = \"C:\\file.exe\"}\n        psi = New ProcessStartInfo With {.FileName = \"bad.exe\"}     ' FN\n        psi = New ProcessStartInfo() With {.FileName = \"bad.exe\"}   ' FN\n        psi = New ProcessStartInfo() With {.FileName = \"bad.exe\"}   ' Compliant, reassigned later\n        psi.FileName = \"C:\\file.exe\"\n\n        psi = New ProcessStartInfo() With {.FileName = \"bad.exe\"}   ' FN\n        Process.Start(psi)\n        psi.FileName = \"C:\\file.exe\"\n\n        psi = New ProcessStartInfo() With {.FileName = \"bad.exe\"}   ' FN\n        Run(psi)\n        psi.FileName = \"C:\\file.exe\"\n    End Sub\n\n    Private Sub Run(Psi As ProcessStartInfo)\n        Process.Start(Psi)\n    End Sub\n\n    Public Sub PathFormat()\n        ' Compliant prefixes\n        Process.Start(\"/file\")\n        Process.Start(\"/File\")\n        Process.Start(\"/dir/dir/dir/file\")\n        Process.Start(\"//////file\")        ' Compliant, we don't validate the path format itself\n        Process.Start(\"/file.exe\")\n        Process.Start(\"./file.exe\")\n        Process.Start(\"../file.exe\")\n        Process.Start(\"c:\")\n        Process.Start(\"c:/file.exe\")\n        Process.Start(\"C:/file.exe\")\n        Process.Start(\"D:/file.exe\")\n        Process.Start(\"//server/file.exe\")\n        Process.Start(\"//server/dir/file.exe\")\n        Process.Start(\"//server/c$/file.exe\")\n        Process.Start(\"//10.0.0.1/dir/file.exe\")\n        Process.Start(\"\\file.exe\")\n        Process.Start(\"\\\\\\\\\\\\file\")        ' Compliant, we don't validate the path format itself\n        Process.Start(\".\\file.exe\")\n        Process.Start(\"..\\file.exe\")\n        Process.Start(\"c:\\file.exe\")\n        Process.Start(\"C:\\file.exe\")\n        Process.Start(\"C:file.exe\")       ' Missing \"\\\" after drive letter: Valid relative path from current directory Of the C: drive\n        Process.Start(\"C:Dir\\file.exe\")   ' Missing \"\\\" after drive letter: Valid relative path from current directory Of the C: drive\n        Process.Start(\"C:\\dir\\file.exe\")\n        Process.Start(\"D:\\file.exe\")\n        Process.Start(\"z:\\file.exe\")\n        Process.Start(\"Z:\\file.exe\")\n        Process.Start(\"\\\\server\\file.exe\")\n        Process.Start(\"\\\\server\\dir\\file.exe\")\n        Process.Start(\"\\\\server\\c$\\file.exe\")\n        Process.Start(\"\\\\10.0.0.1\\dir\\file.exe\")\n        Process.Start(\"http://www.microsoft.com\")\n        Process.Start(\"https://www.microsoft.com\")\n        Process.Start(\"ftp://www.microsoft.com\")\n        ' Compliant, custom protocols used to start an application\n        Process.Start(\"skype:echo123?call\")\n        Process.Start(\"AA:/file.exe\")\n        Process.Start(\"Ř:/file.exe\")\n        Process.Start(\"ř:/file.exe\")\n        Process.Start(\"AA:\\file.exe\")\n        Process.Start(\"Ř:\\file.exe\")\n        Process.Start(\"ř:\\file.exe\")\n        Process.Start(\"0:/file.exe\")\n        Process.Start(\"0:\\file.exe\")\n\n        Process.Start(\"file\")           ' Noncompliant\n        Process.Start(\"file.exe\")       ' Noncompliant\n        Process.Start(\"File.bat\")       ' Noncompliant\n        Process.Start(\"dir/file.cmd\")   ' Noncompliant\n        Process.Start(\"-file.com\")      ' Noncompliant\n        Process.Start(\"@file.cpl\")      ' Noncompliant\n        Process.Start(\"$file.dat\")      ' Noncompliant\n        Process.Start(\".file.txt\")      ' Noncompliant\n        Process.Start(\".|file.fake\")    ' Noncompliant\n        Process.Start(\"~/file.exe\")     ' Noncompliant\n        Process.Start(\"...file.exe\")    ' Noncompliant\n        Process.Start(\".../file.exe\")   ' Noncompliant\n        Process.Start(\"...\\file.exe\")   ' Noncompliant\n    End Sub\n\nEnd Class\n\nNamespace CustomType\n\n    Public Class ProcessStartInfo\n\n        Public Property FileName As String\n\n        Public Sub New(fileName As String)\n        End Sub\n\n        Public Shared Sub Usage()\n            Dim psi As New ProcessStartInfo(\"bad.exe\")  ' Compliant with this custom class\n            psi.FileName = \"file.exe\"                   ' Compliant\n        End Sub\n\n    End Class\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/ConfiguringLoggers_AspNetCore.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Hosting;\nusing Microsoft.Extensions.Configuration;\nusing Microsoft.Extensions.DependencyInjection;\nusing Microsoft.Extensions.Logging;\nusing Microsoft.Extensions.Options;\nusing Microsoft.AspNetCore;\n\nnamespace MvcApp\n{\n    //RSPEC S4792: https://jira.sonarsource.com/browse/RSPEC-4792\n    public class ProgramLogging\n    {\n        public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>\n            WebHost.CreateDefaultBuilder(args) // Noncompliant {{Make sure that this logger's configuration is safe.}}\n                .ConfigureLogging((hostingContext, logging) =>\n                {\n                    // ...\n                })\n                .UseStartup<StartupLogging>();\n    }\n\n\n    public class StartupLogging\n    {\n        public void ConfigureServices(IServiceCollection services)\n        {\n            services.AddLogging(logging => // Noncompliant {{Make sure that this logger's configuration is safe.}}\n            {\n                // ...\n            });\n        }\n\n        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)\n        {\n            IConfiguration config = null;\n            LogLevel level = LogLevel.Critical;\n            bool includeScopes = false;\n            Func<string, Microsoft.Extensions.Logging.LogLevel, bool> filter = null;\n            Microsoft.Extensions.Logging.Console.IConsoleLoggerSettings consoleSettings = null;\n            Microsoft.Extensions.Logging.AzureAppServices.AzureAppServicesDiagnosticsSettings azureSettings = null;\n            Microsoft.Extensions.Logging.EventLog.EventLogSettings eventLogSettings = null;\n\n            // An issue will be raised for each call to an ILoggerFactory extension methods adding loggers.\n            loggerFactory.AddAzureWebAppDiagnostics();\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^    {{Make sure that this logger's configuration is safe.}}\n            loggerFactory.AddAzureWebAppDiagnostics(azureSettings); // Noncompliant\n            loggerFactory.AddConsole(); // Noncompliant\n            loggerFactory.AddConsole(level); // Noncompliant\n            loggerFactory.AddConsole(level, includeScopes); // Noncompliant\n            loggerFactory.AddConsole(filter); // Noncompliant\n            loggerFactory.AddConsole(filter, includeScopes); // Noncompliant\n            loggerFactory.AddConsole(config); // Noncompliant\n            loggerFactory.AddConsole(consoleSettings); // Noncompliant\n            loggerFactory.AddDebug(); // Noncompliant\n            loggerFactory.AddDebug(level); // Noncompliant\n            loggerFactory.AddDebug(filter); // Noncompliant\n            loggerFactory.AddEventLog(); // Noncompliant\n            loggerFactory.AddEventLog(eventLogSettings); // Noncompliant\n            loggerFactory.AddEventLog(level); // Noncompliant\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^    {{Make sure that this logger's configuration is safe.}}\n\n            // Testing the next method using a hack - see notes at the end of the file\n            loggerFactory.AddEventSourceLogger(); // Noncompliant\n\n            IEnumerable<ILoggerProvider> providers = null;\n            LoggerFilterOptions filterOptions1 = null;\n            IOptionsMonitor<LoggerFilterOptions> filterOptions2 = null;\n\n            LoggerFactory factory = new LoggerFactory(); // Noncompliant\n//                                  ^^^^^^^^^^^^^^^^^^^    {{Make sure that this logger's configuration is safe.}}\n\n            new LoggerFactory(providers); // Noncompliant\n            new LoggerFactory(providers, filterOptions1); // Noncompliant\n            new LoggerFactory(providers, filterOptions2); // Noncompliant\n        }\n\n        public void AdditionalTests(IWebHostBuilder webHostBuilder,  IServiceCollection serviceDescriptors)\n        {\n            var factory = new MyLoggerFactory();\n//                        ^^^^^^^^^^^^^^^^^^^^^\n            new MyLoggerFactory(\"data\"); // Noncompliant\n\n            // Calling extension methods as static methods\n            WebHostBuilderExtensions.ConfigureLogging(webHostBuilder, (Action<ILoggingBuilder>)null);            // Noncompliant\n            LoggingServiceCollectionExtensions.AddLogging(serviceDescriptors, (Action<ILoggingBuilder>)null);    // Noncompliant\n\n            AzureAppServicesLoggerFactoryExtensions.AddAzureWebAppDiagnostics(factory, null);    // Noncompliant\n            ConsoleLoggerExtensions.AddConsole(factory);                            // Noncompliant\n            DebugLoggerFactoryExtensions.AddDebug(factory);                         // Noncompliant\n            EventLoggerFactoryExtensions.AddEventLog(factory);                      // Noncompliant\n            EventSourceLoggerFactoryExtensions.AddEventSourceLogger(factory);       // Noncompliant\n        }\n    }\n\n    public class MyLoggerFactory : ILoggerFactory\n    {\n        public MyLoggerFactory() { }\n        public MyLoggerFactory(string data) { }\n\n        public void AddProvider(ILoggerProvider provider) { /* no-op */ }\n        public ILogger CreateLogger(string categoryName) => null;\n        public void Dispose() { /* no-op */ }\n    }\n}\n\n// HACK - the tests are not currently built againts NET Core 2.0 so one of the\n// methods we want to test is not available. Instead, we'll define a type with\n// the expected name and method signature\nnamespace Microsoft.Extensions.Logging\n{\n    internal static class EventSourceLoggerFactoryExtensions\n    {\n        public static void AddEventSourceLogger(this ILoggerFactory factory) { /* no-op */ }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/ConfiguringLoggers_AspNetCore.vb",
    "content": "﻿Imports System\nImports System.Collections\nImports System.Collections.Generic\nImports Microsoft.AspNetCore\nImports Microsoft.AspNetCore.Builder\nImports Microsoft.AspNetCore.Hosting\nImports Microsoft.Extensions.Configuration\nImports Microsoft.Extensions.DependencyInjection\nImports Microsoft.Extensions.Logging\nImports Microsoft.Extensions.Options\n\nNamespace MvcApp\n\n    Public Class ProgramLogging\n\n        Public Shared Function CreateWebHostBuilder(args As String()) As IWebHostBuilder\n\n            Dim host = WebHost.CreateDefaultBuilder(args)\n            host.ConfigureLogging(Function(hostingContext, Logging)  ' Noncompliant\n                                      ' ...\n                                  End Function) _\n            .UseStartup(Of StartupLogging)()\n\n            '...\n        End Function\n    End Class\n\n\n    Public Class StartupLogging\n\n        Public Sub ConfigureServices(services As IServiceCollection)\n\n            services.AddLogging(Function(logging) ' Noncompliant\n                                    '...\n                                End Function)\n        End Sub\n\n        Public Sub Configure(app As IApplicationBuilder, env As IHostingEnvironment, loggerFactory As ILoggerFactory)\n\n            Dim config As IConfiguration = Nothing\n            Dim level As LogLevel = LogLevel.Critical\n            Dim includeScopes As Boolean = False\n            Dim filter As Func(Of String, Microsoft.Extensions.Logging.LogLevel, Boolean) = Nothing\n            Dim consoleSettings As Microsoft.Extensions.Logging.Console.IConsoleLoggerSettings = Nothing\n            Dim azureSettings As Microsoft.Extensions.Logging.AzureAppServices.AzureAppServicesDiagnosticsSettings = Nothing\n            Dim eventLogSettings As Microsoft.Extensions.Logging.EventLog.EventLogSettings = Nothing\n\n            ' An issue will be raised for each call to an ILoggerFactory extension methods adding loggers.\n            loggerFactory.AddAzureWebAppDiagnostics() ' Noncompliant\n            loggerFactory.AddAzureWebAppDiagnostics(azureSettings) ' Noncompliant\n            loggerFactory.AddConsole() ' Noncompliant\n            loggerFactory.AddConsole(level) ' Noncompliant\n            loggerFactory.AddConsole(level, includeScopes) ' Noncompliant\n            loggerFactory.AddConsole(filter) ' Noncompliant\n            loggerFactory.AddConsole(filter, includeScopes) ' Noncompliant\n            loggerFactory.AddConsole(config) ' Noncompliant\n            loggerFactory.AddConsole(consoleSettings) ' Noncompliant\n            loggerFactory.AddDebug() ' Noncompliant\n            loggerFactory.AddDebug(level) ' Noncompliant\n            loggerFactory.AddDebug(filter) ' Noncompliant\n            loggerFactory.AddEventLog() ' Noncompliant\n            loggerFactory.AddEventLog(eventLogSettings) ' Noncompliant\n            loggerFactory.AddEventLog(level) ' Noncompliant\n\n            ' Only available for NET Standard 2.0 and above. Tested for C# using a hack.\n            'loggerFactory.AddEventSourceLogger() ' Non  compliant\n\n            Dim providers As IEnumerable(Of ILoggerProvider) = Nothing\n            Dim filterOptions1 As LoggerFilterOptions = Nothing\n            Dim filterOptions2 As IOptionsMonitor(Of LoggerFilterOptions) = Nothing\n\n            Dim factory As LoggerFactory = New LoggerFactory() ' Noncompliant\n            factory = New LoggerFactory(providers) ' Noncompliant\n            factory = New LoggerFactory(providers, filterOptions1) ' Noncompliant\n            factory = New LoggerFactory(providers, filterOptions2) ' Noncompliant\n        End Sub\n\n        Public Sub AdditionalTests(webHostBuilder As IWebHostBuilder, serviceDescriptors As IServiceCollection)\n            Dim factory = New MyLoggerFactory()\n'                         ^^^^^^^^^^^^^^^^^^^^^\n            factory = New MyLoggerFactory(\"data\") ' Noncompliant\n\n\n            ' Calling extension methods as static methods\n            WebHostBuilderExtensions.ConfigureLogging(webHostBuilder, CType(Nothing, Action(Of ILoggingBuilder)))    ' Noncompliant\n            LoggingServiceCollectionExtensions.AddLogging(serviceDescriptors, CType(Nothing, Action(Of ILoggingBuilder)))    ' Noncompliant\n\n            AzureAppServicesLoggerFactoryExtensions.AddAzureWebAppDiagnostics(factory, Nothing)  ' Noncompliant\n            ConsoleLoggerExtensions.AddConsole(factory)          ' Noncompliant\n            DebugLoggerFactoryExtensions.AddDebug(factory)       ' Noncompliant\n            EventLoggerFactoryExtensions.AddEventLog(factory)    ' Noncompliant\n        End Sub\n    End Class\n\n    Public Class MyLoggerFactory\n        Implements ILoggerFactory\n        Public Sub New()\n        End Sub\n\n        Public Sub New(Data As String)\n        End Sub\n\n        Public Sub AddProvider(provider As ILoggerProvider) Implements ILoggerFactory.AddProvider\n        End Sub\n\n        Public Function CreateLogger(categoryName As String) As ILogger Implements ILoggerFactory.CreateLogger\n            Return Nothing\n        End Function\n\n        Public Sub Dispose() Implements IDisposable.Dispose\n        End Sub\n\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/ConfiguringLoggers_AspNetCore6.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing Microsoft.AspNetCore;\nusing Microsoft.Extensions.Options;\nusing Microsoft.AspNetCore;\nusing Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Hosting;\nusing Microsoft.Extensions.DependencyInjection;\nusing Microsoft.Extensions.Logging;\nusing Microsoft.AspNetCore.Http;\nusing Microsoft.Extensions.Configuration;\nusing Microsoft.Extensions.DependencyInjection;\nusing Microsoft.Extensions.Hosting;\nusing Microsoft.Extensions.Logging;\nusing Microsoft.Extensions.Logging.Console;\nusing Microsoft.Extensions.Logging.AzureAppServices;\nusing Microsoft.Extensions.Logging.EventLog;\nusing Microsoft.Extensions.Logging.EventSource;\n\n\nnamespace MvcApp\n{\n    //RSPEC S4792: https://jira.sonarsource.com/browse/RSPEC-4792\n    public class ProgramLogging\n    {\n        public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>\n            WebHost.CreateDefaultBuilder(args) // Noncompliant {{Make sure that this logger's configuration is safe.}}\n                .ConfigureLogging((hostingContext, logging) =>\n                {\n                    // ...\n                })\n                .UseStartup<StartupLogging>();\n    }\n\n\n    public class StartupLogging\n    {\n        public IServiceCollection ConfigureServices(IServiceCollection services)\n        {\n            services.AddLogging(logging => // Noncompliant {{Make sure that this logger's configuration is safe.}}\n            {\n                logging.AddConsole(); // Noncompliant\n                // ...\n            });\n            return services;\n        }\n\n        public void Configure(IApplicationBuilder app)\n        {\n            IConfiguration config = null;\n            LogLevel level = LogLevel.Critical;\n            bool includeScopes = false;\n            Func<string, LogLevel, bool> filter = null;\n            EventLogSettings eventLogSettings = null;\n\n            using (var loggerFactory = LoggerFactory.Create(builder => builder.AddAzureWebAppDiagnostics() // Noncompliant [1,2,3,4,5,6,7]\n                                                                              .AddAzureWebAppDiagnostics(azureSettings => { azureSettings.IncludeScopes = true; }) // Every invocation in this chain is noncompliant\n                                                                              .AddConsole(options => { options.FormatterName = \"simple\"; })\n                                                                              .AddDebug()\n                                                                              .AddEventLog()\n                                                                              .AddEventLog(eventLogSettings)\n                                                                              .AddEventSourceLogger())) { }\n\n            using (var loggerFactory = LoggerFactory.Create(builder => builder.AddFilter(filter))) { } // Compliant, AddFilter does not add a new logger.\n\n            IEnumerable<ILoggerProvider> providers = null;\n            LoggerFilterOptions filterOptions1 = null;\n            IOptionsMonitor<LoggerFilterOptions> filterOptions2 = null;\n\n            LoggerFactory factory = new LoggerFactory(); // Noncompliant\n//                                  ^^^^^^^^^^^^^^^^^^^    {{Make sure that this logger's configuration is safe.}}\n\n            new LoggerFactory(providers); // Noncompliant\n            new LoggerFactory(providers, filterOptions1); // Noncompliant\n            new LoggerFactory(providers, filterOptions2); // Noncompliant\n        }\n\n        public void AdditionalTests(IWebHostBuilder webHostBuilder, IServiceCollection serviceDescriptors)\n        {\n            var factory = new MyLoggerFactory();\n//                        ^^^^^^^^^^^^^^^^^^^^^\n            new MyLoggerFactory(\"data\"); // Noncompliant\n\n            // Calling extension methods as static methods\n            WebHostBuilderExtensions.ConfigureLogging(webHostBuilder, (Action<ILoggingBuilder>)null);            // Noncompliant\n            LoggingServiceCollectionExtensions.AddLogging(serviceDescriptors, (Action<ILoggingBuilder>)null);    // Noncompliant\n        }\n    }\n\n    public class MyLoggerFactory : ILoggerFactory\n    {\n        public MyLoggerFactory() { }\n        public MyLoggerFactory(string data) { }\n\n        public void AddProvider(ILoggerProvider provider) { /* no-op */ }\n        public ILogger CreateLogger(string categoryName) => null;\n        public void Dispose() { /* no-op */ }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/ConfiguringLoggers_Log4Net.cs",
    "content": "﻿using log4net.Appender;\nusing log4net.Repository;\nusing System;\nusing System.IO;\nusing System.Xml;\n\nnamespace Logging\n{\n    class Log4netLogging\n    {\n        void Foo(ILoggerRepository repository, XmlElement element, FileInfo configFile, Uri configUri, Stream configStream,\n        IAppender appender, params IAppender[] appenders)\n        {\n            log4net.Config.XmlConfigurator.Configure(repository);\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^   {{Make sure that this logger's configuration is safe.}}\n\n            log4net.Config.XmlConfigurator.Configure(repository, element); // Noncompliant\n            log4net.Config.XmlConfigurator.Configure(repository, configFile); // Noncompliant\n            log4net.Config.XmlConfigurator.Configure(repository, configUri); // Noncompliant\n            log4net.Config.XmlConfigurator.Configure(repository, configStream); // Noncompliant\n            log4net.Config.XmlConfigurator.ConfigureAndWatch(repository, configFile); // Noncompliant\n\n            log4net.Config.DOMConfigurator.Configure(); // Noncompliant\n            log4net.Config.DOMConfigurator.Configure(repository); // Noncompliant\n            log4net.Config.DOMConfigurator.Configure(element); // Noncompliant\n            log4net.Config.DOMConfigurator.Configure(repository, element); // Noncompliant\n            log4net.Config.DOMConfigurator.Configure(configFile); // Noncompliant\n            log4net.Config.DOMConfigurator.Configure(repository, configFile); // Noncompliant\n            log4net.Config.DOMConfigurator.Configure(configStream); // Noncompliant\n            log4net.Config.DOMConfigurator.Configure(repository, configStream); // Noncompliant\n            log4net.Config.DOMConfigurator.ConfigureAndWatch(configFile); // Noncompliant\n            log4net.Config.DOMConfigurator.ConfigureAndWatch(repository, configFile); // Noncompliant\n\n            log4net.Config.BasicConfigurator.Configure(); // Noncompliant\n            log4net.Config.BasicConfigurator.Configure(appender); // Noncompliant\n            log4net.Config.BasicConfigurator.Configure(appenders); // Noncompliant\n            log4net.Config.BasicConfigurator.Configure(repository); // Noncompliant\n            log4net.Config.BasicConfigurator.Configure(repository, appender); // Noncompliant\n            log4net.Config.BasicConfigurator.Configure(repository, appenders);\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^   {{Make sure that this logger's configuration is safe.}}\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/ConfiguringLoggers_Log4Net.vb",
    "content": "﻿Imports System\nImports System.IO\nImports System.Xml\nImports log4net.Appender\nImports log4net.Repository\n\nNamespace Logging\n    Class Log4netLogging\n        Private Sub Foo(ByVal repository As ILoggerRepository, ByVal element As XmlElement, ByVal configFile As FileInfo, ByVal configUri As Uri, ByVal configStream As Stream, ByVal appender As IAppender, ParamArray appenders As IAppender())\n            log4net.Config.XmlConfigurator.Configure(repository)\n'           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^   {{Make sure that this logger's configuration is safe.}}\n            log4net.Config.XmlConfigurator.Configure(repository, element) ' Noncompliant\n            log4net.Config.XmlConfigurator.Configure(repository, configFile) ' Noncompliant\n            log4net.Config.XmlConfigurator.Configure(repository, configUri) ' Noncompliant\n            log4net.Config.XmlConfigurator.Configure(repository, configStream) ' Noncompliant\n            log4net.Config.XmlConfigurator.ConfigureAndWatch(repository, configFile)\n'           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^   {{Make sure that this logger's configuration is safe.}}\n\n            log4net.Config.DOMConfigurator.Configure() ' Noncompliant\n            log4net.Config.DOMConfigurator.Configure(repository) ' Noncompliant\n            log4net.Config.DOMConfigurator.Configure(element) ' Noncompliant\n            log4net.Config.DOMConfigurator.Configure(repository, element) ' Noncompliant\n            log4net.Config.DOMConfigurator.Configure(configFile) ' Noncompliant\n            log4net.Config.DOMConfigurator.Configure(repository, configFile) ' Noncompliant\n            log4net.Config.DOMConfigurator.Configure(configStream) ' Noncompliant\n            log4net.Config.DOMConfigurator.Configure(repository, configStream) ' Noncompliant\n            log4net.Config.DOMConfigurator.ConfigureAndWatch(configFile) ' Noncompliant\n            log4net.Config.DOMConfigurator.ConfigureAndWatch(repository, configFile) ' Noncompliant\n'           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^   {{Make sure that this logger's configuration is safe.}}\n\n            log4net.Config.BasicConfigurator.Configure() ' Noncompliant\n            log4net.Config.BasicConfigurator.Configure(appender) ' Noncompliant\n            log4net.Config.BasicConfigurator.Configure(appenders) ' Noncompliant\n            log4net.Config.BasicConfigurator.Configure(repository) ' Noncompliant\n            log4net.Config.BasicConfigurator.Configure(repository, appender) ' Noncompliant\n            log4net.Config.BasicConfigurator.Configure(repository, appenders) ' Noncompliant\n        End Sub\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/ConfiguringLoggers_NLog.cs",
    "content": "﻿using LogMan = NLog.LogManager;\nusing static NLog.LogManager;\n\nnamespace MvcApp\n{\n    class NLogLogging\n    {\n        // RSPEC-4792: https://jira.sonarsource.com/browse/RSPEC-4792\n        void Foo(NLog.Config.LoggingConfiguration config)\n        {\n            NLog.LogManager.Configuration = config;\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^   {{Make sure that this logger's configuration is safe.}}\n        }\n\n\n        void AdditionalTests(NLog.Config.LoggingConfiguration config)\n        {\n            // Call via the alias\n            LogMan.Configuration = config;\n//          ^^^^^^^^^^^^^^^^^^^^   {{Make sure that this logger's configuration is safe.}}\n\n            // Call via the \"using static\"\n            Configuration = config;\n//          ^^^^^^^^^^^^^   {{Make sure that this logger's configuration is safe.}}\n\n\n            // Reading the configuration should be ok\n            var current = Configuration;\n            current = LogMan.Configuration;\n            current = NLog.LogManager.Configuration;\n\n            AdditionalTests(Configuration);\n            AdditionalTests(LogMan.Configuration);\n            AdditionalTests(NLog.LogManager.Configuration);\n\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/ConfiguringLoggers_NLog.vb",
    "content": "﻿Imports LogMan = NLog.LogManager\nImports NLog.LogManager\n\nNamespace Logging\n    Class NLogLogging\n        ' RSPEC-4792: https://jira.sonarsource.com/browse/RSPEC-4792\n        Private Sub Foo(ByVal config As NLog.Config.LoggingConfiguration)\n            NLog.LogManager.Configuration = config\n'           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^   {{Make sure that this logger's configuration is safe.}}\n        End Sub\n\n\n        Private Sub AdditionalTests(config As NLog.Config.LoggingConfiguration)\n            ' Call via the alias\n            LogMan.Configuration = config\n'           ^^^^^^^^^^^^^^^^^^^^   {{Make sure that this logger's configuration is safe.}}\n\n            ' Call via the import of the static class\n            Configuration = config\n'           ^^^^^^^^^^^^^   {{Make sure that this logger's configuration is safe.}}\n\n\n            ' Reading the configuration should be ok\n            Dim current = Configuration\n            current = LogMan.Configuration\n            current = NLog.LogManager.Configuration\n\n            AdditionalTests(Configuration)\n            AdditionalTests(LogMan.Configuration)\n            AdditionalTests(NLog.LogManager.Configuration)\n        End Sub\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/ConfiguringLoggers_Serilog.cs",
    "content": "﻿using Serilog;\nusing Serilog.Core;\n\nnamespace Logging\n{\n    class SerilogLogging\n    {\n        // RSPEC-4792: https://jira.sonarsource.com/browse/RSPEC-4792\n        void Foo()\n        {\n            new Serilog.LoggerConfiguration();\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^   {{Make sure that this logger's configuration is safe.}}\n        }\n\n        void AdditionalTests()\n        {\n            var config = new LoggerConfiguration(); // Noncompliant\n            config = new MyConfiguration();         // Noncompliant\n\n            // Using the logger shouldn't raise issues\n            var levelSwitch = new LoggingLevelSwitch();\n            levelSwitch.MinimumLevel = Serilog.Events.LogEventLevel.Warning;\n\n\n            var newLog = config.\n                MinimumLevel.ControlledBy(levelSwitch)\n                .WriteTo.Console()\n                .CreateLogger();\n\n            Log.Logger = newLog;\n            Log.Information(\"logged info\");\n            Log.CloseAndFlush();\n        }\n    }\n\n    class MyConfiguration : LoggerConfiguration { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/ConfiguringLoggers_Serilog.vb",
    "content": "﻿Imports Serilog\nImports Serilog.Core\n\nNamespace Logging\n    Class SerilogLogging\n        ' RSPEC-4792: https://jira.sonarsource.com/browse/RSPEC-4792\n        Private Sub Foo()\n            Dim config As Serilog.LoggerConfiguration = New Serilog.LoggerConfiguration()\n'                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^   {{Make sure that this logger's configuration is safe.}}\n        End Sub\n\n        Private Sub AdditionalTests()\n\n            Dim config = New LoggerConfiguration()  ' Noncompliant\n            config = New MyConfiguration()          ' Noncompliant\n\n            ' Using the logger shouldn't raise issues\n            Dim levelSwitch = New LoggingLevelSwitch()\n            levelSwitch.MinimumLevel = Serilog.Events.LogEventLevel.Warning\n\n\n            Dim newLog = config.\n                MinimumLevel.ControlledBy(levelSwitch) _\n                .WriteTo.Console() _\n                .CreateLogger()\n\n            Log.Logger = newLog\n            Log.Information(\"logged info\")\n            Log.CloseAndFlush()\n        End Sub\n    End Class\n\n    Friend Class MyConfiguration\n        Inherits LoggerConfiguration\n\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/CookieShouldBeHttpOnly.Latest.cs",
    "content": "﻿using System;\nusing Microsoft.AspNetCore.Http;\nusing Nancy.Cookies;\n\nclass Tests\n{\n    CookieOptions field1 = new CookieOptions(); // Noncompliant\n    CookieOptions field2;\n\n    CookieOptions Property1 { get; set; } = new CookieOptions(); // Noncompliant\n    CookieOptions Property2 { get; set; }\n\n    void CtorSetsAllowedValue()\n    {\n        // none\n    }\n\n    void CtorSetsNotAllowedValue()\n    {\n        new CookieOptions(); // Noncompliant {{Make sure creating this cookie without the \"HttpOnly\" flag is safe.}}\n    }\n\n    void InitializerSetsAllowedValue()\n    {\n        new CookieOptions() { HttpOnly = true };\n    }\n\n    void InitializerSetsNotAllowedValue()\n    {\n        new CookieOptions() { HttpOnly = false }; // Noncompliant\n//      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        new CookieOptions() { }; // Noncompliant\n        new CookieOptions() { Secure = true }; // Noncompliant\n    }\n\n    void PropertySetsNotAllowedValue()\n    {\n        var c = new CookieOptions() { HttpOnly = true };\n        c.HttpOnly = false; // Noncompliant\n//      ^^^^^^^^^^^^^^^^^^\n\n        field1.HttpOnly = false; // Noncompliant\n        this.field1.HttpOnly = false; // Noncompliant\n\n        Property1.HttpOnly = false; // Noncompliant\n        this.Property1.HttpOnly = false; // Noncompliant\n    }\n\n    void PropertySetsAllowedValue(bool foo)\n    {\n        var c1 = new CookieOptions(); // Compliant, HttpOnly is set below\n        c1.HttpOnly = true;\n\n        field1 = new CookieOptions(); // Compliant, HttpOnly is set below\n        field1.HttpOnly = true;\n\n        this.field2 = new CookieOptions(); // Compliant, HttpOnly is set below\n        this.field2.HttpOnly = true;\n\n        Property1 = new CookieOptions(); // Compliant, HttpOnly is set below\n        Property1.HttpOnly = true;\n\n        this.Property2 = new CookieOptions(); // Compliant, HttpOnly is set below\n        this.Property2.HttpOnly = true;\n\n        var c2 = new CookieOptions(); // Noncompliant, HttpOnly is set conditionally\n        if (foo)\n        {\n            c2.HttpOnly = true;\n        }\n\n        var c3 = new CookieOptions(); // Compliant, HttpOnly is set after the if\n        if (foo)\n        {\n            // do something\n        }\n        c3.HttpOnly = true;\n\n        CookieOptions c4 = null;\n        if (foo)\n        {\n            c4 = new CookieOptions(); // Noncompliant, HttpOnly is not set in the same scope\n        }\n        c4.HttpOnly = true;\n    }\n}\n\nclass CSharp9\n{\n    CookieOptions field1 = new(); // Noncompliant\n    CookieOptions field2;\n\n    CookieOptions Property0 { get; init; } = new CookieOptions(); // Noncompliant\n    CookieOptions Property1 { get; init; } = new(); // Noncompliant\n    CookieOptions Property2 { get; init; }\n\n    CSharp9()\n    {\n        Property2.HttpOnly = false; // Noncompliant\n    }\n\n    void InitializerSetsNotAllowedValue(DateTime? expires, string domain, string path)\n    {\n        CookieOptions c1 = new() { HttpOnly = false }; // Noncompliant\n        CookieOptions c2 = new() { Secure = true };    // Noncompliant\n        NancyCookie cookie2 = new(\"name\", \"secure\") { Expires = expires, Domain = domain, Path = path };  // Noncompliant\n    }\n}\n\npublic record struct RecordStruct\n{\n    public void SetValueAfterObjectInitialization()\n    {\n        var propertyTrue = new CookieOptions() { HttpOnly = false }; // Compliant, property is set below\n        (propertyTrue.HttpOnly, var x1) = (true, 0);\n\n        var propertyFalse = new CookieOptions() { HttpOnly = false }; // Noncompliant\n        (propertyFalse.HttpOnly, var x2) = (false, 0); // Noncompliant\n    }\n}\n\npartial class Partial\n{\n    partial CookieOptions Property2 { get; }\n}\n\npartial class Partial\n{\n    partial CookieOptions Property2 => new CookieOptions(); // Noncompliant\n}\n\npublic class NullConditionalAssignment\n{\n    public void TestMethod(CookieOptions cookie)\n    {\n        cookie.HttpOnly = false;    // Noncompliant\n        cookie.HttpOnly = true;     // Compliant\n\n        cookie?.HttpOnly = false;   // Noncompliant https://sonarsource.atlassian.net/browse/NET-2857\n        cookie?.HttpOnly = true;    // Compliant\n    }\n}\n\npublic static class Extension\n{\n    extension(CookieOptions c)\n    {\n        public void SetHttpOnlyTrue() { c.HttpOnly = true; }    // Compliant\n        public void SetHttpOnlyFalse() { c.HttpOnly = false; }  // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/CookieShouldBeHttpOnly.TopLevelStatements.cs",
    "content": "﻿using System;\nusing Microsoft.AspNetCore.Http;\nusing Nancy.Cookies;\n\nCookieOptions topLevelStatement1 = new();                // Noncompliant\nCookieOptions topLevelStatement2 = new CookieOptions();  // Noncompliant\nNancyCookie topLevelStatement3 = new(\"name\", \"secure\");  // Noncompliant\n\n(CookieOptions topLevelStatement4, int a) = (new CookieOptions(), 42); // Noncompliant\n(NancyCookie topLevelStatement5, var b) = (new(\"name\", \"secure\"), \"42\"); // Noncompliant\n\nvar c = new CookieOptions() { HttpOnly = true };\n(c.HttpOnly, var x1) = (false, 0); // Noncompliant\n(c.HttpOnly, var x2) = (true, 0);\n(c.HttpOnly, var x3) = ((false), 0); // Noncompliant\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/CookieShouldBeHttpOnly.cs",
    "content": "﻿using System;\nusing System.Web;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        HttpCookie field1 = new HttpCookie(\"c\"); // Noncompliant\n        HttpCookie field2;\n        HttpCookie field3 = new HttpCookie(\"c\") { HttpOnly = \"false\" }; // Noncompliant\n        // Error@-1 [CS0029]\n\n        HttpCookie Property1 { get; set; } = new HttpCookie(\"c\"); // Noncompliant\n        HttpCookie Property2 { get; set; }\n\n        private bool trueField = true;\n        private bool falseField = false;\n\n        void CtorSetsAllowedValue()\n        {\n            // none\n        }\n\n        void CtorSetsNotAllowedValue()\n        {\n            new HttpCookie(\"c\"); // Noncompliant {{Make sure creating this cookie without the \"HttpOnly\" flag is safe.}}\n        }\n\n        void InitializerSetsAllowedValue()\n        {\n            new HttpCookie(\"c\") { HttpOnly = true };\n            new HttpCookie(\"c\") { HttpOnly = trueField };\n        }\n\n        void InitializerSetsNotAllowedValue()\n        {\n            new HttpCookie(\"c\") { HttpOnly = false };       // Noncompliant\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            new HttpCookie(\"c\") { HttpOnly = falseField };  // Noncompliant\n            new HttpCookie(\"c\") { };                        // Noncompliant\n            new HttpCookie(\"c\") { Secure = true };          // Noncompliant\n        }\n\n        void PropertySetsNotAllowedValue()\n        {\n            var c = new HttpCookie(\"c\") { HttpOnly = true };\n            c.HttpOnly = false; // Noncompliant\n//          ^^^^^^^^^^^^^^^^^^\n\n            field1.HttpOnly = false;        // Noncompliant\n            field1.HttpOnly = falseField;   // Noncompliant\n            this.field1.HttpOnly = false;   // Noncompliant\n\n            Property1.HttpOnly = false;         // Noncompliant\n            this.Property1.HttpOnly = false;    // Noncompliant\n        }\n\n        void PropertySetsAllowedValue(bool foo)\n        {\n            var c1 = new HttpCookie(\"c\"); // Compliant, HttpOnly is set below\n            c1.HttpOnly = true;\n\n            var cc = new HttpCookie(\"c\"); // Compliant, HttpOnly is set below\n            cc.HttpOnly = trueField;\n\n            field1 = new HttpCookie(\"c\"); // Compliant, HttpOnly is set below\n            field1.HttpOnly = true;\n\n            this.field2 = new HttpCookie(\"c\"); // Compliant, HttpOnly is set below\n            this.field2.HttpOnly = true;\n\n            Property1 = new HttpCookie(\"c\"); // Compliant, HttpOnly is set below\n            Property1.HttpOnly = true;\n\n            this.Property2 = new HttpCookie(\"c\"); // Compliant, HttpOnly is set below\n            this.Property2.HttpOnly = true;\n\n            var c2 = new HttpCookie(\"c\"); // Noncompliant, HttpOnly is set conditionally\n            if (foo)\n            {\n                c2.HttpOnly = true;\n            }\n\n            var c3 = new HttpCookie(\"c\"); // Compliant, HttpOnly is set after the if\n            if (foo)\n            {\n                // do something\n            }\n            c3.HttpOnly = true;\n\n            HttpCookie c4 = null;\n            if (foo)\n            {\n                c4 = new HttpCookie(\"c\"); // Noncompliant, HttpOnly is not set in the same scope\n            }\n            c4.HttpOnly = true;\n        }\n\n        void RaiseTwice()\n        {\n            var x = new HttpCookie(\"c\"); // Noncompliant {{Make sure creating this cookie without the \"HttpOnly\" flag is safe.}}\n            x.HttpOnly = false; // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/CookieShouldBeHttpOnly_Nancy.cs",
    "content": "﻿using Nancy.Cookies;\nusing System;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        private bool trueField = true;\n        private bool falseField = false;\n\n        void CtorSetsAllowedValues(bool arg)\n        {\n            new NancyCookie(\"name\", \"value\", true);\n            new NancyCookie(\"name\", \"value\", trueField);\n            new NancyCookie(\"name\", \"value\", true, false);\n            new NancyCookie(\"name\", \"value\", true, true);\n            new NancyCookie(\"name\", \"value\", true, false, DateTime.Now);\n            new NancyCookie(\"name\", \"value\", secure: false, httpOnly: true);\n            new NancyCookie(httpOnly: true, name: \"name\", secure: false, value: \"value\");\n        }\n\n        void CtorSetsDisallowedValues(string name, string value, DateTime? expires, string domain, string path, bool arg)\n        {\n            var falseVariable = false;\n            new NancyCookie(\"name\", \"value\");                   // Noncompliant\n            new NancyCookie(\"name\", \"httpOnly\");                // Noncompliant\n            new NancyCookie(\"name\", \"value\", DateTime.Now);     // Noncompliant\n            new NancyCookie(\"name\", \"value\", false);            // Noncompliant\n            new NancyCookie(\"name\", \"value\", arg);              // Noncompliant, it's not known to be true, so we raise\n            new NancyCookie(\"name\", \"value\", falseField);       // Noncompliant\n            new NancyCookie(\"name\", \"value\", falseVariable);    // Noncompliant\n            new NancyCookie(\"name\", \"value\", false, false);     // Noncompliant\n            new NancyCookie(\"name\", \"value\", false, true);      // Noncompliant\n            new NancyCookie(\"name\", \"value\", false, false, DateTime.Now);       // Noncompliant\n            new NancyCookie(\"name\", \"value\", secure: true, httpOnly: false);    // Noncompliant\n            new NancyCookie(httpOnly: false, name: \"name\", secure: true, value: \"value\");       // Noncompliant\n            new NancyCookie(name, value) { Expires = expires, Domain = domain, Path = path };   // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/CookieShouldBeHttpOnly_WithWebConfig.cs",
    "content": "﻿using System;\nusing System.Web;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        HttpCookie field1 = new HttpCookie(\"c\"); // Compliant, Web.Config overrides the default behaviour.\n        HttpCookie field2;\n\n        HttpCookie Property1 { get; set; } = new HttpCookie(\"c\"); // Compliant\n        HttpCookie Property2 { get; set; }\n\n        private bool trueField = true;\n        private bool falseField = false;\n\n        void CtorSetsAllowedValue()\n        {\n            new HttpCookie(\"c\"); // Compliant\n        }\n\n        void InitializerSetsAllowedValue()\n        {\n            new HttpCookie(\"c\") { HttpOnly = true };\n            new HttpCookie(\"c\") { HttpOnly = trueField };\n        }\n\n        void InitializerSetsNotAllowedValue()\n        {\n            new HttpCookie(\"c\") { HttpOnly = false };       // Noncompliant\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            new HttpCookie(\"c\") { HttpOnly = falseField };  // Noncompliant\n            new HttpCookie(\"c\") { };                        // Compliant\n            new HttpCookie(\"c\") { Secure = true };          // Compliant\n        }\n\n        void PropertySetsNotAllowedValue()\n        {\n            var c = new HttpCookie(\"c\") { HttpOnly = true };\n            c.HttpOnly = false; // Noncompliant\n//          ^^^^^^^^^^^^^^^^^^\n\n            field1.HttpOnly = false;        // Noncompliant\n            field1.HttpOnly = falseField;   // Noncompliant\n            this.field1.HttpOnly = false;   // Noncompliant\n\n            Property1.HttpOnly = false;         // Noncompliant\n            this.Property1.HttpOnly = false;    // Noncompliant\n        }\n\n        void PropertySetsAllowedValue(bool foo)\n        {\n            var c1 = new HttpCookie(\"c\"); // Compliant, HttpOnly is set below\n            c1.HttpOnly = true;\n\n            var cc = new HttpCookie(\"c\"); // Compliant, HttpOnly is set below\n            cc.HttpOnly = trueField;\n\n            field1 = new HttpCookie(\"c\"); // Compliant, HttpOnly is set below\n            field1.HttpOnly = true;\n\n            this.field2 = new HttpCookie(\"c\"); // Compliant, HttpOnly is set below\n            this.field2.HttpOnly = true;\n\n            Property1 = new HttpCookie(\"c\"); // Compliant, HttpOnly is set below\n            Property1.HttpOnly = true;\n\n            this.Property2 = new HttpCookie(\"c\"); // Compliant, HttpOnly is set below\n            this.Property2.HttpOnly = true;\n\n            var c2 = new HttpCookie(\"c\"); // Compliant\n            if (foo)\n            {\n                c2.HttpOnly = true;\n            }\n\n            var c3 = new HttpCookie(\"c\"); // Compliant, HttpOnly is set after the if\n            if (foo)\n            {\n                // do something\n            }\n            c3.HttpOnly = true;\n\n            HttpCookie c4 = null;\n            if (foo)\n            {\n                c4 = new HttpCookie(\"c\"); // Compliant\n            }\n            c4.HttpOnly = true;\n        }\n\n        void RaiseTwice()\n        {\n            var x = new HttpCookie(\"c\"); // Compliant\n            x.HttpOnly = false; // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/CookieShouldBeSecure.Latest.cs",
    "content": "﻿using System;\nusing Microsoft.AspNetCore.Http;\nusing Nancy.Cookies;\n\nclass MyClass\n{\n    CookieOptions field1 = new CookieOptions(); // Noncompliant\n    CookieOptions field2;\n\n    CookieOptions Property1 { get; set; } = new CookieOptions(); // Noncompliant\n    CookieOptions Property2 { get; set; }\n\n    void CtorSetsAllowedValue()\n    {\n        // none\n    }\n\n    void CtorSetsNotAllowedValue()\n    {\n        new CookieOptions(); // Noncompliant {{Make sure creating this cookie without setting the 'Secure' property is safe here.}}\n    }\n\n    void InitializerSetsAllowedValue()\n    {\n        new CookieOptions() { Secure = true };\n    }\n\n    void InitializerSetsNotAllowedValue()\n    {\n        new CookieOptions() { Secure = false }; // Noncompliant\n//      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        new CookieOptions() { }; // Noncompliant\n        new CookieOptions() { HttpOnly = true }; // Noncompliant\n    }\n\n    void PropertySetsNotAllowedValue()\n    {\n        var c = new CookieOptions() { Secure = true };\n        c.Secure = false; // Noncompliant\n//      ^^^^^^^^^^^^^^^^\n        field1.Secure = false; // Noncompliant\n        this.field1.Secure = false; // Noncompliant\n        Property1.Secure = false; // Noncompliant\n        this.Property1.Secure = false; // Noncompliant\n    }\n\n    void PropertySetsAllowedValue(bool foo)\n    {\n        var c1 = new CookieOptions(); // Compliant, Secure is set below\n        c1.Secure = true;\n        field1 = new CookieOptions(); // Compliant, Secure is set below\n        field1.Secure = true;\n        this.field2 = new CookieOptions(); // Compliant, Secure is set below\n        this.field2.Secure = true;\n        Property1 = new CookieOptions(); // Compliant, Secure is set below\n        Property1.Secure = true;\n        this.Property2 = new CookieOptions(); // Compliant, Secure is set below\n        this.Property2.Secure = true;\n        var c2 = new CookieOptions(); // Noncompliant, Secure is set conditionally\n        if (foo)\n        {\n            c2.Secure = true;\n        }\n        var c3 = new CookieOptions(); // Compliant, Secure is set after the if\n        if (foo)\n        {\n            // do something\n        }\n        c3.Secure = true;\n        CookieOptions c4 = null;\n        if (foo)\n        {\n            c4 = new CookieOptions(); // Noncompliant, Secure is not set in the same scope\n        }\n        c4.Secure = true;\n    }\n}\n\nclass CSharp9\n{\n    CookieOptions field1 = new(); // Noncompliant\n    CookieOptions field2;\n\n    CookieOptions Property0 { get; init; } = new CookieOptions(); // Noncompliant\n    CookieOptions Property1 { get; init; } = new(); // Noncompliant\n    CookieOptions Property2 { get; init; }\n\n    CSharp9()\n    {\n        Property2.Secure = false; // Noncompliant\n    }\n\n    void InitializerSetsNotAllowedValue(DateTime? expires, string domain, string path)\n    {\n        CookieOptions c0 = new() { Secure = false };  // Noncompliant\n        CookieOptions c1 = new() { HttpOnly = true }; // Noncompliant\n        NancyCookie cookie2 = new(\"name\", \"secure\") { Expires = expires, Domain = domain, Path = path };  // Noncompliant\n    }\n}\n\npublic record struct RecordStruct\n{\n    public void SetValueAfterObjectInitialization()\n    {\n        var propertyTrue = new CookieOptions() { Secure = false }; // Compliant, property is set below\n        (propertyTrue.Secure, var x1) = (true, 0);\n\n        var propertyFalse = new CookieOptions() { Secure = false }; // Noncompliant\n        (propertyFalse.Secure, var x2) = (false, 0); // Noncompliant\n    }\n}\n\npartial class Partial\n{\n    partial CookieOptions Property0 { get; }\n}\n\npartial class Partial\n{\n    partial CookieOptions Property0 => new CookieOptions(); // Noncompliant\n}\n\npublic class NullConditionalAssignment\n{\n    public void TestMethod(CookieOptions cookie)\n    {\n        cookie.Secure = false;    // Noncompliant\n        cookie.Secure = true;     // Compliant\n\n        cookie?.Secure = false;   // Noncompliant https://sonarsource.atlassian.net/browse/NET-2875\n        cookie?.Secure = true;    // Compliant\n    }\n}\n\npublic static class Extension\n{\n    extension(CookieOptions c)\n    {\n        public void SetSecureTrue() { c.Secure = true; }    // Compliant\n        public void SetSecureFalse() { c.Secure = false; }  // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/CookieShouldBeSecure.TopLevelStatements.cs",
    "content": "﻿using System;\nusing Microsoft.AspNetCore.Http;\nusing Nancy.Cookies;\n\nCookieOptions topLevelStatement1 = new();                // Noncompliant\nCookieOptions topLevelStatement2 = new CookieOptions();  // Noncompliant\nNancyCookie topLevelStatement3 = new(\"name\", \"secure\"); // Noncompliant\n\n(CookieOptions topLevelStatement4, int a) = (new CookieOptions(), 42);  // Noncompliant\n(NancyCookie topLevelStatement5, var b) = (new(\"name\", \"secure\"), \"42\"); // Noncompliant\n\nvar c = new CookieOptions() { Secure = true };\n(c.Secure, var x1) = (false, 0); // Noncompliant\n(c.Secure, var x2) = (true, 0);\n(c.Secure, var x3) = ((false), 0); // Noncompliant\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/CookieShouldBeSecure.cs",
    "content": "﻿using System;\nusing System.Web;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        HttpCookie field1 = new HttpCookie(\"c\"); // Noncompliant\n        HttpCookie field2;\n        HttpCookie field3 = new HttpCookie(\"c\") { Secure = \"false\" }; // Noncompliant\n        // Error@-1 [CS0029]\n\n        HttpCookie Property1 { get; set; } = new HttpCookie(\"c\"); // Noncompliant\n        HttpCookie Property2 { get; set; }\n\n        private bool trueField = true;\n        private bool falseField = false;\n\n        void CtorSetsAllowedValue()\n        {\n            // none\n        }\n\n        void CtorSetsNotAllowedValue()\n        {\n            new HttpCookie(\"c\"); // Noncompliant {{Make sure creating this cookie without setting the 'Secure' property is safe here.}}\n        }\n\n        void InitializerSetsAllowedValue()\n        {\n            new HttpCookie(\"c\") { Secure = true };\n            new HttpCookie(\"c\") { Secure = trueField };\n        }\n\n        void InitializerSetsNotAllowedValue()\n        {\n            new HttpCookie(\"c\") { Secure = false };         // Noncompliant\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            new HttpCookie(\"c\") { Secure = falseField };    // Noncompliant\n            new HttpCookie(\"c\") { };                        // Noncompliant\n            new HttpCookie(\"c\") { HttpOnly = true };        // Noncompliant\n        }\n\n        void PropertySetsNotAllowedValue()\n        {\n            var c = new HttpCookie(\"c\") { Secure = true };\n            c.Secure = false; // Noncompliant\n//          ^^^^^^^^^^^^^^^^\n\n            field1.Secure = false; // Noncompliant\n            this.field1.Secure = false; // Noncompliant\n\n            Property1.Secure = false; // Noncompliant\n            this.Property1.Secure = false; // Noncompliant\n        }\n\n        void PropertySetsAllowedValue(bool foo)\n        {\n            var c1 = new HttpCookie(\"c\"); // Compliant, Secure is set below\n            c1.Secure = true;\n\n            field1 = new HttpCookie(\"c\"); // Compliant, Secure is set below\n            field1.Secure = true;\n\n            this.field2 = new HttpCookie(\"c\"); // Compliant, Secure is set below\n            this.field2.Secure = true;\n\n            Property1 = new HttpCookie(\"c\"); // Compliant, Secure is set below\n            Property1.Secure = true;\n\n            this.Property2 = new HttpCookie(\"c\"); // Compliant, Secure is set below\n            this.Property2.Secure = true;\n\n            var c2 = new HttpCookie(\"c\"); // Noncompliant, Secure is set conditionally\n            if (foo)\n            {\n                c2.Secure = true;\n            }\n\n            var c3 = new HttpCookie(\"c\"); // Compliant, Secure is set after the if\n            if (foo)\n            {\n                // do something\n            }\n            c3.Secure = true;\n\n            HttpCookie c4 = null;\n            if (foo)\n            {\n                c4 = new HttpCookie(\"c\"); // Noncompliant, Secure is not set in the same scope\n            }\n            c4.Secure = true;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/CookieShouldBeSecure_Nancy.cs",
    "content": "﻿using Nancy.Cookies;\nusing System;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        private bool trueField = true;\n        private bool falseField = false;\n\n        void CtorSetsAllowedValues()\n        {\n            new NancyCookie(\"name\", \"value\", true, true);\n            new NancyCookie(\"name\", \"value\", false, true);\n            new NancyCookie(\"name\", \"value\", false, trueField);\n            new NancyCookie(\"name\", \"value\", secure: true, httpOnly: false);\n            new NancyCookie(httpOnly: false, name: \"name\", secure: true, value: \"value\");\n        }\n\n        void CtorSetsDisallowedValues(string name, string value, DateTime? expires, string domain, string path)\n        {\n            new NancyCookie(\"name\", \"secure\");                      // Noncompliant\n            new NancyCookie(\"name\", \"httpOnly\");                    // Noncompliant\n            new NancyCookie(\"name\", \"value\", DateTime.Now);         // Noncompliant\n            new NancyCookie(\"name\", \"value\", true);                 // Noncompliant\n            new NancyCookie(\"name\", \"value\", false);                // Noncompliant\n            new NancyCookie(\"name\", \"value\", false, false);         // Noncompliant\n            new NancyCookie(\"name\", \"value\", false, falseField);    // Noncompliant\n            new NancyCookie(\"name\", \"value\", true, false);          // Noncompliant\n            new NancyCookie(\"name\", \"value\", false, false, DateTime.Now);       // Noncompliant\n            new NancyCookie(\"name\", \"value\", true, false, DateTime.Now);        // Noncompliant\n            new NancyCookie(\"name\", \"value\", secure: false, httpOnly: true);    // Noncompliant\n            new NancyCookie(httpOnly: true, name: \"name\", secure: false, value: \"value\");       // Noncompliant\n            new NancyCookie(name, value) { Expires = expires, Domain = domain, Path = path };   // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/CookieShouldBeSecure_WithWebConfig.cs",
    "content": "﻿using System;\nusing System.Web;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        HttpCookie field1 = new HttpCookie(\"c\"); // Compliant, Web.Config overrides the default behaviour.\n        HttpCookie field2;\n\n        HttpCookie Property1 { get; set; } = new HttpCookie(\"c\"); // Compliant\n        HttpCookie Property2 { get; set; }\n\n        private bool trueField = true;\n        private bool falseField = false;\n\n        void CtorSetsAllowedValue()\n        {\n            new HttpCookie(\"c\"); // Compliant\n        }\n\n        void InitializerSetsAllowedValue()\n        {\n            new HttpCookie(\"c\") { Secure = true };\n            new HttpCookie(\"c\") { Secure = trueField };\n        }\n\n        void InitializerSetsNotAllowedValue()\n        {\n            new HttpCookie(\"c\") { Secure = false };         // Noncompliant\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            new HttpCookie(\"c\") { Secure = falseField };    // Noncompliant\n            new HttpCookie(\"c\") { };                        // Compliant\n            new HttpCookie(\"c\") { HttpOnly = true };        // Compliant\n        }\n\n        void PropertySetsNotAllowedValue()\n        {\n            var c = new HttpCookie(\"c\") { Secure = true };\n            c.Secure = false; // Noncompliant\n//          ^^^^^^^^^^^^^^^^\n\n            field1.Secure = false; // Noncompliant\n            this.field1.Secure = false; // Noncompliant\n\n            Property1.Secure = false; // Noncompliant\n            this.Property1.Secure = false; // Noncompliant\n        }\n\n        void PropertySetsAllowedValue(bool foo)\n        {\n            var c1 = new HttpCookie(\"c\"); // Compliant, Secure is set below\n            c1.Secure = true;\n\n            field1 = new HttpCookie(\"c\"); // Compliant, Secure is set below\n            field1.Secure = true;\n\n            this.field2 = new HttpCookie(\"c\"); // Compliant, Secure is set below\n            this.field2.Secure = true;\n\n            Property1 = new HttpCookie(\"c\"); // Compliant, Secure is set below\n            Property1.Secure = true;\n\n            this.Property2 = new HttpCookie(\"c\"); // Compliant, Secure is set below\n            this.Property2.Secure = true;\n\n            var c2 = new HttpCookie(\"c\"); // Compliant\n            if (foo)\n            {\n                c2.Secure = true;\n            }\n\n            var c3 = new HttpCookie(\"c\"); // Compliant\n            if (foo)\n            {\n                // do something\n            }\n            c3.Secure = true;\n\n            HttpCookie c4 = null;\n            if (foo)\n            {\n                c4 = new HttpCookie(\"c\"); // Compliant\n            }\n            c4.Secure = true;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/CreatingHashAlgorithms.Latest.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Security.Cryptography;\nusing System.Text;\nusing System.Threading;\nusing System.Threading.Tasks;\n\npublic class InsecureHashAlgorithm\n{\n    const string part1 = \"\"\"System.Security.Cryptography\"\"\";\n    const string part2 = \"\"\"SHA1\"\"\";\n\n    void RawStringLiterals(byte[] temp)\n    {\n        using var SHA1HashAlgorithmWithNamespaceRawStringLiteral = HashAlgorithm.Create(\"\"\"System.Security.Cryptography.SHA1\"\"\"); // Noncompliant\n        using var SHA1HashAlgorithmWithNamespaceInterpolatedRawStringLiteral = HashAlgorithm.Create($$\"\"\"{{part1}}.{{part2}}\"\"\"); // Noncompliant\n    }\n\n    void NewlinesInStringInterpolation()\n    {\n        using var SHA1HashAlgorithm = HashAlgorithm.Create($\"{part1 +\n            '.' +\n            part2}\"); // FN (at the moment we validate only constant string)\n        using var SHA1HashAlgorithmRawString = HashAlgorithm.Create($$\"\"\"{{part1 +\n            '.' +\n            part2}}\"\"\"); // FN (at the moment we validate only constant string)\n    }\n}\n\n// All the new .NET5 methods should be taken into consideration\n// https://github.com/SonarSource/sonar-dotnet/issues/8758\npublic class Repro_FN_8758\n{\n    public void Method()\n    {\n        var data = new byte[42];\n        var hashBuffer = new byte[SHA1.HashSizeInBytes];\n        using var stream = new System.IO.MemoryStream(data);\n        SHA1.HashData(stream);                                                 // Noncompliant\n        SHA1.HashData(data);                                                   // Noncompliant\n        if (SHA1.TryHashData(data, hashBuffer, out int bytesWrittenSHA1))      // Noncompliant\n        { }\n\n        MD5.HashData(data);                                                    // Noncompliant\n        if (MD5.TryHashData(data, hashBuffer, out int bytesWrittenMD5))        // Noncompliant\n        { }\n    }\n\n    public async Task Method2()\n    {\n        using var stream = new System.IO.MemoryStream(new byte[42]);\n        await SHA1.HashDataAsync(stream);          // Noncompliant\n        await MD5.HashDataAsync(stream);           // Noncompliant\n    }\n\n    private sealed class MyDSA : DSA\n    {\n        public override byte[] CreateSignature(byte[] rgbHash) => [];\n\n        public override DSAParameters ExportParameters(bool includePrivateParameters) => new DSAParameters();\n\n        public override void ImportParameters(DSAParameters parameters)\n        { }\n\n        public override bool VerifySignature(byte[] rgbHash, byte[] rgbSignature) => true;\n\n        protected override byte[] HashData(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm) => [];\n\n        protected override byte[] HashData(Stream data, HashAlgorithmName hashAlgorithm) => [];\n\n        protected override bool TryHashData(ReadOnlySpan<byte> data, Span<byte> destination, HashAlgorithmName hashAlgorithm, out int bytesWritten)\n        {\n            bytesWritten = 0;\n            return false;\n        }\n\n        public void UseHashData()\n        {\n            var data = new byte[42];\n            var hashBuffer = new byte[SHA1.HashSizeInBytes];\n            using var stream = new System.IO.MemoryStream(data);\n\n            _ = HashData(data, 0, data.Length, HashAlgorithmName.SHA1);                          // Noncompliant\n            _ = HashData(stream, HashAlgorithmName.SHA1);                                        // Noncompliant\n            if (TryHashData(data, hashBuffer, HashAlgorithmName.SHA1, out int bytesWrittenSHA1)) // Noncompliant\n            { }\n\n            _ = HashData(data, 0, data.Length, HashAlgorithmName.SHA3_256);\n            _ = HashData(stream, HashAlgorithmName.SHA3_384);\n            if (TryHashData(data, hashBuffer, HashAlgorithmName.SHA3_384, out int bytesWrittenSHA3))\n            { }\n\n            _ = base.HashData(data, 0, data.Length, HashAlgorithmName.SHA1);                              // Noncompliant\n            _ = base.HashData(stream, HashAlgorithmName.SHA1);                                            // Noncompliant\n            if (base.TryHashData(data, hashBuffer, HashAlgorithmName.SHA1, out int bytesWrittenSHA1Base)) // Noncompliant\n            { }\n\n            _ = base.HashData(data, 0, data.Length, HashAlgorithmName.SHA3_256);\n            _ = base.HashData(stream, HashAlgorithmName.SHA3_384);\n            if (base.TryHashData(data, hashBuffer, HashAlgorithmName.SHA3_384, out int bytesWrittenSHA3Base))\n            { }\n        }\n    }\n}\n\nclass PrimaryConstructor(string ctorParam = \"MD5\")\n{\n    void Method(string methodParam = \"MD5\")\n    {\n        var md5Ctor = (HashAlgorithm)CryptoConfig.CreateFromName(ctorParam); // FN\n        var md5Method = (HashAlgorithm)CryptoConfig.CreateFromName(methodParam); // FN\n        var lambda = (string lambdaParam = \"MD5\") => (HashAlgorithm)CryptoConfig.CreateFromName(lambdaParam); // FN\n    }\n}\n\nclass CSharp13\n{\n    void KMAK_Hashing()\n    {\n        using var kmac128 = new Kmac128(new byte[] { 0x01, 0x02, 0x03, 0x04 });       // Compliant\n        using var kmac256 = new Kmac256(new byte[] { 0x01, 0x02, 0x03, 0x04 });       // Compliant\n        using var kmacXof128 = new KmacXof128(new byte[] { 0x01, 0x02, 0x03, 0x04 }); // Compliant\n        using var kmacXof256 = new KmacXof256(new byte[] { 0x01, 0x02, 0x03, 0x04 }); // Compliant\n\n        byte[] data = Encoding.UTF8.GetBytes(\"KMAK\");\n        byte[] key = new byte[] { 0x01, 0x02, 0x03, 0x04 };\n        byte[] mac128 = Kmac128.HashData(key, data, 200);       // Compliant\n        byte[] mac256 = Kmac256.HashData(key, data, 200);       // Compliant\n        byte[] macXof128 = KmacXof128.HashData(key, data, 200); // Compliant\n        byte[] macXof256 = KmacXof256.HashData(key, data, 200); // Compliant\n    }\n\n    // https://sonarsource.atlassian.net/browse/NET-399\n    void CryptoOperations(byte[] data, Span<byte> hashSpan, ReadOnlySpan<byte> readOnlyData, Memory<byte> memoryData, CancellationToken cancellationToken)\n    {\n        using var stream = new MemoryStream(data);\n        CryptographicOperations.HashData(HashAlgorithmName.MD5, data);                                                   // Noncompliant\n        CryptographicOperations.HashData(HashAlgorithmName.MD5, readOnlyData, hashSpan);                                 // Noncompliant\n        CryptographicOperations.HashData(HashAlgorithmName.MD5, readOnlyData);                                           // Noncompliant\n        CryptographicOperations.HashData(HashAlgorithmName.MD5, stream, hashSpan);                                       // Noncompliant\n        CryptographicOperations.HashData(HashAlgorithmName.MD5, stream);                                                 // Noncompliant\n        CryptographicOperations.HashDataAsync(HashAlgorithmName.MD5, stream, cancellationToken);                         // Noncompliant\n        CryptographicOperations.HashDataAsync(HashAlgorithmName.MD5, stream, memoryData, cancellationToken);             // Noncompliant\n        CryptographicOperations.HmacData(HashAlgorithmName.MD5, data, data);                                             // Noncompliant\n        CryptographicOperations.HmacData(HashAlgorithmName.MD5, data, stream);                                           // Noncompliant\n        CryptographicOperations.HmacData(HashAlgorithmName.MD5, readOnlyData, readOnlyData, hashSpan);                   // Noncompliant\n        CryptographicOperations.HmacData(HashAlgorithmName.MD5, readOnlyData, readOnlyData);                             // Noncompliant\n        CryptographicOperations.HmacData(HashAlgorithmName.MD5, readOnlyData, stream, hashSpan);                         // Noncompliant\n        CryptographicOperations.HmacData(HashAlgorithmName.MD5, readOnlyData, stream);                                   // Noncompliant\n        CryptographicOperations.HmacDataAsync(HashAlgorithmName.MD5, data, stream, cancellationToken);                   // Noncompliant\n        CryptographicOperations.HmacDataAsync(HashAlgorithmName.MD5, memoryData, stream, cancellationToken);             // Noncompliant\n        CryptographicOperations.HmacDataAsync(HashAlgorithmName.MD5, memoryData, stream, memoryData, cancellationToken); // Noncompliant\n        CryptographicOperations.TryHashData(HashAlgorithmName.MD5, readOnlyData, hashSpan, out _);                       // Noncompliant\n        CryptographicOperations.TryHmacData(HashAlgorithmName.MD5, readOnlyData, readOnlyData, hashSpan, out _);         // Noncompliant\n\n        CryptographicOperations.HashData(HashAlgorithmName.SHA1, data);                                                  // Noncompliant\n        CryptographicOperations.HmacDataAsync(HashAlgorithmName.SHA1, data, stream);                                     // Noncompliant\n        CryptographicOperations.HmacDataAsync(HashAlgorithmName.SHA1, memoryData, stream, cancellationToken);            // Noncompliant\n        CryptographicOperations.TryHashData(HashAlgorithmName.SHA1, readOnlyData, hashSpan, out _);                      // Noncompliant\n\n        CryptographicOperations.HashData(HashAlgorithmName.SHA256, data);                                                // Compliant\n        CryptographicOperations.HmacDataAsync(HashAlgorithmName.SHA3_256, data, stream);                                 // Compliant\n        CryptographicOperations.HmacDataAsync(HashAlgorithmName.SHA3_384, memoryData, stream, cancellationToken);        // Compliant\n        CryptographicOperations.TryHashData(HashAlgorithmName.SHA3_512, readOnlyData, hashSpan, out _);                  // Compliant\n    }\n\n    partial class Partial\n    {\n        partial HashAlgorithm MyHashAlgorithm { get; }\n    }\n\n    partial class Partial\n    {\n        partial HashAlgorithm MyHashAlgorithm => HashAlgorithm.Create(\"\"\"System.Security.Cryptography.SHA1\"\"\"); // Noncompliant\n    }\n}\n\npublic class NullConditionalAssignment\n{\n    public class Sample\n    {\n        public HashAlgorithm Property { get; set; }\n    }\n\n    public void Method(Sample sample)\n    {\n        sample?.Property = SHA1.Create();               // Noncompliant\n    }\n}\n\npublic static class Extensions\n{\n    extension(string s)\n    {\n        public HashAlgorithm Property => SHA1.Create(); // Noncompliant\n        public HashAlgorithm Method() => SHA1.Create(); // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/CreatingHashAlgorithms.NET.vb",
    "content": "﻿Imports System\nImports System.IO\nImports System.Security.Cryptography\nImports System.Threading\nImports System.Threading.Tasks\n\nNamespace Tests.Diagnostics\n\n    Public Class Repro_FN_8758\n        Public Sub Method()\n            Dim data As Byte() = New Byte(41) {}\n            Dim hashBuffer As Byte() = New Byte(SHA1.HashSizeInBytes - 1) {}\n            Using stream As New MemoryStream(data)\n                SHA1.HashData(stream)                                              ' Noncompliant\n                SHA1.HashData(data)                                                ' Noncompliant\n                Dim bytesWrittenSHA1 As Integer\n                If SHA1.TryHashData(data, hashBuffer, bytesWrittenSHA1) Then       ' Noncompliant\n                End If\n                MD5.HashData(data)                                                 ' Noncompliant\n                Dim bytesWrittenMD5 As Integer\n                If MD5.TryHashData(data, hashBuffer, bytesWrittenMD5) Then         ' Noncompliant\n                End If\n            End Using\n        End Sub\n\n        Public Async Function Method2() As Task\n            Using stream As New MemoryStream(New Byte(41) {})\n                Await SHA1.HashDataAsync(stream)       ' Noncompliant\n                Await MD5.HashDataAsync(stream)        ' Noncompliant\n            End Using\n        End Function\n\n    End Class\n\n\n    ' https://sonarsource.atlassian.net/browse/NET-643\n    Public Class CryptographicOperationsTests\n        Public Sub CryptoOperations(data As Byte(), cancellationToken As CancellationToken)\n            Using stream As New MemoryStream(data)\n                CryptographicOperations.HashData(HashAlgorithmName.MD5, data)                                            ' Noncompliant\n                CryptographicOperations.HashData(HashAlgorithmName.SHA1, data)                                           ' Noncompliant\n                CryptographicOperations.HashData(HashAlgorithmName.SHA1, stream)                                         ' Noncompliant\n                CryptographicOperations.HmacData(HashAlgorithmName.MD5, data, data)                                      ' Noncompliant\n                CryptographicOperations.HmacData(HashAlgorithmName.SHA1, data, data)                                     ' Noncompliant\n                CryptographicOperations.HmacData(HashAlgorithmName.MD5, data, stream)                                    ' Noncompliant\n\n                Dim hashBuffer As Byte() = New Byte(31) {}\n                Dim keyBuffer As Byte() = New Byte(15) {}\n                Dim bytesWritten As Integer\n                CryptographicOperations.TryHashData(HashAlgorithmName.MD5, data, hashBuffer, bytesWritten)               ' Noncompliant\n                CryptographicOperations.TryHashData(HashAlgorithmName.SHA1, data, hashBuffer, bytesWritten)              ' Noncompliant\n                CryptographicOperations.TryHmacData(HashAlgorithmName.MD5, keyBuffer, data, hashBuffer, bytesWritten)    ' Noncompliant\n                CryptographicOperations.TryHmacData(HashAlgorithmName.SHA1, keyBuffer, data, hashBuffer, bytesWritten)   ' Noncompliant\n\n                CryptographicOperations.HashData(HashAlgorithmName.SHA256, data)                                         ' Compliant\n                CryptographicOperations.HmacData(HashAlgorithmName.SHA256, data, data)                                   ' Compliant\n                CryptographicOperations.TryHashData(HashAlgorithmName.SHA3_256, data, hashBuffer, bytesWritten)          ' Compliant\n                CryptographicOperations.TryHmacData(HashAlgorithmName.SHA3_256, keyBuffer, data, hashBuffer, bytesWritten) ' Compliant\n            End Using\n        End Sub\n\n        Public Async Function CryptoOperationsAsync(data As Byte(), cancellationToken As CancellationToken) As Task\n            Using stream As New MemoryStream(data)\n                Await CryptographicOperations.HashDataAsync(HashAlgorithmName.MD5, stream, cancellationToken)             ' Noncompliant\n                Await CryptographicOperations.HashDataAsync(HashAlgorithmName.SHA1, stream)                              ' Noncompliant\n                Await CryptographicOperations.HmacDataAsync(HashAlgorithmName.MD5, data, stream, cancellationToken)      ' Noncompliant\n                Await CryptographicOperations.HmacDataAsync(HashAlgorithmName.SHA1, data, stream)                        ' Noncompliant\n\n                Await CryptographicOperations.HashDataAsync(HashAlgorithmName.SHA256, stream)                            ' Compliant\n                Await CryptographicOperations.HmacDataAsync(HashAlgorithmName.SHA256, data, stream)                      ' Compliant\n            End Using\n        End Function\n    End Class\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/CreatingHashAlgorithms.NetFramework.cs",
    "content": "﻿using System.Security.Cryptography;\n\nnamespace Tests.Diagnostics\n{\n    public class InsecureHashAlgorithm\n    {\n        public void Hash(byte[] temp)\n        {\n            var HMACRIPEMD160 = new HMACRIPEMD160(); // Noncompliant\n            var HMACRIPEMD160Create = HMACMD5.Create(); // Noncompliant\n            var HMACRIPEMD160CreateWithParam = HMACMD5.Create(\"HMACRIPEMD160\"); // Noncompliant\n            var HMACRIPEMD160KeyedHashAlgorithm = KeyedHashAlgorithm.Create(\"HMACRIPEMD160\"); // Noncompliant\n            var HMACRIPEMD160KeyedHashAlgorithmWithNamespace = KeyedHashAlgorithm.Create(\"System.Security.Cryptography.HMACRIPEMD160\"); // Noncompliant\n            var HMACRIPEMD160CryptoConfig = (HashAlgorithm)CryptoConfig.CreateFromName(\"HMACRIPEMD160\"); // Noncompliant\n\n            var MD5Cng = new MD5Cng(); // Noncompliant\n\n            var RIPEMD160Managed  = new RIPEMD160Managed(); // Noncompliant\n\n            var RIPEMD160Create = RIPEMD160.Create(); // Noncompliant\n            var RIPEMD160CreateWithParam = RIPEMD160.Create(\"RIPEMD160\"); // Noncompliant\n            var RIPEMD160HashAlgorithm = HashAlgorithm.Create(\"RIPEMD160\"); // Noncompliant\n            var RIPEMD160HashAlgorithmWithNamespace = HashAlgorithm.Create(\"System.Security.Cryptography.RIPEMD160\"); // Noncompliant\n            var RIPEMD160CryptoConfig = (HashAlgorithm)CryptoConfig.CreateFromName(\"RIPEMD160\"); // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/CreatingHashAlgorithms.NetFramework.vb",
    "content": "﻿Imports System.Security.Cryptography\n\nNamespace Tests.Diagnostics\n\n    Public Class InsecureHashAlgorithm\n\n        Public Sub Hash(temp as Byte())\n            Dim HMACRIPEMD160 = new HMACRIPEMD160() ' Noncompliant\n            Dim HMACRIPEMD160Create = HMACMD5.Create() ' Noncompliant\n            Dim HMACRIPEMD160CreateWithParam = HMACMD5.Create(\"HMACRIPEMD160\") ' Noncompliant\n            Dim HMACRIPEMD160KeyedHashAlgorithm = KeyedHashAlgorithm.Create(\"HMACRIPEMD160\") ' Noncompliant\n            Dim HMACRIPEMD160KeyedHashAlgorithmWithNamespace = KeyedHashAlgorithm.Create(\"System.Security.Cryptography.HMACRIPEMD160\") ' Noncompliant\n            Dim HMACRIPEMD160CryptoConfig = CryptoConfig.CreateFromName(\"HMACRIPEMD160\") ' Noncompliant\n\n            Dim MD5Cng = new MD5Cng() ' Noncompliant\n\n            Dim RIPEMD160Managed  = new RIPEMD160Managed() ' Noncompliant\n\n            Dim RIPEMD160Create = RIPEMD160.Create() ' Noncompliant\n            Dim RIPEMD160CreateWithParam = RIPEMD160.Create(\"RIPEMD160\") ' Noncompliant\n            Dim RIPEMD160HashAlgorithm = HashAlgorithm.Create(\"RIPEMD160\") ' Noncompliant\n            Dim RIPEMD160HashAlgorithmWithNamespace = HashAlgorithm.Create(\"System.Security.Cryptography.RIPEMD160\") ' Noncompliant\n            Dim RIPEMD160CryptoConfig = CryptoConfig.CreateFromName(\"RIPEMD160\") ' Noncompliant\n        End Sub\n\n    End Class\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/CreatingHashAlgorithms.cs",
    "content": "﻿using System.Security.Cryptography;\n\nnamespace Tests.Diagnostics\n{\n    public class InsecureHashAlgorithm\n    {\n        public void Hash(byte[] temp)\n        {\n            var DSACng = new DSACng(10); // Noncompliant {{Make sure this weak hash algorithm is not used in a sensitive context here.}}\n//                       ^^^^^^^^^^^^^^\n            var DSACryptoServiceProvider = new DSACryptoServiceProvider(); // Noncompliant\n            var DSACreate = DSA.Create(); // Noncompliant\n            var DSACreateWithParam = DSA.Create(\"DSA\"); // Noncompliant\n            var DSACreateFromName = (AsymmetricAlgorithm)CryptoConfig.CreateFromName(\"DSA\"); // Noncompliant\n            var DSAAsymmetricAlgorithm = AsymmetricAlgorithm.Create(\"DSA\"); // Noncompliant\n            var DSAAsymmetricAlgorithmWithNamespace = AsymmetricAlgorithm.Create(\"System.Security.Cryptography.DSA\"); // Noncompliant\n\n            var HMACCreate = HMAC.Create(); // Noncompliant\n            var HMACCreateWithParam = HMAC.Create(\"HMACMD5\"); // Noncompliant\n\n            var HMACMD5 = new HMACMD5(); // Noncompliant\n            var HMACMD5Create = HMACMD5.Create(); // Noncompliant\n            var HMACMD5CreateWithParam = HMACMD5.Create(\"HMACMD5\"); // Noncompliant\n            var HMACMD5KeyedHashAlgorithm = KeyedHashAlgorithm.Create(\"HMACMD5\"); // Noncompliant\n            var HMACMD5KeyedHashAlgorithmWithNamespace = KeyedHashAlgorithm.Create(\"System.Security.Cryptography.HMACMD5\"); // Noncompliant\n            var HMACMD5CryptoConfig = (HashAlgorithm)CryptoConfig.CreateFromName(\"HMACMD5\"); // Noncompliant\n\n            var HMACSHA1 = new HMACSHA1(); // Noncompliant\n            var HMACSHA1Create = HMACMD5.Create(); // Noncompliant\n            var HMACSHA1CreateWithParam = HMACMD5.Create(\"HMACSHA1\"); // Noncompliant\n            var HMACSHA1KeyedHashAlgorithm = KeyedHashAlgorithm.Create(\"HMACSHA1\"); // Noncompliant\n            var HMACSHA1KeyedHashAlgorithmWithNamespace = KeyedHashAlgorithm.Create(\"System.Security.Cryptography.HMACSHA1\"); // Noncompliant\n            var HMACSHA1CryptoConfig = (HashAlgorithm)CryptoConfig.CreateFromName(\"HMACSHA1\"); // Noncompliant\n\n            var HMACSHA256Create = HMACSHA256.Create(\"HMACSHA256\");\n            var HMACSHA256KeyedHashAlgorithm = KeyedHashAlgorithm.Create(\"HMACSHA256\");\n            var HMACSHA256KeyedHashAlgorithmWithNamespace = KeyedHashAlgorithm.Create(\"System.Security.Cryptography.HMACSHA256\");\n            var HMACSHA256CryptoConfig = (HashAlgorithm)CryptoConfig.CreateFromName(\"HMACSHA256\");\n\n            var MD5CryptoServiceProvider = new MD5CryptoServiceProvider(); // Noncompliant\n            var MD5CryptoConfig = (HashAlgorithm)CryptoConfig.CreateFromName(\"MD5\"); // Noncompliant\n            var MD5HashAlgorithm = HashAlgorithm.Create(\"MD5\"); // Noncompliant\n            var MD5HashAlgorithmWithNamespace = HashAlgorithm.Create(\"System.Security.Cryptography.MD5\"); // Noncompliant\n            var MD5Create = MD5.Create(); // Noncompliant\n            var MD5CreateWithParam = MD5.Create(\"MD5\"); // Noncompliant\n\n            var SHA1Managed = new SHA1Managed(); // Noncompliant\n            var SHA1Create = SHA1.Create(); // Noncompliant\n            var SHA1CreateWithParam = SHA1.Create(\"SHA1\"); // Noncompliant\n            var SHA1HashAlgorithm = HashAlgorithm.Create(\"SHA1\"); // Noncompliant\n            var SHA1HashAlgorithmWithNamespace = HashAlgorithm.Create(\"System.Security.Cryptography.SHA1\"); // Noncompliant\n            var SHA1CryptoServiceProvider = new SHA1CryptoServiceProvider(); // Noncompliant\n\n            var sha256Managed = new SHA256Managed();\n            var sha256HashAlgorithm = HashAlgorithm.Create(\"SHA256Managed\");\n            var sha256HashAlgorithmWithNamespace = HashAlgorithm.Create(\"System.Security.Cryptography.SHA256Managed\");\n            var sha256CryptoConfig = CryptoConfig.CreateFromName(\"SHA256Managed\");\n\n            HashAlgorithm hashAlgo = HashAlgorithm.Create();\n\n            var algoName = \"MD5\";\n            var md5Var = (HashAlgorithm)CryptoConfig.CreateFromName(algoName); // Noncompliant\n            algoName = \"SHA256Managed\";\n            var SHA256ManagedVar = (HashAlgorithm)CryptoConfig.CreateFromName(algoName);\n\n            const string part1 = \"System.Security.Cryptography\";\n            const string part2 = \"SHA1\";\n            var SHA1HashAlgorithmInterpolation = HashAlgorithm.Create($\"{part1}.{part2}\"); // Noncompliant\n\n            string part3 = \"System.Security.Cryptography\";\n            string part4 = \"SHA1\";\n            var SHA1HashAlgorithmInterpolation2 = HashAlgorithm.Create($\"{part3}.{part4}\"); // FN (at the moment we validate only constant string)\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/CreatingHashAlgorithms.vb",
    "content": "﻿Imports System.IO\nImports System.Security.Cryptography\n\nNamespace Tests.Diagnostics\n\n    Public Class InsecureHashAlgorithm\n\n        Public Sub Hash(temp As Byte())\n            Dim DSACng = New DSACng(10)\n'                        ^^^^^^^^^^^^^^ {{Make sure this weak hash algorithm is not used in a sensitive context here.}}\n            Dim DSACryptoServiceProvider = New DSACryptoServiceProvider() ' Noncompliant\n            Dim DSACreate = DSA.Create() ' Noncompliant\n            Dim DSACreateWithParam = DSA.Create(\"DSA\") ' Noncompliant\n            Dim DSACreateFromName = CryptoConfig.CreateFromName(\"DSA\") ' Noncompliant\n            Dim DSAAsymmetricAlgorithm = AsymmetricAlgorithm.Create(\"DSA\") ' Noncompliant\n            Dim DSAAsymmetricAlgorithmWithNamespace = AsymmetricAlgorithm.Create(\"System.Security.Cryptography.DSA\") ' Noncompliant\n\n            Dim HMACCreate = HMAC.Create() ' Noncompliant\n            Dim HMACCreateWithParam = HMAC.Create(\"HMACMD5\") ' Noncompliant\n\n            Dim HMACMD5 = New HMACMD5() ' Noncompliant\n            Dim HMACMD5Create = HMACMD5.Create() ' Noncompliant\n            Dim HMACMD5CreateWithParam = HMACMD5.Create(\"HMACMD5\") ' Noncompliant\n            Dim HMACMD5KeyedHashAlgorithm = KeyedHashAlgorithm.Create(\"HMACMD5\") ' Noncompliant\n            Dim HMACMD5KeyedHashAlgorithmWithNamespace = KeyedHashAlgorithm.Create(\"System.Security.Cryptography.HMACMD5\") ' Noncompliant\n            Dim HMACMD5CryptoConfig = CryptoConfig.CreateFromName(\"HMACMD5\") ' Noncompliant\n\n            Dim HMACSHA1 = New HMACSHA1() ' Noncompliant\n            Dim HMACSHA1Create = HMACMD5.Create() ' Noncompliant\n            Dim HMACSHA1CreateWithParam = HMACMD5.Create(\"HMACSHA1\") ' Noncompliant\n            Dim HMACSHA1KeyedHashAlgorithm = KeyedHashAlgorithm.Create(\"HMACSHA1\") ' Noncompliant\n            Dim HMACSHA1KeyedHashAlgorithmWithNamespace = KeyedHashAlgorithm.Create(\"System.Security.Cryptography.HMACSHA1\") ' Noncompliant\n            Dim HMACSHA1CryptoConfig = CryptoConfig.CreateFromName(\"HMACSHA1\") ' Noncompliant\n\n            Dim HMACSHA256Create = HMACSHA256.Create(\"HMACSHA256\")\n            Dim HMACSHA256KeyedHashAlgorithm = KeyedHashAlgorithm.Create(\"HMACSHA256\")\n            Dim HMACSHA256KeyedHashAlgorithmWithNamespace = KeyedHashAlgorithm.Create(\"System.Security.Cryptography.HMACSHA256\")\n            Dim HMACSHA256CryptoConfig = CryptoConfig.CreateFromName(\"HMACSHA256\")\n\n            Dim MD5CryptoServiceProvider = New MD5CryptoServiceProvider() ' Noncompliant\n            Dim MD5CryptoConfig = CryptoConfig.CreateFromName(\"MD5\") ' Noncompliant\n            Dim MD5HashAlgorithm = HashAlgorithm.Create(\"MD5\") ' Noncompliant\n            Dim MD5HashAlgorithmWithNamespace = HashAlgorithm.Create(\"System.Security.Cryptography.MD5\") ' Noncompliant\n            Dim MD5Create = MD5.Create() ' Noncompliant\n            Dim MD5CreateWithParam = MD5.Create(\"MD5\") ' Noncompliant\n\n            Dim SHA1Managed = New SHA1Managed() ' Noncompliant\n            Dim SHA1Create = SHA1.Create() ' Noncompliant\n            Dim SHA1CreateWithParam = SHA1.Create(\"SHA1\") ' Noncompliant\n            Dim SHA1HashAlgorithm = HashAlgorithm.Create(\"SHA1\") ' Noncompliant\n            Dim SHA1HashAlgorithmWithNamespace = HashAlgorithm.Create(\"System.Security.Cryptography.SHA1\") ' Noncompliant\n            Dim SHA1CryptoServiceProvider = New SHA1CryptoServiceProvider() ' Noncompliant\n\n            Dim SHA256Managed = New SHA256Managed()\n            Dim SHA256ManagedHashAlgorithm = HashAlgorithm.Create(\"SHA256Managed\")\n            Dim SHA256ManagedHashAlgorithmWithNamespace = HashAlgorithm.Create(\"System.Security.Cryptography.SHA256Managed\")\n            Dim SHA256ManagedCryptoConfig = CryptoConfig.CreateFromName(\"SHA256Managed\")\n\n            Dim hashAlgo = HashAlgorithm.Create()\n\n            Dim algoName = \"MD5\"\n            Dim MD5Var = CryptoConfig.CreateFromName(algoName) ' Noncompliant\n\n            algoName = \"SHA256Managed\"\n            Dim SHA256ManagedVar = CryptoConfig.CreateFromName(algoName)\n        End Sub\n\n        'Repro NET-3011\n        Public Sub NoParenthesis()\n            SHA1.Create                                                 ' Noncompliant\n            Dim InVariableDeclarator As HashAlgorithm = SHA1.Create     ' Noncompliant\n\n            Using InUsingStatement As HashAlgorithm = SHA1.Create       ' Noncompliant\n\n            End Using\n        End Sub\n\n    End Class\n\n    Public Class MyDSA\n        Inherits DSA\n\n        Public Overrides Sub ImportParameters(parameters As DSAParameters)\n            Throw New NotImplementedException()\n        End Sub\n\n        Public Overrides Function CreateSignature(rgbHash() As Byte) As Byte()\n            Throw New NotImplementedException()\n        End Function\n\n        Public Overrides Function ExportParameters(includePrivateParameters As Boolean) As DSAParameters\n            Throw New NotImplementedException()\n        End Function\n\n        Public Overrides Function VerifySignature(rgbHash() As Byte, rgbSignature() As Byte) As Boolean\n            Throw New NotImplementedException()\n        End Function\n\n        Public Sub UseHashData()\n            Dim data = New Byte(41) {}\n            Using stream = New System.IO.MemoryStream(data)\n                Dim a = HashData(data, 0, data.Length, HashAlgorithmName.SHA1)                             ' Noncompliant\n                Dim b = HashData(stream, HashAlgorithmName.SHA1)                                           ' Noncompliant\n            End Using\n        End Sub\n\n    End Class\n\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/DeliveringDebugFeaturesInProduction.Net7.cs",
    "content": "﻿using Microsoft.AspNetCore.Builder;\nusing Microsoft.Extensions.Hosting;\n\nvar builder = WebApplication.CreateBuilder(args);\nvar app = builder.Build();\n\n// https://github.com/SonarSource/sonar-dotnet/issues/6772\nif (app.Environment.IsDevelopment())\n{\n    app.UseDeveloperExceptionPage();\n}\n\napp.Run();\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/DeliveringDebugFeaturesInProduction.NetCore2.cs",
    "content": "﻿using System;\nusing Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Hosting;\n\nnamespace Tests.Diagnostics\n{\n    public class Startup\n    {\n        // for coverage\n        private IHostingEnvironment env;\n\n        private IApplicationBuilder foo;\n        public IApplicationBuilder Foo\n        {\n            get\n            {\n                if (env.IsDevelopment())\n                {\n                    foo.UseDeveloperExceptionPage();        // Compliant\n                }\n                return foo;\n            }\n            set\n            {\n                var x = value.UseDeveloperExceptionPage();  // Noncompliant\n                foo = value;\n            }\n        }\n\n        event EventHandler SomeEvent\n        {\n            add { foo.UseDeveloperExceptionPage(); }        // Noncompliant\n            remove\n            {\n                if (env.IsDevelopment())\n                {\n                    foo.UseDeveloperExceptionPage();        // Compliant\n                }\n            }\n        }\n\n        public Startup()\n        {\n            foo.UseDeveloperExceptionPage();                // Noncompliant\n        }\n\n        public void Lambda()\n        {\n            Action action1 = () =>\n            {\n                foo.UseDeveloperExceptionPage();            // Noncompliant\n            };\n            action1();\n\n            Action action2 = () =>\n            {\n                if (env.IsDevelopment())\n                {\n                    foo.UseDeveloperExceptionPage();        // Compliant\n                }\n            };\n            action2();\n        }\n\n        public void Configure(IApplicationBuilder app, IHostingEnvironment env)\n        {\n            // Invoking as extension methods\n            if (env.IsDevelopment())\n            {\n                app.UseDeveloperExceptionPage(); // Compliant\n                app.UseDatabaseErrorPage(); // Compliant\n            }\n        }\n\n        public void Configure2(IApplicationBuilder app, IHostingEnvironment env)\n        {\n            // Invoking as static methods\n            if (HostingEnvironmentExtensions.IsDevelopment(env))\n            {\n                DeveloperExceptionPageExtensions.UseDeveloperExceptionPage(app); // Compliant\n                DatabaseErrorPageExtensions.UseDatabaseErrorPage(app); // Compliant\n            }\n        }\n\n        public void Configure3(IApplicationBuilder app, IHostingEnvironment env)\n        {\n            // Not in development\n            if (!env.IsDevelopment())\n            {\n                DeveloperExceptionPageExtensions.UseDeveloperExceptionPage(app); // FN\n                DatabaseErrorPageExtensions.UseDatabaseErrorPage(app); // FN\n            }\n        }\n\n        public void Configure4(IApplicationBuilder app, IHostingEnvironment env)\n        {\n            var isDevelopment = env.IsDevelopment();\n            if (isDevelopment)\n            {\n                app.UseDeveloperExceptionPage();\n                app.UseDatabaseErrorPage();\n            }\n        }\n\n        public void Configure5(IApplicationBuilder app, IHostingEnvironment env)\n        {\n            while (env.IsDevelopment())\n            {\n                app.UseDeveloperExceptionPage();\n                app.UseDatabaseErrorPage();\n                break;\n            }\n        }\n\n        public void Configure6(IApplicationBuilder app, IHostingEnvironment env)\n        {\n            app.UseDeveloperExceptionPage(); // Noncompliant\n            app.UseDatabaseErrorPage(); // Noncompliant\n            DeveloperExceptionPageExtensions.UseDeveloperExceptionPage(app); // Noncompliant\n            DatabaseErrorPageExtensions.UseDatabaseErrorPage(app); // Noncompliant\n        }\n\n        public void Configure7(IApplicationBuilder app, IHostingEnvironment env)\n        {\n            var x = env.IsDevelopment();\n            app.UseDeveloperExceptionPage(); // FN\n            app.UseDatabaseErrorPage(); // FN\n        }\n\n        public void ConfigureAsArrow(IApplicationBuilder app, IHostingEnvironment env) =>\n            DeveloperExceptionPageExtensions.UseDeveloperExceptionPage(app); // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/DeliveringDebugFeaturesInProduction.NetCore2.vb",
    "content": "﻿Imports System\nImports Microsoft.AspNetCore.Builder\nImports Microsoft.AspNetCore.Hosting\n\nNamespace Tests.Diagnostics\n\n    Public Class Startup\n\n        Public Shared DefaultBuilder As IApplicationBuilder\n        Public Builder As IApplicationBuilder = DefaultBuilder.UseDeveloperExceptionPage() ' Noncompliant\n\n        Public Sub Configure(ByVal app As IApplicationBuilder, ByVal env As IHostingEnvironment)\n            ' Invoking as extension methods\n            If env.IsDevelopment() Then\n                app.UseDeveloperExceptionPage() ' Compliant\n                app.UseDatabaseErrorPage() ' Compliant\n            End If\n\n            ' Invoking as static methods\n            If HostingEnvironmentExtensions.IsDevelopment(env) Then\n                DeveloperExceptionPageExtensions.UseDeveloperExceptionPage(app) ' Compliant\n                DatabaseErrorPageExtensions.UseDatabaseErrorPage(app) ' Compliant\n            End If\n\n            ' Not in development\n            If Not env.IsDevelopment() Then\n                DeveloperExceptionPageExtensions.UseDeveloperExceptionPage(app) ' Noncompliant\n                DatabaseErrorPageExtensions.UseDatabaseErrorPage(app) ' Noncompliant\n            End If\n\n            ' Custom conditions are deliberately ignored\n            Dim isDevelopment = env.IsDevelopment()\n            If isDevelopment Then\n                app.UseDeveloperExceptionPage() ' Noncompliant, False Positive\n                app.UseDatabaseErrorPage() ' Noncompliant, False Positive\n            End If\n\n            ' Only simple IF checks are considered\n            While env.IsDevelopment\n                app.UseDeveloperExceptionPage   ' Noncompliant FP\n                app.UseDatabaseErrorPage        ' Noncompliant FP\n                Exit While\n            End While\n\n            ' These are called unconditionally\n            app.UseDeveloperExceptionPage() ' Noncompliant\n            app.UseDatabaseErrorPage() ' Noncompliant\n            DeveloperExceptionPageExtensions.UseDeveloperExceptionPage(app) ' Noncompliant\n            DatabaseErrorPageExtensions.UseDatabaseErrorPage(app) ' Noncompliant\n\n            ' VB-specific syntax\n            If env.IsDevelopment() Then app.UseDeveloperExceptionPage() ' Compliant\n            If env.IsDevelopment() Then app.UseDatabaseErrorPage() ' Compliant\n            If Not env.IsDevelopment() Then app.UseDeveloperExceptionPage() ' Noncompliant\n            If Not env.IsDevelopment() Then app.UseDatabaseErrorPage() ' Noncompliant\n        End Sub\n\n    End Class\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/DeliveringDebugFeaturesInProduction.NetCore3.cs",
    "content": "﻿using Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Hosting;\nusing Microsoft.Extensions.Hosting;\n\nnamespace NetCore3\n{\n    public class Startup\n    {\n        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)\n        {\n            // Invoking as extension methods\n            if (env.IsDevelopment())\n            {\n                app.UseDeveloperExceptionPage(); // Compliant\n            }\n        }\n\n        public void Configure2(IApplicationBuilder app, IWebHostEnvironment env)\n        {\n            // Invoking as static methods\n            if (HostEnvironmentEnvExtensions.IsDevelopment(env))\n            {\n                DeveloperExceptionPageExtensions.UseDeveloperExceptionPage(app); // Compliant\n            }\n        }\n\n        public void Configure3(IApplicationBuilder app, IWebHostEnvironment env)\n        {\n            // Not in development\n            if (!env.IsDevelopment())\n            {\n                DeveloperExceptionPageExtensions.UseDeveloperExceptionPage(app); // FN\n            }\n        }\n\n        public void Configure4(IApplicationBuilder app, IWebHostEnvironment env)\n        {\n            var isDevelopment = env.IsDevelopment();\n            if (isDevelopment)\n            {\n                app.UseDeveloperExceptionPage();\n            }\n        }\n\n        public void Configure5(IApplicationBuilder app, IWebHostEnvironment env)\n        {\n            while (env.IsDevelopment())\n            {\n                app.UseDeveloperExceptionPage();\n                break;\n            }\n        }\n\n        public void Configure6(IApplicationBuilder app, IWebHostEnvironment env)\n        {\n            app.UseDeveloperExceptionPage(); // Noncompliant\n            DeveloperExceptionPageExtensions.UseDeveloperExceptionPage(app); // Noncompliant\n        }\n\n        public void Configure7(IApplicationBuilder app, IWebHostEnvironment env)\n        {\n            var x = env.IsDevelopment();\n            app.UseDeveloperExceptionPage(); // FN\n        }\n\n        public void ConfigureAsArrow(IApplicationBuilder app, IWebHostEnvironment env) =>\n            DeveloperExceptionPageExtensions.UseDeveloperExceptionPage(app); // Noncompliant\n    }\n\n    public class StartupDevelopment\n    {\n        public void Configure(IApplicationBuilder app, IWebHostEnvironment env) =>\n            // See: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/environments?view=aspnetcore-5.0#startup-class-conventions\n            app.UseDeveloperExceptionPage(); // Compliant, it is inside StartupDevelopment class\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/DeliveringDebugFeaturesInProduction.NetCore3.vb",
    "content": "﻿Imports Microsoft.AspNetCore.Builder\nImports Microsoft.AspNetCore.Hosting\nImports Microsoft.Extensions.Hosting\n\nNamespace Tests.Diagnostics\n\n    Public Class Startup\n\n        Public Shared DefaultBuilder As IApplicationBuilder\n        Public Builder As IApplicationBuilder = DefaultBuilder.UseDeveloperExceptionPage() ' Noncompliant\n\n        Public Sub Configure(ByVal app As IApplicationBuilder, ByVal env As IWebHostEnvironment)\n            ' Invoking as extension methods\n            If env.IsDevelopment() Then\n                app.UseDeveloperExceptionPage() ' Compliant\n            End If\n\n            ' Invoking as static methods\n            If HostEnvironmentEnvExtensions.IsDevelopment(env) Then\n                DeveloperExceptionPageExtensions.UseDeveloperExceptionPage(app) ' Compliant\n            End If\n\n            ' Not in development\n            If Not env.IsDevelopment() Then\n                DeveloperExceptionPageExtensions.UseDeveloperExceptionPage(app) ' Noncompliant\n            End If\n\n            ' Custom conditions are deliberately ignored\n            Dim isDevelopment = env.IsDevelopment()\n            If isDevelopment Then\n                app.UseDeveloperExceptionPage() ' Noncompliant, False Positive\n            End If\n\n            ' Only simple IF checks are considered\n            While env.IsDevelopment\n                app.UseDeveloperExceptionPage   ' Noncompliant FP\n                Exit While\n            End While\n\n            ' These are called unconditionally\n            app.UseDeveloperExceptionPage() ' Noncompliant\n            DeveloperExceptionPageExtensions.UseDeveloperExceptionPage(app) ' Noncompliant\n\n            ' VB-specific syntax\n            If env.IsDevelopment() Then app.UseDeveloperExceptionPage() ' Compliant\n            If Not env.IsDevelopment() Then app.UseDeveloperExceptionPage() ' Noncompliant\n        End Sub\n\n    End Class\n\n    Public Class StartupDevelopment\n\n        Public Sub Configure(ByVal app As IApplicationBuilder, ByVal env As IWebHostEnvironment)\n            ' See: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/environments?view=aspnetcore-5.0#startup-class-conventions\n            app.UseDeveloperExceptionPage() ' Compliant, it is inside StartupDevelopment class\n        End Sub\n\n    End Class\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/DisablingCsrfProtection.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Linq;\nusing Microsoft.AspNetCore.Mvc;\nusing Microsoft.AspNetCore.Mvc.ViewFeatures;\nusing Microsoft.Extensions.DependencyInjection;\nusing IATA = Microsoft.AspNetCore.Mvc.IgnoreAntiforgeryTokenAttribute;\n\npublic class DisablingCSRFProtection\n{\n    public static void ConfigureServices(IServiceCollection services)\n    {\n        services.AddControllersWithViews(options => options.Filters.Add(new IgnoreAntiforgeryTokenAttribute())); // Noncompliant\n        services.AddControllersWithViews(options => options.Filters.Add(new IATA())); // FN - for performance reasons type alias is not supported\n        services.AddControllersWithViews(options => options.Filters.Add(new AutoValidateAntiforgeryTokenAttribute()));\n        services.AddControllersWithViews(options => options.Filters.Add(new ValidateAntiForgeryTokenAttribute()));\n        services.AddControllers(options => options.Filters.Add(new IgnoreAntiforgeryTokenAttribute())); // Noncompliant\n        services.AddMvc(options => options.Filters.Add(new IgnoreAntiforgeryTokenAttribute())); // Noncompliant\n        services.AddMvcCore(options => options.Filters.Add(new IgnoreAntiforgeryTokenAttribute())); // Noncompliant\n\n        Action<MvcOptions> setupAction = options => options.Filters.Add(new IgnoreAntiforgeryTokenAttribute()); // Noncompliant\n        services.AddControllersWithViews(setupAction);\n\n        static void SetupAction(MvcOptions options) => options.Filters.Add(new IgnoreAntiforgeryTokenAttribute()); // Noncompliant\n        services.AddControllersWithViews(SetupAction);\n\n        services.AddMvc(options => options.Filters.Add(GetAntiForgeryPolicy()));\n\n        IgnoreAntiforgeryTokenAttribute _ = new(); // Noncompliant\n    }\n\n    private static IAntiforgeryPolicy GetAntiForgeryPolicy() =>\n        new IgnoreAntiforgeryTokenAttribute(); // Noncompliant\n}\n\n[IgnoreAntiforgeryToken] // Noncompliant\npublic class S4502Controller : Controller\n{\n    private readonly string path = string.Empty;\n\n    [IgnoreAntiforgeryToken] // Noncompliant\n    public IActionResult ChangeEmail_Noncompliant(string model) => View(path);\n\n    [HttpPost, IgnoreAntiforgeryTokenAttribute] // Noncompliant\n    public IActionResult ChangeEmail_AttributesOnTheSameLine_Noncompliant(string model) => View(path);\n\n    [HttpPost]\n    [AutoValidateAntiforgeryToken]\n    public IActionResult ChangeEmail_Compliant(string model) => View(path);\n\n    [HttpPost, AutoValidateAntiforgeryToken]\n    public IActionResult ChangeEmail_AttributesOnTheSameLine_Compliant(string model) => View(path);\n}\n\ninternal class Inheritance \n{\n    [DerivedAttribute] // FN - for performance reasons inheritance is not supported\n    public void B() { }\n}\n\npublic class DerivedAttribute : IgnoreAntiforgeryTokenAttribute { }\n\ninternal class TestCases\n{\n    public void Bar(IEnumerable<int> collection)\n    {\n        [IgnoreAntiforgeryToken] int Get() => 1; // Noncompliant\n\n        _ = collection.Select([IgnoreAntiforgeryToken] (x) => x + 1); // Noncompliant\n\n        Func<int, int> nonCompliantDelegate = [IgnoreAntiforgeryToken] (x) => x + 1; // Noncompliant\n\n        Action a = [IgnoreAntiforgeryToken] () => { }; // Noncompliant\n\n        Action x = true\n                       ? ([IgnoreAntiforgeryToken] () => { }) // Noncompliant\n                       : [IgnoreAntiforgeryToken] () => { }; // Noncompliant\n\n        Call([IgnoreAntiforgeryToken] (x) => { }); // Noncompliant\n    }\n\n    private void Call(Action<int> action) => action(1);\n}\n\ninternal class SomeTest2\n{\n    [GenericIgnoreAntiforgeryToken<int>]    // FN: for performance reasons inheritance is not supported\n    public void A() { }\n\n    [IgnoreAntiforgeryTokenAttribute]       // Noncompliant\n    public void B() { }\n}\n\npublic class GenericIgnoreAntiforgeryToken<T> : IgnoreAntiforgeryTokenAttribute { }\n\npublic class DisablingCSRFProtection2\n{\n    public static void ConfigureServices(IServiceCollection services)\n    {\n        services.AddControllers((MvcOptions options = null) => options.Filters.Add(new IgnoreAntiforgeryTokenAttribute())); // Noncompliant\n    }\n}\n\npartial class Partial\n{\n    public IEnumerable<int> collection;\n\n    [IgnoreAntiforgeryToken] // Noncompliant\n    partial int Get => 1; // Error@-1 [CS0592]\n\n    partial int Get2\n    {\n        get\n        {\n            return collection.Select([IgnoreAntiforgeryToken] (x) => x + 1).FirstOrDefault(); // Noncompliant\n        }\n    }\n}\n\npartial class Partial\n{\n    partial int Get { get; }\n    partial int Get2 { get; }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/DisablingRequestValidation.cs",
    "content": "﻿using System;\nusing System.Web.Mvc;\n\nnamespace Tests.Diagnostics\n{\n    [ValidateInput(false)] // Noncompliant {{Make sure disabling ASP.NET Request Validation feature is safe here.}}\n    public class NonCompliantClass\n    {\n    }\n\n    public class NonCompliantMethods // we don't care if it derives from controller\n    {\n        [ValidateInput(false)] // Noncompliant {{Make sure disabling ASP.NET Request Validation feature is safe here.}}\n//       ^^^^^^^^^^^^^^^^^^^^\n        public ActionResult Foo(string input)\n        {\n            return null;\n        }\n\n        [CLSCompliant(false)]\n        [ValidateInput(false)] // Noncompliant\n        public ActionResult WithTwoFalse(string input)\n        {\n            return Foo(input);\n        }\n\n        [HttpPost]\n        [ValidateInput(false)] // Noncompliant\n        [Obsolete]\n        public ActionResult FooWithMoreAttributes(string input)\n        {\n            return Foo(input);\n        }\n\n        [ValidateInput(false)] // Noncompliant\n        public ActionResult FooNoParam()\n        {\n            return null;\n        }\n\n        [ValidateInput(false)] // Noncompliant\n        public void VoidFoo() { }\n\n        [ValidateInput(false)] // Noncompliant\n        private ActionResult ArrowFoo(string i) => null;\n    }\n\n    public class CompliantController : Controller\n    {\n        [ValidateInput(true)]\n        public ActionResult Foo(string input)\n        {\n            return Foo(input);\n        }\n\n        public ActionResult Bar()\n        {\n            return null;\n        }\n\n        [HttpPost]\n        public ActionResult Boo(AllowedHtml input) => null;\n\n        [System.Web.Mvc.HttpPost]\n        [System.Web.Mvc.ValidateInput(true)]\n        public ActionResult Qix(string input)\n        {\n            return Foo(input);\n        }\n\n        private ActionResult Quix(string i) => null;\n    }\n\n    [ValidateInput(true)]\n    public class CompliantController2 : Controller\n    {\n    }\n\n    public class AllowedHtml\n    {\n        [AllowHtml] // ok\n        public string Prop { get; set; }\n    }\n\n    [Obsolete]\n    public class MyObsoleteClass // for coverage\n    {\n    }\n\n    [Obsolete(\"\", false)]\n    public class MyObsoleteClass2 // for coverage\n    {\n    }\n\n    [CLSCompliant(false)] // for coverage\n    public class ClassWithFalse\n    {\n    }\n\n    public class Errors\n    {\n        [ValidateInput(\"foo\")] // Error [CS1503] - cannot convert to bool\n        public ActionResult Foo(string input)\n        {\n            return Foo(input);\n        }\n\n        [ValidateInput()] // Error [CS7036] - no arg given\n        public ActionResult Bar(string input)\n        {\n            return Foo(input);\n        }\n\n        [ValidateInput(false, \"foo\")] // Error [CS1729] - ctor doesn't exist\n        public ActionResult Baz(string input)\n        {\n            return Foo(input);\n        }\n    }\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/DisablingRequestValidation.vb",
    "content": "﻿Imports System\nImports System.Web.Mvc\n\nNamespace Tests.Diagnostics\n    <ValidateInput(False)> ' Noncompliant {{Make sure disabling ASP.NET Request Validation feature is safe here.}}\n    Public Class NonCompliantClass\n    End Class\n\n    Public Class NonCompliantMethods ' we don't care if it derives from controller\n\n        <ValidateInput(False)> Public Function Foo(ByVal input As String) As ActionResult ' Noncompliant {{Make sure disabling ASP.NET Request Validation feature is safe here.}}\n'        ^^^^^^^^^^^^^^^^^^^^\n            Return Nothing\n        End Function\n\n        <CLSCompliant(False)>\n        <ValidateInput(False)> ' Noncompliant\n        Public Function WithTwoFalse(ByVal input As String) As ActionResult\n            Return Foo(input)\n        End Function\n\n        <HttpPost>\n        <ValidateInput(False)> ' Noncompliant\n        <Obsolete>\n        Public Function FooWithMoreAttributes(ByVal input As String) As ActionResult\n            Return Foo(input)\n        End Function\n\n        <ValidateInput(False)> ' Noncompliant\n        Public Function FooNoParam() As ActionResult\n            Return Nothing\n        End Function\n\n        <ValidateInput(False)> ' Noncompliant\n        Public Sub VoidFoo()\n        End Sub\n\n        <ValidateInput(False)> ' Noncompliant\n        Private Function ArrowFoo(ByVal i As String) As ActionResult\n            Return Nothing\n        End Function\n    End Class\n\n    Public Class CompliantController\n        Inherits Controller\n\n        <ValidateInput(True)>\n        Public Function Foo(ByVal input As String) As ActionResult\n            Return Foo(input)\n        End Function\n\n        Public Function Bar() As ActionResult\n            Return Nothing\n        End Function\n\n        <HttpPost>\n        Public Function Boo(ByVal input As AllowedHtml) As ActionResult\n            Return Nothing\n        End Function\n\n        <System.Web.Mvc.HttpPost>\n        <System.Web.Mvc.ValidateInput(True)>\n        Public Function Qix(ByVal input As String) As ActionResult\n            Return Foo(input)\n        End Function\n\n        Private Function Quix(ByVal i As String) As ActionResult\n            Return Nothing\n        End Function\n    End Class\n\n    <ValidateInput(True)>\n    Public Class CompliantController2\n    End Class\n\n    Public Class AllowedHtml\n        <AllowHtml>\n        Public Property Prop As String\n    End Class\n\n    <Obsolete>\n    Public Class MyObsoleteClass ' for coverage\n    End Class\n\n    <Obsolete(\"\", False)>\n    Public Class MyObsoleteClass2 ' for coverage\n    End Class\n\n    <CLSCompliant(False)>\n    Public Class ClassWithFalse ' for coverage\n    End Class\n\n    Public Class Errors\n        <ValidateInput(\"foo\")> ' Error [BC30934]\n        Public Function Foo(ByVal input As String) As ActionResult\n            Return Foo(input)\n        End Function\n\n        <ValidateInput()> ' Error [BC30455]\n        Public Function Bar(ByVal input As String) As ActionResult\n            Return Foo(input)\n        End Function\n\n        <ValidateInput(False, \"foo\")> ' Error [BC30057]\n        Public Function Baz(ByVal input As String) As ActionResult\n            Return Foo(input)\n        End Function\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/DoNotUseRandom.cs",
    "content": "﻿using System;\nusing System.Security.Cryptography;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        public void Main()\n        {\n            new Random(); // Noncompliant {{Make sure that using this pseudorandom number generator is safe here.}}\n//          ^^^^^^^^^^^^\n            new Random(1); // Noncompliant\n\n            new EventArgs(); // Compliant, not Random\n\n            RandomNumberGenerator.Create(); // Compliant, using cryptographically strong RNG\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/ExecutingSqlQueries.AzureCosmos.cs",
    "content": "using Microsoft.Azure.Cosmos;\n\nnamespace Tests.Diagnostics\n{\n    class AzureCosmosTest\n    {\n        private Container container = null;\n\n        public void GetItemQueryIterator_Compliant(string continuationToken)\n        {\n            // Compliant - constant query string\n            container.GetItemQueryIterator<MyType>(\"SELECT * FROM c\");\n            container.GetItemQueryIterator<MyType>(\"SELECT * FROM c\", continuationToken);\n            container.GetItemQueryIterator<MyType>(\"SELECT * FROM c\", continuationToken, null);\n        }\n\n        public void GetItemQueryIterator_Noncompliant(string userInput, string continuationToken)\n        {\n            container.GetItemQueryIterator<MyType>($\"SELECT * FROM c WHERE c.id = '{userInput}'\"); // Noncompliant\n            container.GetItemQueryIterator<MyType>($\"SELECT * FROM c WHERE c.id = '{userInput}'\", continuationToken); // Noncompliant\n            container.GetItemQueryIterator<MyType>($\"SELECT * FROM c WHERE c.id = '{userInput}'\", continuationToken, null); // Noncompliant\n\n            container.GetItemQueryIterator<MyType>(\"SELECT * FROM c WHERE c.id = '\" + userInput + \"'\"); // Noncompliant\n            container.GetItemQueryIterator<MyType>(\"SELECT * FROM c WHERE c.id = '\" + userInput + \"'\", continuationToken); // Noncompliant\n\n            container.GetItemQueryIterator<MyType>(string.Format(\"SELECT * FROM c WHERE c.id = '{0}'\", userInput)); // Noncompliant\n            container.GetItemQueryIterator<MyType>(string.Format(\"SELECT * FROM c WHERE c.id = '{0}'\", userInput), continuationToken); // Noncompliant\n\n            container.GetItemQueryIterator<MyType>(string.Concat(\"SELECT * FROM c WHERE c.id = '\", userInput, \"'\")); // Noncompliant\n        }\n\n        public void GetItemQueryIterator_VariableAssignment(string userInput, string continuationToken)\n        {\n            string query = $\"SELECT * FROM c WHERE c.id = '{userInput}'\"; // Secondary\n            container.GetItemQueryIterator<MyType>(query); // Noncompliant\n\n            // Compliant - variable assigned with constant\n            string constQuery = \"SELECT * FROM c\";\n            container.GetItemQueryIterator<MyType>(constQuery);\n        }\n\n        public void GetItemQueryStreamIterator_Compliant(string continuationToken)\n        {\n            // Compliant - constant query string\n            container.GetItemQueryStreamIterator(\"SELECT * FROM c\");\n            container.GetItemQueryStreamIterator(\"SELECT * FROM c\", continuationToken);\n            container.GetItemQueryStreamIterator(\"SELECT * FROM c\", continuationToken, null);\n        }\n\n        public void GetItemQueryStreamIterator_Noncompliant(string userInput, string continuationToken)\n        {\n            container.GetItemQueryStreamIterator($\"SELECT * FROM c WHERE c.id = '{userInput}'\"); // Noncompliant\n            container.GetItemQueryStreamIterator($\"SELECT * FROM c WHERE c.id = '{userInput}'\", continuationToken); // Noncompliant\n            container.GetItemQueryStreamIterator($\"SELECT * FROM c WHERE c.id = '{userInput}'\", continuationToken, null); // Noncompliant\n\n            container.GetItemQueryStreamIterator(\"SELECT * FROM c WHERE c.id = '\" + userInput + \"'\"); // Noncompliant\n            container.GetItemQueryStreamIterator(\"SELECT * FROM c WHERE c.id = '\" + userInput + \"'\", continuationToken); // Noncompliant\n\n            container.GetItemQueryStreamIterator(string.Format(\"SELECT * FROM c WHERE c.id = '{0}'\", userInput)); // Noncompliant\n            container.GetItemQueryStreamIterator(string.Format(\"SELECT * FROM c WHERE c.id = '{0}'\", userInput), continuationToken); // Noncompliant\n\n            container.GetItemQueryStreamIterator(string.Concat(\"SELECT * FROM c WHERE c.id = '\", userInput, \"'\")); // Noncompliant\n        }\n\n        public void GetItemQueryStreamIterator_VariableAssignment(string userInput, string continuationToken)\n        {\n            string query = $\"SELECT * FROM c WHERE c.id = '{userInput}'\"; // Secondary\n            container.GetItemQueryStreamIterator(query); // Noncompliant\n\n            // Compliant - variable assigned with constant\n            string constQuery = \"SELECT * FROM c\";\n            container.GetItemQueryStreamIterator(constQuery);\n        }\n\n        public void QueryDefinition_Compliant()\n        {\n            // Compliant - constant query string\n            new QueryDefinition(\"SELECT * FROM c\");\n        }\n\n        public void QueryDefinition_Noncompliant(string userInput)\n        {\n            new QueryDefinition($\"SELECT * FROM c WHERE c.id = '{userInput}'\"); // Noncompliant\n            new QueryDefinition(\"SELECT * FROM c WHERE c.id = '\" + userInput + \"'\"); // Noncompliant\n            new QueryDefinition(string.Format(\"SELECT * FROM c WHERE c.id = '{0}'\", userInput)); // Noncompliant\n            new QueryDefinition(string.Concat(\"SELECT * FROM c WHERE c.id = '\", userInput, \"'\")); // Noncompliant\n        }\n\n        public void QueryDefinition_VariableAssignment(string userInput)\n        {\n            string query = $\"SELECT * FROM c WHERE c.id = '{userInput}'\"; // Secondary\n            new QueryDefinition(query); // Noncompliant\n\n            // Compliant - variable assigned with constant\n            string constQuery = \"SELECT * FROM c\";\n            new QueryDefinition(constQuery);\n        }\n    }\n\n    class MyType\n    {\n        public string Id { get; set; }\n        public string Name { get; set; }\n    }\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/ExecutingSqlQueries.Dapper.cs",
    "content": "﻿using Dapper;\nusing System;\nusing System.Data;\nusing System.Threading.Tasks;\n\nnamespace Tests.Diagnostics\n{\n    class DapperTest\n    {\n        private IDbConnection con = null;\n\n        public void SqlMapper_Query(string query, string param)\n        {\n            con.Query(\"Select Name From Person Where Id=@Id\", new { Id = param}); // Compliant\n            con.Query(query + param);                                             // Noncompliant\n            con.Query(typeof(object), query + param);                             // Noncompliant\n            SqlMapper.Query(con, query + param);                                  // Noncompliant\n            SqlMapper.Query(con, typeof(object), query + param);                  // FN. The string argument is in the third position for this overload invoked in the unreduced form\n            con.Query(\"\", query + param);                                         // Compliant. The tracked strings are passed to the \"param\" object parameter\n            con.Query(query + param, new { Id = 1 });                             // Noncompliant\n            con.Query<DapperTest>(query + param, new { Id = 1 });                 // Noncompliant\n        }\n\n        public async Task SqlMapper_QueryAsync(string query, string param)\n        {\n            await con.QueryAsync(\"Select Name From Person Where Id=@Id\", new { Id = param }); // Compliant\n            await con.QueryAsync(query + param);                                              // Noncompliant\n            await con.QueryAsync(typeof(object), query + param);                              // Noncompliant\n            await SqlMapper.QueryAsync(con, query + param);                                   // Noncompliant\n            await SqlMapper.QueryAsync(con, typeof(object), query + param);                   // FN. The string argument is in the third position for this overload invoked in the unreduced form\n            await con.QueryAsync(\"\", query + param);                                          // Compliant. The tracked strings are passed to the \"param\" object parameter\n            await con.QueryAsync(query + param, new { Id = 1 });                              // Noncompliant\n            await con.QueryAsync<DapperTest>(query + param, new { Id = 1 });                  // Noncompliant\n        }\n\n        public void SqlMapper_QueryFirst(string query, string param)\n        {\n            con.QueryFirst(\"Select Name From Person Where Id=@Id\", new { Id = param }); // Compliant\n            con.QueryFirst(query + param);                                              // Noncompliant\n            con.QueryFirst(typeof(object), query + param);                              // Noncompliant\n            SqlMapper.QueryFirst(con, query + param);                                   // Noncompliant\n            SqlMapper.QueryFirst(con, typeof(object), query + param);                   // FN. The string argument is in the third position for this overload invoked in the unreduced form\n            con.QueryFirst(\"\", query + param);                                          // Compliant. The tracked strings are passed to the \"param\" object parameter\n            con.QueryFirst(query + param, new { Id = 1 });                              // Noncompliant\n            con.QueryFirst<DapperTest>(query + param, new { Id = 1 });                  // Noncompliant\n        }\n\n        public async Task SqlMapper_QueryFirstAsync(string query, string param)\n        {\n            await con.QueryFirstAsync(\"Select Name From Person Where Id=@Id\", new { Id = param }); // Compliant\n            await con.QueryFirstAsync(query + param);                                              // Noncompliant\n            await con.QueryFirstAsync(typeof(object), query + param);                              // Noncompliant\n            await SqlMapper.QueryFirstAsync(con, query + param);                                   // Noncompliant\n            await SqlMapper.QueryFirstAsync(con, typeof(object), query + param);                   // FN. The string argument is in the third position for this overload invoked in the unreduced form\n            await con.QueryFirstAsync(\"\", query + param);                                          // Compliant. The tracked strings are passed to the \"param\" object parameter\n            await con.QueryFirstAsync(query + param, new { Id = 1 });                              // Noncompliant\n            await con.QueryFirstAsync<DapperTest>(query + param, new { Id = 1 });                  // Noncompliant\n        }\n\n        public void SqlMapper_QueryFirstOrDefault(string query, string param)\n        {\n            con.QueryFirstOrDefault(\"Select Name From Person Where Id=@Id\", new { Id = param }); // Compliant\n            con.QueryFirstOrDefault(query + param);                                              // Noncompliant\n            con.QueryFirstOrDefault(typeof(object), query + param);                              // Noncompliant\n            SqlMapper.QueryFirstOrDefault(con, query + param);                                   // Noncompliant\n            SqlMapper.QueryFirstOrDefault(con, typeof(object), query + param);                   // FN. The string argument is in the third position for this overload invoked in the unreduced form\n            con.QueryFirstOrDefault(\"\", query + param);                                          // Compliant. The tracked strings are passed to the \"param\" object parameter\n            con.QueryFirstOrDefault(query + param, new { Id = 1 });                              // Noncompliant\n            con.QueryFirstOrDefault<DapperTest>(query + param, new { Id = 1 });                  // Noncompliant\n        }\n\n        public async Task SqlMapper_QueryFirstOrDefaultAsync(string query, string param)\n        {\n            await con.QueryFirstOrDefaultAsync(\"Select Name From Person Where Id=@Id\", new { Id = param }); // Compliant\n            await con.QueryFirstOrDefaultAsync(query + param);                                              // Noncompliant\n            await con.QueryFirstOrDefaultAsync(typeof(object), query + param);                              // Noncompliant\n            await SqlMapper.QueryFirstOrDefaultAsync(con, query + param);                                   // Noncompliant\n            await SqlMapper.QueryFirstOrDefaultAsync(con, typeof(object), query + param);                   // FN. The string argument is in the third position for this overload invoked in the unreduced form\n            await con.QueryFirstOrDefaultAsync(\"\", query + param);                                          // Compliant. The tracked strings are passed to the \"param\" object parameter\n            await con.QueryFirstOrDefaultAsync(query + param, new { Id = 1 });                              // Noncompliant\n            await con.QueryFirstOrDefaultAsync<DapperTest>(query + param, new { Id = 1 });                  // Noncompliant\n        }\n\n        public void SqlMapper_QuerySingle(string query, string param)\n        {\n            con.QuerySingle(\"Select Name From Person Where Id=@Id\", new { Id = param }); // Compliant\n            con.QuerySingle(query + param);                                              // Noncompliant\n            con.QuerySingle(typeof(object), query + param);                              // Noncompliant\n            SqlMapper.QuerySingle(con, query + param);                                   // Noncompliant\n            SqlMapper.QuerySingle(con, typeof(object), query + param);                   // FN. The string argument is in the third position for this overload invoked in the unreduced form\n            con.QuerySingle(\"\", query + param);                                          // Compliant. The tracked strings are passed to the \"param\" object parameter\n            con.QuerySingle(query + param, new { Id = 1 });                              // Noncompliant\n            con.QuerySingle<DapperTest>(query + param, new { Id = 1 });                  // Noncompliant\n        }\n\n        public async Task SqlMapper_QuerySingleAsync(string query, string param)\n        {\n            await con.QuerySingleAsync(\"Select Name From Person Where Id=@Id\", new { Id = param }); // Compliant\n            await con.QuerySingleAsync(query + param);                                              // Noncompliant\n            await con.QuerySingleAsync(typeof(object), query + param);                              // Noncompliant\n            await SqlMapper.QuerySingleAsync(con, query + param);                                   // Noncompliant\n            await SqlMapper.QuerySingleAsync(con, typeof(object), query + param);                   // FN. The string argument is in the third position for this overload invoked in the unreduced form\n            await con.QuerySingleAsync(\"\", query + param);                                          // Compliant. The tracked strings are passed to the \"param\" object parameter\n            await con.QuerySingleAsync(query + param, new { Id = 1 });                              // Noncompliant\n            await con.QuerySingleAsync<DapperTest>(query + param, new { Id = 1 });                  // Noncompliant\n        }\n\n        public void SqlMapper_QuerySingleOrDefault(string query, string param)\n        {\n            con.QuerySingleOrDefault(\"Select Name From Person Where Id=@Id\", new { Id = param }); // Compliant\n            con.QuerySingleOrDefault(query + param);                                              // Noncompliant\n            con.QuerySingleOrDefault(typeof(object), query + param);                              // Noncompliant\n            SqlMapper.QuerySingleOrDefault(con, query + param);                                   // Noncompliant\n            SqlMapper.QuerySingleOrDefault(con, typeof(object), query + param);                   // FN. The string argument is in the third position for this overload invoked in the unreduced form\n            con.QuerySingleOrDefault(\"\", query + param);                                          // Compliant. The tracked strings are passed to the \"param\" object parameter\n            con.QuerySingleOrDefault(query + param, new { Id = 1 });                              // Noncompliant\n            con.QuerySingleOrDefault<DapperTest>(query + param, new { Id = 1 });                  // Noncompliant\n        }\n\n        public async Task SqlMapper_QuerySingleOrDefaultAsync(string query, string param)\n        {\n            await con.QuerySingleOrDefaultAsync(\"Select Name From Person Where Id=@Id\", new { Id = param }); // Compliant\n            await con.QuerySingleOrDefaultAsync(query + param);                                              // Noncompliant\n            await con.QuerySingleOrDefaultAsync(typeof(object), query + param);                              // Noncompliant\n            await SqlMapper.QuerySingleOrDefaultAsync(con, query + param);                                   // Noncompliant\n            await SqlMapper.QuerySingleOrDefaultAsync(con, typeof(object), query + param);                   // FN. The string argument is in the third position for this overload invoked in the unreduced form\n            await con.QuerySingleOrDefaultAsync(\"\", query + param);                                          // Compliant. The tracked strings are passed to the \"param\" object parameter\n            await con.QuerySingleOrDefaultAsync(query + param, new { Id = 1 });                              // Noncompliant\n            await con.QuerySingleOrDefaultAsync<DapperTest>(query + param, new { Id = 1 });                  // Noncompliant\n        }\n\n        public void SqlMapper_QueryMultiple(string query, string param)\n        {\n            con.QueryMultiple(\"Select Name From Person Where Id=@Id\", new { Id = param }); // Compliant\n            con.QueryMultiple(query + param);                                              // Noncompliant\n            SqlMapper.QueryMultiple(con, query + param);                                   // Noncompliant\n            con.QueryMultiple(\"\", query + param);                                          // Compliant. The tracked strings are passed to the \"param\" object parameter\n            con.QueryMultiple(query + param, new { Id = 1 });                              // Noncompliant\n        }\n\n        public async Task SqlMapper_QueryMultipleAsync(string query, string param)\n        {\n            await con.QueryMultipleAsync(\"Select Name From Person Where Id=@Id\", new { Id = param }); // Compliant\n            await con.QueryMultipleAsync(query + param);                                              // Noncompliant\n            await SqlMapper.QueryMultipleAsync(con, query + param);                                   // Noncompliant\n            await con.QueryMultipleAsync(\"\", query + param);                                          // Compliant. The tracked strings are passed to the \"param\" object parameter\n            await con.QueryMultipleAsync(query + param, new { Id = 1 });                              // Noncompliant\n        }\n\n        public void SqlMapper_Execute(string query, string param)\n        {\n            con.Execute(\"Insert Into Person Values (Id=@Id)\", new { Id = param }); // Compliant\n            con.Execute(query + param);                                            // Noncompliant\n            con.Execute(\"\", query + param);                                        // Compliant. The tracked strings are passed to the \"param\" object parameter\n            con.Execute(query + param, new { Id = 1 });                            // Noncompliant\n            SqlMapper.Execute(con, query + param);                                 // Noncompliant\n        }\n\n        public async Task SqlMapper_ExecuteAsync(string query, string param)\n        {\n            await con.ExecuteAsync(\"Insert Into Person Values (Id=@Id)\", new { Id = param }); // Compliant\n            await con.ExecuteAsync(query + param);                                            // Noncompliant\n            await con.ExecuteAsync(\"\", query + param);                                        // Compliant. The tracked strings are passed to the \"param\" object parameter\n            await con.ExecuteAsync(query + param, new { Id = 1 });                            // Noncompliant\n            await SqlMapper.ExecuteAsync(con, query + param);                                 // Noncompliant\n        }\n\n        public void SqlMapper_ExecuteReader(string query, string param)\n        {\n            con.ExecuteReader(\"Insert Into Person Values (Id=@Id)\", new { Id = param }); // Compliant\n            con.ExecuteReader(query + param);                                            // Noncompliant\n            con.ExecuteReader(\"\", query + param);                                        // Compliant. The tracked strings are passed to the \"param\" object parameter\n            con.ExecuteReader(query + param, new { Id = 1 });                            // Noncompliant\n            SqlMapper.ExecuteReader(con, query + param);                                 // Noncompliant\n        }\n\n        public async Task SqlMapper_ExecuteReaderAsync(string query, string param)\n        {\n            await con.ExecuteReaderAsync(\"Insert Into Person Values (Id=@Id)\", new { Id = param }); // Compliant\n            await con.ExecuteReaderAsync(query + param);                                            // Noncompliant\n            await con.ExecuteReaderAsync(\"\", query + param);                                        // Compliant. The tracked strings are passed to the \"param\" object parameter\n            await con.ExecuteReaderAsync(query + param, new { Id = 1 });                            // Noncompliant\n            await SqlMapper.ExecuteReaderAsync(con, query + param);                                 // Noncompliant\n        }\n\n        public void SqlMapper_ExecuteScalar(string query, string param)\n        {\n            con.ExecuteScalar(\"Insert Into Person Values (Id=@Id)\", new { Id = param }); // Compliant\n            con.ExecuteScalar(query + param);                                            // Noncompliant\n            con.ExecuteScalar(\"\", query + param);                                        // Compliant. The tracked strings are passed to the \"param\" object parameter\n            con.ExecuteScalar(query + param, new { Id = 1 });                            // Noncompliant\n            con.ExecuteScalar<DapperTest>(query + param);                                // Noncompliant\n            SqlMapper.ExecuteScalar(con, query + param);                                 // Noncompliant\n        }\n\n        public async Task SqlMapper_ExecuteScalarAsync(string query, string param)\n        {\n            await con.ExecuteScalarAsync(\"Insert Into Person Values (Id=@Id)\", new { Id = param }); // Compliant\n            await con.ExecuteScalarAsync(query + param);                                            // Noncompliant\n            await con.ExecuteScalarAsync(\"\", query + param);                                        // Compliant. The tracked strings are passed to the \"param\" object parameter\n            await con.ExecuteScalarAsync(query + param, new { Id = 1 });                            // Noncompliant\n            await con.ExecuteScalarAsync<DapperTest>(query + param);                                // Noncompliant\n            await SqlMapper.ExecuteScalarAsync(con, query + param);                                 // Noncompliant\n        }\n\n        public void CommandDefinition_Constructor(string query, string param)\n        {\n            new CommandDefinition(\"Insert Into Person Values (Id=@Id)\", new { Id = param }); // Compliant\n            new CommandDefinition(query + param);                                            // Noncompliant\n            new CommandDefinition(query + param, new { Id = 1 });                            // Noncompliant\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/9602\n    class Repro_9602\n    {\n        public void ConstantQuery(IDbConnection dbConnection, bool onlyEnabled)\n        {\n            string query = \"SELECT id FROM users\";\n            if(onlyEnabled)\n                query += \" WHERE enabled = 1\";\n            string query2 = $\"SELECT id FROM users {(onlyEnabled ? \"WHERE enabled = 1\" : \"\")}\"; // Secondary - FP\n\n            dbConnection.Query<int>(query); // Compliant\n            dbConnection.Query<int>(query2); // Noncompliant - FP\n            dbConnection.Query<int>($\"SELECT id FROM users {(onlyEnabled ? \"WHERE enabled = 1\" : \"\")}\"); // Noncompliant - FP\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/ExecutingSqlQueries.EF6.cs",
    "content": "﻿using System;\nusing System.Data.Entity;\nusing System.Linq;\nusing System.Threading.Tasks;\n\nclass Program\n{\n    public async Task DatabaseMethods(Database database, string query, int x)\n    {\n        database.SqlQuery<Program>(query);     // Compliant\n        database.SqlQuery<Program>(query + x); // Noncompliant {{Make sure using a dynamically formatted SQL query is safe here.}}\n        database.SqlQuery(typeof(Program), query + x);                                             // Noncompliant\n        database.SqlQuery<Program>($\"{query} {x}\");                                                // Noncompliant\n        database.SqlQuery<Program>(string.Format(\"Select * from Program Where Id={1}\", x));        // Noncompliant\n\n        database.ExecuteSqlCommand(query);                                                         // Compliant\n        database.ExecuteSqlCommand(query + x);                                                     // Noncompliant\n        database.ExecuteSqlCommand(TransactionalBehavior.EnsureTransaction, query + x);            // Noncompliant\n        await database.ExecuteSqlCommandAsync(query);                                              // Compliant\n        await database.ExecuteSqlCommandAsync(query + x);                                          // Noncompliant\n        await database.ExecuteSqlCommandAsync(TransactionalBehavior.EnsureTransaction, query + x); // Noncompliant\n    }\n\n    public void DbSetMethods(DbSet set, string query, int x, int param)\n    {\n        set.SqlQuery(query);            // Compliant\n        set.SqlQuery(query + x);        // Noncompliant {{Make sure using a dynamically formatted SQL query is safe here.}}\n        set.SqlQuery(query, param);     // Compliant\n        set.SqlQuery(query + x, param); // Noncompliant\n    }\n\n    public void DbSetMethods(DbSet<Program> set, string query, int x, int param)\n    {\n        set.SqlQuery(query);            // Compliant\n        set.SqlQuery(query + x);        // Noncompliant {{Make sure using a dynamically formatted SQL query is safe here.}}\n        set.SqlQuery(query, param);     // Compliant\n        set.SqlQuery(query + x, param); // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/ExecutingSqlQueries.EntityFrameworkCore2.cs",
    "content": "﻿using System;\nusing System.Linq;\nusing Microsoft.EntityFrameworkCore;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        private const string ConstQuery = \"\";\n\n        public void Foo(DbContext context, string query, int x, Guid guid, params object[] parameters)\n        {\n            context.Database.ExecuteSqlCommand($\"\"); // Compliant, FormattableString is sanitized\n            context.Database.ExecuteSqlCommand(\"\"); // Compliant, constants are safe\n            context.Database.ExecuteSqlCommand(ConstQuery); // Compliant, constants are safe\n            context.Database.ExecuteSqlCommand(\"\" + \"\"); // Compliant, constants are safe\n            context.Database.ExecuteSqlCommand(query); // Compliant, not concat or format\n            context.Database.ExecuteSqlCommand(\"\" + query); // Noncompliant\n            context.Database.ExecuteSqlCommand($\"\", parameters); // Compliant. Was FP until Roslyn 3.11.0. Interpolated string with argument tranformed in RawQuery\n            context.Database.ExecuteSqlCommand(query, parameters); // Compliant, not concat or format\n            context.Database.ExecuteSqlCommand(\"\" + query, parameters); // Noncompliant\n\n            context.Database.ExecuteSqlCommand($\"SELECT * FROM mytable WHERE mycol={query} AND mycol2={0}\", parameters[0]); // Noncompliant, string interpolation  it is RawSqlString\n            context.Database.ExecuteSqlCommand($\"SELECT * FROM mytable WHERE mycol={query}{query}\", x, guid); // Noncompliant, RawSqlQuery\n            context.Database.ExecuteSqlCommand($@\"SELECT * FROM mytable WHERE mycol={query}{query}\", x, guid); // Noncompliant, RawSqlQuery\n            context.Database.ExecuteSqlCommand($\"SELECT * FROM mytable WHERE mycol={query}\"); // Compliant, FormattableString is sanitized\n\n            RelationalDatabaseFacadeExtensions.ExecuteSqlCommand(context.Database, query); // Compliant\n            RelationalDatabaseFacadeExtensions.ExecuteSqlCommand(context.Database, $\"SELECT * FROM mytable WHERE mycol={query}{query}\", x, guid); // Noncompliant\n\n            context.Database.ExecuteSqlCommandAsync($\"\"); // Compliant, FormattableString is sanitized\n            context.Database.ExecuteSqlCommandAsync(\"\"); // Compliant, constants are safe\n            context.Database.ExecuteSqlCommandAsync(ConstQuery); // Compliant, constants are safe\n            context.Database.ExecuteSqlCommandAsync(\"\" + \"\"); // Compliant, constants are safe\n            context.Database.ExecuteSqlCommandAsync(query); // Compliant, not concat\n            context.Database.ExecuteSqlCommandAsync(\"\" + query); // Noncompliant\n            context.Database.ExecuteSqlCommandAsync(query + \"\"); // Noncompliant\n            context.Database.ExecuteSqlCommandAsync(\"\" + query + \"\"); // Noncompliant\n            context.Database.ExecuteSqlCommandAsync($\"\", parameters); // Compliant. Was FP until Roslyn 3.11.0. Interpolated string with argument tranformed in RawQuery\n            context.Database.ExecuteSqlCommandAsync(query, parameters); // Compliant, not concat or format\n            context.Database.ExecuteSqlCommandAsync(\"\" + query, parameters); // Noncompliant\n            RelationalDatabaseFacadeExtensions.ExecuteSqlCommandAsync(context.Database, \"\" + query, parameters);  // Noncompliant\n\n            context.Query<User>().FromSql($\"\"); // Compliant, FormattableString is sanitized\n            context.Query<User>().FromSql(\"\"); // Compliant, constants are safe\n            context.Query<User>().FromSql(ConstQuery); // Compliant, constants are safe\n            context.Query<User>().FromSql(query); // Compliant, not concat/format\n            context.Query<User>().FromSql(\"\" + \"\"); // Compliant\n            context.Query<User>().FromSql($\"\", parameters); // Compliant. Was FP until Roslyn 3.11.0. Interpolated string with argument tranformed in RawQuery\n            context.Query<User>().FromSql(\"\", parameters); // Compliant, the parameters are sanitized\n            context.Query<User>().FromSql(query, parameters); // Compliant\n            context.Query<User>().FromSql(\"\" + query, parameters); // Noncompliant\n            RelationalQueryableExtensions.FromSql(context.Query<User>(), \"\" + query, parameters); // Noncompliant\n        }\n\n        public void ConcatAndFormat(DbContext context, string query, params object[] parameters)\n        {\n            var concatenated = string.Concat(query, parameters);                                    // Secondary [1,2,3]\n            var formatted = string.Format(\"INSERT INTO Users (name) VALUES (\\\"{0}\\\")\", parameters); // Secondary [4,5,6]\n            var interpolated = $\"SELECT * FROM mytable WHERE mycol={parameters[0]}\";                // Secondary [7,8,9]\n\n            context.Database.ExecuteSqlCommand(string.Concat(query, parameters)); // Noncompliant\n            context.Database.ExecuteSqlCommand(string.Format(query, parameters)); // Noncompliant\n            context.Database.ExecuteSqlCommand(string.Format(\"INSERT INTO Users (name) VALUES (\\\"{0}\\\")\", parameters)); // Noncompliant\n            context.Database.ExecuteSqlCommand($\"SELECT * FROM mytable WHERE mycol={parameters[0]}\"); // Compliant, the FormattableString is transformed into a parametrized query.\n            context.Database.ExecuteSqlCommand(\"SELECT * FROM mytable WHERE mycol=\" + parameters[0]); // Noncompliant\n            context.Database.ExecuteSqlCommand(formatted);    // Noncompliant [4]\n            context.Database.ExecuteSqlCommand(concatenated); // Noncompliant [1]\n            context.Database.ExecuteSqlCommand(interpolated); // Noncompliant [7]\n\n            context.Database.ExecuteSqlCommandAsync(string.Concat(query, parameters)); // Noncompliant\n            context.Database.ExecuteSqlCommandAsync(string.Format(query, parameters)); // Noncompliant\n            context.Database.ExecuteSqlCommandAsync(string.Format(\"INSERT INTO Users (name) VALUES (\\\"{0}\\\")\", parameters)); // Noncompliant\n            context.Database.ExecuteSqlCommandAsync($\"SELECT * FROM mytable WHERE mycol={parameters[0]}\"); // Compliant, the FormattableString is transformed into a parametrized query.\n            context.Database.ExecuteSqlCommandAsync(\"SELECT * FROM mytable WHERE mycol=\" + parameters[0]); // Noncompliant\n            context.Database.ExecuteSqlCommandAsync(formatted);    // Noncompliant [5]\n            context.Database.ExecuteSqlCommandAsync(concatenated); // Noncompliant [2]\n            context.Database.ExecuteSqlCommandAsync(interpolated); // Noncompliant [8]\n\n            context.Query<User>().FromSql(string.Concat(query, parameters)); // Noncompliant\n            context.Query<User>().FromSql(string.Format(\"INSERT INTO Users (name) VALUES (\\\"{0}\\\")\", parameters)); // Noncompliant\n            context.Query<User>().FromSql($\"SELECT * FROM mytable WHERE mycol={parameters[0]}\"); // Compliant, the FormattableString is transformed into a parametrized query.\n            context.Query<User>().FromSql(\"SELECT * FROM mytable WHERE mycol=\" + parameters[0]); // Noncompliant\n            context.Query<User>().FromSql(formatted);    // Noncompliant [6]\n            context.Query<User>().FromSql(concatenated); // Noncompliant [3]\n            context.Query<User>().FromSql(interpolated); // Noncompliant [9]\n        }\n\n        public void Foo(BloggingContext context, string query)\n        {\n            var b = context.Blogs.FromSql($\"{query}\"); // Compliant: interpolated strings are safe in EF (https://learn.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.relationalqueryableextensions.fromsql?view=efcore-2.0#microsoft-entityframeworkcore-relationalqueryableextensions-fromsql-1(system-linq-iqueryable((-0))-system-formattablestring))\n        }\n    }\n\n    class User\n    {\n        string Id { get; set; }\n        string Name { get; set; }\n    }\n\n    public class BloggingContext : DbContext\n    {\n        public DbSet<Blog> Blogs { get; set; }\n    }\n\n    public class Blog\n    {\n        public string Url { get; set; }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/9602\n    class Repro_9602\n    {\n        public void ConstantQuery(DbContext context, bool onlyEnabled)\n        {\n            string query = \"SELECT id FROM users\";\n            if(onlyEnabled)\n                query += \" WHERE enabled = 1\";\n            string query2 = $\"SELECT id FROM users {(onlyEnabled ? \"WHERE enabled = 1\" : \"\")}\"; // Secondary [c1, c2, c3]\n\n            context.Database.ExecuteSqlCommand(query); // Compliant\n            context.Database.ExecuteSqlCommand(query2); // Noncompliant [c1] - FP\n            context.Database.ExecuteSqlCommand($\"SELECT id FROM users {(onlyEnabled ? \"WHERE enabled = 1\" : \"\")}\"); // Compliant\n\n            context.Database.ExecuteSqlCommandAsync(query); // Compliant\n            context.Database.ExecuteSqlCommandAsync(query2); // Noncompliant [c2] - FP\n            context.Database.ExecuteSqlCommandAsync($\"SELECT id FROM users {(onlyEnabled ? \"WHERE enabled = 1\" : \"\")}\"); // Compliant\n\n            context.Query<User>().FromSql(query); // Compliant\n            context.Query<User>().FromSql(query2); // Noncompliant [c3] - FP\n            context.Query<User>().FromSql($\"SELECT id FROM users {(onlyEnabled ? \"WHERE enabled = 1\" : \"\")}\"); // Compliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/ExecutingSqlQueries.EntityFrameworkCore2.vb",
    "content": "﻿Imports System\nImports System.Linq\nImports Microsoft.EntityFrameworkCore\n\nNamespace Tests.Diagnostics\n    Class Program\n        Private Const ConstQuery As String = \"\"\n\n        Public Sub Foo(ByVal context As DbContext, ByVal query As String, ByVal x As Int32, ParamArray parameters As Object())\n            context.Database.ExecuteSqlCommand($\"\") ' Compliant, FormattableString is sanitized\n            context.Database.ExecuteSqlCommand(\"\") ' Compliant, constants are safe\n            context.Database.ExecuteSqlCommand(ConstQuery) ' Compliant, constants are safe\n            context.Database.ExecuteSqlCommand(\"\" & \"\") ' Compliant, constants are safe\n            context.Database.ExecuteSqlCommand(\"\" + \"\") ' Compliant, constants are safe\n            context.Database.ExecuteSqlCommand(query) ' Compliant, not concat or format\n            context.Database.ExecuteSqlCommand(\"\" & query) ' Noncompliant\n            context.Database.ExecuteSqlCommand(\"\" + query) ' Noncompliant\n            context.Database.ExecuteSqlCommand($\"\", parameters) ' Noncompliant, interpolated string with argument transformed in RawQuery\n            context.Database.ExecuteSqlCommand(query, parameters) ' Compliant, not concat or format\n            context.Database.ExecuteSqlCommand(\"\" & query, parameters) ' Noncompliant\n            context.Database.ExecuteSqlCommand(\"\" + query, parameters) ' Noncompliant\n\n            context.Database.ExecuteSqlCommand($\"SELECT * FROM mytable WHERE mycol={query}\", parameters(0)) ' Noncompliant, the FormattableString is evaluated and converted to RawSqlString\n            context.Database.ExecuteSqlCommand($\"SELECT * FROM mytable WHERE mycol={query}\", x) ' Noncompliant\n            context.Database.ExecuteSqlCommand($\"SELECT * FROM mytable WHERE mycol={query}\") ' Compliant, FormattableString is sanitized\n\n            RelationalDatabaseFacadeExtensions.ExecuteSqlCommand(context.Database, query) ' Compliant\n            RelationalDatabaseFacadeExtensions.ExecuteSqlCommand(context.Database, $\"SELECT * FROM mytable WHERE mycol={query} AND col2={0}\", x) ' Noncompliant\n\n            context.Database.ExecuteSqlCommandAsync($\"\") ' Compliant, FormattableString is sanitized\n            context.Database.ExecuteSqlCommandAsync(\"\") ' Compliant, constants are safe\n            context.Database.ExecuteSqlCommandAsync(ConstQuery) ' Compliant, constants are safe\n            context.Database.ExecuteSqlCommandAsync(\"\" & \"\") ' Compliant, constants are safe\n            context.Database.ExecuteSqlCommandAsync(\"\" + \"\") ' Compliant, constants are safe\n            context.Database.ExecuteSqlCommandAsync(\"\" + \"\" & \"\") ' Compliant, constants are safe\n            context.Database.ExecuteSqlCommandAsync(\"\" & \"\" + \"\") ' Compliant, constants are safe\n            context.Database.ExecuteSqlCommandAsync(query) ' Compliant, not concat or format\n            context.Database.ExecuteSqlCommandAsync(\"\" & query) ' Noncompliant\n            context.Database.ExecuteSqlCommandAsync(\"\" + query) ' Noncompliant\n            context.Database.ExecuteSqlCommandAsync($\"\", parameters) ' Noncompliant, interpolated string with argument transformed in RawQuery\n            context.Database.ExecuteSqlCommandAsync(query, parameters) ' Compliant, not concat or format\n            context.Database.ExecuteSqlCommandAsync(\"\" & query, parameters) ' Noncompliant\n            context.Database.ExecuteSqlCommandAsync(\"\" + query, parameters) ' Noncompliant\n            context.Database.ExecuteSqlCommandAsync(query + \"\", parameters) ' Noncompliant\n            context.Database.ExecuteSqlCommandAsync(query & \"\", parameters) ' Noncompliant\n            context.Database.ExecuteSqlCommandAsync(\"\" & query + \"\", parameters) ' Noncompliant\n            context.Database.ExecuteSqlCommandAsync(\"\" + query & \"\", parameters) ' Noncompliant\n            context.Database.ExecuteSqlCommandAsync($\"SELECT * FROM mytable WHERE mycol={query}\") ' Compliant, FormattableString is sanitized\n            context.Database.ExecuteSqlCommandAsync($\"SELECT * FROM mytable WHERE mycol={query}\", x) ' Noncompliant\n            RelationalDatabaseFacadeExtensions.ExecuteSqlCommandAsync(context.Database, \"\" & query, parameters) ' Noncompliant\n            RelationalDatabaseFacadeExtensions.ExecuteSqlCommandAsync(context.Database, \"\" + query, parameters) ' Noncompliant\n\n            context.Query(Of User)().FromSql($\"\") ' Compliant, FormattableString is sanitized\n            context.Query(Of User)().FromSql(\"\") ' Compliant, constants are safe\n            context.Query(Of User)().FromSql(ConstQuery) ' Compliant, constants are safe\n            context.Query(Of User)().FromSql(query) ' Compliant, not concat or format\n            context.Query(Of User)().FromSql(\"\" & \"\") ' Compliant, constants are safe\n            context.Query(Of User)().FromSql(\"\" + \"\") ' Compliant, constants are safe\n            context.Query(Of User)().FromSql($\"\", parameters) ' Noncompliant, interpolated string with argument transformed in RawQuery\n            context.Query(Of User)().FromSql(\"\", parameters) ' Compliant, the parameters are sanitized\n            context.Query(Of User)().FromSql(query, parameters) ' Compliant, not concat or format\n            context.Query(Of User)().FromSql(\"\" & query, parameters) ' Noncompliant\n            context.Query(Of User)().FromSql(\"\" + query, parameters) ' Noncompliant\n            context.Query(Of User)().FromSql($\"SELECT * FROM mytable WHERE mycol={query}\") ' Compliant, FormattableString is sanitized\n            context.Query(Of User)().FromSql($\"SELECT * FROM mytable WHERE mycol={query}\", x) ' Noncompliant\n            RelationalQueryableExtensions.FromSql(context.Query(Of User)(), \"\" & query, parameters) ' Noncompliant\n            RelationalQueryableExtensions.FromSql(context.Query(Of User)(), \"\" + query, parameters) ' Noncompliant\n\n        End Sub\n\n        Public Sub ConcatAndFormat(ByVal context As DbContext, ByVal query As String, ParamArray parameters As Object())\n            Dim formatted = String.Format(\"INSERT INTO Users (name) VALUES (\"\"{0}\"\")\", parameters) ' Secondary [1,2,3]\n            Dim concatenated = String.Concat(query, parameters)                                    ' Secondary [4,5,6]\n            Dim interpolated = $\"SELECT * FROM mytable WHERE mycol={query}\"                        ' Secondary [7,8,9]\n\n            context.Database.ExecuteSqlCommand(String.Concat(query, parameters)) ' Noncompliant\n            context.Database.ExecuteSqlCommand(String.Format(query, parameters)) ' Noncompliant\n            context.Database.ExecuteSqlCommand(String.Format(\"INSERT INTO Users (name) VALUES (\"\"{0}\"\")\", parameters)) ' Noncompliant\n            context.Database.ExecuteSqlCommand($\"SELECT * FROM mytable WHERE mycol={parameters(0)}\") ' Compliant, is sanitized\n            context.Database.ExecuteSqlCommand(formatted)    ' Noncompliant [1]\n            context.Database.ExecuteSqlCommand(concatenated) ' Noncompliant [4]\n            context.Database.ExecuteSqlCommand(interpolated) ' Noncompliant [7]\n\n            context.Database.ExecuteSqlCommandAsync(String.Concat(query, parameters)) ' Noncompliant\n            context.Database.ExecuteSqlCommandAsync(String.Format(query, parameters)) ' Noncompliant\n            context.Database.ExecuteSqlCommandAsync(String.Format(\"INSERT INTO Users (name) VALUES (\"\"{0}\"\")\", parameters)) ' Noncompliant\n            context.Database.ExecuteSqlCommandAsync(formatted)    ' Noncompliant [2]\n            context.Database.ExecuteSqlCommandAsync(concatenated) ' Noncompliant [5]\n            context.Database.ExecuteSqlCommandAsync(interpolated) ' Noncompliant [8]\n\n            context.Query(Of User)().FromSql(String.Concat(query, parameters)) ' Noncompliant\n            context.Query(Of User)().FromSql(String.Format(\"INSERT INTO Users (name) VALUES (\"\"{0}\"\")\", parameters)) ' Noncompliant\n            context.Query(Of User)().FromSql(formatted)    ' Noncompliant [3]\n            context.Query(Of User)().FromSql(concatenated) ' Noncompliant [6]\n            context.Query(Of User)().FromSql(interpolated) ' Noncompliant [9]\n        End Sub\n\n    End Class\n\n    ' https://github.com/SonarSource/sonar-dotnet/issues/9602\n    Class Repro_9602\n        Public Sub ConstantQuery(context As DbContext, onlyEnabled As Boolean)\n            Dim query As String = \"SELECT id FROM users\"\n            If onlyEnabled Then\n                query += \" WHERE enabled = 1\"\n            End If\n            Dim query2 As String = $\"SELECT id FROM users {(If(onlyEnabled, \"WHERE enabled = 1\", \"\"))}\" ' Secondary [c1,c2,c3]\n\n            context.Database.ExecuteSqlCommand(query) ' Compliant\n            context.Database.ExecuteSqlCommand(query2) ' Noncompliant [c1] - FP\n            context.Database.ExecuteSqlCommand($\"SELECT id FROM users {(If(onlyEnabled, \"WHERE enabled = 1\", \"\"))}\") ' Compliant\n\n            context.Database.ExecuteSqlCommandAsync(query) ' Compliant\n            context.Database.ExecuteSqlCommandAsync(query2) ' Noncompliant [c2] - FP\n            context.Database.ExecuteSqlCommandAsync($\"SELECT id FROM users {(If(onlyEnabled, \"WHERE enabled = 1\", \"\"))}\") ' Compliant\n\n            context.Query(Of User)().FromSql(query) ' Compliant\n            context.Query(Of User)().FromSql(query2) ' Noncompliant [c3] - FP\n            context.Query(Of User)().FromSql($\"SELECT id FROM users {(If(onlyEnabled, \"WHERE enabled = 1\", \"\"))}\") ' Compliant\n        End Sub\n    End Class\n\n    Class User\n        Private Property Id As String\n        Private Property Name As String\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/ExecutingSqlQueries.EntityFrameworkCoreLatest.cs",
    "content": "﻿using System;\nusing Microsoft.EntityFrameworkCore;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        private const string ConstQuery = \"\";\n\n        public void Foo(DbContext context, string query, int x, Guid guid, params object[] parameters)\n        {\n            context.Database.ExecuteSqlRaw($\"\"); // Compliant\n            context.Database.ExecuteSqlRaw(\"\"); // Compliant, constants are safe\n            context.Database.ExecuteSqlRaw(ConstQuery); // Compliant, constants are safe\n            context.Database.ExecuteSqlRaw(\"\" + \"\"); // Compliant, constants are safe\n            context.Database.ExecuteSqlRaw(query); // Compliant, not concat or format\n            context.Database.ExecuteSqlRaw(\"\" + query); // Noncompliant\n            context.Database.ExecuteSqlRaw($\"\", parameters); // Compliant\n            context.Database.ExecuteSqlRaw(query, parameters); // Compliant, not concat or format\n\n            context.Database.ExecuteSqlRaw(\"\" + query, parameters); // Noncompliant\n            context.Database.ExecuteSqlRaw($\"SELECT * FROM mytable WHERE mycol={query} AND mycol2={0}\", parameters[0]); // Noncompliant\n            context.Database.ExecuteSqlRaw($\"SELECT * FROM mytable WHERE mycol={query}{query}\", x, guid); // Noncompliant\n            context.Database.ExecuteSqlRaw($@\"SELECT * FROM mytable WHERE mycol={query}{query}\", x, guid); // Noncompliant\n            context.Database.ExecuteSqlRaw($\"SELECT * FROM mytable WHERE mycol={query}\"); // Noncompliant\n\n            RelationalDatabaseFacadeExtensions.ExecuteSqlRaw(context.Database, query); // Compliant\n            RelationalDatabaseFacadeExtensions.ExecuteSqlRaw(context.Database, $\"SELECT * FROM mytable WHERE mycol={query}{query}\", x, guid); // Noncompliant\n\n            context.Database.ExecuteSqlRawAsync($\"\"); // Compliant, constants are safe\n            context.Database.ExecuteSqlRawAsync(\"\"); // Compliant, constants are safe\n            context.Database.ExecuteSqlRawAsync(ConstQuery); // Compliant, constants are safe\n            context.Database.ExecuteSqlRawAsync(\"\" + \"\"); // Compliant, constants are safe\n            context.Database.ExecuteSqlRawAsync(query); // Compliant, not concat\n            context.Database.ExecuteSqlRawAsync(\"\" + query); // Noncompliant\n            context.Database.ExecuteSqlRawAsync(query + \"\"); // Noncompliant\n            context.Database.ExecuteSqlRawAsync(\"\" + query + \"\"); // Noncompliant\n            context.Database.ExecuteSqlRawAsync($\"\", parameters); // Compliant\n            context.Database.ExecuteSqlRawAsync(query, parameters); // Compliant, not concat or format\n\n            context.Database.ExecuteSqlRawAsync(\"\" + query, parameters); // Noncompliant\n            RelationalDatabaseFacadeExtensions.ExecuteSqlRawAsync(context.Database, \"\" + query, parameters);  // Noncompliant\n\n            context.Set<User>().FromSqlRaw($\"\"); // Compliant\n            context.Set<User>().FromSqlRaw(\"\"); // Compliant, constants are safe\n            context.Set<User>().FromSqlRaw(ConstQuery); // Compliant, constants are safe\n            context.Set<User>().FromSqlRaw(query); // Compliant, not concat/format\n            context.Set<User>().FromSqlRaw(\"\" + \"\"); // Compliant\n            context.Set<User>().FromSqlRaw($\"\", parameters); // Compliant\n            context.Set<User>().FromSqlRaw(\"\", parameters); // Compliant, the parameters are sanitized\n            context.Set<User>().FromSqlRaw(query, parameters); // Compliant\n            context.Set<User>().FromSqlRaw(\"\" + query, parameters); // Noncompliant\n            RelationalQueryableExtensions.FromSqlRaw(context.Set<User>(), \"\" + query, parameters); // Noncompliant\n        }\n\n        public void ConcatAndFormat(DbContext context, string query, params object[] parameters)\n        {\n            var concatenated = string.Concat(query, parameters);                                    // Secondary [1,2,3]\n            var formatted = string.Format(\"INSERT INTO Users (name) VALUES (\\\"{0}\\\")\", parameters); // Secondary [4,5,6]\n            var interpolated = $\"SELECT * FROM mytable WHERE mycol={parameters[0]}\";                // Secondary [7,8,9]\n\n            context.Database.ExecuteSqlRaw(string.Concat(query, parameters)); // Noncompliant\n            context.Database.ExecuteSqlRaw(string.Format(query, parameters)); // Noncompliant\n            context.Database.ExecuteSqlRaw(string.Format(\"INSERT INTO Users (name) VALUES (\\\"{0}\\\")\", parameters)); // Noncompliant\n            context.Database.ExecuteSqlRaw($\"SELECT * FROM mytable WHERE mycol={parameters[0]}\"); // Noncompliant\n            context.Database.ExecuteSqlRaw(\"SELECT * FROM mytable WHERE mycol=\" + parameters[0]); // Noncompliant\n            context.Database.ExecuteSqlRaw(formatted);    // Noncompliant [4]\n            context.Database.ExecuteSqlRaw(concatenated); // Noncompliant [1]\n            context.Database.ExecuteSqlRaw(interpolated); // Noncompliant [7]\n\n            context.Database.ExecuteSqlRawAsync(string.Concat(query, parameters)); // Noncompliant\n            context.Database.ExecuteSqlRawAsync(string.Format(query, parameters)); // Noncompliant\n            context.Database.ExecuteSqlRawAsync(string.Format(\"INSERT INTO Users (name) VALUES (\\\"{0}\\\")\", parameters)); // Noncompliant\n            context.Database.ExecuteSqlRawAsync($\"SELECT * FROM mytable WHERE mycol={parameters[0]}\"); // Noncompliant\n            context.Database.ExecuteSqlRawAsync(\"SELECT * FROM mytable WHERE mycol=\" + parameters[0]); // Noncompliant\n            context.Database.ExecuteSqlRawAsync(formatted);    // Noncompliant [5]\n            context.Database.ExecuteSqlRawAsync(concatenated); // Noncompliant [2]\n            context.Database.ExecuteSqlRawAsync(interpolated); // Noncompliant [8]\n\n            context.Set<User>().FromSqlRaw(string.Concat(query, parameters)); // Noncompliant\n            context.Set<User>().FromSqlRaw(string.Format(\"INSERT INTO Users (name) VALUES (\\\"{0}\\\")\", parameters)); // Noncompliant\n            context.Set<User>().FromSqlRaw($\"SELECT * FROM mytable WHERE mycol={parameters[0]}\"); // Noncompliant\n            context.Set<User>().FromSqlRaw(\"SELECT * FROM mytable WHERE mycol=\" + parameters[0]); // Noncompliant\n            context.Set<User>().FromSqlRaw(formatted);    // Noncompliant [6]\n            context.Set<User>().FromSqlRaw(concatenated); // Noncompliant [3]\n            context.Set<User>().FromSqlRaw(interpolated); // Noncompliant [9]\n        }\n\n        public void Foo(BloggingContext context, string query)\n        {\n            var a = context.Blogs.FromSqlRaw($\"{query}\"); // Noncompliant\n            var b = context.Blogs.FromSqlInterpolated($\"{query}\"); // Compliant, FromSqlInterpolated is safe https://learn.microsoft.com/ef/core/querying/sql-queries#passing-parameters\n        }\n    }\n\n    class User\n    {\n        string Id { get; set; }\n        string Name { get; set; }\n    }\n\n    public class BloggingContext : DbContext\n    {\n        public DbSet<Blog> Blogs { get; set; }\n    }\n\n    public class Blog\n    {\n        public string Url { get; set; }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/9602\n    class Repro_9602\n    {\n        public void ConstantQuery(DbContext context, bool onlyEnabled)\n        {\n            string query = \"SELECT id FROM users\";\n            if(onlyEnabled)\n                query += \" WHERE enabled = 1\";\n            string query2 = $\"SELECT id FROM users {(onlyEnabled ? \"WHERE enabled = 1\" : \"\")}\"; // Secondary [c1, c2, c3]\n\n            context.Database.ExecuteSqlRaw(query); // Compliant\n            context.Database.ExecuteSqlRaw(query2); // Noncompliant [c1] - FP\n            context.Database.ExecuteSqlRaw($\"SELECT id FROM users {(onlyEnabled ? \"WHERE enabled = 1\" : \"\")}\"); // Noncompliant - FP\n\n            context.Database.ExecuteSqlRawAsync(query); // Compliant\n            context.Database.ExecuteSqlRawAsync(query2); // Noncompliant [c2] - FP\n            context.Database.ExecuteSqlRawAsync($\"SELECT id FROM users {(onlyEnabled ? \"WHERE enabled = 1\" : \"\")}\"); // Noncompliant - FP\n\n            context.Set<User>().FromSqlRaw(query); // Compliant\n            context.Set<User>().FromSqlRaw(query2); // Noncompliant [c3] - FP\n            context.Set<User>().FromSqlRaw($\"SELECT id FROM users {(onlyEnabled ? \"WHERE enabled = 1\" : \"\")}\"); // Noncompliant - FP\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/ExecutingSqlQueries.EntityFrameworkCoreLatest.vb",
    "content": "﻿Imports System\nImports System.Linq\nImports Microsoft.EntityFrameworkCore\n\nNamespace Tests.Diagnostics\n    Class Program\n        Private Const ConstQuery As String = \"\"\n\n        Public Sub Foo(ByVal context As DbContext, ByVal query As String, ByVal x As Int32, ParamArray parameters As Object())\n            context.Database.ExecuteSqlRaw($\"\") ' Noncompliant\n            context.Database.ExecuteSqlRaw(\"\") ' Compliant, constants are safe\n            context.Database.ExecuteSqlRaw(ConstQuery) ' Compliant, constants are safe\n            context.Database.ExecuteSqlRaw(\"\" & \"\") ' Compliant, constants are safe\n            context.Database.ExecuteSqlRaw(\"\" + \"\") ' Compliant, constants are safe\n            context.Database.ExecuteSqlRaw(query) ' Compliant, not concat or format\n            context.Database.ExecuteSqlRaw(\"\" & query) ' Noncompliant\n            context.Database.ExecuteSqlRaw(\"\" + query) ' Noncompliant\n            context.Database.ExecuteSqlRaw($\"\", parameters) ' Noncompliant\n            context.Database.ExecuteSqlRaw(query, parameters) ' Compliant, not concat or format\n            context.Database.ExecuteSqlRaw(\"\" & query, parameters) ' Noncompliant\n            context.Database.ExecuteSqlRaw(\"\" + query, parameters) ' Noncompliant\n\n            context.Database.ExecuteSqlRaw($\"SELECT * FROM mytable WHERE mycol={query}\", parameters(0)) ' Noncompliant\n            context.Database.ExecuteSqlRaw($\"SELECT * FROM mytable WHERE mycol={query}\", x) ' Noncompliant\n            context.Database.ExecuteSqlRaw($\"SELECT * FROM mytable WHERE mycol={query}\") ' Noncompliant\n\n            RelationalDatabaseFacadeExtensions.ExecuteSqlRaw(context.Database, query) ' Compliant\n            RelationalDatabaseFacadeExtensions.ExecuteSqlRaw(context.Database, $\"SELECT * FROM mytable WHERE mycol={query} AND col2={0}\", x) ' Noncompliant\n\n            context.Database.ExecuteSqlRawAsync($\"\") ' Noncompliant\n            context.Database.ExecuteSqlRawAsync(\"\") ' Compliant, constants are safe\n            context.Database.ExecuteSqlRawAsync(ConstQuery) ' Compliant, constants are safe\n            context.Database.ExecuteSqlRawAsync(\"\" & \"\") ' Compliant, constants are safe\n            context.Database.ExecuteSqlRawAsync(\"\" + \"\") ' Compliant, constants are safe\n            context.Database.ExecuteSqlRawAsync(\"\" + \"\" & \"\") ' Compliant, constants are safe\n            context.Database.ExecuteSqlRawAsync(\"\" & \"\" + \"\") ' Compliant, constants are safe\n            context.Database.ExecuteSqlRawAsync(query) ' Compliant, not concat or format\n            context.Database.ExecuteSqlRawAsync(\"\" & query) ' Noncompliant\n            context.Database.ExecuteSqlRawAsync(\"\" + query) ' Noncompliant\n            context.Database.ExecuteSqlRawAsync($\"\", parameters) ' Noncompliant\n            context.Database.ExecuteSqlRawAsync(query, parameters) ' Compliant, not concat or format\n            context.Database.ExecuteSqlRawAsync(\"\" & query, parameters) ' Noncompliant\n            context.Database.ExecuteSqlRawAsync(\"\" + query, parameters) ' Noncompliant\n            context.Database.ExecuteSqlRawAsync(query + \"\", parameters) ' Noncompliant\n            context.Database.ExecuteSqlRawAsync(query & \"\", parameters) ' Noncompliant\n            context.Database.ExecuteSqlRawAsync(\"\" & query + \"\", parameters) ' Noncompliant\n            context.Database.ExecuteSqlRawAsync(\"\" + query & \"\", parameters) ' Noncompliant\n            context.Database.ExecuteSqlRawAsync($\"SELECT * FROM mytable WHERE mycol={query}\") ' Noncompliant\n            context.Database.ExecuteSqlRawAsync($\"SELECT * FROM mytable WHERE mycol={query}\", x) ' Noncompliant\n            RelationalDatabaseFacadeExtensions.ExecuteSqlRawAsync(context.Database, \"\" & query, parameters) ' Noncompliant\n            RelationalDatabaseFacadeExtensions.ExecuteSqlRawAsync(context.Database, \"\" + query, parameters) ' Noncompliant\n\n            context.Set(Of User)().FromSqlRaw($\"\") ' Noncompliant\n            context.Set(Of User)().FromSqlRaw(\"\") ' Compliant, constants are safe\n            context.Set(Of User)().FromSqlRaw(ConstQuery) ' Compliant, constants are safe\n            context.Set(Of User)().FromSqlRaw(query) ' Compliant, not concat or format\n            context.Set(Of User)().FromSqlRaw(\"\" & \"\") ' Compliant, constants are safe\n            context.Set(Of User)().FromSqlRaw(\"\" + \"\") ' Compliant, constants are safe\n            context.Set(Of User)().FromSqlRaw($\"\", parameters) ' Noncompliant\n            context.Set(Of User)().FromSqlRaw(\"\", parameters) ' Compliant, the parameters are sanitized\n            context.Set(Of User)().FromSqlRaw(query, parameters) ' Compliant, not concat or format\n            context.Set(Of User)().FromSqlRaw(\"\" & query, parameters) ' Noncompliant\n            context.Set(Of User)().FromSqlRaw(\"\" + query, parameters) ' Noncompliant\n            context.Set(Of User)().FromSqlRaw($\"SELECT * FROM mytable WHERE mycol={query}\") ' Noncompliant\n            context.Set(Of User)().FromSqlRaw($\"SELECT * FROM mytable WHERE mycol={query}\", x) ' Noncompliant\n            RelationalQueryableExtensions.FromSqlRaw(context.Set(Of User)(), \"\" & query, parameters) ' Noncompliant\n            RelationalQueryableExtensions.FromSqlRaw(context.Set(Of User)(), \"\" + query, parameters) ' Noncompliant\n\n        End Sub\n\n        Public Sub ConcatAndFormat(ByVal context As DbContext, ByVal query As String, ParamArray parameters As Object())\n            Dim formatted = String.Format(\"INSERT INTO Users (name) VALUES (\"\"{0}\"\")\", parameters) ' Secondary [1,2,3]\n            Dim concatenated = String.Concat(query, parameters)                                    ' Secondary [4,5,6]\n            Dim interpolated = $\"SELECT * FROM mytable WHERE mycol={query}\"                        ' Secondary [7,8,9]\n\n            context.Database.ExecuteSqlRaw(String.Concat(query, parameters)) ' Noncompliant\n            context.Database.ExecuteSqlRaw(String.Format(query, parameters)) ' Noncompliant\n            context.Database.ExecuteSqlRaw(String.Format(\"INSERT INTO Users (name) VALUES (\"\"{0}\"\")\", parameters)) ' Noncompliant\n            context.Database.ExecuteSqlRaw($\"SELECT * FROM mytable WHERE mycol={parameters(0)}\") ' Noncompliant\n            context.Database.ExecuteSqlRaw(formatted)    ' Noncompliant [1]\n            context.Database.ExecuteSqlRaw(concatenated) ' Noncompliant [4]\n            context.Database.ExecuteSqlRaw(interpolated) ' Noncompliant [7]\n\n            context.Database.ExecuteSqlRawAsync(String.Concat(query, parameters)) ' Noncompliant\n            context.Database.ExecuteSqlRawAsync(String.Format(query, parameters)) ' Noncompliant\n            context.Database.ExecuteSqlRawAsync(String.Format(\"INSERT INTO Users (name) VALUES (\"\"{0}\"\")\", parameters)) ' Noncompliant\n            context.Database.ExecuteSqlRawAsync(formatted)    ' Noncompliant [2]\n            context.Database.ExecuteSqlRawAsync(concatenated) ' Noncompliant [5]\n            context.Database.ExecuteSqlRawAsync(interpolated) ' Noncompliant [8]\n\n            context.Set(Of User)().FromSqlRaw(String.Concat(query, parameters)) ' Noncompliant\n            context.Set(Of User)().FromSqlRaw(String.Format(\"INSERT INTO Users (name) VALUES (\"\"{0}\"\")\", parameters)) ' Noncompliant\n            context.Set(Of User)().FromSqlRaw(formatted)    ' Noncompliant [3]\n            context.Set(Of User)().FromSqlRaw(concatenated) ' Noncompliant [6]\n            context.Set(Of User)().FromSqlRaw(interpolated) ' Noncompliant [9]\n        End Sub\n\n    End Class\n\n    ' https://github.com/SonarSource/sonar-dotnet/issues/9602\n    Class Repro_9602\n        Public Sub ConstantQuery(context As DbContext, onlyEnabled As Boolean)\n            Dim query As String = \"SELECT id FROM users\"\n            If onlyEnabled Then\n                query += \" WHERE enabled = 1\"\n            End If\n            Dim query2 As String = $\"SELECT id FROM users {(If(onlyEnabled, \"WHERE enabled = 1\", \"\"))}\" ' Secondary [c1, c2, c3]\n\n            context.Database.ExecuteSqlRaw(query) ' Compliant\n            context.Database.ExecuteSqlRaw(query2) ' Noncompliant [c1] - FP\n            context.Database.ExecuteSqlRaw($\"SELECT id FROM users {(If(onlyEnabled, \"WHERE enabled = 1\", \"\"))}\") ' Noncompliant - FP\n\n            context.Database.ExecuteSqlRawAsync(query) ' Compliant\n            context.Database.ExecuteSqlRawAsync(query2) ' Noncompliant [c2] - FP\n            context.Database.ExecuteSqlRawAsync($\"SELECT id FROM users {(If(onlyEnabled, \"WHERE enabled = 1\", \"\"))}\") ' Noncompliant - FP\n\n            context.Set(Of User)().FromSqlRaw(query) ' Compliant\n            context.Set(Of User)().FromSqlRaw(query2) ' Noncompliant [c3] - FP\n            context.Set(Of User)().FromSqlRaw($\"SELECT id FROM users {(If(onlyEnabled, \"WHERE enabled = 1\", \"\"))}\") ' Noncompliant - FP\n        End Sub\n    End Class\n\n    Class User\n        Private Property Id As String\n        Private Property Name As String\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/ExecutingSqlQueries.Latest.cs",
    "content": "﻿using System;\nusing System.Linq;\nusing Microsoft.EntityFrameworkCore;\nusing Microsoft.Data.Sqlite;\n\nstring ConstQuery = \"\";\n\nconst string part1 = \"SELECT * FROM\";\nconst string part2 = \" mytable WHERE mycol=\";\nconst string query = $\"{part1}{part2}\";\n\nconst string part3 = \"\"\"SELECT * FROM\"\"\";\nconst string part4 = \"\"\" mytable WHERE mycol=\"\"\";\nconst string rawConstQuery = $\"\"\"{part3}{part4}\"\"\";\n\nvoid Foo(DbContext context, SqliteConnection connection, string myQuery, int x, Guid guid, params object[] parameters)\n{\n    context.Database.ExecuteSqlCommand(ConstQuery); // Compliant, constants are safe\n    context.Database.ExecuteSqlCommand(myQuery); // Compliant, not concat or format\n\n    context.Database.ExecuteSqlCommand($\"SELECT * FROM mytable WHERE mycol={myQuery} AND mycol2={0}\", parameters[0]); // Noncompliant {{Make sure using a dynamically formatted SQL query is safe here.}}\n\n    context.Query<User>().FromSql(ConstQuery);                                               // Compliant, constants are safe\n    context.Query<User>().FromSql(\"\" + myQuery, parameters);                                   // Noncompliant\n    RelationalQueryableExtensions.FromSql(context.Query<User>(), \"\" + myQuery, parameters);    // Noncompliant\n\n    SqliteCommand command = new($\"SELECT * FROM mytable WHERE mycol={myQuery}\", connection);  // Noncompliant\n    context.Database.ExecuteSqlCommand(@$\"SELECT * FROM mytable WHERE mycol={myQuery}{myQuery}\", x, guid); // Noncompliant, RawSqlQuery\n}\n\nvoid Foo2(DbContext context, SqliteConnection connection, string notConstant, params object[] parameters)\n{\n    context.Query<User>().FromSql(\"\" + query, parameters);         // Compliant\n    context.Query<User>().FromSql(\"\" + notConstant, parameters);    // Noncompliant\n}\n\nvoid RawStringLiterals(DbContext context, SqliteConnection connection, string someUserInput, params object[] parameters)\n{\n    context.Query<User>().FromSql(rawConstQuery, parameters); // Compliant\n    SqliteCommand command = new($\"\"\"SELECT * FROM mytable WHERE mycol={someUserInput}\"\"\", connection);  // Noncompliant\n}\n\nvoid NewlinesInStringInterpolation(SqliteConnection connection, string someUserInput)\n{\n    SqliteCommand command = new($\"SELECT * FROM mytable WHERE mycol={someUserInput // Noncompliant\n        .ToLower()}\", connection);\n    SqliteCommand commandRawString = new($$\"\"\"SELECT * FROM mytable WHERE mycol={{someUserInput // Noncompliant\n        .ToLower()}}\"\"\", connection);\n}\n\nclass ClassWithPrimaryConstructor(DbContext context, SqliteConnection connection, string someUserInput, params object[] parameters)\n{\n    void Foo()\n    {\n        context.Query<object>().FromSql(someUserInput, parameters); // Compliant, we don't know anything about the someUserInput parameter\n        SqliteCommand command = new($\"SELECT * FROM mytable WHERE mycol={someUserInput}\", connection); // Noncompliant\n    }\n}\n\npartial class Partial\n{\n    partial string PropertyQuery => \"SELECT * FROM mytable WHERE mycol=\";\n}\n\npartial class Partial\n{\n    partial string PropertyQuery { get; }\n\n    void EscapeSequence(DbContext context, SqliteConnection connection, string myQuery, params object[] parameters)\n    {\n        const string constQuery = \"SELECT * FROM mytable\\eWHERE mycol=\";\n        context.Query<User>().FromSql(\"\\e\" + myQuery, parameters);       // Noncompliant\n        context.Query<User>().FromSql(\"\\e\" + constQuery, parameters);    // Compliant: constants are safe\n        context.Query<User>().FromSql(\"\\e\" + PropertyQuery, parameters); // Noncompliant\n        context.Query<User>().FromSql(\"\\e\" + PropertyQuery, \"\\e\");       // Noncompliant\n    }\n}\n\nrecord User\n{\n    string Id { get; set; }\n    string Name { get; set; }\n}\n\npublic static class  Extensions\n{\n    extension(DbContext db)\n    {\n        public void ExecuteSql(string myQuery, params object[] parameters)\n        {\n            db.Database.ExecuteSqlCommand($\"SELECT * FROM mytable WHERE mycol={myQuery} AND mycol2={0}\", parameters[0]);    // Noncompliant\n        } \n    }\n}\n\npublic class  NullConditionalAssignment\n{\n    public class Sample\n    {\n        public SqliteCommand Command { get; set; }\n        public string Query { get; set; }\n    }\n\n    public void Method(DbContext context, SqliteConnection connection, Sample sample, string userInput, int x, int guid)\n    {\n        sample?.Command = new SqliteCommand($\"SELECT * FROM mytable WHERE mycol={userInput}\", connection); // Noncompliant\n        sample?.Query = $\"SELECT * FROM mytable WHERE mycol={userInput}\";                                  // Compliant\n        context.Database.ExecuteSqlCommand(sample.Query);                                                  // Compliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/ExecutingSqlQueries.MicrosoftDataSqlClient.cs",
    "content": "using Microsoft.Data.SqlClient;\n\nnamespace Tests.Diagnostics\n{\n    class MicrosoftDataSqlClientTest\n    {\n        public void MicrosoftDataSqlClient_Compliant(SqlConnection connection, SqlTransaction transaction, string query)\n        {\n            // Compliant - constant query strings\n            new SqlCommand(\"SELECT * FROM table\");\n            new SqlCommand(\"SELECT * FROM table\", connection);\n            new SqlCommand(\"SELECT * FROM table\", connection, transaction);\n            new SqlCommand(\"SELECT * FROM table\", connection, transaction, SqlCommandColumnEncryptionSetting.Enabled);\n\n            var command = new SqlCommand();\n            command.CommandText = \"SELECT * FROM table\";\n\n            new SqlDataAdapter(\"SELECT * FROM table\", connection);\n        }\n\n        public void MicrosoftDataSqlClient_Noncompliant(SqlConnection connection, SqlTransaction transaction, string userInput)\n        {\n            new SqlCommand($\"SELECT * FROM table WHERE id = '{userInput}'\"); // Noncompliant\n            new SqlCommand($\"SELECT * FROM table WHERE id = '{userInput}'\", connection); // Noncompliant\n            new SqlCommand($\"SELECT * FROM table WHERE id = '{userInput}'\", connection, transaction); // Noncompliant\n            new SqlCommand($\"SELECT * FROM table WHERE id = '{userInput}'\", connection, transaction, SqlCommandColumnEncryptionSetting.Enabled); // Noncompliant\n\n            new SqlCommand(\"SELECT * FROM table WHERE id = '\" + userInput + \"'\"); // Noncompliant\n            new SqlCommand(string.Format(\"SELECT * FROM table WHERE id = '{0}'\", userInput), connection); // Noncompliant\n            new SqlCommand(string.Concat(\"SELECT * FROM table WHERE id = '\", userInput, \"'\"), connection, transaction); // Noncompliant\n\n            var command = new SqlCommand();\n            command.CommandText = $\"SELECT * FROM table WHERE id = '{userInput}'\"; // Noncompliant\n            command.CommandText = \"SELECT * FROM table WHERE id = '\" + userInput + \"'\"; // Noncompliant\n            command.CommandText = string.Format(\"SELECT * FROM table WHERE id = '{0}'\", userInput); // Noncompliant\n            command.CommandText = string.Concat(\"SELECT * FROM table WHERE id = '\", userInput, \"'\"); // Noncompliant\n\n            new SqlDataAdapter($\"SELECT * FROM table WHERE id = '{userInput}'\", connection); // Noncompliant\n            new SqlDataAdapter(\"SELECT * FROM table WHERE id = '\" + userInput + \"'\", connection); // Noncompliant\n            new SqlDataAdapter(string.Format(\"SELECT * FROM table WHERE id = '{0}'\", userInput), connection); // Noncompliant\n        }\n\n        public void MicrosoftDataSqlClient_VariableAssignment(SqlConnection connection, string userInput)\n        {\n            string query = $\"SELECT * FROM table WHERE id = '{userInput}'\"; // Secondary [1, 2, 3, 4]\n            new SqlCommand(query); // Noncompliant [1]\n            new SqlCommand(query, connection); // Noncompliant [2]\n\n            var command = new SqlCommand();\n            command.CommandText = query; // Noncompliant [3]\n\n            new SqlDataAdapter(query, connection); // Noncompliant [4]\n\n            // Compliant - variable assigned with constant\n            string constQuery = \"SELECT * FROM table\";\n            new SqlCommand(constQuery);\n            command.CommandText = constQuery;\n        }\n    }\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/ExecutingSqlQueries.MySqlData.cs",
    "content": "﻿using Dapper;\nusing MySql.Data.MySqlClient;\n\n// https://github.com/SonarSource/sonar-dotnet/issues/9602\nclass Repro_9602\n{\n    public void ConstantQuery(MySqlConnection db, bool onlyEnabled)\n    {\n        string query = \"SELECT id FROM users\";\n        if(onlyEnabled)\n            query += \" WHERE enabled = 1\";\n        string query2 = $\"SELECT id FROM users {(onlyEnabled ? \"WHERE enabled = 1\" : \"\")}\"; // Secondary\n\n        db.Query<int>(query);                                                               // Compliant\n        db.Query<int>(query2);                                                              // Noncompliant - FP\n        db.Query<int>($\"SELECT id FROM users {(onlyEnabled ? \"WHERE enabled = 1\" : \"\")}\");  // Noncompliant - FP\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/ExecutingSqlQueries.NHibernate.cs",
    "content": "﻿using System;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing NHibernate;\nusing NHibernate.Cfg.Loquacious;\nusing NHibernate.Engine;\nusing NHibernate.Engine.Query;\nusing NHibernate.Engine.Query.Sql;\nusing NHibernate.Impl;\n\nclass Program\n{\n    public async Task ISessionMethods(ISession session, string query, string param)\n    {\n        session.CreateFilter(null, query);                                                              // Compliant\n        session.CreateFilter(null, query + param);                                                      // Noncompliant\n\n        await session.CreateFilterAsync(null, query);                                                   // Compliant\n        await session.CreateFilterAsync(null, query + param);                                           // Noncompliant\n\n        session.CreateQuery(query);                                                                     // Compliant\n        session.CreateQuery(query + param);                                                             // Noncompliant\n\n        session.CreateSQLQuery(query);                                                                  // Compliant\n        session.CreateSQLQuery(query + param);                                                          // Noncompliant\n\n        session.Delete(query);                                                                          // Compliant\n        session.Delete(query + param);                                                                  // Noncompliant\n\n        await session.DeleteAsync(query);                                                               // Compliant\n        await session.DeleteAsync(query + param);                                                       // Noncompliant\n\n        session.GetNamedQuery(query);                                                                   // Compliant\n        session.GetNamedQuery(query + param);                                                           // Noncompliant\n    }\n\n    public async Task SessionImplMethods(SessionImpl session, string query, string param)\n    {\n        session.CreateFilter(null, query);                                                              // Compliant\n        session.CreateFilter(null, query + param);                                                      // Noncompliant\n\n        await session.CreateFilterAsync(null, query);                                                   // Compliant\n        await session.CreateFilterAsync(null, query + param);                                           // Noncompliant\n\n        session.CreateQuery(query);                                                                     // Compliant\n        session.CreateQuery(query + param);                                                             // Noncompliant\n\n        session.CreateSQLQuery(query);                                                                  // Compliant\n        session.CreateSQLQuery(query + param);                                                          // Noncompliant\n\n        session.Delete(query);                                                                          // Compliant\n        session.Delete(query + param);                                                                  // Noncompliant\n\n        await session.DeleteAsync(query);                                                               // Compliant\n        await session.DeleteAsync(query + param);                                                       // Noncompliant\n\n        session.GetNamedQuery(query);                                                                   // Compliant\n        session.GetNamedQuery(query + param);                                                           // Noncompliant\n\n        session.GetNamedSQLQuery(query);                                                                // Compliant\n        session.GetNamedSQLQuery(query + param);                                                        // Noncompliant\n    }\n\n    public async Task AbstractSessionImplMethods(AbstractSessionImpl session, string query, string param)\n    {\n        session.CreateQuery(query);                                                                     // Compliant\n        session.CreateQuery(query + param);                                                             // Noncompliant\n\n        session.CreateSQLQuery(query);                                                                  // Compliant\n        session.CreateSQLQuery(query + param);                                                          // Noncompliant\n\n        session.GetNamedQuery(query);                                                                   // Compliant\n        session.GetNamedQuery(query + param);                                                           // Noncompliant\n\n        session.GetNamedSQLQuery(query);                                                                // Compliant\n        session.GetNamedSQLQuery(query + param);                                                        // Noncompliant\n    }\n\n    public void NamedQueryDefinitionBuilder_Query(NamedQueryDefinitionBuilder builder, string query, string param)\n    {\n        builder.Query = query;                                                                          // Compliant\n        builder.Query = query + param;                                                                  // Noncompliant\n        builder.Query = $\"SELECT * FROM table WHERE id = '{param}'\";                                    // Noncompliant\n        builder.Query = string.Format(\"SELECT * FROM table WHERE id = '{0}'\", param);                   // Noncompliant\n    }\n\n    public void NamedQueryDefinition_Constructor(string query, string param)\n    {\n        new NamedQueryDefinition(query, false, null, 0, 0, FlushMode.Auto, CacheMode.Normal, false, null, null);              // Compliant\n        new NamedQueryDefinition(query + param, false, null, 0, 0, FlushMode.Auto, CacheMode.Normal, false, null, null);      // Noncompliant\n        new NamedQueryDefinition($\"SELECT * FROM table WHERE id = '{param}'\", false, null, 0, 0, FlushMode.Auto, CacheMode.Normal, false, null, null);  // Noncompliant\n    }\n\n    public void NamedSQLQueryDefinition_Constructor(string query, string param)\n    {\n        new NamedSQLQueryDefinition(query, (INativeSQLQueryReturn[])null, null, false, null, 0, 0, FlushMode.Auto, CacheMode.Normal, false, null, null, false);              // Compliant\n        new NamedSQLQueryDefinition(query + param, (INativeSQLQueryReturn[])null, null, false, null, 0, 0, FlushMode.Auto, CacheMode.Normal, false, null, null, false);      // Noncompliant\n        new NamedSQLQueryDefinition($\"SELECT * FROM table WHERE id = '{param}'\", (INativeSQLQueryReturn[])null, null, false, null, 0, 0, FlushMode.Auto, CacheMode.Normal, false, null, null, false);  // Noncompliant\n    }\n\n    public void QueryImpl_Constructor(ISessionImplementor sessionImplementor, ParameterMetadata parameterMetadata, string query, string param)\n    {\n        new QueryImpl(query, FlushMode.Auto, sessionImplementor, parameterMetadata);                    // Compliant\n        new QueryImpl(query + param, FlushMode.Auto, sessionImplementor, parameterMetadata);            // Noncompliant\n        new QueryImpl($\"SELECT * FROM table WHERE id = '{param}'\", FlushMode.Auto, sessionImplementor, parameterMetadata);  // Noncompliant\n        new QueryImpl(string.Format(\"SELECT * FROM table WHERE id = '{0}'\", param), FlushMode.Auto, sessionImplementor, parameterMetadata);  // Noncompliant\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/9602\nclass Repro_9602\n{\n    public async Task ConstantQuery(ISession session, bool onlyEnabled)\n    {\n        string query = \"SELECT id FROM users\";\n        if(onlyEnabled)\n            query += \" WHERE enabled = 1\";\n        string query2 = $\"SELECT id FROM users {(onlyEnabled ? \"WHERE enabled = 1\" : \"\")}\"; // Secondary [s1, s2, s3, s4, s5, s6, s7, s8]\n\n        session.CreateFilter(null, query);                                                              // Compliant\n        session.CreateFilter(null, query2);                                                             // Noncompliant [s1] - FP\n        session.CreateFilter(null, $\"SELECT id FROM users {(onlyEnabled ? \"WHERE enabled = 1\" : \"\")}\"); // Noncompliant - FP\n\n        session.CreateFilter(null, query);                                                              // Compliant\n        session.CreateFilter(null, query2);                                                             // Noncompliant [s2] - FP\n        session.CreateFilter(null, $\"SELECT id FROM users {(onlyEnabled ? \"WHERE enabled = 1\" : \"\")}\"); // Noncompliant - FP\n\n        await session.CreateFilterAsync(null, query);                                                   // Compliant\n        await session.CreateFilterAsync(null, query2);                                                  // Noncompliant [s3] - FP\n        await session.CreateFilterAsync(null, $\"SELECT id FROM users {(onlyEnabled ? \"WHERE enabled = 1\" : \"\")}\");  // Noncompliant - FP\n\n        session.CreateQuery(query);                                                                     // Compliant\n        session.CreateQuery(query2);                                                                    // Noncompliant [s4] - FP\n        session.CreateQuery($\"SELECT id FROM users {(onlyEnabled ? \"WHERE enabled = 1\" : \"\")}\");        // Noncompliant - FP\n\n        session.CreateSQLQuery(query);                                                                  // Compliant\n        session.CreateSQLQuery(query2);                                                                 // Noncompliant [s5] - FP\n        session.CreateSQLQuery($\"SELECT id FROM users {(onlyEnabled ? \"WHERE enabled = 1\" : \"\")}\");     // Noncompliant - FP\n\n        session.Delete(query);                                                                          // Compliant\n        session.Delete(query2);                                                                         // Noncompliant [s6] - FP\n        session.Delete($\"SELECT id FROM users {(onlyEnabled ? \"WHERE enabled = 1\" : \"\")}\");             // Noncompliant - FP\n\n        await session.DeleteAsync(query);                                                               // Compliant\n        await session.DeleteAsync(query2);                                                              // Noncompliant [s7] - FP\n        await session.DeleteAsync($\"SELECT id FROM users {(onlyEnabled ? \"WHERE enabled = 1\" : \"\")}\");  // Noncompliant - FP\n\n        session.GetNamedQuery(query);                                                                   // Compliant\n        session.GetNamedQuery(query2);                                                                  // Noncompliant [s8] - FP\n        session.GetNamedQuery($\"SELECT id FROM users {(onlyEnabled ? \"WHERE enabled = 1\" : \"\")}\");      // Noncompliant - FP\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/ExecutingSqlQueries.Net46.MonoSqlLite.cs",
    "content": "﻿using System;\nusing System.Linq;\nusing Mono.Data.Sqlite;\n\npublic class Sample\n{\n    string ConstQuery = \"\";\n\n    void Compliant(SqliteConnection connection)\n    {\n        var command = new SqliteCommand();       // Compliant\n        command = new SqliteCommand(connection); // Compliant\n        var adapter = new SqliteDataAdapter();   // Compliant\n    }\n\n    void Foo(SqliteConnection connection, string query, SqliteTransaction transaction, params object[] parameters)\n    {\n        var command = new SqliteCommand($\"SELECT * FROM mytable WHERE mycol={query}\", connection);          // Noncompliant\n        command = new SqliteCommand($\"SELECT * FROM mytable WHERE mycol={query}\");                          // Noncompliant\n        command = new SqliteCommand($\"SELECT * FROM mytable WHERE mycol={query}\", connection, transaction); // Noncompliant\n        var adapter = new SqliteDataAdapter(string.Concat(query, parameters), connection);                  // Noncompliant\n        adapter = new SqliteDataAdapter(string.Concat(query, parameters), \"connection\");                    // Noncompliant\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/7261\n    void Reproduce_7261(string connectionString, string query)\n    {\n        string sql = \"select * from table where query = '\" + query + \"';\"; // Secondary [adapter, command]\n\n        using (SqliteConnection connection = new SqliteConnection(connectionString))\n        {\n            connection.Open();\n\n            var adapter = new SqliteDataAdapter(sql, connection); // Noncompliant [adapter]\n            var command = new SqliteCommand(sql, connection);     // Noncompliant [command]\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/ExecutingSqlQueries.Net46.MonoSqlLite.vb",
    "content": "﻿Imports System\nImports System.Linq\nImports Mono.Data.Sqlite\n\nPublic Class Sample\n    Private ConstQuery As String = \"\"\n\n    Private Sub Compliant(ByVal connection As SqliteConnection)\n        Dim command = New SqliteCommand()       ' Compliant\n        command = New SqliteCommand(connection) ' Compliant\n        Dim adapter = New SqliteDataAdapter()   ' Compliant\n    End Sub\n\n    Private Sub Foo(ByVal connection As SqliteConnection, transaction As SqliteTransaction, ByVal query As String, ParamArray parameters As Object())\n        Dim command = New SqliteCommand($\"SELECT * FROM mytable WHERE mycol={query}\", connection)          ' Noncompliant\n        command = New SqliteCommand($\"SELECT * FROM mytable WHERE mycol={query}\")                          ' Noncompliant\n        command = New SqliteCommand($\"SELECT * FROM mytable WHERE mycol={query}\", connection, transaction) ' Noncompliant\n        Dim adapter = New SqliteDataAdapter(String.Concat(query, parameters), connection)                  ' Noncompliant\n        adapter = New SqliteDataAdapter(String.Concat(query, parameters), \"connection\")                    ' Noncompliant\n    End Sub\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/ExecutingSqlQueries.Net46.cs",
    "content": "﻿using System;\nusing System.Data;\nusing System.Data.Common;\nusing System.Data.SqlClient;\nusing System.Data.Odbc;\nusing System.Data.OracleClient;\nusing System.Data.SqlServerCe;\nusing MySql.Data.MySqlClient;\nusing Microsoft.Data.Sqlite;\nusing System.Data.SQLite;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        private const string ConstantQuery = \"\";\n\n        public void CompliantSqlCommands(SqlConnection connection, SqlTransaction transaction, string query)\n        {\n            SqlCommand command;\n            command = new SqlCommand(); // Compliant\n            command = new SqlCommand(\"\"); // Compliant\n            command = new SqlCommand(ConstantQuery); // Compliant\n            command = new SqlCommand(query); // Compliant, we don't know anything about the parameter\n            command = new SqlCommand(query, connection); // Compliant\n            command = new SqlCommand(\"\", connection); // Compliant, constant queries are safe\n            command = new SqlCommand(query, connection, transaction); // Compliant\n            command = new SqlCommand(\"\", connection, transaction); // Compliant, constant queries are safe\n            command = new SqlCommand(query, connection, transaction, SqlCommandColumnEncryptionSetting.Enabled); // Compliant\n            command = new SqlCommand(\"\", connection, transaction, SqlCommandColumnEncryptionSetting.Enabled); // Compliant, constant queries are safe\n\n            command.CommandText = query; // Compliant, we don't know enough about the parameter\n            command.CommandText = ConstantQuery; // Compliant\n            string text;\n            text = command.CommandText; // Compliant\n            text = command.CommandText = query; // Compliant\n\n            SqlDataAdapter adapter;\n            adapter = new SqlDataAdapter(); // Compliant\n            adapter = new SqlDataAdapter(command); // Compliant\n            adapter = new SqlDataAdapter(query, \"\"); // Compliant\n            adapter = new SqlDataAdapter(query, connection); // Compliant\n        }\n\n        public void NonCompliant_Concat_SqlCommands(SqlConnection connection, SqlTransaction transaction, string query, string param)\n        {\n            var command = new SqlCommand(string.Concat(query, param)); // Noncompliant {{Make sure using a dynamically formatted SQL query is safe here.}}\n//                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            command = new SqlCommand(query + param, connection); // Noncompliant\n            command = new SqlCommand(\"\" + 1 + 2, connection); // Compliant\n            command = new SqlCommand(string.Concat(query, param), connection); // Noncompliant\n            command = new SqlCommand(string.Concat(query, param), connection, transaction); // Noncompliant\n            command = new SqlCommand(string.Concat(query, param), connection, transaction, SqlCommandColumnEncryptionSetting.Enabled); // Noncompliant\n\n            command.CommandText = string.Concat(query, param); // Noncompliant\n//          ^^^^^^^^^^^^^^^^^^^\n            string text = command.CommandText = string.Concat(query, param); // Noncompliant\n\n            var adapter = new SqlDataAdapter(string.Concat(query, param), \"\"); // Noncompliant\n        }\n\n        public void NonCompliant_Format_SqlCommands(SqlConnection connection, SqlTransaction transaction, string param)\n        {\n            var command = new SqlCommand(string.Format(\"INSERT INTO Users (name) VALUES (\\\"{0}\\\")\", param)); // Noncompliant {{Make sure using a dynamically formatted SQL query is safe here.}}\n//                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            command = new SqlCommand(string.Format(\"INSERT INTO Users (name) VALUES (\\\"{0}\\\")\", param), connection); // Noncompliant\n            command = new SqlCommand(string.Format(\"INSERT INTO Users (name) VALUES (\\\"{0}\\\")\", param), connection, transaction); // Noncompliant\n            command = new SqlCommand(string.Format(\"INSERT INTO Users (name) VALUES (\\\"{0}\\\")\", param), connection, transaction, SqlCommandColumnEncryptionSetting.Enabled); // Noncompliant\n            int x = 1;\n            Guid g = Guid.NewGuid();\n            DateTime dateTime = DateTime.Now;\n            command = new SqlCommand(string.Format(\"INSERT INTO Users (name) VALUES (\\\"{0}\\\", \\\"{2}\\\", \\\"{3}\\\")\", x, g, dateTime), // Noncompliant - scalars can be dangerous and lead to expensive queries\n                connection, transaction, SqlCommandColumnEncryptionSetting.Enabled);\n            command = new SqlCommand(string.Format(\"INSERT INTO Users (name) VALUES (\\\"{0}\\\", \\\"{2}\\\", \\\"{3}\\\")\", x, param, dateTime), // Noncompliant\n                connection, transaction, SqlCommandColumnEncryptionSetting.Enabled);\n\n            command.CommandText = string.Format(\"INSERT INTO Users (name) VALUES (\\\"{0}\\\")\", param); // Noncompliant\n            string text = command.CommandText = string.Format(\"INSERT INTO Users (name) VALUES (\\\"{0}\\\")\", param); // Noncompliant\n\n            var adapter = new SqlDataAdapter(string.Format(\"INSERT INTO Users (name) VALUES (\\\"{0}\\\")\", param), \"\"); // Noncompliant\n        }\n\n        public void NonCompliant_Interpolation_SqlCommands(SqlConnection connection, SqlTransaction transaction, string param)\n        {\n            var command = new SqlCommand($\"SELECT * FROM mytable WHERE mycol={param}\"); // Noncompliant {{Make sure using a dynamically formatted SQL query is safe here.}}\n//                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            command = new SqlCommand($\"SELECT * FROM mytable WHERE mycol={param}\", connection, transaction, SqlCommandColumnEncryptionSetting.Enabled); // Noncompliant\n\n            command.CommandText = $\"SELECT * FROM mytable WHERE mycol={param}\"; // Noncompliant\n//          ^^^^^^^^^^^^^^^^^^^\n\n            var adapter = new SqlDataAdapter($\"SELECT * FROM mytable WHERE mycol={param}\", \"\"); // Noncompliant\n        }\n\n        public void OdbcCommands(OdbcConnection connection, OdbcTransaction transaction, string query)\n        {\n            OdbcCommand command;\n            command = new OdbcCommand(); // Compliant\n            command = new OdbcCommand(\"\"); // Compliant\n            command = new OdbcCommand(ConstantQuery); // Compliant\n            command = new OdbcCommand(query); // Compliant, we don't know anything about the parameter\n            command = new OdbcCommand(query, connection); // Compliant\n            command = new OdbcCommand(query, connection, transaction); // Compliant\n\n            command.CommandText = query; // Compliant\n            command.CommandText = ConstantQuery; // Compliant\n            string text;\n            text = command.CommandText; // Compliant\n            text = command.CommandText = query; // Compliant\n\n            OdbcDataAdapter adapter;\n            adapter = new OdbcDataAdapter(); // Compliant\n            adapter = new OdbcDataAdapter(command); // Compliant\n            adapter = new OdbcDataAdapter(query, $\"concatenated connection string {query}\"); // Compliant\n            adapter = new OdbcDataAdapter(query, connection); // Compliant\n        }\n\n        /**\n         * For the rest of the frameworks, we do sparse testing, to keep tests maintainable and relevant\n         */\n\n        public void NonCompliant_OdbcCommands(SqlConnection connection, SqlTransaction transaction, string query, string param)\n        {\n            var command = new OdbcCommand(string.Concat(query, param)); // Noncompliant {{Make sure using a dynamically formatted SQL query is safe here.}}\n            command.CommandText = string.Concat(query, param); // Noncompliant\n            command.CommandText = $\"SELECT * FROM mytable WHERE mycol={param}\"; // Noncompliant\n            var adapter = new OdbcDataAdapter(string.Format(\"INSERT INTO Users (name) VALUES (\\\"{0}\\\")\", param), \"\"); // Noncompliant\n        }\n\n        public void OracleCommands(OracleConnection connection, OracleTransaction transaction, string query)\n        {\n            OracleCommand command;\n            command = new OracleCommand(); // Compliant\n            command = new OracleCommand(\"\"); // Compliant\n            command = new OracleCommand(ConstantQuery); // Compliant\n            command = new OracleCommand(query); // Compliant, we don't know anything about the parameter\n            command = new OracleCommand(query, connection); // Compliant, we don't know anything about the parameter\n            command = new OracleCommand(query, connection, transaction); // Compliant, we don't know anything about the parameter\n\n            command.CommandText = query; // Compliant, we don't know anything about the parameter\n            command.CommandText = ConstantQuery; // Compliant\n            string text;\n            text = command.CommandText; // Compliant\n            text = command.CommandText = query; // Compliant, we don't know anything about the parameter\n\n            OracleDataAdapter adapter;\n            adapter = new OracleDataAdapter(); // Compliant\n            adapter = new OracleDataAdapter(command); // Compliant\n            adapter = new OracleDataAdapter(query, $\"nonconcatenated connection string {query}\"); // Compliant, we don't know anything about the parameter\n            adapter = new OracleDataAdapter(query, connection); // Compliant, we don't know anything about the parameter\n        }\n\n        public void NonCompliant_OracleCommands(OracleConnection connection, OracleTransaction transaction, string query, string param)\n        {\n            var command = new OracleCommand(string.Format(\"INSERT INTO Users (name) VALUES (\\\"{0}\\\")\", param)); // Noncompliant {{Make sure using a dynamically formatted SQL query is safe here.}}\n            command.CommandText = $\"SELECT * FROM mytable WHERE mycol={param}\"; // Noncompliant\n            new OracleDataAdapter(string.Format(\"INSERT INTO Users (name) VALUES (\\\"{0}\\\")\", param), \"\"); // Noncompliant\n        }\n\n        public void SqlServerCeCommands(SqlCeConnection connection, SqlCeTransaction transaction, string query)\n        {\n            SqlCeCommand command;\n            command = new SqlCeCommand(); // Compliant\n            command = new SqlCeCommand(\"\"); // Compliant\n            command = new SqlCeCommand(ConstantQuery); // Compliant\n            command = new SqlCeCommand(query); // Compliant\n            command = new SqlCeCommand(query, connection); // Compliant\n            command = new SqlCeCommand(query, connection, transaction); // Compliant\n\n            command.CommandText = query; // Compliant\n            command.CommandText = ConstantQuery; // Compliant\n            string text;\n            text = command.CommandText; // Compliant\n            text = command.CommandText = query; // Compliant\n\n            SqlCeDataAdapter adapter;\n            adapter = new SqlCeDataAdapter(); // Compliant\n            adapter = new SqlCeDataAdapter(command); // Compliant\n            adapter = new SqlCeDataAdapter(query, string.Concat(\"concatenated connection string\", query)); // Compliant\n            adapter = new SqlCeDataAdapter(query, connection); // Compliant\n        }\n\n        public void NonCompliant_SqlCeCommands(SqlCeConnection connection, SqlCeTransaction transaction, string query, string param)\n        {\n            new SqlCeDataAdapter(string.Concat(query, param), \"\"); // Noncompliant\n            var command = new SqlCeCommand($\"SELECT * FROM mytable WHERE mycol={param}\"); // Noncompliant {{Make sure using a dynamically formatted SQL query is safe here.}}\n            command.CommandText = string.Format(\"INSERT INTO Users (name) VALUES (\\\"{0}\\\")\", param); // Noncompliant\n        }\n\n        public void MySqlDataCompliant(MySqlConnection connection, MySqlTransaction transaction, string query)\n        {\n            MySqlCommand command;\n            command = new MySqlCommand();                                               // Compliant\n            command = new MySqlCommand(\"\");                                             // Compliant\n            command = new MySqlCommand(query, connection, transaction);                 // Compliant\n\n            command.CommandText = query;                                                // Compliant\n            command.CommandText = ConstantQuery;                                        // Compliant\n            string text;\n            text = command.CommandText;                                                 // Compliant\n            text = command.CommandText = query;                                         // Compliant\n\n            var adapter = new MySqlDataAdapter(\"\", connection);                         // Compliant\n            adapter = new MySqlDataAdapter(ConstantQuery, \"connectionString\");          // Compliant\n\n            MySqlHelper.ExecuteDataRow($\"concatenated connection string = {query}\", ConstantQuery);   // Compliant\n        }\n\n        public void NonCompliant_MySqlData(MySqlConnection connection, MySqlTransaction transaction, string query, string param)\n        {\n            var command = new MySqlCommand($\"SELECT * FROM mytable WHERE mycol={param}\");                          // Noncompliant\n            command = new MySqlCommand($\"SELECT * FROM mytable WHERE mycol={param}\", connection);                  // Noncompliant\n            command = new MySqlCommand($\"SELECT * FROM mytable WHERE mycol={param}\", connection, transaction);     // Noncompliant\n            command.CommandText = string.Format(\"INSERT INTO Users (name) VALUES (\\\"{0}\\\")\", param);               // Noncompliant\n\n            var adapter = new MySqlDataAdapter($\"SELECT * FROM mytable WHERE mycol=\" + param, connection);         // Noncompliant\n\n            MySqlHelper.ExecuteDataRow(\"connectionString\", $\"SELECT * FROM mytable WHERE mycol={param}\");          // Noncompliant\n            MySqlHelper.ExecuteDataRowAsync(\"connectionString\", $\"SELECT * FROM mytable WHERE mycol={param}\");     // Noncompliant\n            MySqlHelper.ExecuteDataRowAsync(\"connectionString\", $\"SELECT * FROM mytable WHERE mycol={param}\", new System.Threading.CancellationToken());    // Noncompliant\n            MySqlHelper.ExecuteDataset(\"connectionString\", $\"SELECT * FROM mytable WHERE mycol={param}\");          // Noncompliant\n            MySqlHelper.ExecuteDatasetAsync(\"connectionString\", $\"SELECT * FROM mytable WHERE mycol={param}\");     // Noncompliant\n            MySqlHelper.ExecuteNonQuery(\"connectionString\", $\"SELECT * FROM mytable WHERE mycol={param}\");         // Noncompliant\n            MySqlHelper.ExecuteNonQueryAsync(connection, $\"SELECT * FROM mytable WHERE mycol={param}\");            // Noncompliant\n            MySqlHelper.ExecuteReader(connection, $\"SELECT * FROM mytable WHERE mycol={param}\");                   // Noncompliant\n            MySqlHelper.ExecuteReaderAsync(connection, $\"SELECT * FROM mytable WHERE mycol={param}\");              // Noncompliant\n            MySqlHelper.ExecuteScalar(connection, $\"SELECT * FROM mytable WHERE mycol={param}\");                   // Noncompliant\n            MySqlHelper.ExecuteScalarAsync(connection, $\"SELECT * FROM mytable WHERE mycol={param}\");              // Noncompliant\n            MySqlHelper.UpdateDataSet(\"connectionString\", $\"SELECT * FROM mytable WHERE mycol={param}\", new DataSet(), \"tableName\");                        // Noncompliant\n            MySqlHelper.UpdateDataSetAsync(\"connectionString\", $\"SELECT * FROM mytable WHERE mycol={param}\", new DataSet(), \"tableName\");                   // Noncompliant\n\n            var script = new MySqlScript($\"SELECT * FROM mytable WHERE mycol={param}\");                            // Noncompliant\n            script = new MySqlScript(connection, $\"SELECT * FROM mytable WHERE mycol={param}\");                    // Noncompliant\n        }\n\n        public void MicrosoftDataSqliteCompliant(SqliteConnection connection, string query)\n        {\n            SqliteCommand command;\n            command = new SqliteCommand();          // Compliant\n            command = new SqliteCommand(\"\");        // Compliant\n            command.CommandText = ConstantQuery;    // Compliant\n\n            command.CommandText = query;            // Compliant\n        }\n\n        public void NonCompliant_MicrosoftDataSqlite(SqliteConnection connection, string query, string param)\n        {\n            var command = new SqliteCommand($\"SELECT * FROM mytable WHERE mycol={param}\", connection);  // Noncompliant\n            command.CommandText = string.Format(\"INSERT INTO Users (name) VALUES (\\\"{0}\\\")\", param);    // Noncompliant\n        }\n\n        public void SystemDataSqliteCompliant(SQLiteConnection connection, SQLiteTransaction transaction, string query)\n        {\n            SQLiteCommand command;\n            command = new SQLiteCommand();                                  // Compliant\n            command = new SQLiteCommand(\"\");                                // Compliant\n            command = new SQLiteCommand(query, connection, transaction);    // Compliant\n\n            command.CommandText = query;                                    // Compliant\n            command.CommandText = ConstantQuery;                            // Compliant\n            string text;\n            text = command.CommandText;                                     // Compliant\n            text = command.CommandText = query;                             // Compliant\n\n            SQLiteCommand.Execute(\"SELECT * FROM mytable WHERE mycol={param}\", SQLiteExecuteType.None, $\"connectionString={query}\");    // Compliant\n        }\n\n        public void NonCompliant_SystemDataSqlite(SQLiteConnection connection, SQLiteTransaction transaction, string query, string param)\n        {\n            var command = new SQLiteCommand($\"SELECT * FROM mytable WHERE mycol={param}\");                                      // Noncompliant\n            command = new SQLiteCommand($\"SELECT * FROM mytable WHERE mycol={param}\", connection);                              // Noncompliant\n            command = new SQLiteCommand($\"SELECT * FROM mytable WHERE mycol={param}\", connection, transaction);                 // Noncompliant\n            command.CommandText = string.Format(\"INSERT INTO Users (name) VALUES (\\\"{0}\\\")\", param);                            // Noncompliant\n\n            var adapter = new SQLiteDataAdapter($\"SELECT * FROM mytable WHERE mycol=\" + param, connection);                     // Noncompliant\n            SQLiteCommand.Execute($\"SELECT * FROM mytable WHERE mycol={param}\", SQLiteExecuteType.None, \"connectionString\");    // Noncompliant\n        }\n\n        public void ConcatAndStringFormat(SqlConnection connection, string param)\n        {\n            SqlCommand command;\n            string sensitiveQuery = string.Format(\"INSERT INTO Users (name) VALUES (\\\"{0}\\\")\", param);  // Secondary [1,2,3,4,5] {{SQL Query is dynamically formatted and assigned to sensitiveQuery.}}\n            //     ^^^^^^^^^^^^^^\n            command = new SqlCommand(sensitiveQuery);                                                   // Noncompliant [1]\n\n            command.CommandText = sensitiveQuery;                                                       // Noncompliant [2]\n\n            string stillSensitive = sensitiveQuery;                                                     // Secondary    ^20#14 [3] {{SQL query is assigned to stillSensitive.}}\n            command.CommandText = stillSensitive;                                                       // Noncompliant ^13#19 [3]\n\n            string sensitiveConcatQuery = \"SELECT * FROM Table1 WHERE col1 = '\" + param + \"'\";          // Secondary [6,7,8] {{SQL Query is dynamically formatted and assigned to sensitiveConcatQuery.}}\n\n            command = new SqlCommand(sensitiveConcatQuery);                                             // Noncompliant [6]\n\n            command.CommandText = sensitiveConcatQuery;                                                 // Noncompliant [7]\n\n            string stillSensitiveConcat = sensitiveConcatQuery;                                         // Secondary [8] {{SQL query is assigned to stillSensitiveConcat.}}\n            command.CommandText = stillSensitiveConcat;                                                 // Noncompliant [8]\n\n            SqlDataAdapter adapter;\n            adapter = new SqlDataAdapter(sensitiveQuery, connection);                                   // Noncompliant [4]\n\n            command = new SqlCommand(\"SELECT * FROM Table1 WHERE col1 = '\" + param + \"'\");              // Noncompliant\n            command.CommandText = \"SELECT * FROM Table1 WHERE col1 = '\" + param + \"'\";                  // Noncompliant\n\n            string x = null;\n            x = string.Format(\"INSERT INTO Users (name) VALUES (\\\"{0}\\\")\", param);                      // Secondary ^13#1 [9] {{SQL Query is dynamically formatted and assigned to x.}}\n            command.CommandText = x;                                                                    // Noncompliant    [9]\n\n            string y;\n            y = sensitiveQuery;                                                                         // Secondary ^13#1 [5] {{SQL query is assigned to y.}}\n            command.CommandText = y;                                                                    // Noncompliant    [5]\n        }\n\n        public void DbCommand_CommandText(DbCommand command, string param)\n        {\n            command.CommandText = string.Format(\"INSERT INTO Users (name) VALUES (\\\"{0}\\\")\", param);    // Noncompliant\n        }\n\n        public void IDbCommand_CommandText(IDbCommand command, string param)\n        {\n            command.CommandText = string.Format(\"INSERT INTO Users (name) VALUES (\\\"{0}\\\")\", param);    // Noncompliant\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/9602\n    class Repro_9602\n    {\n        public void ConstantQuery(SqliteConnection connection, bool onlyEnabled)\n        {\n            string query = \"SELECT id FROM users\";\n            if(onlyEnabled)\n                query += \" WHERE enabled = 1\";\n            string query2 = $\"SELECT id FROM users {(onlyEnabled ? \"WHERE enabled = 1\" : \"\")}\"; // Secondary [c2, c3]\n\n            var command = new SqliteCommand(query, connection);  // Compliant\n            command.CommandText = query;    // Compliant\n\n            var command2 = new SqliteCommand(query2, connection);  // Noncompliant [c2] - FP\n            command2.CommandText = query2;    // Noncompliant [c3] - FP\n\n            var command3 = new SqliteCommand($\"SELECT id FROM users {(onlyEnabled ? \"WHERE enabled = 1\" : \"\")}\", connection);  // Noncompliant - FP\n            command3.CommandText = $\"SELECT id FROM users {(onlyEnabled ? \"WHERE enabled = 1\" : \"\")}\";    // Noncompliant - FP\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/ExecutingSqlQueries.Net46.vb",
    "content": "﻿Imports System\nImports System.Data\nImports System.Data.SqlClient\nImports System.Data.Odbc\nImports System.Data.OracleClient\nImports System.Data.SqlServerCe\nImports MySql.Data.MySqlClient\nImports MSSqlite = Microsoft.Data.Sqlite\nImports SystemSqlite = System.Data.SQLite\n\nNamespace Tests.Diagnostics\n    Class Program\n        Private Const ConstantQuery As String = \"\"\n\n        Public Sub SqlCommands(ByVal connection As SqlConnection, ByVal transaction As SqlTransaction, ByVal query As String)\n            Dim command As SqlCommand\n            command = New SqlCommand() ' Compliant\n            command = New SqlCommand(\"\") ' Compliant\n            command = New SqlCommand(ConstantQuery) ' Compliant\n            command = New SqlCommand(query) '  Compliant, not concat or format\n            command = New SqlCommand(query, connection) ' Compliant, not concat or format\n            command = New SqlCommand(\"\", connection) ' Compliant, constant queries are safe\n            command = New SqlCommand(query, connection, transaction) ' Compliant, not concat or format\n            command = New SqlCommand(\"\", connection, transaction) ' Compliant, constant queries are safe\n            command = New SqlCommand(query, connection, transaction, SqlCommandColumnEncryptionSetting.Enabled) ' Compliant, not concat or format\n            command = New SqlCommand(\"\", connection, transaction, SqlCommandColumnEncryptionSetting.Enabled) ' Compliant, constant queries are safe\n\n            command.CommandText = query ' Compliant, not concat or format\n            command.CommandText = ConstantQuery ' Compliant\n            Dim text As String\n            text = command.CommandText ' Compliant\n            Dim adapter As SqlDataAdapter\n            adapter = New SqlDataAdapter() ' Compliant\n            adapter = New SqlDataAdapter(command) ' Compliant\n            adapter = New SqlDataAdapter(query, \"\") ' Compliant, not concat or format\n            adapter = New SqlDataAdapter(query, connection) ' Compliant, not concat or format\n        End Sub\n\n        Public Sub NonCompliant_Concat_SqlCommands(ByVal connection As SqlConnection, ByVal transaction As SqlTransaction, ByVal query As String, ByVal param As String)\n            Dim command = New SqlCommand(String.Concat(query, param)) ' Noncompliant {{Make sure using a dynamically formatted SQL query is safe here.}}\n            '             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            command = New SqlCommand(query & param, connection) ' Noncompliant\n            command = New SqlCommand(query + param, connection) ' Noncompliant\n            command = New SqlCommand(query + param & param, connection) ' Noncompliant\n            command = New SqlCommand(query & param + param, connection) ' Noncompliant\n            command = New SqlCommand(\"\" & 1 & 2, connection) ' Compliant, only constants\n            command = New SqlCommand(\"\" + 1 + 2, connection) ' Compliant, only constants\n            command = New SqlCommand(\"\" & 1 + 2, connection) ' Compliant, only constants\n            command = New SqlCommand(\"\" + 1 & 2, connection) ' Compliant, only constants\n            command = New SqlCommand(String.Concat(query, param), connection) ' Noncompliant\n            command = New SqlCommand(String.Concat(query, param), connection, transaction) ' Noncompliant\n            command = New SqlCommand(String.Concat(query, param), connection, transaction, SqlCommandColumnEncryptionSetting.Enabled) ' Noncompliant\n            Dim x As Integer = 1\n            Dim g As Guid = Guid.NewGuid()\n            Dim dateTime As DateTime = DateTime.Now\n            command = New SqlCommand(String.Format(\"INSERT INTO Users (name) VALUES (\"\"{0}\"\", \"\"{2}\"\", \"\"{3}\"\")\", x, g, dateTime), connection, transaction, SqlCommandColumnEncryptionSetting.Enabled) ' Noncompliant - scalars can be dangerous and lead to expensive queries\n            command = New SqlCommand(String.Format(\"INSERT INTO Users (name) VALUES (\"\"{0}\"\", \"\"{2}\"\", \"\"{3}\"\")\", x, param, dateTime), connection, transaction, SqlCommandColumnEncryptionSetting.Enabled) ' Noncompliant\n            command.CommandText = String.Concat(query, param) ' Noncompliant ^13#19\n            Dim adapter = New SqlDataAdapter(String.Concat(query, param), \"\") ' Noncompliant\n        End Sub\n\n        Public Sub NonCompliant_Format_SqlCommands(ByVal connection As SqlConnection, ByVal transaction As SqlTransaction, ByVal param As String)\n            Dim command = New SqlCommand(String.Format(\"INSERT INTO Users (name) VALUES (\"\"{0}\"\")\", param)) ' Noncompliant\n            command = New SqlCommand(String.Format(\"INSERT INTO Users (name) VALUES (\"\"{0}\"\")\", param), connection) ' Noncompliant\n            command = New SqlCommand(String.Format(\"INSERT INTO Users (name) VALUES (\"\"{0}\"\")\", param), connection, transaction) ' Noncompliant\n            command = New SqlCommand(String.Format(\"INSERT INTO Users (name) VALUES (\"\"{0}\"\")\", param), connection, transaction, SqlCommandColumnEncryptionSetting.Enabled) ' Noncompliant\n            command.CommandText = String.Format(\"INSERT INTO Users (name) VALUES (\"\"{0}\"\")\", param) ' Noncompliant\n            Dim adapter = New SqlDataAdapter(String.Format(\"INSERT INTO Users (name) VALUES (\"\"{0}\"\")\", param), \"\") ' Noncompliant\n        End Sub\n\n        Public Sub NonCompliant_Interpolation_SqlCommands(ByVal connection As SqlConnection, ByVal transaction As SqlTransaction, ByVal param As String)\n            Dim command = New SqlCommand(\"SELECT * FROM mytable WHERE mycol=\" & param) ' Noncompliant\n            command = New SqlCommand($\"SELECT * FROM mytable WHERE mycol={param}\", connection, transaction, SqlCommandColumnEncryptionSetting.Enabled) ' Noncompliant\n            command.CommandText = \"SELECT * FROM mytable WHERE mycol=\" & param ' Noncompliant\n            Dim adapter = New SqlDataAdapter(\"SELECT * FROM mytable WHERE mycol=\" & param, \"\") ' Noncompliant\n        End Sub\n\n        Public Sub OdbcCommands(ByVal connection As OdbcConnection, ByVal transaction As OdbcTransaction, ByVal query As String)\n            Dim command As OdbcCommand\n            command = New OdbcCommand() ' Compliant\n            command = New OdbcCommand(\"\") ' Compliant\n            command = New OdbcCommand(ConstantQuery) ' Compliant\n            command = New OdbcCommand(query) ' Compliant\n            command = New OdbcCommand(query, connection) ' Compliant\n            command = New OdbcCommand(query, connection, transaction) ' Compliant\n            command.CommandText = query ' Compliant\n            command.CommandText = ConstantQuery ' Compliant\n            Dim text As String\n            text = command.CommandText ' Compliant\n            Dim adapter As OdbcDataAdapter\n            adapter = New OdbcDataAdapter() ' Compliant\n            adapter = New OdbcDataAdapter(command) ' Compliant\n            adapter = New OdbcDataAdapter(query, $\"concatenated connection string {query}\") ' Compliant\n            adapter = New OdbcDataAdapter(query, connection) ' Compliant\n        End Sub\n\n        Public Sub NonCompliant_OdbcCommands(ByVal connection As SqlConnection, ByVal transaction As SqlTransaction, ByVal query As String, ByVal param As String)\n            Dim command = New OdbcCommand(String.Concat(query, param)) ' Noncompliant\n            command.CommandText = String.Concat(query, param) ' Noncompliant\n            command.CommandText = \"SELECT * FROM mytable WHERE mycol=\" & param ' Noncompliant\n            command.CommandText = $\"SELECT * FROM mytable WHERE mycol={param}\" ' Noncompliant\n            Dim adapter = New OdbcDataAdapter(String.Format(\"INSERT INTO Users (name) VALUES (\"\"{0}\"\")\", param), \"\") ' Noncompliant\n            Dim adapter1 = New odbcdataadapter(sTRing.foRmAt(\"INSERT INTO Users (name) VALUES (\"\"{0}\"\")\", param), \"\") ' Noncompliant\n        End Sub\n\n        Public Sub OracleCommands(ByVal connection As OracleConnection, ByVal transaction As OracleTransaction, ByVal query As String)\n            Dim command As OracleCommand\n            command = New OracleCommand() ' Compliant\n            command = New OracleCommand(\"\") ' Compliant\n            command = New OracleCommand(ConstantQuery) ' Compliant\n            command = New OracleCommand(query) ' Compliant\n            command = New OracleCommand(query, connection) ' Compliant\n            command = New OracleCommand(query, connection, transaction) ' Compliant\n            command.CommandText = query ' Compliant\n            command.CommandText = ConstantQuery ' Compliant\n            Dim text As String\n            text = command.CommandText\n            Dim adapter As OracleDataAdapter\n            adapter = New OracleDataAdapter() ' Compliant\n            adapter = New OracleDataAdapter(command) ' Compliant\n            adapter = New OracleDataAdapter(query, $\"concatenated connection string {query}\") ' Compliant\n            adapter = New OracleDataAdapter(query, connection) ' Compliant\n        End Sub\n\n        Public Sub NonCompliant_OracleCommands(ByVal connection As OracleConnection, ByVal transaction As OracleTransaction, ByVal query As String, ByVal param As String)\n            Dim command = New OracleCommand(\"SELECT * FROM mytable WHERE mycol=\" & param) ' Noncompliant\n            command.CommandText = String.Format(\"INSERT INTO Users (name) VALUES (\"\"{0}\"\")\", param) ' Noncompliant\n            command.CommandText = string.forMAT(\"INSERT INTO Users (name) VALUES (\"\"{0}\"\")\", param) ' Noncompliant\n            Dim x = New OracleDataAdapter(String.Format(\"INSERT INTO Users (name) VALUES (\"\"{0}\"\")\", param), \"\") ' Noncompliant\n            x = New OracleDataAdapter($\"INSERT INTO Users (name) VALUES (\"\"{param}\"\")\", \"\") ' Noncompliant\n        End Sub\n\n        Public Sub SqlServerCeCommands(ByVal connection As SqlCeConnection, ByVal transaction As SqlCeTransaction, ByVal query As String)\n            Dim command As SqlCeCommand\n            command = New SqlCeCommand() ' Compliant\n            command = New SqlCeCommand(\"\") ' Compliant\n            command = New SqlCeCommand(ConstantQuery) ' Compliant\n            command = New SqlCeCommand(query) ' Compliant\n            command = New SqlCeCommand(query, connection) ' Compliant\n            command = New SqlCeCommand(query, connection, transaction) ' Compliant\n            command.CommandText = query ' Compliant\n            command.CommandText = ConstantQuery ' Compliant\n            Dim text As String\n            text = command.CommandText ' Compliant\n            Dim adapter As SqlCeDataAdapter\n            adapter = New SqlCeDataAdapter() ' Compliant\n            adapter = New SqlCeDataAdapter(command) ' Compliant\n            adapter = New SqlCeDataAdapter(query, string.Concat(\"concatenated connection string\", query)) ' Compliant\n            adapter = New SqlCeDataAdapter(query, connection) ' Compliant\n        End Sub\n\n        Public Sub NonCompliant_SqlCeCommands(ByVal connection As SqlCeConnection, ByVal transaction As SqlCeTransaction, ByVal query As String, ByVal param As String)\n            Dim x = New SqlCeDataAdapter(String.Concat(query, param), \"\") ' Noncompliant\n            Dim command = New SqlCeCommand(\"\" & param) ' Noncompliant\n            command.CommandText = String.Format(\"INSERT INTO Users (name) VALUES (\"\"{0}\"\")\", param) ' Noncompliant\n        End Sub\n\n        Public Sub MySqlDataCompliant(ByVal connection As MySqlConnection, ByVal transaction As MySqlTransaction, ByVal query As String)\n            Dim command As MySqlCommand\n            command = New MySqlCommand()                                                ' Compliant\n            command = New MySqlCommand(\"\")                                              ' Compliant\n            command = New MySqlCommand(query, connection, transaction)                  ' Compliant\n\n            command.CommandText = query                                                 ' Compliant\n            command.CommandText = ConstantQuery                                         ' Compliant\n            Dim text As String\n            text = command.CommandText                                                  ' Compliant\n\n            Dim adapter As MySqlDataAdapter\n            adapter = New MySqlDataAdapter(\"\", connection)                              ' Compliant\n            adapter = New MySqlDataAdapter(ConstantQuery, \"connectionString\")           ' Compliant\n\n            MySqlHelper.ExecuteDataRow($\"concatenated connection string = {query}\", ConstantQuery)    ' Compliant\n        End Sub\n\n        Public Sub NonCompliant_MySqlData(ByVal connection As MySqlConnection, ByVal transaction As MySqlTransaction, ByVal query As String, ByVal param As String)\n            Dim command As MySqlCommand\n            command = New MySqlCommand($\"SELECT * FROM mytable WHERE mycol={param}\")                               ' Noncompliant\n            command = New MySqlCommand($\"SELECT * FROM mytable WHERE mycol={param}\", connection)                   ' Noncompliant\n            command = New MySqlCommand($\"SELECT * FROM mytable WHERE mycol={param}\", connection, transaction)      ' Noncompliant\n            command.CommandText = String.Format(\"INSERT INTO Users (name) VALUES (\"\"{0}\"\")\", param)                ' Noncompliant\n\n            Dim adapter As MySqlDataAdapter\n            adapter = New MySqlDataAdapter($\"SELECT * FROM mytable WHERE mycol=\" + param, connection)              ' Noncompliant\n\n            MySqlHelper.ExecuteDataRow(\"connectionString\", $\"SELECT * FROM mytable WHERE mycol={param}\")           ' Noncompliant\n            MySqlHelper.ExecuteDataRowAsync(\"connectionString\", $\"SELECT * FROM mytable WHERE mycol={param}\")      ' Noncompliant\n            MySqlHelper.ExecuteDataRowAsync(\"connectionString\", $\"SELECT * FROM mytable WHERE mycol={param}\", New System.Threading.CancellationToken())     ' Noncompliant\n            MySqlHelper.ExecuteDataset(\"connectionString\", $\"SELECT * FROM mytable WHERE mycol={param}\")           ' Noncompliant\n            MySqlHelper.ExecuteDatasetAsync(\"connectionString\", $\"SELECT * FROM mytable WHERE mycol={param}\")      ' Noncompliant\n            MySqlHelper.ExecuteNonQuery(\"connectionString\", $\"SELECT * FROM mytable WHERE mycol={param}\")          ' Noncompliant\n            MySqlHelper.ExecuteNonQueryAsync(connection, $\"SELECT * FROM mytable WHERE mycol={param}\")             ' Noncompliant\n            MySqlHelper.ExecuteReader(connection, $\"SELECT * FROM mytable WHERE mycol={param}\")                    ' Noncompliant\n            MySqlHelper.ExecuteReaderAsync(connection, $\"SELECT * FROM mytable WHERE mycol={param}\")               ' Noncompliant\n            MySqlHelper.ExecuteScalar(connection, $\"SELECT * FROM mytable WHERE mycol={param}\")                    ' Noncompliant\n            MySqlHelper.ExecuteScalarAsync(connection, $\"SELECT * FROM mytable WHERE mycol={param}\")               ' Noncompliant\n            MySqlHelper.UpdateDataSet(\"connectionString\", $\"SELECT * FROM mytable WHERE mycol={param}\", New DataSet(), \"tableName\")                         ' Noncompliant\n            MySqlHelper.UpdateDataSetAsync(\"connectionString\", $\"SELECT * FROM mytable WHERE mycol={param}\", New DataSet(), \"tableName\")                    ' Noncompliant\n\n            Dim script As MySqlScript\n            script = New MySqlScript($\"SELECT * FROM mytable WHERE mycol={param}\")                                 ' Noncompliant\n            script = New MySqlScript(connection, $\"SELECT * FROM mytable WHERE mycol={param}\")                     ' Noncompliant\n        End Sub\n\n        Public Sub MicrosoftDataSqliteCompliant(ByVal connection As MSSqlite.SqliteConnection, ByVal query As String)\n            Dim command As MSSqlite.SqliteCommand\n            command = New MSSqlite.SqliteCommand()      ' Compliant\n            command = New MSSqlite.SqliteCommand(\"\")    ' Compliant\n            command.CommandText = ConstantQuery         ' Compliant\n\n            command.CommandText = query                 ' Compliant\n        End Sub\n\n        Public Sub NonCompliant_MicrosoftDataSqlite(ByVal connection As MSSqlite.SqliteConnection, ByVal query As String, ByVal param As String)\n            Dim command As MSSqlite.SqliteCommand\n            command = New MSSqlite.SqliteCommand($\"SELECT * FROM mytable WHERE mycol={param}\", connection)  ' Noncompliant\n            command.CommandText = String.Format(\"INSERT INTO Users (name) VALUES (\"\"{0}\"\")\", param)         ' Noncompliant\n        End Sub\n\n        Public Sub SystemDataSqliteCompliant(ByVal connection As SystemSqlite.SQLiteConnection, ByVal transaction As SystemSqlite.SQLiteTransaction, ByVal query As String)\n            Dim command As SystemSqlite.SQLiteCommand\n            command = New SystemSqlite.SQLiteCommand()                                  ' Compliant\n            command = New SystemSqlite.SQLiteCommand(\"\")                                ' Compliant\n            command = New SystemSqlite.SQLiteCommand(query, connection, transaction)    ' Compliant\n\n            command.CommandText = query                                                 ' Compliant\n            command.CommandText = ConstantQuery                                         ' Compliant\n            Dim Text As String\n            Text = command.CommandText                                                  ' Compliant\n            Text = command.CommandText = query                                          ' Compliant\n            SystemSqlite.SQLiteCommand.Execute(\"SELECT * FROM mytable WHERE mycol={param}\", SystemSqlite.SQLiteExecuteType.None, $\"connectionString={query}\")   ' Compliant\n        End Sub\n\n        Public Sub NonCompliant_SystemDataSqlite(ByVal connection As SystemSqlite.SqliteConnection, ByVal transaction As SystemSqlite.SQLiteTransaction, ByVal query As String, ByVal param As String)\n            Dim command As SystemSqlite.SQLiteCommand\n            command = New SystemSqlite.SQLiteCommand($\"SELECT * FROM mytable WHERE mycol={param}\")                                                      ' Noncompliant\n            command = New SystemSqlite.SQLiteCommand($\"SELECT * FROM mytable WHERE mycol={param}\", connection)                                          ' Noncompliant\n            command = New SystemSqlite.SQLiteCommand($\"SELECT * FROM mytable WHERE mycol={param}\", connection, transaction)                             ' Noncompliant\n            command.CommandText = String.Format(\"INSERT INTO Users (name) VALUES (\"\"{0}\"\")\", param)                                                     ' Noncompliant\n\n            Dim adapter As SystemSqlite.SQLiteDataAdapter\n            adapter = New SystemSqlite.SQLiteDataAdapter($\"SELECT * FROM mytable WHERE mycol={param}\", connection)                                      ' Noncompliant\n            SystemSqlite.SQLiteCommand.Execute($\"SELECT * FROM mytable WHERE mycol={param}\", SystemSqlite.SQLiteExecuteType.None, \"connectionString\")   ' Noncompliant\n        End Sub\n\n        Public Sub ConcatAndStringFormat(ByVal connection As SqlConnection, ByVal param As String)\n            Dim sensitiveQuery As String = String.Format(\"INSERT INTO Users (name) VALUES (\"\"{0}\"\")\", param)    ' Secondary [1,2,3,4] {{SQL Query is dynamically formatted and assigned to sensitiveQuery.}}\n            '   ^^^^^^^^^^^^^^\n            Dim command = New SqlCommand(sensitiveQuery)                                                        ' Noncompliant [1]\n            command.CommandText = sensitiveQuery                                                                ' Noncompliant [2]\n\n            Dim stillSensitive As String = sensitiveQuery                                                       ' Secondary [3] {{SQL query is assigned to stillSensitive.}}\n            '   ^^^^^^^^^^^^^^\n            command.CommandText = stillSensitive                                                                ' Noncompliant ^13#19 [3]\n\n            Dim sensitiveConcatQuery As String = \"SELECT * FROM Table1 WHERE col1 = '\" + param + \"'\"            ' Secondary [5,6,7] {{SQL Query is dynamically formatted and assigned to sensitiveConcatQuery.}}\n\n            command = New SqlCommand(sensitiveConcatQuery)                                                      ' Noncompliant [5]\n            command.CommandText = sensitiveConcatQuery                                                          ' Noncompliant [6]\n\n            Dim stillSensitiveConcat As String = sensitiveConcatQuery                                           ' Secondary    [7] {{SQL query is assigned to stillSensitiveConcat.}}\n            command.CommandText = stillSensitiveConcat                                                          ' Noncompliant [7]\n\n            Dim sensitiveConcatQuery2 As String = \"SELECT * FROM Table1 WHERE col1 = '\" & param & \"'\"           ' Secondary    [8,9,10] {{SQL Query is dynamically formatted and assigned to sensitiveConcatQuery2.}}\n            command = New SqlCommand(sensitiveConcatQuery2)                                                     ' Noncompliant [8]\n            command.CommandText = sensitiveConcatQuery2                                                         ' Noncompliant [9]\n\n            Dim stillSensitiveConcat2 As String = sensitiveConcatQuery2                                         ' Secondary ^17#21 [10] {{SQL query is assigned to stillSensitiveConcat2.}}\n            command.CommandText = stillSensitiveConcat2                                                         ' Noncompliant     [10]\n\n            Dim x As String\n            x = String.Format(\"INSERT INTO Users (name) VALUES (\"\"{0}\"\")\", param)                               ' Secondary ^13#1 {{SQL Query is dynamically formatted and assigned to x.}}\n            command.CommandText = x                                                                             ' Noncompliant\n\n            Dim y As String\n            y = sensitiveQuery                                                                                  ' Secondary ^13#1 [4] {{SQL query is assigned to y.}}\n            command.CommandText = y                                                                             ' Noncompliant    [4]\n        End Sub\n    End Class\n\n    ' https://github.com/SonarSource/sonar-dotnet/issues/9602\n    Class Repro_9602\n        Public Sub ConstantBuiltQuery(connection As MSSqlite.SqliteConnection, onlyEnabled As Boolean)\n            Dim query As String = \"SELECT id FROM users\"\n            If onlyEnabled Then\n                query += \" WHERE enabled = 1\"\n            End If\n            Dim query2 As String = $\"SELECT id FROM users {(If(onlyEnabled, \"WHERE enabled = 1\", \"\"))}\" ' Secondary [c2, c3]\n\n            Dim command As New MSSqlite.SqliteCommand(query, connection)  ' Compliant\n            command.CommandText = query    ' Compliant\n\n            Dim command2 As New MSSqlite.SqliteCommand(query2, connection)  ' Noncompliant [c2] - FP\n            command2.CommandText = query2    ' Noncompliant [c3] - FP\n\n            Dim command3 As New MSSqlite.SqliteCommand($\"SELECT id FROM users {(If(onlyEnabled, \"WHERE enabled = 1\", \"\"))}\", connection)  ' Noncompliant - FP\n            command3.CommandText = $\"SELECT id FROM users {(If(onlyEnabled, \"WHERE enabled = 1\", \"\"))}\"    ' Noncompliant - FP\n        End Sub\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/ExecutingSqlQueries.OracleManagedDataAccess.cs",
    "content": "using Oracle.ManagedDataAccess.Client;\n\nnamespace Tests.Diagnostics\n{\n    class OracleManagedDataAccessTest\n    {\n        public void OracleCommand_Compliant(OracleConnection connection, string query)\n        {\n            new OracleCommand(\"SELECT * FROM table\");\n            new OracleCommand(\"SELECT * FROM table\", connection);\n\n            var command = new OracleCommand();\n            command.CommandText = \"SELECT * FROM table\";\n        }\n\n        public void OracleCommand_Noncompliant(OracleConnection connection, string userInput)\n        {\n            new OracleCommand($\"SELECT * FROM table WHERE id = '{userInput}'\"); // Noncompliant\n            new OracleCommand($\"SELECT * FROM table WHERE id = '{userInput}'\", connection); // Noncompliant\n            new OracleCommand(\"SELECT * FROM table WHERE id = '\" + userInput + \"'\"); // Noncompliant\n            new OracleCommand(string.Format(\"SELECT * FROM table WHERE id = '{0}'\", userInput), connection); // Noncompliant\n            new OracleCommand(string.Concat(\"SELECT * FROM table WHERE id = '\", userInput, \"'\"), connection); // Noncompliant\n\n            var command = new OracleCommand();\n            command.CommandText = $\"SELECT * FROM table WHERE id = '{userInput}'\"; // Noncompliant\n            command.CommandText = \"SELECT * FROM table WHERE id = '\" + userInput + \"'\"; // Noncompliant\n            command.CommandText = string.Format(\"SELECT * FROM table WHERE id = '{0}'\", userInput); // Noncompliant\n            command.CommandText = string.Concat(\"SELECT * FROM table WHERE id = '\", userInput, \"'\"); // Noncompliant\n        }\n\n        public void OracleCommand_VariableAssignment(OracleConnection connection, string userInput)\n        {\n            string query = $\"SELECT * FROM table WHERE id = '{userInput}'\"; // Secondary [1, 2, 3]\n            new OracleCommand(query); // Noncompliant [1]\n            new OracleCommand(query, connection); // Noncompliant [2]\n\n            var command = new OracleCommand();\n            command.CommandText = query; // Noncompliant [3]\n\n            string constQuery = \"SELECT * FROM table\";\n            new OracleCommand(constQuery);\n            command.CommandText = constQuery;\n        }\n\n        public void OracleDataAdapter_Compliant(OracleConnection connection, string query)\n        {\n            new OracleDataAdapter(\"SELECT * FROM table\", connection);\n        }\n\n        public void OracleDataAdapter_Noncompliant(OracleConnection connection, string userInput)\n        {\n            new OracleDataAdapter($\"SELECT * FROM table WHERE id = '{userInput}'\", connection); // Noncompliant\n            new OracleDataAdapter(\"SELECT * FROM table WHERE id = '\" + userInput + \"'\", connection); // Noncompliant\n            new OracleDataAdapter(string.Format(\"SELECT * FROM table WHERE id = '{0}'\", userInput), connection); // Noncompliant\n        }\n\n        public void OracleDataAdapter_VariableAssignment(OracleConnection connection, string userInput)\n        {\n            string query = $\"SELECT * FROM table WHERE id = '{userInput}'\"; // Secondary\n            new OracleDataAdapter(query, connection); // Noncompliant\n\n            string constQuery = \"SELECT * FROM table\";\n            new OracleDataAdapter(constQuery, connection);\n        }\n    }\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/ExecutingSqlQueries.OrmLite.cs",
    "content": "﻿using System;\nusing System.Data;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing ServiceStack.OrmLite;\n\nclass Program\n{\n    public void OrmLiteReadApiMethods(IDbConnection dbConn, string query, string param)\n    {\n        dbConn.Select<Entity>(query);                                                                         // Compliant\n        dbConn.Select<Entity>(query + param);                                                                 // Noncompliant\n        dbConn.Select<Entity>(typeof(Program), query + param, new { a = 1 });                                 // Noncompliant\n        OrmLiteReadApi.Select<Entity>(dbConn, typeof(Program), query + param, new { a = 1 });                 // FN. string argument is in the thrid position if this overload is called in the unreduced form.\n\n        dbConn.SelectLazy<Entity>(query);                                                                     // Compliant\n        dbConn.SelectLazy<Entity>(query + param);                                                             // Noncompliant\n        OrmLiteReadApi.SelectLazy<Entity>(dbConn, query + param);                                             // Noncompliant\n\n        dbConn.SelectNonDefaults(query, new Entity { Age = 42 });                                             // Compliant\n        dbConn.SelectNonDefaults(query + param, new Entity { Age = 42 });                                     // Noncompliant\n        OrmLiteReadApi.SelectNonDefaults(dbConn, query + param, new Entity { Age = 42 });                     // Noncompliant\n\n        dbConn.Single<Entity>(query);                                                                         // Compliant\n        dbConn.Single<Entity>(query + param);                                                                 // Noncompliant\n        OrmLiteReadApi.Single<Entity>(dbConn, query + param, new { Age = 42 });                               // Noncompliant\n\n        dbConn.Scalar<Entity>(query);                                                                         // Compliant\n        dbConn.Scalar<Entity>(query + param);                                                                 // Noncompliant\n        OrmLiteReadApi.Scalar<Entity>(dbConn, query + param, new { Age = 42 });                               // Noncompliant\n\n        dbConn.Column<Entity>(query);                                                                         // Compliant\n        dbConn.Column<Entity>(query + param);                                                                 // Noncompliant\n        OrmLiteReadApi.Column<Entity>(dbConn, query + param, new { Age = 42 });                               // Noncompliant\n\n        dbConn.ColumnLazy<Entity>(query);                                                                     // Compliant\n        dbConn.ColumnLazy<Entity>(query + param);                                                             // Noncompliant\n        OrmLiteReadApi.ColumnLazy<Entity>(dbConn, query + param, new { Age = 42 });                           // Noncompliant\n\n        dbConn.ColumnDistinct<Entity>(query);                                                                 // Compliant\n        dbConn.ColumnDistinct<Entity>(query + param);                                                         // Noncompliant\n        OrmLiteReadApi.ColumnDistinct<Entity>(dbConn, query + param, new { Age = 42 });                       // Noncompliant\n\n        dbConn.Lookup<string, Entity>(query);                                                                 // Compliant\n        dbConn.Lookup<string, Entity>(query + param);                                                         // Noncompliant\n        OrmLiteReadApi.Lookup<string, Entity>(dbConn, query + param, new { Age = 42 });                       // Noncompliant\n\n        dbConn.Dictionary<string, Entity>(query);                                                             // Compliant\n        dbConn.Dictionary<string, Entity>(query + param);                                                     // Noncompliant\n        OrmLiteReadApi.Dictionary<string, Entity>(dbConn, query + param, new { Age = 42 });                   // Noncompliant\n\n        dbConn.Exists<Entity>(query);                                                                         // Compliant\n        dbConn.Exists<Entity>(query + param);                                                                 // Noncompliant\n        OrmLiteReadApi.Exists<Entity>(dbConn, query + param, new { Age = 42 });                               // Noncompliant\n\n        dbConn.SqlList<Entity>(query);                                                                        // Compliant\n        dbConn.SqlList<Entity>(query + param);                                                                // Noncompliant\n        OrmLiteReadApi.SqlList<Entity>(dbConn, query + param, new { Age = 42 });                              // Noncompliant\n\n        dbConn.SqlColumn<Entity>(query);                                                                      // Compliant\n        dbConn.SqlColumn<Entity>(query + param);                                                              // Noncompliant\n        OrmLiteReadApi.SqlColumn<Entity>(dbConn, query + param, new { Age = 42 });                            // Noncompliant\n\n        dbConn.SqlScalar<Entity>(query);                                                                      // Compliant\n        dbConn.SqlScalar<Entity>(query + param);                                                              // Noncompliant\n        OrmLiteReadApi.SqlScalar<Entity>(dbConn, query + param, new { Age = 42 });                            // Noncompliant\n\n        dbConn.ExecuteNonQuery(query);                                                                        // Compliant\n        dbConn.ExecuteNonQuery(query + param);                                                                // Noncompliant\n        OrmLiteReadApi.ExecuteNonQuery(dbConn, query + param, new { Age = 42 });                              // Noncompliant\n    }\n\n    public async Task OrmLiteReadApiAsyncMethods(IDbConnection dbConn, string query, string param)\n    {\n        await dbConn.SelectAsync<Entity>(query);                                                              // Compliant\n        await dbConn.SelectAsync<Entity>(query + param);                                                      // Noncompliant\n        await dbConn.SelectAsync<Entity>(typeof(Program), query + param, new { a = 1 });                      // Noncompliant\n        await OrmLiteReadApiAsync.SelectAsync<Entity>(dbConn, typeof(Program), query + param, new { a = 1 }); // FN. string argument is in the thrid position if this overload is called in the unreduced form.\n\n        await dbConn.SelectNonDefaultsAsync(query, new Entity { Age = 42 });                                  // Compliant\n        await dbConn.SelectNonDefaultsAsync(query + param, new Entity { Age = 42 });                          // Noncompliant\n        await OrmLiteReadApiAsync.SelectNonDefaultsAsync(dbConn, query + param, new Entity { Age = 42 });     // Noncompliant\n\n        await dbConn.SingleAsync<Entity>(query);                                                              // Compliant\n        await dbConn.SingleAsync<Entity>(query + param);                                                      // Noncompliant\n        await OrmLiteReadApiAsync.SingleAsync<Entity>(dbConn, query + param, new { Age = 42 });               // Noncompliant\n\n        await dbConn.ScalarAsync<Entity>(query);                                                              // Compliant\n        await dbConn.ScalarAsync<Entity>(query + param);                                                      // Noncompliant\n        OrmLiteReadApiAsync.ScalarAsync<Entity>(dbConn, query + param, new { Age = 42 });                     // Noncompliant\n\n        await dbConn.ColumnAsync<Entity>(query);                                                              // Compliant\n        await dbConn.ColumnAsync<Entity>(query + param);                                                      // Noncompliant\n        OrmLiteReadApiAsync.ColumnAsync<Entity>(dbConn, query + param, new { Age = 42 });                     // Noncompliant\n\n        await dbConn.ColumnDistinctAsync<Entity>(query);                                                      // Compliant\n        await dbConn.ColumnDistinctAsync<Entity>(query + param);                                              // Noncompliant\n        OrmLiteReadApiAsync.ColumnDistinctAsync<Entity>(dbConn, query + param, new { Age = 42 });             // Noncompliant\n\n        await dbConn.LookupAsync<string, Entity>(query);                                                      // Compliant\n        await dbConn.LookupAsync<string, Entity>(query + param);                                              // Noncompliant\n        OrmLiteReadApiAsync.LookupAsync<string, Entity>(dbConn, query + param, new { Age = 42 });             // Noncompliant\n\n        await dbConn.DictionaryAsync<string, Entity>(query);                                                  // Compliant\n        await dbConn.DictionaryAsync<string, Entity>(query + param);                                          // Noncompliant\n        OrmLiteReadApiAsync.DictionaryAsync<string, Entity>(dbConn, query + param, new { Age = 42 });         // Noncompliant\n\n        await dbConn.ExistsAsync<Entity>(query);                                                              // Compliant\n        await dbConn.ExistsAsync<Entity>(query + param);                                                      // Noncompliant\n        OrmLiteReadApiAsync.ExistsAsync<Entity>(dbConn, query + param, new { Age = 42 });                     // Noncompliant\n\n        await dbConn.SqlListAsync<Entity>(query);                                                             // Compliant\n        await dbConn.SqlListAsync<Entity>(query + param);                                                     // Noncompliant\n        OrmLiteReadApiAsync.SqlListAsync<Entity>(dbConn, query + param, new { Age = 42 });                    // Noncompliant\n\n        await dbConn.SqlColumnAsync<Entity>(query);                                                           // Compliant\n        await dbConn.SqlColumnAsync<Entity>(query + param);                                                   // Noncompliant\n        OrmLiteReadApiAsync.SqlColumnAsync<Entity>(dbConn, query + param, new { Age = 42 });                  // Noncompliant\n\n        await dbConn.SqlScalarAsync<Entity>(query);                                                           // Compliant\n        await dbConn.SqlScalarAsync<Entity>(query + param);                                                   // Noncompliant\n        OrmLiteReadApiAsync.SqlScalarAsync<Entity>(dbConn, query + param, new { Age = 42 });                  // Noncompliant\n\n        await dbConn.ExecuteNonQueryAsync(query);                                                             // Compliant\n        await dbConn.ExecuteNonQueryAsync(query + param);                                                     // Noncompliant\n        OrmLiteReadApiAsync.ExecuteNonQueryAsync(dbConn, query + param, new { Age = 42 });                    // Noncompliant\n    }\n}\n\nclass Entity\n{\n    public int Age { get; set; }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/ExpandingArchives.Latest.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.IO.Compression;\nusing System.Linq;\nusing System.Text;\n\nnamespace ClassLibrary1\n{\n    public class Class1\n    {\n        public void ExtractArchive(ZipArchive archive)\n        {\n            foreach (var entry in archive.Entries)\n            {\n                entry.ExtractToFileAsync(\"\");                           // Compliant FN https://sonarsource.atlassian.net/browse/NET-2879\n            }\n            for (int i = 0; i < archive.Entries.Count; i++)\n            {\n                archive.Entries[i].ExtractToFileAsync(\"\");              // Compliant FN \n            }\n            archive.Entries.ToList()\n                .ForEach(e => e.ExtractToFileAsync(\"\"));                // Compliant FN\n            ZipFileExtensions.ExtractToDirectoryAsync(archive, \"\");     // Compliant FN\n            archive.ExtractToDirectoryAsync(\"\");                        // Compliant FN\n        }\n\n        public void ExtractEntry(ZipArchiveEntry entry)\n        {\n            string fullName;\n            entry.ExtractToFileAsync(\"\");                               // Compliant FN\n            entry?.ExtractToFileAsync(\"\");                              // Compliant FN\n            entry.ExtractToFileAsync(\"\", true);                         // Compliant FN\n            ZipFileExtensions.ExtractToFileAsync(entry, \"\");            // Compliant FN\n            ZipFileExtensions.ExtractToFileAsync(entry, \"\", true);      // Compliant FN\n            ZipFile.ExtractToDirectoryAsync(\"\", \"\");                    // Compliant FN\n            ZipFile.ExtractToDirectoryAsync(\"\", \"\", Encoding.Default);  // Compliant FN\n            var stream = entry.OpenAsync();                             // Compliant, method is not tracked\n            entry.Delete();                                             // Compliant, method is not tracked\n            fullName = entry.FullName;                                  // Compliant, properties are not tracked\n            ExtractToFileAsync(entry);                                  // Compliant, method is not tracked\n        }\n        public void ExtractToFileAsync(ZipArchiveEntry entry) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/ExpandingArchives.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.IO.Compression;\nusing System.Linq;\nusing System.Text;\n\nnamespace ClassLibrary1\n{\n    public class Class1\n    {\n        public void ExtractArchive(ZipArchive archive)\n        {\n            foreach (var entry in archive.Entries)\n            {\n                entry.ExtractToFile(\"\"); // Noncompliant\n//              ^^^^^^^^^^^^^^^^^^^^^^^\n            }\n\n            for (int i = 0; i < archive.Entries.Count; i++)\n            {\n                archive.Entries[i].ExtractToFile(\"\"); // Noncompliant\n            }\n\n            archive.Entries.ToList()\n                .ForEach(e => e.ExtractToFile(\"\")); // Noncompliant\n//                            ^^^^^^^^^^^^^^^^^^^\n\n            ZipFileExtensions.ExtractToDirectory(archive, \"\"); // Noncompliant\n            archive.ExtractToDirectory(\"\"); // Noncompliant\n        }\n\n        public void ExtractEntry(ZipArchiveEntry entry)\n        {\n            string fullName;\n            Stream stream;\n\n            entry.ExtractToFile(\"\"); // Noncompliant\n            entry?.ExtractToFile(\"\"); // Noncompliant\n            entry.ExtractToFile(\"\", true); // Noncompliant\n\n            ZipFileExtensions.ExtractToFile(entry, \"\"); // Noncompliant\n            ZipFileExtensions.ExtractToFile(entry, \"\", true); // Noncompliant\n\n            ZipFile.ExtractToDirectory(\"\", \"\"); // Noncompliant\n            ZipFile.ExtractToDirectory(\"\", \"\", Encoding.Default); // Noncompliant\n\n            stream = entry.Open(); // Compliant, method is not tracked\n\n            entry.Delete(); // Compliant, method is not tracked\n\n            fullName = entry.FullName; // Compliant, properties are not tracked\n\n            ExtractToFile(entry); // Compliant, method is not tracked\n\n            Invoke(ZipFileExtensions.ExtractToFile); // Compliant, not an invocation, but could be considered as FN\n        }\n\n        public void ExtractToFile(ZipArchiveEntry entry) { }\n\n        public void Invoke(Action<ZipArchiveEntry, string> action) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/ExpandingArchives.vb",
    "content": "﻿Imports System\nImports System.IO\nImports System.IO.Compression\nImports System.Linq\nImports System.Text\n\nNamespace ClassLibrary1\n    Public Class Class1\n        Public Sub ExtractArchive(ByVal archive As ZipArchive)\n            For Each entry As ZipArchiveEntry In archive.Entries\n                entry.ExtractToFile(\"\") ' Noncompliant\n'               ^^^^^^^^^^^^^^^^^^^^^^^\n            Next\n\n            For i As Integer = 0 To archive.Entries.Count - 1\n                archive.Entries(i).ExtractToFile(\"\") ' Noncompliant\n            Next\n\n            archive.Entries.ToList().ForEach(Sub(e) e.ExtractToFile(\"\")) ' Noncompliant\n'                                                   ^^^^^^^^^^^^^^^^^^^\n\n            ZipFileExtensions.ExtractToDirectory(archive, \"\") ' Noncompliant\n            archive.ExtractToDirectory(\"\") ' Noncompliant\n        End Sub\n\n        Public Sub ExtractEntry(ByVal entry As ZipArchiveEntry)\n            Dim fullName As String\n            Dim stream As Stream\n\n            entry.ExtractToFile(\"\") ' Noncompliant\n            entry.ExtractToFile(\"\", True) ' Noncompliant\n\n            ZipFileExtensions.ExtractToFile(entry, \"\") ' Noncompliant\n            ZipFileExtensions.ExtractToFile(entry, \"\", True) ' Noncompliant\n\n            ZipFile.ExtractToDirectory(\"\", \"\") ' Noncompliant\n            ZipFile.ExtractToDirectory(\"\", \"\", Encoding.Default) ' Noncompliant\n\n            stream = entry.Open() ' Compliant, method is not tracked\n\n            entry.Delete() ' Compliant, method is not tracked\n\n            fullName = entry.FullName ' Compliant, properties are not tracked\n\n            ExtractToFile(entry) ' Compliant, method is not tracked\n        End Sub\n\n        Public Sub ExtractToFile(ByVal entry As ZipArchiveEntry)\n        End Sub\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/HardcodedIpAddress.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace CSharp10\n{\n    public class HardcodedIpAddress\n    {\n        public HardcodedIpAddress(string unknownPart, string knownPart)\n        {\n            const string part1 = \"192\";\n            const string part2 = \"168\";\n            const string part3 = \"0\";\n            const string part4 = \"1\";\n            knownPart = \"255\";\n\n            const string ip1 = $\"{part1}.{part2}.{part3}.{part4}\"; // Noncompliant\n//                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            const string nonIp = $\"{part1}:{part2}\";\n\n            string ip2 = $\"{part1}.{part2}.{part3}.{knownPart}\"; // Noncompliant\n            string ip3 = $\"{part1}.{part2}.{part3}.{unknownPart}\";\n\n            const string nestedConstInterpolation = $\"{$\"{part1}.{part2}\"}.{part3}.{part4}\"; // Noncompliant\n            string nestedInterpolation = $\"{$\"{part1}.{knownPart}\"}.{part3}.{part4}\"; // Noncompliant\n        }\n    }\n}\n\nnamespace CSharp11\n{\n    public class HardcodedIpAddress\n    {\n        public void RawStringLiterals(string unknownPart, string knownPart)\n        {\n            string ip1 = \"\"\"192.168.0.1\"\"\"; // Noncompliant {{Make sure using this hardcoded IP address '192.168.0.1' is safe here.}}\n            var ip2 = \"192.168.0.1\"u8; // Noncompliant\n            var ip3 = \"\\x31\\x39\\x32\\x2E\\x31\\x36\\x38\\x2E\\x30\\x2E\\x31\"u8; // Noncompliant - this is 192.168.0.1 in utf-8\n            var ip4 = \"\"\"192.168.0.1\"\"\"u8; // Noncompliant\n            var ip5 = \"\"\"\n                192.168.0.1\n                \"\"\"u8; // Noncompliant@-2\n        }\n\n        public void NewlinesInStringInterpolation()\n        {\n            const string s1 = \"1\";\n            const string s2 = \"\";\n            string nonCompliant = $\"192.168.0.{s1 + // Noncompliant\n                s2}\";\n            string nonCompliantRawString = $$\"\"\"192.168.0.{{s1 + // Noncompliant\n                s2}}\"\"\";\n        }\n    }\n}\n\nnamespace CSharp12\n{\n    class PrimaryConstructor(string ctorParam = \"192.168.0.1\", string ctorParam2 = $\"192.168.{\"0\"}.1\") // Noncompliant\n                                                                                                       // Noncompliant@-1\n    {\n        void Method(string methodParam = \"192.168.0.1\", string methodParam2 = $\"192.168.{\"0\"}.1\") // Noncompliant\n                                                                                                  // Noncompliant@-1\n        {\n            var lambda = (string lambdaParam = \"192.168.0.1\", string lambdaParam2 = $\"192.168.{\"0\"}.1\") => lambdaParam; // Noncompliant\n                                                                                                                        // Noncompliant@-1\n        }\n    }\n}\n\nnamespace CSharp13\n{\n    partial class Partial\n    {\n        partial string MyProperty { get; }\n        partial string MyProperty2 { get; }\n\n        public void MyMethod(string unknownPart, string knownPart)\n        {\n            _ = \"\\e192.168.0.1\";         // Compliant\n            _ = \"\\u001b192.168.0.1\";     // Compliant\n            _ = \"192\\e.168.0.1\";         // Compliant\n            _ = \"192.\\e168.0.1\";         // Compliant\n            _ = \"192.168.\\e0.1\";         // Compliant\n            _ = \"192.168.0.1\\e\";         // Compliant\n            _ = $\"{MyProperty2}168.0.1\"; // Compliant - MyProperty2 is not a constant\n        }\n    }\n\n    partial class Partial\n    {\n        partial string MyProperty => \"192.168.0.1\"; // Noncompliant\n        partial string MyProperty2 => \"192.\";\n    }\n}\n\npublic static class Extensions\n{\n    extension(string)\n    {\n        public static string NoncompliantProp => \"192.168.0.1\";     // Noncompliant\n        public static string CompliantProp => \"192.\";               // Compliant\n        public static string NoncompliantMethod() => \"192.168.0.1\"; // Noncompliant\n        public static string CompliantMethod() => \"192.\";           // Compliant\n    }\n}\n\npublic class NullConditionalAssignmnet\n{\n    public class Sample\n    {\n        public string IP { get; set; }\n    }\n\n    public void Method(Sample sample)\n    {\n        sample?.IP = \"192.168.0.1\"; // Noncompliant\n        sample.IP = \"192.\";         // Compliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/HardcodedIpAddress.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public class AnyAssemblyClass\n    {\n        public AnyAssemblyClass(string s)\n        {\n        }\n    }\n\n    public class SomeAttribute : Attribute\n    {\n        public SomeAttribute(string s)\n        {\n\n        }\n    }\n\n    public class HardcodedIpAddress\n    {\n        private static void WriteAssemblyInfo(string assemblyName, string version, string author, string description, string title)\n        {\n        }\n\n        [SomeAttribute(\"127.0.0.1\")] // this is mainly for assembly versions\n        public HardcodedIpAddress()\n        {\n            string ip = \"192.168.0.1\"; // Noncompliant {{Make sure using this hardcoded IP address '192.168.0.1' is safe here.}}\n//                      ^^^^^^^^^^^^^\n            ip = \"300.0.0.0\";                               // Compliant, not a valid IP\n            ip = \"127.0.0.1\";                               // Compliant, this is an exception in the rule (see: https://github.com/SonarSource/sonar-dotnet/issues/1540)\n            ip = \"    127.0.0.0    \";\n            ip = @\"    \"\"127.0.0.0\"\"    \";\n            ip = \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\";  // Compliant. Is a documentation IP.\n            ip = \"2002:db8:1234:ffff:ffff:ffff:ffff:ffff\";  // Noncompliant\n            ip = \"2001:abcd:1234:ffff:ffff:ffff:ffff:ffff\"; // Noncompliant\n            ip = \"2002:db8::ff00:42:8329\";                  // Noncompliant\n            ip = \"::/0\";                                    // Compliant, not recognized as IPv6 address\n            ip = \"::\";                                      // Compliant, this is an exception in the rule\n            ip = \"2\";                                       // Compliant, should not be recognized as 0.0.0.2\n            ip = \"::2\";                                     // Noncompliant\n            ip = \"0:0:0:0:0:0:0:2\";                         // Noncompliant\n            ip = \"0:0::0:2\";                                // Noncompliant\n            ip = \"1623:0000:0000:0000:0000:0000:0000:0001\"; // Noncompliant\n\n            new Version(\"127.0.0.0\");\n            new Version(\"192.168.0.1\");\n            new AnyAssemblyClass(\"127.0.0.0\");\n\n            WriteAssemblyInfo(\"ProjectWithDependenciesWithContent\",\n                               \"1.2.0.0\",\n                                 \"Thomas\",\n                                 \"Project with content\",\n                                \"Title of Package\");\n\n            string broadcastAddress = \"255.255.255.255\";\n            string loopbackAddress1 = \"127.0.0.1\";\n            string loopbackAddress2 = \"127.2.3.4\";\n            string loopbackAddress3 = \"::ffff:127.0.0.1\";   //Compliant https://www.rfc-editor.org/rfc/rfc4291.html#section-2.5.5.2\n            string loopbackAddress4 = \"::ffff:127.2.3.4\";\n            string loopbackAddress5 = \"::1\";                //Compliant https://www.rfc-editor.org/rfc/rfc4291.html#section-2.5.3\n            string loopbackAddress6 = \"64:ff9b::127.2.3.4\"; // Noncompliant Translated IP4 not supported https://www.rfc-editor.org/rfc/rfc6052.html\n            string loopbackAddress7 = \"::ffff:0:127.2.3.4\"; // Noncompliant Translated IP4 not supported https://www.rfc-editor.org/rfc/rfc2765.html\n            string nonRoutableAddress = \"0.0.0.0\";\n            string documentationRange1 = \"192.0.2.111\";\n            string documentationRange2 = \"198.51.100.111\";\n            string documentationRange3 = \"203.0.113.111\";\n            string notAnIp1 = \"0.0.0.1234\";\n            string country_oid = \"2.5.6.2\";\n            string subschema_oid = \"2.5.20.1\";\n            string not_considered_as_an_oid = \"2.59.6.2\";   // Noncompliant\n//                                            ^^^^^^^^^^\n\n            // IPV6 loopback\n            string loopbackAddressV6_1 = \"::1\";\n            string loopbackAddressV6_2 = \"0:0:0:0:0:0:0:1\";\n            string loopbackAddressV6_3 = \"0:0::0:1\";\n            string loopbackAddressV6_4 = \"0000:0000:0000:0000:0000:0000:0000:0001\";\n\n            // IPV6 non routable\n            string nonRoutableAddressV6_1 = \"::\";\n            string nonRoutableAddressV6_2 = \"0:0:0:0:0:0:0:0\";\n            string nonRoutableAddressV6_3 = \"0::0\";\n            string nonRoutableAddressV6_4 = \"0000:0000:0000:0000:0000:0000:0000:0000\";\n\n            // IPV6 documentation range\n            string documentationRangeV6_1 = \"2001:0db8:0000:0000:0000:ff00:0042:8329\";\n            string documentationRangeV6_2 = \"2001:db8:0:0:0:ff00:42:8329\";\n            string documentationRangeV6_3 = \"2001:db8::ff00:42:8329\";\n\n            // IPV6 invalid form\n            string invalidIPv6 = \"1::2::3\";\n            invalidIPv6 = \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\";\n            invalidIPv6 = \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\";\n            invalidIPv6 = \":::4\";\n\n            string invalidIp = $\"192.168.{\"0\"}.1\"; // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/HardcodedIpAddress.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\n\nNamespace Tests.Diagnostics\n    Public Class AnyAssemblyClass\n        Public Sub New(ByVal s As String)\n        End Sub\n    End Class\n\n    Public Class HardcodedIpAddress\n        Private Shared Sub WriteAssemblyInfo(ByVal assemblyName As String, ByVal version As String, ByVal author As String, ByVal description As String, ByVal title As String)\n        End Sub\n\n        Public Sub Foo()\n            Dim ip As String = \"192.168.0.1\"                ' Noncompliant {{Make sure using this hardcoded IP address '192.168.0.1' is safe here.}}\n            '                  ^^^^^^^^^^^^^\n            ip = \"300.0.0.0\"                                ' Compliant, invalid IP\n            ip = \"127.0.0.1\"                                ' Compliant, exception from the rule\n            ip = \"    127.0.0.0    \"\n            ip = \"    \"\"127.0.0.0\"\"    \"\n            ip = \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\"   ' Compliant. Is a documentation IP.\n            ip = \"2001:0db8:1234:ffff:ffff:ffff:ffff:ffff\"  ' Compliant. Is a documentation IP.\n            ip = \"2001:abcd:1234:ffff:ffff:ffff:ffff:ffff\"  ' Noncompliant\n            ip = \"::/0\"                                     ' Compliant, not an IPv6 address\n            ip = \"::\"                                       ' Compliant, exception from the rule\n            ip = \"2\"\n            ip = \"::2\"                                      ' Noncompliant\n            ip = \"0:0:0:0:0:0:0:2\"                          ' Noncompliant\n            ip = \"0:0::0:2\"                                 ' Noncompliant\n            ip = \"1623:0000:0000:0000:0000:0000:0000:0001\"  ' Noncompliant\n\n            Dim v = New Version(\"127.0.0.0\")\n            Dim c = New AnyAssemblyClass(\"127.0.0.0\")\n            WriteAssemblyInfo(\"ProjectWithDependenciesWithContent\", _\n                \"1.2.0.0\", \"Thomas\", \"Project with content\", \"Title of Package\")\n\n            Dim broadcastAddress As String = \"255.255.255.255\"\n            Dim loopbackAddress1 = \"127.0.0.1\"\n            Dim loopbackAddress2 = \"127.2.3.4\"\n            Dim loopbackAddress3 = \"::ffff:127.0.0.1\"    ' Compliant Mapped IP4 https://www.rfc-editor.org/rfc/rfc4291.html#section-2.5.5.2\n            Dim loopbackAddress4 = \"::ffff:127.2.3.4\"\n            Dim loopbackAddress5 = \"::1\"                 ' Compliant IP6 loopback https://www.rfc-editor.org/rfc/rfc4291.html#section-2.5.3\n            Dim loopbackAddress6 = \"64:ff9b::127.2.3.4\"  ' Noncompliant Translated IP4 not supported https://www.rfc-editor.org/rfc/rfc6052.html\n            Dim loopbackAddress7 = \"::ffff:0:127.2.3.4\"  ' Noncompliant Translated IP4 not supported https://www.rfc-editor.org/rfc/rfc2765.html\n            Dim nonRoutableAddress As String = \"0.0.0.0\"\n            Dim documentationRange1 = \"192.0.2.111\"\n            Dim documentationRange2 = \"198.51.100.111\"\n            Dim documentationRange3 = \"203.0.113.111\"\n            Dim notAnIp1 As String = \"0.0.0.1234\"\n            Dim country_oid As String = \"2.5.6.2\"\n            Dim subschema_oid As String = \"2.5.20.1\"\n            Dim not_considered_as_an_oid As String = \"2.59.6.2\" ' Noncompliant\n            '                                        ^^^^^^^^^^\n\n            ' IPV6 loopback\n            Dim loopbackAddressV6_1 As String = \"::1\"\n            Dim loopbackAddressV6_2 As String = \"0:0:0:0:0:0:0:1\"\n            Dim loopbackAddressV6_3 As String = \"0:0::0:1\"\n            Dim loopbackAddressV6_4 As String = \"0000:0000:0000:0000:0000:0000:0000:0001\"\n\n            ' IPV6 non routable\n            Dim nonRoutableAddressV6_1 As String = \"::\"\n            Dim nonRoutableAddressV6_2 As String = \"0:0:0:0:0:0:0:0\"\n            Dim nonRoutableAddressV6_3 As String = \"0::0\"\n            Dim nonRoutableAddressV6_4 As String = \"0000:0000:0000:0000:0000:0000:0000:0000\"\n\n            ' IPV6 invalid form\n            Dim invalidIPv6 As String = \"1::2::3\"\n            invalidIPv6 = \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\"\n            invalidIPv6 = \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\"\n            invalidIPv6 = \":::4\"\n        End Sub\n\n        Public Sub StringInterpolation(ByVal unknownPart As String, ByVal knownPart As String)\n            Dim part1 As String = \"192\"\n            Dim part2 As String = \"168\"\n            Dim part3 As String = \"0\"\n            Dim part4 As String = \"1\"\n            knownPart = \"255\"\n            Dim ip1 As String = $\"{part1}.{part2}.{part3}.{part4}\"                           ' Noncompliant\n            Dim nonIp As String = $\"{part1}:{part2}\"\n            Dim ip2 As String = $\"{part1}.{part2}.{part3}.{knownPart}\"                       ' Noncompliant\n            Dim ip3 As String = $\"{part1}.{part2}.{part3}.{unknownPart}\"\n            Dim nestedConstInterpolation As String = $\"{$\"{part1}.{part2}\"}.{part3}.{part4}\" ' Noncompliant\n            Dim nestedInterpolation As String = $\"{$\"{part1}.{knownPart}\"}.{part3}.{part4}\"  ' Noncompliant\n        End Sub\n\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/InsecureDeserialization.Latest.Partial.cs",
    "content": "﻿using System;\nusing System.Runtime.Serialization;\n\npublic partial class PartialConstructor\n{\n    public partial PartialConstructor(string name)  // Noncompliant\n    {\n        Name = name ?? string.Empty;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/InsecureDeserialization.Latest.cs",
    "content": "﻿using System;\nusing System.Runtime.Serialization;\n\nnamespace CSharp9\n{\n    [Serializable]\n    public record ClassWithoutConstructorIsSafe\n    {\n        public string Name { get; set; }\n    }\n\n    [Serializable]\n    public record CtorParameterInIfStatement\n    {\n        public string Name { get; set; }\n\n        public CtorParameterInIfStatement(string name) // Noncompliant\n        {\n            if (string.IsNullOrEmpty(name))\n                Name = name;\n        }\n    }\n\n    [Serializable]\n    public record WithParameters(int X)\n    {\n        public string Name { get; set; }\n\n        public WithParameters(string name) : this(name.Length) // Noncompliant\n        {\n            if (string.IsNullOrEmpty(name))\n                Name = name;\n        }\n    }\n\n    [Serializable]\n    public record CtorParameterInCoalesceAssignmentExpression\n    {\n        public CtorParameterInCoalesceAssignmentExpression(string name) // Noncompliant {{Make sure not performing data validation after deserialization is safe here.}}\n        {\n            name ??= string.Empty;\n        }\n\n        [Serializable]\n        public record Nested\n        {\n            public Nested(string name) // Noncompliant {{Make sure not performing data validation after deserialization is safe here.}}\n            {\n                name ??= string.Empty;\n            }\n        }\n    }\n}\n\nnamespace CSharp10\n{\n    [Serializable]\n    public record struct RecordStructWithoutConstructorIsSafe\n    {\n        public RecordStructWithoutConstructorIsSafe() { }\n\n        public string Name { get; set; } = \"\";\n    }\n\n    [Serializable]\n    public record struct CtorParameterInIfStatement\n    {\n        public string Name { get; set; } = \"\";\n\n        public CtorParameterInIfStatement(string name) // Noncompliant {{Make sure not performing data validation after deserialization is safe here.}}\n        //     ^^^^^^^^^^^^^^^^^^^^^^^^^^\n        {\n            if (string.IsNullOrEmpty(name))\n                Name = name;\n        }\n    }\n\n    [Serializable]\n    public record struct CtorParameterInIfStatementPositionalRecordStruct(string Property)\n    {\n        public string Name { get; set; } = \"\";\n\n        public CtorParameterInIfStatementPositionalRecordStruct(string name, string property) : this(property) // Noncompliant\n        {\n            if (string.IsNullOrEmpty(name))\n                Name = name;\n        }\n    }\n\n    [Serializable]\n    public record struct WithParameters(int X)\n    {\n        public string Name { get; set; } = \"\";\n\n        public WithParameters(string name) : this(name.Length) // Noncompliant\n        {\n            if (string.IsNullOrEmpty(name))\n                Name = name;\n        }\n    }\n\n    [Serializable]\n    public record struct CtorParameterInCoalesceAssignmentExpression\n    {\n        public CtorParameterInCoalesceAssignmentExpression(string name) // Noncompliant\n        {\n            name ??= string.Empty;\n        }\n\n        [Serializable]\n        public record struct Nested\n        {\n            public Nested(string name) // Noncompliant\n            {\n                name ??= string.Empty;\n            }\n        }\n    }\n\n    [Serializable]\n    public struct SomeStruct\n    {\n        public string Name { get; set; } = \"\";\n\n        public SomeStruct(string name) // Noncompliant\n        {\n            if (string.IsNullOrEmpty(name))\n                Name = name;\n        }\n    }\n}\n\nnamespace CSharp13\n{\n    [Serializable]\n    partial class Partial\n    {\n        partial string Name { get; set; }\n\n        public Partial(string name) // Noncompliant\n        {\n            if (string.IsNullOrEmpty(name))\n                Name = name;\n        }\n    }\n\n    partial class Partial\n    {\n        partial string Name\n        {\n            get => \"Name\";\n            set => Name = value;\n        }\n    }\n}\n\n[Serializable]\npublic class ClassWithDefaultConstructorWithConditionalsIsSafe\n{\n    public string Name { get; set; }\n\n    public ClassWithDefaultConstructorWithConditionalsIsSafe()\n    {\n        Name ??= string.Empty;\n    }\n}\n\n[Serializable]\npublic class CtorParameterInCoalesceAssignmentExpression\n{\n    public CtorParameterInCoalesceAssignmentExpression(string name) // Noncompliant {{Make sure not performing data validation after deserialization is safe here.}}\n    {\n        name ??= string.Empty;\n    }\n\n    [Serializable]\n    public class InNestedClass\n    {\n        public InNestedClass(string name) // Noncompliant {{Make sure not performing data validation after deserialization is safe here.}}\n        {\n            name ??= string.Empty;\n        }\n    }\n}\n\n[Serializable]\npublic class CtorParameterInSwitchExpression\n{\n    public string Name { get; set; }\n\n    public CtorParameterInSwitchExpression(string name) // Noncompliant {{Make sure not performing data validation after deserialization is safe here.}}\n    {\n        Name = name switch\n        {\n            \"1\" => \"one\",\n            _ => \"else\"\n        };\n    }\n\n    public CtorParameterInSwitchExpression(int tmp)  // Compliant - no checks done on the parameter\n    {\n        Name = DateTime.Now.Kind switch\n        {\n            DateTimeKind.Unspecified => tmp.ToString(),\n            _ => \"else\"\n        };\n    }\n}\n\n[Serializable]\npublic class CtorParameterInSwitchExpressionArm\n{\n    public string Name { get; set; }\n\n    public CtorParameterInSwitchExpressionArm(string name) // Noncompliant {{Make sure not performing data validation after deserialization is safe here.}}\n    {\n        Name = \"\" switch\n        {\n            { } s when s == name => \"one\",\n            _ => \"else\"\n        };\n    }\n}\n\n\n[Serializable]\npublic class DifferentConditionsInCtor : IDeserializationCallback\n{\n    internal string Name { get; private set; }\n\n    public DifferentConditionsInCtor(string name) // Noncompliant\n    {\n        Name = name ?? string.Empty;\n    }\n\n    public void UnrelatedMethod(object sender) { Name ??= string.Empty; } // Name != OnDeserialization\n\n    public void OnDeserialization() => Name ??= string.Empty; // Wrong number of parameters\n\n    public void OnDeserialization(string a, string b) => Name ??= string.Empty; // wrong number of parameters\n\n    public void OnDeserialization(object sender) { }\n}\n\n[Serializable]\npublic partial class PartialConstructor\n{\n    internal string Name { get; private set; }\n    public partial PartialConstructor(string name);\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/InsecureDeserialization.cs",
    "content": "﻿using System;\nusing System.Runtime.Serialization;\n\nnamespace Tests.Diagnostics\n{\n    [Serializable]\n    public class ClassWithoutConstructorIsSafe\n    {\n        public string Name { get; set; }\n    }\n\n    [Serializable]\n    public class ClassWithDefaultConstructorIsSafe\n    {\n        public string Name { get; set; }\n\n        public ClassWithDefaultConstructorIsSafe()\n        {\n            Name = string.Empty;\n        }\n    }\n\n    [Serializable]\n    public class CtorParameterIsNotInConditional\n    {\n        public string Name { get; set; }\n\n        public CtorParameterIsNotInConditional(string name)\n        {\n            Name = name;\n        }\n    }\n\n    [Serializable]\n    public class CtorParameterInIfStatement\n    {\n        public string Name { get; set; }\n\n        public CtorParameterInIfStatement(string name) // Noncompliant {{Make sure not performing data validation after deserialization is safe here.}}\n//             ^^^^^^^^^^^^^^^^^^^^^^^^^^\n        {\n            if (string.IsNullOrEmpty(name))\n                Name = name;\n        }\n    }\n\n    [Serializable]\n    public class CtorParameterInTernaryOperator\n    {\n        public string Name { get; set; }\n\n        public CtorParameterInTernaryOperator(string name) // Noncompliant {{Make sure not performing data validation after deserialization is safe here.}}\n        {\n            Name = string.IsNullOrEmpty(name) ? \"default\" : name;\n        }\n    }\n\n    [Serializable]\n    public class CtorParameterInCoalesceExpression\n    {\n        public string Name { get; set; }\n\n        public CtorParameterInCoalesceExpression(string name) // Noncompliant {{Make sure not performing data validation after deserialization is safe here.}}\n        {\n            Name = name ?? string.Empty;\n        }\n    }\n\n    [Serializable]\n    public class CtorParameterInSwitchStatement\n    {\n        public string Name { get; private set; }\n\n        public CtorParameterInSwitchStatement(string name) // Noncompliant {{Make sure not performing data validation after deserialization is safe here.}}\n        {\n            switch (name)\n            {\n                case \"1\":\n                case \"2\":\n                case \"3\":\n                    throw new NotSupportedException();\n            }\n        }\n\n        public CtorParameterInSwitchStatement(int tmp) // Compliant - no checks done on the parameter\n        {\n            switch (DateTime.Now.Kind)\n            {\n                case DateTimeKind.Unspecified:\n                case DateTimeKind.Utc:\n                case DateTimeKind.Local:\n                    Name = tmp.ToString();\n                    break;\n                default:\n                    throw new ArgumentOutOfRangeException();\n            }\n        }\n    }\n\n    [Serializable]\n    public class MultipleConstructorsOneUnsafe\n    {\n        public string Name { get; set; }\n\n        public MultipleConstructorsOneUnsafe()\n        {\n        }\n\n        public MultipleConstructorsOneUnsafe(string name) // Noncompliant {{Make sure not performing data validation after deserialization is safe here.}}\n        {\n            Name = name ?? string.Empty;\n        }\n\n        public MultipleConstructorsOneUnsafe(string firstName, string lastName)\n        {\n            Name = $\"{firstName} {lastName}\";\n        }\n    }\n\n    [Serializable]\n    public class MultipleConstructorsMoreUnsafe\n    {\n        public string Name { get; set; }\n\n        public MultipleConstructorsMoreUnsafe()\n        {\n        }\n\n        public MultipleConstructorsMoreUnsafe(string name) // Noncompliant {{Make sure not performing data validation after deserialization is safe here.}}\n        {\n            Name = name ?? string.Empty;\n        }\n\n        public MultipleConstructorsMoreUnsafe(string firstName, string lastName) // Noncompliant {{Make sure not performing data validation after deserialization is safe here.}}\n        {\n            Name = firstName ?? lastName;\n        }\n    }\n\n    [Serializable]\n    public class ParameterPartOfNestedConditional\n    {\n        public string Name { get; set; }\n\n        public ParameterPartOfNestedConditional(string name) // Noncompliant {{Make sure not performing data validation after deserialization is safe here.}}\n        {\n            if (true)\n            {\n                Name = string.IsNullOrEmpty(name) ? \"default\" : name;\n            }\n        }\n    }\n\n    [Serializable]\n    public class NoConditionals : ISerializable\n    {\n        protected NoConditionals(SerializationInfo info, StreamingContext context)\n        {\n        }\n\n        void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    [Serializable]\n    public class MissingDeserializationCtor : ISerializable\n    {\n        void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    [Serializable]\n    public class CtorWithConditionsAndMissingDeserializationCtor : ISerializable\n    {\n        private string name;\n\n        public CtorWithConditionsAndMissingDeserializationCtor(string name) // Noncompliant\n        {\n            this.name = name ?? string.Empty;\n        }\n\n        void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    [Serializable]\n    public class MultipleConstructorsNoConditionals : ISerializable\n    {\n        public MultipleConstructorsNoConditionals()\n        {\n        }\n\n        public MultipleConstructorsNoConditionals(bool condition, string name)\n        {\n        }\n\n        protected MultipleConstructorsNoConditionals(SerializationInfo info, StreamingContext context)\n        {\n        }\n\n        void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    [Serializable]\n    public class WithConditionsISerializable : ISerializable\n    {\n        public string Url { get; }\n\n        public WithConditionsISerializable(string url)\n        {\n            if (string.IsNullOrEmpty(url))\n            {\n                Url = url;\n            }\n        }\n\n        protected WithConditionsISerializable(SerializationInfo info, StreamingContext context)\n        {\n            foreach (var item in info)\n            {\n                if (item.Name == \"Url\")\n                {\n                    Url = (string) item.Value;\n                }\n            }\n        }\n\n        void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    [Serializable]\n    public class WithDifferentConditionsISerializable : ISerializable\n    {\n        public string FirstName { get; }\n\n        public string LastName { get; }\n\n        public WithDifferentConditionsISerializable(string firstName, string lastName) // Compliant - FN: ctor has conditions on different args/fields/properties than deserialization constructor\n        {\n            FirstName = firstName ?? \"\";\n            LastName = lastName;\n        }\n\n        protected WithDifferentConditionsISerializable(SerializationInfo info, StreamingContext context)\n        {\n            FirstName = info.GetString(\"FirstName\");\n            LastName = info.GetString(\"LastName\") ?? string.Empty;\n        }\n\n        void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    [Serializable]\n    public class WithoutConditionsInDeserializationCtor : ISerializable\n    {\n        public string Url { get; }\n\n        public WithoutConditionsInDeserializationCtor(string url) // Noncompliant\n        {\n            if (string.IsNullOrEmpty(url))\n            {\n                Url = url;\n            }\n        }\n\n        protected WithoutConditionsInDeserializationCtor(SerializationInfo info, StreamingContext context)\n        {\n            Url = info.GetString(\"Url\");\n        }\n\n        void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    [Serializable]\n    public class NoConstructor : IDeserializationCallback\n    {\n        public void OnDeserialization(object sender)\n        {\n        }\n    }\n\n    [Serializable]\n    public class WithoutConditionsInCtor : IDeserializationCallback\n    {\n        private string Name { get; }\n\n        public WithoutConditionsInCtor(string name)\n        {\n            Name = name;\n        }\n\n        public void OnDeserialization(object sender)\n        {\n        }\n    }\n\n    [Serializable]\n    public class WithConditionsInBothCtorAndOnDeserialization : IDeserializationCallback\n    {\n        public string Name { get; private set; }\n\n        public WithConditionsInBothCtorAndOnDeserialization(string name)\n        {\n            Name = name ?? string.Empty;\n        }\n\n        public void OnDeserialization(object sender)\n        {\n            if (sender != null)\n            {\n                Name = sender.ToString();\n            }\n        }\n    }\n\n    [Serializable]\n    public class WithDifferentConditionsInBothCtorAndOnDeserialization : IDeserializationCallback\n    {\n        public string FirstName { get; private set; }\n\n        public string LastName { get; private set; }\n\n        public WithDifferentConditionsInBothCtorAndOnDeserialization(string firstName, string lastName) // Compliant - FN: ctor has conditional on different argument/property/field than OnDeserialization.\n        {\n            FirstName = firstName ?? string.Empty;\n            lastName = lastName;\n        }\n\n        public void OnDeserialization(object sender)\n        {\n            FirstName = (string)sender;\n            LastName = true ? \"a\" : \"b\";\n        }\n    }\n\n    [Serializable]\n    public abstract class AbstractSerializable : ISerializable\n    {\n        public string Name { get; private set; }\n\n        public AbstractSerializable(string name) // Noncompliant\n        {\n            Name = name ?? string.Empty;\n        }\n\n        public abstract void GetObjectData(SerializationInfo info, StreamingContext context);\n    }\n\n    [Serializable]\n    public abstract class AbstractDeserializationCallback : IDeserializationCallback\n    {\n        public string Name { get; private set; }\n\n        public AbstractDeserializationCallback(string name) // Noncompliant\n        {\n            Name = name ?? string.Empty;\n        }\n\n        public abstract void OnDeserialization(object sender);\n    }\n\n    public class ClassWithoutSerializableAttributeIsSafe\n    {\n        public string Name { get; set; }\n\n        public ClassWithoutSerializableAttributeIsSafe(string name)\n        {\n            Name = name ?? string.Empty;\n        }\n    }\n\n    public class DeserializationCallback : IDeserializationCallback\n    {\n        public void OnDeserialization(object sender)\n        {\n        }\n    }\n\n    [Serializable]\n    public class IndirectImplementationIDeserializationCallback : DeserializationCallback\n    {\n        public string Name { get; private set; }\n\n        public IndirectImplementationIDeserializationCallback(string name) // Noncompliant\n        {\n            Name = name ?? string.Empty;\n        }\n    }\n\n    [Serializable]\n    public struct StructNonCompliant\n    {\n        public string Name { get; private set; }\n\n        public StructNonCompliant(string name) // Noncompliant\n        {\n            Name = name ?? string.Empty;\n        }\n    }\n\n    partial class Partial\n    {\n        public Partial(string name) // Noncompliant\n        {\n            if (string.IsNullOrEmpty(name))\n                Name = name;\n        }\n    }\n\n    [Serializable]\n    partial class Partial\n    {\n        public string Name\n        {\n            get => \"Name\";\n            set => Name = value;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/PermissiveCors.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Microsoft.AspNetCore.Http;\nusing Microsoft.AspNetCore.Mvc;\nusing Microsoft.AspNetCore.Cors;\nusing Microsoft.Net.Http.Headers;\nusing Microsoft.AspNetCore.Cors.Infrastructure;\nusing Microsoft.Extensions.DependencyInjection;\nusing Microsoft.Extensions.Primitives;\nusing CPB = Microsoft.AspNetCore.Cors.Infrastructure.CorsPolicyBuilder;\nusing SV = Microsoft.Extensions.Primitives.StringValues;\n\n\ninternal class TestCases\n{\n    public void Bar(IEnumerable<int> collection)\n    {\n        [EnableCors()] int Get() => 1; // Compliant - we don't know what default policy is\n\n        _ = collection.Select([EnableCors(\"policyName\")] (x) => x + 1);\n\n        Action a = [EnableCors(\"*\")] () => { }; // Compliant - `*`, in this case, is the name of the policy\n\n        Action x = true\n                       ? ([EnableCors] () => { })\n                       : [EnableCors(\"*\")] () => { };\n\n        Call([EnableCors] (x) => { });\n    }\n\n    private void Call(Action<int> action) => action(1);\n    \n    [ApiController]\n    [Route(\"[controller]\")]\n    public class ConstantInterpolatedStringController : Controller\n    {\n        [HttpGet]\n        public void Index()\n        {\n            const string constAccessControl = \"Access-Control\";\n            const string constAllowOrigin = \"Allow-Origin\";\n            Response.Headers.Add($\"{constAccessControl}-{constAllowOrigin}\", \"*\"); // Noncompliant\n\n            const string constString = \"Access-Control-Allow-Origin\";\n            Response.Headers.Add(constString, \"*\"); // FN\n\n            const string interpolatedString = $\"{constAccessControl}-{constAllowOrigin}\";\n            Response.Headers.Add(interpolatedString, \"*\"); // FN\n        }\n    }\n}\n\n[ApiController]\n[Route(\"[controller]\")]\npublic class CorsEnabledManualAddedHeadersController : Controller\n{\n    [HttpGet]\n    public void Index(string header, string headerValue)\n    {\n        string accessControl = \"Access-Control\";\n        string allowOrigin = \"Allow-Origin\";\n        // The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given origin.\n        Response.Headers.Add(\"\"\"Access-Control-Allow-Origin\"\"\", \"\"\"*\"\"\"); // Noncompliant\n        Response.Headers.Add($$\"\"\"{{accessControl}}-{{allowOrigin}}\"\"\", \"*\"); // FN (at the moment we validate only constant string)\n\n        const string constAccessControl = \"Access-Control\";\n        const string constAllowOrigin = \"Allow-Origin\";\n        Response.Headers.Add($$\"\"\"{{constAccessControl}}-{{constAllowOrigin}}\"\"\", \"*\"); // Noncompliant\n\n        const string RawStar = \"\"\"*\"\"\";\n        Response.Headers.Add(\"Access-Control-Allow-Origin\", RawStar); // Noncompliant\n        Response.Headers.Add($\"\"\"{constAccessControl}-{constAllowOrigin}\"\"\", RawStar); // Noncompliant\n\n        const string constRawAccessControl = \"\"\"Access-Control\"\"\";\n        const string constRawAllowOrigin = \"\"\"Allow-Origin\"\"\";\n        Response.Headers.Add($\"\"\"{constRawAccessControl}-{constRawAllowOrigin}\"\"\", \"\"\"*\"\"\"); // Noncompliant\n    }\n}\n\ninternal class TestCases2\n{\n    [GenericAttribute<int>(\"*\")] // Compliant - \"*\" is the policy name in this case\n    public void A() { }\n\n    [GenericAttribute<int>]\n    public void B() { }\n\n    [EnableCors()]\n    public void C() { }\n\n    [EnableCors(\"*\")]\n    public void D() { }\n}\n\npublic class GenericAttribute<T> : EnableCorsAttribute\n{\n    public GenericAttribute() : base() { }\n\n    public GenericAttribute(string policyName) : base(policyName) { }\n}\n\npartial class Partial\n{\n    private const string Star = \"*\";\n\n    public partial IServiceCollection A { get; }\n}\n\npartial class Partial\n{\n    public partial IServiceCollection A => new ServiceCollection().AddCors(options =>\n    {\n        options.AddDefaultPolicy(builder =>\n        {\n            builder.WithOrigins(\"*\"); // Noncompliant\n            builder.WithOrigins(Star); // Noncompliant\n            builder.WithOrigins(\"*\", \"*\", \"*\"); // Noncompliant\n        });\n    });\n}\n\npublic class Setup\n{\n    private const string Star = \"*\";\n\n    public void ConfigureServices(IServiceCollection services)\n    {\n        services.AddCors(options =>\n        {\n            options.AddDefaultPolicy(builder =>\n            {\n                builder.WithOrigins(\"*\"); // Noncompliant\n                builder.WithOrigins(Star); // Noncompliant\n                builder.WithOrigins(\"*\", \"*\", \"*\"); // Noncompliant\n            });\n\n            options.AddPolicy(\"EnableAllPolicy\", builder =>\n            {\n                builder.WithOrigins(\"https://trustedwebsite.com\", \"*\"); // Noncompliant\n            });\n\n            options.AddPolicy(\"OtherPolicy\", builder =>\n            {\n                builder.AllowAnyOrigin(); // Noncompliant\n            });\n\n            options.AddPolicy(\"Safe\", builder =>\n            {\n                builder.WithOrigins(\"https://trustedwebsite.com\", \"https://anothertrustedwebsite.com\");\n            });\n\n            options.AddPolicy(\"MyAllowSubdomainPolicy\", builder =>\n            {\n                builder.WithOrigins(\"https://*.example.com\")\n                       .SetIsOriginAllowedToAllowWildcardSubdomains();\n            });\n\n            var unsafeBuilder = new CorsPolicyBuilder(\"*\"); // Noncompliant\n            options.AddPolicy(\"UnsafeBuilder\", unsafeBuilder.Build());\n\n            var unsafeBuilderWithAlias = new CPB(\"*\"); // FN - for performance reasons type alias is not supported\n            options.AddPolicy(\"UnsafeBuilderWithAlias\", unsafeBuilderWithAlias.Build());\n\n            var safeBuilder = new CorsPolicyBuilder(\"https://trustedwebsite.com\");\n            options.AddPolicy(\"SafeBuilder\", safeBuilder.Build());\n\n            CorsPolicyBuilder builder = new(\"*\");     // Noncompliant\n\n            builder = new CorsPolicyBuilder { };\n        });\n\n        services.AddControllers();\n    }\n}\n\nnamespace NetTests\n{\n    [ApiController]\n    [Route(\"[controller]\")]\n    public class CorsEnabledManualAddedHeadersController : Controller\n    {\n        private const string Star = \"*\";\n        private string NonConstStar = \"*\";\n\n        [HttpGet]\n        public void Index(string header, string headerValue)\n        {\n            // The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given origin.\n            Response.Headers.Add(\"Access-Control-Allow-Origin\", \"*\"); // Noncompliant\n            Response.Headers.Add(\"Access-Control-Allow-Origin\", Star); // Noncompliant\n            Response.Headers.Add(\"Access-Control-Allow-Origin\", \"https://trustedwebsite.com\");\n            Response.Headers.Add(\"Access-Control-Allow-Origin\", new[] { \"https://trustedwebsite.com\", \"*\" }); // Noncompliant\n            Response.Headers.Add(\"Access-Control-Allow-Origin\", \"*****\");\n            Response.Headers.Add(\"OtherString\", \"*\");\n            Response.Headers.Add(HeaderNames.Age, \"*\");\n            Response.Headers.Add(HeaderNames.AccessControlAllowOrigin, \"*\"); // Noncompliant\n            Response.Headers.Add(HeaderNames.AccessControlAllowOrigin, \"https://trustedwebsite.com\");\n            Response.Headers.Add(header, \"*\");\n            Response.Headers.Add(HeaderNames.AccessControlAllowOrigin, headerValue);\n\n            Response.Headers.Append(\"Access-Control-Allow-Origin\", \"*\"); // Noncompliant\n            Response.Headers.Append(\"Access-Control-Allow-Origin\", \"https://trustedwebsite.com\");\n\n            Response.Headers.Append(HeaderNames.AccessControlAllowOrigin, \"*\"); // Noncompliant\n            Response.Headers.Append(HeaderNames.AccessControlAllowOrigin, Star); // Noncompliant\n            Response.Headers.Append(HeaderNames.AccessControlAllowOrigin, \"https://trustedwebsite.com\");\n            Response.Headers.Append(\"OtherString\", \"*\");\n            Response.Headers.Append(HeaderNames.Age, \"*\");\n\n            Response.Headers.Append(HeaderNames.AccessControlAllowOrigin, new StringValues(\"*\")); // Noncompliant\n            Response.Headers.Append(HeaderNames.AccessControlAllowOrigin, new StringValues(Star)); // Noncompliant\n            Response.Headers.Append(HeaderNames.AccessControlAllowOrigin, new StringValues(\"https://trustedwebsite.com\"));\n            Response.Headers.Append(HeaderNames.AccessControlAllowOrigin, new StringValues(new[] { \"*\", \"https://trustedwebsite.com\" })); // Noncompliant\n\n            Response.Headers.Append(HeaderNames.AccessControlAllowOrigin, new SV(\"*\")); // FN - for performance reasons type alias is not supported\n            Response.Headers.Append(HeaderNames.AccessControlAllowOrigin, \"*, https://trustedwebsite.com\"); // FN\n            Response.Headers.Append(HeaderNames.AccessControlAllowOrigin, $\"{Star}, https://trustedwebsite.com\"); // FN\n\n            Response.Headers.Append(HeaderNames.AccessControlAllowOrigin, $\"{Star}\"); // Noncompliant\n            Response.Headers.Append(HeaderNames.AccessControlAllowOrigin, $\"{NonConstStar}\"); // FN (at the moment we validate only constant string)\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/PermissiveCors.NetFramework.cs",
    "content": "﻿namespace TestCases_Controller\n{\n    using System;\n    using System.Web;\n    using System.Web.Http;\n    using System.Web.Http.Cors;\n    using Microsoft.Net.Http.Headers;\n\n    [EnableCors(origins: \"*\", headers: \"*\", methods: \"*\", exposedHeaders: \"X-Custom-Header\")] // Noncompliant {{Make sure this permissive CORS policy is safe here.}}\n    public class PermissiveCors : ApiController\n    {\n        [EnableCors(\"https:\\\\trustedwebsite.com\", \"*\", \"*\", \"X-Custom-Header\")]\n        public string Get()\n        {\n            var response = HttpContext.Current.Response;\n\n            response.Headers.Add(\"Access-Control-Allow-Origin\", \"*\"); // Noncompliant\n            response.Headers.Add(\"Access-Control-Allow-Origin\", \"https:\\\\trustedwebsite.com\");\n            response.Headers.Add(\"something else\", \"*\");\n            response.Headers.Add(\"Access-Control-Allow-Origin\", new String('*', 1)); // FN\n\n            response.Headers.Add(HeaderNames.AccessControlAllowOrigin, \"*\"); // Noncompliant\n            response.Headers.Add(HeaderNames.AccessControlAllowOrigin, \"https:\\\\trustedwebsite.com\");\n            response.Headers.Add(HeaderNames.ContentLength, \"*\");\n\n            response.AppendHeader(\"Access-Control-Allow-Origin\", \"*\"); // Noncompliant\n            response.AppendHeader(\"Access-Control-Allow-Origin\", \"https:\\\\trustedwebsite.com\");\n            response.AppendHeader(\"something else\", \"*\");\n\n            response.AppendHeader(HeaderNames.AccessControlAllowOrigin, \"*\"); // Noncompliant\n            response.AppendHeader(HeaderNames.AccessControlAllowOrigin, \"https:\\\\trustedwebsite.com\");\n            response.AppendHeader(HeaderNames.ContentLength, \"*\");\n\n            return string.Empty;\n        }\n    }\n}\n\nnamespace TestCases_MvcFilter\n{\n    using System.Web.Mvc;\n    using Microsoft.Net.Http.Headers;\n\n    public class AllowCrossSiteAttribute : ActionFilterAttribute\n    {\n        public override void OnActionExecuting(ActionExecutingContext context)\n        {\n            context.RequestContext.HttpContext.Response.AddHeader(\"Access-Control-Allow-Origin\", \"*\"); // Noncompliant\n            context.RequestContext.HttpContext.Response.AddHeader(\"Access-Control-Allow-Origin\", \"https:\\\\trustedwebsite.com\");\n            context.RequestContext.HttpContext.Response.AddHeader(\"something else\", \"*\");\n\n            context.RequestContext.HttpContext.Response.AddHeader(HeaderNames.AccessControlAllowOrigin, \"*\"); // Noncompliant\n            context.RequestContext.HttpContext.Response.AddHeader(HeaderNames.AccessControlAllowOrigin, \"https:\\\\trustedwebsite.com\");\n            context.RequestContext.HttpContext.Response.AddHeader(HeaderNames.ContentLength, \"*\");\n\n            base.OnActionExecuting(context);\n        }\n    }\n}\n\nnamespace TestCases_WebApiFilter\n{\n    using System.Web.Http.Filters;\n    using Microsoft.Net.Http.Headers;\n\n    public class AllowCrossSiteJsonAttribute : ActionFilterAttribute\n    {\n        public override void OnActionExecuted(HttpActionExecutedContext context)\n        {\n            context.Response.Headers.Add(\"Access-Control-Allow-Origin\", \"*\"); // Noncompliant\n            context.Response.Headers.Add(\"Access-Control-Allow-Origin\", \"https:\\\\trustedwebsite.com\");\n            context.Response.Headers.Add(\"something else\", \"*\");\n\n            context.Response.Headers.Add(HeaderNames.AccessControlAllowOrigin, \"*\"); // Noncompliant\n            context.Response.Headers.Add(HeaderNames.AccessControlAllowOrigin, \"https:\\\\trustedwebsite.com\");\n            context.Response.Headers.Add(HeaderNames.ContentLength, \"*\");\n\n            base.OnActionExecuted(context);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/PubliclyWritableDirectories.Latest.cs",
    "content": "﻿using System;\nusing System.IO;\n\nnamespace CSharp10\n{\n    public class Program\n    {\n        public void Examples()\n        {\n            const string t = \"T\";\n            const string e = \"E\";\n            const string m = \"M\";\n            const string p = \"P\";\n            const string part1 = \"/tEmP\"; // Noncompliant\n            const string part2 = \"/f\";\n            const string noncompliant2 = $\"{part1}{part2}\"; // Noncompliant\n\n            var tmp = Environment.GetEnvironmentVariable($\"{t}{e}{m}{p}\"); // Noncompliant\n            tmp = Environment.GetEnvironmentVariable($\"{t}{e}{m}{p}{5}\");\n        }\n    }\n}\n\nnamespace CSharp11\n{\n    public class Program\n    {\n        void RawStringLiterals()\n        {\n            var tmp = Environment.GetEnvironmentVariable(\"\"\"TMPDIR\"\"\"); // Noncompliant\n        }\n\n        void NewlinesInStringInterpolation(string firstPartOfPath, string secondPartOfPath)\n        {\n            string dir = $\"/tmp/{firstPartOfPath + // Noncompliant\n                secondPartOfPath}\";\n            string dirRawString = $$\"\"\"/tmp/{{firstPartOfPath + // Noncompliant\n                            secondPartOfPath}}\"\"\";\n        }\n\n        void Utf8StringLiterals()\n        {\n            var tmp = \"%USERPROFILE%\\\\AppData\\\\Local\\\\Temp\\\\f\"u8; // Noncompliant\n            tmp = \"%TEMP%\\\\f\"u8;                // Noncompliant\n            tmp = \"/tmp/\"u8;                    // Noncompliant\n            tmp = \"/tmp\"u8;                     // Noncompliant\n            tmp = \"/var/tmp/f\"u8;               // Noncompliant\n            tmp = \"/usr/tmp/f\"u8;               // Noncompliant\n            tmp = \"/dev/shm/f\"u8;               // Noncompliant\n            tmp = \"/dev/mqueue/f\"u8;            // Noncompliant\n            tmp = \"/run/lock/f\"u8;              // Noncompliant\n            tmp = \"/var/run/lock/f\"u8;          // Noncompliant\n            tmp = \"/Library/Caches/f\"u8;        // Noncompliant\n            tmp = \"/Users/Shared/f\"u8;          // Noncompliant\n            tmp = \"/private/tmp/f\"u8;           // Noncompliant\n            tmp = \"/private/var/tmp/\"u8;        // Noncompliant\n            tmp = \"C:\\\\Windows\\\\Temp\\\\f\"u8;     // Noncompliant\n            tmp = \"C:\\\\Temp\\\\f\"u8;              // Noncompliant\n            tmp = \"C:\\\\TEMP\\\\f\"u8;              // Noncompliant\n            tmp = \"C:\\\\TMP\\\\f\"u8;               // Noncompliant\n            tmp = @\"/tmp/f\"u8;                  // Noncompliant\n            tmp = \"D:\\\\Windows\\\\Temp\\\\f\"u8;     // Noncompliant\n            tmp = \"\\\\\\\\Server_Name\\\\Temp\\\\f\"u8; // Noncompliant\n            tmp = \"\\\\Windows\\\\Temp\\\\f\"u8;       // Noncompliant\n            tmp = @\"C:\\Windows\\Temp\\f\"u8;       // Noncompliant\n            tmp = @\"D:\\Windows\\Temp\\f\"u8;       // Noncompliant\n            tmp = @\"\\\\Windows\\Temp\\f\"u8;        // Noncompliant\n            tmp = @\"\\Windows\\Temp\\f\"u8;         // Noncompliant\n        }\n    }\n}\n\nnamespace CSharp12\n{\n    class PrimaryConstructor(string ctorParam = \"C:\\\\TMP\\\\f\",        // Noncompliant\n                             string ctorParam2 = $\"C:\\\\{\"TM\"}P\\\\f\")  // FN\n    {\n        void Method(string methodParam = \"C:\\\\TMP\\\\f\",        // Noncompliant\n                    string methodParam2 = $\"C:\\\\{\"TM\"}P\\\\f\")  // FN\n        {\n            const string p = \"p\";\n            var lambda = (string lambdaParam = \"C:\\\\TMP\\\\f\",                // Noncompliant\n                          string lambdaParam2 = $\"C:\\\\{\"TM\"}P\\\\f\",          // FN\n                          string lambdaParam3 = $\"/tem{p}\") => lambdaParam; // Noncompliant\n        }\n    }\n}\n\nnamespace CSharp13\n{\n    class MyClass\n    {\n        void EscapeSequence()\n        {\n            var tmp = \"\\e%TEMP%\\\\f\";                           // Compliant\n            tmp = \"\\e/tmp\";                                    // Compliant\n            tmp = \"/var\\e/tmp/f\";                              // Compliant\n            tmp = \"/usr/tm\\ep/f\";                              // Compliant\n            tmp = \"%USERPROFILE%\\\\AppData\\\\Local\\\\Temp\\\\f\\e\";  // Noncompliant\n            tmp = \"/tmp/\\e\";                                   // Noncompliant\n            tmp = \"/tmp/som\\ething\";                           // Noncompliant\n            tmp = @\"/tmp/f\\e\";                                 // Noncompliant\n            tmp = \"D:\\\\Windows\\\\Temp\\\\f\\\\\\u001b\";              // Noncompliant\n            tmp = \"\\\\\\\\\\eServer_Name\\\\Temp\\\\f\";                // Noncompliant\n        }\n    }\n}\n\npublic class NullConditionalAssignment\n{\n    public class Sample\n    {\n        public string Path { get; set; }\n    }\n\n    public void Method(Sample sample)\n    {\n        sample?.Path = \"%USERPROFILE%\\\\AppData\\\\Local\\\\Temp\\\\f\"; // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/PubliclyWritableDirectories.cs",
    "content": "﻿using System;\nusing System.IO;\n\nnamespace Tests.Diagnostics\n{\n    public class Program\n    {\n        public void Compliant()\n        {\n            var randomPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); // Compliant\n            var tempFileName = Path.GetTempFileName(); // Compliant\n\n            using (var tmpDir = new StreamReader(@\"Path is /tmp/f\")) { };  // Compliant\n            using (var tmpDir = new StreamReader(@\"C:\\\\Windows\\\\Tempete\")) { };  // Compliant;\n            var url = \"http://example.domain/tmp/f\"; // Compliant\n        }\n\n        private string CompliantWithArg(string dir = \"/other/tmp\") // Compliant\n        {\n            return dir;\n        }\n\n        private class InnerClass\n        {\n            public string StringProp { get; set; }\n        }\n\n        public void NonCompliant(string partOfPath)\n        {\n            // Environment\n            var tmp = Path.GetTempPath();   // Noncompliant\n            tmp = Path.GetTempPath();       // Noncompliant\n            InnerClass inner = new InnerClass() { StringProp = Path.GetTempPath() }; // Noncompliant\n            tmp = Environment.GetEnvironmentVariable(\"TMPDIR\");                      // Noncompliant {{Make sure publicly writable directories are used safely here.}}\n//                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            tmp = Environment.GetEnvironmentVariable(\"TMP\");            // Noncompliant\n            tmp = Environment.GetEnvironmentVariable(\"TEMP\");           // Noncompliant\n\n            string temp = \"TEMP\";\n            tmp = Environment.GetEnvironmentVariable(temp); // FN\n\n            tmp = Environment.GetEnvironmentVariable(42); // Error [CS1503]\n            tmp = Environment.GetEnvironmentVariable();   // Error [CS1501]\n\n            tmp = Environment.ExpandEnvironmentVariables(\"%TMPDIR%\");   // Noncompliant\n            tmp = Environment.ExpandEnvironmentVariables(\"%TMP%\");      // Noncompliant\n            tmp = Environment.ExpandEnvironmentVariables(\"%TEMP%\");     // Noncompliant\n            tmp = \"%USERPROFILE%\\\\AppData\\\\Local\\\\Temp\\\\f\";             // Noncompliant\n            tmp = \"%TEMP%\\\\f\";                                          // Noncompliant\n            tmp = \"%TMP%\\\\f\";                                           // Noncompliant\n            tmp = \"%TMPDIR%\\\\f\";                                        // Noncompliant\n//                ^^^^^^^^^^^^^\n\n            // Common\n            using (var tmpDir = new StreamReader(\"/tmp/f\")) { };        // Noncompliant\n            using (var tmpDir = new StreamReader(\"/tmp\")) { };          // Noncompliant\n            using (var tmpDir = new StreamReader(\"/var/tmp/f\")) { };    // Noncompliant\n            using (var tmpDir = new StreamReader(\"/usr/tmp/f\")) { };    // Noncompliant\n            using (var tmpDir = new StreamReader(\"/dev/shm/f\")) { };    // Noncompliant\n\n            // Linux\n            using (var tmpDir = new StreamReader(\"/dev/mqueue/f\")) { };     // Noncompliant\n            using (var tmpDir = new StreamReader(\"/run/lock/f\")) { };       // Noncompliant\n            using (var tmpDir = new StreamReader(\"/var/run/lock/f\")) { };   // Noncompliant\n\n            // MacOS\n            using (var tmpDir = new StreamReader(\"/Library/Caches/f\")) { };     // Noncompliant\n            using (var tmpDir = new StreamReader(\"/Users/Shared/f\")) { };       // Noncompliant\n            using (var tmpDir = new StreamReader(\"/private/tmp/f\")) { };        // Noncompliant\n            using (var tmpDir = new StreamReader(\"/private/var/tmp/f\")) { };    // Noncompliant\n\n            // Windows\n            using (var tmpDir = new StreamReader(\"C:\\\\Windows\\\\Temp\\\\f\")) { };  // Noncompliant\n            using (var tmpDir = new StreamReader(\"C:\\\\Temp\\\\f\")) { };           // Noncompliant\n            using (var tmpDir = new StreamReader(\"C:\\\\TEMP\\\\f\")) { };           // Noncompliant\n            using (var tmpDir = new StreamReader(\"C:\\\\TMP\\\\f\")) { };            // Noncompliant\n\n            // Variates\n            using (var tmpDir = new StreamReader(@\"/tmp/f\")) { };                   // Noncompliant\n            using (var tmpDir = new StreamReader(\"D:\\\\Windows\\\\Temp\\\\f\")) { };      // Noncompliant\n            using (var tmpDir = new StreamReader(\"\\\\\\\\Server_Name\\\\Temp\\\\f\")) { };  // Noncompliant\n            using (var tmpDir = new StreamReader(\"\\\\Windows\\\\Temp\\\\f\")) { };        // Noncompliant\n            using (var tmpDir = new StreamReader(@\"C:\\Windows\\Temp\\f\")) { };        // Noncompliant\n            using (var tmpDir = new StreamReader(@\"D:\\Windows\\Temp\\f\")) { };        // Noncompliant\n            using (var tmpDir = new StreamReader(@\"\\\\Windows\\Temp\\f\")) { };         // Noncompliant\n            using (var tmpDir = new StreamReader(@\"\\Windows\\Temp\\f\")) { };          // Noncompliant\n            tmp = \"/tmp/f\";                                                         // Noncompliant\n            tmp = \"/tEmP/f\";                                                        // Noncompliant\n\n            // Interpolated\n            tmp = $\"/tmp/{partOfPath}\";                                             // Noncompliant\n//                ^^^^^^^^^^^^^^^^^^^^\n        }\n\n        private string NonCompliantWithArg(string dir = \"/tmp\") // Noncompliant\n        {\n            return dir;\n        }\n\n        public string TempPath => Path.GetTempPath();           // Noncompliant\n\n        public string GetTempPath()\n        {\n            return Path.GetTempPath();                          // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/PubliclyWritableDirectories.vb",
    "content": "﻿Imports System\nImports System.IO\n\nNamespace Tests.TestCases\n\n    Public Class Program\n\n        Public Sub Compliant()\n            Dim RandomPath As String = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()) ' Compliant\n            Dim TempFileName As String = Path.GEtTempFileName() ' Compliant\n            Using TmpDir = New StreamReader(\"Path is /tmp/f\") ' Compliant\n            End Using\n            Using TmpDir = New StreamReader(\"C:\\\\Windows\\\\Tempete\") ' Compliant;\n            End Using\n            Dim url As String = \"http://example.domain/tmp/f\" ' Compliant\n        End Sub\n\n        Public Function CompliantWithArg(Optional Dir As String = \"/other/tmp\") As String ' Compliant\n            Return Dir\n        End Function\n\n        Public Sub NonCompliant(PartOfPath As String)\n            ' Environment\n            Dim Tmp As String = Path.GetTempPath()                      ' Noncompliant\n            Tmp = Path.GetTempPath()                                    ' Noncompliant\n            Tmp = Environment.GetEnvironmentVariable(\"TMPDIR\")          ' Noncompliant {{Make sure publicly writable directories are used safely here.}}\n            '     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            Tmp = Environment.GetEnvironmentVariable(\"TMP\")             ' Noncompliant\n            Tmp = Environment.GetEnvironmentVariable(\"TEMP\")            ' Noncompliant\n            Tmp = Environment.GetEnvironmentVariable(42)\n            Tmp = Environment.GetEnvironmentVariable() ' Error [BC30516]\n            Tmp = Environment.ExpandEnvironmentVariables(\"%TMPDIR%\")    ' Noncompliant\n            Tmp = Environment.ExpandEnvironmentVariables(\"%TMP%\")       ' Noncompliant\n            Tmp = Environment.ExpandEnvironmentVariables(\"%TEMP%\")      ' Noncompliant\n            Tmp = \"%USERPROFILE%\\AppData\\Local\\Temp\\f\"                  ' Noncompliant\n            Tmp = \"%TEMP%\\f\"                                            ' Noncompliant\n            Tmp = \"%TMP%\\f\"                                             ' Noncompliant\n            Tmp = \"%TMPDIR%\\f\"                                          ' Noncompliant\n            '     ^^^^^^^^^^^^\n\n            ' Common\n            Using TmpDir = New StreamReader(\"/tmp/f\")           ' Noncompliant\n            End Using\n            Using TmpDir = New StreamReader(\"/tmp\")             ' Noncompliant\n            End Using\n            Using TmpDir = New StreamReader(\"/var/tmp/f\")       ' Noncompliant\n            End Using\n            Using TmpDir = New StreamReader(\"/usr/tmp/f\")       ' Noncompliant\n            End Using\n            Using TmpDir = New StreamReader(\"/dev/shm/f\")       ' Noncompliant\n            End Using\n\n            ' Linux\n            Using TmpDir = New StreamReader(\"/dev/mqueue/f\")    ' Noncompliant\n            End Using\n            Using TmpDir = New StreamReader(\"/run/lock/f\")      ' Noncompliant\n            End Using\n            Using TmpDir = New StreamReader(\"/var/run/lock/f\")  ' Noncompliant\n            End Using\n\n            ' MacOS\n            Using TmpDir = New StreamReader(\"/Library/Caches/f\")    ' Noncompliant\n            End Using\n            Using TmpDir = New StreamReader(\"/Users/Shared/f\")      ' Noncompliant\n            End Using\n            Using TmpDir = New StreamReader(\"/private/tmp/f\")       ' Noncompliant\n            End Using\n            Using TmpDir = New StreamReader(\"/private/var/tmp/f\")   ' Noncompliant\n            End Using\n\n            ' Windows\n            Using TmpDir = New StreamReader(\"C:\\Windows\\Temp\\f\") ' Noncompliant\n            End Using\n            Using TmpDir = New StreamReader(\"C:\\Temp\\f\")         ' Noncompliant\n            End Using\n            Using TmpDir = New StreamReader(\"C:\\TEMP\\f\")         ' Noncompliant\n            End Using\n            Using TmpDir = New StreamReader(\"C:\\TMP\\f\")          ' Noncompliant\n            End Using\n\n            ' Variates\n            Using TmpDir = New StreamReader(\"/tmp/f\")               ' Noncompliant\n            End Using\n            Using TmpDir = New StreamReader(\"\\\\Server_Name\\Temp\\f\") ' Noncompliant\n            End Using\n            Using TmpDir = New StreamReader(\"C:\\Windows\\Temp\\f\")    ' Noncompliant\n            End Using\n            Using TmpDir = New StreamReader(\"D:\\Windows\\Temp\\f\")    ' Noncompliant\n            End Using\n            Using TmpDir = New StreamReader(\"\\Windows\\Temp\\f\")      ' Noncompliant\n            End Using\n            Tmp = \"/tmp/f\"  ' Noncompliant\n            Tmp = \"/TeMp/f\" ' Noncompliant\n\n            ' Interpolated\n            Tmp = $\"/tmp/{PartOfPath}\" ' Noncompliant\n            '     ^^^^^^^^^^^^^^^^^^^^\n\n        End Sub\n\n        Public Function NonCompliantWithArg(Optional Dir As String = \"/tmp\") As String ' Noncompliant\n            Return Dir\n        End Function\n\n        ReadOnly Property GetTempPath() As String\n            Get\n                Return Path.GetTempPath() ' Noncompliant\n            End Get\n        End Property\n\n        Public Sub Examples()\n            Const t As String = \"T\"\n            Const e As String = \"E\"\n            Const m As String = \"M\"\n            Const p As String = \"P\"\n            Const part1 As String = \"/tEmP\" ' Noncompliant\n            Const part2 As String = \"/f\"\n            Dim noncompliant2 As String = $\"{part1}{part2}\" ' Noncompliant\n            Dim tmp = Environment.GetEnvironmentVariable($\"{t}{e}{m}{p}\") ' Noncompliant\n            tmp = Environment.GetEnvironmentVariable($\"{t}{e}{m}{p}{5}\")\n        End Sub\n\n    End Class\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/RequestsWithExcessiveLength.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.InteropServices;\nusing System.Threading.Tasks;\nusing Microsoft.AspNetCore.Components.Forms;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Net6Poc.RequestsWithExcessiveLength.GenericAttributes;\n\npublic class MyController : Controller\n{\n    [HttpPost]\n    [DisableRequestSizeLimit] // Noncompliant {{Make sure the content length limit is safe here.}}\n    public ActionResult PostRequestWithNoLimit()\n    {\n        return null;\n    }\n\n    [HttpPost]\n    [RequestSizeLimit(8_388_609)] // Noncompliant\n    public ActionResult RequestSizeLimitAboveLimit()\n    {\n        [RequestFormLimits(MultipartBodyLengthLimit = 8_388_609)] // Noncompliant\n        ActionResult LocalFunction()\n        {\n            return null;\n        }\n        return LocalFunction();\n    }\n\n    public ActionResult PostRequest()\n    {\n        [RequestSizeLimit(8_388_609)] // Noncompliant\n        ActionResult LocalFunction()\n        {\n            return null;\n        }\n        return LocalFunction();\n    }\n\n    [HttpPost]\n    [RequestFormLimits(MultipartBodyLengthLimit = 8_388_609)] // Noncompliant\n    public ActionResult RequestFormLimitsAboveLimit()\n    {\n        [RequestSizeLimit(8_388_609)] // Secondary [1] {{Make sure the content length limit is safe here.}}\n        [RequestFormLimits(MultipartBodyLengthLimit = 8_388_609)] // Noncompliant [1]\n        ActionResult LocalFunction()\n        {\n            return null;\n        }\n        return LocalFunction();\n    }\n\n    [HttpPost]\n    public ActionResult RequestFormLimitsBelowLimit()\n    {\n        [DisableRequestSizeLimit()] // Noncompliant\n        ActionResult LocalFunction()\n        {\n            return null;\n        }\n        return LocalFunction();\n    }\n}\n\ninternal class TestCases\n{\n    [RequestSizeLimit(8_388_609)] // Noncompliant\n    public void Foo() { }\n\n    [GenericAttribute<int>(8_388_609)] // FN for performance reasons we decided not to handle derived classes\n    public void Bar() { }\n\n    public void Bar(IEnumerable<int> collection)\n    {\n        [RequestSizeLimit(8_388_609)] int Get() => 1; // Noncompliant [flow1] - FP not a security problem since the local methods and lambdas are not reachable\n        [RequestSizeLimit(1)] int GetSmall() => 1;\n\n        _ = collection.Select([DisableRequestSizeLimitAttribute()] (x) => x + 1); // Noncompliant [flow2] - FP\n\n        Action a = [RequestSizeLimit(8_388_609)] () => { }; // Secondary [flow3]\n\n        Action x = true\n            ? ([RequestFormLimits(MultipartBodyLengthLimit = 8_388_609)] () => { })\n            : [RequestFormLimits(MultipartBodyLengthLimit = 7_000_001)] () => { };\n\n        Call([RequestFormLimits(MultipartBodyLengthLimit = 8_388_609)] (x) => { }); // Noncompliant [flow3] {{Make sure the content length limit is safe here.}} - FP\n    }\n\n    private void Call(Action<int> action) => action(1);\n}\n\npublic class GenericAttribute<T> : RequestSizeLimitAttribute\n{\n    public GenericAttribute(long bytes) : base(bytes) { }\n}\n\npublic class StreamsBase\n{\n    protected const long BaseExceedsLimit = 1024 * 1024 * 8 + 1;\n    protected const long BaseCompliant = 1024;\n}\n\npublic class StreamsDerived : StreamsBase\n{\n    private const long ExceedsLimit = 1024 * 1024 * 8 + 1;\n    private const long Compliant = 1024;\n\n    public static void OpenReadStream(IBrowserFile file, long unknownSize)\n    {\n        file.OpenReadStream(1024 * 1024 * 20); // Noncompliant {{Make sure the content length limit is safe here.}}\n//      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        file.OpenReadStream(maxAllowedSize: 1024 * 1024 * 20); // Noncompliant\n        const long maxFileSizeNonCompliant = 1024 * 1024 * 20;\n        file.OpenReadStream(maxFileSizeNonCompliant); // Noncompliant\n        file.OpenReadStream(ExceedsLimit); // Noncompliant\n        file.OpenReadStream(20);\n        file.OpenReadStream(Compliant);\n        file.OpenReadStream(BaseExceedsLimit); // Noncompliant\n        file.OpenReadStream(BaseCompliant);\n        file.OpenReadStream(unknownSize);\n\n        var x = unknownSize;\n        file.OpenReadStream(x); // We do not track the value of x\n        file.OpenReadStream(GetSize()); // We do not track the value of GetSize()\n\n        long[] sizes = [ExceedsLimit, Compliant];\n        file.OpenReadStream(sizes[0]); // FN we don't track the value of sizes[0]\n        file.OpenReadStream(sizes[1]);\n        file.OpenReadStream(sizes[2]);\n\n        if (unknownSize > 1024 * 1024 * 20)\n        {\n            file.OpenReadStream(unknownSize); // FN we don't track the value of unknownSize\n        }\n        else\n        {\n            file.OpenReadStream(unknownSize);\n        }\n\n        static long GetSize() => 1024 * 1024 * 20;\n    }\n\n    public static void GetMultipleFiles(InputFileChangeEventArgs inputFileChange)\n    {\n        foreach (var part in inputFileChange.GetMultipleFiles()) // Default to a maximum of 10 files\n        {\n            part.OpenReadStream(); // Defaults to a maximum of 500 KB, 10 files x 500 KB = 5 MB which is less than the default 8 MB limit\n        }\n\n        foreach (var part in inputFileChange.GetMultipleFiles()) // Default to a maximum of 10 files\n        {\n            part.OpenReadStream(1024); // 10 files x 1 KB = 10 KB which is less than the default 8 MB limit\n            part.OpenReadStream(1024 * 1024); // Noncompliant - 10 files x 1 MB = 10 MB which exceeds the default 8 MB limit\n            part.OpenReadStream(ExceedsLimit); // Noncompliant\n        }\n\n        foreach (var part in inputFileChange.GetMultipleFiles(1))\n        {\n            part.OpenReadStream(1024); // 1 files x 1 KB = 1 KB which is less than the default 8 MB limit\n            part.OpenReadStream(1024 * 1024); // 1 MB < 8 MB limit\n            part.OpenReadStream(ExceedsLimit); // Noncompliant\n        }\n\n        var browserFiles = inputFileChange.GetMultipleFiles();\n        foreach (var part in browserFiles)\n        {\n            part.OpenReadStream(1024 * 1024); // Noncompliant\n        }\n\n        browserFiles = inputFileChange.GetMultipleFiles(1);\n        foreach (var part in browserFiles)\n        {\n            part.OpenReadStream(1024); // Compliant\n            part.OpenReadStream(1024 * 1024); // Compliant\n        }\n\n        browserFiles = inputFileChange.GetMultipleFiles(3 * 4);\n        foreach (var part in browserFiles)\n        {\n            part.OpenReadStream(1024 * 1024); // Noncompliant\n        }\n    }\n\n    public static void GetMultipleFiles_ArrayAccess(InputFileChangeEventArgs inputFileChange)\n    {\n        // The strategy used is to look at the closest invocation of GetMultipleFiles and use the value of the first argument.\n        // Due to this, the rule can be noisy if the user calls OpenReadStream with different sizes depending on the index.\n        // Since the rule is a hotspot, we decided to keep it simple and not sum up the size of all the invocations.\n        var defaultParameter = inputFileChange.GetMultipleFiles();\n        defaultParameter.First().OpenReadStream(1024 * 1024); // Noncompliant - 1 MB * 10 files = 10 MB which exceeds the default 8 MB limit\n\n        var differentIndexes = inputFileChange.GetMultipleFiles(20);\n        differentIndexes[0].OpenReadStream(2 * 1024 * 1024); // Noncompliant - 2 MB * 20 files = 40 MB which exceeds the default 8 MB limit\n        differentIndexes[1].OpenReadStream(3 * 1024 * 1024); // Noncompliant - 3 MB * 20 files = 60 MB which exceeds the default 8 MB limit\n        differentIndexes[2].OpenReadStream(4 * 1024 * 1024); // Noncompliant - 4 MB * 20 files = 80 MB which exceeds the default 8 MB limit\n\n        var sameIndex = inputFileChange.GetMultipleFiles(5);\n        sameIndex[0].OpenReadStream(2 * 1024 * 1024); // Noncompliant - 2 MB * 5 files = 10 MB which exceeds the default 8 MB limit\n        sameIndex[0].OpenReadStream(3 * 1024 * 1024); // Noncompliant - 3 MB * 5 files = 15 MB which exceeds the default 8 MB limit\n        sameIndex[0].OpenReadStream(4 * 1024 * 1024); // Noncompliant - 4 MB * 5 files = 20 MB which exceeds the default 8 MB limit\n\n        // Testing a mix of method calls for the same index and different indexes\n        var multipleAccess = inputFileChange.GetMultipleFiles(3);\n        multipleAccess[0].OpenReadStream(2 * 1024 * 1024);\n        multipleAccess[0].OpenReadStream(3 * 1024 * 1024); // Noncompliant - 3 MB * 3 files = 9 MB which exceeds the default 8 MB limit\n        multipleAccess[1].OpenReadStream(4 * 1024 * 1024); // Noncompliant - 4 MB * 3 files = 12 MB which exceeds the default 8 MB limit\n    }\n\n    public static void GetMultipleFiles_InLambda(InputFileChangeEventArgs inputFileChange)\n    {\n        Parallel.ForEach(inputFileChange.GetMultipleFiles(9), file =>\n        {\n            file.OpenReadStream(1024 * 1024); // Noncompliant\n        });\n    }\n\n    [DllImport(\"User32.dll\", CharSet = CharSet.Unicode)]\n    public static extern int MethodDeclarationWithoutABody(IntPtr h, string m, string c, int type);\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/RequestsWithExcessiveLength.cs",
    "content": "﻿using System;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Tests.Diagnostics\n{\n    public class MyController : Controller\n    {\n        [HttpPost]\n        [DisableRequestSizeLimit] // Noncompliant {{Make sure the content length limit is safe here.}}\n//       ^^^^^^^^^^^^^^^^^^^^^^^\n        public ActionResult PostRequestWithNoLimit()\n        {\n            return null;\n        }\n\n        [DisableRequestSizeLimitAttribute] // Noncompliant\n        public ActionResult DisableRequestSizeLimitWithFullName()\n        {\n            return null;\n        }\n\n        [HttpPost]\n        [RequestSizeLimit(8_388_609)] // Noncompliant {{Make sure the content length limit is safe here.}}\n//       ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        public ActionResult PostRequestAboveLimit()\n        {\n            return null;\n        }\n\n        [HttpPost]\n        [RequestSizeLimitAttribute(8_388_609)] // Noncompliant\n        public ActionResult RequestSizeLimitWithFullname()\n        {\n            return null;\n        }\n\n        [HttpPost]\n        [RequestSizeLimit(8_388_608)] // Compliant value is below limit.\n        public ActionResult PostRequestBelowLimit()\n        {\n            return null;\n        }\n\n        [HttpPost]\n        [RequestSizeLimit(8_389_632)] // Noncompliant\n        public ActionResult SizeWith1024Base()\n        {\n            return null;\n        }\n\n        [HttpPost]\n        [RequestFormLimits(MultipartBodyLengthLimit = 8_388_609, MultipartHeadersLengthLimit = 42)] // Noncompliant {{Make sure the content length limit is safe here.}}\n//       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        public ActionResult MultipartFormRequestAboveLimit()\n        {\n            return null;\n        }\n\n        [HttpPost]\n        [RequestFormLimitsAttribute(MultipartBodyLengthLimit = 8_388_609)] // Noncompliant\n        public ActionResult RequestFormLimitsWithFullname()\n        {\n            return null;\n        }\n\n        [HttpPost]\n        [RequestFormLimits(MultipartHeadersLengthLimit = 8_388_608)]\n        public ActionResult MultipartFormRequestHeadersLimitSet()\n        {\n            return null;\n        }\n\n        [HttpPost]\n        public ActionResult MultiPartFromRequestWithDefaultLimit()\n        {\n            return null;\n        }\n\n        [HttpPost]\n        [RequestFormLimits(MultipartHeadersLengthLimit = 42, MultipartBodyLengthLimit = 8_388_609)] // Noncompliant {{Make sure the content length limit is safe here.}}\n        public ActionResult RequestFormLimitsWithVariousParamsV1()\n        {\n            return null;\n        }\n\n        [HttpPost]\n        [RequestFormLimits(BufferBody = true, MultipartBodyLengthLimit = 8_388_609)]  // Noncompliant {{Make sure the content length limit is safe here.}}\n        public ActionResult RequestFormLimitsWithVariousParamsV2()\n        {\n            return null;\n        }\n\n        [HttpPost]\n        [RequestFormLimits(BufferBody = true, MultipartHeadersLengthLimit = 42, ValueCountLimit = 42, MultipartBodyLengthLimit = 8_388_609)] // Noncompliant\n        public ActionResult RequestFormLimitsWithVariousParamsV3()\n        {\n            return null;\n        }\n\n        [HttpPost]\n        [RequestFormLimits(BufferBody = true, MultipartHeadersLengthLimit = 42, ValueCountLimit = 42)]\n        public ActionResult RequestFormLimitsWithVariousParamsV4()\n        {\n            return null;\n        }\n\n        [HttpPost]\n        [RequestFormLimits(MultipartBodyLengthLimit = 8_388_608)] // Compliant value is below limit.\n        public ActionResult MultipartFormRequestBelowLimit()\n        {\n            return null;\n        }\n\n        [HttpPost]\n        [RequestFormLimits(MultipartBodyLengthLimit = \"NonNumericalValue\")] // Error [CS0029]\n        public ActionResult MultipartFormRequestNonNumerical()\n        {\n            return null;\n        }\n\n        [HttpPost]\n        [RequestFormLimits]\n        public ActionResult MultipartFormRequestWithoutParams()\n        {\n            return null;\n        }\n\n        [HttpPost]\n        [RequestFormLimits(42)] // Error [CS1729]\n        public ActionResult MultipartFormRequestNonNameEquals()\n        {\n            return null;\n        }\n\n        [HttpPost]\n        [RequestSizeLimit(\"NonNumerical\")] // Error [CS1503]\n        public ActionResult PostRequestNonNumerical()\n        {\n            return null;\n        }\n\n        [HttpPost]\n        [RequestSizeLimit] // Error [CS7036]\n        public ActionResult PostRequestWithoutParams()\n        {\n            return null;\n        }\n\n        [HttpPost]\n        [RequestSizeLimit(int.MaxValue)] // Noncompliant\n        public ActionResult RequestSizeLimitWithoutNumericLiteral()\n        {\n            return null;\n        }\n\n        [HttpPost]\n        [RequestSizeLimit(1000000000)] // Secondary [1] {{Make sure the content length limit is safe here.}}\n//       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        [RequestFormLimits(MultipartBodyLengthLimit = 1000000000)] // Noncompliant [1]\n//       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        public ActionResult RequestSizeLimitAndFormLimits()\n        {\n            return null;\n        }\n\n        [HttpPost]\n        [RequestSizeLimit(42)]\n        [RequestFormLimits(MultipartBodyLengthLimit = 1000000000)] // Noncompliant\n        public ActionResult SizeBelowLimitFormsAboveLimit()\n        {\n            return null;\n        }\n\n        [HttpPost]\n        [RequestSizeLimit(1000000000)] // Noncompliant\n        [RequestFormLimits(MultipartBodyLengthLimit = 42)]\n        public ActionResult SizeAboveLimitFormsBelowLimit()\n        {\n            return null;\n        }\n\n        [HttpPost]\n        [RequestSizeLimit(42)]\n        [RequestFormLimits(MultipartBodyLengthLimit = 42)]\n        public ActionResult BothBelowLimit()\n        {\n            return null;\n        }\n\n        public ActionResult MethodWithoutAttributes()\n        {\n            return null;\n        }\n    }\n\n    [DisableRequestSizeLimit] // Noncompliant\n//   ^^^^^^^^^^^^^^^^^^^^^^^\n    public class DisableRequestSizeLimitController : Controller\n    {\n\n    }\n\n    [RequestSizeLimit(8_388_609)] // Noncompliant\n    public class RequestSizeLimitAboveController : Controller\n    {\n\n    }\n\n    [RequestFormLimits(MultipartBodyLengthLimit = 8_388_609)] // Noncompliant\n    public class RequestFormLimitsAboveController : Controller\n    {\n\n    }\n\n    [RequestSizeLimit(8_388_608)]\n    public class RequestSizeLimitBelowController : Controller\n    {\n\n    }\n\n    [RequestFormLimits(MultipartHeadersLengthLimit = 8_388_608)]\n    public class RequestFormLimitsBelowController : Controller\n    {\n\n    }\n\n    internal class TestCases\n    {\n        [DerivedAttribute(8_388_609)] // FN for performance reasons we decided not to handle derived classes\n        public void Bar() { }\n    }\n\n    public class DerivedAttribute : RequestSizeLimitAttribute\n    {\n        public DerivedAttribute(long bytes) : base(bytes) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/RequestsWithExcessiveLength.vb",
    "content": "﻿Imports System\nImports Microsoft.AspNetCore.Mvc\n\nNamespace Tests.TestCases\n\n    Public Class MyController\n        Inherits Controller\n\n        <HttpPost>\n        <DisableRequestSizeLimit()>\n        Public Function PostRequestWithNoLimit() As ActionResult\n        '^^^^^^^^^^^^^^^^^^^^^^^^^  Noncompliant@-1 {{Make sure the content length limit is safe here.}}\n            Return Nothing\n        End Function\n\n        <HttpPost>\n        <DisableRequestSizeLimitAttribute()> ' Noncompliant\n        Public Function DisableRequestSizeLimitWithFullName() As ActionResult\n            Return Nothing\n        End Function\n\n        <HttpPost>\n        <RequestSizeLimit(8_388_609)>\n        Public Function PostRequestAboveLimit() As ActionResult\n        '^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant@-1 {{Make sure the content length limit is safe here.}}\n            Return Nothing\n        End Function\n\n        <HttpPost>\n        <RequestSizeLimit(8_388_609)> ' Noncompliant\n        Public Function RequestSizeLimitWithFullname() As ActionResult\n            Return Nothing\n        End Function\n\n        <HttpPost>\n        <RequestSizeLimit(8_388_608)> ' Compliant value Is below limit.\n        Public Function PostRequestBelowLimit() As ActionResult\n            Return Nothing\n        End Function\n\n        <HttpPost>\n        <RequestSizeLimit(8_389_632)> ' Noncompliant\n        Public Function SizeWith1024Base() As ActionResult\n            Return Nothing\n        End Function\n\n        <HttpPost>\n        <RequestFormLimits(MultipartBodyLengthLimit:=8_388_609, MultipartHeadersLengthLimit:=42)>\n        Public Function MultipartFormRequestAboveLimit() As ActionResult\n        '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant@-1 {{Make sure the content length limit is safe here.}}\n            Return Nothing\n        End Function\n\n        <HttpPost>\n        <RequestFormLimits(MultipartBodyLengthLimit:=8_388_609)> ' Noncompliant\n        Public Function RequestFormLimitsWithFullname() As ActionResult\n            Return Nothing\n        End Function\n\n        <HttpPost>\n        <RequestFormLimits(MultipartHeadersLengthLimit:=8_388_608)>\n        Public Function MultipartFormRequestHeadersLimitSet() As ActionResult\n            Return Nothing\n        End Function\n\n        <HttpPost>\n        <RequestFormLimits()>\n        Public Function MultiPartFromRequestWithDefaultLimit() As ActionResult\n            Return Nothing\n        End Function\n\n        <HttpPost>\n        <RequestFormLimits(MultipartHeadersLengthLimit:=42, MultipartBodyLengthLimit:=8_388_609)> ' Noncompliant\n        Public Function RequestFormLimitsWithVariousParamsV1() As ActionResult\n            Return Nothing\n        End Function\n\n        <HttpPost>\n        <RequestFormLimits(BufferBody:=True, MultipartBodyLengthLimit:=8_388_609)> ' Noncompliant\n        Public Function RequestFormLimitsWithVariousParamsV2() As ActionResult\n            Return Nothing\n        End Function\n\n        <HttpPost>\n        <RequestFormLimits(BufferBody:=True, MultipartHeadersLengthLimit:=42, ValueCountLimit:=42, MultipartBodyLengthLimit:=8_388_609)> ' Noncompliant\n        Public Function RequestFormLimitsWithVariousParamsV3() As ActionResult\n            Return Nothing\n        End Function\n\n        <HttpPost>\n        <RequestFormLimits(BufferBody:=True, MultipartHeadersLengthLimit:=42, ValueCountLimit:=42)>\n        Public Function RequestFormLimitsWithVariousParamsV4() As ActionResult\n            Return Nothing\n        End Function\n\n        <HttpPost>\n        <RequestFormLimits(mULTIPARTbODYlENGTHlIMIT:=8_388_608)> ' Compliant value Is below limit.\n        Public Function MultipartFormRequestBelowLimit() As ActionResult\n            Return Nothing\n        End Function\n\n        <HttpPost>\n        <RequestFormLimits(MultipartHeadersLengthLimit:=\"NonNumericalValue\")> ' Error [BC30934]\n        Public Function MultipartFormRequestNonNumerical() As ActionResult\n            Return Nothing\n        End Function\n\n        <HttpPost>\n        <RequestFormLimits>\n        Public Function MultipartFormRequestWithoutParams() As ActionResult\n            Return Nothing\n        End Function\n\n        <HttpPost>\n        <RequestFormLimits(42)> ' Error [BC30057]\n        Public Function MultipartFormRequestNonNameEquals() As ActionResult\n            Return Nothing\n        End Function\n\n        <HttpPost>\n        <RequestSizeLimit(\"NonNumerical\")> ' Error [BC30934]\n        Public Function PostRequestNonNumerical() As ActionResult\n            Return Nothing\n        End Function\n\n        <HttpPost>\n        <RequestSizeLimit> ' Error [BC30455]\n        Public Function PostRequestWithoutParams() As ActionResult\n            Return Nothing\n        End Function\n\n        <HttpPost>\n        <RequestSizeLimit(Integer.MaxValue)> ' Noncompliant\n        Public Function RequestSizeLimitWithoutNumericLiteral() As ActionResult\n            Return Nothing\n        End Function\n\n        <HttpPost>\n        <RequestFormLimits(MultipartBodyLengthLimit:=1000000000)> ' Noncompliant [1]\n        <RequestSizeLimit(1000000000)> ' Secondary [1] {{Make sure the content length limit is safe here.}}\n        Public Function RequestSizeLimitAndFormLimits() As ActionResult\n            Return Nothing\n        End Function\n\n        <HttpPost>\n        <RequestFormLimits(MultipartBodyLengthLimit:=1000000000)> ' Noncompliant\n        <RequestSizeLimit(42)>\n        Public Function SizeBelowLimitFormsAboveLimit() As ActionResult\n            Return Nothing\n        End Function\n\n        <HttpPost>\n        <RequestFormLimits(MultipartBodyLengthLimit:=42)>\n        <RequestSizeLimit(1000000000)> ' Noncompliant\n        Public Function SizeAboveLimitFormsBelowLimit() As ActionResult\n            Return Nothing\n        End Function\n\n        <HttpPost>\n        <RequestFormLimits(MultipartBodyLengthLimit:=42)>\n        <RequestSizeLimit(42)>\n        Public Function BothBelowLimit() As ActionResult\n            Return Nothing\n        End Function\n\n        Public Function MethodWithoutAttributes() As ActionResult\n            Return Nothing\n        End Function\n\n    End Class\n\n    <DisableRequestSizeLimit()>\n    Public Class DisableRequestSizeLimitController\n        Inherits Controller\n\n    End Class\n    '^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant@-4\n\n    <RequestSizeLimit(8_388_609)> ' Noncompliant\n    Public Class RequestSizeLimitAboveController\n        Inherits Controller\n\n    End Class\n\n    <RequestFormLimits(MultipartBodyLengthLimit:=8_388_609)> ' Noncompliant\n    Public Class RequestFormLimitsAboveController\n        Inherits Controller\n\n    End Class\n\n    <RequestSizeLimit(8_388_608)>\n    Public Class RequestSizeLimitBelowController\n        Inherits Controller\n\n    End Class\n\n    <RequestFormLimits(MultipartBodyLengthLimit:=8_388_608)>\n    Public Class RequestFormLimitsBelowController\n        Inherits Controller\n\n    End Class\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/RequestsWithExcessiveLength_CustomValues.cs",
    "content": "﻿using System;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Tests.Diagnostics\n{\n    public class MyController : Controller\n    {\n        [HttpPost]\n        [RequestSizeLimit(43)] // Noncompliant {{Make sure the content length limit is safe here.}}\n//       ^^^^^^^^^^^^^^^^^^^^\n        public ActionResult PostRequestAboveLimit()\n        {\n            return null;\n        }\n\n        [HttpPost]\n        [RequestFormLimits(MultipartBodyLengthLimit = 43)] // Noncompliant {{Make sure the content length limit is safe here.}}\n//       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        public ActionResult MultipartFormRequestAboveLimit()\n        {\n            return null;\n        }\n\n        [HttpPost]\n        [RequestSizeLimit(41)]\n        public ActionResult PostRequestBelowLimit()\n        {\n            return null;\n        }\n\n        [HttpPost]\n        [RequestFormLimits(MultipartBodyLengthLimit = 41)]\n        public ActionResult MultipartFormRequestBelowLimit()\n        {\n            return null;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/RequestsWithExcessiveLength_CustomValues.vb",
    "content": "﻿Imports System\nImports Microsoft.AspNetCore.Mvc\n\nNamespace Tests.TestCases\n\n    Public Class MyController\n        Inherits Controller\n\n        <HttpPost>\n        <RequestSizeLimit(43)>\n        Public Function PostRequestAboveLimit() As ActionResult\n        '^^^^^^^^^^^^^^^^^^^^ Noncompliant@-1 {{Make sure the content length limit is safe here.}}\n            Return Nothing\n        End Function\n\n        <HttpPost>\n        <RequestFormLimits(MultipartBodyLengthLimit:=43)>\n        Public Function MultipartFormRequestAboveLimit() As ActionResult\n        '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant@-1 {{Make sure the content length limit is safe here.}}\n            Return Nothing\n        End Function\n\n        <HttpPost>\n        <RequestSizeLimit(41)>\n        Public Function PostRequestBelowLimit() As ActionResult\n            Return Nothing\n        End Function\n\n        <HttpPost>\n        <RequestFormLimits(MultipartBodyLengthLimit:=41)>\n        Public Function MultipartFormRequestBelowLimit() As ActionResult\n            Return Nothing\n        End Function\n\n    End Class\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/SpecifyTimeoutOnRegex.DefaultMatchTimeout.cs",
    "content": "﻿using System.Text.RegularExpressions;\nusing System;\n\nAppDomain.CurrentDomain.SetData(\"REGEX_DEFAULT_MATCH_TIMEOUT\", TimeSpan.FromMilliseconds(100));\n\nvoid RegexPattern(string input)\n{\n    _ = new Regex(\".+@.+\", RegexOptions.None);  // Noncompliant, FP REGEX_DEFAULT_MATCH_TIMEOUT is set in the AppDomain\n    _ = Regex.IsMatch(input, \"[0-9]+\");         // Noncompliant, FP REGEX_DEFAULT_MATCH_TIMEOUT is set in the AppDomain\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/SpecifyTimeoutOnRegex.Latest.cs",
    "content": "﻿using System;\nusing System.Text.RegularExpressions;\n\nclass MyClass\n{\n    void ImplicitObject()\n    {\n        Regex patternOnly = new(\"some pattern\"); // Noncompliant {{Pass a timeout to limit the execution time.}}\n        //                  ^^^^^^^^^^^^^^^^^^^\n        Regex withOptions = new(\"some pattern\", RegexOptions.None); // Noncompliant\n        Regex defaultOrder = new(\"some pattern\", RegexOptions.None, TimeSpan.FromSeconds(1)); // Compliant\n    }\n\n    // Repro https://sonarsource.atlassian.net/browse/NET-227\n    void EnumerateSplitsAndMatchesMethod(ReadOnlySpan<char> input, RegexOptions options)\n    {\n        foreach (Range r in Regex.EnumerateSplits(input, \"something\")) { }                                   // Noncompliant\n        foreach (Range r in Regex.EnumerateSplits(input, \"something\", options)) { }                          // Noncompliant\n        foreach (Range r in Regex.EnumerateSplits(input, \"something\", options, TimeSpan.FromSeconds(1))) { } // Compliant\n\n        foreach (var m in Regex.EnumerateMatches(input, \"something\")) { }                                    // Noncompliant\n        foreach (var m in Regex.EnumerateMatches(input, \"something\", options)) { }                           // Noncompliant\n        foreach (var m in Regex.EnumerateMatches(input, \"something\", options, TimeSpan.FromSeconds(1))) { }  // Compliant\n    }\n}\n\npublic static class Extensions\n{\n    extension(string s)\n    {\n        public Regex NoncompliantProp => new(s);                                              // Noncompliant\n        public Regex CompliantProp => new(s, RegexOptions.None, TimeSpan.FromSeconds(1));     // Compliant\n\n        public Regex NoncompliantMethod() => new(s);                                          // Noncompliant\n        public Regex CompliantMethod() => new(s, RegexOptions.None, TimeSpan.FromSeconds(1)); // Compliant\n    }\n}\n\npublic class NulLConditionalAssignment\n{\n    public class Sample\n    {\n        public Regex Regex { get; set; }\n    }\n\n    public void Method(Sample sample)\n    {\n        sample?.Regex = new(\"something\");                                             // Noncompliant\n        sample?.Regex = new(\"something\", RegexOptions.None, TimeSpan.FromSeconds(1)); // Compliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/SpecifyTimeoutOnRegex.cs",
    "content": "﻿using System;\nusing System.ComponentModel.DataAnnotations;\nusing System.Text.RegularExpressions;\n\nclass Compliant\n{\n    void Ctor()\n    {\n        var defaultOrder = new Regex(\"some pattern\", RegexOptions.None, TimeSpan.FromSeconds(1)); // Compliant\n\n        var namedArgs = new Regex(\n            matchTimeout: TimeSpan.FromSeconds(1), // Compliant\n            pattern: \"some pattern\",\n            options: RegexOptions.None);\n    }\n\n    void Instance()\n    {\n        var regex = new Regex(\"some pattern\", RegexOptions.None, TimeSpan.FromSeconds(1));\n\n        var isMatch = regex.IsMatch(\"some input\"); // Compliant\n        var match = regex.Match(\"some input\"); // Compliant\n        var matches = regex.Matches(\"some input\"); // Compliant\n        var replace = regex.Replace(\"some input\", \"some replacement\"); // Compliant\n        var split = regex.Split(\"some input\"); // Compliant\n    }\n\n    void Static()\n    {\n        var isMatch = Regex.IsMatch(\"some input\", \"some pattern\", RegexOptions.None, TimeSpan.FromSeconds(1)); // Compliant\n        var match = Regex.Match(\"some input\", \"some pattern\", RegexOptions.None, TimeSpan.FromSeconds(1)); // Compliant\n        var matches = Regex.Matches(\"some input\", \"some pattern\", RegexOptions.None, TimeSpan.FromSeconds(1)); // Compliant\n        var replace = Regex.Replace(\"some input\", \"some pattern\", \"some replacement\", RegexOptions.None, TimeSpan.FromSeconds(1)); // Compliant\n        var split = Regex.Split(\"some input\", \"some pattern\", RegexOptions.None, TimeSpan.FromSeconds(1)); // Compliant\n    }\n\n    void NonBacktrackingSpecified()\n    {\n        var newOnBacktrackingOnly = new Regex(\"some pattern\", (RegexOptions)1024); // Compliant\n        var newOnAlsoBacktracking = new Regex(\"some pattern\", (RegexOptions)1025); // Compliant. RegexOptions is a flag enum\n        var staticOnSplit = Regex.Split(\"some input\", \"some pattern\", (RegexOptions)1024); // Compliant\n    }\n\n    void NoRegex()\n    {\n        var match = NoSystem.Regex.IsMatch(\"some input\", \"some pattern\"); // Compliant\n    }\n\n    [RegularExpression(\"[0-9]+\")] // Compliant, Default timeout is 2000 ms.\n    public string AttributeWithoutTimeout { get; set; }\n\n    [RegularExpression(\"[0-9]+\", MatchTimeoutInMilliseconds = 200)] // Compliant\n    public string AttributeWithTimeout { get; set; }\n}\n\nclass Noncompliant\n{\n    void Ctor()\n    {\n        var patternOnly = new Regex(\"some pattern\"); // Noncompliant {{Pass a timeout to limit the execution time.}}\n        //                ^^^^^^^^^^^^^^^^^^^^^^^^^\n        var withOptions = new Regex(\"some pattern\", RegexOptions.None); // Noncompliant\n    }\n\n    void Static(RegexOptions options)\n    {\n        var isMatch = Regex.IsMatch(\"some input\", \"some pattern\"); // Noncompliant\n        //            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        var match = Regex.Match(\"some input\", \"some pattern\"); // Noncompliant\n        var matches = Regex.Matches(\"some input\", \"some pattern\", RegexOptions.None); // Noncompliant\n        var replace = Regex.Replace(\"some input\", \"some pattern\", \"some replacement\", RegexOptions.None); // Noncompliant\n        var split = Regex.Split(\"some input\", \"some pattern\", options); // Noncompliant\n    }\n}\n\nclass DoesNotCrash\n{\n    void MethodWithoutIdentifier(__arglist)\n    {\n        MethodWithoutIdentifier(__arglist(\"\"));\n    }\n}\n\nnamespace NoSystem\n{\n    public class Regex\n    {\n        public static bool IsMatch(string input, string pattern)\n        {\n            return input == pattern;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/SpecifyTimeoutOnRegex.vb",
    "content": "﻿Imports System.ComponentModel.DataAnnotations\nImports System.Text.RegularExpressions\n\nClass Compliant\n\n    Sub Ctor()\n        Dim ctor As New Regex(\"some pattern\", RegexOptions.None, TimeSpan.FromSeconds(1)) ' Compliant\n    End Sub\n\n    Sub Instance()\n        Dim regex As New Regex(\"some pattern\", RegexOptions.None, TimeSpan.FromSeconds(1))\n\n        Dim isMatch = regex.IsMatch(\"some input\") ' Compliant\n        Dim match = regex.Match(\"some input\") ' Compliant\n        Dim matches = regex.Matches(\"some input\") ' Compliant\n        Dim replace = regex.Replace(\"some input\", \"some replacement\") ' Complaint\n        Dim split = regex.Split(\"some input\") ' Compliant\n    End Sub\n\n    Sub NonBacktrackingSpecified()\n        Dim newonBacktrackingOnly As New Regex(\"some pattern\", CType(1024, RegexOptions)) ' Compliant\n        Dim newonAlsoBacktracking As New Regex(\"some pattern\", CType(1025, RegexOptions)) ' Compliant\n        Dim split = Regex.Split(\"some input\", \"some pattern\", CType(1024, RegexOptions)) ' Compliant\n    End Sub\n\n    Sub _Static()\n        Dim isMatch = Regex.IsMatch(\"some input\", \"some pattern\", RegexOptions.None, TimeSpan.FromSeconds(1)) ' Compliant\n        Dim match = Regex.Match(\"some input\", \"some pattern\", RegexOptions.None, TimeSpan.FromSeconds(1)) ' Compliant\n        Dim matches = Regex.Matches(\"some input\", \"some pattern\", RegexOptions.None, TimeSpan.FromSeconds(1)) ' Compliant\n        Dim replace = Regex.Replace(\"some input\", \"some pattern\", \"some replacement\", RegexOptions.None, TimeSpan.FromSeconds(1)) ' Complaint\n        Dim split = Regex.Split(\"some input\", \"some pattern\", RegexOptions.None, TimeSpan.FromSeconds(1)) ' Compliant\n    End Sub\n\n    <RegularExpression(\"[0-9]+\")> ' Compliant, Default timeout is 2000 ms.\n    Public Property AttributeWithoutTimeout As String\n\n    <RegularExpression(\"[0-9]+\", MatchTimeoutInMilliseconds:=200)> ' Compliant\n    Public Property AttributeWithTimeout As String\n\nEnd Class\n\nClass Noncompliant\n\n    Sub Ctor()\n        Dim patternOnly As New Regex(\"some pattern\") ' Noncompliant {{Pass a timeout to limit the execution time.}}\n        '                  ^^^^^^^^^^^^^^^^^^^^^^^^^\n        Dim withOptions As New Regex(\"some pattern\", RegexOptions.None) ' Noncompliant\n    End Sub\n\n    Sub _Static(options As RegexOptions)\n        Dim isMatch = Regex.IsMatch(\"some input\", \"some pattern\") ' Noncompliant\n        Dim match = Regex.Match(\"some input\", \"some pattern\") ' Noncompliant\n        Dim matches = Regex.Matches(\"some input\", \"some pattern\", RegexOptions.None) ' Noncompliant\n        Dim replace = Regex.Replace(\"some input\", \"some pattern\", \"some replacement\", RegexOptions.None) ' Noncompliant\n        Dim split = Regex.Split(\"some input\", \"some pattern\", options) ' Noncompliant\n    End Sub\nEnd Class\n\nClass DoesNotCrash\n    Private Sub MethodWithoutIdentifier(__arglist)\n        MethodWithoutIdentifier(\"__arglist\"(\"\"))\n    End Sub\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/UnsafeCodeBlocks.cs",
    "content": "﻿using System;\n\npublic class Sample\n{\n    unsafe void MethodScope(byte* pointer) { }                      // Noncompliant {{Make sure that using \"unsafe\" is safe here.}}\n//  ^^^^^^\n\n    void BlockScope()\n    {\n        unsafe                                                      // Noncompliant\n//      ^^^^^^\n        {\n        }\n    }\n\n    void SafeMethod() { }                                           // Compliant\n\n    void LocalFunction()\n    {\n        unsafe void Local(byte* pointer) { }                        // Noncompliant\n        void SafeLocal(byte noPointer) { }                          // Compliant\n    }\n\n    unsafe class UnsafeClass { }                                    // Noncompliant\n\n    unsafe struct UnsafeStruct                                      // Noncompliant\n    {\n        unsafe fixed byte unsafeFixedBuffer[16];                    // Noncompliant\n    }\n\n    unsafe interface IUnsafeInterface { }                           // Noncompliant\n\n    unsafe Sample(byte* pointer) { }                                // Noncompliant\n\n    static unsafe Sample() { }                                      // Noncompliant\n\n    unsafe ~Sample() { }                                            // Noncompliant\n\n    unsafe byte* unsafeField;                                       // Noncompliant\n\n    unsafe byte* UnsafeProperty { get; }                            // Noncompliant\n\n    unsafe event EventHandler UnsafeEvent;                          // Noncompliant\n\n    unsafe delegate void UnsafeDelegate(byte* pointer);             // Noncompliant\n\n    unsafe int this[int i] => 5;                                    // Noncompliant\n\n    public unsafe static Sample operator +(Sample other) => other;  // Noncompliant\n\n    // from RSPEC\n    public unsafe int SubarraySum(int[] array, int start, int end)  // Noncompliant\n    {\n        var sum = 0;\n\n        // Skip array bound checks for extra performance\n        fixed (int* firstNumber = array)\n        {\n            for (int i = start; i < end; i++)\n                sum += *(firstNumber + i);\n        }\n\n        return sum;\n    }\n\n    // from C# docs\n    unsafe static void SquarePtrParam(int* p)                       // Noncompliant\n    {\n        *p *= *p;\n    }\n\n    unsafe static void Main()                                       // Noncompliant\n    {\n        int i = 5;\n        // Unsafe method: uses address-of operator (&).\n        SquarePtrParam(&i);\n        Console.WriteLine(i);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/UsingNonstandardCryptography.CSharp10.cs",
    "content": "﻿using System;\nusing System.Security.Cryptography;\n\nnamespace Tests.Diagnostics\n{\n    public record struct CustomCryptoTransform : ICryptoTransform  // Noncompliant\n    {\n        public int InputBlockSize => throw new NotImplementedException();\n\n        public int OutputBlockSize => throw new NotImplementedException();\n\n        public bool CanTransformMultipleBlocks => throw new NotImplementedException();\n\n        public bool CanReuseTransform => throw new NotImplementedException();\n\n        public void Dispose() => throw new NotImplementedException();\n\n        public int TransformBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset) => throw new NotImplementedException();\n\n        public byte[] TransformFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount) => throw new NotImplementedException();\n    }\n\n    public interface ICustomCryptoTransform : ICryptoTransform  // Noncompliant {{Make sure using a non-standard cryptographic algorithm is safe here.}}\n    {\n    }\n\n    public record struct CustomCryptoTransformWithInterface : ICustomCryptoTransform  // Noncompliant\n    {\n        public int InputBlockSize => throw new NotImplementedException();\n\n        public int OutputBlockSize => throw new NotImplementedException();\n\n        public bool CanTransformMultipleBlocks => throw new NotImplementedException();\n\n        public bool CanReuseTransform => throw new NotImplementedException();\n\n        public void Dispose() => throw new NotImplementedException();\n\n        public int TransformBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset) => throw new NotImplementedException();\n\n        public byte[] TransformFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount) => throw new NotImplementedException();\n    }\n\n    public record struct CustomCryptoTransformWithInterfacePositionalRecordStruct(string Property) : ICustomCryptoTransform  // Noncompliant\n    {\n        public int InputBlockSize => throw new NotImplementedException();\n\n        public int OutputBlockSize => throw new NotImplementedException();\n\n        public bool CanTransformMultipleBlocks => throw new NotImplementedException();\n\n        public bool CanReuseTransform => throw new NotImplementedException();\n\n        public void Dispose() => throw new NotImplementedException();\n\n        public int TransformBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset) => throw new NotImplementedException();\n\n        public byte[] TransformFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount) => throw new NotImplementedException();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/UsingNonstandardCryptography.CSharp12.cs",
    "content": "﻿using System;\nusing System.Security.Cryptography;\n\nclass CustomHashAlgorithmUsingPrimaryConstructor(byte[] array) : HashAlgorithm  // Noncompliant\n{\n    public override void Initialize() => throw new NotImplementedException();\n\n    protected override void HashCore(byte[] array, int ibStart, int cbSize) => throw new NotImplementedException();\n\n    protected override byte[] HashFinal() => throw new NotImplementedException();\n}\n\nclass CustomAsymmetricAlgorithm(byte[] array) : AsymmetricAlgorithm { } // Noncompliant\n\nclass DerivedFromCustomAsymmetricAlgorithm(byte[] array) : CustomAsymmetricAlgorithm(array) { } // Noncompliant\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/UsingNonstandardCryptography.CSharp9.cs",
    "content": "﻿using System;\nusing System.Security.Cryptography;\n\nnamespace Tests.Diagnostics\n{\n    public record CustomCryptoTransform : ICryptoTransform  // Noncompliant\n    {\n        public int InputBlockSize => throw new NotImplementedException();\n\n        public int OutputBlockSize => throw new NotImplementedException();\n\n        public bool CanTransformMultipleBlocks => throw new NotImplementedException();\n\n        public bool CanReuseTransform => throw new NotImplementedException();\n\n        public void Dispose() => throw new NotImplementedException();\n\n        public int TransformBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset) => throw new NotImplementedException();\n\n        public byte[] TransformFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount) => throw new NotImplementedException();\n    }\n\n    public interface ICustomCryptoTransform : ICryptoTransform  // Noncompliant {{Make sure using a non-standard cryptographic algorithm is safe here.}}\n    {\n    }\n\n    public record CustomCryptoTransformWithInterface : ICustomCryptoTransform  // Noncompliant\n    {\n        public int InputBlockSize => throw new NotImplementedException();\n\n        public int OutputBlockSize => throw new NotImplementedException();\n\n        public bool CanTransformMultipleBlocks => throw new NotImplementedException();\n\n        public bool CanReuseTransform => throw new NotImplementedException();\n\n        public void Dispose() => throw new NotImplementedException();\n\n        public int TransformBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset) => throw new NotImplementedException();\n\n        public byte[] TransformFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount) => throw new NotImplementedException();\n    }\n\n    public record CustomCryptoTransformWithInterfacePositionalRecord(string Property) : ICustomCryptoTransform  // Noncompliant\n    {\n        public int InputBlockSize => throw new NotImplementedException();\n\n        public int OutputBlockSize => throw new NotImplementedException();\n\n        public bool CanTransformMultipleBlocks => throw new NotImplementedException();\n\n        public bool CanReuseTransform => throw new NotImplementedException();\n\n        public void Dispose() => throw new NotImplementedException();\n\n        public int TransformBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset) => throw new NotImplementedException();\n\n        public byte[] TransformFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount) => throw new NotImplementedException();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/UsingNonstandardCryptography.cs",
    "content": "﻿using System;\nusing System.Security.Cryptography;\n\nnamespace Tests.Diagnostics\n{\n    public class CustomHashAlgorithm : HashAlgorithm  // Noncompliant {{Make sure using a non-standard cryptographic algorithm is safe here.}}\n//               ^^^^^^^^^^^^^^^^^^^\n    {\n        public override void Initialize() => throw new NotImplementedException();\n\n        protected override void HashCore(byte[] array, int ibStart, int cbSize) => throw new NotImplementedException();\n\n        protected override byte[] HashFinal() => throw new NotImplementedException();\n    }\n\n    public class CustomCryptoTransform : ICryptoTransform  // Noncompliant {{Make sure using a non-standard cryptographic algorithm is safe here.}}\n//               ^^^^^^^^^^^^^^^^^^^^^\n    {\n        public int InputBlockSize => throw new NotImplementedException();\n\n        public int OutputBlockSize => throw new NotImplementedException();\n\n        public bool CanTransformMultipleBlocks => throw new NotImplementedException();\n\n        public bool CanReuseTransform => throw new NotImplementedException();\n\n        public void Dispose() => throw new NotImplementedException();\n\n        public int TransformBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset) => throw new NotImplementedException();\n\n        public byte[] TransformFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount) => throw new NotImplementedException();\n    }\n\n    public interface ICustomCryptoTransform : ICryptoTransform  // Noncompliant {{Make sure using a non-standard cryptographic algorithm is safe here.}}\n//                   ^^^^^^^^^^^^^^^^^^^^^^\n    {\n    }\n\n    public class CustomCryptoTransformWithInterface : ICustomCryptoTransform  // Noncompliant {{Make sure using a non-standard cryptographic algorithm is safe here.}}\n    //           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    {\n        public int InputBlockSize => throw new NotImplementedException();\n\n        public int OutputBlockSize => throw new NotImplementedException();\n\n        public bool CanTransformMultipleBlocks => throw new NotImplementedException();\n\n        public bool CanReuseTransform => throw new NotImplementedException();\n\n        public void Dispose() => throw new NotImplementedException();\n\n        public int TransformBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset) => throw new NotImplementedException();\n\n        public byte[] TransformFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount) => throw new NotImplementedException();\n    }\n\n    internal class CustomDerivebytes : DeriveBytes  // Noncompliant {{Make sure using a non-standard cryptographic algorithm is safe here.}}\n//                 ^^^^^^^^^^^^^^^^^\n    {\n        public override byte[] GetBytes(int cb) => throw new NotImplementedException();\n\n        public override void Reset() => throw new NotImplementedException();\n\n        private class CustomSymmetricAlgorithm : SymmetricAlgorithm  // Noncompliant {{Make sure using a non-standard cryptographic algorithm is safe here.}}\n//                    ^^^^^^^^^^^^^^^^^^^^^^^^\n        {\n            public override ICryptoTransform CreateDecryptor(byte[] rgbKey, byte[] rgbIV) => throw new NotImplementedException();\n\n            public override ICryptoTransform CreateEncryptor(byte[] rgbKey, byte[] rgbIV) => throw new NotImplementedException();\n\n            public override void GenerateIV() => throw new NotImplementedException();\n\n            public override void GenerateKey() => throw new NotImplementedException();\n        }\n    }\n\n    public class CustomAsymmetricAlgorithm : AsymmetricAlgorithm  // Noncompliant {{Make sure using a non-standard cryptographic algorithm is safe here.}}\n//               ^^^^^^^^^^^^^^^^^^^^^^^^^\n    {\n    }\n\n    public class DerivedClassFromCustomAsymmetricAlgorithm : CustomAsymmetricAlgorithm  // Noncompliant {{Make sure using a non-standard cryptographic algorithm is safe here.}}\n//               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    {\n    }\n\n    public class CustomAsymmetricKeyExchangeDeformatter : AsymmetricKeyExchangeDeformatter  // Noncompliant {{Make sure using a non-standard cryptographic algorithm is safe here.}}\n//               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    {\n        public override string Parameters { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }\n\n        public override byte[] DecryptKeyExchange(byte[] rgb) => throw new NotImplementedException();\n\n        public override void SetKey(AsymmetricAlgorithm key) => throw new NotImplementedException();\n    }\n\n    public class CustomAsymmetricKeyExchangeFormatter : AsymmetricKeyExchangeFormatter  // Noncompliant {{Make sure using a non-standard cryptographic algorithm is safe here.}}\n//               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    {\n        public override string Parameters => throw new NotImplementedException();\n\n        public override byte[] CreateKeyExchange(byte[] data) => throw new NotImplementedException();\n\n        public override byte[] CreateKeyExchange(byte[] data, Type symAlgType) => throw new NotImplementedException();\n\n        public override void SetKey(AsymmetricAlgorithm key) => throw new NotImplementedException();\n    }\n\n    public class CustomAsymmetricSignatureDeformatter : AsymmetricSignatureDeformatter  // Noncompliant {{Make sure using a non-standard cryptographic algorithm is safe here.}}\n//               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    {\n        public override void SetHashAlgorithm(string strName) => throw new NotImplementedException();\n\n        public override void SetKey(AsymmetricAlgorithm key) => throw new NotImplementedException();\n\n        public override bool VerifySignature(byte[] rgbHash, byte[] rgbSignature) => throw new NotImplementedException();\n    }\n\n    public class CustomAsymmetricSignatureFormatter : AsymmetricSignatureFormatter  // Noncompliant {{Make sure using a non-standard cryptographic algorithm is safe here.}}\n//               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    {\n        public override byte[] CreateSignature(byte[] rgbHash) => throw new NotImplementedException();\n\n        public override void SetHashAlgorithm(string strName) => throw new NotImplementedException();\n\n        public override void SetKey(AsymmetricAlgorithm key) => throw new NotImplementedException();\n    }\n\n    public class CustomKeyedHashAlgorithm : KeyedHashAlgorithm  // Noncompliant {{Make sure using a non-standard cryptographic algorithm is safe here.}}\n//               ^^^^^^^^^^^^^^^^^^^^^^^^\n    {\n        public override void Initialize() => throw new NotImplementedException();\n\n        protected override void HashCore(byte[] array, int ibStart, int cbSize) => throw new NotImplementedException();\n\n        protected override byte[] HashFinal() => throw new NotImplementedException();\n    }\n\n    public struct CustomCryptoTransformStruct : ICryptoTransform  // Noncompliant\n    {\n        public int InputBlockSize => throw new NotImplementedException();\n\n        public int OutputBlockSize => throw new NotImplementedException();\n\n        public bool CanTransformMultipleBlocks => throw new NotImplementedException();\n\n        public bool CanReuseTransform => throw new NotImplementedException();\n\n        public void Dispose() => throw new NotImplementedException();\n\n        public int TransformBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset) => throw new NotImplementedException();\n\n        public byte[] TransformFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount) => throw new NotImplementedException();\n    }\n}\n\npublic class ClassThatDoesNotInheritOrImplementAnything // Compliant\n{\n}\n\npublic interface InterfaceThatDoesNotInheritOrImplementAnything // Compliant\n{\n}\n\npublic interface InterfaceThatDoesNotInheritCryptographic : IDisposable // Compliant\n{\n}\n\npublic sealed class ClassThatDoesNotInheritCryptographic : IDisposable // Compliant\n{\n    public void Dispose() => throw new NotImplementedException();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Hotspots/UsingNonstandardCryptography.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.Linq\nImports System.Text\nImports System.Security.Cryptography\n\nPublic Class CustomHash  ' Noncompliant {{Make sure using a non-standard cryptographic algorithm is safe here.}}\n'            ^^^^^^^^^^\n    Inherits HashAlgorithm\n\n    Public Overrides Sub Initialize()\n        Throw New NotImplementedException()\n    End Sub\n\n    Protected Overrides Sub HashCore(array() As Byte, ibStart As Integer, cbSize As Integer)\n        Throw New NotImplementedException()\n    End Sub\n\n    Protected Overrides Function HashFinal() As Byte()\n        Throw New NotImplementedException()\n    End Function\n\nEnd Class\n\nPublic class CustomCryptoTransform  ' Noncompliant {{Make sure using a non-standard cryptographic algorithm is safe here.}}\n'            ^^^^^^^^^^^^^^^^^^^^^\n    Implements ICryptoTransform\n\n    Public ReadOnly Property InputBlockSize As Integer Implements ICryptoTransform.InputBlockSize\n        Get\n            Throw New NotImplementedException()\n        End Get\n    End Property\n\n    Public ReadOnly Property OutputBlockSize As Integer Implements ICryptoTransform.OutputBlockSize\n        Get\n            Throw New NotImplementedException()\n        End Get\n    End Property\n\n    Public ReadOnly Property CanTransformMultipleBlocks As Boolean Implements ICryptoTransform.CanTransformMultipleBlocks\n        Get\n            Throw New NotImplementedException()\n        End Get\n    End Property\n\n    Public ReadOnly Property CanReuseTransform As Boolean Implements ICryptoTransform.CanReuseTransform\n        Get\n            Throw New NotImplementedException()\n        End Get\n    End Property\n\n    Public Function TransformBlock(inputBuffer() As Byte, inputOffset As Integer, inputCount As Integer, outputBuffer() As Byte, outputOffset As Integer) As Integer Implements ICryptoTransform.TransformBlock\n        Throw New NotImplementedException()\n    End Function\n\n    Public Function TransformFinalBlock(inputBuffer() As Byte, inputOffset As Integer, inputCount As Integer) As Byte() Implements ICryptoTransform.TransformFinalBlock\n        Throw New NotImplementedException()\n    End Function\n\n    Public Sub Dispose() Implements IDisposable.Dispose\n        Throw New NotImplementedException()\n    End Sub\n\nEnd Class\n\nPublic Interface ICustomCryptoTransform  ' Noncompliant {{Make sure using a non-standard cryptographic algorithm is safe here.}}\n'                ^^^^^^^^^^^^^^^^^^^^^^\n    Inherits ICryptoTransform\n\nEnd Interface\n\nPublic class CustomCryptoTransformWithInterface  ' Noncompliant {{Make sure using a non-standard cryptographic algorithm is safe here.}}\n'            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    Implements ICustomCryptoTransform\n\n    Public ReadOnly Property InputBlockSize As Integer Implements ICryptoTransform.InputBlockSize\n        Get\n            Throw New NotImplementedException()\n        End Get\n    End Property\n\n    Public ReadOnly Property OutputBlockSize As Integer Implements ICryptoTransform.OutputBlockSize\n        Get\n            Throw New NotImplementedException()\n        End Get\n    End Property\n\n    Public ReadOnly Property CanTransformMultipleBlocks As Boolean Implements ICryptoTransform.CanTransformMultipleBlocks\n        Get\n            Throw New NotImplementedException()\n        End Get\n    End Property\n\n    Public ReadOnly Property CanReuseTransform As Boolean Implements ICryptoTransform.CanReuseTransform\n        Get\n            Throw New NotImplementedException()\n        End Get\n    End Property\n\n    Public Function TransformBlock(inputBuffer() As Byte, inputOffset As Integer, inputCount As Integer, outputBuffer() As Byte, outputOffset As Integer) As Integer Implements ICryptoTransform.TransformBlock\n        Throw New NotImplementedException()\n    End Function\n\n    Public Function TransformFinalBlock(inputBuffer() As Byte, inputOffset As Integer, inputCount As Integer) As Byte() Implements ICryptoTransform.TransformFinalBlock\n        Throw New NotImplementedException()\n    End Function\n\n    Public Sub Dispose() Implements IDisposable.Dispose\n        Throw New NotImplementedException()\n    End Sub\n\nEnd Class\n\nPublic class CustomDerivebytes  ' Noncompliant {{Make sure using a non-standard cryptographic algorithm is safe here.}}\n'            ^^^^^^^^^^^^^^^^^\n    Inherits DeriveBytes\n\n    Public Overrides Sub Reset()\n        Throw New NotImplementedException()\n    End Sub\n\n    Public Overrides Function GetBytes(cb As Integer) As Byte()\n        Throw New NotImplementedException()\n    End Function\n\nEnd Class\n\nPublic class CustomSymmetricAlgorithm  ' Noncompliant {{Make sure using a non-standard cryptographic algorithm is safe here.}}\n'            ^^^^^^^^^^^^^^^^^^^^^^^^\n    Inherits SymmetricAlgorithm\n\n    Public Overrides Sub GenerateKey()\n        Throw New NotImplementedException()\n    End Sub\n\n    Public Overrides Sub GenerateIV()\n        Throw New NotImplementedException()\n    End Sub\n\n    Public Overrides Function CreateEncryptor(rgbKey() As Byte, rgbIV() As Byte) As ICryptoTransform\n        Throw New NotImplementedException()\n    End Function\n\n    Public Overrides Function CreateDecryptor(rgbKey() As Byte, rgbIV() As Byte) As ICryptoTransform\n        Throw New NotImplementedException()\n    End Function\n\nEnd Class\n\nPublic class CustomAsymmetricAlgorithm  ' Noncompliant {{Make sure using a non-standard cryptographic algorithm is safe here.}}\n'            ^^^^^^^^^^^^^^^^^^^^^^^^^\n    Inherits AsymmetricAlgorithm\n\nEnd Class\n\nPublic class DerivedClassFromCustomAsymmetricAlgorithm  ' Noncompliant {{Make sure using a non-standard cryptographic algorithm is safe here.}}\n'            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    Inherits CustomAsymmetricAlgorithm\n\nEnd Class\n\nPublic class CustomAsymmetricKeyExchangeDeformatter  ' Noncompliant {{Make sure using a non-standard cryptographic algorithm is safe here.}}\n'            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    Inherits AsymmetricKeyExchangeDeformatter\n    Public Overrides Property Parameters As String\n        Get\n            Throw New NotImplementedException()\n        End Get\n        Set(value As String)\n            Throw New NotImplementedException()\n        End Set\n    End Property\n\n    Public Overrides Sub SetKey(key As AsymmetricAlgorithm)\n        Throw New NotImplementedException()\n    End Sub\n\n    Public Overrides Function DecryptKeyExchange(rgb() As Byte) As Byte()\n        Throw New NotImplementedException()\n    End Function\n\nEnd Class\n\nPublic Class CustomAsymmetricKeyExchangeFormatter  ' Noncompliant {{Make sure using a non-standard cryptographic algorithm is safe here.}}\n'            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    Inherits AsymmetricKeyExchangeFormatter\n\n    Public Overrides ReadOnly Property Parameters As String\n        Get\n            Throw New NotImplementedException()\n        End Get\n    End Property\n\n    Public Overrides Sub SetKey(key As AsymmetricAlgorithm)\n        Throw New NotImplementedException()\n    End Sub\n\n    Public Overrides Function CreateKeyExchange(data() As Byte) As Byte()\n        Throw New NotImplementedException()\n    End Function\n\n    Public Overrides Function CreateKeyExchange(data() As Byte, symAlgType As Type) As Byte()\n        Throw New NotImplementedException()\n    End Function\n\nEnd Class\n\nPublic class CustomAsymmetricSignatureDeformatter  ' Noncompliant {{Make sure using a non-standard cryptographic algorithm is safe here.}}\n'            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    Inherits AsymmetricSignatureDeformatter\n\n    Public Overrides Sub SetKey(key As AsymmetricAlgorithm)\n        Throw New NotImplementedException()\n    End Sub\n\n    Public Overrides Sub SetHashAlgorithm(strName As String)\n        Throw New NotImplementedException()\n    End Sub\n\n    Public Overrides Function VerifySignature(rgbHash() As Byte, rgbSignature() As Byte) As Boolean\n        Throw New NotImplementedException()\n    End Function\n\nEnd Class\n\nPublic class CustomAsymmetricSignatureFormatter  ' Noncompliant {{Make sure using a non-standard cryptographic algorithm is safe here.}}\n'            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    Inherits AsymmetricSignatureFormatter\n\n    Public Overrides Sub SetKey(key As AsymmetricAlgorithm)\n        Throw New NotImplementedException()\n    End Sub\n\n    Public Overrides Sub SetHashAlgorithm(strName As String)\n        Throw New NotImplementedException()\n    End Sub\n\n    Public Overrides Function CreateSignature(rgbHash() As Byte) As Byte()\n        Throw New NotImplementedException()\n    End Function\nEnd Class\n\nPublic class CustomKeyedHashAlgorithm  ' Noncompliant {{Make sure using a non-standard cryptographic algorithm is safe here.}}\n'            ^^^^^^^^^^^^^^^^^^^^^^^^\n    Inherits KeyedHashAlgorithm\n\n    Public Overrides Sub Initialize()\n        Throw New NotImplementedException()\n    End Sub\n\n    Protected Overrides Sub HashCore(array() As Byte, ibStart As Integer, cbSize As Integer)\n        Throw New NotImplementedException()\n    End Sub\n\n    Protected Overrides Function HashFinal() As Byte()\n        Throw New NotImplementedException()\n    End Function\nEnd Class\n\nPublic class ClassThatDoesNotInheritOrImplementAnything  ' Compliant\n\nEnd Class\n\nPublic Interface InterfaceThatDoesNotInheritOrImplementAnything  ' Compliant\n\nEnd Interface\n\nPublic Interface InterfaceThatDoesNotInheritCryptographic  ' Compliant\n    Inherits IDisposable\n\nEnd Interface\n\nPublic Class ClassThatDoesNotInheritCryptographic  ' Compliant\n    Implements IDisposable\n\n    Public Sub Dispose() Implements IDisposable.Dispose\n        Throw New NotImplementedException()\n    End Sub\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/IdentifiersNamedExtensionShouldBeEscaped.BeforeCSharp14.cs",
    "content": "﻿// The structure of this file must mirror IdentifiersNamedExtensionShouldBeEscaped.Latest.cs.\n// Both files must be kept in sync — add new test cases to both files.\n// Annotations differ: in C# 14, all noncompliant cases are compiler errors instead of S8368 diagnostics.\n\nnamespace Noncompliant\n{\n    namespace ClassType { class extension { } } // Noncompliant\n\n    namespace Members\n    {\n        class @extension\n        {\n            extension() { } // Noncompliant\n        }\n\n        unsafe class MyClass\n        {\n            extension M() { return null; }              // Noncompliant\n            extension Property { get { return null; } } // Noncompliant\n            extension field;                            // Noncompliant\n\n            extension[] ArrayReturn() { return null; }   // Noncompliant\n            extension[] arrayField;                      // Noncompliant\n\n            extension[][] JaggedArrayReturn() { return null; }  // Noncompliant\n            extension[][] jaggedArrayField;                     // Noncompliant\n            extension[,] MultiDimArrayReturn() { return null; } // Noncompliant\n            extension[,] multiDimArrayField;                    // Noncompliant\n\n            extension* PointerReturn() { return null; } // Noncompliant\n            extension* pointerField;                    // Noncompliant\n\n            extension this[int i] { get { return null; } }                            // Noncompliant\n            public static extension operator +(MyClass a, MyClass b) { return null; } // Noncompliant\n        }\n    }\n\n    namespace Nullable\n    {\n        struct @extension { }\n\n        class MyClass\n        {\n            extension M() { return new @extension(); }  // Noncompliant\n            extension? N() { return null; }             // Noncompliant\n        }\n    }\n\n}\n\nnamespace Compliant\n{\n    namespace ClassType { class @extension { }; class MyExtension { } }\n\n    namespace Members\n    {\n        class @extension { @extension() { } ~extension() { } }\n\n        unsafe class MyClass\n        {\n            void extension() { }\n            @extension N() { return null; }\n            @extension Escaped { get { return null; } }\n            @extension escapedField;\n\n            @extension[] EscapedArrayReturn() { return null; }\n            @extension[] escapedArrayField;\n            System.Collections.Generic.List<extension> ListReturn() { return null; }\n            System.Collections.Generic.List<extension> listField;\n            System.Collections.Generic.List<@extension> EscapedListReturn() { return null; }\n            System.Collections.Generic.List<@extension> escapedListField;\n\n            @extension* EscapedPointerReturn() { return null; }\n            @extension* escapedPointerField;\n\n            @extension this[int i] { get { return null; } }\n            public static @extension operator +(MyClass a, MyClass b) { return null; }\n            public static explicit operator extension(MyClass x) { return null; }\n\n            void ParameterMethod(extension x) { }\n            void LocalVarMethod() { extension x = null; }\n        }\n    }\n\n    namespace Events\n    {\n        delegate void @extension();\n\n        class MyClass\n        {\n            event extension MyEvent;\n            event @extension EscapedEvent;\n        }\n    }\n\n    namespace QualifiedNames\n    {\n        class MyClass\n        {\n            Noncompliant.Members.extension QualifiedField;\n            global::Noncompliant.Members.extension GlobalQualifiedField;\n            global::extension GlobalDirectField;\n        }\n    }\n}\n\nclass @extension { }\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/IdentifiersNamedExtensionShouldBeEscaped.Latest.cs",
    "content": "﻿// The structure of this file must mirror IdentifiersNamedExtensionShouldBeEscaped.BeforeCSharp14.cs.\n// Both files must be kept in sync — add new test cases to both files.\n// Annotations differ: C# 14 emits compiler errors for all noncompliant cases instead of S8368 diagnostics.\n\nnamespace Noncompliant\n{\n    namespace ClassType { class extension { } } // Error [CS9306] Types and aliases cannot be named 'extension'.\n\n    namespace Members\n    {\n        class @extension\n        {\n            extension() { } // Error [CS9283, CS1031]\n        }\n\n        unsafe class MyClass\n        {\n            extension M() => default;      // Error [CS9281, CS9283, CS1031, CS1513, CS1514, CS1519]\n            extension Property { get; }    // Error [CS9281, CS9283, CS1003, CS1026, CS1031, CS1519, CS1519]\n            extension field;               // Error [CS9281, CS9283, CS1003, CS1026, CS1031]\n\n            extension[] ArrayReturn() => default;   // Error [CS9283, CS1003, CS1001, CS0246, CS1003, CS9285, CS8124, CS1003, CS1026]\n            extension[] arrayField;                 // Error [CS9283, CS1003, CS1001, CS0246, CS1026]\n\n            extension[][] JaggedArrayReturn() => default;   // Error [CS9283, CS1003, CS1001, CS1001, CS0246, CS1003, CS9285, CS8124, CS1003, CS1026]\n            extension[][] jaggedArrayField;                 // Error [CS9283, CS1003, CS1001, CS1001, CS0246, CS1026]\n            extension[,] MultiDimArrayReturn() => default;  // Error [CS9283, CS1003, CS1001, CS0246, CS1003, CS9285, CS8124, CS1003, CS1026]\n            extension[,] multiDimArrayField;                // Error [CS9283, CS1003, CS1001, CS0246, CS1026]\n\n            extension* PointerReturn() { return null; } // Error [CS9283, CS1003, CS1031, CS1103, CS1003, CS9285, CS8124, CS1026, CS1519]\n            extension* pointerField;                    // Error [CS9283, CS1003, CS1031, CS1103, CS1026]\n\n            extension this[int i] => default;                                    // Error [CS9283, CS0027, CS1003, CS0270, CS1031, CS1525, CS1003, CS1003, CS1026]\n            public static extension operator +(MyClass a, MyClass b) => default; // Error [CS0106, CS0106, CS9283, CS1003, CS1003, CS1031, CS1003, CS9285, CS1003, CS1026]\n        }\n    }\n\n    namespace Nullable\n    {\n        struct @extension { }\n\n        class MyClass\n        {\n            extension M() { return new @extension(); }  // Error [CS9283, CS9281, CS1031, CS1519, CS0106, CS1520, CS9282]\n            extension? N() { return null; }             // Error [CS9283, CS1003, CS1031, CS1003, CS9285, CS8124, CS1026, CS1519]\n        }\n    }\n\n}\n\nnamespace Compliant\n{\n    namespace ClassType { class @extension { }; class MyExtension { } }\n\n    namespace Members\n    {\n        class @extension { @extension() { } ~extension() { } }\n\n        unsafe class MyClass\n        {\n            void extension() { }\n            @extension N() { return null; }\n            @extension Escaped { get { return null; } }\n            @extension escapedField;\n\n            @extension[] EscapedArrayReturn() { return null; }\n            @extension[] escapedArrayField;\n            System.Collections.Generic.List<extension> ListReturn() { return null; }\n            System.Collections.Generic.List<extension> listField;\n            System.Collections.Generic.List<@extension> EscapedListReturn() { return null; }\n            System.Collections.Generic.List<@extension> escapedListField;\n\n            @extension* EscapedPointerReturn() { return null; }\n            @extension* escapedPointerField;\n\n            @extension this[int i] { get { return null; } }\n            public static @extension operator +(MyClass a, MyClass b) { return null; }\n            public static explicit operator extension(MyClass x) { return null; }\n\n            void ParameterMethod(extension x) { }\n            void LocalVarMethod() { extension x = null; }\n        }\n    }\n\n    namespace Events\n    {\n        delegate void @extension();\n\n        class MyClass\n        {\n            event extension MyEvent;\n            event @extension EscapedEvent;\n        }\n    }\n\n    namespace QualifiedNames\n    {\n        class MyClass\n        {\n            Noncompliant.Members.extension QualifiedField;               // no annotation: rule doesn't fire (C# 14), no compiler error (qualified access)\n            global::Noncompliant.Members.extension GlobalQualifiedField; // no annotation: rule doesn't fire (C# 14), no compiler error (qualified access)\n            global::extension GlobalDirectField;                          // no annotation: rule doesn't fire (C# 14), no compiler error (qualified access)\n        }\n    }\n}\n\nclass @extension { }\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/IdentifiersNamedFieldShouldBeEscaped.BeforeCSharp14.cs",
    "content": "public partial class Sample\n{\n    private int field;\n\n    public int Prop1\n    {\n        get\n        {\n            int field = 0; // Noncompliant {{'field' is a contextual keyword in C# 14. Rename it, escape it as '@field', or qualify member access as 'this.field' to avoid ambiguity.}}\n            return 0;\n        }\n    }\n\n    public int Prop2\n    {\n        get\n        {\n            return field; // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/IdentifiersNamedFieldShouldBeEscaped.BeforeCSharp14.partial.cs",
    "content": "public partial class Sample\n{\n    public int Prop3\n    {\n        get\n        {\n            return field; // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/IdentifiersNamedFieldShouldBeEscaped.CSharp9-13.cs",
    "content": "// The structure of this file must mirror IdentifiersNamedFieldShouldBeEscaped.Latest.cs.\n// Both files must be kept in sync — add new test cases to both files.\n// Annotations differ only where C# 14 emits compiler diagnostics instead of S8367:\n//   Local variable declarations named 'field': S8367 fires here; CS9273 fires in Latest.\n//   Field references to 'field' in accessors:   S8367 fires here; CS9258 fires in Latest.\nusing System;\n\npublic class Node { public Node field; public Node a; }\npublic class S { public static Node field; }\n\nnamespace Noncompliant\n{\n    public class LocalVariableInAccessors\n    {\n        public int Value\n        {\n            get\n            {\n                int field = 0; // Noncompliant {{'field' is a contextual keyword in C# 14. Rename it, escape it as '@field', or qualify member access as 'this.field' to avoid ambiguity.}}\n                return field; // Not reported; body usage covered by the declaration above\n            }\n            set\n            {\n                int field = value; // Noncompliant\n            }\n        }\n    }\n\n    public class LocalVariableInInit\n    {\n        public int Value\n        {\n            get => 0;\n            init\n            {\n                int field = value; // Noncompliant\n            }\n        }\n    }\n\n    public class ClassFieldReferencedInAccessor\n    {\n        private int field;\n\n        public int Value\n        {\n            get => field; // Noncompliant\n            set => field = value; // Noncompliant\n        }\n\n        public int ExpressionBodied => field; // Noncompliant\n    }\n\n    public class BaseClassFieldReferencedInDerivedAccessor\n    {\n        protected int field;\n    }\n\n    public class DerivedClassFieldReferencedInAccessor : BaseClassFieldReferencedInDerivedAccessor\n    {\n        public int Value\n        {\n            get => field; // Noncompliant\n            set => field = value; // Noncompliant\n        }\n\n        public int ExpressionBodied => field; // Noncompliant\n    }\n\n    public class ParameterNamedFieldInAccessor\n    {\n        public int StaticLocalFunction\n        {\n            get\n            {\n                static int LocalFunction(int field) // Noncompliant\n                    => 0;\n                return 0;\n            }\n        }\n\n        public int LocalFunction\n        {\n            get\n            {\n                int LocalFunction(int field) // Noncompliant\n                {\n                    return field; // Not reported; body usage covered by the declaration above\n                }\n                return 0;\n            }\n        }\n\n        public int Lambda\n        {\n            get\n            {\n                Func<int, int> f = (field) // Noncompliant\n                    => field; // Not reported; body usage covered by the declaration above\n                return 0;\n            }\n        }\n\n        public int AnonymousDelegate\n        {\n            get\n            {\n                Func<int, int> f = delegate(int field) // Noncompliant\n                {\n                    return field; // Not reported; body usage covered by the declaration above\n                };\n                return 0;\n            }\n        }\n    }\n\n    public class MemberReferenceInAccessor\n    {\n        private Node field;\n\n        public Node Value\n        {\n            get\n            {\n                _ = field.a;   // Noncompliant\n                _ = field?.a;  // Noncompliant\n                _ = field!.a;  // Noncompliant\n                return default;\n            }\n        }\n    }\n\n    public class IndexerAccessInAccessor\n    {\n        private int[] field;\n\n        public int[] Value\n        {\n            get\n            {\n                _ = field[0];   // Noncompliant\n                _ = field?[0];  // Noncompliant\n                return null;\n            }\n        }\n    }\n\n    public class ExpressionBodiedLambdaParameter\n    {\n        public System.Func<int, int> Value => (int field) => 0; // Noncompliant\n    }\n\n    namespace StaticTypeNamedField\n    {\n        public static class field { public static int i; }\n\n        public class AccessViaTypeName\n        {\n            public int Value\n            {\n                get\n                {\n                    _ = field  // Noncompliant\n                        .i;\n                    return 0;\n                }\n            }\n        }\n    }\n\n    public class ClassMethodReferencedInAccessor\n    {\n        private int field() => 42;\n\n        public int Value\n        {\n            get => field(); // Noncompliant\n        }\n    }\n\n    public class ClassEventReferencedInAccessor\n    {\n        private event Action field;\n\n        public int Value\n        {\n            get\n            {\n                field?.Invoke(); // Noncompliant\n                return 0;\n            }\n        }\n    }\n\n    namespace NamespaceNamedField\n    {\n        namespace field\n        {\n            public class C { public static int i; }\n        }\n\n        public class AccessViaNamespaceName\n        {\n            public int Value\n            {\n                get\n                {\n                    _ = field  // Noncompliant\n                        .C.i;\n                    return 0;\n                }\n            }\n        }\n    }\n\n    public class TypeParameterReferencedInAccessor<field>\n    {\n        public Type Value\n        {\n            get => typeof(field); // Noncompliant\n        }\n    }\n}\n\nnamespace Compliant\n{\n    public class LocalVariableInAccessors\n    {\n        public int Value\n        {\n            get\n            {\n                int @field = 0;\n                return @field;\n            }\n            set\n            {\n                int @field = value;\n            }\n        }\n    }\n\n    public class LocalVariableInInit\n    {\n        public int Value\n        {\n            get => 0;\n            init\n            {\n                int @field = value;\n            }\n        }\n    }\n\n    public class ClassFieldReferencedInAccessor\n    {\n        private int field;\n\n        public int Value\n        {\n            get => this.field;\n            set => this.field = value;\n        }\n\n        public int ExpressionBodied => this.field;\n    }\n\n    public class BaseClassFieldReferencedInDerivedAccessor\n    {\n        protected int field;\n    }\n\n    public class DerivedClassFieldReferencedInAccessor : BaseClassFieldReferencedInDerivedAccessor\n    {\n        public int Value\n        {\n            get => base.field;\n            set => base.field = value;\n        }\n\n        public int ExpressionBodied => base.field;\n    }\n\n    public class NonPropertyAccessors\n    {\n        private int field;\n\n        public int this[int i]\n        {\n            get => field;\n            set => field = value;\n        }\n\n        public event Action E\n        {\n            add { field++; }\n            remove { field--; }\n        }\n    }\n\n    public class ParameterNamedFieldInAccessor\n    {\n        public int StaticLocalFunction\n        {\n            get\n            {\n                static int LocalFunction(int @field)\n                    => 0;\n                return 0;\n            }\n        }\n\n        public int LocalFunction\n        {\n            get\n            {\n                int LocalFunction(int @field)\n                {\n                    return @field;\n                }\n                return 0;\n            }\n        }\n\n        public int Lambda\n        {\n            get\n            {\n                Func<int, int> f = (@field)\n                    => @field;\n                return 0;\n            }\n        }\n\n        public int AnonymousDelegate\n        {\n            get\n            {\n                Func<int, int> f = delegate(int @field)\n                {\n                    return @field;\n                };\n                return 0;\n            }\n        }\n    }\n\n    public class MemberReferenceInAccessor\n    {\n        private Node field;\n        Node x;\n        Node[] xs;\n\n        public Node Value\n        {\n            get\n            {\n                _ = x.field;\n                _ = x?.field;\n                _ = xs[0].field;\n                _ = xs[0]?.field;\n                _ = S.field;\n                _ = x.a.a.field;\n                _ = x.field.a;\n                _ = x.field.a.field.a;\n                return default;\n            }\n        }\n    }\n\n    public class IndexerAccessInAccessor\n    {\n        private int[] field;\n\n        public int Value\n        {\n            get\n            {\n                _ = this.field[0];\n                _ = this.field?[0];\n                return 0;\n            }\n        }\n    }\n\n    public class ClassMethodReferencedInAccessor\n    {\n        private int field() => 42;\n\n        public int Value\n        {\n            get => this.field(); // Compliant - qualified\n        }\n    }\n\n    public class ClassEventReferencedInAccessor\n    {\n        private event Action field;\n\n        public int Value\n        {\n            get\n            {\n                this.field?.Invoke(); // Compliant - qualified\n                return 0;\n            }\n        }\n    }\n\n    namespace NamespaceNamedField\n    {\n        namespace field\n        {\n            public class C { public static int i; }\n        }\n\n        public class AccessViaNamespaceName\n        {\n            public int Value\n            {\n                get\n                {\n                    _ = @field.C.i;\n                    return 0;\n                }\n            }\n        }\n    }\n\n    public class TypeParameterReferencedInAccessor<field>\n    {\n        public Type Value\n        {\n            get => typeof(@field);\n        }\n    }\n\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/IdentifiersNamedFieldShouldBeEscaped.Latest.cs",
    "content": "// The structure of this file must mirror IdentifiersNamedFieldShouldBeEscaped.CSharp9-13.cs.\n// Both files must be kept in sync — add new test cases to both files.\n// Annotations differ only where C# 14 emits compiler diagnostics instead of S8367:\n//   Local variable declarations named 'field': CS9273 fires here; S8367 fires in CSharp9-13.\n//   Field references to 'field' in accessors:   CS9258 fires here; S8367 fires in CSharp9-13.\nusing System;\n\npublic class Node { public Node field; public Node a; }\npublic class S { public static Node field; }\n\nnamespace Noncompliant\n{\n    public class LocalVariableInAccessors\n    {\n        public int Value\n        {\n            get\n            {\n                int field = 0; // Error [CS9273]\n                return field; // Error [CS9258]\n            }\n            set\n            {\n                int field = value; // Error [CS9273]\n            }\n        }\n    }\n\n    public class LocalVariableInInit\n    {\n        public int Value\n        {\n            get => 0;\n            init\n            {\n                int field = value; // Error [CS9273]\n            }\n        }\n    }\n\n    public class ClassFieldReferencedInAccessor\n    {\n        private int field;\n\n        public int Value\n        {\n            get => field; // Error [CS9258]\n            set => field = value; // Error [CS9258]\n        }\n\n        public int ExpressionBodied => field; // Error [CS9258]\n    }\n\n    public class BaseClassFieldReferencedInDerivedAccessor\n    {\n        protected int field;\n    }\n\n    public class DerivedClassFieldReferencedInAccessor : BaseClassFieldReferencedInDerivedAccessor\n    {\n        public int Value\n        {\n            get => field; // Error [CS9258]\n            set => field = value; // Error [CS9258]\n        }\n\n        public int ExpressionBodied => field; // Error [CS9258]\n    }\n\n    public class ParameterNamedFieldInAccessor\n    {\n        public int StaticLocalFunction\n        {\n            get\n            {\n                static int LocalFunction(int field) // Error [CS9273]\n                    => 0;\n                return 0;\n            }\n        }\n\n        public int LocalFunction\n        {\n            get\n            {\n                int LocalFunction(int field) // Error [CS9273]\n                {\n                    return field; // Error [CS9258]\n                }\n                return 0;\n            }\n        }\n\n        public int Lambda\n        {\n            get\n            {\n                Func<int, int> f = (field) // Error [CS9273]\n                    => field; // Error [CS9258]\n                return 0;\n            }\n        }\n\n        public int AnonymousDelegate\n        {\n            get\n            {\n                Func<int, int> f = delegate(int field) // Error [CS9273]\n                {\n                    return field; // Error [CS9258]\n                };\n                return 0;\n            }\n        }\n    }\n\n    public class MemberReferenceInAccessor\n    {\n        private Node field;\n\n        public Node Value\n        {\n            get\n            {\n                _ = field.a;   // Error [CS9258]\n                _ = field?.a;  // Error [CS9258]\n                _ = field!.a;  // Error [CS9258]\n                return default;\n            }\n        }\n    }\n\n    public class IndexerAccessInAccessor\n    {\n        private int[] field;\n\n        public int[] Value\n        {\n            get\n            {\n                _ = field[0];   // Error [CS9258]\n                _ = field?[0];  // Error [CS9258]\n                return null;\n            }\n        }\n    }\n\n    public class ExpressionBodiedLambdaParameter\n    {\n        public System.Func<int, int> Value => (int field) => 0; // Error [CS9273]\n    }\n\n    namespace StaticTypeNamedField\n    {\n        public static class field { public static int i; }\n\n        public class AccessViaTypeName\n        {\n            public int Value\n            {\n                get\n                {\n                    _ = field  // Error [CS9258]\n                        .i;    // Error [CS1061]\n                    return 0;\n                }\n            }\n        }\n    }\n\n    public class ClassMethodReferencedInAccessor\n    {\n        private int field() => 42;\n\n        public int Value\n        {\n            get => field(); // Error [CS9258, CS0149]\n        }\n    }\n\n    public class ClassEventReferencedInAccessor\n    {\n        private event Action field;\n\n        public int Value\n        {\n            get\n            {\n                field?.Invoke(); // Error [CS9258, CS0023]\n                return 0;\n            }\n        }\n    }\n\n    namespace NamespaceNamedField\n    {\n        namespace field\n        {\n            public class C { public static int i; }\n        }\n\n        public class AccessViaNamespaceName\n        {\n            public int Value\n            {\n                get\n                {\n                    _ = field  // Error [CS9258]\n                        .C.i;  // Error [CS1061]\n                    return 0;\n                }\n            }\n        }\n    }\n\n    public class TypeParameterReferencedInAccessor<field>\n    {\n        public Type Value\n        {\n            get => typeof(field);\n        }\n    }\n}\n\nnamespace Compliant\n{\n    public class LocalVariableInAccessors\n    {\n        public int Value\n        {\n            get\n            {\n                int @field = 0;\n                return @field;\n            }\n            set\n            {\n                int @field = value;\n            }\n        }\n    }\n\n    public class LocalVariableInInit\n    {\n        public int Value\n        {\n            get => 0;\n            init\n            {\n                int @field = value;\n            }\n        }\n    }\n\n    public class ClassFieldReferencedInAccessor\n    {\n        private int field;\n\n        public int Value\n        {\n            get => this.field;\n            set => this.field = value;\n        }\n\n        public int ExpressionBodied => this.field;\n    }\n\n    public class BaseClassFieldReferencedInDerivedAccessor\n    {\n        protected int field;\n    }\n\n    public class DerivedClassFieldReferencedInAccessor : BaseClassFieldReferencedInDerivedAccessor\n    {\n        public int Value\n        {\n            get => base.field;\n            set => base.field = value;\n        }\n\n        public int ExpressionBodied => base.field;\n    }\n\n    public class NonPropertyAccessors\n    {\n        private int field;\n\n        public int this[int i]\n        {\n            get => field;\n            set => field = value;\n        }\n\n        public event Action E\n        {\n            add { field++; }\n            remove { field--; }\n        }\n    }\n\n    public class ParameterNamedFieldInAccessor\n    {\n        public int StaticLocalFunction\n        {\n            get\n            {\n                static int LocalFunction(int @field)\n                    => 0;\n                return 0;\n            }\n        }\n\n        public int LocalFunction\n        {\n            get\n            {\n                int LocalFunction(int @field)\n                {\n                    return @field;\n                }\n                return 0;\n            }\n        }\n\n        public int Lambda\n        {\n            get\n            {\n                Func<int, int> f = (@field)\n                    => @field;\n                return 0;\n            }\n        }\n\n        public int AnonymousDelegate\n        {\n            get\n            {\n                Func<int, int> f = delegate(int @field)\n                {\n                    return @field;\n                };\n                return 0;\n            }\n        }\n    }\n\n    public class MemberReferenceInAccessor\n    {\n        private Node field;\n        Node x;\n        Node[] xs;\n\n        public Node Value\n        {\n            get\n            {\n                _ = x.field;\n                _ = x?.field;\n                _ = xs[0].field;\n                _ = xs[0]?.field;\n                _ = S.field;\n                _ = x.a.a.field;\n                _ = x.field.a;\n                _ = x.field.a.field.a;\n                return default;\n            }\n        }\n    }\n\n    public class IndexerAccessInAccessor\n    {\n        private int[] field;\n\n        public int Value\n        {\n            get\n            {\n                _ = this.field[0];\n                _ = this.field?[0];\n                return 0;\n            }\n        }\n    }\n\n    public class ClassMethodReferencedInAccessor\n    {\n        private int field() => 42;\n\n        public int Value\n        {\n            get => this.field(); // Compliant - qualified\n        }\n    }\n\n    public class ClassEventReferencedInAccessor\n    {\n        private event Action field;\n\n        public int Value\n        {\n            get\n            {\n                this.field?.Invoke(); // Compliant - qualified\n                return 0;\n            }\n        }\n    }\n\n    namespace NamespaceNamedField\n    {\n        namespace field\n        {\n            public class C { public static int i; }\n        }\n\n        public class AccessViaNamespaceName\n        {\n            public int Value\n            {\n                get\n                {\n                    _ = @field.C.i;\n                    return 0;\n                }\n            }\n        }\n    }\n\n    public class TypeParameterReferencedInAccessor<field>\n    {\n        public Type Value\n        {\n            get => typeof(@field);\n        }\n    }\n\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/IfChainWithoutElse.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\n\nnamespace Tests.Diagnostics\n{\n    public class IfChainWithoutElse\n    {\n        public IfChainWithoutElse(bool a)\n        {\n            if (a)\n            {\n            }\n\n            if (a)\n            {\n            }\n            else\n            {\n            }\n\n            if (a)\n            {\n            }\n            else if (a)\n            {\n            }\n            else if (a) // Noncompliant {{Add the missing 'else' clause with either the appropriate action or a suitable comment as to why no action is taken.}}\n//          ^^^^^^^\n            {\n            }\n\n\n            if (a) { }\n            else if (a) { }\n            else if (a) { }\n            else if (a) { }\n            else if (a) { }\n            else if (a) // Noncompliant {{Add the missing 'else' clause with either the appropriate action or a suitable comment as to why no action is taken.}}\n//          ^^^^^^^\n            {\n            }\n\n            if (a) { }\n            else if (a) { }\n            else if (a) { } // Noncompliant\n            else { }\n\n            if (a) { }\n            else if (a) { }\n            else if (a) { }\n            else if (a) { }\n            else if (a) { }\n            else if (a) { }\n            else if (a) { } // Noncompliant\n            else { }\n\n            if (a) { }\n            else if (a) { }\n            else if (a) { }\n            else\n            {\n                Console.WriteLine();\n            }\n\n            if (a) { }\n            else if (a) { }\n            else if (a) { }\n            else\n            {\n                // Single line comment\n            }\n\n            if (a) { }\n            else if (a) { }\n            else if (a) { }\n            else\n            {\n                /* Multi line comment\n                 * Which is actually multi line\n                 */\n            }\n\n            if (a) { }\n            else if (a) { }\n            else if (a) { }\n            else\n                Console.WriteLine();\n\n            if (a) { }\n            else if (a) { }\n            else if (a) { }\n            else\n            {\n#if DEBUG\n            Trace.WriteLine(\"Something to log only in debug\", a.ToString());\n#endif\n            }\n\n            if (a) { }\n            else if (a) { }\n            else if (a) { } // Noncompliant\n            else\n            {\n#if DEBUG\n#endif\n            }\n\n            if (a)\n            {\n            }\n            else\n            {\n                if (a)\n                {\n                    if (a)\n                    {\n                    }\n                    else if (a) // Noncompliant\n                    {\n                    }\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/IfChainWithoutElse.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.Diagnostics\nImports System.Linq\nImports System.Text\n\nNamespace Tests.TestCases\n    Public Class IfChainWithoutElse\n        Public Sub New(a As Boolean)\n            If a Then\n            End If\n\n            If a Then\n            Else\n            End If\n\n            If a Then\n            ElseIf a Then\n            ElseIf a Then ' Noncompliant {{Add the missing 'Else' clause with either the appropriate action or a suitable comment as to why no action is taken.}}\n'           ^^^^^^\n            End If\n\n            If a Then\n            ElseIf a Then\n            ElseIf a Then\n            ElseIf a Then\n            ElseIf a Then\n            ElseIf a Then\n            ElseIf a Then\n            ElseIf a Then\n            ElseIf a Then\n            ElseIf a Then ' Noncompliant\n            End If\n\n            If a Then\n            ElseIf a Then\n            ElseIf a Then ' Noncompliant\n            Else\n            End If\n\n            If a Then\n            ElseIf a Then\n            ElseIf a Then\n            ElseIf a Then\n            ElseIf a Then\n            ElseIf a Then\n            ElseIf a Then\n            ElseIf a Then\n            ElseIf a Then\n            ElseIf a Then ' Noncompliant\n            Else\n            End If\n\n            If a Then\n            ElseIf a Then\n            ElseIf a Then\n            Else\n                Console.WriteLine()\n            End If\n\n            If a Then\n            ElseIf a Then\n            ElseIf a Then\n            Else\n                ' Single line comment\n            End If\n\n            If a Then\n            ElseIf a Then\n            ElseIf a Then\n            Else ' Single line comment\n            End If\n\n            If a Then\n            ElseIf a Then\n            ElseIf a Then ' Noncompliant\n            Else\n            End If ' Single line comment\n\n            If a Then\n            ElseIf a Then\n            ElseIf a Then\n            Else\n#If DEBUG\n                Trace.WriteLine(\"Something to log only in debug\", a.ToString())\n#End If\n            End If\n\n            If a Then\n            ElseIf a Then\n            ElseIf a Then ' Noncompliant\n            Else\n#If DEBUG\n#End If\n            End If\n\n            If a Then\n            Else\n                If a Then\n                    If a Then\n                    ElseIf a Then ' Noncompliant\n                    End If\n                End If\n            End If\n        End Sub\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/IfCollapsible.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Tests.TestCases\n{\n    class IfCollapsible\n    {\n        public void Test(bool cond1, bool cond2, bool cond3)\n        {\n            while (cond1)\n            {\n                if (cond2 || cond3)\n                {\n                }\n            }\n\n            if (cond1)\n//          ^^ Secondary [0]\n            {\n                if (cond2 || cond3)\n//              ^^ Noncompliant [0]\n                {\n                }\n            }\n\n            if (cond1) // Secondary [1] {{Merge this if statement with its nested one.}}\n                if (cond2 || cond3) // Noncompliant [1] {{Merge this if statement with the enclosing one.}}\n                {\n                }\n\n            if (cond1)\n            {\n                if (cond2 || cond3)\n                {\n                }\n                else\n                {\n                }\n            }\n\n            if (cond1)\n            {\n                var x = 5;\n                if (cond2 || cond3)\n                {\n                }\n            }\n\n            if (cond1 && (cond2 || cond3))\n            {\n            }\n\n            if (cond1)\n            {\n                if (cond2 || cond3) // Compliant, parent has else\n                {\n                }\n            }\n            else\n            {\n            }\n        }\n    }\n\n    // Reproducer for https://github.com/SonarSource/sonar-dotnet/issues/9221\n    public class Repro_9221\n    {\n        public DateTime? ThisWorks()\n        {\n            dynamic anything = \"2024-05-13\";\n            object anythingObj = \"2024-05-13\";\n            string notDynamic = \"2024-05-13\";\n\n            if (anything is string)\n                if (DateTime.TryParseExact(anything, \"yyyy-MM-dd\", CultureInfo.InvariantCulture, DateTimeStyles.None, out DateTime dt)) // Compliant - Contains dynamic identifier\n                    return dt;\n\n            if (anythingObj is string) // Secondary\n                if (DateTime.TryParseExact((string)anythingObj, \"yyyy-MM-dd\", CultureInfo.InvariantCulture, DateTimeStyles.None, out DateTime dt1)) // Noncompliant\n                    return dt1;\n\n            if (anythingObj is string && DateTime.TryParseExact((string)anythingObj, \"yyyy-MM-dd\", CultureInfo.InvariantCulture, DateTimeStyles.None, out DateTime dt2))\n                    return dt2;\n\n            if (notDynamic != null)\n                if (notDynamic == \"something\" && anything is string) // Compliant - Contains dynamic identifier\n                    return null;\n\n            if (notDynamic != null)\n                if (notDynamic == (anything is string ? notDynamic : string.Empty) && notDynamic is string) // Compliant - Contains dynamic identifier\n                    return null;\n\n            if (notDynamic != null) // Secondary\n                if (notDynamic == \"something\") // Noncompliant\n                    return null;\n\n            return null;\n        }\n\n        public DateTime? ThisWontWork()\n        {\n            dynamic anything = \"2024-04-29\";\n\n            if (anything is string && DateTime.TryParseExact(anything, \"yyyy-MM-dd\", CultureInfo.InvariantCulture, DateTimeStyles.None, out DateTime dt))\n                return dt; // Error [CS0165]\n\n            return null;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/IfCollapsible.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.Linq\nImports System.Text\n\nNamespace Tests.TestCases\n    Class Foo\n        Public Sub Test(ByVal cond1 As Boolean, ByVal cond2 As Boolean, ByVal cond3 As Boolean)\n            If cond1 Then\n            End If\n\n            If cond1 Then ' Secondary [0] {{Merge this if statement with its nested one.}}\n                If cond2 Then ' Noncompliant [0] {{Merge this if statement with the enclosing one.}}\n                End If\n            End If\n\n            If cond1 Then\n                If cond2 Then\n                Else\n                End If\n            End If\n\n            If cond1 Then\n                If cond2 Then ' Compliant - parent as a Else clause\n                End If\n            Else\n            End If\n\n            If cond1 Then\n                Dim x = 1\n                If cond2 Then ' Compliant - not direct child of the previous if\n                End If\n            End If\n\n            If cond1 Then\n'           ^^ Secondary [1]\n                If cond2 OrElse cond3 Then\n'               ^^ Noncompliant [1]\n                End If\n            End If\n\n            If cond1 Then\n            ElseIf cond2 Then\n                If cond3 Then\n                End If\n            End If\n\t\tEnd Sub\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ImplementIDisposableCorrectly.AbstractClass.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public abstract class AbstractNotDisposable\n    {\n        public void Dispose() { } // is ignored\n    }\n\n    public abstract class AbstractWithAbstractDispose : IDisposable // Noncompliant\n    {\n        public abstract void Dispose();\n//             ^^^^^^^^ Secondary {{'AbstractWithAbstractDispose.Dispose()' should not be 'virtual' or 'abstract'.}}\n        protected abstract void Dispose(bool disposing);\n    }\n\n    public abstract class AbstractWithoutProtectedDispose : IDisposable\n//                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant {{Fix this implementation of 'IDisposable' to conform to the dispose pattern.}}\n//                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary@-1 {{Provide 'protected' overridable implementation of 'Dispose(bool)' on 'AbstractWithoutProtectedDispose' or mark the type as 'sealed'.}}\n    {\n        public void Dispose() // Secondary {{'AbstractWithoutProtectedDispose.Dispose()' should also call 'Dispose(true)'.}}\n        {\n            GC.SuppressFinalize(this);\n        }\n    }\n\n    public abstract class AbstractWithVirtual : IDisposable\n    {\n        public void Dispose()\n        {\n            Dispose(true);\n            GC.SuppressFinalize(this);\n        }\n\n        protected virtual void Dispose(bool disposing)\n        {\n        }\n    }\n\n    public class DerivedFromAbstractWithVirtual : AbstractWithVirtual\n    {\n        protected override void Dispose(bool disposing)\n        {\n            base.Dispose(disposing);\n        }\n    }\n\n    public class DerivedFromAbstractWithVirtualWithExpression : AbstractWithVirtual\n    {\n        protected override void Dispose(bool disposing) => base.Dispose(disposing);\n    }\n\n    public class DerivedFromAbstractWithVirtualNoBaseCall : AbstractWithVirtual // Noncompliant\n    {\n        protected override void Dispose(bool disposing) { }\n//                              ^^^^^^^ Secondary {{Modify 'Dispose(disposing)' so that it calls 'base.Dispose(disposing)'.}}\n    }\n\n    public abstract class AbstractWithAbstract : IDisposable // compliant\n    {\n        public void Dispose()\n        {\n            Dispose(true);\n            GC.SuppressFinalize(this);\n        }\n\n        protected abstract void Dispose(bool disposing);\n    }\n\n    public class DerivedFromAbstractWithAbstract : AbstractWithAbstract\n    {\n        protected override void Dispose(bool disposing)\n        {\n            // Does not call Base.Dispose(disposing) because the base method is abstract.\n        }\n    }\n\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ImplementIDisposableCorrectly.Latest.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public sealed record SealedDisposable : IDisposable\n    {\n        public void Dispose() { }\n    }\n\n    public record SimpleDisposable : IDisposable // Noncompliant {{Fix this implementation of 'IDisposable' to conform to the dispose pattern.}}\n    {\n        public void Dispose() => Dispose(true); // Secondary {{'SimpleDisposable.Dispose()' should also call 'GC.SuppressFinalize(this)'.}}\n\n        protected virtual void Dispose(bool disposing) { }\n    }\n\n    public record SimpleDisposablePositional(string Value) : IDisposable // Noncompliant {{Fix this implementation of 'IDisposable' to conform to the dispose pattern.}}\n    {\n        public void Dispose() => Dispose(true); // Secondary {{'SimpleDisposablePositional.Dispose()' should also call 'GC.SuppressFinalize(this)'.}}\n\n        protected virtual void Dispose(bool disposing) { }\n    }\n\n    public record SimpleDisposableWithSuppressFinalize : IDisposable\n    {\n        public void Dispose()\n        {\n            Dispose(true);\n            GC.SuppressFinalize(this);\n        }\n\n        protected virtual void Dispose(bool disposing) { }\n    }\n\n    public record DisposableWithMoreThanTwoStatements : IDisposable // Noncompliant\n    {\n        public void Dispose() // Secondary {{'DisposableWithMoreThanTwoStatements.Dispose()' should call 'Dispose(true)', 'GC.SuppressFinalize(this)' and nothing else.}}\n        {\n            Dispose(true);\n            Console.WriteLine(\"Extra statement\");\n            GC.SuppressFinalize(this);\n        }\n\n        protected virtual void Dispose(bool disposing) { }\n    }\n\n    public record DerivedDisposable : SimpleDisposable\n    {\n        protected override void Dispose(bool disposing)\n        {\n            base.Dispose(disposing);\n        }\n    }\n\n    public record FinalizedDisposable : IDisposable\n    {\n        public void Dispose()\n        {\n            Dispose(true);\n            GC.SuppressFinalize(this);\n        }\n\n        protected virtual void Dispose(bool disposing) { }\n\n        ~FinalizedDisposable()\n        {\n            Dispose(false);\n        }\n    }\n\n    public record FinalizedDisposableExpression : IDisposable\n    {\n        public void Dispose()\n        {\n            Dispose(true);\n            GC.SuppressFinalize(this);\n        }\n\n        protected virtual void Dispose(bool disposing) { }\n\n        ~FinalizedDisposableExpression() =>\n            Dispose(false);\n    }\n\n    public record NoVirtualDispose : IDisposable\n//                ^^^^^^^^^^^^^^^^ Noncompliant {{Fix this implementation of 'IDisposable' to conform to the dispose pattern.}}\n//                ^^^^^^^^^^^^^^^^ Secondary@-1 {{Provide 'protected' overridable implementation of 'Dispose(bool)' on 'NoVirtualDispose' or mark the type as 'sealed'.}}\n    {\n        public void Dispose() { }\n//                  ^^^^^^^ Secondary {{'NoVirtualDispose.Dispose()' should call 'Dispose(true)' and 'GC.SuppressFinalize(this)'.}}\n\n        public virtual void Dispose(bool a, bool b) { } // This should not affect the implementation\n    }\n\n    public record ExplicitImplementation : IDisposable // Noncompliant\n    {\n        void IDisposable.Dispose()\n//                       ^^^^^^^ Secondary {{'ExplicitImplementation.Dispose()' should also call 'GC.SuppressFinalize(this)'.}}\n//                       ^^^^^^^ Secondary@-1 {{'ExplicitImplementation.Dispose()' should be 'public'.}}\n        {\n            Dispose(true);\n        }\n\n        protected virtual void Dispose(bool disposing) { }\n    }\n\n    public record VirtualImplementation : IDisposable // Noncompliant\n    {\n        public virtual void Dispose()\n//             ^^^^^^^ Secondary {{'VirtualImplementation.Dispose()' should not be 'virtual' or 'abstract'.}}\n//                          ^^^^^^^ Secondary@-1 {{'VirtualImplementation.Dispose()' should also call 'GC.SuppressFinalize(this)'.}}\n        {\n            Dispose(true);\n        }\n\n        protected virtual void Dispose(bool disposing) { }\n    }\n\n    public record WithFinalizer : IDisposable // Noncompliant\n    {\n        public void Dispose()\n//                  ^^^^^^^ Secondary {{'WithFinalizer.Dispose()' should also call 'GC.SuppressFinalize(this)'.}}\n        {\n            Dispose(true);\n        }\n\n        protected virtual void Dispose(bool disposing) { }\n\n        ~WithFinalizer() { }\n//       ^^^^^^^^^^^^^ Secondary {{Modify 'WithFinalizer.~WithFinalizer()' so that it calls 'Dispose(false)' and then returns.}}\n    }\n\n    public record WithFinalizer2 : IDisposable // Noncompliant\n    {\n        public void Dispose()\n        {\n            Dispose(true);\n            GC.SuppressFinalize(this);\n        }\n\n        protected virtual void Dispose(bool disposing) { }\n\n        ~WithFinalizer2() // Secondary, more than one line\n        {\n            Dispose(false);\n            Console.WriteLine(1);\n            Console.WriteLine(2);\n        }\n    }\n\n    public record DerivedDisposable1 : NoVirtualDispose // Compliant, we are not in charge of our base\n    {\n    }\n\n    public record DerivedDisposable2 : SimpleDisposable // Compliant, we do not override Dispose(bool)\n    {\n    }\n\n    public record DisposeNotCallingBase1 : SimpleDisposable // Noncompliant\n    {\n        protected override void Dispose(bool disposing) { }\n//                              ^^^^^^^ Secondary {{Modify 'Dispose(disposing)' so that it calls 'base.Dispose(disposing)'.}}\n    }\n\n    public record DisposeNotCallingBase2 : DerivedDisposable2 // Noncompliant, checking for deeper inheritance here\n    {\n        protected override void Dispose(bool disposing)\n//                              ^^^^^^^ Secondary {{Modify 'Dispose(disposing)' so that it calls 'base.Dispose(disposing)'.}}\n        {\n        }\n    }\n\n    public interface IMyDisposable : IDisposable // Compliant, interface\n    {\n    }\n\n    public record DerivedWithInterface1 : NoVirtualDispose, IDisposable\n//                ^^^^^^^^^^^^^^^^^^^^^ Noncompliant\n//                                                          ^^^^^^^^^^^ Secondary@-1 {{Remove 'IDisposable' from the list of interfaces implemented by 'DerivedWithInterface1' and override the base record 'Dispose' implementation instead.}}\n    {\n    }\n\n    public record DerivedWithInterface2 : NoVirtualDispose, IMyDisposable // Compliant, we are not in charge of the interface\n    {\n    }\n\n   // See https://github.com/SonarSource/sonar-dotnet/issues/4402\n    public partial record PartialCompliant : IDisposable\n    {\n        public partial void Dispose();\n        protected virtual partial void Dispose(bool disposing);\n    }\n\n    public partial record PartialCompliant\n    {\n        public partial void Dispose()\n        {\n            Dispose(true);\n            GC.SuppressFinalize(this);\n        }\n\n        protected virtual partial void Dispose(bool disposing) { }\n    }\n\n    public partial record PartialDerived : PartialCompliant, IDisposable // Noncompliant {{Fix this implementation of 'IDisposable' to conform to the dispose pattern.}}\n                                                                         // Secondary@-1 {{Remove 'IDisposable' from the list of interfaces implemented by 'PartialDerived' and override the base record 'Dispose' implementation instead.}}\n    {\n        protected override partial void Dispose(bool disposing);\n    }\n\n    public partial record PartialDerived : PartialCompliant // Noncompliant {{Fix this implementation of 'IDisposable' to conform to the dispose pattern.}}\n    {\n        protected override partial void Dispose(bool disposing) { } // Secondary {{Modify 'Dispose(disposing)' so that it calls 'base.Dispose(disposing)'.}}\n    }\n\n    public partial record PartialSimpleDisposable : IDisposable\n    {\n        public partial void Dispose();\n        protected virtual partial void Dispose(bool disposing);\n    }\n\n    public partial record PartialSimpleDisposable // Noncompliant {{Fix this implementation of 'IDisposable' to conform to the dispose pattern.}}\n    {\n        public partial void Dispose() => Dispose(true); // Secondary {{'PartialSimpleDisposable.Dispose()' should also call 'GC.SuppressFinalize(this)'.}}\n\n        protected virtual partial void Dispose(bool disposing) { }\n    }\n\n    public partial record PartialWithoutDisposeBool : IDisposable // Noncompliant {{Fix this implementation of 'IDisposable' to conform to the dispose pattern.}}\n                                                                  // Secondary@-1 {{Provide 'protected' overridable implementation of 'Dispose(bool)' on 'PartialWithoutDisposeBool' or mark the type as 'sealed'.}}\n    {\n    }\n\n    public partial record PartialWithoutDisposeBool : IDisposable // Noncompliant {{Fix this implementation of 'IDisposable' to conform to the dispose pattern.}}\n                                                                  // Secondary@-1 {{Provide 'protected' overridable implementation of 'Dispose(bool)' on 'PartialWithoutDisposeBool' or mark the type as 'sealed'.}}\n    {\n        public void Dispose() // Secondary {{'PartialWithoutDisposeBool.Dispose()' should also call 'Dispose(true)'.}}\n        {\n            GC.SuppressFinalize(this);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ImplementIDisposableCorrectly.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public sealed class SealedDisposable : IDisposable\n    {\n        public void Dispose() { }\n    }\n\n    public class SimpleDisposable : IDisposable // Noncompliant {{Fix this implementation of 'IDisposable' to conform to the dispose pattern.}}\n    {\n        public void Dispose() => Dispose(true); // Secondary {{'SimpleDisposable.Dispose()' should also call 'GC.SuppressFinalize(this)'.}}\n\n        protected virtual void Dispose(bool disposing) { }\n    }\n\n    public class SimpleDisposableWithSuppressFinalize : IDisposable\n    {\n        public void Dispose()\n        {\n            Dispose(true);\n            GC.SuppressFinalize(this);\n        }\n\n        protected virtual void Dispose(bool disposing) { }\n    }\n\n    public class DisposableWithMoreThanTwoStatements : IDisposable // Noncompliant\n    {\n        public void Dispose() // Secondary {{'DisposableWithMoreThanTwoStatements.Dispose()' should call 'Dispose(true)', 'GC.SuppressFinalize(this)' and nothing else.}}\n        {\n            Dispose(true);\n            Console.WriteLine(\"Extra statement\");\n            GC.SuppressFinalize(this);\n        }\n\n        protected virtual void Dispose(bool disposing) { }\n    }\n\n    public class DerivedDisposable : SimpleDisposable\n    {\n        protected override void Dispose(bool disposing)\n        {\n            base.Dispose(disposing);\n        }\n    }\n\n    public class FinalizedDisposable : IDisposable\n    {\n        public void Dispose()\n        {\n            Dispose(true);\n            GC.SuppressFinalize(this);\n        }\n\n        protected virtual void Dispose(bool disposing) { }\n\n        ~FinalizedDisposable()\n        {\n            Dispose(false);\n        }\n    }\n\n    public class FinalizedDisposableExpression : IDisposable\n    {\n        public void Dispose()\n        {\n            Dispose(true);\n            GC.SuppressFinalize(this);\n        }\n\n        protected virtual void Dispose(bool disposing) { }\n\n        ~FinalizedDisposableExpression() =>\n            Dispose(false);\n    }\n\n    public class NoVirtualDispose : IDisposable\n//               ^^^^^^^^^^^^^^^^ Noncompliant {{Fix this implementation of 'IDisposable' to conform to the dispose pattern.}}\n//               ^^^^^^^^^^^^^^^^ Secondary@-1 {{Provide 'protected' overridable implementation of 'Dispose(bool)' on 'NoVirtualDispose' or mark the type as 'sealed'.}}\n    {\n        public void Dispose() { }\n//                  ^^^^^^^ Secondary {{'NoVirtualDispose.Dispose()' should call 'Dispose(true)' and 'GC.SuppressFinalize(this)'.}}\n\n        public virtual void Dispose(bool a, bool b) { } // This should not affect the implementation\n    }\n\n    public class ExplicitImplementation : IDisposable // Noncompliant\n    {\n        void IDisposable.Dispose()\n//                       ^^^^^^^ Secondary {{'ExplicitImplementation.Dispose()' should also call 'GC.SuppressFinalize(this)'.}}\n//                       ^^^^^^^ Secondary@-1 {{'ExplicitImplementation.Dispose()' should be 'public'.}}\n        {\n            Dispose(true);\n        }\n\n        protected virtual void Dispose(bool disposing) { }\n    }\n\n    public class VirtualImplementation : IDisposable // Noncompliant\n    {\n        public virtual void Dispose()\n//             ^^^^^^^ Secondary {{'VirtualImplementation.Dispose()' should not be 'virtual' or 'abstract'.}}\n//                          ^^^^^^^ Secondary@-1 {{'VirtualImplementation.Dispose()' should also call 'GC.SuppressFinalize(this)'.}}\n        {\n            Dispose(true);\n        }\n\n        protected virtual void Dispose(bool disposing) { }\n    }\n\n    public class WithFinalizer : IDisposable // Noncompliant\n    {\n        public void Dispose()\n//                  ^^^^^^^ Secondary {{'WithFinalizer.Dispose()' should also call 'GC.SuppressFinalize(this)'.}}\n        {\n            Dispose(true);\n        }\n\n        protected virtual void Dispose(bool disposing) { }\n\n        ~WithFinalizer() { }\n//       ^^^^^^^^^^^^^ Secondary {{Modify 'WithFinalizer.~WithFinalizer()' so that it calls 'Dispose(false)' and then returns.}}\n    }\n\n    public class WithFinalizer2 : IDisposable // Noncompliant\n    {\n        public void Dispose()\n        {\n            Dispose(true);\n            GC.SuppressFinalize(this);\n        }\n\n        protected virtual void Dispose(bool disposing) { }\n\n        ~WithFinalizer2() // Secondary, more than one line\n        {\n            Dispose(false);\n            Console.WriteLine(1);\n            Console.WriteLine(2);\n        }\n    }\n\n    public class DerivedDisposable1 : NoVirtualDispose // Compliant, we are not in charge of our base\n    {\n    }\n\n    public class DerivedDisposable2 : SimpleDisposable // Compliant, we do not override Dispose(bool)\n    {\n    }\n\n    public class DisposeNotCallingBase1 : SimpleDisposable // Noncompliant\n    {\n        protected override void Dispose(bool disposing) { }\n//                              ^^^^^^^ Secondary {{Modify 'Dispose(disposing)' so that it calls 'base.Dispose(disposing)'.}}\n    }\n\n    public class DisposeNotCallingBase2 : DerivedDisposable2 // Noncompliant, checking for deeper inheritance here\n    {\n        protected override void Dispose(bool disposing)\n//                              ^^^^^^^ Secondary {{Modify 'Dispose(disposing)' so that it calls 'base.Dispose(disposing)'.}}\n        {\n        }\n    }\n\n    public interface IMyDisposable : IDisposable // Compliant, interface\n    {\n    }\n\n    public class DerivedWithInterface1 : NoVirtualDispose, IDisposable\n//               ^^^^^^^^^^^^^^^^^^^^^ Noncompliant\n//                                                         ^^^^^^^^^^^ Secondary@-1 {{Remove 'IDisposable' from the list of interfaces implemented by 'DerivedWithInterface1' and override the base class 'Dispose' implementation instead.}}\n    {\n    }\n\n    public class DerivedWithInterface2 : NoVirtualDispose, IMyDisposable // Compliant, we are not in charge of the interface\n    {\n    }\n\n    public class SimpleDisposableCompilationError : IDisposable  // Noncompliant {{Fix this implementation of 'IDisposable' to conform to the dispose pattern.}}\n    {\n        public void Dispose() => Dispose(true, false);           // Error [CS1501]\n                                                                 // Secondary@-1 {{'SimpleDisposableCompilationError.Dispose()' should call 'Dispose(true)' and 'GC.SuppressFinalize(this)'.}}\n\n        protected virtual void Dispose(bool disposing) { }\n    }\n}\n\nnamespace Rspec_Compliant_Samples\n{\n    // Sealed class\n    public sealed class Foo1 : IDisposable\n    {\n        public void Dispose()\n        {\n            // Cleanup\n        }\n    }\n\n    // Simple implementation\n    public class Foo2 : IDisposable\n    {\n        public void Dispose()\n        {\n            Dispose(true);\n            GC.SuppressFinalize(this);\n        }\n\n        protected virtual void Dispose(bool disposing)\n        {\n            // Cleanup\n        }\n    }\n\n    // Implementation with a finalizer\n    public class Foo3 : IDisposable\n    {\n        public void Dispose()\n        {\n            Dispose(true);\n            GC.SuppressFinalize(this);\n        }\n\n        protected virtual void Dispose(bool disposing)\n        {\n            // Cleanup\n        }\n\n        ~Foo3()\n        {\n            Dispose(false);\n        }\n    }\n\n    // Base disposable class\n    public class Foo4 : Foo2\n    {\n        protected override void Dispose(bool disposing)\n        {\n            // Cleanup\n            // Do not forget to call base\n            base.Dispose(disposing);\n        }\n    }\n\n    // Base disposable class, expression body\n    public class Foo5 : Foo2\n    {\n        protected override void Dispose(bool disposing) =>\n            // Cleanup\n            // Do not forget to call base\n            base.Dispose(disposing);\n    }\n\n    public ref struct Struct\n    {\n        public void Dispose()\n        {\n        }\n    }\n\n    public ref struct Struct2\n    {\n        public void Dispose(bool disposing) // Compliant - FN: for ref structs the pattern is to have Dispose without parameters\n        {\n        }\n    }\n}\n\nnamespace VS_Generated_Implementation\n{\n    // NOTE: this is not compliant\n    public class Foo3 : IDisposable // Noncompliant\n    {\n\n        #region IDisposable Support\n        private bool disposedValue = false; // To detect redundant calls\n\n        protected virtual void Dispose(bool disposing)\n        {\n            if (!disposedValue)\n            {\n                if (disposing)\n                {\n                    // TODO: dispose managed state (managed objects).\n                }\n\n                // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below.\n                // TODO: set large fields to null.\n\n                disposedValue = true;\n            }\n        }\n\n        // TODO: override a finalizer only if Dispose(bool disposing) above has code to free unmanaged resources.\n        // ~Foo3() {\n        //   // Do not change this code. Put cleanup code in Dispose(bool disposing) above.\n        //   Dispose(false);\n        // }\n\n        // This code added to correctly implement the disposable pattern.\n        public void Dispose() // Secondary\n        {\n            // Do not change this code. Put cleanup code in Dispose(bool disposing) above.\n            Dispose(true);\n            // TODO: uncomment the following line if the finalizer is overridden above.\n            // GC.SuppressFinalize(this);\n        }\n        #endregion\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ImplementIDisposableCorrectlyPartial1.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public partial class ImplementIDisposableCorrectlyPartial : IDisposable\n    {\n        protected virtual void Dispose(bool disposing)\n        {\n        }\n    }\n}\n\n\n\n\n\n\n\n\n\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ImplementIDisposableCorrectlyPartial2.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n    public partial class ImplementIDisposableCorrectlyPartial\n    {\n        public void Dispose()\n        {\n            Dispose(true);\n            GC.SuppressFinalize(this);\n        }\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ImplementISerializableCorrectly.Latest.Partial.cs",
    "content": "﻿using System;\nusing System.Runtime.Serialization;\n\nnamespace Tests.Diagnostics.PartialMethods\n{\n    public partial class Partial_SerializableDerived_Not_CallingBase_GetObjectData_SeparateFiles_Class\n    //                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant [4] {{Update this implementation of 'ISerializable' to conform to the recommended serialization pattern. Invoke 'base.GetObjectData(SerializationInfo, StreamingContext)' in 'GetObjectData'.}}\n    {\n        public override partial void GetObjectData(SerializationInfo info, StreamingContext context) { }  // Secondary [4] {{Invoke 'base.GetObjectData(SerializationInfo, StreamingContext)' in 'GetObjectData'.}}\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ImplementISerializableCorrectly.Latest.cs",
    "content": "﻿using System;\nusing System.Runtime.Serialization;\n\nnamespace Tests.Diagnostics\n{\n    [Serializable]\n    public record SerializableRecord : ISerializable\n    {\n        public SerializableRecord() { }\n        protected SerializableRecord(SerializationInfo info, StreamingContext context) { }\n        public virtual void GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    [Serializable]\n    public record SerializableRecord_Positional(SerializableRecord PositionalSerializableField) : ISerializable\n    {\n        public SerializableRecord_Positional() : this((SerializableRecord)null) { }\n        protected SerializableRecord_Positional(SerializationInfo info, StreamingContext context) : this((SerializableRecord)null) { }\n        public virtual void GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    [Serializable]\n    public record SerializableRecord_PositionalNonserializable(NonSerializedType PositionalNonserializableField) : ISerializable    // FN\n    {\n        public SerializableRecord_PositionalNonserializable() : this((NonSerializedType)null) { }\n        protected SerializableRecord_PositionalNonserializable(SerializationInfo info, StreamingContext context) : this((NonSerializedType)null) { }\n        public virtual void GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    [Serializable]\n    public record SerializableRecord_PositionalNonserializable_AttributeOnField([field:NonSerialized]NonSerializedType PositionalNonserializableField) : ISerializable  // Compliant\n    {\n        public SerializableRecord_PositionalNonserializable_AttributeOnField() : this((NonSerializedType)null) { }\n        protected SerializableRecord_PositionalNonserializable_AttributeOnField(SerializationInfo info, StreamingContext context) : this((NonSerializedType)null) { }\n        public virtual void GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    public abstract record SerializableAbstract : ISerializable\n    {\n        public SerializableAbstract() { }\n        protected SerializableAbstract(SerializationInfo info, StreamingContext context) { }\n        public virtual void GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    [Serializable]\n    public sealed record SerializableSealed : ISerializable\n    {\n        public SerializableSealed() { }\n        private SerializableSealed(SerializationInfo info, StreamingContext context) { }\n        public void GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    internal record SerializableInternal : ISerializable // Nonpublic types are ignored\n    {\n        public SerializableInternal() { }\n        public void GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    [Serializable]\n    public record SerializableDerived : SerializableRecord\n    {\n        public SerializableDerived() { }\n        protected SerializableDerived(SerializationInfo info, StreamingContext context) : base(info, context) { }\n    }\n\n    [Serializable]\n    public record SerializableDerived_1 : SerializableRecord\n    {\n        private SerializableRecord serializableField;\n\n        public SerializableDerived_1() { }\n        protected SerializableDerived_1(SerializationInfo info, StreamingContext context) : base(info, context) { }\n\n        public override void GetObjectData(SerializationInfo info, StreamingContext context)\n        {\n            base.GetObjectData(info, context);\n        }\n    }\n\n    public record NonSerializedType\n    {\n    }\n\n    public record Serializable_NoAttribute : ISerializable\n//                ^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant\n//         ^^^^^^ Secondary@-1 {{Add 'System.SerializableAttribute' attribute on 'Serializable_NoAttribute' because it implements 'ISerializable'.}}\n    {\n        private readonly NonSerializedType field; // FN, should be marked with [NonSerialized]\n\n        public Serializable_NoAttribute() { }\n        protected Serializable_NoAttribute(SerializationInfo info, StreamingContext context) { }\n\n        public void GetObjectData(SerializationInfo info, StreamingContext context) { }\n//                  ^^^^^^^^^^^^^ Secondary {{Make 'GetObjectData' 'public' and 'virtual', or seal 'Serializable_NoAttribute'.}}\n    }\n\n    public record Serializable_NoAttribute_1 : SerializableRecord, ISerializable\n    //            ^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant {{Update this implementation of 'ISerializable' to conform to the recommended serialization pattern. Add 'System.SerializableAttribute' attribute on 'Serializable_NoAttribute_1' because it implements 'ISerializable'. Call 'base(SerializationInfo, StreamingContext)' on the serialization constructor.}}\n    //     ^^^^^^ Secondary@-1 {{Add 'System.SerializableAttribute' attribute on 'Serializable_NoAttribute_1' because it implements 'ISerializable'.}}\n    {\n        public Serializable_NoAttribute_1() { }\n\n        protected Serializable_NoAttribute_1(SerializationInfo info, StreamingContext context) { }\n        //        ^^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary {{Call 'base(SerializationInfo, StreamingContext)' on the serialization constructor.}}\n    }\n\n    [Serializable]\n    public record Serializable_ExplicitImplementation : ISerializable // Compliant, False Negative - rule should be extended to ensure there is a virtual GetObjectData method that is called\n    {\n        public Serializable_ExplicitImplementation() { }\n        protected Serializable_ExplicitImplementation(SerializationInfo info, StreamingContext context) { }\n        void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    [Serializable]\n    public record Serializable_ExplicitImplementation2 : ISerializable\n    {\n        public Serializable_ExplicitImplementation2() { }\n        protected Serializable_ExplicitImplementation2(SerializationInfo info, StreamingContext context) { }\n\n        void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)\n        {\n            GetObjectData(info, context);\n        }\n\n        protected void GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    [Serializable]\n    public sealed record Serializable_Sealed : ISerializable\n    //                   ^^^^^^^^^^^^^^^^^^^ Noncompliant {{Update this implementation of 'ISerializable' to conform to the recommended serialization pattern. Make the serialization constructor 'private'.}}\n    {\n        public Serializable_Sealed() { }\n\n        protected Serializable_Sealed(SerializationInfo info, StreamingContext context) { }\n        //        ^^^^^^^^^^^^^^^^^^^ Secondary {{Make the serialization constructor 'private'.}}\n        public void GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    [Serializable]\n    public sealed record Serializable_Sealed_NoConstructor : ISerializable\n//                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant\n//                ^^^^^^ Secondary@-1 {{Add a 'private' constructor 'Serializable_Sealed_NoConstructor(SerializationInfo, StreamingContext)'.}}\n    {\n        public Serializable_Sealed_NoConstructor() { }\n        public void GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    [Serializable]\n    public record Serializable_NoConstructor : ISerializable\n//                ^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant\n//         ^^^^^^ Secondary@-1 {{Add a 'protected' constructor 'Serializable_NoConstructor(SerializationInfo, StreamingContext)'.}}\n    {\n        public Serializable_NoConstructor() { }\n        public virtual void GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    [Serializable]\n    public record SerializableDerived_Not_CallingBase : SerializableRecord\n    //            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant {{Update this implementation of 'ISerializable' to conform to the recommended serialization pattern. Call 'base(SerializationInfo, StreamingContext)' on the serialization constructor.}}\n    {\n        public SerializableDerived_Not_CallingBase() { }\n\n        protected SerializableDerived_Not_CallingBase(SerializationInfo info, StreamingContext context) { }\n        //        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary {{Call 'base(SerializationInfo, StreamingContext)' on the serialization constructor.}}\n    }\n\n    [Serializable]\n    public record SerializableDerived_Not_CallingBase_GetObjectData : SerializableRecord\n    //            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant {{Update this implementation of 'ISerializable' to conform to the recommended serialization pattern. Invoke 'base.GetObjectData(SerializationInfo, StreamingContext)' in 'GetObjectData'.}}\n    {\n        private SerializableRecord serializableField;\n        public SerializableDerived_Not_CallingBase_GetObjectData() { }\n        protected SerializableDerived_Not_CallingBase_GetObjectData(SerializationInfo info, StreamingContext context) : base(info, context) { }\n\n        public override void GetObjectData(SerializationInfo info, StreamingContext context) { }\n        //                   ^^^^^^^^^^^^^ Secondary {{Invoke 'base.GetObjectData(SerializationInfo, StreamingContext)' in 'GetObjectData'.}}\n    }\n\n    [Serializable]\n    public record SerializableDerived_New_GetObjectData : SerializableRecord\n//                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant\n    {\n        public SerializableDerived_New_GetObjectData() { }\n        protected SerializableDerived_New_GetObjectData(SerializationInfo info, StreamingContext context) : base(info, context) { }\n\n        public new void GetObjectData(SerializationInfo info, StreamingContext context)\n//                      ^^^^^^^^^^^^^ Secondary {{Make 'GetObjectData' 'public' and 'virtual', or seal 'SerializableDerived_New_GetObjectData'.}}\n        {\n            base.GetObjectData(info, context);\n        }\n    }\n\n    [Serializable]\n    public record SerializableDerived_Not_Overriding_GetObjectData : SerializableRecord\n//                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant\n//         ^^^^^^ Secondary@-1 {{Override 'GetObjectData(SerializationInfo, StreamingContext)' and serialize 'serializableField'.}}\n    {\n        private SerializableRecord serializableField;\n\n        public SerializableDerived_Not_Overriding_GetObjectData() { }\n        protected SerializableDerived_Not_Overriding_GetObjectData(SerializationInfo info, StreamingContext context) : base(info, context) { }\n    }\n\n    [Serializable]\n    public record Serializable_NoConstructor_Positional(string Value) : ISerializable\n    //            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant {{Update this implementation of 'ISerializable' to conform to the recommended serialization pattern. Add a 'protected' constructor 'Serializable_NoConstructor_Positional(SerializationInfo, StreamingContext)'.}}\n    //     ^^^^^^ Secondary@-1 {{Add a 'protected' constructor 'Serializable_NoConstructor_Positional(SerializationInfo, StreamingContext)'.}}\n    {\n        public Serializable_NoConstructor_Positional() : this(\"\") { }\n        public virtual void GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n}\n\nnamespace Tests.Diagnostics.PartialMethods\n{\n// See https://github.com/SonarSource/sonar-dotnet/issues/4411 Applicable to all raised issues below\n    [Serializable]\n    public partial record Partial_SerializableDerived_CallingBase_GetObjectData_Record : SerializableRecord\n    {\n        public Partial_SerializableDerived_CallingBase_GetObjectData_Record() { }\n        protected Partial_SerializableDerived_CallingBase_GetObjectData_Record(SerializationInfo info, StreamingContext context) : base(info, context) { }\n        public override partial void GetObjectData(SerializationInfo info, StreamingContext context);\n    }\n\n    public partial record Partial_SerializableDerived_CallingBase_GetObjectData_Record\n    {\n        public override partial void GetObjectData(SerializationInfo info, StreamingContext context) =>\n            base.GetObjectData(info, context);\n    }\n\n    [Serializable]\n    public partial record Partial_SerializableDerived_Not_CallingBase_GetObjectData_Record : SerializableRecord\n    //                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant {{Update this implementation of 'ISerializable' to conform to the recommended serialization pattern. Invoke 'base.GetObjectData(SerializationInfo, StreamingContext)' in 'GetObjectData'.}}\n    {\n        public Partial_SerializableDerived_Not_CallingBase_GetObjectData_Record() { }\n        protected Partial_SerializableDerived_Not_CallingBase_GetObjectData_Record(SerializationInfo info, StreamingContext context) : base(info, context) { }\n        public override partial void GetObjectData(SerializationInfo info, StreamingContext context);     // Secondary\n    }\n\n    public partial record Partial_SerializableDerived_Not_CallingBase_GetObjectData_Record\n    //                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant {{Update this implementation of 'ISerializable' to conform to the recommended serialization pattern. Invoke 'base.GetObjectData(SerializationInfo, StreamingContext)' in 'GetObjectData'.}}\n    {\n        public override partial void GetObjectData(SerializationInfo info, StreamingContext context) { }      // Secondary\n    }\n\n    [Serializable]\n    public class SerializableClass : ISerializable\n    {\n        public SerializableClass() { }\n        protected SerializableClass(SerializationInfo info, StreamingContext context) { }\n        public virtual void GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    [Serializable]\n    public partial class Partial_SerializableDerived_CallingBase_GetObjectData_Class : SerializableClass\n    {\n        public Partial_SerializableDerived_CallingBase_GetObjectData_Class() { }\n        protected Partial_SerializableDerived_CallingBase_GetObjectData_Class(SerializationInfo info, StreamingContext context) : base(info, context) { }\n        public override partial void GetObjectData(SerializationInfo info, StreamingContext context);\n    }\n\n    public partial class Partial_SerializableDerived_CallingBase_GetObjectData_Class\n    {\n        public override partial void GetObjectData(SerializationInfo info, StreamingContext context) =>\n            base.GetObjectData(info, context);\n    }\n\n    [Serializable]\n    public partial class Partial_SerializableDerived_Not_CallingBase_GetObjectData_Class : SerializableClass\n    //                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant [1] {{Update this implementation of 'ISerializable' to conform to the recommended serialization pattern. Invoke 'base.GetObjectData(SerializationInfo, StreamingContext)' in 'GetObjectData'.}}\n    {\n        public Partial_SerializableDerived_Not_CallingBase_GetObjectData_Class() { }\n        protected Partial_SerializableDerived_Not_CallingBase_GetObjectData_Class(SerializationInfo info, StreamingContext context) : base(info, context) { }\n        public override partial void GetObjectData(SerializationInfo info, StreamingContext context); // Secondary [1] {{Invoke 'base.GetObjectData(SerializationInfo, StreamingContext)' in 'GetObjectData'.}}\n    }\n\n    public partial class Partial_SerializableDerived_Not_CallingBase_GetObjectData_Class\n    //                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant [2] {{Update this implementation of 'ISerializable' to conform to the recommended serialization pattern. Invoke 'base.GetObjectData(SerializationInfo, StreamingContext)' in 'GetObjectData'.}}\n    {\n        public override partial void GetObjectData(SerializationInfo info, StreamingContext context) { }  // Secondary [2] {{Invoke 'base.GetObjectData(SerializationInfo, StreamingContext)' in 'GetObjectData'.}}\n    }\n\n    public partial record Partial_SerializableDerived_Not_SerializableAttributeOnNonInheriting_Record : SerializableRecord\n    {\n        public Partial_SerializableDerived_Not_SerializableAttributeOnNonInheriting_Record() { }\n        protected Partial_SerializableDerived_Not_SerializableAttributeOnNonInheriting_Record(SerializationInfo info, StreamingContext context) : base(info, context) { }\n        public override partial void GetObjectData(SerializationInfo info, StreamingContext context);\n    }\n\n    [Serializable]\n    public partial record Partial_SerializableDerived_Not_SerializableAttributeOnNonInheriting_Record\n    {\n        public override partial void GetObjectData(SerializationInfo info, StreamingContext context) =>\n            base.GetObjectData(info, context);\n    }\n\n    [Serializable]\n    public partial class Partial_SerializableDerived_Not_CallingBase_GetObjectData_SeparateFiles_Class : SerializableClass\n    //                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant [3] {{Update this implementation of 'ISerializable' to conform to the recommended serialization pattern. Invoke 'base.GetObjectData(SerializationInfo, StreamingContext)' in 'GetObjectData'.}}\n    {\n        public Partial_SerializableDerived_Not_CallingBase_GetObjectData_SeparateFiles_Class() { }\n        protected Partial_SerializableDerived_Not_CallingBase_GetObjectData_SeparateFiles_Class(SerializationInfo info, StreamingContext context) : base(info, context) { }\n        public override partial void GetObjectData(SerializationInfo info, StreamingContext context); // Secondary [3] {{Invoke 'base.GetObjectData(SerializationInfo, StreamingContext)' in 'GetObjectData'.}}\n    }\n}\n\npublic class NonSerializedType\n{\n}\n\npublic struct SerializableStruct_NoAttribute : ISerializable    // Noncompliant {{Update this implementation of 'ISerializable' to conform to the recommended serialization pattern. Add 'System.SerializableAttribute' attribute on 'SerializableStruct_NoAttribute' because it implements 'ISerializable'. Add a 'private' constructor 'SerializableStruct_NoAttribute(SerializationInfo, StreamingContext)'.}}\n                                                                // Secondary@-1 {{Add 'System.SerializableAttribute' attribute on 'SerializableStruct_NoAttribute' because it implements 'ISerializable'.}}\n                                                                // Secondary@-2 {{Add a 'private' constructor 'SerializableStruct_NoAttribute(SerializationInfo, StreamingContext)'.}}\n{\n    private readonly NonSerializedType field = null; // Should be marked with [NonSerialized]\n\n    public SerializableStruct_NoAttribute() { }\n\n    public void GetObjectData(SerializationInfo info, StreamingContext context) { }\n}\n\npublic record struct SerializableRecordStruct_NoAttribute : ISerializable // Noncompliant\n                                                                          // Secondary@-1\n                                                                          // Secondary@-2\n{\n    private readonly NonSerializedType field = null; // Should be marked with [NonSerialized]\n\n    public SerializableRecordStruct_NoAttribute() { }\n\n    public void GetObjectData(SerializationInfo info, StreamingContext context) { }\n}\n\npublic record struct SerializablePositionalRecordStruct_NoAttribute(string Property) : ISerializable // Noncompliant\n                                                                                                     // Secondary@-1\n                                                                                                     // Secondary@-2\n{\n    private readonly NonSerializedType field = null; // Should be marked with [NonSerialized]\n\n    public SerializablePositionalRecordStruct_NoAttribute() : this(\"SomeString\") { }\n\n    public void GetObjectData(SerializationInfo info, StreamingContext context) { }\n}\n\n[Serializable]\npublic class Serializable : ISerializable\n{\n    public Serializable() { }\n    protected Serializable(SerializationInfo info, StreamingContext context) { }\n    public virtual void GetObjectData(SerializationInfo info, StreamingContext context) { }\n}\n\n[Serializable]\npublic class SomeClass(Serializable serializableField) : Serializable\n//           ^^^^^^^^^ Noncompliant\n//     ^^^^^ Secondary@-1 {{Override 'GetObjectData(SerializationInfo, StreamingContext)' and serialize '<serializableField>P'.}}\n{\n    public SomeClass() : this(new Serializable()) { }\n\n    protected SomeClass(SerializationInfo info, StreamingContext context) : this(new Serializable()) { }\n    //        ^^^^^^^^^ Secondary {{Call 'base(SerializationInfo, StreamingContext)' on the serialization constructor.}}\n    private void SomeMethod()\n    {\n        Console.WriteLine(serializableField.ToString());\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ImplementISerializableCorrectly.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Runtime.Serialization;\nusing Tests.Diagnostics;\n\nnamespace Tests.Diagnostics\n{\n    [Serializable]\n    public class Serializable : ISerializable\n    {\n        public Serializable() { }\n        protected Serializable(SerializationInfo info, StreamingContext context) { }\n        public virtual void GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    public abstract class SerializableAbstract : ISerializable\n    {\n        public SerializableAbstract() { }\n        protected SerializableAbstract(SerializationInfo info, StreamingContext context) { }\n        public virtual void GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    [Serializable]\n    public sealed class SerializableSealed : ISerializable\n    {\n        public SerializableSealed() { }\n        private SerializableSealed(SerializationInfo info, StreamingContext context) { }\n        public void GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    internal class SerializableInternal : ISerializable // Nonpublic classes are ignored\n    {\n        public SerializableInternal() { }\n        public void GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    [Serializable]\n    public class SerializableDerived : Serializable\n    {\n        public SerializableDerived() { }\n        protected SerializableDerived(SerializationInfo info, StreamingContext context) : base(info, context) { }\n    }\n\n    [Serializable]\n    public class SerializableDerived_1 : Serializable\n    {\n        private Serializable serializableField;\n        public SerializableDerived_1() { }\n        protected SerializableDerived_1(SerializationInfo info, StreamingContext context) : base(info, context) { }\n        public override void GetObjectData(SerializationInfo info, StreamingContext context)\n        {\n            base.GetObjectData(info, context);\n        }\n    }\n\n    public class NonSerializedType\n    {\n    }\n\n    public class Serializable_NoAttribute : ISerializable\n//               ^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant\n//         ^^^^^ Secondary@-1 {{Add 'System.SerializableAttribute' attribute on 'Serializable_NoAttribute' because it implements 'ISerializable'.}}\n    {\n        private readonly NonSerializedType field; // FN, should be marked with [NonSerialized]\n\n        public Serializable_NoAttribute() { }\n        protected Serializable_NoAttribute(SerializationInfo info, StreamingContext context) { }\n        public void GetObjectData(SerializationInfo info, StreamingContext context) { }\n//                  ^^^^^^^^^^^^^ Secondary {{Make 'GetObjectData' 'public' and 'virtual', or seal 'Serializable_NoAttribute'.}}\n    }\n\n    public class Serializable_NoAttribute_1 : Serializable, ISerializable\n//               ^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant\n//         ^^^^^ Secondary@-1 {{Add 'System.SerializableAttribute' attribute on 'Serializable_NoAttribute_1' because it implements 'ISerializable'.}}\n    {\n        public Serializable_NoAttribute_1() { }\n        protected Serializable_NoAttribute_1(SerializationInfo info, StreamingContext context) { }\n        //        ^^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary {{Call 'base(SerializationInfo, StreamingContext)' on the serialization constructor.}}\n    }\n\n    [Serializable]\n    public class Serializable_ExplicitImplementation : ISerializable // Compliant, False Negative - rule should be extended to ensure there is a virtual GetObjectData method that is called\n    {\n        public Serializable_ExplicitImplementation() { }\n        protected Serializable_ExplicitImplementation(SerializationInfo info, StreamingContext context) { }\n        void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    [Serializable]\n    public class Serializable_ExplicitImplementation2 : ISerializable\n    {\n        public Serializable_ExplicitImplementation2() { }\n        protected Serializable_ExplicitImplementation2(SerializationInfo info, StreamingContext context) { }\n        void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)\n        {\n            GetObjectData(info, context);\n        }\n        protected void GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    [Serializable]\n    public sealed class Serializable_Sealed : ISerializable\n    //                  ^^^^^^^^^^^^^^^^^^^ Noncompliant {{Update this implementation of 'ISerializable' to conform to the recommended serialization pattern. Make the serialization constructor 'private'.}}\n    {\n        public Serializable_Sealed() { }\n        protected Serializable_Sealed(SerializationInfo info, StreamingContext context) { }\n        //        ^^^^^^^^^^^^^^^^^^^ Secondary {{Make the serialization constructor 'private'.}}\n        public void GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    [Serializable]\n    public sealed class Serializable_Sealed_NoConstructor : ISerializable\n//                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant\n//                ^^^^^ Secondary@-1 {{Add a 'private' constructor 'Serializable_Sealed_NoConstructor(SerializationInfo, StreamingContext)'.}}\n    {\n        public Serializable_Sealed_NoConstructor() { }\n        public void GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    [Serializable]\n    public class Serializable_NoConstructor : ISerializable\n//               ^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant\n//         ^^^^^ Secondary@-1 {{Add a 'protected' constructor 'Serializable_NoConstructor(SerializationInfo, StreamingContext)'.}}\n    {\n        public Serializable_NoConstructor() { }\n        public virtual void GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    [Serializable]\n    public class SerializableDerived_Not_CallingBase : Serializable\n    //           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant {{Update this implementation of 'ISerializable' to conform to the recommended serialization pattern. Call 'base(SerializationInfo, StreamingContext)' on the serialization constructor.}}\n    {\n        public SerializableDerived_Not_CallingBase() { }\n        protected SerializableDerived_Not_CallingBase(SerializationInfo info, StreamingContext context) { }\n        //        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary {{Call 'base(SerializationInfo, StreamingContext)' on the serialization constructor.}}\n    }\n\n    [Serializable]\n    public class SerializableDerived_Not_CallingBase_GetObjectData : Serializable\n    //           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant {{Update this implementation of 'ISerializable' to conform to the recommended serialization pattern. Invoke 'base.GetObjectData(SerializationInfo, StreamingContext)' in 'GetObjectData'.}}\n    {\n        private Serializable serializableField;\n\n        public SerializableDerived_Not_CallingBase_GetObjectData() { }\n        protected SerializableDerived_Not_CallingBase_GetObjectData(SerializationInfo info, StreamingContext context) : base(info, context) { }\n        public override void GetObjectData(SerializationInfo info, StreamingContext context) { }\n        //                   ^^^^^^^^^^^^^ Secondary {{Invoke 'base.GetObjectData(SerializationInfo, StreamingContext)' in 'GetObjectData'.}}\n    }\n\n    [Serializable]\n    public class SerializableDerived_Not_CallingBase_GetObjectData_Coverage : Serializable   // Noncompliant\n    {\n        private Serializable serializableField;\n\n        public SerializableDerived_Not_CallingBase_GetObjectData_Coverage() { }\n        protected SerializableDerived_Not_CallingBase_GetObjectData_Coverage(SerializationInfo info, StreamingContext context) : base(info, context) { }\n        public override void GetObjectData(SerializationInfo info, StreamingContext context) // Secondary {{Invoke 'base.GetObjectData(SerializationInfo, StreamingContext)' in 'GetObjectData'.}}\n        {\n            var somethingElse = new SerializableDerived_Not_CallingBase_GetObjectData_Coverage();\n            somethingElse.GetObjectData(info, context);\n        }\n    }\n\n    [Serializable]\n    public class SerializableDerived_New_GetObjectData : Serializable\n//               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant\n    {\n        public SerializableDerived_New_GetObjectData() { }\n        protected SerializableDerived_New_GetObjectData(SerializationInfo info, StreamingContext context) : base(info, context) { }\n\n        public new void GetObjectData(SerializationInfo info, StreamingContext context)\n//                      ^^^^^^^^^^^^^ Secondary {{Make 'GetObjectData' 'public' and 'virtual', or seal 'SerializableDerived_New_GetObjectData'.}}\n        {\n            base.GetObjectData(info, context);\n        }\n    }\n\n    [Serializable]\n    public class SerializableDerived_Not_Overriding_GetObjectData : Serializable\n//               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant\n//         ^^^^^ Secondary@-1 {{Override 'GetObjectData(SerializationInfo, StreamingContext)' and serialize 'serializableField'.}}\n    {\n        private Serializable serializableField;\n\n        public SerializableDerived_Not_Overriding_GetObjectData() { }\n        protected SerializableDerived_Not_Overriding_GetObjectData(SerializationInfo info, StreamingContext context) : base(info, context) { }\n    }\n\n    [Serializable]\n    public class SerializableDerived_Not_Overriding_GetObjectData_NonserializableFields : Serializable\n    {\n        private NonSerializedAttribute nonSerializableField;\n\n        public SerializableDerived_Not_Overriding_GetObjectData_NonserializableFields() { }\n        protected SerializableDerived_Not_Overriding_GetObjectData_NonserializableFields(SerializationInfo info, StreamingContext context) : base(info, context) { }\n    }\n\n    [Serializable]\n    public class SerializableDerived_Not_Overriding_GetObjectData_StaticFields : Serializable\n    {\n        private static Serializable staticSerializable;\n\n        public SerializableDerived_Not_Overriding_GetObjectData_StaticFields() { }\n        protected SerializableDerived_Not_Overriding_GetObjectData_StaticFields(SerializationInfo info, StreamingContext context) : base(info, context) { }\n    }\n\n    [Serializable]\n    public class OptionException : Exception\n    {\n        public OptionException() { }\n        public OptionException(string message) : base(message) { }\n        public OptionException(string message, Exception innerException) : base(message, innerException) { }\n        protected OptionException(SerializationInfo info, StreamingContext context) : base(info, context) { }\n    }\n\n    [Serializable]\n    public class OptionUnknownException : OptionException\n    {\n        private string option;\n\n        public OptionUnknownException() { }\n\n        public OptionUnknownException(string option)\n            : base(\"Unknown option '\" + option + \"'\")\n        {\n            this.option = option;\n        }\n        public OptionUnknownException(string option, Exception innerException)\n            : base(\"Unknown option '\" + option + \"'\", innerException)\n        {\n            this.option = option;\n        }\n\n        public OptionUnknownException(string option, string message) : base(message)\n        {\n            this.option = option;\n        }\n\n        protected OptionUnknownException(SerializationInfo info, StreamingContext context) : base(info, context)\n        {\n            this.option = info.GetString(\"option\");\n        }\n\n        public override void GetObjectData(SerializationInfo info, StreamingContext context)\n        {\n            info.AddValue(\"option\", this.option);\n            base.GetObjectData(info, context);\n        }\n\n        public virtual String Option\n        {\n            get { return this.option; }\n        }\n    }\n\n    public class MyException : Exception // Compliant: no opt-in for custom serialization\n    { }\n\n    [Serializable]\n    public class SerializableDerived_NoExtraFields : Serializable\n    {\n        public SerializableDerived_NoExtraFields() { }\n        protected SerializableDerived_NoExtraFields(SerializationInfo info, StreamingContext context) : base(info, context) { }\n    }\n\n    public class CustomLookup : Dictionary<string, object> // Compliant: no opt-in for custom serialization\n    {\n    }\n\n    public class CustomLookup_OptInPerInterface : Dictionary<string, object>, ISerializable\n    //           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant\n    //     ^^^^^                                Secondary@-1 {{Add 'System.SerializableAttribute' attribute on 'CustomLookup_OptInPerInterface' because it implements 'ISerializable'.}}\n    //     ^^^^^                                Secondary@-2 {{Add a 'protected' constructor 'CustomLookup_OptInPerInterface(SerializationInfo, StreamingContext)'.}}\n    {\n    }\n\n    [Serializable]\n    public class CustomLookup_OptInPerAttribute : Dictionary<string, object>\n    //           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant\n    //     ^^^^^                                Secondary@-1 {{Add a 'protected' constructor 'CustomLookup_OptInPerAttribute(SerializationInfo, StreamingContext)'.}}\n    {\n    }\n\n    public class CustomLookup_OptInPerConstructor1 : Dictionary<string, object>\n    //           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant\n    //     ^^^^^                                   Secondary@-1 {{Add 'System.SerializableAttribute' attribute on 'CustomLookup_OptInPerConstructor1' because it implements 'ISerializable'.}}\n    {\n        protected CustomLookup_OptInPerConstructor1(SerializationInfo info, StreamingContext context) : base(info, context)\n        { }\n    }\n\n    public class CustomLookup_OptInPerConstructor2 : Dictionary<string, object>\n    //           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  Noncompliant {{Update this implementation of 'ISerializable' to conform to the recommended serialization pattern. Add 'System.SerializableAttribute' attribute on 'CustomLookup_OptInPerConstructor2' because it implements 'ISerializable'. Call 'base(SerializationInfo, StreamingContext)' on the serialization constructor.}}\n    //     ^^^^^                                    Secondary@-1 {{Add 'System.SerializableAttribute' attribute on 'CustomLookup_OptInPerConstructor2' because it implements 'ISerializable'.}}\n    {\n        protected CustomLookup_OptInPerConstructor2(SerializationInfo info, StreamingContext context)\n        //        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary {{Call 'base(SerializationInfo, StreamingContext)' on the serialization constructor.}}\n        { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ImplementSerializationMethodsCorrectly.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.Serialization;\n\n[OnSerialized] // Noncompliant {{Serialization attributes on local functions are not considered.}}\nint OnSerialized(StreamingContext context) => 42;\n\npublic interface IWithValidSerializationMethods\n{\n    [OnSerializing]\n    protected abstract void OnSerializingMethod(StreamingContext context);\n\n    [OnSerialized]\n    protected abstract void OnSerializedMethod(StreamingContext context);\n\n    [OnDeserializing]\n    protected void OnDeserializingMethod(StreamingContext context) { }\n\n    [OnDeserialized]\n    protected virtual void OnDeserializedMethod(StreamingContext context) { }\n}\n\npublic interface IWithInvalidSerializationMethodsModifiers\n{\n    [OnSerializing]\n    public abstract void OnSerializingMethod(StreamingContext context); // Compliant, despite \"public\", it is in interface\n\n    [OnSerialized]\n    public abstract void OnSerializedMethod(StreamingContext context);\n\n    [OnDeserializing]\n    public void OnDeserializingMethod(StreamingContext context) { }\n\n    [OnDeserialized]\n    public virtual void OnDeserializedMethod(StreamingContext context) { }\n}\n\npublic interface IWithInvalidSerializationMethodsParams\n{\n    [OnSerializing]\n    protected abstract void OnSerializingMethod(StreamingContext context, object otherPar); // Compliant, despite wrong params, it is in interface\n\n    [OnSerialized]\n    protected abstract void OnSerializedMethod(object otherPar);\n\n    [OnDeserializing]\n    protected void OnDeserializingMethod(object otherPar, StreamingContext context) { }\n\n    [OnDeserialized]\n    protected virtual void OnDeserializedMethod() { }\n}\n\n\n[Serializable]\npublic record Foo\n{\n    [OnSerializing]\n    public void OnSerializing(StreamingContext context) { } // Noncompliant {{Make this method non-public.}}\n//              ^^^^^^^^^^^^^\n\n    [OnSerialized]\n    int OnSerialized(StreamingContext context) { return 1; } // Noncompliant {{Make this method return 'void'.}}\n\n    [OnDeserializing]\n    void OnDeserializing() { } // Noncompliant  {{Make this method have a single parameter of type 'StreamingContext'.}}\n\n    [OnDeserialized]\n    void OnDeserialized(StreamingContext context, string str) { } // Noncompliant {{Make this method have a single parameter of type 'StreamingContext'.}}\n\n    void OnDeserialized2(StreamingContext context, string str) { } // Compliant\n\n    [OnDeserialized]\n    void OnDeserialized<T>(StreamingContext context) { } // Noncompliant {{Make this method have no type parameters.}}\n\n    [OnDeserializing]\n    public int OnDeserializing2(StreamingContext context) { throw new NotImplementedException(); } // Noncompliant {{Make this method non-public and return 'void'.}}\n\n    [OnDeserializing]\n    public void OnDeserializing3() { throw new NotImplementedException(); } // Noncompliant {{Make this method non-public and have a single parameter of type 'StreamingContext'.}}\n\n    [OnDeserializing]\n    int OnDeserializing4() { throw new NotImplementedException(); } // Noncompliant {{Make this method return 'void' and have a single parameter of type 'StreamingContext'.}}\n\n    [OnDeserializing]\n    public int OnDeserializing5<T>() { throw new NotImplementedException(); } // Noncompliant {{Make this method non-public, return 'void', have no type parameters and have a single parameter of type 'StreamingContext'.}}\n\n    [OnSerializing]\n    private static void OnSerializingStatic(StreamingContext context) { } // Noncompliant {{Make this method non-static.}}\n\n    [OnSerializing]\n    public static void OnSerializingPublicStatic(StreamingContext context) { } // Noncompliant {{Make this method non-public and non-static.}}\n\n    [OnSerializing()]\n    internal void OnSerializingMethod(StreamingContext context) { }     // Compliant, method is not public and gets invoked\n\n    [OnSerialized()]\n    protected void OnSerializedMethod(StreamingContext context) { }      // Compliant, method is not public and gets invoked\n\n    [OnDeserializing()]\n    private void OnDeserializingMethod(StreamingContext context) { }    // Compliant\n\n    [OnDeserialized()]\n    private void OnDeserializedMethod(StreamingContext context) { }     // Compliant\n\n    public void LocalFunctions()\n    {\n        [OnSerializing()] // Noncompliant {{Serialization attributes on local functions are not considered.}}\n        void OnSerializing(StreamingContext context)\n        { }\n\n        [OnSerialized()] // Noncompliant {{Serialization attributes on local functions are not considered.}}\n        void OnSerialized(StreamingContext context)\n        { }\n\n        [OnDeserializing()] // Noncompliant {{Serialization attributes on local functions are not considered.}}\n        void OnDeserializing(StreamingContext context)\n        { }\n\n        [OnDeserialized()] // Noncompliant {{Serialization attributes on local functions are not considered.}}\n        void OnDeserialized(StreamingContext context)\n        { }\n\n        [OnDeserialized()] // Noncompliant {{Serialization attributes on local functions are not considered.}}\n        static void OnDeserializedStatic(StreamingContext context)\n        { }\n    }\n}\n\n[Serializable]\npublic partial class Partial\n{\n    [OnSerialized]\n    private partial int OnSerialized(StreamingContext context);             // Noncompliant\n\n    [OnDeserialized()]\n    private partial void OnDeserializedMethod(StreamingContext context);    // Compliant\n}\n\npublic partial class Partial\n{\n    private partial int OnSerialized(StreamingContext context) => 42;           // Noncompliant\n\n    private partial void OnDeserializedMethod(StreamingContext context) { }     // Compliant\n}\n\ninternal class TestCases\n{\n    public void Method(IEnumerable<int> collection)\n    {\n        [OnSerializing] int Get() => 1; // Noncompliant {{Serialization attributes on local functions are not considered.}}\n\n        _ = collection.Select([OnSerialized] (x) => x + 1);  // Noncompliant {{Serialization attributes on lambdas are not considered.}}\n\n        Action a = [OnDeserializing] () => { }; // Noncompliant\n\n        Action x = true\n                       ? ([OnDeserialized] () => { }) // Noncompliant\n                       : [OnDeserialized] () => { };  // Noncompliant\n\n        Call([OnDeserialized] (x) => { }); // Noncompliant\n    }\n\n    private void Call(Action<int> action) => action(1);\n}\n\n[Serializable]\ninternal class SerializableWithGenericAttribute\n{\n    [OnSerializing, Generic<int>]\n    public void OnSerializing(StreamingContext context) { } // Noncompliant\n}\n\npublic class GenericAttribute<T> : Attribute { }\n\ninterface IMyInterface\n{\n    [OnSerializing]\n    static virtual void OnSerializingStaticVirtual(StreamingContext context) { } // Compliant, because in an interface\n\n    [OnSerializing]\n    static abstract void OnSerializingStaticAbstract(StreamingContext context); // Compliant, because in an interface\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ImplementSerializationMethodsCorrectly.cs",
    "content": "﻿using System;\nusing System.Runtime.Serialization;\nusing System.ComponentModel;\n\n[Serializable]\npublic class Foo\n{\n    [OnSerializing]\n    public void OnSerializing(StreamingContext context) { } // Noncompliant {{Make this method non-public.}}\n    //          ^^^^^^^^^^^^^\n\n    [OnSerialized]\n    int OnSerialized(StreamingContext context) { return 1; } // Noncompliant {{Make this method return 'void'.}}\n\n    [OnDeserializing]\n    void OnDeserializing() { } // Noncompliant  {{Make this method have a single parameter of type 'StreamingContext'.}}\n\n    [OnDeserialized]\n    void OnDeserialized(StreamingContext context, string str) { } // Noncompliant {{Make this method have a single parameter of type 'StreamingContext'.}}\n\n    void OnDeserialized2(StreamingContext context, string str) { } // Compliant\n\n    [OnDeserialized]\n    void OnDeserialized<T>(StreamingContext context) { } // Noncompliant {{Make this method have no type parameters.}}\n\n    [OnDeserializing]\n    public int OnDeserializing2(StreamingContext context) { throw new NotImplementedException(); } // Noncompliant {{Make this method non-public and return 'void'.}}\n\n    [OnDeserializing]\n    public void OnDeserializing3() { throw new NotImplementedException(); } // Noncompliant {{Make this method non-public and have a single parameter of type 'StreamingContext'.}}\n\n    [OnDeserializing]\n    int OnDeserializing4() { throw new NotImplementedException(); } // Noncompliant {{Make this method return 'void' and have a single parameter of type 'StreamingContext'.}}\n\n    [OnDeserializing]\n    public int OnDeserializing5<T>() { throw new NotImplementedException(); } // Noncompliant {{Make this method non-public, return 'void', have no type parameters and have a single parameter of type 'StreamingContext'.}}\n\n    [OnSerializing]\n    private static void OnSerializingStatic(StreamingContext context) { } // Noncompliant {{Make this method non-static.}}\n\n    [OnSerializing]\n    public static void OnSerializingPublicStatic(StreamingContext context) { } // Noncompliant {{Make this method non-public and non-static.}}\n\n    [OnDeserialized]\n    [EditorBrowsable]\n    public static void OnDeserialized(StreamingContext context) { }      // Noncompliant {{Make this method non-public and non-static.}}\n\n    [OnDeserializing]\n    [EditorBrowsable]\n    public static void OnDeserializing(StreamingContext context) { }     // Noncompliant {{Make this method non-public and non-static.}}\n\n    [OnDeserialized]\n    [EditorBrowsable(EditorBrowsableState.Advanced)]\n    public static void OnDeserialized1(StreamingContext context) { }     // Noncompliant {{Make this method non-public and non-static.}}\n\n    [OnDeserializing]\n    [EditorBrowsable(EditorBrowsableState.Advanced)]\n    public static void OnDeserializing1(StreamingContext context) { }    // Noncompliant {{Make this method non-public and non-static.}}\n\n    [OnSerializing()]\n    internal void OnSerializingMethod(StreamingContext context) { }     // Compliant, method is not public and gets invoked\n\n    [OnSerialized()]\n    protected void OnSerializedMethod(StreamingContext context) { }      // Compliant, method is not public and gets invoked\n\n    [OnSerializing]\n    protected internal void OnProtectedInternal(StreamingContext context) { } // Compliant, method is not public and gets invoked\n\n    [OnDeserializing()]\n    private void OnDeserializingMethod(StreamingContext context) { }    // Compliant\n\n    [OnDeserialized()]\n    private void OnDeserializedMethod(StreamingContext context) { }     // Compliant\n\n    [OnDeserialized]\n    [EditorBrowsable(EditorBrowsableState.Never)]\n    public void OnDeserialized3(StreamingContext context) { }           // Compliant\n\n    [OnDeserializing]\n    [EditorBrowsable(EditorBrowsableState.Never)]\n    public void OnDeserializing3(StreamingContext context) { }          // Compliant\n\n    [OnSerializing]\n    [EditorBrowsable(EditorBrowsableState.Never)]\n    public void OnSerializing3(StreamingContext context) { }            // Compliant\n\n    [OnSerialized]\n    [EditorBrowsable(EditorBrowsableState.Never)]\n    int OnSerialized3(StreamingContext context) { return 1; }           // Compliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ImplementSerializationMethodsCorrectly.vb",
    "content": "﻿Imports System\nImports System.Runtime.Serialization\nImports System.ComponentModel\n\n<Serializable>\nPublic Class Foo\n\n    <OnSerializing>\n    Public Sub OnSerializing(ByVal context As StreamingContext) ' Noncompliant {{Make this method non-public.}}\n        '      ^^^^^^^^^^^^^\n    End Sub\n\n    <OnSerialized>\n    Private Function OnSerialized(ByVal context As StreamingContext) As Integer ' Noncompliant {{Make this method a 'Sub' not a 'Function'.}}\n    End Function\n\n    <OnDeserializing>\n    Private Sub OnDeserializing() ' Noncompliant  {{Make this method have a single parameter of type 'StreamingContext'.}}\n    End Sub\n\n    <OnDeserialized>\n    Private Sub OnDeserialized(ByVal context As StreamingContext, ByVal str As String) ' Noncompliant {{Make this method have a single parameter of type 'StreamingContext'.}}\n    End Sub\n\n    Private Sub OnDeserialized2(ByVal context As StreamingContext, ByVal str As String)\n    End Sub\n\n    <OnDeserialized>\n    Private Sub OnDeserialized(Of T)(ByVal context As StreamingContext) ' Noncompliant {{Make this method have no type parameters.}}\n    End Sub\n\n    <OnDeserializing>\n    Public Function OnDeserializing2(ByVal context As StreamingContext) As Integer ' Noncompliant {{Make this method non-public and a 'Sub' not a 'Function'.}}\n        Throw New NotImplementedException()\n    End Function\n\n    <OnDeserializing>\n    Public Sub OnDeserializing3() ' Noncompliant {{Make this method non-public and have a single parameter of type 'StreamingContext'.}}\n        Throw New NotImplementedException()\n    End Sub\n\n    <OnDeserializing>\n    Private Function OnDeserializing4() As Integer ' Noncompliant {{Make this method a 'Sub' not a 'Function' and have a single parameter of type 'StreamingContext'.}}\n        Throw New NotImplementedException()\n    End Function\n\n    <OnDeserializing>\n    Public Function OnDeserializing5(Of T)() As Integer ' Noncompliant {{Make this method non-public, a 'Sub' not a 'Function', have no type parameters and have a single parameter of type 'StreamingContext'.}}\n        Throw New NotImplementedException()\n    End Function\n\n    <OnDeserializing>\n    Public Function () As String ' Noncompliant\n        ' Error@-1 [BC30203]\n        Throw New NotImplementedException()\n    End Function\n\n    <OnSerializing>\n    Private Shared Sub OnSerializingStatic(Context As StreamingContext)  ' Noncompliant {{Make this method non-shared.}}\n    End Sub\n\n    <OnSerializing>\n    Public Shared Sub OnSerializingPublicStatic(Context As StreamingContext)  ' Noncompliant {{Make this method non-public and non-shared.}}\n    End Sub\n\n    <OnDeserialized>\n    <EditorBrowsable>\n    Public Shared Sub OnDeserialized(Context As StreamingContext)    ' Noncompliant {{Make this method non-public and non-shared.}}\n    End Sub\n\n    <OnDeserializing>\n    <EditorBrowsable>\n    Public Shared Sub OnDeserializing(Context As StreamingContext)   ' Noncompliant {{Make this method non-public and non-shared.}}\n    End Sub\n\n    <OnDeserialized>\n    <EditorBrowsable(EditorBrowsableState.Advanced)>\n    Public Shared Sub OnDeserialized1(Context As StreamingContext)   ' Noncompliant {{Make this method non-public and non-shared.}}\n    End Sub\n\n    <OnDeserializing>\n    <EditorBrowsable(EditorBrowsableState.Advanced)>\n    Public Shared Sub OnDeserializing1(Context As StreamingContext)  ' Noncompliant {{Make this method non-public and non-shared.}}\n    End Sub\n\n    <OnSerializing>\n    Friend Sub OnSerializingMethod(Context As StreamingContext)     ' Compliant, method is not public and gets invoked\n    End Sub\n\n    <OnSerialized>\n    Protected Sub OnSerializedMethod(Context As StreamingContext)   ' Compliant, method is not public and gets invoked\n    End Sub\n\n    <OnSerialized>\n    Protected Friend Sub OnProtectedFriend(Context As StreamingContext) ' Compliant, method is not public and gets invoked\n    End Sub\n\n    <OnDeserializing>\n    Private Sub OnDeserializingMethod(Context As StreamingContext)        ' Compliant\n    End Sub\n\n    <OnDeserialized>\n    Private Sub OnDeserializedMethod(Context As StreamingContext)         ' Compliant\n    End Sub\n\n    <OnDeserialized>\n    <EditorBrowsable(EditorBrowsableState.Never)>\n    Public Sub OnDeserialized3(Context As StreamingContext)               ' Compliant\n    End Sub\n\n    <OnDeserializing>\n    <EditorBrowsable(EditorBrowsableState.Never)>\n    Public Sub OnDeserializing3(Context As StreamingContext)              ' Compliant\n    End Sub\n\n    <OnSerializing>\n    <EditorBrowsable(EditorBrowsableState.Never)>\n    Public Sub OnSerializing3(Context As StreamingContext)                ' Compliant\n    End Sub\n\n    <OnSerialized>\n    <EditorBrowsable(EditorBrowsableState.Never)>\n    Public Function OnSerialized3(Context As StreamingContext) As Integer ' Compliant\n        Throw New NotImplementedException()\n    End Function\n\nEnd Class\n\nPublic Interface IWithInvalidSerializationMethodsParams\n\n    <OnSerializing>\n    Sub OnSerializingMethod(Context As StreamingContext, OtherPar As Object) ' Compliant\n\n    <OnSerialized>\n    Sub OnSerializedMethod(OtherPar As Object) ' Compliant\n\n    <OnDeserializing>\n    Sub OnDeserializingMethod(OtherPar As Object, Context As StreamingContext) ' Compliant\n\n    <OnDeserialized>\n    Sub OnDeserializedMethod() ' Compliant\n\nEnd Interface\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/IndentSingleLineFollowingConditional.Latest.cs",
    "content": "﻿using System;\n\nvar condition = true;\nint total = 0;\nstring data = \"abc\";\n\nif (condition)\n    DoTheThing();\n\nif (condition)      // Noncompliant\nDoTheThing();       //  Secondary\n\ndo                  // Noncompliant {{Use curly braces or indentation to denote the code conditionally executed by this 'do'}}\ntotal++;            // Secondary\nwhile (total < 10);\n\nwhile (total < 20)  // Noncompliant {{Use curly braces or indentation to denote the code conditionally executed by this 'while'}}\ntotal++;            // Secondary\n\nfor (int i = 0; i < 10; i++)    // Noncompliant {{Use curly braces or indentation to denote the code conditionally executed by this 'for'}}\ntotal++;                        // Secondary\n\nforeach (char item in data)     // Noncompliant {{Use curly braces or indentation to denote the code conditionally executed by this 'foreach'}}\ntotal++;                        // Secondary\n\nif (total < 100)    // Noncompliant {{Use curly braces or indentation to denote the code conditionally executed by this 'if'}}\ntotal = 100;        // Secondary\nelse                // Noncompliant {{Use curly braces or indentation to denote the code conditionally executed by this 'else'}}\ntotal = 200;        // Secondary\n\nvoid TopLevelMethod(bool condition)\n{\n    if (condition)  // Noncompliant\n    DoTheThing();   // Secondary\n\n    Foo();\n\n    // Compliant\n    if (condition)\n        DoTheThing();\n\n    Foo();\n}\n\nvoid DoTheThing() { }\nvoid Foo() { }\n\npublic interface IStaticInterfaceMethod\n{\n    static virtual string MyStaticVirtualMethod(bool condition)\n    {\n        if (condition)  // Noncompliant\n        return \"Noncompliant\";   // Secondary\n\n        if (condition) // Compliant\n            return \"Compliant\";\n\n        return string.Empty;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/IndentSingleLineFollowingConditional.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    class RspecExample\n    {\n        private void DoTheThing() { /* no-op */ }\n        private void DoTheOtherThing() { /* no-op */ }\n        private void SomethingElseEntirely() { /* no-op */ }\n        private void Foo() { /* no-op */ }\n\n        public void RSpec(bool condition)\n        {\n            if (condition)  // Noncompliant\n//          ^^^^^^^^^^^^^^\n            DoTheThing();\n//          ^^^^^^^^^^^^^ Secondary\n\n            DoTheOtherThing();\n            SomethingElseEntirely();\n\n            Foo();\n\n            // Compliant slution\n            if (condition)\n                DoTheThing();\n\n            DoTheOtherThing();\n            SomethingElseEntirely();\n\n            Foo();\n        }\n\n    }\n\n    class Non_CompliantProgram\n    {\n        public void Non_compliant_OneOfEach_Messages()\n        {\n            int total = 0;\n            string data = \"abc\";\n\n            do                          // Noncompliant {{Use curly braces or indentation to denote the code conditionally executed by this 'do'}}\n//          ^^\n            total = total + 1;          // trivia not included in secondary location for single line statements...\n//          ^^^^^^^^^^^^^^^^^^ Secondary\n            while (total < 10);\n\n            while (total < 20)          // Noncompliant {{Use curly braces or indentation to denote the code conditionally executed by this 'while'}}\n//          ^^^^^^^^^^^^^^^^^^\n           total = total + 1;           // trivia not included in secondary location for single line statements...\n//         ^^^^^^^^^^^^^^^^^^ Secondary\n\n            for(int i = 0; i < 10; i++) // Noncompliant {{Use curly braces or indentation to denote the code conditionally executed by this 'for'}}\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n       total = total + i;               // trivia not included in secondary location for single line statements...\n//     ^^^^^^^^^^^^^^^^^^ Secondary\n\n            foreach(char item in data)  // Noncompliant {{Use curly braces or indentation to denote the code conditionally executed by this 'foreach'}}\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^\n            total++;                    // trivia not included in secondary location for single line statements...\n//          ^^^^^^^^ Secondary\n\n            if (total < 100)            // Noncompliant {{Use curly braces or indentation to denote the code conditionally executed by this 'if'}}\n//          ^^^^^^^^^^^^^^^^\n            total = 100;                // trivia not included in secondary location for single line statements...\n//          ^^^^^^^^^^^^ Secondary\n            else                        // Noncompliant {{Use curly braces or indentation to denote the code conditionally executed by this 'else'}}\n//          ^^^^\n            total = 200;\n//          ^^^^^^^^^^^^ Secondary\n        }\n\n        public int SpecialElseIfCase(int i)\n        {\n            if (i > 100)\n                return 1;\n            else if (i > 200)\n                return 2;  // compliant - common pattern used in Akka, and used Ember and Nancy too.\n\n            if (i > 300)\n                return 3;\n            else if (i > 400) // Noncompliant {{Use curly braces or indentation to denote the code conditionally executed by this 'else if'}}\n//          ^^^^^^^^^^^^^^^^^\n            return 4;\n//          ^^^^^^^^^ Secondary\n\n            if (i > 400)\n                return 4;\n            else if (i > 500) // Noncompliant {{Use curly braces or indentation to denote the code conditionally executed by this 'else if'}}\n//          ^^^^^^^^^^^^^^^^^\n      return 5;\n//    ^^^^^^^^^ Secondary\n\n            return 6;\n        }\n\n        public int OtherElseIfCombinations(int i)\n        {\n            if (i > 100)\n                return 1;\n            else  // Noncompliant\n//          ^^^^\n            if (i > 200)\n//          ^^^^^^^^^^^^ Secondary\n//          ^^^^^^^^^^^^ @-1\n            return 2;\n//          ^^^^^^^^^ Secondary\n\n            return 0;\n        }\n\n        public int Non_compliant_NestedMixedConditionals()\n        {\n            int total = 0;\n            string data = \"abc\";\n\n            do  // Noncompliant\n//          ^^\n            while (total < 10)                  // comments are included in highlighting for compound statements\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary\n//          ^^^^^^^^^^^^^^^^^^ @-1\n            for (int i = 0; i < 10; i++)        // comments are included in highlighting for compound statements\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @-1\n            foreach (var item in data)          // comments are included in highlighting for compound statements\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^ @-1\n            if (total < 1000)                   // comments are included in highlighting for compound statements\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary\n//          ^^^^^^^^^^^^^^^^^ @-1\n            do                                  // comments are included in highlighting for compound statements\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary\n//          ^^ @-1\n            total++;\n//          ^^^^^^^^ Secondary\n            while (total < 10);\n            while (total < 100);\n\n            return total;\n        }\n    }\n\n    class CompliantProgram\n    {\n        public int Compliant_MixedConditionals()\n        {\n            int total = 0;\n            string data = \"abc\";\n\n            do\n                while (total < 10)\n                    for (int i = 0; i < 10; i++)\n                        foreach (var item in data)\n                            if (total < 1000)\n                                do\n                                    total++;\n                                while (total < 10);\n            while (total < 100);\n\n            return total;\n        }\n\n        public int Compliant_MixedConditionals_WithBraces()\n        {\n            int total = 0;\n            string data = \"abc\";\n\n            // Indentation is irrelevant if there are braces\n            do\n            {\n            while (total < 10)\n            {\n            for (int i = 0; i < 10; i++)\n            {\n            foreach (var item in data)\n            {\n            if (total < 1000)\n            {\n            do\n            {\n            total++;\n            } while (total < 10);\n            }\n            else\n            {\n            if (total < 2000)\n            {\n            total++;\n            }\n            else\n            {\n            total--;\n            }\n            }\n            }\n            }\n            }\n            } while (total < 100);\n            return total;\n        }\n\n        public int Compliant_NestedIf(int value)\n        {\n            int result = 0;\n            if (value > 1)\n                    if (value > 2)\n                            if (value > 3)\n                                result = 1;\n\n            return result;\n        }\n\n        public int Compliant_NestedIfElse(int value)\n        {\n            int result = 0;\n            if (value > 1)\n                if (value > 2)\n                    if (value > 3)\n                        result = 3;\n                    else\n                        result = -3;\n                else\n                    result = -2;\n            else\n                result = -1;\n\n            return result;\n        }\n\n        public int Compliant_NestedFor()\n        {\n            int total = 0;\n            for (int i = 0; i < 1; i++)\n             for (int j = 0; j < 1; j++)\n              for (int k = 0; k < 1; k++)\n                        /* no-op */\n               total = i + j + k;\n\n            return total;\n        }\n\n        public int Compliant_NestedForEach()\n        {\n            int total = 0;\n            string data = \"abcde\";\n            foreach (var a in data)\n                foreach (var b in data)\n                    foreach (var c in data)\n                        total++;\n            return total;\n        }\n\n        public int Compliant_NestedDo()\n        {\n            int total = 0;\n\n            do\n                do\n                    do\n                        total++;\n                    while (total < 10);\n                while (total < 20);\n            while (total < 30);\n\n            return total;\n        }\n\n        public int Compliant_NestedWhile()\n        {\n            int total = 0;\n\n            while (total < 10)\n                while (total < 20)\n                    while (total < 30)\n                        total++;\n\n            return total;\n        }\n\n        public int Compliant_StatementOnSameLine()\n        {\n            int total = 0;\n            string data = \"abc\";\n            int notPartOfTheStatement = 0;\n\n            do total = total + 1; while (total < 10);\n         notPartOfTheStatement++; // not part of the control statement\n\n            while (total < 20) total = total + 1;\n       notPartOfTheStatement++; // not part of the control statement\n\n            for (int i = 0; i < 10; i++) total = total + i;\n    notPartOfTheStatement++; // not part of the control statement\n\n            foreach (char item in data) total++;\nnotPartOfTheStatement++; // not part of the control statement\n\n            if (total < 100) total = 100; notPartOfTheStatement++; // not part of the control statement\n\n            return total + notPartOfTheStatement;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/IndexOfCheckAgainstZero.Latest.cs",
    "content": "﻿using System;\n\npublic class Sample\n{\n    public void Spans()\n    {\n        var span = new Span<char>(\"Hello\".ToCharArray());\n        var readonlySpan = new ReadOnlySpan<char>(\"Hello\".ToCharArray());\n\n        if (span.IndexOf('H') > 0)                  // Noncompliant\n        {\n            // ...\n        }\n\n        if (readonlySpan.IndexOf('H') > 0)          // Noncompliant\n        {\n            // ...\n        }\n        if(MemoryExtensions.IndexOf(span, 'H') > 0) // Noncompliant\n        {\n\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/IndexOfCheckAgainstZero.cs",
    "content": "﻿using System;\nusing System.Linq;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    class IndexOfCheckAgainstZero\n    {\n        public IndexOfCheckAgainstZero()\n        {\n            string color = \"blue\";\n            string name = \"ishmael\";\n\n            List<string> strings = new List<string>();\n            System.Collections.IList stringIList = new List<string>();\n            strings.Add(color);\n            strings.Add(name);\n            string[] stringArray = strings.ToArray();\n            char[] chars = { 'i', 'l' };\n\n            if (stringIList.IndexOf(color) > 0) // Noncompliant\n//                                         ^^^\n            {\n                // ...\n            }\n\n            if (stringIList.IndexOf(color) > -0) // Noncompliant\n//                                         ^^^^\n            {\n                // ...\n            }\n\n            if (strings.IndexOf(color) > 0) // Noncompliant {{0 is a valid index, but this check ignores it.}}\n            {\n                // ...\n            }\n\n            if (0 < name.IndexOf(\"ish\")) // Noncompliant\n            {\n                // ...\n            }\n\n            if (-1 < name.IndexOf(\"ish\"))\n            {\n                // ...\n            }\n\n            if (2 < name.IndexOf(\"ish\"))\n            {\n                // ...\n            }\n\n            if (name.IndexOf(\"ae\") > 0) // Noncompliant\n            {\n                // ...\n            }\n\n            if (Array.IndexOf(stringArray, color) > 0) // Noncompliant\n            {\n                // ...\n            }\n\n            if (Array.IndexOf(stringArray, color) >= 0)\n            {\n                // ...\n            }\n\n            if (0 > 0)\n            {\n\n            }\n\n            if (strings.Count() > 0)\n            {\n\n            }\n\n            if (name.IndexOfAny(chars) > 0) // Noncompliant\n            {\n\n            }\n\n            if (0 < name.IndexOfAny(chars)) // Noncompliant\n            {\n\n            }\n\n            if (name.LastIndexOf('a') > 0) // Noncompliant\n            {\n\n            }\n\n            if (0 < name.LastIndexOf('a')) // Noncompliant\n            {\n\n            }\n\n            if (name.LastIndexOfAny(chars) > 0) // Noncompliant\n            {\n\n            }\n\n            if (0 < name.LastIndexOfAny(chars)) // Noncompliant\n            {\n\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/IndexOfCheckAgainstZero.vb",
    "content": "﻿Imports System\nImports System.Linq\nImports System.Collections.Generic\n\nNamespace Tests.TestCases\n\n    Class IndexOfCheckAgainstZero\n\n        Public Sub IndexOfCheckAgainstZero()\n            Dim Color As String = \"blue\"\n            Dim Name As String = \"ishmael\"\n\n            Dim Strings As New List(Of String)\n            Dim StringIList As System.Collections.IList = New List(Of String) \n            Strings.Add(Color)\n            Strings.Add(Name)\n            Dim StringArray As String() = Strings.ToArray()\n            Dim Chars = New Char() { \"i\"c, \"l\"c }\n\n            If StringIList.IndexOf(Color) > 0 Then ' Noncompliant\n            '                             ^^^\n            '   ...\n            End If\n\n            If StringIList.IndexOf(Color) > -0 Then ' Noncompliant\n            '                             ^^^^\n            '   ...\n            End If\n\n            If StringIList.iNdExOf(Color) > 0 Then ' Noncompliant\n            '                             ^^^\n            '   ...\n            End If\n\n            If Strings.IndexOf(Color) > 0 Then ' Noncompliant {{0 is a valid index, but this check ignores it.}}\n            '    ...\n            End If\n\n            If 0 < Name.IndexOf(\"ish\") Then ' Noncompliant\n            '    ...\n            End If\n\n            If -1 < Name.IndexOf(\"ish\") Then\n            '    ...\n            End If\n\n            If 2 < Name.IndexOf(\"ish\") Then\n            '    ...\n            End If\n\n            If Name.IndexOf(\"ae\") > 0 Then ' Noncompliant\n            '    ...\n            End If\n\n            If Array.IndexOf(StringArray, Color) > 0 Then ' Noncompliant\n            '    ...\n            End If\n\n            If Array.IndexOf(StringArray, Color) >= 0 Then\n            '    ...\n            End If\n\n            If 0  > 0 Then\n            '   ...\n            End If\n\n            If Strings.Count() > 0 Then\n            '   ...\n            End If\n\n            If Name.IndexOfAny(Chars) > 0 Then ' Noncompliant\n            '   ...\n            End If\n\n            If 0 < Name.IndexOfAny(Chars) Then ' Noncompliant\n            '   ...\n            End If\n\n            If Name.LastIndexOf(\"a\"c) > 0 Then ' Noncompliant\n            '   ...\n            End If\n\n            If 0 < Name.LastIndexOf(\"a\"c) Then ' Noncompliant\n            '   ...\n            End If\n\n            If Name.LastIndexOfAny(Chars) > 0 Then ' Noncompliant\n            '   ...\n            End If\n\n            If 0 < Name.LastIndexOfAny(Chars) Then ' Noncompliant\n            '   ...\n            End If\n        End Sub\n\n    End Class\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/IndexedPropertyWithMultipleParameters.vb",
    "content": "﻿Module Module1\n    ReadOnly Property Sum(ByVal a As Integer, ByVal b As Integer) ' Noncompliant {{This indexed property has 2 parameters, use methods instead.}}\n'                     ^^^\n        Get\n            Return a + b\n        End Get\n    End Property\n\n    ReadOnly Property Prop As Integer\n        Get\n            Return 42\n        End Get\n    End Property\n\n    Function Sum3(ByVal a As Integer, ByVal b As Integer)          ' Compliant\n        Return a + b\n    End Function\nEnd Module"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/InfiniteRecursion.RoslynCfg.Latest.cs",
    "content": "﻿using System;\nusing System.Numerics;\n\n// https://github.com/SonarSource/sonar-dotnet/issues/6646\nnamespace Repro_6646\n{\n    public class Repro\n    {\n        public string Name\n        {\n            init // Noncompliant\n            {\n                Name = value;\n            }\n        }\n\n        public string Arrow\n        {\n            init => Arrow = value;   // Noncompliant\n        }\n    }\n}\n\nnamespace CSharp.Thirteen\n{\n    //https://sonarsource.atlassian.net/browse/NET-403\n    public partial class PartialProperty\n    {\n        public partial string Name { get; set; }\n        public partial string Name2 { init; }\n        public partial int Method();\n    }\n\n    public partial class PartialProperty\n    {\n        public partial string Name\n        {\n            get // Compliant FN\n            {\n                return Name;\n            }\n            set // Compliant FN\n            {\n                Name = value;\n            }\n        }\n        public partial string Name2\n        {\n            init // Compliant FN\n            {\n                Name2 = value;\n            }\n        }\n        public partial int Method()\n        {\n            Method(); // Compliant FN\n            return 1;\n        }\n    }\n}\n\nnamespace Tests.Diagnostics\n{\n    public class CSharp8\n    {\n        int CSharp8_SwitchExpressions_OK(int a)\n        {\n            return a switch\n            {\n                0 => 1,\n                1 => 0,\n                _ => CSharp8_SwitchExpressions_OK(a) % 2\n            };\n        }\n\n        int CSharp8_SwitchExpressions_Bad(int a)    // Noncompliant\n        {\n            return a switch\n            {\n                0 => CSharp8_SwitchExpressions_Bad(a + 1),\n                1 => CSharp8_SwitchExpressions_Bad(a - 1),\n                _ => CSharp8_SwitchExpressions_Bad(a) % 2\n            };\n        }\n\n        int CSharp8_StaticLocalFunctions_OK(int a)\n        {\n            static int Calculate(int a, int b) => a + b + 1;\n\n            return Calculate(a, 1);\n        }\n\n        int CSharp8_StaticLocalFunctions_Bad(int a, int b)\n        {\n            static int Calculate(int a, int b) => Calculate(a, b) + 1;  //Noncompliant\n\n            return Calculate(a, b);\n        }\n\n        int CSharp8_StaticLocalFunctions_FN(int a, int b)\n        {\n            static int Add(int a, int b) => Fix(a, b);  // FN - Two methods calling each other are not recognized\n            static int Fix(int a, int b) => Add(a, b);\n\n            return Add(a, b);\n        }\n    }\n\n    public interface IWithDefaultImplementation\n    {\n        decimal Count { get; set; }\n        decimal Price { get; set; }\n\n        decimal Total() //Noncompliant\n        {\n            return Count * Price + Total();\n        }\n    }\n\n    interface InfiniteRecursion\n    {\n        static virtual int Pow<T>(int num, int exponent) where T : InfiniteRecursion // Noncompliant\n        {\n            num *= T.Pow<T>(num, exponent - 1);\n            return num;  // this is never reached\n        }\n    }\n\n    public class Addition : IAdditionOperators<Addition, Addition, Addition>\n    {\n        public static Addition operator +(Addition left, Addition right) => left + right; // Noncompliant\n//                                      ^\n    }\n\n    public class Comparison : IComparisonOperators<Comparison, Comparison, Comparison>\n    {\n        public static Comparison operator ==(Comparison? left, Comparison? right)\n//                                        ^^\n        {\n            return left == right;\n        }\n\n        public static Comparison operator !=(Comparison left, Comparison right) => left == right; // Compliant (we do not support cross-method analysis)\n\n        public static Comparison operator <(Comparison left, Comparison right) =>\n            left is null ? left < right : left; // Compliant\n\n        public static Comparison operator >(Comparison left, Comparison right) =>\n            (left > right) is null ? left : right; // Noncompliant@-1\n\n        public static Comparison operator <=(Comparison left, Comparison right) => left <= right; // Noncompliant\n\n        public static Comparison operator >=(Comparison left, Comparison right) => left >= right; // Noncompliant\n    }\n\n    public class Multiply : IMultiplyOperators<Multiply, Multiply, int>\n    {\n        public int Value { get; set; }\n\n        public static int operator *(Multiply left, Multiply right) => left.Value * right.Value; // Compliant (not looping)\n    }\n\n    public class Decrement : IDecrementOperators<Decrement>\n    {\n        public static Decrement operator --(Decrement val) => --val; // Noncompliant\n//                                       ^^\n    }\n\n    public class DecrementAfter : IDecrementOperators<DecrementAfter>\n    {\n        public static DecrementAfter operator --(DecrementAfter val) => val--; // Noncompliant\n    }\n\n    public class Increment : IIncrementOperators<Increment>\n    {\n        public static Increment operator ++(Increment val) => ++val; // Noncompliant\n    }\n\n    public class IncrementAfter : IIncrementOperators<IncrementAfter>\n    {\n        public static IncrementAfter operator ++(IncrementAfter val) => val++; // Noncompliant\n    }\n\n    public class BitWise : IBitwiseOperators<BitWise, BitWise, BitWise>\n    {\n        public static BitWise operator ~(BitWise value) => ~value; // Noncompliant\n//                                     ^\n\n        public static BitWise operator &(BitWise left, BitWise right) => left & right; // Noncompliant\n\n        public static BitWise operator |(BitWise left, BitWise right) => left | right; // Noncompliant\n\n        public static BitWise operator ^(BitWise left, BitWise right) => left ^ right; // Noncompliant\n    }\n}\n\npublic static class Extensions\n{\n    extension(Exception ex)\n    {\n        public void Infinite()  // Noncompliant\n        {\n            ex.Infinite();\n        }\n\n        public void Finite(int count)\n        {\n            if (count > 0)\n            {\n                ex.Finite(count - 1);\n            }\n        }\n\n        public int InstanceInfiniteCount => ex.InstanceInfiniteCount + 1; // FN\n        public int InstanceFiniteCount => ex.Message.Length + 1;\n\n        public static int StaticInfiniteCount => Exception.StaticInfiniteCount + 1; // Noncompliant\n        public static int StaticFiniteCount => 4 + 2;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/InfiniteRecursion.RoslynCfg.cs",
    "content": "﻿using System;\nusing System.Threading.Tasks;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Tests.Diagnostics\n{\n    class InfiniteRecursion\n    {\n        int Pow(int num, int exponent)   // Noncompliant; no condition under which pow isn't re-called\n//          ^^^\n        {\n            num = num * Pow(num, exponent - 1);\n            return num;  // this is never reached\n        }\n\n        void Test1() // Noncompliant {{Add a way to break out of this method's recursion.}}\n        {\n            var i = 10;\n            if (i == 10)\n            {\n                Test1();\n            }\n            else\n            {\n                switch (i)\n                {\n                    case 1:\n                        Test1();\n                        break;\n                    default:\n                        Test1();\n                        break;\n                }\n            }\n        }\n\n        void Test2()  // Noncompliant\n        {\n            var i = 10;\n            switch (i)\n            {\n                case 1:\n                    goto default;  // Missing secondary location\n                default:\n                    goto case 1;   // Missing secondary location\n            }\n        }\n\n        void Test3()\n        {\n            var i = 10;\n            switch (i)\n            {\n                case 1:\n                    goto default;\n                case 2:\n                    break;\n                default:\n                    goto case 1; // FN\n            }\n\n            switch (i)\n            {\n                case 1:\n                    goto default;\n                case 2:\n                    break;\n                default:\n                    goto case 1; // FN\n            }\n        }\n\n        int Test4() => Test4(); // Noncompliant\n\n        int Test5() => 42;\n\n        int Prop\n        {\n            get // Noncompliant {{Add a way to break out of this property accessor's recursion.}}\n            {\n                return Prop;\n            }\n        }\n\n        string Prop0\n        {\n            get\n            {\n                return nameof(Prop0);\n            }\n        }\n\n        object Prop1\n        {\n            get // FN - analyzer currently only checks for property access on the 'this' object\n            {\n                return (new InfiniteRecursion())?.Prop1;\n            }\n        }\n\n        int Prop2\n        {\n            get // Not recognized, but the accessors are circularly infinitely recursive\n            {\n                (Prop2) = 10;\n                return 10;\n            }\n            set\n            {\n                var x = Prop2;\n            }\n        }\n\n        int Prop3 => 42;\n\n        int Prop5 => Prop5; // Noncompliant\n\n        int Prop6\n        {\n            get => 42;\n        }\n\n        int Prop7\n        {\n            get => Prop6;\n        }\n\n        private InfiniteRecursion infiniteRecursionField;\n\n        object Prop8\n        {\n            get // FN - analyzer currently only checks for property access on the 'this' object\n            {\n                return infiniteRecursionField?.Prop1;\n            }\n        }\n\n        int RecursiveProp1\n        {\n            get  // Noncompliant\n            {\n                start:\n                    goto end;\n                end:\n                    goto start;\n                return 42;\n            }\n        }\n\n        private int backing;\n\n        int RecursiveProp2\n        {\n            set  // Noncompliant\n            {\n                start:\n                    goto end;\n                end:\n                    goto start;\n                backing = value;\n            }\n        }\n\n        void InternalRecursion(int i)  // Noncompliant\n        {\n        start:\n            goto end;    // Missing secondary location\n        end:\n            goto start;  // Missing secondary location\n\n            switch (i)\n            {\n                case 1:\n                    goto default;\n                case 2:\n                    break;\n                default:\n                    goto case 1; // Compliant, already not reachable\n            }\n        }\n\n        int Pow2(int num, int exponent)\n        {\n            if (exponent > 1)\n            {\n                num = num * Pow2(num, exponent - 1);\n            }\n            return num;\n        }\n\n        void Generic<T>() // Noncompliant\n        {\n            Generic<T>();\n        }\n\n        void Generic2<T>() // Compliant\n        {\n            Generic2<int>();\n        }\n\n        // See https://github.com/SonarSource/sonar-dotnet/issues/2342\n        int Power(int num, int exponent) // Noncompliant\n        {\n            try\n            {\n                num = num * Power(num, exponent - 1);\n                return num;  // this is never reached\n            }\n            catch (Exception)\n            {\n                throw;\n            }\n        }\n\n        int FixIt(int a)    // FN - Two methods calling each other are not recognized\n        {\n            return UpdateIt(a);\n        }\n\n        int UpdateIt(int a)\n        {\n            return FixIt(a);\n        }\n\n        void MethodWithNestedLocalFunctions()\n        {\n            void LocalFunction()\n            {\n                void NestedLocalFunction()     // Noncompliant\n                {\n                    NestedLocalFunction();\n                }\n            }\n        }\n\n        void MethodWithNestedLocalFunctions2()          // FN\n        {\n            LocalFunction();\n            void LocalFunction()\n            {\n                InvokingEnclosingMethod();\n                void InvokingEnclosingMethod()\n                {\n                    MethodWithNestedLocalFunctions2();  // gets invoked here\n                }\n            }\n        }\n\n        void MethodWithNestedLocalFunctions3()\n        {\n            LocalFunction();\n            void LocalFunction()                       // FN\n            {\n                InvokingParentLocalFunction();\n                void InvokingParentLocalFunction()\n                {\n                    LocalFunction();                   // gets invoked here\n                }\n            }\n        }\n\n        private Action<T> SimpleLambdaExpression<T>(Func<T, Task> asyncHandler)\n        {\n            return m =>\n            {\n                Task Foo1() => asyncHandler(m);\n                Task Foo2() => Foo2();  // Noncompliant\n            };\n        }\n\n        private Action<T> ParenthesizedLambdaExpression<T>(Func<T, Task> asyncHandler)\n        {\n            return (m) =>\n            {\n                Task Bar1() => asyncHandler(m);\n                Task Bar2() => Bar2();  // Noncompliant\n            };\n        }\n\n        delegate void MethodExpressionDelegate();\n\n        private void MethodWithNestedLocalFunctionsAndDelegate()\n        {\n            void LocalFunctionWithDelegate()\n            {\n                MethodExpressionDelegate del = delegate\n                {\n                    void LocalFunctionInDelegate()  // Noncompliant\n                    {\n                        LocalFunctionInDelegate();\n                    }\n                };\n            }\n        }\n\n        MethodExpressionDelegate delMain = delegate {\n            void Foo()  // Noncompliant\n            {\n                Foo();\n            }\n        };\n\n        private void LamdaInIf(List<string> input)\n        {\n            if (input.Where(x =>\n                            {\n                                return Foo();\n                                bool Foo() { return Foo(); }  // Noncompliant\n                            }).SingleOrDefault() != null)\n            {\n            }\n        }\n    }\n\n    class MoreCases\n    {\n        void CallsOnThis()    // Noncompliant\n        {\n            this.CallsOnThis();\n        }\n\n        void CallsOnObject()  // Noncompliant\n        {\n            var x = new MoreCases();\n            x.CallsOnObject();\n        }\n\n        public virtual void CallsOnObjectVirtual(MoreCases arg)  // Compliant\n        {\n            arg.CallsOnObjectVirtual(arg);\n        }\n\n        static int PassItself(int a)\n        {\n            Receiver(PassItself);\n            return 42;\n        }\n\n        static void Receiver(Func<int, int> func)\n        {\n\n        }\n    }\n\n    class Exceptions\n    {\n        public int Property1 => throw new NotImplementedException();\n\n        public int Property2\n        {\n            get\n            {\n                throw new NotImplementedException();\n            }\n\n            set\n            {\n                throw new NotImplementedException();\n            }\n        }\n\n        public int Property3\n        {\n            get  // Noncompliant\n            {\n                var a = Property3;\n                throw new NotImplementedException();\n            }\n            set  // Noncompliant\n            {\n                Property3 = 42;\n                throw new NotImplementedException();\n            }\n        }\n\n        void ThrowsException() => throw new AggregateException();\n\n        void ThrowsExceptionInIf()\n        {\n            var a = 5;\n            if (a > 1)\n            {\n                throw new AggregateException();\n            }\n            else\n            {\n                throw new AggregateException();\n            }\n        }\n\n        void CallsItselfAndThrows()            // Noncompliant\n        {\n            CallsItselfAndThrows();\n            throw new AggregateException();\n        }\n\n        void ThrowsExceptionInIfAfterGoto()    // Noncompliant\n        {\n            A:\n            goto A;\n            var a = 5;\n            if (a > 1)\n            {\n                throw new AggregateException();\n            }\n        }\n\n        int ThrowsInIf(int a)\n        {\n            if (a > 1)\n            {\n                throw new ArgumentException();\n            }\n            A:\n            goto A;\n\n            return 42;\n        }\n\n        int ThrowsInTry(int a)\n        {\n            try\n            {\n                throw new ArgumentException();\n            }\n            catch (Exception e)\n            {\n                ThrowsInTry(a); // FN\n                return 42;\n            }\n\n            return 42;\n        }\n\n        int ThrowsInFinally(int a)\n        {\n            try\n            {\n            }\n            finally\n            {\n                throw new ArgumentException();\n            }\n        }\n    }\n\n    abstract class One\n    {\n        protected One Parent;\n\n        public virtual int Prop\n        {\n            get\n            {\n                return Parent.Prop;\n            }\n        }\n\n        public virtual int Method()\n        {\n            return Parent.Method();\n        }\n\n        public virtual int? NullableMethod()\n        {\n            return Parent?.NullableMethod();\n        }\n    }\n\n    class Two : One\n    {\n        public Two(One parent)\n        {\n            Parent = parent;\n        }\n    }\n\n    class Three : One\n    {\n        public override int Prop\n        {\n            get => 42;\n        }\n\n        public override int Method()\n        {\n            return 42;\n        }\n\n        public override int? NullableMethod()\n        {\n            return 42;\n        }\n    }\n\n    class StaticPropertyCase\n    {\n        private static int Prop { get => Prop; }  // Noncompliant\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/3624\nnamespace Repro_3624\n{\n    public class Repro : Base\n    {\n        public string Name\n        {\n            get // Noncompliant\n            {\n                return Name;\n            }\n            set // Noncompliant\n            {\n                Name = value;\n            }\n        }\n\n        public virtual string Arrow\n        {\n            get => Arrow;           // Noncompliant\n            set => Arrow = value;   // Noncompliant\n        }\n\n        public override string Overriden\n        {\n            get => base.Overriden;          // Compliant\n            set => base.Overriden = value;  // Compliant\n        }\n    }\n\n    public class Base\n    {\n        public virtual string Overriden { get; set; }\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/5261\npublic class Repro_5261\n{\n    public IEnumerable<T> Repeat<T>(T element)  // Noncompliant FP, it's not a recursion.\n    {\n        while (true)\n        {\n            yield return element;\n        }\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/6642\npublic class Repro_6642\n{\n    private List<byte> list;\n\n    public int this[int i]\n    {\n        get { return this[i]; } // Noncompliant\n        set { this[i] = value; } // Noncompliant\n    }\n\n    public char this[char i] => this[i]; // Noncompliant\n\n    public byte this[byte i]\n    {\n        get { return list[i]; } // Compliant\n        set { list[i] = value; } // Compliant\n    }\n\n    public short this[short i] => list[1623]; // Compliant\n\n    public string this[string i]\n    {\n        get { return this; } // Compliant\n    }\n\n    public static implicit operator string(Repro_6642 d) => \"\";\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/6643\npublic class Repro_6643\n{\n    public static implicit operator byte(Repro_6643 d) => d; // Noncompliant\n\n    public static explicit operator string(Repro_6643 d) => (string)d; // Noncompliant\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/6644\npublic delegate bool SomeDelegate();\n\npublic class Repro_6644\n{\n    public event SomeDelegate SomeEvent\n    {\n        add { SomeEvent += value; } // Noncompliant\n\n        remove { SomeEvent -= value; } // Noncompliant\n    }\n\n    public event SomeDelegate SomeEvent2\n    {\n        add { SomeEvent2 -= value; } // Noncompliant FP\n\n        remove { SomeEvent2 += value; } // Noncompliant FP\n    }\n\n    public event SomeDelegate SomeEvent3\n    {\n        add\n        {\n            SomeEvent += value; // Compliant\n        }\n\n        remove\n        {\n            SomeEvent -= value; // Compliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/InfiniteRecursion.SonarCfg.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    class InfiniteRecursion\n    {\n        int Pow(int num, int exponent)   // Noncompliant; no condition under which pow isn't re-called\n//          ^^^\n        {\n            num = num * Pow(num, exponent - 1);\n            return num;  // this is never reached\n        }\n\n        void Test1() // Noncompliant {{Add a way to break out of this method's recursion.}}\n        {\n            var i = 10;\n            if (i == 10)\n            {\n                Test1();\n            }\n            else\n            {\n                switch (i)\n                {\n                    case 1:\n                        Test1();\n                        break;\n                    default:\n                        Test1();\n                        break;\n                }\n            }\n        }\n\n        void Test2()\n        {\n            var i = 10;\n            switch (i)\n            {\n                case 1:\n                    goto default;\n                default:\n                    goto case 1; // Noncompliant {{Add a way to break out of this method.}}\n            }\n        }\n\n        void Test3()\n        {\n            var i = 10;\n            switch (i)\n            {\n                case 1:\n                    goto default;\n                case 2:\n                    break;\n                default:\n                    goto case 1; // Noncompliant\n            }\n\n            switch (i)\n            {\n                case 1:\n                    goto default;\n                case 2:\n                    break;\n                default:\n                    goto case 1; // Noncompliant\n            }\n        }\n\n        int Test4() => Test4(); // Noncompliant\n\n        int Test5() => 42;\n\n        int Prop\n        {\n            get // Noncompliant {{Add a way to break out of this property accessor's recursion.}}\n            {\n                return Prop;\n            }\n        }\n\n        string Prop0\n        {\n            get\n            {\n                return nameof(Prop0);\n            }\n        }\n\n        object Prop1\n        {\n            get // FN - analyzer currently only checks for property access on the 'this' object\n            {\n                return (new InfiniteRecursion())?.Prop1;\n            }\n        }\n\n        int Prop2\n        {\n            get // Not recognized, but the accessors are circularly infinitely recursive\n            {\n                (Prop2) = 10;\n                return 10;\n            }\n            set\n            {\n                var x = Prop2;\n            }\n        }\n\n        int Prop3 => 42;\n\n        int Prop5 => Prop5; // Noncompliant\n\n        int Prop6\n        {\n            get => 42;\n        }\n\n        int Prop7\n        {\n            get => Prop6;\n        }\n\n        private InfiniteRecursion infiniteRecursionField;\n\n        object Prop8\n        {\n            get // FN - analyzer currently only checks for property access on the 'this' object\n            {\n                return infiniteRecursionField?.Prop1;\n            }\n        }\n\n        object Prop9 { }  // Error [CS0548]\n\n        void InternalRecursion(int i)\n        {\n        start:\n            goto end;\n        end:\n            goto start; // Noncompliant\n\n            switch (i)\n            {\n                case 1:\n                    goto default;\n                case 2:\n                    break;\n                default:\n                    goto case 1; // Compliant, already not reachable\n            }\n        }\n\n        int Pow2(int num, int exponent)\n        {\n            if (exponent > 1)\n            {\n                num = num * Pow2(num, exponent - 1);\n            }\n            return num;\n        }\n\n        void Generic<T>() // Noncompliant\n        {\n            Generic<T>();\n        }\n\n        void Generic2<T>() // Compliant\n        {\n            Generic2<int>();\n        }\n\n        // (FN) False Negative, was fixed in RoslynCFG. There will be no updates in SonarCFG in the future.\n        // See https://github.com/SonarSource/sonar-dotnet/issues/2342\n        int Power(int num, int exponent)\n        {\n            try\n            {\n                num = num * Power(num, exponent - 1);\n                return num;  // this is never reached\n            }\n            catch (Exception)\n            {\n                throw;\n            }\n        }\n\n        int FixIt(int a)    // FN - Two methods calling each other are not recognized\n        {\n            return UpdateIt(a);\n        }\n\n        int UpdateIt(int a)\n        {\n            return FixIt(a);\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/6642\n    // this is added here for coverage purposes\n    public class Repro_6642\n    {\n        public int this[int i]\n        {\n            get { return this[i]; } // FN\n            set { this[i] = value; } // FN\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/6643\n    public class Repro_6643\n    {\n        public static implicit operator byte(Repro_6643 d) => d; // FN\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/6644\n    public delegate bool SomeDelegate();\n\n    public class Repro_6644\n    {\n        public event SomeDelegate SomeEvent\n        {\n            add\n            {\n                SomeEvent += value; // FN\n            }\n\n            remove\n            {\n                SomeEvent -= value; // FN\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/InheritedCollidingInterfaceMembers.AnotherFile.cs",
    "content": "﻿/*\n * We want to create a big padding so when the rule looking for the secondary location, we make sure\n * that this file is way bigger that the file were the primary location is.\n * So the secondray location would be out of bound of the first file.\n *\n * ###################################################################################\n * ###                            .i;;;;i.                                         ###\n * ###                          iYcviii;vXY:                                       ###\n * ###                        .YXi       .i1c.                                     ###\n * ###                       .YC.     .    in7.                                    ###\n * ###                      .vc.   ......   ;1c.                                   ###\n * ###                      i7,   ..        .;1;                                   ###\n * ###                     i7,   .. ...      .Y1i                                  ###\n * ###                    ,7v     .6MMM@;     .YX,                                 ###\n * ###                   .7;.   ..IMMMMMM1     :t7.                                ###\n * ###                  .;Y.     ;$MMMMMM9.     :tc.                               ###\n * ###                  vY.   .. .nMMM@MMU.      ;1v.                              ###\n * ###                 i7i   ...  .#MM@M@C. .....:71i                              ###\n * ###                it:   ....   $MMM@9;.,i;;;i,;tti                             ###\n * ###               :t7.  .....   0MMMWv.,iii:::,,;St.                            ###\n * ###              .nC.   .....   IMMMQ..,::::::,.,czX.                           ###\n * ###             .ct:   ....... .ZMMMI..,:::::::,,:76Y.                          ###\n * ###             c2:   ......,i..Y$M@t..:::::::,,..inZY                          ###\n * ###            vov   ......:ii..c$MBc..,,,,,,,,,,..iI9i                         ###\n * ###           i9Y   ......iii:..7@MA,..,,,,,,,,,....;AA:                        ###\n * ###          iIS.  ......:ii::..;@MI....,............;Ez.                       ###\n * ###         .I9.  ......:i::::...8M1..................C0z.                      ###\n * ###        .z9;  ......:i::::,.. .i:...................zWX.                     ###\n * ###        vbv  ......,i::::,,.      ................. :AQY                     ###\n * ###       c6Y.  .,...,::::,,..:t0@@QY. ................ :8bi                    ###\n * ###      :6S. ..,,...,:::,,,..EMMMMMMI. ............... .;bZ,                   ###\n * ###     :6o,  .,,,,..:::,,,..i#MMMMMM#v.................  YW2.                  ###\n * ###    .n8i ..,,,,,,,::,,,,.. tMMMMM@C:.................. .1Wn                  ###\n * ###    7Uc. .:::,,,,,::,,,,..   i1t;,..................... .UEi                 ###\n * ###    7C...::::::::::::,,,,..        ....................  vSi.                ###\n * ###    ;1;...,,::::::,.........       ..................    Yz:                 ###\n * ###     v97,.........                                     .voC.                 ###\n * ###      izAotX7777777777777777777777777777777777777777Y7n92:                   ###\n * ###        .;CoIIIIIUAA666666699999ZZZZZZZZZZZZZZZZZZZZ6ov.                     ###\n * ###                                                                             ###\n * ###                                                                             ###\n * ###                  This file MUST be bigger than                              ###\n * ###       InheritedCollidingInterfaceMembers.DifferentFile.cs in size           ###\n * ###                                                                             ###\n * ###################################################################################\n *\n * A lorem ipsum text\n *\n * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor\n * incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud\n * exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure\n * dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n * Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit\n * anim id est laborum.\n *\n * Another one:\n *\n * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor\n * incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud\n * exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure\n * dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n * Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit\n * anim id est laborum.\n *\n */\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public partial interface IAnotherFile\n    {\n        void Method(int i);\n    }\n\n    public partial interface IAnotherFile2\n    {\n        void Method(int i); // Secondary {{This member collides with 'IAnotherFile.Method(int)'}}\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/InheritedCollidingInterfaceMembers.DifferentFile.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\n\n/*\n * DO NOT ADD ANYTHING ELSE HERE\n */\n\nnamespace Tests.Diagnostics\n{\n    public interface IParentInAnotherFile : IAnotherFile, IAnotherFile2 // Noncompliant {{Rename or add member 'Method(int)' to this interface to resolve ambiguities.}}\n    {\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/InheritedCollidingInterfaceMembers.Latest.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    interface A\n    {\n        void m();\n    }\n\n    interface B : A\n    {\n        void A.m() { Console.WriteLine(\"interface B\"); }\n    }\n\n    interface C : A\n    {\n        void A.m() { Console.WriteLine(\"interface C\"); }\n    }\n\n    class D : B, C  // Error [CS8705] Interface member 'A.m()' does not have a most specific implementation. Neither 'B.A.m()', nor 'C.A.m()' are most specific\n    {\n        static void Main()\n        {\n            C c = new D();\n            c.m();\n        }\n    }\n\n    public interface IPublicMethodFirst\n    {\n        public string Method(string value)\n        {\n            return value;\n        }\n    }\n\n    public interface IPublicMethodSecond\n    {\n        public string Method(string value);\n//                    ^^^^^^ Secondary {{This member collides with 'IPublicMethodFirst.Method(string)'}}\n    }\n\n    public interface ICommon : IPublicMethodFirst, IPublicMethodSecond // Noncompliant {{Rename or add member 'Method(string)' to this interface to resolve ambiguities.}}\n//                   ^^^^^^^\n    {\n    }\n\n    public interface IAbstractMethodFirst\n    {\n        public abstract string AbstractMethod(string value);\n    }\n\n    public interface IAbstractMethodSecond\n    {\n        public abstract string AbstractMethod(string value);\n//                             ^^^^^^^^^^^^^^ Secondary {{This member collides with 'IAbstractMethodFirst.AbstractMethod(string)'}}\n    }\n\n    public interface IAbstractMethodCommon : IAbstractMethodFirst, IAbstractMethodSecond // Noncompliant {{Rename or add member 'AbstractMethod(string)' to this interface to resolve ambiguities.}}\n//                   ^^^^^^^^^^^^^^^^^^^^^\n    {\n    }\n\n    public interface IVirtualMethodFirst\n    {\n        public virtual string Virtual(string value)\n        {\n            return value;\n        }\n    }\n\n    public interface IVirtualMethodSecond\n    {\n        public virtual string Virtual(string value)\n//                            ^^^^^^^ Secondary {{This member collides with 'IVirtualMethodFirst.Virtual(string)'}}\n        {\n            return value;\n        }\n    }\n\n    public interface IVirtualMethodCommon : IVirtualMethodFirst, IVirtualMethodSecond // Noncompliant {{Rename or add member 'Virtual(string)' to this interface to resolve ambiguities.}}\n//                   ^^^^^^^^^^^^^^^^^^^^\n    {\n    }\n\n    public interface IInternalMethodFirst\n    {\n        internal string Internal(string value)\n        {\n            return value;\n        }\n    }\n\n    public interface IInternalMethodSecond\n    {\n        internal string Internal(string value)\n//                      ^^^^^^^^ Secondary {{This member collides with 'IInternalMethodFirst.Internal(string)'}}\n        {\n            return value;\n        }\n    }\n\n    public interface IInternalMethodCommon : IInternalMethodFirst, IInternalMethodSecond // Noncompliant {{Rename or add member 'Internal(string)' to this interface to resolve ambiguities.}}\n//                   ^^^^^^^^^^^^^^^^^^^^^\n    {\n    }\n\n    public interface IProtectedMethodFirst\n    {\n        protected string Protected(string value)\n        {\n            return value;\n        }\n    }\n\n    public interface IProtectedMethodSecond\n    {\n        protected string Protected(string value)\n//                       ^^^^^^^^^ Secondary {{This member collides with 'IProtectedMethodFirst.Protected(string)'}}\n        {\n            return value;\n        }\n    }\n\n    public interface IProtectedMethodCommon : IProtectedMethodFirst, IProtectedMethodSecond // Noncompliant {{Rename or add member 'Protected(string)' to this interface to resolve ambiguities.}}\n//                   ^^^^^^^^^^^^^^^^^^^^^^\n    {\n    }\n\n    public interface IPrivateMethodFirst\n    {\n        private string Private(string value)\n        {\n            return value;\n        }\n    }\n\n    public interface IPrivateMethodSecond\n    {\n        private string Private(string value)\n        {\n            return value;\n        }\n    }\n\n    public interface IPrivateMethodCommon : IPrivateMethodFirst, IPrivateMethodSecond // Compliant: the methods are not accessible on the derived classes or interfaces\n    {\n    }\n\n    public interface ISealedMethodFirst\n    {\n        public sealed string Sealed(string value)\n        {\n            return value;\n        }\n    }\n\n    public interface ISealedMethodSecond\n    {\n        public sealed string Sealed(string value)\n//                           ^^^^^^ Secondary {{This member collides with 'ISealedMethodFirst.Sealed(string)'}}\n        {\n            return value;\n        }\n    }\n\n    public interface ISealedMethodCommon : ISealedMethodFirst, ISealedMethodSecond // Noncompliant\n//                   ^^^^^^^^^^^^^^^^^^^\n    {\n    }\n\n    public interface IStaticMethodFirst\n    {\n        public static string Static(string value)\n        {\n            return value;\n        }\n    }\n\n    public interface IStaticMethodSecond\n    {\n        public static string Static(string value)\n//                           ^^^^^^ Secondary {{This member collides with 'IStaticMethodFirst.Static(string)'}}\n        {\n            return value;\n        }\n    }\n\n    public interface IStaticMethodDerived : IStaticMethodFirst, IStaticMethodSecond // Noncompliant\n    {\n    }\n\n    public interface IBase1\n    {\n        public static string PublicStaticField;\n    }\n\n    public interface IBase2\n    {\n        public static string PublicStaticField;\n    }\n\n    public interface IDerived : IBase1, IBase2\n    {\n    }\n\n    public interface IIndexer1\n    {\n        public string this[int i]\n        {\n            get { return \"\"; }\n            set { }\n        }\n    }\n\n    public interface IIndexer2\n    {\n        public string this[int i] // Indexer does not have a name, signature is used instead\n        {\n            get { return \"\"; }\n//          ^^^ Secondary {{This member collides with 'IIndexer1.this[int]'}}\n            set { }\n//          ^^^ Secondary {{This member collides with 'IIndexer1.this[int]'}}\n        }\n    }\n\n    public interface IIndexerDerived : IIndexer1, IIndexer2 // Noncompliant {{Rename or add members 'IIndexer2.this[int]' to this interface to resolve ambiguities.}}\n//                   ^^^^^^^^^^^^^^^\n    {\n    }\n\n    public interface IProperty1\n    {\n        public string Property\n        {\n            get => string.Empty;\n            set => Console.WriteLine(value);\n        }\n    }\n\n    public interface IProperty2\n    {\n        public string Property\n        {\n            get => string.Empty;\n//          ^^^ Secondary {{This member collides with 'IProperty1.Property.get'}}\n            set => Console.WriteLine(value);\n//          ^^^ Secondary {{This member collides with 'IProperty1.Property.set'}}\n        }\n    }\n\n    public interface IPropertyDerived : IProperty1, IProperty2 // Noncompliant {{Rename or add members 'Property.get' and 'Property.set' to this interface to resolve ambiguities.}}\n//                   ^^^^^^^^^^^^^^^^\n    {\n    }\n\n    public interface IEvents1\n    {\n        public event EventHandler Click;\n\n        public event EventHandler OnClick\n        {\n            add\n            {\n                Click += value;\n            }\n            remove\n            {\n                Click -= value;\n            }\n        }\n    }\n\n    public interface IEvents2\n    {\n        public event EventHandler Click;\n//                                ^^^^^ Secondary {{This member collides with 'IEvents1.Click'}}\n\n        public event EventHandler OnClick\n        {\n            add\n//          ^^^ Secondary {{This member collides with 'IEvents1.OnClick'}}\n            {\n                Click += value;\n            }\n            remove\n            {\n                Click -= value;\n            }\n        }\n    }\n\n    public interface IEventsDerived : IEvents1, IEvents2 // Noncompliant {{Rename or add members 'Click' and 'OnClick' to this interface to resolve ambiguities.}}\n    {\n    }\n}\n\npublic interface IAbstractFirst\n{\n    public static abstract string StaticAbstractMethod(string value);\n}\n\npublic interface IAbstractSecond\n{\n    public static abstract string StaticAbstractMethod(string value);\n//                                ^^^^^^^^^^^^^^^^^^^^ Secondary {{This member collides with 'IAbstractFirst.StaticAbstractMethod(string)'}}\n}\n\npublic interface IAbstractCommon : IAbstractFirst, IAbstractSecond { } // Noncompliant\n\npublic interface IVirtualFirst\n{\n    public static virtual string StaticVirtualMethod(string value) => value;\n}\n\npublic interface IVirtualSecond\n{\n    public static virtual string StaticVirtualMethod(string value) => value;\n//                               ^^^^^^^^^^^^^^^^^^^ Secondary {{This member collides with 'IVirtualFirst.StaticVirtualMethod(string)'}}\n}\n\npublic interface IVirtualCommon : IVirtualFirst, IVirtualSecond { }  // Noncompliant\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/InheritedCollidingInterfaceMembers.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public interface IMyInterface1\n    {\n        unsafe string Method(int[,] parameter, int* pointer);\n    }\n    public interface IMyInterface2\n    {\n        unsafe int Method(int[,] parameter, int* pointer);\n//                 ^^^^^^ Secondary {{This member collides with 'IMyInterface1.Method(int[*,*], int*)'}}\n    }\n    public interface IMyInterfaceCommon1 : IMyInterface1, IMyInterface2 // Noncompliant {{Rename or add member 'Method(int[*,*], int*)' to this interface to resolve ambiguities.}}\n//                   ^^^^^^^^^^^^^^^^^^^\n    {\n        int Method(int i, string s);\n    }\n    public interface IMyInterfaceCommon2 : IMyInterface1, IMyInterface2\n    {\n        unsafe new int Method(int[,] parameter, int* pointer);\n    }\n\n    public interface IMyInterfaceGeneric1\n    {\n        unsafe string Method<T1>(T1[,] parameter, int* pointer);\n    }\n    public interface IMyInterfaceGeneric2\n    {\n        unsafe int Method<T2>(T2[,] parameter, int* pointer);\n    }\n    public interface IMyInterfaceGenericCommon1 : IMyInterfaceGeneric1, IMyInterfaceGeneric2 // FN, no support for generics with different type name\n    {\n    }\n\n    public interface IMyInterfaceGeneric3<T>\n    {\n        unsafe int Method(T[,] parameter, int* pointer);\n//                 ^^^^^^ Secondary {{This member collides with 'IMyInterface1.Method(int[*,*], int*)'}}\n//                 ^^^^^^ Secondary@-1 {{This member collides with 'IMyInterfaceGeneric4<T>.Method(T[*,*], int*)'}}\n    }\n\n    public interface IMyInterfaceGeneric4<T>\n    {\n        unsafe int Method(T[,] parameter, int* pointer);\n    }\n\n    public interface IMyInterfaceGenericCommon2 : IMyInterface1, IMyInterfaceGeneric3<int> // Noncompliant\n    {\n    }\n\n    public interface IMyInterfaceGenericCommon3<T> : IMyInterfaceGeneric4<T>, IMyInterfaceGeneric3<T> // Noncompliant\n    {\n    }\n\n    public interface IMyInterfaceGenericCommon4<T> : IMyInterfaceGeneric4<T>, IMyInterfaceGeneric3<T>\n    {\n        unsafe int Method(T[,] parameter, int* pointer);\n    }\n\n    public interface IMyInterfaceEvent1\n    {\n        event EventHandler X;\n    }\n    public interface IMyInterfaceEvent2\n    {\n        event EventHandler X;\n//                         ^ Secondary {{This member collides with 'IMyInterfaceEvent1.X'}}\n    }\n    public interface IMyInterfaceCommonEvent : IMyInterfaceEvent1, IMyInterfaceEvent2 // Noncompliant\n    {\n    }\n\n    public interface IMultipleMember1\n    {\n        int Method(int i);\n        void Method2(string s);\n    }\n\n    public interface IMultipleMember2\n    {\n        void Method2(string s);\n//           ^^^^^^^ Secondary {{This member collides with 'IMultipleMember1.Method2(string)'}}\n    }\n\n    public interface IMultipleMember3\n    {\n        int Method(int i);\n//          ^^^^^^ Secondary {{This member collides with 'IMultipleMember1.Method(int)'}}\n    }\n\n    public interface IMultipleMemberCommon : IMultipleMember1, IMultipleMember2, IMultipleMember3 // Noncompliant {{Rename or add members 'Method(int)' and 'Method2(string)' to this interface to resolve ambiguities.}}\n    {\n    }\n\n    public interface IReadOnlyDictionary<TKey, TValue> : IReadOnlyCollection<KeyValuePair<TKey, TValue>>, //Noncompliant\n        IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable\n    {\n    }\n    public interface IMultilayer : IReadOnlyDictionary<string, object>, IDummy // Compliant\n    {\n    }\n    public interface IDummy\n    {\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/3225\n    public interface IRepro3225<T> : IList<T>, IReadOnlyList<T> // Noncompliant {{Rename or add member 'IReadOnlyList<T>.this[int]' to this interface to resolve ambiguities.}}\n    {\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/InitializeStaticFieldsInline.cs",
    "content": "﻿using System.IO;\nusing System.Reflection;\nusing System.Resources;\nusing System.Globalization;\n\nnamespace Tests.Diagnostics\n{\n    static class RuntimeInformation\n    {\n        public static bool IsWindows() { return true; }\n    }\n\n    class Program\n    {\n        public static int i;\n        static string s;\n\n        static Program() // Noncompliant\n//             ^^^^^^^\n        {\n            i = 3;\n            ResourceManager sm = new ResourceManager(\"strings\", Assembly.GetExecutingAssembly());\n            s = sm.GetString(\"mystring\");\n            sm = null;\n        }\n    }\n\n    class Foo\n    {\n        static Foo()\n        {\n            System.Console.WriteLine(\"test\");\n        }\n    }\n\n    class Bar\n    {\n        static Bar()\n        {\n            Program.i = 42;\n        }\n    }\n\n    static class Class1\n    {\n        public static readonly Foo foo1 = new Foo();\n        public static readonly Foo foo2 = new Foo();\n\n        public static readonly Foo someFoo;\n\n        static Class1() // Noncompliant\n        {\n            if (RuntimeInformation.IsWindows())\n                someFoo = foo1;\n            else\n                someFoo = foo2;\n        }\n    }\n\n    static class ExpressionBodyCtor\n    {\n        private static readonly bool IsAvailable;\n\n        static ExpressionBodyCtor() => IsAvailable = Initialize(); // Noncompliant\n\n        static bool Initialize() => true;\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/4832\n    public class ReproIfSingle\n    {\n        private static readonly string Key;\n\n        static ReproIfSingle()  // Noncompliant\n        {\n            if (RuntimeInformation.IsWindows())\n            {\n                Key = \"Key A\";\n            }\n            else\n            {\n                Key = \"Key B\";\n            }\n        }\n    }\n\n    public class ReproIfMulti\n    {\n        private static readonly string Key;\n        private static readonly string Value;\n\n        static ReproIfMulti()  // Compliant, because there are multiple variables assigned conditionally. Not easy to inline.\n        {\n            if (RuntimeInformation.IsWindows())\n            {\n                Key = \"Key A\";\n                Value = \"Value A\";\n            }\n            else\n            {\n                Key = \"Key B\";\n                Value = \"Value B\";\n            }\n        }\n    }\n\n    public class ReproIfMultiReducable\n    {\n        private static readonly string Key;\n        private static readonly string Value;\n\n        static ReproIfMultiReducable()  // FN\n        {\n            if (RuntimeInformation.IsWindows())\n            {\n                Key = \"Key A\";\n            }\n            else\n            {\n                Key = \"Key B\";\n            }\n            Value = \"Value\";\n        }\n    }\n\n    public class ReproSwitchSingle\n    {\n        private static readonly string Key;\n\n        static ReproSwitchSingle()    // Noncompliant\n        {\n            switch (RuntimeInformation.IsWindows())\n            {\n                case true:\n                    Key = \"Key A\";\n                    break;\n                default:\n                    Key = \"Key B\";\n                    break;\n            }\n        }\n    }\n\n    public class ReproSwitchMulti\n    {\n        private static readonly string Key;\n        private static readonly string Value;\n\n        static ReproSwitchMulti()    // Compliant, because there are multiple variable assigned conditionally. Not easy to inline.\n        {\n            switch (RuntimeInformation.IsWindows())\n            {\n                case true:\n                    Key = \"Key A\";\n                    Value = \"Value A\";\n                    break;\n                default:\n                    Key = \"Key B\";\n                    Value = \"Value B\";\n                    break;\n            }\n        }\n    }\n\n    public static class TestUtil\n    {\n        // https://github.com/SonarSource/sonar-dotnet/issues/6343\n        static TestUtil() // Compliant\n        {\n            if (!Directory.Exists(\"\"))\n            {\n                Directory.CreateDirectory(\"\");\n            }\n        }\n    }\n\n    // https://sonarsource.atlassian.net/browse/NET-184\n    static class Repro_184\n    {\n        private static readonly bool IsAvailable;\n\n        static Repro_184() // Noncompliant FP\n        {\n            IsAvailable = true;\n            System.Console.Write(\"side effect\");\n        }\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/9656\nnamespace TupleAssignments\n{\n    public class StaticConstructorWithTuple\n    {\n        private static readonly string Foo;\n        private static readonly string Bar;\n        private static readonly string Baz;\n\n        static StaticConstructorWithTuple()     // Compliant: the static constructor is needed because of the tuple assignment\n        {\n            (Foo, Bar) = Helper.GetFooBar();\n            Baz = Helper.GetBaz();\n        }\n    }\n\n    public class StaticConstructorWithTupleAndLocalVariables\n    {\n        private static readonly string Foo;\n        private static readonly string Bar;\n        private static readonly string Baz;\n\n        static StaticConstructorWithTupleAndLocalVariables()     // Noncompliant - FP\n        {\n            var (foo, bar) = Helper.GetFooBar();\n            Foo = foo;\n            Bar = bar;\n            Baz = Helper.GetBaz();\n        }\n    }\n\n    public class StaticConstructorWithTupleAndDiscard\n    {\n        private static readonly string Foo;\n        private static readonly string Bar;\n        private static readonly string Baz;\n\n        static StaticConstructorWithTupleAndDiscard()     // Noncompliant: the fields can be assigned separately\n        {\n            (Foo, _) = Helper.GetFooBar();\n            (_, Bar) = Helper.GetFooBar();\n            Baz = Helper.GetBaz();\n        }\n    }\n\n    public class StaticConstructorWithNestedTuple\n    {\n        private static readonly string Foo;\n        private static readonly string Bar;\n        private static readonly string Baz;\n        private static readonly string Qux;\n\n        static StaticConstructorWithNestedTuple()\n        {\n            ((Foo, Bar), Baz) = Helper.GetFooBarBaz();\n            Qux = \"\";\n        }\n    }\n\n    internal class Helper\n    {\n        internal static string GetBaz() => \"Baz\";\n        internal static (string, string) GetFooBar() => (\"Foo\", \"Bar\");\n        internal static ((string, string), string) GetFooBarBaz() => ((\"Foo\", \"Bar\"), \"Baz\");\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/InsecureContentSecurityPolicy.Latest.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Threading.Tasks;\nusing Microsoft.AspNetCore.Http;\nusing Microsoft.Extensions.Primitives;\n\npublic class InsecureContentSecurityPolicy\n{\n    public void CustomDictionary(MyHeaderDictionary myheaderDictionary)\n    {\n        myheaderDictionary.Add(\"Content-Security-Policy\", \"script-src 'self';\");                    // Compliant\n        myheaderDictionary.Add(\"Content-Security-Policy\", \"script-src 'self' 'unsafe-inline';\");    // Noncompliant\n        myheaderDictionary.Append(\"Content-Security-Policy\", \"script-src 'self';\");                 // Compliant\n        myheaderDictionary.Append(\"Content-Security-Policy\", \"script-src 'self' 'unsafe-inline';\"); // Compliant\n        myheaderDictionary[\"Content-Security-Policy\"] = \"script-src 'self';\";                       // Compliant\n        myheaderDictionary[\"Content-Security-Policy\"] = \"script-src 'self' 'unsafe-inline';\";       // Compliant\n    }\n\n    public void ConditionalNullAssignment(HttpContext context, IHeaderDictionary[] headers)\n    {\n        headers[0]?.ContentSecurityPolicy = \"*\"; // Noncompliant\n\n        context?.Response.Headers.ContentSecurityPolicy = \"*\";  // Noncompliant\n        context.Response?.Headers.ContentSecurityPolicy = \"*\";  // Noncompliant\n        context.Response.Headers?.ContentSecurityPolicy = \"*\";  // Noncompliant\n\n        context?.Response.Headers[\"Content-Security-Policy\"] = \"script-src 'self' 'unsafe-inline';\"; // Noncompliant\n        context.Response?.Headers[\"Content-Security-Policy\"] = \"script-src 'self' 'unsafe-inline';\"; // Noncompliant\n        context.Response.Headers?[\"Content-Security-Policy\"] = \"script-src 'self' 'unsafe-inline';\"; // Noncompliant\n    }\n}\n\npublic class MyHeaderDictionary : IHeaderDictionary\n{\n    public long? ContentLength { get; set; }\n    public ICollection<string> Keys => throw new NotImplementedException();\n    public ICollection<StringValues> Values => throw new NotImplementedException();\n    public int Count => throw new NotImplementedException();\n    public bool IsReadOnly => throw new NotImplementedException();\n    public StringValues this[string key]\n    {\n        get => throw new NotImplementedException();\n        set => throw new NotImplementedException();\n    }\n\n    public void Add(string key, StringValues value) { }\n    public void Append(string key, StringValues value) { }\n    public bool ContainsKey(string key) => throw new NotImplementedException();\n    public bool Remove(string key) => throw new NotImplementedException();\n    public bool TryGetValue(string key, [MaybeNullWhen(false)] out StringValues value) => throw new NotImplementedException();\n    public void Clear() => throw new NotImplementedException();\n    public bool Contains(KeyValuePair<string, StringValues> item) => throw new NotImplementedException();\n    public void CopyTo(KeyValuePair<string, StringValues>[] array, int arrayIndex) => throw new NotImplementedException();\n    public bool Remove(KeyValuePair<string, StringValues> item) => throw new NotImplementedException();\n    public IEnumerator<KeyValuePair<string, StringValues>> GetEnumerator() => throw new NotImplementedException();\n    IEnumerator IEnumerable.GetEnumerator() => throw new NotImplementedException();\n    public void Add(KeyValuePair<string, StringValues> item) => throw new NotImplementedException();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/InsecureContentSecurityPolicy.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Threading.Tasks;\nusing Microsoft.AspNetCore.Http;\nusing Microsoft.Extensions.Primitives;\n\nnamespace SonarAnalyzer.Test.TestCases\n{\n    public class InsecureContentSecurityPolicy\n    {\n        public async Task InvokeAsync(HttpContext context, IHeaderDictionary dictionary, A mock)\n        {\n            const string unsafeConstantValue = \"script-src 'self' 'unsafe-inline';\";\n            const string safeConstantValue = \"script-src 'self';\";\n            const string partiallyUnsafeConstantValue = \"unsafe\";\n            const string contentSecurityPolicy = \"Content-Security-Policy\";\n\n            context.Response.Headers.ContentSecurityPolicy = \"*\";                 // Noncompliant {{Content Security Policies should be restrictive to mitigate the risk of content injection attacks.}}\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            context.Response.Headers.ContentSecurityPolicy = \"'unsafe-inline'\";   // Noncompliant\n            context.Response.Headers.ContentSecurityPolicy = \"'unsafe-hashes'\";   // Noncompliant\n            context.Response.Headers.ContentSecurityPolicy = \"'unsafe-eval'\";     // Noncompliant\n            context.Response.Headers.ContentSecurityPolicy = \"script-src 'self' 'unsafe-inline' 'unsafe-eval' 'unsafe-hashes';\"; // Noncompliant\n            context.Response.Headers.ContentSecurityPolicy = \"'something-else'\";  // Compliant\n            context.Response.Headers.AccessControlAllowHeaders = \"'unsafe-inline'\";   // Compliant\n            context.Response.Headers.ContentSecurityPolicy = unsafeConstantValue; // Noncompliant\n            context.Response.Headers.ContentSecurityPolicy = safeConstantValue;   // Compliant\n            context.Response.Headers.ContentSecurityPolicy = $\"{safeConstantValue} 'unsafe-inline'\"; // Noncompliant\n            context.Response.Headers.ContentSecurityPolicy = $\"{safeConstantValue} 'unsafe-inline'\"; // Noncompliant\n            context.Response.Headers.ContentSecurityPolicy = $\"'{partiallyUnsafeConstantValue}-inline'\"; // Noncompliant\n\n            context.Response.Headers.ContentSecurityPolicy = \"script-src 'self' 'unsafe-inline';\"; // Noncompliant\n            context.Response.Headers.ContentSecurityPolicy = \"script-src 'self';\";                 // Compliant\n            context.Response.Headers.AcceptCharset = \"script-src 'self' 'unsafe-inline';\";         // Compliant\n            _ = context.Response.Headers.ContentSecurityPolicy; // Compliant\n\n            context.Response.Headers[\"Content-Security-Policy\"] = \"script-src 'self' 'unsafe-inline';\"; // Noncompliant\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            context.Response.Headers[\"Content-Security-Policy\"] = \"script-src 'self';\"; // Compliant\n            context.Response.Headers[\"Content-Security-Policy\"] = unsafeConstantValue; // Noncompliant\n            context.Response.Headers[\"AcceptCharset\"] = \"script-src 'self' 'unsafe-inline';\"; // Compliant\n            context.Response.Headers[contentSecurityPolicy] = \"script-src 'self' 'unsafe-inline';\"; // Noncompliant\n            context.Response.Headers[contentSecurityPolicy] = unsafeConstantValue; // Noncompliant\n            _ = context.Response.Headers[contentSecurityPolicy]; // Compliant\n            context.Response.Headers[contentSecurityPolicy].ToString(); // Compliant\n\n            context.Response.Headers.Add(\"Content-Security-Policy\", \"default-src 'self' '*.example.com';\"); // Noncompliant\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            context.Response.Headers.Add(\"Content-Security-Policy\", \"default-src 'self' 'example.com'\"); // Compliant\n            context.Response.Headers.Add(\"Content-Security-Policy\", unsafeConstantValue); // Noncompliant\n            context.Response.Headers.Add(contentSecurityPolicy, unsafeConstantValue); // Noncompliant\n            context.Response.Headers.Add(contentSecurityPolicy, $\"'{partiallyUnsafeConstantValue}-inline'\"); // Noncompliant\n            context.Response.Headers.Append(\"Content-Security-Policy\", \"default-src 'self' '*.example.com';\"); // Noncompliant\n            context.Response.Headers.Append(\"Content-Security-Policy\", \"script-src 'self' 'example.com';\"); // Compliant\n            context.Response.Headers.Append(\"Content-Security-Policy\", unsafeConstantValue); // Noncompliant\n            context.Response.Headers.Append(contentSecurityPolicy, unsafeConstantValue); // Noncompliant\n            context.Response.Headers.Add(\"AcceptCharset\", \"default-src 'self' '*.example.com';\"); // Compliant\n            context.Response.Headers.Append(\"AcceptCharset\", \"default-src 'self' '*.example.com';\"); // Compliant\n\n            dictionary.Add(\"Content-Security-Policy\", \"default-src 'self' '*.example.com';\"); // Noncompliant\n            dictionary.Add(\"Content-Security-Policy\", \"default-src 'self';\"); // Compliant\n            dictionary.Append(\"Content-Security-Policy\", \"default-src 'self' '*.example.com';\"); // Noncompliant\n            dictionary.Append(\"Content-Security-Policy\", \"default-src 'self';\"); // Compliant\n            dictionary[\"Content-Security-Policy\"] = \"default-src 'self' '*.example.com';\"; // FN\n            dictionary[\"Content-Security-Policy\"] = \"default-src 'self';\"; // Compliant\n\n            mock.Response.Headers.ContentSecurityPolicy = \"script-src 'self' 'unsafe-inline';\";            // Compliant\n            mock.Response.Headers.Add(\"Content-Security-Policy\", \"script-src 'self' 'unsafe-inline';\");    // Compliant\n            mock.Response.Headers.Append(\"Content-Security-Policy\", \"script-src 'self' 'unsafe-inline';\"); // Compliant\n            mock.Response.Headers[\"Content-Security-Policy\"] = \"script-src 'self' 'unsafe-inline';\";       // Compliant\n\n            context.Response.Headers.ContentSecurityPolicy = \"script-src 'self' 'wasm-unsafe-eval';\"; // Compliant: 'wasm-unsafe-eval' should not raise issue as it is required for client-side Blazor apps.\n\n            context.Response.Headers[\"Content-Security-Policy\"] = new StringValues(\"script-src 'self' 'unsafe-inline';\");                          // FN\n            context.Response.Headers.Add(new KeyValuePair<string, StringValues>(\"Content-Security-Policy\", \"script-src 'self' 'unsafe-inline';\")); // FN\n            context.Response.Headers.Add(\"Content-Security-Policy\", new StringValues(\"default-src 'self' '*.example.com';\"));                      // FN\n            context.Response.Headers.Append(\"Content-Security-Policy\", new StringValues(\"script-src 'self' 'unsafe-inline';\"));                    // FN\n        }\n\n        public class A\n        {\n            public B Response { get; set; }\n            public class B\n            {\n                public C Headers { get; set; }\n                public class C\n                {\n                    public string ContentSecurityPolicy { get; set; }\n                    public void Add(string key, string value) { }\n                    public void Append(string key, string value) { }\n                    public string this[string key]\n                    {\n                        get => string.Empty;\n                        set => ContentSecurityPolicy = value;\n                    }\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/InsecureEncryptionAlgorithm.Latest.cs",
    "content": "﻿using System.Security.Cryptography;\n\n\nvar oid = CryptoConfig.MapNameToOID(\"\"\"DES\"\"\"); // Compliant\nSymmetricAlgorithm test1 = SymmetricAlgorithm.Create(\"\"\"DES\"\"\"); // Noncompliant\n\nusing (MyTripleDESCryptoServiceProvider tripleDES = new())  // Noncompliant {{Use a strong cipher algorithm.}}\n{\n}\n\nusing (DESCryptoServiceProvider des = new())    // Noncompliant\n{\n}\n\nusing (RC2CryptoServiceProvider rc21 = new())   // Noncompliant\n{\n}\n\nusing (AesCryptoServiceProvider aes = new())    // Compliant\n{\n}\n\npublic class MyTripleDESCryptoServiceProvider : TripleDES\n{\n    public override ICryptoTransform CreateDecryptor(byte[] rgbKey, byte[] rgbIV) =>\n        throw new System.NotImplementedException();\n\n    public override ICryptoTransform CreateEncryptor(byte[] rgbKey, byte[] rgbIV) =>\n        throw new System.NotImplementedException();\n\n    public override void GenerateIV() =>\n        throw new System.NotImplementedException();\n\n    public override void GenerateKey() =>\n        throw new System.NotImplementedException();\n}\n\npublic class InsecureEncryptionAlgorithm\n{\n    // Rule will raise an issue for both S2278 and S5547 as they are activated by default in unit tests\n    public InsecureEncryptionAlgorithm()\n    {\n        using (MyTripleDESCryptoServiceProvider tripleDES = new())  // Noncompliant {{Use a strong cipher algorithm.}}\n        {\n        }\n\n        using (DESCryptoServiceProvider des = new())    // Noncompliant\n        {\n        }\n\n        using (RC2CryptoServiceProvider rc21 = new())   // Noncompliant\n        {\n        }\n\n        using (AesCryptoServiceProvider aes = new())    // Compliant\n        {\n        }\n    }\n}\n\npublic struct S\n{\n    public void Assignment()\n    {\n        SymmetricAlgorithm a = null;\n        (a, var b) = (a, new DESCryptoServiceProvider()); // Noncompliant\n    }\n}\n\npublic partial class PartialProperty\n{\n    public partial SymmetricAlgorithm Symmetric { get; }\n    private partial SymmetricAlgorithm this[int index] { get; } \n}\npublic partial class PartialProperty\n{\n    public partial SymmetricAlgorithm Symmetric { get { return new DESCryptoServiceProvider(); } } // Noncompliant\n    private partial SymmetricAlgorithm this[int index] { get { return new DESCryptoServiceProvider(); } } // Noncompliant\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/InsecureEncryptionAlgorithm.Latest.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\n\nPublic Class InsecureEncryptionAlgorithm\n\n    Public Sub NullConditionalIndexing(List As List(Of Integer))\n        Dim Value As Integer = List?(0)\n    End Sub\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/InsecureEncryptionAlgorithm.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Security.Cryptography;\nusing Org.BouncyCastle.Crypto.Engines;\nusing Org.BouncyCastle.Crypto.Modes;\n\nnamespace Tests.Diagnostics\n{\n    public class MyTripleDESCryptoServiceProvider : TripleDES\n    {\n        public override ICryptoTransform CreateDecryptor(byte[] rgbKey, byte[] rgbIV)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public override ICryptoTransform CreateEncryptor(byte[] rgbKey, byte[] rgbIV)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public override void GenerateIV()\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public override void GenerateKey()\n        {\n            throw new System.NotImplementedException();\n        }\n    }\n\n    public class InsecureEncryptionAlgorithm\n    {\n        public InsecureEncryptionAlgorithm()\n        {\n            // Rule will raise an issue for both S2278 and S5547 as they are activated by default in unit tests\n\n            using (var tripleDES = new MyTripleDESCryptoServiceProvider()) // Noncompliant    {{Use a strong cipher algorithm.}}\n//                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            {\n                //...\n            }\n            using (var des = new DESCryptoServiceProvider()) // Noncompliant\n            {\n                //...\n            }\n            using (TripleDES TripleDESalg = TripleDES.Create()) // Noncompliant\n//                                          ^^^^^^^^^^^^^^^^^^\n            {\n            }\n\n            using (var des = DES.Create(\"fgdsgsdfgsd\")) // Noncompliant\n            {\n            }\n\n            using (var aes = new AesCryptoServiceProvider())\n            {\n                //...\n            }\n\n            using (var rc21 = new RC2CryptoServiceProvider()) // Noncompliant\n            {\n\n            }\n\n            using (var rc22 = RC2.Create()) // Noncompliant\n            {\n\n            }\n\n            SymmetricAlgorithm des1 = SymmetricAlgorithm.Create(\"DES\"); // Noncompliant\n            des1 = SymmetricAlgorithm.Create(\"TripleDES\"); // Noncompliant\n            des1 = SymmetricAlgorithm.Create(\"3DES\"); // Noncompliant\n\n            var rc2 = SymmetricAlgorithm.Create(\"RC2\"); // Noncompliant\n\n            var crypto = CryptoConfig.CreateFromName(\"DES\"); // Noncompliant\n\n            var aesFastEngine = new AesFastEngine(); // Noncompliant\n//                                  ^^^^^^^^^^^^^\n\n            var blockCipher1 = new GcmBlockCipher(new AesFastEngine()); // Noncompliant\n\n            var blockCipher2 = new GcmBlockCipher(new AesEngine());     // Compliant\n\n            var oid = CryptoConfig.MapNameToOID(\"DES\"); // Compliant\n\n            var unknown = new Unknown(); // Compliant // Error [CS0246]\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/InsecureEncryptionAlgorithm.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.Security.Cryptography\nImports Org.BouncyCastle.Crypto.Engines\nImports Org.BouncyCastle.Crypto.Modes\n\nNamespace Tests.TestCases\n\n    Public Class MyTripleDESCryptoServiceProvider\n        Inherits TripleDES\n\n        Public Overrides Sub GenerateKey()\n            Throw New NotImplementedException()\n        End Sub\n\n        Public Overrides Sub GenerateIV()\n            Throw New NotImplementedException()\n        End Sub\n\n        Public Overrides Function CreateEncryptor(rgbKey() As Byte, rgbIV() As Byte) As ICryptoTransform\n            Throw New NotImplementedException()\n        End Function\n\n        Public Overrides Function CreateDecryptor(rgbKey() As Byte, rgbIV() As Byte) As ICryptoTransform\n            Throw New NotImplementedException()\n        End Function\n\n    End Class\n\n    Public Class InsecureEncryptionAlgorithm\n\n        Public Sub New()\n\n            Using TripleDES As New MyTripleDESCryptoServiceProvider() ' Noncompliant    {{Use a strong cipher algorithm.}}\n            '                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            '   ...\n            End Using\n\n            Using Des = New DESCryptoServiceProvider() ' Noncompliant\n            '   ...\n            End Using\n\n            Using TripleDESalg = TripleDES.Create() ' Noncompliant\n            '                    ^^^^^^^^^^^^^^^^^^\n            '   ...\n            End Using\n\n            Using DesInstance = DES.Create(\"fgdsgsdfgsd\") ' Noncompliant\n            '   ...\n            End Using\n\n            Using Aes = new AesCryptoServiceProvider() ' Compliant\n                '   ...\n            End Using\n\n            Using Rc21 = new RC2CryptoServiceProvider() ' Noncompliant\n            '   ...\n            End Using\n\n            Using Rc22 = RC2.Create() ' Noncompliant\n            '   ...\n            End Using\n\n            Dim Des1 As SymmetricAlgorithm = SymmetricAlgorithm.Create(\"DES\") ' Noncompliant\n\n            Des1 = SymmetricAlgorithm.Create(\"TripleDES\") ' Noncompliant\n\n            Des1 = SymmetricAlgorithm.Create(\"3DES\") ' Noncompliant\n\n            Dim Rc2Instance = SymmetricAlgorithm.Create(\"RC2\") ' Noncompliant\n\n            Dim Crypto = CryptoConfig.CreateFromName(\"DES\") ' Noncompliant\n\n            Dim AesFastEngineInstance = New AesFastEngine() ' Noncompliant\n            '                               ^^^^^^^^^^^^^\n\n            Dim BlockCipher1 = new GcmBlockCipher(new AesFastEngine()) ' Noncompliant\n\n            Dim BlockCipher2 = new GcmBlockCipher(new AesEngine()) ' Compliant\n\n            Dim Oid = CryptoConfig.MapNameToOID(\"DES\") ' Compliant\n\n        End Sub\n\n    End Class\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/InsecureTemporaryFilesCreation.Latest.cs",
    "content": "﻿using System;\nusing System.IO;\n\nvar tempPath = Path.GetTempFileName(); // Noncompliant {{'Path.GetTempFileName()' is insecure. Use 'Path.GetRandomFileName()' instead.}}\n//             ^^^^^^^^^^^^^^^^^^^^\n\n_ = Path.GetTempFileName(); // Noncompliant\n\nstring Get() => Path.GetTempFileName(); // Noncompliant\n\npublic record Record\n{\n    private readonly string tempFileName;\n\n    public string TempFileName\n    {\n        init => tempFileName = Path.Combine(value, Path.GetTempFileName()); // Noncompliant\n        get => tempFileName;\n    }\n\n    public void Method() => Path.GetTempFileName(); // Noncompliant\n\n    public void Safe() => Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); // Compliant\n}\n\npublic class Class\n{\n    public Func<string> GetTempFileNameGenerator() => Path.GetTempFileName; // Noncompliant\n//                                                    ^^^^^^^^^^^^^^^^^^^^\n\n    public void Test()\n    {\n        Consume(Path.GetTempFileName); // Noncompliant\n\n        _ = Custom.Path.GetTempFileName(); // Compliant, method from other namespace\n    }\n\n    private static void Consume(Func<string> generator) => generator();\n}\n\nnamespace Custom\n{\n    public static class Path\n    {\n        public static string GetTempFileName() => string.Empty;\n    }\n}\n\npublic class Sample\n{\n    public string Temp;\n\n    public void NullConditionalAssignment(Sample arg)\n    {\n        arg?.Temp = Path.GetTempFileName(); // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/InsecureTemporaryFilesCreation.cs",
    "content": "﻿using System;\nusing System.IO;\n\npublic class Sample\n{\n    private string tempFileName;\n\n    public string TempFileName\n    {\n        set => tempFileName = Path.Combine(value, Path.GetTempFileName()); // Noncompliant\n        get => tempFileName;\n    }\n\n    public void Method() => Path.GetTempFileName(); // Noncompliant\n\n    public void Safe() => Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); // Compliant\n}\n\npublic class Class\n{\n    public Func<string> GetTempFileNameGenerator() => Path.GetTempFileName; // Noncompliant\n//                                                    ^^^^^^^^^^^^^^^^^^^^\n\n    public void Test()\n    {\n        Consume(Path.GetTempFileName); // Noncompliant\n\n        _ = Custom.Path.GetTempFileName(); // Compliant, method from other namespace\n    }\n\n    private static void Consume(Func<string> generator) => generator();\n}\n\nnamespace Custom\n{\n    public static class Path\n    {\n        public static string GetTempFileName() => string.Empty;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/InsecureTemporaryFilesCreation.vb",
    "content": "﻿Imports System\nImports System.IO\n\nPublic Class TestCases\n    ReadOnly Property TempFileName() As String\n        Get\n            TempFileName = Path.GetTempFileName() 'Noncompliant\n            Exit Property\n        End Get\n    End Property\n\n    Public Sub Method()\n        Dim TempPath = Path.GetTempFileName() 'Noncompliant\n    End Sub\n\n    Public Function GetTempFileNameGenerator() As Func(Of String)\n        Return AddressOf Path.GetTempFileName 'Noncompliant\n    End Function\n\n    Public Sub Test()\n        Consume(AddressOf Path.GetTempFileName) 'Noncompliant\n    End Sub\n\n    Public Sub Consume(generator as Func(Of String))\n        Dim path = generator()\n    End Sub\n\n    Public Function Compliant() As String\n        Return Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()) 'Compliant\n    End Function\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/InsteadOfAny.EntityFramework.Core.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing Microsoft.EntityFrameworkCore;\n\n// https://github.com/SonarSource/sonar-dotnet/issues/7286\npublic class EntityFrameworkReproGH7286\n{\n    public class MyEntity\n    {\n        public int Id { get; set; }\n    }\n\n    public class FirstContext: DbContext\n    {\n        public DbSet<MyEntity> MyEntities { get; set; }\n    }\n\n    public class SecondContext: DbContext\n    {\n        public DbSet<MyEntity> SecondEntities { get; set; }\n    }\n\n\n    public void GetEntities(FirstContext dbContext, List<int> ids)\n    {\n        _ = dbContext.MyEntities.Where(e => ids.Any(i => e.Id == i)); // Compliant\n        _ = dbContext.MyEntities.Where(e => ids.Any(i => e.Equals(i))); // Compliant\n        _ = dbContext.MyEntities.Where(e => ids.Any(i => e.Id > i)); // Compliant\n\n        _ = dbContext.MyEntities.Where(e => ids.Any(i => e.Id is i)); // Error [CS9135]\n        _ = dbContext.MyEntities.Where(e => ids.Any(i => e.Id is 2)); // Error [CS8122]\n\n        var iqueryable = dbContext.MyEntities.OrderBy(e => e.Id);\n        _ = iqueryable.Where(e => ids.Any(i => e.Id == i)); // Compliant\n    }\n\n    public async Task GetEntitiesAsync(SecondContext secondContext, List<int> ids)\n    {\n        _ = await secondContext\n                .SecondEntities\n                .Where(e => ids.Any(i => e.Id == i))\n                .ToListAsync();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/InsteadOfAny.EntityFramework.Core.vb",
    "content": "﻿Imports System.Collections.Generic\nImports System.Linq\nImports Microsoft.EntityFrameworkCore\n\nPublic Class EntityFrameworkTestcases\n    Public Class MyEntity2\n        Public Property Id As Integer\n    End Class\n\n    Public Class MyDbContext\n        Inherits DbContext\n\n        Public Property MyEntities As DbSet(Of MyEntity2)\n\n        Public Sub GetEntities(ByVal dbContext As MyDbContext, ByVal ids As List(Of Integer))\n            Dim __ As IQueryable(Of MyEntity2) = dbContext.MyEntities.Where(Function(e) ids.Any(Function(i) e.Id = i)) ' Compliant\n            __ = dbContext.MyEntities.Where(Function(e) ids.Any(Function(i) e.Equals(i))) ' Compliant\n            __ = dbContext.MyEntities.Where(Function(e) ids.Any(Function(i) e.Id > i)) ' Compliant\n            __ = dbContext.MyEntities.Where(Function(e) ids.Any(Function(i) TypeOf e.Id Is i)) ' Error [BC30002]\n\n            Dim iqueryable = dbContext.MyEntities.OrderBy(Function(e) e.Id)\n            __ = iqueryable.Where(Function(e) ids.Any(Function(i) e.Id = i)) ' Compliant\n\n        End Sub\n    End Class\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/InsteadOfAny.EntityFramework.Framework.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.Remoting.Contexts;\nusing System.Threading.Tasks;\nusing System.Data.Entity;\n\n// https://github.com/SonarSource/sonar-dotnet/issues/7286\npublic class EntityFrameworkReproGH7286\n{\n    public class MyEntity\n    {\n        public int Id { get; set; }\n    }\n\n    public class FirstContext : DbContext\n    {\n        public DbSet<MyEntity> MyEntities { get; set; }\n    }\n\n    public class SecondContext : DbContext\n    {\n        public DbSet<MyEntity> SecondEntities { get; set; }\n    }\n\n\n    public void GetEntities(FirstContext dbContext, List<int> ids)\n    {\n        _ = dbContext.MyEntities.Where(e => ids.Any(i => e.Id == i)); // Compliant\n        _ = dbContext.MyEntities.Where(e => ids.Any(i => e.Equals(i))); // Compliant\n        _ = dbContext.MyEntities.Where(e => ids.Any(i => e.Id > i)); // Compliant\n\n        var iqueryable = dbContext.MyEntities.OrderBy(e => e.Id);\n        _ = iqueryable.Where(e => ids.Any(i => e.Id == i)); // Compliant\n    }\n\n    public async Task GetEntitiesAsync(SecondContext secondContext, List<int> ids)\n    {\n        _ = await secondContext\n                .SecondEntities\n                .Where(e => ids.Any(i => e.Id == i))\n                .ToListAsync();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/InsteadOfAny.Latest.cs",
    "content": "﻿using System.Linq;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\n\nvar list = new List<int>();\nlist.Any(x => x > 0);       // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\nlist?.Any(x => x > 0);      // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\nlist.Any(x => x == 0);      // Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\nlist?.Any(x => x == 0);     // Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\nlist.Append(1).Any(x => x > 0);\nlist.Any();\nlist.Exists(x => x > 0);\n\nvar immutableList = ImmutableList.Create<int>();\nimmutableList.Any(x => x > 0);  // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\nimmutableList?.Any(x => x > 0); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\nimmutableList.Append(1).Any(x => x > 0);\nimmutableList.Any();\nimmutableList.Exists(x => x > 0);\n\nint someInt = 1;\nimmutableList.Any(x => x == 0);         // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\nimmutableList.Any(x => 0 == x);         // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\nimmutableList.Any(x => x == someInt);   // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\nimmutableList.Any(x => someInt == x);   // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\nimmutableList.Any(x => x.Equals(0));    // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\nimmutableList.Any(x => 0.Equals(x));        // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\nimmutableList.Any(x => x.Equals(x + 1));    // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n\npublic class Sample\n{\n    public List<int> FieldKeyword\n    {\n        get;\n        set\n        {\n            if (field.Any(x => x == 0)) // Noncompliant\n            {\n                field.AddRange(value);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/InsteadOfAny.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Linq.Expressions;\n\npublic class TestClass\n{\n    void MyMethod(List<int> list, int[] array)\n    {\n        list.Any(x => x > 0); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        //   ^^^\n        list.Any(x => x == 0); // Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        //   ^^^\n\n        list.Append(1).Any(x => x > 1); // Compliant (Appended list becomes an IEnumerable)\n        list.Append(1).Append(2).Any(x => x > 1); // Compliant\n        list.Append(1).Append(2).Any(x => x > 1).ToString(); // Compliant\n\n        list.Any(); // Compliant (you can't use Exists with no arguments, CS7036)\n        list.Exists(x => x > 0); // Compliant\n\n        array.Any(x => x > 0); // Noncompliant\n        array.Any(); // Compliant\n\n        var classA = new ClassA();\n        classA.myListField.Any(x => x > 0); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        classA.classB.myListField.Any(x => x > 0); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        classA.classB.myListField.Any(); // Compliant\n\n        var classB = new ClassB();\n        classB.Any(x => x > 0); // Compliant\n\n        list?.Any(x => x > 0); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        list?.Any(x => x > 0).ToString(); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        classB?.Any(x => x > 0); // Compliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n\n        Func<int, bool> del = x => true;\n        list.Any(del); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n\n        var enumList = new EnumList<int>();\n        enumList.Any(x => x > 0); // Compliant\n\n        var goodList = new GoodList<int>();\n        goodList.Any(x => x > 0); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n\n        var ternaryExists = (true ? list : goodList).Any(x => x > 0); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        var nullCoalesceExists = (list ?? goodList).Any(x => x > 0); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        var ternaryNullCoalesceExists = (list ?? (true ? list : goodList)).Any(x => x > 0); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n\n        var ternaryContains = (true ? list : goodList).Any(x => x == 0); // Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        var nullCoalesceContains = (list ?? goodList).Any(x => x == 0); // Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        var ternaryNullCoalesceContains = (list ?? (true ? list : goodList)).Any(x => x == 0); // Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n\n        goodList.GetList().Any(x => true); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n\n        Any<int>(x => x > 0); // Compliant\n        AcceptMethod<int>(goodList.Any); // Compliant\n    }\n\n    void List(List<int> list)\n    {\n        list.Any(x => x == 0); // Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        list.Any(x => x > 0); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        list.Any(); // Compliant\n    }\n\n    void HashSet(HashSet<int> hashSet)\n    {\n        hashSet.Any(x => x == 0); // Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        hashSet.Any(x => x > 0); // Compliant\n        hashSet.Any(); // Compliant\n    }\n\n    void SortedSet(SortedSet<int> sortedSet)\n    {\n        sortedSet.Any(x => x == 0); // Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        sortedSet.Any(x => x > 0); // Compliant\n        sortedSet.Any(); // Compliant\n    }\n\n    void Array(int[] array)\n    {\n        array.Any(x => x == 0); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        array.Any(x => x > 0); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        array.Any(); // Compliant\n    }\n\n    void ConditionalsMatrix(GoodList<int> goodList)\n    {\n        goodList.GetList().GetList().GetList().GetList().Any(x => x > 0);     // Noncompliant\n        goodList.GetList().GetList().GetList().GetList()?.Any(x => x > 0);    // Noncompliant\n        goodList.GetList().GetList().GetList()?.GetList().Any(x => x > 0);    // Noncompliant\n        goodList.GetList().GetList().GetList()?.GetList()?.Any(x => x > 0);   // Noncompliant\n        goodList.GetList().GetList()?.GetList().GetList().Any(x => x > 0);    // Noncompliant\n        goodList.GetList().GetList()?.GetList().GetList()?.Any(x => x > 0);   // Noncompliant\n        goodList.GetList().GetList()?.GetList()?.GetList().Any(x => x > 0);   // Noncompliant\n        goodList.GetList().GetList()?.GetList()?.GetList()?.Any(x => x > 0);  // Noncompliant\n        goodList.GetList()?.GetList().GetList().GetList().Any(x => x > 0);    // Noncompliant\n        goodList.GetList()?.GetList().GetList().GetList()?.Any(x => x > 0);   // Noncompliant\n        goodList.GetList()?.GetList().GetList()?.GetList().Any(x => x > 0);   // Noncompliant\n        goodList.GetList()?.GetList().GetList()?.GetList()?.Any(x => x > 0);  // Noncompliant\n        goodList.GetList()?.GetList()?.GetList().GetList().Any(x => x > 0);   // Noncompliant\n        goodList.GetList()?.GetList()?.GetList().GetList()?.Any(x => x > 0);  // Noncompliant\n        goodList.GetList()?.GetList()?.GetList()?.GetList().Any(x => x > 0);  // Noncompliant\n        goodList.GetList()?.GetList()?.GetList()?.GetList()?.Any(x => x > 0); // Noncompliant\n    }\n\n    void CheckDelegate(\n        List<int> intList,\n        List<string> stringList,\n        List<ClassA> refList,\n        int[] intArray,\n        string someString,\n        int someInt,\n        int anotherInt,\n        ClassA someRef)\n    {\n        intList.Any(x => x == 0); // Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        intList.Any(x => 0 == x); // Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        intList.Any(x => x == someInt); // Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        intList.Any(x => someInt == x); // Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        intList.Any(x => x.Equals(0));  // Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        intList.Any(x => 0.Equals(x));  // Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        intList.Any(x => x is 1); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}} Should be Contains\n        intList.Any(x => 1 is x); // Error [CS9135]\n        intList.Any(x => x is someInt); // Error [CS9135]\n        intList.Any(x => someInt is x); // Error [CS9135]\n\n        intList.Any(x => x == x); // Noncompliant\n        intList.Any(x => someInt == anotherInt); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        intList.Any(x => someInt == 0); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        intList.Any(x => 0 == 0); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n\n        intList.Any(x => x.Equals(x)); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        intList.Any(x => someInt.Equals(anotherInt)); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        intList.Any(x => someInt.Equals(0)); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        intList.Any(x => 0.Equals(0)); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        intList.Any(x => x.Equals(x + 1)); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n\n        intList.Any(x => x.GetType() == typeof(int)); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        intList.Any(x => x.GetType().Equals(typeof(int))); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}} FP\n        intList.Any(x => MyIntCheck(x)); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        intList.Any(MyIntCheck);  // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        intList.Any(x => x != 0); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        intList.Any(x => x.Equals(0) && true);   // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        intList.Any(x => (x == 0 ? 2 : 0) == 0); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        intList.Any(x => { return x == 0; });    // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}} FP\n\n        stringList.Any(x => x == \"\"); // Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        stringList.Any(x => \"\" == x); // Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        stringList.Any(x => x == someString); // Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        stringList.Any(x => someString == x); // Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        stringList.Any(x => x.Equals(\"\")); // Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        stringList.Any(x => \"\".Equals(x)); // Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        stringList.Any(x => Equals(x, \"\")); // Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        stringList.Any(x => x is \"\"); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}} FP\n        stringList.Any(x => x is null); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}} Should raise Contains\n        stringList.Any(x => \"\" is x); // Error [CS9135]\n        stringList.Any(x => x is someString); // Error [CS9135]\n        stringList.Any(x => someString is x); // Error [CS9135]\n\n        stringList.Any(x => MyStringCheck(x)); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        stringList.Any(MyStringCheck);  // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        stringList.Any(x => x != \"\");   // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        stringList.Any(x => x.Equals(\"\") && true);   // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        stringList.Any(x => (x == \"\" ? \"a\" : \"b\") == \"a\"); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        stringList.Any(x => x.Equals(\"\" + someString)); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n\n        intArray.Any(x => x == 0); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        intArray.Any(x => 0 == x); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        intArray.Any(x => x == someInt); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        intArray.Any(x => someInt == x); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        intArray.Any(x => x.Equals(0));  // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        intArray.Any(x => 0.Equals(x));  // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        intArray.Any(x => someInt.Equals(x)); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        intArray.Any(x => x.Equals(x + 1));   // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n\n        refList.Any(x => x == someRef); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        refList.Any(x => someRef == x); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        refList.Any(x => x.Equals(someRef));  // Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        refList.Any(x => someRef.Equals(x));  // Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        refList.Any(x => Equals(someRef, x)); // Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        refList.Any(x => Equals(x, someRef)); // Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        refList.Any(x => x is someRef); // Error [CS9135]\n        refList.Any(x => someRef is x); // Error [CS9135]\n\n        intList.Any(x => x == null); // Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}} (warning: the result of this expression will always be false since a value-type is never equal to null)\n        intList.Any(x => x.Equals(null));  // Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}} (warning: the result of this expression will always be false since a value-type is never equal to null)\n        intList.Any(x => Equals(x, null)); // Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}} (warning: the result of this expression will always be false since a value-type is never equal to null)\n\n        refList.Any(x => x == null); // Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        refList.Any(x => x.Equals(null));  // Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        refList.Any(x => Equals(x, null)); // Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n\n        bool MyIntCheck(int x) => x == 0;\n        bool MyStringCheck(string x) => x == \"\";\n    }\n\n    void CustomEqualsCheckOneParam(List<int> intList, int someInt)\n    {\n        intList.Any(x => Equals(x)); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n\n        bool Equals(int a) => false;\n    }\n\n    void CustomEqualsCheckTwoParam(List<int> intList, int someInt)\n    {\n        intList.Any(x => Equals(x, someInt)); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n\n        bool Equals(int a, int b) => false;\n    }\n\n    void CustomEqualsCheckThreeParam(List<int> intList, int someInt)\n    {\n        intList.Any(x => Equals(x, someInt, someInt)); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n\n        bool Equals(int a, int b, int c) => false;\n    }\n\n    bool ContainsEvenExpression(List<int> data) =>\n        data.Any(x => x % 2 == 0); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n\n    bool Any<T>(Func<T, bool> predicate) => true;\n\n    void AcceptMethod<T>(Func<Func<T, bool>, bool> methodThatLooksLikeAny) { }\n\n    class GoodList<T> : List<T>\n    {\n        public GoodList<T> GetList() => this;\n        void CallAny() => this.Any(x => true); // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n    }\n\n    class EnumList<T> : IEnumerable<T>\n    {\n        public IEnumerator<T> GetEnumerator() => null;\n        IEnumerator IEnumerable.GetEnumerator() => null;\n    }\n\n    class ClassA\n    {\n        public List<int> myListField = new List<int>();\n\n        public List<int> myListProperty\n        {\n            get => myListField;\n            set\n            {\n                myListField.AddRange(value);\n                var b = myListField.Any(x => x > 0);    // Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n                var c = myListField.Exists(x => x > 0); // Compliant\n                var d = myListField.Contains(0);        // Compliant\n            }\n        }\n\n        public ClassB classB = new ClassB();\n    }\n}\n\npublic class ClassB\n{\n    public List<int> myListField = new List<int>();\n\n    public bool Any(Func<int, bool> predicate) => false;\n}\n\npublic class ExpressionTree\n{\n    // https://github.com/SonarSource/sonar-dotnet/issues/7508\n    public void Repro_7508()\n    {\n        Expression<Func<List<int>, bool>> containsThree = list => list.Any(el => el == 3); // Compliant (IsInExpressionTree)\n    }\n\n    class Customer\n    {\n        public ICollection<Order> Orders { get; } // Orders is an IEnumerable<T> and not IQueryable<T>\n    }\n    class Order\n    {\n        public int Id { get; }\n    }\n\n    private void NestedQuery(IQueryable<Customer> customers) // typically a DbSet<Customer> https://learn.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.dbset-1\n    {\n        // Typical query in EF (https://learn.microsoft.com/en-us/ef/core/modeling/relationships/one-to-many)\n\n        // (order => order.Id > 0) is not an Expression<Func<..>> nor is Orders an IQueryable<T>\n        // But the surrounding \"customers.Where\" are and so we do not raise.\n        var qry1 = customers.Where(customer => customer.Orders.Any(order => order.Id > 0)); // Compliant. In expression tree context\n\n        var qry2 = from customer in customers\n                   where customer.Orders.Any(order => order.Id > 0) // Compliant. In expression tree context\n                   select customer;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/InsteadOfAny.vb",
    "content": "﻿Imports System\nImports System.Collections\nImports System.Collections.Generic\nImports System.Linq\n\nPublic Class TestClass\n    Private Sub MyMethod(ByVal list As List(Of Integer), ByVal array As Integer())\n        list.Any(Function(x) x > 0) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        '    ^^^\n        list.Any(Function(x) x = 0) ' Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        '    ^^^\n\n        list.Append(1).Any(Function(x) x > 1) ' Compliant (Appended list becomes an IEnumerable)\n        list.Append(1).Append(2).Any(Function(x) x > 1) ' Compliant\n        Enumerable.Any(Enumerable.Append(Enumerable.Append(list, 1), 2), Function(x) x > 1).ToString() ' Compliant \n\n        list.Any() ' Compliant (you can't use Exists with no arguments, CS7036)\n        list.Exists(Function(x) x > 0) ' Compliant\n        Dim a = list.Contains(0)\n\n        array.Any(Function(x) x > 0) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        array.Any() ' Compliant\n\n        Dim classA = New ClassA()\n        classA.myListField.Any(Function(x) x > 0) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        classA.classB.myListField.Any(Function(x) x > 0) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        classA.classB.myListField.Any() ' Compliant\n\n        Dim classB = New ClassB()\n        classB.Any(Function(x) x > 0) ' Compliant\n\n        list?.Any(Function(x) x > 0) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        classB?.Any(Function(x) x > 0) ' Compliant\n\n        Dim del As Func(Of Integer, Boolean) = Function(x) True\n        list.Any(del) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n\n        Dim enumList = New EnumList(Of Integer)()\n        enumList.Any(Function(x) x > 0) ' Compliant\n\n        Dim goodList = New GoodList(Of Integer)()\n        goodList.Any(Function(x) x > 0) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n\n        Dim ternary = If(True, list, goodList).Any(Function(x) x > 0) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        Dim nullCoalesce = If(list, goodList).Any(Function(x) x > 0) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        Dim ternaryNullCoalesce = If(list, If(True, list, goodList)).Any(Function(x) x > 0) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n\n        goodList.GetList().Any(Function(x) True) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n\n        Any(Of Integer)(Function(x) x > 0) ' Compliant\n        Call AcceptMethod(New Func(Of Func(Of Integer, Boolean), Boolean)(AddressOf goodList.Any)) ' Compliant\n    End Sub\n\n    Private Sub List(ByVal pList As List(Of Integer))\n        pList.Any(Function(x) x = 0) ' Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        pList.Any(Function(x) x > 0) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        pList.Any() ' Compliant\n    End Sub\n\n    Private Sub HashSet(ByVal pHashSet As HashSet(Of Integer))\n        pHashSet.Any(Function(x) x = 0) ' Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        pHashSet.Any(Function(x) x > 0) ' Compliant\n        pHashSet.Any() ' Compliant\n    End Sub\n\n    Private Sub SortedSet(ByVal pSortedSet As SortedSet(Of Integer))\n        pSortedSet.Any(Function(x) x = 0) ' Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        pSortedSet.Any(Function(x) x > 0) ' Compliant\n        pSortedSet.Any() ' Compliant\n    End Sub\n\n    Private Sub Array(ByVal pArray As Integer())\n        pArray.Any(Function(x) x = 0) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        pArray.Any(Function(x) x > 0) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        pArray.Any() ' Compliant\n    End Sub\n\n    Private Sub ConditionalsMatrix(ByVal goodList As GoodList(Of Integer))\n        goodList.GetList().GetList().GetList().GetList().Any(Function(x) x > 0)     ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        goodList.GetList().GetList().GetList().GetList()?.Any(Function(x) x > 0)    ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        goodList.GetList().GetList().GetList()?.GetList().Any(Function(x) x > 0)    ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        goodList.GetList().GetList().GetList()?.GetList()?.Any(Function(x) x > 0)   ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        goodList.GetList().GetList()?.GetList().GetList().Any(Function(x) x > 0)    ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        goodList.GetList().GetList()?.GetList().GetList()?.Any(Function(x) x > 0)   ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        goodList.GetList().GetList()?.GetList()?.GetList().Any(Function(x) x > 0)   ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        goodList.GetList().GetList()?.GetList()?.GetList()?.Any(Function(x) x > 0)  ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        goodList.GetList()?.GetList().GetList().GetList().Any(Function(x) x > 0)    ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        goodList.GetList()?.GetList().GetList().GetList()?.Any(Function(x) x > 0)   ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        goodList.GetList()?.GetList().GetList()?.GetList().Any(Function(x) x > 0)   ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        goodList.GetList()?.GetList().GetList()?.GetList()?.Any(Function(x) x > 0)  ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        goodList.GetList()?.GetList()?.GetList().GetList().Any(Function(x) x > 0)   ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        goodList.GetList()?.GetList()?.GetList().GetList()?.Any(Function(x) x > 0)  ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        goodList.GetList()?.GetList()?.GetList()?.GetList().Any(Function(x) x > 0)  ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        goodList.GetList()?.GetList()?.GetList()?.GetList()?.Any(Function(x) x > 0) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n    End Sub\n\n    Private Sub CheckDelegate(ByVal intList As List(Of Integer), ByVal stringList As List(Of String), ByVal refList As List(Of ClassA), ByVal intArray As Integer(), ByVal someString As String, ByVal someInt As Integer, ByVal anotherInt As Integer, ByVal someRef As ClassA)\n        intList.Any(Function(x) x = 0) ' Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        intList.Any(Function(x) 0 = x) ' Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        intList.Any(Function(x) x = someInt) ' Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        intList.Any(Function(x) someInt = x) ' Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        intList.Any(Function(x) x.Equals(0)) ' Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        intList.Any(Function(x) 0.Equals(x)) ' Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n\n        intList.Any(Function(x) x = x) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        intList.Any(Function(x) someInt = anotherInt) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        intList.Any(Function(x) someInt = 0) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        intList.Any(Function(x) 0 = 0) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n\n        intList.Any(Function(x) x.Equals(x)) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        intList.Any(Function(x) someInt.Equals(anotherInt)) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        intList.Any(Function(x) someInt.Equals(0)) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        intList.Any(Function(x) 0.Equals(0)) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        intList.Any(Function(x) x.Equals(x + 1)) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n\n        intList.Any(Function(x) x.GetType() Is GetType(Integer)) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        intList.Any(Function(x) x.GetType().Equals(GetType(Integer))) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}} FP\n        intList.Any(Function(x) MyIntCheck(x)) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        intList.Any(Function(x) x <> 0)     ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        intList.Any(Function(x) x.Equals(0) AndAlso True) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        intList.Any(Function(x) If(x = 0, 2, 0) = 0) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n\n        stringList.Any(Function(x) Equals(x, \"\")) ' Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        stringList.Any(Function(x) Equals(\"\", x)) ' Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        stringList.Any(Function(x) Equals(x, someString)) ' Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        stringList.Any(Function(x) Equals(someString, x)) ' Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        stringList.Any(Function(x) x.Equals(\"\")) ' Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        stringList.Any(Function(x) \"\".Equals(x)) ' Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        stringList.Any(Function(x) Equals(x, \"\")) ' Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        stringList.Any(Function(x) \"\" Is x) ' Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        stringList.Any(Function(x) x Is \"\") ' Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        stringList.Any(Function(x) x Is Nothing) ' Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n\n        stringList.Any(Function(x) MyStringCheck(x)) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        stringList.Any(Function(x) Not Equals(x, \"\"))     ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        stringList.Any(Function(x) x.Equals(\"\") AndAlso True)   ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        stringList.Any(Function(x) Equals(If(Equals(x, \"\"), \"a\", \"b\"), \"a\")) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        stringList.Any(Function(x) x.Equals(\"\" & someString)) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n\n        intArray.Any(Function(x) x = 0) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        intArray.Any(Function(x) 0 = x) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        intArray.Any(Function(x) x = someInt) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        intArray.Any(Function(x) someInt = x) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        intArray.Any(Function(x) x.Equals(0)) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        intArray.Any(Function(x) 0.Equals(x)) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        intArray.Any(Function(x) someInt.Equals(x)) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        intArray.Any(Function(x) x.Equals(x + 1)) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n\n        refList.Any(Function(x) x Is someRef) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        refList.Any(Function(x) someRef Is x) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n        refList.Any(Function(x) x.Equals(someRef))  ' Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        refList.Any(Function(x) someRef.Equals(x))  ' Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        refList.Any(Function(x) Equals(someRef, x)) ' Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        refList.Any(Function(x) Equals(x, someRef)) ' Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n\n        intList.Any(Function(x) x Is Nothing) ' Error [BC30020]\n        intList.Any(Function(x) x.Equals(Nothing)) ' Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}} FP\n        intList.Any(Function(x) Equals(x, Nothing)) ' Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}} FP\n\n        refList.Any(Function(x) x = Nothing) ' Error [BC30452]\n        refList.Any(Function(x) x.Equals(Nothing)) ' Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n        refList.Any(Function(x) Equals(x, Nothing)) ' Noncompliant {{Collection-specific \"Contains\" method should be used instead of the \"Any\" extension.}}\n    End Sub\n\n    Private Function MyIntCheck(ByVal x As Integer) As Boolean\n        Return x = 0\n    End Function\n    Private Function MyStringCheck(ByVal x As String) As Boolean\n        Return Equals(x, \"\")\n    End Function\n\n    Private Function Any(Of T)(ByVal predicate As Func(Of T, Boolean)) As Boolean\n        Return True\n    End Function\n\n    Private Sub AcceptMethod(Of T)(ByVal methodThatLooksLikeAny As Func(Of Func(Of T, Boolean), Boolean))\n    End Sub\n\n    Friend Class GoodList(Of T)\n        Inherits List(Of T)\n        Public Function GetList() As GoodList(Of T)\n            Return Me\n        End Function\n    End Class\n\n    Friend Class EnumList(Of T)\n        Implements IEnumerable(Of T)\n        Public Function GetEnumerator() As IEnumerator(Of T) Implements IEnumerable(Of T).GetEnumerator\n            Return Nothing\n        End Function\n        Private Function GetEnumerator1() As IEnumerator Implements IEnumerable.GetEnumerator\n            Return Nothing\n        End Function\n    End Class\n\n    Friend Class ClassA\n        Public myListField As List(Of Integer) = New List(Of Integer)()\n\n        Public Property myListProperty As List(Of Integer)\n            Get\n                Return myListField\n            End Get\n            Set(ByVal value As List(Of Integer))\n                myListField.AddRange(value)\n                Dim b = myListField.Any(Function(x) x > 0) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n                Dim c = myListField.Exists(Function(x) x > 0) ' Compliant\n            End Set\n        End Property\n\n        Public classB As ClassB = New ClassB()\n    End Class\nEnd Class\n\nPublic Class ClassB\n    Public myListField As List(Of Integer) = New List(Of Integer)()\n\n    Public Function Any(ByVal predicate As Func(Of Integer, Boolean)) As Boolean\n        Return False\n    End Function\n\n    Private Sub CheckEquals(ByVal intList As List(Of Integer), ByVal someInt As Integer)\n        intList.Any(Function(x) Equals(x, someInt, someInt)) ' Noncompliant {{Collection-specific \"Exists\" method should be used instead of the \"Any\" extension.}}\n    End Sub\n\n    Private Function Equals(ByVal a As Integer, ByVal b As Integer, ByVal c As Integer) As Boolean\n        Return False\n    End Function\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/InterfaceMethodsShouldBeCallableByChildTypes.CSharp9.cs",
    "content": "﻿using System;\nusing System.Globalization;\n\npublic interface IFoo\n{\n    void Method();\n    int Property { get; set; }\n\n    event EventHandler Event;\n}\n\npublic record Foo : IFoo\n{\n    void IFoo.Method() // Noncompliant {{Make 'Foo' sealed, change to a non-explicit declaration or provide a new method exposing the functionality of 'IFoo.Method'.}}\n    {\n    }\n\n    void Method() { }\n\n    int IFoo.Property // Noncompliant {{Make 'Foo' sealed, change to a non-explicit declaration or provide a new method exposing the functionality of 'IFoo.Property'.}}\n    { get; set; }\n\n    int Property { get; set; }\n\n    event EventHandler IFoo.Event // Noncompliant\n    { add { } remove { } }\n\n    // We cannot add this line yet, it crashes Roslyn with StackOverflowException https://github.com/dotnet/roslyn/issues/49286\n    // event EventHandler Event {  add { } remove { } }\n}\n\npublic record Bar(string Name) : IFoo\n{\n    void IFoo.Method() { } // Noncompliant {{Make 'Bar' sealed, change to a non-explicit declaration or provide a new method exposing the functionality of 'IFoo.Method'.}}\n    int IFoo.Property // Noncompliant {{Make 'Bar' sealed, change to a non-explicit declaration or provide a new method exposing the functionality of 'IFoo.Property'.}}\n    { get; set; }\n    event EventHandler IFoo.Event // Noncompliant\n    { add { } remove { } }\n}\n\n// Repro https://sonarsource.atlassian.net/browse/NET-3524\npublic interface IBaseInterface\n{\n    void Method1(string parameter);\n}\n\npublic interface IDerivedInterface : IBaseInterface\n{\n    void Method2(int parameter);\n\n    void IBaseInterface.Method1(string parameter) => this.Method2(Convert.ToInt32(parameter, CultureInfo.InvariantCulture)); // Noncompliant FP\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/InterfaceMethodsShouldBeCallableByChildTypes.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public interface IFoo\n    {\n        void Method();\n        int Property { get; set; }\n\n        event EventHandler Event;\n    }\n\n    public class Foo : IFoo\n    {\n        void IFoo.Method() // Noncompliant {{Make 'Foo' sealed, change to a non-explicit declaration or provide a new method exposing the functionality of 'IFoo.Method'.}}\n//                ^^^^^^\n        {\n        }\n\n        void Method() { }\n\n        int IFoo.Property // Noncompliant {{Make 'Foo' sealed, change to a non-explicit declaration or provide a new method exposing the functionality of 'IFoo.Property'.}}\n//               ^^^^^^^^\n        { get; set; }\n\n        int Property { get; set; }\n\n        event EventHandler IFoo.Event // Noncompliant {{Make 'Foo' sealed, change to a non-explicit declaration or provide a new method exposing the functionality of 'IFoo.Event'.}}\n//                              ^^^^^\n        { add { } remove { } }\n\n        event EventHandler Event {  add { } remove { } }\n    }\n\n    public sealed class Foo2 : IFoo\n    {\n        void IFoo.Method() // Compliant - Foo2 is sealed\n        {\n        }\n        int IFoo.Property\n        { get; set; }\n        event EventHandler IFoo.Event\n        { add { } remove { } }\n    }\n\n    public class Foo3 : IFoo\n    {\n        public void Method() // Compliant - IFoo is not explicitly implemented\n        {\n        }\n\n        public int Property { get; set; }\n        public event EventHandler Event { add { } remove { } }\n    }\n\n    public class Foo4 : IFoo\n    {\n        void IFoo.Method() // Compliant - public method with same name, params and return type\n        {\n        }\n\n        public void Method() { }\n\n        int IFoo.Property\n        { get; set; }\n\n        public int Property { get; set; }\n\n        event EventHandler IFoo.Event\n        { add { } remove { } }\n\n        public event EventHandler Event { add { } remove { } }\n    }\n\n    public class Foo5 : IFoo\n    {\n        void IFoo.Method() // Compliant - public method with same name, params BUT different return type\n        {\n        }\n\n        public int Method() => 42;\n\n        int IFoo.Property\n        { get; set; }\n\n        public float Property { get; set; }\n\n        event EventHandler IFoo.Event\n        { add { } remove { } }\n\n        public event EventHandler<ResolveEventArgs> Event\n        { add { } remove { } }\n    }\n\n    public class Foo6 : IFoo\n    {\n        void IFoo.Method() // Compliant - public method with same name, return type BUT different param\n        {\n        }\n\n        public void Method(int i) { }\n\n        int IFoo.Property\n        { get; set; }\n\n        public int Property { get; }\n\n        event EventHandler IFoo.Event\n        { add { } remove { } }\n\n        public event EventHandler Event { add { } remove { } }\n    }\n\n    public class Foo7 : IFoo\n    {\n        void IFoo.Method() // Noncompliant\n        {\n        }\n\n        private void Method() { }\n\n        int IFoo.Property // Noncompliant\n        { get; set; }\n\n        private int Property { get; set; }\n\n        event EventHandler IFoo.Event // Noncompliant\n        { add { } remove { } }\n\n        private event EventHandler Event { add { } remove { } }\n    }\n\n    public class Foo8 : IFoo\n    {\n        void IFoo.Method() // Compliant\n        {\n        }\n\n        protected void Method() { }\n\n        int IFoo.Property // Compliant\n        { get; set; }\n\n        protected int Property { get; set; }\n\n        event EventHandler IFoo.Event // Compliant\n        { add { } remove { } }\n\n        protected event EventHandler Event { add { } remove { } }\n    }\n\n    public class MyClass3 : IDisposable\n    {\n        void IDisposable.Dispose() // Compliant - Close is an allowed special case for IDisposable\n        {\n        }\n\n        public void Close() { }\n    }\n\n    public class MyClass4 : IDisposable\n    {\n        void IDisposable.Dispose() // Noncompliant\n        {\n        }\n\n        protected void Bar() { }\n    }\n\n    public class MyClass5 : MyDisposable\n    {\n        void MyDisposable.NotDispose() // Noncompliant\n        {\n        }\n\n        protected void Bar() { }\n    }\n\n    public interface MyDisposable\n    {\n        void NotDispose();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/InterfaceName.vb",
    "content": "﻿Namespace Tests.Diagnostics\n    Public Interface MyInterface ' Noncompliant\n'                    ^^^^^^^^^^^\n    End Interface\n    Public Interface IMyInterface ' Compliant\n    End Interface\n\n    Public Interface IMMyInterface ' Compliant\n    End Interface\n    Public Interface IMMMMyInterface ' Noncompliant\n    End Interface\n\nEnd Namespace"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/InterfacesShouldNotBeEmpty.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace MyLibrary\n{\n    public interface ISomeMethodsInterface\n    {\n        void Method();\n    }\n\n    public interface MyInterface { } // Noncompliant {{Remove this interface or add members to it.}}\n    //               ^^^^^^^^^^^\n\n    public interface MyInterface2 : ISomeMethodsInterface { } // Noncompliant\n\n    public interface MyInterface3\n    {\n        void Foo();\n    }\n\n    public interface MyInterface4\n    {\n        bool Bar { get; }\n    }\n\n    internal interface MyInterfaceInternal { }\n\n    interface MyInterfaceDefault { }\n\n    public class Container\n    {\n        public interface IPublic { } // Noncompliant\n        private interface IPrivate { }\n        internal interface IInternal { }\n    }\n\n    // This is not a marker interface, it aggregates other interfaces and is ok not to have members\n    interface MyInterface5 : ISomeMethodsInterface, MyInterface3 // Compliant\n    {\n    }\n\n    public interface ISortedCollection<T> : ICollection<T> { }  // Noncompliant: ICollection<T> is derived from a lot other interfaces but this is not \"aggregation\" like MyInterface5\n    public interface ISortedList : IList { }                    // Noncompliant: Same here, still just a marker interface\n\n    public interface // Error [CS1001]\n    {\n    }\n\n    public interface IGeneric<T> { }                                                       // Noncompliant\n    public interface IBoundGeneric : IGeneric<int> { }                                     // Compliant: specialized version\n    public interface IUnboundGeneric<T> : IGeneric<T> { }                                  // Noncompliant: Just an alias of the base interface\n    public interface IUnboundConstraintGeneric1<T> : IGeneric<T> where T : struct { }      // Compliant: specialized version, constraint struct\n    public interface IUnboundConstraintGeneric2<T> : IGeneric<T> where T : class { }       // Compliant: specialized version, constraint class\n    public interface IUnboundConstraintGeneric3<T> : IGeneric<T> where T : new() { }       // Compliant: specialized version, constraint new\n    public interface IUnboundConstraintGeneric4<T> : IGeneric<T> where T : IDisposable { } // Compliant: specialized version, constraint type\n    public interface IGeneric2_Constraint1<T1, T2> : IGeneric<T1> where T1 : new() { }     // Compliant: specialized version\n    public interface IGeneric2_Constraint2<T1, T2> : IGeneric<T1> where T2 : new() { }     // Compliant: FN. Not a specialization of the base type parameter\n    public interface IGeneric3<T> where T : new() { }                                      // Noncompliant: No base interface\n\n    [Obsolete(\"Interface with attribute\")]\n    public interface Attributed1 { }                  // Noncompliant: An interface with an attribute is still only usefull as a marker\n                                                      // Note: Implementing types do not inherit this attribute even if AttributeUsageAttribute.Inherited = true\n\n    [Obsolete(\"Interface with attribute\")]\n    public interface Attributed2 : MyInterface { }    // Compliant: A derived interface with attribute enhances the base interface\n\n    [Obsolete(\"Interface with attribute\")]\n    public interface Attributed3<T> : IGeneric<T> { } // Compliant: A derived interface with attribute enhances the base interface\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/InvalidCastToInterface.Latest.cs",
    "content": "﻿using System;\nusing System.Text;\n\nvar standalone = new StandaloneClass();\nvar casted = (ISomething)standalone;    // Noncompliant, this part is not based on SE\n\nvar implementing = new ImplementingClass();\ncasted = (ISomething)implementing;\n\nint? nullable = 42;\nvar i = (int)nullable;\n\nnullable = null;\ni = (int)nullable; // FN {{Nullable is known to be empty, this cast throws an exception.}};\n\nvoid TopLevelLocalFunction()\n{\n    var localstandalone = new StandaloneClass();\n    var localcasted = (ISomething)localstandalone;    // Noncompliant, this part is not based on SE\n\n    var localimplementing = new ImplementingClass();\n    localcasted = (ISomething)localimplementing;\n\n    int? localnullable = 42;\n    var i = (int)localnullable;\n\n    localnullable = null;\n    i = (int)localnullable; // SE part\n}\n\npublic interface ISomething { }\npublic class StandaloneClass { }\npublic class ImplementingClass : ISomething { }\n\npublic class Sample\n{\n    private string field;\n    private ISomething somethingField;\n\n    public void TargetTypedNew()\n    {\n        StandaloneClass standalone = new();\n        var casted = (ISomething)standalone;    // Noncompliant, this part is not based on SE\n\n        ImplementingClass implementing = new();\n        casted = (ISomething)implementing;\n\n        int? nullable = 42;\n        var i = (int)nullable;\n\n        nullable = null;\n        i = (int)nullable; // FN, can't build CFG for this method\n    }\n\n    public void StaticLambda()\n    {\n        Action a = static () =>\n        {\n            var standalone = new StandaloneClass();\n            var casted = (ISomething)standalone;     // Noncompliant\n\n            var implementing = new ImplementingClass();\n            casted = (ISomething)implementing;\n\n            int? nullable = 42;\n            var i = (int)nullable;\n\n            nullable = null;\n            i = (int)nullable; // SE part\n        };\n        a();\n    }\n\n    public int Property\n    {\n        get => 42;\n        init\n        {\n            var standalone = new StandaloneClass();\n            var casted = (ISomething)standalone;     // Noncompliant, this part is not based on SE\n\n            var implementing = new ImplementingClass();\n            casted = (ISomething)implementing;\n\n            int? nullable = 42;\n            var i = (int)nullable;\n\n            nullable = null;\n            i = (int)nullable;  // SE part\n        }\n    }\n\n    public void TupleAssignment()\n    {\n        var standalone = new StandaloneClass();\n        StandaloneClass a;\n        (a, var b) = (standalone, (ISomething)standalone); // Noncompliant\n    }\n\n    public void NullConditionalAssignment(Sample arg)\n    {\n        var standalone = new StandaloneClass();\n        arg?.somethingField = (ISomething)standalone; // Noncompliant\n    }\n\n    public ISomething FieldKeyword\n    {\n        get;\n        set => field = ((ISomething)new StandaloneClass()); // Noncompliant\n    }\n}\n\npublic record StandaloneRecord { }\npublic record ImplementingRecord : ISomething { }\n\npublic record Record\n{\n    public void MethodWithClasses()\n    {\n        var standalone = new StandaloneClass();\n        var casted = (ISomething)standalone;     // Noncompliant\n\n        var implementing = new ImplementingClass();\n        casted = (ISomething)implementing;\n\n        int? nullable = 42;\n        var i = (int)nullable;\n\n        nullable = null;\n        i = (int)nullable; // SE part\n    }\n\n    public void MethodWithRecords()\n    {\n        var standalone = new StandaloneRecord();\n        var casted = (ISomething)standalone;     // Noncompliant\n\n        var implementing = new ImplementingRecord();\n        casted = (ISomething)implementing;\n    }\n}\n\npublic partial class Partial : ISomething\n{\n    public partial void Method();\n}\n\npublic partial class Partial\n{\n    public partial void Method()\n    {\n        var standalone = new StandaloneClass();\n        var casted = (ISomething)standalone;     // Noncompliant\n\n        var implementing = new ImplementingClass();\n        casted = (ISomething)implementing;\n\n        var implementingPartial = new Partial();\n        casted = (ISomething)implementingPartial;\n\n        int? nullable = 42;\n        var i = (int)nullable;\n\n        nullable = null;\n        i = (int)nullable; // SE part\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/InvalidCastToInterface.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\n\nnamespace Tests.Diagnostics\n{\n    public interface IMyInterface\n    { /* ... */ }\n\n    public class Implementer : IMyInterface { }\n\n    public interface IMyInterface2\n    { /* ... */ }\n\n    public interface IMyInterface4 : IMyInterface\n    { /* ... */ }\n\n    public interface IMyInterface3 : IMyInterface\n    { /* ... */ }\n\n    public class MyClass1\n    { /* ... */ }\n    public class MyClass2\n    { /* ... */ }\n\n    public class MyClass3 : MyClass2, IMyInterface\n    { /* ... */ }\n\n    public class MyClass4\n    { /* ... */ }\n\n    public class InvalidCastToInterface\n    {\n        public class Nested : MyClass4, IDisposable\n        {\n            public void Dispose() { }\n        }\n\n        static void Main()\n        {\n            var myclass1 = new MyClass1();\n            var x = (IMyInterface)myclass1; // Noncompliant {{Review this cast; in this project there's no type that extends 'MyClass1' and implements 'IMyInterface'.}}\n//                   ^^^^^^^^^^^^\n            x = myclass1 as IMyInterface;\n            bool b = myclass1 is IMyInterface;\n\n            var arr = new MyClass1[10];\n            var arr2 = (IMyInterface[])arr;\n\n            var myclass2 = new MyClass2();\n            var y = (IMyInterface)myclass2;\n\n            IMyInterface i = new MyClass3();\n            var c = (IMyInterface2)i; // Compliant\n            IMyInterface4 ii = null;\n            var d = (IMyInterface2)i; // Compliant\n            var e = (IMyInterface3)i;\n\n            var o = (object)true;\n            e = (IMyInterface3)o;\n\n            var coll = (IEnumerable<int>)new List<int>();\n\n            var z = (IDisposable)new MyClass4();\n\n            var w = (IDisposable)(new Node());\n        }\n    }\n\n    public class DerivedNode : MiddleNode, IDisposable\n    {\n        public void Dispose() { }\n    }\n    public class MiddleNode : Node\n    {\n\n    }\n    public class Node\n    { }\n\n    public class MyClass\n    {\n        public double? D { get; set; } = 1.001;\n    }\n\n    interface IFoo { }\n    interface IBar { }\n\n    class Foo : IFoo { }\n    class Bar : IBar { public Bar(string foo) { } }\n    class FooBar : IFoo, IBar { }\n    sealed class FinalBar : IBar { }\n\n    class Other\n    {\n        public void Method<T>(T generic) where T : new()\n        {\n            IFoo ifoo = null;\n            IBar ibar = null;\n            Foo foo = null;\n            Bar bar = null;\n            FooBar foobar = null;\n            FinalBar finalbar = null;\n            object o = null;\n\n            o = (IFoo)bar;  // Noncompliant\n            o = (IFoo)ibar;\n            o = (Foo)bar; // Compliant; causes compiler error // Error [CS0030] - invalid cast\n            o = (Foo)ibar;\n            o = (IFoo)finalbar; // Compliant; causes compiler error // Error [CS0030] - invalid cast\n            o = (Bar)generic; // Compliant; causes compiler error // Error [CS0030] - invalid cast\n\n            o = bar  as IFoo;\n            o = ibar as IFoo;\n            o = ibar as Foo;\n            o = generic as Bar;\n\n            o = bar  is IFoo;\n            o = ibar is IFoo;\n            o = bar  is Foo;\n            o = ibar is Foo;\n            o = finalbar is IFoo;\n            o = generic is Bar;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/InvalidCastToInterface.vb",
    "content": "﻿Public Interface IBase\nEnd Interface\n\nPublic Interface INotImplemented\nEnd Interface\n\nPublic Interface INotImplementedWithBase\n    Inherits IBase\n\nEnd Interface\n\nPublic Interface IImplemented\nEnd Interface\n\nPublic Interface IGeneric(Of T)\nEnd Interface\n\nPublic Interface IGeneric(Of TFirst, TSecond)\nEnd Interface\n\nPublic Class ImplementerOfIBase\n    Implements IBase\n\nEnd Class\n\nPublic Class ImplementerOfIImplemented\n    Implements IImplemented\n\nEnd Class\n\nPublic Class ImplementerOfIIGenericInt\n    Implements IGeneric(Of Integer)\n\nEnd Class\n\nPublic Class ImplementerOfIIGenericString\n    Implements IGeneric(Of String)\n\nEnd Class\n\nPublic Class ImplementerOfIIGenericStringObject\n    Implements IGeneric(Of String, Object)\n\nEnd Class\n\nPublic Class ImplementerOfIIGenericStringString\n    Implements IGeneric(Of String, String)\n\nEnd Class\n\nPublic Class ImplementerOfIIGenericIntString\n    Implements IGeneric(Of Integer, String)\n\nEnd Class\n\nPublic Class EmptyClass\nEnd Class\n\nPublic Class EmptyBase\nEnd Class\n\nPublic Class InheritsAndImplements\n    Inherits EmptyBase\n    Implements IBase\n\nEnd Class\n\nPublic Class InvalidCastToInterface\n\n    Public Class Nested\n        Inherits EmptyClass\n        Implements IDisposable\n\n        Public Sub Dispose() Implements IDisposable.Dispose\n        End Sub\n\n    End Class\n\n    Public Sub Main()\n        Dim Empty As New EmptyClass(), WithDirect, WithTry, WithCType As IBase\n        WithDirect = DirectCast(Empty, IBase)   ' Noncompliant {{Review this cast; in this project there's no type that extends 'EmptyClass' and implements 'IBase'.}}\n        '                              ^^^^^\n        WithCType = CType(Empty, IBase)         ' Noncompliant {{Review this cast; in this project there's no type that extends 'EmptyClass' and implements 'IBase'.}}\n        '                        ^^^^^\n        Dim A As IImplemented = DirectCast(WithDirect, IImplemented) ' Noncompliant {{Review this cast; in this project there's no type that implements both 'IBase' and 'IImplemented'.}}\n        WithTry = TryCast(Empty, IBase)         ' Compliant, will return Nothing\n        Dim B As Boolean = TypeOf Empty Is IBase\n\n        Dim Arr As EmptyClass() = {}\n        Dim Arr2 As IBase() = DirectCast(Arr, IBase())\n\n        Dim EmptyBase As New EmptyBase()\n        Dim y As IBase = DirectCast(EmptyBase, IBase)\n\n        Dim i As IBase = New InheritsAndImplements()\n        Dim c As INotImplemented = DirectCast(i, INotImplemented) ' Compliant, because INotImplemented doesn't have concrete implementation\n        Dim d As INotImplemented = DirectCast(i, INotImplemented) ' Compliant\n        Dim e As INotImplemented = DirectCast(i, INotImplementedWithBase)\n\n        Dim O As Object = True\n        e = DirectCast(O, INotImplementedWithBase)\n\n        Dim Z As IDisposable = DirectCast(New EmptyClass(), IDisposable)\n    End Sub\n\n    Public Sub Generics()\n        Dim List As New List(Of Integer)\n        Dim IEnumerable = DirectCast(List, IEnumerable(Of Integer))\n        Dim IList = DirectCast(List, IList)\n        Dim ICollection = DirectCast(List, ICollection)\n\n        Dim FromString As New ImplementerOfIIGenericString()\n        Dim ToString As IGeneric(Of String) = DirectCast(FromString, IGeneric(Of String))\n        Dim ToInt As IGeneric(Of Integer) = DirectCast(FromString, IGeneric(Of Integer))    ' Noncompliant\n\n        Dim FromStringObject As New ImplementerOfIIGenericStringObject()\n        Dim ToStringObject As IGeneric(Of String, Object) = DirectCast(FromStringObject, IGeneric(Of String, Object))\n        Dim ToStringString As IGeneric(Of String, String) = DirectCast(FromStringObject, IGeneric(Of String, String))   ' Noncompliant\n        Dim ToIntString As IGeneric(Of Integer, String) = DirectCast(FromStringObject, IGeneric(Of Integer, String))    ' Noncompliant\n        Dim ToSingleTyped As IGeneric(Of Integer) = DirectCast(FromStringObject, IGeneric(Of Integer))                  ' Noncompliant\n    End Sub\n\n    Public Sub Dynamic(D)\n        D.Whatever = 42 ' Dynamic with Option Strict Off\n        Dim B As IBase = DirectCast(D, IBase)\n    End Sub\n\n    Public Sub Nullable()\n        Dim i? As Integer = Nothing\n        Dim o As Object = i\n        Dim ii = DirectCast(o, Integer) ' Compliant, this Is handled by S3655\n    End Sub\n\nEnd Class\n\nInterface IFoo\nEnd Interface\n\nInterface IBar\nEnd Interface\n\nPublic Class Foo\n    Implements IFoo\n\nEnd Class\n\nPublic Class Bar\n    Implements IBar\n\nEnd Class\n\nPublic Class FooBar\n    Implements IFoo, IBar\n\nEnd Class\n\nPublic NotInheritable Class FinalBar\n    Implements IBar\n\nEnd Class\n\nPublic Class Other\n\n    Public Sub Method(Of T As New)(Generic As T)\n        Dim IFoo As IFoo\n        Dim IBar As IBar\n        Dim Foo As Foo\n        Dim Bar As Bar\n        Dim FooBar As FooBar\n        Dim FinalBar As FinalBar\n        Dim o As Object\n\n        o = DirectCast(Bar, IFoo)       ' Noncompliant\n        o = DirectCast(IBar, IFoo)\n        o = DirectCast(Bar, Foo)        ' Compliant causes compiler error ' Error   [BC30311] - invalid cast\n        o = DirectCast(IBar, Foo)\n        o = DirectCast(FinalBar, IFoo)  ' Error [BC42322] - Compliant, causes compiler warning\n        o = DirectCast(Generic, Bar)    ' Compliant causes compiler error ' Error   [BC30311] - invalid cast\n\n        o = TryCast(Bar, IFoo)\n        o = TryCast(IBar, IFoo)\n        o = TryCast(IBar, Foo)\n        o = TryCast(Generic, Bar)\n\n        o = TypeOf Bar Is IFoo\n        o = TypeOf IBar Is IFoo\n        o = TypeOf Bar Is Foo       ' Error [BC31430]\tExpression Of type 'Bar' can never be of type 'Foo'\n        o = TypeOf IBar Is Foo\n        o = TypeOf FinalBar Is IFoo\n        o = TypeOf Generic Is Bar\n    End Sub\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/InvocationResolvesToOverrideWithParams.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\ninterface IMyInterface\n{\n    static virtual void Test(int foo, params object[] p) => Console.WriteLine(\"Test1\");\n\n    static virtual void Test(double foo, object p1) => Console.WriteLine(\"Test2\");\n\n    static virtual void InterfaceStaticAbstractMethod<T>() where T : IMyInterface\n    {\n        T.Test(42, null); // Noncompliant {{Review this call, which partially matches an overload without 'params'. The partial match is 'void IMyInterface.Test(double foo, object p1)'.}}\n    }\n}\n\npublic class SomeClass\n{\n    void ClassMethod<T>() where T : IMyInterface\n    {\n        T.Test(42, null); // Noncompliant\n    }\n\n    private protected int PrivateProtectedOverload(object a, string b) => 42;\n    public int PrivateProtectedOverload(string a, params string[] bs) => 42;\n\n    public void Method()\n    {\n        PrivateProtectedOverload(\"s1\");                  // Compliant\n        PrivateProtectedOverload(\"s1\", \"s2\");            // Noncompliant\n        PrivateProtectedOverload(null, \"s2\");            // Noncompliant\n        PrivateProtectedOverload(null, new[] { \"s2\" });  // Compliant\n        PrivateProtectedOverload(\"42\", \"s1\", \"s2\");      // Compliant\n    }\n}\n\npublic class OtherClass\n{\n    public void CheckAccessibilityInMethod(SomeClass arg)\n    {\n        arg.PrivateProtectedOverload(\"s1\");                  // Compliant\n        arg.PrivateProtectedOverload(\"s1\", \"s2\");            // Compliant\n        arg.PrivateProtectedOverload(null, \"s2\");            // Compliant\n        arg.PrivateProtectedOverload(null, new[] { \"s2\" });  // Compliant\n        arg.PrivateProtectedOverload(\"42\", \"s1\", \"s2\");      // Compliant\n    }\n}\n\nclass ParamsCollections\n{\n    private void Format(string a, params List<object> b) => Console.WriteLine(\"Format with List<object>\");\n\n    private void Format(object a, object b, object c) => Console.WriteLine(\"Format with three objects\");\n\n    public void Method()\n    {\n        ParamsCollections paramsCollections = new ParamsCollections();\n\n        paramsCollections.Format(\"\", null, null); // Noncompliant {{Review this call, which partially matches an overload without 'params'. The partial match is 'void ParamsCollections.Format(object a, object b, object c)'.}}\n        paramsCollections.Format(\"\", new List<object> { null, null }); // Compliant\n        paramsCollections.Format(\"\", [new object(), null]); // Compliant\n    }\n}\n\npublic class StaticLocalFunctions\n{\n    public static void Test(int foo, params object[] p)\n    {\n        Console.WriteLine(\"test1\");\n    }\n\n    public static void Test(double foo, object p1)\n    {\n        Console.WriteLine(\"test2\");\n    }\n\n    public void Method()\n    {\n        static void Call()\n        {\n            Test(42, null); // Noncompliant {{Review this call, which partially matches an overload without 'params'. The partial match is 'void StaticLocalFunctions.Test(double foo, object p1)'.}}\n        }\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/8522\nclass Repro_8522\n{\n    T Get<T>(params string[] key) => default;\n    string Get(string key) => default;\n\n    T GetBothHaveGenerics<T>(params int[] ints) => default;\n    T GetBothHaveGenerics<T>(int anInt) => default;\n\n    T GenericsWhereOneHasObjectParam<T>(params int[] ints) => default;\n    T GenericsWhereOneHasObjectParam<T>(object anInt) => default;\n\n    void Test()\n    {\n        Get<string>(\"text\");                          // Compliant\n        GetBothHaveGenerics<string>(1);               // Compliant, when both methods are generic it seems to resolve correctly to the T GetBothHaveGenerics<T>(int anInt).\n        GenericsWhereOneHasObjectParam<string>(1);    // Noncompliant\n    }\n}\n\npublic static class Extensions\n{\n    public static void Method(Exception ex)\n    {\n        ex.InstanceExtension(\"s1\");             // Compliant\n        ex.InstanceExtension(\"s1\", \"s2\");       // Noncompliant\n        Exception.StaticExtension(\"s1\");        // Compliant\n        Exception.StaticExtension(\"s1\", \"s2\");  // Noncompliant\n    }\n\n    extension(Exception ex)\n    {\n        public int InstanceExtension(object a, string b) => 42;\n        public int InstanceExtension(string a, params string[] bs) => 42;\n\n        public static int StaticExtension(object a, string b) => 42;\n        public static int StaticExtension(string a, params string[] bs) => 42;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/InvocationResolvesToOverrideWithParams.TopLevelStatements.cs",
    "content": "﻿SomeClass x;\nx = new (\"1\");              // Compliant, can't see non-param overload\nx = new (\"1\", \"s1\");        // Compliant, can't see non-param overload\nx = new (null, \"s1\");       // Compliant, can't see non-param overload\nx = new (\"1\", \"s1\", \"s2\");  // Compliant, can't see non-param overload\nx = new (null, \"s1\", \"s2\"); // Compliant, can't see non-param overload\n\nx.PrivateOverload(\"42\");                           // Compliant\nx.PrivateOverload(\"42\", \"s1\");                     // Compliant\nx.PrivateOverload(null, \"s1\");                     // Compliant\nx.PrivateOverload(null, new[] { \"s2\" });           // Compliant\nx.PrivateOverload(\"42\", \"s1\", \"s2\");               // Compliant\n\nx.ProtectedOverload(\"s1\");                         // Compliant\nx.ProtectedOverload(\"s1\", \"s2\");                   // Compliant\nx.ProtectedOverload(null, \"s2\");                   // Compliant\nx.ProtectedOverload(null, new[] { \"s2\" });         // Compliant\nx.ProtectedOverload(\"42\", \"s1\", \"s2\");             // Compliant\n\nx.PrivateProtectedOverload(\"s1\");                  // Compliant\nx.PrivateProtectedOverload(\"s1\", \"s2\");            // Compliant\nx.PrivateProtectedOverload(null, \"s2\");            // Compliant\nx.PrivateProtectedOverload(null, new[] { \"s2\" });  // Compliant\nx.PrivateProtectedOverload(\"42\", \"s1\", \"s2\");      // Compliant\n\nx.ProtectedInternalOverload(\"s1\");                 // Compliant\nx.ProtectedInternalOverload(\"s1\", \"s2\");           // Noncompliant\nx.ProtectedInternalOverload(null, \"s2\");           // Noncompliant\nx.ProtectedInternalOverload(null, new[] { \"s2\" }); // Compliant\nx.ProtectedInternalOverload(\"42\", \"s1\", \"s2\");     // Compliant\n\nx.InternalOverload(\"s1\");                          // Compliant\nx.InternalOverload(\"s1\", \"s2\");                    // Noncompliant\nx.InternalOverload(null, \"s2\");                    // Noncompliant\nx.InternalOverload(null, new[] { \"s2\" });          // Compliant\nx.InternalOverload(\"42\", \"s1\", \"s2\");              // Compliant\n\npublic class SomeClass\n{\n    private SomeClass(object a, string b) { }\n    private SomeClass(string a, string b) { }\n    public SomeClass(string a, params string[] bs) { }\n\n    private int PrivateOverload(object a, string b) => 42;\n    public int PrivateOverload(string a, params string[] bs) => 42;\n\n    protected int ProtectedOverload(object a, string b) => 42;\n    public int ProtectedOverload(string a, params string[] bs) => 42;\n\n    private protected int PrivateProtectedOverload(object a, string b) => 42;\n    public int PrivateProtectedOverload(string a, params string[] bs) => 42;\n\n    protected internal int ProtectedInternalOverload(object a, string b) => 42;\n    public int ProtectedInternalOverload(string a, params string[] bs) => 42;\n\n    internal int InternalOverload(object a, string b) => 42;\n    public int InternalOverload(string a, params string[] bs) => 42;\n\n    protected virtual int OverriddenAsProtected(object a, string b) => 42;\n    public int OverriddenAsProtected(string a, params string[] bs) => 42;\n\n    protected int ShadowedAsPublic(object a, string b) => 42;\n    public int ShadowedAsPublic(string a, params string[] bs) => 42;\n\n    protected int ShadowedAsProtectedInternal(object a, string b) => 42;\n    public int ShadowedAsProtectedInternal(string a, params string[] bs) => 42;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/InvocationResolvesToOverrideWithParams.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\n\nclass InvocationResolvesToOverrideWithParams\n{\n    public static void Test(int foo, params object[] p)\n    {\n        Console.WriteLine(\"test1\");\n    }\n\n    public static void Test(double foo, object p1)\n    {\n        Console.WriteLine(\"test2\");\n    }\n\n    static void Main(string[] args)\n    {\n        Test(42, null); // Noncompliant {{Review this call, which partially matches an overload without 'params'. The partial match is 'void InvocationResolvesToOverrideWithParams.Test(double foo, object p1)'.}}\n//      ^^^^^^^^^^^^^^\n    }\n\n    public InvocationResolvesToOverrideWithParams(string a, params object[] b)\n    {\n\n    }\n    public InvocationResolvesToOverrideWithParams(object a, object b, object c)\n    {\n\n    }\n\n    private void Format(string a, params object[] b) { }\n\n    private void Format(object a, object b, object c, object d = null) { }\n\n    private void Format2(string a, params object[] b) { }\n\n    private void Format2(int a, object b, object c) { }\n\n    private void Format3(params int[] a) { }\n\n    private void Format3(IEnumerable<int> a) { }\n\n    private void Format4(params object[] a) { }\n\n    private void Format4(object o, IEnumerable<object> a) { }\n\n    private void m()\n    {\n        Format(\"\", null, null); // Noncompliant\n        Format(new object(), null, null);\n        Format(\"\", new object[0]);\n\n        Format2(\"\", null, null); // Compliant\n\n        new InvocationResolvesToOverrideWithParams(\"\", null, null); //Noncompliant\n        new InvocationResolvesToOverrideWithParams(new object(), null, null);\n\n        Format3(new int[0]); //Compliant, although it is also an IEnumerable<int>\n\n        Format4(new object(), new int[0]); // Noncompliant\n\n        Format3(null); // Noncompliant, maybe it could be compliant\n        string.Concat(\"aaaa\"); // Noncompliant, resolves to params, but there's a single object version too.\n\n        Console.WriteLine(\"format\", 0, 1, \"\", \"\"); // Compliant\n    }\n}\n\npublic class MyClass\n{\n    public void Format(string a, params object[] b) { }\n    public void Format() { } // The presence of this method causes the issue\n\n    public void Test()\n    {\n        Format(\"\", null, null);\n    }\n}\n\npublic class Test\n{\n    public void MyMethod(params string[] s) { }\n    public void MyMethod(Test s) { }\n\n    public Test()\n    {\n        MyMethod(\"\"); // Compliant\n    }\n}\n\npublic class Test2\n{\n    public static implicit operator Test2(string s) { return null; }\n\n    public void MyMethod(params string[] s) { }\n    public void MyMethod(Test2 s) { }\n\n    public Test2()\n    {\n        MyMethod(\"\"); // Noncompliant\n    }\n}\n\n// See https://github.com/SonarSource/sonar-dotnet/issues/2234\npublic class FuncAndActionCases\n{\n    static void Main(string[] args)\n    {\n        M1(() => Console.WriteLine(\"hi\"));\n    }\n\n    public static void M1(params Action[] a) { }\n    public static void M1<T>(Func<T> f) { }\n    public static void M1(Func<Task> f) { }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/5430\nnamespace Repro5430\n{\n    public class SomeClass\n    {\n        private int Field11 = new SomeClass().PrivateOverload(\"s1\");                  // Compliant\n        private int Field12 = new SomeClass().PrivateOverload(\"s1\", \"s2\");            // Noncompliant\n        private int Field13 = new SomeClass().PrivateOverload(null, \"s2\");            // Noncompliant\n        private int Field14 = new SomeClass().PrivateOverload(null, new[] { \"s2\" });  // Compliant\n        private int Field15 = new SomeClass().PrivateOverload(\"42\", \"s1\", \"s2\");      // Compliant\n\n        private int Field21 = new SomeClass().InternalOverload(\"s1\");                 // Compliant\n        private int Field22 = new SomeClass().InternalOverload(\"s1\", \"s2\");           // Noncompliant\n        private int Field23 = new SomeClass().InternalOverload(null, \"s2\");           // Noncompliant\n        private int Field24 = new SomeClass().InternalOverload(null, new[] { \"s2\" }); // Compliant\n        private int Field25 = new SomeClass().InternalOverload(\"42\", \"s1\", \"s2\");     // Compliant\n\n        public SomeClass() { }\n        private SomeClass(object a, string b) { }\n        private SomeClass(string a, string b) { }\n        public SomeClass(string a, params string[] bs) { }\n\n        private int PrivateOverload(object a, string b) => 42;\n        public int PrivateOverload(string a, params string[] bs) => 42;\n\n        protected int ProtectedOverload(object a, string b) => 42;\n        public int ProtectedOverload(string a, params string[] bs) => 42;\n\n        protected internal int ProtectedInternalOverload(object a, string b) => 42;\n        public int ProtectedInternalOverload(string a, params string[] bs) => 42;\n\n        internal int InternalOverload(object a, string b) => 42;\n        public int InternalOverload(string a, params string[] bs) => 42;\n\n        protected virtual int OverriddenAsProtected(object a, string b) => 42;\n        public int OverriddenAsProtected(string a, params string[] bs) => 42;\n\n        protected int ShadowedAsPublic(object a, string b) => 42;\n        public int ShadowedAsPublic(string a, params string[] bs) => 42;\n\n        protected int ShadowedAsProtectedInternal(object a, string b) => 42;\n        public int ShadowedAsProtectedInternal(string a, params string[] bs) => 42;\n\n        public void AllOverloadsVisibleFromSameClass()\n        {\n            SomeClass x;\n            x = new SomeClass(\"1\");                          // Compliant, can't resolve to non-param overload\n            x = new SomeClass(\"1\", \"s1\");                    // Compliant, resolves to non-param overload\n            x = new SomeClass(null, \"s1\");                   // Compliant, resolves to non-param overload\n            x = new SomeClass(\"1\", \"s1\", \"s2\");              // Compliant, can't resolve to non-param overload\n            x = new SomeClass(null, \"s1\", \"s2\");             // Compliant, can't resolve to non-param overload\n\n            PrivateOverload(\"42\");                           // Compliant\n            PrivateOverload(\"42\", \"s1\");                     // Noncompliant\n            PrivateOverload(null, \"s1\");                     // Noncompliant\n            PrivateOverload(null, new[] { \"s2\" });           // Compliant\n            PrivateOverload(\"42\", \"s1\", \"s2\");               // Compliant\n\n            ProtectedOverload(\"s1\");                         // Compliant\n            ProtectedOverload(\"s1\", \"s2\");                   // Noncompliant\n            ProtectedOverload(null, \"s2\");                   // Noncompliant\n            ProtectedOverload(null, new[] { \"s2\" });         // Compliant\n            ProtectedOverload(\"42\", \"s1\", \"s2\");             // Compliant\n\n            ProtectedInternalOverload(\"s1\");                 // Compliant\n            ProtectedInternalOverload(\"s1\", \"s2\");           // Noncompliant\n            ProtectedInternalOverload(null, \"s2\");           // Noncompliant\n            ProtectedInternalOverload(null, new[] { \"s2\" }); // Compliant\n            ProtectedInternalOverload(\"42\", \"s1\", \"s2\");     // Compliant\n\n            InternalOverload(\"s1\");                          // Compliant\n            InternalOverload(\"s1\", \"s2\");                    // Noncompliant\n            InternalOverload(null, \"s2\");                    // Noncompliant\n            InternalOverload(null, new[] { \"s2\" });          // Compliant\n            InternalOverload(\"42\", \"s1\", \"s2\");              // Compliant\n        }\n\n        public class NestedClass\n        {\n            public void AllOverloadsVisibleFromWithinNestedClass()\n            {\n                var x = new SomeClass();\n                x.PrivateOverload(\"42\");                 // Compliant\n                x.PrivateOverload(\"42\", \"s1\");           // Noncompliant\n                x.PrivateOverload(null, \"s1\");           // Noncompliant\n                x.PrivateOverload(null, new[] { \"s2\" }); // Compliant\n                x.PrivateOverload(\"42\", \"s1\", \"s2\");     // Compliant\n            }\n\n            public struct Nested2ndLevel\n            {\n                public void AllOverloadsVisibleFromWithinNested2ndLevel()\n                {\n                    var x = new SomeClass();\n                    x.PrivateOverload(\"42\");                 // Compliant\n                    x.PrivateOverload(\"42\", \"s1\");           // Noncompliant\n                    x.PrivateOverload(null, \"s1\");           // Noncompliant\n                    x.PrivateOverload(null, new[] { \"s2\" }); // Compliant\n                    x.PrivateOverload(\"42\", \"s1\", \"s2\");     // Compliant\n                }\n            }\n        }\n    }\n\n    public class OtherClass\n    {\n        private int Field11 = new SomeClass().PrivateOverload(\"s1\");                  // Compliant\n        private int Field12 = new SomeClass().PrivateOverload(\"s1\", \"s2\");            // Compliant\n        private int Field13 = new SomeClass().PrivateOverload(null, \"s2\");            // Compliant\n        private int Field14 = new SomeClass().PrivateOverload(null, new[] { \"s2\" });  // Compliant\n        private int Field15 = new SomeClass().PrivateOverload(\"42\", \"s1\", \"s2\");      // Compliant\n\n        private int Field21 = new SomeClass().InternalOverload(\"s1\");                 // Compliant\n        private int Field22 = new SomeClass().InternalOverload(\"s1\", \"s2\");           // Noncompliant\n        private int Field23 = new SomeClass().InternalOverload(null, \"s2\");           // Noncompliant\n        private int Field24 = new SomeClass().InternalOverload(null, new[] { \"s2\" }); // Compliant\n        private int Field25 = new SomeClass().InternalOverload(\"42\", \"s1\", \"s2\");     // Compliant\n\n        public int this[int i]\n        {\n            get\n            {\n                var x = new SomeClass();\n                x.InternalOverload(\"s1\");                      // Compliant\n                x.InternalOverload(\"s1\", \"s2\");                // Noncompliant\n                x.InternalOverload(null, \"s2\");                // Noncompliant\n                x.InternalOverload(null, new[] { \"s2\" });      // Compliant\n                x.InternalOverload(\"42\", \"s1\", \"s2\");          // Compliant\n                return 42;\n            }\n        }\n\n        public int CheckAccessibilityInProperty\n        {\n            get\n            {\n                var x = new SomeClass();\n                x.InternalOverload(\"s1\");                      // Compliant\n                x.InternalOverload(\"s1\", \"s2\");                // Noncompliant\n                x.InternalOverload(null, \"s2\");                // Noncompliant\n                x.InternalOverload(null, new[] { \"s2\" });      // Compliant\n                x.InternalOverload(\"42\", \"s1\", \"s2\");          // Compliant\n                return 42;\n            }\n        }\n\n        public void CheckAccessibilityInMethod()\n        {\n            SomeClass x;\n            x = new SomeClass(\"1\");                            // Compliant, can't see non-param overload because it's private\n            x = new SomeClass(\"1\", \"s1\");                      // Compliant\n            x = new SomeClass(null, \"s1\");                     // Compliant\n            x = new SomeClass(\"1\", \"s1\", \"s2\");                // Compliant\n            x = new SomeClass(null, \"s1\", \"s2\");               // Compliant\n\n            x.PrivateOverload(\"42\");                           // Compliant\n            x.PrivateOverload(\"42\", \"s1\");                     // Compliant\n            x.PrivateOverload(null, \"s1\");                     // Compliant\n            x.PrivateOverload(null, new[] { \"s2\" });           // Compliant\n            x.PrivateOverload(\"42\", \"s1\", \"s2\");               // Compliant\n\n            x.ProtectedOverload(\"s1\");                         // Compliant\n            x.ProtectedOverload(\"s1\", \"s2\");                   // Compliant\n            x.ProtectedOverload(null, \"s2\");                   // Compliant\n            x.ProtectedOverload(null, new[] { \"s2\" });         // Compliant\n            x.ProtectedOverload(\"42\", \"s1\", \"s2\");             // Compliant\n\n            x.ProtectedInternalOverload(\"s1\");                 // Compliant\n            x.ProtectedInternalOverload(\"s1\", \"s2\");           // Noncompliant\n            x.ProtectedInternalOverload(null, \"s2\");           // Noncompliant\n            x.ProtectedInternalOverload(null, new[] { \"s2\" }); // Compliant\n            x.ProtectedInternalOverload(\"42\", \"s1\", \"s2\");     // Compliant\n\n            x.InternalOverload(\"s1\");                          // Compliant\n            x.InternalOverload(\"s1\", \"s2\");                    // Noncompliant\n            x.InternalOverload(null, \"s2\");                    // Noncompliant\n            x.InternalOverload(null, new[] { \"s2\" });          // Compliant\n            x.InternalOverload(\"42\", \"s1\", \"s2\");              // Compliant\n        }\n    }\n\n    public class SubClass : SomeClass\n    {\n        public SubClass(): base() { }\n        public SubClass(string a, params string[] bs) : base(a, bs) { }\n\n        protected override int OverriddenAsProtected(object a, string b) => 42;\n\n        public new int ShadowedAsPublic(object a, string b) => 42;\n\n        protected internal new int ShadowedAsProtectedInternal(object a, string b) => 42;\n\n        public void OverridenAndShadowedAccessibility()\n        {\n            var x = new SubClass();\n            x.OverriddenAsProtected(\"42\");                       // Compliant\n            x.OverriddenAsProtected(\"42\", \"s1\");                 // Noncompliant, overrides doesn't change priority\n            x.OverriddenAsProtected(null, \"s1\");                 // Noncompliant, overrides doesn't change priority\n            x.OverriddenAsProtected(null, new[] { \"s2\" });       // Compliant\n            x.OverriddenAsProtected(\"42\", \"s1\", \"s2\");           // Compliant\n\n            x.ShadowedAsPublic(\"s1\");                            // Compliant\n            x.ShadowedAsPublic(\"s1\", \"s2\");                      // Compliant, shadowing method takes priority\n            x.ShadowedAsPublic(null, \"s1\");                      // Compliant, shadowing method takes priority\n            x.ShadowedAsPublic(null, new[] { \"s2\" });            // Compliant\n            x.ShadowedAsPublic(\"42\", \"s1\", \"s2\");                // Compliant\n\n            x.ShadowedAsProtectedInternal(\"s1\");                 // Compliant\n            x.ShadowedAsProtectedInternal(\"s1\", \"s2\");           // Compliant, shadowing method takes priority\n            x.ShadowedAsProtectedInternal(null, \"s1\");           // Compliant, shadowing method takes priority\n            x.ShadowedAsProtectedInternal(null, new[] { \"s2\" }); // Compliant\n            x.ShadowedAsProtectedInternal(\"42\", \"s1\", \"s2\");     // Compliant\n        }\n\n        public class NestedClass\n        {\n            public void AllOverloadsVisibleFromWithinNestedClass()\n            {\n                var x = new SomeClass();\n                x.PrivateOverload(\"42\");                 // Compliant\n                x.PrivateOverload(\"42\", \"s1\");           // Compliant\n                x.PrivateOverload(null, \"s1\");           // Compliant\n                x.PrivateOverload(null, new[] { \"s2\" }); // Compliant\n                x.PrivateOverload(\"42\", \"s1\", \"s2\");     // Compliant\n            }\n        }\n    }\n\n    public class SubClassOfClassFromAnotherAssembly : FromAnotherAssembly\n    {\n        public void AccessibilityAcrossAssemblies()\n        {\n            ProtectedOverload(\"42\");                         // Compliant\n            ProtectedOverload(\"42\", \"s1\");                   // Noncompliant, protected visible across assemblies\n            ProtectedOverload(null, \"s1\");                   // Noncompliant, protected visible across assemblies\n            ProtectedOverload(null, new[] { \"s2\" });         // Compliant\n            ProtectedOverload(\"42\", \"s1\", \"s2\");             // Compliant\n\n            PrivateProtectedOverload(\"42\");                  // Compliant\n            PrivateProtectedOverload(\"42\", \"s1\");            // Compliant, private protected not visible across assemblies\n            PrivateProtectedOverload(null, \"s1\");            // Compliant, private protected not visible across assemblies\n            PrivateProtectedOverload(null, new[] { \"s2\" });  // Compliant\n            PrivateProtectedOverload(\"42\", \"s1\", \"s2\");      // Compliant\n\n            ProtectedInternalOverload(\"42\");                 // Compliant\n            ProtectedInternalOverload(\"42\", \"s1\");           // Noncompliant, protected internal visible across assemblies\n            ProtectedInternalOverload(null, \"s1\");           // Noncompliant, protected internal visible across assemblies\n            ProtectedInternalOverload(null, new[] { \"s2\" }); // Compliant\n            ProtectedInternalOverload(\"42\", \"s1\", \"s2\");     // Compliant\n\n            InternalOverload(\"42\");                          // Compliant\n            InternalOverload(\"42\", \"s1\");                    // Compliant, internal not visible across assemblies\n            InternalOverload(null, \"s1\");                    // Compliant, internal not visible across assemblies\n            InternalOverload(null, new[] { \"s2\" });          // Compliant\n            InternalOverload(\"42\", \"s1\", \"s2\");              // Compliant\n        }\n    }\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/IssueSuppression.CSharp10.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Linq;\n\nnamespace Net6Poc.IssueSuppression\n{\n    internal class TestCases\n    {\n        public void Bar(IEnumerable<int> collection)\n        {\n            [SuppressMessage(\"\", \"\")] int Get() => 1; // Noncompliant\n\n            _ = collection.Select([SuppressMessage(\"\", \"\")] (x) => x + 1); // Noncompliant\n\n            Action a =[SuppressMessage(\"\", \"\")] () => { }; // Noncompliant\n\n            Action x = true\n                           ? ([SuppressMessage(\"\", \"\")] () => { }) // Noncompliant\n                           :[SuppressMessage(\"\", \"\")] () => { }; // Noncompliant\n\n            Call([SuppressMessage(\"\", \"\")] (x) => { }); // Noncompliant\n        }\n\n        private void Call(Action<int> action) => action(1);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/IssueSuppression.CSharp9.cs",
    "content": "﻿[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage(\"\", \"\")] // Noncompliant\n\n#pragma warning disable XXX // Noncompliant\n\nvar topLevel = true;\n\n#pragma warning restore XXX // Compliant\n\nvoid Method()\n{\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"\", \"\")] // Noncompliant\n    void LocalFunction()\n    {\n\n    }\n\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"\", \"\")] // Noncompliant\n    static void StaticLocalFunction()\n    {\n\n    }\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/IssueSuppression.cs",
    "content": "﻿using System;\n\n[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage(\"\", \"\")] // Noncompliant\n[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage(\"\")] // Compliant // Error [CS7036] - ctor doesn't exist\n\nnamespace Tests.TestCases\n{\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"\", \"\")] // Noncompliant\n//                                   ^^^^^^^^^^^^^^^\n    class IssueSuppression\n    {\n  #pragma warning disable XXX // Noncompliant\n//^^^^^^^^^^^^^^^^^^^^^^^\n\n\n#pragma warning restore XXX // Compliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/IssueSuppression2.cs",
    "content": "﻿using System;\n\n[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage(\"\", \"\")] // Noncompliant\n[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage(\"\")] // Compliant // Error [CS7036] - ctor doesn't exist\n\nnamespace AppendedNamespaceForConcurrencyTest.Tests.TestCases\n{\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"\", \"\")] // Noncompliant\n//                                   ^^^^^^^^^^^^^^^\n    class IssueSuppression\n    {\n  #pragma warning disable XXX // Noncompliant\n//^^^^^^^^^^^^^^^^^^^^^^^\n\n\n#pragma warning restore XXX // Compliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/JSInvokableMethodsShouldBePublic.Latest.cs",
    "content": "﻿using Microsoft;\nusing Microsoft.JSInterop;\nusing System;\n\nclass Visibilities\n{\n    [JSInvokable] private protected void PrivateProtectedMethod() { }                 // Noncompliant\n    //                                   ^^^^^^^^^^^^^^^^^^^^^^\n    [JSInvokable] private protected static void PrivateProtectedStaticMethod1() { }   // Noncompliant\n    //                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    [JSInvokable] private static protected void PrivateProtectedStaticMethod2() { }   // Noncompliant\n    //                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n}\n\nclass LocalFunctions\n{\n    void Test()\n    {\n        [JSInvokable] void LocalFunction()\n        { }               // Compliant: not a method\n        [JSInvokable] static void LocalStaticFunction()\n        { }  // Compliant: not a method\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/JSInvokableMethodsShouldBePublic.cs",
    "content": "﻿using Microsoft;\nusing Microsoft.JSInterop;\nusing System;\nusing System.Threading.Tasks;\n\n[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]\nclass SomeAttribute : Attribute { }\n\nclass ValidCases\n{\n    private void PrivateMethod1() { }                  // Compliant: not a JSInvokable\n    [SomeAttribute] private void PrivateMethod2() { }  // Compliant: not a JSInvokable\n}\n\nclass WithExplicitVisibilityModifiers\n{\n    [JSInvokable] private void PrivateMethod() { }                                   // Noncompliant {{Methods marked as 'JSInvokable' should be 'public'.}}\n    //                         ^^^^^^^^^^^^^\n    [JSInvokable] internal void InternalMethod() { }                                 // Noncompliant\n    //                          ^^^^^^^^^^^^^^\n    [JSInvokable] protected void ProtectedMethod() { }                               // Noncompliant\n    //                           ^^^^^^^^^^^^^^^\n    [JSInvokable] protected internal void ProtectedInternalMethod() { }              // Noncompliant\n    //                                    ^^^^^^^^^^^^^^^^^^^^^^^\n    [JSInvokable] public void PublicMethod() { }                                     // Compliant\n\n    [JSInvokable] private static void PrivateStaticMethod() { }                      // Noncompliant\n    //                                ^^^^^^^^^^^^^^^^^^^\n    [JSInvokable] internal static void InternalStaticMethod() { }                    // Noncompliant\n    //                                 ^^^^^^^^^^^^^^^^^^^^\n    [JSInvokable] protected static void ProtectedStaticMethod() { }                  // Noncompliant\n    //                                  ^^^^^^^^^^^^^^^^^^^^^\n    [JSInvokable] protected internal static void ProtectedInternalStaticMethod() { } // Noncompliant\n    //                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    [JSInvokable] public static void PublicStaticMethod() { }                        // Compliant\n}\n\npartial class WithImplicitVisibility\n{\n    [JSInvokable] void PrivateMethod() { } // Noncompliant: a method is implicitly private\n    [JSInvokable] partial void PartialMethod2(); // Noncompliant: a partial method is implicitly private\n}\n\nunsafe class WithOtherModifiers\n{\n    [JSInvokable] private async Task PrivateAsyncMethod() { }   // Noncompliant\n    [JSInvokable] private unsafe void PrivateUnsafeMethod() { } // Noncompliant\n}\n\nclass WithMethodNamedAfterKeyword\n{\n    [JSInvokable] private void @for() { }  // Noncompliant\n    //                         ^^^^\n}\n\nclass WithMethodSignatureOnMultipleLines\n{\n    [JSInvokable\n    ] private\n        void PrivateMethod1( // Noncompliant\n    //       ^^^^^^^^^^^^^^\n            int i1,\n            int i2)\n    { }\n\n    [\n        SomeAttribute,\n        JSInvokable\n    ]\n    private\n        void PrivateMethod2( // Noncompliant\n    //       ^^^^^^^^^^^^^^\n            int i1,\n            int i2)\n    { }\n}\n\nclass WithMultipleAttributes\n{\n    [JSInvokable, SomeAttribute] private void PrivateMethod1() { }   // Noncompliant\n    [SomeAttribute, JSInvokable] private void PrivateMethod2() { }   // Noncompliant\n    [JSInvokable, JSInvokable] private void PrivateMethod3() { }     // Noncompliant\n    [SomeAttribute, SomeAttribute] private void PrivateMethod4() { } // Compliant: not a JSInvokable\n\n    [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]\n    private class SomeAttribute : Attribute { }\n}\n\nclass WithMultipleAttributeLists\n{\n    [JSInvokable][SomeAttribute] private void PrivateMethod1() { }   // Noncompliant\n    [SomeAttribute][JSInvokable] private void PrivateMethod2() { }   // Noncompliant\n    [JSInvokable][JSInvokable] private void PrivateMethod3() { }     // Noncompliant\n    [SomeAttribute][SomeAttribute] private void PrivateMethod4() { } // Compliant: not a JSInvokable\n\n    [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]\n    private class SomeAttribute : Attribute { }\n}\n\nnamespace WithDifferentWaysOfReferencingTheAttribute\n{\n    using AliasForJSInterop = Microsoft.JSInterop;\n    using AliasForJSInvokable = Microsoft.JSInterop.JSInvokableAttribute;\n\n    class Test\n    {\n        [JSInvokable] private void WithoutAttributeSuffix() { }                     // Noncompliant\n        [JSInvokableAttribute] private void WithAttributeSuffix() { }               // Noncompliant\n        [Microsoft.JSInterop.JSInvokable] private void WithFullyQualifiedName() { } // Noncompliant\n        [AliasForJSInterop.JSInvokable] private void WithNamespaceAlias() { }       // Noncompliant\n        [AliasForJSInvokable] private void WithAttributeAlias() { }                 // Noncompliant\n    }\n}\n\nclass WithUserDefinedJSInvokable\n{\n    [@JSInvokable] private void PrivateMethod1() { }            // Compliant\n    [JSInvokableWithSuffix] private void PrivateMethod2() { }   // Compliant\n\n    [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]\n    private class JSInvokable : Attribute { }\n\n    [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]\n    private class JSInvokableWithSuffix : Attribute { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/JSInvokableMethodsShouldBePublic.razor",
    "content": "﻿@using Microsoft.JSInterop\n\n@code {\n    private void JSInvokableImplicitelyPrivateMethodInCodeBlock() { }               // Compliant: not a JSInvokable\n    [JSInvokable] private void JSInvokableExplicitelyPrivateMethodInCodeBlock() { } // Noncompliant {{Methods marked as 'JSInvokable' should be 'public'.}}\n    //                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n}\n\n@functions {\n    [JSInvokable] private void JSInvokablePrivateMethodInFunctionsBlock() { } // Noncompliant\n}\n\n@{\n    [JSInvokable] void JSInvokableLocalFunctionInDirective() { }              // Compliant: local function\n    [JSInvokable] static void JSInvokableStaticLocalFunctionInDirective() { } // Compliant: local function\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/JSInvokableMethodsShouldBePublic.razor.cs",
    "content": "﻿using Microsoft.JSInterop;\n\npublic partial class JSInvokableMethodsShouldBePublic\n{\n    [JSInvokable] private void JSInvokablePrivateMethodInPartialRazorComponent() { }    // Noncompliant\n    [JSInvokable] void JSInvokableImplicitelyPrivateMethodInPartialRazorComponent() { } // Noncompliant\n    [JSInvokable] public void JSInvokablePublicMethodInPartialRazorComponent() { }      // Compliant: public\n\n    void SomeMethod()\n    {\n        [JSInvokable] void JSInvokablePrivateMethodInLocalFunction() { }                // Compliant: local function\n    }\n}\n\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/JwtSigned.Extensions.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing JWT;\nusing JWT.Algorithms;\nusing JWT.Builder;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        const string secret = \"GQDstcKsx0NHjPOuXOYg5MbeJ1XT0uFiwDVvVBrk\";\n        const string invalidToken = \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJmb28iOiJmYWtlYmFyIiwiaWF0IjoxNTc1NjQ0NTc3fQ.pcX_7snpSGf01uBfaM8XPkbgdhs1gq9JcYRCQvZrJyk\";\n\n        private JwtParts invalidParts;\n\n        void ExtensionCalledOnInstance(JwtDecoder decoder)\n        {\n            var decoded = decoder.Decode(invalidToken); // Noncompliant\n            decoded = decoder.Decode(invalidParts); // Noncompliant\n\n            decoded = decoder.Decode(invalidToken, new byte[] { 42 }, false); // Noncompliant\n            decoded = decoder.Decode(invalidToken, new byte[] { 42 }, true); // Compliant\n\n            decoded = decoder.Decode(invalidToken, secret, false); // Noncompliant\n            decoded = decoder.Decode(invalidToken, secret, true); // Compliant\n\n            var decodedObject = decoder.DecodeToObject<object>(invalidToken, new byte[] { 42 }, false); // Noncompliant\n            decodedObject = decoder.DecodeToObject<object>(invalidToken, new byte[] { 42 }, true); // Compliant\n\n            decodedObject = decoder.DecodeToObject<object>(invalidToken, secret, false); // Noncompliant\n            decodedObject = decoder.DecodeToObject<object>(invalidToken, secret, true); // Compliant\n\n            decodedObject = decoder.DecodeToObject<object>(invalidToken); // Noncompliant\n            IDictionary<string, object> decodedMap = decoder.DecodeToObject(invalidToken); // Noncompliant\n        }\n\n        void ExtensionCalledThroughStaticClass(JwtDecoder decoder)\n        {\n            var decoded = JwtDecoderExtensions.Decode(decoder, invalidToken); // Noncompliant\n            decoded = JwtDecoderExtensions.Decode(decoder, invalidParts); // Noncompliant\n\n            decoded = JwtDecoderExtensions.Decode(decoder, invalidToken, new byte[] { 42 }, false); // Noncompliant\n            decoded = JwtDecoderExtensions.Decode(decoder, invalidToken, new byte[] { 42 }, true); // Compliant\n\n            decoded = JwtDecoderExtensions.Decode(decoder, invalidToken, secret, false); // Noncompliant\n            decoded = JwtDecoderExtensions.Decode(decoder, invalidToken, secret, true); // Compliant\n\n            var decodedObject = JwtDecoderExtensions.DecodeToObject<object>(decoder, invalidToken, new byte[] { 42 }, false); // Noncompliant\n            decodedObject = JwtDecoderExtensions.DecodeToObject<object>(decoder, invalidToken, new byte[] { 42 }, true); // Compliant\n\n            decodedObject = JwtDecoderExtensions.DecodeToObject<object>(decoder, invalidToken, secret, false); // Noncompliant\n            decodedObject = JwtDecoderExtensions.DecodeToObject<object>(decoder, invalidToken, secret, true); // Compliant\n\n            decodedObject = JwtDecoderExtensions.DecodeToObject<object>(decoder, invalidToken); // Noncompliant\n            IDictionary<string, object> decodedMap = JwtDecoderExtensions.DecodeToObject(decoder, invalidToken); // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/JwtSigned.Extensions.vb",
    "content": "﻿Imports System\nImports JWT\nImports JWT.Algorithms\nImports JWT.Builder\nImports System.Collections.Generic\n\nNamespace Tests.Diagnostics\n\n    Class Program\n\n        Protected Const Secret As String = \"GQDstcKsx0NHjPOuXOYg5MbeJ1XT0uFiwDVvVBrk\"\n        Protected Const InvalidToken As String = \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJmb28iOiJmYWtlYmFyIiwiaWF0IjoxNTc1NjQ0NTc3fQ.pcX_7snpSGf01uBfaM8XPkbgdhs1gq9JcYRCQvZrJyk\"\n\n        Private InvalidParts As JwtParts\n\n        Sub ExtensionCalledOnInstance(Decoder As JwtDecoder)\n\n            Dim byteArray As Byte() = { 16, 23 }\n\n            Dim Decoded As String = Decoder.Decode(invalidToken) ' Noncompliant\n            Decoded = Decoder.Decode(invalidParts) ' Noncompliant\n\n            Decoded = Decoder.Decode(invalidToken, byteArray, false) ' Noncompliant\n            Decoded = Decoder.Decode(invalidToken, byteArray, true) ' Compliant\n\n            Decoded = Decoder.Decode(invalidToken, secret, false) ' Noncompliant\n            Decoded = Decoder.Decode(invalidToken, secret, true) ' Compliant\n\n            Dim DecodedObject As Object = Decoder.DecodeToObject(Of Object)(invalidToken, byteArray, false) ' Noncompliant\n            DecodedObject = Decoder.DecodeToObject(Of Object)(invalidToken, byteArray, true) ' Compliant\n\n            DecodedObject = Decoder.DecodeToObject(Of Object)(invalidToken, secret, false) ' Noncompliant\n            DecodedObject = Decoder.DecodeToObject(Of Object)(invalidToken, secret, true) ' Compliant\n\n            DecodedObject = Decoder.DecodeToObject(Of Object)(invalidToken) ' Noncompliant\n            Dim DecodedMap As IDictionary(Of String, Object) = decoder.DecodeToObject(invalidToken) ' Noncompliant\n\n        End Sub\n\n        Sub ExtensionCalledThroughStaticClass(Decoder As JwtDecoder)\n\n            Dim byteArray As Byte() = { 16, 23 }\n\n            Dim Decoded As String = JwtDecoderExtensions.Decode(Decoder, invalidToken) ' Noncompliant\n            Decoded = JwtDecoderExtensions.Decode(Decoder, invalidParts) ' Noncompliant\n\n            Decoded = JwtDecoderExtensions.Decode(Decoder, invalidToken, byteArray, false) ' Noncompliant\n            Decoded = JwtDecoderExtensions.Decode(Decoder, invalidToken, byteArray, true) ' Compliant\n\n            Decoded = JwtDecoderExtensions.Decode(Decoder, invalidToken, secret, false) ' Noncompliant\n            Decoded = JwtDecoderExtensions.Decode(Decoder, invalidToken, secret, true) ' Compliant\n\n            Dim DecodedObject As Object = JwtDecoderExtensions.DecodeToObject(Of Object)(Decoder, invalidToken, byteArray, false) ' Noncompliant\n            DecodedObject = JwtDecoderExtensions.DecodeToObject(Of Object)(Decoder, invalidToken, byteArray, true) ' Compliant\n\n            DecodedObject = JwtDecoderExtensions.DecodeToObject(Of Object)(Decoder, invalidToken, secret, false) ' Noncompliant\n            DecodedObject = JwtDecoderExtensions.DecodeToObject(Of Object)(Decoder, invalidToken, secret, true) ' Compliant\n\n            DecodedObject = JwtDecoderExtensions.DecodeToObject(Of Object)(Decoder, invalidToken) ' Noncompliant\n            Dim DecodedMap As IDictionary(Of String, Object) = JwtDecoderExtensions.DecodeToObject(Decoder, invalidToken) ' Noncompliant\n\n        End Sub\n\n    End Class\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/JwtSigned.Latest.cs",
    "content": "﻿using JWT.Builder;\n\nconst string secret = \"GQDstcKsx0NHjPOuXOYg5MbeJ1XT0uFiwDVvVBrk\";\nconst string invalidToken = \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJmb28iOiJmYWtlYmFyIiwiaWF0IjoxNTc1NjQ0NTc3fQ.pcX_7snpSGf01uBfaM8XPkbgdhs1gq9JcYRCQvZrJyk\";\n\nJwtBuilder decoded1 = new();\ndecoded1.WithSecret(secret).Decode(invalidToken); // Noncompliant {{Use only strong cipher algorithms when verifying the signature of this JWT.}}\n\nJwtBuilder decoded2 = new();\ndecoded2.WithSecret(secret).MustVerifySignature().Decode(invalidToken); // Compliant\n\nvoid DecoderMethod()\n{\n    JwtBuilder decoded1 = new();\n    decoded1.WithSecret(secret).Decode(invalidToken); // Noncompliant {{Use only strong cipher algorithms when verifying the signature of this JWT.}}\n\n    JwtBuilder decoded2 = new();\n    decoded2.WithSecret(secret).MustVerifySignature().Decode(invalidToken); // Compliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/JwtSigned.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing JWT;\nusing JWT.Algorithms;\nusing JWT.Builder;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        const string secret = \"GQDstcKsx0NHjPOuXOYg5MbeJ1XT0uFiwDVvVBrk\";\n        const string invalidToken = \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJmb28iOiJmYWtlYmFyIiwiaWF0IjoxNTc1NjQ0NTc3fQ.pcX_7snpSGf01uBfaM8XPkbgdhs1gq9JcYRCQvZrJyk\";\n\n        private JwtParts invalidParts;\n        private bool trueField = true;\n        private bool falseField = false;\n\n        // Encoding with JWT.NET is safe\n\n        void DecodingWithDecoder(JwtDecoder decoder)\n        {\n            string decoded;\n            decoded = decoder.Decode(invalidToken, secret, true);\n            decoded = decoder.Decode(invalidToken, secret, false); // Noncompliant {{Use only strong cipher algorithms when verifying the signature of this JWT.}}\n            decoded = decoder?.Decode(invalidToken, secret, false); // Noncompliant\n\n            decoded = decoder.Decode(invalidToken, secret, trueField);\n            decoded = decoder.Decode(invalidToken, secret, falseField);         // Noncompliant\n\n            decoded = decoder.Decode(invalidToken, secret, verify: true);\n            decoded = decoder.Decode(invalidToken, secret, verify: false);      // Noncompliant\n\n            decoded = decoder.Decode(invalidToken, secret, verify: true);\n            decoded = decoder.Decode(invalidToken, secret, verify: false);      // Noncompliant\n\n            decoded = decoder.Decode(invalidToken, verify: true, key: secret);\n            decoded = decoder.Decode(invalidToken, verify: false, key: secret); // Noncompliant\n\n            decoded = decoder.Decode(invalidToken, verify: true, key: new byte[] { 42 });\n            decoded = decoder.Decode(invalidToken, verify: false, key: new byte[] { 42 }); // Noncompliant\n\n            decoded = decoder.Decode(invalidToken); // Noncompliant\n            decoded = decoder.Decode(invalidParts); // Noncompliant\n\n            var decoded21 = decoder.DecodeToObject(invalidToken, secret, true);\n            var decoded22 = decoder.DecodeToObject(invalidToken, secret, false); // Noncompliant\n\n            var decoded31 = decoder.DecodeToObject<UserInfo>(invalidToken, secret, true);\n            var decoded32 = decoder.DecodeToObject<UserInfo>(invalidToken, secret, false); // Noncompliant\n\n            // Reassigned\n            trueField = false;\n            falseField = true;\n            decoded = decoder.Decode(invalidToken, secret, trueField);          // Noncompliant\n            decoded = decoder.Decode(invalidToken, secret, falseField);\n        }\n\n        void DecodingWithCustomDecoder(CustomDecoder decoder)\n        {\n            var decoded1 = decoder.Decode(invalidToken, secret, true);\n            var decoded2 = decoder.Decode(invalidToken, secret, false); // Noncompliant {{Use only strong cipher algorithms when verifying the signature of this JWT.}}\n\n            var decoded3 = decoder.Decode(invalidToken, secret, verify: true);\n            var decoded4 = decoder.Decode(invalidToken, secret, verify: false); // Noncompliant\n\n            var decoded5 = decoder.Decode(invalidToken, secret, verify: true);\n            var decoded6 = decoder.Decode(invalidToken, secret, verify: false); // Noncompliant\n\n            var decoded7 = decoder.Decode(invalidToken, verify: true, key: secret);\n            var decoded8 = decoder.Decode(invalidToken, verify: false, key: secret); // Noncompliant\n\n            var decoded9 = decoder.Decode(invalidToken, verify: true, key: new byte[] { 42 });\n            var decoded10 = decoder.Decode(invalidToken, verify: false, key: new byte[] { 42 }); // Noncompliant\n\n            var decoded11 = decoder.Decode(invalidToken); // Noncompliant\n            var decoded12 = decoder.Decode(invalidParts); // Noncompliant\n\n            var decoded21 = decoder.DecodeToObject(invalidToken, secret, true);\n            var decoded22 = decoder.DecodeToObject(invalidToken, secret, false); // Noncompliant\n\n            var decoded31 = decoder.DecodeToObject<UserInfo>(invalidToken, secret, true);\n            var decoded32 = decoder.DecodeToObject<UserInfo>(invalidToken, secret, false); // Noncompliant\n        }\n\n        void DecodingWithBuilder()\n        {\n            var decoded1 = new JwtBuilder() // Noncompliant {{Use only strong cipher algorithms when verifying the signature of this JWT.}}\n              .WithSecret(secret)\n              .Decode(invalidToken);\n\n            var decoded2 = new JwtBuilder()\n              .WithSecret(secret)\n              .MustVerifySignature()\n              .Decode(invalidToken);\n\n            var builder1 = new JwtBuilder().WithSecret(secret);\n            builder1.Decode(invalidToken); // Noncompliant\n\n            try\n            {\n                if (true)\n                {\n                    builder1.Decode(invalidToken); // Noncompliant, tracking outside nested block\n                }\n            }\n            finally\n            {\n            }\n\n            var builder2 = builder1.MustVerifySignature();\n            builder2.Decode(invalidToken);\n\n            var builder3 = new JwtBuilder().WithSecret(secret).MustVerifySignature();\n            builder3.Decode(invalidToken);\n\n            var builder4 = (((new JwtBuilder()).WithSecret(secret)));\n            builder4.Decode(invalidToken); // Noncompliant\n\n            var builder5 = new JwtBuilder().WithSecret(secret).DoNotVerifySignature();\n            builder5.Decode(invalidToken); // Noncompliant\n\n            var decoded11 = new JwtBuilder()  // Noncompliant\n                .WithSecret(secret)\n                .WithVerifySignature(true)\n                .MustVerifySignature()\n                .DoNotVerifySignature()\n                .Decode(invalidToken);\n\n            var Decoded12 = new JwtBuilder()\n                .WithSecret(secret)\n                .WithVerifySignature(false)\n                .DoNotVerifySignature()\n                .MustVerifySignature()\n                .Decode(invalidToken);\n\n            var Decoded21 = new JwtBuilder()\n                .WithSecret(secret)\n                .DoNotVerifySignature()\n                .WithVerifySignature(false)\n                .WithVerifySignature(true)\n                .Decode(invalidToken);\n\n            var Decoded31 = new JwtBuilder()  // Noncompliant\n                .WithSecret(secret)\n                .MustVerifySignature()\n                .WithVerifySignature(true)\n                .WithVerifySignature(false)\n                .Decode(invalidToken);\n        }\n\n        void DecodingWithBuilder_FPs(bool condition)\n        {\n            var builder1 = new JwtBuilder();\n            Init();\n            builder1.Decode(invalidToken); // Noncompliant FP, initialization in local function is not tracked\n\n            void Init()\n            {\n                builder1 = builder1.WithSecret(secret).MustVerifySignature();\n            }\n        }\n\n        void DecodingWithBuilder_FNs(bool condition)\n        {\n            var builder1 = new JwtBuilder();\n            if (condition)\n            {\n                builder1 = builder1.WithSecret(secret);\n            }\n            builder1.Decode(invalidToken); // FN, this is not SE rule, only linear initialization is considered\n\n            CreateBuilder().Decode(invalidToken); // FN, cross procedural initialization is not tracked\n            CreateLocalBuilder().Decode(invalidToken); // FN, local function initialization is not tracked\n\n            JwtBuilder CreateLocalBuilder() => new JwtBuilder().DoNotVerifySignature();\n        }\n\n        JwtBuilder CreateBuilder()\n        {\n            return new JwtBuilder().DoNotVerifySignature();\n        }\n    }\n\n    class UserInfo\n    {\n        string Name { get; set; }\n    }\n\n    class CustomDecoder : IJwtDecoder\n    {\n        public string Decode(JwtParts jwt)\n        {\n            throw new NotImplementedException();\n        }\n\n        public string Decode(string token)\n        {\n            throw new NotImplementedException();\n        }\n\n        public string Decode(string token, string key, bool verify)\n        {\n            throw new NotImplementedException();\n        }\n\n        public string Decode(string token, string[] keys, bool verify)\n        {\n            throw new NotImplementedException();\n        }\n\n        public string Decode(string token, byte[] key, bool verify)\n        {\n            throw new NotImplementedException();\n        }\n\n        public string Decode(string token, byte[][] keys, bool verify)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IDictionary<string, object> DecodeToObject(string token)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IDictionary<string, object> DecodeToObject(string token, string key, bool verify)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IDictionary<string, object> DecodeToObject(string token, string[] keys, bool verify)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IDictionary<string, object> DecodeToObject(string token, byte[] key, bool verify)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IDictionary<string, object> DecodeToObject(string token, byte[][] keys, bool verify)\n        {\n            throw new NotImplementedException();\n        }\n\n        public T DecodeToObject<T>(string token)\n        {\n            throw new NotImplementedException();\n        }\n\n        public T DecodeToObject<T>(string token, string key, bool verify)\n        {\n            throw new NotImplementedException();\n        }\n\n        public T DecodeToObject<T>(string token, string[] keys, bool verify)\n        {\n            throw new NotImplementedException();\n        }\n\n        public T DecodeToObject<T>(string token, byte[] key, bool verify)\n        {\n            throw new NotImplementedException();\n        }\n\n        public T DecodeToObject<T>(string token, byte[][] keys, bool verify)\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/JwtSigned.vb",
    "content": "﻿Imports System\nImports JWT\nImports JWT.Algorithms\nImports JWT.Builder\nImports System.Collections.Generic\n\nNamespace Tests.Diagnostics\n\n    Class Program\n\n        Protected Const Secret As String = \"GQDstcKsx0NHjPOuXOYg5MbeJ1XT0uFiwDVvVBrk\"\n        Protected Const InvalidToken As String = \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJmb28iOiJmYWtlYmFyIiwiaWF0IjoxNTc1NjQ0NTc3fQ.pcX_7snpSGf01uBfaM8XPkbgdhs1gq9JcYRCQvZrJyk\"\n\n        Private InvalidParts As JwtParts\n        Private TrueField As String = True\n        Private FalseField As String = False\n\n        ' Encoding with JWT.NET Is safe\n\n        Sub DecodingWithDecoder(Decoder As JwtDecoder)\n            Dim Decoded As String\n            Decoded = Decoder.Decode(InvalidToken, Secret, True)\n            Decoded = Decoder.Decode(InvalidToken, Secret, False)   ' Noncompliant {{Use only strong cipher algorithms when verifying the signature of this JWT.}}\n\n            Decoded = Decoder.Decode(InvalidToken, Secret, TrueField)\n            Decoded = Decoder.Decode(InvalidToken, Secret, FalseField)      ' Noncompliant\n\n            Decoded = Decoder.Decode(InvalidToken, Secret, verify:=True)\n            Decoded = Decoder.Decode(InvalidToken, Secret, verify:=False)   ' Noncompliant\n\n            Decoded = Decoder.Decode(InvalidToken, Secret, verify:=True)\n            Decoded = Decoder.Decode(InvalidToken, Secret, verify:=False)   ' Noncompliant\n\n            Decoded = Decoder.Decode(InvalidToken, verify:=True, key:=Secret)\n            Decoded = Decoder.Decode(InvalidToken, verify:=False, key:=Secret)  ' Noncompliant\n\n            Decoded = Decoder.Decode(InvalidToken, verify:=True, key:={42})\n            Decoded = Decoder.Decode(InvalidToken, verify:=False, key:={42})    ' Noncompliant\n\n            Decoded = Decoder.Decode(InvalidToken) ' Noncompliant\n            Decoded = Decoder.Decode(InvalidParts) ' Noncompliant\n\n            Dim Decoded21 As Object = Decoder.DecodeToObject(InvalidToken, Secret, True)\n            Dim Decoded22 As Object = Decoder.DecodeToObject(InvalidToken, Secret, False) ' Noncompliant\n\n            Dim Decoded31 As UserInfo = Decoder.DecodeToObject(Of UserInfo)(InvalidToken, Secret, True)\n            Dim Decoded32 As UserInfo = Decoder.DecodeToObject(Of UserInfo)(InvalidToken, Secret, False) ' Noncompliant\n\n            ' Reassigned\n            TrueField = False\n            FalseField = True\n            Decoded = Decoder.Decode(InvalidToken, Secret, TrueField)      ' Noncompliant\n            Decoded = Decoder.Decode(InvalidToken, Secret, FalseField)\n        End Sub\n\n        Sub DecodingWithCustomDecoder(Decoder As CustomDecoder)\n            Dim Decoded1 As String = Decoder.Decode(InvalidToken, Secret, True)\n            Dim Decoded2 As String = Decoder.Decode(InvalidToken, Secret, False) ' Noncompliant {{Use only strong cipher algorithms when verifying the signature of this JWT.}}\n\n            Dim Decoded3 As String = Decoder.Decode(InvalidToken, Secret, verify:=True)\n            Dim Decoded4 As String = Decoder.Decode(InvalidToken, Secret, verify:=False) ' Noncompliant\n\n            Dim Decoded5 As String = Decoder.Decode(InvalidToken, Secret, verify:=True)\n            Dim Decoded6 As String = Decoder.Decode(InvalidToken, Secret, verify:=False) ' Noncompliant\n\n            Dim Decoded7 As String = Decoder.Decode(InvalidToken, verify:=True, key:=Secret)\n            Dim Decoded8 As String = Decoder.Decode(InvalidToken, verify:=False, key:=Secret) ' Noncompliant\n\n            Dim Decoded9 As String = Decoder.Decode(InvalidToken, verify:=True, key:={42})\n            Dim Decoded10 As String = Decoder.Decode(InvalidToken, verify:=False, key:={42}) ' Noncompliant\n\n            Dim Decoded11 As String = Decoder.Decode(InvalidToken) ' Noncompliant\n            Dim Decoded12 As String = Decoder.Decode(InvalidParts) ' Noncompliant\n\n            Dim Decoded21 As Object = Decoder.DecodeToObject(InvalidToken, Secret, True)\n            Dim Decoded22 As Object = Decoder.DecodeToObject(InvalidToken, Secret, False) ' Noncompliant\n\n            Dim Decoded31 As UserInfo = Decoder.DecodeToObject(Of UserInfo)(InvalidToken, Secret, True)\n            Dim Decoded32 As UserInfo = Decoder.DecodeToObject(Of UserInfo)(InvalidToken, Secret, False) ' Noncompliant\n        End Sub\n\n        Sub DecodingWithBuilder()\n            Dim Decoded1 As String = New JwtBuilder().  ' Noncompliant {{Use only strong cipher algorithms when verifying the signature of this JWT.}}\n                WithSecret(Secret).\n                Decode(InvalidToken)\n\n            Dim Decoded2 As String = New JwtBuilder().\n                WithSecret(Secret).\n                MustVerifySignature().\n                Decode(InvalidToken)\n\n            Dim builder1 As JwtBuilder = New JwtBuilder().WithSecret(Secret)\n            builder1.Decode(InvalidToken) ' Noncompliant\n\n            Try\n                If True Then\n                    builder1.Decode(InvalidToken) ' Noncompliant, tracking outside nested block\n                End If\n            Finally\n            End Try\n\n            Dim builder2 As JwtBuilder = builder1.MustVerifySignature()\n            builder2.Decode(InvalidToken)\n\n            Dim builder3 As JwtBuilder = New JwtBuilder().WithSecret(Secret).MustVerifySignature()\n            builder3.Decode(InvalidToken)\n\n            Dim builder4 As JwtBuilder = New JwtBuilder().WithSecret(Secret)\n            builder4.Decode(InvalidToken) ' Noncompliant\n\n            Dim builder5 As JwtBuilder = (((New JwtBuilder()).WithSecret(Secret)).DoNotVerifySignature())\n            builder5.Decode(InvalidToken) ' Noncompliant\n\n            Dim Decoded11 As String = New JwtBuilder().  ' Noncompliant\n                WithSecret(Secret).\n                WithVerifySignature(True).\n                MustVerifySignature().\n                DoNotVerifySignature().\n                Decode(InvalidToken)\n\n            Dim Decoded12 As String = New JwtBuilder().\n                WithSecret(Secret).\n                WithVerifySignature(False).\n                DoNotVerifySignature().\n                MustVerifySignature().\n                Decode(InvalidToken)\n\n            Dim Decoded21 As String = New JwtBuilder().\n                WithSecret(Secret).\n                DoNotVerifySignature().\n                WithVerifySignature(False).\n                WithVerifySignature(True).\n                Decode(InvalidToken)\n\n            Dim Decoded31 As String = New JwtBuilder().  ' Noncompliant\n                WithSecret(Secret).\n                MustVerifySignature().\n                WithVerifySignature(True).\n                WithVerifySignature(False).\n                Decode(InvalidToken)\n        End Sub\n\n        Sub DecodingWithBuilder_FNs(Condition As Boolean)\n            Dim builder1 As New JwtBuilder()\n            If Condition Then\n                builder1 = builder1.WithSecret(Secret)\n            End If\n            builder1.Decode(InvalidToken) ' FN, this is not SE rule, only linear initialization is considered\n\n            CreateBuilder().Decode(InvalidToken) ' FN, cross procedural initialization is not tracked\n        End Sub\n\n        Private Function CreateBuilder() As JwtBuilder\n            Return New JwtBuilder().DoNotVerifySignature()\n        End Function\n\n    End Class\n\n    Public Class UserInfo\n\n        Public Property Name As String\n\n    End Class\n\n    Public Class CustomDecoder\n        Implements IJwtDecoder\n\n        Public Function Decode(jwt As JwtParts) As String Implements IJwtDecoder.Decode\n        End Function\n\n        Public Function Decode(token As String) As String Implements IJwtDecoder.Decode\n        End Function\n\n        Public Function Decode(token As String, key As String, verify As Boolean) As String Implements IJwtDecoder.Decode\n        End Function\n\n        Public Function Decode(token As String, keys() As String, verify As Boolean) As String Implements IJwtDecoder.Decode\n        End Function\n\n        Public Function Decode(token As String, key() As Byte, verify As Boolean) As String Implements IJwtDecoder.Decode\n        End Function\n\n        Public Function Decode(token As String, keys As Byte()(), verify As Boolean) As String Implements IJwtDecoder.Decode\n        End Function\n\n        Public Function DecodeToObject(token As String) As IDictionary(Of String, Object) Implements IJwtDecoder.DecodeToObject\n        End Function\n\n        Public Function DecodeToObject(token As String, key As String, verify As Boolean) As IDictionary(Of String, Object) Implements IJwtDecoder.DecodeToObject\n        End Function\n\n        Public Function DecodeToObject(token As String, keys() As String, verify As Boolean) As IDictionary(Of String, Object) Implements IJwtDecoder.DecodeToObject\n        End Function\n\n        Public Function DecodeToObject(token As String, key() As Byte, verify As Boolean) As IDictionary(Of String, Object) Implements IJwtDecoder.DecodeToObject\n        End Function\n\n        Public Function DecodeToObject(token As String, keys As Byte()(), verify As Boolean) As IDictionary(Of String, Object) Implements IJwtDecoder.DecodeToObject\n        End Function\n\n        Public Function DecodeToObject(Of T)(token As String) As T Implements IJwtDecoder.DecodeToObject\n        End Function\n\n        Public Function DecodeToObject(Of T)(token As String, key As String, verify As Boolean) As T Implements IJwtDecoder.DecodeToObject\n        End Function\n\n        Public Function DecodeToObject(Of T)(token As String, keys() As String, verify As Boolean) As T Implements IJwtDecoder.DecodeToObject\n        End Function\n\n        Public Function DecodeToObject(Of T)(token As String, key() As Byte, verify As Boolean) As T Implements IJwtDecoder.DecodeToObject\n        End Function\n\n        Public Function DecodeToObject(Of T)(token As String, keys As Byte()(), verify As Boolean) As T Implements IJwtDecoder.DecodeToObject\n        End Function\n\n    End Class\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LaunchSettings/DoNotHardcodeCredentials/Corrupt/launchSettings.json",
    "content": "﻿{\n  \"profiles\": {\n    \"MyApp\": {\n      \"commandName\": \"Project\",\n      \"environmentVariables\": {\n        \"ASPNETCORE_ENVIRONMENT\": \"Development\",\n        \"CONNECTION_STRING\": \"Server=localhost; Database=Test; User=SA; Password=Secret123\",\n\n        <<< Corrupted, we don't raise here"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LaunchSettings/DoNotHardcodeCredentials/UnexpectedContent/launchSettings.json",
    "content": "﻿[\n  \"S101\",\n  \"S107\"\n]"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LaunchSettings/DoNotHardcodeCredentials/Valid/launchSettings.json",
    "content": "{\n  \"profiles\": {\n    \"MyApp\": {\n      \"commandName\": \"Project\",\n      \"environmentVariables\": {\n        \"ASPNETCORE_ENVIRONMENT\": \"Development\",\n        \"CONNECTION_STRING\": \"Server=localhost; Database=Test; User=SA; Password=Secret123\", /* Noncompliant {{\"password\" detected here, make sure this is not a hard-coded credential.}} */\n        /*                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */\n        /* Noncompliant@+2 */\n        \"CONNECTION_STRING_MULTILINE\":\n          \"Server=localhost; Database=Test; User=SA; Password=Secret123\",\n        \"CONNECTION_STRING_EMPTY\": \"Server=localhost; Database=Test; User=SA; Password=\", /* Compliant, should not raise on empty passwords */\n        \"CONNECTION_STRING_NOPWD\": \"Server=localhost; Database=Test; Integrated Security=True\" /* Compliant */\n\n      },\n      \"applicationUrl\": \"https://localhost:5001;http://localhost:5000\"\n    }\n  }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LaunchSettings/DoNotHardcodeSecrets/Corrupt/launchSettings.json",
    "content": "﻿{\n  \"profiles\": {\n    \"MyApp\": {\n      \"commandName\": \"Project\",\n      \"environmentVariables\": {\n        \"ASPNETCORE_ENVIRONMENT\": \"Development\",\n        \"CONNECTION_STRING\": \"Server=localhost; Database=Test; User=SA; Credential=1IfHMPanImzX8ZxC-Ud6+YhXiLwlXq$f_-3v~.=\",\n\n        <<< Corrupted, we don't raise here"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LaunchSettings/DoNotHardcodeSecrets/UnexpectedContent/launchSettings.json",
    "content": "﻿[\n  \"S101\",\n  \"S107\"\n]"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LaunchSettings/DoNotHardcodeSecrets/Valid/launchSettings.json",
    "content": "{\n  \"profiles\": {\n    \"MyApp\": {\n      \"commandName\": \"Project\",\n      \"environmentVariables\": {\n        \"ASPNETCORE_ENVIRONMENT\": \"Development\",\n        \"CONNECTION_STRING\": \"Server=localhost; Database=Test; User=SA; Credential=1IfHMPanImzX8ZxC-Ud6+YhXiLwlXq$f_-3v~.=\", /* Noncompliant {{\"Credential\" detected here, make sure this is not a hard-coded secret.}} */\n        /*                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */\n        /* Noncompliant@+2 */\n        \"CONNECTION_STRING_MULTILINE\":\n          \"Server=localhost; Database=Test; User=SA; Credential=1IfHMPanImzX8ZxC-Ud6+YhXiLwlXq$f_-3v~.=\",\n        \"CONNECTION_STRING_EMPTY\": \"Server=localhost; Database=Test; User=SA; Credential=\", /* Compliant, should not raise on empty passwords */\n        \"CONNECTION_STRING_NOPWD\": \"Server=localhost; Database=Test; Integrated Security=True\" /* Compliant */\n\n      },\n      \"applicationUrl\": \"https://localhost:5001;http://localhost:5000\"\n    }\n  }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LdapConnectionShouldBeSecure.Latest.cs",
    "content": "﻿using System;\nusing System.DirectoryServices;\n\nnew DirectoryEntry(\"path\", \"user\", \"pass\", AuthenticationTypes.Secure); // Compliant\nnew DirectoryEntry(\"path\", \"user\", \"pass\", AuthenticationTypes.None);   // Noncompliant\n\nvar authTypeSecure = AuthenticationTypes.Secure;\nnew DirectoryEntry(\"path\", \"user\", \"pass\", authTypeSecure); // Compliant\n\nvar authTypeNone = AuthenticationTypes.None;\nnew DirectoryEntry(\"path\", \"user\", \"pass\", authTypeNone);   // Noncompliant\n\nDirectoryEntry entry1 = new(\"path\", \"user\", \"pass\", AuthenticationTypes.Secure);    // Compliant\nDirectoryEntry entry2 = new(\"path\", \"user\", \"pass\", AuthenticationTypes.None);      // Noncompliant\nDirectoryEntry entry3 = new(\"path\", \"user\", \"pass\", authTypeSecure);    // Compliant\nDirectoryEntry entry4 = new(\"path\", \"user\", \"pass\", authTypeNone);      // Noncompliant\n// https://sonarsource.atlassian.net/browse/NET-412\nDirectoryEntry entry5 = new(\"path\", \"user\", \"pass\", AuthenticationTypes.None); // Noncompliant FP\n\n(entry1.AuthenticationType, var x1) = (AuthenticationTypes.None, 0); // Noncompliant\n(entry5.AuthenticationType, var x2) = (AuthenticationTypes.Secure, 0);\n(entry5.AuthenticationType, var x3) = ((AuthenticationTypes.None), 0); // Noncompliant\n\nrecord FieldsAndProperties\n{\n    private DirectoryEntry field1 = new DirectoryEntry(\"path\", \"user\", \"pass\", AuthenticationTypes.None); // Noncompliant {{Set the 'AuthenticationType' property of this DirectoryEntry to 'AuthenticationTypes.Secure'.}}\n    private DirectoryEntry field2 = new DirectoryEntry() { AuthenticationType = AuthenticationTypes.None }; // Noncompliant\n    private DirectoryEntry field3 = new DirectoryEntry() { AuthenticationType = AuthenticationTypes.Secure }; // Compliant\n    private DirectoryEntry field4;\n    private DirectoryEntry field5;\n    private DirectoryEntry field6;\n    private DirectoryEntry field7 = new DirectoryEntry();\n\n    private DirectoryEntry Property0 => new DirectoryEntry { AuthenticationType = AuthenticationTypes.None }; // Noncompliant\n    private DirectoryEntry Property1 { get; set; } = new DirectoryEntry { AuthenticationType = AuthenticationTypes.None }; // Noncompliant\n    private DirectoryEntry Property3 { get; set; } = new DirectoryEntry() { AuthenticationType = AuthenticationTypes.Secure }; // Compliant\n    private DirectoryEntry Property4 { get; set; }\n    private DirectoryEntry Property5 { get; set; }\n    private DirectoryEntry Property6 { get; set; }\n\n    private AuthenticationTypes AuthenticationType\n    {\n        set => field7.AuthenticationType = value;\n        get => field7.AuthenticationType;\n    }\n\n    public void Method()\n    {\n        new DirectoryEntry(\"path\", \"user\", \"pass\", AuthenticationTypes.Secure); // Compliant\n        new DirectoryEntry(\"path\", \"user\", \"pass\", AuthenticationTypes.None); // Noncompliant\n    }\n\n    void Cases()\n    {\n        field3.AuthenticationType = AuthenticationTypes.None; // Noncompliant\n\n        field4 = new DirectoryEntry(\"path\", \"user\", \"pass\", AuthenticationTypes.None); // Compliant, AuthenticationType is set on the next line\n        field4.AuthenticationType = AuthenticationTypes.Secure;\n\n        // this\n        this.field5 = new DirectoryEntry(\"path\", \"user\", \"pass\", AuthenticationTypes.None); // Compliant, AuthenticationType is set on the next line\n        this.field5.AuthenticationType = AuthenticationTypes.Secure;\n\n        field6 = new DirectoryEntry(\"path\", \"user\", \"pass\", AuthenticationTypes.None); // Noncompliant\n\n        Property3.AuthenticationType = AuthenticationTypes.None; // Noncompliant\n        Property4 = new DirectoryEntry(\"path\", \"user\", \"pass\", AuthenticationTypes.None); // Compliant, AuthenticationType is set on the next line\n        Property4.AuthenticationType = AuthenticationTypes.Secure;\n\n        // this\n        this.Property5 = new DirectoryEntry(\"path\", \"user\", \"pass\", AuthenticationTypes.None); // Compliant, AuthenticationType is set on the next line\n        this.Property5.AuthenticationType = AuthenticationTypes.Secure;\n\n        Property6 = new DirectoryEntry(); // Compliant\n    }\n\n    public DirectoryEntry FieldKeyword\n    {\n        get;\n        set => field.AuthenticationType = AuthenticationTypes.None;  // Noncompliant\n    }\n}\n\npublic record struct RecordStruct\n{\n    public void SetValueAfterObjectInitialization()\n    {\n        DirectoryEntry entry1 = new(\"path\", \"user\", \"pass\", AuthenticationTypes.None); // Compliant, property is set below\n        (entry1.AuthenticationType, var x1) = (AuthenticationTypes.Secure, 0);\n\n        DirectoryEntry entry2 = new(\"path\", \"user\", \"pass\", AuthenticationTypes.None); // Noncompliant\n        (entry2.AuthenticationType, var x2) = (AuthenticationTypes.None, 0); // Noncompliant\n\n        AuthenticationTypes AuthenticationType;\n        (AuthenticationType, var x3) = (AuthenticationTypes.None, 0);\n    }\n}\n\npublic partial class PartialProperty\n{\n    private partial DirectoryEntry Property1 { get; }\n    private partial DirectoryEntry Property2 { get; }\n    private partial DirectoryEntry this[int index] { get; }\n}\n\npublic partial class PartialProperty\n{\n    private partial DirectoryEntry Property1\n    {\n        get => new DirectoryEntry { AuthenticationType = AuthenticationTypes.None }; // Noncompliant\n    }\n    private partial DirectoryEntry Property2\n    {\n        get => new DirectoryEntry() { AuthenticationType = AuthenticationTypes.Secure }; // Compliant\n    }\n    private partial DirectoryEntry this[int index]\n    {\n        get => new DirectoryEntry { AuthenticationType = AuthenticationTypes.None }; // Noncompliant\n    }\n}\n\npublic interface IWithDefaultMethod\n{\n    void Method()\n    {\n        new DirectoryEntry(\"path\", \"user\", \"pass\", AuthenticationTypes.Secure); // Compliant\n        new DirectoryEntry(\"path\", \"user\", \"pass\", AuthenticationTypes.None); // Noncompliant\n\n        var authTypeSecure = AuthenticationTypes.Secure;\n        new DirectoryEntry(\"path\", \"user\", \"pass\", authTypeSecure); // Compliant\n\n        var authTypeNone = AuthenticationTypes.None;\n        new DirectoryEntry(\"path\", \"user\", \"pass\", authTypeNone); // Noncompliant\n    }\n}\n\npublic class AssignmentsAndDeclarators\n{\n    public void WithDefaultLiteralExpression()\n    {\n        AuthenticationTypes authType = default;\n        new DirectoryEntry(\"\", null, null, authType); // Noncompliant\n    }\n\n    public void WithDefaultExpression()\n    {\n        AuthenticationTypes authType = default(AuthenticationTypes);\n        new DirectoryEntry(\"\", null, null, authType); // Noncompliant\n    }\n\n    public void AssignmentWithDefaultLiteralExpression()\n    {\n        var authType = AuthenticationTypes.Secure;\n        authType = default;\n        new DirectoryEntry(\"\", null, null, authType); // Noncompliant\n    }\n\n    public void AssignmentWithDefaultExpression()\n    {\n        var authType = AuthenticationTypes.Secure;\n        authType = default(AuthenticationTypes);\n        new DirectoryEntry(\"\", null, null, authType); // Noncompliant\n    }\n}\n\npublic class Sample\n{\n    public void NullConditionalAssignment(DirectoryEntry entry)\n    {\n        entry?.AuthenticationType = AuthenticationTypes.None; // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LdapConnectionShouldBeSecure.cs",
    "content": "﻿using System;\nusing System.DirectoryServices;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        DirectoryEntry field1 = new DirectoryEntry(); // Compliant\n        DirectoryEntry field2;\n\n        DirectoryEntry Property1 { get; set; } = new DirectoryEntry(); // Compliant\n        DirectoryEntry Property2 { get; set; }\n\n        AuthenticationTypes field = AuthenticationTypes.None;\n\n        public Program()\n        {\n            new DirectoryEntry(\"path\", \"user\", \"pass\", AuthenticationTypes.Secure); // Compliant\n            new DirectoryEntry(\"path\", \"user\", \"pass\", AuthenticationTypes.None); // Noncompliant\n\n            var authTypeSecure = AuthenticationTypes.Secure;\n            new DirectoryEntry(\"path\", \"user\", \"pass\", authTypeSecure); // Compliant\n\n            var authTypeNone = AuthenticationTypes.None;\n            new DirectoryEntry(\"path\", \"user\", \"pass\", authTypeNone); // Noncompliant\n\n            new DirectoryEntry(\"path\", \"user\", \"pass\", field);  // Noncompliant\n            field = AuthenticationTypes.Secure;\n            new DirectoryEntry(\"path\", \"user\", \"pass\", field);\n            field = AuthenticationTypes.None;\n            new DirectoryEntry(\"path\", \"user\", \"pass\", field);  // Noncompliant\n        }\n\n        void CtorSetsAllowedValue()\n        {\n            new DirectoryEntry(); // Compliant\n            new DirectoryEntry(\"path\", \"user\", \"pass\", AuthenticationTypes.Secure); // Compliant\n        }\n\n        void CtorSetsNotAllowedValue()\n        {\n            new DirectoryEntry(\"path\", \"user\", \"pass\", AuthenticationTypes.None); // Noncompliant {{Set the 'AuthenticationType' property of this DirectoryEntry to 'AuthenticationTypes.Secure'.}}\n        }\n\n        void InitializerSetsAllowedValue(AuthenticationTypes arg)\n        {\n            new DirectoryEntry(\"path\", \"user\", \"pass\", AuthenticationTypes.None) { AuthenticationType = AuthenticationTypes.Secure }; // Compliant\n            new DirectoryEntry(\"path\", \"user\", \"pass\", AuthenticationTypes.None) { AuthenticationType = arg };  // Compliant\n        }\n\n        void InitializerSetsNotAllowedValue()\n        {\n            new DirectoryEntry() { AuthenticationType = AuthenticationTypes.None }; // Noncompliant\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            new DirectoryEntry() { }; // Compliant\n        }\n\n        void PropertySetsNotAllowedValue()\n        {\n            var c = new DirectoryEntry();\n            c.AuthenticationType = AuthenticationTypes.None; // Noncompliant\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n            field1.AuthenticationType = AuthenticationTypes.None; // Noncompliant\n            this.field1.AuthenticationType = AuthenticationTypes.None; // Noncompliant\n\n            Property1.AuthenticationType = AuthenticationTypes.None; // Noncompliant\n            this.Property1.AuthenticationType = AuthenticationTypes.None; // Noncompliant\n        }\n\n        void PropertySetsAllowedValue(bool foo)\n        {\n            var c1 = new DirectoryEntry(\"path\", \"user\", \"pass\", AuthenticationTypes.None); // Compliant, AuthenticationType is set below\n            c1.AuthenticationType = AuthenticationTypes.Secure;\n\n            field1 = new DirectoryEntry(\"path\", \"user\", \"pass\", AuthenticationTypes.None); // Compliant, AuthenticationType is set below\n            field1.AuthenticationType = AuthenticationTypes.Secure;\n\n            this.field2 = new DirectoryEntry(\"path\", \"user\", \"pass\", AuthenticationTypes.None); // Compliant, AuthenticationType is set below\n            this.field2.AuthenticationType = AuthenticationTypes.Secure;\n\n            Property1 = new DirectoryEntry(\"path\", \"user\", \"pass\", AuthenticationTypes.None); // Compliant, AuthenticationType is set below\n            Property1.AuthenticationType = AuthenticationTypes.Secure;\n\n            this.Property2 = new DirectoryEntry(\"path\", \"user\", \"pass\", AuthenticationTypes.None); // Compliant, AuthenticationType is set below\n            this.Property2.AuthenticationType = AuthenticationTypes.Secure;\n\n            var c2 = new DirectoryEntry(\"path\", \"user\", \"pass\", AuthenticationTypes.None); // Noncompliant, AuthenticationType is set conditionally\n            if (foo)\n            {\n                c2.AuthenticationType = AuthenticationTypes.Secure;\n            }\n\n            var c3 = new DirectoryEntry(\"path\", \"user\", \"pass\", AuthenticationTypes.None); // Compliant, AuthenticationType is set after the if\n            if (foo)\n            {\n                // do something\n            }\n            c3.AuthenticationType = AuthenticationTypes.Secure;\n\n            DirectoryEntry c4 = null;\n            if (foo)\n            {\n                c4 = new DirectoryEntry(\"path\", \"user\", \"pass\", AuthenticationTypes.None); // Noncompliant, HttpOnly is not set in the same scope\n            }\n            c4.AuthenticationType = AuthenticationTypes.Secure;\n        }\n    }\n\n    class FieldsAndProperties\n    {\n        private DirectoryEntry field1 = new DirectoryEntry(\"path\", \"user\", \"pass\", AuthenticationTypes.None); // Noncompliant {{Set the 'AuthenticationType' property of this DirectoryEntry to 'AuthenticationTypes.Secure'.}}\n//                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        private DirectoryEntry field2 = new DirectoryEntry() { AuthenticationType = AuthenticationTypes.None }; // Noncompliant\n        private DirectoryEntry field3 = new DirectoryEntry() { AuthenticationType = AuthenticationTypes.Secure }; // Compliant\n        private DirectoryEntry field4;\n        private DirectoryEntry field5;\n        private DirectoryEntry field6;\n        private DirectoryEntry field7 = new DirectoryEntry();\n\n        private DirectoryEntry Property0 => new DirectoryEntry { AuthenticationType = AuthenticationTypes.None }; // Noncompliant\n        private DirectoryEntry Property1 { get; set; } = new DirectoryEntry { AuthenticationType = AuthenticationTypes.None }; // Noncompliant\n        private DirectoryEntry Property3 { get; set; } = new DirectoryEntry() { AuthenticationType = AuthenticationTypes.Secure }; // Compliant\n        private DirectoryEntry Property4 { get; set; }\n        private DirectoryEntry Property5 { get; set; }\n        private DirectoryEntry Property6 { get; set; }\n\n        private AuthenticationTypes AuthenticationType\n        {\n            set => field7.AuthenticationType = value;\n            get => field7.AuthenticationType;\n        }\n\n        void Cases()\n        {\n            field3.AuthenticationType = AuthenticationTypes.None; // Noncompliant\n\n            field4 = new DirectoryEntry(\"path\", \"user\", \"pass\", AuthenticationTypes.None); // Compliant, AuthenticationType is set on the next line\n            field4.AuthenticationType = AuthenticationTypes.Secure;\n\n            // this\n            this.field5 = new DirectoryEntry(\"path\", \"user\", \"pass\", AuthenticationTypes.None); // Compliant, AuthenticationType is set on the next line\n            this.field5.AuthenticationType = AuthenticationTypes.Secure;\n\n            field6 = new DirectoryEntry(\"path\", \"user\", \"pass\", AuthenticationTypes.None); // Noncompliant\n\n            Property3.AuthenticationType = AuthenticationTypes.None; // Noncompliant\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n            Property4 = new DirectoryEntry(\"path\", \"user\", \"pass\", AuthenticationTypes.None); // Compliant, AuthenticationType is set on the next line\n            Property4.AuthenticationType = AuthenticationTypes.Secure;\n\n            // this\n            this.Property5 = new DirectoryEntry(\"path\", \"user\", \"pass\", AuthenticationTypes.None); // Compliant, AuthenticationType is set on the next line\n            this.Property5.AuthenticationType = AuthenticationTypes.Secure;\n\n            Property6 = new DirectoryEntry(); // Compliant\n        }\n    }\n\n    public struct Struct\n    {\n        public void Method()\n        {\n            new DirectoryEntry(\"path\", \"user\", \"pass\", AuthenticationTypes.Secure); // Compliant\n            new DirectoryEntry(\"path\", \"user\", \"pass\", AuthenticationTypes.None); // Noncompliant\n\n            var authTypeSecure = AuthenticationTypes.Secure;\n            new DirectoryEntry(\"path\", \"user\", \"pass\", authTypeSecure); // Compliant\n\n            var authTypeNone = AuthenticationTypes.None;\n            new DirectoryEntry(\"path\", \"user\", \"pass\", authTypeNone); // Noncompliant\n        }\n    }\n\n    public class AllTypes\n    {\n        public void AllTypeInitialization()\n        {\n            new DirectoryEntry(\"\", null, null, AuthenticationTypes.None); // Noncompliant\n            new DirectoryEntry(\"\", null, null, AuthenticationTypes.Secure);\n            new DirectoryEntry(\"\", null, null, AuthenticationTypes.Encryption);\n            new DirectoryEntry(\"\", null, null, AuthenticationTypes.SecureSocketsLayer);\n            new DirectoryEntry(\"\", null, null, AuthenticationTypes.ReadonlyServer);\n            new DirectoryEntry(\"\", null, null, AuthenticationTypes.Anonymous); // Noncompliant\n            new DirectoryEntry(\"\", null, null, AuthenticationTypes.FastBind);\n            new DirectoryEntry(\"\", null, null, AuthenticationTypes.Signing);\n            new DirectoryEntry(\"\", null, null, AuthenticationTypes.Sealing);\n            new DirectoryEntry(\"\", null, null, AuthenticationTypes.Delegation);\n            new DirectoryEntry(\"\", null, null, AuthenticationTypes.ServerBind);\n        }\n    }\n\n    public class AssignmentsAndDeclarators\n    {\n        public void WithTernaryOperatorSecure(bool condition)\n        {\n            var authType = condition ? AuthenticationTypes.SecureSocketsLayer : AuthenticationTypes.Secure;\n            var entry = new DirectoryEntry(\"\", null, null, authType);\n        }\n\n        public void WithTernaryOperatorUnsecure(bool condition)\n        {\n            var authType = condition ? AuthenticationTypes.None : AuthenticationTypes.Anonymous;\n            // Symbolic execution would be a better fit to increase precision\n            var entry = new DirectoryEntry(\"\", null, null, authType); // Compliant - FN\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LineContinuation.vb",
    "content": "﻿Imports System\n\nModule Module1\n    Sub LineContinuation()\n        ' Noncompliant@+1 {{Reformat the code to remove this use of the line continuation character.}}\n        Console.WriteLine(\"Hello\" _\n                          & \"world\")\n    End Sub\nEnd Module\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LineLength.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public class LineLength\n    {\n        public LineLength()\n        {\n            Console.WriteLine(\"This is OK...\"); // with these comments.........................................................\n            Console.WriteLine(); // Noncompliant {{Split this 128 characters long line (which is greater than 127 authorized).}}\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LineLength.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\n\nNamespace Tests.Diagnostics\n\n    Public Class LineLength\n        Public Sub LineLength()\n\n            Console.WriteLine(\"This is OK...\") ' With these comments............................................................\n            ' Noncompliant@-1 {{Split this 128 characters long line (which is greater than 127 authorized).}}\n            Console.WriteLine()\n\n            ' Next line is compliant because it contains the error pattern so we prevent the issue to be reported\n            Console.WriteLine(\" error: foo bar oeirpo worweoi rewopir epwooriewporiewpor iweporiw oriewporiewprowe ipoewirpewoirewporiwepo\")\n        End Sub\n    End Class\nEnd Namespace\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LinkedListPropertiesInsteadOfMethods.Fixed.cs",
    "content": "﻿using System.Collections;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nclass MyClass\n{\n    void Basic(LinkedList<int> data)\n    {\n        _ = data.First.Value; // Fixed\n        _ = data.Last.Value; // Fixed\n        data.First(x => x > 0);            // Compliant\n        data.Last(x => x > 0);             // Compliant\n        _ = data.First.Value;              // Compliant\n        _ = data.Last.Value;               // Compliant\n        data.Count();                      // Compliant\n        data.Append(1).First().ToString(); // Compliant\n        data.Append(1).Last().ToString();  // Compliant\n        data?.First.Value.ToString();          // Fixed\n        data?.Last.Value.ToString();           // Fixed\n\n    }\n\n    void CustomClass(LinkedList<int> data)\n    {\n        var classContainingLinkedList = new ClassContainingLinkedList();\n        _ = classContainingLinkedList.myLinkedListField.First.Value;  // Fixed\n        _ = classContainingLinkedList.notALinkedList.First(); // Compliant\n\n        var enumData = new EnumData<int>();\n        enumData.First(); // Compliant\n\n        var goodLinkedList = new GoodLinkedList<int>();\n        _ = goodLinkedList.First.Value; // Fixed\n\n        var ternary = (true ? data : goodLinkedList).First.Value; // Fixed\n        var nullCoalesce = (data ?? goodLinkedList).First.Value;  // Fixed\n        var ternaryNullCoalesce = (data ?? (true ? data : goodLinkedList)).First.Value; // Fixed\n    }\n\n    void ConditionalsCombinations(GoodLinkedList<int> goodLinkedList)\n    {\n        _ = goodLinkedList.GetLinkedList().GetLinkedList().GetLinkedList().GetLinkedList().First.Value;     // Fixed\n        _ = goodLinkedList.GetLinkedList().GetLinkedList().GetLinkedList().GetLinkedList()?.First.Value;    // Fixed\n        _ = goodLinkedList.GetLinkedList().GetLinkedList().GetLinkedList()?.GetLinkedList().First.Value;    // Fixed\n        _ = goodLinkedList.GetLinkedList().GetLinkedList().GetLinkedList()?.GetLinkedList()?.First.Value;   // Fixed\n        _ = goodLinkedList.GetLinkedList().GetLinkedList()?.GetLinkedList().GetLinkedList().First.Value;    // Fixed\n        _ = goodLinkedList.GetLinkedList().GetLinkedList()?.GetLinkedList().GetLinkedList()?.First.Value;   // Fixed\n        _ = goodLinkedList.GetLinkedList().GetLinkedList()?.GetLinkedList()?.GetLinkedList().First.Value;   // Fixed\n        _ = goodLinkedList.GetLinkedList().GetLinkedList()?.GetLinkedList()?.GetLinkedList()?.First.Value;  // Fixed\n        _ = goodLinkedList.GetLinkedList()?.GetLinkedList().GetLinkedList().GetLinkedList().First.Value;    // Fixed\n        _ = goodLinkedList.GetLinkedList()?.GetLinkedList().GetLinkedList().GetLinkedList()?.First.Value;   // Fixed\n        _ = goodLinkedList.GetLinkedList()?.GetLinkedList().GetLinkedList()?.GetLinkedList().First.Value;   // Fixed\n        _ = goodLinkedList.GetLinkedList()?.GetLinkedList().GetLinkedList()?.GetLinkedList()?.First.Value;  // Fixed\n        _ = goodLinkedList.GetLinkedList()?.GetLinkedList()?.GetLinkedList().GetLinkedList().First.Value;   // Fixed\n        _ = goodLinkedList.GetLinkedList()?.GetLinkedList()?.GetLinkedList().GetLinkedList()?.First.Value;  // Fixed\n        _ = goodLinkedList.GetLinkedList()?.GetLinkedList()?.GetLinkedList()?.GetLinkedList().First.Value;  // Fixed\n        _ = goodLinkedList.GetLinkedList()?.GetLinkedList()?.GetLinkedList()?.GetLinkedList()?.First.Value; // Fixed\n        _ = goodLinkedList.GetLinkedList()?.GetLinkedList()?.GetLinkedList()?.GetLinkedList()?.First(x => x > 0); // Compliant\n    }\n\n    int GetFirst(LinkedList<int> data) => data.First.Value; // Fixed\n\n    class GoodLinkedList<T> : LinkedList<T>\n    {\n        public GoodLinkedList<T> GetLinkedList() => this;\n        T CallFirst() => this.First.Value; // Fixed\n    }\n\n    class EnumData<T> : IEnumerable<T>\n    {\n        public IEnumerator<T> GetEnumerator() => null;\n        IEnumerator IEnumerable.GetEnumerator() => null;\n    }\n\n    class ClassContainingLinkedList\n    {\n        public LinkedList<int> myLinkedListField = new LinkedList<int>();\n\n        public LinkedList<int> myLinkedListProperty\n        {\n            get => myLinkedListField;\n            set => myLinkedListField.AddLast(value.First.Value); // Fixed\n        }\n\n        public NotALinkedList notALinkedList = new NotALinkedList();\n    }\n}\n\npublic class NotALinkedList\n{\n    public int First() => 0;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LinkedListPropertiesInsteadOfMethods.cs",
    "content": "﻿using System.Collections;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nclass MyClass\n{\n    void Basic(LinkedList<int> data)\n    {\n        _ = data.First(); // Noncompliant {{'First' property of 'LinkedList' should be used instead of the 'First()' extension method.}}\n//               ^^^^^\n        _ = data.Last(); // Noncompliant {{'Last' property of 'LinkedList' should be used instead of the 'Last()' extension method.}}\n//               ^^^^\n        data.First(x => x > 0);            // Compliant\n        data.Last(x => x > 0);             // Compliant\n        _ = data.First.Value;              // Compliant\n        _ = data.Last.Value;               // Compliant\n        data.Count();                      // Compliant\n        data.Append(1).First().ToString(); // Compliant\n        data.Append(1).Last().ToString();  // Compliant\n        data?.First().ToString();          // Noncompliant\n        data?.Last().ToString();           // Noncompliant\n\n    }\n\n    void CustomClass(LinkedList<int> data)\n    {\n        var classContainingLinkedList = new ClassContainingLinkedList();\n        _ = classContainingLinkedList.myLinkedListField.First();  // Noncompliant\n        _ = classContainingLinkedList.notALinkedList.First(); // Compliant\n\n        var enumData = new EnumData<int>();\n        enumData.First(); // Compliant\n\n        var goodLinkedList = new GoodLinkedList<int>();\n        _ = goodLinkedList.First(); // Noncompliant\n\n        var ternary = (true ? data : goodLinkedList).First(); // Noncompliant\n        var nullCoalesce = (data ?? goodLinkedList).First();  // Noncompliant\n        var ternaryNullCoalesce = (data ?? (true ? data : goodLinkedList)).First(); // Noncompliant\n    }\n\n    void ConditionalsCombinations(GoodLinkedList<int> goodLinkedList)\n    {\n        _ = goodLinkedList.GetLinkedList().GetLinkedList().GetLinkedList().GetLinkedList().First();     // Noncompliant\n        _ = goodLinkedList.GetLinkedList().GetLinkedList().GetLinkedList().GetLinkedList()?.First();    // Noncompliant\n        _ = goodLinkedList.GetLinkedList().GetLinkedList().GetLinkedList()?.GetLinkedList().First();    // Noncompliant\n        _ = goodLinkedList.GetLinkedList().GetLinkedList().GetLinkedList()?.GetLinkedList()?.First();   // Noncompliant\n        _ = goodLinkedList.GetLinkedList().GetLinkedList()?.GetLinkedList().GetLinkedList().First();    // Noncompliant\n        _ = goodLinkedList.GetLinkedList().GetLinkedList()?.GetLinkedList().GetLinkedList()?.First();   // Noncompliant\n        _ = goodLinkedList.GetLinkedList().GetLinkedList()?.GetLinkedList()?.GetLinkedList().First();   // Noncompliant\n        _ = goodLinkedList.GetLinkedList().GetLinkedList()?.GetLinkedList()?.GetLinkedList()?.First();  // Noncompliant\n        _ = goodLinkedList.GetLinkedList()?.GetLinkedList().GetLinkedList().GetLinkedList().First();    // Noncompliant\n        _ = goodLinkedList.GetLinkedList()?.GetLinkedList().GetLinkedList().GetLinkedList()?.First();   // Noncompliant\n        _ = goodLinkedList.GetLinkedList()?.GetLinkedList().GetLinkedList()?.GetLinkedList().First();   // Noncompliant\n        _ = goodLinkedList.GetLinkedList()?.GetLinkedList().GetLinkedList()?.GetLinkedList()?.First();  // Noncompliant\n        _ = goodLinkedList.GetLinkedList()?.GetLinkedList()?.GetLinkedList().GetLinkedList().First();   // Noncompliant\n        _ = goodLinkedList.GetLinkedList()?.GetLinkedList()?.GetLinkedList().GetLinkedList()?.First();  // Noncompliant\n        _ = goodLinkedList.GetLinkedList()?.GetLinkedList()?.GetLinkedList()?.GetLinkedList().First();  // Noncompliant\n        _ = goodLinkedList.GetLinkedList()?.GetLinkedList()?.GetLinkedList()?.GetLinkedList()?.First(); // Noncompliant\n//                                                                                             ^^^^^\n        _ = goodLinkedList.GetLinkedList()?.GetLinkedList()?.GetLinkedList()?.GetLinkedList()?.First(x => x > 0); // Compliant\n    }\n\n    int GetFirst(LinkedList<int> data) => data.First(); // Noncompliant\n\n    class GoodLinkedList<T> : LinkedList<T>\n    {\n        public GoodLinkedList<T> GetLinkedList() => this;\n        T CallFirst() => this.First(); // Noncompliant\n    }\n\n    class EnumData<T> : IEnumerable<T>\n    {\n        public IEnumerator<T> GetEnumerator() => null;\n        IEnumerator IEnumerable.GetEnumerator() => null;\n    }\n\n    class ClassContainingLinkedList\n    {\n        public LinkedList<int> myLinkedListField = new LinkedList<int>();\n\n        public LinkedList<int> myLinkedListProperty\n        {\n            get => myLinkedListField;\n            set => myLinkedListField.AddLast(value.First()); // Noncompliant\n        }\n\n        public NotALinkedList notALinkedList = new NotALinkedList();\n    }\n}\n\npublic class NotALinkedList\n{\n    public int First() => 0;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LinkedListPropertiesInsteadOfMethods.vb",
    "content": "﻿Imports System.Collections\nImports System\nImports System.Collections.Generic\nImports System.Linq\n\nClass [MyClass]\n    Private Sub Various()\n        Dim data = New LinkedList(Of Integer)()\n        Enumerable.First(data) ' Noncompliant {{'First' property of 'LinkedList' should be used instead of the 'First()' extension method.}}\n        '          ^^^^^\n        Enumerable.Last(data)  ' Noncompliant {{'Last' property of 'LinkedList' should be used instead of the 'Last()' extension method.}}\n        '          ^^^^\n\n        Dim a = Enumerable.Any(data)    ' Compliant\n        Dim b1 = data.First()           ' Compliant\n        Dim b2 = data.Last()            ' Compliant\n        Dim c1 = data.First.Value       ' Compliant\n        Dim c2 = data.Last.Value        ' Compliant\n        Dim d = data.Count()            ' Compliant\n        Dim e1 = Enumerable.First(data, Function(x) x > 0) ' Compliant\n        Dim e2 = Enumerable.Last(data, Function(x) x > 0)  ' Compliant\n\n        Enumerable.First(If(True = True, data, data)) ' Noncompliant\n    End Sub\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LiteralSuffixUpperCase.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Tests.TestCases\n{\n    class LiteralSuffixUpperCase\n    {\n        public void Test(long ui)\n        {\n            // Error @+1 [CS0078] - compiler warning \"The 'l' suffix is easily confused with the digit '1' -- use 'L' for clarity\"\n            const long b = 0L;      // Fixed\n            const ulong c = 0Ul;\n            const ulong d = 0uL;\n            const decimal e = 1.2m;\n            const float f = 1.2f;\n            const double g = 1.2d;\n            const double h = 1.2e-10f;\n            const int i = 0xf; // Compliant\n            const int j = 0Xf; // Compliant\n            const int k = 0; // Compliant\n            const uint l = 0u;\n\n            // Error @+1 [CS0078] - compiler warning \"The 'l' suffix is easily confused with the digit '1' -- use 'L' for clarity\"\n            Test(45L); // Fixed\n        }\n        public void TestOk()\n        {\n            const uint a = 0U;\n            const long b = 100L;\n            const ulong c = 0UL;\n            const ulong d = 0UL;\n            const decimal e = 1.2M;\n            const float f = 1.2F;\n            const double g = 1.2D;\n            const double h = 1.2E-10;\n            const int i = 0xF;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LiteralSuffixUpperCase.Latest.cs",
    "content": "﻿public struct S\n{\n    public long Property { get; set; }\n\n    public void M()\n    {\n        // Error @+1 [CS0078] - compiler warning \"The 'l' suffix is easily confused with the digit '1' -- use 'L' for clarity\"\n        (Property, var b) = (0l,  // Noncompliant\n                             // Error @+1 [CS0078] - compiler warning \"The 'l' suffix is easily confused with the digit '1' -- use 'L' for clarity\"\n                             0l); // Noncompliant\n    }\n\n    void Utf8StringLiterals()\n    {\n        var a = \"test\"u8; // Compliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LiteralSuffixUpperCase.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Tests.TestCases\n{\n    class LiteralSuffixUpperCase\n    {\n        public void Test(long ui)\n        {\n            // Error @+1 [CS0078] - compiler warning \"The 'l' suffix is easily confused with the digit '1' -- use 'L' for clarity\"\n            const long b = 0l;      // Noncompliant {{Upper case this literal suffix.}}\n//                          ^\n            const ulong c = 0Ul;\n            const ulong d = 0uL;\n            const decimal e = 1.2m;\n            const float f = 1.2f;\n            const double g = 1.2d;\n            const double h = 1.2e-10f;\n            const int i = 0xf; // Compliant\n            const int j = 0Xf; // Compliant\n            const int k = 0; // Compliant\n            const uint l = 0u;\n\n            // Error @+1 [CS0078] - compiler warning \"The 'l' suffix is easily confused with the digit '1' -- use 'L' for clarity\"\n            Test(45l); // Noncompliant\n        }\n        public void TestOk()\n        {\n            const uint a = 0U;\n            const long b = 100L;\n            const ulong c = 0UL;\n            const ulong d = 0UL;\n            const decimal e = 1.2M;\n            const float f = 1.2F;\n            const double g = 1.2D;\n            const double h = 1.2E-10;\n            const int i = 0xF;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LiteralsShouldNotBePassedAsLocalizedParameters.CSharp10.cs",
    "content": "﻿using System.ComponentModel;\n\npublic struct S\n{\n    [Localizable(true)]\n    public string Property { get; set; }\n\n    public void M()\n    {\n        (Property, var b) = (\"a\", \"B\");     // Noncompliant\n        //                   ^^^\n\n        (Property, Property) = (\"a\", \"B\");  // Noncompliant [issue1, issue2]\n\n        (this.Property, b) = (\"a\", \"B\");    // Noncompliant\n\n        var s = new S();\n        (s.Property, b) = (\"a\", \"B\");       // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LiteralsShouldNotBePassedAsLocalizedParameters.CSharp11.cs",
    "content": "﻿using System.ComponentModel;\n\nclass FooBar\n{\n    [Localizable(true)]\n    public string Property1 { get; set; }\n\n    public void Method()\n    {\n        Property1 = \"\"\"\n            This is a long message.\n            It has several lines.\n                Some are indented\n                        more than others.\n            \"\"\"; // Noncompliant @-5\n\n        LocalFunction(\"\"\"\n            This is a long message.\n            It has several lines.\n                Some are indented\n                        more than others..\n            \"\"\"); // Noncompliant @-5\n\n        void LocalFunction([Localizable(true)] string param1) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LiteralsShouldNotBePassedAsLocalizedParameters.CSharp9.cs",
    "content": "﻿using System.ComponentModel;\n\nTopLevelLocalFunction(\"literal\", \"literal\"); //Noncompliant\n                                             //Noncompliant@-1\n\nvoid TopLevelLocalFunction([Localizable(true)] string param1, string message)\n{\n}\n\nrecord Record\n{\n    [Localizable(true)]\n    public string Property1 { get; set; }\n    public string Property2 { get; set; }\n\n    public void Method()\n    {\n        Property1 = \"lorem\"; // Noncompliant\n        Property2 = \"ipsum\";\n\n        LocalFunctionWithAttribute(\"literal\"); //Noncompliant\n\n        void LocalFunctionWithAttribute([Localizable(true)] string param1)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LiteralsShouldNotBePassedAsLocalizedParameters.cs",
    "content": "﻿using System;\nusing System.ComponentModel;\nusing System.Diagnostics;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        private const string ConstText = \"this cannot change\";\n\n        [Localizable(true)]\n        public string Property1 { get; set; }\n        [Localizable(false)]\n        public string Property2 { get; set; }\n        [Localizable(false)]\n        public string SomeMessage { get; set; }\n        public string Message { get; set; }\n        public string Text { get; set; }\n        public string Caption { get; set; }\n        public string OtherText { get; set; }\n        public string TextualRepresenatation { get; set; }\n\n        private string message;\n        [Localizable(true)]\n        public int IntProperty { get; set; }\n\n        public void Foo()\n        {\n            Bar(\"param1\", // Noncompliant {{Replace this string literal with a string retrieved through an instance of the 'ResourceManager' class.}}\n//              ^^^^^^^^\n                \"param2\", // Noncompliant\n//              ^^^^^^^^\n                \"param3\", // Noncompliant\n//              ^^^^^^^^\n                \"param4\"); // Noncompliant\n//              ^^^^^^^^\n\n            const string localConst = \"unchangeable\";\n\n            Baz(\"param1\",\n                \"some parameter\", // Compliant as Localizable is set to false\n                \"param2\", // Noncompliant\n                localConst, // Noncompliant\n                ConstText, // Noncompliant\n                ConstText); // Compliant, parameter does not match exactly\n\n            Console.WriteLine(\"some text\"); // Noncompliant\n            Console.Write(\"some more text\"); // Noncompliant\n            Console.WriteLine(\"the format\", \"a\"); // Noncompliant\n            Console.Write(\"the format\", \"a\"); // Noncompliant\n\n            Property1 = \"some text\"; // Noncompliant {{Replace this string literal with a string retrieved through an instance of the 'ResourceManager' class.}}\n            //          ^^^^^^^^^^^\n            Property2 = \"moar text\";\n            SomeMessage = \"some text\"; // Compliant as Localizable is set to false\n            Message = \"message text\"; // Noncompliant\n            Text = \"textual text\"; // Noncompliant\n            Caption = \"caption text\"; // Noncompliant\n            OtherText = \"other text\"; // Noncompliant\n            TextualRepresenatation = \"different things here\"; // Compliant, property does not match exactly\n\n            message = \"message text\"; // Compliant as it is a field\n            IntProperty = 42; // Compliant as it is not a string property.\n\n            InvalidAttribute1(\"some parameter\");\n            InvalidAttribute2(\"some parameter\");\n        }\n\n        public void Bar([Localizable(true)]string param1, string message, string text, string caption)\n        {\n        }\n\n        public void Baz([Localizable(false)]string param1, [Localizable(false)] string someMessage, string myMessage, string otherText, string captionString, string captionlessTitle)\n        {\n        }\n\n        public void InvalidAttribute1([Localizable] string param1) // Error [CS7036]\n        {\n        }\n\n        public void InvalidAttribute2([Localizable(42)] string param1) // Error [CS1503]\n        {\n        }\n    }\n\n    class InvalidProgram\n    {\n        public void Foo()\n        {\n            Bar(\"some string\", \"other string\", \"third string\"); // Compliant, this cannot be compiled // Error [CS1501]\n            Bar(\"some string\"); // Error [CS7036] Compliant, this cannot be compiled\n            Bar();              // Error [CS7036] Compliant\n            Console.Write(true); // Compliant\n            Console.WriteLine(); // Compliant\n        }\n\n        public void Bar(string text, string message)\n        {\n        }\n    }\n\n    class DebugCode\n    {\n        public string Message { get; set; }\n\n        public void LogStuff()\n        {\n            // Regression tests for https://github.com/SonarSource/sonar-dotnet/issues/1464\n            // S4055 should not raise issues for string literal used in the 'message' of Debug.XXX\n            Debug.Assert(true, \"Assertion message\");                    // compliant - method on Debug\n            Debug.WriteLine(\"Stuff happened\");                          // compliant - method on Debug\n            Debug.WriteLineIf(true, \"Stuff happened conditionally\");    // compliant - method on Debug\n        }\n\n        [Conditional(\"DEBUG\")]\n        public void DebugOnlyMethod(string text)\n        {\n            Console.WriteLine(\"hello world\");   // compliant - in a debug only method\n            Message = \"hello world\";            // compliant - in a debug only method\n        }\n\n        [Conditional(\"NONDEBUG\")]\n        public void NonDebugOnlyMethod(string text)\n        {\n            Console.WriteLine(\"hello world\");    // Noncompliant - not DEBUG conditional\n            Message = \"hello world\";             // Noncompliant - not DEBUG conditional\n        }\n\n        public void Caller()\n        {\n            DebugOnlyMethod(\"a message\");    // compliant - calling a debug-only method\n            NonDebugOnlyMethod(\"a message\"); // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LocalVariableName.vb",
    "content": "﻿Imports System\nImports Microsoft.VisualBasic\nModule Module1\n\n    Dim Foo As Int16\n\n\n\n    Sub Main()\n        Const Constant = 0 ' Compliant\n        Dim Foo = 0 ' Noncompliant\n        Dim ffoo = 0 ' Compliant\n        Dim fOOo42 = 0 ' Compliant\n\n        Using Resource As New Object ' Noncompliant\n\n        End Using\n\n        For Each Xxxx As Object In {1, 2, 3} ' Noncompliant\n\n        Next\n\n        For Value As Integer = 0 To 10 ' Noncompliant\n\n        Next\n\n        For Index = 1 To 10 ' Noncompliant\n\n        Next\n\n        For Foo = 1 To 10 ' Compliant\n\n        Next\n\n        For Each X In {1, 2, 3} ' Noncompliant\n\n        Next\n\n        For Each Foo In {1, 2, 3} ' Compliant\n\n        Next\n\n    End Sub\nEnd Module"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LockedFieldShouldBeReadonly.Latest.cs",
    "content": "﻿using System;\nusing System.Threading;\n\nclass Test\n{\n    static readonly object staticReadonlyField = null;\n\n    readonly object readonlyField = null;\n    object readWriteField = null;\n\n    Test()\n    {\n        ref object refToReadonlyField = ref readonlyField;\n        lock (refToReadonlyField) { }  // Noncompliant, while the reference is to a readonly field, the reference itself is a local variable and as of C# 7.3 can be ref reassigned\n\n        ref object refToReadWriteField = ref readWriteField;\n        lock (refToReadWriteField) { } // Noncompliant\n    }\n\n    void ReadonlyReferences()\n    {\n        lock (RefReturnReadonlyField(this)) { }\n        lock (RefReturnStaticReadonlyField()) { }\n        lock (StaticRefReturnReadonlyField(this)) { }\n        lock (StaticRefReturnStaticReadonlyField()) { }\n\n        ref readonly object RefReturnReadonlyField(Test instance) => ref instance.readonlyField;\n        ref readonly object RefReturnStaticReadonlyField() => ref Test.staticReadonlyField;\n        static ref readonly object StaticRefReturnReadonlyField(Test instance) => ref instance.readonlyField;\n        static ref readonly object StaticRefReturnStaticReadonlyField() => ref Test.staticReadonlyField;\n    }\n\n    void OnANewInstanceOnStack()\n    {\n        lock (stackalloc int[] { }) { }              // Error [CS0185]\n        lock (stackalloc [] { 1 }) { }               // Error [CS0185]\n    }\n\n    void CoalescingAssignment(object oPar)\n    {\n        lock (oPar ??= readonlyField) { }            // FN, null conditional assignment not supported\n    }\n\n    void SwitchExpression(object oPar)\n    {\n        lock (oPar switch { _ => new object() }) { } // FN, switch expression not supported\n    }\n\n    void StringLiterals()\n    {\n        lock (\"\"\"a raw string literal\"\"\") // Noncompliant\n        { }                    \n        lock ($\"\"\"an interpolated {\"raw string literal\"}\"\"\") // Noncompliant\n        { }\n    }\n\n    void TargetTypedObjectCreation()\n    {\n        lock ((object)new())  // FN\n        { }\n    }\n}\n\nclass Records\n{\n    readonly ARecord readonlyField = new();\n    ARecord readWriteField = new();\n\n    static readonly ARecord staticReadonlyField = new();\n    static ARecord staticReadWriteField = new();\n\n    void OnAFieldOfTypeRecord()\n    {\n        lock (readonlyField)\n        { }\n        lock (readWriteField) // Noncompliant\n        { }\n        lock (staticReadonlyField)\n        { }\n        lock (staticReadWriteField) // Noncompliant\n        { }\n    }\n\n    void OnANewRecordInstance()\n    {\n        lock (new ARecord()) // Noncompliant\n        { }\n    }\n\n    record ARecord();\n}\n\nclass LockObjectType\n{\n    private readonly Lock _LockReadonly = new();\n    private Lock _LockWriteable = new();\n\n    public void LockOnReadonlyLock()\n    {\n        lock (_LockReadonly)\n        { }\n    }\n\n    public void LockOnWritableLock()\n    {\n        lock (_LockWriteable) // Noncompliant\n        { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LockedFieldShouldBeReadonly.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nclass Test\n{\n    private static readonly object staticReadonlyField = null;\n    private static object staticReadWriteField = null;\n\n    private readonly object readonlyField = null;\n    private readonly string readonlyStringField = \"a string\";\n    private object readWriteField = null;\n\n    private static object StaticReadonlyProperty => null;\n    private object ReadonlyProperty => null;\n\n    private static object StaticReadWriteProperty { get; set; }\n    private object ReadWriteProperty { get; set; }\n\n    void OnAStaticField()\n    {\n        lock (staticReadonlyField) { }\n        lock (staticReadWriteField) { }                  // Noncompliant {{Do not lock on writable field 'staticReadWriteField', use a readonly field instead.}}\n        //    ^^^^^^^^^^^^^^^^^^^^\n        lock (Test.staticReadonlyField) { }\n        lock (Test.staticReadWriteField) { }             // Noncompliant {{Do not lock on writable field 'staticReadWriteField', use a readonly field instead.}}\n        //    ^^^^^^^^^^^^^^^^^^^^^^^^^\n        lock (AnotherClass.staticReadonlyField) { }\n        lock (AnotherClass.staticReadWriteField) { }     // Noncompliant {{Do not lock on writable field 'staticReadWriteField', use a readonly field instead.}}\n        //    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    }\n\n    void OnAFieldOfSameInstance()\n    {\n        lock (readonlyField) { }\n        lock (readonlyStringField) { }                   // Noncompliant {{Do not lock on strings as they can be interned, use a readonly field instead.}}\n        lock (readWriteField) { }                        // Noncompliant {{Do not lock on writable field 'readWriteField', use a readonly field instead.}}\n        lock (this.readonlyField) { }\n        lock (this.readWriteField) { }                   // Noncompliant {{Do not lock on writable field 'readWriteField', use a readonly field instead.}}\n    }\n\n    void OnParenthesizedExpressions()\n    {\n        lock ((readonlyField)) { }\n        lock ((readWriteField)) { }                      // Noncompliant {{Do not lock on writable field 'readWriteField', use a readonly field instead.}}\n        lock ((this.readWriteField)) { }                 // Noncompliant {{Do not lock on writable field 'readWriteField', use a readonly field instead.}}\n    }\n\n    void OnAFieldOfDifferentInstance()\n    {\n        var anotherInstance = new Test();\n        lock (anotherInstance.readonlyField) { }\n        lock (anotherInstance.readWriteField) { }        // Noncompliant {{Do not lock on writable field 'readWriteField', use a readonly field instead.}}\n        lock (anotherInstance.readonlyField) { }\n        lock (anotherInstance?.readWriteField) { }       // FN: ?. not supported\n    }\n\n    void OnALocalVariable()\n    {\n        object localVarNull = null;\n        lock (localVarNull) { }                          // Noncompliant {{Do not lock on local variable 'localVarNull', use a readonly field instead.}}\n        object localVarReadonlyField = readonlyField;\n        lock (localVarReadonlyField) { }                 // Noncompliant, while the local variable references a readonly field, the local variable itself can mutate\n        object localVarReadWriteField = readWriteField;\n        lock (localVarReadWriteField) { }                // Noncompliant\n    }\n\n    void OnALocalOutVar(Dictionary<int, object> lockObjs)\n    {\n        if (lockObjs.TryGetValue(42, out var lockObj))\n        {\n            lock (lockObj) { }                           // Noncompliant, FP: the lock object is a local variable retrieved from a collection of locks\n        }\n    }\n\n    void OnANewInstance()\n    {\n        lock (new object()) { }                          // Noncompliant {{Do not lock on a new instance because is a no-op, use a readonly field instead.}}\n        lock (new ANamespace.AClass()) { }               // Noncompliant\n        lock (new Test[] { }) { }                        // Noncompliant\n        lock (new[] { readonlyField }) { }               // Noncompliant\n        lock (new Tuple<object>(readonlyField)) { }      // Noncompliant\n        lock (new { }) { }                               // Noncompliant\n\n        lock (1) { }                                     // Error [CS0185]\n        lock ((a: readonlyField, b: readonlyField)) { }  // Error [CS0185]\n\n        lock (new ADelegate(x => x)) { }                 // Noncompliant\n        lock (new Func<int, int>(x => x)) { }            // Noncompliant\n        lock (x => x) { }                                // Error [CS0185]\n        lock ((int?)1) { }                               // Error [CS0185]\n\n        lock (from x in new object[2] select x) { }      // Noncompliant\n    }\n\n    void OnAStringInstance()\n    {\n        lock (\"a string\") { }                            // Noncompliant {{Do not lock on strings as they can be interned, use a readonly field instead.}}\n        lock ($\"an interpolated {\"string\"}\") { }         // Noncompliant\n        lock (\"a\" + \"string\") { }                        // Noncompliant\n        lock (MethodReturningString()) { }               // Noncompliant\n\n        string MethodReturningString() => \"a string\";\n    }\n\n    void OnAssignment()\n    {\n        object x;\n        lock (x = readonlyField) { }\n        lock (x = readWriteField) { }                    // FN, assignment not supported\n    }\n\n    void OtherCases(object oPar, bool bPar, object[] arrayPar)\n    {\n        lock (null) { }\n\n        lock (oPar) { }\n\n        lock (this) { }\n\n        lock (SomeMethod()) { }\n        lock (oPar.GetType()) { }\n        lock (typeof(Test)) { }\n        lock (default(Test)) { }\n\n        object SomeMethod() => null;\n\n        lock (StaticReadonlyProperty) { }\n        lock (ReadonlyProperty) { }\n        lock (StaticReadWriteProperty) { }\n        lock (ReadWriteProperty) { }\n\n        lock (bPar ? readWriteField : readonlyField) { }\n\n        lock (oPar ?? readonlyField) { }\n        lock (oPar = readonlyField) { }\n\n        lock (arrayPar[0]) { }\n    }\n\n    void ReadWriteReferences()\n    {\n        lock (RefReturnReadWriteField(this)) { }         // FN, the method returns a readwrite ref to a member\n        lock (RefReturnStaticReadonlyField(this)) { }    // FN, the method returns a readwrite ref to a member\n\n        ref object RefReturnReadWriteField(Test instance) => ref instance.readWriteField;\n        ref object RefReturnStaticReadonlyField(Test instance) => ref Test.staticReadWriteField;\n    }\n\n    void NoIdentifier()\n    {\n        lock () { }   // Error [CS1525]\n        lock (()) { } // Error [CS1525]\n    }\n\n    delegate object ADelegate(object oPar);\n}\n\nclass TestExplicitCast\n{\n    private readonly object readonlyField = null;\n\n    void Test()\n    {\n        lock ((AnotherClass)readonlyField) { } // Compliant, the cast operator can run arbitrary code\n    }\n}\n\nclass AnotherClass\n{\n    public static readonly object staticReadonlyField = null;\n    public static object staticReadWriteField = null;\n\n    public readonly object readonlyField = null;\n    public object readWriteField = null;\n\n    public static explicit operator AnotherClass(Test o) => new AnotherClass();\n}\n\nclass FieldAccessibily\n{\n    private readonly object privateField = null;\n    protected readonly object protectedField = null;\n    protected internal readonly object protectedInternalField = null;\n    internal readonly object internalField = null;\n    public readonly object publicField = null;\n\n    private object PrivateProperty => null;\n    protected object ProtectedProperty => null;\n    protected internal object ProtectedInternalProperty => null;\n    internal object InternalProperty => null;\n    public object PublicProperty => null;\n\n    void FieldAccessibilityDoesntMatter()\n    {\n        lock (privateField) { }\n        lock (protectedField) { }\n        lock (protectedInternalField) { }\n        lock (internalField) { }\n        lock (publicField) { }\n    }\n\n    void RuleDoesntRaiseOnProperties()\n    {\n        lock (PrivateProperty) { }\n        lock (ProtectedProperty) { }\n        lock (ProtectedInternalProperty) { }\n        lock (InternalProperty) { }\n        lock (PublicProperty) { }\n    }\n}\n\nnamespace ANamespace\n{\n    class AClass { }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/7058\nclass Repro_7058\n{\n    void LockInsideCapture()\n    {\n        var local = new object();\n        Action action = () =>\n        {\n            lock (local) { } // Noncompliant, FP: local is in the captured scope\n        };\n    }\n\n    void LockOutsideCapture()\n    {\n        var local = new object();\n        Action action = () =>\n        {\n            var localCaptured = local;\n        };\n        lock (local) { }     // Noncompliant, locking captured variable in its declaration scope\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LoggerFieldsShouldBePrivateStaticReadonly.cs",
    "content": "﻿using Microsoft.Extensions.Logging;\n\npublic class Compliant\n{\n    static readonly ILogger logger1;                      // Compliant\n\n    private static readonly ILogger<int> logger2;         // Compliant\n\n    private static readonly ILogger logger3, logger4;     // Compliant\n}\n\npublic class Noncompliant\n{\n    ILogger logger1, logger2, logger3;\n    //      ^^^^^^^ {{Make the logger 'logger1' private static readonly.}}\n    //               ^^^^^^^ @-1 {{Make the logger 'logger2' private static readonly.}}\n    //                        ^^^^^^^ @-2 {{Make the logger 'logger3' private static readonly.}}\n\n    private ILogger logger4;                              // Noncompliant\n    //              ^^^^^^^\n    static ILogger<int> logger5;                          // Noncompliant\n    readonly ILogger logger6;                             // Noncompliant\n\n    private static ILogger logger7;                       // Noncompliant\n    private readonly ILogger logger8;                     // Noncompliant\n\n    public static readonly ILogger<object> logger10;      // Noncompliant\n    protected internal static readonly ILogger logger12;  // Noncompliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LoggersShouldBeNamedForEnclosingType.NLog.cs",
    "content": "﻿using NLog;\nusing static NLog.LogManager;\n\nclass EnclosingType\n{\n    void Method(LogFactory factory)\n    {\n        LogManager.GetLogger(nameof(EnclosingType));            // Compliant\n        LogManager.GetLogger(typeof(EnclosingType).Name);       // Compliant\n\n        LogManager.GetLogger(nameof(AnotherType));              // Noncompliant {{Update this logger to use its enclosing type.}}\n        //                          ^^^^^^^^^^^\n        LogManager.GetLogger(typeof(AnotherType).Name);         // Noncompliant\n        //                          ^^^^^^^^^^^\n\n        factory.GetLogger(nameof(EnclosingType));               // Compliant\n        factory.GetLogger(typeof(EnclosingType).Name);          // Compliant\n\n        factory.GetLogger(nameof(AnotherType));                 // Noncompliant {{Update this logger to use its enclosing type.}}\n        //                       ^^^^^^^^^^^\n        factory.GetLogger(typeof(AnotherType).Name);            // Noncompliant\n        //                       ^^^^^^^^^^^\n\n        GetLogger(typeof(AnotherType).Name);            // Noncompliant\n        //               ^^^^^^^^^^^\n    }\n}\n\nclass AnotherType : EnclosingType { }\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LoggersShouldBeNamedForEnclosingType.cs",
    "content": "﻿using Microsoft.Extensions.Logging;\nusing System;\n\nusing AliasedFactory = Microsoft.Extensions.Logging.ILoggerFactory;\n\nclass AnotherType : EnclosingType { }\n\nclass EnclosingType\n{\n    void Strings(ILoggerFactory factory, string loggerName)\n    {\n        factory.CreateLogger(\"Whatever\");                               // Compliant, ignore strings apart from nameof and typeof\n        factory.CreateLogger(loggerName);                               // Compliant\n        factory.CreateLogger(GetLoggerName());                          // Compliant\n\n        factory.CreateLogger(GetType().FullName);                       // Compliant\n        factory.CreateLogger(new AnotherType().GetType().FullName);     // FN, we do not parse this\n\n        factory.CreateLogger(nameof(EnclosingType));                    // Compliant\n        factory.CreateLogger(nameof(AnotherType));                      // Noncompliant {{Update this logger to use its enclosing type.}}\n        //                          ^^^^^^^^^^^\n\n        factory.CreateLogger(typeof(EnclosingType).Name);               // Compliant\n        factory.CreateLogger(typeof(AnotherType).Name);                 // Noncompliant\n\n        factory.CreateLogger(typeof(EnclosingType).FullName);           // Compliant\n        factory.CreateLogger(typeof(AnotherType).FullName);             // Noncompliant\n    }\n\n    void Types(ILoggerFactory factory)\n    {\n        // runtime\n        factory.CreateLogger(GetType());                                // Compliant\n        factory.CreateLogger(new AnotherType().GetType());              // FN, we do not parse this\n        factory.CreateLogger(GetLoggerType());                          // FN, we do not parse this\n\n        // compile time, typeof\n        factory.CreateLogger(typeof(EnclosingType));                   // Compliant\n        factory.CreateLogger(typeof(AnotherType));                     // Noncompliant\n        //                          ^^^^^^^^^^^\n\n        // compile time, generics\n        factory.CreateLogger<EnclosingType>();                         // Compliant\n        factory.CreateLogger<AnotherType>();                           // Noncompliant\n        //                   ^^^^^^^^^^^\n\n        LoggerFactoryExtensions.CreateLogger<AnotherType>(factory);    // Noncompliant\n        //                                   ^^^^^^^^^^^\n    }\n\n    void Aliasing(AliasedFactory factory)\n    {\n        factory.CreateLogger(nameof(EnclosingType));                   // Compliant\n        factory.CreateLogger(nameof(AnotherType));                     // Noncompliant\n        //                          ^^^^^^^^^^^\n    }\n\n    static string GetLoggerName() => \"Whatever\";\n    static Type GetLoggerType() => null;\n\n    class Inner\n    {\n        void InnerMethod(ILoggerFactory factory)\n        {\n            factory.CreateLogger(nameof(Inner));                                         // Compliant\n            factory.CreateLogger(nameof(AnotherType));                                   // Noncompliant\n\n            factory.CreateLogger(nameof(EnclosingType.Inner));                           // Compliant\n            factory.CreateLogger(nameof(AnotherType.Inner));                             // Compliant, `Inner` is the same type\n            factory.CreateLogger(typeof(AnotherType.Inner));                             // Compliant\n            factory.CreateLogger(typeof(AnotherType.Inner).Name);                        // Compliant\n            factory.CreateLogger(typeof(AnotherType.Inner).FullName);                    // Compliant\n            factory.CreateLogger(typeof(AnotherType.Inner).AssemblyQualifiedName);       // Compliant\n\n            factory.CreateLogger<EnclosingType.Inner>();                                 // Compliant\n            factory.CreateLogger<AnotherType.Inner>();                                   // Compliant\n            factory.CreateLogger<AnotherType>();                                         // Noncompliant\n\n            LoggerFactoryExtensions.CreateLogger(factory, typeof(EnclosingType.Inner));  // Compliant\n            LoggerFactoryExtensions.CreateLogger(factory, typeof(AnotherType));          // FN, we do not go into arguments if their Count is > 1\n\n            LoggerFactoryExtensions.CreateLogger<EnclosingType.Inner>(factory);          // Compliant\n            LoggerFactoryExtensions.CreateLogger<AnotherType>(factory);                  // Noncompliant\n            //                                   ^^^^^^^^^^^\n        }\n    }\n}\n\nclass Generic<T>\n{\n    public Generic<T> Same;\n    public ILoggerFactory factory;\n\n    void Method()\n    {\n        factory.CreateLogger<Generic<T>>();                                             // Compliant\n        factory.CreateLogger(nameof(Generic<T>));                                       // Compliant\n        factory.CreateLogger(typeof(Generic<T>));                                       // Compliant\n        factory.CreateLogger(typeof(Generic<T>).Name);                                  // Compliant\n        factory.CreateLogger(typeof(Generic<T>).FullName);                              // Compliant\n        factory.CreateLogger(typeof(Generic<T>).AssemblyQualifiedName);                 // Compliant\n\n        this.Same.factory.CreateLogger<Generic<T>>();                                   // Compliant\n        this.Same.Same.Same.factory.CreateLogger<Generic<T>>();                         // Compliant\n\n        this.Same.Same.Same.factory.CreateLogger<AnotherType>();                        // Noncompliant\n        this.Same.Same.Same.factory.CreateLogger(nameof(AnotherType));                  // Noncompliant\n        this.Same.Same.Same.factory.CreateLogger(typeof(AnotherType));                  // Noncompliant\n\n        this.Chain<T>().Chain<T>().Factory().CreateLogger(nameof(Generic<T>));          // Compliant\n        this.Chain<T>().Chain<T>().Factory().CreateLogger(nameof(AnotherType));         // Noncompliant\n\n        this.Chain<T>().Chain<T>().Factory().CreateLogger(typeof(Generic<T>));          // Compliant\n        this.Chain<T>().Chain<T>().Factory().CreateLogger(typeof(AnotherType));         // Noncompliant\n\n        this.Chain<T>().Chain<T>().Factory().CreateLogger(typeof(Generic<T>).Name);     // Compliant\n        this.Chain<T>().Chain<T>().Factory().CreateLogger(typeof(AnotherType).Name);    // Noncompliant\n\n        this.Chain<T>().Chain<T>().Factory().CreateLogger<Generic<T>>();                // Compliant\n        this.Chain<T>().Chain<T>().Factory().CreateLogger<AnotherType>();               // Noncompliant\n    }\n\n    Generic<T> Chain<T>() => null;\n    ImplFactory Factory() => null;\n}\n\nclass ImplFactory : ILoggerFactory\n{\n    public void AddProvider(ILoggerProvider provider) { }\n    public void Dispose() { }\n\n    public ILogger CreateLogger(string categoryName) => null;\n}\n\nclass FakeMethods\n{\n    public ILogger GetLogger(string name) => null;\n    public ILogger GetLogger(Type type) => null;\n\n    public ILogger CreateLogger(string name) => null;\n    public ILogger CreateLogger(Type type) => null;\n    public ILogger CreateLogger<T>() => null;\n    public ILogger CreateLogger<T1, T2>() => null;\n\n    string nameof(object a) => null;\n    string nameof(object a, object b) => null;\n\n    public void Method(ILoggerFactory factory)\n    {\n        CreateLogger(typeof(AnotherType));              // Compliant, not relevant method\n        CreateLogger(typeof(AnotherType).Name);         // Compliant\n        CreateLogger<AnotherType>();                    // Compliant\n        CreateLogger<AnotherType, AnotherType>();       // Compliant\n\n        GetLogger(typeof(AnotherType));                 // Compliant, not relevant method\n        GetLogger(typeof(AnotherType).Name);            // Compliant\n\n        var FakeType = \"FakeType\";\n        factory.CreateLogger(nameof(FakeType));         // Noncompliant FP, very unrealistic\n        factory.CreateLogger(nameof(FakeType, 42));     // Compliant\n    }\n}\n\nclass LoggerHelper\n{\n    ILoggerFactory factory;\n\n    ILogger<T> CreateLogger<T>() => factory.CreateLogger<T>(); // Compliant, T is GenericType\n}\n\npublic class Service\n{\n    public Service(ILogger logger) { }\n    public Service(ILogger logger, string otherParameter) { }\n    public Service(ILogger<Service> logger) { }\n    public Service(ILogger<Service> logger, string otherParameter) { }\n    public Service(Service service) { }\n    public Service(AnotherService service) { }\n}\n\npublic class AnotherService\n{\n    public AnotherService(Service service) { }\n    public AnotherService(ILogger<Service> logger) { }\n}\n\n\npublic class Factory\n{\n    private readonly ILogger<Service> logger = LoggerFactory.Create(builder => { }).CreateLogger<Service>();        // Noncompliant\n\n    public void CreateType(ILoggerFactory loggerFactory, string otherParameter)\n    {\n        new Service(loggerFactory.CreateLogger<Service>());                                                         // Compliant\n        new Service(loggerFactory.CreateLogger<AnotherService>());                                                  // Noncompliant\n\n        new Service(loggerFactory.CreateLogger<Service>(), otherParameter);\n        new Service(loggerFactory.CreateLogger(nameof(Service)), otherParameter);\n        new Service(loggerFactory.CreateLogger(typeof(Service)), otherParameter);\n        new Service(loggerFactory.CreateLogger(typeof(Service).Name), otherParameter);\n        new Service(loggerFactory.CreateLogger(typeof(Service).FullName), otherParameter);\n        new Service(loggerFactory.CreateLogger(typeof(Service).AssemblyQualifiedName), otherParameter);\n\n        new Service(loggerFactory.CreateLogger<string>(), otherParameter);                                           // Noncompliant\n        new Service(loggerFactory.CreateLogger(nameof(AnotherService)), otherParameter);                             // Noncompliant\n        new Service(loggerFactory.CreateLogger(typeof(AnotherService)), otherParameter);                             // Noncompliant\n        new Service(loggerFactory.CreateLogger(typeof(string).Name), otherParameter);                                // Noncompliant\n        new Service(loggerFactory.CreateLogger(typeof(string).FullName), otherParameter);                            // Noncompliant\n        new Service(loggerFactory.CreateLogger(typeof(Decorator<Service>).AssemblyQualifiedName), otherParameter);   // Noncompliant\n\n        new AnotherService(new Service(loggerFactory.CreateLogger<Service>()));                                      // Compliant\n        new Service(new AnotherService(loggerFactory.CreateLogger<Service>()));                                      // Noncompliant\n    }\n\n    public Service CreateType_LocalVariable(ILoggerFactory loggerFactory)\n    {\n        var logger = loggerFactory.CreateLogger<Service>();                                                         // Noncompliant FP\n        return new Service(logger);\n    }\n\n    public Service CreateType_LocalVariableField()\n    {\n        return new Service(logger);\n    }\n\n    public Service CreateType_Decorator(ILoggerFactory loggerFactory)\n    {\n        return new Service(new Decorator<Service>(loggerFactory.CreateLogger<Service>()));                          // Compliant\n        return new Service(new Decorator(loggerFactory.CreateLogger(nameof(Service))));                             // Compliant\n    }\n\n    class Decorator : ILogger\n    {\n        public Decorator(ILogger logger) { }\n        public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter) { }\n        public bool IsEnabled(LogLevel logLevel) => true;\n        public IDisposable BeginScope<TState>(TState state) => null;\n    }\n\n    private class Decorator<T> : ILogger<T>\n    {\n        public Decorator(ILogger<T> logger) { }\n        public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter) { }\n        public bool IsEnabled(LogLevel logLevel) => true;\n        public IDisposable BeginScope<TState>(TState state) => null;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LoggingArgumentsShouldBePassedCorrectly.cs",
    "content": "﻿using System;\nusing Microsoft.Extensions.Logging;\n\npublic class Program\n{\n    private void Log(ILogger logger, Exception e)\n    {\n        LogWarning(null, null); // Error [CS0103] The name 'LogWarning' does not exist in the current context\n\n        logger.LogCritical(\"Expected exception.\", e);\n//      ^^^^^^^^^^^^^^^^^^ {{Logging arguments should be passed to the correct parameter.}}\n//                                                ^ Secondary @-1\n        logger.LogWarning(new EventId(1), e.InnerException, \"Message!\");\n        logger.LogWarning(new EventId(1), e?.InnerException, \"Message!\");\n        logger.LogWarning(new EventId(1), e.InnerException.InnerException, \"Message!\");\n        logger.LogWarning(new EventId(1), (Exception)e.InnerException, \"Message!\");\n        logger.LogCritical(args: new object[] { e, LogLevel.Critical }, message: \"Expected exception.\");        // FN\n        logger.LogCritical(message: \"Expected exception.\", eventId: new EventId(42), exception: new Exception(), args: e);\n        logger.LogCritical(message: \"Expected exception.\", eventId: new EventId(42), args: e);\n//      ^^^^^^^^^^^^^^^^^^\n//                                                                                   ^^^^^^^ Secondary@-1\n        logger.LogCritical(\"Expected exception.\", new NullReferenceException());    // Noncompliant\n                                                                                    // Secondary@-1\n    }\n\n    private void Log(CustomLogger logger, Exception e)\n    {\n        logger.LogCritical(\"Expected exception.\", e, LogLevel.Critical);\n//      ^^^^^^^^^^^^^^^^^^\n//                                                ^ Secondary @-1\n//                                                   ^^^^^^^^^^^^^^^^^ Secondary @-2\n    }\n\n    private class CustomLogger : ILogger\n    {\n        public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter) { }\n        public bool IsEnabled(LogLevel logLevel) => false;\n        public IDisposable BeginScope<TState>(TState state) => null;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LoggingTemplatePlaceHoldersShouldBeInOrder.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Microsoft.Extensions.Logging;\n\npublic class Program\n{\n    private string _first = \"\";\n    private string _second = \"\";\n    private string First { get; set; } = \"\";\n    private string Second { get; set; } = \"\";\n    private Person _person;\n    private Person Person { get; set; }\n\n    public void Basics(ILogger logger, int first, int second, int third)\n    {\n        logger.LogInformation(\"No placeholder\");                        // Compliant\n        logger.LogInformation(\"Arg: {First}\", first);\n        logger.LogInformation(\"Arg: {First}\", first);                   // Compliant - S6678 should raise for not using Pascal Case naming, but not this rule\n        logger.LogInformation(\"Arg: {First}\", 42);\n        logger.LogInformation(\"Arg: {First}\", second);                  // Compliant - maybe anotherArg is passed by mistake, hard to decide without knowing the context\n        logger.LogInformation(\"Arg: {First} {Second}\", first, first);\n        logger.LogInformation(\"Arg: {First}\");\n        logger.LogInformation(\"Arg: {First}\", new object());\n        logger.LogInformation(\"Arg: {First}\", first.ToString());\n        logger.LogInformation(\"Arg: {First}\", second.ToString());\n        logger.LogInformation(\"Arg: {First}\", new[] { first });\n        logger.LogInformation(\"Arg: {0}\", first);\n        logger.LogInformation(\"Arg: {0} {1}\", 1, 0);\n        logger.LogInformation(\"Arg: {_}\", first);\n        logger.LogInformation(\"Arg: {}\", first);\n        logger.LogInformation(\"Arg: {First} {Second}\", first, second);\n        logger.LogInformation(\"Arg: {{First}} {{Second}}\", first, second);\n        logger.LogInformation(\"Arg: {First} {Another_Arg}\", first, second);\n        logger.LogInformation(\"Arg: {First} {Another Arg}\", first, second);\n        logger.LogInformation(\"Arg: {First} {Another.Arg}\", first, second);\n        logger.LogInformation(\"Arg: {First} {Second}\", first, second);\n        logger.LogInformation(\"Arg: {First} {Second}\", first, 42);\n        logger.LogInformation(\"Arg: {First} {First}\", first, first);\n        logger.LogInformation(\"Arg: {First} {Second}\", first, first);\n        logger.LogInformation(\"Arg: {First} {Second}\", new object(), 42);\n        logger.LogInformation(\"Arg: {First} {Second}\", new[] { first, second });\n\n        logger.BeginScope(\"scope\");\n        logger.BeginScope(\"Arg: {First} {Second}\", first, second);\n        logger.BeginScope(\"Arg: {First} {Second}\", second, first);      // Compliant - not a logger method\n\n        logger.LogInformation(\"Arg: {First} {Second}\", second, first);\n        //                           ^^^^^ {{Template placeholders should be in the right order: placeholder 'First' does not match with argument 'second'.}}\n        //                                             ^^^^^^ Secondary @-1 {{The argument should be 'first' to match placeholder 'First'.}}\n\n        logger.LogInformation(\"Arg: {First} {Third} {Second}\", first, second, third);\n        //                                   ^^^^^ {{Template placeholders should be in the right order: placeholder 'Third' does not match with argument 'second'.}}\n        //                                                            ^^^^^^ Secondary @-1 {{The argument should be 'third' to match placeholder 'Third'.}}\n\n        logger.LogInformation(\"Arg: {First} {First}\", first, second);   // Compliant - S6677 should raise for duplicate placeholder names, but not this rule\n        logger.LogInformation(@\"\n             {First}\n             {Second}\", second, first);\n        //    ^^^^^ @-1\n        //              ^^^^^^ Secondary @-1\n\n        logger.LogInformation(\"Arg: {First} {Second}\", _first, _second);                        // Compliant\n        logger.LogInformation(\"Arg: {First} {Second}\", _second, _first);                        // Noncompliant\n                                                                                                // Secondary @-1\n\n        logger.LogInformation(\"Arg: {First} {Second}\", First, Second);                          // Compliant\n        logger.LogInformation(\"Arg: {First} {Second}\", Second, First);                          // Noncompliant\n                                                                                                // Secondary @-1\n\n        logger.LogInformation(\"Arg: {First} {Second}\", _first, Second);                         // Compliant\n        logger.LogInformation(\"Arg: {First} {Second}\", _second, First);                         // Noncompliant\n                                                                                                // Secondary @-1\n\n        int arg1 = first;\n        int arg2 = second;\n        logger.LogInformation(\"Arg: {Arg1} {Arg2}\", arg1, arg2);                                // Compliant\n        logger.LogInformation(\"Arg: {Arg1} {Arg2}\", arg2, arg1);                                // FN\n\n        logger.LogInformation(\"Arg: {First} {Second}\", (short)second, (float)first);            // Noncompliant\n                                                                                                // Secondary @-1\n\n        LoggerExtensions.LogInformation(logger, \"Arg: {First} {Second}\", second, first);        // Noncompliant\n                                                                                                // Secondary @-1\n    }\n\n    public void NamedArguments(ILogger logger, int first, int second)\n    {\n        logger.LogInformation(args: new[] { first, second }, message: \"Arg: {Second} {First}\"); // Compliant\n        logger.LogInformation(args: new[] { first, second }, message: \"Arg: {Second} {First}\"); // FN\n    }\n\n    public void PropertyAccess(ILogger logger, Person person, List<Person> people)\n    {\n        logger.LogInformation(\"Person: {FirstName} {Age}\", person.FirstName, person.Age);       // Compliant\n        logger.LogInformation(\"Person: {Age} {FirstName}\", person.FirstName, person.Age);       // Noncompliant\n                                                                                                // Secondary @-1 {{The argument should be 'person.Age' to match placeholder 'Age'.}}\n\n        logger.LogInformation(\"Person: {FirstName} {Age}\", _person.FirstName, _person.Age);     // Compliant\n        logger.LogInformation(\"Person: {Age} {FirstName}\", _person.FirstName, _person.Age);     // Noncompliant\n                                                                                                // Secondary @-1  {{The argument should be '_person.Age' to match placeholder 'Age'.}}\n\n        logger.LogInformation(\"Person: {FirstName} {Age}\", Person.FirstName, Person.Age);       // Compliant\n        logger.LogInformation(\"Person: {Age} {FirstName}\", Person.FirstName, Person.Age);       // Noncompliant\n                                                                                                // Secondary @-1  {{The argument should be 'Person.Age' to match placeholder 'Age'.}}\n\n        logger.LogInformation(\"Father: {Father}, Mother: {Mother}\", person.Father.LastName, person.Mother.LastName);    // Compliant\n        logger.LogInformation(\"Father: {Father}, Mother: {Mother}\", person.Mother.LastName, person.Father.LastName);    // FN\n\n        logger.LogInformation(\"Person: {FirstName} {LastName}\", person.FirstName, person.LastName);     // Compliant\n        logger.LogInformation(\"Person: {FirstName} {LastName}\", person.LastName, person.FirstName);     // FN\n\n        logger.LogInformation(\"People: {Count} {People}\", people.Count, people.Select(x => x.FirstName + \" \" + x.LastName));\n\n        var someFirstName = person.FirstName;\n        logger.LogInformation(\"{PersonFirstName} {PersonAge}\", someFirstName, person.Age);      // Compliant\n\n        var first = person.FirstName;\n        var last = person.LastName;\n        var name = person.LastName;\n        var PFN = person.FirstName;\n        var PLN = person.LastName;\n        logger.LogInformation(\"Person: {FirstName} {LastName}\", first, last);                   // Compliant\n        logger.LogInformation(\"Person: {FirstName} {LastName}\", last, first);                   // Compliant\n        logger.LogInformation(\"Person: {FirstName} {LastName}\", last, name);                    // Compliant\n        logger.LogInformation(\"Person: {FirstName} {LastName}\", name, name);                    // Compliant\n        logger.LogInformation(\"Person: {FirstName} {LastName}\", name, name);                    // Compliant\n        logger.LogInformation(\"Person: {FirstName} {LastName}\", PFN, PLN);                      // Compliant\n        logger.LogInformation(\"Person: {FirstName} {LastName}\", PLN, PFN);                      // Compliant\n        logger.LogInformation(\"Person: {PLN} {PFN}\", PLN, PFN);                                 // Compliant\n        logger.LogInformation(\"Person: {PLN} {PFN}\", PFN, PLN);                                 // Compliant\n\n        var allPeople = people;\n        logger.LogInformation(\"People: {Count} {People}\", people.Count, allPeople);\n    }\n\n    public void Overloads(ILogger logger, int first, int second)\n    {\n        logger.LogInformation(new EventId(42), \"Arg: {First} {Second}\", first, second);\n        logger.LogInformation(new EventId(42), \"Arg: {Second} {First}\", first, second);         // Noncompliant\n                                                                                                // Secondary @-1\n        logger.LogInformation(new Exception(), \"Arg: {First} {Second}\", first, second);\n        logger.LogInformation(new Exception(), \"Arg: {Second} {First}\", first, second);         // Noncompliant\n                                                                                                // Secondary @-1\n    }\n\n    public void Casing(ILogger logger, int first, int second)\n    {\n        logger.LogInformation(\"Arg: {Second} {First}\", first, second);      // Noncompliant\n                                                                            // Secondary @-1\n        logger.LogInformation(\"Arg: {_second_} {_first_}\", first, second);  // Noncompliant\n                                                                            // Secondary @-1\n        logger.LogInformation(\"Arg: {SECOND} {FIRST}\", first, second);      // Noncompliant\n                                                                            // Secondary @-1\n    }\n\n    public void IncorrectPlaceholderFormat(ILogger logger, int first, int second)\n    {\n        logger.LogInformation(\"Arg: {@First} {@Second}\", second, first);                    // Noncompliant\n                                                                                            // Secondary @-1\n        logger.LogInformation(\"Arg: {&First} {&Second}\", second, first);\n        logger.LogInformation(\"Arg: {First,42} {Second,42}\", second, first);                // Noncompliant\n                                                                                            // Secondary @-1\n        logger.LogInformation(\"Arg: {First,First} {Second,Second}\", second, first);\n    }\n\n    public void ClassImplementsILogger(CustomLogger logger, int first, int second)\n    {\n        logger.LogInformation(\"Arg: {First} {Second}\", first, second);  // Compliant\n        logger.LogInformation(\"Arg: {First} {Second}\", second, first);  // Noncompliant\n                                                                        // Secondary @-1\n    }\n\n    public void ClassDoesNotImplementILogger(NotILogger notILogger, int first, int second)\n    {\n        notILogger.LogInformation(\"Arg: {First} {Second}\", first, second);\n        notILogger.LogCritical(\"Arg: {First} {Second}\", second, first);\n    }\n}\n\npublic class Person\n{\n    public string FirstName { get; set; }\n    public string LastName { get; set; }\n    public int Age { get; set; }\n    public Person Mother { get; set; }\n    public Person Father { get; set; }\n}\n\npublic class CustomLogger : ILogger\n{\n    public IDisposable BeginScope<TState>(TState state) => null;\n    public bool IsEnabled(LogLevel logLevel) => false;\n    public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)\n    {\n    }\n}\n\npublic class NotILogger\n{\n    public void LogInformation(string message, params object[] args) { }\n}\n\npublic static class NotILoggerExtensions\n{\n    public static void LogCritical(this NotILogger logger, string message, params object[] args) { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LoopsAndLinq.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Linq;\n\nnamespace CSharpEight\n{\n    public class S3267\n    {\n        public void ForEach_PropertySet_Compliant(ICollection<Point> collection)\n        {\n            foreach (var point in collection) // Compliant - Selecting `Y` and setting it's value will not work in this case.\n            {\n                point.Y ??= 3;\n                Console.WriteLine(point.Y);\n            }\n        }\n\n        public void ForEach_UsingDynamic_Compliant(ICollection<Point> collection)\n        {\n            var sum = 0;\n            foreach (dynamic point in collection) // Compliant - with dynamic we cannot know for sure\n            {\n                sum = point.X + point.X + 3;\n            }\n        }\n\n        public class Point\n        {\n            public int X { get; set; }\n            public int? Y { get; set; }\n        }\n\n        void IsPatterns(List<string> strings, List<Tuple<string, int>> tuples)\n        {\n            const string target = \"42\";\n\n            foreach (var s in strings) // Noncompliant\n            {\n                if (s is target) // Secondary\n                {\n                    Console.WriteLine(\"Pattern match successful\");\n                }\n            }\n\n            foreach (var s in strings) // Compliant, do not raise on VarPattern in IsPattern\n            {\n                if (s is var s2)\n                {\n                    Console.WriteLine(\"Pattern match successful\");\n                }\n            }\n\n            foreach (var s in strings)  // Compliant, do not raise when 1 side of a binary expression is invalid\n            {\n                if (s is var s2 && s == \":)\")\n                {\n                    Console.WriteLine(\"Pattern match successful\");\n                }\n            }\n\n            int count = 0;\n            foreach (var s in strings)  // Compliant, do not raise when 1 side of a binary expression is invalid\n            {\n                if (count++ && s == \":)\")  // Error [CS0019] Operator '&&' cannot be applied to operands of type 'int' and 'bool'\n                {\n                    Console.WriteLine(\"Pattern match successful\");\n                }\n            }\n\n            foreach (var s in strings) // Compliant, do not raise on SingleVariableDeclaration in IsPattern\n            {\n                if (s is { Length: 42 } str)\n                {\n                    Console.WriteLine(\"Pattern match successful\");\n                }\n            }\n\n            foreach (var t in tuples) // Compliant, do not raise on ParenthesizedVariableDeclaration in IsPattern\n            {\n                if (t is var (t1, t2))\n                {\n                    Console.WriteLine(\"Pattern match successful\");\n                }\n            }\n        }\n    }\n}\n\nnamespace CSharpEleven\n{\n    class IsPatternTests\n    {\n        void ListPattern(List<int[]> list)\n        {\n            foreach (int[] array in list) // Noncompliant\n            {\n                if (array is [1, 2, 3]) // Secondary\n                {\n                    Console.WriteLine(\"Pattern match successful\");\n                }\n            }\n\n            foreach (var array in list) // Compliant, do not raise on VarPattern in ListPattern\n            {\n                if (array is [1, var x, var z])\n                {\n                    Console.WriteLine(\"Pattern match successful\");\n                }\n\n            }\n\n            foreach (var array in list) // Compliant, do not raise on declaration statements in ListPattern\n            {\n                if (array is [1, ..] local)\n                {\n                    Console.WriteLine(\"Pattern match successful\");\n                }\n\n            }\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/7730\n    class Repro_7730\n    {\n        void SpansAndLogicalPatterns(Span<char> s, ReadOnlySpan<char> ros)\n        {\n            foreach (var c in s)                   // Compliant iterable but not enumerable, nor queriable\n                if (c is ' ') { }\n            foreach (var c in s)                   // Compliant\n                if (c is not ' ') { }\n            foreach (var c in s)                   // Compliant\n                if (c is ' ' or '\\n' or '\\r') { }\n\n            foreach (var c in ros)                 // Compliant\n                if (c is ' ') { }\n            foreach (var c in ros)                 // Compliant\n                if (c is not ' ') { }\n            foreach (var c in ros)                 // Compliant\n                if (c is ' ' or '\\n' or '\\r') { }\n        }\n\n        void SpansAndLogicalOperators(Span<char> s, ReadOnlySpan<char> ros)\n        {\n            foreach (var c in s)                             // Compliant: iterable but not enumerable, nor queriable\n                if (c == ' ') { }\n            foreach (var c in s)                             // Compliant\n                if (c != ' ') { }\n            foreach (var c in s)                             // Compliant\n                if (c == ' ' || c == '\\n' || c == '\\r') { }\n\n            foreach (var c in ros)                           // Compliant\n                if (c == ' ') { }\n            foreach (var c in ros)                           // Compliant\n                if (c != ' ') { }\n            foreach (var c in ros)                           // Compliant\n                if (c == ' ' || c == '\\n' || c == '\\r') { }\n        }\n\n        void IterableNotEnumerableAndLogicalPatterns(IterableNotEnumerable s)\n        {\n            foreach (var c in s)                   // Compliant: iterable but not enumerable, nor queriable\n                if (c is ' ') { }\n            foreach (var c in s)                   // Compliant\n                if (c is not ' ') { }\n            foreach (var c in s)                   // Compliant\n                if (c is ' ' or '\\n' or '\\r') { }\n        }\n\n        void EnumerableNotCollectionAndLogicalPatterns()\n        {\n            foreach (var c in EnumerableNotCollection()) // Noncompliant\n                if (c is ' ') { }                        // Secondary\n            foreach (var c in EnumerableNotCollection()) // Noncompliant\n                if (c is not ' ') { }                    // Secondary\n            foreach (var c in EnumerableNotCollection()) // Noncompliant\n                if (c is ' ' or '\\n' or '\\r') { }        // Secondary\n\n            IEnumerable<char> EnumerableNotCollection()\n            {\n                yield return 'a';\n                yield return 'b';\n            }\n        }\n\n        class IterableNotEnumerable\n        {\n            public IEnumerator<char> GetEnumerator()\n            {\n                yield return 'a';\n                yield return 'b';\n            }\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/7776\n    class Repro_7776\n    {\n        class ForEach_WithCustomList\n        {\n            void Test(CustomList s)\n            {\n                foreach (var c in s)                   // Noncompliant\n                    if (c is ' ') { }                  // Secondary\n                foreach (var c in s)                   // Noncompliant\n                    if (c is not ' ') { }              // Secondary\n                foreach (var c in s)                   // Noncompliant\n                    if (c == ' ') { }                  // Secondary\n                foreach (var c in s)                   // Noncompliant\n                    if (c != ' ') { }                  // Secondary\n            }\n\n            class CustomList : List<char>\n            {\n            }\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/8430\n    class Repro_8430\n    {\n        void Visit(ReadOnlySpan<char> x) { }\n        void Visit(MyRefStruct x) { }\n\n        void Test(IEnumerable<ReadOnlyMemory<char>> tokens)\n        {\n            foreach (ReadOnlyMemory<char> token in tokens) // Compliant\n            {\n                ReadOnlySpan<char> chars = token.Span;\n                Visit(chars);\n            }\n        }\n\n        public class Data\n        {\n            public MyRefStruct RefStruct => new MyRefStruct();\n        }\n\n        public ref struct MyRefStruct\n        {\n\n        }\n\n        void TestRefStruct(IEnumerable<Data> datas)\n        {\n            foreach (Data data in datas) // Compliant\n            {\n                MyRefStruct refStruct = data.RefStruct;\n                Visit(refStruct);\n            }\n        }\n    }\n\n    // https://sonarsource.atlassian.net/browse/NET-3454\n    class Repro_NET3454\n    {\n        // Gap 1: ref struct as invocation argument\n        bool IsMatchArgument(IReadOnlyList<string> segments, ReadOnlySpan<char> value, StringComparison comparison)\n        {\n            foreach (var segment in segments) // Compliant: value is ReadOnlySpan<char> and cannot be captured in a lambda\n            {\n                if (segment.Equals(value, comparison)) return true;\n            }\n            return false;\n        }\n\n        // Gap 2: ref struct as invocation receiver\n        bool IsMatchReceiver(IReadOnlyList<char> chars, ReadOnlySpan<char> span)\n        {\n            foreach (var c in chars) // Compliant: span is a ref struct receiver and cannot be captured in a lambda\n            {\n                if (span.Contains(c)) return true;\n            }\n            return false;\n        }\n\n        // Gap 3: ref struct identifier in binary expression (IdentifierNameSyntax accepted unconditionally)\n        bool IsMatchBinary(IReadOnlyList<string> segments, ReadOnlySpan<char> span)\n        {\n            foreach (var segment in segments) // Compliant: span is a ref struct identifier in a binary expression and cannot be captured in a lambda\n            {\n                if (segment.AsSpan() == span) return true;\n            }\n            return false;\n        }\n\n        // Gap 4: ref struct in if body (assignment + break pattern)\n        ReadOnlySpan<char> FindFirst(IReadOnlyList<string> segments, Predicate<string> predicate)\n        {\n            ReadOnlySpan<char> found = default;\n            foreach (var segment in segments) // Compliant: found is a ref struct assigned in the if body and cannot be captured in a lambda\n            {\n                if (predicate(segment))\n                {\n                    found = segment.AsSpan();\n                    break;\n                }\n            }\n            return found;\n        }\n\n        // Transient ref struct created inside the lambda — not captured from outer scope, so LINQ conversion is valid\n        bool IsMatchTransient(IReadOnlyList<string> segments, string value)\n        {\n            foreach (var segment in segments) // Noncompliant\n            {\n                if (segment.AsSpan().Equals(value, StringComparison.Ordinal)) return true; // Secondary\n            }\n            return false;\n        }\n\n        // ref struct field: accessing a ref struct field requires going through the ref struct instance,\n        // which is itself an identifier of ref struct type — detected by ContainsRefStructReference\n        ref struct SegmentWrapper\n        {\n            public ReadOnlySpan<char> Span;\n        }\n\n        bool IsMatchViaRefStructField(IReadOnlyList<char> chars, SegmentWrapper wrapper)\n        {\n            foreach (var c in chars) // Compliant: wrapper is a ref struct and cannot be captured in a lambda\n            {\n                if (wrapper.Span.Contains(c)) return true;\n            }\n            return false;\n        }\n    }\n}\n\nnamespace CSharp13\n{\n    public class NewMethods\n    {\n        async void WhenEach(List<Task<string>> tasks)\n        {\n            await foreach (var s in Task.WhenEach(tasks)) // Noncompliant IAsyncEnumerable\n            {\n                if (s.Result is \"42\")  // Secondary\n                {\n                    Console.WriteLine(s.Result);\n                }\n            }\n        }\n\n        void IndexTest(List<string> strings)\n        {\n            foreach (var s in strings.Index()) // Noncompliant\n            {\n                if (s is (42, \"42\"))    // Secondary\n                {\n                    Console.WriteLine(s);\n                }\n            }\n        }\n    }\n\n    class ReturnNull\n    {\n        interface IInterface { }\n\n        private IInterface? ReturnNullInterface(IEnumerable<int> enumerable, Predicate<int> predicate)\n        {\n            foreach (var element in enumerable) // Noncompliant\n            {\n                if (predicate(element))         // Secondary\n                {\n                    return null;\n                }\n            }\n\n            return null;\n        }\n\n        private int? ReturnDefault(IEnumerable<int> enumerable, Predicate<int> predicate)\n        {\n            foreach (var element in enumerable) // Noncompliant\n            {\n                if (predicate(element))         // Secondary\n                {\n                    return default;\n                }\n            }\n\n            foreach (var element in enumerable) // Noncompliant\n            {\n                if (predicate(element))         // Secondary\n                {\n                    return null;\n                }\n            }\n\n            return null;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LoopsAndLinq.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Data;\nusing System.Linq;\nusing System.Text;\n\n[AttributeUsage(AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = true, Inherited = false)]\npublic sealed class PerformanceSensitiveAttribute : Attribute\n{\n    public bool AllowGenericEnumeration { get; set; }\n}\n\nnamespace Tests.Diagnostics\n{\n    public class S3267\n    {\n        public bool WithOutArg(string p1, out string p2)\n        {\n            p2 = string.Empty;\n            return true;\n        }\n\n        public bool WithRefArg(string p1, ref string p2) => true;\n\n        public void ForEachWithBlockWithIfSuggestWhere(ICollection<string> collection, Predicate<string> condition, Predicate<int> intCondition)\n        {\n            var result = new List<string>();\n\n            foreach (var element in collection) // Noncompliant {{Loops should be simplified using the \"Where\" LINQ method}}\n            //                      ^^^^^^^^^^\n            {\n                if (condition(element))\n                //  ^^^^^^^^^^^^^^^^^^ Secondary\n                {\n                    result.Add(element);\n                }\n            }\n\n            foreach (var element in collection)\n            {\n                Foo(1);\n                if (condition(element))\n                {\n                    result.Add(element);\n                }\n            }\n\n            foreach (var element in collection)\n            {\n                result.Add(element);\n                if (condition(element)) { }\n            }\n\n            foreach (var element in collection) // Noncompliant\n            {\n                if (condition(element))\n                //  ^^^^^^^^^^^^^^^^^^ Secondary\n                {\n                    if (intCondition(element.Length))\n                        result.Add(element);\n                }\n            }\n\n            foreach (var element in collection.Select(e => e.Length).Where(l => l > 0)) // Noncompliant\n            {\n                if (intCondition(element))\n                //  ^^^^^^^^^^^^^^^^^^^^^ Secondary\n                {\n                }\n            }\n        }\n\n        public void ForEach_ConditionWithOutParameter_Compliant(ICollection<string> collection)\n        {\n            var result = new List<string>();\n\n            foreach (var element in collection) // Compliant due to `out var a`\n            {\n                if (WithOutArg(element, out var a))\n                {\n                    result.Add(a);\n                    result.Add(element);\n                }\n            }\n        }\n\n        public void ForEach_ConditionWithRefParameter_Compliant(ICollection<string> collection, ref string v)\n        {\n            var result = new List<string>();\n\n            foreach (var element in collection) // Compliant due to `ref v`\n            {\n                if (WithRefArg(element, ref v))\n                {\n                    result.Add(element);\n                }\n            }\n        }\n\n        public void ForEach_NoIf_Compliant(ICollection<string> collection)\n        {\n            var builder = new StringBuilder();\n            foreach (var s in collection)\n            {\n                builder.AppendFormat(\"\\n    {0}\", s);\n            }\n        }\n\n        public void ForEach_PropertySet_Compliant(ICollection<Point> collection)\n        {\n            foreach (var point in collection) // Compliant - Selecting `X` and setting it's value will not work in this case.\n            {\n                point.X = point.X + 3;\n            }\n\n            foreach (var point in collection) // Compliant - Selecting `X` and setting it's value will not work in this case.\n            {\n                point.X += point.X + 3;\n            }\n\n            foreach (var point in collection) // Compliant - Selecting `X` and setting it's value will not work in this case.\n            {\n                point.X -= point.X + 3;\n            }\n        }\n\n        public void ForEach_PropertyGet_Compliant(ICollection<Point> collection)\n        {\n            var sum = 0;\n            foreach (var point in collection) // Noncompliant\n            {\n                sum = point.X + point.X + 3;\n            }\n        }\n\n        public void ForEach_IfWithElseBranch_Compliant(ICollection<string> collection, Predicate<string> condition)\n        {\n            var result = new List<string>();\n\n            foreach (var element in collection) // Compliant due to else branch\n            {\n                if (condition(element))\n                {\n                    result.Add(element);\n                }\n                else\n                {\n                    result.Add(string.Empty);\n                }\n            }\n        }\n\n        public void ForEachWithIfSuggestWhere(ICollection<string> collection, Predicate<string> condition)\n        {\n            var result = new List<string>();\n\n            foreach (var element in collection) // Noncompliant {{Loops should be simplified using the \"Where\" LINQ method}}\n            //                      ^^^^^^^^^^\n                if (condition(element))\n                //  ^^^^^^^^^^^^^^^^^^ Secondary\n                {\n                    result.Add(element);\n                }\n        }\n\n        public void ForEachWithPropertyGet_SuggestsSelect(ICollection<string> collection, ICollection<Point> points, int[] values)\n        {\n            var result = new List<int>();\n\n            foreach (var element in collection) // Noncompliant {{Loop should be simplified by calling Select(element => element.Length))}}\n            //                      ^^^^^^^^^^\n            {\n                var someValue = element.Length;\n            }\n\n            foreach (var element in collection) // Compliant: property is used only once and not in an assignment\n            {\n                Foo(element.Length);\n            }\n\n            foreach (var element in collection) // Noncompliant {{Loop should be simplified by calling Select(element => element.Length))}}\n            //                      ^^^^^^^^^^\n            {\n                var someValue = element.Length;\n                if (someValue > 0)\n                {\n                    result.Add(someValue);\n                }\n            }\n\n            foreach (var element in collection) // Noncompliant\n            {\n                var someValue = element.Length;\n                if (someValue != null)\n                {\n                    result.Add(someValue);\n                }\n            }\n\n            foreach (var element in collection) // Compliant: `element` is used\n            {\n                var someValue = element.Length;\n                if (element == \"\") { }\n            }\n\n            foreach (var element in collection) // Compliant: IsNormalized is a method\n            {\n                var someValue = element.IsNormalized();\n            }\n\n            foreach (var element in collection) // Compliant: indexer is used\n            {\n                var someValue = element[0];\n            }\n\n            foreach (var point in points) // Compliant (FN): when multiple properties are used we can suggest a tupple.\n            {\n                var x = point.X;\n                var y = point.Y;\n            }\n\n            foreach (var point in points) // Compliant: we ignore method invocations.\n            {\n                var someValue = point.GetX();\n                if (someValue > 0)\n                {\n                    result.Add(someValue);\n                }\n            }\n\n            var sum = 0;\n            for (int i = 0; i < values.Length; i++) // Compliant (FN): we can suggest `sum = values.Sum();`\n                sum += values[i];\n\n            for (int i = 0; i < values.Length; i++) // Compliant (FN): we can suggest `sum = values.Aggregate(sum, (current, t) => current - t);`\n                sum -= values[i];\n\n            var min = 0;\n            foreach (var t in values)   // Noncompliant\n            {\n                if (min > t)            // Secondary\n                {\n                    min = t;\n                }\n            }\n\n            var max = 0;\n            foreach (var t in values)   // Noncompliant\n            {\n                if (max < t)            // Secondary\n                {\n                    max = t;\n                }\n            }\n\n            bool test = false;\n            foreach (var t in values)   // Noncompliant\n            {\n                if(test)                // Secondary\n                {\n                    test = t == 42;\n                }\n            }\n\n            foreach (var t in values)   // Noncompliant\n            {\n                if (!test)              // Secondary\n                {\n                    test = t == 42;\n                }\n            }\n\n        }\n\n        public void ForEachWithEarlyExitIsNotCompliant(ICollection<string> collection, Predicate<string> condition)\n        {\n            var result = new List<string>();\n\n            foreach (var element in collection) // Noncompliant\n            {\n                if (condition(element))\n                //  ^^^^^^^^^^^^^^^^^^ Secondary\n                {\n                    result.Add(element);\n                    return;\n                }\n            }\n        }\n\n        public void ForEach_Compliant(ICollection<string> collection, ICollection<Point> collection2, Predicate<string> condition)\n        {\n            var result = new List<string>();\n\n            // We could improve the rule suggesting: result.AddRange(collection.Where(x => condition(x)));\n            foreach (var element in collection.Where(x => condition(x)))\n            {\n                result.Add(element);\n            }\n\n            // We could improve the rule suggesting: result.AddRange(collection2.Select(x => x.Property).Where(y => y != null));\n            foreach (var someValue in collection2.Select(x => x.Property).Where(y => y != null))\n            {\n                result.Add(someValue);\n            }\n        }\n\n        public void ForEach_WithLambda(Func<SortedSet<int>> lambda)\n        {\n            foreach (var x in lambda())  // Noncompliant\n                if (x is 0) { }          // Secondary\n        }\n\n        public void ForEach_WithMethod(Func<SortedSet<int>> lambda)\n        {\n            foreach (var x in MethodReturningList())  // Noncompliant\n                if (x is 0) { }                       // Secondary\n        }\n\n        public void ForEach_WithLocalFunction(Func<SortedSet<int>> lambda)\n        {\n            foreach (var x in LocalFunctionReturningList())  // Noncompliant\n                if (x is 0) { }                              // Secondary\n\n            List<int> LocalFunctionReturningList() => new List<int>();\n        }\n\n        public void ForEach_IterableNonEnumerable(DataTable rawSheetData)\n        {\n            var row = rawSheetData.Rows[0];\n            var data = new Dictionary<string, string>();\n            foreach (DataColumn column in rawSheetData.Columns) // Compliant, it does not implement IEnumerable<T>\n            {\n                var datum = Convert.ToString(row[column.ColumnName]);\n                data.Add(column.ColumnName, datum);\n            }\n        }\n\n        public void Print(IEnumerable<Point> points)\n        {\n            foreach (var point in points) // Noncompliant\n            {\n                Console.WriteLine(point.X + \" \" + point.X);\n            }\n        }\n\n        void IsPattern(List<int> list)\n        {\n            foreach (var item in list) // Noncompliant\n            {\n                if (item is 42) // Secondary\n                {\n                    Console.WriteLine(\"The meaning of Life.\");\n                }\n            }\n        }\n\n        private List<int> MethodReturningList() => new List<int>();\n\n        private void Foo(int s) { }\n\n        public class Point\n        {\n            public int X { get; set; }\n            public int? Y { get; set; }\n            public string Property { get; set; }\n\n            public int GetX() => X;\n        }\n    }\n\n    class Repro_7776\n    {\n        // https://github.com/SonarSource/sonar-dotnet/issues/7776\n        public void ForEach_WithListAndLogicalOperators(List<char> s)\n        {\n            foreach (var c in s)                    // Noncompliant\n                if (c == ' ') { }                   // Secondary\n            foreach (var c in s)                    // Noncompliant\n                if (c != ' ') { }                   // Secondary\n            foreach (var c in s)                    // Noncompliant\n                if (c != ' ' || c == ' ' && c != '4') { }       // Secondary\n        }\n    }\n\n    // https://sonarsource.atlassian.net/browse/NET-1222\n    class Repro_1222\n    {\n        public static T? FirstOrNone<T>(IEnumerable<T> enumerable, Predicate<T> predicate) where T : struct\n        {\n            // this could be re-written via LINQ but it isn't obvious:\n            // enumerable.Cast<T?>().FirstOrDefault(x => predicate(x!.Value));\n            foreach (var element in enumerable)\n            {\n                if (predicate(element))\n                {\n                    return element;\n                }\n            }\n            return null;\n        }\n\n        public static T FirstOrNone<T>(IEnumerable<T?> enumerable, Predicate<T?> predicate) where T : struct\n        {\n            foreach (var element in enumerable) // Noncompliant {{Loops should be simplified using the \"Where\" LINQ method}}\n            {\n                if (predicate(element))         // Secondary\n                {\n                    return (T)element;\n                }\n            }\n            return default(T);\n        }\n\n        private static IEnumerable<T> GetEnumerable<T>() { return null; }\n        private static bool Filter<T>(T v) { return true; }\n\n        public static int? LocalFunction()\n        {\n            int? value = null;\n            foreach (var i in GetEnumerable<int>())\n            {\n                if (Filter(i))\n                {\n                    value = i;\n                    break;\n                }\n            }\n            foreach (var element in GetEnumerable<int>())\n            {\n                if (Filter(element))\n                    return element;\n            }\n            return null;\n            int? MyLocalFunction(IEnumerable<int> enumerable, Predicate<int> predicate)\n            {\n                foreach (var element in enumerable)\n                {\n                    if (predicate(element))\n                    {\n                        {\n                            return element;\n                        }\n                    }\n                }\n                return null;\n            }\n        }\n\n        public static int? operator +(Repro_1222 _i1, int _i2)\n        {\n            foreach (var i in GetEnumerable<int>()) // Compliant\n            {\n                if (Filter(i))\n                {\n                    return i;\n                }\n            }\n            return null;\n        }\n\n        public int? Integer\n        {\n            get\n            {\n                foreach (var i in GetEnumerable<int>()) // Compliant\n                {\n                    if (Filter(i))\n                    {\n                        return i;\n                    }\n                }\n                return null;\n            }\n            set\n            {\n                value = null;\n                foreach (var i in GetEnumerable<int>()) // Compliant\n                {\n                    if (Filter(i))\n                    {\n                        value = i;\n                        break;\n                    }\n                }\n            }\n        }\n    }\n\n    class PerformanceSensitive\n    {\n        private static IEnumerable<T> GetEnumerable<T>() { return null; }\n        private static bool Filter<T>(T v) { return true; }\n\n        [PerformanceSensitive]\n        public PerformanceSensitive()\n        {\n            int value = 0;\n            foreach (var i in GetEnumerable<int>())\n            {\n                if (Filter(i))\n                {\n                    value = i;\n                    break;\n                }\n            }\n        }\n\n\n        [PerformanceSensitive]\n        public int Property\n        {\n            get\n            {\n                foreach (var i in GetEnumerable<int>())\n                {\n                    if (Filter(i))\n                    {\n                        return i;\n                    }\n                }\n                return 0;\n            }\n            set\n            {\n                value = 0;\n                foreach (var i in GetEnumerable<int>())\n                {\n                    if (Filter(i))\n                    {\n                        value = i;\n                        break;\n                    }\n                }\n            }\n        }\n\n        [PerformanceSensitive]\n        public static int Method()\n        {\n            foreach (var i in GetEnumerable<int>())\n            {\n                if (Filter(i))\n                {\n                    return i;\n                }\n            }\n            return 0;\n        }\n\n        [PerformanceSensitive(AllowGenericEnumeration = true)]\n        public static int AllowGenericEnumerationTrue()\n        {\n            foreach (var i in GetEnumerable<int>())\n            {\n                if (Filter(i))\n                {\n                    return i;\n                }\n            }\n            return 0;\n        }\n\n        [PerformanceSensitive(AllowGenericEnumeration = false)]\n        public static int AllowGenericEnumerationFalse()\n        {\n            foreach (var i in GetEnumerable<int>()) // Noncompliant\n            {\n                if (Filter(i))                      // Secondary\n                {\n                    return i;\n                }\n            }\n            return 0;\n        }\n\n        [Obsolete(\"Not PerformanceSensitive\")]\n        public static int AnotherAttribute()\n        {\n            foreach (var i in GetEnumerable<int>()) // Noncompliant\n            {\n                if (Filter(i))                      // Secondary\n                {\n                    return i;\n                }\n            }\n            return 0;\n        }\n    }\n\n    class NotNullable\n    {\n        public static T FirstOrNone<T>(IEnumerable<T> enumerable, Predicate<T> predicate) where T : struct\n        {\n            foreach (var element in enumerable) // Noncompliant\n            {\n                if (predicate(element))         // Secondary\n                {\n                    return element;\n                }\n            }\n            return default(T);\n        }\n\n        private static IEnumerable<T> GetEnumerable<T>() { return null; }\n        private static bool Filter<T>(T v) { return true; }\n\n        public static int LocalFunction()\n        {\n            int value = 0;\n            foreach (var i in GetEnumerable<int>()) // Noncompliant\n            {\n                if (Filter(i))                      // Secondary\n                {\n                    value = i;\n                    break;\n                }\n            }\n            foreach (var element in GetEnumerable<int>()) // Noncompliant\n            {\n                if (Filter(element))                      // Secondary\n                    return element;\n            }\n            return 0;\n            int MyLocalFunction(IEnumerable<int> enumerable, Predicate<int> predicate)\n            {\n                foreach (var element in enumerable) // Noncompliant\n                {\n                    if (predicate(element))         // Secondary\n                    {\n                        {\n                            return element;\n                        }\n                    }\n                }\n                return 0;\n            }\n        }\n\n        public static int operator +(NotNullable _i1, int _i2)\n        {\n            foreach (var i in GetEnumerable<int>()) // Noncompliant\n            {\n                if (Filter(i))                      // Secondary\n                {\n                    return i;\n                }\n            }\n            return 0;\n        }\n\n        public int Integer\n        {\n            get\n            {\n                foreach (var i in GetEnumerable<int>()) // Noncompliant\n                {\n                    if (Filter(i))                      // Secondary\n                    {\n                        return i;\n                    }\n                }\n                return 0;\n            }\n            set\n            {\n                value = 0;\n                foreach (var i in GetEnumerable<int>()) // Noncompliant\n                {\n                    if (Filter(i))                      // Secondary\n                    {\n                        value = i;\n                        break;\n                    }\n                }\n            }\n        }\n    }\n\n    class EmptyReturn\n    {\n        public static void MyMethod<T>(IEnumerable<T> enumerable, Predicate<T> predicate) where T : struct\n        {\n            foreach (var element in enumerable) // Noncompliant\n            {\n                if (predicate(element))         // Secondary\n                {\n                    return;\n                }\n            }\n        }\n    }\n\n    class Lambda\n    {\n        private Predicate<Object> LambdaMethod(IEnumerable<int> enumerable, Predicate<int> predicate)\n        {\n            Predicate<Object> lambda = null;\n            foreach (var element in enumerable) // Noncompliant\n            {\n                if (predicate(element))         // Secondary\n                {\n                    lambda = instance => false;\n                    break;\n                }\n            }\n\n            return lambda;\n        }\n    }\n\n    // https://sonarsource.atlassian.net/browse/NET-3520\n    class ReproAD0001\n    {\n        void Method()\n        {\n            foreach (var name in new List<string>())\n            {\n                // \"foo\" is undeclared and the semantic model cannot resolve \"name\" as the loop variable\n                // and GetSymbolInfo(name).Symbol is null\n                _ = foo.name; // Error [CS0103]\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LooseFilePermissions.Unix.cs",
    "content": "﻿using Mono.Unix;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        public void UpdatePermissionsOnUnixUsingMonoPosix()\n        {\n            var fileSystemEntry = UnixFileSystemInfo.GetFileSystemEntry(\"path\");\n\n            fileSystemEntry.FileAccessPermissions = FileAccessPermissions.UserRead;\n            fileSystemEntry.FileAccessPermissions = FileAccessPermissions.UserWrite;\n            fileSystemEntry.FileAccessPermissions = FileAccessPermissions.UserExecute;\n            fileSystemEntry.FileAccessPermissions = FileAccessPermissions.UserReadWriteExecute;\n\n            fileSystemEntry.FileAccessPermissions = FileAccessPermissions.GroupRead;\n            fileSystemEntry.FileAccessPermissions = FileAccessPermissions.GroupWrite;\n            fileSystemEntry.FileAccessPermissions = FileAccessPermissions.GroupExecute;\n            fileSystemEntry.FileAccessPermissions = FileAccessPermissions.GroupReadWriteExecute;\n\n            fileSystemEntry.FileAccessPermissions = FileAccessPermissions.UserRead | FileAccessPermissions.GroupRead;\n\n            fileSystemEntry.FileAccessPermissions = FileAccessPermissions.AllPermissions; // Noncompliant (DefaultPermissions | OtherExecute | GroupExecute | UserExecute, // 0x000001FF)\n            fileSystemEntry.FileAccessPermissions = FileAccessPermissions.DefaultPermissions; // Noncompliant (OtherWrite | OtherRead | GroupWrite | GroupRead | UserWrite | UserRead, // 0x000001B6)\n            fileSystemEntry.FileAccessPermissions = FileAccessPermissions.OtherReadWriteExecute; // Noncompliant\n            fileSystemEntry.FileAccessPermissions = FileAccessPermissions.OtherExecute; // Noncompliant\n            fileSystemEntry.FileAccessPermissions = FileAccessPermissions.OtherWrite; // Noncompliant\n            fileSystemEntry.FileAccessPermissions = FileAccessPermissions.OtherRead; // Noncompliant {{Make sure this permission is safe.}}\n\n            fileSystemEntry.FileAccessPermissions |= FileAccessPermissions.AllPermissions; // Noncompliant (DefaultPermissions | OtherExecute | GroupExecute | UserExecute, // 0x000001FF)\n            fileSystemEntry.FileAccessPermissions |= FileAccessPermissions.DefaultPermissions; // Noncompliant (OtherWrite | OtherRead | GroupWrite | GroupRead | UserWrite | UserRead, // 0x000001B6)\n            fileSystemEntry.FileAccessPermissions |= FileAccessPermissions.OtherReadWriteExecute; // Noncompliant\n            fileSystemEntry.FileAccessPermissions |= FileAccessPermissions.OtherExecute; // Noncompliant\n            fileSystemEntry.FileAccessPermissions |= FileAccessPermissions.OtherWrite; // Noncompliant\n            fileSystemEntry.FileAccessPermissions |= FileAccessPermissions.OtherRead; // Noncompliant\n\n            fileSystemEntry.FileAccessPermissions ^= FileAccessPermissions.AllPermissions; // Noncompliant - depending on the case this might add or remove permissions\n            fileSystemEntry.FileAccessPermissions ^= FileAccessPermissions.DefaultPermissions; // Noncompliant\n            fileSystemEntry.FileAccessPermissions ^= FileAccessPermissions.OtherReadWriteExecute; // Noncompliant\n            fileSystemEntry.FileAccessPermissions ^= FileAccessPermissions.OtherExecute; // Noncompliant\n            fileSystemEntry.FileAccessPermissions ^= FileAccessPermissions.OtherWrite; // Noncompliant\n            fileSystemEntry.FileAccessPermissions ^= FileAccessPermissions.OtherRead; // Noncompliant\n\n            fileSystemEntry.FileAccessPermissions = FileAccessPermissions.UserRead | FileAccessPermissions.GroupRead | FileAccessPermissions.OtherRead; // Noncompliant\n//                                                                                                                                           ^^^^^^^^^\n            UnixFileInfo.GetFileSystemEntry(\"path\").FileAccessPermissions = FileAccessPermissions.AllPermissions; // Noncompliant\n            UnixSymbolicLinkInfo.GetFileSystemEntry(\"path\").FileAccessPermissions = FileAccessPermissions.AllPermissions; // Noncompliant\n\n            if (fileSystemEntry.FileAccessPermissions != FileAccessPermissions.OtherExecute) { }\n            while (fileSystemEntry.FileAccessPermissions != FileAccessPermissions.OtherExecute) { }\n            _ = fileSystemEntry.FileAccessPermissions == FileAccessPermissions.OtherWrite ? 1 : 2;\n\n            fileSystemEntry.FileAccessPermissions = ~((FileAccessPermissions.OtherRead));\n            fileSystemEntry.FileAccessPermissions = ~FileAccessPermissions.OtherRead;\n        }\n    }\n\n    class Base\n    {\n        public Base(FileAccessPermissions permissions) { }\n\n        public Base() : this(FileAccessPermissions.DefaultPermissions) { } // Noncompliant\n//                                                 ^^^^^^^^^^^^^^^^^^\n    }\n\n    class Subclass : Base\n    {\n        public Subclass() : base(FileAccessPermissions.DefaultPermissions) { } // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LooseFilePermissions.Unix.vb",
    "content": "﻿Imports Mono.Unix\n\nPublic Class S2612TestCasesUnix\n    Public Sub UpdatePermissionsOnUnixUsingMonoPosix()\n            Dim fileSystemEntry = UnixFileSystemInfo.GetFileSystemEntry(\"path\")\n\n            fileSystemEntry.FileAccessPermissions = FileAccessPermissions.UserRead\n            fileSystemEntry.FileAccessPermissions = FileAccessPermissions.UserWrite\n            fileSystemEntry.FileAccessPermissions = FileAccessPermissions.UserExecute\n            fileSystemEntry.FileAccessPermissions = FileAccessPermissions.UserReadWriteExecute\n\n            fileSystemEntry.FileAccessPermissions = FileAccessPermissions.GroupRead\n            fileSystemEntry.FileAccessPermissions = FileAccessPermissions.GroupWrite\n            fileSystemEntry.FileAccessPermissions = FileAccessPermissions.GroupExecute\n            fileSystemEntry.FileAccessPermissions = FileAccessPermissions.GroupReadWriteExecute\n\n            fileSystemEntry.FileAccessPermissions = FileAccessPermissions.UserRead OR FileAccessPermissions.GroupRead\n\n            fileSystemEntry.FileAccessPermissions = FileAccessPermissions.AllPermissions ' Noncompliant (DefaultPermissions | OtherExecute | GroupExecute | UserExecute, // 0x000001FF)\n            fileSystemEntry.FileAccessPermissions = FileAccessPermissions.DefaultPermissions ' Noncompliant (OtherWrite | OtherRead | GroupWrite | GroupRead | UserWrite | UserRead, // 0x000001B6)\n            fileSystemEntry.FileAccessPermissions = FileAccessPermissions.OtherReadWriteExecute ' Noncompliant\n            fileSystemEntry.FileAccessPermissions = FileAccessPermissions.OtherExecute ' Noncompliant\n            fileSystemEntry.FileAccessPermissions = FileAccessPermissions.OtherWrite ' Noncompliant\n            fileSystemEntry.FileAccessPermissions = FileAccessPermissions.OtherRead ' Noncompliant {{Make sure this permission is safe.}}\n\n            fileSystemEntry.FileAccessPermissions ^= FileAccessPermissions.AllPermissions ' Noncompliant - depending on the case this might add or remove permissions\n            fileSystemEntry.FileAccessPermissions ^= FileAccessPermissions.DefaultPermissions ' Noncompliant\n            fileSystemEntry.FileAccessPermissions ^= FileAccessPermissions.OtherReadWriteExecute ' Noncompliant\n            fileSystemEntry.FileAccessPermissions ^= FileAccessPermissions.OtherExecute ' Noncompliant\n            fileSystemEntry.FileAccessPermissions ^= FileAccessPermissions.OtherWrite ' Noncompliant\n            fileSystemEntry.FileAccessPermissions ^= FileAccessPermissions.OtherRead ' Noncompliant\n\n            fileSystemEntry.FileAccessPermissions = FileAccessPermissions.UserRead Or FileAccessPermissions.GroupRead Or FileAccessPermissions.OtherRead ' Noncompliant\n'                                                                                                                                              ^^^^^^^^^\n            UnixFileInfo.GetFileSystemEntry(\"path\").FileAccessPermissions = FileAccessPermissions.AllPermissions ' Noncompliant\n            UnixSymbolicLinkInfo.GetFileSystemEntry(\"path\").FileAccessPermissions = FileAccessPermissions.AllPermissions ' Noncompliant\n\n            if fileSystemEntry.FileAccessPermissions <> FileAccessPermissions.OtherExecute\n            End If\n\n            while fileSystemEntry.FileAccessPermissions <> FileAccessPermissions.OtherExecute\n            End While\n    End Sub\n\n    Public Class Base\n        Protected Sub New(permissions As FileAccessPermissions)\n        End Sub\n\n        Public Sub New()\n            Me.New(FileAccessPermissions.DefaultPermissions) ' Noncompliant\n'                                        ^^^^^^^^^^^^^^^^^^\n        End Sub\n    End Class\n\n    Public Class Subclass\n        Inherits Base\n        Sub New()\n            MyBase.New(FileAccessPermissions.DefaultPermissions) ' Noncompliant\n        End Sub\n    End Class\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LooseFilePermissions.Windows.CSharp10.cs",
    "content": "﻿using System;\nusing System.Security.AccessControl;\nusing System.Security.Principal;\n\nconst string compliantPart1 = \"Us\";\nconst string compliantPart2 = \"er\";\nconst string compliant = $\"{compliantPart1}{compliantPart2}\";\nconst string nonCompliantPart1 = \"Ever\";\nconst string nonCompliantPart2 = \"yone\";\nconst string noncompliant = $\"{nonCompliantPart1}{nonCompliantPart2}\";\n\nFileSecurity fileSecurity = null;\n\n\nfileSecurity.SetAccessRule(new (compliant, FileSystemRights.ListDirectory, AccessControlType.Allow));\nfileSecurity.AddAccessRule(new (noncompliant, FileSystemRights.Write, AccessControlType.Allow)); // Noncompliant\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LooseFilePermissions.Windows.CSharp11.cs",
    "content": "﻿using System;\nusing System.Security.AccessControl;\nusing System.Security.Principal;\n\nconst string compliantPart1 = \"\"\"Us\"\"\";\nconst string compliantPart2 = \"\"\"er\"\"\";\nconst string compliant = $\"\"\"{compliantPart1}{compliantPart2}\"\"\";\nconst string nonCompliantPart1 = \"\"\"Ever\"\"\";\nconst string nonCompliantPart2 = \"\"\"yone\"\"\";\nconst string noncompliant = $\"\"\"{nonCompliantPart1}{nonCompliantPart2}\"\"\";\n\nFileSecurity fileSecurity = null;\n\n\nfileSecurity.SetAccessRule(new (compliant, FileSystemRights.ListDirectory, AccessControlType.Allow));\nfileSecurity.AddAccessRule(new (noncompliant, FileSystemRights.Write, AccessControlType.Allow)); // Noncompliant\nfileSecurity.SetAccessRule(new FileSystemAccessRule(\"\"\"Everyone\"\"\", FileSystemRights.Write, AccessControlType.Allow)); // Noncompliant\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LooseFilePermissions.Windows.CSharp12.cs",
    "content": "﻿using System.Security.AccessControl;\n\nclass Program(FileSecurity fileSecurity)\n{\n    const string Everyone = \"Everyone\";\n\n    void UpdatePermissionsUsingAccessControl()\n    {\n        fileSecurity.RemoveAccessRule(new FileSystemAccessRule(Everyone, FileSystemRights.ListDirectory, AccessControlType.Allow));\n        fileSecurity.SetAccessRule(new FileSystemAccessRule(Everyone, FileSystemRights.Write, AccessControlType.Allow)); // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LooseFilePermissions.Windows.CSharp9.cs",
    "content": "﻿using System;\nusing System.Security.AccessControl;\nusing System.Security.Principal;\n\nFileSecurity fileSecurity = null;\nDirectorySecurity directorySecurity = null;\n\nfileSecurity.SetAccessRule(new (\"User\", FileSystemRights.ListDirectory, AccessControlType.Allow));\nfileSecurity.AddAccessRule(new (\"User\", FileSystemRights.ListDirectory, AccessControlType.Allow));\nfileSecurity.AddAccessRule(new (\"User\", FileSystemRights.ListDirectory, AccessControlType.Deny));\nfileSecurity.AddAccessRule(new (\"Everyone\", FileSystemRights.ListDirectory, AccessControlType.Deny));\nfileSecurity.RemoveAccessRule(new (\"Everyone\", FileSystemRights.ListDirectory, AccessControlType.Allow));\nfileSecurity.SetAccessRule(new (\"Everyone\", FileSystemRights.Write, AccessControlType.Allow)); // Noncompliant {{Make sure this permission is safe.}}\nfileSecurity.AddAccessRule(new (\"Everyone\", FileSystemRights.Write, AccessControlType.Allow)); // Noncompliant {{Make sure this permission is safe.}}\n\nvoid InVariable(FileSecurity fileSecurity)\n{\n    FileSystemAccessRule unsafeAccessRule = new (\"Everyone\", FileSystemRights.FullControl, AccessControlType.Allow);\n    //                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary  {{Make sure this permission is safe.}}\n    //                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary@-1  {{Make sure this permission is safe.}}\n\n    fileSecurity.RemoveAccessRule(unsafeAccessRule);\n\n    fileSecurity.AddAccessRule(unsafeAccessRule); // Noncompliant\n    fileSecurity.SetAccessRule(unsafeAccessRule); // Noncompliant\n//  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n    FileSystemAccessRule safeAccessRule = new (\"Everyone\", FileSystemRights.FullControl, AccessControlType.Deny);\n    fileSecurity.AddAccessRule(safeAccessRule);\n    fileSecurity.SetAccessRule(safeAccessRule);\n\n    FileSystemAccessRule rule = new (\"User\", FileSystemRights.Read, AccessControlType.Allow);\n    rule = new (\"Everyone\", FileSystemRights.Read, AccessControlType.Allow);\n\n    fileSecurity.AddAccessRule(rule); // Compliant - FN, we look only at the object creation and don't track state changes.\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LooseFilePermissions.Windows.cs",
    "content": "﻿using System;\nusing System.Security.AccessControl;\nusing System.Security.Principal;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        private const string Everyone = \"Everyone\";\n\n        public void UpdatePermissionsUsingAccessControl(FileSecurity fileSecurity, DirectorySecurity directorySecurity)\n        {\n            fileSecurity.SetAccessRule(new FileSystemAccessRule(\"User\", FileSystemRights.ListDirectory, AccessControlType.Allow));\n            fileSecurity.AddAccessRule(new FileSystemAccessRule(\"User\", FileSystemRights.ListDirectory, AccessControlType.Allow));\n            fileSecurity.AddAccessRule(new FileSystemAccessRule(\"User\", FileSystemRights.ListDirectory, AccessControlType.Deny));\n            fileSecurity.AddAccessRule(new FileSystemAccessRule(\"Everyone\", FileSystemRights.ListDirectory, AccessControlType.Deny));\n            fileSecurity.RemoveAccessRule(new FileSystemAccessRule(\"Everyone\", FileSystemRights.ListDirectory, AccessControlType.Allow));\n            fileSecurity.SetAccessRule(new FileSystemAccessRule(\"Everyone\", FileSystemRights.Write, AccessControlType.Allow)); // Noncompliant\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            fileSecurity.AddAccessRule(new FileSystemAccessRule(\"Everyone\", FileSystemRights.Write, AccessControlType.Allow)); // Noncompliant\n\n            fileSecurity.SetAccessRule(new FileSystemAccessRule(\"User\", FileSystemRights.FullControl, InheritanceFlags.None, PropagationFlags.None, AccessControlType.Allow));\n            fileSecurity.AddAccessRule(new FileSystemAccessRule(\"User\", FileSystemRights.FullControl, InheritanceFlags.None, PropagationFlags.None, AccessControlType.Allow));\n            fileSecurity.AddAccessRule(new FileSystemAccessRule(\"User\", FileSystemRights.FullControl, InheritanceFlags.None, PropagationFlags.None, AccessControlType.Deny));\n            fileSecurity.AddAccessRule(new FileSystemAccessRule(\"Everyone\", FileSystemRights.FullControl, InheritanceFlags.None, PropagationFlags.None, AccessControlType.Deny));\n            fileSecurity.RemoveAccessRule(new FileSystemAccessRule(\"Everyone\", FileSystemRights.FullControl, InheritanceFlags.None, PropagationFlags.None, AccessControlType.Allow));\n            fileSecurity.SetAccessRule(new FileSystemAccessRule(\"Everyone\", FileSystemRights.FullControl, InheritanceFlags.None, PropagationFlags.None, AccessControlType.Allow)); // Noncompliant\n            fileSecurity.AddAccessRule(new FileSystemAccessRule(\"Everyone\", FileSystemRights.FullControl, InheritanceFlags.None, PropagationFlags.None, AccessControlType.Allow)); // Noncompliant\n\n            fileSecurity.AddAccessRule(new FileSystemAccessRule(\"Everyone\", FileSystemRights.Read | FileSystemRights.Write, AccessControlType.Allow)); // Noncompliant\n            fileSecurity.SetAccessRule(new FileSystemAccessRule(\"Everyone\", FileSystemRights.Read | FileSystemRights.Write, AccessControlType.Allow)); // Noncompliant\n            fileSecurity.AddAccessRule(new FileSystemAccessRule(Everyone, FileSystemRights.FullControl, AccessControlType.Allow)); // Noncompliant\n            fileSecurity.SetAccessRule(new FileSystemAccessRule(Everyone, FileSystemRights.FullControl, AccessControlType.Allow)); // Noncompliant\n\n            fileSecurity.AddAccessRule(new FileSystemAccessRule(new NTAccount(\"Everyone\"), FileSystemRights.FullControl, AccessControlType.Allow)); // Noncompliant\n            fileSecurity.AddAccessRule(new FileSystemAccessRule(Everyone, FileSystemRights.FullControl, InheritanceFlags.ContainerInherit, PropagationFlags.None, AccessControlType.Allow)); // Noncompliant\n            fileSecurity.AddAccessRule(new FileSystemAccessRule(new NTAccount(Everyone), FileSystemRights.FullControl, InheritanceFlags.ContainerInherit, PropagationFlags.None, AccessControlType.Allow)); // Noncompliant\n\n            fileSecurity.AddAccessRule(new FileSystemAccessRule(new SecurityIdentifier(WellKnownSidType.WorldSid, null), FileSystemRights.Modify, AccessControlType.Allow)); // Noncompliant\n\n            directorySecurity.SetAccessRule(new FileSystemAccessRule(\"User\", FileSystemRights.Write, AccessControlType.Allow));\n            directorySecurity.AddAccessRule(new FileSystemAccessRule(\"User\", FileSystemRights.Write, AccessControlType.Allow));\n            directorySecurity.AddAccessRule(new FileSystemAccessRule(\"User\", FileSystemRights.Write, AccessControlType.Deny));\n            directorySecurity.AddAccessRule(new FileSystemAccessRule(\"Everyone\", FileSystemRights.Write, AccessControlType.Deny));\n            directorySecurity.RemoveAccessRule(new FileSystemAccessRule(\"Everyone\", FileSystemRights.Write, AccessControlType.Allow));\n            directorySecurity.AddAccessRule(new FileSystemAccessRule(\"Everyone\", FileSystemRights.Write, AccessControlType.Allow)); // Noncompliant\n            directorySecurity.SetAccessRule(new FileSystemAccessRule(\"Everyone\", FileSystemRights.Write, AccessControlType.Allow)); // Noncompliant\n        }\n\n        public void InVariable(FileSecurity fileSecurity)\n        {\n            var unsafeAccessRule = new FileSystemAccessRule(\"Everyone\", FileSystemRights.FullControl, AccessControlType.Allow);\n//                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary\n//                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary@-1\n            fileSecurity.RemoveAccessRule(unsafeAccessRule);\n\n            fileSecurity.AddAccessRule(unsafeAccessRule); // Noncompliant\n            fileSecurity.SetAccessRule(unsafeAccessRule); // Noncompliant\n\n            var safeAccessRule = new FileSystemAccessRule(\"Everyone\", FileSystemRights.FullControl, AccessControlType.Deny);\n            fileSecurity.AddAccessRule(safeAccessRule);\n            fileSecurity.SetAccessRule(safeAccessRule);\n\n            var rule = new FileSystemAccessRule(\"User\", FileSystemRights.Read, AccessControlType.Allow);\n            rule = new FileSystemAccessRule(\"Everyone\", FileSystemRights.Read, AccessControlType.Allow);\n\n            fileSecurity.AddAccessRule(rule); // Compliant - FN, we look only at the object creation and don't track state changes.\n        }\n\n        public void InsideTryCatch(FileSecurity fileSecurity)\n        {\n            var rule = new FileSystemAccessRule(\"Everyone\", FileSystemRights.Read, AccessControlType.Allow);\n//                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary\n\n            try\n            {\n                fileSecurity.AddAccessRule(rule); // Noncompliant\n            }\n            catch { }\n        }\n\n        private void InsideLocalFunction(FileSecurity fileSecurity)\n        {\n            var rule = new FileSystemAccessRule(\"Everyone\", FileSystemRights.Read, AccessControlType.Allow);\n//                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary\n\n            void LocalFunction()\n            {\n                fileSecurity.AddAccessRule(rule); // Noncompliant\n            }\n        }\n\n        private void InsideLambda(FileSecurity fileSecurity)\n        {\n            Func<FileSystemAccessRule> ruleFactory = () => new FileSystemAccessRule(\"Everyone\", FileSystemRights.Read, AccessControlType.Allow);\n\n            fileSecurity.AddAccessRule(ruleFactory()); // Compliant - FN, not supported\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LooseFilePermissions.Windows.vb",
    "content": "﻿Imports System.Security.AccessControl\nImports System.Security.Principal\n\nPublic Class S2612TestCasesWindows\n    Const Everyone = \"Everyone\"\n\n    Public Sub UpdatePermissionsUsingAccessControl(fileSecurity as FileSecurity, directorySecurity as DirectorySecurity)\n            fileSecurity.SetAccessRule(new FileSystemAccessRule(\"User\", FileSystemRights.ListDirectory, AccessControlType.Allow))\n            fileSecurity.AddAccessRule(new FileSystemAccessRule(\"User\", FileSystemRights.ListDirectory, AccessControlType.Allow))\n            fileSecurity.AddAccessRule(new FileSystemAccessRule(\"User\", FileSystemRights.ListDirectory, AccessControlType.Deny))\n            fileSecurity.AddAccessRule(new FileSystemAccessRule(\"Everyone\", FileSystemRights.ListDirectory, AccessControlType.Deny))\n            fileSecurity.RemoveAccessRule(new FileSystemAccessRule(\"Everyone\", FileSystemRights.ListDirectory, AccessControlType.Allow))\n            fileSecurity.SetAccessRule(new FileSystemAccessRule(\"Everyone\", FileSystemRights.Write, AccessControlType.Allow)) ' Noncompliant\n'           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            fileSecurity.AddAccessRule(new FileSystemAccessRule(\"Everyone\", FileSystemRights.Write, AccessControlType.Allow)) ' Noncompliant\n\n            fileSecurity.SetAccessRule(new FileSystemAccessRule(\"User\", FileSystemRights.FullControl, InheritanceFlags.None, PropagationFlags.None, AccessControlType.Allow))\n            fileSecurity.AddAccessRule(new FileSystemAccessRule(\"User\", FileSystemRights.FullControl, InheritanceFlags.None, PropagationFlags.None, AccessControlType.Allow))\n            fileSecurity.AddAccessRule(new FileSystemAccessRule(\"User\", FileSystemRights.FullControl, InheritanceFlags.None, PropagationFlags.None, AccessControlType.Deny))\n            fileSecurity.AddAccessRule(new FileSystemAccessRule(\"Everyone\", FileSystemRights.FullControl, InheritanceFlags.None, PropagationFlags.None, AccessControlType.Deny))\n            fileSecurity.RemoveAccessRule(new FileSystemAccessRule(\"Everyone\", FileSystemRights.FullControl, InheritanceFlags.None, PropagationFlags.None, AccessControlType.Allow))\n            fileSecurity.SetAccessRule(new FileSystemAccessRule(\"Everyone\", FileSystemRights.FullControl, InheritanceFlags.None, PropagationFlags.None, AccessControlType.Allow)) ' Noncompliant\n            fileSecurity.AddAccessRule(new FileSystemAccessRule(\"Everyone\", FileSystemRights.FullControl, InheritanceFlags.None, PropagationFlags.None, AccessControlType.Allow)) ' Noncompliant\n\n            fileSecurity.AddAccessRule(new FileSystemAccessRule(\"Everyone\", FileSystemRights.Read Or FileSystemRights.Write, AccessControlType.Allow)) ' Noncompliant\n            fileSecurity.SetAccessRule(new FileSystemAccessRule(\"Everyone\", FileSystemRights.Read Or FileSystemRights.Write, AccessControlType.Allow)) ' Noncompliant\n            fileSecurity.AddAccessRule(new FileSystemAccessRule(Everyone, FileSystemRights.FullControl, AccessControlType.Allow)) ' Noncompliant\n            fileSecurity.SetAccessRule(new FileSystemAccessRule(Everyone, FileSystemRights.FullControl, AccessControlType.Allow)) ' Noncompliant\n\n            fileSecurity.AddAccessRule(new FileSystemAccessRule(new NTAccount(\"Everyone\"), FileSystemRights.FullControl, AccessControlType.Allow)) ' Noncompliant\n            fileSecurity.AddAccessRule(new FileSystemAccessRule(Everyone, FileSystemRights.FullControl, InheritanceFlags.ContainerInherit, PropagationFlags.None, AccessControlType.Allow)) ' Noncompliant\n            fileSecurity.AddAccessRule(new FileSystemAccessRule(new NTAccount(Everyone), FileSystemRights.FullControl, InheritanceFlags.ContainerInherit, PropagationFlags.None, AccessControlType.Allow)) ' Noncompliant\n\n            fileSecurity.AddAccessRule(new FileSystemAccessRule(new SecurityIdentifier(WellKnownSidType.WorldSid, Nothing), FileSystemRights.Modify, AccessControlType.Allow)) ' Noncompliant\n\n            directorySecurity.SetAccessRule(new FileSystemAccessRule(\"User\", FileSystemRights.Write, AccessControlType.Allow))\n            directorySecurity.AddAccessRule(new FileSystemAccessRule(\"User\", FileSystemRights.Write, AccessControlType.Allow))\n            directorySecurity.AddAccessRule(new FileSystemAccessRule(\"User\", FileSystemRights.Write, AccessControlType.Deny))\n            directorySecurity.AddAccessRule(new FileSystemAccessRule(\"Everyone\", FileSystemRights.Write, AccessControlType.Deny))\n            directorySecurity.RemoveAccessRule(new FileSystemAccessRule(\"Everyone\", FileSystemRights.Write, AccessControlType.Allow))\n            directorySecurity.AddAccessRule(new FileSystemAccessRule(\"Everyone\", FileSystemRights.Write, AccessControlType.Allow)) ' Noncompliant {{Make sure this permission is safe.}}\n            directorySecurity.SetAccessRule(new FileSystemAccessRule(\"Everyone\", FileSystemRights.Write, AccessControlType.Allow)) ' Noncompliant {{Make sure this permission is safe.}}\n    End Sub\n\n    Public Sub InVariable(fileSecurity As FileSecurity)\n        Dim unsafeAccessRule = new FileSystemAccessRule(\"Everyone\", FileSystemRights.FullControl, AccessControlType.Allow)\n'                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary    {{Make sure this permission is safe.}}\n'                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary@-1 {{Make sure this permission is safe.}}\n        fileSecurity.RemoveAccessRule(unsafeAccessRule)\n\n        fileSecurity.AddAccessRule(unsafeAccessRule) ' Noncompliant\n        fileSecurity.SetAccessRule(unsafeAccessRule) ' Noncompliant\n\n        Dim safeAccessRule = new FileSystemAccessRule(\"Everyone\", FileSystemRights.FullControl, AccessControlType.Deny)\n        fileSecurity.AddAccessRule(safeAccessRule)\n        fileSecurity.SetAccessRule(safeAccessRule)\n\n        Dim rule = new FileSystemAccessRule(\"User\", FileSystemRights.Read, AccessControlType.Allow)\n        rule = new FileSystemAccessRule(\"Everyone\", FileSystemRights.Read, AccessControlType.Allow)\n\n        fileSecurity.AddAccessRule(rule) ' Compliant - FN, we look only at the object creation and don't track state changes.\n    End Sub\n\n    Public Sub InsideTryCatch(fileSecurity As FileSecurity)\n        Dim rule = new FileSystemAccessRule(\"Everyone\", FileSystemRights.Read, AccessControlType.Allow)\n'                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary\n        Try\n            fileSecurity.AddAccessRule(rule) ' Noncompliant\n        Catch\n        End Try\n    End Sub\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LossOfFractionInDivision.Latest.cs",
    "content": "﻿using System;\nusing System.Threading.Tasks;\n\ndecimal dec = 3 / 2;    // Noncompliant\ndec = 3L / 2;           // Noncompliant\nMethod(3 / 2);          // Noncompliant\ndec = (decimal)3 / 2;\nMethod(3.0F / 2);\n\nnint a = 3;\nnint b = 2;\nnuint c = 5;\ndecimal both = a / b;           // Noncompliant\ndecimal left = (nint)3 / 2;     // Noncompliant\ndecimal right = 3 / (nint)2;    // Noncompliant\nleft = c / 2;                   // Noncompliant\nleft = (nuint)3 / 2;            // Noncompliant\nMethod((nint)3 / 2);            // Noncompliant\n\nright = (decimal)3 / b;         // Compliant\nMethod(3.0F / b);               // Compliant\n\nleft = (UnknownType)3 / 2;      // Error [CS0246]\n\nvoid Method(float f) { }\n\nstatic double Calc()\n{\n    return (nint)3 / 2;     // Noncompliant\n}\n\npublic class Sample\n{\n    public decimal Property { get; set; }\n\n    public void M()\n    {\n        (Property, var _) = (3 / 2, 3 / 2);    // Noncompliant {{Cast one of the operands of this division to 'decimal'.}}\n//                           ^^^^^\n\n        (decimal x, var y) = (1 / 3, 2);      // Noncompliant\n        (decimal xx, var (yy, zz)) = (1 / 3, (2, 1 / 3)); // Noncompliant\n        (decimal xxx, var (yyy, zzz)) = (1, (2, 1 / 3));\n        (decimal xxxx, var (yyyy, zzzz)) = (1, (2, 1 / 3)); // FN\n\n\n        var (a, b) = (1 / 3, 2);\n        var (a1, (b1, c1)) = (1, (1 / 3, 2));\n        var d = (1 / 3, 2);\n        (int, int) d2 = (1 / 3, 2);\n        (decimal, decimal) d3 = (1 / 3, 2); // Noncompliant\n        (int, (decimal, (int, decimal))) nested = (3, (1 / 3, (0, 1 / 3)));\n        //                                             ^^^^^ {{Cast one of the operands of this division to 'decimal'.}}\n        //                                                        ^^^^^ @-1 {{Cast one of the operands of this division to 'decimal'.}}\n\n        (decimal, decimal) d4 = (1 / 3, 2); // Noncompliant\n        (decimal, decimal) d5 = (1 / 3, 1 / 3); // Noncompliant [issue3, issue4]\n        (decimal d6, decimal d7) = (1 / 3, 1 / 3); // Noncompliant [issue5, issue6]\n\n        var bar = (1, FooDecimal(1 / 3)); // Noncompliant\n\n        (int, decimal) fooBar;\n        fooBar = (1, FooDecimal(1 / 3)); // Noncompliant\n\n        var p1 = 1;\n        var p2 = 2;\n        (int, decimal) result = (1, p1 / p2); // Noncompliant\n\n        (int, ValueTuple<int, int>) vt = (1, (1 / 3, 3)); // FN\n        (int, (int, int)) vt1 = (1, 1 / 3, 3); // Error [CS0029]\n\n        decimal FooDecimal(decimal d)\n        {\n            return d;\n        }\n\n        bar = (1, FooInt(1 / 3));\n\n        fooBar = (1, FooInt(1 / 3));\n\n        int FooInt(int d)\n        {\n            return d;\n        }\n    }\n\n    public decimal M(int x) => x;\n    public decimal M((int, int) x) => x.Item1;\n\n    public void FNs()\n    {\n        var a = M(1 / 3);\n        decimal a2 = 1 / 3 == 1 ? 1 / 3 : 1 / 3; // FN\n        (decimal, decimal) a5 = (1, M(1 / 3)); // FN\n        (decimal, decimal) a6 = (1, 1 / 3 + 1 / 3); // FN\n        var a9 = M((1, 1 / 3)); // FN\n    }\n\n    public async Task FNAsync()\n    {\n        decimal a4 = await Task.FromResult(1 / 3); // FN\n    }\n\n}\n\npublic class NativeIntChecks\n{\n    decimal result;\n    Func<decimal> decimalFunc;\n\n    IntPtr intPtr1 = 2;\n    IntPtr intPtr2 = 3;\n\n    UIntPtr uIntPtr1 = 2;\n    UIntPtr uIntPtr2 = 3;\n\n    nint nint1 = 2;\n    nint nint2 = 3;\n\n    nuint nuint1 = 2;\n    nuint nuint2 = 3;\n\n    void AssignmentChecks()\n    {\n        result = intPtr1 / intPtr2; // Noncompliant\n        result = uIntPtr1 / uIntPtr2; // Noncompliant\n        result = nint1 / nint2;  // Noncompliant\n        result = nuint1 / nuint2; // Noncompliant\n        result = intPtr1 / nint1; // Noncompliant\n        result = nint1 / intPtr1; // Noncompliant\n        result = uIntPtr1 / nuint1; // Noncompliant\n        result = nuint1 / uIntPtr1; // Noncompliant\n\n        result = (decimal)intPtr1 / intPtr2; // Compliant\n        result = (decimal)uIntPtr1 / uIntPtr2; // Compliant\n        result = (decimal)nint1 / nint2;  // Compliant\n        result = (decimal)nuint1 / nuint2; // Compliant\n        result = (decimal)intPtr1 / nint1; // Compliant\n        result = (decimal)nint1 / intPtr1; // Compliant\n        result = (decimal)uIntPtr1 / nuint1; // Compliant\n        result = (decimal)nuint1 / uIntPtr1; // Compliant\n    }\n\n    void MethodArgumentChecks()\n    {\n        MethodAcceptingDecimal(intPtr1 / intPtr2); // Noncompliant\n        MethodAcceptingDecimal(uIntPtr1 / uIntPtr2); // Noncompliant\n\n        MethodAcceptingDecimal((decimal)intPtr1 / intPtr2); // Compliant\n        MethodAcceptingDecimal((decimal)uIntPtr1 / uIntPtr2); // Compliant\n\n        decimal MethodAcceptingDecimal(decimal arg) => arg;\n    }\n\n    void FuncReturnChecks()\n    {\n        decimalFunc = () => intPtr1 / intPtr2; // Noncompliant\n        decimalFunc = () => uIntPtr1 / uIntPtr2; // Noncompliant\n\n        decimalFunc = () => (decimal)intPtr1 / intPtr2; // Compliant\n        decimalFunc = () => (decimal)uIntPtr1 / uIntPtr2; // Compliant\n    }\n\n    decimal MethodReturnChecks()\n    {\n        return intPtr1 / intPtr2; // Noncompliant\n        return uIntPtr1 / uIntPtr2; // Noncompliant\n\n        return (decimal)intPtr1 / intPtr2; // Compliant\n        return (decimal)uIntPtr1 / uIntPtr2; // Compliant\n    }\n}\n\ninterface IMyInterface\n{\n    static virtual void StaticVirtualMethod()\n    {\n        decimal dec = 3 / 2; // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/LossOfFractionInDivision.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Tests.TestCases\n{\n    class LossOfFractionInDivision\n    {\n        static void Main()\n        {\n            decimal dec = 3 / 2; // Noncompliant\n//                        ^^^^^\n            dec = 3L / 2; // Noncompliant\n            Method(3 / 2); // Noncompliant\n            dec = (decimal)3 / 2;\n            Method(3.0F / 2);\n\n            Action<float> a = (f) => { };\n            a(3 / 2); // Noncompliant\n\n            ((Action<float>)(f => { }))(3 / 2); // Noncompliant {{Cast one of the operands of this division to 'float'.}}\n        }\n\n        static void Method(float f) { }\n\n        static double Calc()\n        {\n            Func<float> f = () => { return 3 / 2; }; // Noncompliant\n            f = () => 3 / 2; // Noncompliant\n            var x = 3 / 2;\n            return 3 / 2; // Noncompliant\n        }\n\n        static double GetCalc\n        {\n            get\n            {\n                return 3 / 2; // Noncompliant\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MagicNumberShouldNotBeUsed.CSharp11.cs",
    "content": "﻿using System;\n\nvar arg = new nint(42); // Compliant, variable declaration\nFoo(new nint(42)); // Compliant, constructor\n\nfor (nint i = 42; i < 420; i++) // Noncompliant\n{ }\n\nfor (nuint i = 42; i < 420; i++) // Noncompliant\n{ }\n\nfor (IntPtr i = 42; i < 420; i++) // Noncompliant\n{ }\n\nfor (UIntPtr i = 42; i < 420; i++) // Noncompliant\n{ }\n\nvoid Foo(nint v) { }\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MagicNumberShouldNotBeUsed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Tests.Diagnostics\n{\n    [AttributeUsage(AttributeTargets.Method, Inherited = false)]\n    public class FooAttribute : Attribute\n    {\n        public int Baz { get; set; }\n        public FooAttribute(int Bar = 0, int Bar2 = 0)\n        {\n        }\n    }\n\n    public class FooBar\n    {\n        public int Size { get; set; }\n        public int COUNT { get; set; }\n        public int length { get; set; }\n        public int baz { get; set; }\n        public FooBar fooBar { get; set; }\n        public FooBar GetFooBar() => null;\n        public int Count() => 0;\n        public FooBar Length() => null; // for coverage\n    }\n\n    public class Baz\n    {\n        public int Size() => 1;\n    }\n\n    public class ValidUseCases\n    {\n        private const int MAGIC = 42;\n        private IntPtr Pointer = new IntPtr(19922); // Compliant, store in field\n        public readonly int MY_VALUE = 25;\n        const int ONE_YEAR_IN_SECONDS = 31_557_600;\n        static readonly int ReadOnlyValue = Bar(999); // Compliant as stored in static readonly\n\n        public int A { get; set; } = 2;\n\n        public static double FooProp\n        {\n            get { return 2; }\n        }\n\n        public static double FooProp2\n        {\n            get\n            {\n                var someName = Math.Sqrt(4096); // Compliant, stored in a variable\n                return someName;\n            }\n        }\n\n        public ValidUseCases(int x, int y) { }\n\n        public ValidUseCases(string s, FooBar foo, Baz baz)\n        {\n            int i1 = 0;\n            int i2 = -1;\n            int i3 = 1;\n            int i4 = 42;\n            var list = new List<string>(42); // Compliant, set to variable\n            var bigInteger = new IntPtr(1612342); // compliant, set to variable\n            var g = new Guid(0xA, 0xB, 0xC, new Byte[] { 0, 1, 2, 3, 4, 5, 6, 7 }); // Compliant, set to a variable\n            var valid = new ValidUseCases(100, 300);\n            var fooResult = Bar(42, Bar(110, Bar(233, 23454, Bar(999)))); // FN https://github.com/SonarSource/sonar-dotnet/issues/5251\n            Foo(new IntPtr(123456)); // compliant, constructor\n\n            long[] values1 = { 30L, 40L }; // Compliant, set to variable\n            int[] values2 = new int[] { 100, 200 }; // Compliant, set to variable\n            Console.WriteLine(value: 12); // Compliant, named argument\n\n            for (int i = 0; i < 0; i++) { }\n\n            var result = list.Count == 1; // Compliant, single digit for Count\n            result = list.Count < 2; // Compliant\n            result = list.Count <= 2; // Compliant\n            result = 2 <= list.Count; // Compliant\n            result = list.Count != 2; // Compliant\n            result = list.Count > 2; // Compliant\n            result = list.Count() > 2; // Compliant\n            result = s.Length == 3; // Compliant, single digit for Length\n            result = foo.Size == 4; // Compliant, single digit for Size\n            result = baz.Size() == 7; // tolerated FN\n            result = foo.fooBar.fooBar.fooBar.Size == 4; // Compliant\n            result = foo.GetFooBar().fooBar.fooBar.GetFooBar().Count() == 4; // possible FN, we don't check if Count() is from LINQ to be efficient\n\n            WithTimeSpan(TimeSpan.FromDays(1), TimeSpan.FromMilliseconds(33)); // compliant\n\n            const int VAL = 15;\n\n            Console.Write(\"test\");\n        }\n\n        public override int GetHashCode()\n        {\n            return MY_VALUE * 397;\n        }\n\n        [Foo(Bar: 42)] // Compliant, explicit attribute argument names\n        public void Foo1() { }\n\n        [Foo(Baz = 43)] // Compliant, explicit attribute argument names\n        public void Foo2() { }\n\n        [Foo(Bar: 42, Baz = 43)] // Compliant, explicit attribute argument names\n        public void Foo3() { }\n\n        public void Foo(int value = 42) // compliant, default value for argument\n        {\n            var x = -1 < 1;\n        }\n\n        public static void Foo(IntPtr x) { }\n\n        [Foo(42)] // Compliant, attribute with only one argument\n        public static int Bar(int value, params int[] values) => 0;\n\n        public static void WithTimeSpan(TimeSpan one, TimeSpan two) { }\n    }\n\n    public enum MyEnum\n    {\n        Value1 = 1,\n        Value2 = 2,\n        Value3 = 3\n    }\n\n    public class WrongUseCases\n    {\n        public static double FooProp\n        {\n            get { return Math.Sqrt(4); } // Noncompliant {{Assign this magic number '4' to a well-named variable or constant, and use that instead.}}\n//                                 ^\n        }\n\n        public WrongUseCases(int x, int y) { }\n\n        public WrongUseCases(List<int> list, string s, FooBar foo)\n        {\n            Console.WriteLine(12); // Noncompliant {{Assign this magic number '12' to a well-named variable or constant, and use that instead.}}\n\n            for (int i = 10; i < 50; i++) // Noncompliant {{Assign this magic number '50' to a well-named variable or constant, and use that instead.}}\n            {\n\n            }\n\n            var array = new string[10];\n            array[5] = \"test\"; // Noncompliant {{Assign this magic number '5' to a well-named variable or constant, and use that instead.}}\n            Foo(new int[] { 100 }); // Noncompliant\n\n            new WrongUseCases(100, Foo(200, 300)); // Noncompliant {{Assign this magic number '200' to a well-named variable or constant, and use that instead.}}\n            // Noncompliant@-1 {{Assign this magic number '300' to a well-named variable or constant, and use that instead.}}\n\n            Foo(new int[] { 100, 200 }); // Noncompliant {{Assign this magic number '100' to a well-named variable or constant, and use that instead.}}\n            // Noncompliant@-1 {{Assign this magic number '200' to a well-named variable or constant, and use that instead.}}\n\n            GetSomeFrom(42); // Noncompliant\n\n            for (int i = 0; i < list.Count / 8; i++) { } // Noncompliant\n\n            var result = list.Count == 99;\n            result = list.Count < 400; // Noncompliant\n            result = s.Length == 121; // Noncompliant\n            result = foo.Size == 472; // Noncompliant\n            result = foo.baz == 4; // Noncompliant\n            result = s.Length == list.Count / 2 ; // Noncompliant FP - clear it's checking if it's half the list\n\n            result = foo.COUNT == 8; // Noncompliant\n            result = foo.length == 9; // Noncompliant\n            result = GetCount() < 9; // Noncompliant\n            result = SizeOfSomething == 5; // Noncompliant\n            // for coverage\n            result = foo.Length().fooBar.length == 4; // Noncompliant\n\n            var x = 1;\n            result = x == 2; // Noncompliant\n            Foo(foo.Size + 41, s.Length - 43, list.Count * 2, list.Count / 8); // Noncompliant\n            // Noncompliant@-1\n            // Noncompliant@-2\n            // Noncompliant@-3\n        }\n\n        [Foo(42, 43)] // Noncompliant\n        // Noncompliant@-1\n        public int GetValue()\n        {\n            return 13; // Noncompliant\n        }\n\n        public int GetCount() => 1;\n        public int SizeOfSomething { get; } = 1;\n\n        public static void Foo(params int[] array) { }\n        public static int Foo(int x, int y) => 1;\n        public static void GetSomeFrom(int value) { }\n    }\n}\n\n#pragma warning disable 1998 //async method lacks an await\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MarkAssemblyWithAssemblyVersionAttribute.cs",
    "content": "﻿using System.Reflection;\n\n[assembly: AssemblyVersionAttribute(\"1.24.0\")]\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MarkAssemblyWithAssemblyVersionAttribute.vb",
    "content": "﻿Imports System.Reflection\n\n<Assembly: AssemblyVersionAttribute(\"1.24.0\")>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MarkAssemblyWithAssemblyVersionAttributeNoncompliant.cs",
    "content": "﻿// Noncompliant ^1#0 {{Provide an 'AssemblyVersion' attribute for assembly 'project0'.}}\nusing System.Reflection;\n\n[assembly: AssemblyCompany(\"SonarSource\")]\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MarkAssemblyWithAssemblyVersionAttributeNoncompliant.vb",
    "content": "﻿' Noncompliant ^1#0 {{Provide an 'AssemblyVersion' attribute for assembly 'project0'.}}\nImports System.Reflection\n\n<Assembly: AssemblyCompany(\"SonarSource\")>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MarkAssemblyWithAssemblyVersionAttributeRazor.cs",
    "content": "﻿using System.Reflection;\nusing Microsoft.AspNetCore.Razor.Hosting;\n\n[assembly: AssemblyCompany(\"SonarSource\")]\n// We should not raise on Razor ProjectName.Views.dll auto-generated assemblies\n[assembly: RazorCompiledItem(typeof(Sample), \"mvc.1.0.view\", \"@/Views/Fake/Index.cshtml\")]\n\npublic class Sample { }\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MarkAssemblyWithAssemblyVersionAttributeRazor.vb",
    "content": "﻿Imports System.Reflection\nImports Microsoft.AspNetCore.Razor.Hosting\n\n<Assembly: AssemblyCompany(\"SonarSource\")>\n' https://github.com/SonarSource/sonar-dotnet/issues/2921\n' We should not raise on Razor ProjectName.Views.dll auto-generated assemblies\n<Assembly: RazorCompiledItem(GetType(Sample), \"mvc.1.0.view\", \"@/Views/Fake/Index.cshtml\")>\n\nPublic Class Sample\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MarkAssemblyWithClsCompliantAttribute.cs",
    "content": "﻿using System;\n\n[assembly: CLSCompliant(false)]\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MarkAssemblyWithClsCompliantAttribute.vb",
    "content": "﻿Imports System\n\n<Assembly: CLSCompliant(False)>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MarkAssemblyWithClsCompliantAttributeNoncompliant.cs",
    "content": "﻿// Noncompliant ^1#0 {{Provide a 'CLSCompliant' attribute for assembly 'project0'.}}\nusing System.Reflection;\n\n[assembly: AssemblyCompany(\"SonarSource\")]\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MarkAssemblyWithClsCompliantAttributeNoncompliant.vb",
    "content": "﻿' Noncompliant ^1#0 {{Provide a 'CLSCompliant' attribute for assembly 'project0'.}}\nImports System.Reflection\n\n<Assembly: AssemblyCompany(\"SonarSource\")>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MarkAssemblyWithComVisibleAttribute.cs",
    "content": "﻿using System.Runtime.InteropServices;\n\n[assembly: ComVisible(true)]\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MarkAssemblyWithComVisibleAttribute.vb",
    "content": "﻿Imports System.Runtime.InteropServices\n\n<Assembly: ComVisible(True)>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MarkAssemblyWithComVisibleAttributeNoncompliant.cs",
    "content": "﻿// Noncompliant ^1#0 {{Provide a 'ComVisible' attribute for assembly 'project0'.}}\nusing System.Reflection;\n\n[assembly: AssemblyCompany(\"SonarSource\")]\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MarkAssemblyWithComVisibleAttributeNoncompliant.vb",
    "content": "﻿' Noncompliant ^1#0 {{Provide a 'ComVisible' attribute for assembly 'project0'.}}\nImports System.Reflection\n\n<Assembly: AssemblyCompany(\"SonarSource\")>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MarkAssemblyWithNeutralResourcesLanguageAttribute.cs",
    "content": "﻿[assembly: System.Resources.NeutralResourcesLanguage(\"en\")]"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MarkAssemblyWithNeutralResourcesLanguageAttributeNonCompliant.cs",
    "content": "﻿// Noncompliant {{Provide a 'System.Resources.NeutralResourcesLanguageAttribute' attribute for assembly 'project0'.}}\n\nusing System.Reflection;\n\n[assembly: AssemblyCompany(\"SonarSource\")]\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MarkAssemblyWithNeutralResourcesLanguageAttributeNoncompliant.Invalid.cs",
    "content": "﻿// Noncompliant {{Provide a 'System.Resources.NeutralResourcesLanguageAttribute' attribute for assembly 'project0'.}}\n\n[assembly: System.Resources.NeutralResourcesLanguage(\"\")]\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MarkWindowsFormsMainWithStaThread.cs",
    "content": "﻿using System;\nusing System.Threading;\nusing System.Threading.Tasks;\n\nnamespace Tests.Diagnostics\n{\n    class Program_00\n    {\n        [SomeNonsense] // Error [CS0246,CS0246] - unknown type\n        // Error@+2 [CS0017] Program has more than one entry point\n        // Secondary@+1 [CS0017] Program has more than one entry point\n        public static void Main() // Noncompliant {{Add the 'STAThread' attribute to this entry point.}}\n        {\n        }\n    }\n\n    class Program_01\n    {\n        // Secondary@+1 [CS0017] Program has more than one entry point\n        public static void Main() // Noncompliant {{Add the 'STAThread' attribute to this entry point.}}\n//                         ^^^^\n        {\n        }\n    }\n\n    class Program_02\n    {\n        // Secondary@+1 [CS0017] Program has more than one entry point\n        public static int Main(string[] args) // Noncompliant {{Add the 'STAThread' attribute to this entry point.}}\n//                        ^^^^\n        {\n            return 1;\n        }\n    }\n\n    class Program_03\n    {\n        [MTAThread]\n        // Secondary@+1 [CS0017] Program has more than one entry point\n        public static void Main() // Noncompliant {{Change the 'MTAThread' attribute of this entry point to 'STAThread'.}}\n        {\n        }\n    }\n\n    class Program_04\n    {\n        [MTAThread]\n        // Secondary@+1 [CS0017] Program has more than one entry point\n        public static int Main(string[] args) // Noncompliant {{Change the 'MTAThread' attribute of this entry point to 'STAThread'.}}\n        {\n            return 1;\n        }\n    }\n\n    class Program_05\n    {\n        [System.MTAThreadAttribute]\n        // Secondary@+1 [CS0017] Program has more than one entry point\n        public static int Main(string[] args) // Noncompliant {{Change the 'MTAThread' attribute of this entry point to 'STAThread'.}}\n        {\n            return 1;\n        }\n    }\n\n    class Program_06\n    {\n        [STAThread]\n        // Secondary@+1 [CS0017] Program has more than one entry point\n        public static void Main()\n        {\n        }\n    }\n\n    class Program_07\n    {\n        [STAThread]\n        // Secondary@+1 [CS0017] Program has more than one entry point\n        public static int Main(string[] args)\n        {\n            return 1;\n        }\n    }\n\n    class Program_08\n    {\n        [System.STAThread]\n        // Secondary@+1 [CS0017] Program has more than one entry point\n        public static int Main(string[] args)\n        {\n            return 1;\n        }\n    }\n\n    class Program_09\n    {\n        [STAThread(\"this is wrong\", 1)] // Error [CS1729] - ctor doesn't exist\n        // Secondary@+1 [CS0017] Program has more than one entry point\n        public static int Main(string[] args)\n        {\n            return 1;\n        }\n    }\n\n    class Program_10\n    {\n        public static async Task Main() // Compliant, async Main is always MTA\n        {\n            await Task.CompletedTask;\n        }\n    }\n\n    class Program_11\n    {\n        [STAThread]\n        public static async Task Main()\n        {\n            await Task.CompletedTask;\n        }\n    }\n\n    class Program_12\n    {\n        [MTAThread]\n        public static async Task Main()\n        {\n            await Task.CompletedTask;\n        }\n    }\n\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MarkWindowsFormsMainWithStaThread.vb",
    "content": "﻿' Error [BC30738] 'Sub Main' is declared more than once in 'project0'\nImports System\nImports System.Windows.Forms\nImports System.Threading\nImports System.Threading.Tasks\n\nNamespace Tests.TestCases\n\n  Class Program_00\n        ' Error@+1 [BC30002] Attribute doesn't exist\n        <Nonsense>\n        Shared Sub Main() ' Noncompliant\n        End Sub\n    End Class\n\n  Public Class Program_01\n    Shared Sub Main() ' Noncompliant {{Add the 'STAThread' attribute to this entry point.}}\n'              ^^^^\n    End Sub\n  End Class\n\n  Public Class Program_02\n    Public Shared Sub Main() ' Noncompliant {{Add the 'STAThread' attribute to this entry point.}}\n    End Sub\n  End Class\n\n  class LowerCaseProgram\n    public shared sub main(args as string()) ' Noncompliant {{Add the 'STAThread' attribute to this entry point.}}\n    end sub\n  end class\n\n  Class Program_04\n    <MTAThread()> Shared Sub Main() ' Noncompliant {{Change the 'MTAThread' attribute of this entry point to 'STAThread'.}}\n    End Sub\n  End Class\n\n  Class Program_05\n    <MTAThread()> Shared Sub Main(args As String()) ' Noncompliant {{Change the 'MTAThread' attribute of this entry point to 'STAThread'.}}\n    End Sub\n  End Class\n\n  Class Program_06\n    Sub Main(args As String()) ' not static method\n    End Sub\n  End Class\n\n  Public Class Program_07\n    <STAThread()> Shared Sub Main()\n    End Sub\n  End Class\n\n  Public Class Program_08\n    <STAThread> Shared Sub Main(args As String())\n    End Sub\n  End Class\n\n  Class Program_09\n        ' Error@+1 [BC30057] Invalid code\n        <STAThread(\"random\", 1)>\n        Shared Sub Main()\n        End Sub\n    End Class\n\n  Class Program_10\n    <MTAThread>\n    Shared Sub Pain()\n    End Sub\n  End Class\n\n  Class Program_11\n    Public Shared Async Function Main() As Task\n      Await Task.CompletedTask\n    End Function\n  End Class\n\n  Class Program_12\n    <STAThread>\n    Public Shared Async Function Main() As Task\n        Await Task.CompletedTask\n    End Function\n  End Class\n\n  Class Program_13\n    <MTAThread>\n    Public Shared Async Function Main() As Task\n        Await Task.CompletedTask\n    End Function\n  End Class\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MarkWindowsFormsMainWithStaThread_NoWindowsForms.cs",
    "content": "﻿using System;\nusing System.Threading;\nusing System.Threading.Tasks;\n\nnamespace Tests.Diagnostics\n{\n    class Program_00\n    {\n        [SomeNonsense] // Error [CS0246,CS0246] - unknown type\n        // Error@+2 [CS0017] Program has more than one entry point\n        // Secondary@+1 [CS0017] Program has more than one entry point\n        public static void Main()\n        {\n        }\n    }\n\n    class Program_01\n    {\n        // Secondary@+1 [CS0017] Program has more than one entry point\n        public static void Main()\n\n        {\n        }\n    }\n\n    class Program_02\n    {\n        // Secondary@+1 [CS0017] Program has more than one entry point\n        public static int Main(string[] args)\n        {\n            return 1;\n        }\n    }\n\n    class Program_03\n    {\n        [MTAThread]\n        // Secondary@+1 [CS0017] Program has more than one entry point\n        public static void Main()\n        {\n        }\n    }\n\n    class Program_04\n    {\n        [MTAThread]\n        // Secondary@+1 [CS0017] Program has more than one entry point\n        public static int Main(string[] args)\n        {\n            return 1;\n        }\n    }\n\n    class Program_05\n    {\n        [System.MTAThreadAttribute]\n        // Secondary@+1 [CS0017] Program has more than one entry point\n        public static int Main(string[] args)\n        {\n            return 1;\n        }\n    }\n\n    class Program_06\n    {\n        [STAThread]\n        // Secondary@+1 [CS0017] Program has more than one entry point\n        public static void Main()\n        {\n        }\n    }\n\n    class Program_07\n    {\n        [STAThread]\n        // Secondary@+1 [CS0017] Program has more than one entry point\n        public static int Main(string[] args)\n        {\n            return 1;\n        }\n    }\n\n    class Program_08\n    {\n        [System.STAThread]\n        // Secondary@+1 [CS0017] Program has more than one entry point\n        public static int Main(string[] args)\n        {\n            return 1;\n        }\n    }\n\n    class Program_09\n    {\n        [STAThread(\"this is wrong\", 1)] // Error [CS1729] - ctor doesn't exist\n        // Secondary@+1 [CS0017] Program has more than one entry point\n        public static int Main(string[] args)\n        {\n            return 1;\n        }\n    }\n\n    class Program_10\n    {\n        public static async Task Main()\n        {\n            await Task.CompletedTask;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MarkWindowsFormsMainWithStaThread_NoWindowsForms.vb",
    "content": "﻿Imports System\nImports System.Windows.Forms\nImports System.Threading\nImports System.Threading.Tasks\n\nNamespace Tests.TestCases\n\n  Class Program_00\n    <Nonsense>\n    Shared Sub Main()\n    End Sub\n  End Class\n\n  Public Class Program_01\n    Shared Sub Main()\n      Dim winForm As Form = New Form\n      Application.Run(winForm)\n    End Sub\n  End Class\n\n  Public Class Program_02\n    Public Shared Sub Main()\n    End Sub\n  End Class\n\n  Class Program_03\n    Public Shared Sub Main(args As String())\n    End Sub\n  End Class\n\n  Class Program_04\n    <MTAThread()> Shared Sub Main()\n    End Sub\n  End Class\n\n  Class Program_05\n    <MTAThread()> Shared Sub Main(args As String())\n    End Sub\n  End Class\n\n  Class Program_06\n    Sub Main(args As String())\n    End Sub\n  End Class\n\n  Public Class Program_07\n    <STAThread()> Shared Sub Main()\n      Dim winForm As Form = New Form\n      Application.Run(winForm)\n    End Sub\n  End Class\n\n  Public Class Program_08\n    <STAThread> Shared Sub Main(args As String())\n      Dim winForm As Form = New Form\n      Application.Run(winForm)\n    End Sub\n  End Class\n\n  Class Program_09\n    <STAThread(\"random\", 1)>\n    Shared Sub Main()\n    End Sub\n  End Class\n\n  Class Program_11\n    <MTAThread>\n    Shared Sub Pain()\n    End Sub\n  End Class\n\n  Class Program_12\n    Public Shared Async Function Main() As Task\n      Await Task.CompletedTask\n    End Function\n  End Class\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MemberInitializedToDefault.CSharp10.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public struct BarStruct\n    {\n        // Repro for issue: https://github.com/SonarSource/sonar-dotnet/issues/6461\n        public int someField = 0; // Noncompliant FP for versions < C# 11 Fields that are not initialized in all constructors must be set explicitly.\n        public BarStruct(bool someDummy) // Ctor with a parameter that does not initialize all fields\n        { }\n    }\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MemberInitializedToDefault.CSharp11.Fixed.cs",
    "content": "﻿using System;\nusing System.Diagnostics.CodeAnalysis;\n\nrecord IntPointers\n{\n    public const IntPtr myConst = 0; // Compliant\n    public static IntPtr staticField; // Fixed\n\n    public IntPtr field1; // Fixed\n    public IntPtr field2 = 42; // Compliant\n\n    public UIntPtr field3; // Fixed\n    public UIntPtr field4 = 42;// Compliant\n\n    public IntPtr field5; // Fixed\n    public IntPtr field6; // Fixed\n    public UIntPtr field7; // Fixed\n    public IntPtr field8; // Fixed\n    public IntPtr field9 = new IntPtr(staticField); // Compliant\n\n    public UIntPtr field10; // Fixed\n    public UIntPtr field11;  // Fixed\n    public UIntPtr field12; // Fixed\n\n    public IntPtr Property1 { get; set; } // Fixed\n    public IntPtr Property2 { get; set; } = 42; // Compliant\n\n    public UIntPtr Property3 { get; init; } // Fixed\n    public UIntPtr Property4 { get; init; } = 42; // Compliant\n\n    public IntPtr Property5 { get; set; } = 0 * 20 - 0; // FN - Expression is not evaluated\n    public UIntPtr Property6 { get; set; } = 0 * 20 - 0; // FN - Expression is not evaluated\n}\n\npublic readonly struct FooStruct\n{\n    public FooStruct() { }\n\n    public int Value { get; init; } // Compliant\n    public bool BoolValue { get; init; } // Compliant\n\n    public int ValueDefault { get; init; } // Fixed\n    public bool BoolValueDefault { get; init; } // Fixed\n}\n\npublic struct BarStruct\n{\n    public int someField; // Fixed\n    public required int someRequiredField; // Fixed\n    public BarStruct(int dummy) { }\n\n    [SetsRequiredMembers]\n    public BarStruct() { } // this constructor will init all required members to their default values.\n}\n\npublic struct FooBarStruct\n{\n    public int someField; // Compliant - does not raise a CS0171 issue anymore due to the auto-default-struct C# 11 feature https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-11#auto-default-struct\n    public required int someRequiredField; // Compliant - does not raise a CS0171 and the compiler will default this to 0.\n\n    public FooBarStruct(int dummy) { }\n}\n\npublic class TestRequiredProperties\n{\n    void Method()\n    {\n        var classWithRequiredProperties = new ClassWithRequiredProperties() { RequiredProperty = 0 };\n        var classWithRequiredProperties_initWithConstructor = new ClassWithRequiredProperties();\n    }\n\n    public class ClassWithRequiredProperties\n    {\n        public required int RequiredProperty { get; init; } // Fixed\n        public int AnotherProperty { get; set; }\n\n        [SetsRequiredMembers]\n        public ClassWithRequiredProperties() { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MemberInitializedToDefault.CSharp11.cs",
    "content": "﻿using System;\nusing System.Diagnostics.CodeAnalysis;\n\nrecord IntPointers\n{\n    public const IntPtr myConst = 0; // Compliant\n    public static IntPtr staticField = 0; // Noncompliant\n\n    public IntPtr field1 = 0; // Noncompliant\n    public IntPtr field2 = 42; // Compliant\n\n    public UIntPtr field3 = 0; // Noncompliant\n    public UIntPtr field4 = 42;// Compliant\n\n    public IntPtr field5 = IntPtr.Zero; // Noncompliant\n    public IntPtr field6 = 0x0000000000000000; // Noncompliant\n    public UIntPtr field7 = UIntPtr.Zero; // Noncompliant\n    public IntPtr field8 = new IntPtr(0); // Noncompliant\n    public IntPtr field9 = new IntPtr(staticField); // Compliant\n\n    public UIntPtr field10 = new UIntPtr(0); // Noncompliant\n    public UIntPtr field11 = new();  // Noncompliant\n    public UIntPtr field12 = new UIntPtr { }; // Noncompliant\n\n    public IntPtr Property1 { get; set; } = 0; // Noncompliant\n    public IntPtr Property2 { get; set; } = 42; // Compliant\n\n    public UIntPtr Property3 { get; init; } = 0; // Noncompliant\n    public UIntPtr Property4 { get; init; } = 42; // Compliant\n\n    public IntPtr Property5 { get; set; } = 0 * 20 - 0; // FN - Expression is not evaluated\n    public UIntPtr Property6 { get; set; } = 0 * 20 - 0; // FN - Expression is not evaluated\n}\n\npublic readonly struct FooStruct\n{\n    public FooStruct() { }\n\n    public int Value { get; init; } // Compliant\n    public bool BoolValue { get; init; } // Compliant\n\n    public int ValueDefault { get; init; } = 0; // Noncompliant\n    public bool BoolValueDefault { get; init; } = false; // Noncompliant\n}\n\npublic struct BarStruct\n{\n    public int someField = 0; // Noncompliant Initializing this field is optional for C# 11 due to the auto-default-struct C# feature https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-11#auto-default-struct\n    public required int someRequiredField = 0; // Noncompliant \"required\" indicates C# 11 and the compiler takes care of the initialization to the default value for structs in C# 11 and above\n    public BarStruct(int dummy) { }\n\n    [SetsRequiredMembers]\n    public BarStruct() { } // this constructor will init all required members to their default values.\n}\n\npublic struct FooBarStruct\n{\n    public int someField; // Compliant - does not raise a CS0171 issue anymore due to the auto-default-struct C# 11 feature https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-11#auto-default-struct\n    public required int someRequiredField; // Compliant - does not raise a CS0171 and the compiler will default this to 0.\n\n    public FooBarStruct(int dummy) { }\n}\n\npublic class TestRequiredProperties\n{\n    void Method()\n    {\n        var classWithRequiredProperties = new ClassWithRequiredProperties() { RequiredProperty = 0 };\n        var classWithRequiredProperties_initWithConstructor = new ClassWithRequiredProperties();\n    }\n\n    public class ClassWithRequiredProperties\n    {\n        public required int RequiredProperty { get; init; } = 0; // Noncompliant -  the required property is to be set on the caller's side anyways or by the constructor.\n        public int AnotherProperty { get; set; }\n\n        [SetsRequiredMembers]\n        public ClassWithRequiredProperties() { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MemberInitializedToDefault.CSharp8.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\n#nullable enable\n\nnamespace Tests.Diagnostics\n{\n    public class C\n    {\n        // If the field is not initialized and nullable is set to enabled then\n        // there's a warning \"CS8618: Non-nullable property 'MyProperty' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.\"\n        // To silence the warning one needs to use a field initializer and the suppression operator. We should not raise and issue in the case ! is present.\n        public object Noncompliant { get; set; } = default; // FN\n        public object MyProperty { get; set; } = default!;  // Compliant\n        public object MyPropertyNull { get; set; } = null!; // Compliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MemberInitializedToDefault.CSharp9.cs",
    "content": "﻿using System;\n\nrecord NativeInts\n{\n    public const nint myConst = 0;  // Compliant\n    public static nint staticField = 0; // Noncompliant\n    public nint field1 = 0;         // Noncompliant\n    public nint field2 = 42;\n    public nuint field3 = 0;        // Noncompliant\n    public nuint field4 = 42;\n    public nint field5 = IntPtr.Zero;         // Noncompliant\n    public nint field6 = 0x0000000000000000;  // Noncompliant\n    public nuint field7 = UIntPtr.Zero;       // Noncompliant\n    public nint field8 = new IntPtr(0);       // Noncompliant\n    public nint field9 = new IntPtr(staticField);\n    public nuint field10 = new UIntPtr(0);    // Noncompliant\n    public nuint field11 = new ();           // Noncompliant\n    public nuint field12 = new nuint { };    // Noncompliant\n\n    public nint Property1 { get; set; } = 0;    // Noncompliant\n    public nint Property2 { get; set; } = 42;\n\n    public nuint Property3 { get; init; } = 0; // Noncompliant\n    public nuint Property4 { get; init; } = 42;\n\n    public nint Property5\n    {\n        get\n        {\n            return 0;\n        }\n        init\n        {\n            field1 = 0;     // Not tracked\n        }\n    }\n\n    public nuint Property6\n    {\n        get => 0;\n        init => field1 = 0; // Not tracked\n    }\n\n    public nuint Property7\n    {\n        get => 0;\n        init => field1 = 0; // Not tracked\n    }\n\n    public nint Property8 { get; set; } = 0 * 20 - 0; // FN - Expression is not evaluated\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MemberInitializedToDefault.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    struct Dummy\n    { }\n\n    class MemberInitializedToDefault<T>\n    {\n        public const int myConst = 0; //Compliant\n        public double fieldD1; // Fixed\n        public double fieldD2; // Fixed\n        public double fieldD2b; // Fixed\n        public double fieldD3; // Fixed\n        public decimal fieldD4; // Fixed\n        public decimal fieldD5 = .2m;\n        public byte b; // Fixed\n        public char c; // Fixed\n        public char c2; // Fixed\n        public bool bo; // Fixed\n        public sbyte sb; // Fixed\n        public ushort us; // Fixed\n        public uint ui; // Fixed\n        public ulong ul; // Fixed\n        public long l; // Fixed\n        public static object o; // Fixed\n        public object MyProperty { get; set; } // Fixed\n        public object Property3 => null;\n        public object Property4\n        {\n            get => null;\n            set => throw new Exception();\n        }\n\n        public event EventHandler MyEvent;  // Fixed\n        public event EventHandler MyEvent2 = (s, e) => { };\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MemberInitializedToDefault.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    struct Dummy\n    { }\n\n    class MemberInitializedToDefault<T>\n    {\n        public const int myConst = 0; //Compliant\n        public double fieldD1 = 0; // Noncompliant\n//                            ^^^\n        public double fieldD2 = +0.0; // Noncompliant\n        public double fieldD2b = -+-+-0.0; // Noncompliant\n        public double fieldD3 = .0; // Noncompliant\n        public decimal fieldD4 = .0m; // Noncompliant\n        public decimal fieldD5 = .2m;\n        public byte b = 0; // Noncompliant\n        public char c = '\\u0000'; // Noncompliant\n        public char c2 = new char(); // Noncompliant\n        public bool bo = false; // Noncompliant\n        public sbyte sb = +0; // Noncompliant\n        public ushort us = -0; // Noncompliant\n        public uint ui = +-+-+0; // Noncompliant\n        public ulong ul = 0UL; // Noncompliant\n        public long l = new long(); // Noncompliant\n        public static object o = default(object); // Noncompliant {{Remove this initialization to 'o', the compiler will do that for you.}}\n        public object MyProperty { get; set; } = null; // Noncompliant\n        public object Property3 => null;\n        public object Property4\n        {\n            get => null;\n            set => throw new Exception();\n        }\n\n        public event EventHandler MyEvent = null;  // Noncompliant\n        public event EventHandler MyEvent2 = (s, e) => { };\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MemberInitializerRedundant.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    class Person\n    {\n        static int maxAge = 42;\n        int age; // Fixed\n        int Age { get; } // Fixed\n        int Age2 { get; } = 0; // we already report on this with S3052\n        event EventHandler myEvent; // Fixed\n        public Person(int age)\n        {\n            var x = nameof(this.Age); // Nameof doesn't matter\n\n            if (true)\n            {\n                maxAge = 43;\n                this.age = age;\n                this.Age = this.age;\n                Age2 = 44;\n                myEvent = (a, b) => { };\n            }\n            else\n            {\n                maxAge = 43;\n                this.age = age;\n                (Age) = this.age;\n                Age2 = 44;\n                myEvent = (a, b) => { };\n            }\n\n            Console.WriteLine(this.Age);\n        }\n    }\n\n    class Person2\n    {\n        int age = 42;\n        public Person2(int age)\n        {\n            this.age = age;\n        }\n\n        public Person2(int age, int other)\n        {\n        }\n    }\n\n    class Person2b\n    {\n        int age; // Fixed\n        public Person2b(int age)\n        {\n            this.age = age;\n        }\n\n        public Person2b(int age, int other)\n        {\n            this.age = age;\n        }\n    }\n\n    class Person3\n    {\n        int age; // Fixed\n        int id = 42; // only set in the second constructor\n        public Person3(int age)\n        {\n            this.age = age;\n        }\n\n        public Person3(int age, int other)\n            : this(age)\n        {\n            id = other;\n        }\n    }\n\n    class Person4\n    {\n        int age = 42;\n        public Person4()\n        {\n            Console.WriteLine(this?.age);\n            this.age = 40;\n        }\n    }\n\n    class Person4b\n    {\n        int age = 42;\n        public Person4b()\n        {\n            Console.WriteLine(this.age);\n            this.age = 40;\n        }\n    }\n\n    class Person5\n    {\n        int age = 42;\n        public Person5()\n        {\n            Delegate d = new Action(() => { this.age = 40; });\n        }\n    }\n\n    class Person6\n    {\n        int age, // Fixed\n            year; // Fixed\n        public Person6(bool c)\n        {\n            if (c)\n            {\n                this.age = 40;\n            }\n            else\n            {\n                this.age = 42;\n            }\n            this.year = 400;\n            Console.WriteLine(this.year);\n        }\n    }\n\n    class Person7\n    {\n        int age = 42,\n            year; // Fixed\n        public Person7(bool c)\n        {\n            if (c)\n            {\n                this.age = 40;\n            }\n            this.year = 400;\n            Console.WriteLine(this.year);\n        }\n    }\n\n    class Person8\n    {\n        int year = 1980; // Compliant, lambda uses it in constructor\n        public Person8()\n        {\n            Action a = () => Console.WriteLine(this?.year);\n            a();\n            this.year = 1980;\n        }\n    }\n\n    class Person9\n    {\n        int year; // Fixed\n        public Person9()\n        {\n            try\n            {\n                year = 400; // the CFG connects the beginning of the try block with the catch, hence we have a path where \"year\" is not rewritten\n            }\n            catch (Exception)\n            {\n                throw;\n            }\n            Console.WriteLine(this.year);\n        }\n    }\n\n    class Person10\n    {\n        int year; // Fixed\n        public Person10()\n        {\n            M(out ((this.year)));\n        }\n\n        void M(out int x) { x = 42; }\n    }\n\n    class Person11\n    {\n        int a; // Fixed\n\n        public Person11() => a = 42;\n    }\n\n    class Person12\n    {\n        int age;\n        public Person12()\n        {\n            age = 0; // FN\n        }\n    }\n\n    class Person13\n    {\n        static int x; // Fixed\n        static int y;\n        static int z { get; } // Fixed\n        static event EventHandler w; // Fixed\n        static Person13()\n        {\n            x = 41;\n            y = 41;\n            z = 2;\n            w = (a, b) => { };\n        }\n    }\n\n    class Person14\n    {\n        static int x = 42; // Compliant\n        static Person14()\n        {\n            Console.WriteLine(x);\n            x = 41;\n        }\n    }\n\n    class Person15\n    {\n        int age = 42;\n        public Person15()\n        {\n            Delegate d = new Action(() =>\n            {\n                Delegate c = new Action(() => { this.age = 40; });\n            });\n        }\n    }\n\n    class Person16\n    {\n        int a = 42;\n\n        private int b { get; set; } = 42;\n\n        event EventHandler c = (a, b) => { };\n\n        public Person16(Person16 other)\n        {\n            other.a = 0;\n            other.b = 0;\n            other.c = (a, b) => { };\n        }\n    }\n\n    internal class Person17\n    {\n        internal string Special;  // Fixed\n\n        internal Person17(string foo)\n        {\n            var x = true && true;\n            Special = foo;\n        }\n    }\n\n    class CSharp8_PersonA\n    {\n        int age = 42;\n        public CSharp8_PersonA(bool b, int age)\n        {\n            Console.Write(b switch\n                {\n                    true => $\"Age: {this.age}\",\n                    _ => \"N/A\"\n                }\n                );\n            this.age = age;\n        }\n    }\n\n    class CSharp8_PersonB\n    {\n        int[] ids = new int[0];\n        public CSharp8_PersonB(int[] ids)\n        {\n            this.ids ??= ids;\n        }\n    }\n\n    class BaseClass\n    {\n        int foo; // Fixed\n        public BaseClass(int i)\n        {\n            foo = 42;\n        }\n    }\n    class NewClass : BaseClass\n    {\n        int baz = 0; // FN\n        public NewClass() : base(1)\n        {\n            baz = 0;\n        }\n    }\n\n    struct Struct1\n    {\n        // structs cannot initialize instance fields/properties at declaration, only const\n        const int a = 42;\n        static int b; // Fixed\n        static int b2 = 2;\n\n        static Struct1() => b = 1;\n    }\n    class EmptyClassForCoverage { }\n    struct EmptyStructForCoverage { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MemberInitializerRedundant.Latest.Fixed.cs",
    "content": "﻿using System;\nusing System.Runtime.CompilerServices;\nclass Person\n{\n    const int forCoverage = 0;\n    static int minAge = 0;\n    static int Bar { get; set; } = 1;\n    static event EventHandler Quix = (a, b) => { };\n\n    static int maxAge; // Fixed\n    static string Name; // Fixed\n    static string Job; // Fixed\n    static bool Nice; // Fixed\n    static int Foo { get; set; } // Fixed\n    static event EventHandler Taz; // Fixed\n\n    public Person() { } // for coverage\n\n    [ModuleInitializer]\n    internal static void Initialize()\n    {\n        maxAge = 42;\n    }\n\n    [Obsolete]\n    [ModuleInitializer]\n    internal static void SecondInitialize()\n    {\n        Name = \"Foo\";\n        Job = \"2\";\n        Nice = false;\n        Foo = 1;\n        Taz = (a, b) => { };\n    }\n\n    [ModuleInitializer]\n    internal static void ThirdInitialize()\n    {\n        Job = \"3\";\n    }\n\n    [Obsolete]\n    internal static void Foo1()\n    {\n        minAge = 2;\n    }\n\n    [Obsolete(\"argument\", false)]\n    internal static void Foo2()\n    {\n        minAge = 2;\n    }\n\n    internal static void Foo3()\n    {\n        minAge = 3;\n        Bar = 2;\n        Quix = (a, b) => { };\n    }\n}\n\n// we do not support records for instance members, see discussion in https://github.com/SonarSource/sonar-dotnet/pull/4756\nrecord InstanceRecord\n{\n    static int foo = 1; // FN\n    int bar = 42; // FN\n    int fred { get; init; } = 42; // FN\n    int quix = 9; // ok, not initialized in all constructors\n    const int barney = 1;\n\n    [ModuleInitializer]\n    internal static void Initialize()\n    {\n        foo = 1;\n    }\n\n    public InstanceRecord()\n    {\n        bar = 30;\n        quix = 10;\n        fred = 10;\n    }\n\n    public InstanceRecord(int x)\n    {\n        bar = x;\n        fred = 10;\n    }\n\n    public InstanceRecord(int x, int y) : this(x) { }\n}\n\npublic record RecordWithParam(string bar)\n{\n    public string foo = \"foo\";\n}\n\npublic record RecordWithParamAndConstructor(string bar)\n{\n    public string foo = \"foo\";\n    public int quix = 1; // FN\n    public RecordWithParamAndConstructor(string x, int y) : this(x)\n    {\n        quix = 2;\n    }\n}\n\npublic record StaticRecord\n{\n    public static int FOO = 1; // FN\n    public static string BAR = \"BAR\";\n    static StaticRecord()\n    {\n        FOO = 2;\n    }\n}\n\nrecord EmptyRecordForCoverage { }\n\nstruct Struct1\n{\n    static int b; // Fixed\n    static int b2 = 2;\n\n    [ModuleInitializer]\n    internal static void Initialize() => b = 42;\n}\n\ninterface SomeInterface\n{\n    static int Field; // Fixed\n    static int Field2 = 2;\n    static event EventHandler Taz; // Fixed\n\n    [ModuleInitializer]\n    internal static void Initialize()\n    {\n        Field = 2;\n        Taz = (a, b) => { };\n    }\n}\n\n// we do not support records for instance members, see discussion in https://github.com/SonarSource/sonar-dotnet/pull/4756\nrecord struct InstanceStruct\n{\n    static int foo = 1; // FN\n    int bar = 42; // FN\n    int fred { get; init; } = 42; // FN\n    int quix = 9; // ok, not initialized in all constructors\n    const int barney = 1;\n\n    [ModuleInitializer]\n    internal static void Initialize()\n    {\n        foo = 1;\n    }\n\n    public InstanceStruct()\n    {\n        bar = 30;\n        quix = 10;\n        fred = 10;\n    }\n\n    public InstanceStruct(int x)\n    {\n        bar = x;\n        fred = 10;\n    }\n\n    public InstanceStruct(int x, int y) : this(x) { }\n}\n\npublic record struct RecordStructWithParam(string bar)\n{\n    public string foo = \"foo\";\n}\n\npublic record struct RecordStructWithParamAndConstructor(string bar)\n{\n    public string foo = \"foo\";\n    public int quix = 1; // FN\n    public RecordStructWithParamAndConstructor(string x, int y) : this(x)\n    {\n        quix = 2;\n    }\n}\n\npublic record struct RecordStruct\n{\n    public static int FOO = 1; // FN\n    public static string BAR = \"BAR\";\n    static RecordStruct()\n    {\n        FOO = 2;\n    }\n}\n\nrecord struct EmptyRecordStructForCoverage { }\n\nstruct StaticStruct\n{\n    static int b; // Fixed\n    static int b2 = 2;\n\n    [ModuleInitializer]\n    internal static void Initialize() => b = 42;\n}\n\n/// Reproducer for https://github.com/SonarSource/sonar-dotnet/issues/7624\nclass WithPrimaryConstructor(object options)\n{\n    private readonly object _options = options;      // Compliant\n    public object Options { get; } = options;        // Compliant\n    public object[] AllOptions { get; } = [options]; // Compliant\n}\n\nclass WithReferencedPrimaryConstructor(object options)\n{\n    public WithReferencedPrimaryConstructor() : this(null)\n    {\n\n    }\n    private readonly object _options = options; // Compliant\n}\n\nclass WithPrimaryConstructorAndAssignment(object options)\n{\n    public WithPrimaryConstructorAndAssignment() : this(null)\n    {\n        _options = null;\n    }\n    private readonly object _options = options; // Compliant\n}\n\nclass CollectionExpression1\n{\n    private readonly int[] numbers; // Fixed\n\n    CollectionExpression1()\n    {\n        numbers = [4, 5, 6];\n    }\n}\n\nclass FieldKeyword\n{\n    public int Count { get => field; set => field = value; } = 10; // FN https://sonarsource.atlassian.net/browse/NET-2685\n\n    public FieldKeyword()\n    {\n        Count = 20;\n    }\n}\n\nclass NullConditionalAssignmentTests\n{\n    int Count = 10;          // FN https://sonarsource.atlassian.net/browse/NET-2685\n    int CompliantCount = 10; // FN unfixable without SE, unsupported\n    public NullConditionalAssignmentTests()\n    {\n        this?.Count = 20;\n        if (this is null)\n        {\n            CompliantCount = 20;\n        }\n    }\n}\n\npublic partial class PartialConstructor\n{\n    int id = 100;   // FN https://sonarsource.atlassian.net/browse/NET-2685\n    public partial PartialConstructor();\n}\n\npublic partial class PartialConstructor\n{\n    public partial PartialConstructor()\n    {\n        id = 1;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MemberInitializerRedundant.Latest.cs",
    "content": "﻿using System;\nusing System.Runtime.CompilerServices;\nclass Person\n{\n    const int forCoverage = 0;\n    static int minAge = 0;\n    static int Bar { get; set; } = 1;\n    static event EventHandler Quix = (a, b) => { };\n\n    static int maxAge = 42; // Noncompliant {{Remove the static member initializer, a static constructor or module initializer sets an initial value for the member.}}\n    static string Name = \"X\"; // Noncompliant\n    static string Job = \"1\"; // Noncompliant\n    static bool Nice = true; // Noncompliant\n    static int Foo { get; set; } = 1; // Noncompliant\n    static event EventHandler Taz = (a, b) => { }; // Noncompliant\n\n    public Person() { } // for coverage\n\n    [ModuleInitializer]\n    internal static void Initialize()\n    {\n        maxAge = 42;\n    }\n\n    [Obsolete]\n    [ModuleInitializer]\n    internal static void SecondInitialize()\n    {\n        Name = \"Foo\";\n        Job = \"2\";\n        Nice = false;\n        Foo = 1;\n        Taz = (a, b) => { };\n    }\n\n    [ModuleInitializer]\n    internal static void ThirdInitialize()\n    {\n        Job = \"3\";\n    }\n\n    [Obsolete]\n    internal static void Foo1()\n    {\n        minAge = 2;\n    }\n\n    [Obsolete(\"argument\", false)]\n    internal static void Foo2()\n    {\n        minAge = 2;\n    }\n\n    internal static void Foo3()\n    {\n        minAge = 3;\n        Bar = 2;\n        Quix = (a, b) => { };\n    }\n}\n\n// we do not support records for instance members, see discussion in https://github.com/SonarSource/sonar-dotnet/pull/4756\nrecord InstanceRecord\n{\n    static int foo = 1; // FN\n    int bar = 42; // FN\n    int fred { get; init; } = 42; // FN\n    int quix = 9; // ok, not initialized in all constructors\n    const int barney = 1;\n\n    [ModuleInitializer]\n    internal static void Initialize()\n    {\n        foo = 1;\n    }\n\n    public InstanceRecord()\n    {\n        bar = 30;\n        quix = 10;\n        fred = 10;\n    }\n\n    public InstanceRecord(int x)\n    {\n        bar = x;\n        fred = 10;\n    }\n\n    public InstanceRecord(int x, int y) : this(x) { }\n}\n\npublic record RecordWithParam(string bar)\n{\n    public string foo = \"foo\";\n}\n\npublic record RecordWithParamAndConstructor(string bar)\n{\n    public string foo = \"foo\";\n    public int quix = 1; // FN\n    public RecordWithParamAndConstructor(string x, int y) : this(x)\n    {\n        quix = 2;\n    }\n}\n\npublic record StaticRecord\n{\n    public static int FOO = 1; // FN\n    public static string BAR = \"BAR\";\n    static StaticRecord()\n    {\n        FOO = 2;\n    }\n}\n\nrecord EmptyRecordForCoverage { }\n\nstruct Struct1\n{\n    static int b = 1; // Noncompliant\n    static int b2 = 2;\n\n    [ModuleInitializer]\n    internal static void Initialize() => b = 42;\n}\n\ninterface SomeInterface\n{\n    static int Field = 1; // Noncompliant\n    static int Field2 = 2;\n    static event EventHandler Taz = (a, b) => { }; // Noncompliant\n\n    [ModuleInitializer]\n    internal static void Initialize()\n    {\n        Field = 2;\n        Taz = (a, b) => { };\n    }\n}\n\n// we do not support records for instance members, see discussion in https://github.com/SonarSource/sonar-dotnet/pull/4756\nrecord struct InstanceStruct\n{\n    static int foo = 1; // FN\n    int bar = 42; // FN\n    int fred { get; init; } = 42; // FN\n    int quix = 9; // ok, not initialized in all constructors\n    const int barney = 1;\n\n    [ModuleInitializer]\n    internal static void Initialize()\n    {\n        foo = 1;\n    }\n\n    public InstanceStruct()\n    {\n        bar = 30;\n        quix = 10;\n        fred = 10;\n    }\n\n    public InstanceStruct(int x)\n    {\n        bar = x;\n        fred = 10;\n    }\n\n    public InstanceStruct(int x, int y) : this(x) { }\n}\n\npublic record struct RecordStructWithParam(string bar)\n{\n    public string foo = \"foo\";\n}\n\npublic record struct RecordStructWithParamAndConstructor(string bar)\n{\n    public string foo = \"foo\";\n    public int quix = 1; // FN\n    public RecordStructWithParamAndConstructor(string x, int y) : this(x)\n    {\n        quix = 2;\n    }\n}\n\npublic record struct RecordStruct\n{\n    public static int FOO = 1; // FN\n    public static string BAR = \"BAR\";\n    static RecordStruct()\n    {\n        FOO = 2;\n    }\n}\n\nrecord struct EmptyRecordStructForCoverage { }\n\nstruct StaticStruct\n{\n    static int b = 1; // Noncompliant\n    static int b2 = 2;\n\n    [ModuleInitializer]\n    internal static void Initialize() => b = 42;\n}\n\n/// Reproducer for https://github.com/SonarSource/sonar-dotnet/issues/7624\nclass WithPrimaryConstructor(object options)\n{\n    private readonly object _options = options;      // Compliant\n    public object Options { get; } = options;        // Compliant\n    public object[] AllOptions { get; } = [options]; // Compliant\n}\n\nclass WithReferencedPrimaryConstructor(object options)\n{\n    public WithReferencedPrimaryConstructor() : this(null)\n    {\n\n    }\n    private readonly object _options = options; // Compliant\n}\n\nclass WithPrimaryConstructorAndAssignment(object options)\n{\n    public WithPrimaryConstructorAndAssignment() : this(null)\n    {\n        _options = null;\n    }\n    private readonly object _options = options; // Compliant\n}\n\nclass CollectionExpression1\n{\n    private readonly int[] numbers = [1, 2, 3]; // Noncompliant\n    //                             ^^^^^^^^^^^\n\n    CollectionExpression1()\n    {\n        numbers = [4, 5, 6];\n    }\n}\n\nclass FieldKeyword\n{\n    public int Count { get => field; set => field = value; } = 10; // FN https://sonarsource.atlassian.net/browse/NET-2685\n\n    public FieldKeyword()\n    {\n        Count = 20;\n    }\n}\n\nclass NullConditionalAssignmentTests\n{\n    int Count = 10;          // FN https://sonarsource.atlassian.net/browse/NET-2685\n    int CompliantCount = 10; // FN unfixable without SE, unsupported\n    public NullConditionalAssignmentTests()\n    {\n        this?.Count = 20;\n        if (this is null)\n        {\n            CompliantCount = 20;\n        }\n    }\n}\n\npublic partial class PartialConstructor\n{\n    int id = 100;   // FN https://sonarsource.atlassian.net/browse/NET-2685\n    public partial PartialConstructor();\n}\n\npublic partial class PartialConstructor\n{\n    public partial PartialConstructor()\n    {\n        id = 1;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MemberInitializerRedundant.RoslynCfg.FlowCaptureBug.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    // See https://github.com/SonarSource/sonar-dotnet/issues/4954\n    internal class FlowCaptureOperation\n    {\n        internal string Special = \"\";  // Compliant FN\n\n        internal FlowCaptureOperation(string foo)\n        {\n            Special = foo != \"\" ? foo : \"foo\";\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MemberInitializerRedundant.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    class Person\n    {\n        static int maxAge = 42;\n        int age = 42 /*init*/; // Noncompliant {{Remove the member initializer, all constructors set an initial value for the member.}}\n//              ^^^^\n        int Age { get; } = 42; // Noncompliant\n//                       ^^^^\n        int Age2 { get; } = 0; // we already report on this with S3052\n        event EventHandler myEvent = (a, b) => { }; // Noncompliant\n        public Person(int age)\n        {\n            var x = nameof(this.Age); // Nameof doesn't matter\n\n            if (true)\n            {\n                maxAge = 43;\n                this.age = age;\n                this.Age = this.age;\n                Age2 = 44;\n                myEvent = (a, b) => { };\n            }\n            else\n            {\n                maxAge = 43;\n                this.age = age;\n                (Age) = this.age;\n                Age2 = 44;\n                myEvent = (a, b) => { };\n            }\n\n            Console.WriteLine(this.Age);\n        }\n    }\n\n    class Person2\n    {\n        int age = 42;\n        public Person2(int age)\n        {\n            this.age = age;\n        }\n\n        public Person2(int age, int other)\n        {\n        }\n    }\n\n    class Person2b\n    {\n        int age = 42; // Noncompliant\n        public Person2b(int age)\n        {\n            this.age = age;\n        }\n\n        public Person2b(int age, int other)\n        {\n            this.age = age;\n        }\n    }\n\n    class Person3\n    {\n        int age = 42; // Noncompliant\n        int id = 42; // only set in the second constructor\n        public Person3(int age)\n        {\n            this.age = age;\n        }\n\n        public Person3(int age, int other)\n            : this(age)\n        {\n            id = other;\n        }\n    }\n\n    class Person4\n    {\n        int age = 42;\n        public Person4()\n        {\n            Console.WriteLine(this?.age);\n            this.age = 40;\n        }\n    }\n\n    class Person4b\n    {\n        int age = 42;\n        public Person4b()\n        {\n            Console.WriteLine(this.age);\n            this.age = 40;\n        }\n    }\n\n    class Person5\n    {\n        int age = 42;\n        public Person5()\n        {\n            Delegate d = new Action(() => { this.age = 40; });\n        }\n    }\n\n    class Person6\n    {\n        int age = 42, // Noncompliant\n            year = 1980; // Noncompliant\n        public Person6(bool c)\n        {\n            if (c)\n            {\n                this.age = 40;\n            }\n            else\n            {\n                this.age = 42;\n            }\n            this.year = 400;\n            Console.WriteLine(this.year);\n        }\n    }\n\n    class Person7\n    {\n        int age = 42,\n            year = 1980; // Noncompliant\n        public Person7(bool c)\n        {\n            if (c)\n            {\n                this.age = 40;\n            }\n            this.year = 400;\n            Console.WriteLine(this.year);\n        }\n    }\n\n    class Person8\n    {\n        int year = 1980; // Compliant, lambda uses it in constructor\n        public Person8()\n        {\n            Action a = () => Console.WriteLine(this?.year);\n            a();\n            this.year = 1980;\n        }\n    }\n\n    class Person9\n    {\n        int year = 1980; // Noncompliant\n        public Person9()\n        {\n            try\n            {\n                year = 400; // the CFG connects the beginning of the try block with the catch, hence we have a path where \"year\" is not rewritten\n            }\n            catch (Exception)\n            {\n                throw;\n            }\n            Console.WriteLine(this.year);\n        }\n    }\n\n    class Person10\n    {\n        int year = 1980; // Noncompliant\n        public Person10()\n        {\n            M(out ((this.year)));\n        }\n\n        void M(out int x) { x = 42; }\n    }\n\n    class Person11\n    {\n        int a = 42; // Noncompliant\n\n        public Person11() => a = 42;\n    }\n\n    class Person12\n    {\n        int age;\n        public Person12()\n        {\n            age = 0; // FN\n        }\n    }\n\n    class Person13\n    {\n        static int x = 42; // Noncompliant {{Remove the static member initializer, a static constructor or module initializer sets an initial value for the member.}}\n        static int y;\n        static int z { get; } = 2; // Noncompliant\n        static event EventHandler w = (a, b) => { }; // Noncompliant\n        static Person13()\n        {\n            x = 41;\n            y = 41;\n            z = 2;\n            w = (a, b) => { };\n        }\n    }\n\n    class Person14\n    {\n        static int x = 42; // Compliant\n        static Person14()\n        {\n            Console.WriteLine(x);\n            x = 41;\n        }\n    }\n\n    class Person15\n    {\n        int age = 42;\n        public Person15()\n        {\n            Delegate d = new Action(() =>\n            {\n                Delegate c = new Action(() => { this.age = 40; });\n            });\n        }\n    }\n\n    class Person16\n    {\n        int a = 42;\n\n        private int b { get; set; } = 42;\n\n        event EventHandler c = (a, b) => { };\n\n        public Person16(Person16 other)\n        {\n            other.a = 0;\n            other.b = 0;\n            other.c = (a, b) => { };\n        }\n    }\n\n    internal class Person17\n    {\n        internal string Special = \"\";  // Noncompliant\n\n        internal Person17(string foo)\n        {\n            var x = true && true;\n            Special = foo;\n        }\n    }\n\n    class CSharp8_PersonA\n    {\n        int age = 42;\n        public CSharp8_PersonA(bool b, int age)\n        {\n            Console.Write(b switch\n                {\n                    true => $\"Age: {this.age}\",\n                    _ => \"N/A\"\n                }\n                );\n            this.age = age;\n        }\n    }\n\n    class CSharp8_PersonB\n    {\n        int[] ids = new int[0];\n        public CSharp8_PersonB(int[] ids)\n        {\n            this.ids ??= ids;\n        }\n    }\n\n    class BaseClass\n    {\n        int foo = 42; // Noncompliant\n        public BaseClass(int i)\n        {\n            foo = 42;\n        }\n    }\n    class NewClass : BaseClass\n    {\n        int baz = 0; // FN\n        public NewClass() : base(1)\n        {\n            baz = 0;\n        }\n    }\n\n    struct Struct1\n    {\n        // structs cannot initialize instance fields/properties at declaration, only const\n        const int a = 42;\n        static int b = 1; // Noncompliant\n        static int b2 = 2;\n\n        static Struct1() => b = 1;\n    }\n    class EmptyClassForCoverage { }\n    struct EmptyStructForCoverage { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MemberOverrideCallsBaseMember.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    class Base\n    {\n        public virtual int MyProperty { get; set; }\n        public virtual int MyProperty1 { get; set; }\n        public virtual int MyProperty2 { get; }\n        public virtual int MyProperty3 { get; }\n        public virtual int MyProperty4 { get; set; }\n\n        public virtual void Method(int[] numbers)\n        {\n        }\n        public virtual int Method2(int[] numbers)\n        {\n            return 1;\n        }\n        public virtual int Method3(int[] numbers)\n        {\n            return 1;\n        }\n        public virtual int Method4(int[] numbers)\n        {\n            return 1;\n        }\n        public virtual void Method(string s1, string s2)\n        {\n        }\n        public virtual void Method2(string s1, string s2)\n        {\n        }\n        public virtual void Method(int i, int[] numbers)\n        {\n        }\n        public virtual void Method3(string s1, string s2)\n        {\n        }\n        public virtual void Method4(string s1, params string[] s2)\n        {\n        }\n        public virtual void Method5(string s1, string s2)\n        {\n        }\n\n        public virtual int Method6(string s1, string s2)\n        {\n            return 1;\n        }\n\n        public virtual void Method8(string s1, string s2 = null)\n        {\n        }\n\n        protected virtual bool PrintMembers(System.Text.StringBuilder builder)  // for records a method with this name is generated by the compiler\n        {\n            return false;\n        }\n\n        public override bool Equals(object obj)\n        {\n            return base.Equals(obj);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    class Derived : Base\n    {\n        public override int MyProperty3 => 42;\n\n        public Base bbb;\n        public override int Method4(int[] numbers2) => base.Method4(numbers2);\n        public override void Method(string s1, string s2)\n        {\n            base.Method(s2, s1);\n        }\n        public override void Method2(string s1, string s2)\n        {\n            bbb.Method2(s1, s2);\n        }\n        public override sealed void Method(int i, int[] numbers)\n        {\n            base.Method(i, numbers);\n        }\n        public override void Method3(string s1, string s2)\n        {\n            base.Method(s1, s2);\n        }\n        public override void Method4(string s1, params string[] s2)\n        {\n            base.Method4(s1);\n        }\n        public override void Method5(string s1, string s2)\n        {\n            base.Method5(s1, null);\n        }\n        public override int Method6(string s1, string s2)\n        {\n            return base.NonExisteng(s1, s2); // Error [CS0117] 'Base' does not contain a definition for 'NonExisteng'\n        }\n        public override void Method7(string s1, string s2) // Error [CS0115] no suitable method found to override\n        {\n            return base.Method7(s1, s2); // Error [CS0117] 'Base' does not contain a definition for 'Method7'\n        }\n        public override void Method8(string s1, string s2)\n        {\n            base.Method8(s1, s2);\n        }\n    }\n\n    public class A\n    {\n        public virtual void Foo1(int a)\n        {\n        }\n\n        public virtual void Foo2(int a = 42)\n        {\n        }\n\n        public virtual void Foo3(int a)\n        {\n        }\n        public virtual void Foo4(int a = 42)\n        {\n        }\n    }\n\n    public class B : A\n    {\n        public override void Foo1(int a = 1)\n        {\n            base.Foo1(a);\n        }\n\n        public override void Foo2(int a = 1)\n        {\n            base.Foo2(a);\n        }\n\n        /// <summary>\n        ///\n        /// </summary>\n        /// <param name=\"a\"></param>\n        public override void Foo3(int a)\n        {\n            base.Foo3(a);\n        }\n\n        public virtual void Foo4(int a)\n        {\n            base.Foo4(a);\n        }\n    }\n\n    public class MyBase\n    {\n        public virtual int MyProperty1 { get; }\n        public virtual int MyProperty2 { get; }\n    }\n\n    public class MyDerived : MyBase\n    {\n        private MyBase instance;\n\n        public override int MyProperty2\n        {\n            get\n            {\n                return instance.MyProperty2;\n            }\n        }\n    }\n\n    public class MyCustomAttribute : Attribute\n    {\n        public string Text { get; set; }\n    }\n\n    public class AnotherCustomAttribute : Attribute\n    {\n        public string Text { get; set; }\n    }\n\n    class MyAttributesTestCase\n    {\n        [MyCustomAttribute]\n        public virtual int PropertyWithSameInheritedAttributeOnAllLevels => 1;\n        [MyCustomAttribute]\n        public virtual int PropertyWithInheritedAttributeOnFirstLevel => 1;\n        public virtual int PropertyWithInheritedAttributeOnSecondLevel => 1;\n        public virtual int PropertyWithInheritedAttributeOnThirdLevel => 1;\n        [MyCustomAttribute]\n        public virtual int PropertyWithSameInheritedAttributeOnFirstAndSecondLevels => 1;\n        [MyCustomAttribute]\n        public virtual int PropertyWithSameInheritedAttributeOnFirstAndThirdLevels => 1;\n        [MyCustomAttribute]\n        public virtual int PropertyWithDifferentInheritedAttributeOnFirstAndSecondLevels => 1;\n\n        [MyCustomAttribute]\n        public virtual int MethodWithSameInheritedAttributeOnAllLevels()\n        {\n            return 1;\n        }\n        [MyCustomAttribute]\n        public virtual int MethodWithInheritedAttributeOnFirstLevel()\n        {\n            return 1;\n        }\n        public virtual int MethodWithInheritedAttributeOnSecondLevel()\n        {\n            return 1;\n        }\n        public virtual int MethodWithInheritedAttributeOnThirdLevel()\n        {\n            return 1;\n        }\n        [MyCustomAttribute]\n        public virtual int MethodWithSameInheritedAttributeOnFirstAndSecondLevels()\n        {\n            return 1;\n        }\n        [MyCustomAttribute]\n        public virtual int MethodWithSameInheritedAttributeOnFirstAndThirdLevels()\n        {\n            return 1;\n        }\n        [MyCustomAttribute]\n        public virtual int MethodWithDifferentInheritedAttributeOnFirstAndSecondLevels()\n        {\n            return 1;\n        }\n    }\n\n    class MySubAttributesTestCase : MyAttributesTestCase\n    {\n        [MyCustomAttribute]\n        public override int PropertyWithSameInheritedAttributeOnAllLevels => base.PropertyWithSameInheritedAttributeOnAllLevels;\n        public override int PropertyWithInheritedAttributeOnFirstLevel => base.PropertyWithInheritedAttributeOnFirstLevel;\n        [MyCustomAttribute]\n        public override int PropertyWithInheritedAttributeOnSecondLevel => base.PropertyWithInheritedAttributeOnSecondLevel;\n        [MyCustomAttribute]\n        public override int PropertyWithSameInheritedAttributeOnFirstAndSecondLevels => base.PropertyWithSameInheritedAttributeOnFirstAndSecondLevels;\n        public override int PropertyWithSameInheritedAttributeOnFirstAndThirdLevels => base.PropertyWithSameInheritedAttributeOnFirstAndThirdLevels;\n        [AnotherCustomAttribute]\n        public override int PropertyWithDifferentInheritedAttributeOnFirstAndSecondLevels => base.PropertyWithDifferentInheritedAttributeOnFirstAndSecondLevels;\n\n        [MyCustomAttribute]\n        public override int MethodWithSameInheritedAttributeOnAllLevels() => base.MethodWithSameInheritedAttributeOnAllLevels();\n        public override int MethodWithInheritedAttributeOnFirstLevel() => base.MethodWithInheritedAttributeOnFirstLevel();\n        [MyCustomAttribute]\n        public override int MethodWithInheritedAttributeOnSecondLevel() => base.MethodWithInheritedAttributeOnSecondLevel();\n        [MyCustomAttribute]\n        public override int MethodWithSameInheritedAttributeOnFirstAndSecondLevels() => base.MethodWithSameInheritedAttributeOnFirstAndSecondLevels();\n        public override int MethodWithSameInheritedAttributeOnFirstAndThirdLevels() => base.MethodWithSameInheritedAttributeOnFirstAndThirdLevels();\n        [AnotherCustomAttribute]\n        public override int MethodWithDifferentInheritedAttributeOnFirstAndSecondLevels() => base.MethodWithDifferentInheritedAttributeOnFirstAndSecondLevels();\n    }\n\n    class MySubSubAttributesTestCase : MySubAttributesTestCase\n    {\n        [MyCustomAttribute]\n        public override int PropertyWithSameInheritedAttributeOnAllLevels => base.PropertyWithSameInheritedAttributeOnAllLevels;\n        public override int PropertyWithInheritedAttributeOnFirstLevel => base.PropertyWithInheritedAttributeOnFirstLevel;\n        public override int PropertyWithInheritedAttributeOnSecondLevel => base.PropertyWithInheritedAttributeOnSecondLevel;\n        [MyCustomAttribute]\n        public override int PropertyWithInheritedAttributeOnThirdLevel => base.PropertyWithInheritedAttributeOnThirdLevel;\n        public override int PropertyWithSameInheritedAttributeOnFirstAndSecondLevels => base.PropertyWithSameInheritedAttributeOnFirstAndSecondLevels;\n        [MyCustomAttribute]\n        public override int PropertyWithSameInheritedAttributeOnFirstAndThirdLevels => base.PropertyWithSameInheritedAttributeOnFirstAndThirdLevels;\n\n        [MyCustomAttribute]\n        public override int MethodWithSameInheritedAttributeOnAllLevels() => base.MethodWithSameInheritedAttributeOnAllLevels();\n        public override int MethodWithInheritedAttributeOnFirstLevel() => base.MethodWithInheritedAttributeOnFirstLevel();\n        public override int MethodWithInheritedAttributeOnSecondLevel() => base.MethodWithInheritedAttributeOnSecondLevel();\n        [MyCustomAttribute]\n        public override int MethodWithInheritedAttributeOnThirdLevel() => base.MethodWithInheritedAttributeOnThirdLevel();\n        public override int MethodWithSameInheritedAttributeOnFirstAndSecondLevels() => base.MethodWithSameInheritedAttributeOnFirstAndSecondLevels();\n        [MyCustomAttribute]\n        public override int MethodWithSameInheritedAttributeOnFirstAndThirdLevels() => base.MethodWithSameInheritedAttributeOnFirstAndThirdLevels();\n    }\n\n    struct StructTest\n    {\n        public override bool Equals(object obj) => // Compliant\n            base.Equals(obj);\n\n        public override int GetHashCode() =>       // Compliant\n            base.GetHashCode();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MemberOverrideCallsBaseMember.Latest.Fixed.cs",
    "content": "﻿record Base\n{\n    public virtual int MyProperty1 { get; init; }\n    public virtual int MyProperty2 { get; init; }\n    public virtual int MyProperty3 { get; init; }\n    public virtual int MyProperty4 { get; init; }\n    public virtual int MyProperty5 { get; init; }\n    public virtual int MyProperty6 { init; } // Error [CS8051]\n    public virtual int MyProperty7 { get; }\n    public virtual int MyProperty8 { get; init; }\n    public virtual int MyProperty9 { get; init; }\n    public virtual int MyProperty10 { get; init; }\n    public virtual int MyProperty11 { get; init; }\n    public virtual int MyProperty12 { get; init; }\n    public virtual int MyProperty13 { get; init; }\n    public virtual void Method() { }\n}\n\nrecord Derived : Base\n{\n    bool isInitialized;\n    int backingField;\n    public override int MyProperty2 { get => base.MyProperty2; init => base.MyProperty2 = value + 1; }\n    public override int MyProperty3 { get => base.MyProperty3; init { base.MyProperty2 = value; isInitialized = true; } }\n    /// <summary>\n    ///  This is some documentation which should disble the issue on this property.\n    /// </summary>\n    public override int MyProperty4 { get => base.MyProperty1; init => base.MyProperty1 = value; }\n    public override sealed int MyProperty5 { get => base.MyProperty5; init => base.MyProperty5 = value; }\n    public override int MyProperty6 { get => base.MyProperty6; init => base.MyProperty6 = value; } // Error [CS0154, CS0545] The property or indexer 'property' cannot be used in this context because it lacks the get accessor\n    public override int MyProperty7 { get => base.MyProperty7; init => base.MyProperty7 = value; } // Error [CS0200, CS0546] Property or indexer 'property' cannot be assigned to -- it is read only\n    public sealed int MyProperty10 { get => base.MyProperty10; init => base.MyProperty10 = value; } // Error [CS0238] 'member' cannot be sealed because it is not an override\n    public override int MyProperty11 { get => base.MyProperty11; init => backingField = value; }\n    public override int MyProperty12 { get => base.MyProperty5; init => base.MyProperty5 = value; }\n    public override int MyProperty13 { get; init => base.MyProperty13 = value; }\n    public override int MyProperty14 { get => base.MyProperty14; init => base.MyProperty14 = value; } // Error [CS0115, CS0117, CS0117] no suitable method found to override, 'Base' does not contain a definition for 'MyProperty14'\n}\n\nnamespace CompilerGeneratedMethods\n{\n    record Base\n    {\n        public override string ToString() => \"Some custom ToString\";\n    }\n\n    record Derived : Base\n    {\n        public override string ToString() =>\n            base.ToString(); // Compliant. Without the override the compiler generates a ToString instead of calling base.ToString\n\n        protected override bool PrintMembers(System.Text.StringBuilder builder) =>\n            base.PrintMembers(builder); // Compliant. The generated PrintMembers implementation would add the properties of Derived to the builder.\n\n        public override bool Equals(Base other) // Error [CS0111] Type 'Derived' already defines a member called 'Equals' with the same parameter types\n            => base.Equals(other);\n\n        public override int GetHashCode() =>\n            base.GetHashCode(); // Compliant.\n    }\n\n    record Underived\n    {\n        public override string ToString() =>\n            base.ToString(); // Compliant. Prevents the compiler from generating a custom ToString method.\n    }\n\n    record struct RecordStruct\n    {\n        public override string ToString() =>\n            base.ToString(); // Compliant. Prevents the compiler from generating a custom ToString method.\n    }\n}\n\nnamespace PartialProperties\n{\n    public partial class Partial\n    {\n        public virtual partial int Prop1 { get; }\n        public virtual partial int Prop2 { get; set; }\n    }\n\n    public partial class Partial\n    {\n        public virtual partial int Prop1 => 42;\n\n        private int _value;\n        public virtual partial int Prop2\n        {\n            get => _value;\n            set => _value = value;\n        }\n    }\n\n    public class Derived : Partial\n    {\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MemberOverrideCallsBaseMember.Latest.cs",
    "content": "﻿record Base\n{\n    public virtual int MyProperty1 { get; init; }\n    public virtual int MyProperty2 { get; init; }\n    public virtual int MyProperty3 { get; init; }\n    public virtual int MyProperty4 { get; init; }\n    public virtual int MyProperty5 { get; init; }\n    public virtual int MyProperty6 { init; } // Error [CS8051]\n    public virtual int MyProperty7 { get; }\n    public virtual int MyProperty8 { get; init; }\n    public virtual int MyProperty9 { get; init; }\n    public virtual int MyProperty10 { get; init; }\n    public virtual int MyProperty11 { get; init; }\n    public virtual int MyProperty12 { get; init; }\n    public virtual int MyProperty13 { get; init; }\n    public virtual void Method() { }\n}\n\nrecord Derived : Base\n{\n    bool isInitialized;\n    int backingField;\n\n    public override int MyProperty1 { get => base.MyProperty1; init => base.MyProperty1 = value; }      // Noncompliant\n    public override int MyProperty2 { get => base.MyProperty2; init => base.MyProperty2 = value + 1; }\n    public override int MyProperty3 { get => base.MyProperty3; init { base.MyProperty2 = value; isInitialized = true; } }\n    /// <summary>\n    ///  This is some documentation which should disble the issue on this property.\n    /// </summary>\n    public override int MyProperty4 { get => base.MyProperty1; init => base.MyProperty1 = value; }\n    public override sealed int MyProperty5 { get => base.MyProperty5; init => base.MyProperty5 = value; }\n    public override int MyProperty6 { get => base.MyProperty6; init => base.MyProperty6 = value; } // Error [CS0154, CS0545] The property or indexer 'property' cannot be used in this context because it lacks the get accessor\n    public override int MyProperty7 { get => base.MyProperty7; init => base.MyProperty7 = value; } // Error [CS0200, CS0546] Property or indexer 'property' cannot be assigned to -- it is read only\n    public override int MyProperty8 { init => base.MyProperty8 = value; } // Noncompliant\n    public override int MyProperty9 { get => base.MyProperty9; } // Noncompliant\n    public sealed int MyProperty10 { get => base.MyProperty10; init => base.MyProperty10 = value; } // Error [CS0238] 'member' cannot be sealed because it is not an override\n    public override int MyProperty11 { get => base.MyProperty11; init => backingField = value; }\n    public override int MyProperty12 { get => base.MyProperty5; init => base.MyProperty5 = value; }\n    public override int MyProperty13 { get; init => base.MyProperty13 = value; }\n    public override int MyProperty14 { get => base.MyProperty14; init => base.MyProperty14 = value; } // Error [CS0115, CS0117, CS0117] no suitable method found to override, 'Base' does not contain a definition for 'MyProperty14'\n    public override void Method() => base.Method(); // Noncompliant\n}\n\nnamespace CompilerGeneratedMethods\n{\n    record Base\n    {\n        public override string ToString() => \"Some custom ToString\";\n    }\n\n    record Derived : Base\n    {\n        public override string ToString() =>\n            base.ToString(); // Compliant. Without the override the compiler generates a ToString instead of calling base.ToString\n\n        protected override bool PrintMembers(System.Text.StringBuilder builder) =>\n            base.PrintMembers(builder); // Compliant. The generated PrintMembers implementation would add the properties of Derived to the builder.\n\n        public override bool Equals(Base other) // Error [CS0111] Type 'Derived' already defines a member called 'Equals' with the same parameter types\n            => base.Equals(other);\n\n        public override int GetHashCode() =>\n            base.GetHashCode(); // Compliant.\n    }\n\n    record Underived\n    {\n        public override string ToString() =>\n            base.ToString(); // Compliant. Prevents the compiler from generating a custom ToString method.\n    }\n\n    record struct RecordStruct\n    {\n        public override string ToString() =>\n            base.ToString(); // Compliant. Prevents the compiler from generating a custom ToString method.\n    }\n}\n\nnamespace PartialProperties\n{\n    public partial class Partial\n    {\n        public virtual partial int Prop1 { get; }\n        public virtual partial int Prop2 { get; set; }\n    }\n\n    public partial class Partial\n    {\n        public virtual partial int Prop1 => 42;\n\n        private int _value;\n        public virtual partial int Prop2\n        {\n            get => _value;\n            set => _value = value;\n        }\n    }\n\n    public class Derived : Partial\n    {\n        public override int Prop1 => base.Prop1; // Noncompliant\n\n        public override int Prop2                // Noncompliant\n        {\n            get => base.Prop2;\n            set => base.Prop2 = value;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MemberOverrideCallsBaseMember.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    class Base\n    {\n        public virtual int MyProperty { get; set; }\n        public virtual int MyProperty1 { get; set; }\n        public virtual int MyProperty2 { get; }\n        public virtual int MyProperty3 { get; }\n        public virtual int MyProperty4 { get; set; }\n\n        public virtual void Method(int[] numbers)\n        {\n        }\n        public virtual int Method2(int[] numbers)\n        {\n            return 1;\n        }\n        public virtual int Method3(int[] numbers)\n        {\n            return 1;\n        }\n        public virtual int Method4(int[] numbers)\n        {\n            return 1;\n        }\n        public virtual void Method(string s1, string s2)\n        {\n        }\n        public virtual void Method2(string s1, string s2)\n        {\n        }\n        public virtual void Method(int i, int[] numbers)\n        {\n        }\n        public virtual void Method3(string s1, string s2)\n        {\n        }\n        public virtual void Method4(string s1, params string[] s2)\n        {\n        }\n        public virtual void Method5(string s1, string s2)\n        {\n        }\n\n        public virtual int Method6(string s1, string s2)\n        {\n            return 1;\n        }\n\n        public virtual void Method8(string s1, string s2 = null)\n        {\n        }\n\n        protected virtual bool PrintMembers(System.Text.StringBuilder builder)  // for records a method with this name is generated by the compiler\n        {\n            return false;\n        }\n\n        public override bool Equals(object obj)\n        {\n            return base.Equals(obj);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    class Derived : Base\n    {\n        public override int MyProperty { get { return base.MyProperty; } set { base.MyProperty = value; } } // Noncompliant\n        public override int MyProperty1 { get { return base.MyProperty1; } } // Noncompliant\n        public override int MyProperty2 => base.MyProperty2; // Noncompliant {{Remove this property 'MyProperty2' to simply inherit its behavior.}}\n//      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        public override int MyProperty3 => 42;\n        public override int MyProperty4 // Noncompliant\n        {\n            get => base.MyProperty4;\n            set => base.MyProperty4 = value;\n        }\n\n        public Base bbb;\n        public override void Method(int[] numbers) // Noncompliant {{Remove this method 'Method' to simply inherit its behavior.}}\n        {\n            base.Method(numbers);\n        }\n        public override int Method2(int[] numbers) // Noncompliant\n        {\n            return base.Method2(numbers);\n        }\n        public override int Method3(int[] numbers) => base.Method3(numbers); // Noncompliant\n        public override int Method4(int[] numbers2) => base.Method4(numbers2);\n        public override void Method(string s1, string s2)\n        {\n            base.Method(s2, s1);\n        }\n        public override void Method2(string s1, string s2)\n        {\n            bbb.Method2(s1, s2);\n        }\n        public override sealed void Method(int i, int[] numbers)\n        {\n            base.Method(i, numbers);\n        }\n        public override void Method3(string s1, string s2)\n        {\n            base.Method(s1, s2);\n        }\n        public override void Method4(string s1, params string[] s2)\n        {\n            base.Method4(s1);\n        }\n        public override void Method5(string s1, string s2)\n        {\n            base.Method5(s1, null);\n        }\n        public override int Method6(string s1, string s2)\n        {\n            return base.NonExisteng(s1, s2); // Error [CS0117] 'Base' does not contain a definition for 'NonExisteng'\n        }\n        public override void Method7(string s1, string s2) // Error [CS0115] no suitable method found to override\n        {\n            return base.Method7(s1, s2); // Error [CS0117] 'Base' does not contain a definition for 'Method7'\n        }\n        public override void Method8(string s1, string s2)\n        {\n            base.Method8(s1, s2);\n        }\n        protected override bool PrintMembers(System.Text.StringBuilder builder) => base.PrintMembers(builder); // Noncompliant\n    }\n\n    public class A\n    {\n        public virtual void Foo1(int a)\n        {\n        }\n\n        public virtual void Foo2(int a = 42)\n        {\n        }\n\n        public virtual void Foo3(int a)\n        {\n        }\n        public virtual void Foo4(int a = 42)\n        {\n        }\n    }\n\n    public class B : A\n    {\n        public override void Foo1(int a = 1)\n        {\n            base.Foo1(a);\n        }\n\n        public override void Foo2(int a = 1)\n        {\n            base.Foo2(a);\n        }\n\n        /// <summary>\n        ///\n        /// </summary>\n        /// <param name=\"a\"></param>\n        public override void Foo3(int a)\n        {\n            base.Foo3(a);\n        }\n\n        public virtual void Foo4(int a)\n        {\n            base.Foo4(a);\n        }\n    }\n\n    public class MyBase\n    {\n        public virtual int MyProperty1 { get; }\n        public virtual int MyProperty2 { get; }\n    }\n\n    public class MyDerived : MyBase\n    {\n        private MyBase instance;\n        public override int MyProperty1 // Noncompliant\n        {\n            get\n            {\n                return base.MyProperty1;\n            }\n        }\n\n        public override int MyProperty2\n        {\n            get\n            {\n                return instance.MyProperty2;\n            }\n        }\n    }\n\n    public class MyCustomAttribute : Attribute\n    {\n        public string Text { get; set; }\n    }\n\n    public class AnotherCustomAttribute : Attribute\n    {\n        public string Text { get; set; }\n    }\n\n    class MyAttributesTestCase\n    {\n        [MyCustomAttribute]\n        public virtual int PropertyWithSameInheritedAttributeOnAllLevels => 1;\n        [MyCustomAttribute]\n        public virtual int PropertyWithInheritedAttributeOnFirstLevel => 1;\n        public virtual int PropertyWithInheritedAttributeOnSecondLevel => 1;\n        public virtual int PropertyWithInheritedAttributeOnThirdLevel => 1;\n        [MyCustomAttribute]\n        public virtual int PropertyWithSameInheritedAttributeOnFirstAndSecondLevels => 1;\n        [MyCustomAttribute]\n        public virtual int PropertyWithSameInheritedAttributeOnFirstAndThirdLevels => 1;\n        [MyCustomAttribute]\n        public virtual int PropertyWithDifferentInheritedAttributeOnFirstAndSecondLevels => 1;\n\n        [MyCustomAttribute]\n        public virtual int MethodWithSameInheritedAttributeOnAllLevels()\n        {\n            return 1;\n        }\n        [MyCustomAttribute]\n        public virtual int MethodWithInheritedAttributeOnFirstLevel()\n        {\n            return 1;\n        }\n        public virtual int MethodWithInheritedAttributeOnSecondLevel()\n        {\n            return 1;\n        }\n        public virtual int MethodWithInheritedAttributeOnThirdLevel()\n        {\n            return 1;\n        }\n        [MyCustomAttribute]\n        public virtual int MethodWithSameInheritedAttributeOnFirstAndSecondLevels()\n        {\n            return 1;\n        }\n        [MyCustomAttribute]\n        public virtual int MethodWithSameInheritedAttributeOnFirstAndThirdLevels()\n        {\n            return 1;\n        }\n        [MyCustomAttribute]\n        public virtual int MethodWithDifferentInheritedAttributeOnFirstAndSecondLevels()\n        {\n            return 1;\n        }\n    }\n\n    class MySubAttributesTestCase : MyAttributesTestCase\n    {\n        [MyCustomAttribute]\n        public override int PropertyWithSameInheritedAttributeOnAllLevels => base.PropertyWithSameInheritedAttributeOnAllLevels;\n        public override int PropertyWithInheritedAttributeOnFirstLevel => base.PropertyWithInheritedAttributeOnFirstLevel;\n        [MyCustomAttribute]\n        public override int PropertyWithInheritedAttributeOnSecondLevel => base.PropertyWithInheritedAttributeOnSecondLevel;\n        public override int PropertyWithInheritedAttributeOnThirdLevel => base.PropertyWithInheritedAttributeOnThirdLevel; // Noncompliant\n        [MyCustomAttribute]\n        public override int PropertyWithSameInheritedAttributeOnFirstAndSecondLevels => base.PropertyWithSameInheritedAttributeOnFirstAndSecondLevels;\n        public override int PropertyWithSameInheritedAttributeOnFirstAndThirdLevels => base.PropertyWithSameInheritedAttributeOnFirstAndThirdLevels;\n        [AnotherCustomAttribute]\n        public override int PropertyWithDifferentInheritedAttributeOnFirstAndSecondLevels => base.PropertyWithDifferentInheritedAttributeOnFirstAndSecondLevels;\n\n        [MyCustomAttribute]\n        public override int MethodWithSameInheritedAttributeOnAllLevels() => base.MethodWithSameInheritedAttributeOnAllLevels();\n        public override int MethodWithInheritedAttributeOnFirstLevel() => base.MethodWithInheritedAttributeOnFirstLevel();\n        [MyCustomAttribute]\n        public override int MethodWithInheritedAttributeOnSecondLevel() => base.MethodWithInheritedAttributeOnSecondLevel();\n        public override int MethodWithInheritedAttributeOnThirdLevel() => base.MethodWithInheritedAttributeOnThirdLevel(); // Noncompliant\n        [MyCustomAttribute]\n        public override int MethodWithSameInheritedAttributeOnFirstAndSecondLevels() => base.MethodWithSameInheritedAttributeOnFirstAndSecondLevels();\n        public override int MethodWithSameInheritedAttributeOnFirstAndThirdLevels() => base.MethodWithSameInheritedAttributeOnFirstAndThirdLevels();\n        [AnotherCustomAttribute]\n        public override int MethodWithDifferentInheritedAttributeOnFirstAndSecondLevels() => base.MethodWithDifferentInheritedAttributeOnFirstAndSecondLevels();\n    }\n\n    class MySubSubAttributesTestCase : MySubAttributesTestCase\n    {\n        [MyCustomAttribute]\n        public override int PropertyWithSameInheritedAttributeOnAllLevels => base.PropertyWithSameInheritedAttributeOnAllLevels;\n        public override int PropertyWithInheritedAttributeOnFirstLevel => base.PropertyWithInheritedAttributeOnFirstLevel;\n        public override int PropertyWithInheritedAttributeOnSecondLevel => base.PropertyWithInheritedAttributeOnSecondLevel;\n        [MyCustomAttribute]\n        public override int PropertyWithInheritedAttributeOnThirdLevel => base.PropertyWithInheritedAttributeOnThirdLevel;\n        public override int PropertyWithSameInheritedAttributeOnFirstAndSecondLevels => base.PropertyWithSameInheritedAttributeOnFirstAndSecondLevels;\n        [MyCustomAttribute]\n        public override int PropertyWithSameInheritedAttributeOnFirstAndThirdLevels => base.PropertyWithSameInheritedAttributeOnFirstAndThirdLevels;\n\n        [MyCustomAttribute]\n        public override int MethodWithSameInheritedAttributeOnAllLevels() => base.MethodWithSameInheritedAttributeOnAllLevels();\n        public override int MethodWithInheritedAttributeOnFirstLevel() => base.MethodWithInheritedAttributeOnFirstLevel();\n        public override int MethodWithInheritedAttributeOnSecondLevel() => base.MethodWithInheritedAttributeOnSecondLevel();\n        [MyCustomAttribute]\n        public override int MethodWithInheritedAttributeOnThirdLevel() => base.MethodWithInheritedAttributeOnThirdLevel();\n        public override int MethodWithSameInheritedAttributeOnFirstAndSecondLevels() => base.MethodWithSameInheritedAttributeOnFirstAndSecondLevels();\n        [MyCustomAttribute]\n        public override int MethodWithSameInheritedAttributeOnFirstAndThirdLevels() => base.MethodWithSameInheritedAttributeOnFirstAndThirdLevels();\n    }\n\n    struct StructTest\n    {\n        public override bool Equals(object obj) => // Compliant\n            base.Equals(obj);\n\n        public override int GetHashCode() =>       // Compliant\n            base.GetHashCode();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MemberShadowsOuterStaticMember.Latest.cs",
    "content": "﻿using System;\n\nnamespace CSharp9\n{\n    record OuterRecord\n    {\n        private delegate void SomeName();\n        private static int F;\n        public static int MyProperty { get; set; }\n\n        class InnerClass\n        {\n            class SomeName      // Noncompliant {{Rename this class to not shadow the outer class' member with the same name.}}\n            {\n                private int F;  // Noncompliant {{Rename this field to not shadow the outer class' member with the same name.}}\n                private int InnerOnlyField;\n            }\n\n            public static int MyProperty { get; set; }  //Noncompliant {{Rename this property to not shadow the outer class' member with the same name.}}\n            public static int InnerOnlyProperty { get; set; }\n        }\n\n        record InnerRecord\n        {\n            class SomeName      // Noncompliant {{Rename this class to not shadow the outer class' member with the same name.}}\n            {\n                private int F;  // Noncompliant {{Rename this field to not shadow the outer class' member with the same name.}}\n                private int InnerOnlyField;\n            }\n\n            public static int MyProperty { get; set; }  //Noncompliant {{Rename this property to not shadow the outer class' member with the same name.}}\n            public static int InnerOnlyProperty { get; set; }\n        }\n    }\n\n    class OuterClass\n    {\n        private delegate void SomeName();\n        private static int F;\n        public static int MyProperty { get; set; }\n\n        record InnerRecord\n        {\n            class SomeName      // Noncompliant\n            {\n                private int F;  // Noncompliant\n                private int InnerOnlyField;\n            }\n\n            public static int MyProperty { get; set; }  //Noncompliant\n            public static int InnerOnlyProperty { get; set; }\n        }\n    }\n\n    public interface OuterTypes\n    {\n        public class SomeClass { }\n        public interface SomeInterface { }\n        public struct SomeStruct { }\n        public enum SomeEnum { }\n\n        public delegate void SomeDelegate(int x);\n\n        public interface InnerTypes\n        {\n            public enum SomeClass { } // Noncompliant\n            public struct SomeInterface { } // Noncompliant\n            public class SomeStruct { } // Noncompliant\n            public enum SomeEnum { } // Noncompliant\n\n            public delegate void SomeDelegate(int x); // Noncompliant\n        }\n    }\n}\n\nnamespace CSharp10\n{\n    record struct OuterRecordStruct\n    {\n        private delegate void SomeName();\n        private static int F;\n        public static int MyProperty { get; set; }\n\n        class InnerClass\n        {\n            record struct SomeName // Noncompliant {{Rename this record struct to not shadow the outer class' member with the same name.}}\n            //            ^^^^^^^^\n            {\n                private int F;     // Noncompliant {{Rename this field to not shadow the outer class' member with the same name.}}\n                //          ^\n                private int InnerOnlyField;\n            }\n\n            public static int MyProperty { get; set; }  // Noncompliant\n            public static int InnerOnlyProperty { get; set; }\n        }\n\n        record struct InnerRecordStruct\n        {\n            record SomeName        // Noncompliant {{Rename this record to not shadow the outer class' member with the same name.}}\n            {\n                private int F;     // Noncompliant\n                private int InnerOnlyField;\n            }\n\n            public static int MyProperty { get; set; }  // Noncompliant\n            public static int InnerOnlyProperty { get; set; }\n        }\n    }\n}\n\nnamespace CSharp11\n{\n    public interface OuterInterface\n    {\n        public static int StaticFoo1 => 42;\n        public static int StaticFoo2 => 42;\n        public static int StaticFoo3 => 42;\n        public static int StaticFoo4 => 42;\n        public static int StaticFoo5 => 42;\n\n        public static int StaticFoo6 => 42;\n        public static int StaticFoo7 => 42;\n\n        public static virtual int StaticVirtualFoo1 => 42;\n        public static abstract int StaticAbstractFoo1 { get; }\n        public const int ConstFoo1 = 42;\n\n        public abstract class InnerClass\n        {\n            public int StaticFoo1 => 42; // Noncompliant\n            public const int StaticFoo2 = 42; // Noncompliant\n            public virtual int StaticFoo3 => 42; // Noncompliant\n            public abstract int StaticFoo4 { get; } // Noncompliant\n            public static int StaticFoo5 => 42; // Noncompliant\n\n            public int StaticVirtualFoo1 => 42; // Compliant, you cannot invoke Interface.Member for virtual members, only on type parameters\n            public int StaticAbstractFoo1 => 42; // Compliant, you cannot invoke Interface.Member for abstract members, only on type parameters\n\n            public int ConstFoo1 => 42; // Noncompliant\n        }\n\n        public interface InnerInterface\n        {\n            public int StaticFoo1 => 42; // Noncompliant\n            public const int StaticFoo2 = 42; // Noncompliant\n            public virtual int StaticFoo3 => 42; // Noncompliant\n            public abstract int StaticFoo4 { get; } // Noncompliant\n            public static int StaticFoo5 => 42; // Noncompliant\n\n            public static virtual int StaticFoo6 => 42; // Compliant, you cannot invoke Interface.Member for abstract/virtual members, only on type parameters \n            public static abstract int StaticFoo7 { get; } // Compliant, you cannot invoke Interface.Member for abstract/virtual members, only on type parameters\n\n            public int StaticVirtualFoo1 => 42; // Compliant, you cannot invoke Interface.Member for virtual members, only on type parameters\n            public int StaticAbstractFoo1 => 42; // Compliant, you cannot invoke Interface.Member for abstract members, only on type parameters\n\n            public int ConstFoo1 => 42; // Noncompliant\n        }\n    }\n\n    public class OuterClass\n    {\n        public static int StaticFoo1 => 42;\n        public static int StaticFoo2 => 42;\n        public static int StaticFoo3 => 42;\n        public static int StaticFoo4 => 42;\n        public static int StaticFoo5 => 42;\n\n        public static int StaticFoo6 => 42;\n        public static int StaticFoo7 => 42;\n\n        public const int ConstFoo1 = 42;\n\n        public interface InnerInterface\n        {\n            public int StaticFoo1 => 42; // Noncompliant\n            public const int StaticFoo2 = 42; // Noncompliant\n            public virtual int StaticFoo3 => 42; // Noncompliant\n            public abstract int StaticFoo4 { get; } // Noncompliant\n            public static int StaticFoo5 => 42; // Noncompliant\n\n            public static virtual int StaticFoo6 => 42; // Compliant, you cannot invoke Interface.Member for abstract/virtual members, only on type parameters \n            public static abstract int StaticFoo7 { get; } // Compliant, you cannot invoke Interface.Member for abstract/virtual members, only on type parameters\n\n            public int ConstFoo1 => 42; // Noncompliant\n        }\n    }\n}\n\nnamespace CSharp13\n{\n    class Outer\n    {\n        public static int Prop { get; set; }\n\n        partial class Inner\n        {\n            public partial int Prop { get; } // Noncompliant\n        }\n\n        partial class Inner\n        {\n            public partial int Prop => 42;\n        }\n    }\n}\n\npublic static class ExtensionShadowsSelf\n{\n    public static int Prop { get; set; }\n    public static void Method(int i) { }\n\n    extension(string s)\n    {\n        public int Prop => 42;\n        public void Method(int j) { }\n    }\n}\n\npublic class Sample\n{\n    public static int Prop { get; set; }\n    public static void Method(int i) { }\n}\n\npublic static class ExtensionShadowsExtendedType\n{\n    extension(Sample s)\n    {\n        public int Prop => 42;\n        public void Method(int j) { }\n    }\n}\n\npublic static class ExtensionShadowsNestedExtendedType\n{\n    public class InnerSample\n    {\n        public static int Prop { get; set; }\n        public static void Method(int i) { } // Noncompliant FP https://sonarsource.atlassian.net/browse/NET-2740\n    }\n\n    extension(InnerSample s)\n    {\n        public static int Prop => 42;\n        public static void Method(int j) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MemberShadowsOuterStaticMember.cs",
    "content": "﻿using System;\n\nnamespace Tests.TestCases\n{\n    class MemberShadowsOuterStaticMember\n    {\n        private delegate void SomeName();\n\n        const int a = 5;\n        static event D event1;\n        static event D event2;\n        private static int F1;\n        private int F2;\n        private delegate void D();\n        public static int MyProperty { get; set; }\n\n        public static void M(int i) { }\n\n        class Inner\n        {\n            class SomeName // Noncompliant {{Rename this class to not shadow the outer class' member with the same name.}}\n            //    ^^^^^^^^\n            {\n                private int F1; // Noncompliant {{Rename this field to not shadow the outer class' member with the same name.}}\n                //          ^^\n                private int F2; // Compliant: Non static.\n            }\n\n            public static int MyProperty { get; set; } //Noncompliant {{Rename this property to not shadow the outer class' member with the same name.}}\n            const int a = 7; //Noncompliant\n            event D event1; //Noncompliant {{Rename this event to not shadow the outer class' member with the same name.}}\n            event D event2 //Noncompliant\n            {\n                add { }\n                remove { }\n            }\n            private delegate void D(); //Noncompliant {{Rename this delegate to not shadow the outer class' member with the same name.}}\n\n            private int F1; //Noncompliant\n\n            public void M(int j) { } // Noncompliant\n            public void M1() { }\n            public void MyMethod()\n            {\n                F1 = 5;\n                M(1);\n                D delegat = null;\n                SomeName delegat2 = null;\n                event1();\n                F1 = a;\n            }\n        }\n    }\n\n    struct OuterStruct\n    {\n        private delegate void SomeName();\n        private static int F;\n        public static int MyProperty { get; set; }\n        public enum SomeEnum { }\n\n        class InnerClass\n        {\n            class SomeName      // Noncompliant {{Rename this class to not shadow the outer class' member with the same name.}}\n            //    ^^^^^^^^\n            {\n                private int F;  // Noncompliant {{Rename this field to not shadow the outer class' member with the same name.}}\n                //          ^\n                private int InnerOnlyField;\n            }\n\n            public static int MyProperty { get; set; }  // Noncompliant\n            public static int InnerOnlyProperty { get; set; }\n        }\n\n        struct InnerStruct1 // Don't rename. It is used as a collision target\n        {\n            class SomeName      // Noncompliant\n            {\n                private int F;  // Noncompliant\n                private int InnerOnlyField;\n            }\n\n            public static int MyProperty { get; set; }  // Noncompliant\n            public static int InnerOnlyProperty { get; set; }\n        }\n\n        struct InnerStruct2\n        {\n            struct SomeName       // Noncompliant\n            {\n            }\n        }\n\n        struct InnerStruct3\n        {\n            struct InnerStruct1   // Noncompliant\n            {\n            }\n        }\n\n        struct InnerStruct4\n        {\n            enum InnerStruct1 { } // Noncompliant\n        }\n\n        struct InnerStruct5\n        {\n            struct SomeEnum { }   // Noncompliant\n        }\n    }\n\n    public class SomeEnumContainer \n    {\n        public enum SomeEnum\n        {\n            Value1, // Compliant\n            Value2, // Compliant\n        }\n\n        public static int Value1 = 42;\n        public const int Value2 = 43;\n    }\n\n    public static class ClassicExtensionShadowsNestedExtendedType\n    {\n        public class InnerSample\n        {\n            public static int Prop { get; set; } // Noncompliant\n            public static void Method(int i) { } // Noncompliant\n        }\n\n        public static int Prop => 42;\n        public static void Method(int j) { }\n    }\n\n    public class Sample\n    {\n        public static void Method(int i) { }\n    }\n\n    public static class ClassicExtensionShadowsExtendedType\n    {\n        public static void Method(this Sample sample, int j) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MemberShouldBeStatic.Latest.Partial.cs",
    "content": "﻿namespace CSharp13\n{\n    public partial class Partial\n    {\n        public partial int Prop => 42; // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MemberShouldBeStatic.Latest.cs",
    "content": "﻿using System;\nusing System.Diagnostics.CodeAnalysis;\n\nint TopLevelLocalfunction() => 0;       // Compliant, local functions are not class members\n\nvar localVariable = 42;\nint LocalFunction() => localVariable;   // Compliant\n\nnamespace Exceptions\n{\n    [DynamicallyAccessedMembersAttribute(DynamicallyAccessedMemberTypes.All)]\n    public class Foo\n    {\n        public int Value => 1; // Noncompliant FP, accessed via reflection\n    }\n\n    [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.PublicMethods)]\n    public class Bar\n    {\n        public int Value1 => 1; // Noncompliant FP\n        private int Value2 => 2; // Noncompliant TP DynamicallyAccessedMembers doesn't apply to private members\n\n        public int GetValue1() => 1; // Noncompliant FP\n        [return: DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] // Any DynamicallyAccessedMembers applied to the method, a parameter or the return value makes the method compliant\n        private int GetValue2() => 1; // Noncompliant FP\n    }\n}\n\nnamespace CSharp8\n{\n    public interface IUtilities\n    {\n        public int MagicNum { get { return 42; } } // Compliant, inside interface\n\n        private static string magicWord = \"please\";\n\n        public string MagicWord // Compliant, inside interface\n        {\n            get { return magicWord; }\n            set { magicWord = value; }\n        }\n\n        public int Sum(int a, int b) // Compliant, inside interface\n        {\n            return a + b;\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/3204\n    public class Repro_3204<TFirst, TSecond>\n    {\n        private protected int ProtectedInternal() => 42;    // Noncompliant, not accessible from outside this class\n    }\n}\n\nnamespace CSharp9\n{\n    public record Methods\n    {\n        private int instanceMember;\n        private static int staticMember;\n\n        public int Method1() => 0;                              // Noncompliant {{Make 'Method1' a static method.}}\n        public int Method2() => instanceMember;\n        public int Method3() => this.instanceMember;\n        public int Method4() => staticMember;                   // Noncompliant\n        public int Method5() => Methods.staticMember;           // Noncompliant\n        public int Method6() => new Methods().instanceMember;   // Noncompliant\n        public int Method7(Methods arg) => arg.instanceMember;  // Noncompliant\n\n        public static int StaticMethod1() => 0;\n        public static int StaticMethod2() => staticMember;\n    }\n\n    public class Lambda\n    {\n        private int instanceMember;\n        private static int staticMember;\n\n        public void Method()\n        {\n            var variable = 0;\n            Execute(() => instanceMember);\n            Execute(() => variable);\n\n            // These lambdas could be static, but the rule doesn't apply to lambdas\n            Execute(() => 0);\n            Execute(() => staticMember);\n        }\n\n        private void Execute(Func<int> f) { }\n    }\n}\n\nnamespace CSharp12\n{\n    public class PrimaryClass(SomeService s1, SomeService s2, SomeService s3)\n    {\n        public SomeService s1 = s1;\n        public SomeService s2 { get; set; } = s2;\n\n        private void Access_Parameter_OfPrimaryConstructor(int a, int b) // Compliant\n        {\n            _ = s1.Sum(a, b);\n            _ = s2.Sum(a, b);\n            _ = s3.Sum(a, b);\n        }\n\n        private void NoAccessTo_Parameter_OfPrimaryConstructor(int a, int b) // Noncompliant\n        {\n            _ = a + b;\n        }\n\n        private void MethodParameter_Hides_Parameter_OfPrimaryConstructor(int s1, int s2) // Noncompliant\n        {\n            _ = s1 + s2;\n        }\n    }\n\n    public record PrimaryRecord(SomeService s1, SomeService s2, SomeService s3)\n    {\n        public SomeService s1 = s1;\n        public SomeService s2 { get; set; } = s2;\n\n        private void Access_Parameter_OfPrimaryConstructor(int a, int b) // Compliant\n        {\n            _ = s1.Sum(a, b);\n            _ = s2.Sum(a, b);\n            _ = s3.Sum(a, b);\n        }\n\n        private void NoAccessTo_Parameter_OfPrimaryConstructor(int a, int b) // Noncompliant\n        {\n            _ = a + b;\n        }\n\n        private void MethodParameter_Hides_Parameter_OfPrimaryConstructor(int s1, int s2) // Noncompliant\n        {\n            _ = s1 + s2;\n        }\n    }\n\n\n    public class SomeService\n    {\n        private int x = 42;\n        public int Sum(int a, int b) => a + b + x;\n    }\n}\n\nnamespace CSharp13\n{\n    public partial class Partial\n    {\n        public partial int Prop { get; }\n    }\n}\n\nnamespace CSharp14\n{\n    public static class ReproNET2621 // https://sonarsource.atlassian.net/browse/NET-2621\n    {\n        extension(int number)\n        {\n            public bool IsEven => number % 2 == 0;  //  Compliant, number is instance data.\n            public bool IsOdd() => number % 2 != 0; //  Compliant, number is instance data.\n        }\n    }\n\n    public class FieldKeyword\n    {\n        public int Field1   // Compliant https://sonarsource.atlassian.net/browse/NET-2716\n        {\n            get;\n            set => field = value < 0 ? throw new ArgumentException(\"Value must be greater or equal 0.\") : value;\n        }\n    }\n\n    public class NullConditionalAssignment\n    {\n        private int x = 42;\n        private Sample sample = new Sample();\n        public int? RightSideInstanced(Sample a) => a?.Value = x;\n        public int? LeftSideInstanced(int a) => sample?.Value = a;\n\n        public class Sample\n        {\n            public int Value { get; set; }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MemberShouldBeStatic.WinForms.cs",
    "content": "﻿using System;\nusing System.Windows.Forms;\n\nnamespace MemberShouldBeStatic\n{\n    public class MyForm : IContainerControl\n    {\n        public Control ActiveControl { get; set; }\n\n        public bool ActivateControl(Control active) { return true; }\n\n        private void MethodWith1Argument(object sender) { Handle(); } // Noncompliant\n\n        private void MethodWith3Argument(object sender, MyEventArgs e, string other) { Handle(); } // Noncompliant\n        \n        private void SenderArgumentNotObject(string input, MyEventArgs e) { Handle(); } // Noncompliant\n\n        private void EventArgs_Handler(object sender, EventArgs e) { Handle(); } // Compliant\n\n        private void MyEventArgs_Handler(object sender, MyEventArgs e) { Handle(); } // Compliant\n\n        static void Handle() { }\n    }\n\n    public class NoForm \n    {\n        private void EventArgs_Handler(object sender, EventArgs e) { Handle(); } // Noncompliant\n\n        private void MyEventArgs_Handler(object sender, MyEventArgs e) { Handle(); } // Noncompliant\n\n        static void Handle() { }\n    }\n\n    public class MyEventArgs : EventArgs { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MemberShouldBeStatic.Xaml.cs",
    "content": "﻿using System;\nusing System.Windows;\n\nnamespace MemberShouldBeStatic\n{\n    // https://github.com/SonarSource/sonar-dotnet/issues/9695\n    public partial class Rerpo_9695 : FrameworkElement\n    {\n        private void MethodWith1Argument(object sender) { Handle(); }                              // Noncompliant\n        private void MethodWith3Argument(object sender, MyEventArgs e, string other) { Handle(); } // Noncompliant\n        private void SenderArgumentNotObject(string input, MyEventArgs e) { Handle(); }            // Noncompliant\n        private void EventArgs_Handler(object sender, EventArgs e) { Handle(); }                   // Compliant\n        private void MyEventArgs_Handler(object sender, MyEventArgs e) { Handle(); }               // Compliant\n        static void Handle() { }\n    }\n\n    public class NoFrameworkElement\n    {\n        private void EventArgs_Handler(object sender, EventArgs e) { Handle(); }     // Noncompliant\n        private void MyEventArgs_Handler(object sender, MyEventArgs e) { Handle(); } // Noncompliant\n        static void Handle() { }\n    }\n\n    public class MyEventArgs : EventArgs { }\n\n    public class App : Application\n    {\n        private void MethodWith1Argument(object sender) { Handle(); }                               // Noncompliant\n        private void MethodWith3Argument(object sender, MyEventArgs e, string other) { Handle(); }  // Noncompliant\n        private void SenderArgumentNotObject(string input, MyEventArgs e) { Handle(); }             // Noncompliant\n        private void EventArgs_Handler(object sender, EventArgs e) { Handle(); }                    // Noncompliant FP\n        private void MyEventArgs_Handler(object sender, MyEventArgs e) { Handle(); }                // Noncompliant FP\n        private void App_OnStartup(object sender, StartupEventArgs e)                               // Noncompliant FP https://sonarsource.atlassian.net/browse/NET-2677\n        {\n            Console.WriteLine(\"Hello World!\");\n        }\n        static void Handle() { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MemberShouldBeStatic.cs",
    "content": "﻿using System;\nusing System.Runtime.CompilerServices;\n\nnamespace Tests.Diagnostics\n{\n    public interface IInterface1\n    {\n        int InterfaceMethod1();\n        int InterfaceProperty1 { get; set; }\n    }\n\n    public class Class1\n    {\n        private int instanceMember = 0;\n        private static int staticMember = 0;\n        protected IInterface1 instanceInterface = null;\n\n        // properties\n        public int Property1 { get; }\n        public int Property2 { get; set; }\n        public int Property3 { get { return instanceMember; } }\n        public int Property4 { get { return this.instanceMember; } }\n        public int Property5 { get { return staticMember; } } // Noncompliant {{Make 'Property5' a static property.}}\n        public int Property6 { get { return Class1.staticMember; } } // Noncompliant\n        public int Property7 { get { return new Class1().instanceMember; } } // Noncompliant\n        public int Property8 { get { return 0; } } // Noncompliant\n        public int Property9 { get { return 0; } set { instanceMember = value; } }\n        public int Property10 { get { return 0; } set { this.instanceMember = value; } }\n        public int Property11 => 0; // Noncompliant\n        public int Property12 => instanceMember;\n        public int Property13 => this.instanceMember;\n        public int Property14 => staticMember; // Noncompliant\n        public int Property15 => Class1.staticMember; // Noncompliant\n        public int Property16 => new Tests.Diagnostics.Class1().instanceMember; // Noncompliant\n        public int Property17 => instanceInterface.InterfaceProperty1;\n        public Class1 Property18 => this;\n        public static int StaticProperty1 => 0;\n        public static int StaticProperty2 => staticMember;\n        public virtual int VirtualProperty { get; set; }\n        public int Property20 // Noncompliant\n        {\n            get => 1;\n        }\n\n        public int Property21\n        {\n            get => instanceMember;\n            set => instanceMember = value;\n        }\n\n        public int Property22\n        {\n            get => instanceMember;\n        }\n\n        public int Property23\n        {\n            set => instanceMember = value;\n        }\n\n        // indexers are always instance\n        public int this[string index] { get { return 0; } } // Compliant!\n\n        // methods\n        public int Method1() { return 0; } // Noncompliant\n        public int Method2() { return instanceMember; }\n        public int Method3() { return this.instanceMember; }\n        public int Method4() { return staticMember; } // Noncompliant\n        public int Method5() { return Class1.staticMember; } // Noncompliant {{Make 'Method5' a static method.}}\n        public int Method6() { return new Class1().instanceMember; } // Noncompliant\n        public int Method7(Class1 arg) { return arg.instanceMember; } // Noncompliant\n        public int Method8(Class1 arg) { return arg.instanceInterface.InterfaceProperty1; } // Noncompliant\n        public int Method8_0(Class1 arg) { return (arg).instanceInterface.InterfaceProperty1; } // Noncompliant\n        public int Method8_1(Class1 arg) { return (int)arg?.instanceInterface?.InterfaceProperty1; } // Noncompliant\n        public int Method8_2(Class1 arg) { return (int)((arg))?.instanceInterface?.InterfaceProperty1; } // Noncompliant\n        // Error@+1 [CS0030]\n        public int Method8_3(Class1 arg) { return ((int)arg)?.instanceInterface?.InterfaceProperty1; } // Noncompliant\n        public void Method9() { (Property2 + 1).ToString(); }\n\n        public int Method10() => 0; // Noncompliant\n        public int Method11() => instanceMember;\n        public int Method12() => this.instanceMember;\n        public int Method13() => staticMember; // Noncompliant\n        public int Method13_1() => (staticMember); // Noncompliant\n        public int Method14() => Class1.staticMember; // Noncompliant\n        public int Method15() => new Class1().instanceMember; // Noncompliant\n        public int Method15_1() => (new Class1()).instanceMember; // Noncompliant\n        public int Method16() => 0; // Noncompliant\n        public int Method17(Class1 arg) => arg.instanceMember; // Noncompliant\n        public int Method18(Class1 arg) => arg.instanceInterface.InterfaceProperty1; // Noncompliant\n        public int Method19() { return instanceInterface.InterfaceProperty1.GetHashCode(); }\n        public int Method19_1() { return ((((((instanceInterface))).InterfaceProperty1))).GetHashCode(); }\n        public int Method19_2() { return (((((((((this))).instanceInterface))).InterfaceProperty1))).GetHashCode(); }\n        public Class1 Method21() => this;\n        public string Method22() => nameof(instanceMember); // Noncompliant\n\n        public static int StaticMethod1() { return 0; }\n        public static int StaticMethod2() { return staticMember; }\n        public static int StaticMethod3() => 0;\n        public static int StaticMethod4() => staticMember;\n\n        public bool Method30() { return 0 > instanceMember; }\n        public bool Method31() { var a = instanceMember; return a > 0; }\n        public bool Method32() { if (instanceMember - 5 > 10) return true; else return false; }\n        public int Method33() { return Math.Abs(instanceMember); }\n\n        public virtual int VirtualMethod() { return 0; }\n\n        protected void GenericMethod<T>(T arg) { /*do nothing*/ }\n        protected void Method34() { GenericMethod<int>(5); }\n    }\n\n    public abstract class Class2\n    {\n        public abstract int AbstractProperty { get; set; }\n        public abstract int AbstractMethod();\n    }\n\n    public class Class3 : Class1\n    {\n        public override int VirtualProperty { get { return 0; } set { /*do nothing*/ } }\n        public override int VirtualMethod() { return 0; }\n        public new int Method1() { return 0; }\n        public new int Property1 { get { return 0; } }\n        public bool Method44(Class1 test) { return test.Property1 == instanceInterface.InterfaceProperty1; }\n    }\n\n    public class Class4 : IInterface1\n    {\n        public int InterfaceProperty1 { get { return 0; } set { } } // if Class4 adds an explicit implementation of this property an issue will be raised here\n        public int InterfaceMethod1() => 0;\n    }\n\n    // Adding exception for SuppressMessage https://github.com/SonarSource/sonar-dotnet/issues/631\n    public class Class5\n    {\n        [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Foo\", \"Bar\", Justification = \"baz\")]\n        public int Property1 { get { return 0; } } // Noncompliant\n        [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Foo\", \"Bar\", Justification = \"baz\")]\n        public int Property2 => 0; // Noncompliant\n        [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Foo\", \"Bar\", Justification = \"baz\")]\n        public int Property3 { } // Error [CS0548]\n        [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Foo\", \"Bar\", Justification = \"baz\")]\n        public int Method1() { return 0; } // Noncompliant\n        [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Foo\", \"Bar\", Justification = \"baz\")]\n        public int Method2() => 0; // Noncompliant\n    }\n\n    public class Class6\n    {\n        [System.ObsoleteAttribute]\n        public int Property1 { get { return 0; } } // Compliant, any attribute disables this rule\n        [System.ObsoleteAttribute]\n        public int Property2 => 0; // Compliant, any attribute disables this rule\n        [System.ObsoleteAttribute]\n        public int Method1() { return 0; } // Compliant, any attribute disables this rule\n        [System.ObsoleteAttribute]\n        public int Method2() => 0; // Compliant, any attribute disables this rule\n    }\n\n    // The following test cases are linked to FP when using ASP controllers.\n    // See https://github.com/SonarSource/sonar-dotnet/issues/733\n    public class WebClass1 : System.Web.Mvc.Controller\n    {\n        public int Foo() => 0;\n\n        protected int FooFoo() => 0; // Noncompliant\n    }\n\n    public class DerivedWebClass1 : WebClass1\n    {\n        public int Bar() => 1;\n\n        protected int BarBar() => 1; // Noncompliant\n    }\n\n    public class WebClass2 : System.Web.Http.ApiController\n    {\n        public int Foo() => 0;\n\n        protected int FooFoo() => 0; // Noncompliant\n    }\n\n    public class DerivedWebClass2 : WebClass2\n    {\n        public int Bar() => 1;\n\n        protected int BarBar() => 1; // Noncompliant\n    }\n\n    public class WebClass3 : Microsoft.AspNetCore.Mvc.Controller\n    {\n        public int Foo() => 0;\n\n        protected int FooFoo() => 0; // Noncompliant\n    }\n\n    public class DerivedWebClass3 : WebClass3\n    {\n        public int Bar() => 1;\n\n        protected int BarBar() => 1; // Noncompliant\n    }\n\n    public class Foo\n    {\n        protected void Application_AuthenticateRequest(Object sender, EventArgs e) { }\n        protected void Application_BeginRequest(object sender, EventArgs e) { }\n        protected void Application_End() { }\n        protected void Application_EndRequest(Object sender, EventArgs e) { }\n        protected void Application_Error(object sender, EventArgs e) { }\n        protected void Application_Init(object sender, EventArgs e) { }\n        protected void Application_Start() { }\n        protected void Session_End(object sender, EventArgs e) { }\n        protected void Session_Start(object sender, EventArgs e) { }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/3204\n    public class Repro_3204<TFirst, TSecond>\n    {\n        public int BuildSomething() // Compliant, we don't raise inside generic class, so it doesn't have to be invoked like Repro_3204<SomethingA, SomethingB>.BuildSomething() - too difficult to read\n        {\n            return 42;\n        }\n\n        public int WithGenericArguments<TFirst, TSecond>() // Compliant\n        {\n            return 42;\n        }\n\n        private int PrivateMethod() => 42;      // Noncompliant, private member is easy to invoke => should be private\n        protected int ProtectedMethod() => 42;  // Noncompliant\n\n        internal int InternalMethod() => 42;                // Compliant\n        protected internal int ProtectedInternal() => 42;   // Compliant as internal invocation would be hard\n\n        public class PublicNestedInGenericType\n        {\n            public int BuildSomething() => 42;  // Compliant\n        }\n\n        private class PrivateNestedInGenericType\n        {\n            public int BuildSomething() => 42;  // Noncompliant\n        }\n\n        public static class PublicStaticNestedInGenericType\n        {\n            public static int BuildSomething() => 42;  // Compliant\n        }\n\n        private static class PrivateStaticNestedInGenericType\n        {\n            public static int BuildSomething() => 42;  // Compliant\n        }\n\n        public class Nongeneric\n        {\n            private class Generic<TFirst, TSecond>\n            {\n                public int BuildSomething() => 42;      // Compliant\n\n                private class NestedNongeneric\n                {\n                    public int BuildSomething() => 42;  // Noncompliant, it can be accessed as NestedNongeneric.BuildSomething() from Generic<TFirst, TSecond> scope\n                }\n            }\n        }\n\n        public class GenericOuter<TFirst, TSecond>\n        {\n            private class NongenericInner\n            {\n                public int BuildSomething() => 42;  // Noncompliant\n            }\n        }\n    }\n\n    public class Repro_3204_OK\n    {\n        public int BuildSomething<TFirst, TSecond>() // Noncompliant, this generic method should be static\n        {\n            return 42;\n        }\n    }\n\n    public class NameColon\n    {\n        string local = \"hey\";\n\n        public decimal UsingParameter(string parameter) // Noncompliant\n        {\n            throw new ArgumentNullException(paramName: parameter);\n        }\n\n        public decimal UsingLocal() // Compliant\n        {\n            throw new ArgumentNullException(paramName: local);\n        }\n    }\n\n    public class PropertyInitialization\n    {\n        public int Prop { get; set; }\n\n        public PropertyInitialization Create() // FN - because of the property initialization\n        {\n            return new PropertyInitialization { Prop = 42 };\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/8025\n    partial class PartialClass\n    {\n        public void WriteEverything()\n        {\n            Console.WriteLine(\"Something\");\n\n            WriteMore();\n        }\n\n        partial void WriteMore();\n    }\n\n    partial class PartialClass\n    {\n        partial void WriteMore() // Compliant\n        {\n            Console.WriteLine(\"More\");\n        }\n    }\n\n    public class Awaitable : INotifyCompletion  // inorder for a type to be awaitable, must implement instanced `IsCompleted` property\n    {\n        public Awaitable GetAwaiter() => this;\n\n        public void GetResult() { }\n        public bool IsCompleted => !true;       // Noncompliant FP https://sonarsource.atlassian.net/browse/NET-2937\n        public void OnCompleted(Action continuation) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MemberShouldNotHaveConflictingTransparencyAttributes.AssemblyLevel.cs",
    "content": "﻿using System;\nusing System.Security;\n\n[assembly: SecurityCritical]\n//         ^^^^^^^^^^^^^^^^ Secondary\n//         ^^^^^^^^^^^^^^^^ Secondary@-1\n//         ^^^^^^^^^^^^^^^^ Secondary@-2\n//         ^^^^^^^^^^^^^^^^ Secondary@-3\n//         ^^^^^^^^^^^^^^^^ Secondary@-4\n//         ^^^^^^^^^^^^^^^^ Secondary@-5\n//         ^^^^^^^^^^^^^^^^ Secondary@-6\n//         ^^^^^^^^^^^^^^^^ Secondary@-7\n\nnamespace Tests.Diagnostics\n{\n    public class Program1\n    {\n        [SecuritySafeCritical] // Noncompliant {{Change or remove this attribute to be consistent with its container.}}\n//       ^^^^^^^^^^^^^^^^^^^^\n        private int myValue;\n    }\n\n    public class Program2\n    {\n        [SecuritySafeCritical] // Noncompliant\n        public delegate void SimpleDelegate();\n    }\n\n    public class Program3\n    {\n        [SecuritySafeCritical] // Noncompliant\n        public Program3()\n        {\n        }\n    }\n\n    public class Program4\n    {\n        [SecuritySafeCritical] // Noncompliant\n        public void DoSomething()\n        {\n        }\n    }\n\n    public class Program5\n    {\n        [SecuritySafeCritical] // Noncompliant\n        public class SafeClass\n        {\n        }\n    }\n\n    public class Program6\n    {\n        [SecuritySafeCritical] // Noncompliant\n        public struct SafeStruct\n        {\n        }\n    }\n\n    public class Program7\n    {\n        [SecuritySafeCritical] // Noncompliant\n        public interface ISafe\n        {\n        }\n    }\n\n    public class Program8\n    {\n        [SecuritySafeCritical] // Noncompliant\n        public enum SafeEnum\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MemberShouldNotHaveConflictingTransparencyAttributes.Latest.Partial.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Security;\n\nnamespace Net6Poc.MemberShouldNotHaveConflictingTransparencyAttributes;\n\npublic partial class PartialClass\n{\n    [SecuritySafeCritical]  // FN https://sonarsource.atlassian.net/browse/NET-2717\n    public partial PartialClass() { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MemberShouldNotHaveConflictingTransparencyAttributes.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Security;\n\nnamespace Net6Poc.MemberShouldNotHaveConflictingTransparencyAttributes;\n\n[SecurityCritical]\n// Secondary@-1 [flow1]\n// Secondary@-2 [flow2]\n// Secondary@-3 [flow3]\n// Secondary@-4 [flow4]\n// Secondary@-5 [flow5]\n// Secondary@-6 [flow6]\ninternal class TestCases\n{\n    [SecuritySafeCritical]  // Noncompliant [flow6]\n    internal TestCases() { }\n\n    public void Bar(IEnumerable<int> collection)\n    {\n        [SecuritySafeCritical] int Get() => 1; // Noncompliant [flow1]\n\n        _ = collection.Select([SecuritySafeCritical] (x) => x + 1); // Noncompliant [flow2]\n\n        Action a =[SecuritySafeCritical] () => { }; // Noncompliant [flow3]\n\n        Action x = true\n                       ? ([SecuritySafeCritical] () => { }) // Noncompliant [flow4]\n                       :[SecuritySafeCritical] () => { }; // Noncompliant [flow5]\n\n        Call([Obsolete] (x) => { });\n    }\n\n    private void Call(Action<int> action) => action(1);\n}\n\n[SecurityCritical]\n// Secondary@-1\n// Secondary@-2\npublic interface Foo\n{\n    [SecuritySafeCritical] // Noncompliant\n    public static virtual void Bar()\n    {\n    }\n\n    [SecuritySafeCritical] // Noncompliant\n    public static abstract void Bar2();\n}\n\n[SecurityCritical]  // FN\npublic partial class PartialClass\n{\n    public partial PartialClass();\n}\n\n[SecurityCritical]\npublic class Sample { }\n\n[SecurityCritical] // Secondary\npublic static class Extensions\n{\n    extension(Sample sample)\n    {\n        [SecuritySafeCritical] // Noncompliant\n        public static void ExtensionMethod() { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MemberShouldNotHaveConflictingTransparencyAttributes.Partial.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Security;\n\nnamespace Tests.Diagnostics\n{\n    public partial class PartialClass\n    {\n        [SecuritySafeCritical]  // FN https://sonarsource.atlassian.net/browse/NET-2717\n        private void Method() { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MemberShouldNotHaveConflictingTransparencyAttributes.cs",
    "content": "﻿using System;\nusing System.Security;\n\nnamespace Tests.Diagnostics\n{\n    [SecurityCritical] // Secondary\n//   ^^^^^^^^^^^^^^^^\n    public class Program1\n    {\n        [SecuritySafeCritical] // Noncompliant {{Change or remove this attribute to be consistent with its container.}}\n//       ^^^^^^^^^^^^^^^^^^^^\n        private int myValue;\n    }\n\n    [SecurityCritical] // Secondary\n    public class Program2\n    {\n        [SecuritySafeCritical] // Noncompliant\n        public delegate void SimpleDelegate();\n    }\n\n    [SecurityCritical] // Secondary\n    public class Program3\n    {\n\n        [SecuritySafeCritical] // Noncompliant\n        public Program3()\n        {\n        }\n    }\n\n    [SecurityCritical] // Secondary\n    public class Program4\n    {\n\n        [SecuritySafeCritical] // Noncompliant\n        public void DoSomething()\n        {\n        }\n    }\n\n    [SecurityCritical] // Secondary\n    public class Program5\n    {\n\n        [SecuritySafeCritical] // Noncompliant\n        public class SafeClass\n        {\n        }\n    }\n\n    [SecurityCritical] // Secondary\n    public class Program6\n    {\n\n        [SecuritySafeCritical] // Noncompliant\n        public struct SafeStruct\n        {\n        }\n    }\n\n    [SecurityCritical] // Secondary\n    public class Program7\n    {\n\n        [SecuritySafeCritical] // Noncompliant\n        public interface ISafe\n        {\n        }\n    }\n\n    [SecurityCritical] // Secondary\n    public class Program8\n    {\n\n        [SecuritySafeCritical] // Noncompliant\n        public enum SafeEnum\n        {\n        }\n    }\n\n    [SecurityCritical]  // FN\n    public partial class PartialClass { }\n\n    [SecurityCritical]\n    public class Sample { }\n\n    [SecurityCritical]  // Secondary\n    public static class ClassicExtensions\n    {\n        [SecuritySafeCritical] // Noncompliant\n        public static void ExtensionMethod(this Sample sample) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MessageTemplatesShouldBeCorrect.Latest.cs",
    "content": "﻿using Microsoft.Extensions.Logging;\nusing System;\n\npublic class Program\n{\n    public void EscapeSequence(ILogger logger, string user)\n    {\n        logger.LogError(\"Login failed for Us\\er\");\n        logger.LogError(\"Login failed for \\e{User}\", user);\n\n        logger.LogError(\"{\\eUser}\", user);                       // Noncompliant {{Log message template placeholder '\\eUser' should only contain letters, numbers, and underscore.}}\n        logger.LogError(\"\\e{User}{Us\\eer}{Us\\u001ber}\", user);   // Noncompliant {{Log message template placeholder 'Us\\eer' should only contain letters, numbers, and underscore.}}\n                                                                 // Noncompliant@-1 {{Log message template placeholder 'Us\\u001ber' should only contain letters, numbers, and underscore.}}\n        logger.LogError(\"User{Use\\er}User\", user);               // Noncompliant\n        logger.LogError(\"Login failed for \\e{\\eUser\", user);     // Noncompliant {{Log message template should be syntactically correct.}}\n        logger.LogError(\"Login failed for {{\\u001b{User\", user); // Noncompliant \n        logger.LogError(\"{\\e\", user);                            // Noncompliant\n        logger.LogError(\"{{\\e{\", user);                          // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MessageTemplatesShouldBeCorrect.cs",
    "content": "﻿using Microsoft.Extensions.Logging;\nusing System;\n\npublic class Program\n{\n    public void Compliant(ILogger logger, string user)\n    {\n        Console.WriteLine(\"Login failed for {User\", user);\n\n        logger.LogError(\"\");\n        logger.LogError(\"Login failed for User\");\n        logger.LogError(\"{User}\", user);\n        logger.LogError(\"{User}{User}{User}\", user);\n        logger.LogError(\"User{User}User\", user);\n\n        logger.LogError($\"Login failed for {{User\", user);\n        logger.LogError(\"Login failed for {User}\", user);\n        logger.LogError(\"Login failed for {{User}}\", user);\n        logger.LogError(\"Login failed for {{{User}}}\", user);\n\n        logger.LogError(\"{{ }} {{ {{{{  {{🔥}}\");     // On fire\n\n        logger.LogError(\"Login failed for {$User,42}\", user);\n        logger.LogError(\"Login failed for {@User:format}\", user);\n        logger.LogError(\"Login failed for {User42,42:format}\", user);\n        logger.LogError(\"Login failed for {User_Name:format,42}\", user);\n\n        logger.LogError(\"Login failed for {User:                 }\", user);\n        logger.LogError(\"Login failed for {User: -f0rmat c@n contain _any!@#$thing_ {you{want{ }\", user);\n        logger.LogError(\"Login failed for {User,-42}\", user);\n\n        logger.LogError(\"Login failed for {{User}\", user);          // Compliant FN. Syntactically valid, in reality it's probably a typo.\n    }\n\n    public void InvalidSyntax(ILogger logger, string user)\n    {\n        logger.LogError(\"Login failed for {User\", user);                // Noncompliant {{Log message template should be syntactically correct.}}\n        //              ^^^^^^^^^^^^^^^^^^^^^^^^\n        logger.LogError(\"Login failed for {{{User\", user);              // Noncompliant {{Log message template should be syntactically correct.}}\n        //              ^^^^^^^^^^^^^^^^^^^^^^^^^^\n        logger.LogError(\"{\", user);                                     // Noncompliant {{Log message template should be syntactically correct.}}\n        //              ^^^\n        logger.LogError(\"{{{\", user);                                   // Noncompliant {{Log message template should be syntactically correct.}}\n        //              ^^^^^\n    }\n\n    public void EmptyPlaceholder(ILogger logger, string user)\n    {\n        logger.LogError(\"Login failed for {}\", user);                   // Noncompliant {{Log message template should not contain empty placeholder.}}\n        //                                ^^\n        logger.LogError(\"{}\", user);                                    // Noncompliant {{Log message template should not contain empty placeholder.}}\n        //               ^^\n        logger.LogError(\"{{{}}}\", user);                                // Noncompliant {{Log message template should not contain empty placeholder.}}\n        //                 ^^\n        logger.LogError(\"{{Login for {} user }}failed\", user);          // Noncompliant {{Log message template should not contain empty placeholder.}}\n        //                           ^^\n    }\n\n    public void InvalidName(ILogger logger, string user)\n    {\n        logger.LogError(\"Login failed for {@}\", user);                  // Noncompliant {{Log message template placeholder '' should only contain letters, numbers, and underscore.}}\n        //                                 ^\n        logger.LogError(\"Login failed for {%User}\", user);              // Noncompliant {{Log message template placeholder '%User' should only contain letters, numbers, and underscore.}}\n        //                                 ^^^^^\n        logger.LogError(\"Login failed for { {User} }\", user);              // Noncompliant {{Log message template placeholder ' {User' should only contain letters, numbers, and underscore.}}\n        //                                 ^^^^^^\n        logger.LogError(\"Login failed for {User-Name}\", user);          // Noncompliant {{Log message template placeholder 'User-Name' should only contain letters, numbers, and underscore.}}\n        //                                 ^^^^^^^^^\n        logger.LogError(\"Login failed for {User Name}\", user);          // Noncompliant {{Log message template placeholder 'User Name' should only contain letters, numbers, and underscore.}}\n        //                                 ^^^^^^^^^\n        logger.LogError(\"Login failed for {user}, server is on {🔥}\", user, \"fire\");          // Noncompliant {{Log message template placeholder '🔥' should only contain letters, numbers, and underscore.}}\n        //                                                      ^^\n        logger.LogError(\"Retry attempt {@,:}\", user);                    // Noncompliant {{Log message template placeholder '' should only contain letters, numbers, and underscore.}}\n        //                              ^^^\n    }\n\n    public void InvalidAlignmentAndFormat(ILogger logger, int cnt)\n    {\n        logger.LogError(\"Retry attempt {Cnt,r}\", cnt);                   // Noncompliant {{Log message template placeholder 'Cnt' should have numeric alignment instead of 'r'.}}\n        //                              ^^^^^\n        logger.LogError(\"Retry attempt {Cnt,}\", cnt);                    // Noncompliant {{Log message template placeholder 'Cnt' should have numeric alignment instead of ''.}}\n        //                              ^^^^\n        logger.LogError(\"Retry attempt {Cnt,-foo}\", cnt);                // Noncompliant {{Log message template placeholder 'Cnt' should have numeric alignment instead of '-foo'.}}\n        //                              ^^^^^^^^\n        logger.LogError(\"Retry attempt {Cnt:}\", cnt);                    // Noncompliant {{Log message template placeholder 'Cnt' should not have empty format.}}\n        //                              ^^^^\n        logger.LogError(\"Retry attempt {Cnt,:}\", cnt);                    // Noncompliant {{Log message template placeholder 'Cnt' should have numeric alignment instead of ''.}}\n        //                              ^^^^^\n    }\n\n    public void Complex(ILogger logger, string user, int cnt, int total)\n    {\n        logger.LogError(\"[User {user name,42}] Retry attempt {Cnt,:}\", user, cnt);\n        //                      ^^^^^^^^^^^^ {{Log message template placeholder 'user name' should only contain letters, numbers, and underscore.}}\n        //                                                    ^^^^^ @-1 {{Log message template placeholder 'Cnt' should have numeric alignment instead of ''.}}\n\n\n        logger.LogError(\"[User {user%,42}] Retry {{attempt}} {@Cnt:foo,} {$Total,-5000:}\", user, cnt, total);\n        //                      ^^^^^^^^ {{Log message template placeholder 'user%' should only contain letters, numbers, and underscore.}}\n        //                                                                ^^^^^^^^^^^^^ @-1 {{Log message template placeholder 'Total' should not have empty format.}}\n\n        logger.LogError(@\"[User {user,42}] Retry attempt {@Cnt\n            :foo,}\", user, cnt); // Noncompliant@-1\n\n        logger.LogError(@\"\n            [User {user name}]\n            Retry attempt {@Cnt:}\n            Out of total {$Total,-abc:format}\",\n            user, cnt, total);\n        //         ^^^^^^^^^ @-3 {{Log message template placeholder 'user name' should only contain letters, numbers, and underscore.}}\n        //                 ^^^^^ @-3 {{Log message template placeholder 'Cnt' should not have empty format.}}\n        //                ^^^^^^^^^^^^^^^^^^ @-3 {{Log message template placeholder 'Total' should have numeric alignment instead of '-abc'.}}\n    }\n\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodOverloadOptionalParameter.Latest.Partial.cs",
    "content": "﻿public partial class Partial\n{\n    public partial void Single(string[] messages, string delimiter = \"; \") { }      // Noncompliant\n\n    public partial void Together(string[] messages) { }\n    public partial void Together(string[] messages, string delimiter = \"; \") { }    // Noncompliant\n\n    public partial void Mixed(string[] messages) { }\n    public partial void Mixed(string[] messages, string delimiter = \"; \");          // Noncompliant\n}\n\npublic partial class PartialConstructor\n{\n    public partial PartialConstructor(string[] messages);\n    public partial PartialConstructor(string[] messages, string delimiter = \"\\n\") { } // Noncompliant\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodOverloadOptionalParameter.Latest.cs",
    "content": "﻿public record Record\n{\n    void Method(string[] messages) { }\n    void Method(string[] messages, string delimiter = \"\\n\") { }                 // Noncompliant\n}\n\npublic partial class Partial\n{\n    public void Single(string[] messages) { }\n    public partial void Single(string[] messages, string delimiter = \"; \");     // Noncompliant\n\n    public partial void Together(string[] messages);\n    public partial void Together(string[] messages, string delimiter = \"; \");   // Noncompliant\n\n    public partial void Mixed(string[] messages);\n    public partial void Mixed(string[] messages, string delimiter = \"; \") { }   // Noncompliant\n}\n\npublic record struct RecordStruct\n{\n    void Method(string[] messages) { }\n    void Method(string[] messages, string delimiter = \"\\n\") { } // Noncompliant\n}\n\n\npublic record struct PositionalRecord(string value)\n{\n    void Method(string[] messages) { }\n    void Method(string[] messages, string delimiter = \"\\n\") { } // Noncompliant\n}\n\npublic interface IMyInterface\n{\n    static abstract void Abstract(string[] messages);\n    static abstract void Abstract(string[] messages, string delimiter = \"\\n\"); // Noncompliant\n//                                                   ^^^^^^^^^^^^^^^^^^^^^^^\n    static virtual void Virtual(string[] messages) { }\n    static virtual void Virtual(string[] messages, string delimiter = \"\\n\") { } // Noncompliant\n}\n\npublic partial class MethodOverloadOptionalParameter : IMyInterface\n{\n    public static void Abstract(string[] messages) { }\n    public static void Abstract(string[] messages, string delimiter = \"\\n\") { } // Compliant; comes from interface\n    public static void Virtual(string[] messages) { }\n    public static void Virtual(string[] messages, string delimiter = \"\\n\") { } // Compliant; comes from interface\n\n    partial void Print(string[] messages);\n\n    partial void Print(string[] messages) { }\n\n    void Print(string[] messages, string delimiter = \"\\n\") { } // Noncompliant;\n    void Print(string[] messages,\n        string delimiter = \"\\n\", // Noncompliant\n        string b = \"a\" // Noncompliant\n        )\n    { }\n}\n\npublic class MyClass1(string[] messages)\n{\n    public MyClass1(string[] messages, string delimiter = \"\\n\") : this(messages) // Noncompliant {{This method signature overlaps the one defined on line 60, the default parameter value can't be used.}}\n    {\n    }\n}\n\npublic class MyClass2(string[] messages, string delimiter = \"\\n\") // Noncompliant {{This method signature overlaps the one defined on line 69, the default parameter value can't be used.}}\n{\n    public MyClass2(string[] messages) : this(messages, \"\\n\")\n    {\n    }\n}\n\npublic partial class PartialConstructor\n{\n    public partial PartialConstructor(string[] messages) { }\n    public partial PartialConstructor(string[] messages, string delimiter = \"\\n\");\n}\n\npublic class Sample { }\n\npublic class SampleWithMethod\n{\n    public void Method(string[] messages) { }\n}\n\npublic static class NewExtensions\n{\n    extension(Sample sample)\n    {\n        public void Method(string[] messages) { }\n        public void Method(string[] messages, string delimiter = \"\\n\") { } // Noncompliant\n    }\n\n    extension(SampleWithMethod sample)\n    {\n        public void Method(string[] messages, string delimiter = \"\\n\") { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodOverloadOptionalParameter.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public interface IMyInterface\n    {\n        void Print2(string[] messages);\n        void Print2(string[] messages, string delimiter = \"\\n\");// Noncompliant;\n//                                     ^^^^^^^^^^^^^^^^^^^^^^^\n    }\n\n    public class MyBase\n    {\n        public virtual void Print3(string[] messages) { }\n        public virtual void Print3(string[] messages, string delimiter = \"\\n\") { }// Noncompliant {{This method signature overlaps the one defined on line 15, the default parameter value can't be used.}}\n    }\n\n    public partial class MethodOverloadOptionalParameter : MyBase, IMyInterface\n    {\n        public override void Print3(string[] messages) { }\n        public override void Print3(string[] messages, string delimiter = \"\\n\") { }// Compliant; comes from base class\n\n        public void Print2(string[] messages) { }\n        public void Print2(string[] messages, string delimiter = \"\\n\") { } // Compliant; comes from interface\n\n        partial void Print(string[] messages);\n\n        partial void Print(string[] messages) { }\n\n        void Print(string[] messages, string delimiter = \"\\n\") {} // Noncompliant;\n        void Print(string[] messages,\n            string delimiter = \"\\n\", // Noncompliant {{This method signature overlaps the one defined on line 29, the default parameter value can only be used with named arguments.}}\n            string b = \"a\" // Noncompliant {{This method signature overlaps the one defined on line 31, the default parameter value can't be used.}}\n            ) {}\n    }\n\n    public interface MyType\n    {\n        void Print(string messages, int num, object something);\n\n        void Print(string messages, int num = 0, object something = null); // Error [CS0111] - Already contains member with same params\n    }\n\n    public interface Generics\n    {\n        void Foo<T>(string[] messages);\n        void Foo<T>(string[] messages, string delimiter = \"\\n\"); // Noncompliant\n\n        void Foo2(string[] messages);\n        void Foo2<T>(string[] messages, string delimiter = \"\\n\");\n\n        void Foo3<T>(T messages);\n        void Foo3<V>(V messages, string delimiter = \"\\n\"); // Noncompliant\n\n        void Foo4<T>(IEnumerable<T> messages);\n        void Foo4<V>(IEnumerable<V> messages, string delimiter = \"\\n\"); // Noncompliant\n\n        void Foo5<T>(IEnumerable<T> messages);\n        void Foo5<MyType>(MyType messages);\n        void Foo5(MyType messages, string delimiter = \"\\n\");\n\n        void Foo6<T>(KeyValuePair<T, int> ids);\n        void Foo6<U>(KeyValuePair<U, string> messages, string delimiter = \"\\n\");\n\n        void Foo7<T>(KeyValuePair<KeyValuePair<T, int>, string> ids);\n        void Foo7<U>(KeyValuePair<KeyValuePair<U, string>, string> messages, string delimiter = \"\\n\");\n\n        void Foo8<T>(KeyValuePair<KeyValuePair<T, int>, string> ids);\n        void Foo8<U>(KeyValuePair<KeyValuePair<U, int>, string> messages, string delimiter = \"\\n\"); // Noncompliant\n    }\n\n    public interface IInterfaceWithDefaultImpl\n    {\n        void Print2(string[] messages)\n        {\n        }\n\n        void Print2(string[] messages, string delimiter = \"\\n\") // Noncompliant;\n//                                     ^^^^^^^^^^^^^^^^^^^^^^^\n        {\n        }\n    }\n\n    public class Sample { }\n\n    public class SampleWithMethod\n    {\n        public void Method(string[] messages) { }\n    }\n\n    public static class ClassicExtensions\n    {\n        public static void Method(this Sample sample, string[] messages) { }\n        public static void Method(this Sample sample, string[] messages, string delimiter = \"\\n\") { } // Noncompliant\n\n        public static void Method(this SampleWithMethod sample, string[] messages, string delimiter = \"\\n\") { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodOverloadsShouldBeGrouped.Latest.cs",
    "content": "﻿record R1\n{\n    void a() { } // Noncompliant {{All 'a' method overloads should be adjacent.}}\n\n    void a(int a, char b) { }\n\n    record B { }\n\n    void a(string a) { } // Secondary {{Non-adjacent overload}}\n}\n\nrecord R2\n{\n    void a() { }\n\n    void a(int a, char b) { }\n\n    void a(string a) { }\n\n    record B { }\n}\n\nrecord R3\n{\n    R3() { } // Noncompliant {{All 'R3' method overloads should be adjacent.}}\n\n    R3(int a) { }\n\n    R3(char a) { }\n\n    ~R3() { }\n\n    R3(double a) { } // Secondary {{Non-adjacent overload}}\n}\n\nrecord PositionalR1(string Parameter)\n{\n    void a() { } // Noncompliant {{All 'a' method overloads should be adjacent.}}\n\n    void a(int a, char b) { }\n\n    record B { }\n\n    void a(string a) { } // Secondary {{Non-adjacent overload}}\n}\n\nrecord PositionalR2(string Parameter)\n{\n    void a() { }\n\n    void a(int a, char b) { }\n\n    void a(string a) { }\n\n    record B { }\n}\n\nrecord PositionalR3(string Parameter)\n{\n    PositionalR3(): this(\"a\") { } // Noncompliant {{All 'PositionalR3' method overloads should be adjacent.}}\n\n    PositionalR3(int a) : this(\"a\") { }\n\n    PositionalR3(char a) : this(\"a\") { }\n\n    ~PositionalR3() { }\n\n    PositionalR3(double a) : this(\"a\") { } // Secondary {{Non-adjacent overload}}\n}\n\n\nrecord struct RS1\n{\n    void a() { } // Noncompliant {{All 'a' method overloads should be adjacent.}}\n    //   ^\n\n    void a(int a, char b) { }\n\n    record B { }\n\n    void a(string a) { } // Secondary {{Non-adjacent overload}}\n    //   ^\n}\n\nrecord struct RS2\n{\n    void a() { }\n\n    void a(int a, char b) { }\n\n    void a(string a) { }\n\n    record B { }\n}\n\nrecord struct RS3\n{\n    public RS3() { } // Noncompliant\n\n    public RS3(int a) { }\n\n    public RS3(char a) { }\n\n    void a() { }\n\n    public RS3(double a) { } // Secondary\n}\n\nrecord struct PositionalRS1(string Parameter)\n{\n    void a() { } // Noncompliant\n\n    void a(int a, char b) { }\n\n    record B { }\n\n    void a(string a) { } // Secondary\n}\n\nrecord struct PositionalRS2(string Parameter)\n{\n    void a() { }\n\n    void a(int a, char b) { }\n\n    void a(string a) { }\n\n    record B { }\n}\n\nrecord struct PositionalRS3(string Parameter)\n{\n    public PositionalRS3() : this(\"a\") { } // Noncompliant\n\n    public PositionalRS3(int a) : this(\"a\") { }\n\n    public PositionalRS3(char a) : this(\"a\") { }\n\n    void a() { }\n\n    public PositionalRS3(double a) : this(\"a\") { } // Secondary\n}\n\ninterface A\n{\n    static abstract void DoSomething(double b);\n\n    static abstract void DoSomething();\n\n    static abstract void DoSomething(int a);\n}\n\ninterface B\n{\n    static abstract void DoSomething(double b); // Noncompliant {{All 'DoSomething' method overloads should be adjacent.}}\n//                       ^^^^^^^^^^^\n\n    static abstract void DoSomething();\n\n    static abstract void DoSomethingElse();\n\n    static abstract void DoSomething(int a); // Secondary {{Non-adjacent overload}}\n//                       ^^^^^^^^^^^\n\n    static virtual void DoSomething(double a, double b) { }\n}\n\nclass SomeClass : A, B\n{\n    public static void DoSomething(double a) { } // Noncompliant\n\n    public void SeparateFromSameInterfaceA() { }\n\n    // Compliant - we dont not raise issues for explicit interface implementation as it is a corner case and it can make sense to group implementation by interface\n    static void A.DoSomething() { }\n\n    static public void DoSomethingElse() { }\n\n    static void B.DoSomething() { } // Compliant - explicit interface implementation\n\n    public void SeparateFromSameInterfaceB() { }\n\n    public static void DoSomething(int a) { } // Secondary\n}\n\nclass PrimaryConstructor(int arg)\n{\n    public void RandomMethod1() { }         // Noncompliant\n\n    public PrimaryConstructor() : this(5) { }\n\n    public void RandomMethod1(int i) { }    // Secondary\n\n    public void RandomMethod2() { }\n}\n\npublic static class Extensions\n{\n    public class Sample { }\n    extension (Sample sample)\n    {\n        void a() { }            // Noncompliant - https://sonarsource.atlassian.net/browse/NET-2719\n        void a(int a, char b) { }\n        void b() { }\n        void a(string a) { }    // Secondary - https://sonarsource.atlassian.net/browse/NET-2719\n    }\n\n    extension(Sample sample)\n    {\n        void x() { }       // Compliant\n        void x(int a) { }\n        void y() { }       // Compliant\n        void y(int a) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodOverloadsShouldBeGrouped.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    class A\n    {\n        void a() { } // Noncompliant {{All 'a' method overloads should be adjacent.}}\n        //   ^\n\n        void a(int a, char b) { }\n\n        class B { }\n\n        void a(string a) { } // Secondary\n        //   ^\n\n        interface C { }\n\n        void a(int a) { } // Secondary {{Non-adjacent overload}}\n        //   ^\n\n        enum D { }\n\n        void a(double a) { } // Secondary {{Non-adjacent overload}}\n        //   ^\n\n        int myField;\n\n        void a(char a) { } // Secondary {{Non-adjacent overload}}\n        //   ^\n\n        int MyProperty\n        {\n            get;\n        }\n\n        void a(char a, int b) { } // Secondary {{Non-adjacent overload}}\n        //   ^\n    }\n\n    class B\n    {\n        B() { } // Noncompliant {{All 'B' method overloads should be adjacent.}}\n\n        B(int a) { }\n\n        B(char a) { }\n\n        ~B() { }\n\n        B(double a) { } // Secondary {{Non-adjacent overload}}\n    }\n\n    class C\n    {\n        public static C operator -(C c1) // Compliant - this one is unary -, while the other is binary -\n        {\n            return null;\n        }\n\n        void a() { }\n\n        public static implicit operator B(C d) => null; // Compliant - this operator and the B() method are not related\n\n        void B() { }\n\n        public static C operator -(C c1, C c2)\n        {\n            return null;\n        }\n    }\n\n    interface D\n    {\n        void DoSomething(double b);\n\n        void DoSomething();\n\n        void DoSomething(int a);\n    }\n\n    interface E\n    {\n        void DoSomething(double b); // Noncompliant {{All 'DoSomething' method overloads should be adjacent.}}\n        //   ^^^^^^^^^^^\n\n        void DoSomething();\n\n        void DoSomethingElse();\n\n        void DoSomething(int a); // Secondary {{Non-adjacent overload}}\n        //   ^^^^^^^^^^^\n    }\n\n    struct F\n    {\n        F(char a) { }\n\n        F(int a) { }\n\n        void MyStructMethod() { } // Noncompliant {{All 'MyStructMethod' method overloads should be adjacent.}}\n\n        void MyStructMethod(int a) { }\n\n        void MyStructMethod2() { }\n\n        void MyStructMethod(char a) { } // Secondary {{Non-adjacent overload}}\n    }\n\n    class G : D, E\n    {\n        public void DoSomething(double a) { } // Noncompliant\n\n        public void SeparateFromSameInterfaceD() { }\n\n        // Compliant - we dont not raise issues for explicit interface implementation as it is a corner case and it can make sense to group implementation by interface\n        void D.DoSomething() { }\n\n        public void DoSomethingElse() { }\n\n        void E.DoSomething() { } // Compliant - explicit interface implementation\n\n        public void SeparateFromSameInterfaceE() { }\n\n        public void DoSomething(int a) { } // Secondary\n    }\n\n    class H\n    {\n        private void DoSomething(int a) { } // Compliant - not same accessibility as the other method\n\n        void DoSomethingElse() { }\n\n        public void DoSomething() { }\n    }\n\n    class I\n    {\n        private void DoSomething(int a) { } // Noncompliant\n\n        void DoSomethingElse() { }\n\n        private void DoSomething() { } // Secondary {{Non-adjacent overload}}\n    }\n\n    class J\n    {\n        void DoSomething<T>(T t) { } // Noncompliant\n\n        void DoSomethingElse() { }\n\n        void DoSomething(int a) { } // Secondary {{Non-adjacent overload}}\n    }\n\n    class K\n    {\n        public void Lorem() { }\n\n        public void DoSomething() { }\n\n        private void DoSomething(int i) { }    // Compliant interleaving with different accesibility\n\n        protected void DoSomething(bool b) { }\n\n        public void DoSomething(string s) { }\n\n        private void Lorem(int i) { }       // Compliant, different accessibility\n\n    }\n\n    public class L\n    {\n        public void MethodA() { }\n\n        public void MethodB() { }\n\n        public static void MethodA(int i) { } // Compliant as one is static the other is not\n    }\n\n    public abstract class M\n    {\n        public abstract void MethodA();\n\n        public void MethodB() { }\n\n        public void MethodA(int i) { } // Compliant as one is abstract and the other is not\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/2776\n    public class StaticMethodsTogether\n    {\n\n        public StaticMethodsTogether() { }\n        public StaticMethodsTogether(int i) { }\n\n        public static void MethodA() // Compliant - static methods are grouped together, it's ok\n        {\n        }\n\n        public static void MethodB()\n        {\n        }\n\n        static StaticMethodsTogether() { }  //Compliant - static constructor can be grouped with static methods\n\n        public void MethodA(int i)\n        {\n        }\n\n        public static void MethodC()    // Noncompliant - When there're more shared methods, they still should be together\n        {\n        }\n\n        public static void MethodD()\n        {\n        }\n\n        public static int MethodD(int i)\n        {\n            return i;\n        }\n\n        public static void MethodD(bool b)\n        {\n        }\n\n        public static void MethodC(bool b)    // Secondary\n        {\n        }\n\n        public static void Separator()\n        {\n        }\n\n        public static int MethodC(int i)    // Secondary\n        {\n            return i;\n        }\n\n    }\n\n    public abstract class MustOverrideMethodsTogether\n    {\n\n        protected abstract void DoWork(bool b); //Compliant - abstract methods are grouped together, it's OK\n        protected abstract void DoWork(int i);\n\n        protected MustOverrideMethodsTogether() { }\n\n        protected void DoWork() //Compliant - abstract methods are grouped together, it's OK\n        {\n            DoWork(true);\n            DoWork(42);\n        }\n\n        protected abstract void OnEvent(bool b);    //Noncompliant\n        protected abstract void OnProgress();\n        protected abstract void OnEvent(int i);     //Secondary\n\n        public void DoSomething() { }\n        protected abstract void DoSomething(bool b);     //Compliant interleaving with abstract\n        public void DoSomething(int i) { }\n\n    }\n\n    public class Inheritor : MustOverrideMethodsTogether\n    {\n\n        protected override void DoWork(bool b)\n        {\n        }\n\n        public static void DoWork(string s) //Compliant interleaving with static\n        {\n        }\n\n        protected override void DoWork(int i)\n        {\n        }\n\n        protected override void OnEvent(bool b) //Noncompliant\n        {\n        }\n\n        protected override void OnProgress()\n        {\n        }\n\n        protected override void OnEvent(int i)  //Secondary\n        {\n        }\n\n        protected override void DoSomething(bool b)\n        {\n        }\n\n    }\n\n    public class InterfaceImplementationTogether : IEqualityComparer<int>, IEqualityComparer<string>\n    {\n        public bool Equals(int x, int y) { return true; }\n\n        public int GetHashCode(int obj) { return 0; }\n\n        public bool Equals(string x, string y) { return true; }\n\n        public int GetHashCode(string obj) { return 0; }\n    }\n\n    public interface ITest<TItem>\n    {\n        void Aaa(TItem x);\n        event EventHandler<TItem> Eee;\n        TItem this[TItem index] { get; set; }\n        TItem Ppp { get; set; }\n        void Zzz(TItem x);\n    }\n\n    public class InterfaceImplementationTogetherWithPropertiesAndEvents : ITest<int>, ITest<string>\n    {\n        public event EventHandler<int> Eee;\n        public void Aaa(int x) { }\n        public int this[int index] { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }\n        int ITest<int>.Ppp { get; set; }\n        public void Zzz(int x) { }\n\n        event EventHandler<string> ITest<string>.Eee\n        {\n            add { }\n            remove { }\n        }\n        public void Aaa(string x) { }\n        public string this[string index] { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }\n        public string Ppp { get; set; }\n        public void Zzz(string x) { }\n    }\n\n    public class ImplicitInterfaceWithEventHandler : ITest<int>\n    {\n        public void Zzz(string x) { } // Noncompliant\n\n        // Implicit interface implementation groupped together\n        public void Aaa(int x) { }\n        int ITest<int>.Ppp { get; set; }\n        public int this[int index] { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }\n        public event EventHandler<int> Eee; // C# events are not recognized as parts of interface group, grouping is splitted here\n        public void Zzz(int x) { } // Secondary\n    }\n\n    public interface ICancel\n    {\n        void Cancel();\n        void Cancel(bool b);\n        void Renew();\n    }\n\n    public class InterfaceImplementationMethodsTogether : ICancel\n    {\n        public void Cancel() { } // Noncompliant, it should be adjecent inside same interface implementation group\n        public void Renew() { }\n        public void Cancel(bool b) { } // Secondary\n    }\n\n    public interface ISecond\n    {\n        void A();\n        void Cancel();\n        void B();\n    }\n\n    public class ImplementsBoth : ICancel, ISecond\n    {\n        public void Cancel(bool b) { }\n        public void Renew() { }\n\n        public void A() { }\n        public void Cancel() { } // Implements ICancel and ISecond\n        public void B() { }\n    }\n\n    public class ImplementsBothFalseNegative : ICancel, ISecond\n    {\n        public void Cancel(bool b) { } // Noncompliant\n        public void Renew() { }\n\n        public void A() { }\n        public void B() { }\n\n        public void Something() { }\n\n        public void Cancel() { } // Secondary, implements ICancel and ISecond\n    }\n\n    public interface IInterfaceSample\n    {\n        void Grouping();\n        void DoSomething();\n    }\n\n    public class Interface_InterfaceMembersTogether : IInterfaceSample\n    {\n        private void DoSomething(int nonInterfaceOverload) { } // Compliant. DoSomething is kept with the other interface implementations.\n        public void Grouping() { }\n        public void DoSomething() { }\n    }\n\n    public class Interface_OverloadsTogether : IInterfaceSample\n    {\n        public void Grouping() { } // Compliant. Interface members are not kept together, but overloads are.\n        private void DoSomething(int nonInterfaceOverload) { }\n        public void DoSomething() { }\n    }\n\n    public class Interface_OverloadsAndInterfacesMixed : IInterfaceSample\n    {\n        public void Grouping() { } // FN. Neither the interface members nor the overoads are kept together.\n        private void DoSomething(int nonInterfaceOverload) { }\n        private void Grouping(int nonInterfaceOverload) { }\n        public void DoSomething() { }\n    }\n\n    public class Interface_ExplicitImpl : IInterfaceSample\n    {\n        public void Grouping() { }\n        private void DoSomething(int nonInterfaceOverload) { }\n        private void GroupEnd() { }\n        void IInterfaceSample.DoSomething() { } // Compliant. Explicit interface members can form their own group.\n    }\n\n    public interface IOverloadInterfaceSample\n    {\n        void DoSomething();\n        void DoSomething(int overload);\n    }\n\n    public class InterfaceOverload_InterfacemembersTogether : IOverloadInterfaceSample\n    {\n        public void DoSomething(string nonInterfaceOverload) { } // Compliant. Interface members are kept separate\n        public void EndGrouping() { }\n        public void DoSomething() { }\n        public void DoSomething(int overload) { }\n    }\n\n    public class InterfaceOverload_InterfacemembersSplit : IOverloadInterfaceSample\n    {\n        public void DoSomething() { }             // Noncompliant\n        public void EndGrouping() { }\n        public void DoSomething(int overload) { } // Secondary\n    }\n\n    public class InterfaceOverload_ExplicitAndImplicit : IOverloadInterfaceSample\n    {\n        public void DoSomething() { } // Compliant. Implicit and explicit interface implementations form their own group.\n        public void EndGrouping() { }\n        void IOverloadInterfaceSample.DoSomething(int overload) { }\n    }\n\n    public class InterfaceOverload_Explicit : IOverloadInterfaceSample\n    {\n        void IOverloadInterfaceSample.DoSomething() { } // FN. Explicit overload implementations should be kept together.\n        public void EndGrouping() { }\n        void IOverloadInterfaceSample.DoSomething(int overload) { }\n    }\n\n    public static class ClassicExtensions\n    {\n        public class Sample { }\n        public static void a(this Sample sample) { }            // Noncompliant\n        public static void a(this Sample sample, int a) { }\n        public static void b() { }\n        public static void a(this Sample sample, string z) { }  // Secondary\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodOverloadsShouldBeGrouped.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.Linq\nImports System.Text\n\nNamespace Tests.TestCases\n    Class A\n        Public Overloads Sub Test() ' Noncompliant {{All 'Test' method overloads should be adjacent.}}\n'                            ^^^^\n        End Sub\n\n        Public Overloads Sub Test(ByVal a As Integer)\n        End Sub\n\n        Property Size As Integer\n\n        Public Overloads Sub Test(ByVal a As Double) ' Secondary {{Non-adjacent overload}}\n'                            ^^^^\n        End Sub\n\n        Public Overloads Function Test2() ' Noncompliant {{All 'Test2' method overloads should be adjacent.}}\n'                                 ^^^^^\n        End Function\n\n        Public Overloads Function Test2(ByVal a As Integer)\n        End Function\n\n        Private Class NestedClass\n        End Class\n\n        Public Overloads Function Test2(ByVal a As Integer, ByVal b As Integer) ' Secondary {{Non-adjacent overload}}\n'                                 ^^^^^\n        End Function\n\n        Public Overloads Function Test3() ' Noncompliant {{All 'Test3' method overloads should be adjacent.}}\n        End Function\n\n        Public Overloads Function Test3(ByVal a As Integer)\n        End Function\n\n        Public Age As Integer\n\n        Public Overloads Function test3(ByVal a As Double) ' Secondary {{Non-adjacent overload}}\n        End Function\n\n        Public Overloads Function Test4()\n        End Function\n\n        Public Overloads Function Test4(ByVal a As Integer)\n        End Function\n\n        Public Overloads Function Test4(ByVal a As Double)\n        End Function\n\n        Public Overloads Function TEST3(ByVal a As Double, ByVal b As Integer) ' Secondary {{Non-adjacent overload}}\n        End Function\n    End Class\n\n    Class B\n        Public Sub New() ' Noncompliant {{All 'New' method overloads should be adjacent.}}\n        End Sub\n\n        Public Sub New(ByVal x As Integer)\n        End Sub\n\n        Protected Overrides Sub Finalize()\n        End Sub\n\n        Public Sub New(ByVal x As Double) ' Secondary {{Non-adjacent overload}}\n        End Sub\n    End Class\n\n    Class C\n        Public Overloads Sub Test()\n        End Sub\n\n        Public Overloads Sub TEST(ByVal a As Double)\n        End Sub\n\n        Public Overloads Sub Test(ByVal a As Integer)\n        End Sub\n\n        Public Overloads Function Test2()\n        End Function\n\n        Public Overloads Function Test2(ByVal a As Integer)\n        End Function\n    End Class\n\n    Interface D\n        Function TEST() As Integer ' Noncompliant {{All 'TEST' method overloads should be adjacent.}}\n\n        Function test(ByVal a As Double) As Integer\n\n        Event MyEvent(ByVal Success As Boolean)\n\n        Function TEST2() As Integer\n\n        Function tEst2(ByVal a As Integer) As Integer\n\n        Function test2(ByVal a As Double) As Integer\n\n        Function tEst(ByVal a As Integer) As Integer ' Secondary {{Non-adjacent overload}}\n\n        Event MyEvent2(ByVal Success As Boolean)\n    End Interface\n\n    Interface E\n        Function TEST() As Integer\n\n        Function test(ByVal a As Double) As Integer\n\n        Function tEst(ByVal a As Integer) As Integer\n\n        Event MyEvent2(ByVal Success As Boolean)\n    End Interface\n\n    Structure F\n        Public myField1 As String\n\n        Public Sub Test() ' Noncompliant {{All 'Test' method overloads should be adjacent.}}\n        End Sub\n\n        Public myField2 As String\n\n        Public Sub Test(a As Double) ' Secondary {{Non-adjacent overload}}\n        End Sub\n\n        Public myField3 As String\n\n        Public Sub Test(a As Integer) ' Secondary {{Non-adjacent overload}}\n        End Sub\n    End Structure\n\n    Class K\n\n        Public Sub Lorem()\n        End Sub\n\n        Public Sub DoSomething()\n        End Sub\n\n        Private Sub DoSomething(i As Integer)   ' Compliant interleaving With different accesibility\n        End Sub\n\n        Protected Sub DoSomething(b As Boolean)\n        End Sub\n\n        Public Sub DoSomething(s As String)\n        End Sub\n\n        Private Sub Lorem(i As Integer)     ' Compliant, different accessibility\n        End Sub\n\n    End Class\n\n    ' https://github.com/SonarSource/sonar-dotnet/issues/2776\n    Public Class StaticMethodsTogether\n\n        Public Sub New()\n        End Sub\n\n        Public Sub New(i As Integer)\n        End Sub\n\n        Public Shared Sub MethodA() ' Compliant - Static methods are grouped together, it's ok\n        End Sub\n\n        Public Shared Sub MethodB()\n        End Sub\n\n        Shared Sub New()            ' Compliant - static constructor can be grouped with static methods\n        End Sub\n\n        Public Sub MethodA(ByVal i As Integer)\n        End Sub\n\n        Public Shared Sub MethodC() ' Noncompliant - When there're more shared methods, they still should be together\n        End Sub\n\n        Public Shared Sub MethodD()\n        End Sub\n\n        Public Shared Function MethodD(i As Integer) As Integer ' Compliant\n        End Function\n\n        Public Shared Sub MethodD(b As Boolean)         ' Compliant\n        End Sub\n\n        Public Shared Sub MethodC(b As Boolean)         ' Secondary\n        End Sub\n\n        Public Shared Sub Separator()\n        End Sub\n\n        Public Shared Function MethodC(i As Integer)    ' Secondary\n        End Function\n\n    End Class\n\n    Public MustInherit Class MustOverrideMethodsTogether\n\n        Protected MustOverride Sub DoWork(b As Boolean) 'Compliant - MustOverride methods are grouped together, it's OK\n        Protected MustOverride Sub DoWork(i As Integer)\n\n        Protected Sub New()\n        End Sub\n\n        Protected Sub DoWork() 'Compliant - MustOverride methods are grouped together, it's OK\n            DoWork(True)\n            DoWork(42)\n        End Sub\n\n        Protected MustOverride Sub OnEvent(b As Boolean)    'Noncompliant\n        Protected MustOverride Sub OnProgress()\n        Protected MustOverride Sub OnEvent(i As Integer)    'Secondary\n\n        Public Sub DoSomething()\n        End Sub\n\n        Protected MustOverride Sub DoSomething(b As Boolean)\n\n        Public Sub DoSomething(i As Integer)\n        End Sub\n\n    End Class\n\n    Public Class Inheritor\n        Inherits MustOverrideMethodsTogether\n\n        Protected Overrides Sub DoWork(b As Boolean)\n        End Sub\n\n        Public Overloads Shared Sub DoWork(s As String)           'Compliant interleaving with static\n        End Sub\n\n        Protected Overrides Sub DoWork(i As Integer)\n        End Sub\n\n        Protected Overrides Sub OnEvent(b As Boolean)   'Noncompliant\n        End Sub\n\n        Protected Overrides Sub OnProgress()\n        End Sub\n\n        Protected Overrides Sub OnEvent(i As Integer)   'Secondary\n        End Sub\n\n        Protected Overrides Sub DoSomething(b As Boolean)\n        End Sub\n\n    End Class\n\n    Public Class InterfaceImplementationTogether\n        Implements IEqualityComparer(Of Integer), IEqualityComparer(Of String)\n\n        Private Function ComparerEquals(x As Integer, y As Integer) As Boolean Implements IEqualityComparer(Of Integer).Equals\n        End Function\n\n        Private Function ComparerGetHashCode(obj As Integer) As Integer Implements IEqualityComparer(Of Integer).GetHashCode\n        End Function\n\n        Private Function ComparerEquals(x As String, y As String) As Boolean Implements IEqualityComparer(Of String).Equals\n        End Function\n\n        Private Function ComparerGetHashCode(obj As String) As Integer Implements IEqualityComparer(Of String).GetHashCode\n        End Function\n\n    End Class\n\n    Public Interface ITest(Of ItemType)\n\n        Sub Aaa(X As ItemType)\n        Event Eee(Arg As ItemType)\n        Property Ppp() As ItemType\n        Sub Zzz(X As ItemType)\n\n    End Interface\n\n    Public Class InterfaceImplementationTogetherWithPropertiesAndEvents\n        Implements ITest(Of Integer), ITest(Of String)\n\n        Public Sub Aaa(X As Integer) Implements ITest(Of Integer).Aaa\n            Throw New NotImplementedException()\n        End Sub\n\n        Public Property Ppp() As Integer Implements ITest(Of Integer).Ppp\n\n        Public Event Eee(Arg As Integer) Implements ITest(Of Integer).Eee\n\n        Public Sub Zzz(X As Integer) Implements ITest(Of Integer).Zzz\n        End Sub\n\n        Public Sub Aaa(X As String) Implements ITest(Of String).Aaa\n        End Sub\n\n        Private Property ITest_Ppp() As String Implements ITest(Of String).Ppp\n\n        Private Event ITest_Eee(Arg As String) Implements ITest(Of String).Eee\n\n        Public Sub Zzz(X As String) Implements ITest(Of String).Zzz\n        End Sub\n\n    End Class\n\n    Public Interface ICancel\n\n        Sub Cancel()\n        Sub Cancel(b As Boolean)\n        Sub Renew()\n\n    End Interface\n\n    Public Class InterfaceImplementationMethodsTogether\n        Implements ICancel\n\n        Public Sub Cancel() Implements ICancel.Cancel   ' Noncompliant, it should be adjecent inside same Interface implementation group\n        End Sub\n\n        Public Sub Renew() Implements ICancel.Renew\n        End Sub\n\n        Public Sub Cancel(b As Boolean) Implements ICancel.Cancel ' Secondary\n        End Sub\n\n    End Class\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodOverrideAddsParams.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    abstract class Base\n    {\n        public virtual void Method(int[] numbers)\n        {\n        }\n        public virtual void Method(string s,\n            params int[] numbers)\n        {\n        }\n        public abstract void Method(string s, string s1,\n            int[] numbers);\n\n        public virtual void Method(string s, string s1, string s2,\n            params int[] numbers)\n        {\n        }\n    }\n    abstract class Derived : Base\n    {\n        public override void Method(int[] numbers) // Fixed\n        {\n        }\n        public override void Method(string s,\n            params int[] numbers)\n        {\n        }\n        public override void Method(string s, string s1,\n            int[] numbers) // Fixed\n        { }\n\n        public override void Method(string s, string s1, string s2,\n            int[] numbers)\n        {\n        }\n    }\n\n    public interface IFirst\n    {\n        public virtual void Method(int[] numbers)\n        {\n        }\n    }\n\n    public class Second : IFirst\n    {\n        public void Method(params int[] numbers) // Compliant - The interface method can be accessed only after cast (due to the fact that it has an implementation).\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodOverrideAddsParams.Latest.cs",
    "content": "﻿using System.Collections.Generic;\n\nabstract record Base\n{\n    public virtual void Method(int[] numbers) { }\n\n    public virtual void Method(string s, params int[] numbers) { }\n\n    public abstract void Method(string s, string s1, int[] numbers);\n\n    public virtual void Method(string s, string s1, string s2, params int[] numbers) { }\n\n    public virtual void Method2(List<int> numbers) { }\n}\n\nabstract record Derived : Base\n{\n    public override void Method(params int[] numbers) { }                       // Noncompliant {{'params' should be removed from this override.}}\n\n    public override void Method(string s, params int[] numbers) { }\n\n    public override void Method(string s, string s1, params int[] numbers) { }  // Noncompliant\n\n    public override void Method(string s, string s1, string s2, int[] numbers) { }\n\n    public override void Method2(params List<int> numbers) { }                  // Noncompliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodOverrideAddsParams.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    abstract class Base\n    {\n        public virtual void Method(int[] numbers)\n        {\n        }\n        public virtual void Method(string s,\n            params int[] numbers)\n        {\n        }\n        public abstract void Method(string s, string s1,\n            int[] numbers);\n\n        public virtual void Method(string s, string s1, string s2,\n            params int[] numbers)\n        {\n        }\n    }\n    abstract class Derived : Base\n    {\n        public override void Method(params int[] numbers) // Noncompliant {{'params' should be removed from this override.}}\n//                                  ^^^^^^\n        {\n        }\n        public override void Method(string s,\n            params int[] numbers)\n        {\n        }\n        public override void Method(string s, string s1,\n            params int[] numbers) // Noncompliant\n        { }\n\n        public override void Method(string s, string s1, string s2,\n            int[] numbers)\n        {\n        }\n    }\n\n    public interface IFirst\n    {\n        public virtual void Method(int[] numbers)\n        {\n        }\n    }\n\n    public class Second : IFirst\n    {\n        public void Method(params int[] numbers) // Compliant - The interface method can be accessed only after cast (due to the fact that it has an implementation).\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodOverrideChangedDefaultValue.Latest.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public interface IMyInterface\n    {\n        static abstract void Write(int i, int j = 5);\n\n        static virtual void Write(int i, int j, int x = 5) { }\n    }\n\n    public class Class : IMyInterface\n    {\n        public static void Write(int i, int j = 5) // Fixed\n        {\n            Console.WriteLine(i);\n        }\n\n        public static void Write(int i, int j, int x = 5) { } // Fixed\n    }\n}\n\npublic interface IMyInterface\n{\n    void Read(int i, int j = 5);\n    void Write(int i, int j = 5);\n}\n\npublic record Base : IMyInterface\n{\n    public void Read(int i, int j = 5) { } // Compliant\n\n    public virtual void Write(int i, int j = 5) { } // Fixed\n}\n\npublic partial record Derived : Base\n{\n    public override partial void Write(int i, int j = 5); // Fixed\n}\n\npublic partial record Derived\n{\n    public override partial void Write(int i, int j = 5) // Fixed\n    {\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodOverrideChangedDefaultValue.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public interface IMyInterface\n    {\n        static abstract void Write(int i, int j = 5);\n\n        static virtual void Write(int i, int j, int x = 5) { }\n    }\n\n    public class Class : IMyInterface\n    {\n        public static void Write(int i, int j = 0) // Noncompliant {{Use the default parameter value defined in the overridden method.}}\n//                                              ^\n        {\n            Console.WriteLine(i);\n        }\n\n        public static void Write(int i, int j, int x = 0) { } // Noncompliant\n    }\n}\n\npublic interface IMyInterface\n{\n    void Read(int i, int j = 5);\n    void Write(int i, int j = 5);\n}\n\npublic record Base : IMyInterface\n{\n    public void Read(int i, int j = 5) { } // Compliant\n\n    public virtual void Write(int i, int j = 0) { } // Noncompliant {{Use the default parameter value defined in the overridden method.}}\n}\n\npublic partial record Derived : Base\n{\n    public override partial void Write(int i, int j = 42); // Noncompliant\n}\n\npublic partial record Derived\n{\n    public override partial void Write(int i, int j = 1024) // Noncompliant\n    {\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodOverrideChangedDefaultValue.Remove.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public interface IMyInterface\n    {\n        void Write(int i, int j = 5);\n    }\n\n    public class Base : IMyInterface\n    {\n        public virtual void Write(int i, int j = 0) // Fixed\n        {\n            Console.WriteLine(i);\n        }\n    }\n\n    public class Derived1 : Base\n    {\n        public override void Write(int i,\n            int j = 42) // Fixed\n        {\n            Console.WriteLine(i);\n        }\n    }\n\n    public class Derived2 : Base\n    {\n        public override void Write(int i,\n            int j) // Fixed\n        {\n            Console.WriteLine(i);\n        }\n    }\n\n    public class Derived3 : Base\n    {\n        public override void Write(int i = 5,  // Fixed\n            int j = 0)\n        {\n            Console.WriteLine(i);\n        }\n    }\n\n    public class ExplicitImpl1 : IMyInterface\n    {\n        void IMyInterface.Write(int i,\n            int j) // Fixed\n        {\n        }\n    }\n\n    public interface IFirst\n    {\n        void Write(int i, int j = 5);\n\n        void Write(int i = 42);\n    }\n\n    public interface ISecond : IFirst\n    {\n        void Write(int i, int j = 5)\n        {\n        }\n\n        void Write(int i = 0) // Compliant - This method can be called only after a cast to ISecond\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodOverrideChangedDefaultValue.Synchronize.Fixed.Batch.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public interface IMyInterface\n    {\n        void Write(int i, int j = 5);\n    }\n\n    public class Base : IMyInterface\n    {\n        public virtual void Write(int i, int j = 5) // Fixed\n        {\n            Console.WriteLine(i);\n        }\n    }\n\n    public class Derived1 : Base\n    {\n        public override void Write(int i,\n            int j = 5) // Fixed\n        {\n            Console.WriteLine(i);\n        }\n    }\n\n    public class Derived2 : Base\n    {\n        public override void Write(int i,\n            int j = 5) // Fixed\n        {\n            Console.WriteLine(i);\n        }\n    }\n\n    public class Derived3 : Base\n    {\n        public override void Write(int i,  // Fixed\n            int j = 0)\n        {\n            Console.WriteLine(i);\n        }\n    }\n\n    public class ExplicitImpl1 : IMyInterface\n    {\n        void IMyInterface.Write(int i,\n            int j = 0) // Fixed\n        {\n        }\n    }\n\n    public interface IFirst\n    {\n        void Write(int i, int j = 5);\n\n        void Write(int i = 42);\n    }\n\n    public interface ISecond : IFirst\n    {\n        void Write(int i, int j = 5)\n        {\n        }\n\n        void Write(int i = 0) // Compliant - This method can be called only after a cast to ISecond\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodOverrideChangedDefaultValue.Synchronize.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public interface IMyInterface\n    {\n        void Write(int i, int j = 5);\n    }\n\n    public class Base : IMyInterface\n    {\n        public virtual void Write(int i, int j = 5) // Fixed\n        {\n            Console.WriteLine(i);\n        }\n    }\n\n    public class Derived1 : Base\n    {\n        public override void Write(int i,\n            int j = 5) // Fixed\n        {\n            Console.WriteLine(i);\n        }\n    }\n\n    public class Derived2 : Base\n    {\n        public override void Write(int i,\n            int j = 5) // Fixed\n        {\n            Console.WriteLine(i);\n        }\n    }\n\n    public class Derived3 : Base\n    {\n        public override void Write(int i,  // Fixed\n            int j = 5)\n        {\n            Console.WriteLine(i);\n        }\n    }\n\n    public class ExplicitImpl1 : IMyInterface\n    {\n        void IMyInterface.Write(int i,\n            int j = 0) // Fixed\n        {\n        }\n    }\n\n    public interface IFirst\n    {\n        void Write(int i, int j = 5);\n\n        void Write(int i = 42);\n    }\n\n    public interface ISecond : IFirst\n    {\n        void Write(int i, int j = 5)\n        {\n        }\n\n        void Write(int i = 0) // Compliant - This method can be called only after a cast to ISecond\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodOverrideChangedDefaultValue.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public interface IMyInterface\n    {\n        void Write(int i, int j = 5);\n    }\n\n    public class Base : IMyInterface\n    {\n        public virtual void Write(int i, int j = 0) // Noncompliant {{Use the default parameter value defined in the overridden method.}}\n//                                               ^\n        {\n            Console.WriteLine(i);\n        }\n    }\n\n    public class Derived1 : Base\n    {\n        public override void Write(int i,\n            int j = 42) // Noncompliant\n        {\n            Console.WriteLine(i);\n        }\n    }\n\n    public class Derived2 : Base\n    {\n        public override void Write(int i,\n            int j) // Noncompliant\n        {\n            Console.WriteLine(i);\n        }\n    }\n\n    public class Derived3 : Base\n    {\n        public override void Write(int i = 5,  // Noncompliant {{Remove the default parameter value to match the signature of overridden method.}}\n            int j = 0)\n        {\n            Console.WriteLine(i);\n        }\n    }\n\n    public class ExplicitImpl1 : IMyInterface\n    {\n        void IMyInterface.Write(int i,\n            int j = 0) // Noncompliant\n        {\n        }\n    }\n\n    public interface IFirst\n    {\n        void Write(int i, int j = 5);\n\n        void Write(int i = 42);\n    }\n\n    public interface ISecond : IFirst\n    {\n        void Write(int i, int j = 5)\n        {\n        }\n\n        void Write(int i = 0) // Compliant - This method can be called only after a cast to ISecond\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodOverrideNoParams.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    abstract class Base\n    {\n        public virtual void Method(params int[] numbers)\n        {\n        }\n        public virtual void Method(string s,\n            params int[] numbers)\n        {\n        }\n        public abstract void Method(string s, string s1,\n            params int[] numbers);\n    }\n    abstract class Derived : Base\n    {\n        public override void Method(params int[] numbers) // Fixed\n        {\n        }\n        public override void Method(string s,\n            params int[] numbers) // Fixed\n        {\n        }\n        public override void Method(string s, string s1,\n            params int[] numbers) // Fixed\n        { }\n    }\n\n    abstract class Derived2 : Base\n    {\n        public override void Method(params int[] numbers)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodOverrideNoParams.Latest.cs",
    "content": "﻿using System.Collections.Generic;\n\nabstract class Base\n{\n    public virtual void Method(params int[] numbers) { }\n    public virtual void Method(string s, params int[] numbers) { }\n    public abstract void Method(string s, string s1, params int[] numbers);\n}\nabstract class Derived : Base\n{\n    public override void Method(int[] numbers) { }              // Noncompliant {{'params' should not be removed from an override.}}\n    public override void Method(string s, int[] numbers) { }    // Noncompliant\n    public override void Method(string s, string s1, params int[] numbers) { }\n}\n\npublic interface IMath\n{\n    static virtual void Method(params int[] numbers) { }\n    static virtual void Method(string s, params int[] numbers) { }\n    static abstract void Method(string s, string s1, params int[] numbers);\n}\n\npublic class Foo : IMath\n{\n    public static void Method(int[] numbers) { } // Compliant, rule does not apply to interfaces\n    public static void Method(string s, int[] numbers) { } // Compliant, rule does not apply to interfaces\n    public static void Method(string s, string s1, int[] numbers) { } // Compliant, rule does not apply to interfaces\n}\n\nclass Base2\n{\n    public virtual void Method(params List<int> numbers) { }\n    public virtual void Method(string s, params List<int> numbers) { }\n}\n\nclass Derived2 : Base2\n{\n    public override void Method(List<int> numbers) { }              // Noncompliant {{'params' should not be removed from an override.}}\n    public override void Method(string s, List<int> numbers) { }    // Noncompliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodOverrideNoParams.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    abstract class Base\n    {\n        public virtual void Method(params int[] numbers)\n        {\n        }\n        public virtual void Method(string s,\n            params int[] numbers)\n        {\n        }\n        public abstract void Method(string s, string s1,\n            params int[] numbers);\n    }\n    abstract class Derived : Base\n    {\n        public override void Method(int[] numbers) // Noncompliant {{'params' should not be removed from an override.}}\n//                                  ^^^^^^^^^^^^^\n        {\n        }\n        public override void Method(string s,\n            int[] numbers) // Noncompliant\n        {\n        }\n        public override void Method(string s, string s1,\n            int[] numbers) // Noncompliant\n        { }\n    }\n\n    abstract class Derived2 : Base\n    {\n        public override void Method(params int[] numbers)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodParameterMissingOptional.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Runtime.InteropServices;\n\nnamespace Tests.TestCases\n{\n    public class MethodParameterMissingOptional\n    {\n        public void MyMethod([DefaultParameterValue(5), Optional] int j) //Fixed\n        {\n            Console.WriteLine(j);\n        }\n        public void MyMethod2([DefaultParameterValue(5), Optional] int j)\n        {\n            Console.WriteLine(j);\n        }\n        public void MyMethod3([DefaultParameterValue(5)][Optional] int j)\n        {\n            Console.WriteLine(j);\n        }\n        public int this[[DefaultParameterValue(5), Optional] int index] //Fixed\n        {\n            get { return 42; }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodParameterMissingOptional.Latest.cs",
    "content": "﻿using System.Runtime.InteropServices;\n\npublic record MethodParameterMissingOptional\n{\n    public void MyMethod1([DefaultParameterValue(5)] int j) { } //Noncompliant\n    public void MyMethod2([DefaultParameterValue(5), Optional] int j) { }\n    public void MyMethod3([DefaultParameterValue(5)][Optional] int j) { }\n    public int this[[DefaultParameterValue(5)] int index] //Noncompliant {{Add the 'Optional' attribute to this parameter.}}\n    {\n        get => 42;\n    }\n\n    public void LocalFunction()\n    {\n        void Local([DefaultParameterValue(5)] int j) { } //Noncompliant\n        void LocalOptional([DefaultParameterValue(5), Optional] int j) { }\n\n        static void StaticLocal([DefaultParameterValue(5)] int j) { } //Noncompliant\n        static void StaticLocalOptional([DefaultParameterValue(5), Optional] int j) { }\n    }\n}\n\npublic static class Extensions\n{\n    public class Sample { }\n    extension (Sample sample)\n    {\n        public void NonCompliant([DefaultParameterValue(5)] int j) { } //Noncompliant\n        public void Compliant([DefaultParameterValue(5), Optional] int j) { }\n        public void AlsoCompliant([DefaultParameterValue(5)][Optional] int j) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodParameterMissingOptional.TopLevelStatements.cs",
    "content": "﻿using System.Runtime.InteropServices;\n\nvoid TopLevelMethod([DefaultParameterValue(5)] int j) { } //Noncompliant\nvoid TopLevelOptional([DefaultParameterValue(5), Optional] int j) { }\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodParameterMissingOptional.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Runtime.InteropServices;\n\nnamespace Tests.TestCases\n{\n    public class MethodParameterMissingOptional\n    {\n        public void MyMethod([DefaultParameterValue(5)] int j) //Noncompliant\n//                            ^^^^^^^^^^^^^^^^^^^^^^^^\n        {\n            Console.WriteLine(j);\n        }\n        public void MyMethod2([DefaultParameterValue(5), Optional] int j)\n        {\n            Console.WriteLine(j);\n        }\n        public void MyMethod3([DefaultParameterValue(5)][Optional] int j)\n        {\n            Console.WriteLine(j);\n        }\n        public int this[[DefaultParameterValue(5)]int index] //Noncompliant {{Add the 'Optional' attribute to this parameter.}}\n        {\n            get { return 42; }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodParameterUnused.Latest.cs",
    "content": "﻿using System;\nusing System.Threading.Tasks;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace CSharp7\n{\n    public class BasicTests\n    {\n        public void Baz()\n        {\n            this.Foo(new[] { (\"some\", \"thing\") });\n        }\n\n        private void Foo((string key, string value)[] bars)\n        {\n            foreach (var (key, value) in bars)\n            { }\n        }\n\n        private void Foo2((string key, string value)[] bars)\n        {\n            var x = bars;\n        }\n    }\n}\n\nnamespace CSharp8\n{\n    public interface IWithDefaultImplementation\n    {\n        decimal Count { get; set; }\n        decimal Price { get; set; }\n\n        void Reset(int a);     //Compliant\n\n        //Default interface methods\n        decimal Total()\n        {\n            return Count * Price;\n        }\n\n        decimal Total(decimal Discount)\n        {\n            return Count * Price * (1 - Discount);\n        }\n\n        decimal Total(string unused)    // Compliant, because it's interface member\n        {\n            return Count * Price;\n        }\n    }\n\n    public class StaticLocalFunctions\n    {\n        public int DoSomething(int a)   // Compliant\n        {\n            static int LocalFunction(int x, int seed) => x + seed;\n            static int BadIncA(int x, int seed) => x + 1;   //Noncompliant\n            static int BadIncB(int x, int seed)             //Noncompliant\n            {\n                seed = 1;\n                return x + seed;\n            }\n            static int BadIncRecursive(int x, int seed)     //Noncompliant\n            {\n                seed = 1;\n                if (x > 1)\n                {\n                    return BadIncRecursive(x - 1, seed);\n                }\n                return x + seed;\n            }\n\n            return LocalFunction(a, 42) + BadIncA(a, 42) + BadIncB(a, 42) + BadIncRecursive(a, 42);\n        }\n\n        // https://github.com/SonarSource/sonar-dotnet/issues/4377\n        private static bool Foo(IEnumerable<int> a, int b)\n        {\n            bool InsideFoo(int x) => x.Equals(b);\n            bool CallInsideFoo(IEnumerable<int> numbers) => numbers.Any(x => false | InsideFoo(x));\n\n            return CallInsideFoo(a);\n        }\n\n        public void Method()\n        {\n            void WithMultipleParameters(int a,\n                                        int b, // Noncompliant\n                                        int c,\n                                        int d) // Noncompliant\n            {\n                var result = a + c;\n            }\n\n            static void WithMultipleParametersStatic(int a,\n                                                     int b, // Noncompliant\n                                                     int c,\n                                                     int d) // Noncompliant\n            {\n                var result = a + c;\n            }\n        }\n\n        // See: https://github.com/SonarSource/sonar-dotnet/issues/3803\n        private void AddValue(uint id1, uint id2, string value)\n        {\n            var x = new Dictionary<(uint, uint), string>();\n            x[(id1, id2)] = value;\n        }\n\n        public void UsedInCatch(int arg, int usedInLocalFunctionArg)\n        {\n            try\n            {\n                StaticLocalFunction(42, 42, 42);\n            }\n            catch\n            {\n                arg.ToString();\n            }\n\n            static async void StaticLocalFunction(int staticLocalArg, int staticLocalArgWithWhen, int staticLocalArgInWhen)\n            {\n                try\n                {\n                }\n                catch when (staticLocalArgInWhen == 0)\n                {\n                    staticLocalArgWithWhen.ToString();\n                }\n                catch\n                {\n                    staticLocalArg.ToString();\n                }\n            }\n        }\n    }\n\n    public class SwitchExpressions\n    {\n        public int DoSomething(int a, bool b)\n        {\n            return b switch\n            {\n                true => a,\n                _ => 0\n            };\n        }\n    }\n\n    public class UsageInRange\n    {\n        public void DoSomething(int a, int b)\n        {\n            var list = new string[] { \"a\", \"b\", \"c\" };\n            var sublist = list[a..];\n            System.Range r = ..^b;\n            sublist = list[r];\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/3255\n    public class Repro_3255\n    {\n        private string UsedInTuple(string value)\n        {\n            var x = (value, 7);\n            return x.value;\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/4704\n    public static class Repro_4704\n    {\n        private static void ConfigureAndValidateSettings(this int someNumber, string someString)    // Compliant, captured in generic local method\n        {\n            PrintSomeSum<int>();\n\n            void PrintSomeSum<TOptions>() where TOptions : struct\n            {\n                Console.WriteLine(someNumber + someString.Length);\n            }\n        }\n\n        private static void NotInvoked(string someString)    // Noncompliant\n        {\n            var somethingWithGenericName = new System.Lazy<object>(() => null);\n            Undefined<int>(); // Error [CS0103] The name 'Undefined' does not exist in the current context\n\n            void PrintSomeSum<TOptions>() where TOptions : struct\n            {\n                Console.WriteLine(someString.Length);\n            }\n        }\n\n        private static void UsedByReferenceWithStruct(this int someNumber, string someString)\n        {\n            Action x = PrintSomeSum<int>;\n\n            x();\n\n            void PrintSomeSum<TOptions>() where TOptions : struct\n            {\n                Console.WriteLine(someNumber + someString.Length);\n            }\n        }\n\n        private static void UsedByReferenceAsArgument(int[] list, string arg)\n        {\n            list.Where(LocalFunction<int>);\n\n            bool LocalFunction<TOptions>(TOptions x) where TOptions : struct\n            {\n                Console.WriteLine(arg);\n                return true;\n            }\n        }\n\n        private static void InsideNameOf_Valid(string arg)   // Noncompliant\n        {\n            var name = nameof(LocalFunction);\n\n            void LocalFunction<TOptions>() where TOptions : struct\n            {\n                Console.WriteLine(arg);\n            }\n        }\n\n        private static void InsideNameOf_Invalid(string arg)   // Noncompliant\n        {\n            var name = nameof(LocalFunction<int>);      // Error [CS8084] Type parameters are not allowed on a method group as an argument to 'nameof'\n\n            void LocalFunction<TOptions>() where TOptions : struct\n            {\n                Console.WriteLine(arg);\n            }\n        }\n    }\n\n    // https://github.com/dotnet/roslyn/issues/56644\n    public class RoslynIssue_56644\n    {\n        private char[] invalidCharacters;\n\n        private bool IsValidViewName(string viewName)    // Compliant, this works as expected under .NET build, but doesn't work under .NET Framework\n        {\n            return !this.invalidCharacters.Any(viewName.Contains);\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/5145\n    static class Repro5145\n    {\n        public static void Print(string[] args)\n        {\n            var dict = new Dictionary<string, int>();\n            Console.WriteLine(GetSegmentSortKey(dict));\n        }\n\n        private static int GetSegmentSortKey(IDictionary<string, int> nodes) // Compliant\n        {\n            return Run(nodes.TryGetValueOrNull);\n        }\n\n        private static int Run(Func<string, int> tryGetValueOrNull)\n        {\n            return tryGetValueOrNull(\"test\");\n        }\n    }\n\n    public static class DictionaryExtensions\n    {\n        public static TValue TryGetValueOrNull<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key) where TValue : struct => default(TValue);\n    }\n}\n\nnamespace CSharp10\n{\n    public class Base\n    {\n        public Base() { }\n\n        public Base(int x) { }\n\n        public Base(string x) { }\n    }\n\n    public class A : Base\n    {\n        public A(int x, int y) : base(x) { }\n\n        private A(string x, string y) : base(x) { } // Method is empty\n\n        public A(int i, int j, int z)\n        {\n            Console.WriteLine(j + z);\n        }\n\n        private A(string i, string j, string z) // Noncompliant\n        {\n            Console.WriteLine(j + z);\n        }\n\n        public A(int x, int y, string z) : this(x, y) { }\n\n        private A(string x, string y, int z) : this(x, y) // Noncompliant\n        {\n            Console.WriteLine(x);\n        }\n    }\n\n    public record class B\n    {\n        public B(int i, int j)\n        {\n            Console.WriteLine(j);\n        }\n\n        private B(string i, int j) // Noncompliant\n        {\n            Console.WriteLine(j);\n        }\n    }\n\n    public struct C\n    {\n        public C(int i, int j)\n        {\n            Console.WriteLine(j);\n        }\n\n        private C(string i, int j) // Noncompliant\n        {\n            Console.WriteLine(j);\n        }\n    }\n\n    public record struct D\n    {\n        public D(int i, int j)\n        {\n            Console.WriteLine(j);\n        }\n\n        private D(string i, int j) // Noncompliant\n        {\n            Console.WriteLine(j);\n        }\n    }\n}\n\nnamespace CSharp11\n{\n    namespace SomeNamespace\n    {\n        public class MethodParameterUnused\n        {\n            private void Argument_Unused(string argument) // Noncompliant\n    //                                   ^^^^^^^^^^^^^^^\n            {\n                var x = 42;\n            }\n\n            private void Argument_Reassigned(string argument) // Noncompliant\n    //                                       ^^^^^^^^^^^^^^^\n            {\n                argument = \"So Long, and Thanks for All the Fish\";\n            }\n\n            [Obsolete(nameof(argument))]\n            private void Argument_UsedInAttributeByNameOf(string argument) // Compliant, methods with attributes are ignored\n            {\n                var x = 42;\n            }\n\n            [Obsolete(nameof(TArgument))]\n            private void Argument_UsedInGenericAttributeByNameOf<TArgument>(TArgument argument) // Compliant, methods with attributes are ignored\n            {\n                var x = 42;\n            }\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/8988\n    namespace Issue_8988\n    {\n        public partial class PartialMethod\n        {\n            private partial string ExtendedPartialMethod(string one, string two);\n        }\n\n        public partial class PartialMethod\n        {\n            private partial string ExtendedPartialMethod(string one, string two) // Compliant, we don't want to raise on partial methods due to generated signatures\n            {\n                return two;\n            }\n        }\n    }\n}\n\nnamespace CSharp13\n{\n    public class Class\n    {\n        private async void TaskWhenEach(List<Task> tasks) // Compliant\n        {\n            await foreach (var item in Task.WhenEach(tasks))\n            {\n                var x = 1;\n            }\n        }\n\n        private void NewLinqMethods(List<int> a, List<int> b, List<int> c) // Compliant\n        {\n            _ = new List<int>().CountBy(x => a);\n            _ = b.AggregateBy(x => x, seed: 0, (x, y) => y);\n            _ = c.Index();\n        }\n\n        private IEnumerable<int> IteratorRef(int[] a)  // Compliant\n        {\n            ref int x = ref a[0];\n            yield break;\n        }\n\n        private async Task AsyncRef(int[] a)  // Compliant\n        {\n            ref int x = ref a[0];\n            await Task.Delay(50);\n        }\n    }\n}\n\nnamespace ReproMethodGroups\n{\n    internal static class Test\n    {\n        private static string Test1(string x) => string.Empty; // FN\n\n        private static string Test2(string x) => string.Empty; // Noncompliant\n\n        public static void Main()\n        {\n            _ = Enumerable.Empty<string>().Select(Test1);\n            _ = Enumerable.Empty<string>().Select(x => Test2(x));\n        }\n    }\n}\n\nnamespace ReproCaptureInLocalFunction\n{\n    internal static class Test\n    {\n        // https://community.sonarsource.com/t/132900\n        private static string CaptureInSwitchExression(string currentUnit) // Compliant\n        {\n            return GetLongUnit();\n\n            string GetLongUnit()\n            {\n                return currentUnit switch\n                {\n                    \"M\" => \"Meters\",\n                    _ => \"Yards\"\n                };\n            }\n        }\n\n        private static string CaptureSimple(string text) // Compliant\n        {\n            return UpperCase();\n\n            string UpperCase() => text.ToUpper();\n        }\n    }\n}\n\nnamespace ReproNET2384\n{\n    class Test\n    {\n        // https://sonarsource.atlassian.net/browse/NET-2384\n        void Method(string? a, string? b) // Noncompliant FP for string? b. The b value is read if a is null\n        {\n            LocalFunction();\n            void LocalFunction()\n            {\n                if (a != null)\n                {\n                    b = null; // modify b only if a is not null\n                }\n                if (b != null)\n                {\n                    //...\n                }\n            }\n        }\n    }\n}\n\npublic static class Extensions\n{\n    extension(string s)\n    {\n        [Any]\n        public int MyMethod2(int i, int b) => b;              // Compliant, because of the attribute\n        public void MyMethod(int i) { }                       // Compliant - Unused extension owner\n        public int Add(int a, int b) => a + b;                // Compliant\n        public int AddedLength(int a, int b) => s.Length + b; // FN https://sonarsource.atlassian.net/browse/NET-2732\n    }\n    public class AnyAttribute : Attribute { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodParameterUnused.RoslynCfg.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing System.Runtime.Serialization;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Tests.TestCases\n{\n    internal interface MyPrivateInterface\n    {\n        void MyPrivateMethod(int a);\n    }\n\n    public class BasicTests : MyPrivateInterface\n    {\n        private BasicTests(int a) : this(a, 42) // Compliant\n        { }\n\n        private BasicTests(\n            int a\n            ) // Fixed\n        {\n            Console.WriteLine(a);\n\n            Action<string> x = WriteLine;\n            Action<string> y = WriteLine<int>;\n        }\n\n        private void BasicTest1(int a) { } // Compliant\n        void BasicTest2(int a) { } // Compliant\n        private void BasicTest3(int a) { } // Compliant\n        public void Caller()\n        {\n            BasicTest3(42); // Doesn't make it compliant\n        }\n\n        void MyPrivateInterface.MyPrivateMethod(int a) // Compliant\n        {\n        }\n\n        public int MyMethod(int a) => a; // Compliant\n\n        private static void WriteLine(string format) { } // Compliant\n        private static void WriteLine<T>(string format) { } // Compliant\n\n        void Foo(string a) // Compliant because only throws NotImplementedException\n        {\n            throw new NotImplementedException();\n        }\n\n        public void Foo(int arg1) // Compliant\n        {\n            // Empty on purpose\n        }\n\n        void DoSomething(int a, int b) => throw new NotImplementedException();\n\n        private void UsedInCatch(int arg, int argLocalLifetime, int usedInLocalFunctionArg)\n        {\n            try\n            {\n                LocalFunction(42);\n            }\n            catch\n            {\n                arg.ToString();\n            }\n\n            try\n            {\n                LocalFunctionLocalLifetime(42);\n                var t = true || true; // This causes LocalLivetimeRegion to be generated\n            }\n            catch\n            {\n                argLocalLifetime.ToString();\n            }\n\n            void LocalFunction(int localArg)\n            {\n                try\n                {\n                }\n                catch\n                {\n                    localArg.ToString();\n                    usedInLocalFunctionArg.ToString();\n                }\n            }\n\n            void LocalFunctionLocalLifetime(int localArgLocalLifetime)\n            {\n                try\n                {\n                    DoSomething();\n                    var t = true || true; // This causes LocalLivetimeRegion to be generated\n                }\n                catch\n                {\n                    localArgLocalLifetime.ToString();\n                    usedInLocalFunctionArg.ToString();\n                }\n            }\n\n            void DoSomething()\n            { }\n        }\n    }\n\n    class MainEntryPoints1\n    {\n        static void Main(string[] args) // Compliant because Main is ignored + empty method\n        {\n        }\n    }\n\n    class MainEntryPoints2\n    {\n        static async Task Main(string[] args) // Compliant - new main syntax\n        {\n            Console.WriteLine(\"Test\");\n        }\n    }\n\n    class MainEntryPoints3\n    {\n        static async Task<int> Main(string[] args) // Compliant - new main syntax\n        {\n            Console.WriteLine(\"Test\");\n            return 1;\n        }\n    }\n\n    class MainEntryPoints4\n    {\n        static async Task<string> Main() // Fixed\n        {\n            Console.WriteLine(\"Test\");\n            return \"\";\n        }\n    }\n\n    public class Program1\n    {\n        static void Main(string[] args) // Compliant because Main is ignored + only a throw NotImplemented\n        {\n            throw new NotImplementedException();\n        }\n    }\n\n    public class Program2\n    {\n        static void Main(string[] args) // Compliant because Main is ignored\n        {\n            Console.WriteLine(\"foo\");\n        }\n    }\n\n    public class Reassigned\n    {\n        private void DeadOnEntry(int arg)    // Fixed\n        {\n            arg = 42;\n            arg.ToString(); // Use\n        }\n\n        private void SelfAssigned(int arg)\n        {\n            arg = arg;\n            arg.ToString(); // Use\n        }\n\n        private void UpdatedFromSelf(int arg)\n        {\n            arg = arg + 1;\n            arg.ToString(); // Use\n        }\n\n        private void UpdatedFromSelf(string arg)\n        {\n            arg = arg.Replace(\"'\", \"''\");\n            arg.ToString(); // Use\n        }\n    }\n\n    public class FooBar\n    {\n        public FooBar(string a) // Compliant\n        {\n        }\n    }\n\n    public class AnyAttribute : Attribute { }\n\n    public static class Extensions\n    {\n        private static void MyMethod(this string s,\n            int i) // Compliant\n        {\n\n        }\n\n        [Any]\n        private static void MyMethod2(this string s,\n            int i) // Compliant because of the attribute\n        {\n\n        }\n\n        private static int Add(this string s, int a, int b) //Unused extension owner is ignored\n        {\n            return a + b;\n        }\n\n        private static int AddedLength(this string s, int a) //Fixed\n        {\n            return s.Length + a;\n        }\n\n    }\n\n    abstract class BaseAbstract\n    {\n        public abstract void M3(int a); //okay\n    }\n    class Base\n    {\n        public virtual void M3(int a) //okay\n        {\n        }\n    }\n    interface IMy\n    {\n        void M4(int a);\n    }\n\n    class MethodParameterUnused : Base, IMy\n    {\n        private void M1(int a) // Compliant\n        {\n        }\n\n        void M1Bis(\n            int a,\n                        int c\n            ) // Fixed\n        {\n            var result = a + c;\n        }\n\n        private void M1okay(int a)\n        {\n            Console.Write(a);\n        }\n\n        public virtual void M2(int a)\n        {\n        }\n\n        public override void M3(int a) //okay\n        {\n        }\n\n        public void M4(int a) //okay\n        { }\n\n        private void MyEventHandlerMethod(object sender, EventArgs e) //okay, event handler\n        { }\n        private void MyEventHandlerMethod(object sender, MyEventArgs e) //okay, event handler\n        { }\n\n        class MyEventArgs : EventArgs { }\n    }\n\n    class MethodAsEvent\n    {\n        delegate void CustomDelegate(string arg1, int arg2);\n        event CustomDelegate SomeEventAdd;\n        event CustomDelegate SomeEventSub;\n\n        public MethodAsEvent()\n        {\n            SomeEventAdd += MyMethodAdd;\n            SomeEventSub -= MyMethodSub;\n        }\n\n        private void MyMethodAdd(string arg1, int arg2) // Compliant\n        {\n        }\n\n        private void MyMethodSub(string arg1, int arg2) // Compliant\n        {\n        }\n    }\n\n    class MethodAssignedToActionFromInitializer\n    {\n        private static void MyMethod1(int arg) { } // Compliant, because of the below assignment\n\n        public System.Action<int> MyReference = MyMethod1;\n    }\n\n    class MethodAssignedToActionFromInitializerQualified\n    {\n        private static void MyMethod2(int arg) { } // Compliant, because of the below assignment\n\n        public System.Action<int> MyReference = MethodAssignedToActionFromInitializerQualified.MyMethod2;\n    }\n\n    class MethodAssignedToFromVariable\n    {\n        private static void MyMethod3(int arg) { } // Compliant, because of the below assignment\n\n        public void Foo()\n        {\n            System.Action<int> MyReference;\n            MyReference = MyMethod3;\n        }\n    }\n\n    class MethodAssignedToFromVariableQualified\n    {\n        private static void MyMethod4(int arg) { } // Compliant, because of the below assignment\n\n        public void Foo()\n        {\n            System.Action<int> MyReference;\n            MyReference = new System.Action<int>(MethodAssignedToFromVariableQualified.MyMethod4);\n        }\n    }\n\n    partial class MethodAssignedToActionFromPartialClass\n    {\n        private static void MyMethod5(int arg) { } // Compliant, because of the below assignment\n\n        private static void MyNonCompliantMethod(int arg) { }\n    }\n\n    partial class MethodAssignedToActionFromPartialClass\n    {\n        public System.Action<int> MyReference = MethodAssignedToActionFromPartialClass.MyMethod5;\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/8988\n    public partial class PartialMethod_Issue_8988\n    {\n        partial void Partial(string one, string two);\n    }\n\n    public partial class PartialMethod_Issue_8988\n    {\n        partial void Partial(string one, string two) // Compliant, we don't want to raise on partial methods due to generated signatures\n        {\n            Console.Write(two);\n        }\n    }\n\n    public class Dead\n    {\n        private int Method1(int p) => (new Func<int>(() => { p = 10; return p; }))(); // Not reporting on this\n\n        private void Method2(int p)\n        {\n            var x = true;\n            if (x)\n            {\n                p = 10;\n                Console.WriteLine(p);\n            }\n\n            Console.WriteLine(p);\n        }\n\n        public void Method3_Public(int p) // Compliant\n        {\n            var x = true;\n            if (x)\n            {\n                p = 10;\n                Console.WriteLine(p);\n            }\n        }\n\n        private void Method3(int p) // Fixed\n        {\n            var x = true;\n            if (x)\n            {\n                p = 10;\n                Console.WriteLine(p);\n            }\n\n            Action<int> a = new Action<int>(Method4);\n        }\n\n        private void Method4(int p) // Fixed\n        {\n            var x = true;\n            if (x)\n            {\n                p = 10;\n                Console.WriteLine(p);\n            }\n            else\n            {\n                p = 11;\n            }\n        }\n\n        private void Method5_Out(out int p)\n        {\n            var x = true;\n            if (x)\n            {\n                p = 10;\n                Console.WriteLine(p);\n            }\n            else\n            {\n                p = 11;\n            }\n        }\n\n        private int Method6_LocalFunctions(int usedInLocalFunction)   // Compliant\n        {\n            int LocalFunction(int seed) => usedInLocalFunction + seed;\n            int BadIncA() => usedInLocalFunction + 1;   // Fixed\n            int BadIncB(int seed)             // Fixed\n            {\n                seed = 1;\n                return usedInLocalFunction + seed;\n            }\n\n            return LocalFunction(42) + BadIncA(42) + BadIncB(42);\n        }\n    }\n\n    public class Intermediate : ISerializable // Error [CS0535]\n    { }\n\n    [Serializable]\n    public class ProperImplementedSerializableClass : Intermediate\n    {\n        private string value;\n\n        private ProperImplementedSerializableClass(SerializationInfo info, StreamingContext context) // Compliant, because using the streaming context is not required for properly implementing the serializable constructor.\n        {\n            value = info.GetString(\"Value\");\n        }\n    }\n\n    [Serializable]\n    public class NotProperImplementedSerializableClass : Intermediate\n    {\n        private StreamingContextStates state;\n\n        private NotProperImplementedSerializableClass(StreamingContext context) // Fixed\n        {\n            state = context.State;\n        }\n    }\n\n    [Serializable]\n    public class NotProperImplementedSerializableClass2\n    {\n        private string value;\n\n        private NotProperImplementedSerializableClass2(SerializationInfo info) // Fixed\n        {\n            value = info.GetString(\"Value\");\n        }\n    }\n\n    public class EffectiveAccessibility\n    {\n        private class Inner\n        {\n            public void Method(int a\n                ) // Fixed\n            {\n                Console.WriteLine(a);\n            }\n        }\n    }\n\n    public class SwitchInTry\n    {\n        private int Method(int i)   // Compliant\n        {\n            try\n            {\n                switch (i)\n                {\n                    case 0:\n                        return 1;\n                    case 1:\n                        return 2;\n                    default:\n                        return 3;\n                }\n            }\n            catch\n            {\n                return 4;\n            }\n        }\n    }\n\n    class NullConditionalOperatorInTry\n    {\n        private void Method(string s)   // Compliant\n        {\n            try\n            {\n                s?.ToString();\n            }\n            catch\n            {\n            }\n        }\n    }\n\n    public class ReproGithubIssue2010\n    {\n        static int PatternMatch(StringSplitOptions splitOptions, int i)\n        {\n            switch (splitOptions)\n            {\n                case StringSplitOptions.None\n                    when i > 0:\n                    return 1;\n                default:\n                    return 0;\n            }\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/3132\n    public class Repro_3132\n    {\n        object TupleArgument((string adress, bool state)? e)\n        {\n            return new { Data = (e?.adress, e?.state) };\n        }\n\n        public object PublicTupleArgument((string adress, bool state)? e) // Compliant for public method\n        {\n            return new { Data = (e?.adress, e?.state) };\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/3134\n    public class Repro_3134\n    {\n        private static Predicate<DateTime> LocalFunctionReturned(DateTime dateTime)\n        {\n            bool Filter(DateTime time) => time.Year == dateTime.Year;\n            return Filter;\n        }\n\n        private void LocalFunctionReferencedArrow(bool condition)\n        {\n            Enumerable.Empty<object>().Where(IsTrue);\n\n            bool IsTrue(object x) => condition;\n        }\n\n        private void LocalFunctionReferencedBody(bool condition)\n        {\n            Enumerable.Empty<object>().Where(IsTrue);\n\n            bool IsTrue(object x)\n            {\n                return condition;\n            };\n        }\n\n        private void LocalFunctionCrossReferenced(bool condition)\n        {\n            Enumerable.Empty<object>().Where(IsTrueOuter);\n\n            bool IsTrueOuter(object x) => new[] { x }.Any(IsTrueMiddle);\n            bool IsTrueMiddle(object x) => IsTrueInner();\n            bool IsTrueInner() => condition;\n        }\n\n        private void LocalFunctionRecursive(int arg)\n        {\n            Enumerable.Empty<object>().Where(IsTrue);\n\n            bool IsTrue(object x)\n            {\n                arg--;\n                return arg <= 0 || new[] { x }.Any(IsTrue);\n            }\n        }\n\n        private void LocalFunctionUnused(bool condition)    // Fixed\n        {\n            bool Unused() => condition;\n        }\n\n        private void LocalFunctionUnusedWithNameOf(bool condition)    // Fixed\n        {\n            var name = nameof(Unused);\n\n            bool Unused() => condition;\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/4096\n    public class Repro_4096\n    {\n        private int TryCatchWithUsing(int errorCode)\n        {\n            try\n            {\n                using (var textWriter = new StreamWriter(\"TestOutput.txt\"))\n                {\n                    textWriter.Write(\"There is an errorcode\");\n\n                    return 0;\n                }\n            }\n            catch (Exception)\n            {\n                return errorCode;\n            }\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/4199\n    public class Repro_4199\n    {\n        private Task DoSomethingAsync(string text)\n        {\n            return Task.Run(async () => await UseAsync());\n\n            async Task UseAsync()\n            {\n                await Task.Delay(100);\n                Console.WriteLine(text);\n            }\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/5338\n    public class Repro_5338\n    {\n        private string[] largerArray;\n\n        // This case is very similar to our MethodParameterUnused.RoslynCfg.Fixed.cs, but it reproduces on .NET build as well.\n        // https://github.com/dotnet/roslyn/issues/56644\n        private bool HasAny(string[] smallerOrEqualArray)       // Compliant\n        {\n            return largerArray.Any(smallerOrEqualArray.Contains);\n        }\n\n        private static double GetDegreeOfOverlap(string[] largerArray, string[] smallerOrEqualArray)    // Compliant\n        {\n            return (double)largerArray.Count(smallerOrEqualArray.Contains) / largerArray.Length;\n        }\n    }\n\n    // https://github.com/dotnet/roslyn/issues/56644\n    public class RoslynIssue_56644\n    {\n        private char[] invalidCharacters;\n\n        private bool IsValidViewName(string viewName)   // Compliant, this was working as expected under .NET build, but didn't work under .NET Framework. We handle it by syntax now.\n        {\n            return !this.invalidCharacters.Any(viewName.Contains);\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/8371\n    public class Repro_8371\n    {\n        static Repro_8371()\n        {\n            AppDomain.CurrentDomain.AssemblyResolve += AssemblyResolver.LoadAnyVersion;\n        }\n\n        private static class AssemblyResolver\n        {\n            public static Assembly LoadAnyVersion(object sender, ResolveEventArgs args) // Was not detected by IsEventHandler because the non-void return type\n            {\n                ReferenceEquals(1, 2);\n                return null;\n            }\n        }\n    }\n\n    // https://sonarsource.atlassian.net/browse/NET-1090\n    public static class Repro_1090\n    {\n        private static bool InstanceMethod(IDictionary<int, bool> dict)\n        {\n            return Enumerable.Range(0, 1).Any(dict.Keys.Contains);\n        }\n\n        private static bool ExtensionMethod(IDictionary<int, bool> dict)\n        {\n            return Enumerable.Range(0, 1).Any(dict.ContainsExt);\n        }\n\n        private static bool ExtensionMethodWithMemberAccess(IDictionary<int, bool> dict) // Fixed\n        {\n            return Enumerable.Range(0, 1).Any(dict.Keys.ContainsExt); // The member access dict.Key is not supported\n        }\n\n        private static bool ContainsExt(this ICollection<int> ints, int value) => ints.Contains(value);\n        private static bool ContainsExt(this IDictionary<int, bool> dict, int value) => dict.Keys.Contains(value);\n    }\n\n    // https://sonarsource.atlassian.net/browse/NET-1168\n    public class Repro_1168\n    {\n        private void Repro(string s1, string s2, int val)  // Compliant\n        {\n            LocalFunction();\n\n            void LocalFunction()\n            {\n                s1 = s1?.ToString();\n                Console.WriteLine(s2 ?? \"Nothing\");\n                var x = true ? val : 42;\n            }\n        }\n\n        private void Nested(string s)  // Compliant\n        {\n            Outer();\n\n            void Outer()\n            {\n                Inner();\n\n                void Inner()\n                {\n                    Console.WriteLine(s ?? \"default\");\n                }\n            }\n        }\n\n        private void NotInvoked(string s)  // Fixed\n        {\n            void LocalFunction()\n            {\n                Console.WriteLine(s ?? \"default\");\n            }\n        }\n\n        private void WithMethodReference(string s)  // Compliant - s is used in local function passed as method reference\n        {\n            Action a = LocalFunction;\n            a();\n\n            void LocalFunction()\n            {\n                Console.WriteLine(s ?? \"default\");\n            }\n        }\n\n        private void WithAnonymousFunction(string s)  // Compliant - s is used in anonymous function\n        {\n            Action a = () => Console.WriteLine(s ?? \"default\");\n            a();\n        }\n\n        private void WithRecursiveLocalFunction(string s)  // Compliant\n        {\n            LocalFunction();\n\n            void LocalFunction()\n            {\n                if (s?.Length > 0)\n                    LocalFunction();\n            }\n        }\n\n        private void WithLambdaCallingLocalFunction(string s)  // Compliant - s is used in local function called from lambda\n        {\n            Action a = () => Console.WriteLine(LocalFunction());\n            a();\n\n            string LocalFunction() => s ?? \"default\";\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodParameterUnused.RoslynCfg.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing System.Runtime.Serialization;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Tests.TestCases\n{\n    internal interface MyPrivateInterface\n    {\n        void MyPrivateMethod(int a);\n    }\n\n    public class BasicTests : MyPrivateInterface\n    {\n        private BasicTests(int a) : this(a, 42) // Compliant\n        { }\n\n        private BasicTests(\n            int a,\n            int b) // Noncompliant\n        //  ^^^^^\n        {\n            Console.WriteLine(a);\n\n            Action<string> x = WriteLine;\n            Action<string> y = WriteLine<int>;\n        }\n\n        private void BasicTest1(int a) { } // Compliant\n        void BasicTest2(int a) { } // Compliant\n        private void BasicTest3(int a) { } // Compliant\n        public void Caller()\n        {\n            BasicTest3(42); // Doesn't make it compliant\n        }\n\n        void MyPrivateInterface.MyPrivateMethod(int a) // Compliant\n        {\n        }\n\n        public int MyMethod(int a) => a; // Compliant\n\n        private static void WriteLine(string format) { } // Compliant\n        private static void WriteLine<T>(string format) { } // Compliant\n\n        void Foo(string a) // Compliant because only throws NotImplementedException\n        {\n            throw new NotImplementedException();\n        }\n\n        public void Foo(int arg1) // Compliant\n        {\n            // Empty on purpose\n        }\n\n        void DoSomething(int a, int b) => throw new NotImplementedException();\n\n        private void UsedInCatch(int arg, int argLocalLifetime, int usedInLocalFunctionArg)\n        {\n            try\n            {\n                LocalFunction(42);\n            }\n            catch\n            {\n                arg.ToString();\n            }\n\n            try\n            {\n                LocalFunctionLocalLifetime(42);\n                var t = true || true; // This causes LocalLivetimeRegion to be generated\n            }\n            catch\n            {\n                argLocalLifetime.ToString();\n            }\n\n            void LocalFunction(int localArg)\n            {\n                try\n                {\n                }\n                catch\n                {\n                    localArg.ToString();\n                    usedInLocalFunctionArg.ToString();\n                }\n            }\n\n            void LocalFunctionLocalLifetime(int localArgLocalLifetime)\n            {\n                try\n                {\n                    DoSomething();\n                    var t = true || true; // This causes LocalLivetimeRegion to be generated\n                }\n                catch\n                {\n                    localArgLocalLifetime.ToString();\n                    usedInLocalFunctionArg.ToString();\n                }\n            }\n\n            void DoSomething()\n            { }\n        }\n    }\n\n    class MainEntryPoints1\n    {\n        static void Main(string[] args) // Compliant because Main is ignored + empty method\n        {\n        }\n    }\n\n    class MainEntryPoints2\n    {\n        static async Task Main(string[] args) // Compliant - new main syntax\n        {\n            Console.WriteLine(\"Test\");\n        }\n    }\n\n    class MainEntryPoints3\n    {\n        static async Task<int> Main(string[] args) // Compliant - new main syntax\n        {\n            Console.WriteLine(\"Test\");\n            return 1;\n        }\n    }\n\n    class MainEntryPoints4\n    {\n        static async Task<string> Main(string[] args) // Noncompliant\n        {\n            Console.WriteLine(\"Test\");\n            return \"\";\n        }\n    }\n\n    public class Program1\n    {\n        static void Main(string[] args) // Compliant because Main is ignored + only a throw NotImplemented\n        {\n            throw new NotImplementedException();\n        }\n    }\n\n    public class Program2\n    {\n        static void Main(string[] args) // Compliant because Main is ignored\n        {\n            Console.WriteLine(\"foo\");\n        }\n    }\n\n    public class Reassigned\n    {\n        private void DeadOnEntry(int arg)    // Noncompliant\n        {\n            arg = 42;\n            arg.ToString(); // Use\n        }\n\n        private void SelfAssigned(int arg)\n        {\n            arg = arg;\n            arg.ToString(); // Use\n        }\n\n        private void UpdatedFromSelf(int arg)\n        {\n            arg = arg + 1;\n            arg.ToString(); // Use\n        }\n\n        private void UpdatedFromSelf(string arg)\n        {\n            arg = arg.Replace(\"'\", \"''\");\n            arg.ToString(); // Use\n        }\n    }\n\n    public class FooBar\n    {\n        public FooBar(string a) // Compliant\n        {\n        }\n    }\n\n    public class AnyAttribute : Attribute { }\n\n    public static class Extensions\n    {\n        private static void MyMethod(this string s,\n            int i) // Compliant\n        {\n\n        }\n\n        [Any]\n        private static void MyMethod2(this string s,\n            int i) // Compliant because of the attribute\n        {\n\n        }\n\n        private static int Add(this string s, int a, int b) //Unused extension owner is ignored\n        {\n            return a + b;\n        }\n\n        private static int AddedLength(this string s, int a, int b) //Noncompliant\n        {\n            return s.Length + a;\n        }\n\n    }\n\n    abstract class BaseAbstract\n    {\n        public abstract void M3(int a); //okay\n    }\n    class Base\n    {\n        public virtual void M3(int a) //okay\n        {\n        }\n    }\n    interface IMy\n    {\n        void M4(int a);\n    }\n\n    class MethodParameterUnused : Base, IMy\n    {\n        private void M1(int a) // Compliant\n        {\n        }\n\n        void M1Bis(\n            int a,\n            int b, // Noncompliant\n            int c,\n            int d) // Noncompliant\n        {\n            var result = a + c;\n        }\n\n        private void M1okay(int a)\n        {\n            Console.Write(a);\n        }\n\n        public virtual void M2(int a)\n        {\n        }\n\n        public override void M3(int a) //okay\n        {\n        }\n\n        public void M4(int a) //okay\n        { }\n\n        private void MyEventHandlerMethod(object sender, EventArgs e) //okay, event handler\n        { }\n        private void MyEventHandlerMethod(object sender, MyEventArgs e) //okay, event handler\n        { }\n\n        class MyEventArgs : EventArgs { }\n    }\n\n    class MethodAsEvent\n    {\n        delegate void CustomDelegate(string arg1, int arg2);\n        event CustomDelegate SomeEventAdd;\n        event CustomDelegate SomeEventSub;\n\n        public MethodAsEvent()\n        {\n            SomeEventAdd += MyMethodAdd;\n            SomeEventSub -= MyMethodSub;\n        }\n\n        private void MyMethodAdd(string arg1, int arg2) // Compliant\n        {\n        }\n\n        private void MyMethodSub(string arg1, int arg2) // Compliant\n        {\n        }\n    }\n\n    class MethodAssignedToActionFromInitializer\n    {\n        private static void MyMethod1(int arg) { } // Compliant, because of the below assignment\n\n        public System.Action<int> MyReference = MyMethod1;\n    }\n\n    class MethodAssignedToActionFromInitializerQualified\n    {\n        private static void MyMethod2(int arg) { } // Compliant, because of the below assignment\n\n        public System.Action<int> MyReference = MethodAssignedToActionFromInitializerQualified.MyMethod2;\n    }\n\n    class MethodAssignedToFromVariable\n    {\n        private static void MyMethod3(int arg) { } // Compliant, because of the below assignment\n\n        public void Foo()\n        {\n            System.Action<int> MyReference;\n            MyReference = MyMethod3;\n        }\n    }\n\n    class MethodAssignedToFromVariableQualified\n    {\n        private static void MyMethod4(int arg) { } // Compliant, because of the below assignment\n\n        public void Foo()\n        {\n            System.Action<int> MyReference;\n            MyReference = new System.Action<int>(MethodAssignedToFromVariableQualified.MyMethod4);\n        }\n    }\n\n    partial class MethodAssignedToActionFromPartialClass\n    {\n        private static void MyMethod5(int arg) { } // Compliant, because of the below assignment\n\n        private static void MyNonCompliantMethod(int arg) { }\n    }\n\n    partial class MethodAssignedToActionFromPartialClass\n    {\n        public System.Action<int> MyReference = MethodAssignedToActionFromPartialClass.MyMethod5;\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/8988\n    public partial class PartialMethod_Issue_8988\n    {\n        partial void Partial(string one, string two);\n    }\n\n    public partial class PartialMethod_Issue_8988\n    {\n        partial void Partial(string one, string two) // Compliant, we don't want to raise on partial methods due to generated signatures\n        {\n            Console.Write(two);\n        }\n    }\n\n    public class Dead\n    {\n        private int Method1(int p) => (new Func<int>(() => { p = 10; return p; }))(); // Not reporting on this\n\n        private void Method2(int p)\n        {\n            var x = true;\n            if (x)\n            {\n                p = 10;\n                Console.WriteLine(p);\n            }\n\n            Console.WriteLine(p);\n        }\n\n        public void Method3_Public(int p) // Compliant\n        {\n            var x = true;\n            if (x)\n            {\n                p = 10;\n                Console.WriteLine(p);\n            }\n        }\n\n        private void Method3(int p) // Noncompliant {{Remove this parameter 'p', whose value is ignored in the method.}}\n        {\n            var x = true;\n            if (x)\n            {\n                p = 10;\n                Console.WriteLine(p);\n            }\n\n            Action<int> a = new Action<int>(Method4);\n        }\n\n        private void Method4(int p) // Noncompliant, although it is used above in the Action assignment\n        {\n            var x = true;\n            if (x)\n            {\n                p = 10;\n                Console.WriteLine(p);\n            }\n            else\n            {\n                p = 11;\n            }\n        }\n\n        private void Method5_Out(out int p)\n        {\n            var x = true;\n            if (x)\n            {\n                p = 10;\n                Console.WriteLine(p);\n            }\n            else\n            {\n                p = 11;\n            }\n        }\n\n        private int Method6_LocalFunctions(int usedInLocalFunction)   // Compliant\n        {\n            int LocalFunction(int seed) => usedInLocalFunction + seed;\n            int BadIncA(int seed) => usedInLocalFunction + 1;   // Noncompliant\n            int BadIncB(int seed)             // Noncompliant\n            {\n                seed = 1;\n                return usedInLocalFunction + seed;\n            }\n\n            return LocalFunction(42) + BadIncA(42) + BadIncB(42);\n        }\n    }\n\n    public class Intermediate : ISerializable // Error [CS0535]\n    { }\n\n    [Serializable]\n    public class ProperImplementedSerializableClass : Intermediate\n    {\n        private string value;\n\n        private ProperImplementedSerializableClass(SerializationInfo info, StreamingContext context) // Compliant, because using the streaming context is not required for properly implementing the serializable constructor.\n        {\n            value = info.GetString(\"Value\");\n        }\n    }\n\n    [Serializable]\n    public class NotProperImplementedSerializableClass : Intermediate\n    {\n        private StreamingContextStates state;\n\n        private NotProperImplementedSerializableClass(SerializationInfo info, StreamingContext context) // Noncompliant, because using the serialization info is required for properly implementing the serializable constructor.\n        {\n            state = context.State;\n        }\n    }\n\n    [Serializable]\n    public class NotProperImplementedSerializableClass2\n    {\n        private string value;\n\n        private NotProperImplementedSerializableClass2(SerializationInfo info, StreamingContext context) // Noncompliant\n        {\n            value = info.GetString(\"Value\");\n        }\n    }\n\n    public class EffectiveAccessibility\n    {\n        private class Inner\n        {\n            public void Method(int a,\n                int b) // Noncompliant\n            {\n                Console.WriteLine(a);\n            }\n        }\n    }\n\n    public class SwitchInTry\n    {\n        private int Method(int i)   // Compliant\n        {\n            try\n            {\n                switch (i)\n                {\n                    case 0:\n                        return 1;\n                    case 1:\n                        return 2;\n                    default:\n                        return 3;\n                }\n            }\n            catch\n            {\n                return 4;\n            }\n        }\n    }\n\n    class NullConditionalOperatorInTry\n    {\n        private void Method(string s)   // Compliant\n        {\n            try\n            {\n                s?.ToString();\n            }\n            catch\n            {\n            }\n        }\n    }\n\n    public class ReproGithubIssue2010\n    {\n        static int PatternMatch(StringSplitOptions splitOptions, int i)\n        {\n            switch (splitOptions)\n            {\n                case StringSplitOptions.None\n                    when i > 0:\n                    return 1;\n                default:\n                    return 0;\n            }\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/3132\n    public class Repro_3132\n    {\n        object TupleArgument((string adress, bool state)? e)\n        {\n            return new { Data = (e?.adress, e?.state) };\n        }\n\n        public object PublicTupleArgument((string adress, bool state)? e) // Compliant for public method\n        {\n            return new { Data = (e?.adress, e?.state) };\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/3134\n    public class Repro_3134\n    {\n        private static Predicate<DateTime> LocalFunctionReturned(DateTime dateTime)\n        {\n            bool Filter(DateTime time) => time.Year == dateTime.Year;\n            return Filter;\n        }\n\n        private void LocalFunctionReferencedArrow(bool condition)\n        {\n            Enumerable.Empty<object>().Where(IsTrue);\n\n            bool IsTrue(object x) => condition;\n        }\n\n        private void LocalFunctionReferencedBody(bool condition)\n        {\n            Enumerable.Empty<object>().Where(IsTrue);\n\n            bool IsTrue(object x)\n            {\n                return condition;\n            };\n        }\n\n        private void LocalFunctionCrossReferenced(bool condition)\n        {\n            Enumerable.Empty<object>().Where(IsTrueOuter);\n\n            bool IsTrueOuter(object x) => new[] { x }.Any(IsTrueMiddle);\n            bool IsTrueMiddle(object x) => IsTrueInner();\n            bool IsTrueInner() => condition;\n        }\n\n        private void LocalFunctionRecursive(int arg)\n        {\n            Enumerable.Empty<object>().Where(IsTrue);\n\n            bool IsTrue(object x)\n            {\n                arg--;\n                return arg <= 0 || new[] { x }.Any(IsTrue);\n            }\n        }\n\n        private void LocalFunctionUnused(bool condition)    // Noncompliant\n        {\n            bool Unused() => condition;\n        }\n\n        private void LocalFunctionUnusedWithNameOf(bool condition)    // Noncompliant\n        {\n            var name = nameof(Unused);\n\n            bool Unused() => condition;\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/4096\n    public class Repro_4096\n    {\n        private int TryCatchWithUsing(int errorCode)\n        {\n            try\n            {\n                using (var textWriter = new StreamWriter(\"TestOutput.txt\"))\n                {\n                    textWriter.Write(\"There is an errorcode\");\n\n                    return 0;\n                }\n            }\n            catch (Exception)\n            {\n                return errorCode;\n            }\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/4199\n    public class Repro_4199\n    {\n        private Task DoSomethingAsync(string text)\n        {\n            return Task.Run(async () => await UseAsync());\n\n            async Task UseAsync()\n            {\n                await Task.Delay(100);\n                Console.WriteLine(text);\n            }\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/5338\n    public class Repro_5338\n    {\n        private string[] largerArray;\n\n        // This case is very similar to our MethodParameterUnused.RoslynCfg.Fixed.cs, but it reproduces on .NET build as well.\n        // https://github.com/dotnet/roslyn/issues/56644\n        private bool HasAny(string[] smallerOrEqualArray)       // Compliant\n        {\n            return largerArray.Any(smallerOrEqualArray.Contains);\n        }\n\n        private static double GetDegreeOfOverlap(string[] largerArray, string[] smallerOrEqualArray)    // Compliant\n        {\n            return (double)largerArray.Count(smallerOrEqualArray.Contains) / largerArray.Length;\n        }\n    }\n\n    // https://github.com/dotnet/roslyn/issues/56644\n    public class RoslynIssue_56644\n    {\n        private char[] invalidCharacters;\n\n        private bool IsValidViewName(string viewName)   // Compliant, this was working as expected under .NET build, but didn't work under .NET Framework. We handle it by syntax now.\n        {\n            return !this.invalidCharacters.Any(viewName.Contains);\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/8371\n    public class Repro_8371\n    {\n        static Repro_8371()\n        {\n            AppDomain.CurrentDomain.AssemblyResolve += AssemblyResolver.LoadAnyVersion;\n        }\n\n        private static class AssemblyResolver\n        {\n            public static Assembly LoadAnyVersion(object sender, ResolveEventArgs args) // Was not detected by IsEventHandler because the non-void return type\n            {\n                ReferenceEquals(1, 2);\n                return null;\n            }\n        }\n    }\n\n    // https://sonarsource.atlassian.net/browse/NET-1090\n    public static class Repro_1090\n    {\n        private static bool InstanceMethod(IDictionary<int, bool> dict)\n        {\n            return Enumerable.Range(0, 1).Any(dict.Keys.Contains);\n        }\n\n        private static bool ExtensionMethod(IDictionary<int, bool> dict)\n        {\n            return Enumerable.Range(0, 1).Any(dict.ContainsExt);\n        }\n\n        private static bool ExtensionMethodWithMemberAccess(IDictionary<int, bool> dict) // Noncompliant FP (NET-1090)\n        {\n            return Enumerable.Range(0, 1).Any(dict.Keys.ContainsExt); // The member access dict.Key is not supported\n        }\n\n        private static bool ContainsExt(this ICollection<int> ints, int value) => ints.Contains(value);\n        private static bool ContainsExt(this IDictionary<int, bool> dict, int value) => dict.Keys.Contains(value);\n    }\n\n    // https://sonarsource.atlassian.net/browse/NET-1168\n    public class Repro_1168\n    {\n        private void Repro(string s1, string s2, int val)  // Compliant\n        {\n            LocalFunction();\n\n            void LocalFunction()\n            {\n                s1 = s1?.ToString();\n                Console.WriteLine(s2 ?? \"Nothing\");\n                var x = true ? val : 42;\n            }\n        }\n\n        private void Nested(string s)  // Compliant\n        {\n            Outer();\n\n            void Outer()\n            {\n                Inner();\n\n                void Inner()\n                {\n                    Console.WriteLine(s ?? \"default\");\n                }\n            }\n        }\n\n        private void NotInvoked(string s)  // Noncompliant - local function captures s but is never invoked\n        //                      ^^^^^^^^\n        {\n            void LocalFunction()\n            {\n                Console.WriteLine(s ?? \"default\");\n            }\n        }\n\n        private void WithMethodReference(string s)  // Compliant - s is used in local function passed as method reference\n        {\n            Action a = LocalFunction;\n            a();\n\n            void LocalFunction()\n            {\n                Console.WriteLine(s ?? \"default\");\n            }\n        }\n\n        private void WithAnonymousFunction(string s)  // Compliant - s is used in anonymous function\n        {\n            Action a = () => Console.WriteLine(s ?? \"default\");\n            a();\n        }\n\n        private void WithRecursiveLocalFunction(string s)  // Compliant\n        {\n            LocalFunction();\n\n            void LocalFunction()\n            {\n                if (s?.Length > 0)\n                    LocalFunction();\n            }\n        }\n\n        private void WithLambdaCallingLocalFunction(string s)  // Compliant - s is used in local function called from lambda\n        {\n            Action a = () => Console.WriteLine(LocalFunction());\n            a();\n\n            string LocalFunction() => s ?? \"default\";\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodParameterUnused.SonarCfg.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Runtime.Serialization;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Tests.TestCases\n{\n    internal interface MyPrivateInterface\n    {\n        void MyPrivateMethod(int a);\n    }\n\n    public class BasicTests : MyPrivateInterface\n    {\n        private BasicTests(int a) : this(a, 42) // Compliant\n        { }\n\n        private BasicTests(\n            int a,\n            int b) // Noncompliant\n//          ^^^^^\n        {\n            Console.WriteLine(a);\n\n            Action<string> x = WriteLine;\n            Action<string> y = WriteLine<int>;\n        }\n\n        private void BasicTest1(int a) { } // Compliant\n        void BasicTest2(int a) { } // Compliant\n        private void BasicTest3(int a) { } // Compliant\n        public void Caller()\n        {\n            BasicTest3(42); // Doesn't make it compliant\n        }\n\n        void MyPrivateInterface.MyPrivateMethod(int a) // Compliant\n        {\n        }\n\n        public int MyMethod(int a) => a; // Compliant\n\n        private static void WriteLine(string format) { } // Compliant\n        private static void WriteLine<T>(string format) { } // Compliant\n\n        void Foo(string a) // Compliant because only throws NotImplementedException\n        {\n            throw new NotImplementedException();\n        }\n\n        public void Foo(int arg1) // Compliant\n        {\n            // Empty on purpose\n        }\n\n        void DoSomething(int a, int b) => throw new NotImplementedException();\n    }\n\n    class MainEntryPoints1\n    {\n        static void Main(string[] args) // Compliant because Main is ignored + empty method\n        {\n        }\n    }\n\n    class MainEntryPoints2\n    {\n        static async Task Main(string[] args) // Compliant - new main syntax\n        {\n            Console.WriteLine(\"Test\");\n        }\n    }\n\n    class MainEntryPoints3\n    {\n        static async Task<int> Main(string[] args) // Compliant - new main syntax\n        {\n            Console.WriteLine(\"Test\");\n            return 1;\n        }\n    }\n\n    class MainEntryPoints4\n    {\n        static async Task<string> Main(string[] args) // Noncompliant\n        {\n            Console.WriteLine(\"Test\");\n            return \"\";\n        }\n    }\n\n    public class Program1\n    {\n        static void Main(string[] args) // Compliant because Main is ignored + only a throw NotImplemented\n        {\n            throw new NotImplementedException();\n        }\n    }\n\n    public class Program2\n    {\n        static void Main(string[] args) // Compliant because Main is ignored\n        {\n            Console.WriteLine(\"foo\");\n        }\n    }\n\n    public class Reassigned\n    {\n        private void DeadOnEntry(int arg)    // Noncompliant\n        {\n            arg = 42;\n            arg.ToString(); // Use\n        }\n\n        private void SelfAssigned(int arg)\n        {\n            arg = arg;\n            arg.ToString(); // Use\n        }\n\n        private void UpdatedFromSelf(int arg)\n        {\n            arg = arg + 1;\n            arg.ToString(); // Use\n        }\n\n        private void UpdatedFromSelf(string arg)\n        {\n            arg = arg.Replace(\"'\", \"''\");\n            arg.ToString(); // Use\n        }\n    }\n\n    public class FooBar\n    {\n        public FooBar(string a) // Compliant\n        {\n        }\n    }\n\n    public class AnyAttribute : Attribute { }\n\n    public static class Extensions\n    {\n        private static void MyMethod(this string s,\n            int i) // Compliant\n        {\n\n        }\n\n        [Any]\n        private static void MyMethod2(this string s,\n            int i) // Compliant because of the attribute\n        {\n\n        }\n\n        private static int Add(this string s, int a, int b) //Unused extension owner is ignored\n        {\n            return a + b;\n        }\n\n        private static int AddedLength(this string s, int a, int b) //Noncompliant\n        {\n            return s.Length + a;\n        }\n\n    }\n\n    abstract class BaseAbstract\n    {\n        public abstract void M3(int a); //okay\n    }\n    class Base\n    {\n        public virtual void M3(int a) //okay\n        {\n        }\n    }\n    interface IMy\n    {\n        void M4(int a);\n    }\n\n    class MethodParameterUnused : Base, IMy\n    {\n        private void M1(int a) // Compliant\n        {\n        }\n\n        void M1Bis(\n            int a,\n            int b, // Noncompliant\n            int c,\n            int d) // Noncompliant\n        {\n            var result = a + c;\n        }\n\n        private void M1okay(int a)\n        {\n            Console.Write(a);\n        }\n\n        public virtual void M2(int a)\n        {\n        }\n\n        public override void M3(int a) //okay\n        {\n        }\n\n        public void M4(int a) //okay\n        { }\n\n        private void MyEventHandlerMethod(object sender, EventArgs e) //okay, event handler\n        { }\n        private void MyEventHandlerMethod(object sender, MyEventArgs e) //okay, event handler\n        { }\n\n        class MyEventArgs : EventArgs { }\n    }\n\n    class MethodAsEvent\n    {\n        delegate void CustomDelegate(string arg1, int arg2);\n        event CustomDelegate SomeEventAdd;\n        event CustomDelegate SomeEventSub;\n\n        public MethodAsEvent()\n        {\n            SomeEventAdd += MyMethodAdd;\n            SomeEventSub -= MyMethodSub;\n        }\n\n        private void MyMethodAdd(string arg1, int arg2) // Compliant\n        {\n        }\n\n        private void MyMethodSub(string arg1, int arg2) // Compliant\n        {\n        }\n    }\n\n    class MethodAssignedToActionFromInitializer\n    {\n        private static void MyMethod1(int arg) { } // Compliant, because of the below assignment\n\n        public System.Action<int> MyReference = MyMethod1;\n    }\n\n    class MethodAssignedToActionFromInitializerQualified\n    {\n        private static void MyMethod2(int arg) { } // Compliant, because of the below assignment\n\n        public System.Action<int> MyReference = MethodAssignedToActionFromInitializerQualified.MyMethod2;\n    }\n\n    class MethodAssignedToFromVariable\n    {\n        private static void MyMethod3(int arg) { } // Compliant, because of the below assignment\n\n        public void Foo()\n        {\n            System.Action<int> MyReference;\n            MyReference = MyMethod3;\n        }\n    }\n\n    class MethodAssignedToFromVariableQualified\n    {\n        private static void MyMethod4(int arg) { } // Compliant, because of the below assignment\n\n        public void Foo()\n        {\n            System.Action<int> MyReference;\n            MyReference = new System.Action<int>(MethodAssignedToFromVariableQualified.MyMethod4);\n        }\n    }\n\n    partial class MethodAssignedToActionFromPartialClass\n    {\n        private static void MyMethod5(int arg) { } // Compliant, because of the below assignment\n\n        private static void MyNonCompliantMethod(int arg) { }\n    }\n\n    partial class MethodAssignedToActionFromPartialClass\n    {\n        public System.Action<int> MyReference = MethodAssignedToActionFromPartialClass.MyMethod5;\n    }\n\n    public class Dead\n    {\n        private int Method1(int p) => (new Func<int>(() => { p = 10; return p; }))(); // Not reporting on this\n\n        private void Method2(int p)\n        {\n            var x = true;\n            if (x)\n            {\n                p = 10;\n                Console.WriteLine(p);\n            }\n\n            Console.WriteLine(p);\n        }\n\n        public void Method3_Public(int p) // Compliant\n        {\n            var x = true;\n            if (x)\n            {\n                p = 10;\n                Console.WriteLine(p);\n            }\n        }\n\n        private void Method3(int p) // Noncompliant {{Remove this parameter 'p', whose value is ignored in the method.}}\n        {\n            var x = true;\n            if (x)\n            {\n                p = 10;\n                Console.WriteLine(p);\n            }\n\n            Action<int> a = new Action<int>(Method4);\n        }\n\n        private void Method4(int p) // Noncompliant, although it is used above in the Action assignment\n        {\n            var x = true;\n            if (x)\n            {\n                p = 10;\n                Console.WriteLine(p);\n            }\n            else\n            {\n                p = 11;\n            }\n        }\n\n        private void Method5_Out(out int p)\n        {\n            var x = true;\n            if (x)\n            {\n                p = 10;\n                Console.WriteLine(p);\n            }\n            else\n            {\n                p = 11;\n            }\n        }\n\n        private int Method6_LocalFunctions(int usedInLocalFunction)   // Compliant\n        {\n            int LocalFunction(int seed) => usedInLocalFunction + seed;\n            int BadIncA(int seed) => usedInLocalFunction + 1;   // Noncompliant\n            int BadIncB(int seed)             // Noncompliant\n            {\n                seed = 1;\n                return usedInLocalFunction + seed;\n            }\n\n            return LocalFunction(42) + BadIncA(42) + BadIncB(42);\n        }\n    }\n\n    public class Intermediate : ISerializable // Error [CS0535]\n    { }\n\n    [Serializable]\n    public class ProperImplementedSerializableClass : Intermediate\n    {\n        private string value;\n\n        private ProperImplementedSerializableClass(SerializationInfo info, StreamingContext context) // Compliant, because using the streaming context is not required for properly implementing the serializable constructor.\n        {\n            value = info.GetString(\"Value\");\n        }\n    }\n\n    [Serializable]\n    public class NotProperImplementedSerializableClass : Intermediate\n    {\n        private StreamingContextStates state;\n\n        private NotProperImplementedSerializableClass(SerializationInfo info, StreamingContext context) // Noncompliant, because using the serialization info is required for properly implementing the serializable constructor.\n        {\n            state = context.State;\n        }\n    }\n\n    [Serializable]\n    public class NotProperImplementedSerializableClass2\n    {\n        private string value;\n\n        private NotProperImplementedSerializableClass2(SerializationInfo info, StreamingContext context) // Noncompliant\n        {\n            value = info.GetString(\"Value\");\n        }\n    }\n\n    public class EffectiveAccessibility\n    {\n        private class Inner\n        {\n            public void Method(int a,\n                int b) // Noncompliant\n            {\n                Console.WriteLine(a);\n            }\n        }\n    }\n\n    public class ReproGithubIssue2010\n    {\n        static int PatternMatch(StringSplitOptions splitOptions, int i)\n        {\n            switch (splitOptions)\n            {\n                case StringSplitOptions.None\n                    when i > 0:\n                    return 1;\n                default:\n                    return 0;\n            }\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/3132\n    public class Repro_3132\n    {\n        object TupleArgument((string adress, bool state)? e)\n        {\n            return new { Data = (e?.adress, e?.state) };\n        }\n\n        public object PublicTupleArgument((string adress, bool state)? e) // Compliant for public method\n        {\n            return new { Data = (e?.adress, e?.state) };\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/3134\n    public class Repro_3134\n    {\n        private static Predicate<DateTime> LocalFunctionReturned(DateTime dateTime)\n        {\n            bool Filter(DateTime time) => time.Year == dateTime.Year;\n            return Filter;\n        }\n\n        private void LocalFunctionReferencedArrow(bool condition)\n        {\n            Enumerable.Empty<object>().Where(IsTrue);\n\n            bool IsTrue(object x) => condition;\n        }\n\n        private void LocalFunctionReferencedBody(bool condition)\n        {\n            Enumerable.Empty<object>().Where(IsTrue);\n\n            bool IsTrue(object x)\n            {\n                return condition;\n            };\n        }\n\n        private void LocalFunctionCrossReferenced(bool condition)\n        {\n            Enumerable.Empty<object>().Where(IsTrueOuter);\n\n            bool IsTrueOuter(object x) => new[] { x }.Any(IsTrueMiddle);\n            bool IsTrueMiddle(object x) => IsTrueInner();\n            bool IsTrueInner() => condition;\n        }\n\n        private void LocalFunctionRecursive(int arg)\n        {\n            Enumerable.Empty<object>().Where(IsTrue);\n\n            bool IsTrue(object x)\n            {\n                arg--;\n                return arg <= 0 || new[] { x }.Any(IsTrue);\n            }\n        }\n\n        private void LocalFunctionUnused(bool condition)    // Noncompliant\n        {\n            bool Unused() => condition;\n        }\n\n        private void LocalFunctionUnusedWithNameOf(bool condition)    // Noncompliant\n        {\n            var name = nameof(Unused);\n\n            bool Unused() => condition;\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/4096\n    public class Repro_4096\n    {\n        private int TryCatchWithUsing(int errorCode) // Noncompliant FP\n        {\n            try\n            {\n                using (var textWriter = new StreamWriter(\"TestOutput.txt\"))\n                {\n                    textWriter.Write(\"There is an errorcode\");\n\n                    return 0;\n                }\n            }\n            catch (Exception)\n            {\n                return errorCode;\n            }\n        }\n    }\n\n    public class Repro_4199\n    {\n        private Task DoSomethingAsync(string text) // Noncompliant FP, see https://github.com/SonarSource/sonar-dotnet/issues/4199\n        {\n            return Task.Run(async () => await UseAsync());\n\n            async Task UseAsync()\n            {\n                await Task.Delay(100);\n                Console.WriteLine(text);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodParameterUnused.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.Linq\nImports System.Text\n\nNamespace Tests.TestCases\n\n    Class InvalidCodeClass\n\n        Dim field As String\n\n        Private Sub DoSomething1NoParams()\n            Console.WriteLine(\"foo\")\n        End Sub\n\n        Private Sub DoSomething1(ByVal a As Integer) ' Noncompliant {{Remove this unused procedure parameter 'a'.}}\n            '                    ^^^^^^^^^^^^^^^^^^\n            Console.WriteLine(\"foo\")\n        End Sub\n\n        Private Function DoSomething2(ByVal a As Integer) As Integer ' Noncompliant\n            Return 1\n        End Function\n\n        Private Sub DoSomething3(ByRef a As Integer) ' Noncompliant\n            Console.WriteLine(\"foo\")\n        End Sub\n\n        Private Sub DoSomething4(field As String) ' Noncompliant - the parameter is not used\n            Me.field = \"\"\n        End Sub\n\n        Private Sub DoSomething5(intField As Integer) ' Noncompliant - the parameter is not used\n            Dim x = GetSomething()\n            Console.WriteLine(x?.intField)\n        End Sub\n\n        Private Function GetSomething() As InvalidCodeStructure?\n            Return Nothing\n        End Function\n\n        Private Sub OnlyThrows1(ByVal a As Integer) ' Noncompliant\n            Throw New InvalidOperationException()\n        End Sub\n\n        Private Function OnlyThrows2(ByVal a As Integer) As Integer ' Noncompliant\n            Throw New InvalidOperationException()\n        End Function\n\n        Public Sub Something(. As Integer) ' Error [BC30203] for coverage\n            Dim X As Integer = 42\n        End Sub\n\n    End Class\n\n    Structure InvalidCodeStructure\n\n        Dim intField As Integer\n\n        Private Sub DoSomething1(ByVal a As Integer) ' Noncompliant {{Remove this unused procedure parameter 'a'.}}\n            '                    ^^^^^^^^^^^^^^^^^^\n            Console.WriteLine(\"foo\")\n        End Sub\n\n        Private Function DoSomething2(ByVal a As Integer) As Integer ' Noncompliant\n            Return 1\n        End Function\n\n    End Structure\n\n    Module InvalidCodeModule\n\n        Private Sub DoSomething1(ByVal a As Integer) ' Noncompliant {{Remove this unused procedure parameter 'a'.}}\n            '                    ^^^^^^^^^^^^^^^^^^\n            Console.WriteLine(\"foo\")\n        End Sub\n\n        Private Function DoSomething2(ByVal a As Integer) As Integer ' Noncompliant\n            Return 1\n        End Function\n\n    End Module\n\n    Class ValidCodeClass\n\n        Private Sub DoSomething1(ByVal a As Integer)\n            Dim x = a\n        End Sub\n\n        Private Function DoSomething2(ByVal a As Integer) As Integer\n            Return a\n        End Function\n\n        Private Function Casing(DifferentCasing As Integer) As Integer\n            Return differentCASING\n        End Function\n\n        Sub DoSomething3(ByVal a As Integer) ' Default accessibility is public\n            Console.WriteLine(\"foo\")\n        End Sub\n\n        Function DoSomething4(ByVal a As Integer) As Integer ' Default accessibility is public\n            Return 1\n        End Function\n\n        Public Sub DoSomething5(ByVal a As Integer)\n            Console.WriteLine(\"foo\")\n        End Sub\n\n        Public Function DoSomething6(ByVal a As Integer) As Integer\n            Return 1\n        End Function\n\n        Protected Sub DoSomething7(ByVal a As Integer)\n            Console.WriteLine(\"foo\")\n        End Sub\n\n        Protected Function DoSomething8(ByVal a As Integer) As Integer\n            Return 1\n        End Function\n\n        Friend Sub DoSomething9(ByVal a As Integer)\n            Console.WriteLine(\"foo\")\n        End Sub\n\n        Friend Function DoSomething10(ByVal a As Integer) As Integer\n            Return 1\n        End Function\n\n        <Obsolete()>\n        Private Sub Attribute1(ByVal a As Integer) ' Compliant because of the attribute\n            Console.WriteLine(\"foo\")\n        End Sub\n\n        <Obsolete()>\n        Private Function Attribute2(ByVal a As Integer) As Integer ' Compliant because of the attribute\n            Return 1\n        End Function\n\n        Private Sub Empty1(ByVal a As Integer) ' Compliant because there is no statements\n        End Sub\n\n        Private Sub OnlyThrows1(ByVal a As Integer) ' Compliant because it only throws NotImplementedException\n            Throw New NotImplementedException()\n        End Sub\n\n        Private Function OnlyThrows2(ByVal a As Integer) As Integer ' Compliant because it only throws NotImplementedException\n            Throw New NotImplementedException()\n        End Function\n\n        Private Sub MyApplication_Startup(ByVal sender As Object, ByVal e As EventArgs) ' Compliant because it is event handler\n            Console.WriteLine()\n        End Sub\n\n        Private Class PrivateClass\n\n            Public Overridable Sub Overridable1(ByVal a As Integer) ' Compliant because it is Overridable\n                Console.WriteLine(\"foo\")\n            End Sub\n\n            Public Overridable Function Overridable2(ByVal a As Integer) As Integer ' Compliant because it is Overridable\n                Return 1\n            End Function\n\n        End Class\n\n    End Class\n\n    Structure ValidCodeStructure\n\n        Private Sub DoSomething1(ByVal a As Integer)\n            Dim x = a\n        End Sub\n\n        Private Function DoSomething2(ByVal a As Integer) As Integer\n            Return a\n        End Function\n\n    End Structure\n\n    Module ValidCodeModule\n\n        Private Sub DoSomething1(ByVal a As Integer)\n            Dim x = a\n        End Sub\n\n        Private Function DoSomething2(ByVal a As Integer) As Integer\n            Return a\n        End Function\n\n    End Module\n\n    Public MustInherit Class AbstractValidCode\n\n        MustOverride Sub MyAbstractMethod(ByVal a As Integer)\n\n    End Class\n\n    Public Interface IPerson\n\n        Function GetSomething(ByVal age As Integer) As Integer\n\n    End Interface\n\n    Public Class Person\n        Inherits AbstractValidCode\n        Implements IPerson\n\n        Public Function GetSomething(age As Integer) As Integer Implements IPerson.GetSomething ' Compliant because it's an interface implementation\n            Return 42\n        End Function\n\n        Public Overrides Sub MyAbstractMethod(a As Integer) ' Compliant because it overrides\n            Console.WriteLine()\n        End Sub\n\n        Private Function GetFoo(ByVal s As String) ' Noncompliant\n            Return \"\"\n        End Function\n\n    End Class\n\n    Module MainModule\n\n        Function Main(ByVal cmdArgs() As String) As Integer ' Compliant because this is the main method\n            Return 1\n        End Function\n\n    End Module\n\n    Module OtherMainModule\n\n        Sub Main(ByVal cmdArgs() As String) ' Compliant because this is the main method\n            Console.WriteLine()\n        End Sub\n\n    End Module\n\n    ' https//github.com/SonarSource/sonar-dotnet/issues/4406\n    Public Class Source\n\n        Public Event Dirty(Name As String, Count As Integer)\n\n    End Class\n\n    Public Class Consumer\n\n        Private WithEvents fSource As Source\n\n        Private Sub fSource_Dirty(Name As String, Count As Integer) Handles fSource.Dirty 'Compliant, because it's WithEvents event handler\n            Dim S As String = Name\n        End Sub\n\n    End Class\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodShouldBeNamedAccordingToSynchronicity.CSharp11.cs",
    "content": "﻿using System;\nusing System.Threading.Tasks;\nusing Microsoft.AspNet.SignalR;\n\nnamespace Tests.Diagnostics\n{\n    public interface IFoo\n    {\n        static abstract Task Do(); // Noncompliant\n    }\n\n    public class BaseClass : IFoo\n    {\n        public virtual Task<string> MyMethod() // Noncompliant\n        {\n            return Task.FromResult(\"foo\");\n        }\n\n        public static Task Do() // Compliant - comes from interface so not possible to change\n        {\n            return null;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodShouldBeNamedAccordingToSynchronicity.CSharp8.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Threading;\nusing System.Threading.Tasks;\n\nnamespace Tests.Diagnostics\n{\n    public abstract class IEnumerableReproducer\n    {\n        protected abstract IAsyncEnumerable<int> GetFilesAsync(string folderName); // Compliant (https://github.com/SonarSource/sonar-dotnet/issues/3433)\n\n        protected abstract IAsyncEnumerable<int> GetFiles(string folderName); // Noncompliant\n\n        protected abstract CustomAsyncEnumerable<int> GetFilesCustomAsyncEnumerableAsync(string folderName); // Compliant\n\n        protected abstract CustomAsyncEnumerable<int> GetFilesCustomAsyncEnumerable(string folderName); // Noncompliant\n\n        protected abstract CustomTask<int> GetFilesCustomTaskAsync(string folderName); // Compliant\n\n        protected abstract CustomTask<int> GetFilesCustomTask(string folderName); // Noncompliant\n\n        protected abstract void NoReturnType(string folderName);\n    }\n\n    public class CustomAsyncEnumerable<T> : IAsyncEnumerable<T>\n    {\n        public IAsyncEnumerator<T> GetAsyncEnumerator(CancellationToken cancel = new CancellationToken())\n            => throw new System.NotImplementedException();\n    }\n\n    public class CustomTask<T> : Task<T>\n    {\n        public CustomTask(Func<T> function) : base(function)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodShouldBeNamedAccordingToSynchronicity.MVC.Core.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Tests.Diagnostics\n{\n    public class MyController : Controller\n    {\n        public async Task<ActionResult> Users() { return null; } // Compliant\n\n        public async Task<object> Orders() { return null; } // Compliant\n\n        public async Task<int> GetNumber() { return 5; } // Compliant\n    }\n\n    public class OtherController : MyController\n    {\n        public async Task<ActionResult> Emails() { return null; } // Compliant\n\n        public async Task<object> Purchases() { return null; } // Compliant\n\n        public async Task<int> GetAnotherNumber() { return 5; } // Compliant\n    }\n\n    [Microsoft.AspNetCore.Mvc.Controller]\n    public class CustomController\n    {\n        public async Task<ActionResult> Users() { return null; } // Compliant\n\n        public async Task<object> Orders() { return null; } // Compliant\n\n        public async Task<int> GetNumber() { return 5; } // Compliant\n    }\n\n    [Microsoft.AspNetCore.Mvc.NonController]\n    public class CustomNonController : CustomController\n    {\n        public async Task<ActionResult> Emails() { return null; } // Noncompliant\n\n        public async Task<object> Purchases() { return null; } // Noncompliant\n\n        public async Task<int> GetAnotherNumber() { return 5; } // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodShouldBeNamedAccordingToSynchronicity.MVC.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing System.Web;\nusing System.Web.Mvc;\n\nnamespace Tests.Diagnostics\n{\n    public class MyController : Controller\n    {\n        public async Task<ActionResult> Users() { return null; } // Compliant\n\n        public async Task<object> Orders() { return null; } // Compliant\n\n        public async Task<int> GetNumber() { return 5; } // Compliant\n    }\n\n    public class OtherController : MyController\n    {\n        public async Task<ActionResult> Emails() { return null; } // Compliant\n\n        public async Task<object> Purchases() { return null; } // Compliant\n\n        public async Task<int> GetAnotherNumber() { return 5; } // Compliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodShouldBeNamedAccordingToSynchronicity.MsTest.cs",
    "content": "﻿using System;\nusing System.Threading.Tasks;\n\nnamespace Tests.Diagnostics\n{\n    public class TestAttributes\n    {\n        [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethod]\n        public async Task MSTest_TestMethod() { }\n\n        [Microsoft.VisualStudio.TestTools.UnitTesting.DataTestMethod]\n        public async Task MSTest_DataTestMethod() { }\n\n        [DerivedTestMethodAttribute]\n        public async Task MSTest_DerivedTestMethod() { }\n    }\n\n    public class DerivedTestMethodAttribute : Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute\n    {\n\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodShouldBeNamedAccordingToSynchronicity.NUnit.cs",
    "content": "﻿using System;\nusing System.Threading.Tasks;\n\nnamespace Tests.Diagnostics\n{\n    public class TestAttributes\n    {\n        [NUnit.Framework.Test]\n        public async Task NUnit_Test() { }\n\n        [NUnit.Framework.TestCase(1)]\n        public async Task NUnit_TestCase(int i) { }\n\n        [NUnit.Framework.TestCaseSource(\"foo\")]\n        public async Task NUnit_TestCaseSource() { }\n\n        [NUnit.Framework.Theory]\n        public async Task NUnit_Theory() { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodShouldBeNamedAccordingToSynchronicity.Xunit.cs",
    "content": "﻿using System;\nusing System.Threading.Tasks;\n\nnamespace Tests.Diagnostics\n{\n    public class TestAttributes\n    {\n        [Xunit.Fact]\n        public async Task Xunit_Fact() { }\n\n        [Xunit.Theory]\n        public async Task Xunit_Theory() { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodShouldBeNamedAccordingToSynchronicity.cs",
    "content": "﻿using System;\nusing System.Threading.Tasks;\nusing Microsoft.AspNet.SignalR;\n\nnamespace Tests.Diagnostics\n{\n    public class NonCompliantCases\n    {\n        public ValueTask<T> FooValueTaskT<T>() // Noncompliant\n        {\n            return default(ValueTask<T>);\n        }\n\n        public Task FooTask() // Noncompliant {{Add the 'Async' suffix to the name of this method.}}\n//                  ^^^^^^^\n        {\n            return Task.Delay(0);\n        }\n\n        public Task<int> FooTaskInt() // Noncompliant\n        {\n            return Task.FromResult(1);\n        }\n\n        public Task<T> FooTaskT<T>() // Noncompliant\n//                     ^^^^^^^^\n        {\n            return Task.FromResult(default(T));\n        }\n\n        public void BarVoidAsync() // Noncompliant {{Remove the 'Async' suffix to the name of this method.}}\n//                  ^^^^^^^^^^^^\n        {\n        }\n\n        public int BarIntAsync() // Noncompliant\n        {\n            return 1;\n        }\n\n        public object BarObjectAsync() // Noncompliant\n        {\n            return null;\n        }\n\n        public Task MyMethodAsync()\n        {\n            if (true)\n            {\n                return OtherSubMethod();\n            }\n\n            return SubMethod();\n\n            Task SubMethod() => Task.Delay(0); // Compliant - should not be but requires C# 7 syntax\n\n            Task OtherSubMethod()// Compliant - should not be but requires C# 7 syntax\n            {\n                return Task.Delay(0);\n            }\n        }\n    }\n\n    public interface IFoo\n    {\n        Task Do(); // Noncompliant\n    }\n\n    public class BaseClass : IFoo\n    {\n        public virtual Task<string> MyMethod()// Noncompliant\n        {\n            return Task.FromResult(\"foo\");\n        }\n\n        public Task Do() // Compliant - comes from interface so not possible to change\n        {\n            return null;\n        }\n    }\n\n    public class CompliantCases : BaseClass\n    {\n        public Task FooTaskAsync()\n        {\n            return Task.Delay(0);\n        }\n\n        public Task<int> FooTaskIntAsync()\n        {\n            return Task.FromResult(1);\n        }\n\n        public Task<T> FooTaskTAsync<T>()\n        {\n            return Task.FromResult(default(T));\n        }\n\n        public void BarVoid()\n        {\n        }\n\n        public int BarInt()\n        {\n            return 1;\n        }\n\n        public object BarObject()\n        {\n            return null;\n        }\n\n        public override Task<string> MyMethod()\n        {\n            return Task.FromResult(\"foo\");\n        }\n    }\n\n    public class Program1\n    {\n        public static async Task Main() { }\n    }\n\n    public class Program2\n    {\n        public static async Task<int> Main() { return 0; }\n    }\n\n    public class Program3\n    {\n        public static async Task Main(string[] args) { }\n    }\n\n    public class Program4\n    {\n        public static async Task<int> Main(string[] args) { return 0; }\n    }\n\n    public class TestAttributes\n    {\n        [System.ComponentModel.Browsable(true)]\n        public async Task OtherAttributes() { } // Noncompliant\n    }\n\n    public class MyHub : Hub\n    {\n        public MyHub()\n        {\n        }\n\n        public Task<string> MyMethod() // Compliant - Public methods from types derived from `Microsoft.AspNet.SignalR.Hub` are considered an exception.\n        {\n            return Task.FromResult(\"foo\");\n        }\n\n        private Task<string> PrivateMethod() // Noncompliant\n        {\n            return Task.FromResult(\"foo\");\n        }\n    }\n\n    public interface IChatClient\n    {\n        Task ReceiveMessage(string user, string message); // Noncompliant\n\n        Task ReceiveMessage(string message); // Noncompliant\n    }\n\n    public class StronglyTypedChatHub : Hub<IChatClient>\n    {\n        public async Task SendMessage(string user, string message)\n        {\n            await Clients.All.ReceiveMessage(user, message);\n        }\n\n        public Task SendMessageToCaller(string message)\n        {\n            return Clients.Caller.ReceiveMessage(message);\n        }\n\n        public Task ThrowException()\n        {\n            throw new HubException(\"This error will be sent to the client!\");\n        }\n    }\n\n    public unsafe class PointerReturnType\n    {\n        public int* MethodWithPointerReturnTypeAsync(int* input)  // Noncompliant\n        {\n            return input;\n        }\n    }\n\n    // See https://github.com/SonarSource/sonar-dotnet/issues/4799\n    public class AsyncCouldStay\n    {\n        public T GenericTaskTAsync<T>(T input) where T : Task\n        {\n            return input;\n        }\n\n        public T GenericTaskT2Async<T, V>(V input) where V : Task // Noncompliant\n        {\n            return default(T);\n        }\n    }\n\n    public class GenericWithoutConstraint\n    {\n        public T GenericTaskTAsync<T>(T input) // Noncompliant\n        {\n            return input;\n        }\n    }\n\n    public class GenericWithDifferentConstraint\n    {\n        public T GenericTaskTAsync<T>(T input) where T : new() // Noncompliant\n        {\n            return input;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodShouldNotOnlyReturnConstant.Latest.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    interface ISomeInterface {\n        public bool IsCondition() => true; // Compliant, see: https://github.com/SonarSource/sonar-dotnet/issues/5498\n    }\n    public interface IFoo\n    {\n        static abstract int GetValue();\n\n        static virtual int GetAnotherValue() { return 42; } // Compliant - interface methods are ignored\n    }\n\n    public class Foo : IFoo\n    {\n        public static int GetValue() // Compliant - implements interface so cannot get rid of the method\n        {\n            return 42;\n        }\n\n        public string Get() => \"hello\"; // Noncompliant\n\n        public string Get_Raw() => \"\"\"\n        \"Forty-two\", said Deep Thought, with infinite majesty and calm.\n        \"\"\";\n        // Noncompliant@-3\n\n        // ref: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/reference-types#utf-8-string-literals\n        public ReadOnlySpan<byte> Get_Utf_8() => \"hello\"u8; // Compliant, utf-8 strings are runtime constants (represented as ReadOnlySpan<byte>)\n    }\n}\n\npublic static class  Extensions\n{\n    extension (string s)\n    {\n        public string NewCompliant() => s + \"!\";\n        public string NewNonCompliant() => \"!\"; // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodShouldNotOnlyReturnConstant.cs",
    "content": "﻿public class Program\n{\n    public int GetInt() // Noncompliant {{Remove this method and declare a constant for this value.}}\n//             ^^^^^^\n    {\n        return 12;\n    }\n\n    public int GetMultiplication()\n    {\n        return 3 * 2;\n    }\n\n    public int GetAge(string name) // Compliant - method takes parameters\n    {\n        return 12;\n    }\n\n    private double GetDouble() // Noncompliant\n    {\n        return (((3.14)));\n    }\n\n    private int GetArrow() => 42; // Noncompliant\n\n    public string GetString() // Noncompliant\n    {\n        return \"foo\";\n    }\n\n    public bool GetIsEnabled()  // Noncompliant\n    {\n        return true;\n    }\n\n    public string GetNull()\n    {\n        return null;\n    }\n\n    public char GetChar() // Noncompliant\n    {\n        return 'a';\n    }\n\n    string GetWithNoModifier() // Noncompliant\n    {\n        return \"\";\n    }\n\n    public int GetWithInner()\n    {\n        return GetInner();\n\n        int GetInner() // Compliant - FN - should not be compliant\n        {\n            return 42;\n        }\n    }\n\n    private const int CONSTANT = 42;\n\n    public int ReturnsConstant()\n    {\n        return CONSTANT;  // Compliant, not a literal expression\n    }\n}\n\npublic interface IFoo\n{\n    int GetValue();\n}\n\npublic class Foo : IFoo\n{\n    public int GetValue() // Compliant - implements interface so cannot get rid of the method\n    {\n        return 42;\n    }\n}\n\npublic abstract class Base\n{\n    protected virtual string GetName() // Compliant - can be overriden\n    {\n        return \"\";\n    }\n\n    public abstract float GetPrecision();\n}\n\npublic class NotBase : Base\n{\n    protected override string GetName() // Compliant - override\n    {\n        return \"John\";\n    }\n\n    public override float GetPrecision() // Compliant - override\n    {\n        return 0.1F;\n    }\n}\n\npublic static class Extensions\n{\n    public static string ClassicCompliant(this string s) => s + \"!\";\n    public static string ClassicNonCompliant(this string s) => \"!\";  // FN https://sonarsource.atlassian.net/browse/NET-2733\n}\n\n// https://sonarsource.atlassian.net/browse/NET-3640\npublic class Repro_3640\n{\n    public int InConditionalCompilation()\n    {\n#if NET\n        return 42;  // Compliant\n#else\n        return 24;  // Compliant\n#endif\n    }\n\n    public int OutsideConditionalCompilation()\n    {\n#if SOMETHING\n        return 24;\n#endif\n        return 42;  // Compliant, ugly due to missing #else, but compliant\n    }\n\n    public int Arrow() =>\n#if NET\n        42;  // Compliant\n#else\n        24;  // Compliant\n#endif\n\n    public int TruePositive() =>    // Noncompliant\n        42;\n\n#if SOMETHING\n    public void ThisIsUnrelatedLeadingTrivia_BeforeArrow() { }\n#endif\n\n    public int ConditionalLeadingTrivia_Arrow() =>  // Noncompliant\n        42;\n\n#if SOMETHING\n    public void ThisIsUnrelatedLeadingTrivia_BeforeBody() { }\n#endif\n\n    public int ConditionalLeadingTrivia_Body()      // Noncompliant\n    {\n        return 42;\n    }\n\n#if SOMETHING\n    public void ThisIsUnrelatedTrailingTrivia_AfterBody() { }\n#endif\n\n}\n\npublic class InvalidCode\n{\n    public int MethodWithoutBody(); // Error [CS0501] 'InvalidCode.MethodWithoutBody()' must declare a body because it is not marked abstract, extern, or partial\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodsShouldNotHaveIdenticalImplementations.Latest.cs",
    "content": "﻿using System;\nusing System.Threading.Tasks;\nusing System.Collections.Generic;\n\npublic class StaticLocalFunctions\n{\n\n    public void Method()\n    {\n        static string LocalFunction(int x)\n        //            ^^^^^^^^^^^^^ Secondary\n        //            ^^^^^^^^^^^^^ Secondary@-1\n        {\n            x += 42;\n            return x.ToString();\n        }\n\n        static string LocalFunctionCopy(int x) // Noncompliant\n        {\n            x += 42;\n            return x.ToString();\n        }\n    }\n\n    public string MethodWhichCopiesLocalFunction(int x) // Noncompliant\n    {\n        x += 42;\n        return x.ToString();\n    }\n}\n\n// https://sonarsource.atlassian.net/browse/NET-348\nclass Repro_348\n{\n    T Method1<T>() // Secondary\n    {\n        var a = 1;\n        return default;\n    }\n\n    T Method2<T>() // Noncompliant\n    {\n        var a = 1;\n        return default;\n    }\n}\n\npublic record struct Sample\n{\n    public void Method1()\n    //          ^^^^^^^ Secondary\n    //          ^^^^^^^ Secondary@-1\n    {\n        string s = \"test\";\n        Console.WriteLine(\"Result: {0}\", s);\n    }\n\n    public void Method2() // Noncompliant\n    {\n        string s = \"test\";\n        Console.WriteLine(\"Result: {0}\", s);\n    }\n\n    public void Method3() // Noncompliant\n    {\n        string s = \"test\";\n        Console.WriteLine(\"Result: {0}\", s);\n    }\n\n    public void Method4()\n    {\n        Console.WriteLine(\"Result: 0\");\n    }\n\n    public string Method5()\n    {\n        return \"foo\";\n    }\n\n    public string Method6() =>\n        \"foo\";\n}\n\npublic record struct SamplePositional(string Value)\n{\n    public void Method1() // Secondary\n    {\n        string s = \"test\";\n        Console.WriteLine(\"Result: {0}\", s);\n    }\n\n    public void Method2() // Noncompliant\n    {\n        string s = \"test\";\n        Console.WriteLine(\"Result: {0}\", s);\n    }\n}\n\ninterface SomeInterface\n{\n    void Foo1() // Secondary\n    {\n        string s = \"test\";\n        Console.WriteLine(\"Result: {0}\", s);\n    }\n\n    void Foo2() // Noncompliant\n    {\n        string s = \"test\";\n        Console.WriteLine(\"Result: {0}\", s);\n    }\n}\n\npublic static class TypeConstraints\n{\n    public static int Use<T>(T? value) where T : struct => 1;\n\n    public static int Use<T>(T? value) where T : class => 2;\n\n    public static void First<T>(T? value) where T : struct\n    {\n        var x = Use(value);\n        Console.WriteLine(x);\n    }\n\n    public static void Second<T>(T? value) where T : class  // Compliant, method looks the same but different overloads are called due to the type constraints used.\n    {\n        var x = Use(value);\n        Console.WriteLine(x);\n    }\n\n    public static bool Compare1<T>(T? value1, T value2) // Secondary [Compare]\n    {\n        Console.WriteLine(value1);\n        Console.WriteLine(value2);\n        return true;\n    }\n\n    public static bool Compare2<T>(T? value1, T value2)  // Noncompliant [Compare]\n    {\n        Console.WriteLine(value1);\n        Console.WriteLine(value2);\n        return true;\n    }\n\n    public static bool Compare3<T>(T? value1, T value2) where T : System.IComparable // Compliant. Parameter type constraints don't match\n    {\n        Console.WriteLine(value1);\n        Console.WriteLine(value2);\n        return true;\n    }\n\n    public static bool Equal1<T>(T t1, T t2) where T : System.IEquatable<T>  // Secondary [Equal]\n    {\n        Console.WriteLine(t1);\n        Console.WriteLine(t2);\n        return true;\n    }\n\n    public static bool Equal2<T>(T t1, T t2) where T : System.IEquatable<T> // Noncompliant [Equal]\n    {\n        Console.WriteLine(t1);\n        Console.WriteLine(t2);\n        return true;\n    }\n\n    public static bool Equal3<T>(T t1, T t2) where T : System.IEquatable<int> // Compliant. The type constraint is different\n    {\n        Console.WriteLine(t1);\n        Console.WriteLine(t2);\n        return true;\n    }\n\n    public static bool Equal4<T>(T t1, T t2) where T : System.IComparable<T> // Compliant. The type constraint is different\n    {\n        Console.WriteLine(t1);\n        Console.WriteLine(t2);\n        return true;\n    }\n}\n\npublic class TypeConstraintsOnGenericClass<TClass>\n{\n    public void ConstraintByTClass1<TMethod>() where TMethod : TClass // Secondary [ConstraintByTClass]\n    {\n        Console.WriteLine(\"a\");\n        Console.WriteLine(\"b\");\n        Console.WriteLine(\"c\");\n    }\n\n    public void ConstraintByTClass2<TMethod>() where TMethod : TClass // Noncompliant [ConstraintByTClass]\n    {\n        Console.WriteLine(\"a\");\n        Console.WriteLine(\"b\");\n        Console.WriteLine(\"c\");\n    }\n\n    public void ConstraintByTClass3<TMethod>() // Compliant\n    {\n        Console.WriteLine(\"a\");\n        Console.WriteLine(\"b\");\n        Console.WriteLine(\"c\");\n    }\n\n    public void ConstraintByTClass4<TMethod>() where TMethod : IEquatable<TClass> // Compliant\n    {\n        Console.WriteLine(\"a\");\n        Console.WriteLine(\"b\");\n        Console.WriteLine(\"c\");\n    }\n\n    public void ConstraintByTClass5<TMethod>() where TMethod : struct, TClass // Compliant\n    {\n        Console.WriteLine(\"a\");\n        Console.WriteLine(\"b\");\n        Console.WriteLine(\"c\");\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/9654\npublic class Repro_9654\n{\n    public record Foo(string A);\n    public record Bar(string A);\n\n    private static Foo SameBodyDifferentReturnTypeImplicit1()\n    {\n        string s = \"A\";\n        return new(s);\n    }\n\n    private static Bar SameBodyDifferentReturnTypeImplicit2()       // Compliant - different return type\n    {\n        string s = \"A\";\n        return new(s);\n    }\n\n    private static Foo SameBodyDifferentReturnTypeExplicit1()\n    {\n        Console.WriteLine(\"Test\");\n        return new Foo(\"A\");\n    }\n\n    private static Bar SameBodyDifferentReturnTypeExplicit2()\n    {\n        Console.WriteLine(\"Test\");\n        return new Bar(\"A\");\n    }\n\n    private static int SameBodyDifferentReturnTypeLiteral1()\n    {\n        Console.WriteLine(\"Test\");\n        return 42;\n    }\n\n    private static double SameBodyDifferentReturnTypeLiteral2()     // Compliant - different return type\n    {\n        Console.WriteLine(\"Test\");\n        return 42;\n    }\n\n    private static string SameReturnTypeWithDifferentName1()        // Secondary [SameReturnTypeWithDifferentName]\n    {\n        Console.WriteLine(\"Test\");\n        return \"A\";\n    }\n\n    private static System.String SameReturnTypeWithDifferentName2() // Noncompliant [SameReturnTypeWithDifferentName]\n    {\n        Console.WriteLine(\"Test\");\n        return \"A\";\n    }\n\n    private static UnkownType1 SameImplementationWithUnknownReturnType1() // Error[CS0246]\n    {\n        Console.WriteLine(\"Test\");\n        return \"A\";\n    }\n\n    private static UnkownType2 SameImplementationWithUnknownReturnType2() // Error[CS0246]\n    {\n        Console.WriteLine(\"Test\");\n        return \"A\";\n    }\n}\n\nnamespace Tests.Diagnostics\n{\n    interface IInterface\n    {\n        static virtual void First()\n//                          ^^^^^ Secondary\n        {\n            string s = \"test\";\n            Console.WriteLine(\"Result: {0}\", s);\n        }\n\n        static virtual void Second() // Noncompliant {{Update this method so that its implementation is not identical to 'First'.}}\n//                          ^^^^^^\n        {\n            string s = \"test\";\n            Console.WriteLine(\"Result: {0}\", s);\n        }\n\n        static virtual void Different()\n        {\n            string s = \"this is a different method\";\n            Console.WriteLine(\"Result: {0}\", s);\n        }\n    }\n}\n\npublic class ExtensionTest\n{\n    public void MethodInBase()\n    {\n        Console.WriteLine(\"One\");\n        Console.WriteLine(\"Two\");\n    }\n}\n\npublic static class NewExtensions\n{\n    extension(ExtensionTest sample)\n    {\n        public void IdenticalToBaseMethod() // FN https://sonarsource.atlassian.net/browse/NET-2772\n        {\n            Console.WriteLine(\"One\");\n            Console.WriteLine(\"Two\");\n        }\n\n        public void MethodInExtension() // FN https://sonarsource.atlassian.net/browse/NET-2745\n        {\n            Console.WriteLine(\"One\");\n            Console.WriteLine(\"Two\");\n            Console.WriteLine(\"Three\");\n        }\n\n        public void MethodInExtension2() // FN https://sonarsource.atlassian.net/browse/NET-2745\n        {\n            Console.WriteLine(\"One\");\n            Console.WriteLine(\"Two\");\n            Console.WriteLine(\"Three\");\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodsShouldNotHaveIdenticalImplementations.TopLevelStatements.cs",
    "content": "﻿using System;\n\nvoid Method1()// Secondary [0]\n              // Secondary@-1 [1]\n{\n    string s = \"test\";\n    Console.WriteLine(\"Result: {0}\", s);\n}\n\nvoid Method2() // Noncompliant [0] {{Update this method so that its implementation is not identical to 'Method1'.}}\n{\n    string s = \"test\";\n    Console.WriteLine(\"Result: {0}\", s);\n}\n\nvoid Method3() // Noncompliant [1] {{Update this method so that its implementation is not identical to 'Method1'.}}\n{\n    string s = \"test\";\n    Console.WriteLine(\"Result: {0}\", s);\n}\n\nvoid Method4()\n{\n    Console.WriteLine(\"Result: 0\");\n}\n\npublic record Sample\n{\n    public void Method1() // Secondary [2]\n                          // Secondary@-1 [3]\n    {\n        string s = \"test\";\n        Console.WriteLine(\"Result: {0}\", s);\n    }\n\n    public void Method2() // Noncompliant [2] {{Update this method so that its implementation is not identical to 'Method1'.}}\n    {\n        string s = \"test\";\n        Console.WriteLine(\"Result: {0}\", s);\n    }\n\n    public void Method3() // Noncompliant [3] {{Update this method so that its implementation is not identical to 'Method1'.}}\n    {\n        string s = \"test\";\n        Console.WriteLine(\"Result: {0}\", s);\n    }\n\n    public void Method4()\n    {\n        Console.WriteLine(\"Result: 0\");\n    }\n\n    public string Method5()\n    {\n        return \"foo\";\n    }\n\n    public string Method6() =>\n        \"foo\";\n}\n\npublic record SamplePositional(string Value)\n{\n    public void Method1() // Secondary [4]\n    {\n        string s = \"test\";\n        Console.WriteLine(\"Result: {0}\", s);\n    }\n\n    public void Method2() // Noncompliant [4] {{Update this method so that its implementation is not identical to 'Method1'.}}\n    {\n        string s = \"test\";\n        Console.WriteLine(\"Result: {0}\", s);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodsShouldNotHaveIdenticalImplementations.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        void Foo1()\n//           ^^^^ Secondary {{Update this method so that its implementation is not identical to 'Foo2'.}}\n//           ^^^^ Secondary@-1 {{Update this method so that its implementation is not identical to 'Foo3'.}}\n//           ^^^^ Secondary@-2 {{Update this method so that its implementation is not identical to 'Foo4'.}}\n        {\n            string s = \"test\";\n            Console.WriteLine(\"Result: {0}\", s);\n        }\n\n        void Foo2() // Noncompliant {{Update this method so that its implementation is not identical to 'Foo1'.}}\n//           ^^^^\n        {\n            string s = \"test\";\n            Console.WriteLine(\"Result: {0}\", s);\n        }\n\n        void Foo3() // Noncompliant {{Update this method so that its implementation is not identical to 'Foo1'.}}\n        {\n            string s = \"test\";\n            Console.WriteLine(\"Result: {0}\", s);\n        }\n\n        void Foo4() // Noncompliant {{Update this method so that its implementation is not identical to 'Foo1'.}}\n        {\n            string s = \"test\"; // Comment are excluded from comparison\n            Console.WriteLine(\"Result: {0}\", s);\n        }\n\n        void Foo5()\n        {\n            string s = \"test\";\n            Console.WriteLine(\"Result: {0}\", s);\n            Console.WriteLine(\"different\");\n        }\n\n        void Foo1(string arg1)\n        {\n            string s = arg1;\n            Console.WriteLine(\"Result: {0}\", s);\n        }\n\n\n        int DiffBySignature1(int arg1)\n        {\n            Console.WriteLine(arg1);\n            return arg1;\n        }\n\n        string DiffBySignature2(string arg1)\n        {\n            Console.WriteLine(arg1);\n            return arg1;\n        }\n\n\n        void Bar1()\n        {\n            throw new NotImplementedException();\n        }\n\n        void Bar2()\n        {\n            throw new NotImplementedException();\n        }\n\n\n\n        void FooBar1()\n        {\n            throw new NotSupportedException();\n        }\n\n        void FooBar2()\n        {\n            throw new NotSupportedException();\n        }\n\n\n\n        int Baz1(int a) => a;\n\n        int Baz2(int a) => a; // Compliant we ignore expression body\n\n\n\n        string Qux1(int val)\n        {\n            return val.ToString();\n        }\n\n        string Qux2(int val)\n        {\n            return val.ToString(); // Compliant because we ignore one liner\n        }\n\n        string Qux3(int val) => val.ToString(); // Compliant we ignore expression body\n\n        public class Foo\n        {\n            public void Test(string str)\n            {\n                Console.WriteLine(str);\n            }\n        }\n\n        public class Bar\n        {\n            public void Test(string str)\n            {\n                throw new Exception(str);\n            }\n        }\n\n        public static void TestFoo1(Foo x)\n        {\n            x.Test(\"hello\");\n            x.Test(\"world\");\n        }\n\n        public static void TestFoo2(Foo x, string s)\n        {\n            x.Test(\"hello\");\n            x.Test(\"world\");\n        }\n\n        public static void TestFoo3(string s, Foo x)\n        {\n            x.Test(\"hello\");\n            x.Test(\"world\");\n        }\n\n        public static void TestBar1(Bar x)\n        {\n            x.Test(\"hello\");\n            x.Test(\"world\");\n        }\n\n        static string M(int x)\n        {\n            x += 1;\n            return x.ToString();\n        }\n\n        static System.String Qualified1() // Secondary\n        {\n            var x = 1;\n            return \"\";\n        }\n\n        static string Qualified2() // Noncompliant\n        {\n            var x = 1;\n            return \"\";\n        }\n    }\n\n    struct SomeStruct\n    {\n        void Foo1() // Secondary\n        {\n            string s = \"test\";\n            Console.WriteLine(\"Result: {0}\", s);\n        }\n\n        void Foo2() // Noncompliant\n        {\n            string s = \"test\";\n            Console.WriteLine(\"Result: {0}\", s);\n        }\n    }\n\n    public abstract class InheritedConstraints\n    {\n        public class Item { public void Action() { } }\n        public class Mobile { public void Action() { } }\n\n        public abstract void WriteItem<T>(T item) where T : Item;\n        public abstract void WriteItem2<T>(T item) where T : Item;\n        public abstract void WriteMobile<T>(T item) where T : Mobile;\n\n        public class Derived : InheritedConstraints\n        {\n            public override void WriteItem<T>(T item) // Secondary\n            {\n                item.Action();\n                Console.WriteLine(\"One\");\n                Console.WriteLine(\"Two\");\n            }\n\n            public override void WriteItem2<T>(T item) // Noncompliant. The WriteItem methods have the same inherited constraints.\n            {\n                item.Action();\n                Console.WriteLine(\"One\");\n                Console.WriteLine(\"Two\");\n            }\n\n            public override void WriteMobile<T>(T item) // Compliant. The WriteMobile method has a different inherited constraint.\n            {\n                item.Action();\n                Console.WriteLine(\"One\");\n                Console.WriteLine(\"Two\");\n            }\n        }\n    }\n}\n\npublic class Sample\n{\n    public void MethodInBase()\n    {\n        Console.WriteLine(\"One\");\n        Console.WriteLine(\"Two\");\n    }\n}\n\npublic static class ClassicExtensions\n{\n    public static void IdenticalToBaseMethod(this Sample sample) // FN https://sonarsource.atlassian.net/browse/NET-2772\n    {\n        Console.WriteLine(\"One\");\n        Console.WriteLine(\"Two\");\n    }\n\n    public static void MethodInExtension(this Sample sample) // Secondary\n    {\n        Console.WriteLine(\"One\");\n        Console.WriteLine(\"Two\");\n        Console.WriteLine(\"Three\");\n    }\n\n    public static void MethodInExtension2(this Sample sample) // Noncompliant\n    {\n        Console.WriteLine(\"One\");\n        Console.WriteLine(\"Two\");\n        Console.WriteLine(\"Three\");\n    }\n}\n\npublic class GenericReturnType\n{\n    T Generic<T>() where T : class // Secondary\n    {\n        var a = 1;\n        return default(T);\n    }\n\n    T Generic2<T>() where T : class // Noncompliant\n    {\n        var a = 1;\n        return default(T);\n    }\n\n    T Generic4<T>() where T : GenericReturnType // Compliant, Parameter type constraints don't match\n    {\n        var a = 1;\n        return default(T);\n    }\n\n    T Generic5<T>() where T : struct // Compliant, Parameter type constraints don't match\n    {\n        var a = 1;\n        return default(T);\n    }\n\n    List<T> List<T>() where T : class // Secondary\n    {\n        var a = 1;\n        return null;\n    }\n\n    List<T> List2<T>() where T : class // Noncompliant\n    {\n        var a = 1;\n        return null;\n    }\n\n    Task<int> Task() // Secondary\n    {\n        var a = 1;\n        return null;\n    }\n\n    Task<int> Task2() // Noncompliant\n    {\n        var a = 1;\n        return null;\n    }\n\n    Task<T[]> Task2<T>() // Secondary\n    {\n        var a = 1;\n        return null;\n    }\n\n    Task<T[]> Task3<T>() // Noncompliant\n    {\n        var a = 1;\n        return null;\n    }\n\n    (T, V) Tuple1<T, V>() // Secondary\n    {\n        var a = 1;\n        return default((T, V));\n    }\n\n    (T, V) Tuple2<T, V>() // Noncompliant\n    {\n        var a = 1;\n        return default((T, V));\n    }\n\n    T[] Array<T>() // Secondary\n    {\n        var a = 1;\n        return null;\n    }\n\n    T[] Array2<T>() // Noncompliant\n    {\n        var a = 1;\n        return null;\n    }\n\n    IList<IList<T>> Nested<T>() // Secondary\n    {\n        var a = 1;\n        return null;\n    }\n\n    IList<IList<T>> Nested2<T>() // Noncompliant\n    {\n        var a = 1;\n        return null;\n    }\n\n    IList<IList<T[]>> Nested3<T>() // Secondary\n    {\n        var a = 1;\n        return null;\n    }\n\n    IList<IList<T[]>> Nested4<T>() // Noncompliant\n    {\n        var a = 1;\n        return null;\n    }\n\n    IList<T[]> Nested5<T>() // Secondary\n    {\n        var a = 1;\n        return null;\n    }\n\n    IList<T[]> Nested6<T>() // Noncompliant\n    {\n        var a = 1;\n        return null;\n    }\n\n    Dictionary<TKey, TValue> Dict1<TKey, TValue>() // Secondary\n    {\n        var a = 1;\n        return null;\n    }\n\n    Dictionary<TKey, TValue> Dict2<TKey, TValue>() // Noncompliant\n    {\n        var a = 1;\n        return null;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodsShouldNotHaveIdenticalImplementations.vb",
    "content": "﻿Imports System\n\nNamespace Tests.Diagnostics\n    Class Program\n\n        Sub SubFirstNoParentheses\n            Dim s As String = \"test\"\n            Dim k As String = \"test\"\n            Console.WriteLine(\"Result: {0}\", s)\n        End Sub\n\n        Sub Foo1()\n'           ^^^^ Secondary {{Update this method so that its implementation is not identical to 'Foo2'.}}\n'           ^^^^ Secondary@-1 {{Update this method so that its implementation is not identical to 'Foo3'.}}\n'           ^^^^ Secondary@-2 {{Update this method so that its implementation is not identical to 'Foo4'.}}\n\n            Dim s As String = \"test\"\n            Console.WriteLine(\"Result: {0}\", s)\n        End Sub\n\n        Sub Foo2() ' Noncompliant {{Update this method so that its implementation is not identical to 'Foo1'.}}\n'           ^^^^\n            Dim s As String = \"test\"\n            Console.WriteLine(\"Result: {0}\", s)\n        End Sub\n\n        Sub Foo3() ' Noncompliant {{Update this method so that its implementation is not identical to 'Foo1'.}}\n            Dim s As String = \"test\"\n            Console.WriteLine(\"Result: {0}\", s)\n        End Sub\n\n        Sub Foo4() ' Noncompliant {{Update this method so that its implementation is not identical to 'Foo1'.}}\n            Dim s As String = \"test\" ' Comment are excluded from comparison\n            Console.WriteLine(\"Result: {0}\", s)\n        End Sub\n\n        Sub Foo5()\n            Dim s As String = \"test\"\n            Console.WriteLine(\"Result: {0}\", s)\n            Console.WriteLine(\"different\")\n        End Sub\n\n        Function Func1() As String\n'                ^^^^^ Secondary\n\n            Dim s As String = \"test\"\n            Console.WriteLine(\"Result: {0}\", s)\n            Return s\n        End Function\n\n        Function Func2() As String ' Noncompliant {{Update this method so that its implementation is not identical to 'Func1'.}}\n'                ^^^^^\n            Dim s As String = \"test\"\n            Console.WriteLine(\"Result: {0}\", s)\n            Return s\n        End Function\n\n\n        Function DiffBySignature1(arg1 As Integer) As Integer\n            Console.WriteLine(arg1)\n            Return arg1\n        End Function\n\n        Function DiffBySignature2(arg1 As String) As String\n            Console.WriteLine(arg1)\n            Return arg1\n        End Function\n\n        Sub Foo1(arg1 As String)\n            Dim s As String = arg1\n            Console.WriteLine(\"Result: {0}\", s)\n        End Sub\n\n        Sub Bar1()\n            Throw New NotImplementedException()\n        End Sub\n\n        Sub Bar2()\n            Throw New NotImplementedException()\n        End Sub\n\n        Sub FooBar1()\n            Throw New NotSupportedException()\n        End Sub\n\n        Sub FooBar2()\n            Throw New NotSupportedException()\n        End Sub\n\n        Function Qux1(val As Integer) As String\n            Return val.ToString()\n        End Function\n\n        Function Qux2(val As Integer) As String\n            Return val.ToString() ' Compliant because we ignore one liner\n        End Function\n\n        Sub SubSecondNoParentheses\n            Dim s As String = \"test\"\n            Console.WriteLine(\"Result: {0}\", s)\n        End Sub\n\n        Function FunctionNoParentheses As String\n            Dim s As String = \"test\"\n            Return s\n        End Function\n\n    End Class\n\n    Structure SomeStruct\n        Private Sub Foo1()\n            '       ^^^^ Secondary\n            Dim s As String = \"test\"\n            Console.WriteLine(\"Result: {0}\", s)\n        End Sub\n\n        Private Sub Foo2() ' Noncompliant\n            Dim s As String = \"test\"\n            Console.WriteLine(\"Result: {0}\", s)\n        End Sub\n    End Structure\n\n    ' https://github.com/SonarSource/sonar-dotnet/issues/9654\n    Public Class Repro_9654\n        Private Shared Function SameBodyDifferentReturnTypeLiteral1() As Integer\n            Console.WriteLine(\"Test\")\n            Return 42\n        End Function\n\n        Private Shared Function SameBodyDifferentReturnTypeLiteral2() As Double     ' Compliant - different return type\n            Console.WriteLine(\"Test\")\n            Return 42\n        End Function\n\n        Private Shared Function SameReturnTypeWithDifferentName1() As String        ' Secondary [SameReturnTypeWithDifferentName]\n            Console.WriteLine(\"Test\")\n            Return \"A\"\n        End Function\n\n        Private Shared Function SameReturnTypeWithDifferentName2() As String        ' Noncompliant [SameReturnTypeWithDifferentName]\n            Console.WriteLine(\"Test\")\n            Return \"A\"\n        End Function\n\n        Private Shared Function SameImplementationWithUnknownReturnType1() As UnkownType1  ' Error[BC30002]\n            Console.WriteLine(\"Test\")\n            Return \"A\"\n        End Function\n\n        Private Shared Function SameImplementationWithUnknownReturnType2() As UnkownType2  ' Error[BC30002]\n            Console.WriteLine(\"Test\")\n            Return \"A\"\n        End Function\n\n        Private Shared Sub SubProcedure()\n            Console.WriteLine(\"Test1\")\n            Console.WriteLine(\"Test2\")\n        End Sub\n\n        Private Shared Function Func() As String    ' Compliant - Func() and SubProcedure() has different return types\n            Console.WriteLine(\"Test1\")\n            Console.WriteLine(\"Test2\")\n            Return \"A\"\n        End Function\n    End Class\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodsShouldNotHaveTooManyLines.LocalFunctions.CSharp9.cs",
    "content": "﻿using System;\nusing System.Runtime.InteropServices;\n\nclass WithExternLocalFunctions\n{\n    void ShortWithSingleExtern() // Compliant, we do not count extern local functions\n    {\n        int i = 0;\n        i++;\n        i++;\n        i++;\n        i++;\n\n        [DllImport(\"libc\")]\n        static extern int chmod(string pathname, int mode); // Compliant, we do not count lines of an externally defined function\n    }\n\n    void ShortWithMultipleExtern() // Compliant, we do not count extern local functions\n    {\n        int i = 0;\n        i++;\n        i++;\n\n        [DllImport(\"libc\")] static extern int chmod1(string pathname, int mode); // Compliant\n        [DllImport(\"libc\")] static extern int chmod2(string pathname, int mode); // Compliant\n        [DllImport(\"libc\")] static extern int chmod3(string pathname, int mode); // Compliant\n    }\n\n    void Long() // Noncompliant {{This method 'Long' has 6 lines, which is greater than the 5 lines authorized. Split it into smaller methods.}}\n    {\n        int i = 0;\n        i++;\n        i++;\n        i++;\n        i++;\n        i++;\n\n        [DllImport(\"libc\")]\n        static extern int chmod(string pathname, int mode); // Compliant, we do not count lines of an externally defined function\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodsShouldNotHaveTooManyLines.LocalFunctions.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class Foo\n    {\n        public void Bar(int i) // Compliant, because we do not count the local static functions lines.\n        {\n            Console.WriteLine(i);\n\n            void LocalFunction(int x)\n            {\n                Console.WriteLine(x);\n            }\n\n            static void StaticLocalFunction()\n            {\n                int i = 0;\n                i++;\n                i++;\n                i++;\n            }\n\n            static void StaticLocalFunctionWithManyLines() // Noncompliant {{This static local function has 8 lines, which is greater than the 5 lines authorized.}}\n            {\n                int i = 0;\n                i++;\n                i++;\n                i++;\n                i++;\n                i++;\n                i++;\n                i++;\n            }\n        }\n\n        public void FooBar(int i) // Noncompliant {{This method 'FooBar' has 12 lines, which is greater than the 5 lines authorized. Split it into smaller methods.}}\n        {\n            Console.WriteLine(i);\n\n            void LocalFunctionWithManyLines()\n            {\n                int i = 0;\n                i++;\n                i++;\n                i++;\n                i++;\n                i++;\n                i++;\n                i++;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodsShouldNotHaveTooManyLines_CustomValues.CSharp10.cs",
    "content": "﻿using System;\n\npublic class A\n{\n    public A(int i, int j) // Noncompliant\n    {\n        Console.WriteLine(i);\n        Console.WriteLine(j);\n        Console.WriteLine(j);\n    }\n}\n\npublic record class B\n{\n    public B(int i, int j) // Noncompliant\n    {\n        Console.WriteLine(i);\n        Console.WriteLine(j);\n        Console.WriteLine(j);\n    }\n}\n\npublic struct C\n{\n    public C(int i, int j) // Noncompliant\n    {\n        Console.WriteLine(i);\n        Console.WriteLine(j);\n        Console.WriteLine(j);\n    }\n}\n\npublic record struct D\n{\n    public D(int i, int j) // Noncompliant\n    {\n        Console.WriteLine(i);\n        Console.WriteLine(j);\n        Console.WriteLine(j);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodsShouldNotHaveTooManyLines_CustomValues.CSharp9.cs",
    "content": "﻿int i = 1; i++;\ni++;\ni++;\ni++;\n\nvoid LocalFunction() // Noncompliant {{This local function has 4 lines, which is greater than the 2 lines authorized.}}\n{\n    i++;\n    i++;\n    i++;\n    i++;\n}\n\nstatic void StaticLocalFunction() // Noncompliant {{This static local function has 4 lines, which is greater than the 2 lines authorized.}}\n{\n    int k = 1;\n    k++;\n    k++;\n    k++;\n}\n\nvoid Compliant()\n{\n    i++;\n    i++;\n}\n\nvoid ABitLonger() // Noncompliant {{This local function has 3 lines, which is greater than the 2 lines authorized.}}\n{\n    i++;\n    i++;\n    i++;\n}\n\nint Lambda(int a, int b, int c) => // Noncompliant {{This local function has 3 lines, which is greater than the 2 lines authorized.}}\n    a\n    + b\n    + c;\n\nrecord Sample\n{\n    public Sample() // Noncompliant {{This constructor 'Sample' has 4 lines, which is greater than the 2 lines authorized. Split it into smaller methods.}}\n    {\n        int i = 1; i++;\n        i++;\n        i++;\n        i++;\n    }\n\n    ~Sample() // Noncompliant {{This finalizer '~Sample' has 4 lines, which is greater than the 2 lines authorized. Split it into smaller methods.}}\n    {\n        int i = 1; i++;\n        i++;\n        i++;\n        i++;\n    }\n\n    public void Method_01() // Noncompliant {{This method 'Method_01' has 3 lines, which is greater than the 2 lines authorized. Split it into smaller methods.}}\n    {\n        int i = 1; i++;\n        i++;\n        i++;\n    }\n\n    public int Method_02()\n    {\n        int i = 1;\n        return 1;\n    }\n\n    public void WithLocalFunction() // Noncompliant\n    {\n        LocalFunction();\n        void LocalFunction()\n        {\n            var i = 1; i++;\n            i++;\n            i++;\n            i++;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodsShouldNotHaveTooManyLines_CustomValues.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    abstract class Program\n    {\n        public Program() // Noncompliant {{This constructor 'Program' has 4 lines, which is greater than the 2 lines authorized. Split it into smaller methods.}}\n//             ^^^^^^^\n        {\n            int i = 1; i++;\n            i++;\n            i++;\n            i++;\n        }\n\n        ~Program() // Noncompliant {{This finalizer '~Program' has 4 lines, which is greater than the 2 lines authorized. Split it into smaller methods.}}\n        {\n            int i = 1; i++;\n            i++;\n            i++;\n            i++;\n        }\n\n\n        public void Method_01() // Noncompliant {{This method 'Method_01' has 4 lines, which is greater than the 2 lines authorized. Split it into smaller methods.}}\n//                  ^^^^^^^^^\n        {\n            for (int i = 1; i < 10; i++)\n            {\n                i++;\n            }\n        }\n\n        public int Method_02() // Noncompliant {{This method 'Method_02' has 13 lines, which is greater than the 2 lines authorized. Split it into smaller methods.}}\n        {\n            int i = 1;\n            i++;\n            i++;\n            i++;\n            i++;\n            i++;\n            i++;\n            i++;\n            i++;\n            i++;\n            i++;\n            i++;\n\n            return 1;\n        }\n\n        public abstract int Method_04();\n\n        extern int Method_05();\n\n        public int Method_06() // Noncompliant {{This method 'Method_06' has 7 lines, which is greater than the 2 lines authorized. Split it into smaller methods.}}\n        {\n            // We only report on outer methods.\n            // The lines of code of inner functions are counted against the method.\n            void InnerFunction_06()\n            {\n                int i = 0;\n                i++;\n                i++;\n            }\n\n            return 1;\n        }\n\n        public string Method_07() // Noncompliant {{This method 'Method_07' has 4 lines, which is greater than the 2 lines authorized. Split it into smaller methods.}}\n            =>\n            1\n            .ToString()\n            .ToString()\n            .ToString();\n\n        public string Method_08()\n            =>\n            1\n            .ToString();\n\n        public string Method_09()\n        {\n            /*\n             * comments are not counted, y'know?\n             *\n             */\n\n            //\n            // Neither are these\n            //\n\n            return null;\n        }\n\n        public string Method_10() // Noncompliant {{This method 'Method_10' has 3 lines, which is greater than the 2 lines authorized. Split it into smaller methods.}}\n        { int i = 0;\n            i++;\n            return null; }\n\n        public string Method_11() // Noncompliant {{This method 'Method_11' has 5 lines, which is greater than the 2 lines authorized. Split it into smaller methods.}}\n        {\n            return @\"\n\n\n\n            \";\n        }\n\n        // Compliant. Properties are not covered by this rule\n        public int Property_01\n        {\n            get\n            {\n                int i = 0;\n                i++;\n\n                return 1;\n            }\n\n            set\n            {\n                int i = 0;\n                i++;\n                i++;\n            }\n        }\n\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodsShouldNotHaveTooManyLines_CustomValues.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.Linq\nImports System.Text\n\nNamespace Tests.TestCases\n    Class InvalidCases\n        Public Sub Test() ' Noncompliant {{This method 'Test' has 6 lines, which is greater than the 2 lines authorized. Split it into smaller procedures.}}\n'                  ^^^^\n            Dim i As Integer\n\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n\t\tEnd Sub\n\n        Public Function MyFunc() As Integer ' Noncompliant {{This function 'MyFunc' has 7 lines, which is greater than the 2 lines authorized. Split it into smaller procedures.}}\n'                       ^^^^^^\n            Dim i As Integer\n\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n\n            Return 0\n        End Function\n\n        Sub New() ' Noncompliant {{This constructor has 6 lines, which is greater than the 2 lines authorized. Split it into smaller procedures.}}\n'           ^^^\n            Dim i As Integer\n\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n        End Sub\n\n         Protected Overrides Sub Finalize() ' Noncompliant {{This finalizer has 6 lines, which is greater than the 2 lines authorized. Split it into smaller procedures.}}\n'                                ^^^^^^^^\n            Dim i As Integer\n\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n         End Sub\n    End Class\n\n    Class ValidCases\n        Public Sub Foo()\n\n        End Sub\n\n        Public Sub Bar()\n            Dim i = 0\n            i += 1\n        End Sub\n\n        Public Sub ' Error [BC30203]\n            Dim i As Integer\n\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n        End Sub\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodsShouldNotHaveTooManyLines_DefaultValues.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        public void Foo()\n        {\n        }\n\n        public void Bar() // Noncompliant {{This method 'Bar' has 81 lines, which is greater than the 80 lines authorized. Split it into smaller methods.}}\n//                  ^^^\n        {\n            int i = 0;\n\n            i++;\n            i++;\n            i++;\n            i++;\n            i++;\n\n            i++;\n            i++;\n            i++;\n            i++;\n            i++;\n\n            i++;\n            i++;\n            i++;\n            i++;\n            i++;\n\n            i++;\n            i++;\n            i++;\n            i++;\n            i++;\n\n            i++;\n            i++;\n            i++;\n            i++;\n            i++;\n\n            i++;\n            i++;\n            i++;\n            i++;\n            i++;\n\n            i++;\n            i++;\n            i++;\n            i++;\n            i++;\n\n            i++;\n            i++;\n            i++;\n            i++;\n            i++;\n\n            i++;\n            i++;\n            i++;\n            i++;\n            i++;\n\n            i++;\n            i++;\n            i++;\n            i++;\n            i++;\n\n            i++;\n            i++;\n            i++;\n            i++;\n            i++;\n\n            i++;\n            i++;\n            i++;\n            i++;\n            i++;\n\n            i++;\n            i++;\n            i++;\n            i++;\n            i++;\n\n            i++;\n            i++;\n            i++;\n            i++;\n            i++;\n\n            i++;\n            i++;\n            i++;\n            i++;\n            i++;\n\n            i++;\n            i++;\n            i++;\n            i++;\n            i++;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodsShouldNotHaveTooManyLines_DefaultValues.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.Linq\nImports System.Text\n\nNamespace Tests.TestCases\n    Class Foo\n        Public Sub Test() ' Noncompliant {{This method 'Test' has 91 lines, which is greater than the 80 lines authorized. Split it into smaller procedures.}}\n            Dim i As Integer\n\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n            i += 1\n\t\tEnd Sub\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodsShouldUseBaseTypes.AspControllers.cs",
    "content": "﻿using System;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace WebApplication1\n{\n    [ApiController]\n    [Route(\"api/controller\")]\n    public class ValuesController : ControllerBase\n    {\n        [HttpGet]\n        public string Get([FromQuery] Query query) // Compliant, it's a public method in a controller, see: https://github.com/SonarSource/sonar-dotnet/issues/5264\n        {\n            query.Foo();\n            return \"\";\n        }\n\n        private void AMethod(Query query) // Noncompliant\n        {\n            query.Foo();\n        }\n    }\n\n    public class QueryBase\n    {\n        public void Foo() { }\n    }\n\n    public class Query : QueryBase { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodsShouldUseBaseTypes.CSharp8.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Something\n{\n    internal interface IFoo\n    {\n        bool IsFoo { get; }\n    }\n\n    public class Foo : IFoo\n    {\n        public bool IsFoo { get; set; }\n    }\n\n    public class Bar : Foo\n    {\n    }\n}\n\n// Test that rule doesn't suggest base with inconsistent accessibility\nnamespace InconsistentAccessibility\n{\n    public class Bar\n    {\n        protected internal void ProtectedInternal_InternalBaseType(Something.Foo f) // Noncompliant\n        {\n            var x = f.IsFoo;\n        }\n\n        protected internal void ProtectedInternal_PublicBaseType(Something.Bar f) // Noncompliant\n        {\n            var x = f.IsFoo;\n        }\n\n        private protected void PrivateProtected_InternalBaseType(Something.Foo f) // Noncompliant\n        {\n            var x = f.IsFoo;\n        }\n    }\n\n    public class Parent\n    {\n        private interface IPrivateFoo\n        {\n            bool IsFoo { get; }\n        }\n\n        public class ImplementsIPrivateFoo : IPrivateFoo\n        {\n            public bool IsFoo { get; }\n        }\n\n        private void Private(ImplementsIPrivateFoo foo) // Noncompliant\n        {\n            var x = foo.IsFoo;\n        }\n\n        private protected void PrivateProtected(ImplementsIPrivateFoo foo) // Compliant\n        {\n            var x = foo.IsFoo;\n        }\n\n        protected internal void ProtectedInternal(ImplementsIPrivateFoo foo) // Compliant\n        {\n            var x = foo.IsFoo;\n        }\n\n        private protected interface IPrivateProtectedFoo\n        {\n            bool IsFoo { get; }\n        }\n\n        public class ImplementsIPrivateProtectedFoo : IPrivateProtectedFoo\n        {\n            public bool IsFoo { get; }\n        }\n\n        private void Private(ImplementsIPrivateProtectedFoo foo) // Noncompliant\n        {\n            var x = foo.IsFoo;\n        }\n\n        private protected void PrivateProtected(ImplementsIPrivateProtectedFoo foo) // Noncompliant\n        {\n            var x = foo.IsFoo;\n        }\n\n        protected internal void ProtectedInternal(ImplementsIPrivateProtectedFoo foo) // Compliant\n        {\n            var x = foo.IsFoo;\n        }\n\n        protected internal interface IProtectedInternalFoo\n        {\n            bool IsFoo { get; }\n        }\n\n        public class ImplementsIProtectedInternalFoo : IProtectedInternalFoo\n        {\n            public bool IsFoo { get; }\n        }\n\n        private void Private(ImplementsIProtectedInternalFoo foo) // Noncompliant\n        {\n            var x = foo.IsFoo;\n        }\n\n        private protected void PrivateProtected(ImplementsIProtectedInternalFoo foo) // Noncompliant\n        {\n            var x = foo.IsFoo;\n        }\n\n        protected internal void ProtectedInternal(ImplementsIProtectedInternalFoo foo) // Noncompliant\n        {\n            var x = foo.IsFoo;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodsShouldUseBaseTypes.CSharp9.cs",
    "content": "﻿int LocalMethod(B b) // FN\n{\n    return b.Property;\n}\n\npublic record A\n{\n    public A(A a) { }\n\n    public void Method() { }\n\n    public int Property { get; init; }\n}\n\npublic record B : A\n{\n    public B(B b) : base(b) // FN - only base class property is copied\n    {\n        Property = b.Property;\n    }\n\n    public int Test_01(B b) // Noncompliant\n    {\n        return b.Property;\n    }\n\n    public void Test_02(B foo) // Noncompliant {{Consider using more general type 'A' instead of 'B'.}}\n//                        ^^^\n    {\n        foo.Method();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodsShouldUseBaseTypes.Concurrent.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\n\n// Test interface inheritance\nnamespace AppendedNamespaceForConcurrencyTest.Test_01\n{\n    public interface A\n    {\n        void Method();\n    }\n\n    public class B : A\n    {\n        public void Method() { }\n\n        public void Test_01(B foo) // Noncompliant {{Consider using more general type 'AppendedNamespaceForConcurrencyTest.Test_01.A' instead of 'AppendedNamespaceForConcurrencyTest.Test_01.B'.}}\n//                            ^^^\n        {\n            foo.Method();\n        }\n    }\n}\n\n// Test interface inheritance with in-between interface\nnamespace AppendedNamespaceForConcurrencyTest.Test_02\n{\n    public interface A\n    {\n        void Method();\n    }\n\n    public interface B : A\n    {\n    }\n\n    public class C : B\n    {\n        public void Method() { }\n\n        public void Test_02(C foo) // Noncompliant {{Consider using more general type 'AppendedNamespaceForConcurrencyTest.Test_02.A' instead of 'AppendedNamespaceForConcurrencyTest.Test_02.C'.}}\n        {\n            foo.Method();\n        }\n    }\n}\n\n// Test interface inheritance with hierarchy\nnamespace AppendedNamespaceForConcurrencyTest.Test_03\n{\n    public interface A_Base\n    {\n        void Method();\n    }\n\n    public interface A_Derived : A_Base\n    {\n    }\n\n    public interface B_Base\n    {\n        void OtherMethod();\n    }\n\n    public interface B_Derived : B_Base\n    {\n    }\n\n    public class C : B_Derived, A_Derived\n    {\n        public void Method() { }\n        public void OtherMethod() { }\n\n        public void Test_03(C foo) // Noncompliant {{Consider using more general type 'AppendedNamespaceForConcurrencyTest.Test_03.A_Base' instead of 'AppendedNamespaceForConcurrencyTest.Test_03.C'.}}\n        {\n            foo.Method();\n        }\n    }\n}\n\n// Test new method (without \"new\" keyword)\nnamespace AppendedNamespaceForConcurrencyTest.Test_04\n{\n    public class A\n    {\n        public void Method() { }\n    }\n\n    public class B : A\n    {\n        public void Method() { }\n\n        public void Test_04(B foo)\n        {\n            foo.Method();\n        }\n    }\n}\n\n// Test new method (with \"new\" keyword)\nnamespace AppendedNamespaceForConcurrencyTest.Test_05\n{\n    public class A\n    {\n        public void Method() { }\n    }\n\n    public class B : A\n    {\n        public new void Method() { }\n\n        public void Test_05(B foo)\n        {\n            foo.Method();\n        }\n    }\n}\n\n// Test virtual method\nnamespace AppendedNamespaceForConcurrencyTest.Test_06\n{\n    public class A\n    {\n        public virtual void Method() { }\n    }\n\n    public class B : A\n    {\n        public override void Method() { }\n\n        public void Test_06(B foo) // Noncompliant {{Consider using more general type 'AppendedNamespaceForConcurrencyTest.Test_06.A' instead of 'AppendedNamespaceForConcurrencyTest.Test_06.B'.}}\n        {\n            foo.Method();\n        }\n    }\n}\n\n// Test property inheritance\nnamespace AppendedNamespaceForConcurrencyTest.Test_07\n{\n    public class A\n    {\n        public int Property { get; set; }\n    }\n\n    public class B : A\n    {\n        public void Test_07(B foo) // Noncompliant {{Consider using more general type 'AppendedNamespaceForConcurrencyTest.Test_07.A' instead of 'AppendedNamespaceForConcurrencyTest.Test_07.B'.}}\n        {\n            int x = foo.Property;\n        }\n    }\n}\n\n// Test property with no base setter\nnamespace AppendedNamespaceForConcurrencyTest.Test_08\n{\n    public interface A\n    {\n        int Property { get; }\n    }\n\n    public class B : A\n    {\n        public int Property { get; set; }\n\n        public void Test_08(B foo)\n        {\n            foo.Property = 1;\n        }\n    }\n}\n\n// Test constraints from other methods\nnamespace AppendedNamespaceForConcurrencyTest.Test_09\n{\n    public interface A\n    {\n        int Property { get; }\n    }\n\n    public class B : A\n    {\n        public int Property { get; set; }\n\n        public void Test_09(B foo) // Noncompliant\n        {\n            MethodA(foo);\n        }\n\n        public void Test_09_01(B foo)\n        {\n            MethodB(foo);\n        }\n\n        public void MethodA(A something) { }\n\n        public void MethodB(B something) { }\n    }\n}\n\n// Test assignments\nnamespace AppendedNamespaceForConcurrencyTest.Test_10\n{\n    public interface A\n    {\n        int Property { get; set; }\n    }\n\n    public class B : A\n    {\n        public int Property { get; set; }\n\n        public void Test_10(B foo)\n        {\n            foo = new Test_10.B();\n            var y = foo.Property;\n        }\n\n        public void Test_10_01(B foo)\n        {\n            var x = foo;\n            var y = foo.Property;\n        }\n\n        public void Test_10_02(B foo) // Noncompliant\n        {\n            var y = foo.Property;\n        }\n    }\n}\n\n// Test fields\nnamespace AppendedNamespaceForConcurrencyTest.Test_11\n{\n    public class A\n    {\n        public int publicField;\n        public int publicField_2;\n\n        protected int protectedField;\n        protected int protectedField_2;\n    }\n\n    public class B : A\n    {\n        public int publicField;\n\n        new protected int protectedField;\n\n        public void Test_11(B foo)\n        {\n            foo.publicField = 1;\n        }\n\n        public void Test_11_01(B foo) // Noncompliant\n        {\n            foo.publicField_2 = 1;\n        }\n\n        public void Test_11_02(B foo)\n        {\n            var x = foo.publicField;\n        }\n\n        public void Test_11_03(B foo) // Noncompliant\n        {\n            var x = foo.publicField_2;\n        }\n    }\n}\n\n// Test conditional access\nnamespace AppendedNamespaceForConcurrencyTest.Test_12\n{\n    public class A\n    {\n        public int Field;\n\n        public void Method() { }\n\n        public int Property { get; set; }\n\n        public event EventHandler Event\n        {\n            add { }\n            remove { }\n        }\n    }\n\n    public class B : A\n    {\n        public void Test_12(B foo) // Noncompliant\n        {\n            var x = foo?.Field;\n        }\n\n        public void Test_12_01(B foo) // Noncompliant\n        {\n            var x = foo?.Property;\n        }\n\n        public void Test_12_02(B foo) // Noncompliant\n        {\n            foo?.Method();\n        }\n\n        public void Test_12_03(B foo) // Noncompliant\n        {\n            foo.Event += Foo_SomeEvent;\n        }\n\n        private void Foo_SomeEvent(object sender, EventArgs e) { }\n    }\n}\n\n// Test parameter ordering\nnamespace AppendedNamespaceForConcurrencyTest.Test_13\n{\n    public class A\n    {\n        public int Field;\n\n        public void Method() { }\n\n        public int Property { get; set; }\n    }\n\n    public class B : A\n    {\n        public void Test_13(Test_13.B foo) // Noncompliant\n        {\n            MethodA(1, 1, foo, false);\n        }\n        public void MethodA(int unused, int param2, Test_13.A something, bool f) { }\n\n        public void MethodB(Test_13.B something) { }\n    }\n}\n\n// Test extension methods\nnamespace AppendedNamespaceForConcurrencyTest.Test_14\n{\n    public class A\n    {\n    }\n\n    public class B : A\n    {\n        public void Test_14(B foo) // Noncompliant\n        {\n            foo.ExtMethodA();\n        }\n\n        public void Test_14_01(B foo)\n        {\n            foo.ExtMethodB();\n        }\n\n        public void Test_14_02(B foo)\n        {\n            foo?.ExtMethodB();\n        }\n    }\n\n    public static class Ext\n    {\n        public static void ExtMethodA(this A foo)\n        {\n        }\n\n        public static void ExtMethodB(this B foo)\n        {\n        }\n    }\n}\n\n// Test events\nnamespace AppendedNamespaceForConcurrencyTest.Test_15\n{\n    public interface A\n    {\n        event EventHandler SomeEvent;\n    }\n\n    public class B : A\n    {\n        public event EventHandler SomeEvent\n        {\n            add { }\n            remove { }\n        }\n\n        public void Test_15(B foo) // Noncompliant\n        {\n            foo.SomeEvent += Foo_SomeEvent;\n        }\n\n        public void Test_15_01(A foo)\n        {\n            foo.SomeEvent += Foo_SomeEvent;\n        }\n\n        private void Foo_SomeEvent(object sender, EventArgs e) { }\n    }\n}\n\n// Test multiple parameters\nnamespace AppendedNamespaceForConcurrencyTest.Test_16\n{\n    public interface A\n    {\n        void Method();\n\n        int Property { get; }\n    }\n\n    public class B : A\n    {\n        public int Property { get { return 0; } }\n\n        public void Method() { }\n\n        public void OtherMethod() { }\n\n        public void Test_16(B foo1, B foo2, B foo3)\n//                            ^^^^ Noncompliant {{Consider using more general type 'AppendedNamespaceForConcurrencyTest.Test_16.A' instead of 'AppendedNamespaceForConcurrencyTest.Test_16.B'.}}\n//                                    ^^^^ Noncompliant@-1 {{Consider using more general type 'AppendedNamespaceForConcurrencyTest.Test_16.A' instead of 'AppendedNamespaceForConcurrencyTest.Test_16.B'.}}\n        {\n            foo1.Method();\n            var x = foo2.Property;\n            foo3.OtherMethod();\n        }\n    }\n}\n\n// Test overridden method\nnamespace AppendedNamespaceForConcurrencyTest.Test_17\n{\n    public interface IA\n    {\n        void Method();\n\n        int Property { get; }\n    }\n\n    public class A : IA\n    {\n        public int Property { get { return 0; } }\n\n        public void Method() { }\n\n        // Compliant - method is virtual so there is a contract to respect\n        public virtual void Test_17(B foo)\n        {\n            foo.Method();\n        }\n    }\n\n    public class B : A\n    {\n        public int Property { get { return 0; } }\n\n        public void Method() { }\n\n        public void OtherMethod() { }\n\n        // Compliant - cannot change parameter type, because it is an override.\n        public override void Test_17(B foo)\n        {\n            foo.Method();\n        }\n    }\n}\n\n// Test excluded types\nnamespace AppendedNamespaceForConcurrencyTest.Test_18\n{\n    using System.Collections.Generic;\n\n    public class A\n    {\n        public enum AreWeGood { Yes, OfCourse }\n\n        // Compliant examples. Do not report on if the suggestion is one of:\n        // object\n        // string\n        // value type\n        // array\n        // enum\n        // types starting with \"_\"\n        // unused parameter\n\n        public void Test_18_Object(B foo)\n        {\n            var x = foo.ToString();\n        }\n\n        public void Test_18_Enum(AreWeGood foo)\n        {\n            foo.HasFlag(AreWeGood.Yes);\n        }\n\n        public void Test_18_Interop(System.Type foo)\n        {\n            var x = foo.IsEnum;\n        }\n\n        public void Test_18_Unused(B foo)\n        {\n        }\n\n        public void Test_18_Array(B[] foo)\n        {\n            var x = foo.Length;\n        }\n\n        public void Test_18_ValueType(Guid foo)\n        {\n            var x = foo.ToString();\n        }\n\n        public void Test_18_String(string foo)\n        {\n            var x = foo.Equals(\"\");\n        }\n    }\n\n    public class B : A { }\n}\n\n// Test parentheses\nnamespace AppendedNamespaceForConcurrencyTest.Test_19\n{\n    public class A\n    {\n        public void Method() { }\n\n        public int Property { get; set; }\n    }\n\n    public class B : A\n    {\n        public void Test_19_Method(B foo) // Noncompliant\n        {\n            (((foo))).Method();\n        }\n\n        public void Test_19_Method2(B foo) // Noncompliant\n        {\n            Foo( (((foo))) );\n        }\n\n        public void Test_19_Property(B foo) // Noncompliant\n        {\n            (foo).Property = 1;\n        }\n\n        private void Foo(A thing) { }\n    }\n}\n\n// Test unsupported\nnamespace AppendedNamespaceForConcurrencyTest.Test_20\n{\n    public class A\n    {\n        public void Method() { }\n    }\n\n    public class B : A\n    {\n        public void Test_19_Method(B foo) // False negative\n        {\n            (foo ?? null).Method();\n        }\n    }\n}\n\n// Test implementing interface\nnamespace AppendedNamespaceForConcurrencyTest.Test_21\n{\n    public interface I\n    {\n        void Foo();\n\n        void Foo2();\n    }\n\n    public class A : I\n    {\n        public virtual void Foo() { }\n        public void Foo2() { }\n    }\n\n    public class B : A\n    {\n        public override void Foo() { }\n        public void Foo2() { }\n    }\n\n    public interface IOther\n    {\n        void MethodA(A a);\n        void MethodB(B b);\n    }\n\n    public class Other : IOther\n    {\n        public void MethodA(A a)\n        {\n            a.Foo();\n        }\n\n        public void MethodB(B b)\n        {\n            b.Foo();\n        }\n    }\n}\n\n// Test collection accessed through indexer\nnamespace AppendedNamespaceForConcurrencyTest.Test_23\n{\n    using System.Collections;\n    using System.Collections.Generic;\n\n    public class Foo\n    {\n        public void MethodOne(IList list)\n        {\n            if (list.Count > 0)\n            {\n                Console.WriteLine(list[0]);\n            }\n        }\n\n        public void MethodTwo(IList<Foo> list)\n        {\n            if (list.Count > 0)\n            {\n                Console.WriteLine(list[0]);\n            }\n        }\n\n        public void MethodThree(IReadOnlyList<Foo> list)\n        {\n            if (list.Count > 0)\n            {\n                Console.WriteLine(list[0]);\n            }\n        }\n\n        public void MethodThree(IList<Foo> list)\n        {\n            list[0] = new Test_23.Foo();\n        }\n    }\n}\n\n// Test that rule doesn't suggest other types for EventHandler methods\nnamespace AppendedNamespaceForConcurrencyTest.Test_24\n{\n    public interface IFooEventArgs\n    {\n        bool IsFoo { get; }\n    }\n    public class FooEventArgs : EventArgs, IFooEventArgs\n    {\n        public bool IsFoo { get; set; }\n    }\n\n    public class Foo\n    {\n        public event EventHandler<FooEventArgs> FooEvent;\n\n        public Foo()\n        {\n            FooEvent += Foo_FooEvent;\n        }\n\n        private void Foo_FooEvent(object sender, FooEventArgs e)\n        {\n            var x = e.IsFoo;\n        }\n    }\n}\n\nnamespace AppendedNamespaceForConcurrencyTest.Something\n{\n    internal interface IFoo\n    {\n        bool IsFoo { get; }\n    }\n\n    public class Foo : IFoo\n    {\n        public bool IsFoo { get; set; }\n    }\n\n    public class Bar : Foo\n    {\n    }\n}\n\n// Test that rule doesn't suggest base with inconsistent accessibility\nnamespace AppendedNamespaceForConcurrencyTest.Test_25\n{\n    public class Bar\n    {\n        public void MethodOne(Something.Foo f)\n        {\n            var x = f.IsFoo;\n        }\n\n        protected void MethodTwo(Something.Foo f)\n        {\n            var x = f.IsFoo;\n        }\n\n        private void MethodThree(Something.Foo f) // Noncompliant\n        {\n            var x = f.IsFoo;\n        }\n\n        internal void MethodFour(Something.Foo f) // Noncompliant\n        {\n            var x = f.IsFoo;\n        }\n\n        public void MethodFive(Something.Bar f) // Noncompliant {{Consider using more general type 'AppendedNamespaceForConcurrencyTest.Something.Foo' instead of 'AppendedNamespaceForConcurrencyTest.Something.Bar'.}}\n        {\n            var x = f.IsFoo;\n        }\n\n        protected void MethodSix(Something.Bar f) // Noncompliant {{Consider using more general type 'AppendedNamespaceForConcurrencyTest.Something.Foo' instead of 'AppendedNamespaceForConcurrencyTest.Something.Bar'.}}\n        {\n            var x = f.IsFoo;\n        }\n\n        private void MethodSeven(Something.Bar f) // Noncompliant {{Consider using more general type 'AppendedNamespaceForConcurrencyTest.Something.IFoo' instead of 'AppendedNamespaceForConcurrencyTest.Something.Bar'.}}\n        {\n            var x = f.IsFoo;\n        }\n\n        internal void MethodEight(Something.Bar f) // Noncompliant {{Consider using more general type 'AppendedNamespaceForConcurrencyTest.Something.IFoo' instead of 'AppendedNamespaceForConcurrencyTest.Something.Bar'.}}\n        {\n            var x = f.IsFoo;\n        }\n    }\n}\n\n// Do not suggest ICollection<KVP<T1, T2>> instead of Dictionary<T1, T2>\nnamespace AppendedNamespaceForConcurrencyTest.Test_26\n{\n    public class Foo\n    {\n        public void Bar(Dictionary<string, string> dictionary)\n        {\n            var x = dictionary.Count;\n        }\n\n        public void Bar(ICollection<KeyValuePair<string, string>> b)\n        {\n            var x = b.Count;\n        }\n    }\n}\n\n// Test IEnumerable iterated over twice\nnamespace AppendedNamespaceForConcurrencyTest.Test_26\n{\n    public class IEnumerable_T_Tests\n    {\n        protected void IEnumerable_Once(IEnumerable<string> foo)\n        {\n            var y = foo.Where(z => z != null);\n        }\n\n        protected void IEnumerable_Twice(List<string> foo)\n        {\n            var y = foo.Where(z => z != null);\n            y = foo.Where(z => z != null);\n        }\n\n        protected void IEnumerable_T_Once_With_List(List<string> foo) // Noncompliant\n        {\n            var y = foo.Where(z => z != null);\n        }\n    }\n\n    public class IEnumerable_Tests\n    {\n        protected void IEnumerable_Once(IEnumerable foo)\n        {\n            var x = foo.GetEnumerator();\n        }\n\n        protected void IEnumerable_Twice(IList foo)\n        {\n            var x = foo.GetEnumerator();\n            var y = foo.GetEnumerator();\n        }\n\n        protected void IEnumerable_T_Once_With_List(IList foo) // Noncompliant\n        {\n            var x = foo.GetEnumerator();\n        }\n    }\n}\n\nnamespace AppendedNamespaceForConcurrencyTest.Test_27\n{\n    public sealed class ReproIssue2479\n    {\n        public void SomeMethod(IReadOnlyList<S3242DeconstructibleType> list) // Noncompliant FP, using IReadOnlyCollection gives compile error\n        {\n            for (var i = 0; i < list.Count; ++i)\n            {\n                var (key, value) = list[i];\n                Console.WriteLine(key + \" \" + value);\n            }\n        }\n    }\n\n    public class S3242DeconstructibleType\n    {\n        public void Deconstruct(out object key, out object value)\n        {\n            key = value = \"x\";\n        }\n    }\n}\n\nnamespace AppendedNamespaceForConcurrencyTest.MultiConditionalAccess\n{\n    public class BaseItem\n    {\n        public string this[int i] => null;\n\n        public string BaseMethod() => null;\n    }\n\n    public class MainItem : BaseItem\n    {\n        public string Property => null;\n    }\n\n    public class Usage\n    {\n        public void Basic(MainItem item) // Noncompliant\n        {\n            var value = item[42];\n            var length = item[42].Length;\n        }\n\n        public void ConditionalAccess(MainItem item) // False negative, binding syntax is not supported in ConditionalAccessExpressionSyntax\n        {\n            var value = item?[42];\n            var length = item?[42].Length;\n        }\n\n        public void DoubleConditionalAccess(MainItem item) // False negative, binding syntax is not supported in ConditionalAccessExpressionSyntax\n        {\n            var length = item?[42]?.ToString()?.Length;\n        }\n\n        public void CompliantDouble(System.ArgumentException ex)\n        {\n            var length = ex?.ParamName?.Length;\n            var message = ex.Message;\n        }\n\n        public void CompliantTriple(System.ArgumentException ex)\n        {\n            var length = ex?.ParamName?.ToString()?.Length;\n            var message = ex.Message;\n        }\n\n        public void NoncompliantDouble(System.ArgumentException ex) // Noncompliant\n        {\n            var length = ex?.Message?.Length;\n        }\n\n        public void NoncompliantTriple(System.ArgumentException ex) // Noncompliant\n        {\n            var length = ex?.Message?.ToString()?.Length;\n        }\n\n        public void NoncompliantTripleMethod(MainItem ex) // Noncompliant\n        {\n            var length = ex?.BaseMethod()?.ToString()?.Length;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MethodsShouldUseBaseTypes.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\n\n// Test interface inheritance\nnamespace Test_01\n{\n    public interface A\n    {\n        void Method();\n    }\n\n    public class B : A\n    {\n        public void Method() { }\n\n        public void Test_01(B foo) // Noncompliant {{Consider using more general type 'Test_01.A' instead of 'Test_01.B'.}}\n//                            ^^^\n        {\n            foo.Method();\n        }\n    }\n}\n\n// Test interface inheritance with in-between interface\nnamespace Test_02\n{\n    public interface A\n    {\n        void Method();\n    }\n\n    public interface B : A\n    {\n    }\n\n    public class C : B\n    {\n        public void Method() { }\n\n        public void Test_02(C foo) // Noncompliant {{Consider using more general type 'Test_02.A' instead of 'Test_02.C'.}}\n        {\n            foo.Method();\n        }\n    }\n}\n\n// Test interface inheritance with hierarchy\nnamespace Test_03\n{\n    public interface A_Base\n    {\n        void Method();\n    }\n\n    public interface A_Derived : A_Base\n    {\n    }\n\n    public interface B_Base\n    {\n        void OtherMethod();\n    }\n\n    public interface B_Derived : B_Base\n    {\n    }\n\n    public class C : B_Derived, A_Derived\n    {\n        public void Method() { }\n        public void OtherMethod() { }\n\n        public void Test_03(C foo) // Noncompliant {{Consider using more general type 'Test_03.A_Base' instead of 'Test_03.C'.}}\n        {\n            foo.Method();\n        }\n    }\n}\n\n// Test new method (without \"new\" keyword)\nnamespace Test_04\n{\n    public class A\n    {\n        public void Method() { }\n    }\n\n    public class B : A\n    {\n        public void Method() { }\n\n        public void Test_04(B foo)\n        {\n            foo.Method();\n        }\n    }\n}\n\n// Test new method (with \"new\" keyword)\nnamespace Test_05\n{\n    public class A\n    {\n        public void Method() { }\n    }\n\n    public class B : A\n    {\n        public new void Method() { }\n\n        public void Test_05(B foo)\n        {\n            foo.Method();\n        }\n    }\n}\n\n// Test virtual method\nnamespace Test_06\n{\n    public class A\n    {\n        public virtual void Method() { }\n    }\n\n    public class B : A\n    {\n        public override void Method() { }\n\n        public void Test_06(B foo) // Noncompliant {{Consider using more general type 'Test_06.A' instead of 'Test_06.B'.}}\n        {\n            foo.Method();\n        }\n    }\n}\n\n// Test property inheritance\nnamespace Test_07\n{\n    public class A\n    {\n        public int Property { get; set; }\n    }\n\n    public class B : A\n    {\n        public void Test_07(B foo) // Noncompliant {{Consider using more general type 'Test_07.A' instead of 'Test_07.B'.}}\n        {\n            int x = foo.Property;\n        }\n    }\n}\n\n// Test property with no base setter\nnamespace Test_08\n{\n    public interface A\n    {\n        int Property { get; }\n    }\n\n    public class B : A\n    {\n        public int Property { get; set; }\n\n        public void Test_08(B foo)\n        {\n            foo.Property = 1;\n        }\n    }\n}\n\n// Test constraints from other methods\nnamespace Test_09\n{\n    public interface A\n    {\n        int Property { get; }\n    }\n\n    public class B : A\n    {\n        public int Property { get; set; }\n\n        public void Test_09(B foo) // Noncompliant\n        {\n            MethodA(foo);\n        }\n\n        public void Test_09_01(B foo)\n        {\n            MethodB(foo);\n        }\n\n        public void MethodA(A something) { }\n\n        public void MethodB(B something) { }\n    }\n}\n\n// Test assignments\nnamespace Test_10\n{\n    public interface A\n    {\n        int Property { get; set; }\n    }\n\n    public class B : A\n    {\n        public int Property { get; set; }\n\n        public void Test_10(B foo)\n        {\n            foo = new Test_10.B();\n            var y = foo.Property;\n        }\n\n        public void Test_10_01(B foo)\n        {\n            var x = foo;\n            var y = foo.Property;\n        }\n\n        public void Test_10_02(B foo) // Noncompliant\n        {\n            var y = foo.Property;\n        }\n    }\n}\n\n// Test fields\nnamespace Test_11\n{\n    public class A\n    {\n        public int publicField;\n        public int publicField_2;\n\n        protected int protectedField;\n        protected int protectedField_2;\n    }\n\n    public class B : A\n    {\n        public int publicField;\n\n        new protected int protectedField;\n\n        public void Test_11(B foo)\n        {\n            foo.publicField = 1;\n        }\n\n        public void Test_11_01(B foo) // Noncompliant\n        {\n            foo.publicField_2 = 1;\n        }\n\n        public void Test_11_02(B foo)\n        {\n            var x = foo.publicField;\n        }\n\n        public void Test_11_03(B foo) // Noncompliant\n        {\n            var x = foo.publicField_2;\n        }\n    }\n}\n\n// Test conditional access\nnamespace Test_12\n{\n    public class A\n    {\n        public int Field;\n\n        public void Method() { }\n\n        public int Property { get; set; }\n\n        public event EventHandler Event\n        {\n            add { }\n            remove { }\n        }\n    }\n\n    public class B : A\n    {\n        public void Test_12(B foo) // Noncompliant\n        {\n            var x = foo?.Field;\n        }\n\n        public void Test_12_01(B foo) // Noncompliant\n        {\n            var x = foo?.Property;\n        }\n\n        public void Test_12_02(B foo) // Noncompliant\n        {\n            foo?.Method();\n        }\n\n        public void Test_12_03(B foo) // Noncompliant\n        {\n            foo.Event += Foo_SomeEvent;\n        }\n\n        private void Foo_SomeEvent(object sender, EventArgs e) { }\n    }\n}\n\n// Test parameter ordering\nnamespace Test_13\n{\n    public class A\n    {\n        public int Field;\n\n        public void Method() { }\n\n        public int Property { get; set; }\n    }\n\n    public class B : A\n    {\n        public void Test_13(Test_13.B foo) // Noncompliant\n        {\n            MethodA(1, 1, foo, false);\n        }\n        public void MethodA(int unused, int param2, Test_13.A something, bool f) { }\n\n        public void MethodB(Test_13.B something) { }\n    }\n}\n\n// Test extension methods\nnamespace Test_14\n{\n    public class A\n    {\n    }\n\n    public class B : A\n    {\n        public void Test_14(B foo) // Noncompliant\n        {\n            foo.ExtMethodA();\n        }\n\n        public void Test_14_01(B foo)\n        {\n            foo.ExtMethodB();\n        }\n\n        public void Test_14_02(B foo)\n        {\n            foo?.ExtMethodB();\n        }\n    }\n\n    public static class Ext\n    {\n        public static void ExtMethodA(this A foo)\n        {\n        }\n\n        public static void ExtMethodB(this B foo)\n        {\n        }\n    }\n}\n\n// Test events\nnamespace Test_15\n{\n    public interface A\n    {\n        event EventHandler SomeEvent;\n    }\n\n    public class B : A\n    {\n        public event EventHandler SomeEvent\n        {\n            add { }\n            remove { }\n        }\n\n        public void Test_15(B foo) // Noncompliant\n        {\n            foo.SomeEvent += Foo_SomeEvent;\n        }\n\n        public void Test_15_01(A foo)\n        {\n            foo.SomeEvent += Foo_SomeEvent;\n        }\n\n        private void Foo_SomeEvent(object sender, EventArgs e) { }\n    }\n}\n\n// Test multiple parameters\nnamespace Test_16\n{\n    public interface A\n    {\n        void Method();\n\n        int Property { get; }\n    }\n\n    public class B : A\n    {\n        public int Property { get { return 0; } }\n\n        public void Method() { }\n\n        public void OtherMethod() { }\n\n        public void Test_16(B foo1, B foo2, B foo3)\n//                            ^^^^ Noncompliant {{Consider using more general type 'Test_16.A' instead of 'Test_16.B'.}}\n//                                    ^^^^ Noncompliant@-1 {{Consider using more general type 'Test_16.A' instead of 'Test_16.B'.}}\n        {\n            foo1.Method();\n            var x = foo2.Property;\n            foo3.OtherMethod();\n        }\n    }\n}\n\n// Test overridden method\nnamespace Test_17\n{\n    public interface IA\n    {\n        void Method();\n\n        int Property { get; }\n    }\n\n    public class A : IA\n    {\n        public int Property { get { return 0; } }\n\n        public void Method() { }\n\n        // Compliant - method is virtual so there is a contract to respect\n        public virtual void Test_17(B foo)\n        {\n            foo.Method();\n        }\n    }\n\n    public class B : A\n    {\n        public int Property { get { return 0; } }\n\n        public void Method() { }\n\n        public void OtherMethod() { }\n\n        // Compliant - cannot change parameter type, because it is an override.\n        public override void Test_17(B foo)\n        {\n            foo.Method();\n        }\n    }\n}\n\n// Test excluded types\nnamespace Test_18\n{\n    using System.Collections.Generic;\n\n    public class A\n    {\n        public enum AreWeGood { Yes, OfCourse }\n\n        // Compliant examples. Do not report on if the suggestion is one of:\n        // object\n        // string\n        // value type\n        // array\n        // enum\n        // types starting with \"_\"\n        // unused parameter\n\n        public void Test_18_Object(B foo)\n        {\n            var x = foo.ToString();\n        }\n\n        public void Test_18_Enum(AreWeGood foo)\n        {\n            foo.HasFlag(AreWeGood.Yes);\n        }\n\n        public void Test_18_Interop(System.Type foo)\n        {\n            var x = foo.IsEnum;\n        }\n\n        public void Test_18_Unused(B foo)\n        {\n        }\n\n        public void Test_18_Array(B[] foo)\n        {\n            var x = foo.Length;\n        }\n\n        public void Test_18_ValueType(Guid foo)\n        {\n            var x = foo.ToString();\n        }\n\n        public void Test_18_String(string foo)\n        {\n            var x = foo.Equals(\"\");\n        }\n    }\n\n    public class B : A { }\n}\n\n// Test parentheses\nnamespace Test_19\n{\n    public class A\n    {\n        public void Method() { }\n\n        public int Property { get; set; }\n    }\n\n    public class B : A\n    {\n        public void Test_19_Method(B foo) // Noncompliant\n        {\n            (((foo))).Method();\n        }\n\n        public void Test_19_Method2(B foo) // Noncompliant\n        {\n            Foo( (((foo))) );\n        }\n\n        public void Test_19_Property(B foo) // Noncompliant\n        {\n            (foo).Property = 1;\n        }\n\n        private void Foo(A thing) { }\n    }\n}\n\n// Test unsupported\nnamespace Test_20\n{\n    public class A\n    {\n        public void Method() { }\n    }\n\n    public class B : A\n    {\n        public void Test_19_Method(B foo) // False negative\n        {\n            (foo ?? null).Method();\n        }\n    }\n}\n\n// Test implementing interface\nnamespace Test_21\n{\n    public interface I\n    {\n        void Foo();\n\n        void Foo2();\n    }\n\n    public class A : I\n    {\n        public virtual void Foo() { }\n        public void Foo2() { }\n    }\n\n    public class B : A\n    {\n        public override void Foo() { }\n        public void Foo2() { }\n    }\n\n    public interface IOther\n    {\n        void MethodA(A a);\n        void MethodB(B b);\n    }\n\n    public class Other : IOther\n    {\n        public void MethodA(A a)\n        {\n            a.Foo();\n        }\n\n        public void MethodB(B b)\n        {\n            b.Foo();\n        }\n    }\n}\n\n// Test collection accessed through indexer\nnamespace Test_23\n{\n    using System.Collections;\n    using System.Collections.Generic;\n\n    public class Foo\n    {\n        public void MethodOne(IList list)\n        {\n            if (list.Count > 0)\n            {\n                Console.WriteLine(list[0]);\n            }\n        }\n\n        public void MethodTwo(IList<Foo> list)\n        {\n            if (list.Count > 0)\n            {\n                Console.WriteLine(list[0]);\n            }\n        }\n\n        public void MethodThree(IReadOnlyList<Foo> list)\n        {\n            if (list.Count > 0)\n            {\n                Console.WriteLine(list[0]);\n            }\n        }\n\n        public void MethodThree(IList<Foo> list)\n        {\n            list[0] = new Test_23.Foo();\n        }\n    }\n}\n\n// Test that rule doesn't suggest other types for EventHandler methods\nnamespace Test_24\n{\n    public interface IFooEventArgs\n    {\n        bool IsFoo { get; }\n    }\n    public class FooEventArgs : EventArgs, IFooEventArgs\n    {\n        public bool IsFoo { get; set; }\n    }\n\n    public class Foo\n    {\n        public event EventHandler<FooEventArgs> FooEvent;\n\n        public Foo()\n        {\n            FooEvent += Foo_FooEvent;\n        }\n\n        private void Foo_FooEvent(object sender, FooEventArgs e)\n        {\n            var x = e.IsFoo;\n        }\n    }\n}\n\nnamespace Something\n{\n    internal interface IFoo\n    {\n        bool IsFoo { get; }\n    }\n\n    public class Foo : IFoo\n    {\n        public bool IsFoo { get; set; }\n    }\n\n    public class Bar : Foo\n    {\n    }\n}\n\n// Test that rule doesn't suggest base with inconsistent accessibility\nnamespace Test_25\n{\n    public class Bar\n    {\n        public void MethodOne(Something.Foo f)\n        {\n            var x = f.IsFoo;\n        }\n\n        protected void MethodTwo(Something.Foo f)\n        {\n            var x = f.IsFoo;\n        }\n\n        private void MethodThree(Something.Foo f) // Noncompliant\n        {\n            var x = f.IsFoo;\n        }\n\n        internal void MethodFour(Something.Foo f) // Noncompliant\n        {\n            var x = f.IsFoo;\n        }\n\n        public void MethodFive(Something.Bar f) // Noncompliant {{Consider using more general type 'Something.Foo' instead of 'Something.Bar'.}}\n        {\n            var x = f.IsFoo;\n        }\n\n        protected void MethodSix(Something.Bar f) // Noncompliant {{Consider using more general type 'Something.Foo' instead of 'Something.Bar'.}}\n        {\n            var x = f.IsFoo;\n        }\n\n        private void MethodSeven(Something.Bar f) // Noncompliant {{Consider using more general type 'Something.IFoo' instead of 'Something.Bar'.}}\n        {\n            var x = f.IsFoo;\n        }\n\n        internal void MethodEight(Something.Bar f) // Noncompliant {{Consider using more general type 'Something.IFoo' instead of 'Something.Bar'.}}\n        {\n            var x = f.IsFoo;\n        }\n    }\n}\n\n// Do not suggest ICollection<KVP<T1, T2>> instead of Dictionary<T1, T2>\nnamespace Test_26\n{\n    public class Foo\n    {\n        public void Bar(Dictionary<string, string> dictionary)\n        {\n            var x = dictionary.Count;\n        }\n\n        public void Bar(ICollection<KeyValuePair<string, string>> b)\n        {\n            var x = b.Count;\n        }\n    }\n}\n\n// Test IEnumerable iterated over twice\nnamespace Test_26\n{\n    public class IEnumerable_T_Tests\n    {\n        protected void IEnumerable_Once(IEnumerable<string> foo)\n        {\n            var y = foo.Where(z => z != null);\n        }\n\n        protected void IEnumerable_Twice(List<string> foo)\n        {\n            var y = foo.Where(z => z != null);\n            y = foo.Where(z => z != null);\n        }\n\n        protected void IEnumerable_T_Once_With_List(List<string> foo) // Noncompliant\n        {\n            var y = foo.Where(z => z != null);\n        }\n    }\n\n    public class IEnumerable_Tests\n    {\n        protected void IEnumerable_Once(IEnumerable foo)\n        {\n            var x = foo.GetEnumerator();\n        }\n\n        protected void IEnumerable_Twice(IList foo)\n        {\n            var x = foo.GetEnumerator();\n            var y = foo.GetEnumerator();\n        }\n\n        protected void IEnumerable_T_Once_With_List(IList foo) // Noncompliant\n        {\n            var x = foo.GetEnumerator();\n        }\n    }\n}\n\nnamespace Test_27\n{\n    public sealed class ReproIssue2479\n    {\n        public void SomeMethod(IReadOnlyList<S3242DeconstructibleType> list) // Noncompliant FP, using IReadOnlyCollection gives compile error\n        {\n            for (var i = 0; i < list.Count; ++i)\n            {\n                var (key, value) = list[i];\n                Console.WriteLine(key + \" \" + value);\n            }\n        }\n    }\n\n    public class S3242DeconstructibleType\n    {\n        public void Deconstruct(out object key, out object value)\n        {\n            key = value = \"x\";\n        }\n    }\n}\n\nnamespace MultiConditionalAccess\n{\n    public class BaseItem\n    {\n        public string this[int i] => null;\n\n        public string BaseMethod() => null;\n    }\n\n    public class MainItem : BaseItem\n    {\n        public string Property => null;\n    }\n\n    public class Usage\n    {\n        public void Basic(MainItem item) // Noncompliant\n        {\n            var value = item[42];\n            var length = item[42].Length;\n        }\n\n        public void ConditionalAccess(MainItem item) // False negative, binding syntax is not supported in ConditionalAccessExpressionSyntax\n        {\n            var value = item?[42];\n            var length = item?[42].Length;\n        }\n\n        public void DoubleConditionalAccess(MainItem item) // False negative, binding syntax is not supported in ConditionalAccessExpressionSyntax\n        {\n            var length = item?[42]?.ToString()?.Length;\n        }\n\n        public void CompliantDouble(System.ArgumentException ex)\n        {\n            var length = ex?.ParamName?.Length;\n            var message = ex.Message;\n        }\n\n        public void CompliantTriple(System.ArgumentException ex)\n        {\n            var length = ex?.ParamName?.ToString()?.Length;\n            var message = ex.Message;\n        }\n\n        public void NoncompliantDouble(System.ArgumentException ex) // Noncompliant\n        {\n            var length = ex?.Message?.Length;\n        }\n\n        public void NoncompliantTriple(System.ArgumentException ex) // Noncompliant\n        {\n            var length = ex?.Message?.ToString()?.Length;\n        }\n\n        public void NoncompliantTripleMethod(MainItem ex) // Noncompliant\n        {\n            var length = ex?.BaseMethod()?.ToString()?.Length;\n        }\n\n        public void Handler(IReadOnlyDictionary<string, object> data) // See: https://github.com/SonarSource/sonar-dotnet/issues/5443\n        {\n            var _ = data.ToDictionary(x => x.Key, x => x.Value);\n        }\n\n        public void Handler(List<string> data) // Noncompliant\n        {\n            var _ = data.ToDictionary(x => x, x => x);\n        }\n    }\n}\n\nnamespace WithGenericBase\n{\n    public class Sample\n    {\n        public void CanUseInterface(CustomDictionary arg)   // Noncompliant {{Consider using more general type 'System.Collections.Generic.IDictionary<string, int>' instead of 'WithGenericBase.CustomDictionary'.}}\n        {\n            if (arg.ContainsKey(\"key\"))\n            {\n            }\n        }\n    }\n\n    public class CustomDictionary : Dictionary<string, int> { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MultilineBlocksWithoutBrace.Latest.cs",
    "content": "﻿using System;\nusing System.Threading.Tasks;\n\nclass WhenEach\n{\n    async Task ForEach()\n    {\n        var one = Task.Run(() => \"hey\");\n        var two = Task.Run(() => \"there\");\n\n        await foreach (var t in Task.WhenEach(one, two))\n            Console.WriteLine(t.Result);    // Secondary\n            Console.WriteLine(42);          // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MultilineBlocksWithoutBrace.cs",
    "content": "﻿class SecondWithIdentationRoot\n{\n    void While(bool condition)\n    {\n        while (condition)\n            Act.First();\n\n        Act.Second(); // Compliant\n    }\n\n    void For(string[] args)\n    {\n        for (var i = 0; i < args.Length; i++)\n            Act.First(args[i]);\n\n        Act.Second(); // Compliant\n    }\n\n    void ForEach(string[] args)\n    {\n        foreach (var arg in args)\n            Act.First(arg);\n\n        Act.Second(); // Compliant\n    }\n\n    void If(bool condition)\n    {\n        if (condition)\n            Act.First();\n\n        Act.Second(); // Compliant\n    }\n\n    void Else(bool condition)\n    {\n        if (condition)\n            Act.Other();\n\n        else\n            Act.First();\n\n        Act.Second(); // Compliant\n    }\n\n    void ElseIf(bool condition)\n    {\n        if (condition)\n            Act.Other();\n\n        else if (condition)\n            Act.First();\n\n        Act.Second(); // Compliant\n    }\n}\n\nclass SecondWithIdentationFirst\n{\n    void While(bool condition)\n    {\n        while (condition)\n            Act.First();\n        //  ^^^^^^^^^^^^ Secondary\n            Act.Second();\n        //  ^^^^^^^^^^^^^\n    }\n\n    void For(string[] args)\n    {\n        for (var i = 0; i < args.Length; i++)\n            Act.First(args[i]); // Secondary\n            Act.Second(); // Noncompliant {{This line will not be executed in a loop; only the first line of this 2-line block will be. The rest will execute only once.}}\n    }\n\n    void ForEach(string[] args)\n    {\n        foreach (var arg in args)\n            Act.First(arg); // Secondary\n            Act.Second(); // Noncompliant {{This line will not be executed in a loop; only the first line of this 2-line block will be. The rest will execute only once.}}\n    }\n\n    void If(bool condition)\n    {\n        if (condition)\n            Act.First(); // Secondary\n            Act.Second(); // Noncompliant {{This line will not be executed conditionally; only the first line of this 2-line block will be. The rest will execute unconditionally.}}\n    }\n\n    void Else(bool condition)\n    {\n        if (condition)\n            Act.Other();\n\n        else\n            Act.First(); // Secondary\n            Act.Second(); // Noncompliant {{This line will not be executed conditionally; only the first line of this 2-line block will be. The rest will execute unconditionally.}}\n    }\n\n    void ElseIf(bool condition)\n    {\n        if (condition)\n            Act.Other();\n\n        else if (condition)\n            Act.First(); // Secondary\n            Act.Second(); // Noncompliant {{This line will not be executed conditionally; only the first line of this 2-line block will be. The rest will execute unconditionally.}}\n    }\n}\n\nclass FirstAndSecondOneSameLine\n{\n    void While(bool condition)\n    {\n        while (condition) Act.First(); Act.Second();\n        //                ^^^^^^^^^^^^ Secondary\n        //                             ^^^^^^^^^^^^^ @-1\n    }\n\n    void For(string[] args)\n    {\n        for (var i = 0; i < args.Length; i++) Act.First(args[i]); Act.Second();\n        //                                    ^^^^^^^^^^^^^^^^^^^ Secondary\n        //                                                        ^^^^^^^^^^^^^ @-1\n    }\n\n    void ForEach(string[] args)\n    {\n        foreach (var arg in args) Act.First(arg); Act.Second();\n        //                        ^^^^^^^^^^^^^^^ Secondary\n        //                                        ^^^^^^^^^^^^^ @-1\n    }\n\n    void If(bool condition)\n    {\n        if (condition) Act.First(); Act.Second();\n        //             ^^^^^^^^^^^^ Secondary\n        //                          ^^^^^^^^^^^^^ @-1\n    }\n\n    void Else(bool condition)\n    {\n        if (condition) Act.Other();\n        else Act.First(); Act.Second();\n        //   ^^^^^^^^^^^^ Secondary\n        //                ^^^^^^^^^^^^^ @-1\n    }\n\n    void ElseIf(bool condition)\n    {\n        if (condition) Act.Other();\n        else if (condition) Act.First(); Act.Second();\n        //                  ^^^^^^^^^^^^ Secondary\n        //                               ^^^^^^^^^^^^^ @-1\n    }\n}\n\nclass FirstOneSameLineAndSecondWithIndentation\n{\n    void While(bool condition)\n    {\n        while (condition) Act.First(); // Secondary\n            Act.Second(); // Noncompliant\n    }\n\n    void For(string[] args)\n    {\n        for (var i = 0; i < args.Length; i++) Act.First(args[i]); // Secondary\n            Act.Second(); // Noncompliant\n    }\n\n    void ForEach(string[] args)\n    {\n        foreach (var arg in args) Act.First(arg); // Secondary\n            Act.Second(); // Noncompliant\n    }\n\n    void If(bool condition)\n    {\n        if (condition) Act.First(); // Secondary\n            Act.Second(); // Noncompliant\n    }\n\n    void Else(bool condition)\n    {\n        if (condition) Act.Other();\n        else Act.First(); // Secondary\n            Act.Second(); // Noncompliant\n    }\n\n    void ElseIf(bool condition)\n    {\n        if (condition) Act.Other();\n        else if (condition) Act.First(); // Secondary\n            Act.Second(); // Noncompliant\n    }\n}\n\nclass Nested\n{\n    void While(bool condition)\n    {\n        while (true)\n            while (condition) Act.First(); // Secondary\n                Act.Second(); // Noncompliant\n    }\n\n    void For(string[] args)\n    {\n        for (var ii = 0; ii < args.Length; ii++)\n            for (var i = 0; i < args.Length; i++) Act.First(args[i]); // Secondary\n                Act.Second(); // Noncompliant\n    }\n\n    void ForEach(string[] args)\n    {\n        foreach (var _ in args)\n            foreach (var arg in args) Act.First(arg); // Secondary\n                Act.Second(); // Noncompliant\n    }\n\n    void If(bool condition)\n    {\n        if (condition)\n            if (condition) Act.First(); // Secondary\n                Act.Second(); // Noncompliant\n    }\n}\n\nclass SecondPartIsPartOfIfStructure\n{\n    void Else(bool condition)\n    {\n        if (condition)\n            Act.First();\n            else Act.Second(); // Compliant\n    }\n    void ElseIf(bool condition)\n    {\n        if (condition)\n            Act.First();\n            else if(condition) Act.Second(); // Compliant\n    }\n}\n\nclass SecondPartOfOtherScope\n{\n    void LowerElseIf(bool condition)\n    {\n        if (condition)\n            if (condition)\n                Act.First(\"if\", \"if\");\n            else\n                Act.First(\"if\", \"else\");\n        else if (condition)  // Compliant\n            Act.First(\"else if\");\n    }\n    void LowerElse(bool condition)\n    {\n        if (condition)\n            if (condition)\n                Act.First(\"if\", \"if\");\n            else\n                Act.First(\"if\", \"else\");\n        else Act.First(\"else\"); // Compliant\n    }\n    void If(bool condition)\n    {\n        while (condition)\n            if(condition)\n                Act.First(\"while\");\n        if (condition) Act.First(\"while\", \"if\");  // Compliant\n    }\n}\n\nclass Comments\n{\n    int BlockComment(int n)\n    {\n        while (true)\n            while (true)\n                n++; /* first */ // Secondary\n        /*   */ return n; // Noncompliant\n    }\n\n    void BlockComment(bool condition)\n    {\n        if (condition)\n            Act.First(); // Secondary\n            /* Comment in the middle */\n            Act.Second(); // Noncompliant\n    }\n\n    void LineComment(bool condition)\n    {\n        if (condition)\n            Act.First(); // Secondary\n            // Commented line\n            Act.Second(); // Noncompliant\n    }\n}\n\nclass EmptyLines\n{\n    void HaveNoEffect(bool condition)\n    {\n        if (condition)\n            Act.First(); // Secondary\n\n            Act.Second(); // Noncompliant\n    }\n}\n\nclass EmptyStatements // Compliant, we ignore cases where at least one of the statements is empty\n{\n    public void First(bool condition)\n    {\n        if (condition) ; Act.Second();\n    }\n    public void Second(bool condition)\n    {\n        if (condition) Act.First(); ;\n    }\n    public void Both(bool condition)\n    {\n        if (condition) ; ;\n    }\n    public void BlockComment(bool condition)\n    {\n        if (condition) /* comment */; Act.Second();\n    }\n}\n\nclass Other\n{\n    void FirstSameLineSecondTooFar(bool condition)\n    {\n        if (condition) Act.First(); // Secondary\n                            Act.Second(); // Noncompliant\n    }\n\n    int WithReturnStatement(bool condition)\n    {\n        while (condition)\n            Act.First();\n        //  ^^^^^^^^^^^^ Secondary\n            return Act.Second();\n        //  ^^^^^^^^^^^^^^^^^^^^\n    }\n\n    void ZeroIdentation(bool condition)\n    {\n        if (condition)\nAct.First(); // Secondary\nAct.Second(); // Noncompliant\n    }\n\n    void DesendingIndentation(bool condition)\n    {\n                if (condition)\n            Act.First();\n        Act.Second(); // Compliant, although inconvenient.\n    }\n\n    void ShiftedIndentation(bool condition)\n    {\n                if (condition)\n        Act.First(); // Secondary\n            Act.Second(); // Noncompliant\n    }\n\n    void AlternativeIndentation(bool condition)\n    {\n        try {\n          if (condition)\n            Act.First(); // This statement is aligned with the '{' of the try on purpose to fix https://github.com/SonarSource/sonar-dotnet/issues/264\n        }\n        finally { }\n    }\n\n    void LimitedIndentation(bool condition)\n    {\n        if (condition)\n          Act.First();\n\n        Act.Second();\n    }\n\n    void LimitedIndentationSameLine(bool condition)\n    {\n        if (condition) Act.First(); // Secondary\n         Act.Second(); // Noncompliant\n    }\n\n    void IfElseWithAlternativeSpacing(bool condition)\n    {\n        var n = 0;\n        if (condition)\n            n = 2;\n        else\n        if (condition)\n            n = 2;\n        else\n        if (condition)\n            n = 2;\n        else\n        if (condition)\n            n = 2;\n        n = 4; // Compliant\n    }\n\n    public override bool Equals(object obj)\n    {\n        if (obj is null) return false;\n        return obj is Other other && Equals(other); // Compliant\n    }\n\n    public bool Equals(Other other) { return other != null; }\n}\nclass DoesNotCrash\n{\n    void OnMissingStatement(bool condition)\n    {\n        if (condition)\n            // Error@-1 [CS1002] ; expected\n            // Error@-2 [CS1525] Invalid expression term\n    }\n}\n\nclass Act\n{\n    public static void First(params string[] args) { }\n    public static int Second() { return 42; }\n    public static void Other() { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MultipleVariableDeclaration.Fixed.cs",
    "content": "﻿namespace Tests.Diagnostics\n{\n    public class MultipleVariableDeclaration\n    {\n        private int /*aaa1*/ a /*aaa2*/;\n        private int\n            /*bbb1*/ b /*bbb2*/;\n\n        private int c;\n        public MultipleVariableDeclaration(int n)\n        {\n            int /*aaa1*/a = 0 /*aaa2*/;\n            int /*bbb1*/ b = 0 /*bbb2*/;\n            int c = 0;\n            for (int i = 0, j = 2; i < 3; i++)\n            {\n\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MultipleVariableDeclaration.Fixed.vb",
    "content": "﻿Namespace Tests.Diagnostics\n\n    Public Class MultipleVariableDeclaration\n        Public Const AAA As Integer = 5\n        Public Const BBB = 42\n        Public Const DDD As String = \"foo\"\n        Public Sub New(n As Integer)\n            Dim AAA = 1\n            Dim B As Integer = 5\n            Dim BBB = 42\n            Dim CCC As String = \"foo\"\n            Dim DDD As String = \"foo\"\n        End Sub\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MultipleVariableDeclaration.WrongIndentation.Fixed.cs",
    "content": "﻿class TestCases\n{\n        // Method is indentation is bigger than the default (8 spaces instead of 4).\n        // After codefix, method itself and line \"int c\" is on expected indent, while \"int d\" gets missaligned.\n        public void WrongIndendation()\n        {\n            int c;\n        int d;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MultipleVariableDeclaration.WrongIndentation.cs",
    "content": "﻿class TestCases\n{\n        // Method is indentation is bigger than the default (8 spaces instead of 4).\n        // After codefix, method itself and line \"int c\" is on expected indent, while \"int d\" gets missaligned.\n        public void WrongIndendation()\n        {\n            int c, d; // Noncompliant\n        }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MultipleVariableDeclaration.cs",
    "content": "﻿namespace Tests.Diagnostics\n{\n    public class MultipleVariableDeclaration\n    {\n        private int /*aaa1*/ a /*aaa2*/,\n            /*bbb1*/ b /*bbb2*/; // Noncompliant\n//                   ^\n        private int c;\n        public MultipleVariableDeclaration(int n)\n        {\n            int /*aaa1*/a = 0 /*aaa2*/, /*bbb1*/ b = 0 /*bbb2*/; // Noncompliant {{Declare 'b' in a separate statement.}}\n//                                               ^\n            int c = 0;\n            for (int i = 0, j = 2; i < 3; i++)\n            {\n\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MultipleVariableDeclaration.vb",
    "content": "﻿Namespace Tests.Diagnostics\n\n    Public Class MultipleVariableDeclaration\n        Public Const AAA As Integer = 5, 'some comment\n            BBB = 42  ' Noncompliant {{Declare 'BBB' in a separate statement.}}\n'           ^^^\n        Public Const DDD As String = \"foo\"\n        Public Sub New(n As Integer)\n            Dim AAA = 1, B As Integer = 5, ' Noncompliant\n                BBB = 42, ' Noncompliant\n                CCC As String = \"foo\"  ' Noncompliant\n            Dim DDD As String = \"foo\"\n        End Sub\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MutableFieldsShouldNotBePublicReadonly.Latest.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Frozen;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Collections.Immutable;\nusing System.Collections.Specialized;\n\nnamespace Tests.Diagnostics\n{\n    public record MutableInitializedWithImmutable\n    {\n        public readonly ISet<string> iSetInitializaedWithImmutableSet = ImmutableHashSet.Create(\"a\", \"b\");\n        public readonly IList<string> iListInitializaedWithImmutableArray = ImmutableArray.Create(\"a\", \"b\");\n        public readonly IList<string> iListInitializaedWithImmutableList = ImmutableList.Create(\"a\", \"b\");\n        public readonly IDictionary<string, string> iDictionaryInitializaedWithImmutableDictionary = ImmutableDictionary.Create<string, string>();\n        public readonly IList<string> iList = null;\n    }\n\n    public record MutableInitializedWithMutable\n    {\n        public readonly ISet<string> isetInitializaedWithHashSet = new HashSet<string> { \"a\", \"b\" };                          // Noncompliant {{Use an immutable collection or reduce the accessibility of the non-private readonly field 'isetInitializaedWithHashSet'.}}\n        //              ^^^^^^^^^^^^\n        public readonly IList<string> iListInitializaedWithList = new List<string> { \"a\", \"b\" };                              // Noncompliant\n        public readonly IDictionary<string, string> iDictionaryInitializaedWithDictionary = new Dictionary<string, string>(); // Noncompliant\n    }\n\n    public record MutableInitializedWithMutablePositional(string Property)\n    {\n        public readonly ISet<string> isetInitializaedWithHashSet = new HashSet<string> { \"a\", \"b\" };                          // Noncompliant\n        public readonly IList<string> iListInitializaedWithList = new List<string> { \"a\", \"b\" };                              // Noncompliant\n        public readonly IDictionary<string, string> iDictionaryInitializaedWithDictionary = new Dictionary<string, string>(); // Noncompliant\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/8638\nnamespace Repro_8638\n{\n    public class FrozenCollections\n    {\n        public readonly FrozenDictionary<string, string> FrozenDictionaryTest = new Dictionary<string, string>().ToFrozenDictionary(); // Compilant\n        public readonly FrozenSet<string> FrozenSetTest = new HashSet<string>().ToFrozenSet(); // Compilant\n    }\n}\n\nnamespace CSharp10\n{\n    public record struct MutableInitializedWithImmutable\n    {\n        public MutableInitializedWithImmutable() { }\n\n        public readonly ISet<string> iSetInitializaedWithImmutableSet = ImmutableHashSet.Create(\"a\", \"b\");\n        public readonly IList<string> iListInitializaedWithImmutableArray = ImmutableArray.Create(\"a\", \"b\");\n        public readonly IList<string> iListInitializaedWithImmutableList = ImmutableList.Create(\"a\", \"b\");\n        public readonly IDictionary<string, string> iDictionaryInitializaedWithImmutableDictionary = ImmutableDictionary.Create<string, string>();\n        public readonly IList<string> iList = null;\n    }\n\n    public record struct MutableInitializedWithMutable\n    {\n        public MutableInitializedWithMutable() { }\n\n        public readonly ISet<string> isetInitializaedWithHashSet = new HashSet<string> { \"a\", \"b\" };                          // Noncompliant {{Use an immutable collection or reduce the accessibility of the non-private readonly field 'isetInitializaedWithHashSet'.}}\n        //              ^^^^^^^^^^^^\n        public readonly IList<string> iListInitializaedWithList = new List<string> { \"a\", \"b\" };                              // Noncompliant\n        public readonly IDictionary<string, string> iDictionaryInitializaedWithDictionary = new Dictionary<string, string>(); // Noncompliant\n    }\n\n    public record struct MutableInitializedWithMutablePositional(string Property)\n    {\n        public readonly ISet<string> isetInitializaedWithHashSet = new HashSet<string> { \"a\", \"b\" };                          // Noncompliant\n        public readonly IList<string> iListInitializaedWithList = new List<string> { \"a\", \"b\" };                              // Noncompliant\n        public readonly IDictionary<string, string> iDictionaryInitializaedWithDictionary = new Dictionary<string, string>(); // Noncompliant\n    }\n\n    public struct MutableInitializedWithMutableStruct\n    {\n        public MutableInitializedWithMutableStruct() { }\n\n        public readonly ISet<string> isetInitializaedWithHashSet = new HashSet<string> { \"a\", \"b\" };                          // Noncompliant\n        public readonly IList<string> iListInitializaedWithList = new List<string> { \"a\", \"b\" };                              // Noncompliant\n        public readonly IDictionary<string, string> iDictionaryInitializaedWithDictionary = new Dictionary<string, string>(); // Noncompliant\n    }\n}\n\nnamespace CSharp13\n{\n    public class NewCollectionTypesUninitialized\n    {\n        public readonly OrderedDictionary<string, string> OrderedDictionary;\n        public readonly ReadOnlySet<string> ReadOnlySet;\n    }\n\n    // https://sonarsource.atlassian.net/browse/NET-388\n    public class NewCollectionTypesInitializedWithMutable(HashSet<string> set)\n    {\n        public readonly OrderedDictionary<string, string> OrderedDictionary = new(); // Noncompliant\n        public readonly ReadOnlySet<string> ReadOnlySet = new(set);                  // Compliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MutableFieldsShouldNotBePublicReadonly.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Collections.Immutable;\n\nnamespace Tests.Diagnostics\n{\n    public class Foo : ICollection<string>\n    {\n        public int Count { get; }\n        public bool IsReadOnly { get; }\n\n        public void Add(string item)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public void Clear()\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public bool Contains(string item)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public void CopyTo(string[] array, int arrayIndex)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public IEnumerator<string> GetEnumerator()\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public bool Remove(string item)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            throw new System.NotImplementedException();\n        }\n    }\n    public class Bar : ReadOnlyCollection<string>\n    {\n        public Bar(IList<string> list)\n            : base(list)\n        {\n        }\n    }\n\n    public class NotPublicAndReadonly\n    {\n        public string[] notReadonlyStrings;\n        protected readonly bool[] bools;\n        private readonly int[] ints;\n        internal readonly float[] floats;\n\n        private class NotEffectivelyPublic\n        {\n            public readonly string[] strings;\n        }\n    }\n\n    public class ImmutableUninitialized<T>\n    {\n        public readonly ReadOnlyCollection<string> readonlyCollectionString;\n        public readonly ReadOnlyDictionary<string, string> readonlyDictionaryStrings;\n        public readonly IReadOnlyList<string> iReadonlyListString;\n        public readonly IReadOnlyCollection<string> iReadonlyCollectionString;\n        public readonly IReadOnlyDictionary<string, string> iReadonlyDictionaryStrings;\n        public readonly Bar bar;\n        public readonly IImmutableDictionary<string, string> iImmutableDictionary;\n        public readonly IImmutableList<string> iImmutableList;\n        public readonly IImmutableQueue<string> iImmutableQueue;\n        public readonly IImmutableSet<string> iImmutableSet;\n        public readonly IImmutableStack<string> iImmutableStack;\n        public readonly ImmutableArray<string> immutableArray;\n        public readonly ImmutableSortedSet<string> immutableSortedSet;\n        public static readonly ImmutableSortedSet<string> staticReadonlyImmutableSortedSet;\n        public readonly ImmutableSortedSet<T> genericImmutableSortedSet;\n    }\n\n    public class MutableInitializedWithImmutable\n    {\n        public readonly ISet<string> iSetInitializaedWithImmutableSet = ImmutableHashSet.Create(\"a\", \"b\");\n        public readonly IList<string> iListInitializaedWithImmutableArray = ImmutableArray.Create(\"a\", \"b\");\n        public readonly IList<string> iListInitializaedWithImmutableList = ImmutableList.Create(\"a\", \"b\");\n        public readonly IDictionary<string, string> iDictionaryInitializaedWithImmutableDictionary = ImmutableDictionary.Create<string, string>();\n        public readonly IList<string> iList = null;\n    }\n\n    public class MutableInitializedWithMutable\n    {\n        public readonly ISet<string> isetInitializaedWithHashSet = new HashSet<string> { \"a\", \"b\" }; // Noncompliant {{Use an immutable collection or reduce the accessibility of the non-private readonly field 'isetInitializaedWithHashSet'.}}\n//                      ^^^^^^^^^^^^\n        public readonly IList<string> iListInitializaedWithList = new List<string> { \"a\", \"b\" }; // Noncompliant\n        public readonly IDictionary<string, string> iDictionaryInitializaedWithDictionary = new Dictionary<string, string>(); // Noncompliant\n    }\n\n    public class HandleFieldWithMultipleVariables\n    {\n        public readonly string validfield;\n        public readonly ISet<string> set1 = new HashSet<string>(), set2 = new HashSet<string>(); // Noncompliant {{Use an immutable collection or reduce the accessibility of the non-private readonly fields 'set1' and 'set2'.}}\n    }\n\n    // When the types are uninitialized, this is equivalent to being initialized to null so we don't report\n    public class MutableUninitialized\n    {\n        public readonly string[] strings;\n        public readonly Array array;\n        public readonly List<string> listString;\n        public readonly LinkedList<string> linkedListString;\n        public readonly SortedList<string, string> sortedListString;\n        public readonly ObservableCollection<string> observableCollectionString;\n        public readonly Foo foo;\n\n        public readonly ICollection<string> iCollectionString;\n        public readonly IList<string> iListString;\n        public readonly ISet<string> set1, set2;\n    }\n\n    // Issue #1491: https://github.com/SonarSource/sonar-dotnet/issues/1491\n    public class MutableInitializedWithImmutableInConstructor\n    {\n        public readonly string[] foo; // Compliant - set to null in ctor\n        public readonly ISet<string> set; // Compliant - set to immutable in ctor\n\n        MutableInitializedWithImmutableInConstructor()\n        {\n            foo = null;\n            set = ImmutableHashSet.Create(\"a\", \"b\");\n        }\n    }\n\n    public class MutableInitializedInConstructors\n    {\n        public readonly ISet<string> set; // Noncompliant - one of the ctor sets a mutable type\n\n        MutableInitializedInConstructors()\n        {\n            set = ImmutableHashSet.Create(\"a\", \"b\");\n        }\n\n        MutableInitializedInConstructors(string s)\n        {\n            set = new HashSet<string>();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MutableFieldsShouldNotBePublicStatic.Latest.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Frozen;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Collections.Immutable;\nusing System.Collections.Specialized;\n\nnamespace Tests.Diagnostics\n{\n    public record WhenNonReadonlyAlwaysReport\n    {\n        public static ISet<string> iSetInitializaedWithImmutableSet = ImmutableHashSet.Create(\"a\", \"b\");   // Noncompliant {{Use an immutable collection or reduce the accessibility of the public static field 'iSetInitializaedWithImmutableSet'.}}\n        //            ^^^^^^^^^^^^\n        public static IList<string> iListInitializaedWithImmutableArray = ImmutableArray.Create(\"a\", \"b\"); // Noncompliant\n        public static IList<string> iListInitializaedWithImmutableList = ImmutableList.Create(\"a\", \"b\");   // Noncompliant\n        public static IDictionary<string, string> iDictionaryInitializaedWithImmutableDictionary = ImmutableDictionary.Create<string, string>(); // Noncompliant\n        public static IList<string> iList = null;                                                                                                // Noncompliant\n        public static ISet<string> isetInitializaedWithHashSet = new HashSet<string> { \"a\", \"b\" };                                               // Noncompliant\n        public static IList<string> iListInitializaedWithList = new List<string> { \"a\", \"b\" };                                                   // Noncompliant\n        public static IDictionary<string, string> iDictionaryInitializaedWithDictionary = new Dictionary<string, string>();                      // Noncompliant\n        public static string[] strings;                                        // Noncompliant\n        public static Array array;                                             // Noncompliant\n        public static List<string> listString;                                 // Noncompliant\n        public static LinkedList<string> linkedListString;                     // Noncompliant\n        public static SortedList<string, string> sortedListString;             // Noncompliant\n        public static ObservableCollection<string> observableCollectionString; // Noncompliant\n        public static ICollection<string> iCollectionString;                   // Noncompliant\n        public static IList<string> iListString;                               // Noncompliant\n    }\n\n    public record WhenReadonlyAndInitializedToImmutable\n    {\n        public static readonly ISet<string> iSetInitializaedWithImmutableSet = ImmutableHashSet.Create(\"a\", \"b\");\n        public static readonly IList<string> iListInitializaedWithImmutableArray = ImmutableArray.Create(\"a\", \"b\");\n        public static readonly IList<string> iListInitializaedWithImmutableList = ImmutableList.Create(\"a\", \"b\");\n        public static readonly IDictionary<string, string> iDictionaryInitializaedWithImmutableDictionary = ImmutableDictionary.Create<string, string>();\n        public static readonly IList<string> iList = null;\n    }\n\n    public record WhenNonReadonlyAlwaysReportPositional(string Property, int Value)\n    {\n        public static ISet<string> iSetInitializaedWithImmutableSet = ImmutableHashSet.Create(\"a\", \"b\");   // Noncompliant\n        public static IList<string> iListInitializaedWithImmutableArray = ImmutableArray.Create(\"a\", \"b\"); // Noncompliant\n        public static IList<string> iListInitializaedWithImmutableList = ImmutableList.Create(\"a\", \"b\");   // Noncompliant\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/8638\nnamespace Repro_8638\n{\n    public class FrozenCollections\n    {\n        public static FrozenDictionary<string, string> FrozenDictionaryTest = new Dictionary<string, string>().ToFrozenDictionary(); // Compilant\n        public static FrozenSet<string> FrozenSetTest = new HashSet<string>().ToFrozenSet(); // Compilant\n    }\n}\n\nnamespace CSharp10\n{\n    public record struct WhenNonReadonlyAlwaysReport\n    {\n        public static ISet<string> iSetInitializaedWithImmutableSet = ImmutableHashSet.Create(\"a\", \"b\");   // Noncompliant {{Use an immutable collection or reduce the accessibility of the public static field 'iSetInitializaedWithImmutableSet'.}}\n        //            ^^^^^^^^^^^^\n        public static IList<string> iListInitializaedWithImmutableArray = ImmutableArray.Create(\"a\", \"b\"); // Noncompliant\n        public static IList<string> iListInitializaedWithImmutableList = ImmutableList.Create(\"a\", \"b\");   // Noncompliant\n        public static IDictionary<string, string> iDictionaryInitializaedWithImmutableDictionary = ImmutableDictionary.Create<string, string>(); // Noncompliant\n        public static IList<string> iList = null;                                                                                                // Noncompliant\n        public static ISet<string> isetInitializaedWithHashSet = new HashSet<string> { \"a\", \"b\" };                                               // Noncompliant\n        public static IList<string> iListInitializaedWithList = new List<string> { \"a\", \"b\" };                                                   // Noncompliant\n        public static IDictionary<string, string> iDictionaryInitializaedWithDictionary = new Dictionary<string, string>();                      // Noncompliant\n        public static string[] strings;                                        // Noncompliant\n        public static Array array;                                             // Noncompliant\n        public static List<string> listString;                                 // Noncompliant\n        public static LinkedList<string> linkedListString;                     // Noncompliant\n        public static SortedList<string, string> sortedListString;             // Noncompliant\n        public static ObservableCollection<string> observableCollectionString; // Noncompliant\n        public static ICollection<string> iCollectionString;                   // Noncompliant\n        public static IList<string> iListString;                               // Noncompliant\n    }\n\n    public record struct WhenReadonlyAndInitializedToImmutable\n    {\n        public static readonly ISet<string> iSetInitializaedWithImmutableSet = ImmutableHashSet.Create(\"a\", \"b\");\n        public static readonly IList<string> iListInitializaedWithImmutableArray = ImmutableArray.Create(\"a\", \"b\");\n        public static readonly IList<string> iListInitializaedWithImmutableList = ImmutableList.Create(\"a\", \"b\");\n        public static readonly IDictionary<string, string> iDictionaryInitializaedWithImmutableDictionary = ImmutableDictionary.Create<string, string>();\n        public static readonly IList<string> iList = null;\n    }\n\n    public record struct WhenNonReadonlyAlwaysReportPositional(string Property)\n    {\n        public static ISet<string> iSetInitializaedWithImmutableSet = ImmutableHashSet.Create(\"a\", \"b\");   // Noncompliant\n        public static IList<string> iListInitializaedWithImmutableArray = ImmutableArray.Create(\"a\", \"b\"); // Noncompliant\n        public static IList<string> iListInitializaedWithImmutableList = ImmutableList.Create(\"a\", \"b\");   // Noncompliant\n    }\n\n    public struct WhenNonReadonlyAlwaysReportStruct\n    {\n        public static ISet<string> iSetInitializaedWithImmutableSet = ImmutableHashSet.Create(\"a\", \"b\");   // Noncompliant\n        public static IList<string> iListInitializaedWithImmutableArray = ImmutableArray.Create(\"a\", \"b\"); // Noncompliant\n        public static IList<string> iListInitializaedWithImmutableList = ImmutableList.Create(\"a\", \"b\");   // Noncompliant\n    }\n}\n\nnamespace CSharp13\n{\n    public class OrderedDictionary\n    {\n        public static OrderedDictionary<string, string> orderedDictionary; // Noncompliant\n        public static OrderedDictionary<string, string> a, b;              // Noncompliant\n        public static readonly OrderedDictionary<string, string> orderedDictionary2;\n        public static readonly OrderedDictionary<string, string> a2, b2;\n    }\n\n    // https://sonarsource.atlassian.net/browse/NET-389\n    public class ReadOnlySet\n    {\n        public static ReadOnlySet<string> readonlySet;                     // Compliant\n        public static readonly ReadOnlySet<string> readonlySet2;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/MutableFieldsShouldNotBePublicStatic.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Collections.Immutable;\n\nnamespace Tests.Diagnostics\n{\n    public class Foo : ICollection<string>\n    {\n        public int Count { get; }\n        public bool IsReadOnly { get; }\n\n        public void Add(string item)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public void Clear()\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public bool Contains(string item)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public void CopyTo(string[] array, int arrayIndex)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public IEnumerator<string> GetEnumerator()\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public bool Remove(string item)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            throw new System.NotImplementedException();\n        }\n    }\n\n    public class Bar : ReadOnlyCollection<string>\n    {\n        public Bar(IList<string> list) : base(list)\n        {\n        }\n    }\n\n    public class NotPublicAndStatic\n    {\n        public string[] notReadonlyStrings;\n        protected static bool[] bools;\n        private static int[] ints;\n        internal static float[] floats;\n\n        private class NotEffectivelyPublic\n        {\n            public static string[] strings;\n        }\n    }\n\n    public class ImmutableUninitialized<T>\n    {\n        public static ReadOnlyCollection<string> readonlyCollectionString;\n        public static ReadOnlyDictionary<string, string> readonlyDictionaryStrings;\n        public static IReadOnlyList<string> iReadonlyListString;\n        public static IReadOnlyCollection<string> iReadonlyCollectionString;\n        public static IReadOnlyDictionary<string, string> iReadonlyDictionaryStrings;\n        public static Bar bar;\n        public static IImmutableDictionary<string, string> iImmutableDictionary;\n        public static IImmutableList<string> iImmutableList;\n        public static IImmutableQueue<string> iImmutableQueue;\n        public static IImmutableSet<string> iImmutableSet;\n        public static IImmutableStack<string> iImmutableStack;\n        public static ImmutableArray<string> immutableArray;\n        public static ImmutableSortedSet<string> immutableSortedSet;\n        public static ImmutableSortedSet<T> genericImmutableSortedSet;\n        public static readonly ImmutableSortedSet<string> staticReadonlyImmutableSortedSet;\n    }\n\n    public class WhenNonReadonlyAlwaysReport\n    {\n        public static ISet<string> iSetInitializaedWithImmutableSet = ImmutableHashSet.Create(\"a\", \"b\"); // Noncompliant {{Use an immutable collection or reduce the accessibility of the public static field 'iSetInitializaedWithImmutableSet'.}}\n//                    ^^^^^^^^^^^^\n        public static IList<string> iListInitializaedWithImmutableArray = ImmutableArray.Create(\"a\", \"b\"); // Noncompliant\n        public static IList<string> iListInitializaedWithImmutableList = ImmutableList.Create(\"a\", \"b\"); // Noncompliant\n        public static IDictionary<string, string> iDictionaryInitializaedWithImmutableDictionary = ImmutableDictionary.Create<string, string>(); // Noncompliant\n        public static IList<string> iList = null; // Noncompliant\n        public static ISet<string> isetInitializaedWithHashSet = new HashSet<string> { \"a\", \"b\" }; // Noncompliant\n        public static IList<string> iListInitializaedWithList = new List<string> { \"a\", \"b\" }; // Noncompliant\n        public static IDictionary<string, string> iDictionaryInitializaedWithDictionary = new Dictionary<string, string>(); // Noncompliant\n        public static string[] strings; // Noncompliant\n        public static Array array; // Noncompliant\n        public static List<string> listString; // Noncompliant\n        public static LinkedList<string> linkedListString; // Noncompliant\n        public static SortedList<string, string> sortedListString; // Noncompliant\n        public static ObservableCollection<string> observableCollectionString; // Noncompliant\n        public static Foo foo; // Noncompliant\n        public static ICollection<string> iCollectionString; // Noncompliant\n        public static IList<string> iListString; // Noncompliant\n    }\n\n    public class HandleFieldWithMultipleVariables\n    {\n        public static string validfield;\n        public static ISet<string> set1, set2; // Noncompliant {{Use an immutable collection or reduce the accessibility of the public static fields 'set1' and 'set2'.}}\n    }\n\n    public class WhenReadonlyAndInitializedToImmutable\n    {\n        public static readonly ISet<string> iSetInitializaedWithImmutableSet = ImmutableHashSet.Create(\"a\", \"b\");\n        public static readonly IList<string> iListInitializaedWithImmutableArray = ImmutableArray.Create(\"a\", \"b\");\n        public static readonly IList<string> iListInitializaedWithImmutableList = ImmutableList.Create(\"a\", \"b\");\n        public static readonly IDictionary<string, string> iDictionaryInitializaedWithImmutableDictionary = ImmutableDictionary.Create<string, string>();\n        public static readonly IList<string> iList = null;\n    }\n\n    public class WhenReadonlyAndInitializedToImmutableInConstructor\n    {\n        public static readonly string[] foo; // Compliant - set to null in ctor\n        public static readonly ISet<string> set; // Compliant - set to immutable in ctor\n\n        static WhenReadonlyAndInitializedToImmutableInConstructor()\n        {\n            foo = null;\n            set = ImmutableHashSet.Create(\"a\", \"b\");\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/NameOfShouldBeUsed.CSharp11.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        public void Method_With_RawStringLiterals(int arg1, string argument)\n        {\n            if (arg1 < 0)\n                throw new Exception(\"\"\"arg1\"\"\"); // Noncompliant\n            else if (arg1 < 1)\n                throw new ArgumentException(\"\"\"Bad parameter name\"\"\", \"\"\"arg1\"\"\"); // Noncompliant\n            else if (arg1 < 2)\n                throw new ArgumentOutOfRangeException(\"\"\"\n                    arg1\n                    \"\"\"); // Noncompliant@-2\n            else if (arg1 < 3)\n                throw new Exception($\"\"\"argument {argument}\"\"\"); // Noncompliant\n//                                      ^^^^^^^^^\n            else if (arg1 < 4)\n                throw new Exception($\"\"\"arg1 {arg1}\"\"\"); // Compliant (parameter length 4, minimum allowed to raise 5)\n            else\n                throw new Exception($\"\"\"{nameof(argument)} should not be used with value {argument}\"\"\"); // Compliant\n        }\n\n\n        public void Method_With_NewLinesInStringInterpolation(int arg1)\n        {\n            string argName = \"arg1\";\n            if (arg1 < 0)\n            {\n                throw new Exception($\"{\n                    arg1 switch\n                    {\n                        < 0 => \"arg1\",  // Noncompliant\n                        _ => \"Can't touch this\",\n                    }}\");\n            }\n            else\n            {\n                throw new Exception($$\"\"\"arg1\"\"\"); // Noncompliant\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/NameOfShouldBeUsed.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        public void Method_01(int arg1, int argument)\n        {\n            if (arg1 < 0)\n                throw new Exception(\"arg1\"); // Noncompliant {{Replace the string 'arg1' with 'nameof(arg1)'.}}\n//                                  ^^^^^^\n\n            if (arg1 < 0)\n                throw new ArgumentException(\"arg1\"); // Noncompliant {{Replace the string 'arg1' with 'nameof(arg1)'.}}\n\n            if (arg1 < 0)\n                throw new ArgumentException(\"Bad parameter name\", \"arg1\"); // Noncompliant {{Replace the string 'arg1' with 'nameof(arg1)'.}}\n\n            if (arg1 < 0)\n                throw new ArgumentException(\"argument\", \"arg1\"); // Noncompliant {{Replace the string 'argument' with 'nameof(argument)'.}}\n                                                                 // Noncompliant@-1 {{Replace the string 'arg1' with 'nameof(arg1)'.}}\n\n            const string foo = \"arg1\";\n\n            ValidateArgument(arg1, \"arg1\");\n\n            if (\"arg1\" == foo)\n                return;\n\n            throw new ArgumentException\n            {\n                Source = \"arg1\"                       // Noncompliant\n            };\n\n            throw new ArgumentException\n            {\n                Source = \"argument123\"\n            };\n\n            throw new ArgumentException(\"argument \"); // Noncompliant\n            throw new ArgumentException(\"argument,\"); // Noncompliant\n            throw new ArgumentException(\"argument!\"); // Noncompliant\n            throw new ArgumentException(\"argument?\"); // Noncompliant\n\n            throw new ArgumentException(\"argument123\");\n            throw new ArgumentException(\"ARGUMENT\");\n            throw new ArgumentException(\"arg \"); // too short name\n            throw new ArgumentException(\"arg!\"); // too short name\n\n            throw new ArgumentException(\"This is argument.\"); // Noncompliant\n            throw new ArgumentException(\"This is argument.\", nameof(argument));\n            throw new ArgumentException(\"argument and arg1\"); // Noncompliant\n            throw new ArgumentException(\"argument and arg1\", nameof(arg1));\n\n            throw new ArgumentNullException(\"arg1\"); // Noncompliant\n            throw new ArgumentNullException(nameof(arg1));\n            throw new ArgumentNullException(nameof(argument), \"argument\");\n            throw new ArgumentNullException(nameof(argument), \"Incorrect argument value\");\n\n            throw new ArgumentOutOfRangeException(\"arg1\"); // Noncompliant\n            throw new ArgumentOutOfRangeException(nameof(arg1));\n            throw new ArgumentOutOfRangeException(nameof(argument), \"argument\");\n            throw new ArgumentOutOfRangeException(nameof(argument), \"Incorrect argument value\");\n            throw new ArgumentOutOfRangeException(nameof(argument), argument, \"argument\");\n            throw new ArgumentOutOfRangeException(nameof(argument), argument, \"Incorrect argument value\");\n\n            var ex1 = new ArgumentException(\"This is argument.\"); // FN\n            throw ex1;\n            var ex2 = new ArgumentException(\"This is argument.\", nameof(argument));\n            throw ex2;\n\n            throw new ArgumentException(nameof(argument), nameof(arg1), new ArgumentException(\"argument\", nameof(arg1)));\n        }\n\n        private void ValidateArgument(int v, string longName)\n        {\n            if (v < 0)\n                throw new ArgumentOutOfRangeException(\"longName\"); // Noncompliant\n            if (v < 0)\n                throw new Exception(nameof(longName));\n            if (v < 0)\n                throw new Exception($\"{nameof(longName)} should not be used with value {longName}\");\n        }\n\n        public Program(int arg1, int arg2)\n        {\n            if (arg1 < 0)\n                throw new Exception(\"arg1\"); // Noncompliant\n        }\n\n        public Program(string argument, int arg2, object anotherArgument)\n        {\n            if (argument == null || argument.Length == 0)\n                throw new Exception($\"Argument argument with value \\\"{argument}\\\" is not valid\"); // Noncompliant  {{Replace the string 'argument' with 'nameof(argument)'.}}\n//                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n            throw new Exception($\"argument\"); // Noncompliant\n            throw new Exception($\"anotherArgument argument argument value \\\"{argument}\\\" is not valid\"); // Noncompliant  {{Replace the string 'argument' with 'nameof(argument)'.}}\n            throw new Exception(\"argument anotherArgument argument anotherArgument\");  // Noncompliant  {{Replace the string 'argument' with 'nameof(argument)'.}}\n        }\n\n        public bool Method_02(int arg1, int arg1) // Error [CS0100] - duplicated args\n        {\n            throw new Exception(\"arg1\");\n        }\n\n        public bool MethodWithUnnecessaryParams(int a, int two, int of, int that)\n        {\n            throw new Exception(\"of type\");\n            throw new Exception(\"I have a car\");\n            throw new Exception($\"I have two cars\");\n            throw new Exception($\"I have that problem\");\n        }\n\n        public bool SameStringTokens(int argumentName)\n        {\n            throw new ArgumentException(\"argumentName\", \"argumentName\"); // Noncompliant\n            // Noncompliant@-1\n            throw new Exception(\"argumentName\"); // Noncompliant\n            throw new ArgumentException(\"argumentName argumentName argumentName\"); // Noncompliant (only one message)\n            throw new ArgumentException(\"argumentName argumentName argumentName\"); // Noncompliant\n            throw new Exception($\"argumentName argumentName argumentName\"); // Noncompliant (only one message)\n            throw new Exception($\"argumentName argumentName argumentName\"); // Noncompliant\n            throw new Exception($\"argumentName\"); // Noncompliant\n            throw new Exception($\"argumentName\"); // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/NameOfShouldBeUsed.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.Linq\nImports System.Text\n\nNamespace Tests.TestCases\n    Class Program\n        Public Sub Method_00\n            Throw New Exception(\"arg1\")\n        End Sub\n\n        Public Sub Method_01(arg1 As Integer, argument As Integer)\n            If arg1 < 0 Then\n                Throw New Exception(\"arg1\") ' Noncompliant {{Replace the string 'arg1' with 'NameOf(arg1)'.}}\n'                                   ^^^^^^\n            End If\n\n            If ARG1 < 0 Then\n                Throw New ArgumentException(\"ARG1\") ' Noncompliant {{Replace the string 'arg1' with 'NameOf(arg1)'.}}\n            End If\n\n            Const foo As String = \"arg1\"\n\n            ValidateArgument(arg1, \"arg1\")\n\n            If \"arg1\" = foo Then\n                Return\n            End If\n\n            Throw New ArgumentException\n\n            Throw New ArgumentException(\"argument \") ' Noncompliant\n            Throw New ArgumentException(\"argument,\") ' Noncompliant\n\n            Throw New ArgumentException(\"argument!\") ' Noncompliant\n            Throw New ArgumentException(\"argument?\") ' Noncompliant\n            Throw New ArgumentException(\"ARGUMENT\") ' Noncompliant\n\n            Throw New ArgumentException(\"arg \") ' too short name\n            Throw New ArgumentException(\"argument123\")\n            Throw New ArgumentException(\"arg123\")\n\n            Throw New ArgumentException(\"This is argument.\") ' Noncompliant\n            Throw New ArgumentException(\"This is argument.\", NameOf(argument))\n            Throw New ArgumentException(\"argument and arg1\") ' Noncompliant\n            Throw New ArgumentException(\"argument and arg1\", NameOf(arg1))\n\n            Throw New aRGUMENTeXCEPTION(\"This is ARGUMENT.\") ' Noncompliant\n            Throw New aRGUMENTeXCEPTION(\"This is ARGUMENT.\", NameOf(argument))\n            Throw New aRGUMENTeXCEPTION(\"ARGUMENT and ARG1\") ' Noncompliant\n            Throw New aRGUMENTeXCEPTION(\"ARGUMENT and ARG1\", NameOf(arg1))\n\n            Throw New ArgumentNullException(\"arg1\") ' Noncompliant\n            Throw New ArgumentNullException(NameOf(arg1))\n            Throw New ArgumentNullException(NameOf(argument), \"argument\")\n            Throw New ArgumentNullException(NameOf(argument), \"Incorrect argument value\")\n\n            Throw New ArgumentOutOfRangeException(\"arg1\") ' Noncompliant\n            Throw New ArgumentOutOfRangeException(NameOf(arg1))\n            Throw New ArgumentOutOfRangeException(NameOf(argument), \"argument\")\n            Throw New ArgumentOutOfRangeException(NameOf(argument), \"Incorrect argument value\")\n            Throw New ArgumentOutOfRangeException(NameOf(argument), argument, \"argument\")\n            Throw New ArgumentOutOfRangeException(NameOf(argument), argument, \"Incorrect argument value\")\n\n            Dim ex1 as ArgumentException\n            ex1 = New ArgumentException(\"This is argument.\") ' FN\n            Throw ex1\n            Dim ex2 as ArgumentException\n            ex2 = New ArgumentException(\"This is argument.\", NameOf(argument))\n            Throw ex2\n\n            Throw New ArgumentException(NameOf(argument), NameOf(arg1), New ArgumentException(\"argument\", NameOf(arg1)))\n        End Sub\n\n        Private Sub ValidateArgument(v As Integer, name As String)\n            If v < 0 Then\n                Throw New ArgumentOutOfRangeException(\"name\") ' Noncompliant\n            End If\n\n            If v < 0 Then\n                Throw New Exception(NameOf(name))\n            End If\n\n            If v < 0 Then\n                Throw New Exception($\"{NameOf(name)} is not valid with value {name}\")\n            End If\n\n        End Sub\n\n        Public Sub New(arg1 As String, argument As Integer, anotherArgument As String)\n            If arg1 is Nothing Or arg1.Length = 0 Then\n                Throw New Exception($\"The arg1 with value {arg1} is not valid\") ' too short\n            End If\n\n            Throw New Exception($\"argument with value {argument} is not valid\") ' Noncompliant\n'                                 ^^^^^^^^^^^^^^^^^^^^\n            Throw New Exception($\"arg1\") ' Noncompliant\n\n            Throw New Exception(\"anotherArgument argument argument value \"\"{argument}\"\" is not valid\") ' Noncompliant\n            Throw New Exception(\"argument anotherArgument argument anotherArgument\") ' Noncompliant\n        End Sub\n\n        Public Function Method_03(arg1 As Integer, arg2 As Integer) As Boolean\n            Throw New Exception(\"arg2\") ' Noncompliant\n        End Function\n\n        Public Function SameStringTokens(argumentName As Integer) As Boolean\n            Throw New ArgumentException(\"argumentName\", \"argumentName\") ' Noncompliant\n            ' Noncompliant@-1\n            Throw New Exception(\"argumentName\") ' Noncompliant\n            Throw New ArgumentException(\"argumentName argumentName argumentName\") ' Noncompliant (only one message)\n            Throw New ArgumentException(\"argumentName argumentName argumentName\") ' Noncompliant\n            Throw New Exception($\"argumentName argumentName argumentName\") ' Noncompliant (only one message)\n            Throw New Exception($\"argumentName argumentName argumentName\") ' Noncompliant\n            Throw New Exception(\"argumentName\") ' Noncompliant\n            Throw New Exception(\"argumentName\") ' Noncompliant\n        End Function\n    End Class\n\n    Public Interface EmberTVScraperModule\n\n        Sub SubWithNoBody()\n\n        Function FunctionWithNoBody() As Boolean\n\n    End Interface\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/NamedPlaceholdersShouldBeUnique.cs",
    "content": "﻿using System;\n\nnamespace MicrosoftTests\n{\n    using Microsoft.Extensions.Logging;\n\n    public class Program\n    {\n        void Compliant(ILogger logger, string foo, string bar)\n        {\n            var args = new object[] { foo, bar };\n\n            Console.WriteLine(\"Hey {foo} and {foo}\");                       // Compliant\n\n            // Do not raise on duplicate indexes\n            logger.LogDebug(\"Hey {0} and {foo} and {0}\", foo, foo, bar);    // Compliant\n            logger.LogTrace(\"Hey {0} and {0}\", foo, bar);                   // Compliant\n\n            // Do not raise on wildcard placeholder\n            logger.LogError(\"Hey {_} and {_}\", foo, bar);                   // Compliant\n            logger.LogError(\"Hey {_} and {_0}\", foo, bar);                  // Compliant\n\n            logger.Log(LogLevel.Trace, \"Hey {foo} and {bar}\", foo, bar);    // Compliant\n\n            // Out of order\n            logger.LogError(args: args, message: \"Hey {foo} and {bar}\");    // Compliant\n\n            // Calling as static method\n            LoggerExtensions.LogCritical(logger, \"Hey {foo} and {bar}\", foo, bar);                  // Compliant\n            LoggerExtensions.LogDebug(message: \"Hey {foo} and {bar}\", logger: logger, args: args);  // Compliant\n\n            // Custom type not implementing ILogger\n            new NotLogger().LogDebug(\"Hey {foo} and {foo}\", foo, foo);      // Compliant\n            new NotLogger().LogCritical(\"Hey {foo} and {foo}\", foo, foo);   // Compliant\n\n            // Invalid template syntaxs\n            logger.LogInformation(\"Hey foo} and {foo}\", foo, foo);           // Compliant\n            logger.LogInformation(\"Hey {foo and {foo}\", foo, foo);           // Compliant\n            logger.LogInformation(\"Hey {foo} and {foo\", foo, foo);           // Compliant\n            logger.LogInformation(\"Hey {foo} and {&foo}\", foo);              // Compliant\n            logger.LogInformation(\"Hey {foo} and {@foo,INVALID}\", foo);      // Compliant\n            logger.LogInformation(\"Hey {foo} and {@foo#}\", foo);             // Compliant\n\n            // Escaped\n            logger.LogInformation(\"Hey {{foo}} and {{foo}}\", foo, foo);      // Compliant\n            logger.LogInformation(\"Hey {foo} and {{foo}}\", foo, foo);        // Compliant\n\n            // Contains Interpolation\n            logger.LogWarning($\"Hey {foo} and {foo}\", foo, foo);                    // Compliant\n            logger.LogWarning($\"Hey {foo}\" + \"and {foo}\", foo, foo);                // Compliant\n            logger.LogInformation(\"Hey {foo}\" + $\"and {foo}\" + \"{foo}\", foo, foo);  // FN due to interpolation being ignored in complex cases\n\n            // Contains Identifier name\n            logger.LogWarning(\"Hey {\" + foo + \"} and {\" + foo + \"}\");        // Compliant\n\n            logger.LogInformation($\"Hey {{foo}} and {{foo}}\", foo, foo);     // Noncompliant\n                                                                             // Secondary @-1\n            logger.LogInformation(\"Hey\" + \"{\" + \"foo} and {foo\" +\"}\");       // FN\n\n            logger.LogInformation(true ? \"Hey {foo}\" : \"Hi {foo}\", foo);     // Compliant\n        }\n\n        void Noncompliant(ILogger logger, string foo, string bar, string baz, Exception ex, EventId eventId)\n        {\n            logger.Log(LogLevel.Trace, \"Hey {foo} and {foo}\", foo, bar);\n            //                               ^^^ {{Message template placeholder 'foo' is not unique.}}\n            //                                         ^^^ Secondary @-1 {{Message template placeholder 'foo' is not unique.}}\n\n            logger.LogInformation(\"Hey {foo} and {foo} and {foo}\", foo, bar);\n            //                          ^^^ {{Message template placeholder 'foo' is not unique.}}\n            //                                    ^^^ Secondary @-1\n            //                                              ^^^ Secondary @-2\n\n            logger.LogInformation(\"Hey {foo} and {foo} and {foo} and {bar}\", foo, foo, foo, bar);\n            //                          ^^^ {{Message template placeholder 'foo' is not unique.}}\n            //                                    ^^^ Secondary @-1 {{Message template placeholder 'foo' is not unique.}}\n            //                                              ^^^ Secondary @-2 {{Message template placeholder 'foo' is not unique.}}\n\n            logger.LogCritical(\"Hey {foo} and {bar} and {foo} and {bar}\", foo, bar, foo, bar);\n            //                       ^^^ {{Message template placeholder 'foo' is not unique.}}\n            //                                           ^^^ Secondary @-1 {{Message template placeholder 'foo' is not unique.}}\n            //                                 ^^^ @-2 {{Message template placeholder 'bar' is not unique.}}\n            //                                                     ^^^ Secondary @-3 {{Message template placeholder 'bar' is not unique.}}\n\n            logger.LogDebug(\"Hey {foo} and {bar} and {foo} and {bar} and {baz} {baz}\", foo, bar, foo, bar, baz, baz);\n            //                    ^^^ {{Message template placeholder 'foo' is not unique.}}\n            //                                        ^^^ Secondary @-1\n            //                              ^^^ @-2 {{Message template placeholder 'bar' is not unique.}}\n            //                                                  ^^^ Secondary @-3\n            //                                                            ^^^ @-4 {{Message template placeholder 'baz' is not unique.}}\n            //                                                                  ^^^ Secondary @-5\n\n            logger.LogTrace(\"Hey {foo} and {0} and {foo} and {bar} and {0} {baz}\", foo, bar, foo, bar, baz, baz);\n            //                    ^^^ {{Message template placeholder 'foo' is not unique.}}\n            //                                      ^^^ Secondary @-1\n\n            LoggerExtensions.LogWarning(logger, \"Hey {foo} {foo} and {bar} and {0} {baz}\", foo, foo, bar, baz, baz); // Noncompliant\n                                                                                                                     // Secondary @-1\n            LoggerExtensions.LogError(message: \"Hey {foo} {foo} and {bar} and {0} {baz}\", logger: logger, args: Array.Empty<object>()); // Noncompliant\n                                                                                                                                        // Secondary @-1\n\n            LoggerExtensions.LogInformation(logger, args: Array.Empty<object>(), message: \"Hey {foo} and {foo}\"); // Noncompliant\n                                                                                                                  // Secondary @-1\n\n            logger.Log(LogLevel.Trace, args: new[] { foo, foo }, message: \"Hey {foo} and {foo}\"); // Noncompliant\n                                                                                                  // Secondary @-1\n\n            // Grammar checks\n            logger.LogInformation(\"Hey {foo} and {$foo} and {@foo}\", foo, bar);\n            //                          ^^^ {{Message template placeholder 'foo' is not unique.}}\n            //                                     ^^^ Secondary @-1\n            //                                                ^^^ Secondary @-2\n\n            logger.LogInformation(\"Hey {foo} and {foo,42} and {foo:format} and {foo,-42:for_{_mat}\", foo, bar);\n            //                          ^^^ {{Message template placeholder 'foo' is not unique.}}\n            //                                    ^^^ Secondary @-1\n            //                                                 ^^^ Secondary @-2\n            //                                                                  ^^^ Secondary @-3\n\n            logger.LogInformation(\"Hey {_foo} and {_foo42} and {_foo42} and {_foo}\", foo, bar);\n            //                          ^^^^ {{Message template placeholder '_foo' is not unique.}}\n            //                                                               ^^^^ Secondary @-1\n            //                                     ^^^^^^ @-2 {{Message template placeholder '_foo42' is not unique.}}\n            //                                                  ^^^^^^ Secondary @-3\n\n            // Multiline\n            logger.LogDebug(\n                message: \"Hey {foo} and {foo}\",\n            //                 ^^^ {{Message template placeholder 'foo' is not unique.}}\n            //                           ^^^ Secondary @-1\n                eventId: eventId,\n                exception: ex,\n                args: new[] { foo, foo });\n\n            LoggerExtensions.Log(\n                logger,\n                logLevel: LogLevel.Trace,\n                args: Array.Empty<object>(),\n                message: \"Hey {foo} and {foo}\"); // Noncompliant\n                                                 // Secondary @-1\n\n            logger.LogWarning(@\"\n                hey there\n                {foo}\n                and {bar}\n                and again {foo}\n                \",\n            //   ^^^ @-3 {{Message template placeholder 'foo' is not unique.}}\n            //             ^^^ Secondary @-2\n                foo, bar, foo);\n\n\n            // SyntaxKinds\n            logger.LogInformation(\"Hey {foo}\" + \"and {foo}\", foo, foo);\n            //                          ^^^ {{Message template placeholder 'foo' is not unique.}}\n            //                                        ^^^ Secondary @-1\n            logger.LogInformation(\"Hey {foo}\" + $\"and of course\" + \"{foo}\", foo, foo);\n            //                          ^^^ {{Message template placeholder 'foo' is not unique.}}\n            //                                                       ^^^ Secondary @-1\n            logger.LogInformation(\"Hey {foo}\" + $\"{{foo}}\" + \"{foo}\", foo, foo);                    // We miss the second placeholder\n            //                          ^^^ {{Message template placeholder 'foo' is not unique.}}\n            //                                                 ^^^ Secondary @-1\n\n            logger.LogInformation(\n                \"Hey {foo}\"\n            //        ^^^ {{Message template placeholder 'foo' is not unique.}}\n                +\n                \"and {foo}\", foo, foo);\n            //        ^^^ Secondary\n\n        }\n\n        // Fake\n        public class NotLogger\n        {\n            public void LogDebug(string message, params object[] args) { }\n        }\n    }\n\n    public static class NotLoggerExtensions\n    {\n        public static void LogCritical(this Program.NotLogger logger, string message, params object[] args) { }\n    }\n}\n\nnamespace SerilogTests\n{\n    using Serilog;\n    using Serilog.Events;\n\n    public class Program\n    {\n        void Compliant(ILogger logger, string arg)\n        {\n            logger.Write(LogEventLevel.Information, \"Hey {foo} and {bar}\");                // Compliant\n            logger.Write(LogEventLevel.Information, \"Hey {foo} and {bar}\", arg);           // Compliant\n            logger.Write(LogEventLevel.Information, \"Hey {foo} and {bar}\", arg, arg);      // Compliant\n        }\n\n        void Noncompliant(ILogger logger, string arg)\n        {\n            logger.Write(LogEventLevel.Information, \"Hey {foo} and {foo}\");                // Noncompliant\n                                                                                           // Secondary @-1\n            logger.Write(LogEventLevel.Information, \"Hey {foo} and {foo}\", arg);           // Noncompliant\n                                                                                           // Secondary @-1\n            logger.Write(LogEventLevel.Information, \"Hey {foo} and {foo}\", arg, arg);      // Noncompliant\n                                                                                           // Secondary @-1\n        }\n    }\n}\n\nnamespace NLogTests\n{\n    using NLog;\n\n    public class Program\n    {\n        void Compliant(ILoggerBase logger, string arg)\n        {\n            logger.Log(LogLevel.Trace, \"Hey {foo} and {bar}\");              // Compliant\n            logger.Log(LogLevel.Trace, \"Hey {foo} and {bar}\", arg);         // Compliant\n            logger.Log(LogLevel.Trace, \"Hey {foo} and {bar}\", arg, arg);    // Compliant\n        }\n\n        void Noncompliant(ILoggerBase logger, string arg)\n        {\n            logger.Log(LogLevel.Trace, \"Hey {foo} and {foo}\");              // Noncompliant\n                                                                            // Secondary @-1\n            logger.Log(LogLevel.Trace, \"Hey {foo} and {foo}\", arg);         // Noncompliant\n                                                                            // Secondary @-1\n            logger.Log(LogLevel.Trace, \"Hey {foo} and {foo}\", arg, arg);    // Noncompliant\n                                                                            // Secondary @-1\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/NamespaceName.vb",
    "content": "﻿Namespace Tests.Diagnostics ' Compliant\nEnd Namespace\n\nNamespace Tests ' Compliant\nEnd Namespace\n\nNamespace tests.Diagnostics ' Noncompliant\nEnd Namespace\n\nNamespace Tests.diagnostics ' Noncompliant\nEnd Namespace\n\nNamespace Aaa.Bbb.Ccc.Ddd ' Compliant\n\nEnd Namespace"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/NativeMethodsShouldBeWrapped.Latest.SourceGenerator.cs",
    "content": "﻿// <auto-generated/>\nnamespace LibraryImportAttributeTests\n{\n    public static unsafe partial class ExternMethods\n    {\n        [System.Runtime.InteropServices.DllImportAttribute(\"foo.dll\", EntryPoint = \"DllImportAttributeAppliedToThisFunction\", ExactSpelling = true)]\n        public static extern partial void DllImportAttributeAppliedToThisFunction();\n    }\n}\nnamespace LibraryImportAttributeTests\n{\n    public static unsafe partial class ExternMethods\n    {\n        [System.Runtime.InteropServices.DllImportAttribute(\"foo.dll\", EntryPoint = \"CompliantDllImportAttributeAppliedToThisFunction\", ExactSpelling = true)]\n        private static extern partial void CompliantDllImportAttributeAppliedToThisFunction(int i);\n    }\n}\nnamespace LibraryImportAttributeTests\n{\n    public static unsafe partial class ExternMethods\n    {\n        [System.CodeDom.Compiler.GeneratedCodeAttribute(\"Microsoft.Interop.LibraryImportGenerator\", \"7.0.7.6804\")]\n        [System.Runtime.CompilerServices.SkipLocalsInitAttribute]\n        public static partial void DllImportAttributeAppliedToGeneratedLocalFunction(string p)\n        {\n            byte* __p_native = default;\n            // Setup - Perform required setup.\n            global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __p_native__marshaller = new();\n            try\n            {\n                // Marshal - Convert managed data to native data.\n                byte* __p_native__stackptr = stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize];\n                __p_native__marshaller.FromManaged(p, new System.Span<byte>(__p_native__stackptr, global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize));\n                {\n                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.\n                    __p_native = __p_native__marshaller.ToUnmanaged();\n                    __PInvoke(__p_native);\n                }\n            }\n            finally\n            {\n                // Cleanup - Perform required cleanup.\n                __p_native__marshaller.Free();\n            }\n\n            // Local P/Invoke\n            [System.Runtime.InteropServices.DllImportAttribute(\"foo.dll\", EntryPoint = \"DllImportAttributeAppliedToGeneratedLocalFunction\", ExactSpelling = true)]\n            static extern unsafe void __PInvoke(byte* p);\n        }\n    }\n}\nnamespace LibraryImportAttributeTests\n{\n    public static unsafe partial class ExternMethods\n    {\n        [System.CodeDom.Compiler.GeneratedCodeAttribute(\"Microsoft.Interop.LibraryImportGenerator\", \"7.0.7.6804\")]\n        [System.Runtime.CompilerServices.SkipLocalsInitAttribute]\n        private static partial void CompliantDllImportAttributeAppliedToGeneratedLocalFunction(string p)\n        {\n            byte* __p_native = default;\n            // Setup - Perform required setup.\n            global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __p_native__marshaller = new();\n            try\n            {\n                // Marshal - Convert managed data to native data.\n                byte* __p_native__stackptr = stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize];\n                __p_native__marshaller.FromManaged(p, new System.Span<byte>(__p_native__stackptr, global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize));\n                {\n                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.\n                    __p_native = __p_native__marshaller.ToUnmanaged();\n                    __PInvoke(__p_native);\n                }\n            }\n            finally\n            {\n                // Cleanup - Perform required cleanup.\n                __p_native__marshaller.Free();\n            }\n\n            // Local P/Invoke\n            [System.Runtime.InteropServices.DllImportAttribute(\"foo.dll\", EntryPoint = \"CompliantDllImportAttributeAppliedToGeneratedLocalFunction\", ExactSpelling = true)]\n            static extern unsafe void __PInvoke(byte* p);\n        }\n    }\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/NativeMethodsShouldBeWrapped.Latest.cs",
    "content": "﻿using System.Runtime.InteropServices;\n\npublic interface IInterface\n{\n    [DllImport(\"kernel32.dll\", CharSet = CharSet.Unicode)]\n    static extern virtual bool RemoveDirectory1(string name); // Noncompliant\n\n    [DllImport(\"kernel32.dll\", CharSet = CharSet.Unicode)]\n    public static extern virtual bool RemoveDirectory2(string name);  // Noncompliant\n}\n\nnamespace LibraryImportAttributeTests\n{\n    // Copy the class to a .Net 7 project in VS and use \"goto definition\" on the methods to extract the code generated by the Microsoft.Interop.LibraryImportGenerator\n    public static partial class ExternMethods\n    {\n        [LibraryImport(\"foo.dll\")]\n        public static partial void DllImportAttributeAppliedToThisFunction(); // Noncompliant\n\n        [LibraryImport(\"foo.dll\")]\n        private static partial void CompliantDllImportAttributeAppliedToThisFunction(int i); // Compliant\n\n        [LibraryImport(\"foo.dll\", StringMarshalling = StringMarshalling.Utf8)]\n        public static partial void DllImportAttributeAppliedToGeneratedLocalFunction(string p); // Noncompliant\n\n        [LibraryImport(\"foo.dll\", StringMarshalling = StringMarshalling.Utf8)]\n        private static partial void CompliantDllImportAttributeAppliedToGeneratedLocalFunction(string p); // Compliant\n\n        // Wrapper tests\n\n        public static void CompliantDllImportAttributeAppliedToThisFunctionNoncompliantWrapper(int i) // Noncompliant {{Make this wrapper for native method 'CompliantDllImportAttributeAppliedToThisFunction' less trivial.}}\n        {\n            CompliantDllImportAttributeAppliedToThisFunction(i);\n        }\n\n        public static void CompliantDllImportAttributeAppliedToThisFunctionCompliantWrapper(int i) // Compliant\n        {\n            if (i > 0)\n            {\n                CompliantDllImportAttributeAppliedToThisFunction(i);\n            }\n        }\n\n        public static void CompliantDllImportAttributeAppliedToGeneratedLocalFunctionWrapper(string p) // Noncompliant\n            => CompliantDllImportAttributeAppliedToGeneratedLocalFunction(p);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/NativeMethodsShouldBeWrapped.TopLevelStatements.cs",
    "content": "﻿using System.Runtime.InteropServices;\n\n// Invalid method, testing if IMethodSymbol.ContainingType returns null (it currently doesn't)\nprivate void Do(int x) { } // Error [CS0106]\n\npublic record Record\n{\n    extern private static void Extern0(); // Compliant\n\n    extern private static void Extern1(string s, int x); // Compliant\n\n    extern public static void Extern2(string s, int x); // Noncompliant {{Make this native method private and provide a wrapper.}}\n    //                        ^^^^^^^\n\n    public void Method()\n    {\n        extern static void Extern(string s, int x); // Compliant - local method\n    }\n}\n\nnamespace TestsFromDeprecatedS4214\n{\n    public record Record\n    {\n        public void Method()\n        {\n            [DllImport(\"kernel32.dll\", CharSet = CharSet.Unicode)]\n            static extern bool RemoveDirectory(string name);     // Compliant - Method is not publicly exposed\n        }\n\n        [DllImport(\"kernel32.dll\", CharSet = CharSet.Unicode)]\n        public static extern bool RemoveDirectory(string name);  // Noncompliant\n    }\n}\n\ninterface Foo\n{\n    [DllImport(\"mynativelib\")]\n    extern public static void Bar(string s, int x);     // FN\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/NativeMethodsShouldBeWrapped.cs",
    "content": "﻿using System;\nusing System.Runtime.InteropServices;\n\nnamespace Tests.Diagnostics\n{\n    public class Program\n    {\n        private static T DoSomething<T>(T x) => x;\n\n        extern private static void Extern0(); // Compliant\n\n        extern private static void Extern1(string s, int x); // Compliant\n\n        extern public static void Extern2(string s, int x); // Noncompliant {{Make this native method private and provide a wrapper.}}\n//                                ^^^^^^^\n\n        extern internal protected static void Extern3(string s, int x); // Noncompliant\n//                                            ^^^^^^^\n\n\n        extern private static int Extern4(string s); // Compliant\n\n        public static void Wrapper1(string s, int x) // Noncompliant {{Make this wrapper for native method 'Extern1' less trivial.}}\n        {\n            Extern1(s, x);\n        }\n\n        public static void Wrapper2() // Compliant, no arguments\n        {\n            Extern0();\n        }\n\n        public static int Wrapper3() // Compliant, no arguments\n        {\n            if (DoSomething(false)) // simulate some check\n                Extern0();\n\n            return 5;\n        }\n\n        public static void Wrapper4(string s, int x) // Compliant, more than one statement\n        {\n            Extern1(s, x);\n            Extern1(s, x);\n        }\n\n        public static void Wrapper5(string s, int x) // Compliant, more than one statement\n        {\n            if (string.IsNullOrEmpty(s) || x < 0)\n            {\n                return;\n            }\n            Extern1(s, x);\n        }\n\n        public static void Wrapper6(string s, int x) // Compliant, parameters are not directly passed\n        {\n            Extern1(s != null ? s : string.Empty, x > 0 ? x : 100);\n        }\n\n        public static void Wrapper7(string s, int x) // Compliant, parameters are not directly passed\n        {\n            Extern1(DoSomething(s), DoSomething(x));\n        }\n\n        public static void Wrapper8(string s, int x) => // Noncompliant {{Make this wrapper for native method 'Extern1' less trivial.}}\n            Extern1(s, x);\n\n        public static void Wrapper9(string s, int x) => // Compliant, parameters are not directly passed\n            Extern1(s.Length > 0 ? s : string.Empty, x > 0 ? x : 100);\n\n        public static void Wrapper10(string s, int x) => // Compliant, parameters are not directly passed\n            Extern1(DoSomething(s), DoSomething(x));\n\n        public static int Wrapper11() => // Compliant, no arguments\n            DoSomething(false) ? Extern4(\"\") : 5; // simulate some check\n\n        private class PrivateClass\n        {\n            extern public static void Extern(); // Compliant, container class is private\n        }\n\n        internal class PrivateClass2\n        {\n            extern public static void Extern(); // Compliant, container class is internal\n        }\n    }\n}\n\nnamespace TestsFromDeprecatedS4214\n{\n    public class Program\n    {\n        [DllImport(\"kernel32.dll\", CharSet = CharSet.Unicode)]\n        public static extern bool RemoveDirectory1(string name); // Noncompliant {{Make this native method private and provide a wrapper.}}\n        //                        ^^^^^^^^^^^^^^^^\n\n        [DllImport(\"kernel32.dll\", CharSet = CharSet.Unicode)]\n        protected static extern bool RemoveDirectory2(string name); // Noncompliant\n\n        [DllImport(\"kernel32.dll\", CharSet = CharSet.Unicode)]\n        internal protected static extern bool RemoveDirectory3(string name); // Noncompliant\n\n        [DllImport(\"kernel32.dll\", CharSet = CharSet.Unicode)]\n        internal static extern bool RemoveDirectory4(string name);\n\n        [DllImport(\"kernel32.dll\", CharSet = CharSet.Unicode)]\n        private static extern bool RemoveDirectory5(string name);\n\n        [DllImport(\"kernel32.dll\", CharSet = CharSet.Unicode)] // Error [CS0601]\n        public extern bool RemoveDirectory6(string name);      // Noncompliant\n\n        [DllImport(\"kernel32.dll\", CharSet = CharSet.Unicode)] // Error [CS0601]\n        public static bool RemoveDirectory7(string name); // Error [CS0501] - so do not raise an issue\n    }\n\n    internal class Foo\n    {\n        [DllImport(\"kernel32.dll\", CharSet = CharSet.Unicode)]\n        public static extern bool RemoveDirectory1(string name); // Compliant because effective accessibility is not public\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/NegatedIsExpression.Fixed.vb",
    "content": "﻿Module Module1\n    Sub Main(x As Boolean)\n        Dim a = \"a\" IsNot Nothing ' Fixed\n        a = \"a\" IsNot ' Fixed\n            Nothing 'some comment\n        a = \"a\" IsNot Nothing ' Compliant\n        Main(\"a\" IsNot Nothing) ' Fixed\n    End Sub\nEnd Module"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/NegatedIsExpression.vb",
    "content": "﻿Module Module1\n    Sub Main(x As Boolean)\n        Dim a = Not \"a\" Is Nothing ' Noncompliant {{Replace this use of 'Not...Is...' with 'IsNot'.}}\n'               ^^^^^^^^^^^^^^^^^^\n        a = Not \"a\" Is ' Noncompliant\n            Nothing 'some comment\n        a = \"a\" IsNot Nothing ' Compliant\n        Main(Not \"a\" Is Nothing) ' Noncompliant\n    End Sub\nEnd Module"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/NestedCodeBlock.Latest.cs",
    "content": "﻿public class FieldKeyword\n{\n    public string Name\n    {\n        get\n        {\n            { // Noncompliant\n                return field;\n            }\n        }\n        set;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/NestedCodeBlock.TopLevelStatements.cs",
    "content": "﻿using System;\n\n    { // Noncompliant\n//  ^\n        if (1 < 2)\n        {\n        }\n    }\n\nrecord TestRecord\n{\n    public int MeaningOfLife\n    {\n        get\n        {\n            { // Noncompliant\n//          ^\n                return 42;\n            }\n        }\n        init\n        {\n            { // Noncompliant\n//          ^\n                throw new ArgumentOutOfRangeException(\"Value can only be 42.\");\n            }\n        }\n    }\n\n    public void Run(int x, int y)\n    {\n        { // Noncompliant\n//      ^\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/NestedCodeBlock.cs",
    "content": "﻿using System;\nusing System.IO;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        public int MeaningOfLife\n        {\n            get\n            {\n                { // Noncompliant {{Extract this nested code block into a separate method.}}\n//              ^\n                    return 42;\n                }\n            }\n            set\n            {\n                { // Noncompliant\n//              ^\n                    throw new ArgumentOutOfRangeException(\"Value can only be 42.\");\n                }\n            }\n        }\n\n        public event EventHandler eventHandler;\n\n        struct Point\n        {\n            public int x, y;\n\n            public Point(int x, int y)\n            {\n                { // Noncompliant\n//              ^\n                    this.x = x;\n                    this.y = y;\n                }\n            }\n        }\n\n        public enum MyEnum\n        {\n            A,\n            B\n        }\n\n        public Program()\n        {\n            { // Noncompliant\n//          ^\n            }\n        }\n\n        public void Method(int value)\n        { // Compliant, parent is MethodDeclaration\n            { // Noncompliant\n//          ^\n            }\n            switch (value)\n            {\n                case 1:\n                    break;\n                case 2:\n                    { // Compliant, parent is SwitchSection\n                        int a = 1;\n                        { // Noncompliant\n//                      ^\n                            int b = 2;\n                        }\n                    }\n                    break;\n                default:\n                    { // Compliant, parent is SwitchSection\n                        { // Noncompliant\n                        }\n                    }\n                    break;\n            }\n            if (value == 3)\n            { // Compliant, parent is IfStatement\n                { // Noncompliant\n                }\n            }\n            else\n            { // Compliant, parent is ElseClause\n                { // Noncompliant\n                }\n            }\n            for (int i = 0; i < value; i++)\n            { // Compliant, parent is ForStatement\n                { // Noncompliant\n                }\n            }\n\n            foreach (int element in new int [] { 1, 2 })\n            {\n                { // Noncompliant\n                }\n            }\n\n            int j = 0;\n            while (j < value)\n            { // Compliant, parent is WhileStatement\n                { // Noncompliant\n                }\n                j++;\n            }\n\n            do\n            {\n                { // Noncompliant\n                }\n                j++;\n            } while (j < value);\n\n            using (var streamReader = new StreamReader(\"file.txt\"))\n            {\n                { // Noncompliant\n                }\n            }\n\n            try\n            {\n                { // Noncompliant\n                }\n            }\n            catch\n            {\n                { // Noncompliant\n                }\n            }\n            finally\n            {\n                { // Noncompliant\n                }\n            }\n\n            unsafe\n            {\n                { // Noncompliant\n                }\n            }\n\n            checked\n            {\n                { // Noncompliant\n                }\n            }\n\n            unchecked\n            {\n                { // Noncompliant\n                }\n            }\n\n            lock (this)\n            {\n                { // Noncompliant\n                }\n            }\n\n            eventHandler += delegate\n            {\n                { // Noncompliant\n                }\n            };\n\n            var x = LocalFunction();\n            bool LocalFunction()\n            {\n                { // Noncompliant\n                    return true;\n                }\n            }\n\n\n        }\n\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/NoExceptionsInFinally.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public class MyTestCases\n    {\n        public void Method1()\n        {\n            try\n            {\n                throw new ArgumentException();\n            }\n            finally\n            {\n                throw new InvalidOperationException(); // Noncompliant\n            }\n        }\n\n        public void Method2()\n        {\n            try\n            {\n                throw new ArgumentException();\n            }\n            finally\n            {\n                try\n                {\n\n                }\n                finally\n                {\n                    throw new InvalidOperationException(); // Noncompliant\n                }\n            }\n        }\n\n        public void Method3()\n        {\n            try\n            {\n                throw new ArgumentException();\n            }\n            finally\n            {\n                try\n                {\n                    throw new InvalidOperationException(); // Noncompliant\n                }\n                catch (InvalidCastException)\n                {\n\n                }\n            }\n        }\n\n        public void Method4()\n        {\n            int a = 0;\n            try\n            {\n                a++;\n                throw new ArgumentException();\n            }\n            finally\n            {\n                if (a > 0)\n                {\n                    throw new InvalidOperationException(); // Noncompliant\n                }\n            }\n        }\n\n        public void Method5()\n        {\n            try\n            {\n                throw new ArgumentException();\n            }\n            finally\n            {\n                try\n                {\n                    try\n                    {\n                        throw new ArgumentOutOfRangeException(); // Noncompliant\n                    }\n                    finally\n                    {\n                        throw new InvalidOperationException(); // Noncompliant\n                    }\n                }\n                catch\n                {\n\n                }\n            }\n        }\n\n        public void Method6()\n        {\n            try\n            {\n                throw new ArgumentException();\n            }\n            finally\n            {\n                try\n                {\n                    try\n                    {\n                        throw new InvalidOperationException(); // Noncompliant\n                    }\n                    catch\n                    {\n\n                    }\n\n                    throw new ArgumentOutOfRangeException(); // Noncompliant\n                }\n                catch (ArgumentOutOfRangeException)\n                {\n                    throw; // Noncompliant\n                }\n            }\n        }\n\n        public void Method7()\n        {\n            try\n            {\n                throw new ArgumentException();\n            }\n            finally\n            {\n                try\n                {\n                    try\n                    {\n                        try\n                        {\n                            throw new InvalidOperationException(); // Noncompliant\n                        }\n                        catch\n                        {\n\n                        }\n\n                        throw new ArgumentOutOfRangeException(); // Noncompliant\n                    }\n                    catch (ArgumentOutOfRangeException)\n                    {\n                        throw; // Noncompliant\n                    }\n                }\n                catch (ArgumentOutOfRangeException)\n                {\n                }\n            }\n        }\n\n        public void Method8()\n        {\n            try\n            {\n                throw new ArgumentException();\n            }\n            finally\n            {\n            }\n        }\n\n        public void Method9()\n        {\n            try\n            {\n                throw new ArgumentException();\n            }\n            finally\n            {\n                try\n                {\n                    throw new InvalidOperationException(); // Noncompliant\n                }\n                catch (InvalidOperationException)\n                {\n\n                }\n            }\n        }\n\n        public void Method10()\n        {\n            try\n            {\n                throw new ArgumentException();\n            }\n            finally\n            {\n                try\n                {\n                    throw new InvalidOperationException(); // Noncompliant\n                }\n                catch\n                {\n\n                }\n            }\n        }\n\n        public void Method11()\n        {\n            try\n            {\n                throw new ArgumentException();\n            }\n            finally\n            {\n                try\n                {\n                    try\n                    {\n                        try\n                        {\n                            throw new InvalidOperationException(); // Noncompliant\n                        }\n                        catch\n                        {\n\n                        }\n\n                        throw new ArgumentOutOfRangeException(); // Noncompliant\n                    }\n                    catch (ArgumentOutOfRangeException)\n                    {\n                        throw; // Noncompliant\n                    }\n                }\n                catch\n                {\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/NoExceptionsInFinally.vb",
    "content": "﻿Imports System\n\nPublic Class TestCases\n\n    Public Sub Method1()\n        Try\n            Throw New ArgumentException()\n        Finally\n            Throw New InvalidOperationException() ' Noncompliant\n        End Try\n    End Sub\n\n    Public Sub Method2()\n        Try\n            Throw New ArgumentException()\n        Finally\n            Try\n\n            Finally\n                Throw New InvalidOperationException() ' Noncompliant\n            End Try\n        End Try\n    End Sub\n\n    Public Sub Method3()\n        Try\n            Throw New ArgumentException()\n        Finally\n            Try\n                Throw New InvalidOperationException() ' Noncompliant\n            Catch ex As InvalidCastException\n            End Try\n        End Try\n    End Sub\n\n    Public Sub Method4()\n        Dim a As Integer = 0\n        Try\n            a += 1\n            Throw New ArgumentException()\n        Finally\n            If a > 0 Then Throw New InvalidOperationException() ' Noncompliant\n        End Try\n    End Sub\n\n    Public Sub Method5()\n        Try\n            Throw New ArgumentException()\n        Finally\n            Try\n                Try\n                    Throw New ArgumentOutOfRangeException() ' Noncompliant\n                Finally\n                    Throw New InvalidOperationException()   ' Noncompliant\n                End Try\n            Catch\n            End Try\n        End Try\n    End Sub\n\n    Public Sub Method6()\n        Try\n            Throw New ArgumentException()\n        Finally\n            Try\n                Try\n                    Throw New InvalidOperationException() ' Noncompliant\n                Catch\n                End Try\n                Throw New ArgumentOutOfRangeException() ' Noncompliant\n            Catch ex As ArgumentOutOfRangeException\n                Throw ' Noncompliant\n            End Try\n        End Try\n    End Sub\n\n    Public Sub Method7()\n        Try\n            Throw New ArgumentException()\n        Finally\n            Try\n                Try\n                    Try\n                        Throw New InvalidOperationException() ' Noncompliant\n                    Catch\n                    End Try\n                    Throw New ArgumentOutOfRangeException() ' Noncompliant\n                Catch ex As ArgumentOutOfRangeException\n                    Throw ' Noncompliant\n                End Try\n            Catch ex As ArgumentOutOfRangeException\n            End Try\n        End Try\n    End Sub\n\n    Public Sub Method8()\n        Try\n            Throw New ArgumentException()\n        Finally\n        End Try\n    End Sub\n\n    Public Sub Method9()\n        Try\n            Throw New ArgumentException()\n        Finally\n            Try\n                Throw New InvalidOperationException() ' Noncompliant\n            Catch ex As InvalidOperationException\n            End Try\n        End Try\n    End Sub\n\n    Public Sub Method10()\n        Try\n            Throw New ArgumentException()\n        Finally\n            Try\n                Throw New InvalidOperationException() ' Noncompliant\n            Catch\n            End Try\n        End Try\n    End Sub\n\n    Public Sub Method11()\n        Try\n            Throw New ArgumentException()\n        Finally\n            Try\n                Try\n                    Try\n                        Throw New InvalidOperationException() ' Noncompliant\n                    Catch\n                        Throw New ArgumentOutOfRangeException() ' Noncompliant\n                    End Try\n                Catch ex As ArgumentOutOfRangeException\n                    Throw ' Noncompliant\n                End Try\n            Catch\n            End Try\n        End Try\n    End Sub\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/NonAsyncTaskShouldNotReturnNull.Latest.Partial.cs",
    "content": "﻿using System.Threading.Tasks;\n\npublic partial class PartialProperties\n{\n    public partial Task<object> Prop1 => null; // Noncompliant\n\n    public partial Task<object> Prop2\n    {\n        get\n        {\n            return null; // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/NonAsyncTaskShouldNotReturnNull.Latest.cs",
    "content": "﻿using System.Threading.Tasks;\n\npublic interface IMath\n{\n    public static virtual Task<object> GetValue()\n    {\n        return null; // Noncompliant\n    }\n}\n\npublic partial class PartialProperties\n{\n    public partial Task<object> Prop1 { get; }\n    public partial Task<object> Prop2 { get; }\n}\n\npublic static class Extensions\n{\n    extension(string s)\n    {\n        public Task<object> NonCompliantInstanceProp => null;                                       // Noncompliant\n        public Task<object> CompliantInstanceProp => new Task<object>(() => new object());          // Compliant\n\n        public Task<object> NonCompliantInstanceMethod() => null;                                   // Noncompliant\n        public Task<object> CompliantInstanceMethod() => new Task<object>(() => new object());      // Compliant\n\n        public static Task<object> NonCompliantStaticProp => null;                                  // Noncompliant\n        public static Task<object> CompliantStaticProp => new Task<object>(() => new object());     // Compliant\n\n        public static Task<object> NonCompliantStaticMethod() => null;                              // Noncompliant\n        public static Task<object> CompliantStaticMethod() => new Task<object>(() => new object()); // Compliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/NonAsyncTaskShouldNotReturnNull.cs",
    "content": "﻿using System;\nusing System.Threading.Tasks;\n\nnamespace Tests.Diagnostics\n{\n    public class CompliantUseCases\n    {\n        public async Task GetTaskAsync1()\n        {\n        }\n\n        public async Task<object> GetTaskAsync2()\n        {\n            return null; // async\n        }\n\n        public Task GetTask1()\n        {\n            return Task.FromResult(true);\n        }\n\n        public Task GetTask2()\n        {\n            var x = new Task<object>(() => null); // Compliant\n\n            return Task.Delay(0);\n        }\n\n        public Task Foo { get; set; }\n\n        public Task<object> GetFooAsync()\n        {\n            return Task.Run(() =>\n            {\n                if (false)\n                {\n                    return new object();\n                }\n                else\n                {\n                    return null;\n                }\n            });\n        }\n\n        public Task GetBar()\n        {\n            Func<Task> func = () => null;\n\n            return func(); // False negative\n        }\n    }\n\n    public class NonCompliantUseCases\n    {\n        public Task GetTask1()\n        {\n            return null; // Noncompliant {{Do not return null from this method, instead return 'Task.FromResult<T>(null)', 'Task.CompletedTask' or 'Task.Delay(0)'.}}\n//                 ^^^^\n        }\n\n        public Task<object> GetTask2()\n        {\n            return null; // Noncompliant\n        }\n\n        public Task GetTaskAsync3(int a)\n        {\n            if (a > 42)\n            {\n                return null; // Noncompliant\n            }\n\n            return Task.Delay(0);\n        }\n\n        public Task<string> GetTask4() => null; // Noncompliant\n\n        public Task<string> GetTask5(int a)\n        {\n            if (a > 0)\n            {\n                return null; // Noncompliant\n            }\n            else\n            {\n                return null; // Noncompliant\n            }\n        }\n\n        public Task GetTask6()\n        {\n            return (null); // Noncompliant\n        }\n\n        public Task GetTask7(bool condition)\n        {\n            return condition ? Task.FromResult(5) : null; // Should be non-compliant\n        }\n\n        private Task foo;\n        public Task Foo\n        {\n            get\n            {\n                return null; // Noncompliant\n            }\n            set\n            {\n                foo = value;\n            }\n        }\n\n        public Task<int> AgeAsync\n        {\n            get => null; // Noncompliant\n        }\n\n        // See https://github.com/SonarSource/sonar-dotnet/issues/1845\n        public Task<object> GetObjectTask()\n        {\n            object GetObject()\n            {\n                return null;\n            }\n\n            return Task.FromResult(GetObject());\n        }\n\n        public Task<object> SomeMethodAsync()\n        {\n            return this.SomeOtherMethodAsync(\n                async input =>\n                {\n                    await Task.Yield();\n\n                    return null;\n                });\n        }\n\n        public Task<object> SomeMethodNonAsync()\n        {\n            return this.SomeOtherMethodAsync(\n                input =>\n                {\n                    return null; // Noncompliant\n                });\n        }\n\n        public Task<object> SomeMethodParenthesizedAsync()\n        {\n            return this.SomeOtherMethodAsync(\n                async (input) =>\n                {\n                    await Task.Yield();\n\n                    return null;\n                });\n        }\n\n        public Task<object> SomeMethodParenthesizedNonAsync()\n        {\n            return this.SomeOtherMethodAsync(\n                (input) =>\n                {\n                    return null; // Noncompliant\n                });\n        }\n\n        private Task<object> SomeOtherMethodAsync(Func<object, Task<object>> function) => function.Invoke(null);\n\n        public Task<object> GetBar()\n        {\n            return Add(1, 2);\n\n            static Task<object> Add(int left, int right)\n            {\n                return null; // Noncompliant\n            }\n\n            static Task<object> GetTaskAsync2() => null; // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/NonAsyncTaskShouldNotReturnNull.vb",
    "content": "﻿Imports System\nImports System.Threading.Tasks\n\nNamespace Tests.Diagnostics\n    Public Class CompliantUseCases\n\n        Public Async Function GetTaskAsync2() As Task(Of Object)\n            Return Nothing\n        End Function\n\n        Public Function GetTask1() As Task\n            Return Task.FromResult(True)\n        End Function\n\n        Public Function GetTask2() As Task\n            Dim x = New Task(Of Object)(Function() Nothing)\n            Return Task.Delay(0)\n        End Function\n\n        Public Property Foo As Task\n\n        Public Function GetFooAsync() As Task(Of Object)\n            Return Task.Run(Function()\n                                If False Then\n                                    Return New Object()\n                                Else\n                                    Return Nothing\n                                End If\n                            End Function)\n        End Function\n\n        Public Function GetBar() As Task\n            Dim func As Func(Of Task) = Function() Nothing\n            Return func()\n        End Function\n    End Class\n\n    Public Class NonCompliantUseCases\n        Public Function GetTask1() As Task\n            Return Nothing ' Noncompliant {{Do not return null from this method, instead return 'Task.FromResult(Of T)(Nothing)', 'Task.CompletedTask' or 'Task.Delay(0)'.}}\n'                  ^^^^^^^\n        End Function\n\n        Public Function GetTask2() As Task(Of Object)\n            Return Nothing ' Noncompliant\n        End Function\n\n        Public Function GetTaskAsync3(ByVal a As Integer) As Task\n            If a > 42 Then\n                Return Nothing ' Noncompliant\n            End If\n\n            Return Task.Delay(0)\n        End Function\n\n        Public Function GetTask5(ByVal a As Integer) As Task(Of String)\n            If a > 0 Then\n                Return Nothing ' Noncompliant\n            Else\n                Return Nothing ' Noncompliant\n            End If\n        End Function\n\n        Public Function GetTask6() As Task\n            Return (Nothing) ' Noncompliant\n        End Function\n\n        Public Function GetTask7(ByVal condition As Boolean) As Task\n            Return If(condition, Task.FromResult(5), Nothing) ' Noncompliant\n        End Function\n\n        Public Property Foo As Task\n            Get\n                Return Nothing ' Noncompliant\n            End Get\n            Set(ByVal value As Task)\n                foo = value\n            End Set\n        End Property\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/NonDerivedPrivateClassesShouldBeSealed.Latest.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class ClassWithRecord\n    {\n        private record RecordNotExtended { } // Noncompliant {{Private record classes which are not derived in the current assembly should be marked as 'sealed'.}}\n            //         ^^^^^^^^^^^^^^^^^\n\n        private record PrivateRecord { }\n\n        private sealed record PrivateRecordExtension : PrivateRecord { }\n    }\n\n    public record PublicRecord\n    {\n        private record NonsealedPrivateRecord { } // Noncompliant\n\n        private record NonsealedPrivatePositionalRecord(string Property) { } // Noncompliant\n    }\n\n    public record PublicPositionalRecord\n    {\n        private record NonsealedPrivateRecord { } // Noncompliant\n\n        private record NonsealedPrivatePositionalRecord(string Property) { } // Noncompliant\n    }\n\n    public partial class APartialClass\n    {\n        private record PrivateRecord { }\n    }\n\n    public partial class APartialClass\n    {\n        private sealed record PrivateRecordExtension : PrivateRecord { }\n    }\n}\n\nfile class ClassNotExtended { }             // Noncompliant {{File-scoped classes which are not derived in the current file should be marked as 'sealed'.}}\n//         ^^^^^^^^^^^^^^^^\nfile record RecordNotExtended { }           // Noncompliant {{File-scoped record classes which are not derived in the current file should be marked as 'sealed'.}}\n//          ^^^^^^^^^^^^^^^^^\nfile record class RecordNotExtended2 { }    // Noncompliant {{File-scoped record classes which are not derived in the current file should be marked as 'sealed'.}}\n//                ^^^^^^^^^^^^^^^^^^\n\nfile class FileClassVirtualMethod // Compliant, the class has a virtual member.\n{\n    public virtual void AMethod() { }\n}\n\nfile class FileClassVirtualProperty // Compliant, the class has a virtual member.\n{\n    public virtual int Number { get; set; }\n}\n\nfile record FileClassVirtualIndexer // Compliant, the class has a virtual member.\n{\n    public virtual int this[int key]\n    {\n        get { return 1; }\n        set { key += 1; }\n    }\n}\n\nfile record FileClassVirtualEvent // Compliant, the class has a virtual member.\n{\n    public virtual event EventHandler Foo\n    {\n        add\n        {\n            Console.WriteLine(\"Base Foo.add called\");\n        }\n        remove\n        {\n            Console.WriteLine(\"Base Foo.remove called\");\n        }\n    }\n}\n\n\nfile class FileDerivedClass { } // Compliant, derived\n\nfile class FileDerivedClassExtension : FileDerivedClass { } // Noncompliant\n\nfile class FileDerivedClassSecondExtension : FileDerivedClass { }\n\nfile class TheThirdExtension : FileDerivedClassSecondExtension { } // Noncompliant\n\nfile sealed class ClassNotExtendedButFile { }\n\nfile struct AStruct { }                 // Compliant, structs cannot be inherited.\nfile record struct ARecordStruct { }    // Compliant, record structs cannot be inherited.\n\nfile static class FileStaticClass { }   // Compliant, static classes cannot be inherited.\n\nfile abstract class FileAbstractClass { } // Compliant, abstract classes cannot be sealed.\n\n\nnamespace GenericClasses\n{\n    file class NotInheritedGenericClass<T> { }  // Noncompliant\n    file class InheritedGenericClass<T> { }     // Compliant\n\n    file class ImplementationClass : InheritedGenericClass<int> { }     // Noncompliant\n    file class ImplementationClass<T> : InheritedGenericClass<T> { }    // Noncompliant\n\n    file sealed class SealedImplementationClass : InheritedGenericClass<int> { }        // Compliant\n    file sealed class SealedImplementationClass<T> : InheritedGenericClass<T> { }       // Compliant\n    file abstract class AbstractImplementationClass : InheritedGenericClass<int> { }    // Compliant\n    file abstract class AbstractImplementationClass<T> : InheritedGenericClass<T> { }   // Compliant\n}\n\nnamespace GenericRecords\n{\n    file record NotInheritedGenericRecord<T> { }    // Noncompliant\n    file record InheritedGenericRecord<T> { }       // Compliant\n\n    file record ImplementationRecord : InheritedGenericRecord<int> { }  // Noncompliant\n    file record ImplementationRecord<T> : InheritedGenericRecord<T> { } // Noncompliant\n\n    file sealed record SealedImplementationRecord : InheritedGenericRecord<int> { }         // Compliant\n    file sealed record SealedImplementationRecord<T> : InheritedGenericRecord<T> { }        // Compliant\n    file abstract record AbstractImplementationRecord : InheritedGenericRecord<int> { }     // Compliant\n    file abstract record AbstractImplementationRecord<T> : InheritedGenericRecord<T> { }    // Compliant\n}\n\nnamespace GenericRecordClasses\n{\n    file record class NotInheritedGenericRecord<T> { }  // Noncompliant\n    file record class InheritedGenericRecord<T> { }     // Compliant\n\n    file record class ImplementationRecord : InheritedGenericRecord<int> { }    // Noncompliant\n    file record class ImplementationRecord<T> : InheritedGenericRecord<T> { }   // Noncompliant\n\n    file sealed record class SealedImplementationRecord : InheritedGenericRecord<int> { }       // Compliant\n    file sealed record class SealedImplementationRecord<T> : InheritedGenericRecord<T> { }      // Compliant\n    file abstract record class AbstractImplementationRecord : InheritedGenericRecord<int> { }   // Compliant\n    file abstract record class AbstractImplementationRecord<T> : InheritedGenericRecord<T> { }  // Compliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/NonDerivedPrivateClassesShouldBeSealed.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class Foo\n    {\n        private class ClassWontBeExtended { } // Noncompliant {{Private classes which are not derived in the current assembly should be marked as 'sealed'.}}\n//                    ^^^^^^^^^^^^^^^^^^^\n\n        private class PrivateClassVirtualMethod // Compliant, the class has a virtual member.\n        {\n            public virtual void AMethod() { }\n        }\n\n        private class PrivateClassVirtualProperty // Compliant, the class has a virtual member.\n        {\n            public virtual int Number { get; set; }\n        }\n\n        private class PrivateClassVirtualIndexer // Compliant, the class has a virtual member.\n        {\n            public virtual int this[int key]\n            {\n                get { return 1; }\n                set { key += 1; }\n            }\n        }\n\n        private class PrivateClassVirtualEvent // Compliant, the class has a virtual member.\n        {\n            public virtual event EventHandler Foo\n            {\n                add\n                {\n                    Console.WriteLine(\"Base Foo.add called\");\n                }\n                remove\n                {\n                    Console.WriteLine(\"Base Foo.remove called\");\n                }\n            }\n        }\n\n        private sealed class ClassWontBeExtendedButSealed { }\n\n        private class PrivateDerivedClass { }\n\n        private class PrivateDerivedClassExtension : PrivateDerivedClass { } // Noncompliant\n\n        private class PrivateDerivedClassSecondExtension : PrivateDerivedClass { }\n\n        private class TheThirdExtension : PrivateDerivedClassSecondExtension { } // Noncompliant\n\n        private class PrivateExternalA { } // Compliant, it's extended in 'ExtendsExternalPrivateClass'\n        private class PrivateExternalB { } // Compliant, it's extended in 'SeriouslyNestedClass'\n\n        private class PrivateClass\n        {\n            private class NestedPrivateClass { } // Noncompliant\n\n            private sealed class ExtendsOuterPrivateClass : PrivateClass { }\n\n            private sealed class ExtendsExternalPrivateClass : PrivateExternalA { }\n\n            private class NestedPrivateClassWillBeExtended { }\n\n            private class NestedExtension : NestedPrivateClassWillBeExtended { } // Noncompliant\n\n            private sealed class SeriouslyNestedClass\n            {\n                private sealed class ClassA\n                {\n                    private sealed class ClassB\n                    {\n                        private sealed class ClassC : PrivateExternalB { }\n                    }\n                }\n            }\n        }\n\n        private abstract class PrivateAbstractClass { } // Compliant\n\n        private struct AStruct { } // Compliant, structs cannot be inherited.\n\n        private static class InnerPrivateStaticClass { } // Compliant, static classes cannot be inherited.\n    }\n\n    public partial class Bar\n    {\n        private class SomeClass { }\n    }\n\n    public partial class Bar\n    {\n        private class SomeOtherClass : SomeClass { } // Noncompliant\n    }\n\n    public partial class ClassImplementedInTwoFiles\n    {\n        // The class is extended \\TestCases\\NonDerivedPrivateClassesShouldBeSealed_PartialClass.cs\n        private class InnerPrivateClass { }\n    }\n\n    public class AClassWithAnInnerInterface\n    {\n        private class APrivateClass { } // Noncompliant\n\n        public interface InnerInterface { }\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/5160\npublic class Repro_5160\n{\n    private class Inner { }\n\n    private class Inner<T> : Inner { }\n\n    private class Inner<T, V> : Inner<T> { }\n\n    private sealed class Inner<T, V, W> : Inner<T, V> { }\n\n    private class Inner<A, B, C, D> : Inner { } // Noncompliant \n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/NonDerivedPrivateClassesShouldBeSealed_PartialClass.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public partial class ClassImplementedInTwoFiles\n    {\n        private sealed class InnerPrivateClassExtension : InnerPrivateClass { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/NonFlagsEnumInBitwiseOperation.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Reflection;\n\nnamespace Tests.Diagnostics\n{\n    [Flags]\n    enum Permissions\n    {\n        None = 0,\n        Read = 1,\n        Write = 2,\n        Execute = 4\n    }\n\n    [Flags]\n    enum Permissions2\n    {\n        None = 0,\n        Read = 1,\n        Write = 2,\n        Execute = 4\n    }\n\n    class NonFlagsEnumInBitwiseOperation\n    {\n        void Test()\n        {\n            var x = Permissions.Read | Permissions.Write;  // Fixed\n            x = Permissions.Read & Permissions.Write;  // Fixed\n            x = Permissions.Read ^ Permissions.Write;  // Fixed\n            x &= Permissions.Read;  // Fixed\n\n            x = ~Permissions.Read;  // Compliant\n\n            var y = Permissions2.Read | Permissions2.Write;\n\n            var w = 1 | 3;\n\n            var v = System.ComponentModel.DesignerSerializationVisibility.Content\n                | System.ComponentModel.DesignerSerializationVisibility.Hidden; // Fixed\n\n            // MethodImplAttributes lacks [Flags] but is designed for bitwise operations\n            // https://stackoverflow.com/questions/38689649/why-is-methodimplattributes-not-marked-with-flagsattribute\n            var z = MethodImplAttributes.NoInlining | MethodImplAttributes.NoOptimization; // Compliant - BCL enum without [Flags] but designed for bitwise use\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/NonFlagsEnumInBitwiseOperation.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Reflection;\n\nnamespace Tests.Diagnostics\n{\n    enum Permissions\n    {\n        None = 0,\n        Read = 1,\n        Write = 2,\n        Execute = 4\n    }\n\n    [Flags]\n    enum Permissions2\n    {\n        None = 0,\n        Read = 1,\n        Write = 2,\n        Execute = 4\n    }\n\n    class NonFlagsEnumInBitwiseOperation\n    {\n        void Test()\n        {\n            var x = Permissions.Read | Permissions.Write;  // Noncompliant {{Mark enum 'Permissions' with 'Flags' attribute or remove this bitwise operation.}}\n//                                   ^\n            x = Permissions.Read & Permissions.Write;  // Noncompliant\n            x = Permissions.Read ^ Permissions.Write;  // Noncompliant\n            x &= Permissions.Read;  // Noncompliant\n\n            x = ~Permissions.Read;  // Compliant\n\n            var y = Permissions2.Read | Permissions2.Write;\n\n            var w = 1 | 3;\n\n            var v = System.ComponentModel.DesignerSerializationVisibility.Content\n                | System.ComponentModel.DesignerSerializationVisibility.Hidden; // Noncompliant\n\n            // MethodImplAttributes lacks [Flags] but is designed for bitwise operations\n            // https://stackoverflow.com/questions/38689649/why-is-methodimplattributes-not-marked-with-flagsattribute\n            var z = MethodImplAttributes.NoInlining | MethodImplAttributes.NoOptimization; // Compliant - BCL enum without [Flags] but designed for bitwise use\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/NormalizeStringsToUppercase.CSharp11.cs",
    "content": "﻿using System.Globalization;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        void StringLowerCalls()\n        {\n            var score = 100;\n            var newLineInInterpolation = $\"The score: {score} is {score switch\n            {\n                > 0 => \"Positive\",\n                < 0 => \"Negative\",\n                _ => \"Zero\",\n            }}\".ToLower(); // Compliant\n\n            var newLineInInterpolation2 = $\"The score: {score} is {score switch\n            {\n                > 0 => \"Positive\",\n                < 0 => \"Negative\",\n                _ => \"Zero\",\n            }}\".ToLowerInvariant(); // Noncompliant\n\n            var rawStringLiteral = \"\"\"\n                This is a long message.\n                It has several lines.\n                    Some are indented.\n                \"\"\".ToLower(); // Compliant\n\n            var rawStringLiteral2 = \"\"\"\n                This is a long message.\n                It has several lines.\n                    Some are indented.\n                \"\"\".ToLowerInvariant(); // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/NormalizeStringsToUppercase.cs",
    "content": "﻿using System.Globalization;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        void StringLowerCalls()\n        {\n            var s1 = \"\".ToLower(); // Compliant\n            s1 = \"\".ToLower(CultureInfo.CurrentCulture);\n\n\n            s1 = \"\".ToLower(CultureInfo.InvariantCulture); // Noncompliant  {{Change this normalization to 'ToUpperInvariant()'.}}\n//                  ^^^^^^^\n            s1 = \"\".ToLowerInvariant(); // Noncompliant\n\n            s1 = Ext.ToLower(\"\", 42);\n            s1 = \"\".ToLower(42);\n        }\n\n        void CharLowerCalls()\n        {\n            var s1 = char.ToLower('a'); // Compliant\n            s1 = char.ToLower('a', CultureInfo.CurrentCulture);\n\n\n            s1 = char.ToLower('a', CultureInfo.InvariantCulture); // Noncompliant  {{Change this normalization to 'ToUpperInvariant()'.}}\n//                    ^^^^^^^\n            s1 = char.ToLowerInvariant('a'); // Noncompliant\n\n            s1 = Ext.ToLower('a', 42);\n            s1 = 'a'.ToLower(42);\n        }\n    }\n\n    static class Ext\n    {\n        public static string ToLower(this string s, int i) => s;\n        public static char ToLower(this char s, int i) => s;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/NotAssignedPrivateMember.Latest.Partial.cs",
    "content": "﻿public partial class PartialProperties\n{\n    public partial int Prop1 { get; }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/NotAssignedPrivateMember.Latest.cs",
    "content": "﻿using System;\nusing System.Runtime.InteropServices;\n\npublic record Compliant\n{\n    public int field;\n}\n\n[StructLayout(LayoutKind.Sequential)]\npublic record InteropMethodArgument\n{\n    public uint number; // Compliant, we don't raise on members of classes with StructLayout attribute\n}\n\npublic record Record\n{\n    private int field; // Noncompliant {{Remove unassigned field 'field', or set its value.}}\n    private int field2;\n    private static int field3; // Noncompliant\n    private static int field4;\n    private readonly int field5; // Noncompliant\n    private int field6; // Compliant - value is set in nested class ctor\n\n    private int Property { get; }  // Noncompliant\n    private int Property2 { get; }\n\n    public Record()\n    {\n        field2 = field;\n        field4 = field3;\n        field2 = field5;\n        Property2 = Property;\n    }\n\n    private record NestedRecord\n    {\n        NestedRecord(Record r)\n        {\n            r.field6 = 5;\n        }\n    }\n}\n\npublic record PositionalRecord(string Value)\n{\n    private int field; // Noncompliant\n    private int field2;\n    public PositionalRecord() : this(\"\")\n    {\n        field2 = field;\n    }\n}\n\npublic partial class PartialProperties\n{\n    public partial int Prop1 => 42;\n}\n\npublic class FieldKeyWord\n{\n    public int Prop1 => field;\n    private int Prop2 => field;                               // Compliant handled by S2292\n    public int Prop3 { get => field; set => field = value; }\n    private int Prop4 { get => field; set => field = value; } // Compliant handled by S2292\n}\n\npublic class NullConditionalAssignment\n{\n    private int compliant;                      // Compliant https://sonarsource.atlassian.net/browse/NET-2748\n    private int compliantNonNull;               // Compliant\n    private Nesting NestedCompliant;            // Compliant\n    private Nesting NestedCompliantNonNull;     // Compliant\n    private Nesting DeeperNoncompliant;         // Noncompliant\n    private Nesting DeeperNoncompliantNonNull;  // Noncompliant\n    private Nesting OtherDeeperNoncompliant;    // Noncompliant\n    private Nesting AnotherDeeperNoncompliant;  // Noncompliant\n\n    public NullConditionalAssignment()\n    {\n        this?.compliant = 42;\n        compliantNonNull = 42;\n\n        this?.NestedCompliant = new Nesting();\n        NestedCompliantNonNull = new Nesting();\n\n        DeeperNoncompliantNonNull.Prop = new Nesting();\n        this?.DeeperNoncompliant?.Prop = new Nesting();\n        this?.OtherDeeperNoncompliant.Prop = new Nesting();\n        AnotherDeeperNoncompliant?.Prop = new Nesting();\n    }\n\n    public class Nesting\n    {\n        public Nesting Prop { get; set; }\n        public Nesting this[int index] { get { return new Nesting(); } set { } }\n    }\n}\n\npublic static class Extensions\n{\n    private static string NonCompliantInProp;   // Noncompliant\n    private static string CompliantInMethod;\n\n    extension(string s)\n    {\n        public int length => NonCompliantInProp.Length;\n        public void SetLength()\n        {\n            CompliantInMethod = \"42\";\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/NotAssignedPrivateMember.cs",
    "content": "﻿using System;\nusing System.Runtime.InteropServices;\n\nnamespace Tests.Diagnostics\n{\n    struct ValueType1\n    {\n        public int field;\n    }\n\n    class RefType\n    {\n        public int field2;\n    }\n\n    struct ValueType2\n    {\n        public RefType field1;\n    }\n\n    public interface ISampleInterface\n    {\n        string Name { get; }\n    }\n\n    class MyClass\n    {\n        class Nested\n        {\n            private int field; // Noncompliant, shouldn't it be initialized? This way the value is always default(int), 0.\n//                      ^^^^^\n            private int field2;\n            private static int field3; // Noncompliant {{Remove unassigned field 'field3', or set its value.}}\n            private static int field4;\n            private static int field5; //reported by unused member rule\n            private static int field6 = 42;\n\n            [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]\n            private int withAttribute; // Compliant\n\n            private readonly int field7; // Noncompliant\n            private int Property { get; }  // Noncompliant {{Remove unassigned auto-property 'Property', or set its value.}}\n            private int Property2 { get; }\n            private int Property3 { get; } = 42; // Unused, S1144 reports on it\n            private virtual int VirtualPrivateProperty { get; } // Error [CS0621]: virtual or abstract members cannot be private\n            private Lazy<int> Lazy { get; }\n\n            private int Property4 { get; set; }  // Noncompliant\n            private int Property5 { get; set; } = 42;\n            private int Property6 { get { return 42; } set { } }\n\n            private ValueType1 v1; // Compliant, a member is assigned\n            private ValueType1 v2; // Compliant, a member is assigned\n            private ValueType1 v3; // Noncompliant\n\n            private ValueType2 v4; // Compliant, a member is assigned\n            private ValueType2 v5; // Compliant, a member is assigned\n            private ValueType2 v6; // Noncompliant\n\n            public Nested()\n            {\n                Property2 = 42;\n                v1.field++;\n                ((((v2).field))) = 42;\n                Console.WriteLine(v3.field);\n\n                this.v4.field1.field2++;\n                ((((this.v5).field1)).field2) = 42;\n                Console.WriteLine(v6.field1?.field2);\n            }\n\n            public void Print()\n            {\n                Console.WriteLine((field)); //Will always print 0\n                Console.WriteLine((field6));\n                Console.WriteLine((field7));\n                Console.WriteLine((Property));\n                Console.WriteLine((Property4));\n                Console.WriteLine((Property6));\n\n                Console.WriteLine(this.field); //Will always print 0\n                Console.WriteLine(MyClass.Nested.field3); //Will always print 0\n                new MyClass().M(ref MyClass.Nested.field4);\n\n                this.field2 = 10;\n                field2 = 10;\n            }\n        }\n\n        public void M(ref int f) { }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/242\n    public class MyClass2\n    {\n        [StructLayout(LayoutKind.Sequential)]\n        private class InteropMethodArgument\n        {\n            public uint number; // Compliant, we don't raise on members of classes with StructLayout attribute\n        }\n    }\n\n    public class MyTupleClass\n    {\n        private readonly int _foo;\n        private readonly int _bar;\n\n        public MyTupleClass()\n        {\n            (_foo, _bar) = GetFoobar();\n        }\n\n        private static (int f, int b) GetFoobar() => (1, 2);\n    }\n\n    public static class Memory\n    {\n        [return: MarshalAs(UnmanagedType.Bool)]\n        [DllImport(\"kernel32.dll\", CharSet = CharSet.Auto, SetLastError = true)]\n        static extern bool GlobalMemoryStatusEx([In, Out] MEMORYSTATUSEX lpBuffer);\n\n        [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]\n        private class MEMORYSTATUSEX\n        {\n            public uint dwLength;\n            public uint dwMemoryLoad;\n            public ulong ullTotalPhys;\n            public ulong ullAvailPhys { get; set; }\n            public ulong ullTotalPageFile;\n            public ulong ullAvailPageFile;\n            public ulong ullTotalVirtual;\n            public ulong ullAvailVirtual;\n            public ulong ullAvailExtendedVirtual;\n            public MEMORYSTATUSEX()\n            {\n                this.dwLength = (uint)Marshal.SizeOf(typeof(MEMORYSTATUSEX));\n            }\n        }\n\n        public static ulong TotalPhysicalMemory\n        {\n            get\n            {\n                MEMORYSTATUSEX memStatus = new MEMORYSTATUSEX();\n                if (GlobalMemoryStatusEx(memStatus))\n                {\n                    return memStatus.ullTotalPhys;\n                }\n                else\n                {\n                    return memStatus.ullAvailPhys;\n                }\n            }\n        }\n    }\n\n    public sealed class OuterFoo\n    {\n        private static class InnerFactory\n        {\n            public static InnerFoo<string> Instance = new InnerFoo<string> { X = \"X\" };\n        }\n\n        private class InnerFoo<T>\n        {\n            public string X;\n            public string Y;  // Noncompliant\n\n            public void Foo()\n            {\n                Console.Write(X);\n                Console.Write(Y);\n            }\n        }\n    }\n\n    // Reproducer for https://github.com/SonarSource/sonar-dotnet/issues/5232\n    public class Repro5232\n    {\n        private int Random\n        {\n            get => new Random().Next();\n        }\n        public void Print()\n        {\n            Console.WriteLine(Random);\n        }\n    }\n\n    [Serializable]\n    public class SerializableClass\n    {\n        private int field; // Compliant, see: https://github.com/SonarSource/sonar-dotnet/issues/5451\n\n        private int Prop { get; set; } // Compliant, see: https://github.com/SonarSource/sonar-dotnet/issues/5451\n\n        public void Print()\n        {\n            Console.WriteLine(field);\n            Console.WriteLine(Prop);\n        }\n    }\n}\n\n// Reproducer: https://github.com/SonarSource/sonar-dotnet/issues/9106\npublic class Repro_9106\n{\n    private int _foo; // Compliant\n\n    public ref int Foo => ref _foo;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/NotAssignedPrivateMember.razor",
    "content": "@namespace Razor\n<PageTitle @ref=\"@pageTitle\">\n</PageTitle>"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/NotAssignedPrivateMember.razor.cs",
    "content": "﻿using System;\nusing Microsoft.AspNetCore.Components;\n\nnamespace Razor\n{\n    public partial class NotAssignedPrivateMember\n    {\n        private ElementReference pageTitle; // Compliant - Assigned in the generated code for the razor file.\n\n        public void Test()\n        {\n            Console.WriteLine(pageTitle.ToString());\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/NumberPatternShouldBeRegular.CSharp9.cs",
    "content": "﻿nint n1 = 1000;\nnint n2 = 2_435_951;\nnint n3 = 0x01_00;\nnint n4 = 0b1_0000_0000;\nnint n5 = 0b1_00_00_00_00;\n\nnint n6 = 1_000_00_000;  // Noncompliant {{Review this number; its irregular pattern indicates an error.}}\n//        ^^^^^^^^^^^^\nnint n7 = 1_234_5; // Noncompliant\nnint n8 = 0b1_00_00_0000; // Noncompliant\n\nnuint u1 = 1000;\nnuint u2 = 2_435_951;\nnuint u3 = 0x01_00;\nnuint u4 = 0b1_0000_0000;\nnuint u5 = 0b1_00_00_00_00;\n\nnuint u6 = 1_000_00_000;  // Noncompliant {{Review this number; its irregular pattern indicates an error.}}\n//         ^^^^^^^^^^^^\nnuint u7 = 1_234_5; // Noncompliant\nnuint u8 = 0b1_00_00_0000; // Noncompliant\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/NumberPatternShouldBeRegular.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        private int field = 1_000;\n\n        public void CompliantCases()\n        {\n            var thousand = 1000;\n\n            // decimal notation\n            var balance = 2_435_951.68;\n            double multiGroupLengths = 1_234.56_78;\n            var groupsBeforDot = 1_234.11111;\n\n            // hexadecimal notation\n            var num = 0x01_00;\n\n            // binary notation\n            var num2 = 0b1_0000_0000;\n            var num3 = 0b1_00_00_00_00;\n\n            balance += 227_652;\n\n            Console.WriteLine(1_234);\n\n            // number types suffixes\n            ulong ulong1 = 1_000_000UL;\n            ulong ulong2 = 1_000_000ul;\n            ulong ulong3 = 1_000_000uL;\n            long long1 = 10_000L;\n            long long2 = 10_000l;\n            double double1 = 123.456D;\n            double double2 = 123.456d;\n            float float1 = 100.50F;\n            float float2 = 100.50f;\n            uint uint1 = 1_000U;\n            uint uint2 = 1_000u;\n            decimal decimal1 = 1_000.123M;\n            decimal decimal2 = 1_000.123m;\n        }\n\n        public void NonCompliantCases()\n        {\n            int million = 1_000_00_000;  // Noncompliant {{Review this number; its irregular pattern indicates an error.}}\n//                        ^^^^^^^^^^^^\n\n            var x = 1_234.56_78_123; // Noncompliant\n\n            var y = 1_234_5; // Noncompliant\n\n            var num2 = 0b1_00_00_0000; // Noncompliant\n\n            var num = 0x01_00_000; // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ObjectCreatedDropped.Latest.cs",
    "content": "﻿namespace S1848.ObjectCreatedDropped\n{\n    class Noncompliant\n    {\n        void CreatedOnly()\n        {\n            new SomeRecord(); // Noncompliant\n        }\n\n        record SomeRecord();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ObjectCreatedDropped.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Tests.TestCases\n{\n    class ObjectCreatedDropped\n    {\n        public object Method1()\n        {\n            new object(); // Noncompliant\n//          ^^^^^^^^^^^^\n\n            new ObjectCreatedDropped(); // Noncompliant {{Either remove this useless object instantiation of class 'ObjectCreatedDropped' or use it.}}\n\n            var x = new object();\n\n            var y = new ObjectCreatedDropped();\n\n            var objects = new object[] { new object(), new ObjectCreatedDropped() };\n\n            if (true)\n                new Exception(); // Noncompliant\n\n            var func = new Func<object>(() => new object());\n\n            func = new Func<object>(() =>\n            {\n                var o = new object();\n                new object(); // Noncompliant\n                return o;\n            });\n\n            var xx = func();\n\n            new Guid(); // Noncompliant, struct\n\n            new SomeDisposable(); // Noncompliant\n\n            return new object();\n        }\n\n        void Disposing()\n        {\n            using (new SomeDisposable()) // Compliant\n            {\n\n            }\n        }\n\n    }\n    class SomeDisposable : IDisposable\n    {\n        public void Dispose() { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ObsoleteAttributesNeedExplanation.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\n[Obsolete] // Noncompliant\nvoid LocalMethod()\n{ }\n\n[Obsolete] // Noncompliant\nstatic void StaticLocalMethod()\n{ }\n\n[Obsolete] // Noncompliant {{Add an explanation.}}\npublic record Record\n{\n    public void Method()\n    {\n        [Obsolete] // Noncompliant\n        static void LocalMethod()\n        { }\n    }\n}\n\nclass Noncompliant\n{\n\n    [Obsolete(\"\", true, DiagnosticId = \"42\")] // Noncompliant\n    void WithDiagnostics() { }\n\n    [Obsolete(\"\", true, DiagnosticId = \"42\", UrlFormat = \"https://sonarsource.com\")] // Noncompliant\n    void WithDiagnosticsAndUrlFormat() { }\n}\n\nclass Compliant\n{\n    [Obsolete(\"explanation\", true, DiagnosticId = \"42\")]\n    void WithDiagnostics() { }\n\n    [Obsolete(\"explanation\", true, DiagnosticId = \"42\", UrlFormat = \"https://sonarsource.com\")]\n    void WithDiagnosticsAndUrlFormat() { }\n}\n\nclass Ignore\n{\n    [Obsolete(UrlFormat = \"https://sonarsource.com\")]\n    void NamedParametersOnly() { } // FN\n}\n\ninternal class TestCases\n{\n    public void Bar(IEnumerable<int> collection)\n    {\n        [Obsolete] int Get() => 1; // Noncompliant\n\n        _ = collection.Select([Obsolete] (x) => x + 1); // Noncompliant\n\n        Action a = [Obsolete] () => { }; // Noncompliant\n\n        Action x = true\n                       ? ([Obsolete] () => { }) // Noncompliant\n                       : [Obsolete] () => { }; // Noncompliant\n\n        Call([Obsolete(\"something\")] (x) => { });\n    }\n\n    private void Call(Action<int> action) => action(1);\n}\n\npartial class PartialProperties\n{\n    [Obsolete] // Noncompliant\n    partial int Value { get; set; }\n\n    [Obsolete] // Noncompliant\n    partial int this[int x] { get; set; }\n}\n\npartial class PartialProperties\n{\n    partial int Value { get => 42; set { } }\n\n    partial int this[int x] { get => 42; set { } }\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ObsoleteAttributesNeedExplanation.VB14.vb",
    "content": "﻿' Commented line for concurrent namespace\n\nClass Noncompliant\n    <Obsolete(\"\", True, DiagnosticId:=\"42\")> ' Noncompliant\n    Sub WithDiagnostics()\n    End Sub\n\n    <Obsolete(\"\", True, DiagnosticId:=\"42\", UrlFormat:=\"https://sonarsource.com\")> ' Noncompliant\n    Sub WithDiagnosticsAndUrlFormat()\n    End Sub\nEnd Class\n\nClass Compliant\n    <Obsolete(\"explanation\", True, DiagnosticId:=\"42\")>\n    Sub WithDiagnostics()\n    End Sub\n\n    <Obsolete(\"explanation\", True, DiagnosticId:=\"42\", UrlFormat:=\"https://sonarsource.com\")>\n    Sub WithDiagnosticsAndUrlFormat()\n    End Sub\nEnd Class\n\nClass Ignore\n    <Obsolete(UrlFormat:=\"https://sonarsource.com\")>\n    Private Sub NamedParametersOnly() ' FP\n    End Sub\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ObsoleteAttributesNeedExplanation.cs",
    "content": "﻿using System;\n\n[Obsolete] // Noncompliant ^2#8 {{Add an explanation.}}\nclass Noncompliant\n{\n    [Obsolete()] // Noncompliant\n    void WithBrackets() { }\n\n    [System.Obsolete] // Noncompliant\n    void FullyDeclaredNamespace() { }\n\n    [global::System.Obsolete] // Noncompliant\n    void GloballyDeclaredNamespace() { }\n\n    [Obsolete(null)] // Noncompliant\n    void WithNull() { }\n\n    [Obsolete(\"\")] // Noncompliant\n    void WithEmptyString() { }\n\n    [Obsolete(\"  \")] // Noncompliant\n    void WithWhiteSpace() { }\n\n    [Obsolete(\"\", true)] // Noncompliant\n    void WithTwoArguments() { }\n\n    [Obsolete] // Noncompliant\n    [CLSCompliant(false)]\n    uint Multiple() { return 0; }\n\n    [Obsolete, CLSCompliant(false)]\n//   ^^^^^^^^\n    uint Combined() { return 0; }\n\n    [Obsolete] // Noncompliant\n    enum Enum { foo, bar }\n\n    [Obsolete] // Noncompliant\n    Noncompliant() { }\n\n    [Obsolete] // Noncompliant\n    void Method() { }\n\n    [Obsolete] // Noncompliant\n    int Property { get; set; }\n\n    [Obsolete] // Noncompliant\n    int Field;\n\n    [Obsolete] // Noncompliant\n    event EventHandler Event;\n\n    [Obsolete] // Noncompliant\n    delegate void Delegate();\n}\n\n[Obsolete] // Noncompliant\ninterface IInterface\n{\n    [Obsolete] // Noncompliant\n    void Method();\n}\n\n\n[Obsolete] // Noncompliant\nstruct ProgramStruct\n{\n    [Obsolete] // Noncompliant\n    void Method() { }\n}\n\n[Obsolete(\"explanation\")]\nclass Compliant\n{\n    [Obsolete(\"explanation\")]\n    enum Enum { foo, bar }\n\n    [Obsolete(\"explanation\")]\n    Compliant() { }\n\n    [Obsolete(\"explanation\")]\n    void Method() { }\n\n    [Obsolete(\"explanation\", true)]\n    void WithTwoArguments() { }\n\n    [Obsolete(\"explanation\")]\n    string Property { get; set; }\n\n    [Obsolete(\"explanation\", true)]\n    int Field;\n\n    [Obsolete(\"explanation\", false)]\n    event EventHandler Event;\n\n    [Obsolete(\"explanation\")]\n    delegate void Delegate();\n}\n\n[Obsolete(\"explanation\")]\ninterface IComplaintInterface\n{\n    [Obsolete(\"explanation\")]\n    void Method();\n}\n\n[Obsolete(\"explanation\")]\nstruct ComplaintStruct\n{\n    [Obsolete(\"explanation\")]\n    void Method() { }\n}\n\nclass Ignore\n{\n    // FP the value of error is taken.\n    [Obsolete(error: true, message: \"explanation\")] // Noncompliant\n    public void NamedParmetersDifferentOrderFP() { }\n\n    [Obsolete(error: true, message: \"\")] // Noncompliant for wrong reason \n    public void NamedParmetersDifferentOrder() { }\n}\n\nclass NotApplicable\n{\n    [CLSCompliant(false)]\n    enum Enum { foo, bar }\n\n    NotApplicable() { }\n\n    void Method() { }\n\n    int Property { get; set; }\n\n    int Field;\n\n    event EventHandler Event;\n\n    delegate void Delegate();\n\n    [NotSystem.Obsolete]\n    void SameName() { }\n}\n\nnamespace NotSystem\n{\n    public class ObsoleteAttribute : Attribute { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ObsoleteAttributesNeedExplanation.vb",
    "content": "﻿' Commented line for concurrent namespace\n\n<Obsolete>  ' Noncompliant^2#8 {{Add an explanation.}}\nClass Noncompliant\n    <Obsolete()> Sub WithBrackets() ' Noncompliant {{Add an explanation.}}\n'    ^^^^^^^^^^\n    End Sub\n\n    <System.Obsolete> ' Noncompliant\n    Sub FullyDeclaredNamespace()\n    End Sub\n\n    <Global.System.Obsolete> ' Noncompliant\n    Sub GloballyDeclaredNamespace()\n    End Sub\n\n    <Obsolete(Nothing)> ' Noncompliant\n    Sub WithNothing()\n    End Sub\n\n    <Obsolete(\"\")> ' Noncompliant\n    Sub WithEmptyString()\n    End Sub\n\n    <Obsolete(\"  \")> ' Noncompliant\n    Sub WithWhiteSpace()\n    End Sub\n\n    <Obsolete(\"\", True)> ' Noncompliant\n    Sub WithTwoArguments()\n    End Sub\n\n    <Obsolete> ' Noncompliant\n    <CLSCompliant(False)>\n    Function Multiple() As UInteger\n        Return 0\n    End Function\n\n    <Obsolete, CLSCompliant(False)> Function Combined() As UInteger ' Noncompliant\n        Return 0\n    End Function\n\n    <Obsolete> ' Noncompliant\n    Enum [Enum]\n        foo\n        bar\n    End Enum\n\n    <Obsolete> ' Noncompliant\n    Sub New()\n    End Sub\n\n    <Obsolete> ' Noncompliant\n    Sub Method()\n    End Sub\n\n    <Obsolete> ' Noncompliant\n    Property [Property] As Integer\n\n    <Obsolete> ' Noncompliant\n    Private Field As Integer\n\n    <Obsolete> ' Noncompliant\n    Event [Event] As EventHandler\n\n    <Obsolete> ' Noncompliant\n    Delegate Sub [Delegate]()\nEnd Class\n\n<Obsolete> ' Noncompliant\nInterface IInterface\n    <Obsolete> ' Noncompliant\n    Sub Method()\nEnd Interface\n\n<Obsolete> ' Noncompliant\nStructure ProgramStruct\n    <Obsolete> ' Noncompliant\n    Sub Method()\n    End Sub\nEnd Structure\n\n<Obsolete(\"explanation\")>\nClass Compliant\n    <Obsolete(\"explanation\")>\n    Enum [Enum]\n        foo\n        bar\n    End Enum\n\n    <Obsolete(\"explanation\")>\n    Sub New()\n    End Sub\n\n    <Obsolete(\"explanation\")>\n    Sub Method()\n    End Sub\n\n    <Obsolete(\"explanation\", True)>\n    Sub WithTwoArguments()\n    End Sub\n\n    <Obsolete(\"explanation\")>\n    Property [Property] As String\n\n    <Obsolete(\"explanation\", True)>\n    Private Field As Integer\n\n    <Obsolete(\"explanation\", False)>\n    Event [Event] As EventHandler\n\n    <Obsolete(\"explanation\")>\n    Delegate Sub [Delegate]()\nEnd Class\n\n<Obsolete(\"explanation\")>\nInterface IComplaintInterface\n    <Obsolete(\"explanation\")>\n    Sub Method()\nEnd Interface\n\n<Obsolete(\"explanation\")>\nStructure ComplaintStruct\n    <Obsolete(\"explanation\")>\n    Sub Method()\n    End Sub\nEnd Structure\n\nClass NotApplicable\n    <CLSCompliant(False)>\n    Enum [Enum]\n        foo\n        bar\n    End Enum\n\n    Sub New()\n    End Sub\n\n    Sub Method()\n    End Sub\n\n    Property [Property] As Integer\n\n    Private Field As Integer\n\n    Event [Event] As EventHandler\n\n    Delegate Sub [Delegate]()\n\n    <NotSystem.ObsoleteAttribute>\n    Sub SameName()\n    End Sub\nEnd Class\n\nNamespace NotSystem\n    Class ObsoleteAttribute\n        Inherits Attribute\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/OnErrorStatement.vb",
    "content": "﻿Module A\n    Sub DivideByZero()\n        On Error GoTo nextstep ' Noncompliant {{Remove this use of 'OnError'.}}\n'       ^^^^^^^^\n        On Error Resume Next ' Noncompliant\n        On Error GoTo - 1 ' Noncompliant\n        On Error GoTo 0 ' Noncompliant\n        Dim result As Integer\n        Dim num As Integer\n        num = 100\n        result = num / 0\nnextstep:\n        System.Console.WriteLine(\"Error\")\n    End Sub\nEnd Module"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/OperatorOverloadsShouldHaveNamedAlternatives.CSharp11.cs",
    "content": "﻿using System.Threading.Tasks;\nusing System;\n\ninternal interface IOperator<T> where T : IOperator<T>\n{\n    static virtual T operator ++(T input) => input; // Noncompliant {{Implement alternative method 'Increment' for the operator '++'.}}\n    static abstract T operator --(T input); // Noncompliant\n    static IOperator<T> operator ~(IOperator<T> input) => input; // Noncompliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/OperatorOverloadsShouldHaveNamedAlternatives.CSharp9.cs",
    "content": "﻿public record FooNotCompliant\n{\n    public static FooNotCompliant operator +(FooNotCompliant x, FooNotCompliant y) => null; // Noncompliant {{Implement alternative method 'Add' for the operator '+'.}}\n    public static FooNotCompliant operator &(FooNotCompliant x, FooNotCompliant y) => null; // Noncompliant {{Implement alternative method 'BitwiseAnd' for the operator '&'.}}\n    public static FooNotCompliant operator |(FooNotCompliant x, FooNotCompliant y) => null; // Noncompliant {{Implement alternative method 'BitwiseOr' for the operator '|'.}}\n    public static FooNotCompliant operator /(FooNotCompliant x, FooNotCompliant y) => null; // Noncompliant {{Implement alternative method 'Divide' for the operator '/'.}}\n    public static FooNotCompliant operator ^(FooNotCompliant x, FooNotCompliant y) => null; // Noncompliant {{Implement alternative method 'Xor' for the operator '^'.}}\n    public static FooNotCompliant operator >(FooNotCompliant x, FooNotCompliant y) => null; // Noncompliant {{Implement alternative method 'Compare' for the operator '>'.}}\n    public static FooNotCompliant operator <(FooNotCompliant x, FooNotCompliant y) => null; // Noncompliant {{Implement alternative method 'Compare' for the operator '<'.}}\n    public static FooNotCompliant operator >=(FooNotCompliant x, FooNotCompliant y) => null; // Noncompliant {{Implement alternative method 'Compare' for the operator '>='.}}\n    public static FooNotCompliant operator <=(FooNotCompliant x, FooNotCompliant y) => null; // Noncompliant {{Implement alternative method 'Compare' for the operator '<='.}}\n    public static FooNotCompliant operator --(FooNotCompliant x) => null; // Noncompliant {{Implement alternative method 'Decrement' for the operator '--'.}}\n    public static FooNotCompliant operator ++(FooNotCompliant x) => null; // Noncompliant {{Implement alternative method 'Increment' for the operator '++'.}}\n    public static FooNotCompliant operator <<(FooNotCompliant x, int y) => null; // Noncompliant {{Implement alternative method 'LeftShift' for the operator '<<'.}}\n    public static FooNotCompliant operator >>(FooNotCompliant x, int y) => null; // Noncompliant {{Implement alternative method 'RightShift' for the operator '>>'.}}\n    public static FooNotCompliant operator !(FooNotCompliant x) => null; // Noncompliant {{Implement alternative method 'LogicalNot' for the operator '!'.}}\n    public static FooNotCompliant operator %(FooNotCompliant x, FooNotCompliant y) => null; // Noncompliant {{Implement alternative method 'Mod' for the operator '%'.}}\n    public static FooNotCompliant operator *(FooNotCompliant x, FooNotCompliant y) => null; // Noncompliant {{Implement alternative method 'Multiply' for the operator '*'.}}\n    public static FooNotCompliant operator ~(FooNotCompliant x) => null; // Noncompliant {{Implement alternative method 'OnesComplement' for the operator '~'.}}\n    public static FooNotCompliant operator -(FooNotCompliant x, FooNotCompliant y) => null; // Noncompliant {{Implement alternative method 'Subtract' for the operator '-'.}}\n    public static bool operator true(FooNotCompliant x) => true; // Compliant, we don't check for true\n    public static bool operator false(FooNotCompliant x) => false; // Compliant, we don't check for false\n    public static FooNotCompliant operator -(FooNotCompliant x) => null; // Noncompliant {{Implement alternative method 'Negate' for the operator '-'.}}\n    public static FooNotCompliant operator +(FooNotCompliant x) => null; // Noncompliant {{Implement alternative method 'Plus' for the operator '+'.}}\n}\n\npublic record FooCompliant\n{\n    public static FooCompliant operator +(FooCompliant x, FooCompliant y) => null;\n    public static FooCompliant operator &(FooCompliant x, FooCompliant y) => null;\n    public static FooCompliant operator |(FooCompliant x, FooCompliant y) => null;\n    public static FooCompliant operator /(FooCompliant x, FooCompliant y) => null;\n    public static FooCompliant operator ^(FooCompliant x, FooCompliant y) => null;\n    public static FooCompliant operator >(FooCompliant x, FooCompliant y) => null;\n    public static FooCompliant operator <(FooCompliant x, FooCompliant y) => null;\n    public static FooCompliant operator >=(FooCompliant x, FooCompliant y) => null;\n    public static FooCompliant operator <=(FooCompliant x, FooCompliant y) => null;\n    public static FooCompliant operator --(FooCompliant x) => null;\n    public static FooCompliant operator ++(FooCompliant x) => null;\n    public static FooCompliant operator <<(FooCompliant x, int y) => null;\n    public static FooCompliant operator >>(FooCompliant x, int y) => null;\n    public static FooCompliant operator !(FooCompliant x) => null;\n    public static FooCompliant operator %(FooCompliant x, FooCompliant y) => null;\n    public static FooCompliant operator *(FooCompliant x, FooCompliant y) => null;\n    public static FooCompliant operator ~(FooCompliant x) => null;\n    public static FooCompliant operator -(FooCompliant x, FooCompliant y) => null;\n    public static FooCompliant operator -(FooCompliant x) => null;\n    public static FooCompliant operator +(FooCompliant x) => null;\n\n    public FooCompliant Add(FooCompliant y) => null;\n    public FooCompliant BitwiseAnd(FooCompliant x, FooCompliant y) => null;\n    public FooCompliant BitwiseOr(FooCompliant x, FooCompliant y) => null;\n    public FooCompliant Divide(FooCompliant x, FooCompliant y) => null;\n    public FooCompliant Xor(FooCompliant x, FooCompliant y) => null;\n    public bool Equals(FooCompliant x, FooCompliant y) => true;\n    public FooCompliant Compare(FooCompliant x, FooCompliant y) => null;\n    public FooCompliant Decrement(FooCompliant x) => null;\n    public FooCompliant Increment(FooCompliant x) => null;\n    public FooCompliant LeftShift(FooCompliant x, int y) => null;\n    public FooCompliant RightShift(FooCompliant x, int y) => null;\n    public FooCompliant LogicalNot(FooCompliant x) => null;\n    public FooCompliant Mod(FooCompliant x, FooCompliant y) => null;\n    public FooCompliant Multiply(FooCompliant x, FooCompliant y) => null;\n    public FooCompliant OnesComplement(FooCompliant x) => null;\n    public FooCompliant Subtract(FooCompliant x, FooCompliant y) => null;\n    public FooCompliant Negate(FooCompliant x) => null;\n    public FooCompliant Plus(FooCompliant x) => null;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/OperatorOverloadsShouldHaveNamedAlternatives.cs",
    "content": "﻿namespace Tests.Diagnostics\n{\n    public class FooNotCompliant\n    {\n        public static FooNotCompliant operator +(FooNotCompliant x, FooNotCompliant y) => null; // Noncompliant {{Implement alternative method 'Add' for the operator '+'.}}\n        public static FooNotCompliant operator &(FooNotCompliant x, FooNotCompliant y) => null; // Noncompliant {{Implement alternative method 'BitwiseAnd' for the operator '&'.}}\n        public static FooNotCompliant operator |(FooNotCompliant x, FooNotCompliant y) => null; // Noncompliant {{Implement alternative method 'BitwiseOr' for the operator '|'.}}\n        public static FooNotCompliant operator /(FooNotCompliant x, FooNotCompliant y) => null; // Noncompliant {{Implement alternative method 'Divide' for the operator '/'.}}\n        public static FooNotCompliant operator ^(FooNotCompliant x, FooNotCompliant y) => null; // Noncompliant {{Implement alternative method 'Xor' for the operator '^'.}}\n        public static bool operator ==(FooNotCompliant x, FooNotCompliant y) => true; // Noncompliant {{Implement alternative method 'Equals' for the operator '=='.}}\n        public static bool operator !=(FooNotCompliant x, FooNotCompliant y) => true; // Noncompliant {{Implement alternative method 'Equals' for the operator '!='.}}\n        public static FooNotCompliant operator >(FooNotCompliant x, FooNotCompliant y) => null; // Noncompliant {{Implement alternative method 'Compare' for the operator '>'.}}\n        public static FooNotCompliant operator <(FooNotCompliant x, FooNotCompliant y) => null; // Noncompliant {{Implement alternative method 'Compare' for the operator '<'.}}\n        public static FooNotCompliant operator >=(FooNotCompliant x, FooNotCompliant y) => null; // Noncompliant {{Implement alternative method 'Compare' for the operator '>='.}}\n        public static FooNotCompliant operator <=(FooNotCompliant x, FooNotCompliant y) => null; // Noncompliant {{Implement alternative method 'Compare' for the operator '<='.}}\n        public static FooNotCompliant operator --(FooNotCompliant x) => null; // Noncompliant {{Implement alternative method 'Decrement' for the operator '--'.}}\n        public static FooNotCompliant operator ++(FooNotCompliant x) => null; // Noncompliant {{Implement alternative method 'Increment' for the operator '++'.}}\n        public static FooNotCompliant operator <<(FooNotCompliant x, int y) => null; // Noncompliant {{Implement alternative method 'LeftShift' for the operator '<<'.}}\n        public static FooNotCompliant operator >>(FooNotCompliant x, int y) => null; // Noncompliant {{Implement alternative method 'RightShift' for the operator '>>'.}}\n        public static FooNotCompliant operator !(FooNotCompliant x) => null; // Noncompliant {{Implement alternative method 'LogicalNot' for the operator '!'.}}\n        public static FooNotCompliant operator %(FooNotCompliant x, FooNotCompliant y) => null; // Noncompliant {{Implement alternative method 'Mod' for the operator '%'.}}\n        public static FooNotCompliant operator *(FooNotCompliant x, FooNotCompliant y) => null; // Noncompliant {{Implement alternative method 'Multiply' for the operator '*'.}}\n        public static FooNotCompliant operator ~(FooNotCompliant x) => null; // Noncompliant {{Implement alternative method 'OnesComplement' for the operator '~'.}}\n        public static FooNotCompliant operator -(FooNotCompliant x, FooNotCompliant y) => null; // Noncompliant {{Implement alternative method 'Subtract' for the operator '-'.}}\n        public static bool operator true(FooNotCompliant x) => true; // Compliant, we don't check for true\n        public static bool operator false(FooNotCompliant x) => false; // Compliant, we don't check for false\n        public static FooNotCompliant operator -(FooNotCompliant x) => null; // Noncompliant {{Implement alternative method 'Negate' for the operator '-'.}}\n        public static FooNotCompliant operator +(FooNotCompliant x) => null; // Noncompliant {{Implement alternative method 'Plus' for the operator '+'.}}\n    }\n\n    public class FooCompliant\n    {\n        public static FooCompliant operator +(FooCompliant x, FooCompliant y) => null;\n        public static FooCompliant operator &(FooCompliant x, FooCompliant y) => null;\n        public static FooCompliant operator |(FooCompliant x, FooCompliant y) => null;\n        public static FooCompliant operator /(FooCompliant x, FooCompliant y) => null;\n        public static FooCompliant operator ^(FooCompliant x, FooCompliant y) => null;\n        public static bool operator ==(FooCompliant x, FooCompliant y) => true;\n        public static bool operator !=(FooCompliant x, FooCompliant y) => true;\n        public static FooCompliant operator >(FooCompliant x, FooCompliant y) => null;\n        public static FooCompliant operator <(FooCompliant x, FooCompliant y) => null;\n        public static FooCompliant operator >=(FooCompliant x, FooCompliant y) => null;\n        public static FooCompliant operator <=(FooCompliant x, FooCompliant y) => null;\n        public static FooCompliant operator --(FooCompliant x) => null;\n        public static FooCompliant operator ++(FooCompliant x) => null;\n        public static FooCompliant operator <<(FooCompliant x, int y) => null;\n        public static FooCompliant operator >>(FooCompliant x, int y) => null;\n        public static FooCompliant operator !(FooCompliant x) => null;\n        public static FooCompliant operator %(FooCompliant x, FooCompliant y) => null;\n        public static FooCompliant operator *(FooCompliant x, FooCompliant y) => null;\n        public static FooCompliant operator ~(FooCompliant x) => null;\n        public static FooCompliant operator -(FooCompliant x, FooCompliant y) => null;\n        public static FooCompliant operator -(FooCompliant x) => null;\n        public static FooCompliant operator +(FooCompliant x) => null;\n\n        public FooCompliant Add(FooCompliant y) => null;\n        public FooCompliant BitwiseAnd(FooCompliant x, FooCompliant y) => null;\n        public FooCompliant BitwiseOr(FooCompliant x, FooCompliant y) => null;\n        public FooCompliant Divide(FooCompliant x, FooCompliant y) => null;\n        public FooCompliant Xor(FooCompliant x, FooCompliant y) => null;\n        public bool Equals(FooCompliant x, FooCompliant y) => true;\n        public FooCompliant Compare(FooCompliant x, FooCompliant y) => null;\n        public FooCompliant Decrement(FooCompliant x) => null;\n        public FooCompliant Increment(FooCompliant x) => null;\n        public FooCompliant LeftShift(FooCompliant x, int y) => null;\n        public FooCompliant RightShift(FooCompliant x, int y) => null;\n        public FooCompliant LogicalNot(FooCompliant x) => null;\n        public FooCompliant Mod(FooCompliant x, FooCompliant y) => null;\n        public FooCompliant Multiply(FooCompliant x, FooCompliant y) => null;\n        public FooCompliant OnesComplement(FooCompliant x) => null;\n        public FooCompliant Subtract(FooCompliant x, FooCompliant y) => null;\n        public FooCompliant Negate(FooCompliant x) => null;\n        public FooCompliant Plus(FooCompliant x) => null;\n    }\n\n    // For comparison operators we allow \"CompareTo\" in addition to \"Compare\"\n    public class FooCompliant_OtherNames\n    {\n        public static FooCompliant operator >(FooCompliant_OtherNames x, FooCompliant_OtherNames y) => null;\n        public static FooCompliant operator <(FooCompliant_OtherNames x, FooCompliant_OtherNames y) => null;\n        public static FooCompliant operator >=(FooCompliant_OtherNames x, FooCompliant_OtherNames y) => null;\n        public static FooCompliant operator <=(FooCompliant_OtherNames x, FooCompliant_OtherNames y) => null;\n\n        public FooCompliant CompareTo(FooCompliant x, FooCompliant y) => null;\n    }\n\n    public class FooCompliant_Static\n    {\n        public static FooCompliant_Static operator +(FooCompliant_Static x, FooCompliant_Static y) => null;\n\n        public static FooCompliant_Static Add(FooCompliant_Static y) => null;\n    }\n\n    public class FooCompliant_OtherArguments\n    {\n        public static FooCompliant_OtherArguments operator +(FooCompliant_OtherArguments x, FooCompliant_OtherArguments y) => null;\n\n        // We don't care about return type, argument count and types, just as FxCop\n        public FooCompliant_OtherArguments Add() => null;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/OperatorsShouldBeOverloadedConsistently.Latest.cs",
    "content": "﻿public record Compliant // Compliant as == operator cannot be overloaded for records.\n{\n    public static object operator +(Compliant a, Compliant b) => new object();\n    public static object operator -(Compliant a, Compliant b) => new object();\n    public static object operator *(Compliant a, Compliant b) => new object();\n    public static object operator /(Compliant a, Compliant b) => new object();\n    public static object operator %(Compliant a, Compliant b) => new object();\n}\n\npublic record OnlyPlus // Compliant\n{\n    public static object operator +(OnlyPlus a, OnlyPlus b) => new object();\n}\n\npublic record OnlyMinus // Compliant\n{\n    public static object operator -(OnlyMinus a, OnlyMinus b) => new object();\n}\n\npublic record OnlyMultiply // Compliant\n{\n    public static object operator -(OnlyMultiply a, OnlyMultiply b) => new object();\n}\n\npublic record OnlyDevide // Compliant\n{\n    public static object operator -(OnlyDevide a, OnlyDevide b) => new object();\n}\n\npublic record OnlyReminder // Compliant\n{\n    public static object operator -(OnlyReminder a, OnlyReminder b) => new object();\n}\n\n// Issues are not raised in Interface implementations.\n// Interfaces are used to describe the operators supported by a type in a fine grained way\npublic interface IPlus<TSelf> where TSelf : IPlus<TSelf>\n{\n    static virtual TSelf operator +(TSelf a, TSelf b) => a;\n}\npublic interface IMinus<TSelf> where TSelf : IMinus<TSelf>\n{\n    static abstract TSelf operator -(TSelf a, TSelf b);\n}\npublic interface IMulti\n{\n    static IMulti operator *(IMulti a, IMulti b) => a;\n}\n\npublic class OperatorsInExtensionNoEqualsOperator // FN https://sonarsource.atlassian.net/browse/NET-2774\n\n{\n    public int left;\n    public int right;\n\n    public OperatorsInExtensionNoEqualsOperator(int l, int r)\n    {\n        this.left = l;\n        this.right = r;\n    }\n}\n\npublic class EqualsMethodsInExtensionsEqualsOperatorInClass // Noncompliant\n{\n    public static object operator ==(EqualsMethodsInExtensionsEqualsOperatorInClass a, EqualsMethodsInExtensionsEqualsOperatorInClass b) => new object();\n    public static object operator !=(EqualsMethodsInExtensionsEqualsOperatorInClass a, EqualsMethodsInExtensionsEqualsOperatorInClass b) => new object();\n}\n\npublic class EqualsOperatorsInExtensionsEqualsMethodsInClass // FN https://sonarsource.atlassian.net/browse/NET-2774\n{\n    public override bool Equals(object obj) => false;\n    public override int GetHashCode() => 0;\n}\n\npublic class SingleOperatorsInClassEqualsOperatorsInExtensions // Noncompliant FP https://sonarsource.atlassian.net/browse/NET-2774\n{\n    public static object operator +(SingleOperatorsInClassEqualsOperatorsInExtensions a, SingleOperatorsInClassEqualsOperatorsInExtensions b) => new object();\n    public static object operator -(SingleOperatorsInClassEqualsOperatorsInExtensions a, SingleOperatorsInClassEqualsOperatorsInExtensions b) => new object();\n\n    public override bool Equals(object obj) => false;\n    public override int GetHashCode() => 0;\n}\n\npublic class EqualsOperatorsInClassSingleOperatorsInExtensions // Noncompliant\n{\n    public static object operator ==(EqualsOperatorsInClassSingleOperatorsInExtensions a, EqualsOperatorsInClassSingleOperatorsInExtensions b) => new object();\n    public static object operator !=(EqualsOperatorsInClassSingleOperatorsInExtensions a, EqualsOperatorsInClassSingleOperatorsInExtensions b) => new object();\n}\n\n\npublic static class Extensions\n{\n    extension(OperatorsInExtensionNoEqualsOperator)\n    {\n        public static object operator +(OperatorsInExtensionNoEqualsOperator a, OperatorsInExtensionNoEqualsOperator b) => new object();\n        public static object operator -(OperatorsInExtensionNoEqualsOperator a, OperatorsInExtensionNoEqualsOperator b) => new object();\n    }\n\n    extension(EqualsMethodsInExtensionsEqualsOperatorInClass)\n    {\n        public static bool Equals(object obj) => false;\n        public static int GetHashCode() => 0;\n    }\n\n    extension(EqualsOperatorsInExtensionsEqualsMethodsInClass)\n    {\n        public static object operator ==(EqualsOperatorsInExtensionsEqualsMethodsInClass a, EqualsOperatorsInExtensionsEqualsMethodsInClass b) => new object();\n        public static object operator !=(EqualsOperatorsInExtensionsEqualsMethodsInClass a, EqualsOperatorsInExtensionsEqualsMethodsInClass b) => new object();\n    }\n\n    extension(SingleOperatorsInClassEqualsOperatorsInExtensions)\n    {\n        public static object operator ==(SingleOperatorsInClassEqualsOperatorsInExtensions a, SingleOperatorsInClassEqualsOperatorsInExtensions b) => new object();\n        public static object operator !=(SingleOperatorsInClassEqualsOperatorsInExtensions a, SingleOperatorsInClassEqualsOperatorsInExtensions b) => new object();\n    }\n\n    extension(EqualsOperatorsInClassSingleOperatorsInExtensions)\n    {\n        public static object operator +(EqualsOperatorsInClassSingleOperatorsInExtensions a, EqualsOperatorsInClassSingleOperatorsInExtensions b) => new object();\n        public static object operator -(EqualsOperatorsInClassSingleOperatorsInExtensions a, EqualsOperatorsInClassSingleOperatorsInExtensions b) => new object();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/OperatorsShouldBeOverloadedConsistently.cs",
    "content": "﻿using System;\n\nnamespace MyLibrary\n{\n    public class Foo\n//               ^^^ Noncompliant {{Provide an implementation for: 'operator==', 'operator!=', 'Object.Equals' and 'Object.GetHashCode'.}}\n    {\n        private int left;\n        private int right;\n\n        public Foo(int l, int r)\n        {\n            this.left = l;\n            this.right = r;\n        }\n\n        public static Foo operator +(Foo a, Foo b)\n        {\n            return new Foo(a.left + b.left, a.right + b.right);\n        }\n\n        public static Foo operator -(Foo a, Foo b)\n        {\n            return new Foo(a.left - b.left, a.right - b.right);\n        }\n\n        public static Foo operator *(Foo a, Foo b)\n        {\n            return new Foo(a.left * b.left, a.right * b.right);\n        }\n\n        public static Foo operator /(Foo a, Foo b)\n        {\n            return new Foo(a.left / b.left, a.right / b.right);\n        }\n\n        public static Foo operator %(Foo a, Foo b)\n        {\n            return new Foo(a.left % b.left, a.right % b.right);\n        }\n    }\n\n    public class Foo2\n    {\n        public static object operator +(Foo2 a, Foo2 b) => new object();\n        public static object operator -(Foo2 a, Foo2 b) => new object();\n        public static object operator *(Foo2 a, Foo2 b) => new object();\n        public static object operator /(Foo2 a, Foo2 b) => new object();\n        public static object operator %(Foo2 a, Foo2 b) => new object();\n        public static object operator ==(Foo2 a, Foo2 b) => new object();\n        public static object operator !=(Foo2 a, Foo2 b) => new object();\n\n        public override bool Equals(object obj) => false;\n        public override int GetHashCode() => 0;\n    }\n\n    public class Foo3\n    {\n        public static object operator -(Foo3 a, Foo3 b) => new object();\n        public static object operator ==(Foo3 a, Foo3 b) => new object();\n        public static object operator !=(Foo3 a, Foo3 b) => new object();\n\n        public override bool Equals(object obj) => false;\n        public override int GetHashCode() => 0;\n    }\n\n\n    public class Foo4\n    {\n        public static object operator ==(Foo4 a, Foo4 b) => new object();\n        public static object operator !=(Foo4 a, Foo4 b) => new object();\n\n        public override bool Equals(object obj) => false;\n        public override int GetHashCode() => 0;\n    }\n\n    public class Foo5 // Compliant - Covered by CS0216\n    {\n        public static object operator !=(Foo5 a, Foo5 b) => new object(); // Error [CS0216] - requires == operator\n\n        public override bool Equals(object obj) => false;\n        public override int GetHashCode() => 0;\n    }\n\n    public class Foo6\n//               ^^^^ Noncompliant {{Provide an implementation for: 'Object.Equals' and 'Object.GetHashCode'.}}\n    {\n        public static object operator ==(Foo6 a, Foo6 b) => new object(); // Error [CS0216] - requires != operator\n    }\n\n    public class Foo8 // Noncompliant {{Provide an implementation for: 'operator==', 'operator!=', 'Object.Equals' and 'Object.GetHashCode'.}}\n    {\n        public static Foo8 operator +(Foo8 a, Foo8 b) => new Foo8();\n    }\n\n    public class Foo9 // Noncompliant {{Provide an implementation for: 'operator==', 'operator!=', 'Object.Equals' and 'Object.GetHashCode'.}}\n    {\n        public static Foo9 operator -(Foo9 a, Foo9 b) => new Foo9();\n    }\n\n    public class Foo10 // Noncompliant {{Provide an implementation for: 'operator==', 'operator!=', 'Object.Equals' and 'Object.GetHashCode'.}}\n    {\n        public static Foo10 operator *(Foo10 a, Foo10 b) => new Foo10();\n    }\n\n    public class Foo11 // Noncompliant {{Provide an implementation for: 'operator==', 'operator!=', 'Object.Equals' and 'Object.GetHashCode'.}}\n    {\n        public static Foo11 operator /(Foo11 a, Foo11 b) => new Foo11();\n    }\n\n    public class Foo12 // Noncompliant {{Provide an implementation for: 'operator==', 'operator!=', 'Object.Equals' and 'Object.GetHashCode'.}}\n    {\n        public static Foo12 operator %(Foo12 a, Foo12 b) => new Foo12();\n    }\n\n    public class Foo13 // Compliant as the unary operators are overriden\n    {\n        public static Foo13 operator +(Foo13 a) => new Foo13();\n        public static Foo13 operator -(Foo13 a) => new Foo13();\n    }\n}\n\npublic class EqualsOperatorInClassEqualsMethodsInExtensions // Noncompliant\n{\n    public static object operator ==(EqualsOperatorInClassEqualsMethodsInExtensions a, EqualsOperatorInClassEqualsMethodsInExtensions b) => new object();\n    public static object operator !=(EqualsOperatorInClassEqualsMethodsInExtensions a, EqualsOperatorInClassEqualsMethodsInExtensions b) => new object();\n}\n\npublic static class ClassicExtensions\n{\n    public static bool Equals(this EqualsOperatorInClassEqualsMethodsInExtensions self, object obj) => false;\n    public static int GetHashCode(this EqualsOperatorInClassEqualsMethodsInExtensions self) => 0;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/OptionalParameter.CSharp10.cs",
    "content": "﻿using System.Runtime.CompilerServices;\n\nnamespace Tests.Diagnostics\n{\n    public class CallerMember\n    {\n        public void Caller_ArgumentExpression(bool condition, [CallerArgumentExpression(\"condition\")] string message = null) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/OptionalParameter.CSharp11.cs",
    "content": "﻿namespace Tests.Diagnostics\n{\n    public interface IInterface\n    {\n        static abstract void Method(int i = 42); //Noncompliant\n//                                        ^^^^\n    }\n\n    public class Base : IInterface\n    {\n        public static void Method(int i = 42)\n        {\n        }\n\n        public static void Method2(int i = 42) //Noncompliant {{Use the overloading mechanism instead of the optional parameters.}}\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/OptionalParameter.Web.cs",
    "content": "﻿using Microsoft.AspNetCore.Mvc;\n\nnamespace WebApplication1.Controllers\n{\n    [ApiController]\n    [Route(\"[controller]/[action]\")]\n    public class MyController : ControllerBase\n    {\n        [HttpGet]\n        public IActionResult Get([FromQuery] string msg = \"\") // Noncompliant - FP\n        {\n            return Ok(msg);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/OptionalParameter.cs",
    "content": "﻿using System.Runtime.CompilerServices;\n\nnamespace Tests.Diagnostics\n{\n    public interface IInterface\n    {\n        void Method(int i = 42); //Noncompliant\n//                        ^^^^\n    }\n\n    public class Base\n    {\n        public virtual void Method(int i = 42) //Noncompliant {{Use the overloading mechanism instead of the optional parameters.}}\n        { }\n    }\n\n    public class OptionalParameter : Base\n    {\n        public override void Method(int i = 42) //Compliant\n        {\n            base.Method(i);\n        }\n        public OptionalParameter(int i = 0, // Noncompliant\n            int j = 1) // Noncompliant\n        {\n        }\n        public OptionalParameter()\n        {\n        }\n        private OptionalParameter(int i = 0) // Compliant, private\n        {\n        }\n\n        private void PrivateFoo(int i = 42) // Compliant, private\n        { }\n\n        internal void InternalFoo(int i = 42) // Compliant, internal\n        { }\n\n        protected void ProtectedFoo(int i = 42) // Noncompliant\n        { }\n\n        internal protected void InternalProtectedFoo(int i = 42) // Noncompliant\n        {\n        }\n\n        public void PublicFoo(int i = 42) // Noncompliant\n        { }\n    }\n\n    public class CallerMember\n    {\n        public void Caller_LineNumber([CallerLineNumber] int line = 0) { }\n        public void Caller_FilePath([CallerFilePath] string sourceFilePath = \"\") { }\n        public void Caller_MemberName([CallerMemberName] string memberName = \"\") { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/OptionalParameter.vb",
    "content": "﻿Imports System.Collections.Generic\n\nNamespace Tests.Diagnostics\n    Public Class OptionalParameter\n\n        Public Sub New(Optional ByVal i As Integer = 5, 'Noncompliant\n                       Optional ByVal j As Integer = 5) 'Noncompliant {{Use the overloading mechanism instead of the optional parameters.}}\n'                      ^^^^^^^^\n        End Sub\n        Public Function F(Optional ByVal i As Integer = 5) 'Noncompliant\n        End Function\n        Public Sub S(Optional ByVal i As Integer = 5) 'Noncompliant\n        End Sub\n        Public Sub SubNoParams\n        End Sub\n        Public Sub New()\n        End Sub\n\n        ReadOnly Property num(Optional i As Integer = 10) As String 'Noncompliant\n            Get\n                Return 42\n            End Get\n        End Property\n\n\n        Friend Function Fr(Optional ByVal i As Integer = 5) ' Compliant, friend\n        End Function\n    End Class\n\n    Public Class CallerMember\n        Public Sub Method(<System.Runtime.CompilerServices.CallerLineNumber> Optional line As Integer = 0)\n\n        End Sub\n    End Class\nEnd Namespace\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/OptionalParameterNotPassedToBaseCall.Latest.cs",
    "content": "﻿record Base\n{\n    public virtual void MyMethod(int j, int i = 1) { }\n    public virtual void MyMethod2(int i = 1) { }\n}\n\nrecord Derived : Base\n{\n    public override void MyMethod(int j, int i = 1)\n    {\n        base.MyMethod(1); // Noncompliant {{Pass the missing user-supplied parameter value to this 'base' call.}}\n//      ^^^^^^^^^^^^^^^^\n        base.MyMethod(j); // Noncompliant {{Pass the missing user-supplied parameter value to this 'base' call.}}\n        base.MyMethod2();\n        this.MyMethod(1);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/OptionalParameterNotPassedToBaseCall.cs",
    "content": "﻿namespace Tests.Diagnostics\n{\n    public class BaseClass\n    {\n        public virtual void MyMethod(int j, int i = 1) { }\n        public virtual void MyMethod2(int i = 1) { }\n    }\n\n    public class DerivedClass : BaseClass\n    {\n        public override void MyMethod(int j, int i = 1)\n        {\n            base.MyMethod(1); // Noncompliant {{Pass the missing user-supplied parameter value to this 'base' call.}}\n//          ^^^^^^^^^^^^^^^^\n            base.MyMethod(j); // Noncompliant {{Pass the missing user-supplied parameter value to this 'base' call.}}\n            base.MyMethod2();\n            this.MyMethod(1);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/OptionalParameterNotPassedToBaseCall.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\n\nNamespace Tests.Diagnostics\n    Public Class BaseClass\n        Public Overridable Sub MyMethod(ByVal j As Integer, ByVal Optional i As Integer = 1)\n        End Sub\n\n        Public Overridable Sub MyMethod2(ByVal Optional i As Integer = 1)\n        End Sub\n    End Class\n\n    Public Class DerivedClass\n        Inherits BaseClass\n\n        Public Overrides Sub MyMethod(ByVal j As Integer, ByVal Optional i As Integer = 1)\n            MyBase.MyMethod(1) ' Noncompliant {{Pass the missing user-supplied parameter value to this 'base' call.}}\n'           ^^^^^^^^^^^^^^^^^^\n            MyBase.MyMethod(j) ' Noncompliant {{Pass the missing user-supplied parameter value to this 'base' call.}}\n            MyBase.MyMethod2()\n            Me.MyMethod(1)\n        End Sub\n\n        Public Overrides Sub MyMethod2(Optional i As Integer = 1)\n        ' Special for VB.NET: Call without parentheses must be handled\n            MyBase.MyMethod2 ' Noncompliant {{Pass the missing user-supplied parameter value to this 'base' call.}}\n'           ^^^^^^^^^^^^^^^^\n        End Sub\n\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/OptionalParameterWithDefaultValue.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\nusing System.ComponentModel;\n\nnamespace Tests.Diagnostics\n{\n    public class OptionalParameterWithDefaultValue\n    {\n        class MyClass\n        {\n            public void DoStuff([Optional][DefaultParameterValue(4)]int i, int j = 5) // Fixed\n            {\n                Console.WriteLine(i);\n            }\n\n            public void DoStuff1([Optional][DefaultParameterValue(value: 4)]int i, int j = 5) // Fixed\n            {\n                Console.WriteLine(i);\n            }\n\n            public void DoStuff2([Optional][DefaultParameterValue(4)]int i, int j = 5)\n            {\n                Console.WriteLine(i);\n            }\n\n            public void DoStuff3([DefaultValue(4)]int i, int j = 5) // okay, we have no idea what the intent was\n            {\n                Console.WriteLine(i);\n            }\n\n            public void DoStuff4([Optional][DefaultValue(typeof(int), \"1\")]int i, int j = 5) // Fixed\n            {\n                Console.WriteLine(i);\n            }\n\n            public static void Main()\n            {\n                new MyClass().DoStuff(); // prints 0\n                new MyClass().DoStuff2(); // prints 4\n            }\n\n            public void DoStuff5([DefaultParameterValue(4)][DefaultValue(4)]int i, int j = 5) // Compliant, S3450 will trigger\n            {\n                Console.WriteLine(i);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/OptionalParameterWithDefaultValue.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\nusing System.ComponentModel;\n\nnamespace Tests.Diagnostics\n{\n    public interface OptionalParameterWithDefaultValue\n    {\n            static virtual void Virtual([Optional][DefaultValue(4)]int i, int j = 5) // Noncompliant\n            {\n                Console.WriteLine(i);\n            }\n\n            static abstract void Abstract([Optional] [DefaultValue(4)] int i, int j = 5); // Noncompliant\n\n            static abstract void Abstract2([Optional] [DefaultParameterValue(4)] int i, int j = 5); // Compliant\n\n            static virtual void DoStuff3([Optional][DefaultParameterValue(4)]int i, int j = 5)\n            {\n                Console.WriteLine(i);\n            }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/OptionalParameterWithDefaultValue.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\nusing System.ComponentModel;\n\nnamespace Tests.Diagnostics\n{\n    public class OptionalParameterWithDefaultValue\n    {\n        class MyClass\n        {\n            public void DoStuff([Optional][DefaultValue(4)]int i, int j = 5) // Noncompliant\n//                                         ^^^^^^^^^^^^^^^\n            {\n                Console.WriteLine(i);\n            }\n\n            public void DoStuff1([Optional][DefaultValue(value: 4)]int i, int j = 5) // Noncompliant {{Use '[DefaultParameterValue]' instead.}}\n            {\n                Console.WriteLine(i);\n            }\n\n            public void DoStuff2([Optional][DefaultParameterValue(4)]int i, int j = 5)\n            {\n                Console.WriteLine(i);\n            }\n\n            public void DoStuff3([DefaultValue(4)]int i, int j = 5) // okay, we have no idea what the intent was\n            {\n                Console.WriteLine(i);\n            }\n\n            public void DoStuff4([Optional][DefaultValue(typeof(int), \"1\")]int i, int j = 5) // Noncompliant, can't fix\n            {\n                Console.WriteLine(i);\n            }\n\n            public static void Main()\n            {\n                new MyClass().DoStuff(); // prints 0\n                new MyClass().DoStuff2(); // prints 4\n            }\n\n            public void DoStuff5([DefaultParameterValue(4)][DefaultValue(4)]int i, int j = 5) // Compliant, S3450 will trigger\n            {\n                Console.WriteLine(i);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/OptionalRefOutParameter.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\n\nnamespace Tests.Diagnostics\n{\n    public class OptionalRefOutParameter\n    {\n        public void DoStuff(ref int i) // Fixed\n        {\n            Console.WriteLine(i);\n        }\n        public void DoStuff2(out int i) // Fixed\n        {\n            i = 23;\n            Console.WriteLine(i);\n        }\n        public void DoStuff3([Optional] int i)\n        {\n            Console.WriteLine(i);\n        }\n\n        public static void Main()\n        {\n            new MyClass().DoStuff(); // Error [CS0246]\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/OptionalRefOutParameter.Latest.cs",
    "content": "﻿using System.Runtime.InteropServices;\n\npublic record OptionalRefOutParameter\n{\n    public void WithRefParam([Optional] ref int i) { } // Noncompliant\n//                            ^^^^^^^^\n\n    public void WithOutParam([Optional] out int i) // Noncompliant {{Remove the 'Optional' attribute, it cannot be used with 'out'.}}\n    {\n        i = 23;\n    }\n\n    public void Compliant([Optional] int i) { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/OptionalRefOutParameter.TopLevelStatements.cs",
    "content": "﻿using System.Runtime.InteropServices;\n\nstatic void WithRefParam([Optional] ref int i) { } // Noncompliant\n//                        ^^^^^^^^\n\nstatic void WithOutParam([Optional] out int i) // Noncompliant {{Remove the 'Optional' attribute, it cannot be used with 'out'.}}\n{\n    i = 23;\n}\n\nstatic void Compliant([Optional] int i) { }\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/OptionalRefOutParameter.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\n\nnamespace Tests.Diagnostics\n{\n    public class OptionalRefOutParameter\n    {\n        public void DoStuff([Optional] ref int i) // Noncompliant\n//                           ^^^^^^^^\n        {\n            Console.WriteLine(i);\n        }\n        public void DoStuff2([Optional] out int i) // Noncompliant {{Remove the 'Optional' attribute, it cannot be used with 'out'.}}\n        {\n            i = 23;\n            Console.WriteLine(i);\n        }\n        public void DoStuff3([Optional] int i)\n        {\n            Console.WriteLine(i);\n        }\n\n        public static void Main()\n        {\n            new MyClass().DoStuff(); // Error [CS0246]\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/OrderByRepeated.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Tests.Diagnostics\n{\n\n    class OrderByRepeated\n    {\n        public void Test()\n        {\n            new int[] { 1, 2, 3 }.OrderBy(i => i).ThenBy(i => i); //Fixed\n            new int[] { 1, 2, 3 }.OrderBy(i => i).ThenBy(i => i);\n            new string[] { \"\" }\n                .OrderBy(i => i, StringComparer.CurrentCultureIgnoreCase)\n                .ThenBy(i => i); //Fixed\n            new string[] { \"\" }\n                .OrderBy(i => i, StringComparer.CurrentCultureIgnoreCase)\n                .ThenBy(i => i, StringComparer.CurrentCultureIgnoreCase)\n                .ThenBy(i => i); //Fixed\n        }\n\n        public void Coverage()\n        {\n            new int[] { 1, 2, 3 }.OrderBy(i => i).Count();\n            new int[] { 1, 2, 3 }.Select(i => i).OrderBy(i => i);\n            new int[] { 1, 2, 3 }.OrderBy(\"x\").ThenBy(\"x\");\n            new int[] { 1, 2, 3 }.OrderBy(i => i).ThenBy(\"x\");\n            new int[] { 1, 2, 3 }.OrderBy(i => i).ThenBy(\"x\"); // Fixed\n            new int[] { 1, 2, 3 }.OrderBy(\"x\").ThenBy(i => i);\n            var array = new int[] { 1, 2, 3 };\n            MyExtensions.OrderBy(MyExtensions.OrderBy(array, \"x\"), \"x\");\n            Foo();\n        }\n\n        public void Foo() { }\n    }\n\n    static class MyExtensions\n    {\n        public static IOrderedEnumerable<int> OrderBy(this IEnumerable<int> source, string x) => null;\n        public static IEnumerable<int> ThenBy(this IEnumerable<int> source, string x) => null;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/OrderByRepeated.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Tests.Diagnostics\n{\n\n    class OrderByRepeated\n    {\n        public void Test()\n        {\n            new int[] { 1, 2, 3 }.OrderBy(i => i).OrderBy(i => i); //Noncompliant\n//                                                ^^^^^^^\n            new int[] { 1, 2, 3 }.OrderBy(i => i).ThenBy(i => i);\n            new string[] { \"\" }\n                .OrderBy(i => i, StringComparer.CurrentCultureIgnoreCase)\n                .OrderBy(i => i); //Noncompliant {{Use 'ThenBy' instead.}}\n            new string[] { \"\" }\n                .OrderBy(i => i, StringComparer.CurrentCultureIgnoreCase)\n                .ThenBy(i => i, StringComparer.CurrentCultureIgnoreCase)\n                .OrderBy(i => i); //Noncompliant\n        }\n\n        public void Coverage()\n        {\n            new int[] { 1, 2, 3 }.OrderBy(i => i).Count();\n            new int[] { 1, 2, 3 }.Select(i => i).OrderBy(i => i);\n            new int[] { 1, 2, 3 }.OrderBy(\"x\").ThenBy(\"x\");\n            new int[] { 1, 2, 3 }.OrderBy(i => i).ThenBy(\"x\");\n            new int[] { 1, 2, 3 }.OrderBy(i => i).OrderBy(\"x\"); // Noncompliant\n            new int[] { 1, 2, 3 }.OrderBy(\"x\").ThenBy(i => i);\n            var array = new int[] { 1, 2, 3 };\n            MyExtensions.OrderBy(MyExtensions.OrderBy(array, \"x\"), \"x\");\n            Foo();\n        }\n\n        public void Foo() { }\n    }\n\n    static class MyExtensions\n    {\n        public static IOrderedEnumerable<int> OrderBy(this IEnumerable<int> source, string x) => null;\n        public static IEnumerable<int> ThenBy(this IEnumerable<int> source, string x) => null;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/OverrideGetHashCodeOnOverridingEquals.Latest.cs",
    "content": "﻿public record OverrideOnlyGetHashCode // Compliant - `Equals can't be overridden for records`\n{\n    public override int GetHashCode()\n    {\n        return base.GetHashCode();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/OverrideGetHashCodeOnOverridingEquals.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    interface IInterface\n    {\n\n    }\n\n    class OverrideOnlyEqualsClass // Noncompliant {{This class overrides 'Equals' and should therefore also override 'GetHashCode'.}}\n//        ^^^^^^^^^^^^^^^^^^^^^^^\n    {\n        public override bool Equals(object obj)\n        {\n            return base.Equals(obj);\n        }\n    }\n\n    class OverrideOnlyGetHashCodeClass // Noncompliant {{This class overrides 'GetHashCode' and should therefore also override 'Equals'.}}\n//        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    {\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    class ValidClass\n    {\n        public override bool Equals(object obj)\n        {\n            return base.Equals(obj);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    struct OverrideOnlyEqualsStruct // Noncompliant {{This struct overrides 'Equals' and should therefore also override 'GetHashCode'.}}\n//         ^^^^^^^^^^^^^^^^^^^^^^^^\n    {\n        public override bool Equals(object obj)\n        {\n            return base.Equals(obj);\n        }\n    }\n\n    struct OverrideOnlyGetHashCodeStruct // Noncompliant {{This struct overrides 'GetHashCode' and should therefore also override 'Equals'.}}\n//         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    {\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    struct ValidStruct\n    {\n        public override bool Equals(object obj)\n        {\n            return base.Equals(obj);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PInvokesShouldNotBeVisible.CSharp11.cs",
    "content": "﻿using System.Runtime.InteropServices;\n\npublic interface IInterface\n{\n    [DllImport(\"kernel32.dll\", CharSet = CharSet.Unicode)]\n    static extern virtual bool RemoveDirectory1(string name); // Noncompliant\n\n    [DllImport(\"kernel32.dll\", CharSet = CharSet.Unicode)]\n    public static extern virtual bool RemoveDirectory2(string name);  // Noncompliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PInvokesShouldNotBeVisible.CSharp9.cs",
    "content": "﻿using System.Runtime.InteropServices;\n\npublic record Record\n{\n    public void Method()\n    {\n        [DllImport(\"kernel32.dll\", CharSet = CharSet.Unicode)]\n        static extern bool RemoveDirectory(string name); // Compliant - Method is not publicly exposed\n    }\n\n    [DllImport(\"kernel32.dll\", CharSet = CharSet.Unicode)]\n    public static extern bool RemoveDirectory(string name);  // Noncompliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PInvokesShouldNotBeVisible.cs",
    "content": "﻿using System;\nusing System.Runtime.InteropServices;\n\nnamespace Tests.Diagnostics\n{\n    public class Program\n    {\n        [DllImport(\"kernel32.dll\", CharSet = CharSet.Unicode)]\n        public static extern bool RemoveDirectory1(string name); // Noncompliant {{Make this 'P/Invoke' method private or internal.}}\n//                                ^^^^^^^^^^^^^^^^\n\n        [DllImport(\"kernel32.dll\", CharSet = CharSet.Unicode)]\n        protected static extern bool RemoveDirectory2(string name); // Noncompliant\n\n        [DllImport(\"kernel32.dll\", CharSet = CharSet.Unicode)]\n        internal protected static extern bool RemoveDirectory3(string name); // Noncompliant\n\n        [DllImport(\"kernel32.dll\", CharSet = CharSet.Unicode)]\n        internal static extern bool RemoveDirectory4(string name);\n\n        [DllImport(\"kernel32.dll\", CharSet = CharSet.Unicode)]\n        private static extern bool RemoveDirectory5(string name);\n\n        [DllImport(\"kernel32.dll\", CharSet = CharSet.Unicode)] // Error [CS0601] - so do not raise an issue\n        public extern bool RemoveDirectory6(string name);\n\n        [DllImport(\"kernel32.dll\", CharSet = CharSet.Unicode)] // Error [CS0601]\n        public static bool RemoveDirectory7(string name); // Error [CS0501] - so do not raise an issue\n    }\n\n    internal class Foo\n    {\n        [DllImport(\"kernel32.dll\", CharSet = CharSet.Unicode)]\n        public static extern bool RemoveDirectory1(string name); // Compliant because effective accessibility is not public\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ParameterAssignedTo.Latest.cs",
    "content": "﻿using System;\n\nstatic void Foo(int x)\n{\n    Action<int, int> discard = (_, _) => _ = 10; // Compliant\n\n    Action<int> underscoreName = _ => _ = 10; // Noncompliant\n\n    Action<int, int> foo = (a, b) => a = 10; // Noncompliant\n}\n\npublic record Record\n{\n    public int PropertyWithSet\n    {\n        set { value = 10; } // Noncompliant\n    }\n\n    public int PropertyWithInit\n    {\n        init { value = 10; } // Noncompliant\n    }\n\n    void Foo(int x)\n    {\n        x = 42; // Noncompliant\n    }\n\n    void Foo(nint x)\n    {\n        x += 42; // Compliant\n    }\n}\n\npublic record struct Record2\n{\n    void Foo(int x)\n    {\n        (int i, x) = (42, 42); // Noncompliant {{Introduce a new variable instead of reusing the parameter 'x'.}}\n//              ^\n    }\n\n}\n\npublic class AClass\n{\n    void Foo(int x)\n    {\n        (int i, x) = (42, 42); // Noncompliant\n    }\n}\n\npublic partial class PartialProperties\n{\n    public partial int PartialProperty \n    {\n        set { value = 10; } // Noncompliant\n    }\n\n    public partial int PartialProperty2\n    {\n        init { value = 10; } // Noncompliant\n    }\n\n    public partial int this[int x]\n    {\n        set { value = 10; } // Noncompliant\n    }\n}\n\npublic partial class PartialProperties\n{\n    public partial int PartialProperty { set; }\n    public partial int PartialProperty2 { init; }\n    public partial int this[int x] { set; }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ParameterAssignedTo.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public static class ParameterAssignedToStatic\n    {\n        static void f7(this int a)\n        {\n            a = 42; // Noncompliant\n//          ^\n\n            try\n            {\n\n            }\n            catch (Exception exc)\n            {\n                exc = new Exception(); // Noncompliant {{Introduce a new variable instead of reusing the parameter 'exc'.}}\n                var v = 5;\n                v = 6;\n                throw exc;\n            }\n        }\n\n        static void f0(this string x)\n        {\n            string y = x;\n            x = \"x\"; // compliant, but weird\n        }\n    }\n\n    public class ParameterAssignedTo\n    {\n        void f00(string x)\n        {\n            int tmp = x.Length;\n            x = \"foo\";\n        }\n\n        void f01(string x)\n        {\n            int tmp = x.Length;\n            tmp = 5;\n            x = \"1\";\n        }\n\n        void f02(int x)\n        {\n            f1(x);\n            x = 1;\n        }\n\n        void f03(int x)\n        {\n            x += x;\n        }\n\n        void f04(int x)\n        {\n            x -= x;\n        }\n\n        void f05(int x)\n        {\n            x *= x;\n        }\n\n        void f06(int x)\n        {\n            x <<= x;\n        }\n\n        void f1(int a)\n        {\n            a = 42; // Noncompliant\n        }\n\n        void f2(int a)\n        {\n            int tmp = a;\n            tmp = 42;\n        }\n\n        void f3(ref int a)\n        {\n            a = 42;\n        }\n\n        void f4(out int a)\n        {\n            a = 42;\n        }\n\n        static void f5()\n        {\n        }\n\n        void f6(int a, int b, int c, int d, int e)\n        {\n            b = 42; // Noncompliant\n            e = 0; // Noncompliant\n        }\n\n\n        delegate void d1(out int b, int c, ref int d);\n\n        private event d1 e;\n\n        void f8(Func<int, int> param)\n        {\n            d1 dd = delegate (out int b, int c, ref int d)\n            {\n                b = 0;\n                c = 0; // Noncompliant\n                d = 0;\n            };\n\n            param = i => 42; // Noncompliant\n\n            e += delegate (out int foo1, int foo2, ref int foo3)\n            {\n                foo1 = 0;\n                foo2 = 0; // Noncompliant\n            };\n\n            f8((int x) => x = 0); // Noncompliant\n            f8((x) => x = 0); // Noncompliant\n            f8(\n                (x) =>\n                {\n                    return 0;\n                });\n            f8(\n                (x) =>\n                {\n                    x = 0; // Noncompliant\n                    return 0;\n                });\n            f8(\n                (int x) =>\n                {\n                    return 0;\n                });\n            f8(\n                (int x) =>\n                {\n                    x = 0; // Noncompliant\n                    return 0;\n                });\n        }\n\n        public int this[int index]\n        {\n            get\n            {\n                index = 1; // Noncompliant\n                return 0;\n            }\n            set\n            {\n                index = 1;  // Noncompliant\n                value = 45; // Noncompliant\n            }\n        }\n\n        public delegate void SomeEventHandler();\n\n        public event SomeEventHandler OnSomeEvent;\n\n        public void f9()\n        {\n            OnSomeEvent += delegate { };\n        }\n\n        public void f10(Func<int, int> param)\n        {\n            Func<int, int> tmp = param;\n            param = i => 42;\n        }\n\n        public void f11(int a, int b, int c, int d, bool e, int f)\n        {\n            a++;\n            ++b;\n            --c;\n            d--;\n            !e; // Error [CS0201] - expression used as statement\n            ~f; // Error [CS0201] - expression used as statement\n        }\n\n        public int f12(int param)\n        {\n            param = param + 1;\n\n            return param;\n        }\n\n        public void f13(string x)\n        {\n            var baz = x == null;\n            if (baz)\n            {\n                x = \"\";\n            }\n        }\n\n        public void f14(string x)\n        {\n            (((x))) = \"\"; // Noncompliant\n        }\n\n        public void f15(string x)\n        {\n            string y = ((x));\n            ((x)) = \"\";\n        }\n\n        public string f16(string x)\n        {\n            if (x == null)\n            {\n                x = \"\";\n            }\n            return x;\n        }\n\n        public string f17(string text)\n        {\n            if (string.IsNullOrWhiteSpace(text))\n            {\n                text = \"(empty)\";\n            }\n\n            return text;\n        }\n\n    }\n\n    public class ExceptionHandling\n    {\n        void foo()\n        {\n            var list = new List<string>();\n            try { }\n            catch (Exception e)\n            {\n                while (e != null)\n                {\n                    list.Add(FormatMessage(e));\n                    e = e.InnerException;\n                }\n            }\n        }\n\n        void quix(Exception e)\n        {\n            if (e != null)\n            {\n                FormatMessage(e);\n                e = new Exception(\"\");\n            }\n        }\n\n        void serialized()\n        {\n            try\n            {\n\n            }\n            catch (Exception exSerial)\n            {\n                FormatMessage(exSerial);\n            }\n            try\n            {\n\n            }\n            catch (Exception exSerial)      //Same name as previous statement\n            {\n                exSerial = new Exception(\"Obfuscation\");    //Noncompliant\n            }\n        }\n\n        void nested()\n        {\n            try\n            {\n\n            }\n            catch (Exception exOuter)\n            {\n                try\n                {\n                    FormatMessage(exOuter);\n                }\n                catch (Exception exInner)\n                {\n                    exOuter = new Exception(\"Compliant\");\n                    exInner = exOuter;  //Noncompliant\n                }\n            }\n        }\n\n        private string FormatMessage(Exception e) => \"\";\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ParameterAssignedTo.vb",
    "content": "﻿\nImports System\nImports System.Collections.Generic\n\nNamespace Tests.Diagnostics\n\n    Module ParameterAssignedToStatic\n\n        ' Error@+1 [BC30002]\n        <Extension()>\n        Static Sub MySub(ByVal a As Integer) ' Error [BC30242] Static is not valid\n            a = 42 ' Noncompliant {{Introduce a new variable instead of reusing the parameter 'a'.}}\n'           ^\n            Try\n\n            Catch exc As Exception\n                exc = New Exception() ' Noncompliant\n                Dim v As Integer = 5\n                v = 6\n                Throw exc\n            End Try\n        End Sub\n\n    End Module\n\n    Public Class ParameterAssignedTo\n\n        Sub f00(xx As String)\n            Dim tmp As Integer = xx.Length\n            xx = \"foo\"\n        End Sub\n\n        Sub f01(x As String)\n            Dim tmp As Integer = x.Length\n            tmp = 5\n            x = \"1\"\n        End Sub\n\n        Sub f02(x As Integer)\n            f1(x)\n            x = 1\n        End Sub\n\n        Sub f03(x As Integer)\n            x += x\n        End Sub\n\n        Sub f04(x As Integer)\n            x -= x\n        End Sub\n        Sub f05(x As Integer)\n            x *= x\n        End Sub\n\n        Sub f06(x As Integer)\n            x <<= x\n        End Sub\n\n        Sub f1(a As Integer)\n            a = 42 ' Noncompliant\n        End Sub\n\n        Sub f2(a As Integer)\n            Dim tmp As Integer = a\n            tmp = 42\n        End Sub\n\n        Sub f3(ByRef a As Integer)\n            a = 42\n        End Sub\n\n        Shared Sub f5()\n        End Sub\n\n        Sub f6(a As Integer, b As Integer, c As Integer, d As Integer, e As Integer)\n            b = 42  ' Noncompliant\n            e = 0   ' Noncompliant\n        End Sub\n\n        Delegate Sub d1(c As Integer, ByRef d As Integer)\n\n        Private Event e As d1\n        Sub f8(param As Func(Of Integer, Integer))\n            Dim dd As d1 = Sub(c As Integer, ByRef d As Integer)\n                               c = 0 ' Noncompliant\n                               d = 0\n                           End Sub\n            param = Function(i) 42 ' Noncompliant\n\n            AddHandler e, Sub(foo2 As Integer, ByRef foo3 As Integer)\n                              foo2 = 0 ' Noncompliant\n                              foo3 = 0\n                          End Sub\n\n            f8(Function(x)\n                   Return 0\n               End Function)\n            f8(Function(X)\n                   X = 0 ' Noncompliant\n                   Return X\n               End Function)\n            f8(Function(X As Integer)\n                   Return 0\n               End Function)\n            f8(Function(X As Integer)\n                   X = 0 ' Noncompliant\n                   Return 0\n               End Function)\n        End Sub\n\n        Default Public Property Item(Index As Integer) As Integer\n            Get\n                Index = 1 ' Noncompliant\n                Return 0\n            End Get\n            Set(Value As Integer)\n                Index = 1  ' Noncompliant\n                Value = 45 ' Noncompliant\n            End Set\n        End Property\n\n        Public Event SomeEvent()\n\n        Public Sub f9()\n            AddHandler SomeEvent, Sub()\n                                  End Sub\n        End Sub\n\n        Public Sub f10(Param As Func(Of Integer, Integer))\n            Dim Tmp As Func(Of Integer, Integer) = Param\n            Param = Function(i) 42\n        End Sub\n\n        Public Sub f11(a As Integer, b As Integer, c As Integer, d As Integer, e As Boolean)\n            a += 1\n            b *= 1\n            c -= 1\n            d -= 1\n            e = Not e\n        End Sub\n\n        Public Function f12(param As Integer) As Integer\n            param = param + 1\n            Return param\n        End Function\n\n        Public Sub f13(x As String)\n            Dim b As Boolean = x Is Nothing\n            If b Then x = \"\"\n        End Sub\n\n        Public Sub f14(x As String)\n            x = \"\" ' Noncompliant\n        End Sub\n\n        Public Sub f15(x As String)\n            Dim y As String = ((x))\n            x = \"\"\n        End Sub\n\n        Public Function f16(x As String) As String\n            If x Is Nothing Then\n                x = \"\"\n            End If\n            Return x\n        End Function\n\n        Public Function f17(text As String) As String\n            If String.IsNullOrWhiteSpace(text) Then\n                text = \"(empty)\"\n            End If\n            Return text\n        End Function\n\n    End Class\n\n    Public Class ExceptionHandling\n\n        Sub foo()\n            Dim Lst As New List(Of String)\n            Try\n\n            Catch ex As Exception\n                While (ex IsNot Nothing)\n                    Lst.Add(Log(ex))\n                    ex = ex.InnerException\n                End While\n            End Try\n        End Sub\n\n        Sub quix(e As Exception)\n            If e IsNot Nothing Then\n                Log(e)\n                e = New Exception(\"\")\n            End If\n        End Sub\n\n        Sub serialized()\n            Try\n\n            Catch exSerial As Exception\n                Log(exSerial)\n            End Try\n            Try\n\n            Catch exSerial As Exception 'Same name As previous statement\n                exSerial = New Exception(\"Obfuscation\")    'Noncompliant\n            End Try\n        End Sub\n\n        Sub nested()\n            Try\n\n            Catch exOuter As Exception\n                Try\n                    Log(exOuter)\n                Catch exInner As Exception\n                    exOuter = New Exception(\"Compliant\")\n                    exInner = exOuter  'Noncompliant\n                End Try\n            End Try\n        End Sub\n\n        Private Function Log(ex As Exception) As String\n\n        End Function\n\n    End Class\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ParameterName.CustomPattern.vb",
    "content": "﻿Module Module1\n\n    Sub GetSomething(ByVal ID As Integer) ' Noncompliant\n        '                  ^^\n    End Sub\n\n    Sub GetSomething2(ByVal PrefixSomething As Integer, Name As String) ' Noncompliant\n        '                                               ^^^^\n    End Sub\n\n    ' Wrong casing\n    Public Sub A(PrefixSomething As String) : End Sub   ' Compliant\n    Public Sub B(PrefixAnything As String) : End Sub    ' Compliant\n    Public Sub C(prefixSomething As String) : End Sub   ' Noncompliant\n    Public Sub D(PREFIXSomething As String) : End Sub   ' Noncompliant\n    Public Sub E(Prefixsomething As String) : End Sub   ' Noncompliant\n\nEnd Module\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ParameterName.vb",
    "content": "﻿Module Module1\n\n    Private WithEvents fSource As Source\n\n    Sub GetSomething(ByVal ID As Integer) ' Noncompliant\n        '                  ^^\n    End Sub\n\n    Sub GetSomething2(ByVal id As Integer, Name As String) ' Noncompliant\n        '                                  ^^^^\n    End Sub\n\n    Dim array As String()\n\n    ReadOnly Property Foo(ByVal Index As Integer)  ' Noncompliant\n        '                       ^^^^^\n        Get\n            Return array(Index)\n        End Get\n    End Property\n\n    Private Sub fSource_SomeEvent(Sender As Object) Handles fSource.SomeEvent\n    End Sub\n\nEnd Module\n\nPublic Class Source\n\n    Public Event SomeEvent(Sender As Object) ' Noncompliant\n\nEnd Class\n\nPublic Interface ISomething\n\n    Function ReturnSomething(Name As String) As Integer ' Noncompliant\n    Sub DoSomething(Name As String)                     ' Noncompliant\n    ReadOnly Property Value(Index As Integer)           ' Noncompliant\n\nEnd Interface\n\nPublic Class Something\n    Implements ISomething\n\n    Public Function ReturnSomething(Name As String) As Integer Implements ISomething.ReturnSomething\n    End Function\n\n    Public Sub DoSomething(Name As String) Implements ISomething.DoSomething\n    End Sub\n\n    Public ReadOnly Property Value(Index As Integer) As System.Object Implements ISomething.Value\n        Get\n            Return 42\n        End Get\n    End Property\n\nEnd Class\n\nPublic Class Base\n\n    Protected Overridable Sub DoSomething(Name As String) ' Noncompliant\n    End Sub\n\n    Protected Overridable Sub ToShadow(name As String)\n    End Sub\n\n    Public Overridable ReadOnly Property Value(Index As Integer) As Integer  ' Noncompliant\n        Get\n            Return 42\n        End Get\n    End Property\n\nEnd Class\n\nPublic Class Derived\n    Inherits Base\n\n    Protected Overrides Sub DoSomething(Name As String)\n    End Sub\n\n    Protected Shadows Sub ToShadow(Name As String)  ' Noncompliant, because it's redefining the names\n    End Sub\n\n    Public Overrides ReadOnly Property Value(Index As Integer) As Integer  ' Compliant, follows base class\n        Get\n            Return 1024\n        End Get\n    End Property\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ParameterNameMatchesOriginal.Latest.Partial.cs",
    "content": "﻿namespace CSharp13\n{\n    public partial class PartialIndexers\n    {\n        // https://sonarsource.atlassian.net/browse/NET-423\n        public partial int this[int index] => 42; // FN\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ParameterNameMatchesOriginal.Latest.cs",
    "content": "﻿\n\npublic partial interface IParameterNamesInPartialMethods\n{\n    partial void DoSomething(int x, int y);\n    partial void DoSomething2(int x, int y);\n}\n\npublic partial interface IParameterNamesInPartialMethods\n{\n    partial void DoSomething(int x, int y)\n    {\n    }\n\n    partial void DoSomething2(int someParam, int y) //Noncompliant {{Rename parameter 'someParam' to 'x' to match the partial class declaration.}}\n//                                ^^^^^^^^^\n    {\n    }\n}\n\nnamespace CSharp9\n{\n    public partial record Record\n    {\n        partial void M1(int x, int y);\n\n        private partial void M2(int x, int y);\n        internal partial void M3(int x, int y);\n        protected partial void M4(int x, int y);\n        protected internal partial void M5(int x, int y);\n        public partial void M6(int x, int y);\n        public partial bool M7(string x, out string y);\n    }\n\n    public partial record Record\n    {\n        private partial void M2(int someParam, int y) { } //Noncompliant {{Rename parameter 'someParam' to 'x' to match the partial class declaration.}}\n        internal partial void M3(int someParam, int y) { } //Noncompliant {{Rename parameter 'someParam' to 'x' to match the partial class declaration.}}\n        protected partial void M4(int someParam, int y) { } //Noncompliant {{Rename parameter 'someParam' to 'x' to match the partial class declaration.}}\n        protected internal partial void M5(int someParam, int y) { } //Noncompliant {{Rename parameter 'someParam' to 'x' to match the partial class declaration.}}\n        public partial void M6(int someParam, int y) { } //Noncompliant {{Rename parameter 'someParam' to 'x' to match the partial class declaration.}}\n        public partial bool M7(string someParam, out string y) { y = string.Empty; return true; } //Noncompliant {{Rename parameter 'someParam' to 'x' to match the partial class declaration.}}\n    }\n\n    public abstract record BaseRecord<T>\n    {\n        public abstract void SomeMethod(T someParameter);\n        public abstract void SomeMethod(T someParameter, int anotherParameter);\n    }\n\n    public record RecordOne : BaseRecord<int>\n    {\n        public override void SomeMethod(int renamedParam) { }\n        public override void SomeMethod(int renamedParam, int wrongName) { } //Noncompliant {{Rename parameter 'wrongName' to 'anotherParameter' to match the base class declaration.}}\n    }\n}\n\nnamespace CSharp11\n{\n    public interface IAnotherInterface\n    {\n        static abstract void DoSomething(string value);\n        static abstract void DoSomethingElse(string value);\n    }\n\n    public class AnotherClass : IAnotherInterface\n    {\n        public static void DoSomething(string renamedParam) // Noncompliant\n        {\n        }\n\n        public static void DoSomethingElse(string value)\n        {\n        }\n    }\n}\n\nnamespace CSharp13\n{\n    public partial class PartialIndexers\n    {\n        public partial int this[int x] { get; }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ParameterNameMatchesOriginal.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public partial class ParameterNamesInPartialMethod\n    {\n        partial void DoSomething(int x, int y);\n        partial void DoSomething2(int x, int y);\n\n        partial void DoSomething3(int x, int y);\n\n        public void DoSomething4(int x, int y)\n        {\n        }\n    }\n\n    public partial class ParameterNamesInPartialMethod\n    {\n        partial void DoSomething(int x, int y)\n        {\n\n        }\n\n        partial void DoSomething2(int someParam, int y) //Noncompliant {{Rename parameter 'someParam' to 'x' to match the partial class declaration.}}\n//                                    ^^^^^^^^^\n        {\n\n        }\n\n        partial void DoSomething3(int x, int y, int z);\n    }\n\n    public abstract class BaseClass\n    {\n        public virtual void DoSomethingVirtual(int x, int y)\n        {\n        }\n\n        public abstract void DoSomethingAbstract(int x, int y);\n    }\n\n    public class ChildClass : BaseClass\n    {\n        public override void DoSomethingAbstract(int x, int someParam) //Noncompliant {{Rename parameter 'someParam' to 'y' to match the base class declaration.}}\n        {\n            throw new NotImplementedException();\n        }\n\n        public override void DoSomethingVirtual(int x, int someParam) //Noncompliant {{Rename parameter 'someParam' to 'y' to match the base class declaration.}}\n        {\n            base.DoSomethingVirtual(x, someParam);\n        }\n    }\n\n    public abstract class ChildClassLevel2 : ChildClass\n    {\n        public override void DoSomethingAbstract(int x, int y) //Noncompliant {{Rename parameter 'y' to 'someParam' to match the base class declaration.}}\n        {\n            throw new NotImplementedException();\n        }\n\n        public override void DoSomethingVirtual(int x, int y) //Noncompliant {{Rename parameter 'y' to 'someParam' to match the base class declaration.}}\n        {\n            base.DoSomethingVirtual(x, y);\n        }\n    }\n\n    public class InterfaceImplementation : IComparer<InterfaceImplementation>\n    {\n        public int Compare(InterfaceImplementation a, InterfaceImplementation y)\n        {\n            return 0;\n        }\n    }\n\n    public interface IGenericInterface<A>\n    {\n        void DoSomething();\n        void DoSomething(A value);\n        void DoSomething(A value, int intValue);\n        void DoSomethingElse(A value);\n        void DoSomethingElse(A value, ParameterClass parameterClassValue);\n        void TryOneMoreTime(AnotherParameterClass value);\n        void DoSomethingCaseSensitive(A value, int intValue);\n    }\n    public class ParameterClass { }\n    public class AnotherParameterClass { }\n    public class Implementation : IGenericInterface<ParameterClass>\n    {\n        public void DoSomething() { }\n        public void DoSomething(ParameterClass parameter) { }\n        public void DoSomething(AnotherParameterClass randomName) { }\n        public void DoSomethingElse(ParameterClass completelyAnotherName) { }\n        public void DoSomething(ParameterClass value, int myValue) { }                // Noncompliant\n//                                                        ^^^^^^^\n        public void DoSomethingElse(ParameterClass value, ParameterClass val) { }     // Noncompliant\n//                                                                       ^^^\n        public void TryOneMoreTime(AnotherParameterClass anotherParameter) { }        // Noncompliant\n//                                                       ^^^^^^^^^^^^^^^^\n        public void DoSomethingCaseSensitive(ParameterClass Value, int IntValue) { }  // Noncompliant\n//                                                                     ^^^^^^^^\n    }\n\n    public struct StructImplementation : IGenericInterface<ParameterClass>\n    {\n        public void DoSomething() { }\n        public void DoSomething(ParameterClass parameter) { }\n        public void DoSomething(AnotherParameterClass randomName) { }\n        public void DoSomethingElse(ParameterClass completelyAnotherName) { }\n        public void DoSomething(ParameterClass value, int myValue) { }             // Noncompliant\n//                                                        ^^^^^^^\n        public void DoSomethingElse(ParameterClass value, ParameterClass val) { }  // Noncompliant\n//                                                                       ^^^\n        public void TryOneMoreTime(AnotherParameterClass anotherParameter) { }     // Noncompliant\n//                                                       ^^^^^^^^^^^^^^^^\n        public void DoSomethingCaseSensitive(ParameterClass Value, int IntValue) { }  // Noncompliant\n//                                                                     ^^^^^^^^\n    }\n\n    public abstract class BaseClass<T>\n    {\n        public abstract void SomeMethod(T someParameter);\n\n        public abstract void SomeMethod(T someParameter, int intParam);\n    }\n\n    public class ClassOne : BaseClass<int>\n    {\n        public override void SomeMethod(int renamedParam) { }\n\n        public override void SomeMethod(int someParameter, int renamedParam) {  }  // Noncompliant\n//                                                             ^^^^^^^^^^^^\n    }\n\n    public abstract class AbstractClassWithGenericMethod\n    {\n        abstract public void Foo<T>(T val);\n        abstract public void Bar<T>(T val);\n    }\n\n    public class InheritedClassWithDefinition : AbstractClassWithGenericMethod\n    {\n        public override void Foo<T>(T myNewName) { }                               // Noncompliant\n//                                    ^^^^^^^^^\n        public override void Bar<T>(T val) { }\n    }\n\n    public interface IAnotherGenericInterface<A>\n    {\n        void DoSomething(A value);\n        void DoSomething(A value, int intValue);\n    }\n\n    public interface IAnotherInterface : IAnotherGenericInterface<ParameterClass>\n    {\n        void DoSomethingElse(ParameterClass value);\n    }\n\n    public abstract class AnotherAbstractClass : IAnotherInterface\n    {\n        public abstract void DoSomething(ParameterClass abstractValue);\n        public abstract void DoSomething(ParameterClass value, int IntValue);            //Noncompliant {{Rename parameter 'IntValue' to 'intValue' to match the interface declaration.}}\n//                                                                 ^^^^^^^^\n        public abstract void DoSomethingElse(ParameterClass Value);                      //Noncompliant {{Rename parameter 'Value' to 'value' to match the interface declaration.}}\n//                                                          ^^^^^\n    }\n\n    public class AnotherImplementation : AnotherAbstractClass\n    {\n        public override void DoSomething(ParameterClass value) { }                       //Noncompliant {{Rename parameter 'value' to 'abstractValue' to match the base class declaration.}}\n//                                                      ^^^^^\n        public override void DoSomething(ParameterClass abstractValue, int IntValue) { } //Noncompliant {{Rename parameter 'abstractValue' to 'value' to match the base class declaration.}}\n//                                                      ^^^^^^^^^^^^^\n        public override void DoSomethingElse(ParameterClass Value) { }\n    }\n\n    // See https://github.com/SonarSource/sonar-dotnet/issues/4370\n    public interface SomeInterface<A> { }\n\n    public interface BaseInterface<A>\n    {\n        void Apply(SomeInterface<A> param);\n    }\n\n    public class BasicImplementation : BaseInterface<int>\n    {\n        public void Apply(SomeInterface<int> intValueParam) { }\n    }\n\n    public class StillGeneric<T> : BaseInterface<T>\n    {\n        public void Apply(SomeInterface<T> renamedParam) { }  // Noncompliant\n    }\n\n    public abstract class AbstractClass<T>\n    {\n        public abstract void Apply(SomeInterface<T> intValueParam);\n    }\n\n    public class OverridenCompliant : AbstractClass<int>\n    {\n        public override void Apply(SomeInterface<int> intValueParam) { }\n    }\n\n    public class OverridenNonCompliant<K> : AbstractClass<K>\n    {\n        public override void Apply(SomeInterface<K> renamedParam) { } // Noncompliant\n    }\n\n    public interface BaseInterface2<A, B>\n    {\n        void Apply(Tuple<A, B> param);\n    }\n\n    public class SomeClass<T> : BaseInterface2<T, int>\n    {\n        public void Apply(Tuple<T, int> renamed) { }\n    }\n\n    public abstract class BaseRepro\n    {\n        public abstract int SomeMethod(int SomeParam1, int SomeParam2);\n    }\n\n    public class Reproducer : BaseRepro\n    {\n        public override int SomeMethod(int _, int SomeParam2) => SomeParam2; // Noncompliant, it is not a discard\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ParameterNameMatchesOriginal.vb",
    "content": "﻿'Partial methods are not relevant for VB.NET\n\nPublic MustInherit Class Base\n\n    Public MustOverride Sub DoSomethingMustOverride(Name As String)\n\n    Public Overridable Sub DoSomethingOverridable(Name As String)\n    End Sub\n\n    Public Sub NoParameters()\n    End Sub\n\n    Public Sub NoParametersNoParenthesis  'This should not have ()\n    End Sub\n\nEnd Class\n\nPublic Interface IContract\n\n    Sub Add(Count As Integer)\n\nEnd Interface\n\nPublic Class GoodUsage\n    Inherits Base\n    Implements IContract\n\n    Public Overrides Sub DoSomethingMustOverride(Name As String)\n    End Sub\n\n    Public Overrides Sub DoSomethingOverridable(Name As String)\n    End Sub\n\n    Public Sub Add(Count As Integer) Implements IContract.Add\n    End Sub\n\nEnd Class\n\nPublic Class BadUsage\n    Inherits Base\n    Implements IContract\n\n    Public Overrides Sub DoSomethingMustOverride(Description As String) ' Noncompliant {{Rename parameter 'Description' to 'Name' to match the base class declaration.}}\n        '                                        ^^^^^^^^^^^\n    End Sub\n\n    Public Overrides Sub DoSomethingOverridable(Description As String)  ' Noncompliant\n    End Sub\n\n    Public Sub Add(Difference As Integer) Implements IContract.Add      ' Noncompliant {{Rename parameter 'Difference' to 'Count' to match the interface declaration.}}\n        '          ^^^^^^^^^^\n    End Sub\n\nEnd Class\n\nPublic Class IgnoreCaseChange\n    Implements IContract\n\n    Public Sub Add(count As Integer) Implements IContract.Add   ' Compliant, differs only in casing\n    End Sub\n\nEnd Class\n\nPublic Interface IGenericInterface(Of A)\n\n    Sub DoSomething()\n    Sub DoSomething(Value As A)\n    Sub DoSomething(Value As A, IntValue As Integer)\n    Sub DoSomethingElse(Value As A)\n    Sub DoSomethingElse(Value As A, ParameterClassValue As ParameterClass)\n    Sub TryOneMoreTime(Value As AnotherParameterClass)\n    Sub DoSomethingCaseSensitive(Value As A, IntValue As Integer)\n\nEnd Interface\n\nPublic Class ParameterClass\nEnd Class\n\nPublic Class AnotherParameterClass\nEnd Class\n\nPublic Class Implementation\n    Implements IGenericInterface(Of ParameterClass)\n\n    Public Sub DoSomething() Implements IGenericInterface(Of ParameterClass).DoSomething\n    End Sub\n\n    Public Sub DoSomething(Parameter As ParameterClass) Implements IGenericInterface(Of ParameterClass).DoSomething\n    End Sub\n\n    Public Sub DoSomething(RandomName As AnotherParameterClass)\n    End Sub\n\n    Public Sub DoSomethingElse(CompletelyAnotherName As ParameterClass) Implements IGenericInterface(Of ParameterClass).DoSomethingElse\n    End Sub\n\n    Public Sub DoSomething(Value As ParameterClass, MyValue As Integer) Implements IGenericInterface(Of ParameterClass).DoSomething                             ' Noncompliant\n        '                                           ^^^^^^^\n    End Sub\n\n    Public Sub DoSomethingElse(Value As ParameterClass, Val As ParameterClass) Implements IGenericInterface(Of ParameterClass).DoSomethingElse                  ' Noncompliant\n        '                                               ^^^\n    End Sub\n\n    Public Sub TryOneMoreTime(AnotherParameter As AnotherParameterClass) Implements IGenericInterface(Of ParameterClass).TryOneMoreTime                               ' Noncompliant\n        '                     ^^^^^^^^^^^^^^^^\n    End Sub\n\n    Public Sub DoSomethingCaseSensitive(VALUE As ParameterClass, INTVALUE As Integer) Implements IGenericInterface(Of ParameterClass).DoSomethingCaseSensitive\n    End Sub\n\nEnd Class\n\nPublic Structure StructImplementation\n    Implements IGenericInterface(Of ParameterClass)\n\n    Public Sub DoSomething() Implements IGenericInterface(Of ParameterClass).DoSomething\n    End Sub\n\n    Public Sub DoSomething(Parameter As ParameterClass) Implements IGenericInterface(Of ParameterClass).DoSomething\n    End Sub\n\n    Public Sub DoSomething(RandomName As AnotherParameterClass)\n    End Sub\n\n    Public Sub DoSomethingElse(CompletelyAnotherName As ParameterClass) Implements IGenericInterface(Of ParameterClass).DoSomethingElse\n    End Sub\n\n    Public Sub DoSomething(Value As ParameterClass, MyValue As Integer) Implements IGenericInterface(Of ParameterClass).DoSomething                             ' Noncompliant\n        '                                           ^^^^^^^\n    End Sub\n\n    Public Sub DoSomethingElse(Value As ParameterClass, Val As ParameterClass) Implements IGenericInterface(Of ParameterClass).DoSomethingElse                  ' Noncompliant\n        '                                               ^^^\n    End Sub\n\n    Public Sub TryOneMoreTime(AnotherParameter As AnotherParameterClass) Implements IGenericInterface(Of ParameterClass).TryOneMoreTime                               ' Noncompliant\n        '                     ^^^^^^^^^^^^^^^^\n    End Sub\n\n    Public Sub DoSomethingCaseSensitive(VALUE As ParameterClass, INTVALUE As Integer) Implements IGenericInterface(Of ParameterClass).DoSomethingCaseSensitive\n    End Sub\n\nEnd Structure\n\nPublic MustInherit Class BaseClass(Of T)\n\n    Public MustOverride Sub SomeMethod(SomeParameter As T)\n    Public MustOverride Sub SomeMethod(SomeParameter As T, IntParam As Integer)\n\nEnd Class\n\nPublic Class ClassOne\n    Inherits BaseClass(Of Integer)\n\n    Public Overrides Overloads Sub SomeMethod(RenamedParam As Integer)\n    End Sub\n\n    Public Overrides Overloads Sub SomeMethod(SomeParameter As Integer, RenamedParam As Integer)  ' Noncompliant\n        '                                                               ^^^^^^^^^^^^\n    End Sub\n\nEnd Class\n\nPublic MustInherit Class AbstractClassWithGenericMethod\n\n    MustOverride Public Sub Foo(Of T)(Val As T)\n    MustOverride Public Sub Bar(Of T)(Val As T)\n\nEnd Class\n\nPublic Class InheritedClassWithDefinition\n    Inherits AbstractClassWithGenericMethod\n\n    Public Overrides Sub Foo(Of T)(MyNewName As T)  ' Noncompliant\n        '                          ^^^^^^^^^\n    End Sub\n\n    Public Overrides Sub Bar(Of T)(Val As T)\n    End Sub\n\nEnd Class\n\nPublic Interface IAnotherGenericInterface(Of A)\n\n    Sub DoSomething(Value As A)\n    Sub DoSomething(Value As A, IntValue As Integer)\n\nEnd Interface\n\nPublic Interface IAnotherInterface\n    Inherits IAnotherGenericInterface(Of ParameterClass)\n\n    Sub DoSomethingElse(Value As ParameterClass)\n\nEnd Interface\n\nPublic MustInherit Class AnotherAbstractClass\n    Implements IAnotherInterface\n    Public MustOverride Sub DoSomething(AbstractValue As ParameterClass) Implements IAnotherGenericInterface(Of ParameterClass).DoSomething\n    Public MustOverride Sub DoSomething(Value As ParameterClass, IntValue As Integer) Implements IAnotherGenericInterface(Of ParameterClass).DoSomething\n    Public MustOverride Sub DoSomethingElse(Value As ParameterClass) Implements IAnotherInterface.DoSomethingElse\n\nEnd Class\n\nPublic Class AnotherImplementation\n    Inherits AnotherAbstractClass\n\n    Public Overrides Overloads Sub DoSomething(Value As ParameterClass)  'Noncompliant {{Rename parameter 'Value' to 'AbstractValue' to match the base class declaration.}}\n        '                                      ^^^^^\n    End Sub\n\n    Public Overrides Overloads Sub DoSomething(AbstractValue As ParameterClass, IntValue As Integer)  'Noncompliant {{Rename parameter 'AbstractValue' to 'Value' to match the base class declaration.}}\n        '                                      ^^^^^^^^^^^^^\n    End Sub\n\n    Public Overrides Sub DoSomethingElse(Value As ParameterClass)\n    End Sub\n\nEnd Class\n\n' See https://github.com/SonarSource/sonar-dotnet/issues/4370\nPublic Interface SomeInterface(Of A)\nEnd Interface\n\nPublic Interface BaseInterface(Of A)\n    Sub Apply(ByVal param As SomeInterface(Of A))\nEnd Interface\n\nPublic Class BasicImplementation\n    Implements BaseInterface(Of Integer)\n\n    Public Sub Apply(ByVal intValueParam As SomeInterface(Of Integer)) Implements BaseInterface(Of Integer).Apply\n    End Sub\nEnd Class\n\nPublic Class StillGeneric(Of T)\n    Implements BaseInterface(Of T)\n\n    Public Sub Apply(ByVal renamedParam As SomeInterface(Of T)) Implements BaseInterface(Of T).Apply  ' Noncompliant\n    End Sub\nEnd Class\n\nPublic MustInherit Class AbstractClass(Of T)\n    Public MustOverride Sub Apply(ByVal param As SomeInterface(Of T))\nEnd Class\n\nPublic Class OverridenCompliant\n    Inherits AbstractClass(Of Integer)\n\n    Public Overrides Overloads Sub Apply(ByVal intValueParam As SomeInterface(Of Integer))\n    End Sub\nEnd Class\n\nPublic Class OverridenNonCompliant(Of K)\n    Inherits AbstractClass(Of K)\n\n    Public Overrides Overloads Sub Apply(ByVal renamedParam As SomeInterface(Of K)) ' Noncompliant\n    End Sub\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ParameterNamesShouldNotDuplicateMethodNames.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        public void Method1(string method1, string METHOD1, string argument)\n//                  ^^^^^^^ Secondary [0,1]\n//                                 ^^^^^^^ Noncompliant@-1 [0] {{Rename the parameter 'method1' so that it does not duplicate the method name.}}\n//                                                 ^^^^^^^ Noncompliant@-2 [1] {{Rename the parameter 'METHOD1' so that it does not duplicate the method name.}}\n        {\n            // Do something\n        }\n\n        public int @int(int @int) => 0; // Noncompliant\n                                        // Secondary@-1\n\n        public int @int(string @int1) => 0;\n    }\n\n    class WithLocalFunctions\n    {\n        public void Method()\n        {\n            void Method1(string Method1) // Noncompliant\n            {                            // Secondary@-1\n            }\n\n            static void Method2(string Method2) // Noncompliant\n            {                                   // Secondary@-1\n            }\n\n            void Method3(string Method4)\n            {\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ParameterTypeShouldMatchRouteTypeConstraint.Conversion.razor",
    "content": "@page \"/route/1/{ObjectParam:int}\"\n@page \"/route/2/{ComparableParam:int}\"\n@page \"/route/3/{LongParam:int}\"\n@page \"/route/4/{IntEnumParam:int}\"\n@page \"/route/5/{LongEnumParam:long}\"\n@page \"/route/6/{GuidEnumParam:guid}\"\n@page \"/route/7/{ImplicitConversionParam:int}\"\n@page \"/route/8/{ExplicitConversionParam:int}\"\n\n@code {\n\n    public enum MyEnum\n    {\n        A,\n        B,\n        C\n    }\n\n    public class ImplicitConversion\n    {\n        public int IntProp { get; set; }\n\n        public static implicit operator ImplicitConversion(int i)\n        {\n            return new ImplicitConversion { IntProp = i };\n        }\n    }\n\n    public class ExplicitConversion\n    {\n        public int IntProp { get; set; }\n\n        public static explicit operator ExplicitConversion(int i)\n        {\n            return new ExplicitConversion { IntProp = i };\n        }\n    }\n\n    [Parameter]\n    public object ObjectParam { get; set; }\n\n    [Parameter]\n    public IComparable ComparableParam { get; set; }\n\n    [Parameter]\n    public MyEnum IntEnumParam { get; set; }\n\n    [Parameter]\n    public MyEnum LongEnumParam { get; set; }\n\n    [Parameter]\n    public MyEnum GuidEnumParam { get; set; } // Noncompliant\n    //     ^^^^^^\n\n    [Parameter]\n    public long LongParam { get; set; } // Noncompliant\n\n    [Parameter]\n    public ImplicitConversion ImplicitConversionParam { get; set; } // Noncompliant\n    //     ^^^^^^^^^^^^^^^^^^\n\n    [Parameter]\n    public ExplicitConversion ExplicitConversionParam { get; set; } // Noncompliant\n\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ParameterTypeShouldMatchRouteTypeConstraint.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing Microsoft.AspNetCore.Components;\n\n[Route(\"\"\"/route/{RawStringLiteralParam:bool}\"\"\")]\n[Route(\"\"\"/route/{RawStringLiteralParam:int}\"\"\")] // Secondary [raw-int]\n//               ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n[Route($$\"\"\"/route/{RawInterpolatedParam:{{Constants.BoolConstraint}}}\"\"\")]\n[Route($$\"\"\"/route/{RawInterpolatedParam:{{Constants.IntConstraint}}}\"\"\")] // Secondary [raw-interpolated-int]\n//     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n[Route(\"/something\" + \"/{ConcatenationParam:bool}\")]\n[Route(\"/something\" + \"/{ConcatenationParam:int}\")] // Secondary [concatenation-int]\n//                      ^^^^^^^^^^^^^^^^^^^^^^^^\npublic class ParameterTypeShouldMatchRouteTypeConstraint_Constant : ComponentBase\n{\n    [Parameter]\n    public bool RawStringLiteralParam { get; set; } // Noncompliant [raw-int]\n    [Parameter]\n    public bool RawInterpolatedParam { get; set; } // Noncompliant [raw-interpolated-int]\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ParameterTypeShouldMatchRouteTypeConstraint.Partial.razor",
    "content": "@namespace EmptyProject\n@page \"/route/{BoolParam:bool}\""
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ParameterTypeShouldMatchRouteTypeConstraint.Partial.razor.cs",
    "content": "using Microsoft.AspNetCore.Components;\n\n// Namespace in the test project\nnamespace EmptyProject\n{\n    public partial class ParameterTypeShouldMatchRouteTypeConstraint_Partial : ComponentBase\n    {\n        [Parameter]\n        public string BoolParam { get; set; } // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ParameterTypeShouldMatchRouteTypeConstraint.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing Microsoft.AspNetCore.Components;\n\n[Route(\"/route/{BoolParam:bool}\")] // Secondary [bool] {{This route parameter has a 'bool' type constraint.}}\n//             ^^^^^^^^^^^^^^^^\n[Route(\"/route/{DatetimeParam:datetime}\")] // Secondary [datetime] {{This route parameter has a 'datetime' type constraint.}}\n//             ^^^^^^^^^^^^^^^^^^^^^^^^\n[Route(\"/route/{DatetimeParam:datetime}/{BoolParam:bool}\")] // Secondary ^16#24 [datetime-multiple] {{This route parameter has a 'datetime' type constraint.}}\n                                                            // Secondary@-1 ^41#16 [bool-multiple] {{This route parameter has a 'bool' type constraint.}}\n[Route(\"/route/{CompliantBoolParam:bool}\")]\n[Route(\"/route/{CompliantDatetimeParam:datetime}\")]\npublic class ParameterTypeShouldMatchRouteTypeConstraint : ComponentBase\n{\n    [Parameter]\n    public string BoolParam { get; set; } // Noncompliant [bool, bool-multiple] {{Parameter type 'string' does not match route parameter type constraint.}}\n    [Parameter]\n    public decimal DatetimeParam { get; set; } // Noncompliant [datetime, datetime-multiple] {{Parameter type 'decimal' does not match route parameter type constraint.}}\n    [Parameter]\n    public bool CompliantBoolParam { get; set; } // Compliant\n    [Parameter]\n    public DateTime CompliantDatetimeParam { get; set; } // Compliant\n    [Parameter]\n    public DateTime NoncompliantFromConstant { get; set; } // FN\n    [Parameter]\n    public bool CompliantFromConstant { get; set; } // Compliant\n}\n\n[Route(\"/route/{FullyQualifiedParam:bool}\")] // Secondary [fully-qualified] {{This route parameter has a 'bool' type constraint.}}\n[Route(\"/route/{ListParam}\")] // Secondary [list] {{This route parameter has an implicit 'string' type constraint.}}\n[Route(\"/route/{DictionaryParam}\")] // Secondary [dictionary] {{This route parameter has an implicit 'string' type constraint.}}\n[Route(\"/route/{PointerParam:int}\")] // Secondary [pointer] {{This route parameter has a 'int' type constraint.}}\n[Route(\"/route/{DoublePointerParam:int}\")] // Secondary [double-pointer] {{This route parameter has a 'int' type constraint.}}\n[Route(\"/route/{NullableInt:int}\")]\n[Route(\"/route/{NonNullableInt:int}\")]\n[Route(\"/route/{NullableInt:int?}\")]\n[Route(\"/route/{NonNullableInt:int?}\")]\n[Route(\"/route/{ArrayInt:int}\")] // Secondary [array] {{This route parameter has a 'int' type constraint.}}\n[Route(\"/route/{ArrayInt:int?}\")] // Secondary [array-optional] {{This route parameter has a 'int' type constraint.}}\npublic class ParameterTypeShouldMatchRouteTypeConstraint_EdgeCase : ComponentBase\n{\n    [Parameter]\n    public System.String FullyQualifiedParam { get; set; } // Noncompliant [fully-qualified] {{Parameter type 'String' does not match route parameter type constraint.}}\n\n    [Parameter]\n    public IList<string> ListParam { get; set; } // Noncompliant [list] {{Parameter type 'IList' does not match route parameter type constraint.}}\n\n    [Parameter]\n    public IDictionary<string, string> DictionaryParam { get; set; } // Noncompliant [dictionary] {{Parameter type 'IDictionary' does not match route parameter type constraint.}}\n\n    [Parameter]\n    unsafe public int* PointerParam { get; set; } // Noncompliant [pointer] {{Parameter type 'int*' does not match route parameter type constraint.}}\n\n    [Parameter]\n    unsafe public int** DoublePointerParam { get; set; } // Noncompliant [double-pointer] {{Parameter type 'int**' does not match route parameter type constraint.}}\n\n    [Parameter]\n    public int? NullableInt { get; set; }\n\n    [Parameter]\n    public int NonNullableInt { get; set; }\n\n    [Parameter]\n    public int[] ArrayInt { get; set; } // Noncompliant [array, array-optional] {{Parameter type 'int[]' does not match route parameter type constraint.}}\n}\n\npublic static class Constants\n{\n    public const string NONCOMPLIANT_ROUTE = \"/route/{NoncompliantFromConstant:bool}\";\n    public const string COMPLIANT_ROUTE = \"/route/{CompliantFromConstant:bool}\";\n    public const string BoolConstraint = \"bool\";\n    public const string IntConstraint = \"int\";\n}\n\n[Route(Constants.COMPLIANT_ROUTE)]\n[Route(Constants.NONCOMPLIANT_ROUTE)] // Secondary [constant]\n//     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n[Route(template: \"/route/{UseTemplateParam:bool}\")]\n[Route(template: \"/route/{UseTemplateParam:int}\")] // Secondary [template-int]\n//                       ^^^^^^^^^^^^^^^^^^^^^^\n[Route(((\"/route/{ParenthesisParam:bool}\")))]\n[Route(((\"/route/{ParenthesisParam:int}\")))] // Secondary [parenthesis-int]\n//               ^^^^^^^^^^^^^^^^^^^^^^\n[Route(\"/something\" + \"/{ConcatenationParam:bool}\")]\n[Route(\"/something\" + \"/{ConcatenationParam:int}\")] // Secondary [concatenation-int]\n//                      ^^^^^^^^^^^^^^^^^^^^^^^^\npublic class ParameterTypeShouldMatchRouteTypeConstraint_Constant : ComponentBase\n{\n    [Parameter]\n    public DateTime NoncompliantFromConstant { get; set; } // Noncompliant [constant]\n    //     ^^^^^^^^\n    [Parameter]\n    public bool CompliantFromConstant { get; set; } // Compliant\n    [Parameter]\n    public bool UseTemplateParam { get; set; } // Noncompliant [template-int]\n    //     ^^^^\n    [Parameter]\n    public bool ParenthesisParam { get; set; } // Noncompliant [parenthesis-int]\n    [Parameter]\n    public bool ConcatenationParam { get; set; } // Noncompliant [concatenation-int]\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ParameterTypeShouldMatchRouteTypeConstraint.razor",
    "content": "@page \"/route/{BoolParam:bool}\"\n@page \"/route/{BoolParam:InT}\"\n@page \"/route/{BoolParam:int}/{DatetimeParam:DATEtime}\"\n@page \"/route/{DatetimeParam:datetime}\"\n@page \"/route/{DecimalParam:decimal}\"\n@page \"/route/{doubleparam:double}\"\n@page \"/route/{FloatParam:float}\"\n@page \"/route/{GuIdPaRam:guid}\"\n@page \"/route/{INTPARAM:INT}\"\n@page \"/route/{LongParam:long}\"\n@page \"/route/{StringParam}\"\n@page \"/route/{OptionalStringParam?}\"\n@page \"/route/{CompliantBoolParam:bool}\"\n@page \"/route/{COMPLIANTDATETIMEPARAM:datetime}\"\n@page \"/route/{CompliantDecimalParam:decimal}\"\n@page \"/route/{CompliantDoubleParam:double}\"\n@page \"/route/{CompliantFloatParam:float}\"\n@page \"/route/{CompliantGuidParam:guid}\"\n@page \"/route/{CompliantIntParam:int}\"\n@page \"/route/{compliantlongparam:long}\"\n@page \"/route/{CompliantStringParam}\"\n@page \"/route/{OptionalCompliantStringParam?}\"\n@page \"/route/{InvalidConstraint:invalid}\"\n\n@code {\n    [Parameter]\n    public string BoolParam { get; set; } // Noncompliant {{Parameter type 'string' does not match route parameter type constraint 'bool' in route '/route/{BoolParam:bool}'.}}\n    //     ^^^^^^\n                                          // Noncompliant@-2 {{Parameter type 'string' does not match route parameter type constraint 'int' in route '/route/{BoolParam:InT}'.}}\n                                          // Noncompliant@-3 {{Parameter type 'string' does not match route parameter type constraint 'int' in route '/route/{BoolParam:int}/{DatetimeParam:DATEtime}'.}}\n    [Parameter]\n    public decimal DatetimeParam { get; set; } // Noncompliant {{Parameter type 'decimal' does not match route parameter type constraint 'datetime' in route '/route/{BoolParam:int}/{DatetimeParam:DATEtime}'.}}\n                                               // Noncompliant@-1 {{Parameter type 'decimal' does not match route parameter type constraint 'datetime' in route '/route/{DatetimeParam:datetime}'.}}\n    [Parameter]\n    public bool DecimalParam { get; set; } // Noncompliant {{Parameter type 'bool' does not match route parameter type constraint 'decimal' in route '/route/{DecimalParam:decimal}'.}}\n    [Parameter]\n    public DateTime DoubleParam { get; set; } // Noncompliant {{Parameter type 'DateTime' does not match route parameter type constraint 'double' in route '/route/{doubleparam:double}'.}}\n    [Parameter]\n    public Guid FloatParam { get; set; } // Noncompliant {{Parameter type 'Guid' does not match route parameter type constraint 'float' in route '/route/{FloatParam:float}'.}}\n    [Parameter]\n    public string GuidParam { get; set; } // Noncompliant {{Parameter type 'string' does not match route parameter type constraint 'guid' in route '/route/{GuIdPaRam:guid}'.}}\n    [Parameter]\n    public long IntParam { get; set; } // Noncompliant {{Parameter type 'long' does not match route parameter type constraint 'int' in route '/route/{INTPARAM:INT}'.}}\n    [Parameter]\n    public int LongParam { get; set; } // Noncompliant {{Parameter type 'int' does not match route parameter type constraint 'long' in route '/route/{LongParam:long}'.}}\n    [Parameter]\n    public float StringParam { get; set; } // Noncompliant {{Parameter type 'float' does not match route parameter implicit type constraint 'string' in route '/route/{StringParam}'.}}\n    [Parameter]\n    public float OptionalStringParam { get; set; } // Noncompliant {{Parameter type 'float' does not match route parameter implicit type constraint 'string' in route '/route/{OptionalStringParam?}'.}}\n\n    [Parameter]\n    public bool CompliantBoolParam { get; set; } // Compliant\n    [Parameter]\n    public DateTime CompliantDatetimeParam { get; set; } // Compliant\n    [Parameter]\n    public decimal CompliantDecimalParam { get; set; } // Compliant\n    [Parameter]\n    public double CompliantDoubleParam { get; set; } // Compliant\n    [Parameter]\n    public float CompliantFloatParam { get; set; } // Compliant\n    [Parameter]\n    public Guid CompliantGuidParam { get; set; } // Compliant\n    [Parameter]\n    public int CompliantIntParam { get; set; } // Compliant\n    [Parameter]\n    public long CompliantLongParam { get; set; } // Compliant\n    [Parameter]\n    public string CompliantStringParam { get; set; } // Compliant\n    [Parameter]\n    public string OptionalCompliantStringParam { get; set; } // Compliant\n    [Parameter]\n    public string InvalidConstraint { get; set; } // Compliant\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ParameterValidationInAsyncShouldBeWrapped.CSharp10.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Threading.Tasks;\n\nnamespace Tests.Diagnostics\n{\n    public class InvalidCases\n    {\n        public static async Task<string> FooAsync(string something) // Noncompliant\n        {\n            ArgumentNullException.ThrowIfNull(something);\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary\n\n            await Task.Delay(1);\n            return something + \"foo\";\n        }\n\n        public static async Task<string> ThrowExpressionAsync(string something) // FN #6369\n        {\n            _ = something ?? throw new ArgumentNullException();\n\n            await Task.Delay(1);\n            return something + \"foo\";\n        }\n    }\n\n    public class ValidCases\n    {\n        public static Task FooAsync(string something)\n        {\n            ArgumentNullException.ThrowIfNull(something);\n\n            return FooInternalAsync(something);\n        }\n\n        private static async Task<string> FooInternalAsync(string something)\n        {\n            await Task.Delay(1);\n            return something + \"foo\";\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ParameterValidationInAsyncShouldBeWrapped.CSharp11.cs",
    "content": "﻿using System;\nusing System.Threading.Tasks;\n\nnamespace Tests.Diagnostics\n{\n    public interface IInvalidCases\n    {\n        static virtual async Task<string> FooAsync(string something) // Noncompliant {{Split this method into two, one handling parameters check and the other handling the asynchronous code.}}\n        {\n            if (something == null) { throw new ArgumentNullException(nameof(something)); } // Secondary\n\n            await Task.Delay(1);\n            return something + \"foo\";\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ParameterValidationInAsyncShouldBeWrapped.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Linq;\nusing System.Threading.Tasks;\n\nnamespace Tests.Diagnostics\n{\n    public class InvalidCases\n    {\n        public static async Task<string> FooAsync(string something) // Noncompliant {{Split this method into two, one handling parameters check and the other handling the asynchronous code.}}\n//                                       ^^^^^^^^\n        {\n            if (something == null) { throw new ArgumentNullException(nameof(something)); }\n//                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary {{This ArgumentException will be raised only after observing the task.}}\n\n            await Task.Delay(1);\n            return something + \"foo\";\n        }\n\n        public static async Task<string> IndirectUsageAsync(string something) // Noncompliant\n        {\n            var exception = new ArgumentNullException(nameof(something));\n            if (something == null)\n                throw exception; // Secondary\n            await Task.Delay(1);\n            return something + \"foo\";\n        }\n\n        public static async Task<string> IndirectUsageWithMethodCallAsync(string something) // Noncompliant\n        {\n            if (something == null)\n                throw GetArgumentExpression(nameof(something));\n//                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary\n            await Task.Delay(1);\n            return something + \"foo\";\n        }\n\n        private static ArgumentNullException GetArgumentExpression(string name)\n        {\n            return new ArgumentNullException(name);\n        }\n\n        // See https://github.com/SonarSource/sonar-dotnet/issues/2665\n        public async void OnSomeEvent(object sender, EventArgs args) // Compliant\n        {\n            if (sender == null)\n            {\n                throw new ArgumentNullException(nameof(sender));\n            }\n\n            await Task.Yield();\n        }\n\n        public void Foo(object sender, EventArgs args) { }\n    }\n\n    public class ValidCases\n    {\n        // https://github.com/SonarSource/sonar-dotnet/issues/6449\n        public class Repro_6449\n        {\n            public Task<int[]> CheckAsync() => Task.FromResult(new int[] { 1 });\n            public Task<int> Check2Async() => Task.FromResult(1);\n\n            public async Task HasS4457Async(int request) // Compliant\n            {\n                var identifierType = (await CheckAsync()).FirstOrDefault(x => x == request);\n                if (identifierType == 0)\n                    throw new ArgumentException(\"message\");\n            }\n        }\n\n        public static Task FooAsync(string something)\n        {\n            if (something == null) { throw new ArgumentNullException(nameof(something)); }\n\n            return FooInternalAsync(something);\n        }\n\n        private static async Task<string> FooInternalAsync(string something)\n        {\n            await Task.Delay(1);\n            return something + \"foo\";\n        }\n\n        public async Task DoAsync() // Compliant - no args check\n        {\n            await Task.Delay(0);\n        }\n\n        public async Task FooAsync(int age) // Compliant - the exception doesn't derive from ArgumentException\n        {\n            if (age == 0)\n            {\n                throw new Exception(\"Wrong age\");\n            }\n\n            await Task.Delay(0);\n        }\n\n\n        public static Task WithLocalFunctionAsync(string something) // Compliant - async part is declared in a sub method\n        {\n            if (something == null)\n            {\n                throw new ArgumentNullException(nameof(something));\n            }\n\n            return FooLocalFunctionAsync(something);\n\n            async Task<string> FooLocalFunctionAsync(string s)\n            {\n                await Task.Delay(1);\n                return s + \"foo\";\n            }\n        }\n\n        public async Task WithFuncAsync()\n        {\n            Func<int, string> func =\n                age =>\n                {\n                    if (age < 0)\n                    {\n                        throw new ArgumentOutOfRangeException(nameof(age)); // Compliant - we don't know where/how the func is used\n                    }\n\n                    return \"\";\n                };\n\n            await Task.Delay(0);\n        }\n\n        public Task WithAsyncFunc(string s)\n        {\n            if (s == null)\n            {\n                throw new ArgumentNullException(nameof(s));\n            }\n\n            Func<Task> func = async () => await Task.Delay(0);\n\n            return func();\n        }\n\n        // See https://github.com/SonarSource/sonar-dotnet/issues/1819\n        public async Task DoSomethingAsync(string value)\n        {\n            await Task.Delay(0);\n\n            if (value == null)\n            {\n                throw new ArgumentNullException(nameof(value));\n            }\n        }\n\n        // See https://github.com/SonarSource/sonar-dotnet/issues/2665\n        private async void OnButtonPressed( object sender, EventArgs e) // Compliant (the compliant solution from rule specs does not apply here)\n        {\n            if(e == null)\n                throw new ArgumentException(nameof(e));\n\n            await Task.Delay(0);\n        }\n\n        // https://github.com/SonarSource/sonar-dotnet/issues/4702\n        private static async Task Main(string[] args)   // Compliant, should not raise on Main\n        {\n            if (args.Length == 0)\n            {\n                throw new ArgumentException(nameof(args));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ParameterValidationInYieldShouldBeWrapped.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\n\npublic static class InvalidCases\n{\n    public static IEnumerable<string> YieldReturn(string something) // Noncompliant\n    {\n        ArgumentNullException.ThrowIfNull(something);\n//      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary\n\n        yield return something;\n    }\n\n    public static IEnumerable<int> YieldBreak(string something) // Noncompliant\n    {\n        ArgumentNullException.ThrowIfNull(something);\n//      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary\n\n        yield break;\n    }\n\n    public static IEnumerable<int> ThrowExpression(string something) // FN #6369\n    {\n        _ = something ?? throw new ArgumentNullException();\n\n        yield break;\n    }\n\n    // For details, check https://github.com/SonarSource/sonar-dotnet/pull/6624.\n    public static async IAsyncEnumerable<int> AsyncThenYield(object arg) // Noncompliant\n    {\n        if (arg is null)\n        {\n            throw new ArgumentException(nameof(arg));\n//                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary\n        }\n\n        var res = await Task.Run(() => 42);\n        yield return res;\n    }\n\n    // For details, check https://github.com/SonarSource/sonar-dotnet/pull/6624.\n    public static async IAsyncEnumerable<int> NestedAsyncThenYield(object arg) // Noncompliant\n    {\n        if (arg is null)\n        {\n            throw new ArgumentException(nameof(arg));\n//                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary\n        }\n\n        var res = (await Task.Run(() => 42)).GetHashCode();\n        yield return res;\n    }\n}\n\npublic static class ValidCases\n{\n    public static IEnumerable<string> Foo(string something) // Compliant - split into 2 methods\n    {\n        ArgumentNullException.ThrowIfNull(something);\n\n        return FooIterator(something);\n    }\n\n    private static IEnumerable<string> FooIterator(string something)\n    {\n        yield return something;\n    }\n}\n\npublic interface IInvalidCases\n{\n    public static virtual IEnumerable<string> Foo(string something) // Noncompliant {{Split this method into two, one handling parameters check and the other handling the iterator.}}\n    {\n        if (something == null)\n        { throw new ArgumentNullException(nameof(something)); } // Secondary\n\n        yield return something;\n    }\n}\n\nclass InlineArrays\n{\n    IEnumerable<int> Invalid(Buffer? buffer)     // Noncompliant\n    {\n        if (buffer == null)\n            throw new ArgumentNullException(nameof(buffer)); // Secondary\n\n        foreach (var item in new Buffer())\n            yield return item;\n    }\n\n    IEnumerable<int> Valid(Buffer? buffer)       // Compliant\n    {\n        if (buffer == null)\n            throw new ArgumentNullException(nameof(buffer));\n        return Generator(buffer.Value);\n\n        IEnumerable<int> Generator(Buffer buffer)\n        {\n            foreach (var item in buffer)\n                yield return item;\n        }\n    }\n\n    [System.Runtime.CompilerServices.InlineArray(10)]\n    struct Buffer\n    {\n        int arrayItem;\n    }\n}\n\npublic static class NewExtensions\n{\n    extension<TSource>(IEnumerable<TSource> source)\n    {\n        public IEnumerable<TSource> Noncompliant(Func<TSource, bool> predicate)               // Noncompliant\n        {\n            if (source is null) { throw new ArgumentNullException(nameof(source)); }        // Secondary\n            if (predicate is null) { throw new ArgumentNullException(nameof(predicate)); }  // Secondary\n\n            foreach (var element in source)\n            {\n                if (!predicate(element))\n                { break; }\n                yield return element;\n            }\n        }\n\n        public IEnumerable<TSource> Compliant(Func<TSource, bool> predicate)\n        {\n            if (source == null)\n            { throw new ArgumentNullException(nameof(source)); }\n            if (predicate == null)\n            { throw new ArgumentNullException(nameof(predicate)); }\n            return CompliantIterator<TSource>(source, predicate);\n        }\n\n        private static IEnumerable<TSource> CompliantIterator(IEnumerable<TSource> target, Func<TSource, bool> predicate)\n        {\n            foreach (TSource element in target)\n            {\n                if (!predicate(element))\n                    break;\n                yield return element;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ParameterValidationInYieldShouldBeWrapped.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public static class InvalidCases\n    {\n        public static IEnumerable<string> YieldReturn(string something) // Noncompliant {{Split this method into two, one handling parameters check and the other handling the iterator.}}\n//                                        ^^^^^^^^^^^\n        {\n            if (something == null) { throw new ArgumentNullException(nameof(something)); }\n//                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary\n\n            yield return something;\n        }\n\n        public static IEnumerable<int> GetSomething(string value) // Noncompliant - this is an edge case that might be worth handling later on\n        {\n            yield return 42;\n\n            if (value == null)\n            {\n                throw new ArgumentNullException(nameof(value)); // Secondary\n            }\n        }\n\n        public static IEnumerable<int> YieldBreak(int a) // Noncompliant\n        {\n            if (a < 0)\n            {\n                throw new ArgumentOutOfRangeException(nameof(a)); // Secondary\n            }\n\n            yield break;\n        }\n\n        public static IEnumerable<string> IndirectUsageAsync(string something) // Noncompliant\n        {\n            var exception = new ArgumentNullException(nameof(something));\n            if (something == null)\n                throw exception; // Secondary\n            yield return something;\n        }\n\n        public static IEnumerable<string> IndirectUsageWithMethodCallAsync(string something) // Noncompliant\n        {\n            if (something == null)\n                throw GetArgumentExpression(nameof(something));\n//                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Secondary\n            yield return something;\n        }\n\n        private static ArgumentNullException GetArgumentExpression(string name)\n        {\n            return new ArgumentNullException(name);\n        }\n\n        // Documenting that this rule fires even if T:ArgumentException has no argument\n        public static IEnumerable<int> ThrowWithoutArgument(int a) // Noncompliant\n        {\n            throw new ArgumentNullException(); // Secondary\n            yield return 42;\n        }\n\n        // Documenting that this rule fires even if T:ArgumentException has an ad-hoc argument\n        public static IEnumerable<int> ThrowWithAdHocArgument(int a) // Noncompliant\n        {\n            throw new ArgumentNullException(\"i am not a parameter name\"); // Secondary\n            yield return 42;\n        }\n    }\n\n    public static class ValidCases\n    {\n        public static IEnumerable<string> Foo(string something) // Compliant - split into 2 methods\n        {\n            if (something == null) { throw new ArgumentNullException(nameof(something)); }\n\n            return FooIterator(something);\n        }\n\n        private static IEnumerable<string> FooIterator(string something)\n        {\n            yield return something;\n        }\n\n        public static IEnumerable<string> WithLocalFunction(string something) // Compliant - usage of local function\n        {\n            if (something == null) { throw new ArgumentNullException(nameof(something)); }\n\n            return Iterator(something);\n\n            IEnumerable<string> Iterator(string s)\n            {\n                yield return s;\n            }\n        }\n\n        public static IEnumerable<int> WithFunc(string foo)\n        {\n            Func<string, string> func =\n                f =>\n                {\n                    if (f == null)\n                    {\n                        throw new ArgumentNullException(nameof(f));\n                    }\n\n                    return f + f;\n                };\n\n            yield return foo.Length;\n        }\n    }\n}\n\nclass NullCoalescing\n{\n    IEnumerable<int> Invalid(int? i)                // FN\n    {\n        _ = i ?? throw new ArgumentNullException(nameof(i));\n\n        yield return 1;\n    }\n\n    IEnumerable<int> ValidWithSecondMethod(int? i)  // Compliant\n    {\n        _ = i ?? throw new ArgumentNullException(nameof(i));\n        return SecondMethod();\n    }\n\n    IEnumerable<int> SecondMethod() { yield return 1; }\n\n    IEnumerable<int> ValidWithLocalFunction(int? i)  // Compliant\n    {\n        _ = i ?? throw new ArgumentNullException(nameof(i));\n        return LocalFunction();\n\n        IEnumerable<int> LocalFunction() { yield return 1; }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ParametersCorrectOrder.Latest.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public interface IInterface\n    {\n        static virtual void SomeMethod(int a, int b) { } // Secondary\n    }\n\n    public class SomeClass<T> where T : IInterface\n    {\n        public SomeClass()\n        {\n            int a = 1;\n            int b = 2;\n\n            T.SomeMethod(b, a); // Noncompliant\n        }\n    }\n}\n\nnamespace Repro_8072\n{\n    class Lambdas\n    {\n        Func<int, int, int> F1 = (int a, int b) => a + b;\n\n        void InvokedFromAnotherLambda()\n        {\n            var f1 = (int a, int b) => a + b;\n            var paramsFullyInverted = (int a, int b) => f1(b, a);                                    // FN\n            var paramsFullyInvertedWithAdditionalParamAfter = (int a, int b, string s) => f1(b, a);  // FN\n            var paramsFullyInvertedWithAdditionalParamBefore = (string s, int a, int b) => f1(b, a); // FN\n\n            var f2 = (int a, int b, int c) => a + b + c;\n            var paramsPartiallyInvertedFirstAndSecond = (int a, int b, int c) => f2(b, a, c);        // FN\n            var paramsPartiallyInvertedFirstAndLast = (int a, int b, int c) => f2(c, b, a);          // FN\n            var paramsPartiallyInvertedSecondAndLast = (int a, int b, int c) => f2(a, c, b);         // FN\n        }\n\n        void InvokedFromLocalFunction()\n        {\n            var f1 = (int a, int b) => a + b;\n            var f2 = (int a, int b, int c) => a + b + c;\n\n            int FullyInverted(int a, int b) => f1(b, a);                                    // FN\n            int FullyInvertedWithAdditionalParamAfter(int a, int b, string c) => f1(b, a);  // FN\n            int FullyInvertedWithAdditionalParamBefore(string c, int a, int b) => f1(b, a); // FN\n\n            int PartiallyInvertedFirstAndSecond(int a, int b, int c) => f2(b, a, c); // FN\n            int PartiallyInvertedFirstAndLast(int a, int b, int c) => f2(c, b, a);   // FN\n            int PartiallyInvertedSecondAndLast(int a, int b, int c) => f2(a, c, b);  // FN\n        }\n\n        void InvokedFromAMethod(int a, int b)\n        {\n            F1(b, a);   // FN\n        }\n    }\n}\n\nclass StaticLocalFunctions\n{\n    public void M1()\n    {\n        static double divide(int divisor, int dividend) // Secondary\n        {\n            return divisor / dividend;\n        }\n\n        static void doTheThing(int divisor, int dividend)\n        {\n            double result = divide(dividend, divisor);  // Noncompliant\n        }\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/8071\nnamespace Repro_8071\n{\n    class BaseConstructor\n    {\n        class Base(int a, int b) // Secondary [Base1, Base2, Base3, Base4, Base5, Base6, Base7, Base8]\n        {\n            Base(int a, int b, string c) : this(b, a) { }                                            // Noncompliant [Base1]\n            //                             ^^^^                                                      \n            Base(string c, int a, int b) : this(b, a) { }                                            // Noncompliant [Base2]\n        }\n\n        class ParamsFullyInverted(int a, int b) : Base(b, a);                                        // Noncompliant [Base3]\n        //                                        ^^^^\n        class ParamsPartiallyInverted(int a, int b, int c) : BaseConstructor.Base(b, a);             // Noncompliant [Base4]\n        //                                                                   ^^^^\n        class ParamsPartiallyInvertedWithAdditionalParamAfter(int a, int b, string s) : Base(b, a);  // Noncompliant [Base5]\n        class ParamsPartiallyInvertedWithAdditionalParamBefore(string s, int a, int b) : Base(b, a); // Noncompliant [Base6]\n\n        Base MyMethod(int b, int a)\n        {\n            _ = new Base(b, a);                                                                      // Noncompliant [Base7]\n            return new(b, a);                                                                        // Noncompliant [Base8]\n        }\n    }\n\n    class WithRecordStructs\n    {\n        void Basics(int a, int b, int c)\n        {\n            _ = new SomeRecord(b, a);           // Noncompliant [SomeRecord1]\n        }\n\n        void WithPromotion(short a, short b)\n        {\n            SomeRecord _ = new(b, a);           // Noncompliant [SomeRecord2]\n            //             ^^^\n        }\n\n        void WithCasting(long a, long b)\n        {\n            _ = new SomeRecord((int)b, (int)a); // FN [SomeRecord3]\n        }\n\n        record SomeRecord(int a, int b)  // Secondary [SomeRecord1, SomeRecord2, SomeRecord4, SomeRecord5]\n        {\n            public SomeRecord(int a, int b, string c) : this(b, a) { } // Noncompliant [SomeRecord4]\n            public SomeRecord(string c, int a, int b) : this(b, a) { } // Noncompliant [SomeRecord5]\n        }\n    }\n\n    class WithRecords\n    {\n        void Basics(int a, int b, int c)\n        {\n            _ = new SomeRecordStruct(b, a);           // Noncompliant [SomeRecordStruct1]\n        }\n\n        void WithPromotion(short a, short b)\n        {\n            _ = new SomeRecordStruct(b, a);           // Noncompliant [SomeRecordStruct2]\n        }\n\n        void WithCasting(long a, long b)\n        {\n            _ = new SomeRecordStruct((int)b, (int)a); // FN [SomeRecordStruct3]\n        }\n\n        record struct SomeRecordStruct(int a, int b) // Secondary [SomeRecordStruct1, SomeRecordStruct2, SomeRecordStruct4, SomeRecordStruct5]\n        {\n            public SomeRecordStruct(int a, int b, string c) : this(b, a) { } // Noncompliant [SomeRecordStruct4]\n            public SomeRecordStruct(string c, int a, int b) : this(b, a) { } // Noncompliant [SomeRecordStruct5]\n        }\n    }\n}\n\nnamespace Repro_8072\n{\n    public class DefaultLambdaParameters\n    {\n        void InvokedFromAnotherLambda()\n        {\n            var f1 = (int a = 42, int b = 42) => a + b;\n            var paramsFullyInverted = (int a = 42, int b = 42) => f1(b, a);                                           // FN\n            var paramsFullyInvertedWithAdditionalParamAfter = (int a = 42, int b = 42, string s = \"42\") => f1(b, a);  // FN\n            var paramsFullyInvertedWithAdditionalParamBefore = (string s = \"42\", int a = 42, int b = 42) => f1(b, a); // FN\n\n            var f2 = (int a = 42, int b = 42, int c = 42) => a + b + c;\n            var paramsPartiallyInvertedFirstAndSecond = (int a = 42, int b = 42, int c = 42) => f2(b, a, c); // FN\n            var paramsPartiallyInvertedFirstAndLast = (int a = 42, int b = 42, int c = 42) => f2(c, b, a);   // FN\n            var paramsPartiallyInvertedSecondAndLast = (int a = 42, int b = 42, int c = 42) => f2(a, c, b);  // FN\n        }\n\n        void InvokedFromLocalFunction()\n        {\n            var f = (int a = 42, int b = 42) => a + b;\n\n            int SomeLocalFunction(int a = 42, int b = 42) => f(b, a); // FN\n        }\n    }\n}\n\npublic static class NewExtensions\n{\n    extension(int)\n    {\n        static double divide(int divisor, int dividend)                 // Secondary\n        {\n            return divisor / dividend;\n        }\n    }\n\n    extension(int math)\n    {\n        public double instanceDivide(int divisor, int dividend)         // Secondary\n        {\n            return divisor / dividend;\n        }\n    }\n\n    public class TestExtensions\n    {\n        void doTheThing(int divisor, int dividend)\n        {\n            double staticDivide = int.divide(dividend, divisor);        // Noncompliant\n            var instanceDivide = 10.instanceDivide(dividend, divisor);  // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ParametersCorrectOrder.cs",
    "content": "﻿using System;\nusing System.Collections;\n\nnamespace Tests.Diagnostics\n{\n    public class Params\n    {\n        public void method(int i, int k = 5, params int[] rest)\n        {\n        }\n\n        public void call()\n        {\n            int i = 0, j = 5, k = 6, l=7;\n            method(i, j, k, l);\n        }\n        public void call2()\n        {\n            int i = 0, j = 5, rest = 6, l = 7;\n            var k = new[] { i, l };\n            method(i, k : rest, rest : k); // Compliant, code will not compile if suggestion is applied\n        }\n    }\n\n    public static class Other\n    {\n        public static void call()\n        {\n            var a = \"1\";\n            var b = \"2\";\n\n            Comparer.Default.Compare(b, a); // Noncompliant\n            //               ^^^^^^^\n        }\n    }\n\n    public static class Extensions\n    {\n        public static void Ex(this string self, string v1, string v2)\n//                         ^^ Secondary [6]\n        {\n        }\n        public static void Ex(this string self, string v1, string v2, int x)\n        {\n            Ex(self, v1, v2);\n            self.Ex(v1, v2);\n            Extensions.Ex(self, v1, v2);\n            Tests.Diagnostics.Extensions.Ex(self, v1, v2);\n        }\n    }\n\n    public partial class ParametersCorrectOrder\n    {\n        partial void divide(int divisor, int someOther, int dividend, int p = 10, int some = 5, int other2 = 7);\n//                   ^^^^^^ Secondary [1,2,3,4]\n    }\n\n    public partial class ParametersCorrectOrder\n    {\n        partial void divide(int a, int b, int c, int p, int other, int other2)\n        {\n            var x = a / b;\n        }\n\n        public void m(int a, int b) // Secondary [5]\n        {\n        }\n\n        public void doTheThing()\n        {\n            int divisor = 15;\n            int dividend = 5;\n            var something = 6;\n            var someOther = 6;\n            var other2 = 6;\n            var some = 6;\n\n            divide(dividend, 1 + 1, divisor, other2: 6);  // Noncompliant [1] operation succeeds, but result is unexpected\n//          ^^^^^^\n\n            divide(divisor, other2, dividend);\n            divide(divisor, other2, dividend, other2: someOther); // Noncompliant [2] {{Parameters to 'divide' have the same names but not the same order as the method arguments.}}\n\n            divide(divisor, someOther, dividend, other2: some, some: other2); // Noncompliant [3]\n\n            divide(1, 1, 1, other2: some, some: other2); // Noncompliant [4]\n            divide(1, 1, 1, other2: 1, some: other2);\n\n            int a=5, b=6;\n\n            m(1, a); // Compliant\n            m(1, b);\n            m(b, b);\n            m(divisor, dividend);\n\n            m(a, b);\n            m(b, b); // Compliant\n            m(b, a); // Noncompliant [5]\n\n            var v1 = \"\";\n            var v2 = \"\";\n\n            \"aaaaa\".Ex(v1, v2);\n            \"aaaaa\".Ex(v2, v1); // Noncompliant [6]\n        }\n    }\n\n    public class A\n    {\n        public class B\n        {\n            public class C\n            {\n                public C(string left, string right) { } // Secondary [C]\n            }\n        }\n    }\n\n    public class Foo\n    {\n        public Foo(string left, string right) { } // Secondary [B]\n\n        public void Method(string left, string right) { } // Secondary [A]\n\n        public void Bar()\n        {\n            var left = \"valueLeft\";\n            var right = \"valueRight\";\n\n            Method(left, right);\n            Method(right, left); // Noncompliant [A]\n\n            var foo1 = new Foo(left, right);\n            var foo2 = new Foo(right, left); // Noncompliant [B]\n\n            var c1 = new A.B.C(left, right);\n            var c2 = new A.B.C(right, left); // Noncompliant [C]\n        }\n    }\n\n    class Program\n    {\n        void Struct(DateTime a, string b)\n        {\n            Bar1(a, b); // Compliant\n        }\n\n        void ClassAndInterface(Boo a, string b)\n        {\n            Bar2(a, b); // Compliant\n            Bar3(a, b); // Compliant\n            Bar3(b: a, a: b); // Compliant\n        }\n        void Bar1(DateTime b, string a) { }\n        void Bar2(Boo b, string a) { }\n        void Bar3(IBoo b, string a) { }\n    }\n    interface IBoo { }\n    class Boo : IBoo { }\n\n    class WithLocalFunctions\n    {\n        public void M2()\n        {\n            double divide(int divisor, int dividend) // Secondary\n            {\n                return divisor / dividend;\n            }\n\n            void doTheThing(int divisor, int dividend)\n            {\n                double result = divide(dividend, divisor);  // Noncompliant\n            }\n        }\n\n        public void M3()\n        {\n            double divide(int divisor, int dividend) => divisor / dividend; // Secondary\n\n            double doTheThing(int divisor, int dividend) => divide(dividend, divisor);  // Noncompliant\n        }\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/8070\nnamespace Repro_8070\n{\n    class InvokingConstructorViaNew\n    {\n        void Test(int a, int b, int c)\n        {\n            _ = new SomeClass(b, a);                              // Noncompliant, fully inverted\n            //      ^^^^^^^^^\n            _ = new InvokingConstructorViaNew.SomeClass(b, a, c); // Noncompliant, partially inverted\n            //                                ^^^^^^^^^\n        }\n\n        class SomeClass\n        {\n            public SomeClass(int a, int b) { }        // Secondary\n            public SomeClass(int a, int b, int c) { } // Secondary\n        }\n    }\n\n    class InvokingConstructorViaThis\n    {\n        class SomeClass\n        {\n            public SomeClass(int a, int b) { } // Secondary [SomeClass1, SomeClass2]\n            public SomeClass(int a, int b, string c) : this(b, a) { } // Noncompliant [SomeClass1]\n            public SomeClass(string c, int a, int b) : this(b, a) { } // Noncompliant [SomeClass2]\n        }\n    }\n\n    class InvokingConstructorViaBase\n    {\n        class Base\n        {\n            public Base(int a, int b) { }        // Secondary [Base1, Base3, Base4]\n            public Base(int a, int b, int c) { } // Secondary [Base2]\n        }\n\n        class ParamsFullyInverted : Base\n        {\n            public ParamsFullyInverted(int a, int b) : base(b, a) { }                                    // Noncompliant [Base1]\n            //                                         ^^^^\n        }\n\n        class ParamsPartiallyInverted : Base\n        {\n            public ParamsPartiallyInverted(int a, int b, int c) : base(b, a, c) { }                      // Noncompliant [Base2]\n        }\n\n        class ParamsFullyInvertedWithAdditionalParamAfter : Base\n        {\n            public ParamsFullyInvertedWithAdditionalParamAfter(int a, int b, string s) : base(b, a) { }  // Noncompliant [Base3]\n        }\n\n        class ParamsFullyInvertedWithAdditionalParamBefore : Base\n        {\n            public ParamsFullyInvertedWithAdditionalParamBefore(string s, int a, int b) : base(b, a) { } // Noncompliant [Base4]\n        }\n    }\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ParametersCorrectOrder.vb",
    "content": "﻿Namespace Tests.TestCases\n    Public Class Foo\n        Public Shared Property ValProp As Integer\n\n        Sub New(ByVal left As Integer, ByVal right As Integer)\n\n        End Sub\n\n        Sub New()\n        End Sub\n\n        Public Sub Invocations()\n            Dim divisor = 15\n            Dim dividend = 5\n\n            Divide(divisor, dividend)\n            Divide(dividend, dividend)\n            Divide(divisor, divisor)\n            Foo.GlobalDivide(divisor, dividend)\n\n            Divide(dividend, divisor) ' Noncompliant [1] {{Parameters to 'Divide' have the same names but not the same order as the method arguments.}}\n'           ^^^^^^\n            Foo.GlobalDivide(dividend, divisor) ' Noncompliant [2]\n            '   ^^^^^^^^^^^^\n\n            Divide(dividend:=dividend, divisor:= divisor)\n\n            Divide(ValProp, Foo.ValProp)\n\n            FooBar(1)\n            FooBar(1, \"a\", \"b\")\n            FooBar(value:= 1)\n\t\tEnd Sub\n\n        Public Sub ObjectCreations()\n            Dim left = 1\n            Dim right = 2\n\n            Dim x = New Foo(left, right)\n            x = New Foo(left, left)\n            x = New Foo(right, right)\n            x = New Foo(right:= right, left:= left)\n            x = New Foo\n\n            x = New Foo(right, left) ' Noncompliant\n            '       ^^^\n            x = New FooFoo(right, left) ' Noncompliant\n            x = New Foo.FooFoo(right, left) ' Noncompliant\n            '           ^^^^^^\n\n            x = New Foo(ValProp, Foo.ValProp)\n        End Sub\n\n        Sub Bar(ByVal name As String, Optional ByVal age As Short = 0)\n        End Sub\n\n        Sub FooBar(ByVal value As Integer, ByVal ParamArray args() As String)\n        End Sub\n\n        Public Function Divide(ByVal divisor As Integer, ByVal dividend As Integer) As Double ' Secondary [1]\n            Return divisor / dividend\n        End Function\n\n        Public Shared Function GlobalDivide(ByVal divisor As Integer, ByVal dividend As Integer) As Double ' Secondary [2]\n            Return divisor / dividend\n        End Function\n\n        Public Class FooFoo\n            Inherits Foo\n            Sub New(ByVal left As Integer, ByVal right As Integer)\n                MyBase.New(right, left) ' Noncompliant\n            End Sub\n        End Class\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PartCreationPolicyShouldBeUsedWithExportAttribute.Latest.cs",
    "content": "﻿using System.ComponentModel.Composition;\n\n[Export(typeof(object))]\n[PartCreationPolicy(CreationPolicy.Any)] // Compliant, Export is present\nrecord Program1\n{\n}\n\n[InheritedExport(typeof(object))]\n[PartCreationPolicy(CreationPolicy.Any)] // Compliant, InheritedExport is present\nrecord Program2_Base\n{\n}\n\n[PartCreationPolicy(CreationPolicy.Any)] // Compliant, InheritedExport is present in base\nrecord Program2 : Program2_Base\n{\n}\n\n[PartCreationPolicy(CreationPolicy.Any)] // Noncompliant\nrecord Program3\n{\n}\n\n[PartCreationPolicy(CreationPolicy.Any)] // Noncompliant\nrecord Program4 : Program1\n{\n    public void Method()\n    {\n        [PartCreationPolicy(CreationPolicy.Any)] // Error [CS0592] - Compliant, attribute cannot be used on methods, don't raise\n        void LocalFunction()\n        { }\n    }\n}\n\n[Export(typeof(Foo))]\n[PartCreationPolicy(CreationPolicy.Any)] // Compliant\nrecord Foo(string X)\n{\n}\n\n[PartCreationPolicy(CreationPolicy.Any)] // Noncompliant\nrecord Bar(string X)\n{\n}\n\nclass PrimaryConstructors\n{\n    [PartCreationPolicy(CreationPolicy.Any)] // Noncompliant\n    class Class1(int iPar, in int iParWithExplicitIn, int iParWithDefault = 42);\n\n    [InheritedExport(typeof(object))]\n    [PartCreationPolicy(CreationPolicy.Any)] // Compliant, InheritedExport is present\n    class Class2(int iPar, in int iParWithExplicitIn, int iParWithDefault = 42);\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PartCreationPolicyShouldBeUsedWithExportAttribute.cs",
    "content": "﻿using System;\nusing System.ComponentModel.Composition;\n\n[Export(typeof(object))]\n[PartCreationPolicy(CreationPolicy.Any)] // Compliant, Export is present\nclass Program1\n{\n}\n\n[InheritedExport(typeof(object))]\n[PartCreationPolicy(CreationPolicy.Any)] // Compliant, InheritedExport is present\nclass Program2_Base\n{\n}\n\n[PartCreationPolicy(CreationPolicy.Any)] // Compliant, InheritedExport is present in base\nclass Program2 : Program2_Base\n{\n}\n\n    [PartCreationPolicy(CreationPolicy.Any)] // Noncompliant {{Add the 'ExportAttribute' or remove 'PartCreationPolicyAttribute' to/from this type definition.}}\n//   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nclass Program3\n{\n}\n\n[PartCreationPolicy(CreationPolicy.Any)] // Noncompliant, Export is not inherited\nclass Program4 : Program1\n{\n}\n\nclass Program5\n{\n    [PartCreationPolicy(CreationPolicy.Any)] // Error [CS0592] - Compliant, attribute cannot be used on methods, don't raise\n    public void Method() { }\n\n    [PartCreationPolicy(CreationPolicy.Any)] // Error [CS0592] - Compliant, attribute cannot be used on fields, don't raise\n    public int Field;\n\n    [PartCreationPolicy(CreationPolicy.Any)] // Error [CS0592] - Compliant, attribute cannot be used on properties, don't raise\n    public int Property { get; set; }\n}\n\n[MyExport]\n[PartCreationPolicy(CreationPolicy.Any)] // Compliant, custom Export is present\nclass Program6 { }\n\n[MyInheritedExport(typeof(object))]\n[PartCreationPolicy(CreationPolicy.Any)] // Compliant, MyInheritedExport is present\nclass Program7_Base { }\n\n[PartCreationPolicy(CreationPolicy.Any)] // Compliant, MyInheritedExport is present in base\nclass Program7 : Program2_Base { }\n\n[Foo]\n[PartCreationPolicy(CreationPolicy.Any)] // Noncompliant {{Add the 'ExportAttribute' or remove 'PartCreationPolicyAttribute' to/from this type definition.}}\nclass Program8 { }\n\n[PartCreationPolicy(CreationPolicy.NonShared)] // Compliant, InheritedExport is present on interface\nclass Program9 : IMyInheritedExportInterface { }\n\n[PartCreationPolicy(CreationPolicy.Shared)] // Compliant, MyInheritedExport is present on interface MyInheritedExportInterface\nclass Program11 : IFoo, IBar, IMyInheritedExportInterface, IQix { }\n\n[PartCreationPolicy(CreationPolicy.NonShared)] // Noncompliant\nclass Program12 : IFoo, IBar, IQix { }\n\nclass MyExportAttribute : ExportAttribute { }\n\nclass MyInheritedExportAttribute : InheritedExportAttribute\n{\n    public MyInheritedExportAttribute(System.Type type) { }\n}\n\nclass FooAttribute : Attribute { }\n\n[InheritedExport(typeof(object))]\ninterface IMyInheritedExportInterface { }\n\ninterface IFoo { }\ninterface IBar { }\ninterface IQix { }\n\n[PartCreationPolicy(CreationPolicy.Any)] // Error [CS1671] - Compliant, illegal use, don't raise\n\nnamespace Aliases\n{\n    using AliasForPartCreationPolicy = System.ComponentModel.Composition.PartCreationPolicyAttribute;\n    using AliasForExport = System.ComponentModel.Composition.ExportAttribute;\n    using AliasForInheritedExport = System.ComponentModel.Composition.InheritedExportAttribute;\n\n    [AliasForExport(typeof(object))]\n    [PartCreationPolicy(CreationPolicy.Any)]         // Compliant, Export is present\n    class AClass1 { }\n\n    [AliasForInheritedExport(typeof(object))]\n    [PartCreationPolicy(CreationPolicy.Any)]         // Compliant, InheritanceExport is present\n    class AClass2 { }\n\n    [AliasForExport(typeof(object))]\n    [AliasForPartCreationPolicy(CreationPolicy.Any)] // Compliant, Export is present\n    class AClass3 { }\n\n    [AliasForPartCreationPolicy(CreationPolicy.Any)] // Noncompliant\n    class AClass4 { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PartCreationPolicyShouldBeUsedWithExportAttribute.vb",
    "content": "﻿Imports System\nImports System.ComponentModel.Composition\n\nNamespace Tests.TestCases\n    <Export(GetType(Object))>\n    <PartCreationPolicy(CreationPolicy.Any)> ' Compliant, Export is present\n    class Program1\n\n    End Class\n\n    <InheritedExport(GetType(Object))>\n    <PartCreationPolicy(CreationPolicy.Any)> ' Compliant, InheritedExport is present\n    class Program2_Base\n\n    End Class\n\n    <PartCreationPolicy(CreationPolicy.Any)> ' Compliant, InheritedExport is present in base\n    class Program2\n        inherits Program2_Base\n\n    End Class\n\n    <PartCreationPolicy(CreationPolicy.Any)> ' Noncompliant {{Add the 'ExportAttribute' or remove 'PartCreationPolicyAttribute' to/from this type definition.}}\n    class Program3\n'    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^@-1\n\n    End Class\n\n    <PartCreationPolicy(CreationPolicy.Any)> ' Noncompliant, Export is not inherited\n    class Program4\n        inherits Program1\n\n    End Class\n\n    <MyExportAttribute>\n    <PartCreationPolicy(CreationPolicy.Any)>\n    Class Program6\n    End Class\n\n    <MyInheritedExport(GetType(Object))>\n    <PartCreationPolicy(CreationPolicy.Any)>\n    Class Program7_Base\n    End Class\n\n    <PartCreationPolicy(CreationPolicy.Any)>\n    Class Program7\n        Inherits Program2_Base\n    End Class\n\n    <Foo>\n    <PartCreationPolicy(CreationPolicy.Any)> ' Noncompliant {{Add the 'ExportAttribute' or remove 'PartCreationPolicyAttribute' to/from this type definition.}}\n    Class Program8\n    End Class\n\n    <PartCreationPolicy(CreationPolicy.NonShared)>\n    Class Program9\n        Implements IMyInheritedExportInterface\n    End Class\n\n    <PartCreationPolicy(CreationPolicy.[Shared])>\n    Class Program11\n        Implements IFoo, IBar, IMyInheritedExportInterface, IQix\n    End Class\n\n    <PartCreationPolicy(CreationPolicy.[NonShared])> ' Noncompliant\n    Class Program12\n        Implements IFoo, IBar, IQix\n    End Class\n\n    Class MyExportAttribute\n        Inherits ExportAttribute\n    End Class\n\n    Class MyInheritedExportAttribute\n        Inherits InheritedExportAttribute\n\n        Public Sub New(ByVal type As System.Type)\n        End Sub\n    End Class\n\n    Class FooAttribute\n        Inherits Attribute\n    End Class\n\n    <InheritedExport(GetType(Object))>\n    Interface IMyInheritedExportInterface\n    End Interface\n\n    Interface IFoo\n    End Interface\n\n    Interface IBar\n    End Interface\n\n    Interface IQix\n    End Interface\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PartialMethodNoImplementation.Latest.Partial.cs",
    "content": "﻿public partial record Record3\n{\n    partial void Method3(); // Noncompliant\n\n    partial void Method2()\n    {\n\n    }\n\n    public partial void M7()\n    {\n\n    }\n\n    public partial void M10()\n    {\n\n    }\n\n    public partial int M11()\n    {\n        return 42;\n    }\n\n    public partial void M12(out string someParam)\n    {\n        someParam = \"\";\n    }\n}\n\npublic partial record struct RecordStruct3\n{\n    partial void Method3(); // Noncompliant\n\n    partial void Method2()\n    {\n\n    }\n\n    public partial void M7()\n    {\n\n    }\n\n    public partial void M10()\n    {\n\n    }\n\n    public partial int M11()\n    {\n        return 42;\n    }\n\n    public partial void M12(out string someParam)\n    {\n        someParam = \"\";\n    }\n}\n\npublic partial class PartialConstructorHasImplementation\n{\n    public partial PartialConstructorHasImplementation() { }\n}\n\npublic partial class PartialConstructorNoImplementation\n{\n\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PartialMethodNoImplementation.Latest.cs",
    "content": "﻿public partial record Record\n{\n    partial void Method(); //Noncompliant {{Supply an implementation for this partial method.}}\n    private partial void M2();      // Error [CS8795]\n    internal partial void M3();     // Error [CS8795]\n    protected partial void M4();    // Error [CS8795]\n    protected internal partial void M5();           // Error [CS8795]\n    public partial void M6();       // Error [CS8795]\n    public partial void M7();       // Compliant\n    public partial int M8();        // Error [CS8795]\n    public partial void M9(out string someParam);   // Error [CS8795]\n    public partial void M10();      // Compliant\n    public partial int M11();       // Compliant\n    public partial void M12(out string someParam); // Compliant\n}\n\npublic partial record Record\n{\n    public partial void M7()\n    {\n\n    }\n\n    public partial void M10()\n    {\n\n    }\n\n    public partial int M11()\n    {\n        return 42;\n    }\n\n    public partial void M12(out string someParam)\n    {\n        someParam = \"\";\n    }\n}\n\npublic partial record Record2\n{\n    partial void Method();  //Noncompliant {{Supply an implementation for this partial method.}}\n    private partial void M2();              // Error [CS8795]\n    internal partial void M3();             // Error [CS8795]\n    protected partial void M4();            // Error [CS8795]\n    protected internal partial void M5();   // Error [CS8795]\n    public partial void M6();               // Error [CS8795]\n\n    public void SomeMethod()\n    {\n        var record2 = new Record2();\n\n        record2.Method(); // Noncompliant\n        record2.M2();\n        record2.M3();\n        record2.M4();\n        record2.M5();\n        record2.M6();\n    }\n}\n\npublic partial record Record3\n{\n    partial void Method(); //Noncompliant {{Supply an implementation for this partial method.}}\n    partial void Method2();\n    private partial void M2();      // Error [CS8795]\n    internal partial void M3();     // Error [CS8795]\n    protected partial void M4();    // Error [CS8795]\n    protected internal partial void M5();   // Error [CS8795]\n    public partial void M6();       // Error [CS8795]\n    public partial void M7();       // Compliant\n    public partial int M8();        // Error [CS8795]\n    public partial void M9(out string someParam);   // Error [CS8795]\n    public partial void M10();      // Compliant\n    public partial int M11();       // Compliant\n    public partial void M12(out string someParam);  // Compliant\n}\n\npublic partial record struct RecordStruct\n{\n    partial void Method();          //Noncompliant {{Supply an implementation for this partial method.}}\n    private partial void M2();      // Error [CS8795]\n    internal partial void M3();     // Error [CS8795]\n    public partial void M6();       // Error [CS8795]\n    public partial void M7();       // Compliant\n    public partial int M8();        // Error [CS8795]\n    public partial void M9(out string someParam);   // Error [CS8795]\n    public partial void M10();      // Compliant\n    public partial int M11();       // Compliant\n    public partial void M12(out string someParam);  // Compliant\n}\n\npublic partial record struct RecordStruct\n{\n    public partial void M7()\n    {\n\n    }\n\n    public partial void M10()\n    {\n\n    }\n\n    public partial int M11()\n    {\n        return 42;\n    }\n\n    public partial void M12(out string someParam)\n    {\n        someParam = \"\";\n    }\n}\n\npublic partial record struct RecordStruct3\n{\n    partial void Method();          //Noncompliant {{Supply an implementation for this partial method.}}\n    partial void Method2();\n    private partial void M2();      // Error [CS8795]\n    internal partial void M3();     // Error [CS8795]\n    public partial void M6();       // Error [CS8795]\n    public partial void M7();       // Compliant\n    public partial int M8();        // Error [CS8795]\n    public partial void M9(out string someParam);   // Error [CS8795]\n    public partial void M10();      // Compliant\n    public partial int M11();       // Compliant\n    public partial void M12(out string someParam);  // Compliant\n}\n\npublic partial class PartialConstructorHasImplementation\n{\n    public partial PartialConstructorHasImplementation();\n}\n\npublic partial class PartialConstructorNoImplementation\n{\n    public partial PartialConstructorNoImplementation(); // Error [CS9275] Partial member 'PartialConstructorNoImplementation.PartialConstructorNoImplementation()' must have an implementation part.\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PartialMethodNoImplementation.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Tests.Diagnostics\n{\n    public abstract partial class PartialMethodNoImplementation\n    {\n        partial void Method(); //Noncompliant {{Supply an implementation for this partial method.}}\n//      ^^^^^^^\n\n        void OtherM()\n        {\n            Method(); //Noncompliant {{Supply an implementation for the partial method, otherwise this call will be ignored.}}\n            OkMethod();\n            OkMethod2();\n            M();\n            ArrowMethod(\"\");\n        }\n\n        partial void OkMethod();\n        partial void OkMethod()\n        {\n            throw new NotImplementedException();\n        }\n\n        partial void OkMethod2()\n        {\n            throw new NotImplementedException();\n        }\n        partial void OkMethod2();\n\n        public abstract void M();\n\n        partial void ArrowMethod(string s);\n        partial void ArrowMethod(string s) => Console.WriteLine(s);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PasswordsShouldBeStoredCorrectly.Core.cs",
    "content": "﻿using System;\nusing System.Text;\nusing System.Security.Cryptography;\nusing Microsoft.AspNetCore.Cryptography.KeyDerivation;\nusing Microsoft.AspNetCore.Identity;\n\nclass Testcases\n{\n    const int ITERATIONS = 100_000;\n    const PasswordHasherCompatibilityMode MODE = PasswordHasherCompatibilityMode.IdentityV3;\n\n    void PasswordHasherOptions_IterationCount(int iterations)\n    {\n        var sut = new PasswordHasherOptions()\n        {\n            IterationCount = 100_000            // Compliant\n        };\n\n        sut = new PasswordHasherOptions()\n        {\n            IterationCount = 1                  // Noncompliant {{Use at least 100,000 iterations here.}}\n    //      ^^^^^^^^^^^^^^\n        };\n\n        sut.IterationCount = -1;                // Noncompliant {{Use at least 100,000 iterations here.}}\n    //  ^^^^^^^^^^^^^^^^^^\n        sut.IterationCount = 42;                // Noncompliant\n        sut.IterationCount = 100_000 - 1;       // Noncompliant\n        sut.IterationCount = ITERATIONS - 42;   // Noncompliant\n\n        sut.IterationCount = ITERATIONS;        // Compliant\n        sut.IterationCount = 100_000;           // Compliant\n        sut.IterationCount = 1_000_000;         // Compliant\n\n        if (iterations >= 100_000)\n        {\n            sut.IterationCount = iterations;    // Compliant\n        }\n        else\n        {\n            sut.IterationCount = iterations;    // Compliant FN\n        }\n\n        SetIterationCount(42);                  // Compliant FN\n\n        void SetIterationCount(int value)\n        {\n            sut.IterationCount = value;\n        }\n    }\n\n    void PasswordHasherOptions_CompatibilityMode(PasswordHasherCompatibilityMode mode)\n    {\n        var sut = new PasswordHasherOptions\n        {\n            CompatibilityMode = PasswordHasherCompatibilityMode.IdentityV3  // Compliant\n        };\n\n        sut = new PasswordHasherOptions()\n        {\n            CompatibilityMode = PasswordHasherCompatibilityMode.IdentityV2  // Noncompliant {{Identity v2 uses only 1000 iterations. Consider changing to identity V3.}}\n    //      ^^^^^^^^^^^^^^^^^\n        };\n\n        sut.CompatibilityMode = MODE;                                       // Compliant\n        sut.CompatibilityMode = (PasswordHasherCompatibilityMode)1;         // Compliant\n        sut.CompatibilityMode = PasswordHasherCompatibilityMode.IdentityV3; // Compliant\n\n        sut.CompatibilityMode = 0;                                          // Noncompliant {{Identity v2 uses only 1000 iterations. Consider changing to identity V3.}}\n    //  ^^^^^^^^^^^^^^^^^^^^^\n        sut.CompatibilityMode = (PasswordHasherCompatibilityMode)0;         // Noncompliant\n        sut.CompatibilityMode = PasswordHasherCompatibilityMode.IdentityV2; // Noncompliant\n\n        if (mode == PasswordHasherCompatibilityMode.IdentityV3)\n        {\n            sut.CompatibilityMode = mode;                                   // Compliant\n        }\n        else\n        {\n            sut.CompatibilityMode = mode;                                   // Compliant FN\n        }\n\n        SetCompatibility(PasswordHasherCompatibilityMode.IdentityV2);       // Compliant FN\n\n        void SetCompatibility(PasswordHasherCompatibilityMode value)\n        {\n            sut.CompatibilityMode = value;\n        }\n    }\n\n    void KeyDerivation_Pbkdf2(int iterations)\n    {\n        KeyDerivation.Pbkdf2(null, null, 0, 42, 0);                                 // Noncompliant {{Use at least 100,000 iterations here.}}\n        //                                  ^^\n        KeyDerivation.Pbkdf2(null, null, 0, iterationCount: 100_000 - 42, 0);       // Noncompliant\n        KeyDerivation.Pbkdf2(null, null, 0, iterationCount: ITERATIONS - 42, 0);    // Noncompliant\n\n        KeyDerivation.Pbkdf2(\n            iterationCount: 42,                                                     // Noncompliant {{Use at least 100,000 iterations here.}}\n        //  ^^^^^^^^^^^^^^^^^^\n            password: \"exploding\",\n            salt: Encoding.UTF8.GetBytes(\"whale\"),\n            numBytesRequested: 42,\n            prf: 0);\n\n        KeyDerivation.Pbkdf2(null, null, 0, 100_000, 0);                            // Compliant\n        KeyDerivation.Pbkdf2(null, null, 0, iterationCount: 100_000 - 42 + 43, 0);  // Compliant\n        KeyDerivation.Pbkdf2(null, null, 0, iterationCount: ITERATIONS, 0);         // Compliant\n        KeyDerivation.Pbkdf2(null, null, 0, iterationCount: iterations, 0);         // Compliant\n\n        KeyDerivation.Pbkdf2(\n            iterationCount: 100_000,                                                // Compliant\n            password: \"exploding\",\n            salt: Encoding.UTF8.GetBytes(\"whale\"),\n            numBytesRequested: 42,\n            prf: 0);\n    }\n\n    void Rfc2898DeriveBytes_Pbkdf2(int iterations, byte[] bs, HashAlgorithmName han, ReadOnlySpan<byte> ss, ReadOnlySpan<char> cs, Span<byte> dest)\n    {\n        Rfc2898DeriveBytes.Pbkdf2(bs, bs, 42, han, 42);                     // Noncompliant {{Use at least 100,000 iterations here.}}\n        Rfc2898DeriveBytes.Pbkdf2(\"\", bs, 42, han, 42);                     // Noncompliant\n        Rfc2898DeriveBytes.Pbkdf2(ss, ss, 42, han, 42);                     // Noncompliant\n        Rfc2898DeriveBytes.Pbkdf2(ss, ss, dest, 42, han);                   // Noncompliant\n        Rfc2898DeriveBytes.Pbkdf2(cs, ss, 42, han, 42);                     // Noncompliant\n        Rfc2898DeriveBytes.Pbkdf2(cs, ss, dest, 42, han);                   // Noncompliant\n    //                                          ^^\n\n        Rfc2898DeriveBytes.Pbkdf2(\n            iterations: 42,                                                 // Noncompliant\n       //   ^^^^^^^^^^^^^^\n            password: cs,\n            salt: ss,\n            hashAlgorithm: han,\n            outputLength: 0);\n\n        Rfc2898DeriveBytes.Pbkdf2(bs, bs, ITERATIONS, han, 42);             // Compliant\n        Rfc2898DeriveBytes.Pbkdf2(\"\", bs, ITERATIONS, han, 42);             // Compliant\n        Rfc2898DeriveBytes.Pbkdf2(ss, ss, ITERATIONS, han, 42);             // Compliant\n        Rfc2898DeriveBytes.Pbkdf2(ss, ss, dest, ITERATIONS, han);           // Compliant\n        Rfc2898DeriveBytes.Pbkdf2(cs, ss, ITERATIONS, han, 42);             // Compliant\n        Rfc2898DeriveBytes.Pbkdf2(cs, ss, dest, ITERATIONS, han);           // Compliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PointersShouldBePrivate.CSharp11.cs",
    "content": "﻿using System;\n\npublic unsafe class NativeInts\n{\n    protected IntPtr _intPtr; // Noncompliant\n    public UIntPtr _uIntPtr; // Noncompliant\n\n    protected nint _nint; // Compliant, FN, nint should be treated as a pointer type\n    public nuint _nuint; // Compliant, FN, nuint should be treated as a pointer type\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PointersShouldBePrivate.CSharp9.cs",
    "content": "﻿using System;\n\npublic unsafe record Record\n{\n    private IntPtr p1;\n    public UIntPtr p2; // Noncompliant\n    public RandomNameSpace.UIntPtr p3; // Error [CS0246]\n    public (int, string) p4;\n    public System.UIntPtr p5; // Noncompliant\n    public nint p6; // Compliant\n    public nuint p7; // Compliant\n}\n\npublic unsafe class Class\n{\n    private IntPtr p1;\n    protected int* p2; // Noncompliant\n    protected readonly IntPtr p3;\n    public IntPtr p4; // Noncompliant\n\n    private UIntPtr p5;\n    protected char* p6; // Noncompliant\n    protected readonly UIntPtr p7;\n    public UIntPtr p8; // Noncompliant\n\n    public delegate* <int, int> f1;\n    protected delegate* managed<int, int> f2;\n    protected readonly delegate* managed<int, int> f3;\n    private readonly delegate* managed<int, int> f4;\n    public delegate* unmanaged[Cdecl]<int, int> f5; // Noncompliant\n    protected delegate* unmanaged<int, int> f6; // Noncompliant\n    protected readonly delegate* unmanaged<int, int> f7;\n    private readonly delegate* unmanaged<int, int> f8;\n    protected delegate* unmanaged[Fastcall]<int, int> f9; // Noncompliant\n    public delegate* unmanaged<int, int> f10; // Noncompliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PointersShouldBePrivate.cs",
    "content": "﻿using System;\nusing PointerAlias = System.IntPtr;\n\nnamespace Tests.Diagnostics\n{\n    public class Program\n    {\n        public int publicOtherType;\n        private IntPtr privatePointer1;\n        private UIntPtr privatePointer2;\n        internal IntPtr internalPointer1;\n        internal UIntPtr internalPointer2;\n        public readonly IntPtr publicReadonlyPointer1;\n        protected readonly IntPtr protectedReadonlyPointer1;\n        protected readonly UIntPtr protectedReadonlyPointer2;\n        protected internal readonly IntPtr protectedInternalReadonlyPointer1;\n        protected internal readonly UIntPtr protectedInternalReadonlyPointer2;\n\n        public IntPtr publicPointer1; // Noncompliant {{Make 'publicPointer1' 'private' or 'protected readonly'.}}\n        public UIntPtr publicPointer2; // Noncompliant\n        protected IntPtr protectedPointer1; // Noncompliant\n        protected UIntPtr protectedPointer2; // Noncompliant\n        protected internal IntPtr protectedInternalPointer1; // Noncompliant\n        protected internal UIntPtr protectedInternalPointer2; // Noncompliant\n        protected internal PointerAlias protectedInternalAliasPointer; // FN\n\n        public IntPtr pointer1, // Noncompliant {{Make 'pointer1' 'private' or 'protected readonly'.}}\n            pointer2, // Noncompliant {{Make 'pointer2' 'private' or 'protected readonly'.}}\n            pointer3; // Noncompliant {{Make 'pointer3' 'private' or 'protected readonly'.}}\n\n        public class PublicInnerClass\n        {\n            public IntPtr publicPointer1; // Noncompliant\n        }\n\n        private class PrivateInnerClass\n        {\n            public IntPtr publicPointer1;\n        }\n\n        internal class InternalInnerClass\n        {\n            public IntPtr publicPointer1;\n        }\n    }\n\n    public unsafe class PointerTypes\n    {\n        private int* privatePointer1;\n        private char* privatePointer2;\n        internal byte* internalPointer1;\n        internal uint* internalPointer2;\n        public readonly long* publicReadonlyPointer1;\n        protected readonly byte* protectedReadonlyPointer1;\n        protected readonly int* protectedReadonlyPointer2;\n        protected internal readonly int* protectedInternalReadonlyPointer1;\n        protected internal readonly int* protectedInternalReadonlyPointer2;\n\n        public int* publicPointer1; // Noncompliant {{Make 'publicPointer1' 'private' or 'protected readonly'.}}\n        public char* publicPointer2; // Noncompliant\n        protected byte* protectedPointer1; // Noncompliant\n        protected long* protectedPointer2; // Noncompliant\n        protected internal uint* protectedInternalPointer1; // Noncompliant\n        protected internal SomeStruct* protectedInternalPointer2; // Noncompliant\n\n        public int* pointer1, // Noncompliant {{Make 'pointer1' 'private' or 'protected readonly'.}}\n            pointer2, // Noncompliant {{Make 'pointer2' 'private' or 'protected readonly'.}}\n            pointer3; // Noncompliant {{Make 'pointer3' 'private' or 'protected readonly'.}}\n\n        public class PublicInnerClass\n        {\n            public int* publicPointer1; // Noncompliant\n        }\n\n        private class PrivateInnerClass\n        {\n            public int* publicPointer1;\n        }\n\n        internal class InternalInnerClass\n        {\n            public int* publicPointer1;\n        }\n\n        public struct SomeStruct\n        {\n            int value;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PreferGuidEmpty.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nclass Compliant\n{\n    Guid? nullableField; // Compliant\n    readonly Guid? readonlyNullableField; // Compliant\n    Guid Property { get; set; } // Compliant\n\n    void Empty()\n    {\n        var empty = Guid.Empty; // Compliant\n    }\n\n    void NotEmpty()\n    {\n        var rnd = Guid.NewGuid();// Compliant\n        var bytes = new Guid(new byte[0]); // Compliant\n        var str = new Guid(\"FA97FFE7-532C-4015-8698-49D8CE4126F4\"); // Compliant\n    }\n\n    void NullableDefault()\n    {\n        Guid? nullable = default; // Compliant, not equivalent to Guid.Empty.\n        var nullableOfT = default(Guid?); // Compliant\n        var guidAsParameter = new NullableGuidClass(default); // Compliant\n        guidAsParameter.Method(default); // Compliant\n    }\n\n    void NotInitialized(string str)\n    {\n        Guid parsed; // Compliant\n        Guid.TryParse(str, out parsed);\n    }\n\n    void OptionalParameter(Guid id = default) { } // Compliant, default has to be a run-time constant\n\n    void NotGuid()\n    {\n        int integer = default;\n        var date = default(DateTime);\n    }\n\n    Dictionary<string, string> DoesNotCrashOnDictionaryCreation()\n    {\n        return new Dictionary<string, string>\n        {\n            [\"a\"] = \"b\"\n        };\n    }\n}\n\nclass NonCompliant\n{\n    Guid field;\n    readonly Guid readonlyField;\n    Guid Property { get; set; }\n\n    void DefaultCtor()\n    {\n        var ctor = Guid.Empty; // Fixed\n    }\n\n    void DefaultInitialization()\n    {\n        Guid defaultValue = Guid.Empty; // Fixed\n        var defaultOfGuid = Guid.Empty; // Fixed\n        Property = Guid.Empty; // Fixed\n        var guidAsParameter = new GuidClass(Guid.Empty); // Fixed\n        guidAsParameter.Method(Guid.Empty); // Fixed\n        field = Guid.Empty; // Fixed\n    }\n\n    void EmptyString()\n    {\n        var emptyCtor = Guid.Empty; // Fixed\n        var emptyParse = Guid.Parse(\"00000000-0000-0000-0000-000000000000\"); // FN\n    }\n}\n\nstruct GuidAssignmentStruct\n{\n    static readonly Guid Static;\n    Guid Field; // Compliant, structs do not allow assigned instance values\n    readonly Guid ReadOnly; // Compliant, structs do not allow assigned instance values\n}\nclass GuidClass\n{\n    public GuidClass(Guid param) { }\n    public void Method(Guid param) { }\n}\nclass NullableGuidClass\n{\n    public NullableGuidClass(Guid? param) { }\n    public void Method(Guid? param) { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PreferGuidEmpty.Latest.cs",
    "content": "﻿using System;\nusing System.Text;\n\nnamespace Tests.Diagnostics\n{\n    public class Program\n    {\n        public static readonly Guid Global = new(\"54972F01-2A74-4D09-AA7C-359E9C5A5B5A\"); // Compliant\n\n        public void Foo()\n        {\n            Guid g1 = new(); // Noncompliant\n\n            g1 = default; // Noncompliant\n//               ^^^^^^^\n\n            StringBuilder st = new(); // Checking that the rules raises issue only for the Guid class.\n            string test = default;\n        }\n\n        public Guid Get() => default; // Noncompliant\n\n        // See: https://github.com/SonarSource/sonar-dotnet/issues/5245\n        private void Test(Guid guid = default) // Compliant\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PreferGuidEmpty.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nclass Compliant\n{\n    Guid? nullableField; // Compliant\n    readonly Guid? readonlyNullableField; // Compliant\n    Guid Property { get; set; } // Compliant\n\n    void Empty()\n    {\n        var empty = Guid.Empty; // Compliant\n    }\n\n    void NotEmpty()\n    {\n        var rnd = Guid.NewGuid();// Compliant\n        var bytes = new Guid(new byte[0]); // Compliant\n        var str = new Guid(\"FA97FFE7-532C-4015-8698-49D8CE4126F4\"); // Compliant\n    }\n\n    void NullableDefault()\n    {\n        Guid? nullable = default; // Compliant, not equivalent to Guid.Empty.\n        var nullableOfT = default(Guid?); // Compliant\n        var guidAsParameter = new NullableGuidClass(default); // Compliant\n        guidAsParameter.Method(default); // Compliant\n    }\n\n    void NotInitialized(string str)\n    {\n        Guid parsed; // Compliant\n        Guid.TryParse(str, out parsed);\n    }\n\n    void OptionalParameter(Guid id = default) { } // Compliant, default has to be a run-time constant\n\n    void NotGuid()\n    {\n        int integer = default;\n        var date = default(DateTime);\n    }\n\n    Dictionary<string, string> DoesNotCrashOnDictionaryCreation()\n    {\n        return new Dictionary<string, string>\n        {\n            [\"a\"] = \"b\"\n        };\n    }\n}\n\nclass NonCompliant\n{\n    Guid field;\n    readonly Guid readonlyField;\n    Guid Property { get; set; }\n\n    void DefaultCtor()\n    {\n        var ctor = new Guid(); // Noncompliant {{Use 'Guid.NewGuid()' or 'Guid.Empty' or add arguments to this GUID instantiation.}}\n        //         ^^^^^^^^^^\n    }\n\n    void DefaultInitialization()\n    {\n        Guid defaultValue = default; // Noncompliant\n        var defaultOfGuid = default(Guid); // Noncompliant\n        Property = default; // Noncompliant\n        var guidAsParameter = new GuidClass(default); // Noncompliant\n        guidAsParameter.Method(default); // Noncompliant\n        field = default; // Noncompliant\n    }\n\n    void EmptyString()\n    {\n        var emptyCtor = new Guid(\"00000000-0000-0000-0000-000000000000\"); // Noncompliant\n        var emptyParse = Guid.Parse(\"00000000-0000-0000-0000-000000000000\"); // FN\n    }\n}\n\nstruct GuidAssignmentStruct\n{\n    static readonly Guid Static;\n    Guid Field; // Compliant, structs do not allow assigned instance values\n    readonly Guid ReadOnly; // Compliant, structs do not allow assigned instance values\n}\nclass GuidClass\n{\n    public GuidClass(Guid param) { }\n    public void Method(Guid param) { }\n}\nclass NullableGuidClass\n{\n    public NullableGuidClass(Guid? param) { }\n    public void Method(Guid? param) { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PreferGuidEmpty.vb",
    "content": "﻿Imports System.Collections.Generic\n\nClass Compliant\n\n    Private NullableField As Guid? ' Compliant\n    Private ReadOnly ReadonlyNullableField As Guid? ' Compliant\n    Property Prop As Guid ' Compliant\n\n    Sub Empty()\n        Dim empty As Guid = Guid.Empty ' Compliant\n    End Sub\n\n    Sub NotEmpty()\n        Dim rnd As Guid = Guid.NewGuid() ' Compliant\n        Dim bytes As Guid = New Guid({0, 3, 4}) ' Compliant\n        Dim str As Guid = New Guid(\"FA97FFE7-532C-4015-8698-49D8CE4126F4\") ' Compliant\n    End Sub\n\n    Sub NullableDefault()\n        Dim nullable As Guid? = Nothing ' Compliant, not equivalent to Guid.Empty.\n        Dim guidAsParameter As New NullableGuidClass(Nothing) ' Compliant\n        guidAsParameter.Method(Nothing) ' Compliant\n    End Sub\n\n    Sub NotInitialized(str As String)\n        Dim parsed As Guid ' Compliant\n        Guid.TryParse(str, parsed)\n    End Sub\n\n    Sub OptionalParameter(Optional guid As Guid = Nothing) ' Compliant, default has to be a run-time constant\n    End Sub\n\n    Sub NotGuid()\n        Dim int As Integer = Nothing ' Compliant\n        Dim dat As Date = Nothing ' Compliant\n    End Sub\n\n    Function DoesNotCrashOnDictionaryCreation() As Dictionary(Of String, String)\n        Return New Dictionary(Of String, String) From {{\"a\", \"b\"}, {\"c\", \"d\"}}\n    End Function\n\nEnd Class\n\nClass NonCompliant\n\n    Private Field As Guid\n    Private ReadOnly ReadonlyField As Guid\n    Property Prop As Guid\n\n    Sub DefaultCtor()\n        Dim ctor As Guid = New Guid() ' Noncompliant {{Use 'Guid.NewGuid()' or 'Guid.Empty' or add arguments to this GUID instantiation.}}\n        '                  ^^^^^^^^^^\n        Dim asignend As New Guid() ' Noncompliant\n    End Sub\n\n    Sub DefaultInitialization()\n        Dim defaultValue As Guid = Nothing ' Noncompliant\n        Dim unasignend As Guid ' FN\n        Dim guidAsParameter As New GuidClass(Nothing) ' Noncompliant\n        guidAsParameter.Method(Nothing) ' Noncompliant\n        Prop = Nothing ' Noncompliant\n        Field = Nothing ' Noncompliant\n    End Sub\n\n    Sub EmptyString()\n        Dim ctor1 As Guid = New Guid(\"00000000-0000-0000-0000-000000000000\") ' Noncompliant\n        Dim ctor2 As New Guid(\"00000000-0000-0000-0000-000000000000\") ' Noncompliant\n        Dim parse As Guid = Guid.Parse(\"00000000-0000-0000-0000-000000000000\") ' FN\n    End Sub\n\nEnd Class\n\nStructure GuidAssignmentStruct\n\n    Private Shared ReadOnly StaticField As Guid\n    Private Field As Guid                   ' Compliant, structs do not allow assigned instance values\n    Private ReadOnly ReadOnlyField As Guid  ' Compliant, structs do not allow assigned instance values\n\nEnd Structure\n\nClass GuidClass\n\n    Public Sub New(param As Guid)\n    End Sub\n\n    Public Sub Method(param As Guid)\n    End Sub\n\nEnd Class\n\nClass NullableGuidClass\n\n    Public Sub New(param As Guid?)\n    End Sub\n\n    Public Sub Method(param As Guid?)\n    End Sub\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PreferJaggedArraysOverMultidimensional.Latest.cs",
    "content": "﻿partial class PartialProperties\n{\n    public partial int[,] MultiDimArrayProperty { get; }            // Noncompliant\n    public partial int[,] this[int index] { get; }                  // Noncompliant\n}\n\npartial class PartialProperties\n{\n    public partial int[,] MultiDimArrayProperty { get => null; }    // Noncompliant\n    public partial int[,] this[int index] { get => null; }          // Noncompliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PreferJaggedArraysOverMultidimensional.cs",
    "content": "﻿namespace Tests.Diagnostics\n{\n    class Program\n    {\n        private int[,] multiDimArrayField = // Noncompliant {{Change this multidimensional array to a jagged array.}}\n//                     ^^^^^^^^^^^^^^^^^^\n            {\n                {1,2,3,4},\n                {5,6,7,0},\n                {8,0,0,0},\n                {9,0,0,0}\n            };\n\n        private int[][] jaggedArrayField = // Compliant\n            {\n                new int[] {1,2,3,4},\n                new int[] {5,6,7},\n                new int[] {8},\n                new int[] {9}\n            };\n\n        public Program(string[,] array) // Noncompliant\n        { }\n\n        public float[,] Foo() // Noncompliant\n        {\n            return null;\n        }\n\n        public void Bar(string[,] multiDimArrayParameter) // Noncompliant\n        {\n        }\n\n        public void FooBar()\n        {\n            string[,] multiDimArrayVar; // Noncompliant\n            string[][] jaggedArrayVar;\n        }\n\n        public int[,] MultiDimArrayProperty { get; set; } // Noncompliant\n\n        public int Prop\n        {\n            get\n            {\n                string[,] multiDimArrayPropVar; // Noncompliant\n                return 0;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PrivateConstantFieldName.vb",
    "content": "﻿Class Foo\n    Private Const Foo = 10  ' Noncompliant\n'                 ^^^\n\n    Private ReadOnly foo2 As Integer\n    Private ReadOnly s_fooFooFFFoooFF\n    Private ReadOnly sfooFooFFFoooFF\n    Private ReadOnly sFooFooFFFooooFF\n    Private Const _fooFooFFFoooFF = 10, __fooFooFFFoooFF = 42  ' Noncompliant\n'                                       ^^^^^^^^^^^^^^^^\n\n    Private Const _fooFooFFFFoooFF As Integer = 1 ' Noncompliant\n    Private Const _fooFooFFFoooF As Integer = 2 ' Noncompliant\n    Private Shared ReadOnly _fooFooFFFoooFFF As Integer\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PrivateFieldName.vb",
    "content": "﻿Class Foo\n    Private ReadOnly Foo As Integer  ' Noncompliant\n'                    ^^^\n\n    Private ReadOnly foo2 As Integer\n    Private ReadOnly s_fooFooFFFoooFF\n    Private ReadOnly sfooFooFFFoooFF\n    Private ReadOnly sFooFooFFFooooFF\n    Private ReadOnly _fooFooFFFoooFF, __fooFooFFFoooFF As Integer ' Noncompliant\n'                                     ^^^^^^^^^^^^^^^^\n\n    Private Shared _fooFooFFFFoooFF As Integer ' Noncompliant\n    Private Shared _fooFooFFFoooF As Integer ' Noncompliant\n    Private Const _fooFooFFFoooFFF As Integer = 1\n    Private Shared ReadOnly _fooFooFFFFoooFFF As Integer\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PrivateFieldUsedAsLocalVariable.Latest.cs",
    "content": "﻿record Record\n{\n    private int privateUnused = 0; // Compliant - unused\n    private int privateUsed = 0; // Noncompliant\n    private protected int privateProtected = 0; // Compliant\n    internal int @internal = 0; // Compliant\n    protected internal int protectedInternal = 0; // Compliant\n    protected int @protected = 0; // Compliant\n    public int @public = 0; // Compliant - Public\n    private int usedInWith = 0; // Noncompliant\n\n    void Foo()\n    {\n        ((privateUsed)) = 42;\n        privateProtected = 42;\n        @internal = 42;\n        protectedInternal = 42;\n        @protected = 42;\n        @public = 42;\n        Bar(privateUsed);\n        var zero = new Record();\n        usedInWith = 4;\n        var answer = zero with { @public = usedInWith };\n    }\n\n    void Bar(int i) { }\n\n    private int fieldInPropertyCompliant = 0;\n    public int P1 { get { return fieldInPropertyCompliant; } }\n\n    private int fieldInPropertyNoncompliant = 0; // Noncompliant\n    public int P2 { get { fieldInPropertyNoncompliant = 42; return fieldInPropertyNoncompliant; } }\n\n    private int fieldInPropertyWithInitCompliant = 0;\n    public int P3\n    {\n        get { return fieldInPropertyWithInitCompliant; }\n        init { fieldInPropertyWithInitCompliant = value; }\n    }\n\n    public record PositionalRecord(string Input)\n    {\n        private string inputField = Input; // Noncompliant\n        public string Output { get { inputField = \"2021\"; return inputField + \" year\"; } }\n    }\n}\n\nrecord struct RecordStruct\n{\n    public RecordStruct() { }\n\n    private int privateUnused = 0; // Compliant - unused\n    private int privateUsed = 0;   // Noncompliant {{Remove the field 'privateUsed' and declare it as a local variable in the relevant methods.}}\n    //          ^^^^^^^^^^^^^^^\n    internal int @internal = 0;    // Compliant\n    public int @public = 0;        // Compliant - Public\n    private int usedInWith = 0;    // Noncompliant\n\n    void Foo()\n    {\n        ((privateUsed)) = 42;\n        @internal = 42;\n        @public = 42;\n        Bar(privateUsed);\n        var zero = new RecordStruct();\n        usedInWith = 4;\n        var answer = zero with { @public = usedInWith };\n    }\n\n    void Bar(int i) { }\n\n    private int fieldInPropertyCompliant = 0;\n    public int P1 { get { return fieldInPropertyCompliant; } }\n\n    private int fieldInPropertyNoncompliant = 0; // Noncompliant\n    public int P2 { get { fieldInPropertyNoncompliant = 42; return fieldInPropertyNoncompliant; } }\n\n    private int fieldInPropertyWithInitCompliant = 0;\n    public int P3\n    {\n        get { return fieldInPropertyWithInitCompliant; }\n        init { fieldInPropertyWithInitCompliant = value; }\n    }\n\n    public record struct PositionalRecordStruct(string Input)\n    {\n        private string inputField = Input; // Noncompliant\n        public string Output { get { inputField = \"2021\"; return inputField + \" year\"; } }\n    }\n}\n\npublic class NullConditionalAssignment\n{\n    public class Sample\n    {\n        public int Value { get; set; }\n    }\n    private Sample compliantConditionalAssignment;\n    private Sample compliant;\n\n    void Test()\n    {\n        compliantConditionalAssignment?.Value = 42;\n        if(compliant is null)\n        {\n            compliant = new Sample();\n        }\n        compliant.Value = 42;\n\n        useSample(compliant);\n        useSample(compliantConditionalAssignment);\n    }\n    void useSample(Sample sample) { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PrivateFieldUsedAsLocalVariable.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    class PrivateFieldUsedAsLocalVariable\n    {\n        private int F0 = 0; // Compliant - unused\n\n        private int F1 = 0; // Noncompliant {{Remove the field 'F1' and declare it as a local variable in the relevant methods.}}\n//                  ^^^^^^\n        public int F2 = 0; // Compliant - Public\n\n        void Use(int foo) { }\n\n        void M1()\n        {\n            ((F1)) = 42;\n            Use(F1);\n            F2 = 42;\n        }\n\n        private int F3 = 1; // Compliant - Referenced from another field initializer\n        public int F4 = F3; // Compliant - Public // Error [CS0236]\n\n        private int F5 = 0; // Noncompliant\n        private int F6; // Noncompliant\n\n        void M2()\n        {\n            F5 = 42;\n            Use(F5);\n            F6 = 42;\n            Use(F6);\n        }\n\n        private int F7 = 0; // Compliant - Read before write\n        void M3()\n        {\n            Console.WriteLine(F7);\n            F7 = 42;\n        }\n\n        private int F8 = 0; // Compliant, False Negative, we cannot detect if a field is both updated and read in the same statement\n        private int F9 = 0; // Compliant, False Negative, we cannot detect if statements that set the field in both branches\n        private int F10 = 0; // Compliant - not assigned from every path\n        void M4(bool p1)\n        {\n            for (F8 = 0; F8 < 42; F8++)\n            { }\n\n            if (p1)\n            {\n                F9 = 0;\n                F10 = 0;\n            }\n            else\n            {\n                F9 = 1;\n            }\n            Console.WriteLine(F9);\n            Console.WriteLine(F10);\n        }\n\n        private int F11 = 0; // Compliant - first read through 'this.'\n        private int F12 = 0; // Noncompliant\n        void M5()\n        {\n            Console.WriteLine(this.F11);\n            F11 = 42;\n\n            this.F12 = 42;\n            Console.WriteLine(F12);\n        }\n\n        private int F13 = 0; // Compliant - parameter of same name is assigned, not the field\n        private int F14 = 0; // Noncompliant\n        void M6(int F13, int F14)\n        {\n            F13 = 42;\n            this.F14 = 42;\n            Use(this.F14);\n        }\n\n        private int F15 = 0; // Compliant - returned in property getter\n        private int F16 = 0; // Noncompliant, property is assigning first\n        public int P1 { get { return F15; } }\n        public int P2 { get { F16 = 42; return F16; } }\n\n        private static int F17 = 0; // Compliant\n        private int F18 = 0; // Compliant\n        public int P3 { get; set; } = F17;\n        public int M7() => F18;\n        void M8()\n        {\n            F17 = 42;\n            F18 = 42;\n        }\n\n        private int F19 = 42; // Compliant - accessed through instance\n        private int F20 = 42; // Compliant - accessed through instance\n        private int F21 = 42; // Compliant - accessed through instance\n        private static int F22 = 42; // Noncompliant, overwritten static instance\n        private int F23 = 42;\n        void M9(PrivateFieldUsedAsLocalVariable inst)\n        {\n            F19 = inst.F19;\n\n            if (inst.F20 == 42)\n            {\n                Console.WriteLine();\n            }\n\n            F20 = 0;\n\n            inst.F21 = 42;\n            if (F21 == 42)\n            {\n                Console.WriteLine();\n            }\n\n            PrivateFieldUsedAsLocalVariable.F22 = 42;\n            Console.WriteLine(F22);\n\n            this.F21 = this?.F23 ?? 42;\n        }\n\n        private int F24 = 42; // Noncompliant - passed as 'out'\n        private int F25 = 42; // Compliant - passed as 'ref'\n        void M10()\n        {\n            M11(out F24, ref F25);\n            Use(F24);\n            Use(F25);\n        }\n\n        void M11(out int a, ref int b)\n        {\n            a = 42;\n            b = 42;\n        }\n\n        private int F26 = 42; // Noncompliant - always assigned from constructor\n        private int F27 = 42; // Compliant - passed to another constructor\n        PrivateFieldUsedAsLocalVariable() : this(F27) // Error [CS0120]\n        {\n            F26 = 42;\n            Use(F26);\n        }\n\n        PrivateFieldUsedAsLocalVariable(int a)\n        {\n        }\n\n        private int F28 = 42; // Noncompliant - always assigned from event\n        private int F29 = 42; // Compliant\n        event EventHandler E1\n        {\n            add\n            {\n                F28 = 42;\n                F29 = 42;\n                Use(F28); // use after assignment in event\n            }\n            remove\n            {\n                Console.WriteLine(F29);\n            }\n        }\n\n        private int F30 = 42; // Noncompliant - always assigned\n        private int F31 = 42; // Compliant - read in a different method\n        void M12()\n        {\n            F30 = 42;\n            Use(F30);\n            F31 = 40;\n        }\n\n        private string F32 = \"\"; // Noncompliant\n        void M13()\n        {\n            this.F32 = 42.ToString();\n            Console.WriteLine(this.F32);\n\n            Console.WriteLine(this.F31);\n        }\n\n        private static string F33 = \"\"; // Noncompliant\n        ~PrivateFieldUsedAsLocalVariable()\n        {\n            F33 = \"foo\";\n            Console.WriteLine(F33);\n        }\n\n        private string F34 = \"\"; // Compliant\n        public static PrivateFieldUsedAsLocalVariable operator +(PrivateFieldUsedAsLocalVariable c1, PrivateFieldUsedAsLocalVariable c2)\n        {\n            PrivateFieldUsedAsLocalVariable.F33 = \"foo\";\n            c1.F34 = \"foo\";\n            return null;\n        }\n\n        [Obsolete]\n        private string F35 = \"\"; // Compliant, even though it is overwritten, the field has attribute and is not reported\n        void M14()\n        {\n            this.F35 = \"foo\";\n        }\n\n        private int F36; // Should be raised by S4487\n        public void M15(int i) => F36 = i + 1;\n\n        private string F37; // Compliant\n        protected string SomeString\n        {\n            get { return F37 ?? (F37 = \"5\"); }\n        }\n\n        private int InvocationWithSideEffect = 0;\n        private int PropertyWithSideEffect = 0; // Noncompliant FP\n\n        public int SetValueInProperty { set { PropertyWithSideEffect = 42; } }\n\n        void MethodWithSideEffect()\n        {\n            InvocationWithSideEffect = 42;\n        }\n\n        void M16()\n        {\n            InvocationWithSideEffect = 5;\n            MethodWithSideEffect();\n            Use(InvocationWithSideEffect);\n        }\n\n        void M17()\n        {\n            PropertyWithSideEffect = 5;\n            SetValueInProperty = 42;\n            Use(PropertyWithSideEffect);\n        }\n\n        private int F38 = 21; // Compliant - unread\n\n        void M18()\n        {\n            F38 = 42;\n        }\n\n        struct SomeStruct\n        {\n            public int Field;\n        }\n\n        private SomeStruct F39; // Noncompliant\n        private SomeStruct? F40 = null; // Noncompliant\n\n        void M19()\n        {\n            F39 = new SomeStruct() { Field = 42 };\n            F39.Field = 42;\n        }\n\n        void M20()\n        {\n            F40 = new SomeStruct() { Field = 42 };\n            if (F40 != null)\n            {\n                Console.WriteLine(F40?.Field);\n            }\n        }\n    }\n\n    public partial class SomePartialClass\n    {\n        private int F0 = 0; // Compliant - partial classes are not checked\n\n        void M1()\n        {\n            F0 = 0;\n            Console.WriteLine(F0);\n        }\n    }\n\n    public struct SomeStruct\n    {\n        private int F0; // Noncompliant\n\n        void M1()\n        {\n            F0 = 0;\n            Console.WriteLine(F0);\n        }\n    }\n\n    public class AccessInExpressionBodiedConstructs\n    {\n        private string F0;\n        public string M0 => F0 ?? (F0 = \"test\");\n        private string F1;\n        public string M1() => F1 ?? (F1 = \"test\");\n        private string F2;\n        public string M2\n        {\n            get => F2 ?? (F2 = \"test\");\n            set => F2 = \"value\";\n        }\n        private string F3;\n        AccessInExpressionBodiedConstructs()\n        {\n            F3 = F3 ?? \"test\";\n        }\n        private string F4;\n        ~AccessInExpressionBodiedConstructs()\n        {\n            F4 = F4 ?? \"test\";\n        }\n        private string F5;\n        public string this[int i]\n        {\n            get => \"value\";\n            set => F5 = F5 ?? \"test\";\n        }\n    }\n\n    public struct CompoundAssignmentReadAsWellAsWrite\n    {\n        private int F0;\n        void M1()\n        {\n            F0 += 1;\n            Console.WriteLine(F0);\n        }\n    }\n\n    // Repro https://github.com/SonarSource/sonar-dotnet/issues/9672\n    public class MethodUpdateTest\n    {\n        private int value = 0; // Noncompliant FP\n\n        private void Reset() => value = 0;\n\n        public void TestMethod()\n        {\n            value = 20;\n\n            while (value != 0)\n            {\n                Reset();\n            }\n        }\n    }\n\n    // As S4487 will raise when a private field is written and not read, S1450 won't raise on these cases\n    // These tests where finding issues before with S1450 and should find them with S4487 now\n    public class TestsForS4487Harmony\n    {\n        private int F1 = 0; // compliant\n\n        public void M1()\n        {\n            ((F1)) = 42;\n        }\n\n        private int F5 = 0; // compliant\n        private int F6; // compliant\n        public void M2()\n        {\n            F5 = 42;\n            F6 = 42;\n        }\n\n        private int F14 = 0; // compliant\n        public void M6(int F14)\n        {\n            this.F14 = 42;\n        }\n        private int F28 = 42; // compliant\n        public event EventHandler E1\n        {\n            add\n            {\n                F28 = 42;\n            }\n            remove\n            {\n            }\n        }\n\n        private int F36; // compliant\n        public void M15(int i) => F36 = i + 1;\n    }\n\n    public class Broker\n    {\n        public event EventHandler Receive;\n        public void Process() { Receive?.Invoke(this, EventArgs.Empty); }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/8239\n    public class Repro_8239\n    {\n        private bool _received; // Noncompliant\n\n        public void Program(Broker broker)\n        {\n            broker.Receive += Broker_Receive; // Broker_Receive should be treated as \"public\" as it is passed as a delegate\n            _received = false; // This is not compliant because this line is after registering the event\n            broker.Process();\n\n            if (_received)\n            {\n                Console.WriteLine(\"OK\");\n            }\n        }\n\n        private void Broker_Receive(object sender, EventArgs e)\n        {\n            _received = true;\n        }\n    }\n\n    public class Repro_8239_Compliant\n    {\n        private bool _received;\n\n        public void Program(Broker broker)\n        {\n            _received = false;\n            broker.Receive += Broker_Receive;\n            broker.Process();\n\n            if (_received)\n            {\n                Console.WriteLine(\"OK\");\n            }\n        }\n\n        private void Broker_Receive(object sender, EventArgs e)\n        {\n            _received = true;\n        }\n    }\n\n    public class Repo_8239_Variation\n    {\n        private bool _wasCalled;\n\n        public void Program()\n        {\n            var list = new List<int>();\n            _wasCalled = false;\n\n            list.ForEach(Increment);            // Increment is passed as a delegate `new Action<int>(Increment)` and should be treated as \"public\"\n\n            if (_wasCalled)\n            {\n                Console.WriteLine(\"OK\");\n            }\n        }\n\n        private void Increment(int dummy)\n            => _wasCalled = true;\n    }\n\n    public class Repo_8239_Variation_Noncompliant\n    {\n        private bool _wasCalled; // Noncompliant\n\n        public void Program()\n        {\n            var list = new List<int>();\n            list.ForEach(x => Increment(x));\n            _wasCalled = false;\n\n            if (_wasCalled)\n            {\n                Console.WriteLine(\"OK\");\n            }\n        }\n\n        private void Increment(int dummy) =>\n            _wasCalled = true;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PrivateSharedReadonlyFieldName.vb",
    "content": "﻿Class Foo\n    Private Shared ReadOnly Foo As Integer  ' Noncompliant\n'                           ^^^\n\n    Private Shared ReadOnly foo2 As Integer\n    Private Shared ReadOnly s_fooFooFFFoooFF\n    Private Shared ReadOnly sfooFooFFFoooFF\n    Private Shared ReadOnly sFooFooFFFooooFF\n    Private Shared ReadOnly _fooFooFFFoooFF, __fooFooFFFoooFF As Integer ' Noncompliant\n'                                            ^^^^^^^^^^^^^^^^\n\n    Private Shared ReadOnly _fooFooFFFFoooFF As Integer ' Noncompliant\n    Private Shared ReadOnly _fooFooFFFoooF As Integer ' Noncompliant\n\nEnd Class"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PrivateStaticMethodUsedOnlyByNestedClass.CSharpLatest.cs",
    "content": "﻿namespace CSharp8\n{\n    class OuterClass\n    {\n        static void OnlyUsedByNestedInterface() { }                 // Noncompliant\n        private protected static void PrivateProtectedMethod() { }  // Compliant - method is not private\n\n        interface INestedInterface\n        {\n            void Foo()\n            {\n                OnlyUsedByNestedInterface();\n                PrivateProtectedMethod();\n            }\n        }\n    }\n\n    interface IOuterInterface\n    {\n        static void OnlyUsedByNestedClass() { }                     // Noncompliant\n\n        class NestedClass\n        {\n            void Foo()\n            {\n                OnlyUsedByNestedClass();\n            }\n        }\n    }\n}\n\nnamespace CSharp9\n{\n    record OuterRecord\n    {\n        static void UsedOnlyByNestedClass() { }  // Noncompliant\n        static void UsedOnlyByNestedRecord() { } // Noncompliant\n\n        class NestedClass\n        {\n            void Foo()\n            {\n                UsedOnlyByNestedClass();\n            }\n        }\n\n        record NestedRecord\n        {\n            void Foo()\n            {\n                UsedOnlyByNestedRecord();\n            }\n        }\n    }\n}\n\nnamespace CSharp10\n{\n    record class OuterRecordClass\n    {\n        static void UsedOnlyByNestedClass() { }  // Noncompliant\n        static void UsedOnlyByNestedRecord() { } // Noncompliant\n\n        class NestedClass\n        {\n            void Foo()\n            {\n                UsedOnlyByNestedClass();\n            }\n        }\n\n        record class NestedRecord\n        {\n            void Foo()\n            {\n                UsedOnlyByNestedRecord();\n            }\n        }\n    }\n\n    record struct OuterRecordStruct\n    {\n        private static void UsedOnlyByNestedClass() { }  // Noncompliant\n        private static void UsedOnlyByNestedRecord() { } // Noncompliant\n\n        class NestedClass\n        {\n            void Foo()\n            {\n                UsedOnlyByNestedClass();\n            }\n        }\n\n        record struct NestedRecord\n        {\n            void Foo()\n            {\n                UsedOnlyByNestedRecord();\n            }\n        }\n    }\n}\n\nnamespace CSharp14\n{\n    public static class ExtensionMethods\n    {\n        extension(ExtensionMethods)\n        {\n            public static void Compliant()\n            {\n                ThisIsCompliant();\n            }\n        }\n        private static void ThisIsCompliant() { } // Compliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PrivateStaticMethodUsedOnlyByNestedClass.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.Runtime.InteropServices;\n\nclass OuterClass\n{\n    static void OnlyUsedOnceByNestedClass() { }                     // Noncompliant {{Move this method inside 'NestedClass'.}}\n    //          ^^^^^^^^^^^^^^^^^^^^^^^^^\n    static void OnlyUsedByNestedClassMultipleTimes() { }            // Noncompliant\n    static void OnlyUsedByNestedClassWithClassName() { }            // Noncompliant\n    static void UsedByMultipleSiblingNestedClasses() { }            // Compliant - it needs to stay in the outer class\n    static void UsedByOuterAndNestedClasses() { }                   // Compliant - it's used by the outer class, so it needs to stay there\n    static void UsedBySiblingAndDeeperNestedClasses() { }           // Compliant - SiblingNestedClass and DeeperNestedClass both need access to the method, so it must stay in the outer class\n    static void OnlyUsedByDeeperNestedClass() { }                   // Noncompliant {{Move this method inside 'DeeperNestedClass'.}}\n    static void UsedByNestedClassAndDeeperNestedClass() { }         // Noncompliant {{Move this method inside 'NestedClass'.}}\n    static void UsedByDeeperNestedClassesOnTheSameLevel() { }       // Noncompliant {{Move this method inside 'NestedClass'.}}\n    static void UnusedMethod() { }                                  // Compliant - no need to move unused method anywhere\n\n    void NotStatic() { }                                            // Compliant - method is not static\n    static int _outerField;                                         // Compliant - not a method\n    static int OuterProp { get; set; }                              // Compliant - not a method\n\n    public static void PublicMethod() { }                           // Compliant - method is not private\n    protected static void ProtectedMethod() { }                     // Compliant - method is not private\n    internal static void InternalMethod() { }                       // Compliant - method is not private\n    protected internal static void ProtectedInternalMethod() { }    // Compliant - method is not private\n    private static void PrivateMethod() { }                         // Noncompliant\n    private static void PrivateMethod(int arg) { }                  // Compliant - overloaded version of the previous method, not used anywhere\n\n    static T GenericMethod<T>(T arg) => arg;                        // Noncompliant\n    //       ^^^^^^^^^^^^^\n\n    static int Recursive(int n) => Recursive(n - 1);                // Noncompliant\n    static void MutuallyRecursive1() => MutuallyRecursive2();       // FN - both methods could be moved inisde the nested class\n    static void MutuallyRecursive2() => MutuallyRecursive1();\n\n    [DllImport(\"SomeLibrary.dll\")]\n    private static extern void ExternalMethod();                    // Noncompliant\n\n    static int UsedOnlyByPropertyInNestedClass() => 42;             // Noncompliant\n    static int UsedOnlyByFieldInitializerInNestedClass() => 42;     // Noncompliant\n    static void UsedOnlyByConstructorInNestedClass() { }            // Noncompliant\n    static void AssignedToDelegateInNestedClass() { }               // Noncompliant\n    static void UsedInNameOfExpressionInNestedClass() { }           // Noncompliant \n\n    void Foo()\n    {\n        UsedByOuterAndNestedClasses();\n    }\n\n    class NestedClass\n    {\n        int _nestedField = UsedOnlyByFieldInitializerInNestedClass();\n        int NestedProp => UsedOnlyByPropertyInNestedClass();\n\n        public NestedClass()\n        {\n            UsedOnlyByConstructorInNestedClass();\n        }\n\n        static void NestedClassMethodUsedByDeeperNestedClass() { }  // Noncompliant {{Move this method inside 'DeeperNestedClass'.}}\n\n        void Bar()\n        {\n            OnlyUsedOnceByNestedClass();\n            OnlyUsedByNestedClassMultipleTimes();\n            OuterClass.OnlyUsedByNestedClassWithClassName();\n            UsedByMultipleSiblingNestedClasses();\n            UsedByOuterAndNestedClasses();\n            UsedByNestedClassAndDeeperNestedClass();\n\n            new OuterClass().NotStatic();\n            _outerField = 42;\n            OuterProp = 42;\n\n            PublicMethod();\n            ProtectedMethod();\n            InternalMethod();\n            ProtectedInternalMethod();\n            PrivateMethod();\n\n            GenericMethod(42);\n\n            Recursive(42);\n            MutuallyRecursive1();\n\n            ExternalMethod();\n\n            Action methodDelegate = AssignedToDelegateInNestedClass;\n            string methodName = nameof(UsedInNameOfExpressionInNestedClass);\n        }\n\n        void FooBaz()\n        {\n            OnlyUsedByNestedClassMultipleTimes();\n        }\n\n        class DeeperNestedClass\n        {\n            void FooBar()\n            {\n                OnlyUsedByDeeperNestedClass();\n                UsedByNestedClassAndDeeperNestedClass();\n                UsedByDeeperNestedClassesOnTheSameLevel();\n                UsedBySiblingAndDeeperNestedClasses();\n                NestedClassMethodUsedByDeeperNestedClass();\n            }\n        }\n\n        class AnotherDeeperNestedClass\n        {\n            void Foo()\n            {\n                UsedByDeeperNestedClassesOnTheSameLevel();\n            }\n        }\n    }\n\n    class SiblingNestedClass\n    {\n        void Baz()\n        {\n            UsedByMultipleSiblingNestedClasses();\n            UsedBySiblingAndDeeperNestedClasses();\n        }\n    }\n}\n\nclass ClassContainsStruct\n{\n    static void OnlyUsedByNestedStruct() { }                        // Noncompliant\n\n    struct NestedStruct\n    {\n        void Foo()\n        {\n            OnlyUsedByNestedStruct();\n        }\n    }\n}\n\nstruct StructContainsClass\n{\n    private static void OnlyUsedByNestedClass() { }                 // Noncompliant\n\n    class NestedClass\n    {\n        void Foo()\n        {\n            OnlyUsedByNestedClass();\n        }\n    }\n}\n\npartial class PartialOuterClass\n{\n    static void OnlyUsedByNestedClass() { }                         // Compliant - partial classes are often a result of code generation, so their methods shouldn't be moved\n    static partial void PartialOnlyUsedByNestedClass() { }          // Compliant\n}\n\npartial class PartialOuterClass\n{\n    static partial void PartialOnlyUsedByNestedClass();\n\n    class NestedClass\n    {\n        void Foo()\n        {\n            OnlyUsedByNestedClass();\n            PartialOnlyUsedByNestedClass();\n        }\n    }\n}\n\n[DebuggerDisplay(\"{UsedByDebuggerDisplay()}\")]\nclass DebugViewClass\n{\n    static string UsedByDebuggerDisplay() => \"\";                    // Noncompliant - FP: should not be moved to nested class, because it's also used by the attribute\n\n    class NestedClass\n    {\n        void Foo()\n        {\n            UsedByDebuggerDisplay();\n        }\n    }\n}\n\npublic class EdgeCaseWithLongCommonPaths\n{\n    private static void StaticMethod() { }                           // Noncompliant {{Move this method inside 'InsideMiddleOne'.}}\n\n    public class MiddleOne\n    {\n        public class InsideMiddleOne\n        {\n            public class Foo\n            {\n                public class FooLeaf\n                {\n                    public void Method() => StaticMethod();\n                }\n            }\n\n            public class Bar\n            {\n                public void Method() => StaticMethod();\n                public class BarLeaf\n                {\n                    public void Method() => StaticMethod();\n                }\n            }\n        }\n    }\n    public class MiddleTwo {\n        public void StaticMethod()\n        {\n        }\n        public void Method() => StaticMethod();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PropertiesAccessCorrectField.Latest.Partial.cs",
    "content": "﻿// https://sonarsource.atlassian.net/browse/NET-429\nnamespace CSharp13\n{\n    public partial class PartialProperties\n    {\n        private int x;\n        private int y;\n\n        public partial int X { get; set; }\n\n        public partial int Y\n        {\n            get { return x; }  // Noncompliant {{Refactor this getter so that it actually refers to the field 'y'.}}\n            set { x = value; } // Noncompliant {{Refactor this setter so that it actually refers to the field 'y'.}}\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PropertiesAccessCorrectField.Latest.cs",
    "content": "﻿namespace CSharp8\n{\n    class NullCoalesceAssignment\n    {\n        private object x;\n        private object y;\n\n        public object X\n        {\n            get { return x; }\n            set { x ??= value; }\n        }\n\n        public object Y\n        {\n            get { return x; }  // Noncompliant {{Refactor this getter so that it actually refers to the field 'y'.}}\n//                       ^\n            set { x ??= value; } // Noncompliant {{Refactor this setter so that it actually refers to the field 'y'.}}\n//                ^\n        }\n    }\n\n    class NullCoalesceAssignment_SubExpression\n    {\n        private object x;\n        private object y;\n\n        public object X\n        {\n            get { return x; }\n            set { var something = x ??= value; }\n        }\n\n        public object Y\n        {\n            get { return x; }            // Noncompliant {{Refactor this getter so that it actually refers to the field 'y'.}}\n            set { var y = x ??= value; } // Noncompliant {{Refactor this setter so that it actually refers to the field 'y'.}}\n        }\n    }\n}\n\nnamespace CSharp9\n{\n    public record Record\n    {\n        private object w;\n        private object x;\n        private object y;\n        private object z;\n\n        public object X\n        {\n            get { return x; }\n            set { x ??= value; }\n        }\n\n        public object W\n        {\n            get { return w; }\n            init { w ??= value; }\n        }\n\n        public object Y\n        {\n            get { return x; }  // Noncompliant {{Refactor this getter so that it actually refers to the field 'y'.}}\n    //                   ^\n            set { x ??= value; } // Noncompliant {{Refactor this setter so that it actually refers to the field 'y'.}}\n    //            ^\n        }\n\n        public object Z\n        {\n            get { return x; }  // Noncompliant {{Refactor this getter so that it actually refers to the field 'z'.}}\n    //                   ^\n            init { x ??= value; } // Noncompliant {{Refactor this setter so that it actually refers to the field 'z'.}}\n    //             ^\n        }\n    }\n}\n\nnamespace CSharp12\n{\n    // https://github.com/SonarSource/sonar-dotnet/issues/8101\n        public class SomeClass(object y)\n        {\n            object x;\n\n            public object Y\n            {\n                get { return x; }    // FN\n                set { x ??= value; } // FN\n            }\n        }\n}\n\n// https://sonarsource.atlassian.net/browse/NET-429\nnamespace CSharp13\n{\n    public partial class PartialProperties\n    {\n        public partial int X\n        {\n            get { return y; }  // Noncompliant {{Refactor this getter so that it actually refers to the field 'x'.}}\n            set { y = value; } // Noncompliant {{Refactor this setter so that it actually refers to the field 'x'.}}\n        }\n\n        public partial int Y { get; set; }\n    }\n}\n\nclass FieldKeyword\n{\n    private int y;\n    public int Y => field; // FN https://sonarsource.atlassian.net/browse/NET-2812\n\n    public int Field => field;\n\n    class FieldKeywordEscaped\n    {\n        public int field;\n        public int something;\n        public int Field => @field;\n        public int Something => @field; // FN https://sonarsource.atlassian.net/browse/NET-2812\n        public int Other => @field;\n    }\n}\n\nclass NullConditonalAssignment\n{\n    public class Sample\n    {\n        public int Value { get; set; }\n    }\n\n    private Sample correctField;\n    private Sample wrongField;\n\n    public Sample CorrectField\n    {\n        get;    // Noncompliant\n        set     // Noncompliant\n        {\n            wrongField?.Value = value.Value;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PropertiesAccessCorrectField.NetFramework.cs",
    "content": "﻿// https://github.com/SonarSource/sonar-dotnet/issues/3442\n// Also see \"Add WPF support in unit tests when targeting .Net Core\" https://github.com/SonarSource/sonar-dotnet/issues/4883\nnamespace TestCases\n{\n    using System.Windows;\n    using System.Windows.Controls;\n    using System.Windows.Media;\n\n    public class CustomControl : UserControl\n    {\n        public static readonly DependencyProperty BackgroundColorProperty =\n            DependencyProperty.Register(\"BackgroundColor\", typeof(Color), typeof(CustomControl), new PropertyMetadata(Colors.Red, ColorPropertyChanged));\n\n        public static readonly DependencyProperty ForegroundColorProperty =\n            DependencyProperty.Register(\"ForegroundColor\", typeof(Color), typeof(CustomControl), new PropertyMetadata(Colors.Red, ColorPropertyChanged));\n\n        private Color backgroundColor;\n        private Color foregroundColor;\n\n        public Color BackgroundColor\n        {\n            get => (Color)GetValue(BackgroundColorProperty);\n            set => this.SetValue(BackgroundColorProperty, value);\n        }\n\n        public Color ForegroundColor\n        {\n            get\n            {\n                return (Color) GetValue(ForegroundColorProperty);\n            }\n\n            set\n            {\n                this.SetValue(ForegroundColorProperty, value);\n            }\n        }\n\n        private static void ColorPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PropertiesAccessCorrectField.NetFramework.vb",
    "content": "﻿Imports System.Windows\nImports System.Windows.Controls\nImports System.Windows.Media\n\nPublic Class Repro3442\n    Inherits  UserControl\n\n    Public Shared ReadOnly BackgroundColorProperty As DependencyProperty = DependencyProperty.Register(\"BackgroundColor\", GetType(Color), GetType(Color), New PropertyMetadata(\"\"))\n    Public Shared ReadOnly ForegroundColorProperty As DependencyProperty = DependencyProperty.Register(\"ForegroundColor\", GetType(Color), GetType(Color), New PropertyMetadata(\"\"))\n    Public Shared ReadOnly OldColorProperty As DependencyProperty = DependencyProperty.Register(\"OldColor\", GetType(Color), GetType(Color), New PropertyMetadata(\"\"))\n\n    Private backgroundColor_ As Color\n    Private foregroundColor_ As Color\n    Private oldColor_ As Color\n\n    Public Property BackgroundColor As Color\n        Get\n            Return GetValue(BackgroundColorProperty)\n        End Get\n\n        Set\n            SetValue(BackgroundColorProperty, value)\n        End Set\n    End Property\n\n    Public Property ForegroundColor As Color\n        Get\n            Return GetValue(ForegroundColorProperty)\n        End Get\n\n        Set\n            SetValue(ForegroundColorProperty, value)\n        End Set\n    End Property\n\n    Public Property OldColor As Color\n        Get\n            Return GETVALUE(OldColorProperty)\n        End Get\n\n        Set\n            SETVALUE(OldColorProperty, value)\n        End Set\n    End Property\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PropertiesAccessCorrectField.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing GalaSoft.MvvmLight;\nusing System.Runtime.CompilerServices;\nusing System.Windows;\n\nclass NonCompliantClass_FromRspec\n{\n    private int x;\n    private int y;\n\n    public int X\n    {\n        get { return x; }\n        set { x = value; }\n    }\n\n    public int Y\n    {\n        get { return x; }  // Noncompliant {{Refactor this getter so that it actually refers to the field 'y'.}}\n//                   ^\n        set { x = value; } // Noncompliant {{Refactor this setter so that it actually refers to the field 'y'.}}\n//            ^\n    }\n}\n\npartial class NonCompliant_PartialClass\n{\n    private int x;\n    private int y;\n}\n\npartial class NonCompliant_PartialClass\n{\n    public int Y\n    {\n        get { return x; }  // Noncompliant\n        set { x = value; } // Noncompliant\n    }\n}\n\nstruct NonCompliantStruct_FromRspec\n{\n    private int x;\n    private int y;\n\n    public int X\n    {\n        get { return x; }\n        set { x = value; }\n    }\n\n    public int Y\n    {\n        get { return x; }  // Noncompliant: field 'y' is not used in the return value\n        set { x = value; } // Noncompliant: field 'y' is not updated\n    }\n}\n\n\nclass NonCompliant_UnderscoresInNamesAndCasing\n{\n    private int yyy;\n    private int __x__X; // test that underscores and casing in names are ignored\n    public int XX\n    {\n        get { return yyy; }   // Noncompliant {{Refactor this getter so that it actually refers to the field '__x__X'.}}\n//                   ^^^\n        set { yyy = value; }  // Noncompliant {{Refactor this setter so that it actually refers to the field '__x__X'.}}\n//            ^^^\n    }\n\n    public int _Y___Y_Y_\n    {\n        get { return __x__X; } // Noncompliant\n//                   ^^^^^^\n    }\n}\n\nclass NonCompliant_FieldTypeIsIgnored\n{\n    private int aaa;\n    private string aString;\n\n    public string AAA\n    {\n        get { return aString; } // Compliant - field called 'aaa' exists, but type is different\n        set { aString = value; } // Compliant - Type is different.\n    }\n}\n\nclass NonCompliant_AssigningToExpression\n{\n    private int aaa;\n    private string aString;\n\n    public string AAA\n    {\n        set { aString = \"foo\" + value; } // Compliant field called 'aaa' exists, but type is different.\n    }\n}\n\npartial class NonCompliant_PartialClass\n{\n    private object myProperty;\n}\npartial class NonCompliant_PartialClass\n{\n    private object anotherObject;\n}\npartial class NonCompliant_PartialClass\n{\n    public object MyProperty\n    {\n        get { return this.anotherObject; } // Noncompliant\n        set { this.anotherObject = value; } // Noncompliant\n    }\n}\n\n\nclass NonCompliant_ComplexProperty\n{\n    private int field1;\n    private int field2;\n    private bool initialized;\n    private bool isDisposed;\n\n    public int Field1\n    {\n        get // Noncompliant {{Refactor this getter so that it actually refers to the field 'field1'.}}\n//      ^^^\n        {\n            if (!this.initialized)\n            {\n                throw new InvalidOperationException();\n            }\n            if (this.isDisposed)\n            {\n                throw new ObjectDisposedException(\"object name\");\n            }\n\n            return this.field2;\n        }\n\n        set\n        {\n            if (value < 0)\n            {\n                throw new ArgumentOutOfRangeException(nameof(value));\n            }\n            this.field2 = value; // Noncompliant\n//               ^^^^^^\n        }\n    }\n}\n\nclass NonCompliant_Parentheses\n{\n    private int field1;\n    private int field2;\n\n    public int Field2\n    {\n        get { return (((this.field1))); } // Noncompliant\n//                           ^^^^^^\n        set\n        {\n            (((field1))) = value; // Noncompliant\n//             ^^^^^^\n        }\n    }\n}\n\n\nclass NonCompliant_OuterClass\n{\n    private string fielda;\n    private string fieldb;\n\n    struct NonCompliant_NestedClass\n    {\n        int fielda;\n        int fieldb;\n\n        public int FieldA\n        {\n            get { return this.fieldb; }     // Noncompliant\n            set { this.fieldb = value; }   // Noncompliant\n        }\n    }\n}\n\n\nclass Compliant_Indexer\n{\n    // Declare an array to store the data elements.\n    private readonly int[] arr = new int[100];\n\n    // Define the indexer to allow client code to use [] notation.\n    public int this[int i]\n    {\n        get { return arr[i]; }  // Compliant - we don't know which field to check against\n        set { arr[i] = value; }\n    }\n}\n\nclass CompliantClass\n{\n    private int xxx;\n\n    public int XXX\n    {\n        get { return xxx; }\n        set { xxx = value; }\n    }\n\n    public int UUU\n    {\n        get { return xxx; }     // Compliant - no matching field name\n        set { xxx = value; }\n    }\n\n    private string _a_b_c;\n    private string abc;\n    private string yyy;\n\n    public string Abc\n    {\n        get { return yyy; }     // Compliant - multiple possible matching field names, so don't raise\n        set { yyy = value; }\n    }\n}\n\nclass Compliant_ImplicitProperties\n{\n    private string firstName;\n    private string secondName;\n\n    public string FirstName { get; set; } = \"Jane\";\n    public string SecondName { get; set; }\n}\n\n\nclass WrappedClass\n{\n    internal int field1;\n    internal int field2;\n}\nclass Compliant_WrappedObject\n{\n    private WrappedClass wrapped;\n\n    public int Field2\n    {\n        get { return wrapped.field1; }\n        set { wrapped.field1 = value; }\n    }\n}\n\nclass BaseClass\n{\n    protected int field1;\n}\n\nclass ChildClass : BaseClass\n{\n    private int field2;\n\n    public int Field1\n    {\n        get { return field2; }      // Noncompliant\n        set { field2 = value; }     // Noncompliant\n    }\n}\n\npublic class Base\n{\n    protected long writeLockTimeout;\n}\n\npublic class SubClass : Base\n{\n    public long WRITE_LOCK_TIMEOUT = 1000;\n    public long WriteLockTimeout\n    {\n        get\n        {\n            return writeLockTimeout; // Compliant - points to the field in the base class\n        }\n        set\n        {\n            this.writeLockTimeout = value; // Compliant - points to the field in the base class\n        }\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/8110\n// https://sonarsource.atlassian.net/browse/NET-1678\nclass Repro_8110\n{\n    class Base\n    {\n        private bool _isSelected;\n        protected bool _isEnabled;\n        protected bool _otherProtected;\n\n        public virtual bool IsSelected\n        {\n            get => _isSelected;\n            set => _isSelected = value;\n        }\n\n        public virtual bool IsEnabled\n        {\n            get => _isEnabled;\n            set => _isEnabled = value;\n        }\n    }\n\n    class Intermediate : Base { }\n\n    class PrivateField_DerivedCallsOtherFieldInBase : Base\n    {\n        public override bool IsSelected\n        {\n            get => _isEnabled;         // Compliant: base field _isSelected is private\n            set => _isEnabled = value; // Compliant: base field _isSelected is private\n        }\n    }\n\n    class PrivateField_DerivedCallsOtherFieldInDerived : Base\n    {\n        private bool _other;\n\n        public override bool IsSelected\n        {\n            get => _other;         // Compliant: base field _isSelected is private\n            set => _other = value; // Compliant: base field _isSelected is private\n        }\n    }\n\n    class PrivateField_GrandchildCallsOtherFieldInBase : Intermediate\n    {\n        public override bool IsSelected\n        {\n            get => _isEnabled;         // Compliant: base field _isSelected is private\n            set => _isEnabled = value; // Compliant: base field _isSelected is private\n        }\n    }\n\n    class ProtectedField_DerivedCallsOtherFieldInBase : Base\n    {\n        public override bool IsEnabled\n        {\n            get => _otherProtected;         // Noncompliant {{Refactor this getter so that it actually refers to the field '_isEnabled'.}}\n            set => _otherProtected = value; // Noncompliant {{Refactor this setter so that it actually refers to the field '_isEnabled'.}}\n        }\n    }\n\n    class ProtectedField_DerivedCallsOtherFieldInDerived : Base\n    {\n        private bool _other;\n\n        public override bool IsEnabled\n        {\n            get => _other;         // Noncompliant {{Refactor this getter so that it actually refers to the field '_isEnabled'.}}\n            set => _other = value; // Noncompliant {{Refactor this setter so that it actually refers to the field '_isEnabled'.}}\n        }\n    }\n\n    class ProtectedField_DerivedCallsOverriddenBaseAccessor : Base\n    {\n        public override bool IsEnabled\n        {\n            get => base.IsEnabled;         // Compliant: calling own base property accessor\n            set => base.IsEnabled = value; // Compliant: calling own base property accessor\n        }\n    }\n\n    class ProtectedField_DerivedCallsOtherBaseAccessor : Base\n    {\n        public override bool IsEnabled\n        {\n            get // Noncompliant {{Refactor this getter so that it actually refers to the field '_isEnabled'.}}\n            {\n                return base.IsSelected;\n            }\n            set // Noncompliant {{Refactor this setter so that it actually refers to the field '_isEnabled'.}}\n            {\n                base.IsSelected = value;\n            }\n        }\n    }\n\n    class ProtectedField_GrandchildCallsOtherFieldInBase : Intermediate\n    {\n        public override bool IsEnabled\n        {\n            get => _otherProtected;         // Noncompliant {{Refactor this getter so that it actually refers to the field '_isEnabled'.}}\n            set => _otherProtected = value; // Noncompliant {{Refactor this setter so that it actually refers to the field '_isEnabled'.}}\n        }\n    }\n}\n\nclass MultipleOperations\n{\n    private int _foo;\n    private int _bar;\n    public int Foo\n    {\n        get\n        {\n            return _foo;\n        }\n        set\n        {\n            _bar = 1;\n            _foo = value; // Compliant\n            _bar = 0;\n        }\n    }\n}\n\nstruct MultipleOperationsStruct\n{\n    private int _foo;\n    private int _bar;\n    public int Foo\n    {\n        get\n        {\n            return _foo;\n        }\n        set\n        {\n            _bar = 1;\n            _foo = value; // Compliant\n            _bar = 0;\n        }\n    }\n}\n\n// this usage is specific to MVVM Light framework\npublic class FooViewModel : ViewModelBase\n{\n    private int _foo;\n    private int _bar;\n\n    public int Foo\n    {\n        get => this._foo;\n        set\n        {\n            if (this.Set(ref this._foo, 1)) // Compliant - the Set method does the assignment\n            {\n                this._bar = 1;\n            }\n        }\n    }\n}\n\npublic class FooViewModelWithoutSet : ViewModelBase\n{\n    private int _foo;\n    private int _bar;\n\n    public bool MySet(int x, int y) => true;\n\n    public int Foo\n    {\n        get => this._foo;\n        set\n        {\n            if (MySet(this._foo, 1))\n            {\n                this._bar = 1; // Noncompliant\n            }\n        }\n    }\n}\n\npublic class NoFieldUsage\n{\n    private int foo1;\n    public int Foo1 { get; }\n\n    private int foo2;\n    public int Foo2 { get; set; }\n\n    private int foo3;\n    public int Foo3\n    {\n        get\n        {\n            Bar();\n            return foo1; // Noncompliant\n        }\n        set // Noncompliant\n//      ^^^\n        {\n            Bar();\n        }\n    }\n\n    private int foo4;\n    public int Foo4 => 4;\n\n    private int foo5;\n    public int Foo5\n    {\n        get // Noncompliant\n//      ^^^\n        {\n            Bar();\n            return 1;\n        }\n    }\n\n    void Bar() { }\n}\n\npublic class UpdateWithOut\n{\n    private int foo;\n    public int Foo\n    {\n        set\n        {\n            Assign(value, out foo);\n        }\n    }\n    private void Assign(int value, out int result)\n    {\n        result = value;\n    }\n}\n\npublic class UpdateWithOut2\n{\n    private int foo;\n    private int bar;\n    public int Foo\n    {\n        set\n        {\n            Assign(value, out bar); // Noncompliant\n        }\n    }\n    private void Assign(int value, out int result)\n    {\n        result = value;\n    }\n}\n\npublic class MultipleStatements\n{\n    private string foo;\n    private string bar;\n    public string Foo\n    {\n        get\n        {\n            if (true)\n            {\n                throw new System.InvalidOperationException(\"\");\n            }\n            foo = \"stuff\";\n            return bar; // Noncompliant {{Refactor this getter so that it actually refers to the field 'foo'.}}\n//                 ^^^\n        }\n        set\n        {\n            if (foo.Equals(foo))\n            {\n                bar = value; // Noncompliant {{Refactor this setter so that it actually refers to the field 'foo'.}}\n//              ^^^\n            }\n        }\n    }\n    public string Bar\n    {\n        get\n        {\n            if (true)\n            {\n                throw new System.InvalidOperationException(\"\");\n            }\n            this.bar = \"stuff\";\n            return this.foo; // Noncompliant {{Refactor this getter so that it actually refers to the field 'bar'.}}\n//                      ^^^\n        }\n        set\n        {\n            if (this.bar.Equals(foo))\n            {\n                this.foo = value; // Noncompliant {{Refactor this setter so that it actually refers to the field 'bar'.}}\n//                   ^^^\n            }\n        }\n    }\n\n}\n\npublic class SpecialUsages\n{\n    private string _foo;\n\n    public string Foo\n    {\n        get\n        {\n            var foo = _foo; // Compliant, field is read\n            if (true)\n            {\n                foo += foo;\n            }\n            return foo;\n        }\n    }\n\n    private object baz;\n    public object Baz\n    {\n        get => baz ?? throw new System.InvalidOperationException(\"\"); // Compliant\n        set => baz = (baz == null) ? value : throw new System.InvalidOperationException(\"\"); // Compliant\n    }\n\n    private int doNotSet;\n    public int DoNotSet\n    {\n        set\n        {\n            throw new System.InvalidOperationException(\"\"); // Compliant, if it throws do not raise\n        }\n    }\n\n    private string tux;\n    public string Tux\n    {\n        get\n        {\n            return tux + \"salt\"; // Compliant\n        }\n    }\n\n    private string mux;\n    public string Mux\n    {\n        get\n        {\n            return mux.Replace('x', 'y');\n        }\n    }\n\n    private string MultipleFields\n    {\n        get => _foo == baz ? tux : mux;\n    }\n\n    private object baz2;\n    public object Baz2\n    {\n        get /* 123 */ => /* 456 */ throw new System.InvalidOperationException(\"\"); // Compliant\n        set => throw new System.InvalidOperationException(\"\"); // Compliant\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/2867\npublic class Repro_2867\n{\n    private class ValueWrapper<T>\n    {\n        public T Value { get; set; }\n        // ...\n    }\n\n    private readonly ValueWrapper<double> _someMember = new ValueWrapper<double>();\n\n    public double SomeMember\n    {\n        get => _someMember.Value;\n        set => _someMember.Value = value;\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/2435\npublic class CrossProcedural_Repro_2435\n{\n    private int expressionValue;\n    private int expressionValueWrong;\n    private int bodyValue;\n    private int bodyValueWrong;\n    private int tooNested;\n    private int tooComplex;\n\n    public int ExpressionValue\n    {\n        get => GetByExpression();\n        set => SetByExpression(value);\n    }\n\n    public int ExpressionValue_ // With \"this.\"\n    {\n        get => this.GetByExpression();\n        set => this.SetByExpression(value);\n    }\n\n    public int ExpressionValueWrong\n    {\n        get => GetByExpression(); // Noncompliant\n        set => SetByExpression(value); // Noncompliant\n    }\n\n    private int GetByExpression() => this.expressionValue;\n    private void SetByExpression(int value) => this.expressionValue = value;\n\n    public int BodyValue\n    {\n        get\n        {\n            return GetByBody();\n        }\n        set\n        {\n            SetByBody(value);\n        }\n    }\n\n    public int BodyValue_ // With \"this.\"\n    {\n        get\n        {\n            return this.GetByBody();\n        }\n        set\n        {\n            this.SetByBody(value);\n        }\n    }\n\n    public int BodyValue__ // get/set with more than one statement\n    {\n        get // Noncompliant, only one function invocation is supported\n        {\n            try\n            {\n                var nothing = IrrelevantFunction();\n                return GetByBody();\n            }\n            catch (Exception ex)\n            {\n                return 0;\n            }\n        }\n        set // Noncompliant, only one function invocation is supported\n        {\n            try\n            {\n                IrrelevantProcedure(value);\n                SetByBody(value);\n            }\n            catch (Exception ex)\n            {\n                // Nothing\n            }\n        }\n    }\n\n    public int BodyValueWrong\n    {\n        get // Noncompliant\n        {\n            return this.GetByExpression();\n        }\n        set // Noncompliant\n        {\n            this.SetByExpression(value);\n        }\n    }\n\n    private int IrrelevantFunction()\n    {\n        return 42; // Do not return local fields\n    }\n\n    private void IrrelevantProcedure(int value)\n    {\n        // Do not set local fields\n    }\n\n    private int GetByBody()\n    {\n        return this.bodyValue;\n    }\n\n    private void SetByBody(int value)\n    {\n        this.bodyValue = value;\n    }\n\n    public int TooNested\n    {\n        get => GetTooNestedA(); // Noncompliant, only one level of nesting is supported\n        set => SetTooNestedA(value); // Noncompliant, only one level of nesting is supported\n    }\n\n    private int GetTooNestedA() => GetTooNestedB();\n    private void SetTooNestedA(int value) => SetTooNestedB(value);\n\n    private int GetTooNestedB() => this.tooNested;\n    private void SetTooNestedB(int value) => this.tooNested = value;\n\n    public int TooComplex\n    {\n        get // Noncompliant, only single return scenario is supported\n        {\n            if (true)\n                return GetTooComplex();\n            else\n                return GetTooComplex();\n        }\n        set // Noncompliant, only one function invocation is supported\n        {\n            if (true)\n                SetTooComplex(value);\n            else\n                SetTooComplex(value);\n\n        }\n    }\n\n    private int GetTooComplex() => this.tooComplex;\n    private void SetTooComplex(int value) => this.tooComplex = value;\n\n    public int WithAttributeWithoutBody\n    {\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        get;\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private set;\n    }\n\n    public int ReadOnlyProperty\n    {\n        [DebuggerStepThrough]\n        get;\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/3441\npublic class Repro3441\n{\n    private readonly List<int> _data = new List<int>();\n    public List<int> Data\n    {\n        get => _data;\n        // The setter in this case is only executed by a deserializer, but we don’t want to replace the field instance.\n        private set // Noncompliant\n        {\n            foreach (var item in value)\n            {\n                _data.Add(item);\n            }\n        }\n    }\n}\n\n// See: https://github.com/SonarSource/sonar-dotnet/issues/4339\npublic class TestCases\n{\n    bool pause;\n    public bool Pause\n    {\n        get => pause;\n        set => pause |= value;\n    }\n\n    private int textBufferUndoHistory;\n    public int TextBufferUndoHistory\n    {\n        get\n        {\n            return textBufferUndoHistory = GetValue();\n        }\n    }\n    private static int GetValue() => 1;\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/5259\n    private int[] attributes;\n    public int[] Attributes\n    {\n        set { value.CopyTo(attributes, 0); } // Noncompliant - FP\n    }\n\n    private const string PREFIX = \"pre\";\n    private string m_prefix;\n    public string Prefix\n    {\n        get { return m_prefix; } // Compliant PREFIX is const\n        set { m_prefix = value; } // Compliant PREFIX is const\n    }\n}\n\npublic class ContainsConstraint\n{\n    private bool _ignoreCase;\n\n    public ContainsConstraint IgnoreCase\n    {\n        get // Compliant - _IgnoreCase has different type\n        {\n            _ignoreCase = true;\n            return this;\n        }\n    }\n}\n\npublic class AClass\n{\n    public static long WRITE_LOCK_TIMEOUT = 1000;\n    public long longValue;\n    public long WriteLockTimeout\n    {\n        get\n        {\n            return longValue; // Compliant - WRITE_LOCK_TIMEOUT is static field when the property is not static.\n        }\n        set\n        {\n            longValue = value; // Compliant - WRITE_LOCK_TIMEOUT is static field when the property is not static.\n        }\n    }\n\n    public static long TEST_STATIC_CASE = 1000;\n    public static long ALong = 2000;\n    public static long TestStaticCase\n    {\n        get\n        {\n            return ALong; // Noncompliant\n        }\n        set\n        {\n            ALong = value; // Noncompliant\n        }\n    }\n}\n\nclass Repro_NET2939 // https://sonarsource.atlassian.net/browse/NET-2939\n{\n    private string _someField;\n    private string wrongLocation;\n    private string correctLocationWithField;\n    private string correctLocationWithoutField;\n    public string WrongLocation\n    {\n        get\n        {\n            string a = string.Empty; // Noncompliant Wrong location, should be on 'get' https://sonarsource.atlassian.net/browse/NET-2939\n//                            ^^^^^\n        return a;\n        }\n    }\n\n    public string CorrectLocationWithField\n    {\n        get \n        {\n            return _someField;           // Noncompliant\n//                 ^^^^^^^^^^\n        }\n    }\n\n    public string CorrectLocationWithoutField\n    {\n        get                         // Noncompliant\n//      ^^^\n        {\n            string a = \"string.Empty\";\n            return a;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PropertiesAccessCorrectField.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.Windows\nImports GalaSoft.MvvmLight\n\nNamespace Tests.Diagnostics\n    Class NonCompliantClass_FromRspec\n        Private x_ As Integer\n        Private y_ As Integer\n\n        Public Property X As Integer\n            Get\n                Return x_\n            End Get\n            Set(ByVal value As Integer)\n                x_ = value\n            End Set\n        End Property\n\n        Public Property Y As Integer\n            Get\n                Return x_ ' Noncompliant {{Refactor this getter so that it actually refers to the field 'y_'.}}\n            End Get\n            Set(ByVal value As Integer)\n                x_ = value ' Noncompliant {{Refactor this setter so that it actually refers to the field 'y_'.}}\n            End Set\n        End Property\n    End Class\n\n    Structure NonCompliantStruct_FromRspec\n        Private x_ As Integer\n        Private y_ As Integer\n\n        Public Property X As Integer\n            Get\n                Return x_\n            End Get\n            Set(ByVal value As Integer)\n                x_ = value\n            End Set\n        End Property\n\n        Public Property Y As Integer\n            Get\n                Return x_ ' Noncompliant\n            End Get\n            Set(ByVal value As Integer)\n                x_ = value ' Noncompliant\n            End Set\n        End Property\n    End Structure\n\n    Class NonCompliant_UnderscoresInNamesAndCasing\n        Private yyy As Integer\n        Private __x__X As Integer\n\n        Public Property XX As Integer ' test that underscores and casing in names are ignored\n            Get\n                Return yyy ' Noncompliant {{Refactor this getter so that it actually refers to the field '__x__X'.}}\n            End Get\n            Set(ByVal value As Integer)\n                yyy = value ' Noncompliant {{Refactor this setter so that it actually refers to the field '__x__X'.}}\n            End Set\n        End Property\n\n        Public ReadOnly Property _Y___Y_Y_ As Integer\n            Get\n                Return __x__X ' Noncompliant\n            End Get\n        End Property\n    End Class\n\n    Class NonCompliant_FieldTypeIsIgnored\n        Private aaa_ As Integer\n        Private aString As String\n\n        Public Property AAA As String\n            Get\n                Return aString ' Compliant - field called 'aaa' exists, but type is different\n            End Get\n            Set(ByVal value As String)\n                aString = value ' Compliant - field called 'aaa' exists, but type is different\n            End Set\n        End Property\n    End Class\n\n    Class NonCompliant_AssigningToExpression\n        Private aaa_ As Integer\n        Private aString As String\n\n        Public WriteOnly Property AAA As String\n            Set(ByVal value As String)\n                aString = \"foo\" & value ' Compliant - field called 'aaa' exists, but type is different\n            End Set\n        End Property\n    End Class\n\n    Partial Class NonCompliant_PartialClass\n        Private myProperty_ As Object\n    End Class\n\n    Partial Class NonCompliant_PartialClass\n        Private anotherObject As Object\n    End Class\n\n    Partial Class NonCompliant_PartialClass\n        Public Property MyProperty As Object\n            Get\n                Return Me.anotherObject ' Noncompliant\n            End Get\n            Set(ByVal value As Object)\n                Me.anotherObject = value ' Noncompliant\n            End Set\n        End Property\n    End Class\n\n    Class NonCompliant_ComplexProperty\n        Private field1_ As Integer\n        Private field2_ As Integer\n        Private initialized As Boolean\n        Private isDisposed As Boolean\n\n        Public Property Field1 As Integer\n            Get ' Noncompliant ^13#3\n                If Not Me.initialized Then\n                    Throw New InvalidOperationException()\n                End If\n\n                If Me.isDisposed Then\n                    Throw New ObjectDisposedException(\"object name\")\n                End If\n\n                Return Me.field2_\n            End Get\n            Set(ByVal value As Integer)\n\n                If value < 0 Then\n                    Throw New ArgumentOutOfRangeException(NameOf(value))\n                End If\n\n                Me.field2_ = value ' Noncompliant\n                '  ^^^^^^^\n            End Set\n        End Property\n    End Class\n\n    Class NonCompliant_Parentheses\n        Private field1_ As Integer\n        Private field2_ As Integer\n\n        Public ReadOnly Property Field2 As Integer\n            Get\n                Return (((Me.field1_))) ' Noncompliant\n                '            ^^^^^^^\n            End Get\n        End Property\n    End Class\n\n    Class NonCompliant_OuterClass\n        Private fielda_ As String\n        Private fieldb_ As String\n\n        Structure NonCompliant_NestedClass\n            Private fielda_ As Integer\n            Private fieldb_ As Integer\n\n            Public Property FieldA As Integer\n                Get\n                    Return Me.fieldb_  ' Noncompliant\n                End Get\n                Set(ByVal value As Integer)\n                    Me.fieldb_ = value ' Noncompliant\n                End Set\n            End Property\n        End Structure\n    End Class\n\n    Structure Compliant_Indexer\n        ' Declare an array to store the data elements.\n        Private Shared ReadOnly arr As Integer() = New Integer(99) {}\n\n        ' Define the indexer to allow client code to use [] notation.\n        Default Public Property Item(ByVal i As Integer) As Integer\n            Get\n                Return arr(i) ' Compliant - we don't know which field to check against\n            End Get\n            Set(ByVal value As Integer)\n                arr(i) = value\n            End Set\n        End Property\n    End Structure\n\n    Class CompliantClass\n        Private xxx_ As Integer\n\n        Public Property XXX As Integer\n            Get\n                Return xxx_\n            End Get\n            Set(ByVal value As Integer)\n                xxx_ = value\n            End Set\n        End Property\n\n        Public Property UUU As Integer\n            Get\n                Return xxx_ ' Compliant - no matching field name\n            End Get\n            Set(ByVal value As Integer)\n                xxx_ = value\n            End Set\n        End Property\n\n        Private _a_b_c As String\n        Private abc As String\n        Private yyy As String\n\n        Public Property Abc2 As String\n            Get\n                Return yyy ' Compliant - multiple possible matching field names, so don't raise\n            End Get\n            Set(ByVal value As String)\n                yyy = value\n            End Set\n        End Property\n    End Class\n\n    Class Compliant_ImplicitProperties\n        Private firstName As String\n        Private secondName As String\n        Public Property FirstName2 As String = \"Jane\"\n        Public Property SecondName2 As String\n    End Class\n\n    Class WrappedClass\n        Friend field1 As Integer\n        Friend field2 As Integer\n    End Class\n\n    Class Compliant_WrappedObject\n        Private wrapped As WrappedClass\n\n        Public Property Field2 As Integer\n            Get\n                Return wrapped.field1\n            End Get\n            Set(Value As Integer)\n                wrapped.field1 = Value\n            End Set\n        End Property\n    End Class\n\n    Class BaseClass\n        Protected field1 As Integer\n    End Class\n\n    Class ChildClass\n        Inherits BaseClass\n\n        Private field2 As Integer\n\n        Public Property Field1 As Integer\n            Get\n                Return field2 ' Noncompliant - should point to the field in the base class or change the property name.\n            End Get\n            Set(ByVal value As Integer)\n                field2 = value ' Noncompliant - should point to the field in the base class or change the property name.\n            End Set\n        End Property\n    End Class\n\n    Class MultipleOperations\n        Private _foo As Integer\n        Private _bar As Integer\n\n        Public Property Foo As Integer\n            Get\n                Return _foo\n            End Get\n            Set(ByVal value As Integer)\n                _bar = 1\n                _foo = value ' Compliant\n                _bar = 0\n            End Set\n        End Property\n    End Class\n\n    ' this usage is specific to MVVM Light framework\n    Public Class FooViewModel\n        Inherits ViewModelBase\n\n        Private _foo As Integer\n        Private _bar As Integer\n\n        Public Property Foo As Integer\n            Get\n                Return Me._foo\n            End Get\n            Set(ByVal value As Integer)\n                If Me.[Set](Me._foo, 1) Then ' Compliant, it is assigned in the Set method\n                    Me._bar = 1\n                End If\n            End Set\n        End Property\n    End Class\n\n    Public Class FooViewModelWithoutSet\n        Inherits ViewModelBase\n\n        Private _foo As Integer\n        Private _bar As Integer\n\n        Public Function MySet(ByVal x As Integer, ByVal y As Integer) As Boolean\n            Return True\n        End Function\n\n        Public Property Foo As Integer\n            Get\n                Return Me._foo\n            End Get\n            Set(ByVal value As Integer)\n                If MySet(Me._foo, 1) Then\n                    Me._bar = 1 ' Noncompliant\n                End If\n            End Set\n        End Property\n    End Class\n\n    Public Class MultipleStatements\n        Private _foo As String\n        Private _bar As String\n\n        Public Property Foo As String\n            Get\n                If True Then\n                    Throw New System.InvalidOperationException(\"\")\n                End If\n\n                _foo = \"stuff\"\n                Return _bar ' Noncompliant {{Refactor this getter so that it actually refers to the field '_foo'.}}\n                '      ^^^^\n            End Get\n            Set\n                If _foo.Equals(_foo) Then\n                    _bar = Value ' Noncompliant ^21#4 {{Refactor this setter so that it actually refers to the field '_foo'.}}\n                End If\n\n            End Set\n        End Property\n\n        Public Property Bar As String\n            Get\n                If True Then\n                    Throw New System.InvalidOperationException(\"\")\n                End If\n\n                Me._bar = \"stuff\"\n                Return Me._foo ' Noncompliant {{Refactor this getter so that it actually refers to the field '_bar'.}}\n                '         ^^^^\n            End Get\n            Set\n                If Me._bar.Equals(Me._foo) Then\n                    Me._foo = Value ' Noncompliant {{Refactor this setter so that it actually refers to the field '_bar'.}}\n                    '  ^^^^\n                End If\n\n            End Set\n        End Property\n    End Class\n\n    Public Class SpecialUsages\n        Private _foo As String\n\n        Public ReadOnly Property Foo As String\n            Get\n                Dim variable = Me._foo ' Compliant, field is read\n                If True Then\n                    variable = (variable + variable)\n                End If\n                Return variable\n            End Get\n        End Property\n\n        Public WriteOnly Property DoNotSet As Integer\n            Set\n                Throw New System.InvalidOperationException(\"\") ' Compliant\n            End Set\n        End Property\n\n        Private _tux As String\n\n        Public ReadOnly Property Tux As String\n            Get\n                Return (_tux + \"salt\") ' Compliant\n            End Get\n        End Property\n\n        Private _mux As String\n\n        Public ReadOnly Property Mux As String\n            Get\n                Return _mux.Replace(\"x\", \"y\") ' Compliant\n            End Get\n        End Property\n    End Class\n\n    ' https://github.com/SonarSource/sonar-dotnet/issues/2774\n    Public Class Class1\n\n        Private WithEvents _RootA As Random\n        Private WithEvents _RootB As Random\n\n        Public Property RootA() As Random\n            Get\n                Return _RootA\n            End Get\n            Set(ByVal Value As Random)\n                _RootA = Value\n            End Set\n        End Property\n\n        Public Property RootB() As Random\n            Get\n                Return Me._RootB\n            End Get\n            Set(ByVal Value As Random)\n                Me._RootB = Value\n            End Set\n        End Property\n\n    End Class\n\n    Public Class CashLess\n\n    End Class\n\n    ' https://github.com/SonarSource/sonar-dotnet/issues/2867\n    Public Class Repro_2867\n\n        Public Class ValueWrapper(Of T)\n\n            Public Property Value As T\n\n        End Class\n\n        Private ReadOnly _someMember As New ValueWrapper(Of Double)\n\n        Public Property SomeMember As Double\n            Get\n                Return _someMember.Value\n            End Get\n            Set(value As Double)\n                _someMember.Value = value\n            End Set\n        End Property\n\n    End Class\n\n    ' https//github.com/SonarSource/sonar-dotnet/issues/2435\n    Public Class CrossProcedural_Repro_2435\n\n        Private _BodyValue As Integer\n        Private _BodyValueWrong As Integer\n        Private _TooNested As Integer\n        Private _TooComplex As Integer\n\n        Public Property BodyValue As Integer\n            Get\n                Return GetByBody()\n            End Get\n            Set(value As Integer)\n                SetByBody(value)\n            End Set\n        End Property\n\n        Public Property BodyValue_ As Integer   'With \"Me.\"\n            Get\n                Return Me.GetByBody()\n            End Get\n            Set(value As Integer)\n                Me.SetByBody(value)\n            End Set\n        End Property\n\n        Public Property BodyValue__ As Integer 'Get/Set with more than one statement\n            Get 'Noncompliant, only one function invocation is supported\n                Try\n                    IrrelevantFunction()\n                    Return GetByBody()\n                Catch ex As Exception\n                    Return 0\n                End Try\n            End Get\n            Set(value As Integer) 'Noncompliant, only one function invocation is supported\n                Try\n                    IrrelevantProcedure(value)\n                    SetByBody(value)\n                Catch ex As Exception\n                    'Nothing\n                End Try\n            End Set\n        End Property\n\n        Public Property BodyValueWrong As Integer\n            Get                     'Noncompliant\n                Return GetByBody()\n            End Get\n            Set(value As Integer)   'Noncompliant\n                SetByBody(value)\n            End Set\n        End Property\n\n        Private Function IrrelevantFunction() As Integer\n            Return 42   'Do not touch local fieds\n        End Function\n\n        Private Sub IrrelevantProcedure(Value As Integer)\n            'Do not set local fields\n        End Sub\n\n        Private Function GetByBody() As Integer\n            Return _BodyValue\n        End Function\n\n        Private Sub SetByBody(Value As Integer)\n            _BodyValue = Value\n        End Sub\n\n        Public Property TooNested As Integer\n            Get         ' Noncompliant, only one level Of nesting Is supported\n                Return GetTooNestedA()\n            End Get\n            Set(value As Integer)  ' Noncompliant, only one level Of nesting Is supported\n                SetTooNestedA(value)\n            End Set\n        End Property\n\n        Private Function GetTooNestedA() As Integer\n            Return GetTooNestedB()\n        End Function\n\n        Private Sub SetTooNestedA(Value As Integer)\n            SetTooNestedB(Value)\n        End Sub\n\n        Private Function GetTooNestedB() As Integer\n            Return _TooNested\n        End Function\n\n        Private Sub SetTooNestedB(Value As Integer)\n            _TooNested = Value\n        End Sub\n\n        Public Property TooComplex As Integer\n            Get ' Noncompliant, only single return scenario is supported\n                If True Then\n                    Return GetTooComplex()\n                Else\n                    Return GetTooComplex()\n                End If\n            End Get\n            Set(Value As Integer) ' Noncompliant, only one function invocation is supported\n                If True Then\n                    SetTooComplex(Value)\n                Else\n                    SetTooComplex(Value)\n                End If\n            End Set\n        End Property\n\n        Private Function GetTooComplex() As Integer\n            Return _TooComplex\n        End Function\n\n        Private Sub SetTooComplex(Value As Integer)\n            _TooComplex = Value\n        End Sub\n\n    End Class\n\n    ' https://github.com/SonarSource/sonar-dotnet/issues/3441\n    Public Class Repro3441\n        Private ReadOnly _data As List(Of Integer) = New List(Of Integer)()\n\n        Public Property Data As List(Of Integer)\n            Get\n                Return _data\n            End Get\n            Private Set(ByVal value As List(Of Integer)) ' Noncompliant\n                For Each item In value\n                    _data.Add(item)\n                Next\n            End Set\n        End Property\n    End Class\n\n#If NETFRAMEWORK Then ' System.Windows.Controls.Primitives.ButtonBase is in a different assembly in NETCOREAPP\n    ' https://github.com/SonarSource/sonar-dotnet/issues/3442\n    ' Also see \"Add WPF support in unit tests when targeting .Net Core\" https://github.com/SonarSource/sonar-dotnet/issues/4883\n    Public Class SampleFor3442\n        Inherits System.Windows.Controls.Primitives.ButtonBase\n\n        Public Shared ReadOnly IsSpinningProperty As DependencyProperty = DependencyProperty.Register(\"IsSpinning\", GetType(Boolean), GetType(SampleFor3442))\n\n        Public Property IsSpinning As Boolean\n            Get\n                Return CBool(GetValue(IsSpinningProperty))\n            End Get\n            Set(ByVal value As Boolean)\n                SetValue(IsSpinningProperty, value)\n            End Set\n        End Property\n    End Class\n#End If\n\n    Public Class TestCases\n        Private pause_ As Boolean\n\n        Public Property Pause As Boolean\n            Get\n                Return pause_\n            End Get\n            Set(ByVal value As Boolean)\n                pause_ = pause_ Or value\n            End Set\n        End Property\n\n        Private textBufferUndoHistory_ As Integer\n\n        Public ReadOnly Property TextBufferUndoHistory As Integer\n            Get\n                Return textBufferUndoHistory_ = GetValue()\n            End Get\n        End Property\n\n        Private Shared Function GetValue() As Integer\n            Return 1\n        End Function\n\n        ' https://github.com/SonarSource/sonar-dotnet/issues/5259\n        Private attributes_ As Integer()\n        Public WriteOnly Property Attributes As Integer()\n            Set(ByVal value As Integer()) ' Noncompliant - FP\n                value.CopyTo(attributes_, 0)\n            End Set\n        End Property\n\n        Private Const PREFIX_ As String = \"pre\"\n        Private m_prefix As String\n\n        Public Property Prefix As String\n            Get\n                Return m_prefix ' Compliant - PREFIX is const\n            End Get\n            Set(ByVal value As String)\n                m_prefix = value\n            End Set\n        End Property\n    End Class\n\n    Public Class ContainsConstraint\n        Private _ignoreCase As Boolean\n\n        Public ReadOnly Property IgnoreCase As ContainsConstraint\n            Get ' Compliant - _IgnoreCase has different type\n                _ignoreCase = True\n                Return Me\n            End Get\n        End Property\n    End Class\n\n    Public Class AClass\n        Public Shared WRITE_LOCK_TIMEOUT As Long = 1000\n        Public longValue As Long\n\n        Public Property WriteLockTimeout As Long\n            Get\n                Return longValue ' Compliant - WRITE_LOCK_TIMEOUT is shared field when the property is not shared.\n            End Get\n            Set(ByVal value As Long)\n                longValue = value\n            End Set\n        End Property\n\n        Public Shared TEST_STATIC_CASE As Long = 1000\n        Public Shared ALong As Long = 2000\n\n        Public Shared Property TestStaticCase As Long\n            Get\n                Return ALong ' Noncompliant\n            End Get\n            Set(ByVal value As Long)\n                ALong = value ' Noncompliant\n            End Set\n        End Property\n    End Class\n\n    ' https://sonarsource.atlassian.net/browse/NET-1678\n    Public Class A\n        Private _chargeId as Integer\n\n        Protected Overridable Property ChargeId As Integer\n            Get\n                Return _chargeId\n            End Get\n            Set(value As Integer)\n                If (value <> _chargeId)\n                    _chargeId = value ' strictly speaking, we're doing other validation, but a scenario where auto properties aren't a solution\n                End If\n            End Set\n        End Property\n    End Class\n\n    Public Class B\n        Inherits A\n\n        ' Override property that delegates to MyBase.ChargeId should be compliant\n        Protected Overrides Property ChargeId As Integer\n            Get ' Compliant\n                Return If(true, MyBase.ChargeId, 1234)\n            End Get\n            Set(value As Integer) ' Compliant\n                MyBase.ChargeId = value\n            End Set\n        End Property\n    End Class\n\n    ' https://github.com/SonarSource/sonar-dotnet/issues/9688\n    Public Class Repro_9688\n        Private _feedback As String\n\n        Friend Property Feedback As String\n            Get\n                Return _feedback\n            End Get\n            Private Set(value As String)\n                _feedback &= value ' Compliant\n            End Set\n        End Property\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PropertiesShouldBePreferred.CSharp10.cs",
    "content": "﻿public record struct RecordStruct\n{\n    public RecordStruct() { }\n\n    private string name = \"\";\n\n    public string GetName() // Noncompliant {{Consider making method 'GetName' a property.}}\n    //            ^^^^^^^\n    {\n        return name;\n    }\n\n    public object GetName2() => null;  // Noncompliant\n    private string GetName3() => null; // Compliant\n    public string Property { get; set; } = \"\";\n}\n\npublic record struct PositionalRecordStruct(string Parameter)\n{\n    private string name = \"\";\n\n    public string GetName()            // Noncompliant\n    {\n        return name;\n    }\n\n    public object GetName2() => null;  // Noncompliant\n    private string GetName3() => null; // Compliant\n    public string Property { get; set; } = \"\";\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PropertiesShouldBePreferred.CSharp11.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\n\nnamespace MyLibrary\n{\n    public interface IBase\n    {\n        static abstract string GetStuff(); // Noncompliant\n    }\n\n    public class SomeClass : IBase\n    {\n        public static string GetStuff() => \"\";\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PropertiesShouldBePreferred.CSharp9.cs",
    "content": "﻿public record RecordBase\n{\n    public virtual string GetFooMethod() => \"\"; // Noncompliant\n}\n\npublic record Record : RecordBase\n{\n    private string name;\n\n    public string GetName() // Noncompliant\n    {\n        return name;\n    }\n\n    public override string GetFooMethod() => \"\"; // Compliant\n\n    public object GetName2() => null; // Noncompliant\n\n    protected string GetName3() => null; // Noncompliant\n\n    protected internal string GetName4() => null; // Noncompliant\n\n    private string GetName5() => null; // Compliant\n\n    public string Property { get; set; }\n}\n\npublic record PositionalRecord(string Parameter) : RecordBase\n{\n    private string name;\n\n    public string GetName() // Noncompliant\n    {\n        return name;\n    }\n\n    public override string GetFooMethod() => \"\"; // Compliant\n\n    public object GetName2() => null; // Noncompliant\n\n    protected string GetName3() => null; // Noncompliant\n\n    protected internal string GetName4() => null; // Noncompliant\n\n    private string GetName5() => null; // Compliant\n\n    public string Property { get; set; }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PropertiesShouldBePreferred.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\n\nnamespace MyLibrary\n{\n    public class Foo\n    {\n        public virtual string GetFooMethod() => \"\"; // Noncompliant\n    }\n\n    public class Bar : Foo, IEnumerable<string>\n    {\n        private string name;\n\n        public string GetName()\n//                    ^^^^^^^ Noncompliant {{Consider making method 'GetName' a property.}}\n        {\n            return name;\n        }\n\n        public override string GetFooMethod() => \"\"; // Compliant - override method\n\n        public IEnumerator<string> GetEnumerator() => null; // Compliant - comes from interface\n\n        IEnumerator IEnumerable.GetEnumerator() => null; // Compliant - explicit interface implementation\n\n        public object Get() => null;\n\n        private string GetName2() => null;\n\n        public string[] GetName3() => null;\n\n        public object GetName4() => null; // Noncompliant\n\n        public List<int> GetName5() => null; // Noncompliant\n\n        public List<int> NameGet6() => null;\n\n        public string GetName7(int param) => null;\n\n        protected string GetName8() => null; // Noncompliant\n\n        protected internal string GetName9() => null; // Noncompliant\n\n        internal string GetName10() => null;\n\n        public string GetProperty1 { get; set; }\n\n        public string Property1 { get; set; }\n\n        public string GetProperty2 { get { return \"\"; } }\n\n        public string Property2 { get { return \"\"; } }\n    }\n\n    public interface IBase\n    {\n        string GetStuff(); // Noncompliant\n    }\n\n    public struct SomeStruct\n    {\n        public string GetStuff() { return \"\"; } // Noncompliant\n    }\n\n    public interface IFoo\n    {\n        // See https://github.com/SonarSource/sonar-dotnet/issues/1593\n        // and https://msdn.microsoft.com/en-us/magazine/mt797654.aspx\n        IMyEnumerator GetEnumerator();\n    }\n\n    public interface IMyEnumerator\n    {\n        int Current { get; }\n        bool MoveNext();\n    }\n\n    // See https://github.com/SonarSource/sonar-dotnet/issues/2238\n    #region GetAwaiter\n    public class CustomAwaiter\n    {\n        public CustomAwaiter(int simulateDelayMilliseconds)\n        {\n        }\n    }\n\n    public class CustomAwaiter<T> : CustomAwaiter\n    {\n        public CustomAwaiter(int simulateDelayMilliseconds, T result)\n            : base(simulateDelayMilliseconds)\n        {\n        }\n    }\n\n    public class CustomAwaitable\n    {\n        protected readonly int _simulateDelayMilliseconds;\n\n        public CustomAwaitable(int simulateDelayMilliseconds)\n        {\n            _simulateDelayMilliseconds = simulateDelayMilliseconds;\n        }\n\n        public CustomAwaiter GetAwaiter() // Compliant, name is excluded\n        {\n            return new CustomAwaiter(_simulateDelayMilliseconds);\n        }\n    }\n\n    public class CustomAwaitable<T> : CustomAwaitable\n    {\n        private readonly T _result;\n\n        public CustomAwaitable(int simulateDelayMilliseconds, T result)\n            : base(simulateDelayMilliseconds)\n        {\n            _result = result;\n        }\n\n        public new CustomAwaiter<T> GetAwaiter() // Compliant, name is excluded\n        {\n            return new CustomAwaiter<T>(_simulateDelayMilliseconds, _result);\n        }\n    }\n    #endregion // GetAwaiter\n\n    public class AsyncTests\n    {\n        public async void GetResultAsync() // Compliant - use async\n        {\n            await Task.FromResult(true).ConfigureAwait(false);\n        }\n\n        public Task GetSomething1() => Task.FromResult(true); // Compliant - return type is Task\n        public Task<bool> GetSomething2() => Task.FromResult(true); // Compliant - return type is Task<T>\n        public ValueTask<bool> GetSomething3() => default(ValueTask<bool>); // Compliant - return type is ValueTask<T>\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/3140\n    public class Repro_3136\n    {\n        private static readonly Random rnd = new Random();\n\n        [NoProperty]\n        public int GetRandom() => rnd.Next(); // Compliant\n\n        [NoProperty]\n        [PropertyOrMethod]\n        public string GetBothSupportedAndNotSupportedPropertyUsage() => \"\"; // Compliant\n\n        [PropertyOrMethod]\n        public int GetUsageIncludingProperty() => 42; // Noncompliant\n\n        [AllTargets]\n        public int GetUsageForAll() => 17; // Noncompliant\n\n        [AllTargets]\n        [PropertyOrMethod]\n        public int GetUsageForAll2() => 17; // Noncompliant\n\n        [NoUsageDefined]\n        public int GetNoUsagedDefined() => 666; // Noncompliant\n\n        [AttributeUsage(AttributeTargets.All)]\n        private sealed class AllTargetsAttribute : Attribute { }\n\n        [AttributeUsage(AttributeTargets.Property | AttributeTargets.Method)]\n        private sealed class PropertyOrMethodAttribute : Attribute { }\n\n        [AttributeUsage(AttributeTargets.All ^ AttributeTargets.Property)]\n        private sealed class NoPropertyAttribute : Attribute { }\n\n        private sealed class NoUsageDefinedAttribute : Attribute { }\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/8739\npublic class Repro_8739\n{\n    private object[] items;\n\n    public IEnumerable<T> GetNodes<T>() =>\n        Calculate<T>();\n\n    public IEnumerable<T> GetNodesOriginal<T>() where T : Exception =>\n        items.OfType<T>();\n\n    private static IEnumerable<T> Calculate<T>() => null;\n\n    public class GenericType<T>\n    {\n        public IEnumerable<T> GetNodes() =>  // Noncompliant, this can be a property\n            Calculate<T>();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PropertyGetterWithThrow.Latest.Partial.cs",
    "content": "﻿using System;\n\nnamespace CSharp13\n{\n    public partial class PartialProperties\n    {\n        public partial int MyProperty { get; }\n        public partial int MyProperty2 { get; }\n        public partial int MyProperty3 { get; }\n        public partial int MyProperty4 { get; set; }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PropertyGetterWithThrow.Latest.cs",
    "content": "﻿using System;\n\nnamespace CSharp13\n{\n    public partial class PartialProperties\n    {\n        public partial int MyProperty\n        {\n            get\n            {\n                var x = 5;\n                throw new NotSupportedException(); // Compliant\n            }\n        }\n        public partial int MyProperty2\n        {\n            get\n            {\n                throw new NotImplementedException(); // Compliant\n            }\n        }\n        public partial int MyProperty3\n        {\n            get\n            {\n                throw new PlatformNotSupportedException(); // Compliant\n            }\n        }\n        public partial int MyProperty4\n        {\n            get\n            {\n                throw new Exception(); // Noncompliant {{Remove the exception throwing from this property getter, or refactor the property into a method.}}\n    //          ^^^^^^^^^^^^^^^^^^^^^^\n            }\n\n            set\n            {\n                throw new Exception(); // Compliant\n            }\n        }\n    }\n}\n\npublic class FieldKeyword\n{\n    public int Property\n    {\n        get { return field; }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PropertyGetterWithThrow.cs",
    "content": "﻿namespace Tests.Diagnostics\n{\n    using System;\n\n    public class PropertyGetterWithThrow\n    {\n        public int MyProperty\n        {\n            get\n            {\n                var x = 5;\n                throw new NotSupportedException(); // Compliant\n            }\n        }\n        public int MyProperty2\n        {\n            get\n            {\n                throw new NotImplementedException(); // Compliant\n            }\n        }\n        public int MyProperty3\n        {\n            get\n            {\n                throw new PlatformNotSupportedException(); // Compliant\n            }\n        }\n        public int MyProperty4\n        {\n            get\n            {\n                throw new Exception(); // Noncompliant {{Remove the exception throwing from this property getter, or refactor the property into a method.}}\n//              ^^^^^^^^^^^^^^^^^^^^^^\n            }\n        }\n        public int MyProperty5\n        {\n            get\n            {\n                return 42;\n            }\n            set\n            {\n                throw new Exception(); // Compliant - setters are ignored by this rule\n            }\n        }\n        public int MyProperty6\n        {\n            get\n            {\n                throw new InvalidOperationException(); // Compliant\n            }\n        }\n        public int MyProperty7\n        {\n            get\n            {\n                throw new ObjectDisposedException(\"\"); // Compliant\n            }\n        }\n        public int MyProperty8\n        {\n            get\n            {\n                try\n                {\n                }\n                catch(Exception)\n                {\n                    throw; // Compliant\n                }\n\n                return 0;\n            }\n        }\n        public int this[int i]\n        {\n            get\n            {\n                throw new System.Exception(); // Compliant - indexed getters are ignored by this rule\n            }\n            set\n            {\n            }\n        }\n        public int MyProperty9\n        {\n            get\n            {\n                throw FactoryMethod(); // Compliant\n            }\n        }\n        private NotSupportedException FactoryMethod()\n        {\n            return new NotSupportedException();\n        }\n        public int MyProperty10\n        {\n            get\n            {\n                throw FactoryMethod2(); // Noncompliant {{Remove the exception throwing from this property getter, or refactor the property into a method.}}\n//              ^^^^^^^^^^^^^^^^^^^^^^^\n            }\n        }\n        private Exception FactoryMethod2()\n        {\n            return new Exception();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PropertyGetterWithThrow.vb",
    "content": "﻿Imports System\nNamespace Tests.Diagnostics\n    Public Class PropertyGetterWithThrow\n        Public Property Foo1() As Integer\n            Get\n                Throw New Exception() ' Noncompliant\n'               ^^^^^^^^^^^^^^^^^^^^^\n            End Get\n            Set(ByVal value As Integer)\n                ' ... some code ...\n            End Set\n        End Property\n        Public Property Foo2() As Integer\n            Get\n                Throw New NotImplementedException() ' Compliant\n            End Get\n            Set(ByVal value As Integer)\n                ' ... some code ...\n            End Set\n        End Property\n        Public Property Foo3() As Integer\n            Get\n                Throw New NotSupportedException() ' Compliant\n            End Get\n            Set(ByVal value As Integer)\n                ' ... some code ...\n            End Set\n        End Property\n        Public Property Foo4() As Integer\n            Get\n                Throw New PlatformNotSupportedException() ' Compliant\n            End Get\n            Set(ByVal value As Integer)\n                ' ... some code ...\n            End Set\n        End Property\n        Public ReadOnly Property Foo5() As Integer\n            Get\n                Return 1\n            End Get\n        End Property\n        Public ReadOnly Property Foo6() As Integer\n            Get\n                Throw New InvalidOperationException() ' Compliant\n            End Get\n        End Property\n        Public ReadOnly Property Foo7() As Integer\n            Get\n                Throw New ObjectDisposedException(\"foo\") ' Compliant\n            End Get\n        End Property\n        Public Property Item(ByVal index As Long) As Byte ' Indexed properties are ignored\n            Get\n                Throw New NotImplementedException\n            End Get\n            Set(ByVal Value As Byte)\n\n            End Set\n        End Property\n        Public ReadOnly Property Foo9() As Integer\n            Get\n                Throw FactoryMethod() ' Compliant\n            End Get\n        End Property\n        private Function FactoryMethod() as NotSupportedException\n            return new NotSupportedException()\n        End Function\n        Public ReadOnly Property Foo10() As Integer\n            Get\n                Throw FactoryMethod2() ' Noncompliant\n'               ^^^^^^^^^^^^^^^^^^^^^^\n            End Get\n        End Property\n        private Function FactoryMethod2() as Exception\n            return new Exception()\n        End Function\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PropertyName.vb",
    "content": "﻿Namespace Tests.Diagnostics\n    Module Module1\n        Public Property foo As Integer   ' Noncompliant\n        Public Property FooFoo As Integer\n\n        Dim array As String()\n\n        ReadOnly Property foooo(ByVal index As Integer) ' Noncompliant\n            Get\n                Return array(index)\n            End Get\n        End Property\n    End Module\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PropertyNamesShouldNotMatchGetMethods.Latest.Partial1.g.cs",
    "content": "﻿//------------------------------------------------------------------------------ \n// <auto-generated> \n// This code was generated by no one. Hand-crafted with love by me.\n// Runtime Version:2.0.50727.42 \n// \n// Changes to this file may cause incorrect behavior and will be lost if \n// the code is regenerated. But you can't! AHA!\n// </auto-generated> \n//------------------------------------------------------------------------------\n\nusing System;\n\npublic partial class PartialCrossFile\n{\n    public partial int Foo { get => 1; } // Issue filtered: generated file\n    public partial int GetFoo(); // Issue filtered: generated file\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PropertyNamesShouldNotMatchGetMethods.Latest.Partial2.cs",
    "content": "﻿using System;\n\npublic partial class PartialCrossFile\n{\n    public partial int GetFoo() => 1;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PropertyNamesShouldNotMatchGetMethods.Latest.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public record Base\n    {\n        public virtual int MyProperty { get; set; }\n    }\n\n    public record Record : Base\n    {\n        public int Foo // Noncompliant\n        { get; set; }\n        public int GetFoo() // Secondary\n        { return 1; }\n\n        public DateTime Date { get; }\n        public string GetDateAsString()\n        {\n            return Date.ToString();\n        }\n\n        public string Bar // Noncompliant\n        { get; }\n        // Error@+1 [CS0102]\n        public int Bar()    // Secondary\n        //         ^^^\n        {\n            return 42;\n        }\n\n        private string Color { get; } // Compliant - property is private\n        public string GetColor() { return \"\"; }\n\n        public string Day { get; } // Compliant - method is private\n        private string GetDay() { return \"\"; }\n\n        protected string Whatever // Noncompliant\n        { get; }\n\n        public string GetWhatever() // Secondary\n        {\n            return \"\";\n        }\n\n        public string SomeWeirdCase // Noncompliant\n        { get; }\n\n        public string SOMEWEIRDCASE() // Secondary\n        {\n            return \"\";\n        }\n\n        public override int MyProperty { get; set; } // Compliant - override\n        public int GetMyProperty() => 42;\n    }\n\n    public record PositionalRecord : Base\n    {\n        public int Foo // Noncompliant\n        { get; set; }\n        public int GetFoo() // Secondary\n        { return 1; }\n\n        public DateTime Date { get; }\n        public string GetDateAsString()\n        {\n            return Date.ToString();\n        }\n\n        public string Bar // Noncompliant\n        { get; }\n        public int Bar() // Error [CS0102]\n                         // Secondary@-1\n        {\n            return 42;\n        }\n\n        private string Color { get; } // Compliant - property is private\n        public string GetColor() { return \"\"; }\n\n        public string Day { get; } // Compliant - method is private\n        private string GetDay() { return \"\"; }\n\n        protected string Whatever // Noncompliant\n        { get; }\n\n        public string GetWhatever() // Secondary\n        {\n            return \"\";\n        }\n\n        public string SomeWeirdCase // Noncompliant\n        { get; }\n\n        public string SOMEWEIRDCASE() // Secondary\n        {\n            return \"\";\n        }\n\n        public override int MyProperty { get; set; } // Compliant - override\n        public int GetMyProperty() => 42;\n    }\n\n    public record struct RecordStruct\n    {\n        public int Foo // Noncompliant\n        { get; set; }\n        public int GetFoo() // Secondary\n        { return 1; }\n\n        public DateTime Date { get; }\n        public string GetDateAsString()\n        {\n            return Date.ToString();\n        }\n\n        public string Bar   // Noncompliant\n        { get; }\n        public int Bar()    // Error [CS0102]\n                            // Secondary@-1\n        {\n            return 42;\n        }\n\n        private string Color { get; }   // Compliant - property is private\n        public string GetColor() { return \"\"; }\n\n        public string Day { get; }      // Compliant - method is private\n        private string GetDay() { return \"\"; }\n\n        public string GetWhatever()\n        {\n            return \"\";\n        }\n\n        public string SomeWeirdCase // Noncompliant\n        { get; }\n\n        public string SOMEWEIRDCASE() // Secondary\n        {\n            return \"\";\n        }\n\n        public int GetMyProperty() => 42;\n    }\n\n    public record struct PositionalRecordStruct\n    {\n        public int Foo // Noncompliant\n        { get; set; }\n        public int GetFoo() // Secondary\n        { return 1; }\n\n        public DateTime Date { get; }\n        public string GetDateAsString()\n        {\n            return Date.ToString();\n        }\n\n        public string Bar   // Noncompliant\n        { get; }\n        public int Bar()    // Error [CS0102]\n                            // Secondary@-1\n        {\n            return 42;\n        }\n\n        private string Color { get; } // Compliant - property is private\n        public string GetColor() { return \"\"; }\n\n        public string Day { get; } // Compliant - method is private\n        private string GetDay() { return \"\"; }\n\n        public string GetWhatever()\n        {\n            return \"\";\n        }\n\n        public string SomeWeirdCase // Noncompliant\n        { get; }\n\n        public string SOMEWEIRDCASE() // Secondary\n        {\n            return \"\";\n        }\n\n        public int GetMyProperty() => 42;\n    }\n\n    // https://sonarsource.atlassian.net/browse/NET-543\n    public partial class PartialProperties\n    {\n        public partial int Foo { get; }       // Noncompliant {{Change either the name of property 'Foo' or the name of method 'GetFoo' to make them distinguishable.}}\n\n        public void GetFoo() { }              // Secondary\n    }\n\n    public partial class PartialProperties\n    {\n        public partial int Foo { get => 42; } // Noncompliant {{Change either the name of property 'Foo' or the name of method 'GetFoo' to make them distinguishable.}}\n    }\n}\n\npublic partial class PartialCrossFile\n{\n    public partial int Foo { get; } // Noncompliant {{Change either the name of property 'Foo' or the name of method 'GetFoo' to make them distinguishable.}}\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PropertyNamesShouldNotMatchGetMethods.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class Base\n    {\n        public virtual int MyProperty { get; set; }\n    }\n\n    public class Program : Base\n    {\n        public int Foo // Noncompliant {{Change either the name of property 'Foo' or the name of method 'GetFoo' to make them distinguishable.}}\n//                 ^^^\n        { get; set; }\n        public int GetFoo()\n//                 ^^^^^^ Secondary\n        { return 1; }\n\n        public DateTime Date { get; }\n        public string GetDateAsString()\n        {\n            return Date.ToString();\n        }\n\n        public string Bar // Noncompliant {{Change either the name of property 'Bar' or the name of method 'Bar' to make them distinguishable.}}\n//                    ^^^\n        { get; }\n        // Error@+1 [CS0102]\n        public int Bar()    // Secondary\n//                 ^^^\n        {\n            return 42;\n        }\n\n        private string Color { get; } // Compliant - property is private\n        public string GetColor() { return \"\"; }\n\n        public string Day { get; } // Compliant - method is private\n        private string GetDay() { return \"\"; }\n\n        protected string Whatever // Noncompliant\n        { get; }\n\n        public string GetWhatever() // Secondary\n        {\n            return \"\";\n        }\n\n        public string SomeWeirdCase // Noncompliant\n        { get; }\n\n        public string SOMEWEIRDCASE() // Secondary\n        {\n            return \"\";\n        }\n\n        public override int MyProperty { get; set; } // Compliant - override\n        public int GetMyProperty() => 42;\n    }\n\n    public struct SomeStruct\n    {\n        public int Foo      // Noncompliant\n        { get; set; }\n        public int GetFoo() // Secondary\n        { return 1; }\n\n        public DateTime Date { get; }\n        public string GetDateAsString()\n        {\n            return Date.ToString();\n        }\n\n        public string Bar   // Noncompliant\n        { get; }\n        public int Bar()    // Error [CS0102]\n                            // Secondary@-1\n        {\n            return 42;\n        }\n\n        private string Color { get; } // Compliant - property is private\n        public string GetColor() { return \"\"; }\n\n        public string Day { get; } // Compliant - method is private\n        private string GetDay() { return \"\"; }\n\n        public string GetWhatever()\n        {\n            return \"\";\n        }\n\n        public string SomeWeirdCase // Noncompliant\n        { get; }\n\n        public string SOMEWEIRDCASE() // Secondary\n        {\n            return \"\";\n        }\n\n        public int GetMyProperty() => 42;\n    }\n\n    public interface ISomething\n    {\n        int Value { get; set; }  // Noncompliant\n        int GetValue();          // Secondary\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PropertyToAutoProperty.Latest.cs",
    "content": "﻿using System;\n\npublic class MyAttribute : Attribute { }\n\npublic unsafe record Record\n{\n    private string field1;\n    private string field2;\n    private int prop;\n    private Coord* coord1; // Error [CS8908]\n    private Coord coord2;\n    private Record r;\n\n    [My()]\n    private int fieldWithAttribute;\n    public int Compliant\n    {\n        get { return fieldWithAttribute; }\n        set { fieldWithAttribute = value; }\n    }\n\n    public string PropWithGetAndSet // Noncompliant\n    {\n        get { return field1; }\n        set { field1 = value; }\n    }\n\n    public string PropWithGetAndInit // Noncompliant\n    {\n        get { return field2; }\n        init { field2 = value; }\n    }\n\n    public string AutoPropWithGetAndInit { get; init; } // Compliant\n\n    public int Prop1 { get; get; } // Error [CS1007]\n\n    public int Prop2\n    {\n        get\n        {\n            return prop;\n        }\n\n        set\n        {\n            prop += 1;\n        }\n    }\n\n    public int Prop3\n    {\n        get\n        {\n            return coord1->X;\n        }\n        set\n        {\n            prop += 1;\n        }\n    }\n\n    public int Prop4\n    {\n        get\n        {\n            return r.coord2.X;\n        }\n        set\n        {\n            prop = value;\n        }\n    }\n}\n\npublic struct Coord\n{\n    public int X;\n}\n\nnamespace CSharp13\n{\n    // https://sonarsource.atlassian.net/browse/NET-456\n    public partial class PartialProperties\n    {\n        private string field;\n        private int[] array = new int[100];\n\n        public partial string Prop // Compliant\n        {\n            get { return field; }\n            set { field = value; }\n        }\n\n        public partial int this[int index]\n        {\n            get { return array[index]; }\n            set { array[index] = value; }\n        }\n    }\n\n    public partial class PartialProperties\n    {\n        public partial string Prop { get; set; }\n\n        public partial int this[int index] { get; set; }\n    }\n}\n\npublic class FieldKeyword\n{\n    public string BodyProp1                                         // Noncompliant https://sonarsource.atlassian.net/browse/NET-2813\n    {\n        get { return field; }\n        set { field = value; }\n    }\n    public string BodyProp3                                         // Compliant\n    {\n        set { field = value; }\n    }\n    public string BodyProp2                                         // Compliant FN https://sonarsource.atlassian.net/browse/NET-2943\n    {\n        get { return field; }\n    }\n    private int ArrowProp1 { get => field; set => field = value; }  // Noncompliant\n    private int ArrowProp2 { set => field = value; }\t            // Compliant\n    private int ArrowProp3 { get => field; }                        // Compliant FN https://sonarsource.atlassian.net/browse/NET-2943\n\n    private int ArrowProp => field;                                // Noncompliant\n}\n\npublic static class Extensions\n{\n    extension(string s)\n    {\n        public int Length => s.Length;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PropertyToAutoProperty.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public class MyAttribute : Attribute { }\n\n    public class SomeException : Exception { }\n\n    public class PropertyToAutoProperty\n    {\n        static public implicit operator int (PropertyToAutoProperty x)\n        {\n            return 1;\n        }\n        static public implicit operator PropertyToAutoProperty(int x)\n        {\n            return null;\n        }\n\n        private int backingField;\n        public PropertyToAutoProperty Prop //Compliant\n        {\n            get { return backingField; }\n            set { backingField = value; }\n        }\n\n        [My()]\n        private int field2;\n        public int Prop2 //Compliant\n        {\n            get { return field2; }\n            set { field2 = value; }\n        }\n\n        private string _make;\n        public string Make // Noncompliant\n//                    ^^^^\n        {\n            get { return _make; }\n            set { this._make = value; }\n        }\n\n        public string MakeModif\n        {\n            get { return _make; }\n            private set { this._make = value; }\n        }\n\n        PropertyToAutoProperty instance = new PropertyToAutoProperty();\n        public string Make5 // Compliant\n        {\n            get { return _make; }\n            set { instance._make = value; }\n        }\n\n        private static string _make3;\n        public static string Make3 // Noncompliant {{Make this an auto-implemented property and remove its backing field.}}\n        {\n            get { return _make3; }\n            set { PropertyToAutoProperty._make3 = value; }\n        }\n\n        public static string Make3Modif\n        {\n            get { return _make3; }\n            internal set { PropertyToAutoProperty._make3 = value; }\n        }\n\n        public static string Make3Attr\n        {\n            get { return _make3; }\n            [My]\n            set { PropertyToAutoProperty._make3 = value; }\n        }\n\n        public static string Make4 // Compliant\n        {\n            get { return _make3; }\n            set { PropertyToAutoProperty._make3 += value; }\n        }\n\n        public string Make9 // Compliant, returns a static field\n        {\n            get { return _make3; }\n            set { _make3 = value; }\n        }\n\n        public string Make2\n        {\n            get { return _make; }\n            set\n            {\n                if (value == null)\n                {\n                    throw new SomeException();\n                }\n                _make = value;\n            }\n        }\n\n        public int Readonly => 1;\n\n        // C# 7 should not throw\n        public int Property01 //Noncompliant\n        {\n            get => backingField;\n            set => backingField = value;\n        }\n    }\n\n    public class SomePropertyToAutoProperty\n    {\n        private int backingField;\n\n        public int Property01 //Noncompliant\n        {\n            get => backingField;\n            set => backingField = value;\n        }\n    }\n\n    public class VolatileField\n    {\n        private volatile int backingField;\n\n        public int Property01 // Compliant - cannot have volatile autoproperty\n        {\n            get => backingField;\n            set => backingField = value;\n        }\n    }\n\n    public class SingleAccessorAutoProperty\n    {\n        private int backingGet;\n        private int backingGetArrow;\n        private int backingSet;\n        private int backingSetArrow;\n        public int GetterOnlyArrow  // Compliant FN https://sonarsource.atlassian.net/browse/NET-2943\n        {\n            get => backingGetArrow;\n        }\n        public int SetterOnlyArrow  // Compliant - Auto-implemented properties must have get accessors\n        {\n            set => backingSetArrow = value;\n        }\n\n        public int GetterOnlyReturn // Compliant FN https://sonarsource.atlassian.net/browse/NET-2943\n        {\n            get { return backingGet; }\n        }\n        public int SetterOnly       // Compliant - Auto-implemented properties must have get accessors\n        {\n            set { backingSet = value; }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PropertyWithArrayType.vb",
    "content": "﻿Module Module1\n\n    ' Internal state\n    Dim Array = {\"apple\", \"banana\", \"orange\", \"pineapple\", \"strawberry\"}\n\n    Public Property NotAProblem As Byte()   'Compliant, this doens't copy anything inside\n\n    ReadOnly Property Foo As String()   ' Noncompliant {{Refactor 'Foo' into a method, properties should not be based on arrays.}}\n        '             ^^^\n        Get\n            Dim copy = Array.Clone      ' Expensive call\n            Return copy\n        End Get\n    End Property\n\n    Property Foo2() As String()         ' Noncompliant\n        Get\n            Dim copy = Array.Clone      ' Expensive call\n            Return copy\n        End Get\n        Set(value As String())\n        End Set\n    End Property\n\n    Property Foo3() As String\n        Get\n            Return \"aaa\"\n        End Get\n        Set(value As String)\n        End Set\n    End Property\n\nEnd Module\n\nPublic Interface IBase\n\n    ReadOnly Property Hash As Byte()    ' Noncompliant\n\nEnd Interface\n\nPublic MustInherit Class Base\n\n    Public MustOverride Property Bad As Byte()  ' Noncompliant\n\nEnd Class\n\nPublic Class Sample\n    Inherits Base\n    Implements IBase\n\n    Public ReadOnly Property Hash As Byte() Implements IBase.Hash   ' Compliant, this class cannot change interface signature\n        Get\n        End Get\n    End Property\n\n    Public Overrides Property Bad As Byte() ' Compliant, this class cannot change overriden property signature\n        Get\n        End Get\n        Set(value As Byte())\n        End Set\n    End Property\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PropertyWriteOnly.Latest.Partial.cs",
    "content": "﻿namespace CSharp13\n{\n    public partial class PartialProperties\n    {\n        public partial int Foo { set; } // Noncompliant\n        public partial int Foo2 { get; set; }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PropertyWriteOnly.Latest.cs",
    "content": "﻿record PropertyWriteOnly\n{\n    public int Foo1  // Noncompliant {{Provide a getter for 'Foo1' or replace the property with a 'SetFoo1' method.}}\n    {\n        init { }\n    }\n\n    public int Foo2 { set { } } // Noncompliant {{Provide a getter for 'Foo2' or replace the property with a 'SetFoo2' method.}}\n\n    public int Foo3 { get { return 1; } set { } }\n}\n\nrecord PropertyWriteOnlyInPositionalRecord(int Parameter)\n{\n    private int foo1 = 5;\n\n    public int Foo1  // Noncompliant\n    {\n        init { foo1 = value; }\n    }\n\n    public int Foo2 { set { } } // Noncompliant {{Provide a getter for 'Foo2' or replace the property with a 'SetFoo2' method.}}\n\n    public int Foo3 { get { return 1; } set { } }\n}\n\nnamespace ReproIssue2390\n{\n    public record A\n    {\n        protected int m = 5;\n        public virtual int M\n        {\n            get { return m; }\n            init { m = value; }\n        }\n    }\n    public record B : A\n    {\n        public override int M // Compliant, getter is in base class\n        {\n            init { m = value + 1; }\n        }\n    }\n}\n\npublic interface IPropertyWriteOnly\n{\n    public static virtual int Foo  // Noncompliant {{Provide a getter for 'Foo' or replace the property with a 'SetFoo' method.}}\n    {\n        set\n        {\n            // ... some code ...\n        }\n    }\n}\n\nnamespace CSharp13\n{\n    public partial class PartialProperties\n    {\n        public partial int Foo  // Noncompliant {{Provide a getter for 'Foo' or replace the property with a 'SetFoo' method.}}\n//                         ^^^\n        {\n            set\n            {\n                // ... some code ...\n            }\n        }\n        public partial int Foo2\n        {\n            get\n            {\n                return 1;\n            }\n            set\n            {\n                // ... some code ...\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PropertyWriteOnly.cs",
    "content": "﻿namespace Tests.Diagnostics\n{\n    public class PropertyWriteOnly\n    {\n        public int Foo  // Noncompliant {{Provide a getter for 'Foo' or replace the property with a 'SetFoo' method.}}\n//                 ^^^\n        {\n            set\n            {\n                // ... some code ...\n            }\n        }\n        public int Foo2\n        {\n            get\n            {\n                return 1;\n            }\n            set\n            {\n                // ... some code ...\n            }\n        }\n    }\n\n    public struct PropertyWriteOnlyStruct\n    {\n        public int Foo  // Noncompliant {{Provide a getter for 'Foo' or replace the property with a 'SetFoo' method.}}\n//                 ^^^\n        {\n            set\n            {\n                // ... some code ...\n            }\n        }\n        public int Foo2\n        {\n            get\n            {\n                return 1;\n            }\n            set\n            {\n                // ... some code ...\n            }\n        }\n    }\n}\n\nnamespace ReproIssue2390\n{\n    public class A\n    {\n        protected int m = 5;\n        public virtual int M\n        {\n            get { return m; }\n            set { m = value; }\n        }\n    }\n    public class B : A\n    {\n        public override int M // compliant, getter is in base class\n        {\n            set { m = value + 1; }\n        }\n    }\n    public class Program\n    {\n        public static void Main(string[] args)\n        {\n            B b = new B();\n            System.Console.WriteLine(b.M);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PropertyWriteOnly.vb",
    "content": "﻿Namespace Tests.Diagnostics\n\n    Public Class PropertyWriteOnly\n        WriteOnly Property Foo() As Integer ' Noncompliant {{Provide a getter for 'Foo' or replace the property with a 'SetFoo' method.}}\n'                          ^^^\n            Set(ByVal value As Integer)\n                ' ... some code ...\n            End Set\n        End Property\n\n        Property Foo2() As Integer\n            Get\n                Return 1\n            End Get\n            Set(ByVal value As Integer)\n                ' ... some code ...\n            End Set\n        End Property\n\n    End Class\nEnd Namespace"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ProvideDeserializationMethodsForOptionalFields.Latest.cs",
    "content": "﻿using System;\nusing System.Runtime.Serialization;\n\n[Serializable]\npublic record Compliant\n{\n    [OptionalField]\n    int optionalField = 5;\n\n    [OnDeserializing]\n    void OnDeserializing(StreamingContext context)\n    {\n        optionalField = 5;\n    }\n\n    [OnDeserialized]\n    void OnDeserialized(StreamingContext context)\n    {\n        // Set optionalField if dependent on other deserialized values.\n    }\n}\n\npublic record NoEventHandlerMethods // Noncompliant\n{\n    [OptionalField]\n    int optionalField = 5;\n}\n\npublic record OnlyOnDeserializingEventHandlerMethod // Noncompliant\n{\n    [OptionalField]\n    int optionalField = 5;\n\n    [OnDeserializing]\n    void OnDeserializing(StreamingContext context) => optionalField = 5;\n}\n\n[Serializable]\npublic record Record // Noncompliant, attributes are added on local methods\n{\n    [OptionalField]\n    int optionalField = 5;\n\n    public Record()\n    {\n        [OnDeserializing]\n        void OnDeserializing(StreamingContext context) => optionalField = 5;\n\n        [OnDeserialized]\n        void OnDeserialized(StreamingContext context)\n        {\n            // Set optionalField if dependent on other deserialized values.\n        }\n    }\n}\n\npublic record NoEventHandlerMethodsWithParams(string Name) // Noncompliant\n{\n    [OptionalField]\n    int optionalField = 5;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ProvideDeserializationMethodsForOptionalFields.cs",
    "content": "﻿using System;\nusing System.Runtime.Serialization;\n\nnamespace Tests.Diagnostics\n{\n    public class NoEventHandlerMethods // Noncompliant {{Add deserialization event handlers.}}\n//               ^^^^^^^^^^^^^^^^^^^^^\n    {\n        [OptionalField]\n        int optionalField = 5;\n    }\n\n    public class OnlyOnDeserializingEventHandlerMethod // Noncompliant {{Add the missing 'OnDeserializedAttribute' event handler.}}\n    {\n        [OptionalFieldAttribute]\n        int optionalField = 5;\n\n        [OnDeserializing]\n        void OnDeserializing(StreamingContext context)\n        {\n            optionalField = 5;\n        }\n    }\n\n    public class OnlyOnDeserializedEventHandlerMethod // Noncompliant {{Add the missing 'OnDeserializingAttribute' event handler.}}\n    {\n        [OptionalField]\n        int optionalField = 5;\n\n        [OnDeserialized]\n        void OnDeserialized(StreamingContext context)\n        {\n            // Set optionalField if dependent on other deserialized values.\n        }\n    }\n\n    [Serializable]\n    public class Compliant\n    {\n        [OptionalField]\n        int optionalField = 5;\n\n        [OnDeserializing]\n        void OnDeserializing(StreamingContext context)\n        {\n            optionalField = 5;\n        }\n\n        [OnDeserialized]\n        void OnDeserialized(StreamingContext context)\n        {\n            // Set optionalField if dependent on other deserialized values.\n        }\n    }\n\n    public struct NoncompliantStruct // Noncompliant {{Add deserialization event handlers.}}\n    {\n        [OptionalField]\n        int optionalField;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ProvideDeserializationMethodsForOptionalFields.vb",
    "content": "﻿Imports System\nImports System.Runtime.Serialization\n\nNamespace Tests.Diagnostics\n    Public Class NoEventHandlerMethods ' Noncompliant {{Add deserialization event handlers.}}\n'                ^^^^^^^^^^^^^^^^^^^^^\n        <OptionalField>\n        Private optionalField As Integer = 5\n    End Class\n\n    Public Class OnlyOnDeserializingEventHandlerMethod '  Noncompliant {{Add the missing 'OnDeserializedAttribute' event handler.}}\n        <OptionalFieldAttribute>\n        Private optionalField As Integer = 5\n\n        <OnDeserializing>\n        Private Sub OnDeserializing(ByVal context As StreamingContext)\n            optionalField = 5\n        End Sub\n    End Class\n\n    Public Class OnlyOnDeserializedEventHandlerMethod ' Noncompliant {{Add the missing 'OnDeserializingAttribute' event handler.}}\n        <OptionalField>\n        Private optionalField As Integer = 5\n\n        <OnDeserialized>\n        Private Sub OnDeserialized(ByVal context As StreamingContext)\n        End Sub\n    End Class\n\n    <Serializable>\n    Public Class Compliant\n        <OptionalField>\n        Private optionalField As Integer = 5\n\n        <OnDeserializing>\n        Private Sub OnDeserializing(ByVal context As StreamingContext)\n            optionalField = 5\n        End Sub\n\n        <OnDeserialized>\n        Private Sub OnDeserialized(ByVal context As StreamingContext)\n        End Sub\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PublicConstantField.CSharp10.cs",
    "content": "﻿public record struct Record\n{\n    public Record() { }\n\n    private const int B = 5;\n    public int C = 5;\n    public const int A1 = 5; // Noncompliant {{Change this constant to a 'static' read-only property.}}\n\n    internal record Nested\n    {\n        public Nested() { }\n\n        public const int A = 5; // Compliant\n        private const int B = 5;\n    }\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PublicConstantField.CSharp9.cs",
    "content": "﻿public record Record\n{\n    private const nint B = 5;\n    public nint C = 5;\n    public const nint A1 = 5; // Noncompliant {{Change this constant to a 'static' read-only property.}}\n\n    internal record Nested\n    {\n        public const nint A = 5; // Compliant\n        private const nint B = 5;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PublicConstantField.cs",
    "content": "﻿namespace Tests.Diagnostics\n{\n    public class A\n    {\n        public const int A1 = 5; // Noncompliant {{Change this constant to a 'static' read-only property.}}\n//                       ^^\n        private const int B = 5;\n        public int C = 5;\n    }\n\n    internal class b\n    {\n        public const int A = 5; // Compliant\n        private const int B = 5;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PublicConstantField.vb",
    "content": "﻿Imports System\n\nNamespace Tests.Diagnostics\n    Public Class A\n        Public Const A As Integer = 5 ' Noncompliant {{Change this constant to a 'Shared Read-Only' property.}}\n'                    ^\n        Private Const B As Integer = 5\n        Public C As Integer = 5\n    End Class\n\n    Friend Class B\n        Public Const A As Integer = 5\n        Private Const B As Integer = 5\n        Public C As Integer = 5\n    End Class\nEnd Namespace"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PublicConstantFieldName.vb",
    "content": "﻿Class Foo\n    Public Shared ReadOnly Foo As Integer  ' Compliant\n\n    Public Const foo2 = 42 ' Noncompliant\n'                ^^^^\n    Public Shared FooFooFFFoooFF As Integer\n    Friend Const FooFooFFFFoooFF As Integer = 1 ' Noncompliant\n    Protected Const FooFooFFFFoooFFF As Integer = 1 ' Noncompliant\n    Protected ReadOnly FooFooFFFFoooFFFF As Integer\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PublicFieldName.vb",
    "content": "﻿Class Foo\n    Public Shared ReadOnly Foo As Integer  ' Compliant\n\n    Public Shared foo2 As Integer ' Noncompliant\n'                 ^^^^\n    Public Shared FooFooFFFoooFF As Integer\n    Friend ReadOnly FooFooFFFFoooFF As Integer ' Noncompliant\n    Protected FooFooFFFFoooFFF As Integer ' Noncompliant\n    Protected Const FooFooFFFFoooFFFF As Integer = 2\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PublicMethodWithMultidimensionalArray.Latest.Partial.cs",
    "content": "﻿\npublic partial class PartialConstructor\n{\n    public partial PartialConstructor(int[][] matrix) { } // Noncompliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PublicMethodWithMultidimensionalArray.Latest.cs",
    "content": "﻿namespace Tests.Diagnostics\n{\n    public interface IFace\n    {\n        static virtual void Method1(int[,] a) { } //Noncompliant\n\n        static abstract void Method2(int[,] a); //Noncompliant\n    }\n\n    public class PublicMethodWithMultidimensionalArray : IFace\n    {\n        public static void Method1(int[,] a) { } // Compliant\n\n        public static void Method2(int[,] a) { } // Compliant\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/8083\nnamespace Repro_8083\n{\n    using IntMatrix = int[][];\n\n    public class PrimaryConstructors\n    {\n        public class C0(int[] a);            // Compliant\n        public class C1(int[][] a);          // Noncompliant, the ctor is publicly exposed\n        public class C2(int[,] a);           // Noncompliant\n        public class C3(params int[] a);     // Compliant, params of int\n        public class C4(params int[][][] a); // Noncompliant, params of int[][]\n        public class C5(int i);              // Compliant, not a multi-dimensional array\n        public class C6(params int[][] a);   // Compliant\n    }\n\n    public class Aliases(IntMatrix a)                    // Noncompliant\n    {\n        public Aliases(IntMatrix a, int i) : this(a) { } // Noncompliant\n\n        public void AMethod1(IntMatrix a) { }            // Noncompliant\n        public void AMethod2(params IntMatrix a) { }     // Compliant\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/8100\nnamespace Repro_8100\n{\n    public class InlineArrays\n    {\n        public void AMethod1(Buffer[] a) { }          // FN, Buffer[] is 2-dimensional\n        public void AMethod1(Buffer[,] a) { }         // Noncompliant, Buffer[,] is 3-dimensional\n        public void AMethod2(params Buffer[] a) { }   // Compliant, params of Buffer\n        public void AMethod3(params Buffer[][] a) { } // FN, params of Buffer[]\n    }\n\n    [System.Runtime.CompilerServices.InlineArray(10)]\n    public struct Buffer\n    {\n        int arrayItem;\n    }\n}\n\npublic static class Extensions\n{\n    extension(string s)\n    {\n        public void Noncompliant(int[][] matrix) // Noncompliant\n        {\n\n        }\n    }\n}\n\npublic partial class PartialConstructor\n{\n    public partial PartialConstructor(int[][] matrix);\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PublicMethodWithMultidimensionalArray.cs",
    "content": "﻿public interface IFace\n{\n    void Method5(int[,] a); //Noncompliant\n//       ^^^^^^^\n}\n\npublic abstract class Base\n{\n    public abstract void Method4(int[,] a); //Noncompliant {{Make this method private or simplify its parameters to not use multidimensional/jagged arrays.}}\n}\n\npublic class PublicMethodWithMultidimensionalArray : Base, IFace\n{\n    public void Method(int a)\n    {\n    }\n    public void MethodX(int[] a)\n    {\n    }\n    public void Method1(int[][] a) //Noncompliant\n    {\n    }\n    void Method2(int[][] a) //Compliant\n    {\n    }\n    public void Method3(int[,] a) //Noncompliant\n    {\n    }\n\n    public override void Method4(int[,] a) //Compliant, overrides\n    {\n    }\n\n    public void Method5(int[,] a) //Compliant, implements interface\n    {\n    }\n\n    void Method6(params int[][,] a) // Compliant\n    {\n    }\n\n    public void Method7(params int[][] a) // Compliant\n    {\n    }\n\n    public void Method8(params int[][][] a) // Noncompliant\n    {\n    }\n\n    public void Method9(int[][] a, params int[][] b) // Noncompliant\n    {\n    }\n\n    public void Method10(int[,][] a) // Noncompliant\n    {\n    }\n}\n\ninternal class Other\n{\n    public void Method1(int[][] a) // Compliant, class is internal\n    {\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/8083\nnamespace Repro_8083\n{\n    public class Constructors\n    {\n        public Constructors(int[][] a) { }          // Noncompliant {{Make this constructor private or simplify its parameters to not use multidimensional/jagged arrays.}}\n        public Constructors(int[,] a) { }           // Noncompliant\n        public Constructors(params int[] a) { }     // Compliant, params of int\n        public Constructors(params int[][][] a) { } // Noncompliant\n        public Constructors(int i) { }              // Compliant, not a multi-dimensional array\n    }\n}\n\npublic static class ExtensionMethod\n{\n    public static void Method1<T>(this T[,] dataMatrix, int a) { }\n    public static void Method2<T>(this T data, T[,] dataMatrix) { } // Noncompliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PublicMethodWithMultidimensionalArray.vb",
    "content": "﻿Imports System\n\nNamespace Tests.Diagnostics\n    Public Interface IFace\n        Sub Method6(a As Integer()()) ' Noncompliant {{Make this method private or simplify its parameters to not use multidimensional/jagged arrays.}}\n'           ^^^^^^^\n    End Interface\n\n    Public MustInherit Class Base\n        MustOverride Sub Method5(a As Integer()()) ' Noncompliant\n    End Class\n\n    Public Class PublicMethodWithMultidimensionalArray\n        Inherits Base\n        Implements IFace\n        Public Sub Method(a As Integer)\n        End Sub\n        Public Sub MethodX(a As Integer())\n        End Sub\n\n        Public Sub Method1(a As Integer()()) ' Noncompliant\n        End Sub\n        Sub Method2(a As Integer()()) ' Noncompliant\n        End Sub\n        Sub Method2b(a As Integer(,)) ' Noncompliant\n        End Sub\n\n        Private Sub Method3(a As Integer()())\n        End Sub\n\n        Function Method4(a As Integer()()) As Integer ' Noncompliant\n            Return 1\n        End Function\n\n        Overrides Sub Method5(a As Integer()()) ' Compliant\n        End Sub\n\n        Private Sub Method6(a As Integer()()) Implements IFace.Method6 ' Compliant, interface implementation\n            Throw New NotImplementedException()\n        End Sub\n\n        Public Sub Method7(ParamArray a As Integer()()) ' Compliant\n        End Sub\n\n        Public Sub Method8(ParamArray a As Integer()()()) ' Noncompliant\n        End Sub\n\n        Sub Method9(ParamArray a As Integer()(,)) ' Compliant\n        End Sub\n\n        Sub Method10 ' Compliant\n            Console.WriteLine(\"Hello, world!\")\n        End Sub\n\n        Public Sub Metho11(a As Integer()(), ParamArray b As Integer()()) ' Noncompliant\n        End Sub\n\n        Sub Method12(a As Integer(,)()) ' Noncompliant\n        End Sub\n\n    End Class\n    Friend Class Other\n\n        Public Sub Method1(a As Integer()()) ' Compliant\n        End Sub\n\n    End Class\n\n    Public Class Constructors\n        Public Sub New(A As Integer()()) ' Noncompliant {{Make this constructor private or simplify its parameters to not use multidimensional/jagged arrays.}}\n'                  ^^^\n        End Sub\n\n        Public Sub New(A As Integer(,)) ' Noncompliant\n        End Sub\n\n        Public Sub New(ParamArray A As Integer())\n        End Sub\n\n        Public Sub New(ParamArray A As Integer()()()) ' Noncompliant\n        End Sub\n\n        Public Sub New(I As Integer)\n        End Sub\n    End Class\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PublicSharedReadonlyFieldName.vb",
    "content": "﻿Class Foo\n    Public Shared ReadOnly Foo As Integer  ' Compliant\n\n    Public Shared ReadOnly foo2 As Integer ' Noncompliant\n'                          ^^^^\n    Public Shared ReadOnly FooFooFFFoooFF As Integer\n    Friend Shared ReadOnly FooFooFFFFoooFF As Integer ' Noncompliant\n    Protected Shared ReadOnly FooFooFFFFoooFFF As Integer ' Noncompliant\n\nEnd Class"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PureAttributeOnVoidMethod.CSharp7.cs",
    "content": "﻿using System.Diagnostics.Contracts;\n\nrecord Record   // Error [CS0246] The type or namespace name 'record' could not be found (are you missing a using directive or an assembly reference?)\n                // Error@-1 [CS0548] '<invalid-global-code>.Record': property or indexer must have at least one accessor\n{\n    Record()    // Error [CS1014] A get or set accessor expected\n                // Error@-1 [CS1014] A get or set accessor expected\n                // Error@-2 [CS1014] A get or set accessor expected\n    {\n        [Pure]\n        void LocalFunction()\n        { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PureAttributeOnVoidMethod.Latest.cs",
    "content": "﻿using System;\nusing System.Diagnostics.Contracts;\n\nnamespace Tests.TestCases\n{\n    public class PureAttributes\n    {\n        private int age;\n\n        [Pure] // Noncompliant\n        void WithExplicitInParamater(in int age)\n        {\n            this.age = age;\n        }\n    }\n}\n\ninterface IInterface\n{\n    [Pure] // Noncompliant {{Remove the 'Pure' attribute or change the method to return a value.}}\n    public static virtual void DoSomething1(int a) { }\n\n    [Pure] // Noncompliant {{Remove the 'Pure' attribute or change the method to return a value.}}\n    public static abstract void DoSomething2(int a);\n\n    [Pure]\n    public static virtual int DoSomething3(int a) { return 5; }\n}\n\nrecord Record\n{\n    Record()\n    {\n        [Pure] // Noncompliant\n//       ^^^^\n        void LocalFunction()\n        {\n            [Pure] // Noncompliant\n            void NestedLocalFunction()\n            {\n            }\n        }\n\n        [PureAttribute] // Noncompliant\n        void LocalFunction2()\n        {\n        }\n\n        [Pure]\n        int LocalFunction3()\n        {\n            return 42;\n        }\n\n        [Pure]\n        void LocalFunction4(ref int param)\n        {\n        }\n    }\n}\n\nnamespace UserDefined\n{\n    public class PureAttribute : System.Attribute { }\n}\n\n\n// https://github.com/SonarSource/sonar-dotnet/issues/5117\npublic class Repro_5117\n{\n    public void Method()\n    {\n        [System.Diagnostics.Contracts.Pure] // Noncompliant\n        void LocalFunctionPure()\n        {\n        }\n\n        [UserDefined.Pure] // Compliant, it's user defined attribute\n        void LocalFunctionUserDefinedAttribute()\n        {\n        }\n\n        [System.Diagnostics.Contracts.ContractAbbreviator]  // Qualified name was throwing NRE\n        void LocalFunctionOther()\n        {\n        }\n    }\n}\n\npublic static class Extensions\n{\n    extension (string s)\n    {\n        [Pure] // Noncompliant\n        public void NonCompliant() { }  \n\n        [Pure]\n        public string Compliant() => \"42\";\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PureAttributeOnVoidMethod.TopLevelStatements.cs",
    "content": "﻿using System.Diagnostics.Contracts;\n\n[Pure]\nint Compliant(int age) => age;\n\n[Pure] // Noncompliant {{Remove the 'Pure' attribute or change the method to return a value.}}\nvoid Noncompliant()\n{\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PureAttributeOnVoidMethod.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Diagnostics.Contracts;\n\nnamespace Tests.TestCases\n{\n    public class MyAttribute : Attribute { }\n\n    class Person\n    {\n        private int age;\n\n        [Pure] // Noncompliant {{Remove the 'Pure' attribute or change the method to return a value.}}\n//       ^^^^\n        void ConfigureAge(int age)\n        {\n            this.age = age;\n        }\n\n        [Pure] // Noncompliant\n        Task TaskDoesNotReturn(int input)\n        {\n            return Task.FromResult(input);\n        }\n\n        [Pure] // Noncompliant\n        async Task AsyncTaskDoesNotReturn(int age)\n        {\n            this.age = age;\n        }\n\n        [My]\n        void ConfigureAge2(int age)\n        {\n            this.age = age;\n        }\n\n        [Pure]\n        int ConfigureAge3(int age)\n        {\n            return age;\n        }\n\n        [Pure]\n        void ConfigureAge4(int age, out int ret)\n        {\n            ret = age;\n        }\n\n        [Pure]\n        void VoidWithRef(ref int age)\n        {\n            age++;\n        }\n\n        [Pure]\n        Task<int> TaskOfTReturns(int input)\n        {\n            return Task.FromResult(input * 42);\n        }\n\n        [Pure]\n        Task TaskWithOutParameter(int input, out int ret)\n        {\n            ret = input;\n            return Task.FromResult(input);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/PureAttributeOnVoidMethod.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.Linq\nImports System.Text\nImports System.Threading.Tasks\nImports System.Diagnostics.Contracts\nImports Microsoft.VisualStudio.TestTools.UnitTesting\nImports System.Runtime.InteropServices\n\nNamespace Tests.TestCases\n    Public Class MyAttribute\n        Inherits Attribute\n    End Class\n\n    Class Person\n        Private age As Integer\n\n        <Pure> ' Noncompliant {{Remove the 'Pure' attribute or change the method to return a value.}}\n        Private Sub ConfigureAge(ByVal age As Integer)\n'        ^^^^ @-1\n            Me.age = age\n        End Sub\n\n        <Pure> 'Noncompliant\n        Sub WithExplicitInParameter(<[In]> ByVal age As Integer)\n            Me.age = age\n        End Sub\n\n        <Pure> 'Noncompliant\n        Function TaskDoesNotRetrun(input As Integer) As Task\n            Return Task.FromResult(input)\n        End Function\n\n        <Pure> 'Noncompliant\n        Async Function AsyncTaskDoesNotRetrun(input As Integer) As Task\n            Me.age = input\n        End Function\n\n        <My>\n        Private Sub ConfigureAge2(ByVal age As Integer)\n            Me.age = age\n        End Sub\n\n        <Pure>\n        Private Function ConfigureAge3(ByVal age As Integer) As Integer\n            Return age\n        End Function\n\n        <Pure>\n        Private Sub ConfigureAge4(ByVal age As Integer, <Out> ByRef ret As Integer)\n            ret = age\n        End Sub\n\n        <Pure>\n        Private Sub SubWithByref(ByRef age As Integer)\n            age += 1\n        End Sub\n\n        <Pure>\n        Function TaskOfTReturns(input As Integer) As Task(Of Integer)\n            Return Task.FromResult(input * 42)\n        End Function\n\n        <Pure>\n        Function TaskWithOutParameter(input As Integer, <Out> ByRef ret As Integer) As Task\n            ret = input\n            Return Task.FromResult(input)\n        End Function\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundancyInConstructorDestructorDeclaration.BaseCall.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\n\nnamespace Tests.Diagnostics\n{\n    class MyClass\n    {\n        public MyClass()\n        {\n\n        }\n        public MyClass(int p)\n        {\n\n        }\n    }\n\n    class DefaultBaseConstructorCall : MyClass\n    {\n        public DefaultBaseConstructorCall() /*c*/   // Fixed\n        {\n        }\n\n        public DefaultBaseConstructorCall(string s)\n        {\n        }\n\n        public DefaultBaseConstructorCall(string[] s)\n        {\n        }\n\n        public DefaultBaseConstructorCall(string[] s, int i) /*comment\n            some comment*/\n        {\n        }\n\n        public DefaultBaseConstructorCall(int parameter) : base(parameter)\n        {\n        }\n    }\n\n    public class MyClass1\n    {\n        static MyClass1() // Fixed\n        {\n\n        }\n        public MyClass1() // Fixed\n        {\n\n        }\n        ~MyClass1() // Fixed\n        {\n            //some comment\n        }\n    }\n\n    public class MyClass2\n    {\n        private MyClass2()\n        {\n\n        }\n    }\n    public class MyClass3\n    {\n        public MyClass3(int i)\n        {\n        }\n    }\n\n    public class MyClass4\n    {\n        public MyClass4()\n        {\n        }\n        public MyClass4(int i)\n        {\n        }\n    }\n\n    public class MyClass5 : MyClass4\n    {\n        public MyClass5() : base() // Fixed\n        {\n        }\n    }\n\n    public class MyClass6 : MyClass4\n    {\n        public MyClass6() : base(10)\n        {\n        }\n    }\n\n    public class MyClass7\n    {\n        Stream unmanagedResource;\n\n        ~MyClass7() // Compliant\n        {\n            if (unmanagedResource != null)\n            {\n                unmanagedResource.Dispose();\n                unmanagedResource = null;\n            }\n        }\n    }\n\n    class LambdaCtor\n    {\n        private int i;\n        LambdaCtor() => i++; // Fixed\n    }\n\n    class LambdaCtorWithLineEnding\n    {\n        private int i;\n        LambdaCtorWithLineEnding()\n            => i++;\n    }\n\n    class LambdaCtorTrailing\n    {\n        private int i;\n        LambdaCtorTrailing() /*b*/ => /*c*/ i++ /*d*/ ;   // Fixed\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundancyInConstructorDestructorDeclaration.CSharp10.Fixed.cs",
    "content": "﻿using System;\n\nrecord struct StaticCtor\n{\n}\n\nrecord struct RecordStruct\n{\n}\n\nrecord struct PositionalRecordStruct(string Property)\n{\n    public PositionalRecordStruct() : this(\"SomeString\") { } // Compliant\n}\n\nstruct Struct\n{\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/8087\npublic readonly struct Repro_8087\n{\n    // More info here https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/constructor-errors?f1url=%3FappId%3Droslyn%26k%3Dk(CS8983)#constructors-in-struct-types\n    public Repro_8087() { } // Compliant - Would mix with CS8983\n\n    public bool Foo { get; init; } = true;\n}\n\nstruct StructWithFieldInitializer\n{\n    public StructWithFieldInitializer() { } // Compliant\n    public int aField = 42;\n}\n\nstruct StructWithPropertyInitializer\n{\n    public StructWithPropertyInitializer(int someParam) { } // Compliant\n    public int AProperty { get; } = 42;\n}\n\nrecord struct RecordStructWithFieldInitializer\n{\n    public RecordStructWithFieldInitializer() { } // Compliant\n    public int aField = 42;\n}\n\nrecord struct RecordStructWithPropertyInitializer\n{\n    public RecordStructWithPropertyInitializer() { } // Compliant\n    public int AProperty { get; } = 42;\n}\n\npartial struct PartialStructWithPropertyInitializer\n{\n    public PartialStructWithPropertyInitializer() { } // Compliant\n}\n\npartial struct PartialStructWithPropertyInitializer\n{\n    public int AProperty { get; } = 42;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundancyInConstructorDestructorDeclaration.CSharp10.cs",
    "content": "﻿using System;\n\nrecord struct StaticCtor\n{\n    static StaticCtor() { } // Noncompliant\n}\n\nrecord struct RecordStruct\n{\n    public RecordStruct() { } // Noncompliant\n}\n\nrecord struct PositionalRecordStruct(string Property)\n{\n    public PositionalRecordStruct() : this(\"SomeString\") { } // Compliant\n}\n\nstruct Struct\n{\n    public Struct() { } // Noncompliant\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/8087\npublic readonly struct Repro_8087\n{\n    // More info here https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/constructor-errors?f1url=%3FappId%3Droslyn%26k%3Dk(CS8983)#constructors-in-struct-types\n    public Repro_8087() { } // Compliant - Would mix with CS8983\n\n    public bool Foo { get; init; } = true;\n}\n\nstruct StructWithFieldInitializer\n{\n    public StructWithFieldInitializer() { } // Compliant\n    public int aField = 42;\n}\n\nstruct StructWithPropertyInitializer\n{\n    public StructWithPropertyInitializer(int someParam) { } // Compliant\n    public int AProperty { get; } = 42;\n}\n\nrecord struct RecordStructWithFieldInitializer\n{\n    public RecordStructWithFieldInitializer() { } // Compliant\n    public int aField = 42;\n}\n\nrecord struct RecordStructWithPropertyInitializer\n{\n    public RecordStructWithPropertyInitializer() { } // Compliant\n    public int AProperty { get; } = 42;\n}\n\npartial struct PartialStructWithPropertyInitializer\n{\n    public PartialStructWithPropertyInitializer() { } // Compliant\n}\n\npartial struct PartialStructWithPropertyInitializer\n{\n    public int AProperty { get; } = 42;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundancyInConstructorDestructorDeclaration.CSharp11.Fixed.cs",
    "content": "﻿struct StructWithMulitpleField\n{\n    public StructWithMulitpleField() { } // Compliant\n    public int aField = 42, bField;\n}\n\nstruct StructWithMulitpleField2\n{\n    public StructWithMulitpleField2() { } // Compliant\n    public int aField, bField = 42;\n}\n\npublic struct Noncompliant\n{\n\n    public bool Foo { get; set; } // No initializer\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundancyInConstructorDestructorDeclaration.CSharp11.cs",
    "content": "﻿struct StructWithMulitpleField\n{\n    public StructWithMulitpleField() { } // Compliant\n    public int aField = 42, bField;\n}\n\nstruct StructWithMulitpleField2\n{\n    public StructWithMulitpleField2() { } // Compliant\n    public int aField, bField = 42;\n}\n\npublic struct Noncompliant\n{\n    public Noncompliant() { } // Noncompliant\n\n    public bool Foo { get; set; } // No initializer\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundancyInConstructorDestructorDeclaration.CSharp12.cs",
    "content": "﻿// https://github.com/SonarSource/sonar-dotnet/issues/8092\nnamespace Repro_8092\n{\n    namespace PrimaryParameterlessConstructor\n    {\n        class AClassWithBody() { }                                              // Noncompliant {{Remove this redundant primary constructor.}}\n//                          ^^\n        class AClassWithoutBody();                                              // Noncompliant\n\n        public abstract class BaseClass(string value);\n        public abstract class BaseClassNoValue{ };\n\n        public class SomeClass() : BaseClass(\"SomeValue\");                      // Compliant, Foo is calling Base constructor with primary constructor syntax, it's not redundant\n\n        public class DefaultStyle : BaseClass\n        {\n            public DefaultStyle() : base(\"SomeValue\")                           // Compliant, \"default\" way of calling Base constructor\n            { }\n        }\n\n        public class AClass() : BaseClassNoValue;                              // Noncompliant\n\n        public abstract record class BaseRecordClass(string value);\n\n        public record class SomeRecordClass() : BaseRecordClass(\"SomeValue\");  // Compliant, Foo is calling Base constructor with primary constructor syntax, it's not redundant\n\n        public record class DefaultStyleRecordClass : BaseRecordClass\n        {\n            public DefaultStyleRecordClass() : base(\"SomeValue\")               // Compliant, \"default\" way of calling Base constructor\n            { }\n        }\n\n        struct AStructWithBody() { }              // Noncompliant\n        struct AStructWithoutBody();              // Noncompliant\n        record ARecordWithBody() { }              // Noncompliant\n        record ARecordWithoutBody();              // Noncompliant\n        record struct ARecordStructWithBody() { } // Noncompliant\n        record struct ARecordStructWithoutBody(); // Noncompliant\n\n        // https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/constructor-errors?f1url=%3FappId%3Droslyn%26k%3Dk(CS8983)#constructors-in-struct-types\n        namespace FieldInitializerInStructRequiresConstructor\n        {\n            struct AStructWithFieldInitializer()              // Compliant\n            {\n                int aField = 42;\n            }\n\n            struct AStructWithFieldDoubleInitializers()       // Compliant\n            {\n                int aField, bField = 42;\n            }\n\n            struct AStructWithPropertyInitializer()           // Compliant\n            {\n                int AProperty { get; } = 42;\n            }\n\n            record struct ARecordStructWithFieldInitializer() // Compliant\n            {\n                int aField = 42;\n            }\n\n            partial struct PartialStructWithPropertyInitializer() // Compliant\n            {\n            }\n\n            partial struct PartialStructWithPropertyInitializer\n            {\n                int AProperty { get; } = 42;\n            }\n\n            partial record struct PartialRecordStructWithFieldInitializer() // Compliant\n            {\n            }\n\n            partial record struct PartialRecordStructWithFieldInitializer\n            {\n                int AField = 42;\n            }\n        }\n\n        namespace FieldInitializerInClassDontRequireConstructor\n        {\n            class AClassWithFieldInitializer()    // Noncompliant\n            {\n                int aField = 42;\n            }\n\n            class AClassWithPropertyInitializer() // Noncompliant\n            {\n                int AProperty { get; } = 42;\n            }\n\n            class ARecordWithFieldInitializer()   // Noncompliant\n            {\n                int aField = 42;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundancyInConstructorDestructorDeclaration.CSharp9.Fixed.cs",
    "content": "﻿using System;\n\nrecord RecordBase\n{\n    public RecordBase() { }\n    public RecordBase(int i) { }\n}\n\nrecord Record : RecordBase\n{\n    public Record()\n{ } // Fixed\n\n    public Record(string s)\n    {\n    }\n\n    public Record(int i)\n        : base(i)\n    {\n    }\n}\n\nrecord StaticCtor\n{\n    static StaticCtor() { } // Fixed\n}\n\nrecord Foo\n{\n    public Foo() { } // Fixed\n\n    ~Foo() { } // Fixed\n}\n\nrecord Bar\n{\n    public Bar()\n    {\n        Console.WriteLine(\"Hi!\");\n    }\n}\n\nrecord FooWithParams(string name)\n{\n    public FooWithParams() : this(\"a\") { } // Compliant - has initializer with arguments\n\n    ~FooWithParams() { } // Fixed\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/8436\npublic class Repro_FP_8436\n{\n    public abstract record BaseRecord(string Value);\n\n    public record RecordStyle() : BaseRecord(\"SomeValue\"); // Compliant, Foo is calling Base constructor with record idiomatic syntax, it's not redundant\n\n    public record DefaultStyle : BaseRecord\n    {\n        public DefaultStyle() : base(\"SomeValue\") // Compliant, \"default\" way of calling Base constructor\n        { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundancyInConstructorDestructorDeclaration.CSharp9.cs",
    "content": "﻿using System;\n\nrecord RecordBase\n{\n    public RecordBase() { }\n    public RecordBase(int i) { }\n}\n\nrecord Record : RecordBase\n{\n    public Record()\n        : base() { } // Noncompliant\n\n    public Record(string s)\n        : base() // Noncompliant\n    {\n    }\n\n    public Record(int i)\n        : base(i)\n    {\n    }\n}\n\nrecord StaticCtor\n{\n    static StaticCtor() { } // Noncompliant\n}\n\nrecord Foo\n{\n    public Foo() { } // Noncompliant\n\n    ~Foo() { } // Noncompliant {{Remove this redundant destructor.}}\n}\n\nrecord Bar\n{\n    public Bar()\n    {\n        Console.WriteLine(\"Hi!\");\n    }\n}\n\nrecord FooWithParams(string name)\n{\n    public FooWithParams() : this(\"a\") { } // Compliant - has initializer with arguments\n\n    ~FooWithParams() { } // Noncompliant {{Remove this redundant destructor.}}\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/8436\npublic class Repro_FP_8436\n{\n    public abstract record BaseRecord(string Value);\n\n    public record RecordStyle() : BaseRecord(\"SomeValue\"); // Compliant, Foo is calling Base constructor with record idiomatic syntax, it's not redundant\n\n    public record DefaultStyle : BaseRecord\n    {\n        public DefaultStyle() : base(\"SomeValue\") // Compliant, \"default\" way of calling Base constructor\n        { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundancyInConstructorDestructorDeclaration.Constructor.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\n\nnamespace Tests.Diagnostics\n{\n    class MyClass\n    {\n        public MyClass()\n        {\n\n        }\n        public MyClass(int p)\n        {\n\n        }\n    }\n\n    class DefaultBaseConstructorCall : MyClass\n    {\n        public DefaultBaseConstructorCall() /*c*/  : /*don't keep*/ base() // Fixed\n\n\n        {\n        }\n\n        public DefaultBaseConstructorCall(string s)\n            : base() // Fixed\n        {\n        }\n\n        public DefaultBaseConstructorCall(string[] s)\n\n\n            : base() // Fixed\n\n\n\n        {\n        }\n\n        public DefaultBaseConstructorCall(string[] s, int i) /*comment\n            some comment*/\n\n            : base() // Fixed\n\n            /*some comment2*/\n\n        {\n        }\n\n        public DefaultBaseConstructorCall(int parameter) : base(parameter)\n        {\n        }\n    }\n\n    public class MyClass1\n    {\n        ~MyClass1() // Fixed\n        {\n            //some comment\n        }\n    }\n\n    public class MyClass2\n    {\n        private MyClass2()\n        {\n\n        }\n    }\n    public class MyClass3\n    {\n        public MyClass3(int i)\n        {\n        }\n    }\n\n    public class MyClass4\n    {\n        public MyClass4()\n        {\n        }\n        public MyClass4(int i)\n        {\n        }\n    }\n\n    public class MyClass5 : MyClass4\n    {\n    }\n\n    public class MyClass6 : MyClass4\n    {\n        public MyClass6() : base(10)\n        {\n        }\n    }\n\n    public class MyClass7\n    {\n        Stream unmanagedResource;\n\n        ~MyClass7() // Compliant\n        {\n            if (unmanagedResource != null)\n            {\n                unmanagedResource.Dispose();\n                unmanagedResource = null;\n            }\n        }\n    }\n\n    class LambdaCtor\n    {\n        private int i;\n        LambdaCtor() : base() => i++; // Fixed\n    }\n\n    class LambdaCtorWithLineEnding\n    {\n        private int i;\n        LambdaCtorWithLineEnding()\n            : base() // Fixed\n            => i++;\n    }\n\n    class LambdaCtorTrailing\n    {\n        private int i;\n        LambdaCtorTrailing() : /*a*/ base() /*b*/ => /*c*/ i++ /*d*/ ;   // Fixed\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundancyInConstructorDestructorDeclaration.Destructor.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\n\nnamespace Tests.Diagnostics\n{\n    class MyClass\n    {\n        public MyClass()\n        {\n\n        }\n        public MyClass(int p)\n        {\n\n        }\n    }\n\n    class DefaultBaseConstructorCall : MyClass\n    {\n        public DefaultBaseConstructorCall() /*c*/  : /*don't keep*/ base() // Fixed\n\n\n        {\n        }\n\n        public DefaultBaseConstructorCall(string s)\n            : base() // Fixed\n        {\n        }\n\n        public DefaultBaseConstructorCall(string[] s)\n\n\n            : base() // Fixed\n\n\n\n        {\n        }\n\n        public DefaultBaseConstructorCall(string[] s, int i) /*comment\n            some comment*/\n\n            : base() // Fixed\n\n            /*some comment2*/\n\n        {\n        }\n\n        public DefaultBaseConstructorCall(int parameter) : base(parameter)\n        {\n        }\n    }\n\n    public class MyClass1\n    {\n        static MyClass1() // Fixed\n        {\n\n        }\n        public MyClass1() // Fixed\n        {\n\n        }\n    }\n\n    public class MyClass2\n    {\n        private MyClass2()\n        {\n\n        }\n    }\n    public class MyClass3\n    {\n        public MyClass3(int i)\n        {\n        }\n    }\n\n    public class MyClass4\n    {\n        public MyClass4()\n        {\n        }\n        public MyClass4(int i)\n        {\n        }\n    }\n\n    public class MyClass5 : MyClass4\n    {\n        public MyClass5() : base() // Fixed\n        {\n        }\n    }\n\n    public class MyClass6 : MyClass4\n    {\n        public MyClass6() : base(10)\n        {\n        }\n    }\n\n    public class MyClass7\n    {\n        Stream unmanagedResource;\n\n        ~MyClass7() // Compliant\n        {\n            if (unmanagedResource != null)\n            {\n                unmanagedResource.Dispose();\n                unmanagedResource = null;\n            }\n        }\n    }\n\n    class LambdaCtor\n    {\n        private int i;\n        LambdaCtor() : base() => i++; // Fixed\n    }\n\n    class LambdaCtorWithLineEnding\n    {\n        private int i;\n        LambdaCtorWithLineEnding()\n            : base() // Fixed\n            => i++;\n    }\n\n    class LambdaCtorTrailing\n    {\n        private int i;\n        LambdaCtorTrailing() : /*a*/ base() /*b*/ => /*c*/ i++ /*d*/ ;   // Fixed\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundancyInConstructorDestructorDeclaration.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\n\nnamespace Tests.Diagnostics\n{\n    class MyClass\n    {\n        public MyClass()\n        {\n\n        }\n        public MyClass(int p)\n        {\n\n        }\n    }\n\n    class DefaultBaseConstructorCall : MyClass\n    {\n        public DefaultBaseConstructorCall() /*c*/  : /*don't keep*/ base() // Noncompliant {{Remove this redundant 'base()' call.}}\n\n\n        {\n        }\n\n        public DefaultBaseConstructorCall(string s)\n            : base() // Noncompliant\n        {\n        }\n\n        public DefaultBaseConstructorCall(string[] s)\n\n\n            : base() // Noncompliant\n//          ^^^^^^^^\n\n\n\n        {\n        }\n\n        public DefaultBaseConstructorCall(string[] s, int i) /*comment\n            some comment*/\n\n            : base() // Noncompliant\n\n            /*some comment2*/\n\n        {\n        }\n\n        public DefaultBaseConstructorCall(int parameter) : base(parameter)\n        {\n        }\n    }\n\n    public class MyClass1\n    {\n        static MyClass1() // Noncompliant\n        {\n\n        }\n        public MyClass1() // Noncompliant {{Remove this redundant constructor.}}\n        {\n\n        }\n        ~MyClass1() // Noncompliant {{Remove this redundant destructor.}}\n        {\n            //some comment\n        }\n    }\n\n    public class MyClass2\n    {\n        private MyClass2()\n        {\n\n        }\n    }\n    public class MyClass3\n    {\n        public MyClass3(int i)\n        {\n        }\n    }\n\n    public class MyClass4\n    {\n        public MyClass4()\n        {\n        }\n        public MyClass4(int i)\n        {\n        }\n    }\n\n    public class MyClass5 : MyClass4\n    {\n        public MyClass5() : base() // Noncompliant\n        {\n        }\n    }\n\n    public class MyClass6 : MyClass4\n    {\n        public MyClass6() : base(10)\n        {\n        }\n    }\n\n    public class MyClass7\n    {\n        Stream unmanagedResource;\n\n        ~MyClass7() // Compliant\n        {\n            if (unmanagedResource != null)\n            {\n                unmanagedResource.Dispose();\n                unmanagedResource = null;\n            }\n        }\n    }\n\n    class LambdaCtor\n    {\n        private int i;\n        LambdaCtor() : base() => i++; // Noncompliant\n    }\n\n    class LambdaCtorWithLineEnding\n    {\n        private int i;\n        LambdaCtorWithLineEnding()\n            : base() // Noncompliant\n            => i++;\n    }\n\n    class LambdaCtorTrailing\n    {\n        private int i;\n        LambdaCtorTrailing() : /*a*/ base() /*b*/ => /*c*/ i++ /*d*/ ;   // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantArgument.Latest.cs",
    "content": "﻿using System;\n\nclass DefaultLambdaParameters\n{\n    void SingleDefaultArgument()\n    {\n        var f = (int i = 42) => i;\n        f();       // Compliant\n        f(40);     // Compliant\n        f(42);     // Noncompliant\n        f(41 + 1); // Noncompliant, expression results into the default value\n    }\n\n    void MultipleDefaultArguments()\n    {\n        var f = (int i = 41, int j = 42) => i + j;\n        f();       // Compliant\n        f(42);     // Compliant\n        f(42, 42); // Noncompliant\n        f(41, 42); // Multiple violations\n        //^^\n        //    ^^@-1\n    }\n\n    void NamedArguments()\n    {\n        var f = (int i = 41, int j = 42, int z = 43) => i;\n        f(i: 42); // Error [CS1746] The delegate '<anonymous delegate>' does not have a parameter named 'i'\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/8096\nnamespace Repro_8096\n{\n    class PrimaryConstructors\n    {\n        void SingleDefaultArgument()\n        {\n            _ = new C1();       // Compliant\n            _ = new C1(41);     // Compliant\n            _ = new C1(42);     // Noncompliant\n            _ = new C1(41 + 1); // Noncompliant, expression results into the default value\n        }\n\n        void MultipleDefaultArguments()\n        {\n            _ = new C1();       // Compliant\n            _ = new C2(42);     // Compliant\n            _ = new C2(42, 42); // Noncompliant\n            _ = new C2(41, 42); // multiple violations\n            //         ^^\n            //             ^^@-1\n        }\n\n        void NamedArguments()\n        {\n            _ = new C2(j: 42);  // Noncompliant\n        }\n\n        class C1(int i = 42);\n        class C2(int i = 41, int j = 42);\n        class C3() : C1(42);    // Noncompliant\n    }\n\n    class ConstructorInitializerBase\n    {\n        public ConstructorInitializerBase(int i = 42) { }\n        public ConstructorInitializerBase(bool _) : this(42) { } // Noncompliant\n\n        class Derived : ConstructorInitializerBase\n        {\n            public Derived() : base(42) { }                      // Noncompliant\n        }\n    }\n}\n\npublic interface IInterfaceWithDefaultMethod\n{\n    public void Write(int i, int j = 5) { }\n}\n\npublic class Consumer\n{\n    public Consumer(IInterfaceWithDefaultMethod i)\n    {\n        i.Write(1, 5); // Noncompliant {{Remove this default value assigned to parameter 'j'.}}\n    }\n}\n\npublic class WithLocalFunctions\n{\n    public void Method()\n    {\n        Foo(1, 5); // Noncompliant {{Remove this default value assigned to parameter 'j'.}}\n        Bar(1, 5); // Noncompliant {{Remove this default value assigned to parameter 'j'.}}\n\n        void Foo(int i, int j = 5) { }\n\n        static void Bar(int i, int j = 5) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantArgument.Named.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq.Expressions;\n\nnamespace Tests.Diagnostics\n{\n    public static class RedundantArgument\n    {\n        public static void M(int x, int y = 5, int z = 7) { /* ... */ }\n        public static void M2(int x, int y, int z) { /* ... */ }\n        public static void M3(int x = 1, int y = 5, int z = 7) { /* ... */ }\n        public static void Ext(this int self, int y = 5, params int[] parameters) { }\n        public static void Ext2(this int self, int y, params int[] parameters) { }\n\n        public static void Test()\n        {\n            var x = \"\".ToString();\n            M(1, 5); //Fixed\n            M(1, 5, 0); // Compliant - z=0 is non-default positional, blocks y=5 removal\n            M(1, z: 7); //Fixed\n            M(1, 5, // Fixed\n                7); // Fixed\n            M(1);\n            M(1, 2, 4);\n            M2(1, 1, 1);\n            5.Ext(5);       //Fixed\n            5.Ext(parameters: new[] { 0, 0 }); //Fixed\n            5.Ext2(5);\n\n            RedundantArgument.Ext(5, parameters: new[] { 4, 4, 5, 6 }); //Fixed\n            RedundantArgument.Ext(5, y: 5, parameters: new int[] { 4, 4, 5, 6 }); //Fixed\n            RedundantArgument.Ext(5, 5); //Fixed\n\n            M3(1,      //Fixed\n                y: 5,  //Fixed\n                z: 7); //Fixed\n\n            M3(1,      //Fixed\n                y: 4);\n            M3(x: 1,   //Fixed\n                y: 4);\n            M3(y: 4);    //Fixed\n            M3(1,      // Compliant - y=4 is non-default positional, blocks x=1 removal\n                4);\n        }\n    }\n\n    // Issue #789: Cannot use optional arguments when using expression trees (CS0584)\n    public class RedundantArgsInExpressionTrees\n    {\n        private static string FuncWithOptionals(string str = null, params string[] args)\n        {\n            return str;\n        }\n\n        // Field declaration -> variable declaration\n        Func<string> normalField = () => FuncWithOptionals(args: new[] { \"111\", \"222\" }); //Fixed\n        readonly Expression<Action> expTreeField = () => FuncWithOptionals(null); //Compliant - expression tree, so cannot use defaults\n\n        // Property declaration\n        Func<string> normalProperty => () => FuncWithOptionals(str: null); //Fixed\n        Expression<Action> expTreeProperty => () => FuncWithOptionals(null); //Compliant\n\n        void takeExpression(Expression<Func<string>> expr) { }\n\n        public void Method1()\n        {\n            // Variable declaration\n            Func<string> var1 = () => FuncWithOptionals(null); //Fixed\n            Expression<Action> expTreeVar = () => FuncWithOptionals(null); //Compliant\n            takeExpression(() => FuncWithOptionals(null)); //Compliant\n\n            // Simple assigment\n            var1 = () => FuncWithOptionals(str: null, args: \"123\"); //Fixed\n            expTreeVar = () => FuncWithOptionals(null); //Compliant\n        }\n    }\n\n    public class PositionalDefaultBeforeNonDefault // https://sonarsource.atlassian.net/browse/NET-3212\n    {\n        public static void M(int x, int y = 5, int z = 7) { }\n        public static void M3(int x = 1, int y = 5, int z = 7) { }\n        public static void WithOptional(bool a = false, bool b = false) { }\n        public PositionalDefaultBeforeNonDefault(int timeout = 30, int retries = 3, bool verbose = false) { }\n        public void Methods()\n        {\n            M(1, 5, 0);                 // Compliant\n            M3(1, 4);                   // Compliant\n            WithOptional(false, true);  // Compliant\n        }\n        public void Constructors()\n        {\n            var c1 = new PositionalDefaultBeforeNonDefault(30, 5);          // Compliant\n            var c2 = new PositionalDefaultBeforeNonDefault(30, 5, true);    // Compliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantArgument.NoNamed.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq.Expressions;\n\nnamespace Tests.Diagnostics\n{\n    public static class RedundantArgument\n    {\n        public static void M(int x, int y = 5, int z = 7) { /* ... */ }\n        public static void M2(int x, int y, int z) { /* ... */ }\n        public static void M3(int x = 1, int y = 5, int z = 7) { /* ... */ }\n        public static void Ext(this int self, int y = 5, params int[] parameters) { }\n        public static void Ext2(this int self, int y, params int[] parameters) { }\n\n        public static void Test()\n        {\n            var x = \"\".ToString();\n            M(1); //Fixed\n            M(1, 5, 0); // Compliant - z=0 is non-default positional, blocks y=5 removal\n            M(1); //Fixed\n            M(1); // Fixed\n            M(1);\n            M(1, 2, 4);\n            M2(1, 1, 1);\n            5.Ext();       //Fixed\n            5.Ext(5, 0, 0); //Fixed\n            5.Ext2(5);\n\n            RedundantArgument.Ext(5, 5, 4, 4, 5, 6); //Fixed\n            RedundantArgument.Ext(5, parameters: new int[] { 4, 4, 5, 6 }); //Fixed\n            RedundantArgument.Ext(5); //Fixed\n\n            M3(); //Fixed\n\n            M3(y: 4);\n            M3(y: 4);\n            M3(1,      // Compliant - y=4 is non-default positional, blocks x=1 removal\n                4);    //Fixed\n            M3(1,      // Compliant - y=4 is non-default positional, blocks x=1 removal\n                4);\n        }\n    }\n\n    // Issue #789: Cannot use optional arguments when using expression trees (CS0584)\n    public class RedundantArgsInExpressionTrees\n    {\n        private static string FuncWithOptionals(string str = null, params string[] args)\n        {\n            return str;\n        }\n\n        // Field declaration -> variable declaration\n        Func<string> normalField = () => FuncWithOptionals(null, \"111\", \"222\"); //Fixed\n        readonly Expression<Action> expTreeField = () => FuncWithOptionals(null); //Compliant - expression tree, so cannot use defaults\n\n        // Property declaration\n        Func<string> normalProperty => () => FuncWithOptionals(); //Fixed\n        Expression<Action> expTreeProperty => () => FuncWithOptionals(null); //Compliant\n\n        void takeExpression(Expression<Func<string>> expr) { }\n\n        public void Method1()\n        {\n            // Variable declaration\n            Func<string> var1 = () => FuncWithOptionals(); //Fixed\n            Expression<Action> expTreeVar = () => FuncWithOptionals(null); //Compliant\n            takeExpression(() => FuncWithOptionals(null)); //Compliant\n\n            // Simple assigment\n            var1 = () => FuncWithOptionals(args: \"123\"); //Fixed\n            expTreeVar = () => FuncWithOptionals(null); //Compliant\n        }\n    }\n\n    public class PositionalDefaultBeforeNonDefault // https://sonarsource.atlassian.net/browse/NET-3212\n    {\n        public static void M(int x, int y = 5, int z = 7) { }\n        public static void M3(int x = 1, int y = 5, int z = 7) { }\n        public static void WithOptional(bool a = false, bool b = false) { }\n        public PositionalDefaultBeforeNonDefault(int timeout = 30, int retries = 3, bool verbose = false) { }\n        public void Methods()\n        {\n            M(1, 5, 0);                 // Compliant\n            M3(1, 4);                   // Compliant\n            WithOptional(false, true);  // Compliant\n        }\n        public void Constructors()\n        {\n            var c1 = new PositionalDefaultBeforeNonDefault(30, 5);          // Compliant\n            var c2 = new PositionalDefaultBeforeNonDefault(30, 5, true);    // Compliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantArgument.TopLevelStatements.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nA(1, 5); //Noncompliant, y has the default value\n//   ^\nA(1, z: 7); //Noncompliant, z has the default value\n\nA(1);\nA(1, 2, 4);\n\nRecord r1 = new(1);\nRecord r2 = new(1, 5); // Noncompliant\nRecord r3 = new(1, 6); // Compliant\n\nr1 = new Record(1);\nr2 = new Record(1, 5); // Noncompliant\nr3 = new Record(1, 6); // Compliant\n\n_ = new List<int> { 1 }; // Constructor without ArgumentList\n\nint x = 5;\nvar y = x switch\n{\n    1 => A(1),\n    5 => A(1, x), // Compliant - FN\n    7 => A(1, z: 7) // Noncompliant\n};\n\nif (x is 5)\n{\n    A(1, x); // Compliant - FN\n}\n\nAction<int> a = static x =>\n{\n    A(x);\n    A(x, 5); // Noncompliant\n};\n\nstatic int A(int x, int y = 5, int z = 7) => x;\nstatic int B(int x, int y, int z) => x;\n\nrecord Record\n{\n    public Record(int x, int y = 5) { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantArgument.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq.Expressions;\n\nnamespace Tests.Diagnostics\n{\n    public static class RedundantArgument\n    {\n        public static void M(int x, int y = 5, int z = 7) { /* ... */ }\n        public static void M2(int x, int y, int z) { /* ... */ }\n        public static void M3(int x = 1, int y = 5, int z = 7) { /* ... */ }\n        public static void Ext(this int self, int y = 5, params int[] parameters) { }\n        public static void Ext2(this int self, int y, params int[] parameters) { }\n\n        public static void Test()\n        {\n            var x = \"\".ToString();\n            M(1, 5); //Noncompliant, y has the default value\n            //   ^\n            M(1, 5, 0); // Compliant - z=0 is non-default positional, blocks y=5 removal\n            M(1, z: 7); //Noncompliant, z has the default value\n            M(1, 5, // Noncompliant\n//               ^\n                7); // Noncompliant, y, z has the default value\n//              ^\n            M(1);\n            M(1, 2, 4);\n            M2(1, 1, 1);\n            5.Ext(5);       //Noncompliant\n            5.Ext(5, 0, 0); //Noncompliant\n            5.Ext2(5);\n\n            RedundantArgument.Ext(5, 5, 4, 4, 5, 6); //Noncompliant {{Remove this default value assigned to parameter 'y'.}}\n            RedundantArgument.Ext(5, y: 5, parameters: new int[] { 4, 4, 5, 6 }); //Noncompliant {{Remove this default value assigned to parameter 'y'.}}\n            RedundantArgument.Ext(5, 5); //Noncompliant\n\n            M3(1,      //Noncompliant\n                y: 5,  //Noncompliant\n                z: 7); //Noncompliant\n\n            M3(1,      //Noncompliant\n                y: 4);\n            M3(x: 1,   //Noncompliant\n                y: 4);\n            M3(1,      // Compliant - y=4 is non-default positional, blocks x=1 removal\n                4,\n                7);    //Noncompliant\n            M3(1,      // Compliant - y=4 is non-default positional, blocks x=1 removal\n                4);\n        }\n    }\n\n    // Issue #789: Cannot use optional arguments when using expression trees (CS0584)\n    public class RedundantArgsInExpressionTrees\n    {\n        private static string FuncWithOptionals(string str = null, params string[] args)\n        {\n            return str;\n        }\n\n        // Field declaration -> variable declaration\n        Func<string> normalField = () => FuncWithOptionals(null, \"111\", \"222\"); //Noncompliant -- non-expression tree, so can use defaults\n        readonly Expression<Action> expTreeField = () => FuncWithOptionals(null); //Compliant - expression tree, so cannot use defaults\n\n        // Property declaration\n        Func<string> normalProperty => () => FuncWithOptionals(str: null); //Noncompliant\n        Expression<Action> expTreeProperty => () => FuncWithOptionals(null); //Compliant\n\n        void takeExpression(Expression<Func<string>> expr) { }\n\n        public void Method1()\n        {\n            // Variable declaration\n            Func<string> var1 = () => FuncWithOptionals(null); //Noncompliant\n            Expression<Action> expTreeVar = () => FuncWithOptionals(null); //Compliant\n            takeExpression(() => FuncWithOptionals(null)); //Compliant\n\n            // Simple assigment\n            var1 = () => FuncWithOptionals(str: null, args: \"123\"); //Noncompliant\n            expTreeVar = () => FuncWithOptionals(null); //Compliant\n        }\n    }\n\n    public class PositionalDefaultBeforeNonDefault // https://sonarsource.atlassian.net/browse/NET-3212\n    {\n        public static void M(int x, int y = 5, int z = 7) { }\n        public static void M3(int x = 1, int y = 5, int z = 7) { }\n        public static void WithOptional(bool a = false, bool b = false) { }\n        public PositionalDefaultBeforeNonDefault(int timeout = 30, int retries = 3, bool verbose = false) { }\n        public void Methods()\n        {\n            M(1, 5, 0);                 // Compliant\n            M3(1, 4);                   // Compliant\n            WithOptional(false, true);  // Compliant\n        }\n        public void Constructors()\n        {\n            var c1 = new PositionalDefaultBeforeNonDefault(30, 5);          // Compliant\n            var c2 = new PositionalDefaultBeforeNonDefault(30, 5, true);    // Compliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantCast.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Tests.Diagnostics\n{\n    public class RedundantCast\n    {\n        void foo(long l)\n        {\n            var x = new int[] { 1, 2, 3 }; // Fixed\n            x = new int[] { 1, 2, 3 };\n            x = x\n; //Fixed\n            x = x; //Fixed\n\n            var y = x.OfType<object>();\n\n            var zz = (int)l;\n            int i = 0;\n            var z = (int)i; // Fixed\n            z = (Int32)i; // Fixed\n\n            var w = (object)i;\n\n            method(new int[] { 1, 2, 3 }); // Fixed\n        }\n        void method(IEnumerable<int> enumerable)\n        { }\n\n        void M()\n        {\n            var o = new object();\n            var oo = o; // Fixed\n            var i = o as RedundantCast; // Compliant\n        }\n\n        public void N(int[,] numbers)\n        {\n            numbers.Cast<int>().Where(x => x > 0); // Compliant, multidimensional arrays need to be cast\n        }\n\n        // https://github.com/SonarSource/sonar-dotnet/issues/3273\n        public void OfTypeWithReferenceTypes(IEnumerable<object> param)\n        {\n            var stringArrayWithNull = new string[] { \"one\", \"two\", null, \"three\" };\n            var filteredStringArray = stringArrayWithNull.OfType<string>(); // Compliant, has 3 items, without 'null'\n\n            var enumerableOfObjects = new object[] { 1, \"one\", null };\n            var filteredObjectArray = enumerableOfObjects.OfType<object>(); // Compliant, has 2 items, without 'null'\n\n            var enumerableOfNullableInt = new int?[] { 1, 2, null };\n            var filteredInts = enumerableOfNullableInt.OfType<int?>(); // Compliant, has 2 items, without 'null'\n\n            param.OfType<object>(); // Compliant, may contain null values\n\n            var useless = new string[] { \"one\", \"two\" }.OfType<string>(); // FN\n        }\n\n        public void CastWithReferenceTypes(IEnumerable<object> param)\n        {\n            var stringArrayWithNull = new string[] { \"one\", \"two\", null, \"three\" };\n            var castStringArray = stringArrayWithNull; // Fixed\n\n            var enumerableOfObjects = new object[] { 1, \"one\", null };\n            var filteredObjectArray = enumerableOfObjects; // Fixed\n\n            var enumerableOfNullableInt = new int?[] { 1, 2, null };\n            var filteredInts = enumerableOfNullableInt; // Fixed\n\n            param; // Fixed\n        }\n    }\n\n    public static class MyEnumerableExtensions\n    {\n        public static IEnumerable<T1> OfType<T1, T2>(this IEnumerable source) =>\n            source.OfType<T1>();\n        public static IEnumerable<T1> Cast<T1, T2>(this IEnumerable source) =>\n            source.Cast<T1>();\n        public static int OfType<T1, T2, T3>(this IEnumerable source) => 0;\n        public static int Cast<T1, T2, T3>(this IEnumerable source) => 0;\n    }\n\n    public class TestWithCustomExtension\n    {\n        public void UnlikelyCases(IEnumerable<int> intValues, List<string> stringValues)\n        {\n            intValues; // Fixed\n            intValues; // Fixed\n            stringValues.OfType<string, string>();\n            stringValues; // Fixed\n\n            intValues.OfType<int, int, int>();\n            intValues.Cast<int, int, int>();\n        }\n    }\n\n    public class MoreTests\n    {\n        public void Foo(IEnumerable enumerable, IEnumerable<object> genericEnumerable)\n        {\n            enumerable.OfType<int>();\n            enumerable.OfType<string>();\n\n            genericEnumerable.Select(x => x).Select(x => x).OfType<string>();\n            genericEnumerable.Select(x => x).Select(x => x).OfType<string>().OfType<string>();\n            genericEnumerable.Select(x => x).Select(x => x).OfType<int>();\n            genericEnumerable.Select(x => x).Select(x => x).OfType<int>(); // Fixed\n        }\n\n        public void OfType() => OfType();\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/9498\n    public class Repro_9498\n    {\n        void Sample(float x)\n        {\n            float res = 1 / (float)(x * 2); // Fixed\n        }\n    }\n\n    // https://sonarsource.atlassian.net/browse/NET-1183\n    public class NumberLiteralSuffixes\n    {\n        void Numbers()\n        {\n            var d0 = (decimal)12.0;     // FN: use 12.0m\n            var d1 = (decimal)12;       // FN: use 12m\n            var d2 = (double)12;        // FN: use 12d\n            var f0 = (float)12.0;       // FN: use 12.0f\n            var n0 = (uint)12;          // FN: use 12u\n            var n1 = (long)12;          // FN: use 12l\n            var n2 = (ulong)12;         // FN: use 12ul\n\n            var n3 = (uint)0x12;        // FN: use 0x12u\n            var n4 = (uint)0b101;       // FN: use 0b101u\n\n            var n5 = (UInt32)12;        // FN: use 12u\n            var n6 = (byte)12;          // Compliant, there is no suffix for byte\n            var n7 = 0xFF_FF_FF_FF_FFl; // Compliant, \"l\" is redundant here but for readability it's better to keep it\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantCast.Latest.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\n\n#nullable enable\n\npublic class InvocationTests\n{\n    public static void Invocations()\n    {\n        var ints = new int[1];\n        var objects = new object[1];\n        var moreInts = new int[1][];\n        var moreObjects = new object[1][];\n        ints?.Cast<int>();              // Noncompliant\n        objects?.Cast<int>();           // Compliant\n        moreInts[0].Cast<int>();        // Noncompliant\n        moreObjects[0].Cast<int>();     // Compliant\n        moreInts[0]?.Cast<int>();       // Noncompliant\n        moreObjects[0]?.Cast<int>();    // Compliant\n        GetInts().Cast<int>();          // Noncompliant\n        GetObjects().Cast<int>();       // Compliant\n        GetInts()?.Cast<int>();         // Noncompliant\n        GetObjects()?.Cast<int>();      // Compliant\n        Enumerable.Cast<int>();         // Error [CS7036] - overload resolution failure\n    }\n\n    public static int[] GetInts() => null;\n    public static object[] GetObjects() => null;\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/3273\npublic class CastOnNullable\n{\n    public static IEnumerable<string> Array()\n    {\n        var nullableStrings = new string?[] { \"one\", \"two\", null, \"three\" };\n        return nullableStrings.OfType<string>(); // Compliant - filters out the null\n    }\n\n    public void Tuple()\n    {\n        _ = (a: (string?)\"\", b: \"\");    // Compliant\n    }\n\n    public void ValueTypes(int nonNullable, int? nullable)\n    {\n        _ = (int?)nonNullable;  // Compliant\n        _ = (int?)nullable;     // Noncompliant\n        _ = (int)nonNullable;   // Noncompliant\n        _ = (int)nullable;      // Compliant\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/6438\npublic class AnonTypes\n{\n    public void Simple(string nonNullable, string? nullable)\n    {\n        _ = new { X = (string?)nonNullable };   // Compliant\n        _ = new { X = (string?)nullable };      // Noncompliant\n        _ = new { X = (string)nonNullable };    // Noncompliant\n        _ = new { X = (string)nullable };       // Compliant\n    }\n\n    public void Array(string nonNullable, string? nullable)\n    {\n        _ = new[] { new { X = (string?)nonNullable }, new { X = (string?)null } };  // Compliant\n        _ = new[] { new { X = (string?)nullable }, new { X = (string?)null } };     // Noncompliant\n        _ = new[] { new { X = (string?)nonNullable } };                             // Compliant\n        _ = new[] { new { X = (string?)nullable } };                                // Noncompliant\n        _ = new[] { new HoldsObject(new { X = (string?)nonNullable }) };            // Compliant\n        _ = new[] { new HoldsObject(new { X = (string?)nullable }) };               // Noncompliant\n    }\n\n    public void SwitchExpression(string nonNullable, string? nullable)\n    {\n        _ = true switch\n        {\n            true => new { X = (string?)nonNullable },   // Compliant\n            false => new { X = (string?)null }          // Compliant\n        };\n        _ = true switch\n        {\n            true => new { X = (string?)nullable },   // Noncompliant\n            false => new { X = (string?)null }          // Compliant\n        };\n    }\n}\n\ninternal class HoldsObject\n{\n    object O { get; }\n    public HoldsObject(object o)\n    {\n        O = o;\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/8413\n// See also https://github.com/SonarSource/sonar-dotnet/pull/7036\nclass Repro_8413\n{\n    public IEnumerable<string> GetNonNullStringsDirectCast(IEnumerable<string?> strings)\n    {\n        return (IEnumerable<string>)strings.Where(s => s != null); // Compliant\n    }\n\n    public IEnumerable<string> GetNonNullStringsMethodCast(IEnumerable<string?> strings)\n    {\n        return strings.Where(s => s != null).Cast<string>(); // Compliant\n    }\n\n    public IEnumerable<string> GetNonNullStringsAsCast(IEnumerable<string?> strings)\n    {\n        return strings.Where(s => s != null) as IEnumerable<string>;  // Compliant\n    }\n}\n\npublic static class Test\n{\n    public static IEnumerable<T> WhereNotNull<T>(IEnumerable<T?> result) =>\n        result.OfType<T>();\n\n    public static IEnumerable<T> Another<T>(IEnumerable<T> result) =>\n        result.OfType<T>();  // Noncompliant\n\n    public static void SpanConversion()\n    {\n        const int bufferSize = 1024;\n        var buffer1 = (Span<char>)stackalloc char[bufferSize]; // Compliant, stackalloc returns char* without the cast\n        var buffer2 = (Span<char>)stackalloc char[] { 'c' };\n        var buffer3 = (Span<char>)stackalloc [] { 'c' }; // Implicit stackalloc array creation expression\n        var buffer4 = (Span<char>)(stackalloc char[bufferSize]); \n        unsafe\n        {\n            var buffer5 = (char*)stackalloc char[bufferSize]; // Error [CS8346] (This would have been a FN, but it doesn't compile. See also https://github.com/dotnet/roslyn/issues/23995)\n        }\n    }\n}\n\npublic class DefaultLiteralTest\n{\n    // https://sonarsource.atlassian.net/browse/NET-2198\n    public static void NET2198()\n    {\n        _ = new Result<Foo>((Foo)default!); // Compliant, without the cast the overload resolution of the ctor would be ambiguous. Without the null supression (!) two warnings would be raised:\n                                            // CS8600: Converting null literal or possible null value to non-nullable type.\n                                            // CS8625: Cannot convert null literal to non-nullable reference type.\n    }\n    public record Result<TR>\n    {\n        public Result(TR value) { }\n        public Result(DefaultLiteralTest other) { }\n    }\n    public class Foo { }\n}\n\nstatic class Extensions\n{\n    extension(IEnumerable source)\n    {\n        public IEnumerable<T1> OfType<T1, T2>() => source.OfType<T1>();\n        public IEnumerable<T1> Cast<T1, T2>() => source.Cast<T1>();\n        public int OfType<T1, T2, T3>() => 0;\n        public int Cast<T1, T2, T3>() => 0;\n    }\n\n    static void Method(IEnumerable<int> intValues, List<string> stringValues)\n    {\n        intValues.OfType<int, string>();        // FN NET-2746\n        intValues.Cast<int, string>();          // FN NET-2746\n        stringValues.OfType<string, string>();\n        stringValues.Cast<string, string>();    // FN NET-2746\n\n        intValues.OfType<int, int, int>();\n        intValues.Cast<int, int, int>();\n    }\n}\n\nclass FieldKeyword\n{\n    int Property\n    {\n        get => (int)field;          // Noncompliant\n        set => field = (int)value;  // Noncompliant\n    }\n}\n\nclass ImplicitSpanConversion\n{\n    void Method(string[] array)\n    {\n        Span<string> span = (Span<string>)array;                                        // FN NET-2747\n        ReadOnlySpan<string> readOnlySpan = (ReadOnlySpan<string>)array;                // FN NET-2747\n        readOnlySpan = (ReadOnlySpan<string>)span;                                      // FN NET-2747\n        ReadOnlySpan<object> objectReadOnlySpan = (ReadOnlySpan<object>)readOnlySpan;   // FN NET-2747\n        ReadOnlySpan<char> chars = (ReadOnlySpan<char>)\"string\";                        // FN NET-2747\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantCast.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Tests.Diagnostics\n{\n    public class RedundantCast\n    {\n        void foo(long l)\n        {\n            var x = new int[] { 1, 2, 3 }.Cast<int>(); // Noncompliant\n//                                       ^^^^^^^^^^^^\n            x = Enumerable // Noncompliant\n                .Cast<int>(new int[] { 1, 2, 3 });\n            x = x\n                .OfType<int>(); //Noncompliant\n            x = x.Cast<int>(); //Noncompliant\n\n            var y = x.OfType<object>();\n\n            var zz = (int)l;\n            int i = 0;\n            var z = (int)i; // Noncompliant {{Remove this unnecessary cast to 'int'.}}\n//                   ^^^\n            z = (Int32)i; // Noncompliant {{Remove this unnecessary cast to 'int'.}}\n\n            var w = (object)i;\n\n            method(new int[] { 1, 2, 3 }.Cast<int>()); // Noncompliant {{Remove this unnecessary cast to 'IEnumerable<int>'.}}\n        }\n        void method(IEnumerable<int> enumerable)\n        { }\n\n        void M()\n        {\n            var o = new object();\n            var oo = o as object; // Noncompliant\n            var i = o as RedundantCast; // Compliant\n        }\n\n        public void N(int[,] numbers)\n        {\n            numbers.Cast<int>().Where(x => x > 0); // Compliant, multidimensional arrays need to be cast\n        }\n\n        // https://github.com/SonarSource/sonar-dotnet/issues/3273\n        public void OfTypeWithReferenceTypes(IEnumerable<object> param)\n        {\n            var stringArrayWithNull = new string[] { \"one\", \"two\", null, \"three\" };\n            var filteredStringArray = stringArrayWithNull.OfType<string>(); // Compliant, has 3 items, without 'null'\n\n            var enumerableOfObjects = new object[] { 1, \"one\", null };\n            var filteredObjectArray = enumerableOfObjects.OfType<object>(); // Compliant, has 2 items, without 'null'\n\n            var enumerableOfNullableInt = new int?[] { 1, 2, null };\n            var filteredInts = enumerableOfNullableInt.OfType<int?>(); // Compliant, has 2 items, without 'null'\n\n            param.OfType<object>(); // Compliant, may contain null values\n\n            var useless = new string[] { \"one\", \"two\" }.OfType<string>(); // FN\n        }\n\n        public void CastWithReferenceTypes(IEnumerable<object> param)\n        {\n            var stringArrayWithNull = new string[] { \"one\", \"two\", null, \"three\" };\n            var castStringArray = stringArrayWithNull.Cast<string>(); // Noncompliant\n\n            var enumerableOfObjects = new object[] { 1, \"one\", null };\n            var filteredObjectArray = enumerableOfObjects.Cast<object>(); // Noncompliant\n\n            var enumerableOfNullableInt = new int?[] { 1, 2, null };\n            var filteredInts = enumerableOfNullableInt.Cast<int?>(); // Noncompliant\n\n            param.Cast<object>(); // Noncompliant\n        }\n    }\n\n    public static class MyEnumerableExtensions\n    {\n        public static IEnumerable<T1> OfType<T1, T2>(this IEnumerable source) =>\n            source.OfType<T1>();\n        public static IEnumerable<T1> Cast<T1, T2>(this IEnumerable source) =>\n            source.Cast<T1>();\n        public static int OfType<T1, T2, T3>(this IEnumerable source) => 0;\n        public static int Cast<T1, T2, T3>(this IEnumerable source) => 0;\n    }\n\n    public class TestWithCustomExtension\n    {\n        public void UnlikelyCases(IEnumerable<int> intValues, List<string> stringValues)\n        {\n            intValues.OfType<int, string>(); // Noncompliant\n            intValues.Cast<int, string>(); // Noncompliant\n            stringValues.OfType<string, string>();\n            stringValues.Cast<string, string>(); // Noncompliant\n\n            intValues.OfType<int, int, int>();\n            intValues.Cast<int, int, int>();\n        }\n    }\n\n    public class MoreTests\n    {\n        public void Foo(IEnumerable enumerable, IEnumerable<object> genericEnumerable)\n        {\n            enumerable.OfType<int>();\n            enumerable.OfType<string>();\n\n            genericEnumerable.Select(x => x).Select(x => x).OfType<string>();\n            genericEnumerable.Select(x => x).Select(x => x).OfType<string>().OfType<string>();\n            genericEnumerable.Select(x => x).Select(x => x).OfType<int>();\n            genericEnumerable.Select(x => x).Select(x => x).OfType<int>().OfType<int>(); // Noncompliant\n        }\n\n        public void OfType() => OfType();\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/9498\n    public class Repro_9498\n    {\n        void Sample(float x)\n        {\n            float res = 1 / (float)(x * 2); // Noncompliant FP\n        }\n    }\n\n    // https://sonarsource.atlassian.net/browse/NET-1183\n    public class NumberLiteralSuffixes\n    {\n        void Numbers()\n        {\n            var d0 = (decimal)12.0;     // FN: use 12.0m\n            var d1 = (decimal)12;       // FN: use 12m\n            var d2 = (double)12;        // FN: use 12d\n            var f0 = (float)12.0;       // FN: use 12.0f\n            var n0 = (uint)12;          // FN: use 12u\n            var n1 = (long)12;          // FN: use 12l\n            var n2 = (ulong)12;         // FN: use 12ul\n\n            var n3 = (uint)0x12;        // FN: use 0x12u\n            var n4 = (uint)0b101;       // FN: use 0b101u\n\n            var n5 = (UInt32)12;        // FN: use 12u\n            var n6 = (byte)12;          // Compliant, there is no suffix for byte\n            var n7 = 0xFF_FF_FF_FF_FFl; // Compliant, \"l\" is redundant here but for readability it's better to keep it\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantConditionalAroundAssignment.Fixed.cs",
    "content": "﻿namespace Tests.Diagnostics\n{\n    public class RedundantConditionalAroundAssignment\n    {\n        public static void Test()\n        {\n            var x = \"\";\n\n            if (x == \"\")\n            {\n                x = \"\";\n            }\n\n            x = null;\n\n            if (!(x is null)) // FN (is expression not supported yet)\n            {\n                x = null;\n            }\n\n            if (x is null) // Compliant\n            {\n                x = null;\n            }\n\n            if (x != null) // Compliant FN\n                x = null;\n\n            x = null;\n\n            x = null;\n\n            x = (null);\n\n            object a = null;\n            switch (a)\n            {\n                case null:   // Compliant FN\n                    {\n                        a = null;\n                    }\n                    break;\n                default:\n                    break;\n            }\n\n            if (null != x)\n            {\n                x = null;\n                x = \"\";\n            }\n\n            if (null != x)\n            {\n                x += \"\";\n            }\n\n            if ((null != x))\n            {\n                x = (null);\n            }\n            else\n            { }\n\n            if (true)\n            { }\n            else if ((null != x))\n            {\n                x = (null);\n            }\n\n            if (null != x)\n            {\n                x = \"\";\n            }\n\n            if (null != x)\n            {\n                Test();\n            }\n\n            if (null == x)\n            {\n                x = null;\n            }\n\n            var y = 1;\n            if (y == 2)\n            {\n                y += 2;\n            }\n\n            if (Property != 42)\n            {\n                Property = 42;\n            }\n\n            int i = 0;\n            if (i++)   // Error [CS0029]\n            {\n                i = 0;\n            }\n        }\n\n        private static int? f;\n        // Do not report issue on field check within a property accessor as it might be expensive to set again the value\n        public static int Property\n        {\n            get\n            {\n                f = null;\n\n                return 1;\n            }\n            set\n            {\n                if (f != null)  // Compliant, don't raise in setter\n                {\n                    f = null;\n                }\n            }\n        }\n\n        int x;\n\n        void MemberAccess(RedundantConditionalAroundAssignment r, int a)\n        {\n            r.x = a;\n\n            r.x = a;        // Compliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantConditionalAroundAssignment.Latest.Fixed.cs",
    "content": "﻿using System;\n\nclass CSharp9\n{\n    void Method()\n    {\n        int x = 5;\n        int y = 6;\n\n        y = 5;\n\n        y = 5;\n\n        y = 5;\n\n        y = y switch\n        {\n            5 => 5, // Fixed\n            6 => 6  // Fixed\n        };\n\n        y = y switch\n        {\n            not 5 when x == 5 => 5\n        };\n\n        y = y switch\n        {\n            5 => 6\n        };\n\n        x = y switch\n        {\n            5 => 6\n        };\n\n        y = y switch\n        {\n            4 => 4,      // Fixed\n            not 5 => 5,\n        };\n\n        y = 5;\n\n        y = y switch\n        {\n            5 => 6,\n            _ => y\n        };\n\n        y = y;\n\n        y = y switch\n        {\n            4 => 4,      // Fixed\n            not x => 5,  // Error [CS9135]\n        };\n\n        int z = y switch\n        {\n            not 5 => 5\n        };\n\n        if ((x, y) is (1, 2)) // FN (is expression not supported yet)\n        {\n            x = 1;\n            y = 2;\n        }\n\n        SomeClass someClass = new SomeClass() { SomeField = 42 };\n\n        someClass.SomeField = 42;\n\n        if (someClass is { SomeField: not 42 }) // FN (is and is not expression not supported yet)\n        {\n            someClass.SomeField = 42;\n        }\n    }\n\n    public class SomeClass\n    {\n        public int SomeField;\n    }\n\n    record Record\n    {\n        string x;\n\n        string CompliantProperty1\n        {\n            init\n            {\n                if (x != value)\n                {\n                    x = value;\n                }\n            }\n        }\n\n        string CompliantProperty2\n        {\n            init { x = value; }\n        }\n    }\n}\n\npublic static class SwitchExpressionCases\n{\n    public static Uri ToWebsocketUri(this Uri uri)\n    {\n        // See: https://github.com/SonarSource/sonar-dotnet/issues/5246\n        var builder = new UriBuilder(uri);\n        builder.Scheme = uri.Scheme switch\n        {\n            \"https\" => \"wss\",\n            \"http\" => \"ws\",\n            \"wss\" => \"wss\", // Compliant, if this is removed the switch logic changes\n            \"ws\" => \"ws\",   // Compliant, if this is removed the switch logic changes\n            _ => throw new ArgumentException($\"Cannot convert URI scheme '{uri.Scheme}' to a websocket scheme.\"),\n        };\n        return builder.Uri;\n    }\n\n    static string M(string s) =>\n        s switch\n        {\n            null => null, // Compliant, if this is removed \"s\" will be assigned non-empty is case of null.\n            \"\" => \"Empty\",\n            _ => \"Not empty\",\n        };\n}\n\n// Reproducer for https://github.com/SonarSource/sonar-dotnet/issues/6447\nclass Repro6447\n{\n    void MyMethod()\n    {\n        string x = null;\n\n        if (x is not null) // FN (is not expression not supported yet)\n        {\n            x = null;\n        }\n    }\n}\n\nclass CSharp10\n{\n    void Method()\n    {\n        int y = 6;\n\n        y = 5;\n\n        SomeClass someClass = new SomeClass() { SomeField1 = new SomeOtherClass() { SomeField2 = 42 } };\n\n        someClass.SomeField1.SomeField2 = 42;\n\n        if (someClass is { SomeField1: { SomeField2: not 42 } }) // FN (is expression not supported yet)\n        {\n            someClass.SomeField1.SomeField2 = 42;\n        }\n\n        if (someClass is { SomeField1.SomeField2: not 42 }) // FN (is expression not supported yet)\n        {\n            someClass.SomeField1.SomeField2 = 42;\n        }\n    }\n\n    public class SomeClass\n    {\n        public SomeOtherClass SomeField1;\n    }\n\n    public class SomeOtherClass\n    {\n        public int SomeField2;\n    }\n}\n\npublic class SomeClass\n{\n    public void Noncompliant(byte[] bytes)\n    {\n        if (bytes is [not 1, .., not 3]) // FN (is expression not supported yet)\n        {\n            bytes[0] = 1;\n            bytes[^1] = 3;\n        }\n    }\n\n    // https://sonarsource.atlassian.net/browse/NET-443\n    void IndexAccess()\n    {\n        DataBuffer buffer = new()\n        {\n            [-1] = -1,\n            [1] = 0,\n            [2] = 1,\n            [3] = 2,\n            [4] = 3,\n            [5] = 4,\n            [6] = 5,\n            [7] = 6,\n            [8] = 7,\n            [9] = 8\n        };\n        if (buffer[^1] != 9)\n        {\n            buffer[^1] = 9; // FN\n        }\n    }\n}\n\npublic class DataBuffer\n{\n    public int this[Index index]\n    {\n        get => 1;\n        set { /* not relevant */ }\n    }\n}\n\nclass FieldKeyword\n{\n    int Property\n    {\n        get\n        {\n            field = 0;\n\n            return field;\n        }\n        set\n        {\n            if (field != 0) // Compliant, don't raise in setter\n            {\n                field = 0;\n            }\n        }\n    }\n}\n\nclass NullConditionalAssignment\n{\n    int x;\n\n    void Method(NullConditionalAssignment n, int a)\n    {\n        if (n.x != a)   // FN NET-2751\n        {\n            n?.x = a;\n        }\n\n        n?.x = a;       // Compliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantConditionalAroundAssignment.Latest.cs",
    "content": "﻿using System;\n\nclass CSharp9\n{\n    void Method()\n    {\n        int x = 5;\n        int y = 6;\n\n        y = y switch\n        {\n            not 5 => 5 // Noncompliant\n        };\n\n        y = y switch\n        {\n            5 => 5 // Noncompliant\n        };\n\n        y = y switch\n        {\n            5 when x == 5 => 5 // Noncompliant\n        };\n\n        y = y switch\n        {\n            5 => 5, // Noncompliant\n            6 => 6  // Noncompliant\n        };\n\n        y = y switch\n        {\n            not 5 when x == 5 => 5\n        };\n\n        y = y switch\n        {\n            5 => 6\n        };\n\n        x = y switch\n        {\n            5 => 6\n        };\n\n        y = y switch\n        {\n            4 => 4,      // Noncompliant\n            not 5 => 5,\n        };\n\n        y = x switch\n        {\n            _ => 5       // Noncompliant\n        };\n\n        y = y switch\n        {\n            5 => 6,\n            _ => y\n        };\n\n        y = y switch\n        {\n            _ => y       // Noncompliant\n        };\n\n        y = y switch\n        {\n            4 => 4,      // Noncompliant\n            not x => 5,  // Error [CS9135]\n        };\n\n        int z = y switch\n        {\n            not 5 => 5\n        };\n\n        if ((x, y) is (1, 2)) // FN (is expression not supported yet)\n        {\n            x = 1;\n            y = 2;\n        }\n\n        SomeClass someClass = new SomeClass() { SomeField = 42 };\n\n        if (someClass.SomeField != 42) // Noncompliant\n        {\n            someClass.SomeField = 42;\n        }\n\n        if (someClass is { SomeField: not 42 }) // FN (is and is not expression not supported yet)\n        {\n            someClass.SomeField = 42;\n        }\n    }\n\n    public class SomeClass\n    {\n        public int SomeField;\n    }\n\n    record Record\n    {\n        string x;\n\n        string CompliantProperty1\n        {\n            init\n            {\n                if (x != value)\n                {\n                    x = value;\n                }\n            }\n        }\n\n        string CompliantProperty2\n        {\n            init { x = value; }\n        }\n    }\n}\n\npublic static class SwitchExpressionCases\n{\n    public static Uri ToWebsocketUri(this Uri uri)\n    {\n        // See: https://github.com/SonarSource/sonar-dotnet/issues/5246\n        var builder = new UriBuilder(uri);\n        builder.Scheme = uri.Scheme switch\n        {\n            \"https\" => \"wss\",\n            \"http\" => \"ws\",\n            \"wss\" => \"wss\", // Compliant, if this is removed the switch logic changes\n            \"ws\" => \"ws\",   // Compliant, if this is removed the switch logic changes\n            _ => throw new ArgumentException($\"Cannot convert URI scheme '{uri.Scheme}' to a websocket scheme.\"),\n        };\n        return builder.Uri;\n    }\n\n    static string M(string s) =>\n        s switch\n        {\n            null => null, // Compliant, if this is removed \"s\" will be assigned non-empty is case of null.\n            \"\" => \"Empty\",\n            _ => \"Not empty\",\n        };\n}\n\n// Reproducer for https://github.com/SonarSource/sonar-dotnet/issues/6447\nclass Repro6447\n{\n    void MyMethod()\n    {\n        string x = null;\n\n        if (x is not null) // FN (is not expression not supported yet)\n        {\n            x = null;\n        }\n    }\n}\n\nclass CSharp10\n{\n    void Method()\n    {\n        int y = 6;\n\n        y = y switch\n        {\n            not 5 => 5 // Noncompliant\n        };\n\n        SomeClass someClass = new SomeClass() { SomeField1 = new SomeOtherClass() { SomeField2 = 42 } };\n\n        if (someClass.SomeField1.SomeField2 != 42) // Noncompliant\n        {\n            someClass.SomeField1.SomeField2 = 42;\n        }\n\n        if (someClass is { SomeField1: { SomeField2: not 42 } }) // FN (is expression not supported yet)\n        {\n            someClass.SomeField1.SomeField2 = 42;\n        }\n\n        if (someClass is { SomeField1.SomeField2: not 42 }) // FN (is expression not supported yet)\n        {\n            someClass.SomeField1.SomeField2 = 42;\n        }\n    }\n\n    public class SomeClass\n    {\n        public SomeOtherClass SomeField1;\n    }\n\n    public class SomeOtherClass\n    {\n        public int SomeField2;\n    }\n}\n\npublic class SomeClass\n{\n    public void Noncompliant(byte[] bytes)\n    {\n        if (bytes is [not 1, .., not 3]) // FN (is expression not supported yet)\n        {\n            bytes[0] = 1;\n            bytes[^1] = 3;\n        }\n    }\n\n    // https://sonarsource.atlassian.net/browse/NET-443\n    void IndexAccess()\n    {\n        DataBuffer buffer = new()\n        {\n            [-1] = -1,\n            [1] = 0,\n            [2] = 1,\n            [3] = 2,\n            [4] = 3,\n            [5] = 4,\n            [6] = 5,\n            [7] = 6,\n            [8] = 7,\n            [9] = 8\n        };\n        if (buffer[^1] != 9)\n        {\n            buffer[^1] = 9; // FN\n        }\n    }\n}\n\npublic class DataBuffer\n{\n    public int this[Index index]\n    {\n        get => 1;\n        set { /* not relevant */ }\n    }\n}\n\nclass FieldKeyword\n{\n    int Property\n    {\n        get\n        {\n            if (field != 0) // Noncompliant\n            {\n                field = 0;\n            }\n\n            return field;\n        }\n        set\n        {\n            if (field != 0) // Compliant, don't raise in setter\n            {\n                field = 0;\n            }\n        }\n    }\n}\n\nclass NullConditionalAssignment\n{\n    int x;\n\n    void Method(NullConditionalAssignment n, int a)\n    {\n        if (n.x != a)   // FN NET-2751\n        {\n            n?.x = a;\n        }\n\n        n?.x = a;       // Compliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantConditionalAroundAssignment.cs",
    "content": "﻿namespace Tests.Diagnostics\n{\n    public class RedundantConditionalAroundAssignment\n    {\n        public static void Test()\n        {\n            var x = \"\";\n\n            if (x == \"\")\n            {\n                x = \"\";\n            }\n\n            if (x != null) // Noncompliant\n//              ^^^^^^^^^\n            {\n                x = null;\n            }\n\n            if (!(x is null)) // FN (is expression not supported yet)\n            {\n                x = null;\n            }\n\n            if (x is null) // Compliant\n            {\n                x = null;\n            }\n\n            if (x != null) // Compliant FN\n                x = null;\n\n            if (null != x) // Noncompliant {{Remove this useless conditional.}}\n            {\n                x = null;\n            }\n\n            if (x != (null)) // Noncompliant\n            {\n                x = null;\n            }\n\n            if ((null != x)) // Noncompliant\n            {\n                x = (null);\n            }\n\n            object a = null;\n            switch (a)\n            {\n                case null:   // Compliant FN\n                    {\n                        a = null;\n                    }\n                    break;\n                default:\n                    break;\n            }\n\n            if (null != x)\n            {\n                x = null;\n                x = \"\";\n            }\n\n            if (null != x)\n            {\n                x += \"\";\n            }\n\n            if ((null != x))\n            {\n                x = (null);\n            }\n            else\n            { }\n\n            if (true)\n            { }\n            else if ((null != x))\n            {\n                x = (null);\n            }\n\n            if (null != x)\n            {\n                x = \"\";\n            }\n\n            if (null != x)\n            {\n                Test();\n            }\n\n            if (null == x)\n            {\n                x = null;\n            }\n\n            var y = 1;\n            if (y == 2)\n            {\n                y += 2;\n            }\n\n            if (Property != 42)\n            {\n                Property = 42;\n            }\n\n            int i = 0;\n            if (i++)   // Error [CS0029]\n            {\n                i = 0;\n            }\n        }\n\n        private static int? f;\n        // Do not report issue on field check within a property accessor as it might be expensive to set again the value\n        public static int Property\n        {\n            get\n            {\n                if (f != null) // Noncompliant\n                {\n                    f = null;\n                }\n\n                return 1;\n            }\n            set\n            {\n                if (f != null)  // Compliant, don't raise in setter\n                {\n                    f = null;\n                }\n            }\n        }\n\n        int x;\n\n        void MemberAccess(RedundantConditionalAroundAssignment r, int a)\n        {\n            if (r.x != a)   // Noncompliant\n            {\n                r.x = a;\n            }\n\n            r.x = a;        // Compliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantDeclaration.ArraySize.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    abstract class RedundantDeclaration\n    {\n        public RedundantDeclaration()\n        {\n            MyEvent += new EventHandler(Handle); // Fixed\n            MyEvent += (a, b) => { Handle(a, b); };\n\n            (new EventHandler(Handle))(1, null);\n\n            MyEvent2 = new MyMethod(Handle); // Fixed\n            MyEvent2 = new MyMethod(            // Fixed\n                delegate (int i, int j) { });   // Fixed\n\n            Delegate anotherEvent = new EventHandler(Handle);\n            BoolDelegate myDelegate = new BoolDelegate(() => true);      // Fixed\n\n            MyEvent2 = delegate (int i, int j) { Console.WriteLine(); }; // Fixed\n            MyEvent = delegate { Console.WriteLine(\"fdsfs\"); };\n\n            var l = new List<int>() { }; // Fixed\n            l = new List<int>();\n            var o = new object() { }; // Fixed\n            o = new object { };\n\n            var ints = new int[] { 1, 2, 3 }; // Fixed\n            ints = new[] { 1, 2, 3 };\n            ints = new int[] { 1, 2, 3 }; // Fixed\n            ints = new int[] { };\n\n            var ddd = new double[] { 1, 2, 3.0 }; // Compliant the element types are not the same as the specified one\n\n            var xxx = new int[,] { { 1, 1, 1 }, { 2, 2, 2 }, { 3, 3, 3 } };\n            var yyy = new int[,] { { 1, 1, 1 }, { 2, 2, 2 }, { 3, 3, 3 } };\n\n            // see https://github.com/SonarSource/sonar-dotnet/issues/1840\n            var multiDimIntArray = new int[][] // Compliant - type specifier is mandatory here\n            {\n                new int[] { 1 } // Fixed\n            };\n            var zzz = new int[][] { new[] { 1, 2, 3 }, new int[0], new int[0] };\n            var www = new int[][][] { new[] { new[] { 0 } } };\n\n            int? xx = ((new int?(5))); // Fixed\n            xx = new Nullable<int>(5); // Fixed\n            var rr = new int?(5);\n\n            NullableTest1(new int?(5));\n            NullableTest1<int>(new int?(5)); // Fixed\n            NullableTest2(new int?(5)); // Fixed\n\n            Func<int, int?> f = new Func<int, int?>(// Fixed\n                i => new int?(i)); // Fixed\n            f = i =>\n            {\n                return new int?(i); // Fixed\n            };\n\n            Delegate d = new Action(() => { });\n            Delegate d2 = new Func<double>(() => { return 1; });\n\n            NullableTest2(f(5));\n\n            var f2 = new Func<int, int?>(i => i);\n\n            Func<int, int> f1 = (int i) => i; //Fixed\n            Func<int, int> f3 = (i) => i;\n            var transformer = Funcify((string x) => new { Original = x, Normalized = x.ToLower() });\n            var transformer2 = Funcify2((string x) => new { Original = x, Normalized = x.ToLower() }); // Fixed\n\n            RefDelegateMethod((ref int i) => { i++; });\n        }\n\n        public void M()\n        {\n            dynamic d = new object();\n            Test(d, new BoolDelegate(() => true)); // Special case, d is dynamic\n            Test2(null, new BoolDelegate(() => true)); // Compliant\n        }\n\n        public Delegate N()\n        {\n            Delegate foo;\n            foo = (new BoolDelegate(() => true));\n            return (new BoolDelegate(() => true));\n        }\n\n        public BoolDelegate O()\n        {\n            return (new BoolDelegate(() => true));        // Fixed\n        }\n\n        public Func<BoolDelegate> P()\n        {\n            return (() => new BoolDelegate(() => true));  // Fixed\n        }\n\n        public abstract void Test(object o, BoolDelegate f);\n        public abstract void Test2(object o, Delegate f);\n        public delegate bool BoolDelegate();\n\n        private event EventHandler MyEvent;\n        private event MyMethod MyEvent2;\n\n        private delegate void MyMethod(int i, int j);\n        private delegate void MyMethod2(ref int i);\n        private void RefDelegateMethod(MyMethod2 f) { }\n\n        public static Func<T, TResult> Funcify<T, TResult>(Func<T, TResult> f) { return f; }\n        public static Func<string, TResult> Funcify2<TResult>(Func<string, TResult> f) { return f; }\n\n        public static void NullableTest1<T>(T? x) where T : struct { }\n        public static void NullableTest2(int? x) { }\n\n        private void Handle(object sender, EventArgs e) {}\n        private void Handle(int i, int j) {}\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantDeclaration.ArrayType.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    abstract class RedundantDeclaration\n    {\n        public RedundantDeclaration()\n        {\n            MyEvent += new EventHandler(Handle); // Fixed\n            MyEvent += (a, b) => { Handle(a, b); };\n\n            (new EventHandler(Handle))(1, null);\n\n            MyEvent2 = new MyMethod(Handle); // Fixed\n            MyEvent2 = new MyMethod(            // Fixed\n                delegate (int i, int j) { });   // Fixed\n\n            Delegate anotherEvent = new EventHandler(Handle);\n            BoolDelegate myDelegate = new BoolDelegate(() => true);      // Fixed\n\n            MyEvent2 = delegate (int i, int j) { Console.WriteLine(); }; // Fixed\n            MyEvent = delegate { Console.WriteLine(\"fdsfs\"); };\n\n            var l = new List<int>() { }; // Fixed\n            l = new List<int>();\n            var o = new object() { }; // Fixed\n            o = new object { };\n\n            var ints = new[] { 1, 2, 3 }; // Fixed\n            ints = new[] { 1, 2, 3 };\n            ints = new int[3] { 1, 2, 3 }; // Fixed\n            ints = new int[] { };\n\n            var ddd = new double[] { 1, 2, 3.0 }; // Compliant the element types are not the same as the specified one\n\n            var xxx = new int[,] { { 1, 1, 1 }, { 2, 2, 2 }, { 3, 3, 3 } };\n            var yyy = new int[3 // Fixed\n                , 3// Fixed\n                ] { { 1, 1, 1 }, { 2, 2, 2 }, { 3, 3, 3 } };\n\n            // see https://github.com/SonarSource/sonar-dotnet/issues/1840\n            var multiDimIntArray = new int[][] // Compliant - type specifier is mandatory here\n            { new[] { 1 } // Fixed\n            };\n            var zzz = new int[][] { new[] { 1, 2, 3 }, new int[0], new int[0] };\n            var www = new int[][][] { new[] { new[] { 0 } } };\n\n            int? xx = ((new int?(5))); // Fixed\n            xx = new Nullable<int>(5); // Fixed\n            var rr = new int?(5);\n\n            NullableTest1(new int?(5));\n            NullableTest1<int>(new int?(5)); // Fixed\n            NullableTest2(new int?(5)); // Fixed\n\n            Func<int, int?> f = new Func<int, int?>(// Fixed\n                i => new int?(i)); // Fixed\n            f = i =>\n            {\n                return new int?(i); // Fixed\n            };\n\n            Delegate d = new Action(() => { });\n            Delegate d2 = new Func<double>(() => { return 1; });\n\n            NullableTest2(f(5));\n\n            var f2 = new Func<int, int?>(i => i);\n\n            Func<int, int> f1 = (int i) => i; //Fixed\n            Func<int, int> f3 = (i) => i;\n            var transformer = Funcify((string x) => new { Original = x, Normalized = x.ToLower() });\n            var transformer2 = Funcify2((string x) => new { Original = x, Normalized = x.ToLower() }); // Fixed\n\n            RefDelegateMethod((ref int i) => { i++; });\n        }\n\n        public void M()\n        {\n            dynamic d = new object();\n            Test(d, new BoolDelegate(() => true)); // Special case, d is dynamic\n            Test2(null, new BoolDelegate(() => true)); // Compliant\n        }\n\n        public Delegate N()\n        {\n            Delegate foo;\n            foo = (new BoolDelegate(() => true));\n            return (new BoolDelegate(() => true));\n        }\n\n        public BoolDelegate O()\n        {\n            return (new BoolDelegate(() => true));        // Fixed\n        }\n\n        public Func<BoolDelegate> P()\n        {\n            return (() => new BoolDelegate(() => true));  // Fixed\n        }\n\n        public abstract void Test(object o, BoolDelegate f);\n        public abstract void Test2(object o, Delegate f);\n        public delegate bool BoolDelegate();\n\n        private event EventHandler MyEvent;\n        private event MyMethod MyEvent2;\n\n        private delegate void MyMethod(int i, int j);\n        private delegate void MyMethod2(ref int i);\n        private void RefDelegateMethod(MyMethod2 f) { }\n\n        public static Func<T, TResult> Funcify<T, TResult>(Func<T, TResult> f) { return f; }\n        public static Func<string, TResult> Funcify2<TResult>(Func<string, TResult> f) { return f; }\n\n        public static void NullableTest1<T>(T? x) where T : struct { }\n        public static void NullableTest2(int? x) { }\n\n        private void Handle(object sender, EventArgs e) {}\n        private void Handle(int i, int j) {}\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantDeclaration.CSharp10.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    abstract class RedundantDeclaration\n    {\n        public void M()\n        {\n            Test(null, new BoolDelegate(() => true)); // Compliant (natural type is Func<bool> and not BoolDelegate)\n            Test(null, () => true);   // Fixed\n        }\n\n        public abstract void Test(object o, Delegate f);\n        public delegate bool BoolDelegate();\n    }\n\n    // https://sonarsource.atlassian.net/browse/NET-3456\n    class Repro_NET3456\n    {\n        [AttributeUsage(AttributeTargets.Parameter)]\n        class BindingAttribute : Attribute { }\n\n        void Test()\n        {\n            Action<int> withoutAttribute = (x) => { };           // Fixed\n            Action<int> withAttribute    = ([Binding] x) => { }; // Fixed\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantDeclaration.CSharp10.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    abstract class RedundantDeclaration\n    {\n        public void M()\n        {\n            Test(null, new BoolDelegate(() => true)); // Compliant (natural type is Func<bool> and not BoolDelegate)\n            Test(null, new Func<bool>(() => true));   // Noncompliant\n        }\n\n        public abstract void Test(object o, Delegate f);\n        public delegate bool BoolDelegate();\n    }\n\n    // https://sonarsource.atlassian.net/browse/NET-3456\n    class Repro_NET3456\n    {\n        [AttributeUsage(AttributeTargets.Parameter)]\n        class BindingAttribute : Attribute { }\n\n        void Test()\n        {\n            Action<int> withoutAttribute = (x) => { };           // Noncompliant {{'x' is not used. Use discard parameter instead.}}\n            Action<int> withAttribute    = ([Binding] x) => { }; // Noncompliant - FP: x is annotated; the attribute may be consumed by a framework (e.g. [FromRoute], [JsonProperty])\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantDeclaration.CSharp12.ArraySize.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace AliasAnyType\n{\n    using Int = int;\n    using IntArray = int[];\n    using IntNullable = int?;\n    using Point = (int x, int y);\n    using ThreeInts = int[3];                   // Error [CS0270]: Array size cannot be specified in a variable declaration\n    using IntToIntFunc = Func<int, int>;\n\n    class AClass\n    {\n        void AliasWithArraySize()\n        {\n            IntArray a1 = new Int[] { 1, 2, 3 };  // Fixed\n        }\n\n        void AliasWithUnnecessaryType()\n        {\n            IntToIntFunc f = (Int i) => i;      // Fixed\n        }\n\n        void AliasWithInitializer()\n        {\n            IntArray a1 = new IntArray { };     // Error [CS8386]: Invalid object creation\n            var a2 = new IntArray { };          // Error [CS8386]: Invalid object creation\n            int[] a3 = new IntArray();          // Error [CS8386]: Invalid object creation\n        }\n\n        void AliasWithEmptyParamsList()\n        {\n            IntArray a1 = new IntArray();       // Error [CS8386]: Invalid object creation\n            var a2 = new IntArray();            // Error [CS8386]: Invalid object creation\n            int[] a3 = new IntArray();          // Error [CS8386]: Invalid object creation\n        }\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/8115\nnamespace Repro_8115\n{\n    class CollectionExpressions\n    {\n        void ExplicitTypeDeclaration()\n        {\n            int[] a1 = [1, 2, 3];         // Compliant\n            a1 = [1, 2, 3];               // Compliant, reassignment\n            int[] a2 = new[] { 1, 2, 3 }; // FN, can be written as [1, 2, 3]\n            a2 = new[] { 1, 2, 3 };       // FN, can be written as [1, 2, 3], reassignment\n        }\n\n        void VarDeclarationWithInlineAssignment()\n        {\n            var invalid = [1, 2, 3];            // Error [CS9176] There is no target type for the collection expression.\n        }\n\n        void VarDeclarationWithReassignment()\n        {\n            var typeInferredAndReassigned = new[] { 1, 2, 3 }; // Compliant, cannot be written as [1, 2, 3]\n            typeInferredAndReassigned = new[] { 1, 2, 3 };     // FN, can be written as [1, 2, 3], reassignment of a type-inferred variable\n            typeInferredAndReassigned = new int[] { 1, 2, 3 }; // Fixed\n            typeInferredAndReassigned = [];                    // Compliant\n            typeInferredAndReassigned = new int[] { };         // FN, can be written as []\n        }\n\n        void VarDeclarationWithReassignmentToEmptyCollection()\n        {\n            var typeInferredAndReassigned = new[] { 1, 2, 3 };\n            typeInferredAndReassigned = new[] { };             // Error [CS0826] No best type found for implicitly-typed array\n        }\n    }\n}\n\n// https://sonarsource.atlassian.net/browse/NET-882\nnamespace ReproNET882\n{\n    public class ReproNet882\n    {\n        public void Method()\n        {\n            // In this example, the method group has a natural type of Action<object, EventArgs> and the action delegate is up-casted by AddHandler to Delegate.\n            // (The EventHandler delegate has the exact same definition as the Action but they are different delegate types).\n            // https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-10.0/lambda-improvements#natural-function-type\n            AddHandler(OnErrorEvent);                   // Could lead to a runtime error (e.g.: WPF) because the delegate type of the method group is Action<object, EventArgs> instead of EventHandler.\n            AddHandler(new EventHandler(OnErrorEvent)); // Compliant, the inferred natural type is Action<object, EventArgs> and therefore the delegate type must be explicit specified.\n        }\n        private void OnErrorEvent(object sender, EventArgs e) { }\n\n        public void AddHandler(Delegate handler)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantDeclaration.CSharp12.LambdaParameterType.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace AliasAnyType\n{\n    using Int = int;\n    using IntArray = int[];\n    using IntNullable = int?;\n    using Point = (int x, int y);\n    using ThreeInts = int[3];                   // Error [CS0270]: Array size cannot be specified in a variable declaration\n    using IntToIntFunc = Func<int, int>;\n\n    class AClass\n    {\n        void AliasWithArraySize()\n        {\n            IntArray a1 = new Int[3] { 1, 2, 3 };  // Fixed\n        }\n\n        void AliasWithUnnecessaryType()\n        {\n            IntToIntFunc f = (i) => i;      // Fixed\n        }\n\n        void AliasWithInitializer()\n        {\n            IntArray a1 = new IntArray { };     // Error [CS8386]: Invalid object creation\n            var a2 = new IntArray { };          // Error [CS8386]: Invalid object creation\n            int[] a3 = new IntArray();          // Error [CS8386]: Invalid object creation\n        }\n\n        void AliasWithEmptyParamsList()\n        {\n            IntArray a1 = new IntArray();       // Error [CS8386]: Invalid object creation\n            var a2 = new IntArray();            // Error [CS8386]: Invalid object creation\n            int[] a3 = new IntArray();          // Error [CS8386]: Invalid object creation\n        }\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/8115\nnamespace Repro_8115\n{\n    class CollectionExpressions\n    {\n        void ExplicitTypeDeclaration()\n        {\n            int[] a1 = [1, 2, 3];         // Compliant\n            a1 = [1, 2, 3];               // Compliant, reassignment\n            int[] a2 = new[] { 1, 2, 3 }; // FN, can be written as [1, 2, 3]\n            a2 = new[] { 1, 2, 3 };       // FN, can be written as [1, 2, 3], reassignment\n        }\n\n        void VarDeclarationWithInlineAssignment()\n        {\n            var invalid = [1, 2, 3];            // Error [CS9176] There is no target type for the collection expression.\n        }\n\n        void VarDeclarationWithReassignment()\n        {\n            var typeInferredAndReassigned = new[] { 1, 2, 3 }; // Compliant, cannot be written as [1, 2, 3]\n            typeInferredAndReassigned = new[] { 1, 2, 3 };     // FN, can be written as [1, 2, 3], reassignment of a type-inferred variable\n            typeInferredAndReassigned = new int[] { 1, 2, 3 }; // Fixed\n            typeInferredAndReassigned = [];                    // Compliant\n            typeInferredAndReassigned = new int[] { };         // FN, can be written as []\n        }\n\n        void VarDeclarationWithReassignmentToEmptyCollection()\n        {\n            var typeInferredAndReassigned = new[] { 1, 2, 3 };\n            typeInferredAndReassigned = new[] { };             // Error [CS0826] No best type found for implicitly-typed array\n        }\n    }\n}\n\n// https://sonarsource.atlassian.net/browse/NET-882\nnamespace ReproNET882\n{\n    public class ReproNet882\n    {\n        public void Method()\n        {\n            // In this example, the method group has a natural type of Action<object, EventArgs> and the action delegate is up-casted by AddHandler to Delegate.\n            // (The EventHandler delegate has the exact same definition as the Action but they are different delegate types).\n            // https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-10.0/lambda-improvements#natural-function-type\n            AddHandler(OnErrorEvent);                   // Could lead to a runtime error (e.g.: WPF) because the delegate type of the method group is Action<object, EventArgs> instead of EventHandler.\n            AddHandler(new EventHandler(OnErrorEvent)); // Compliant, the inferred natural type is Action<object, EventArgs> and therefore the delegate type must be explicit specified.\n        }\n        private void OnErrorEvent(object sender, EventArgs e) { }\n\n        public void AddHandler(Delegate handler)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantDeclaration.CSharp12.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace AliasAnyType\n{\n    using Int = int;\n    using IntArray = int[];\n    using IntNullable = int?;\n    using Point = (int x, int y);\n    using ThreeInts = int[3];                   // Error [CS0270]: Array size cannot be specified in a variable declaration\n    using IntToIntFunc = Func<int, int>;\n\n    class AClass\n    {\n        void AliasWithArraySize()\n        {\n            IntArray a1 = new Int[3] { 1, 2, 3 };  // Noncompliant\n        }\n\n        void AliasWithUnnecessaryType()\n        {\n            IntToIntFunc f = (Int i) => i;      // Noncompliant {{Remove the type specification; it is redundant.}}\n        }\n\n        void AliasWithInitializer()\n        {\n            IntArray a1 = new IntArray { };     // Error [CS8386]: Invalid object creation\n            var a2 = new IntArray { };          // Error [CS8386]: Invalid object creation\n            int[] a3 = new IntArray();          // Error [CS8386]: Invalid object creation\n        }\n\n        void AliasWithEmptyParamsList()\n        {\n            IntArray a1 = new IntArray();       // Error [CS8386]: Invalid object creation\n            var a2 = new IntArray();            // Error [CS8386]: Invalid object creation\n            int[] a3 = new IntArray();          // Error [CS8386]: Invalid object creation\n        }\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/8115\nnamespace Repro_8115\n{\n    class CollectionExpressions\n    {\n        void ExplicitTypeDeclaration()\n        {\n            int[] a1 = [1, 2, 3];         // Compliant\n            a1 = [1, 2, 3];               // Compliant, reassignment\n            int[] a2 = new[] { 1, 2, 3 }; // FN, can be written as [1, 2, 3]\n            a2 = new[] { 1, 2, 3 };       // FN, can be written as [1, 2, 3], reassignment\n        }\n\n        void VarDeclarationWithInlineAssignment()\n        {\n            var invalid = [1, 2, 3];            // Error [CS9176] There is no target type for the collection expression.\n        }\n\n        void VarDeclarationWithReassignment()\n        {\n            var typeInferredAndReassigned = new[] { 1, 2, 3 }; // Compliant, cannot be written as [1, 2, 3]\n            typeInferredAndReassigned = new[] { 1, 2, 3 };     // FN, can be written as [1, 2, 3], reassignment of a type-inferred variable\n            typeInferredAndReassigned = new int[] { 1, 2, 3 }; // Noncompliant, can be written as [1, 2, 3]\n            typeInferredAndReassigned = [];                    // Compliant\n            typeInferredAndReassigned = new int[] { };         // FN, can be written as []\n        }\n\n        void VarDeclarationWithReassignmentToEmptyCollection()\n        {\n            var typeInferredAndReassigned = new[] { 1, 2, 3 };\n            typeInferredAndReassigned = new[] { };             // Error [CS0826] No best type found for implicitly-typed array\n        }\n    }\n}\n\n// https://sonarsource.atlassian.net/browse/NET-882\nnamespace ReproNET882\n{\n    public class ReproNet882\n    {\n        public void Method()\n        {\n            // In this example, the method group has a natural type of Action<object, EventArgs> and the action delegate is up-casted by AddHandler to Delegate.\n            // (The EventHandler delegate has the exact same definition as the Action but they are different delegate types).\n            // https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-10.0/lambda-improvements#natural-function-type\n            AddHandler(OnErrorEvent);                   // Could lead to a runtime error (e.g.: WPF) because the delegate type of the method group is Action<object, EventArgs> instead of EventHandler.\n            AddHandler(new EventHandler(OnErrorEvent)); // Compliant, the inferred natural type is Action<object, EventArgs> and therefore the delegate type must be explicit specified.\n        }\n        private void OnErrorEvent(object sender, EventArgs e) { }\n\n        public void AddHandler(Delegate handler)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantDeclaration.CSharp9.Fixed.cs",
    "content": "﻿using System;\n\nRecord r1 = new Record(); // Compliant - FN\nRecord r2 = null;\nr2 = new Record(); // Compliant - FN\n\nLocalStatic(new Record()); // Compliant - FN\nAction<int, int> a = static (_, _) => { };\n\nAction<int, int, int> b = static (_, p2, _) => { Console.WriteLine(p2); };\n\nAction<int> c = static (parameter1) => { Console.WriteLine(parameter1); }; // FN - Can be replaced with method group `Action<int> b = Console.WriteLine;`\n\nAction<int> d = static parameter1 => { Console.WriteLine(parameter1); }; // FN - Can be replaced with method group `Action<int> c = Console.WriteLine;`\n\nRecord Local() => new Record(); // Compliant - FN\nstatic Record LocalStatic(Record r) => r;\n\nint? xx = ((new int?(5))); // Fixed\n\nEventHandler myEvent = new((_, _) => { });\n\nrecord Record\n{\n    object field;\n\n    object Property\n    {\n        get { return new object(); } // Compliant - FN\n        init { field = new object(); } // Compliant - FN\n    }\n}\n\npublic class RedundantDeclaration\n{\n    public RedundantDeclaration()\n    {\n        MyEvent += new((_, _) => { });\n\n        object o = new() { }; // Fixed\n\n        _ = new Point[] // Fixed\n        {\n            new Point(1, 2),\n            new Point(1, 2),\n        };\n\n        _ = new Point[] // Fixed\n        {\n            new(1, 2),\n            new Point(1, 2),\n        };\n\n        _ = new Point[] // Compliant\n        {\n            new(1, 2),\n            new ChildPoint(1, 2),\n        };\n\n        // https://sonarsource.atlassian.net/browse/NET-2122\n        _ = new[] // FN\n        {\n            new Point(1, 2),\n            new Point(1, 2),\n        };\n\n        _ = new Point[] // Fixed\n        {\n            new Point(1, 2),\n            new Point(1, 2),\n        };\n\n        _ = new [] // Error [CS0826]\n        {\n            new(1, 2),\n            new(1, 2),\n        };\n\n        Point[] typed = new[] // Error [CS0826]\n        {\n            new(1, 2),\n            new(1, 2),\n        };\n    }\n\n    private event EventHandler MyEvent;\n\n    public record Point(int x, int y);\n\n    public record ChildPoint(int x, int y) : Point(x ,y);\n}\n\nabstract class NaturalDelegateTypes\n{\n    public void M()\n    {\n        Test(null, new BoolDelegate(() => true)); // Compliant\n        Test(null, new Func<bool>(() => true));   // Compliant. In C#9 \"CS1660: Cannot convert lambda expression to type 'Delegate' because it is not a delegate type\" is raised without the new Func<bool>(..)\n    }\n\n    public abstract void Test(object o, Delegate f);\n    public delegate bool BoolDelegate();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantDeclaration.CSharp9.cs",
    "content": "﻿using System;\n\nRecord r1 = new Record(); // Compliant - FN\nRecord r2 = null;\nr2 = new Record(); // Compliant - FN\n\nLocalStatic(new Record()); // Compliant - FN\nAction<int, int> a = static (parameter1, parameter2) => { };\n//                           ^^^^^^^^^^ {{'parameter1' is not used. Use discard parameter instead.}}\n//                                       ^^^^^^^^^^@-1 {{'parameter2' is not used. Use discard parameter instead.}}\n\nAction<int, int, int> b = static (p1, p2, p3) => { Console.WriteLine(p2); };\n//                                ^^ {{'p1' is not used. Use discard parameter instead.}}\n//                                        ^^@-1 {{'p3' is not used. Use discard parameter instead.}}\n\nAction<int> c = static (parameter1) => { Console.WriteLine(parameter1); }; // FN - Can be replaced with method group `Action<int> b = Console.WriteLine;`\n\nAction<int> d = static parameter1 => { Console.WriteLine(parameter1); }; // FN - Can be replaced with method group `Action<int> c = Console.WriteLine;`\n\nRecord Local() => new Record(); // Compliant - FN\nstatic Record LocalStatic(Record r) => r;\n\nint? xx = ((new int?(5))); // Noncompliant {{Remove the explicit nullable type creation; it is redundant.}}\n\nEventHandler myEvent = new((a, b) => { });\n//                     ^^^^^^^^^^^^^^^^^^ {{Remove the explicit delegate creation; it is redundant.}}\n//                          ^@-1 {{'a' is not used. Use discard parameter instead.}}\n//                             ^@-2 {{'b' is not used. Use discard parameter instead.}}\n\nrecord Record\n{\n    object field;\n\n    object Property\n    {\n        get { return new object(); } // Compliant - FN\n        init { field = new object(); } // Compliant - FN\n    }\n}\n\npublic class RedundantDeclaration\n{\n    public RedundantDeclaration()\n    {\n        MyEvent += new((a, b) => { });\n//                 ^^^^^^^^^^^^^^^^^^ {{Remove the explicit delegate creation; it is redundant.}}\n//                      ^@-1 {{'a' is not used. Use discard parameter instead.}}\n//                         ^@-2 {{'b' is not used. Use discard parameter instead.}}\n\n        object o = new() { }; // Noncompliant {{Remove the initializer; it is redundant.}}\n//                       ^^^\n\n        _ = new Point[] // Noncompliant\n        {\n            new Point(1, 2),\n            new Point(1, 2),\n        };\n\n        _ = new Point[] // Noncompliant\n        {\n            new(1, 2),\n            new Point(1, 2),\n        };\n\n        _ = new Point[] // Compliant\n        {\n            new(1, 2),\n            new ChildPoint(1, 2),\n        };\n\n        // https://sonarsource.atlassian.net/browse/NET-2122\n        _ = new[] // FN\n        {\n            new Point(1, 2),\n            new Point(1, 2),\n        };\n\n        _ = new Point[] // Noncompliant\n        {\n            new Point(1, 2),\n            new Point(1, 2),\n        };\n\n        _ = new [] // Error [CS0826]\n        {\n            new(1, 2),\n            new(1, 2),\n        };\n\n        Point[] typed = new[] // Error [CS0826]\n        {\n            new(1, 2),\n            new(1, 2),\n        };\n    }\n\n    private event EventHandler MyEvent;\n\n    public record Point(int x, int y);\n\n    public record ChildPoint(int x, int y) : Point(x ,y);\n}\n\nabstract class NaturalDelegateTypes\n{\n    public void M()\n    {\n        Test(null, new BoolDelegate(() => true)); // Compliant\n        Test(null, new Func<bool>(() => true));   // Compliant. In C#9 \"CS1660: Cannot convert lambda expression to type 'Delegate' because it is not a delegate type\" is raised without the new Func<bool>(..)\n    }\n\n    public abstract void Test(object o, Delegate f);\n    public delegate bool BoolDelegate();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantDeclaration.DelegateParameterList.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    abstract class RedundantDeclaration\n    {\n        public RedundantDeclaration()\n        {\n            MyEvent += new EventHandler(Handle); // Fixed\n            MyEvent += (a, b) => { Handle(a, b); };\n\n            (new EventHandler(Handle))(1, null);\n\n            MyEvent2 = new MyMethod(Handle); // Fixed\n            MyEvent2 = new MyMethod(            // Fixed\n                delegate { });   // Fixed\n\n            Delegate anotherEvent = new EventHandler(Handle);\n            BoolDelegate myDelegate = new BoolDelegate(() => true);      // Fixed\n\n            MyEvent2 = delegate { Console.WriteLine(); }; // Fixed\n            MyEvent = delegate { Console.WriteLine(\"fdsfs\"); };\n\n            var l = new List<int>() { }; // Fixed\n            l = new List<int>();\n            var o = new object() { }; // Fixed\n            o = new object { };\n\n            var ints = new int[] { 1, 2, 3 }; // Fixed\n            ints = new[] { 1, 2, 3 };\n            ints = new int[3] { 1, 2, 3 }; // Fixed\n            ints = new int[] { };\n\n            var ddd = new double[] { 1, 2, 3.0 }; // Compliant the element types are not the same as the specified one\n\n            var xxx = new int[,] { { 1, 1, 1 }, { 2, 2, 2 }, { 3, 3, 3 } };\n            var yyy = new int[3 // Fixed\n                , 3// Fixed\n                ] { { 1, 1, 1 }, { 2, 2, 2 }, { 3, 3, 3 } };\n\n            // see https://github.com/SonarSource/sonar-dotnet/issues/1840\n            var multiDimIntArray = new int[][] // Compliant - type specifier is mandatory here\n            {\n                new int[] { 1 } // Fixed\n            };\n            var zzz = new int[][] { new[] { 1, 2, 3 }, new int[0], new int[0] };\n            var www = new int[][][] { new[] { new[] { 0 } } };\n\n            int? xx = ((new int?(5))); // Fixed\n            xx = new Nullable<int>(5); // Fixed\n            var rr = new int?(5);\n\n            NullableTest1(new int?(5));\n            NullableTest1<int>(new int?(5)); // Fixed\n            NullableTest2(new int?(5)); // Fixed\n\n            Func<int, int?> f = new Func<int, int?>(// Fixed\n                i => new int?(i)); // Fixed\n            f = i =>\n            {\n                return new int?(i); // Fixed\n            };\n\n            Delegate d = new Action(() => { });\n            Delegate d2 = new Func<double>(() => { return 1; });\n\n            NullableTest2(f(5));\n\n            var f2 = new Func<int, int?>(i => i);\n\n            Func<int, int> f1 = (int i) => i; //Fixed\n            Func<int, int> f3 = (i) => i;\n            var transformer = Funcify((string x) => new { Original = x, Normalized = x.ToLower() });\n            var transformer2 = Funcify2((string x) => new { Original = x, Normalized = x.ToLower() }); // Fixed\n\n            RefDelegateMethod((ref int i) => { i++; });\n        }\n\n        public void M()\n        {\n            dynamic d = new object();\n            Test(d, new BoolDelegate(() => true)); // Special case, d is dynamic\n            Test2(null, new BoolDelegate(() => true)); // Compliant\n        }\n\n        public Delegate N()\n        {\n            Delegate foo;\n            foo = (new BoolDelegate(() => true));\n            return (new BoolDelegate(() => true));\n        }\n\n        public BoolDelegate O()\n        {\n            return (new BoolDelegate(() => true));        // Fixed\n        }\n\n        public Func<BoolDelegate> P()\n        {\n            return (() => new BoolDelegate(() => true));  // Fixed\n        }\n\n        public abstract void Test(object o, BoolDelegate f);\n        public abstract void Test2(object o, Delegate f);\n        public delegate bool BoolDelegate();\n\n        private event EventHandler MyEvent;\n        private event MyMethod MyEvent2;\n\n        private delegate void MyMethod(int i, int j);\n        private delegate void MyMethod2(ref int i);\n        private void RefDelegateMethod(MyMethod2 f) { }\n\n        public static Func<T, TResult> Funcify<T, TResult>(Func<T, TResult> f) { return f; }\n        public static Func<string, TResult> Funcify2<TResult>(Func<string, TResult> f) { return f; }\n\n        public static void NullableTest1<T>(T? x) where T : struct { }\n        public static void NullableTest2(int? x) { }\n\n        private void Handle(object sender, EventArgs e) {}\n        private void Handle(int i, int j) {}\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantDeclaration.ExplicitDelegate.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    abstract class RedundantDeclaration\n    {\n        public RedundantDeclaration()\n        {\n            MyEvent += Handle; // Fixed\n            MyEvent += (a, b) => { Handle(a, b); };\n\n            (new EventHandler(Handle))(1, null);\n\n            MyEvent2 = Handle; // Fixed\n            MyEvent2 = delegate (int i, int j) { };   // Fixed\n\n            Delegate anotherEvent = new EventHandler(Handle);\n            BoolDelegate myDelegate = () => true;      // Fixed\n\n            MyEvent2 = delegate (int i, int j) { Console.WriteLine(); }; // Fixed\n            MyEvent = delegate { Console.WriteLine(\"fdsfs\"); };\n\n            var l = new List<int>() { }; // Fixed\n            l = new List<int>();\n            var o = new object() { }; // Fixed\n            o = new object { };\n\n            var ints = new int[] { 1, 2, 3 }; // Fixed\n            ints = new[] { 1, 2, 3 };\n            ints = new int[3] { 1, 2, 3 }; // Fixed\n            ints = new int[] { };\n\n            var ddd = new double[] { 1, 2, 3.0 }; // Compliant the element types are not the same as the specified one\n\n            var xxx = new int[,] { { 1, 1, 1 }, { 2, 2, 2 }, { 3, 3, 3 } };\n            var yyy = new int[3 // Fixed\n                , 3// Fixed\n                ] { { 1, 1, 1 }, { 2, 2, 2 }, { 3, 3, 3 } };\n\n            // see https://github.com/SonarSource/sonar-dotnet/issues/1840\n            var multiDimIntArray = new int[][] // Compliant - type specifier is mandatory here\n            {\n                new int[] { 1 } // Fixed\n            };\n            var zzz = new int[][] { new[] { 1, 2, 3 }, new int[0], new int[0] };\n            var www = new int[][][] { new[] { new[] { 0 } } };\n\n            int? xx = ((new int?(5))); // Fixed\n            xx = new Nullable<int>(5); // Fixed\n            var rr = new int?(5);\n\n            NullableTest1(new int?(5));\n            NullableTest1<int>(new int?(5)); // Fixed\n            NullableTest2(new int?(5)); // Fixed\n\n            Func<int, int?> f = i => new int?(i); // Fixed\n            f = i =>\n            {\n                return new int?(i); // Fixed\n            };\n\n            Delegate d = new Action(() => { });\n            Delegate d2 = new Func<double>(() => { return 1; });\n\n            NullableTest2(f(5));\n\n            var f2 = new Func<int, int?>(i => i);\n\n            Func<int, int> f1 = (int i) => i; //Fixed\n            Func<int, int> f3 = (i) => i;\n            var transformer = Funcify((string x) => new { Original = x, Normalized = x.ToLower() });\n            var transformer2 = Funcify2((string x) => new { Original = x, Normalized = x.ToLower() }); // Fixed\n\n            RefDelegateMethod((ref int i) => { i++; });\n        }\n\n        public void M()\n        {\n            dynamic d = new object();\n            Test(d, new BoolDelegate(() => true)); // Special case, d is dynamic\n            Test2(null, new BoolDelegate(() => true)); // Compliant\n        }\n\n        public Delegate N()\n        {\n            Delegate foo;\n            foo = (new BoolDelegate(() => true));\n            return (new BoolDelegate(() => true));\n        }\n\n        public BoolDelegate O()\n        {\n            return (() => true);        // Fixed\n        }\n\n        public Func<BoolDelegate> P()\n        {\n            return (() => () => true);  // Fixed\n        }\n\n        public abstract void Test(object o, BoolDelegate f);\n        public abstract void Test2(object o, Delegate f);\n        public delegate bool BoolDelegate();\n\n        private event EventHandler MyEvent;\n        private event MyMethod MyEvent2;\n\n        private delegate void MyMethod(int i, int j);\n        private delegate void MyMethod2(ref int i);\n        private void RefDelegateMethod(MyMethod2 f) { }\n\n        public static Func<T, TResult> Funcify<T, TResult>(Func<T, TResult> f) { return f; }\n        public static Func<string, TResult> Funcify2<TResult>(Func<string, TResult> f) { return f; }\n\n        public static void NullableTest1<T>(T? x) where T : struct { }\n        public static void NullableTest2(int? x) { }\n\n        private void Handle(object sender, EventArgs e) {}\n        private void Handle(int i, int j) {}\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantDeclaration.ExplicitNullable.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    abstract class RedundantDeclaration\n    {\n        public RedundantDeclaration()\n        {\n            MyEvent += new EventHandler(Handle); // Fixed\n            MyEvent += (a, b) => { Handle(a, b); };\n\n            (new EventHandler(Handle))(1, null);\n\n            MyEvent2 = new MyMethod(Handle); // Fixed\n            MyEvent2 = new MyMethod(            // Fixed\n                delegate (int i, int j) { });   // Fixed\n\n            Delegate anotherEvent = new EventHandler(Handle);\n            BoolDelegate myDelegate = new BoolDelegate(() => true);      // Fixed\n\n            MyEvent2 = delegate (int i, int j) { Console.WriteLine(); }; // Fixed\n            MyEvent = delegate { Console.WriteLine(\"fdsfs\"); };\n\n            var l = new List<int>() { }; // Fixed\n            l = new List<int>();\n            var o = new object() { }; // Fixed\n            o = new object { };\n\n            var ints = new int[] { 1, 2, 3 }; // Fixed\n            ints = new[] { 1, 2, 3 };\n            ints = new int[3] { 1, 2, 3 }; // Fixed\n            ints = new int[] { };\n\n            var ddd = new double[] { 1, 2, 3.0 }; // Compliant the element types are not the same as the specified one\n\n            var xxx = new int[,] { { 1, 1, 1 }, { 2, 2, 2 }, { 3, 3, 3 } };\n            var yyy = new int[3 // Fixed\n                , 3// Fixed\n                ] { { 1, 1, 1 }, { 2, 2, 2 }, { 3, 3, 3 } };\n\n            // see https://github.com/SonarSource/sonar-dotnet/issues/1840\n            var multiDimIntArray = new int[][] // Compliant - type specifier is mandatory here\n            {\n                new int[] { 1 } // Fixed\n            };\n            var zzz = new int[][] { new[] { 1, 2, 3 }, new int[0], new int[0] };\n            var www = new int[][][] { new[] { new[] { 0 } } };\n\n            int? xx = ((5)); // Fixed\n            xx = 5; // Fixed\n            var rr = new int?(5);\n\n            NullableTest1(new int?(5));\n            NullableTest1<int>(5); // Fixed\n            NullableTest2(5); // Fixed\n\n            Func<int, int?> f = new Func<int, int?>(// Fixed\n                i => i); // Fixed\n            f = i =>\n            {\n                return i; // Fixed\n            };\n\n            Delegate d = new Action(() => { });\n            Delegate d2 = new Func<double>(() => { return 1; });\n\n            NullableTest2(f(5));\n\n            var f2 = new Func<int, int?>(i => i);\n\n            Func<int, int> f1 = (int i) => i; //Fixed\n            Func<int, int> f3 = (i) => i;\n            var transformer = Funcify((string x) => new { Original = x, Normalized = x.ToLower() });\n            var transformer2 = Funcify2((string x) => new { Original = x, Normalized = x.ToLower() }); // Fixed\n\n            RefDelegateMethod((ref int i) => { i++; });\n        }\n\n        public void M()\n        {\n            dynamic d = new object();\n            Test(d, new BoolDelegate(() => true)); // Special case, d is dynamic\n            Test2(null, new BoolDelegate(() => true)); // Compliant\n        }\n\n        public Delegate N()\n        {\n            Delegate foo;\n            foo = (new BoolDelegate(() => true));\n            return (new BoolDelegate(() => true));\n        }\n\n        public BoolDelegate O()\n        {\n            return (new BoolDelegate(() => true));        // Fixed\n        }\n\n        public Func<BoolDelegate> P()\n        {\n            return (() => new BoolDelegate(() => true));  // Fixed\n        }\n\n        public abstract void Test(object o, BoolDelegate f);\n        public abstract void Test2(object o, Delegate f);\n        public delegate bool BoolDelegate();\n\n        private event EventHandler MyEvent;\n        private event MyMethod MyEvent2;\n\n        private delegate void MyMethod(int i, int j);\n        private delegate void MyMethod2(ref int i);\n        private void RefDelegateMethod(MyMethod2 f) { }\n\n        public static Func<T, TResult> Funcify<T, TResult>(Func<T, TResult> f) { return f; }\n        public static Func<string, TResult> Funcify2<TResult>(Func<string, TResult> f) { return f; }\n\n        public static void NullableTest1<T>(T? x) where T : struct { }\n        public static void NullableTest2(int? x) { }\n\n        private void Handle(object sender, EventArgs e) {}\n        private void Handle(int i, int j) {}\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantDeclaration.LambdaParameterType.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    abstract class RedundantDeclaration\n    {\n        public RedundantDeclaration()\n        {\n            MyEvent += new EventHandler(Handle); // Fixed\n            MyEvent += (a, b) => { Handle(a, b); };\n\n            (new EventHandler(Handle))(1, null);\n\n            MyEvent2 = new MyMethod(Handle); // Fixed\n            MyEvent2 = new MyMethod(            // Fixed\n                delegate (int i, int j) { });   // Fixed\n\n            Delegate anotherEvent = new EventHandler(Handle);\n            BoolDelegate myDelegate = new BoolDelegate(() => true);      // Fixed\n\n            MyEvent2 = delegate (int i, int j) { Console.WriteLine(); }; // Fixed\n            MyEvent = delegate { Console.WriteLine(\"fdsfs\"); };\n\n            var l = new List<int>() { }; // Fixed\n            l = new List<int>();\n            var o = new object() { }; // Fixed\n            o = new object { };\n\n            var ints = new int[] { 1, 2, 3 }; // Fixed\n            ints = new[] { 1, 2, 3 };\n            ints = new int[3] { 1, 2, 3 }; // Fixed\n            ints = new int[] { };\n\n            var ddd = new double[] { 1, 2, 3.0 }; // Compliant the element types are not the same as the specified one\n\n            var xxx = new int[,] { { 1, 1, 1 }, { 2, 2, 2 }, { 3, 3, 3 } };\n            var yyy = new int[3 // Fixed\n                , 3// Fixed\n                ] { { 1, 1, 1 }, { 2, 2, 2 }, { 3, 3, 3 } };\n\n            // see https://github.com/SonarSource/sonar-dotnet/issues/1840\n            var multiDimIntArray = new int[][] // Compliant - type specifier is mandatory here\n            {\n                new int[] { 1 } // Fixed\n            };\n            var zzz = new int[][] { new[] { 1, 2, 3 }, new int[0], new int[0] };\n            var www = new int[][][] { new[] { new[] { 0 } } };\n\n            int? xx = ((new int?(5))); // Fixed\n            xx = new Nullable<int>(5); // Fixed\n            var rr = new int?(5);\n\n            NullableTest1(new int?(5));\n            NullableTest1<int>(new int?(5)); // Fixed\n            NullableTest2(new int?(5)); // Fixed\n\n            Func<int, int?> f = new Func<int, int?>(// Fixed\n                i => new int?(i)); // Fixed\n            f = i =>\n            {\n                return new int?(i); // Fixed\n            };\n\n            Delegate d = new Action(() => { });\n            Delegate d2 = new Func<double>(() => { return 1; });\n\n            NullableTest2(f(5));\n\n            var f2 = new Func<int, int?>(i => i);\n\n            Func<int, int> f1 = (i) => i; //Fixed\n            Func<int, int> f3 = (i) => i;\n            var transformer = Funcify((string x) => new { Original = x, Normalized = x.ToLower() });\n            var transformer2 = Funcify2((x) => new { Original = x, Normalized = x.ToLower() }); // Fixed\n\n            RefDelegateMethod((ref int i) => { i++; });\n        }\n\n        public void M()\n        {\n            dynamic d = new object();\n            Test(d, new BoolDelegate(() => true)); // Special case, d is dynamic\n            Test2(null, new BoolDelegate(() => true)); // Compliant\n        }\n\n        public Delegate N()\n        {\n            Delegate foo;\n            foo = (new BoolDelegate(() => true));\n            return (new BoolDelegate(() => true));\n        }\n\n        public BoolDelegate O()\n        {\n            return (new BoolDelegate(() => true));        // Fixed\n        }\n\n        public Func<BoolDelegate> P()\n        {\n            return (() => new BoolDelegate(() => true));  // Fixed\n        }\n\n        public abstract void Test(object o, BoolDelegate f);\n        public abstract void Test2(object o, Delegate f);\n        public delegate bool BoolDelegate();\n\n        private event EventHandler MyEvent;\n        private event MyMethod MyEvent2;\n\n        private delegate void MyMethod(int i, int j);\n        private delegate void MyMethod2(ref int i);\n        private void RefDelegateMethod(MyMethod2 f) { }\n\n        public static Func<T, TResult> Funcify<T, TResult>(Func<T, TResult> f) { return f; }\n        public static Func<string, TResult> Funcify2<TResult>(Func<string, TResult> f) { return f; }\n\n        public static void NullableTest1<T>(T? x) where T : struct { }\n        public static void NullableTest2(int? x) { }\n\n        private void Handle(object sender, EventArgs e) {}\n        private void Handle(int i, int j) {}\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantDeclaration.ObjectInitializer.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    abstract class RedundantDeclaration\n    {\n        public RedundantDeclaration()\n        {\n            MyEvent += new EventHandler(Handle); // Fixed\n            MyEvent += (a, b) => { Handle(a, b); };\n\n            (new EventHandler(Handle))(1, null);\n\n            MyEvent2 = new MyMethod(Handle); // Fixed\n            MyEvent2 = new MyMethod(            // Fixed\n                delegate (int i, int j) { });   // Fixed\n\n            Delegate anotherEvent = new EventHandler(Handle);\n            BoolDelegate myDelegate = new BoolDelegate(() => true);      // Fixed\n\n            MyEvent2 = delegate (int i, int j) { Console.WriteLine(); }; // Fixed\n            MyEvent = delegate { Console.WriteLine(\"fdsfs\"); };\n\n            var l = new List<int>(); // Fixed\n            l = new List<int>();\n            var o = new object(); // Fixed\n            o = new object { };\n\n            var ints = new int[] { 1, 2, 3 }; // Fixed\n            ints = new[] { 1, 2, 3 };\n            ints = new int[3] { 1, 2, 3 }; // Fixed\n            ints = new int[] { };\n\n            var ddd = new double[] { 1, 2, 3.0 }; // Compliant the element types are not the same as the specified one\n\n            var xxx = new int[,] { { 1, 1, 1 }, { 2, 2, 2 }, { 3, 3, 3 } };\n            var yyy = new int[3 // Fixed\n                , 3// Fixed\n                ] { { 1, 1, 1 }, { 2, 2, 2 }, { 3, 3, 3 } };\n\n            // see https://github.com/SonarSource/sonar-dotnet/issues/1840\n            var multiDimIntArray = new int[][] // Compliant - type specifier is mandatory here\n            {\n                new int[] { 1 } // Fixed\n            };\n            var zzz = new int[][] { new[] { 1, 2, 3 }, new int[0], new int[0] };\n            var www = new int[][][] { new[] { new[] { 0 } } };\n\n            int? xx = ((new int?(5))); // Fixed\n            xx = new Nullable<int>(5); // Fixed\n            var rr = new int?(5);\n\n            NullableTest1(new int?(5));\n            NullableTest1<int>(new int?(5)); // Fixed\n            NullableTest2(new int?(5)); // Fixed\n\n            Func<int, int?> f = new Func<int, int?>(// Fixed\n                i => new int?(i)); // Fixed\n            f = i =>\n            {\n                return new int?(i); // Fixed\n            };\n\n            Delegate d = new Action(() => { });\n            Delegate d2 = new Func<double>(() => { return 1; });\n\n            NullableTest2(f(5));\n\n            var f2 = new Func<int, int?>(i => i);\n\n            Func<int, int> f1 = (int i) => i; //Fixed\n            Func<int, int> f3 = (i) => i;\n            var transformer = Funcify((string x) => new { Original = x, Normalized = x.ToLower() });\n            var transformer2 = Funcify2((string x) => new { Original = x, Normalized = x.ToLower() }); // Fixed\n\n            RefDelegateMethod((ref int i) => { i++; });\n        }\n\n        public void M()\n        {\n            dynamic d = new object();\n            Test(d, new BoolDelegate(() => true)); // Special case, d is dynamic\n            Test2(null, new BoolDelegate(() => true)); // Compliant\n        }\n\n        public Delegate N()\n        {\n            Delegate foo;\n            foo = (new BoolDelegate(() => true));\n            return (new BoolDelegate(() => true));\n        }\n\n        public BoolDelegate O()\n        {\n            return (new BoolDelegate(() => true));        // Fixed\n        }\n\n        public Func<BoolDelegate> P()\n        {\n            return (() => new BoolDelegate(() => true));  // Fixed\n        }\n\n        public abstract void Test(object o, BoolDelegate f);\n        public abstract void Test2(object o, Delegate f);\n        public delegate bool BoolDelegate();\n\n        private event EventHandler MyEvent;\n        private event MyMethod MyEvent2;\n\n        private delegate void MyMethod(int i, int j);\n        private delegate void MyMethod2(ref int i);\n        private void RefDelegateMethod(MyMethod2 f) { }\n\n        public static Func<T, TResult> Funcify<T, TResult>(Func<T, TResult> f) { return f; }\n        public static Func<string, TResult> Funcify2<TResult>(Func<string, TResult> f) { return f; }\n\n        public static void NullableTest1<T>(T? x) where T : struct { }\n        public static void NullableTest2(int? x) { }\n\n        private void Handle(object sender, EventArgs e) {}\n        private void Handle(int i, int j) {}\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantDeclaration.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    abstract class RedundantDeclaration\n    {\n        public RedundantDeclaration()\n        {\n            MyEvent += new EventHandler(Handle); // Noncompliant {{Remove the explicit delegate creation; it is redundant.}}\n//                     ^^^^^^^^^^^^^^^^\n            MyEvent += (a, b) => { Handle(a, b); };\n\n            (new EventHandler(Handle))(1, null);\n\n            MyEvent2 = new MyMethod(Handle); // Noncompliant\n            MyEvent2 = new MyMethod(            // Noncompliant\n                delegate (int i, int j) { });   // Noncompliant {{Remove the parameter list; it is redundant.}}\n//                       ^^^^^^^^^^^^^^\n\n            Delegate anotherEvent = new EventHandler(Handle);\n            BoolDelegate myDelegate = new BoolDelegate(() => true);      // Noncompliant {{Remove the explicit delegate creation; it is redundant.}}\n\n            MyEvent2 = delegate (int i, int j) { Console.WriteLine(); }; // Noncompliant\n            MyEvent = delegate { Console.WriteLine(\"fdsfs\"); };\n\n            var l = new List<int>() { }; // Noncompliant {{Remove the initializer; it is redundant.}}\n//                                  ^^^\n            l = new List<int>();\n            var o = new object() { }; // Noncompliant\n//                               ^^^\n            o = new object { };\n\n            var ints = new int[] { 1, 2, 3 }; // Noncompliant {{Remove the array type; it is redundant.}}\n//                         ^^^\n            ints = new[] { 1, 2, 3 };\n            ints = new int[3] { 1, 2, 3 }; // Noncompliant {{Remove the array size specification; it is redundant.}}\n//                         ^\n            ints = new int[] { };\n\n            var ddd = new double[] { 1, 2, 3.0 }; // Compliant the element types are not the same as the specified one\n\n            var xxx = new int[,] { { 1, 1, 1 }, { 2, 2, 2 }, { 3, 3, 3 } };\n            var yyy = new int[3 // Noncompliant, we report two issues on this to keep the comma unfaded\n                , 3// Noncompliant\n                ] { { 1, 1, 1 }, { 2, 2, 2 }, { 3, 3, 3 } };\n\n            // see https://github.com/SonarSource/sonar-dotnet/issues/1840\n            var multiDimIntArray = new int[][] // Compliant - type specifier is mandatory here\n            {\n                new int[] { 1 } // Noncompliant\n            };\n            var zzz = new int[][] { new[] { 1, 2, 3 }, new int[0], new int[0] };\n            var www = new int[][][] { new[] { new[] { 0 } } };\n\n            int? xx = ((new int?(5))); // Noncompliant {{Remove the explicit nullable type creation; it is redundant.}}\n//                      ^^^^^^^^\n            xx = new Nullable<int>(5); // Noncompliant\n            var rr = new int?(5);\n\n            NullableTest1(new int?(5));\n            NullableTest1<int>(new int?(5)); // Noncompliant\n            NullableTest2(new int?(5)); // Noncompliant\n\n            Func<int, int?> f = new Func<int, int?>(// Noncompliant\n                i => new int?(i)); // Noncompliant\n            f = i =>\n            {\n                return new int?(i); // Noncompliant\n            };\n\n            Delegate d = new Action(() => { });\n            Delegate d2 = new Func<double>(() => { return 1; });\n\n            NullableTest2(f(5));\n\n            var f2 = new Func<int, int?>(i => i);\n\n            Func<int, int> f1 = (int i) => i; //Noncompliant {{Remove the type specification; it is redundant.}}\n//                               ^^^\n            Func<int, int> f3 = (i) => i;\n            var transformer = Funcify((string x) => new { Original = x, Normalized = x.ToLower() });\n            var transformer2 = Funcify2((string x) => new { Original = x, Normalized = x.ToLower() }); // Noncompliant\n\n            RefDelegateMethod((ref int i) => { i++; });\n        }\n\n        public void M()\n        {\n            dynamic d = new object();\n            Test(d, new BoolDelegate(() => true)); // Special case, d is dynamic\n            Test2(null, new BoolDelegate(() => true)); // Compliant\n        }\n\n        public Delegate N()\n        {\n            Delegate foo;\n            foo = (new BoolDelegate(() => true));\n            return (new BoolDelegate(() => true));\n        }\n\n        public BoolDelegate O()\n        {\n            return (new BoolDelegate(() => true));        // Noncompliant {{Remove the explicit delegate creation; it is redundant.}}\n        }\n\n        public Func<BoolDelegate> P()\n        {\n            return (() => new BoolDelegate(() => true));  // Noncompliant {{Remove the explicit delegate creation; it is redundant.}}\n        }\n\n        public abstract void Test(object o, BoolDelegate f);\n        public abstract void Test2(object o, Delegate f);\n        public delegate bool BoolDelegate();\n\n        private event EventHandler MyEvent;\n        private event MyMethod MyEvent2;\n\n        private delegate void MyMethod(int i, int j);\n        private delegate void MyMethod2(ref int i);\n        private void RefDelegateMethod(MyMethod2 f) { }\n\n        public static Func<T, TResult> Funcify<T, TResult>(Func<T, TResult> f) { return f; }\n        public static Func<string, TResult> Funcify2<TResult>(Func<string, TResult> f) { return f; }\n\n        public static void NullableTest1<T>(T? x) where T : struct { }\n        public static void NullableTest2(int? x) { }\n\n        private void Handle(object sender, EventArgs e) {}\n        private void Handle(int i, int j) {}\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantExitSelect.vb",
    "content": "﻿Imports System\n\nModule Module1\n    Sub Main()\n        Dim x = 0\n        Select Case x\n            Case 0\n                Console.WriteLine(\"0\")\n                Exit Select                ' Noncompliant {{Remove this redundant use of 'Exit Select'.}}\n'               ^^^^^^^^^^^\n            Case 1\n                Console.WriteLine(\"1\")\n                If True Then\n                    Exit Select ' Compliant\n                End If\n                Exit Sub\n            Case Else\n                Console.WriteLine(\"Not 0, 1\")\n                Exit Select                ' Noncompliant\n        End Select\n    End Sub\nEnd Module\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantInheritanceList.CSharp10.Fixed.cs",
    "content": "﻿using System;\n\ninterface IBaseContract { }\n\ninterface IContract : IBaseContract { }\n\nrecord Record { } // Fixed\n\nrecord struct RedunantInterfaceImpl : IContract { } // Fixed\n\nrecord struct RedunantInterfaceImplPositionalRecord(int SomeProperty) : IContract { } // Fixed\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantInheritanceList.CSharp10.cs",
    "content": "﻿using System;\n\ninterface IBaseContract { }\n\ninterface IContract : IBaseContract { }\n\nrecord Record : Object { } // Noncompliant\n\nrecord struct RedunantInterfaceImpl : IContract, IBaseContract { } // Noncompliant\n\nrecord struct RedunantInterfaceImplPositionalRecord(int SomeProperty) : IContract, IBaseContract { } // Noncompliant\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantInheritanceList.CSharp9.Fixed.cs",
    "content": "﻿using System;\n\nrecord Record { } // Fixed\n\nrecord OtherRecord : IContract { } // Fixed\n\nrecord SubRecord : OtherRecord { } // Compliant\n\nrecord RedunantInterfaceImpl : IContract { } // Fixed\n\nrecord PositionalRecord(int SomeProperty) { } // Fixed\n\nrecord OtherPositionalRecord(int SomeProperty) : IContract { } // Fixed\n\nrecord SubPositionalRecord(int SomeProperty) : OtherPositionalRecord(SomeProperty) { } // Compliant\n\nrecord RedunantInterfaceImplPositionalRecord(int SomeProperty) : IContract { } // Fixed\n\ninterface IContract : IBaseContract { }\n\ninterface IBaseContract { }\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantInheritanceList.CSharp9.cs",
    "content": "﻿using System;\n\nrecord Record : Object { } // Noncompliant\n\nrecord OtherRecord : Object, IContract { } // Noncompliant\n\nrecord SubRecord : OtherRecord { } // Compliant\n\nrecord RedunantInterfaceImpl : IContract, IBaseContract { } // Noncompliant\n\nrecord PositionalRecord(int SomeProperty) : Object { } // Noncompliant\n\nrecord OtherPositionalRecord(int SomeProperty) : Object, IContract { } // Noncompliant\n\nrecord SubPositionalRecord(int SomeProperty) : OtherPositionalRecord(SomeProperty) { } // Compliant\n\nrecord RedunantInterfaceImplPositionalRecord(int SomeProperty) : IContract, IBaseContract { } // Noncompliant\n\ninterface IContract : IBaseContract { }\n\ninterface IBaseContract { }\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantInheritanceList.Fixed.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    enum MyEnum : long\n    {\n    }\n    enum MyEnum2\n    {\n    }\n    enum MyEnum3\n    {\n    }\n\n    class AA  //Fixed\n    { }\n    class AAA\n    { }\n\n    class A\n    { }\n    class B :\n        IBase\n    { }\n\n    class BB\n       : IBase\n    { }\n\n    interface IBase { }\n    interface IA : IBase { }\n    interface IB : IA\n    { }\n\n    interface IPrint1\n    {\n        void Print();\n    }\n    class Base : IPrint1\n    {\n        public void Print() { }\n    }\n    class A1 : Base\n    { }\n    class A2 : Base, IPrint1\n    {\n        public new void Print() { }\n    }\n    class A3 : Base, IPrint1\n    {\n        void IPrint1.Print() { }\n    }\n\n    interface IB1\n    {\n        void Method();\n    }\n\n    interface IB2 : IB1\n    {\n    }\n\n    class C1 : IB2\n    {\n        public void Method() { }\n    }\n\n    public interface IM\n    {\n        void Print();\n    }\n\n    public interface IM2 : IM // not redundant\n    {\n    }\n\n    public class Base2 : IM\n    {\n        public void Print()\n        {\n            Console.WriteLine(\"base\");\n        }\n    }\n\n    public class Derived1 : Base2, IM // not redundant\n    {\n        public void Print()\n        {\n            Console.WriteLine(\"derived\");\n        }\n    }\n\n    public class Derived2 : IM2\n    {\n        public void Print()\n        {\n            Console.WriteLine(\"derived\");\n        }\n    }\n\n    public class Derived2B : IM2\n    {\n        public void Print()\n        {\n            Console.WriteLine(\"derived\");\n        }\n    }\n\n    public class Derived3 : IM2\n    {\n        void IM.Print()\n        {\n            Console.WriteLine(\"derived\");\n        }\n    }\n\n    public class Derived4 : Base2, IM\n    {\n        void IM.Print()\n        {\n            Console.WriteLine(\"derived\");\n        }\n    }\n    interface IMyInt\n    {\n        void M();\n    }\n\n    class X1 : IMyInt\n    {\n        public void M()\n        {\n            throw new NotImplementedException();\n        }\n    }\n\n    class X2 : X1\n    {\n        public new void M()\n        {\n            throw new NotImplementedException();\n        }\n    }\n\n    class X3 : X2, IMyInt // Compliant\n    {\n    }\n\n    struct RedunantInterfaceImpl : IA { } // Fixed\n\n    // Reproducer for FP: https://github.com/SonarSource/sonar-dotnet/issues/6823\n    class Foo { }\n\n    interface IBar\n    {\n        int Test();\n    }\n\n    class Bar : Foo { } // Error [CS0535]\n    // Fixed\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantInheritanceList.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    enum MyEnum : long\n    {\n    }\n    enum MyEnum2\n        : int //Noncompliant {{'int' should not be explicitly used as the underlying type.}}\n//      ^^^^^\n    {\n    }\n    enum MyEnum3\n    {\n    }\n\n    class AA : Object //Noncompliant {{'Object' should not be explicitly extended.}}\n    { }\n    class AAA://Noncompliant\n        Object\n    { }\n\n    class A\n        : Object //Noncompliant\n    { }\n    class B :\n        Object, //Noncompliant\n//      ^^^^^^^\n        IBase\n    { }\n\n    class BB\n       : Object, //Noncompliant\n         IBase\n    { }\n\n    interface IBase { }\n    interface IA : IBase { }\n    interface IB : IA\n        , IBase //Noncompliant {{'IA' implements 'IBase' so 'IBase' can be removed from the inheritance list.}}\n    { }\n\n    interface IPrint1\n    {\n        void Print();\n    }\n    class Base : IPrint1\n    {\n        public void Print() { }\n    }\n    class A1 : Base\n        , IPrint1 //Noncompliant\n    { }\n    class A2 : Base, IPrint1\n    {\n        public new void Print() { }\n    }\n    class A3 : Base, IPrint1\n    {\n        void IPrint1.Print() { }\n    }\n\n    interface IB1\n    {\n        void Method();\n    }\n\n    interface IB2 : IB1\n    {\n    }\n\n    class C1 : IB2\n        , IB1 // Noncompliant\n    {\n        public void Method() { }\n    }\n\n    public interface IM\n    {\n        void Print();\n    }\n\n    public interface IM2 : IM // not redundant\n    {\n    }\n\n    public class Base2 : IM\n    {\n        public void Print()\n        {\n            Console.WriteLine(\"base\");\n        }\n    }\n\n    public class Derived1 : Base2, IM // not redundant\n    {\n        public void Print()\n        {\n            Console.WriteLine(\"derived\");\n        }\n    }\n\n    public class Derived2 : IM2\n    {\n        public void Print()\n        {\n            Console.WriteLine(\"derived\");\n        }\n    }\n\n    public class Derived2B : IM, // Noncompliant\n        IM2\n    {\n        public void Print()\n        {\n            Console.WriteLine(\"derived\");\n        }\n    }\n\n    public class Derived3 : IM2\n        , IM // Noncompliant\n    {\n        void IM.Print()\n        {\n            Console.WriteLine(\"derived\");\n        }\n    }\n\n    public class Derived4 : Base2, IM\n    {\n        void IM.Print()\n        {\n            Console.WriteLine(\"derived\");\n        }\n    }\n    interface IMyInt\n    {\n        void M();\n    }\n\n    class X1 : IMyInt\n    {\n        public void M()\n        {\n            throw new NotImplementedException();\n        }\n    }\n\n    class X2 : X1\n    {\n        public new void M()\n        {\n            throw new NotImplementedException();\n        }\n    }\n\n    class X3 : X2, IMyInt // Compliant\n    {\n    }\n\n    struct RedunantInterfaceImpl : IA, IBase { } // Noncompliant {{'IA' implements 'IBase' so 'IBase' can be removed from the inheritance list.}}\n    //                               ^^^^^^^\n\n    // Reproducer for FP: https://github.com/SonarSource/sonar-dotnet/issues/6823\n    class Foo { }\n\n    interface IBar\n    {\n        int Test();\n    }\n\n    class Bar : Foo, IBar { } // Error [CS0535]\n    // Noncompliant@-1 {{'Foo' implements 'IBar' so 'IBar' can be removed from the inheritance list.}} FP\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantJumpStatement.Latest.cs",
    "content": "﻿using System;\n\npublic class RedundantJumpStatement\n{\n    void CSharp8_StaticLocalFunctions()\n    {\n        static void Compute(int a, out int b)\n        {\n            b = a;\n            return;     // Noncompliant\n        }\n        static void EnsurePositive(int a, out int b)\n        {\n            b = 0;\n            if (a <= 0)\n            {\n                return;\n            }\n            b = a;\n        }\n    }\n}\n\npublic interface IWithDefaultImplementation\n{\n    decimal Count { get; set; }\n    decimal Price { get; set; }\n\n    //Default interface methods\n    void Reset()\n    {\n        Price = 0;\n        Count = 0;\n        return;     // Noncompliant\n    }\n\n    void ResetIfZero()\n    {\n        if (Count == 0)\n        {\n            return;\n        }\n        Price = 0;\n    }\n}\n\nrecord Record\n{\n    int Prop\n    {\n        init\n        {\n            goto A; // Noncompliant\n        A:\n            return; // Noncompliant\n        }\n    }\n}\n\n// NET-3284: https://sonarsource.atlassian.net/browse/NET-3284\npublic class RedundantJumpStatement_C9Patterns\n{\n    void AllPatterns_C9Patterns(int[] numbers, int[][] arrays)\n    {\n        foreach (var n in numbers)\n        {\n            if (n is 1 or 2) continue;             // FN - OrPattern\n            else if (n is > 100) continue;         // FN - RelationalPattern\n            else if (n is > 0 and < 100) continue; // FN - AndPattern\n            else if (n is not 100) continue;       // FN - NotPattern\n        }\n        foreach (var arr in arrays)\n        {\n            if (arr is []) continue;               // FN - ListPattern\n        }\n    }\n}\n\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantJumpStatement.TopLevelStatements.cs",
    "content": "﻿using System;\n\ngoto A; // Compliant - FN\nA:\nreturn; // Compliant - FN\n\nAction<int> b = static i =>\n{\n    return;  // Noncompliant\n};\n\nstatic void LocalMethod()\n{\n    return; // Noncompliant\n};\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantJumpStatement.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\npublic class RedundantJumpStatement\n{\n    void Foo1()\n    {\n        var a = new Action(() =>\n        {\n            return; // Noncompliant\n//          ^^^^^^^\n        });\n\n        goto A; // Noncompliant\n        A:\n        return; // Noncompliant {{Remove this redundant jump.}}\n    }\n\n    int Prop\n    {\n        set\n        {\n            goto A; // Noncompliant\n            A:\n            return; // Noncompliant\n        }\n    }\n\n    void Foo2(bool a)\n    {\n        if (a)\n        {\n            return; // Noncompliant\n        }\n        else\n        {\n            return;\n            Foo2(a);\n        }\n    }\n\n    void Loop_Continue(bool a)\n    {\n        for (int i = 0; i < 10; i++)\n        {\n            if (a)\n            {\n                continue; // Noncompliant\n            }\n            else\n            {\n                continue;\n                Foo2(a);\n            }\n        }\n    }\n\n    void Switch_Goto(int j)\n    {\n        switch (j)\n        {\n            case 1:\n                goto default; // Not reported\n            default:\n                break;\n        }\n\n        throw new Exception();\n    }\n\n    void Switch_Return(int j)\n    {\n        switch (j)\n        {\n            case 1:\n                return; // Compliant\n            case 2:\n                return; // Non-compliant, not reported\n                break;\n        }\n    }\n\n    IEnumerable<int> YieldBreak1(int j)\n    {\n        yield break; // Compliant\n    }\n\n    IEnumerable<int> YieldReturn(int j)\n    {\n        yield return 1;\n    }\n\n    IEnumerable<int> YieldBreak2(int j)\n    {\n        yield return 1;\n        yield break; // Noncompliant\n    }\n\n    void LongChain()\n    {\n        if (true)\n        {\n        }\n        else if (true)\n        {\n            return; // Noncompliant\n        }\n        else if (false)\n        { }\n        else if (false)\n        { }\n        else\n        { }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/1265\n    void RegressionTest_1265()\n    {\n        try\n        {\n            Console.WriteLine();\n        }\n        catch (Exception)\n        {\n            Console.WriteLine();\n            return;\n        }\n        finally\n        {\n            Console.WriteLine();\n        }\n        Console.WriteLine();\n    }\n\n    void RedundantJumpInTryCatch1()\n    {\n        try\n        {\n            Console.WriteLine();\n        }\n        catch (Exception)\n        {\n            Console.WriteLine();\n            return; // Noncompliant\n        }\n        finally\n        {\n            Console.WriteLine();\n        }\n    }\n\n    void RedundantJumpInTryCatch2()\n    {\n        try\n        {\n            Console.WriteLine();\n            return; // Noncompliant\n        }\n        catch (Exception)\n        {\n            Console.WriteLine();\n        }\n        finally\n        {\n            Console.WriteLine();\n        }\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/3105\npublic class Repro_3105\n{\n    public void DoSomething()\n    {\n        Action a = () => throw new Exception();\n\n        Invoke(() => throw new Exception());\n    }\n\n    void Invoke(Action a)\n    {\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/3193\npublic class Repro_3193\n{\n    void Foo(Log Logger)\n    {\n        {\n            var retryAttempts = 0;\n            while (retryAttempts < 3)\n            {\n                retryAttempts++;\n                try\n                {\n                    // Do something real here.\n                    return; // Noncompliant FP, this should end the loop if previous statement succeeded\n                }\n                catch (Exception ex)\n                {\n                    //Log\n                }\n                finally\n                {\n                    Logger?.Finally(); // Removing ? generates simple block and different CFG shape (Finally is on different location)\n                }\n            }\n        }\n    }\n}\n\npublic class Log\n{\n    public void Finally() { }\n}\n\n// https://sonarsource.atlassian.net/browse/NET-1149\npublic class Repro_1149\n{\n    public void LocalFunctionAfterReturn(List<string> items)\n    {\n        items.ForEach(LocalFunction);\n\n        return; // Compliant: exception for readability\n\n        void LocalFunction(string item)\n        {\n            Console.WriteLine(item);\n        }\n    }\n\n    public void LocalFunctionBeforeReturn(List<string> items)\n    {\n        void LocalFunction(string item)\n        {\n            Console.WriteLine(item);\n        }\n\n        items.ForEach(LocalFunction);\n\n        return; // Noncompliant\n    }\n\n    public void LocalFunctionAfterGoto(List<string> items)\n    {\n        items.ForEach(LocalFunction);\n\n        goto A; // Noncompliant\n        A:\n\n        void LocalFunction(string item)\n        {\n            Console.WriteLine(item);\n        }\n    }\n\n    public void LabeledLocalFunctionAfterReturn(List<string> items)\n    {\n        items.ForEach(LocalFunction);\n\n        return; // Compliant: exception for readability\n        A:\n\n        void LocalFunction(string item)\n        {\n            Console.WriteLine(item);\n        }\n    }\n\n    public IEnumerable<int> LocalFunctionAfterYieldReturnYieldBreak(List<string> items)\n    {\n        items.ForEach(LocalFunction);\n\n        yield return 1;\n\n        Console.WriteLine(\"Some code\");\n\n        yield break; // Compliant: exception for readability\n\n        void LocalFunction(string item)\n        {\n            Console.WriteLine(item);\n        }\n    }\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantModifier.Fixed.Checked.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class C1\n    {\n        public virtual void MyNotOverriddenMethod() { }\n    }\n    internal partial class Partial1Part //Fixed\n    {\n        void Method() { }\n    }\n    partial struct PartialStruct //Fixed\n    {\n    }\n    partial interface PartialInterface //Fixed\n    {\n    }\n\n    internal partial class Partial2Part\n    {\n    }\n\n    internal abstract partial class Partial2Part\n    {\n        public virtual void MyOverriddenMethod() { }\n        public virtual int Prop { get; set; }\n        public abstract int this[int counter] { get; }\n        protected abstract event EventHandler<EventArgs> MyEvent;\n        protected abstract event EventHandler<EventArgs> MyEvent2;\n    }\n\n    internal class Override : Partial2Part\n    {\n        public override void MyOverriddenMethod() { }\n\n        public override int this[int counter]\n        {\n            get { return 0; }\n        }\n\n        protected override event EventHandler<EventArgs> MyEvent;\n        protected override event EventHandler<EventArgs> MyEvent2\n        {\n            add { }\n            remove { }\n        }\n\n        public enum SomeEnumeration\n        {\n\n        }\n    }\n\n    sealed class SealedClass : Partial2Part\n    {\n        public override sealed void MyOverriddenMethod() { } // Fixed\n        public override sealed int Prop { get; set; } // Fixed\n\n        public override sealed int this[int counter] // Fixed\n        {\n            get { return 0; }\n        }\n\n        protected override sealed event EventHandler<EventArgs> MyEvent; // Fixed\n        protected override sealed event EventHandler<EventArgs> MyEvent2 // Fixed\n        {\n            add { }\n            remove { }\n        }\n    }\n\n    abstract class AbstractClass : Partial2Part\n    {\n        public override sealed void MyOverriddenMethod() { }\n        public override sealed int Prop { get; set; }\n\n        public override sealed int this[int counter]\n        {\n            get { return 0; }\n        }\n\n        protected override sealed event EventHandler<EventArgs> MyEvent;\n        protected override sealed event EventHandler<EventArgs> MyEvent2\n        {\n            add { }\n            remove { }\n        }\n    }\n\n    sealed class SealedClassWithoutRedundantKeywordOnMembers : Partial2Part\n    {\n        public override void MyOverriddenMethod() { }\n\n        public override int Prop { get; set; }\n\n        public override int this[int counter]\n        {\n            get { return 0; }\n        }\n\n        protected override event EventHandler<EventArgs> MyEvent;\n        protected override event EventHandler<EventArgs> MyEvent2\n        {\n            add { }\n            remove { }\n        }\n    }\n\n    internal class BaseClass<T>\n    {\n        public virtual string Process(string input)\n        {\n            return input;\n        }\n    }\n\n    internal class SubClass : BaseClass<string>\n    {\n        public override string Process(string input)\n        {\n            return \"Test\";\n        }\n    }\n\n    unsafe class UnsafeClass\n    {\n        int* pointer;\n    }\n\n    unsafe class UnsafeClass2 // Fixed\n    {\n        int num;\n    }\n    unsafe class UnsafeClass3 // Fixed\n    {\n        unsafe void M() // Fixed\n        {\n\n        }\n    }\n\n    class Point\n    {\n        public int x;\n        public int y;\n    }\n\n    class Class4\n    {\n        unsafe interface MyInterface\n        {\n            unsafe int* Method(); // Fixed\n        }\n\n        private unsafe delegate void MyDelegate(int* p);\n        private unsafe delegate void MyDelegate2(int i); // Fixed\n\n        unsafe class Inner { } // Fixed\n\n        unsafe event MyDelegate MyEvent; // Fixed\n        unsafe event MyDelegate MyEvent2\n        {\n            add\n            {\n                int* p;\n            }\n            remove { }\n        }\n\n        unsafe ~Class4() // Fixed\n        {\n        }\n        void M()\n        {\n            Point pt = new Point();\n            unsafe\n            {\n                fixed (int* p = &pt.x)\n                {\n                    *p = 1;\n                }\n            }\n\n            unsafe\n            {\n                unsafe // Fixed\n                {\n                    unsafe // Fixed\n                    {\n                        var i = 1;\n                        int* p = &i;\n                    }\n                }\n            }\n        }\n    }\n\n    public class Foo\n    {\n        public class Bar\n        {\n            public unsafe class Baz // Fixed\n            {\n            }\n        }\n    }\n\n    public unsafe class Foo2\n    {\n        public unsafe class Bar // Fixed\n        {\n            private int* p;\n\n            public unsafe class Baz // Fixed\n            {\n                private int* p2;\n            }\n        }\n    }\n\n    public class Checked\n    {\n        public static void M()\n        {\n            checked\n            {\n                {\n                    var z = 1 + 4;\n                    var y = unchecked(1 +\n                        4); // Fixed\n                }\n            }\n\n            {\n                var f = 5.5;\n                var y = unchecked(5 + 4);\n            }\n\n            checked\n            {\n                var f = 5.5;\n                var x = 5 + 4;\n                var y = unchecked(5 + 4);\n            }\n\n            checked\n            {\n                var f = 5.5;\n                var x = 5 + 4;\n                var y = 5.5 + 4; // Fixed\n            }\n\n            {\n                var f = 5.5;\n                var x = 5 + \"somestring\";\n            }\n\n            unchecked\n            {\n                var f = 5.5;\n                var y = 5 + 4; // Fixed\n            }\n\n            checked\n            {\n                var x = (uint)10;\n                var y = (int)x;\n            }\n\n            {\n                var x = 10;\n                var y = (double)x;\n            }\n\n            checked\n            {\n                var x = 10;\n                x += int.MaxValue;\n            }\n\n            checked\n            {\n                var x = 10;\n                x = -int.MaxValue;\n            }\n\n            checked\n            {\n                var x = 10;\n                x = -5;\n            }\n\n            {\n                var x = 10;\n                x = -\"1\"; // Error [CS0023]\n            }\n\n            {\n                var x = 10;\n                x = +5;\n            }\n\n            {\n                var x = 10;\n                var y = 5 % x;\n            }\n\n            checked\n            {\n                var x = (uint)null; // Error [CS0037]\n                var y = (int)x;\n            }\n\n            checked\n            {\n                var x = (SomeClass)5; // Error [CS0246]\n                var y = (int)x;\n            }\n        }\n    }\n\n    public unsafe struct FixedArraySample\n    {\n        private fixed int a[10];\n    }\n\n    public class StackAlloc\n    {\n        private unsafe void M()\n        {\n            var x = stackalloc int[100];\n        }\n    }\n\n    public class UnsafeHidden\n    {\n        private unsafe int* Method() { return null; }\n        private unsafe void Method2(int* p) { }\n        public unsafe void M1()\n        {\n            Method();\n        }\n\n        public unsafe void WithUndefinedInvocation()    // Fixed\n        {\n            Undefined();        // Error [CS0103]: The name 'Undefined' does not exist in the current context\n        }\n\n        private unsafe int* Prop { get; set; }\n        public unsafe void M2()\n        {\n            Method2(Prop);\n        }\n    }\n\n    public class UnsafeParameter\n    {\n        public unsafe delegate void Unsafe(int* x);\n\n        public unsafe void Method()\n        {\n            Unsafe u = (a) => { };\n        }\n    }\n\n    public class UnsafeCtor\n    {\n        public UnsafeCtor()\n        {\n            unsafe // Fixed\n            {\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantModifier.Fixed.Partial.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class C1\n    {\n        public virtual void MyNotOverriddenMethod() { }\n    }\n    internal class Partial1Part //Fixed\n    {\n        void Method() { }\n    }\n    struct PartialStruct //Fixed\n    {\n    }\n    interface PartialInterface //Fixed\n    {\n    }\n\n    internal partial class Partial2Part\n    {\n    }\n\n    internal abstract partial class Partial2Part\n    {\n        public virtual void MyOverriddenMethod() { }\n        public virtual int Prop { get; set; }\n        public abstract int this[int counter] { get; }\n        protected abstract event EventHandler<EventArgs> MyEvent;\n        protected abstract event EventHandler<EventArgs> MyEvent2;\n    }\n\n    internal class Override : Partial2Part\n    {\n        public override void MyOverriddenMethod() { }\n\n        public override int this[int counter]\n        {\n            get { return 0; }\n        }\n\n        protected override event EventHandler<EventArgs> MyEvent;\n        protected override event EventHandler<EventArgs> MyEvent2\n        {\n            add { }\n            remove { }\n        }\n\n        public enum SomeEnumeration\n        {\n\n        }\n    }\n\n    sealed class SealedClass : Partial2Part\n    {\n        public override sealed void MyOverriddenMethod() { } // Fixed\n        public override sealed int Prop { get; set; } // Fixed\n\n        public override sealed int this[int counter] // Fixed\n        {\n            get { return 0; }\n        }\n\n        protected override sealed event EventHandler<EventArgs> MyEvent; // Fixed\n        protected override sealed event EventHandler<EventArgs> MyEvent2 // Fixed\n        {\n            add { }\n            remove { }\n        }\n    }\n\n    abstract class AbstractClass : Partial2Part\n    {\n        public override sealed void MyOverriddenMethod() { }\n        public override sealed int Prop { get; set; }\n\n        public override sealed int this[int counter]\n        {\n            get { return 0; }\n        }\n\n        protected override sealed event EventHandler<EventArgs> MyEvent;\n        protected override sealed event EventHandler<EventArgs> MyEvent2\n        {\n            add { }\n            remove { }\n        }\n    }\n\n    sealed class SealedClassWithoutRedundantKeywordOnMembers : Partial2Part\n    {\n        public override void MyOverriddenMethod() { }\n\n        public override int Prop { get; set; }\n\n        public override int this[int counter]\n        {\n            get { return 0; }\n        }\n\n        protected override event EventHandler<EventArgs> MyEvent;\n        protected override event EventHandler<EventArgs> MyEvent2\n        {\n            add { }\n            remove { }\n        }\n    }\n\n    internal class BaseClass<T>\n    {\n        public virtual string Process(string input)\n        {\n            return input;\n        }\n    }\n\n    internal class SubClass : BaseClass<string>\n    {\n        public override string Process(string input)\n        {\n            return \"Test\";\n        }\n    }\n\n    unsafe class UnsafeClass\n    {\n        int* pointer;\n    }\n\n    unsafe class UnsafeClass2 // Fixed\n    {\n        int num;\n    }\n    unsafe class UnsafeClass3 // Fixed\n    {\n        unsafe void M() // Fixed\n        {\n\n        }\n    }\n\n    class Point\n    {\n        public int x;\n        public int y;\n    }\n\n    class Class4\n    {\n        unsafe interface MyInterface\n        {\n            unsafe int* Method(); // Fixed\n        }\n\n        private unsafe delegate void MyDelegate(int* p);\n        private unsafe delegate void MyDelegate2(int i); // Fixed\n\n        unsafe class Inner { } // Fixed\n\n        unsafe event MyDelegate MyEvent; // Fixed\n        unsafe event MyDelegate MyEvent2\n        {\n            add\n            {\n                int* p;\n            }\n            remove { }\n        }\n\n        unsafe ~Class4() // Fixed\n        {\n        }\n        void M()\n        {\n            Point pt = new Point();\n            unsafe\n            {\n                fixed (int* p = &pt.x)\n                {\n                    *p = 1;\n                }\n            }\n\n            unsafe\n            {\n                unsafe // Fixed\n                {\n                    unsafe // Fixed\n                    {\n                        var i = 1;\n                        int* p = &i;\n                    }\n                }\n            }\n        }\n    }\n\n    public class Foo\n    {\n        public class Bar\n        {\n            public unsafe class Baz // Fixed\n            {\n            }\n        }\n    }\n\n    public unsafe class Foo2\n    {\n        public unsafe class Bar // Fixed\n        {\n            private int* p;\n\n            public unsafe class Baz // Fixed\n            {\n                private int* p2;\n            }\n        }\n    }\n\n    public class Checked\n    {\n        public static void M()\n        {\n            checked\n            {\n                checked // Fixed\n                {\n                    var z = 1 + 4;\n                    var y = unchecked(1 +\n                        unchecked(4)); // Fixed\n                }\n            }\n\n            checked // Fixed\n            {\n                var f = 5.5;\n                var y = unchecked(5 + 4);\n            }\n\n            checked\n            {\n                var f = 5.5;\n                var x = 5 + 4;\n                var y = unchecked(5 + 4);\n            }\n\n            checked\n            {\n                var f = 5.5;\n                var x = 5 + 4;\n                var y = unchecked(5.5 + 4); // Fixed\n            }\n\n            checked // Fixed\n            {\n                var f = 5.5;\n                var x = 5 + \"somestring\";\n            }\n\n            unchecked\n            {\n                var f = 5.5;\n                var y = unchecked(5 + 4); // Fixed\n            }\n\n            checked\n            {\n                var x = (uint)10;\n                var y = (int)x;\n            }\n\n            checked // Fixed\n            {\n                var x = 10;\n                var y = (double)x;\n            }\n\n            checked\n            {\n                var x = 10;\n                x += int.MaxValue;\n            }\n\n            checked\n            {\n                var x = 10;\n                x = -int.MaxValue;\n            }\n\n            checked\n            {\n                var x = 10;\n                x = -5;\n            }\n\n            checked // Fixed\n            {\n                var x = 10;\n                x = -\"1\"; // Error [CS0023]\n            }\n\n            checked // Fixed\n            {\n                var x = 10;\n                x = +5;\n            }\n\n            checked  // Fixed\n            {\n                var x = 10;\n                var y = 5 % x;\n            }\n\n            checked\n            {\n                var x = (uint)null; // Error [CS0037]\n                var y = (int)x;\n            }\n\n            checked\n            {\n                var x = (SomeClass)5; // Error [CS0246]\n                var y = (int)x;\n            }\n        }\n    }\n\n    public unsafe struct FixedArraySample\n    {\n        private fixed int a[10];\n    }\n\n    public class StackAlloc\n    {\n        private unsafe void M()\n        {\n            var x = stackalloc int[100];\n        }\n    }\n\n    public class UnsafeHidden\n    {\n        private unsafe int* Method() { return null; }\n        private unsafe void Method2(int* p) { }\n        public unsafe void M1()\n        {\n            Method();\n        }\n\n        public unsafe void WithUndefinedInvocation()    // Fixed\n        {\n            Undefined();        // Error [CS0103]: The name 'Undefined' does not exist in the current context\n        }\n\n        private unsafe int* Prop { get; set; }\n        public unsafe void M2()\n        {\n            Method2(Prop);\n        }\n    }\n\n    public class UnsafeParameter\n    {\n        public unsafe delegate void Unsafe(int* x);\n\n        public unsafe void Method()\n        {\n            Unsafe u = (a) => { };\n        }\n    }\n\n    public class UnsafeCtor\n    {\n        public UnsafeCtor()\n        {\n            unsafe // Fixed\n            {\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantModifier.Fixed.Sealed.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class C1\n    {\n        public virtual void MyNotOverriddenMethod() { }\n    }\n    internal partial class Partial1Part //Fixed\n    {\n        void Method() { }\n    }\n    partial struct PartialStruct //Fixed\n    {\n    }\n    partial interface PartialInterface //Fixed\n    {\n    }\n\n    internal partial class Partial2Part\n    {\n    }\n\n    internal abstract partial class Partial2Part\n    {\n        public virtual void MyOverriddenMethod() { }\n        public virtual int Prop { get; set; }\n        public abstract int this[int counter] { get; }\n        protected abstract event EventHandler<EventArgs> MyEvent;\n        protected abstract event EventHandler<EventArgs> MyEvent2;\n    }\n\n    internal class Override : Partial2Part\n    {\n        public override void MyOverriddenMethod() { }\n\n        public override int this[int counter]\n        {\n            get { return 0; }\n        }\n\n        protected override event EventHandler<EventArgs> MyEvent;\n        protected override event EventHandler<EventArgs> MyEvent2\n        {\n            add { }\n            remove { }\n        }\n\n        public enum SomeEnumeration\n        {\n\n        }\n    }\n\n    sealed class SealedClass : Partial2Part\n    {\n        public override void MyOverriddenMethod() { } // Fixed\n        public override int Prop { get; set; } // Fixed\n\n        public override int this[int counter] // Fixed\n        {\n            get { return 0; }\n        }\n\n        protected override event EventHandler<EventArgs> MyEvent; // Fixed\n        protected override event EventHandler<EventArgs> MyEvent2 // Fixed\n        {\n            add { }\n            remove { }\n        }\n    }\n\n    abstract class AbstractClass : Partial2Part\n    {\n        public override sealed void MyOverriddenMethod() { }\n        public override sealed int Prop { get; set; }\n\n        public override sealed int this[int counter]\n        {\n            get { return 0; }\n        }\n\n        protected override sealed event EventHandler<EventArgs> MyEvent;\n        protected override sealed event EventHandler<EventArgs> MyEvent2\n        {\n            add { }\n            remove { }\n        }\n    }\n\n    sealed class SealedClassWithoutRedundantKeywordOnMembers : Partial2Part\n    {\n        public override void MyOverriddenMethod() { }\n\n        public override int Prop { get; set; }\n\n        public override int this[int counter]\n        {\n            get { return 0; }\n        }\n\n        protected override event EventHandler<EventArgs> MyEvent;\n        protected override event EventHandler<EventArgs> MyEvent2\n        {\n            add { }\n            remove { }\n        }\n    }\n\n    internal class BaseClass<T>\n    {\n        public virtual string Process(string input)\n        {\n            return input;\n        }\n    }\n\n    internal class SubClass : BaseClass<string>\n    {\n        public override string Process(string input)\n        {\n            return \"Test\";\n        }\n    }\n\n    unsafe class UnsafeClass\n    {\n        int* pointer;\n    }\n\n    unsafe class UnsafeClass2 // Fixed\n    {\n        int num;\n    }\n    unsafe class UnsafeClass3 // Fixed\n    {\n        unsafe void M() // Fixed\n        {\n\n        }\n    }\n\n    class Point\n    {\n        public int x;\n        public int y;\n    }\n\n    class Class4\n    {\n        unsafe interface MyInterface\n        {\n            unsafe int* Method(); // Fixed\n        }\n\n        private unsafe delegate void MyDelegate(int* p);\n        private unsafe delegate void MyDelegate2(int i); // Fixed\n\n        unsafe class Inner { } // Fixed\n\n        unsafe event MyDelegate MyEvent; // Fixed\n        unsafe event MyDelegate MyEvent2\n        {\n            add\n            {\n                int* p;\n            }\n            remove { }\n        }\n\n        unsafe ~Class4() // Fixed\n        {\n        }\n        void M()\n        {\n            Point pt = new Point();\n            unsafe\n            {\n                fixed (int* p = &pt.x)\n                {\n                    *p = 1;\n                }\n            }\n\n            unsafe\n            {\n                unsafe // Fixed\n                {\n                    unsafe // Fixed\n                    {\n                        var i = 1;\n                        int* p = &i;\n                    }\n                }\n            }\n        }\n    }\n\n    public class Foo\n    {\n        public class Bar\n        {\n            public unsafe class Baz // Fixed\n            {\n            }\n        }\n    }\n\n    public unsafe class Foo2\n    {\n        public unsafe class Bar // Fixed\n        {\n            private int* p;\n\n            public unsafe class Baz // Fixed\n            {\n                private int* p2;\n            }\n        }\n    }\n\n    public class Checked\n    {\n        public static void M()\n        {\n            checked\n            {\n                checked // Fixed\n                {\n                    var z = 1 + 4;\n                    var y = unchecked(1 +\n                        unchecked(4)); // Fixed\n                }\n            }\n\n            checked // Fixed\n            {\n                var f = 5.5;\n                var y = unchecked(5 + 4);\n            }\n\n            checked\n            {\n                var f = 5.5;\n                var x = 5 + 4;\n                var y = unchecked(5 + 4);\n            }\n\n            checked\n            {\n                var f = 5.5;\n                var x = 5 + 4;\n                var y = unchecked(5.5 + 4); // Fixed\n            }\n\n            checked // Fixed\n            {\n                var f = 5.5;\n                var x = 5 + \"somestring\";\n            }\n\n            unchecked\n            {\n                var f = 5.5;\n                var y = unchecked(5 + 4); // Fixed\n            }\n\n            checked\n            {\n                var x = (uint)10;\n                var y = (int)x;\n            }\n\n            checked // Fixed\n            {\n                var x = 10;\n                var y = (double)x;\n            }\n\n            checked\n            {\n                var x = 10;\n                x += int.MaxValue;\n            }\n\n            checked\n            {\n                var x = 10;\n                x = -int.MaxValue;\n            }\n\n            checked\n            {\n                var x = 10;\n                x = -5;\n            }\n\n            checked // Fixed\n            {\n                var x = 10;\n                x = -\"1\"; // Error [CS0023]\n            }\n\n            checked // Fixed\n            {\n                var x = 10;\n                x = +5;\n            }\n\n            checked  // Fixed\n            {\n                var x = 10;\n                var y = 5 % x;\n            }\n\n            checked\n            {\n                var x = (uint)null; // Error [CS0037]\n                var y = (int)x;\n            }\n\n            checked\n            {\n                var x = (SomeClass)5; // Error [CS0246]\n                var y = (int)x;\n            }\n        }\n    }\n\n    public unsafe struct FixedArraySample\n    {\n        private fixed int a[10];\n    }\n\n    public class StackAlloc\n    {\n        private unsafe void M()\n        {\n            var x = stackalloc int[100];\n        }\n    }\n\n    public class UnsafeHidden\n    {\n        private unsafe int* Method() { return null; }\n        private unsafe void Method2(int* p) { }\n        public unsafe void M1()\n        {\n            Method();\n        }\n\n        public unsafe void WithUndefinedInvocation()    // Fixed\n        {\n            Undefined();        // Error [CS0103]: The name 'Undefined' does not exist in the current context\n        }\n\n        private unsafe int* Prop { get; set; }\n        public unsafe void M2()\n        {\n            Method2(Prop);\n        }\n    }\n\n    public class UnsafeParameter\n    {\n        public unsafe delegate void Unsafe(int* x);\n\n        public unsafe void Method()\n        {\n            Unsafe u = (a) => { };\n        }\n    }\n\n    public class UnsafeCtor\n    {\n        public UnsafeCtor()\n        {\n            unsafe // Fixed\n            {\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantModifier.Fixed.Unsafe.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class C1\n    {\n        public virtual void MyNotOverriddenMethod() { }\n    }\n    internal partial class Partial1Part //Fixed\n    {\n        void Method() { }\n    }\n    partial struct PartialStruct //Fixed\n    {\n    }\n    partial interface PartialInterface //Fixed\n    {\n    }\n\n    internal partial class Partial2Part\n    {\n    }\n\n    internal abstract partial class Partial2Part\n    {\n        public virtual void MyOverriddenMethod() { }\n        public virtual int Prop { get; set; }\n        public abstract int this[int counter] { get; }\n        protected abstract event EventHandler<EventArgs> MyEvent;\n        protected abstract event EventHandler<EventArgs> MyEvent2;\n    }\n\n    internal class Override : Partial2Part\n    {\n        public override void MyOverriddenMethod() { }\n\n        public override int this[int counter]\n        {\n            get { return 0; }\n        }\n\n        protected override event EventHandler<EventArgs> MyEvent;\n        protected override event EventHandler<EventArgs> MyEvent2\n        {\n            add { }\n            remove { }\n        }\n\n        public enum SomeEnumeration\n        {\n\n        }\n    }\n\n    sealed class SealedClass : Partial2Part\n    {\n        public override sealed void MyOverriddenMethod() { } // Fixed\n        public override sealed int Prop { get; set; } // Fixed\n\n        public override sealed int this[int counter] // Fixed\n        {\n            get { return 0; }\n        }\n\n        protected override sealed event EventHandler<EventArgs> MyEvent; // Fixed\n        protected override sealed event EventHandler<EventArgs> MyEvent2 // Fixed\n        {\n            add { }\n            remove { }\n        }\n    }\n\n    abstract class AbstractClass : Partial2Part\n    {\n        public override sealed void MyOverriddenMethod() { }\n        public override sealed int Prop { get; set; }\n\n        public override sealed int this[int counter]\n        {\n            get { return 0; }\n        }\n\n        protected override sealed event EventHandler<EventArgs> MyEvent;\n        protected override sealed event EventHandler<EventArgs> MyEvent2\n        {\n            add { }\n            remove { }\n        }\n    }\n\n    sealed class SealedClassWithoutRedundantKeywordOnMembers : Partial2Part\n    {\n        public override void MyOverriddenMethod() { }\n\n        public override int Prop { get; set; }\n\n        public override int this[int counter]\n        {\n            get { return 0; }\n        }\n\n        protected override event EventHandler<EventArgs> MyEvent;\n        protected override event EventHandler<EventArgs> MyEvent2\n        {\n            add { }\n            remove { }\n        }\n    }\n\n    internal class BaseClass<T>\n    {\n        public virtual string Process(string input)\n        {\n            return input;\n        }\n    }\n\n    internal class SubClass : BaseClass<string>\n    {\n        public override string Process(string input)\n        {\n            return \"Test\";\n        }\n    }\n\n    unsafe class UnsafeClass\n    {\n        int* pointer;\n    }\n\n    class UnsafeClass2 // Fixed\n    {\n        int num;\n    }\n    class UnsafeClass3 // Fixed\n    {\n        void M() // Fixed\n        {\n\n        }\n    }\n\n    class Point\n    {\n        public int x;\n        public int y;\n    }\n\n    class Class4\n    {\n        unsafe interface MyInterface\n        {\n            int* Method(); // Fixed\n        }\n\n        private unsafe delegate void MyDelegate(int* p);\n        private delegate void MyDelegate2(int i); // Fixed\n\n        class Inner { } // Fixed\n\n        event MyDelegate MyEvent; // Fixed\n        unsafe event MyDelegate MyEvent2\n        {\n            add\n            {\n                int* p;\n            }\n            remove { }\n        }\n\n        ~Class4() // Fixed\n        {\n        }\n        void M()\n        {\n            Point pt = new Point();\n            unsafe\n            {\n                fixed (int* p = &pt.x)\n                {\n                    *p = 1;\n                }\n            }\n\n            unsafe\n            {\n                var i = 1;\n                int* p = &i;\n            }\n        }\n    }\n\n    public class Foo\n    {\n        public class Bar\n        {\n            public class Baz // Fixed\n            {\n            }\n        }\n    }\n\n    public unsafe class Foo2\n    {\n        public class Bar // Fixed\n        {\n            private int* p;\n\n            public class Baz // Fixed\n            {\n                private int* p2;\n            }\n        }\n    }\n\n    public class Checked\n    {\n        public static void M()\n        {\n            checked\n            {\n                checked // Fixed\n                {\n                    var z = 1 + 4;\n                    var y = unchecked(1 +\n                        unchecked(4)); // Fixed\n                }\n            }\n\n            checked // Fixed\n            {\n                var f = 5.5;\n                var y = unchecked(5 + 4);\n            }\n\n            checked\n            {\n                var f = 5.5;\n                var x = 5 + 4;\n                var y = unchecked(5 + 4);\n            }\n\n            checked\n            {\n                var f = 5.5;\n                var x = 5 + 4;\n                var y = unchecked(5.5 + 4); // Fixed\n            }\n\n            checked // Fixed\n            {\n                var f = 5.5;\n                var x = 5 + \"somestring\";\n            }\n\n            unchecked\n            {\n                var f = 5.5;\n                var y = unchecked(5 + 4); // Fixed\n            }\n\n            checked\n            {\n                var x = (uint)10;\n                var y = (int)x;\n            }\n\n            checked // Fixed\n            {\n                var x = 10;\n                var y = (double)x;\n            }\n\n            checked\n            {\n                var x = 10;\n                x += int.MaxValue;\n            }\n\n            checked\n            {\n                var x = 10;\n                x = -int.MaxValue;\n            }\n\n            checked\n            {\n                var x = 10;\n                x = -5;\n            }\n\n            checked // Fixed\n            {\n                var x = 10;\n                x = -\"1\"; // Error [CS0023]\n            }\n\n            checked // Fixed\n            {\n                var x = 10;\n                x = +5;\n            }\n\n            checked  // Fixed\n            {\n                var x = 10;\n                var y = 5 % x;\n            }\n\n            checked\n            {\n                var x = (uint)null; // Error [CS0037]\n                var y = (int)x;\n            }\n\n            checked\n            {\n                var x = (SomeClass)5; // Error [CS0246]\n                var y = (int)x;\n            }\n        }\n    }\n\n    public unsafe struct FixedArraySample\n    {\n        private fixed int a[10];\n    }\n\n    public class StackAlloc\n    {\n        private unsafe void M()\n        {\n            var x = stackalloc int[100];\n        }\n    }\n\n    public class UnsafeHidden\n    {\n        private unsafe int* Method() { return null; }\n        private unsafe void Method2(int* p) { }\n        public unsafe void M1()\n        {\n            Method();\n        }\n\n        public void WithUndefinedInvocation()    // Fixed\n        {\n            Undefined();        // Error [CS0103]: The name 'Undefined' does not exist in the current context\n        }\n\n        private unsafe int* Prop { get; set; }\n        public unsafe void M2()\n        {\n            Method2(Prop);\n        }\n    }\n\n    public class UnsafeParameter\n    {\n        public unsafe delegate void Unsafe(int* x);\n\n        public unsafe void Method()\n        {\n            Unsafe u = (a) => { };\n        }\n    }\n\n    public class UnsafeCtor\n    {\n        public UnsafeCtor()\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantModifier.Latest.Fixed.Checked.cs",
    "content": "﻿using System;\n\nnamespace CSharp9\n{\n    public record Record\n    {\n        public virtual void MyNotOverriddenMethod() { }\n    }\n\n    internal partial record PartialRecordDeclaredOnlyOnce // Fixed\n    {\n        void Method() { }\n    }\n\n    internal partial record PartialPositionalRecordDeclaredOnlyOnce(string parameter) // Fixed\n    {\n        void Method() { }\n    }\n\n    internal partial record PartialDeclaredMultipleTimes\n    {\n    }\n\n    internal partial record PartialDeclaredMultipleTimes\n    {\n    }\n\n    abstract record BaseRecord\n    {\n        public abstract void MyOverriddenMethod();\n\n        public abstract int Prop { get; set; }\n    }\n\n    sealed record SealedRecord : BaseRecord\n    {\n        public sealed override void MyOverriddenMethod() { } // Fixed\n\n        public sealed override int Prop { get; set; } // Fixed\n    }\n\n    internal record BaseRecord<T>\n    {\n        public virtual string Process(string input)\n        {\n            return input;\n        }\n    }\n\n    internal record SubRecord : BaseRecord<string>\n    {\n        public override string Process(string input) => \"Test\";\n    }\n\n    internal unsafe record UnsafeRecord // Fixed\n    {\n        int num;\n\n        private unsafe delegate void MyDelegate2(int i); // Fixed\n\n        unsafe void M() // Fixed\n        {\n        }\n\n        unsafe ~UnsafeRecord() // Fixed\n        {\n        }\n    }\n\n    public record Foo\n    {\n        public unsafe record Bar // Fixed\n        {\n        }\n\n        unsafe interface MyInterface\n        {\n            unsafe int* Method(); // Fixed\n        }\n\n        public static void M()\n        {\n            checked\n            {\n                {\n                    var z = 1 + 4;\n                    var y = unchecked(1 +\n                        4); // Fixed\n                }\n            }\n\n            {\n                var f = 5.5;\n                var y = unchecked(5 + 4);\n            }\n\n            checked\n            {\n                var f = 5.5;\n                var x = 5 + 4;\n                var y = unchecked(5 + 4);\n            }\n\n            checked\n            {\n                var f = 5.5;\n                var x = 5 + 4;\n                var y = 5.5 + 4; // Fixed\n            }\n\n            unchecked\n            {\n                var f = 5.5;\n                var y = 5 + 4; // Fixed\n            }\n\n            checked\n            {\n                var x = (uint)10;\n                var y = (int)x;\n            }\n\n            {\n                var x = 10;\n                var y = (double)x;\n            }\n\n            checked\n            {\n                var x = 10;\n                x += int.MaxValue;\n            }\n\n            {\n                nint x = 42;\n                nuint y = 42;\n\n                x += 42;\n                y += 42;\n            }\n        }\n    }\n\n    public unsafe record RecordNewSyntax(string Input) // Fixed\n    {\n        private string inputField = Input;\n    }\n}\n\nnamespace CSharp10\n{\n    internal unsafe record struct UnsafeRecordStruct // Fixed\n    {\n        int num;\n\n        private unsafe delegate void MyDelegate2(int i); // Fixed\n\n        unsafe void M() // Fixed\n        {\n        }\n    }\n\n    public record struct Foo\n    {\n        public unsafe record struct Bar // Fixed\n        {\n        }\n\n        unsafe interface MyInterface\n        {\n            unsafe int* Method(); // Fixed\n        }\n\n        public static void M()\n        {\n            checked\n            {\n                {\n                    var z = 1 + 4;\n                    var y = unchecked(1 +\n                        4); // Fixed\n                }\n            }\n\n            {\n                var f = 5.5;\n                var y = unchecked(5 + 4);\n            }\n\n            checked\n            {\n                var f = 5.5;\n                var x = 5 + 4;\n                var y = unchecked(5 + 4);\n            }\n\n            checked\n            {\n                var f = 5.5;\n                var x = 5 + 4;\n                var y = 5.5 + 4; // Fixed\n            }\n\n            unchecked\n            {\n                var f = 5.5;\n                var y = 5 + 4; // Fixed\n            }\n\n            checked\n            {\n                var x = (uint)10;\n                var y = (int)x;\n            }\n\n            {\n                var x = 10;\n                var y = (double)x;\n            }\n\n            checked\n            {\n                var x = 10;\n                x += int.MaxValue;\n            }\n        }\n    }\n\n    public unsafe record struct RecordNewSyntax(string Input) // Fixed\n    {\n        private string inputField = Input;\n    }\n}\n\nnamespace CSharp11\n{\n    public class Foo\n    {\n        public static void Method()\n        {\n            {\n                nint x = 42;\n                IntPtr y = 2;\n                var _ = x + y;\n            }\n\n            {\n                nuint x = 42;\n                UIntPtr y = 2;\n                var _ = x + y;\n            }\n        }\n    }\n\n    // file-scoped types cannot use accessibility modifiers and cannot be nested.\n\n    file partial class PartialFoo { } // Fixed\n\n    file partial class PartialFooBar { } // Fixed\n\n    file partial class PartialFileClass { }\n    file partial class PartialFileClass { }\n\n\n    file unsafe class UnsafeClass\n    {\n        int* pointer;\n    }\n\n    file unsafe class UnsafeClass2 // Fixed\n    {\n        int num;\n    }\n\n    file unsafe interface MyInterface\n    {\n        unsafe int* Method(); // Fixed\n    }\n}\n\nnamespace CSharp13\n{\n    public class Base\n    {\n        public virtual int Value { get; }\n    }\n\n    public sealed partial class Thingy : Base\n    {\n        public override sealed partial int Value { get; } // Fixed\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantModifier.Latest.Fixed.Partial.cs",
    "content": "﻿using System;\n\nnamespace CSharp9\n{\n    public record Record\n    {\n        public virtual void MyNotOverriddenMethod() { }\n    }\n\n    internal record PartialRecordDeclaredOnlyOnce // Fixed\n    {\n        void Method() { }\n    }\n\n    internal record PartialPositionalRecordDeclaredOnlyOnce(string parameter) // Fixed\n    {\n        void Method() { }\n    }\n\n    internal partial record PartialDeclaredMultipleTimes\n    {\n    }\n\n    internal partial record PartialDeclaredMultipleTimes\n    {\n    }\n\n    abstract record BaseRecord\n    {\n        public abstract void MyOverriddenMethod();\n\n        public abstract int Prop { get; set; }\n    }\n\n    sealed record SealedRecord : BaseRecord\n    {\n        public sealed override void MyOverriddenMethod() { } // Fixed\n\n        public sealed override int Prop { get; set; } // Fixed\n    }\n\n    internal record BaseRecord<T>\n    {\n        public virtual string Process(string input)\n        {\n            return input;\n        }\n    }\n\n    internal record SubRecord : BaseRecord<string>\n    {\n        public override string Process(string input) => \"Test\";\n    }\n\n    internal unsafe record UnsafeRecord // Fixed\n    {\n        int num;\n\n        private unsafe delegate void MyDelegate2(int i); // Fixed\n\n        unsafe void M() // Fixed\n        {\n        }\n\n        unsafe ~UnsafeRecord() // Fixed\n        {\n        }\n    }\n\n    public record Foo\n    {\n        public unsafe record Bar // Fixed\n        {\n        }\n\n        unsafe interface MyInterface\n        {\n            unsafe int* Method(); // Fixed\n        }\n\n        public static void M()\n        {\n            checked\n            {\n                checked // Fixed\n                {\n                    var z = 1 + 4;\n                    var y = unchecked(1 +\n                        unchecked(4)); // Fixed\n                }\n            }\n\n            checked // Fixed\n            {\n                var f = 5.5;\n                var y = unchecked(5 + 4);\n            }\n\n            checked\n            {\n                var f = 5.5;\n                var x = 5 + 4;\n                var y = unchecked(5 + 4);\n            }\n\n            checked\n            {\n                var f = 5.5;\n                var x = 5 + 4;\n                var y = unchecked(5.5 + 4); // Fixed\n            }\n\n            unchecked\n            {\n                var f = 5.5;\n                var y = unchecked(5 + 4); // Fixed\n            }\n\n            checked\n            {\n                var x = (uint)10;\n                var y = (int)x;\n            }\n\n            checked // Fixed\n            {\n                var x = 10;\n                var y = (double)x;\n            }\n\n            checked\n            {\n                var x = 10;\n                x += int.MaxValue;\n            }\n\n            checked // Fixed\n            {\n                nint x = 42;\n                nuint y = 42;\n\n                x += 42;\n                y += 42;\n            }\n        }\n    }\n\n    public unsafe record RecordNewSyntax(string Input) // Fixed\n    {\n        private string inputField = Input;\n    }\n}\n\nnamespace CSharp10\n{\n    internal unsafe record struct UnsafeRecordStruct // Fixed\n    {\n        int num;\n\n        private unsafe delegate void MyDelegate2(int i); // Fixed\n\n        unsafe void M() // Fixed\n        {\n        }\n    }\n\n    public record struct Foo\n    {\n        public unsafe record struct Bar // Fixed\n        {\n        }\n\n        unsafe interface MyInterface\n        {\n            unsafe int* Method(); // Fixed\n        }\n\n        public static void M()\n        {\n            checked\n            {\n                checked // Fixed\n                {\n                    var z = 1 + 4;\n                    var y = unchecked(1 +\n                        unchecked(4)); // Fixed\n                }\n            }\n\n            checked // Fixed\n            {\n                var f = 5.5;\n                var y = unchecked(5 + 4);\n            }\n\n            checked\n            {\n                var f = 5.5;\n                var x = 5 + 4;\n                var y = unchecked(5 + 4);\n            }\n\n            checked\n            {\n                var f = 5.5;\n                var x = 5 + 4;\n                var y = unchecked(5.5 + 4); // Fixed\n            }\n\n            unchecked\n            {\n                var f = 5.5;\n                var y = unchecked(5 + 4); // Fixed\n            }\n\n            checked\n            {\n                var x = (uint)10;\n                var y = (int)x;\n            }\n\n            checked // Fixed\n            {\n                var x = 10;\n                var y = (double)x;\n            }\n\n            checked\n            {\n                var x = 10;\n                x += int.MaxValue;\n            }\n        }\n    }\n\n    public unsafe record struct RecordNewSyntax(string Input) // Fixed\n    {\n        private string inputField = Input;\n    }\n}\n\nnamespace CSharp11\n{\n    public class Foo\n    {\n        public static void Method()\n        {\n            checked // Fixed\n            {\n                nint x = 42;\n                IntPtr y = 2;\n                var _ = x + y;\n            }\n\n            checked // Fixed\n            {\n                nuint x = 42;\n                UIntPtr y = 2;\n                var _ = x + y;\n            }\n        }\n    }\n\n    // file-scoped types cannot use accessibility modifiers and cannot be nested.\n\n    file class PartialFoo { } // Fixed\n\n    file class PartialFooBar { } // Fixed\n\n    file partial class PartialFileClass { }\n    file partial class PartialFileClass { }\n\n\n    file unsafe class UnsafeClass\n    {\n        int* pointer;\n    }\n\n    file unsafe class UnsafeClass2 // Fixed\n    {\n        int num;\n    }\n\n    file unsafe interface MyInterface\n    {\n        unsafe int* Method(); // Fixed\n    }\n}\n\nnamespace CSharp13\n{\n    public class Base\n    {\n        public virtual int Value { get; }\n    }\n\n    public sealed class Thingy : Base\n    {\n        public override sealed partial int Value { get; } // Fixed\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantModifier.Latest.Fixed.Sealed.cs",
    "content": "﻿using System;\n\nnamespace CSharp9\n{\n    public record Record\n    {\n        public virtual void MyNotOverriddenMethod() { }\n    }\n\n    internal partial record PartialRecordDeclaredOnlyOnce // Fixed\n    {\n        void Method() { }\n    }\n\n    internal partial record PartialPositionalRecordDeclaredOnlyOnce(string parameter) // Fixed\n    {\n        void Method() { }\n    }\n\n    internal partial record PartialDeclaredMultipleTimes\n    {\n    }\n\n    internal partial record PartialDeclaredMultipleTimes\n    {\n    }\n\n    abstract record BaseRecord\n    {\n        public abstract void MyOverriddenMethod();\n\n        public abstract int Prop { get; set; }\n    }\n\n    sealed record SealedRecord : BaseRecord\n    {\n        public override void MyOverriddenMethod() { } // Fixed\n\n        public override int Prop { get; set; } // Fixed\n    }\n\n    internal record BaseRecord<T>\n    {\n        public virtual string Process(string input)\n        {\n            return input;\n        }\n    }\n\n    internal record SubRecord : BaseRecord<string>\n    {\n        public override string Process(string input) => \"Test\";\n    }\n\n    internal unsafe record UnsafeRecord // Fixed\n    {\n        int num;\n\n        private unsafe delegate void MyDelegate2(int i); // Fixed\n\n        unsafe void M() // Fixed\n        {\n        }\n\n        unsafe ~UnsafeRecord() // Fixed\n        {\n        }\n    }\n\n    public record Foo\n    {\n        public unsafe record Bar // Fixed\n        {\n        }\n\n        unsafe interface MyInterface\n        {\n            unsafe int* Method(); // Fixed\n        }\n\n        public static void M()\n        {\n            checked\n            {\n                checked // Fixed\n                {\n                    var z = 1 + 4;\n                    var y = unchecked(1 +\n                        unchecked(4)); // Fixed\n                }\n            }\n\n            checked // Fixed\n            {\n                var f = 5.5;\n                var y = unchecked(5 + 4);\n            }\n\n            checked\n            {\n                var f = 5.5;\n                var x = 5 + 4;\n                var y = unchecked(5 + 4);\n            }\n\n            checked\n            {\n                var f = 5.5;\n                var x = 5 + 4;\n                var y = unchecked(5.5 + 4); // Fixed\n            }\n\n            unchecked\n            {\n                var f = 5.5;\n                var y = unchecked(5 + 4); // Fixed\n            }\n\n            checked\n            {\n                var x = (uint)10;\n                var y = (int)x;\n            }\n\n            checked // Fixed\n            {\n                var x = 10;\n                var y = (double)x;\n            }\n\n            checked\n            {\n                var x = 10;\n                x += int.MaxValue;\n            }\n\n            checked // Fixed\n            {\n                nint x = 42;\n                nuint y = 42;\n\n                x += 42;\n                y += 42;\n            }\n        }\n    }\n\n    public unsafe record RecordNewSyntax(string Input) // Fixed\n    {\n        private string inputField = Input;\n    }\n}\n\nnamespace CSharp10\n{\n    internal unsafe record struct UnsafeRecordStruct // Fixed\n    {\n        int num;\n\n        private unsafe delegate void MyDelegate2(int i); // Fixed\n\n        unsafe void M() // Fixed\n        {\n        }\n    }\n\n    public record struct Foo\n    {\n        public unsafe record struct Bar // Fixed\n        {\n        }\n\n        unsafe interface MyInterface\n        {\n            unsafe int* Method(); // Fixed\n        }\n\n        public static void M()\n        {\n            checked\n            {\n                checked // Fixed\n                {\n                    var z = 1 + 4;\n                    var y = unchecked(1 +\n                        unchecked(4)); // Fixed\n                }\n            }\n\n            checked // Fixed\n            {\n                var f = 5.5;\n                var y = unchecked(5 + 4);\n            }\n\n            checked\n            {\n                var f = 5.5;\n                var x = 5 + 4;\n                var y = unchecked(5 + 4);\n            }\n\n            checked\n            {\n                var f = 5.5;\n                var x = 5 + 4;\n                var y = unchecked(5.5 + 4); // Fixed\n            }\n\n            unchecked\n            {\n                var f = 5.5;\n                var y = unchecked(5 + 4); // Fixed\n            }\n\n            checked\n            {\n                var x = (uint)10;\n                var y = (int)x;\n            }\n\n            checked // Fixed\n            {\n                var x = 10;\n                var y = (double)x;\n            }\n\n            checked\n            {\n                var x = 10;\n                x += int.MaxValue;\n            }\n        }\n    }\n\n    public unsafe record struct RecordNewSyntax(string Input) // Fixed\n    {\n        private string inputField = Input;\n    }\n}\n\nnamespace CSharp11\n{\n    public class Foo\n    {\n        public static void Method()\n        {\n            checked // Fixed\n            {\n                nint x = 42;\n                IntPtr y = 2;\n                var _ = x + y;\n            }\n\n            checked // Fixed\n            {\n                nuint x = 42;\n                UIntPtr y = 2;\n                var _ = x + y;\n            }\n        }\n    }\n\n    // file-scoped types cannot use accessibility modifiers and cannot be nested.\n\n    file partial class PartialFoo { } // Fixed\n\n    file partial class PartialFooBar { } // Fixed\n\n    file partial class PartialFileClass { }\n    file partial class PartialFileClass { }\n\n\n    file unsafe class UnsafeClass\n    {\n        int* pointer;\n    }\n\n    file unsafe class UnsafeClass2 // Fixed\n    {\n        int num;\n    }\n\n    file unsafe interface MyInterface\n    {\n        unsafe int* Method(); // Fixed\n    }\n}\n\nnamespace CSharp13\n{\n    public class Base\n    {\n        public virtual int Value { get; }\n    }\n\n    public sealed partial class Thingy : Base\n    {\n        public override partial int Value { get; } // Fixed\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantModifier.Latest.Fixed.Unsafe.cs",
    "content": "﻿using System;\n\nnamespace CSharp9\n{\n    public record Record\n    {\n        public virtual void MyNotOverriddenMethod() { }\n    }\n\n    internal partial record PartialRecordDeclaredOnlyOnce // Fixed\n    {\n        void Method() { }\n    }\n\n    internal partial record PartialPositionalRecordDeclaredOnlyOnce(string parameter) // Fixed\n    {\n        void Method() { }\n    }\n\n    internal partial record PartialDeclaredMultipleTimes\n    {\n    }\n\n    internal partial record PartialDeclaredMultipleTimes\n    {\n    }\n\n    abstract record BaseRecord\n    {\n        public abstract void MyOverriddenMethod();\n\n        public abstract int Prop { get; set; }\n    }\n\n    sealed record SealedRecord : BaseRecord\n    {\n        public sealed override void MyOverriddenMethod() { } // Fixed\n\n        public sealed override int Prop { get; set; } // Fixed\n    }\n\n    internal record BaseRecord<T>\n    {\n        public virtual string Process(string input)\n        {\n            return input;\n        }\n    }\n\n    internal record SubRecord : BaseRecord<string>\n    {\n        public override string Process(string input) => \"Test\";\n    }\n\n    internal record UnsafeRecord // Fixed\n    {\n        int num;\n\n        private delegate void MyDelegate2(int i); // Fixed\n\n        void M() // Fixed\n        {\n        }\n\n        ~UnsafeRecord() // Fixed\n        {\n        }\n    }\n\n    public record Foo\n    {\n        public record Bar // Fixed\n        {\n        }\n\n        unsafe interface MyInterface\n        {\n            int* Method(); // Fixed\n        }\n\n        public static void M()\n        {\n            checked\n            {\n                checked // Fixed\n                {\n                    var z = 1 + 4;\n                    var y = unchecked(1 +\n                        unchecked(4)); // Fixed\n                }\n            }\n\n            checked // Fixed\n            {\n                var f = 5.5;\n                var y = unchecked(5 + 4);\n            }\n\n            checked\n            {\n                var f = 5.5;\n                var x = 5 + 4;\n                var y = unchecked(5 + 4);\n            }\n\n            checked\n            {\n                var f = 5.5;\n                var x = 5 + 4;\n                var y = unchecked(5.5 + 4); // Fixed\n            }\n\n            unchecked\n            {\n                var f = 5.5;\n                var y = unchecked(5 + 4); // Fixed\n            }\n\n            checked\n            {\n                var x = (uint)10;\n                var y = (int)x;\n            }\n\n            checked // Fixed\n            {\n                var x = 10;\n                var y = (double)x;\n            }\n\n            checked\n            {\n                var x = 10;\n                x += int.MaxValue;\n            }\n\n            checked // Fixed\n            {\n                nint x = 42;\n                nuint y = 42;\n\n                x += 42;\n                y += 42;\n            }\n        }\n    }\n\n    public record RecordNewSyntax(string Input) // Fixed\n    {\n        private string inputField = Input;\n    }\n}\n\nnamespace CSharp10\n{\n    internal record struct UnsafeRecordStruct // Fixed\n    {\n        int num;\n\n        private delegate void MyDelegate2(int i); // Fixed\n\n        void M() // Fixed\n        {\n        }\n    }\n\n    public record struct Foo\n    {\n        public record struct Bar // Fixed\n        {\n        }\n\n        unsafe interface MyInterface\n        {\n            int* Method(); // Fixed\n        }\n\n        public static void M()\n        {\n            checked\n            {\n                checked // Fixed\n                {\n                    var z = 1 + 4;\n                    var y = unchecked(1 +\n                        unchecked(4)); // Fixed\n                }\n            }\n\n            checked // Fixed\n            {\n                var f = 5.5;\n                var y = unchecked(5 + 4);\n            }\n\n            checked\n            {\n                var f = 5.5;\n                var x = 5 + 4;\n                var y = unchecked(5 + 4);\n            }\n\n            checked\n            {\n                var f = 5.5;\n                var x = 5 + 4;\n                var y = unchecked(5.5 + 4); // Fixed\n            }\n\n            unchecked\n            {\n                var f = 5.5;\n                var y = unchecked(5 + 4); // Fixed\n            }\n\n            checked\n            {\n                var x = (uint)10;\n                var y = (int)x;\n            }\n\n            checked // Fixed\n            {\n                var x = 10;\n                var y = (double)x;\n            }\n\n            checked\n            {\n                var x = 10;\n                x += int.MaxValue;\n            }\n        }\n    }\n\n    public record struct RecordNewSyntax(string Input) // Fixed\n    {\n        private string inputField = Input;\n    }\n}\n\nnamespace CSharp11\n{\n    public class Foo\n    {\n        public static void Method()\n        {\n            checked // Fixed\n            {\n                nint x = 42;\n                IntPtr y = 2;\n                var _ = x + y;\n            }\n\n            checked // Fixed\n            {\n                nuint x = 42;\n                UIntPtr y = 2;\n                var _ = x + y;\n            }\n        }\n    }\n\n    // file-scoped types cannot use accessibility modifiers and cannot be nested.\n\n    file partial class PartialFoo { } // Fixed\n\n    file partial class PartialFooBar { } // Fixed\n\n    file partial class PartialFileClass { }\n    file partial class PartialFileClass { }\n\n\n    file unsafe class UnsafeClass\n    {\n        int* pointer;\n    }\n\n    file class UnsafeClass2 // Fixed\n    {\n        int num;\n    }\n\n    file unsafe interface MyInterface\n    {\n        int* Method(); // Fixed\n    }\n}\n\nnamespace CSharp13\n{\n    public class Base\n    {\n        public virtual int Value { get; }\n    }\n\n    public sealed partial class Thingy : Base\n    {\n        public override sealed partial int Value { get; } // Fixed\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantModifier.Latest.Partial.cs",
    "content": "﻿namespace CSharp11\n{\n    file partial class PartialFooBar { } // Noncompliant\n}\n\n\nnamespace CSharp13\n{\n    public sealed partial class Thingy\n    {\n        public override sealed partial int Value { get => 42; } // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantModifier.Latest.cs",
    "content": "﻿using System;\n\nnamespace CSharp9\n{\n    public record Record\n    {\n        public virtual void MyNotOverriddenMethod() { }\n    }\n\n    internal partial record PartialRecordDeclaredOnlyOnce // Noncompliant\n    {\n        void Method() { }\n    }\n\n    internal partial record PartialPositionalRecordDeclaredOnlyOnce(string parameter) // Noncompliant\n    {\n        void Method() { }\n    }\n\n    internal partial record PartialDeclaredMultipleTimes\n    {\n    }\n\n    internal partial record PartialDeclaredMultipleTimes\n    {\n    }\n\n    abstract record BaseRecord\n    {\n        public abstract void MyOverriddenMethod();\n\n        public abstract int Prop { get; set; }\n    }\n\n    sealed record SealedRecord : BaseRecord\n    {\n        public sealed override void MyOverriddenMethod() { } // Noncompliant\n\n        public sealed override int Prop { get; set; } // Noncompliant\n    }\n\n    internal record BaseRecord<T>\n    {\n        public virtual string Process(string input)\n        {\n            return input;\n        }\n    }\n\n    internal record SubRecord : BaseRecord<string>\n    {\n        public override string Process(string input) => \"Test\";\n    }\n\n    internal unsafe record UnsafeRecord // Noncompliant\n    {\n        int num;\n\n        private unsafe delegate void MyDelegate2(int i); // Noncompliant\n\n        unsafe void M() // Noncompliant\n        {\n        }\n\n        unsafe ~UnsafeRecord() // Noncompliant\n        {\n        }\n    }\n\n    public record Foo\n    {\n        public unsafe record Bar // Noncompliant\n        {\n        }\n\n        unsafe interface MyInterface\n        {\n            unsafe int* Method(); // Noncompliant\n        }\n\n        public static void M()\n        {\n            checked\n            {\n                checked // Noncompliant\n    //          ^^^^^^^\n                {\n                    var z = 1 + 4;\n                    var y = unchecked(1 +\n                        unchecked(4)); // Noncompliant\n    //                  ^^^^^^^^^\n                }\n            }\n\n            checked // Noncompliant {{'checked' is redundant in this context.}}\n            {\n                var f = 5.5;\n                var y = unchecked(5 + 4);\n            }\n\n            checked\n            {\n                var f = 5.5;\n                var x = 5 + 4;\n                var y = unchecked(5 + 4);\n            }\n\n            checked\n            {\n                var f = 5.5;\n                var x = 5 + 4;\n                var y = unchecked(5.5 + 4); // Noncompliant\n            }\n\n            unchecked\n            {\n                var f = 5.5;\n                var y = unchecked(5 + 4); // Noncompliant\n            }\n\n            checked\n            {\n                var x = (uint)10;\n                var y = (int)x;\n            }\n\n            checked // Noncompliant\n            {\n                var x = 10;\n                var y = (double)x;\n            }\n\n            checked\n            {\n                var x = 10;\n                x += int.MaxValue;\n            }\n\n            checked // Noncompliant, FP, nuint/UIntPtr is not a member of KnownType.IntegralNumbers.\n            {\n                nint x = 42;\n                nuint y = 42;\n\n                x += 42;\n                y += 42;\n            }\n        }\n    }\n\n    public unsafe record RecordNewSyntax(string Input) // Noncompliant For the class\n    {\n        private string inputField = Input;\n    }\n}\n\nnamespace CSharp10\n{\n    internal unsafe record struct UnsafeRecordStruct // Noncompliant\n    {\n        int num;\n\n        private unsafe delegate void MyDelegate2(int i); // Noncompliant\n\n        unsafe void M() // Noncompliant\n        {\n        }\n    }\n\n    public record struct Foo\n    {\n        public unsafe record struct Bar // Noncompliant\n        {\n        }\n\n        unsafe interface MyInterface\n        {\n            unsafe int* Method(); // Noncompliant\n        }\n\n        public static void M()\n        {\n            checked\n            {\n                checked // Noncompliant\n                {\n                    var z = 1 + 4;\n                    var y = unchecked(1 +\n                        unchecked(4)); // Noncompliant\n                }\n            }\n\n            checked // Noncompliant\n            {\n                var f = 5.5;\n                var y = unchecked(5 + 4);\n            }\n\n            checked\n            {\n                var f = 5.5;\n                var x = 5 + 4;\n                var y = unchecked(5 + 4);\n            }\n\n            checked\n            {\n                var f = 5.5;\n                var x = 5 + 4;\n                var y = unchecked(5.5 + 4); // Noncompliant\n            }\n\n            unchecked\n            {\n                var f = 5.5;\n                var y = unchecked(5 + 4); // Noncompliant\n            }\n\n            checked\n            {\n                var x = (uint)10;\n                var y = (int)x;\n            }\n\n            checked // Noncompliant\n            {\n                var x = 10;\n                var y = (double)x;\n            }\n\n            checked\n            {\n                var x = 10;\n                x += int.MaxValue;\n            }\n        }\n    }\n\n    public unsafe record struct RecordNewSyntax(string Input) // Noncompliant\n    {\n        private string inputField = Input;\n    }\n}\n\nnamespace CSharp11\n{\n    public class Foo\n    {\n        public static void Method()\n        {\n            checked // Noncompliant, FP, nint/IntPtr is not a member of KnownType.IntegralNumbers.\n            {\n                nint x = 42;\n                IntPtr y = 2;\n                var _ = x + y;\n            }\n\n            checked // Noncompliant, FP, nuint/UIntPtr is not a member of KnownType.IntegralNumbers.\n            {\n                nuint x = 42;\n                UIntPtr y = 2;\n                var _ = x + y;\n            }\n        }\n    }\n\n    // file-scoped types cannot use accessibility modifiers and cannot be nested.\n\n    file partial class PartialFoo { } // Noncompliant\n\n    file partial class PartialFooBar { } // Noncompliant\n\n    file partial class PartialFileClass { }\n    file partial class PartialFileClass { }\n\n\n    file unsafe class UnsafeClass\n    {\n        int* pointer;\n    }\n\n    file unsafe class UnsafeClass2 // Noncompliant\n//       ^^^^^^\n    {\n        int num;\n    }\n\n    file unsafe interface MyInterface\n    {\n        unsafe int* Method(); // Noncompliant\n    }\n}\n\nnamespace CSharp13\n{\n    public class Base\n    {\n        public virtual int Value { get; }\n    }\n\n    public sealed partial class Thingy : Base\n    {\n        public override sealed partial int Value { get; } // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantModifier.Preprocessor.Net.Partial.cs",
    "content": "﻿using System;\nusing System.Text.RegularExpressions;\n\nnamespace Repro_1129\n{\n    public static partial class TargetDependent\n    {\n        private static partial Regex GetPattern() { return null; }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantModifier.Preprocessor.Net.cs",
    "content": "﻿using System;\nusing System.Text.RegularExpressions;\n\nnamespace Repro_1129\n{\n    public static partial class TargetDependent\n    {\n        public static bool Matches(string ns) => Pattern.IsMatch(ns);\n\n#if NETFRAMEWORK\n        private static readonly Regex Pattern = new(@\"\\.v(?<Version>[1-9][0-9]+(_[0-9]+)*)\\.\", RegexOptions.CultureInvariant | RegexOptions.ExplicitCapture);\n#else\n        private static readonly Regex Pattern = GetPattern();\n\n        [GeneratedRegex(@\"\\.v(?<Version>[1-9][0-9]+(_[0-9]+)*)\\.\", RegexOptions.ExplicitCapture | RegexOptions.CultureInvariant)]\n        private static partial Regex GetPattern();\n#endif\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantModifier.Preprocessor.NetFx.cs",
    "content": "﻿using System;\nusing System.Text.RegularExpressions;\n\nnamespace Repro_1129\n{\n    public static partial class TargetDependent // Noncompliant FP - Only when target .NET Framework, 'partial' is required for GeneratedRegex attribute\n    {\n        public static bool Matches(string ns) => Pattern.IsMatch(ns);\n\n#if NETFRAMEWORK\n        private static readonly Regex Pattern = new(@\"\\.v(?<Version>[1-9][0-9]+(_[0-9]+)*)\\.\", RegexOptions.CultureInvariant | RegexOptions.ExplicitCapture);\n#else\n        private static readonly Regex Pattern = GetPattern();\n\n        [GeneratedRegex(@\"\\.v(?<Version>[1-9][0-9]+(_[0-9]+)*)\\.\", RegexOptions.ExplicitCapture | RegexOptions.CultureInvariant)]\n        private static partial Regex GetPattern();\n#endif\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantModifier.Preprocessor.cs",
    "content": "﻿using System;\nusing System.Text.RegularExpressions;\n\nnamespace Repo_\n{\n    public static partial class TargetDependent // Noncompliant FP - Only when target .NET Framework, 'partial' is required for GeneratedRegex attribute\n    {\n        public static bool Matches(string ns) => Pattern.IsMatch(ns);\n\n#if NETFRAMEWORK\n        private static readonly Regex Pattern = new(@\"\\.v(?<Version>[1-9][0-9]+(_[0-9]+)*)\\.\", RegexOptions.CultureInvariant | RegexOptions.ExplicitCapture);\n#else\n        private static readonly Regex Pattern = GetPattern();\n\n        [GeneratedRegex(@\"\\.v(?<Version>[1-9][0-9]+(_[0-9]+)*)\\.\", RegexOptions.ExplicitCapture | RegexOptions.CultureInvariant)]\n        private static partial Regex GetPattern();\n#endif\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantModifier.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class C1\n    {\n        public virtual void MyNotOverriddenMethod() { }\n    }\n    internal partial class Partial1Part //Noncompliant\n//           ^^^^^^^\n    {\n        void Method() { }\n    }\n    partial struct PartialStruct //Noncompliant {{'partial' is gratuitous in this context.}}\n    {\n    }\n    partial interface PartialInterface //Noncompliant\n    {\n    }\n\n    internal partial class Partial2Part\n    {\n    }\n\n    internal abstract partial class Partial2Part\n    {\n        public virtual void MyOverriddenMethod() { }\n        public virtual int Prop { get; set; }\n        public abstract int this[int counter] { get; }\n        protected abstract event EventHandler<EventArgs> MyEvent;\n        protected abstract event EventHandler<EventArgs> MyEvent2;\n    }\n\n    internal class Override : Partial2Part\n    {\n        public override void MyOverriddenMethod() { }\n\n        public override int this[int counter]\n        {\n            get { return 0; }\n        }\n\n        protected override event EventHandler<EventArgs> MyEvent;\n        protected override event EventHandler<EventArgs> MyEvent2\n        {\n            add { }\n            remove { }\n        }\n\n        public enum SomeEnumeration\n        {\n\n        }\n    }\n\n    sealed class SealedClass : Partial2Part\n    {\n        public override sealed void MyOverriddenMethod() { } // Noncompliant {{'sealed' is redundant in this context.}}\n//                      ^^^^^^\n        public override sealed int Prop { get; set; } // Noncompliant\n\n        public override sealed int this[int counter] // Noncompliant\n        {\n            get { return 0; }\n        }\n\n        protected override sealed event EventHandler<EventArgs> MyEvent; // Noncompliant\n        protected override sealed event EventHandler<EventArgs> MyEvent2 // Noncompliant\n        {\n            add { }\n            remove { }\n        }\n    }\n\n    abstract class AbstractClass : Partial2Part\n    {\n        public override sealed void MyOverriddenMethod() { }\n        public override sealed int Prop { get; set; }\n\n        public override sealed int this[int counter]\n        {\n            get { return 0; }\n        }\n\n        protected override sealed event EventHandler<EventArgs> MyEvent;\n        protected override sealed event EventHandler<EventArgs> MyEvent2\n        {\n            add { }\n            remove { }\n        }\n    }\n\n    sealed class SealedClassWithoutRedundantKeywordOnMembers : Partial2Part\n    {\n        public override void MyOverriddenMethod() { }\n\n        public override int Prop { get; set; }\n\n        public override int this[int counter]\n        {\n            get { return 0; }\n        }\n\n        protected override event EventHandler<EventArgs> MyEvent;\n        protected override event EventHandler<EventArgs> MyEvent2\n        {\n            add { }\n            remove { }\n        }\n    }\n\n    internal class BaseClass<T>\n    {\n        public virtual string Process(string input)\n        {\n            return input;\n        }\n    }\n\n    internal class SubClass : BaseClass<string>\n    {\n        public override string Process(string input)\n        {\n            return \"Test\";\n        }\n    }\n\n    unsafe class UnsafeClass\n    {\n        int* pointer;\n    }\n\n    unsafe class UnsafeClass2 // Noncompliant\n//  ^^^^^^\n    {\n        int num;\n    }\n    unsafe class UnsafeClass3 // Noncompliant {{'unsafe' is redundant in this context.}}\n    {\n        unsafe void M() // Noncompliant\n//      ^^^^^^\n        {\n\n        }\n    }\n\n    class Point\n    {\n        public int x;\n        public int y;\n    }\n\n    class Class4\n    {\n        unsafe interface MyInterface\n        {\n            unsafe int* Method(); // Noncompliant\n        }\n\n        private unsafe delegate void MyDelegate(int* p);\n        private unsafe delegate void MyDelegate2(int i); // Noncompliant\n\n        unsafe class Inner { } // Noncompliant\n\n        unsafe event MyDelegate MyEvent; // Noncompliant\n        unsafe event MyDelegate MyEvent2\n        {\n            add\n            {\n                int* p;\n            }\n            remove { }\n        }\n\n        unsafe ~Class4() // Noncompliant\n        {\n        }\n        void M()\n        {\n            Point pt = new Point();\n            unsafe\n            {\n                fixed (int* p = &pt.x)\n                {\n                    *p = 1;\n                }\n            }\n\n            unsafe\n            {\n                unsafe // Noncompliant\n                {\n                    unsafe // Noncompliant\n                    {\n                        var i = 1;\n                        int* p = &i;\n                    }\n                }\n            }\n        }\n    }\n\n    public class Foo\n    {\n        public class Bar\n        {\n            public unsafe class Baz // Noncompliant\n            {\n            }\n        }\n    }\n\n    public unsafe class Foo2\n    {\n        public unsafe class Bar // Noncompliant\n        {\n            private int* p;\n\n            public unsafe class Baz // Noncompliant\n            {\n                private int* p2;\n            }\n        }\n    }\n\n    public class Checked\n    {\n        public static void M()\n        {\n            checked\n            {\n                checked // Noncompliant\n//              ^^^^^^^\n                {\n                    var z = 1 + 4;\n                    var y = unchecked(1 +\n                        unchecked(4)); // Noncompliant\n//                      ^^^^^^^^^\n                }\n            }\n\n            checked // Noncompliant {{'checked' is redundant in this context.}}\n            {\n                var f = 5.5;\n                var y = unchecked(5 + 4);\n            }\n\n            checked\n            {\n                var f = 5.5;\n                var x = 5 + 4;\n                var y = unchecked(5 + 4);\n            }\n\n            checked\n            {\n                var f = 5.5;\n                var x = 5 + 4;\n                var y = unchecked(5.5 + 4); // Noncompliant\n            }\n\n            checked // Noncompliant\n            {\n                var f = 5.5;\n                var x = 5 + \"somestring\";\n            }\n\n            unchecked\n            {\n                var f = 5.5;\n                var y = unchecked(5 + 4); // Noncompliant\n            }\n\n            checked\n            {\n                var x = (uint)10;\n                var y = (int)x;\n            }\n\n            checked // Noncompliant\n            {\n                var x = 10;\n                var y = (double)x;\n            }\n\n            checked\n            {\n                var x = 10;\n                x += int.MaxValue;\n            }\n\n            checked\n            {\n                var x = 10;\n                x = -int.MaxValue;\n            }\n\n            checked\n            {\n                var x = 10;\n                x = -5;\n            }\n\n            checked // Noncompliant\n            {\n                var x = 10;\n                x = -\"1\"; // Error [CS0023]\n            }\n\n            checked // Noncompliant\n            {\n                var x = 10;\n                x = +5;\n            }\n\n            checked  // Noncompliant\n            {\n                var x = 10;\n                var y = 5 % x;\n            }\n\n            checked\n            {\n                var x = (uint)null; // Error [CS0037]\n                var y = (int)x;\n            }\n\n            checked\n            {\n                var x = (SomeClass)5; // Error [CS0246]\n                var y = (int)x;\n            }\n        }\n    }\n\n    public unsafe struct FixedArraySample\n    {\n        private fixed int a[10];\n    }\n\n    public class StackAlloc\n    {\n        private unsafe void M()\n        {\n            var x = stackalloc int[100];\n        }\n    }\n\n    public class UnsafeHidden\n    {\n        private unsafe int* Method() { return null; }\n        private unsafe void Method2(int* p) { }\n        public unsafe void M1()\n        {\n            Method();\n        }\n\n        public unsafe void WithUndefinedInvocation()    // Noncompliant\n        {\n            Undefined();        // Error [CS0103]: The name 'Undefined' does not exist in the current context\n        }\n\n        private unsafe int* Prop { get; set; }\n        public unsafe void M2()\n        {\n            Method2(Prop);\n        }\n    }\n\n    public class UnsafeParameter\n    {\n        public unsafe delegate void Unsafe(int* x);\n\n        public unsafe void Method()\n        {\n            Unsafe u = (a) => { };\n        }\n    }\n\n    public class UnsafeCtor\n    {\n        public UnsafeCtor()\n        {\n            unsafe // Noncompliant\n            {\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantNullCheck.CSharp10.Fixed.cs",
    "content": "﻿using System.Collections.Generic;\n\nSomeClass someClass = new();\n\nif (someClass is { SomeProperty.Count: 42 }) { } // Fixed\nif (someClass is { SomeProperty.Count: 42 }) { } // Fixed\n\nif (someClass != null && someClass is not { SomeProperty.Count: 42 }) { } // Compliant\n\nsealed record SomeClass\n{\n    public List<int> SomeProperty;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantNullCheck.CSharp10.cs",
    "content": "﻿using System.Collections.Generic;\n\nSomeClass someClass = new();\n\nif (someClass != null && someClass is { SomeProperty.Count: 42 }) { } // Noncompliant\nif (!(someClass is null) && someClass is { SomeProperty.Count: 42 }) { } // Noncompliant\n\nif (someClass != null && someClass is not { SomeProperty.Count: 42 }) { } // Compliant\n\nsealed record SomeClass\n{\n    public List<int> SomeProperty;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantNullCheck.CSharp11.cs",
    "content": "﻿public class SomeClass\n{\n    public void SomeMethod(object[] objects)\n    {\n        if (objects[0] is not null && objects is [not null]) // FN\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantNullCheck.CSharp9.Fixed.cs",
    "content": "﻿object a = \"\";\nobject b = \"\";\nobject n = 5;\nobject m = 5;\nApple apple = new();\n\n// AND\nif (n is nint) // Fixed\n{\n}\n\nif (n is nint nintValue) // Fixed\n{\n}\n\nif (n is Apple) // Fixed\n{\n}\n\nvar result = (n is string); // Fixed\nresult = (n is string && m is not null); // Fixed\n\n// parenthesized pattern\nresult = n is (\"a\" or \"b\" or \"c\"); // Fixed\n\nif (n is null && apple != null && m is null && apple is (\"Sweet\", \"Red\")) { } // FN\nif (n is null && apple != null && apple is (\"Sweet\", \"Red\")) { } // FN\nif (apple is (\"Sweet\", \"Red\")) { } // Fixed\nif (apple is { Taste: \"Sweet\", Color: \"Red\" }) { } // Fixed\nif (apple is { Taste: \"Sweet\", Color: \"Red\" }) { } // Fixed\nif (apple is (\"Sweet\", \"Red\")) { } // Fixed\n\nvar x = a switch\n{\n    Apple appleInside => \"\", // Fixed\n    _ => \"\"\n};\n\nx = a switch\n{\n    string s6 and (not null or \"a\") => s6, // FN\n    _ => \"\"\n};\n\nx = apple switch\n{\n    (\"Sweet\", \"Red\") => \"\", // Fixed\n    _ => \"\"\n};\n\nx = apple switch\n{\n    { Taste: \"Sweet\", Color: \"Red\" } => \"\", // Fixed\n    _ => \"\"\n};\n\nx = apple switch\n{\n    { Taste: \"Sweet\" } and { Color: \"Red\" }  => \"\", // Fixed\n    _ => \"\"\n};\n\n// OR, inverted\nresult = !(n is Apple); // Fixed\nresult = !(n is Apple); // Fixed\nresult = !(a is Apple aTyped1); // Fixed\nresult = !(a is Apple aTyped2); // Fixed\nresult = ((!((a) is Apple))); // Fixed\n\nif (apple is not { Taste: \"Sweet\", Color: \"Red\" }) { } // Fixed\nif (apple is not { Taste: \"Sweet\", Color: \"Red\" }) { } // Fixed\nif (!(apple is { Taste: \"Sweet\", Color: \"Red\" })) { } // Fixed\nif (apple is not (\"Sweet\", \"Red\")) { } // Fixed\nif (!(apple is (\"Sweet\", \"Red\"))) { } // Fixed\nif (!(apple is (\"Sweet\", \"Red\"))) { } // Fixed\n\nx = a switch\n{\n    not \"a\" => \"not a\", // Fixed\n    _ => \"default\"\n};\n\nx = a switch\n{\n    not Apple => \"\", // Fixed\n    _ => \"\"\n};\n\nx = apple switch\n{\n    not (\"Sweet\", \"Red\")  => \"\", // Fixed\n    _ => \"\"\n};\n\nx = apple switch\n{\n    not { Taste: \"Sweet\" } or not { Color: \"Red\" } => \"\", // Fixed\n    _ => \"\"\n};\n\nx = apple switch\n{\n    not { Taste: \"Sweet\" } or not { Color: \"Red\" } => \"\", // Fixed\n    _ => \"\"\n};\n\nswitch (n)\n{\n    case \"sweet\": // Fixed\n        break;\n    case not \"sweet\": // Fixed\n        break;\n    default:\n        break;\n}\n\nswitch (n)\n{\n    case Apple appleSwitch1: // Fixed\n        break;\n    case not (\"Sweet\", \"Red\"): // Fixed\n        break;\n    default:\n        break;\n}\n\nswitch (n)\n{\n    case not Apple: // Fixed\n        break;\n    default:\n        break;\n}\n\n// Compliant\nif (apple != null && apple is not { Taste: \"Sweet\", Color: \"Red\" }) { } // Compliant\nif (apple != null && apple is not (\"Sweet\", \"Red\")) { } // Compliant\nif (apple is not null || apple is (\"Sweet\", \"Red\")) { } // Compliant\nif (apple is not null || apple is { Taste: \"Sweet\", Color: \"Red\" }) { } // Compliant\nif (apple == null || apple is { Taste: \"Sweet\", Color: \"Red\" }) { } // Compliant\nif (apple is { Taste: \"Sweet\", Color: \"Red\" } || apple is null) { } // Compliant\n\nif (n is not null && n is not null) // Compliant (not related to this rule)\n{\n}\nif (n is not null && n != null) // Compliant (not related to this rule)\n{\n}\nresult = (n is not Apple && n != null); // Compliant\nresult = (a is null || a is not null); // Compliant - not related to this rule\nresult = (a is null || !(b is Apple)); // Compliant - a is not b\nresult = b is null || !(a is Apple); // Compliant - b is not a\nresult = (n is string s && s is not null); // Compliant, s can be null\nresult = (n is not Apple && n is not null); // Compliant\nresult = (a is null && a is string); // Compliant - rule ConditionEvaluatesToConstant should raise issue here (to be consistent with the non-C#9 tests)\nx = m switch\n{\n    string s2 and null => s2, // Error [CS8510] The pattern is unreachable. It has already been handled by a previous arm of the switch expression or it is impossible to match.\n    _ => \"\"\n};\n\nx = m switch\n{\n    string or null => \"\", // Compliant\n    _ => \"\"\n};\n\nx = m switch\n{\n    null or string => \"\", // Compliant\n    not null or 5 => \"\", // Compliant\n};\n\nx = a switch\n{\n    null or not null => \"\" // Compliant\n};\n\nx = m switch\n{\n    null or 5 or 7 or 8 or Apple => \"\", // Compliant\n    string or 6 or 10 or null => \"\", // Compliant\n    _ => \"\"\n};\n\nswitch (n)\n{\n    case not null or \"sweet\": // Compliant\n        break;\n    case not null or not \"sweet\": // Compliant\n        break;\n    default:\n        break;\n}\n\nswitch (n)\n{\n    case not null or Apple: // Compliant\n        break;\n    default:\n        break;\n}\n\nswitch (n)\n{\n    case null or Apple: // Compliant\n        break;\n    default:\n        break;\n}\n\nstatic int GetTax(object id) => id switch\n{\n    1 => 0, // Fixed\n    not null and not 5 => 5, // Compliant\n    5 => 15,\n    _ => 10\n};\n\nsealed record Apple\n{\n    public string Taste;\n    public string Color;\n    public void Deconstruct(out string x, out string y) => (x, y) = (Taste, Color);\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantNullCheck.CSharp9.cs",
    "content": "﻿object a = \"\";\nobject b = \"\";\nobject n = 5;\nobject m = 5;\nApple apple = new();\n\n// AND\nif (n != null && n is nint) // Noncompliant\n{\n}\n\nif (n is not null && n is nint nintValue) // Noncompliant\n{\n}\n\nif (!(n is null) && n is Apple) // Noncompliant\n{\n}\n\nvar result = (n is string && n is not null); // Noncompliant {{Remove this unnecessary null check; 'is' returns false for nulls.}}\n//                           ^^^^^^^^^^^^^\nresult = (n is string && n is not null && m is not null); // Noncompliant\n//                       ^^^^^^^^^^^^^\n\n// parenthesized pattern\nresult = n is (\"a\" or \"b\" or \"c\") && n is not null; // Noncompliant\n//                                   ^^^^^^^^^^^^^\n\nif (n is null && apple != null && m is null && apple is (\"Sweet\", \"Red\")) { } // FN\nif (n is null && apple != null && apple is (\"Sweet\", \"Red\")) { } // FN\nif (apple != null && apple is (\"Sweet\", \"Red\")) { } // Noncompliant\nif (apple != null && apple is { Taste: \"Sweet\", Color: \"Red\" }) { } // Noncompliant\nif (!(apple is null) && apple is { Taste: \"Sweet\", Color: \"Red\" }) { } // Noncompliant\n//  ^^^^^^^^^^^^^^^^\nif (apple is not null && apple is (\"Sweet\", \"Red\")) { } // Noncompliant\n\nvar x = a switch\n{\n    Apple appleInside and not null => \"\", // Noncompliant {{Remove this unnecessary null check; it is already done by the pattern match.}}\n//                        ^^^^^^^^\n    _ => \"\"\n};\n\nx = a switch\n{\n    string s6 and (not null or \"a\") => s6, // FN\n    _ => \"\"\n};\n\nx = apple switch\n{\n    not null and (\"Sweet\", \"Red\") => \"\", // Noncompliant\n    _ => \"\"\n};\n\nx = apple switch\n{\n    { Taste: \"Sweet\", Color: \"Red\" } and not null => \"\", // Noncompliant\n    _ => \"\"\n};\n\nx = apple switch\n{\n    { Taste: \"Sweet\" } and not null and { Color: \"Red\" }  => \"\", // Noncompliant\n//                         ^^^^^^^^\n    _ => \"\"\n};\n\n// OR, inverted\nresult = n is null || !(n is Apple); // Noncompliant {{Remove this unnecessary null check; 'is' returns false for nulls.}}\nresult = !(n is Apple) || n is null; // Noncompliant\nresult = a is null || !(a is Apple aTyped1); // Noncompliant\nresult = !(a is Apple aTyped2) || a == null; // Noncompliant\nresult = ((!((a) is Apple))) || ((a) == (null)); // Noncompliant\n//                               ^^^^^^^^^^^^^\n\nif (apple == null || apple is not { Taste: \"Sweet\", Color: \"Red\" }) { } // Noncompliant\n//  ^^^^^^^^^^^^^\nif (apple is null || apple is not { Taste: \"Sweet\", Color: \"Red\" }) { } // Noncompliant\n//  ^^^^^^^^^^^^^\nif (apple == null || !(apple is { Taste: \"Sweet\", Color: \"Red\" })) { } // Noncompliant\nif (apple == null || apple is not (\"Sweet\", \"Red\")) { } // Noncompliant\nif (apple == null || !(apple is (\"Sweet\", \"Red\"))) { } // Noncompliant\nif (apple is null || !(apple is (\"Sweet\", \"Red\"))) { } // Noncompliant\n\nx = a switch\n{\n    null or not \"a\" => \"not a\", // Noncompliant {{Remove this unnecessary null check; it is already done by the pattern match.}}\n//  ^^^^\n    _ => \"default\"\n};\n\nx = a switch\n{\n    not Apple or null => \"\", // Noncompliant\n    _ => \"\"\n};\n\nx = apple switch\n{\n    null or not (\"Sweet\", \"Red\")  => \"\", // Noncompliant\n    _ => \"\"\n};\n\nx = apple switch\n{\n    null or not { Taste: \"Sweet\" } or not { Color: \"Red\" } => \"\", // Noncompliant\n    _ => \"\"\n};\n\nx = apple switch\n{\n    not { Taste: \"Sweet\" } or null or not { Color: \"Red\" } => \"\", // Noncompliant\n    _ => \"\"\n};\n\nswitch (n)\n{\n    case not null and \"sweet\": // Noncompliant\n        break;\n    case null or not \"sweet\": // Noncompliant\n        break;\n    default:\n        break;\n}\n\nswitch (n)\n{\n    case not null and Apple appleSwitch1: // Noncompliant\n        break;\n    case null or not (\"Sweet\", \"Red\"): // Noncompliant\n        break;\n    default:\n        break;\n}\n\nswitch (n)\n{\n    case null or not Apple: // Noncompliant\n        break;\n    default:\n        break;\n}\n\n// Compliant\nif (apple != null && apple is not { Taste: \"Sweet\", Color: \"Red\" }) { } // Compliant\nif (apple != null && apple is not (\"Sweet\", \"Red\")) { } // Compliant\nif (apple is not null || apple is (\"Sweet\", \"Red\")) { } // Compliant\nif (apple is not null || apple is { Taste: \"Sweet\", Color: \"Red\" }) { } // Compliant\nif (apple == null || apple is { Taste: \"Sweet\", Color: \"Red\" }) { } // Compliant\nif (apple is { Taste: \"Sweet\", Color: \"Red\" } || apple is null) { } // Compliant\n\nif (n is not null && n is not null) // Compliant (not related to this rule)\n{\n}\nif (n is not null && n != null) // Compliant (not related to this rule)\n{\n}\nresult = (n is not Apple && n != null); // Compliant\nresult = (a is null || a is not null); // Compliant - not related to this rule\nresult = (a is null || !(b is Apple)); // Compliant - a is not b\nresult = b is null || !(a is Apple); // Compliant - b is not a\nresult = (n is string s && s is not null); // Compliant, s can be null\nresult = (n is not Apple && n is not null); // Compliant\nresult = (a is null && a is string); // Compliant - rule ConditionEvaluatesToConstant should raise issue here (to be consistent with the non-C#9 tests)\nx = m switch\n{\n    string s2 and null => s2, // Error [CS8510] The pattern is unreachable. It has already been handled by a previous arm of the switch expression or it is impossible to match.\n    _ => \"\"\n};\n\nx = m switch\n{\n    string or null => \"\", // Compliant\n    _ => \"\"\n};\n\nx = m switch\n{\n    null or string => \"\", // Compliant\n    not null or 5 => \"\", // Compliant\n};\n\nx = a switch\n{\n    null or not null => \"\" // Compliant\n};\n\nx = m switch\n{\n    null or 5 or 7 or 8 or Apple => \"\", // Compliant\n    string or 6 or 10 or null => \"\", // Compliant\n    _ => \"\"\n};\n\nswitch (n)\n{\n    case not null or \"sweet\": // Compliant\n        break;\n    case not null or not \"sweet\": // Compliant\n        break;\n    default:\n        break;\n}\n\nswitch (n)\n{\n    case not null or Apple: // Compliant\n        break;\n    default:\n        break;\n}\n\nswitch (n)\n{\n    case null or Apple: // Compliant\n        break;\n    default:\n        break;\n}\n\nstatic int GetTax(object id) => id switch\n{\n    not null and 1 => 0, // Noncompliant\n    not null and not 5 => 5, // Compliant\n    5 => 15,\n    _ => 10\n};\n\nsealed record Apple\n{\n    public string Taste;\n    public string Color;\n    public void Deconstruct(out string x, out string y) => (x, y) = (Taste, Color);\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantNullCheck.Fixed.Batch.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class RedundantNullCheck\n    {\n        public void TestRedundantNullCheck(Object a, RedundantNullCheck b)\n        {\n\n            if (a is RedundantNullCheck) // Fixed\n            {\n\n            }\n\n            if (a is RedundantNullCheck) // Fixed\n            {\n\n            }\n\n            if (a is RedundantNullCheck) // Fixed\n            {\n\n            }\n\n            if (a is RedundantNullCheck && b != null) // Fixed\n            {\n\n            }\n\n            if (a is RedundantNullCheck aTyped0) // Fixed\n            {\n\n            }\n\n            if (a is RedundantNullCheck aTyped1 && aTyped1 != null)\n            {\n\n            }\n\n            if (a is RedundantNullCheck aTyped2) // Fixed\n            {\n\n            }\n\n            if (((a) is RedundantNullCheck aTyped3)) // Fixed\n            {\n\n            }\n\n            if (a != null && b != null && b is RedundantNullCheck) // FN\n            {\n\n            }\n\n            if (a != null || a is RedundantNullCheck) // Compliant - not AND operator\n            {\n\n            }\n\n            if (a != null && !(a is RedundantNullCheck)) // Compliant\n            {\n\n            }\n\n            if (a == null && a is RedundantNullCheck) // Compliant - rule ConditionEvaluatesToConstant will raise issue here\n            {\n\n            }\n\n            if (a != null && b is RedundantNullCheck) // Compliant\n            {\n\n            }\n\n            if (b != null && a is RedundantNullCheck) // Compliant\n            {\n\n            }\n\n            if (a != null && a != null) // Compliant - not related to this rule\n            {\n\n            }\n        }\n\n        public void TestRedundantInvertedNullCheck(Object a, RedundantNullCheck b)\n        {\n\n            if (!(a is RedundantNullCheck)) // Fixed\n            {\n\n            }\n\n            if (!(a is RedundantNullCheck)) // Fixed\n            {\n\n            }\n\n            if (!(a is RedundantNullCheck aTyped1)) // Fixed\n            {\n\n            }\n\n            if (!(a is RedundantNullCheck aTyped2)) // Fixed\n            {\n\n            }\n\n            if (((!((a) is RedundantNullCheck)))) // Fixed\n            {\n\n            }\n\n            if (a == null || !(b is RedundantNullCheck)) // Compliant\n            {\n\n            }\n\n            if (b == null || !(a is RedundantNullCheck)) // Compliant\n            {\n\n            }\n\n            if (a == null || a != null) // Compliant - not related to this rule\n            {\n\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantNullCheck.Fixed.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class RedundantNullCheck\n    {\n        public void TestRedundantNullCheck(Object a, RedundantNullCheck b)\n        {\n\n            if (a is RedundantNullCheck) // Fixed\n            {\n\n            }\n\n            if (a is RedundantNullCheck) // Fixed\n            {\n\n            }\n\n            if (a is RedundantNullCheck) // Fixed\n            {\n\n            }\n\n            if (a is RedundantNullCheck && b != null) // Fixed\n            {\n\n            }\n\n            if (a is RedundantNullCheck aTyped0) // Fixed\n            {\n\n            }\n\n            if (a is RedundantNullCheck aTyped1 && aTyped1 != null)\n            {\n\n            }\n\n            if (a is RedundantNullCheck aTyped2) // Fixed\n            {\n\n            }\n\n            if (((a) is RedundantNullCheck aTyped3)) // Fixed\n            {\n\n            }\n\n            if (a != null && b != null && b is RedundantNullCheck) // FN\n            {\n\n            }\n\n            if (a != null || a is RedundantNullCheck) // Compliant - not AND operator\n            {\n\n            }\n\n            if (a != null && !(a is RedundantNullCheck)) // Compliant\n            {\n\n            }\n\n            if (a == null && a is RedundantNullCheck) // Compliant - rule ConditionEvaluatesToConstant will raise issue here\n            {\n\n            }\n\n            if (a != null && b is RedundantNullCheck) // Compliant\n            {\n\n            }\n\n            if (b != null && a is RedundantNullCheck) // Compliant\n            {\n\n            }\n\n            if (a != null && a != null) // Compliant - not related to this rule\n            {\n\n            }\n        }\n\n        public void TestRedundantInvertedNullCheck(Object a, RedundantNullCheck b)\n        {\n\n            if (!(a is RedundantNullCheck)) // Fixed\n            {\n\n            }\n\n            if (!(a is RedundantNullCheck)) // Fixed\n            {\n\n            }\n\n            if (!(a is RedundantNullCheck aTyped1)) // Fixed\n            {\n\n            }\n\n            if (!(a is RedundantNullCheck aTyped2)) // Fixed\n            {\n\n            }\n\n            if (((!((a) is RedundantNullCheck)))) // Fixed\n            {\n\n            }\n\n            if (a == null || !(b is RedundantNullCheck)) // Compliant\n            {\n\n            }\n\n            if (b == null || !(a is RedundantNullCheck)) // Compliant\n            {\n\n            }\n\n            if (a == null || a != null) // Compliant - not related to this rule\n            {\n\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantNullCheck.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class RedundantNullCheck\n    {\n        public void TestRedundantNullCheck(Object a, RedundantNullCheck b)\n        {\n\n            if (a != null && a is RedundantNullCheck) // Noncompliant {{Remove this unnecessary null check; 'is' returns false for nulls.}}\n//              ^^^^^^^^^\n            {\n\n            }\n\n            if (null != a && a is RedundantNullCheck) // Noncompliant\n//              ^^^^^^^^^\n            {\n\n            }\n\n            if (a is RedundantNullCheck && a != null) // Noncompliant\n//                                         ^^^^^^^^^\n            {\n\n            }\n\n            if (a is RedundantNullCheck && a != null && b != null) // Noncompliant\n//                                         ^^^^^^^^^\n            {\n\n            }\n\n            if (a != null && a is RedundantNullCheck aTyped0) // Noncompliant\n            {\n\n            }\n\n            if (a is RedundantNullCheck aTyped1 && aTyped1 != null)\n            {\n\n            }\n\n            if (a is RedundantNullCheck aTyped2 && a != null) // Noncompliant\n            {\n\n            }\n\n            if (((a) != ((null))) && ((a) is RedundantNullCheck aTyped3)) // Noncompliant\n            {\n\n            }\n\n            if (a != null && b != null && b is RedundantNullCheck) // FN\n            {\n\n            }\n\n            if (a != null || a is RedundantNullCheck) // Compliant - not AND operator\n            {\n\n            }\n\n            if (a != null && !(a is RedundantNullCheck)) // Compliant\n            {\n\n            }\n\n            if (a == null && a is RedundantNullCheck) // Compliant - rule ConditionEvaluatesToConstant will raise issue here\n            {\n\n            }\n\n            if (a != null && b is RedundantNullCheck) // Compliant\n            {\n\n            }\n\n            if (b != null && a is RedundantNullCheck) // Compliant\n            {\n\n            }\n\n            if (a != null && a != null) // Compliant - not related to this rule\n            {\n\n            }\n        }\n\n        public void TestRedundantInvertedNullCheck(Object a, RedundantNullCheck b)\n        {\n\n            if (a == null || !(a is RedundantNullCheck)) // Noncompliant {{Remove this unnecessary null check; 'is' returns false for nulls.}}\n//              ^^^^^^^^^\n            {\n\n            }\n\n            if (!(a is RedundantNullCheck) || a == null) // Noncompliant\n            {\n\n            }\n\n            if (a == null || !(a is RedundantNullCheck aTyped1)) // Noncompliant\n            {\n\n            }\n\n            if (!(a is RedundantNullCheck aTyped2) || a == null) // Noncompliant\n//                                                    ^^^^^^^^^\n            {\n\n            }\n\n            if (((!((a) is RedundantNullCheck))) || ((a) == (null))) // Noncompliant\n            {\n\n            }\n\n            if (a == null || !(b is RedundantNullCheck)) // Compliant\n            {\n\n            }\n\n            if (b == null || !(a is RedundantNullCheck)) // Compliant\n            {\n\n            }\n\n            if (a == null || a != null) // Compliant - not related to this rule\n            {\n\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantNullCheck.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.Linq\nImports System.Text\n\nNamespace Tests.TestCases\n    Class RedundantNullCheck\n        Private a As Object\n        Private b As Object\n\n        Public Function TestRedundantNullCheck() As Object\n            If (a IsNot Nothing And TypeOf a Is RedundantNullCheck) Then ' Noncompliant {{Remove this unnecessary null check; 'TypeOf ... Is' returns false for nulls.}}\n'               ^^^^^^^^^^^^^^^\n            End If\n\n            If (Not a Is Nothing And TypeOf a Is RedundantNullCheck) Then ' Noncompliant\n            End If\n\n            If (a IsNot Nothing AndAlso TypeOf a Is RedundantNullCheck) Then ' Noncompliant\n            End If\n\n            If (TypeOf a Is RedundantNullCheck And a IsNot Nothing) Then ' Noncompliant\n'                                                  ^^^^^^^^^^^^^^^\n            End If\n\n            If (TypeOf a Is RedundantNullCheck And a IsNot Nothing And b IsNot Nothing) Then ' Noncompliant\n'                                                  ^^^^^^^^^^^^^^^\n            End If\n\n            If (((a) IsNot Nothing) And ((TypeOf (a) Is RedundantNullCheck))) Then ' Noncompliant\n            End If\n\n            If (a IsNot Nothing Or TypeOf a Is RedundantNullCheck) Then ' Compliant - not AND operator\n            End If\n\n            If (a IsNot Nothing And TypeOf a IsNot RedundantNullCheck) Then ' Compliant\n            End If\n\n            If (a IsNot Nothing And Not TypeOf a Is RedundantNullCheck) Then ' Compliant\n            End If\n\n            If (a IsNot Nothing And TypeOf b Is RedundantNullCheck) Then ' Compliant\n            End If\n\n            If (b IsNot Nothing And TypeOf a Is RedundantNullCheck) Then ' Compliant\n            End If\n\n            If (a IsNot Nothing And a IsNot Nothing) Then ' Compliant - not related to this rule\n            End If\n        End Function\n\n        Public Function TestRedundantInvertedNullCheck() As Object\n            If (a Is Nothing Or Not TypeOf a Is RedundantNullCheck) Then ' Noncompliant {{Remove this unnecessary null check; 'TypeOf ... Is' returns false for nulls.}}\n'               ^^^^^^^^^^^^\n            End If\n\n            If (a Is Nothing OrElse Not TypeOf a Is RedundantNullCheck) Then ' Noncompliant\n            End If\n\n            If (a Is Nothing Or TypeOf a IsNot RedundantNullCheck) Then ' Noncompliant\n            End If\n\n            If (TypeOf a IsNot RedundantNullCheck Or a Is Nothing) Then ' Noncompliant\n'                                                    ^^^^^^^^^^^^\n\n            End If\n\n            If ((TypeOf (a) IsNot RedundantNullCheck) Or ((a) Is Nothing)) Then ' Noncompliant\n\n            End If\n\n            If (a Is Nothing Or Not TypeOf b Is RedundantNullCheck) Then ' Compliant\n            End If\n\n            If (b Is Nothing Or Not TypeOf a Is RedundantNullCheck) Then ' Compliant\n            End If\n\n            If (a Is Nothing Or a Is Nothing) Then ' Compliant - not related to this rule \n            End If\n        End Function\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantNullableTypeComparison.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public class MyClass\n    {\n        public Type GetType()\n        {\n            // some other implementation\n            return null;\n        }\n    }\n\n    public class RedundantNullableTypeComparison\n    {\n        public RedundantNullableTypeComparison()\n        {\n            int? nullable = 42;\n            bool comparison = nullable.GetType() == typeof(Nullable<int>); // Noncompliant, always false\n//                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            comparison = nullable.GetType() != typeof(Nullable<int>); // Noncompliant {{Remove this redundant type comparison.}}\n\n            comparison = new MyClass().GetType() != typeof(Nullable<int>);\n            comparison = 42.GetType() != typeof(int);\n            comparison = 42.ToString().GetType() != typeof(int);\n            comparison = new object() != typeof(Nullable<int>);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantParentheses.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.Linq\nImports System.Text\n\nNamespace Tests.TestCases\n    Class Foo\n        Private Dim a As Object\n\n        Public Function Test() As Object\n            Return (1)\n            Return (a)\n            Return False\n\n            Return (((a)))\n'                  ^^ Noncompliant [0] {{Remove these redundant parentheses.}}\n'                       ^^ Secondary@-1 [0] {{Remove the redundant closing parentheses.}}\n\n            If (a IsNot Nothing) Then\n            End If\n\n             If ((a IsNot Nothing)) Then\n'               ^ Noncompliant [1]\n'                                 ^ Secondary@-1 [1]\n            End If\n\n            Dim x = 1\n            Dim y = 12\n            Dim foo = ((x + 2) / (((y))))\n'                                ^^ Noncompliant [2]\n'                                     ^^ Secondary@-1 [2]\n\t\tEnd Function\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantParenthesesExpression.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Globalization;\n\nnamespace Tests.Diagnostics\n{\n    class Bar\n    {\n        public Bar(object param) { }\n    }\n\n    class Foo\n    {\n        private object a;\n\n        void Invoke(object param) { }\n\n        object Del()\n        {\n            return (3);\n            return (a);\n            return (false);\n            return (((1)+(1))-(2));\n            return (((a)));\n//                 ^^ Noncompliant [0] {{Remove these redundant parentheses.}}\n//                      ^^ Secondary@-1 [0] {{Remove the redundant closing parentheses.}}\n            var x = 1;\n            return (x + 1);\n            return (string.Empty);\n            return (\"\".ToString());\n            return (\"\".ToString((CultureInfo.InvariantCulture)));\n            return (string.Compare(\"a\", \"b\"));\n\n            var y = 12;\n            return ((((x & 0x0000FFFF))) | y);\n//                  ^^ Noncompliant [1]\n//                                    ^^ Secondary@-1 [1]\n\n            int x2 = (y / 2 + 1);\n            int y2 = (4 + x2) * y2;\n            int z = ((4 + x2) * y2);\n            int u = ((4 + x2) * (y2));\n            int u2 = ((4 + x2) * ((y2)));\n//                               ^ Noncompliant [2]\n//                                    ^ Secondary@-1 [2]\n            if ((0)) { } // Error [CS0029] - cannot convert\n            while ((true)) { }\n            do { } while ((true));\n\n            Console.Write((x));\n            Console.Write((x + y));\n            Console.Write(\"\", (x), y);\n            Console.Write(\"\", (x + y), y);\n            Console.Write(false ? (true ? 1 : 2) : 2);\n            Console.Write(false ? 0 : (true ? 1 : 2));\n            Console.Write(false ? 0 : (1 + 1));\n            Console.Write(false ? 0 : (1));\n            Console.Write((false) ? 0 : 1);\n            Console.Write((x > y) ? 0 : 1);\n            Console.Write((false ? false : true) ? 0 : 1);\n            Console.Write((foo()) ? 0 : 1); // Error [CS0841] - undeclared var\n            Console.Write((foo) ? 0 : 1); // Error [CS0841] - undeclared var\n            Invoke(((int)plop)); // Error [CS0103] - undeclared var\n\n            int[] tab;\n            tab[(1 + 2)]; // Error [CS0201] - not a statement\n            tab[(1 + 2) / 2]; // Error [CS0201] - not a statement\n\n            int p = ((int[])tab)[0];\n            var n = new Bar((1 / 3));\n\n            this.a = (b); // Error [CS0103] - unknown b\n            this.a = (true ? 1 : 2);\n            this.a = false ? (true ? 1 : 2) : 2;\n            this.a = (1 + 2) / 2;\n            this.a = ((int[])contentSpec.value)[0]; // Error [CS0103] - unknown contentSpec\n\n            object[] foo = new[] { (true ? 1 : 2) }; // Error [CS0029] - cannot convert\n        }\n\n        public static short value1 = (((short)(0)));\n//                                   ^ Noncompliant [3]\n//                                                ^ Secondary@-1 [3]\n        public static short value2 = (short)(0);\n        public static short value3 = ((short)0);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantParenthesesObjectCreation.CSharp10.cs",
    "content": "﻿using System;\n\nnamespace Net6Poc.TestCases\n{\n    internal class TestCases\n    {\n        [NonGeneric()] int A() => 1; // Noncompliant\n        public void M()\n        {\n            [NonGeneric()] int A() => 1; // Noncompliant\n            [NonGeneric] int B() => 1;\n\n            [NonGeneric()] int C() => 1; // Noncompliant\n            [NonGeneric(), Obsolete] int D() => 1; // Noncompliant\n\n            Action a = [NonGeneric()] async () => { }; // Noncompliant\n            Action b = [NonGeneric] async () => { };\n        }\n    }\n\n    public class NonGenericAttribute : Attribute { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantParenthesesObjectCreation.CSharp11.cs",
    "content": "﻿using System;\n\nnamespace Net6Poc.TestCases\n{\n    internal class TestCases\n    {\n        [Generic<int>()] // Noncompliant\n        public void M()\n        {\n            [Generic<int>()] int A() => 1; // Noncompliant\n            [Generic<int>] int B() => 1;\n\n            [Generic<int>(), Obsolete()] int C() => 1; // Noncompliant\n                                                       // Noncompliant@-1\n            [GenericAttribute<int>] int D() => 1;\n\n            Action a = [Generic<int>] async () => { };\n            Action b = [Generic<int>()] async () => { }; // Noncompliant\n        }\n    }\n\n    public class GenericAttribute<T> : Attribute { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantParenthesesObjectCreation.CSharp9.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nList<nuint> l = new() { 1, 2 }; // Compliant - FN\nList<nint> Get() => new() { 1, 2 };  // Compliant - FN\nList<nint> GetEmpty() => new();  // Compliant\n\n[MyAttribute] // Compliant\nrecord Record\n{\n}\n\n[MyAttribute()] // Noncompliant {{Remove these redundant parentheses.}}\nrecord RecordNoncompliant\n{\n}\n\npublic class MyAttribute : Attribute\n{\n    public int MyProperty { get; set; }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantParenthesesObjectCreation.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public class MyAttribute : Attribute {\n        public int MyProperty { get; set; }\n    }\n\n    [MyAttribute] // Fixed\n    [MyAttribute] // Compliant // Error [CS0579] - duplicate attribute\n    [MyAttribute(MyProperty =5)] // Compliant // Error [CS0579] - duplicate attribute\n    class MyClass\n    {\n        public MyClass()\n        {\n\n        }\n        public MyClass(int i)\n        {\n\n        }\n        public int MyProperty { get; set; }\n        public static MyClass CreateNew(int propertyValue)\n        {\n            return new MyClass //Fixed\n            {\n                MyProperty = propertyValue\n            };\n        }\n\n        public static MyClass CreateNew2(int propertyValue)\n        {\n            return new MyClass\n            {\n                MyProperty = propertyValue\n            };\n        }\n\n        public static MyClass CreateNew3(int propertyValue)\n        {\n            return new MyClass(5)\n            {\n                MyProperty = propertyValue\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantParenthesesObjectCreation.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public class MyAttribute : Attribute {\n        public int MyProperty { get; set; }\n    }\n\n    [MyAttribute()] // Noncompliant {{Remove these redundant parentheses.}}\n//              ^^\n    [MyAttribute] // Compliant // Error [CS0579] - duplicate attribute\n    [MyAttribute(MyProperty =5)] // Compliant // Error [CS0579] - duplicate attribute\n    class MyClass\n    {\n        public MyClass()\n        {\n\n        }\n        public MyClass(int i)\n        {\n\n        }\n        public int MyProperty { get; set; }\n        public static MyClass CreateNew(int propertyValue)\n        {\n            return new MyClass() //Noncompliant\n//                            ^^\n            {\n                MyProperty = propertyValue\n            };\n        }\n\n        public static MyClass CreateNew2(int propertyValue)\n        {\n            return new MyClass\n            {\n                MyProperty = propertyValue\n            };\n        }\n\n        public static MyClass CreateNew3(int propertyValue)\n        {\n            return new MyClass(5)\n            {\n                MyProperty = propertyValue\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantPropertyNamesInAnonymousClass.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    class RedundantPropertyNamesInAnonymousClass\n    {\n        public int X { get; set; }\n\n        public void M()\n        {\n            var Y = \"my string\";\n\n            var anon = new\n            {\n                X, //Fixed\n                Y  //Fixed\n            };\n\n            var anon2 = new\n            {\n                X, //Fixed\n                Y = \"some string\"\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantPropertyNamesInAnonymousClass.Latest.Partial.cs",
    "content": "﻿\nnamespace CSharp13\n{\n    public partial class PartialPropertyClass\n    {\n        public partial int PartialProperty  \n        {\n            get;\n            set;\n        }\n        public partial int OtherPartialProperty\n        {\n            get => 42;\n            set { }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantPropertyNamesInAnonymousClass.Latest.cs",
    "content": "﻿namespace CSharp13\n{\n    public partial class PartialPropertyClass\n    {\n        public partial int PartialProperty\n        {\n            get => 42;\n            set { }\n        }\n\n        public partial int OtherPartialProperty\n        {\n            get;\n            set;\n        }\n\n        public void M()\n        {\n            var anon = new\n            {\n                PartialProperty = PartialProperty, //Noncompliant\n//              ^^^^^^^^^^^^^^^^^\n            };\n\n            var anon2 = new\n            {\n                OtherPartialProperty = OtherPartialProperty, //Noncompliant\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantPropertyNamesInAnonymousClass.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    class RedundantPropertyNamesInAnonymousClass\n    {\n        public int X { get; set; }\n\n        public void M()\n        {\n            var Y = \"my string\";\n\n            var anon = new\n            {\n                X = X, //Noncompliant\n//              ^^^\n                Y = Y  //Noncompliant {{Remove the redundant 'Y ='.}}\n            };\n\n            var anon2 = new\n            {\n                X = X, //Noncompliant\n                Y = \"some string\"\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantToArrayCall.CSharp11.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Tests.Diagnostics\n{\n    public class RedundantToArrayCall\n    {\n        public void Utf8StringLiterals()\n        {\n            var c = \"some string\"u8[10];        // Fixed\n            c = \"some string\"u8.Slice(5, 4)[1];           // Compliant\n            foreach (var v in \"some string\"u8)  // Fixed\n            {\n                // ...\n            }\n\n            var arr = \"some string\"u8.ToArray(); // Compliant\n        }\n\n        public void ReadOnlySpans(ReadOnlySpan<byte> span)\n        {\n                var elementAccess = span[10];        // Fixed\n                var sliced = span.Slice(5, 4)[1];           // Compliant\n\n                foreach (var v in span)  // Fixed\n                {\n                    // ...\n                }\n\n                var arr = span.ToArray(); // Compliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantToArrayCall.CSharp11.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Tests.Diagnostics\n{\n    public class RedundantToArrayCall\n    {\n        public void Utf8StringLiterals()\n        {\n            var c = \"some string\"u8.ToArray()[10];        // Noncompliant\n            c = \"some string\"u8.Slice(5, 4)[1];           // Compliant\n            foreach (var v in \"some string\"u8.ToArray())  // Noncompliant {{Remove this redundant 'ToArray' call.}}\n            {\n                // ...\n            }\n\n            var arr = \"some string\"u8.ToArray(); // Compliant\n        }\n\n        public void ReadOnlySpans(ReadOnlySpan<byte> span)\n        {\n                var elementAccess = span.ToArray()[10];        // Noncompliant\n                var sliced = span.Slice(5, 4)[1];           // Compliant\n\n                foreach (var v in span.ToArray())  // Noncompliant {{Remove this redundant 'ToArray' call.}}\n                {\n                    // ...\n                }\n\n                var arr = span.ToArray(); // Compliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantToArrayCall.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public class RedundantToArrayCall\n    {\n        public char[] ToCharArray()\n        {\n            return null;\n        }\n\n        public void Literals()\n        {\n            var c = \"some string\"[10]; // Fixed\n            c = \"some string\".ToCharArray(5, 4)[1];\n            foreach (var v in \"some string\") // Fixed\n            {\n                // ...\n            }\n\n            var x = \"some string\".ToCharArray();\n\n            c = this.ToCharArray()[10];\n        }\n\n        public void Coverage()\n        {\n            \"x\".ToString();\n            this.Foo();\n            foreach (var v in Foo()) { }\n            Foo();\n            var x = \"x\".ToCharArray(1, 2)[0]; // Compliant, it does a substring\n        }\n\n        public IEnumerable<string> Foo() => null;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantToArrayCall.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public class RedundantToArrayCall\n    {\n        public char[] ToCharArray()\n        {\n            return null;\n        }\n\n        public void Literals()\n        {\n            var c = \"some string\".ToCharArray()[10]; // Noncompliant, the indexer already returns a char\n//                                ^^^^^^^^^^^\n            c = \"some string\".ToCharArray(5, 4)[1];\n            foreach (var v in \"some string\".ToCharArray()) // Noncompliant {{Remove this redundant 'ToCharArray' call.}}\n            {\n                // ...\n            }\n\n            var x = \"some string\".ToCharArray();\n\n            c = this.ToCharArray()[10];\n        }\n\n        public void Coverage()\n        {\n            \"x\".ToString();\n            this.Foo();\n            foreach (var v in Foo()) { }\n            Foo();\n            var x = \"x\".ToCharArray(1, 2)[0]; // Compliant, it does a substring\n        }\n\n        public IEnumerable<string> Foo() => null;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantToStringCall.CSharp10.cs",
    "content": "﻿record Record\n{\n    public void Method()\n    {\n        const string Part1 = \"Part1\";\n        const string Part2 = \"Part2\";\n        const string MergedString = $\"{Part1} and {Part2}\";\n        var a = \"fee fie foe \" + MergedString.ToString(); // Noncompliant {{There's no need to call 'ToString()' on a string.}}\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantToStringCall.CSharp11.cs",
    "content": "﻿class Foo\n{\n    public void Method()\n    {\n        string rawStringLiteral = \"\"\"Hello\"\"\";\n        string magic = \"Abracadabra\";\n\n        string interpolationWithNewLine = $\"And for my next trick I'll do some {\n            magic.ToString() // Noncompliant {{There's no need to call 'ToString()' on a string.}}\n            }\";\n\n        var s = rawStringLiteral.ToString(); // Noncompliant {{There's no need to call 'ToString()' on a string.}}\n        s = interpolationWithNewLine.ToString(); // Noncompliant {{There's no need to call 'ToString()' on a string.}}\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantToStringCall.CSharp9.cs",
    "content": "﻿record Record\n{\n    public void Method()\n    {\n        var s = \"foo\";\n        var a = \"fee fie foe \" + s.ToString(); // Noncompliant {{There's no need to call 'ToString()' on a string.}}\n        var b = \"test\" + this.ToString(); // Noncompliant\n        var c = \"\" + 1.ToString(); // Compliant, value type\n\n        nint n = -5;\n        var d = \"\" + n.ToString(); // Compliant, value type\n\n        nuint nu = 5;\n        var e = \"\" + nu.ToString(); // Compliant, value type\n\n        PrintMembers(new());\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantToStringCall.Fixed.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class MyClass\n    {\n        public static MyClass operator +(MyClass c, string s)\n        {\n            return null;\n        }\n    }\n    public class MyBase { }\n\n    public class RedundantToStringCall : MyBase\n    {\n        public RedundantToStringCall()\n        {\n            var calledOnStringLiteral = \"IAmAStringLiteral\"; // Fixed\n            var s = \"foo\";\n            var t = \"fee fie foe \" + s;  // Fixed\n            t = \"fee fie foe \" + s.ToString(System.Globalization.CultureInfo.InvariantCulture);\n            var u = \"\" + 1.ToString(); // Compliant, value type\n            u = new object() + \"\"; // Fixed\n            u = new object() // Fixed\n                + new object().ToString(); // Fixed\n\n            u += new object(); // Fixed\n            u = 1.ToString() + 2;\n\n            var x = 1 + 3;\n\n            var v = string.Format(\"{0}\",\n                new object()); //Fixed\n\n            v = string.Format(\"{0}\",\n                1.ToString()); // Compliant, value type\n\n            u = 1.ToString();\n\n            var m = new MyClass();\n            s = m.ToString() + \"\";\n\n            s = base.ToString() + \"\";\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/3665\n    public class Repro_3665\n    {\n        public void Repro(Uri a, Uri b, Uri c, Uri d)\n        {\n            var two = a + b.ToString();  // First occurance is False Positive, second is True Positive\n\n            var four = a + b.ToString() + c + d;   // Fixed\n            // Fixed\n            // Fixed\n            // Fixed\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantToStringCall.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class MyClass\n    {\n        public static MyClass operator +(MyClass c, string s)\n        {\n            return null;\n        }\n    }\n    public class MyBase { }\n\n    public class RedundantToStringCall : MyBase\n    {\n        public RedundantToStringCall()\n        {\n            var calledOnStringLiteral = \"IAmAStringLiteral\".ToString(); // Noncompliant\n            var s = \"foo\";\n            var t = \"fee fie foe \" + s.ToString();  // Noncompliant {{There's no need to call 'ToString()' on a string.}}\n//                                    ^^^^^^^^^^^\n            t = \"fee fie foe \" + s.ToString(System.Globalization.CultureInfo.InvariantCulture);\n            var u = \"\" + 1.ToString(); // Compliant, value type\n            u = new object().ToString() + \"\"; // Noncompliant\n            u = new object().ToString() // Noncompliant\n                + new object().ToString(); // Noncompliant, note: this is why we don't have a global fix\n\n            u += new object().ToString(); // Noncompliant {{There's no need to call 'ToString()', the compiler will do it for you.}}\n            u = 1.ToString() + 2;\n\n            var x = 1 + 3;\n\n            var v = string.Format(\"{0}\",\n                new object().ToString()); //Noncompliant\n\n            v = string.Format(\"{0}\",\n                1.ToString()); // Compliant, value type\n\n            u = 1.ToString();\n\n            var m = new MyClass();\n            s = m.ToString() + \"\";\n\n            s = base.ToString() + \"\";\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/3665\n    public class Repro_3665\n    {\n        public void Repro(Uri a, Uri b, Uri c, Uri d)\n        {\n            var two = a.ToString() + b.ToString();  // First occurance is False Positive, second is True Positive\n//                     ^^^^^^^^^^^\n//                                    ^^^^^^^^^^^@-1\n\n            var four = a.ToString() + b.ToString() + c.ToString() + d.ToString();   // Noncompliant, a.ToString() is a False Positive\n            // Noncompliant@-1 // b is TP\n            // Noncompliant@-2 // c is TP\n            // Noncompliant@-3 // d is TP\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ReferenceEqualityCheckWhenEqualsExists.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading;\n\n// Faking DependencyObject and CollectionViewSource\nnamespace System.Windows\n{\n    public class DependencyObject\n    {\n        public sealed override bool Equals(object obj)\n        {\n            return base.Equals(obj);\n        }\n    }\n}\n\nnamespace System.Windows.Data\n{\n    public class CollectionViewSource : DependencyObject\n    {\n    }\n}\n\nnamespace Tests.Diagnostics\n{\n    interface IMyInterface { }\n    interface IMyInterfaceWithoutImplementations { }\n\n    class Base\n    {\n        public override bool Equals(object obj)\n        {\n            return new Base() == obj; // Compliant, we are inside the Equals.\n        }\n    }\n\n    class MyClass : Base, IMyInterface\n    {\n\n    }\n\n    internal class MyClass2 : IMyInterface\n    {\n        public static bool operator ==(MyClass2 a, MyClass2 b)\n        {\n            return false;\n        }\n        public static bool operator !=(MyClass2 a, MyClass2 b)\n        {\n            return false;\n        }\n    }\n\n    class ReferenceEqualityCheckWhenEqualsExists\n    {\n        static void Main(IMyInterface x, IMyInterface y)\n        {\n            var b = x == y; // Noncompliant {{Consider using 'Equals' if value comparison was intended.}}\n//                    ^^\n            b = x != y; // Noncompliant\n            b = x != null;\n            b = x == new object();\n            b = new Base() == new object();\n            b = new MyClass() == new object();\n            b = new MyClass2() == new object(); // Error [CS0253] - compiler warning \"Possible unintended reference comparison; to get a value comparison, cast the right hand side to type 'MyClass2'\"\n            b = new object() == new object();\n\n            // The following is compliant\n            // mscorlib defines Type.operator==, but System.Runtime doesn't, and System.Type defines Equals,\n            // which performs reference equals.\n            // We can't test it here though, because in the test we have the mscorlib's Type\n            b = typeof(object) == typeof(object);\n\n            var dependencyObject = new System.Windows.Data.CollectionViewSource();\n            b = dependencyObject == dependencyObject;\n\n            b = x == null; // Compliant\n            b = y == (object)null; // Compliant\n        }\n\n        private static T1 CompareExchange<T1>(ref T1 reference, T1 expectedValue, T1 newValue) where T1 : class\n        {\n            var r = CompareExchange(ref reference, newValue, expectedValue) == expectedValue;\n            return r ? newValue : null;\n        }\n\n        private static T2 CompareExchange2<T2>(ref T2 reference, T2 expectedValue, T2 newValue) where T2 : Base\n        {\n            var r = CompareExchange2(ref reference, newValue, expectedValue) == expectedValue; // Noncompliant\n            return r ? newValue : null;\n        }\n    }\n}\nnamespace MissingGeneric\n{\n    interface IWithGeneric\n    {\n        void Something<T>();\n    }\n\n    class UsingInterfaces\n    {\n        public void Compare(IWithGeneric a, IWithGeneric b)\n        {\n            if (a == b) { }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ReferenceEqualityCheckWhenEqualsExists2.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading;\n\nnamespace AppendedNamespaceForConcurrencyTestTests.Tests.Diagnostics\n{\n    interface IMyInterface { }\n    interface IMyInterfaceWithoutImplementations { }\n\n    class Base\n    {\n        public override bool Equals(object obj)\n        {\n            return new Base() == obj; // Compliant, we are inside the Equals.\n        }\n    }\n\n    class MyClass : Base, IMyInterface\n    {\n\n    }\n\n    internal class MyClass2 : IMyInterface\n    {\n        public static bool operator ==(MyClass2 a, MyClass2 b)\n        {\n            return false;\n        }\n        public static bool operator !=(MyClass2 a, MyClass2 b)\n        {\n            return false;\n        }\n    }\n\n    class ReferenceEqualityCheckWhenEqualsExists\n    {\n        static void Main(IMyInterface x, IMyInterface y)\n        {\n            var b = x == y; // Noncompliant {{Consider using 'Equals' if value comparison was intended.}}\n//                    ^^\n            b = x != y; // Noncompliant\n            b = x != null;\n            b = x == new object();\n            b = new Base() == new object();\n            b = new MyClass() == new object();\n            b = new MyClass2() == new object(); // Error [CS0253] - compiler warning \"Possible unintended reference comparison; to get a value comparison, cast the right hand side to type 'MyClass2'\"\n            b = new object() == new object();\n\n            // The following is compliant\n            // mscorlib defines Type.operator==, but System.Runtime doesn't, and System.Type defines Equals,\n            // which performs reference equals.\n            // We can't test it here though, because in the test we have the mscorlib's Type\n            b = typeof(object) == typeof(object);\n\n            var dependencyObject = new System.Windows.Data.CollectionViewSource();\n            b = dependencyObject == dependencyObject;\n\n            b = x == null; // Compliant\n            b = y == (object)null; // Compliant\n        }\n\n        private static T1 CompareExchange<T1>(ref T1 reference, T1 expectedValue, T1 newValue) where T1 : class\n        {\n            var r = CompareExchange(ref reference, newValue, expectedValue) == expectedValue;\n            return r ? newValue : null;\n        }\n\n        private static T2 CompareExchange2<T2>(ref T2 reference, T2 expectedValue, T2 newValue) where T2 : Base\n        {\n            var r = CompareExchange2(ref reference, newValue, expectedValue) == expectedValue; // Noncompliant\n            return r ? newValue : null;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ReferenceEqualsOnValueType.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public class ReferenceEqualsOnValueType\n    {\n        public ReferenceEqualsOnValueType()\n        {\n            var b = object.ReferenceEquals(1, 2); //Noncompliant\n//                  ^^^^^^^^^^^^^^^^^^^^^^\n            b = ReferenceEquals(1, 2); //Noncompliant\n            ReferenceEqualsOnValueType.ReferenceEquals(1, new object()); //Noncompliant {{Use a different kind of comparison for these value types.}}\n            ReferenceEquals(new object(), new object());\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RegularExpressions/RegexMustHaveValidSyntax.Latest.cs",
    "content": "﻿using System;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Text.RegularExpressions;\n\nclass Compliant\n{\n    private const string ValidPattern = \"[A]\";\n\n    void ImplicitObject()\n    {\n        Regex defaultOrder = new(\"valid pattern\");    // Compliant\n    }\n\n    void Interpolated(string subPattern)\n    {\n        var regex = new Regex($\"{ValidPattern}\");     // Compliant\n        var combined = new Regex($\"[AB{subPattern}\"); // Compliant\n    }\n\n    void RawString()\n    {\n        var raw = new Regex(\"\"\"\n            [A\n            B]\n            \"\"\"); // Compliant\n    }\n\n    void DiagnosticStringSyntaxAttribute()\n    {\n        MyMethod(\"[0-9]+\"); // Compliant\n\n        void MyMethod([StringSyntax(StringSyntaxAttribute.Regex)] string regex) { }\n    }\n\n    void NewEnumerateSplitsMethod(ReadOnlySpan<char> input, RegexOptions options)\n    {\n        foreach (Range r in Regex.EnumerateSplits(input, \"[0-9]+\")) { }                                   // Compliant\n        foreach (Range r in Regex.EnumerateSplits(input, \"[0-9]+\", options)) { }                          // Compliant\n        foreach (Range r in Regex.EnumerateSplits(input, \"[0-9]+\", options, TimeSpan.FromSeconds(1))) { } // Compliant\n\n        foreach (var m in Regex.EnumerateMatches(input, \"[A-Z]\")) { }                                     // Compliant\n        foreach (var m in Regex.EnumerateMatches(input, \"[A-Z]\", options)) { }                            // Compliant\n        foreach (var m in Regex.EnumerateMatches(input, \"[A-Z]\", options, TimeSpan.FromSeconds(1))) { }   // Compliant\n    }\n}\n\nclass Noncompliant\n{\n    private const string InvalidPattern = \"[A\";\n\n    void ImplicitObject()\n    {\n        Regex patternOnly = new(\"[A\");      // Noncompliant {{Fix the syntax error inside this regex: Invalid pattern '[A' at offset 2. Unterminated [] set.}}\n        Regex differentIssue = new(\"A???\"); // Noncompliant {{Fix the syntax error inside this regex: Invalid pattern 'A???' at offset 4. Nested quantifier '?'.}}\n    }\n\n    void Interpolated()\n    {\n        var regex = new Regex($\"{InvalidPattern}\");       // Noncompliant\n        var combined = new Regex($\"[AB{InvalidPattern}\"); // Noncompliant\n    }\n\n    void RawString()\n    {\n        var single = new Regex(\"\"\"[A\"\"\"); // Noncompliant\n        var multi = new Regex(\"\"\"\n            [A\n            \"\"\"); // Noncompliant @-2\n    }\n\n    // Repro https://sonarsource.atlassian.net/browse/NET-236\n    void DiagnosticStringSyntaxAttribute()\n    {\n        MyMethod(\"[A\"); // FN\n\n        void MyMethod([StringSyntax(StringSyntaxAttribute.Regex)] string regex) { }\n    }\n\n    // Repro https://sonarsource.atlassian.net/browse/NET-228\n    void EnumerateSplitsAndMatchesMethod(ReadOnlySpan<char> input, RegexOptions options)\n    {\n        foreach (Range r in Regex.EnumerateSplits(input, \"[A\")) { }                                   // Noncompliant\n        foreach (Range r in Regex.EnumerateSplits(input, \"[A\", options)) { }                          // Noncompliant\n        foreach (Range r in Regex.EnumerateSplits(input, \"[A\", options, TimeSpan.FromSeconds(1))) { } // Noncompliant\n\n        foreach (var m in Regex.EnumerateMatches(input, \"[A\")) { }                                    // Noncompliant\n        foreach (var m in Regex.EnumerateMatches(input, \"[A\", options)) { }                           // Noncompliant\n        foreach (var m in Regex.EnumerateMatches(input, \"[A\", options, TimeSpan.FromSeconds(1))) { }  // Noncompliant\n    }\n\n    void EscapeSequence()\n    {\n        var regex = new Regex(\"\\e[a|b]\"); // Compliant\n        regex = new Regex(\"[a|\\eb]\");     // Compliant\n        regex = new Regex(\"[a|\\u001bb]\"); // Compliant\n        regex = new Regex(\"[a|b]\\e\");     // Compliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RegularExpressions/RegexMustHaveValidSyntax.cs",
    "content": "﻿using System;\nusing System.ComponentModel.DataAnnotations;\nusing System.Text.RegularExpressions;\n\nclass Compliant\n{\n    void Ctor()\n    {\n        var defaultOrder = new Regex(\"valid pattern\", RegexOptions.None); // Compliant\n\n        var namedArgs = new Regex(\n            options: RegexOptions.None,\n            pattern: \"valid pattern\");\n\n        var noRegex = new NoRegex(\"[A\", RegexOptions.None); // Compliant\n    }\n\n    void Static()\n    {\n        var isMatch = Regex.IsMatch(\"some input\", \"valid pattern\", RegexOptions.None); // Compliant\n        var noRegex = NoRegex.IsMatch(\"some input\", \"[A\", RegexOptions.None); // Compliant\n    }\n\n    void Unknown(string unknown)\n    {\n        var regex = new NoRegex(unknown + \"[A\", RegexOptions.None); // Compliant\n    }\n\n    bool Multiline(string input)\n    {\n        return Regex.IsMatch(input,\n            @\"[a\n              |b\n              |d]\");  // Compliant\n    }\n\n    bool ConcatanationMultiline(string input)\n    {\n        return Regex.IsMatch(input, \"[a\"\n            + \"|b\"\n            + \"|c\"\n            + \"|d]\"); // Compliant\n    }\n\n    bool ConcatanationSingleIne(string input)\n    {\n        return Regex.IsMatch(input, \"a\" + \"|b\" + \"|c\" + \"|[A\"); // Noncompliant\n    }\n\n    [RegularExpression(\"[0-9]+\")] // Compliant\n    public string Attribute { get; set; }\n}\n\nclass Noncompliant\n{\n    private const string Prefix = \".*\";\n\n    void Ctor()\n    {\n        var patternOnly = new Regex(\"[A\"); // Noncompliant\n        //                          ^^^^\n\n        var withConst = new Regex(Prefix + \"[A\"); // Noncompliant\n    }\n\n    void Static()\n    {\n        var isMatch = Regex.IsMatch(\"some input\", \"[A\");    // Noncompliant\n        //                                        ^^^^\n        var match = Regex.Match(\"some input\", \"[A\");        // Noncompliant\n        var matches = Regex.Matches(\"some input\", \"[A\");    // Noncompliant\n        var split = Regex.Split(\"some input\", \"[A\");        // Noncompliant\n\n        var replace = Regex.Replace(\"some input\", \"[A\", \"some replacement\"); // Noncompliant\n    }\n\n    bool Multiline(string input)\n    {\n        return Regex.IsMatch(input,\n            @\"|b\n              |c\n              |[A\");  // Noncompliant @-2\n    }\n\n    bool ConcatanationMultiline(string input)\n    {\n        return Regex.IsMatch(input, \"a\" // Noncompliant\n            + \"|b\"\n            + \"|c\"\n            + \"|[A\");\n    }\n\n    bool ConcatanationSingleIne(string input)\n    {\n        return Regex.IsMatch(input, \"a\" + \"|b\" + \"|c\" + \"|[A\"); // Noncompliant\n    }\n\n    [RegularExpression(\"[A\")] // Noncompliant\n    public string Attribute { get; set; }\n\n    [System.ComponentModel.DataAnnotations.RegularExpression(\"[A\")] // Noncompliant\n    public string AttributeFullySpecified { get; set; }\n\n    [global::System.ComponentModel.DataAnnotations.RegularExpression(\"[A\")] // Noncompliant\n    public string AttributeGloballySpecified { get; set; }\n}\n\nclass DoesNotCrash\n{\n    bool UnknownVariable(string input)\n    {\n        return Regex.IsMatch(input, \"a\" + undefined); // Error [CS0103] The name 'undefined' does not exist in the current context\n    }\n}\n\npublic class NoRegex\n{\n    public NoRegex(string pattern, RegexOptions options) { }\n\n    public static bool IsMatch(string input, string pattern, RegexOptions options) { return true; }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RegularExpressions/RegexMustHaveValidSyntax.vb",
    "content": "﻿Imports System.ComponentModel.DataAnnotations\nImports System.Text.RegularExpressions\n\nClass Compliant\n    Private Sub Ctor()\n        Dim defaultOrder = New Regex(\"valid pattern\", RegexOptions.None)\n        Dim namedArgs = New Regex(options:=RegexOptions.None, pattern:=\"valid pattern\")\n    End Sub\n\n    Private Sub [Static]()\n        Dim isMatch = Regex.IsMatch(\"some input\", \"valid pattern\", RegexOptions.None)\n    End Sub\n\n    <RegularExpression(\"[0-9]+\")>\n    Public Property Attribute As String\nEnd Class\n\nClass Noncompliant\n    Private Sub Ctor()\n        Dim patternOnly = New Regex(\"[A\") ' Noncompliant\n        '                           ^^^^\n    End Sub\n\n    Private Sub [Static]()\n        Dim isMatch = Regex.IsMatch(\"some input\", \"[A\") ' Noncompliant\n        Dim match = Regex.Match(\"some input\", \"[A\")     ' Noncompliant\n        Dim matches = Regex.Matches(\"some input\", \"[A\") ' Noncompliant\n        Dim split = Regex.Split(\"some input\", \"[A\")     ' Noncompliant\n        Dim replace = Regex.Replace(\"some input\", \"[A\", \"some replacement\") ' Noncompliant\n    End Sub\n\n    <RegularExpression(\"[A\")> ' Noncompliant\n    Public Property Attribute As String\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RemoveObsoleteCode.Latest.cs",
    "content": "﻿using System;\n\n[ObsoleteAttribute()] // Noncompliant\nvoid Local()\n{\n\n}\n\n[Obsolete] // Noncompliant\nrecord R\n{\n    void M()\n    {\n        [Obsolete] // Noncompliant\n        void Local()\n        {\n        }\n    }\n}\n\npartial class PartialProperties\n{\n    [Obsolete] // Noncompliant\n    partial int Value { get; set; }\n\n    [Obsolete] // Noncompliant\n    partial int this[int x] { get; set; }\n}\n\npartial class PartialProperties\n{\n    partial int Value { get => 42; set { } }\n\n    partial int this[int x] { get => 42; set { } }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RemoveObsoleteCode.cs",
    "content": "﻿using System;\n\nnamespace Tests\n{\n    [Obsolete] // Noncompliant {{Do not forget to remove this deprecated code someday.}}\n//   ^^^^^^^^\n    public class Program\n    {\n        [Obsolete(\"Message\")]                // Noncompliant\n        public delegate void CloseDelegate(object sender, EventArgs eventArgs);\n\n        [Obsolete(\"Message\", error: true)]   // Noncompliant\n        public event CloseDelegate OnClose;\n\n        [ObsoleteAttribute()]                // Noncompliant\n        public Program()\n        {\n\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RemoveObsoleteCode.vb",
    "content": "﻿Imports System\n\n<Obsolete> ' Noncompliant ^2#8 {{Do not forget to remove this deprecated code someday.}}\nPublic Class Program\n\n    <Obsolete(\"Message\")>                   ' Noncompliant\n    Public Delegate Sub CloseDelegate(sender As Object, eventArgs As EventArgs)\n\n    <Obsolete(\"Message\", True)>             ' Noncompliant\n    Public Event OnClose As CloseDelegate\n\n    <ObsoleteAttribute()>                   ' Noncompliant\n    Public Sub New()\n    End Sub\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RequireAttributeUsageAttribute.CSharp11.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class GenericAttribute<T> : Attribute { } // Noncompliant\n\n    [AttributeUsage(AttributeTargets.Class)]\n    public class MyCompliantAttribute<T> : Attribute { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RequireAttributeUsageAttribute.cs",
    "content": "﻿using System;\n\npublic class MyInvalidAttribute : Attribute\n//           ^^^^^^^^^^^^^^^^^^ {{Specify AttributeUsage on 'MyInvalidAttribute'.}}\n{\n}\n\n[AttributeUsage(AttributeTargets.Class)]\npublic class MyCompliantAttribute : Attribute\n{\n}\n\npublic class MyInvalidInheritedAttribute : MyCompliantAttribute\n//           ^^^^^^^^^^^^^^^^^^^^^^^^^^^ {{Specify AttributeUsage on 'MyInvalidInheritedAttribute' to improve readability, even though it inherits it from its base type.}}\n{\n}\n\n[AttributeUsage(AttributeTargets.Class)]\npublic class MyInheritedAttribute : MyCompliantAttribute\n{\n}\n\npublic abstract class AbstractAttribute : Attribute // Compliant\n{\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Resources/AnotherResources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace SonarAnalyzer.Test.TestCases {\n    using System;\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"17.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    internal class AnotherResources {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal AnotherResources() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"SonarAnalyzer.Test.TestCases.AnotherResources\", typeof(AnotherResources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Some value.\n        /// </summary>\n        internal static string Key {\n            get {\n                return ResourceManager.GetString(\"Key\", resourceCulture);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Resources/AnotherResources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <data name=\"Key\" xml:space=\"preserve\">\n    <value>Some value</value>\n  </data>\n</root>"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Resources/SomeResources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace SonarAnalyzer.Test.TestCases {\n    using System;\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"17.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    internal class SomeResources {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal SomeResources() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"SonarAnalyzer.Test.TestCases.SomeResources\", typeof(SomeResources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to MyValue.\n        /// </summary>\n        internal static string MyName {\n            get {\n                return ResourceManager.GetString(\"MyName\", resourceCulture);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Resources/SomeResources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <data name=\"MyName\" xml:space=\"preserve\">\n    <value>MyValue</value>\n    <comment>My description</comment>\n  </data>\n</root>"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ReturnEmptyCollectionInsteadOfNull.Latest.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Numerics;\n\n// Reproducer for #6491 https://github.com/SonarSource/sonar-dotnet/issues/6491\nnamespace Issue_6491\n{\n    class SwitchExpressionClass\n    {\n        List<string> SwitchExpression(string str)\n        {\n            return str switch\n            {\n                \"First\" => null, // FN\n                \"Second\" => new List<string> { },\n                _ => null // FN\n            };\n        }\n\n        List<string> SwitchExpression2(string str) =>\n            str switch\n            {\n                \"First\" => null, // FN\n                \"Second\" => new List<string> { },\n                _ => null // FN\n            };\n    }\n}\n\nnamespace NullableAnotated\n{\n    class MyClass\n    {\n        public byte[]? GetNullableArrayOfNonNullableValueType(string itemId) => null;\n        public byte?[]? GetNullableArrayOfNullableValueType(string itemId) => null;\n        public byte?[] GetNonNullableArrayOfNullableValueType(string itemId) => null; // Noncompliant\n\n        public object[]? GetNullableArrayOfNonNullableReferenceType(string itemId) => null;\n        public object?[]? GetNullableArrayOfNullableReferenceType(string itemId) => null;\n        public object?[] GetNonNullableArrayOfNullableReferenceType(string itemId) => null; // Noncompliant\n        public byte[] GetArray(string itemId) => null; // Noncompliant\n    }\n\n    class MyGenericClass<T> where T : struct\n    {\n        public List<T>? GetNullableListOfNonNullableValueGenericType(string itemId) => null;\n        public List<T?>? GetNullableListOfNullableValueGenericType(string itemId) => null;\n        public List<T?> GetNonNullableListOfNullableValueGenericType(string itemId) => null; // Noncompliant\n        public List<T> GetList(string itemId) => null; // Noncompliant\n    }\n}\n\nrecord Record\n{\n    IEnumerable<string> Property => null; // Noncompliant\n\n    IEnumerable<char> Method(string str)\n    {\n        if (str == null)\n        {\n            return null; // Noncompliant\n        }\n\n        return str.ToCharArray();\n    }\n\n    static (IEnumerable<char>, IEnumerable<char>) SomeMethod()\n    {\n        return (null, null); // FN\n    }\n\n    IEnumerable<int> Compliant() => Enumerable.Empty<int>();\n}\n\nclass TernariesAndDefaults\n{\n    private static readonly string checkAgainst = \"42\";\n\n    public static IEnumerable<string> Foo1() => null; // Noncompliant\n    public static IEnumerable<string> Foo2() => (null); // Noncompliant\n    public static IEnumerable<string> Foo3() => default; // Noncompliant\n    public static IEnumerable<string> Foo4() => (default); // Noncompliant\n    public static IEnumerable<string> Foo5() => true ? null : new List<string>(); // Noncompliant\n    public static IEnumerable<string> Foo6() =>\n        ((\n        checkAgainst == null // Compliant\n        ? default // Noncompliant\n        : checkAgainst is not ((null)) // Compliant\n            ? ((default)) // Secondary\n            : DateTime.Now.Second % 2 == 0\n                ? null // Secondary\n                : (((null))) // Secondary\n        ));\n\n    public static IEnumerable<string> Foo7()\n    {\n        if (true)\n        {\n            if (true)\n            {\n                if (true)\n                {\n                    return ((null)); // Noncompliant\n                }\n            }\n            else\n            {\n                return default(IEnumerable<string>); // Secondary\n            }\n        }\n        else\n        {\n            return checkAgainst != null // Compliant\n                ? new List<string>()\n                : (default); // Secondary\n        }\n    }\n\n    public static IEnumerable<string> Foo8()\n    {\n        return true\n            ? new List<string>()\n            : false\n                ? default // Noncompliant\n                : null;  // Secondary\n    }\n}\n\nclass Operators : IAdditionOperators<Operators, Operators, IEnumerable<string>>\n{\n    private static readonly string checkAgainst = \"42\";\n\n    public static IEnumerable<string> operator +(Operators right, Operators left) => null; // Noncompliant\n    public static IEnumerable<string> operator -(Operators right, Operators left) => (null); // Noncompliant\n    public static IEnumerable<string> operator /(Operators right, Operators left) => default; // Noncompliant\n    public static IEnumerable<string> operator *(Operators right, Operators left) => (default); // Noncompliant\n    public static IEnumerable<string> operator %(Operators right, Operators left) => true ? null : new List<string>(); // Noncompliant\n    public static IEnumerable<string> operator ^(Operators right, Operators left) =>\n        ((\n        checkAgainst == null // Compliant\n        ? default // Noncompliant\n        : checkAgainst is not ((null)) // Compliant\n            ? ((default)) // Secondary\n            : DateTime.Now.Second % 2 == 0\n                ? null // Secondary\n                : (((null))) // Secondary\n        ));\n\n    public static IEnumerable<string> operator &(Operators right, Operators left)\n    {\n        if (true)\n        {\n            if (true)\n            {\n                if (true)\n                {\n                    return ((null)); // Noncompliant\n                }\n            }\n            else\n            {\n                return default(IEnumerable<string>); // Secondary\n            }\n        }\n        else\n        {\n            return checkAgainst != null // Compliant\n                ? new List<string>()\n                : (default); // Secondary\n        }\n    }\n\n    public static IEnumerable<string> operator |(Operators right, Operators left)\n    {\n        return true\n            ? new List<string>()\n            : false\n                ? default // Noncompliant\n                : null;  // Secondary\n    }\n}\n\n// https://sonarsource.atlassian.net/browse/NET-459\npublic class CSharp13\n{\n    partial class Partial\n    {\n        partial IEnumerable<string> MyStrings\n        {\n            get => ((null)); // Noncompliant\n        }\n\n        partial IEnumerable<string> this[int i] => null; // Noncompliant\n    }\n\n    partial class Partial\n    {\n        partial IEnumerable<string> MyStrings { get; }\n\n        partial IEnumerable<string> this[int i] { get; }\n    }\n}\n\n// https://sonarsource.atlassian.net/browse/NET-2347\npublic class Repro_NET2347\n{\n\n    public static ValueTypeCollection StructCollection(byte b)\n    {\n        return b == 0\n            ? default // Noncompliant - FP - The returned struct is a valid ValueTypeCollection with the `bits` parameter initialized to 0\n            : new ValueTypeCollection(b);\n    }\n\n    public static ImmutableArray<T> ReturnImmutableArray<T>() => default; // Noncompliant TP, default here is an uninitialized ImmutableArray<T> with the private `T[]` field being `null`.\n\n\n    public readonly struct ValueTypeCollection(byte bits) : IReadOnlyCollection<int>\n    {\n        public int Count => BitOperations.PopCount(bits);\n\n        public IEnumerator<int> GetEnumerator() =>\n            Enumerable.Range(0, 8).GetEnumerator();\n\n        IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();\n    }\n}\n\n// Spans are structs and thus should not trigger\nclass SpanConversions\n{\n    Span<char> Method1 => default;              // Compliant\n    Span<char> Method2 => new char[5];          // Compliant\n    ReadOnlySpan<char> Method3 => default;      // Compliant\n    ReadOnlySpan<char> Method4 => \"a string\";   // Compliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ReturnEmptyCollectionInsteadOfNull.TopLevelStatements.cs",
    "content": "﻿using System;\n\nstring[] LocalFunction() => null;                   // Noncompliant {{Return an empty collection instead of null.}}\nstring[] LocalFunctionNew() => new string[0];       // Compliant\n\nstatic string[] StaticLocalFunction() => (null);    // Noncompliant\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ReturnEmptyCollectionInsteadOfNull.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Xml;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        IEnumerable<string> ArrowedStrings1 => null; // Noncompliant {{Return an empty collection instead of null.}}\n//                                             ^^^^\n\n        IEnumerable<string> ArrowedStrings2 => (null); // Noncompliant\n\n        IEnumerable<string> Strings2\n        {\n            get\n            {\n                return null; // Noncompliant\n//                     ^^^^\n            }\n        }\n\n        IEnumerable<string> Strings3\n        {\n            get\n            {\n                return ((null)); // Noncompliant\n            }\n        }\n\n        IEnumerable<string> PropertyNoGetter { set { } }\n\n        IEnumerable<string> ArrowedGetStrings1() => null; // Noncompliant\n//                                                  ^^^^\n        IList<string> ArrowedGetStrings2 => null; // Noncompliant\n        string[] ArrowedGetStrings3() => null; // Noncompliant\n        ICollection<string> ArrowedGetStrings4() => null; // Noncompliant\n        Array ArrowedGetArray() => null; // Noncompliant\n        object ArrowedGetObject() => null; // Compliant\n\n        IEnumerable<char> GetValues(string str)\n        {\n            if (str == null)\n            {\n                return null; // Noncompliant\n//                     ^^^^\n            }\n\n            return str.ToCharArray();\n        }\n\n        IEnumerable<int> AssignedToNullVariable(int value)\n        {\n            List<int> myList = null;\n            return myList; // Compliant - should not be\n        }\n\n        IEnumerable<int> AssignedToNullVariable2(int value)\n        {\n            List<int> myList = null;\n\n            if (value == 42)\n            {\n                myList = new List<int>();\n            }\n\n            return myList; // Compliant - should not be (null on one path)\n        }\n\n        void DoSomething()\n        {\n        }\n\n        string GetString()\n        {\n            return null; // Compliant - string is a collection but we allow null\n        }\n\n        public int Age { get; private set; }\n\n        // See https://github.com/SonarSource/sonar-dotnet/issues/761\n        public List<int> Method()\n        {\n            Func<int?> aFunc = () =>\n            {\n                return null; // Compliant because we return from a func\n            };\n            return new List<int>();\n        }\n\n        public XmlNode GetXmlNode()\n        {\n            return null; // Compliant XmlNode and its descendants are ignored\n        }\n\n        public XmlDocument GetXmlDocument()\n        {\n            return null; // Compliant XmlNode and its descendants are ignored\n        }\n\n        public XmlElement GetXmlElement()\n        {\n            return null; // Compliant XmlNode and its descendants are ignored\n        }\n\n        public IEnumerable<int> SomeProp\n        {\n            get => null; // Noncompliant\n        }\n\n        public IEnumerable<string> GetSomeStrings()\n        {\n            var list = new List<string>();\n            return list;\n\n            int? LocalFunc()\n            {\n                return null;\n            }\n        }\n\n        public IEnumerable<string> GetSomeStrings2()\n        {\n            var list = new List<string>();\n            return list;\n\n            IEnumerable<string> LocalFunc()\n            {\n                return null; // Noncompliant\n            }\n        }\n\n        static IEnumerable<string> TestNullFromLambda()\n        {\n            var list = new List<string>();\n\n            return list.Select(o =>\n            {\n                if (o != null)\n                {\n                    return o;\n                }\n\n                return null;\n            });\n        }\n\n        static IEnumerable<string> TestNullFromParenthesizedLambda()\n        {\n            var list = new List<string>();\n\n            return list.Select<string, string>((o, i) =>\n            {\n                return null;\n            });\n        }\n\n        static IEnumerable<string> MethodWithLambdaStillRaisesIssue()\n        {\n            var list = new List<string>();\n\n            return list.Select<string, string>((o, i) =>\n            {\n                return null;\n            });\n            return null; // Noncompliant\n        }\n\n        List<string> NoncompliantMethodWithSecondaryLocation(string str)\n        {\n            switch (str)\n            {\n                case \"First\":\n                    return null; // Noncompliant\n                case \"Second\":\n                    return new List<string> { };\n                default:\n                    return null; // Secondary {{Return an empty collection instead of null.}}\n            }\n        }\n    }\n}\n\nclass PropertyWithoutAccessorList\n{\n    IEnumerable<string> Incomplete => ; // Error [CS1525]: Invalid expression term\n}\n\n// Reproducer for #6494 https://github.com/SonarSource/sonar-dotnet/issues/6494\nnamespace Issue_6494\n{\n    class MyClass\n    {\n        public IEnumerable<string> this[int i] => null; // Noncompliant\n        public static implicit operator List<int>(MyClass c) => null; // Noncompliant\n    }\n    class MyOtherClass\n    {\n        public IEnumerable<string> this[int index]\n        {\n            get\n            {\n                return null; // Noncompliant\n            }\n        }\n        public static implicit operator List<int>(MyOtherClass c)\n        {\n            return null; // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ReturnTypeNamedPartialShouldBeEscaped.CSharp8-13.cs",
    "content": "﻿namespace ReturnTypeNamedPartial\n{\n    using System.Collections.Generic;\n\n    public class Noncompliant\n    {\n        public delegate partial Delegate(); // Noncompliant {{Return types named 'partial' should be escaped with '@'}}\n        //              ^^^^^^^\n\n        public partial Method(int a) => null; // Noncompliant\n\n        public ReturnTypeNamedPartial.partial Qualified() => null; // Noncompliant\n        //                            ^^^^^^^\n\n        global::ReturnTypeNamedPartial.partial Alias() => null; // Noncompliant\n        //                             ^^^^^^^\n\n        ref partial Refs(ref partial p) => ref p; // Noncompliant\n        //  ^^^^^^^\n\n        Parent.partial Nested() => null; // Noncompliant\n        //     ^^^^^^^\n    }\n\n    public class Compliant\n    {\n        public delegate @partial Delegate();\n\n        @partial Method() => null;\n\n        public ReturnTypeNamedPartial.@partial Qualified() => null;\n\n        global::ReturnTypeNamedPartial.@partial Alias() => null;\n\n        ref @partial Refs(ref partial p) => ref p;\n\n        unsafe partial* Pointer() => null;\n\n        partial[] Array() => null;\n\n        List<partial> List() => null;\n\n        partial<int> Generic() => null;\n\n        partial GenricMethod<T>() => null;\n\n        public delegate partial GenericDelegate<T>();\n\n        public ReturnTypeNamedPartial.partial Qualified<T>() => null;\n\n        global::ReturnTypeNamedPartial.partial GenericAlias<T>() => null;\n\n        ref partial GenericRefs<T>(ref partial p) => ref p;\n\n        void GenericLocalFunction()\n        {\n            partial LocalFunction<T>() => null;\n        }\n\n        partial.Nested Nested() => null;\n\n        Parent.partial Nested<T>() => null;\n\n        Parent.@partial NestedEscaped() => null;\n\n        partial? Nullable() => null;\n\n        void VoidMethod() { }\n\n        (int, int) TupleMethod() { return (1, 0); }\n    }\n\n    public class partial\n    {\n        public class Nested { }\n    }\n\n    public class partial<T> { }\n\n    public class Parent\n    {\n        public class partial { }\n    }\n}\n\nnamespace Alias\n{\n    using partial = System.Int32;\n    using System.Collections.Generic;\n\n    using System.Collections.Generic;\n\n    public class Noncompliant\n    {\n        public delegate partial Delegate(); // Noncompliant\n        //              ^^^^^^^\n\n        public partial Method(int a) => default; // Noncompliant\n\n        public ReturnTypeNamedPartial.partial Qualified() => default; // Noncompliant\n        //                            ^^^^^^^\n\n        global::ReturnTypeNamedPartial.partial Alias() => default; // Noncompliant\n        //                             ^^^^^^^\n\n        ref partial Refs(ref partial p) => ref p; // Noncompliant\n        //  ^^^^^^^\n    }\n\n    public class Compliant\n    {\n        public delegate @partial Delegate();\n\n        @partial Method() => default;\n\n        public ReturnTypeNamedPartial.@partial Qualified() => default;\n\n        global::ReturnTypeNamedPartial.@partial Alias() => default;\n\n        ref @partial Refs(ref partial p) => ref p;\n\n        unsafe partial* Pointer() => default;\n\n        partial[] Array() => default;\n\n        List<partial> List() => default;\n\n        partial GenricMethod<T>() => default;\n\n        public delegate partial GenericDelegate<T>();\n\n        public ReturnTypeNamedPartial.partial Qualified<T>() => default;\n\n        global::ReturnTypeNamedPartial.partial GenericAlias<T>() => default;\n\n        ref partial GenericRefs<T>(ref partial p) => ref p;\n\n        void GenericLocalFunction()\n        {\n            partial LocalFunction<T>() => default;\n        }\n\n        partial? Nullable() => null;\n\n        (partial, partial) TupleMethod() => default;\n    }\n}\n\nnamespace GenericInterface\n{\n    interface INoncompliant<partial>\n    {\n        partial Method(); //Noncompliant\n    }\n\n    interface ICompliant<partial>\n    {\n        @partial Method();\n\n        partial Method<T>() => default;\n    }\n}\n\nnamespace partial\n{\n\n    class Compliant\n    {\n        partial.Compliant Method() => null;\n\n        global::partial.Compliant Method2() => null;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ReturnTypeNamedPartialShouldBeEscaped.Latest.cs",
    "content": "﻿namespace ReturnTypeNamedPartial\n{\n    using System.Collections.Generic;\n\n    public class Compliant\n    {\n        public delegate @partial Delegate();\n\n        @partial Method() => null;\n\n        public ReturnTypeNamedPartial.@partial Qualified() => null;\n\n        global::ReturnTypeNamedPartial.@partial Alias() => null;\n\n        ref @partial Refs(ref partial p) => ref p;\n\n        unsafe partial* Pointer() => null;\n\n        partial[] Array() => null;\n\n        List<partial> List() => null;\n\n        partial<int> Generic() => null;\n\n        partial GenricMethod<T>() => null;\n\n        public delegate partial GenericDelegate<T>();\n\n        public ReturnTypeNamedPartial.partial Qualified<T>() => null;\n\n        global::ReturnTypeNamedPartial.partial GenericAlias<T>() => null;\n\n        ref partial GenericRefs<T>(ref partial p) => ref p;\n\n        void GenericLocalFunction()\n        {\n            partial LocalFunction<T>() => null;\n        }\n\n        partial? Nullable() => null;\n\n        void VoidMethod() { }\n\n        (partial, partial) TupleMethod() => default;\n    }\n\n    public class CompilerErrors\n    {\n        public delegate partial Delegate(); // Error [CS1002] ; expected\n                                            // Error@-1 [CS1003] Syntax error, '(' expected\n                                            // Error@-2 [CS1026] ) expected\n                                            // Error@-3 [CS1031] Type expected\n                                            // Error@-4 [CS1525] Invalid expression term 'partial'\n                                            // Error@-5 [CS0751] A partial member must be declared within a partial type\n                                            // Error@-6 [CS1520] Method must have a return type\n\n        public ReturnTypeNamedPartial.partial FirstMethod() // Error [CS0102] The type 'CompilerErrors' already contains a definition for ''\n                                                            // Error@-1 [CS1002] ; expected\n                                                            // Error@-2 [CS1525] Invalid expression term 'partial'\n                                                            // Error@-3 [CS1525] Invalid expression term 'partial'\n                                                            // Error@-4 [CS0751] A partial member must be declared within a partial type\n                                                            // Error@-5 [CS1520] Method must have a return type\n        {\n            return new ReturnTypeNamedPartial.partial(); // Error [CS0127] Since 'CompilerErrors.CompilerErrors()' returns void, a return keyword must not be followed by an object expression\n        }\n\n        partial SecondMethod() // Error [CS0751] A partial member must be declared within a partial type\n                               // Error@-1 [CS1520] Method must have a return type\n                               // Error@-2 [CS9278] Partial member 'CompilerErrors.CompilerErrors()' may not have multiple implementing declarations.\n        {\n            return new partial(); // Error [CS0127] Since 'CompilerErrors.CompilerErrors()' returns void, a return keyword must not be followed by an object expression\n        }\n    }\n\n    public class partial { }\n\n    public class partial<T> { }\n}\n\nnamespace partial\n{\n\n    class Compliant\n    {\n        partial.Compliant Method() => null;\n\n        global::partial.Compliant Method2() => null;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ReturnTypeNamedPartialShouldBeEscaped.TopLevelStatements.CSharp9-13.cs",
    "content": "﻿   partial Function() => null; // Noncompliant {{Return types named 'partial' should be escaped with '@'}}\n// ^^^^^^^\n\nglobal::partial Global() => null; // Noncompliant\n//      ^^^^^^^\n\nglobal::partial GlobalGeneric<T>() => null;\n\n@partial Function2() => null;\n\nglobal::@partial Global2() => null;\n\npartial GenericFunction<T>() => null;\n\npartial<int> GenericFunction2() => null;\n\nclass Noncompliant\n{\n    global::partial Method() => null; // Noncompliant\n    //      ^^^^^^^\n}\n\nclass Compliant\n{\n    global::@partial Method() => null;\n}\n\nclass partial { }\n\nclass partial<T> { }\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ReturnTypeNamedPartialShouldBeEscaped.TopLevelStatements.Latest.cs",
    "content": "﻿partial Function () => null; // Error [CS0116] A namespace cannot directly contain members such as fields, methods or statements\n                             // Error@-1 [CS0201] Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement\n\nglobal::partial Global () => null; // Error [CS1002] ; expected\n                                   // Error@-1 [CS1525] Invalid expression term 'partial'\n                                   // Error@-2 [CS0116] A namespace cannot directly contain members such as fields, methods or statements\n                                   // Error@-3 [CS0201] Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement\n\nglobal::partial GlobalGeneric<T>() => null;\n\n@partial Function2() => null;\n\nglobal::@partial Global2() => null;\n\npartial GenericFunction<T>() => null;\n\npartial<int> GenericFunction2() => null;\n\nclass Errors\n{\n    global::partial Method() => null; // Error [CS1002] ; expected\n                                      // Error@-1 [CS1525] Invalid expression term 'partial'\n                                      // Error@-2 [CS0751] A partial member must be declared within a partial type\n                                      // Error@-3 [CS1520] Method must have a return type\n                                      // Error@-4 [CS0201] Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement\n                                      // Error@-5 [CS1525] Invalid expression term 'partial'\n                                      // Error@-6 [CS9276] Partial member 'Errors.Errors()' must have a definition part.\n}\n\nclass Compliant\n{\n    global::@partial Method() => null;\n}\n\nclass partial { }\n\nclass partial<T> { }\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ReturnValueIgnored.Latest.cs",
    "content": "﻿using System;\nusing System.Linq;\nusing System.Diagnostics.Contracts;\nusing System.Collections.ObjectModel;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Collections.Frozen;\n\nclass CSharp13\n{\n    // https://sonarsource.atlassian.net/browse/NET-416\n    void ReadOnlySet(HashSet<int> set)\n    {\n        var readonlySet = new ReadOnlySet<int>(set);\n        readonlySet.OfType<object>();   // Noncompliant\n        readonlySet.ToList();           // Noncompliant\n        readonlySet.Where(i => true);   // Noncompliant\n        readonlySet.Min();              // Noncompliant\n        readonlySet.ToHashSet();        // Noncompliant\n        readonlySet.ToImmutableArray(); // Noncompliant\n        readonlySet.ToFrozenSet();      // Noncompliant\n    }\n\n    void LinqExtensions(List<int> list)\n    {\n        list.CountBy(i => i);                              // Noncompliant\n        list.AggregateBy(x => x, y => y, (x, y) => x + y); // Noncompliant\n        list.Index();                                      // Noncompliant\n    }\n}\n\nclass CSharp14\n{\n    private IEnumerable<int> field;\n\n    void NullConditionalAssignment(CSharp14 sample, List<int> list)\n    {\n        sample?.field = list.Where(x => x > 5); // Compliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ReturnValueIgnored.TopLevelStatements.cs",
    "content": "﻿using System;\nusing System.Linq;\nusing System.Diagnostics.Contracts;\nusing System.Collections.ObjectModel;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Collections.Frozen;\n\nRecord r = new();\nr.GetValue();\nr.Method(); // Noncompliant\nvar x = r.Method();\n\nnew nint[] { 1 }.Where(i => true); // Noncompliant\nnew nint[] { 1 }.ToList(); // Noncompliant\n\nAction<int> a = static (input) => \"this string\".Equals(\"other string\"); // Noncompliant\nAction<nint, nuint> b = static (_, _) => \"this string\".Equals(\"other string\"); // Noncompliant\n\nint i = 2;\n\nnint n = 2;\nnuint nu = 2;\n\nIntPtr intPtr = IntPtr.Zero;\nUIntPtr uintPtr = UIntPtr.Zero;\n\nintPtr.ToInt64(); // Noncompliant\nuintPtr.ToUInt64(); // Noncompliant\n\nn.ToInt32(); // Noncompliant\nnu.ToUInt32(); // Noncompliant\n\nunsafe\n{\n    intPtr.ToPointer(); // Noncompliant\n    uintPtr.ToPointer(); // Noncompliant\n    i.ToString(); // Noncompliant\n\n    n.ToPointer(); // Noncompliant\n    nu.ToPointer(); // Noncompliant\n}\n\nrecord Record\n{\n    [Pure]\n    public uint Method() { return 0; }\n\n    public nint GetValue() => 42;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ReturnValueIgnored.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Diagnostics.Contracts;\n\nnamespace Tests.Diagnostics\n{\n    [Pure]\n    public class PureType\n    {\n        public static int GetValue() => 42;\n    }\n\n    public class NonPureType\n    {\n        public static int GetValue() => 42;\n    }\n\n    class ReturnValueIgnored\n    {\n        [Pure]\n        int Method() { return 0; }\n        [Pure]\n        int Method(ref int i) { return i; }\n\n        void Test()\n        {\n            new int[] { 1 }.Where(i => true); // Noncompliant\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n            var k = 0;\n            new int[] { 1 }.Where(i => { k++; return true; }); // Noncompliant, although it has side effect\n\n            new int[] { 1 }.ToList().ForEach(i => { });\n\n            new int[] { 1 }.ToList(); // Noncompliant {{Use the return value of method 'ToList'.}}\n            new int[] { 1 }.OfType<object>(); // Noncompliant\n\n            \"this string\".Equals(\"other string\"); // Noncompliant\n            M(\"this string\".Equals(\"other string\"));\n\n            \"this string\".Equals(new object()); // Noncompliant\n            Method(); // Noncompliant\n//          ^^^^^^^^\n\n            1.ToString(); // Noncompliant\n\n            int j = 1;\n            Method(ref j);\n\n            Action<int> a = (input) => \"this string\".Equals(\"other string\"); // Noncompliant\n            Func<int, bool> f = (input) => \"this string\".Equals(\"other string\");\n\n            PureType.GetValue(); // Noncompliant\n            NonPureType.GetValue();\n\n            \"\".DoSomething(null); // Compliant\n            new int[] { 1 }.DoSomething(null); // Compliant\n\n            string.Intern(\"abc\"); // Noncompliant {{Use the return value of method 'Intern'.}}\n            string.Compare(\"abc\", \"def\"); // Noncompliant\n        }\n        void M(object o) { }\n    }\n\n    public static class Ext\n    {\n        public static int DoSomething<T>(this IEnumerable<T> self, Action action) { return 42; }\n        public static int DoSomething(this string self, Action action) { return 42; }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ReversedOperators.Latest.cs",
    "content": "﻿class CSharp14\n{\n    int target = -5;\n    int num = 3;\n\n    public void NullConditionalAssignment(CSharp14 sample)\n    {\n        sample?.target =- num;  // Noncompliant\n        sample?.target =+ num;  // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ReversedOperators.TopLevelStatements.cs",
    "content": "﻿nint nintTarget = -5;\nnint nintNum = 3;\n\nnintTarget =- nintNum; // Noncompliant\nnintTarget =+ nintNum; // Noncompliant\n\nnintTarget = -nintNum; // Compliant; intent to assign inverse value of num is clear\n\nnintTarget += nintNum;\nnintTarget += -nintNum;\nnintTarget =\n    +nintNum;\n\nnuint nuintTarget = +5;\nnuint nuintNum = 3;\n\nnuintTarget =+ nuintNum; // Noncompliant\n\nnuintTarget += nuintNum;\nnuintTarget += +nuintNum;\nnuintTarget =\n    +nuintNum;\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ReversedOperators.cs",
    "content": "﻿namespace Tests.Diagnostics\n{\n    public class ReversedOperators\n    {\n        public ReversedOperators()\n        {\n            int target = -5;\n            int num = 3;\n\n            target =- num;  // Noncompliant {{Was '-=' meant instead?}}\n//                  ^\n            target =+ num;  // Noncompliant; target = 3\n//                  ^\n\n            target = -num;  // Compliant; intent to assign inverse value of num is clear\n            target =-num;  // Compliant; most probably intent to assign inverse value?\n            target=-num;  // Compliant; most probably intent to assign inverse value?\n\n            target += num;\n\n            target +=- num;\n            target += -num;\n            target =\n                +num;\n\n            bool a, b;\n            // Error@+1 [CS0165] - b not initialized\n            if (a =! b) { } // Noncompliant\n            if (a != b) { }\n            if (a = !b) { }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ReversedOperators.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.Linq\nImports System.Text\n\nNamespace Tests.TestCases\n  Class Foo\n    Public Sub Test()\n      Dim target As Integer = -5\n      Dim num As Integer = 3\n\n      target =- num ' Noncompliant {{Was '-=' meant instead?}}\n'             ^\n      target =+ num ' Noncompliant {{Was '+=' meant instead?}}\n'             ^\n      target =-     num ' Noncompliant\n      target=- num ' Noncompliant\n\n      target = - num\n      target = -num ' Compliant intent To assign inverse value Of num Is clear\n      target =-num ' Compliant most probably intent To assign inverse value?\n      target=-num ' Compliant most probably intent To assign inverse value?\n\n      target +=- num\n\n      target += num\n\n      target += -num\n      target = _\n          +num\n\n    End Sub\n  End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RightCurlyBraceStartsLine.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public class RightCurlyBraceStartsLine\n    {\n        private void doSomething() { throw new Exception();}\n        private void doSomething(object[] os) { throw new Exception();}\n        public RightCurlyBraceStartsLine()\n        {\n        }\n\n        public void f1()\n        {\n            doSomething();} // Noncompliant\n//                        ^\n\n        public void f2()\n        {\n            if (true)\n            {\n            doSomething();} // Noncompliant {{Move this closing curly brace to the next line.}}\n\n            var f = new Action(delegate {\n                                       doSomething();}); // Noncompliant\n\n            {\n            doSomething();} // Noncompliant\n\n            if (true) { doSomething(); }\n        }\n\n\n        public void f3()\n        {\n            doSomething(new[] { new Foo (),\n                                new Foo ()});\n\n            List<int> d = new List<int> { 0, 1, 2, 3, 4,\n                                        5, 6, 7, 8, 9 };\n\n            var b = new { A = 1, B = 2,\n                                C = 3, D = 4};\n\n            var c = new DummyCl { A = 1, B = 2,\n                                C = 3, D = 4};\n        }\n    }\n\n    public class Foo { }\n\n    public class DummyCl\n    {\n        public int A { get; set; }\n        public int B { get; set; }\n        public int C { get; set; }\n        public int D { get; set; }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RuleFailure/InvalidSyntax.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text\nusing System.Threading.Tasks;\n\nnamespace SonarAnalyzer.Test.TestCasesForRuleFailure\n{\n    public void Method2(int i, int j) { }\n\n    class DuplicatedInterfaces: IList, IList {}\n\n    class InvalidSyntax\n    {\n        ;\n        public void Method(int i, int j,)\n        {\n            var x = 6\n            for (int i = 0; i < 5; i++)\n            }\n\n        private class C\n        {\n            public C()\n        }\n    }\n\n    class\n    {\n        int i;\n        public override int GetHashCode()\n        {\n            int? v = null;\n            if (v > missing)\n            { }\n\n            return i; // we don't report on this\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RuleFailure/InvalidSyntax.vb",
    "content": "﻿Imports System\nImports System.Collections\nImports System.Collections.Generic\nImports System.Linq\nImports System.Text\nImports System.Threading.Tasks\n\nNamespace TestCasesForRuleFailure\n\n    Public Sub Method2(i As Integer, j As Integer)\n    End Sub\n\n    Public Class DuplicatedNotImplementedInterfaces\n        Implements IList\n        Implements IList\n\n    End Class\n\n    Class InvalidSyntax\n\n        Public Sub Method(i As Integer, j As Integer,)\n            Dim x =\n            For i as integer = 0 to 5\n        End Sub\n\n        Public Sub InvalidChars()\n            ;\n            {\n            }\n        End Sub\n\n        Private Class C\n            Public New\n        End Class\n\n    End Class\n\n    Class\n\n        i as integer\n\n    End Class\n\n    Public Class NoSubName\n\n        Public Sub\n        End Sub\n\n    End Class\n\nEnd Namespace\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RuleFailure/PerformanceTestCases.cs",
    "content": "﻿using System.Collections.Generic;\n\nnamespace SonarAnalyzer.Test.TestCasesForRuleFailure\n{\n    class PerformanceTestCases\n    {\n        static void Bar()\n        {\n            var dictionary = new HashSet<string>() { \"F7:2869G6B1.77.\", \"DEBGDE4AE:0:.94\", \"::2\", \"EB9AD3G02.1GC81\", \"AE3.7EAD1B1616D\", \"BE:3538E9F87801\", \"G97ADF.2DCE7.:B\", \"::2\", \"::\", \"0.0.0.0\", \"1.G54:C6737EC28\", \"41EB67FA26B56GD\", \"0::0\", \"0:0::0:1\", \"0:0::0:2\", \"::\", \"0:0::0:1\", \"381GG84C9:980DG\", \"0:0:0:0:0:0:0:1\", \"G73954GC:7.236F\", \"::\", \"0:0:0:0:0:0:0:0\", \"0::0\", \"0ED6GE5E703B289\", \"0:0:0:0:0:0:0:2\", \"2.5.20.1\", \"0:0:0:0:0:0:0:2\", \"F9CA:02793:C1BC\", \"2G785DBEGA8F.4G\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"2.5.20.1\", \"8CC8348G4AFE48:\", \"::2\", \"G4D:E6G:164FCBF\", \":.AA:109BG95G07\", \"0:0:0:0:0:0:0:0\", \"::\", \"83:09B8A5EC9D:9\", \"G:AE:E:EF5GCA5C\", \"0:0:0:0:0:0:0:2\", \"::/0\", \"CA0EA1F7C5A473E\", \"87E05063D2A.G1B\", \"1::2::3\", \"::/0\", \"04A2B45FE:DG374\", \"BC2B18574BA.AAA\", \"0:0:0:0:0:0:0:0\", \"A39.67.4E44:FGA\", \"127.0.0.1\", \"4.993D.36.E0696\", \".9CDC509C8G05:G\", \"::\", \"    127.0.0.0    \", \"B903A:GEF194345\", \"A8:B0DEE107F87D\", \"::2\", \"    127.0.0.0    \", \"    127.0.0.0    \", \"::\", \"::/0\", \"F7B1C4E5B038C5D\", \"51EE5C8A31C6B3A\", \"67GC26.13E::C61\", \"::2\", \"3B0623D8G1E6AB6\", \"6GB..:2F:E:94G5\", \".9E4:09CC3F86:A\", \"D3583CA61182FFB\", \"5A0BB1B89A93156\", \"::\", \":::4\", \"::\", \"DA61141:1C9BAA1\", \"D998BCA5GE542EC\", \"5G:5:DFCEA002A9\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"EG32399EE79AD:6\", \"1E2117AC7D629G3\", \":::4\", \"127.0.0.1\", \":::4\", \":4ED.BCB.994C8B\", \"0:0:0:0:0:0:0:0\", \"2.59.6.2\", \"1::2::3\", \"255.255.255.255\", \"9DF32GGF:D11C18\", \"0:0::0:1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"1FF71E:GFB7GDFG\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::\", \"8DCEG134:BA10BD\", \"304B65DF1835508\", \"::\", \"2\", \"150C2.E5C1AFG74\", \"AB242GDG7EF60FD\", \"127.0.0.0\", \"0.0.0.0\", \"::2\", \"2CEGFAGG45947EF\", \"6:DFG7B2:6341CA\", \"::/0\", \"B:1E024G1BFBE9.\", \":894:C4465A1FF:\", \"::556.B5:3EA29G\", \"1::2::3\", \"::\", \"EGC.:92380A2B.4\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"ABAGCF.FF.9GE.2\", \"16EGE.F014:.7D1\", \".2E:31CABF62GD.\", \"93A:5A39:5B1F:4\", \"GA769.GF8F20A16\", \"9DDF9C36F2080E8\", \"6DG48C014CF4.F7\", \"0:0:0:0:0:0:0:2\", \"A943:5466:7.759\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"9.A75:83511.4F4\", \"    127.0.0.0    \", \"5870EC01:3E0EEC\", \"3897A43BFADG9.9\", \":::4\", \"31.5G5B733:FCC3\", \"127.0.0.0\", \"069G48BG71953.D\", \"B85:D32B6F:7G4B\", \"0.0.0.1234\", \"::1\", \"A4.3G3::99FEE8E\", \":::4\", \"9.2F575:6F6D74F\", \"90EC:580:9A5728\", \"2.59.6.2\", \"::\", \"0:0:0:0:0:0:0:2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"2997C.F56022154\", \"9A7FB01F12B.F1A\", \"91EG4.A1BD832C1\", \"04507FDB0743355\", \"0:0::0:1\", \"3:87:93:E.188C:\", \"127.0.0.0\", \"EE3289E1DAAGA76\", \"127.2.3.4\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"04:9DD49FF3A2E5\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"::1\", \"0:0::0:1\", \"127.2.3.4\", \".D2E3.F1E8.:278\", \"192.168.0.1\", \"8FAGAB56EG:E6:.\", \"DA258FB5:544:57\", \"2\", \"::2\", \"84626DBG2180771\", \"E22EG67G8ADD5A9\", \"F456:0A4B.G5G:C\", \"FF341EBCA5DC2DB\", \"300.0.0.0\", \"0:0:0:0:0:0:0:0\", \"18EB7DDF88F:1.2\", \"0::0\", \"F:15AD:40DFCC5G\", \"D864C5.DCCE8C9A\", \"0:0:0:0:0:0:0:0\", \"44:8A59F896.B22\", \"0.0.0.1234\", \"15C:2747ABCBD34\", \"10.6639E8A126:7\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"AF2AAC7317CBG38\", \"35.517483D15CF0\", \"127.0.0.1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"3:3.G559.7FB6FA\", \"E::1.F0E4.9.9D.\", \"CD5155F8:1EB6D5\", \"81:.16D:E66DC:1\", \"0:0:0:0:0:0:0:2\", \".DF6278FA.22365\", \"4FD34DF5:F92.82\", \"2.59.6.2\", \"A3:CEG0F08F5.14\", \"1::2::3\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0::0\", \"922FF0A055:17:4\", \"0:0::0:1\", \"B5363.4A11G:442\", \"6FG40FB895F.8..\", \"300.0.0.0\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"GA258848.51.5C:\", \"1::2::3\", \"127.2.3.4\", \"316735D3AC80GBD\", \"300.0.0.0\", \"0:0:0:0:0:0:0:1\", \"192.168.0.1\", \"0:0:0:0:0:0:0:0\", \"F.GA2CEC7.AA06F\", \"127.2.3.4\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2.5.20.1\", \"::1\", \"8399BEB7F1EA5G.\", \"9FE9F3:5.56:5E9\", \"0.0.0.0\", \"0:0:0:0:0:0:0:1\", \"::\", \"0:0::0:1\", \"::\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"33EB0DD.1960D6.\", \"D.:C0:F7:F6AAF2\", \"::2\", \".F2155A0D8EA0.6\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"E5A448047E1.21E\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"5DFFF6D87C1.056\", \"2.5.20.1\", \"0:0::0:2\", \"0::0\", \"0:0::0:1\", \"E32.AG3:3E85:.7\", \"0.1DE003FCB5BAA\", \"2.5.6.2\", \"0::0\", \"5005G2E2B:657:F\", \"127.2.3.4\", \"0:0::0:2\", \"2D989268.E8D7BA\", \"GCC5.C603716981\", \"::/0\", \"BG.G:1E7.DG603B\", \"990E2AFE12D8A1G\", \":FE42AA3D5A44.D\", \"::2\", \"0.0.0.0\", \".6.F56B444.GA2C\", \"DA06G13E853G.44\", \"192.168.0.1\", \"300.0.0.0\", \"F73CAGF58A14664\", \"0:0::0:2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"CGGCC76D933C6B2\", \"3925DB.F20DAA1:\", \"5A74953FC1GF:8E\", \"B.:..F6.2:BFD4.\", \"0:0:0:0:0:0:0:2\", \"GGA1.C4503ECE02\", \"1::2::3\", \"2.5.6.2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"AE72FD85G46:1:A\", \"1F4066E1A1ABG42\", \"B9AG25F4D08GC3A\", \"2C3.83E5FFA:D9C\", \"51F63C848F.7E8D\", \"54F4:E373:FE32F\", \"8E622.GA323BA2E\", \"192.168.0.1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2.5.20.1\", \"8BC1219:4A8.4F3\", \"4F7D61B.95A7509\", \"1A724F72AC865G.\", \"2.59.6.2\", \"7D:CD571F:037:7\", \"GAC892A:35G11A3\", \"C2AG.D.01785C91\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"300.0.0.0\", \"0BEB.B56638944C\", \"300.0.0.0\", \"D37F9E1:89FG55:\", \"0:0:0:0:0:0:0:0\", \"0.0.0.0\", \"ED1CA52773D21C.\", \"2.5.20.1\", \"    127.0.0.0    \", \"127.0.0.1\", \"255.255.255.255\", \":264GF0AABFA8:2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"B::F.A2D5.:44GB\", \"A:DF4::F:F.2884\", \"0:0::0:2\", \"0:0::0:2\", \"999FF8C74.29F6:\", \"GGGG7GBD3E16764\", \"G83DA611A16G434\", \"255.255.255.255\", \"127.2.3.4\", \"EC497C0A5E39.4:\", \"2\", \"35C.683.B:1E844\", \"1E39F6.93B.D39C\", \"7A2B.9EDD043.:0\", \"0::0\", \"54G38E9DAGG4G.1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"2.59.6.2\", \"51.30B:F3ABBF29\", \"0:0::0:2\", \"::1\", \"::1\", \"2.59.6.2\", \"CG3A3264A.D766F\", \".2.B.48B:GEE322\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"60.54CD62A99.CD\", \"255.255.255.255\", \"G60:8A4F47:EAGA\", \"1252G2GF661DBD:\", \"E7::4:F1118FBFG\", \"::/0\", \"127.0.0.1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"ECFCF3F6A3F.GE9\", \"0::0\", \"10CF98:7:C:0GD:\", \"4EE5G34EA57C985\", \":::4\", \":::4\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::\", \"1GEF:8B01E60.BB\", \"736C:CF5.C847G2\", \"F7:.E6.5:299A.1\", \"G33E:::.6.8B5:7\", \"255.255.255.255\", \"2CA8B5E:0DDE7C6\", \"469EG43GA9B.7DC\", \"4.C6209G1..28:2\", \"::/0\", \"B:68A00742E5FBF\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0:0::0:1\", \"E4A:9BD69BD9D98\", \"35:781A46D20C27\", \"0.0.0.1234\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"F118.EG09G0.BG:\", \"1::2::3\", \"7F0A67A6:B31904\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"8093DE6GA733.B5\", \"0:0::0:1\", \".51B:BD3872324:\", \"E6F.14G37639A49\", \"0:0:0:0:0:0:0:1\", \"255.255.255.255\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"2.59.6.2\", \"0:0:0:0:0:0:0:2\", \"G9F91E21C17E825\", \":9.D9A14.F9.3G.\", \"7805GG1.94B9CD.\", \"2.5.20.1\", \"GE.92:E5F0FB290\", \"::7BDD78G275B12\", \"::\", \"DA5::05CB653:01\", \"867460EE610FF1A\", \"    127.0.0.0    \", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0:0:0:0:0:0:1\", \"4E3D88194D46.G7\", \"0:0::0:1\", \"0:0::0:2\", \"192.168.0.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"7764G34A2:DC9A8\", \"2.59.6.2\", \"::/0\", \".433F1FD:672G20\", \"13F:C2B840.52BE\", \"0455A0CF93C:6GG\", \"1130D62E30EG067\", \"0::0\", \"CG063DB45278GB5\", \"2\", \"40F9634C7DD6AG3\", \"528.2731:4G86BA\", \"97729BF15F8099E\", \"1.03D:049A41.::\", \"08:A967:7C68D7E\", \"E:E.4:EB3C.C300\", \"AEA6D1B:6B02113\", \"0::0\", \"1AA:49:B:AGB0GC\", \"ECB520BE8G:FEEE\", \":::4\", \"2.59.6.2\", \"0:0::0:2\", \"2ABC.F65BF2.4A9\", \"2.59.6.2\", \"29129683A9.9191\", \"GAE61F0CD4.96C2\", \"E2D5.AB4172BDAE\", \".1G15D544FA7:1F\", \".DF9G:DA21041.4\", \"B:5GB41FDFEC.B1\", \"4:EB998A3D8CA4E\", \"B82A38.6.0.51B4\", \"75E3CC3:C9AC5G1\", \"E10F0B6463412:F\", \"0.0.0.0\", \"65853G:F13219G0\", \"E1296A7C8697CFA\", \"E8G91D7.4C:9441\", \"45B8:C.160FF281\", \"DED7.DB0491D.D1\", \"::1\", \"::1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"C:GE3693.E0B39D\", \"01EE2:746A43FBB\", \"::\", \"9B.3G97EFE20226\", \"F7A9B6EB28.D804\", \"0.0.0.1234\", \"::2\", \"D76E9B3D71GA::G\", \"8020C6B38B3A921\", \".::D37G2C4F15F7\", \"9FG92EF2.8:5B76\", \"::2\", \"51B557E4.E7F314\", \"2\", \"GB25GC1:BCF48AE\", \"::1\", \"::\", \"::\", \"5..02EG4691AA.6\", \"::\", \"D219F6.0DF9:8.6\", \"AD7A7F32BGE2494\", \"0.0.0.0\", \"C05C2B87F9CDG70\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"02:6449.F...454\", \"1::2::3\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \".FA727DAA.09E4F\", \"45B2B:18D664A42\", \"133B3DE7BEDB.46\", \":3BC55466390C4A\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"4DE:98G3F86652.\", \"G7F:.1FCCDCFA7A\", \"127.0.0.0\", \"6GF9F:2.4E0:19D\", \"3BD7E71BB14::26\", \"::1\", \"09A960DFB:23C.C\", \"255.255.255.255\", \"048822BDF:E130G\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"A1BA5C0408F8:GB\", \"2\", \"2.5.6.2\", \"C4427EB35EG1615\", \"06C4B8376:0F619\", \"255.255.255.255\", \"::1\", \".8.5AD5B8C.G2D1\", \"C2F4D0:7DE28BEF\", \"255.255.255.255\", \"B733DB61:741222\", \"C3E4EC6.G7407:4\", \"255.255.255.255\", \"0.0.0.0\", \":.0EB2E0.D83A38\", \":2:G1GE6E0165F2\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \":51G33898D4EFGB\", \"3G7EF40.703A.8F\", \"9:96ACDC0CD3418\", \"9B756650126GE12\", \"8DC:8912AC.6.79\", \"255.255.255.255\", \"11GF:C32F2E00:0\", \"2.5.6.2\", \"F6E9220393.91A6\", \"127.0.0.0\", \"127.0.0.0\", \"E350C4ABEAE5E97\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"F983187227AEEA4\", \"::1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"FD4F25CB20B57.A\", \"ABC:AF6969EAA1.\", \"5F:A:10G:E65757\", \"0:0:0:0:0:0:0:1\", \"F4E4FCD:1C9BBD4\", \"5D41FF:058B.77D\", \"BAA16B328E056D8\", \"0:0::0:1\", \"B:DBB91A592A.9:\", \"87366.1.ECCF2E9\", \"266G001866.C9DG\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \":BAFABA5880.B10\", \"::/0\", \"6F40G92G19.B272\", \"3G5GEG661:4G390\", \"C18.2FFBFFF462A\", \"3D8A17E:48FB.AG\", \"DB5E9A21D2FF:A3\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"5::487BGDC:E92D\", \"9C0713CAG.G55BE\", \"127.0.0.1\", \"14613A91CB2B838\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"EB4B526D1.D44F9\", \"5FE66429B:G7EAE\", \"F7346.CF6F3.C6G\", \":C65045:B5:4.:6\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \":::4\", \"::\", \"::\", \"EE2G153BG0CB.0B\", \".18D1740F1F9189\", \"833E32DE9EBE3BB\", \"94:GDB.G1:716.F\", \"3::A24001840GGF\", \"2.5.20.1\", \"::2\", \"0:0:0:0:0:0:0:1\", \"7D.45D9G4B27E41\", \"11A0486961F604:\", \"0DE5.966:0395G8\", \"::1\", \"0:0:0:0:0:0:0:2\", \"E.309B:51F.2GB3\", \"1::2::3\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0::0:1\", \"BF74398103BF9.D\", \"9:0C:0C290DB00E\", \"255.255.255.255\", \"CFE.B65.B65D8G2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"2.5.20.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \":6G::6E13G988B5\", \"C46195G8G04:7.D\", \"1D40653FFA9E1D4\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"154:33BB..6D241\", \"0:0::0:1\", \"DD7462A4:63:4C1\", \"B3974F968AFB47A\", \"452CC9C2D267D72\", \"A3326B1F.06:E20\", \"300.0.0.0\", \"G947:DDBEG:7F8D\", \"9F:914462D2.F:D\", \":030.E5214E:DEF\", \"C:B3140176C879B\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"3A0AE81F2D4CDGA\", \"127.0.0.1\", \"::1\", \"127.2.3.4\", \"7:67B0B1C8404E.\", \"06AAG54CD.E7F9F\", \":.34B222E5A4A1F\", \"127.2.3.4\", \"0::0\", \"592849E:52.2.C4\", \"::/0\", \"75004542C6A7D.4\", \"720GA4480.A71E8\", \"0.0.0.0\", \"0::0\", \"FCEE5404CGDG4F3\", \"6.A2.124777777F\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"A95DG4G30A0220F\", \"0.0.0.1234\", \"250D7DBEG700628\", \"15.06E6G5B6F.F9\", \"0::0\", \"0:0::0:1\", \"D91.:D.C3DBGC43\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2.5.6.2\", \"127.0.0.0\", \"2\", \"2.5.20.1\", \"2106F7.2DC4:5G9\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"E98:0AA3G6B7AG3\", \"A4AA5F1CABF6F62\", \"BCF9F5523:CA6B.\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"1::2::3\", \"1::2::3\", \"0:0:0:0:0:0:0:0\", \"9GEE6B5364568G1\", \"::\", \"2:E2G3:00789G98\", \"094G:33GA3CEEFF\", \"::\", \"127.0.0.0\", \"1CB8122438677:D\", \":::4\", \"6:G35C24D8.9241\", \"EFF4649.B766706\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"8F60D.AB90:794G\", \".4C7F5029001B73\", \"CF3FC3.G0E..7.7\", \":E60BC7FC4F399G\", \"0.0.0.0\", \"0:0:0:0:0:0:0:2\", \"300.0.0.0\", \"127.2.3.4\", \".G2.F76.3DD:4:8\", \"127.0.0.0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"801C8EF897:1576\", \"0:0:0:0:0:0:0:0\", \"::1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"::2\", \"::2\", \"0:0:0:0:0:0:0:2\", \":A85E0418CC026.\", \"255.255.255.255\", \"0::0\", \"0:0::0:1\", \"127.0.0.1\", \"0B914:0G94FFF43\", \"127.2.3.4\", \"B7EAD59881.5E..\", \"69A06C9G8CGG.A3\", \"10EEF26FB7E915:\", \"A0G9C802.A17CBE\", \"2.59.6.2\", \"27B857E0FEG1G3G\", \"BF5C2AD401324DD\", \"1::2::3\", \"    127.0.0.0    \", \"255.255.255.255\", \"EGEG69B71A34A55\", \"1C20230DFD:8G5E\", \"EB931:F5F9DD84:\", \":::4\", \"::\", \"::\", \"127.0.0.1\", \":::4\", \"1::2::3\", \"A4C868CC:.FAADG\", \"F6.13G5G6GFD135\", \"CE:.G8B6FDC96AE\", \"::/0\", \"551G857GC477:CG\", \"0:0::0:1\", \"2.5.6.2\", \"2\", \"G7A7FADA..2B59G\", \"127.0.0.0\", \"6F13D:705E11C06\", \"A4.57.B0GA.G:2.\", \"13C14FA279E23E3\", \"318G08741428E.1\", \"F9E55D48C55222A\", \"5DAC4:5EG691C91\", \"127.2.3.4\", \"255.255.255.255\", \"0:0::0:1\", \"127.0.0.0\", \"DGCB251:2A32B:5\", \"CC2:F437B6:234G\", \"0:0:0:0:0:0:0:2\", \"FG64CE:40F0E31A\", \"0:0::0:1\", \"058FD58ECC63409\", \"398A8E8CF4:6FD3\", \"E3D64GB.AGDC2FE\", \"GEAE0F23F821A6.\", \"0.0.0.1234\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"7CD0:1:2G3944D6\", \"F15B5.DAE2FA758\", \"2E236B74:0A6:2E\", \"3:5::08G8ADF26:\", \"D225B9AEE93G3A8\", \"0:0::0:1\", \"15A0.484:..893G\", \"::/0\", \"043F.D9536G58E6\", \"0:0::0:1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0:0:0:0:0:0:0:1\", \"::2\", \"D6.68BD9247EBB.\", \"2563E5718E4056F\", \"2G:D9ECG15C.G03\", \"::2\", \"D980G301FG15D74\", \"0::0\", \"1.26:953A6A7FED\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0.0.0.0\", \"6DC2G7D:3.A6G:F\", \"458B8G2DBD89G.E\", \"CA200CC806A0CCE\", \"::/0\", \"2.5.20.1\", \"127.0.0.1\", \":6C2BC4EBD9CD68\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"BBEB1EG5A.C6949\", \"1::2::3\", \"0:0::0:2\", \"::\", \"2.5.20.1\", \"::2\", \"9E..B676876A:92\", \"::1\", \"::1\", \"::\", \"F3DD2.GG..B11BE\", \"F048B2AA.1E107G\", \"::/0\", \"EG1CC171978D9E.\", \":C27GE33D1E1388\", \"810E3C70A2FB1.8\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"E2G2505EGAG3.B7\", \"2.5.20.1\", \"B61CC287B9.5A3G\", \"2.5.6.2\", \"EG:AG5316G30865\", \"1::2::3\", \"B53B8:951631AF2\", \"192.168.0.1\", \".33.G998G9AF8C9\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0:0::0:1\", \"0:0::0:2\", \"2.5.6.2\", \"5025C4E26AE4G73\", \"    127.0.0.0    \", \"0:0::0:1\", \"CFAG717D0CE3AB2\", \"73D2F071..9727B\", \"0::0\", \"0:0::0:1\", \"DGG03C284672105\", \"0:0:0:0:0:0:0:0\", \"127.0.0.1\", \":B55E.B.EE1716B\", \"1801GF42B.G2D.E\", \"DA82.AA6B7:1B:.\", \":::4\", \"0.0.0.1234\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"924.ADB3A::FD10\", \"0:0::0:2\", \"15D3.101F71:146\", \"D1E0::EECD1DD.G\", \"8ADG6A2317AF2A8\", \"2\", \"1G6B47D3F3222.9\", \"A955CA8C3C647G3\", \"255.255.255.255\", \"999462.404AFDE1\", \":223D8908FC2CC0\", \"EC6:BF9295B9F3G\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \":3C41F2218BF::.\", \"8GBE42A11D713CF\", \"F3.73.GF3A.F8:6\", \"    127.0.0.0    \", \"255.255.255.255\", \"::\", \"70:4ADB2E8GA11D\", \"0:0:0:0:0:0:0:0\", \"0:0::0:2\", \"7CGFFBD4B4944F1\", \"9FCA0A8::708:01\", \"255.255.255.255\", \".BFB.320G44AFFC\", \"2.5.6.2\", \"EE5:G2::F5EAF:0\", \"AC002.0EG:E623F\", \"300.0.0.0\", \"2.5.6.2\", \"5.G170:0BCDD6A9\", \"127.0.0.1\", \"86G511420GA78::\", \"282D96G0D0.5589\", \"D7A0GFGBDFF0:D:\", \"A3.4EFA844:5591\", \"300.0.0.0\", \"0.0.0.0\", \"DBA1B29:612BC55\", \"1::2::3\", \"5:FD.70E27E108C\", \"C8E9GD802159278\", \"1::2::3\", \"E98.89.FDC49549\", \"1::2::3\", \"ECE49A98788C07G\", \"BC075896005GFB8\", \"0:0:0:0:0:0:0:1\", \"127.0.0.1\", \"143E70EG2A442C1\", \"192.168.0.1\", \"6GE3A:8B5.A509.\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"D553.22C77922:B\", \":C24EB291F:572B\", \"C07CB9G9:5C..1F\", \"AG5A32:6FAF34C8\", \"E8710EBD7665G3C\", \"::\", \"417E68A99A::GD2\", \"::2\", \"    127.0.0.0    \", \"7A2B4ED4GE:DBG5\", \":::4\", \"4AE5B6BE449134G\", \"AG66CABF048FF97\", \"300.0.0.0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"1::2::3\", \"BGGB427F11BGF12\", \"6178G:44G100BC0\", \"127.0.0.0\", \"FC17618GCC26881\", \"127.0.0.1\", \":7:115BD9246448\", \":DC163775.25B9A\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::1\", \"5598:FC4D5.44D:\", \"::\", \"ABFA:G65CD29EGF\", \"    127.0.0.0    \", \"9E.DEG35E21C9F1\", \"2:CD.CF:63CE:9B\", \":A39B1DE:7:AGFG\", \"0:0::0:2\", \"ECGCD16.429E8E5\", \".A54E7AAE:8E3FG\", \"A.B76BA:CG3A0DE\", \"G.80B0.1594DA1E\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \":::4\", \"0BB9E84895GEA4A\", \"03GB.15.9.AG860\", \"0:0:0:0:0:0:0:1\", \"2\", \"D::296FB51871DF\", \"7EA3CBE60AD4576\", \"    127.0.0.0    \", \"9957:8:7:FBG656\", \"AGE72BE470CB55A\", \"284E368FGF0E6E6\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"127.0.0.1\", \"0313AA:E4A250:B\", \"::\", \"::2\", \"4C9G74.CGD75124\", \"::1\", \"0.0.0.0\", \"2G.F2124G.751.9\", \"0.0.0.1234\", \"::2\", \"AA5559398CGBE3A\", \"0:0::0:2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"02DE930756C164D\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"127.2.3.4\", \"127.0.0.1\", \"192.168.0.1\", \"ADD62179A:FB6.4\", \"::2\", \"07:AC95AE024C29\", \"2418:DCF7992554\", \"GEDCEG4DDG:5FFG\", \"A2F00F0.29.3444\", \"0.0.0.0\", \"E:.0.968.63F8C6\", \"C.:F57E1655740:\", \"192.168.0.1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"000F8.82685GB4B\", \"2E7CB365.DE.CA1\", \"2C2.7F5D7E86DC1\", \"41GD800DA1AC881\", \"7366AD9B5050674\", \"::2\", \".65332A5B7G.5E4\", \"6CE9DBDBF04F0BC\", \"836131ADG411.93\", \"2.5.6.2\", \"B14F7CEB:91D170\", \"0:9:D11FB3:GBGE\", \"9:427.4909A73F0\", \"2\", \".F:6731998:9FG8\", \"0:0:0:0:0:0:0:1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0:0:0:0:0:0:0:2\", \"3CG2A761GE291A3\", \"2.5.20.1\", \"::/0\", \"127.0.0.1\", \"93GG1:04465.6F8\", \"GA17GD29765.038\", \"127.2.3.4\", \"1D18A453BFCC2FE\", \"0:0:0:0:0:0:0:1\", \"127.0.0.1\", \"127.0.0.0\", \"G4B283DE1G46090\", \"86226B63B3DG398\", \"::\", \"4A2F8F651EB8F98\", \"4:4.8:BF0EDFAC.\", \"F2718D6B92A831F\", \"0:0:0:0:0:0:0:0\", \"127.0.0.0\", \"EG9A8.D2A373DCA\", \"046B8A63859C3:1\", \"9C5A8.3.:3.EFB7\", \"24FA03ED72A2A04\", \"0::0\", \"54BG:F06A53B:28\", \"G268B3E1:255:68\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"GF1550FDC.::36G\", \"    127.0.0.0    \", \"127.0.0.1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2.5.6.2\", \"0.0.0.0\", \"::2\", \"0:0:0:0:0:0:0:0\", \"0:0::0:1\", \"0CB3AA:A9AG76F0\", \"B2E.26G71:.B9C8\", \".264904D211BGB6\", \"127.0.0.1\", \"127.0.0.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"5GAA97672DG.0D7\", \":::4\", \"127.0.0.0\", \":::4\", \"7:CF1C935B5043.\", \"2.29836A341:4GG\", \"0G1AC6C.07DC.AC\", \"::/0\", \"4288D1BE7:57297\", \"46G26B9AB67A2:3\", \"0::0\", \"3.70F4DD87F55G.\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"CEA0BBG1:F190.5\", \"1::2::3\", \"127.0.0.1\", \"3GC37CB2G3DC5:B\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2.5.20.1\", \"93E0AF6D5D72.B3\", \":4F.DEC80B.BGE1\", \"CD72:C14G5D2..F\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2\", \"0:0::0:1\", \"6GGCBC102797:B7\", \"1::2::3\", \"2A:0DED6.3AG36D\", \"F96D.1:D10BF7AA\", \"127.0.0.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"D6B685791DC61A1\", \"::\", \"2.5.6.2\", \"E7405C.5AF7:57G\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"1:22G8D1E2.4:97\", \"51F7G89.C05:E54\", \"0:0::0:1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"97C9GD93F73F9ED\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"127.0.0.0\", \"300.0.0.0\", \"F01D688BBBB7G92\", \"DF358237A.CD:D7\", \"G8BAG13:3751128\", \"0::0\", \"3F:0AC0880.0515\", \"99F8D42253DE2:A\", \"255.255.255.255\", \"81942B.3A75DE3A\", \"0941D.:67.D:325\", \"0:0:0:0:0:0:0:1\", \"::/0\", \"127.0.0.0\", \"192.168.0.1\", \"127.0.0.1\", \"::\", \":::4\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0::0\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"858750B0EEFC1.9\", \"2\", \"::\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"880.E1G84A07G67\", \"GB6F5265B2:6G:7\", \"127.0.0.1\", \"127.0.0.1\", \"300.0.0.0\", \"B5376E8GC6:7288\", \"2.5.6.2\", \"CE006::4181D8AC\", \"77C.2A872E93EC3\", \"300.0.0.0\", \"192.168.0.1\", \"EF:.25733077G72\", \"::/0\", \".10AC6839::G845\", \"0:0::0:2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \".C4:2:27E:5.FF9\", \"2.59.6.2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"7A4E17.989GG1CD\", \"DA5.38DCDD7E076\", \"1G02GGFB:AF52CB\", \"3E993B5.:953485\", \"22B5639148420:1\", \"300.0.0.0\", \"0FE693F4B2B:80C\", \"72CFE634B:DDF05\", \"::\", \"2.5.20.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0:0:0:0:0:0:0:2\", \"1ECAAEE35G6E620\", \"A5EC8225160D858\", \"8:9BBG4F4D93956\", \"0BC2.1D4FDF9DG4\", \"0:0:0:0:0:0:0:1\", \"127.2.3.4\", \"300.0.0.0\", \"0::0\", \"255.255.255.255\", \"B.1D8EF6AEDGG94\", \".3G055C1F0F5983\", \"D57EGD3F4759D.G\", \"0:0::0:2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"838.5.EE.2CC:01\", \"5C562DAD86G9EG3\", \"1230.7:37.:FBC7\", \":::4\", \"127.0.0.0\", \"300.0.0.0\", \":::4\", \".395GB06C15F4G4\", \"0.0.0.0\", \"2.5.20.1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0.0.0.1234\", \"0:0::0:1\", \"G:A:GC53056745E\", \"E9E.E8A1122EB1:\", \"C:87GFE:B4F082B\", \"255.255.255.255\", \"2.5.20.1\", \"51F:::D6528A406\", \"2.5.20.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0.0.0.1234\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"127.0.0.1\", \"EG.7C52962EGA2B\", \"0:0:0:0:0:0:0:1\", \"2967..BC61FA986\", \"0.0.0.0\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2.5.6.2\", \".6347688FB924.9\", \"1B7E97AE39FA8.B\", \"127.0.0.0\", \"AE0AAD.AG3F3559\", \":::4\", \":BD8FDFFEG29.1G\", \"261D258F26BDB66\", \"3E5A58A6.280D5F\", \"CEGC553F9650GE6\", \"127.0.0.1\", \":::4\", \"D9C77A3F.401E8E\", \"F00.FBF3A902032\", \"0.0.0.1234\", \"C4974B09D569BEC\", \"0:0::0:2\", \"0.0.0.0\", \"D2EA417143C84GF\", \"192.168.0.1\", \"736BF95:8GFE915\", \"6193EA78E7.1BD6\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"1::2::3\", \"8:D1:FC1C8F8EG.\", \"BB878D925DEEC76\", \"4.:BB81..9FFC:G\", \"127.2.3.4\", \"127.0.0.0\", \"::1\", \"::\", \"2\", \"300.0.0.0\", \"C4D:8G.4.EE1FEB\", \"406327D.86D5010\", \"E0291D83G:961F8\", \"127.0.0.0\", \"0:0:0:0:0:0:0:0\", \"76CFG884A45DF7F\", \"0:0::0:2\", \"DD257D406958650\", \"0.0.0.0\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0.0.0.0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0.0.0.1234\", \"::1\", \"300.0.0.0\", \"A7.83E417.FB8CA\", \"127.0.0.1\", \"4.E.EF81.CF.E3F\", \"G.0EB86::3AG8E0\", \"    127.0.0.0    \", \":::4\", \"127.0.0.1\", \"::/0\", \"EG5.EC09CECA:AF\", \"D0540464FG.09:E\", \"1244:7.25D70G00\", \"3AA9G2G2GA26EF.\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"4C62GBA1CAG1G3F\", \"0095B1631773G45\", \"0:0::0:1\", \"0:0::0:2\", \"300.0.0.0\", \"2.370EDDB55:CE7\", \"0.0.0.1234\", \"0:0:0:0:0:0:0:0\", \"80B75G44B6872E1\", \"::2\", \"522647460.8G:74\", \"2.59.6.2\", \"6F2F4:D0F9EBF7G\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0.0.0.1234\", \"0:0::0:1\", \"0:0:0:0:0:0:0:2\", \"2.59.6.2\", \"127.2.3.4\", \"2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"G0B8A.736BA35G7\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"7FC:BG75BF4.D3G\", \"::1\", \"127.0.0.1\", \"B94EA.F:7EA98EE\", \"3E6ACBC78.:7:0G\", \"5G206CG5D..2FF5\", \"0.0.0.0\", \"0:0:0:0:0:0:0:2\", \"127.0.0.0\", \"EFG4GE01229EF12\", \"2.59.6.2\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"::\", \"127.0.0.0\", \"13F24E:17624D.A\", \"127.0.0.1\", \".:7G0:37G9D93AG\", \"0.0.0.1234\", \"::\", \"3G897693:5CG47B\", \"37EDED5:B:9F0B0\", \"2.5.6.2\", \":::4\", \"7AF6:G6F:192DBA\", \"127.0.0.1\", \"127.2.3.4\", \"77913426B1C0707\", \"0:0:0:0:0:0:0:0\", \"523726C73D69748\", \"GGC2CA7340:.2E8\", \"3F9171042262BA9\", \"199229CA1B6:CD9\", \"8B924A:F233E069\", \"127.0.0.0\", \"192.168.0.1\", \"0.0.0.0\", \"E197BB.3ED0DB25\", \"C9467GF4F7E8748\", \"E13::0456D.50D7\", \"0:0::0:2\", \"A2:50FGD:9.685F\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0::0:1\", \"47000AC820.90F8\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"::\", \"127.0.0.1\", \"4:F98ABE4AF4E87\", \"1C7GC:B2GF36191\", \"0.0.0.1234\", \"0:0:0:0:0:0:0:1\", \"13G1F489BG5F49A\", \"127.0.0.1\", \"AC3DF4ACD51E8D1\", \"839:.4A4E3G217.\", \"0:0::0:2\", \"GAB937CE2:1C607\", \"F3E7531F79G126:\", \"300.0.0.0\", \"48F80D2140.0518\", \"1::2::3\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"G2B310CCBFGG41G\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"B.:8C5BF2C43748\", \"89:..6:6068G2DA\", \"7:D88429.D:81.G\", \"D09DD.FF0:37E1C\", \"A41F.0AF3E9746G\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"E8B0E2B0D.39:DB\", \"GDE2.86EB42C:F7\", \"127.0.0.1\", \"58:6:C755B34757\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"6:.7F3F387F.7FG\", \"127.0.0.1\", \"A:50:D65ED1B7FF\", \"::1\", \":A2.38:BGF707BA\", \"EE92AB4F731E98.\", \"7:7FD5B.807B1.9\", \"127.0.0.0\", \"2.5.20.1\", \"0:0:0:0:0:0:0:1\", \"G79BGA.C:02GF5G\", \"0.0.0.1234\", \"0:0:0:0:0:0:0:1\", \"E03A.B73ABFC9B3\", \"    127.0.0.0    \", \"0::0\", \"0:0:0:0:0:0:0:2\", \"F690C12E502:790\", \"::\", \"8:E5BFB0ABB.242\", \"54:.849G87B686A\", \"9B44A7885E.:980\", \"0:0::0:2\", \"FC866A45.1174G8\", \":F1326CB863E5DB\", \"00E5C3D17D90GB4\", \"127.0.0.1\", \"D96F8.916BDDEA9\", \"::1\", \"04ED1E65FF49B4A\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"::\", \"1::2::3\", \"0.0.0.0\", \"112:812ED:1D93.\", \".C45194913583D3\", \"G441C2B.0D75:87\", \"::1\", \"0.0.0.0\", \"82CCAAEG685:A:F\", \"0A674CE:.276B3D\", \"C3ED5DFEED8E2C3\", \"9G:DEA74EAF.BAE\", \"::\", \"GEGB.:A.3ED.580\", \"127.0.0.1\", \"2.5.20.1\", \"5FG43BF3G32037E\", \".B.D:G1F::811BB\", \"1::2::3\", \"0.C1AE211431A.E\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0:0:0:0:0:0:0:1\", \"565B81115A42966\", \"0.0.0.1234\", \"192.168.0.1\", \"::1\", \"5GD2.53G4FA3:D2\", \"::/0\", \"97A9C505D5749F6\", \"F1D6A4F7.4CDB82\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \".9251..BE013717\", \"E50497D20EG3B9B\", \"0.0.0.0\", \"0:0:0:0:0:0:0:1\", \"::/0\", \"G154F2BG40CA:G.\", \"0::0\", \"0:0:0:0:0:0:0:2\", \"2.5.20.1\", \"0:0:0:0:0:0:0:0\", \"127.0.0.1\", \"C6015G.11FE0572\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \".F5DE7721E7AFG1\", \"    127.0.0.0    \", \"0::0\", \"    127.0.0.0    \", \"8FFGAAE249175AE\", \"CGF0421:6C7BD.9\", \"37ED9..7798:1G.\", \"9D57A1B8GD0885B\", \".:3:3B:7A2550E1\", \"2E1G061G23E668B\", \"7G0.A995D73A340\", \"0:0:0:0:0:0:0:2\", \"::\", \"0:0::0:2\", \"::\", \"192.168.0.1\", \"1::2::3\", \"0.0.0.1234\", \"127.0.0.1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0::0\", \"127.0.0.1\", \"GE.1.6CG416.2C5\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"CF078G2.B95:FG3\", \"A2E5.67E5E7C63:\", \"2.59.6.2\", \"::2\", \"BA04DD.2E8B337E\", \"::/0\", \"127.2.3.4\", \"2\", \"1G17E57E6EA4A:D\", \"08AEFGA66..5.5C\", \"    127.0.0.0    \", \"300.0.0.0\", \"BD5D3.654D41:7F\", \"::2\", \"127.2.3.4\", \"27C74A53DF0AA0D\", \"9F4E6BF9B:315:7\", \"::\", \"4AE1G2..7:B658F\", \"E28.BG00GAD5481\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::2\", \"2.5.20.1\", \":4A2341C58BGF43\", \"2.59.6.2\", \"GE2D8..7396D947\", \".116.691:114F7:\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"G4.G80946F9:675\", \"    127.0.0.0    \", \"F7F253ED0FEF.25\", \"3755192B86EC4G7\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"552D30GB2BEG9DC\", \"1::2::3\", \"255.255.255.255\", \"F253FDE30G:B498\", \"GD110G9GA08.0C9\", \"4A:GCD3D8647F88\", \"C.38:31A.1E:G02\", \"2.59.6.2\", \"127.0.0.1\", \"127.0.0.1\", \"5A92708D0B79794\", \"8FD5A8G42205D:6\", \"G53118:ED475GGD\", \"0.0.0.1234\", \"0:0::0:2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"192.168.0.1\", \":24657D1FC.2G7C\", \":08586:0EB643C0\", \"::\", \"127.0.0.1\", \"0:0:0:0:0:0:0:1\", \"::\", \"FC7047035613BA7\", \"A..C12:61C:3FBB\", \"0:0:0:0:0:0:0:2\", \"BCCA82335.CF7F5\", \"EE6EG4:3AF5F745\", \"4GG652DA64F7FD8\", \"127.0.0.0\", \"127.2.3.4\", \"127.0.0.1\", \"44AA0.6C1F81ADB\", \"2\", \"BA4989GAA6454AC\", \"D.8F292648.1DG3\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \".86.GE011580A.8\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"G4929.1754A726F\", \"39ECA62E70AG288\", \"501F:C55749G50A\", \"2.59.6.2\", \":60075GD.0AG433\", \"    127.0.0.0    \", \"F.F93F7B:06359E\", \"::\", \"C7557E53:55A2G2\", \"C:GA3B.G8.9EBF7\", \"A5A7G:.4165F7B1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0.0.0.0\", \"7:GE::53B11GC25\", \"::1\", \"B506.13599GCGDG\", \"3F69B:.C8685056\", \"0.0.0.1234\", \"0:0:0:0:0:0:0:2\", \"66AA34811C495B1\", \"127.0.0.1\", \"D2C30EFG989F374\", \"3071C3CDFC8E..D\", \"69GB44GD.19G12C\", \"9G.C555D801.4::\", \"127.0.0.0\", \"127.2.3.4\", \"2.5.6.2\", \"0G5:215441:A095\", \"2\", \"9981D:20016F:DD\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"1::2::3\", \":::4\", \"9CDBCEE.GGE69F3\", \":CCEC6486F708DC\", \"0::0\", \"DAF8E24D5BE3C:.\", \".A83B1GAC:5.DAE\", \"1D45.:96:24G99A\", \"::1\", \"0:0:0:0:0:0:0:0\", \"D543702EGG03G5A\", \"CE:C5D.71C12A:7\", \"::2\", \"1::2::3\", \"2.6GC6E3:71G3E2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"C5:DGB3F716:G7B\", \"2:E7BC57GF643DB\", \"2.59.6.2\", \"1::2::3\", \"0:0::0:2\", \"C5F7E1986:6.264\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"GAE65GC846DG.B4\", \"B77AGE51E83G..1\", \"::1\", \"0:0:0:0:0:0:0:1\", \"::1\", \"127.0.0.1\", \":A59D52D211:.B4\", \"0:0:0:0:0:0:0:2\", \"::\", \"127.2.3.4\", \"127.0.0.1\", \"1G0:41FDG9846.0\", \"C4::66G4E.GAGF8\", \"5:E3:D596.3AAF0\", \"0:0:0:0:0:0:0:0\", \"1::2::3\", \"66DB46.FA33E7:.\", \"6B92774966529EB\", \"2\", \"2.5.6.2\", \"A3A66B781EED48E\", \"8B.CA4A6BE08074\", \"EBCE337B8GEE1.E\", \"67:F5B1BB84E.37\", \"127.0.0.1\", \"127.0.0.1\", \"0E4F5:7:.50A5EC\", \"0:0:0:0:0:0:0:0\", \"8C5:E0320GE75.A\", \"A8:G6.FAFA6:548\", \"2\", \"::\", \"DA6180D7160F440\", \":24D15B07E1D23.\", \"127.0.0.1\", \"::2\", \"81000B:57C97C7C\", \"EG.E227.CF17A59\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"2.59.6.2\", \"BC3201C86731:E2\", \"B63592E7DD288C5\", \":81FG418B14E28C\", \"23:C13CC:C05629\", \":6DF.EA35550GD3\", \"127.0.0.1\", \":414358G9802A40\", \"192.168.0.1\", \"23E5FF66799F219\", \"D071:AAD2.5F:C:\", \"920AFF3:6D62F07\", \"2\", \"::\", \"0:0::0:2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::2\", \"0:0:0:0:0:0:0:2\", \"127.2.3.4\", \"0:0::0:2\", \"2.59.6.2\", \"E33E1FA9027E.D:\", \"3GD8GAG9239GEA7\", \"29GC4C0A:.267B6\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"6.1B46A6D2E37A0\", \"::1\", \"    127.0.0.0    \", \"    127.0.0.0    \", \"089951DA192BD45\", \"5823GB:E6AE9998\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"127.0.0.1\", \"C78B3D1D1:318.A\", \"::\", \"660D78855FCEA78\", \"FB83B9G1F35DBAB\", \":D04D716B2A744A\", \"::\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0:0:0:0:0:0:0:2\", \"86.B.B9D4D869.7\", \"0:0:0:0:0:0:0:0\", \"4EF1G.G831362B7\", \"7::3E1GG9C43FAD\", \"::1\", \"0.0.0.0\", \"9B9EC1.7B.B.0D9\", \"127.0.0.1\", \"0.0.0.0\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0::0\", \"2.5.20.1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::2\", \"B408::7EC1AG120\", \"192.168.0.1\", \"300.0.0.0\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"7459G.GCG14.D93\", \"0.0.0.0\", \"2.5.6.2\", \"09817EGF2FE:B9F\", \"192.168.0.1\", \"0:0:0:0:0:0:0:2\", \"0.0.0.0\", \":C.26EAD46152BG\", \"::\", \"0.0.0.0\", \"127.2.3.4\", \"::\", \"341B8B7566CACD7\", \"96:DB45:6.64C3D\", \"2\", \"DD1.141C56E896D\", \"127.0.0.1\", \"6166C4E.9:F6035\", \"::1\", \"0.0.0.1234\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"93C20C785CG8C.8\", \"1FB1.DDFD99AA:F\", \"192.168.0.1\", \"5C82BC684135:4E\", \"D618.E004805D03\", \"300.0.0.0\", \"773632322A34GA.\", \"127.0.0.0\", \"2.5.20.1\", \"CA3:2F402394B61\", \"GA31CE07E:1D8.3\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"6DDC2:GA8BBAD0A\", \"0:0::0:1\", \"D26.EFGF1F63F7:\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"092.4A3G1G7D1G.\", \"::1\", \"E0D5E64CDFDD640\", \"0:0:0:0:0:0:0:1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \":::4\", \"255.255.255.255\", \":::4\", \"4:353:F6F5CECAC\", \"EGA72B11G1D632B\", \"0::0\", \"DB4144G0.:5FAE1\", \"0::0\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"BAG35A2CB4D4FC9\", \"E:16C0584CGCFG8\", \"B79AEDD24E1501B\", \":::4\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2.5.6.2\", \"1E9G216DE90408F\", \"0D3197A7.4:721A\", \"0:0:0:0:0:0:0:2\", \"::1\", \"A.G6C5085A9DEG:\", \"4751:A77C0A4CAF\", \"2\", \"6C:D212C6A5.30.\", \"255.255.255.255\", \"63E963:.CEG29FG\", \"G.0GGCG43BE2CAB\", \"::\", \"A.G2046.89EGF6F\", \".01:.5D1C35GA08\", \"127.0.0.1\", \"127.0.0.1\", \"4B8B3D3A.E8G687\", \"17C8FD515:BECBG\", \"F5C1G347C56.98E\", \"2.5.20.1\", \"6FF6BA65E0FGD:A\", \":::4\", \"    127.0.0.0    \", \"573C6791A1A7A6B\", \"A349B:E47EFD2A7\", \"0D75AE:FA67CBD3\", \"E95C3E60197ADCF\", \"127.2.3.4\", \"0489C122858:73:\", \"70BE92CC6F.CG40\", \"740C7CEG3G:G19D\", \"..D4:75B7GG946B\", \"2.5.20.1\", \"192.168.0.1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"::/0\", \"127.0.0.1\", \"255.255.255.255\", \"3970:CGEDFA7CF9\", \"73B5F16E.6:G063\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"B24F9CGG04:39GE\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"F60:71.817942CB\", \"127.0.0.0\", \"221DC:A93255.GA\", \"192.168.0.1\", \"127.0.0.1\", \"1::2::3\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"127.0.0.0\", \"2.5.6.2\", \"D5D724EFBBGABB8\", \"0:0::0:1\", \"2.59.6.2\", \"C69GG75BG15:1:0\", \"::/0\", \"192.168.0.1\", \".8D29A.B477881A\", \"0:0:0:0:0:0:0:0\", \"0.0.0.0\", \"127.2.3.4\", \"033A9.0766D52D7\", \"5G3.4:GFD752A6.\", \"127.0.0.0\", \"127.0.0.1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"00B9.171EB783E4\", \"::/0\", \"96CE803.91EF1:1\", \"127.2.3.4\", \"    127.0.0.0    \", \"5D8A647C:7F27CE\", \"8D0F2D:.1BA9091\", \"    127.0.0.0    \", \"DFDF113673:FF3D\", \"9B9722:7A:5BE9D\", \"300.0.0.0\", \"9288GCG468339:G\", \"9D..BECC.0.GDA9\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"124C0DB8B.8A8C.\", \"AAD6.3F5A4451BC\", \"127.0.0.0\", \"::2\", \"300.0.0.0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"93997E4.8E183CE\", \"1::2::3\", \"127.0.0.0\", \"4D8F90E1G7C6:CC\", \"E722C5:834G6:05\", \"300.0.0.0\", \"0:0::0:2\", \"4BDDB3573F51GFD\", \"CG8EG:476653:A6\", \"0:0:0:0:0:0:0:0\", \"EAD8G93BDD667E.\", \"1.7GB84G0DB9AB8\", \"0:0::0:2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \".500GFE:0GD28A4\", \".5326FE.ED536G4\", \"0:0:0:0:0:0:0:1\", \"192.168.0.1\", \"127.2.3.4\", \"6FDEC0528.6D:87\", \"::\", \"2\", \"2E4C657GB4C8.C2\", \"::\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"A1A9:BF1G43.3:2\", \"DD9C490.AB5F1.5\", \"951.1:188DGE1EA\", \"0:0:0:0:0:0:0:0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2.59.6.2\", \"4D9279E0A96G9:1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \":::4\", \"::1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"G1FG88E.:DF.6E0\", \"5E2.2B:.E6DCA26\", \"::2\", \"0:0:0:0:0:0:0:1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \":9AA0C7G5911E0E\", \"127.0.0.1\", \".1G23A06B8G6F29\", \"F685125BA0F:062\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \":AF3E.3.E.8:G26\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"255.255.255.255\", \"::/0\", \"::\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"9..46C5FD07:B6F\", \"E552EF6C0B7DC5A\", \"2\", \"53A6D8BD671GF38\", \"7D823F800C49EG6\", \"C77776:FE27CAF8\", \"0.0.0.0\", \"8.FD4.9:E.FFBF8\", \"40.00C7:34F0FG4\", \"3ADB9C40::3G9.3\", \"2.5.20.1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2.59.6.2\", \"127.2.3.4\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"2.59.6.2\", \"E.517G9:AA1218F\", \"0:0::0:1\", \"300.0.0.0\", \"CD3905FE6F2.:5:\", \"EE52E8E893DBDAB\", \"B6E459:75504D.1\", \"10::BC8D2:5D5FA\", \"8DCG1B.4:0D35A8\", \"2.5.20.1\", \"6255FFAD87C2856\", \"127.0.0.0\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"127.0.0.0\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::/0\", \"E4G6G059G0.BA79\", \"DED5:C3:8344C2A\", \"0.0.0.1234\", \"9EFF5AD36G22D3F\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"AFA:A6GEG3D073B\", \"13D:4G305D3451A\", \".9F3EBG4907:E07\", \"6:020F44G806740\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"1BCG.C479C7:D8:\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"8.6FC820A19D7A1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"2\", \"C783D.02972G46C\", \"1GB50BB18591527\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"3GC51ED7C9E6:0D\", \"2.5.20.1\", \".9F0:95A014:CGA\", \"36538CED65:8D87\", \".4C0E..E7361982\", \"0:0::0:1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"413GC326AE03EAB\", \"530.674989.B3::\", \"::\", \"192.168.0.1\", \"942ADEGDA782A.0\", \"88669D5C8.BC7A0\", \"0::0\", \"2\", \"6168E59B3C:FB9.\", \"BG:G8518.:5:1.B\", \"    127.0.0.0    \", \"192.168.0.1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"FBEGC08A8BD9GF8\", \"35CE7878C1GA712\", \"7G9B783.12D.3E.\", \"192.168.0.1\", \"0:0:0:0:0:0:0:0\", \"0::0\", \"127.2.3.4\", \"C:5C:253.379G1C\", \"3G429E6889B.0ED\", \"B1:8563A05.443:\", \"2.5.20.1\", \"0.0.0.1234\", \"0354D2E0D2339:E\", \"192.168.0.1\", \"0:0:0:0:0:0:0:0\", \"F.0..FF6B926458\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"A96D510.EGEDG40\", \"633827EC5E17A2A\", \"::2\", \"0:0:0:0:0:0:0:1\", \"1::2::3\", \"14566E1D3GF40C4\", \"300.0.0.0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2\", \"7FBDE0168A1C05D\", \"52:05DC4D09F575\", \"946C5A224A5GG.2\", \"D8B863F0009:215\", \"1::2::3\", \"912F:52F.8E06G9\", \"5ABB79:96208C18\", \"3A0EA6ACG2A8062\", \"::\", \"    127.0.0.0    \", \"2.5.6.2\", \"7A73E1C7F8G264.\", \"97F420:C9856:49\", \"300.0.0.0\", \"0:0:0:0:0:0:0:2\", \"30F627:83EF64GB\", \"0::0\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"31B:F32F5495CA0\", \"0E733.G0250:EB3\", \"0.0.0.1234\", \"0:0::0:2\", \"1F143D8F0CDCAEA\", \":0.CGF35BFGA703\", \"::2\", \"0:0:0:0:0:0:0:1\", \"0G1358A0C1:9714\", \"6CFCF3F4E39:F48\", \"127.0.0.1\", \"BCF56:9CE6:2E18\", \"127.2.3.4\", \"::\", \"E37A156:5G09GB8\", \"F1AC6430A.41F3B\", \"300.0.0.0\", \"127.0.0.1\", \"..2C6D3A4C8382A\", \"300.0.0.0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2\", \"01A803B15F92264\", \"83DB0::.G326D59\", \"::1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0:0::0:1\", \"G:295C199A7:AE5\", \"509:037E24A6G:A\", \"0:0:0:0:0:0:0:2\", \"127.0.0.1\", \"::/0\", \"0::0\", \"008A1965403AA23\", \"2.59.6.2\", \"95E7B72BFC3BF70\", \"::2\", \"4CC0E74C0F7:B4.\", \"2\", \"4:GA.56A847C968\", \"3EBE7.6A2AC8FF7\", \"0:0::0:2\", \"    127.0.0.0    \", \"2.59.6.2\", \"2.5.20.1\", \"0:0::0:1\", \"0:0:0:0:0:0:0:2\", \"AF211GF5B4D52BC\", \"::\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"8A3:E0E16246D4C\", \"39755:A980.1B.A\", \"CAAF.6B8D8GBE5C\", \"::2\", \"73D29036E39G99D\", \"2.5.6.2\", \":::4\", \"::\", \"298B0052FBAADEA\", \":DB33E18DGADBAG\", \"0:0::0:2\", \"196.G55CB94:2GE\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"::/0\", \"127.0.0.0\", \"148C6:3GG1C.:88\", \":::4\", \"28840199B524DDD\", \"0:0:0:0:0:0:0:1\", \"2.59.6.2\", \"70B0D131B577AAD\", \"A09GGBD153BDE69\", \"0:0::0:2\", \"74569F1820AB692\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"33D7.880635B77B\", \"F71D32G10A571A:\", \"2.5.6.2\", \"11..B1DEC635871\", \"2.59.6.2\", \".ECF01F95BE2C8.\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"A.CA1D5AA5FFD1.\", \"0::0\", \".03487:G826GE22\", \"98:21:4855G3FE3\", \"CC0F46C8CGGB.1D\", \"2.5.6.2\", \"::2\", \"AEC35BF5:A82FA1\", \"8D015D2D070F.A:\", \"192.168.0.1\", \"300.0.0.0\", \"1D24C07:D6.D52G\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"218E:C33AG.592.\", \"255.255.255.255\", \"0.0.0.0\", \"7:013FED9G6329:\", \"    127.0.0.0    \", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2.5.20.1\", \"5455B:GE17F.82E\", \"AFFBD43EF4G7FAA\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \".B571A56B6.C411\", \"3EA02E2D7F40C1B\", \"64ABB1.44.:8AA2\", \"767F65FEE2:G6F9\", \"127.2.3.4\", \"6887G4D31D3CC15\", \"300.0.0.0\", \":4195BFE8B2CA8C\", \"0:0:0:0:0:0:0:1\", \"3F36F43.7272B:6\", \"0D2E2.587:A1BD.\", \"70C88CG983E563G\", \":A2887DAFBGG591\", \"03B59GDAC94E788\", \"DG94D1848241D42\", \"2\", \"C:C3GD2A.0ECF9E\", \":BG6C03:C.32163\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::/0\", \"0:0:0:0:0:0:0:1\", \"1::2::3\", \"0GEBE4DF93CB.B:\", \"236:F7733:D6704\", \"E.6F76.193CD.:9\", \"5G0G36E:.9B9DFC\", \"G5C5683BDDC91GC\", \"0:0:0:0:0:0:0:1\", \"A87956B:5FCBBG8\", \"7A8EGEA92F05D55\", \"0:0:0:0:0:0:0:2\", \"    127.0.0.0    \", \".7643512GD72D63\", \"D:1FE:GD:34A2D4\", \"127.0.0.1\", \"2.5.6.2\", \"2\", \"349F8C72E73F771\", \"13GG533D4AGB230\", \"1:DB6EB4DD6BE.E\", \"C.13G724G.BD:F3\", \"79C1A891C945935\", \"74.C7856GA299AD\", \"82A47CDG4:F7A95\", \"00A4CC05D77.:5C\", \"2.5.6.2\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"6G3435D:G21F:2D\", \"255.255.255.255\", \"1::2::3\", \"4B.:3:D674B4AE7\", \"563B3D7A9::911F\", \"0:0:0:0:0:0:0:0\", \"E587BD.9:1AF207\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"4D3F0E:4308:296\", \"127.0.0.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"2A3B23961A8F845\", \"62B65GD580B9:DF\", \"A08DE:.GD48376D\", \"28:118AA5391F3G\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"6B0397C..GCBFEG\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"127.0.0.1\", \"4062EC4B3G.8AGA\", \"19351978F14275B\", \"127.0.0.0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"127.2.3.4\", \"255.255.255.255\", \"5A1A7EAFGFD4C01\", \"GC8.80018B:2ACB\", \"191399BD:F0G6G:\", \"1632F0:E630958F\", \"998C592G:6CABD3\", \"065A4BA9A7:9A01\", \"2.5.6.2\", \"2\", \"A11A3:5C8C1B8CF\", \"::2\", \"::/0\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"192.168.0.1\", \".C294E7:F1C10:0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"3:C05:EAB7CFG58\", \"CDAGAA43509C6:8\", \"G45G48D6870G041\", \"::1\", \":BE0A.1884E379G\", \"7C66C.B5681BBD9\", \"BCG519A07AG9E61\", \"98:G2.B4G05A.6A\", \"2.5.20.1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"B.D2F55157969E1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \":50E8.A0FFC23:1\", \"0.0.0.0\", \"3279296B11506:3\", \"2.5.6.2\", \"2.5.20.1\", \"300.0.0.0\", \"3ED82G4.4.1F99A\", \"00F6.5.21E8A846\", \"5687F4B.D9FGGD5\", \"F1E7.E67B49.F6F\", \"1AF42E927510084\", \"2.5.6.2\", \"GB6D9B2GAD8G797\", \"::\", \"0:0::0:1\", \"DBGA:351A63729.\", \"2EF3E733C785488\", \"2:1FA9CCG154A6E\", \"::\", \"::/0\", \"2.59.6.2\", \"6G.1A77FBD5.4E.\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"EE0CF:5EA0F74E3\", \"G6G73EEB6337BA.\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0:0:0:0:0:0:0:0\", \"::\", \"2.5.6.2\", \"2\", \"2.5.20.1\", \"359723122.3.8E7\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"    127.0.0.0    \", \"A3D9:2815EF2031\", \".18FG4GE9E7G784\", \"D6.2G04CB:11A21\", \"F7786FEG4459:EC\", \".E7:EFE10A9EGC0\", \"2\", \"624GAE024AEE150\", \"6C0C41A81.45E39\", \"A90:9196F2E424:\", \"B:E:4G7ABG.F25D\", \"2:F500.A2DFF608\", \"4DFFG0G8F817EGE\", \"3E5766BCBF9BF1G\", \"    127.0.0.0    \", \"FAE86E295094.:G\", \"0::0\", \":GADC6.1:B:6FBF\", \"11BE78E5B4A8FB:\", \"DG.4D865F.95A59\", \"0:0:0:0:0:0:0:0\", \"255.255.255.255\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"127.0.0.0\", \"F9AEC:84757394E\", \"127.0.0.1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0:0:0:0:0:0:0:0\", \"0:0::0:1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"GA0FED63B916205\", \"00574D15D.25718\", \"73D24470.4:19E7\", \"    127.0.0.0    \", \"::\", \"6C:CC2E0D012EB7\", \"95:G3A11G6:EB9F\", \"127.0.0.1\", \".9DG2A4:CG1E9DF\", \"3.21083FA954A:0\", \"B0:8B4E.E.4C1DD\", \"127.0.0.1\", \"2.5.20.1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"5:F92611A683F81\", \"0:0:0:0:0:0:0:1\", \"842.DG1F.0923:D\", \"A1:A20EE5CC471G\", \"B1GC559E9D49C86\", \"52AF778D54574CD\", \"A:FB767F6DB480G\", \"0:0:0:0:0:0:0:2\", \"    127.0.0.0    \", \"0.0.0.0\", \"0::0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"2.5.6.2\", \"069F29ADDFBD1D8\", \"::/0\", \".A4EFF9GG1.:.C9\", \"GG.C7AB2D6463EA\", \"2.59.6.2\", \"127.0.0.0\", \"    127.0.0.0    \", \"A9EA89F5C80F42:\", \"82D5.9AA9575436\", \"0:0::0:2\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"GD38:C0:4BFC5D0\", \"0:0:0:0:0:0:0:1\", \"::1\", \"    127.0.0.0    \", \"3DGG:C62C6:19:F\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"50..1D74.6BEEA4\", \"0:0::0:1\", \"300.0.0.0\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"BEG51:D0AA.:AAA\", \"A0851B.A857G:92\", \"E1D18:67CD6E882\", \"0::0\", \"DB60B37G2882A68\", \"127.0.0.1\", \"4D8478...G7E669\", \"70FAC6549GBB6F0\", \"1AG30B2C:4FF56.\", \"    127.0.0.0    \", \"300.0.0.0\", \"988GA4FAB39FBFD\", \"B313..2GAGCBBE1\", \"21AG1FGE.G908E:\", \"2.5.6.2\", \"A6C2E36F8CE1E5.\", \"..D5B2D:3BD273A\", \"127.0.0.1\", \"BCF7:C:D:4356FE\", \"2.5.20.1\", \"452..FCA97B32F6\", \"FA.8CD0C7E878FC\", \"3G5E45B3F809D4:\", \"96:B4AE1G746:DB\", \"0:0::0:2\", \"::2\", \"6012AC556C532BE\", \"G4D4CC:F:0BG5AA\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"9D438E.9G.GED3:\", \"127.0.0.1\", \"::/0\", \"0.0.0.1234\", \"ACE5:C61G4GC68.\", \"469AA185595D2DD\", \"02C5F36A7B83B42\", \"0:0:0:0:0:0:0:2\", \"5F801G:.14:EAEE\", \"255.255.255.255\", \"DF:FAC9FGA3:2::\", \"    127.0.0.0    \", \"D87C8EAE7E2C221\", \"127.2.3.4\", \"::\", \".FD3BCDAB75B140\", \"0A8B4:CD5BF4A81\", \"::1\", \"2.59.6.2\", \"52BED7G92.30ADF\", \"5F36202E8389GBF\", \"G75CA2CBDD34FAD\", \"4:CG0EEC5B8A:.1\", \"2.5.6.2\", \"231100A33EB35C.\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"01D.:390C14.98:\", \"A:C5G7D5CD9DG.8\", \"2:C1GC78BE2428E\", \"D24E2B0BA2A7A7E\", \"300.0.0.0\", \"10A26A438C1D542\", \"2\", \"0::0\", \"A2CF.732DF.28:0\", \"20.:158DC88::C:\", \"::\", \"0D089B4FE44F1.E\", \"2:EB56A8:1E78:E\", \"29892:909GA9BC7\", \"E76EF6716A35350\", \"1::2::3\", \"300.0.0.0\", \"255.255.255.255\", \"73:D45A0AG49357\", \"0:0:0:0:0:0:0:1\", \"104D9825B8761BD\", \"557.:C62698173B\", \"39C.8B84G8FB40B\", \"G91:050532056G6\", \"28A20.909D2G:BB\", \"0::0\", \"9:B200.57GCBF79\", \"2\", \"0:0::0:1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"9.26BFF7C8137.1\", \"0:0::0:1\", \"61B7A4GC4:2E54G\", \"0:0:0:0:0:0:0:1\", \"G82GG16B8A.6G9F\", \"127.0.0.1\", \"0B1865.340B4D66\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"DGEE5BEEG03EDF8\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"F613GBC0A8FE26:\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"GAC43D6F59A11AE\", \"255.255.255.255\", \"0:0::0:2\", \"7425E:72CB3:DE8\", \"2.5.6.2\", \"0:0::0:1\", \"::\", \"127.2.3.4\", \"0.0.0.0\", \"DD8ACC8CC033860\", \"4..AFC0:8862.D:\", \"77FA:5FGF8FDE01\", \".C25A0.53940639\", \"CB505B.3DB4505C\", \"93C74GC4614ED66\", \"D376B904CG699D1\", \"DE27.5B9:B007.B\", \"0290ECAE80DD2:E\", \"F2C87B976929899\", \"383.:5375F45:.9\", \"C593FD4.E4538G6\", \"DC6CC33G2.1A.A4\", \"G6A7F.:42C:3G48\", \"4AAD.AB38938F0A\", \"E8:GD7EAB4A0GB6\", \"    127.0.0.0    \", \"E:8C2:4BG1082G5\", \"95857A9569.7A20\", \"2.5.6.2\", \"2\", \".3D:E18BAG30C1C\", \"4358BE8:0348BB1\", \"::1\", \"16D509FCF1C75G8\", \"2.5.6.2\", \"EA87A5ECA5:D00G\", \"CE8D14F96E5115F\", \"127.2.3.4\", \"0:0:0:0:0:0:0:0\", \"2.5.20.1\", \"7:C5195:B9D1::6\", \".28FA0G.4AG264E\", \"2CE7F41AA2AF570\", \"E5.:D766:502D37\", \"4G8C3D71A05E.8C\", \"8365F2E.612F.64\", \"127.0.0.1\", \"2.5.20.1\", \"7D35228F2G98G3F\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"1::2::3\", \"0:0:0:0:0:0:0:1\", \"425A.E8.7A407A:\", \".B21E429B53953E\", \"127.0.0.1\", \"3FEDC04EG.F7DD:\", \":::4\", \"04F055725FE5C95\", \"127.0.0.1\", \"::1\", \"::2\", \"0::0\", \"255.255.255.255\", \"0:0:0:0:0:0:0:0\", \"4CC8AD68AD5047A\", \"::\", \"    127.0.0.0    \", \"300.0.0.0\", \"4F820BF4GE0:60:\", \"GE8GB:EG.B448A8\", \"F41A89A4G8:979G\", \"C4.AA29G5265G:3\", \"BAGA9.3F:9F9A04\", \"G7::6G3E8FD2G:F\", \"127.0.0.0\", \"    127.0.0.0    \", \"2.5.6.2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"255.255.255.255\", \"::8AD6GEBA57G4B\", \"255.255.255.255\", \"::5B:34697.69B8\", \":E86E49F4DB51AD\", \"0::0\", \"0.0.0.1234\", \"2854437G91B1098\", \"2.5.6.2\", \"0:0:0:0:0:0:0:0\", \"1::2::3\", \"2.5.6.2\", \"::2\", \"2.5.6.2\", \"255.255.255.255\", \"1::2::3\", \"0:0:0:0:0:0:0:1\", \"1::2::3\", \"::1\", \"B::2FFD.49CE7DG\", \"15C.2GF7E5:2ADE\", \"DAE3:.E44:62A84\", \"0:0:0:0:0:0:0:1\", \"::\", \"0:0::0:2\", \"8E8DGCDA70E.A6E\", \"127.0.0.1\", \"98F40F0266D85F3\", \"9.0E0EE.EE:EF9A\", \"A1DBB5F:49:.7F0\", \"C:ACGDE7:7AG:79\", \"1FEG6277E46CA08\", \":::4\", \"A6B4B4088.66CG:\", \"5:79GB21C:99A7A\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"D290ACA3B901B:6\", \"64.:7G28DD0D..5\", \"0:0:0:0:0:0:0:2\", \"711.E21D:C2G415\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::1\", \"G8DD4BG:C8.9007\", \"06:G5CFF6A1E45:\", \"FA6D6E24CDGB38F\", \"2.59.6.2\", \"B2459770E.D4250\", \"0CBF:EB0FF5979:\", \"::\", \"18EGA0.G.CD:5F.\", \"::/0\", \"2.59.6.2\", \"2.5.20.1\", \"G38A:4:G4.GE.85\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"FD0.GF9C9:5EE46\", \"2.5.20.1\", \"2FDF626F892805.\", \"21522GDE2E440G8\", \"62:E6250291FE1B\", \"2.5.20.1\", \"127.0.0.0\", \"40.3FG9CC85FC3.\", \"::/0\", \"6DB5951.:9610.F\", \"1.5D.B.8A414GA8\", \"0:0:0:0:0:0:0:2\", \"2.5.20.1\", \"3G434BCEA73:722\", \"A41G31DE236804C\", \"D2CD079GD661:D5\", \"A9.EF528CDG.C82\", \"987A03FABF9F5CB\", \"::E4A98CD611E3.\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"2.5.20.1\", \"0:0::0:1\", \"3G50.5B1.027399\", \"::\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::\", \"0:0::0:1\", \"127.0.0.0\", \"127.2.3.4\", \"8F91A7B67BFEFAC\", \"701A00030::28EC\", \"0::0\", \"3.720429FF68339\", \"63D4B779:A4:.9B\", \"0:0::0:1\", \"255.255.255.255\", \"4B9:F827F0DA5DE\", \"::\", \"F8F2AD1GC1.:4E3\", \"2:E9B:C2BC8AFFG\", \"127.0.0.0\", \"127.0.0.1\", \"0:0:0:0:0:0:0:1\", \"9970517.B49C8EC\", \"255.255.255.255\", \"0.0.0.0\", \"0.0.0.1234\", \"1::2::3\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"::1\", \"B6:073EC85715:5\", \"127.0.0.1\", \"255.255.255.255\", \"0:0:0:0:0:0:0:2\", \"::/0\", \"6.C295C791BAD1:\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"C56542D2E5F:E9E\", \"G15.3D5:6C3934B\", \"F:758.19G.6:795\", \"127.0.0.0\", \"0:0:0:0:0:0:0:0\", \"24205:082:CF3A8\", \"1CDE1GD0EBBCBE5\", \"73A0D6.B60C904:\", \"5GA9321F7G75205\", \"2\", \"F5F0E.17463G759\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::\", \"    127.0.0.0    \", \"EEG.17905GDC1EE\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"255.255.255.255\", \"9B5C8250F7:6B3C\", \"24GBD3DE7C71CA4\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::\", \"0.0.0.1234\", \"5D6C:13.0B7DE:F\", \"11G46D.8BA0GE.7\", \"2.5.6.2\", \"127.2.3.4\", \"82428D1BE7AC16D\", \":::4\", \":EC4F2184D8ADE4\", \"::\", \"0:0:0:0:0:0:0:2\", \".3BC6C61E43E206\", \"F0F10CE43278B73\", \"G1DC.4::.F7896G\", \"255.255.255.255\", \"D243G41:6GF8EF5\", \"0:0::0:1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2.5.6.2\", \"127.2.3.4\", \"3A7:.11.42F784F\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"127.0.0.0\", \"G:4DE:9B:B80202\", \"A29.8C4:.885BG4\", \"111..A4CA7EEG87\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"9.4B30FD:AFA6B7\", \"2.59.6.2\", \"EGBG78D5GA9B785\", \"GCF91F8DFG7D099\", \"192.168.0.1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"1.6E2D.C8D:7571\", \"B7D4:3..FD.BEEG\", \"3.:99:2B:C7F6C6\", \"127.0.0.1\", \"9860D8G07.3152G\", \"0:0:0:0:0:0:0:1\", \"41F6BD6E2B96F:F\", \"CC0C90A575B4B93\", \"C0:2D2G3:2A80DE\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"2FF28E:.4A8B9G8\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"F6BCG4GGE2174B7\", \"A7AD.7C30.19D18\", \"CAB4FF.24DF.F24\", \"5B.025112.4701A\", \"8:D9GG9F7.7GF78\", \":9D33FD4819051C\", \"EA99B7F205EFCE:\", \"2A00FF:227BBA45\", \"300.0.0.0\", \"0.0.0.1234\", \"::1\", \"G1D6D0GB0E:49G8\", \"860A1.BC9E6E817\", \"74B9:574C3A7AFE\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"9..8E.1E0F82527\", \"127.0.0.1\", \"::\", \"0:0:0:0:0:0:0:1\", \"0:0:0:0:0:0:0:1\", \"A89:.70DFE95E7F\", \"127.2.3.4\", \"1E.47:.EA8:C7F5\", \"0.0.0.1234\", \"127.2.3.4\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"127.0.0.1\", \"1B83A9E3GCB1GC0\", \"0G307E67AB.E8E2\", \"6E7494CD3E15D.A\", \"::1\", \"9F9GG.B:CBG5BA:\", \"1D.030D0G398E01\", \"0:0:0:0:0:0:0:2\", \"E2A:B666D18C19G\", \"2\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"B8F99EDD953CF21\", \"8:4F:.2:FC788:5\", \"48:486:F554B9EG\", \"0.0.0.0\", \"::\", \"C..C1BBCGD605F9\", \"::2\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"192.168.0.1\", \"2.59.6.2\", \"ABD4B6C4CE3515C\", \"300.0.0.0\", \"::2\", \":::4\", \"2.5.6.2\", \"2.5.6.2\", \"895.D3F5.A40G87\", \"A1B6.B9G92140F3\", \"FG48831820CA94F\", \"::/0\", \"2.5.20.1\", \"13BB328D48B25:C\", \"::/0\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"BE0A1201.6.C0D.\", \"0.0.0.1234\", \"A2C:..947:110A8\", \"0:0:0:0:0:0:0:2\", \"BE6327BA:7:G65A\", \"E42EA2B709B81FA\", \"5.85B29G1F96AA:\", \"E5G.6DAE:3981C0\", \"::\", \"::/0\", \"300.0.0.0\", \"6G.:3FE5C2544E8\", \"2G7B506146379GB\", \"GBC4BA64A912F82\", \"FF7879ADD5F.D12\", \":::4\", \".2D4:9D8.D69EF3\", \"A955AEB9DCG.F8F\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"46AGDE7:14B7CF8\", \":::4\", \"::\", \"09178FCG39D2927\", \"G3916510C882D9:\", \":::4\", \"8CF87G1A8737FF3\", \"2.5.20.1\", \"BE.A7259::GB688\", \"::2\", \"BCD17BG1:0DA832\", \"::/0\", \"127.2.3.4\", \"127.0.0.1\", \"0.0.0.1234\", \"724D.79074FB3.7\", \"1::2::3\", \"::/0\", \"G2C4CE49.GCC24.\", \"127.0.0.0\", \"90DAFF669GC330D\", \".07037C5D:0FCAF\", \"2.5.20.1\", \"1.E:.836GE8291G\", \"18EF3366002E2.B\", \"466BFG3G7G2C38.\", \"CG7DD36D6431DFG\", \"D3E03E78.5:013C\", \"C77CG4B673CE:61\", \"7..AA768EF9:E66\", \"0:0::0:2\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"300.0.0.0\", \"083F43DFG:034E9\", \"6:F20G3B8D1140A\", \"127.2.3.4\", \"4E9097E5.E6E953\", \"51A4277C92069B5\", \"7FA..0B89DEB:C2\", \"127.2.3.4\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"::\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \":A4E:19B17G.B59\", \"3AA463B:B24EA9.\", \"1DC9514ACBG9.BD\", \"::\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0CDD1:E.:6AC856\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"B68.A81F8EF09DG\", \"0::0\", \".0GEF081A3G7.5F\", \"245C5C.FD96F0G4\", \"5849G0.7055.3G0\", \"::\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"192.168.0.1\", \"127.2.3.4\", \":::4\", \"::2\", \"2.5.6.2\", \"B:03:CGA24F4242\", \"G89B74:E.6GD2A1\", \"E22G7B.A051043.\", \".1C.EA3F:37572A\", \":::4\", \"127.0.0.0\", \"E9BB93F40G88864\", \"C..B0CFA62973:.\", \"300.0.0.0\", \":B.6G40G2CBBF8G\", \"2.5.20.1\", \"A419.G33271C:2G\", \"55AC370DC22B0GF\", \"23FA5A95..78C6E\", \"0:0:0:0:0:0:0:2\", \"A7EBD..1BC1:287\", \"0:0:0:0:0:0:0:2\", \"55E799703GFGA20\", \"G:5327A967F07B.\", \".50EBFDE6:8G944\", \"FG53E5DF0:.1DB1\", \"GEE7C7F734739E:\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"G636.619389C2:C\", \"0:0:0:0:0:0:0:1\", \"2\", \":::4\", \"F18AC3A47.571E4\", \":::4\", \"7.9BG2D9ADD.4AE\", \"F0.01EB00E88EAF\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"1E448D9B05AFECG\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"6BG96A175D00GA4\", \"255.255.255.255\", \"0:0:0:0:0:0:0:1\", \"FCE94B03G7C:E31\", \"ABB7F594:EEB:C:\", \"BD047AECF.E6BD4\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"::1\", \"3E6A214536BC74F\", \"2.5.6.2\", \"0:0::0:2\", \"D54BB1D6B0CA0F8\", \"3G40D5E9B32681A\", \"C7.2F0705:3G:5G\", \"127.2.3.4\", \"0.112BFG:44024B\", \"7EBB.884D0DC39D\", \"3.A29.:G7GE7E72\", \":::4\", \"    127.0.0.0    \", \"46FA654:676F66F\", \".0G7C1601:7B428\", \"3EC07D6B550CE97\", \"8.C1G62.0867A99\", \":C22AA5C:AGG28C\", \"255.255.255.255\", \"1B06F9928AA.079\", \"4E2522G:E3ABAB6\", \"81B9040DD10B2BD\", \".24AD438E504FGC\", \"2DE6GAB6686F.6G\", \"1:E6FF63D7D:9G3\", \".E8A:84993:BBC7\", \":::4\", \"255.255.255.255\", \"GF09.1E68G36AF8\", \"0.0.0.0\", \"7430819DF1G91AE\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"CCC94D.GC6FC924\", \"7D:3B54F6B8B82F\", \"0::0\", \":2C4518C58:F1F1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"86657ED646986GD\", \"7F0A67620C21.D3\", \"2B81B9FBA4.BA16\", \"::\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"127.0.0.1\", \"9FF6D13A.51G.BA\", \".A2F017G7.D:88F\", \".07767.DAE.C:6A\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"B68E258586D58A9\", \"72070B2C3E269:.\", \"255.255.255.255\", \".EEC5::90627E.:\", \"300.0.0.0\", \"127.0.0.1\", \"1::2::3\", \"3B2954E35.81G70\", \"02B446408.:C53F\", \"300.0.0.0\", \"6AB32F:750BE8CB\", \"0:0::0:2\", \"2\", \"::\", \"C3B8G2B.0999C9F\", \"0::0\", \"44F.81639BDE4F:\", \":4GFEE:EDDDC2ED\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::\", \"1B.2.8:1678DDGB\", \"192.168.0.1\", \"E4:C2392FB2693E\", \"0:0:0:0:0:0:0:1\", \"777GG7B98892:FB\", \"300.0.0.0\", \"C0BG39E.EA877AB\", \"BEA02603A465FD8\", \"DEF5B248:12C863\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"B.29FF2A3965:98\", \"41.381287AC665E\", \"0:B.934B149CA49\", \"1::2::3\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0:0:0:0:0:0:0:1\", \"0:0::0:2\", \"6F27D16B8ABF71A\", \"B6A:1E0AC8653DD\", \"::\", \"69C167685C41:9:\", \"127.0.0.1\", \":.964F45162.BDA\", \"B6E0986C121G795\", \"127.2.3.4\", \"1401483GCC:84GC\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::\", \"0.0.0.0\", \"B057CCE0:7DFE4G\", \"255.255.255.255\", \"C.G5B8460FC2346\", \"CG1BDG29F341DF3\", \"F5EG77GD0A8.:43\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"127.0.0.1\", \"A9:0761CA2:A.7C\", \"G18::92F3600D92\", \"::\", \"::ADA20:CB32D91\", \"2.59.6.2\", \"::\", \"G1209BF77:B9.C1\", \"0.0.0.0\", \"023F286B.C883GA\", \"    127.0.0.0    \", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"78035F650:C1FF7\", \"0:0:0:0:0:0:0:1\", \"DGC62B897E2.AG9\", \"7E2EDD.F89237G.\", \"76A.444634CB9GD\", \"47509830C02.611\", \"0:0::0:2\", \"0:0:0:0:0:0:0:0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \".4D4C05A0:G0A:0\", \"8E89B.F.3F4GG0C\", \":::4\", \"27F6B50G8B8E8.8\", \"4G7G6BF38A82.9G\", \"DD6AE447:8FF:40\", \"D:4BE339CA102E6\", \"81DF41F423G27D3\", \"2.5.6.2\", \"255.255.255.255\", \"65346E671978CED\", \"::1\", \"738BF949..787:2\", \"0:0::0:2\", \"066672CD5709D71\", \"::1\", \":::4\", \"1::2::3\", \"3B4272C75484EB9\", \"0:0::0:1\", \"300.0.0.0\", \"2.5.20.1\", \"1::2::3\", \"2.59.6.2\", \"14:G524CAC140.0\", \"127.0.0.1\", \"0:0:0:0:0:0:0:1\", \"95EAC.CC405E8:F\", \"    127.0.0.0    \", \"9.2C18413FG15F8\", \"0:0:0:0:0:0:0:1\", \".822D370B.538C:\", \"::/0\", \"3CE.D7F74G779BB\", \":G09E3C7G04C5EB\", \"::1\", \"127.0.0.0\", \"0:0:0:0:0:0:0:2\", \"936BB.B1GEAEGG8\", \"14.:7850B:G874E\", \"0.0.0.0\", \"D14EE6G:E880FA8\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"E2456A9451.464B\", \"2.5.6.2\", \"192.168.0.1\", \"0::0\", \":02261.C09CC714\", \"0::0\", \"0:0:0:0:0:0:0:1\", \"::\", \"G30A220FFC7EEG2\", \"475A7F4D:BG0766\", \"G3ABFFC98826G:9\", \"2.5.20.1\", \"0:0::0:2\", \":::4\", \"G:F91:0047BE.85\", \"E.59B91.3:3C5.4\", \"127.0.0.1\", \"4:EF8A1D107F497\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"BB:4A3EE9AGCB0B\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"B010CC167G:8BDG\", \"566EED1CE42D9G.\", \"C83AC93:C9EB594\", \"AAE2.E87:29B6:4\", \"0:0:0:0:0:0:0:0\", \"2.5.20.1\", \"71A6DC894..E558\", \"DD59.782A.8D5C1\", \"    127.0.0.0    \", \"127.0.0.1\", \"4922GBG4F:70A29\", \"G7273C.CFAE.07G\", \"::1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0::0\", \"8GC6DDF680C0623\", \"23.E4E.G1D2C7A4\", \"43G988B7F7G19B:\", \"0.0.0.1234\", \"G::6E.DC49:8144\", \"::1\", \"0:0:0:0:0:0:0:2\", \"B486501B2C5:79C\", \"BDFC:29F155C0BD\", \"0:0:0:0:0:0:0:2\", \"112.50FC4B2A5.B\", \"1001D7C966F70A5\", \"GB84F771:58.DG6\", \"D4G2B2F5.4A5A0D\", \"89F47E6:3B32CA4\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0::0:1\", \"127.0.0.1\", \"127.0.0.0\", \"D171.B185F68722\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"3DB.3406GA03G7.\", \"2G7D4F1FB987F25\", \"::/0\", \"0:0:0:0:0:0:0:2\", \"A4DD46580F7DG1A\", \"192.168.0.1\", \"0:0:0:0:0:0:0:1\", \"B1G84:DF6C2D5D5\", \"FCEE31DDFB4CD8G\", \"BC8GGG3E1E984GG\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"5A05425G:G27.A7\", \"E2D07A7AD1D3734\", \"480E2.648E7F55B\", \"0:0:0:0:0:0:0:1\", \"    127.0.0.0    \", \"::1\", \"A4285GBCA13FDG2\", \"2.59.6.2\", \"2.5.6.2\", \"::2\", \"4AD6:DC8GG226F6\", \"6977GF:03GC627B\", \"127.2.3.4\", \"0:0:0:0:0:0:0:0\", \"127.0.0.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \":F63:.69A195876\", \"GGG39FG:3C6C6FB\", \"127.0.0.1\", \"::2\", \"0:CE0FB4B9B2FEC\", \"287B693101DD:.2\", \"    127.0.0.0    \", \"CB8A8E2E2A8AD5E\", \"C020.858B98:F07\", \"8A:9DGE5A7A2871\", \"1::2::3\", \"2.5.6.2\", \"03487550247655G\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"A783BAGE8ED41BB\", \":D158DEBE48GB87\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"98A7E.732E8E4E2\", \"B8206EB39G84E8D\", \"127.0.0.1\", \"39G6C32B82F92:F\", \"::1\", \"4FGBEGBF4ECA29D\", \"0.0.0.1234\", \"::1\", \"9631FDG:C33C4E9\", \"::1\", \"4A:..2:F.272:80\", \"4.56B5A45F35E90\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"2\", \"9DAD8B06E5GBADB\", \"::\", \"127.0.0.1\", \"6FAADBE980:F8CC\", \"9D6.4AAD51GA391\", \"C9C82D50ACGCCGA\", \"0::0\", \"::1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"C0F0C3.970G:28F\", \"192.168.0.1\", \"E75E627:2EEB0BC\", \"300.0.0.0\", \"0::0\", \"G91761.966231C5\", \"G.F48B6784A1D09\", \"2.5.20.1\", \"7DA761FC0:AG5B.\", \"2679403A4630C5E\", \"0.0.0.1234\", \"0DA.AGCBB:G9681\", \"E:A728B4A95.G35\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"CDB5841AB79G91F\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"179BF7C:2A7BG3E\", \"331160CA7E83C4B\", \"::/0\", \"2\", \"5G3C846ABBFB6E9\", \"0:0::0:1\", \"42055B:8651DA79\", \"255.255.255.255\", \"1::2::3\", \"C2A613G63604FF8\", \"2BE7:6:3.FEF6AA\", \"1::1865CGA9C7FA\", \"5120DB4CE.4GF23\", \"ACG:3C3BD:7E88G\", \".2A732AB9BF020.\", \"0:0:0:0:0:0:0:2\", \"127.0.0.1\", \"B0CDC6:09CF48B6\", \"DD2GEC.A:7AFC9E\", \"9261A4AA9G85..0\", \"127.0.0.0\", \"::\", \"G808::ABA69690C\", \"2.59.6.2\", \"2\", \"GG3A4.4E3.F:G6D\", \"127.0.0.1\", \"::\", \"::\", \"0::0\", \"300.0.0.0\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \":::4\", \"641GCA262EEB6B8\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \":::4\", \"E1756:359.28860\", \"0::0\", \"2\", \"155525:G5C83G0C\", \".EA0E7C6F:4C531\", \"::\", \"88EF9342AB:7450\", \"127.0.0.1\", \"G0GE9.5921.GCCD\", \"11D5.0EG2966E::\", \"ACEF5865DG.1A6G\", \"16EG47:A5D1.79F\", \"F802A5E122CA:.A\", \"    127.0.0.0    \", \"127.0.0.1\", \"36E6A:61EG8C:11\", \"81180G21AC73.5.\", \"7.1A.1BDG190231\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2.59.6.2\", \"1::2::3\", \"96FABG7C3C1D1A4\", \"B637GGB3BFBCDAF\", \"G23C3AAE013A7E2\", \"0::0\", \"C562G3:A9BAB71A\", \".0G4102E1A0F.35\", \"50222:746637DB7\", \"DEGC7:A369G6062\", \"0::0\", \"ABG96B3:6FFCBC0\", \"0:0:0:0:0:0:0:1\", \"DG78BDEA738:DAF\", \"127.2.3.4\", \"2.5.20.1\", \"::2\", \"6C646A16BBBCB50\", \"D4B.:05AA7A.9AG\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"C1BF2AF9D34F258\", \"127.0.0.0\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0.0.0.1234\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"2.5.20.1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"997:GGD337D89:G\", \"192.168.0.1\", \"0.0.0.0\", \"6F98BCG.15E8388\", \"::1\", \"4917136BA:9G986\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"24798CCE.4:G.ED\", \"23GF59:E74F9GE6\", \"620A2358:53F5:7\", \"0:0:0:0:0:0:0:2\", \":6G3F28F9F87D09\", \"57BA.C5G1969DC:\", \"0:0:0:0:0:0:0:1\", \"2.59.6.2\", \"255.255.255.255\", \"6G6FFBEBCB2A792\", \"GD48.4B2F5B9B7A\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"255.255.255.255\", \"127.0.0.1\", \"F3A5EA5.2G9A293\", \"0::0\", \"2.59.6.2\", \"127.0.0.1\", \"7996FF2C.8AG16B\", \"192.168.0.1\", \"D77B:C.87FAD66:\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"C:3A9803:B.500F\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"252:CF6424E1G7A\", \"7C2A3:8B:1G87BE\", \"FE:6ECF83DD3706\", \"255.255.255.255\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \".1BG00500DC4384\", \"A2778:58C2546G8\", \"F4434C36G59..G0\", \"0.0.0.0\", \"01327.02907D08C\", \"0.0.0.1234\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0:0::0:1\", \"09F:C920:9FD.D3\", \"23A:FF615A042:.\", \"5E371GG:B.:3EEA\", \"2.5.6.2\", \"F9FDEB.F1.A8041\", \":::4\", \"2.59.6.2\", \"0.0.0.0\", \"54DF:698:G4A6C5\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2.59.6.2\", \":4.GAFGD2A.2973\", \":.:27DD8C.300F4\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"127.0.0.0\", \"907E039:FC71BD5\", \"::\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"AA.6B0.689FF9B7\", \"300.0.0.0\", \"    127.0.0.0    \", \"0:0::0:2\", \"EB1BEGCC6:63D32\", \"EB75D2AG7C5CG2:\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0:0::0:1\", \"127.0.0.1\", \"127.2.3.4\", \":::4\", \"127.0.0.1\", \"1::2::3\", \"0:0::0:1\", \":.FF78E755BCC87\", \"2\", \"0:0::0:1\", \"3366:F7EB6FF7G4\", \"0:0::0:1\", \"1::2::3\", \"47D977GG14C0GDA\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"G.D::GE0BA::E7G\", \"302150062CC8A4F\", \"DGEAAE29E:E46.C\", \"5.54C19E9912AB3\", \"GC7A752A2C9E:0E\", \"127.0.0.0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"F956:A84FGF9023\", \"2.5.20.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0:0:0:0:0:0:0:0\", \"92C05764340D0:.\", \"802F8973D5590D:\", \"::2\", \"EG17GF4BE758:73\", \"1::2::3\", \"3:F5F90C3E24F57\", \"0.0.0.0\", \"G00:1F131.8D::0\", \"0::0\", \"567.3:.5BBFG6DA\", \"0:0:0:0:0:0:0:0\", \"2D3C7C:C1E7BC50\", \"::\", \"2\", \"255.255.255.255\", \"127.0.0.0\", \"::\", \"837B4E:1DG47176\", \"D95503C:75GGFCE\", \"26C752C4B0GB:E6\", \"::/0\", \":61A.G2AG5:8E66\", \"0.0.0.0\", \"0:0:0:0:0:0:0:1\", \"0170C46G.97:A83\", \"127.0.0.0\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \":::4\", \"255.255.255.255\", \"0:0:0:0:0:0:0:0\", \"192.168.0.1\", \"48F.38A750113C.\", \"18GG.578F0C37G6\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0:0::0:1\", \"    127.0.0.0    \", \"2.5.20.1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"::2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \":::4\", \"E8F30A443CDC4E7\", \".351A02.7.B66G9\", \"0::0\", \"5153E7E3.GDEEA4\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \":4ED85C01:E:DB7\", \"38.396A973AGF4A\", \"127.0.0.1\", \"16FE58EB19.F05E\", \"64C46939753913E\", \"2DBG6C68CAD961G\", \"127.2.3.4\", \"GC2D1FD8F12E2F6\", \"0:0::0:2\", \"99.F.8982.57252\", \":::4\", \"7FA4EB2:621G893\", \"::1\", \"0:0::0:1\", \"28G:7AC8F1F5:GF\", \"0A8:E1BA59:G38G\", \"EAC7F5:526C665E\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"93B3G205193.715\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \".37CCCF81411G.:\", \"762E1260F1E16.3\", \"300.0.0.0\", \"127.2.3.4\", \":GCG135423:3CDA\", \"0D7FE9BE55B9003\", \"192.168.0.1\", \"63609542A483CF8\", \"E8C5G640GB524FD\", \"FF3E334F72.7C23\", \":AG7C3A803AEC50\", \"8BA5GA9F3.713BF\", \"127.0.0.1\", \"0.0.0.1234\", \"6E58:G0D:F2CABA\", \"76D.5G93933C514\", \"2\", \"DEC716E2AB1803C\", \"9D::02C8.9EB3:9\", \"0G9CE3512673120\", \"::/0\", \"FD32416267E63GA\", \":E742433G4AD3F8\", \"4188F2E192E5.C0\", \"B98.03D1.29CDD8\", \"127.2.3.4\", \":::4\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::1\", \"0:0:0:0:0:0:0:1\", \"84C.ED99731D52.\", \"0:0:0:0:0:0:0:2\", \"255.255.255.255\", \"300.0.0.0\", \"C7693E4D.7E600E\", \"DDFBD24.F0D7C92\", \"57514EB33BFB0A4\", \"::\", \"2.59.6.2\", \":3701CE.8FGBCF0\", \"1::2::3\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"9:231G78B4640:2\", \"4EEGF0C0A2E0DD:\", \"FBF516DD3:A240F\", \"192.168.0.1\", \"CC94CE.E0927G:4\", \"0:0::0:1\", \"DB763D2D922B2GE\", \"CFFA5A556BG3C3A\", \"22A4FG738AG6CFD\", \"1::2::3\", \"3183.8EDD68:4CB\", \"A2632B7C0241786\", \"::D.6B..:7.9B1C\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"581C1G2F670GG7A\", \"2.5.6.2\", \"AC5B1A74FGCG35E\", \"192.168.0.1\", \"0:0:0:0:0:0:0:1\", \"::1\", \"180B13G57E0B.7C\", \"0:0:0:0:0:0:0:0\", \"    127.0.0.0    \", \"0.0.0.0\", \":::4\", \"::2\", \"6DBE50798GF66:5\", \"2\", \"127.0.0.1\", \"6C75BF33E2:3E9:\", \"4BGB.6F55B.0AFB\", \"0:0:0:0:0:0:0:2\", \".8.E82C9:473722\", \"5F2.BB976.38BDD\", \"5GBEB002G4G.EC1\", \"0.0.0.1234\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0:0:0:0:0:0:0:2\", \"3D02CFF6G66FF1G\", \":CG:B9551::F726\", \"2.2E1.B7.F65E40\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"127.0.0.0\", \":F.A159A1B7.53B\", \"4E:D3.G38B5E2BG\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0::0\", \"85:85C.8437891.\", \"876EA0074:3:305\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"42.E48E6C4.A486\", \"95AGCCD:8E3C2DD\", \"D6G43A97FD5:051\", \":::4\", \"FE14E8C39484370\", \"2.5.20.1\", \"8BD1..F.3ED1.6.\", \"0:0::0:2\", \"0:0:0:0:0:0:0:2\", \"1D3AG25CC754EAC\", \":49E61C6982940G\", \"2\", \"255.255.255.255\", \"1::2::3\", \"3:20D.G.21E8DBC\", \"255.255.255.255\", \"2.5.6.2\", \"2.5.6.2\", \"8D0GD78E0D30062\", \"2\", \"26F2CB8E40C:853\", \"DFDF53G71.B2D02\", \"0:0::0:1\", \"92B40A34.22E973\", \"2.59.6.2\", \"8A3BD.A3.F6CF4G\", \"127.0.0.0\", \"1::2::3\", \"438F6CF457:C54G\", \"B073FEAD5D5DBEC\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"9548EBA179:4A1.\", \"127.0.0.0\", \"0:0:0:0:0:0:0:1\", \"0:0:0:0:0:0:0:1\", \"1AF.G7:.0GFD3B9\", \"0:0:0:0:0:0:0:1\", \"300.0.0.0\", \".B60.DE:A471.4:\", \"127.0.0.0\", \".DF1C73:DGCE959\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"CA:3:B8FD5953GC\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::\", \"::1\", \"3D.:01EF.8BBFA9\", \"0.0.0.0\", \"2.5.20.1\", \"0:0::0:2\", \":91.B75C22A.18C\", \"5C85074G4E33G60\", \"D4E0617EF6FE7G6\", \":::4\", \"2.5.6.2\", \"::1\", \"    127.0.0.0    \", \"53:E4E518EAC220\", \"0.0.0.1234\", \"DF:26658DCA0:6B\", \"E4:0G6C9.BCF3EA\", \"0:0::0:1\", \"80A2626FD58F6AF\", \"300.0.0.0\", \"6ED:4826F44E:F5\", \"B98.E:42C4F188B\", \"2.5.20.1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"300.0.0.0\", \"G7C9BFD8366.DB.\", \"15BABG7B6D5668:\", \"127.0.0.1\", \"AE5G54.963A0CA5\", \"CC8A6G:9E7E3403\", \"F4CGF7G0376:CDF\", \"G588G71A:BCAE3:\", \"::\", \"0:0:0:0:0:0:0:0\", \"B2F24GE997119.4\", \"::/0\", \"0:0:0:0:0:0:0:0\", \"    127.0.0.0    \", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2\", \"1BA2292:3DBF83F\", \"2\", \"967AA63208B98DD\", \"127.2.3.4\", \":155GG634FAD6D9\", \"7G30.C2G08.:37.\", \"456E1E9DEA27GC:\", \"2.5.20.1\", \"58126D9B01A7:7C\", \".DE7C74740BBA51\", \"D490169GD1BG203\", \"8C5D5A26:G372C.\", \"3B6GB67589BC1A8\", \"74A238:06C5ED:B\", \"E402A4CA58G395D\", \"0:0:0:0:0:0:0:2\", \"8F35AG3460FC027\", \"76:9G6:F2E7:GA2\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"7B:D6A32G6F.G1B\", \"091G476A4:82F.1\", \"027795A:0DC5.37\", \"::\", \"0:0:0:0:0:0:0:1\", \"::1\", \"2.59.6.2\", \":04792A95170.88\", \"G1F9641B40D3723\", \":F:E..2BEEFA8.7\", \"6.87BCA::76EF86\", \"2.5.6.2\", \"::1\", \"::\", \"G2E:8C03A4B:66:\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"G4:20732G012329\", \"90GCD017D:88GFC\", \"1::2::3\", \"::/0\", \"1::2::3\", \".A4GE3G961:B38A\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::\", \"32B.8585DC9A8F2\", \"::2\", \"2DG:D0BEE831EG0\", \"0::0\", \"0.0.0.1234\", \"97.DFG39A:62FA4\", \"1197771C6A6FBA2\", \"3BD8.:3DDD7G0E9\", \"17345C.C578AF57\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0::0\", \":::4\", \"127.2.3.4\", \"0:0:0:0:0:0:0:2\", \"A7235994BF44C.B\", \"136FCA235G941CC\", \"    127.0.0.0    \", \"3.B99F6A9G958:F\", \"77A:A20G911GG:3\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"    127.0.0.0    \", \"7D7.CB4:5BAB797\", \"::\", \"530G::793G028.:\", \"C2D6E2D07CEC4AD\", \"1::2::3\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0::0:2\", \"5G:FC7F34A.7309\", \"B97:4D62BGE4B3:\", \"2.59.6.2\", \"17G2239A.C7:.3.\", \"68C31F8GB310.0C\", \"3EC4D7BC7D69481\", \"GAA68374G2D7DCE\", \"0:0:0:0:0:0:0:2\", \"D962:0B.DD72A6.\", \"G51390162C7D19B\", \"47097A924143EE9\", \"A:44C824468.CE3\", \"F2.E3837DF711C8\", \"741F5C:2B1C6B02\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"::\", \"2.59.6.2\", \"G36C:37GF5CD8.9\", \"2\", \"::2\", \"92:8A0913475GB6\", \"5:4A7788.57.AC6\", \"BD4D40806BC1BCD\", \"::2\", \"B0DG67DF8FA5D4.\", \"::2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \":::4\", \"0:0::0:1\", \"802B9EA918F87FG\", \"E.3B82.0:5.89DF\", \"192.168.0.1\", \"89BBG2DE0428:G6\", \"3C74.DB.55FG509\", \"8:099C::BD.DDF2\", \"919B6G5FC978096\", \"7EACB::G465A0B7\", \"1:7D92G50652A8A\", \":9E..49A81C.60A\", \"300.0.0.0\", \"8C:F5D6AC03278A\", \"15F2C2BD4CGB63A\", \"2907BD39:670A:B\", \"ADEG047A7G7:D:0\", \"766128204A4B42.\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"1::2::3\", \"66:8728:5.3GDBF\", \"2C839G94A961C11\", \"0:0::0:2\", \"A8G4966A4GE:::4\", \"127.0.0.0\", \"A.0B:F57A6CB:..\", \":0F1G:5A3GE0F03\", \"E0GF5.32E083388\", \"300.0.0.0\", \"0.0.0.1234\", \"6.1680CC923F:93\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"2B..9:D9E653602\", \"606G875G:D3EA85\", \"0GGE03FE:AG8:BD\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::1\", \"2.5.20.1\", \"0:0::0:1\", \"    127.0.0.0    \", \"FD.F3584D42G61:\", \"5414EE943:3.D33\", \"DA2.FC2B40B:638\", \"FB82.B.28:F2207\", \"0.0.0.0\", \"15EBGD0B489A5CA\", \"::/0\", \".GEECA5E9894E7:\", \"0::0\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"FBGG8EABB1G94BA\", \"0.0.0.0\", \"2.59.6.2\", \"B45BB6.FD.BD7EG\", \"BD957C34.3A4A1.\", \"::\", \"CG5CGB1CAGC1E90\", \"0.0.0.1234\", \"0:0:0:0:0:0:0:2\", \"5EF1G7E.G91AEDD\", \"FA:03C4:56063D1\", \"33B88:1BCADC1AE\", \"0:0:0:0:0:0:0:1\", \"FDD53.B9B7EE4BF\", \"4DG:2EDB3CFBA3G\", \".E52B0.5967FGCE\", \"0:0:0:0:0:0:0:1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"1GB.5C9CG6G0D.C\", \"0.0.0.1234\", \"A5C:7G0C5CBG2AB\", \"GD5E16C4:A.0290\", \"2.5.6.2\", \"300.0.0.0\", \"127.0.0.1\", \"E69:G.:AD0.6A8D\", \"127.0.0.0\", \"1AD3B1.D3G59.49\", \"::\", \"347G:78E25FEBG:\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"G0:B4.A.70CB661\", \":B6583.5:.2GCD5\", \"F46A:94E2414.22\", \"0.0.0.1234\", \"192.168.0.1\", \"300.0.0.0\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \":G0FAGA0B97630A\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0:0::0:1\", \"127.0.0.0\", \"A3CBG0.754E520E\", \"41GGF5BC3D.AA47\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"10BD4GBEG48AGEC\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"35A1CADG1:40D7G\", \"CF2CC..5.A789DG\", \"192.168.0.1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"AC07E971DG.65G8\", \"255.255.255.255\", \"    127.0.0.0    \", \"EG4FDFC2:75B185\", \"1::2::3\", \"CF20C3810812573\", \"127.0.0.0\", \"A7393AD82FB141.\", \".D6881B822464E.\", \"0:0::0:2\", \"0FB657B537:FF8.\", \"DAADG1.E7A6A3D:\", \"::/0\", \"::/0\", \"6CF5798A8CB:ACA\", \"0.0.0.0\", \"0.0.0.0\", \"255.255.255.255\", \"707E:CBD.927CCB\", \"F.02A24GBE2C7D:\", \"B91AE0AG0230375\", \":::4\", \"B2G534.6:1AE5:C\", \"45G7EBDG6F.:33A\", \"9GC4G3D.E113A76\", \"D27:1.B0A21CEG8\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"502FE.G:8C78G.D\", \"0.0.0.0\", \"22.22G4429ED:GF\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"300.0.0.0\", \"0:0:0:0:0:0:0:0\", \"127.0.0.1\", \"D385640C18C2383\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"7:G22C58497346F\", \"39A.E049..74A05\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0BBGE450D571CF1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"1::2::3\", \"0.0.0.0\", \"127.2.3.4\", \".6AE48.6EAB59:B\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"255.255.255.255\", \"D34:50477B.:421\", \"::/0\", \"::\", \"5C:E34E20::05.E\", \"10.281974D24F3:\", \"255.255.255.255\", \"2.59.6.2\", \"AAEB986C786GCFB\", \".7485C29379CE8C\", \"::\", \"6E9AD8E6F4BGDGE\", \"300.0.0.0\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"2\", \"::\", \"DC4G20FC2F076E:\", \"54.6AD4.D2.0086\", \"11747C80226GE.E\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"192.168.0.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:F15.728434A2E\", \"0.0.0.0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0:0:0:0:0:0:2\", \"FG4895E619751D2\", \"79.3170:B35BADA\", \"::\", \"2.5.6.2\", \"G.6EF109C887DFG\", \"72C6310.5EAC787\", \"DAG:9A2B61BB076\", \"    127.0.0.0    \", \":E0GC182361E5CG\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"07069GA6A.:8A81\", \"300.0.0.0\", \"127.0.0.0\", \"255.255.255.255\", \"255.255.255.255\", \"300.0.0.0\", \"::\", \"255.255.255.255\", \"E7GG4D61GEB158G\", \":C8F2E8F3:.9EEC\", \"::\", \"BG49EB139EF9CGA\", \"0.0.0.1234\", \"F4535C:8A05CAEF\", \"2.5.20.1\", \"64EA3AECC16B9BD\", \"C:2B:58FCB0.:GE\", \"D.EE578:2231A88\", \"255.255.255.255\", \"2.5.20.1\", \"::\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"1309306AA023741\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"::1\", \"93F5534C67GE7..\", \"127.0.0.1\", \"::2\", \"0::0\", \"0.0.0.0\", \"2\", \"0:0:0:0:0:0:0:1\", \"::\", \"8.64620F10F:F45\", \"0.0.0.1234\", \"B742:A49E:F09.8\", \"127.0.0.1\", \"F.:DA4F5C:F.C2.\", \"C5GE8441A5B:BFE\", \"127.0.0.1\", \"0:0::0:1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"300.0.0.0\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"::\", \"0F2DG7G96AG.0:7\", \"747BBE2.2FBF896\", \"127.0.0.1\", \"1AD0B8D565F90G9\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"9DBA846E.4D2196\", \"0:0::0:1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"7479611DC.A317D\", \"D:F6722G:C735FE\", \"FD0.:CD180.G:0.\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0:0:0:0:0:0:0\", \"300.0.0.0\", \"4:EFCDEB6:E8C08\", \"::\", \"DGF1ED2E:E05616\", \"D3.6GD4:15.C:F6\", \"127.0.0.1\", \"2.59.6.2\", \":::4\", \"0:0::0:2\", \"E8191A1FEC:5.0A\", \"2\", \"944BD3G6659808G\", \"3F011.603:BED66\", \"05.C8ACF4DFED60\", \"3:209231294A8F4\", \"2.59.6.2\", \"300.0.0.0\", \"0.0.0.1234\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"33D8A.684:30D9:\", \"192.168.0.1\", \"EEE.E562B9.E1.G\", \"D708BA4.G361C:A\", \"DD:.316GB.:D351\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0:0::0:1\", \"EBF63262.1B1:6.\", \"0:0:0:0:0:0:0:0\", \"2\", \"24C2A8E91D1CC1B\", \"0:0::0:2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2.5.6.2\", \"0:0::0:2\", \"2.5.6.2\", \"FA76B388F9:430:\", \"0:0:0:0:0:0:0:1\", \"0:0:0:0:0:0:0:1\", \"127.0.0.1\", \"F3:E.65:GECD052\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::\", \"B4EAECBFF67B400\", \"0:0:0:0:0:0:0:2\", \"    127.0.0.0    \", \"G:CECE9FD95:2D7\", \"E7C2G:FA5.2009E\", \"F:E672G5ED9:FBA\", \":G18GF:EB:D49DC\", \"127.0.0.1\", \"FF572:.3562F:C4\", \"2.5.20.1\", \"8AB6EC7C8F8GB0E\", \"    127.0.0.0    \", \"0:0:0:0:0:0:0:2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"4C.:596982B93D4\", \"8E706.46F30817B\", \"B26BDBF6A8::977\", \":4D.DBC01C.87C:\", \"733837GBB92DFA0\", \"2.59.6.2\", \"F44F:A5E.8.9F78\", \"0:0::0:2\", \"A62631C6GD55FFC\", \"2.5.20.1\", \"D307503CD1.60.4\", \"2\", \"66C0B39D13FA:33\", \"7988GB.C644:0.0\", \"::\", \"::/0\", \"2.5.20.1\", \"197:0822649GGD0\", \"0.0.0.1234\", \"192.168.0.1\", \":::4\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"24:::76BEEA1394\", \"0:0::0:1\", \"7F9143C4GF:E484\", \"0:0:0:0:0:0:0:0\", \"205BG4C7B3GD.00\", \"2\", \"127.2.3.4\", \"3F:2:4.6403581:\", \"    127.0.0.0    \", \"D88A6C33F:B7E9:\", \"2\", \"9C4CF51D379FG91\", \"1C020E312C0C1B8\", \"127.0.0.0\", \"::/0\", \"0720:8C::.F98AD\", \"0:0:0:0:0:0:0:1\", \"48.47B.405E4EE1\", \"GD8F418B4C62:13\", \":::4\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0:AG8A68BB9:7B4\", \"2\", \"401D5B8.CG36:7G\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"750A5624D71:8E:\", \"0.:F:GFA47.G3FD\", \"8B2A170200571B8\", \"0:0:0:0:0:0:0:1\", \"D9300B70DGF3B5D\", \"CE6.BFA80E8E002\", \"EB60.:7G6A7:4C.\", \"0:0:0:0:0:0:0:0\", \"F60.4BB42F8460.\", \"::\", \"0.0.0.1234\", \"2.5.6.2\", \"4993E3AC7ECBA5E\", \"A56581C566:E657\", \"A2GB96D:A3AA87C\", \"CC:FD453CE98E32\", \"127.0.0.0\", \"::\", \"FE7F.97341B7A3B\", \"127.0.0.1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"192.168.0.1\", \"C01B:57A.99FCC.\", \"2.53E::15CDFD23\", \"300.0.0.0\", \"F2:B2021BC2.AB6\", \"::2\", \"127.0.0.1\", \"G.B9185524B32D:\", \"AD55CA854G:5D:8\", \"::2\", \"E6156:23FBDD2A8\", \"724678B896F:525\", \"D.A:EB5C9F698.1\", \"127.2.3.4\", \"DC.51:55G4558DA\", \":::4\", \"3AGF0DC1DC33E:2\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"67:BE51ECE6CEA0\", \"E3686344.9G84AG\", \"127.0.0.0\", \"2:B57515E:B2B6B\", \"EBBB2CBA6329110\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \":::4\", \"0:0:0:0:0:0:0:1\", \"127.2.3.4\", \"0:0::0:1\", \"9:C755ED9D96978\", \"0:0:0:0:0:0:0:2\", \"B1G:E97FB194527\", \"0:0:0:0:0:0:0:0\", \"0:0::0:1\", \"444739665F7F11D\", \"::\", \"G06:4A66CFED55:\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0F26.2.0EF2CGGC\", \"127.0.0.0\", \"E5A:8E92D10F714\", \"::5DA0.2662G14.\", \".5B7E06EC2C4C16\", \"A5B56:638F725:7\", \"0:0::0:2\", \"0:0::0:2\", \"G2AD0G7885F.9F8\", \"::2\", \"5F9FG39A46C9214\", \"2.5.6.2\", \"8381818F67.7944\", \"0.0.0.0\", \"0:0:0:0:0:0:0:2\", \"5F3G57AG.EC.3G4\", \"6F1.::6D161D1E6\", \"D83A5A6B:37.945\", \"9868FB81.570:7D\", \"300.0.0.0\", \"CA8.7:FF:CC4EA5\", \"192.168.0.1\", \"127.0.0.1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"E.01G303E:F.041\", \"G:574202DG0.:7B\", \"127.0.0.0\", \"2.59.6.2\", \"::5G5FF5103.3GF\", \"C6FAD2BC48:8G7A\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"    127.0.0.0    \", \"16.B56124CD.690\", \"F1G3:88E1968.E6\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0:0:0:0:0:0:0:2\", \"8AADD.8E:83B408\", \"B04FBGE6G946F2G\", \"127.0.0.0\", \"B.E2F5F3B90.054\", \"0::0\", \"F2:CAD56666A:09\", \"..7.82.BEB1344D\", \"127.0.0.0\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"DBFB16A67AD27BF\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \":19F1AF4:.E9E61\", \"1.77.E7E1825:76\", \"FG38.86G2841121\", \"0:0:0:0:0:0:0:2\", \"0:0::0:1\", \"06EF8AEC.52240B\", \"255.255.255.255\", \"300.0.0.0\", \"4.00868E5.4831B\", \"::\", \"::/0\", \"B.GD1.147CD7G8B\", \"1::2::3\", \".B8237E70CE15GC\", \"2\", \"2.5.6.2\", \"6AAG9EE9BD5ED6A\", \"2.59.6.2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"1C7E1:G045A2517\", \"0A5.B8DA628GB9:\", \"4F683.62.B6:C39\", \"AB96CA72.A.9E1C\", \".3C9.8.E75AC4CD\", \"DBG164DG8C6FC:7\", \"0::0\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"6971G45BE6218F.\", \"0::0\", \"127.0.0.1\", \"127.0.0.1\", \"02ACG96B9DEC5DG\", \"127.0.0.0\", \".1482C.999FG:9D\", \"GE69E704GBG74CD\", \"::\", \"8A:GA0FB0FCE87:\", \"79F273939:E0377\", \"255.255.255.255\", \"ACA0G1750DD61.8\", \"C8F.9774EF50419\", \"D6GDC5.C.26619.\", \"4084F3B367EGF6F\", \"E8D9G.A2798BD97\", \"::/0\", \"8D341D.GBA826CF\", \"::/0\", \"DB:ED25CEGAE700\", \"386.1382482EG6A\", \"21GC418.5726220\", \":89F6E0166.:A54\", \"ADA7903FC6164C2\", \"5:80A4BE1A:7026\", \"0.0.0.0\", \"::1\", \"795801.919FF117\", \"127.0.0.1\", \"203DAF4:G7E3:90\", \"0.0.0.0\", \"8BA.12G0959BB6G\", \"::\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0:0:0:0:0:0:0:2\", \"4GA:55.:GCB62:A\", \"C7BB4FACCD8.60C\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"C5G6DA137067952\", \"::/0\", \"7C.2B4B3D492402\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"GD9F65CA593.693\", \":32BG907368.961\", \"941B501:860412D\", \"068E349GG704EB9\", \"362B1FC.178A.E1\", \"2261ED41E3:015D\", \"2.5.20.1\", \"564E771425.2.0C\", \"0:0:0:0:0:0:0:1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::.62FAF81FCGB9\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \":1GDD5D48F7CEG4\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"F00597B4D128718\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"BG75A5:3B.40450\", \"967A77DF2F48.BC\", \"22GDE08G6AG41A0\", \"0:0:0:0:0:0:0:1\", \"EF8GEGFBF6.E7C9\", \"2.5.20.1\", \".8FAF2::G0346F0\", \"97BFG8C2GBFE:41\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"31G.88116.9.E73\", \"2.5.20.1\", \":BDC:C6324B1CG7\", \"0726873D7G637FC\", \".69:65BCCB:.BAG\", \"0.0.0.0\", \"1::2::3\", \"235G3C8F4DB8177\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"45C32:592B1:D95\", \":::4\", \"BB8CF7F673A5.CC\", \"    127.0.0.0    \", \".0171GG0061AG54\", \"127.0.0.1\", \":::4\", \"::\", \"192.168.0.1\", \"EC52.E8G8E0:FFC\", \"B5051:3D3B5CCD1\", \"0.0.0.0\", \"127.2.3.4\", \"1::2::3\", \"5C6:78262GA6G3C\", \"AA:1.D6B119A010\", \"C:GEBBE70DABF67\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"B8CB1570.7C5671\", \"8F2A9242996D.78\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"A374:C406F654FD\", \"35A52606B69A765\", \"0:0::0:2\", \"0:0::0:2\", \"::2\", \"F.3.G6E2C7764D5\", \"D4942FA176877F0\", \"2C2.5F0EF36.G2F\", \"2.5.20.1\", \"9GG993EC27C3595\", \"2.EE3786983FA8:\", \"G845..650ADCCC2\", \"0:0::0:2\", \"127.0.0.1\", \"::2\", \"9796F:03013022B\", \"G.GE762GE2DA9.4\", \"3B01D182E988A21\", \"::\", \".114DG0:1G34D38\", \":::4\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"AEC87G4GG5F.E6D\", \"C.GB80673CD72G:\", \"::\", \"8988DBC4E5447A1\", \"0:0:0:0:0:0:0:2\", \"127.0.0.1\", \"F21D835G0.0374B\", \"D274:864C4G:F98\", \"0.0.0.0\", \"49DGG29FB7BC04G\", \":::4\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"G1E2.:0.:.F756:\", \"2.5.20.1\", \":1139E80CAF4107\", \"0B419BC.88F7:CF\", \"2.5.6.2\", \"18G.:B00GB1833A\", \":6EF6.F944BF0BC\", \"2.5.20.1\", \"A0A67BD646BD7C6\", \"255.255.255.255\", \"127.0.0.0\", \"1G2G1E04CB00C19\", \"0::0\", \":::4\", \"5F13E5:271B73BG\", \"5A6915AA1FEB6G3\", \"127.0.0.1\", \":::4\", \"90.F89.127FB4F6\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"E99:D.2D9.1013:\", \"0.0.0.1234\", \"3D7A5.AD63DD64A\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"G20FAD4:A2G.D06\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"::\", \"127.0.0.0\", \"37GA576:032369B\", \"41:5:4F598..CAC\", \"0.0.0.0\", \"192.168.0.1\", \"D.5EE803G9BB1D:\", \"127.0.0.1\", \"8484FBF4G.DD59D\", \"B.2.146A09AE891\", \".038CE1F33901F6\", \"::\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \":::4\", \"726F:4CA2FG:5F2\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"::\", \"0.0.0.1234\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"C224871DACCCAEB\", \"::1\", \"7E2:5888841C:E7\", \"7G8E243D8G4C912\", \"FBGAF8.GB8D846E\", \"0:0::0:1\", \"2\", \"E8047GBCGD04.EA\", \"F4EGC22E99BG946\", \"5F:14E9EG431B6G\", \"::2\", \"1:122DDGBAE9589\", \"0:0:0:0:0:0:0:2\", \"0:0:0:0:0:0:0:0\", \"::1\", \"::/0\", \"    127.0.0.0    \", \"75296:480CBEG9.\", \"2G.E923B8936174\", \"0:0::0:2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"CA4F:74D39B8D65\", \":::4\", \"2:6B8:8FC13A:AG\", \"E16.:363GA:E6CF\", \"C:367E7EF.B05GA\", \"::\", \"3G9F057F02B7F17\", \"8D1C8:907:C2984\", \"127.0.0.1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"192.168.0.1\", \"CA5CD:0B:F6.3B3\", \"F3DED4C1G14F5DD\", \"F63.AG:F00BD:B2\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::/0\", \"AGF88E.E2G::13:\", \"2BC8E43F4979EF2\", \"359:4DGD20.50..\", \".C0351C2B7D:3:B\", \"GFC3.176GF35BAE\", \"972E.3B.20BDGA2\", \"192.168.0.1\", \"BG9E84E85D5610A\", \"6E71.B78DFC3GA9\", \"6C9:6FA:7347.CG\", \"2.5.6.2\", \"::\", \"::1\", \"2.5.6.2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"127.0.0.0\", \"0::0\", \"192.168.0.1\", \"0:0::0:2\", \"A9E21GA728.C5:4\", \"3CEC7BCEAB2F0AE\", \"BCFA68G4D2FA2.6\", \"18B1.AF:8B9934:\", \"2.5.6.2\", \"B.6..9B29574.80\", \"2.5.6.2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"D889E71:44F1FBF\", \"DD1F6EG3B.E1A8E\", \"GA3A1612C4BBF:D\", \"2.5.6.2\", \"300.0.0.0\", \".9093DD5F:::E1E\", \"0:0::0:2\", \"88B.89BA6F00:9:\", \".8590FD6:DF6F8:\", \"0.727:6B6:F1C.1\", \"B.88G0E.E09EG.G\", \"6D80D4C5AG1ACC:\", \"::1\", \"2.59.6.2\", \"127.0.0.1\", \"0:0::0:1\", \"416E6FFCG3F:861\", \"0::0\", \"1::2::3\", \".24D760045:89A.\", \"2DB3B6D59D27BAB\", \"06.1424G67C8B:4\", \"A4969.EA08215.6\", \"127.0.0.0\", \".04D227D683AC36\", \"0.0.0.1234\", \"127.0.0.1\", \"255.255.255.255\", \"300.0.0.0\", \"0:0::0:1\", \"7EEF158D:G6EA9F\", \"2AFB0DG5CCA9.62\", \"7685F09.F854230\", \"E90.FBB4:79G4CA\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2:63584E:6E21E.\", \"0:0:0:0:0:0:0:0\", \"5.A32313A1E.5D6\", \":EGA.32D.5.4B1A\", \"G61E1DA22A2.E8C\", \"3.9AE.476C45A75\", \"0:0::0:1\", \"D91E865.1GG.09E\", \"DC303878360B.C7\", \".FG.DF775EA0BG:\", \"::2\", \"FDF00:5959DEDB8\", \"5A.BB2763FDC8AA\", \"0:0:0:0:0:0:0:0\", \"C::4E0BA224D4GE\", \":GAFD1G:0G904G5\", \"CA07GEC.453C4G9\", \"::1\", \"0BF0FFE57A31E35\", \"D986B54EEBB.56:\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0.0.0.1234\", \"0.0.0.0\", \"    127.0.0.0    \", \"127.0.0.1\", \"7154:GCA76:EA3:\", \"64.:F3GCEFC0F:7\", \":CB8D1EDEDFD4:3\", \"2.59.6.2\", \"5C88104D1F1AE90\", \"::2\", \"2\", \"BAG736E1EF4:E53\", \"C3F.A98DG23BA9C\", \"0:0:0:0:0:0:0:2\", \"543:1.D456BE24A\", \"5EE35047FE0D7B4\", \"26BAE3GB384F651\", \"5:.FC2.1DB.CE62\", \"0:0::0:2\", \"7139BF531G24G0D\", \"3.83BF1210G051D\", \"D9GG340B7.D9929\", \"0:0::0:1\", \"0.0.0.0\", \"747BCF.DF5161.F\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::/0\", \"::2\", \"25.95D.B17.A8.C\", \"0.0.0.0\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::/0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"650E1CCE72D:27:\", \"E46:F6330:C706B\", \"2FDB5ED753CC2.8\", \"4B555GD0DA6C2E6\", \"65C1173E859878A\", \"C80.4930818C.B5\", \".0E1289E5D5G9BF\", \"3F7425D23DB:01B\", \"2.040G7E0789.63\", \"196D::0D8.:22A:\", \"G3EC24E5D8F86DE\", \"1::2::3\", \"127.2.3.4\", \"6GC213G0FE388.A\", \"83E543:5B1054G4\", \"127.2.3.4\", \"C65F21G45G.3D0G\", \"2.5.20.1\", \"GB5GC8:B2CCFDE7\", \"127.0.0.0\", \"G:126094.27B997\", \"2F::5BD.:F6C.DA\", \"127.2.3.4\", \"8:36::91C1E71.0\", \":59G60931.GGB65\", \":::5CCA14085E87\", \"0:0:0:0:0:0:0:2\", \":41702F1186B1:.\", \"0:0::0:2\", \"::2\", \"2..A27206172BG6\", \"46F8CG5.5B.FFGC\", \"::/0\", \"0:0::0:2\", \"12D1:F39A7GB.G8\", \"8C9317D94247E79\", \"3D.B12GAFF274B9\", \"6233A66E62CD24B\", \"0:0::0:1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"DGA3.3A3GC47:E2\", \"127.2.3.4\", \"0:0:0:0:0:0:0:0\", \"    127.0.0.0    \", \"::1\", \"::/0\", \"0:0:0:0:0:0:0:2\", \"02F12E:1FE9E444\", \"::\", \"0:0:0:0:0:0:0:0\", \"::1\", \"2FC60D94FB03G81\", \"0:0::0:2\", \"G70F::C9ADEA09B\", \"6A:4E7ED7B256B9\", \".2G0E47AG89CF95\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"3GCC.G4DD036:45\", \"0:0::0:1\", \"2.59.6.2\", \"5DF08.3.7BG4.6:\", \"3CADDE0:B8798BC\", \"E94767B55BA6699\", \"0::0\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"F725919.0.C163C\", \"1E.2AB39.4:BBD4\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"127.0.0.1\", \"79CG5G:F093E0CF\", \"49C66BCEA74G8.5\", \"127.0.0.1\", \"9B..:1BB50G93A5\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"DA17:5G09677F7A\", \".B9E6.C1457A0E0\", \"1F9DE5.EA745C.F\", \"300.0.0.0\", \"2.5.6.2\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"2.59.6.2\", \"CA.:79GEA3F780C\", \"2.59.6.2\", \"39B.A.C043.A270\", \"EFG802D33D7CEDF\", \"2\", \"0.0.0.0\", \"192.168.0.1\", \"91DEGFF0::71C.6\", \"A9EG45AFE913AF6\", \"AAG1480B0FB.B5C\", \"28BGE.21FE0B8A7\", \":::4\", \".AE3A71:FEC:1ED\", \"213:E57D53.2842\", \"127.0.0.0\", \"192.168.0.1\", \"F9E51E3B:E20A0E\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \".3E6D:2FAG6.B.E\", \"::\", \"0:0:0:0:0:0:0:0\", \"127.0.0.1\", \"06D6G.8A6C3.69.\", \"    127.0.0.0    \", \"0.0.0.1234\", \"127.0.0.0\", \"2.5.6.2\", \"127.0.0.0\", \"747E.23G4BB2EA.\", \"27350B9:3809.:8\", \"2.5.20.1\", \"9E:.E8C425537EC\", \"DC4.8674BE:1B.2\", \"18:1877CFGGB2G6\", \".4E6D:C2EE2E0G1\", \"61B1E78AB:67EGB\", \"9.B1E3D77::.659\", \"0FAB10990:B454G\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"36350228.5:CC3G\", \"127.0.0.0\", \"2\", \"AA9B97E.9FC1EE.\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"D0C19B6C.3.09CG\", \"2606CC24045.:44\", \"9.4GDD51E6A8719\", \".FE9:CE1359C8C9\", \"B307D0DADB3D:D8\", \"255.255.255.255\", \".523E485AGB4GBG\", \"C94244863928AGB\", \"8GF044C8754531E\", \"127.0.0.1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"B6E875A19:FE0A6\", \"01DC4:1.A617236\", \"2.5.20.1\", \"6AB8.D2B:F:.092\", \"1.6C.16B3E42A96\", \"7C474CBC5A8D681\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"DAAF971CC462.98\", \"B6497853G1C7288\", \"B196BC94A56CE79\", \"EB38:.0:8A4C.4F\", \"::2\", \"127.0.0.0\", \"47B195396EC1DFF\", \"2\", \"282402652C4C9F5\", \"2.59.6.2\", \"C83AE19F63EBC7C\", \":F5A55:4C1G7450\", \"108E92:C5:9D1F6\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \".E4AA92G0.2076D\", \"DB5BA817AFE5CF9\", \"28635.9080AB1AG\", \"::\", \"127.0.0.1\", \"G86DA8G60E3A:11\", \"G3F:BDBCF.9E.57\", \"::\", \"99:9C9F26627:B.\", \"0.0.0.1234\", \"1::2::3\", \"5F17AA8AG1CC7CC\", \"2.5.20.1\", \"D0C9.1187AF16..\", \"7A3G6.9C8:B3FB2\", \"7845A8.85B82C8.\", \"::1\", \"FCC93.69BC4BFF7\", \"F5:G058.62BA.:1\", \"2.5.6.2\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"77..6:G959CD:3.\", \"127.0.0.0\", \"2\", \"::\", \"B34B076F35GA87B\", \".7035AEF:07E9G8\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"829C8EBB8.2E9AF\", \"CB1CFAD9B0C01F.\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"6E23A736DDG9759\", \"2.59.6.2\", \"B06A849.B:6D161\", \"0:0:0:0:0:0:0:1\", \"2.5.20.1\", \"D068ADF5D8DEB0.\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"457149GFD56DFG3\", \"0:0:0:0:0:0:0:2\", \"::\", \"2.5.20.1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"6B7C:2E3560598D\", \"::/0\", \"711:E..64B0B140\", \"    127.0.0.0    \", \"754C6DBGA8C824B\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"300.0.0.0\", \"8.C69E:.8.C8695\", \"0:0:0:0:0:0:0:1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"6.GDC2E.:.40836\", \"B:CCE3AA.D275:.\", \"0:0:0:0:0:0:0:1\", \"0:0::0:2\", \"::\", \"4:C3F0DFD9C37A3\", \"EDFE20G2EE1C:D7\", \"::73323GA:C:D83\", \"4FFAE1B59C7.076\", \"C57DG43:D0A25FD\", \"0:0:0:0:0:0:0:2\", \"74:405D76CBDFB2\", \"27C7EC51D8F5AG3\", \"GF2FG995A.2:900\", \"2.5.6.2\", \"0568G.CCC6B4F4:\", \"DFF937E273D3:32\", \"2.5.20.1\", \"::\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"231D0C877CF45DG\", \"G.:BG:5:6538A93\", \":::4\", \"::2\", \"::\", \"1::2::3\", \":80D6G1471F256C\", \".94D8CEE037A18B\", \"::\", \"4B93A72ABEFEG47\", \"2.5.6.2\", \"0:0:0:0:0:0:0:2\", \"::1\", \":::4\", \"0E0GC42FDA558.E\", \"0::0\", \"0:0:0:0:0:0:0:2\", \"5AE6B.16F219.33\", \"2.59.6.2\", \"94083C.51GE90A.\", \"DG0:0AD5:7A41G:\", \"    127.0.0.0    \", \"CB9.0G:61:98389\", \"::/0\", \"6:8045877BBEF36\", \"93E65537A2E0A.A\", \"::\", \"0:0:0:0:0:0:0:0\", \"1::2::3\", \"D01EGEE0:00G5B:\", \"D2198CE04CF3G2G\", \"::1\", \"20744GB0ED477C7\", \"2.5.6.2\", \"8E4350.84890F25\", \"36678A4G:.1:C51\", \"127.0.0.1\", \"338G1E2E241180D\", \".:50F9CF620D3G.\", \"::1\", \"D1:5A21212CAGC1\", \"1:.ADF6278D64.E\", \"::2\", \"0:0:0:0:0:0:0:2\", \"E6GAGCEE3365.A7\", \"G160CF76FF3G74A\", \"255.255.255.255\", \"264FB9C:77F1:4:\", \"0:0:0:0:0:0:0:2\", \"255.255.255.255\", \"::/0\", \"2.59.6.2\", \"8CB7.E3DC8GA433\", \"5B4D54A72BD80DC\", \"127.0.0.0\", \"0:0:0:0:0:0:0:0\", \"294G0:DD8EDB76.\", \"2.5.6.2\", \".GBD:.747DGAG2E\", \".ECE19BG9A.BF23\", \"F97FD323:5FGFG.\", \"2.5.20.1\", \"A74650480GC:45G\", \"2B9GE17B3:D2485\", \"F91F26A48::BED9\", \"GAG82:6AB44C3.7\", \"2.5.6.2\", \"::/0\", \"GG62C1F4F3CE133\", \"::/0\", \"2\", \"CCFA9G8D18B30EF\", \"90B0F9G7F76C01F\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"2.5.20.1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \":G9E15:97365FB8\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"127.2.3.4\", \"0:0::0:2\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::/0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"60527576B5614D7\", \"::1\", \"B5BGA1561:A15G:\", \"8E.9G2G1F8E5C38\", \"59:9G5BC37C17AC\", \"::/0\", \"002F586681069A6\", \"0.0.0.1234\", \"F5F8:6D42DAB9D8\", \"1::2::3\", \"C8BF91C6C06A:.D\", \"1E619F3:C4D4043\", \"1::2::3\", \"7453G6A3DBFE.47\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"3FBE..E00CD.28D\", \"86F:95:74E15FC.\", \"AE.D.7343913AE2\", \".6A17D2962.579A\", \"5ABA:1B562C5900\", \"2.5.6.2\", \"127.0.0.1\", \"CD41F259E60E:21\", \":A263:4B62EA3.2\", \"1CD03B10.AEFACE\", \"0:0:0:0:0:0:0:2\", \"A596E31:E891053\", \"6FBF0E8604F:972\", \"C.318AEB::F3G4C\", \"::/0\", \"83E:B133E:61152\", \"59A.450631093.4\", \"127.0.0.1\", \"::2\", \"::\", \"4E43:DE2GA6B65F\", \"0.0.0.1234\", \"::\", \"22:AG443340FD2F\", \"127.0.0.1\", \"5DABG867344F7:0\", \"300.0.0.0\", \"::1\", \"5F0E1A32:0A681A\", \"::/0\", \"::\", \"0:0::0:1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"8CA7.3FGA:AF442\", \".66436:CDGDDGDA\", \"G12:G203E8371DC\", \"3D9.A817.BB574D\", \"4.2.9E8FF817307\", \"CBFC:3C47586AG2\", \"::/0\", \"56F63C22FG1732G\", \"0.0.0.1234\", \"::\", \"127.2.3.4\", \"0.0.0.1234\", \"FD4B4:3.D4A81B4\", \"3:.09C4A0EA285G\", \"4CG41:0AE84D21.\", \"2.5.20.1\", \"BA8093:1C.D98B4\", \"0.0.0.1234\", \"3:66AE38DGG71GB\", \"0:0:0:0:0:0:0:2\", \"3C4F..1.504052A\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"::/0\", \"74DC0C22808639E\", \"0:0:0:0:0:0:0:2\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0:0:0:0:0:0:0:2\", \"C7G31:.6459.4C8\", \"B6D9F2.4:21981A\", \"4F6D21.5FECABAG\", \"6GF5549F00G5.06\", \"8138F86FBED969G\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"48.4651CF17:96A\", \"::1\", \"B:304.:CE05CC.9\", \"B3FF.2056CF7G7.\", \"B6:2D2A5E3B7E8D\", \"A56CCFG:B7:2F6G\", \"::\", \"56.:C2DBB85GCF2\", \"A24GC17AAA3E50:\", \"127.2.3.4\", \"255.255.255.255\", \"B5:F55..A1BAC.7\", \"2.5.6.2\", \"1EF150ABFB6B5GD\", \"940846G719F629G\", \"7G0C03F1224:67D\", \"0:0:0:0:0:0:0:0\", \":::4\", \"DEEGF8G4BE493D5\", \"A37GD25G62C8322\", \"526GE0E7:084526\", \"1..51GA58G516A5\", \"2.59.6.2\", \"300.0.0.0\", \"0:0::0:2\", \"DG:4E67712FF.BF\", \"2.5.6.2\", \"::\", \".9CF2FBA.G8GFEC\", \"84.B6GA9.B9F490\", \":E2D312EFF2A813\", \"5DG9FEF3A4A4390\", \"1070C66388:0.E0\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"192.168.0.1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"CG0A3E:3E8FFBDC\", \"GGD.08902CEG.F1\", \"2.5.20.1\", \"89.CF.0BF2055DA\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"F9BGACCF:DB2B22\", \"48199A2B38G5GG9\", \"::2\", \"2.5.20.1\", \"2.5.6.2\", \"5AEF607A6:E:DEC\", \"255.255.255.255\", \"DGAA2D.12633G52\", \":::4\", \"0:0:0:0:0:0:0:2\", \"0:0:0:0:0:0:0:1\", \"0.0.0.1234\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"6246D5E54276:0F\", \"300.0.0.0\", \"7:A133D9G46BG.F\", \"2\", \"127.2.3.4\", \"2595:33GF73AE61\", \"70BFG702E23GBGE\", \"46B12CE6..69163\", \"    127.0.0.0    \", \"0:0:0:0:0:0:0:0\", \"08C8FG86142.CC:\", \"::\", \"8C9A86CBE1D727F\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"127.0.0.1\", \"::2\", \"0:0::0:1\", \"0:0:0:0:0:0:0:0\", \"0.0.0.0\", \"FC4GA5386F6AF:C\", \"102BE48CFCA:9F3\", \"3825389..A19689\", \"192.168.0.1\", \"A43G07:ACG977:7\", \"0:0::0:1\", \"0:0:0:0:0:0:0:0\", \"1::2::3\", \"4F62B9DC8278E86\", \"FE4C:G:5EBDA217\", \"0::0\", \"7FB020CC61AC296\", \"0:0:0:0:0:0:0:0\", \"0::0\", \".F78BFG9A2AC24D\", \"C0:8D8C36AA345E\", \"0.0.0.0\", \"127.2.3.4\", \"    127.0.0.0    \", \":::4\", \"300.0.0.0\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"21F86CEA9A6:70C\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0:0:0:0:0:0:0:0\", \"192.168.0.1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"C689G6:8D9F847E\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"7F83.4E316G2.AB\", \"3F7.A0E2DD841G0\", \"0:0:0:0:0:0:0:1\", \"9A2D5CG78GF03.0\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2\", \"FB:CG:4DGD8.EE.\", \".6:9CF7C53GA:05\", \":.A0868DA69A9A4\", \"G9:3C3G.:E.1.A7\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"300.0.0.0\", \"::2\", \"255.255.255.255\", \"127.2.3.4\", \"2\", \"127.0.0.1\", \"7:604:2DGA42::F\", \"0:0::0:2\", \"B93:05.DE53.1B9\", \"DGFCG:0AA.6D1:.\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"12DB05AD636F9C1\", \"A2D68C.:09D4FB9\", \"3565G.88E5F6875\", \"0:0:0:0:0:0:0:1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"D5A8297G2D.F382\", \"621E55F2GC6832G\", \"4:G.887A23FD:E1\", \"C.CD53451E488A1\", \"0BA3G076.7F1:.8\", \"C8G68669D0:D958\", \"67B1FG70EF0CE9:\", \"F0:1:EA0C3E17.B\", \"G30CC66BED.0B93\", \"1::2::3\", \"4C394EAC6E.G8E0\", \".4B94E0FBGE.B33\", \"17EBE59BC5375F6\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"127.0.0.0\", \":::4\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"B90CCAC3:35.D9E\", \"127.0.0.0\", \"127.0.0.0\", \"37CE3C:F7:FA104\", \"B73E5DE21BB5DC9\", \"C72F21DG77CA6.4\", \"::1\", \"1.138819B5E7A85\", \".907622CD334EB.\", \":6.5035F801E.CC\", \":EG98GA207:C3E9\", \"::2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"9::B.:B984BDBDE\", \"127.0.0.0\", \"3G09D:D:B0F5B77\", \"73E..41.2B690G7\", \"ACG0A51D54341DC\", \"CE0CBF2.E4FE04G\", \"::\", \"3C8D49GD5G42A:5\", \"E3480054EG:1:C9\", \"2\", \"CG9F07:AE29G781\", \"::/0\", \"33C4C64:3CG8BEE\", \"300.0.0.0\", \"0:0:0:0:0:0:0:1\", \"A7G0BE8:DEE1F2B\", \"::\", \"0.0.0.0\", \"G5G15F52D86B6E0\", \"2.5.20.1\", \"31D9831AAAEDAG5\", \"2\", \"D5B.5A8392C8E55\", \"0.0.0.1234\", \"6:3310:2551523D\", \"1::2::3\", \"38FCB1CC41E.94F\", \"44A8578B05G1F7G\", \"0AA7GBCB68DFD6F\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"127.0.0.1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"GD67A01.E267GGF\", \"    127.0.0.0    \", \"F:28:124BAADDDG\", \"611534GC2.G9010\", \"22A:400B4A4FCAD\", \"2C5:3A99:3082GC\", \"D3E:A11.D873142\", \"6.:546C81ED6F4:\", \"5ED9E19.6FF.C88\", \"2.59.6.2\", \"2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0:0:0:0:0:0:1\", \"3C23G953C724D1E\", \"2\", \"255.255.255.255\", \"35GEE83:5E:40A0\", \"C:551B60E:92BC:\", \"::D96:A821DF00.\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::\", \"127.0.0.1\", \"0A:5FAEF338..36\", \"079:7007CF44A7E\", \"AE6.9A8G741A80:\", \"E3::D5E0903331F\", \"7C40D08.:02.0GA\", \"022D53400G2AGA0\", \"0:0::0:1\", \"GC0231280A.CB36\", \"57:..56A9GF0854\", \"::2\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"F57B:6EF8EBAC2G\", \"127.0.0.0\", \"127.0.0.1\", \"622489:DD.4AB.B\", \"38A:.BF:D6:031D\", \"4B2159:6.GFD2::\", \"GE:6CC68:A8EB32\", \"154GBBF946CBFC9\", \"::2\", \"A47FEA83AE:0091\", \"127.2.3.4\", \":FA.D2EB252671:\", \"B.53AE95B4FD569\", \"1::2::3\", \"2\", \"127.2.3.4\", \"A..68E:.E160BB:\", \"0::0\", \"B54D.DB2FD26G7A\", \"127.2.3.4\", \"68464E74D8G4EFG\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0::0:2\", \"D.F:D:F9A6A5282\", \"0.0.0.0\", \"::1\", \"192.168.0.1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"127.2.3.4\", \"13DB0::5AEEED5F\", \"843G::.08092G:0\", \"127.0.0.1\", \"G652.4.:B8895G3\", \":CF3A2E3F708DC6\", \"D2C102398A5FA65\", \"::/0\", \"0.0.0.1234\", \"0:0:0:0:0:0:0:0\", \"2.59.6.2\", \"0:0::0:2\", \"B5B532C17G:8EFB\", \"B4:1GB52.983F4E\", \"::1\", \"81A821E3AC946E7\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"1::2::3\", \"B6.BA726.42C.8F\", \"G.5C::77BBAB84C\", \"::\", \"::\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"6ED14565AG.0E0E\", \"8066C985:400328\", \"0:0:0:0:0:0:0:1\", \"2\", \"9E1:90957GA3A.2\", \".G.3AEFC:9808C3\", \"G9E:30G5AD:F.D8\", \"2.59.6.2\", \"AE0B:87402322F0\", \"B6:081BCB9:CCGG\", \"192.168.0.1\", \"0::0\", \"CGFB5D9B.0.0284\", \"::\", \"BF8.:1E4E4EB8:8\", \".26D7336D54E033\", \"300.0.0.0\", \"5581.6A233G3C46\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"::\", \"8DAF398E990756:\", \"02:61C0CB9GD99D\", \"0AE0F.CB94GFEDC\", \"1::2::3\", \"8D67CFF939GC3:0\", \"0.0.0.1234\", \".B8968364EC26.5\", \"::\", \"0.0.0.0\", \"127.2.3.4\", \"192.168.0.1\", \"1::2::3\", \"7F9D51110C2D96F\", \"127.0.0.0\", \"97DE::38B9B45EA\", \":::4\", \"0.0.0.0\", \"116E587D.8:1D4:\", \"0:0:0:0:0:0:0:2\", \"GCF816964:GEB4.\", \"EAG06D4B94B569D\", \"D8352D0:GG7G66G\", \"D:82A09EA1802F5\", \"286163411A1B2A0\", \"300.0.0.0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"1::2::3\", \"0:0::0:1\", \"0:0::0:2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"5E3CB5CA239D0G0\", \"::\", \"127.0.0.1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"G:BD::08FDA4FF8\", \"192.168.0.1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0G8AD:885B.5720\", \"::1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \":F2:G6.E4.1DA83\", \"F0E2:1D3C5CC:B0\", \"0:0::0:2\", \"A5CBG3004E857EF\", \"0:0:0:0:0:0:0:1\", \"AFD40.68110B1G1\", \"300.0.0.0\", \"4D6547G9827F698\", \"0:0::0:1\", \"127.2.3.4\", \".752D24A9.8G9CA\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"B04AB1D9BB9197.\", \"3G4B2:27D5G2.2.\", \"223F63B1.:EF3.C\", \"D9FF1F74E:BD5C:\", \"FC10E0.D4B4DB1F\", \"03F99EGFAFF3CC4\", \"6.G00D0.B2E6953\", \"6A160G6::A42D82\", \"127.2.3.4\", \"300.0.0.0\", \"400DG4:GGGA2E6G\", \"7D27CF6GB83CDFD\", \"::\", \"2C5BBECF:0A81E7\", \"192.168.0.1\", \"1::2::3\", \"FCDB18D710:4A67\", \"::1\", \"GD.GA4B.C5C:C1F\", \"::\", \"C.GD70156777C3D\", \"52D59E6FE27BA50\", \"87GGC89C6DGDE5F\", \":EBC9E93DA9E:E:\", \"AEAAB430027BAB8\", \":53735AB7FA0E9D\", \"C8BCBD08A4D4DB7\", \"20087421F92026G\", \"127.2.3.4\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"87CF1GACD7E97E.\", \"FF1GGAEC5E12DC9\", \"127.0.0.1\", \"0E57FA99.18265D\", \"BE2BG0D5F49.DGB\", \"A9C:CCA213E5BFC\", \"1::2::3\", \"76.G8:9F6FEDE0:\", \"2\", \"0:0::0:2\", \"::2\", \"G604A19E65.GGE:\", \"0:0:0:0:0:0:0:0\", \"127.0.0.0\", \"1::2::3\", \"8FE:5GAF2D816:8\", \"378D9F5:7:C6CDE\", \"7211917545795E2\", \"5AFC4D60521535C\", \"::1\", \"::\", \"8F9G323B6G96AD.\", \"0:0:0:0:0:0:0:1\", \"2.5.6.2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"5ECF3.B4AE991A.\", \"A.CE4EC6:B7D43E\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \":::4\", \"310.:2375DGF:CD\", \"A1.A4FC95C0G42F\", \"    127.0.0.0    \", \"::/0\", \"2BFC1B73G4G85F5\", \"::1\", \"::\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0:0::0:1\", \"0:0:0:0:0:0:0:2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0:0:0:0:0:0:0:1\", \"2.5.20.1\", \"E.DG44167FD206:\", \"DA5.GFB:B9B2D30\", \"1GC01DF694AE.00\", \"G955E.BC5EAD2E1\", \"01673C3D33G5C48\", \"255.255.255.255\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"C171313BE836D.C\", \"05.AD640BFBA539\", \"0:0::0:2\", \"255.255.255.255\", \"127.2.3.4\", \"0:0:0:0:0:0:0:1\", \":::4\", \":2E.2FFB:.7.B75\", \"A9GGF4A4GDA690B\", \".9231C93353F8D4\", \"150.2FA.091AGG:\", \"    127.0.0.0    \", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"9F.D11:39A0105E\", \"127.2.3.4\", \"2.5.6.2\", \"A::.F7D1..3G5G0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"7E941270EAGAG41\", \"7100A84D505C8:E\", \"0:0::0:2\", \"DD1B7C927D9CDFA\", \"CDAE52AA3F41:.5\", \"A1EF85AD.4.A7AA\", \"127.0.0.1\", \"A..EG3CB16D109B\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"127.2.3.4\", \"127.0.0.1\", \"9B5C5CBA:86E26.\", \"300.0.0.0\", \"::1\", \"2.59.6.2\", \"0:0:0:0:0:0:0:0\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"8137G120.426CE.\", \"2\", \"2.5.20.1\", \":::4\", \":BA:F87CD85:55D\", \"G6CCF801FEG93E4\", \"2.5.6.2\", \"0:0::0:1\", \"0::0\", \"BA7G3G1CGB49D94\", \"54.F.43C1BB3CG5\", \"710358E834EE6:B\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0:0:0:0:0:0:0:1\", \"728.209C11B6C35\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"4.C254GGED943A4\", \"D5CEC93C6F0G5:8\", \"07345F96B633G9G\", \"88:2G6E07:FAC1.\", \"127.0.0.1\", \"255.255.255.255\", \":::4\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"2\", \"893FBGA:236F6:E\", \"2\", \"::2\", \"2CD.6B56AGEFF4:\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0:0:0:0:0:0:0:0\", \"EA2346A1868..0F\", \"2B4E53AC419BF88\", \"192.168.0.1\", \"0:0:0:0:0:0:0:2\", \"2\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"21501.9366E0687\", \"0:0:0:0:0:0:0:1\", \"0:0:0:0:0:0:0:1\", \"192.168.0.1\", \"0E6F84A3DE199C0\", \".G266EG74.764.9\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0:0:0:0:0:0:0:0\", \"CCDBB70041D6EBB\", \"9512:C4206DE555\", \"::2\", \"702FF8D.91A.54F\", \"82A6B57:F:026A1\", \"683DBC:0A52180A\", \"35DF3G.DC.:0A5G\", \"127.0.0.1\", \"0:0:0:0:0:0:0:0\", \"497F6676FB7740:\", \"0.0.0.0\", \"2\", \"57CG01:D4161.83\", \"127.0.0.1\", \":::4\", \"0:0:0:0:0:0:0:2\", \"F4488CG:8G99CG8\", \"::1\", \"6BG042.6G96F.BA\", \"4G5F7.A5:0BA0C9\", \"G.D8A.3A.1GB209\", \"E9.4C::A1D3.B4E\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"7F52:C::A7C51AE\", \"2.59.6.2\", \"127.0.0.1\", \"127.0.0.1\", \"E0EE82FCD81FE7B\", \"0:0::0:2\", \".DA1D6.F54:36EG\", \"G13:GED41EC3D36\", \":6..2G4A378:G37\", \"3DGGEA4A79ABF87\", \"BCC4C06A28680A7\", \"0:0::0:1\", \"::\", \"0C1:3911D1EBA07\", \"    127.0.0.0    \", \"G8B7C9D8.E09AB6\", \"::1\", \"::\", \"::\", \"0:0:0:0:0:0:0:1\", \"::1\", \"C76BE3407472592\", \":::4\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"233B65D170297:E\", \"26.E3:50D95ABE8\", \"2.59.6.2\", \"G.3F89AFE674D:6\", \"0:0::0:2\", \"89G5F:347:26GE6\", \"G45D529194AEF96\", \"0.0.0.1234\", \"2.59.6.2\", \"B:29:.EF8:1472E\", \"28E994A1B2A.G0B\", \"127.0.0.1\", \"::A.A24649716E4\", \"300.0.0.0\", \"A833715B::6D751\", \"372GCB703D67.44\", \".5FCC846.5CDA17\", \"0:0::0:1\", \"::1\", \"4D88:13DF0A8C1.\", \".BFG4:1AAEF6G50\", \"92.G3982B4.7145\", \"77E41G494906A51\", \"ABFG1E6DB01:17C\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0:0:0:0:0:0:0:2\", \"127.0.0.1\", \"3960.AG6C55.CAE\", \"D:74AC49AFC3D:4\", \"744266208.538AB\", \"E52FBF8F7359ECE\", \"2.5.20.1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"7EEBB299B9598.4\", \"60E7BEECEBBB706\", \"127.0.0.1\", \"::1\", \"435:G3937CG78B.\", \"0::0\", \"9713687C48FC97B\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0:0:0:0:0:0:0:2\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"300.0.0.0\", \"8GB33CC96219F.6\", \"FFA5105EFA41C5C\", \"G7.A6.4.G:3DD84\", \"::\", \"::\", \"406D1A8EG6:80G3\", \"EE2.G7G3A:G337A\", \"5BB411C:.C37B1A\", \"::1\", \"A.FE.7DA56A2C44\", \"2.59.6.2\", \"127.2.3.4\", \"EA8F0986068BE:C\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"3B99C1CA52BF91G\", \"::1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"162:.C.3406D4FD\", \":66886..AG933BA\", \"127.0.0.1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"A4.A6EAAB0A.FE4\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"B67128827DBFF9F\", \"0:0::0:1\", \"145E1.F:GD7DG.4\", \"0::0\", \":B95E88707AA::E\", \"127.0.0.0\", \"F40B5A4G774F87G\", \"::/0\", \"127.0.0.1\", \"24D2CBE:5CC0016\", \"2:BA82D16FDG9F0\", \"::1\", \"FG.FEAFA:65FF:1\", \"2:1AB06B03.7DEE\", \"0:0:0:0:0:0:0:1\", \"0:0::0:2\", \"127.0.0.0\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"127.2.3.4\", \"0.0.0.1234\", \"127.2.3.4\", \"300.0.0.0\", \"AA0BE7F6386C642\", \"9:4EEEGE740G:AF\", \"1::2::3\", \"BC711C73C81A236\", \"829580AD3FGF.C6\", \"G2B.B11D84AG7GE\", \"610CF57F15613F4\", \"0:0::0:1\", \"7C0323D732457E2\", \"5:C3F8A418.782D\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0G5AA682G89:995\", \"0::0\", \"::\", \"8:GAEDFAD:A1011\", \"BGE3G44:5A0B208\", \"2:C98:97235F4B2\", \"5:A81:5F0A46.49\", \"D:.FF4D45E6..65\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"127.0.0.0\", \"7F:5:1GEA7GF57:\", \"0.0.0.0\", \"8CGB15C4386E754\", \"2BG014381EC9DD4\", \"0::0\", \"4EEF4CC56AG3423\", \"13G39GD43D7G8.3\", \"127.0.0.0\", \"C3E33312AB1.F50\", \"F5:61.1897:602:\", \"01E0:2612E440.4\", \"7972A4G54DF:.13\", \"DD3.901.0C9:09D\", \"44AC:68AA3062:4\", \"1:CC:52F174E098\", \":::4\", \"5DF1CA8CF25D8G9\", \"8A8665:C76EE134\", \"127.0.0.1\", \".653A.6358GA91F\", \"2.5.20.1\", \"0:0:0:0:0:0:0:1\", \"255.255.255.255\", \"D8::FE81A0G7466\", \"0.0.0.0\", \"19C0D727B59.2C2\", \"0:0::0:1\", \":B.42349G87A4BE\", \"    127.0.0.0    \", \"127.0.0.1\", \"C9BAB893E56EC9F\", \"8G:216B:G961EF5\", \"338A6509AE.1843\", \"5EF9205A.CGA:G0\", \"::\", \"::B7D87CC21.F40\", \":::4\", \"0:0::0:2\", \"    127.0.0.0    \", \"EB9.BB2C8:20.C.\", \"0.0.0.0\", \"0:0::0:2\", \":6184DE220E:F2E\", \"F49GE51523.34:0\", \"::1\", \"4814C195G.D4.52\", \"B7.E92B9ED0E.30\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"    127.0.0.0    \", \"::/0\", \"42.93695ADE3:41\", \"1:F0C87118FFC29\", \"BDA.7BEA.5447GG\", \"C3G2DF.42B16422\", \"B15718FD5475AB6\", \"43460730BE48A54\", \"127.0.0.1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0::0\", \"2.59.6.2\", \"300.0.0.0\", \"1C0C6A9EF66GF44\", \".7FBA5347E4E985\", \"::/0\", \"2G8E0A::F769FA6\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"127.2.3.4\", \"300.0.0.0\", \"4E5762:7.0AG11D\", \"7E2AC79EC071587\", \"0:0:0:0:0:0:0:2\", \"    127.0.0.0    \", \"0:0::0:1\", \"0.0.0.1234\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \".41F.A7::92948A\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0:0:0:0:0:0:0\", \"0:0::0:1\", \".DE99AD52BE21EE\", \"300.0.0.0\", \"2.5.20.1\", \"    127.0.0.0    \", \"G0.E2826A90A.C9\", \"2.5.6.2\", \"994F1E.AB6095B6\", \"47:B8FDB7:937C2\", \"0.0.0.0\", \".64BBFB42AFAA5B\", \"2.5.6.2\", \"192.168.0.1\", \"0:0::0:1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"4G6GGG9GGC63:.0\", \"0.0.0.1234\", \"6B9DGE95C1G7007\", \"0.0.0.1234\", \"5.GGA1BB7B69:D9\", \"1BE321F27F9D438\", \".G14:B.2F686.4.\", \"B.:DF:66B42A27.\", \"0.0.0.1234\", \"192.168.0.1\", \"127.0.0.0\", \"0::0\", \"1::2::3\", \"9BB3B5.2F2.3274\", \"B980:7.5ECE2B5D\", \"3179D827A1D7F7D\", \"255.255.255.255\", \"GE98735C4EC:63B\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"127.0.0.1\", \"9.2G5434B9F7G.3\", \"127.0.0.1\", \"3:A.20E.0448B3D\", \":8EB3B.C43.:925\", \"GF4AE284D.1A.1E\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0.0.0.1234\", \"97E79E50A9CE81C\", \"E432451F5138A19\", \".68A8:F048.:B03\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0::0\", \"36BB4G6E0G43B7C\", \"A7E5BG24C5EC005\", \"192.168.0.1\", \"::\", \"2\", \"1::2::3\", \"98G3F9CF0639E:8\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"D91D::8926D13:B\", \"BFE:60C381DAAEB\", \"812G.8DDD2G81DE\", \"::2\", \"127.0.0.1\", \"B6DDDDAG1E8G70:\", \"78CAD7A089AE5C5\", \"::/0\", \"0:0:0:0:0:0:0:2\", \"    127.0.0.0    \", \"1F.GB76.6..G.C:\", \"127.2.3.4\", \"32ED5800C3BA6DG\", \".6DB3G4BD5FA460\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \":C0F0FAAEB39D3F\", \"4A2D8F868B71130\", \"0:0:0:0:0:0:0:2\", \"255.255.255.255\", \"127.2.3.4\", \".:5G1084:5792.6\", \"2C1BF75186E5.75\", \"BA9E3B22G798D.9\", \"::2\", \"0:0:0:0:0:0:0:0\", \"BDAGDGGAFE383:9\", \"::\", \"0:0::0:2\", \"BD2A10F4C279:A8\", \"0.0.0.1234\", \"FG75C:21009F9A4\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"66.8F46A2C8D3:4\", \"021E34681D82:13\", \"255.255.255.255\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"1AF88D94776G622\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0:0:0:0:0:0:0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0.0.0.1234\", \"::/0\", \"::2\", \"0:0:0:0:0:0:0:2\", \"C9B7A0.DG2C7ED:\", \":.6:.:E:41A29A6\", \"::\", \"::\", \"72G40C.0FD26DFF\", \"F85113583190G73\", \"0:0::0:1\", \"0:0::0:1\", \"127.0.0.1\", \"0:0:0:0:0:0:0:0\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \":B2197751F7F.33\", \"FA5FEADADC6B4DA\", \"B3A778ECG9G.061\", \"EGG6B2:F52B0BAB\", \"0.0.0.1234\", \"2.5.20.1\", \":69F53B556.7C19\", \"127.0.0.1\", \"2.59.6.2\", \"4EA82BCFB8.5194\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"08502:DBF6E2D8B\", \"    127.0.0.0    \", \"::2\", \"7FD0F476.24::F5\", \"3246BB5.48B:286\", \"2\", \"3:CE31G9.G1D.CA\", \"270B7::EF34CC45\", \"15.1G9DCA3GBBC.\", \"2.5.6.2\", \"127.0.0.1\", \"F9E.824E2:9A4DG\", \"192.168.0.1\", \"1::2::3\", \"51C14:4..EF0362\", \"127.0.0.1\", \"F:97A8:CFBD:9E9\", \"0B9C2EC396C049D\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"D9F8B9BA3AD84..\", \"EE3496D7.F511A3\", \"5D5A69D9BB9:33D\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"::\", \"94D68:8A:GAB24.\", \"2\", \"5EAE4C42E557167\", \"1::2::3\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0:0::0:2\", \"CC:A367:48539CG\", \"B4884084E1G3A59\", \"E7.EC.59ACA13BF\", \"42:E3F23G364.:7\", \":.93:501A6.54.0\", \"GFE5.8BG56314.2\", \"E60E3456C4ABB.E\", \"EAC01:2BC.0:70:\", \"8238:57B59D5:74\", \"192.168.0.1\", \"45:1F2197108855\", \"46GC31877388:1C\", \"2\", \"1::2::3\", \"CE9C707.D8:DAC8\", \"3FGB100DEE4CF.2\", \"3D71F3F.618:DB5\", \"127.0.0.0\", \"::\", \"22F0D777E00776.\", \"1A9853661EA799D\", \".7FDE85BA5C114.\", \"G4C0D9EE1C27DD0\", \"AF.8F80EBC597G7\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"FB21B.60:5484DC\", \"33BG6E.1981.C66\", \"2.59.6.2\", \"::2\", \"CF8E39ACGC:053:\", \"5:C1.9DA94B.5B5\", \":::4\", \"2.5.6.2\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"GCE6A515A23C57D\", \"0:0:0:0:0:0:0:1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0G91BABFE:1DBF9\", \"2.59.6.2\", \"3CA5914748EF:G2\", \"127.0.0.1\", \"G508637A119G:8B\", \"0:0::0:1\", \"::\", \"::\", \"127.0.0.1\", \"300.0.0.0\", \"C3741G5GDF.6FE6\", \"2\", \"6EG5F.1637:3AB0\", \"127.0.0.1\", \"::63.95AD:9:6A4\", \"41F70E590168150\", \"A39205.3240:::2\", \":::4\", \"56.186A8FC7BFCG\", \"G007AA:7GA2B337\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"192.168.0.1\", \"::2\", \"0:0::0:1\", \"2.5.20.1\", \"2.5.20.1\", \"38F:34.C971E6.D\", \"2.59.6.2\", \":E4A8DF9.:6:E:C\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"    127.0.0.0    \", \"359B8115GA4:1BC\", \"G6CA670EFE5E72F\", \"2.5.20.1\", \"0:0:0:0:0:0:0:2\", \"0:0::0:2\", \"647G.1344FF3DA1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"A83679.0005520B\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0::0\", \"9.A6C.19C01.6G8\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"::\", \"EB83BDDB79229G5\", \"1781F:8F.ED7C3A\", \"5C.G1281CDG97.G\", \"0:0:0:0:0:0:0:0\", \"38820BA.2EB8753\", \"AE897BF68A5G62C\", \"1::2::3\", \"105136C2F:30.67\", \"::/0\", \"0:0:0:0:0:0:0:2\", \"::1\", \"8CD32:E0DB7.AB9\", \"2FG9A5C8A:B56::\", \"6879AFFE060BG1:\", \"127.2.3.4\", \"0:0::0:2\", \"A.7DB4G025G987:\", \"41D6909:212C9FC\", \"127.0.0.1\", \"::\", \"G626545B:E24050\", \"FF18.4AB::662.7\", \"127.0.0.1\", \"8361C142GC2G:1A\", \"0:0:0:0:0:0:0:1\", \"749GD04FE::48AG\", \"C02.9B2A0B3C:AE\", \"127.0.0.1\", \"411BF8C5:97728C\", \"::\", \":.9G59F6B93.1D9\", \"D441G76B0C:8EB.\", \"615117E8D3:4F30\", \"192.168.0.1\", \"9:0DF9.893191D2\", \"E33EG4.83069084\", \"4G48EG:31C4D9DA\", \"6A1EC8610E:2:2F\", \"192.168.0.1\", \"GAFD0G85EE6F5:3\", \"300.0.0.0\", \"127.0.0.1\", \"127.0.0.1\", \"EG6EDE529:23G10\", \"2.5.20.1\", \".6794.F99202097\", \"127.0.0.1\", \"0:0:0:0:0:0:0:1\", \"7DDA:2FE8:6DC51\", \"FB1.3C0GG6:EDE7\", \"2\", \"4E7FA4D2C16FBEA\", \"E9.664DF6775F44\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"G8C52:3A7B2555.\", \"6FB5620F5AF5.05\", \"C:EED3D:720G2FF\", \"AEBG9458BDE9.8A\", \"0G7G11CF0DBCC2.\", \"2.5.20.1\", \"66:55.FB66A235F\", \"0:0::0:2\", \"2CE79BFD2378334\", \"B.9C325A0DBF:F7\", \"2.59.6.2\", \"83C72G06GC:06B6\", \"    127.0.0.0    \", \"FG:80D0BE5093DE\", \"0:0:0:0:0:0:0:0\", \":::4\", \"GBDF4E1:C4C2D67\", \"::/0\", \"7EG01EB.BG9.FB0\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"5.6:B8EA6483363\", \"68.4605G9F3CD8E\", \"05CG.4D.25D9E7C\", \"0.0.0.0\", \"BEEDC4.DF008064\", \"E519CCF6:DEDD35\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"192.168.0.1\", \"::2\", \"2ADD37DF4B7B2G8\", \"::1\", \"35.5C45F2C1F91.\", \"0:0:0:0:0:0:0:0\", \"5:E46DD1G1C547:\", \"127.0.0.1\", \"C3BEF1A:E408.70\", \"F8.17E7:E13E313\", \"127.0.0.1\", \"300.0.0.0\", \"0:0::0:2\", \"BD69254ADBA39F5\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2\", \"770CB402EBG3.4G\", \"127.0.0.0\", \"127.2.3.4\", \"0:0:0:0:0:0:0:0\", \"6GA9.DC7D7CCBAB\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"3E:DED6D109A98A\", \"0:0:0:0:0:0:0:2\", \"59E53E:17E5809A\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"2.5.6.2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"    127.0.0.0    \", \":5F9DFC6EF5:7D:\", \"279E8G45.G2FA26\", \"F26BCG6B071GDG:\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"127.0.0.0\", \"0:0::0:2\", \"2.59.6.2\", \"777B7A94GGGD3.0\", \":A626B5.530.DED\", \"2.59.6.2\", \"0:0::0:2\", \":::4\", \"2.5.20.1\", \"807CEDADF3:F.5.\", \"284A44B37D85C50\", \"A2753AE054F:9BD\", \"GFD4C5DEF220B76\", \"0:0::0:2\", \".D:C:563D7484C1\", \"2B05109CEE3.6BA\", \"BB93.2017AD.FA0\", \"C3F807C0558BB9.\", \"9D:85F7914F0462\", \"4977G.2B4.7BCGC\", \"B9FEA:E8AFG9D1D\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"C91DED6D.D8DG9D\", \"::1\", \"E7:19C0F6E489:6\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0:0:0:0:0:0:0:1\", \"::2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"EC:1B.8G1GB06DD\", \"::/0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"6F510B5.67BB:.1\", \"1::2::3\", \":::4\", \"6BFD4::31D791DA\", \"5D.06F3C788.A51\", \"..E3ED47390D3E8\", \"::2\", \"09B45G.4841787B\", \"::704FA1DDE3E84\", \"1EF84B418990:E8\", \"::2\", \"2\", \"2.5.6.2\", \"5BGE2:.27F9BB:A\", \"127.0.0.1\", \"0:0:0:0:0:0:0:1\", \"2.59.6.2\", \"9C5B46B7105F:FE\", \"78A7.F623.E.76G\", \"0.D001661D4363:\", \"BA46F26.260FEC.\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0:0:0:0:0:0:0:2\", \"A68ACA02960E1F.\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"300.0.0.0\", \"0.0.0.0\", \"0:0:0:0:0:0:0:0\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"4.3709G3.B239C.\", \"0.0.0.0\", \"192.168.0.1\", \"7513GEDB.75C8EE\", \"2.59.6.2\", \"2\", \"EF619GB.E21F095\", \"::/0\", \"G:71.6:82C914EA\", \"F.DE333B.572CD5\", \"E0:F961.930C568\", \"C8EGC7621G:A5:3\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"::2\", \"0:0:0:0:0:0:0:0\", \"2.59.6.2\", \"::1\", \"300.0.0.0\", \"::\", \"550813.D8BECA.1\", \"999257B..6FGB3D\", \"1C92G:G0D:34:DA\", \"7D7F:39CD1:.720\", \"2.5.20.1\", \"127.0.0.0\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"99A4G3CCB.B10BC\", \"192.168.0.1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0.0.0.0\", \"0:0::0:2\", \"2086.GG:7E:6C.5\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"127.0.0.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"D7BD986E8G.4870\", \"D.00.11G87.50A:\", \"34AGF1GA9BD6411\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"E3AACB0F3:.D19E\", \"::1\", \"1::2::3\", \"2.5.6.2\", \"2.5.6.2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0:0::0:1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"2\", \".707:814D128:1G\", \"5CAE2A7FED18C.2\", \"2\", \"0:0:0:0:0:0:0:2\", \"E9DE0A952CAD6C4\", \"EA8:A7E976GDAG9\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::1\", \"47BFB5.669B13G3\", \"2.59.6.2\", \"300.0.0.0\", \"656AD9.GFFD13C:\", \"::/0\", \"2.5.20.1\", \"AFDA632A27C3G:2\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"F50E77.GF703B79\", \":::4\", \"410A636.20GA:A.\", \"246EGE74C10B.47\", \"E5DFF3..9.9:910\", \".DD1.7AC22051C9\", \"G272D1.EFA2878C\", \"::2\", \":2319F0GC:G2698\", \"::1\", \"0:0:0:0:0:0:0:1\", \"6D78.70:84DFA56\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0:0:0:0:0:0:0:0\", \"::\", \"3:C:96.A5G2AA12\", \"DDGD2.GBG82D9FB\", \"D.BG6D.G8E:9AG1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"2.5.20.1\", \"B638FB976D119B5\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"G6A.A240D0C38G8\", \":5794716CBDBC4B\", \"28836:4CB.98562\", \"4FE13:D6A973G4G\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"2.5.6.2\", \"::\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"8625.:4EED.F81C\", \"::2\", \"192.168.0.1\", \"FGGC9.7443D6G66\", \":::4\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"3D32.9218GCD38E\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \":7DF1323E226C2:\", \"58.5.G3135C1.5:\", \"79.2CD0B2E4D745\", \"0:0::0:2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::2\", \"4FA1:32BB562FF0\", \"3A17.BE40C40A2D\", \":C5:9DB3:0EDD58\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"127.0.0.1\", \"8FB21B2.92:8C:3\", \"::/0\", \"::2\", \"G1G46D4.96A3D9:\", \"3903CADGG7:407A\", \"0::0\", \"14.5C:88DF1EDC1\", \"3:EABA66:854C1F\", \"3274F7BBBFG2B0A\", \"127.0.0.0\", \"7:EA37FFE263:FG\", \"2.5.6.2\", \"782BG.CD477C93E\", \".8F:0G1G6A4E5GC\", \"7DC802A:C580C:C\", \"0F37B375027.847\", \"24A56A4770E2G4B\", \"4A94B75A35131AD\", \"1F::6G82E8B:DE3\", \"ED936.AC4:B:.EA\", \"D1C46E93BF1397E\", \"787AEGG4GCBB0F6\", \"A65D60B2099.AB4\", \"B:EC4:.G068A9B3\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"65700D50.0EE19.\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"::/0\", \"8A4C8.2AB976D1F\", \"2.59.6.2\", \".67:225B5:G4144\", \":6A6799A1DB4:7D\", \"0:0:0:0:0:0:0:1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0:0:0:0:0:0:0:1\", \"C7G71069B7:1:D8\", \"2.5.6.2\", \"2.5.20.1\", \"0:0:0:0:0:0:0:2\", \"0:0::0:1\", \"8540C42AD3:717D\", \"C:1C65D9EE0G2D1\", \"53E00005C01.FBC\", \"0.0.0.0\", \"70F0GGG598F75:F\", \"16FF.9GE:A:EBCA\", \"BF:.:89A.GF3B72\", \"300.0.0.0\", \"2\", \"2.5.20.1\", \"F3EE9C0688B8.4D\", \"300.0.0.0\", \"0:0::0:2\", \"6:CD.3CE1A9:GD2\", \"50AA571064BD333\", \"300.0.0.0\", \":GF94.7899.EGE3\", \"::1\", \"0::0\", \"    127.0.0.0    \", \"96926E155F6F:4F\", \"6.D069E70476E0D\", \"2.5.6.2\", \"0:0::0:2\", \"C1.1.9C07150:37\", \":046AG2453B31AE\", \"6863:FC757C932D\", \"G2GC06D1D80C1GA\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"D85.G:314:3763C\", \"300.0.0.0\", \"A68FC74AB6:75:1\", \"300.0.0.0\", \"C62286A21488716\", \"0.0.0.1234\", \":F0418GD.55C4B.\", \"::\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"8GAG8A7.560G236\", \"127.0.0.1\", \"127.2.3.4\", \"82.GB220E78252E\", \".204B795577DA9:\", \"49C7GC83GAGE8:C\", \"0.0.0.0\", \"300.0.0.0\", \"    127.0.0.0    \", \"0:0:0:0:0:0:0:1\", \"A9110207D5F5EBD\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"::\", \"2C9E:932D2G49D6\", \"48:E93BFD8G9D8F\", \"1:A94GDAA5A70AA\", \"::\", \"::\", \":::4\", \"FC394D2D4EE:A58\", \"3E2.61161A55ECE\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"..8GF92:977:552\", \"4GBBDC6FD8:5G9.\", \"B3B2C85F08E1837\", \"C.8G9DG.EFG4AAC\", \"0:0:0:0:0:0:0:1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"2.5.20.1\", \"2.59.6.2\", \"G7B9D.EE.:6:09E\", \"192.168.0.1\", \"0::0\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0.0.0.0\", \"C8314.1F6936E68\", \"0::0\", \"0:0::0:1\", \"48F7C.49.CDB089\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"606D0:9BG:6E.7A\", \"B.:G54604:B01.D\", \"127.0.0.1\", \"30B54C277:4DEA4\", \"D16C7:26FCAA88.\", \"127.0.0.1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0CDDG228.7C0C9E\", \"3A7DF8B8AA18132\", \"127.0.0.0\", \"G2FF60855C887F4\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"G09AE6FF385C8BF\", \"EB26E467D546GF8\", \"127.0.0.1\", \"88.6:.43FBC5251\", \"2E99027158G:470\", \"255.255.255.255\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"B67E.69D7GB2BA1\", \"1F43085FDD5GBE2\", \":::4\", \"F59AF6B0G5:.G77\", \"127.2.3.4\", \"2C309671:1B1C:8\", \"2.5.6.2\", \"39AA903AC47FF4.\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"7D05341F275.:CE\", \"AFBA8.900G93BBB\", \"6:04E5.B.B2606.\", \"192.168.0.1\", \".E8B81E547.5C72\", \"    127.0.0.0    \", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"729DF813750CC3:\", \"0:0:0:0:0:0:0:0\", \"1041C09G51E4BGB\", \"50E4D36D88.C91F\", \"EF8EF85D58EC31D\", \"::\", \"::2\", \"127.2.3.4\", \"40:.1GCC71G3DBD\", \"D5G83:328B:2.A4\", \"8:F4C9.DE96:.9F\", \"8EFB34CF:G16FA:\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \":D3:755716ABFEG\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"GD82732.:A87AF0\", \"5G95EE6:214E3:4\", \"127.2.3.4\", \"0:0::0:2\", \"G1F0AAC8594A55:\", \"192.168.0.1\", \"F8.53.4..D84.EF\", \"138.2G2AE.336:C\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"    127.0.0.0    \", \"0:0::0:2\", \"DE6EC338EFB:0FB\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0.0.0.1234\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0::0:1\", \"0.0.0.1234\", \"0:0:0:0:0:0:0:0\", \"::\", \"::\", \"0:0:0:0:0:0:0:1\", \"5542668B1:D982E\", \"::\", \"FCD11C0C5.2BD9B\", \"    127.0.0.0    \", \"::2\", \"0::0\", \"262B916.48.407:\", \"    127.0.0.0    \", \"2\", \"2.59.6.2\", \"D:466BC36E30AC1\", \"AE.6AEF:DA4D906\", \"127.2.3.4\", \"::\", \"F9994..1..E9.BG\", \"::\", \"::\", \"AFAFFA1661:44G8\", \"247F0141:F:02EG\", \"0C5BD29G9620::E\", \"127.0.0.1\", \"8G9964EF3FFGE39\", \"BCBE.DEEF3E6.13\", \"456.0.6G1G9C4.F\", \"A0015FF7B5:D381\", \"0:0:0:0:0:0:0:2\", \"2.5.20.1\", \"C4A2465:.4.:CD5\", \"7F952FB6A22856A\", \"::1\", \"BD2088C19G9:2.2\", \"912.E80:8D7231A\", \"0418C8E4AD3654G\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \".02::ACBBG:371G\", \"127.0.0.0\", \"3CDCA5A7C7B097.\", \":89F1D.D587C29.\", \"::\", \"CF3F54.57116E:9\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"B.B:297BB152GB0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0::0\", \"G9272DF:3::.FE7\", \":G49AB97B:208G4\", \"0:0:0:0:0:0:0:2\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"19ECG3BB71AFCCE\", \"0:0::0:1\", \"FA87GG485A52B74\", \"BAC4643.B0.2DG.\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"460754CFD9B1.21\", \"::1\", \"9F85:E8B79893C8\", \"95GB3B3B:E:0340\", \"254C3GD6812G8FC\", \"633DBAB6.31E:60\", \"2\", \"    127.0.0.0    \", \"8E.GG70:B5D03:6\", \"3F61G3.816EB:.4\", \"A34C48AF1:357D8\", \":G5C96489EA7D9F\", \"255.255.255.255\", \"4BE9G14F5044604\", \"13E01:235GCAD7D\", \"GE561BD55C.E8CC\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::1\", \"300.0.0.0\", \"0:0:0:0:0:0:0:1\", \"    127.0.0.0    \", \"2A52D0.EA26AD5C\", \"6446.1DG5135D46\", \"    127.0.0.0    \", \"0::0\", \":CGCD47E.G6D2.A\", \"127.0.0.0\", \"C66.87GFC8EF:GG\", \"EB5E657G1C0G9B4\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"::\", \"F812G474GA08.3F\", \"31576C39C2AEA28\", \"01:CC206BA8E8FF\", \":61919120296E:F\", \"A8C4CGF.B:EED99\", \"192.168.0.1\", \"0:0:0:0:0:0:0:2\", \"2.59.6.2\", \":::4\", \"36DFD:E153CD5A3\", \"655CC6855.G8424\", \"CEDE70GF8CD38F.\", \"127.0.0.1\", \"4E0G6E07B17426D\", \":D529.2B374F39C\", \"0.0.0.1234\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"EC98F67858A4EAG\", \"::1\", \".:.AD83337CB1F5\", \"192.168.0.1\", \".57938G0ABEC7AD\", \".28092DE43G28E8\", \"FD1D9FCG189GG71\", \"255.255.255.255\", \"74851BDBEC.8286\", \"2\", \"0.0.0.1234\", \"5B5D8:8E4GG3A29\", \"45CB:10475D0DD.\", \"F54:18.7BC:ABF0\", \"1::2::3\", \"63F0GB353F40F10\", \"GEE540::10A8751\", \"499F313B2B6GF5.\", \":.E52B7D:FBE4G6\", \"2.59.6.2\", \"2\", \"GCC415540C:086B\", \"0::0\", \"23AACB:928D53AD\", \"9549D50B:GB5.2E\", \"127.0.0.0\", \":::4\", \":DA4C.5CDB2G220\", \"58::9152FC5DCFC\", \"FA48728912F747D\", \"89GDB8A.C358F37\", \":A:C6F5F.53..6E\", \".A:653B98GA:028\", \"192.168.0.1\", \"::2\", \"6AC4.5GD..75AEB\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"834AAB0CBB.BB4C\", \"0F.:.AA46D0A3EF\", \"5EG.9:164EF27B0\", \"504E01C33GC79.F\", \"8C1F2FA95CGE395\", \"::/0\", \"2.59.6.2\", \"G6B66867BCC50C3\", \"127.0.0.1\", \":::4\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"A00.:92BC4:C33F\", \"98225.59F4.B337\", \"CED1:268:44F51C\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"8C:04G408G:BC2C\", \"300.0.0.0\", \"0::0\", \"0.0.0.1234\", \"49A05G8G2D93533\", \"A.4EF1A07D2.G0E\", \"8015530E.17A.0C\", \"725821C981CBBGB\", \"::\", \"00DA61G2AC24348\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"9D488EE5E84C126\", \"2.59.6.2\", \"::\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"    127.0.0.0    \", \"127.0.0.1\", \"F044D3.AGEG9:81\", \"37793:A1005.75E\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"87FDD46D9A56497\", \"1E16:G6:92A4BB4\", \"CAEB5F5C3790FG9\", \"45DCG867:A5:79C\", \"17F7:6C.8E::F0G\", \"FFD5045BD2E1A4B\", \"7C5B.G535CCF5BD\", \"D:D0200B9::3G0B\", \"::1\", \"9AFGDE8FB.1A984\", \"300.0.0.0\", \"0.0.0.0\", \"0.0.0.1234\", \"FG.EF41717.F7AC\", \"751619B4GB:BC62\", \"2.5.20.1\", \"::\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"3AGAE119G9CE9:6\", \"3D868:FE.D0F850\", \"::/0\", \"::\", \"5:1.0E7E4G08E49\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"B:54864086FB2:2\", \"::\", \":73:17C74C59A24\", \"8..07F96.F43F9A\", \"EA5:CAAB94F.911\", \"0:0::0:2\", \"127.0.0.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::\", \"    127.0.0.0    \", \"::/0\", \"2.59.6.2\", \"0798D94B899GECB\", \"9AA:ED::5BB2E00\", \"47:13E68.2F8BCE\", \"A78.1D3F58GE13G\", \":C:452GC.7G0CDC\", \"3331.68DF::7G04\", \"0:0:0:0:0:0:0:0\", \":88781D41B6:75E\", \"255.255.255.255\", \"2361D68D5:A6757\", \"0:0:0:0:0:0:0:1\", \"B9:8BF9F1G2C4FC\", \"::2\", \"AAF:G8254E7.B78\", \"::\", \"::\", \"::1\", \"0:G.6B2B447BECB\", \"8:64.6D5DDFB25C\", \"F43C4AEBCEEE3G3\", \"31C6F7FFA403FE0\", \"192.168.0.1\", \"6076728GB2FGF17\", \":.G.609.60GGDG3\", \".C126E93A.D6.F1\", \"127.0.0.1\", \"2\", \"D3F4.6EG.CF8.9D\", \"F95B1.3200D70GC\", \"127.2.3.4\", \".6D1.857CG33:D:\", \"6G07C.8C9E62.G.\", \"0:0:0:0:0:0:0:1\", \"B7.96.5A0:G20.F\", \"4B666501.1F:9FB\", \"G:A1D13F706D9.3\", \"0:0::0:1\", \"300.0.0.0\", \"D23:7C8.:2:CC7.\", \"28EE.8:75CFE0AC\", \"    127.0.0.0    \", \"::1\", \"::\", \"0::0\", \"    127.0.0.0    \", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"9:700426.7E1BFF\", \"FA4:.4D04:721:0\", \"0:0::0:1\", \"    127.0.0.0    \", \"A7.E:.E4919F:F6\", \"::2\", \"300.0.0.0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"192.168.0.1\", \"460A26:39B7DA05\", \"586D6FG1.62G297\", \"315E00D9F5053G2\", \"502:.6D4918A0.A\", \"9EG47AD9C73CF5G\", \"127.0.0.1\", \"DE238.3:0DAE984\", \"127.0.0.1\", \"2\", \"DD0DD.815129G.A\", \"592.EFEB1E54GA:\", \"::2\", \"27E8::AGD23:880\", \"D:F520GF9::6302\", \"FF1D:C70EBDB31E\", \"05D.6.041DE2469\", \"4A09A3DED2E7CE4\", \".E:0296E60A7B8.\", \"1.C57CAG:C58E70\", \"284A:980E52.67:\", \"::1\", \"78GF1B3B9A11A41\", \"1::2::3\", \"64C58CCCF7:39D3\", \"0:0:0:0:0:0:0:1\", \".:B2G567F79A1.B\", \"0:0::0:1\", \"0:0:0:0:0:0:0:1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \":::4\", \"0::0\", \"300.0.0.0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2.59.6.2\", \"300.0.0.0\", \"::1\", \"31G8522:F4DGDA:\", \"0:0:0:0:0:0:0:0\", \"EBEGFCF7DBG0F89\", \"266:937C3724:70\", \"4DC3B3F299G6D4E\", \"255.255.255.255\", \"0751E016D:73F50\", \"5A22BBC07DG2:DA\", \"127.2.3.4\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::2\", \"F2A7E5C0:599442\", \"300.0.0.0\", \"0:0:0:0:0:0:0:1\", \"A86262920D8F158\", \":8B86C2:7.BAA3F\", \"0.0.0.0\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \":4743GB:CG.B955\", \"3BA294585353.E1\", \"DB2.:EE8F.F4G5:\", \"103565E9G1A7.3G\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"04.GC0.48GE.:D8\", \"0::0\", \"0:0:0:0:0:0:0:2\", \"255.255.255.255\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0::0:2\", \"E4370F2A781918:\", \"DAG08C8D33A0EG2\", \"CAGG8BB5583BD0A\", \"2.59.6.2\", \"0.0.0.0\", \":::4\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"3G1E3ED5FE59GF2\", \".0:DD392FA726EB\", \"CDABB4.5A7A3.DE\", \"::\", \"127.0.0.1\", \"BA0761574557B.8\", \"EACC8D.F0GB:3A6\", \"A942654FE1:D272\", \"2.5.6.2\", \"127.2.3.4\", \"127.0.0.0\", \"300.0.0.0\", \"300.0.0.0\", \"::1\", \"CC:E:87585.D7:A\", \"0:0::0:2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0::0:1\", \"255.255.255.255\", \"300.0.0.0\", \"61725982A034A:6\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2.59.6.2\", \"60:15G63C4ED1G9\", \"0:0:0:0:0:0:0:1\", \"E97B11C44142:.B\", \"0:0:0:0:0:0:0:2\", \"8C71G93G5A7E04G\", \"2\", \"9G5A049E594D:3G\", \"2\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"9.G4CCE394.4FA6\", \"255.255.255.255\", \"3:C:0C4F1A26753\", \"C2:E24DEB78C740\", \"0:0::0:2\", \"2B.CFF7AG45DDG3\", \"5810F3604F5.E9D\", \"20A62649G5.5911\", \"2211909E558GG:9\", \"981486C9F43B5BE\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"70GC9F:0AB2B:71\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"927GG354C.939CB\", \"::/0\", \"::\", \"6D7ABD:5B27:BDA\", \"G3B069:.C0.6F27\", \"::\", \"9E34F.4.:F21A47\", \"0.0.0.1234\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \".EB.5GE..86F:87\", \"1B3.92B4ECA:B8G\", \"2.59.6.2\", \"53:9F:E:2EE92A:\", \"::/0\", \"763E76:94G:49D2\", \"2\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"465B2A0.9.17F09\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0:0:0:0:0:0:0:2\", \"79AD7B015CGAFAA\", \"CE4688450:BGG93\", \"1A03.F82CCF82:0\", \"0.0.0.0\", \"A639C49CF30E59F\", \"5F:G5D2D:6C3A.1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"255.255.255.255\", \"::2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2\", \"::\", \"::\", \"4EB42B4A4EA0.9G\", \"FD9C:BC.EFE231F\", \"0:0:0:0:0:0:0:2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"127.0.0.0\", \"0:0:0:0:0:0:0:0\", \"192.168.0.1\", \"471G97:15027A2E\", \"127.0.0.1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2.59.6.2\", \"192.168.0.1\", \"::1\", \"127.0.0.0\", \"0:0:0:0:0:0:0:1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"AE:FB92C9308F1E\", \"    127.0.0.0    \", \"127.0.0.1\", \"::/0\", \"::2\", \"0.0.0.0\", \".A008A4...5502G\", \"BG2GCF..6G999F0\", \"44C44EG187A38B3\", \"1D137343A589282\", \"0.0.0.1234\", \"C:2A8D9ECAA1469\", \"0:0:0:0:0:0:0:0\", \"1::2::3\", \"2.59.6.2\", \"DCA.BG12F90C81D\", \".F8A21966423C41\", \"852783D98319G:3\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"127.0.0.1\", \"C10D07GB546962B\", \"D089330:3BB97B:\", \"0:0::0:1\", \"18G0930E.4:9770\", \"2097451.516FGDC\", \"4A5D8FED2:476E0\", \"::1\", \"0::0\", \"2.99623DB1.:6FC\", \"B:6GD:47ED78D6E\", \"B177DGA64AG18B3\", \"15010E12C3A7C40\", \"0.0.0.1234\", \"1::2::3\", \"127.2.3.4\", \"127.0.0.1\", \"0:0:0:0:0:0:0:2\", \"0.0.0.0\", \".AA7G.7FD7E:F2A\", \"0:0:0:0:0:0:0:0\", \"0:0:0:0:0:0:0:0\", \"216E3F9C950FEC0\", \"::\", \".4464A:E441757:\", \"0:0::0:1\", \"A597GG48185CE5.\", \"G58DB61C:3E5A0D\", \"E18.900CF6:790A\", \"63:8B67B0G927ED\", \"82B.0.DBE:C981:\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0::0:1\", \"300.0.0.0\", \"D8319.54:43:G0B\", \"300.0.0.0\", \"06:F649CEG.G6D6\", \"CCAA6.:D2:48CB.\", \"2.5.6.2\", \"2.59.6.2\", \"3A3FDBF93F99E5G\", \"42.D.2A323440DB\", \"127.0.0.1\", \"FB5DEB2528CE2EA\", \"::2\", \".5823733B45DFGE\", \"::1\", \"::2\", \"79744G50:C0588.\", \"127.2.3.4\", \"2.59.6.2\", \"D:8:4GAC007EE0D\", \"FF84F.C76A1D3:2\", \"3F68.:B033:51F8\", \"0.0.0.0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"95:B1420D47:8C.\", \"    127.0.0.0    \", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"CCCG73.2B3GD:83\", \"0:0:0:0:0:0:0:1\", \"FAA313A9.7BAB:C\", \"9E8A9B1.878AC34\", \"572C:A46E:FG22G\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"9GG6BG:2A239EGC\", \"B1.F5F4.3843A8E\", \"E:.4.A71:00101:\", \"127.0.0.1\", \"A5:1B61C5AFD69B\", \"8C49B.91D6A.356\", \"0:0:0:0:0:0:0:0\", \"95B3D0B5C0A6DF4\", \"2.59.6.2\", \"127.0.0.0\", \"GD20F.:9G728EA1\", \"C927.9BD9E82.6D\", \"1::2::3\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"6C46C76958GE2E6\", \"255.255.255.255\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \":1G122:C700E28A\", \"0A91G67D06A9F9F\", \"::/0\", \"24.14GDE0.D5.89\", \"0:4D1F.5AAG1:DE\", \"60.B:B880:BD6FF\", \"    127.0.0.0    \", \"GDG8.9BE.461A3C\", \"127.0.0.1\", \"2.59.6.2\", \"371:110E1.D34GG\", \"::2\", \"59.G6B2805135GG\", \"G1BD4EG.7:A2G82\", \"5:7BD9CBC67..78\", \"::/0\", \"0.0.0.1234\", \"127.2.3.4\", \"2E9C4F27A97E760\", \"3A33AC8:D9DE5:2\", \":17A8A71E29277D\", \"E7E458E:CF06.7:\", \"4C.E3:87A3FC.F.\", \"0:0::0:1\", \"0::0\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"E:F03G7C8F3DC.C\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"1G96E.6:633CC8E\", \"127.0.0.0\", \"127.2.3.4\", \"C94601C2A9C:CFD\", \".0885CF9G67F784\", \"E37B13086.B4G.0\", \".42E:G17059.515\", \"AGB68F11BF:B7F8\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"255.255.255.255\", \"300.0.0.0\", \"G877B:59EF118:.\", \"0A57.7G5:C967B8\", \"2.59.6.2\", \":59C93E:G.1.865\", \".CF4132603G6477\", \"::\", \"::/0\", \":A614.650A.35A.\", \"0:0:0:0:0:0:0:0\", \"2.5.6.2\", \"0:0::0:1\", \"1::2::3\", \"6F59C.3CF397C0B\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"068:E3D0649768B\", \"7EF423EBA2GG9EE\", \"B.D29B1G8197740\", \"1::2::3\", \"2.59.6.2\", \"7GE24F86987AB4F\", \"2\", \"6BF8:4804AB7896\", \"::2\", \"476DE911978B0.4\", \"300.0.0.0\", \"::2\", \"090F54.9613939A\", \"192.168.0.1\", \"494FB:5.BGG8896\", \"127.0.0.0\", \"C.54D:F75.8:::G\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::1\", \"C6.:G45C.0G52B5\", \"::1\", \"E06299B8:5A3D49\", \"5.EG34::85ADC9G\", \"6GA15B43B.B3202\", \":49F.B.A8E498F3\", \"2285092AF95DF1A\", \"09AA1E7E7F4376F\", \"B7611G838DGF:FD\", \"    127.0.0.0    \", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"937CD26DA0031:8\", \"192.168.0.1\", \"46GE29B27F:8CA.\", \"321FDAF0082G62E\", \"::1\", \"2.5.20.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0:0:0:0:0:0:0\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"G57.438C.C18B4:\", \"22147:319:A1D1:\", \"0:0:0:0:0:0:0:1\", \"B326A3B.117FBG2\", \"25EG:194B8DD510\", \"255.255.255.255\", \"C31C9G31:GAAC68\", \"300.0.0.0\", \"0::0\", \"127.0.0.1\", \"0.0.0.0\", \"4C2E6848C3BGEF7\", \"::\", \"255.255.255.255\", \"2F8A0AD3F1771EB\", \":::4\", \"5.AF971C60650:D\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"    127.0.0.0    \", \"0:0:0:0:0:0:0:2\", \"0:0:0:0:0:0:0:2\", \"192.168.0.1\", \"255.255.255.255\", \"7A8E2F:7C699BGG\", \"0:0:0:0:0:0:0:2\", \"9GAF9C7:0B407EA\", \"::1\", \"CC348E3C40E:8.3\", \"2C0A6BE2:6:.6A2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"B:0.32FA29BGA:E\", \"3F353B74C45EC1E\", \"0:0:0:0:0:0:0:0\", \"0::0\", \"::9.6BD85G8E3:E\", \"0:0:0:0:0:0:0:0\", \"GA3DFE:F67.4BBE\", \"127.0.0.0\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0:0:0:0:0:0:0:2\", \"G9GD2G4DF3D5740\", \"300.0.0.0\", \"160ED442BFF6G3C\", \"192.168.0.1\", \"192.168.0.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"37:FEB.:4C0.247\", \"0::0\", \"2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"127.2.3.4\", \"C38176E10A0.AG3\", \"4549E7E31CCGA0:\", \"127.0.0.0\", \"::\", \"2\", \"::\", \"7BB264CE.2D76.D\", \"891G3.18C5B5716\", \"0.0.0.1234\", \"B16FB8:F713.FD3\", \"4F687D.CA20.4CG\", \"::/0\", \"AFGAFBEG2GA3F0E\", \"FA2D:B764FE31:9\", \"5811F80C363225B\", \"2.5.20.1\", \"E5A45:89674GBF8\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"673F8F7B1FC0674\", \":B685:03CD8.1E4\", \"8.93951EG8F8:D9\", \"AD6.DEG5436GCE8\", \"::\", \"::2\", \"DG:641G6:1663:4\", \"127.2.3.4\", \"C1536.41G6615EB\", \"4AC.5D309.D8D9B\", \"023153B52G.31G7\", \"FC65CD2D6..A74:\", \"127.0.0.1\", \"G43..1D6.7A1401\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"127.0.0.1\", \"2\", \"0.0.0.1234\", \"0:0:0:0:0:0:0:1\", \"863C1GBA17F.DA.\", \"1::2::3\", \"255.255.255.255\", \"7E56B0DG33G73C2\", \"::\", \"18B2:00C:GC67G8\", \"35347E34..710:G\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \":009300DFC2B8EF\", \"60C.7.:1FE0CF4B\", \"1CBA0G76:EGCBAG\", \"F74:E54GFBDG7GC\", \"::\", \"300.0.0.0\", \"99EGG360.467:1E\", \"::1\", \"617.0355CDBC97F\", \"::\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0::0\", \"9F:BFD1D30AB887\", \"7810D1B20A6G539\", \"G9C82FC25DGAFDA\", \"A430C:6502FC49A\", \"DAFG.67202906CG\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"1::2::3\", \"0.0.0.1234\", \"554:D8:E.:52G4F\", \"::1\", \"GG1.C34F:.32:D7\", \"0.0.0.1234\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"017703BB64EEA1D\", \"6.3:DF:B6E2804.\", \"3DGB099.A3B757A\", \"::\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2.5.20.1\", \"::\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"9B9689E30FF.173\", \"B:74:G7332BF079\", \"4FDCF7696A174B:\", \"DB7F1G36:.G7:CG\", \"8BB1.4CC56A:AB7\", \"127.0.0.1\", \"127.2.3.4\", \"4CB:07F9DCB.:10\", \"BA15CCAGF.E52E6\", \"0.0.0.1234\", \":::4\", \"D615708G004AEE5\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0::0:2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"2.59.6.2\", \"1::2::3\", \"0:0::0:2\", \"0:0:0:0:0:0:0:1\", \"51D8C487166BC13\", \"C455A6B47DEFB5C\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"    127.0.0.0    \", \"B823E23975:.A4C\", \"2.5.6.2\", \"508F8E7BD5G2FD2\", \"::/0\", \"730B36A14.3B520\", \"::\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"::\", \"8.4915GED846G55\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"1::2::3\", \"127.0.0.1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"29D6:F60C502:A8\", \"BB.F9.:387F4B6A\", \".6F.1.791BFB93C\", \".EG1C.1B:967:09\", \"3F7AEC.B888B360\", \"0:0::0:1\", \"C9G.219F121E4A2\", \"2.59.6.2\", \".:0040A9A3GED3A\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"1G24E.31D3C5C2B\", \"C:B19B.75:8EBA4\", \"5E1BB85:0789EG7\", \"0:0::0:2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"BD8B3GFCD5.79.A\", \"0.0.0.0\", \"2.5.20.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"5692904:A262656\", \"GA040ED21F7G733\", \"2CC6:E4A.3FCA88\", \"0.0.0.0\", \"0:0:0:0:0:0:0:2\", \"4ADC1B13DGB1A31\", \"E2CF5DF.A7F689F\", \"3.AD8:.30A10G3F\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \".GC61C08C4DA799\", \"007:68AA806E5D8\", \"127.0.0.1\", \"0.0.0.1234\", \"17CC.92554C76F.\", \"DG17GD9417:A7B9\", \"133B63E:922B06A\", \"0.0.0.1234\", \".7EC:DG.88D2322\", \":3B86479:6B0151\", \"20E6BDG.E1B:AG3\", \"0.0.0.0\", \"CBB1GDB7BE632E9\", \"0:0::0:2\", \"127.2.3.4\", \"GE299G93:41.29G\", \":D0982984BA42E4\", \"0CD7G56B8486EG3\", \"127.0.0.1\", \"300.0.0.0\", \"1BGE203EC68:3FB\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"G1A.G4:EG80524C\", \".6:G5233G::ADCF\", \"7C898F:38027432\", \"E7F2ED6525A73A0\", \"0.0.0.0\", \"::\", \"F3BFGE.6ECDCEGD\", \"96C5E0603A9EF.F\", \"::\", \"::\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"27B4.1C81C69B2D\", \"0::0\", \"0:0:0:0:0:0:0:0\", \"192.168.0.1\", \"C.9BDCB5.0CD5E9\", \"2.59.6.2\", \"::2\", \"2.59.6.2\", \"3:7F0AA19A64BE7\", \"0.0.0.0\", \"127.0.0.0\", \"G9:590:EEA0A1B0\", \"0:6FAA62AFA:C5A\", \"0:0:0:0:0:0:0:0\", \"D3C57233DA26:62\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"5827F87E8832.EE\", \"592413.GF2.GADD\", \"0:0::0:1\", \"2\", \"0::0\", \"    127.0.0.0    \", \"127.0.0.1\", \"8677B3CB737165G\", \"9D:3E714414.:.A\", \":.1:DBA86C4B908\", \"0:0::0:2\", \"F6B2G1G7G4E:B99\", \"0.0.0.0\", \"G2AC29FDDG7A8DE\", \"127.0.0.0\", \"2\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"C78A6:0F1D59.AE\", \"G20A1FA100BG039\", \"300.0.0.0\", \"2.59.6.2\", \"0.0.0.0\", \"9ED0:.B24GBG9EE\", \"2.5.6.2\", \"A789G:52G3.7E15\", \"1::2::3\", \"2\", \"A4A2900E.367450\", \"    127.0.0.0    \", \"G0.5GB0B5G.DEA7\", \"7C0D2F09E1D8D77\", \"2.5.20.1\", \"9C26CF2B:D04C52\", \"5::5:9.1152CBG5\", \"0:0::0:1\", \"::2\", \"D69FEFA465.F42F\", \"1::2::3\", \"DA1CB277791:6.2\", \"255.255.255.255\", \"::\", \"214495.D1DE774C\", \"547A:1B1074CF8G\", \"300.0.0.0\", \"7AB0C9780D41252\", \"06263EF.33F7DD3\", \"A4E6.74DAF65GE5\", \"9F4GC05:7.EDGF6\", \"518DF539D02D64D\", \"8A9504GF..AA9:D\", \"0.0.0.0\", \":07:934756020.4\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"1B8A0E4443350BC\", \"127.0.0.1\", \"2.5.20.1\", \"138E.GB33..FG8C\", \"    127.0.0.0    \", \"0:0:0:0:0:0:0:2\", \"C895807G0.45F80\", \"0::0\", \"2\", \"CDC:F6E8E87.FBB\", \"703.AA.E2545940\", \"127.2.3.4\", \"84D0B064440FDB.\", \"73B57ED2FA87180\", \"239.4F0DA:EBB:7\", \":62B7DGA2334D8G\", \"0.0.0.0\", \"94B4942ED14101B\", \"GAA6A:874E725.3\", \".:0B05:0F00:FFA\", \"127.0.0.1\", \"8GD.611E4F31A11\", \"2.5.20.1\", \"2.59.6.2\", \"2.5.6.2\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"G2CG3D2B0:3AF30\", \":CCE8EDEG61G:7F\", \"::\", \"::\", \"8G67F50E63AB7DD\", \"127.0.0.0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"EA4B4F8C6648E89\", \"1::2::3\", \"57.A2C82:6G73C4\", \"0:0:0:0:0:0:0:0\", \"0.0.0.0\", \"1G3.C1179BB24GB\", \"4DC0B5EA830B.14\", \"EF15A31F:.F76A0\", \"0.0.0.0\", \"::/0\", \"6011G5C64B7B777\", \"4492DCC8A71D551\", \"6B8GC0.2D:205D4\", \"C6B72BDCB13BA8E\", \"::1\", \"2.5.6.2\", \"4DC3EF:28C16F.F\", \"1D68FD32486F1G5\", \"CG888D6C7BD7B3.\", \"::2\", \":.73.DG6F23D025\", \"GBA06GE4F23CF02\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"6E.:D702:986:94\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"127.0.0.1\", \":3:.D58D0G0D978\", \"0::0\", \"9609AA3:7192494\", \"ACBB61505DC:G0E\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"4E:4GD3A3B38B3B\", \"1A7G:DEC93AAE6B\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \".3F.82D3.77C7E1\", \"298A977C0839E5C\", \":EA232558D43:GE\", \".845:44BGE4:AA2\", \"G53370BA040.16G\", \":GG8B39CD7FE6E.\", \"::\", \"4F6D35B21.D24FD\", \"2D54F9F5D2DDF03\", \"324C09CFB51E3B6\", \":985.06807G1BB1\", \"0.DFG70G7C:8055\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"A.0E4719:A0356:\", \"36662D2AA713DGE\", \"1::2::3\", \"::2\", \"GD322C7C8F4CB2G\", \"::\", \"2.5.6.2\", \"300E3A62F80G797\", \"127.0.0.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0:0::0:1\", \".G19887.72C.04B\", \"..:8G8:3G36D76C\", \".51921A6C5.13A3\", \"2\", \"1.B.A3B.4A0EF0D\", \"12CCED0G:7BAE8G\", \"2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::\", \"0:0::0:1\", \"0:0:0:0:0:0:0:0\", \"386F:79D2074F55\", \"192.168.0.1\", \"2.59.6.2\", \"0:0:0:0:0:0:0:1\", \"C399.26FEE07EB7\", \"6F87AD:CC52F.79\", \"127.0.0.0\", \".:D.AF9D6811DCB\", \"0:0::0:2\", \"0:0::0:2\", \"2.5.20.1\", \"::\", \"127.0.0.1\", \"BEECA7B3:B:10DE\", \"0AA0C5081D.1:61\", \"E19995.966:GG.B\", \"00EEE0:9DGF.397\", \".D:D90ACE8ADAB1\", \"BF8GB.9ADD57146\", \"7B873DF92D8:F.0\", \"2.5.20.1\", \"2A90E36F.06.F2E\", \"::/0\", \"::\", \"::\", \"0:0::0:2\", \"2B.F04928DF592F\", \"E.C1B4921057G3D\", \"2.59.6.2\", \"::\", \"45D056CC7B30506\", \"2.59.6.2\", \"1.34.B:1FDG0557\", \"1G5BDDBFC8A6EF0\", \"EG78007C2D7:E73\", \"AGG029A10EF5CDE\", \":6.GD31381F:4E1\", \"9:19:2:5C19B7.4\", \"::2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0::0\", \"9E:1B8637332A69\", \"2.5.6.2\", \"90:7.B64B3G4749\", \"95A57E075:2B3D7\", \"2.5.6.2\", \"::2\", \"::\", \"::2\", \".B69BB24:E6G374\", \"CBCC9::B3A4D1C5\", \"F19633C374:5266\", \"127.2.3.4\", \"2.5.6.2\", \"04:5442A12E2.2G\", \"127.0.0.1\", \"::/0\", \"32170913::1FDA7\", \"26D5423AC4:FE62\", \"7166B07ABA:2736\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"59536C164CE26GA\", \"0:0:0:0:0:0:0:2\", \"::2\", \"2\", \"FB77912.A0AE52A\", \"0.0.0.0\", \"300.0.0.0\", \"934BF3AC347E1D6\", \"255.255.255.255\", \"0:0:0:0:0:0:0:0\", \"2.5.6.2\", \"0.0.0.0\", \"4A84E:E0G149321\", \"27D4B2066859C46\", \"127.0.0.0\", \"2078BC62E1GB.GE\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"7B5D776:B41305B\", \"30BBC01:G0.:FGE\", \"0:0::0:2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"51F69F45.57.B19\", \":::4\", \"127.0.0.1\", \"27E201961F4GA88\", \"0:0:0:0:0:0:0:2\", \"0:0::0:2\", \"127.0.0.0\", \".5F238ABE9CA6.G\", \"0.0.0.1234\", \"F82:5AD:::11.7C\", \"300.0.0.0\", \"DA3G33D797C:7.:\", \":48137G0998:15A\", \"0:0:0:0:0:0:0:2\", \"47B1G8338A3G640\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"F5E31728DCGG165\", \"B4G75D3:24BE1EA\", \"1GC5A:31A2GDB34\", \"8F4D9352:.G076:\", \"::2\", \"D84G8D4B4:05885\", \"10:2C:B986E5C03\", \"2\", \"4C9ADD9665.EAFF\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0::0\", \"D::BA4288905G46\", \"G0181EGC8321BG6\", \"    127.0.0.0    \", \"255.255.255.255\", \"1020B2BB6C23.07\", \"::\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"A:65D:.BC.G5C:9\", \"413512281:F5AAB\", \"76E4C7EA69A3F91\", \"192.168.0.1\", \"2.59.6.2\", \"0:0:0:0:0:0:0:2\", \"6..4G0:90G56333\", \"80:F85D669EEB26\", \"355814GFE2:FA.7\", \"::\", \"2\", \"363AAC18D4DB:FA\", \"::\", \"CF2B1103B1GG08.\", \"B59EDAA0C1:6F3A\", \"8B97A4649G9.DAG\", \":::4\", \".79E35C89EADE2D\", \"GGB7F478D99.A73\", \"G6B1BD24BEGG136\", \"192.168.0.1\", \"::2\", \"2.5.6.2\", \"857G7758B3DADF:\", \"2\", \"6G2GA1C0BAE7G72\", \"0B725:F7A1941CF\", \"::2\", \"071G14E4DAD24.F\", \"B78E9BGE198D5EG\", \"E810:52FG0:CE.4\", \"::\", \"0:0:0:0:0:0:0:2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"5B:.5E9A99A261E\", \"0:0::0:2\", \"FEFA4G1A8902607\", \"0DDA3C1GDB2B4C9\", \":::4\", \"49:70B:770:47:6\", \"ADG:.892C11114D\", \"1::2::3\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0::0:2\", \"0:0::0:2\", \"4E5C57160D3F59:\", \".6F1B.2ADED.6.5\", \"255.255.255.255\", \"5B538D9A1EE8215\", \"1A3C7952:G0GB77\", \"127.2.3.4\", \"A60.:9802.9BBG8\", \"B926CA34E4AGF4C\", \"733B72219646F27\", \"893DA193D8.::GF\", \"127.0.0.1\", \"127.0.0.1\", \"0::0\", \"F:.7B.417F3E:F:\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"91B7GAC74308E35\", \"0:0::0:1\", \"127.0.0.1\", \"127.0.0.1\", \"    127.0.0.0    \", \"1::2::3\", \"1::2::3\", \"E4E3CBGB3C464C8\", \"127.0.0.0\", \"    127.0.0.0    \", \"0000:0000:0000:0000:0000:0000:0000:0001\", \":::4\", \"0:0::0:1\", \"47:68ECC770937D\", \"6DDC83G0GA617E4\", \"4F:AA303.G37GF5\", \"39CAEDGGDB8D51D\", \"5.0EC009CB.24GB\", \"C71A6F16A3F1GBG\", \"300.0.0.0\", \"2.59.6.2\", \"9G610C7997G3C1C\", \"0::0\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"9D154AA77416C8:\", \"0:0:0:0:0:0:0:1\", \"8G5E762E:8E29B5\", \"07:7:6GD.B95C4E\", \"5C.GG651:28.B1B\", \"16A.83.805AG5DF\", \"2.59.6.2\", \"0:0::0:1\", \"01B9178B.E15374\", \"::1\", \"8791A5029C0CA01\", \"234007E73783AD0\", \"71G7..764.G4D:E\", \"FD903519EBG3A3.\", \"0:0::0:1\", \"0:0:0:0:0:0:0:2\", \"0:0:0:0:0:0:0:2\", \"2.5.6.2\", \"1::2::3\", \"6AFEE29:167A7DB\", \"1CF1A313.:70AG2\", \"9::.563293G291:\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"G5FD810E.CCADFA\", \"60G1F:115932.3F\", \"104D02F:359416E\", \"::\", \"82AA.D14:1093C3\", \"421G.F4C19G7AAA\", \"255.255.255.255\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"1::2::3\", \"40789:0683B:D:A\", \"82722857D3BD3AE\", \"255.255.255.255\", \"0:0::0:1\", \"0::0\", \"80966C133886::C\", \"74CAF4GE9BE9509\", \"0:0::0:2\", \"8GCE25C4:.352A3\", \"2.5.20.1\", \"2.5.20.1\", \"86B367D65705949\", \"    127.0.0.0    \", \"8D.31EB8194C5.3\", \"DB7E.6GF1.EA81B\", \"F.FG9EDD2598D4D\", \"81FD18.7F3DG01F\", \"06G.A:995624FG5\", \"2FE95472DA.E.B4\", \"E61781.GEBF15ED\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"F686B8A9D4GBEA2\", \"ECE2C2F794A2A99\", \"2.5.20.1\", \"C6GC17459GG1E13\", \"F82.D4F:07G9B89\", \"2GBC9.G:89A320A\", \"FDC7D507C5.F:2:\", \"2\", \"5.2G34560:A9E.9\", \"    127.0.0.0    \", \"E8AC2.15791A6EG\", \"A0FD2A:02EB44CA\", \"0.0.0.0\", \"127.0.0.1\", \"2\", \"0.0.0.0\", \"0C2E.7D0C1F658F\", \"2.5.20.1\", \"192.168.0.1\", \"127.0.0.1\", \"E:3A852C.0GA650\", \"::/0\", \"0:0:0:0:0:0:0:0\", \"0::0\", \"127.0.0.1\", \"::\", \":E.3146G4::D6B9\", \"127.0.0.1\", \"EC1E01::5.35.08\", \"96A3A29:6G1194D\", \"3519F.BG84BF401\", \"6F9099266FG7A35\", \"577.3D9F3F6CAF7\", \"0:0:0:0:0:0:0:0\", \"1::2::3\", \"0:0::0:1\", \"4D18784BCCB8F69\", \"0:0::0:2\", \"0.0.0.1234\", \"0:0:0:0:0:0:0:2\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::\", \"2\", \":4G244.975CG.:G\", \"0:0:0:0:0:0:0:1\", \"127.2.3.4\", \"0.0.0.1234\", \"127.0.0.1\", \"2363F:80.D2G04B\", \"5D1D21456179F.C\", \"7G0:1..4G8C:A9A\", \"AB2B1A608E2603B\", \"774F.3D6GE9F7.A\", \"127.0.0.1\", \"80BD2A3:982FC9B\", \"0:0:0:0:0:0:0:0\", \"78G314FC:DAF:2B\", \"F95712B.E47191G\", \"468GBA2B2.2EA:2\", \"127.2.3.4\", \"2.5.6.2\", \":1AEB12:.AB81DE\", \"0:0::0:1\", \"803B8B2F099F:41\", \"6CG8800E492EE0C\", \"95AB3GFG8G40GF6\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"A:911..50D799G4\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"7GCD.70:.FG3A86\", \"CCEB0D74E060C54\", \".773B3ADA5A05:4\", \"1C1F129F:2G3E20\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"    127.0.0.0    \", \"753880A525B56:C\", \"..A945::8F90A4E\", \"9:E:10840FE8C5E\", \"90FE4C5F3641:55\", \"B2D85.B.5GDE:E6\", \"::\", \"F8ED33F7F3F8EF:\", \":::4\", \"CDA77407A0C:35.\", \"1::2::3\", \"GEBEB:9.357D.76\", \"2\", \"1D:BA23GEG3D38:\", \"GA03F7AAFEF1EB6\", \"0:0:0:0:0:0:0:2\", \"6983.8DC.5E5525\", \".GEE09..438F5:B\", \"D350F07A6.D61G0\", \"0.GA34EG.51C770\", \".B5.93FBC5G:7E1\", \"C.8:4:81.G57:8E\", \"63F93D83FC6GC:2\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"127.0.0.1\", \"FG8C23EC398BA7A\", \"127.0.0.0\", \"127.2.3.4\", \"FDEF81:58B13842\", \"    127.0.0.0    \", \"::1\", \"::/0\", \"::1\", \"..3:.B28A59EE78\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0.0.0.0\", \"C62177FG3074B:2\", \"255.255.255.255\", \"DEEF9D512DDA407\", \"127.0.0.1\", \"2F3C48:F8:F7CG:\", \"6CF3.6EF9G1F634\", \"8A135CBB9G9B800\", \":D815B8C8B56.2C\", \"0:0:0:0:0:0:0:2\", \"192.168.0.1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \":925.203B527EA4\", \"08.AG.6429B.A.C\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"CCG31.CEBG:B:85\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"6B85DF6CDB371ED\", \"::1\", \"0::0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0.0.0.0\", \"D5B55E215.243BB\", \"::1\", \"1::2::3\", \"103A89A91EA3G03\", \"0:0::0:1\", \"060.0..47EG04.9\", \"127.0.0.0\", \"AAE54.296BG603E\", \"0:0::0:2\", \"4.:5.07BA..::84\", \"1BD2G623FC39934\", \"::\", \"819B07B5G5D:18B\", \"G:D9.0B2G6CGB00\", \"F2A:BB1D:09C.C0\", \"127.2.3.4\", \"2.5.20.1\", \"DG.GC:2GA2C51B:\", \"127.0.0.1\", \"45D99:DB7C5E2GC\", \"C0F4ACEF78G424G\", \"127.0.0.1\", \"127.0.0.1\", \"BA856A.B56E4D3B\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"C463G0C25DAF09G\", \"0.0.0.0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"192.168.0.1\", \"G9477F8EGD8E815\", \"::/0\", \"0DF5.62494:1:20\", \"0:0:0:0:0:0:0:0\", \"26B0A450D0D34F8\", \"300.0.0.0\", \"CEA42AC022658FA\", \"3911C0A31116B56\", \"127.0.0.0\", \"127.0.0.1\", \"0:0:0:0:0:0:0:1\", \"2.5.6.2\", \"13:5C.0G.FFC::1\", \"BEGCBF:3BGGA09B\", \"D8C446BF058.425\", \"377G7F5G033F.3B\", \"::/0\", \"66AC0B18:F14B57\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2.5.6.2\", \"AD61.F1G00808:8\", \"FEBBC7F6:6DB6A0\", \"255.255.255.255\", \"0:0:0:0:0:0:0:1\", \"C1EGEG.B:48C37F\", \"967A6E172DB:A45\", \"8D4EC32565B977E\", \"8DC.D1CF828:6D3\", \"B72B9495EDB2460\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2E9G5F4427G2CD7\", \"0.0.0.1234\", \":.3E955C14B341A\", \"2:.:A875:3F96A7\", \"9DB18B1A44BGF24\", \":FACF2B71624.3B\", \":::4\", \"F149E297847G63D\", \"0:0::0:1\", \"127.2.3.4\", \".0EF9:C4:CD25FC\", \"28C.87069A84107\", \"D8E:605:88C33C8\", \"AF61185D3:7ED2C\", \"192.168.0.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0:0:0:0:0:0:0\", \"::2\", \"B0939G52.5916AB\", \"::/0\", \"65265A5027E06B4\", \"85A2.A088940A:1\", \"BAB5E5EEF722G95\", \"127.2.3.4\", \"6D:0.D.37862E8D\", \"8ADD054787E9BF5\", \"0:0:0:0:0:0:0:0\", \"B24C1:7DCA3.G.4\", \"CB1G0AG231:234.\", \"C5.1:A2..:DC1G:\", \"0:0:0:0:0:0:0:2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"1::2::3\", \"EF138ABC5:74.5F\", \"0:0::0:2\", \"20E44AC431C3BD3\", \"47EC0A42B6.5361\", \"00C1234FCGA04GD\", \"127.0.0.0\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"127.2.3.4\", \"G5EBF35AB:2E68B\", \"0:0::0:1\", \"0:0:0:0:0:0:0:1\", \"7574FBF3F2:B3B0\", \"::\", \"413EECE.A.86BG1\", \"09DGD00E7DDFD6B\", \"54F7.E:.F.77DB0\", \"A35C:D08A1AG9ED\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"2.5.20.1\", \"0::0\", \"2.59.6.2\", \"A167G.2.E8:E:FF\", \"63959B2G8701A51\", \"E4FD:02F4G0..CC\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"DC53BEEGDD04918\", \"0::0\", \"192.168.0.1\", \"0:0:0:0:0:0:0:2\", \"0:0::0:2\", \"81E81.3C74G4284\", \"8FBB1E2.D54DA4G\", \"    127.0.0.0    \", \"0:0:0:0:0:0:0:0\", \"0.0.0.0\", \"    127.0.0.0    \", \"1::2::3\", \"2.5.6.2\", \"::/0\", \"192.168.0.1\", \"127.0.0.1\", \".E2.GA24E23235F\", \"0:0:0:0:0:0:0:0\", \"::\", \"G95E98B940EDB:F\", \"AE05694.A9E0796\", \"127.2.3.4\", \"B0GD5G5.964B3G4\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2.5.6.2\", \"2.59.6.2\", \"8310.63FAF13.1D\", \"GC55GD1ED2F3326\", \"0E5E995C47D2AGE\", \"::\", \"192.168.0.1\", \"2.59.6.2\", \"B9:B43EA3.45D:9\", \"CBA7.554G3800.F\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"65EC12D2C.7AFFA\", \"D.01DEGG8D9:39A\", \"    127.0.0.0    \", \"2.20B8DA4AEG3A4\", \"G16AG:CA68E3GEC\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"B924D41F4810E45\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"EA61:53GCEE6FE6\", \"7707:.AG99368F5\", \"127.0.0.1\", \"20BE37A6.A0:C16\", \"002G0B9D6.DE.9E\", \":::4\", \"G61.3::3C8F80AF\", \"FD:A1C525AE0DA9\", \"0:0::0:1\", \"5F0717.31G7FD:G\", \"FGDG35.FF304438\", \"9C21.8:C99BC555\", \"0::0\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"255.255.255.255\", \"0::0\", \"9GB173B.FG06G9D\", \"B5E0E.6FGB:G254\", \"192.168.0.1\", \"40EBD5G:A693DFC\", \":46BCGBB515DB56\", \"2\", \"DBEGBC.G88B7E53\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0::0:2\", \"9DF74BA23F08EG2\", \"B35G7FBF525E8F6\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"33G.B2B5F47:1G.\", \"E04670G2G9CF1C7\", \"6A4E556C:23EC59\", \":48CA:57A0D7:6F\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0:0:0:0:0:0:0:1\", \"36EA76G02401F59\", \"192.168.0.1\", \"0:0::0:2\", \"127.0.0.0\", \"D:F27110D4FD47G\", \"0.0.0.0\", \"2.59.6.2\", \"8B::.5B6B04:E28\", \"0:0:0:0:0:0:0:0\", \"7296.E4B5:5956F\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"A9E4F89B9:AAD07\", \"0:0::0:1\", \"127.0.0.0\", \"::/0\", \"0:0::0:2\", \"4:41602G1673:43\", \"127.2.3.4\", \"9:G..609..E35FF\", \"127.0.0.1\", \"E6A4:AE.1B32AD3\", \":C.E719C7A22899\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::\", \"::2\", \"::\", \"0.0.0.0\", \"2.59.6.2\", \"2.5.20.1\", \":::4\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"G872B5G:.FA5B:A\", \"F3C6G095140355G\", \"0.0.0.1234\", \"9G80G9:G1D99C89\", \"7DE9B:D5A5ED1..\", \"G336.D1C50484.6\", \"2G6EEB7.91BCD21\", \":3B3330A0E7:704\", \"192.168.0.1\", \"::/0\", \".:3:380C.AF:256\", \"3B418923852D479\", \"4EAD68CEA5GEB.3\", \"FB:0DG9AC.06:E6\", \".819DA1763D01C:\", \"G6BC:.27.E2G431\", \"0.0.0.0\", \"::/0\", \"0.0.0.1234\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0::0:1\", \"::\", \"D3.GC3:D6812B74\", \"96A8D91268CCA12\", \"639G4:9B2.9E5D:\", \"0:0:0:0:0:0:0:2\", \"::A994B7:991G4B\", \"CG5D01F42G.8BF:\", \".:D1AF4E7E0E1D5\", \"9219DAC::.2F4CG\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"8FC:0:275G14EC3\", \"..5742AF84F221B\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"503F419F14AD6DE\", \"2656560G37:4B86\", \"2.5.6.2\", \"C651240646GFA:7\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"::1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \":::4\", \"127.0.0.0\", \"E.AC41AGB1G0317\", \"78D307A0..E:F.0\", \"62DGF89B76EDDF8\", \"16AB8CGBEFA3CE0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::/0\", \"BGAEG8.28E150:1\", \"0:0:0:0:0:0:0:1\", \"134ABC055G96B96\", \"127.0.0.0\", \"::/0\", \"CA057:CB6GGGCE3\", \"C1C75F4B:31E8E7\", \"0:0:0:0:0:0:0:2\", \"AAA5A7:437D30D.\", \"::1\", \"EC22B734.8G.DC4\", \"::\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"F56F57B58AF4G58\", \":CD3B45G.D1::G6\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"3A77GEB7:F.8G9C\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"G9:.0630:GG9CE:\", \"04F6A4B9.5FC54B\", \"51A7FC3.CG:FB09\", \"2.59.6.2\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"919.0A347756.BA\", \"6G2B1D221E3F2AA\", \"0:GBFCC6F1B2A6E\", \"C7005973991A89C\", \"74C8A2C0FBF9CBG\", \"2.59.6.2\", \".8.1AG6B35D4G30\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"7EC681G51BDCD16\", \"4D67:G35G97F92F\", \"::\", \"77692851CGBC4AF\", \"::\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"86:G4757900A2E6\", \"::\", \"192.168.0.1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"E16822CC.5CE283\", \"58.BBA5BCAB7933\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"B:GF:3AG11G5B3D\", \"192.168.0.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"95394AF8B:GGEDF\", \"0:0:0:0:0:0:0:1\", \"0:0:0:0:0:0:0:1\", \"2.5.6.2\", \"D69G55ECB:A5EA.\", \"G:G:.298.E593:B\", \"B0.E.61196D661C\", \"GGG:7:600ED0B0C\", \"91FD3FFE3E495::\", \"2.59.6.2\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"2FGEA.5..8C42AB\", \":9571F10488EE48\", \":::4\", \"EAF1.F:24A4.:.F\", \":::4\", \"2.59.6.2\", \"D3G76422:6F:9F0\", \"92D68D5:G48:528\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"9.GF5:4008G812C\", \"2DA57F6C7F:4F0D\", \"A28BD614G75E882\", \"300.0.0.0\", \"5ED0EGGA7F0A2C:\", \"G9BB66EE9BDAGE5\", \"1E2G6.BD3A76FFE\", \"::\", \"0:0:0:0:0:0:0:2\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"300.0.0.0\", \"D8A57..2:9FC4E.\", \"2F28DF552F9043A\", \"127.0.0.1\", \"ED6FDE1989140A3\", \":9D5C2128992CD1\", \"56A4D294.9B0.33\", \".0.EG90DG4A559B\", \"0:0:0:0:0:0:0:1\", \"::\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"AE:7295AC1FDG:A\", \"B7B9E03E5D8A913\", \"B.FD55D6F9G.301\", \"A.9D85D62B0F9GG\", \"6180793E1CGF7.5\", \"8CEC3AD80C70:E2\", \"07B7393BBDE.D6B\", \"A182.5CE.CGB3D7\", \"2.5.20.1\", \"..578DC:6.A:D2B\", \"255.255.255.255\", \"E:EC9200343A9D:\", \"7E3A9F2D201A0C3\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"9DFG4F3E1BB5724\", \"7E1744D.8B46445\", \"::/0\", \"62C..8CG9A.E0D7\", \"255.255.255.255\", \"::/0\", \"53A901CGA736904\", \"127.0.0.1\", \".2DG79E83GA...:\", \"DE1FB:C500A2C6:\", \"5B6:EEGGAB1:8AA\", \"00C3A0A:28122EA\", \":::4\", \"GDGA6F14CAGF346\", \"E4.9:D.21837EE4\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"EE..52GD:C3::50\", \"    127.0.0.0    \", \"0:0:0:0:0:0:0:2\", \"127.0.0.1\", \"A685E2B31F05:9:\", \"AE9627F62B461CC\", \"0.0.0.1234\", \"5C9:ADD.DD98CD8\", \"886985.B4BB3F86\", \"    127.0.0.0    \", \"2.5.20.1\", \"AC0E1DE91B.7C74\", \":::4\", \"AGAB:1263459.DB\", \"G66EA0569810217\", \"1::4280.053F363\", \"C1:GBGC5F1:5C::\", \"8..DB52F4975386\", \"0:0:0:0:0:0:0:0\", \".7E84BG5C041.C7\", \"0:0:0:0:0:0:0:2\", \":C643G7065F1E48\", \"0:0:0:0:0:0:0:0\", \"::/0\", \"255.255.255.255\", \"2.5.6.2\", \"A2C65DCD7B5C82A\", \"2.59.6.2\", \"127.2.3.4\", \"192.168.0.1\", \"0:0:0:0:0:0:0:1\", \"::1\", \"127.0.0.0\", \"2.5.20.1\", \"0:0::0:1\", \"614.9.85C75D113\", \"::1\", \"192.168.0.1\", \"2.5.6.2\", \"0:0:0:0:0:0:0:0\", \"2.5.20.1\", \"::\", \"2\", \"::1\", \"AE80F91BB4C:C25\", \"3GD3.DA:A02A1B3\", \"0:0::0:2\", \"2.5.6.2\", \"::1\", \"26F114:D1:B7G40\", \"93DDC7CAD.GG99F\", \"3BAE4:G82B5215D\", \"0:0:0:0:0:0:0:1\", \"9:F8:2E6A8EG.34\", \"50F2E3114.B2B16\", \"127.2.3.4\", \"G696:AC182BFE8C\", \"127.0.0.1\", \"0:0:0:0:0:0:0:2\", \"17EEB3C0EC9A374\", \"9DFF7A889:8A68.\", \"482D9FB3.1A73:G\", \"192.168.0.1\", \"GD66A1AG:G2E329\", \"32DA3:9F1322B05\", \"::2\", \":B5.E53C1725G79\", \"::\", \"A.7BF801BDC0BFA\", \"    127.0.0.0    \", \"G.79D3A.7AFBE13\", \"FF85G5F:GF61F00\", \"AG2B67F17B:3A08\", \"300.0.0.0\", \"0.0.0.1234\", \"056.4F0C.B70AB1\", \"2880A:EFD3A6A74\", \"8.B8E10CED783A3\", \"82DA02717BA566F\", \"C478:B.EGD8:G52\", \"::2\", \"519BD6348G3EC3.\", \"0:0::0:1\", \"    127.0.0.0    \", \"0.0.0.1234\", \"2841F090.GCB1.9\", \"BE8E7::829929::\", \"0.0.0.1234\", \"0298C80:A4ED6E:\", \"E7162:52F37CFF3\", \"80A0A6CDE19805:\", \"0:0:0:0:0:0:0:1\", \"::\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"5C00:D.F98:9178\", \"0:0::0:2\", \"5D7BE7C:F:85288\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2.5.20.1\", \"0.0.0.1234\", \"192.168.0.1\", \"2.59.6.2\", \"2:16F8G:C747A28\", \"::\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2.5.20.1\", \"08762E.3BE43ED6\", \"5.E26CDC9EDAA0A\", \"    127.0.0.0    \", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"4CB2536C1:E10.F\", \"2.5.6.2\", \"06AFG0ACGF8.GC0\", \".DDC:DE43056B.4\", \"0:0:0:0:0:0:0:1\", \"E57:BD80EC04F96\", \"2.BGG9AD3E:E712\", \"C104DD3EGF49:D:\", \"F50:528DG27.355\", \"07621A934B39038\", \"127.0.0.0\", \"0:0:0:0:0:0:0:2\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"EF0B46B7FEAC392\", \"28GE26F3E1FEB8.\", \":::4\", \"255.255.255.255\", \"::2\", \".7:EC.7.59GE0G0\", \"071B5GC:2A5:E66\", \"0::0\", \"::2\", \"2.59.6.2\", \"D5344A29BG182F0\", \"0:0:0:0:0:0:0:2\", \"B199AF:A0FDD8C9\", \"C9:B029.F760B.2\", \"3G:ABGAD15:A2:0\", \"E1.B:3B8E8G6.9F\", \"4F3FC9:5G39G3D.\", \"127.2.3.4\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"FF7EC5F578929:G\", \"E2B9878G38..1D1\", \"0::0\", \"4GF69AG:.9D83..\", \"::1\", \".30.C.3BF8G7BEG\", \"D2DFC5AD51.269B\", \"3BC.21GA4.8:921\", \"127.0.0.1\", \"B4FEA:CBF926A00\", \"::1\", \"E5:4A3E1A2B0DCD\", \"DEE3AE7D:1F5974\", \"D14G:D50F54905C\", \"127.0.0.1\", \"FD3.C9963G3.14C\", \"3150F.B3F3D5617\", \".7F7784F3FG881B\", \"868A8A4A8:72C:2\", \"0:0::0:2\", \"6D6367:E80ED:8D\", \"407BA144333:514\", \"B8F:7570:B463G4\", \"0A2GCAF76D49044\", \"D3GF1:57D:.98A:\", \"828E1A0:A14F4A5\", \"EDDF31C6DCF790F\", \"A:B945603B1A602\", \".:D:4AF38G4EB3.\", \"0:0:0:0:0:0:0:1\", \"C.C9::1A40118:6\", \"FA42:F4C2BF:8G8\", \"2.59.6.2\", \"127.2.3.4\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"G5DC6.2CAA8D9F3\", \"1260EG6CC621063\", \"::1\", \"::\", \"88..9459047496C\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"127.0.0.1\", \"127.2.3.4\", \"127.0.0.1\", \"40ADG201076DAD3\", \"A973GCF044G233B\", \"192.168.0.1\", \"87EEF:6::AGD98:\", \"A98.C:A17BDE2C3\", \"300.0.0.0\", \"::\", \"127.0.0.1\", \"C2E9ED7.4F.4DG3\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"77AGF1A7.5D73B9\", \"0::0\", \".11:G7:6GDA68:1\", \"::\", \"0.0.0.0\", \"1::2::3\", \"0:0::0:1\", \"127.0.0.0\", \"9C209AA526:B01E\", \"7060A564:5F5C:B\", \"001C6DB2C1CC:C.\", \".A440F905BD9E6F\", \"B.875F8B:6CD89C\", \"99DFE748:3C09.F\", \"AC9G296D3ADFD7F\", \"127.0.0.0\", \"5A:5G2610B4669G\", \"2.5.20.1\", \"9A3D.9BDAC02822\", \"1::2::3\", \"91.C279FA:G1305\", \"152E2G.5..D:196\", \"G88A.14651F9988\", \"2.5.6.2\", \"8.9732AG9D.E989\", \"103CCCAD497F9G3\", \"2\", \"GB4B7D862BDG2F8\", \"0:0:0:0:0:0:0:1\", \"::2\", \"62F11DCB019.9FF\", \"15EF1B253.0:F7.\", \"300.0.0.0\", \"0:0::0:1\", \"0.0.0.1234\", \"::\", \"2\", \"2\", \"::1\", \"B41F9.F9E:G5G11\", \"C7916B4FD5A9.G4\", \"C.C37:70C69BFE5\", \"2.59.6.2\", \"2.5.6.2\", \":::4\", \"AC2:6317DA6:7B9\", \"    127.0.0.0    \", \"::\", \"BG510F0D764CAC2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"DE:0C480F7A8G0D\", \"0G4:0D907AGE903\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"36765G1246081A2\", \"80DB153G124ACF.\", \"A3C90.0493A37CE\", \"GA6:95714:56814\", \"127.0.0.1\", \"9DD3.6GEGCF4:62\", \"300.0.0.0\", \"B2C59699F93CDFC\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0:0:0:0:0:0:0:1\", \":C23E176735B3.3\", \"127.0.0.0\", \"0:0::0:1\", \"C7DBFFDA5332C4E\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"2.5.6.2\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"99A:5:2:491298D\", \"4AD458371B:E:1A\", \"39:6AG9:G:33D8.\", \"388FEF713D37C:2\", \"0:0::0:1\", \"::\", \"127.0.0.0\", \"0E40EA4G8.6AD55\", \"D85F.FF8BG6180F\", \"81FB:E7DE2BC448\", \"0:0::0:1\", \"61020864AD7G04G\", \"0:0::0:1\", \".9B2FCG:400.GC:\", \"C89716.GCFC84:C\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0:0:0:0:0:0:0:0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"770G.6C8622D.3G\", \"AG:F572D3502.AA\", \"127.0.0.1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::/0\", \"3C9852492101A.B\", \"64D5:A89G9975.6\", \"1::2::3\", \"004D.04EE896CG5\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0.0.0.1234\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"BED0:A2C7:F8584\", \":CD5792D9:8GD07\", \"::/0\", \"AEE4B2B6D16:F77\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"C.82A2C700E5D3B\", \"5BDD234A2GCB8DC\", \"63C:66BC0.DE.2.\", \"0.0.0.1234\", \"055G7AD87F4D.FD\", \"5D648711C14D503\", \"0:0::0:1\", \"23425E3.6E50A86\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"F:23B5855C4G1:9\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"192.168.0.1\", \"795533C3G6BG7EG\", \"BC50:20GA5B30C8\", \"127.0.0.1\", \"::2\", \"127.0.0.1\", \":G0F1DDC1284GBD\", \"3C8:B1B4BF0F7EA\", \"0:0:0:0:0:0:0:0\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"127.0.0.0\", \"0...989D.F8BA76\", \"    127.0.0.0    \", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"253550E5AE43G58\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::\", \"3GEBE6B762C8E50\", \"4CDC29:AE6:85.B\", \"B7B6154BE5.:.71\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"D8342AADB8C8425\", \"::\", \":::4\", \".527BE0A00D1397\", \"4GG:F0B5FD2DFA4\", \"2B3G71.6.D.A:7F\", \"AB14061D3810FB4\", \":5G36GBF18A:C84\", \"127.0.0.1\", \"A:.7CF1C:74:0F4\", \"DCE2288BC72:DEE\", \"987460G92384445\", \"127.2.3.4\", \"5CG71118AA.5836\", \"A1A56DD9:2016AC\", \"2.59.6.2\", \"2.59.6.2\", \".67460E56098B9C\", \"3A26:ED:E9EF2:1\", \"39G5993BEC92147\", \"::/0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"300.0.0.0\", \"::/0\", \"C8017893D:A750E\", \"5C7A508.B8AE785\", \"B6F9FGD66FD9F28\", \"2.5.20.1\", \"3862A6D:B:9BG16\", \"50B7A853965:5EA\", \"A9B..1BCE1820E0\", \"C:757CAGE.5694F\", \"2\", \"DACDB2E48.B84::\", \"0.0.0.0\", \"127.0.0.0\", \"::/0\", \"1::2::3\", \"66D3B4:7F.62:21\", \"7CC634E23:C481D\", \":6BFGE9D9FE9F14\", \"::1\", \"0:0:0:0:0:0:0:2\", \"0D7F.A0E22:DB.E\", \"127.0.0.1\", \"2.5.20.1\", \"9271DG99A:.0B61\", \"127.0.0.1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"3.5G64217E3:.A4\", \"300.0.0.0\", \"::/0\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0:0:0:0:0:0:0\", \"2\", \"8CGB3:31.D53E8F\", \"F8.C490E509G.8E\", \"G:C5A93CBF86.7G\", \":D.893.2:E58FG:\", \"1::2::3\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"127.2.3.4\", \"C:36G104FE6C93.\", \"192.168.0.1\", \"DD26009EEA7:644\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"F504635CEF:05.A\", \":::4\", \"127.0.0.0\", \"::1\", \"D39:A6B485:6E:9\", \"0.0.0.0\", \"E64:9EG.2BBB:F:\", \"E.08EA1..BD78C1\", \"::\", \"0::0\", \"7:34903:593B4CC\", \"9BE226..:92C6D1\", \"::1\", \"G.A:49BG2983A02\", \"EE5B01D1F1:6G65\", \"E55FFD7GE:CB.D2\", \"68C039.AA5:A2F9\", \"E.G0C5F26A31.E3\", \"BB224812:A::A47\", \".5927.9ABCC397.\", \"EBAGGD7677223AA\", \"3G809:EAE8BFGC.\", \"127.0.0.1\", \"::1\", \"0::0\", \"589253DCA6534.G\", \"::\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0:0::0:1\", \":::4\", \"1::2::3\", \"AA048A39DF:5079\", \"0:0:0:0:0:0:0:1\", \"0:0::0:1\", \"55367D:C.3A.56B\", \"47..12G58B7GE.G\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"2.5.20.1\", \"0:0::0:1\", \"FB987:8G:317.D5\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"64B4.B2DAA3655C\", \"64D:4C6AEDG25.5\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \":7B7EEF6B770E8G\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"127.0.0.1\", \"3A:8.F73525BCA0\", \"EDE547:.:C:4G75\", \"05295E:1A48585G\", \"8:G572C90C0B53C\", \"D9B:3E9CE7G1C6.\", \"B96:D0DBD8D.39.\", \"G84AFB9B80E6FE0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"A:A54C8C.:G02EG\", \"7A90BDC8:2ABBCC\", \"2.59.6.2\", \"127.0.0.1\", \"23:13272G11C88D\", \"0::0\", \"2.5.20.1\", \"C57370DC:B77088\", \"AB640970:CC31C5\", \"2.5.6.2\", \"6BFA.550G3G2A9G\", \"CE.4:7013AE41:5\", \"0.0.0.0\", \"0.0.0.0\", \"4454E95E71F4B9G\", \"35:10.311G41G73\", \"3D48644A9C1F323\", \"0:0:0:0:0:0:0:2\", \"1::2::3\", \"::1\", \"07913C.E78G1:F.\", \"0:0::0:1\", \"192.168.0.1\", \"439C3E7G.7:2CG4\", \"::1\", \"6DE1A9053DFDFF1\", \"55866E:DE2A.B64\", \"FA4943919D94354\", \"127.0.0.1\", \"41GG.:FC.33G9G8\", \"0:0::0:1\", \"DG4GG51405CB95G\", \"GE25A6A4F16GCD0\", \":::4\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \":::4\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"6043BDC9166DDG6\", \".CECC:F7.7F1F0.\", \"A4FBA07820DCD30\", \"::\", \"1CF21E21CABF93E\", \"::/0\", \"300.0.0.0\", \"0.0.0.1234\", \"127.0.0.1\", \"BF71542EC1D.6.5\", \"::1\", \"0:0::0:2\", \"300.0.0.0\", \"127.0.0.1\", \":::4\", \"46227A26G.4948E\", \"E1D56.G2DF27511\", \"::\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"F8:DF:93:0:0510\", \".438:B6G7D28552\", \"0216C2287962163\", \"127.2.3.4\", \"73:78800.E24B87\", \"BC8F061A33B90:8\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"795G:7623A035BG\", \"0::0\", \"2.59.6.2\", \".964DDB5E0733D3\", \"9D751598B.CE1G6\", \"::1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"4488D68609D8F1B\", \"169FCGAGB:.C421\", \"D6E3FAAC6889240\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"FGF4F941398G9F3\", \"3892DB3GBF5EB0A\", \".8BFC9977:5160G\", \"    127.0.0.0    \", \"0:0:0:0:0:0:0:1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"4AF.C92B.3BE.63\", \"E061905C1:60805\", \"CE33768B0B:3.02\", \"::\", \"880849GC226.:12\", \"80A5.04B.D43F97\", \"4D790173D:07407\", \"88:A304FB3.5D72\", \"::\", \"6E6B88E86FG7:CD\", \"A.A462E:83B.736\", \"A8C22G7383B.D87\", \"0.0.0.1234\", \"G3499G4EB976B.8\", \".C4B2C1E4D:B41:\", \"E344.GA6B:ADC96\", \"EFEA64567G.738E\", \".2E0E:87EGC..:A\", \"::/0\", \"0:0::0:2\", \"0.0.0.0\", \"BAC22DA7GFGA6DA\", \"::\", \"F52701EC8F33FDB\", \"14924C3A8GC4:62\", \"55E2::DEA7C691.\", \"4AG1FA7B7A31090\", \"0:0:0:0:0:0:0:0\", \"1::2::3\", \"1A2:F18F:A241CF\", \"0:0:0:0:0:0:0:1\", \"2F17CC9135CDA68\", \"23E1A88A718346C\", \"127.0.0.0\", \"491144DF82B1423\", \"DG.7C7A98A8B3E7\", \"2C6A:08:F0GD39D\", \"255.255.255.255\", \"::\", \"0:0:0:0:0:0:0:2\", \"192.168.0.1\", \"E591326A269GA4G\", \"1D9AGC8:8CC6G19\", \"8GDDA621C4085GG\", \":86:729FC80FC4B\", \"0:0:0:0:0:0:0:1\", \"8CC93B66C5GE63D\", \"A.8F954CG.:252E\", \"0G200C76G57F06F\", \"CED.C0AE27G0BFA\", \"8DBDC93D30:0.BC\", \"03FE1C2A1A92B1E\", \"1::2::3\", \"255.255.255.255\", \"127.0.0.0\", \"    127.0.0.0    \", \"2.5.6.2\", \"4D2C2E8DB43A.49\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0C5EA.B75768347\", \"0:0::0:2\", \"0.0.0.0\", \"A620.784D299A29\", \"255.255.255.255\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0.0.0.1234\", \":::4\", \"6G2D3D44CE135.2\", \"0:0:0:0:0:0:0:0\", \"C0:DGB46CB.3CC9\", \"F0B4662DF0.BF7C\", \"42G72B08.960237\", \"127.2.3.4\", \"0:0:0:0:0:0:0:0\", \"B2B79646:3.B.G7\", \"C8B1CA6485AG50.\", \"98:6CC.D.50F1:7\", \"127.0.0.0\", \"EC9GE:4F1G58C54\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"01EC6D001GCF58F\", \"::/0\", \"127.0.0.1\", \"62F80E:288E7C85\", \"::1\", \"F019.A60A8DED6A\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"99DB:165F:5A:8G\", \"2.C4911397:7C0.\", \"::1\", \"028531G53G:B5F5\", \"127.2.3.4\", \"2\", \"54F4C466F30EGA4\", \":::4\", \"D4G9A::.7E1F.6A\", \"0.0.0.1234\", \"0:0::0:2\", \"8346EF2BFCE3226\", \"25D3AC6358DF8C2\", \"FD95G53D28D3.G.\", \"GFE455E646DFA56\", \"ABBCC3634B38023\", \"300.0.0.0\", \"BG5AB2::538.DE0\", \"127.0.0.1\", \"0:0::0:2\", \"C1931867E5A0184\", \":::4\", \"0.0.0.0\", \"0:0:0:0:0:0:0:1\", \"56E1.5583.E0:F8\", \"7.BCC4ED5A:BE04\", \"::/0\", \"2\", \".37ED8:F5DADC74\", \"::\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"127.2.3.4\", \"0.0.0.0\", \"A13CEE936DA6A93\", \"F49FG34:F81E9E6\", \"::1\", \"0.0.0.1234\", \"127.0.0.0\", \"255.255.255.255\", \"::1\", \"0.0.0.1234\", \"192.168.0.1\", \"2\", \"300.0.0.0\", \"127.2.3.4\", \"8CDEA39931:F6B5\", \"C..08F::DDE9FDC\", \"E756:1DD74391:7\", \"D6G:E2BAE.B21AC\", \"::2\", \"2.59.6.2\", \"5G3B3BB8C7CDGBG\", \"C6C69.594B4D454\", \"5C3.401B98:58:0\", \"::\", \"    127.0.0.0    \", \"0:0:0:0:0:0:0:0\", \"D1C8C2B84E.09D2\", \"300.0.0.0\", \".1D.8FD36.9:78C\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"127.0.0.0\", \"45.3940B5A5ED4A\", \"C9:F05C77DD:G9G\", \"2.59.6.2\", \"2.59.6.2\", \"2.59.6.2\", \"127.0.0.1\", \"2.5.20.1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"1::2::3\", \"D9C35D0C:CG4434\", \"AG64EDAC956E77.\", \"::/0\", \"::2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"127.2.3.4\", \"255.255.255.255\", \"0:0::0:2\", \":75F:ACC8GA8A54\", \"255.255.255.255\", \"127.2.3.4\", \"3B09B9EBA5A3AEB\", \":::4\", \"12G7C26.:3D08BD\", \"::1\", \"E72.GE61AA2ABBG\", \"87F1A4BB9CA68F6\", \"127.0.0.0\", \"B:789EE4FC5.E5E\", \"127.0.0.0\", \"0E7D27C.79F.564\", \"13:G1B:2A0535D5\", \"5144F::778D37A:\", \"2.5.6.2\", \"71EABC:3D3:FAB0\", \"579E536.72A6.86\", \"0:0:0:0:0:0:0:2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"A81AGCD03B5:47.\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2.5.20.1\", \"0:0:0:0:0:0:0:0\", \"75DC3871:G8:C0:\", \"61D7A7A23643F2F\", \"08466E3A1:.BBCB\", \"779EC88095C4F7E\", \"0247:57766.D::G\", \"30AD3BABECA794D\", \"192.168.0.1\", \"::1\", \"0::0\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2\", \".7BB.139F4DG0BC\", \"::\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"9DF9CG63B6FBEA0\", \"GA9A:CD54CE2DEB\", \"D8140:49.C:ABB9\", \"127.0.0.1\", \"AGBFB1F9E0C9:BC\", \"D3054G67A2:GGG.\", \"::2\", \"8291.B288DGE0D8\", \"    127.0.0.0    \", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"    127.0.0.0    \", \"300.0.0.0\", \":G035.3EC28FEE:\", \"0.0.0.0\", \"0::0\", \"0.0.0.0\", \"BA71DA6DD:5ADDF\", \"0:0:0:0:0:0:0:1\", \"127.0.0.1\", \"1DAFC48A58F917E\", \"DA.GD53G537GCFC\", \"A:.20E58A4977G.\", \".6263FA15097:G6\", \"B4A89A2D99F7C7C\", \"8D259BB22.B0:EF\", \"127.0.0.0\", \":7F45ACA6G73.07\", \"7CE10B197:81AF.\", \"255.255.255.255\", \"EBA6DD4G4DB981F\", \"07FG29.FF0C1FD1\", \"B72B8:982DA8361\", \"1::2::3\", \"6:3EG3B28DF8B49\", \"    127.0.0.0    \", \"0.0.0.1234\", \"3G7:2C5CGG5534G\", \"GA32.A5A:4AE:4.\", \"    127.0.0.0    \", \"3952BA3.E5BD92A\", \"92GE:B837.BD426\", \"BE1..6.8::3A946\", \"255.255.255.255\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"G94A3106:G85D5A\", \"9662B.8B5C6:16E\", \"42C2D8D8C6559CG\", \"CC62B637B4FC.4F\", \"AB67B6820CGAGGF\", \"D1BCDEC979BEE9E\", \"E806BEGE:1EF1F7\", \"7A5.2BE10D.:.28\", \":.57672G19FB3FD\", \"A13E704A.6G::AE\", \"1D5C2469E78DD:8\", \"27:E741692FF4B6\", \"F3BBEA9573DC559\", \"2.59.6.2\", \"0:0:0:0:0:0:0:0\", \":76566.49G22BEE\", \"DB1A56BBEC1FFG2\", \"2.5.6.2\", \"3E614E1F6.2.E36\", \"::\", \"778.9619B1F05..\", \":::4\", \"::2\", \"592146EGBFF2900\", \"AG932:F4GCD5DG2\", \"127.0.0.1\", \"127.0.0.1\", \"0F15BGE0624F4CB\", \"2.5.20.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"43297094310:5D5\", \"::/0\", \"192.168.0.1\", \"::\", \"0:0:0:0:0:0:0:1\", \"2.59.6.2\", \"F:4::BBD9.A0022\", \":15.55AGA09AF:4\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"127.2.3.4\", \"265BC039EEG.92D\", \"5B7.8E1B7AB3950\", \"300.0.0.0\", \"300.0.0.0\", \"94G3749C8BC6.C7\", \"0.0.0.1234\", \"B8F2828233F45B8\", \"2.5.20.1\", \"0:0:0:0:0:0:0:0\", \":39EGE81D8D8A78\", \"::/0\", \"3FE21B.A0EB111F\", \"2\", \"BEB5498D.38C2.7\", \"EA2.09:.BG3G.91\", \"2::BB63DG718:DA\", \"127.2.3.4\", \"AC8:4166C2EFBAD\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0.0.0.0\", \"5.0:GFF2E69G7.0\", \"423DF1D2A11C8C8\", \"54.2A64DCF.64.4\", \"::\", \"127.0.0.1\", \"C5:455E9:B1B:34\", \"0:0::0:1\", \"0::0\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"5783G9B8B5509B:\", \"300.0.0.0\", \"255.255.255.255\", \"1::2::3\", \"D.BBF1.:E:EG6..\", \"0.0.0.1234\", \"6047D:F99.:4299\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"2.59.6.2\", \"2:FG33EAA0:..2B\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"127.0.0.1\", \"255.255.255.255\", \"924GE751E2EF6F9\", \"91C508.F0FECD..\", \"236:FE0.32A946A\", \"0.0.0.1234\", \"F01AG:F419E8G9.\", \"300.0.0.0\", \":D:78B.39784B6D\", \"6G6DD75B8.EE7E0\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2.5.6.2\", \"C80DA79CGG.080C\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"5294G86CEF.A98:\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0:0:0:0:0:0:0:1\", \".25G.835A3B013C\", \"2.5.6.2\", \"30649:C5FC572D0\", \"0:833.FD84:E763\", \"FF3283D798D:G52\", \"EA6CBF24A57G494\", \"300.0.0.0\", \"D36309:508129.A\", \"::\", \":::4\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"75657.E:B6B7042\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"    127.0.0.0    \", \"2\", \"2\", \"5B7C495D4AC17E4\", \"84E:E:30864D5BC\", \":::4\", \"127.0.0.0\", \"E87C1B:CF91A609\", \"0:0:0:0:0:0:0:1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"9GD726974G37B52\", \"813E4FE8D4BBEF0\", \"::/0\", \"0.0.0.0\", \":BFB.31E7.G.BA.\", \".4E:F3F9.DD:C22\", \"0:0:0:0:0:0:0:0\", \"43G4F2442380680\", \"3E894B2375BC647\", \"::\", \"0:0:0:0:0:0:0:0\", \"127.0.0.1\", \"0:0:0:0:0:0:0:2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"6:1541BC9F589E7\", \"E1.8G6516F01C22\", \"F106BF152B3E3E1\", \"BB.B57538CG8.40\", \"127.0.0.0\", \"EFEB830GBC7AG99\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2.59.6.2\", \"C010CCB96BGF91B\", \"886.70F2.B.21F.\", \"2.5.6.2\", \"2.59.6.2\", \"E7E.28F794048.1\", \"A8AG23.D1123F.4\", \"4C.96G.850.8GB.\", \"196C6EB3FD1D4G8\", \"CGE988BG29B69A3\", \"D6724:391DC4F63\", \"::\", \"0:0:0:0:0:0:0:2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2.5.20.1\", \":C:5:.C58504CCE\", \"0625E61:823011D\", \"9AG.80B2.1D:80G\", \"5968AF88D2561C5\", \"2.5.20.1\", \"127.0.0.1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"B97DE:A7.84F809\", \"1::2::3\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"300.0.0.0\", \"03G568F7G:F240D\", \"0:0:0:0:0:0:0:1\", \"E4C4.03:56194E0\", \"2.5.20.1\", \"392.A24DEA93749\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \".2CB26F91D3GFA2\", \"127.2.3.4\", \"2..076C4BB71C43\", \"DD1.C:EE8D6F32G\", \"::1\", \"354B6B9::A49A:F\", \"7G..519223B61D:\", \"192.168.0.1\", \"0:0:0:0:0:0:0:0\", \"B92D5E49B4C0::2\", \"127.0.0.1\", \"C79:BG:C7A288CB\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \":059:G.54.:AF70\", \"478B8E:254DA.B1\", \"E678836EE7.12.C\", \"127.0.0.1\", \"56C.C7FAF3G7EFF\", \":744F.DC9A6DB42\", \"6B55.6787CEE33F\", \"    127.0.0.0    \", \"FE7.:BC:2891BBC\", \"::\", \"23825.D3D764455\", \"255.255.255.255\", \"C6BAFAB9FB.192.\", \"0.0.0.0\", \"127.2.3.4\", \"83E633CA219A2F6\", \"    127.0.0.0    \", \"CAGB68EEC101D1B\", \"0.0.0.1234\", \"0:0:0:0:0:0:0:0\", \"127.2.3.4\", \"300.0.0.0\", \"0.0.0.0\", \"2..2AEGEF6A3E3A\", \"0:0::0:1\", \"107FGC75GGA75G1\", \".AGDE5.8:F.B4FB\", \"127.0.0.0\", \"127.0.0.1\", \":GG623DA04:.5D9\", \"G639422DG3C:9E5\", \"127A9D73C9F89AE\", \"GDEGD5AB3BG3CA.\", \"2.59.6.2\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2.5.20.1\", \"DD8DE1A7CBFGB:A\", \"::1\", \"3FB914GDAG2BC19\", \"0.0.0.0\", \"::\", \"3.:A1.1415DB905\", \"::1\", \"0.0.0.1234\", \"7C31.9564D5F.6C\", \"127.2.3.4\", \"904:73F1:G68046\", \"::/0\", \"5AF1.CG.80AC9CB\", \"E9598F.232D.C3G\", \"C6.434.B8C5A7BA\", \"6DC27C88293B329\", \":::4\", \"::\", \"1FABGF65100:E6E\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"1G8:831F41.24G.\", \"8B6GD9C85DC15DB\", \"0.0.0.0\", \"EEB2CE6B9GA13BB\", \"0:0:0:0:0:0:0:0\", \"0::0\", \"127.0.0.0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0:0::0:2\", \"0:0:0:0:0:0:0:1\", \"E7C6051F29:72D9\", \"8G675100471G3.4\", \"0.5394D7CG6CF58\", \":DF57AE3E:6BC4B\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"C9.8.99C7C4A:FC\", \"BE.4BGCB0.F9147\", \"3:G77A6::.09A31\", \"1::2::3\", \".01861754C4.1.B\", \"D19198625GD804E\", \"06:FE0.DFC8462B\", \"5A167GD85ACF2F2\", \"2CB16.9A443:3G0\", \"4CE55G4E5GAC3G.\", \"54D6666:751FF17\", \"2.59.6.2\", \"51D69C8:A220AFC\", \"2AD98867F56330.\", \"G59F:048EAE.888\", \"2.5.6.2\", \"2\", \"6:4.D6AFA999EF4\", \"127.0.0.1\", \".ACBG73968..999\", \"22121GGC546.F.C\", \":FCF6:6F0E47200\", \"E.9F437CG6B9A5.\", \"E0D91DCCB4:71:4\", \"F5528:1:G54E3D0\", \":C9:EAD0:A4DA2D\", \"1DA6EF325275D:6\", \"G2E.CAF614D8EFB\", \"0:0:0:0:0:0:0:1\", \"C5E43AF:5G1F6D:\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0:0:0:0:0:0:0:1\", \"3903.8D1ADG5:A1\", \"::1\", \"::\", \"::1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2.5.6.2\", \"66F5GC91E2:5530\", \"0:0:0:0:0:0:0:2\", \"::\", \"37209GG6B67.189\", \"7:7BA:4633C4476\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"A1CEF6924DB1878\", \"FC.749G05GCB464\", \"2\", \"5CA93660496CF6E\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0:0:0:0:0:0:2\", \"00:F4G9F5E96FC0\", \"0:0:0:0:0:0:0:1\", \"2.5.20.1\", \"::\", \"7F9F5B2FDE4C:C3\", \"2.59.6.2\", \"658B6D466422BC:\", \"2\", \"3FC18EEG375GGG7\", \":F0856F3:.C4BB9\", \"4GD8G6:ACED01.7\", \"C43A67D..E:BG48\", \"746F3DD62A0:G87\", \".09C07G162:.B07\", \"2.5.20.1\", \"127.0.0.0\", \"56F99CDD790EA4C\", \"2.59.6.2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \":7F3026C:807:96\", \"ABC8F744FF:D278\", \"6E9F1:21AA9FEDF\", \"GDE6D6::3E:A76D\", \"2.59.6.2\", \"192.168.0.1\", \"127.2.3.4\", \"G22E:GC836E.8CB\", \"BGA7:GC1EC440CA\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"2DE60D48G8835.4\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"EC115F899.FAG:A\", \"::\", \"B0A0.C6C:96::6:\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2.5.6.2\", \":767589D106C5C6\", \"2.5.6.2\", \"54A::644C0DGC:9\", \"G7F118C6218A61:\", \":::4\", \"8B74ED5E7.0G0.0\", \"300.0.0.0\", \"69DE63:5ED0G748\", \"127.2.3.4\", \"2.59.6.2\", \"255.255.255.255\", \"2.59.6.2\", \"192.168.0.1\", \"0::0\", \"0.0.0.1234\", \"02659CDBC9B8180\", \"0:0:0:0:0:0:0:0\", \"232DD977.302886\", \"::1\", \"127.2.3.4\", \"DB9714F1F8EA.82\", \"1::2::3\", \"0:0::0:1\", \"BG78AD243E37BG4\", \"0:0::0:2\", \"D3GG7E72GC35G39\", \"37E14529D5FD9CE\", \"0:0:0:0:0:0:0:1\", \"481D:.23B7FD2A7\", \"0:0::0:1\", \"D26757.:A67:0A3\", \"1::2::3\", \"A8B2EACF:ED34BE\", \"6G:0G3.ACBA55C2\", \"0.0.0.1234\", \"1::2::3\", \"0:0:0:0:0:0:0:0\", \":.:A1G8CG3:DG56\", \"13BC0FC9B50.D6G\", \"0887279326A9GC8\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"92EA3A601G2:209\", \"192.168.0.1\", \"542894D66CB81EA\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0:0::0:1\", \"4:AEGDF4358A12G\", \"33G8E7280F.D8F2\", \"ED.3F9199::0FFD\", \"A8CFEA6CG0EGAA8\", \"07BDD0DE3B21DBE\", \"6C0AAC06:1296C1\", \"D.41CB9FG2C.G69\", \"GCBD9457095A546\", \"2F8138E1C0874.7\", \"2.59.6.2\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"2\", \":D59DA:C160D8G0\", \"127.0.0.1\", \"0DB23G41:552.9G\", \"80AE66505DE910E\", \"192.168.0.1\", \"E5BD3E6F5.BA.E6\", \"59904CB8445:228\", \"AEA3D404DE604A.\", \"::\", \"0:0::0:2\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"6F7173AE178E7EG\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::/0\", \"0.0.0.1234\", \"8110GB5ACCGCEC0\", \"0:0:0:0:0:0:0:0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"5B9E4262042EE5C\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"6411DE321504:AC\", \"::1\", \"300.0.0.0\", \"0:0::0:1\", \"0::0\", \"95DGD5:61D9A2AG\", \"    127.0.0.0    \", \"0.0.0.1234\", \"::2\", \"0:0::0:1\", \"E35C601EA5A397C\", \"DBB4B64A86F8D3E\", \"2.5.20.1\", \"300.0.0.0\", \"127.0.0.0\", \"8A379C36GF6796E\", \"F9D3:2G6BDC747.\", \"B10EA57A2B:D962\", \"864EC84B50G3CA0\", \"2BGG:E53.0:FEFC\", \"2.59.6.2\", \"6C99EF07FGBC2C3\", \"0:0::0:2\", \"6662F:289EBCE28\", \"2.5.20.1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"BCAE.:BFD:FFA31\", \"47E574.G0GC2E.6\", \"::2\", \"0G.36CDF668D51D\", \"2.5.6.2\", \"0.0.0.1234\", \"2\", \"G27EA688964A7:7\", \"GG7D:E34CB363D:\", \"EF8672G:12D0D64\", \"::/0\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"CAC254F8:GC01FC\", \"DF9:.0BDE6212D6\", \"300.0.0.0\", \":7:70GGACG9CG9C\", \"127.2.3.4\", \"2.5.20.1\", \"DC1:FG01ECD09GD\", \"63379:2GEAD:6.G\", \":098.4ED75FG731\", \"9ED328:22:A:85:\", \"0489BF:0C667:06\", \"::\", \"0:0:0:0:0:0:0:0\", \"9A93A61:B71B.2D\", \"127.2.3.4\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"3DA011B1G7D5BC2\", \"127.2.3.4\", \"1D:8C17.27G7AE:\", \"A:C34F660B24EEA\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"192.168.0.1\", \"127.0.0.1\", \"F149ED740GG22A6\", \"6083F:5C7E7443G\", \"2.59.6.2\", \"79:2838E533920C\", \"0:0:0:0:0:0:0:2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \".FFDF8B3D6937:F\", \"    127.0.0.0    \", \"2G:1AGG850DD42D\", \"0.0.0.0\", \"2\", \"127.0.0.0\", \"0AD.2BE2AG:7A45\", \"757E395C:1.1492\", \"2.5.6.2\", \"D94E074:57F6E:9\", \"C56D2A4:6D95.0B\", \"2\", \"2G343D83AF193BF\", \"6B242.A47BCBFAE\", \"6D140.93843477F\", \"127.0.0.1\", \"G9E2FD238:1G528\", \".98EF144:G8BBFF\", \"D43CB00::0GF1BG\", \"0EDF8DAG3.80B3.\", \"D:3791B4.68.D9F\", \"AEE74::EA63CD.5\", \"0:0::0:2\", \"6592A7G4EEC799C\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"E6A3937:77.FF91\", \"0:0::0:1\", \"5CC372AC2C97A26\", \"C08EAD5EC08A:EE\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0:0:0:0:0:0:0\", \"1::2::3\", \"127.2.3.4\", \"2.5.20.1\", \"4A4473AEDD917E7\", \"E85AA792DG3E.24\", \"    127.0.0.0    \", \"32EDDFE1:B8137E\", \"0:0::0:1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"E7D826D1C64FA8:\", \"695E37.4D.1C937\", \"300.0.0.0\", \"4BCB154:579B0.9\", \"0.0.0.1234\", \"BCFC0C0D2.FB63C\", \"2FAFD:2B5F93853\", \"0.0.0.1234\", \"5917A::DF83D35A\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"13.674C566F4CB0\", \"0::0\", \"GBE:C7.3A4..1:2\", \"13FE6B88E3C02EF\", \"::1\", \"1::2::3\", \"2\", \"::\", \":12A.4902G.EG70\", \"0:0:0:0:0:0:0:1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"255.255.255.255\", \"300.0.0.0\", \"0:0::0:1\", \"::\", \"628.D95B204:3AD\", \"0:0::0:2\", \"55235:4AD.96G34\", \"::/0\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"9525869C:36E.AC\", \"9EA7:91:6EF7F92\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"300.0.0.0\", \"6C3D148E54D.EG3\", \"F57350BC92:A74F\", \"9F.28A9B1321.5B\", \"0::0\", \"809B2A41634E982\", \"G201F.G6.G.:369\", \"D:C:4:.:2.69841\", \"127.2.3.4\", \"0:0:0:0:0:0:0:0\", \"A0E6EA0.FA3AD39\", \"2.5.20.1\", \"2.5.6.2\", \"3B:BD69GG1A38GF\", \"192.168.0.1\", \"0:0:0:0:0:0:0:1\", \"0::0\", \"222B8C8DE.5GECA\", \"24BEA77572E3::B\", \"127.2.3.4\", \"D878.D83.G2AG3A\", \":1B5008EDEDF1:0\", \"0.0.0.0\", \"331G5F0DAGD00B2\", \"::\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"3G.14E5FB8GG97G\", \"192.168.0.1\", \":F5911.06E7.G83\", \"127.0.0.0\", \"C574AF3A9E.F9DG\", \"::\", \"993D13:8ED8.DE1\", \"8E:27:2F4GD4183\", \"::\", \"::1\", \"E9BA:G9D12EBE03\", \"255.255.255.255\", \"C583GB73C.0396A\", \"0:0:0:0:0:0:0:0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0.0.0.0\", \"    127.0.0.0    \", \"0:0:0:0:0:0:0:0\", \":03D6DA83.80DDD\", \"127.0.0.1\", \"2\", \"2\", \"2.5.20.1\", \"255.255.255.255\", \"0:FEC9EG867B839\", \"9016F8.5G:G8914\", \"0:0::0:2\", \"0:0::0:1\", \"83B5DEDECCGCC.7\", \"127.0.0.0\", \"GD1124A0ADF37D2\", \"::2\", \"300.0.0.0\", \"3F90677867ED49E\", \"0::0\", \".001:970A5C:808\", \"2\", \"B:AD26818E:D:F7\", \"4C68753D3540862\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"6EB730551FDF0:.\", \"E.27CB5G1GB722C\", \"101FG8G7GEFC02F\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"AC85FFC..10D9FC\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0.0.0.0\", \"2.59.6.2\", \".9:38606F73932C\", \"2.5.20.1\", \"6GC9761839EGFA3\", \"59B3064F92E7C7C\", \"2.59.6.2\", \"2.5.20.1\", \"::/0\", \"25:4DAB2A9586F4\", \"B86666:E0C2E696\", \":F:65D3ADCE.9:9\", \"75E45G8:56D96GC\", \"E.7AC97:6G29:5G\", \"02:F23E372.D9.5\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"300.0.0.0\", \"2.5.20.1\", \"127.0.0.1\", \":C96.EA8.EBEF96\", \"8F80517793.AB07\", \"2.5.20.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::1\", \"5CF9621A39B2A1B\", \"F57D:C4F1F:6:CC\", \"::1\", \"9C7A4E21E65E8B2\", \"4A78G:084CE7.8A\", \"C3G699.4F41164.\", \"B6FD.GDEG424F2:\", \"2.59.6.2\", \"0:0:0:0:0:0:0:2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"9060647:E0G87A.\", \"::/0\", \"4C4:51AD9F69664\", \"C4DB9D5F669C65B\", \"127.0.0.0\", \"28155D:A8.4C68B\", \"45DB1EG4D3696CF\", \"A:A22F2F8D5FBF5\", \"CBB03DA.38.5345\", \"83408G4FG6271EF\", \":::4\", \"DAEEE:22454C6C:\", \"3BF4862GD8AF3F3\", \"127.0.0.0\", \":13B85BA128G554\", \"6EAB:92.1A.F97B\", \"67A855D47B654B7\", \"300.0.0.0\", \"127.0.0.1\", \"2CD91FB:7.7314C\", \":2GACEA6F11EB:.\", \":::4\", \"1DCC7:0E3030337\", \"5C:3F547ECB4DDE\", \"G3EGAD..69.:1AG\", \"0::0\", \"384CABB.2E01DE8\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"AEG9FGE28A85830\", \"G843A8G:953.8G5\", \"::\", \"2.5.20.1\", \"0:0::0:1\", \"127.2.3.4\", \"2.5.20.1\", \"294A.0.A8G4CC87\", \"255.255.255.255\", \"127.2.3.4\", \"127.2.3.4\", \"0.0.0.1234\", \"0:0:0:0:0:0:0:0\", \"3670FG97G1ECEF5\", \"DA4:34:57B05C20\", \"438B07.A19CD225\", \"300.0.0.0\", \"F7010D6676E5:62\", \"127.0.0.1\", \"2\", \"D5DB1DC:96:GDCC\", \"7.099.BG156F128\", \"2.5.6.2\", \"9E3G6F45333C7.5\", \"::\", \"80176BG34D4G020\", \"::\", \"::1\", \"0:9.FCD72G900E7\", \"2.5.6.2\", \"0:0:0:0:0:0:0:2\", \"AD0D92F:G7E52B8\", \"5E1A807E2.8E9C8\", \"300.0.0.0\", \"EDEDA9F0DFGED53\", \"45C:BG8CDDC.F1:\", \"0.0.0.0\", \"G46G5D243F501E3\", \"B4A76D4.4852FGD\", \"0:0:0:0:0:0:0:0\", \"FCD496AGB7B38:B\", \"AA3A4A:3B1C1288\", \"1D9.2:9.6.928D9\", \"E476AB18F:43E41\", \"19B64E055113.3F\", \"0.0.0.0\", \"44FA6FGD77D44E6\", \"DB14AA:C:42B:CF\", \"2A2BAD5GD15:6C2\", \"E23203D2D4.B7GF\", \"126AB2:0:62A9G9\", \"0.0.0.1234\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"D911629FC45C174\", \"35F.76513G7E4.8\", \"::2\", \".7.GDB.E:683B0F\", \"0:0::0:1\", \"0::0\", \"GG2E9A9.C1D4119\", \"0:0::0:1\", \"E0FE742:2C:6A3C\", \"7A.E21EGCEC7GAD\", \"8C608B4319.E333\", \"161DBB661EECB4E\", \"BG9.:7711FACF5C\", \"7E4C36B.2C7DB..\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"51G53C4B.98.E44\", \"192.168.0.1\", \"192.168.0.1\", \"3B0C1::1GG70970\", \"A64DE43G0C76G.7\", \"3C4AF5F7.7:1353\", \"B:2B.89AB119648\", \"2.5.6.2\", \"0:0:0:0:0:0:0:1\", \":::4\", \"5C95F49B71ECF75\", \"0.0.0.0\", \"C13A61C0:7FF:C4\", \"0:0::0:2\", \"::\", \"99DE6DF:6710738\", \"0:0:0:0:0:0:0:0\", \"5A.1D762BA.D7A7\", \"78G5G:4B:0035BE\", \"D03E8G753B59B.D\", \"0:0:0:0:0:0:0:0\", \"5F8133DF3A.B84C\", \"060E550361CGED0\", \"0:0::0:2\", \":::4\", \"::\", \"B09.EG67.9C0.53\", \"0:0::0:1\", \"::/0\", \"300.0.0.0\", \"B8425229C4G2A5C\", \"300.0.0.0\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \":::4\", \"0:0:0:0:0:0:0:0\", \"127.0.0.0\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"AG18569846BA452\", \"912774C16380A2.\", \"2106185C2G23E0.\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"255.255.255.255\", \"300.0.0.0\", \"57F05C97C2093FG\", \"4AB3152EA96ACAA\", \"C1AF198AGCA2.4G\", \"17916:D729ADB89\", \"C9BCE75:E333G40\", \"4B1:3E477FAB694\", \"::1\", \"127.0.0.1\", \"0::0\", \"2.5.20.1\", \"742D.FDC6155G92\", \".B92G7GF94F22BA\", \"5F0377492B:AGAF\", \"    127.0.0.0    \", \"D96CA4GB1:7D421\", \"127.0.0.0\", \"90GE6A4E:1DCAD4\", \"::E234:BE8G0724\", \":::4\", \"492DD.BC:FD1:BF\", \"0:0:0:0:0:0:0:0\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2F32CG2C6G0462F\", \"EBB4GB.C6C0F5E8\", \"127.0.0.1\", \"0:0::0:2\", \"FD87FAGCA1D5:84\", \"0:0::0:1\", \"C:15G39F5DDA6D3\", \"193A5F:G6644365\", \"7C703:F5645E70A\", \"49A10.2472D3.AF\", \".1ADF83DD81CC24\", \"23A52D1:9F29ED5\", \"E:23D0CE7FE7F4C\", \"BAA.3044FCGD8B1\", \"0.0.0.0\", \":::4\", \"38GDBA9GC6AF336\", \"2\", \"D2:0FC19E17:77A\", \"::/0\", \":..026BC09B5095\", \"E003G23138A2F41\", \".75EG5CG8D.G:D0\", \"4C9:CFC9AC:58D7\", \":::4\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0:0:0:0:0:0:0:0\", \":05E1BF2:CC3AE6\", \":95:G13496DDBG4\", \"4GEA.0AGG.49:AE\", \"A3CE3999:87C.44\", \"37.G527GFAC6D89\", \"DC3966D407448BB\", \"0:0:0:0:0:0:0:1\", \"04G0G0DFCEAC873\", \".2E8B7F70FBE8F6\", \"::1\", \"2.59.6.2\", \"::2\", \"DBB316D.CB2GC4:\", \"C2.7..9A3CABF2C\", \"127.0.0.0\", \"127.0.0.1\", \"3G803.ABE45E8EA\", \"960C840DDB299A8\", \"255.255.255.255\", \"300.0.0.0\", \"65E570D5E4334EG\", \"5141.0573A83ABB\", \"1::2::3\", \"6F54D54D6336G8D\", \"127.0.0.1\", \"255.255.255.255\", \"09128658819E5:C\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"2.5.6.2\", \"::1\", \"974AG510.G33G1.\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"1.7E93D:8A36A..\", \"::\", \"CA301:C48D8F88F\", \"8FGA3D:95FEC.97\", \"1::2::3\", \"0:0::0:1\", \"1::2::3\", \"5ED8CG6.E:F88.:\", \"2\", \"::/0\", \"2.5.20.1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"2.5.6.2\", \"2.5.20.1\", \"078BE71:1CA0B12\", \":A1:FF139G7F171\", \"0::0\", \"0:0:0:0:0:0:0:1\", \"0:0:0:0:0:0:0:0\", \"::2\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"A1D93F2F.G.F6.4\", \"::1\", \"0.0.0.1234\", \"    127.0.0.0    \", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"G8CBG2A0E8G960E\", \"127.0.0.0\", \"9AAGG2FEE1D1:35\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0:0:0:0:0:0:0:2\", \"::2\", \"0.0.0.1234\", \"1::2::3\", \"C9G318E1E8761..\", \"7F7:B:C9AF.76:9\", \"47F882E901FGC6C\", \"127.0.0.1\", \"300.0.0.0\", \"0:0::0:1\", \"2.5.20.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \":::4\", \"4D9FCEC3:GBAEGG\", \"127.0.0.0\", \"0:FCFB0B05E..1:\", \"127.0.0.1\", \"EB9D8G2CB9.466:\", \"7CA8D5C0:644CG4\", \"8:FC8AG01EF9DF3\", \".F817C:A1C.CD66\", \"192.168.0.1\", \"5G184C:BBAF04FA\", \":::4\", \"0::0\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::1\", \"B17A878D8DA:0:G\", \"FDC294B7A6675:5\", \"5G06614E0430DDG\", \"87FF8:5.G5BC146\", \"255.255.255.255\", \"51F.DDBF820A72A\", \"::\", \"::\", \"0:0:0:0:0:0:0:2\", \".G:0202AED0F308\", \":4E:0C593.06B35\", \"G14D840CB7.4CG.\", \":::4\", \"2.59.6.2\", \"7G:4A30:2D886EE\", \"::/0\", \"731467A1::E7.:8\", \"2.5.20.1\", \"0:0::0:1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"2733.0C75.F8F1F\", \"F066230.D366.::\", \"B3D93F.938B.B7F\", \"975E19C.F3123A4\", \"2.5.6.2\", \"A3C:CA..E03.A7B\", \"0:0:0:0:0:0:0:0\", \"0:0:0:0:0:0:0:2\", \"E89586843C80A16\", \"::\", \"300.0.0.0\", \"8D47CBGF7.26BED\", \"0.0.0.1234\", \"0:0:0:0:0:0:0:2\", \"0::0\", \"2.5.6.2\", \"192.168.0.1\", \"::2\", \"8FB7:AA.CC:6674\", \"255.255.255.255\", \"127.0.0.1\", \"5716D2F071:F477\", \"F156196:2E043FE\", \":::4\", \"65:3E6:2:57GEAC\", \"127.0.0.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"G786350309:A.35\", \"0376097.6F6695G\", \"1::2::3\", \"04543303A8F696D\", \"7B:.1184CDCG:5D\", \"255.255.255.255\", \"GCG:1::9CE086F5\", \"B36318:GABBGFA3\", \"F6A92B:8C:77264\", \"2GGD90G0D6B4:2C\", \"2.59.6.2\", \":B67:D10C:AC6AA\", \"127.0.0.1\", \"127.0.0.0\", \"0.0.0.1234\", \"1::2::3\", \"0:0:0:0:0:0:0:1\", \"0:0:0:0:0:0:0:1\", \"9GC.82DED5D60CD\", \"526BC976752CB07\", \"2:33G93EBDD919G\", \"2.5.20.1\", \"127.0.0.0\", \"2.59.6.2\", \":::4\", \"2.5.6.2\", \"0::0\", \"::\", \"2.5.20.1\", \"77:G8C3348470:C\", \"127.0.0.1\", \"BE1BD26B:3C6927\", \"F1EB54FB..CFG:F\", \"20CC062D06G71E2\", \":::4\", \"127.0.0.0\", \"BBA4840C17A4:63\", \"::/0\", \"2.59.6.2\", \".585338A8BC3797\", \"16:.82CGAAD:.:D\", \"2.5.6.2\", \"0:0::0:1\", \"D:G5AD6392.C5G7\", \"004G6F:979CC:92\", \"::\", \"..:87FA7010:4DG\", \"0::0\", \"GA1A8F.0EB041.1\", \"0:0:0:0:0:0:0:2\", \":::4\", \"CBFG45B.38DCF4G\", \"3G00D87:A3G1D19\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"::1\", \"03047EC117CFF63\", \"0:0::0:1\", \"    127.0.0.0    \", \"280C3D:GBDCGEC3\", \"F119E7BB6E849BF\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::\", \"2.59.6.2\", \"127.0.0.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"::\", \"9.DA5.29786:32D\", \"D6A:98BFGE6GE:8\", \"56540EA.88.GBA:\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"127.0.0.1\", \"127.0.0.1\", \"9B4:9B:15A4ADA7\", \"2.59.6.2\", \"0:0::0:2\", \"G5.E38D2.C7AE.2\", \"52E83:9:B582A69\", \":::4\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"::\", \"127916GB03G1C95\", \"41CG6FEFF6F217F\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \":325G1CCGA3C:.D\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"::/0\", \"73C:3B77D6DFC13\", \"AC62:8:963F665G\", \"44B1EC0CD04199E\", \"06:5C5420D.1DGB\", \"3.A3C7.D.FB17G7\", \"2\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"2BA0F.9A01BC56D\", \"4ABFC97574G2CF4\", \"0:0:0:0:0:0:0:1\", \"3B3A:AF293BC823\", \"2E.60E6CC48GB34\", \"B3:C:7F7.F75GEB\", \"2G:61.GFFE5EFA7\", \"1.615:3EG76BGE7\", \"1E2C54E9D67BD6D\", \"1.052B94F0747:4\", \"::2\", \"0.0.0.1234\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"51A55BCFGGD4308\", \"127.0.0.1\", \"127.0.0.0\", \"192.168.0.1\", \"127.0.0.0\", \".8EG33B266B7GE3\", \"1::2::3\", \"9FA55D.84A7.301\", \"ABC67:.BEA.6954\", \"C542A9FE:693.9F\", \"8FBF7C7:0244BE9\", \"1::2::3\", \"AGC8C0EA1F0AD38\", \"2.5.20.1\", \".3FA2D.BA:BG15E\", \"0.0.0.1234\", \"127.0.0.0\", \"2.5.20.1\", \"506..E79573:BBB\", \"0:0:0:0:0:0:0:1\", \"::\", \"G3B:BD.0.DF16G:\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"127.0.0.1\", \"2.5.6.2\", \"::\", \"300.0.0.0\", \"0:0:0:0:0:0:0:2\", \"6CF3198D0AE4FBF\", \":::4\", \"0.0.0.0\", \"2\", \"2.5.6.2\", \"0E.61A7:0D5BB2.\", \"3E1GF.F37A4EC2D\", \".2E948B7GB38:3D\", \":::4\", \"2E952066A.D329:\", \"9B09:3FDCG6G919\", \"255.255.255.255\", \"127.0.0.1\", \"8C1A163A31B6:6F\", \"G317.GF13FB70BB\", \"127.0.0.1\", \"088GD9.E42CE26A\", \"2\", \"0::0\", \"255.255.255.255\", \"F50AE8E2:.BBC7G\", \"0:0:0:0:0:0:0:1\", \"AG5E2B27EGC726A\", \"2.59.6.2\", \"127.2.3.4\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0.0.0.0\", \"4G967F75B8BG650\", \"4.5B7:558.9A54.\", \"2BC2BCA313FDB16\", \"3F0G7B:D88GC8A6\", \"2\", \"C56.5.AD:E5F4.C\", \"18CG.:AD27F3.B8\", \"F8198D5.5201C38\", \"0.0.0.1234\", \"7.FF:C:F.D847GE\", \"B8DA:B7C165C3.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"5FD:F9227E73347\", \"0.0.0.0\", \"300.0.0.0\", \"0:0::0:1\", \"2.5.20.1\", \"3F3:8G1FG60:CF2\", \"0:0:0:0:0:0:0:1\", \"192.168.0.1\", \"0:0:0:0:0:0:0:1\", \"::\", \"::1\", \"C211D.D14GDG:F:\", \"0:0:0:0:0:0:0:2\", \"127.2.3.4\", \"14194FBCABEEC1D\", \"::\", \"0:0::0:2\", \"6B01:68B17AECCD\", \"5ACD2B80.4871ED\", \"::1\", \"DD5DCDDCFGF3G:A\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0::0\", \"2.5.20.1\", \"0D.5A39G8.EF73E\", \"2\", \"2.5.20.1\", \"    127.0.0.0    \", \"B5..5G:F0C7G82G\", \"0:0:0:0:0:0:0:0\", \"0:0:0:0:0:0:0:1\", \"3:84C60691:GA:G\", \"0.0.0.1234\", \"5AC01482.:1308G\", \"127.0.0.1\", \"127.0.0.1\", \"3741E27DCA01GFE\", \"::\", \"::\", \"B37CFCB1AABEEBE\", \":97A020CE1418:E\", \"0:0:0:0:0:0:0:2\", \"0016.G67:1AF366\", \"127.0.0.0\", \"192.168.0.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \".280.FB52068GF8\", \"1::2::3\", \"0.0.0.1234\", \"300.0.0.0\", \"0.0.0.0\", \"65G5D32.4660D5:\", \"004:744G07CD8E0\", \"2.5.6.2\", \"751.6E2E8.DA:B3\", \"G:F04EG0:301947\", \"127.0.0.1\", \"127.0.0.1\", \":FF5644D0CA0:A8\", \"2.59.6.2\", \".5F27C:F6E9.205\", \"127.2.3.4\", \"7:555531639G1A6\", \"2.5.6.2\", \"2.5.6.2\", \"2\", \"91955G99CA:1508\", \"C02AE3FF:G.F.73\", \"7..3BGEBE8072D0\", \"B6G8:DGF.A2DGC5\", \"CA567577C77DB16\", \"D42.D19GG29A5B9\", \"0.0.0.1234\", \"0:0:0:0:0:0:0:1\", \"685B32C2:636.0D\", \"BF62B64E.A4375A\", \"0.0.0.0\", \"1G1227246BFA62:\", \"928G649ECA3DF8:\", \"192.168.0.1\", \"F0G1C7:CDFDFC44\", \"GB54:.FGCE807DE\", \"::\", \"255.255.255.255\", \"0:0:0:0:0:0:0:2\", \"943C9AEGB4BC7F8\", \":3F8152:7C7E65.\", \"818A.DB96E5152:\", \"2.59.6.2\", \"127.0.0.0\", \".E3:85DC948B1.:\", \"::/0\", \"0:0:0:0:0:0:0:2\", \"300.0.0.0\", \"3A2BD987C35F5C7\", \"::\", \"0.0.0.0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::\", \"2\", \"::2\", \"162EB.A28E6EC.7\", \":::4\", \"0:0:0:0:0:0:0:0\", \"::\", \"D6F.564B68C.84A\", \":6F023E4C159DB6\", \"458FF70:6F0GCD4\", \"G0BD:7G0BE.:00:\", \"D09G1C5AC3A87.6\", \"E4.C6635AAG3CBC\", \"::/0\", \"F9554AC:373B2B5\", \"82200FED2040CD:\", \"G4F2BG7:F6.7CD9\", \"D8C96.16G8DGB6B\", \"7EF.G:FFBE286F0\", \"F:72G2BC893.7.E\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"D761413G..643D2\", \"8G5:2AA0B9.EE04\", \"::2\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"2.5.20.1\", \"0:0::0:2\", \"215A7F15BFDB66B\", \"::\", \"2\", \"300.0.0.0\", \"0::0\", \"2D59GE8F418BF67\", \"127.2.3.4\", \":9GG6CDA032G.GC\", \"::2\", \"AA604F6FA:408C4\", \"127.0.0.1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"127.0.0.1\", \"5:F2B:10ED..F07\", \"255.255.255.255\", \"2.59.6.2\", \"GC3961G3:94A733\", \"::2\", \"8:7A3BF8C988.:G\", \".1DFB4.116567.G\", \"0.0.0.0\", \"0:0::0:1\", \"127.0.0.0\", \"    127.0.0.0    \", \"B5B0F06E062B23D\", \"1::2::3\", \"2\", \"    127.0.0.0    \", \"D185F36.:75F98F\", \":211DGE0CD1:G8F\", \"1C367170:FD65.E\", \"2:DEG.B69AD06.4\", \"0:0:0:0:0:0:0:0\", \"::1\", \"G49:4CAEB2B25F:\", \"    127.0.0.0    \", \"E45CE9G99CD41..\", \"2\", \"::/0\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"57GC5D2C63EBEB.\", \"2.59.6.2\", \"2.5.6.2\", \"    127.0.0.0    \", \"4AGD1.G297G0D5A\", \"::1\", \"    127.0.0.0    \", \"D:83C2G42143:80\", \".1606.4.557E.17\", \"255.255.255.255\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"5B3579EGD3:6GC:\", \"207FE1.354D.797\", \"2.59.6.2\", \"0::0\", \"57851C5C3B23.7.\", \"2.5.6.2\", \"2\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0:0:0:0:0:0:0:2\", \":::4\", \".C4:41A.:371.GB\", \"F83A.C19ABG..28\", \"680E::259BD:7G8\", \"FC7.3C3.DBG5A4E\", \"192.168.0.1\", \"    127.0.0.0    \", \"251746C7F3E422:\", \"2\", \"AG:9491:541F367\", \":::4\", \"37::F5:8AAE7D0:\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"E8F7BC4D4D492CA\", \"A9DC.FE08A0D574\", \"9D1308F.91A43A7\", \"300.0.0.0\", \"127.0.0.0\", \"192.168.0.1\", \"0381G6EGD0CA0B2\", \"::\", \"D91A9F8EB63236:\", \"417C0D7CAD.76.C\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"BE586GG30032BAA\", \"715A.BD0G83G086\", \"::2\", \"0:0::0:2\", \"3E9D32F:52G318G\", \":ABA:F4D45D48:E\", \":6676:05B:063AE\", \"G327604C45D9911\", \"AB.D853BE0766D5\", \"49:316176A1EF:3\", \"::\", \":::4\", \"CA6DE75268A2.8F\", \"0.0.0.0\", \"2.59.6.2\", \"C60GA:A1.F825B5\", \"2BBD.E7BB3C3711\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0:0:0:0:0:0:0:0\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"1122401GCF14A53\", \"::\", \"5B3ED1AD127A1F5\", \"255.255.255.255\", \"0:0::0:2\", \"F648GA88435EG7A\", \"156.46DF31:C23:\", \"255.255.255.255\", \"    127.0.0.0    \", \"2.59.6.2\", \"F43F13A62GC033B\", \"2\", \"GCE.1A9C2BD60::\", \"2.5.6.2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"    127.0.0.0    \", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"BG868C05C2AC2:1\", \"E2.GACE064A0822\", \"0.0.0.1234\", \"A75E1CAF02A8B:9\", \"3249375:22.:01D\", \"G981:G684CGCA95\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"::/0\", \"0939A354G7195FF\", \"BAB688BBCD7.5F7\", \"::\", \"0::0\", \"C6FC6G8.A1979F2\", \"::\", \"3F96FGCE5359.23\", \"2136C77F235A:73\", \"192.168.0.1\", \"2.5.20.1\", \"B1:9:29B0.60DA0\", \"0:0:0:0:0:0:0:2\", \"453D08A278D65.B\", \"900B380:C:33825\", \"8C71:B8.EA681E3\", \"70284F127CGD.F7\", \"A.266DC:73.0754\", \"2:9013C4B41D388\", \".D796B.71:.3:09\", \"5C06.5EDG::E27D\", \"84E3C::.D3FGGF5\", \".72B07589A617FD\", \"127.0.0.1\", \"637DE3C53.6::93\", \"0:0:0:0:0:0:0:1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::/0\", \"192.168.0.1\", \":G81EA252DCGBD2\", \"127.2.3.4\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"EB454GE912665DB\", \"0:0:0:0:0:0:0:0\", \"2.5.20.1\", \"7735D.C88G07EEG\", \"2.5G3EF9EAA05:7\", \"9..FB6G9CB9...C\", \"    127.0.0.0    \", \"1::2::3\", \".3C4FF5A78G.50G\", \"32BADGB:AAD1405\", \"127.0.0.0\", \"::/0\", \"::/0\", \"305B58:A9G7B56F\", \"11C42134AFB2906\", \"127.0.0.0\", \"::\", \"127.0.0.1\", \"9.A4.26:194BGF:\", \"5:2B8D2:BB7.3A:\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"2\", \"136768E6FD2..F4\", \"35007E856EF:52F\", \".9552C.G1B0CDB:\", \"9.3G4660528DCDB\", \"255.255.255.255\", \"0:0:0:0:0:0:0:0\", \"77.8B::42:FE::.\", \"0::0\", \"1E3.:33D732964G\", \"0:0::0:1\", \"B0.6BC1E:G0.0:0\", \"127.0.0.0\", \"DA3:.EBG239B1A3\", \"4D321166324F3D6\", \"127.2.3.4\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"CD444DC805AFF:5\", \"4.648D7FCG8G3C9\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"5169B64286G7D4E\", \"255.255.255.255\", \"7:D:E2G6.23AF31\", \"::\", \"127.2.3.4\", \"127.0.0.1\", \"0.0.0.1234\", \"0.0.0.0\", \"0:0::0:2\", \":0B593D:4B70684\", \"2.5.20.1\", \"A001E1B:530C9FB\", \"12G923EAF5B8246\", \"2.5.20.1\", \"2.59.6.2\", \"CG6FB6D80A86.19\", \".910.18AGD4F3:8\", \"2\", \"BG328281C9ACA8B\", \"2GB89592D7F05F7\", \"0::0\", \"E8BF2C:DFBC3970\", \"CD20E8C74G77ED8\", \"2.5.20.1\", \"B49B8DD13855C3.\", \"0:0:0:0:0:0:0:0\", \"::\", \":A91:55DD5D2G7A\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"1::2::3\", \"328DAF58.F44AF6\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0:0:0:0:0:0:0:0\", \"2.59.6.2\", \"24873G136196758\", \"37:545F0G05D:G9\", \"E70DC0DDD.91G9D\", \"2.5.6.2\", \"8E656BG2G562400\", \"FA:57350:5:7.G8\", \"76AD9BB572DF9FF\", \"77D599CC129:788\", \".G69E3A2:G072D0\", \"52858D1:5:5E6GC\", \"0:0::0:1\", \"192.168.0.1\", \"::\", \"C519A3A68BGC36A\", \"0:0:0:0:0:0:0:0\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0::0\", \"192.168.0.1\", \"1::2::3\", \"::/0\", \":FC310.62B5G0EE\", \"3G37G613GGF3G67\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"987.GAGABG06E.2\", \"::\", \"0:0:0:0:0:0:0:1\", \"1B6C3CA03921EF9\", \"D7:2:BEA467D9E2\", \"F3F3AB5009976E7\", \"    127.0.0.0    \", \"G01B0G8A4E6627C\", \"A06DC983F804931\", \"FD.C89.FC3:CG09\", \"CD905048GC41D34\", \"2.5.6.2\", \"F15G7E394A50CA9\", \"127.0.0.1\", \"63CFDA639CCE4D9\", \"127.0.0.0\", \"0:0::0:1\", \"192.168.0.1\", \"FGGF.FAG4D3135C\", \"3GGGB8DF187F6BA\", \"0:0:0:0:0:0:0:0\", \"127.2.3.4\", \"1::2::3\", \"D93FAGG000338E5\", \"2\", \"C:BEFD744F5EG17\", \"GG:F..B1111E7E1\", \"B.G6924496G91A4\", \"0.0.0.0\", \"B06GE07.D04DF2D\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"C:EG241D7F.9G73\", \"AD:.53A05DA5G38\", \"::2\", \"D.F.D535C5:7C1G\", \"55376AD4D52B17.\", \"BE277:.:613A6GG\", \"::.46D22786A98C\", \"255.255.255.255\", \"5F0831DE10CC062\", \"31FBCED2768:63E\", \"B44.164FCD2B1BC\", \"2.59.6.2\", \"B:G0.1:74C.:FG9\", \"2\", \"255.255.255.255\", \"0:0:0:0:0:0:0:1\", \"BF0A.6.441B2ADG\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"3:G2C9345BF807A\", \"2.73A62085E1G.8\", \"::\", \"8FD9488CE7DED5F\", \"330GA3A67G67734\", \"7.A1:4B7C7AEB28\", \":::4\", \"127.0.0.1\", \"127.0.0.1\", \"0:0:0:0:0:0:0:0\", \"::2\", \"4:36G05..4C78G.\", \"AG7.:E7EF.61F:G\", \"E538395A840G:C.\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"50G2B.2921307B3\", \".438BCB38C6B32:\", \"5FG6FGB45C6F:2F\", \"8437G2D4F854ACF\", \"2D61D9D403.:14A\", \"347439.88892860\", \":9.025B1F2E5379\", \"281A394184A:7:.\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2.5.6.2\", \"1::2::3\", \":E0.9.D2620DBD6\", \"0E8GFD.F6014FEC\", \"GD:.9F.3.310146\", \"995:5:7EG54AE0A\", \"::2\", \"CE81D6.5FGA2728\", \"0533D.1:3B73.EE\", \"127.2.3.4\", \"0.0.0.0\", \"378BE6CA6ECB8CD\", \"0:0:0:0:0:0:0:2\", \"::1\", \"127.0.0.1\", \"EGG92C.E9:A9AB3\", \"0:0::0:2\", \"::\", \"8FE14396DD4.95D\", \"2.5.6.2\", \"127.0.0.1\", \"3D4E1GF1G5AA9E9\", \"127.2.3.4\", \"52739ED0C.B.218\", \"0:0::0:2\", \"127.0.0.1\", \"20A774G2GDCCDAC\", \"D93BB22G7GB9:.7\", \"EGGE4D:ED3.3C:A\", \"2.7AB00G41GF5C2\", \":447DDBC1F2B6C:\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0:0::0:1\", \"6ECG0:7E5:7BD54\", \".6F6C69C2GDB:62\", \":::4\", \"GAF26B:45F4C1E3\", \"3G6G:B.9756013A\", \"4B6:778944E1B:4\", \"127.0.0.1\", \"1::2::3\", \"::/0\", \"1351BF9A9CCD033\", \"::\", \"2EB2F7AAGGA3FBD\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"F77D923:1B6E507\", \"91C921.8F5DE5.0\", \"92DA34F85C00032\", \"127.2.3.4\", \"D076:CAC03B.G1A\", \"94.B094802C3G2D\", \"E24D08FAC12A:6E\", \"192.168.0.1\", \"127.2.3.4\", \"0:0::0:1\", \":0D6247EF552.92\", \"02GAEGF370FFGFG\", \"8936G6CEGC9AF22\", \"9CG.197:0E498B2\", \"E:ECG972:2:26FD\", \"::\", \"09719B.D6DB0:A7\", \"0::0\", \"9AEFB5D5:358A8B\", \"::2\", \"1E137.4ED.GC4:0\", \".92:1AB:E741518\", \"1::2::3\", \"69GB:3.0F001.C3\", \"9C32D2ACCF76CA8\", \"0:0:0:0:0:0:0:2\", \"5:6A:3E8B508CF4\", \"G743GE80GB097A6\", \"0:0:0:0:0:0:0:2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0::0:1\", \"127.2.3.4\", \"1C:143B1310F300\", \":3D8696670F586.\", \"5F3666G:8:GF.0B\", \":::4\", \"    127.0.0.0    \", \"0:0::0:1\", \"::/0\", \"::2\", \"E7270DGD:A9870D\", \"127.0.0.1\", \"747F6:BCA34.45C\", \"C9786F0BFC:GE33\", \"D23GDF45C:6E391\", \"0233G69.CB25.8F\", \"8DD:CBG84CD:1.6\", \"FFDFE5E.92AGC02\", \"127.0.0.0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \":0E5AG85C839::9\", \"0.0.0.0\", \"::2\", \"CGA57CAA3C86658\", \"4314A65ADEA:G1G\", \"F22A:DD.8432FBC\", \"4831D:860G6355.\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"7E:GE0EA17:416:\", \"6FF4GA79AF6ED.4\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \":30:852F42.4:1F\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \".B300GGEC8ACDFD\", \"0:53B015FAF:BC:\", \"651EF935688F58F\", \"0:0:0:0:0:0:0:0\", \"2.59.6.2\", \"2.5.6.2\", \"457FF2A.88E.3E5\", \"92A7139033AED12\", \"41:06B:46B2090F\", \"GB202F1:.E86:15\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"56A3.D4F7BG8.B3\", \"127.0.0.0\", \"4F0G96:215C481E\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"1::2::3\", \":::4\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"G5FFDFCC4D::E80\", \"ED.74800E510643\", \"2D0.C236121CC67\", \":57DG69DDEBC5B.\", \"D6337C9.3FC9.56\", \"5D79DB415E4A.70\", \"0:0:0:0:0:0:0:2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"AC9:4B..E8CB.09\", \":::4\", \"7F235F6AFAAG25C\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0:0::0:2\", \"2.59.6.2\", \"F25E71D63EAGB8E\", \"GF:AG0C15G60G15\", \"0:0::0:2\", \"G206G82BF.493:D\", \"0::0\", \"::/0\", \"86DFADCD49A.1GG\", \"8F812022B50B6G1\", \"127.0.0.1\", \"0.0.0.1234\", \"1.CF0C94E8781B6\", \"389DF5F3.5F86G:\", \"::\", \"255.255.255.255\", \"8A7F3AF9576AC07\", \"8A:EDE:A9D309G8\", \"3FB43:EAE444.A5\", \"14B8.F518GB4695\", \"GE3B36A.72E:AG8\", \"9D::B146998GF04\", \"0:0::0:1\", \"AB10CEEG32E7A4C\", \"08E77CE5615:760\", \"::\", \".1:.G3E2D7D6C:D\", \"1D65G1F34D7F3CE\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"300.0.0.0\", \"5966:64F:7BB3D4\", \":::4\", \":88AB6647.1G545\", \"G..9F.DD439A760\", \"::\", \"127.0.0.0\", \"127.2.3.4\", \"3E.624.:6919445\", \"2.5.6.2\", \"8..42968CB39F60\", \"85G9EDF7ADCG517\", \"427.B175ABG3012\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"1::2::3\", \"962FAG0FE633GA3\", \"E0CAADGA87CDB4G\", \"35A4D30:2BA7:2A\", \".DGF:10:96G7856\", \"A834ED62C.AF.6.\", \"B1D6B2FD42E5B83\", \"127.0.0.1\", \"2226279C387267C\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"EAAG75G:9C2C101\", \"0:0::0:2\", \"FEGD4D52.6D0A31\", \"EA8A21GG29840.:\", \"AC574B3180:5DG6\", \"C769B3AA754576F\", \"B452E7DF6508F00\", \".5:EAAF3A.DDD39\", \"127.0.0.1\", \"2\", \"0.0.0.0\", \"8431B26DA093C07\", \"69G89922B185F2E\", \"0:0::0:2\", \"0.0.0.0\", \".5G4E7D3719:4.F\", \"2174.A51CF8GBF9\", \"8E8B1997557F.36\", \"7:5GG55A27DF394\", \"192.168.0.1\", \"127.0.0.0\", \"4FDC836:BCA39A:\", \"::2\", \"AFEA3A28:90F2E6\", \"127.0.0.1\", \"::\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0:0:0:0:0:0:0:1\", \"0:0:0:0:0:0:0:1\", \"2.D.:8FE3B46D24\", \"B141F47EA.A685E\", \"3D13AEAD21C94GC\", \"0:0:0:0:0:0:0:2\", \"127.0.0.0\", \"300.0.0.0\", \"::\", \"G3E3:2E5E:3.5D3\", \"EF8AE81A3G5G705\", \"0:0:0:0:0:0:0:2\", \"0.0.0.1234\", \"E530::DB38GFA:B\", \"0C6GF.8F941D.46\", \"0:0::0:1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::1\", \"::1\", \"::2\", \"1A75365D43328D1\", \"::\", \"0:0:0:0:0:0:0:2\", \"::1\", \"127.0.0.1\", \"192.168.0.1\", \":::4\", \"127.2.3.4\", \".8F00F61309:221\", \"D02D2C0GG07.138\", \"    127.0.0.0    \", \"2\", \"E116G76B4193F29\", \"::2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"::1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"127.0.0.1\", \"2\", \"::2\", \"0.0.0.0\", \"280G1.49FB477A5\", \"::1\", \"255.255.255.255\", \"5813E05GG178777\", \"F61:57B.ED4GFDB\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"3B9E1C0B5AA2CA5\", \"01F1287AAEE23CE\", \"2AAE30282C:D9C8\", \"103BFF3FE.4D1AE\", \"7401E7FG5BC3962\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \":08AGEE..29:..E\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"300.0.0.0\", \"78:0DBF98BGB4E0\", \"G::273D8GEFD2.4\", \"2\", \"127.0.0.1\", \"127.0.0.0\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"564D664G6G43270\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0:0::0:2\", \":8F2.CCA.BG752B\", \"::\", \"35B:GG.610CG1A8\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"FG2:3:.14394AAG\", \"3B:7B773.41:BE8\", \":7F710C357.CA40\", \"DBF8F6.B80F28EB\", \"0.0.0.1234\", \"::1\", \"74.57BD:39::D77\", \"0:0::0:2\", \"127.0.0.0\", \"127.0.0.0\", \"255.255.255.255\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"619BF47216BA:45\", \"821ABB3D36E37AC\", \"6:0G21:C.D41D83\", \"3E:8598.EC171F8\", \"2G65E..DE:8.336\", \"0:0:0:0:0:0:0:1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0.0.0.0\", \"EAD7B23D10F37G7\", \":::4\", \"B85FC7FEG23G883\", \"1BB41E0F9D799:0\", \"2.5.20.1\", \"4:CEBE74A1.8.99\", \"A4596032:E56GFA\", \"0:0::0:2\", \"0.0.0.0\", \"0::0\", \"36B36F0C:8G0CF6\", \"4AGBEA97F1.G99:\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"300.0.0.0\", \"AAFDG64G:7EC3.3\", \"2.5.6.2\", \"33.CG2B31F2E0E9\", \"4DB6.0E0D2A4B50\", \"G4A6:02908B2C86\", \":4FE:D355768BFB\", \"F69A4F357245155\", \"94ED5FA906B48.3\", \"255.255.255.255\", \"0:0::0:1\", \"0.0.0.1234\", \"2\", \"127.2.3.4\", \"EA96.3F:62..5EB\", \"6E2.4DBB41C594A\", \"B5B3GCD.1A14CA1\", \"192.168.0.1\", \"0.0.0.1234\", \"6DA1F1FC7.GDG4C\", \"06B55.03C.1A447\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"::\", \":FAD33B0DBG631F\", \"97::07A.DB4:FA:\", \"300.0.0.0\", \"B38882BFF964:08\", \":::4\", \"::2\", \"300.0.0.0\", \"1::2::3\", \"0:0:0:0:0:0:0:0\", \"FD.5G59335B34FA\", \"27.C96D07.7A946\", \"192.168.0.1\", \"68B4.01A.BBE08F\", \"010DB6G:42D73DE\", \"0:0:0:0:0:0:0:1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"DDDCBB4DDC8221F\", \"::1\", \":7E123536132500\", \"9ACF870.:7D1:D5\", \"0:0::0:1\", \"D7060B2G.::GB0B\", \"D77E1EBGAA.1D.6\", \"2\", \"255.255.255.255\", \"2574CA2DGDF7E5C\", \"2.5.20.1\", \"::\", \"::2\", \"91EF7C69B343.:.\", \"3D2950BD:2B90C0\", \"0:0::0:1\", \"B91A3D7GD.A1:D9\", \"    127.0.0.0    \", \"A106341D5::5G85\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::\", \"776DG6A:4E27451\", \"4FC1146CC7:9C4G\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"181D7.4E5C7GD.1\", \"D32A927E9:8B0C2\", \".40.C4G31.6D090\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"A819502.G7G342A\", \":::4\", \"0:0::0:2\", \"0:0:0:0:0:0:0:2\", \"8:15471FEG086:2\", \"2.5.20.1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"B2:GDG8C7945EG5\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \".97932GFB8GF.5C\", \"A3.G7GEE9B1E4DE\", \"127.0.0.0\", \"0.0.0.0\", \"AD8F6BCGCGC8FAD\", \"8:8D:5ACFGCA9D8\", \"::2\", \"59E53633CD5A71:\", \"::2\", \"7DDF02AG96C8.46\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0:0::0:1\", \"G53BCA2A:...2BD\", \"    127.0.0.0    \", \"300.0.0.0\", \"0::0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0::0\", \"8CDC:DD26AD8B9:\", \"ABBEBC2A6319E67\", \"300.0.0.0\", \"F76DF95:BG023F2\", \"G02FA687AC209:5\", \"9GC223GGD89001.\", \"212DA5GC8C7E9.2\", \"1::2::3\", \"6C.A7BBGC3FF595\", \"300.0.0.0\", \"2.5.6.2\", \"4:8C00EAB5CBD23\", \"0:0::0:2\", \"GAAE9DC:GA70036\", \"BG5.98508.9GFFG\", \"0:0::0:1\", \"GC.D.AC53E5G8.3\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"97.173B8:EGCDD9\", \"2.5.20.1\", \"0:0:0:0:0:0:0:2\", \"C4F:C:25248G.G7\", \"255.255.255.255\", \"::1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0.0.0.1234\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"::2\", \"DEBA56A2C6042D5\", \"37A5B.9CA.BD353\", \"8A91057E41G678D\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::1\", \"0:0::0:1\", \"0:0:0:0:0:0:0:1\", \"1GD7D10.7F8E5AE\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"192.168.0.1\", \"::\", \"2425G5D:DA041D5\", \".0E3327DA8E6:90\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"5F3G1A:4A2.G913\", \"ED65CBGEE37D49C\", \"127.0.0.0\", \":DG97B3GBB8G7D4\", \".:GD::27EE.18.E\", \"8208425F50.:7B9\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::\", \"    127.0.0.0    \", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"47F5:.11842.FA.\", \"0:0:0:0:0:0:0:0\", \"0.0.0.1234\", \"127.0.0.0\", \":GC60F32A84F.9F\", \"2.5.6.2\", \"2.5.6.2\", \"127.0.0.0\", \"0:0:0:0:0:0:0:1\", \".269G.:.7B60:1G\", \"0:0:0:0:0:0:0:2\", \"::\", \"127.0.0.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"F6.927735G6D304\", \"0B.9G4BEAE.10BB\", \"BBG14EBB10G1.4B\", \"0::0\", \"BAC3F:219B:.F72\", \"B67FC0A143C.300\", \"0:0::0:2\", \"::\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"856348FBBGGC5A.\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"3.3C24979GG9D79\", \"B1G5548FEEAC726\", \"EG2.F1.33.CG50G\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"300.0.0.0\", \"F1F567:G:222AD0\", \"0:0:0:0:0:0:0:0\", \"0:0::0:1\", \"0.0.0.1234\", \".47C9EC9.59:D45\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \":::4\", \"300.0.0.0\", \".GBBEDF1:013EE:\", \"0:0:0:0:0:0:0:0\", \"E85C72A38B29BGC\", \"192.168.0.1\", \"81467D8A1.2.4E7\", \"2.59.6.2\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"6CB9F703A0CE347\", \"84D2BF06FGF0186\", \"8A45DE:EBFED7GC\", \"FFFE1BBG9:GGD18\", \"127.0.0.0\", \"127.2.3.4\", \"0:0:0:0:0:0:0:1\", \"::2\", \"2.59.6.2\", \"::\", \"88F:B1G307F9B8D\", \"0:0:0:0:0:0:0:0\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"1D9E5G9B6A9.1B6\", \"5B5.6D5B4032G4:\", \"127.0.0.1\", \"C9276CG4AD24A23\", \"2\", \":::4\", \":G904F01F.0:29A\", \"F51B6D590G4AF2.\", \"2\", \"127.0.0.1\", \"ADBB8364B3A9A1C\", \":::4\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0:0:0:0:0:0:0:0\", \"0F76E768B5671B4\", \"2\", \"9603CA.D922.64C\", \"127.0.0.1\", \"2.59.6.2\", \"9E5AE2AE651D35B\", \"192.168.0.1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"474815344E5..DG\", \"8.14F6.61389AF3\", \"ECB.9.9BGE8A054\", \"11:DEGF7E7F.E16\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::\", \"477GF86FCF33CA4\", \"F7299FF5AGGG3:C\", \"CE7619EE12946.A\", \"127.0.0.1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \":659E0AEA52B191\", \"0:0:0:0:0:0:0:0\", \":72G13.09.61C15\", \"7CG:70B0.CD94:9\", \"0:0:0:0:0:0:0:0\", \":E91:DA5::89.:D\", \"0:0:0:0:0:0:0:2\", \"8.:2GF5D9DF1C4.\", \"F2208.2G437:GA9\", \"842.E4C5875.0C.\", \"AEGF:A9A1FEF36E\", \"EGGG.05G4DC6GC7\", \"F2DD26C28.E7C93\", \"127.2.3.4\", \"0::0\", \"GBDCFA8.C.E3915\", \"2.5.6.2\", \"00F::35BD:AG2:E\", \"357D90B:3969.57\", \"192.168.0.1\", \"F.0GA99CD1.156F\", \"91..9GAB7A81:99\", \"0.0.0.0\", \"973B:F1:DE:75BB\", \"E:9C0:21769CEBB\", \"277ECAAG0C22957\", \"FAAA:249FAB8BF3\", \"AE928FDFC.1GFG0\", \"95D5AEG0412BD0A\", \"C38A:94D748.36A\", \"3E5.B4G5AGA9F4C\", \"758A5:6F78E297G\", \"0D7DCDEB2D64787\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"67B35GFGDBC54.7\", \"0.0.0.0\", \"1266257:C.DCF37\", \"E22013DB4F5628G\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"CE7.DF.FB54.E47\", \"8D:GA0A643::E:7\", \"DA2282735C9235.\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"127.0.0.1\", \"127.0.0.1\", \"B0CFC:1490D165G\", \"2.5.20.1\", \"69.7B85G7A2AD9:\", \"0:0:0:0:0:0:0:0\", \"192.168.0.1\", \"0A43392E:598286\", \"1ED3E.F6A:.47DF\", \"::2\", \"127.0.0.1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"127.2.3.4\", \"45268F071690.8B\", \"77AE508FC10788E\", \"127.2.3.4\", \"127.0.0.0\", \"2.5.20.1\", \"A9CG51:C.E8.9.4\", \"76BA.63829G936D\", \".2C0A:EDB7G1628\", \"0.0.0.0\", \"3F.36C096.DA4.A\", \"81.A.50A3D37BFF\", \"28F490445:377EF\", \"127.2.3.4\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"::2\", \"6.A20:1736567BG\", \"1:526B9C99B8811\", \"67EF18.C9:A.33G\", \"A.1.1E74F.B300G\", \"1::2::3\", \"FDAE0DB3228E207\", \"2.5.20.1\", \"::\", \"1C12780:82C.381\", \"255.255.255.255\", \"127.0.0.1\", \"::/0\", \"::\", \"5:6A2:GDF4C4A51\", \"6::G53FC37E08A3\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"255.255.255.255\", \"0::0\", \"61A2F8D.8.B9AE:\", \"A32.39A9827D5D:\", \"2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"192.168.0.1\", \"A01.E2:896C1.C7\", \":0G45D8F8G6:D::\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"3:402AG2EGA5251\", \"DF4:422D89AA2G2\", \"2.59.6.2\", \"0:0::0:2\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0:0:0:0:0:0:0:1\", \"0:0::0:2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"192.168.0.1\", \"7FE1F:F3B3D8062\", \"G999A36:1B07850\", \"::1\", \"0:0::0:2\", \"8A6291FF501FCDD\", \"2\", \"383E3858199F5:B\", \"127.2.3.4\", \"0.0.0.0\", \"2.5.6.2\", \"G97B:4.:D7F6273\", \"0:0:0:0:0:0:0:0\", \"58G.:F9CG..8.31\", \"CAC4B33B:.1E64A\", \"8G1E.8F1CA56D54\", \"127.0.0.1\", \":28005E7F8G37EG\", \"1GC7BF.D0E87:4F\", \"0::0\", \"91.D3A2D41C2BGA\", \"2\", \"32:GA228C7FF3A:\", \":3D7E437F3F3628\", \"89F0313BAB91278\", \"127.0.0.1\", \"9.2G:B0786G5:51\", \"1907090:932C.13\", \"::\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"BG5DCBECD3:9AE7\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"D663G7690F37F9G\", \"127.0.0.1\", \"8AAEGC98B2E7646\", \"03F:FA9BB9351.6\", \"3C0:9D8G2954C:7\", \"127.0.0.1\", \"A2:CD1749D1D57.\", \"300.0.0.0\", \"0:0:0:0:0:0:0:0\", \"0EG1..D042:C861\", \"050D061C.1G39:0\", \"2\", \"9C0AGA39576014A\", \"127.0.0.1\", \"2D819F537B9D32.\", \"DC91.9137G7890F\", \"0.0.0.1234\", \"0.0.0.0\", \"::\", \"2.59.6.2\", \"8A73314AABAAB0D\", \"D0E36E2B92BBD.:\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"750:85GEAC666.G\", \"0FF1A93:945B.ED\", \"0:0:0:0:0:0:0:0\", \"C1A2CE30C42F:F6\", \"4BG6.1956.E1.A9\", \"CD5G107A4CC8B:3\", \"1::2::3\", \"7F3G4:1DAC10B37\", \"::/0\", \"19AB81C4125556D\", \"52CBE8C.87DAB:A\", \"B1G667284C746A5\", \"2\", \":E.A.A0F21D7651\", \"9204C.0FD3.18D9\", \"B4.4A0::500A5BE\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"127.2.3.4\", \"41G867B80:E2E96\", \"2.5.6.2\", \"0.0.0.1234\", \"127.2.3.4\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"DF353A284GA666B\", \"AE8B3C901A24D0A\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"9FFFC6D957E2:3F\", \"0:0:0:0:0:0:0:2\", \"2.5.6.2\", \"22913F2DG:81496\", \"D0AF77752DC9274\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"3.DDCC63E724C04\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0::0\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"39E3.A886FDD19B\", \":00FC250959E7E0\", \"5A4F4F5C4EB7F1E\", \"312.CGD0159CE60\", \"9EB:24996C76B9F\", \"0.0.0.1234\", \".EB:13G9C7615D5\", \"GA:2.94FFE5.A86\", \"300.0.0.0\", \"13B.GC00D4ACG03\", \"51G:GE0A886B50.\", \"CDB95G746EGD.67\", \"02.80G:0702098B\", \"0:0:0:0:0:0:0:0\", \"326DG.C90.6:474\", \"E2EBF:GA391164B\", \"0:0:0:0:0:0:0:2\", \"0.0.0.0\", \"127.0.0.1\", \"127.0.0.1\", \"0.0.0.1234\", \"A7C46591.B65F68\", \":::4\", \"G7:D0C67E89C4E4\", \":5E:738:E::F57:\", \"2.5.6.2\", \"    127.0.0.0    \", \"0.0.0.1234\", \"7959E:F6292C68B\", \"185F5G8E1C.662F\", \"5EGDF4240CGFE2C\", \"4EG::76D660EE:F\", \"127.0.0.1\", \"0.0.0.0\", \"0:0:0:0:0:0:0:2\", \"2.5.6.2\", \"127.0.0.1\", \"0.0.0.1234\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"8024DA:G:D63B5B\", \"0:0:0:0:0:0:0:0\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"D9E8GCD403:1.0E\", \"192.168.0.1\", \"2DAF04D1AB332.3\", \":::4\", \"2.5.20.1\", \"2\", \"66BA4.573636:6B\", \"192.168.0.1\", \".F4B5FD:8C51D59\", \"2.5.20.1\", \"5G0C08G:9E47398\", \"A7C.1D83171C1F1\", \"52860:5:BD6423A\", \"192.168.0.1\", \"4BCA8:DEEC79438\", \"B8E.40E2B78:F70\", \"::\", \"0:0:0:0:0:0:0:2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2.59.6.2\", \"FD9223D6E.0329B\", \"127.0.0.1\", \"C2GC:F:CFAD02DE\", \"A546GA80EDA85DF\", \"::\", \"0:0::0:2\", \":::4\", \"GA07AF512836G25\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"1::2::3\", \"::F39:65FADGFAB\", \":7598E6C.B2FBC3\", \"803E0.320D.0A:B\", \"353BCBF:0DB1F:7\", \"::1\", \"0:0:0:0:0:0:0:2\", \"2.5.6.2\", \":A6B7D4:07AB290\", \"15BF610E31719FD\", \"3:106BBDFD7G658\", \"::\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0::0\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::\", \"2\", \"A3EA10.E8866G5D\", \"192.168.0.1\", \"2E15585A3.EB58E\", \"ED967BE8B8CG77E\", \"::2\", \"07D12:198A36164\", \"2\", \"::\", \"C3:G76D9B77F7G8\", \"08.CB2:65:716B7\", \"192.168.0.1\", \"2.5.20.1\", \"2.5.20.1\", \"85332FA:53:8A91\", \"0:0:0:0:0:0:0:1\", \":2DD2DF1C068ECB\", \".1CE:A4EG4G950B\", \":D:7262C:0F.CB:\", \"CF035.EAD:4F93:\", \"192.168.0.1\", \"::/0\", \"4BF82E.A.C64:94\", \"192.168.0.1\", \"G:19:3:.77AC.FG\", \"2.5.6.2\", \"2G2DD555F9B26E3\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"C87F7135FB2DC.8\", \"0:0::0:2\", \"DAC3.21G894D.89\", \"5CF8E:.8A883:DC\", \"255.255.255.255\", \"::/0\", \"    127.0.0.0    \", \"G:505499482B632\", \":620G00G9D10D21\", \"4F54D:176E3890D\", \"0G.G71.7EGE7C65\", \"3G6166D4.746GF7\", \"F194.0B:6GD3:B3\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0.0.0.0\", \"::/0\", \"300.0.0.0\", \"48::0G2F14EBAF5\", \"A90E53.61541:B7\", \"E69AE0E.CAA53AF\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"4E492E4BAFDEA40\", \"0::0\", \"0.0.0.1234\", \"7444BEAE4G875D6\", \"::2\", \"255.255.255.255\", \"0.0.0.0\", \"C8B9819BFA5FD4B\", \".B0F4DC.8BF0FE9\", \"1::2::3\", \".A90G19DA:6DAGF\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"D467B6C7A4DB9B9\", \"2.59.6.2\", \".0A086A78:9FA5.\", \"127.2.3.4\", \"7A5D2F3108.GD81\", \"2.5.20.1\", \"25AC.D:3C5FFG19\", \"::1\", \"01369.1:79:9.B:\", \"0:0::0:2\", \":8.C9B8C.375G4F\", \"127.2.3.4\", \"A76CF1CG7:F1C11\", \"0:0:0:0:0:0:0:1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"::2\", \"127.0.0.1\", \"330FBC.364D5B7A\", \"AGE439F6D2C71FB\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0::0:1\", \":.0:D15A7287B.A\", \"::/0\", \"192.168.0.1\", \"::/0\", \"081BBGE:.BFE9..\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"127.0.0.1\", \"::\", \"017GA211.861355\", \"0:0:0:0:0:0:0:0\", \"91A6GE58C5827D0\", \"96E1AD8CAEB7F8B\", \"127.0.0.1\", \"EE8955:30D7FD85\", \"11.04A7.16FC00:\", \"0:0:0:0:0:0:0:1\", \"326DAE.EDE64F7C\", \"127.2.3.4\", \"2.5.6.2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"4AG8FBC1:F:473E\", \"2.59.6.2\", \"23G9BGEEB2E4886\", \"9BB:G23C050G5E.\", \"2.5.6.2\", \"2\", \":15E5AG38598E.E\", \"1::2::3\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::\", \"255.255.255.255\", \"7C:E50BB299C:9:\", \"0:0::0:1\", \"0:0::0:1\", \"3DDE6B9.922C4G:\", \"92E3DDB8AC8AD0C\", \"DAGB:E6B9G12580\", \".405::1289G:GD6\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"127.0.0.0\", \"0D5G3F5.42D60.3\", \"C638B:04F4E7CB8\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"    127.0.0.0    \", \"46997880.ABB882\", \"::2\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"20B888EB4.86G.G\", \"796244.CA213:D6\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0:0::0:1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"4299.FG885GA6::\", \"255.255.255.255\", \"7D22400728G:A4E\", \"7:9.G720.69E6D5\", \"532G87A7C4655.B\", \"01A:.B76B1C8355\", \"0:0:0:0:0:0:0:2\", \"::1\", \"F73F58G9GD0FG:9\", \"2.59.6.2\", \"300.0.0.0\", \"::1\", \"62E31A42C1B6:E5\", \"1C:CBBAC21879F8\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \".A.:F.2594C:D53\", \"0:0::0:2\", \"0:0:0:0:0:0:0:0\", \"0.0.0.0\", \"GDGECB59EC932D5\", \"2EA58A87824.EE2\", \"5DAG:AAB5.4BG6G\", \"127.0.0.1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0DBEEB6D.AB31.D\", \"2.59.6.2\", \":::4\", \"6FF8.53FF3E:.E6\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \".6569744:ED60CA\", \"D83086G43:628GB\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0::0\", \"192.168.0.1\", \"0.0.0.0\", \"127.0.0.0\", \"2.5.20.1\", \"2\", \"127.0.0.1\", \"1.2B364415180:3\", \"2.5.6.2\", \"21G.D293B7C516C\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"::\", \"::/0\", \"3A6D8.0163A:8BF\", \"735E534F8G7BGFE\", \".0AG:68E4GD42B1\", \"GB23.53FD76D:EG\", \"300.0.0.0\", \"::\", \"78C.1E1E16D2E1.\", \"60.69A1BE4C91.A\", \"CF1A4..C2A40369\", \"0:0::0:1\", \"AA56FEBF.754A7:\", \"::2\", \"50DC250BG:0759F\", \"0.0.0.0\", \"192.168.0.1\", \"A114C2D.F5DEGB1\", \"D5:4C2...F.GEGF\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"G1BG2GB4FG904C6\", \"49991B5D04GD485\", \"255.255.255.255\", \"192.168.0.1\", \"66F:29A4890A912\", \"F7.G:5:B3943786\", \"192.168.0.1\", \".91A705G6E556EF\", \"2CG7G593A5E680.\", \"GAB055:B0F5:D21\", \"8E.GDAA9DEE7626\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"127.0.0.1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"    127.0.0.0    \", \".:251:689.54FG:\", \"127.0.0.0\", \"::\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"3431:CBFFA..E4:\", \"0:0::0:2\", \"0.0.0.1234\", \"0:0:0:0:0:0:0:1\", \"0:0:0:0:0:0:0:0\", \"92C6C7G2A7EF6.B\", \"38ED77DCAB.0::2\", \"2.5.20.1\", \"95CF13A71B1F260\", \"FGD1A:4ADD0BE5C\", \"D62F1:85B89E83F\", \"DA0BB20D.12G4D6\", \"192.168.0.1\", \"0:0:0:0:0:0:0:0\", \"977199:09D32E54\", \".89453BD.77B8.7\", \"8:7F1B0:7892.40\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"127.0.0.1\", \"AC0:FB:.803E9DG\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"1437G8:GED::CG3\", \"5B.8EC:7CCA051:\", \"0C:1BA12EB04F95\", \"255.255.255.255\", \"2.5.20.1\", \"71.EC2G0D7G35DD\", \"05DBG73E79GB5CB\", \":::4\", \"127.0.0.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"4F1681AGG130B3E\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \":EC9ED5A5C.FGE4\", \"6DCCG68:A00.04F\", \"0:0::0:2\", \"2.59.6.2\", \"80676G.750A8.74\", \"0:0::0:1\", \"EB7900:B480666E\", \"0::0\", \"BEC88148C.75DG6\", \"GDC5G69EA2F:G33\", \"19322BGA8BE:E4D\", \"2.59.6.2\", \":F7ACCA530D9F13\", \"192.168.0.1\", \"G04DACG2323AE:7\", \"::\", \"0:0:0:0:0:0:0:2\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"1DE..3.C878828:\", \"302E2764A.2FAE:\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0.0.0.0\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"BF93E::1BGFADG4\", \"127.0.0.1\", \"DC075E.FDA6GGD9\", \"0:0:0:0:0:0:0:1\", \"127.0.0.0\", \".:64834CDDF76F7\", \"    127.0.0.0    \", \"F209153:3E8D9B4\", \"C0049EEDGA7D7GG\", \"::/0\", \"192.168.0.1\", \"E77:FF7E3:B57B4\", \"0:0::0:1\", \"553:1.567A3C94D\", \"0GGB.6:15BBC75E\", \"127.0.0.1\", \"::\", \"0::0\", \".3D5BGF363CDA77\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"7354766.C2A758B\", \"2\", \"73C5BF95:9440BD\", \"F.0DE83AFD56B04\", \"127.2.3.4\", \"EDFD:A:FE1.:1EF\", \"AG2C.49C4CG0.2F\", \"::/0\", \"::\", \"9A368E.3:FDA8GD\", \"::\", \"0::0\", \"0:0:0:0:0:0:0:2\", \"0:0::0:1\", \"0:0:0:0:0:0:0:2\", \"0::0\", \"3DE1FD934086G69\", \"6C8DB:B113.1C0B\", \"1.D0AE8A50F9626\", \"1::2::3\", \"0D.B18AFC2C23D7\", \":35:44BCD8EB:1:\", \"5ACF3.4540G:96F\", \"1::2::3\", \"    127.0.0.0    \", \"4.2880FE7E3.7C5\", \"A079C330FBG7ECA\", \"0:0::0:2\", \"E6:1FABA0749B5F\", \"::/0\", \"    127.0.0.0    \", \"127.2.3.4\", \"056822B3GD3300C\", \"127.0.0.1\", \"65:C5E:32C200EB\", \"062GED5EEG3GDC6\", \"DDEEGE0.CG0756E\", \"0.0.0.1234\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"EC83:406A3E7:82\", \"972E1E73DF:9G9F\", \"4DC72:.39:3.978\", \"0:0::0:2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"67F8E0C:4.B24CG\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"2GA:7A7:FGG..DE\", \"G1607G4A.8F2E06\", \"127.0.0.1\", \"0:0::0:1\", \"1F5192.07C4:57:\", \"192.168.0.1\", \"12E0E9AG6AGDCD9\", \"1::2::3\", \"487E9B6F2.9E874\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"1185B:G0E1A2447\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0::0\", \"BA.66C54912E:1D\", \"CC91CGB:40ED28G\", \"2FEA856E1GC.B61\", \"B.G71GF03:393::\", \"D.8A2:CCA430E8F\", \"3335EFD9DE9BBED\", \":3780167534D440\", \"CB23G1C062B5:55\", \"300.0.0.0\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2.5.6.2\", \"FADC.9990E0FB:F\", \":3BF5GAG::G715.\", \"0::0\", \"0.0.0.0\", \":BG5D747C.9B:22\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"3858FC9C0G774F5\", \"192.168.0.1\", \"132955CA084:75B\", \"ED0EG1CB9FD2D08\", \"5:1579E40F7AFEA\", \"D1G222714E9ED8:\", \"4DC3C0A008188:5\", \"EDCG4B35F0A3B5:\", \"0:0:0:0:0:0:0:1\", \"0:0:0:0:0:0:0:0\", \"93026EFG9E5A738\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"::2\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::\", \"192.168.0.1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"::\", \"0B376B1385:GEC1\", \"127.2.3.4\", \"0:0::0:2\", \"5514C608EF3CBC1\", \"2\", \"C3DA03CC8D3E:4E\", \"49BDF6A1F.87E18\", \"CFBGFEDE4:198G.\", \"9AFAD51D47C80F5\", \"300.0.0.0\", \"0:0:0:0:0:0:0:1\", \"831:86112307GG1\", \"127.2.3.4\", \"9CG02E68E87G12E\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"734GB15CGD83009\", \"31C76G61:B4F86G\", \"530G1FF7G...9F3\", \"F94EF58D8FA99EF\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"CFB98975F3CFG4E\", \"0:0::0:1\", \"127.0.0.0\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::\", \"5DE745B6A7E.D0E\", \"A27CE353D0D0CFG\", \"C6AE25B97EBB022\", \":98D2A8820D8590\", \"0:0:0:0:0:0:0:1\", \"EBD2:2F067042D2\", \"255.255.255.255\", \"G.3BGDD6A6C3.DG\", \"2.5.20.1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"127.0.0.1\", \"C91G3:B36.FAC8G\", \"::\", \"E5A6B8F:BC8D7G8\", \"A::ECCE652FDC39\", \":0:804844:8GBD0\", \"D143..ABCDG4.67\", \"::/0\", \"D:D4702FE52AG:7\", \"1::2::3\", \":.5C0A64:68DF66\", \"1C.F9B1A4172AA8\", \"127.2.3.4\", \"DB7.AC3:8650D6E\", \"300.0.0.0\", \"2\", \"B82CGC6.:.59F8:\", \"::2\", \"74475A78E.5..0F\", \"    127.0.0.0    \", \":61A1B.A506CG8E\", \"300.0.0.0\", \"1CG1821A2ECDA9A\", \"0:0:0:0:0:0:0:0\", \":.F61:FD1A89E3:\", \"2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"F7416D617A:5:CA\", \"::/0\", \"127.2.3.4\", \".3AAG3DD53DGDCC\", \"34C4C99A:088D.F\", \"127.0.0.1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"6F2E2C0.A3D15G.\", \"0::0\", \"::1\", \"0::0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"FC48BE..F769.82\", \"A7.F7:0184:2993\", \".69E1E74.1528DE\", \"0:0:0:0:0:0:0:2\", \"CCC3994C2G0B3.9\", \"0E:9:402.50DFD.\", \"127.0.0.1\", \"0:0:0:0:0:0:0:2\", \"127.2.3.4\", \".8::23:BG4BB853\", \"    127.0.0.0    \", \"2.5.20.1\", \"2.5.6.2\", \"F1CG95G0656881F\", \"GF3G6C24A4899D7\", \"127.0.0.0\", \"::/0\", \"02E44EC4C:40D94\", \"33A0316384AEFGE\", \"    127.0.0.0    \", \":::4\", \"41D4.A69G.8FBG1\", \"C91F550.D67AF96\", \"::1\", \"0.0.0.0\", \"9GC3AG:4CF0910G\", \"1.0A11GE8D95E84\", \"0:0:0:0:0:0:0:2\", \"6C.273G2977BGB1\", \"127.0.0.0\", \":AFA:77CG0462FG\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"9C23F50346BA3G4\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"06CF8A.770CG45:\", \"::2\", \"::1\", \"1::2::3\", \"C:GB82BGB1:57B4\", \"0BE0:51545AE41A\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"5.GA6DA15F2C5G2\", \"0::0\", \"C55C6914:25E2:A\", \".DD7B7GB43.CCBD\", \"C6CF2C.4:468A78\", \"0G15AC8.6BA87CD\", \"3C48G6.GEC0.7DF\", \"777D4:77B31CB13\", \"F21F1969G:D4BGB\", \".E818G7C8.AE1.2\", \"B7BBAF01G321FDF\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::2\", \"3GE:GEA5171C::D\", \"11:F158:G1GA47A\", \"D60BFE5:DE5A49A\", \"CEF3EC305:CB043\", \"04:.5G8FD971029\", \".CA81B809063E8:\", \"CA20C2G3B37272A\", \"127.0.0.1\", \"62BG.6G9D9D0E01\", \"3F81G77:C651C4.\", \"8:778CDBGC33.GF\", \"074A620593G:.EB\", \"0:0::0:2\", \"3:871G1.A99D6::\", \"2F63G6FCB:CC83C\", \"0:0:0:0:0:0:0:2\", \"0:0::0:1\", \"CD0FAD.3CGB0580\", \"127.2.3.4\", \"322EC453E8E53C0\", \"7ABD3AA24FE82F2\", \".FCD3G578.321.4\", \"1::2::3\", \"A2:F0DG:GAB6GA6\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"127.0.0.0\", \"0:0:0:0:0:0:0:0\", \"::\", \"A0FB9A2:7.E35D7\", \"D98:AF4GCD8.DA5\", \"8436098B93BGF5G\", \"5.E6A66C:.C7A.A\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"192.168.0.1\", \"301274AF302DB33\", \"127.0.0.0\", \"9057G7G70ABAD.E\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"7D.7:2F.G2:8410\", \"127.0.0.1\", \"9E6F3907F3GBBG1\", \"902A98:8DG090EG\", \"0:0::0:1\", \"2.5.20.1\", \"2822C561.CFD090\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"2.59.6.2\", \"1512AF6672570E5\", \"39C4910457G7C24\", \"98:GCCC6EG9005:\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"77144G3:G.85G3D\", \"0::0\", \"D921B05.D.ABB6E\", \"B4.B824486003CF\", \"7A3:164GGC83.8A\", \".7A9598G:676CA0\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"5:873:40:701G15\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"1.52:7F5143E6E7\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"7CD5A51043G6286\", \"385F3B13.4G:672\", \"394DB9FAECD50EF\", \"::\", \"0.0.0.1234\", \"0.0.0.1234\", \"91D742.C0CDB:0C\", \"192.168.0.1\", \"0:0:0:0:0:0:0:2\", \"192.168.0.1\", \"1::2::3\", \"300.0.0.0\", \"3EB168AE4.7GB2A\", \"2.5.20.1\", \"127.0.0.1\", \"192.168.0.1\", \"300.0.0.0\", \"2\", \":7G9D.8673721DE\", \"6C0.16:15G:6F5.\", \"0:0:0:0:0:0:0:2\", \"87F8102:46:0491\", \"0.0.0.0\", \"1::2::3\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0E6C46B..773F99\", \"1::2::3\", \"293AFCG:12BDB77\", \"0:0:0:0:0:0:0:2\", \"FA044BD26A74BC1\", \"GBDA5558BBB1.F5\", \"0::0\", \"2.59.6.2\", \"0:0:0:0:0:0:0:1\", \"G5EE:.C:02C.:65\", \"2.5.20.1\", \"1B311GFE68590.8\", \"0:0:0:0:0:0:0:1\", \"0.0.0.1234\", \"::.78GB020E3B5G\", \"0D7AA4AD5A28.G8\", \":::4\", \":.F.9:281E734:.\", \"4E782BE:1C5843C\", \"49FG.56C7FDGC62\", \"BC2.DAE47291A07\", \"C9CG2DD.F71705C\", \"    127.0.0.0    \", \"EDBEGAF:9568.50\", \"73GG787:5G4D2A4\", \"0:0::0:1\", \"127.0.0.1\", \"::1\", \"2\", \"GA71D033D678:B4\", \"2.5.6.2\", \":610B:34058B248\", \"1::2::3\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"6D1059F81D5D54F\", \"5:3:.3.8BB.4DCG\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::\", \"0:0:0:0:0:0:0:2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"08::G66C2988EC9\", \"1::2::3\", \"B.B932618DB4F77\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"127.0.0.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"D23A774:E3AD.98\", \"B:598AE5723G01G\", \"03E:6F75F070B3:\", \"8.A:E3G348C88F8\", \"127.0.0.0\", \"DEED8CE3G4F60D8\", \"0:0::0:2\", \":D3D4B9A66A215:\", \"127.0.0.0\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"127.0.0.1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0:0:0:0:0:0:0:1\", \"E01G33:983DA49E\", \"G9:GC:E79G:60E0\", \"0:0::0:1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"300.0.0.0\", \"2\", \"6:C2A98G17D6:7E\", \"2\", \"81.8323FGF5.39:\", \"2\", \"F19D7EBA7CACF8F\", \"0:0::0:2\", \".BB0B4F75:0726F\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"127.2.3.4\", \"5E03655G6BG94B.\", \"    127.0.0.0    \", \"E976C6EFGA9A0.3\", \"127.0.0.0\", \"127.0.0.1\", \"BG637E3F6B3C.:3\", \"::\", \"2\", \":5.27C10DG7A:E.\", \"9GAA3D:F5597C0:\", \"0.0.0.1234\", \":A5.BBCAD32F8E:\", \"D3E19G7.282A5EC\", \"25E0:30A8994.G9\", \"222:EG2C2D87790\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"8106DBAEG6.G34G\", \"2.5.6.2\", \"9436CDF79F2E:7.\", \"B62B:8A5D699489\", \"G5B142FDD382:3.\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"255.255.255.255\", \"B9F76CACCC0:.A4\", \"E79:9DA96D.0E5F\", \"2.59.6.2\", \"255.255.255.255\", \"2BB2:74:E3AE8D9\", \":54FCA5.A66FB45\", \"432.6CF::651BEF\", \"::2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"4914F25.CA05B07\", \"    127.0.0.0    \", \"A4312:7G57B0.2.\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"ADD2G4C6C6106:A\", \"16A2B16:77DF:46\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \".2.5A20G42A9A1A\", \"C65665A75F8GG70\", \"4F9DBGGF1.G55A1\", \"2.5.20.1\", \"FA.555E623EC619\", \"9E740G89ADC5DA8\", \"D678A9G5:0.8469\", \"20F:10A:5B0:CEB\", \":::4\", \"7C3EBC697:93C31\", \"A7.:A549:79FE65\", \"::\", \"3443DD3CBCFG5CC\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"AED6G:23:1051GD\", \"0.0.0.1234\", \"99EBF:9FB77CCC1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"127.0.0.1\", \"D12G:B1A3.0G0AD\", \"    127.0.0.0    \", \"7CBB09:B2.CECD8\", \"0A0FDCCC.3G2E3B\", \"2.5.6.2\", \"CD4248A4:4FF5G5\", \"0.0.0.1234\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"9CD:6G176FE8:68\", \"0.0.0.1234\", \"1:2A70BDE.1G28F\", \"::1\", \"EEBBE7BG336BD0D\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"5:1C36E35FE5.F:\", \"GDF126B7FF3FCGG\", \"B9:98E1D9C0F:61\", \":D96909G9203AD1\", \"127.0.0.0\", \"B521.A51B:CABDB\", \":::4\", \"0:0:0:0:0:0:0:1\", \"::\", \"0::0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"DB6B95.803582E9\", \"::\", \"8D6AF3C9E7DDC4D\", \"1E17.064:703825\", \"1CB07GFF3F1F0DG\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \":::4\", \"255.255.255.255\", \"2\", \"1::2::3\", \"CAC4E31F8.39:B6\", \"255.255.255.255\", \"8E0D2G081F762:.\", \".0E71398E237C:D\", \":5BG28ECC5EEA7G\", \"4651:4A222E91DE\", \".GC48899.41BF:D\", \"1::2::3\", \"0::0\", \"0::0\", \"0:0::0:1\", \"AC44G78068C4A:3\", \"2\", \"::\", \"0:0:0:0:0:0:0:2\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"127.0.0.1\", \"6280FC1:ACAFD5C\", \"300.0.0.0\", \"BD889G:37678:51\", \"127.0.0.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"FD9.CB5AC0.BA0C\", \"745..FE4C55CE6C\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"65EEBAF626955:E\", \"6B7:77E2BA8C147\", \"2.59.6.2\", \"1D6F076661F5E7:\", \"::\", \":::4\", \"33DFG:G8GEG2.05\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \":::4\", \"    127.0.0.0    \", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"B867D45B702G:C7\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"7FC.9003D2758:6\", \"1::2::3\", \"2.5.20.1\", \"0::0\", \"D34.2BGGBAF8191\", \"127.2.3.4\", \"4D2..52331FBC20\", \"0:0:0:0:0:0:0:0\", \"E1425.:EE4B47:1\", \"8827:EGFFF:DEC8\", \"3F8G6737BG62A7.\", \"300.0.0.0\", \"1EC2DG76F67C7A2\", \"0:0:0:0:0:0:0:2\", \"966C651C90E7EA1\", \"3DE.2741A257G46\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"BA2.:184162D1DA\", \"127.0.0.1\", \"2.59.6.2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"9F248F3517.126G\", \"::/0\", \"426G188465.A5D3\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::\", \"0.0.0.0\", \"9G33A9B98A6E.B:\", \"0.0.0.0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2.59.6.2\", \"F1CF094FGE2BDGG\", \"0:0:0:0:0:0:0:2\", \"77AC:4DGBF9896.\", \"798CF03286E.6.4\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"127.0.0.1\", \"2\", \"1FB4GA32:99705D\", \"0.0.0.0\", \"7A.D945CBBEDG36\", \"127.0.0.0\", \"127.0.0.1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0.EDBDDA.04C8.5\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"::1\", \"0:0:0:0:0:0:0:0\", \".GFG79C2260AGE6\", \"GACF.D4789ABC5.\", \"709.B6D98B1.BA8\", \"::GC2:7E3386G1D\", \"127.0.0.0\", \"A.DFG82444E673:\", \"0.0.0.1234\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2\", \"::\", \"18D:F5BC7GFB76E\", \"10G1C344.6465G.\", \"127.0.0.1\", \"783E:A:2DD8.FDD\", \"F8B4886C2D4D375\", \"0E45A56AB3B694D\", \"E041GE5BACC9C9.\", \"5627A2.2336ACCD\", \"48G6G2F23C3B2AG\", \"FC2C69A82CGF687\", \":::4\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"255.255.255.255\", \"5D.2.GC6AGD6625\", \"ADDBFECG9659.6G\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"300.0.0.0\", \"7G863C29F741581\", \":8:4313653D3437\", \".4491B5861416AD\", \"GC0DA591FF73732\", \"F3B86G8:78C8387\", \"2.59.6.2\", \"B9AE2433C9FB000\", \"::\", \"82GD:0FCG131306\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0.0.0.1234\", \"2.5.6.2\", \"CF3:D42CB19.F54\", \"F3.CE6CGABAC41D\", \"7904ECD51C8B168\", \"D259B2.E:11B:EA\", \"0:0::0:1\", \"2:A029F3DG43.BC\", \"240B6AF5073D18B\", \"2\", \"EE4GGB0CAGG78CD\", \"    127.0.0.0    \", \"625G9143GD65DE2\", \"2.59.6.2\", \":D:D.4652BF0.7B\", \"593GB618:E9063A\", \"1::2::3\", \"7BF62D0D7G::BGE\", \"GA5285C688E.D5.\", \"255.255.255.255\", \"130A1:.7.8761.9\", \"127.2.3.4\", \"0::0\", \"2.59.6.2\", \"::/0\", \"127.2.3.4\", \"::2\", \"76:3AFCCG64DG09\", \"0:0:0:0:0:0:0:1\", \"0:0:0:0:0:0:0:0\", \"0:0::0:2\", \".0AGE52427737.E\", \"GBCD80.09CF8A00\", \"31DA478212B:46D\", \"CF.9BE5CG95:DE8\", \"2F:5:E2681DB0B6\", \"9E814B::6810868\", \"2.5.20.1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"DF9B93537B23A.F\", \"2.59.6.2\", \":::4\", \"B40AGB88:4809D8\", \"CB76D27290C5.28\", \"127.2.3.4\", \"2.59.6.2\", \"0:0::0:1\", \"0:0::0:1\", \"AF.15FC499584C:\", \"AC:7.35ED7.D487\", \"::04FA947:9:9AF\", \"127.0.0.1\", \":B67GD0017C69B:\", \"7E.:5A3.88388G2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"3.4B.2.EC0G8788\", \"    127.0.0.0    \", \"F2EFB27CE638GC:\", \"D6G3B26C8A7BD1D\", \"0:0:0:0:0:0:0:2\", \"8D9930E1C978.39\", \"3FA61920GC014FG\", \"EG35DGEB167BE6C\", \"G.B2B44D6.9109D\", \"300.0.0.0\", \"1FD4282F27CBG1A\", \":93FGED0C76B:FC\", \"127.0.0.0\", \"0:0::0:2\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"127.2.3.4\", \"0:0::0:2\", \":CF607BG6DC10.E\", \"0:0:0:0:0:0:0:2\", \"0:0:0:0:0:0:0:0\", \"192.168.0.1\", \"5EC58EE264F4067\", \":A.6234F753D28C\", \"70D85GE12C3.0B1\", \"036907A.6552G85\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"1::2::3\", \":A185D992GC:938\", \"0.0.0.1234\", \"755:DG0C34CBABC\", \"3393A.777B93BDB\", \"4.4DB78355G8C58\", \".1GA5:B0B8619A7\", \"::\", \"2.5.20.1\", \":F.B12.52FGCD82\", \"373.2A.67FCG30D\", \"255.255.255.255\", \"127.0.0.0\", \"G25::43776DDE5G\", \"C:EGA967EE8.67A\", \"::1\", \"192.168.0.1\", \".5E.DAC7.6GAD75\", \"127.0.0.1\", \"2B96:5E694EE8EA\", \"127.0.0.1\", \"0:0:0:0:0:0:0:1\", \"127.0.0.0\", \".1:FBB1A0GCCED3\", \"    127.0.0.0    \", \"GBE6F03:3400D:1\", \"82.2BC46ABGAA.8\", \"9E.:E7FFC:D:F1F\", \"20F67G:232171B8\", \"9C14G2C18:9GA9E\", \"F8GG00F015AA538\", \"EG193076.F7.DDB\", \"E91:9465D8B04F5\", \".088C248DB4FB.6\", \"192.168.0.1\", \"192.168.0.1\", \"0:0::0:1\", \"0:0:0:0:0:0:0:0\", \"::\", \"1221A58:F5AAECB\", \"::2\", \"0:0::0:2\", \"E.A0D75DC107C38\", \"66D0CGBC47358EG\", \"0:0:0:0:0:0:0:2\", \"33003G371.D.E94\", \":A4.2D4C1GGB965\", \"2.5.20.1\", \"C464CE1G4BAD3:5\", \"E.4F:0.6:F::A:D\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2.5.6.2\", \"192.168.0.1\", \"BAG15641659E64E\", \"192.168.0.1\", \"FC4.145463E:9F.\", \"::\", \"D93713FB42681:A\", \"EB825E88AB.G264\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"950EDF5:E:D.ABG\", \"23.76G2BA6B2G34\", \"::\", \"8G78.19123:95C:\", \"CE9FD6F9FBFA395\", \"D2818:FFBBB6D09\", \"2\", \"0:0::0:1\", \"CACDAG6B2099B5.\", \"127.2.3.4\", \"::\", \"8G9C8555502:413\", \"633EAEGD:7BAF72\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0:0:0:0:0:0:0:1\", \".EC40334A76:.1F\", \"2\", \"::2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"127.0.0.1\", \".E65C2F.GA2BD50\", \"9G72FD:8.6AGE8.\", \":99DCA2894634D2\", \"A.768E.DE28A688\", \"0:0:0:0:0:0:0:1\", \"2\", \"0::0\", \"G58.4G.8.B27:37\", \"4BB3C242.05D6E6\", \"ED93EB..5C9.A1G\", \"F8AD14C20BE4516\", \"::/0\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"127.0.0.1\", \"0:0:0:0:0:0:0:2\", \"0:0:0:0:0:0:0:0\", \"0::0\", \"EFAC71CG4238C5F\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0.0.0.0\", \"::1\", \"255.255.255.255\", \"0:0::0:1\", \"9855E88G.233A3:\", \"300.0.0.0\", \"BE295193EE2BG4:\", \"22E0B66A85B6:BA\", \"192.168.0.1\", \"0:0::0:2\", \"EG20:F0EE38:0F8\", \"E.5419G329G590.\", \"E05.8B:GD:00E96\", \"0:0:0:0:0:0:0:1\", \"    127.0.0.0    \", \"E31CDC4000B72AF\", \"4617CC4BC340916\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"8D:G7.DED:2G3FD\", \"192.168.0.1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"5E260G06475858B\", \"32AA39079241FF8\", \"A56D7D.17F18C9:\", \"AFBB2187AF41C2B\", \"127.2.3.4\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"350A88:43.902:B\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"1::2::3\", \"0.0.0.0\", \"1::2::3\", \"1515.A7CE2.50E4\", \"1::2::3\", \"A8872:GG8840.A1\", \"83G5BG61C4E683D\", \"4FB274.G2D4G198\", \"::1\", \"6::E0E572753AE8\", \"188EE4997CE00A4\", \"0.0.0.1234\", \"A6E8D.450652.D.\", \"1.BA26G8F8F:35F\", \"127.2.3.4\", \":::4\", \"0:0::0:1\", \"0:0:0:0:0:0:0:1\", \"0:0:0:0:0:0:0:2\", \"DFF77F3C739264E\", \"E45D66G::8:02.4\", \"A0B.64B2CF59GFG\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0.0.0.0\", \"6A97D3EG8G1637E\", \"0:0::0:2\", \"127.2.3.4\", \"::\", \"300.0.0.0\", \"2.59.6.2\", \"192.168.0.1\", \"F.22:A74GDFD57D\", \":9.7FFA8ED.6C8F\", \"2\", \"2\", \"04CD35B0G3AB6.2\", \"0:0:0:0:0:0:0:0\", \":5G:D4202C.5978\", \"B7F.3E9A2E:08::\", \"5E34C619.D16DAF\", \"2.5.6.2\", \"300.0.0.0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"5.G57G6532A8::2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"33A9C802B149D0:\", \"CC780G767G:91D.\", \"8081:5G:G32E78A\", \"::/0\", \"2.59.6.2\", \"20G57BAED5CBCB3\", \"    127.0.0.0    \", \"GC5003DE:660FE2\", \":1A61BBA1CAGB55\", \":::4\", \"0:0::0:2\", \"192.168.0.1\", \"F881F.73F99:A6E\", \"0:0::0:1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"42D5EB49.:265G0\", \"F5CE.035:778.1C\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"B5.02:0FF65:D96\", \"::/0\", \"9.CA59D0A.C53B1\", \"9.F76:99B26B5.5\", \"127.0.0.1\", \"40D:8.24E7340AF\", \"571B84G4F:DB54F\", \"0:0:0:0:0:0:0:1\", \"A2CA5.950B21GG8\", \"255.255.255.255\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"EADB045C4GB0909\", \"7.62392F0:1C1E0\", \"E.E962C87633813\", \"74843144G2GG989\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"EA6.A0D4C418452\", \"38:203CB3DF5..B\", \".0497B1CDBD79:G\", \"D6GD.50:4:3BCG5\", \"57A5B6E91::AE26\", \"300.0.0.0\", \":6G843F29C18C50\", \":7DA1EEDC313621\", \"    127.0.0.0    \", \"255.255.255.255\", \"2.59.6.2\", \"E73019A557E0:B5\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0.0.0.0\", \"6E.:B4CD8A05E43\", \"2.5.6.2\", \":2F:C12AC203:5:\", \"..BC7A1B7F978:D\", \"3G0.8.4F4C9DF:G\", \"GEAFA50BB7:.2GB\", \"1::2::3\", \"2.59.6.2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"5BEA469F.41D662\", \"B3CBD0CEDB62802\", \"D3884DG5.CEB44C\", \"1::2::3\", \"::\", \"::2\", \"127.0.0.1\", \"D0075BCG6.D:6EC\", \"0:0::0:1\", \"GB07C.G49E79F93\", \"192.168.0.1\", \"EEE6.1E25187009\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"DE28.G05DD97D85\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"G58G3B77AF92A6C\", \"::2\", \"CA.GF.75DDBB4A3\", \"4D0CEBE191ACGDE\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"199C1B.11DDD4D7\", \"::\", \"BB.DEF8..0:2:F3\", \"BD.FF:ED69AG8:8\", \"B2C:EF03843711.\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0:0:0:0:0:0:0:0\", \"C853BE2G980736B\", \"127.0.0.1\", \"8BDE328D243C34.\", \"0:0::0:2\", \"2.5.20.1\", \"0.0.0.0\", \"0:0::0:1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"127.2.3.4\", \":FCA2670.0CD.9F\", \"300.0.0.0\", \"252EBEFC4BD7.91\", \"::/0\", \"02DFEG24.8909CB\", \"::2\", \"2.59.6.2\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"139665EA655367F\", \"0.0.0.0\", \"    127.0.0.0    \", \"::/0\", \"B:E9EGD9CA.234B\", \"C:5EF9D679FGE97\", \"255.255.255.255\", \"9.C73G1A:4A4620\", \"127.0.0.1\", \"255.255.255.255\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"300.0.0.0\", \"G:E33F88.574:.4\", \"5EDD5DEDD56F:GE\", \".13GC2A39885C8G\", \"0.0.0.0\", \"127.0.0.1\", \"E1700B5DF7:659C\", \"BEE.C.92813GDEB\", \"::/0\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"13E9D7.875B06A:\", \"GG5A19381C77036\", \"127.0.0.0\", \"0::0\", \"G85FGEAF7605GC0\", \"::/0\", \"B385G.:AD7E16..\", \"ECFA.46159BE3GG\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"E29E8757.10D6EG\", \":49FG89ACD3G45D\", \"0.0.0.0\", \"::2\", \"0::0\", \"F5919BF8A:C4EC7\", \"DA091A.G0CE251D\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"4.29E057413.F45\", \"48391EE:7G4:EAF\", \"1::2::3\", \"D1E08:CD68:85F2\", \"7224:75448:FFC9\", \"C779E.6FG18F146\", \"::2\", \"0:0:0:0:0:0:0:0\", \"893B:AF1.65E4B.\", \"61G.GA8B6:3ADE8\", \"0.0.0.1234\", \"127.0.0.0\", \"DG2F331C6CFA9E3\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"81D3..2258.A73B\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0.0.0.0\", \"::2\", \":::4\", \"F09.:F9C6GEDBA9\", \"4AA03870A9D2F51\", \"37FA435FE:GF8EG\", \"D2C7B.C.D1:7B.6\", \"2\", \"2.5.6.2\", \":::4\", \"283271EE9.3::DD\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"2.5.6.2\", \"D63FE6C0363D6E2\", \"127.2.3.4\", \"::\", \"FE507E9.86F93GC\", \"84F8F8F6962BE5B\", \"::\", \"2.59.6.2\", \"0.0.0.1234\", \"127.0.0.0\", \":::4\", \"0:0::0:1\", \":B3:A9C6.A093D:\", \"E.GG204AC:2FCG6\", \"192.168.0.1\", \":1798445E7:G6GB\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"30G8E10F:78.ED2\", \"    127.0.0.0    \", \"::/0\", \"E:ACD184338DGG9\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0:0:0:0:0:0:0\", \"C14:E.D1.6E583D\", \"    127.0.0.0    \", \"::1\", \"74E86.27G.C30:6\", \"2\", \"88A2:A14GB494A3\", \"4.G:3970E.A3:CC\", \"31:9B4CE6G479.9\", \"0:0::0:2\", \":D20C0C4BA..528\", \"BC8AF699E6ED268\", \"47072EA.E9D6B0E\", \"3384572986.46D1\", \"86AECA1:55F92F6\", \"4:3515C:7C35:AF\", \"::1\", \"G93.GB7EB74B247\", \"0:0:0:0:0:0:0:0\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"127.2.3.4\", \"0:0::0:2\", \"BD0728AAFE87F74\", \"0.0.0.1234\", \"556:83.38A8EGGB\", \"99714:E8DFDA9F3\", \"2.5.6.2\", \"09C5.129BC:7AC0\", \"::\", \"5AE4DA0:880572G\", \"B:86308681.3EE8\", \"2\", \"9F301920E97AC73\", \"::\", \"9128EFFCD86A6CA\", \"0.0.0.1234\", \"446E:85C2BB69FC\", \"    127.0.0.0    \", \"0:0:0:0:0:0:0:1\", \"G92AG7B.D79:5E1\", \"GE24A87EEDB5A65\", \"::2\", \"EF6179C53612A16\", \"2.5.20.1\", \"A996F05G310BE3E\", \"::\", \"0:0:0:0:0:0:0:0\", \"::\", \"309B9:DA422FB91\", \"0:0:0:0:0:0:0:1\", \"1::2::3\", \"2.5.20.1\", \"::1\", \"9.93FB8GDFC.EG9\", \"3D:88EA3GFEB8B8\", \"0.0.0.1234\", \"127.0.0.0\", \"CG778GGD70.5.CE\", \":EC8A112:6G872G\", \"23F2AAD0A2G2B81\", \"::1\", \"AA9CDA348216CF5\", \"::1\", \"01840C03056AB75\", \"192.168.0.1\", \"1::2::3\", \"C7FFF374BDBE367\", \"DD6119::7.58B.B\", \"127.0.0.1\", \"D57BG439GCC6.78\", \"52E5EFB1EA59F3F\", \"F5D0949GB8AEC.4\", \"127.0.0.0\", \":DG7BAB4D50:04A\", \"1C5A1D4.4E.4DD:\", \"9A18102615GGA:6\", \".23G4E0AGEA8F48\", \"25892BF69.4A:F0\", \"2D755GE9G1DC196\", \"642.G1171CBB15B\", \"30G0:0FBB.5CE7:\", \"::\", \"C1:G2DC43.A5G.3\", \"F95946BE6::0A00\", \"CD520833360FG23\", \"::2\", \"C2.54.5F78878A5\", \"B9B:A05CB1F51C5\", \"0:0::0:1\", \"97FDD267F89D339\", \"127.0.0.1\", \"    127.0.0.0    \", \"0:0:0:0:0:0:0:0\", \"8::A4G:6:C27EA2\", \"127.0.0.1\", \"::2\", \"0743E6A47EG0D21\", \"0:0:0:0:0:0:0:0\", \"::\", \"GEA10DB.A6A.C37\", \"0:0::0:1\", \"20.2C6B:7E5C777\", \"CD27954:B:G0:7A\", \"0:0::0:1\", \"0:0:0:0:0:0:0:1\", \"::1\", \"2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"F0C405EG7418EA9\", \"::/0\", \"F9F92AA257.:GA9\", \"6.9G0D85BB0.030\", \"8B01A.E69AB1A5.\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::\", \"E7476A6796G3GCA\", \"1::2::3\", \"DE03.13C163376:\", \"0:0::0:1\", \"FC1G99.88F9F4CC\", \"0.0.0.0\", \"0:0:0:0:0:0:0:2\", \"B:2GF3D:41E8A.E\", \"127.0.0.0\", \"F62C1D17.9101E4\", \"6F29C2FD50D3BFB\", \"    127.0.0.0    \", \"6F9A09D9DGA:G28\", \"::2\", \"::\", \"DF7B4F9AAG2..9:\", \"1A7.2.4081G73:6\", \"0:0:0:0:0:0:0:1\", \"0:0:0:0:0:0:0:2\", \"2D5396G880400AB\", \"CE863:1B6F5.EA6\", \"93E25.434A8B2C7\", \"2.5.20.1\", \"C:5.DE894.C.4A3\", \"0:0:0:0:0:0:0:0\", \":::4\", \"7E84A268605CG4F\", \"0..14CD3CCG0ECF\", \"255.255.255.255\", \"255.255.255.255\", \"4A15AE55FB31F0:\", \"4.224A17.AD:EG.\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2.5.6.2\", \"F2:A5:3GB859DE4\", \"127.0.0.1\", \"2.5.20.1\", \"DFE923F618A04EF\", \"300.0.0.0\", \"127.0.0.1\", \"C76G4G:9A97B019\", \"0:0:0:0:0:0:0:2\", \"127.0.0.1\", \"::/0\", \"127.0.0.1\", \"::2\", \"G9:E..43241:911\", \"D8B94:0179BEBAE\", \"65450:4G:90G743\", \"5D81E46893G4.85\", \"G389AB0C6.78D74\", \".9458F1G85E036C\", \"0::0\", \"1::2::3\", \"62:50:F0465B37D\", \"2.59.6.2\", \"0:0::0:2\", \"::1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"2GA0B.4CA7G7B5A\", \"04323681::FD.4G\", \"8F:9528GF1C8327\", \"B..4BD7315225:1\", \"2\", \"635C4C7F0G06006\", \"0:0::0:2\", \"0::0\", \"::2\", \"2\", \":CE:90D1A9F2434\", \"2.59.6.2\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2.5.20.1\", \"09AD49F661C47AA\", \"127.0.0.1\", \"0::0\", \"    127.0.0.0    \", \"127.0.0.1\", \"300.0.0.0\", \"GB44..502EGEFG5\", \"2B.G9G6F9876C08\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \".GCC97FGB.:DA5F\", \"C:A.3G:G5FE7A01\", \"C670B8.123.D4.1\", \"4.4BA29G078A8.9\", \"D:99F98DG9FD497\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"8050DAC5498:7:0\", \"0:5DB18463G:0:8\", \"0CB5.8E..629A13\", \"0:0::0:2\", \"51A75AB2G0.D84.\", \"1::2::3\", \"6A7F6C:45BG46.B\", \"08B545BEG25GE1.\", \"::1\", \"GG3217DDAB:710C\", \"127.0.0.1\", \"5B93A48899:A391\", \"4DE0FAF7100DB96\", \"EB792DB5CE0909B\", \"2.59.6.2\", \"::2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"255.255.255.255\", \"76.C:E315AB05FE\", \"::\", \"8073DA4DCDDA0E3\", \"F::3A07DB29F542\", \"192.168.0.1\", \"EAD7G324G6..852\", \"300.0.0.0\", \"300.0.0.0\", \"87G0F4E7BB27.37\", \"300.0.0.0\", \"D0416B.F1C16531\", \"G70188C1.A9CG71\", \"2.5.6.2\", \"2.5.6.2\", \"1E1A2B5F9862255\", \"B55A9199B2213:1\", \"64F7:B.EBA8:CA.\", \"0:0::0:1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \".74D322DC9:6.G8\", \"2\", \"31:CFC:AA52E474\", \"G234A:632F205:.\", \"127.0.0.1\", \"CB22AB27GA0GG25\", \"0:0:0:0:0:0:0:0\", \"C1.DD04EFE352C:\", \"4E8B:CG3318A2AC\", \":::4\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0:0::0:2\", \"2.1F8.0496E7222\", \"2.5.6.2\", \"1::2::3\", \"C::3FC:9D150564\", \"5674.GG5E49C6E1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"01BCGAF7D196.E6\", \"300.0.0.0\", \"2.5.6.2\", \"300.0.0.0\", \"C6ECEE09EAE6800\", \"0:0:0:0:0:0:0:0\", \"83:E764G33ADE8D\", \"127.0.0.0\", \"192.168.0.1\", \"FD1F65G8BF28170\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"644A2ABC5F700AC\", \"EFC0.10F8:.27.A\", \"0:0:0:0:0:0:0:2\", \"25DF7B1FA4A6F30\", \"127.0.0.0\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"AGF356E9B1D:G4:\", \"633E7D362069665\", \"127.0.0.1\", \"0:0::0:2\", \"GG7C22F.BC65CF2\", \"0:0::0:2\", \"2\", \"127.2.3.4\", \"0:0:0:0:0:0:0:0\", \"F9F30DF31093:6D\", \"B.D6C7A439:868:\", \"4B.0E.67CC6DDE2\", \"2EC51E1C29D11E4\", \"2\", \"FA:3095CC1:18B5\", \"BA7AF2B38.634DD\", \"4:5B45A3E02D54C\", \"127.0.0.1\", \"::2\", \"2.59.6.2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0:0::0:1\", \"G:A:A3G5:46531C\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0:0::0:1\", \"0:0::0:2\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0:0:0:0:0:0:0:0\", \"954:1963GA2D383\", \"2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2.59.6.2\", \"ECA78.FB01B.AE9\", \"2.5.6.2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"300.0.0.0\", \"A2C2G8620.42CF0\", \"2.5.6.2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"G01EE2BGCD12FG8\", \"13G1F8D17687DE8\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"89..1..A0F7D60:\", \"5CB.E:93FBF3F0.\", \"0.0.0.1234\", \"300.0.0.0\", \":BAF.:E2CE4.FA.\", \":718C1BB424E767\", \"7F9CFAB2D3CA029\", \"0:0:0:0:0:0:0:1\", \"A9G6CE543.G:F1.\", \"F89C6C06B15::.:\", \"8477:432B.9A8G.\", \"560.:F4B1A6AG11\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \".EG3GDB78.480C2\", \"6E.2G8G3530G1CA\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"2.59.6.2\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \":398C3.2EE9.8BA\", \"0:0:0:0:0:0:0:2\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0.0.0.0\", \"8DFF124D9225D.5\", \"2.5.20.1\", \"5:611B92B7G6B.A\", \"EAC85:D8BD:54.C\", \"GDCC6.43G2009AG\", \"::\", \"0:0::0:2\", \"628.55A62AG.6E1\", \"192.168.0.1\", \"0::0\", \"2\", \"B..67A6.B772E2G\", \"127.0.0.1\", \"99B1F.39G:3D.01\", \"GB47EE2C0.16E27\", \"0:0::0:1\", \"0:0:0:0:0:0:0:0\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"8611DDF88:GF:8C\", \"2.5.20.1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"34CA582640.0E7E\", \"::2\", \"G2.5A87B20C5B69\", \"B22G2C68::4:03F\", \"0.0.0.0\", \"::/0\", \"2.59.6.2\", \"7A4AA01G1B4D7:A\", \"8FG386.9GB811GE\", \"1::2::3\", \"792A.DF520:F071\", \"EF:57G2CACF.2A7\", \":C35CC.G3B093B:\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0.0.0.0\", \"GB4944423:AA4C:\", \"1::2::3\", \"556G674E7F8.F.7\", \"0A067B257.3CE0A\", \"1::2::3\", \"8901GBB8A265E09\", \"::\", \"2.59.6.2\", \"192.168.0.1\", \"2\", \"1:6ED:B91460F54\", \"127.2.3.4\", \"72892G47C331C9D\", \"127.0.0.0\", \"09C:5EG66237791\", \"10GF846B2F2.72D\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0:0:0:0:0:0:0:2\", \"0:0::0:1\", \":G1C:3D5E74646E\", \"::/0\", \"2.5.20.1\", \"1DB654FE8FDD323\", \"1::2::3\", \"7F607A1527C165A\", \"0:0::0:1\", \"C315F3A10EGG0F6\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"127.2.3.4\", \"E38.7159:2CC:14\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"G:5D413.:51:E67\", \"9336AC8F6D41.C2\", \"127.0.0.0\", \"4571C5F5294GG41\", \"0:0:0:0:0:0:0:0\", \"0.0.0.0\", \"0.0.0.0\", \"2.5.20.1\", \"E2A02F0BE94AF43\", \"D529D.:GEE8FE4:\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"C.8CB:B1605FD7C\", \"B7G9CF6CC29A6C:\", \"74503D534046G97\", \".:34A73F8F172BA\", \"::/0\", \".:94E023F.591E2\", \"::\", \"0.0.0.0\", \"0:0::0:1\", \"9183F2BAAEG78G9\", \"127.0.0.1\", \"5C4AD92563FE6FB\", \"0:0::0:1\", \"G554FE8B.A8.895\", \"AB31:5F67DBECB6\", \"A1.816A.8.0G9CA\", \"50F2401CC3F13:5\", \"0:0::0:1\", \".34GF43DC6F25D6\", \"67GC5.AB874A344\", \"    127.0.0.0    \", \":85E05F0A85C3C1\", \"0:0:0:0:0:0:0:1\", \"7G5BC08AA353B0D\", \"192.168.0.1\", \"255.255.255.255\", \"::2\", \"0:0::0:1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"::2\", \"3F:6AA332B6596.\", \"2\", \"0:0::0:1\", \"A1344E.:9G.2071\", \"0.0.0.0\", \"2.5.20.1\", \"A0078:1:A.B0757\", \"B:FG7F6G8.C59D:\", \"0.0.0.1234\", \"0::0\", \"92E:AA6BDA16DDC\", \"BAG41B081DB637B\", \":::4\", \"0:0::0:2\", \"::\", \"2.5.20.1\", \"0.0.0.0\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"::1\", \"4F5CCFED.2B6328\", \"2.59.6.2\", \"4:70EF73F:6G126\", \"443GC97.82D:7AD\", \"1:CG9572F3A57:D\", \"G343F:GDE798G18\", \"80C561A4826D9D1\", \".G.6CDGC::0826A\", \"F:0A5F3G8615582\", \"    127.0.0.0    \", \"0:0:0:0:0:0:0:0\", \"127.0.0.1\", \":::4\", \".2E1F.9E4A7.422\", \"D8C2DE8E72867A0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"D5214AG420FB507\", \"0::0\", \"FG0D76.6D1F5C81\", \"127.0.0.1\", \"G24F9G9.CBF59EF\", \"G711B7C58E4182F\", \"::\", \"9G1G94509.701G7\", \"127.0.0.1\", \":G5882DE::B495E\", \"0.0.0.0\", \"127.2.3.4\", \"C:9870.66:97739\", \"0:0::0:1\", \"::\", \"2.5.6.2\", \"124F5.:C14232DE\", \"0:0::0:1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"E1G66CGA6:28A2C\", \"933.G824FD69D37\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"8C8DBFDD28D:BE9\", \"127.0.0.0\", \"1EAA7FD204755E1\", \"BE:61BEE.9192D0\", \"388007D0GA2.8A2\", \"2\", \"0:0:0:0:0:0:0:2\", \"7540.339BF463:2\", \"::\", \"::\", \"1E2CEFD4:8.440.\", \"3F853.B61E787A3\", \"0:0:0:0:0:0:0:2\", \"BA3C07C9G.:F.02\", \"0B48::A7166.6D5\", \":::4\", \"127.2.3.4\", \"0:0:0:0:0:0:0:2\", \"300.0.0.0\", \"127.0.0.1\", \"0::0\", \"127.0.0.1\", \"AG8CD830B47:21E\", \"4:.206G753828.6\", \"0:0:0:0:0:0:0:2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"F2E54.174E7CC.1\", \"B82:5840AC176.0\", \"81.89G1A7GAAFF9\", \"::1\", \"F193DE767D9BE6F\", \"E4F:C39A881C9BF\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0:0:0:0:0:0:0:0\", \"2\", \"127.0.0.0\", \"0:0:0:0:0:0:0:2\", \"    127.0.0.0    \", \"9894497B6D6EDG3\", \"::\", \"D8C9G67D2A74G38\", \"FEA4C:B8A1B26E5\", \"::1\", \"791274:9DA.A451\", \"2.5.20.1\", \"151.EDB:69D98BA\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0:0:0:0:0:0:0\", \"::\", \"2.5.6.2\", \"73AB92DDB44782D\", \"80B39FG.C148CBD\", \"31491ABCA69C744\", \"0:0::0:1\", \"127.0.0.1\", \"::\", \"D334E.A:40F83A9\", \"127.0.0.1\", \"0:0::0:1\", \"::\", \"0A:6613.93EFD8E\", \"BC20:BB45.39F8F\", \"2.5.6.2\", \"G9:G31BDD9GC0CD\", \"48:F2GABC.E4F20\", \"G8B10CE720.2425\", \"300.0.0.0\", \"::2\", \"127.0.0.1\", \"4F2GB097C4GDF53\", \"F63AG4GE449F9:2\", \"206EE7F7CD.F2C9\", \"::\", \"300.0.0.0\", \"7723.7C.9BAG5CG\", \"0.0.0.1234\", \":6G:4GCA.5DDB:C\", \"980643.C2D4236G\", \"1::2::3\", \"E33EA7170G3:48F\", \"7413.52:27A2415\", \"127.2.3.4\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0:0::0:1\", \"1DG2D5BBD260816\", \"2\", \"5D9:FFBAEEE6029\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"A9B30A9GG3E9659\", \"::\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"::2\", \"127.2.3.4\", \"4BDC:AB65F6AE72\", \"5538990AGFAD3C8\", \"0:0::0:1\", \"4.D9G6EF26F072D\", \"G5:3:B1.CEF4335\", \"::/0\", \"5:AGD57F9091D.F\", \"9G57G1E6C4C0A0B\", \"2\", \"0.0.0.0\", \"E81AD3G0GA4BD0G\", \"8CF1BBEGAGA9EE:\", \"03..:568A047E62\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"127.2.3.4\", \"2.5.6.2\", \"8G370DG4EB68G85\", \"6:225EB.DE14A2A\", \"300.0.0.0\", \"2.59.6.2\", \"127.0.0.1\", \"2\", \"0:0::0:2\", \".AGE7287G1620G3\", \"0:0:0:0:0:0:0:1\", \"E057CAF42E9FAG5\", \"0:0::0:1\", \"::\", \"::\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"C694FCGB3471:.7\", \"80351G.10295.D6\", \"G57AB37:E11FC5E\", \"E4C0D4A4919D0A6\", \"CBBF00A96913.15\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"B10E05.0DA59A5E\", \"::1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"192.168.0.1\", \"2.5.20.1\", \"::2\", \"127.0.0.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"B.7F16:1GC4E.A4\", \":E49EB.:F56CAGG\", \"::/0\", \"DBG0C:AEDFADEGC\", \"7CG.7061.4B96CA\", \"0:0:0:0:0:0:0:0\", \"0::0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"255.255.255.255\", \"C9CFG:3B.E6E9E6\", \"::\", \"ABCAE59.AEE640D\", \"1.FA37B12GBFFE4\", \"0:0:0:0:0:0:0:1\", \"300.0.0.0\", \"B98:.4G.CF6.6E:\", \"0.0.0.1234\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0.0.0.0\", \"33G023E08:CG986\", \"127.0.0.1\", \"C1E07E7AEF3AG1.\", \"692FFFF706D497:\", \"2.5.20.1\", \"8:D497C3E6:DDG9\", \"114.G433F7G5D4C\", \"300.0.0.0\", \"1::2::3\", \"G.9EAE.E82CF:D7\", \"2.5.20.1\", \"18C24CA:86:4313\", \"4GAG2796A97GE72\", \"95E9DE54639A.9G\", \":F5E7CAB4A49AA:\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \":50.5235979:83:\", \"0:0::0:2\", \"E0F9E9DB7F79:42\", \"E2C143D56E0089C\", \"255.255.255.255\", \"3B8.:B55FDFE7..\", \"::\", \"0:0:0:0:0:0:0:2\", \"255.255.255.255\", \"E312597FC7477GD\", \":B9.6EE6C8.G6F9\", \"::1\", \"::\", \"0::0\", \"127.0.0.1\", \"::/0\", \"FFFED284F33C.D:\", \"5C70466E.4EA.52\", \"0:0:0:0:0:0:0:1\", \"127.0.0.0\", \"127.0.0.1\", \"0.0.0.1234\", \"B2:0851:E01FCB.\", \"A88AFE934EG2BFD\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"G9G38D6FF73GF54\", \".C39G3CA214:8F1\", \"E:1E73B3EA15A3C\", \"0.0.0.1234\", \"67D1A6G42D:E8E3\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"00D878027C81G2A\", \"0:0:0:0:0:0:0:2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"1::2::3\", \"B368A4CC:7G:0F0\", \"FB.EAB:A9G.:B:E\", \"71FEG398AD9EF72\", \"C94FA4:.1FAF4.G\", \"40:1GA5A0:E7118\", \"D98CDF353695362\", \"A04B.:10BFG0441\", \".939924FGGA43C6\", \"3F40418E:36..4B\", \"1B9E93A12F6E:B4\", \"::1\", \"127.0.0.1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2.59.6.2\", \"::\", \"028431G77G7F2FA\", \"02CD99F23:64:02\", \"0.0.0.0\", \"6CC66.B2:5AC7:7\", \":F5C2D19970110.\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"F:E3.88.2E96A47\", \"20F871DC58DDCGB\", \"ED48A:G82AF405E\", \"    127.0.0.0    \", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0.0.0.1234\", \"53CG26CF6DFB57G\", \"CD8G2:5G46C.7BE\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"A83A76G0:.F5D:7\", \"423AGC7E.9AC3FB\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"37AG:44D0B3:9EC\", \"E56.5DEEAE51835\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::\", \"12.:76ACCCG892C\", \":8EA4F5:A70FD2E\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"::2\", \"127.0.0.0\", \"    127.0.0.0    \", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0.0.0.1234\", \"E58D717G5G8D11A\", \"0:0:0:0:0:0:0:1\", \"D3C1.97F:.754BD\", \"0.0.0.1234\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"127.0.0.1\", \"::1\", \"1::2::3\", \"50.D53G17BB9C8E\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"D.D31ACF90AF810\", \"0.0.0.0\", \"19D:F.3B881ABB0\", \"0:0:0:0:0:0:0:2\", \"0:0:0:0:0:0:0:0\", \"2\", \"GE4A03:8G8986:F\", \"4F46EE4.:308:G8\", \"6.B02C94.7286A0\", \"D17GG252181D2F9\", \"C75533G9FFFC176\", \"::\", \"7573D685.038362\", \"300.0.0.0\", \"0.0.0.1234\", \"127.2.3.4\", \"0D491CB478089CA\", \"EFD5568E38B2FGC\", \"2\", \":B:.A7.AF9.7B.2\", \"2E457109B3A6C71\", \"::\", \"5B30.AA5778A912\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"A0234.2EGDA6B.8\", \"1AF5D6F96.:.27A\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0:0::0:1\", \"886EFB357D810GF\", \"0:0::0:1\", \"3.01GAF:G6D:.2C\", \"2\", \"    127.0.0.0    \", \"2\", \"2.59.6.2\", \"F01FB.943C2DGG0\", \"G..C6C53FC8275D\", \"1598GAC8ACCBB73\", \"2G20C13160.B6.D\", \"EEF77G4..61740B\", \"0:0:0:0:0:0:0:1\", \"2.59.6.2\", \"812FA8F.7A3D31G\", \":0DBB19D734G8:A\", \"85G11CF5434E9.8\", \"171:24.523AAE67\", \"1::2::3\", \"0.0.0.0\", \"127.0.0.0\", \"260G4F3672B7169\", \"0::0\", \"E41AE2003:C2C2F\", \"::2\", \"300.0.0.0\", \"8E:9415E903:.94\", \"B7B8706B9G8.B6G\", \"99C85.E018.2A9B\", \"C3.88C8C6.6A517\", \"2.5.20.1\", \"6C1E2:583B024CF\", \"C7112AA0F13ACFD\", \"16B94:011FF8GDF\", \"8ED:2AC4CB3G2:5\", \":::4\", \"300.0.0.0\", \"127.0.0.1\", \"2.59.6.2\", \":::4\", \"95A663.BC7D..3F\", \"2A:0275F7B5.D0E\", \"108G4FGG512E.9B\", \"300.0.0.0\", \"::\", \"0:0:0:0:0:0:0:1\", \"::\", \"0.0.0.1234\", \"::1\", \"E3C.4:G02C90.C.\", \"308BCDA137185BD\", \"FCE3.5964C4GC0E\", \"8A1229:.9FC896A\", \"76D6481A.12368B\", \"0F9:52C60458DG8\", \"G6:E.CD.2105E77\", \"B36DAEEDD17B:AE\", \"F.8A:7D13:F9B9F\", \"0:0::0:1\", \"2\", \"932E:2E75182::A\", \"127.2.3.4\", \"C57E354:EGB1A6F\", \":::4\", \"51GB5F54861F41:\", \"0:0:0:0:0:0:0:2\", \"    127.0.0.0    \", \"0E3F69681.C3258\", \"4265E9:EG1FDFE8\", \"0:0:0:0:0:0:0:1\", \"    127.0.0.0    \", \"16AE703..B.BC84\", \"9.D06560A:1FAGA\", \"52609E08..9:93G\", \"GD1E26D4AADFDBA\", \"B6D225AB233.22E\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"::\", \"::\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"21A8:5E6GEBB69.\", \"A:1:DC90027EB74\", \"03C3.8AE54595B:\", \"0.0.0.0\", \"::\", \"4::D3499741B.70\", \"5E3E88C9AFFFEF9\", \"0.0.0.0\", \"192.168.0.1\", \":::4\", \"300.0.0.0\", \"BEF49FF:9790195\", \"0:0:0:0:0:0:0:0\", \"AF80DG2FCF12..A\", \"::2\", \"4G851DAG3E2DA.6\", \"0:0::0:1\", \"2.59.6.2\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2\", \"127.2.3.4\", \"2:.:2A4227.5DBC\", \"::\", \"EC9243.61332G4F\", \"F1DDD2AE9DA00E2\", \"127.2.3.4\", \"04.E.EB64C6A5EG\", \"1::2::3\", \"127.0.0.0\", \"6:1B8B3B45:ABF:\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::\", \"76C4A73C3.8204.\", \"2.5.20.1\", \"38026D169:F1B.F\", \"8E37G6E47FF32:F\", \"4B8F10A814:6BCG\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"255.255.255.255\", \"2.5.6.2\", \":AAG0G3DB34DDA:\", \"CB471A20A6400CA\", \"0:0::0:2\", \"84BC526F89GC1CD\", \"F.B542590EEAEBD\", \"127.0.0.1\", \"0:0:0:0:0:0:0:2\", \"E7C763ACC02AE4A\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"BA1G5.3.FG30.D2\", \".4099BE6E8B0AF4\", \"B97G14BB98318AE\", \"00:DEG.64G7:25F\", \"    127.0.0.0    \", \"DC3FF5:.A94BC60\", \"D10AC31A:DA0D6E\", \"E9A7786GG76G:6.\", \"0:0::0:1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::\", \":DD3.DAG3F7.B86\", \"0::0\", \"0:0::0:1\", \":6A4:.E1E70D60C\", \"2\", \"2.5.6.2\", \"0:0:0:0:0:0:0:2\", \"2BDB.F9A246FCB.\", \"255.255.255.255\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0:0:0:0:0:0:0:1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"D82FE990BF52.04\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"2747018142.1A2B\", \"::\", \"707C66GA0B9FB:F\", \"CDC.4700EDA1240\", \"0.0.0.0\", \"387.97D3882:93.\", \"0.0.0.0\", \"192.168.0.1\", \"6E418CB:71FD078\", \"G619F05F3C4323F\", \"24.29C41.72.BF0\", \"1EC94B9D71031GB\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"368919:8851B7.B\", \"127.0.0.1\", \"0:0:0:0:0:0:0:0\", \"2.5.20.1\", \"3388552..:726C5\", \"127.0.0.1\", \"3E4E4EE.6D2BE9.\", \"127.2.3.4\", \"1::2::3\", \"0:0:0:0:0:0:0:2\", \"127.0.0.1\", \"6F00A8B55A4.FB7\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"E7G3F8A2B30:.E5\", \"C1A6:C:04.0.4.F\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"43.A8AA.EB.F8GA\", \"3E.GEFD33EC4AD2\", \"2.59.6.2\", \"3B.1C65B31GB162\", \"192.168.0.1\", \"41:2321216E86CE\", \"127.2.3.4\", \"255.255.255.255\", \"0:0::0:2\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"56:338B5:5C427B\", \"127.0.0.1\", \"    127.0.0.0    \", \"EE9D5789923AB9F\", \"E1C4A707D1C5G08\", \"2390C7E4C44G.9A\", \"::2\", \"A34515C:DC82B79\", \"577D77D.B12F8AB\", \"D73EFF5:0A9:FEG\", \"    127.0.0.0    \", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"E.:0F35E9ADB6DC\", \"2.5.20.1\", \":5G58AB40D880C4\", \"4.387DE18C38:4E\", \"1::2::3\", \"0.0.0.1234\", \"35D.EG:6C063G67\", \"192.168.0.1\", \"0:0:0:0:0:0:0:0\", \"192.168.0.1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"CF319.E0C7CG557\", \"F42:7023.72E670\", \"0:0:0:0:0:0:0:2\", \"AE419D45DB08F5D\", \"1::2::3\", \"2E7617B5G943.43\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0::0:2\", \".4D299C62BG:GF7\", \"127.0.0.0\", \"0:0:0:0:0:0:0:2\", \":::4\", \".A494D5B:1GA5D.\", \"6CDA35C3CCF5:B4\", \"2.59.6.2\", \"C1ACF::75A31E89\", \".E3G53.197BAE.G\", \"55A0889F51AAF93\", \"GCGAF38026EBF.4\", \"0F198180BD0::G4\", \"127.2.3.4\", \"::\", \"BC68EA73A6EA4FC\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"192.168.0.1\", \"2AAGGD4239B1B5B\", \"1:B2F116C6BAD.0\", \"0:0::0:1\", \"0:0:0:0:0:0:0:2\", \"127.2.3.4\", \"E446EFE141G8F74\", \"300.0.0.0\", \".C7AA8B23A7.G58\", \"0:0::0:1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::\", \"4.C00G::721:2F3\", \"0.0.0.0\", \":76A2897:6433D:\", \"F0G95D918B:E.9G\", \"GAEEC9D.0EDE7:6\", \"049986.77356D10\", \"300.0.0.0\", \"C3:54D2FB883AC1\", \"192.168.0.1\", \"B88455BEE03A9CA\", \"255.255.255.255\", \"192.168.0.1\", \"::\", \"0.0.0.1234\", \"127.0.0.1\", \"0:0::0:1\", \":4B12B:44017554\", \"5ECE060B8C8FE17\", \"7A2.1E2E1D447CA\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"127.2.3.4\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"15.B14C2DEGE460\", \"EEDFB3B.CA84GAF\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0:0:0:0:0:0:2\", \"B9:F7A1A0A.1D83\", \"DB056CGD.603FB4\", \"B9976.2CCDCD7.6\", \"41DDF2F1B.E36CC\", \"255.255.255.255\", \"2\", \"127.2.3.4\", \"1::2::3\", \":::4\", \"40623F8.4G:16CF\", \"2.5.20.1\", \"127.0.0.0\", \"CEA:73595D4D66F\", \":8B0B8.7:23649E\", \"F87G:4351007456\", \"0:0::0:2\", \":9GF84.1E1F9A:C\", \"A::4428E37G1E09\", \":FD032E757GG3D0\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"4E332:78BE:B260\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"D457C8CE9195185\", \"::2\", \"G5B5564A5:328FD\", \"5464.E25832EA65\", \"1::2::3\", \"A00B19D61ED:8G0\", \"47D9B99.73127A5\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"9CDGAF25D:DCG46\", \"6G55:C333:8G15.\", \"FGF60647A5B:3F2\", \"::\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0::0\", \"127.0.0.0\", \"C:.A6A9.1E2:C62\", \"127.0.0.0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"    127.0.0.0    \", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0.0.0.0\", \"::1\", \"0:0:0:0:0:0:0:1\", \"127.0.0.0\", \"0::0\", \"A1361A2.8FG33A2\", \"0:0:0:0:0:0:0:2\", \"G843C846B8A4904\", \"660D37BE1826204\", \"BG:3F3F1:G9:5E9\", \".16EGA5E7088DDA\", \"131CF7EBG17BC5G\", \"192.168.0.1\", \"0:0:0:0:0:0:0:2\", \".9F.07968D:CGB.\", \"5E300B19..CEAAC\", \"0::0\", \"E117CE:1671F.0.\", \"AD88675B4E9C7G:\", \"9892G2BF13B9339\", \":EA2F4.2.CE9A9E\", \"5:401:7F2FAF3F3\", \"3E05BB091:0A647\", \"D00GGE136A..5E.\", \":AE88DD6G810D29\", \"25AD6311:319952\", \"0:0:0:0:0:0:0:2\", \"E3799F9B054A348\", \"B47.7E9B9:76A07\", \"D:841E1GC277D3C\", \"644.2E4DB0D2F49\", \"6BDG17B2F973:D5\", \":::4\", \"0.0.0.0\", \"0::0\", \"F7:G:0ADEA1:.04\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"2.5.20.1\", \"2\", \"0:0::0:2\", \"0::0\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"127.0.0.1\", \"::\", \"127.2.3.4\", \"7FFDC932FD35523\", \"0.0.0.0\", \"0:0:0:0:0:0:0:0\", \"127.2.3.4\", \"::2\", \"    127.0.0.0    \", \"0:39G8:B6CG5B4:\", \".E0BD4:D2B4B:5A\", \"8637G3EDB905A5E\", \"D7A392:BE337497\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"127.0.0.0\", \"::1\", \"::\", \"2.59.6.2\", \"0.0.0.1234\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"6EDB008:71536E4\", \"C55C47AC9BE62C.\", \"2.714:8951952FB\", \"127.0.0.1\", \":::4\", \"0:0::0:1\", \"7248568C91B6:.A\", \"    127.0.0.0    \", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"9C0.F11DC9375.9\", \"8CA83BC15B4B878\", \"8EDC33934A90FEA\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::\", \"3B35894.8D50AC:\", \"0:0::0:2\", \"CAEC06FF55...:B\", \"255.255.255.255\", \"E::ED2.0B85A50E\", \"077918AD8D1CD0E\", \"12G06GGDE:D4E3:\", \"873B94:2C39A9EF\", \"F1:27BAE263AEB4\", \"0.0.0.1234\", \"::\", \"::\", \"1E5B9.912:CA6AD\", \"0.0.0.0\", \"74.FCFB49878B2.\", \"8EB102A.D24.5B1\", \"G8F40.77CGA5CGC\", \"127.0.0.0\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"::2\", \"E18.90E0G1C83:B\", \"2F238DC4DE1.7C0\", \"0:0:0:0:0:0:0:0\", \"300.0.0.0\", \"DAC973:3B897:.7\", \"::\", \"8C:88E91B5BBEF2\", \"8:.E3.G.7FGB39C\", \"0.0.0.1234\", \"00CAG33A74.3119\", \"0.0.0.1234\", \"G35F114.5FGCB7D\", \"9DF5CBB89135:DG\", \"DDB61GCCGC3.244\", \"::2\", \"BDC:D7F92692EF8\", \"79070:2:8A9B42:\", \"5D.4411EC9E310A\", \"0DCECGE8F288EC9\", \"7BC6G:42E42D9::\", \"055.C7.0E85971B\", \"0:0:0:0:0:0:0:0\", \"1.A.688B3.6805C\", \"57C9DE3GC77C:E2\", \"::2\", \":::4\", \"943D6A978.2AA7:\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"1::2::3\", \"192.168.0.1\", \"127.0.0.1\", \"EB8.FG75.BF.92.\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"127.0.0.0\", \"9DAE.GC43GF5DB8\", \"8.1DE50773:4:1G\", \"360CB13F82650A6\", \":::4\", \"28.B6B189D8CB86\", \"0:0:0:0:0:0:0:0\", \"127.0.0.0\", \"GC3E7.6B9C3:F49\", \"::1\", \"397F5A78518..A8\", \":28374119AAF86E\", \"34735A6G3610A52\", \"0.DBE11G4F930G7\", \"0::0\", \"BA:C7D0FADDD.88\", \"127.0.0.1\", \"C:0:.6303.::6:F\", \":6F880C27D::951\", \"FA84A49AF2:51G6\", \"2\", \"    127.0.0.0    \", \"0:0:0:0:0:0:0:0\", \"69.F..1AB:EE59B\", \"::\", \":::4\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"7:B8C1C73B42368\", \"300.0.0.0\", \"04G6274EC.77AC:\", \"0.0.0.1234\", \"300.0.0.0\", \"AF877.AA..EE9:8\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \":::4\", \"300.0.0.0\", \"635FF2.:D::2F0:\", \"127.0.0.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"    127.0.0.0    \", \":::4\", \"1::2::3\", \"1::2::3\", \"5.A8868.6A.:B0B\", \"A222F035BBEB477\", \"80G:1:DF9BF46FD\", \"C66C18C5D1:A359\", \"7798G:F8F6F3GD3\", \"::2\", \"G766GF.6FDG5.5D\", \"29864G2BB5F051E\", \"2A:141A0:0B8BCA\", \"D4BB:9722BA9BAA\", \"::\", \"3443E64A85C6A7F\", \"::2\", \"    127.0.0.0    \", \"0::0\", \"0206F0GB49E0..F\", \"761A8CGEA18DC39\", \"::\", \"B5G60GA93.15CAC\", \"127.0.0.1\", \"G24D700G0DBG.FB\", \"127.0.0.1\", \"127.0.0.1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0:0::0:2\", \"0:0:0:0:0:0:0:1\", \"F191G19C5F.1G6D\", \"2.5.6.2\", \"EF9.A2E0.A7G82:\", \"5.9766874046B24\", \"::/0\", \"2.5.20.1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0:0:0:0:0:0:0:0\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"E64:08F1FBG27G7\", \"03DF:2432D5481G\", \"6EFAF63EFG9FG86\", \"300.0.0.0\", \"36GCEDC.C:4EG89\", \":C:C07:B0234:76\", \"3F9E:98.934FG49\", \"2.5.20.1\", \"34CA.B6CDD75BEG\", \"0.0.0.0\", \"61F703BBAF7AF90\", \"2:AB314.825.582\", \"::/0\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0:0::0:2\", \"0.0.0.0\", \"::\", \"    127.0.0.0    \", \"7A1F6D2D71.01BF\", \"8F453.A868D::BG\", \"::/0\", \"D5G73.3028D.74E\", \"127.2.3.4\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::\", \"::1\", \"6C799B.5ACE81:.\", \"0:9.D1A25637G9B\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"BF33A7.6B:A.1G:\", \"0:0:0:0:0:0:0:1\", \"::\", \"BD464188FE6C2.E\", \"0:0:0:0:0:0:0:1\", \"2DBD4.830E:866D\", \"76954B490:D42F0\", \"4:8E5DE36C31B2D\", \"0:0::0:1\", \"0:0::0:2\", \"C3E2B:28AEF8856\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"1EB55C.0GC4BE.:\", \"127.0.0.0\", \"2.5.6.2\", \"8:G.BFA02C:3F67\", \"2.59.6.2\", \"255.255.255.255\", \"300.0.0.0\", \".71A:62:3462B82\", \"::\", \"2.5.6.2\", \"679.GF9C798DA81\", \"3.00GA4C9A759.9\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0::0:2\", \"0:0:0:0:0:0:0:2\", \"300.0.0.0\", \"BA1796.7C5B3117\", \"D6:37179A5DA11.\", \".9C03DG5.C216EE\", \"GB2459A23C09.F9\", \"0:0:0:0:0:0:0:0\", \"6D1:40E913A:1E6\", \"2F3G09B3DADC1CD\", \"0BE:63D8BCF:D0E\", \"836ED52BG727FF6\", \"789B173629..D91\", \"ECE1:D77EF3109A\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0.0.0.0\", \"69.:78.C4:049C4\", \":::4\", \"127.2.3.4\", \"300.0.0.0\", \"A8FF57GE4851D5B\", \"95C6F952AF563BB\", \"048E427FF8587CG\", \"DA073C5DD8.F949\", \"0.0.0.0\", \"A4:360G35D70E28\", \"::1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"2.5.20.1\", \"192.168.0.1\", \"CCD9E8:AC121.E1\", \":44F:B4F12.BF8A\", \"F3A.85GA2:66CA9\", \"::1\", \"00A4EAG6FC09G89\", \"ADGEFB0119D0.:7\", \"127.2.3.4\", \"0:0::0:2\", \"EFC7GG7G2DA3E3B\", \".02DE82ABE90GGE\", \"0:0::0:2\", \"AB572DF81D2:BAE\", \"2\", \"127.0.0.1\", \"1G490E1.52G3EB4\", \"127.2.3.4\", \"GFAC::C7C.7GA7.\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0.0.0.0\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"G42BG95..2DDA25\", \"1F77983A.15296:\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"841:DC5B9A7A5FE\", \"2.59.6.2\", \"127.0.0.1\", \"2.59.6.2\", \".135ED78E3GC2A4\", \"0:0::0:1\", \"::2\", \"C2A43BD28E50CB:\", \"D439EG::.9F30B8\", \"6FD5C:432703:1E\", \"656GC61EEECACG:\", \"49F.64:7DC73C8.\", \"C05F0..28D5634:\", \"2.59.6.2\", \"::\", \"0:0::0:1\", \"1::2::3\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"027C41F.EG45:2B\", \"2\", \"CD36.E:A1165AB2\", \"2405D4E2FD.09A8\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2.59.6.2\", \"    127.0.0.0    \", \"A34239GB37A750C\", \"CACFB.715.D10CB\", \"C.0B38.7CFA4C82\", \"::\", \"127.2.3.4\", \"5D5G49F0234F.41\", \"860B19CC16E831A\", \"BE0C229A1E.7E50\", \"7DB:CDGA650D.7C\", \"0G7A34A2GE438CA\", \"0:0::0:2\", \"C98:DC7AC18F05:\", \"C7DAG51724.49GF\", \"1::2::3\", \"1::2::3\", \"96A23BA5GG89D49\", \"B:4G4988C:0B:C2\", \"::/0\", \"255.255.255.255\", \"4D2DF7F2A.G:4G7\", \"0:0:0:0:0:0:0:2\", \"::1\", \"2.5.6.2\", \"GAD5G4B1A9FE4F4\", \"    127.0.0.0    \", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"AD59G8081A67F23\", \"255.255.255.255\", \"E276E2CC009731A\", \"43C37:A956G19G4\", \"0:0:0:0:0:0:0:1\", \":CE.7EDF.64C635\", \"35FEF4.F1DE.F5:\", \"2\", \"434G1D2A9.F7F6F\", \"::\", \"1::2::3\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0::0\", \"C5D09:A4F.3CA:6\", \"9298E3FBE7E0AC1\", \"2.5.20.1\", \"64E7AF2EB:.::DE\", \"0.0.0.1234\", \"0::0\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"67A7EC811AAEE20\", \"::\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"3CA:0C5GE4.FGF8\", \"192.168.0.1\", \"0.0.0.0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"80.G55260GE2.EA\", \"0::0\", \"FBC56A835002C37\", \"127.0.0.1\", \"2\", \"0:0:0:0:0:0:0:2\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"255.255.255.255\", \"::\", \"::/0\", \"AG9D7G4CBG3G959\", \"0.0.0.1234\", \"98D.G6C66G8CBDB\", \"23F9B15:B.C6E70\", \":::4\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"712BG64CG93B.29\", \"G.::G2:B1B2E927\", \"0::0\", \"77063C.16FBF34.\", \"C8:DAAEEB3FCAFD\", \"A8D:2G.G.2.1CB6\", \"AD5.052741293C7\", \"5B66.8GCG81E15E\", \"F:D:.A1G:.65:15\", \"2.59.6.2\", \"7395:2EF58.B10E\", \"65ADDEGE:D.5299\", \"0:G124:G:BF9.71\", \"0:0::0:1\", \"1::2::3\", \"57A54::57:1F9B9\", \"2.5.20.1\", \"0.0.0.0\", \"0:0::0:2\", \":316GG8G8F60EF5\", \"192.168.0.1\", \"AGGF76A60CBG485\", \"55DA84292:E4BD0\", \"4G698991B8E2CGB\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"FCF:1971744.CED\", \"30C7BF8A.FF80FD\", \"1.GG:6BCAA:EF04\", \"D.6DB7E39B37E0.\", \"7D::DD9G3673..F\", \"9BD.8F55.7GA22F\", \"::/0\", \"1::2::3\", \"2.5.6.2\", \"0:0:0:0:0:0:0:2\", \"35F131FB704DGFB\", \"E16:5400386GG9D\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"C7.82ECG:35723A\", \"::/0\", \"2.5.6.2\", \"983F3.:1GEB8E75\", \"CE6AEDC53E3:B08\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::\", \"::1\", \"CAC92EA743F927B\", \"0:0::0:2\", \"::/0\", \"880.1F22EEA2D74\", \"6CEFA739:5G7E6:\", \"0:0::0:2\", \"0:0:0:0:0:0:0:1\", \"::/0\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0:0:0:0:0:0:0:1\", \"127.0.0.0\", \"::/0\", \"2:AA:A:98C86644\", \"15:G305G43CF64E\", \":::4\", \"EGG5018F4CB9G1.\", \"192.168.0.1\", \"GDF5GEA2A8:A8G3\", \"BC22D26BD:5A3G0\", \"E58B0C::934C:3B\", \"2\", \"::1\", \"AA:DFF880:4FB:3\", \"0:0:0:0:0:0:0:1\", \"DEG41G:6.4GGE32\", \"BA7EB8B2B45FC69\", \"::\", \"127.0.0.1\", \"2.59.6.2\", \"0:0:0:0:0:0:0:2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::\", \"0:0::0:1\", \"7872D7838910G98\", \"2.5.20.1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"GF832E51A97:6F7\", \"0:0:0:0:0:0:0:2\", \"127.0.0.1\", \"A05CB22:5A.E30:\", \".0C8AF91EC:2950\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"127.0.0.1\", \"    127.0.0.0    \", \"38A4F.221F560FB\", \"::2\", \".0B1CC0D9BG0:08\", \"0:0::0:2\", \"::/0\", \"D6.G13.02D0F7G8\", \"58D6B70D07920F7\", \"255.255.255.255\", \"2.5.6.2\", \"0A5B2D0:5CCB:93\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0:0:0:0:0:0:2\", \"895F4BDA.GBA77A\", \"2.5.6.2\", \"0::0\", \"65B6786GCA:F806\", \"0:0:0:0:0:0:0:2\", \"FB0.0G565A.B018\", \"0.0.0.0\", \"12819G.:600DG63\", \"255.255.255.255\", \"GEF0:D11A494E6D\", \"0:0:0:0:0:0:0:2\", \"06EF138493492FC\", \"1DC2C86A2165:GB\", \"5DB66A990022B13\", \":::4\", \"3B1AA4425:C2C64\", \"300.0.0.0\", \"FC1FBB12C7508E6\", \"::\", \"79896GAGBF.8DEC\", \"300.0.0.0\", \"980FCA9G33CB27B\", \"46600AF3B1E0CD.\", \"192.168.0.1\", \"F9G05CE863183GC\", \"0:0::0:1\", \"192.168.0.1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"E:446F8F6::50CA\", \"7E0.DF4951988CE\", \".27617F8CF0107D\", \"5DC4D7E1G81A95D\", \"CE131BB8CC69CC.\", \"GD.4E56F77A8B1B\", \"5A4G77DBE0676.E\", \"C9C25:0F46.:7BF\", \"FC2D7C.B5C.5682\", \"2.5.6.2\", \"967:EB6D8E3B3D5\", \"::\", \"EDCCDA5:7..A.AF\", \"127.2.3.4\", \"0.0.0.1234\", \"300.0.0.0\", \"1::2::3\", \"0.F0A3DBE17G3A8\", \"424D8A1382BEC3C\", \"127.0.0.0\", \"13A0GFE99:C7AAG\", \"2.59.6.2\", \"5285A366595AEG9\", \"56A11B6AF0F.41:\", \":90B6A964:50:.G\", \"0::0\", \"697BFEC0153.05D\", \"1::2::3\", \".8CC5516.7281.9\", \"::\", \"1A83.35C906G6AE\", \"A.FCC67C623F02A\", \"8:B79A54B2G5A89\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"D94.8:84G96C26C\", \"192.168.0.1\", \"::\", \"7F:CGE.GBA6::GB\", \"300.0.0.0\", \"0.0.0.1234\", \"9E1378CG4E2DCGA\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"429.C29C6972247\", \"0::0\", \"48.60:D.2438221\", \"2.59.6.2\", \"D7DG5A75790ACG8\", \"0:0:0:0:0:0:0:1\", \"10C44BF:E97B1F1\", \"127.0.0.1\", \"2.5.20.1\", \"300.0.0.0\", \"127.0.0.0\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::1\", \"    127.0.0.0    \", \"127.0.0.0\", \"0:0:0:0:0:0:0:0\", \"26F117E7E1DG9E8\", \"CDFE.387746:68G\", \".AB2C0C42G75E08\", \"9.85AF1065219C9\", \"7DF5B5GBF345814\", \"0::0\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"127.0.0.0\", \"2\", \"2.5.6.2\", \"3E9B374C.GDB76.\", \"9:21A3DA3:0D6:D\", \"::1\", \"::1\", \"GCA1B7CCFE374A9\", \"    127.0.0.0    \", \"0:0:0:0:0:0:0:1\", \":A60D:BD33D87E5\", \"127.0.0.1\", \"2\", \"6GEGDB7:GG:.E59\", \"255.255.255.255\", \"2.5.6.2\", \"B1A5B63G4ECC:G5\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"::\", \"    127.0.0.0    \", \":::4\", \"288F.:CG1A68.0F\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"19FGD56DF.135D6\", \"CGGBEE661CGB7AD\", \"DD12088A8B5227C\", \":B0999D2.775ACE\", \"::2\", \"5C73DEC87106FC0\", \"2A059AF2AF8B:D:\", \"7185:B04479G477\", \"72A5.AB557C.246\", \"4DDD7B89G8CAD64\", \"AA88352E2BG117G\", \"88805680595G0A.\", \"58B669FB4B.75GD\", \"::\", \"192.168.0.1\", \"0:0:0:0:0:0:0:0\", \"92515A3.DG82A45\", \":7996:0C:GDA8FB\", \"C7F0A9BB47:1A7C\", \"GD443956F82C:9B\", \"9A3DFAE.B3:.B9C\", \"1::2::3\", \"1::2::3\", \"    127.0.0.0    \", \"192.168.0.1\", \"0.0.0.0\", \"0:0:0:0:0:0:0:1\", \"371542A369EGG7C\", \"127.0.0.0\", \"F30D2CCC02E8F:C\", \"0:0:0:0:0:0:0:2\", \"0.0.0.1234\", \"1D71AE08E171E14\", \"DBE3GFG9084DDB0\", \"192.168.0.1\", \"0:0:0:0:0:0:0:2\", \"300.0.0.0\", \"0:0:0:0:0:0:0:1\", \"0F71E1A70C1G:E8\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"::\", \"3EAG3:47G:A81B5\", \"1GEE2C78A9C328F\", \"AA8DFD18E918GC1\", \"F8EFE85B2B3GGG.\", \"3BCB..A.2E7B:42\", \"127.0.0.0\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0.0.0.1234\", \"4C:9:B3D99ED970\", \"2GB7D31CBD4FD85\", \"0.0.0.0\", \"0:0:0:0:0:0:0:1\", \"A0734.1G:0A54.C\", \"::1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"::/0\", \"::/0\", \"652E747:B67A9D6\", \"5GFFF6F9B4.171F\", \"4D8A8388F86CCAD\", \"0:0:0:0:0:0:0:2\", \"127.0.0.1\", \"::/0\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \":::4\", \"5A78DC1D05FA1B:\", \"127.0.0.1\", \"G.7GC4:0080EG7F\", \"0.0.0.1234\", \"0:0::0:2\", \"022F9F9G44FB9F5\", \"62..56.A2BFC41:\", \"3AG75:5FC3E7357\", \":.138C9:8B1.155\", \"8EE82:2B59E9C.7\", \"127.0.0.1\", \"0:0::0:2\", \"0::0\", \"4D9441769B:.2D6\", \"CC.E.431B033FEC\", \"0:0:0:0:0:0:0:2\", \"0:0:0:0:0:0:0:1\", \"3A6:A3039F939B8\", \"0.0.0.1234\", \"0:0:0:0:0:0:0:2\", \"2.5.20.1\", \"0:0:0:0:0:0:0:1\", \"D2DDB55.66DGB.1\", \"2.59.6.2\", \"0:0::0:1\", \"127.0.0.1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0:0::0:1\", \"192.168.0.1\", \":::4\", \"BEE110.9CAGB.E1\", \"::\", \":A8G5B6..2CGE24\", \"::\", \"127.2.3.4\", \"6E.8398:23:11:D\", \"::\", \"127.0.0.1\", \"0::0\", \"::\", \"3ED03E.0F16B442\", \"0.0.0.1234\", \"CFGE7211F93B017\", \"E4506E07E1D2G3B\", \"300.0.0.0\", \"D:F8.E75E:9FD46\", \"DBAF8A.B8:E:A.2\", \"D456.12F.BA34D6\", \"0:0:0:0:0:0:0:2\", \"GBB6EAB:0A5CG0A\", \"A3GF8F6.:20BG89\", \"70E1C7399BE5F0.\", \"0.0.0.1234\", \"G.BF99:1B146.03\", \"15:8BE:47190508\", \"5.GF7D5C5C4FG18\", \"0:0:0:0:0:0:0:2\", \"::\", \"BCF8C:0DE5C94E1\", \"57ACC5D:3GG25A2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \":::4\", \"9C5GE46.6D.502G\", \"::61.A3:399C.E:\", \"F5EDG7E:G508EF1\", \"::\", \":DCC:4561589DB5\", \"9FF5321:33AGFA4\", \"0:0:0:0:0:0:0:2\", \"71ADB906F32BD7A\", \":F5D60AC7:8.EA5\", \"0:0::0:2\", \"068B8.FC38BEB:7\", \"    127.0.0.0    \", \"2C250BBD:1:97:2\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"G21EB65C7:11:.B\", \"B8:.852A.EA4C5G\", \"0:0::0:2\", \"G675:.BA.BB.341\", \"DC.:E6226.F0730\", \"49504G42G5B:G6.\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"87B94E59G6GC3FF\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"3B9A01352B9E75.\", \"::/0\", \"B345599E43C.A4D\", \"192.168.0.1\", \"C:60EF719CB.EB9\", \"2.5.20.1\", \"7870864GG54.7C8\", \"G0BA9264:89G296\", \"255.255.255.255\", \"656E4EA:CAG1:2:\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"E50D0CAC3G:4B85\", \":2D.59.88A6E164\", \"::\", \"3EEF9D4C6629A70\", \"F1E2CD6GE:8326D\", \"E30C485AC7DG874\", \"127.0.0.0\", \"127.0.0.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2.5.20.1\", \"A:297B5E9AG10CB\", \"    127.0.0.0    \", \"0:0:0:0:0:0:0:2\", \"0FEA315600D067B\", \"FGF1D1F:3:1A59G\", \"300.0.0.0\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"80E3DA7G20:83GB\", \"127.2.3.4\", \"1::2::3\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"A5658A986.7D42D\", \"4.7BCF9516.:95:\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"43.F96GE354229D\", \":::4\", \".F:E3.E2C8D9CGE\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"19:841.FCDG77DG\", \"9::GEB..28A.:1B\", \"ADEG9GAA197EEFG\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0:0:0:0:0:0:0:0\", \".C94G4.5FG4.2G8\", \".77GB10G364DE68\", \":03676E53D.65D4\", \"17ADBA6E682:812\", \"127.0.0.0\", \"90C9:.257..FCB6\", \"::2\", \"127.0.0.1\", \"G:4D3.E6F596F.E\", \"5.A78B5B16A2AC:\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"9:B1GDDBF:BC60G\", \"3DADA4719D12C8A\", \"7F2F.G.DD1:42BF\", \"2AD98E0.A5945CC\", \"0:0:0:0:0:0:0:0\", \":4:A14.25BG01:3\", \".CD:.9.5FF69DE:\", \":DED13B41D6F3EG\", \"B2AAA3C5.4B.B8:\", \"4.G1CB:EF7F9E8:\", \"13:G1A4AEC3:695\", \"192.168.0.1\", \"300.0.0.0\", \"5.B17:B1G4F2GA2\", \"GEA6A:4DCCE3.C5\", \"0.0.0.0\", \"2.5.6.2\", \"::2\", \"0.0.0.1234\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"7FFB16346C1FCA0\", \"2.59.6.2\", \"::2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0E716C3F4EE18:B\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"127.0.0.1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"135DA:88D.F7G81\", \"G35BDF500BC1B6:\", \"2FE9205.081C0B.\", \"F7D6G2F9G99AD64\", \"0:0:0:0:0:0:0:0\", \"255.255.255.255\", \"::2\", \"8DGD8A.4:B:6A40\", \"03B505EF2FE28BG\", \"B52C2E66BGA6:99\", \"255.255.255.255\", \"0:0:0:0:0:0:0:1\", \"D5:0..39180C92G\", \"1.4.F74EG5895DE\", \":56F9GD1300:E5C\", \"981CE236D6B6DA3\", \"549A46508D46EGD\", \"0:0:0:0:0:0:0:0\", \"127.0.0.1\", \"E60E761CA102C83\", \"9E24388AG281D7G\", \"9A74G0E3E67D49A\", \"0:0:0:0:0:0:0:2\", \"0.0.0.0\", \"::\", \"1::2::3\", \"2E:DF3FC66:560E\", \"0:0::0:1\", \"4181AB.7FE59G9E\", \"::/0\", \"3CG.99170G6419D\", \"4234B769E.0G1G0\", \"A0.6A0DDG3:DAA4\", \"1B.074G20A5D:9A\", \"1A:9GC.GGB52:0C\", \"0::0\", \"2.5.6.2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::2\", \"2.5.6.2\", \"0.0.0.0\", \"::2\", \"DB509A5E.32D:CF\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"::1\", \"E7B3D0D7847G02:\", \"C3:3G04674C1.F2\", \"1::2::3\", \"CA9A1CF7D:A5CC0\", \"3A6..A4DA23A536\", \"0:0:0:0:0:0:0:1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"5:0E:B5574:6DDD\", \"0:0:0:0:0:0:0:1\", \"0:0:0:0:0:0:0:0\", \"2.5.20.1\", \"69CDD888CD:3EGA\", \"1::2::3\", \"::/0\", \"127.0.0.1\", \"98735E55F8F:012\", \"127.2.3.4\", \":D5GA2B271D9186\", \"81667:E2:GG6225\", \"0:0::0:2\", \"8218:.F76.9B196\", \"G8E1070D8.9EB8F\", \"E0:A2DAFB5447:G\", \"192.168.0.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"FA98C750C.7D818\", \"E.B01.2CC57B.45\", \"974A:AG8GE91FE9\", \"8A3EG1226CEB7:G\", \"255.255.255.255\", \"6EGBG9.985.5BG9\", \"0::0\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"FBFD308805FF56B\", \"0C93483581A110A\", \"::/0\", \"300.0.0.0\", \"9BD9.0A528:CBC6\", \"2144E34D4G9C9.D\", \"2.5.6.2\", \"GA3F7G658EBGB33\", \"0.0.0.1234\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"A893B1D28DBD9BG\", \"0E3F06G:EB48590\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"873CCFCAB:EFA::\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0:0::0:1\", \".GB:96734D4DB1.\", \"82C8BB433G45D96\", \"4..15346.DE4A21\", \"0:0::0:2\", \"842BC43C:28G24F\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"127.0.0.0\", \"::1\", \"23E5D77792D5CEE\", \"15C:4.E90873717\", \"6:44CBCDD28623A\", \"6G19.18.8C:7:.F\", \"::1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0:0:0:0:0:0:0:0\", \"1::2::3\", \"9E7E27.327.77A5\", \":0.933G442:E5B.\", \"1::2::3\", \"::/0\", \":::4\", \"    127.0.0.0    \", \"9B:6D53432AA.9A\", \"0:E7312F70D23::\", \"30BF6D231B:.8:4\", \"C39167:2FAG11D5\", \"::1\", \"0:0:0:0:0:0:0:1\", \"::\", \"D547:551F96AF4F\", \"F:4.9B9BAB70.D7\", \"::2\", \"7F82B0A08D241GG\", \"7D1:5AE4E5A1G:9\", \"3.D88GEBB2AB0.1\", \"2\", \"192.168.0.1\", \"127.2.3.4\", \"192.168.0.1\", \"46.031:0E88662F\", \"05FDED6DEC2FAE:\", \"2.5.6.2\", \"F85F1D33BAE209D\", \"::1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"AC50AD503G2A1F2\", \"12::F310.EA96CG\", \"1.3F6A96437AG09\", \"4B:B.261037CA12\", \"0:0::0:2\", \"1D1B63F8.D:0:82\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0:0:0:0:0:0:1\", \"77900G6F48:DC.:\", \"F7434E7C83:9360\", \"118G9B.2E2.376B\", \"42F84403:5A1.00\", \"93.423G4.60656D\", \"14BFF:9E:D6FB6:\", \"2A:0AF04.84DEB6\", \"0:0::0:2\", \"21C7G.83C65:6DF\", \"::1\", \"4D7.GFB63C5G6.E\", \":644EF:0G.08:1A\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"127.0.0.1\", \"90.8B1187E5:351\", \"A5E4870DAC22A61\", \"0:0::0:2\", \"    127.0.0.0    \", \"B5C134:GG00:G..\", \"05101FC046FAD6E\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"E8F67GB8F7.G03B\", \"D49C824F41C.69C\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \":G.BB.A:21BF9:6\", \"127.0.0.1\", \"6309:.657AC9:88\", \"C9CA:394.AGA81G\", \"95:G9EF7G9ED98E\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"9GDFBD76B.EF9:0\", \"127.2.3.4\", \".FAG9684183.8E5\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"F.F2F9BA2:1D80:\", \"1A34G62F815:AA8\", \"F699G90239GG0A6\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"    127.0.0.0    \", \"0.0.0.0\", \"D61F15896:G3B49\", \"2G11A8FA:3B348B\", \"C.A2B6GF9CA24D:\", \"GGDE5BC0205DGA6\", \"3CF:E184:F0B0BD\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0:0:0:0:0:0:0:2\", \"9E5A32B7AD1D:8B\", \"B36G4D49FFG8850\", \"4FAC19:72E6:6E6\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0:0:0:0:0:0:0\", \"6G11C.910.B50CE\", \"4:27:F0G3.D:ABA\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"C04926:E:9FGB58\", \"1::2::3\", \"0:0:0:0:0:0:0:0\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"D5618F92D3F5483\", \"B604D2.24BFF0C3\", \"7G9595C14B:7959\", \"192.168.0.1\", \"6D.A2A338175B6:\", \"8C.191A0235ED09\", \"127.0.0.0\", \"G93E40B1C3:.G10\", \"::1\", \"GF409.1D7AGCDDA\", \"AB79908C516A3D6\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"465ED32AAFCB3C.\", \"::1\", \"1G::B86.C780.70\", \"DA8.2FED60.4523\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"127.0.0.0\", \"0:0::0:1\", \":9E3F770408DDFA\", \"    127.0.0.0    \", \"957A6038.490ED.\", \"::/0\", \"9A268E86190AG2A\", \"2.5.6.2\", \"::\", \"7429C839AC7DD77\", \"::1\", \"127.0.0.1\", \"::2\", \"0.0.0.0\", \"27052D5DC2D2G72\", \"A8E8:A935761C02\", \"255.255.255.255\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"2E7FE8FCA:817CE\", \"F5AF8.1383A37FB\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2.59.6.2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"4F456D8CCF57:DF\", \"2\", \"75A53.42F88CG81\", \"6EAF6.G51G3A0CF\", \"0:0::0:2\", \"B5E32F920B.2C85\", \"05E9F11DEAG5E3F\", \"0:0:0:0:0:0:0:1\", \"127.2.3.4\", \"255.255.255.255\", \"5B100624...ECG9\", \"127.0.0.1\", \"B:60CD:6A:.CEG6\", \".:5C.03344FFA53\", \"89F2F0D33C46:FB\", \"2.5.20.1\", \"9E6C9F8BGAEC4B.\", \"0:0:0:0:0:0:0:2\", \"35:B68600E45G1:\", \"DD:A32G93DBA..6\", \"BD134E:G.7574E5\", \"2.5.20.1\", \"226D6353AA128BD\", \"2.59.6.2\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"8E101CA:ED:1:GD\", \"67:ED84E0CC6623\", \"52FAC:A..4B2CGD\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"5AF8F815CD1475.\", \"D3:35BE2B898GEF\", \"7G81D0D78491F90\", \"EF055G36.438D:A\", \"G9D2D0E.6B2EE24\", \":6FD5BCG88B596E\", \"127.0.0.1\", \"4C5:06.67180B09\", \"0.0.0.0\", \"3D51144A0G90C7F\", \"0:0:0:0:0:0:0:1\", \"::/0\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"255.255.255.255\", \"620.C.2C:960B3G\", \"FF:1:41BG148BAA\", \":AAA485..713A2B\", \"0:0::0:2\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0:0::0:1\", \"DC1BA0ECA8344:5\", \"1G36FDDD.0.0880\", \"127.2.3.4\", \"CFB:F.FA9:3DF34\", \"72EB975747.8G79\", \"8.A0043B13D:342\", \"C2D623GG35G3EFD\", \"255.255.255.255\", \"724615251.86506\", \"C4G7DGED5G760G0\", \"DD06G91F62BB9CF\", \"    127.0.0.0    \", \"69.497.1DF4E.79\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"B20G8846GG.3F33\", \"0:0::0:2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"127.2.3.4\", \"79EEF9:G89D.48C\", \"2A:4.8:C18A343B\", \"D745941F3F:C.E8\", \"EEB17BDADDB990:\", \".48FE4.2F67G436\", \"::2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::1\", \"79066F5B4G999C.\", \"::7269F239A84F6\", \"255.255.255.255\", \"127.0.0.1\", \"86D.C5CF7.3G669\", \"DDF:87AG345D:68\", \"8EBE181F56D0.F5\", \"127.0.0.0\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"9BFA8:B.AA37F22\", \"9::GE10GB8:D693\", \"33800.C:.4A0E32\", \"4CA922313EDB04D\", \"    127.0.0.0    \", \"1661F:A8C4E1C68\", \"7D0EGD8F9D6ED7A\", \"0:0::0:1\", \"    127.0.0.0    \", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"127.0.0.1\", \"127.0.0.1\", \":FE66G15021:GD5\", \"272AB1040FA.B3C\", \"8.C.38F05DAC.E0\", \"EFG5EFD.::0343G\", \"::\", \"300.0.0.0\", \"1A42GA82E1.681.\", \"2.59.6.2\", \"::1\", \"255.255.255.255\", \"B4E255:A3649588\", \"    127.0.0.0    \", \"2\", \"861.79DEC17A9F5\", \"::\", \"0.0.0.0\", \"15:4B3E93AACBD9\", \"BG20E8984::87.5\", \"27067:110F:1::G\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2:33A4AA77:G5DC\", \"CB6D015EB.D2A7D\", \"62A0FE31F035:11\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"::1\", \"189A11BG30.E7C0\", \"192.168.0.1\", \"01.C1G5E3C2ED28\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"127.2.3.4\", \"300.0.0.0\", \"E0GBB2B05.GC29E\", \"::/0\", \"51C:17A.64769AG\", \"255.255.255.255\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"FG6A63707C82B3G\", \"C22937C4EE:00.D\", \"::1\", \"AD401BCB0ACGG8F\", \"8G33:FA9059C.DD\", \"300.0.0.0\", \"819459.F2D68A45\", \"89F14:DF2G37.42\", \"3BA79:DBC0E:86.\", \"FA42:FD:87CAC.3\", \"0:0:0:0:0:0:0:2\", \"0:0:0:0:0:0:0:0\", \"44:3E9FFDE13:G1\", \"8.0A01GD7BEC67D\", \"::\", \"9460G3CBEG34650\", \"0:0::0:2\", \"A9.41:A4:BFF::D\", \"::\", \"GDG.EF5F8.E6708\", \"0:0:0:0:0:0:0:0\", \"F3ACC3B3.58E52B\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"9E:738:7A7BD345\", \":::4\", \"127.2.3.4\", \"BAB2GD16FDE:B05\", \"BC4AG.0256.86:C\", \"0.0.0.1234\", \"::/0\", \"127.0.0.1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"2AD3.9.0A64D:6B\", \"G54GF17AEFAE.EE\", \"BBA0:5BFA4G13G9\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"::2\", \"0.0.0.1234\", \"E0G29B5:D43C.51\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0F305G65CDFGC34\", \"0B7F87.8E08231F\", \"0:0::0:1\", \"0BFE025GF53:G61\", \"::/0\", \"1.15A4C9:2F223.\", \".5G468E531036.F\", \"::\", \"2.5.6.2\", \"0:0:0:0:0:0:0:0\", \"C5DC5EG295C0EA0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"127.0.0.1\", \":6569E3179DA917\", \"127.0.0.0\", \"46893:362EB7E:2\", \"9A.BA.1F18FCG70\", \"2DE13980:2A09A0\", \"C4.4DA51B9:4GE9\", \"G272.A.:GG2C1BE\", \"1::2::3\", \":G3.:EG9G13.1GE\", \"0.0.0.0\", \":A..9.F:D72G71C\", \"D1F3CFFFFF1C5DA\", \"CG95A18D7904103\", \"0::0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2.5.20.1\", \"2.5.20.1\", \"644E316928C3.A9\", \"95C5FA18.3A5:A:\", \"16AB6AC69E74804\", \"A6969GA73BA47A1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2.5.20.1\", \"5B2613.0C23:CC7\", \"2.5.6.2\", \"3E02G704A275142\", \"0.0.0.1234\", \"A24A283E796E434\", \"5.2C49:490298BE\", \"C4839CC63EAF665\", \"::2\", \"1:.ADBC:7GA35A8\", \".BDC9:F02.14.:E\", \"03FG60.66ED46B1\", \"790FE8C:7:F:393\", \"GCD.C.B05..G..G\", \"127.2.3.4\", \":::4\", \"551B7CB03.431.G\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"127.0.0.1\", \"192.168.0.1\", \"75B0G185FC72.73\", \"1::2::3\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \".CAFF0.344GD3:G\", \"::\", \"0.0.0.0\", \"255.255.255.255\", \"C94B7EE02F2B488\", \"59.CE7:D4D84416\", \"192.168.0.1\", \"::2\", \"1E2D.3BF:C101.9\", \"G.B6FC0EA598438\", \"BE91DE8101.CACE\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"::\", \"54F3D44B9:57.CG\", \"0.0.0.0\", \"0:0:0:0:0:0:0:1\", \"::2\", \"0A9.DG6F5:79FBB\", \"FDC4EG2AF80046C\", \"1C3D5936G8G620B\", \"::\", \"108A0271561.FAA\", \"B3:CAC0E791D2D7\", \"283FGB0BC791:.2\", \"127.0.0.1\", \":::4\", \"192.168.0.1\", \"127.2.3.4\", \"2.59.6.2\", \"0D.562AB4:A5DG.\", \"B53324E916:E.23\", \"2.59.6.2\", \"0:0:0:0:0:0:0:2\", \"300.0.0.0\", \"AF971D5:6D4032.\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"04285B4.6792294\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"2.5.6.2\", \"52:02F3:24C9F1B\", \"2\", \"0:0:0:0:0:0:0:0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0:0:0:0:0:0:0:1\", \"CG7G:A4ACDB700E\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"127.0.0.0\", \":::4\", \"GD81900AB1.A4CB\", \"57G78A36GG3B6F4\", \"7D:EF9.:273E180\", \"FC4G5B5ABGF40A6\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"3..23CD2B:8CF1C\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"CG:833G:1716406\", \"2:35:D4C1303DBD\", \"::2\", \"AC050B.402250GF\", \"192.168.0.1\", \"D2DC6F:C80516G1\", \"0::0\", \"0.0.0.1234\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"127.0.0.1\", \":072:8:3GA.E:2C\", \"GAC:003DA9F979G\", \"255.255.255.255\", \"0.0.0.0\", \"35DC27GD62CEG4.\", \"E626B4FG8C4EAFA\", \"127.0.0.1\", \"3G3::E52196FA4B\", \"B748BD7E7A24B:F\", \"0.0.0.0\", \"CD278D.97A21239\", \"0.0.0.1234\", \"300.0.0.0\", \"0:0::0:1\", \"3G6103:.81GG2:0\", \"A:7G96EF38.D710\", \"2A3.0GC1F1GE96C\", \"2F32:9G0618E1F6\", \"GD1G488.B539204\", \"::\", \"2.5.6.2\", \"0.0.0.1234\", \"192.168.0.1\", \"::2\", \":945F:6E:95G6G4\", \"0:0:0:0:0:0:0:0\", \"71.76EG.D3FEC82\", \"::/0\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2.59.6.2\", \"1G25941DD3:677F\", \".76BAEEC7:26ED5\", \"85GAC834GA4D7A1\", \"57015EA2AF22688\", \"9.602G2:6.99256\", \"1F51GDAA.3FBD86\", \"BCCB.A73F.G8G:E\", \"43B:50287AC6A:G\", \"674BE9EE:744957\", \"::\", \"2\", \"8CD0.A11E504.91\", \"2.5.20.1\", \"::2\", \"0:0:0:0:0:0:0:0\", \".4EC01G81ADBC:B\", \"2.5.6.2\", \"AF0DCG3817:A2FD\", \"962D7:D0.B399.:\", \"0::0\", \"::1\", \"2.5.6.2\", \"::2\", \"127.0.0.1\", \"2.59.6.2\", \"9794DC.ABBAG65.\", \"337FG7180D2.8EC\", \"877E9E5C32F::24\", \"A5F.435614FC2AC\", \"47F422524077B:4\", \"::/0\", \"7:FG:67E:D6.EF.\", \"255.255.255.255\", \"D99.593GB9F89F9\", \"0:0::0:2\", \"2.5.6.2\", \"C19:0B4DFDCB:A:\", \"5:8DB29FED0:2G7\", \"3ED4G5C:442.8FC\", \"0.0.0.1234\", \".2C931G399CC9E:\", \"2.5.20.1\", \"EBD6F14DFEA0BB6\", \"::\", \"    127.0.0.0    \", \"C.6B222FG:6G31D\", \":7E1B8A58E96FEB\", \"255.255.255.255\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"EC45F5D043.0AAD\", \"6C.:7AGCD5.5022\", \"4G612FG.0496F42\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0.0.0.1234\", \"9BE27ACA815C25G\", \"2:A43763A78G224\", \"::2\", \":::4\", \"CBAG7.4EB93C3E2\", \"4CE4GGCECA3GE.B\", \"B5ED58GEE2.AG2B\", \"BD5880GGF5BG8FA\", \"1BFA593F6D30D95\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::\", \"::1\", \"192.168.0.1\", \"D0G.C9D:17D62B9\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"1::2::3\", \"G95850:4697CG.1\", \"255.255.255.255\", \"F527E18A1E2A9:3\", \"8D85A8CA274B:8D\", \"B51C3:GC3FB:3:7\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"GBF0GBE0A0:7353\", \"2G7F7E7C1C:CAD1\", \"A9AC.69:F07438.\", \"F9:GB1AC:0A7D79\", \"127.2.3.4\", \".9.D272E9EED92F\", \"AE07859E5D6300.\", \"6466EG1202C9GDE\", \".A65DA24:4.6117\", \"127.0.0.1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"DDA3:GGD8CF4AD:\", \"127.2.3.4\", \"5GA15.3FBGG.:7B\", \"FA:295.BC7C0.45\", \"282F95BF.E5A136\", \"G87G364D94148E2\", \"2D1::52F.49D..2\", \"BGFA9CA4C4GFA02\", \"0.0.0.0\", \"4.A67.C212732F1\", \"::\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0:0::0:1\", \"192.168.0.1\", \"C3:F3GF75G74EDB\", \"0:0:0:0:0:0:0:2\", \"0:0:0:0:0:0:0:0\", \"2879D1.CGD2A362\", \"1::2::3\", \"DFD32..8B3692B5\", \"38F.8:235559:1A\", \"4E.3B.BC3523F.8\", \"2\", \"8E5E:C7730BGD2F\", \"5.6204E902B.A5A\", \"0:0::0:1\", \"C1.BAD45125DE.1\", \"4AC03:9:GD7G326\", \"A0AC4D.46FFAE19\", \"127.0.0.1\", \"2.0:791E8918A48\", \"0.0.0.1234\", \"2.5.6.2\", \"2.5.20.1\", \"DD.:7.B.C86B41C\", \"C3E70.AF83AA1B.\", \"::/0\", \"::2\", \"2\", \"2\", \"3B646E0E:C0941E\", \":60GA54G97FB03C\", \"EC2C.8961E2GA70\", \"C28994G730:D3.5\", \"127.0.0.0\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"2\", \"74D0A5D16DG3A2D\", \"B6EG.A30DB663CE\", \"87D.8:EFC77F135\", \"419G9F0A365::9A\", \"0:0::0:2\", \"::/0\", \"6A:.0221FCFB378\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \".931DF.12A74F09\", \"5G4E17A9DG142FC\", \"FG52E85GCFCAGF.\", \"2..8837ADGF1336\", \"::1\", \"127.2.3.4\", \":::4\", \"C:0163.D3784..2\", \".3:4G52D6045D0E\", \"255.255.255.255\", \"::1\", \":795.55.9F:1E0.\", \":::4\", \"1::2::3\", \"1::2::3\", \"0:0::0:2\", \"127.0.0.0\", \"GBF4C810C9C46C7\", \":BE8:E12E60DAC3\", \"0.0.0.1234\", \"FF36967GGDFFAA3\", \"65B0C8DDBGA3102\", \"127.0.0.1\", \"3.B9B2GEEABGFBD\", \"76CC7B8576649G8\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"395262A9G:4406.\", \"8DC8:B850:B4:09\", \":DFF112.8GD659C\", \"DEFC64D1:.9..3:\", \"E50632GA1FD9:5E\", \"3E8G3E26B.E54:0\", \"5E93BBD79C0..G2\", \"05436BA44249E7C\", \"192.168.0.1\", \"0.0.0.0\", \"5E54BC1CBEE5E20\", \"ED7GFGG1844DAEB\", \":::4\", \"EE3F6AFAF:6FGEC\", \"2FE2:607CFDC588\", \"G.B225908EDDAD6\", \"01048790E8GFD6.\", \"2\", \"77E.C0:958:22FF\", \"BD1:D55AGC:F3BA\", \"FA0363GDD6120EG\", \"DF:DFD90682::FE\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"A1.5F667AC81EG8\", \"6F..CE4.9AGAD90\", \"2\", \"DG7:0066G28:G9D\", \"F8::E69C81A..74\", \"0.0.0.1234\", \"E7F9E67092464E2\", \"2.5.20.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"AF1:7575259FE4C\", \"2\", \"300.0.0.0\", \"8C7F2.E3G423G9B\", \"0AAG2D7B:.2E.A7\", \"1D30E24C5077277\", \"0:0:0:0:0:0:0:1\", \"939AFB8D22:E5A2\", \":74F56GAE39E28.\", \":::4\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"7C3.820228DF97G\", \":058B64G1:0:4BE\", \"2\", \"E03C857E:7A:834\", \"G0.12:4138EC827\", \"2DG:C62AE6:7031\", \"C520362.1BA:5GD\", \"C7D.DF:2B26D582\", \".BFC466F6GB.232\", \"FD583491637C71D\", \"394D4BB76B8FE.:\", \":FCB1F5AAC9B1AE\", \"0:0:0:0:0:0:0:1\", \"255.255.255.255\", \"0.0.0.0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"6A7G:7C759336A2\", \"::/0\", \"0:0::0:2\", \"2.59.6.2\", \"192.168.0.1\", \"ADD..A0F69:5.26\", \":050F508GA80601\", \"DA510:49G:C.C3B\", \":::4\", \"::\", \"0::0\", \"7.9770F7836E437\", \"611.A0F6AF062E.\", \"::2\", \"127.0.0.1\", \"300.0.0.0\", \"2.B201:D67..2D7\", \"E.G3713E18484CF\", \"::\", \"127.2.3.4\", \".80EA842E6F0035\", \"    127.0.0.0    \", \":64DC6586A17726\", \"0:0::0:2\", \"127.2.3.4\", \"2.5.20.1\", \"09482D:7AFEDF0D\", \"192.168.0.1\", \"88GB8B8134C86EF\", \"2.5.20.1\", \"1A:FA509B123925\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"31.3D847FEA8757\", \"FDD73FAGG2DBD.3\", \"A92B5GAD279CC0F\", \"FE32.:.62770:50\", \"57499G56E:59A6:\", \"B.G01F9G4458DC9\", \"31C:F92014:C6B1\", \"89A22F7A0770664\", \"237B:3E:G.6C97:\", \"2.5.20.1\", \"C668F.3AGEAB00E\", \"4.9F2E:A45G9ADB\", \"::1\", \"::/0\", \"0.0.0.0\", \":39B0D43G.26A57\", \"7576C.0EF2:6DD2\", \"::\", \".6B45F6627E228A\", \"333B32F83829FBE\", \"192.168.0.1\", \":45714F.6A48C96\", \"255.255.255.255\", \"G884D6.734371.7\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \".990729D4BE86A2\", \"0:0::0:2\", \"652F020D10:8EEC\", \"GEC3955A:B:CG8E\", \"0:0:0:0:0:0:0:2\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"7.3CB:.D.FF9073\", \"6B.CGA04E1B.BF9\", \".:G45.D949C7A92\", \"ADBDC407162:89C\", \"841:BFB:277FCC0\", \"ACG7E80G5013F3F\", \"92B.5B9FF40F2CC\", \"0.0.0.0\", \"::\", \"4:60GF5GE097AF:\", \".B:163:0C9103C1\", \"53EG28DCFA.F..8\", \"127.0.0.1\", \"68756345186:G7C\", \"CB6539GD08E3D9C\", \"90BF2C6G95442F:\", \"    127.0.0.0    \", \"255.255.255.255\", \"2D01:3F8938.42:\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0::0\", \"0.0.0.0\", \"0:0:0:0:0:0:0:0\", \"2781369CE9285F:\", \"    127.0.0.0    \", \"::\", \"0:0:0:0:0:0:0:1\", \".8.87A0B92BD8C8\", \"::\", \"947.B.0D:41FD09\", \"4GG:19.E3ADFF5B\", \":D19:.:A1463CF2\", \".CB:F..2BE07E7F\", \"::\", \"7EE72728E6B5DF3\", \"9E9DC381440CG84\", \"0.0.0.1234\", \"0::0\", \"2.59.6.2\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \":F77D78DFEC9163\", \"4ED58567G.EBD31\", \"CF35AAGD746AG5G\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \".E2.DG97AG.56GF\", \"6B958A8:3FA:B8F\", \"300.0.0.0\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0::0:2\", \"23C936112816599\", \"5DG:A248DE72932\", \":C1G20D76BF2B73\", \"0:0::0:2\", \"F8GEA53D51AB3B9\", \"752G386BBE206:D\", \"0B9CGE2A4D3864A\", \"E0:BC:A8381D:.A\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0.D6DEGBC12CBEA\", \"2.5.20.1\", \"3D6:A0C4BBDGF99\", \"0:0::0:2\", \"CA46C.6.69G773A\", \":::4\", \"62D17G39AG45.AC\", \"D1.BBE7D:EF32::\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"G0B59BD73927045\", \"127.2.3.4\", \":DAA:7.2FF3:G26\", \"5GDBDC63D208FE1\", \"5584:F5BED418AC\", \"38FG5F:FACBF4GC\", \"0.0.0.1234\", \"::1\", \"C6657.9885345BA\", \":::4\", \"D6.DC.2GDC0728.\", \"9A30B48413D3C88\", \"127.0.0.0\", \":GC8G.:9GE1FDC2\", \"C7A6GC7AEDAC1:A\", \"G3G8:A7D545DB10\", \"98514E8C751:4:9\", \"1FED:09:A85:876\", \"53DCAC84C687DD:\", \"127.0.0.1\", \"0:0::0:2\", \"2GD9FD0CG1925:8\", \"0:0:0:0:0:0:0:2\", \"::1\", \"G85G41B574D:8:5\", \"4212D:ADF.DD61:\", \"::1\", \"24:.G82991E2EAG\", \"A3.2A8G3EEDD17A\", \"::2\", \"57FAGC:A5GB1C58\", \"300.0.0.0\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"4C64B2B416CBAEC\", \"A.E54028BG6B8DA\", \"127.0.0.1\", \"B754F.FF7BFA16F\", \"2\", \"54CA2G::B1068E1\", \"57F5167A0A2GB8.\", \"B35566204.D6:F:\", \"192.168.0.1\", \"6:B.0F8:G92BFF.\", \"::1\", \"127.2.3.4\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2.5.6.2\", \"284B0D638.:EC6B\", \"0897464:FB19D9.\", \"0::0\", \"8B:FA99D704FD7.\", \"519A6.4:CA4.A.B\", \"35C59534C.B96A7\", \"9:0A3C77.3CC986\", \"C6E13DB22BDE1DB\", \"G3D7G1559A3E0C8\", \"668236918ECF364\", \"127.0.0.1\", \"868E3D66A2:F22B\", \":08BG9A806CCCE1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0:0:0:0:0:0:0:1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2.5.20.1\", \"DGEA7A6GF0GB190\", \"DGE3FG7023:.D:0\", \"400BB56F37462G0\", \"8B6CFF:43BA3D:1\", \"::2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"13106562CG9C2D7\", \"1::2::3\", \"::/0\", \"255.255.255.255\", \"B5961C49E96A807\", \"A165EA7B2.0803B\", \"9C31C6EB:5B:CE5\", \"127.0.0.0\", \"192.168.0.1\", \"2\", \"3G.4F844496408C\", \"8:B76E8.:7:BDED\", \"0:0:0:0:0:0:0:1\", \"3218E4AGEA:76BD\", \"40BF7C94813580G\", \"2E37D8DG8741AEB\", \"80349C3ED.EG5F2\", \"::\", \"9E17F5E81.1B.E:\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"::/0\", \"735:471EGE8519F\", \"GC:ADF3:272.BD9\", \"BG331E4017ADD95\", \"127.2.3.4\", \"2.59.6.2\", \"5EC:902512302F0\", \"2\", \"::2\", \"0:0:0:0:0:0:0:1\", \"300.0.0.0\", \"6385905:BGG3C2:\", \"66F37C92810305D\", \":::4\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"DB1EDD0G02DAF2C\", \"D31G4D:F2BGAAEB\", \"16B5.G6DG27::38\", \"DA1D61CBC6AC419\", \"127.0.0.1\", \"2.59.6.2\", \"9B:B24AD4CC1594\", \"DC:E87A2B166B3.\", \"36A6F:CA2:.7A94\", \"65A:E5:8804GG4C\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"B07F476.1A7D:A4\", \"B78..EA0E:3A12D\", \"31C.:A0C22A676D\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::/0\", \"E.45E8F0502C:.3\", \"1::2::3\", \"127.0.0.0\", \"0.G:A5.8.2G2D51\", \"AB218F5.4GE915.\", \"3A12:A247.26.E5\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"127.2.3.4\", \"127.2.3.4\", \"7D531ADDB97DE80\", \"0:0:0:0:0:0:0:2\", \"0.0.0.1234\", \"3.7AA7A1..0A165\", \"FD38BF67.FC0.2E\", \"0.0.0.0\", \"0:0::0:2\", \"6:32BG493192F72\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"G:D.19CG37F0ACG\", \"3027340105593BE\", \"::/0\", \"0.0.0.1234\", \"EA25408E:F73E:8\", \"497694920081726\", \"4C.80B453DE.BB9\", \"::\", \"1E3:AD481.C5A.3\", \"    127.0.0.0    \", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0.0.0.0\", \"0.0.0.1234\", \"B5DBA44F.9FF8:8\", \"49B:AG:D:05A:B3\", \"0D0183ED5E.E0F7\", \"300.0.0.0\", \"127.0.0.1\", \"2.5.6.2\", \"8E24C.D:343.B10\", \"0:0:0:0:0:0:0:2\", \"30A:410:A3:7A1D\", \"0:0::0:1\", \"::1\", \"1::2::3\", \"0.0.0.0\", \"AB08B7A6037296C\", \"7F2C99FEGA9059D\", \"127.2.3.4\", \"1::2::3\", \"8:7C90.D.1.D:2C\", \":3FC7FB733AB0AE\", \"::\", \"6B3G71E19D1288E\", \"0:0:0:0:0:0:0:2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"74379663:7.08DF\", \".2B:G9.3D3CDCF3\", \"G9A27G7:04F9EA3\", \"0.0.0.0\", \"GFF9033832AC27C\", \"300.0.0.0\", \"4G6A9:27B6F80F8\", \"E322C532.E72AC1\", \"127.0.0.1\", \"9GFBB3D6C37B1C3\", \"E798947DCCE9AE3\", \"2:A0A45A5B620DA\", \"79B22D3668F338:\", \"    127.0.0.0    \", \"CFFE6925BG0A1.7\", \"8C.GG6D.93301B4\", \"0.0.0.0\", \"2B86F08638F.9B3\", \"AA882D555FD951G\", \"0:0:0:0:0:0:0:1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"7E7:GFD2E4G:829\", \"0:0::0:2\", \"2A:30B1:3C00E.D\", \"2:7E327B27DE990\", \"0.0.0.0\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2\", \"5BGAA48D9F:08:9\", \"B00F5B1B28G5793\", \".B3G1BG20A:D1B:\", \":::4\", \"::\", \"127.0.0.0\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0::0\", \"596C8F23016.5AF\", \"127.2.3.4\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"300.0.0.0\", \"0:0::0:1\", \":::4\", \"    127.0.0.0    \", \"300.0.0.0\", \"0.0.0.0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"2.59.6.2\", \"F31D.DAEB:8A9DG\", \"::\", \"192.168.0.1\", \"    127.0.0.0    \", \"30:078A:83824..\", \"145799165BD.E:G\", \"3D3463GG52C4207\", \"GB58:::7CFGC6.G\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"9G086:8E8:FAFB8\", \"2.5.6.2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"4EF.GG5FEBG.956\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"F829E.EG16B.4AG\", \"73D5AA.B96B:EEA\", \"0:0:0:0:0:0:0:0\", \"192.168.0.1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"1::2::3\", \"127.2.3.4\", \"2:1GF6AFC6176G:\", \"C74B3:E57E804.0\", \"0:0::0:1\", \"CD801.62GE4.1BD\", \"A965F1F.61B9EF5\", \"2E4FF.6271.773G\", \"::\", \"127.2.3.4\", \"127.0.0.1\", \"0:0:0:0:0:0:0:0\", \"127.0.0.1\", \"31GCG6CB94.17:8\", \"127.2.3.4\", \".91C1:D:24049DB\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0::0:2\", \"0:0::0:2\", \"::\", \"0:0:0:0:0:0:0:2\", \"65B3.FA0GA06BEB\", \"0:0::0:2\", \"814A1.A31:8C3:5\", \"9E1:272G478G519\", \"G.:E53CDE0DE705\", \"0.0.0.0\", \"0:0:0:0:0:0:0:2\", \"0.0.0.1234\", \"2.5.20.1\", \"7B0G.0:2909D8DF\", \":::4\", \"8529A3C.5300A85\", \"4B3.B2.075F9C69\", \"2.5.6.2\", \"B7BG39A4G9BCD17\", \":0AF91F7A4A0:GD\", \"84A8:2B9G95372:\", \"B:0E3.1::EA8GF0\", \"1::2::3\", \"882D:D..GE21.02\", \"7D8:0.8106990AA\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"E.0B68CB8A964G7\", \"255.255.255.255\", \"9A.5B8021:D110F\", \"20B0190309.A9C3\", \"127.0.0.0\", \"::2\", \"8E2G3756C7FG30F\", \"0:0:0:0:0:0:0:0\", \"8:47D55G1:BA8F:\", \"D..DDB479B09319\", \"B.9D758A0E5CD84\", \"::/0\", \"4BDFBAE5670042D\", \"2.28.3C.9FDA590\", \"AB88B301:6FCF91\", \"BA9E5E55B38.G25\", \"2.59.6.2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"A976:8099765D.8\", \"57C29E0E5610B5C\", \"1F4FDC5G85::80:\", \":6160A183GCE2::\", \"7F16G1C1GG8B22G\", \"1692BG0923E:510\", \"DA94D20F8433FE.\", \"E4:B09949B4420:\", \"::1\", \"300.0.0.0\", \".3D0ED:9FF7:6:A\", \"F:F:C5D1B7FEADB\", \"2.5.6.2\", \"300.0.0.0\", \"0:0::0:1\", \"3C1F975CCABA0CF\", \"41138E5B1416.2D\", \"1::2::3\", \"::6.G99D.G87796\", \"2\", \"FAG5:BC7C.B0FCF\", \"45BGB2122GCE1F:\", \"255.255.255.255\", \"E569BD86057B295\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"5CCA.9:A:D8CB5A\", \"0:0:0:0:0:0:0:2\", \"C5G:33F3F30F6:3\", \"0:0::0:1\", \"2.59.6.2\", \"F5E9A5:A3C06D23\", \"0.0.0.1234\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"EF02DA8G66:B49G\", \"0:0:0:0:0:0:0:1\", \"2D7DG4E68:363F0\", \"2E3F36589BC.46D\", \"E121A3GGAE2382G\", \"::/0\", \"F14C2761:.27E0E\", \"192.168.0.1\", \"07FE113E6A37905\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"300.0.0.0\", \"GDFEG673G5E80F9\", \"B7B5C6:ED74A2C9\", \".591GG3:E7FFA25\", \"BD25G0AD858G931\", \"DGE374E21537E5D\", \"B5B032966CG59C9\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \".3GFDF8.1A2DB85\", \"2D373:33139293D\", \"0:0:0:0:0:0:0:0\", \"2:GFAC6C22F9.0D\", \"127.2.3.4\", \"2.59.6.2\", \"B9:B.F47G.7AE.8\", \"0::0\", \"8CA0F515D:6E0AB\", \"BD6CAAGA8D6.895\", \"GD979A0:D30BFD.\", \"BF0D0:75A722F10\", \"E2:G:68G2GB9.07\", \"G0.7:43B2201B7A\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"3DD6G429B1652G1\", \"4BBG:391:EA.991\", \"::/0\", \"DBF32831FE.AAF.\", \"1::2::3\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::\", \"1450B4005FBC860\", \":0E41C48:5AEDGB\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"EECAF3171807668\", \"FB.E7F01AB20.6:\", \".DFAF6CF:.EFA2.\", \"2.5.6.2\", \"300.0.0.0\", \":::4\", \"6A:8F26216.E5BD\", \":::4\", \"0.0.0.0\", \"C426BG70GFB2644\", \"DE397A8412E43:4\", \"2.5.6.2\", \".BA2B1BGF0B7B98\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"35D9BB23EF32G1B\", \"127.0.0.1\", \"2\", \"192.168.0.1\", \"::\", \"F6942DG0E83616E\", \"E1::4552:.9DD65\", \"DD05AE:057FG.57\", \"127.2.3.4\", \".576.99G8:75D26\", \"G7::DC8A94..EAF\", \"::\", \"B..BEFFF...6661\", \"::/0\", \"0.0.0.0\", \"B731DDGBGB.1872\", \"127.0.0.0\", \":D77B6764C369EE\", \"127.2.3.4\", \".EE:FA69A5B6FF2\", \"1A615C588.25B88\", \"    127.0.0.0    \", \"300.0.0.0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0:0:0:0:0:0:0:2\", \"127.0.0.1\", \"::\", \"2.59.6.2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \".C:C76EDG.EB72D\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0:0::0:2\", \"0::0\", \"G0.39A755E9G:74\", \"8B5G19A::F9560:\", \"C8CD2GA20C8G2:1\", \"0:0::0:2\", \"2\", \".:CCFF117F49661\", \"3G92:0.FF461669\", \"127.0.0.1\", \"8F7GE6GD36F4G1:\", \"A8A7E0127.621.B\", \"8D700D1GEADEAAD\", \"7:BBF2BCAB5F937\", \"    127.0.0.0    \", \"46EF1:D6D1.BC4G\", \"0.0.0.0\", \"127.0.0.0\", \"67GAE34F68C260.\", \"2.5.20.1\", \"127.2.3.4\", \"5AE276679C020G7\", \"7D:16F5F5F9.051\", \"2.5.6.2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"365F46D2F.5BAC8\", \"CD8DD999647AG33\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"9796E6DE9CC3FAA\", \"23.:3:1EC.0BD.9\", \"6GG:ECFCECG2516\", \"0:0::0:1\", \"B:F0E1ECGED39:E\", \"0:0:0:0:0:0:0:0\", \"0.0.0.1234\", \"::1\", \"0:0:0:0:0:0:0:0\", \"127.2.3.4\", \"73209803B477C24\", \"::\", \"4EFCAA:3E.G3:4F\", \"0:0:0:0:0:0:0:2\", \"6FBFG05AD.79418\", \"5GC250:1D341D4C\", \"0:0:0:0:0:0:0:2\", \"::2\", \":CEE72FDE.B5BC.\", \"3E752E95GEDF56C\", \"::1\", \"G7GG1AG6226GB9F\", \"127.0.0.1\", \".06:G60BA1E6F8.\", \"7E6G9220GE85544\", \"::\", \"5DE5GE07AB.FDD9\", \"93D1:B05D21.6CE\", \"300.0.0.0\", \"CA.4C16796CD8A7\", \"::\", \"G86FFC61AB.192.\", \"127.0.0.1\", \"99C12:CBC496024\", \":7B::5E6.4.1.E6\", \"8A301C3DAG3F207\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"9CG8E91F:51AC0C\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"8E70:7G6A:999DG\", \"127.0.0.0\", \"B.456391EBEA922\", \"0:0::0:1\", \"C5EB2.C1437F.EA\", \"2\", \"33:BFGF7.E.C:BD\", \"95E2A2DG36619D2\", \"0.0.0.0\", \"C94A41F5D608C10\", \"0:0:0:0:0:0:0:1\", \"0:0:0:0:0:0:0:0\", \"::\", \"9.6:A2.5D46.97B\", \"127.0.0.1\", \"566C95DF:B:.8F6\", \"F7FC2D433F5607F\", \"GE3AB28DBB7D189\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"C8D722E2.769D1G\", \"B79:263F2G0B78.\", \"127.0.0.1\", \".0.GD884CE0G3:6\", \"::89ECA2ABB5BC1\", \"GA0A967FC188EG5\", \"0:0:0:0:0:0:0:0\", \"2.5.20.1\", \":5DFACGAGE269E3\", \"0:0::0:1\", \"3B6CEC0D56D4A8F\", \"0:0:0:0:0:0:0:1\", \"0FA4:9D663A048D\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"127.0.0.1\", \"127.2.3.4\", \"::2\", \"    127.0.0.0    \", \"B614.FDABFD:10.\", \"09386DAA140.:77\", \"93G1::::7:35CF8\", \"::\", \".353:058C1BCAF2\", \"2\", \"C3CA:51E0G5A51F\", \".0E67.1:70F3FG3\", \"0:0:0:0:0:0:0:0\", \"::/0\", \"578.B48223G05CB\", \"127.2.3.4\", \":0B:42930.DF171\", \"0.0.0.1234\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::\", \"88FFE2:ADE311FE\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"5E5D2:4.98187.2\", \"D3CE2C0GFABG:B3\", \"0:0::0:2\", \"    127.0.0.0    \", \"2\", \"B80GC:8F5A2220A\", \"2:931F2C678E5GC\", \"2E6A:EGA6.E:B96\", \"21920C37E90EDDA\", \":9E.D3FA6E41940\", \"127.0.0.0\", \"::\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0:0:0:0:0:0:1\", \"    127.0.0.0    \", \"7099127:813CBG5\", \"0:0:0:0:0:0:0:0\", \"D1B.AA2E9C22:9G\", \"127.0.0.1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0.0.0.0\", \"G291.7BB4995G65\", \"EEA9C5980F3.3GA\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0::0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"56A1B.B52DG797B\", \"DD155C3GA1FD158\", \"127.0.0.0\", \"::/0\", \"2DD93249.3G00C7\", \"2.59.6.2\", \"71D.AG64D7.::70\", \"127.2.3.4\", \"2\", \"::\", \"0D65194B5951G94\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \".8AD4F:.E16490E\", \"::\", \":::4\", \".7.BCBA53AG.29.\", \"2.5.6.2\", \"3043A37E20CBC1:\", \"3533.E4EDF677C.\", \"2\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"2.59.6.2\", \"::\", \"1:DGG5F6:FCB721\", \"0:0::0:2\", \"127.0.0.1\", \"FG3AG.38:G:3CE4\", \"9C19F9ED36.:4ED\", \"2.5.6.2\", \"2.5.20.1\", \"2276E3E605AF1C4\", \"DG.066980FC70CG\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"590.E.:C94A.CG8\", \"::2\", \"C:7C92143:19CBA\", \"0:0:0:0:0:0:0:0\", \"607.1107D.D844F\", \"::1\", \"52.1E.4G97BE2G8\", \"5DED.1G58:8282D\", \"0:0:0:0:0:0:0:0\", \".B6.:34.817DF01\", \"2.5.6.2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"54.60FG50:8D.1B\", \"::\", \"0.0.0.0\", \":::4\", \"4B.B53EECA84B9A\", \"A8BF32EBA8B9G4C\", \"300.0.0.0\", \"0::0\", \":28G6AEDGA346G3\", \"DA003B606FDB26D\", \"0:0:0:0:0:0:0:1\", \"::1\", \":7503765931529F\", \"4B1A87E1G3E00:6\", \"127.0.0.1\", \"0:0:0:0:0:0:0:1\", \"00FG688.DB706B4\", \"0:0::0:2\", \"0.0.0.0\", \"127.0.0.1\", \"0:0:0:0:0:0:0:2\", \"FC7AFC.:E7FFEC9\", \"0.0.0.1234\", \"5G1:E81A1EB0G9E\", \":163:DC:E98:4F7\", \"::2\", \"127.2.3.4\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0:0:0:0:0:0:0:2\", \"90A5AED2E348..F\", \"::2\", \"GAB0G.D065.2CA9\", \"1::2::3\", \"A618GA07E5.DC.E\", \"2076C2:2D5:BG2B\", \"4G72262CACEE5DA\", \"0:0::0:2\", \"42D10FF42GG:EB:\", \"0:0:0:0:0:0:0:1\", \"127.0.0.0\", \"0:0:0:0:0:0:0:1\", \":::4\", \"1::2::3\", \"9..BDED832.C8:1\", \"0.0.0.0\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"EC516B:C185DF.9\", \".3904.06CCE913A\", \"61BD80F7D5FC0:4\", \"8CA9F4A6.027DCB\", \"C3F:98D6E.7:GC2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2.5.20.1\", \"C592CG47DD68FE8\", \"B797G4:39786FC9\", \"BE0:18B47418:FG\", \"FB0DB:2AE576560\", \"::/0\", \"A166.D38F7A.957\", \"3DB4:9EG84224:9\", \"BG..6D:46CE963:\", \":GE3.686146B91C\", \"866A0CBA9:70D18\", \"EC5FFCBAB1.188C\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0::0:1\", \"::\", \"CE.BC8G4760.67C\", \"G0.6..14:4:DE0.\", \"127.0.0.1\", \"::/0\", \"2.5.20.1\", \"::\", \"728:4979G08410A\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"9DC9FDF6A.18726\", \"F2CCA:FC47BFFFD\", \"::1\", \"::2\", \"FE3B57.517A0C3D\", \"::\", \"127.2.3.4\", \"DE88B589742F11F\", \"255.255.255.255\", \"B2G6:C4.9C76B92\", \":::4\", \"FE0G48CDFE9A1EF\", \":C4C.:66F.CE38B\", \"5C.D9:B56F.9A65\", \"127.0.0.1\", \"D0EG3BAD6644765\", \"C7F.2EE76B4E88F\", \"2\", \"E:D:C2.E7GF.B6F\", \"2.5.6.2\", \"E5B2CC60CE03.5G\", \"1::2::3\", \"079E8777D.1D6CE\", \"700:.80187BCC47\", \"127.0.0.1\", \"0.0.0.1234\", \"FFGE68B0A:0G32A\", \"4F4127BG463C0C8\", \"CDA260350E6299.\", \"11CG3B805C9CA1C\", \":10F06D44B73398\", \"0.0.0.0\", \"300.0.0.0\", \"0:0:0:0:0:0:0:2\", \"::1\", \"1::2::3\", \"4F50GEE0184907:\", \"DF15:F::91GB0D2\", \":::4\", \"0:0::0:1\", \"::\", \"::\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0:0:0:0:0:0:0:0\", \"4::G5628895258G\", \"255.255.255.255\", \"436C4:DB13AGB55\", \"1::2::3\", \"846AG83D.:A6C98\", \"2.5.6.2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"11B760BA4DA0249\", \"::\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"F129CC4CAB3.D8.\", \"3A:F:21AG730636\", \":44582982.G.DA9\", \"0:0:0:0:0:0:0:1\", \"18::2527..57B9C\", \"937C84.0GDGBBF9\", \"0.0.0.1234\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"GBD.:5A9D0:864D\", \":3.9057D.E8AB66\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0:0:0:0:0:0:2\", \"    127.0.0.0    \", \"::\", \"192.168.0.1\", \"127.0.0.0\", \"1BF54594E0E12AF\", \"266F6DCB921.33A\", \"1:0D0BC9:1B.2DG\", \"0:0::0:2\", \"A88.48..983D4F7\", \"255.255.255.255\", \"F2C36AD5BADEG.E\", \"2.5.6.2\", \"127.0.0.1\", \"864E8AB662201.3\", \"49GE8G6EDF75:C2\", \"2.59.6.2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"DA100CBA96634DF\", \"255.255.255.255\", \"0:0:0:0:0:0:0:1\", \"29DG3DD1585:E8:\", \"::\", \"EECGE0A229C4..8\", \"5B16792A1705D:B\", \"0.0.0.0\", \"0.0.0.0\", \"58G0A:4EB:2:B74\", \"0:0::0:1\", \"::2\", \"3BA329A9.3002A:\", \"::/0\", \"0:0:0:0:0:0:0:2\", \"0:0::0:2\", \"7FAEC06CB55402A\", \"G24AF:52BB9E8:2\", \"192.168.0.1\", \"2.5.20.1\", \"1::2::3\", \"241DE47FAC58C8C\", \"::1\", \"127.2.3.4\", \"29GFE:8551C:73:\", \"B90652478D10B8F\", \"1G2A9F181AGG:A.\", \"32F2.4CCG40808:\", \"95FG:5B2C.9970F\", \"::2\", \"0:0:0:0:0:0:0:2\", \"0.0.0.0\", \"1.A98EC52A572B.\", \"0:0::0:2\", \"2.5.6.2\", \":::4\", \"FAD99C500F7A562\", \":A:B8A5GDFB77CG\", \"07C243A2B2G08B2\", \"D14432F92AFD4CG\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"1424484FC57G4F0\", \"2940B3.E9G2E333\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"1AD59934.74BGC3\", \"7F7AGA7G7FC7AED\", \":::4\", \".C67381G75334F2\", \"B5E7.A:D083AG.7\", \"0:0:0:0:0:0:0:1\", \"32927CCF3..976B\", \"127.0.0.0\", \"2.5.20.1\", \"::\", \":EA5:0C18G7G524\", \"2G307A6D.C23ACB\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"58.2FC3CF5F67AD\", \"BE7G6FDA74G6E.0\", \":FF9F2B.B1C435E\", \"A4F1:F8D2:50653\", \"0.0.0.1234\", \"    127.0.0.0    \", \"BFC9C.006:34A1F\", \"0:0::0:2\", \"3035:FA31C0.684\", \"2E61DCAA65G13C2\", \"0.0.0.1234\", \"::\", \"8FE5A4.07FE081:\", \"69A9.199081:C65\", \"66FDB0.EG03FCFD\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2\", \"54DG742EG98840A\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \":G1AA208:6.7EF8\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0A8B73F0285F639\", \"0:0::0:2\", \"5750A69B.F:D:F0\", \"2.5.20.1\", \"2.59.6.2\", \"8DF5.14DF.DAEE3\", \"D4A.7B.48621A..\", \"::2\", \"0::0\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"A7G8B771BA18437\", \"CAA5C90A81FD66:\", \"305AE48E8B91:ED\", \"870B444D74E5.70\", \"::/0\", \"0.0.0.1234\", \"6:BG::60648D50G\", \"::\", \".3FAA4GC03.03F2\", \"D7D5740:71F402:\", \"091:D889742E05E\", \"99F2GA8D3ED2GE9\", \"B.9D07G.3C:21BD\", \"::\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"8820.G51GE39AA.\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"::\", \"    127.0.0.0    \", \"18AG6809.D0..26\", \"::\", \"127.0.0.1\", \"2GC906G398858A8\", \"127.0.0.0\", \"A.EC9C146292.BF\", \"FE:3A00FBECC13F\", \"9CD120003G83:32\", \"300.0.0.0\", \"0::0\", \"0::0\", \"F5716B88B1.32A0\", \"::2\", \"0:0::0:2\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \":6E04.90D812:9.\", \"021BD1A8769A60F\", \"DD106926E853306\", \"F08:DA5D3FF89G6\", \"8B.8966BF1B2A46\", \"B9B6:.:97GCD3B4\", \"6.20D9::97FGG2G\", \"BEG1:B.9038.867\", \"192.168.0.1\", \":::4\", \"0128ADB66:69GC.\", \"F:.3CE6.A642D18\", \"AC11:D539D8.FFC\", \"0.0.0.1234\", \"0::0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0.0.0.1234\", \"1:77B316798B8D1\", \".9.D64732469:F2\", \"127.0.0.1\", \"300.0.0.0\", \"802BA8EG3C023E2\", \"3.53F0:4.F93E6D\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"G563C:994C6360:\", \"F325836E:8.858E\", \"127.0.0.1\", \"4DC2654G590E5E6\", \"51:5A624254FE58\", \"69:B7BE36BG91..\", \".F0C4G17AA9CGDD\", \"1::2::3\", \"3DE5:3.ED8.9:D6\", \"0::0\", \"127.2.3.4\", \"1C0A1BB191579D6\", \"::\", \"4FGEDF62:1G3190\", \"1::2::3\", \"    127.0.0.0    \", \"2\", \"FE41FED2FB:982:\", \"937298.0:A8G:.5\", \"6CBE.6:.CC83E8C\", \"0:0:0:0:0:0:0:2\", \"1::2::3\", \"2088E2F3BCC3GE6\", \"8E26592476E:FC7\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"A79G812F.76D4.D\", \"127.0.0.1\", \"::1\", \"164FF9G7549.8CG\", \"CFBEE310E265FE9\", \"3F7127AG78F6FF3\", \"300.0.0.0\", \"021C3:2193F6071\", \"CCGE0DF1GF2E0D.\", \"::2\", \":CA9A876B904.GB\", \"0::0\", \"G8380DB.B08.FF8\", \"4A:284E9E62B7AD\", \"::2\", \":3D314:87958E1A\", \"2\", \"::/0\", \"::1\", \"7:6202F4A0118BG\", \"3F.CEF659494ED8\", \"::\", \"1G8E8B36G06D634\", \"127.0.0.1\", \"AGGBD02C:907:60\", \"0::0\", \"127.2.3.4\", \"00D:C.350B4G:G5\", \".137A:58.36D768\", \"6617G9F4A::5D:7\", \"58C98A.CA.7CA00\", \"127.0.0.1\", \":GD543:A:E913G4\", \":640824F0D:8076\", \"8:BG7011EG:9847\", \".40787279EDG853\", \"C48D0B76A.87.G3\", \":::4\", \"2.59.6.2\", \"0480EE7B298G8G2\", \"9B:..9BF827DDB3\", \"2.59.6.2\", \"CED9GEF2B6G98FD\", \"0.0.0.0\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"DG7G8.94:F8B4CE\", \":::4\", \"6D74..87.326253\", \"F6.67C54E5327:F\", \"6::BBGGCE2405G6\", \":::4\", \"5G.9E16BF6445CA\", \"255.255.255.255\", \"B38AE7.0413B:71\", \"2.59.6.2\", \".01DC:49792F574\", \"0::0\", \"A84F26G64B91DA:\", \"::\", \"B30A0F1972FC057\", \"0:0:0:0:0:0:0:0\", \"3BB9B.E4G0ABA71\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"45B8.DB43:0643E\", \"::\", \"42797GG8:G88DG.\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"EDE40DD34G65EAA\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0C.09D9GECD7724\", \"G41E2DCG8670:9A\", \"649G:G603ADBB3C\", \"127.0.0.1\", \"0GF6E118606D2DA\", \"G162142:8FA9BE5\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"4FA798C1120FBB1\", \"90826G0F86768DB\", \"E7G1:8714.11EB3\", \"E56CA7G2DD835.F\", \"73A4361E14F.2GA\", \"2.59.6.2\", \"063AG9:CAD.8F54\", \"2.5.6.2\", \"FF.EC.8GF0F6EAE\", \":31DEG96.0F54:E\", \"2.59.6.2\", \"145C379GCDE4G.2\", \"E2..43466E0D3..\", \"6BD.BA:42433C:A\", \"8.ECEE.:A88G064\", \"1::2::3\", \"0.0.0.0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0:0:0:0:0:0:2\", \"2.5.6.2\", \"A:24B0224:G52F7\", \"127.0.0.1\", \"::/0\", \"11BGE.376.D8BG0\", \"0A2C7082.48A65.\", \"0::0\", \"127.0.0.0\", \"ACB80FBG7CEFE.E\", \"0.0.0.1234\", \"0:0::0:1\", \"63G178GFGFA5025\", \"A7:8E180D4CGBD2\", \"7:1583F68A3.D82\", \"487:.87C:2DC7D2\", \"BABE15DD11G5D7:\", \":::4\", \"::2\", \"2.5.6.2\", \"255.255.255.255\", \"::1\", \"0E5AGFF40DD8289\", \"06E3G9AECA68E.D\", \"CGA22.C163CED:5\", \"127.2.3.4\", \"5564:5:7D50CE24\", \"3C95E3E1A:974AD\", \"A4E3GG15G95.843\", \"8A127B9EA.1F5B8\", \"0:0:0:0:0:0:0:1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"D059505AG80.18G\", \"FB:8.9AC60AD0FA\", \"2\", \"0:0::0:2\", \"::\", \"0.:63.GG3729B05\", \"0.0.0.1234\", \"8D:3A45264BF024\", \"255.255.255.255\", \"::\", \"EB9479:0CC84..2\", \":::4\", \"2..FC:DDD9BG23.\", \"2C3E4:4BA46207A\", \"::\", \"2\", \"62.:0B30ABF.AG2\", \"4E4:3:120BD.D55\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"5297A7136GF:45.\", \"513247F:1D2F483\", \"2\", \"::1\", \"58CE584.D6.CB85\", \"C280C:1E.G4DB81\", \"04EED578G440647\", \"G7.1.3:2135:EF:\", \"06F76:.4A.G36F5\", \"A4D.4EE3B74G53.\", \"2.5.20.1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"A0.1041F6:8F41C\", \"0::0\", \"0:0::0:2\", \"::1\", \"F.G8DC5456:9C:5\", \".A8:.91G9G20D58\", \".GAFE207AAFEBC:\", \"..:GD1A58278538\", \"192.168.0.1\", \"0.0.0.0\", \"1G02F:128C13A29\", \"::2\", \"A5D:1FE04G.22C2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::\", \"2.59.6.2\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0:0:0:0:0:0:0:1\", \"52EEFGGB5F:53E4\", \"3GFF2D4C6D72023\", \"AE08E2EEGC:52.5\", \"2.5.20.1\", \"0.0.0.1234\", \"..BF6B6FA43.D63\", \"E2G24AF25:00E79\", \"0:0:0:0:0:0:0:0\", \"8EB252319545539\", \"F87BE5FEA76.A95\", \"0::0\", \".E.227CE0.64378\", \"::\", \"B.BADC0.643GC2A\", \"300.0.0.0\", \"EBEF4093E6C9D00\", \"0.0.0.0\", \"2:3982CC39EE84.\", \"127.2.3.4\", \"192.168.0.1\", \"127.0.0.0\", \"192.168.0.1\", \"    127.0.0.0    \", \"::\", \"127.2.3.4\", \"9G1980751B293B1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0:0::0:1\", \"4077FDC8B7D7B:E\", \"46:.E:D37F760:0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0.0.0.0\", \"0:0::0:1\", \"0:0:0:0:0:0:0:0\", \"300.0.0.0\", \"::1\", \"2.5.20.1\", \"::1\", \"F5DB5:8B8.FDBEB\", \"F90.D.E71G475D8\", \"5CF6829C5377FBG\", \"0GG639D29884G71\", \"C5E0A93FGGG9563\", \"79EE:48D4DAC1F7\", \"    127.0.0.0    \", \"BCE99E1966.3B8:\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"9:A:0F3E539E618\", \"127.0.0.1\", \"1::2::3\", \"DC6C:0DGA091F9:\", \"2\", \"1::2::3\", \":::4\", \"300.0.0.0\", \"0E4313F7BBB6B4D\", \"7E3C4FE4:.8G9:.\", \"696G81ABA047CB2\", \"2.5.20.1\", \"1::2::3\", \"0:0:0:0:0:0:0:2\", \"127.0.0.1\", \"2\", \"2\", \"834DBE7G4B8GD.6\", \"127.2.3.4\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"GB3684090:.FF31\", \"AAF0F:1FG3DGC22\", \"0.0.0.0\", \"127.2.3.4\", \"0:0:0:0:0:0:0:2\", \"::\", \"127.2.3.4\", \"80DB5A.7181:F16\", \"    127.0.0.0    \", \"43E76C0.:D03E08\", \"::\", \":F1B532824.3072\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"127.2.3.4\", \"430.822B929B:FC\", \"BB3GGDA0.5.9D6C\", \"922..8E9A30C16:\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"13G.2DF60EG3D..\", \"D2FABB808A0C4BE\", \"GBE1B17EAF1A821\", \"D8GAA4EGGGE:0B4\", \"::\", \"2\", \"2.5.20.1\", \"127.0.0.1\", \"28FABA822696C37\", \"0.0.0.1234\", \":::4\", \"127.0.0.1\", \"B29F:5B75992DEE\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"1A03F3BDA3BC626\", \"127.0.0.1\", \"F6875FC1105E475\", \"5E057C3C5.7729B\", \"0.0.0.1234\", \"411.463C7A55328\", \"EEECG6CE:713F52\", \"0.0.0.1234\", \"0:0:0:0:0:0:0:2\", \"0:0::0:1\", \"127.2.3.4\", \"0:0::0:2\", \"0:0:0:0:0:0:0:0\", \"3CF35G5E.11DF80\", \"D6.238:1F6CB.A2\", \"132..D269F83C6A\", \"0:0:0:0:0:0:0:2\", \"6961E7GFE453BE8\", \"255.255.255.255\", \"::/0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \":6F9F.15DAAB2B2\", \"127.2.3.4\", \"E81D9DC6C28CG82\", \"0:0:0:0:0:0:0:1\", \"0:0::0:1\", \"2B22GC0811614FE\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0F.83.26DE6.E5C\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"6075736:9.E0A73\", \"3G:7C45FAAG91E7\", \"BAG56GFD5BD26C2\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0837A29.EFD0A71\", \"91G7GG0CA::B:E5\", \"F106:DC949AC7D0\", \"    127.0.0.0    \", \"2.59.6.2\", \"0:0:0:0:0:0:0:1\", \"62E.7852E8B7CCD\", \"54:943774BBB08D\", \"::\", \"5A050G30A587A7F\", \"::\", \"127.2.3.4\", \"0.0.0.0\", \":G527504EB1822F\", \"GG7CB80BE8A8423\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0:0::0:1\", \"F29GG327A34CAG0\", \"A582D2CA38.FEFG\", \"EC:AD3A8CG3026B\", \"1:E4369B6A5B361\", \"::\", \"::2\", \"3.470F180AEC37C\", \"8D91F1G8442B534\", \"B987:3AF434EBA9\", \".G7D7894379B4D8\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"G569D05E8.64C58\", \"0DC2D259.41B922\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"G.397EFC51C9A8E\", \"127.0.0.0\", \"FB:8:3GED0217DC\", \"E6CB1835G71C11.\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"255.255.255.255\", \"25.EA15BFG63D4G\", \"0:0::0:1\", \"127.2.3.4\", \"127.0.0.0\", \"0:0::0:2\", \"2.5.20.1\", \"2.59.6.2\", \"F9A21CA7:05ED70\", \"92DG05FFBD1A16B\", \"G51D6:6GF5:6.GD\", \"4F80B:842:0E8F1\", \"A:G2F7B1BE8E565\", \"42583503EA6G09D\", \"300.0.0.0\", \"B33CB2C58:.92AF\", \"DA6C2:B1A0240.E\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"127.0.0.1\", \".BE52C9753050C:\", \"B23E7DE9A::.704\", \"B:G5A81A:8G55:C\", \"BG78:1.:7112BF0\", \"3228FC8.3A2ED78\", \"0:0:0:0:0:0:0:2\", \"E15E.5F3:470277\", \"127.0.0.0\", \"0:0:0:0:0:0:0:1\", \"127.2.3.4\", \"5D6.E::9672GFGD\", \"0.0.0.0\", \"2C8628A1ECB05.3\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"D65:35D1BBB91.B\", \"0.0.0.0\", \"300.0.0.0\", \"2881B71E:D39FD0\", \"AD.8BE5FD42977G\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2.5.20.1\", \"127.0.0.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"A6GB99B200A1292\", \"B7GC16:767FAD40\", \"::2\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"2.59.6.2\", \".0DD07950E8769C\", \"    127.0.0.0    \", \"127.2.3.4\", \"0:0:0:0:0:0:0:2\", \"A8BB5G397GEF03F\", \"1311E5:83.71:8B\", \"525671AG1399D09\", \"5343C99.4F1.BDE\", \"127.0.0.0\", \"0:0:0:0:0:0:0:0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"45E52.G7366GA24\", \"AF02G.D23AD20B5\", \".E3D0F4A48FFCC0\", \"7.394.7FE94FA44\", \"BF:GD9FFD70:51F\", \"0:0::0:2\", \"0:0:0:0:0:0:0:1\", \".B73G4E289C.G34\", \"3D:D2B5:F4B9.C3\", \"5A0BD4CE.E7G25B\", \"F1B8B7F8A84F0.E\", \"127.0.0.1\", \"C7A.7B7B1.93..F\", \"B54EE094:1039E:\", \"7B.A6C94AGAGE:6\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::1\", \"0976GC0G.6E:A25\", \"0:0::0:2\", \"C57E0391:FA:6CB\", \":4:3D9C90B007.D\", \"0:0:0:0:0:0:0:1\", \"::/0\", \"8E.7BCG7:01:E9C\", \"0:0:0:0:0:0:0:2\", \"0::0\", \"80G0..D6.38C14G\", \"0:0::0:2\", \"0:0:0:0:0:0:0:0\", \"92DG4.51B59.G72\", \"::/0\", \"B86262F272493DE\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"DG52410F59CBB:6\", \"A2DDD80GA9FGBE7\", \"2\", \"1::2::3\", \"255.255.255.255\", \":::4\", \"3F.BE15D5ECFE7B\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"A:89607D8F6E.F5\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"::/0\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"3G669C3E4B.5CDE\", \"0.0.0.1234\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \":FEC81G98956AB1\", \"4.3:.B7G52920B8\", \"0::0\", \"127.0.0.0\", \":::4\", \"A583B.40:BFA498\", \":7227205.56C3B0\", \"0:0:0:0:0:0:0:2\", \"C6G57F37396A41.\", \"1::2::3\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"BF49F.B321D:C0E\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"::/0\", \"3388.859FC2D657\", \":::4\", \"::\", \"127.0.0.1\", \"4:6F6.5A6:263:B\", \"0:0::0:1\", \"65.E3C66A588E03\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"BE32G1BA1D58EA0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2\", \"65E6EF:E64F1A94\", \"7C.D.C93FE:9605\", \":4:3FEG91927.E9\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"127.0.0.1\", \".:2GB7A.0:C8A:G\", \"255.255.255.255\", \"7A00799:828071F\", \"2.5.20.1\", \"96G697CACD2E..2\", \"FA2D5.D11C5B848\", \"0:0:0:0:0:0:0:0\", \"0::0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"4F8FGB4B3A:GG46\", \"0.0.0.0\", \"580AB1.D9A147F3\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"127.0.0.1\", \"0.0.0.0\", \"EE1351CEDB9EA.9\", \"127.0.0.1\", \"0:0:0:0:0:0:0:1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"CF:A1:BFE.:G0C3\", \"::\", \"127.0.0.0\", \"0:0::0:2\", \"C121ABEF::G:90G\", \"967G.D.GA74G.D7\", \"4G:B9E5FE4705BD\", \"7.DC948A:492G0F\", \"0.0.0.0\", \"0:0::0:1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \":GE.3C2175D24DE\", \"985G51402:FB967\", \"0:0:0:0:0:0:0:1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0:0:0:0:0:0:0\", \"9C5FF:795:485E7\", \"0:0::0:1\", \"C3236647761BBB7\", \"D.87G3228:AF69D\", \"G9D.D40A361A401\", \"7DBC2A3A97931D2\", \"255.255.255.255\", \"0:0::0:2\", \"0:0:0:0:0:0:0:0\", \"7BGE9BF76A87CF:\", \"B64A76:E:A5B40C\", \"21BF:AF90FEA4AD\", \"DDD:1G10338:981\", \"192.168.0.1\", \"5E622E339BC0GC8\", \"    127.0.0.0    \", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"GDEE.CC7FE4D:3C\", \"0.0.0.0\", \"EC8:491.050726C\", \"::/0\", \".:E2:1C62568.A:\", \"    127.0.0.0    \", \"FA.5B8A5CB58862\", \"D2527ACAE7DF:69\", \"7F8004BF::2:5BD\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \":2A6EFE717950:D\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"300.0.0.0\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2.5.20.1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"C8FBG885E:A.G72\", \"::2\", \":G8.2FD7BB6A6:3\", \"3167A2.G28E5.CE\", \"5E44A6AD28:7BC:\", \"8F32A46.E1GAE8D\", \"0:0::0:2\", \"..CGBFB.430CE76\", \"4D..DBCEDA71.89\", \"0:0::0:1\", \"2\", \"CAC2BF661B410CA\", \"2.59.6.2\", \"192.168.0.1\", \"4FG4035162:CB.2\", \"    127.0.0.0    \", \"0:0::0:2\", \"::\", \"23C9E23G42C1287\", \"C92F46G0G0E8G35\", \"352E:.AB8D3D8DB\", \"1:3DD1614A34C0B\", \"CD4A1E93678B3F4\", \"0:0::0:1\", \".6C:B12A:GCB9CC\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::1\", \"::/0\", \"::2\", \"0:0::0:1\", \"255.255.255.255\", \"0::0\", \".D9G06:7728:565\", \"::/0\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \":F6B8AG4A7CG9C1\", \"0.0.0.0\", \"::\", \"1D.A907140D959A\", \"EE:FD7:6.3GCBGF\", \"E29A1CC5E:AAC:G\", \"0:0::0:2\", \"::/0\", \"1DCDG041972EEB:\", \"5F.D:8G57C60DCB\", \"0:0:0:0:0:0:0:1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"2.59.6.2\", \"68G2F41E3224E45\", \"56BB7AFB1BCC.G6\", \"2.5.20.1\", \"192.168.0.1\", \"CGD5FF53::DFA0D\", \"0:0:0:0:0:0:0:2\", \"F4:A2BFAEEF.3C8\", \":FG74C29E05FEE6\", \"2\", \"300.0.0.0\", \"65A2.G.CCDG0235\", \"::/0\", \"C:78.7A4C5.B1G4\", \"25.BF45.G5AE174\", \"5AF08D:BAE2995G\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"64BB9396:2B2B95\", \"B:159AB0:FC197C\", \"4B3D.14:3EADC62\", \"0.0.0.0\", \"DG136A7A:9B.:85\", \"30B74937971:F96\", \"C6F57D22DBEFF3:\", \"::2\", \".08G9F25:0481A8\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"127.2.3.4\", \"0:0:0:0:0:0:0:0\", \"75901..0083FB.3\", \"127.0.0.1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"2.59.6.2\", \".1C79A1ED1G028A\", \"F4510AE64E4F12F\", \"0:0::0:2\", \"127.2.3.4\", \":58:G947A.CB970\", \"962AFA8AC3D9:6:\", \"AG:.9D49B8:7E.D\", \"569FG42F4.66.F1\", \"54F4E5DE30:G0GB\", \"192.168.0.1\", \"0::0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"127.0.0.0\", \"1A0G215G.73809G\", \"0:0:0:0:0:0:0:2\", \"2\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"E9.AE331C3470FD\", \"127.0.0.1\", \"CG98AE3DGD8379A\", \"0:0:0:0:0:0:0:1\", \"0.0.0.1234\", \"B76D1604419E111\", \"52E:G.631D9.5G2\", \"458D0:D42.717G2\", \"255.255.255.255\", \"6B0788B7F2D5284\", \"0:0:0:0:0:0:0:0\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"F36.DA9B6E71C37\", \"EC4CB1373F598GE\", \"EGD233021C4A7B0\", \":FF.0E4.2829C99\", \"530E2A26AA0:4E3\", \"E6D2::FC2CB.5D7\", \"192.168.0.1\", \"0.0.0.1234\", \"F20A6BGF:2G3FC0\", \"513C5612F1AF5:A\", \"5G5.1GC3AC62B7D\", \"::2\", \"2.59.6.2\", \"69CE0B42F6:93E1\", \"91DBG29:GCEGF5.\", \"255.255.255.255\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"304A4927329AF41\", \"CAD7.60CGD18.DA\", \"E28CG18B8C6D48.\", \"127.0.0.1\", \"0:0:0:0:0:0:0:1\", \"477313A.AB895D3\", \"55.A.8A.6DA5E.9\", \"127.0.0.0\", \"127.0.0.1\", \"CB876C96B8:3D60\", \"2G0E8BG6359DA45\", \"766GDG70A48AB35\", \"0G8E4A72D9.AE01\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"A44C2F1.6GFDEAE\", \"127.0.0.0\", \"57:CE5704:6DG.B\", \"EGB7EB.C8C54A73\", \"10D6.G1A488:9.B\", \"::1\", \"1GCD5A782:8F4C1\", \"69:G4:6E916.52E\", \"D353EDG70920F3B\", \"30GEED3CF6A3761\", \"1EEE3C99BBGA102\", \"FC.FB5F07F8GGC4\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"7B8D542232GF40C\", \"3:16CE.8961819B\", \"2.5.20.1\", \"8CF7487924A9688\", \"6019FE705FDGE2A\", \"3E2F.3C7EF62G6G\", \"B764A3:5:E57.8F\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::/0\", \"67A5GAEA2A7G9DE\", \"F.300E8EGEE3818\", \"D:5:27.EDGC7G70\", \"020GB9C:138G0G:\", \"300.0.0.0\", \"EAF9.123043D0EC\", \":8GD099E8F442FA\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0B8ACFA430DE:EB\", \"1::2::3\", \":41GDG.56215.:.\", \"2\", \"7CB2DB8286E:G2B\", \"D7C119A3240D476\", \"E22B51A4EA30441\", \"D.EBC8F462341.C\", \"2\", \"4C0GE129.:A00D8\", \"FA743F1:069488F\", \"2\", \"0.0.0.0\", \"7B943549E4C1D44\", \"FEB38D:FABF3BG7\", \"44GD0D8419GGEF8\", \".C72:2G3GGC9D0:\", \"0F3D2B2F30D.9FG\", \"G52GC::CC3F61B6\", \"127.0.0.0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"73F.A.3B61F61A5\", \"287G979984B225F\", \"E8.G:773ACABCD0\", \"52D1B37.D9:33EF\", \"127.0.0.1\", \"127.0.0.1\", \"8.F29088B3.:AB5\", \"198061646B42C9.\", \"2.5.6.2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \".AB1GC2BD4A68B2\", \"BA2E4E74FBD5GB3\", \"0:0::0:2\", \"255.255.255.255\", \"54B3.A:272.A4GF\", \"AE3.09.415BA2E8\", \"::2\", \"::\", \"0.0.0.0\", \"0.0.0.1234\", \"1BC8D45FADC5EF4\", \"C1218A3D5D3.FC:\", \"0BB041473CFD943\", \"F79244:6:B23G8E\", \"127.2.3.4\", \"565.7G5GD037:E4\", \"3::.21:.69:1:73\", \"AD2839G.G3A9GFE\", \":::4\", \"CAB2FA393GFDG65\", \"1::2::3\", \"2\", \".CG..DC0735G14F\", \"74A2F:2C9G:A0ED\", \"A2:5G.5EA981:D:\", \":30:FF.9B.306E4\", \"1B86.72:8091D9:\", \"0.0.0.1234\", \"0:0:0:0:0:0:0:1\", \":07F0546.564596\", \"DDE8DC3C462:6G7\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0.0.0.0\", \"127.0.0.0\", \"61DBG.A454EF2B:\", \"6C61DF.5G:F4AA4\", \".:EED0FF557.EAD\", \"2.5.20.1\", \"F.9E634:1.:G8A:\", \"    127.0.0.0    \", \"192.168.0.1\", \"255.255.255.255\", \"E42DB:14260DC30\", \"127.0.0.1\", \"0:0:0:0:0:0:0:1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"5D9B.4:50C0.8BE\", \"300.0.0.0\", \"0:0:0:0:0:0:0:0\", \"48F889G7C2D1D.8\", \"255.255.255.255\", \"B.5EA6C3BCF9A65\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"::\", \".072ADBBBA5E3B4\", \"255.255.255.255\", \"::/0\", \"0:0:0:0:0:0:0:1\", \"AADEDCF:FB52CE4\", \".8A967E356AFAA.\", \"7:045A.CF03:F60\", \"2.5.20.1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0.0.0.1234\", \"EFEB46B7:8150AB\", \"F0900BE4FFD8:6F\", \"2:EB126G68EC99D\", \"0:0:0:0:0:0:0:2\", \"74AFFFE44.9GF52\", \"::/0\", \"2.59.6.2\", \"A9B074D1E4FAF52\", \"B8CF1995:F7B:C5\", \"0:0:0:0:0:0:0:1\", \"300.0.0.0\", \"26GC:88GGG1126E\", \"::/0\", \"127D19F5253AA:C\", \"887DA:093BF.:.1\", \"25.D6.4FD52.D83\", \"ACG08114.D8F683\", \"GD9DA26BD34F2B5\", \"..4EE7302A019GB\", \":.GF1939572C022\", \"E0:EF6DD88G53AD\", \"2.5.6.2\", \"69DCF9B33B7AGE5\", \"G1GE05.46F2GB2C\", \"A:GE:4EGB:77B06\", \"1::2::3\", \"0.0.0.1234\", \"3852:E3548A8GEA\", \"736DD3FG:122:EF\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \":E:475BFA64.C85\", \"EC5DCABE317B202\", \"2.5.20.1\", \"8F9A7A651E:DD16\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"255.255.255.255\", \"13926750GG407GF\", \"7847GGCD2D3FE2F\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2.03BEAB7128D23\", \"C80.A41GEB9GBE9\", \"2.5.6.2\", \"B9105880:8A3F53\", \"3B423FE:8.E5687\", \"8G47A9FA3G33..F\", \"D2B1881B00.0::.\", \":4194:3D6GB28B4\", \"2.59.6.2\", \"1605ECGE2:9.465\", \"28G9A:.E077:F1B\", \"26AFC6D4GA9637C\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"31A5B2E6EG08:1G\", \"::/0\", \"2\", \"C:905DG2AA75DEB\", \"255.255.255.255\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::/0\", \"6878EFC:E6GD7A6\", \"2\", \"2.5.20.1\", \"300.0.0.0\", \"300.0.0.0\", \"0:0:0:0:0:0:0:1\", \":::4\", \"0:0::0:2\", \"615889GE7389F:1\", \"0.0.0.1234\", \"44BEA::6B.A703:\", \"127.0.0.0\", \"127.0.0.1\", \"5DECC34B1G62G47\", \"::2\", \"E665C0E21F1AFG3\", \"BDEDG6A6A922G9G\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"::2\", \":4B093F71EA8:70\", \"2.5.6.2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"08C440020B77:5A\", \"255.255.255.255\", \"300.0.0.0\", \"0.0.0.1234\", \"F5D4G025101A013\", \"B8A45G::.D9G4C.\", \":3.1858D8DC3029\", \"D450905934G692A\", \"489E63D5467.1CC\", \":::4\", \"0FB384B0GCB:352\", \":::4\", \"::2\", \"127.0.0.1\", \"::2\", \"5FE8EC6EAGD.BD9\", \"2\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"DAFF125752.D014\", \"127.0.0.1\", \"9BCE7795528F5E4\", \"23E3C.7FE.E2806\", \"0.0.0.0\", \"0:0::0:1\", \"7.G05F9:05:B2B3\", \"D.7:94009G3B163\", \"7DCB:G.0G69E7A.\", \"300.0.0.0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"74DAC2A8CA5265D\", \"E610..B810C674.\", \"127.0.0.0\", \"0.0.0.1234\", \"582.58G762EE2G7\", \"C45F22.0F86F835\", \"5F:EBC:C4A48.4G\", \"6F.:D6:E.AA952C\", \"AA4FB5B5639:8F4\", \"805B0:89DCAE2D.\", \"4EEB::FF59A929:\", \"C.A91G24C3::DG.\", \"0::0\", \"::1\", \"0:0::0:1\", \"DAB326F6FA..1E0\", \"077B079:47EFEA8\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"G5BF8E422GF8723\", \"02GAG.6B1.15..1\", \"AF1:0E82F6E019E\", \"127.2.3.4\", \"5AG9D8202DF24CA\", \"8CE4E34620A1FC3\", \"2G:2887D461G2.B\", \"98D4:9::283A7:D\", \"423CC:FG:FE99DF\", \"8431F.DG93DB1CE\", \"EAE7E13::B06137\", \"D:D241:383.9E84\", \"9BEA02330C:EGEA\", \"4B33A:B:01:GA42\", \"0:0::0:2\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"6B28AF:7E27D9D4\", \"127.0.0.1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"C.F707CBD27A:78\", \"FA4D7E4G0FA:2FA\", \"20.C0B88AB18BBA\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"300.0.0.0\", \"::1\", \"F2AA6.G:86GB3:A\", \"0:0:0:0:0:0:0:1\", \"6B.9C4BGCB8.C3G\", \"23115:DB.5DB5C3\", \"::/0\", \"BGAF0166GFCEDE7\", \"B429.1G353D9B6D\", \"5AGGGG:4B.AC692\", \"E3::C3D.E0A4D92\", \"64F8363005C:26D\", \"2.5.6.2\", \"2.5.6.2\", \"0:0::0:2\", \"E0G0844BC8G5C2A\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"127.2.3.4\", \"GE3:E8D873D5:EE\", \"::1\", \"::\", \"B6C703:9BB6BF8D\", \"2.5.6.2\", \"50E5:1C36.0F7.6\", \"FEEB1:2BEE::B.B\", \"127.0.0.1\", \"0E5B3AC878652A3\", \"567F13G87.D9BF.\", \"3G31320.213B371\", \"    127.0.0.0    \", \"300.0.0.0\", \"1::2::3\", \"    127.0.0.0    \", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"127.2.3.4\", \"300.0.0.0\", \"25595D60:C09F.D\", \":.32C914B473FC2\", \"742B5EF792.8EDA\", \"G731B17C6.F:F74\", \"0:0:0:0:0:0:0:0\", \"127.0.0.0\", \"F76:1EB8C4:D173\", \"765D67D1C0BEA3B\", \"127.0.0.1\", \"::\", \"::\", \"7A:426.352B4..4\", \"4:.0.:81.B62G30\", \"GD:G:D:29F46DAE\", \"60GD9:5211A4:05\", \"F069C40FCE3E930\", \"84A22A:64D2FDEF\", \"2.5.6.2\", \"0.0.0.1234\", \"23A12965E521846\", \"F0.F6B7.94A101C\", \"5AE:E0.807CC6.6\", \"127.0.0.1\", \"GD07:274684GGEF\", \"17662A07G3D1.14\", \"A822D2.2CG9.B3.\", \"B4:5248780AE40.\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"D5932F06A6125E3\", \"127.0.0.1\", \"1E05AFABG4AF148\", \"BE20D9B5E7036FB\", \":9G:CGD08B00GE0\", \"0:0::0:2\", \"::\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2\", \"1F7EEC5.GE7:93.\", \"23E31F3AA32E927\", \"127.0.0.1\", \"2.5.6.2\", \"0:0::0:1\", \"5E838591B71:7.8\", \"0:0:0:0:0:0:0:1\", \"G457439A08AF7B1\", \"9.EC8328713CDD8\", \"3.908..30AC0C4.\", \"5.CAGBBEE5CA763\", \"2.5.6.2\", \"EDB.B2465414:4C\", \"2\", \"34FE9AF4D3:34:D\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"EAD8G23DA9A28A5\", \"B31CB3AB9:751:3\", \"8E5F3GFA14..0CF\", \"::2\", \"0:69C:14CCFBD2B\", \"0.0.0.1234\", \"CC3E.B77FFC5GA7\", \"192.168.0.1\", \"0:0:0:0:0:0:0:2\", \":::4\", \"5B9F.F6455A19:0\", \".1:6C051967BF81\", \"E3C0D6AA643FC9:\", \"596891AE18A79B6\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0:0::0:2\", \"1::2::3\", \"2.5.6.2\", \"41F5:4FB:97B.AC\", \"1:9258561E9:462\", \"BA.EFA31D016682\", \"C00A0G26.:7G17B\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"D76A8BB542885BD\", \"2\", \"0:0::0:1\", \":9A.F07DBF9AF31\", \"127.0.0.1\", \"0:0:0:0:0:0:0:0\", \"68D6GA75E245039\", \"GAB3D:D10BGA972\", \"1G2344B7G31E4B9\", \":1F25A5E052G1.C\", \":::4\", \"AF1C1A2ABC0258D\", \"2.5.20.1\", \"A11:F.E2:6:92C5\", \"D.5ED79271B8A2G\", \"8..G67FFDB8F744\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"DF:A593C65F7ECB\", \"6.:BDBD4E9544GC\", \"2.5.20.1\", \"AC30553F231GACB\", \"3AB187C355BEA79\", \"0G5:8CB8AC76FF5\", \"127.0.0.0\", \"::\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"D:8:G7E869G1..3\", \"2\", \"0:0::0:1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"4.3B96GC8G8.GE7\", \"8982F48G2G93.00\", \"127.0.0.0\", \"127.0.0.0\", \"0B4985865:7DB75\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"1::2::3\", \"    127.0.0.0    \", \"EBA8:A:E7B825D2\", \"15DC1CAC.:9D.BE\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"FG4E0BG:437F:64\", \"2.5.6.2\", \"0:0::0:1\", \"C8G9583A0.BFABD\", \"192.168.0.1\", \"2\", \"127.0.0.1\", \"D:A3GF0G0F0:578\", \":9F5G:04E9C1C94\", \"..4BF:.F086C452\", \"235:8E345C116.D\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"8DGGE5D1D90F1E1\", \"1::2::3\", \"3848226DBB70C:.\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"::\", \"E4:G80E93C6D058\", \"255.255.255.255\", \"3594FE51FA36CA5\", \"FB0174G0788B6B3\", \"2.59.6.2\", \"0:0::0:2\", \"55DFA9303.ECE.9\", \"A6C7A0B502FBAE8\", \"B4GB97090G..893\", \"0D3D78A6:690B80\", \"G3D42AA9C46BA:4\", \"    127.0.0.0    \", \"E6.C8CE80533:8F\", \"255.255.255.255\", \"70C1186EA7:5CAA\", \"::1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"1G4B94F08E.C.E1\", \".60G9A:C36G4.E.\", \"E:4975:2DCFD6F2\", \"7:GB0F4CE6EC0:F\", \"0:0::0:2\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \":0FG3G5D5CE8G89\", \"0:0::0:1\", \"G717BB5F6D.471D\", \"2.5.20.1\", \"255.255.255.255\", \"0:0::0:2\", \"::\", \"127.0.0.0\", \"192GC2D193.:E4:\", \"127.0.0.1\", \"1::2::3\", \"88702:C.8A:8:05\", \"9931GC22:FE6162\", \"::\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"F.AG381B99F94:7\", \"::\", \"255.255.255.255\", \"81B.B264:A2G800\", \"87.FDF43471FDF.\", \"3GE593GD27D:6B6\", \"86ADA760730FC08\", \"476:241504966B:\", \"14:1C7GA:GC5DC8\", \"127.2.3.4\", \"4E8G435C:EG:F83\", \"2.5.20.1\", \"39148CB465BD..E\", \"E5.6DFF7712DGFA\", \"B:31B46FC11AG0.\", \"0:0:0:0:0:0:0:2\", \"192.168.0.1\", \"EE5A2EB..::44.G\", \"D60BBGAB67GG01.\", \"...00.E:93G59B6\", \"E146AA17892.A56\", \"6C123.3BD45BFG2\", \"255.255.255.255\", \"AC8G4B3F9G3AFB.\", \"192.168.0.1\", \"4AGDC8CD.C7DC32\", \"1::2::3\", \"8B3GG7255D6.:9D\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"6FCD890BBF164GE\", \"::\", \"DE2.C35CE3179GF\", \"6:.FF9:4:5D79.F\", \"2\", \"255.255.255.255\", \"3DG:AFB032.931:\", \"B:02EC:71:48A91\", \"7G15BGA309D009G\", \"647GC4078:C27:D\", \"AD0AG2.4E58GG04\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \".2G9.A:B6B918E6\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"FEB6EG5FGC84EEF\", \".E8CFA8E5BC.G7E\", \"3A0G18515078274\", \"2.5.20.1\", \"F8390AB4G33:374\", \"1::2::3\", \"0:0::0:2\", \"0::0\", \"9.4E:3683BA7F78\", \"029B56.35C3D965\", \"127.0.0.1\", \"0.0.0.1234\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"EBB3.049FF0.165\", \"1EF1439:BG33.A3\", \"C4849527.53G989\", \"2\", \"6C115FE6725DB1.\", \"ECC8.121:26EDC6\", \"86E.78:DC459DG.\", \"300.0.0.0\", \"G..9CD4B011913A\", \"2\", \"DDFF265D0G90D2A\", \"4C9CCF92FGB680B\", \"86A13F53G12GFD3\", \"94CF:B1AE2GAE.0\", \"E:E:CD37BAF3C35\", \":0:3A8D7B79FDF2\", \"64F2554351F055D\", \"6G76:D1DG2B6FC8\", \"0:0:0:0:0:0:0:1\", \"755DB..2A0.27C7\", \"0:0::0:2\", \"5CF3D8AG8B:E5E.\", \"239DD8047G1.E05\", \"G573:F3ED522.D6\", \"9G07955F6:83:20\", \"008B0C785:B0E9E\", \"G7.4130.9203031\", \"0:0:0:0:0:0:0:1\", \":A23F735189..10\", \"14G0C63ECAC:791\", \"0.0.0.1234\", \"2833:7EBBDGB.5G\", \"8:A0B6EC.93EA.4\", \"::1\", \"F0B1G412DE08:CG\", \"E.0C1FF0F235:GB\", \"B82E47.F50886BD\", \"G10B74E8:9F6E4:\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"02F.9B37BGA82:0\", \":::4\", \"3:7B9C2B7CD31BE\", \"CC8G6EE3GDEE:42\", \"3BF34DAAA.B4CEE\", \"255.255.255.255\", \"04405B3433EDA8B\", \"2AB84A1E68E87BC\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"EG0198.6EDGDA:4\", \"0::0\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0::0\", \"127.0.0.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"192.168.0.1\", \"A8C0D0EABBDF9B:\", \"B6:.0.3D.9G0497\", \"127.2.3.4\", \"7DB:811929G21AF\", \"BD:99E615CGG7ED\", \"::\", \"69AD80.09299FFE\", \"8486GCA254026AD\", \"1GBB63GFDG7:960\", \".EA7241DD83F00B\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"ED:ED7GDFBDF985\", \"1:3GGGC16246DC5\", \"A0.B90D13180GE0\", \".:G6C11FG9CEC4.\", \"0::0\", \"E0DB0A5EF:E4C33\", \"300.0.0.0\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"127.0.0.1\", \":.FBF86G9E0CFAF\", \"8FF623CF.F5098:\", \"2\", \"0.0.0.0\", \"5:3.4F18CDG:FA9\", \"60:AG1:.8G36.60\", \"69841CBD:07EEF0\", \"5D.250C00BF865C\", \"::/0\", \"0::0\", \"EA312GE758:B4BC\", \"08E7.2.:7.69600\", \"127.2.3.4\", \"::/0\", \".B519B.A64447E4\", \"0.0.0.1234\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"CA.:AFD7A.1186B\", \"0:0:0:0:0:0:0:1\", \"EC:A471D:532863\", \"88FF92ECBED6C5.\", \"2.5.20.1\", \"127.0.0.1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"9D24C25G6EGAC97\", \"2.5.6.2\", \"0:0::0:2\", \"0::0\", \"300.0.0.0\", \"0:0:0:0:0:0:0:0\", \":3E53D3CF7B1DEB\", \"CA2B98AEEG7A06C\", \"::/0\", \"B1C7F38G141.1FC\", \"94DC42E67CG680C\", \"DD134DBDBBAC62F\", \"A815EC:0BDG6FFB\", \"127.2.3.4\", \"0.0.0.0\", \":C2135904:BGD25\", \"0:0::0:1\", \"ECAF05.D7287G4B\", \"0C.6D:576FB014.\", \"C658:179870:FA9\", \"GF1B00A85A11C51\", \"0:0:0:0:0:0:0:0\", \"2:D1DA9FAC7597D\", \"0G318F78872A3A:\", \"127.0.0.1\", \":::4\", \"127.0.0.0\", \"2.59.6.2\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"::1\", \"E:91G:E9DDE3G:F\", \"E3DA78C8E6015D:\", \"127.0.0.0\", \"FEBD85:2.2.CA.0\", \"A1G9A37G7G1E6G5\", \"    127.0.0.0    \", \"B7E5:::CD4FA1E:\", \":9..67C14B9.FG.\", \"B79:2073..6.1DC\", \"3EB60FD1G5.6D:4\", \"2.59.6.2\", \"CG92501.C.CA4B5\", \"2.59.6.2\", \"0:0:0:0:0:0:0:2\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0:0:0:0:0:0:0:0\", \"GA774BG9DG5.E40\", \"48:620:63DCA83G\", \"C45.40CA2B:A60B\", \"3:E3G49EA748208\", \"0:0::0:1\", \"192.168.0.1\", \"::\", \"1F11DEF5B7E8:5.\", \":9E.FFC9BF3E71:\", \"255.255.255.255\", \"127.0.0.1\", \"3G:ED9.D12:7.AD\", \":::4\", \"83E329E1G79D6FG\", \"0::0\", \"0:0:0:0:0:0:0:2\", \"52823EF89DE0056\", \"E9930E.D22B1E76\", \"AD1CEF073C1CFAF\", \"::/0\", \"2.59.6.2\", \"2.59.6.2\", \"0:0:0:0:0:0:0:0\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"::2\", \"33EC.1D2C38G891\", \"4.G4:2080B43CFB\", \"ABG3AFE2.FF1B2E\", \"127.0.0.0\", \"0:0::0:2\", \"127.0.0.1\", \"2.5.20.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0::0:1\", \"3454153F610843.\", \"B03578A.2ECA692\", \"300.0.0.0\", \"A59G.5:5468ACCG\", \"127.0.0.0\", \"0::0\", \"6GE:99C2127D51F\", \"55488F1G6DGG44E\", \"6B:GD:42276F011\", \"300.0.0.0\", \"1::2::3\", \"G4C.F0.:CE4D19G\", \"0.0.0.1234\", \"0:0::0:1\", \"000165F9B839EFB\", \"B29010G111D:791\", \":E3CG:BB72B261D\", \"1::2::3\", \"BGA590D8C.36G60\", \"DA843A8:ECG7:C8\", \"7FD:.BA0009C30D\", \"2.5.6.2\", \"91.CF18.86BEG.A\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"51BCBBBC.21960:\", \"::2\", \"0.0.0.1234\", \"192.168.0.1\", \"255.255.255.255\", \"::2\", \"7B19E9BB841.A.B\", \"2.5.20.1\", \":B85C3DCG9:BD84\", \"0:0::0:2\", \"18D945GAC46EF.7\", \"0:0:0:0:0:0:0:2\", \"1::2::3\", \"A7D2.70GG87730C\", \"3AB6CGA5CCE9E40\", \"39291F48AFG3837\", \"D193A57B954GFE6\", \"19F8E5ABEG5D71A\", \"G::31CC0A367831\", \"2\", \"F067E14D.70G.CC\", \"127.0.0.0\", \"2.5.20.1\", \"6B:B1:5:2:84B25\", \"255.255.255.255\", \"05840G91EED1AA9\", \"0.0.0.1234\", \"F017.6G7G826073\", \"2.59.6.2\", \"EA495701.81A39C\", \"::/0\", \"0:0::0:1\", \"8FGCD6ABC8523G6\", \"D429DF0:1F4ADD.\", \"24B.B02752ACG52\", \"2.59.6.2\", \"2.5.6.2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"G9FG3A717G.18DE\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \".E4B.B77F612DC6\", \"10DD43G6DG87A80\", \"::\", \":::4\", \"5.372F59E0454.C\", \"8:C9F8..4D61.44\", \"127.0.0.0\", \"::\", \"192.168.0.1\", \"AG12A2.0B80DE04\", \"D.A6.4D5DA6A2B9\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0.0.0.0\", \"4:..0.108D291AD\", \"222C3300:.8F75F\", \"61C9C::1B70257F\", \"::\", \"127.0.0.1\", \"::1\", \"0::0\", \"0:0::0:1\", \"FC9.E326CAE35D.\", \"0.0.0.1234\", \"9D9G2::059E:419\", \"::/0\", \"0:0:0:0:0:0:0:2\", \"D1:067399C048D0\", \"AA00870C89E34:B\", \"127.0.0.1\", \"127.0.0.1\", \"    127.0.0.0    \", \"0::0\", \":09236A.5D:3838\", \"::2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0::0:1\", \"::\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"192.168.0.1\", \"192.168.0.1\", \"1685B:A74CCAE4C\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \":::4\", \"::/0\", \"...:4GB71267500\", \"0:0:0:0:0:0:0:1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0.0.0.0\", \"4ECD29BDA9A::D4\", \"A3812E41C.0860B\", \"FDA88E.E08AF532\", \":::4\", \"F48DDD648:GA.:F\", \"0.0.0.0\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \":::4\", \"255.255.255.255\", \"76A2B6F4EE6C3C4\", \"EB5D833C8FDG.02\", \"CA3343558BB.:8D\", \"0GA166.FEC7F491\", \"2.5.6.2\", \"G15G5B663017.:9\", \"B7F78.072A5F08C\", \":::4\", \"500G3.68C28DD34\", \"127.0.0.1\", \"AE.F:D53E88G:.3\", \"7A274E15761.647\", \"9D4CE179CF0GF..\", \"192.168.0.1\", \"127.2.3.4\", \":AG81EE8F.8.9A6\", \":::4\", \"192.168.0.1\", \"0::0\", \"192.168.0.1\", \"2188GE43F26:D6F\", \"127.0.0.1\", \"::\", \"127.2.3.4\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"F36G:332158A429\", \"3:F8D4::1B67714\", \"38G1D4DBA:6C:61\", \"C8139115454..34\", \"6GG.8GF650D66.8\", \"6.B3D4B4D5A.782\", \"192.168.0.1\", \"54C6F4DDEF9G3.:\", \"A6.794B8.9G60G9\", \"C3AC61801.3069.\", \"0::0\", \"255.255.255.255\", \"8GGB7G26C16AB0B\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"3EC43938:7E38F1\", \"5C7E:6D76.5FE38\", \"F2DA.E.C376672D\", \".G76:.2.C64459A\", \"0:0:0:0:0:0:0:2\", \"ACB.4EC2BC1E.4B\", \":::4\", \"13.CB8329BB2908\", \"0:0::0:2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"57723.7C40F9196\", \"CFFG2.D193B0G9C\", \"127.0.0.0\", \"G4EEG1E69E63EC3\", \"32FE.AFA:C4C104\", \"4EE434GDB69DCC0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \":8AFB77488:4BDE\", \"G:A1590F2028.24\", \"::\", \"0A61GBCB1524.DD\", \"AE1CE332G3AG62E\", \":0F9:C4A:3C7535\", \"2.59.6.2\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"DFEB8FC4AB3C4B6\", \"5G.F1B1B4AA02B1\", \"192.168.0.1\", \"E00.3F0FA8DG:AE\", \"G37D5F6F34::B34\", \"0.0.0.1234\", \"2F8:D99CD268632\", \"127.0.0.1\", \"::1\", \"2BFEBBCA.7G5:FG\", \"A.G4:9DG806B04D\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"C39BGFGEG571BD3\", \"46A5.7.8078B9C3\", \"127.2.3.4\", \"D99C87G4GB8F2:1\", \"CGF4366F423.2GG\", \"A6B60B22A784:23\", \"::/0\", \"127.0.0.1\", \".004A35270833:3\", \"127.2.3.4\", \"5C8D38.:82G288B\", \"::\", \"2\", \"B81F0DG7.98:7:C\", \"192.168.0.1\", \"AF94DD791E:B.64\", \"99346G75FFBC83G\", \"0:0:0:0:0:0:0:0\", \"5D1:3.5GBBF3BD2\", \"0:0::0:2\", \"0:0:0:0:0:0:0:1\", \"2.5.20.1\", \"05FD1E.698EE74A\", \"127.0.0.0\", \"D62.901FB17CG7G\", \"854.:A.454GB18E\", \"::\", \"::2\", \"D.4D96CE0:C4.48\", \"1::2::3\", \"81:00EC60D32C5B\", \".5E765B7F6:C.47\", \"BG.G5889468:D28\", \"255.255.255.255\", \"0:0::0:2\", \"G3::F9D4904A:D4\", \"F0C2C303EG:E6E0\", \"CG8D779EFA2FABB\", \"    127.0.0.0    \", \"4AG7:DC8DACE5B9\", \"2.5.20.1\", \"A214CG7G4CD9C84\", \".8B:6F2C:.1021A\", \"9503BB:1332.6:E\", \"808.9174DG9A83G\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2.5.6.2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"1884A74C5CG058C\", \"E14A3991D97E7E7\", \"127.2.3.4\", \"0.0.0.1234\", \"2.5.20.1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"6B:AAB5243B16G2\", \"    127.0.0.0    \", \":::4\", \"2CFG293.9G18A74\", \"0:0::0:2\", \"38A2F6B39489F7F\", \"2\", \"::\", \"A8G68A3A:EF5:G4\", \"2.59.6.2\", \"0::0\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"7:395GGFAED011B\", \"0:0:0:0:0:0:0:2\", \"192.168.0.1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0.0.0.0\", \"    127.0.0.0    \", \"0:0:0:0:0:0:0:1\", \"127.0.0.1\", \"GAEDD0..97E51G4\", \"0.0.0.0\", \"96B3732GD1E6F74\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"A124F7237EBA0E2\", \"3B:G:B6F6G91BC4\", \"B:0B6565E88BA31\", \"255.255.255.255\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"300.0.0.0\", \"127.0.0.1\", \"0:0:0:0:0:0:0:0\", \"G91GG1DA3.76C9C\", \"::1\", \".65F5:11B13F103\", \"0.0.0.0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0.0.0.0\", \"1FD4ADEDAA52A81\", \"2\", \"127.0.0.1\", \"D3326087A3B5G91\", \"0:0::0:2\", \"G7C34:2747D3997\", \"88EE4:9028C:9B9\", \"03GAG24G042727B\", \"::2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"1::2::3\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"7DE8B0B84C398AC\", \"127.0.0.1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"3G6836A4F035:D8\", \"9212D549FDAD9D0\", \"::1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"::\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"6E02CD98307AF.8\", \"::1\", \"3760F0D9DC8G:9G\", \"A2.7BDE:6015591\", \":A50DA89.D22238\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"9333B33:FGGF089\", \"127.2.3.4\", \"    127.0.0.0    \", \":1.GCC494649.3.\", \"::2\", \"5GF:05D2252F::B\", \"E0F934C9C9.5B46\", \"0:0:0:0:0:0:0:2\", \"FA04::B.6.:5G79\", \":946FA7.G05G4A1\", \"A3546D5E:DG108B\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \".BBF7C4G75EA70D\", \"::1\", \"    127.0.0.0    \", \"D0G3DF:7B375340\", \"C3:6D3.:4.965AF\", \"::\", \"B3E84545F4::6B4\", \"E:F89.CG3C9620:\", \"2\", \"A8F55D430:36DFA\", \"2.5.20.1\", \"127.0.0.0\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0.0.0.0\", \"GD98.1A7BBFG6F.\", \"G228:22988GG.5.\", \"42BF9319D.8:296\", \"::\", \"67F:0BG51218825\", \"1::2::3\", \"::\", \"2.5.20.1\", \"9F9B823C5:GBD8G\", \"1::2::3\", \":D7447G85C.35A1\", \"425ED3E2AC1333F\", \"    127.0.0.0    \", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"1FE33.3EABG66B5\", \"C5BE82556EGDDFA\", \"3:61G.A9E44DG9.\", \"54AEF.:.E76BG55\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::\", \"192.168.0.1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \":B:7483242EC15A\", \".3:.7.71B4F0.D7\", \"FB224F7D24EC4C.\", \":::4\", \"8F.FDF8B:6E330B\", \":.962F51.E48192\", \":::4\", \"FBC5B596GD451B6\", \"0:0:0:0:0:0:0:1\", \"0:0::0:1\", \"127.0.0.1\", \"EA:B5E.C36F6C7.\", \"127.0.0.1\", \"127.2.3.4\", \":::4\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"9CAD.EGC1543G.C\", \"0:0::0:1\", \"255.255.255.255\", \"E1DD5EE0CEE5A0C\", \"0::0\", \"F4D5FEDC:559062\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0:0:0:0:0:0:0:1\", \".C36.A.24CE9EA6\", \"2G0C7748089:DGC\", \"2\", \"0266:G48G0A8C83\", \"GD4E01F.A842849\", \"0:0:0:0:0:0:0:1\", \"1E.32GGB:4186.3\", \"127.0.0.0\", \"0:0:0:0:0:0:0:1\", \"FACD9498GD23B3C\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0.0.0.0\", \"7F2:DB:9E.8BED0\", \"192.168.0.1\", \"127.0.0.0\", \"0::0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"C4C4781C728C::.\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"1CBF5DGB:DBC2EC\", \"    127.0.0.0    \", \"A3:0ADE500BF:EC\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"88BEGFC26D0CEF8\", \"854F.5F9A.4F::8\", \"277CCGDFBB96FE8\", \"127.0.0.1\", \"7DE7442AF7390.C\", \"C223F110732A29D\", \"::2\", \"::\", \"650B.62DB7ADC8B\", \"1::2::3\", \".3:C:CD58A.95C6\", \"37F:3DDB.660742\", \"::\", \"127.2.3.4\", \":::4\", \"G06G.E712FDE:G9\", \"::2\", \"C8AACE9.52F377D\", \"0:0:0:0:0:0:0:2\", \"0.0.0.1234\", \"2\", \"E4D095DB901E1.C\", \"05E9148730F39:8\", \"0:0:0:0:0:0:0:1\", \"CF:0A7110GFCDCA\", \"::1\", \"127.0.0.0\", \"53AGGECAFCA5E70\", \"ACB5D02834::F14\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"127.2.3.4\", \"127.0.0.0\", \"BFDE14D.43.6AAC\", \"1498.F.D8B765G2\", \"::\", \"9B297174A60G2.A\", \"127.0.0.1\", \"2.5.20.1\", \"6A:D109G96.5.A5\", \"0:0:0:0:0:0:0:2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"    127.0.0.0    \", \"0:0:0:0:0:0:0:1\", \"4C:2FD:275217:5\", \"2.59.6.2\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0:0:0:0:0:0:0\", \"4G6D78.FA191D7G\", \".E:D9:D:9D69:41\", \"0.0.0.0\", \"6G.E0E801D93C28\", \"1A9343G903DG0B2\", \"1::2::3\", \"2.5.6.2\", \"D9B5E:A71EG:C7D\", \"0.0.0.0\", \"3:8E1F820F78078\", \".8BCB87287B4A2D\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"B01FDC:D1.C74G7\", \"D87B37C255D6B07\", \"0.0.0.1234\", \"0.0A.6G1GE61E.F\", \"3B.8DADB72:..89\", \"::\", \"A292:5:3F88AG46\", \"007209E:6G43F39\", \"EE242F658280:C7\", \"0:0:0:0:0:0:0:0\", \"4463CD792851697\", \"9ECB96DB39.GBDE\", \"D3:G8C14:86CF19\", \"300.0.0.0\", \"E6:FDED4DB:6957\", \"14DFB0ECD1AA5:9\", \"AAED8CB6879C:20\", \"CG.BGB4221:F00:\", \"1B26F4415F97:51\", \"127.0.0.0\", \"F3B0E42B.568ABE\", \"2.59.6.2\", \"81.573E.0AE39B.\", \"78784B.2B32B4EG\", \"EEB05::CA:E7A29\", \"127.0.0.1\", \"2.5.6.2\", \"2.5.20.1\", \"C9DF.3B8:79F46B\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"172:84GEA3F422B\", \"1::2::3\", \"B8ED156312.AD5E\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"B729EFA3GF74FG1\", \"4FA.C99B20BFB55\", \"0.0.0.0\", \"    127.0.0.0    \", \"4A755DC5D16DG6G\", \"2.5.6.2\", \"127.0.0.1\", \"D0::2:2F9CC:60E\", \"489033EAD89C062\", \"DAA72.E7GD2F0:8\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"4094698:9F:6.CG\", \"8C146.0.3AAE2.:\", \"192.168.0.1\", \"192.168.0.1\", \"0:0:0:0:0:0:0:1\", \"0:0::0:1\", \"735C707957:925F\", \"FC.54D06982095:\", \"FG19B73GG3A5740\", \"2.5.20.1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"25B2A25DFFFA67.\", \"2\", \"::\", \"0:0:0:0:0:0:0:2\", \"2.5.6.2\", \"3:F0:3C9GGB36F:\", \"0:0:0:0:0:0:0:1\", \"B6F1DA:AEF8DF56\", \"5FB.DAF1CG7EG.4\", \"G497C64E9F5B10F\", \":.B1C3B:39.6680\", \"6CE.FG2E8G:2D..\", \"49EG7B5E3C7E81E\", \"0.0.0.1234\", \"300.0.0.0\", \"87BG04F47466D04\", \":::4\", \"0::0\", \"300.0.0.0\", \"966C2EED:AGC960\", \"0:0:0:0:0:0:0:2\", \"53:29A574A2A0BE\", \".65B:44A4EB20D6\", \"127.2.3.4\", \"DFBD.51.835820C\", \"0:0::0:1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0712986BAD0:3:F\", \"E48:D5F1E175:B5\", \"192.168.0.1\", \"9BAA47EFG0GC939\", \"02508:4G.8F34AE\", \"::/0\", \":::4\", \"567B9E1.A1.1999\", \"::2\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2.59.6.2\", \"192.168.0.1\", \"2.59.6.2\", \"::\", \"0A9FD:G8GF:61GC\", \"618874:A020576F\", \"C.036F5C08D:026\", \"D90616F562B2D1B\", \"::\", \"::\", \":::4\", \"70:5:BCB:62EBC2\", \"::\", \"99A72::0E46312F\", \":::4\", \"32C4:0088C:4764\", \"59:671:94F3ED32\", \"395B5E06G::2F51\", \"3055A99128:93F0\", \"8AE0D90G2443E5.\", \"127.0.0.0\", \"6A32598G48:D1D1\", \"7.1AGG54:DD3D6E\", \"C8C7EG4DFFA70E3\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"5G8D746GG377428\", \"192.168.0.1\", \"127.2.3.4\", \"9B3.DD3E8CF8391\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"ED:FAEF:2794.E1\", \"FD1E4B0BC0DDG4A\", \"::\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"AD.9FD290FFBF15\", \"GB7AFBBB74EAF54\", \"2.59.6.2\", \"D581803B2:9.AC5\", \"0:0::0:1\", \"361.6B6.2.9839.\", \"E.3A4DG0D.362B.\", \"F7720AF:0.03068\", \"::1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"::\", \"08CD53:BFE9G:42\", \"..F4C:08179G:18\", \"CBF.49FE733A26D\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0GC008C290FFG:.\", \"D31A.B4EGDG828D\", \"::1\", \"0:0::0:2\", \"::\", \"21EA96658DB18.:\", \"2.5.6.2\", \"127.2.3.4\", \":::4\", \"127.0.0.1\", \"127.0.0.1\", \"::1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"BA8:419A:40.BC8\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"A87FB6..:B14D9.\", \"0:0:0:0:0:0:0:0\", \".6A7B2CB.6:4.4C\", \"2.5.20.1\", \":::4\", \"::/0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"9E1BAE90280FE3C\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"BG308.F2F7F467C\", \"G2.0ADGC130D715\", \"0:0::0:2\", \"255.255.255.255\", \"9E8.3A85.ADD:35\", \"2.5.6.2\", \"B41G7GF.3A2:D88\", \"30BFDA.EG.98F40\", \":6AD.3.B:.1B250\", \"0:0:0:0:0:0:0:2\", \"127.0.0.1\", \"0:0::0:1\", \"127.0.0.1\", \"84680D8BF2BBE5:\", \"03543939EF0G.F6\", \"::/0\", \"::\", \"C9D.5947DDE5B4:\", \".3081A3EG8FBFB3\", \"::\", \"266376C0A81DEFF\", \"0.0.0.1234\", \"82F0.G06CAA:G5D\", \"0.0.0.1234\", \"0:0:0:0:0:0:0:0\", \"84A5G11A.C1BF2C\", \"E24G8E.BFA865F5\", \"127.0.0.1\", \":D41038CF:3D0C9\", \"AAF8.A7B:6513A5\", \".1F8BDF32689FE7\", \"5ECF8C87B09:F.4\", \"36872C49.0G3D4D\", \"127.0.0.1\", \"7E5.7015C2GA.83\", \"D96DF18F17G:2ED\", \"4CE.513G85003.D\", \"DGAGG.2BD9C1.BG\", \"4:1428E3:CB.4E8\", \"39:BA6EA13248F3\", \"0:0::0:2\", \"3F04A5561E:G6D5\", \"1420B6442G1:4EB\", \"9:778CC7.A:8BD5\", \"0:0::0:2\", \"::\", \"ECFEA.FBD029FEF\", \"2.5.6.2\", \"0:0:0:0:0:0:0:0\", \"8FD4:B422BD3CD1\", \"DD3E4:9822.1C53\", \"0:0:0:0:0:0:0:1\", \"0:0:0:0:0:0:0:2\", \"2AE5F60927105EA\", \"2CGF8.4550FACAF\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"4272256514B635B\", \"0:0:0:0:0:0:0:0\", \"8GG.5.EC:8:4G.0\", \"127.2.3.4\", \"127.2.3.4\", \"B56G::F59F5B22C\", \"0:0:0:0:0:0:0:0\", \"6524965A900CE77\", \"90F211.2.A5BG94\", \"24C2440G7758624\", \"0.0.0.0\", \"8F5D4D2E04D11FE\", \"EF87B1D21G10615\", \"3..01B.6E:7B7F.\", \"D5:4E7:5FA.4C6:\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"AD:8G7648G4B820\", \"0:0:0:0:0:0:0:0\", \"2.5.20.1\", \"::1\", \"297289AAG0D98.2\", \"EC40.828C1D9F0F\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"8CA1:B9E2.57G05\", \"0:0::0:2\", \"401DADF417A7193\", \"C:G2D9E936:43FA\", \"9G.8E46306:84F3\", \"F877ACG3F73ACCD\", \"D41EA.:6928005D\", \"D.6C7CD1::02576\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \".GC1354972:B5E2\", \"1D21:0.3AGF707.\", \"D:BAFA542GD67G:\", \"9:559772E:4D28F\", \"192.168.0.1\", \"127.0.0.1\", \"2.5.6.2\", \"ABC9E823.DG6:88\", \"127.2.3.4\", \"0:0:0:0:0:0:0:2\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"F3E8.D:GB7G9A:E\", \"0::0\", \"2\", \"6.1E0:D.9.D.D96\", \"2.5.6.2\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"E9GGB1E.19F339G\", \"    127.0.0.0    \", \"0.0.0.0\", \"51648447G7177:F\", \".FC.72CDACE.E30\", \"0:0:0:0:0:0:0:0\", \"::2\", \"2.5.20.1\", \"A08990:640G3392\", \"1D3CA448845C89:\", \"::/0\", \"62E1635:2FFEE3E\", \"BD64G:511.A08C9\", \"::/0\", \"0:0::0:2\", \"..B6A0471758GGA\", \"D:A:G940F2C4:9E\", \"5G565B2.0:E33B7\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0.0.0.1234\", \"BD37F9A2A438:69\", \"::/0\", \"0:0::0:1\", \"79798FE23:1F48C\", \"::\", \"    127.0.0.0    \", \".18G0BF.F935D.A\", \"2E.CC3:C3A14G7.\", \"0:0:0:0:0:0:0:2\", \"255.255.255.255\", \"E63692D451CB99.\", \"0.0.0.0\", \"084GA.8AEA.GG0E\", \"CFA.5E2C1.7EB5D\", \"2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"9:8BE76.G8886A.\", \"0:0:0:0:0:0:0:1\", \"::/0\", \":::4\", \"8.1592B:4BD218F\", \":4CEG255FG4ED0E\", \"1:C6EC5.:43BAEA\", \"2.5.20.1\", \"2.5.20.1\", \"::/0\", \"3A88EBD0A965782\", \"27D8888GG4E5DG4\", \"B3DAA92:8.72G17\", \"127.0.0.1\", \"EFD0D2D0E39A43F\", \"709384844E02G2G\", \"2.5.20.1\", \"B.FB6CC82BG04:F\", \"F5:119.E9C40CE7\", \"::2\", \"9DA5786312B08GC\", \"0.0.0.0\", \"0.0.0.0\", \"FCA1312.16B0DB0\", \"1::2::3\", \".28EF70444GG4D8\", \"255.255.255.255\", \"00CF81B..2G990.\", \"::\", \"G58E69938255:0G\", \"22181EC89B7GCB8\", \"0:0:0:0:0:0:0:2\", \"2.59.6.2\", \"EEC06FD6.ACG39.\", \"0:0:0:0:0:0:0:2\", \"F596202DB8GC4.G\", \"192.168.0.1\", \"2.5.6.2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"G12A.C6.DB85DE2\", \"    127.0.0.0    \", \"192.168.0.1\", \"9B:F3..05993DF1\", \"G8DE25ADAAE15B0\", \"2EF4G9F28GDBE9E\", \".75G7068581.B71\", \"4A7FDFC.A0F0434\", \"CDD7.945D3E5C2F\", \"D20G7G50C:B256E\", \"2:B3DF42F072EA5\", \"0:0::0:1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"F77101:26B1ED8:\", \"0:0:0:0:0:0:0:0\", \"::\", \"::11803E393E8DC\", \"02338CC80DE0:17\", \"00GF96G6BGB2094\", \"8D54CAA:746.585\", \"82959GB.A66.GD6\", \"694C93::91B81EG\", \"255.255.255.255\", \"192.168.0.1\", \".:1739FAF015D22\", \"255.255.255.255\", \"192.168.0.1\", \":79C8EEC86AB1A:\", \":8ABG001.4.G7B6\", \":::4\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::2\", \"127.2.3.4\", \"0:0::0:2\", \"15FCA..:1F.0038\", \"::1\", \"127.0.0.1\", \".2FGDG59.113EC5\", \"2272:E35D279235\", \"3:G:91670B7A48E\", \"0::0\", \"192.168.0.1\", \"127.0.0.0\", \"0.0.0.1234\", \"041B0356D53BB94\", \"G06.D:14A2FFEA.\", \"0:0:0:0:0:0:0:2\", \"2.5.6.2\", \"2G36B5553A52FGB\", \"73852C85:398D19\", \"457B::A.7AG51E8\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"192.168.0.1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"155A3.:685C540.\", \"04DB5:9AB02077.\", \":::4\", \"CA6DF:F066BBE97\", \"C7CCD0B20BB76FC\", \":84F48684F4610A\", \"5.12353949C1.03\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"6D99GGA3AEGD857\", \"::1\", \":B8DF91D7FDD387\", \"E:00.53DFB.9512\", \"::2\", \"B2.37D697:F991A\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"85E2758F38086C8\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::1\", \"46D:F011.13CBD0\", \"C5G4372D8371F7D\", \"AB3AFBB0D914CBG\", \":::4\", \"::\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"127.0.0.1\", \"G08:AB7.28F269B\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"6FE2:4BG277EBDE\", \"2EE6E7C8A5C6C7D\", \"1E3BB3.1ADG1FA3\", \"4B06761:7B80G9C\", \"88C38G3A5D5:7:2\", \"127.2.3.4\", \"127.2.3.4\", \"1::2::3\", \"E2:G.5G11F5.1G5\", \"0:0::0:2\", \"0:0:0:0:0:0:0:1\", \"2.5.6.2\", \"0:0:0:0:0:0:0:2\", \"0::0\", \"2.5.6.2\", \"::\", \"::\", \".1:547GB514A700\", \"2\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"ED1A1D5G40D5G00\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"::\", \"B666CD39AB.AC8G\", \"E2DFF059.7C1A2C\", \"3048..DD1B3078B\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::1\", \"127.0.0.1\", \"C:G:3477B5CA:F5\", \"0.0.0.0\", \"2.5.6.2\", \"::\", \"372CD1A6:90EFC8\", \"B.G99ACBFB0:E.E\", \"5:26F5F.85:8D57\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"95GEG1707CEE4FF\", \"CE9D9F:4CAB909G\", \"300.0.0.0\", \"::2\", \"3F6D96D5:C6AB36\", \"FGDEC22EG8D1G62\", \"0::0\", \"153.G:4BG4EG67F\", \"0:0::0:2\", \"8D5B6.5.DF33C66\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"300.0.0.0\", \"8378FA43:45430D\", \"::1\", \"4AB9830CCB7.70:\", \"C2680.G07D:CD26\", \":::4\", \"0:0::0:1\", \"0.0.0.0\", \"1G5G235E26E3C.A\", \"784FAE.9755D249\", \"2\", \"2E8B7B2DE68E18:\", \"D6:FC2FE35110F8\", \"255.255.255.255\", \"127.0.0.1\", \"0:0:0:0:0:0:0:2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::1\", \"3FG7AE24252E.21\", \"..GDECGGEC.7G0D\", \"B.45F390:045GGF\", \"A86B57GE3:107E4\", \"4E29B92969F062F\", \"..6AC66E6.691C3\", \"127.0.0.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"127.0.0.1\", \"2.5.20.1\", \"31.AB02994GECC.\", \"0:0:0:0:0:0:0:0\", \"0:0:0:0:0:0:0:2\", \"5E::0G0GCF69440\", \"300.0.0.0\", \"0:0::0:1\", \"5:.0F:13.4DG320\", \"127.0.0.0\", \"300.0.0.0\", \"4B.332CC7EC34:.\", \"54159GDBG42GA:0\", \"B:4GF93.GA:D4GC\", \"F:1.C62BB29B112\", \"9E231GCB1F4DB92\", \"8C7B0G5:5.12720\", \"255.255.255.255\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0.0.0.0\", \"4B61B4GC13E7FEA\", \"CE7A.11BC2G7FB.\", \"0:0:0:0:0:0:0:1\", \"2\", \"E79CE57312F9339\", \"0:0::0:1\", \"9FCG019FA4E0CA.\", \"127.0.0.0\", \"5.E940D312C5.G2\", \"2\", \"F86E83E616E3CE6\", \".5F94G8.:CGB946\", \"::2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0EC9B97C1B40:61\", \"::1\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"::/0\", \"127.0.0.0\", \"0:0:0:0:0:0:0:0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"7EEG4ECE94D34B5\", \"127.0.0.1\", \"3C..48901A91335\", \"FE76C5079336B8A\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2.5.20.1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"DA.137A0F8A0D5F\", \"33EE9D1D210CCEA\", \"4A.0475B985E:9D\", \"A3489E22EE677:8\", \"2.5.20.1\", \"932.165DE59F90C\", \"78G8:52599GE983\", \"1A.8GD65D9BD4A5\", \"137.68:FBB1A:43\", \"069852BDB::.AG.\", \"94CBB4C:7EF71.D\", \"2.5.6.2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"90FCE069.58EF48\", \"127.0.0.1\", \"0:0::0:2\", \"E05F16609G024B1\", \"E3455FDGGACC.FG\", \"0444FFF.EE:811E\", \"EFE0:E3507GD6FE\", \"2.5.6.2\", \"74FFC97B5520E3G\", \".2D0FAEE88G06E.\", \"::\", \"E:6C306.GBE7100\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"42BCE:.B582D5BG\", \".D01BD97AB27G80\", \".29308:1D056977\", \"67.B2C1F6EE86FE\", \"::\", \"7E7GCE9BF:141G8\", \"    127.0.0.0    \", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"127.2.3.4\", \"67C:.2.25795B3.\", \"2.5.6.2\", \"6B606:874:.92.8\", \".027129C:2FDE8C\", \"4GE39G::6F5E:B.\", \"2.5.20.1\", \"4CG70EEC61AAC.1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0::0:2\", \"46B422::BE2G.2B\", \"1::2::3\", \"127.0.0.1\", \"0:0::0:2\", \"::\", \"::\", \"0:0:0:0:0:0:0:1\", \"0:0::0:2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"255.255.255.255\", \"0181413B2814506\", \"E2:808147G49AC6\", \"A2D99944BB74G74\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"300.0.0.0\", \"0:0:0:0:0:0:0:0\", \"D236F2GEBE908C.\", \"A826C7:484BCECE\", \"163C723F00::9.E\", \"661G07:CG0E44G9\", \"127.2.3.4\", \"7A8CAC55F60BEDD\", \"0:0::0:1\", \"GEBC4G92557A0:3\", \":::4\", \"0.0.0.1234\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"1GDDFGGG29460B7\", \"2.5.20.1\", \"1::2::3\", \"549GBD391A13747\", \"255.255.255.255\", \"G71BCE66C0D1580\", \"127.0.0.1\", \"3E23511EA663BG.\", \"DG0F:1:GG4.75:3\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"2.5.6.2\", \"0.0.0.1234\", \"5G032F019.2E:BD\", \"12C8B7352D6:5CD\", \"45.F6F4CE0E6F21\", \"0:0::0:1\", \"0:0::0:1\", \"255.255.255.255\", \"::1\", \"7ABA7925B61DE73\", \"E1FFF628754BFB5\", \"D18B863FBAB.93E\", \"FAD2.EGB7GA42CG\", \":::4\", \"6:9A392CC4FD888\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"9BDF6B:5BF5BC8A\", \"127.0.0.1\", \".3.749C4EA:832G\", \"0.0.0.1234\", \"::\", \"2.59.6.2\", \"G7FA6D.C0E5D9DF\", \"127.0.0.1\", \"B356.0G651C282E\", \"EB7:FD3339BAB8B\", \"2\", \"1::2::3\", \"::/0\", \"3CD2:224D7D:GGE\", \"4B3.985ACGBB27E\", \"0.0.0.1234\", \"AF5:074D42B0.3:\", \"6A76D762E194EA:\", \"0::0\", \"9E99G.1BD8.12E4\", \"4705C21:1605B4D\", \"351909.7:CEC531\", \"7B8.E3033187:1D\", \"255.255.255.255\", \"0..89G47:D:GAE1\", \"47.83CA699GC3GD\", \"300.0.0.0\", \"869CG8F47094102\", \".3927CBD26G1F4A\", \"578A6G4B8BEGE::\", \"E0347A2::40B60G\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"127.0.0.0\", \"2.5.20.1\", \"0:0::0:2\", \"70E6FFA8GE1848C\", \"FB989EFEC189.7F\", \"::/0\", \"1::2::3\", \"31G324F:82:2674\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"56:GGGF5DBFB2.2\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"FE6.C2A29:57G2.\", \"BBD3::15D.E51.8\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"EFFG6E00G.43685\", \"192.168.0.1\", \"86DG81GB0GF9C73\", \"AB76BGFED91CB.6\", \"0:0::0:1\", \"0:0:0:0:0:0:0:1\", \"8E35EEBBG9:49.G\", \".CEG.DF9.AC1433\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"::2\", \"C6687DG49905F1E\", \"C1FE7B3E55E3.8D\", \"B255783GFD7EB86\", \"1F6:FC:0010.2A.\", \"BE3B9F005FEF385\", \"87:623018FBE06F\", \"33AE79G35F25315\", \"0.0.0.0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0::0:1\", \"127.0.0.1\", \"2.59.6.2\", \"5B440.3FD1DCAC:\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \".1265..D88E014C\", \"2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"192.168.0.1\", \"0:0::0:1\", \"0.0.0.1234\", \"2.5.6.2\", \".0A1580:D.GB.15\", \"96A7G9.BC5420..\", \"A7D61CD7A0:BC.3\", \"1CDAFC3FE6A4727\", \"0:0:0:0:0:0:0:1\", \"2D8B:8ADE18499C\", \"298ADGEC5:BFD5D\", \"608E1C1:A979AE1\", \"0.0.0.0\", \"DAG.:01E8001FAG\", \"AFEF926B9A7G3G7\", \"33A37D11444G6E:\", \"2.5.6.2\", \"38853BE:2F5423.\", \"1::2::3\", \"3G:BEGF.3FGD442\", \"2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"F2E78.8D.95E646\", \"6.AAFE:7B6:G749\", \"E15G91E6009F37E\", \"C6779DCG.177331\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"B14G0:4CEBAAB21\", \":47:1B70AE.E6A8\", \"::2\", \"0:0::0:2\", \"0:0::0:2\", \"7GG58E8B23G.DDG\", \"1::2::3\", \"::\", \"127.0.0.1\", \"300.0.0.0\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"7FF5C:7318DFAA1\", \"0:0:0:0:0:0:0:0\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"75FD82A4DD7.A2G\", \"1E86G4A:66D48B5\", \"F837ABEE:791AF2\", \"2\", \":999GB03F.1F5C5\", \"25F:2D0BG5A5E.1\", \"2G.47G::EE9F9EG\", \"127.0.0.1\", \":::4\", \"DB9:4.7D7F138E:\", \"::1\", \"0:0:0:0:0:0:0:0\", \"0::0\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"::/0\", \"E:3794F85E60ED7\", \"A5.2C:G3CE6GC9E\", \"::2\", \"0.0.0.1234\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"A2CED4B8FDB3C97\", \"1855EB35A84G8B9\", \"::\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \":.428291B050209\", \":F:1261GF3189:A\", \"1CB9EA4G:3G0098\", \"0:0::0:1\", \"A7F6F8A18:G2115\", \"1::2::3\", \"42:2CA:DE9C790D\", \":C1545:.CFCE0F6\", \"8B.B1B5C4BE0367\", \".0.84BC9.97:E3G\", \"2D52C668DF9.7F6\", \"C2C.70.CCF7FACG\", \"7A6:.0832823AFF\", \"0:0:0:0:0:0:0:0\", \"::1\", \"3F64D230348:D.8\", \"DG26257F33CEAC6\", \"AE23.7738931A8G\", \"C4A89090GAB651A\", \"::\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"3AE4D718.FA.DG3\", \"C0A7513.3E3676F\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \":::4\", \"2979C.DC9BE1C31\", \"127.2.3.4\", \"::/0\", \"0.0.0.1234\", \"0:0:0:0:0:0:0:2\", \"AG6742721F.43.1\", \"1::2::3\", \"    127.0.0.0    \", \"636G59660226C7D\", \"0.0.0.0\", \"::/0\", \"4:AEEA227G11GC1\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0:0::0:1\", \"2A1BCD0:BA1EA7F\", \"192.168.0.1\", \"53C1135D6.GF442\", \".4ABB:7A497.A37\", \"DA:F37F1121.69A\", \"F6E33G4FCD:2:B1\", \"86B0F465678FBF.\", \"6F54:2B59FF0DBG\", \"755A0B.6:2F85B8\", \"A4648:G09.9D:.D\", \"2.5.20.1\", \"DDA:7BB3G.G.125\", \"0::0\", \"9ED:B:AC51:483C\", \"1::2::3\", \"649491362C:FB.:\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0.0.0.1234\", \"0:0:0:0:0:0:0:1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0:0:0:0:0:0:0\", \"84B1658D3BG135B\", \"F6:7.CF.GDF555B\", \"::\", \"E97C.D7AEAD8GC1\", \"2.59.6.2\", \"3D.172BF:34G:D9\", \"0.29D:97EA.F:5D\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"0710.AD:D8A:G9A\", \"90B52BA.71.A766\", \"AD18D2914EBBCE4\", \"::\", \"7A46B43:C517B:1\", \"::079BA6F370BG4\", \"G4.G4C79F7625GB\", \"60G7B5C1563946B\", \"300.0.0.0\", \"127.2.3.4\", \"5795G50:C06BE58\", \"8G846.0002A5557\", \"0.0.0.1234\", \"2.59.6.2\", \"51C.59300GCFF7F\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"C9B69G0B:.E0D.0\", \"0::0\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"5C038B13FDC8F08\", \"::2\", \"0.0.0.0\", \"7247CBC6DGDG5A5\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::/0\", \"::2\", \"1.31:E:D81807CF\", \"6C:G6A125EBDE07\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"127.0.0.1\", \"A6D27GF39.9F543\", \"127.2.3.4\", \"441:D4.4E71GB10\", \"E6.:99G.:524CC3\", \"255.255.255.255\", \":::4\", \"B353E754390A982\", \"FG8G0467G:9.A7A\", \"34B::451G6EAGA5\", \"B4338EGGB:17277\", \"9EC825D50841.28\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"0:0:0:0:0:0:0:1\", \"0:0:0:0:0:0:0:0\", \"192.168.0.1\", \"85AA5C2.5AE1AC0\", \"2.59.6.2\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"2.59.6.2\", \"93AG13C5.584E:3\", \"D1613GE8F4FE082\", \"::\", \"5C92D97:7568DB5\", \"0:0:0:0:0:0:0:1\", \"::2\", \"::\", \"127.0.0.1\", \"0:0::0:2\", \"45F3B:6.85809DD\", \"192.168.0.1\", \"127.2.3.4\", \"127.2.3.4\", \"3242359C:7BD718\", \"B3D8:493.6CEC:4\", \"0:0:0:0:0:0:0:2\", \"10GGDDGB1:3EA4E\", \"::\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::\", \"33AEC7A8BFDG:83\", \"    127.0.0.0    \", \"55B649F::A6A945\", \"192.168.0.1\", \"127.0.0.1\", \"2FF16A44F2.912C\", \"::\", \"9.BA12.4532.1C1\", \".705G:5B4CFB066\", \"::2\", \"::\", \"::1\", \"1DAB5.77736B4:3\", \"37DB0A9:5:FD.5A\", \"E98.15F677AF395\", \"127.0.0.1\", \"0:0::0:2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"A7:6B.8701.F461\", \"::1\", \".A19D.3:.123AF6\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"127.0.0.1\", \"FB9D057.E0AFB5D\", \"DDD2A:CF6:EF..5\", \":::4\", \"9C6A8EB6F6:01:4\", \"FEG2F64A95G244.\", \"8GAA73035311AD:\", \"2\", \"0:0:0:0:0:0:0:0\", \"300.0.0.0\", \"2.5.6.2\", \"127.0.0.1\", \"2.5.20.1\", \"A9.091CC5.:G:G2\", \"192.168.0.1\", \"1CDBA0:9278:G90\", \"::2\", \"9.:D322B:1E9E4G\", \"1616F6D45111A70\", \"127.0.0.1\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \":71A747:G4D3B55\", \"::/0\", \"778GE89108B2C:2\", \".C9C9::940BFB7.\", \"::1\", \"0::0\", \"192.168.0.1\", \"1::2::3\", \"::/0\", \"A59531F:49A94.8\", \"3DE10.C793:7FB2\", \"A:60FG7ABB9613E\", \"300.0.0.0\", \"5A60DA750.4A15.\", \".0D06.F:.2BC64D\", \"::2\", \"4GG.84G7DF.4229\", \"0:0::0:2\", \"::\", \"20193F5G:E75F:B\", \"0:0:0:0:0:0:0:0\", \"0::0\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"1::2::3\", \"0G8058.F20ECB60\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"8487EDFA8GA.0A9\", \"::/0\", \":::4\", \"8BA6:31FC990C5:\", \"130G:.1G1AD9DCC\", \"127.2.3.4\", \":93C6FC7.593.4:\", \"127.0.0.1\", \"1::2::3\", \"0:0:0:0:0:0:0:2\", \"FC8A.CF69.G2948\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"6GB108BAG15EAEC\", \"ABC944139B3.9:3\", \"F8F:7F:ACD4..18\", \"3D0E4569AGB41DB\", \"GG.:F.0EB5055B:\", \"76A1AC:B3A157E0\", \"127.2.3.4\", \"659447:6DC88D69\", \"::1\", \"2.59.6.2\", \"73100G7EC67E.4A\", \"0::0\", \":::4\", \"CCCA0EBE08584.F\", \"AG:G727:B42D991\", \"127.2.3.4\", \"300.0.0.0\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"1::2::3\", \":::4\", \"4EC4:9C2GF19DGB\", \"7.DG9.A0AG.2CAD\", \"FE1B3:8G75D1B:1\", \"0:0:0:0:0:0:0:1\", \"8A7.9342EG558E3\", \"0.0.0.0\", \".G4391AC4:3GB.:\", \".81.GA54ECEF26F\", \"23B.7BCF919:FA8\", \"    127.0.0.0    \", \"0:0:0:0:0:0:0:0\", \"84.0124:G3:DGC1\", \"0:0:0:0:0:0:0:1\", \"943013::40EC57.\", \"00F3C90BA17D2C6\", \"0E.51G.01C03324\", \"07A3F:.1G1:4.D8\", \"5.82240F0EE37.3\", \"37CDG6B:36.64BD\", \":318G278D2:2327\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"E54ED40E8G.139G\", \"127.0.0.1\", \"5E567:151:5AB4B\", \"::1\", \"1GC3B.38782B.G3\", \"127.2.3.4\", \"127.0.0.1\", \"0:0::0:2\", \"GF.9457..F:4C2A\", \"7E05CFD0A07BF78\", \"0:0:0:0:0:0:0:0\", \"C74A45EBB71G42D\", \"0136F431EEG90E2\", \"5A.1G390GG0GD84\", \"::2\", \"6.GA3DE6AAF101C\", \"886C3FF:F0B4509\", \"653B104A7B6969:\", \"::\", \"0:0::0:1\", \"9C6526.F0922A93\", \"A3G2C054.0170.E\", \"8DFFEF683BFFAD0\", \"127.0.0.0\", \"1::2::3\", \".9DC.A6G78AG:9F\", \"7.5F958DD.3D465\", \"90DF5DCB1:43749\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"4G1DG7CDCG53412\", \"E5A59:FE7E8BA6A\", \"::\", \"0:0:0:0:0:0:0:0\", \"C4GG3A3A6C6E95C\", \"5.F42546G8:::C6\", \"0:29G20BCCDCFB6\", \"2CF4C446.E30F6G\", \"::/0\", \"G859.034G22782C\", \"EFCA20DCE2GGE1C\", \"    127.0.0.0    \", \"    127.0.0.0    \", \"B92066BD:D1172A\", \"2.5.6.2\", \"6F99746774D60:2\", \"G7537:0889EDD9D\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"2.59.6.2\", \"FFAC7:5B9209B:E\", \"465.5GE7GBE0:3C\", \"BG81G0BA:F:B63F\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"0.0.0.0\", \"B:B.F3:61B3863.\", \"0:0::0:1\", \"18.G4C7137A6:84\", \"F16:16828CG32DF\", \"::\", \"82BFF..1E475654\", \"::2\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"9ECF1609BGBBGBF\", \"AD3460GG043D99F\", \"300.0.0.0\", \"DCFBAE.7E6CB13A\", \":::4\", \"1::2::3\", \"B62.137EG5DE:52\", \"0.0.0.1234\", \"4GC.G10F:BGF.8F\", \"::1\", \"300.0.0.0\", \"127.0.0.0\", \".3G29812BG01143\", \"86A17:B16F85453\", \"EC94DG2A6.D1GAG\", \"0:0:0:0:0:0:0:2\", \"7A9G38E:9E.28G5\", \".38A54G39CC::3:\", \"0.0.0.1234\", \"7228B94783AECF6\", \"127.0.0.1\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"C82:8E0C.G65233\", \"2.5.20.1\", \"6E15178477:G:1A\", \"53C86BDB892FFG5\", \"GF07282G872129B\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"2.59.6.2\", \"192.168.0.1\", \"E529:667:1B20G7\", \"2FG.C755D043:DE\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"CB309EA14F7:063\", \"::\", \"2.5.6.2\", \"300.0.0.0\", \"DA30:F11792.G.A\", \"1::2::3\", \"A1:7A0B39:G:E8A\", \"42..A4.452A7.F4\", \"9:B58.702AGB006\", \"192.168.0.1\", \"9FEF0B.404G76F1\", \"9731F91D5B.6229\", \"::\", \"300.0.0.0\", \"1E685CA5A24BC76\", \"CF26B408F13C9:5\", \"2.59.6.2\", \"82567DCB040C88G\", \"B4598CC71CF.7FG\", \"    127.0.0.0    \", \"9B15B0.04EG3AG:\", \"    127.0.0.0    \", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"1::2::3\", \"1F5E01C0G0G:3G2\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"0.0.0.0\", \"0:0:0:0:0:0:0:0\", \"02F7G027EF1258A\", \"0:0:0:0:0:0:0:1\", \"::2\", \"2.5.6.2\", \"2.5.6.2\", \"CB39BCBF707F63.\", \"300.0.0.0\", \"1.1B9E63B2063D.\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"72:3C.68F68B.A7\", \"255.255.255.255\", \"818068E.47D6EE:\", \"::\", \":::4\", \"14.FG8GF74F10GG\", \"1C5892C6D27.:38\", \"    127.0.0.0    \", \"F068B8F07.77FFA\", \"0C4F6B70807F7G6\", \".87197::5A3EB34\", \"255.255.255.255\", \"2.59.6.2\", \"1::2::3\", \"0.0.0.1234\", \"300.0.0.0\", \"127.2.3.4\", \"3A:5:E164808A:C\", \"127.0.0.1\", \"85G8G78101FD430\", \":::4\", \"2.E88GFDAF:0C85\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"CC401GB2255F21C\", \"D4075B28GE43750\", \"2.5.6.2\", \"597:BA42ACBE.01\", \"2.5.6.2\", \"69D72084:B28B:1\", \"0AFFE1CDAFA02A2\", \"480.26BDA:D9D4D\", \"B9949D01G.1GD60\", \"F.FB1EF87C5A08A\", \"56EB5.969BCG:F0\", \"A5C390E17C7EE04\", \"A827596G.1GA98E\", \"127.0.0.0\", \".8..29.E30B018:\", \"6C8D9G3.43A23D3\", \".5B929GCAF2.7A8\", \"2.5.6.2\", \"AC2E.:GA3.1833C\", \"GG35A:5AF0941G6\", \"0.0.0.1234\", \"D90720.:4.B46F4\", \"991GGDE95AG7EED\", \"::/0\", \"1.CDC09CE18D28E\", \"1::2::3\", \"C9D3F22BB:CG.CG\", \"0:0::0:2\", \"300.0.0.0\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"A3:4G.AA2C8:91C\", \"E9F9287E4C:.:D.\", \"::1\", \"GE72DG1.A130BE8\", \"0581C23:8B41384\", \"63E520AD1F175.E\", \"4.B:D884DG4A635\", \"::\", \"42EBG3A2A1217:6\", \"::2\", \"3G55G7227D4BBF.\", \"::\", \"::\", \"0:0:0:0:0:0:0:1\", \"0.0.0.1234\", \"    127.0.0.0    \", \".5G5E2F6G6CEF0E\", \"0.0.0.0\", \"::\", \"276505D27CFCE87\", \"0:0::0:2\", \":A32FB0.CBEC.80\", \"DE65F62GE1D59G9\", \"1::2::3\", \"25F691:4EF:A:EE\", \"::2\", \"127.2.3.4\", \"0:0::0:2\", \"1::2::3\", \"B950ED050A6D.AA\", \"1A01CF639E:.9GF\", \"0.0.0.0\", \"0:0:0:0:0:0:0:1\", \"0:0:0:0:0:0:0:2\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"0:0::0:2\", \"0::E9G98FC540G1\", \"2D6075G4:58G98E\", \"CEB27725F5F701C\", \"    127.0.0.0    \", \"2.5.20.1\", \"DFC:6F.GG35E:F8\", \"2.5.20.1\", \"D4A22A.A0002DDC\", \"2AG31800E4D52C3\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \".DC7D86:32:17:2\", \"157E.A220244G:4\", \"::/0\", \"2\", \"9FD90F7E:2F3B5F\", \"D:6.1::5CGGCF86\", \"127.2.3.4\", \"127.0.0.0\", \"192.168.0.1\", \"328D956A64ACB57\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"::1\", \"8C76BA40:216G31\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"F64:A2.464BAE82\", \"C7.CDC6C5943A15\", \"0:0:0:0:0:0:0:0\", \"2.5.20.1\", \"5..6F02828D510F\", \".AAC1F79C7:C62B\", \"87B57B53:G3.17G\", \"8.5BA01AG59CC4.\", \"::\", \"14.8E8E8F71GF9A\", \"::/0\", \"2.59.6.2\", \"EDA75:C42119.82\", \"4BBCDBE697:9D6D\", \"3D085F:GFAG5G93\", \"0:0:0:0:0:0:0:1\", \"::/0\", \"::6CDB.:EF7E:A9\", \"::/0\", \"7C75E4682AG3A3D\", \"2:A9FDD:8E691.8\", \"6C.0G5:C:8:9BB2\", \"FFA37:803:C7791\", \":::4\", \"1::2::3\", \"127.2.3.4\", \"0:0::0:2\", \"BB5:0F93068E7.8\", \".6F:1854ADC5G:4\", \"71G4897:5G93.AC\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"300.0.0.0\", \"::1\", \"0.0.0.1234\", \"0.0.0.1234\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"203535B25F195:G\", \"0.0.0.1234\", \"127.2.3.4\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"C:078:8BF0G8CB7\", \"127.0.0.1\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"255.255.255.255\", \"GB.G86B6D847F41\", \"::\", \"20015555:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"D21A3C3ACG813C3\", \"0:0:0:0:0:0:0:0\", \"0:F3ECG5EBC6755\", \"4:5919E8FAG6EA1\", \"71B8.EF7F3BG.G1\", \"0.0.0.1234\", \"0.0.0.0\", \"0:0:0:0:0:0:0:1\", \"00A.81E:F6:A.00\", \":C9E8.939F6C.CB\", \"G552BE:C85FDB17\", \"8C4105E2:9C:6:4\", \"127.0.0.0\", \"3AFD8FCDD.57E6G\", \"D7GD:44CAE3G4A2\", \":39B.C284A37919\", \"1::2::3\", \"0:0::0:1\", \"89DA8FE47:6BD62\", \"24A8GGD5CC17:1E\", \"0:0:0:0:0:0:0:2\", \"B40534AGFC69C5D\", \"D02BGE58C4F:5FE\", \"127.0.0.1\", \"A3D2D56G9EDA11.\", \"F32CD:FB4542D85\", \"0:0::0:1\", \".AE06358CB:5C2A\", \"CC9D19:79B4:GE:\", \"0::0\", \"79C09D5E:88DF8D\", \"2.5.6.2\", \"320D77D2.938552\", \"46B9D70F:6G3GBB\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff:1623:2316\", \"2001:db8:1234:ffff:ffff:ffff:ffff:ffff\", \"35G:048.:0416.9\", \"E:788CFB65G32F0\", \"B.C0766E89E5A0.\", \"0:0:0:0:0:0:0:0\", \"0C.6564824D8D9:\", \"1::2::3\", \":::4\", \"0:0:0:0:0:0:0:0\", \"DF9509.G096B634\", \":2B4901169GGG7C\", \"3:EG:B79CB15535\", \"2.5.20.1\", \"F7E9588FF38042:\", \"95488..6F1618BC\", \"00:8B8841GD7FG0\", \"0:0:0:0:0:0:0:0\", \"CGD:FD7002.73AA\", \"D94.191C8:C050.\", \"8B.25.FA423BGC.\", \"    127.0.0.0    \", \"150DC2E.0B7F9F:\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"255.255.255.255\", \"77B1ABD1DBC1997\", \".06864G382DE154\", \"BD8FCDFA498GC9:\", \"0:0:0:0:0:0:0:2\", \"34300A2914118.7\", \"87B90CDB1G249.E\", \"    127.0.0.0    \", \"0:0::0:2\", \"C9E92983284G8G9\", \"79323G::5B43329\", \"BE8D9EF5EAB7GGB\", \"6F4412G4432.6A:\", \"::\", \"0000:0000:0000:0000:0000:0000:0000:0001\", \"::1\", \"5AGD48G56G.:1F6\", \"255.255.255.255\", \"6D74C0.85043B.4\", \"2.5.6.2\", \"0GFFA49D5:414.F\", \"86FA4FBA05CE6AC\", \"7FEA0DB537.5..9\", \"G:4020E:188584.\", \"3E97F9:423CG1:B\", \"CB1AFG:D71CG.EG\", \"B.A.C0BFF98C273\", \"127.0.0.1\", \"20G6F286EDG1F0.\", \"G3B54.BDC98G821\", \"::2\", \"2.5.6.2\", \"3C6BAB1DE:866E7\", \"127.2.3.4\", \"0:0::0:2\", \"B8538G8D24F4GDB\", \"127.0.0.0\", \"0G7:0A2:2.CC202\", \"7B.70F3470B50A0\", \"0::0\", \"0:0:0:0:0:0:0:0\", \"0:0:0:0:0:0:0:1\", \"127.0.0.0\", \"127.0.0.1\", \"256C549516F28A1\", \"127.2.3.4\", \"0:0:0:0:0:0:0:0\", \"1623:0000:0000:0000:0000:0000:0000:0001\", \"C:F2100CBBEFGD4\", \"::\", \"::C54C0A8B:75.:\", \":B890BFG95C8E6G\", \"127.0.0.1\", \"B.2.0E496ACG00G\", \":::4\", \"F.67A845C.42E42\", \"0:0::0:2\", \"0::0\", \"0G747506G7B7ED1\", \"B2D1CA5:F148.2E\", \"2.59.6.2\", \"0::0\", \"0:0:0:0:0:0:0:2\", \"127.0.0.1\", \"0:0:0:0:0:0:0:1\", \":GE6BE58591F0:E\", \"::\", \"13911FGF678D12E\", \":5.4GC1G41GBEBC\", \"0::0\", \"B:385.9:7066G5B\", \"0:0::0:2\", \"35D57.FE21174CA\", \"FFBGF0GG071AC7D\", \"0:0:0:0:0:0:0:1\", \"2.5.20.1\", \"2.59.6.2\", \"127.0.0.0\", \"::1\", \"6.9B5404265AB0.\", \"C0.922E00FE.184\", \"35F.8:F7F9A20BD\", \"DEF06.16648C:B7\", \"E3983C..CGCB160\", \"127.2.3.4\", \"D637G1EAA84DD3E\", \"07.5684182.760G\", \"0000:0000:0000:0000:0000:0000:0000:0000\", \"370.48:46D0B7CG\", \"944C25G8F223ED:\",  };\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RuleFailure/SpecialCases.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Runtime.InteropServices;\n\nnamespace SonarAnalyzer.Test.TestCasesForRuleFailure\n{\n    public class SpecialCases\n    {\n        public void ParamsMethod(int i, params int[] j) { }\n        public int MethodExpressionBody(int i, params int[] j) => 42;\n        public int PropertyExpressionBody => 42;\n\n        public void ArgListMethod(__arglist)\n        {\n            ArgListMethod(__arglist(\"\"));\n        }\n        public void DynamicMethod(dynamic i)\n        {\n            dynamic local = new object();\n        }\n\n        public static implicit operator string(SpecialCases c) { return \"\"; }\n        public static SpecialCases operator+ (SpecialCases a, SpecialCases b) { return null; }\n        public int this[int index] => index;\n\n        [DllImport(\"User32.dll\", CharSet = CharSet.Unicode)]\n        public static extern int MessageBox(IntPtr h, string m, string c, int type);\n\n        static int Main()\n        {\n            return MessageBox((IntPtr)0, \"My message\", \"My Message Box\", 0);\n        }\n    }\n\n    public static class MyExtensions\n    {\n        public static void Ext(this string s)\n        {\n            string ss = null;\n            ss.Ext();\n            Ext(null);\n            dynamic d = ss;\n            d.Ext();\n            Ext(d);\n        }\n\n        public static Dictionary<string, string> GetDict()\n        {\n            return new Dictionary<string, string>\n            {\n                [\"a\"] = \"b\"\n            };\n\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/RuleFailure/SpecialCases.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.Linq\nImports System.Text\nImports System.Threading.Tasks\nImports System.Runtime.InteropServices\nImports System.Runtime.CompilerServices\n\nNamespace TestCasesForRuleFailure\n\n    Public Class SpecialCases\n\n        Public Sub ParamsMethod(i As Integer, ParamArray j() As Integer)\n        End Sub\n\n        Public Sub ArgListMethod(__arglist)\n            ArgListMethod(\"__arglist\"(\"\"))\n        End Sub\n\n        Public Shared Widening Operator CType(c As SpecialCases) As String\n            Return \"\"\n        End Operator\n\n        Public Shared Narrowing Operator CType(c As SpecialCases) As Integer\n            Return \"\"\n        End Operator\n\n        Public Shared Operator +(a As SpecialCases, b As SpecialCases) As SpecialCases\n            Return Nothing\n        End Operator\n\n        Default Public Property Indexer(x As Integer, y As Integer) As String\n            Get\n\n            End Get\n            Set(value As String)\n\n            End Set\n        End Property\n\n        <DllImport(\"User32.dll\", CharSet:=CharSet.Unicode)>\n        Public Shared Function MessageBox(h As IntPtr, m As String, c As String, type As Integer) As Integer\n        End Function\n\n        Private Declare Function GetWindowText Lib \"user32.dll\" (ByVal hwnd As IntPtr, ByVal lpString As StringBuilder, ByVal cch As Integer) As Integer\n\n        Shared Sub Main()\n            MessageBox(IntPtr.Zero, \"My message\", \"My Message Box\", 0)\n        End Sub\n\n        Public Sub NullConditionalIndexing(List As List(Of Integer)\n            Dim Value As Integer = List?(0)\n        End Sub\n\n    End Class\n\n    Public Module MyExtensions\n\n        <Extension>\n        Public Sub Ext(s As String)\n            Dim ss As String = Nothing\n            ss.Ext()\n            Ext(Nothing)\n        End Sub\n\n        Public Function GetDict() As Dictionary(Of String, String)\n            Return New Dictionary(Of String, String) From {{\"a\", \"b\"}, {\"c\", \"d\"}}\n        End Function\n\n    End Module\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SecurityPInvokeMethodShouldNotBeCalled.CSharp11.cs",
    "content": "﻿using System;\nusing System.Runtime.InteropServices;\n\nnamespace Tests.Diagnostics\n{\n    public enum RpcAuthnLevel\n    {\n        Default = 0,\n        None = 1,\n        Connect = 2,\n        Call = 3,\n        Pkt = 4,\n        PktIntegrity = 5,\n        PktPrivacy = 6\n    }\n\n    public enum RpcImpLevel\n    {\n        Default = 0,\n        Anonymous = 1,\n        Identify = 2,\n        Impersonate = 3,\n        Delegate = 4\n    }\n\n    public enum EoAuthnCap\n    {\n        None = 0x00,\n        MutualAuth = 0x01,\n        StaticCloaking = 0x20,\n        DynamicCloaking = 0x40,\n        AnyAuthority = 0x80,\n        MakeFullSIC = 0x100,\n        Default = 0x800,\n        SecureRefs = 0x02,\n        AccessControl = 0x04,\n        AppID = 0x08,\n        Dynamic = 0x10,\n        RequireFullSIC = 0x200,\n        AutoImpersonate = 0x400,\n        NoCustomMarshal = 0x2000,\n        DisableAAA = 0x1000\n    }\n\n    class Program\n    {\n        [DllImport(\"OlE32.dll\")]\n        static extern int CoSetProxyBlanket([MarshalAs(UnmanagedType.IUnknown)] object pProxy, uint dwAuthnSvc, uint dwAuthzSvc, [MarshalAs(UnmanagedType.LPWStr)] string pServerPrincName, uint dwAuthnLevel, uint dwImpLevel, nint pAuthInfo, uint dwCapabilities);\n\n        [DllImport(\"ole32\", BestFitMapping = false, CallingConvention = CallingConvention.FastCall)]\n        public static extern int CoInitializeSecurity(nint pVoid, int cAuthSvc, nint asAuthSvc, nint pReserved1, RpcAuthnLevel level, RpcImpLevel impers, nint pAuthList, EoAuthnCap dwCapabilities, nint pReserved3);\n\n        public static void CoInitializeSecurity(int param) { } // Compliant non extern\n        public extern void CoInitializeSecurity(string param); // Compliant non static\n        public static extern int CoInitializeSecurity(int param1, string param2); // Compliant no DllImport\n\n        static void Main(string[] args)\n        {\n            var hres1 = CoSetProxyBlanket(null, 0, 0, null, 0, 0, 0, 0); // Noncompliant\n//                      ^^^^^^^^^^^^^^^^^\n\n            var hres2 = CoInitializeSecurity(0, -1, 0, 0, RpcAuthnLevel.None, RpcImpLevel.Impersonate, 0, EoAuthnCap.None, 0); // Noncompliant\n//                      ^^^^^^^^^^^^^^^^^^^^\n\n            CoSetProxyBlanket();            // Error [CS7036]\n            CoInitializeSecurity(5);        // Compliant\n            var p = new Program();\n            p.CoInitializeSecurity(\"\");     // Compliant\n            CoInitializeSecurity(5, \"\");    // Compliant\n        }\n    }\n\n    public class CompliantWithCompilationErrors\n    {\n        [DllImport(BestFitMapping = false)] // Error [CS7036]\n        static extern int CoSetProxyBlanket([MarshalAs(UnmanagedType.IUnknown)] object pProxy, uint dwAuthnSvc, uint dwAuthzSvc, [MarshalAs(UnmanagedType.LPWStr)] string pServerPrincName, uint dwAuthnLevel, uint dwImpLevel, nint pAuthInfo, uint dwCapabilities);\n\n        [DllImport(BestFitMapping = false, EntryPoint = \"ole32.dll\", ExactSpelling = true)] // Error [CS7036]\n        public static extern int CoInitializeSecurity(nint pVoid, int cAuthSvc, nint asAuthSvc, nint pReserved1, RpcAuthnLevel level, RpcImpLevel impers, nint pAuthList, EoAuthnCap dwCapabilities, nint pReserved3);\n\n        public void Somemethod()\n        {\n            var hres1 = CoSetProxyBlanket(null, 0, 0, null, 0, 0, 0, 0);\n\n            var hres2 = CoInitializeSecurity(0, -1, 0, 0, RpcAuthnLevel.None, RpcImpLevel.Impersonate, 0, EoAuthnCap.None, 0);\n        }\n    }\n\n    public unsafe partial class LibraryImportAttributeImports\n    {\n\n        // CoSetProxyBlanket can not be converted to LibraryImport because of the [MarshalAs(UnmanagedType.IUnknown)] attribute: https://github.com/dotnet/runtime/blob/v7.0.0/docs/design/libraries/LibraryImportGenerator/Compatibility.md\n\n        [LibraryImport(\"ole32\")]\n        [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvFastcall) })]\n        public static partial int CoInitializeSecurity(nint pVoid, int cAuthSvc, nint asAuthSvc, nint pReserved1, RpcAuthnLevel level, RpcImpLevel impers, nint pAuthList, EoAuthnCap dwCapabilities, nint pReserved3);\n\n        // Provide the implementation part usually generated by the code generator\n        // Note: In this case, the source generator does not generate any marshaling code and therefore the original definition is just made \"extern\" and\n        // decorated with [DllImportAttribute]. But the generator might also generate marshaling code in the future and in that case the [DllImportAttribute] decorated\n        // extern method is a static local function within the generated CoInitializeSecurity method.\n        [System.Runtime.InteropServices.DllImportAttribute(\"ole32\", EntryPoint = \"CoInitializeSecurity\", ExactSpelling = true)]\n        public static extern partial int CoInitializeSecurity(nint pVoid, int cAuthSvc, nint asAuthSvc, nint pReserved1, RpcAuthnLevel level, RpcImpLevel impers, nint pAuthList, EoAuthnCap dwCapabilities, nint pReserved3);\n\n        public void M()\n        {\n            var hres2 = CoInitializeSecurity(0, -1, 0, 0, RpcAuthnLevel.None, RpcImpLevel.Impersonate, 0, EoAuthnCap.None, 0); // Noncompliant\n            //          ^^^^^^^^^^^^^^^^^^^^\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SecurityPInvokeMethodShouldNotBeCalled.CSharp12.cs",
    "content": "﻿using System;\nusing System.Runtime.InteropServices;\nusing IntPtrAliasFromKeywork = nint;\n\nclass AliasAnyType\n{\n    [DllImport(\"OlE32.dll\")]\n    static extern int CoSetProxyBlanket(\n        [MarshalAs(UnmanagedType.IUnknown)] object pProxy,\n        uint dwAuthnSvc,\n        uint dwAuthzSvc,\n        [MarshalAs(UnmanagedType.LPWStr)] string pServerPrincName,\n        uint dwAuthnLevel,\n        IntPtrAliasFromKeywork dwImpLevel,\n        IntPtrAliasFromKeywork pAuthInfo,\n        uint dwCapabilities);\n\n    void Test()\n    {\n        _ = CoSetProxyBlanket(null, 0, 0, null, 0, 0, 0, 0); // Noncompliant\n        //  ^^^^^^^^^^^^^^^^^\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SecurityPInvokeMethodShouldNotBeCalled.cs",
    "content": "﻿using System;\nusing System.Runtime.InteropServices;\n\nnamespace Tests.Diagnostics\n{\n    public enum RpcAuthnLevel\n    {\n        Default = 0,\n        None = 1,\n        Connect = 2,\n        Call = 3,\n        Pkt = 4,\n        PktIntegrity = 5,\n        PktPrivacy = 6\n    }\n\n    public enum RpcImpLevel\n    {\n        Default = 0,\n        Anonymous = 1,\n        Identify = 2,\n        Impersonate = 3,\n        Delegate = 4\n    }\n\n    public enum EoAuthnCap\n    {\n        None = 0x00,\n        MutualAuth = 0x01,\n        StaticCloaking = 0x20,\n        DynamicCloaking = 0x40,\n        AnyAuthority = 0x80,\n        MakeFullSIC = 0x100,\n        Default = 0x800,\n        SecureRefs = 0x02,\n        AccessControl = 0x04,\n        AppID = 0x08,\n        Dynamic = 0x10,\n        RequireFullSIC = 0x200,\n        AutoImpersonate = 0x400,\n        NoCustomMarshal = 0x2000,\n        DisableAAA = 0x1000\n    }\n\n    class Program\n    {\n        [DllImport(\"OlE32.dll\")]\n        static extern int CoSetProxyBlanket([MarshalAs(UnmanagedType.IUnknown)]object pProxy, uint dwAuthnSvc, uint dwAuthzSvc, [MarshalAs(UnmanagedType.LPWStr)] string pServerPrincName, uint dwAuthnLevel, uint dwImpLevel, IntPtr pAuthInfo, uint dwCapabilities);\n\n        [DllImport(\"ole32\", BestFitMapping = false, CallingConvention = CallingConvention.FastCall)]\n        public static extern int CoInitializeSecurity(IntPtr pVoid, int cAuthSvc, IntPtr asAuthSvc, IntPtr pReserved1, RpcAuthnLevel level, RpcImpLevel impers, IntPtr pAuthList, EoAuthnCap dwCapabilities, IntPtr pReserved3);\n\n        public static void CoInitializeSecurity(int param) { } // Compliant non extern\n        public extern void CoInitializeSecurity(string param); // Compliant non static\n        public static extern int CoInitializeSecurity(int param1, string param2); // Compliant no DllImport\n        [DllImport] // Error [CS7036]\n        public static extern int CoInitializeSecurity(int param1, string param2, string param3); // Compliant DllImport argument invalid\n        [DllImport(null)] // Error [CS0591]\n        public static extern int CoInitializeSecurity(int param1, string param2, string param3, string param4); // Compliant DllImport argument invalid\n        [DllImport(wrongParameterName: \"ole32\")] // Error [CS1739] the right name is \"dllName\"\n        public static extern int CoInitializeSecurity(int param1, string param2, string param3, string param4, string param5); // Compliant DllImport parameter name wrong\n        [DllImport(\"noOle32\")]\n        public static extern int CoInitializeSecurity(int param1, string param2, string param3, string param4, string param5, string param6); // Compliant DllImport argument not \"ole32\"\n\n        static void Main(string[] args)\n        {\n            var hres1 = CoSetProxyBlanket(null, 0, 0, null, 0, 0, IntPtr.Zero, 0); // Noncompliant\n//                      ^^^^^^^^^^^^^^^^^\n\n            var hres2 = CoInitializeSecurity(IntPtr.Zero, -1, IntPtr.Zero, IntPtr.Zero, RpcAuthnLevel.None, RpcImpLevel.Impersonate, IntPtr.Zero, EoAuthnCap.None, IntPtr.Zero); // Noncompliant\n//                      ^^^^^^^^^^^^^^^^^^^^\n\n            CoSetProxyBlanket();                             // Error [CS7036]\n            CoInitializeSecurity(5);                         // Compliant\n            var p = new Program();\n            p.CoInitializeSecurity(\"\");                      // Compliant\n            CoInitializeSecurity(5, \"\");                     // Compliant\n            CoInitializeSecurity(5, \"\", \"\");                 // Compliant\n            CoInitializeSecurity(5, \"\", \"\", \"\");             // Compliant\n            CoInitializeSecurity(5, \"\", \"\", \"\", \"\");         // Compliant\n            CoInitializeSecurity(5, \"\", \"\", \"\", \"\", \"\");     // Compliant\n        }\n    }\n\n    public class CompliantWithCompilationErrors\n    {\n        [DllImport(BestFitMapping = false)] // Error [CS7036]\n        static extern int CoSetProxyBlanket([MarshalAs(UnmanagedType.IUnknown)] object pProxy, uint dwAuthnSvc, uint dwAuthzSvc, [MarshalAs(UnmanagedType.LPWStr)] string pServerPrincName, uint dwAuthnLevel, uint dwImpLevel, IntPtr pAuthInfo, uint dwCapabilities);\n\n        [DllImport(BestFitMapping = false, EntryPoint = \"ole32.dll\", ExactSpelling = true)] // Error [CS7036]\n        public static extern int CoInitializeSecurity(IntPtr pVoid, int cAuthSvc, IntPtr asAuthSvc, IntPtr pReserved1, RpcAuthnLevel level, RpcImpLevel impers, IntPtr pAuthList, EoAuthnCap dwCapabilities, IntPtr pReserved3);\n\n        public void Somemethod()\n        {\n            var hres1 = CoSetProxyBlanket(null, 0, 0, null, 0, 0, IntPtr.Zero, 0);\n\n            var hres2 = CoInitializeSecurity(IntPtr.Zero, -1, IntPtr.Zero, IntPtr.Zero, RpcAuthnLevel.None, RpcImpLevel.Impersonate, IntPtr.Zero, EoAuthnCap.None, IntPtr.Zero);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SecurityPInvokeMethodShouldNotBeCalled.vb",
    "content": "﻿Imports System\nImports System.Runtime.InteropServices\n\nNamespace Tests.TestCases\n\n    Public Enum RpcAuthnLevel\n        [Default] = 0\n        None = 1\n        Connect = 2\n        [Call] = 3\n        Pkt = 4\n        PktIntegrity = 5\n        PktPrivacy = 6\n    End Enum\n\n    Public Enum RpcImpLevel\n        [Default] = 0\n        Anonymous = 1\n        Identify = 2\n        Impersonate = 3\n        [Delegate] = 4\n    End Enum\n\n    Public Enum EoAuthnCap\n        None = &H00\n        MutualAuth = &H01\n        StaticCloaking = &H20\n        DynamicCloaking = &H40\n        AnyAuthority = &H80\n        MakeFullSIC = &H100\n        [Default] = &H800\n        SecureRefs = &H02\n        AccessControl = &H04\n        AppID = &H08\n        Dynamic = &H10\n        RequireFullSIC = &H200\n        AutoImpersonate = &H400\n        NoCustomMarshal = &H2000\n        DisableAAA = &H1000\n    End Enum\n\n\n    Public Class Noncompliant1\n\n    <DllImport(\"oLe32\")>\n    Public Shared Function CoSetProxyBlanket(<MarshalAs(UnmanagedType.IUnknown)>pProxy As Object, dwAuthnSvc as UInt32, dwAuthzSvc As UInt32, <MarshalAs(UnmanagedType.LPWStr)> pServerPrincName As String, dwAuthnLevel As UInt32, dwImpLevel As UInt32, pAuthInfo As IntPtr, dwCapabilities As UInt32) As Integer\n    End Function\n\n    <DllImport(\"ole32.dll\")>\n    Public Shared Function CoInitializeSecurity(pVoid As IntPtr, cAuthSvc As Integer, asAuthSvc As IntPtr, pReserved1 As IntPtr, level As RpcAuthnLevel, impers As RpcImpLevel, pAuthList As IntPtr, dwCapabilities As EoAuthnCap, pReserved3 As IntPtr) As Integer\n    End Function\n\n    Public Sub DoSomething()\n        Dim Hres1 As Integer = CoSetProxyBlanket(Nothing, 0, 0, Nothing, 0, 0, IntPtr.Zero, 0) ' Noncompliant {{Refactor the code to remove this use of 'CoSetProxyBlanket'.}}\n        '                      ^^^^^^^^^^^^^^^^^\n        Dim Hres2 As Integer = CoInitializeSecurity(IntPtr.Zero, -1, IntPtr.Zero, IntPtr.Zero, RpcAuthnLevel.None, RpcImpLevel.Impersonate, IntPtr.Zero, EoAuthnCap.None, IntPtr.Zero) ' Noncompliant {{Refactor the code to remove this use of 'CoInitializeSecurity'.}}\n        '                      ^^^^^^^^^^^^^^^^^^^^\n\n        Hres2 = cOINITIALIZEsECURITY(IntPtr.Zero, -1, IntPtr.Zero, IntPtr.Zero, RpcAuthnLevel.None, RpcImpLevel.Impersonate, IntPtr.Zero, EoAuthnCap.None, IntPtr.Zero) ' Noncompliant {{Refactor the code to remove this use of 'CoInitializeSecurity'.}}\n        '       ^^^^^^^^^^^^^^^^^^^^\n    End Sub\n\n    End Class\n\n    Public Class Noncompliant2\n\n        Declare Function CoInitializeSecurity Lib \"ole32.dll\" (pVoid As IntPtr, cAuthSvc As Integer, asAuthSvc As IntPtr, pReserved1 As IntPtr, level As RpcAuthnLevel, impers As RpcImpLevel, pAuthList As IntPtr, dwCapabilities As EoAuthnCap, pReserved3 As IntPtr) As Integer\n\n        Declare Function CustomName Lib \"ole32.dll\" Alias \"CoInitializeSecurity\" (pVoid As IntPtr, cAuthSvc As Integer, asAuthSvc As IntPtr, pReserved1 As IntPtr, level As RpcAuthnLevel, impers As RpcImpLevel, pAuthList As IntPtr, dwCapabilities As EoAuthnCap, pReserved3 As IntPtr) As Integer\n\n        Declare Function CoSetProxyBlanket Lib \"ole32.dll\" Alias \"SomethingElse\" (pVoid As IntPtr, cAuthSvc As Integer, asAuthSvc As IntPtr, pReserved1 As IntPtr, level As RpcAuthnLevel, impers As RpcImpLevel, pAuthList As IntPtr, dwCapabilities As EoAuthnCap, pReserved3 As IntPtr) As Integer\n\n         Public Sub DoSomething()\n            Dim Hres2 As Integer = CoInitializeSecurity(IntPtr.Zero, -1, IntPtr.Zero, IntPtr.Zero, RpcAuthnLevel.None, RpcImpLevel.Impersonate, IntPtr.Zero, EoAuthnCap.None, IntPtr.Zero) ' Noncompliant {{Refactor the code to remove this use of 'CoInitializeSecurity'.}}\n            '                      ^^^^^^^^^^^^^^^^^^^^\n\n            Dim Hres1 As Integer = CustomName(IntPtr.Zero, -1, IntPtr.Zero, IntPtr.Zero, RpcAuthnLevel.None, RpcImpLevel.Impersonate, IntPtr.Zero, EoAuthnCap.None, IntPtr.Zero) ' Noncompliant {{Refactor the code to remove this use of 'CoInitializeSecurity'.}}\n            '                      ^^^^^^^^^^\n\n            Dim Hres3 As Integer = CoSetProxyBlanket(IntPtr.Zero, -1, IntPtr.Zero, IntPtr.Zero, RpcAuthnLevel.None, RpcImpLevel.Impersonate, IntPtr.Zero, EoAuthnCap.None, IntPtr.Zero) ' Compliant\n\n        End Sub\n\n    End Class\n\n    Public Class Compliant\n\n        Declare Function CoInitializeSecurity Lib \"Random.dll\" (pVoid As IntPtr, cAuthSvc As Integer, asAuthSvc As IntPtr, pReserved1 As IntPtr, level As RpcAuthnLevel, impers As RpcImpLevel, pAuthList As IntPtr, dwCapabilities As EoAuthnCap, pReserved3 As IntPtr) As Integer\n\n        Public Sub DoSomething()\n            Dim Hres1 As Integer = CoInitializeSecurity(IntPtr.Zero, -1, IntPtr.Zero, IntPtr.Zero, RpcAuthnLevel.None, RpcImpLevel.Impersonate, IntPtr.Zero, EoAuthnCap.None, IntPtr.Zero)\n\n            NonexistentMethod() ' Error [BC30451]\n        End Sub\n\n    End Class\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SelfAssignment.Latest.Partial.cs",
    "content": "﻿partial class PartialProperties\n{\n    public partial bool IsTrue\n    {\n        get => IsTrue;\n        set => IsTrue = value;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SelfAssignment.Latest.cs",
    "content": "﻿class CSharp8\n{\n    void CoalescingAssignment()\n    {\n        int? value = null;\n        value ??= value;\n//      ^^^^^           Noncompliant\n//                ^^^^^ Secondary@-1\n    }\n}\n\nclass WithPrimaryConstructorParams(int unused, int usedInInlineInitialization, int usedInMethod)\n{\n    int usedInInlineInitialization = usedInInlineInitialization;      // Compliant: param to field assignment\n\n    WithPrimaryConstructorParams(int usedInMethod) : this(0, 0, usedInMethod)\n    {\n        this.usedInInlineInitialization = usedInInlineInitialization; // Compliant: field to field assignment\n        usedInMethod = usedInMethod;                                  // Noncompliant: local to local assignment\n                                                                      // Secondary@-1\n    }\n\n    void AssigningParamToParam()\n    {\n        usedInMethod = usedInMethod; // Noncompliant: param to param assignment (promoted to unspeakable field behind the scenes)\n                                     // Secondary@-1\n    }\n}\n\nclass WithInlineArrays\n{\n    void Test(Buffer b)\n    {\n        b = b; // Noncompliant: local to local assignment\n               // Secondary@-1\n    }\n\n    [System.Runtime.CompilerServices.InlineArray(10)]\n    struct Buffer\n    {\n        int arrayItem;\n    }\n}\n\npartial class PartialProperties\n{\n    public partial bool IsTrue { get; set; }\n\n    void MyMethod()\n    {\n        IsTrue = IsTrue; // Noncompliant\n                         // Secondary@-1\n    }\n}\n\nclass CSharp14\n{\n    int field;\n\n    void NullConditionalAssignment(CSharp14 sample)\n    {\n        sample?.field = sample.field;   // FN NET-2779\n        this?.field = this.field;       // FN NET-2779\n    }\n\n    void ExtensionProperties(CSharp14 sample)\n    {\n        this.Property = this.Property;      // Noncompliant\n                                            // Secondary@-1\n        sample.Property = sample.Property;  // Noncompliant\n                                            // Secondary@-1\n        sample.Property = this.Property;    // Compliant\n        this.Property = sample.Property;    // Compliant\n    }\n}\n\nstatic class Extensions\n{\n    extension(CSharp14 sample)\n    {\n        public int Property { get => 0; set { } }\n\n        void ExtensionMethod()\n        {\n            sample.Property = sample.Property;  // Noncompliant\n        }                                       // Secondary@-1\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SelfAssignment.TopLevelStatements.cs",
    "content": "﻿int x = 42;\n\n  (x, var y) = (x, 42);\n// ^                    Noncompliant\n//              ^       Secondary@-1\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SelfAssignment.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Tests.TestCases\n{\n    class SelfAssignment\n    {\n        public SelfAssignment() { }\n        public SelfAssignment(int Prop1) { }\n\n        public int Prop1 { get; set; }\n\n        public void Test(SelfAssignment other)\n        {\n            var Prop1 = 5;\n            Prop1 = Prop1;\n//          ^^^^^         Noncompliant\n//                  ^^^^^ Secondary@-1\n\n            Prop1 = 2*Prop1;\n\n            var y = 5;\n            y = /*comment*/ y; // Noncompliant {{Remove or correct this useless self-assignment.}}\n                               // Secondary@-1\n\n            var x = new SelfAssignment\n            {\n                Prop1 = Prop1\n            };\n            x = new SelfAssignment(Prop1: Prop1);\n            var z = new\n            {\n                Prop1 = Prop1\n            };\n\n            other.Prop1 = other.Prop1;\n//          ^^^^^^^^^^^                    Noncompliant\n//                        ^^^^^^^^^^^      Secondary@-1\n            other.Prop1 = Prop1;        // Compliant\n            other.Prop1 = this.Prop1;   // Compliant\n            Prop1 = other.Prop1;        // Compliant\n            this.Prop1 = other.Prop1;   // Compliant\n        }\n    }\n\n    // Repro for https://github.com/SonarSource/sonar-dotnet/issues/9667\n    public class Sample\n    {\n        public string First { get; set; }\n        public string Second { get; set; }\n\n        public Sample(string first)\n        {\n            this.First = first;         // Compliant\n            Second = Second;            // Noncompliant\n                                        // Secondary@-1\n            this.Second = this.Second;  // Noncompliant\n                                        // Secondary@-1\n            this.Second = Second;       // FN NET-1544\n            Second = this.Second;       // FN NET-1544\n        }\n    }\n\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SelfAssignment.vb",
    "content": "﻿\nImports System.Collections.Generic\nImports System.Linq\nImports System.Text\nImports System.Threading.Tasks\n\nNamespace Tests.TestCases\n    Class SelfAssignment\n        Sub New()\n        End Sub\n\n        Sub New(Prop1 As Integer)\n        End Sub\n\n        Public Property Prop1 As Integer\n\n        Public Sub Test()\n            Prop1 = 5\n            Prop1 = Prop1 ' Noncompliant\n'           ^^^^^^^^^^^^^\n            Prop1 = 2 * Prop1\n\n            Dim y = 5\n            y = y ' Noncompliant {{Remove or correct this useless self-assignment.}}\n            Dim x = New SelfAssignment() With { .Prop1 = Prop1 }\n            x = New SelfAssignment(Prop1 := Prop1)\n            Dim z = New With { _\n                .Prop1 = Prop1 _\n            }\n        End Sub\n    End Class\n\n    ' Repro for https://github.com/SonarSource/sonar-dotnet/issues/9667\n    Public Class Sample\n\n        Public First, Second As String\n\n        Public Sub New(First As String)\n            Me.First = First    ' Compliant\n            Second = Second     ' Noncompliant\n            Me.Second = Second  ' False Negative\n            Second = Me.Second  ' False Negative\n        End Sub\n\n    End Class\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SerializationConstructorsShouldBeSecured.CSharp9.cs",
    "content": "﻿using System;\nusing System.Runtime.Serialization;\nusing System.Security.Permissions;\n\n[assembly: System.Security.AllowPartiallyTrustedCallers()]\n\n[Serializable]\npublic record Foo : ISerializable\n{\n    private int n;\n\n    [FileIOPermission(SecurityAction.Demand, Unrestricted = true)]\n    public Foo()\n    {\n        n = -1;\n    }\n\n    protected Foo(SerializationInfo info, StreamingContext context) // Noncompliant\n    {\n        n = (int)info.GetValue(\"n\", typeof(int));\n    }\n\n    void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)\n    {\n        info.AddValue(\"n\", n);\n    }\n}\n\n[Serializable]\npublic record Foo_ok : ISerializable\n{\n    [FileIOPermission(SecurityAction.Demand, Unrestricted = true)]\n    public Foo_ok() { }\n\n    [FileIOPermission(SecurityAction.Demand, Unrestricted = true)]\n    protected Foo_ok(SerializationInfo info, StreamingContext context) { } // Compliant\n\n    void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { }\n}\n\n[Serializable]\npublic record Bar : ISerializable\n{\n    [FileIOPermission(SecurityAction.Demand, Unrestricted = true)]\n    [ZoneIdentityPermission(SecurityAction.Demand, Unrestricted = true)]\n    public Bar() { }\n\n    [GacIdentityPermission(SecurityAction.Demand, Unrestricted = true)]\n    public Bar(int i) { }\n\n    [FileIOPermission(SecurityAction.Demand, Unrestricted = true)]\n    [ZoneIdentityPermission(SecurityAction.Demand, Unrestricted = true)]\n    protected Bar(SerializationInfo info, StreamingContext context) { } // Noncompliant\n\n    void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SerializationConstructorsShouldBeSecured.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Runtime.Serialization;\nusing System.Runtime.Serialization.Formatters.Binary;\nusing System.Security;\nusing System.Security.Permissions;\n\n[assembly: System.Security.AllowPartiallyTrustedCallers()]\nnamespace MyLibrary\n{\n    [Serializable]\n    public class Foo : ISerializable\n    {\n        private int n;\n\n        [FileIOPermissionAttribute(SecurityAction.Demand, Unrestricted = true)]\n        public Foo()\n        {\n            n = -1;\n        }\n\n        protected Foo(SerializationInfo info, StreamingContext context) // Noncompliant {{Secure this serialization constructor.}}\n//                ^^^\n        {\n            n = (int)info.GetValue(\"n\", typeof(int));\n        }\n\n        void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)\n        {\n            info.AddValue(\"n\", n);\n        }\n    }\n\n    [Serializable]\n    public class Foo_ok : ISerializable\n    {\n        [FileIOPermissionAttribute(SecurityAction.Demand, Unrestricted = true)]\n        public Foo_ok() { }\n\n        [FileIOPermissionAttribute(SecurityAction.Demand, Unrestricted = true)]\n        protected Foo_ok(SerializationInfo info, StreamingContext context) { } // Compliant\n\n        void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    [Serializable]\n    public class Foo2 : ISerializable\n    {\n        [FileIOPermissionAttribute(SecurityAction.Demand, Unrestricted = true)]\n        [ZoneIdentityPermission(SecurityAction.Demand, Unrestricted = true)]\n        public Foo2() { }\n\n        [FileIOPermissionAttribute(SecurityAction.Demand, Unrestricted = true)]\n        protected Foo2(SerializationInfo info, StreamingContext context) { } // Noncompliant\n\n        void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n\n    [Serializable]\n    public class Foo2_ok : ISerializable\n    {\n        [FileIOPermissionAttribute(SecurityAction.Demand, Unrestricted = true)]\n        [ZoneIdentityPermission(SecurityAction.Demand, Unrestricted = true)]\n        public Foo2_ok() { }\n\n        [FileIOPermissionAttribute(SecurityAction.Demand, Unrestricted = true)]\n        [ZoneIdentityPermission(SecurityAction.Demand, Unrestricted = true)]\n        protected Foo2_ok(SerializationInfo info, StreamingContext context) { } // Compliant\n\n        void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    [Serializable]\n    public class Foo3 : ISerializable\n    {\n        [FileIOPermissionAttribute(SecurityAction.Demand, Unrestricted = true)]\n        [ZoneIdentityPermission(SecurityAction.Demand, Unrestricted = true)]\n        public Foo3() { }\n\n        [GacIdentityPermission(SecurityAction.Demand, Unrestricted = true)]\n        public Foo3(int i) { }\n\n        [FileIOPermissionAttribute(SecurityAction.Demand, Unrestricted = true)]\n        [ZoneIdentityPermission(SecurityAction.Demand, Unrestricted = true)]\n        protected Foo3(SerializationInfo info, StreamingContext context) { } // Noncompliant\n\n        void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    [Serializable]\n    public class Foo3_ok : ISerializable\n    {\n        [FileIOPermissionAttribute(SecurityAction.Demand, Unrestricted = true)]\n        [ZoneIdentityPermission(SecurityAction.Demand, Unrestricted = true)]\n        public Foo3_ok() { }\n\n        [GacIdentityPermission(SecurityAction.Demand, Unrestricted = true)]\n        public Foo3_ok(int i) { }\n\n        [FileIOPermissionAttribute(SecurityAction.Demand, Unrestricted = true)]\n        [GacIdentityPermission(SecurityAction.Demand, Unrestricted = true)]\n        [ZoneIdentityPermission(SecurityAction.Demand, Unrestricted = true)]\n        protected Foo3_ok(SerializationInfo info, StreamingContext context) { } // Compliant\n\n        void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n\n    public class Foo4 : ISerializable\n    {\n        [FileIOPermissionAttribute(SecurityAction.InheritanceDemand)]\n        public Foo4() { }\n\n        [FileIOPermissionAttribute(SecurityAction.Demand)]\n        protected Foo4(SerializationInfo info, StreamingContext context) { } // Noncompliant\n\n        void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    public class Foo4_ok : ISerializable\n    {\n        [FileIOPermissionAttribute(SecurityAction.InheritanceDemand)]\n        public Foo4_ok() { }\n\n        [FileIOPermissionAttribute(SecurityAction.InheritanceDemand)]\n        protected Foo4_ok(SerializationInfo info, StreamingContext context) { } // Compliant\n\n        void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n\n    public class Foo5 : ISerializable\n    {\n        [FileIOPermissionAttribute(SecurityAction.Demand, Unrestricted = false)]\n        public Foo5() { }\n\n        [FileIOPermissionAttribute(SecurityAction.Demand, Unrestricted = true)]\n        protected Foo5(SerializationInfo info, StreamingContext context) { } // Noncompliant\n\n        void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    public class Foo5_ok : ISerializable\n    {\n        [FileIOPermissionAttribute(SecurityAction.Demand)]\n        public Foo5_ok() { }\n\n        [FileIOPermissionAttribute(SecurityAction.Demand)]\n        protected Foo5_ok(SerializationInfo info, StreamingContext context) { } // Compliant\n\n        void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n\n    public class Foo6 : ISerializable\n    {\n        [FileIOPermissionAttribute(SecurityAction.Demand, Unrestricted = true)]\n        public Foo6() { }\n\n        [FileIOPermissionAttribute(SecurityAction.Demand)]\n        protected Foo6(SerializationInfo info, StreamingContext context) { } // Noncompliant\n\n        void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    public class Foo6_ok : ISerializable\n    {\n        [FileIOPermissionAttribute(SecurityAction.Demand, Unrestricted = true)]\n        public Foo6_ok() { }\n\n        [FileIOPermissionAttribute(SecurityAction.Demand, Unrestricted = true)]\n        protected Foo6_ok(SerializationInfo info, StreamingContext context) { } // Compliant\n\n        void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    [Serializable]\n    public partial class MalformedAttributes : ISerializable\n    {\n        [FileIOPermissionAttribute(SecurityAction.Whatever_Mate)] // Error [CS0117] - invalid value\n        public MalformedAttributes() { }\n\n        protected MalformedAttributes(SerializationInfo info, StreamingContext context) { } // Noncompliant\n\n        public void GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SerializationConstructorsShouldBeSecured_NoAssemblyAttribute.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Runtime.Serialization;\nusing System.Runtime.Serialization.Formatters.Binary;\nusing System.Security;\nusing System.Security.Permissions;\n\nnamespace MyLibrary\n{\n    [Serializable]\n    public class Foo : ISerializable\n    {\n        private int n;\n\n        [FileIOPermissionAttribute(SecurityAction.Demand, Unrestricted = true)]\n        public Foo()\n        {\n            n = -1;\n        }\n\n        protected Foo(SerializationInfo info, StreamingContext context) // Compliant (no partial trust assembly attribute)\n        {\n            n = (int)info.GetValue(\"n\", typeof(int));\n        }\n\n        void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)\n        {\n            info.AddValue(\"n\", n);\n        }\n    }\n\n    [Serializable]\n    public class Foo_ok : ISerializable\n    {\n        [FileIOPermissionAttribute(SecurityAction.Demand, Unrestricted = true)]\n        public Foo_ok() { }\n\n        [FileIOPermissionAttribute(SecurityAction.Demand, Unrestricted = true)]\n        protected Foo_ok(SerializationInfo info, StreamingContext context) { } // Compliant\n\n        void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SerializationConstructorsShouldBeSecured_Part1.cs",
    "content": "﻿using System;\nusing System.Runtime.Serialization;\nusing System.Security.Permissions;\n\n[assembly: System.Security.AllowPartiallyTrustedCallers()]\nnamespace MyLibrary\n{\n    [Serializable]\n    public partial class PartialFoo : ISerializable\n    {\n        [FileIOPermission(SecurityAction.Demand, Unrestricted = true)]\n        [ZoneIdentityPermission(SecurityAction.Demand, Unrestricted = true)]\n        public PartialFoo() { }\n\n        public void GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    [Serializable]\n    public partial class PartialFoo_ok : ISerializable\n    {\n        [FileIOPermission(SecurityAction.Demand, Unrestricted = true)]\n        [ZoneIdentityPermission(SecurityAction.Demand, Unrestricted = true)]\n        public PartialFoo_ok() { }\n\n        public void GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n\n    [Serializable]\n    public partial class PartialFoo2 : ISerializable\n    {\n        [FileIOPermission(SecurityAction.Demand, Unrestricted = true)]\n        protected PartialFoo2(SerializationInfo info, StreamingContext context) { } // Noncompliant\n\n        public void GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n\n    [Serializable]\n    public partial class PartialFoo2_ok : ISerializable\n    {\n        [FileIOPermission(SecurityAction.Demand, Unrestricted = true)]\n        [ZoneIdentityPermission(SecurityAction.Demand, Unrestricted = true)]\n        protected PartialFoo2_ok(SerializationInfo info, StreamingContext context) { }\n\n        public void GetObjectData(SerializationInfo info, StreamingContext context) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SerializationConstructorsShouldBeSecured_Part2.cs",
    "content": "﻿using System.Runtime.Serialization;\nusing System.Security.Permissions;\n\nnamespace MyLibrary\n{\n    public partial class PartialFoo\n    {\n        [FileIOPermission(SecurityAction.Demand, Unrestricted = true)]\n        protected PartialFoo(SerializationInfo info, StreamingContext context) { }  // Noncompliant\n    }\n\n    public partial class PartialFoo_ok : ISerializable\n    {\n        [FileIOPermission(SecurityAction.Demand, Unrestricted = true)]\n        [ZoneIdentityPermission(SecurityAction.Demand, Unrestricted = true)]\n        protected PartialFoo_ok(SerializationInfo info, StreamingContext context) { }\n    }\n\n\n    public partial class PartialFoo2 : ISerializable\n    {\n        [FileIOPermission(SecurityAction.Demand, Unrestricted = true)]\n        [ZoneIdentityPermission(SecurityAction.Demand, Unrestricted = true)]\n        public PartialFoo2() { }\n    }\n\n    public partial class PartialFoo2_ok : ISerializable\n    {\n        [FileIOPermission(SecurityAction.Demand, Unrestricted = true)]\n        [ZoneIdentityPermission(SecurityAction.Demand, Unrestricted = true)]\n        public PartialFoo2_ok() { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SetLocaleForDataTypes.CSharp10.cs",
    "content": "﻿using System;\nusing System.Data;\nusing System.Globalization;\n\nDataTable y, d, f, j, l;\nint b, h;\n\n(var x, y) = (new DataTable(), new DataTable()); // Noncompliant [1, 2]\n\n(var a, b) = (new DataTable(), 42); // Noncompliant\n\n(var c, d) = (42, new DataTable()); // Noncompliant\n\n(var e, f) = (new DataTable(), new DataTable());\n(e.Locale, f.Locale) = (CultureInfo.InvariantCulture, CultureInfo.InvariantCulture);\n\n(var g, h) = (new DataTable(), 42);\n(g.Locale, h) = (CultureInfo.InvariantCulture, 42);\n\n(var i, j) = (42, new DataTable());\n(i, j.Locale) = (42, CultureInfo.InvariantCulture);\n\nvar dt = new DataTable();\n(i, (dt.Locale, h)) = (42, (CultureInfo.InvariantCulture, 0));\n\n(var k, l) = (new DataTable(), new DataTable()); // Noncompliant {{Set the locale for this 'DataTable'.}}\n//                             ^^^^^^^^^^^^^^^\nk.Locale = CultureInfo.InvariantCulture;\n\n(var x1, var x2) = ((new DataTable(), 42)); // FN\n(var x3, var x4) = ((new DataTable()), 42); // Noncompliant\nDataTable x5;\n((x5), var x6) = ((new DataTable(), 42)); // FN\n\nvar (xx, yy) = (new DataTable(), new DataTable()); // Noncompliant [3, 4]\nvar (xxx, yyy) = (0, (new DataTable(), 2)); // FN\n(int xxxx, (DataTable, int) yyyy) = (0, (new DataTable(), 2)); // FN\n\nTupleParameter((new DataTable(), new DataTable())); // FN\n\nvoid TupleParameter((DataTable, DataTable) dataTableTuple) { }\n\nvar (_, (_, (o, _))) = (1, (2, (new DataTable(), 4))); // Noncompliant\n\nDataTable foo, bar;\nfoo = (bar = new DataTable()); // Noncompliant\nvar foobar = (bar ??= new DataTable()); // FN\n\nDataTable myTable5, myTable6;\nvar (myTable1, myTable2) = ((new DataTable { Locale = CultureInfo.InvariantCulture }), new DataTable()); // Noncompliant\n//                                                                                     ^^^^^^^^^^^^^^^\n(var myTable3, var myTable4) = (new DataTable { Locale = CultureInfo.InvariantCulture }, new DataTable()); // Noncompliant\n//                                                                                       ^^^^^^^^^^^^^^^\n(myTable5, myTable6) = (new DataTable { Locale = CultureInfo.InvariantCulture }, new DataTable()); // Noncompliant\n//                                                                               ^^^^^^^^^^^^^^^\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SetLocaleForDataTypes.CSharp9.cs",
    "content": "﻿using System;\nusing System.Data;\nusing System.Globalization;\n\nDataTable table1 = new DataTable { Locale = CultureInfo.InvariantCulture };\ntable1 = new(); // Compliant - FN\n\nvar table2 = new DataTable(); // Noncompliant\n\nDataTable x, y;\n\n(x, y) = (new DataTable(), new DataTable()); // Noncompliant [issue1, issue2]\n\nDataTable table3 = new() { Locale = CultureInfo.InvariantCulture };\nDataTable table4 = new(); // Noncompliant\n\nDataSet set1 = new(); // Noncompliant\n\nDataSet set2 = new();\nset2.Locale = CultureInfo.InvariantCulture;\n\nrecord Record\n{\n    void MoreTest()\n    {\n        var dataTable = new DataTable(); // Noncompliant {{Set the locale for this 'DataTable'.}}\n\n        Action action = static () =>\n        {\n            DataTable dataTable = new() { Locale = CultureInfo.InvariantCulture };\n        };\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SetLocaleForDataTypes.cs",
    "content": "﻿using System;\nusing System.Data;\nusing System.Globalization;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        private DataTable myTable = new DataTable { Locale = CultureInfo.InvariantCulture };\n        private DataTable myWrongTable = new DataTable(); // Noncompliant {{Set the locale for this 'DataTable'.}}\n        //                               ^^^^^^^^^^^^^^^\n        private DataTable myWrongTable1 = new DataTable(), myWrongTable2 = new DataTable();\n        //                                ^^^^^^^^^^^^^^^                                      {{Set the locale for this 'DataTable'.}}\n        //                                                                 ^^^^^^^^^^^^^^^ @-1 {{Set the locale for this 'DataTable'.}}\n\n        void Foo()\n        {\n            var dataTable = new System.Data.DataTable();\n            dataTable.Locale = System.Globalization.CultureInfo.InvariantCulture;\n\n            var dataSet = new System.Data.DataSet();\n            dataSet.Locale = System.Globalization.CultureInfo.InvariantCulture;\n\n            DataTable dataTable2;\n            dataTable2 = new DataTable { Locale = CultureInfo.InvariantCulture };\n\n            var fooBar = new FooBar(new DataTable()); // FN\n\n            var a = new\n            {\n                MyTable1 = new DataTable { Locale = CultureInfo.InvariantCulture },\n                MyTable2 = new DataTable(), // FN\n            };\n        }\n\n        void Bar(DataColumn column)\n        {\n            column.Unique = true; // Compliant - not creating the DataTable\n        }\n\n        void Bar(DataSet set)\n        {\n            set.CaseSensitive = true; // Compliant - not creating the DataSet\n        }\n\n        DataTable BadCase1()\n        {\n            var dataTable = new System.Data.DataTable(); // Noncompliant {{Set the locale for this 'DataTable'.}}\n            return dataTable;\n        }\n\n        DataSet BadCase2()\n        {\n            var dataSet = new System.Data.DataSet(); // Noncompliant {{Set the locale for this 'DataSet'.}}\n            return dataSet;\n        }\n\n        DataTable BadCase3()\n        {\n            DataTable dataTable;\n            dataTable = new System.Data.DataTable(); // Noncompliant {{Set the locale for this 'DataTable'.}}\n            return dataTable;\n        }\n\n        void MoreTest()\n        {\n            var dataTable1 = new DataTable(); // Noncompliant {{Set the locale for this 'DataTable'.}}\n            var dataTable2 = new DataTable();\n            dataTable2.Locale = System.Globalization.CultureInfo.InvariantCulture;\n            dataTable2 = new DataTable(); // Compliant FN\n        }\n\n        void BadSyntax()\n        {\n            a = new DataTable();  // Error [CS0103]\n        }\n\n        void CornerCases()\n        {\n            new DataTable { Locale = CultureInfo.CurrentUICulture };\n            new DataTable();\n        }\n\n        void Bar()\n        {\n            void M(DataTable table) { }\n            M(new DataTable()); // FN\n\n            void Init(DataTable dt) => dt.Locale = new CultureInfo(\"de-DE\");\n            var datatable = new DataTable(); // Noncompliant FP\n            Init(datatable);\n        }\n\n        void MultipleVariableDeclarators()\n        {\n            DataTable myTable1 = new DataTable { Locale = CultureInfo.CurrentUICulture }, myTable2 = new DataTable();\n            //                                                                                       ^^^^^^^^^^^^^^^  Noncompliant\n            DataTable myTable3 = new DataTable(), myTable4 = new DataTable { Locale = CultureInfo.CurrentUICulture };\n            //                   ^^^^^^^^^^^^^^^                                                                      Noncompliant\n            DataTable myTable5 = new DataTable(), myTable6 = new DataTable();\n            //                   ^^^^^^^^^^^^^^^                                                                      Noncompliant\n            //                                               ^^^^^^^^^^^^^^^                                          @-1\n        }\n    }\n\n    public class FooBar\n    {\n        public FooBar(DataTable datatable) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SetPropertiesInsteadOfMethods.Latest.cs",
    "content": "﻿using System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Collections.ObjectModel;\nusing System.Collections.Specialized;\n\nvar sortedSet = ImmutableSortedSet.Create<int>();\n\n_ = sortedSet.Min(); // Noncompliant {{\"Min\" property of Set type should be used instead of the \"Min()\" extension method.}}\n//            ^^^\n_ = sortedSet?.Min(); // Noncompliant {{\"Min\" property of Set type should be used instead of the \"Min()\" extension method.}}\n//             ^^^\n_ = sortedSet.Max(); // Noncompliant {{\"Max\" property of Set type should be used instead of the \"Max()\" extension method.}}\n//            ^^^\n_ = sortedSet?.Max(); // Noncompliant {{\"Max\" property of Set type should be used instead of the \"Max()\" extension method.}}\n//             ^^^\n\nFunc<SortedSet<int>, int> funcMin = x => x.Min(); // Noncompliant\nFunc<SortedSet<int>, int> funcMax = x => x.Max(); // Noncompliant\n\nSortedSet<int> DoWork() => null;\n\nDoWork().Min(); // Noncompliant\nDoWork().Max(); // Noncompliant\n\nDoWork()?.Min(); // Noncompliant\nDoWork()?.Max(); // Noncompliant\n\nImmutableSortedSet.Create<int>().Add(42).Min(); // Noncompliant\nImmutableSortedSet.CreateBuilder<int>().ToImmutable().Max(); // Noncompliant\n\nclass CSharp13\n{\n    void NewCollectionTypes(HashSet<int> set)\n    {\n        OrderedDictionary<int, int> orderedDictionary = new OrderedDictionary<int, int>();\n        _ = orderedDictionary.Min(); // Compliant\n        _ = orderedDictionary.Max(); // Compliant\n        _ = orderedDictionary?.Min(); // Compliant\n        _ = orderedDictionary?.Max(); // Compliant\n\n        ReadOnlySet<int> readonlySet = new ReadOnlySet<int>(set);\n        _ = readonlySet.Min(); // Compliant\n        _ = readonlySet.Max(); // Compliant\n        _ = readonlySet?.Min(); // Compliant\n        _ = readonlySet?.Max(); // Compliant\n    }\n}\n\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SetPropertiesInsteadOfMethods.cs",
    "content": "﻿using System;\nusing System.Linq;\nusing System.Collections;\nusing System.Collections.Generic;\n\nstatic class Program\n{\n    static void SortedSet()\n    {\n        var sortedSet = new SortedSet<int>();\n\n        _ = sortedSet.Min(); // Noncompliant {{\"Min\" property of Set type should be used instead of the \"Min()\" extension method.}}\n        //            ^^^\n        _ = sortedSet?.Min(); // Noncompliant {{\"Min\" property of Set type should be used instead of the \"Min()\" extension method.}}\n        //             ^^^\n        _ = sortedSet.Max(); // Noncompliant {{\"Max\" property of Set type should be used instead of the \"Max()\" extension method.}}\n        //            ^^^\n        _ = sortedSet?.Max(); // Noncompliant {{\"Max\" property of Set type should be used instead of the \"Max()\" extension method.}}\n        //             ^^^\n\n        Func<SortedSet<int>, int> funcMin = x => x.Min(); // Noncompliant\n        Func<SortedSet<int>, int> funcMax = x => x.Max(); // Noncompliant\n\n        SortedSet<int> DoWork() => null;\n\n        DoWork().Min(); // Noncompliant\n        DoWork().Max(); // Noncompliant\n\n        DoWork()?.Min(); // Noncompliant\n        DoWork()?.Max(); // Noncompliant\n\n        new SortedSet<int> { 42 }.Min(); // Noncompliant\n        new SortedSet<int> { 42 }.Max(); // Noncompliant\n\n        sortedSet.Min(x => 42f); // Compliant, predicate used\n        sortedSet?.Max(x => x); // Compliant, predicate used\n    }\n\n    static void DerivesFromSortedSet()\n    {\n        var sortedSetDerived = new DerivesFromSetType<int>();\n\n        (true ? sortedSetDerived : sortedSetDerived).Min(); // Noncompliant\n        (true ? sortedSetDerived : sortedSetDerived).Max(); // Noncompliant\n\n        (sortedSetDerived ?? sortedSetDerived).Min(); // Noncompliant\n        (sortedSetDerived ?? sortedSetDerived).Max(); // Noncompliant\n\n        (sortedSetDerived ?? (true ? sortedSetDerived : sortedSetDerived)).Min(); // Noncompliant\n        (sortedSetDerived ?? (true ? sortedSetDerived : sortedSetDerived)).Max(); // Noncompliant\n\n        sortedSetDerived.Fluent().Fluent().Fluent().Fluent().Min(); // Noncompliant\n        sortedSetDerived.Fluent().Fluent().Fluent().Fluent()?.Max(); // Noncompliant\n        sortedSetDerived.Fluent().Fluent().Fluent()?.Fluent().Min(); // Noncompliant\n        sortedSetDerived.Fluent().Fluent().Fluent()?.Fluent()?.Max(); // Noncompliant\n        sortedSetDerived.Fluent().Fluent()?.Fluent().Fluent().Min(); // Noncompliant\n        sortedSetDerived.Fluent().Fluent()?.Fluent().Fluent()?.Max(); // Noncompliant\n        sortedSetDerived.Fluent().Fluent()?.Fluent()?.Fluent().Min(); // Noncompliant\n        sortedSetDerived.Fluent().Fluent()?.Fluent()?.Fluent()?.Max(); // Noncompliant\n        sortedSetDerived.Fluent()?.Fluent().Fluent().Fluent().Min(); // Noncompliant\n        sortedSetDerived.Fluent()?.Fluent().Fluent().Fluent()?.Max(); // Noncompliant\n        sortedSetDerived.Fluent()?.Fluent().Fluent()?.Fluent().Min(); // Noncompliant\n        sortedSetDerived.Fluent()?.Fluent().Fluent()?.Fluent()?.Max(); // Noncompliant\n        sortedSetDerived.Fluent()?.Fluent()?.Fluent().Fluent().Min(); // Noncompliant\n        sortedSetDerived.Fluent()?.Fluent()?.Fluent().Fluent()?.Max(); // Noncompliant\n        sortedSetDerived.Fluent()?.Fluent()?.Fluent()?.Fluent().Min(); // Noncompliant\n        sortedSetDerived.Fluent()?.Fluent()?.Fluent()?.Fluent()?.Max(); // Noncompliant\n        //                                                       ^^^\n\n        sortedSetDerived.Min(x => x == 42f); // Compliant, comparer used\n        sortedSetDerived?.Max(x => x == 42); // Compliant, comparer used\n    }\n\n    static void TrueNegatives()\n    {\n        var set = new SortedSet<int>();\n        _ = set.Min; // Compliant\n        _ = set.Max; // Compliant\n\n        T Min<T>() => default(T);\n        T Max<T>() => default(T);\n\n        Min<int>(); // Compliant\n        Max<int>(); // Compliant\n\n        var doesNotDerive = new DoesNotDeriveFromSetType<int>();\n        doesNotDerive.Min(); // Compliant, does not derive from Set type\n        doesNotDerive.Max(); // Compliant, does not derive from Set type\n\n        var hidden = new DerivesFromSetTypeButHidesEnumerableMethods<int>();\n        hidden.Min(); // Compliant, hides LINQ's Min extension\n        hidden.Max(); // Compliant, hides LINQ's Max extension\n\n        dynamic dynamicSet = new SortedSet<int>();\n        dynamicSet.Min(); // Compliant, dynamic type\n        dynamicSet.Max(); // Compliant, dynamic type\n    }\n}\n\nclass DerivesFromSetType<T> : SortedSet<T>\n{\n    public DerivesFromSetType<T> Fluent() => this;\n}\n\nclass DerivesFromSetTypeButHidesEnumerableMethods<T> : SortedSet<T>\n{\n    public T Min() => default(T);\n    public T Max() => default(T);\n}\n\nclass DoesNotDeriveFromSetType<T> : IEnumerable<T>\n{\n    public IEnumerator<T> GetEnumerator() => null;\n    IEnumerator IEnumerable.GetEnumerator() => null;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SetPropertiesInsteadOfMethods.vb",
    "content": "﻿Imports System\nImports System.Linq\nImports System.Collections\nImports System.Collections.Generic\nImports System.Collections.Immutable\n\nModule Program\n    Sub SortedSet()\n        Dim sortedSet = New SortedSet(Of Integer)()\n\n        Dim dummy = Enumerable.Min(sortedSet) ' Noncompliant {{\"Min\" property of Set type should be used instead of the \"Min()\" extension method.}}\n        dummy = Enumerable.Max(sortedSet) ' Noncompliant {{\"Max\" property of Set type should be used instead of the \"Max()\" extension method.}}\n\n        Dim funcMin As Func(Of SortedSet(Of Integer), Integer) = Function(x) Enumerable.Min(x) ' Noncompliant\n        Dim funcMax As Func(Of SortedSet(Of Integer), Integer) = Function(x) Enumerable.Max(x) ' Noncompliant\n\n        Dim doWork As Func(Of SortedSet(Of Integer)) = Function() Nothing\n\n        dummy = Enumerable.Min(doWork()) ' Noncompliant\n        dummy = Enumerable.Min(doWork.Invoke()) ' Noncompliant\n\n        dummy = Enumerable.Min(New SortedSet(Of Integer)({42})) ' Noncompliant\n        dummy = Enumerable.Max(New SortedSet(Of Integer)({42})) ' Noncompliant\n\n        dummy = Enumerable.Min(sortedSet, Function(x) 42) ' Compliant, predicate used\n        dummy = Enumerable.Max(sortedSet, Function(x) 42.0F) ' Compliant, predicate used\n    End Sub\n\n    Sub DerivesFromSortedSet()\n        Dim sortedSetDerived = New DerivesFromSetType(Of Integer)()\n\n        Dim ternary = IIf(True, sortedSetDerived, sortedSetDerived)\n        Enumerable.Min(ternary) ' Compliant - IIf returns un-typed object\n        Enumerable.Max(ternary) ' Compliant - IIf returns untyped object\n\n        Enumerable.Min(sortedSetDerived.Fluent().Fluent().Fluent().Fluent()) ' Noncompliant\n        Enumerable.Max(sortedSetDerived.Fluent().Fluent().Fluent()?.Fluent()) ' Noncompliant\n        Enumerable.Min(sortedSetDerived.Fluent().Fluent()?.Fluent().Fluent()) ' Noncompliant\n        Enumerable.Max(sortedSetDerived.Fluent().Fluent()?.Fluent()?.Fluent()) ' Noncompliant\n        Enumerable.Min(sortedSetDerived.Fluent()?.Fluent().Fluent().Fluent()) ' Noncompliant\n        Enumerable.Max(sortedSetDerived.Fluent()?.Fluent().Fluent()?.Fluent()) ' Noncompliant\n        Enumerable.Min(sortedSetDerived.Fluent()?.Fluent()?.Fluent().Fluent()) ' Noncompliant\n        Enumerable.Max(sortedSetDerived.Fluent()?.Fluent()?.Fluent()?.Fluent()) ' Noncompliant\n        '          ^^^\n        Enumerable.Min(sortedSetDerived, Function(x) x = 42) ' Compliant, predicate used\n        Enumerable.Max(sortedSetDerived, Function(x) x = 42.0F) ' Compliant, predicate used\n    End Sub\n\n    Sub TrueNegatives()\n        Dim sortedSet = New SortedSet(Of Integer)()\n        Dim dummy = sortedSet.Min ' Compliant\n        dummy = sortedSet.Max ' Compliant\n        dummy = sortedSet.Min() ' Compliant\n        dummy = sortedSet.Max() ' Compliant\n\n        Dim doesNotDerive = New DoesNotDeriveFromSetType(Of Integer)()\n        doesNotDerive.Min() ' Compliant, does not derive from Set type\n        doesNotDerive.Max() ' Compliant, does not derive from Set type\n        dummy = Enumerable.Min(doesNotDerive) ' Compliant, does not derive from Set type\n        dummy = Enumerable.Max(doesNotDerive) ' Compliant, does not derive from Set type\n    End Sub\nEnd Module\n\nClass DerivesFromSetType(Of T)\n    Inherits SortedSet(Of T)\n\n    Public Function Fluent() As DerivesFromSetType(Of T)\n        Return Me\n    End Function\nEnd Class\n\nClass DoesNotDeriveFromSetType(Of T)\n    Implements IEnumerable(Of T)\n\n    Public Function Min() As Integer\n        Return 42\n    End Function\n\n    Public Function Max() As Integer\n        Return 42\n    End Function\n\n    Public Function GetEnumerator() As IEnumerator(Of T) Implements IEnumerable(Of T).GetEnumerator\n        Return Nothing\n    End Function\n\n    Private Function IEnumerable_GetEnumerator() As IEnumerator Implements IEnumerable.GetEnumerator\n        Return Nothing\n    End Function\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ShiftDynamicNotInteger.CSharp11.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public class MyClass\n    {\n        public static implicit operator int(MyClass self)\n        {\n            return 1;\n        }\n    }\n\n    class ShiftDynamicNotInteger\n    {\n        public void Test()\n        {\n            int d = 5;\n            var x = d >>> d; // Compliant\n            x = d >>> new MyClass(); // Compliant\n            x = d >>> new MyUnknownClass(); // Compliant // Error [CS0246] - unknown type\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ShiftDynamicNotInteger.CSharp9.cs",
    "content": "﻿dynamic d = 5;\nvar x = d >> 5.4; // Noncompliant\n\nnuint i = 0;\nvar y = i >> 4; // Compliant\n\nnint j = 1;\nvar z = j >> 4; // Compliant\n\nx = d >> new ImplicitCast();\nx = d >> new NoImplicitCast(); // Noncompliant\n\nrecord ImplicitCast\n{\n    public static implicit operator int(ImplicitCast self) => 1;\n}\n\nrecord NoImplicitCast { }\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ShiftDynamicNotInteger.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public class MyClass\n    {\n        public static implicit operator int(MyClass self)\n        {\n            return 1;\n        }\n    }\n\n    class ShiftDynamicNotInteger\n    {\n        public void Test()\n        {\n            dynamic d = 5;\n            var x = d >> 5.4; // Noncompliant\n//                       ^^^\n            x = d >> null; // Noncompliant\n            x <<= new object(); // Noncompliant {{Remove this erroneous shift, it will fail because 'object' can't be implicitly converted to 'int'.}}\n\n            x = d << d; // Compliant\n            x = d >> new MyClass(); // Compliant\n\n            x = d >> new MyUnknownClass(); // Compliant // Error [CS0246] - unknown type\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ShiftDynamicNotInteger.vb",
    "content": "﻿Option Strict Off\nNamespace Tests.Diagnostics\n\n    Public Class ShiftDynamicNotInteger\n        Public Sub Test()\n            Dim o As Object = 5\n\n            Dim x as Integer\n\n            ' Object cannot be shifted\n            x = o >> 5 ' Noncompliant\n            x = o << 5 ' Noncompliant\n\n            x = Nothing >> 5 ' Compliant, returns 0\n            x = Nothing << 5 ' Compliant, returns 0\n\n            x = x >> Nothing ' Compliant, returns x\n            x = x << Nothing ' Compliant, returns x\n\n            ' Object cannot be used as shift parameter\n            x = x >> o ' Noncompliant\n            x = x << o ' Noncompliant\n            x <<= o ' Noncompliant {{Remove this erroneous shift, it will fail because 'Object' can't be implicitly converted to 'int'.}}\n            x = o << o ' Noncompliant\n\n            ' Compliant cases\n            x = x >> 2\n            x = x << 2\n        End Sub\n    End Class\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ShiftDynamicNotInteger2.vb",
    "content": "﻿Option Strict Off\nNamespace AppendedNamespaceForConcurrencyTest.Tests.Diagnostics\n\n    Public Class ShiftDynamicNotInteger\n        Public Sub Test()\n            Dim o As Object = 5\n\n            Dim x as Integer\n\n            ' Object cannot be shifted\n            x = o >> 5 ' Noncompliant\n            x = o << 5 ' Noncompliant\n\n            x = Nothing >> 5 ' Compliant, returns 0\n            x = Nothing << 5 ' Compliant, returns 0\n\n            x = x >> Nothing ' Compliant, returns x\n            x = x << Nothing ' Compliant, returns x\n\n            ' Object cannot be used as shift parameter\n            x = x >> o ' Noncompliant\n            x = x << o ' Noncompliant\n            x <<= o ' Noncompliant {{Remove this erroneous shift, it will fail because 'Object' can't be implicitly converted to 'int'.}}\n            x = o << o ' Noncompliant\n\n            ' Compliant cases\n            x = x >> 2\n            x = x << 2\n        End Sub\n    End Class\n\nEnd Namespace\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ShouldImplementExportedInterfaces.CSharp9.cs",
    "content": "﻿using System;\nusing System.ComponentModel.Composition;\n\ninterface MyInterface { }\n\n[Export(typeof(MyInterface))] // Noncompliant\n[Export(typeof(Exported))] // Noncompliant\nrecord NotExported\n{\n}\n\n[Export(typeof(MyInterface))] // Noncompliant\n[Export(typeof(Exported))] // Noncompliant\nrecord NotExportedPositional(string Value)\n{\n}\n\n[Export(typeof(MyInterface))]\n[Export(typeof(Exported))]\nrecord Descendant : Exported\n{\n}\n\n[Export(typeof(MyInterface))]\n[Export(typeof(Descendant))] // Noncompliant\nrecord Exported : MyInterface\n{\n}\n\n[Export(contractType: typeof(IComparable), contractName: \"asdasd\")] // Noncompliant\n[Export(contractType: typeof(MyInterface), contractName: \"asdasd\")]\nrecord NotExported_NamedArgs_ReverseOrder : MyInterface\n{\n}\n\ninterface ISomething<T> { }\n\n[Export(typeof(ISomething<>))]\npublic record Something<T> : ISomething<T>\n{\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ShouldImplementExportedInterfaces.System.Composition.cs",
    "content": "﻿using System.Composition;\n\npublic interface IContract { }\n\n[Export(typeof(IContract))] // Noncompliant\nclass DoesNotImplement\n{\n}\n\n[Export(typeof(IContract))] // Compliant\nclass Implements : IContract\n{\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ShouldImplementExportedInterfaces.cs",
    "content": "﻿using System;\nusing System.ComponentModel.Composition;\n\nnamespace Classes\n{\n    static class Constants\n    {\n        public const string ContractName = \"asdasd\";\n    }\n\n    interface MyInterface { }\n\n    [Export(typeof(MyInterface))] // Noncompliant {{Implement 'MyInterface' on 'NotExported' or remove this export attribute.}}\n//   ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    [Export(typeof(Exported))] // Noncompliant {{Derive from 'Exported' on 'NotExported' or remove this export attribute.}}\n//   ^^^^^^^^^^^^^^^^^^^^^^^^\n    class NotExported\n    {\n    }\n\n    [Export(contractType: typeof(IComparable), contractName: \"asdasd\")] // Noncompliant\n    [Export(contractType: typeof(MyInterface), contractName: \"asdasd\")]\n    class NotExported_NamedArgs_ReverseOrder : MyInterface\n    {\n    }\n\n    [Export(\"something\", typeof(MyInterface))] // Noncompliant\n    [Export(Constants.ContractName, typeof(IDisposable))] // Noncompliant\n    class NotExported_MultipleArgs\n    {\n    }\n\n    [Export(typeof(MyInterface)), Export(typeof(IComparable)), Export(typeof(IDisposable))]\n//   ^^^^^^^^^^^^^^^^^^^^^^^^^^^ {{Implement 'MyInterface' on 'NotExported_Multiple' or remove this export attribute.}}\n//                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @-1 {{Implement 'IComparable' on 'NotExported_Multiple' or remove this export attribute.}}\n    class NotExported_Multiple : IDisposable\n    {\n        public void Dispose() { }\n    }\n\n    [ExportAttribute(typeof(MyInterface))] // Noncompliant\n    class NotExported_FullAttributeName\n    {\n    }\n\n    [Export(typeof(MyInterface))]\n    [Export(typeof(Descendant))] // Noncompliant\n    class Exported : MyInterface\n    {\n    }\n\n    [Export]\n    [Export(\"something\")] // Exposing ourselves\n    [Export(typeof(Exporting_Ourselves))]\n    class Exporting_Ourselves\n    {\n    }\n\n    [Export()]\n    class Exporting_CornerCase\n    {\n    }\n\n    [Export(1)] // Error [CS1503]\n    [Export(1, typeof(IComparable))] // Error [CS1503]\n    [Export(typeof(ASDASD))] // Error [CS0246]\n    [Export(typeof(MyInterface), typeof(IComparable))] // Error [CS1503]\n    class InvalidSyntax\n    {\n    }\n\n    [Import(typeof(MyInterface))] // Error [CS0592] - cannot import here\n    [InheritedExport(typeof(MyInterface))] // Noncompliant\n    [InheritedExport(typeof(OtherAttributes))]\n    class OtherAttributes\n    {\n    }\n\n    [Export(typeof(MyInterface))]\n    [Export(typeof(Exported))]\n    class Descendant : Exported\n    {\n    }\n\n    class ExportingMembers_Are_Ignored\n    {\n        [Export(typeof(MyInterface))]\n        [Export(typeof(Exported))]\n        public NotExported MyProperty { get; set; }\n\n        [Export(typeof(MyInterface))]\n        [Export(typeof(Exported))]\n        public NotExported MyField;\n\n        [Export(typeof(MyInterface))]\n        [Export(typeof(Exported))]\n        public NotExported MyMethod() { return null; }\n    }\n\n    interface ISomething<T> { }\n    public class BaseThing { }\n    public class BaseThing2 { }\n\n    [Export(typeof(ISomething<BaseThing>))]\n    public class BaseSomethingImplementation : ISomething<BaseThing>\n    {\n\n    }\n\n    // Error@+1 [CS0416]\n    [Export(typeof(ISomething<BaseThing>))] // Noncompliant {{Implement 'ISomething<BaseThing>' on 'Something<BaseThing>' or remove this export attribute.}}\n    public class Something<BaseThing>\n    {\n    }\n\n    [Export(typeof(ISomething<BaseThing>))] // Noncompliant\n    public class SomethingImplementation : ISomething<BaseThing2>\n    {\n\n    }\n\n    [Export(typeof(ISomething<>))]\n    public class Soomething<T> : ISomething<T>\n    {\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ShouldImplementExportedInterfaces.vb",
    "content": "﻿Imports System\nImports System.ComponentModel.Composition\n\nNamespace Classes\n    Module Constants\n        Public Const ContractName As String = \"asdasd\"\n    End Module\n\n    Interface MyInterface\n    End Interface\n\n    ' Noncompliant@+2 {{Implement 'MyInterface' on 'NotExported' or remove this export attribute.}}\n    ' Noncompliant@+2 {{Derive from 'Exported' on 'NotExported' or remove this export attribute.}}\n    <Export(GetType(MyInterface))>\n    <Export(GetType(Exported))>\n    Class NotExported\n'    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @-2\n'    ^^^^^^^^^^^^^^^^^^^^^^^^^ @-2\n    End Class\n\n    ' Noncompliant@+2\n    ' Noncompliant@+2\n    <Export(\"something\", GetType(MyInterface))>\n    <Export(Constants.ContractName, GetType(IDisposable))>\n    Class NotExported_MultipleArgs\n    End Class\n\n    <Export(GetType(MyInterface)), Export(GetType(IComparable)), Export(GetType(IDisposable))>\n    Class NotExported_Multiple\n'    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @-1 {{Implement 'MyInterface' on 'NotExported_Multiple' or remove this export attribute.}}\n'                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @-2 {{Implement 'IComparable' on 'NotExported_Multiple' or remove this export attribute.}}\n        Implements IDisposable ' Error [BC30149]\n        Sub Dispose()\n        End Sub\n    End Class\n\n    ' Noncompliant@+1\n    <ExportAttribute(GetType(MyInterface))>\n    Class NotExported_FullAttributeName\n    End Class\n\n    ' Noncompliant@+2\n    <Export(GetType(MyInterface))>\n    <Export(GetType(Descendant))>\n    Class Exported\n        Implements MyInterface\n    End Class\n\n    ' Exposing ourselves\n    <Export>\n    <Export(\"something\")>\n    <Export(GetType(Exporting_Ourselves))>\n    Class Exporting_Ourselves\n    End Class\n\n    ' Noncompliant@+1\n    <InheritedExport(GetType(MyInterface))>\n    <InheritedExport(GetType(OtherAttributes))>\n    Class OtherAttributes\n    End Class\n\n    <Export(GetType(MyInterface))>\n    <Export(GetType(Exported))>\n    class Descendant\n        Inherits Exported\n    End Class\n\n    Class ExportingMembers_Are_Ignored\n        <Export(GetType(MyInterface))>\n        <Export(GetType(Exported))>\n        Public Property MyProperty As NotExported\n\n        <Export(GetType(MyInterface))>\n        <Export(GetType(Exported))>\n        Public MyField As NotExported\n\n        <Export(GetType(MyInterface))>\n        <Export(GetType(Exported))>\n        Public Function MyMethod() As NotExported\n        End Function\n    End Class\n\n    Interface ISomething(Of T)\n    End Interface\n\n    Public Class BaseThing\n    End Class\n    Public class BaseThing2\n    End Class\n\n    <Export(GetType(ISomething(Of BaseThing)))>\n    Public Class BaseSomethingImplementation\n        Implements ISomething(Of BaseThing)\n    End Class\n\n    ' Noncompliant@+1 {{Implement 'ISomething(Of BaseThing)' on 'Something(Of BaseThing)' or remove this export attribute.}}\n    <Export(GetType(ISomething(Of BaseThing)))>\n    Public Class Something(Of BaseThing)\n    End Class\n\n    ' Noncompliant@+1\n    <Export(GetType(ISomething(Of BaseThing)))>\n    Public Class SomethingImplementation\n        Implements ISomething(Of BaseThing2)\n    End Class\n\n    <Export(GetType(ISomething(Of)))>\n    Public Class OtherSomething(Of T)\n        Implements ISomething(Of T)\n    End Class\n\n    ' Noncompliant@+2\n    ' Error@+1 [BC31501]\n    <Export(ContractType:=GetType(IDisposable))>\n    Class Exporting_InvalidSyntax\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ShouldImplementExportedInterfaces_Part1.cs",
    "content": "﻿using System;\nusing System.ComponentModel.Composition;\n\nnamespace Classes\n{\n    [Export(typeof(IDisposable))]\n    partial class Exported\n    {\n    }\n\n    [Export(typeof(IDisposable))] // Noncompliant\n    partial class NotExported\n    {\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ShouldImplementExportedInterfaces_Part2.cs",
    "content": "﻿using System;\nusing System.ComponentModel.Composition;\n\nnamespace Classes\n{\n    partial class Exported : IDisposable\n    {\n        public void Dispose() { }\n    }\n\n    partial class NotExported\n    {\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SimpleDoLoop.vb",
    "content": "﻿Imports System\n\nModule Module1\n    Sub Main()\n        Dim i = 1\n        Dim ctrl = New Object()\n\n        Do                        ' Noncompliant {{Use a structured loop instead.}}\n            If i = 10 Then\n                Exit Do\n            End If\n\n            Console.WriteLine(i)\n\n            i = i + 1\n        Loop\n        Do While i <> 10\n            Console.WriteLine(i)\n\n            i = i + 1\n        Loop\n        Do\n\n        Loop Until ctrl Is Nothing\n    End Sub\nEnd Module\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SingleStatementPerLine.CSharp9.cs",
    "content": "﻿bool condition = false;\n\nif (condition) Method(); // Noncompliant\nelse\n{\n    Method();\n}\n\nint a, b = 10;\nvar i = 5; i = 6; i = 7; //Noncompliant\n\nvoid Method() { }\n\nrecord Record\n{\n    public Record()\n    {\n        int a, b = 10;\n        var i = 5; i = 6; i = 7; //Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SingleStatementPerLine.cs",
    "content": "﻿using System;\nnamespace Tests.Diagnostics\n{\n    class SingleStatementPerLine\n    {\n        public SingleStatementPerLine(bool someCondition)\n        {\n            if (someCondition) doSomething(); //Noncompliant\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            if (someCondition) { doSomething(); } //Noncompliant\n            else\n            {\n                doSomething();\n            }\n\n            var i = 5;\n            i = 6; i = 7; //Noncompliant {{Reformat the code to have only one statement per line.}}\n\n            if (someCollection.Any(x=>true)) // Error [CS0103] - unknown element\n            {\n\n            }\n\n            var _sent = 12;\n            var _repeat = 12;\n            var _received = 12;\n            var message = \"\";\n\n            var _actor = new Something();\n            var _latch = new Something();\n            var Self = new Something();\n\n            if (_sent < _repeat)\n            {\n                _actor.Tell(message);\n                _sent++;\n            }\n            else if (_received >= _repeat)\n            {\n                Console.WriteLine(\"done {0}\", Self.Path);\n                _latch.SetResult(true);\n            }\n\n            Func<NancyContext, Response> item1 = r => { return null; }; //Compliant\n            item1 = (r) => null; //Compliant\n            Func<NancyContext, Response> item2 = r => { return null; return null; }; // Noncompliant\n            TestDelegate testDelB = delegate (string s) { Console.WriteLine(s); };//Compliant\n            TestDelegate testDelB2 = delegate (string s) { Console.WriteLine(s); Console.WriteLine(s); };//Noncompliant\n\n            Receive<ClusterEvent.ReachableMember>(member => // Error [CS0246,CS0103]\n            {\n                if (member.Member.Status == MemberStatus.Up) AddMember(member.Member); //Noncompliant\n            });\n\n            switch (x) // Error [CS0103] - x doesn't exist\n            {\n            }; // Compliant, because blocks are ignored\n\n            if (false) {\n                ; } // Compliant, because blocks are ignored\n\n            ; ; // Noncompliant\n        }\n\n        void doSomething() { }\n    }\n\n    class Something\n    {\n        public void Tell(string m) { }\n        public void SetResult(bool b) { }\n\n        public string Path { get; }\n    }\n\n    class NancyContext { }\n    class Response { }\n    public delegate void TestDelegate(string s);\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SingleStatementPerLine.vb",
    "content": "﻿Namespace Tests.Diagnostics\n    Class SingleStatementPerLine\n        Sub Main()\n            Dim a = 0 : Dim b = 0  ' Noncompliant {{Reformat the code to have only one statement per line.}}\n'           ^^^^^^^^^^^^^^^^^^^^^\n\n            Dim message As String = \"Error in {0}.{1}.{2} : {3} Authorization error : {4}   text\" : Dim number As Integer = 8\n            ' Do not report on the previous line as it contains the VBC error pattern\n        End Sub\n        Sub New(someCondition As Boolean)\n            If someCondition Then : doSomething() ' Noncompliant\n            End If\n            If someCondition Then : doSomething() ' Noncompliant\n            Else\n                doSomething()\n            End If\n\n            Dim i As Integer = 5\n            i = 6 : i = 7 ' Noncompliant\n\n            Dim increment1 = Function(x) x + 1 'Compliant\n            Dim increment2 = Function(x)\n                                 Return x + 2 'Compliant\n                             End Function\n\n            Dim increment3 = Function(x)\n                                 Return x + 2 : Return x + 2 'Noncompliant\n                             End Function\n\n        End Sub\n\n        Sub doSomething()\n        End Sub\n\n        Sub Test()\n            Dim test As TestEnum = TestEnum.Value1\n            Select Case test\n                Case TestEnum.Value1\n                    test = TestEnum.Value1 : test = TestEnum.Value2 ' Noncompliant\n                Case TestEnum.Value2\n                    ' action2\n                Case Else\n                    ' else\n            End Select\n        End Sub\n\n        Public Enum TestEnum\n            Value1\n            Value2\n        End Enum\n    End Class\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SingleStatementPerLine2.vb",
    "content": "﻿Namespace AppendedNamespaceForConcurrencyTest.Tests.Diagnostics\n    Class SingleStatementPerLine\n        Sub Main()\n            Dim a = 0 : Dim b = 0  ' Noncompliant {{Reformat the code to have only one statement per line.}}\n'           ^^^^^^^^^^^^^^^^^^^^^\n\n            Dim message As String = \"Error in {0}.{1}.{2} : {3} Authorization error : {4}   text\" : Dim number As Integer = 8\n            ' Do not report on the previous line as it contains the VBC error pattern\n        End Sub\n        Sub New(someCondition As Boolean)\n            If someCondition Then : doSomething() ' Noncompliant\n            End If\n            If someCondition Then : doSomething() ' Noncompliant\n            Else\n                doSomething()\n            End If\n\n            Dim i As Integer = 5\n            i = 6 : i = 7 ' Noncompliant\n\n            Dim increment1 = Function(x) x + 1 'Compliant\n            Dim increment2 = Function(x)\n                                 Return x + 2 'Compliant\n                             End Function\n\n            Dim increment3 = Function(x)\n                                 Return x + 2 : Return x + 2 'Noncompliant\n                             End Function\n\n        End Sub\n\n        Sub doSomething()\n        End Sub\n\n        Sub Test()\n            Dim test As TestEnum = TestEnum.Value1\n            Select Case test\n                Case TestEnum.Value1\n                    test = TestEnum.Value1 : test = TestEnum.Value2 ' Noncompliant\n                Case TestEnum.Value2\n                    ' action2\n                Case Else\n                    ' else\n            End Select\n        End Sub\n\n        Public Enum TestEnum\n            Value1\n            Value2\n        End Enum\n    End Class\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SpecifyIFormatProviderOrCultureInfo.Latest.cs",
    "content": "﻿using System;\nusing System.Globalization;\nusing System.Resources;\nusing System.Net;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        void TestCases()\n        {\n            int result;\n            int.TryParse(\"123\", out result); // Compliant - Controversial: see examples below\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/8233\n    class Repro_8233\n    {\n        public void IgnoreCulture()\n        {\n            // Need more example of type implementating IParseable that ignore culture\n            _ = Guid.Parse(\"\");                 // Compliant\n            _ = Guid.TryParse(\"\", out _);       // Compliant\n\n            // Controversial: There are edge cases like culture \"fa-AF\" where the 0x2212 (MINUS SIGN) is used instead of the usual 0x002D (HYPHEN-MINUS)\n            _ = short.Parse(\"-1\");              // Compliant\n            _ = short.TryParse(\"-1\", out _);    // Compliant\n            _ = int.Parse(\"-1\");                // Compliant\n            _ = int.TryParse(\"-1\", out _);      // Compliant\n            _ = long.Parse(\"-1\");               // Compliant\n            _ = long.TryParse(\"-1\", out _);     // Compliant\n            _ = Int128.Parse(\"-1\");             // Compliant\n            _ = Int128.TryParse(\"-1\", out _);   // Compliant\n\n            // Floating point numbers should not be ignored as they are more culture-sensitive\n            // e.g.: en-US -> 1,000.5 | de-DE -> 1.000,5\n            _ = float.Parse(\"-1\");              // Noncompliant\n            _ = float.TryParse(\"-1\", out _);    // Noncompliant\n            _ = double.Parse(\"-1\");             // Noncompliant\n            _ = double.TryParse(\"-1\", out _);   // Noncompliant\n\n            // The following only have non-public overloads that take an IFormatProvider or CultureInfo\n            // Where the overload does not use the IFormatProvider or CultureInfo\n            _ = Boolean.Parse(\"\");              // Compliant\n            _ = Boolean.TryParse(\"\", out _);    // Compliant\n            _ = char.Parse(\"\");                 // Compliant\n            _ = char.TryParse(\"\", out _);       // Compliant\n            _ = IPAddress.Parse(\"\");            // Compliant\n            _ = IPAddress.TryParse(\"\", out _);  // Compliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SpecifyIFormatProviderOrCultureInfo.cs",
    "content": "﻿using System;\nusing System.Globalization;\nusing System.Resources;\n\nnamespace Tests.Diagnostics\n{\n    static class Methods\n    {\n        public static int DoStuff(string foo) => 1;\n\n        [Obsolete]\n        public static int DoStuff(string foo, IFormatProvider format) => 1;\n\n\n        public static int DoStuff2(string foo) => 1;\n\n        [Obsolete]\n        public static int DoStuff2(string foo, IFormatProvider format) => 1;\n        public static int DoStuff2(string foo, CultureInfo foo2) => 1;\n\n        public static int DoStuff3(string foo) => 1;\n        public static int DoStuff3(int foo, IFormatProvider format) => 1;\n\n        public static int DoStuff4(string foo, string bar, string quix) => 1;\n        public static int DoStuff4(string foo, string bar, int quix, IFormatProvider format) => 1;\n\n        public static int DoStuff5(string foo, string bar, string quix) => 1;\n        public static int DoStuff5(string foo, string bar, string quix, IFormatProvider format) => 1;\n\n        public static int DoStuff6(string foo, string bar, string quix) => 1;\n        public static int DoStuff6(string foo, CultureInfo cultureInfo, string bar, string quix) => 1;\n\n        public static int DoStuff7(string foo, string bar, string quix) => 1;\n        public static int DoStuff7(CultureInfo cultureInfo, string foo, string bar, string quix) => 1;\n\n        public static int DoStuff8(string foo, string bar, string quix) => 1;\n        public static int DoStuff8(CultureInfo cultureInfo, string foo, IFormatProvider formatProvider, string bar, string quix) => 1;\n\n        public static int DoStuff9(string foo, string bar, string quix) => 1;\n        public static int DoStuff9(CultureInfo cultureInfo, IFormatProvider formatProvider, string bar, string quix) => 1;\n\n        public static bool DoStuff10(string foo, bool @default = false) => true;\n        public static bool DoStuff10(string foo) => true;\n\n        public static bool DoStuff11(string foo, params string[] args) => true;\n        public static bool DoStuff11(string foo, int bar, params string[] args) => true;\n\n        public static bool DoStuff12(string foo, IFormatProvider provider, int x, params string[] args) => true;\n        public static bool DoStuff12(string foo, params string[] args) => true;\n\n        // the following test mimicks the behavior of System.String.Format(), which in some .NET distributions has an override with\n        // an IFormatProvider parameter only for the method with 'params' argument\n        public static string MyFormat(IFormatProvider provider, String format, params object[] args) => \"\";\n        public static string MyFormat(String format, params object[] args) => \"\";\n        public static string MyFormat(String format, object arg0) => \"\";\n        public static string MyFormat(String format, object arg0, object arg1) => \"\";\n\n        public static string MyFormat2(IFormatProvider provider, string format, bool boolCheck, params string[] args) => \"\";\n        public static string MyFormat2(string format, bool boolCheck, string arg0) => \"\";\n        public static string MyFormat2(string format, string arg0) => \"\";\n        public static string MyFormat2(string format, bool boolCheck, Program arg0) => \"\";\n        public static string MyFormat2(string format, Program program, params string[] args) => \"\";\n\n        public static string DoStuff13(CultureInfo cultureInfo, params object[] args) => \"\";\n        public static string DoStuff13(Program program) => \"\";\n\n        public static string DoStuff14(CultureInfo cultureInfo) => \"\";\n        public static string DoStuff14(Program program) => \"\";\n    }\n\n    class Program\n    {\n        enum Colors { Red, Green, Blue, Yellow = 12 };\n\n        void InvalidCases()\n        {\n            42.ToString(); // Noncompliant {{Use the overload that takes a 'CultureInfo' or 'IFormatProvider' parameter.}}\n//          ^^^^^^^^^^^^^\n            Methods.DoStuff2(\"foo\"); // Noncompliant\n\n            \"\".StartsWith(\"\"); // FN, overload with CultureInfo has 3 parameters and is difficult to tell if is the proper overload\n\n            Convert.ToInt32(\"123\"); // Noncompliant\n            object number = 1.23;\n            Convert.ToInt32(number); // Noncompliant, there is ToInt32(object, IFormatProvider)\n\n            char.ToUpper('a'); // Noncompliant\n            char.ToLower('a'); // Noncompliant\n\n            \"asdasd\".ToUpper(); // Noncompliant\n\n            string.Format(\"%s %s\", \"foo\"); // Noncompliant\n            string.Format(\"%s %s\", \"foo\", \"bar\"); // Noncompliant\n            string.Format(\"%s %s\", \"foo\", \"bar\", \"quix\"); // Noncompliant\n            string.Format(\"{0}\", \"foo\"); // Noncompliant\n            string.Format(\"{0}\", new MyObject()); // Noncompliant\n            string.Format(\"TimeClient {0}\", 1); // Noncompliant\n\n            Methods.DoStuff5(\"foo\", \"bar\", \"qix\"); // Noncompliant\n            Methods.DoStuff6(\"foo\", \"bar\", \"qix\"); // Noncompliant\n            Methods.DoStuff7(\"foo\", \"bar\", \"qix\"); // Noncompliant\n\n            Methods.MyFormat(\"%s\", \"foo\"); // Noncompliant\n            Methods.MyFormat(\"%s\", \"foo\", \"bar\"); // Noncompliant\n            Methods.MyFormat(\"%s\", \"foo\", \"bar\", \"qix\"); // Noncompliant\n\n            Methods.MyFormat2(\"%s\", true, \"x\"); // Noncompliant\n\n            Methods.DoStuff13(this); // Noncompliant\n        }\n\n        void ValidCases(MyFormat myFormat)\n        {\n            42.ToString(CultureInfo.CurrentCulture);\n            string.Format(CultureInfo.CurrentUICulture, \"{0}\", 42);\n\n            Activator.CreateInstance(); // Compliant - excluded // Error [CS0411] - cannot infer type\n\n            var resourceManager = new ResourceManager(typeof(Program));\n            resourceManager.GetObject(\"a\"); // Compliant - excluded\n            resourceManager.GetString(\"a\"); // Compliant - excluded\n\n            \"\".StartsWith(\"\", StringComparison.CurrentCulture); // Compliant - StringComparison implies culture\n            \"\".StartsWith(\"\", true, CultureInfo.CurrentCulture); // Compliant\n\n            Console.WriteLine(\"Colors.Red = {0}\", Colors.Red.ToString(\"d\"));\n            Colors myColor = Colors.Yellow;\n            Console.WriteLine(\"Colors.Red = {0}\", myColor.ToString(\"d\"));\n            Methods.DoStuff(\"foo\");\n\n            Convert.ToInt32(1.23);\n            Convert.ToInt32('1');\n            Convert.ToChar(15);\n\n            Methods.DoStuff3(\"foo\"); // Compliant - the other DoStuff3 does not have the same signature\n\n            Methods.DoStuff4(\"foo\", \"\", \"\"); // Compliant - the other DoStuff4 does not have the same signature\n\n            Methods.DoStuff5(\"foo\", \"bar\", \"qix\", myFormat);\n            Methods.DoStuff6(\"foo\", CultureInfo.CurrentCulture, \"bar\", \"qix\");\n            Methods.DoStuff7(CultureInfo.DefaultThreadCurrentCulture, \"foo\", \"bar\", \"qix\");\n\n            Methods.DoStuff8(\"foo\", \"bar\", \"qix\"); // Compliant, alternative has too many params\n            Methods.DoStuff9(\"foo\", \"bar\", \"qix\"); // Compliant, alternative is not overload\n\n            Methods.DoStuff10(\"foo\"); // Compliant\n            Methods.DoStuff11(\"foo\"); // Compliant\n            Methods.DoStuff12(\"foo\"); // Compliant\n\n            Methods.MyFormat(myFormat, \"%s\", \"foo\"); // Compliant\n            Methods.MyFormat(myFormat, \"%s\", \"foo\", \"bar\"); // Compliant\n            Methods.MyFormat(myFormat, \"%s\", \"foo\", \"bar\", \"qix\"); // Compliant\n\n            Methods.MyFormat2(myFormat, \"%s\", true, \"x\"); // Compliant\n            Methods.MyFormat2(\"%s\", \"bar\"); // Compliant, there's no overload for it\n            Methods.MyFormat2(\"%s\", true, this); // Compliant, no overload\n            Methods.MyFormat2(\"%s\", this, \"foo\", \"bar\", \"qix\"); // Compliant, no overload\n\n            Methods.DoStuff13(CultureInfo.CurrentCulture, this);\n\n            Methods.DoStuff14(this); // Compliant, no alternative\n        }\n\n        class MyFormat : IFormatProvider\n        {\n            public object GetFormat(Type formatType) => null;\n        }\n\n        class MyObject { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SpecifyStringComparison.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Globalization;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        public void MyMethod(string value) { }\n        public void MyMethod(string value, StringComparison comparisonType) { }\n\n        public void MyMethod1(string value1, string value2) { }\n        public void MyMethod1(string value1) { }\n        public void MyMethod1(string value1, StringComparison comparisonType) { }\n\n        public void MyMethod2(string value) { }\n\n        [Obsolete]\n        public void MyMethod2(string value, StringComparison comparisonType) { }\n\n        public void MyMethod3(StringComparison comparisonType, string format, params string[] args) { }\n        public void MyMethod3(string format, params string[] args) { }\n\n        public void MyMethod4(string foo, params string[] args) { }\n        public void MyMethod4(string foo, int bar, params string[] args) { }\n\n        public void MyMethod5(StringComparison comparisonType, string format, params object[] args) { }\n        public void MyMethod5(string format, params string[] args) { }\n\n        public static void Contains<T>(T expected, IEnumerable<T> collection) { }\n        public static void Contains<T>(T expected, IEnumerable<T> collection, IEqualityComparer<T> comparer) { }\n        public static void Contains<T>(IEnumerable<T> collection, Predicate<T> filter) { }\n\n        public static void Contains2<T>(T expected, IEnumerable<T> collection) { }\n        public static void Contains2<T>(T expected, IEnumerable<T> collection, StringComparison comparisonType) { }\n        public static void Contains2<T>(IEnumerable<T> collection, Predicate<T> filter) { }\n\n        public static void Contains3<T>(T expected, IEnumerable<T> collection) { }\n        public static void Contains3<T, U>(T expected, IEnumerable<U> collection, StringComparison comparisonType) { }\n\n        void InvalidCalls()\n        {\n            string.Compare(\"a\", \"b\"); // Noncompliant {{Change this call to 'string.Compare' to an overload that accepts a 'StringComparison' as a parameter.}}\n\n            string.Equals(\"a\", \"b\"); // Noncompliant\n\n            MyMethod(\"a\"); // Noncompliant\n\n            MyMethod1(\"a\"); // Noncompliant\n\n            MyMethod3(\"a\"); // Noncompliant\n            MyMethod3(\"a\", \"b\"); // Noncompliant\n            MyMethod3(\"a\", \"b\", \"c\"); // Noncompliant\n\n            MyMethod5(\"a\", \"b\", \"c\"); // Noncompliant\n\n            \"\".StartsWith(\"\"); // Noncompliant\n\n            Contains2(\"\", new[] { \"\" }); // Noncompliant\n            Contains3(\"\", new[] { \"\" }); // FN - too complex to correctly resolve type arguments when they are different between invoked and overloaded methods\n        }\n\n        void ValidCalls()\n        {\n            string.Compare(\"a\", \"b\", StringComparison.OrdinalIgnoreCase);\n            string.Equals(\"a\", \"b\", StringComparison.InvariantCulture);\n            MyMethod(\"a\", StringComparison.CurrentCulture);\n            \"a\".IndexOf('#');\n\n            \"\".StartsWith(\"\", StringComparison.CurrentCulture); // Compliant\n            \"\".StartsWith(\"\", true, CultureInfo.CurrentCulture); // Compliant - CultureInfo implies string formatting\n\n            MyMethod1(\"\", \"\"); // Compliant\n            MyMethod1(\"\", StringComparison.CurrentCulture); // Compliant\n            MyMethod2(\"\"); // Compliant\n\n            MyMethod3(StringComparison.OrdinalIgnoreCase, \"\"); // Compliant\n            MyMethod3(StringComparison.OrdinalIgnoreCase, \"\", \"\"); // Compliant\n\n            MyMethod4(\"\"); // Compliant\n            MyMethod4(\"\", \"\"); // Compliant\n            MyMethod4(\"\", 1); // Compliant\n            MyMethod4(\"\", \"\", \"\"); // Compliant\n            MyMethod4(\"\", 1, \"\"); // Compliant\n\n            MyMethod5(StringComparison.OrdinalIgnoreCase, \"a\", \"b\", \"c\"); // Compliant\n\n            Contains(\"\", new[] { \"\" }); // Compliant\n            Contains(\"\", new[] { \"\" }, StringComparer.OrdinalIgnoreCase); // Compliant\n\n            Contains2(\"\", new[] { \"\" }, StringComparison.OrdinalIgnoreCase); // Compliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SqlKeywordsDelimitedBySpace.CSharp10.FileScopedNamespaceDeclaration.cs",
    "content": "﻿using System;\nusing System.Data.SqlClient;\nusing Linq = System.Linq;\n\nnamespace Tests.Diagnostics;\n\nrecord Record\n{\n    public void VariousSqlKeywords()\n    {\n        var select = \"SELECT e.*, f\" +\n            \"FROM DimEmployee AS e\" + // Noncompliant\n            \"ORDER BY LastName;\"; // Noncompliant\n    }\n}\n\nrecord struct RecordStruct\n{\n    public RecordStruct() { }\n\n    private string field = \"SELECT col,col2\" +\n        \"FROM TABLE\" +  // Noncompliant\n        \"WHERE X = 1;\"; // Noncompliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SqlKeywordsDelimitedBySpace.CSharp10.GlobalUsing.cs",
    "content": "﻿global using System.Data.SqlClient;\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SqlKeywordsDelimitedBySpace.CSharp10.GlobalUsingConsumer.cs",
    "content": "﻿// global using declared in SqlKeywordsDelimitedBySpace.CSharp10.Global.cs\n\nnamespace Tests.Diagnostics\n{\n    class Foo\n    {\n        private string field = \"SELECT *\" + // FN\n            \"FROM TABLE\" +\n            \"WHERE X = 1;\";\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SqlKeywordsDelimitedBySpace.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Data.SqlClient;\nusing Linq = System.Linq;\n\nnamespace CSharp10\n{\n    class Examples\n    {\n        public void VariousSqlKeywords(string unknownValue)\n        {\n            const string s1 = \"TRUNCATE\";\n            const string s2 = \"TABLE HumanResources.JobCandidate;\";\n            const string noncompliant1 = $\"{s1}{s2}\"; // Noncompliant {{Add a space before 'TABLE'.}}\n//                                             ^^^^\n\n            const string noncompliant2 = $\"{s1}TABLE HumanResources.JobCandidate;\"; // Noncompliant\n//                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n            const string noncompliant3 = $\"TRUNCATE{s2}\"; // Noncompliant\n//                                                 ^^^^\n\n            const string s3 = \"SELECT e.*, f\";\n            const string s4 = \"ORDER BY LastName\";\n            const string noncompliant4 = $\"{s3}FROM DimEmployee AS e{s4}\"; // Noncompliant\n//Noncompliant@-1\n\n            const string s5 = \"TRUNCATE \";\n            const string s6 = \"TABLE HumanResources.JobCandidate;\";\n            const string compliant1 = $\"{s5}{s6}\";\n\n            const string s7 = \"TRUNCATE\";\n            const string s8 = \" TABLE HumanResources.JobCandidate;\";\n            const string compliant2 = $\"{s7}{s8}\";\n\n            const string compliant3 = $\"{s1} {s2}\";\n            string compliant4 = $\"{s1}{42}\";\n\n            string compliant5 = $\"{s1}{unknownValue}{s2}\";\n\n            string a = string.Empty;\n            string b = \"TABLE HumanResources.JobCandidate;\";\n            a = \"TRUNCATE\";\n\n            string noncompliant5 = $\"{a}{b}\"; // Noncompliant\n\n            const string complexCase = $\"{s1}{$\"{s1}{s2}\"}\"; // Noncompliant\n// Noncompliant@-1\n\n            const string complexCase2 = $\"{s1}{noncompliant1}\"; // Noncompliant {{Add a space before 'TRUNCATETABLE'.}}\n\n            int x = 42;\n\n            (x, var y) = (x, \"TRUNCATE\" + \"TABLE HumanResources.JobCandidate;\"); // Noncompliant\n\n            var compliant6 = \"UPDATE [some_table] SET [some_column] = @\" + $\"{nameof(complexCase2)}\";\n            var compliant7 = \"UPDATE [some_table] SET [some_column] = \" + $\"@{nameof(complexCase2)}\";\n            var compliant8 = \"UPDATE [some_table] SET [some_column] = @\" + \"VarName\";\n            var compliant9 = \"UPDATE [some_table] SET [some_column] = \" + \"@VarName\";\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/6126\n    public class Repro_6249\n    {\n        string SomeColumn { get; set; }\n\n        public void Method()\n        {\n            const string sql = \"UPDATE [some_table]\" +\n                $\"SET [some_column] = @{nameof(SomeColumn)},\" + // Noncompliant\n                $\" [other_column] = @{nameof(SomeColumn)}\";\n        }\n    }\n\n    public class Interpolation\n    {\n        public const string select = \"select\";                  // Compliant\n        public const string truncate = $\"{nameof(truncate)}\";   // Compliant\n        public const string @from = \"from\";                     // Compliant\n\n        public const string s1 = $\"{select}\";                   // Compliant\n        public const string s2 = $\"{select}Name\";               // Noncompliant\n        public const string s3 = $\"select Name {\"from\"}\";       // Compliant\n        public const string s4 = $\"select Name {\"from\"}\";       // Compliant\n        public const string s5 = $\"{select} col1{@from}\";       // Noncompliant {{Add a space before 'from'.}}\n        //                                      ^^^^^^^\n        public const string s6 = $\"{select} col1{{{@from}}}\";\n        //                                               ^^ {{Add a space before '}}'.}}\n        //                                        ^^^^^^^@-1 {{Add a space before 'from'.}}\n        public const string s7 = $\"{select} col1{{{@from}}}\";\n        //                                        ^^^^^^^ {{Add a space before 'from'.}}\n        //                                               ^^@-1 {{Add a space before '}}'.}}\n\n        public const string s8 = truncate + $\"col1{@from}\"; // here we have an FN on col1 + @from, because of the mixed binary/interpolation scenario\n        //                                  ^^^^^^^^^^^^^^ {{Add a space before 'col1{@from}'.}}\n\n        public const string s9 = truncate + $\"table\";           // Noncompliant\n        //                                  ^^^^^^^^\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/6355\n    public class Repro_6355\n    {\n        void Example(string parameter)\n        {\n            const string constOne = \"One\";\n            string nonConstOne = \"One\";\n            string empty = string.Empty;\n\n            const string s0 = $\"{constOne}\";                // Compliant\n            const string s1 = $\"{constOne}Two\";             // Compliant\n            const string s2 = $\"{nameof(constOne)}Two\";     // Compliant\n            const string s3 = $\"{parameter}\";               // Error [CS0133]\n            const string s4 = $\"{parameter}Two\";            // Error [CS0133]\n            const string s5 = $\"{nameof(parameter)}Two\";    // Compliant\n            const string s6 = $\"{nonConstOne}\";             // Error [CS0133]\n            const string s7 = $\"{nonConstOne}Two\";          // Error [CS0133]\n            const string s8 = $\"{nameof(nonConstOne)}Two\";  // Compliant\n            const string s9 = $\"{empty}\";                   // Error [CS0133]\n            const string s10 = $\"{empty}Two\";               // Error [CS0133]\n            const string s11 = $\"{nameof(empty)}Two\";       // Compliant\n\n            string s12 = $\"{constOne}\";                     // Compliant\n            string s13 = $\"{constOne}Two\";                  // Compliant\n            string s14 = $\"{nameof(constOne)}Two\";          // Compliant\n            string s15 = $\"{parameter}\";                    // Compliant\n            string s16 = $\"{parameter}Two\";                 // Compliant\n            string s17 = $\"{nameof(parameter)}Two\";         // Compliant\n            string s18 = $\"{nonConstOne}\";                  // Compliant\n            string s19 = $\"{nonConstOne}Two\";               // Compliant\n            string s20 = $\"{nameof(nonConstOne)}Two\";       // Compliant\n            string s21 = $\"{empty}\";                        // Compliant\n            string s22 = $\"{empty}Two\";                     // Compliant\n            string s23 = $\"{nameof(empty)}Two\";             // Compliant\n\n            string s24 = $\"{{{nonConstOne}}}\";              // Compliant\n        }\n    }\n\n    // https://sonarsource.atlassian.net/browse/NET-1322\n    public class Repro_NET1322\n    {\n        const string tableName = \"MyTableName\";\n        const string strQuery = $\"SELECT * FROM [{tableName}] \"; // Noncompliant {{Add a space before 'MyTableName'.}} FP\n                                                                 // Noncompliant@-1 {{Add a space before ']'.}} FP\n    }\n}\n\nnamespace CSharp11\n{\n    class Examples\n    {\n        void RawStringLiterals(string unknownValue)\n        {\n            const string s1 = \"\"\"TRUNCATE\"\"\"; // Compliant\n            const string s2 = \"\"\"TABLE HumanResources.JobCandidate;\"\"\"; // Compliant\n\n            const string noncompliant1 = $\"\"\"{s1}{s2}\"\"\"; // Noncompliant {{Add a space before 'TABLE'.}}\n//                                               ^^^^\n            const string noncompliant2 = $\"\"\"{s1}TABLE HumanResources.JobCandidate;\"\"\"; // Noncompliant\n//                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            const string complexCase = $\"\"\"\"{s1}{$\"\"\"{s1}{s2}\"\"\"} \"\"\"\"; // Noncompliant\n                                                                        // Noncompliant@-1\n        }\n\n        void NewlinesInStringInterpolation()\n        {\n            const string s1 = \"truncate\";\n            const string s2 = \"\";\n            string noncompliant = $\"{s1 +\n                s2}TABLE HumanResources.JobCandidate;\"; // Noncompliant\n            string noncompliantRawString = $$\"\"\"{{s1 +\n                s2}}TABLE HumanResources.JobCandidate;\"\"\"; // Noncompliant\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/9177\n    public class Repro_9177\n    {\n        record ArtifactDto(string Id, string TagIdentifier);\n\n        string sqlQuery1 = $@\"\n\t        SELECT\n\t\t        [Artifact].[Id] AS [{nameof(ArtifactDto.Id)}],\n\t\t        [Artifact].[TagIdentifier] AS [{nameof(ArtifactDto.TagIdentifier)}]\n\t        FROM\n\t\t        [Artifacts] AS [Artifact]\"; // Noncompliant@-3 [Id, bracket_Id] FPs\n                                            // Noncompliant@-3 [TagIdentifier, bracket_TagIdentifier] FPs\n\n        string sqlQuery2 = $\"\"\"\n            SELECT\n                [Artifact].[Id] AS [{nameof(ArtifactDto.Id)}],\n                [Artifact].[TagIdentifier] AS [{nameof(ArtifactDto.TagIdentifier)}]\n            FROM\n                [Artifacts] AS [Artifact]\n            \"\"\"; // Noncompliant@-4 [Id2, bracket_Id2] FPs\n                 // Noncompliant@-4 [TagIdentifier2, bracket_TagIdentifier2] FPs\n    }\n}\n\n\nnamespace CSharp12\n{\n    class PrimaryConstructors\n    {\n        class C1(string sql = \"SELECT x\" + \"FROM y\");          // Noncompliant\n        struct S1(string sql = \"SELECT x\" + \"FROM y\");         // Noncompliant\n        record R1(string sql = \"SELECT x\" + \"FROM y\");         // Noncompliant\n        record struct RS1(string sql = \"SELECT x\" + \"FROM y\"); // Noncompliant\n    }\n\n    class DefaultLambdaParameters\n    {\n        void Test()\n        {\n            var f1 = (string s = \"SELECT x\" + \"FROM y\") => s;                   // Noncompliant\n            var f2 = (string s1 = \"SELECT x\", string s2 = \"FROM y\") => s1 + s2; // Compliant, different strings\n        }\n    }\n\n    class CollectionExpressions\n    {\n        void MonoDimensional()\n        {\n            IList<string> a;\n            a = [\"SELECT x\" + \"FROM y\"];            // Noncompliant\n            a = [\"SELECT x\" + \"\"\"FROM y\"\"\"];        // Noncompliant\n            a = [\"SELECT x\", \"FROM y\"];             // Compliant, different strings\n            a = [$\"SELECT x{\"FROM y\"}\"];            // Noncompliant\n            a = [$$$\"\"\"\"SELECT x{{\"FROM y\"}}\"\"\"\"];  // Compliant\n            a = [$$\"\"\"\"SELECT x{{\"FROM y\"}}\"\"\"\"];   // Noncompliant\n        }\n\n        void MultiDimensional()\n        {\n            IList<IList<string>> a;\n            a = [\n                    [\"SELECT x\" + \"FROM y\",  // Noncompliant\n                \"SELECT x\"],\n                [\"FROM y\",\n                \"SELECT x\" + \"FROM y\"]   // Noncompliant\n                ];\n        }\n    }\n}\n\nnamespace CSharp13\n{\n    public class MyClass\n    {\n        // https://sonarsource.atlassian.net/browse/NET-444\n        void NewEscapeSequence()\n        {\n            const string keyword1 = \"SELECT\";\n            const string keyword2 = \"FROM\";\n            const char escape = '\\e';\n\n            _ = \"\\e\";\n            _ = \"\\' \\\" \\\\ \\0 \\a \\b \\e \\f \\n \\r \\t \\v\";\n            _ = '\\e';\n            _ = $\"\\e{\"\\e\"}\";\n            _ = $\"{'\\e'}\";\n            _ = $@\"{'\\e'}\";\n            _ = $\"\"\"{'\\e'}\"\"\";\n            _ = $\"\"\"\n            {'\\e'}\n            \"\"\";\n            _ = \"SELECT x\\eFROM y\";            // Compliant: works as expected in SQL server\n            _ = \"SELECT x\" + '\\e' + \"FROM y\";  // Compliant: works as expected in SQL server\n            _ = \"SELECT x\" + \"FROM y\" + '\\e';  // Compliant: works as expected in SQL server\n            _ = keyword1 + escape + keyword2 + \" table_name\";\n\n            _ = \" SELECT\" + \"FROM y\";          // Noncompliant\n            _ = '\\e' + \" SELECT\" + \"FROM y\";   // FN\n            _ = '\\e' + \" SELECT x\" + \"FROM y\"; // FN\n            _ = \"\\e\" + \" SELECT x\" + \"FROM y\"; // FN\n            _ = \"SELECT\" + \"FROM y\" + '\\e';    // FN\n            _ = \"SELECT x\" + \"FROM y\" + '\\e';  // FN\n            _ = \"SELECT x\" + \"FROM y\" + \"\\e\";  // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SqlKeywordsDelimitedBySpace.cs",
    "content": "﻿using System;\nusing System.Data.SqlClient;\nusing Linq = System.Linq;\n\nnamespace Tests.Diagnostics\n{\n    // we don't look for objects from the SqlClient namespace, we just look at the usings\n\n    class NonCompliantExamples\n    {\n        public void VariousSqlKeywords()\n        {\n            var alterTable = \"ALTER TABLE InsurancePolicy\" +\n                \"ADD PERIOD FOR SYSTEM_TIME(SysStartTime, SysEndTime),\" + // Noncompliant\n                \"SysStartTime datetime2 GENERATED ALWAYS AS ROW START HIDDEN NOT NULL\" + // ok, we ignore comma\n                \"    DEFAULT SYSUTCDATETIME(),\" +\n                \"SysEndTime datetime2 GENERATED ALWAYS AS ROW END HIDDEN NOT NULL\" +\n                \"    DEFAULT CONVERT(DATETIME2, '9999-12-31 23:59:59.99999999');\";\n            var bulkInsert = \"BULK INSERT AdventureWorks2012.Sales.SalesOrderDetail\" +\n               \"FROM 'neworders.txt';\"; // Noncompliant {{Add a space before 'FROM'.}}\n//             ^^^^^^^^^^^^^^^^^^^^^^^\n            var create = \"CREATE TABLE #t (x\" + \"INT PRIMARY KEY);\"; // Noncompliant\n            var select = \"SELECT e.*, f\" +\n                \"FROM DimEmployee AS e\" + // Noncompliant\n                \"ORDER BY LastName;\"; // Noncompliant\n            var delete = \"DELETE TOP 10 PERCENT\" + \"FROM target_table;\"; // Noncompliant\n            var drop = \"DROP TABLE\" + \"AdventureWorks2012.dbo.SalesPerson2 ;\"; // Noncompliant\n            var exec = \"EXEC ProcWithParameters\" + \"@name = N'%arm%', @color = N'Black';\"; // Noncompliant\n            var execute = \"EXECUTE ProcWithParameters\" + \"@name = N'%arm%', @color = N'Black';\"; // Noncompliant\n            var update = \"UPDATE dbo.Table2\" +\n                \"SET dbo.Table2.ColB = dbo.Table2.ColB + dbo.Table1.ColB\" + // Noncompliant\n                \"FROM dbo.Table2\"; // Noncompliant\n            var grant = \"GRANT EXECUTE ON TestProc\" + \"TO TesterRole WITH GRANT OPTION;\"; // Noncompliant\n            var insert = \"INSERT INTO CUSTOMERS (ID,NAME,AGE,ADDRESS,SALARY)\" + // FN - we only consider alphanumeric characters\n                \"VALUES(1, 'Ramesh', 32, 'Ahmedabad', 2000.00);\";\n            var updateText = \"UPDATETEXT @TableName.@ColumnName\" +\n                \"@ptrval @insert_offset\"; // Noncompliant\n            var merge = \"MERGE livesIn\" +\n                \"USING((SELECT @PersonId, @CityId, @StreetAddress) AS T(PersonId, CityId, StreetAddress)\" + // Noncompliant\n                \"    JOIN Person ON T.PersonId = Person.ID\" +\n                \"    JOIN City ON T.CityId = City.ID)\" +\n                \"  ON MATCH(Person-(livesIn)->City)\" +\n                \"WHEN MATCHED THEN\" + // FN - we only consider alphanumeric characters\n                \"  UPDATE SET StreetAddress = @StreetAddress\" +\n                \"WHEN NOT MATCHED THEN\" + // Noncompliant\n                \"  INSERT($from_id, $to_id, StreetAddress)\" +\n                \"  VALUES(Person.$node_id, City.$node_id, @StreetAddress);\";\n            var writeText = \"WRITETEXT pub_info.pr_info\" + \"ptrval 'text'\"; // Noncompliant\n            var writeTextWithAt = \"WRITETEXT pub_info.pr_info\" + \"@ptrval 'text'\"; // Noncompliant\n            var readText = \"READTEXT\" + \"pub_info.pr_info @ptrval 1 25;\"; // Noncompliant\n            var truncate = \"TRUNCATE\" + \"TABLE HumanResources.JobCandidate;\"; // Noncompliant\n\n            var a = \"TRUNCATE\" + \" \" + \"TABLE HumanResources.JobCandidate;\";\n\n            var b1 = \"TRUNCATE\" + @\" \" + \"TABLE HumanResources.JobCandidate;\";\n            var b2 = @\"TRUNCATE\" + @\"TABLE HumanResources.JobCandidate;\"; // Noncompliant\n\n            var c1 = \"TRUNCATE\" + $\" \" + \"TABLE HumanResources.JobCandidate;\";\n            var c2 = $\"TRUNCATE\" + $\"TABLE HumanResources.JobCandidate;\"; // Noncompliant\n\n            var d1 = \"TRUNCATE\" + $@\" \" + \"TABLE HumanResources.JobCandidate;\";\n            var d2 = $@\"TRUNCATE \" + $@\"TABLE HumanResources.JobCandidate;\";\n            var d3 = $@\"TRUNCATE\" + $@\"TABLE HumanResources.JobCandidate;\"; // Noncompliant\n\n            var e1 = \"TRUNCATE\" + @$\" \" + \"TABLE HumanResources.JobCandidate;\";\n            var e2 = @$\"TRUNCATE\" + @$\" TABLE HumanResources.JobCandidate;\";\n            var e3 = @$\"TRUNCATE\" + @$\"TABLE HumanResources.JobCandidate;\"; // Noncompliant\n\n            var f1 = \"UPDATE [some_table]\" + \"SET [some_column] = '42'\"; // Noncompliant\n        }\n\n        public string Property\n        {\n            get\n            {\n                return \"SELECT something\" + \"FROM table\"; // Noncompliant\n            }\n            set\n            {\n                value = \"SELECT x\" + \"FROM table\"; // Noncompliant\n            }\n        }\n\n        private string field = \"SELECT col,col2\" +\n            \"FROM TABLE\" +  // Noncompliant\n            \"WHERE X = 1;\"; // Noncompliant\n\n        private string caseInsensitive = \"select col3\" +\n            \"from t\" +  // Noncompliant\n            \"where X = 1;\"; // Noncompliant\n\n        private string onlyFirstKeyword = \"select something\" +\n            \"because I want to\";  // Noncompliant FP\n\n        private string insideParens =\n            (\"SELECT x\" + \"FROM y\") + // Noncompliant\n            \"JOIN\" +\n            (\"SELECT table\" + \"WHERE x=1\"); // Noncompliant\n    }\n\n    class CompliantExamples\n    {\n        private string sql_string = \"SELECT * FROM TABLE WHERE X = 1;\";\n        private string sql_string_spaces_before = \"SELECT *\" +\n            \" FROM TABLE\" +\n            \" WHERE X = 1;\";\n        private string sql_string_spaces_after = \"SELECT * \" +\n            \"FROM TABLE \" +\n            \"WHERE X = 1;\";\n        private string not_sql_string = \"I like tomatoes\" + \"and potatoes\";\n        private int not_string = 1 + 2 + 3;\n        private string empty = string.Empty;\n        private string empty2 = \"\" + \"\" + \"  \" + \"\\\\t\" + \" \";\n        private string combined = \"SELECT all\" + 1 + \"FROM table\"; // FN\n        private string combined2 = \"SELECT all\" + \"\" + \"FROM table\" + \"\";\n        private string notAdd = \"SELECT\" + 2 * 3 + \"FROM table\"; // FN\n        private string shortWords = \"a\" + \"b\" + \"c\";\n\n        void ValidCases(string parameter)\n        {\n            var withParamInside = \"SELECT *\" +\n                parameter +\n                \"FROM TABLE\" +\n                parameter +\n                \"WHERE X = 1;\";\n            var withColumnNames = \"SELECT x.col1, x.col2,\" +\n                \"x.col3,x.col4 \" +\n                \"FROM TABLE\" +\n                parameter +\n                \"WHERE X = 1;\";\n            var withVarAtEnd = \"SELECT x \" +\n                \"FROM y \" +\n                \"WHERE z =\" + parameter;\n            var useGoIfDrop = \"USE AdventureWorks2012;\" + // ok\n                \"GO\" + // FP\n                \"IF OBJECT_ID('dbo.Table1', 'U') IS NOT NULL\" + // FN, we don't support this\n                \"DROP TABLE dbo.Table1;\";\n            var semicolon = \"SELECT * FROM table;\" +\n                \"WHERE something = x;\" +\n                \"ORDERBY z\";\n            var comment = \"SELECT * FROM table--\" +\n                \"WHERE something = x--\" +\n                \"ORDERBY z\";\n            var multilineComment = \"SELECT * FROM table/*\" +\n                \"WHERE something = x\" +\n                \"ORDERBY z*/\"; // Noncompliant FP\n            var nonAlphaNumeric = \"SELECT * FROM table+\" +\n                \"WHERE something = x^\" +\n                \"ORDERBY z#\" +\n                \"UNION WITH x\";\n            var comparison = \"SELECT * FROM table WHERE x>\" +\n                \"10 AND y >20;\";\n            var comparison2 = \"SELECT * FROM table WHERE x\" +\n                \"> 10 AND y >20;\";\n            var parantheses = \"SELECT (\" +\n                \"x.y,z.z)\" + // FN - we ignore parantheses as they can lead to FPs\n                \"FROM  table;\";\n            var parantheses2 = \"SELECT \" + (\"all\") + \"FROM table\"; // Noncompliant {{Add a space before 'FROM'.}}\n            //                                       ^^^^^^^^^^^^\n        }\n\n        public void InterpolatedAndRawStringsAreIgnored(string col1, string col2, string innerQuery)\n        {\n            var select1 = $\"SELECT e.{col1},e.{col2}\" +\n                $\"FROM DimEmployee AS e\" + // Noncompliant {{Add a space before 'FROM'.}}\n                $\"ORDER BY LastName;\"; // Noncompliant {{Add a space before 'ORDER'.}}\n            var select2 = $\"SELECT e.{col1},e.{col2}\" +\n                \" FROM DimEmployee AS e\" +\n                \"ORDER BY LastName;\"; // Noncompliant {{Add a space before 'ORDER'.}}\n            var interpolatedQuery1 = $\"SELECT x\" + $\"{innerQuery}\"; // Noncompliant {{Add a space before '{innerQuery}'.}}\n            var interpolatedQuery2 = \"SELECT x\" + $\"{innerQuery}\"; // Noncompliant\n            var interpolatedQuery3 = \"SELECT x\" + $\"{ innerQuery }\"; // Noncompliant\n            var interpolatedQuery4 = \"SELECT x \" + $\"{innerQuery}\";\n            var interpolatedQuery5 = \"SELECT x\" + $\" {innerQuery}\";\n            var alterTable = @\"ALTER TABLE InsurancePolicy\nADD PERIOD FOR SYSTEM_TIME(SysStartTime, SysEndTime),\nSysStartTime datetime2 GENERATED ALWAYS AS ROW START HIDDEN NOT NULL\n    DEFAULT SYSUTCDATETIME(),\nSysEndTime datetime2 GENERATED ALWAYS AS ROW END HIDDEN NOT NULL\n    DEFAULT CONVERT(DATETIME2, '9999-12-31 23:59:59.99999999');\";\n\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SqlKeywordsDelimitedBySpace_DefaultNamespace.cs",
    "content": "﻿using System.Data.SqlClient;\n\nclass Foo\n{\n    private string field = \"SELECT *\" + // FN\n        \"FROM TABLE\" +\n        \"WHERE X = 1;\";\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SqlKeywordsDelimitedBySpace_InsideNamespace.cs",
    "content": "﻿namespace Tests.StaticUsing\n{\n    using static System.Data.SqlClient.SqlBulkCopyColumnMappingCollection;\n\n    class Foo\n    {\n        private string field = \"SELECT *\" + // FN\n            \"FROM TABLE\" +\n            \"WHERE X = 1;\";\n    }\n}\n\nnamespace Tests.NoSqlNamespace\n{\n    class Foo\n    {\n        private string field = \"SELECT *\" + // FN\n            \"FROM TABLE\" +\n            \"WHERE X = 1;\";\n    }\n}\n\nnamespace Test.SqlAlias\n{\n    using SqlAlias = System.Data.SqlClient;\n    class Foo\n    {\n        private string field = \"SELECT a\" +\n            \"FROM TABLE\" + // Noncompliant\n            \" WHERE X = 1;\";\n    }\n}\n\nnamespace Test.NormalUsing\n{\n    using System.Data.SqlClient;\n    class Foo\n    {\n        private string field = \"SELECT a\" +\n            \"FROM TABLE\" + // Noncompliant\n            \" WHERE X = 1;\";\n    }\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StaticFieldInGenericClass.Latest.Partial.cs",
    "content": "﻿using System;\n\npartial class PartialClass<T>\n{\n    static partial event EventHandler PartialEvent;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StaticFieldInGenericClass.Latest.cs",
    "content": "﻿using System.Collections.Generic;\nusing System;\n\nnamespace CSharp9\n{\n    record StaticFieldInGenericRecord<T>\n    where T : class\n    {\n        internal static string field; //Noncompliant {{A static field in a generic type is not shared among instances of different close constructed types.}}\n\n        public static string Prop1 { get; set; } // Noncompliant\n\n        public string Prop2 { get; set; }\n\n        public static T Prop3 { get; set; }\n    }\n\n    record StaticFieldInGenericPositionalRecord<T>(int Property)\n        where T : class\n    {\n        internal static string field; //Noncompliant {{A static field in a generic type is not shared among instances of different close constructed types.}}\n\n        public static string Prop1 { get; set; } // Noncompliant\n\n        public string Prop2 { get; set; }\n\n        public static T Prop3 { get; set; }\n    }\n\n    public interface IStatic<T>\n    {\n        public static string Field;                 // Noncompliant\n        public static string Prop { get; set; }     // Noncompliant\n        public static T Empty;                      // Compliant\n    }\n}\n\nnamespace CSharp10\n{\n    record struct StaticFieldInGenericRecordStruct<T>\n        where T : class\n    {\n        public StaticFieldInGenericRecordStruct() { }\n\n        internal static string field; // Noncompliant\n\n        public static string Prop1 { get; set; } // Noncompliant\n\n        public string Prop2 { get; set; } = \"\";\n\n        public static T Prop3 { get; set; } = null;\n    }\n\n    record struct StaticFieldInGenericPositionalRecordStruct<T>(int Property)\n        where T : class\n    {\n        public StaticFieldInGenericPositionalRecordStruct() : this(1) { }\n\n        internal static string field; // Noncompliant\n\n        public static string Prop1 { get; set; } // Noncompliant\n\n        public string Prop2 { get; set; } = \"\";\n\n        public static T Prop3 { get; set; } = null;\n    }\n}\n\n// https://sonarsource.atlassian.net/browse/NET-425\nnamespace CSharp13\n{\n    public partial class LengthLimitedSingletonCollection<T> where T : new()\n    {\n        public static partial Dictionary<T, object> Instances => [];\n        public static partial Dictionary<Type, object> Instances2 => new Dictionary<Type, object>();\n    }\n\n    public partial class LengthLimitedSingletonCollection<T> where T : new()\n    {\n        public static partial Dictionary<T, object> Instances { get; }     // Compliant\n        public static partial Dictionary<Type, object> Instances2 { get; } // Noncompliant\n    }\n}\n\npartial class PartialClass<T>\n{\n    static partial event EventHandler PartialEvent { add { } remove { } }   // FN NET-2783\n}\n\nclass ExtensionProperties<T> { }\n\nstatic class Extensions\n{\n    extension<T>(ExtensionProperties<T>)\n    {\n        static int Property => 0;   // FN NET-2785\n    }\n}\n\nclass FieldKeyword<T>\n{\n    static int Property { get => field; set => field = value; } // Noncompliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StaticFieldInGenericClass.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Runtime.CompilerServices;\nusing System.Threading.Tasks;\n\nnamespace Tests.TestCases\n{\n    internal class C\n    {\n        private static Dictionary<string, List<int>> Dict;\n    }\n\n    class StaticFieldInGenericClass<T/*comment*/, /*comment*/U>\n        where T : class\n    {\n        private static readonly ConditionalWeakTable<T, Task<T>>.CreateValueCallback s_taskCreationCallback = Task.FromResult<T>;\n\n        private static Dictionary<string, List<T>> Dict, Dict4 = new Dictionary<string, List<T>>();\n        private static Dictionary<string, T[]> Dict2;\n\n        public static string sProp1 { get; set; } // Noncompliant\n//                           ^^^^^^\n        public /*comment */ static string sProp2 { get; set; } // Noncompliant {{A static field in a generic type is not shared among instances of different close constructed types.}}\n\n        public static int ArrowProperty => 42; // Compliant, doesn't have a static backing field\n\n        public string sProp3 { get; set; }\n\n        public static T tProp { get; set; }\n\n        internal static string sField; // Noncompliant\n\n        internal string NestedClassUsage => NestedClass.StringField;\n\n        // https://github.com/SonarSource/sonar-dotnet/issues/4081\n        private static class NestedClass\n        {\n            public static readonly string StringField = \"String\"; // Noncompliant\n        }\n\n        private static Dictionary<string, string> _attributes = new Dictionary<string, string>(); // Noncompliant\n\n        public static List<int> Numbers { get; } = new List<int>(); // Noncompliant\n\n        public static string State => nameof(State); // Compliant\n\n        public static object New => new object(); // Compliant always a new instance\n\n        public static object Y { get { return new object(); } } // Noncompliant - FP, always a new instance\n\n        public static object Z // Noncompliant\n        {\n            get { return new object(); }\n            set { }\n        }\n\n        protected static Dictionary<string, string> Attributes // Noncompliant - FP? It can use only static fields (for which we already raise)\n        {\n            get {\n                if (_attributes == null)\n                    InitColumns();\n                return _attributes;\n            }\n        }\n\n        private static void InitColumns() { }\n\n        static event EventHandler Event;    // FN NET-2783\n    }\n\n    struct StaticFieldInGenericStruct<T, U>\n    where T : class\n    {\n        private static Dictionary<string, T[]> Dict2;\n\n        public static string sProp1 { get; set; } // Noncompliant\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/5238\n    public class Wrapper<T> where T : class\n    {\n        public static T EmptyProp { get; set; }\n        public static readonly T Empty = CreateEmpty();\n        private static T singleton;\n\n        private static T CreateEmpty() => null;\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/7521\nnamespace Repro_7521\n{\n    public class GenericBase<T> { } // Might be out of our control\n    public interface IGeneric<T> { }\n    public interface IBoring { }\n\n    public class GenericDerived<T> : GenericBase<T>, IBoring\n    {\n        private static readonly string[] field = new[] { \"a\", \"b\", \"c\" }; // Compliant, we might not be able to change the base class, or want the field there\n    }\n\n    public class ImplementsInterface : IBoring, IGeneric<int>\n    {\n        private static readonly string[] field = new[] { \"a\", \"b\", \"c\" }; // Compliant\n    }\n\n    public class ImplementsInterfaceGeneric<T> : IBoring, IGeneric<T>\n    {\n        private static readonly string[] field = new[] { \"a\", \"b\", \"c\" }; // Compliant, we might not be able to change the base class, or want the field there\n    }\n\n    public class ImplementsInterfaceGenericIrrelevantForBase<T> : IBoring, IGeneric<int>\n    {\n        private static readonly string[] field = new[] { \"a\", \"b\", \"c\" }; // Noncompliant\n    }\n\n    public class Outer<T>\n    {\n        public class Inner\n        {\n            private static readonly string[] field = new[] { \"a\", \"b\", \"c\" }; // Noncompliant\n        }\n\n        public class InnerGeneric : GenericBase<T>\n        {\n            private static readonly string[] field = new[] { \"a\", \"b\", \"c\" }; // Compliant, we might not be able to change the base class, or want the field there\n        }\n    }\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StaticFieldInitializerOrder.Latest.Partial.cs",
    "content": "﻿namespace CSharp8\n{\n    public partial interface IStaticFieldsOrder\n    {\n        public static int W = 2;\n\n        public const int Const2 = 5;\n    }\n}\n\nnamespace CSharp13\n{\n    public partial class MyClass\n    {\n        public static partial int X => Y; // Compliant\n        public static partial int Y => 42;\n\n        public static int B = X;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StaticFieldInitializerOrder.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace CSharp8\n{\n    public class StaticFieldInitializerOrder\n    {\n        public static int Y = 42;\n    }\n\n    public partial interface IStaticFieldsOrder\n    {\n        public static string s1 = new string('x', Const); // Compliant. Const do not suffer from initialization order fiasco.\n        public static string s2 = new string('x', Const2);\n        public static string s3 = new string('x', Y); // Noncompliant\n\n        public static int[] ArrY1 = new[] { Y }; // Noncompliant\n        public static Action<int> A = (i) => { var x = i + StaticFieldInitializerOrder.Y; }; // Okay??? Might or might not. For now we don't report on it\n        public static int X = Y; // Noncompliant\n        public static int X2 = M(StaticFieldInitializerOrder.Y); // Compliant - FN: Y at this time is still assigned default(int), i.e. 0\n        public static int Y = 42;\n        public static int Z = Y; // Okay\n        public static int V = W; // Noncompliant\n        public static int U = Const; // Compliant\n        public static int[] ArrY2 = new[] { Y }; // Y was already initialized\n        public static int[] ArrC = new[] { Const };\n        public const int Const = 5;\n\n        public static int M(int i) { return i; }\n    }\n\n    public interface IBadExample\n    {\n        public static int X = Y; // Noncompliant {{Move this field's initializer into a static constructor.}}\n        public static int Z = Y; // Noncompliant\n        public static int Y = 42;\n    }\n\n    public interface IGoodExample\n    {\n        public static int X;\n        public static int Y = 42;\n        public static int Z = Y;\n        static IGoodExample()\n        {\n            X = Y;\n        }\n    }\n}\n\nnamespace CSharp9\n{\n    public record StaticFieldsOrderRecord\n    {\n        public static string s1 = new string('x', Const); // Compliant - const\n        public static string s2 = new string('x', Y); // Noncompliant\n\n        public static int[] ArrY1 = new[] { Y }; // Noncompliant\n        public static Action<int> A = (i) => { var x = i + StaticFieldsOrderRecord.Y; }; // Okay??? Might or might not. For now we don't report on it\n        public static int X = Y; // Noncompliant\n        public static int X2 = M(StaticFieldsOrderRecord.Y); // Noncompliant Y at this time is still assigned default(int), i.e. 0\n        public static int Y = 42;\n        public static int Z = Y; // Okay\n        public static int U = Const; // Compliant\n        public static int[] ArrY2 = new[] { Y }; // Y was already initialized\n        public static int[] ArrC = new[] { Const };\n        public const int Const = 5;\n\n        public static int M(int i) { return i; }\n    }\n\n    public record StaticFieldsOrderPositionalRecord(String Parameter)\n    {\n        public static string s1 = new string('x', Const); // Compliant - const\n        public static string s2 = new string('x', Y); // Noncompliant\n\n        public static int[] ArrY1 = new[] { Y }; // Noncompliant\n        public static Action<int> A = (i) => { var x = i + StaticFieldsOrderPositionalRecord.Y; }; // Okay??? Might or might not. For now we don't report on it\n        public static int X = Y; // Noncompliant\n        public static int X2 = M(StaticFieldsOrderPositionalRecord.Y); // Noncompliant Y at this time is still assigned default(int), i.e. 0\n        public static int Y = 42;\n        public static int Z = Y; // Okay\n        public static int U = Const; // Compliant\n        public static int[] ArrY2 = new[] { Y }; // Y was already initialized\n        public static int[] ArrC = new[] { Const };\n        public const int Const = 5;\n\n        public static int M(int i) { return i; }\n    }\n}\n\nnamespace CSharp10\n{\n    public record struct StaticFieldsOrderRecordStruct\n    {\n        public static string s1 = new string('x', Const);   // Compliant - const\n        public static string s2 = new string('x', Y);       // Noncompliant\n\n        public static int[] ArrY1 = new[] { Y };            // Noncompliant\n        public static Action<int> A = (i) => { var x = i + StaticFieldsOrderRecordStruct.Y; }; // Okay??? Might or might not. For now we don't report on it\n        public static int X = Y;                            // Noncompliant\n        public static int X2 = M(StaticFieldsOrderRecordStruct.Y); // Noncompliant Y at this time is still assigned default(int), i.e. 0\n        public static int Y = 42;\n        public static int Z = Y;                    // Y was already initialized\n        public static int U = Const;                // Compliant\n        public static int[] ArrY2 = new[] { Y };    // Y was already initialized\n        public static int[] ArrC = new[] { Const };\n        public const int Const = 5;\n\n        public static int M(int i) { return i; }\n    }\n\n    public record struct StaticFieldsOrderPositionalRecordStruct(String Parameter)\n    {\n        public static string s1 = new string('x', Const);   // Compliant - const\n        public static string s2 = new string('x', Y);       // Noncompliant\n\n        public static int[] ArrY1 = new[] { Y };            // Noncompliant\n        public static Action<int> A = (i) => { var x = i + StaticFieldsOrderPositionalRecordStruct.Y; }; // Okay??? Might or might not. For now we don't report on it\n        public static int X = Y;                            // Noncompliant\n        public static int X2 = M(StaticFieldsOrderPositionalRecordStruct.Y); // Noncompliant Y at this time is still assigned default(int), i.e. 0\n        public static int Y = 42;\n        public static int Z = Y;                    // Y was already initialized\n        public static int U = Const;                // Compliant\n        public static int[] ArrY2 = new[] { Y };    // Y was already initialized\n        public static int[] ArrC = new[] { Const };\n        public const int Const = 5;\n\n        public static int M(int i) { return i; }\n    }\n}\n\nnamespace CSharp13\n{\n    public partial class MyClass\n    {\n        public static partial int X { get; }\n        public static partial int Y { get; }\n\n        public static int C = A; // Noncompliant\n        public static int A = Y;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StaticFieldInitializerOrder.Partial.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Tests.TestCases\n{\n    public partial class StaticFieldInitializerOrder\n    {\n        public static int W = 2;\n\n        public const int Const2 = 5;\n    }\n\n    public partial struct StaticFieldsOrderStruct\n    {\n        public static int W = 2;\n\n        public const int Const2 = 5;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StaticFieldInitializerOrder.cs",
    "content": "﻿using System;\n\nnamespace Tests.TestCases\n{\n    public partial class StaticFieldInitializerOrder\n    {\n        public static string s1 = new string('x', Const); // Compliant. Const do not suffer from initialization order fiasco.\n        public static string s2 = new string('x', Const2);\n        public static string s3 = new string('x', Y); // Noncompliant\n\n        public static Action<int> A = (i) => { var x = i + StaticFieldInitializerOrder.Y; }; // Okay??? Might or might not. For now we don't report on it\n        public static int X = Y; // Noncompliant; Y at this time is still assigned default(int), i.e. 0\n//                          ^^^\n        public static int[] ArrY1 = new[] { Y }; // Noncompliant\n        public static int X2 = M(StaticFieldInitializerOrder.Y); // Noncompliant; Y at this time is still assigned default(int), i.e. 0\n        public static int Y = 42;\n        public static int Z = Y; // Okay\n        public static int V = W; // Noncompliant {{Move this field's initializer into a static constructor.}}\n        public static int U = Const; // Compliant\n        public static int[] ArrY2 = new[] { Y }; // Y was already initialized\n        public static int[] ArrC = new[] { Const };\n        public const int Const = 5;\n\n        public int nonStat = W;\n\n        public static int moreVariables = 1, withInitializers = 2;\n\n        public static int M(int i) { return i; }\n    }\n\n    public partial struct StaticFieldsOrderStruct\n    {\n        public static string s1 = new string('x', Const); // Compliant. Const do not suffer from initialization order fiasco.\n        public static string s2 = new string('x', Const2);\n        public static string s3 = new string('x', Y); // Noncompliant\n\n        public static int[] ArrY1 = new[] { Y }; // Noncompliant\n        public static Action<int> A = (i) => { var x = i + StaticFieldInitializerOrder.Y; }; // Okay??? Might or might not. For now we don't report on it\n        public static int X = Y; // Noncompliant\n        public static int X2 = M(StaticFieldInitializerOrder.Y); // Compliant - FN: Y at this time is still assigned default(int), i.e. 0\n        public static int Y = 42;\n        public static int Z = Y; // Okay\n        public static int V = W; // Noncompliant\n        public static int U = Const; // Compliant\n        public static int[] ArrY2 = new[] { Y }; // Y was already initialized\n        public static int[] ArrC = new[] { Const };\n        public const int Const = 5;\n\n        public static int M(int i) { return i; }\n    }\n\n    public class Derived : Base\n    {\n        public static int b = a; // Compliant: a gets initialized before b.\n    }\n\n    public class Base\n    {\n        public static int a = 1;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StaticFieldVisible.Latest.cs",
    "content": "﻿using System;\n\npublic record StaticFieldVisible\n{\n    public static double Pi = 3.14;  // Noncompliant\n//                       ^^\n    public const double Pi2 = 3.14;\n    public double Pi3 = 3.14;\n    private protected static double Pi4 = 3.14; // Noncompliant\n    protected private static double Pi15 = 3.14; // Noncompliant\n\n    public static Shape Empty = Shape.Empty; // Noncompliant {{Change the visibility of 'Empty' or make it 'const' or 'readonly'.}}\n\n    [ThreadStatic]\n    public static int value; // Compliant, thread static field values are not shared between threads\n}\n\npublic record Shape\n{\n    public static Shape Empty = new EmptyShape(); // Noncompliant {{Change the visibility of 'Empty' or make it 'const' or 'readonly'.}}\n    public static readonly Shape Empty2 = new EmptyShape();\n\n    private record EmptyShape : Shape { }\n}\n\npublic record PositionalShape(int Property)\n{\n    public static PositionalShape Empty = new EmptyShape(42); // Noncompliant {{Change the visibility of 'Empty' or make it 'const' or 'readonly'.}}\n    public static readonly PositionalShape Empty2 = new EmptyShape(42);\n\n    private record EmptyShape(int Property) : PositionalShape(Property) { }\n}\n\npublic struct StaticFieldVisibleStruct\n{\n    public StaticFieldVisibleStruct() { }\n\n    public static double Pi = 3.14;  // Noncompliant\n//                       ^^\n    public const double Pi2 = 3.14;\n    public double Pi3 = 3.14;\n\n    [ThreadStatic]\n    public static int value; // Compliant, thread static field values are not shared between threads\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StaticFieldVisible.cs",
    "content": "﻿using System;\n\nnamespace Tests.TestCases\n{\n    public class StaticFieldVisible\n    {\n        public static double Pi = 3.14;  // Noncompliant\n//                           ^^\n        public static int X = 1, Y, Z = 100;\n//                        ^\n//                               ^@-1\n//                                  ^@-2\n        public const double Pi2 = 3.14;\n        public double Pi3 = 3.14;\n\n        protected static double Pi4 = 3.14;             // Noncompliant\n        internal static double Pi5 = 3.14;              // Noncompliant\n        internal static double Pi6 = 3.14;              // Noncompliant\n        protected internal static double Pi7 = 3.14;    // Noncompliant\n\n        private static double Pi8 = 3.14;\n        private double Pi9 = 3.14;\n        static double Pi10 = 3.14; // Compliant - if no access modifier exists, the field is private\n        double Pi11 = 3.14;\n        public readonly double Pi12 = 3.14;\n\n        public static volatile int VolatileValue = 3; // Compliant - see: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/volatile\n\n        [ThreadStatic]\n        public static int Value; // Compliant, thread static field values are not shared between threads\n\n        [NonSerialized]\n        public static int Value2; // Noncompliant\n\n    }\n\n    public class Shape\n    {\n        public static Shape Empty = new EmptyShape(); // Noncompliant {{Change the visibility of 'Empty' or make it 'const' or 'readonly'.}}\n        public static readonly Shape Empty2 = new EmptyShape();\n\n        private class EmptyShape : Shape\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StaticFieldWrittenFromInstanceConstructor.Latest.Partial.cs",
    "content": "﻿using System;\n\nnamespace CSharp14\n{\n    public partial class Person\n    {\n        public partial Person(DateTime birthday)\n        {\n            expectedFingers = 5;    // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StaticFieldWrittenFromInstanceConstructor.Latest.cs",
    "content": "﻿using System;\n\nnamespace CSharp8\n{\n    public class Person\n    {\n        private static string text; // Secondary\n\n        public Person(DateTime birthday)\n        {\n            text ??= \"empty\"; // Noncompliant\n        }\n    }\n}\n\nnamespace CSharp9\n{\n    public record Person\n    {\n        private static DateTime dateOfBirth;\n//                              ^^^^^^^^^^^ Secondary [0]\n        private static int expectedFingers; // Secondary [1]\n        private static Person instance; // Secondary [2]\n        private static string text; // Secondary [3]\n        private static Person person; // Secondary [4]\n\n        public Person(DateTime birthday)\n        {\n            dateOfBirth = birthday;  // Noncompliant [0] {{Remove this assignment of 'dateOfBirth' or initialize it statically.}}\n//          ^^^^^^^^^^^^^\n            expectedFingers = 10;  // Noncompliant [1] {{Remove this assignment of 'expectedFingers' or initialize it statically.}}\n//          ^^^^^^^^^^^^^^^^^\n            instance = this; // Noncompliant [2]\n            text ??= \"empty\"; // Noncompliant [3]\n            person = new(); // Noncompliant [4]\n        }\n\n        public Person() : this(DateTime.Now)\n        {\n            var tmp = dateOfBirth.ToString(); // Compliant\n        }\n    }\n}\n\nnamespace CSharp10\n{\n    public struct Person\n    {\n        private static DateTime dateOfBirth;\n//                              ^^^^^^^^^^^    Secondary [5]\n        private static int expectedFingers; // Secondary [6]\n        private static Person instance;     // Secondary [7]\n        private static string text;         // Secondary [8]\n        private static Person person;       // Secondary [9]\n        private static string postalCode;   // Secondary [tuple1]\n        private static string city;         // Secondary [tuple2]\n\n        public Person(DateTime birthday)\n        {\n            dateOfBirth = birthday;  // Noncompliant [5] {{Remove this assignment of 'dateOfBirth' or initialize it statically.}}\n//          ^^^^^^^^^^^^^\n            expectedFingers = 10;    // Noncompliant [6] {{Remove this assignment of 'expectedFingers' or initialize it statically.}}\n//          ^^^^^^^^^^^^^^^^^\n            instance = this;         // Noncompliant [7]\n        }\n\n        public Person() : this(DateTime.Now)\n        {\n            var tmp = dateOfBirth.ToString(); // Compliant\n            text ??= \"empty\";                 // Noncompliant [8]\n            person = new();                   // Noncompliant [9]\n            (postalCode, city, var country, _) = (\"10001\", \"New York\", \"USA\", \"Earth\");\n//           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  Noncompliant    [tuple1]\n//                       ^^^^^^^^^^^^^^^^^^^^^^^  Noncompliant@-1 [tuple2]\n        }\n    }\n\n    public record struct RecordStructPerson\n    {\n        private static DateTime dateOfBirth;\n//                              ^^^^^^^^^^^            Secondary [10, 15]\n        private static int expectedFingers;         // Secondary [11]\n        private static RecordStructPerson instance; // Secondary [12]\n        private static string text;                 // Secondary [13]\n        private static RecordStructPerson person;   // Secondary [14]\n\n        public RecordStructPerson(DateTime birthday)\n        {\n            dateOfBirth = birthday; // Noncompliant [10] {{Remove this assignment of 'dateOfBirth' or initialize it statically.}}\n//          ^^^^^^^^^^^^^\n            expectedFingers = 10;   // Noncompliant [11] {{Remove this assignment of 'expectedFingers' or initialize it statically.}}\n//          ^^^^^^^^^^^^^^^^^\n            instance = this;        // Noncompliant [12]\n        }\n\n        public RecordStructPerson() : this(DateTime.Now)\n        {\n            var tmp = dateOfBirth.ToString();            // Compliant\n            text ??= \"empty\";                            // Noncompliant [13]\n            person = new();                              // Noncompliant [14]\n            (dateOfBirth, var y) = (DateTime.Now, \"42\"); // Noncompliant [15]\n        }\n    }\n}\n\nnamespace CSharp11\n{\n    public class Person\n    {\n        private static int expectedFingers; // Secondary\n\n        public Person(DateTime birthday)\n        {\n            expectedFingers >>>= 5; // Noncompliant\n        }\n    }\n}\n\nnamespace CSharp14\n{\n    public partial class Person\n    {\n        private static int expectedFingers; // Secondary\n\n        public partial Person(DateTime birthday);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StaticFieldWrittenFromInstanceConstructor.cs",
    "content": "﻿using System;\n\nnamespace SonarAnalyzer.Test.TestCases\n{\n    public class Person\n    {\n        private static DateTime dateOfBirth;\n//                              ^^^^^^^^^^^ Secondary [0]\n        private static int expectedFingers; // Secondary [1]\n        private static Person instance; // Secondary [2]\n\n        public Person(DateTime birthday)\n        {\n            dateOfBirth = birthday;  // Noncompliant [0] {{Remove this assignment of 'dateOfBirth' or initialize it statically.}}\n//          ^^^^^^^^^^^^^\n            expectedFingers = 10;  // Noncompliant [1] {{Remove this assignment of 'expectedFingers' or initialize it statically.}}\n//          ^^^^^^^^^^^^^^^^^\n            instance = this; // Noncompliant [2]\n        }\n\n        public Person() : this(DateTime.Now)\n        {\n            var tmp = dateOfBirth.ToString(); // Compliant\n        }\n\n        static Person()\n        {\n            dateOfBirth = DateTime.Now; // Compliant\n        }\n    }\n\n    public partial class PartialPerson\n    {\n        private static DateTime dateOfBirth; // Secondary\n    }\n\n    public partial class PartialPerson\n    {\n        public PartialPerson(DateTime birthday)\n        {\n            dateOfBirth = birthday;  // Noncompliant; now everyone has this birthday\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StaticFieldWrittenFromInstanceMember.Latest.cs",
    "content": "﻿using System;\n\nclass StaticFieldWrittenFromInstanceMember\n{\n    private static string text; // Secondary\n\n    public void DoSomething()\n    {\n        text ??= \"empty\"; // Noncompliant\n    }\n\n    public static void DoSomethingStatic()\n    {\n        text ??= \"empty\";\n    }\n}\n\ninterface IStaticFieldWrittenFromInstanceMember\n{\n    private static int count = 0;\n//                     ^^^^^^^^^ Secondary\n//                     ^^^^^^^^^ Secondary@-1\n\n    public void DoSomething()\n    {\n        count++;  // Noncompliant {{Remove this set, which updates a 'static' field from an instance method.}}\n//      ^^^^^\n        var action = new Action(() =>\n        {\n            count++; // Compliant, already reported on this symbol\n        });\n    }\n\n    public static void DoSomethingStatic()\n    {\n        count++;\n    }\n\n    public int MyProperty\n    {\n        get { return 0; }\n        set\n        {\n            count++; // Noncompliant {{Remove this set, which updates a 'static' field from an instance property.}}\n            count += 42; // Compliant, already reported on this symbol\n        }\n    }\n}\n\nrecord Record\n{\n    internal static int count = 0;\n//                      ^^^^^^^^^ Secondary\n//                      ^^^^^^^^^ Secondary@-1\n\n    public void Method() => count++; // Noncompliant\n\n    public static void DoSomethingStatic() => count++; // Compliant\n\n    public static Action<int> StaticFoo() => static x =>\n    {\n        count += x; // compliant because it can only be used in a static context\n    };\n\n    public Action<int> Foo() => static x =>\n    {\n        count += x; // Noncompliant {{Make the enclosing instance method 'static' or remove this set on the 'static' field.}}\n    };\n\n    public void CallFoo() => Foo()(1); // 'count' gets incremented from an instance member\n}\n\nclass Class\n{\n    private static string staticVar; // Secondary\n    private int var;\n\n    public int MyProperty\n    {\n        get { return var; }\n        init\n        {\n            staticVar = \"42\"; // Noncompliant\n            staticVar += \"42\"; // Compliant, already reported on this symbol\n            var = value;\n        }\n    }\n}\n\nstruct Structure\n{\n    internal static int count = 0;\n    //                  ^^^^^^^^^                            Secondary    [increment]\n    //                  ^^^^^^^^^                            Secondary@-1 [compoundAdd]\n    //                  ^^^^^^^^^                            Secondary@-2 [deconstruct]\n\n    public void Method() => count++;                      // Noncompliant [increment]\n\n    public static void DoSomethingStatic() => count++;    // Compliant\n\n    public static Action<int> StaticFoo() => static x =>\n    {\n        count += x;                                       // Compliant because it can only be used in a static context\n    };\n\n    public Action<int> Foo() => static x =>\n    {\n        count += x;                                       // Noncompliant [compoundAdd] {{Make the enclosing instance method 'static' or remove this set on the 'static' field.}}\n    };\n\n    public Action<int> Foo2() => static x =>\n    {\n        (count, var y) = (42, \"42\");\n//       ^^^^^^^^^^^^^^^                                     Noncompliant [deconstruct]\n    };\n\n    public void CallFoo() => Foo()(1);                    // 'count' gets incremented from an instance member\n}\n\nrecord struct RecordStructure\n{\n    internal static int count = 0;\n    //                  ^^^^^^^^^                            Secondary    [RecordIncrement]\n    //                  ^^^^^^^^^                            Secondary@-1 [RecordCompoundAdd]\n    //                  ^^^^^^^^^                            Secondary@-2 [RecordDeconstruct]\n\n    public void Method() => count++;                      // Noncompliant [RecordIncrement]\n\n    public static void DoSomethingStatic() => count++;    // Compliant\n\n    public static Action<int> StaticFoo() => static x =>\n    {\n        count += x;                                       // Compliant because it can only be used in a static context\n    };\n\n    public Action<int> Foo() => static x =>\n    {\n        count += x;                                       // Noncompliant [RecordCompoundAdd] {{Make the enclosing instance method 'static' or remove this set on the 'static' field.}}\n    };\n\n    public Action<int> Foo2() => static x =>\n    {\n        (count, var y) = (42, \"42\");                      // Noncompliant [RecordDeconstruct]\n    };\n\n    public void CallFoo() => Foo()(1);                    // 'count' gets incremented from an instance member\n}\n\nclass CSharp11\n{\n    private static int count = 0; // Secondary\n    public int MyProperty\n    {\n        get { return myVar; }\n        set\n        {\n            count >>>= 42; // Noncompliant\n            myVar = value;\n        }\n    }\n\n    private int myVar;\n}\n\nclass CSharp13\n{\n    partial class PartialClass\n    {\n        public partial int MyProperty\n        {\n            get { return myVar; }\n            set\n            {\n                count >>>= 42; // Noncompliant\n                myVar = value;\n            }\n        }\n    }\n\n    partial class PartialClass\n    {\n        public partial int MyProperty { get; set; }\n        private int myVar;\n        private static int count = 0; // Secondary\n    }\n}\n\nstatic class CSharp14\n{\n    class Sample\n    {\n        public static int count = 0;\n        public int countInstance = 0;\n    }\n\n    static int count = 0;\n    extension(Sample sample)\n    {\n        void Method()\n        {\n            count++;                // Compliant\n            Sample.count++;         // Compliant\n            sample.countInstance++; // Compliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StaticFieldWrittenFromInstanceMember.TopLevelStatements.cs",
    "content": "﻿Record.count++;             // Compliant - static field set from static method\nStructure.count++;          // Compliant - static field set from static method\nRecordStructure.count++;    // Compliant - static field set from static method\n\nrecord Record\n{\n    internal static int count = 0;\n}\n\nstruct Structure\n{\n    internal static int count = 0;\n}\n\nrecord struct RecordStructure\n{\n    internal static int count = 0;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StaticFieldWrittenFromInstanceMember.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    class StaticFieldWrittenFromInstanceMember\n    {\n        private static int count = 0;\n//                         ^^^^^^^^^ Secondary [0]\n//                         ^^^^^^^^^ Secondary@-1 [1]\n        private int countInstance = 0;\n\n        public void DoSomething()\n        {\n            count++;  // Noncompliant [0] {{Make the enclosing instance method 'static' or remove this set on the 'static' field.}}\n//          ^^^^^\n            var action = new Action(() =>\n            {\n                count++; // Compliant, already reported on this symbol\n            });\n            countInstance++;\n        }\n\n        public static void DoSomethingStatic()\n        {\n            count++;\n        }\n\n        public int MyProperty\n        {\n            get { return myVar; }\n            set\n            {\n                count++; // Noncompliant [1] {{Make the enclosing instance property 'static' or remove this set on the 'static' field.}}\n                count += 42; // Compliant, already reported on this symbol\n                myVar = value;\n            }\n        }\n\n        private int myVar;\n\n        public int MyProperty2\n        {\n            get { return myVar; }\n            set { myVar = value; }\n        }\n    }\n\n    public partial class PartialClass\n    {\n        static int field = 1;\n//                 ^^^^^^^^^ Secondary\n//                 ^^^^^^^^^ Secondary@-1\n\n    }\n\n    public partial class PartialClass\n    {\n        void Foo()\n        {\n            field++; // Noncompliant\n        }\n        void Bar() => field++; // Noncompliant\n    }\n\n    public class NotCompileable : NotKnownType // Error [CS0246]\n    {\n        private static int count = 0; // Secondary\n        void Method()\n        {\n            count++; // Noncompliant\n        }\n    }\n\n    public static class Extensions\n    {\n        public class Sample\n        {\n            public static int count = 0;\n            public int countInstance = 0;\n        }\n        static int count = 0;\n        public static void Method(this Sample sample)\n        {\n            count++;                // Compliant\n            Sample.count++;         // Compliant\n            sample.countInstance++; // Compliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StaticSealedClassProtectedMembers.Latest.Partial.cs",
    "content": "﻿namespace CSharp13\n{\n    sealed partial class PartialPropertyClass\n    {\n        protected partial int PartialProperty // Noncompliant\n        {\n            get;\n            set;\n        }\n        public partial int OtherPartialProperty\n        {\n            get;\n            set;\n        }\n        public partial int this[int index] { get { return 42; } }\n        protected partial int this[string index] { get { return 42; } } // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StaticSealedClassProtectedMembers.Latest.cs",
    "content": "﻿using System;\nnamespace CSharp9\n{\n    sealed record Record\n    {\n        public int field0; // Compliant\n\n        protected int field1; // Noncompliant\n\n        internal protected int field2; // Noncompliant\n\n        internal readonly protected int field3; // Noncompliant\n\n        protected static int field4; // Noncompliant\n\n        internal protected static int field5; // Noncompliant\n\n        internal readonly protected static int field6; // Noncompliant\n\n        protected const int const1 = 5; // Noncompliant\n\n        internal protected const int const2 = 10; // Noncompliant\n\n        protected Record() { } // Noncompliant\n\n        internal protected Record(string name) { } // Noncompliant\n    }\n}\n\nnamespace CSharp13\n{\n    sealed partial class PartialPropertyClass\n    {\n        protected partial int PartialProperty // Noncompliant\n        {\n            get => 42;\n            set { }\n        }\n        public partial int OtherPartialProperty // Compliant\n        {\n            get => 42;\n            set { }\n        }\n        public partial int this[int index] { get; }\n        protected partial int this[string index] { get; } // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StaticSealedClassProtectedMembers.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    sealed class Class1\n    {\n        public int field0; // Compliant\n\n        protected int field1; // Noncompliant {{Remove this 'protected' modifier.}}\n//      ^^^^^^^^^\n\n        internal protected int field2; // Noncompliant\n//               ^^^^^^^^^\n\n        internal readonly protected int field3; // Noncompliant\n//                        ^^^^^^^^^\n\n        protected static int field4; // Noncompliant\n//      ^^^^^^^^^\n\n        internal protected static int field5; // Noncompliant\n//               ^^^^^^^^^\n\n        internal readonly protected static int field6; // Noncompliant\n//                        ^^^^^^^^^\n\n        protected const int const1 = 5; // Noncompliant\n//      ^^^^^^^^^\n\n        internal protected const int const2 = 10; // Noncompliant\n//               ^^^^^^^^^\n\n        private Class1(int counter, string name) // Compliant\n        { }\n        \n        public Class1(int counter) // Compliant\n        { }\n\n        internal Class1(long counter) // Compliant\n        { }\n\n        protected Class1() // Noncompliant\n//      ^^^^^^^^^\n        { }\n\n        internal protected Class1(string name) // Noncompliant\n//               ^^^^^^^^^\n        { }\n\n        protected void Test1() // Noncompliant\n//      ^^^^^^^^^\n        { }\n\n\n        protected internal void Test2() // Noncompliant\n//      ^^^^^^^^^\n        { }\n\n        private void Test3() // Compliant\n        { }\n        \n        protected int MyProperty { get; set; } // Noncompliant\n//      ^^^^^^^^^\n\n        protected int this[int counter] // Noncompliant\n//      ^^^^^^^^^\n        {\n            get { return 0; }\n            set { }\n        }\n\n        protected event EventHandler<EventArgs> MyEvent // Noncompliant\n//      ^^^^^^^^^\n        {\n            add { }\n            remove { }\n        }\n    }\n\n    public class Base1\n    {\n        protected virtual void Method1() // Compliant\n        { }\n\n        protected virtual int MyProperty { get; } // Compliant\n    }\n\n    public sealed class Subclass1 : Base1\n    {\n        protected override void Method1() // Compliant\n        { }\n\n        protected override int MyProperty // Compliant\n        {\n            get { return 0; }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StreamReadStatement.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Threading.Tasks;\n\nnamespace Tests.Diagnostics\n{\n    public class StreamReadStatement\n    {\n        public StreamReadStatement(string fileName)\n        {\n            using var stream = File.Open(fileName, FileMode.Open);\n            var result = new byte[stream.Length];\n            (int a, int b) = (stream.Read(result, 0, (int)stream.Length), 42); // Compliant The result is assigned to a\n            _ = stream.Read(result, 0, (int)stream.Length);                    // FN. The result is discarded\n            (_, var c) = (stream.Read(result, 0, (int)stream.Length), 42);     // FN. The result is discarded\n            _ = stream.Read(result, 0, (int)stream.Length) is { };             // FN. The result is discarded\n            _ = stream.Read(result, 0, (int)stream.Length) is { } _;           // FN. The result is discarded\n            _ = (stream.Read(result, 0, (int)stream.Length), 42) is (_, _);    // FN. The result is discarded\n        }\n\n        public void ReadAtLeast(string fileName)\n        {\n            using var stream = File.Open(fileName, FileMode.Open);\n            var result = new byte[stream.Length];\n            var i = stream.ReadAtLeast(result, (int)stream.Length);            // Compliant The result is assigned to i\n            stream.ReadAtLeast(result, (int)stream.Length);                    // Noncompliant {{Check the return value of the 'ReadAtLeast' call to see how many bytes were read.}}\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        }\n\n        public async Task ReadAtLeastAsync(string fileName)\n        {\n            using var stream = File.Open(fileName, FileMode.Open);\n            var result = new byte[stream.Length];\n            var i = await stream.ReadAtLeastAsync(result, (int)stream.Length); // Compliant\n            await stream.ReadAtLeastAsync(result, (int)stream.Length);         // Noncompliant {{Check the return value of the 'ReadAtLeastAsync' call to see how many bytes were read.}}\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StreamReadStatement.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Threading.Tasks;\n\nnamespace Tests.Diagnostics\n{\n    public class StreamReadStatement\n    {\n        Stream streamField = new MemoryStream();\n\n        public StreamReadStatement(string fileName)\n        {\n            using (var stream = File.Open(fileName, FileMode.Open))\n            {\n                var result = new byte[stream.Length];\n                stream.Read(result, 0, (int)stream.Length);             // Noncompliant\n//              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n                var l = stream.Read(result, 0, (int)stream.Length);\n                stream.ReadAsync(result, 0, (int)stream.Length);        // Noncompliant {{Check the return value of the 'ReadAsync' call to see how many bytes were read.}}\n                                                                        // Error@+1 [CS4033] - ctor can't be async\n                await stream.ReadAsync(result, 0, (int)stream.Length);  // Noncompliant\n                stream.Write(result, 0, (int)stream.Length);\n            }\n            streamField.Read(new byte[0], 0, 0);                        // Noncompliant\n            this.streamField.Read(new byte[0], 0, 0);                   // Noncompliant\n            streamField?.Read(new byte[0], 0, 0);                       // Noncompliant\n            this.streamField?.Read(new byte[0], 0, 0);                  // Noncompliant\n            Read();                                                     // Compliant. Not a read method of a stream\n        }\n\n        public void Read() { }\n    }\n\n    public class DerivedStream : Stream\n    {\n        public override bool CanRead\n        {\n            get\n            {\n                throw new NotImplementedException();\n            }\n        }\n\n        public override bool CanSeek\n        {\n            get\n            {\n                throw new NotImplementedException();\n            }\n        }\n\n        public override bool CanWrite\n        {\n            get\n            {\n                throw new NotImplementedException();\n            }\n        }\n\n        public override long Length\n        {\n            get\n            {\n                throw new NotImplementedException();\n            }\n        }\n\n        public override long Position\n        {\n            get\n            {\n                throw new NotImplementedException();\n            }\n\n            set\n            {\n                throw new NotImplementedException();\n            }\n        }\n\n        public override void Flush()\n        {\n            throw new NotImplementedException();\n        }\n\n        public void Read(byte[] buffer, int offset, string count) { /* do something */ }\n\n        public override int Read(byte[] buffer, int offset, int count)\n        {\n            throw new NotImplementedException();\n        }\n\n        public override long Seek(long offset, SeekOrigin origin)\n        {\n            throw new NotImplementedException();\n        }\n\n        public override void SetLength(long value)\n        {\n            throw new NotImplementedException();\n        }\n\n        public override void Write(byte[] buffer, int offset, int count)\n        {\n            throw new NotImplementedException();\n        }\n    }\n\n    public class Program\n    {\n        public async Task Foo()\n        {\n            var stream = new DerivedStream();\n            var array = new byte[10];\n            stream.Read(array, 0, \"\");                                                     // Compliant\n            stream.Read(array, 0, 10);                                                     // Noncompliant\n            stream.ReadAsync(array, 0, (int)stream.Length);                                // Noncompliant {{Check the return value of the 'ReadAsync' call to see how many bytes were read.}}\n            await stream.ReadAsync(array, 0, (int)stream.Length);                          // Noncompliant\n            await stream.ReadAsync(array, 0, (int)stream.Length).ConfigureAwait(false);    // Noncompliant\n            await (stream.ReadAsync(array, 0, (int)stream.Length)).ConfigureAwait(false);  // Noncompliant\n            await (stream.ReadAsync(array, 0, (int)stream.Length));                        // Noncompliant\n            var res = await stream.ReadAsync(array, 0, (int)stream.Length);                // Compliant\n            var t1 = stream.ReadAsync(array, 0, (int)stream.Length);                       // Compliant The read length is stored in the task and that is as good as storing the read length in a variable\n            var t2 = stream.ReadAsync(array, 0, (int)stream.Length).ConfigureAwait(false); // Compliant\n            var x = stream.ReadAsync(array, 0, (int)stream.Length).Result;                 // Compliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StringConcatenationInLoop.Latest.cs",
    "content": "﻿using System.Threading.Tasks;\nusing System;\n\nnamespace CSharp11\n{\n    public class StringConcatenationInLoop\n    {\n        public StringConcatenationInLoop()\n        {\n            string s = \"\";\n            for (int i = 0; i < 50; i++)\n            {\n                var sLoop = \"\";\n\n                s = s + $\"\"\"{5}a\"\"\" + \"\"\"b\"\"\";  // Noncompliant\n                s += \"\"\"a\"\"\";     // Noncompliant {{Use a StringBuilder instead.}}\n                sLoop += \"\"\"a\"\"\"; // Compliant\n\n                i += 5;\n            }\n        }\n    }\n}\n\nnamespace CSharp13\n{\n    public partial class Partial\n    {\n        public partial string MyString { get; set; }\n    }\n\n    public partial class Partial {\n        public partial string MyString\n        {\n            get => \"a\";\n            set => MyString = value;\n        }\n    }\n\n    public class MyClass\n    {\n        async Task TaskWhenEach()\n        {\n            string s = \"\";\n            Task task1 = Task.Delay(100);\n            Task task2 = Task.Delay(100);\n            Task task3 = Task.Delay(100);\n\n            await foreach (Task t in Task.WhenEach(task1, task2, task3))\n            {\n                s += \"A\"; // Noncompliant\n            }\n        }\n\n        // https://sonarsource.atlassian.net/browse/NET-442\n        void PartialProperties()\n        {\n            Partial partial = new Partial();\n            for (int i = 0; i < 50; i++)\n            {\n                partial.MyString += \"A\";                   // Noncompliant\n                partial.MyString = partial.MyString + \"A\"; // Noncompliant\n            }\n        }\n    }\n}\n\nnamespace CSharp14\n{\n    class NullConditionalAssignment\n    {\n        string s;\n        void Method(NullConditionalAssignment sample)\n        {\n            for (int i = 0; i < 50; i++)\n            {\n                sample?.s += \"A\";   // Noncompliant NET-2858\n            }\n        }\n    }\n\n    class FieldKeyword\n    {\n        string Property\n        {\n            get\n            {\n                for (int i = 0; i < 50; i++)\n                {\n                    field += \"A\";   // Noncompliant NET-2859\n                }\n                return field;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StringConcatenationInLoop.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.IO;\n\nnamespace Tests.Diagnostics\n{\n    public class StringConcatenationInLoop\n    {\n        private string field = \"\";\n        private string Property { get; set; }\n\n        public StringConcatenationInLoop(IList<MyObject> objects, string p, StringConcatenationInLoop sample)\n        {\n            string s = \"\";\n            Dictionary<string, string> dict = new Dictionary<string, string>();\n            int t = 0;\n\n            for (int i = 0; i < 50; i++)\n            {\n                var sLoop = \"\";\n\n                s = s + \"a\" + \"b\";  // Noncompliant {{Use a StringBuilder instead.}}\n//              ^^^^^^^^^^^^^^^^^\n                s += \"a\";     // Noncompliant\n//              ^^^^^^^^\n\n                s = s + i.ToString(); // Noncompliant\n                s += i.ToString(); // Noncompliant\n                s += \"a\" + s; // Noncompliant\n                s += string.Format(\"{0} world;\", \"Hello\"); // Noncompliant\n                dict[\"a\"] = dict[\"a\"] + \"a\"; // Compliant: Technically an FN, but its an uncommon use case. It is much more likely to use a loop variable as the index on a dict/array.\n                dict[i.ToString()] = dict[i.ToString()] + \"a\"; // Compliant\n                s = \"a\" + (s == null ? \"Empty\" : s); // FN\n\n                i = i + 1;\n                i += 1;\n                t = t + 1;\n                t = t + 1 - 1 + 1;\n                t += 1;\n                sLoop = sLoop + \"a\";\n                sLoop += \"a\";\n\n                // https://github.com/SonarSource/sonar-dotnet/issues/7722\n                p = p + \"a\";                        // Noncompliant NET-1259\n                p += \"a\";                           // Noncompliant\n\n                field = field + \"a\";                // Noncompliant\n                field += \"a\";                       // Noncompliant\n\n                Property = Property + \"a\";          // Noncompliant\n                Property += \"a\";                    // Noncompliant\n\n                sample.field = sample.field + \"a\";  // Noncompliant\n            }\n\n            while (true)\n            {\n                var sLoop = \"\";\n\n                s = s + \"a\"; // Noncompliant\n                s += \"a\"; // Noncompliant\n                sLoop = s + \"a\"; // Compliant\n                sLoop += s + \"a\"; // Compliant\n\n                // See https://github.com/SonarSource/sonar-dotnet/issues/1138\n                s = s ?? \"b\";\n            }\n\n            foreach (var o in objects)\n            {\n                var sLoop = \"\";\n\n                s = s + \"a\"; // Noncompliant\n                s += \"a\"; // Noncompliant\n                sLoop = s + \"a\"; // Compliant\n                sLoop += s + \"a\"; // Compliant\n            }\n\n            do\n            {\n                var sLoop = \"\";\n\n                s = s + \"a\"; // Noncompliant\n                s += \"a\"; // Noncompliant\n                sLoop = s + \"a\"; // Compliant\n                sLoop += s + \"a\"; // Compliant\n            }\n            while (true);\n\n            s = s + \"a\"; // Compliant\n            s += \"a\"; // Compliant\n\n            p = p + \"a\"; // Compliant\n            p += \"a\"; // Compliant\n\n            var l = \"\";\n            l = l + \"a\"; // Compliant\n            l += \"a\"; // Compliant\n        }\n\n        // https://github.com/SonarSource/sonar-dotnet/issues/5521\n        void Repro_5521(IList<MyObject> objects)\n        {\n            foreach (var obj in objects)\n            {\n                obj.Name += \"a\"; // Compliant\n                obj.Name = obj.Name + \"a\"; // Compliant\n            }\n        }\n\n        // https://github.com/SonarSource/sonar-dotnet/issues/7713\n        void Repro_7713()\n        {\n            var s = \"\";\n            var t = \"\";\n\n            while (true)\n            {\n                s = \"a\" + \"b\" + \"c\" + s; // Noncompliant\n                s = \"a\" + \"b\" + s; // Noncompliant\n                s = \"a\" + s; // Noncompliant\n                s = \"a\" + s + \"b\"; // Noncompliant\n\n                s = \"a\" + \"b\" + t; // Compliant\n            }\n        }\n    }\n\n    public class MyObject\n    {\n        public string Name { get; set; }\n    }\n\n    class Sample\n    {\n        public string S { get; set; }\n        void M(List<Sample> others)\n        {\n            foreach (var sample in others)\n            {\n                sample.S = sample.S + \"- disabled\"; // Compliant\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StringConcatenationInLoop.vb",
    "content": "﻿Imports System.Collections.Generic\n\nNamespace Tests.Diagnostics\n    Public Class StringConcatenationInLoop\n        Public Sub New(ByVal objects As IList(Of MyObject), ByVal p As String)\n            Dim s = \"\"\n            Dim t = 0\n            Dim dict As Dictionary(Of String, String) = New Dictionary(Of String, String)()\n\n            For i = 0 To 49\n                Dim sLoop = \"\"\n\n                s = s & \"a\" & \"b\"  ' Noncompliant {{Use a StringBuilder instead.}}\n'               ^^^^^^^^^^^^^^^^^\n                s += \"a\"     ' Noncompliant\n'               ^^^^^^^^\n\n                s = s & i.ToString() ' Noncompliant\n                s += i.ToString() ' Noncompliant\n                s += \"a\" & s ' Noncompliant\n                s += String.Format(\"{0} world;\", \"Hello\") ' Noncompliant\n\n                dict(\"a\") = dict(\"a\") & \"a\" ' Compliant\n                dict(i.ToString()) = dict(i.ToString()) & \"a\" ' Compliant\n                i = i + 1\n                i += 1\n                t = t + 1\n                t += 1\n                sLoop = sLoop & \"a\"\n                sLoop += \"a\"\n            Next\n\n            While True\n                Dim sLoop = \"\"\n\n                s = s & \"a\" ' Noncompliant\n                s += \"a\" ' Noncompliant\n                sLoop = s & \"a\" ' Compliant\n                sLoop += s & \"a\" ' Compliant\n\n                ' See https://github.com/SonarSource/sonar-dotnet/issues/1138\n                s = If(s, \"b\")\n            End While\n\n            For Each o In objects\n                Dim sLoop = \"\"\n\n                s = s & \"a\" ' Noncompliant\n                s += \"a\" ' Noncompliant\n                sLoop = s & \"a\" ' Compliant\n                sLoop += s & \"a\" ' Compliant\n            Next\n\n            Do\n                Dim sLoop = \"\"\n\n                s = s & \"a\" ' Noncompliant\n                s += \"a\" ' Noncompliant\n                sLoop = s & \"a\" ' Compliant\n                sLoop += s & \"a\" ' Compliant\n            Loop While True\n\n            s = s & \"a\" ' Compliant\n            s += \"a\" ' Compliant\n\n            p = p & \"a\" ' Compliant\n            p += \"a\" ' Compliant\n\n            Dim l = \"\"\n            l = l & \"a\" ' Compliant\n            l += \"a\" ' Compliant\n        End Sub\n\n        ' https://github.com/SonarSource/sonar-dotnet/issues/5521\n        Private Sub Repro_5521(ByVal objects As IList(Of MyObject))\n            For Each obj In objects\n                obj.Name += \"a\" ' Compliant\n                obj.Name = obj.Name & \"a\" ' Compliant\n            Next\n        End Sub\n\n        ' https://github.com/SonarSource/sonar-dotnet/issues/7713\n        Private Sub Repro_7713()\n            Dim s = \"\"\n\n            While True\n                s = \"a\" & \"b\" & \"c\" & s ' Noncompliant\n                s = \"a\" & \"b\" & s ' Noncompliant\n                s = \"a\" & s ' Noncompliant\n            End While\n        End Sub\n    End Class\n\n    Public Class MyObject\n        Public Property Name As String\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StringConcatenationWithPlus.Fixed.vb",
    "content": "﻿Imports System\nImports System.Xml.Linq\n\nModule Module1\n    Sub Main()\n        ' Fixed\n        Console.WriteLine(\"1\" &\n                          2 & \"3\") ' Fixed\n        Console.WriteLine(\"1\" & \"2\") ' Fixed\n        Console.WriteLine(1 & 2)   ' Compliant - will display \"12\"\n        Console.WriteLine(1 + 2)   ' Compliant - will display \"3\"\n        Console.WriteLine(\"1\" & 2) ' Compliant - will display \"12\"\n    End Sub\nEnd Module\n\n' https://github.com/SonarSource/sonar-dotnet/issues/4346\nPublic Class Repro_4346\n\n    Public Sub XmlLinqXNamespace(xE As XElement, xNS As XNamespace, Name As String)\n        Dim xN1 As XName = xNS + \"Name\" ' Compliant, there's no &Operator for XNamespace and string\n        Dim xN2 As XName = xNS + Name\n        xE.Element(xNS + \"Name\")\n        xE.Element(xNS + Name)\n        xE.Element(\"Prefix\" & Name)\n        xE.Element(\"Prefix\" & Name)     ' Fixed\n    End Sub\n\n    Public Sub CustomOperator(Arg As Repro_4346, Name As String)\n        Dim S As String = Arg + Name    ' +Operator exists for this type so there's a reason for it\n        S = Arg & Name  ' Error [BC30452] Operator '&' is not defined for types 'Repro' and 'String'\n    End Sub\n\n    Public Shared Operator +(A As Repro_4346, B As String) As String\n        Return A.ToString & B\n    End Operator\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StringConcatenationWithPlus.vb",
    "content": "﻿Imports System\nImports System.Xml.Linq\n\nModule Module1\n    Sub Main()\n        ' Noncompliant@+1\n        Console.WriteLine(\"1\" +\n                          2 + \"3\") ' Noncompliant - will display \"6\"\n        Console.WriteLine(\"1\" + \"2\") ' Noncompliant {{Switch this use of the '+' operator to the '&'.}}\n'                             ^\n        Console.WriteLine(1 & 2)   ' Compliant - will display \"12\"\n        Console.WriteLine(1 + 2)   ' Compliant - will display \"3\"\n        Console.WriteLine(\"1\" & 2) ' Compliant - will display \"12\"\n    End Sub\nEnd Module\n\n' https://github.com/SonarSource/sonar-dotnet/issues/4346\nPublic Class Repro_4346\n\n    Public Sub XmlLinqXNamespace(xE As XElement, xNS As XNamespace, Name As String)\n        Dim xN1 As XName = xNS + \"Name\" ' Compliant, there's no &Operator for XNamespace and string\n        Dim xN2 As XName = xNS + Name\n        xE.Element(xNS + \"Name\")\n        xE.Element(xNS + Name)\n        xE.Element(\"Prefix\" & Name)\n        xE.Element(\"Prefix\" + Name)     ' Noncompliant\n    End Sub\n\n    Public Sub CustomOperator(Arg As Repro_4346, Name As String)\n        Dim S As String = Arg + Name    ' +Operator exists for this type so there's a reason for it\n        S = Arg & Name  ' Error [BC30452] Operator '&' is not defined for types 'Repro' and 'String'\n    End Sub\n\n    Public Shared Operator +(A As Repro_4346, B As String) As String\n        Return A.ToString & B\n    End Operator\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StringFormatValidator.EdgeCases.cs",
    "content": "﻿using System.Text;\n\npublic class StringFormatValidatorEdgeCases\n{\n    // https://github.com/SonarSource/sonar-dotnet/issues/2392\n    void EdgeCases(string bar)\n    {\n        var builder = new StringBuilder();\n        builder.AppendFormat(\"&invoice={0}\", Foo(bar));\n        builder.AppendFormat(\"&invoice={0}\", new object[0]);\n        builder.AppendFormat(\"&invoice={0}\", new object[1] { 1 });\n        builder.AppendFormat(\"&invoice={0}\", new [] { 1 });\n        builder.AppendFormat(\"&rm=2\", new object[0]);\n        builder.AppendFormat(\"&rm=2\", new[] { 1 });            // Noncompliant\n        builder.AppendFormat(\"&rm=2\", new object[0] { } );     // Noncompliant\n        builder.AppendFormat(\"&rm=2\", new object[1] { \"a\" } ); // Noncompliant\n    }\n\n    string Foo(string bar)\n    {\n        return \"\";\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StringFormatValidator.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nclass CSharp12\n{\n    void CollectionExpressions(string s1, string s2)\n    {\n        IList<string> l;\n        l = [string.Format(\"foo\")];                                                // Noncompliant\n        l = [string.Format(\"{0}\", s1, s2), string.Format(format: \"{0}\", arg0: 1)]; // Noncompliant\n        //   ^^^^^^^^^^^^^\n        l = [string.Format(\"{-1}\", s1), string.Format(null, \"{}\")];\n        //   ^^^^^^^^^^^^^\n        //                              ^^^^^^^^^^^^^@-1\n    }\n}\n\nclass CSharp13\n{\n    void EscapeSequence()\n    {\n        _ = string.Format(\"{'\\e'}\");        // Noncompliant\n        _ = string.Format(\"{{\\e{0}}}\", 42); // Compliant\n        _ = string.Format(\"{0}\", \"\\e\");     // Compliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StringFormatValidator.RuntimeExceptionFree.CSharp11.cs",
    "content": "﻿using System;\n\npublic class StringFormatValidatorRuntimeExceptionFree\n{\n    void System_String_Format(string[] args)\n    {\n        string s;\n        s = string.Format(\"\"\"{0}\"\"\", 42);  // Compliant\n        s = string.Format(\"\"\"[0}\"\"\", 42);  // Noncompliant {{Invalid string format, unbalanced curly brace count.}}\n        s = string.Format(\"\"\"{{0}\"\"\", 42); // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StringFormatValidator.RuntimeExceptionFree.cs",
    "content": "﻿using System;\n\npublic class StringFormatValidatorRuntimeExceptionFree\n{\n    private string validFormatField = \"{0}\";\n    private string invalidFormatField = \"{{0}\";\n\n    void System_String_Format(string[] args)\n    {\n        string s;\n        string arg0 = string.Empty;\n        string arg1 = string.Empty;\n        string arg2 = string.Empty;\n\n        s = string.Format(\"{0}\", 42); // Compliant\n        s = string.Format(\"{0,10}\", 42); // Compliant\n        s = string.Format(\"{0,-10}\", 42); // Compliant\n        s = string.Format(\"{0:0000}\", 42); // Compliant\n        s = string.Format(\"{2}-{0}-{1}\", 1, 2, 3); // Compliant\n        s = string.Format(\"{{{0}}}\", 42); // Compliant, displays {42}\n        s = string.Format(\"{{\\r\\n{0}}}\", 42); // Compliant, displays {\\r\\n42}\n        s = string.Format(\"{0, -12}\", 42);\n        s = string.Format(\"{0    ,    -12}\", 42);\n        s = string.Format(\"{0   ,   -20    :N1}\", 1.234);\n\n        s = string.Format(\"[0}\", arg0); // Noncompliant {{Invalid string format, unbalanced curly brace count.}}\n        //  ^^^^^^^^^^^^^\n        s = string.Format(\"{{0}\", arg0); // Noncompliant\n        s = string.Format(\"{0}}\", arg0); // Noncompliant\n\n        s = string.Format(\"{-1}\", arg0); // Noncompliant {{Invalid string format, opening curly brace can only be followed by a digit or an opening curly brace.}}\n        s = string.Format(null, \"{}\"); // Noncompliant\n        s = string.Format(\"}{ {0}\", 42); // Noncompliant\n\n        s = string.Format(\"{0} {1}\", arg0); // Noncompliant {{Invalid string format, the highest string format item index should not be greater than the arguments count.}}\n        s = string.Format(\"{0} {1} {2}\", new[] { 1, 2 }); // Noncompliant\n        s = string.Format(\"{0} {1} {2}\", new object[] { 1, 2 }); // Noncompliant\n\n        var pattern = \"{0} {1} {2}\";\n        s = string.Format(pattern, 1, 2); // Noncompliant\n\n        int[] intArray = new int[] { };\n        s = string.Format(\"{0} {1} {2}\", intArray); // Compliant, arrays are not recognized\n        s = string.Format(\"{0} {1} {2}\", args); // Compliant, arrays are not recognized\n\n        const string pattern2 = \"{0} {1} {2}\";\n        s = string.Format(pattern2, 1, 2); // Noncompliant\n        s = string.Format(null, pattern2, 1, 2); // Noncompliant\n        s = string.Format(null, pattern2, 1, 2, 3); // Compliant\n\n        s = string.Format(null, arg0: 1); // Noncompliant {{Invalid string format, the format string cannot be null.}}\n\n        s = string.Format(\"{0test}\", 42); // Noncompliant {{Invalid string format, all format items should comply with the following pattern '{index[,alignment][:formatString]}'.}}\n        s = string.Format(\"{0,test}\", 42); // Noncompliant\n        s = string.Format(\"{0.0}\", 42); // Noncompliant\n        s = string.Format(\"{0:C,10}\", 42);\n        s = string.Format(\"{0:hh:mm:ss}\", DateTime.Now);\n        s = string.Format(\"{0:dd/MM/yyyy}\", DateTime.Now);\n        s = string.Format(\"{0:(###) ###-####}\", 8005551212);\n        s = string.Format(\"{0:(###) ###-####}\", 8005551212);\n        s = string.Format(\"{0:0,.}\", 1500.42);\n        s = string.Format(\"{0:0,0}\", 1500.42);\n\n        s = string.Format(\"{1000001}\"); // Noncompliant {{Invalid string format, the string format item index should not be greater than 1000000.}}\n        s = string.Format(\"{0,1000001}\"); // Noncompliant {{Invalid string format, the string format item alignment should not be greater than 1000000.}}\n\n        var validFormatVariable = \"{0}\";\n        var invalidFormatVariable = \"{{0}\";\n        s = string.Format(invalidFormatField, arg0);    // Noncompliant\n        s = string.Format(invalidFormatVariable, arg0); // Noncompliant\n        s = string.Format(validFormatField, arg0);\n        s = string.Format(validFormatVariable, arg0);\n        // Reassigned to fixed values\n        invalidFormatField = \"{0}\";\n        invalidFormatVariable = \"{0}\";\n        s = string.Format(invalidFormatField, arg0);\n        s = string.Format(invalidFormatVariable, arg0);\n    }\n\n    void System_Console_Write(string[] args)\n    {\n        Console.Write(\"0\");\n        Console.Write(\"{0}\", 42);\n        Console.Write(\"{{}}\"); // Compliant, displays {}\n        Console.Write(\"{\"); // Compliant\n        Console.Write(ulong.MaxValue);\n\n        Console.Write(\"[0}\", args[0]); // Noncompliant\n        Console.Write(\"{-1}\", args[0]); // Noncompliant\n        Console.Write(\"{0} {1}\", args[0]); // Noncompliant\n        Console.Write(null, \"foo\", \"bar\"); // Noncompliant\n    }\n\n    void System_Console_WriteLine(string[] args)\n    {\n        Console.WriteLine(null, \"foo\", \"bar\"); // Noncompliant\n    }\n\n    void System_Text_StringBuilder_AppendFormat(string[] args)\n    {\n        var sb = new System.Text.StringBuilder();\n\n        sb.AppendFormat(\"{0}\", 42);\n\n        sb.AppendFormat(\"[0}\", args[0]); // Noncompliant\n        sb.AppendFormat(\"{-1}\", args[0]); // Noncompliant\n        sb.AppendFormat(\"{0} {1}\", args[0]); // Noncompliant\n        sb.AppendFormat(null, \"foo\", \"bar\"); // Noncompliant\n    }\n\n    void System_IO_TextWriter_Write(string[] args)\n    {\n        System.IO.TextWriter tw = new System.IO.StreamWriter(\"\");\n\n        tw.Write(\"0\");\n        tw.Write(\"{0}\", 42);\n        tw.Write(\"{\"); // Compliant\n        tw.Write(ulong.MaxValue);\n\n        tw.Write(\"[0}\", args[0]); // Noncompliant\n        tw.Write(\"{-1}\", args[0]); // Noncompliant\n        tw.Write(\"{0} {1}\", args[0]); // Noncompliant\n        tw.Write(null, \"foo\", \"bar\"); // Noncompliant\n    }\n\n    void System_IO_TextWriter_WriteLine(string[] args)\n    {\n        System.IO.TextWriter tw = new System.IO.StreamWriter(\"\");\n\n        tw.WriteLine(\"0\");\n        tw.WriteLine(\"{0}\", 42);\n        tw.WriteLine(\"{\"); // Compliant\n        tw.WriteLine(ulong.MaxValue);\n\n        tw.WriteLine(\"[0}\", args[0]); // Noncompliant\n        tw.WriteLine(\"{-1}\", args[0]); // Noncompliant\n        tw.WriteLine(\"{0} {1}\", args[0]); // Noncompliant\n        tw.WriteLine(null, \"foo\", \"bar\"); // Noncompliant\n    }\n\n    void System_Diagnostics_Debug_WriteLine(string[] args)\n    {\n        System.Diagnostics.Debug.WriteLine(\"0\");\n        System.Diagnostics.Debug.WriteLine(\"{0}\", 42);\n        System.Diagnostics.Debug.WriteLine(\"{\"); // Compliant\n        System.Diagnostics.Debug.WriteLine(ulong.MaxValue);\n        System.Diagnostics.Debug.WriteLine(\"\", \"\");\n\n        System.Diagnostics.Debug.WriteLine(\"[0}\", args); // Noncompliant\n        System.Diagnostics.Debug.WriteLine(\"{-1}\", args); // Noncompliant\n        System.Diagnostics.Debug.WriteLine(\"{0} {1}\", (object)args[0]); // Noncompliant\n        System.Diagnostics.Debug.WriteLine(null, \"foo\", \"bar\"); // Noncompliant\n    }\n\n    void System_Diagnostics_Trace_TraceError(string[] args)\n    {\n        System.Diagnostics.Trace.TraceError(\"0\");\n        System.Diagnostics.Trace.TraceError(\"{0}\", 42);\n        System.Diagnostics.Trace.TraceError(\"{\"); // Compliant\n\n        System.Diagnostics.Trace.TraceError(\"[0}\", args[0]); // Noncompliant\n        System.Diagnostics.Trace.TraceError(\"{-1}\", args[0]); // Noncompliant\n        System.Diagnostics.Trace.TraceError(\"{0} {1}\", args[0]); // Noncompliant\n        System.Diagnostics.Trace.TraceError(null, \"foo\", \"bar\"); // Noncompliant\n    }\n\n    void System_Diagnostics_Trace_TraceInformation(string[] args)\n    {\n        System.Diagnostics.Trace.TraceInformation(\"0\");\n        System.Diagnostics.Trace.TraceInformation(\"{0}\", 42);\n        System.Diagnostics.Trace.TraceInformation(\"{\"); // Compliant\n\n        System.Diagnostics.Trace.TraceInformation(\"[0}\", args[0]); // Noncompliant\n        System.Diagnostics.Trace.TraceInformation(\"{-1}\", args[0]); // Noncompliant\n        System.Diagnostics.Trace.TraceInformation(\"{0} {1}\", args[0]); // Noncompliant\n        System.Diagnostics.Trace.TraceInformation(null, \"foo\", \"bar\"); // Noncompliant\n    }\n\n    void System_Diagnostics_Trace_TraceWarning(string[] args)\n    {\n        System.Diagnostics.Trace.TraceWarning(\"0\");\n        System.Diagnostics.Trace.TraceWarning(\"{0}\", 42);\n        System.Diagnostics.Trace.TraceWarning(\"{\"); // Compliant\n\n        System.Diagnostics.Trace.TraceWarning(\"[0}\", args[0]); // Noncompliant\n        System.Diagnostics.Trace.TraceWarning(\"{-1}\", args[0]); // Noncompliant\n        System.Diagnostics.Trace.TraceWarning(\"{0} {1}\", args[0]); // Noncompliant\n        System.Diagnostics.Trace.TraceWarning(null, \"foo\", \"bar\"); // Noncompliant\n    }\n\n    void System_Diagnostics_TraceSource_TraceInformation(string[] args)\n    {\n        var ts = new System.Diagnostics.TraceSource(\"\");\n\n        ts.TraceInformation(\"0\");\n        ts.TraceInformation(\"{0}\", 42);\n        ts.TraceInformation(\"{\"); // Compliant\n\n        ts.TraceInformation(\"[0}\", args[0]); // Noncompliant\n        ts.TraceInformation(\"{-1}\", args[0]); // Noncompliant\n        ts.TraceInformation(\"{0} {1}\", args[0]); // Noncompliant\n        ts.TraceInformation(null, \"foo\", \"bar\"); // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StringFormatValidator.TypoFree.CSharp11.cs",
    "content": "﻿using System;\n\npublic class StringFormatValidatorTypoFree\n{\n    void Test()\n    {\n        string arg0 = string.Empty;\n        string arg1 = string.Empty;\n\n        var s = string.Format(\"\"\"some text\"\"\"); // Noncompliant {{Remove this formatting call and simply use the input string.}}\n        s = string.Format(null, 42);                //Noncompliant {{Invalid string format, the format string cannot be null.}}\n        s = string.Format(string.Format(\"\"\"foo\"\"\"));    //Noncompliant\n        s = string.Format(\"\"\"{0}\"\"\", arg0, arg1); // Noncompliant {{The format string might be wrong, the following arguments are unused: 'arg1'.}}\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StringFormatValidator.TypoFree.cs",
    "content": "﻿using System;\nusing System.Globalization;\n\npublic class StringFormatValidatorTypoFree\n{\n    void Test()\n    {\n        string arg0 = string.Empty;\n        string arg1 = string.Empty;\n        string arg2 = string.Empty;\n\n        var s = string.Format(\"some text\"); // Noncompliant {{Remove this formatting call and simply use the input string.}}\n//              ^^^^^^^^^^^^^\n        s = string.Format(null, 42);                //Noncompliant {{Invalid string format, the format string cannot be null.}}\n        s = string.Format(string.Format(\"foo\"));    //Noncompliant\n        s = string.Format(string.Format(\"{0}\", 42));\n\n        s = string.Format(\"{0}\", 1);\n        s = string.Format(CultureInfo.InvariantCulture, \"{0}\", 3);\n        s = string.Format(CultureInfo.InvariantCulture, \"some text\"); //Noncompliant\n        s = string.Format(format: \"some text\"); //Noncompliant\n        s = string.Format(format: \"{0}\", arg0: 1);\n\n        s = string.Format(\"{0}\", arg0, arg1); // Noncompliant {{The format string might be wrong, the following arguments are unused: 'arg1'.}}\n        s = string.Format(\"{0}\", arg0, arg1, arg2); // Noncompliant {{The format string might be wrong, the following arguments are unused: 'arg1' and 'arg2'.}}\n\n        s = string.Format(\"{0} {2}\", arg0, arg1, arg2); // Noncompliant {{The format string might be wrong, the following item indexes are missing: '1'.}}\n    }\n\n    void System_Console_Write(string[] args)\n    {\n        Console.Write(\"0\"); // Compliant\n        Console.Write(\"{0}\", 42);\n        Console.Write(\"0\", 25); // Noncompliant\n\n        Console.Write(\"{0}\", args[0], args[1]); // Noncompliant\n//      ^^^^^^^^^^^^^\n        Console.Write(\"{2}\", 1, 2, 3); // Noncompliant\n    }\n\n    void System_Console_WriteLine(string[] args)\n    {\n        Console.WriteLine(\"0\"); // Compliant\n        Console.WriteLine(\"{0}\", 42);\n\n        Console.WriteLine(\"{0}\", args[0], args[1]); // Noncompliant\n//      ^^^^^^^^^^^^^^^^^\n        Console.WriteLine(\"{2}\", 1, 2, 3); // Noncompliant\n    }\n\n    void System_Text_StringBuilder_AppendFormat(string[] args)\n    {\n        var sb = new System.Text.StringBuilder();\n        sb.AppendFormat(\"0\"); // Noncompliant\n        sb.AppendFormat(\"{0}\", 42);\n\n        sb.AppendFormat(\"{0}\", args[0], args[1]); // Noncompliant\n//      ^^^^^^^^^^^^^^^\n        sb.AppendFormat(\"{2}\", 1, 2, 3); // Noncompliant\n    }\n\n    void System_IO_TextWriter_Write(string[] args)\n    {\n        var tw = System.IO.File.CreateText(\"C:\\\\perl.txt\");\n        tw.Write(\"0\"); // Compliant\n        tw.Write(\"{0}\", 42);\n\n        tw.Write(\"{0}\", args[0], args[1]); // Noncompliant\n//      ^^^^^^^^\n        tw.Write(\"{2}\", 1, 2, 3); // Noncompliant\n    }\n\n    void System_IO_TextWriter_WriteLine(string[] args)\n    {\n        var tw = System.IO.File.CreateText(\"C:\\\\perl.txt\");\n\n        tw.WriteLine(\"0\"); // Compliant\n        tw.WriteLine(\"{0}\", 42);\n\n        tw.WriteLine(\"{0}\", args[0], args[1]); // Noncompliant\n//      ^^^^^^^^^^^^\n        tw.WriteLine(\"{2}\", 1, 2, 3); // Noncompliant\n    }\n\n    void System_Diagnostics_Debug_WriteLine(string[] args)\n    {\n        System.Diagnostics.Debug.WriteLine(\"0\"); // Compliant\n        System.Diagnostics.Debug.WriteLine(\"{0}\", 42);\n\n        System.Diagnostics.Debug.WriteLine(\"{0}\", args[0], args[1]); // Noncompliant\n//      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        System.Diagnostics.Debug.WriteLine(\"{2}\", 1, 2, 3); // Noncompliant\n    }\n\n    void System_Diagnostics_Trace_TraceError(string[] args)\n    {\n        System.Diagnostics.Trace.TraceError(\"0\"); // Compliant\n        System.Diagnostics.Trace.TraceError(\"{0}\", 42);\n\n        System.Diagnostics.Trace.TraceError(\"{0}\", args[0], args[1]); // Noncompliant\n//      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        System.Diagnostics.Trace.TraceError(\"{2}\", 1, 2, 3); // Noncompliant\n    }\n\n    void System_Diagnostics_Trace_TraceInformation(string[] args)\n    {\n        System.Diagnostics.Trace.TraceInformation(\"0\"); // Compliant\n        System.Diagnostics.Trace.TraceInformation(\"{0}\", 42);\n\n        System.Diagnostics.Trace.TraceInformation(\"{0}\", args[0], args[1]); // Noncompliant\n//      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        System.Diagnostics.Trace.TraceInformation(\"{2}\", 1, 2, 3); // Noncompliant\n    }\n\n    void System_Diagnostics_Trace_TraceWarning(string[] args)\n    {\n        System.Diagnostics.Trace.TraceWarning(\"0\"); // Compliant\n        System.Diagnostics.Trace.TraceWarning(\"{0}\", 42);\n\n        System.Diagnostics.Trace.TraceWarning(\"{0}\", args[0], args[1]); // Noncompliant\n//      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        System.Diagnostics.Trace.TraceWarning(\"{2}\", 1, 2, 3); // Noncompliant\n    }\n\n    void System_Diagnostics_TraceSource_TraceInformation(string[] args)\n    {\n        var ts = new System.Diagnostics.TraceSource(\"TraceTest\");\n        ts.TraceInformation(\"0\"); // Compliant\n        ts.TraceInformation(\"{0}\", 42);\n\n        ts.TraceInformation(\"{0}\", args[0], args[1]); // Noncompliant\n//      ^^^^^^^^^^^^^^^^^^^\n        ts.TraceInformation(\"{2}\", 1, 2, 3); // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StringLiteralShouldNotBeDuplicated.Dapper.cs",
    "content": "using Dapper;\nusing System.Data.SqlClient;\n\n// https://sonarsource.atlassian.net/browse/NET-1565\npublic class RepeatedParameterNamesInDatabase\n{\n    public void ExecuteSqlCommandsForUsers(SqlConnection connection)\n    {\n        var query = \"SELECT * FROM Users WHERE Name = @name\";\n        var param = new DynamicParameters();\n        param.Add(\"@name\", \"John Doe\");                     // Compliant - Name refers to parameters in different SQL tables.\n        var result = connection.Query<User>(query, param);  // Renaming one does not necessitate renaming of parameters with the same name from other tables.\n    }\n\n    public void ExecuteSqlCommandsForCompanies(SqlConnection connection)\n    {\n        var query = \"SELECT * FROM Companies WHERE Name = @name\";\n        var param = new DynamicParameters();\n        param.Add(\"@name\", \"Constosco\");                    // Compliant\n        var result = connection.Query<Company>(query, param);\n    }\n\n    public void ExecuteSqlCommandsForProducts(SqlConnection connection)\n    {\n        var query = \"SELECT * FROM Companies WHERE Name = @name\";\n        var param = new DynamicParameters();\n        param.Add(\"@name\", \"CleanBot 9000\");                // Compliant\n        var result = connection.Query<Product>(query, param);\n    }\n\n    public void ExecuteSqlCommandsForCountries(SqlConnection connection)\n    {\n        var query = \"SELECT * FROM Countries WHERE Name = @name\";\n        var param = new DynamicParameters();\n        param.Add(\"@name\", \"Norway\");                       // Compliant\n        var result = connection.Query<Country>(query, param);\n    }\n\n    public class Product { }\n    public class Country { }\n    public class Company { }\n    public class User { }\n}\n\npublic class FN\n{\n    // FN - \"@name\" is used as an exception parameter name, not as a Dapper SQL parameter.\n    // The current implementation suppresses all @-prefixed strings when Dapper is present.\n    public void A() => throw new System.ArgumentException(\"Invalid argument.\", \"@name\"); // FN\n\n    // FN - \"@name\" is used as a value argument to DynamicParameters.Add (not as the SQL parameter name).\n    public void NameIsValueArgument(SqlConnection connection)\n    {\n        var param = new DynamicParameters();\n        param.Add(\"@other\", \"@name\");   // FN\n        connection.Query<User>(\"SELECT * FROM Users WHERE Other = @other\", param);\n    }\n\n    public void UsedInMethodSecondTime(SqlConnection connection)\n    {\n        var param = new DynamicParameters();\n        param.Add(\"@other\", \"@name\");   // FN\n        connection.Query<Company>(\"SELECT * FROM Companies WHERE Other = @other\", param);\n    }\n\n    public void UsedInMethodThirdTime(SqlConnection connection)\n    {\n        var param = new DynamicParameters();\n        param.Add(\"@other\", \"@name\");   // FN\n        connection.Query<Product>(\"SELECT * FROM Products WHERE Other = @other\", param);\n    }\n\n    public class User { }\n    public class Company { }\n    public class Product { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StringLiteralShouldNotBeDuplicated.Dapper.vb",
    "content": "Imports Dapper\nImports System.Data.SqlClient\n\n' https://sonarsource.atlassian.net/browse/NET-1565\nPublic Class RepeatedParameterNamesInDatabase\n    Public Sub ExecuteSqlCommandsForUsers(connection As SqlConnection)\n        Dim query = \"SELECT * FROM Users WHERE Name = @name\"\n        Dim param = New DynamicParameters()\n        param.Add(\"@name\", \"John Doe\")                          ' Compliant\n        Dim result = connection.Query(Of User)(query, param)\n    End Sub\n\n    Public Sub ExecuteSqlCommandsForCompanies(connection As SqlConnection)\n        Dim query = \"SELECT * FROM Companies WHERE Name = @name\"\n        Dim param = New DynamicParameters()\n        param.Add(\"@name\", \"Constosco\")                         ' Compliant\n        Dim result = connection.Query(Of Company)(query, param)\n    End Sub\n\n    Public Sub ExecuteSqlCommandsForProducts(connection As SqlConnection)\n        Dim query = \"SELECT * FROM Companies WHERE Name = @name\"\n        Dim param = New DynamicParameters()\n        param.Add(\"@name\", \"CleanBot 9000\")                     ' Compliant\n        Dim result = connection.Query(Of Product)(query, param)\n    End Sub\n\n    Public Sub ExecuteSqlCommandsForCountries(connection As SqlConnection)\n        Dim query = \"SELECT * FROM Countries WHERE Name = @name\"\n        Dim param = New DynamicParameters()\n        param.Add(\"@name\", \"Norway\")                            ' Compliant\n        Dim result = connection.Query(Of Country)(query, param)\n    End Sub\n\n    Public Class Product\n    End Class\n    Public Class Country\n    End Class\n    Public Class Company\n    End Class\n    Public Class User\n    End Class\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StringLiteralShouldNotBeDuplicated.Latest.cs",
    "content": "﻿using System.Diagnostics;\nusing Microsoft.EntityFrameworkCore.Migrations;\n\nnamespace CSharp9\n{\n    record Record\n    {\n        private string name = \"csharp9\"; // Noncompliant {{Define a constant instead of using this literal 'csharp9' 11 times.}}\n        //                    ^^^^^^^^^\n\n        public static readonly string NameReadonly = \"csharp9\";\n        //                                           ^^^^^^^^^ Secondary\n\n        string Name { get; } = \"csharp9\";\n        //                     ^^^^^^^^^ Secondary\n\n        void Method()\n        {\n            var x = \"csharp9\";\n            //      ^^^^^^^^^ Secondary\n\n            void NestedMethod()\n            {\n                var y = \"csharp9\";\n                //      ^^^^^^^^^ Secondary\n            }\n        }\n\n        [DebuggerDisplay(\"csharp9\", Name = \"csharp9\", TargetTypeName = \"csharp9\")] // Compliant - in attribute -> ignored\n        record InnerRecord\n        {\n            private string name = \"csharp9\";\n            //                    ^^^^^^^^^ Secondary\n\n            public static readonly string NameReadonly = \"csharp9\";\n            //                                           ^^^^^^^^^ Secondary\n\n            string Name { get; } = \"csharp9\";\n            //                     ^^^^^^^^^ Secondary\n\n            void Method()\n            {\n                var x = \"csharp9\";\n                //      ^^^^^^^^^ Secondary\n\n                [Conditional(\"DEBUG\")] // Compliant - in attribute -> ignored\n                static void NestedMethod()\n                {\n                    var y = \"csharp9\";\n                    //      ^^^^^^^^^ Secondary\n                }\n            }\n        }\n\n        record PositionalRecord(string Name)\n        {\n            private string name = \"csharp9\";\n            //                    ^^^^^^^^^ Secondary\n        }\n    }\n}\n\nnamespace CSharp10\n{\n    record struct RecordStruct\n    {\n        public RecordStruct() { }\n\n        private string name = \"csharp10\"; // Noncompliant\n\n        public static readonly string NameReadonly = \"csharp10\";\n        //                                           ^^^^^^^^^^ Secondary\n\n        string Name { get; } = \"csharp10\";\n        //                     ^^^^^^^^^^ Secondary\n\n        void Method()\n        {\n            var x = \"csharp10\";\n            //      ^^^^^^^^^^ Secondary\n            void NestedMethod()\n            {\n                var y = \"csharp10\";\n                //      ^^^^^^^^^^ Secondary\n            }\n        }\n\n        [DebuggerDisplay(\"csharp10\", Name = \"csharp10\", TargetTypeName = \"csharp10\")] // Compliant - in attribute -> ignored\n        record struct InnerRecordStruct\n        {\n            public InnerRecordStruct() { }\n\n            private string name = \"csharp10\";\n            //                    ^^^^^^^^^^ Secondary\n\n            public static readonly string NameReadonly = \"csharp10\"; // Secondary\n\n            string Name { get; } = \"csharp10\"; // Secondary\n\n            void Method()\n            {\n                var x = \"csharp10\"; // Secondary\n\n                [Conditional(\"foobar\")] // Compliant - in attribute -> ignored\n                static void NestedMethod()\n                {\n                    var y = \"csharp10\"; // Secondary\n                }\n            }\n        }\n\n        record struct PositionalRecordStruct(string Name)\n        {\n            private string name = \"csharp10\";\n            //                    ^^^^^^^^^^ Secondary\n        }\n    }\n}\n\nnamespace CSharp11\n{\n    public class FooNonCompliant\n    {\n        private string NameOne = \"\"\"csharp11\"\"\"; // Noncompliant {{Define a constant instead of using this literal '\"\"csharp11\"\"' 4 times.}}\n\n        private string NameTwo = \"\"\"csharp11\"\"\"; // Secondary\n\n        public const string NameConst = \"\"\"csharp11\"\"\"; // Secondary\n\n        public static readonly string NameReadonly = \"\"\"csharp11\"\"\"; // Secondary\n\n    }\n\n    public class FooLessThanFiveCharacters\n    {\n        private string NameOne = \"\"\"fo\"\"\"; // Compliant (less than 5 characters)\n\n        private string NameTwo = \"\"\"fo\"\"\";\n\n        public const string NameConst = \"\"\"fo\"\"\";\n\n        public static readonly string NameReadonly = \"\"\"fo\"\"\";\n    }\n\n    public class FooNonCompliantStringInterpolation\n    {\n        public string NameOne = $\"{\"BarBar\" // Noncompliant {{Define a constant instead of using this literal 'BarBar' 4 times.}}\n            }\";\n\n        public string NameTwo = $\"{\"BarBar\" // Secondary\n            }\";\n\n        public static string NameThree = \"BarBar\"; // Secondary\n\n        public static readonly string NameReadonly = $\"{\"BarBar\"}\"; // Secondary\n\n    }\n}\n\n// https://sonarsource.atlassian.net/browse/NET-2276\npublic class EfCoreMigration : Migration\n{\n    protected override void Up(MigrationBuilder migrationBuilder)\n    {\n        migrationBuilder.DropIndex(\n            name: \"IX_CustomerOrders_OldStatus\",\n            table: \"CustomerOrders\");\n\n        migrationBuilder.RenameColumn(\n            name: \"OldStatus\",\n            table: \"CustomerOrders\",\n            newName: \"Status\");\n\n        migrationBuilder.CreateIndex(\n            name: \"IX_CustomerOrders_Status\",\n            table: \"CustomerOrders\",\n            column: \"Status\");\n    }\n\n    protected override void Down(MigrationBuilder migrationBuilder)\n    {\n        migrationBuilder.DropIndex(\n            name: \"IX_CustomerOrders_Status\",\n            table: \"CustomerOrders\");\n\n        migrationBuilder.RenameColumn(\n            name: \"Status\",\n            table: \"CustomerOrders\",\n            newName: \"OldStatus\");\n\n        migrationBuilder.CreateIndex(\n            name: \"IX_CustomerOrders_OldStatus\",\n            table: \"CustomerOrders\",\n            column: \"OldStatus\");\n    }\n}\n\nnamespace CSharp13\n{\n    class EscapeSequence\n    {\n        private string backslash = \"Filename\\u001B\" // Noncompliant\n                + \"Filename\\e\"                      // Secondary\n                + \"Filename\\u001b\"                  // Secondary\n                + \"Filename\\e\";                     // Secondary\n    }\n\n    partial class PartialClass\n    {\n        private string some = \"csharp13\";           // FN NET-3597\n        public partial string Hello => \"csharp13\";\n        public partial string World { get; }\n    }\n\n    partial class PartialClass\n    {\n        private const string name = \"csharp13\";\n        public partial string Hello { get; }\n        public partial string World => \"csharp13\";\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StringLiteralShouldNotBeDuplicated.Partial.cs",
    "content": "﻿namespace Tests.Diagnostics\n{\n    partial class PartialClassCrossFileFN\n    {\n        private string c = \"crossfile\"; // FN: NET-3597\n        private string d = \"crossfile\";\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StringLiteralShouldNotBeDuplicated.WithTopLevelStatements.cs",
    "content": "﻿using System.Diagnostics;\n\nstring compliant = \"compliant\";\n// equivalent to args argument of the top level file\nstring compliant1 = \"args\";\nstring compliant2 = \"args\";\nstring compliant3 = \"args\";\n\nstring noncompliant = \"foobar\"; // Noncompliant\n\nvar x = \"foobar\";\n//      ^^^^^^^^ Secondary\n\nrecord Record\n{\n    private string name = \"foobar\";\n//                        ^^^^^^^^ Secondary\n\n    public static readonly string NameReadonly = \"foobar\";\n//                                               ^^^^^^^^ Secondary\n\n    string Name { get; } = \"foobar\";\n//                         ^^^^^^^^ Secondary\n\n    void Method()\n    {\n        var x = \"foobar\";\n//              ^^^^^^^^ Secondary\n\n        void NestedMethod()\n        {\n            var y = \"foobar\";\n//                  ^^^^^^^^ Secondary\n        }\n    }\n\n    [DebuggerDisplay(\"foobar\", Name = \"foobar\", TargetTypeName = \"foobar\")] // Compliant - in attribute -> ignored\n    record InnerRecord\n    {\n        private string name = \"foobar\";\n//                            ^^^^^^^^ Secondary\n\n        public static readonly string NameReadonly = \"foobar\";\n//                                                   ^^^^^^^^ Secondary\n\n        string Name { get; } = \"foobar\";\n//                             ^^^^^^^^ Secondary\n\n        void Method()\n        {\n            var x = \"foobar\";\n//                  ^^^^^^^^ Secondary\n\n            [Conditional(\"DEBUG\")] // Compliant - in attribute -> ignored\n            static void NestedMethod()\n            {\n                var y = \"foobar\";\n//                      ^^^^^^^^ Secondary\n            }\n        }\n    }\n\n    record PositionalRecord(string Name)\n    {\n        private string name = \"foobar\";\n//                            ^^^^^^^^ Secondary\n    }\n}\n\npartial class PartialInTopLevelStatementsFile\n{\n    private string a = \"duplicate\"; // Noncompliant {{Define a constant instead of using this literal 'duplicate' 4 times.}}\n    private string b = \"duplicate\"; // Secondary\n}\n\npartial class PartialInTopLevelStatementsFile\n{\n    private string c = \"duplicate\"; // Secondary\n    private string d = \"duplicate\"; // Secondary\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StringLiteralShouldNotBeDuplicated.cs",
    "content": "﻿using System.Data.Entity.Migrations;\n\n// https://sonarsource.atlassian.net/browse/NET-2276\npublic class EfClassicMigration : DbMigration\n{\n    public override void Up()\n    {\n        AddColumn(\"dbo.Invoices\", \"Description\", c => c.String(maxLength: 500));\n        AddColumn(\"dbo.Invoices\", \"CategoryName\", c => c.String(maxLength: 100));\n        AddColumn(\"dbo.Invoices\", \"SupplierCode\", c => c.String(maxLength: 50));\n        AddColumn(\"dbo.Invoices\", \"TrackingCode\", c => c.String(maxLength: 50));\n    }\n\n    public override void Down()\n    {\n        DropColumn(\"dbo.Invoices\", \"TrackingCode\");\n        DropColumn(\"dbo.Invoices\", \"SupplierCode\");\n        DropColumn(\"dbo.Invoices\", \"CategoryName\");\n        DropColumn(\"dbo.Invoices\", \"Description\");\n    }\n}\n\nnamespace Tests.Diagnostics\n{\n    public class Program\n    {\n        private string empty = \"\";\n\n        public const string NameConst = \"foobar\"; // Noncompliant {{Define a constant instead of using this literal 'foobar' 8 times.}}\n        //                              ^^^^^^^^\n        public static readonly string NameReadonly = \"foobar\";\n        //                                           ^^^^^^^^ Secondary\n\n\n        private string name = \"foobar\";\n        //                    ^^^^^^^^ Secondary\n\n        private string[] values = new[] { \"something\", \"something\", \"something\" }; // Compliant - repetition below threshold\n\n        private string Name { get; } = \"foobar\";\n        //                             ^^^^^^^^ Secondary\n\n        public Program()\n        {\n            var x = \"foobar\";\n            //      ^^^^^^^^ Secondary\n\n            var y = \"FooBar\"; // Compliant - casing is different\n        }\n\n        public void Do(string s = \"foobar\")\n        //                        ^^^^^^^^ Secondary\n        {\n            var x = s ?? \"foobar\";\n            //           ^^^^^^^^ Secondary\n\n            string GetFooBar()\n            {\n                return \"foobar\";\n                //     ^^^^^^^^ Secondary\n            }\n        }\n\n        public void Validate(object foobar)\n        {\n            if (foobar == null)\n            {\n                throw new System.ArgumentNullException(\"foobar\"); // Compliant - matches one of the parameter name\n            }\n\n            Do(\"foobar\"); // Compliant - matches one of the parameter name\n        }\n    }\n\n    public class OuterClass\n    {\n        private string Name { get; } = \"foobar\"; // Noncompliant\n\n        private class InnerClass\n        {\n            private string name1 = \"foobar\"; // Secondary - inner class count with base\n            private string name2 = \"foobar\"; // Secondary\n            private string name3 = \"foobar\"; // Secondary\n            private string name4 = \"foobar\"; // Secondary\n        }\n\n        private struct InnerStruct\n        {\n            private string name1;\n            private string name2;\n            private string name3;\n            private string name4;\n\n            public InnerStruct(string s)\n            {\n                name1 = \"foobar\"; // Secondary - inner struct count with base\n                name2 = \"foobar\"; // Secondary\n                name3 = \"foobar\"; // Secondary\n                name4 = \"foobar\"; // Secondary\n            }\n        }\n    }\n\n    public struct OuterStruct\n    {\n        private string Name;\n        public OuterStruct(string s)\n        {\n            Name = \"foobar\"; // Noncompliant\n        }\n\n        private struct InnerStruct\n        {\n            private string name1;\n            private string name2;\n            private string name3;\n            private string name4;\n\n            public InnerStruct(string s)\n            {\n                name1 = \"foobar\"; // Secondary - inner struct count with base\n                name2 = \"foobar\"; // Secondary\n                name3 = \"foobar\"; // Secondary\n                name4 = \"foobar\"; // Secondary\n            }\n        }\n    }\n\n    public class SpecialChar\n    {\n        // See https://github.com/SonarSource/sonar-dotnet/issues/2191\n        private string ZZ_TRANS_PACKED_0 =\n            \"\\x0001\\u0124\\x0001\\x0000\\x0001\\u0125\\x0002\\x0000\\x0001\\u0126\\x0001\\x0000\\x0001\\u0127\\x0005\\x0000\" + // Noncompliant {{Define a constant instead of using this literal '\\x0001\\u0124\\x0001\\x0000\\x0001\\u0125\\x0002\\x0000\\x0001\\u0126\\x0001\\x0000\\x0001\\u0127\\x0005\\x0000' 4 times.}}\n            \"\\x0001\\u0124\\x0001\\x0000\\x0001\\u0125\\x0002\\x0000\\x0001\\u0126\\x0001\\x0000\\x0001\\u0127\\x0005\\x0000\" + // Secondary\n            \"\\x0001\\u0124\\x0001\\x0000\\x0001\\u0125\\x0002\\x0000\\x0001\\u0126\\x0001\\x0000\\x0001\\u0127\\x0005\\x0000\" + // Secondary\n            \"\\x0001\\u0124\\x0001\\x0000\\x0001\\u0125\\x0002\\x0000\\x0001\\u0126\\x0001\\x0000\\x0001\\u0127\\x0005\\x0000\";  // Secondary\n\n        private string someString = @\"cheese\" // Noncompliant\n            + \"cheese\"      // Secondary\n            + \"cheese\"      // Secondary\n            + @\"cheese\";    // Secondary\n\n        private string backslash = \"Filename\\\\\" // Noncompliant\n            + @\"Filename\\\"                      // Secondary\n            + \"Filename\\x005C\"                  // Secondary\n            + \"Filename\\x005C\";                 // Secondary\n\n        private string doubleQuotes = \"Say \\\"hello\\\"\" // Noncompliant {{Define a constant instead of using this literal 'Say \\\"hello\\\"' 4 times.}}\n            + @\"Say \"\"hello\"\"\"                        // Secondary\n            + \"Say \\x0022hello\\x0022\"                 // Secondary\n            + \"Say \\\"hello\\\"\";                        // Secondary\n    }\n\n    partial class PartialClassSameFile\n    {\n        private string a = \"partialclass\";  // FN: NET-3597\n        private string b = \"partialclass\";\n    }\n\n    partial class PartialClassSameFile\n    {\n        private string c = \"partialclass\";\n        private string d = \"partialclass\";\n    }\n\n    partial class PartialClassCrossFileFN\n    {\n        private string a = \"crossfile\";     // FN: NET-3597\n        private string b = \"crossfile\";\n    }\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StringLiteralShouldNotBeDuplicated.vb",
    "content": "﻿Namespace Tests.TestCases\n\n    Public Class Program\n\n        Private empty As String = \"\"\n\n        Public Const NameConst As String = \"foobar\" ' Noncompliant {{Define a constant instead of using this literal 'foobar' 7 times.}}\n        '                                  ^^^^^^^^\n        Public ReadOnly NameReadonly As String = \"foobar\"\n        '                                        ^^^^^^^^ Secondary\n\n        Private name As String = \"foobar\"\n        '                        ^^^^^^^^ Secondary\n\n        Private values As String() = {\"something\", \"something\", \"something\"} ' Compliant - repetition below threshold\n\n        Private ReadOnly Property FirstName = \"foobar\"\n        '                                     ^^^^^^^^ Secondary\n\n        Public Sub New()\n\n            Dim x As String = \"foobar\"\n            '                 ^^^^^^^^ Secondary\n\n            Dim y As String = \"FooBar\" ' Compliant - casing Is different\n\n        End Sub\n\n        Public Sub DoSomething(Optional s As String = \"foobar\")\n            '                                         ^^^^^^^^ Secondary\n            Dim x As String = If(s, \"foobar\")\n            '                       ^^^^^^^^ Secondary\n        End Sub\n\n        Public Sub Validate(fOobAR As Object)\n            If fOobAR Is Nothing Then Throw New System.ArgumentNullException(\"foobar\") ' Compliant - matches one of the parameter name\n\n            DoSomething(\"foobar\") ' Compliant - matches one of the parameter name\n\n        End Sub\n\n    End Class\n\n    Public Class OuterClass\n\n        Private ReadOnly Property Name As String = \"foobar\" ' Noncompliant\n\n        Private Class InnerClass\n\n            Private name1 As String = \"foobar\" ' Secondary - inner class count with base\n            Private name2 As String = \"foobar\" ' Secondary\n            Private name3 As String = \"foobar\" ' Secondary\n            Private name4 As String = \"foobar\" ' Secondary\n\n        End Class\n\n        Private Structure InnerStruct\n\n            Private name1 As String\n            Private name2 As String\n            Private name3 As String\n            Private name4 As String\n\n            Public Sub New(s As String)\n\n                name1 = \"foobar\" ' Secondary - inner struct count with base\n                name2 = \"foobar\" ' Secondary\n                name3 = \"foobar\" ' Secondary\n                name4 = \"foobar\" ' Secondary\n\n            End Sub\n\n        End Structure\n\n    End Class\n\n    Public Structure OuterStruct\n\n        Private Name As String\n        Public Sub New(s As String)\n\n            Name = \"foobar\" ' Noncompliant\n\n        End Sub\n\n        Private Structure InnerStruct\n\n            Private name1 As String\n            Private name2 As String\n            Private name3 As String\n            Private name4 As String\n\n            Public Sub New(s As String)\n                name1 = \"foobar\" ' Secondary - inner struct count with base\n                name2 = \"foobar\" ' Secondary\n                name3 = \"foobar\" ' Secondary\n                name4 = \"foobar\" ' Secondary\n            End Sub\n\n        End Structure\n\n    End Structure\n\n    Public Class SpecialChars\n        Private someString1 As String = \"Say \"\"Hello\"\"\" ' Noncompliant {{Define a constant instead of using this literal 'Say \"\"Hello\"\"' 4 times.}}\n        Private someString2 As String = \"Say \"\"Hello\"\"\" ' Secondary\n        Private someString3 As String = \"Say \"\"Hello\"\"\" ' Secondary\n        Private someString4 As String = \"Say \"\"Hello\"\"\" ' Secondary\n    End Class\n\nEnd Namespace\n\n' https://github.com/SonarSource/sonar-dotnet/issues/9569\nNamespace SqlNamedParameters\n    Public Class Program\n        Public Sub ExecuteSqlCommands()\n            Dim userCommand = New SqlCommand(\"SELECT * FROM Users WHERE Name = @Name\")\n            userCommand.AddParameter(New SqlParameter(\"@Name\", \"John Doe\"))                    ' Noncompliant - FP: Name refers to parameters in different SQL tables.\n            Dim users = userCommand.ExecuteQuery()                                             ' Renaming one does not necessitate renaming of parameters with the same name from other tables.\n\n            Dim companyCommand = New SqlCommand(\"SELECT * FROM Companies WHERE Name = @Name\")\n            companyCommand.AddParameter(New SqlParameter(\"@Name\", \"Contosco\"))                 ' Secondary - FP\n            Dim companies = companyCommand.ExecuteQuery()\n\n            Dim productCommand = New SqlCommand(\"SELECT * FROM Products WHERE Name = @Name\")\n            productCommand.AddParameter(New SqlParameter(\"@Name\", \"CleanBot 9000\"))            ' Secondary - FP\n            Dim products = productCommand.ExecuteQuery()\n\n            Dim countryCommand = New SqlCommand(\"SELECT * FROM Countries WHERE Name = @Name\")\n            countryCommand.AddParameter(New SqlParameter(\"@Name\", \"Norway\"))                   ' Secondary - FP\n            Dim countries = countryCommand.ExecuteQuery()\n        End Sub\n    End Class\n\n    Public Class SqlCommand\n        Public ReadOnly Property CommandText As String\n        Public Sub New(commandText As String)\n            Me.CommandText = commandText\n        End Sub\n\n        Public Sub AddParameter(parameter As SqlParameter)\n        End Sub\n\n        Public Function ExecuteQuery() As Object\n            Return Nothing\n        End Function\n    End Class\n\n    Public Class SqlParameter\n        Public ReadOnly Property Name As String\n        Public ReadOnly Property Value As String\n        Public Sub New(name As String, value As String)\n            Me.Name = name\n            Me.Value = value\n        End Sub\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StringLiteralShouldNotBeDuplicated_Attributes.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.Diagnostics.CodeAnalysis;\n\n// Issue #1419 - false positive in S1192 - shouldn't look at string in attributes\n// https://github.com/SonarSource/sonar-dotnet/issues/1419\n\n// compliant - outside class and in attribute -> ignored\n[assembly: DebuggerDisplay(\"foo\", Name = \"foo\", TargetTypeName = \"foo\")]\n\nnamespace Tests.Diagnostics\n{\n    public class ConstantsInAttributesShouldBeIgnored\n    {\n        [SuppressMessage(\"Microsoft.Design\", \"CA1024:UsePropertiesWhereAppropriate\")] // Compliant - ignored completely\n        private string field1;\n\n        [SuppressMessage(\"Microsoft.Design\", \"CA1024:UsePropertiesWhereAppropriate\")]\n        private string field2;\n\n        [SuppressMessage(\"Microsoft.Design\", \"CA1024:UsePropertiesWhereAppropriate\")]\n        private string field3;\n\n        // Compliant - repetition below threshold - string in attributes are not counted\n        private string[] values = new[] { \"Microsoft.Design\", \"Microsoft.Design\" };\n\n        // nonCompliant - repetition above threshold. String in attributes should not be highlighted\n        private string[] values2 = new[] { \"CA1024:UsePropertiesWhereAppropriate\",  // Noncompliant {{Define a constant instead of using this literal 'CA1024:UsePropertiesWhereAppropriate' 3 times.}}\n            \"CA1024:UsePropertiesWhereAppropriate\",                                 // Secondary\n            \"CA1024:UsePropertiesWhereAppropriate\" };                               // Secondary\n    }\n\n    [DebuggerDisplay(\"12345\", Name = \"12345\", TargetTypeName = \"12345\")] // Compliant - in attribute -> ignored\n    public class Class1\n    {\n        [DebuggerDisplay(\"12345\", Name = \"12345\", TargetTypeName = \"12345\")]\n        string field1 = \"12345\"; // Noncompliant {{Define a constant instead of using this literal '12345' 4 times.}}\n\n        [DebuggerDisplay(\"12345\", Name = \"12345\", TargetTypeName = \"12345\")]\n        private string Name { get; } = \"12345\";\n//                                     ^^^^^^^ Secondary\n\n        [DebuggerStepThrough]\n        public bool DoStuff(string arg = \"12345\")\n//                                       ^^^^^^^ Secondary\n        {\n            if (arg == \"12345\")\n//                     ^^^^^^^ Secondary\n            {\n                return true;\n            }\n            return false;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StringLiteralShouldNotBeDuplicated_Attributes.vb",
    "content": "﻿Imports System\nImports System.Diagnostics\nImports System.Diagnostics.CodeAnalysis\n\n' compliant - outside class and in attribute -> ignored\n<Assembly: DebuggerDisplay(\"foo\", Name:=\"foo\", TargetTypeName:=\"foo\")>\n\nNamespace Tests.Diagnostics\n    Public Class ConstantsInAttributesShouldBeIgnored\n        <SuppressMessage(\"Microsoft.Design\", \"CA1024:UsePropertiesWhereAppropriate\")> ' Compliant - ignored completely\n        Private field1 As String\n\n        <SuppressMessage(\"Microsoft.Design\", \"CA1024:UsePropertiesWhereAppropriate\")>\n        Private field2 As String\n\n        <SuppressMessage(\"Microsoft.Design\", \"CA1024:UsePropertiesWhereAppropriate\")>\n        Private field3 As String\n\n        ' Compliant - repetition below threshold - string in attributes are not counted\n        Private values As String() = { \"Microsoft.Design\", \"Microsoft.Design\" }\n\n        ' nonCompliant - repetition above threshold. String in attributes should not be highlighted\n        Private values2 As String() = { \"CA1024:UsePropertiesWhereAppropriate\", ' Noncompliant {{Define a constant instead of using this literal 'CA1024:UsePropertiesWhereAppropriate' 3 times.}}\n            \"CA1024:UsePropertiesWhereAppropriate\",                             ' Secondary\n            \"CA1024:UsePropertiesWhereAppropriate\" }                            ' Secondary\n\n    End Class\n    \n    <DebuggerDisplay(\"12345\", Name := \"12345\", TargetTypeName := \"12345\")> ' Compliant - in attribute -> ignored\n    Public Class Class1\n\n        <DebuggerDisplay(\"12345\", Name := \"12345\", TargetTypeName := \"12345\")>\n        Private field1 As String = \"12345\" ' Noncompliant {{Define a constant instead of using this literal '12345' 4 times.}}\n\n        <DebuggerDisplay(\"12345\", Name := \"12345\", TargetTypeName := \"12345\")>\n        Private ReadOnly Property Name As String = \"12345\"\n        '                                          ^^^^^^^ Secondary\n\n        <DebuggerStepThrough>\n        Public Function DoStuff(Optional arg As String = \"12345\")\n        '                                                ^^^^^^^ Secondary\n            If arg = \"12345\" Then\n        '            ^^^^^^^ Secondary\n                Return True\n            End If\n\n            Return False\n\n        End Function\n\n    End Class\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StringOffsetMethods.Latest.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class StringOffsetMethods\n    {\n        public StringOffsetMethods()\n        {\n            \"\"\"Test\"\"\".Substring(1).IndexOf('t'); // Noncompliant {{Replace 'IndexOf' with the overload that accepts a startIndex parameter.}}\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StringOffsetMethods.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class StringOffsetMethods\n    {\n        public StringOffsetMethods()\n        {\n            \"Test\".Substring(1).IndexOf('t'); // Noncompliant {{Replace 'IndexOf' with the overload that accepts a startIndex parameter.}}\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        }\n\n        public int GetIndex =>\n            \"Test\".Substring(1).IndexOf('t'); // Noncompliant\n\n        public void StringOffsetMethodsCases(string x)\n        {\n            \"Test\".Substring(1);\n\n            \"Test\".IndexOf('t');\n            \"Test\".IndexOf('t', 1);\n            \"Test\".IndexOf(\"es\");\n            \"Test\".IndexOf(\"es\", 1);\n            \"Test\".IndexOf(\"es\", 1, StringComparison.InvariantCulture);\n            \"Test\".Substring(1).IndexOf('t'); // Noncompliant\n            \"Test\".Substring(1).IndexOf(\"t\"); // Noncompliant\n            \"Test\".Substring(1).IndexOf(\"t\", 1); // Noncompliant\n            \"Test\".Substring(1).IndexOf(\"t\", StringComparison.InvariantCulture); // Noncompliant\n            \"Test\".Substring(1).IndexOf('t', 1, 3); // Noncompliant\n            \"Test\".Substring(1).IndexOf(\"t\", 1, 3); // Noncompliant\n            \"Test\".Substring(1).IndexOf(\"t\", 1, StringComparison.CurrentCulture); // Noncompliant\n            \"Test\".Substring(1).IndexOf(\"t\", 1, 3, StringComparison.CurrentCulture); // Noncompliant\n\n            \"Test\".IndexOfAny(new[] { 't' });\n            \"Test\".IndexOfAny(new[] { 't' }, 2);\n            \"Test\".IndexOfAny(new[] { 't' }, 1, 2);\n            \"Test\".Substring(1).IndexOfAny(new[] { 't' }); // Noncompliant {{Replace 'IndexOfAny' with the overload that accepts a startIndex parameter.}}\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n            \"Test\".LastIndexOf('t');\n            \"Test\".LastIndexOf('t', 1);\n            \"Test\".LastIndexOf(\"t\");\n            \"Test\".LastIndexOf(\"t\", 1);\n            \"Test\".LastIndexOf(\"t\", 1, 3);\n            \"Test\".Substring(1).LastIndexOf('t'); // Noncompliant {{Replace 'LastIndexOf' with the overload that accepts a startIndex parameter.}}\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            \"Test\".Substring(1).LastIndexOf(\"t\"); // Noncompliant\n\n\n            \"Test\".LastIndexOfAny(new[] { 't' });\n            \"Test\".LastIndexOfAny(new[] { 't' }, 1);\n            \"Test\".LastIndexOfAny(new[] { 't' }, 1, 3);\n            \"Test\".Substring(1).LastIndexOfAny(new[] { 't' }); // Noncompliant {{Replace 'LastIndexOfAny' with the overload that accepts a startIndex parameter.}}\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n            x.Substring(1).IndexOf('t'); // Noncompliant\n\n            x.Substring(1, 3);\n            x.Substring(1).Remove(1).IndexOf('t');\n            x.Remove(1).IndexOf('t');\n\n            Func<char, int> getIndex = c => {\n                return \"Test\".Substring(1).IndexOf(c); // Noncompliant\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StringOperationWithoutCulture.CSharp10.cs",
    "content": "﻿using System;\nnamespace Tests.Diagnostics\n{\n    public class StringOperationWithoutCulture\n    {\n        // Repro for https://github.com/SonarSource/sonar-dotnet/issues/6439\n        void TestDateTimeMethodsNet6()\n        {\n            var time = new TimeOnly().ToString(); // FN\n            var date = new DateOnly().ToString(); // FN\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StringOperationWithoutCulture.CSharp11.cs",
    "content": "﻿namespace Tests.Diagnostics\n{\n    public class StringOperationWithoutCulture\n    {\n        void TestInterpolatedStrings()\n        {\n            int foo = 10;\n            string s = $\"Hello {foo switch\n                {\n                    > 0 => \"FOO\",\n                    _ => \"Bar\",\n                }}\".ToUpper(); // Noncompliant {{Define the locale to be used in this string operation.}}\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StringOperationWithoutCulture.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Globalization;\nusing System.Linq.Expressions;\n\nnamespace Tests.Diagnostics\n{\n    public class StringOperationWithoutCulture\n    {\n        void Test()\n        {\n            var s = \"\";\n            s = s.ToLower(); // Noncompliant\n//                ^^^^^^^\n            s = s.ToUpper(); // Noncompliant {{Define the locale to be used in this string operation.}}\n\n            s = s.ToUpperInvariant();\n            s = s.ToUpper(CultureInfo.InvariantCulture);\n            var b = s.StartsWith(\"\", StringComparison.CurrentCulture);\n            b = s.StartsWith(\"\"); // Compliant, although culture specific\n            b = s.EndsWith(\"\"); // Compliant, although culture specific\n            b = s.StartsWith(\"\", true, CultureInfo.InvariantCulture);\n            b = s.Equals(\"\"); // Compliant, ordinal compare\n            b = s.Equals(new object());\n            b = s.Equals(\"\", StringComparison.CurrentCulture);\n            var i = string.Compare(\"\", \"\", true); // Noncompliant\n            i = string.Compare(\"\", 1, \"\", 2, 3, true); // Noncompliant\n            i = string.Compare(\"\", 1, \"\", 2, 3, true, CultureInfo.InstalledUICulture);\n            i = string.Compare(\"\", \"\", StringComparison.CurrentCulture);\n\n            s = 1.8.ToString(); //Noncompliant\n            s = 1.8m.ToString(); //Noncompliant\n            s = 1.8f.ToString(\"d\");\n            s = 1.8.ToString(CultureInfo.InstalledUICulture);\n\n            i = \"\".CompareTo(\"\"); // Noncompliant {{Use 'CompareOrdinal' or 'Compare' with the locale specified instead of 'CompareTo'.}}\n            object o = \"\";\n            i = \"\".CompareTo(o); // Noncompliant\n\n            i = \"\".IndexOf(\"\"); // Noncompliant\n            i = \"\".IndexOf('a');\n            i = \"\".LastIndexOf(\"\"); // Noncompliant\n            i = \"\".LastIndexOf(\"\", StringComparison.CurrentCulture);\n        }\n\n        void TestExpressions()\n        {\n            // Make sure we don't report it for Expressions\n            Expression<Func<string, bool>> e = s => s.ToUpper() == \"TOTO\";\n            Func<string, bool> f = s => s.ToUpper() == \"TOTO\";                              // Noncompliant\n            var primes = new List<string> { \"two\", \"three\", \"five\", \"seven\" };\n            var withT = primes.Where(s => s.ToUpper().StartsWith(\"T\"));                     // Noncompliant\n            var withTQuery = primes.AsQueryable().Where(s => s.ToUpper().StartsWith(\"T\"));\n            var withoutT = from s in primes where !s.ToUpper().StartsWith(\"T\") select s;    // Noncompliant\n            var withoutTQuery = from s in primes.AsQueryable() where !s.ToUpper().StartsWith(\"T\") select s;\n        }\n\n        void TestDateTimeTypes()\n        {\n            var dateTime = new DateTime().ToString(); // Noncompliant\n\n            // Repro for https://github.com/SonarSource/sonar-dotnet/issues/6439\n            var dateTimeOffset = new DateTimeOffset().ToString(); // FN\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StringOrIntegralTypesForIndexers.Latest.Partial.cs",
    "content": "﻿using System;\n\nnamespace CSharp13\n{\n    partial class PartialIndexerClass\n    {\n        public partial int this[Class index] { get { return 0; } }\n        //                      ^^^^^ Noncompliant {{Use string, integral, index or range type here, or refactor this indexer into a method.}}\n\n        public partial int this[Record index] { get { return 0; } }\n        //                      ^^^^^^ Noncompliant {{Use string, integral, index or range type here, or refactor this indexer into a method.}}\n\n        public partial int this[PositionalRecord index] { get { return 0; } } // Noncompliant\n\n        public partial int this[Range range] { get { return 0; } }\n\n        public partial int this[Index index] { get { return 0; } }\n\n        public partial int this[int index] { get { return 0; } }\n\n        public partial int this[string index] { get { return 0; } }\n\n        public partial int this[nint index] { get { return 0; } } // Noncompliant Represented by the underlying type of System.IntPtr\n\n        public partial int this[nuint index] { get { return 0; } } // Noncompliant Represented by the underlying type of System.UIntPtr\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StringOrIntegralTypesForIndexers.Latest.cs",
    "content": "﻿using System;\n\nrecord Foo\n{\n    public int this[Class index] { get { return 0; } }\n//                  ^^^^^ Noncompliant {{Use string, integral, index or range type here, or refactor this indexer into a method.}}\n\n    public int this[Record index] { get { return 0; } }\n//                  ^^^^^^ Noncompliant {{Use string, integral, index or range type here, or refactor this indexer into a method.}}\n\n    public int this[PositionalRecord index] { get { return 0; } } // Noncompliant\n\n    public int this[Range range] { get { return 0; } }\n\n    public int this[Index index] { get { return 0; } }\n\n    public int this[int index] { get { return 0; } }\n\n    public int this[string index] { get { return 0; } }\n\n    public int this[nint index] { get { return 0; } } // Noncompliant Represented by the underlying type of System.IntPtr\n\n    public int this[nuint index] { get { return 0; } } // Noncompliant Represented by the underlying type of System.UIntPtr\n}\n\nclass Class { }\nrecord Record { }\nrecord PositionalRecord(int SomeProperty) { }\n\n\nnamespace CSharp13\n{\n\n    partial class PartialIndexerClass\n    {\n        public partial int this[Class index] { get; }\n        //                      ^^^^^ Noncompliant {{Use string, integral, index or range type here, or refactor this indexer into a method.}}\n\n        public partial int this[Record index] { get; }\n        //                      ^^^^^^ Noncompliant {{Use string, integral, index or range type here, or refactor this indexer into a method.}}\n\n        public partial int this[PositionalRecord index] { get; } // Noncompliant\n\n        public partial int this[Range range] { get; }\n\n        public partial int this[Index index] { get; }\n\n        public partial int this[int index] { get; }\n\n        public partial int this[string index] { get; }\n\n        public partial int this[nint index] { get; } // Noncompliant Represented by the underlying type of System.IntPtr\n\n        public partial int this[nuint index] { get; } // Noncompliant Represented by the underlying type of System.UIntPtr\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/StringOrIntegralTypesForIndexers.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    class Test1\n    {\n        public int this[Test1 index]\n//                      ^^^^^ Noncompliant {{Use string, integral, index or range type here, or refactor this indexer into a method.}}\n        {\n            get { return 0; }\n        }\n    }\n\n    class Test2\n    {\n        public int this[DateTime index]\n//                      ^^^^^^^^ {{Use string, integral, index or range type here, or refactor this indexer into a method.}}\n        {\n            get { return 0; }\n        }\n    }\n\n    class Test3\n    {\n        public int this[Test1 index, Test1 index2]\n        {\n            get { return 0; }\n        }\n    }\n\n    class Test4\n    {\n        public int this[params string[] paths]\n        {\n            get { return 0; }\n        }\n    }\n\n    class Test5\n    {\n        public int this[string index]\n        {\n            get { return 0; }\n        }\n    }\n\n    class Test6\n    {\n        public int this[dynamic index]\n        {\n            get { return 0; }\n        }\n    }\n\n    class Test7\n    {\n        public int this[object index]\n        {\n            get { return 0; }\n        }\n    }\n\n    class Test8\n    {\n        public int this[short index]\n        {\n            get { return 0; }\n        }\n    }\n\n    class Test9\n    {\n        public int this[int index]\n        {\n            get { return 0; }\n        }\n    }\n\n    class Test10\n    {\n        public int this[long index]\n        {\n            get { return 0; }\n        }\n    }\n\n    class Test11\n    {\n        public int this[ushort index]\n        {\n            get { return 0; }\n        }\n    }\n\n    class Test12\n    {\n        public int this[uint index]\n        {\n            get { return 0; }\n        }\n    }\n\n    class Test13\n    {\n        public int this[ulong index]\n        {\n            get { return 0; }\n        }\n    }\n\n    class Test14\n    {\n        public int this[char index]\n        {\n            get { return 0; }\n        }\n    }\n\n    class Test15\n    {\n        public int this[byte index]\n        {\n            get { return 0; }\n        }\n    }\n\n    class Test16\n    {\n        public int this[sbyte index]\n        {\n            get { return 0; }\n        }\n    }\n\n    class Test17<T>\n    {\n        public int this[T index]\n        {\n            get { return 0; }\n        }\n    }\n\n    class Test18\n    {\n        readonly int[] bar = new int[] { 1, 2, 3, 4, 5 };\n        public int[] this[Range range] => bar[range];\n    }\n\n    class Test19\n    {\n        readonly int[] bar = new int[] { 1, 2, 3, 4, 5 };\n        public int this[Index index] => bar[index];\n    }\n\n    class Test20\n    {\n        public int this[IntPtr index] // Noncompliant\n        {\n            get { return 0; }\n        }\n    }\n\n    class Test21\n    {\n        public int this[UIntPtr index] // Noncompliant\n        {\n            get { return 0; }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SuppressFinalizeUseless.CSharp9.cs",
    "content": "﻿using System;\n\nGC.SuppressFinalize(new object()); // Compliant - class is static. Should we raise if `this` is not passed as parameter?\n\nstatic void Foo()\n{\n    // There is also CA1816\n    GC.SuppressFinalize(new object()); // Compliant - class is static\n}\n\nsealed record Noncompliant\n{\n    public void M() => GC.SuppressFinalize(this); // Noncompliant\n}\n\nrecord Compliant\n{\n    public void M() => GC.SuppressFinalize(this);\n\n    ~Compliant() { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SuppressFinalizeUseless.Fixed.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    class Base\n    {\n        public void M()\n        {\n            GC.SuppressFinalize(this);\n        }\n        ~Base()\n        { }\n    }\n\n    class Derived1 : Base\n    {\n        public void M()\n        {\n            GC.SuppressFinalize(this);\n        }\n\n        ~Derived1()\n        { }\n    }\n    sealed class Derived2 : Base\n    {\n        public void M()\n        {\n            GC.SuppressFinalize(this);\n        }\n    }\n\n    sealed class C1\n    {\n        public void M()\n        {\n        }\n    }\n\n    class C2\n    {\n        public void M()\n        {\n            GC.SuppressFinalize(this); // Compliant, not sealed\n        }\n    }\n\n    class B1 { }\n    sealed class C3 : B1\n    {\n        public void M()\n        {\n        }\n    }\n\n    sealed class Dummy\n    {\n        public void SuppressFinalize(object o)\n        { }\n        public void M()\n        {\n            SuppressFinalize(this);\n        }\n    }\n\n    sealed class Compliant\n    {\n        ~Compliant()\n        { }\n        public void M()\n        {\n            GC.SuppressFinalize(this);\n        }\n    }\n\n    class NoThis\n    {\n        public void M()\n        {\n            GC.SuppressFinalize(new object()); // Compliant - should we raise if `this` is not passed as parameter?\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SuppressFinalizeUseless.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    class Base\n    {\n        public void M()\n        {\n            GC.SuppressFinalize(this);\n        }\n        ~Base()\n        { }\n    }\n\n    class Derived1 : Base\n    {\n        public void M()\n        {\n            GC.SuppressFinalize(this);\n        }\n\n        ~Derived1()\n        { }\n    }\n    sealed class Derived2 : Base\n    {\n        public void M()\n        {\n            GC.SuppressFinalize(this);\n        }\n    }\n\n    sealed class C1\n    {\n        public void M()\n        {\n            GC.SuppressFinalize(this); //Noncompliant\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^\n        }\n    }\n\n    class C2\n    {\n        public void M()\n        {\n            GC.SuppressFinalize(this); // Compliant, not sealed\n        }\n    }\n\n    class B1 { }\n    sealed class C3 : B1\n    {\n        public void M()\n        {\n            GC.SuppressFinalize(this); //Noncompliant {{Remove this useless call to 'GC.SuppressFinalize'.}}\n        }\n    }\n\n    sealed class Dummy\n    {\n        public void SuppressFinalize(object o)\n        { }\n        public void M()\n        {\n            SuppressFinalize(this);\n        }\n    }\n\n    sealed class Compliant\n    {\n        ~Compliant()\n        { }\n        public void M()\n        {\n            GC.SuppressFinalize(this);\n        }\n    }\n\n    class NoThis\n    {\n        public void M()\n        {\n            GC.SuppressFinalize(new object()); // Compliant - should we raise if `this` is not passed as parameter?\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SwaggerActionReturnType.cs",
    "content": "﻿using System.Threading.Tasks;\nusing Microsoft.AspNetCore.Http;\nusing Microsoft.AspNetCore.Http.HttpResults;\nusing Microsoft.AspNetCore.Mvc;\nusing Swashbuckle.AspNetCore.Annotations;\n\n[ApiController]\npublic class CompliantBaseline : Controller\n{\n    private Foo foo = new();\n\n    [HttpGet(\"foo\")]\n    public IActionResult ReturnsNoValue() => Ok();\n\n    [HttpGet(\"foo\")]\n    public IActionResult NotSuccessfulResult() => BadRequest(foo);\n\n    [HttpGet(\"foo\")]\n    [Produces(typeof(Foo))]\n    public IActionResult HasProducesTypeOf() => Ok(foo);\n\n    [HttpGet(\"foo\")]\n    [Produces<Foo>()]\n    public IActionResult HasProducesGeneric() => Ok(foo);\n\n    [HttpGet(\"foo\")]\n    [ProducesResponseType(typeof(Foo), StatusCodes.Status200OK)]\n    public IActionResult HasProducesResponseTypeTypeOf() => Ok(foo);\n\n    [HttpGet(\"foo\")]\n    [ProducesResponseType(typeof(Foo), StatusCodes.Status200OK, \"application/json\")]\n    public IActionResult HasProducesResponseTypeTypeOf2() => Ok(foo);\n\n    [HttpGet(\"foo\")]\n    [ProducesResponseType(StatusCodes.Status200OK, Type = typeof(int))]\n    public IActionResult HasProducesResponseTypeAsParameter() => Ok(foo);\n\n    [HttpGet(\"foo\")]\n    [ProducesResponseType<Foo>(StatusCodes.Status200OK)]\n    public IActionResult HasProducesResponseTypeGeneric() => Ok(foo);\n\n    [HttpGet(\"foo\")]\n    [ProducesResponseType<Foo>(StatusCodes.Status200OK, \"application/json\")]\n    public IActionResult HasProducesResponseTypeGeneric2() => Ok(foo);\n\n    [HttpGet(\"foo\")]\n    [SwaggerResponse(StatusCodes.Status200OK, \"\", typeof(Foo), \"application/json\")]\n    public IActionResult HasSwaggerResponse() => Ok(foo);\n\n    [HttpGet(\"foo\")]\n    [SwaggerResponse(StatusCodes.Status200OK, type: typeof(Foo))]\n    public IActionResult HasSwaggerResponse2() => Ok(foo);\n\n    [HttpGet(\"foo\")]\n    [SwaggerResponse(StatusCodes.Status200OK, type: typeof(Foo))]\n    public IResult IResult_HasAnnotation() => Results.Ok(foo);\n\n    [HttpGet(\"foo\")]\n    public ActionResult<Foo> TypedResponse1() => Ok(foo);\n\n    [HttpGet(\"foo\")]\n    public Foo TypedResponse2() => foo;\n\n    [HttpGet(\"foo\")]\n    public Results<NotFound, Ok<Foo>> TypedResponse3() =>\n        foo == null\n            ? TypedResults.NotFound()\n            : TypedResults.Ok(foo);\n\n    [HttpGet(\"foo\")]\n    public async Task<Foo> TypedResponse4()\n    {\n        await Task.Delay(42);\n        return foo;\n    }\n\n    // For implementation: I think if the type is specified at least once, we should not raise for simplicity, even if there is an http code mismatch.\n    [Route(\"foo\")]\n    [ProducesResponseType<Foo>(StatusCodes.Status201Created)]\n    public IActionResult AnnotatedForWrongStatusCode()\n    {\n        return Ok(foo); // This raises API1000, so the user will find out that the status code in the attribute is wrong.\n    }\n\n    [HttpGet(\"foo\")]\n    [ApiExplorerSettings(IgnoreApi = true)]\n    public IActionResult IgnoreApiTrue() => Ok(42);\n}\n\n[ApiController]\npublic class NocompliantBaseline : ControllerBase\n{\n    private Foo foo = new();\n\n    // For the implementation: If this seems too cumbersome, consider dropping it and documenting it as FN\n    [HttpGet(\"foo\")]\n    public ObjectResult NewObjectResult() => // Noncompliant {{Annotate this method with ProducesResponseType containing the return type for successful responses.}}\n        //              ^^^^^^^^^^^^^^^\n        new ObjectResult(42); // Secondary\n    //  ^^^^^^^^^^^^^^^^^^^^\n\n    [HttpGet(\"foo\")]\n    public IActionResult ReturnsOkWithValue() // Noncompliant {{Annotate this method with ProducesResponseType containing the return type for successful responses.}}\n        //               ^^^^^^^^^^^^^^^^^^\n    {\n        return Ok(foo); // Secondary\n    //         ^^^^^^^\n    }\n\n    [HttpGet(\"foo\")]\n    public IActionResult ReturnsMultipleValues(bool condition) // Noncompliant {{Annotate this method with ProducesResponseType containing the return type for successful responses.}}\n        //               ^^^^^^^^^^^^^^^^^^^^^\n    {\n        if (condition)\n        {\n            return Ok(foo);         // Secondary\n    //             ^^^^^^^\n        }\n        else\n        {\n            return Accepted(foo);   // Secondary\n    //             ^^^^^^^^^^^^^\n        }\n    }\n\n    [HttpGet(\"foo\")]\n    public IActionResult ReturnsMultipleValuesTernary() // Noncompliant {{Annotate this method with ProducesResponseType containing the return type for successful responses.}}\n        //               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    {\n        return true\n            ? Ok(foo)           // Secondary\n        //    ^^^^^^^\n            : Accepted(foo);    // Secondary\n        //    ^^^^^^^^^^^^^\n    }\n\n    [HttpGet(\"foo\")]\n    public IActionResult ReturnsMultipleValuesSwitch(int id) // Noncompliant {{Annotate this method with ProducesResponseType containing the return type for successful responses.}}\n        //               ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    {\n        return id switch\n        {\n            1 => Ok(foo), // Secondary\n            //   ^^^^^^^\n            2 => BadRequest(),\n            3 => Accepted(foo), // Secondary\n            //   ^^^^^^^^^^^^^\n            4 => NotFound(),\n            5 => Created(\"\", foo), // Secondary\n            //   ^^^^^^^^^^^^^^^^\n        };\n    }\n\n    [Route(\"foo\")]\n    public IActionResult MarkedWithRoute() // Noncompliant {{Annotate this method with ProducesResponseType containing the return type for successful responses.}}\n        //               ^^^^^^^^^^^^^^^\n    {\n        return Ok(foo); // Secondary\n    //         ^^^^^^^\n    }\n\n    [HttpGet(\"foo\")]\n    [Produces(\"text/plain\")]\n    public IActionResult HasProducesTypeOf() => // Noncompliant\n        Ok(foo);                                // Secondary\n\n    [Route(\"foo\")]\n    [ProducesResponseType(StatusCodes.Status200OK)]\n    public IActionResult AnnotatedWithNoType() // Noncompliant {{Use the ProducesResponseType overload containing the return type for successful responses.}}\n        //               ^^^^^^^^^^^^^^^^^^^\n    {\n        return Ok(foo); // Secondary\n        //     ^^^^^^^\n    }\n\n    [Route(\"foo\")]\n    [SwaggerResponse(200)]\n    public IActionResult AnnotatedWithNoType2() // Noncompliant {{Use the ProducesResponseType overload containing the return type for successful responses.}}\n        //               ^^^^^^^^^^^^^^^^^^^^\n    {\n        return Ok(foo); // Secondary\n        //     ^^^^^^^\n    }\n\n    [HttpGet(\"foo\")]\n    [ApiExplorerSettings(IgnoreApi = false)]\n    public IActionResult IgnoreApiFalse() => // Noncompliant\n        Ok(42);                              // Secondary\n\n    [HttpGet(\"foo\")]\n    public IActionResult UnusedSuccessResponse() // Noncompliant - FP, the created success response is not returned\n    {\n        var x = Ok(42);                          // Secondary\n        return null;\n    }\n}\n\npublic class NotApiController : Controller\n{\n    [HttpGet(\"foo\")]\n    public IActionResult Foo() => Ok(new Foo());\n}\n\n[NonController]\n[ApiController]\npublic class NotAController : Controller\n{\n    [HttpGet(\"foo\")]\n    public IActionResult Foo() => Ok(new Foo());\n}\n\n[ApiController]\npublic class NotPublicAction : Controller\n{\n    [HttpGet(\"foo\")]\n    internal IActionResult Foo() => Ok(new Foo());\n}\n\n[ApiController]\npublic class UsesApiConventionMethod : Controller\n{\n    [HttpGet(\"foo\")]\n    [ApiConventionMethod(typeof(DefaultApiConventions), nameof(DefaultApiConventions.Get))]\n    public IActionResult Foo() => Ok(new Foo());\n}\n\n[ApiController]\n[ApiConventionType(typeof(DefaultApiConventions))]\npublic class UsesApiConventionType : ControllerBase\n{\n    [HttpGet(\"foo\")]\n    public IActionResult Foo() => Ok(new Foo());\n}\n\n[ApiController]\n[ProducesResponseType<int>(StatusCodes.Status200OK)]\npublic class AnnotatedAtControllerLevel : ControllerBase\n{\n    [HttpGet(\"foo\")]\n    public IActionResult ReturnsOkWithValue() => Ok(42);\n}\n\n[ApiController]\n[ProducesResponseType(typeof(int), StatusCodes.Status200OK)]\npublic class AnnotatedAtControllerLevelWithTypeOf : ControllerBase\n{\n    [HttpGet(\"foo\")]\n    public IActionResult ReturnsOkWithValue() => Ok(42);\n}\n\n[ApiController]\n[ProducesResponseType(200)]\npublic class AnnotatedAtControllerLevelWithNoType : ControllerBase\n{\n    [HttpGet(\"foo\")]\n    public IActionResult ReturnsOkWithValue() => // Noncompliant {{Annotate this method with ProducesResponseType containing the return type for successful responses.}}\n    //                   ^^^^^^^^^^^^^^^^^^\n        Ok(42); // Secondary\n    //  ^^^^^^\n\n}\n\n[ApiController]\n[ApiExplorerSettings(IgnoreApi = true)]\npublic class IgnoreApiTrueController : ControllerBase\n{\n    [HttpGet(\"foo\")]\n    public IActionResult ReturnsOkWithValue() => Ok(42);\n}\n\n[ApiController]\n[SwaggerResponse(StatusCodes.Status200OK, type: typeof(Foo))]\npublic class SwaggerResponseController : Controller\n{\n    [HttpGet(\"foo\")]\n    public IActionResult Foo() => Ok(new Foo());\n}\n\n[ApiController]\n[ApiExplorerSettings(IgnoreApi = false)]\npublic class IgnoreApiFalseController : ControllerBase\n{\n    [HttpGet(\"foo\")]\n    public IActionResult ReturnsOkWithValue() => // Noncompliant {{Annotate this method with ProducesResponseType containing the return type for successful responses.}}\n    //                   ^^^^^^^^^^^^^^^^^^\n        Ok(42); // Secondary\n    //  ^^^^^^\n}\n\npublic class Foo\n{\n    public int Bar { get; set; }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SwitchCaseFallsThroughToDefault.Fixed.cs",
    "content": "﻿namespace Tests.Diagnostics\n{\n    public class SwitchCaseFallsThroughToDefault\n    {\n        private void handleA() { }\n        private void handleB() { }\n        private void handleTheRest() { }\n\n        public SwitchCaseFallsThroughToDefault(char ch)\n        {\n            switch (ch)\n            {\n                case 'b':\n                    handleB();\n                    break;\n                default:\n                    handleTheRest();\n                    break;\n                case 'a':\n                    handleA();\n                    break;\n            }\n\n            switch (ch)\n            {\n                case 'b':\n                    handleB();\n                    break;\n                default:\n                    handleTheRest();\n                    break;\n                case 'a':\n                    handleA();\n                    break;\n            }\n\n            switch (ch)\n            {\n                case 'b':\n                    handleB();\n                    break;\n                default:\n                    handleTheRest();\n                    break;\n                case 'a':\n                    handleA();\n                    break;\n            }\n\n            switch (ch)\n            {\n                case 'b': // Compliant - FN\n                default:\n                    break;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SwitchCaseFallsThroughToDefault.TopLevelStatements.cs",
    "content": "﻿int x = int.Parse(args[0]);\nobject y = args[1];\n\nswitch (x)\n{\n    case > 1 and < 5: // Noncompliant\n    case < 1: // Noncompliant\n    case > 5: // Noncompliant\n    default:\n        handleTheRest();\n        break;\n}\n\nswitch (y)\n{\n    case int: // Noncompliant\n    case not int: // Noncompliant\n    default:\n        handleTheRest();\n        break;\n}\n\nstatic void handleTheRest() { }\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SwitchCaseFallsThroughToDefault.cs",
    "content": "﻿namespace Tests.Diagnostics\n{\n    public class SwitchCaseFallsThroughToDefault\n    {\n        private void handleA() { }\n        private void handleB() { }\n        private void handleTheRest() { }\n\n        public SwitchCaseFallsThroughToDefault(char ch)\n        {\n            switch (ch)\n            {\n                case 'b':\n                    handleB();\n                    break;\n                case 'c':  // Noncompliant\n//              ^^^^^^^^^\n                default:\n                    handleTheRest();\n                    break;\n                case 'a':\n                    handleA();\n                    break;\n            }\n\n            switch (ch)\n            {\n                case 'b':\n                    handleB();\n                    break;\n                case 'c':  // Noncompliant {{Remove this empty 'case' clause.}}\n                case 'e':  // Noncompliant\n                default:\n                    handleTheRest();\n                    break;\n                case 'a':\n                    handleA();\n                    break;\n            }\n\n            switch (ch)\n            {\n                case 'b':\n                    handleB();\n                    break;\n                case 'c':  // Noncompliant\n                default:\n                case 'e':  // Noncompliant\n                    handleTheRest();\n                    break;\n                case 'a':\n                    handleA();\n                    break;\n            }\n\n            switch (ch)\n            {\n                case 'b': // Compliant - FN\n                default:\n                    break;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SwitchCasesMinimumThree.cs",
    "content": "﻿namespace Tests.Diagnostics\n{\n    public class SwitchCasesMinimumThree\n    {\n        public SwitchCasesMinimumThree(int n)\n        {\n            switch (n) // Noncompliant\n//          ^^^^^^\n            {\n                case 0:\n                    break;\n                default:\n                    break;\n            }\n\n            switch (n) // Noncompliant {{Replace this 'switch' statement with 'if' statements to increase readability.}}\n            {\n            }\n\n            switch (n)\n            {\n                case 0:\n                    break;\n                case 1:\n                default:\n                    var x=5;\n                    break;\n            }\n        }\n\n        public int SwitchExpressionsWithNone(int n) =>\n            n switch // Noncompliant {{Remove this 'switch' expression to increase readability.}}\n//            ^^^^^^\n            {\n\n            };\n\n        public int SwitchExpressionsWithOne(int n) =>\n            n switch // Noncompliant {{Replace this 'switch' expression with a ternary conditional operator to increase readability.}}\n            {\n                1 => 1,\n            };\n\n        public int SwitchExpressionsWithTwo(int n) =>\n            n switch //  Noncompliant {{Replace this 'switch' expression with a ternary conditional operator to increase readability.}}\n            {\n                1 => 1,\n                _ => 2,\n            };\n\n        public int SwitchExpressions(string type)\n        {\n            var x = type switch // Noncompliant {{Remove this 'switch' expression to increase readability.}}\n            {\n                _ => 1,\n            };\n\n            var y = type switch // Noncompliant\n            {\n                _ => 0,\n                _ => 1 // Error [CS8510]\n            };\n\n\n            return type switch // Noncompliant\n            {\n                _ => 1\n            };\n        }\n\n        public int SwitchExpressionsWithTwoNonDefault(int n) =>\n            n switch // Compliant\n            {\n                1 => 1,\n                2 => 2,\n            };\n\n        public int SwitchExpressionsWithMany(int n) =>\n            n switch // Compliant\n            {\n                1 => 1,\n                2 => 2,\n                3 => 3,\n                4 => 4,\n                5 => 5,\n            };\n\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SwitchCasesMinimumThree.vb",
    "content": "﻿Namespace Tests.Diagnostics\n    Public Class SwitchCasesMinimumThree\n        Public Sub New(ByVal n As Integer)\n            Select Case n ' Noncompliant {{Replace this 'Select' statement with 'If' statements to increase readability.}}\n'           ^^^^^^\n                Case 0\n                Case Else\n            End Select\n\n            Select Case n ' Noncompliant {{Replace this 'Select' statement with 'If' statements to increase readability.}}\n'           ^^^^^^\n            End Select\n\n            Select Case n 'Compliant, 3 cases\n                Case 0, 1\n                Case Else\n                    Dim x = 5\n            End Select\n        End Sub\n    End Class\nEnd Namespace\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SwitchDefaultClauseEmpty.Fixed.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class SwitchDefaultClauseEmpty\n    {\n        public enum Fruit\n        {\n            Apple,\n            Orange,\n            Banana\n        }\n\n\n        public SwitchDefaultClauseEmpty(Fruit fruit)\n        {\n            switch (fruit)\n            {\n                case Fruit.Apple:\n                    Console.WriteLine(\"apple\");\n                    break;\n            }\n\n            switch (fruit)\n            {\n                case Fruit.Apple:\n                    Console.WriteLine(\"apple\");\n                    break;\n            }\n\n            switch (fruit)\n            {\n                case Fruit.Apple:\n                    Console.WriteLine(\"apple\");\n                    break;\n                default:\n                    // Single line comment before\n                    break;\n            }\n\n            switch (fruit)\n            {\n                case Fruit.Apple:\n                    Console.WriteLine(\"apple\");\n                    break;\n                default:\n                    break; // Single line comment after\n            }\n\n            switch (fruit)\n            {\n                case Fruit.Apple:\n                    Console.WriteLine(\"apple\");\n                    break;\n                default:\n                    /* Multi lines comment before */\n                    break;\n            }\n\n            switch (fruit)\n            {\n                case Fruit.Apple:\n                    Console.WriteLine(\"apple\");\n                    break;\n                default:\n                    break; /* Multi lines comment after */\n            }\n\n            switch (fruit)\n            {\n                case Fruit.Apple:\n                    Console.WriteLine(\"apple\");\n                    break;\n                case Fruit.Orange:\n                default:\n                    /*commented*/\n                    break;\n            }\n\n            switch (fruit)\n            {\n                case Fruit.Apple:\n                    Console.WriteLine(\"apple\");\n                    break;\n                default: // Single line comment after\n                    break;\n            }\n\n            switch (fruit)\n            {\n                case Fruit.Apple:\n                    Console.WriteLine(\"apple\");\n                    break;\n                default:\n                    {\n                        // comment\n                    }\n                    break;\n            }\n\n            switch (fruit)\n            {\n                case Fruit.Apple:\n                    Console.WriteLine(\"apple\");\n                    break;\n                default:\n                    Console.WriteLine(\"other\");\n                    break;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SwitchDefaultClauseEmpty.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class SwitchDefaultClauseEmpty\n    {\n        public enum Fruit\n        {\n            Apple,\n            Orange,\n            Banana\n        }\n\n\n        public SwitchDefaultClauseEmpty(Fruit fruit)\n        {\n            switch (fruit)\n            {\n                case Fruit.Apple:\n                    Console.WriteLine(\"apple\");\n                    break;\n                //Noncompliant@+1\n                default: break;\n//              ^^^^^^^^^^^^^^^\n            }\n\n            switch (fruit)\n            {\n                case Fruit.Apple:\n                    Console.WriteLine(\"apple\");\n                    break;\n                //Noncompliant@+1\n                case Fruit.Orange:\n                default:\n                    break;\n            }\n\n            switch (fruit)\n            {\n                case Fruit.Apple:\n                    Console.WriteLine(\"apple\");\n                    break;\n                default:\n                    // Single line comment before\n                    break;\n            }\n\n            switch (fruit)\n            {\n                case Fruit.Apple:\n                    Console.WriteLine(\"apple\");\n                    break;\n                default:\n                    break; // Single line comment after\n            }\n\n            switch (fruit)\n            {\n                case Fruit.Apple:\n                    Console.WriteLine(\"apple\");\n                    break;\n                default:\n                    /* Multi lines comment before */\n                    break;\n            }\n\n            switch (fruit)\n            {\n                case Fruit.Apple:\n                    Console.WriteLine(\"apple\");\n                    break;\n                default:\n                    break; /* Multi lines comment after */\n            }\n\n            switch (fruit)\n            {\n                case Fruit.Apple:\n                    Console.WriteLine(\"apple\");\n                    break;\n                case Fruit.Orange:\n                default:\n                    /*commented*/\n                    break;\n            }\n\n            switch (fruit)\n            {\n                case Fruit.Apple:\n                    Console.WriteLine(\"apple\");\n                    break;\n                default: // Single line comment after\n                    break;\n            }\n\n            switch (fruit)\n            {\n                case Fruit.Apple:\n                    Console.WriteLine(\"apple\");\n                    break;\n                default:\n                    {\n                        // comment\n                    }\n                    break;\n            }\n\n            switch (fruit)\n            {\n                case Fruit.Apple:\n                    Console.WriteLine(\"apple\");\n                    break;\n                default:\n                    Console.WriteLine(\"other\");\n                    break;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SwitchSectionShouldNotHaveTooManyStatements_CustomValue.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class Program\n    {\n        public Program(int myVariable)\n        {\n            switch (myVariable)\n            {\n                case 0:\n                    break;\n                case 1: // Noncompliant {{Reduce this switch section number of statements from 6 to at most 1, for example by extracting code into a method.}}\n//              ^^^^^^^\n                    Console.WriteLine(\"1\");\n                    Console.WriteLine(\"2\");\n                    Console.WriteLine(\"3\");\n                    Console.WriteLine(\"4\");\n                    Console.WriteLine(\"5\");\n                    break;\n                default:\n                    break;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SwitchSectionShouldNotHaveTooManyStatements_CustomValue.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.Linq\nImports System.Text\n\nNamespace Tests.TestCases\n    Class Foo\n        Public Sub Test()\n            Dim number As Integer = 8\n\n            Select Case number\n                Case 1 To 5 ' Noncompliant {{Reduce this 'Case' block number of statements from 3 to at most 1, for example by extracting code into a procedure.}}\n'               ^^^^^^^^^^^\n                    Test()\n                    Test()\n                    Test()\n                Case 6\n                    Test()\n                Case Else ' Noncompliant\n                    Test()\n                    Test()\n                    Test()\n            End Select\n\n            Select Case number\n                Case 1 To 5\n                Case 6\n                Case Else\n            End Select\n\n\t\tEnd Sub\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SwitchSectionShouldNotHaveTooManyStatements_DefaultValue.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class Program\n    {\n        public Program(int myVariable)\n        {\n            var length = myVariable;\n            switch (myVariable)\n            {\n                case 0:\n                    break;\n                case 1: // Noncompliant {{Reduce this switch section number of statements from 9 to at most 8, for example by extracting code into a method.}}\n//              ^^^^^^^\n                    Console.WriteLine(\"1\");\n                    Console.WriteLine(\"2\");\n                    Console.WriteLine(\"3\");\n                    Console.WriteLine(\"4\");\n                    Console.WriteLine(\"5\");\n                    Console.WriteLine(\"6\");\n                    Console.WriteLine(\"7\");\n                    Console.WriteLine(\"8\");\n                    break;\n                case 2:\n                    {\n                        Console.WriteLine(\"1\");\n                        Console.WriteLine(\"2\");\n                        Console.WriteLine(\"3\");\n                        Console.WriteLine(\"4\");\n                        break;\n                    }\n                case 3: // Noncompliant {{Reduce this switch section number of statements from 10 to at most 8, for example by extracting code into a method.}}\n                case 4:\n                    if (true)\n                    {\n                        if (false)\n                        {\n                            for (int i = 0; i < length; i++)\n                            {\n                                Console.WriteLine();\n                                Console.WriteLine();\n                                Console.WriteLine();\n                                Console.WriteLine();\n                                Console.WriteLine();\n                                Console.WriteLine();\n                            }\n                        }\n                    }\n                    break;\n                case 5: // Noncompliant\n                    var x = Foo(42);\n                    break;\n\n                    string Foo(int value)\n                    {\n                        Console.WriteLine(\"1\");\n                        Console.WriteLine(\"2\");\n                        Console.WriteLine(\"3\");\n                        Console.WriteLine(\"4\");\n                        Console.WriteLine(\"5\");\n                        Console.WriteLine(\"6\");\n                        Console.WriteLine(\"7\");\n\n                        return \"\";\n                    }\n                case: // Error [CS0150]\n                default:\n                    break;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SwitchSectionShouldNotHaveTooManyStatements_DefaultValue.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.IO\nImports System.Linq\nImports System.Text\nImports Microsoft.VisualBasic\n\nNamespace Tests.TestCases\n    Class Foo\n        Public Sub Test()\n            Dim number As Integer = 8\n            Dim theCustomer As New Customer\n            Dim thisLock As New Object\n\n            Select Case number\n                Case 1 To 5 ' Noncompliant {{Reduce this 'Case' block number of statements from 9 to at most 8, for example by extracting code into a procedure.}}\n'               ^^^^^^^^^^^\n                    Test()\n                    Test()\n                    Test()\n                    Test()\n                    Test()\n                    Test()\n                    Test()\n                    Test()\n                    Test()\n                Case 6 ' Noncompliant {{Reduce this 'Case' block number of statements from 20 to at most 8, for example by extracting code into a procedure.}}\n                    If False                                                 ' +1\n                    ElseIf True                                              ' +1\n                    Else                                                     ' +1\n                        For index = 1 To 10                                  ' +1\n                        Next\n                        While True                                           ' +1\n                        End While\n                        Do\n                        Loop While (number < 1)                              ' +1\n                        Do\n                        Loop Until (number = 1)                              ' +1\n                        Select Case number                                   ' +1\n                            Case 1                                           ' +1\n                            Case 2                                           ' +1\n                            Case Else                                        ' +1\n                        End Select\n                        If True Then Test()                                  ' +1\n                        Try                                                  ' +1\n                        Catch ex As Exception                                ' +1\n                        Finally                                              ' +1\n                        End Try\n                    End If\n                    With theCustomer                                         ' +1\n                        .Name = \"d\"                                          ' +1\n                        .City = \"foo\"                                        ' +1\n                    End With\n                    Using writer As TextWriter = File.CreateText(\"log.txt\")  ' +1\n                    End Using\n                    SyncLock thisLock                                        ' +1\n                    End SyncLock\n                Case Else\n                    Test()\n            End Select\n\t\tEnd Sub\n    End Class\n\n    Public Class Customer\n        Public Property Name As String\n        Public Property City As String\n        Public Property URL As String\n\n        Public Property Comments As New List(Of String)\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SwitchShouldNotBeNested.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class Program\n    {\n        public Program(char choice, int value)\n        {\n            switch (choice)\n            {\n                case 'Y':\n                    Console.WriteLine(\"Yes\");\n                    break;\n                case 'M':\n                    Console.WriteLine(\"Maybe\");\n                    break;\n                case 'N':\n                    Console.WriteLine(\"No\");\n                    break;\n                default:\n                    switch (value) // Noncompliant\n//                  ^^^^^^\n                    {\n                        case 0:\n                            break;\n                        default:\n                            break;\n                    }\n                    Console.WriteLine(\"Invalid response\");\n                    break;\n            }\n\n\n            int i = 1;\n            switch (i)\n            {\n                case 1:\n                case 2:\n                    Console.WriteLine(\"One or Two\");\n                    break;\n                default:\n                    Console.WriteLine(\"Other\");\n                    break;\n            }\n\n            string first = \"foo\", second = \"bar\";\n\n            var result = first switch\n            {\n                \"a\" => second switch // Compliant\n                {\n                    \"x\" => 9,\n                    _ => 1\n                },\n                \"b\" => 2,\n                _ => 3\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SwitchShouldNotBeNested.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.Linq\nImports System.Text\n\nNamespace Tests.TestCases\nPublic Class Program\n    Public Sub New()\n        Dim choice As String = \"Foo\"\n        Dim value As Integer = 1\n\n        Select Case choice\n            Case \"Y\"c\n                Console.WriteLine(\"Yes\")\n            Case \"M\"c\n                Console.WriteLine(\"Maybe\")\n            Case \"N\"c\n                Console.WriteLine(\"No\")\n            Case Else\n\n                    Select Case value ' Noncompliant {{Refactor the code to eliminate this nested 'Select Case'.}}\n'                   ^^^^^^^^^^^^^^^^^\n                        Case 0\n                        Case Else\n                    End Select\n\n                    Console.WriteLine(\"Invalid response\")\n        End Select\n\n        Dim i As Integer = 1\n\n        Select Case i\n            Case 1, 2\n                Console.WriteLine(\"One or Two\")\n            Case Else\n                Console.WriteLine(\"Other\")\n        End Select\n    End Sub\nEnd Class\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SwitchWithoutDefault.cs",
    "content": "﻿namespace Tests.Diagnostics\n{\n    public class SwitchWithoutDefault\n    {\n        public SwitchWithoutDefault(int n)\n        {\n            switch (n) // Noncompliant\n//          ^^^^^^\n            {\n            }\n\n            switch (n) // Noncompliant {{Add a 'default' clause to this 'switch' statement.}}\n            {\n                case 1:\n                case 2:\n                    break;\n            }\n\n            switch (n)\n            {\n                default:\n                    break;\n            }\n\n            switch (n)\n            {\n                case 1:\n                    break;\n                default:\n                    break;\n            }\n\n            switch (n)\n            {\n                case 1:\n                default:\n                case 2:\n                    break;\n                case 3:\n                    break;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SwitchWithoutDefault.vb",
    "content": "﻿Namespace Tests.Diagnostics\n\n    Public Class SwitchWithoutDefault\n\n        Public Sub New(n As Integer)\n\n            Select Case n ' Noncompliant {{Add a 'Case Else' clause to this 'Select' statement.}}\n'           ^^^^^^\n            End Select\n\n            Select Case n ' Noncompliant\n                Case 1\n                Case 2\n            End Select\n\n            Select n ' Noncompliant\n                Case Is = 1\n                Case Is = 2\n            End Select\n\n            Select Case n\n                Case Else\n\n            End Select\n\n            Select Case n\n                Case 1\n\n                Case Else\n\n            End Select\n\n            Select Case n\n                Case 1\n                Case 2\n                Case 3\n                Case Else\n            End Select\n        End Sub\n    End Class\nEnd Namespace"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SyntaxWalker_InsufficientExecutionStackException.cs",
    "content": "﻿using System;\n\nnamespace Test\n{\n    public class Foo\n    {\n        private string Bar()\n        {\n            var x =\n            \"1\" +\n            \"2\" +\n            \"3\" +\n            \"4\" +\n            \"5\" +\n            \"6\" +\n            \"7\" +\n            \"8\" +\n            \"9\" +\n            \"10\" +\n            \"11\" +\n            \"12\" +\n            \"13\" +\n            \"14\" +\n            \"15\" +\n            \"16\" +\n            \"17\" +\n            \"18\" +\n            \"19\" +\n            \"20\" +\n            \"21\" +\n            \"22\" +\n            \"23\" +\n            \"24\" +\n            \"25\" +\n            \"26\" +\n            \"27\" +\n            \"28\" +\n            \"29\" +\n            \"30\" +\n            \"31\" +\n            \"32\" +\n            \"33\" +\n            \"34\" +\n            \"35\" +\n            \"36\" +\n            \"37\" +\n            \"38\" +\n            \"39\" +\n            \"40\" +\n            \"41\" +\n            \"42\" +\n            \"43\" +\n            \"44\" +\n            \"45\" +\n            \"46\" +\n            \"47\" +\n            \"48\" +\n            \"49\" +\n            \"50\" +\n            \"51\" +\n            \"52\" +\n            \"53\" +\n            \"54\" +\n            \"55\" +\n            \"56\" +\n            \"57\" +\n            \"58\" +\n            \"59\" +\n            \"60\" +\n            \"61\" +\n            \"62\" +\n            \"63\" +\n            \"64\" +\n            \"65\" +\n            \"66\" +\n            \"67\" +\n            \"68\" +\n            \"69\" +\n            \"70\" +\n            \"71\" +\n            \"72\" +\n            \"73\" +\n            \"74\" +\n            \"75\" +\n            \"76\" +\n            \"77\" +\n            \"78\" +\n            \"79\" +\n            \"80\" +\n            \"81\" +\n            \"82\" +\n            \"83\" +\n            \"84\" +\n            \"85\" +\n            \"86\" +\n            \"87\" +\n            \"88\" +\n            \"89\" +\n            \"90\" +\n            \"91\" +\n            \"92\" +\n            \"93\" +\n            \"94\" +\n            \"95\" +\n            \"96\" +\n            \"97\" +\n            \"98\" +\n            \"99\" +\n            \"100\" +\n            \"101\" +\n            \"102\" +\n            \"103\" +\n            \"104\" +\n            \"105\" +\n            \"106\" +\n            \"107\" +\n            \"108\" +\n            \"109\" +\n            \"110\" +\n            \"111\" +\n            \"112\" +\n            \"113\" +\n            \"114\" +\n            \"115\" +\n            \"116\" +\n            \"117\" +\n            \"118\" +\n            \"119\" +\n            \"120\" +\n            \"121\" +\n            \"122\" +\n            \"123\" +\n            \"124\" +\n            \"125\" +\n            \"126\" +\n            \"127\" +\n            \"128\" +\n            \"129\" +\n            \"130\" +\n            \"131\" +\n            \"132\" +\n            \"133\" +\n            \"134\" +\n            \"135\" +\n            \"136\" +\n            \"137\" +\n            \"138\" +\n            \"139\" +\n            \"140\" +\n            \"141\" +\n            \"142\" +\n            \"143\" +\n            \"144\" +\n            \"145\" +\n            \"146\" +\n            \"147\" +\n            \"148\" +\n            \"149\" +\n            \"150\" +\n            \"151\" +\n            \"152\" +\n            \"153\" +\n            \"154\" +\n            \"155\" +\n            \"156\" +\n            \"157\" +\n            \"158\" +\n            \"159\" +\n            \"160\" +\n            \"161\" +\n            \"162\" +\n            \"163\" +\n            \"164\" +\n            \"165\" +\n            \"166\" +\n            \"167\" +\n            \"168\" +\n            \"169\" +\n            \"170\" +\n            \"171\" +\n            \"172\" +\n            \"173\" +\n            \"174\" +\n            \"175\" +\n            \"176\" +\n            \"177\" +\n            \"178\" +\n            \"179\" +\n            \"180\" +\n            \"181\" +\n            \"182\" +\n            \"183\" +\n            \"184\" +\n            \"185\" +\n            \"186\" +\n            \"187\" +\n            \"188\" +\n            \"189\" +\n            \"190\" +\n            \"191\" +\n            \"192\" +\n            \"193\" +\n            \"194\" +\n            \"195\" +\n            \"196\" +\n            \"197\" +\n            \"198\" +\n            \"199\" +\n            \"200\" +\n            \"201\" +\n            \"202\" +\n            \"203\" +\n            \"204\" +\n            \"205\" +\n            \"206\" +\n            \"207\" +\n            \"208\" +\n            \"209\" +\n            \"210\" +\n            \"211\" +\n            \"212\" +\n            \"213\" +\n            \"214\" +\n            \"215\" +\n            \"216\" +\n            \"217\" +\n            \"218\" +\n            \"219\" +\n            \"220\" +\n            \"221\" +\n            \"222\" +\n            \"223\" +\n            \"224\" +\n            \"225\" +\n            \"226\" +\n            \"227\" +\n            \"228\" +\n            \"229\" +\n            \"230\" +\n            \"231\" +\n            \"232\" +\n            \"233\" +\n            \"234\" +\n            \"235\" +\n            \"236\" +\n            \"237\" +\n            \"238\" +\n            \"239\" +\n            \"240\" +\n            \"241\" +\n            \"242\" +\n            \"243\" +\n            \"244\" +\n            \"245\" +\n            \"246\" +\n            \"247\" +\n            \"248\" +\n            \"249\" +\n            \"250\" +\n            \"251\" +\n            \"252\" +\n            \"253\" +\n            \"254\" +\n            \"255\" +\n            \"256\" +\n            \"257\" +\n            \"258\" +\n            \"259\" +\n            \"260\" +\n            \"261\" +\n            \"262\" +\n            \"263\" +\n            \"264\" +\n            \"265\" +\n            \"266\" +\n            \"267\" +\n            \"268\" +\n            \"269\" +\n            \"270\" +\n            \"271\" +\n            \"272\" +\n            \"273\" +\n            \"274\" +\n            \"275\" +\n            \"276\" +\n            \"277\" +\n            \"278\" +\n            \"279\" +\n            \"280\" +\n            \"281\" +\n            \"282\" +\n            \"283\" +\n            \"284\" +\n            \"285\" +\n            \"286\" +\n            \"287\" +\n            \"288\" +\n            \"289\" +\n            \"290\" +\n            \"291\" +\n            \"292\" +\n            \"293\" +\n            \"294\" +\n            \"295\" +\n            \"296\" +\n            \"297\" +\n            \"298\" +\n            \"299\" +\n            \"300\" +\n            \"301\" +\n            \"302\" +\n            \"303\" +\n            \"304\" +\n            \"305\" +\n            \"306\" +\n            \"307\" +\n            \"308\" +\n            \"309\" +\n            \"310\" +\n            \"311\" +\n            \"312\" +\n            \"313\" +\n            \"314\" +\n            \"315\" +\n            \"316\" +\n            \"317\" +\n            \"318\" +\n            \"319\" +\n            \"320\" +\n            \"321\" +\n            \"322\" +\n            \"323\" +\n            \"324\" +\n            \"325\" +\n            \"326\" +\n            \"327\" +\n            \"328\" +\n            \"329\" +\n            \"330\" +\n            \"331\" +\n            \"332\" +\n            \"333\" +\n            \"334\" +\n            \"335\" +\n            \"336\" +\n            \"337\" +\n            \"338\" +\n            \"339\" +\n            \"340\" +\n            \"341\" +\n            \"342\" +\n            \"343\" +\n            \"344\" +\n            \"345\" +\n            \"346\" +\n            \"347\" +\n            \"348\" +\n            \"349\" +\n            \"350\" +\n            \"351\" +\n            \"352\" +\n            \"353\" +\n            \"354\" +\n            \"355\" +\n            \"356\" +\n            \"357\" +\n            \"358\" +\n            \"359\" +\n            \"360\" +\n            \"361\" +\n            \"362\" +\n            \"363\" +\n            \"364\" +\n            \"365\" +\n            \"366\" +\n            \"367\" +\n            \"368\" +\n            \"369\" +\n            \"370\" +\n            \"371\" +\n            \"372\" +\n            \"373\" +\n            \"374\" +\n            \"375\" +\n            \"376\" +\n            \"377\" +\n            \"378\" +\n            \"379\" +\n            \"380\" +\n            \"381\" +\n            \"382\" +\n            \"383\" +\n            \"384\" +\n            \"385\" +\n            \"386\" +\n            \"387\" +\n            \"388\" +\n            \"389\" +\n            \"390\" +\n            \"391\" +\n            \"392\" +\n            \"393\" +\n            \"394\" +\n            \"395\" +\n            \"396\" +\n            \"397\" +\n            \"398\" +\n            \"399\" +\n            \"400\" +\n            \"401\" +\n            \"402\" +\n            \"403\" +\n            \"404\" +\n            \"405\" +\n            \"406\" +\n            \"407\" +\n            \"408\" +\n            \"409\" +\n            \"410\" +\n            \"411\" +\n            \"412\" +\n            \"413\" +\n            \"414\" +\n            \"415\" +\n            \"416\" +\n            \"417\" +\n            \"418\" +\n            \"419\" +\n            \"420\" +\n            \"421\" +\n            \"422\" +\n            \"423\" +\n            \"424\" +\n            \"425\" +\n            \"426\" +\n            \"427\" +\n            \"428\" +\n            \"429\" +\n            \"430\" +\n            \"431\" +\n            \"432\" +\n            \"433\" +\n            \"434\" +\n            \"435\" +\n            \"436\" +\n            \"437\" +\n            \"438\" +\n            \"439\" +\n            \"440\" +\n            \"441\" +\n            \"442\" +\n            \"443\" +\n            \"444\" +\n            \"445\" +\n            \"446\" +\n            \"447\" +\n            \"448\" +\n            \"449\" +\n            \"450\" +\n            \"451\" +\n            \"452\" +\n            \"453\" +\n            \"454\" +\n            \"455\" +\n            \"456\" +\n            \"457\" +\n            \"458\" +\n            \"459\" +\n            \"460\" +\n            \"461\" +\n            \"462\" +\n            \"463\" +\n            \"464\" +\n            \"465\" +\n            \"466\" +\n            \"467\" +\n            \"468\" +\n            \"469\" +\n            \"470\" +\n            \"471\" +\n            \"472\" +\n            \"473\" +\n            \"474\" +\n            \"475\" +\n            \"476\" +\n            \"477\" +\n            \"478\" +\n            \"479\" +\n            \"480\" +\n            \"481\" +\n            \"482\" +\n            \"483\" +\n            \"484\" +\n            \"485\" +\n            \"486\" +\n            \"487\" +\n            \"488\" +\n            \"489\" +\n            \"490\" +\n            \"491\" +\n            \"492\" +\n            \"493\" +\n            \"494\" +\n            \"495\" +\n            \"496\" +\n            \"497\" +\n            \"498\" +\n            \"499\" +\n            \"500\" +\n            \"501\" +\n            \"502\" +\n            \"503\" +\n            \"504\" +\n            \"505\" +\n            \"506\" +\n            \"507\" +\n            \"508\" +\n            \"509\" +\n            \"510\" +\n            \"511\" +\n            \"512\" +\n            \"513\" +\n            \"514\" +\n            \"515\" +\n            \"516\" +\n            \"517\" +\n            \"518\" +\n            \"519\" +\n            \"520\" +\n            \"521\" +\n            \"522\" +\n            \"523\" +\n            \"524\" +\n            \"525\" +\n            \"526\" +\n            \"527\" +\n            \"528\" +\n            \"529\" +\n            \"530\" +\n            \"531\" +\n            \"532\" +\n            \"533\" +\n            \"534\" +\n            \"535\" +\n            \"536\" +\n            \"537\" +\n            \"538\" +\n            \"539\" +\n            \"540\" +\n            \"541\" +\n            \"542\" +\n            \"543\" +\n            \"544\" +\n            \"545\" +\n            \"546\" +\n            \"547\" +\n            \"548\" +\n            \"549\" +\n            \"550\" +\n            \"551\" +\n            \"552\" +\n            \"553\" +\n            \"554\" +\n            \"555\" +\n            \"556\" +\n            \"557\" +\n            \"558\" +\n            \"559\" +\n            \"560\" +\n            \"561\" +\n            \"562\" +\n            \"563\" +\n            \"564\" +\n            \"565\" +\n            \"566\" +\n            \"567\" +\n            \"568\" +\n            \"569\" +\n            \"570\" +\n            \"571\" +\n            \"572\" +\n            \"573\" +\n            \"574\" +\n            \"575\" +\n            \"576\" +\n            \"577\" +\n            \"578\" +\n            \"579\" +\n            \"580\" +\n            \"581\" +\n            \"582\" +\n            \"583\" +\n            \"584\" +\n            \"585\" +\n            \"586\" +\n            \"587\" +\n            \"588\" +\n            \"589\" +\n            \"590\" +\n            \"591\" +\n            \"592\" +\n            \"593\" +\n            \"594\" +\n            \"595\" +\n            \"596\" +\n            \"597\" +\n            \"598\" +\n            \"599\" +\n            \"600\" +\n            \"601\" +\n            \"602\" +\n            \"603\" +\n            \"604\" +\n            \"605\" +\n            \"606\" +\n            \"607\" +\n            \"608\" +\n            \"609\" +\n            \"610\" +\n            \"611\" +\n            \"612\" +\n            \"613\" +\n            \"614\" +\n            \"615\" +\n            \"616\" +\n            \"617\" +\n            \"618\" +\n            \"619\" +\n            \"620\" +\n            \"621\" +\n            \"622\" +\n            \"623\" +\n            \"624\" +\n            \"625\" +\n            \"626\" +\n            \"627\" +\n            \"628\" +\n            \"629\" +\n            \"630\" +\n            \"631\" +\n            \"632\" +\n            \"633\" +\n            \"634\" +\n            \"635\" +\n            \"636\" +\n            \"637\" +\n            \"638\" +\n            \"639\" +\n            \"640\" +\n            \"641\" +\n            \"642\" +\n            \"643\" +\n            \"644\" +\n            \"645\" +\n            \"646\" +\n            \"647\" +\n            \"648\" +\n            \"649\" +\n            \"650\" +\n            \"651\" +\n            \"652\" +\n            \"653\" +\n            \"654\" +\n            \"655\" +\n            \"656\" +\n            \"657\" +\n            \"658\" +\n            \"659\" +\n            \"660\" +\n            \"661\" +\n            \"662\" +\n            \"663\" +\n            \"664\" +\n            \"665\" +\n            \"666\" +\n            \"667\" +\n            \"668\" +\n            \"669\" +\n            \"670\" +\n            \"671\" +\n            \"672\" +\n            \"673\" +\n            \"674\" +\n            \"675\" +\n            \"676\" +\n            \"677\" +\n            \"678\" +\n            \"679\" +\n            \"680\" +\n            \"681\" +\n            \"682\" +\n            \"683\" +\n            \"684\" +\n            \"685\" +\n            \"686\" +\n            \"687\" +\n            \"688\" +\n            \"689\" +\n            \"690\" +\n            \"691\" +\n            \"692\" +\n            \"693\" +\n            \"694\" +\n            \"695\" +\n            \"696\" +\n            \"697\" +\n            \"698\" +\n            \"699\" +\n            \"700\" +\n            \"701\" +\n            \"702\" +\n            \"703\" +\n            \"704\" +\n            \"705\" +\n            \"706\" +\n            \"707\" +\n            \"708\" +\n            \"709\" +\n            \"710\" +\n            \"711\" +\n            \"712\" +\n            \"713\" +\n            \"714\" +\n            \"715\" +\n            \"716\" +\n            \"717\" +\n            \"718\" +\n            \"719\" +\n            \"720\" +\n            \"721\" +\n            \"722\" +\n            \"723\" +\n            \"724\" +\n            \"725\" +\n            \"726\" +\n            \"727\" +\n            \"728\" +\n            \"729\" +\n            \"730\" +\n            \"731\" +\n            \"732\" +\n            \"733\" +\n            \"734\" +\n            \"735\" +\n            \"736\" +\n            \"737\" +\n            \"738\" +\n            \"739\" +\n            \"740\" +\n            \"741\" +\n            \"742\" +\n            \"743\" +\n            \"744\" +\n            \"745\" +\n            \"746\" +\n            \"747\" +\n            \"748\" +\n            \"749\" +\n            \"750\" +\n            \"751\" +\n            \"752\" +\n            \"753\" +\n            \"754\" +\n            \"755\" +\n            \"756\" +\n            \"757\" +\n            \"758\" +\n            \"759\" +\n            \"760\" +\n            \"761\" +\n            \"762\" +\n            \"763\" +\n            \"764\" +\n            \"765\" +\n            \"766\" +\n            \"767\" +\n            \"768\" +\n            \"769\" +\n            \"770\" +\n            \"771\" +\n            \"772\" +\n            \"773\" +\n            \"774\" +\n            \"775\" +\n            \"776\" +\n            \"777\" +\n            \"778\" +\n            \"779\" +\n            \"780\" +\n            \"781\" +\n            \"782\" +\n            \"783\" +\n            \"784\" +\n            \"785\" +\n            \"786\" +\n            \"787\" +\n            \"788\" +\n            \"789\" +\n            \"790\" +\n            \"791\" +\n            \"792\" +\n            \"793\" +\n            \"794\" +\n            \"795\" +\n            \"796\" +\n            \"797\" +\n            \"798\" +\n            \"799\" +\n            \"800\" +\n            \"801\" +\n            \"802\" +\n            \"803\" +\n            \"804\" +\n            \"805\" +\n            \"806\" +\n            \"807\" +\n            \"808\" +\n            \"809\" +\n            \"810\" +\n            \"811\" +\n            \"812\" +\n            \"813\" +\n            \"814\" +\n            \"815\" +\n            \"816\" +\n            \"817\" +\n            \"818\" +\n            \"819\" +\n            \"820\" +\n            \"821\" +\n            \"822\" +\n            \"823\" +\n            \"824\" +\n            \"825\" +\n            \"826\" +\n            \"827\" +\n            \"828\" +\n            \"829\" +\n            \"830\" +\n            \"831\" +\n            \"832\" +\n            \"833\" +\n            \"834\" +\n            \"835\" +\n            \"836\" +\n            \"837\" +\n            \"838\" +\n            \"839\" +\n            \"840\" +\n            \"841\" +\n            \"842\" +\n            \"843\" +\n            \"844\" +\n            \"845\" +\n            \"846\" +\n            \"847\" +\n            \"848\" +\n            \"849\" +\n            \"850\" +\n            \"851\" +\n            \"852\" +\n            \"853\" +\n            \"854\" +\n            \"855\" +\n            \"856\" +\n            \"857\" +\n            \"858\" +\n            \"859\" +\n            \"860\" +\n            \"861\" +\n            \"862\" +\n            \"863\" +\n            \"864\" +\n            \"865\" +\n            \"866\" +\n            \"867\" +\n            \"868\" +\n            \"869\" +\n            \"870\" +\n            \"871\" +\n            \"872\" +\n            \"873\" +\n            \"874\" +\n            \"875\" +\n            \"876\" +\n            \"877\" +\n            \"878\" +\n            \"879\" +\n            \"880\" +\n            \"881\" +\n            \"882\" +\n            \"883\" +\n            \"884\" +\n            \"885\" +\n            \"886\" +\n            \"887\" +\n            \"888\" +\n            \"889\" +\n            \"890\" +\n            \"891\" +\n            \"892\" +\n            \"893\" +\n            \"894\" +\n            \"895\" +\n            \"896\" +\n            \"897\" +\n            \"898\" +\n            \"899\" +\n            \"900\" +\n            \"901\" +\n            \"902\" +\n            \"903\" +\n            \"904\" +\n            \"905\" +\n            \"906\" +\n            \"907\" +\n            \"908\" +\n            \"909\" +\n            \"910\" +\n            \"911\" +\n            \"912\" +\n            \"913\" +\n            \"914\" +\n            \"915\" +\n            \"916\" +\n            \"917\" +\n            \"918\" +\n            \"919\" +\n            \"920\" +\n            \"921\" +\n            \"922\" +\n            \"923\" +\n            \"924\" +\n            \"925\" +\n            \"926\" +\n            \"927\" +\n            \"928\" +\n            \"929\" +\n            \"930\" +\n            \"931\" +\n            \"932\" +\n            \"933\" +\n            \"934\" +\n            \"935\" +\n            \"936\" +\n            \"937\" +\n            \"938\" +\n            \"939\" +\n            \"940\" +\n            \"941\" +\n            \"942\" +\n            \"943\" +\n            \"944\" +\n            \"945\" +\n            \"946\" +\n            \"947\" +\n            \"948\" +\n            \"949\" +\n            \"950\" +\n            \"951\" +\n            \"952\" +\n            \"953\" +\n            \"954\" +\n            \"955\" +\n            \"956\" +\n            \"957\" +\n            \"958\" +\n            \"959\" +\n            \"960\" +\n            \"961\" +\n            \"962\" +\n            \"963\" +\n            \"964\" +\n            \"965\" +\n            \"966\" +\n            \"967\" +\n            \"968\" +\n            \"969\" +\n            \"970\" +\n            \"971\" +\n            \"972\" +\n            \"973\" +\n            \"974\" +\n            \"975\" +\n            \"976\" +\n            \"977\" +\n            \"978\" +\n            \"979\" +\n            \"980\" +\n            \"981\" +\n            \"982\" +\n            \"983\" +\n            \"984\" +\n            \"985\" +\n            \"986\" +\n            \"987\" +\n            \"988\" +\n            \"989\" +\n            \"990\" +\n            \"991\" +\n            \"992\" +\n            \"993\" +\n            \"994\" +\n            \"995\" +\n            \"996\" +\n            \"997\" +\n            \"998\" +\n            \"999\" +\n            \"1000\" +\n            \"1001\" +\n            \"1002\" +\n            \"1003\" +\n            \"1004\" +\n            \"1005\" +\n            \"1006\" +\n            \"1007\" +\n            \"1008\" +\n            \"1009\" +\n            \"1010\" +\n            \"1011\" +\n            \"1012\" +\n            \"1013\" +\n            \"1014\" +\n            \"1015\" +\n            \"1016\" +\n            \"1017\" +\n            \"1018\" +\n            \"1019\" +\n            \"1020\" +\n            \"1021\" +\n            \"1022\" +\n            \"1023\" +\n            \"1024\" +\n            \"1025\" +\n            \"1026\" +\n            \"1027\" +\n            \"1028\" +\n            \"1029\" +\n            \"1030\" +\n            \"1031\" +\n            \"1032\" +\n            \"1033\" +\n            \"1034\" +\n            \"1035\" +\n            \"1036\" +\n            \"1037\" +\n            \"1038\" +\n            \"1039\" +\n            \"1040\" +\n            \"1041\" +\n            \"1042\" +\n            \"1043\" +\n            \"1044\" +\n            \"1045\" +\n            \"1046\" +\n            \"1047\" +\n            \"1048\" +\n            \"1049\" +\n            \"1050\" +\n            \"1051\" +\n            \"1052\" +\n            \"1053\" +\n            \"1054\" +\n            \"1055\" +\n            \"1056\" +\n            \"1057\" +\n            \"1058\" +\n            \"1059\" +\n            \"1060\" +\n            \"1061\" +\n            \"1062\" +\n            \"1063\" +\n            \"1064\" +\n            \"1065\" +\n            \"1066\" +\n            \"1067\" +\n            \"1068\" +\n            \"1069\" +\n            \"1070\" +\n            \"1071\" +\n            \"1072\" +\n            \"1073\" +\n            \"1074\" +\n            \"1075\" +\n            \"1076\" +\n            \"1077\" +\n            \"1078\" +\n            \"1079\" +\n            \"1080\" +\n            \"1081\" +\n            \"1082\" +\n            \"1083\" +\n            \"1084\" +\n            \"1085\" +\n            \"1086\" +\n            \"1087\" +\n            \"1088\" +\n            \"1089\" +\n            \"1090\" +\n            \"1091\" +\n            \"1092\" +\n            \"1093\" +\n            \"1094\" +\n            \"1095\" +\n            \"1096\" +\n            \"1097\" +\n            \"1098\" +\n            \"1099\" +\n            \"1100\" +\n            \"1101\" +\n            \"1102\" +\n            \"1103\" +\n            \"1104\" +\n            \"1105\" +\n            \"1106\" +\n            \"1107\" +\n            \"1108\" +\n            \"1109\" +\n            \"1110\" +\n            \"1111\" +\n            \"1112\" +\n            \"1113\" +\n            \"1114\" +\n            \"1115\" +\n            \"1116\" +\n            \"1117\" +\n            \"1118\" +\n            \"1119\" +\n            \"1120\" +\n            \"1121\" +\n            \"1122\" +\n            \"1123\" +\n            \"1124\" +\n            \"1125\" +\n            \"1126\" +\n            \"1127\" +\n            \"1128\" +\n            \"1129\" +\n            \"1130\" +\n            \"1131\" +\n            \"1132\" +\n            \"1133\" +\n            \"1134\" +\n            \"1135\" +\n            \"1136\" +\n            \"1137\" +\n            \"1138\" +\n            \"1139\" +\n            \"1140\" +\n            \"1141\" +\n            \"1142\" +\n            \"1143\" +\n            \"1144\" +\n            \"1145\" +\n            \"1146\" +\n            \"1147\" +\n            \"1148\" +\n            \"1149\" +\n            \"1150\" +\n            \"1151\" +\n            \"1152\" +\n            \"1153\" +\n            \"1154\" +\n            \"1155\" +\n            \"1156\" +\n            \"1157\" +\n            \"1158\" +\n            \"1159\" +\n            \"1160\" +\n            \"1161\" +\n            \"1162\" +\n            \"1163\" +\n            \"1164\" +\n            \"1165\" +\n            \"1166\" +\n            \"1167\" +\n            \"1168\" +\n            \"1169\" +\n            \"1170\" +\n            \"1171\" +\n            \"1172\" +\n            \"1173\" +\n            \"1174\" +\n            \"1175\" +\n            \"1176\" +\n            \"1177\" +\n            \"1178\" +\n            \"1179\" +\n            \"1180\" +\n            \"1181\" +\n            \"1182\" +\n            \"1183\" +\n            \"1184\" +\n            \"1185\" +\n            \"1186\" +\n            \"1187\" +\n            \"1188\" +\n            \"1189\" +\n            \"1190\" +\n            \"1191\" +\n            \"1192\" +\n            \"1193\" +\n            \"1194\" +\n            \"1195\" +\n            \"1196\" +\n            \"1197\" +\n            \"1198\" +\n            \"1199\" +\n            \"1200\" +\n            \"1201\" +\n            \"1202\" +\n            \"1203\" +\n            \"1204\" +\n            \"1205\" +\n            \"1206\" +\n            \"1207\" +\n            \"1208\" +\n            \"1209\" +\n            \"1210\" +\n            \"1211\" +\n            \"1212\" +\n            \"1213\" +\n            \"1214\" +\n            \"1215\" +\n            \"1216\" +\n            \"1217\" +\n            \"1218\" +\n            \"1219\" +\n            \"1220\" +\n            \"1221\" +\n            \"1222\" +\n            \"1223\" +\n            \"1224\" +\n            \"1225\" +\n            \"1226\" +\n            \"1227\" +\n            \"1228\" +\n            \"1229\" +\n            \"1230\" +\n            \"1231\" +\n            \"1232\" +\n            \"1233\" +\n            \"1234\" +\n            \"1235\" +\n            \"1236\" +\n            \"1237\" +\n            \"1238\" +\n            \"1239\" +\n            \"1240\" +\n            \"1241\" +\n            \"1242\" +\n            \"1243\" +\n            \"1244\" +\n            \"1245\" +\n            \"1246\" +\n            \"1247\" +\n            \"1248\" +\n            \"1249\" +\n            \"1250\" +\n            \"1251\" +\n            \"1252\" +\n            \"1253\" +\n            \"1254\" +\n            \"1255\" +\n            \"1256\" +\n            \"1257\" +\n            \"1258\" +\n            \"1259\" +\n            \"1260\" +\n            \"1261\" +\n            \"1262\" +\n            \"1263\" +\n            \"1264\" +\n            \"1265\" +\n            \"1266\" +\n            \"1267\" +\n            \"1268\" +\n            \"1269\" +\n            \"1270\" +\n            \"1271\" +\n            \"1272\" +\n            \"1273\" +\n            \"1274\" +\n            \"1275\" +\n            \"1276\" +\n            \"1277\" +\n            \"1278\" +\n            \"1279\" +\n            \"1280\" +\n            \"1281\" +\n            \"1282\" +\n            \"1283\" +\n            \"1284\" +\n            \"1285\" +\n            \"1286\" +\n            \"1287\" +\n            \"1288\" +\n            \"1289\" +\n            \"1290\" +\n            \"1291\" +\n            \"1292\" +\n            \"1293\" +\n            \"1294\" +\n            \"1295\" +\n            \"1296\" +\n            \"1297\" +\n            \"1298\" +\n            \"1299\" +\n            \"1300\" +\n            \"1301\" +\n            \"1302\" +\n            \"1303\" +\n            \"1304\" +\n            \"1305\" +\n            \"1306\" +\n            \"1307\" +\n            \"1308\" +\n            \"1309\" +\n            \"1310\" +\n            \"1311\" +\n            \"1312\" +\n            \"1313\" +\n            \"1314\" +\n            \"1315\" +\n            \"1316\" +\n            \"1317\" +\n            \"1318\" +\n            \"1319\" +\n            \"1320\" +\n            \"1321\" +\n            \"1322\" +\n            \"1323\" +\n            \"1324\" +\n            \"1325\" +\n            \"1326\" +\n            \"1327\" +\n            \"1328\" +\n            \"1329\" +\n            \"1330\" +\n            \"1331\" +\n            \"1332\" +\n            \"1333\" +\n            \"1334\" +\n            \"1335\" +\n            \"1336\" +\n            \"1337\" +\n            \"1338\" +\n            \"1339\" +\n            \"1340\" +\n            \"1341\" +\n            \"1342\" +\n            \"1343\" +\n            \"1344\" +\n            \"1345\" +\n            \"1346\" +\n            \"1347\" +\n            \"1348\" +\n            \"1349\" +\n            \"1350\" +\n            \"1351\" +\n            \"1352\" +\n            \"1353\" +\n            \"1354\" +\n            \"1355\" +\n            \"1356\" +\n            \"1357\" +\n            \"1358\" +\n            \"1359\" +\n            \"1360\" +\n            \"1361\" +\n            \"1362\" +\n            \"1363\" +\n            \"1364\" +\n            \"1365\" +\n            \"1366\" +\n            \"1367\" +\n            \"1368\" +\n            \"1369\" +\n            \"1370\" +\n            \"1371\" +\n            \"1372\" +\n            \"1373\" +\n            \"1374\" +\n            \"1375\" +\n            \"1376\" +\n            \"1377\" +\n            \"1378\" +\n            \"1379\" +\n            \"1380\" +\n            \"1381\" +\n            \"1382\" +\n            \"1383\" +\n            \"1384\" +\n            \"1385\" +\n            \"1386\" +\n            \"1387\" +\n            \"1388\" +\n            \"1389\" +\n            \"1390\" +\n            \"1391\" +\n            \"1392\" +\n            \"1393\" +\n            \"1394\" +\n            \"1395\" +\n            \"1396\" +\n            \"1397\" +\n            \"1398\" +\n            \"1399\" +\n            \"1400\" +\n            \"1401\" +\n            \"1402\" +\n            \"1403\" +\n            \"1404\" +\n            \"1405\" +\n            \"1406\" +\n            \"1407\" +\n            \"1408\" +\n            \"1409\" +\n            \"1410\" +\n            \"1411\" +\n            \"1412\" +\n            \"1413\" +\n            \"1414\" +\n            \"1415\" +\n            \"1416\" +\n            \"1417\" +\n            \"1418\" +\n            \"1419\" +\n            \"1420\" +\n            \"1421\" +\n            \"1422\" +\n            \"1423\" +\n            \"1424\" +\n            \"1425\" +\n            \"1426\" +\n            \"1427\" +\n            \"1428\" +\n            \"1429\" +\n            \"1430\" +\n            \"1431\" +\n            \"1432\" +\n            \"1433\" +\n            \"1434\" +\n            \"1435\" +\n            \"1436\" +\n            \"1437\" +\n            \"1438\" +\n            \"1439\" +\n            \"1440\" +\n            \"1441\" +\n            \"1442\" +\n            \"1443\" +\n            \"1444\" +\n            \"1445\" +\n            \"1446\" +\n            \"1447\" +\n            \"1448\" +\n            \"1449\" +\n            \"1450\" +\n            \"1451\" +\n            \"1452\" +\n            \"1453\" +\n            \"1454\" +\n            \"1455\" +\n            \"1456\" +\n            \"1457\" +\n            \"1458\" +\n            \"1459\" +\n            \"1460\" +\n            \"1461\" +\n            \"1462\" +\n            \"1463\" +\n            \"1464\" +\n            \"1465\" +\n            \"1466\" +\n            \"1467\" +\n            \"1468\" +\n            \"1469\" +\n            \"1470\" +\n            \"1471\" +\n            \"1472\" +\n            \"1473\" +\n            \"1474\" +\n            \"1475\" +\n            \"1476\" +\n            \"1477\" +\n            \"1478\" +\n            \"1479\" +\n            \"1480\" +\n            \"1481\" +\n            \"1482\" +\n            \"1483\" +\n            \"1484\" +\n            \"1485\" +\n            \"1486\" +\n            \"1487\" +\n            \"1488\" +\n            \"1489\" +\n            \"1490\" +\n            \"1491\" +\n            \"1492\" +\n            \"1493\" +\n            \"1494\" +\n            \"1495\" +\n            \"1496\" +\n            \"1497\" +\n            \"1498\" +\n            \"1499\" +\n            \"1500\" +\n            \"1501\" +\n            \"1502\" +\n            \"1503\" +\n            \"1504\" +\n            \"1505\" +\n            \"1506\" +\n            \"1507\" +\n            \"1508\" +\n            \"1509\" +\n            \"1510\" +\n            \"1511\" +\n            \"1512\" +\n            \"1513\" +\n            \"1514\" +\n            \"1515\" +\n            \"1516\" +\n            \"1517\" +\n            \"1518\" +\n            \"1519\" +\n            \"1520\" +\n            \"1521\" +\n            \"1522\" +\n            \"1523\" +\n            \"1524\" +\n            \"1525\" +\n            \"1526\" +\n            \"1527\" +\n            \"1528\" +\n            \"1529\" +\n            \"1530\" +\n            \"1531\" +\n            \"1532\" +\n            \"1533\" +\n            \"1534\" +\n            \"1535\" +\n            \"1536\" +\n            \"1537\" +\n            \"1538\" +\n            \"1539\" +\n            \"1540\" +\n            \"1541\" +\n            \"1542\" +\n            \"1543\" +\n            \"1544\" +\n            \"1545\" +\n            \"1546\" +\n            \"1547\" +\n            \"1548\" +\n            \"1549\" +\n            \"1550\" +\n            \"1551\" +\n            \"1552\" +\n            \"1553\" +\n            \"1554\" +\n            \"1555\" +\n            \"1556\" +\n            \"1557\" +\n            \"1558\" +\n            \"1559\" +\n            \"1560\" +\n            \"1561\" +\n            \"1562\" +\n            \"1563\" +\n            \"1564\" +\n            \"1565\" +\n            \"1566\" +\n            \"1567\" +\n            \"1568\" +\n            \"1569\" +\n            \"1570\" +\n            \"1571\" +\n            \"1572\" +\n            \"1573\" +\n            \"1574\" +\n            \"1575\" +\n            \"1576\" +\n            \"1577\" +\n            \"1578\" +\n            \"1579\" +\n            \"1580\" +\n            \"1581\" +\n            \"1582\" +\n            \"1583\" +\n            \"1584\" +\n            \"1585\" +\n            \"1586\" +\n            \"1587\" +\n            \"1588\" +\n            \"1589\" +\n            \"1590\" +\n            \"1591\" +\n            \"1592\" +\n            \"1593\" +\n            \"1594\" +\n            \"1595\" +\n            \"1596\" +\n            \"1597\" +\n            \"1598\" +\n            \"1599\" +\n            \"1600\" +\n            \"1601\" +\n            \"1602\" +\n            \"1603\" +\n            \"1604\" +\n            \"1605\" +\n            \"1606\" +\n            \"1607\" +\n            \"1608\" +\n            \"1609\" +\n            \"1610\" +\n            \"1611\" +\n            \"1612\" +\n            \"1613\" +\n            \"1614\" +\n            \"1615\" +\n            \"1616\" +\n            \"1617\" +\n            \"1618\" +\n            \"1619\" +\n            \"1620\" +\n            \"1621\" +\n            \"1622\" +\n            \"1623\" +\n            \"1624\" +\n            \"1625\" +\n            \"1626\" +\n            \"1627\" +\n            \"1628\" +\n            \"1629\" +\n            \"1630\" +\n            \"1631\" +\n            \"1632\" +\n            \"1633\" +\n            \"1634\" +\n            \"1635\" +\n            \"1636\" +\n            \"1637\" +\n            \"1638\" +\n            \"1639\" +\n            \"1640\" +\n            \"1641\" +\n            \"1642\" +\n            \"1643\" +\n            \"1644\" +\n            \"1645\" +\n            \"1646\" +\n            \"1647\" +\n            \"1648\" +\n            \"1649\" +\n            \"1650\" +\n            \"1651\" +\n            \"1652\" +\n            \"1653\" +\n            \"1654\" +\n            \"1655\" +\n            \"1656\" +\n            \"1657\" +\n            \"1658\" +\n            \"1659\" +\n            \"1660\" +\n            \"1661\" +\n            \"1662\" +\n            \"1663\" +\n            \"1664\" +\n            \"1665\" +\n            \"1666\" +\n            \"1667\" +\n            \"1668\" +\n            \"1669\" +\n            \"1670\" +\n            \"1671\" +\n            \"1672\" +\n            \"1673\" +\n            \"1674\" +\n            \"1675\" +\n            \"1676\" +\n            \"1677\" +\n            \"1678\" +\n            \"1679\" +\n            \"1680\" +\n            \"1681\" +\n            \"1682\" +\n            \"1683\" +\n            \"1684\" +\n            \"1685\" +\n            \"1686\" +\n            \"1687\" +\n            \"1688\" +\n            \"1689\" +\n            \"1690\" +\n            \"1691\" +\n            \"1692\" +\n            \"1693\" +\n            \"1694\" +\n            \"1695\" +\n            \"1696\" +\n            \"1697\" +\n            \"1698\" +\n            \"1699\" +\n            \"1700\" +\n            \"1701\" +\n            \"1702\" +\n            \"1703\" +\n            \"1704\" +\n            \"1705\" +\n            \"1706\" +\n            \"1707\" +\n            \"1708\" +\n            \"1709\" +\n            \"1710\" +\n            \"1711\" +\n            \"1712\" +\n            \"1713\" +\n            \"1714\" +\n            \"1715\" +\n            \"1716\" +\n            \"1717\" +\n            \"1718\" +\n            \"1719\" +\n            \"1720\" +\n            \"1721\" +\n            \"1722\" +\n            \"1723\" +\n            \"1724\" +\n            \"1725\" +\n            \"1726\" +\n            \"1727\" +\n            \"1728\" +\n            \"1729\" +\n            \"1730\" +\n            \"1731\" +\n            \"1732\" +\n            \"1733\" +\n            \"1734\" +\n            \"1735\" +\n            \"1736\" +\n            \"1737\" +\n            \"1738\" +\n            \"1739\" +\n            \"1740\" +\n            \"1741\" +\n            \"1742\" +\n            \"1743\" +\n            \"1744\" +\n            \"1745\" +\n            \"1746\" +\n            \"1747\" +\n            \"1748\" +\n            \"1749\" +\n            \"1750\" +\n            \"1751\" +\n            \"1752\" +\n            \"1753\" +\n            \"1754\" +\n            \"1755\" +\n            \"1756\" +\n            \"1757\" +\n            \"1758\" +\n            \"1759\" +\n            \"1760\" +\n            \"1761\" +\n            \"1762\" +\n            \"1763\" +\n            \"1764\" +\n            \"1765\" +\n            \"1766\" +\n            \"1767\" +\n            \"1768\" +\n            \"1769\" +\n            \"1770\" +\n            \"1771\" +\n            \"1772\" +\n            \"1773\" +\n            \"1774\" +\n            \"1775\" +\n            \"1776\" +\n            \"1777\" +\n            \"1778\" +\n            \"1779\" +\n            \"1780\" +\n            \"1781\" +\n            \"1782\" +\n            \"1783\" +\n            \"1784\" +\n            \"1785\" +\n            \"1786\" +\n            \"1787\" +\n            \"1788\" +\n            \"1789\" +\n            \"1790\" +\n            \"1791\" +\n            \"1792\" +\n            \"1793\" +\n            \"1794\" +\n            \"1795\" +\n            \"1796\" +\n            \"1797\" +\n            \"1798\" +\n            \"1799\" +\n            \"1800\" +\n            \"1801\" +\n            \"1802\" +\n            \"1803\" +\n            \"1804\" +\n            \"1805\" +\n            \"1806\" +\n            \"1807\" +\n            \"1808\" +\n            \"1809\" +\n            \"1810\" +\n            \"1811\" +\n            \"1812\" +\n            \"1813\" +\n            \"1814\" +\n            \"1815\" +\n            \"1816\" +\n            \"1817\" +\n            \"1818\" +\n            \"1819\" +\n            \"1820\" +\n            \"1821\" +\n            \"1822\" +\n            \"1823\" +\n            \"1824\" +\n            \"1825\" +\n            \"1826\" +\n            \"1827\" +\n            \"1828\" +\n            \"1829\" +\n            \"1830\" +\n            \"1831\" +\n            \"1832\" +\n            \"1833\" +\n            \"1834\" +\n            \"1835\" +\n            \"1836\" +\n            \"1837\" +\n            \"1838\" +\n            \"1839\" +\n            \"1840\" +\n            \"1841\" +\n            \"1842\" +\n            \"1843\" +\n            \"1844\" +\n            \"1845\" +\n            \"1846\" +\n            \"1847\" +\n            \"1848\" +\n            \"1849\" +\n            \"1850\" +\n            \"1851\" +\n            \"1852\" +\n            \"1853\" +\n            \"1854\" +\n            \"1855\" +\n            \"1856\" +\n            \"1857\" +\n            \"1858\" +\n            \"1859\" +\n            \"1860\" +\n            \"1861\" +\n            \"1862\" +\n            \"1863\" +\n            \"1864\" +\n            \"1865\" +\n            \"1866\" +\n            \"1867\" +\n            \"1868\" +\n            \"1869\" +\n            \"1870\" +\n            \"1871\" +\n            \"1872\" +\n            \"1873\" +\n            \"1874\" +\n            \"1875\" +\n            \"1876\" +\n            \"1877\" +\n            \"1878\" +\n            \"1879\" +\n            \"1880\" +\n            \"1881\" +\n            \"1882\" +\n            \"1883\" +\n            \"1884\" +\n            \"1885\" +\n            \"1886\" +\n            \"1887\" +\n            \"1888\" +\n            \"1889\" +\n            \"1890\" +\n            \"1891\" +\n            \"1892\" +\n            \"1893\" +\n            \"1894\" +\n            \"1895\" +\n            \"1896\" +\n            \"1897\" +\n            \"1898\" +\n            \"1899\" +\n            \"1900\" +\n            \"1901\" +\n            \"1902\" +\n            \"1903\" +\n            \"1904\" +\n            \"1905\" +\n            \"1906\" +\n            \"1907\" +\n            \"1908\" +\n            \"1909\" +\n            \"1910\" +\n            \"1911\" +\n            \"1912\" +\n            \"1913\" +\n            \"1914\" +\n            \"1915\" +\n            \"1916\" +\n            \"1917\" +\n            \"1918\" +\n            \"1919\" +\n            \"1920\" +\n            \"1921\" +\n            \"1922\" +\n            \"1923\" +\n            \"1924\" +\n            \"1925\" +\n            \"1926\" +\n            \"1927\" +\n            \"1928\" +\n            \"1929\" +\n            \"1930\" +\n            \"1931\" +\n            \"1932\" +\n            \"1933\" +\n            \"1934\" +\n            \"1935\" +\n            \"1936\" +\n            \"1937\" +\n            \"1938\" +\n            \"1939\" +\n            \"1940\" +\n            \"1941\" +\n            \"1942\" +\n            \"1943\" +\n            \"1944\" +\n            \"1945\" +\n            \"1946\" +\n            \"1947\" +\n            \"1948\" +\n            \"1949\" +\n            \"1950\" +\n            \"1951\" +\n            \"1952\" +\n            \"1953\" +\n            \"1954\" +\n            \"1955\" +\n            \"1956\" +\n            \"1957\" +\n            \"1958\" +\n            \"1959\" +\n            \"1960\" +\n            \"1961\" +\n            \"1962\" +\n            \"1963\" +\n            \"1964\" +\n            \"1965\" +\n            \"1966\" +\n            \"1967\" +\n            \"1968\" +\n            \"1969\" +\n            \"1970\" +\n            \"1971\" +\n            \"1972\" +\n            \"1973\" +\n            \"1974\" +\n            \"1975\" +\n            \"1976\" +\n            \"1977\" +\n            \"1978\" +\n            \"1979\" +\n            \"1980\" +\n            \"1981\" +\n            \"1982\" +\n            \"1983\" +\n            \"1984\" +\n            \"1985\" +\n            \"1986\" +\n            \"1987\" +\n            \"1988\" +\n            \"1989\" +\n            \"1990\" +\n            \"1991\" +\n            \"1992\" +\n            \"1993\" +\n            \"1994\" +\n            \"1995\" +\n            \"1996\" +\n            \"1997\" +\n            \"1998\" +\n            \"1999\" +\n            \"2000\" +\n            \"2001\" +\n            \"2002\" +\n            \"2003\" +\n            \"2004\" +\n            \"2005\" +\n            \"2006\" +\n            \"2007\" +\n            \"2008\" +\n            \"2009\" +\n            \"2010\" +\n            \"2011\" +\n            \"2012\" +\n            \"2013\" +\n            \"2014\" +\n            \"2015\" +\n            \"2016\" +\n            \"2017\" +\n            \"2018\" +\n            \"2019\" +\n            \"2020\" +\n            \"2021\" +\n            \"2022\" +\n            \"2023\" +\n            \"2024\" +\n            \"2025\" +\n            \"2026\" +\n            \"2027\" +\n            \"2028\" +\n            \"2029\" +\n            \"2030\" +\n            \"2031\" +\n            \"2032\" +\n            \"2033\" +\n            \"2034\" +\n            \"2035\" +\n            \"2036\" +\n            \"2037\" +\n            \"2038\" +\n            \"2039\" +\n            \"2040\" +\n            \"2041\" +\n            \"2042\" +\n            \"2043\" +\n            \"2044\" +\n            \"2045\" +\n            \"2046\" +\n            \"2047\" +\n            \"2048\" +\n            \"2049\" +\n            \"2050\" +\n            \"2051\" +\n            \"2052\" +\n            \"2053\" +\n            \"2054\" +\n            \"2055\" +\n            \"2056\" +\n            \"2057\" +\n            \"2058\" +\n            \"2059\" +\n            \"2060\" +\n            \"2061\" +\n            \"2062\" +\n            \"2063\" +\n            \"2064\" +\n            \"2065\" +\n            \"2066\" +\n            \"2067\" +\n            \"2068\" +\n            \"2069\" +\n            \"2070\" +\n            \"2071\" +\n            \"2072\" +\n            \"2073\" +\n            \"2074\" +\n            \"2075\" +\n            \"2076\" +\n            \"2077\" +\n            \"2078\" +\n            \"2079\" +\n            \"2080\" +\n            \"2081\" +\n            \"2082\" +\n            \"2083\" +\n            \"2084\" +\n            \"2085\" +\n            \"2086\" +\n            \"2087\" +\n            \"2088\" +\n            \"2089\" +\n            \"2090\" +\n            \"2091\" +\n            \"2092\" +\n            \"2093\" +\n            \"2094\" +\n            \"2095\" +\n            \"2096\" +\n            \"2097\" +\n            \"2098\" +\n            \"2099\" +\n            \"2100\" +\n            \"2101\" +\n            \"2102\" +\n            \"2103\" +\n            \"2104\" +\n            \"2105\" +\n            \"2106\" +\n            \"2107\" +\n            \"2108\" +\n            \"2109\" +\n            \"2110\" +\n            \"2111\" +\n            \"2112\" +\n            \"2113\" +\n            \"2114\" +\n            \"2115\" +\n            \"2116\" +\n            \"2117\" +\n            \"2118\" +\n            \"2119\" +\n            \"2120\" +\n            \"2121\" +\n            \"2122\" +\n            \"2123\" +\n            \"2124\" +\n            \"2125\" +\n            \"2126\" +\n            \"2127\" +\n            \"2128\" +\n            \"2129\" +\n            \"2130\" +\n            \"2131\" +\n            \"2132\" +\n            \"2133\" +\n            \"2134\" +\n            \"2135\" +\n            \"2136\" +\n            \"2137\" +\n            \"2138\" +\n            \"2139\" +\n            \"2140\" +\n            \"2141\" +\n            \"2142\" +\n            \"2143\" +\n            \"2144\" +\n            \"2145\" +\n            \"2146\" +\n            \"2147\" +\n            \"2148\" +\n            \"2149\" +\n            \"2150\" +\n            \"2151\" +\n            \"2152\" +\n            \"2153\" +\n            \"2154\" +\n            \"2155\" +\n            \"2156\" +\n            \"2157\" +\n            \"2158\" +\n            \"2159\" +\n            \"2160\" +\n            \"2161\" +\n            \"2162\" +\n            \"2163\" +\n            \"2164\" +\n            \"2165\" +\n            \"2166\" +\n            \"2167\" +\n            \"2168\" +\n            \"2169\" +\n            \"2170\" +\n            \"2171\" +\n            \"2172\" +\n            \"2173\" +\n            \"2174\" +\n            \"2175\" +\n            \"2176\" +\n            \"2177\" +\n            \"2178\" +\n            \"2179\" +\n            \"2180\" +\n            \"2181\" +\n            \"2182\" +\n            \"2183\" +\n            \"2184\" +\n            \"2185\" +\n            \"2186\" +\n            \"2187\" +\n            \"2188\" +\n            \"2189\" +\n            \"2190\" +\n            \"2191\" +\n            \"2192\" +\n            \"2193\" +\n            \"2194\" +\n            \"2195\" +\n            \"2196\" +\n            \"2197\" +\n            \"2198\" +\n            \"2199\" +\n            \"2200\" +\n            \"2201\" +\n            \"2202\" +\n            \"2203\" +\n            \"2204\" +\n            \"2205\" +\n            \"2206\" +\n            \"2207\" +\n            \"2208\" +\n            \"2209\" +\n            \"2210\" +\n            \"2211\" +\n            \"2212\" +\n            \"2213\" +\n            \"2214\" +\n            \"2215\" +\n            \"2216\" +\n            \"2217\" +\n            \"2218\" +\n            \"2219\" +\n            \"2220\" +\n            \"2221\" +\n            \"2222\" +\n            \"2223\" +\n            \"2224\" +\n            \"2225\" +\n            \"2226\" +\n            \"2227\" +\n            \"2228\" +\n            \"2229\" +\n            \"2230\" +\n            \"2231\" +\n            \"2232\" +\n            \"2233\" +\n            \"2234\" +\n            \"2235\" +\n            \"2236\" +\n            \"2237\" +\n            \"2238\" +\n            \"2239\" +\n            \"2240\" +\n            \"2241\" +\n            \"2242\" +\n            \"2243\" +\n            \"2244\" +\n            \"2245\" +\n            \"2246\" +\n            \"2247\" +\n            \"2248\" +\n            \"2249\" +\n            \"2250\" +\n            \"2251\" +\n            \"2252\" +\n            \"2253\" +\n            \"2254\" +\n            \"2255\" +\n            \"2256\" +\n            \"2257\" +\n            \"2258\" +\n            \"2259\" +\n            \"2260\" +\n            \"2261\" +\n            \"2262\" +\n            \"2263\" +\n            \"2264\" +\n            \"2265\" +\n            \"2266\" +\n            \"2267\" +\n            \"2268\" +\n            \"2269\" +\n            \"2270\" +\n            \"2271\" +\n            \"2272\" +\n            \"2273\" +\n            \"2274\" +\n            \"2275\" +\n            \"2276\" +\n            \"2277\" +\n            \"2278\" +\n            \"2279\" +\n            \"2280\" +\n            \"2281\" +\n            \"2282\" +\n            \"2283\" +\n            \"2284\" +\n            \"2285\" +\n            \"2286\" +\n            \"2287\" +\n            \"2288\" +\n            \"2289\" +\n            \"2290\" +\n            \"2291\" +\n            \"2292\" +\n            \"2293\" +\n            \"2294\" +\n            \"2295\" +\n            \"2296\" +\n            \"2297\" +\n            \"2298\" +\n            \"2299\" +\n            \"2300\" +\n            \"2301\" +\n            \"2302\" +\n            \"2303\" +\n            \"2304\" +\n            \"2305\" +\n            \"2306\" +\n            \"2307\" +\n            \"2308\" +\n            \"2309\" +\n            \"2310\" +\n            \"2311\" +\n            \"2312\" +\n            \"2313\" +\n            \"2314\" +\n            \"2315\" +\n            \"2316\" +\n            \"2317\" +\n            \"2318\" +\n            \"2319\" +\n            \"2320\" +\n            \"2321\" +\n            \"2322\" +\n            \"2323\" +\n            \"2324\" +\n            \"2325\" +\n            \"2326\" +\n            \"2327\" +\n            \"2328\" +\n            \"2329\" +\n            \"2330\" +\n            \"2331\" +\n            \"2332\" +\n            \"2333\" +\n            \"2334\" +\n            \"2335\" +\n            \"2336\" +\n            \"2337\" +\n            \"2338\" +\n            \"2339\" +\n            \"2340\" +\n            \"2341\" +\n            \"2342\" +\n            \"2343\" +\n            \"2344\" +\n            \"2345\" +\n            \"2346\" +\n            \"2347\" +\n            \"2348\" +\n            \"2349\" +\n            \"2350\" +\n            \"2351\" +\n            \"2352\" +\n            \"2353\" +\n            \"2354\" +\n            \"2355\" +\n            \"2356\" +\n            \"2357\" +\n            \"2358\" +\n            \"2359\" +\n            \"2360\" +\n            \"2361\" +\n            \"2362\" +\n            \"2363\" +\n            \"2364\" +\n            \"2365\" +\n            \"2366\" +\n            \"2367\" +\n            \"2368\" +\n            \"2369\" +\n            \"2370\" +\n            \"2371\" +\n            \"2372\" +\n            \"2373\" +\n            \"2374\" +\n            \"2375\" +\n            \"2376\" +\n            \"2377\" +\n            \"2378\" +\n            \"2379\" +\n            \"2380\" +\n            \"2381\" +\n            \"2382\" +\n            \"2383\" +\n            \"2384\" +\n            \"2385\" +\n            \"2386\" +\n            \"2387\" +\n            \"2388\" +\n            \"2389\" +\n            \"2390\" +\n            \"2391\" +\n            \"2392\" +\n            \"2393\" +\n            \"2394\" +\n            \"2395\" +\n            \"2396\" +\n            \"2397\" +\n            \"2398\" +\n            \"2399\" +\n            \"2400\" +\n            \"2401\" +\n            \"2402\" +\n            \"2403\" +\n            \"2404\" +\n            \"2405\" +\n            \"2406\" +\n            \"2407\" +\n            \"2408\" +\n            \"2409\" +\n            \"2410\" +\n            \"2411\" +\n            \"2412\" +\n            \"2413\" +\n            \"2414\" +\n            \"2415\" +\n            \"2416\" +\n            \"2417\" +\n            \"2418\" +\n            \"2419\" +\n            \"2420\" +\n            \"2421\" +\n            \"2422\" +\n            \"2423\" +\n            \"2424\" +\n            \"2425\" +\n            \"2426\" +\n            \"2427\" +\n            \"2428\" +\n            \"2429\" +\n            \"2430\" +\n            \"2431\" +\n            \"2432\" +\n            \"2433\" +\n            \"2434\" +\n            \"2435\" +\n            \"2436\" +\n            \"2437\" +\n            \"2438\" +\n            \"2439\" +\n            \"2440\" +\n            \"2441\" +\n            \"2442\" +\n            \"2443\" +\n            \"2444\" +\n            \"2445\" +\n            \"2446\" +\n            \"2447\" +\n            \"2448\" +\n            \"2449\" +\n            \"2450\" +\n            \"2451\" +\n            \"2452\" +\n            \"2453\" +\n            \"2454\" +\n            \"2455\" +\n            \"2456\" +\n            \"2457\" +\n            \"2458\" +\n            \"2459\" +\n            \"2460\" +\n            \"2461\" +\n            \"2462\" +\n            \"2463\" +\n            \"2464\" +\n            \"2465\" +\n            \"2466\" +\n            \"2467\" +\n            \"2468\" +\n            \"2469\" +\n            \"2470\" +\n            \"2471\" +\n            \"2472\" +\n            \"2473\" +\n            \"2474\" +\n            \"2475\" +\n            \"2476\" +\n            \"2477\" +\n            \"2478\" +\n            \"2479\" +\n            \"2480\" +\n            \"2481\" +\n            \"2482\" +\n            \"2483\" +\n            \"2484\" +\n            \"2485\" +\n            \"2486\" +\n            \"2487\" +\n            \"2488\" +\n            \"2489\" +\n            \"2490\" +\n            \"2491\" +\n            \"2492\" +\n            \"2493\" +\n            \"2494\" +\n            \"2495\" +\n            \"2496\" +\n            \"2497\" +\n            \"2498\" +\n            \"2499\" +\n            \"2500\" +\n            \"2501\" +\n            \"2502\" +\n            \"2503\" +\n            \"2504\" +\n            \"2505\" +\n            \"2506\" +\n            \"2507\" +\n            \"2508\" +\n            \"2509\" +\n            \"2510\" +\n            \"2511\" +\n            \"2512\" +\n            \"2513\" +\n            \"2514\" +\n            \"2515\" +\n            \"2516\" +\n            \"2517\" +\n            \"2518\" +\n            \"2519\" +\n            \"2520\" +\n            \"2521\" +\n            \"2522\" +\n            \"2523\" +\n            \"2524\" +\n            \"2525\" +\n            \"2526\" +\n            \"2527\" +\n            \"2528\" +\n            \"2529\" +\n            \"2530\" +\n            \"2531\" +\n            \"2532\" +\n            \"2533\" +\n            \"2534\" +\n            \"2535\" +\n            \"2536\" +\n            \"2537\" +\n            \"2538\" +\n            \"2539\" +\n            \"2540\" +\n            \"2541\" +\n            \"2542\" +\n            \"2543\" +\n            \"2544\" +\n            \"2545\" +\n            \"2546\" +\n            \"2547\" +\n            \"2548\" +\n            \"2549\" +\n            \"2550\" +\n            \"2551\" +\n            \"2552\" +\n            \"2553\" +\n            \"2554\" +\n            \"2555\" +\n            \"2556\" +\n            \"2557\" +\n            \"2558\" +\n            \"2559\" +\n            \"2560\" +\n            \"2561\" +\n            \"2562\" +\n            \"2563\" +\n            \"2564\" +\n            \"2565\" +\n            \"2566\" +\n            \"2567\" +\n            \"2568\" +\n            \"2569\" +\n            \"2570\" +\n            \"2571\" +\n            \"2572\" +\n            \"2573\" +\n            \"2574\" +\n            \"2575\" +\n            \"2576\" +\n            \"2577\" +\n            \"2578\" +\n            \"2579\" +\n            \"2580\" +\n            \"2581\" +\n            \"2582\" +\n            \"2583\" +\n            \"2584\" +\n            \"2585\" +\n            \"2586\" +\n            \"2587\" +\n            \"2588\" +\n            \"2589\" +\n            \"2590\" +\n            \"2591\" +\n            \"2592\" +\n            \"2593\" +\n            \"2594\" +\n            \"2595\" +\n            \"2596\" +\n            \"2597\" +\n            \"2598\" +\n            \"2599\" +\n            \"2600\" +\n            \"2601\" +\n            \"2602\" +\n            \"2603\" +\n            \"2604\" +\n            \"2605\" +\n            \"2606\" +\n            \"2607\" +\n            \"2608\" +\n            \"2609\" +\n            \"2610\" +\n            \"2611\" +\n            \"2612\" +\n            \"2613\" +\n            \"2614\" +\n            \"2615\" +\n            \"2616\" +\n            \"2617\" +\n            \"2618\" +\n            \"2619\" +\n            \"2620\" +\n            \"2621\" +\n            \"2622\" +\n            \"2623\" +\n            \"2624\" +\n            \"2625\" +\n            \"2626\" +\n            \"2627\" +\n            \"2628\" +\n            \"2629\" +\n            \"2630\" +\n            \"2631\" +\n            \"2632\" +\n            \"2633\" +\n            \"2634\" +\n            \"2635\" +\n            \"2636\" +\n            \"2637\" +\n            \"2638\" +\n            \"2639\" +\n            \"2640\" +\n            \"2641\" +\n            \"2642\" +\n            \"2643\" +\n            \"2644\" +\n            \"2645\" +\n            \"2646\" +\n            \"2647\" +\n            \"2648\" +\n            \"2649\" +\n            \"2650\" +\n            \"2651\" +\n            \"2652\" +\n            \"2653\" +\n            \"2654\" +\n            \"2655\" +\n            \"2656\" +\n            \"2657\" +\n            \"2658\" +\n            \"2659\" +\n            \"2660\" +\n            \"2661\" +\n            \"2662\" +\n            \"2663\" +\n            \"2664\" +\n            \"2665\" +\n            \"2666\" +\n            \"2667\" +\n            \"2668\" +\n            \"2669\" +\n            \"2670\" +\n            \"2671\" +\n            \"2672\" +\n            \"2673\" +\n            \"2674\" +\n            \"2675\" +\n            \"2676\" +\n            \"2677\" +\n            \"2678\" +\n            \"2679\" +\n            \"2680\" +\n            \"2681\" +\n            \"2682\" +\n            \"2683\" +\n            \"2684\" +\n            \"2685\" +\n            \"2686\" +\n            \"2687\" +\n            \"2688\" +\n            \"2689\" +\n            \"2690\" +\n            \"2691\" +\n            \"2692\" +\n            \"2693\" +\n            \"2694\" +\n            \"2695\" +\n            \"2696\" +\n            \"2697\" +\n            \"2698\" +\n            \"2699\" +\n            \"2700\" +\n            \"2701\" +\n            \"2702\" +\n            \"2703\" +\n            \"2704\" +\n            \"2705\" +\n            \"2706\" +\n            \"2707\" +\n            \"2708\" +\n            \"2709\" +\n            \"2710\" +\n            \"2711\" +\n            \"2712\" +\n            \"2713\" +\n            \"2714\" +\n            \"2715\" +\n            \"2716\" +\n            \"2717\" +\n            \"2718\" +\n            \"2719\" +\n            \"2720\" +\n            \"2721\" +\n            \"2722\" +\n            \"2723\" +\n            \"2724\" +\n            \"2725\" +\n            \"2726\" +\n            \"2727\" +\n            \"2728\" +\n            \"2729\" +\n            \"2730\" +\n            \"2731\" +\n            \"2732\" +\n            \"2733\" +\n            \"2734\" +\n            \"2735\" +\n            \"2736\" +\n            \"2737\" +\n            \"2738\" +\n            \"2739\" +\n            \"2740\" +\n            \"2741\" +\n            \"2742\" +\n            \"2743\" +\n            \"2744\" +\n            \"2745\" +\n            \"2746\" +\n            \"2747\" +\n            \"2748\" +\n            \"2749\" +\n            \"2750\" +\n            \"2751\" +\n            \"2752\" +\n            \"2753\" +\n            \"2754\" +\n            \"2755\" +\n            \"2756\" +\n            \"2757\" +\n            \"2758\" +\n            \"2759\" +\n            \"2760\" +\n            \"2761\" +\n            \"2762\" +\n            \"2763\" +\n            \"2764\" +\n            \"2765\" +\n            \"2766\" +\n            \"2767\" +\n            \"2768\" +\n            \"2769\" +\n            \"2770\" +\n            \"2771\" +\n            \"2772\" +\n            \"2773\" +\n            \"2774\" +\n            \"2775\" +\n            \"2776\" +\n            \"2777\" +\n            \"2778\" +\n            \"2779\" +\n            \"2780\" +\n            \"2781\" +\n            \"2782\" +\n            \"2783\" +\n            \"2784\" +\n            \"2785\" +\n            \"2786\" +\n            \"2787\" +\n            \"2788\" +\n            \"2789\" +\n            \"2790\" +\n            \"2791\" +\n            \"2792\" +\n            \"2793\" +\n            \"2794\" +\n            \"2795\" +\n            \"2796\" +\n            \"2797\" +\n            \"2798\" +\n            \"2799\" +\n            \"2800\" +\n            \"2801\" +\n            \"2802\" +\n            \"2803\" +\n            \"2804\" +\n            \"2805\" +\n            \"2806\" +\n            \"2807\" +\n            \"2808\" +\n            \"2809\" +\n            \"2810\" +\n            \"2811\" +\n            \"2812\" +\n            \"2813\" +\n            \"2814\" +\n            \"2815\" +\n            \"2816\" +\n            \"2817\" +\n            \"2818\" +\n            \"2819\" +\n            \"2820\" +\n            \"2821\" +\n            \"2822\" +\n            \"2823\" +\n            \"2824\" +\n            \"2825\" +\n            \"2826\" +\n            \"2827\" +\n            \"2828\" +\n            \"2829\" +\n            \"2830\" +\n            \"2831\" +\n            \"2832\" +\n            \"2833\" +\n            \"2834\" +\n            \"2835\" +\n            \"2836\" +\n            \"2837\" +\n            \"2838\" +\n            \"2839\" +\n            \"2840\" +\n            \"2841\" +\n            \"2842\" +\n            \"2843\" +\n            \"2844\" +\n            \"2845\" +\n            \"2846\" +\n            \"2847\" +\n            \"2848\" +\n            \"2849\" +\n            \"2850\" +\n            \"2851\" +\n            \"2852\" +\n            \"2853\" +\n            \"2854\" +\n            \"2855\" +\n            \"2856\" +\n            \"2857\" +\n            \"2858\" +\n            \"2859\" +\n            \"2860\" +\n            \"2861\" +\n            \"2862\" +\n            \"2863\" +\n            \"2864\" +\n            \"2865\" +\n            \"2866\" +\n            \"2867\" +\n            \"2868\" +\n            \"2869\" +\n            \"2870\" +\n            \"2871\" +\n            \"2872\" +\n            \"2873\" +\n            \"2874\" +\n            \"2875\" +\n            \"2876\" +\n            \"2877\" +\n            \"2878\" +\n            \"2879\" +\n            \"2880\" +\n            \"2881\" +\n            \"2882\" +\n            \"2883\" +\n            \"2884\" +\n            \"2885\" +\n            \"2886\" +\n            \"2887\" +\n            \"2888\" +\n            \"2889\" +\n            \"2890\" +\n            \"2891\" +\n            \"2892\" +\n            \"2893\" +\n            \"2894\" +\n            \"2895\" +\n            \"2896\" +\n            \"2897\" +\n            \"2898\" +\n            \"2899\" +\n            \"2900\" +\n            \"2901\" +\n            \"2902\" +\n            \"2903\" +\n            \"2904\" +\n            \"2905\" +\n            \"2906\" +\n            \"2907\" +\n            \"2908\" +\n            \"2909\" +\n            \"2910\" +\n            \"2911\" +\n            \"2912\" +\n            \"2913\" +\n            \"2914\" +\n            \"2915\" +\n            \"2916\" +\n            \"2917\" +\n            \"2918\" +\n            \"2919\" +\n            \"2920\" +\n            \"2921\" +\n            \"2922\" +\n            \"2923\" +\n            \"2924\" +\n            \"2925\" +\n            \"2926\" +\n            \"2927\" +\n            \"2928\" +\n            \"2929\" +\n            \"2930\" +\n            \"2931\" +\n            \"2932\" +\n            \"2933\" +\n            \"2934\" +\n            \"2935\" +\n            \"2936\" +\n            \"2937\" +\n            \"2938\" +\n            \"2939\" +\n            \"2940\" +\n            \"2941\" +\n            \"2942\" +\n            \"2943\" +\n            \"2944\" +\n            \"2945\" +\n            \"2946\" +\n            \"2947\" +\n            \"2948\" +\n            \"2949\" +\n            \"2950\" +\n            \"2951\" +\n            \"2952\" +\n            \"2953\" +\n            \"2954\" +\n            \"2955\" +\n            \"2956\" +\n            \"2957\" +\n            \"2958\" +\n            \"2959\" +\n            \"2960\" +\n            \"2961\" +\n            \"2962\" +\n            \"2963\" +\n            \"2964\" +\n            \"2965\" +\n            \"2966\" +\n            \"2967\" +\n            \"2968\" +\n            \"2969\" +\n            \"2970\" +\n            \"2971\" +\n            \"2972\" +\n            \"2973\" +\n            \"2974\" +\n            \"2975\" +\n            \"2976\" +\n            \"2977\" +\n            \"2978\" +\n            \"2979\" +\n            \"2980\" +\n            \"2981\" +\n            \"2982\" +\n            \"2983\" +\n            \"2984\" +\n            \"2985\" +\n            \"2986\" +\n            \"2987\" +\n            \"2988\" +\n            \"2989\" +\n            \"2990\" +\n            \"2991\" +\n            \"2992\" +\n            \"2993\" +\n            \"2994\" +\n            \"2995\" +\n            \"2996\" +\n            \"2997\" +\n            \"2998\" +\n            \"2999\" +\n            \"3000\" +\n            \"3001\" +\n            \"3002\" +\n            \"3003\" +\n            \"3004\" +\n            \"3005\" +\n            \"3006\" +\n            \"3007\" +\n            \"3008\" +\n            \"3009\" +\n            \"3010\" +\n            \"3011\" +\n            \"3012\" +\n            \"3013\" +\n            \"3014\" +\n            \"3015\" +\n            \"3016\" +\n            \"3017\" +\n            \"3018\" +\n            \"3019\" +\n            \"3020\" +\n            \"3021\" +\n            \"3022\" +\n            \"3023\" +\n            \"3024\" +\n            \"3025\" +\n            \"3026\" +\n            \"3027\" +\n            \"3028\" +\n            \"3029\" +\n            \"3030\" +\n            \"3031\" +\n            \"3032\" +\n            \"3033\" +\n            \"3034\" +\n            \"3035\" +\n            \"3036\" +\n            \"3037\" +\n            \"3038\" +\n            \"3039\" +\n            \"3040\" +\n            \"3041\" +\n            \"3042\" +\n            \"3043\" +\n            \"3044\" +\n            \"3045\" +\n            \"3046\" +\n            \"3047\" +\n            \"3048\" +\n            \"3049\" +\n            \"3050\" +\n            \"3051\" +\n            \"3052\" +\n            \"3053\" +\n            \"3054\" +\n            \"3055\" +\n            \"3056\" +\n            \"3057\" +\n            \"3058\" +\n            \"3059\" +\n            \"3060\" +\n            \"3061\" +\n            \"3062\" +\n            \"3063\" +\n            \"3064\" +\n            \"3065\" +\n            \"3066\" +\n            \"3067\" +\n            \"3068\" +\n            \"3069\" +\n            \"3070\" +\n            \"3071\" +\n            \"3072\" +\n            \"3073\" +\n            \"3074\" +\n            \"3075\" +\n            \"3076\" +\n            \"3077\" +\n            \"3078\" +\n            \"3079\" +\n            \"3080\" +\n            \"3081\" +\n            \"3082\" +\n            \"3083\" +\n            \"3084\" +\n            \"3085\" +\n            \"3086\" +\n            \"3087\" +\n            \"3088\" +\n            \"3089\" +\n            \"3090\" +\n            \"3091\" +\n            \"3092\" +\n            \"3093\" +\n            \"3094\" +\n            \"3095\" +\n            \"3096\" +\n            \"3097\" +\n            \"3098\" +\n            \"3099\" +\n            \"3100\" +\n            \"3101\" +\n            \"3102\" +\n            \"3103\" +\n            \"3104\" +\n            \"3105\" +\n            \"3106\" +\n            \"3107\" +\n            \"3108\" +\n            \"3109\" +\n            \"3110\" +\n            \"3111\" +\n            \"3112\" +\n            \"3113\" +\n            \"3114\" +\n            \"3115\" +\n            \"3116\" +\n            \"3117\" +\n            \"3118\" +\n            \"3119\" +\n            \"3120\" +\n            \"3121\" +\n            \"3122\" +\n            \"3123\" +\n            \"3124\" +\n            \"3125\" +\n            \"3126\" +\n            \"3127\" +\n            \"3128\" +\n            \"3129\" +\n            \"3130\" +\n            \"3131\" +\n            \"3132\" +\n            \"3133\" +\n            \"3134\" +\n            \"3135\" +\n            \"3136\" +\n            \"3137\" +\n            \"3138\" +\n            \"3139\" +\n            \"3140\" +\n            \"3141\" +\n            \"3142\" +\n            \"3143\" +\n            \"3144\" +\n            \"3145\" +\n            \"3146\" +\n            \"3147\" +\n            \"3148\" +\n            \"3149\" +\n            \"3150\" +\n            \"3151\" +\n            \"3152\" +\n            \"3153\" +\n            \"3154\" +\n            \"3155\" +\n            \"3156\" +\n            \"3157\" +\n            \"3158\" +\n            \"3159\" +\n            \"3160\" +\n            \"3161\" +\n            \"3162\" +\n            \"3163\" +\n            \"3164\" +\n            \"3165\" +\n            \"3166\" +\n            \"3167\" +\n            \"3168\" +\n            \"3169\" +\n            \"3170\" +\n            \"3171\" +\n            \"3172\" +\n            \"3173\" +\n            \"3174\" +\n            \"3175\" +\n            \"3176\" +\n            \"3177\" +\n            \"3178\" +\n            \"3179\" +\n            \"3180\" +\n            \"3181\" +\n            \"3182\" +\n            \"3183\" +\n            \"3184\" +\n            \"3185\" +\n            \"3186\" +\n            \"3187\" +\n            \"3188\" +\n            \"3189\" +\n            \"3190\" +\n            \"3191\" +\n            \"3192\" +\n            \"3193\" +\n            \"3194\" +\n            \"3195\" +\n            \"3196\" +\n            \"3197\" +\n            \"3198\" +\n            \"3199\" +\n            \"3200\" +\n            \"3201\" +\n            \"3202\" +\n            \"3203\" +\n            \"3204\" +\n            \"3205\" +\n            \"3206\" +\n            \"3207\" +\n            \"3208\" +\n            \"3209\" +\n            \"3210\" +\n            \"3211\" +\n            \"3212\" +\n            \"3213\" +\n            \"3214\" +\n            \"3215\" +\n            \"3216\" +\n            \"3217\" +\n            \"3218\" +\n            \"3219\" +\n            \"3220\" +\n            \"3221\" +\n            \"3222\" +\n            \"3223\" +\n            \"3224\" +\n            \"3225\" +\n            \"3226\" +\n            \"3227\" +\n            \"3228\" +\n            \"3229\" +\n            \"3230\" +\n            \"3231\" +\n            \"3232\" +\n            \"3233\" +\n            \"3234\" +\n            \"3235\" +\n            \"3236\" +\n            \"3237\" +\n            \"3238\" +\n            \"3239\" +\n            \"3240\" +\n            \"3241\" +\n            \"3242\" +\n            \"3243\" +\n            \"3244\" +\n            \"3245\" +\n            \"3246\" +\n            \"3247\" +\n            \"3248\" +\n            \"3249\" +\n            \"3250\" +\n            \"3251\" +\n            \"3252\" +\n            \"3253\" +\n            \"3254\" +\n            \"3255\" +\n            \"3256\" +\n            \"3257\" +\n            \"3258\" +\n            \"3259\" +\n            \"3260\" +\n            \"3261\" +\n            \"3262\" +\n            \"3263\" +\n            \"3264\" +\n            \"3265\" +\n            \"3266\" +\n            \"3267\" +\n            \"3268\" +\n            \"3269\" +\n            \"3270\" +\n            \"3271\" +\n            \"3272\" +\n            \"3273\" +\n            \"3274\" +\n            \"3275\" +\n            \"3276\" +\n            \"3277\" +\n            \"3278\" +\n            \"3279\" +\n            \"3280\" +\n            \"3281\" +\n            \"3282\" +\n            \"3283\" +\n            \"3284\" +\n            \"3285\" +\n            \"3286\" +\n            \"3287\" +\n            \"3288\" +\n            \"3289\" +\n            \"3290\" +\n            \"3291\" +\n            \"3292\" +\n            \"3293\" +\n            \"3294\" +\n            \"3295\" +\n            \"3296\" +\n            \"3297\" +\n            \"3298\" +\n            \"3299\" +\n            \"3300\" +\n            \"3301\" +\n            \"3302\" +\n            \"3303\" +\n            \"3304\" +\n            \"3305\" +\n            \"3306\" +\n            \"3307\" +\n            \"3308\" +\n            \"3309\" +\n            \"3310\" +\n            \"3311\" +\n            \"3312\" +\n            \"3313\" +\n            \"3314\" +\n            \"3315\" +\n            \"3316\" +\n            \"3317\" +\n            \"3318\" +\n            \"3319\" +\n            \"3320\" +\n            \"3321\" +\n            \"3322\" +\n            \"3323\" +\n            \"3324\" +\n            \"3325\" +\n            \"3326\" +\n            \"3327\" +\n            \"3328\" +\n            \"3329\" +\n            \"3330\" +\n            \"3331\" +\n            \"3332\" +\n            \"3333\" +\n            \"3334\" +\n            \"3335\" +\n            \"3336\" +\n            \"3337\" +\n            \"3338\" +\n            \"3339\" +\n            \"3340\" +\n            \"3341\" +\n            \"3342\" +\n            \"3343\" +\n            \"3344\" +\n            \"3345\" +\n            \"3346\" +\n            \"3347\" +\n            \"3348\" +\n            \"3349\" +\n            \"3350\" +\n            \"3351\" +\n            \"3352\" +\n            \"3353\" +\n            \"3354\" +\n            \"3355\" +\n            \"3356\" +\n            \"3357\" +\n            \"3358\" +\n            \"3359\" +\n            \"3360\" +\n            \"3361\" +\n            \"3362\" +\n            \"3363\" +\n            \"3364\" +\n            \"3365\" +\n            \"3366\" +\n            \"3367\" +\n            \"3368\" +\n            \"3369\" +\n            \"3370\" +\n            \"3371\" +\n            \"3372\" +\n            \"3373\" +\n            \"3374\" +\n            \"3375\" +\n            \"3376\" +\n            \"3377\" +\n            \"3378\" +\n            \"3379\" +\n            \"3380\" +\n            \"3381\" +\n            \"3382\" +\n            \"3383\" +\n            \"3384\" +\n            \"3385\" +\n            \"3386\" +\n            \"3387\" +\n            \"3388\" +\n            \"3389\" +\n            \"3390\" +\n            \"3391\" +\n            \"3392\" +\n            \"3393\" +\n            \"3394\" +\n            \"3395\" +\n            \"3396\" +\n            \"3397\" +\n            \"3398\" +\n            \"3399\" +\n            \"3400\" +\n            \"3401\" +\n            \"3402\" +\n            \"3403\" +\n            \"3404\" +\n            \"3405\" +\n            \"3406\" +\n            \"3407\" +\n            \"3408\" +\n            \"3409\" +\n            \"3410\" +\n            \"3411\" +\n            \"3412\" +\n            \"3413\" +\n            \"3414\" +\n            \"3415\" +\n            \"3416\" +\n            \"3417\" +\n            \"3418\" +\n            \"3419\" +\n            \"3420\" +\n            \"3421\" +\n            \"3422\" +\n            \"3423\" +\n            \"3424\" +\n            \"3425\" +\n            \"3426\" +\n            \"3427\" +\n            \"3428\" +\n            \"3429\" +\n            \"3430\" +\n            \"3431\" +\n            \"3432\" +\n            \"3433\" +\n            \"3434\" +\n            \"3435\" +\n            \"3436\" +\n            \"3437\" +\n            \"3438\" +\n            \"3439\" +\n            \"3440\" +\n            \"3441\" +\n            \"3442\" +\n            \"3443\" +\n            \"3444\" +\n            \"3445\" +\n            \"3446\" +\n            \"3447\" +\n            \"3448\" +\n            \"3449\" +\n            \"3450\" +\n            \"3451\" +\n            \"3452\" +\n            \"3453\" +\n            \"3454\" +\n            \"3455\" +\n            \"3456\" +\n            \"3457\" +\n            \"3458\" +\n            \"3459\" +\n            \"3460\" +\n            \"3461\" +\n            \"3462\" +\n            \"3463\" +\n            \"3464\" +\n            \"3465\" +\n            \"3466\" +\n            \"3467\" +\n            \"3468\" +\n            \"3469\" +\n            \"3470\" +\n            \"3471\" +\n            \"3472\" +\n            \"3473\" +\n            \"3474\" +\n            \"3475\" +\n            \"3476\" +\n            \"3477\" +\n            \"3478\" +\n            \"3479\" +\n            \"3480\" +\n            \"3481\" +\n            \"3482\" +\n            \"3483\" +\n            \"3484\" +\n            \"3485\" +\n            \"3486\" +\n            \"3487\" +\n            \"3488\" +\n            \"3489\" +\n            \"3490\" +\n            \"3491\" +\n            \"3492\" +\n            \"3493\" +\n            \"3494\" +\n            \"3495\" +\n            \"3496\" +\n            \"3497\" +\n            \"3498\" +\n            \"3499\" +\n            \"3500\" +\n            \"3501\" +\n            \"3502\" +\n            \"3503\" +\n            \"3504\" +\n            \"3505\" +\n            \"3506\" +\n            \"3507\" +\n            \"3508\" +\n            \"3509\" +\n            \"3510\" +\n            \"3511\" +\n            \"3512\" +\n            \"3513\" +\n            \"3514\" +\n            \"3515\" +\n            \"3516\" +\n            \"3517\" +\n            \"3518\" +\n            \"3519\" +\n            \"3520\" +\n            \"3521\" +\n            \"3522\" +\n            \"3523\" +\n            \"3524\" +\n            \"3525\" +\n            \"3526\" +\n            \"3527\" +\n            \"3528\" +\n            \"3529\" +\n            \"3530\" +\n            \"3531\" +\n            \"3532\" +\n            \"3533\" +\n            \"3534\" +\n            \"3535\" +\n            \"3536\" +\n            \"3537\" +\n            \"3538\" +\n            \"3539\" +\n            \"3540\" +\n            \"3541\" +\n            \"3542\" +\n            \"3543\" +\n            \"3544\" +\n            \"3545\" +\n            \"3546\" +\n            \"3547\" +\n            \"3548\" +\n            \"3549\" +\n            \"3550\" +\n            \"3551\" +\n            \"3552\" +\n            \"3553\" +\n            \"3554\" +\n            \"3555\" +\n            \"3556\" +\n            \"3557\" +\n            \"3558\" +\n            \"3559\" +\n            \"3560\" +\n            \"3561\" +\n            \"3562\" +\n            \"3563\" +\n            \"3564\" +\n            \"3565\" +\n            \"3566\" +\n            \"3567\" +\n            \"3568\" +\n            \"3569\" +\n            \"3570\" +\n            \"3571\" +\n            \"3572\" +\n            \"3573\" +\n            \"3574\" +\n            \"3575\" +\n            \"3576\" +\n            \"3577\" +\n            \"3578\" +\n            \"3579\" +\n            \"3580\" +\n            \"3581\" +\n            \"3582\" +\n            \"3583\" +\n            \"3584\" +\n            \"3585\" +\n            \"3586\" +\n            \"3587\" +\n            \"3588\" +\n            \"3589\" +\n            \"3590\" +\n            \"3591\" +\n            \"3592\" +\n            \"3593\" +\n            \"3594\" +\n            \"3595\" +\n            \"3596\" +\n            \"3597\" +\n            \"3598\" +\n            \"3599\" +\n            \"3600\" +\n            \"3601\" +\n            \"3602\" +\n            \"3603\" +\n            \"3604\" +\n            \"3605\" +\n            \"3606\" +\n            \"3607\" +\n            \"3608\" +\n            \"3609\" +\n            \"3610\" +\n            \"3611\" +\n            \"3612\" +\n            \"3613\" +\n            \"3614\" +\n            \"3615\" +\n            \"3616\" +\n            \"3617\" +\n            \"3618\" +\n            \"3619\" +\n            \"3620\" +\n            \"3621\" +\n            \"3622\" +\n            \"3623\" +\n            \"3624\" +\n            \"3625\" +\n            \"3626\" +\n            \"3627\" +\n            \"3628\" +\n            \"3629\" +\n            \"3630\" +\n            \"3631\" +\n            \"3632\" +\n            \"3633\" +\n            \"3634\" +\n            \"3635\" +\n            \"3636\" +\n            \"3637\" +\n            \"3638\" +\n            \"3639\" +\n            \"3640\" +\n            \"3641\" +\n            \"3642\" +\n            \"3643\" +\n            \"3644\" +\n            \"3645\" +\n            \"3646\" +\n            \"3647\" +\n            \"3648\" +\n            \"3649\" +\n            \"3650\" +\n            \"3651\" +\n            \"3652\" +\n            \"3653\" +\n            \"3654\" +\n            \"3655\" +\n            \"3656\" +\n            \"3657\" +\n            \"3658\" +\n            \"3659\" +\n            \"3660\" +\n            \"3661\" +\n            \"3662\" +\n            \"3663\" +\n            \"3664\" +\n            \"3665\" +\n            \"3666\" +\n            \"3667\" +\n            \"3668\" +\n            \"3669\" +\n            \"3670\" +\n            \"3671\" +\n            \"3672\" +\n            \"3673\" +\n            \"3674\" +\n            \"3675\" +\n            \"3676\" +\n            \"3677\" +\n            \"3678\" +\n            \"3679\" +\n            \"3680\" +\n            \"3681\" +\n            \"3682\" +\n            \"3683\" +\n            \"3684\" +\n            \"3685\" +\n            \"3686\" +\n            \"3687\" +\n            \"3688\" +\n            \"3689\" +\n            \"3690\" +\n            \"3691\" +\n            \"3692\" +\n            \"3693\" +\n            \"3694\" +\n            \"3695\" +\n            \"3696\" +\n            \"3697\" +\n            \"3698\" +\n            \"3699\" +\n            \"3700\" +\n            \"3701\" +\n            \"3702\" +\n            \"3703\" +\n            \"3704\" +\n            \"3705\" +\n            \"3706\" +\n            \"3707\" +\n            \"3708\" +\n            \"3709\" +\n            \"3710\" +\n            \"3711\" +\n            \"3712\" +\n            \"3713\" +\n            \"3714\" +\n            \"3715\" +\n            \"3716\" +\n            \"3717\" +\n            \"3718\" +\n            \"3719\" +\n            \"3720\" +\n            \"3721\" +\n            \"3722\" +\n            \"3723\" +\n            \"3724\" +\n            \"3725\" +\n            \"3726\" +\n            \"3727\" +\n            \"3728\" +\n            \"3729\" +\n            \"3730\" +\n            \"3731\" +\n            \"3732\" +\n            \"3733\" +\n            \"3734\" +\n            \"3735\" +\n            \"3736\" +\n            \"3737\" +\n            \"3738\" +\n            \"3739\" +\n            \"3740\" +\n            \"3741\" +\n            \"3742\" +\n            \"3743\" +\n            \"3744\" +\n            \"3745\" +\n            \"3746\" +\n            \"3747\" +\n            \"3748\" +\n            \"3749\" +\n            \"3750\" +\n            \"3751\" +\n            \"3752\" +\n            \"3753\" +\n            \"3754\" +\n            \"3755\" +\n            \"3756\" +\n            \"3757\" +\n            \"3758\" +\n            \"3759\" +\n            \"3760\" +\n            \"3761\" +\n            \"3762\" +\n            \"3763\" +\n            \"3764\" +\n            \"3765\" +\n            \"3766\" +\n            \"3767\" +\n            \"3768\" +\n            \"3769\" +\n            \"3770\" +\n            \"3771\" +\n            \"3772\" +\n            \"3773\" +\n            \"3774\" +\n            \"3775\" +\n            \"3776\" +\n            \"3777\" +\n            \"3778\" +\n            \"3779\" +\n            \"3780\" +\n            \"3781\" +\n            \"3782\" +\n            \"3783\" +\n            \"3784\" +\n            \"3785\" +\n            \"3786\" +\n            \"3787\" +\n            \"3788\" +\n            \"3789\" +\n            \"3790\" +\n            \"3791\" +\n            \"3792\" +\n            \"3793\" +\n            \"3794\" +\n            \"3795\" +\n            \"3796\" +\n            \"3797\" +\n            \"3798\" +\n            \"3799\" +\n            \"3800\" +\n            \"3801\" +\n            \"3802\" +\n            \"3803\" +\n            \"3804\" +\n            \"3805\" +\n            \"3806\" +\n            \"3807\" +\n            \"3808\" +\n            \"3809\" +\n            \"3810\" +\n            \"3811\" +\n            \"3812\" +\n            \"3813\" +\n            \"3814\" +\n            \"3815\" +\n            \"3816\" +\n            \"3817\" +\n            \"3818\" +\n            \"3819\" +\n            \"3820\" +\n            \"3821\" +\n            \"3822\" +\n            \"3823\" +\n            \"3824\" +\n            \"3825\" +\n            \"3826\" +\n            \"3827\" +\n            \"3828\" +\n            \"3829\" +\n            \"3830\" +\n            \"3831\" +\n            \"3832\" +\n            \"3833\" +\n            \"3834\" +\n            \"3835\" +\n            \"3836\" +\n            \"3837\" +\n            \"3838\" +\n            \"3839\" +\n            \"3840\" +\n            \"3841\" +\n            \"3842\" +\n            \"3843\" +\n            \"3844\" +\n            \"3845\" +\n            \"3846\" +\n            \"3847\" +\n            \"3848\" +\n            \"3849\" +\n            \"3850\" +\n            \"3851\" +\n            \"3852\" +\n            \"3853\" +\n            \"3854\" +\n            \"3855\" +\n            \"3856\" +\n            \"3857\" +\n            \"3858\" +\n            \"3859\" +\n            \"3860\" +\n            \"3861\" +\n            \"3862\" +\n            \"3863\" +\n            \"3864\" +\n            \"3865\" +\n            \"3866\" +\n            \"3867\" +\n            \"3868\" +\n            \"3869\" +\n            \"3870\" +\n            \"3871\" +\n            \"3872\" +\n            \"3873\" +\n            \"3874\" +\n            \"3875\" +\n            \"3876\" +\n            \"3877\" +\n            \"3878\" +\n            \"3879\" +\n            \"3880\" +\n            \"3881\" +\n            \"3882\" +\n            \"3883\" +\n            \"3884\" +\n            \"3885\" +\n            \"3886\" +\n            \"3887\" +\n            \"3888\" +\n            \"3889\" +\n            \"3890\" +\n            \"3891\" +\n            \"3892\" +\n            \"3893\" +\n            \"3894\" +\n            \"3895\" +\n            \"3896\" +\n            \"3897\" +\n            \"3898\" +\n            \"3899\" +\n            \"3900\" +\n            \"3901\" +\n            \"3902\" +\n            \"3903\" +\n            \"3904\" +\n            \"3905\" +\n            \"3906\" +\n            \"3907\" +\n            \"3908\" +\n            \"3909\" +\n            \"3910\" +\n            \"3911\" +\n            \"3912\" +\n            \"3913\" +\n            \"3914\" +\n            \"3915\" +\n            \"3916\" +\n            \"3917\" +\n            \"3918\" +\n            \"3919\" +\n            \"3920\" +\n            \"3921\" +\n            \"3922\" +\n            \"3923\" +\n            \"3924\" +\n            \"3925\" +\n            \"3926\" +\n            \"3927\" +\n            \"3928\" +\n            \"3929\" +\n            \"3930\" +\n            \"3931\" +\n            \"3932\" +\n            \"3933\" +\n            \"3934\" +\n            \"3935\" +\n            \"3936\" +\n            \"3937\" +\n            \"3938\" +\n            \"3939\" +\n            \"3940\" +\n            \"3941\" +\n            \"3942\" +\n            \"3943\" +\n            \"3944\" +\n            \"3945\" +\n            \"3946\" +\n            \"3947\" +\n            \"3948\" +\n            \"3949\" +\n            \"3950\" +\n            \"3951\" +\n            \"3952\" +\n            \"3953\" +\n            \"3954\" +\n            \"3955\" +\n            \"3956\" +\n            \"3957\" +\n            \"3958\" +\n            \"3959\" +\n            \"3960\" +\n            \"3961\" +\n            \"3962\" +\n            \"3963\" +\n            \"3964\" +\n            \"3965\" +\n            \"3966\" +\n            \"3967\" +\n            \"3968\" +\n            \"3969\" +\n            \"3970\" +\n            \"3971\" +\n            \"3972\" +\n            \"3973\" +\n            \"3974\" +\n            \"3975\" +\n            \"3976\" +\n            \"3977\" +\n            \"3978\" +\n            \"3979\" +\n            \"3980\" +\n            \"3981\" +\n            \"3982\" +\n            \"3983\" +\n            \"3984\" +\n            \"3985\" +\n            \"3986\" +\n            \"3987\" +\n            \"3988\" +\n            \"3989\" +\n            \"3990\" +\n            \"3991\" +\n            \"3992\" +\n            \"3993\" +\n            \"3994\" +\n            \"3995\" +\n            \"3996\" +\n            \"3997\" +\n            \"3998\" +\n            \"3999\" +\n            \"4000\";\n\n            return x;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/SyntaxWalker_InsufficientExecutionStackException.vb",
    "content": "﻿Imports System\n\nNamespace Test\n    Public Class Foo\n        Private Sub Bar()\n            Dim x =\n            \"1\" +\n            \"2\" +\n            \"3\" +\n            \"4\" +\n            \"5\" +\n            \"6\" +\n            \"7\" +\n            \"8\" +\n            \"9\" +\n            \"10\" +\n            \"11\" +\n            \"12\" +\n            \"13\" +\n            \"14\" +\n            \"15\" +\n            \"16\" +\n            \"17\" +\n            \"18\" +\n            \"19\" +\n            \"20\" +\n            \"21\" +\n            \"22\" +\n            \"23\" +\n            \"24\" +\n            \"25\" +\n            \"26\" +\n            \"27\" +\n            \"28\" +\n            \"29\" +\n            \"30\" +\n            \"31\" +\n            \"32\" +\n            \"33\" +\n            \"34\" +\n            \"35\" +\n            \"36\" +\n            \"37\" +\n            \"38\" +\n            \"39\" +\n            \"40\" +\n            \"41\" +\n            \"42\" +\n            \"43\" +\n            \"44\" +\n            \"45\" +\n            \"46\" +\n            \"47\" +\n            \"48\" +\n            \"49\" +\n            \"50\" +\n            \"51\" +\n            \"52\" +\n            \"53\" +\n            \"54\" +\n            \"55\" +\n            \"56\" +\n            \"57\" +\n            \"58\" +\n            \"59\" +\n            \"60\" +\n            \"61\" +\n            \"62\" +\n            \"63\" +\n            \"64\" +\n            \"65\" +\n            \"66\" +\n            \"67\" +\n            \"68\" +\n            \"69\" +\n            \"70\" +\n            \"71\" +\n            \"72\" +\n            \"73\" +\n            \"74\" +\n            \"75\" +\n            \"76\" +\n            \"77\" +\n            \"78\" +\n            \"79\" +\n            \"80\" +\n            \"81\" +\n            \"82\" +\n            \"83\" +\n            \"84\" +\n            \"85\" +\n            \"86\" +\n            \"87\" +\n            \"88\" +\n            \"89\" +\n            \"90\" +\n            \"91\" +\n            \"92\" +\n            \"93\" +\n            \"94\" +\n            \"95\" +\n            \"96\" +\n            \"97\" +\n            \"98\" +\n            \"99\" +\n            \"100\" +\n            \"101\" +\n            \"102\" +\n            \"103\" +\n            \"104\" +\n            \"105\" +\n            \"106\" +\n            \"107\" +\n            \"108\" +\n            \"109\" +\n            \"110\" +\n            \"111\" +\n            \"112\" +\n            \"113\" +\n            \"114\" +\n            \"115\" +\n            \"116\" +\n            \"117\" +\n            \"118\" +\n            \"119\" +\n            \"120\" +\n            \"121\" +\n            \"122\" +\n            \"123\" +\n            \"124\" +\n            \"125\" +\n            \"126\" +\n            \"127\" +\n            \"128\" +\n            \"129\" +\n            \"130\" +\n            \"131\" +\n            \"132\" +\n            \"133\" +\n            \"134\" +\n            \"135\" +\n            \"136\" +\n            \"137\" +\n            \"138\" +\n            \"139\" +\n            \"140\" +\n            \"141\" +\n            \"142\" +\n            \"143\" +\n            \"144\" +\n            \"145\" +\n            \"146\" +\n            \"147\" +\n            \"148\" +\n            \"149\" +\n            \"150\" +\n            \"151\" +\n            \"152\" +\n            \"153\" +\n            \"154\" +\n            \"155\" +\n            \"156\" +\n            \"157\" +\n            \"158\" +\n            \"159\" +\n            \"160\" +\n            \"161\" +\n            \"162\" +\n            \"163\" +\n            \"164\" +\n            \"165\" +\n            \"166\" +\n            \"167\" +\n            \"168\" +\n            \"169\" +\n            \"170\" +\n            \"171\" +\n            \"172\" +\n            \"173\" +\n            \"174\" +\n            \"175\" +\n            \"176\" +\n            \"177\" +\n            \"178\" +\n            \"179\" +\n            \"180\" +\n            \"181\" +\n            \"182\" +\n            \"183\" +\n            \"184\" +\n            \"185\" +\n            \"186\" +\n            \"187\" +\n            \"188\" +\n            \"189\" +\n            \"190\" +\n            \"191\" +\n            \"192\" +\n            \"193\" +\n            \"194\" +\n            \"195\" +\n            \"196\" +\n            \"197\" +\n            \"198\" +\n            \"199\" +\n            \"200\" +\n            \"201\" +\n            \"202\" +\n            \"203\" +\n            \"204\" +\n            \"205\" +\n            \"206\" +\n            \"207\" +\n            \"208\" +\n            \"209\" +\n            \"210\" +\n            \"211\" +\n            \"212\" +\n            \"213\" +\n            \"214\" +\n            \"215\" +\n            \"216\" +\n            \"217\" +\n            \"218\" +\n            \"219\" +\n            \"220\" +\n            \"221\" +\n            \"222\" +\n            \"223\" +\n            \"224\" +\n            \"225\" +\n            \"226\" +\n            \"227\" +\n            \"228\" +\n            \"229\" +\n            \"230\" +\n            \"231\" +\n            \"232\" +\n            \"233\" +\n            \"234\" +\n            \"235\" +\n            \"236\" +\n            \"237\" +\n            \"238\" +\n            \"239\" +\n            \"240\" +\n            \"241\" +\n            \"242\" +\n            \"243\" +\n            \"244\" +\n            \"245\" +\n            \"246\" +\n            \"247\" +\n            \"248\" +\n            \"249\" +\n            \"250\" +\n            \"251\" +\n            \"252\" +\n            \"253\" +\n            \"254\" +\n            \"255\" +\n            \"256\" +\n            \"257\" +\n            \"258\" +\n            \"259\" +\n            \"260\" +\n            \"261\" +\n            \"262\" +\n            \"263\" +\n            \"264\" +\n            \"265\" +\n            \"266\" +\n            \"267\" +\n            \"268\" +\n            \"269\" +\n            \"270\" +\n            \"271\" +\n            \"272\" +\n            \"273\" +\n            \"274\" +\n            \"275\" +\n            \"276\" +\n            \"277\" +\n            \"278\" +\n            \"279\" +\n            \"280\" +\n            \"281\" +\n            \"282\" +\n            \"283\" +\n            \"284\" +\n            \"285\" +\n            \"286\" +\n            \"287\" +\n            \"288\" +\n            \"289\" +\n            \"290\" +\n            \"291\" +\n            \"292\" +\n            \"293\" +\n            \"294\" +\n            \"295\" +\n            \"296\" +\n            \"297\" +\n            \"298\" +\n            \"299\" +\n            \"300\" +\n            \"301\" +\n            \"302\" +\n            \"303\" +\n            \"304\" +\n            \"305\" +\n            \"306\" +\n            \"307\" +\n            \"308\" +\n            \"309\" +\n            \"310\" +\n            \"311\" +\n            \"312\" +\n            \"313\" +\n            \"314\" +\n            \"315\" +\n            \"316\" +\n            \"317\" +\n            \"318\" +\n            \"319\" +\n            \"320\" +\n            \"321\" +\n            \"322\" +\n            \"323\" +\n            \"324\" +\n            \"325\" +\n            \"326\" +\n            \"327\" +\n            \"328\" +\n            \"329\" +\n            \"330\" +\n            \"331\" +\n            \"332\" +\n            \"333\" +\n            \"334\" +\n            \"335\" +\n            \"336\" +\n            \"337\" +\n            \"338\" +\n            \"339\" +\n            \"340\" +\n            \"341\" +\n            \"342\" +\n            \"343\" +\n            \"344\" +\n            \"345\" +\n            \"346\" +\n            \"347\" +\n            \"348\" +\n            \"349\" +\n            \"350\" +\n            \"351\" +\n            \"352\" +\n            \"353\" +\n            \"354\" +\n            \"355\" +\n            \"356\" +\n            \"357\" +\n            \"358\" +\n            \"359\" +\n            \"360\" +\n            \"361\" +\n            \"362\" +\n            \"363\" +\n            \"364\" +\n            \"365\" +\n            \"366\" +\n            \"367\" +\n            \"368\" +\n            \"369\" +\n            \"370\" +\n            \"371\" +\n            \"372\" +\n            \"373\" +\n            \"374\" +\n            \"375\" +\n            \"376\" +\n            \"377\" +\n            \"378\" +\n            \"379\" +\n            \"380\" +\n            \"381\" +\n            \"382\" +\n            \"383\" +\n            \"384\" +\n            \"385\" +\n            \"386\" +\n            \"387\" +\n            \"388\" +\n            \"389\" +\n            \"390\" +\n            \"391\" +\n            \"392\" +\n            \"393\" +\n            \"394\" +\n            \"395\" +\n            \"396\" +\n            \"397\" +\n            \"398\" +\n            \"399\" +\n            \"400\" +\n            \"401\" +\n            \"402\" +\n            \"403\" +\n            \"404\" +\n            \"405\" +\n            \"406\" +\n            \"407\" +\n            \"408\" +\n            \"409\" +\n            \"410\" +\n            \"411\" +\n            \"412\" +\n            \"413\" +\n            \"414\" +\n            \"415\" +\n            \"416\" +\n            \"417\" +\n            \"418\" +\n            \"419\" +\n            \"420\" +\n            \"421\" +\n            \"422\" +\n            \"423\" +\n            \"424\" +\n            \"425\" +\n            \"426\" +\n            \"427\" +\n            \"428\" +\n            \"429\" +\n            \"430\" +\n            \"431\" +\n            \"432\" +\n            \"433\" +\n            \"434\" +\n            \"435\" +\n            \"436\" +\n            \"437\" +\n            \"438\" +\n            \"439\" +\n            \"440\" +\n            \"441\" +\n            \"442\" +\n            \"443\" +\n            \"444\" +\n            \"445\" +\n            \"446\" +\n            \"447\" +\n            \"448\" +\n            \"449\" +\n            \"450\" +\n            \"451\" +\n            \"452\" +\n            \"453\" +\n            \"454\" +\n            \"455\" +\n            \"456\" +\n            \"457\" +\n            \"458\" +\n            \"459\" +\n            \"460\" +\n            \"461\" +\n            \"462\" +\n            \"463\" +\n            \"464\" +\n            \"465\" +\n            \"466\" +\n            \"467\" +\n            \"468\" +\n            \"469\" +\n            \"470\" +\n            \"471\" +\n            \"472\" +\n            \"473\" +\n            \"474\" +\n            \"475\" +\n            \"476\" +\n            \"477\" +\n            \"478\" +\n            \"479\" +\n            \"480\" +\n            \"481\" +\n            \"482\" +\n            \"483\" +\n            \"484\" +\n            \"485\" +\n            \"486\" +\n            \"487\" +\n            \"488\" +\n            \"489\" +\n            \"490\" +\n            \"491\" +\n            \"492\" +\n            \"493\" +\n            \"494\" +\n            \"495\" +\n            \"496\" +\n            \"497\" +\n            \"498\" +\n            \"499\" +\n            \"500\" +\n            \"501\" +\n            \"502\" +\n            \"503\" +\n            \"504\" +\n            \"505\" +\n            \"506\" +\n            \"507\" +\n            \"508\" +\n            \"509\" +\n            \"510\" +\n            \"511\" +\n            \"512\" +\n            \"513\" +\n            \"514\" +\n            \"515\" +\n            \"516\" +\n            \"517\" +\n            \"518\" +\n            \"519\" +\n            \"520\" +\n            \"521\" +\n            \"522\" +\n            \"523\" +\n            \"524\" +\n            \"525\" +\n            \"526\" +\n            \"527\" +\n            \"528\" +\n            \"529\" +\n            \"530\" +\n            \"531\" +\n            \"532\" +\n            \"533\" +\n            \"534\" +\n            \"535\" +\n            \"536\" +\n            \"537\" +\n            \"538\" +\n            \"539\" +\n            \"540\" +\n            \"541\" +\n            \"542\" +\n            \"543\" +\n            \"544\" +\n            \"545\" +\n            \"546\" +\n            \"547\" +\n            \"548\" +\n            \"549\" +\n            \"550\" +\n            \"551\" +\n            \"552\" +\n            \"553\" +\n            \"554\" +\n            \"555\" +\n            \"556\" +\n            \"557\" +\n            \"558\" +\n            \"559\" +\n            \"560\" +\n            \"561\" +\n            \"562\" +\n            \"563\" +\n            \"564\" +\n            \"565\" +\n            \"566\" +\n            \"567\" +\n            \"568\" +\n            \"569\" +\n            \"570\" +\n            \"571\" +\n            \"572\" +\n            \"573\" +\n            \"574\" +\n            \"575\" +\n            \"576\" +\n            \"577\" +\n            \"578\" +\n            \"579\" +\n            \"580\" +\n            \"581\" +\n            \"582\" +\n            \"583\" +\n            \"584\" +\n            \"585\" +\n            \"586\" +\n            \"587\" +\n            \"588\" +\n            \"589\" +\n            \"590\" +\n            \"591\" +\n            \"592\" +\n            \"593\" +\n            \"594\" +\n            \"595\" +\n            \"596\" +\n            \"597\" +\n            \"598\" +\n            \"599\" +\n            \"600\" +\n            \"601\" +\n            \"602\" +\n            \"603\" +\n            \"604\" +\n            \"605\" +\n            \"606\" +\n            \"607\" +\n            \"608\" +\n            \"609\" +\n            \"610\" +\n            \"611\" +\n            \"612\" +\n            \"613\" +\n            \"614\" +\n            \"615\" +\n            \"616\" +\n            \"617\" +\n            \"618\" +\n            \"619\" +\n            \"620\" +\n            \"621\" +\n            \"622\" +\n            \"623\" +\n            \"624\" +\n            \"625\" +\n            \"626\" +\n            \"627\" +\n            \"628\" +\n            \"629\" +\n            \"630\" +\n            \"631\" +\n            \"632\" +\n            \"633\" +\n            \"634\" +\n            \"635\" +\n            \"636\" +\n            \"637\" +\n            \"638\" +\n            \"639\" +\n            \"640\" +\n            \"641\" +\n            \"642\" +\n            \"643\" +\n            \"644\" +\n            \"645\" +\n            \"646\" +\n            \"647\" +\n            \"648\" +\n            \"649\" +\n            \"650\" +\n            \"651\" +\n            \"652\" +\n            \"653\" +\n            \"654\" +\n            \"655\" +\n            \"656\" +\n            \"657\" +\n            \"658\" +\n            \"659\" +\n            \"660\" +\n            \"661\" +\n            \"662\" +\n            \"663\" +\n            \"664\" +\n            \"665\" +\n            \"666\" +\n            \"667\" +\n            \"668\" +\n            \"669\" +\n            \"670\" +\n            \"671\" +\n            \"672\" +\n            \"673\" +\n            \"674\" +\n            \"675\" +\n            \"676\" +\n            \"677\" +\n            \"678\" +\n            \"679\" +\n            \"680\" +\n            \"681\" +\n            \"682\" +\n            \"683\" +\n            \"684\" +\n            \"685\" +\n            \"686\" +\n            \"687\" +\n            \"688\" +\n            \"689\" +\n            \"690\" +\n            \"691\" +\n            \"692\" +\n            \"693\" +\n            \"694\" +\n            \"695\" +\n            \"696\" +\n            \"697\" +\n            \"698\" +\n            \"699\" +\n            \"700\" +\n            \"701\" +\n            \"702\" +\n            \"703\" +\n            \"704\" +\n            \"705\" +\n            \"706\" +\n            \"707\" +\n            \"708\" +\n            \"709\" +\n            \"710\" +\n            \"711\" +\n            \"712\" +\n            \"713\" +\n            \"714\" +\n            \"715\" +\n            \"716\" +\n            \"717\" +\n            \"718\" +\n            \"719\" +\n            \"720\" +\n            \"721\" +\n            \"722\" +\n            \"723\" +\n            \"724\" +\n            \"725\" +\n            \"726\" +\n            \"727\" +\n            \"728\" +\n            \"729\" +\n            \"730\" +\n            \"731\" +\n            \"732\" +\n            \"733\" +\n            \"734\" +\n            \"735\" +\n            \"736\" +\n            \"737\" +\n            \"738\" +\n            \"739\" +\n            \"740\" +\n            \"741\" +\n            \"742\" +\n            \"743\" +\n            \"744\" +\n            \"745\" +\n            \"746\" +\n            \"747\" +\n            \"748\" +\n            \"749\" +\n            \"750\" +\n            \"751\" +\n            \"752\" +\n            \"753\" +\n            \"754\" +\n            \"755\" +\n            \"756\" +\n            \"757\" +\n            \"758\" +\n            \"759\" +\n            \"760\" +\n            \"761\" +\n            \"762\" +\n            \"763\" +\n            \"764\" +\n            \"765\" +\n            \"766\" +\n            \"767\" +\n            \"768\" +\n            \"769\" +\n            \"770\" +\n            \"771\" +\n            \"772\" +\n            \"773\" +\n            \"774\" +\n            \"775\" +\n            \"776\" +\n            \"777\" +\n            \"778\" +\n            \"779\" +\n            \"780\" +\n            \"781\" +\n            \"782\" +\n            \"783\" +\n            \"784\" +\n            \"785\" +\n            \"786\" +\n            \"787\" +\n            \"788\" +\n            \"789\" +\n            \"790\" +\n            \"791\" +\n            \"792\" +\n            \"793\" +\n            \"794\" +\n            \"795\" +\n            \"796\" +\n            \"797\" +\n            \"798\" +\n            \"799\" +\n            \"800\" +\n            \"801\" +\n            \"802\" +\n            \"803\" +\n            \"804\" +\n            \"805\" +\n            \"806\" +\n            \"807\" +\n            \"808\" +\n            \"809\" +\n            \"810\" +\n            \"811\" +\n            \"812\" +\n            \"813\" +\n            \"814\" +\n            \"815\" +\n            \"816\" +\n            \"817\" +\n            \"818\" +\n            \"819\" +\n            \"820\" +\n            \"821\" +\n            \"822\" +\n            \"823\" +\n            \"824\" +\n            \"825\" +\n            \"826\" +\n            \"827\" +\n            \"828\" +\n            \"829\" +\n            \"830\" +\n            \"831\" +\n            \"832\" +\n            \"833\" +\n            \"834\" +\n            \"835\" +\n            \"836\" +\n            \"837\" +\n            \"838\" +\n            \"839\" +\n            \"840\" +\n            \"841\" +\n            \"842\" +\n            \"843\" +\n            \"844\" +\n            \"845\" +\n            \"846\" +\n            \"847\" +\n            \"848\" +\n            \"849\" +\n            \"850\" +\n            \"851\" +\n            \"852\" +\n            \"853\" +\n            \"854\" +\n            \"855\" +\n            \"856\" +\n            \"857\" +\n            \"858\" +\n            \"859\" +\n            \"860\" +\n            \"861\" +\n            \"862\" +\n            \"863\" +\n            \"864\" +\n            \"865\" +\n            \"866\" +\n            \"867\" +\n            \"868\" +\n            \"869\" +\n            \"870\" +\n            \"871\" +\n            \"872\" +\n            \"873\" +\n            \"874\" +\n            \"875\" +\n            \"876\" +\n            \"877\" +\n            \"878\" +\n            \"879\" +\n            \"880\" +\n            \"881\" +\n            \"882\" +\n            \"883\" +\n            \"884\" +\n            \"885\" +\n            \"886\" +\n            \"887\" +\n            \"888\" +\n            \"889\" +\n            \"890\" +\n            \"891\" +\n            \"892\" +\n            \"893\" +\n            \"894\" +\n            \"895\" +\n            \"896\" +\n            \"897\" +\n            \"898\" +\n            \"899\" +\n            \"900\" +\n            \"901\" +\n            \"902\" +\n            \"903\" +\n            \"904\" +\n            \"905\" +\n            \"906\" +\n            \"907\" +\n            \"908\" +\n            \"909\" +\n            \"910\" +\n            \"911\" +\n            \"912\" +\n            \"913\" +\n            \"914\" +\n            \"915\" +\n            \"916\" +\n            \"917\" +\n            \"918\" +\n            \"919\" +\n            \"920\" +\n            \"921\" +\n            \"922\" +\n            \"923\" +\n            \"924\" +\n            \"925\" +\n            \"926\" +\n            \"927\" +\n            \"928\" +\n            \"929\" +\n            \"930\" +\n            \"931\" +\n            \"932\" +\n            \"933\" +\n            \"934\" +\n            \"935\" +\n            \"936\" +\n            \"937\" +\n            \"938\" +\n            \"939\" +\n            \"940\" +\n            \"941\" +\n            \"942\" +\n            \"943\" +\n            \"944\" +\n            \"945\" +\n            \"946\" +\n            \"947\" +\n            \"948\" +\n            \"949\" +\n            \"950\" +\n            \"951\" +\n            \"952\" +\n            \"953\" +\n            \"954\" +\n            \"955\" +\n            \"956\" +\n            \"957\" +\n            \"958\" +\n            \"959\" +\n            \"960\" +\n            \"961\" +\n            \"962\" +\n            \"963\" +\n            \"964\" +\n            \"965\" +\n            \"966\" +\n            \"967\" +\n            \"968\" +\n            \"969\" +\n            \"970\" +\n            \"971\" +\n            \"972\" +\n            \"973\" +\n            \"974\" +\n            \"975\" +\n            \"976\" +\n            \"977\" +\n            \"978\" +\n            \"979\" +\n            \"980\" +\n            \"981\" +\n            \"982\" +\n            \"983\" +\n            \"984\" +\n            \"985\" +\n            \"986\" +\n            \"987\" +\n            \"988\" +\n            \"989\" +\n            \"990\" +\n            \"991\" +\n            \"992\" +\n            \"993\" +\n            \"994\" +\n            \"995\" +\n            \"996\" +\n            \"997\" +\n            \"998\" +\n            \"999\" +\n            \"1000\" +\n            \"1001\" +\n            \"1002\" +\n            \"1003\" +\n            \"1004\" +\n            \"1005\" +\n            \"1006\" +\n            \"1007\" +\n            \"1008\" +\n            \"1009\" +\n            \"1010\" +\n            \"1011\" +\n            \"1012\" +\n            \"1013\" +\n            \"1014\" +\n            \"1015\" +\n            \"1016\" +\n            \"1017\" +\n            \"1018\" +\n            \"1019\" +\n            \"1020\" +\n            \"1021\" +\n            \"1022\" +\n            \"1023\" +\n            \"1024\" +\n            \"1025\" +\n            \"1026\" +\n            \"1027\" +\n            \"1028\" +\n            \"1029\" +\n            \"1030\" +\n            \"1031\" +\n            \"1032\" +\n            \"1033\" +\n            \"1034\" +\n            \"1035\" +\n            \"1036\" +\n            \"1037\" +\n            \"1038\" +\n            \"1039\" +\n            \"1040\" +\n            \"1041\" +\n            \"1042\" +\n            \"1043\" +\n            \"1044\" +\n            \"1045\" +\n            \"1046\" +\n            \"1047\" +\n            \"1048\" +\n            \"1049\" +\n            \"1050\" +\n            \"1051\" +\n            \"1052\" +\n            \"1053\" +\n            \"1054\" +\n            \"1055\" +\n            \"1056\" +\n            \"1057\" +\n            \"1058\" +\n            \"1059\" +\n            \"1060\" +\n            \"1061\" +\n            \"1062\" +\n            \"1063\" +\n            \"1064\" +\n            \"1065\" +\n            \"1066\" +\n            \"1067\" +\n            \"1068\" +\n            \"1069\" +\n            \"1070\" +\n            \"1071\" +\n            \"1072\" +\n            \"1073\" +\n            \"1074\" +\n            \"1075\" +\n            \"1076\" +\n            \"1077\" +\n            \"1078\" +\n            \"1079\" +\n            \"1080\" +\n            \"1081\" +\n            \"1082\" +\n            \"1083\" +\n            \"1084\" +\n            \"1085\" +\n            \"1086\" +\n            \"1087\" +\n            \"1088\" +\n            \"1089\" +\n            \"1090\" +\n            \"1091\" +\n            \"1092\" +\n            \"1093\" +\n            \"1094\" +\n            \"1095\" +\n            \"1096\" +\n            \"1097\" +\n            \"1098\" +\n            \"1099\" +\n            \"1100\" +\n            \"1101\" +\n            \"1102\" +\n            \"1103\" +\n            \"1104\" +\n            \"1105\" +\n            \"1106\" +\n            \"1107\" +\n            \"1108\" +\n            \"1109\" +\n            \"1110\" +\n            \"1111\" +\n            \"1112\" +\n            \"1113\" +\n            \"1114\" +\n            \"1115\" +\n            \"1116\" +\n            \"1117\" +\n            \"1118\" +\n            \"1119\" +\n            \"1120\" +\n            \"1121\" +\n            \"1122\" +\n            \"1123\" +\n            \"1124\" +\n            \"1125\" +\n            \"1126\" +\n            \"1127\" +\n            \"1128\" +\n            \"1129\" +\n            \"1130\" +\n            \"1131\" +\n            \"1132\" +\n            \"1133\" +\n            \"1134\" +\n            \"1135\" +\n            \"1136\" +\n            \"1137\" +\n            \"1138\" +\n            \"1139\" +\n            \"1140\" +\n            \"1141\" +\n            \"1142\" +\n            \"1143\" +\n            \"1144\" +\n            \"1145\" +\n            \"1146\" +\n            \"1147\" +\n            \"1148\" +\n            \"1149\" +\n            \"1150\" +\n            \"1151\" +\n            \"1152\" +\n            \"1153\" +\n            \"1154\" +\n            \"1155\" +\n            \"1156\" +\n            \"1157\" +\n            \"1158\" +\n            \"1159\" +\n            \"1160\" +\n            \"1161\" +\n            \"1162\" +\n            \"1163\" +\n            \"1164\" +\n            \"1165\" +\n            \"1166\" +\n            \"1167\" +\n            \"1168\" +\n            \"1169\" +\n            \"1170\" +\n            \"1171\" +\n            \"1172\" +\n            \"1173\" +\n            \"1174\" +\n            \"1175\" +\n            \"1176\" +\n            \"1177\" +\n            \"1178\" +\n            \"1179\" +\n            \"1180\" +\n            \"1181\" +\n            \"1182\" +\n            \"1183\" +\n            \"1184\" +\n            \"1185\" +\n            \"1186\" +\n            \"1187\" +\n            \"1188\" +\n            \"1189\" +\n            \"1190\" +\n            \"1191\" +\n            \"1192\" +\n            \"1193\" +\n            \"1194\" +\n            \"1195\" +\n            \"1196\" +\n            \"1197\" +\n            \"1198\" +\n            \"1199\" +\n            \"1200\" +\n            \"1201\" +\n            \"1202\" +\n            \"1203\" +\n            \"1204\" +\n            \"1205\" +\n            \"1206\" +\n            \"1207\" +\n            \"1208\" +\n            \"1209\" +\n            \"1210\" +\n            \"1211\" +\n            \"1212\" +\n            \"1213\" +\n            \"1214\" +\n            \"1215\" +\n            \"1216\" +\n            \"1217\" +\n            \"1218\" +\n            \"1219\" +\n            \"1220\" +\n            \"1221\" +\n            \"1222\" +\n            \"1223\" +\n            \"1224\" +\n            \"1225\" +\n            \"1226\" +\n            \"1227\" +\n            \"1228\" +\n            \"1229\" +\n            \"1230\" +\n            \"1231\" +\n            \"1232\" +\n            \"1233\" +\n            \"1234\" +\n            \"1235\" +\n            \"1236\" +\n            \"1237\" +\n            \"1238\" +\n            \"1239\" +\n            \"1240\" +\n            \"1241\" +\n            \"1242\" +\n            \"1243\" +\n            \"1244\" +\n            \"1245\" +\n            \"1246\" +\n            \"1247\" +\n            \"1248\" +\n            \"1249\" +\n            \"1250\" +\n            \"1251\" +\n            \"1252\" +\n            \"1253\" +\n            \"1254\" +\n            \"1255\" +\n            \"1256\" +\n            \"1257\" +\n            \"1258\" +\n            \"1259\" +\n            \"1260\" +\n            \"1261\" +\n            \"1262\" +\n            \"1263\" +\n            \"1264\" +\n            \"1265\" +\n            \"1266\" +\n            \"1267\" +\n            \"1268\" +\n            \"1269\" +\n            \"1270\" +\n            \"1271\" +\n            \"1272\" +\n            \"1273\" +\n            \"1274\" +\n            \"1275\" +\n            \"1276\" +\n            \"1277\" +\n            \"1278\" +\n            \"1279\" +\n            \"1280\" +\n            \"1281\" +\n            \"1282\" +\n            \"1283\" +\n            \"1284\" +\n            \"1285\" +\n            \"1286\" +\n            \"1287\" +\n            \"1288\" +\n            \"1289\" +\n            \"1290\" +\n            \"1291\" +\n            \"1292\" +\n            \"1293\" +\n            \"1294\" +\n            \"1295\" +\n            \"1296\" +\n            \"1297\" +\n            \"1298\" +\n            \"1299\" +\n            \"1300\" +\n            \"1301\" +\n            \"1302\" +\n            \"1303\" +\n            \"1304\" +\n            \"1305\" +\n            \"1306\" +\n            \"1307\" +\n            \"1308\" +\n            \"1309\" +\n            \"1310\" +\n            \"1311\" +\n            \"1312\" +\n            \"1313\" +\n            \"1314\" +\n            \"1315\" +\n            \"1316\" +\n            \"1317\" +\n            \"1318\" +\n            \"1319\" +\n            \"1320\" +\n            \"1321\" +\n            \"1322\" +\n            \"1323\" +\n            \"1324\" +\n            \"1325\" +\n            \"1326\" +\n            \"1327\" +\n            \"1328\" +\n            \"1329\" +\n            \"1330\" +\n            \"1331\" +\n            \"1332\" +\n            \"1333\" +\n            \"1334\" +\n            \"1335\" +\n            \"1336\" +\n            \"1337\" +\n            \"1338\" +\n            \"1339\" +\n            \"1340\" +\n            \"1341\" +\n            \"1342\" +\n            \"1343\" +\n            \"1344\" +\n            \"1345\" +\n            \"1346\" +\n            \"1347\" +\n            \"1348\" +\n            \"1349\" +\n            \"1350\" +\n            \"1351\" +\n            \"1352\" +\n            \"1353\" +\n            \"1354\" +\n            \"1355\" +\n            \"1356\" +\n            \"1357\" +\n            \"1358\" +\n            \"1359\" +\n            \"1360\" +\n            \"1361\" +\n            \"1362\" +\n            \"1363\" +\n            \"1364\" +\n            \"1365\" +\n            \"1366\" +\n            \"1367\" +\n            \"1368\" +\n            \"1369\" +\n            \"1370\" +\n            \"1371\" +\n            \"1372\" +\n            \"1373\" +\n            \"1374\" +\n            \"1375\" +\n            \"1376\" +\n            \"1377\" +\n            \"1378\" +\n            \"1379\" +\n            \"1380\" +\n            \"1381\" +\n            \"1382\" +\n            \"1383\" +\n            \"1384\" +\n            \"1385\" +\n            \"1386\" +\n            \"1387\" +\n            \"1388\" +\n            \"1389\" +\n            \"1390\" +\n            \"1391\" +\n            \"1392\" +\n            \"1393\" +\n            \"1394\" +\n            \"1395\" +\n            \"1396\" +\n            \"1397\" +\n            \"1398\" +\n            \"1399\" +\n            \"1400\" +\n            \"1401\" +\n            \"1402\" +\n            \"1403\" +\n            \"1404\" +\n            \"1405\" +\n            \"1406\" +\n            \"1407\" +\n            \"1408\" +\n            \"1409\" +\n            \"1410\" +\n            \"1411\" +\n            \"1412\" +\n            \"1413\" +\n            \"1414\" +\n            \"1415\" +\n            \"1416\" +\n            \"1417\" +\n            \"1418\" +\n            \"1419\" +\n            \"1420\" +\n            \"1421\" +\n            \"1422\" +\n            \"1423\" +\n            \"1424\" +\n            \"1425\" +\n            \"1426\" +\n            \"1427\" +\n            \"1428\" +\n            \"1429\" +\n            \"1430\" +\n            \"1431\" +\n            \"1432\" +\n            \"1433\" +\n            \"1434\" +\n            \"1435\" +\n            \"1436\" +\n            \"1437\" +\n            \"1438\" +\n            \"1439\" +\n            \"1440\" +\n            \"1441\" +\n            \"1442\" +\n            \"1443\" +\n            \"1444\" +\n            \"1445\" +\n            \"1446\" +\n            \"1447\" +\n            \"1448\" +\n            \"1449\" +\n            \"1450\" +\n            \"1451\" +\n            \"1452\" +\n            \"1453\" +\n            \"1454\" +\n            \"1455\" +\n            \"1456\" +\n            \"1457\" +\n            \"1458\" +\n            \"1459\" +\n            \"1460\" +\n            \"1461\" +\n            \"1462\" +\n            \"1463\" +\n            \"1464\" +\n            \"1465\" +\n            \"1466\" +\n            \"1467\" +\n            \"1468\" +\n            \"1469\" +\n            \"1470\" +\n            \"1471\" +\n            \"1472\" +\n            \"1473\" +\n            \"1474\" +\n            \"1475\" +\n            \"1476\" +\n            \"1477\" +\n            \"1478\" +\n            \"1479\" +\n            \"1480\" +\n            \"1481\" +\n            \"1482\" +\n            \"1483\" +\n            \"1484\" +\n            \"1485\" +\n            \"1486\" +\n            \"1487\" +\n            \"1488\" +\n            \"1489\" +\n            \"1490\" +\n            \"1491\" +\n            \"1492\" +\n            \"1493\" +\n            \"1494\" +\n            \"1495\" +\n            \"1496\" +\n            \"1497\" +\n            \"1498\" +\n            \"1499\" +\n            \"1500\" +\n            \"1501\" +\n            \"1502\" +\n            \"1503\" +\n            \"1504\" +\n            \"1505\" +\n            \"1506\" +\n            \"1507\" +\n            \"1508\" +\n            \"1509\" +\n            \"1510\" +\n            \"1511\" +\n            \"1512\" +\n            \"1513\" +\n            \"1514\" +\n            \"1515\" +\n            \"1516\" +\n            \"1517\" +\n            \"1518\" +\n            \"1519\" +\n            \"1520\" +\n            \"1521\" +\n            \"1522\" +\n            \"1523\" +\n            \"1524\" +\n            \"1525\" +\n            \"1526\" +\n            \"1527\" +\n            \"1528\" +\n            \"1529\" +\n            \"1530\" +\n            \"1531\" +\n            \"1532\" +\n            \"1533\" +\n            \"1534\" +\n            \"1535\" +\n            \"1536\" +\n            \"1537\" +\n            \"1538\" +\n            \"1539\" +\n            \"1540\" +\n            \"1541\" +\n            \"1542\" +\n            \"1543\" +\n            \"1544\" +\n            \"1545\" +\n            \"1546\" +\n            \"1547\" +\n            \"1548\" +\n            \"1549\" +\n            \"1550\" +\n            \"1551\" +\n            \"1552\" +\n            \"1553\" +\n            \"1554\" +\n            \"1555\" +\n            \"1556\" +\n            \"1557\" +\n            \"1558\" +\n            \"1559\" +\n            \"1560\" +\n            \"1561\" +\n            \"1562\" +\n            \"1563\" +\n            \"1564\" +\n            \"1565\" +\n            \"1566\" +\n            \"1567\" +\n            \"1568\" +\n            \"1569\" +\n            \"1570\" +\n            \"1571\" +\n            \"1572\" +\n            \"1573\" +\n            \"1574\" +\n            \"1575\" +\n            \"1576\" +\n            \"1577\" +\n            \"1578\" +\n            \"1579\" +\n            \"1580\" +\n            \"1581\" +\n            \"1582\" +\n            \"1583\" +\n            \"1584\" +\n            \"1585\" +\n            \"1586\" +\n            \"1587\" +\n            \"1588\" +\n            \"1589\" +\n            \"1590\" +\n            \"1591\" +\n            \"1592\" +\n            \"1593\" +\n            \"1594\" +\n            \"1595\" +\n            \"1596\" +\n            \"1597\" +\n            \"1598\" +\n            \"1599\" +\n            \"1600\" +\n            \"1601\" +\n            \"1602\" +\n            \"1603\" +\n            \"1604\" +\n            \"1605\" +\n            \"1606\" +\n            \"1607\" +\n            \"1608\" +\n            \"1609\" +\n            \"1610\" +\n            \"1611\" +\n            \"1612\" +\n            \"1613\" +\n            \"1614\" +\n            \"1615\" +\n            \"1616\" +\n            \"1617\" +\n            \"1618\" +\n            \"1619\" +\n            \"1620\" +\n            \"1621\" +\n            \"1622\" +\n            \"1623\" +\n            \"1624\" +\n            \"1625\" +\n            \"1626\" +\n            \"1627\" +\n            \"1628\" +\n            \"1629\" +\n            \"1630\" +\n            \"1631\" +\n            \"1632\" +\n            \"1633\" +\n            \"1634\" +\n            \"1635\" +\n            \"1636\" +\n            \"1637\" +\n            \"1638\" +\n            \"1639\" +\n            \"1640\" +\n            \"1641\" +\n            \"1642\" +\n            \"1643\" +\n            \"1644\" +\n            \"1645\" +\n            \"1646\" +\n            \"1647\" +\n            \"1648\" +\n            \"1649\" +\n            \"1650\" +\n            \"1651\" +\n            \"1652\" +\n            \"1653\" +\n            \"1654\" +\n            \"1655\" +\n            \"1656\" +\n            \"1657\" +\n            \"1658\" +\n            \"1659\" +\n            \"1660\" +\n            \"1661\" +\n            \"1662\" +\n            \"1663\" +\n            \"1664\" +\n            \"1665\" +\n            \"1666\" +\n            \"1667\" +\n            \"1668\" +\n            \"1669\" +\n            \"1670\" +\n            \"1671\" +\n            \"1672\" +\n            \"1673\" +\n            \"1674\" +\n            \"1675\" +\n            \"1676\" +\n            \"1677\" +\n            \"1678\" +\n            \"1679\" +\n            \"1680\" +\n            \"1681\" +\n            \"1682\" +\n            \"1683\" +\n            \"1684\" +\n            \"1685\" +\n            \"1686\" +\n            \"1687\" +\n            \"1688\" +\n            \"1689\" +\n            \"1690\" +\n            \"1691\" +\n            \"1692\" +\n            \"1693\" +\n            \"1694\" +\n            \"1695\" +\n            \"1696\" +\n            \"1697\" +\n            \"1698\" +\n            \"1699\" +\n            \"1700\" +\n            \"1701\" +\n            \"1702\" +\n            \"1703\" +\n            \"1704\" +\n            \"1705\" +\n            \"1706\" +\n            \"1707\" +\n            \"1708\" +\n            \"1709\" +\n            \"1710\" +\n            \"1711\" +\n            \"1712\" +\n            \"1713\" +\n            \"1714\" +\n            \"1715\" +\n            \"1716\" +\n            \"1717\" +\n            \"1718\" +\n            \"1719\" +\n            \"1720\" +\n            \"1721\" +\n            \"1722\" +\n            \"1723\" +\n            \"1724\" +\n            \"1725\" +\n            \"1726\" +\n            \"1727\" +\n            \"1728\" +\n            \"1729\" +\n            \"1730\" +\n            \"1731\" +\n            \"1732\" +\n            \"1733\" +\n            \"1734\" +\n            \"1735\" +\n            \"1736\" +\n            \"1737\" +\n            \"1738\" +\n            \"1739\" +\n            \"1740\" +\n            \"1741\" +\n            \"1742\" +\n            \"1743\" +\n            \"1744\" +\n            \"1745\" +\n            \"1746\" +\n            \"1747\" +\n            \"1748\" +\n            \"1749\" +\n            \"1750\" +\n            \"1751\" +\n            \"1752\" +\n            \"1753\" +\n            \"1754\" +\n            \"1755\" +\n            \"1756\" +\n            \"1757\" +\n            \"1758\" +\n            \"1759\" +\n            \"1760\" +\n            \"1761\" +\n            \"1762\" +\n            \"1763\" +\n            \"1764\" +\n            \"1765\" +\n            \"1766\" +\n            \"1767\" +\n            \"1768\" +\n            \"1769\" +\n            \"1770\" +\n            \"1771\" +\n            \"1772\" +\n            \"1773\" +\n            \"1774\" +\n            \"1775\" +\n            \"1776\" +\n            \"1777\" +\n            \"1778\" +\n            \"1779\" +\n            \"1780\" +\n            \"1781\" +\n            \"1782\" +\n            \"1783\" +\n            \"1784\" +\n            \"1785\" +\n            \"1786\" +\n            \"1787\" +\n            \"1788\" +\n            \"1789\" +\n            \"1790\" +\n            \"1791\" +\n            \"1792\" +\n            \"1793\" +\n            \"1794\" +\n            \"1795\" +\n            \"1796\" +\n            \"1797\" +\n            \"1798\" +\n            \"1799\" +\n            \"1800\" +\n            \"1801\" +\n            \"1802\" +\n            \"1803\" +\n            \"1804\" +\n            \"1805\" +\n            \"1806\" +\n            \"1807\" +\n            \"1808\" +\n            \"1809\" +\n            \"1810\" +\n            \"1811\" +\n            \"1812\" +\n            \"1813\" +\n            \"1814\" +\n            \"1815\" +\n            \"1816\" +\n            \"1817\" +\n            \"1818\" +\n            \"1819\" +\n            \"1820\" +\n            \"1821\" +\n            \"1822\" +\n            \"1823\" +\n            \"1824\" +\n            \"1825\" +\n            \"1826\" +\n            \"1827\" +\n            \"1828\" +\n            \"1829\" +\n            \"1830\" +\n            \"1831\" +\n            \"1832\" +\n            \"1833\" +\n            \"1834\" +\n            \"1835\" +\n            \"1836\" +\n            \"1837\" +\n            \"1838\" +\n            \"1839\" +\n            \"1840\" +\n            \"1841\" +\n            \"1842\" +\n            \"1843\" +\n            \"1844\" +\n            \"1845\" +\n            \"1846\" +\n            \"1847\" +\n            \"1848\" +\n            \"1849\" +\n            \"1850\" +\n            \"1851\" +\n            \"1852\" +\n            \"1853\" +\n            \"1854\" +\n            \"1855\" +\n            \"1856\" +\n            \"1857\" +\n            \"1858\" +\n            \"1859\" +\n            \"1860\" +\n            \"1861\" +\n            \"1862\" +\n            \"1863\" +\n            \"1864\" +\n            \"1865\" +\n            \"1866\" +\n            \"1867\" +\n            \"1868\" +\n            \"1869\" +\n            \"1870\" +\n            \"1871\" +\n            \"1872\" +\n            \"1873\" +\n            \"1874\" +\n            \"1875\" +\n            \"1876\" +\n            \"1877\" +\n            \"1878\" +\n            \"1879\" +\n            \"1880\" +\n            \"1881\" +\n            \"1882\" +\n            \"1883\" +\n            \"1884\" +\n            \"1885\" +\n            \"1886\" +\n            \"1887\" +\n            \"1888\" +\n            \"1889\" +\n            \"1890\" +\n            \"1891\" +\n            \"1892\" +\n            \"1893\" +\n            \"1894\" +\n            \"1895\" +\n            \"1896\" +\n            \"1897\" +\n            \"1898\" +\n            \"1899\" +\n            \"1900\" +\n            \"1901\" +\n            \"1902\" +\n            \"1903\" +\n            \"1904\" +\n            \"1905\" +\n            \"1906\" +\n            \"1907\" +\n            \"1908\" +\n            \"1909\" +\n            \"1910\" +\n            \"1911\" +\n            \"1912\" +\n            \"1913\" +\n            \"1914\" +\n            \"1915\" +\n            \"1916\" +\n            \"1917\" +\n            \"1918\" +\n            \"1919\" +\n            \"1920\" +\n            \"1921\" +\n            \"1922\" +\n            \"1923\" +\n            \"1924\" +\n            \"1925\" +\n            \"1926\" +\n            \"1927\" +\n            \"1928\" +\n            \"1929\" +\n            \"1930\" +\n            \"1931\" +\n            \"1932\" +\n            \"1933\" +\n            \"1934\" +\n            \"1935\" +\n            \"1936\" +\n            \"1937\" +\n            \"1938\" +\n            \"1939\" +\n            \"1940\" +\n            \"1941\" +\n            \"1942\" +\n            \"1943\" +\n            \"1944\" +\n            \"1945\" +\n            \"1946\" +\n            \"1947\" +\n            \"1948\" +\n            \"1949\" +\n            \"1950\" +\n            \"1951\" +\n            \"1952\" +\n            \"1953\" +\n            \"1954\" +\n            \"1955\" +\n            \"1956\" +\n            \"1957\" +\n            \"1958\" +\n            \"1959\" +\n            \"1960\" +\n            \"1961\" +\n            \"1962\" +\n            \"1963\" +\n            \"1964\" +\n            \"1965\" +\n            \"1966\" +\n            \"1967\" +\n            \"1968\" +\n            \"1969\" +\n            \"1970\" +\n            \"1971\" +\n            \"1972\" +\n            \"1973\" +\n            \"1974\" +\n            \"1975\" +\n            \"1976\" +\n            \"1977\" +\n            \"1978\" +\n            \"1979\" +\n            \"1980\" +\n            \"1981\" +\n            \"1982\" +\n            \"1983\" +\n            \"1984\" +\n            \"1985\" +\n            \"1986\" +\n            \"1987\" +\n            \"1988\" +\n            \"1989\" +\n            \"1990\" +\n            \"1991\" +\n            \"1992\" +\n            \"1993\" +\n            \"1994\" +\n            \"1995\" +\n            \"1996\" +\n            \"1997\" +\n            \"1998\" +\n            \"1999\" +\n            \"2000\" +\n            \"2001\" +\n            \"2002\" +\n            \"2003\" +\n            \"2004\" +\n            \"2005\" +\n            \"2006\" +\n            \"2007\" +\n            \"2008\" +\n            \"2009\" +\n            \"2010\" +\n            \"2011\" +\n            \"2012\" +\n            \"2013\" +\n            \"2014\" +\n            \"2015\" +\n            \"2016\" +\n            \"2017\" +\n            \"2018\" +\n            \"2019\" +\n            \"2020\" +\n            \"2021\" +\n            \"2022\" +\n            \"2023\" +\n            \"2024\" +\n            \"2025\" +\n            \"2026\" +\n            \"2027\" +\n            \"2028\" +\n            \"2029\" +\n            \"2030\" +\n            \"2031\" +\n            \"2032\" +\n            \"2033\" +\n            \"2034\" +\n            \"2035\" +\n            \"2036\" +\n            \"2037\" +\n            \"2038\" +\n            \"2039\" +\n            \"2040\" +\n            \"2041\" +\n            \"2042\" +\n            \"2043\" +\n            \"2044\" +\n            \"2045\" +\n            \"2046\" +\n            \"2047\" +\n            \"2048\" +\n            \"2049\" +\n            \"2050\" +\n            \"2051\" +\n            \"2052\" +\n            \"2053\" +\n            \"2054\" +\n            \"2055\" +\n            \"2056\" +\n            \"2057\" +\n            \"2058\" +\n            \"2059\" +\n            \"2060\" +\n            \"2061\" +\n            \"2062\" +\n            \"2063\" +\n            \"2064\" +\n            \"2065\" +\n            \"2066\" +\n            \"2067\" +\n            \"2068\" +\n            \"2069\" +\n            \"2070\" +\n            \"2071\" +\n            \"2072\" +\n            \"2073\" +\n            \"2074\" +\n            \"2075\" +\n            \"2076\" +\n            \"2077\" +\n            \"2078\" +\n            \"2079\" +\n            \"2080\" +\n            \"2081\" +\n            \"2082\" +\n            \"2083\" +\n            \"2084\" +\n            \"2085\" +\n            \"2086\" +\n            \"2087\" +\n            \"2088\" +\n            \"2089\" +\n            \"2090\" +\n            \"2091\" +\n            \"2092\" +\n            \"2093\" +\n            \"2094\" +\n            \"2095\" +\n            \"2096\" +\n            \"2097\" +\n            \"2098\" +\n            \"2099\" +\n            \"2100\" +\n            \"2101\" +\n            \"2102\" +\n            \"2103\" +\n            \"2104\" +\n            \"2105\" +\n            \"2106\" +\n            \"2107\" +\n            \"2108\" +\n            \"2109\" +\n            \"2110\" +\n            \"2111\" +\n            \"2112\" +\n            \"2113\" +\n            \"2114\" +\n            \"2115\" +\n            \"2116\" +\n            \"2117\" +\n            \"2118\" +\n            \"2119\" +\n            \"2120\" +\n            \"2121\" +\n            \"2122\" +\n            \"2123\" +\n            \"2124\" +\n            \"2125\" +\n            \"2126\" +\n            \"2127\" +\n            \"2128\" +\n            \"2129\" +\n            \"2130\" +\n            \"2131\" +\n            \"2132\" +\n            \"2133\" +\n            \"2134\" +\n            \"2135\" +\n            \"2136\" +\n            \"2137\" +\n            \"2138\" +\n            \"2139\" +\n            \"2140\" +\n            \"2141\" +\n            \"2142\" +\n            \"2143\" +\n            \"2144\" +\n            \"2145\" +\n            \"2146\" +\n            \"2147\" +\n            \"2148\" +\n            \"2149\" +\n            \"2150\" +\n            \"2151\" +\n            \"2152\" +\n            \"2153\" +\n            \"2154\" +\n            \"2155\" +\n            \"2156\" +\n            \"2157\" +\n            \"2158\" +\n            \"2159\" +\n            \"2160\" +\n            \"2161\" +\n            \"2162\" +\n            \"2163\" +\n            \"2164\" +\n            \"2165\" +\n            \"2166\" +\n            \"2167\" +\n            \"2168\" +\n            \"2169\" +\n            \"2170\" +\n            \"2171\" +\n            \"2172\" +\n            \"2173\" +\n            \"2174\" +\n            \"2175\" +\n            \"2176\" +\n            \"2177\" +\n            \"2178\" +\n            \"2179\" +\n            \"2180\" +\n            \"2181\" +\n            \"2182\" +\n            \"2183\" +\n            \"2184\" +\n            \"2185\" +\n            \"2186\" +\n            \"2187\" +\n            \"2188\" +\n            \"2189\" +\n            \"2190\" +\n            \"2191\" +\n            \"2192\" +\n            \"2193\" +\n            \"2194\" +\n            \"2195\" +\n            \"2196\" +\n            \"2197\" +\n            \"2198\" +\n            \"2199\" +\n            \"2200\" +\n            \"2201\" +\n            \"2202\" +\n            \"2203\" +\n            \"2204\" +\n            \"2205\" +\n            \"2206\" +\n            \"2207\" +\n            \"2208\" +\n            \"2209\" +\n            \"2210\" +\n            \"2211\" +\n            \"2212\" +\n            \"2213\" +\n            \"2214\" +\n            \"2215\" +\n            \"2216\" +\n            \"2217\" +\n            \"2218\" +\n            \"2219\" +\n            \"2220\" +\n            \"2221\" +\n            \"2222\" +\n            \"2223\" +\n            \"2224\" +\n            \"2225\" +\n            \"2226\" +\n            \"2227\" +\n            \"2228\" +\n            \"2229\" +\n            \"2230\" +\n            \"2231\" +\n            \"2232\" +\n            \"2233\" +\n            \"2234\" +\n            \"2235\" +\n            \"2236\" +\n            \"2237\" +\n            \"2238\" +\n            \"2239\" +\n            \"2240\" +\n            \"2241\" +\n            \"2242\" +\n            \"2243\" +\n            \"2244\" +\n            \"2245\" +\n            \"2246\" +\n            \"2247\" +\n            \"2248\" +\n            \"2249\" +\n            \"2250\" +\n            \"2251\" +\n            \"2252\" +\n            \"2253\" +\n            \"2254\" +\n            \"2255\" +\n            \"2256\" +\n            \"2257\" +\n            \"2258\" +\n            \"2259\" +\n            \"2260\" +\n            \"2261\" +\n            \"2262\" +\n            \"2263\" +\n            \"2264\" +\n            \"2265\" +\n            \"2266\" +\n            \"2267\" +\n            \"2268\" +\n            \"2269\" +\n            \"2270\" +\n            \"2271\" +\n            \"2272\" +\n            \"2273\" +\n            \"2274\" +\n            \"2275\" +\n            \"2276\" +\n            \"2277\" +\n            \"2278\" +\n            \"2279\" +\n            \"2280\" +\n            \"2281\" +\n            \"2282\" +\n            \"2283\" +\n            \"2284\" +\n            \"2285\" +\n            \"2286\" +\n            \"2287\" +\n            \"2288\" +\n            \"2289\" +\n            \"2290\" +\n            \"2291\" +\n            \"2292\" +\n            \"2293\" +\n            \"2294\" +\n            \"2295\" +\n            \"2296\" +\n            \"2297\" +\n            \"2298\" +\n            \"2299\" +\n            \"2300\" +\n            \"2301\" +\n            \"2302\" +\n            \"2303\" +\n            \"2304\" +\n            \"2305\" +\n            \"2306\" +\n            \"2307\" +\n            \"2308\" +\n            \"2309\" +\n            \"2310\" +\n            \"2311\" +\n            \"2312\" +\n            \"2313\" +\n            \"2314\" +\n            \"2315\" +\n            \"2316\" +\n            \"2317\" +\n            \"2318\" +\n            \"2319\" +\n            \"2320\" +\n            \"2321\" +\n            \"2322\" +\n            \"2323\" +\n            \"2324\" +\n            \"2325\" +\n            \"2326\" +\n            \"2327\" +\n            \"2328\" +\n            \"2329\" +\n            \"2330\" +\n            \"2331\" +\n            \"2332\" +\n            \"2333\" +\n            \"2334\" +\n            \"2335\" +\n            \"2336\" +\n            \"2337\" +\n            \"2338\" +\n            \"2339\" +\n            \"2340\" +\n            \"2341\" +\n            \"2342\" +\n            \"2343\" +\n            \"2344\" +\n            \"2345\" +\n            \"2346\" +\n            \"2347\" +\n            \"2348\" +\n            \"2349\" +\n            \"2350\" +\n            \"2351\" +\n            \"2352\" +\n            \"2353\" +\n            \"2354\" +\n            \"2355\" +\n            \"2356\" +\n            \"2357\" +\n            \"2358\" +\n            \"2359\" +\n            \"2360\" +\n            \"2361\" +\n            \"2362\" +\n            \"2363\" +\n            \"2364\" +\n            \"2365\" +\n            \"2366\" +\n            \"2367\" +\n            \"2368\" +\n            \"2369\" +\n            \"2370\" +\n            \"2371\" +\n            \"2372\" +\n            \"2373\" +\n            \"2374\" +\n            \"2375\" +\n            \"2376\" +\n            \"2377\" +\n            \"2378\" +\n            \"2379\" +\n            \"2380\" +\n            \"2381\" +\n            \"2382\" +\n            \"2383\" +\n            \"2384\" +\n            \"2385\" +\n            \"2386\" +\n            \"2387\" +\n            \"2388\" +\n            \"2389\" +\n            \"2390\" +\n            \"2391\" +\n            \"2392\" +\n            \"2393\" +\n            \"2394\" +\n            \"2395\" +\n            \"2396\" +\n            \"2397\" +\n            \"2398\" +\n            \"2399\" +\n            \"2400\" +\n            \"2401\" +\n            \"2402\" +\n            \"2403\" +\n            \"2404\" +\n            \"2405\" +\n            \"2406\" +\n            \"2407\" +\n            \"2408\" +\n            \"2409\" +\n            \"2410\" +\n            \"2411\" +\n            \"2412\" +\n            \"2413\" +\n            \"2414\" +\n            \"2415\" +\n            \"2416\" +\n            \"2417\" +\n            \"2418\" +\n            \"2419\" +\n            \"2420\" +\n            \"2421\" +\n            \"2422\" +\n            \"2423\" +\n            \"2424\" +\n            \"2425\" +\n            \"2426\" +\n            \"2427\" +\n            \"2428\" +\n            \"2429\" +\n            \"2430\" +\n            \"2431\" +\n            \"2432\" +\n            \"2433\" +\n            \"2434\" +\n            \"2435\" +\n            \"2436\" +\n            \"2437\" +\n            \"2438\" +\n            \"2439\" +\n            \"2440\" +\n            \"2441\" +\n            \"2442\" +\n            \"2443\" +\n            \"2444\" +\n            \"2445\" +\n            \"2446\" +\n            \"2447\" +\n            \"2448\" +\n            \"2449\" +\n            \"2450\" +\n            \"2451\" +\n            \"2452\" +\n            \"2453\" +\n            \"2454\" +\n            \"2455\" +\n            \"2456\" +\n            \"2457\" +\n            \"2458\" +\n            \"2459\" +\n            \"2460\" +\n            \"2461\" +\n            \"2462\" +\n            \"2463\" +\n            \"2464\" +\n            \"2465\" +\n            \"2466\" +\n            \"2467\" +\n            \"2468\" +\n            \"2469\" +\n            \"2470\" +\n            \"2471\" +\n            \"2472\" +\n            \"2473\" +\n            \"2474\" +\n            \"2475\" +\n            \"2476\" +\n            \"2477\" +\n            \"2478\" +\n            \"2479\" +\n            \"2480\" +\n            \"2481\" +\n            \"2482\" +\n            \"2483\" +\n            \"2484\" +\n            \"2485\" +\n            \"2486\" +\n            \"2487\" +\n            \"2488\" +\n            \"2489\" +\n            \"2490\" +\n            \"2491\" +\n            \"2492\" +\n            \"2493\" +\n            \"2494\" +\n            \"2495\" +\n            \"2496\" +\n            \"2497\" +\n            \"2498\" +\n            \"2499\" +\n            \"2500\" +\n            \"2501\" +\n            \"2502\" +\n            \"2503\" +\n            \"2504\" +\n            \"2505\" +\n            \"2506\" +\n            \"2507\" +\n            \"2508\" +\n            \"2509\" +\n            \"2510\" +\n            \"2511\" +\n            \"2512\" +\n            \"2513\" +\n            \"2514\" +\n            \"2515\" +\n            \"2516\" +\n            \"2517\" +\n            \"2518\" +\n            \"2519\" +\n            \"2520\" +\n            \"2521\" +\n            \"2522\" +\n            \"2523\" +\n            \"2524\" +\n            \"2525\" +\n            \"2526\" +\n            \"2527\" +\n            \"2528\" +\n            \"2529\" +\n            \"2530\" +\n            \"2531\" +\n            \"2532\" +\n            \"2533\" +\n            \"2534\" +\n            \"2535\" +\n            \"2536\" +\n            \"2537\" +\n            \"2538\" +\n            \"2539\" +\n            \"2540\" +\n            \"2541\" +\n            \"2542\" +\n            \"2543\" +\n            \"2544\" +\n            \"2545\" +\n            \"2546\" +\n            \"2547\" +\n            \"2548\" +\n            \"2549\" +\n            \"2550\" +\n            \"2551\" +\n            \"2552\" +\n            \"2553\" +\n            \"2554\" +\n            \"2555\" +\n            \"2556\" +\n            \"2557\" +\n            \"2558\" +\n            \"2559\" +\n            \"2560\" +\n            \"2561\" +\n            \"2562\" +\n            \"2563\" +\n            \"2564\" +\n            \"2565\" +\n            \"2566\" +\n            \"2567\" +\n            \"2568\" +\n            \"2569\" +\n            \"2570\" +\n            \"2571\" +\n            \"2572\" +\n            \"2573\" +\n            \"2574\" +\n            \"2575\" +\n            \"2576\" +\n            \"2577\" +\n            \"2578\" +\n            \"2579\" +\n            \"2580\" +\n            \"2581\" +\n            \"2582\" +\n            \"2583\" +\n            \"2584\" +\n            \"2585\" +\n            \"2586\" +\n            \"2587\" +\n            \"2588\" +\n            \"2589\" +\n            \"2590\" +\n            \"2591\" +\n            \"2592\" +\n            \"2593\" +\n            \"2594\" +\n            \"2595\" +\n            \"2596\" +\n            \"2597\" +\n            \"2598\" +\n            \"2599\" +\n            \"2600\" +\n            \"2601\" +\n            \"2602\" +\n            \"2603\" +\n            \"2604\" +\n            \"2605\" +\n            \"2606\" +\n            \"2607\" +\n            \"2608\" +\n            \"2609\" +\n            \"2610\" +\n            \"2611\" +\n            \"2612\" +\n            \"2613\" +\n            \"2614\" +\n            \"2615\" +\n            \"2616\" +\n            \"2617\" +\n            \"2618\" +\n            \"2619\" +\n            \"2620\" +\n            \"2621\" +\n            \"2622\" +\n            \"2623\" +\n            \"2624\" +\n            \"2625\" +\n            \"2626\" +\n            \"2627\" +\n            \"2628\" +\n            \"2629\" +\n            \"2630\" +\n            \"2631\" +\n            \"2632\" +\n            \"2633\" +\n            \"2634\" +\n            \"2635\" +\n            \"2636\" +\n            \"2637\" +\n            \"2638\" +\n            \"2639\" +\n            \"2640\" +\n            \"2641\" +\n            \"2642\" +\n            \"2643\" +\n            \"2644\" +\n            \"2645\" +\n            \"2646\" +\n            \"2647\" +\n            \"2648\" +\n            \"2649\" +\n            \"2650\" +\n            \"2651\" +\n            \"2652\" +\n            \"2653\" +\n            \"2654\" +\n            \"2655\" +\n            \"2656\" +\n            \"2657\" +\n            \"2658\" +\n            \"2659\" +\n            \"2660\" +\n            \"2661\" +\n            \"2662\" +\n            \"2663\" +\n            \"2664\" +\n            \"2665\" +\n            \"2666\" +\n            \"2667\" +\n            \"2668\" +\n            \"2669\" +\n            \"2670\" +\n            \"2671\" +\n            \"2672\" +\n            \"2673\" +\n            \"2674\" +\n            \"2675\" +\n            \"2676\" +\n            \"2677\" +\n            \"2678\" +\n            \"2679\" +\n            \"2680\" +\n            \"2681\" +\n            \"2682\" +\n            \"2683\" +\n            \"2684\" +\n            \"2685\" +\n            \"2686\" +\n            \"2687\" +\n            \"2688\" +\n            \"2689\" +\n            \"2690\" +\n            \"2691\" +\n            \"2692\" +\n            \"2693\" +\n            \"2694\" +\n            \"2695\" +\n            \"2696\" +\n            \"2697\" +\n            \"2698\" +\n            \"2699\" +\n            \"2700\" +\n            \"2701\" +\n            \"2702\" +\n            \"2703\" +\n            \"2704\" +\n            \"2705\" +\n            \"2706\" +\n            \"2707\" +\n            \"2708\" +\n            \"2709\" +\n            \"2710\" +\n            \"2711\" +\n            \"2712\" +\n            \"2713\" +\n            \"2714\" +\n            \"2715\" +\n            \"2716\" +\n            \"2717\" +\n            \"2718\" +\n            \"2719\" +\n            \"2720\" +\n            \"2721\" +\n            \"2722\" +\n            \"2723\" +\n            \"2724\" +\n            \"2725\" +\n            \"2726\" +\n            \"2727\" +\n            \"2728\" +\n            \"2729\" +\n            \"2730\" +\n            \"2731\" +\n            \"2732\" +\n            \"2733\" +\n            \"2734\" +\n            \"2735\" +\n            \"2736\" +\n            \"2737\" +\n            \"2738\" +\n            \"2739\" +\n            \"2740\" +\n            \"2741\" +\n            \"2742\" +\n            \"2743\" +\n            \"2744\" +\n            \"2745\" +\n            \"2746\" +\n            \"2747\" +\n            \"2748\" +\n            \"2749\" +\n            \"2750\" +\n            \"2751\" +\n            \"2752\" +\n            \"2753\" +\n            \"2754\" +\n            \"2755\" +\n            \"2756\" +\n            \"2757\" +\n            \"2758\" +\n            \"2759\" +\n            \"2760\" +\n            \"2761\" +\n            \"2762\" +\n            \"2763\" +\n            \"2764\" +\n            \"2765\" +\n            \"2766\" +\n            \"2767\" +\n            \"2768\" +\n            \"2769\" +\n            \"2770\" +\n            \"2771\" +\n            \"2772\" +\n            \"2773\" +\n            \"2774\" +\n            \"2775\" +\n            \"2776\" +\n            \"2777\" +\n            \"2778\" +\n            \"2779\" +\n            \"2780\" +\n            \"2781\" +\n            \"2782\" +\n            \"2783\" +\n            \"2784\" +\n            \"2785\" +\n            \"2786\" +\n            \"2787\" +\n            \"2788\" +\n            \"2789\" +\n            \"2790\" +\n            \"2791\" +\n            \"2792\" +\n            \"2793\" +\n            \"2794\" +\n            \"2795\" +\n            \"2796\" +\n            \"2797\" +\n            \"2798\" +\n            \"2799\" +\n            \"2800\" +\n            \"2801\" +\n            \"2802\" +\n            \"2803\" +\n            \"2804\" +\n            \"2805\" +\n            \"2806\" +\n            \"2807\" +\n            \"2808\" +\n            \"2809\" +\n            \"2810\" +\n            \"2811\" +\n            \"2812\" +\n            \"2813\" +\n            \"2814\" +\n            \"2815\" +\n            \"2816\" +\n            \"2817\" +\n            \"2818\" +\n            \"2819\" +\n            \"2820\" +\n            \"2821\" +\n            \"2822\" +\n            \"2823\" +\n            \"2824\" +\n            \"2825\" +\n            \"2826\" +\n            \"2827\" +\n            \"2828\" +\n            \"2829\" +\n            \"2830\" +\n            \"2831\" +\n            \"2832\" +\n            \"2833\" +\n            \"2834\" +\n            \"2835\" +\n            \"2836\" +\n            \"2837\" +\n            \"2838\" +\n            \"2839\" +\n            \"2840\" +\n            \"2841\" +\n            \"2842\" +\n            \"2843\" +\n            \"2844\" +\n            \"2845\" +\n            \"2846\" +\n            \"2847\" +\n            \"2848\" +\n            \"2849\" +\n            \"2850\" +\n            \"2851\" +\n            \"2852\" +\n            \"2853\" +\n            \"2854\" +\n            \"2855\" +\n            \"2856\" +\n            \"2857\" +\n            \"2858\" +\n            \"2859\" +\n            \"2860\" +\n            \"2861\" +\n            \"2862\" +\n            \"2863\" +\n            \"2864\" +\n            \"2865\" +\n            \"2866\" +\n            \"2867\" +\n            \"2868\" +\n            \"2869\" +\n            \"2870\" +\n            \"2871\" +\n            \"2872\" +\n            \"2873\" +\n            \"2874\" +\n            \"2875\" +\n            \"2876\" +\n            \"2877\" +\n            \"2878\" +\n            \"2879\" +\n            \"2880\" +\n            \"2881\" +\n            \"2882\" +\n            \"2883\" +\n            \"2884\" +\n            \"2885\" +\n            \"2886\" +\n            \"2887\" +\n            \"2888\" +\n            \"2889\" +\n            \"2890\" +\n            \"2891\" +\n            \"2892\" +\n            \"2893\" +\n            \"2894\" +\n            \"2895\" +\n            \"2896\" +\n            \"2897\" +\n            \"2898\" +\n            \"2899\" +\n            \"2900\" +\n            \"2901\" +\n            \"2902\" +\n            \"2903\" +\n            \"2904\" +\n            \"2905\" +\n            \"2906\" +\n            \"2907\" +\n            \"2908\" +\n            \"2909\" +\n            \"2910\" +\n            \"2911\" +\n            \"2912\" +\n            \"2913\" +\n            \"2914\" +\n            \"2915\" +\n            \"2916\" +\n            \"2917\" +\n            \"2918\" +\n            \"2919\" +\n            \"2920\" +\n            \"2921\" +\n            \"2922\" +\n            \"2923\" +\n            \"2924\" +\n            \"2925\" +\n            \"2926\" +\n            \"2927\" +\n            \"2928\" +\n            \"2929\" +\n            \"2930\" +\n            \"2931\" +\n            \"2932\" +\n            \"2933\" +\n            \"2934\" +\n            \"2935\" +\n            \"2936\" +\n            \"2937\" +\n            \"2938\" +\n            \"2939\" +\n            \"2940\" +\n            \"2941\" +\n            \"2942\" +\n            \"2943\" +\n            \"2944\" +\n            \"2945\" +\n            \"2946\" +\n            \"2947\" +\n            \"2948\" +\n            \"2949\" +\n            \"2950\" +\n            \"2951\" +\n            \"2952\" +\n            \"2953\" +\n            \"2954\" +\n            \"2955\" +\n            \"2956\" +\n            \"2957\" +\n            \"2958\" +\n            \"2959\" +\n            \"2960\" +\n            \"2961\" +\n            \"2962\" +\n            \"2963\" +\n            \"2964\" +\n            \"2965\" +\n            \"2966\" +\n            \"2967\" +\n            \"2968\" +\n            \"2969\" +\n            \"2970\" +\n            \"2971\" +\n            \"2972\" +\n            \"2973\" +\n            \"2974\" +\n            \"2975\" +\n            \"2976\" +\n            \"2977\" +\n            \"2978\" +\n            \"2979\" +\n            \"2980\" +\n            \"2981\" +\n            \"2982\" +\n            \"2983\" +\n            \"2984\" +\n            \"2985\" +\n            \"2986\" +\n            \"2987\" +\n            \"2988\" +\n            \"2989\" +\n            \"2990\" +\n            \"2991\" +\n            \"2992\" +\n            \"2993\" +\n            \"2994\" +\n            \"2995\" +\n            \"2996\" +\n            \"2997\" +\n            \"2998\" +\n            \"2999\" +\n            \"3000\" +\n            \"3001\" +\n            \"3002\" +\n            \"3003\" +\n            \"3004\" +\n            \"3005\" +\n            \"3006\" +\n            \"3007\" +\n            \"3008\" +\n            \"3009\" +\n            \"3010\" +\n            \"3011\" +\n            \"3012\" +\n            \"3013\" +\n            \"3014\" +\n            \"3015\" +\n            \"3016\" +\n            \"3017\" +\n            \"3018\" +\n            \"3019\" +\n            \"3020\" +\n            \"3021\" +\n            \"3022\" +\n            \"3023\" +\n            \"3024\" +\n            \"3025\" +\n            \"3026\" +\n            \"3027\" +\n            \"3028\" +\n            \"3029\" +\n            \"3030\" +\n            \"3031\" +\n            \"3032\" +\n            \"3033\" +\n            \"3034\" +\n            \"3035\" +\n            \"3036\" +\n            \"3037\" +\n            \"3038\" +\n            \"3039\" +\n            \"3040\" +\n            \"3041\" +\n            \"3042\" +\n            \"3043\" +\n            \"3044\" +\n            \"3045\" +\n            \"3046\" +\n            \"3047\" +\n            \"3048\" +\n            \"3049\" +\n            \"3050\" +\n            \"3051\" +\n            \"3052\" +\n            \"3053\" +\n            \"3054\" +\n            \"3055\" +\n            \"3056\" +\n            \"3057\" +\n            \"3058\" +\n            \"3059\" +\n            \"3060\" +\n            \"3061\" +\n            \"3062\" +\n            \"3063\" +\n            \"3064\" +\n            \"3065\" +\n            \"3066\" +\n            \"3067\" +\n            \"3068\" +\n            \"3069\" +\n            \"3070\" +\n            \"3071\" +\n            \"3072\" +\n            \"3073\" +\n            \"3074\" +\n            \"3075\" +\n            \"3076\" +\n            \"3077\" +\n            \"3078\" +\n            \"3079\" +\n            \"3080\" +\n            \"3081\" +\n            \"3082\" +\n            \"3083\" +\n            \"3084\" +\n            \"3085\" +\n            \"3086\" +\n            \"3087\" +\n            \"3088\" +\n            \"3089\" +\n            \"3090\" +\n            \"3091\" +\n            \"3092\" +\n            \"3093\" +\n            \"3094\" +\n            \"3095\" +\n            \"3096\" +\n            \"3097\" +\n            \"3098\" +\n            \"3099\" +\n            \"3100\" +\n            \"3101\" +\n            \"3102\" +\n            \"3103\" +\n            \"3104\" +\n            \"3105\" +\n            \"3106\" +\n            \"3107\" +\n            \"3108\" +\n            \"3109\" +\n            \"3110\" +\n            \"3111\" +\n            \"3112\" +\n            \"3113\" +\n            \"3114\" +\n            \"3115\" +\n            \"3116\" +\n            \"3117\" +\n            \"3118\" +\n            \"3119\" +\n            \"3120\" +\n            \"3121\" +\n            \"3122\" +\n            \"3123\" +\n            \"3124\" +\n            \"3125\" +\n            \"3126\" +\n            \"3127\" +\n            \"3128\" +\n            \"3129\" +\n            \"3130\" +\n            \"3131\" +\n            \"3132\" +\n            \"3133\" +\n            \"3134\" +\n            \"3135\" +\n            \"3136\" +\n            \"3137\" +\n            \"3138\" +\n            \"3139\" +\n            \"3140\" +\n            \"3141\" +\n            \"3142\" +\n            \"3143\" +\n            \"3144\" +\n            \"3145\" +\n            \"3146\" +\n            \"3147\" +\n            \"3148\" +\n            \"3149\" +\n            \"3150\" +\n            \"3151\" +\n            \"3152\" +\n            \"3153\" +\n            \"3154\" +\n            \"3155\" +\n            \"3156\" +\n            \"3157\" +\n            \"3158\" +\n            \"3159\" +\n            \"3160\" +\n            \"3161\" +\n            \"3162\" +\n            \"3163\" +\n            \"3164\" +\n            \"3165\" +\n            \"3166\" +\n            \"3167\" +\n            \"3168\" +\n            \"3169\" +\n            \"3170\" +\n            \"3171\" +\n            \"3172\" +\n            \"3173\" +\n            \"3174\" +\n            \"3175\" +\n            \"3176\" +\n            \"3177\" +\n            \"3178\" +\n            \"3179\" +\n            \"3180\" +\n            \"3181\" +\n            \"3182\" +\n            \"3183\" +\n            \"3184\" +\n            \"3185\" +\n            \"3186\" +\n            \"3187\" +\n            \"3188\" +\n            \"3189\" +\n            \"3190\" +\n            \"3191\" +\n            \"3192\" +\n            \"3193\" +\n            \"3194\" +\n            \"3195\" +\n            \"3196\" +\n            \"3197\" +\n            \"3198\" +\n            \"3199\" +\n            \"3200\" +\n            \"3201\" +\n            \"3202\" +\n            \"3203\" +\n            \"3204\" +\n            \"3205\" +\n            \"3206\" +\n            \"3207\" +\n            \"3208\" +\n            \"3209\" +\n            \"3210\" +\n            \"3211\" +\n            \"3212\" +\n            \"3213\" +\n            \"3214\" +\n            \"3215\" +\n            \"3216\" +\n            \"3217\" +\n            \"3218\" +\n            \"3219\" +\n            \"3220\" +\n            \"3221\" +\n            \"3222\" +\n            \"3223\" +\n            \"3224\" +\n            \"3225\" +\n            \"3226\" +\n            \"3227\" +\n            \"3228\" +\n            \"3229\" +\n            \"3230\" +\n            \"3231\" +\n            \"3232\" +\n            \"3233\" +\n            \"3234\" +\n            \"3235\" +\n            \"3236\" +\n            \"3237\" +\n            \"3238\" +\n            \"3239\" +\n            \"3240\" +\n            \"3241\" +\n            \"3242\" +\n            \"3243\" +\n            \"3244\" +\n            \"3245\" +\n            \"3246\" +\n            \"3247\" +\n            \"3248\" +\n            \"3249\" +\n            \"3250\" +\n            \"3251\" +\n            \"3252\" +\n            \"3253\" +\n            \"3254\" +\n            \"3255\" +\n            \"3256\" +\n            \"3257\" +\n            \"3258\" +\n            \"3259\" +\n            \"3260\" +\n            \"3261\" +\n            \"3262\" +\n            \"3263\" +\n            \"3264\" +\n            \"3265\" +\n            \"3266\" +\n            \"3267\" +\n            \"3268\" +\n            \"3269\" +\n            \"3270\" +\n            \"3271\" +\n            \"3272\" +\n            \"3273\" +\n            \"3274\" +\n            \"3275\" +\n            \"3276\" +\n            \"3277\" +\n            \"3278\" +\n            \"3279\" +\n            \"3280\" +\n            \"3281\" +\n            \"3282\" +\n            \"3283\" +\n            \"3284\" +\n            \"3285\" +\n            \"3286\" +\n            \"3287\" +\n            \"3288\" +\n            \"3289\" +\n            \"3290\" +\n            \"3291\" +\n            \"3292\" +\n            \"3293\" +\n            \"3294\" +\n            \"3295\" +\n            \"3296\" +\n            \"3297\" +\n            \"3298\" +\n            \"3299\" +\n            \"3300\" +\n            \"3301\" +\n            \"3302\" +\n            \"3303\" +\n            \"3304\" +\n            \"3305\" +\n            \"3306\" +\n            \"3307\" +\n            \"3308\" +\n            \"3309\" +\n            \"3310\" +\n            \"3311\" +\n            \"3312\" +\n            \"3313\" +\n            \"3314\" +\n            \"3315\" +\n            \"3316\" +\n            \"3317\" +\n            \"3318\" +\n            \"3319\" +\n            \"3320\" +\n            \"3321\" +\n            \"3322\" +\n            \"3323\" +\n            \"3324\" +\n            \"3325\" +\n            \"3326\" +\n            \"3327\" +\n            \"3328\" +\n            \"3329\" +\n            \"3330\" +\n            \"3331\" +\n            \"3332\" +\n            \"3333\" +\n            \"3334\" +\n            \"3335\" +\n            \"3336\" +\n            \"3337\" +\n            \"3338\" +\n            \"3339\" +\n            \"3340\" +\n            \"3341\" +\n            \"3342\" +\n            \"3343\" +\n            \"3344\" +\n            \"3345\" +\n            \"3346\" +\n            \"3347\" +\n            \"3348\" +\n            \"3349\" +\n            \"3350\" +\n            \"3351\" +\n            \"3352\" +\n            \"3353\" +\n            \"3354\" +\n            \"3355\" +\n            \"3356\" +\n            \"3357\" +\n            \"3358\" +\n            \"3359\" +\n            \"3360\" +\n            \"3361\" +\n            \"3362\" +\n            \"3363\" +\n            \"3364\" +\n            \"3365\" +\n            \"3366\" +\n            \"3367\" +\n            \"3368\" +\n            \"3369\" +\n            \"3370\" +\n            \"3371\" +\n            \"3372\" +\n            \"3373\" +\n            \"3374\" +\n            \"3375\" +\n            \"3376\" +\n            \"3377\" +\n            \"3378\" +\n            \"3379\" +\n            \"3380\" +\n            \"3381\" +\n            \"3382\" +\n            \"3383\" +\n            \"3384\" +\n            \"3385\" +\n            \"3386\" +\n            \"3387\" +\n            \"3388\" +\n            \"3389\" +\n            \"3390\" +\n            \"3391\" +\n            \"3392\" +\n            \"3393\" +\n            \"3394\" +\n            \"3395\" +\n            \"3396\" +\n            \"3397\" +\n            \"3398\" +\n            \"3399\" +\n            \"3400\" +\n            \"3401\" +\n            \"3402\" +\n            \"3403\" +\n            \"3404\" +\n            \"3405\" +\n            \"3406\" +\n            \"3407\" +\n            \"3408\" +\n            \"3409\" +\n            \"3410\" +\n            \"3411\" +\n            \"3412\" +\n            \"3413\" +\n            \"3414\" +\n            \"3415\" +\n            \"3416\" +\n            \"3417\" +\n            \"3418\" +\n            \"3419\" +\n            \"3420\" +\n            \"3421\" +\n            \"3422\" +\n            \"3423\" +\n            \"3424\" +\n            \"3425\" +\n            \"3426\" +\n            \"3427\" +\n            \"3428\" +\n            \"3429\" +\n            \"3430\" +\n            \"3431\" +\n            \"3432\" +\n            \"3433\" +\n            \"3434\" +\n            \"3435\" +\n            \"3436\" +\n            \"3437\" +\n            \"3438\" +\n            \"3439\" +\n            \"3440\" +\n            \"3441\" +\n            \"3442\" +\n            \"3443\" +\n            \"3444\" +\n            \"3445\" +\n            \"3446\" +\n            \"3447\" +\n            \"3448\" +\n            \"3449\" +\n            \"3450\" +\n            \"3451\" +\n            \"3452\" +\n            \"3453\" +\n            \"3454\" +\n            \"3455\" +\n            \"3456\" +\n            \"3457\" +\n            \"3458\" +\n            \"3459\" +\n            \"3460\" +\n            \"3461\" +\n            \"3462\" +\n            \"3463\" +\n            \"3464\" +\n            \"3465\" +\n            \"3466\" +\n            \"3467\" +\n            \"3468\" +\n            \"3469\" +\n            \"3470\" +\n            \"3471\" +\n            \"3472\" +\n            \"3473\" +\n            \"3474\" +\n            \"3475\" +\n            \"3476\" +\n            \"3477\" +\n            \"3478\" +\n            \"3479\" +\n            \"3480\" +\n            \"3481\" +\n            \"3482\" +\n            \"3483\" +\n            \"3484\" +\n            \"3485\" +\n            \"3486\" +\n            \"3487\" +\n            \"3488\" +\n            \"3489\" +\n            \"3490\" +\n            \"3491\" +\n            \"3492\" +\n            \"3493\" +\n            \"3494\" +\n            \"3495\" +\n            \"3496\" +\n            \"3497\" +\n            \"3498\" +\n            \"3499\" +\n            \"3500\" +\n            \"3501\" +\n            \"3502\" +\n            \"3503\" +\n            \"3504\" +\n            \"3505\" +\n            \"3506\" +\n            \"3507\" +\n            \"3508\" +\n            \"3509\" +\n            \"3510\" +\n            \"3511\" +\n            \"3512\" +\n            \"3513\" +\n            \"3514\" +\n            \"3515\" +\n            \"3516\" +\n            \"3517\" +\n            \"3518\" +\n            \"3519\" +\n            \"3520\" +\n            \"3521\" +\n            \"3522\" +\n            \"3523\" +\n            \"3524\" +\n            \"3525\" +\n            \"3526\" +\n            \"3527\" +\n            \"3528\" +\n            \"3529\" +\n            \"3530\" +\n            \"3531\" +\n            \"3532\" +\n            \"3533\" +\n            \"3534\" +\n            \"3535\" +\n            \"3536\" +\n            \"3537\" +\n            \"3538\" +\n            \"3539\" +\n            \"3540\" +\n            \"3541\" +\n            \"3542\" +\n            \"3543\" +\n            \"3544\" +\n            \"3545\" +\n            \"3546\" +\n            \"3547\" +\n            \"3548\" +\n            \"3549\" +\n            \"3550\" +\n            \"3551\" +\n            \"3552\" +\n            \"3553\" +\n            \"3554\" +\n            \"3555\" +\n            \"3556\" +\n            \"3557\" +\n            \"3558\" +\n            \"3559\" +\n            \"3560\" +\n            \"3561\" +\n            \"3562\" +\n            \"3563\" +\n            \"3564\" +\n            \"3565\" +\n            \"3566\" +\n            \"3567\" +\n            \"3568\" +\n            \"3569\" +\n            \"3570\" +\n            \"3571\" +\n            \"3572\" +\n            \"3573\" +\n            \"3574\" +\n            \"3575\" +\n            \"3576\" +\n            \"3577\" +\n            \"3578\" +\n            \"3579\" +\n            \"3580\" +\n            \"3581\" +\n            \"3582\" +\n            \"3583\" +\n            \"3584\" +\n            \"3585\" +\n            \"3586\" +\n            \"3587\" +\n            \"3588\" +\n            \"3589\" +\n            \"3590\" +\n            \"3591\" +\n            \"3592\" +\n            \"3593\" +\n            \"3594\" +\n            \"3595\" +\n            \"3596\" +\n            \"3597\" +\n            \"3598\" +\n            \"3599\" +\n            \"3600\" +\n            \"3601\" +\n            \"3602\" +\n            \"3603\" +\n            \"3604\" +\n            \"3605\" +\n            \"3606\" +\n            \"3607\" +\n            \"3608\" +\n            \"3609\" +\n            \"3610\" +\n            \"3611\" +\n            \"3612\" +\n            \"3613\" +\n            \"3614\" +\n            \"3615\" +\n            \"3616\" +\n            \"3617\" +\n            \"3618\" +\n            \"3619\" +\n            \"3620\" +\n            \"3621\" +\n            \"3622\" +\n            \"3623\" +\n            \"3624\" +\n            \"3625\" +\n            \"3626\" +\n            \"3627\" +\n            \"3628\" +\n            \"3629\" +\n            \"3630\" +\n            \"3631\" +\n            \"3632\" +\n            \"3633\" +\n            \"3634\" +\n            \"3635\" +\n            \"3636\" +\n            \"3637\" +\n            \"3638\" +\n            \"3639\" +\n            \"3640\" +\n            \"3641\" +\n            \"3642\" +\n            \"3643\" +\n            \"3644\" +\n            \"3645\" +\n            \"3646\" +\n            \"3647\" +\n            \"3648\" +\n            \"3649\" +\n            \"3650\" +\n            \"3651\" +\n            \"3652\" +\n            \"3653\" +\n            \"3654\" +\n            \"3655\" +\n            \"3656\" +\n            \"3657\" +\n            \"3658\" +\n            \"3659\" +\n            \"3660\" +\n            \"3661\" +\n            \"3662\" +\n            \"3663\" +\n            \"3664\" +\n            \"3665\" +\n            \"3666\" +\n            \"3667\" +\n            \"3668\" +\n            \"3669\" +\n            \"3670\" +\n            \"3671\" +\n            \"3672\" +\n            \"3673\" +\n            \"3674\" +\n            \"3675\" +\n            \"3676\" +\n            \"3677\" +\n            \"3678\" +\n            \"3679\" +\n            \"3680\" +\n            \"3681\" +\n            \"3682\" +\n            \"3683\" +\n            \"3684\" +\n            \"3685\" +\n            \"3686\" +\n            \"3687\" +\n            \"3688\" +\n            \"3689\" +\n            \"3690\" +\n            \"3691\" +\n            \"3692\" +\n            \"3693\" +\n            \"3694\" +\n            \"3695\" +\n            \"3696\" +\n            \"3697\" +\n            \"3698\" +\n            \"3699\" +\n            \"3700\" +\n            \"3701\" +\n            \"3702\" +\n            \"3703\" +\n            \"3704\" +\n            \"3705\" +\n            \"3706\" +\n            \"3707\" +\n            \"3708\" +\n            \"3709\" +\n            \"3710\" +\n            \"3711\" +\n            \"3712\" +\n            \"3713\" +\n            \"3714\" +\n            \"3715\" +\n            \"3716\" +\n            \"3717\" +\n            \"3718\" +\n            \"3719\" +\n            \"3720\" +\n            \"3721\" +\n            \"3722\" +\n            \"3723\" +\n            \"3724\" +\n            \"3725\" +\n            \"3726\" +\n            \"3727\" +\n            \"3728\" +\n            \"3729\" +\n            \"3730\" +\n            \"3731\" +\n            \"3732\" +\n            \"3733\" +\n            \"3734\" +\n            \"3735\" +\n            \"3736\" +\n            \"3737\" +\n            \"3738\" +\n            \"3739\" +\n            \"3740\" +\n            \"3741\" +\n            \"3742\" +\n            \"3743\" +\n            \"3744\" +\n            \"3745\" +\n            \"3746\" +\n            \"3747\" +\n            \"3748\" +\n            \"3749\" +\n            \"3750\" +\n            \"3751\" +\n            \"3752\" +\n            \"3753\" +\n            \"3754\" +\n            \"3755\" +\n            \"3756\" +\n            \"3757\" +\n            \"3758\" +\n            \"3759\" +\n            \"3760\" +\n            \"3761\" +\n            \"3762\" +\n            \"3763\" +\n            \"3764\" +\n            \"3765\" +\n            \"3766\" +\n            \"3767\" +\n            \"3768\" +\n            \"3769\" +\n            \"3770\" +\n            \"3771\" +\n            \"3772\" +\n            \"3773\" +\n            \"3774\" +\n            \"3775\" +\n            \"3776\" +\n            \"3777\" +\n            \"3778\" +\n            \"3779\" +\n            \"3780\" +\n            \"3781\" +\n            \"3782\" +\n            \"3783\" +\n            \"3784\" +\n            \"3785\" +\n            \"3786\" +\n            \"3787\" +\n            \"3788\" +\n            \"3789\" +\n            \"3790\" +\n            \"3791\" +\n            \"3792\" +\n            \"3793\" +\n            \"3794\" +\n            \"3795\" +\n            \"3796\" +\n            \"3797\" +\n            \"3798\" +\n            \"3799\" +\n            \"3800\" +\n            \"3801\" +\n            \"3802\" +\n            \"3803\" +\n            \"3804\" +\n            \"3805\" +\n            \"3806\" +\n            \"3807\" +\n            \"3808\" +\n            \"3809\" +\n            \"3810\" +\n            \"3811\" +\n            \"3812\" +\n            \"3813\" +\n            \"3814\" +\n            \"3815\" +\n            \"3816\" +\n            \"3817\" +\n            \"3818\" +\n            \"3819\" +\n            \"3820\" +\n            \"3821\" +\n            \"3822\" +\n            \"3823\" +\n            \"3824\" +\n            \"3825\" +\n            \"3826\" +\n            \"3827\" +\n            \"3828\" +\n            \"3829\" +\n            \"3830\" +\n            \"3831\" +\n            \"3832\" +\n            \"3833\" +\n            \"3834\" +\n            \"3835\" +\n            \"3836\" +\n            \"3837\" +\n            \"3838\" +\n            \"3839\" +\n            \"3840\" +\n            \"3841\" +\n            \"3842\" +\n            \"3843\" +\n            \"3844\" +\n            \"3845\" +\n            \"3846\" +\n            \"3847\" +\n            \"3848\" +\n            \"3849\" +\n            \"3850\" +\n            \"3851\" +\n            \"3852\" +\n            \"3853\" +\n            \"3854\" +\n            \"3855\" +\n            \"3856\" +\n            \"3857\" +\n            \"3858\" +\n            \"3859\" +\n            \"3860\" +\n            \"3861\" +\n            \"3862\" +\n            \"3863\" +\n            \"3864\" +\n            \"3865\" +\n            \"3866\" +\n            \"3867\" +\n            \"3868\" +\n            \"3869\" +\n            \"3870\" +\n            \"3871\" +\n            \"3872\" +\n            \"3873\" +\n            \"3874\" +\n            \"3875\" +\n            \"3876\" +\n            \"3877\" +\n            \"3878\" +\n            \"3879\" +\n            \"3880\" +\n            \"3881\" +\n            \"3882\" +\n            \"3883\" +\n            \"3884\" +\n            \"3885\" +\n            \"3886\" +\n            \"3887\" +\n            \"3888\" +\n            \"3889\" +\n            \"3890\" +\n            \"3891\" +\n            \"3892\" +\n            \"3893\" +\n            \"3894\" +\n            \"3895\" +\n            \"3896\" +\n            \"3897\" +\n            \"3898\" +\n            \"3899\" +\n            \"3900\" +\n            \"3901\" +\n            \"3902\" +\n            \"3903\" +\n            \"3904\" +\n            \"3905\" +\n            \"3906\" +\n            \"3907\" +\n            \"3908\" +\n            \"3909\" +\n            \"3910\" +\n            \"3911\" +\n            \"3912\" +\n            \"3913\" +\n            \"3914\" +\n            \"3915\" +\n            \"3916\" +\n            \"3917\" +\n            \"3918\" +\n            \"3919\" +\n            \"3920\" +\n            \"3921\" +\n            \"3922\" +\n            \"3923\" +\n            \"3924\" +\n            \"3925\" +\n            \"3926\" +\n            \"3927\" +\n            \"3928\" +\n            \"3929\" +\n            \"3930\" +\n            \"3931\" +\n            \"3932\" +\n            \"3933\" +\n            \"3934\" +\n            \"3935\" +\n            \"3936\" +\n            \"3937\" +\n            \"3938\" +\n            \"3939\" +\n            \"3940\" +\n            \"3941\" +\n            \"3942\" +\n            \"3943\" +\n            \"3944\" +\n            \"3945\" +\n            \"3946\" +\n            \"3947\" +\n            \"3948\" +\n            \"3949\" +\n            \"3950\" +\n            \"3951\" +\n            \"3952\" +\n            \"3953\" +\n            \"3954\" +\n            \"3955\" +\n            \"3956\" +\n            \"3957\" +\n            \"3958\" +\n            \"3959\" +\n            \"3960\" +\n            \"3961\" +\n            \"3962\" +\n            \"3963\" +\n            \"3964\" +\n            \"3965\" +\n            \"3966\" +\n            \"3967\" +\n            \"3968\" +\n            \"3969\" +\n            \"3970\" +\n            \"3971\" +\n            \"3972\" +\n            \"3973\" +\n            \"3974\" +\n            \"3975\" +\n            \"3976\" +\n            \"3977\" +\n            \"3978\" +\n            \"3979\" +\n            \"3980\" +\n            \"3981\" +\n            \"3982\" +\n            \"3983\" +\n            \"3984\" +\n            \"3985\" +\n            \"3986\" +\n            \"3987\" +\n            \"3988\" +\n            \"3989\" +\n            \"3990\" +\n            \"3991\" +\n            \"3992\" +\n            \"3993\" +\n            \"3994\" +\n            \"3995\" +\n            \"3996\" +\n            \"3997\" +\n            \"3998\" +\n            \"3999\" +\n            \"4000\"\n        End Sub\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TabCharacter.cs",
    "content": "﻿using System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public class TabCharacter\n    {\n        public TabCharacter()\n        {\n            var tabs = \"\t\"; // Noncompliant\n            var tabs2 = \"\t\t\";\n            // some more tabs: \"\t\t\"\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TabCharacter.vb",
    "content": "﻿Imports System.Collections.Generic\n\nNamespace Tests.Diagnostics\n    Public Class TabCharacter\n\n        Public Sub New()\n            Dim tabs = \"\t\" ' Noncompliant {{Replace all tab characters in this file by sequences of white-spaces.}}\n            Dim tabs2 = \"\t\t\"\n            ' some more tabs: \"\t\t\"\n        End Sub\n    End Class\nEnd Namespace\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TaskConfigureAwait.NetCore.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Threading.Tasks;\n\nnamespace Tests.Diagnostics\n{\n    public class TaskConfigureAwait\n    {\n        public async void Test()\n        {\n            // This rule is not relevant for .NET Core\n            // See https://github.com/SonarSource/sonar-dotnet/issues/2588\n\n            await Task.Delay(1000); // Compliant, there's no SynchronizationContext in .NET Core\n            await Task.Delay(1000).ConfigureAwait(false);\n            await Task.Delay(1000).ConfigureAwait(true);\n\n            var t = Task.Delay(1000);\n\n            await GetNumber(); // Compliant, there's no SynchronizationContext in .NET Core\n            await GetNumber().ConfigureAwait(false);\n            await GetNumber().ConfigureAwait(true);\n\n            var t2 = GetNumber();\n        }\n\n        private Task<int> GetNumber()\n        {\n            return Task.FromResult(5);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TaskConfigureAwait.NetFx.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Threading.Tasks;\n\nnamespace Tests.Diagnostics\n{\n    public class TaskConfigureAwait\n    {\n        public async void Test()\n        {\n            await Task.Delay(1000); // Noncompliant {{Add '.ConfigureAwait(false)' to this call to allow execution to continue in any thread.}}\n//                ^^^^^^^^^^^^^^^^\n            await Task.Delay(1000).ConfigureAwait(false); // Compliant\n            await Task.Delay(1000).ConfigureAwait(true); // Compliant, we assume that there is a reason to explicitly specify context switching\n\n            var t = Task.Delay(1000);\n\n            await GetNumber(); // Noncompliant {{Add '.ConfigureAwait(false)' to this call to allow execution to continue in any thread.}}\n//                ^^^^^^^^^^^\n\n            await GetNumber().ConfigureAwait(false); // Compliant\n            await GetNumber().ConfigureAwait(true); // Compliant\n\n            var t2 = GetNumber();\n        }\n\n        private Task<int> GetNumber()\n        {\n            return Task.FromResult(5);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TestClassShouldHaveTestMethod.Latest.cs",
    "content": "﻿namespace MicrosoftTests\n{\n    using Microsoft.VisualStudio.TestTools.UnitTesting;\n\n    [TestClass]\n    class TestSuite // Noncompliant {{Add some tests to this class.}}\n    {\n        public void Method()\n        {\n            [TestMethod]\n            void NestedTest()\n            { }\n\n            [DataTestMethod]\n            void NestedDataTest()\n            { }\n        }\n    }\n\n    [TestClass]\n    record TestSuiteRecord1 // Noncompliant {{Add some tests to this record.}}\n    {\n        public void Method()\n        {\n        }\n    }\n\n    [TestClass]\n    record TestSuiteRecord2\n    {\n        [TestMethod]\n        public void Method()\n        {\n        }\n    }\n\n    [TestClass]\n    record PositionalRecord(string SomeProperty)\n    {\n        [TestMethod]\n        public void Method()\n        {\n        }\n    }\n\n    [DerivedTest<int>]\n    class DerivedTestSuite // Noncompliant {{Add some tests to this class.}}\n    {\n        public void Method()\n        {\n        }\n    }\n\n    public class DerivedTestAttribute<T> : TestClassAttribute\n    {\n    }\n\n    [TestClass]\n    class ClassTest1(int primaryConstructor) // Noncompliant\n    //    ^^^^^^^^^^\n    {\n    }\n}\n\nnamespace NUnitTests\n{\n    using NUnit.Framework;\n\n    [TestFixture]\n    class TestSuite // Noncompliant {{Add some tests to this class.}}\n    {\n        public void Method()\n        {\n            [Test]\n            void NestedTest()\n            { }\n\n            [TestCase(42)]\n            void NestedTestCase()\n            { }\n        }\n    }\n\n    [TestFixture]\n    class ClassTest2(int primaryConstructor) // Noncompliant\n    //    ^^^^^^^^^^\n    {\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TestClassShouldHaveTestMethod.MsTest.cs",
    "content": "﻿using System;\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\n\nnamespace Tests.Diagnostics\n{\n    [TestClass]\n    class ClassTest2 // Noncompliant\n//        ^^^^^^^^^^\n    {\n    }\n\n    [TestClass]\n    class ClassTest4 // Noncompliant\n    {\n        public void Foo() { }\n    }\n\n    class ClassTest5\n    {\n        public void Foo() { }\n    }\n\n    class ClassTest6\n    {\n        public void Foo() { }\n    }\n\n    [TestClass]\n    class ClassTest9\n    {\n        [TestMethod]\n        public void Foo() { }\n    }\n\n    [TestClass]\n    class ClassTest12\n    {\n        [DataTestMethod]\n        [DataRow(1)]\n        public void Foo(int i) { }\n    }\n\n    [TestClass]\n    public abstract class MyCommonCode1\n    {\n        [TestInitialize]\n        public void BeforeTests(TestContext context)\n        {\n        }\n\n        [TestCleanup]\n        public void AfterTests()\n        {\n        }\n    }\n\n    [TestClass]\n    public class MySubCommonCode1 : MyCommonCode1 // Noncompliant\n    {\n    }\n\n    public class MySubCommonCode11 : MyCommonCode1 // Compliant\n    {\n    }\n\n    [TestClass]\n    public abstract class TestFooBase\n    {\n        [TestMethod]\n        public void Foo_WhenFoo_ExpectsFoo() { }\n    }\n\n    // See https://github.com/SonarSource/sonar-dotnet/issues/1196\n    [TestClass]\n    public class TestSubFoo : TestFooBase // Compliant - base abstract and at least 1 test in base\n    {\n\n    }\n\n    [TestClass]\n    class // Error [CS1001]\n    {\n    }\n}\n\nnamespace TestSetupAndCleanupAttributes\n{\n    using Microsoft.VisualStudio.TestTools.UnitTesting;\n\n    // Regression tests for Bug 1486: https://github.com/SonarSource/sonar-dotnet/issues/1486\n    // Don't raise for classes that test setup or cleanup attributes\n\n    [TestClass]\n    public class SetupAttributes1\n    {\n        [AssemblyInitialize]\n        public static void BeforeTests(TestContext context)\n        {\n        }\n    }\n\n    [TestClass]\n    public static class SetupAttributes2\n    {\n        [AssemblyCleanup]\n        public static void AfterTests()\n        {\n        }\n    }\n\n\n    [TestClass]\n    public static class SetupAttributes3\n    {\n        [AssemblyInitialize]\n        public static void BeforeTests(TestContext context)\n        {\n        }\n\n        [AssemblyCleanup]\n        public static void AfterTests()\n        {\n        }\n    }\n\n    [TestClass]\n    public class SetupAttributes4 // Noncompliant\n    {\n        [TestInitialize]\n        public void BeforeTests(TestContext context)\n        {\n        }\n    }\n\n    [TestClass]\n    public class SetupAttributes5 // Noncompliant\n    {\n        [TestCleanup]\n        public void AfterTests()\n        {\n        }\n    }\n\n\n    [TestClass]\n    public class SetupAttributes6 // Noncompliant\n    {\n        [TestInitialize]\n        public void BeforeTests(TestContext context)\n        {\n        }\n\n        [TestCleanup]\n        public void AfterTests()\n        {\n        }\n    }\n\n    [TestClass]\n    public class SetupAttributes7 // Noncompliant\n    {\n        [ClassInitializeAttribute]\n        public void BeforeTests(TestContext context)\n        {\n        }\n    }\n\n    [TestClass]\n    public class SetupAttributes8 // Noncompliant\n    {\n        [ClassCleanupAttribute]\n        public void AfterTests()\n        {\n        }\n    }\n\n\n    [TestClass]\n    public class SetupAttributes9 // Noncompliant\n    {\n        [ClassInitializeAttribute]\n        public void BeforeTests(TestContext context)\n        {\n        }\n\n        [ClassCleanupAttribute]\n        public void AfterTests()\n        {\n        }\n    }\n\n    public class NoTestClassAttribute\n    {\n        [TestInitialize]\n        public void BeforeTests(TestContext context)\n        {\n        }\n\n        [TestCleanup]\n        public void AfterTests()\n        {\n        }\n    }\n}\n\nnamespace DerivedAttributes\n{\n\n    public class DerivedTestClassAttribute: TestClassAttribute\n    {\n\n    }\n\n    public class DerivedTestMethodAttribute: TestMethodAttribute\n    {\n\n    }\n\n    public class DerivedDataTestMethodAttribute : DataTestMethodAttribute\n    {\n\n    }\n\n    [DerivedTestClass]\n    class DerivedClassAttribute // Noncompliant\n//        ^^^^^^^^^^^^^^^^^^^^^\n    {\n    }\n\n    [DerivedTestClassAttribute]\n    class DerivedMethodAttribute1\n    {\n        [DerivedTestMethod]\n        public void Foo() { }\n    }\n\n    [DerivedTestClass]\n    class DerivedMethodAttribute2\n    {\n        [DerivedTestMethod]\n        [DataRow(1)]\n        public void Foo() { }\n    }\n}\n\nnamespace Inheritance\n{\n    [TestClass]\n    public abstract class A\n    {\n        [TestMethod]\n        public void Test()\n        {\n        }\n    }\n\n    [TestClass]\n    public abstract class B : A\n    {\n    }\n\n    [TestClass]\n    public class C : B // See: https://github.com/SonarSource/sonar-dotnet/issues/5507\n    {\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TestClassShouldHaveTestMethod.NUnit.cs",
    "content": "﻿using System;\nusing NUnit.Framework;\n\nnamespace Tests.Diagnostics\n{\n    [TestFixture]\n    class ClassTest1 // Noncompliant\n//        ^^^^^^^^^^\n    {\n    }\n\n    [TestFixture]\n    class ClassTest3 // Noncompliant\n    {\n        public void Foo() { }\n    }\n\n    class ClassTest5\n    {\n        public void Foo() { }\n    }\n\n    class ClassTest6\n    {\n        public void Foo() { }\n    }\n\n    [TestFixture]\n    class ClassTest7\n    {\n        [Test]\n        public void Foo() { }\n    }\n\n    [TestFixture]\n    class ClassTest8\n    {\n        [TestCase(\"\")]\n        [TestCase(\"test\")]\n        public void Foo(string a) { }\n    }\n\n    [TestFixture]\n    class ClassTest10\n    {\n        [Theory]\n        public void Foo() { }\n    }\n\n    [TestFixture]\n    public abstract class MyCommonCode2\n    {\n    }\n\n    [TestFixture]\n    public class MySubCommonCode2 : MyCommonCode2 // Noncompliant\n    {\n    }\n\n    public class MySubCommonCode22 : MyCommonCode2 // Compliant\n    {\n    }\n\n    [TestFixture]\n    public class ClassTest11\n    {\n        [TestCaseSource(\"DivideCases\")]\n        public void DivideTest(int n, int d, int q)\n        {\n            Assert.AreEqual(q, n / d);\n        }\n\n        static object[] DivideCases =\n        {\n            new object[] { 12, 3, 4 },\n            new object[] { 12, 2, 6 },\n            new object[] { 12, 4, 3 }\n        };\n    }\n\n    [TestFixture]\n    public abstract class TestFooBase\n    {\n        [Test]\n        public void Foo_WhenFoo_ExpectsFoo() { }\n    }\n\n    // See https://github.com/SonarSource/sonar-dotnet/issues/1196\n    [TestFixture]\n    public class TestSubFoo : TestFooBase // Compliant - base abstract and at least 1 test in base\n    {\n\n    }\n}\n\nnamespace DerivedAttributes\n{\n\n    public class DerivedTestFixtureAttribute : TestFixtureAttribute\n    {\n\n    }\n\n    public class DerivedTestCaseAttribute : TestCaseAttribute\n    {\n\n    }\n\n    public class DerivedTheoryAttribute : TheoryAttribute\n    {\n\n    }\n\n    [DerivedTestFixtureAttribute]\n    class DerivedClassAttribute // Noncompliant\n//        ^^^^^^^^^^^^^^^^^^^^^\n    {\n    }\n\n    [DerivedTestFixtureAttribute]\n    class DerivedMethodAttribute1\n    {\n        [DerivedTestCaseAttribute]\n        public void Foo() { }\n    }\n\n    [DerivedTestFixtureAttribute]\n    class DerivedMethodAttribute2\n    {\n        [DerivedTheoryAttribute]\n        public void Foo() { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TestClassShouldHaveTestMethod.NUnit3.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing NUnit.Framework.Interfaces;\nusing NUnit.Framework.Internal;\n\nnamespace ImplementsTestBuilder\n{\n    public class CustomTestAttribute : Attribute, ITestBuilder\n    {\n        public IEnumerable<TestMethod> BuildFrom(IMethodInfo method, Test suite) => throw new NotImplementedException();\n    }\n\n    public class DerivedCustomTestAttribute : CustomTestAttribute { }\n\n    public interface IWrongInterface { }\n\n    public class FakeAttribute : Attribute, IWrongInterface { }\n\n    [TestFixture]\n    public class Fixture\n    {\n        [CustomTest]\n        public void Foo() { }\n    }\n\n    [TestFixture]\n    public class Fixture2\n    {\n        [DerivedCustomTest]\n        public void Bar() { }\n    }\n\n    [TestFixture]\n    public class Fixture3 // Noncompliant\n//               ^^^^^^^^\n    {\n        [FakeAttribute]\n        public void Baz() { }\n    }\n\n    [TestFixture]\n    public class A // Noncompliant, FP - In NUnit this scenario is valid. See: https://github.com/SonarSource/sonar-dotnet/issues/5732\n    {\n        public class Nested : A\n        {\n            [Test]\n            public void Test()\n            {\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TestClassShouldHaveTestMethod.NUnit4.cs",
    "content": "﻿using System;\nusing NUnit.Framework;\nusing NUnit.Framework.Legacy;\n\nnamespace Tests.Diagnostics\n{\n    [TestFixture]\n    class ClassTest1 // Noncompliant\n//        ^^^^^^^^^^\n    {\n    }\n\n    [TestFixture]\n    public class ClassTest11\n    {\n        [TestCaseSource(\"DivideCases\")]\n        public void DivideTest(int n, int d, int q)\n        {\n            ClassicAssert.AreEqual(q, n / d);\n        }\n\n        static object[] DivideCases =\n        {\n            new object[] { 12, 3, 4 }\n        };\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TestMethodShouldContainAssertion.Custom.Common.cs",
    "content": "﻿using System;\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\n\nnamespace CustomTests\n{\n    using TestFramework;\n    using TestFramework.Attributes;\n\n    [TestClass]\n    public class BaseTest\n    {\n        [AssertionMethod]\n        protected virtual void CustomAssertionMethod() { }\n\n        [TestMethod]\n        public void TestMethod1() // Noncompliant {{Add at least one assertion to this test case.}}\n        //          ^^^^^^^^^^^\n        {\n            var x = 42;\n        }\n\n        [TestMethod]\n        public void TestMethod2() // Compliant\n        {\n            Validator.StaticWithAttribute();\n        }\n\n        [TestMethod]\n        public void TestMethod3() // Noncompliant\n        {\n            Validator.StaticWrongAttribute();\n        }\n\n        [TestMethod]\n        public void TestMethod4() // Noncompliant\n        {\n            Validator.StaticNoAttribute();\n        }\n\n        [TestMethod]\n        public void TestMethod5() // Compliant\n        {\n            var validator = new Validator();\n            validator.InstanceWithAttribute();\n        }\n\n        [TestMethod]\n        public void TestMethod6() => // Compliant\n            new Validator().InstanceWithAttributeAndArg(null);\n\n        [TestMethod]\n        public void TestMethod7() => // Noncompliant, attribute must be on the method itself\n            AttributedType.AttributeOnType();\n    }\n\n    [TestClass]\n    public class DerivedTest : BaseTest\n    {\n        [TestMethod]\n        public void Derived() // Compliant\n        {\n            CustomAssertionMethod();\n        }\n\n        protected override void CustomAssertionMethod()\n        {\n        }\n    }\n}\n\nnamespace TestFramework\n{\n    using TestFramework.Attributes;\n\n    public class Validator\n    {\n        [AssertionMethodAttribute]\n        public static void StaticWithAttribute() { }\n\n        [NotAssertionMethodAttribute]\n        public static void StaticWrongAttribute() { }\n\n        public static void StaticNoAttribute() { }\n\n        [AssertionMethod]\n        public bool InstanceWithAttribute() => true;\n\n        [AssertionMethod]\n        public bool InstanceWithAttributeAndArg(object arg) => true;\n    }\n\n    [AssertionMethod] // Missused attribute\n    public static class AttributedType\n    {\n        public static void AttributeOnType() { } // Not an assertion method\n    }\n}\n\nnamespace TestFramework.Attributes\n{\n    public class AssertionMethodAttribute : Attribute { }\n    public class NotAssertionMethodAttribute : Attribute { } // AssertionMethodAttribute doesn't count as an assertion method attribute\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TestMethodShouldContainAssertion.Custom.V3.cs",
    "content": "﻿using System;\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\n\nnamespace CustomTests\n{\n    using TestFramework.Attributes;\n\n    [TestClass]\n    public class BaseTest\n    {\n        [TestMethod]\n        [DerivedExpectedException]\n        public void TestMethod8() // Compliant\n        {\n            var x = 42;\n        }\n    }\n}\n\nnamespace TestFramework.Attributes\n{\n    public class DerivedExpectedExceptionAttribute : ExpectedExceptionBaseAttribute { protected override void Verify(Exception exception) { } }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TestMethodShouldContainAssertion.Latest.cs",
    "content": "﻿namespace MicrosoftTests\n{\n    using Microsoft.VisualStudio.TestTools.UnitTesting;\n\n    [TestClass]\n    class TestSuite\n    {\n        public void Method()\n        {\n            [TestMethod]\n            void NestedTest()\n            { } // Compliant - test methods must be public, this code does not work\n\n            [DataTestMethod]\n            void NestedDataTest()\n            { } // Compliant - test methods must be public, this code does not work\n        }\n    }\n\n    [TestClass]\n    public partial class WithPartialMethods\n    {\n        [TestMethod]\n        public partial void ThisHasNoAssert();\n\n        [TestMethod]\n        public partial void ThisInvokesSomethingWithAssert();\n    }\n\n    public partial class WithPartialMethods\n    {\n        public partial void ThisHasNoAssert()   // Noncompliant\n        {\n            DoNothing();\n        }\n\n        private void DoNothing() { }\n\n        public partial void ThisInvokesSomethingWithAssert()\n        {\n            DoTheWork();\n        }\n\n        private void DoTheWork() =>\n            Assert.AreEqual(true, true);\n    }\n\n    [TestClass]\n    class DerivedTestSuite\n    {\n        [DerivedTestMethodAttribute<int>]\n        public void TestMethod1() // Noncompliant {{Add at least one assertion to this test case.}}\n//                  ^^^^^^^^^^^\n        {\n            var x = 42;\n        }\n    }\n\n    public class DerivedTestMethodAttribute<T> : TestMethodAttribute\n    {\n    }\n}\n\nnamespace NUnitTests\n{\n    using NUnit.Framework;\n\n    [TestFixture]\n    class TestSuite\n    {\n        public void Method()\n        {\n            [Test]\n            void NestedTest() { } // Compliant - test methods must be public, this code does not work\n\n            [TestCase(42)]\n            void NestedTestCase() { } // Compliant - test methods must be public, this code does not work\n        }\n    }\n}\n\nnamespace XUnitTests\n{\n    using Xunit;\n\n    class TestSuite\n    {\n        public void Method()\n        {\n            [Fact]\n            void NestedFact() { } // Noncompliant {{Add at least one assertion to this test case.}}\n\n            [Fact]\n            void NestedFactWithAssert() => Assert.True(true);\n\n            [Theory]\n            void NestedTheory() { } // Noncompliant\n\n            [Theory]\n            void NestedTheoryWithAssert()\n            {\n                Assert.True(true);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TestMethodShouldContainAssertion.Moq.cs",
    "content": "﻿namespace TestMoq\n{\n    using Microsoft.VisualStudio.TestTools.UnitTesting;\n    using Moq;\n\n    public delegate void CalculatorEvent(int i, bool b);\n    internal interface ICalculator\n    {\n        int Property { get; set; }\n        event CalculatorEvent Event;\n        int Add(int a, int b);\n    }\n\n    [TestClass]\n    public class MoqVerifyTests\n    {\n        [TestMethod]\n        public void MoqVerify()\n        {\n            var mock = new Mock<ICalculator>();\n\n            mock.Verify(x => x.Add(It.IsAny<int>(), It.IsAny<int>()), Times.Never());\n        }\n\n        [TestMethod]\n        public void MoqVerifyAdd()\n        {\n            var mock = new Mock<ICalculator>();\n\n            mock.VerifyAdd(x => x.Event += It.IsAny<CalculatorEvent>());\n        }\n\n        [TestMethod]\n        public void MoqVerifyRemove()\n        {\n            var mock = new Mock<ICalculator>();\n\n            mock.VerifyRemove(x => x.Event -= It.IsAny<CalculatorEvent>(), Times.AtMostOnce());\n        }\n\n        [TestMethod]\n        public void MoqVerifySet()\n        {\n            var mock = new Mock<ICalculator>();\n\n            mock.VerifySet(x => x.Property = It.IsAny<int>());\n        }\n\n        [TestMethod]\n        public void MoqVerifyGet()\n        {\n            var mock = new Mock<ICalculator>();\n\n            mock.VerifyGet(x => x.Property);\n        }\n\n        [TestMethod]\n        public void MoqVerifyNoOtherCalls()\n        {\n            var mock = new Mock<ICalculator>();\n\n            mock.VerifyNoOtherCalls();\n        }\n\n        [TestMethod]\n        public void MoqVerifyAll()\n        {\n            var mock = new Mock<ICalculator>();\n\n            mock.VerifyAll();\n        }\n\n        [TestMethod]\n        public void MoqNoVerify() // Noncompliant\n        {\n            var mock = new Mock<ICalculator>();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TestMethodShouldContainAssertion.MsTest.AnotherFile.cs",
    "content": "﻿namespace TestMsTest\n{\n    using Microsoft.VisualStudio.TestTools.UnitTesting;\n\n    public class HelperFromAnotherSyntaxTree\n    {\n        public static void DoNothing() { }\n\n        public static void Is42Nested(int i) =>\n            Is42(i);\n\n        public static void Is42(int i) =>\n            Assert.AreEqual(42, i);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TestMethodShouldContainAssertion.MsTest.Common.cs",
    "content": "﻿namespace TestMsTest\n{\n    using System;\n    using System.Text;\n    using FluentAssertions;\n    using NFluent;\n    using NSubstitute;\n    using Microsoft.VisualStudio.TestTools.UnitTesting;\n    using Shouldly;\n\n    using static Microsoft.VisualStudio.TestTools.UnitTesting.Assert;\n\n    [TestClass]\n    public class Program\n    {\n        [TestMethod]\n        public void TestMethod1() // Noncompliant {{Add at least one assertion to this test case.}}\n//                  ^^^^^^^^^^^\n        {\n            var x = 42;\n        }\n\n        [TestMethod]\n        public void TestMethod2()\n        {\n            var x = 42;\n            Assert.AreEqual(x, 42);\n        }\n\n        [TestMethod]\n        public void TestMethod3()\n        {\n            var x = 42;\n            Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(x, 42);\n        }\n\n        [TestMethod]\n        public void TestMethod5()\n        {\n            var x = 42;\n            x.Should().Be(42);\n        }\n\n        [TestMethod]\n        public void TestMethod8() => AssertSomething();\n\n        [TestMethod]\n        public void TestMethod9()\n        {\n            ShouldSomething();\n        }\n\n        [TestMethod]\n        public void TestMethod10()\n        {\n            ExpectSomething();\n        }\n\n        [TestMethod]\n        public void TestMethod11()\n        {\n            MustSomething();\n        }\n\n        [TestMethod]\n        public void TestMethod12()\n        {\n            VerifySomething();\n        }\n\n        [TestMethod]\n        public void TestMethod13()\n        {\n            ValidateSomething();\n        }\n\n        [TestMethod]\n        public void TestMethod14()\n        {\n            dynamic d = 10;\n            Assert.AreEqual(d, 10.0);\n        }\n\n        [TestMethod]\n        public void TestMethod15()\n        {\n            var x = 42;\n            AreEqual(x, 42);\n        }\n\n        [TestMethod]\n        public void TestMethod16()\n        {\n            throw new Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException(\"You failed me!\");\n        }\n\n        [TestMethod]\n        public void TestMethod17()\n        {\n            var exception = new Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException(\"You failed me!\");\n            throw exception;\n        }\n\n        [TestMethod]\n        public void TestMethod18() // Noncompliant\n        {\n            throw new Exception(\"You failed me!\");\n        }\n\n        [TestMethod]\n        public void TestMethod18_UndefinedException() // Noncompliant\n        {\n            throw new UndefinedTypeException(\"You failed me!\"); // Error [CS0246]\n        }\n\n        [TestMethod]\n        [Ignore]\n        public void TestMethod19() // Don't raise on skipped test methods\n        {\n        }\n\n        [TestMethod]\n        public void TestMethod20() // Noncompliant\n        {\n            var x = 42;\n            try\n            {\n\n            }\n            catch (Exception)\n            {\n                throw;\n            }\n        }\n\n        [TestMethod]\n        public void TestMethod21()\n        {\n            Check.ThatCode(() => 42).WhichResult().IsStrictlyPositive();\n        }\n\n        [TestMethod]\n        public void TestMethod22()\n        {\n            throw new NFluent.Kernel.FluentCheckException(\"You failed me!\");\n        }\n\n        [TestMethod]\n        public void ArrowMethod1() => DoNothing(); // Noncompliant\n//                  ^^^^^^^^^^^^\n\n        [TestMethod]\n        public void ArrowMethod2() => AssertSomething();\n\n        public void DoNothing() { }\n\n        public void AssertSomething()\n        {\n            Assert.IsTrue(true);\n        }\n\n        public void ShouldSomething()\n        {\n            Assert.IsTrue(true);\n        }\n\n        public void ExpectSomething()\n        {\n            Assert.IsTrue(true);\n        }\n\n        public void MustSomething()\n        {\n            Assert.IsTrue(true);\n        }\n\n        public void VerifySomething()\n        {\n            Assert.IsTrue(true);\n        }\n\n        public void ValidateSomething()\n        {\n            Assert.IsTrue(true);\n        }\n\n        [DerivedTestMethod]\n        public void DerivedTestMethod1() // Noncompliant {{Add at least one assertion to this test case.}}\n//                  ^^^^^^^^^^^^^^^^^^\n        {\n            var x = 42;\n        }\n\n        [DerivedTestMethod]\n        public void DerivedTestMethod2()\n        {\n            var x = 42;\n            Assert.AreEqual(x, 42);\n        }\n    }\n\n    [TestClass]\n    public class Program_DataTestMethod\n    {\n        [DataTestMethod]\n        public void TestMethod1() // Noncompliant {{Add at least one assertion to this test case.}}\n//                  ^^^^^^^^^^^\n        {\n            var x = 42;\n        }\n\n        [DataTestMethod]\n        public void TestMethod2()\n        {\n            var x = 42;\n            Assert.AreEqual(x, 42);\n        }\n\n        [DataTestMethod]\n        public void TestMethod3()\n        {\n            var x = 42;\n            Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(x, 42);\n        }\n\n        [DataTestMethod]\n        public void TestMethod5()\n        {\n            var x = 42;\n            x.Should().Be(42);\n        }\n\n        [DataTestMethod]\n        public void TestMethod8()\n        {\n            AssertSomething();\n        }\n\n        [DataTestMethod]\n        public void TestMethod9()\n        {\n            ShouldSomething();\n        }\n\n        [DataTestMethod]\n        public void TestMethod10()\n        {\n            ExpectSomething();\n        }\n\n        [DataTestMethod]\n        public void TestMethod11()\n        {\n            MustSomething();\n        }\n\n        [DataTestMethod]\n        public void TestMethod12()\n        {\n            VerifySomething();\n        }\n\n        [DataTestMethod]\n        public void TestMethod13()\n        {\n            ValidateSomething();\n        }\n\n        [DataTestMethod]\n        public void TestMethod14()\n        {\n            dynamic d = 10;\n            Assert.AreEqual(d, 10.0);\n        }\n\n        [DataTestMethod]\n        [Ignore]\n        public void TestMethod15() // Don't raise on skipped test methods\n        {\n        }\n\n        public void AssertSomething()\n        {\n            Assert.IsTrue(true);\n        }\n\n        public void ShouldSomething()\n        {\n            Assert.IsTrue(true);\n        }\n\n        public void ExpectSomething()\n        {\n            Assert.IsTrue(true);\n        }\n\n        public void MustSomething()\n        {\n            Assert.IsTrue(true);\n        }\n\n        public void VerifySomething()\n        {\n            Assert.IsTrue(true);\n        }\n\n        public void ValidateSomething()\n        {\n            Assert.IsTrue(true);\n        }\n    }\n\n    public class Class1\n    {\n        public int Add(int a, int b) => a + b;\n    }\n\n    [TestClass]\n    public class UnitTest1\n    {\n        [TestMethod]\n        public void TestMethod1() // Noncompliant\n        {\n            var result = new Class1().Add(1, 2);\n        }\n    }\n\n    /// <summary>\n    /// The NSubstitute and Shoudly assertions are extensively verified in the NUnit test files.\n    /// Here we just do a simple test to confirm that the errors are not raised in conjunction with MsTest.\n    /// </summary>\n    [TestClass]\n    public class NSubstituteAndShouldlyTests\n    {\n        [TestMethod]\n        public void Received() => Substitute.For<IDisposable>().Received().Dispose();\n\n        [TestMethod]\n        public void Shouldly()\n        {\n            int[] array = { 1, 2, 3 };\n            array.ShouldAllBe(x => x > 0);\n        }\n    }\n\n    [TestClass]\n    public class WithHelperMethods\n    {\n        [TestMethod]\n        public void TestMethod1()\n        {\n            DoTheWork(\"42\", 42);\n        }\n\n        [TestMethod]\n        public void TestMethod2() =>\n            DoTheWork(\"42\", 42);\n\n        [TestMethod]\n        public void Complex()\n        {\n            int cnt = 42;\n            var sb = new System.Text.StringBuilder();\n            sb.Append(\"This invocation doesn't have syntax tree for Append\");\n            DoNothing(sb);\n            for(int i = 0; i < cnt; i++)\n            {\n                DoNothing(sb);\n                if (i % 2 == 0)\n                {\n                    sb.Append(i.ToString());\n                    sb.Clear();\n                    try\n                    {\n                        sb.Append(\"42\");\n                        DoTheWork(sb.ToString(), 42);\n                    }\n                    finally\n                    {\n                        DoNothing(null);\n                    }\n\n                }\n                DoNothing(sb);\n            }\n        }\n\n        private void DoNothing(StringBuilder sb)\n        {\n            // Empty path\n        }\n\n        [TestMethod]\n        public void Recursion() =>      // Noncompliant\n            Recursion(100);\n\n        private void Recursion(int cnt)\n        {\n            if (cnt > 0)\n                Recursion(cnt - 1);\n        }\n\n        [TestMethod]\n        public void NestedTwoTimes() =>\n            NestedTwo();\n\n        [TestMethod]\n        public void NestedThreeTimes() => // Noncompliant, it's too deep\n            NestedThree();\n\n        private void NestedThree() =>\n            NestedTwo();\n\n        private void NestedTwo() =>\n            DoTheWork(\"42\", 42);\n\n        private void DoTheWork(string s, int i) =>\n            Assert.AreEqual(i.ToString(), s);\n\n        [TestMethod]\n        public void TestMethod3() =>\n            DoTheWorkByInvocationName(\"42\", 42);\n\n        private void DoTheWorkByInvocationName(string s, int i) =>\n            i.ToString().Should().Be(s);\n\n        [TestMethod]\n        public void TestMethod4() =>\n            DoTheWorkWithThrow();\n\n        private void DoTheWorkWithThrow()\n        {\n            throw new Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException(\"You failed me!\");\n        }\n\n        [TestMethod]\n        public void MixedSyntaxTrees() =>\n            HelperFromAnotherSyntaxTree.Is42(42);\n\n        [TestMethod]\n        public void MixedSyntaxTreesNested() =>\n            HelperFromAnotherSyntaxTree.Is42Nested(42);\n\n        [TestMethod]\n        public void MixedSyntaxTreesMissingAssertion() =>   // Noncompliant\n            HelperFromAnotherSyntaxTree.DoNothing();\n\n        [TestMethod]\n        public void AssertionIsInConstructor()   // Noncompliant FP, not supported\n        {\n            var x = new BadDesign(\"42\", 42);\n        }\n\n        [TestMethod]\n        public void AssertionIsInSetter()       // Noncompliant FP, not supported\n        {\n            var x = new BadDesign();\n            x.Property = 42;\n        }\n\n        private class BadDesign\n        {\n            public BadDesign() { }\n\n            public BadDesign(string s, int i) =>\n                Assert.AreEqual(i.ToString(), s);\n\n            public int Property\n            {\n                set => Assert.AreEqual(value, 42);\n            }\n        }\n    }\n\n    public class DerivedTestMethodAttribute : TestMethodAttribute\n    {\n\n    }\n\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TestMethodShouldContainAssertion.MsTest.Latest.cs",
    "content": "﻿namespace TestMsTest\n{\n    using System;\n    using System.Runtime.CompilerServices;\n    using System.Text;\n    using System.Threading.Tasks;\n    using FluentAssertions;\n    using NFluent;\n    using NSubstitute;\n    using Microsoft.VisualStudio.TestTools.UnitTesting;\n    using Shouldly;\n\n    using static Microsoft.VisualStudio.TestTools.UnitTesting.Assert;\n\n    [TestClass]\n    public class Program\n    {\n        [DerivedTestMethod]\n        public void DerivedTestMethod1() // Noncompliant {{Add at least one assertion to this test case.}}\n        //          ^^^^^^^^^^^^^^^^^^\n        {\n            var x = 42;\n        }\n    }\n\n    [AttributeUsage(AttributeTargets.Method, Inherited = false)]\n    public sealed class DerivedTestMethodAttribute : TestMethodAttribute\n    {\n        public DerivedTestMethodAttribute([CallerFilePath] string callerFilePath = \"\", [CallerLineNumber] int callerLineNumber = -1) : base(callerFilePath, callerLineNumber)\n        { }\n\n        public override Task<TestResult[]> ExecuteAsync(ITestMethod testMethod) => base.ExecuteAsync(testMethod);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TestMethodShouldContainAssertion.MsTest.V3.cs",
    "content": "﻿namespace TestMsTest\n{\n    using System;\n    using System.Text;\n    using FluentAssertions;\n    using NFluent;\n    using NSubstitute;\n    using Microsoft.VisualStudio.TestTools.UnitTesting;\n    using Shouldly;\n\n    using static Microsoft.VisualStudio.TestTools.UnitTesting.Assert;\n\n    [TestClass]\n    public class Program\n    {\n        [TestMethod]\n        [ExpectedException(typeof(Exception))]\n        public void TestMethod1()\n        {\n            var x = System.IO.File.Open(\"\", System.IO.FileMode.Open);\n        }\n\n        [DataTestMethod]\n        [ExpectedException(typeof(Exception))]\n        public void TestMethod2()\n        {\n            var x = System.IO.File.Open(\"\", System.IO.FileMode.Open);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TestMethodShouldContainAssertion.NUnit.FsCheck.cs",
    "content": "﻿namespace TestFsCheck\n{\n    using System;\n    using FsCheck;\n    using FsCheck.Fluent;\n    using NUnit.Framework;\n\n    using PropertyAttribute = FsCheck.NUnit.PropertyAttribute;\n\n    public class FsCheckTests\n    {\n        [Property]\n        public bool NumberPlusNumberEqualsNumberTimesTwo(int someNumber) // Compliant - Property test\n        {\n            return someNumber + someNumber == someNumber * 2;\n        }\n\n        [Test]\n        public void ModuloFiveReturnNaturalNumberBetweenMinus4AndPlus4()\n        {\n            Prop.ForAll<int>(x => x % 5 >= -4 && x % 5 <= 4)\n                .QuickCheck();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TestMethodShouldContainAssertion.NUnit.cs",
    "content": "﻿namespace TestNUnit\n{\n    using System;\n    using System.Collections.Generic;\n    using System.Threading;\n    using System.Threading.Tasks;\n    using FluentAssertions;\n    using NFluent;\n    using NSubstitute;\n    using NSubstitute.ReceivedExtensions;\n    using NUnit.Framework;\n    using Shouldly;\n\n    using static NUnit.Framework.Assert;\n\n    class BaseClass\n    {\n        public void AssertSomething()\n        {\n            Assert.IsTrue(true);\n        }\n\n        public void ShouldSomething()\n        {\n            Assert.IsTrue(true);\n        }\n\n        public void ExpectSomething()\n        {\n            Assert.IsTrue(true);\n        }\n\n        public void MustSomething()\n        {\n            Assert.IsTrue(true);\n        }\n\n        public void VerifySomething()\n        {\n            Assert.IsTrue(true);\n        }\n\n        public void ValidateSomething()\n        {\n            Assert.IsTrue(true);\n        }\n    }\n\n    [TestFixture]\n    class TestAttributeTests : BaseClass\n    {\n        [Test]\n        public void Test1() // Noncompliant {{Add at least one assertion to this test case.}}\n//                  ^^^^^\n        {\n            var x = 42;\n        }\n\n        [Test]\n        public void Test2()\n        {\n            var x = 42;\n            Assert.AreEqual(x, 42);\n        }\n\n        [Test]\n        public void Test3()\n        {\n            var x = 42;\n            NUnit.Framework.Assert.AreEqual(x, 42);\n        }\n\n        [Test]\n        public void Test5()\n        {\n            var x = 42;\n            x.Should().Be(42);\n        }\n\n        [Test]\n        public void Test8()\n        {\n            AssertSomething();\n        }\n\n        [Test]\n        public void Test9()\n        {\n            ShouldSomething();\n        }\n\n        [Test]\n        public void Test10()\n        {\n            ExpectSomething();\n        }\n\n        [Test]\n        public void Test11()\n        {\n            MustSomething();\n        }\n\n        [Test]\n        public void Test12()\n        {\n            VerifySomething();\n        }\n\n        [Test]\n        public void Test13()\n        {\n            ValidateSomething();\n        }\n\n        [Test]\n        public void Test14()\n        {\n            dynamic d = 10;\n            Assert.AreEqual(d, 10.0);\n        }\n\n        [Test]\n        public void Test15()\n        {\n            var x = 42;\n            AreEqual(x, 42);\n        }\n\n        [Test]\n        public void TestMethod16()\n        {\n            throw new NUnit.Framework.AssertionException(\"You failed me!\");\n        }\n\n        [Test]\n        [Ignore(\"Some reason\")]\n        public void Test17() // Don't raise on skipped test methods\n        {\n        }\n\n        [Test(ExpectedResult = 42)]\n        public int TestViaExpectedResult() // Compliant, assertion via expected result\n        {\n            return 42;\n        }\n    }\n\n    [TestFixture]\n    class TestCaseAttributeTests : BaseClass\n    {\n        [TestCase]\n        public void TestCase1() // Noncompliant {{Add at least one assertion to this test case.}}\n//                  ^^^^^^^^^\n        {\n            var x = 42;\n        }\n\n        [TestCase]\n        public void TestCase2()\n        {\n            var x = 42;\n            Assert.AreEqual(x, 42);\n        }\n\n        [TestCase]\n        public void TestCase3()\n        {\n            var x = 42;\n            NUnit.Framework.Assert.AreEqual(x, 42);\n        }\n\n        [TestCase]\n        public void TestCase5()\n        {\n            var x = 42;\n            x.Should().Be(42);\n        }\n\n        [TestCase]\n        public void TestCase8()\n        {\n            AssertSomething();\n        }\n\n        [TestCase]\n        public void TestCase9()\n        {\n            ShouldSomething();\n        }\n\n        [TestCase]\n        public void TestCase10()\n        {\n            ExpectSomething();\n        }\n\n        [TestCase]\n        public void TestCase11()\n        {\n            MustSomething();\n        }\n\n        [TestCase]\n        public void TestCase12()\n        {\n            VerifySomething();\n        }\n\n        [TestCase]\n        public void TestCase13()\n        {\n            ValidateSomething();\n        }\n\n        [TestCase]\n        public void TestCase14()\n        {\n            dynamic d = 10;\n            Assert.AreEqual(d, 10.0);\n        }\n\n        [TestCase]\n        [Ignore(\"Some reason\")]\n        public void TestCase15() // Don't raise on skipped test methods\n        {\n        }\n\n        [TestCase]\n        public async Task TestCase16() // Noncompliant {{Add at least one assertion to this test case.}}\n//                        ^^^^^^^^^^\n        {\n            var x = 42;\n        }\n\n        [TestCase(\"foo\", ExpectedResult = \"foo\")]\n        public void TestCase17(string str) // Noncompliant {{Add at least one assertion to this test case.}}\n//                  ^^^^^^^^^^\n        {\n            var x = str;\n        }\n\n        [TestCase(\"foo\", ExpectedResult = \"foo\")]\n        public async Task TestCase18(string str) // Noncompliant {{Add at least one assertion to this test case.}}\n//                        ^^^^^^^^^^\n        {\n            var x = str;\n        }\n\n        [TestCase(\"foo\", ExpectedResult = \"foo\")]\n        public string TestCase19(string str)\n        {\n            return str;\n        }\n\n        [TestCase(\"foo\", ExpectedResult = \"foo\")]\n        public async Task<string> TestCase20(string str)\n        {\n            return str;\n        }\n\n        [TestCase]\n        public void TestCase21()\n        {\n            Check.ThatCode(() => 42).WhichResult().IsStrictlyPositive();\n        }\n\n        [TestCase]\n        public void TestCase22()\n        {\n            throw new NFluent.Kernel.FluentCheckException(\"You failed me!\");\n        }\n    }\n\n    [TestFixture]\n    class TestCaseSourceAttributeTests : BaseClass\n    {\n\n        [TestCaseSource(\"Foo\")]\n        public void TestCaseSource1() // Noncompliant {{Add at least one assertion to this test case.}}\n//                  ^^^^^^^^^^^^^^^\n        {\n            var x = 42;\n        }\n\n        [TestCaseSource(\"Foo\")]\n        public void TestCaseSource2()\n        {\n            var x = 42;\n            Assert.AreEqual(x, 42);\n        }\n\n        [TestCaseSource(\"Foo\")]\n        public void TestCaseSource3()\n        {\n            var x = 42;\n            NUnit.Framework.Assert.AreEqual(x, 42);\n        }\n\n        [TestCaseSource(\"Foo\")]\n        public void TestCaseSource5()\n        {\n            var x = 42;\n            x.Should().Be(42);\n        }\n\n        [TestCaseSource(\"Foo\")]\n        public void TestCaseSource8()\n        {\n            AssertSomething();\n        }\n\n        [TestCaseSource(\"Foo\")]\n        public void TestCaseSource9()\n        {\n            ShouldSomething();\n        }\n\n        [TestCaseSource(\"Foo\")]\n        public void TestCaseSource10()\n        {\n            ExpectSomething();\n        }\n\n        [TestCaseSource(\"Foo\")]\n        public void TestCaseSource11()\n        {\n            MustSomething();\n        }\n\n        [TestCaseSource(\"Foo\")]\n        public void TestCaseSource12()\n        {\n            VerifySomething();\n        }\n\n        [TestCaseSource(\"Foo\")]\n        public void TestCaseSource13()\n        {\n            ValidateSomething();\n        }\n\n        [TestCaseSource(\"Foo\")]\n        public void TestCaseSource14()\n        {\n            dynamic d = 10;\n            Assert.AreEqual(d, 10.0);\n        }\n\n        [TestCaseSource(\"Foo\")]\n        [Ignore(\"Some reason\")]\n        public void TestCaseSource15() // Don't raise on skipped test methods\n        {\n        }\n\n        [TestCaseSource(\"Foo\")]\n        public async Task TestCaseSource16() // Noncompliant {{Add at least one assertion to this test case.}}\n//                        ^^^^^^^^^^^^^^^^\n        {\n            var x = 42;\n        }\n\n        private static readonly TestCaseData[] Cases =\n        {\n          new TestCaseData(\"foo\", \"bar\").Returns(false),\n          new TestCaseData(100, 100).Returns(true),\n        };\n\n        [Test]\n        [TestCaseSource(nameof(Cases))]\n        public bool TestCaseSource17(object obj1, object obj2)\n        {\n            return obj1.Equals(obj2);\n        }\n\n        [Test]\n        [TestCaseSource(nameof(Cases))]\n        public async Task<bool> TestCaseSource18(object obj1, object obj2)\n        {\n            return obj1.Equals(obj2);\n        }\n    }\n\n    [TestFixture]\n    class TheoryAttributeTests : BaseClass\n    {\n\n        [Theory]\n        public void Theory1() // Noncompliant {{Add at least one assertion to this test case.}}\n//                  ^^^^^^^\n        {\n            var x = 42;\n        }\n\n        [Theory]\n        public void Theory2()\n        {\n            var x = 42;\n            Assert.AreEqual(x, 42);\n        }\n\n        [Theory]\n        public void Theory3()\n        {\n            var x = 42;\n            NUnit.Framework.Assert.AreEqual(x, 42);\n        }\n\n        [Theory]\n        public void Theory5()\n        {\n            var x = 42;\n            x.Should().Be(42);\n        }\n\n        [Theory]\n        public void Theory8()\n        {\n            AssertSomething();\n        }\n\n        [Theory]\n        public void Theory9()\n        {\n            ShouldSomething();\n        }\n\n        [Theory]\n        public void Theory10()\n        {\n            ExpectSomething();\n        }\n\n        [Theory]\n        public void Theory11()\n        {\n            MustSomething();\n        }\n\n        [Theory]\n        public void Theory12()\n        {\n            VerifySomething();\n        }\n\n        [Theory]\n        public void Theory13()\n        {\n            ValidateSomething();\n        }\n\n        [Theory]\n        public void Theory14()\n        {\n            dynamic d = 10;\n            Assert.AreEqual(d, 10.0);\n        }\n\n        [Theory]\n        [Ignore(\"Some reason\")]\n        public void Theory15() // Don't raise on skipped test methods\n        {\n        }\n    }\n\n    [TestFixture]\n    public class TypeExtensionsTests\n    {\n        [TestCase(typeof(string), ExpectedResult = \"System.String\")]\n        [TestCase(typeof(string[]), ExpectedResult = \"System.String[]\")]\n        [TestCase(typeof(List<string>), ExpectedResult = \"List<System.String>\")]\n        [TestCase(typeof(List<(string, int)>), ExpectedResult = \"List<ValueTuple<System.String,System.Int32>>\")]\n        public string GetFriendlyFullName(Type type)\n        {\n            return type.GetType().ToString();\n        }\n\n        [TestCase(typeof(string[]), \"System.String[]\")]\n        public string NoNamedParameter(Type type) // Noncompliant FP\n        {\n            return type.GetType().ToString();\n        }\n    }\n\n    [TestFixture]\n    class NSubstituteTests\n    {\n        private readonly ICalculator calculator;\n\n        public NSubstituteTests()\n        {\n            calculator = Substitute.For<ICalculator>();\n        }\n\n        [TestCase]\n        public void NoAssert() // Noncompliant\n        {\n        }\n\n        [TestCase]\n        public void Received()\n        {\n            calculator.Received().Add(1, 2);\n        }\n\n        [TestCase]\n        public void ReceivedExpression() => calculator.Received().Add(1, 2);\n\n        [TestCase]\n        public void ReceivedNameSpace() => NSubstitute.SubstituteExtensions.Received(calculator).Add(1, 2);\n\n        [TestCase]\n        public void ReceivedWithAnyArgs()\n        {\n            calculator.ReceivedWithAnyArgs().Add(0, 0);\n        }\n\n        [TestCase]\n        public void ReceivedWithQuantity()\n        {\n            calculator.Received(Quantity.AtLeastOne()).Add(1, 2);\n        }\n\n        [TestCase]\n        public void ReceivedExpressionWithQuantity() => calculator.Received(Quantity.AtLeastOne()).Add(1, 2);\n\n        [TestCase]\n        public void ReceivedNameSpaceWithQuantity() => NSubstitute.ReceivedExtensions.ReceivedExtensions.Received(calculator, Quantity.AtLeastOne()).Add(1, 2);\n\n        [TestCase]\n        public void ReceivedWithAnyArgsWithQuantity()\n        {\n            calculator.ReceivedWithAnyArgs(Quantity.AtLeastOne()).Add(0, 0);\n        }\n\n        [TestCase]\n        public void DidNotReceived()\n        {\n            calculator.DidNotReceive().Add(1, 2);\n        }\n\n        [TestCase]\n        public void DidNotReceiveWithAnyArgs()\n        {\n            calculator.DidNotReceiveWithAnyArgs().Add(1, 2);\n        }\n\n        [TestCase]\n        public void ReceivedInOrder()\n        {\n            NSubstitute.Received.InOrder(() =>\n            {\n                calculator.Add(1, 2);\n            });\n        }\n    }\n\n    // All assert methods start with \"Should*\". We do not test all APIs, just some.\n    public class ShouldlyTests\n    {\n        int i = 1;\n        public dynamic Foo() => null;\n        public void Bar() { }\n\n        [TestCase]\n        public void W()\n        {\n            int[] empty = { };\n            empty.ShouldBeEmpty();\n\n            var dict = new Dictionary<string, string> { { \"x\", \"x\" } };\n            dict.ShouldContainKey(\"y\");\n\n            Should.Throw<IndexOutOfRangeException>(() => Bar());\n        }\n\n        [TestCase]\n        public void X() => \"Foo\".ShouldMatchApproved();\n\n        [TestCase]\n        public void Y() => i.ShouldBeInRange(30000, 40000);\n\n        [TestCase]\n        public void Z() => Should.NotThrow(() => Bar());\n\n        [TestCase]\n        public void Dynamic()\n        {\n            dynamic theFuture = Foo();\n            DynamicShould.HaveProperty(theFuture, \"X\");\n        }\n\n        [TestCase]\n        public void CompleteIn() =>\n            Should.CompleteIn(action: () => { Thread.Sleep(TimeSpan.FromSeconds(2)); },\n                              timeout: TimeSpan.FromSeconds(1),\n                              customMessage: \"Some additional context\");\n    }\n\n    internal interface ICalculator\n    {\n        int Add(int a, int b);\n    }\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TestMethodShouldContainAssertion.NUnit4.cs",
    "content": "using NUnit.Framework;\nusing NUnit.Framework.Legacy;\n\nnamespace TestNUnit4\n{\n    [TestFixture]\n    class TestAttributeTests\n    {\n        [Test]\n        public void Test1() // Noncompliant {{Add at least one assertion to this test case.}}\n//                  ^^^^^\n        {\n            var x = 42;\n        }\n\n        [Test]\n        public void Test2()\n        {\n            var x = 42;\n            ClassicAssert.AreEqual(x, 42);\n        }\n\n        [Test]\n        public void Test3()\n        {\n            var x = 42;\n            NUnit.Framework.Legacy.ClassicAssert.AreEqual(x, 42);\n        }\n\n        [Test]\n        public void Test4()\n        {\n            ClassicAssert.IsTrue(true);\n        }\n\n        [Test]\n        public void Test5()\n        {\n            ClassicAssert.IsFalse(false);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TestMethodShouldContainAssertion.SourceGenerators.cs",
    "content": "﻿using Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.CSharp.Testing;\nusing Microsoft.CodeAnalysis.Testing;\nusing System.Threading.Tasks;\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\n\n\n[Generator]\npublic class SourceGenerator : IIncrementalGenerator\n{\n    public void Initialize(IncrementalGeneratorInitializationContext context)\n    {\n        IncrementalValuesProvider<ClassDeclarationSyntax> calculatorClassesProvider = default;\n\n        context.RegisterSourceOutput(calculatorClassesProvider, (sourceProductionContext, calculatorClass) => Execute());\n    }\n\n    public static void Execute() { }\n}\n\n[TestClass]\npublic class TestGeneratorUnitTest\n{\n    [TestMethod]\n    public async Task Test() => // Noncompliant, FP - next line contains the assertion\n        await new CSharpSourceGeneratorTest<SourceGenerator, DefaultVerifier>().RunAsync();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TestMethodShouldContainAssertion.XUnit.FsCheck.cs",
    "content": "﻿namespace TestFsCheck\n{\n    using System;\n    using FsCheck;\n    using FsCheck.Fluent;\n    using FsCheck.Xunit;\n    using Xunit;\n\n    public class FsCheckTests\n    {\n        [Property]\n        public bool NumberPlusNumberEqualsNumberTimesTwo(int someNumber) // Compliant - Property test\n        {\n            return someNumber + someNumber == someNumber * 2;\n        }\n\n        [Fact]\n        public void ModuloFiveReturnNaturalNumberBetweenMinus4AndPlus4()\n        {\n            Prop.ForAll<int>(x => x % 5 >= -4 && x % 5 <= 4)\n                .QuickCheck();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TestMethodShouldContainAssertion.Xunit.Legacy.cs",
    "content": "﻿namespace TestXunitLegacy\n{\n    using System;\n    using FluentAssertions;  // v4.9\n    using NFluent;\n    using Xunit;\n    using Xunit.Extensions; // v1.9.1\n\n    public class Program\n    {\n        [Fact]\n        public void Fact1() // Noncompliant {{Add at least one assertion to this test case.}}\n//                  ^^^^^\n        {\n            var x = 42;\n        }\n\n        [Fact]\n        public void Fact2()\n        {\n            var x = 42;\n            Assert.Equal(x, 42);\n        }\n\n        [Fact]\n        public void Fact3()\n        {\n            var x = 42;\n            Xunit.Assert.Equal(x, 42);\n        }\n\n        [Fact]\n        public void Fact5()\n        {\n            var x = 42;\n            x.Should().Be(42);\n        }\n\n        [Fact]\n        public void Fact8()\n        {\n            AssertSomething(42);\n        }\n\n        [Fact]\n        public void Fact9()\n        {\n            ShouldSomething(42);\n        }\n\n        [Fact]\n        public void Fact10()\n        {\n            ExpectSomething(42);\n        }\n\n        [Fact]\n        public void Fact11()\n        {\n            MustSomething(42);\n        }\n\n        [Fact]\n        public void Fact12()\n        {\n            VerifySomething(42);\n        }\n\n        [Fact]\n        public void Fact13()\n        {\n            ValidateSomething(42);\n        }\n\n        [Fact]\n        public void Fact14()\n        {\n            dynamic d = 10;\n            Assert.Equal(d, 10.0);\n        }\n\n        [Fact(Skip = \"reason\")]\n        public void Fact15() // Don't raise on skipped test methods\n        {\n        }\n\n        [Fact]\n        public void Fact16()\n        {\n            Check.ThatCode(() => 42).WhichResult().IsStrictlyPositive();\n        }\n\n        [Fact]\n        public void Fact17()\n        {\n            throw new NFluent.Kernel.FluentCheckException(\"You failed me!\");\n        }\n\n        [Theory]\n        [InlineData(1)]\n        public void Theory1(int arg1) // Noncompliant {{Add at least one assertion to this test case.}}\n//                  ^^^^^^^\n        {\n            var x = 42;\n        }\n\n        [Theory]\n        [InlineData(1)]\n        public void Theory2(int arg1)\n        {\n            Assert.Equal(42, arg1);\n        }\n\n        [Theory]\n        [InlineData(1)]\n        public void Theory3(int arg1)\n        {\n            Xunit.Assert.Equal(42, arg1);\n        }\n\n        [Theory]\n        [InlineData(1)]\n        public void Theory5(int arg1)\n        {\n            arg1.Should().Be(42);\n        }\n\n        [Theory]\n        [InlineData(1)]\n        public void Theory8(int arg1)\n        {\n            AssertSomething(arg1);\n        }\n\n        [Theory]\n        [InlineData(1)]\n        public void Theory9(int arg1)\n        {\n            ShouldSomething(arg1);\n        }\n\n        [Theory]\n        [InlineData(1)]\n        public void Theory10(int arg1)\n        {\n            ExpectSomething(arg1);\n        }\n\n        [Theory]\n        [InlineData(1)]\n        public void Theory11(int arg1)\n        {\n            MustSomething(arg1);\n        }\n\n        [Theory]\n        [InlineData(1)]\n        public void Theory12(int arg1)\n        {\n            VerifySomething(arg1);\n        }\n\n        [Theory]\n        [InlineData(1)]\n        public void Theory13(int arg1)\n        {\n            ValidateSomething(arg1);\n        }\n\n        [Theory]\n        [InlineData(1)]\n        public void Theory14(int arg1)\n        {\n            dynamic d = 10;\n            Assert.Equal(d, 10.0);\n        }\n\n        [Theory(Skip = \"reason\")]\n        [InlineData(1)]\n        public void Theory15(int arg1) // Don't raise on skipped test methods\n        {\n        }\n\n        public void AssertSomething(int arg1)\n        {\n            Assert.True(true);\n        }\n\n        public void ShouldSomething(int arg1)\n        {\n            Assert.True(true);\n        }\n\n        public void ExpectSomething(int arg1)\n        {\n            Assert.True(true);\n        }\n\n        public void MustSomething(int arg1)\n        {\n            Assert.True(true);\n        }\n\n        public void VerifySomething(int arg1)\n        {\n            Assert.True(true);\n        }\n\n        public void ValidateSomething(int arg1)\n        {\n            Assert.True(true);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TestMethodShouldContainAssertion.Xunit.cs",
    "content": "﻿namespace TestXunit\n{\n    using System;\n    using FluentAssertions;\n    using NFluent;\n    using NSubstitute;\n    using Shouldly;\n    using Xunit;\n\n    using static Xunit.Assert;\n\n    public class Program\n    {\n        [Fact]\n        public void Fact1() // Noncompliant {{Add at least one assertion to this test case.}}\n//                  ^^^^^\n        {\n            var x = 42;\n        }\n\n        [Fact]\n        public void Fact2()\n        {\n            var x = 42;\n            Assert.Equal(x, 42);\n        }\n\n        [Fact]\n        public void Fact3()\n        {\n            var x = 42;\n            Xunit.Assert.Equal(x, 42);\n        }\n\n        [Fact]\n        public void Fact5()\n        {\n            var x = 42;\n            x.Should().Be(42);\n        }\n\n        [Fact]\n        public void Fact8() => AssertSomething(42);\n\n        [Fact]\n        public void Fact9()\n        {\n            ShouldSomething(42);\n        }\n\n        [Fact]\n        public void Fact10()\n        {\n            ExpectSomething(42);\n        }\n\n        [Fact]\n        public void Fact11()\n        {\n            MustSomething(42);\n        }\n\n        [Fact]\n        public void Fact12()\n        {\n            VerifySomething(42);\n        }\n\n        [Fact]\n        public void Fact13()\n        {\n            ValidateSomething(42);\n        }\n\n        [Fact]\n        public void Fact14()\n        {\n            dynamic d = 10;\n            Assert.Equal(d, 10.0);\n        }\n\n        [Fact]\n        public void Fact15()\n        {\n            var x = 42;\n            Equal(x, 42);\n        }\n\n        [Fact]\n        public void Fact16()\n        {\n            throw new Xunit.Sdk.XunitException(\"You failed me!\");\n        }\n\n        [Fact(Skip = \"reason\")]\n        public void Fact17() // Don't raise on skipped test methods\n        {\n        }\n\n        [Fact]\n        public void Fact18()\n        {\n            Check.ThatCode(() => 42).WhichResult().IsStrictlyPositive();\n        }\n\n        [Fact]\n        public void Fact19()\n        {\n            throw new NFluent.Kernel.FluentCheckException(\"You failed me!\");\n        }\n\n        [Theory]\n        [InlineData(1)]\n        public void Theory1(int arg1) // Noncompliant {{Add at least one assertion to this test case.}}\n//                  ^^^^^^^\n        {\n            var x = 42;\n        }\n\n        [Theory]\n        [InlineData(1)]\n        public void Theory2(int arg1)\n        {\n            Assert.Equal(42, arg1);\n        }\n\n        [Theory]\n        [InlineData(1)]\n        public void Theory3(int arg1)\n        {\n            Xunit.Assert.Equal(42, arg1);\n        }\n\n        [Theory]\n        [InlineData(1)]\n        public void Theory5(int arg1)\n        {\n            arg1.Should().Be(42);\n        }\n\n        [Theory]\n        [InlineData(1)]\n        public void Theory8(int arg1)\n        {\n            AssertSomething(arg1);\n        }\n\n        [Theory]\n        [InlineData(1)]\n        public void Theory9(int arg1)\n        {\n            ShouldSomething(arg1);\n        }\n\n        [Theory]\n        [InlineData(1)]\n        public void Theory10(int arg1)\n        {\n            ExpectSomething(arg1);\n        }\n\n        [Theory]\n        [InlineData(1)]\n        public void Theory11(int arg1)\n        {\n            MustSomething(arg1);\n        }\n\n        [Theory]\n        [InlineData(1)]\n        public void Theory12(int arg1)\n        {\n            VerifySomething(arg1);\n        }\n\n        [Theory]\n        [InlineData(1)]\n        public void Theory13(int arg1)\n        {\n            ValidateSomething(arg1);\n        }\n\n        [Theory]\n        [InlineData(1)]\n        public void Theory14(int arg1)\n        {\n            dynamic d = 10;\n            Assert.Equal(d, 10.0);\n        }\n\n        [Theory(Skip = \"reason\")]\n        [InlineData(1)]\n        public void Theory15(int arg1) // Don't raise on skipped test methods\n        {\n        }\n\n        public void AssertSomething(int arg1)\n        {\n            Assert.True(true);\n        }\n\n        public void ShouldSomething(int arg1)\n        {\n            Assert.True(true);\n        }\n\n        public void ExpectSomething(int arg1)\n        {\n            Assert.True(true);\n        }\n\n        public void MustSomething(int arg1)\n        {\n            Assert.True(true);\n        }\n\n        public void VerifySomething(int arg1)\n        {\n            Assert.True(true);\n        }\n\n        public void ValidateSomething(int arg1)\n        {\n            Assert.True(true);\n        }\n    }\n\n    /// <summary>\n    /// The NSubstitute and Shoudly assertions are extensively verified in the NUnit test files.\n    /// Here we just do a simple test to confirm that the errors are not raised in conjunction with XUnit.\n    /// </summary>\n    public class NSubstituteAndShouldlyTests\n    {\n        [Fact]\n        public void Received() => Substitute.For<IDisposable>().Received().Dispose();\n\n        [Fact]\n        public void Shouldly() => \"\".ShouldBe(\"foo\");\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TestMethodShouldContainAssertion.XunitV3.cs",
    "content": "﻿namespace TestXunit\n{\n    using System;\n    using Xunit;\n\n    using static Xunit.Assert;\n\n    public class XUnitV3Tests\n    {\n        public static bool SkipIndicator => true; // Used in [Fact(SkipUnless/SkipWhen)]\n\n        [Fact]\n        public void Fact1() // Noncompliant {{Add at least one assertion to this test case.}}\n        //          ^^^^^\n        {\n            var x = 42;\n        }\n\n        [Fact(Skip = \"Reason\")]\n        public void SkippedFact1()\n        {\n            var x = 42;\n        }\n\n        [Fact(SkipExceptions = new Type[] { typeof(NotSupportedException) })]\n        public void SkippedFact2()\n        {\n            var x = 42;\n        }\n\n        [Fact(SkipType = typeof(XUnitV3Tests))]\n        public void SkippedFact3()\n        {\n            var x = 42;\n        }\n\n        \n        [Fact(SkipUnless = nameof(SkipIndicator))]\n        public void SkippedFact4()\n        {\n            var x = 42;\n        }\n\n        [Fact(SkipWhen = nameof(SkipIndicator))]\n        public void SkippedFact5()\n        {\n            var x = 42;\n        }\n\n        [Fact(Explicit = true)]\n        public void SkippedFact6()\n        {\n            var x = 42;\n        }\n\n        [Fact(Explicit = false)]\n        public void SkippedFact7() // Noncompliant\n        {\n            var x = 42;\n        }\n\n        [Fact]\n        public void SkippedFact8()\n        {\n            Assert.Skip(\"Reason\");\n        }\n\n        [Fact]\n        public void SkippedFact9()\n        {\n            SkipUnless(true, \"\");\n        }\n\n        [Fact]\n        public void SkippedFact10()\n        {\n            SkipWhen(true, \"\");\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TestMethodShouldHaveCorrectSignature.Latest.cs",
    "content": "﻿namespace MicrosoftTests\n{\n    using Microsoft.VisualStudio.TestTools.UnitTesting;\n\n    [TestClass]\n    class TestSuite\n    {\n        public void Method()\n        {\n            [TestMethod]\n            void NestedTest() { } // Noncompliant {{Make this test method a public method instead of a local function.}}\n\n            [DataTestMethod]\n            void NestedDataTest() { } // Noncompliant\n        }\n    }\n\n    [DerivedTestClassAttribute<int>]\n    class DerivedTestSuite\n    {\n        public void Method()\n        {\n            [DerivedTestMethodAttribute<int>]\n            void NestedTest() { } // Noncompliant\n\n            [DerivedDataTestMethodAttribute<int>]\n            void NestedDataTest() { } // Noncompliant\n        }\n    }\n\n    public class DerivedTestClassAttribute<T> : TestClassAttribute { }\n\n    public class DerivedTestMethodAttribute<T>: TestMethodAttribute { }\n\n    public class DerivedDataTestMethodAttribute<T> : DataTestMethodAttribute { }\n}\n\nnamespace NUnitTests\n{\n    using NUnit.Framework;\n\n    [TestFixture]\n    class TestSuite\n    {\n        public void Method()\n        {\n            [Test]\n            void NestedTest() { } // Noncompliant\n\n            [TestCase(42)]\n            void NestedTestCase() { } // Noncompliant\n        }\n    }\n}\n\nnamespace XUnitTests\n{\n    using Xunit;\n\n    class TestSuite\n    {\n        public void Method()\n        {\n            // Compliant - xUnit allows local functions to be executed as test methods\n\n            [Fact]\n            void NestedFact() { }\n\n            [Theory]\n            void NestedTheory() { }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TestMethodShouldHaveCorrectSignature.Misc.cs",
    "content": "﻿namespace Tests.Diagnostics\n{\n    using System.Threading.Tasks;\n    using Microsoft.VisualStudio.TestTools.UnitTesting;\n\n    public partial class TestThatIssuesAreOnlyReportedOnceForPartialClasses\n    {\n    }\n\n    [TestClass]\n    public partial class TestThatIssuesAreOnlyReportedOnceForPartialClasses\n    {\n        [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethod]\n        private void PrivateTestMethod() // Noncompliant {{Make this test method 'public'.}}\n//                   ^^^^^^^^^^^^^^^^^\n        {\n        }\n    }\n\n    [TestClass]\n    public class MultipleFaultsInEachMethod\n    {\n        [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethod]\n        private async void PrivateVoidGenericTestMethod<T>() // Noncompliant {{Make this test method 'public', non-generic and non-'async' or return 'Task'.}}\n//                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        {\n        }\n\n        [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethod]\n        private async void PrivateVoidTestMethod() // Noncompliant {{Make this test method 'public' and non-'async' or return 'Task'.}}\n//                         ^^^^^^^^^^^^^^^^^^^^^\n        {\n        }\n\n        [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethod]\n        public async void VoidGenericTestMethod<T>() // Noncompliant {{Make this test method non-generic and non-'async' or return 'Task'.}}\n//                        ^^^^^^^^^^^^^^^^^^^^^\n        {\n        }\n\n        [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethod]\n        private void PrivateGenericTestMethod<T>() // Noncompliant {{Make this test method 'public' and non-generic.}}\n//                   ^^^^^^^^^^^^^^^^^^^^^^^^\n        {\n        }\n    }\n\n    [TestClass]\n    public class NonTestAttributesAreIgnored\n    {\n        [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethod]\n        [System.Diagnostics.DebuggerStepThrough]\n        private void PrivateTestMethod() // Noncompliant {{Make this test method 'public'.}}\n//                   ^^^^^^^^^^^^^^^^^\n        {\n        }\n    }\n\n    [TestClass]\n    public class InvalidAttributes\n    {\n        [UnknownAttribute]      // Shouldn't fail // Error [CS0246, CS0246]\n        private void AMethod()\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TestMethodShouldHaveCorrectSignature.MsTest.Legacy.cs",
    "content": "﻿namespace Tests.Diagnostics\n{\n    using System.Threading.Tasks;\n    using Microsoft.VisualStudio.TestTools.UnitTesting;\n\n    [TestClass]\n    public class MsTestTest\n    {\n        [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethod]\n        private void PrivateTestMethod() // Noncompliant {{Make this test method 'public'.}}\n//                   ^^^^^^^^^^^^^^^^^\n        {\n        }\n\n        [TestMethod]\n        protected void ProtectedTestMethod() // Noncompliant\n        {\n        }\n\n        [TestMethod]\n        internal void InternalTestMethod() // Noncompliant\n        {\n        }\n\n        [TestMethod]\n        public async void AsyncTestMethod()  // Noncompliant {{Make this test method non-'async' or return 'Task'.}}\n        {\n        }\n\n        [TestMethod]\n        public void GenericTestMethod<T>()  // Noncompliant {{Make this test method non-generic.}}\n        {\n        }\n\n        [TestMethod]\n        private void MultiErrorsMethod1<T>() // Noncompliant {{Make this test method 'public' and non-generic.}}\n        {\n        }\n\n        [TestMethod]\n        private async void MultiErrorsMethod2<T>() // Noncompliant {{Make this test method 'public', non-generic and non-'async' or return 'Task'.}}\n        {\n        }\n\n        [TestMethod]\n        public async Task DoSomethingAsync() // Compliant\n        {\n            return;\n        }\n    }\n}\n\nnamespace Tests.Diagnostics\n{\n    using Microsoft.VisualStudio.TestTools.UnitTesting;\n    using System.Threading.Tasks;\n\n    [TestClass]\n    public class MsTestTest_DataTestMethods\n    {\n        [Microsoft.VisualStudio.TestTools.UnitTesting.DataTestMethod]\n        private void PrivateTestMethod() // Noncompliant {{Make this test method 'public'.}}\n//                   ^^^^^^^^^^^^^^^^^\n        {\n        }\n\n        [DataTestMethod]\n        protected void ProtectedTestMethod() // Noncompliant\n        {\n        }\n\n        [DataTestMethod]\n        internal void InternalTestMethod() // Noncompliant\n        {\n        }\n\n        [DataTestMethod]\n        public async void AsyncTestMethod()  // Noncompliant {{Make this test method non-'async' or return 'Task'.}}\n        {\n        }\n\n        [DataTestMethod]\n        public void GenericTestMethod<T>()  // Noncompliant {{Make this test method non-generic.}}\n        {\n        }\n\n        [DataTestMethod]\n        private void MultiErrorsMethod1<T>() // Noncompliant {{Make this test method 'public' and non-generic.}}\n        {\n        }\n\n        [DataTestMethod]\n        private async void MultiErrorsMethod2<T>() // Noncompliant {{Make this test method 'public', non-generic and non-'async' or return 'Task'.}}\n        {\n        }\n\n        [DataTestMethod]\n        public async Task DoSomethingAsync() // Compliant\n        {\n            return;\n        }\n    }\n}\n\nnamespace DerivedAttributeTestCases\n{\n    using Microsoft.VisualStudio.TestTools.UnitTesting;\n\n    [DerivedTestClassAttribute]\n    class TestSuite\n    {\n        [DerivedTestMethodAttribute]\n        void NestedTest() { } // Noncompliant\n\n        [DerivedDataTestMethodAttribute]\n        void NestedDataTest() { } // Noncompliant\n    }\n\n    public class DerivedTestClassAttribute : TestClassAttribute { }\n\n    public class DerivedTestMethodAttribute : TestMethodAttribute { }\n\n    public class DerivedDataTestMethodAttribute : DataTestMethodAttribute { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TestMethodShouldHaveCorrectSignature.MsTest.cs",
    "content": "﻿namespace Tests.Diagnostics\n{\n    using System.Threading.Tasks;\n    using Microsoft.VisualStudio.TestTools.UnitTesting;\n\n    [TestClass]\n    public class MsTestTest\n    {\n        [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethod]\n        private void PrivateTestMethod() // Noncompliant {{Make this test method 'public'.}}\n//                   ^^^^^^^^^^^^^^^^^\n        {\n        }\n\n        [TestMethod]\n        protected void ProtectedTestMethod() // Noncompliant\n        {\n        }\n\n        [TestMethod]\n        internal void InternalTestMethod() // Noncompliant\n        {\n        }\n\n        [TestMethod]\n        public async void AsyncTestMethod()  // Noncompliant {{Make this test method non-'async' or return 'Task'.}}\n        {\n        }\n\n        [TestMethod]\n        public void GenericTestMethod<T>()  // Noncompliant {{Make this test method non-generic.}} FP  https://sonarsource.atlassian.net/browse/NET-3623\n        {\n        }\n\n        [TestMethod]\n        private void MultiErrorsMethod1<T>() // Noncompliant {{Make this test method 'public' and non-generic.}} FP\n        {\n        }\n\n        [TestMethod]\n        private async void MultiErrorsMethod2<T>() // Noncompliant {{Make this test method 'public', non-generic and non-'async' or return 'Task'.}} FP\n        {\n        }\n\n        [TestMethod]\n        public async Task DoSomethingAsync() // Compliant\n        {\n            return;\n        }\n    }\n}\n\nnamespace Tests.Diagnostics\n{\n    using Microsoft.VisualStudio.TestTools.UnitTesting;\n    using System.Threading.Tasks;\n\n    [TestClass]\n    public class MsTestTest_DataTestMethods\n    {\n        [Microsoft.VisualStudio.TestTools.UnitTesting.DataTestMethod]\n        private void PrivateTestMethod() // Noncompliant {{Make this test method 'public'.}}\n//                   ^^^^^^^^^^^^^^^^^\n        {\n        }\n\n        [DataTestMethod]\n        protected void ProtectedTestMethod() // Noncompliant\n        {\n        }\n\n        [DataTestMethod]\n        internal void InternalTestMethod() // Noncompliant\n        {\n        }\n\n        [DataTestMethod]\n        public async void AsyncTestMethod()  // Noncompliant {{Make this test method non-'async' or return 'Task'.}}\n        {\n        }\n\n        [DataTestMethod]\n        public void GenericTestMethod<T>()  // Noncompliant {{Make this test method non-generic.}} FP\n        {\n        }\n\n        [DataTestMethod]\n        private void MultiErrorsMethod1<T>() // Noncompliant {{Make this test method 'public' and non-generic.}} FP\n        {\n        }\n\n        [DataTestMethod]\n        private async void MultiErrorsMethod2<T>() // Noncompliant {{Make this test method 'public', non-generic and non-'async' or return 'Task'.}} FP\n        {\n        }\n\n        [DataTestMethod]\n        public async Task DoSomethingAsync() // Compliant\n        {\n            return;\n        }\n    }\n}\n\nnamespace DerivedAttributeTestCases\n{\n    using Microsoft.VisualStudio.TestTools.UnitTesting;\n\n    [DerivedTestClassAttribute]\n    class TestSuite\n    {\n        [DerivedTestMethodAttribute]\n        void NestedTest() { } // Noncompliant\n\n        [DerivedDataTestMethodAttribute]\n        void NestedDataTest() { } // Noncompliant\n    }\n\n    public class DerivedTestClassAttribute : TestClassAttribute { }\n\n    public class DerivedTestMethodAttribute : TestMethodAttribute { }\n\n    public class DerivedDataTestMethodAttribute : DataTestMethodAttribute { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TestMethodShouldHaveCorrectSignature.NUnit.cs",
    "content": "﻿using NUnit.Framework;\n\nnamespace Tests.Diagnostics\n{\n    class NUnitTest\n    {\n        [NUnit.Framework.Test]\n        private void PrivateTestMethod() // Noncompliant\n        {\n        }\n\n        [Test]\n        protected void ProtectedTestMethod() // Noncompliant\n        {\n        }\n\n        [Test]\n        internal void InternalTestMethod() // Noncompliant\n        {\n        }\n\n        [Test]\n        public async void AsyncTestMethod()  // Noncompliant\n        {\n        }\n\n        [Test]\n        public void GenericTestMethod<T>()  // Noncompliant\n        {\n        }\n\n        [Test]\n        public void ValidTest()\n        {\n        }\n    }\n\n    class NUnitTest_TestCase\n    {\n        [NUnit.Framework.TestCase(42)]\n        private void PrivateTestMethod(int data) // Noncompliant\n        {\n        }\n\n        [TestCase(42)]\n        protected void ProtectedTestMethod(int data) // Noncompliant\n        {\n        }\n\n        [TestCase(42)]\n        internal void InternalTestMethod(int data) // Noncompliant\n        {\n        }\n\n        [TestCase(42)]\n        public async void AsyncTestMethod(int data)  // Noncompliant\n        {\n        }\n\n        [TestCase(42)]\n        public void GenericTestMethod<T>(T data)  // valid\n        {\n        }\n\n        [TestCase(42)]\n        public void ValidTest(int data)\n        {\n        }\n    }\n\n    class NUnitTest_TestCaseSource\n    {\n        public static object[] DataProvider = { 42 };\n\n        [NUnit.Framework.TestCaseSource(\"DataProvider\")]\n        private void PrivateTestMethod(object data) // Noncompliant\n        {\n        }\n\n        [TestCaseSource(\"DataProvider\")]\n        protected void ProtectedTestMethod(object data) // Noncompliant\n        {\n        }\n\n        [TestCaseSource(\"DataProvider\")]\n        internal void InternalTestMethod(object data) // Noncompliant\n        {\n        }\n\n        [TestCaseSource(\"DataProvider\")]\n        public async void AsyncTestMethod(object data)  // Noncompliant\n        {\n        }\n\n        [TestCaseSource(\"DataProvider\")]\n        public void GenericTestMethod<T>(T data)  // compliant\n        {\n        }\n\n        [TestCaseSource(\"DataProvider\")]\n        public void ValidTest(object data)\n        {\n\n        }\n    }\n\n    public class NUnitTest_Theories\n    {\n        [NUnit.Framework.Theory]\n        private void PrivateTestMethod(int data) // Noncompliant\n        {\n        }\n\n        [Theory]\n        protected void ProtectedTestMethod(int data) // Noncompliant\n        {\n        }\n\n        [Theory]\n        internal void InternalTestMethod(int data) // Noncompliant\n        {\n        }\n\n        [Theory]\n        public async void AsyncTestMethod(int data)  // Noncompliant\n        {\n        }\n\n        [Theory]\n        public void GenericTestMethod<T>(T[] data)  // Noncompliant\n        {\n        }\n\n        [Theory]\n        public void ValidTest(int data)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TestMethodShouldHaveCorrectSignature.Xunit.Legacy.cs",
    "content": "﻿using System;\nusing Xunit;\nusing Xunit.Extensions;\n\nnamespace Tests.Diagnostics\n{\n    public class XUnitTest\n    {\n\n        [Xunit.Fact]\n        private void PrivateTestMethod() // Compliant\n        {\n        }\n\n        [Fact]\n        protected void ProtectedTestMethod() // Compliant\n        {\n        }\n\n        [Fact]\n        internal void InternalTestMethod() // Compliant\n        {\n        }\n\n        [Fact]\n        public async void AsyncTestMethod()  // Compliant\n        {\n        }\n\n        [Fact]\n        public void GenericTestMethod<T>()  // Noncompliant\n        {\n        }\n\n\n        [Xunit.Extensions.Theory]\n        [InlineData(42)]\n        private void PrivateTestMethod_Theory(int arg) // Compliant\n        {\n        }\n\n        [Theory]\n        [InlineData(42)]\n        protected void ProtectedTestMethod_Theory(int arg) // Compliant\n        {\n        }\n\n        [Theory]\n        [InlineData(42)]\n        internal void InternalTestMethod_Theory(int arg) // Compliant\n        {\n        }\n\n        [Theory]\n        [InlineData(42)]\n        public async void AsyncTestMethod_Theory(int arg)  // Compliant\n        {\n        }\n\n        [Theory]\n        [InlineData(42)]\n        public void GenericTestMethod_Theory<T>(T arg)  // Compliant - theories can be generic\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TestMethodShouldHaveCorrectSignature.Xunit.cs",
    "content": "﻿using System;\nusing Xunit;\n\nnamespace Tests.Diagnostics\n{\n    public class XUnitTest\n    {\n\n        [Xunit.Fact]\n        private void PrivateTestMethod() // Compliant\n        {\n        }\n\n        [Fact]\n        protected void ProtectedTestMethod() // Compliant\n        {\n        }\n\n        [Fact]\n        internal void InternalTestMethod() // Compliant\n        {\n        }\n\n        [Fact]\n        public async void AsyncTestMethod()  // Compliant\n        {\n        }\n\n        [Fact]\n        public void GenericTestMethod<T>()  // Noncompliant\n        {\n        }\n\n\n        [Xunit.Theory]\n        [InlineData(42)]\n        private void PrivateTestMethod_Theory(int arg) // Compliant\n        {\n        }\n\n        [Theory]\n        [InlineData(42)]\n        protected void ProtectedTestMethod_Theory(int arg) // Compliant\n        {\n        }\n\n        [Theory]\n        [InlineData(42)]\n        internal void InternalTestMethod_Theory(int arg) // Compliant\n        {\n        }\n\n        [Theory]\n        [InlineData(42)]\n        public async void AsyncTestMethod_Theory(int arg)  // Compliant\n        {\n        }\n\n        [Theory]\n        [InlineData(42)]\n        public void GenericTestMethod_Theory<T>(T arg)  // Compliant - theories can be generic\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TestMethodShouldNotBeIgnored.Latest.cs",
    "content": "﻿namespace MicrosoftTests\n{\n    using Microsoft.VisualStudio.TestTools.UnitTesting;\n\n    [TestClass]\n    class TestSuite\n    {\n        public void Method()\n        {\n            [TestMethod, Ignore]\n//                       ^^^^^^ Noncompliant {{Either remove this 'Ignore' attribute or add an explanation about why this test is ignored.}}\n            // Currently nested tests are not identified by test runner so they are skipped by default.\n            void NestedTest()\n            {\n            }\n        }\n    }\n\n    [DerivedTestClassAttribute<int>]\n    class TestSuiteDerived\n    {\n        [DerivedTestMethodAttribute<int>]\n        [Ignore]\n//       ^^^^^^ Noncompliant\n        public void Foo1()\n        {\n        }\n\n        [DerivedDataTestMethodAttribute<int>]\n        [Ignore]\n//       ^^^^^^ Noncompliant\n        public void Foo2()\n        {\n        }\n    }\n\n    public class DerivedTestClassAttribute<T> : TestClassAttribute { }\n\n    public class DerivedTestMethodAttribute<T> : TestMethodAttribute { }\n\n    public class DerivedDataTestMethodAttribute<T> : DataTestMethodAttribute { }\n}\n\nnamespace NUnitTests\n{\n    using NUnit.Framework;\n\n    [TestFixture]\n    class TestSuite\n    {\n        public void Method()\n        {\n            [Test, Ignore(\"reason\")]\n            // Currently nested tests are not identified by test runner so they are skipped by default. We are not consistent since we raise in case of MsTest.\n            void NestedTest()\n            {\n            }\n        }\n    }\n}\n\nnamespace XUnitTests\n{\n    using Xunit;\n\n    class TestSuite\n    {\n        public void Method()\n        {\n            [Fact(Skip = \"Reason\")]\n            // Currently nested tests are not identified by test runner so they are skipped by default. We are not consistent since we raise in case of MsTest.\n            void NestedTest()\n            {\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TestMethodShouldNotBeIgnored.MsTest.cs",
    "content": "﻿using Microsoft.VisualStudio.TestTools.UnitTesting;\n\nnamespace Tests.Diagnostics.TestMethods\n{\n    [TestClass]\n    public class MsTestClass_TestMethods\n    {\n        [TestMethod]\n        [Ignore]\n//       ^^^^^^ Noncompliant {{Either remove this 'Ignore' attribute or add an explanation about why this test is ignored.}}\n        public void Foo1()\n        {\n        }\n\n        [TestMethod]\n        [Ignore] // This test is ignored because 'blah blah'\n        public void Foo2()\n        {\n        }\n\n        [Ignore, TestMethod] // This test is ignored because 'blah blah'\n        public void Foo3()\n        {\n        }\n\n        [TestMethod]\n        [Ignore(\"Ignored because reasons\")]\n        public void Foo4()\n        {\n        }\n\n        [TestMethod]\n        [Ignore]\n        [WorkItem(1234)]\n        public void Foo5()\n        {\n        }\n    }\n\n    [TestClass]\n    public class MsTestClass_DataTestMethods\n    {\n        [DataTestMethod]\n        [Ignore]\n//       ^^^^^^ Noncompliant {{Either remove this 'Ignore' attribute or add an explanation about why this test is ignored.}}\n        public void Foo1()\n        {\n        }\n\n        [DataTestMethod]\n        [Ignore] // This test is ignored because 'blah blah'\n        public void Foo2()\n        {\n        }\n\n        [Ignore, DataTestMethod] // This test is ignored because 'blah blah'\n        public void Foo3()\n        {\n        }\n\n        [DataTestMethod]\n        [Ignore(\"Ignored because reasons\")]\n        public void Foo4()\n        {\n        }\n\n        [DataTestMethod]\n        [Ignore]\n        [WorkItem(1234)]\n        public void Foo5()\n        {\n        }\n    }\n\n    [Ignore, TestClass]\n//   ^^^^^^ Noncompliant\n    public class MsTestClass1\n    {\n        [TestMethod]\n        public void Test1()\n        {\n        }\n    }\n\n    [Ignore]\n    public class MsTestClass2 // No TestClass attribute\n    {\n    }\n\n    [Ignore, TestClass] // This test is ignored because 'blah blah'\n    public class MsTestClass3\n    {\n    }\n\n    [Ignore(\"Ignored because reasons\"), TestClass]\n    public class MsTestClass4\n    {\n    }\n}\n\nnamespace DerivedAttributeTestCases\n{\n    using Microsoft.VisualStudio.TestTools.UnitTesting;\n\n    [DerivedTestClassAttribute]\n    class TestSuite\n    {\n        [DerivedTestMethodAttribute]\n        [Ignore]\n//       ^^^^^^ Noncompliant\n        public void Foo1()\n        {\n        }\n\n        [DerivedDataTestMethodAttribute]\n        [Ignore]\n//       ^^^^^^ Noncompliant\n        public void Foo2()\n        {\n        }\n    }\n\n    public class DerivedTestClassAttribute : TestClassAttribute { }\n\n    public class DerivedTestMethodAttribute : TestMethodAttribute { }\n\n    public class DerivedDataTestMethodAttribute : DataTestMethodAttribute { }\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TestMethodShouldNotBeIgnored.NUnit.V2.cs",
    "content": "﻿using System;\nusing NUnit.Framework;\nusing MSTest = Microsoft.VisualStudio.TestTools.UnitTesting;\n\nnamespace Tests.Diagnostics\n{\n    [TestFixture]\n    public class NUnitClass\n    {\n        // False positive: using an MSTest Ignore against an NUnit test does nothing,\n        // but we still raise an issue.\n        [Test]\n        [Microsoft.VisualStudio.TestTools.UnitTesting.Ignore]\n//       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant\n        public void Foo1()\n        {\n        }\n\n        [Test]\n        [NUnit.Framework.Ignore] // This test is ignored because 'blah blah'\n        public void Foo2()\n        {\n        }\n\n        [Test]\n        [Ignore]\n        [MSTest.WorkItem(1234)]\n        public void Foo3()\n        {\n        }\n\n        [TestCase(\"\")]\n        [Ignore()]\n//       ^^^^^^^^ Noncompliant\n        public void Foo4(string s)\n        {\n        }\n\n        [TestCase(\"\")]\n        [NUnit.Framework.Ignore] // This test is ignored because 'blah blah'\n        public void Foo5(string s)\n        {\n        }\n\n        [TestCase(\"\")]\n        [Ignore]\n        [MSTest.WorkItem(1234)]\n        public void Foo6(string s)\n        {\n        }\n\n        [TestCase(\"\")]\n        [DerivedIgnoreAttribute()]\n//       ^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant\n        public void Foo7(string s)\n        {\n        }\n\n        [TestCase(\"\")]\n        [DerivedIgnoreAttribute] // This test is ignored because 'blah blah'\n        public void Foo8(string s)\n        {\n        }\n\n        [TestCaseSource(\"DivideCases\")]\n        [Ignore]\n//       ^^^^^^ Noncompliant\n        public void DivideTest(int n, int d, int q)\n        {\n            Assert.AreEqual(q, n / d);\n        }\n\n        static object[] DivideCases =\n        {\n            new object[] { 12, 3, 4 }\n        };\n\n        [Datapoint]\n        public int Data = 42;\n\n        [Theory]\n        [Ignore]\n//       ^^^^^^ Noncompliant\n        public void Theory1(int arg)\n        {\n        }\n\n        [Theory]\n        [Ignore] // some reason\n        public void Theory2(int arg) // Compliant\n        {\n        }\n\n        [Theory]\n        [Ignore(\"a reason\")]\n        public void Theory3(int arg)\n        {\n        }\n    }\n\n    [TestFixture, Ignore]\n    public class IgnoredClass1\n    {\n        [Test]\n        public void TestInIgnoredClass()\n        {\n        }\n    }\n\n    [Ignore]\n    public class IgnoredClass2 // No TestClass attribute\n    {\n    }\n\n    [Ignore, TestFixture] // This test is ignored because 'blah blah'\n    public class IgnoredClass3\n    {\n    }\n\n    [Ignore(\"Ignored because reasons\"), TestFixture]\n    public class IgnoredClass4\n    {\n    }\n\n    public class DerivedIgnoreAttribute : NUnit.Framework.IgnoreAttribute { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TestMethodShouldNotBeIgnored.NUnit.cs",
    "content": "﻿using System;\nusing NUnit.Framework;\nusing MSTest = Microsoft.VisualStudio.TestTools.UnitTesting;\n\nnamespace Tests.Diagnostics\n{\n    [TestFixture]\n    public class NUnitClass\n    {\n        // False positive: using an MSTest Ignore against an NUnit test does nothing,\n        // but we still raise an issue.\n        [Test]\n        [Microsoft.VisualStudio.TestTools.UnitTesting.Ignore]\n//       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant\n        public void Foo1()\n        {\n        }\n\n        static object[] DivideCases =\n        {\n            new object[] { 12, 3, 4 }\n        };\n\n        [Datapoint]\n        public int Data = 42;\n\n        [Theory]\n        [Ignore(\"a reason\")]\n        public void Theory3(int arg)\n        {\n        }\n    }\n\n    [Ignore(\"Ignored because reasons\"), TestFixture]\n    public class IgnoredClass4\n    {\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TestMethodShouldNotBeIgnored.Xunit.cs",
    "content": "﻿using MSTest = Microsoft.VisualStudio.TestTools.UnitTesting;\nusing Xunit;\n\n// Regression test for #1705: https://github.com/SonarSource/sonar-dotnet/issues/1705\n// The rule should not be applied to xUnit tests. Previously, the rule was raising if\n// an MSTest [Ignore] attribute was applied to a xUnit test.\n\nnamespace Tests.Diagnostics\n{\n    [MSTest.Ignore()]\n    public class XUnitClass\n    {\n        [Fact]\n        [MSTest.Ignore()]\n        public void Foo1()\n        {\n        }\n\n        [Theory]\n        [InlineData(\"\")]\n        [MSTest.Ignore]\n        public void Foo2(string s)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TestMethodShouldNotBeIgnored.Xunit.v1.cs",
    "content": "﻿using MSTest = Microsoft.VisualStudio.TestTools.UnitTesting;\nusing Xunit;\nusing Xunit.Extensions;\n\n// Legacy xUnit (v1.9.1)\n\n// Regression test for #1705: https://github.com/SonarSource/sonar-dotnet/issues/1705\n// The rule should not be applied to xUnit tests. Previously, the rule was raising if\n// an MSTest [Ignore] attribute was applied to a xUnit test.\n\nnamespace Tests.Diagnostics\n{\n    [MSTest.Ignore()]\n    public class XUnitClass\n    {\n        [Fact]\n        [MSTest.Ignore()]\n        public void Foo1()\n        {\n        }\n\n        [Theory]\n        [InlineData(\"\")]\n        [MSTest.Ignore]\n        public void Foo2(string s)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TestsShouldNotUseThreadSleep.cs",
    "content": "﻿using Microsoft.VisualStudio.TestTools.UnitTesting;\nusing NUnit.Framework;\nusing System;\nusing System.Threading;\nusing Xunit;\nusing Alias = System.Threading.Thread;\nusing static System.Threading.Thread;\n\nclass Compliant\n{\n    [Test]\n    public void TestWithoutThreadSleep()\n    {\n        Xunit.Assert.Equal(\"42\", \"The answer to life, the universe, and everything\");\n    }\n\n    [Test]\n    public void CallToOtherSleepMethod()\n    {\n        Sleep(42);\n    }\n\n    void ThreadSleepNotInTest()\n    {\n        Thread.Sleep(42);\n    }\n\n    public int Property\n    {\n        get\n        {\n            Thread.Sleep(1000); // Lovely, but compliant\n            return 42;\n        }\n    }\n\n    private void Sleep(int durartion) { }\n}\n\nclass NonCompliant\n{\n    [Test]\n    public void ThreadSleepInNUnitTest()\n    {\n        Thread.Sleep(42); // {{Do not use 'Thread.Sleep()' in a test.}}\n//      ^^^^^^^^^^^^^^^^\n    }\n\n    [Fact]\n    public void ThreadSleepInXUnitTest()\n    {\n        Thread.Sleep(42); // Noncompliant\n    }\n\n    [TestMethod]\n    public void ThreadSleepInMSTest()\n    {\n        Thread.Sleep(42); // Noncompliant\n    }\n\n    [Test]\n    public void ThreadSleepViaAlias()\n    {\n        Alias.Sleep(42); // Noncompliant\n    }\n\n    [Test]\n    public void ThreadSleepViaStaticImport()\n    {\n        Sleep(42); // Noncompliant\n    }\n\n    [Test]\n    public void ThreadSleepInLocalFunction()\n    {\n        Wait();\n\n        void Wait()\n        {\n            Thread.Sleep(42); // Noncompliant\n        }\n    }\n\n    [Test]\n    public void ThreadSleepInLambdaFunction()\n    {\n        Action sleep = () => Thread.Sleep(42); // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TestsShouldNotUseThreadSleep.vb",
    "content": "﻿Imports Microsoft.VisualStudio.TestTools.UnitTesting\nImports NUnit.Framework\nImports System.Threading\nImports Xunit\nImports System.Threading.Thread\nImports _Alias = System.Threading.Thread\n\nClass Compliant\n    <Test>\n    Public Sub TestWithoutThreadSleep()\n        Xunit.Assert.Equal(\"42\", \"The answer to life, the universe, and everything\")\n    End Sub\n\n    <Test>\n    Public Sub CallToOtherSleepMethod()\n        Sleep(42)\n    End Sub\n\n    Private Sub ThreadSleepNotInTest()\n        Thread.Sleep(42)\n    End Sub\n\n    Private Sub Sleep(durartion As Integer)\n    End Sub\nEnd Class\n\nClass NonCompliant\n    <Test>\n    Public Sub ThreadSleepInNUnitTest()\n        Thread.Sleep(42) ' {{Do not use Thread.Sleep() in a test.}}\n'       ^^^^^^^^^^^^^^^^\n    End Sub\n\n    <Fact>\n    Public Sub ThreadSleepInXUnitTest()\n        Thread.Sleep(42) ' Noncompliant\n    End Sub\n\n    <TestMethod>\n    Public Sub ThreadSleepInMSTest()\n        Thread.Sleep(42) ' Noncompliant\n    End Sub\n\n    <Test>\n    Public Sub ThreadSleepViaAlias()\n        _Alias.Sleep(42) ' Noncompliant\n    End Sub\n\t\n\t<Test>\n    Public Sub ThreadSleepViaStaticImport()\n        Sleep(42) ' Noncompliant\n    End Sub\n\t\n\t<Test>\n    Public Sub ThreadSleepInLambdaFunction()\n        Dim sleep As Action = Sub() Thread.Sleep(42) ' Noncompliant\n    End Sub\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ThisShouldNotBeExposedFromConstructors.CSharp10.cs",
    "content": "﻿using System.Collections.Generic;\n\nstruct AStruct\n{\n    public int Id;\n\n    public AStruct()\n    {\n        Id = 0;\n        OtherClass.StaticList.Add(this); // Noncompliant\n        OtherClass.StaticMethod(this); // Noncompliant\n        OtherClass.StaticProperty = this; // Noncompliant\n    }\n}\n\nstatic class OtherClass\n{\n    public static List<AStruct> StaticList = new List<AStruct>();\n\n    public static void StaticMethod(AStruct r) { }\n\n    public static AStruct StaticProperty { get; set; }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ThisShouldNotBeExposedFromConstructors.CSharp9.cs",
    "content": "﻿using System.Collections.Generic;\n\nrecord Record\n{\n    Record()\n    {\n        OtherClass.StaticMethod(this); // Noncompliant\n        OtherClass.StaticList.Add(this); // Noncompliant\n        OtherClass.StaticProperty = this; // Noncompliant\n\n        InstanceProperty = this;\n        InstanceMethod(this);\n    }\n\n    public void InstanceMethod(Record r) { }\n\n    public Record InstanceProperty { get; set; }\n}\n\nstatic class OtherClass\n{\n    public static List<Record> StaticList = new List<Record>();\n\n    public static void StaticMethod(Record r) { }\n\n    public static Record StaticProperty { get; set; }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ThisShouldNotBeExposedFromConstructors.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing static Renamed = Tests.Diagnostics.Other.StaticMethod; // Error [CS0426,CS8085]\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        public Program()\n        {\n            // Fields are handled by S3010\n            privateField = this;\n            publicField = this;\n\n            StaticMethod(null);\n            StaticMethod(this);\n            StaticMethod(((this)));\n            StaticProperty = this;\n            StaticProperty = ((this));\n\n            Other.StaticMethod(this); // Noncompliant\n            Other.StaticList.Add(this); // Noncompliant\n            Other.StaticProperty = this; // Noncompliant\n            ProgramsStatic.Add(this); // Noncompliant\n            InstanceList.Add(this); // Noncompliant\n            this.InstanceList.Add(this); // Noncompliant\n            InstanceProperty = this;\n            InstanceMethod(this);\n            this.InstanceMethod(this);\n            Renamed(this); // Compliant, False Negative\n\n            new Program().InstanceMethod(this); // Noncompliant\n        }\n\n        public void Method()\n        {\n            StaticMethod(this);\n            StaticMethod(((this)));\n            Other.StaticMethod(this);\n            Other.StaticList.Add(this);\n            ProgramsStatic.Add(this);\n            InstanceList.Add(this);\n            InstanceMethod(this);\n        }\n\n        public static Program StaticProperty { get; set; }\n\n        public static void StaticMethod(Program program) { }\n\n        public static List<Program> ProgramsStatic = new List<Program>();\n\n        public List<Program> InstanceList = new List<Program>();\n\n        public void InstanceMethod(Program program) { }\n\n        public Program InstanceProperty { get; set; }\n\n        private static Program privateField;\n        public static Program publicField;\n    }\n\n    static class Other\n    {\n        public static List<Program> StaticList = new List<Program>();\n\n        public static void StaticMethod(Program program) { }\n\n        public static Program StaticProperty { get; set; }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ThreadResumeOrSuspendShouldNotBeCalled.cs",
    "content": "﻿using System.Threading;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        void Foo()\n        {\n            Thread.CurrentThread.Suspend(); // Noncompliant {{Refactor the code to remove this use of 'Thread.Suspend'.}}\n//                               ^^^^^^^\n            Thread.CurrentThread.Resume(); // Noncompliant{{Refactor the code to remove this use of 'Thread.Resume'.}}\n//                               ^^^^^^\n\n            var thread = Thread.CurrentThread;\n            thread.Suspend(); // Noncompliant\n            thread?.Suspend(); // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ThreadResumeOrSuspendShouldNotBeCalled.vb",
    "content": "﻿Imports System.Runtime.InteropServices\nImports System.Threading\n\nClass Program\n\n  Public Sub Foo()\n    Thread.CurrentThread.Suspend() ' Noncompliant {{Refactor the code to remove this use of 'Thread.Suspend'.}}\n    Thread.CurrentThread.[Resume]() ' Noncompliant {{Refactor the code to remove this use of 'Thread.Resume'.}}\n    Dim thread1 = Thread.CurrentThread\n    thread1.Suspend() ' Noncompliant\n    thread1?.Resume() ' Noncompliant\n  End Sub\n\n  Public Sub Bar()\n    Dim t As MyThread = new MyThread\n    t.Resume()\n    t.Suspend()\n  End Sub\n\n  Class MyThread\n    Public Sub Suspend()\n    End Sub\n    Public Sub [Resume]()\n    End Sub\n  End Class\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ThreadStaticNonStaticField.Fixed.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    class XAttribute : Attribute { }\n    public class ThreadStaticNonStaticField\n    {\n        private int count1 = 0, count11 = 0;\n\n        [X]  // Fixed\n        private int count2 = 0;\n\n        [System.ThreadStatic]\n        private static int count3 = 0;\n\n        private int count4 = 0;\n        private int count5;\n        private int count6;\n        private int count7;\n    }\n\n    public class ThreadStaticNonStaticFieldDerivedAttribute\n    {\n        [DerivedThreadStatic]  // FN for performance reasons we decided not to handle derived classes\n        private int count1 = 0, count11 = 0;\n    }\n\n    public class DerivedThreadStaticAttribute : ThreadStaticAttribute { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ThreadStaticNonStaticField.Latest.Fixed.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    class XAttribute : Attribute { }\n\n    record Record\n    {\n        private int count1 = 0, count11 = 0;\n\n        [X]  // Fixed\n        private int count2 = 0;\n\n        [System.ThreadStatic]\n        private static int count3 = 0;\n\n        private int count4 = 0;\n    }\n\n    record struct StructRecord\n    {\n        public StructRecord() { }\n        private int count1 = 0, count11 = 0;\n\n        [X]  // Fixed\n        private int count2 = 0;\n\n        [System.ThreadStatic]\n        private static int count3 = 0;\n\n        private int count4 = 0;\n    }\n\n    public class ThreadStaticNonStaticField\n    {\n        [ThreadStaticAttribute<int>]    // FN: for performance reasons we decided not to handle derived classes\n        private int count1 = 0, count11 = 0;\n        private int count2 = 0;\n    }\n\n    public class ThreadStaticAttribute<T> : ThreadStaticAttribute { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ThreadStaticNonStaticField.Latest.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    class XAttribute : Attribute { }\n\n    record Record\n    {\n        [ThreadStatic]  // Noncompliant\n    //   ^^^^^^^^^^^^\n        private int count1 = 0, count11 = 0;\n\n        [ThreadStatic, X]  // Noncompliant {{Remove the 'ThreadStatic' attribute from this definition.}}\n        private int count2 = 0;\n\n        [System.ThreadStatic]\n        private static int count3 = 0;\n\n        private int count4 = 0;\n    }\n\n    record struct StructRecord\n    {\n        public StructRecord() { }\n\n        [ThreadStatic]  // Noncompliant\n    //   ^^^^^^^^^^^^\n        private int count1 = 0, count11 = 0;\n\n        [ThreadStatic, X]  // Noncompliant {{Remove the 'ThreadStatic' attribute from this definition.}}\n        private int count2 = 0;\n\n        [System.ThreadStatic]\n        private static int count3 = 0;\n\n        private int count4 = 0;\n    }\n\n    public class ThreadStaticNonStaticField\n    {\n        [ThreadStaticAttribute<int>]    // FN: for performance reasons we decided not to handle derived classes\n        private int count1 = 0, count11 = 0;\n\n        [ThreadStaticAttribute]         // Noncompliant\n        private int count2 = 0;\n    }\n\n    public class ThreadStaticAttribute<T> : ThreadStaticAttribute { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ThreadStaticNonStaticField.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    class XAttribute : Attribute { }\n    public class ThreadStaticNonStaticField\n    {\n        [ThreadStatic]  // Noncompliant\n//       ^^^^^^^^^^^^\n        private int count1 = 0, count11 = 0;\n\n        [ThreadStatic, X]  // Noncompliant {{Remove the 'ThreadStatic' attribute from this definition.}}\n        private int count2 = 0;\n\n        [System.ThreadStatic]\n        private static int count3 = 0;\n\n        private int count4 = 0;\n\n        [ThreadStaticAttribute]  // Noncompliant\n        private int count5;\n\n        [System.ThreadStaticAttribute]  // Noncompliant\n        private int count6;\n\n        [System.ThreadStatic]  // Noncompliant\n        private int count7;\n    }\n\n    public class ThreadStaticNonStaticFieldDerivedAttribute\n    {\n        [DerivedThreadStatic]  // FN for performance reasons we decided not to handle derived classes\n        private int count1 = 0, count11 = 0;\n    }\n\n    public class DerivedThreadStaticAttribute : ThreadStaticAttribute { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ThreadStaticWithInitializer.Latest.cs",
    "content": "﻿using System;\nusing Point2D = (int, int);\n\nnamespace CSharp9\n{\n    record Foo\n    {\n        [ThreadStatic]\n        public static object PerThreadObject = new object(); // Noncompliant {{Remove this initialization of 'PerThreadObject' or make it lazy.}}\n//                                           ^^^^^^^^^^^^^^\n\n        [ThreadStatic]\n        public static object Compliant;\n    }\n}\n\nnamespace CSharp11\n{\n    public class ThreadStaticWithInitializer\n    {\n        public class Foo\n        {\n            [ThreadStaticAttribute<int>]\n            public static object PerThreadObject1 = new object();   // FN: for performance reasons we decided not to handle derived classes\n\n            [ThreadStaticAttribute]\n            public static object PerThreadObject2 = new object();   // Noncompliant\n        }\n\n        public class ThreadStaticAttribute<T> : ThreadStaticAttribute { }\n    }\n}\n\nnamespace CSharp12\n{\n    public class ThreadStaticWithInitializer\n    {\n        public class Foo\n        {\n            [ThreadStatic]\n            public static int[] PerThreadArray = [1, 2, 3]; // Noncompliant\n\n            [ThreadStatic]\n            public static Point2D PerThreadPoint = new Point2D(); // Noncompliant\n        }\n    }\n}\n\nnamespace CSharp13\n{\n    public partial class Partial\n    {\n        public static partial object PerThreadObject\n        {\n            get\n            {\n                if (_perThreadObject == null)\n                {\n                    _perThreadObject = new object();\n                }\n                return _perThreadObject;\n            }\n        }\n    }\n\n    public partial class Partial\n    {\n        [ThreadStatic]\n        public static object _perThreadObject; // Compliant\n        public static partial object PerThreadObject { get; }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ThreadStaticWithInitializer.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class ThreadStaticWithInitializer\n    {\n        public class Foo\n        {\n            [ThreadStatic]\n            public static object PerThreadObject = new object(); // Noncompliant {{Remove this initialization of 'PerThreadObject' or make it lazy.}}\n//                                               ^^^^^^^^^^^^^^\n\n            [ThreadStatic]\n            public static object _perThreadObject;\n\n            public static object StaticObject = new object();\n\n            [System.ThreadStatic]\n            public static object PerThreadObject2 = new object(); // Noncompliant\n\n            [ThreadStaticAttribute]\n            public static object PerThreadObject3 = new object(); // Noncompliant\n        }\n    }\n\n    public class ThreadStaticWithInitializerDerivedAttribute\n    {\n        public class Foo\n        {\n            [DerivedAttribute]\n            public static object PerThreadObject = new object(); // FN for performance reasons we decided not to handle derived classes\n        }\n\n        public class DerivedAttribute : ThreadStaticAttribute { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ThrowReservedExceptions.Latest.cs",
    "content": "﻿using System;\n\npublic class Sample\n{\n    public void NullCoalesce(object arg)\n    {\n        _ = arg ?? throw new Exception();   // Noncompliant\n        //               ^^^^^^^^^^^^^^^\n\n        _ = arg switch\n        {\n            string s => s,\n            _ => throw new Exception()      // Noncompliant\n            //         ^^^^^^^^^^^^^^^\n        };\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ThrowReservedExceptions.cs",
    "content": "﻿using System;\n\npublic class ThrowReservedExceptions\n{\n    public void Method1()\n    {\n        throw new Exception();                  // Noncompliant {{'System.Exception' should not be thrown by user code.}}\n//            ^^^^^^^^^^^^^^^\n\n        throw new ApplicationException();       // Noncompliant {{'System.ApplicationException' should not be thrown by user code.}}\n//            ^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n        throw new SystemException();            // Noncompliant {{'System.SystemException' should not be thrown by user code.}}\n//            ^^^^^^^^^^^^^^^^^^^^^\n\n        throw new ExecutionEngineException();   // Noncompliant {{'System.ExecutionEngineException' should not be thrown by user code.}}\n//            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n        throw new IndexOutOfRangeException();   // Noncompliant {{'System.IndexOutOfRangeException' should not be thrown by user code.}}\n//            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n        throw new NullReferenceException();     // Noncompliant {{'System.NullReferenceException' should not be thrown by user code.}}\n//            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n        throw new OutOfMemoryException();       // Noncompliant {{'System.OutOfMemoryException' should not be thrown by user code.}}\n//            ^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n        var e = new OutOfMemoryException(); // Compliant\n        throw new ArgumentNullException();  // Compliant\n\n        OutOfMemoryException e1 = (OutOfMemoryException)new ArgumentException(); // Error [CS0030] - cannot cast\n\n        try\n        {\n            var a = new int[0];\n            Console.WriteLine(a[1]); // Throw exception\n        }\n        catch (IndexOutOfRangeException)\n        {\n            throw; // Compliant\n        }\n    }\n\n    public void Arrow() =>\n        throw new Exception();          // Noncompliant\n\n    public Action Lambda() =>\n        () => throw new Exception();    // Noncompliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ThrowReservedExceptions.vb",
    "content": "﻿Public Class ThrowReservedExceptions\n    Public Sub Method1()\n        Throw New Exception()                   ' Noncompliant {{'System.Exception' should not be thrown by user code.}}\n        '     ^^^^^^^^^^^^^^^\n        Throw New ApplicationException()        ' Noncompliant {{'System.ApplicationException' should not be thrown by user code.}}\n        '     ^^^^^^^^^^^^^^^^^^^^^^^^^^\n        Throw New SystemException()             ' Noncompliant {{'System.SystemException' should not be thrown by user code.}}\n        '     ^^^^^^^^^^^^^^^^^^^^^\n        Throw New ExecutionEngineException()    ' Noncompliant {{'System.ExecutionEngineException' should not be thrown by user code.}}\n        '     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        Throw New IndexOutOfRangeException()    ' Noncompliant {{'System.IndexOutOfRangeException' should not be thrown by user code.}}\n        '     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        Throw New NullReferenceException()      ' Noncompliant {{'System.NullReferenceException' should not be thrown by user code.}}\n        '     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        Throw New OutOfMemoryException()        ' Noncompliant {{'System.OutOfMemoryException' should not be thrown by user code.}}\n        '     ^^^^^^^^^^^^^^^^^^^^^^^^^^\n        Dim e = New OutOfMemoryException()  ' Compliant\n        Throw New ArgumentNullException()   ' Compliant\n\n        Try\n            Dim a = New Integer(-1) {}\n            ' Throw exception\n            Console.WriteLine(a(1))\n        Catch generatedExceptionName As IndexOutOfRangeException ' Compliant\n            Throw\n        End Try\n    End Sub\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ToStringShouldNotReturnNull.Latest.cs",
    "content": "﻿using System;\n\npublic static class Condition\n{\n    public static bool When()\n    {\n        return true;\n    }\n}\n\nclass LocalFunctionReturnsNull\n{\n    public override string ToString()\n    {\n        return string.Empty;\n\n        static string Local()\n        {\n            return null; // Compliant\n        }\n    }\n}\n\nclass LambdaReturnsNull\n{\n    public override string ToString()\n    {\n        Func<string> expression = () => { return null; }; // Compliant\n        Func<string> statment = () => null; // Compliant\n        var simple = Simple(s => null); // Compliant\n        return string.Empty;\n    }\n\n    string Simple(Func<string, string> exp) => exp(null);\n}\n\nrecord RecordReturnsStringEmpty\n{\n    public override string ToString()\n    {\n        if (Condition.When())\n        { return string.Empty; }\n        return string.Empty;\n    }\n}\n\nrecord RecordReturnsNull\n{\n    public override string ToString()\n    {\n        if (Condition.When())\n        { return null; } // Noncompliant\n        return null; // Noncompliant\n    }\n}\n\npublic interface SomeInterface\n{\n    static virtual string ToString()\n    {\n        return null; // Compliant\n    }\n}\n\npublic interface SomeOtherInterface\n{\n    static abstract string ToString();\n}\n\npublic class SomeClass : SomeOtherInterface\n{\n    public static string ToString()\n    {\n        return null; // Compliant\n    }\n}\n\nstatic class Extensions\n{\n    extension(SomeClass s)\n    {\n        string ToString() { return null; }  // Compliant NET-2877\n    }\n}\n\nstatic class StaticExtensions\n{\n    extension(SomeClass)\n    {\n        static string ToString() { return null; }  // Compliant: static\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ToStringShouldNotReturnNull.TopLevelStatements.cs",
    "content": "﻿using System;\n\nstring ToString() { return null; } // Compliant, this is fine since it's not a ToString override\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ToStringShouldNotReturnNull.cs",
    "content": "﻿public static class Condition\n{\n    public static bool When()\n    {\n        return true;\n    }\n}\n\nnamespace Compliant\n{\n    class OtherMethodReturnsNullString\n    {\n        string Returns()\n        {\n            return null;\n        }\n    }\n\n    class ReturnsSomeString\n    {\n        public override string ToString()\n        {\n            if (Condition.When())\n            {\n                return \"Hello, world!\";\n            }\n            return \"Hello, world!\";\n        }\n    }\n\n    class ReturnsEmptyString\n    {\n        public override string ToString()\n        {\n            if (Condition.When())\n            {\n                return \"\";\n            }\n            return \"\";\n        }\n    }\n\n    class ReturnsStringEmpty\n    {\n        public override string ToString()\n        {\n            if (Condition.When())\n            {\n                return string.Empty;\n            }\n            return string.Empty;\n        }\n    }\n\n    struct ReturnsStringEmptyStruct\n    {\n        public override string ToString()\n        {\n            if (Condition.When()) { return string.Empty; }\n            return string.Empty;\n        }\n    }\n\n    class ToString\n    {\n        public string SomeMethod()\n        {\n            return null; // Compliant\n        }\n    }\n}\n\nclass Noncompliant\n{\n    public class ReturnsNull\n    {\n        public override string ToString()\n        {\n            if (Condition.When())\n            {\n                return null; // Noncompliant\n            //  ^^^^^^^^^^^^\n            }\n            return null; // Noncompliant {{Return an empty string instead.}}\n        }\n    }\n\n    public class ReturnsNullConditionaly\n    {\n        public override string ToString()\n        {\n            if (Condition.When())\n            {\n                return null; // Noncompliant\n            }\n            return \"not-null\";\n        }\n    }\n\n    public class ReturnsNullViaExpressionBody\n    {\n        public override string ToString() => null; // Noncompliant\n    }\n\n    public class ReturnsNullViaTernaryExpressionBody\n    {\n        public override string ToString() => Condition.When() ? null : string.Empty; // Noncompliant\n    }\n\n    public class ReturnsNullViaTernary\n    {\n        public override string ToString()\n        {\n            return Condition.When() ? null : \"\"; // Noncompliant\n        }\n    }\n\n    public class ReturnsNullViaNestedTenary\n    {\n        public override string ToString() => // Noncompliant\n            Condition.When()\n             ? (Condition.When() ? null : \"something\") \n             : (Condition.When() ? \"something\" : null);\n    }\n\n    struct StructReturnsNull\n    {\n        public override string ToString()\n        {\n            if (Condition.When()) { return null; } // Noncompliant\n            return null; // Noncompliant\n        }\n    }\n\n    public class SomeClass\n    {\n        public static string ToString()\n        {\n            return null; // Compliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ToStringShouldNotReturnNull.vb",
    "content": "﻿Imports System\n\nClass Condition\n    Shared Function [When]() As Boolean\n        Return True\n    End Function\nEnd Class\n\nNamespace Compliant\n    Class OtherMethodReturnsNothingString\n        Function Returns() As String\n            Return Nothing\n        End Function\n    End Class\n\n    Class ReturnsSomeString\n        Public Overrides Function ToString() As String\n            If Condition.[When]() Then\n                Return \"Hello, world!\"\n            End If\n\n            Return \"Hello, world!\"\n        End Function\n    End Class\n\n    Class ReturnsEmptyString\n        Public Overrides Function ToString() As String\n            If Condition.[When]() Then\n                Return \"\"\n            End If\n\n            Return \"\"\n        End Function\n    End Class\n\n    Class ReturnsStringEmpty\n        Public Overrides Function ToString() As String\n            If Condition.[When]() Then\n                Return String.Empty\n            End If\n\n            Return String.Empty\n        End Function\n    End Class\n\n    Class LambdaReturnsNothing\n        Public Overrides Function ToString() As String\n            Dim lambda As Func(Of String) =\n                Function() As String\n                    Return Nothing ' Compliant\n                End Function\n\n            Return String.Empty\n        End Function\n    End Class\n\n    Structure StructReturnsStringEmpty\n        Public Overrides Function ToString() As String\n            If Condition.[When]() Then\n                Return String.Empty\n            End If\n\n            Return String.Empty\n        End Function\n    End Structure\n\n    Class ToString\n\n        Public Function SomeMethod() As String\n            Return Nothing 'Compliant\n        End Function\n\n    End Class\n\n    Class BinaryConditionalExpressionNotSupported\n\n        Public Function SomeMethod() As String\n            Return If(Nothing, Nothing) ' Not supported, doesn't make sense\n        End Function\n\n    End Class\n\n    Class ToStringSharedMethod\n\n        Public Shared Function ToString() As String\n            Return Nothing\n        End Function\n\n    End Class\n\nEnd Namespace\n\nNamespace Noncompliant\n\n    Public Class ReturnsNothing\n        Public Overrides Function ToString() As String\n            If Condition.[When]() Then\n                Return Nothing ' Noncompliant\n            '   ^^^^^^^^^^^^^^\n            End If\n\n            Return Nothing ' Noncompliant {{Return an empty string instead.}}\n        End Function\n    End Class\n\n    Public Class ReturnsNothingConditionaly\n\n        Public Overrides Function ToString() As String\n            If Condition.[When]() Then\n                Return Nothing ' Noncompliant\n            End If\n\n            Return \"not-null\"\n        End Function\n    End Class\n\n    Public Class ReturnsNothingViaTernary\n        Public Overrides Function ToString() As String\n            Return If(Condition.[When](), Nothing, \"\")  ' Noncompliant\n        End Function\n    End Class\n\n    Public Class ReturnsNullViaNestedTenary\n\n        Public Overrides Function ToString() As String\n            Return If(Condition.When(), ' Noncompliant\n                If(Condition.When(), Nothing, \"something\"),\n                If(Condition.When(), \"something\", Nothing))\n        End Function\n\n    End Class\n\n    Structure StructReturnsNothing\n        Public Overrides Function ToString() As String\n            If Condition.[When]() Then\n                Return Nothing ' Noncompliant\n            End If\n\n            Return Nothing ' Noncompliant\n        End Function\n    End Structure\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TooManyGenericParameters.CustomValues.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    class Bar\n    {\n        public void Foo()\n        {\n        }\n\n        public void Foo<T>()\n        {\n        }\n\n        public void Foo<T1, T2>()\n        {\n        }\n\n        public void Foo<T1, T2, T3>()\n        {\n        }\n\n        public void Foo<T1, T2, T3, T4>()\n        {\n        }\n\n        public void Foo<T1, T2, T3, T4, T5>() // Noncompliant {{Reduce the number of generic parameters in the 'Bar.Foo' method to no more than the 4 authorized.}}\n//                  ^^^\n        {\n        }\n    }\n\n    class Bar<T>\n    {\n    }\n\n    class Bar<T1, T2>\n    {\n    }\n\n    class Bar<T1, T2, T3>\n    {\n    }\n\n    class Bar<T1, T2, T3, T4>\n    {\n    }\n\n    class Bar<T1, T2, T3, T4, T5> // Noncompliant {{Reduce the number of generic parameters in the 'Bar' class to no more than the 4 authorized.}}\n//        ^^^\n    {\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TooManyGenericParameters.DefaultValues.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    class Bar\n    {\n        public void Foo()\n        {\n        }\n\n        public void Foo<T>()\n        {\n        }\n\n        public void Foo<T1, T2>()\n        {\n        }\n\n        public void Foo<T1, T2, T3>()\n        {\n        }\n\n        public void Foo<T1, T2, T3, T4>() // Noncompliant  {{Reduce the number of generic parameters in the 'Bar.Foo' method to no more than the 3 authorized.}}\n//                  ^^^\n        {\n        }\n\n        public void Foo<T1, T2, T3, T4, T5>() // Noncompliant\n//                  ^^^\n        {\n        }\n    }\n\n    class Bar<T>\n    {\n    }\n\n    class Bar<T1, T2>\n    {\n    }\n\n    class Bar<T1, T2, T3> // Noncompliant {{Reduce the number of generic parameters in the 'Bar' class to no more than the 2 authorized.}}\n//        ^^^\n    {\n    }\n\n    class Bar<T1, T2, T3, T4> // Noncompliant\n//        ^^^\n    {\n    }\n\n    class Bar<T1, T2, T3, T4, T5> // Noncompliant\n//        ^^^\n    {\n    }\n\n    struct Str<T1, T2, T3> // Noncompliant {{Reduce the number of generic parameters in the 'Str' struct to no more than the 2 authorized.}}\n//         ^^^\n    {\n        public void Foo<T1, T2, T3>() { }\n\n        public void Foo<T1, T2, T3, T4>() { } // Noncompliant\n    }\n\n    interface IFoo<T1, T2, T3> // Noncompliant {{Reduce the number of generic parameters in the 'IFoo' interface to no more than the 2 authorized.}}\n//            ^^^^\n    {\n        void Foo<T1, T2, T3>();\n\n        void Foo<T1, T2, T3, T4>(); // Noncompliant\n//           ^^^\n    }\n}\n\nnamespace MyLib\n{\n    public abstract class FrameworkBaseClass<T1, T2, T3> // Noncompliant\n    {\n        void Method()\n        {\n            bool GenericLambda<T1, T2, T3, T4>() => true; // Noncompliant\n        }\n    }\n}\n\nnamespace TheProject\n{\n    using MyLib;\n\n    public class Impl : FrameworkBaseClass<int, double, bool>\n    {\n\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TooManyGenericParameters.Latest.cs",
    "content": "﻿using System;\n\nrecord Record\n{\n    public void Foo<T1, T2, T3>() { }\n    public void Foo<T1, T2, T3, T4>() { } // Noncompliant  {{Reduce the number of generic parameters in the 'Record.Foo' method to no more than the 3 authorized.}}\n//              ^^^\n}\n\nrecord PositionalRecord(int SomeProperty)\n{\n    public void Foo<T1, T2, T3>() { }\n    public void Foo<T1, T2, T3, T4>() { } // Noncompliant  {{Reduce the number of generic parameters in the 'PositionalRecord.Foo' method to no more than the 3 authorized.}}\n//              ^^^\n}\n\nrecord Record<T1, T2> { }\nrecord Record<T1, T2, T3> { } // Noncompliant {{Reduce the number of generic parameters in the 'Record' record to no more than the 2 authorized.}}\n\nrecord PositionalRecord<T1, T2>(int SomeProperty) { }\nrecord PositionalRecord<T1, T2, T3>(int SomeProperty) { } // Noncompliant {{Reduce the number of generic parameters in the 'PositionalRecord' record to no more than the 2 authorized.}}\n\nrecord struct RecordStruct\n{\n    public void Foo<T1, T2, T3>() { }\n    public void Foo<T1, T2, T3, T4>() { } // Noncompliant  {{Reduce the number of generic parameters in the 'RecordStruct.Foo' method to no more than the 3 authorized.}}\n    //          ^^^\n}\n\nrecord struct PositionalRecordStruct(int SomeProperty)\n{\n    public void Foo<T1, T2, T3>() { }\n    public void Foo<T1, T2, T3, T4>() { } // Noncompliant  {{Reduce the number of generic parameters in the 'PositionalRecordStruct.Foo' method to no more than the 3 authorized.}}\n}\n\nrecord struct RecordStruct<T1, T2> { }\nrecord struct RecordStruct<T1, T2, T3> { } // Noncompliant  {{Reduce the number of generic parameters in the 'RecordStruct' record struct to no more than the 2 authorized.}}\n//            ^^^^^^^^^^^^\n\nrecord struct PositionalRecordStruct<T1, T2>(int SomeProperty) { }\nrecord struct PositionalRecordStruct<T1, T2, T3>(int SomeProperty) { } // Noncompliant  {{Reduce the number of generic parameters in the 'PositionalRecordStruct' record struct to no more than the 2 authorized.}}\n\nclass SomeAttribute<T1, T2, T3, T4> : Attribute // Noncompliant\n{\n}\n\nclass Bar<T1, T2, T3>(string classParam) // Noncompliant\n{\n    void Method()\n    {\n        bool GenericLambda<T1, T2, T3, T4>(T1 lambdaParam = default(T1)) => true; // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TooManyGenericParameters.TopLevelStatements.cs",
    "content": "﻿void LocalFoo<T1, T2, T3>() { }\nvoid LocalBar<T1, T2, T3, T4>() { } // Noncompliant {{Reduce the number of generic parameters in the 'LocalBar' method to no more than the 3 authorized.}}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TooManyLabelsInSwitch.Latest.cs",
    "content": "﻿using System.Threading.Tasks;\nusing System;\n\nclass TaskWhenEach\n{\n    async Task Method(int n)\n    {\n        Task task1 = Task.Delay(100);\n        Task task2 = Task.Delay(100);\n        Task task3 = Task.Delay(100);\n\n        switch (n) // Noncompliant\n        {\n            case 0:\n                Console.WriteLine(\"0\");\n                break;\n            case 1:\n                Console.WriteLine(\"1\");\n                break;\n            case 2:\n                Console.WriteLine(\"2\");\n                break;\n            case 3:\n                await foreach (Task t in Task.WhenEach(task1, task2, task3))\n                {\n                    if (t.IsCompletedSuccessfully)\n                    {\n                        Console.WriteLine(\"Done!\");\n                    }\n                }\n                break;\n            case 4:\n                Console.WriteLine(\"4\");\n                return;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TooManyLabelsInSwitch.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class TooManyLabelsInSwitch\n    {\n        public enum MyEnum\n        {\n            A,\n            B,\n            C,\n            D\n        }\n\n        public TooManyLabelsInSwitch(int n, MyEnum en)\n        {\n            switch (n)\n            {\n                case 0:\n                    {\n                        {\n                            break;\n                        }\n                    }\n                default:\n                    break;\n            }\n\n            switch (n) // Noncompliant - Blocks are multiline statements\n            {\n                case 0:\n                    {\n                        break;\n                    }\n                case 1:\n                    {\n                        Console.WriteLine(\"\");\n                        break;\n                    }\n                case 2:\n                    {\n                        {\n                            break;\n                        }\n                    }\n            }\n\n            // Testing mutli-line statements ending with a break\n            switch (n) // Noncompliant\n            {\n                case 0:\n                    Console.WriteLine(\"0\");\n                    Console.WriteLine(\"With break\");\n                    break;\n                case 1:\n                    Console.WriteLine(\"1\");\n                    break;\n                case 2:\n                    Console.WriteLine(\"2\");\n                    break;\n            }\n\n            // Testing mutli-line statements ending with a return\n            switch (n) // Noncompliant\n            {\n                case 0:\n                    Console.WriteLine(\"0\");\n                    Console.WriteLine(\"Some return\");\n                    return;\n                case 1:\n                    Console.WriteLine(\"1\");\n                    break;\n                case 2:\n                    Console.WriteLine(\"2\");\n                    break;\n            }\n\n            // Testing mutli-line statements ending with a throw\n            switch (n) // Noncompliant\n            {\n                case 0:\n                    Console.WriteLine(\"0\");\n                    Console.WriteLine(\"0+0\");\n                    throw new InvalidOperationException();\n                case 1:\n                    Console.WriteLine(\"1\");\n                    break;\n                case 2:\n                    Console.WriteLine(\"2\");\n                    break;\n            }\n\n            switch (n) // Compliant\n            {\n                case 0:\n                    Console.WriteLine(\"0\");\n                    break;\n                case 1:\n                    Console.WriteLine(\"1\");\n                    break;\n                case 2:\n                    Console.WriteLine(\"2\");\n                    break;\n                case 3:\n                    Console.WriteLine(\"3\");\n                    throw new InvalidOperationException();\n                case 4:\n                    Console.WriteLine(\"4\");\n                    return;\n            }\n\n            switch (n)\n            {\n                case 0:\n                case 1:\n                case 2:\n                case 3:\n                    break;\n                default:\n                    break;\n            }\n\n            switch (en)\n            {\n                case MyEnum.A:\n                    break;\n                case MyEnum.B:\n                    break;\n                case MyEnum.C:\n                    break;\n                case MyEnum.D:\n                    break;\n                default:\n                    break;\n            }\n\n            switch (n) // Compliant\n            {\n                case 0:\n                case 1:\n                    break;\n                case 2:\n                    break;\n                default:\n                    break;\n            }\n        }\n\n        public int SwitchCase(char ch, int value)\n        {\n            switch (ch)  // Noncompliant {{Consider reworking this 'switch' to reduce the number of 'case' clauses to at most 2 or have only one statement per 'case'.}}\n//          ^^^^^^\n            {\n                case 'a':\n                    return 1;\n                case 'b':\n                    return 2;\n                case 'c':\n                    throw new NotImplementedException();\n                // ...\n                case '-':\n                    if (value > 10)\n                    {\n                        return 42;\n                    }\n                    else if (value < 5 && value > 1)\n                    {\n                        return 21;\n                    }\n                    return 99;\n                default:\n                    return 1000;\n            }\n        }\n\n        public int SwitchCaseWithCodeBlock(char ch, int value)\n        {\n            switch (ch)  // Noncompliant {{Consider reworking this 'switch' to reduce the number of 'case' clauses to at most 2 or have only one statement per 'case'.}}\n//          ^^^^^^\n            {\n                case 'a':\n                    return 1;\n                case 'b':\n                    throw new NotImplementedException();\n                case 'c':\n                    return 3;\n                // ...\n                case '-':\n                    {\n                        Console.WriteLine(\"Block\");\n                        return 99;\n                    }\n                default:\n                    return 1000;\n            }\n        }\n\n        public int SwitchCaseFallThrough(char ch, int value)\n        {\n            switch (ch) // Compliant\n            {\n                case 'a':\n                case 'b':\n                case 'c':\n                case '-':\n                    Console.WriteLine(\"This compliant\");\n                    Console.WriteLine(\"Because there is only fall through cases and less than 3 cases\");\n                    return 99;\n                default:\n                    return 1000;\n            }\n        }\n\n        public int FalseNegatives(int a)\n        {\n            // Single line if statements\n            switch (a) // Noncompliant\n            {\n                case 1:\n                    return 1;\n                case 2:\n                    throw new NotImplementedException();\n                case 3:\n                    return 3;\n                case 4:\n                    if (a > 42) return 21;\n                    return 42;\n                case 5:\n                    if (a > 42) return 21; else if (a < 21) return 3;\n                    return 42;\n            }\n\n            return 0;\n        }\n\n        public void TransparentLoops(int n)\n        {\n            switch (n) // Noncompliant\n            {\n                case 0:\n                    Console.WriteLine(\"0\");\n                    break;\n                case 1:\n                    Console.WriteLine(\"1\");\n                    break;\n                case 2:\n                    Console.WriteLine(\"2\");\n                    break;\n                case 3:\n                    foreach (var i in new[] { 1, 2, 3 })\n                    {\n                        Console.WriteLine(i);\n                    }\n                    break;\n                case 4:\n                    Console.WriteLine(\"4\");\n                    return;\n            }\n        }\n\n        public int Test(string type)\n        {\n            return type switch // Compliant\n            {\n                \"a\" => 1,\n                \"b\" => 2,\n                \"c\" => 3,\n                \"d\" => 4,\n                \"e\" => 5,\n                \"f\" => 6,\n                \"g\" => 7,\n                \"h\" => 8,\n                \"i\" => 9,\n                _ => 10\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TooManyLabelsInSwitch.vb",
    "content": "﻿Namespace Tests.Diagnostics\n    Public Class TooManyLabelsInSwitch\n        Public Enum MyEnum\n            A\n            B\n            C\n            D\n        End Enum\n\n        Public Sub New(ByVal n As Integer, ByVal en As MyEnum)\n            Select Case n\n                Case 0\n                Case Else\n            End Select\n\n            Select Case n\n                Case 0, 1, 2, 3\n                Case Else\n            End Select\n\n            Select Case n ' Compliant\n                Case 0\n                    Console.WriteLine(\"0\")\n                Case 1\n                    Console.WriteLine(\"1\")\n                Case 2\n                    Console.WriteLine(\"2\")\n                Case 3\n                    Console.WriteLine(\"3\")\n                    Throw New InvalidOperationException()\n                Case 4\n                    Console.WriteLine(\"4\")\n                    Return\n                Case Else\n            End Select\n\n            Select Case n ' Noncompliant\n                Case 0\n                    Console.WriteLine(\"0\")\n                    Console.WriteLine(\"0+0\")\n                    Return\n                Case 1\n                    Console.WriteLine(\"1\")\n                Case 2\n                    Console.WriteLine(\"2\")\n                Case Else\n            End Select\n\n            Select Case n ' Noncompliant\n                Case 0\n                    Console.WriteLine(\"0\")\n                    Console.WriteLine(\"0+0\")\n                    Throw New InvalidOperationException()\n                Case 1\n                    Console.WriteLine(\"1\")\n                Case 2\n                    Console.WriteLine(\"2\")\n                Case Else\n            End Select\n\n            Select Case en\n                Case MyEnum.A\n                Case MyEnum.B\n                Case MyEnum.C\n                Case MyEnum.D\n                Case Else\n            End Select\n\n            Select Case n ' Compliant\n                Case 0, 1\n                Case 2\n                Case Else\n            End Select\n        End Sub\n\n        Public Function SwitchCase(ch As Char, value As Integer) As Integer\n            Select Case ch ' Noncompliant {{Consider reworking this 'Select Case' to reduce the number of 'Case' clauses to at most 2 or have only one statement per 'Case'.}}\n'           ^^^^^^\n                Case \"a\"c\n                    Return 1\n                Case \"b\"c\n                    Return 2\n                Case \"c\"c\n                    Return 3\n                Case \"-\"c\n                    If value > 10 Then\n                        Return 42\n                    ElseIf value < 5 AndAlso value > 1 Then\n                        Return 21\n                    End If\n                    Return 99\n                Case Else\n                    Return 1000\n            End Select\n        End Function\n\n        Public Function FalseNegatives(a As Integer) As Integer\n            Select Case a ' Noncompliant\n                Case 1\n                    Return 1\n                Case 2\n                    Throw New NotImplementedException()\n                Case 3\n                    Return 3\n                Case 4\n                    If a > 42 Then Return 21\n                    Return 42\n                Case 5\n                    If a > 42 Then Return 21 Else If a < 21 Then Return 3\n                    Return 42\n                Case Else\n                    Return 0\n            End Select\n                           End Function\n\n        Public Function SwitchCaseFallThrough(ch As Char, value As Integer) As Integer\n            Select Case ch\n                Case \"a\"c, \"b\"c, \"c\"c, \"-\"c\n                    If value > 10 Then\n                        Return 42\n                    ElseIf value < 5 AndAlso value > 1 Then\n                        Return 21\n                    End If\n                    Return 99\n                Case Else\n                    Return 1000\n            End Select\n        End Function\n\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TooManyLoggingCalls.Castle.Core.Logging.cs",
    "content": "﻿using System;\nusing Castle.Core.Logging;\n\npublic class Program\n{\n    public void Log_Debug(ILogger logger)\n    {\n        logger.Debug(\"Debug 1\");                                    // Noncompliant\n        logger.Debug(\"Debug 2\", new Exception());                   // Secondary\n        logger.DebugFormat(\"Debug 3: {0}\", 42);                     // Secondary\n        logger.DebugFormat(\"Debug 4: {0} {1}\", 42, 42);             // Secondary\n        logger.Debug(\"Debug 5\");                                    // Secondary\n\n        while (true)\n        {\n            logger.Debug(\"Debug 1\");                                // Compliant\n            logger.Debug(\"Debug 2\", new Exception());\n            logger.DebugFormat(\"Debug 3: {0}\", 42);\n            logger.DebugFormat(\"Debug 4: {0} {1}\", 42, 42);\n        }\n    }\n\n    public void Log_Trace(ILogger logger)\n    {\n        logger.Trace(\"Trace 1\");                                    // Noncompliant - FP NET-3295\n        logger.Trace(\"Trace 2\", new Exception());                   // Secondary - FP NET-3295\n        logger.TraceFormat(\"Trace 3: {0}\", 42);                     // Secondary - FP NET-3295\n        logger.TraceFormat(\"Trace 4: {0} {1}\", 42, 42);             // Secondary - FP NET-3295\n        logger.Trace(\"Trace 5\");                                    // Secondary - FP NET-3295\n\n        while (true)\n        {\n            logger.Trace(\"Trace 1\");                                // Compliant\n            logger.Trace(\"Trace 2\", new Exception());\n            logger.TraceFormat(\"Trace 3: {0}\", 42);\n            logger.TraceFormat(\"Trace 4: {0} {1}\", 42, 42);\n        }\n    }\n\n    public void Log_Error(ILogger logger)\n    {\n        logger.Error(\"Error 1\");                                    // Noncompliant\n        logger.ErrorFormat(\"Error 2: {0}\", 42);                     // Secondary\n        logger.Fatal(\"Error 3\");                                    // Secondary\n        logger.FatalFormat(\"Error 4: {0}\", 42);                     // Secondary\n\n        while (true)\n        {\n            logger.Error(\"Error 1\");                                // Compliant\n        }\n    }\n\n    public void Log_Information(ILogger logger)\n    {\n        logger.Info(\"Info 1\");                                      // Noncompliant\n        logger.Info(\"Info 2\", new Exception());                     // Secondary\n        logger.InfoFormat(\"Info 3: {0}\", 42);                       // Secondary\n\n        while (true)\n        {\n            logger.Info(\"Info 1\");                                  // Compliant\n            logger.Info(\"Info 2\", new Exception());\n        }\n    }\n\n    public void Log_Warning(ILogger logger)\n    {\n        logger.Warn(\"Warn 1\");                                      // Noncompliant\n        logger.WarnFormat(\"Warn 2: {0}\", 42);                       // Secondary\n\n\n        while (true)\n        {\n            logger.Warn(\"Warn 1\");                                  // Compliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TooManyLoggingCalls.Log4Net.cs",
    "content": "﻿using System;\nusing log4net;\n\npublic class Program\n{\n    public void Log_Debug(ILog logger)\n    {\n        logger.Debug(\"Debug 1\");                                    // Noncompliant\n        logger.Debug(\"Debug 2\", new Exception());                   // Secondary\n        logger.DebugFormat(\"Debug 4: {0}\", 42);                     // Secondary\n        logger.DebugFormat(\"Debug 5: {0} {1}\", 42, 42);             // Secondary\n        logger.Debug(\"Debug 5\");                                    // Secondary\n\n        while (true)\n        {\n            logger.Debug(\"Debug 1\");                                // Compliant\n            logger.Debug(\"Debug 2\", new Exception());\n            logger.DebugFormat(\"Debug 4: {0}\", 42);\n            logger.DebugFormat(\"Debug 5: {0} {1}\", 42, 42);\n        }\n    }\n\n    public void Log_Error(ILog logger)\n    {\n        logger.Error(\"Error 1\");                                    // Noncompliant\n        logger.ErrorFormat(\"Error 2: {0}\", 42);                     // Secondary\n        logger.Fatal(\"Error 3\");                                    // Secondary\n        logger.FatalFormat(\"Error 4: {0}\", 42);                     // Secondary\n\n        while (true)\n        {\n            logger.Error(\"Error 1\");                                // Compliant\n        }\n    }\n\n    public void Log_Information(ILog logger)\n    {\n        logger.Info(\"Info 1\");                                      // Noncompliant\n        logger.Info(\"Info 2\", new Exception());                     // Secondary\n        logger.InfoFormat(\"Info 3: {0}\", 42);                       // Secondary\n\n        while (true)\n        {\n            logger.Info(\"Info 1\");                                  // Compliant\n            logger.Info(\"Info 2\", new Exception());\n        }\n    }\n\n    public void Log_Warning(ILog logger)\n    {\n        logger.Warn(\"Warn 1\");                                      // Noncompliant\n        logger.WarnFormat(\"Warn 2: {0}\", 42);                       // Secondary\n\n\n        while (true)\n        {\n            logger.Warn(\"Warn 1\");                                  // Compliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TooManyLoggingCalls.Microsoft.Extensions.Logging.cs",
    "content": "﻿using System;\nusing Microsoft.Extensions.Logging;\n\npublic class Program\n{\n    public void Log_Debug(ILogger logger)\n    {\n        logger.LogDebug(\"Debug 1\");                                     // Noncompliant\n        logger.LogDebug(\"Debug 2: {Arg}\", 42);                          // Secondary\n        logger.LogDebug(new Exception(), \"Debug 2\");                    // Secondary\n        logger.LogTrace(\"Debug 4\");                                     // Secondary - FP NET-3295\n        logger.LogTrace(\"Debug 5: {Arg}\", 42);                          // Secondary - FP NET-3295\n        logger.LogTrace(new Exception(), \"Debug 6\");                    // Secondary - FP NET-3295\n        logger.Log(LogLevel.Debug, \"Debug 7\");                          // Secondary\n        logger.Log(LogLevel.Trace, \"Debug 8\");                          // Secondary - FP NET-3295\n\n        while (true)\n        {\n            logger.LogDebug(\"Debug 1\");                                 // Compliant\n            logger.LogDebug(\"Debug 2: {Arg}\", 42);\n            logger.LogDebug(new Exception(), \"Debug 2\");\n            logger.LogTrace(\"Debug 4\");\n        }\n    }\n\n    public void Log_Error(ILogger logger)\n    {\n        logger.LogError(\"Error 1\");                                     // Noncompliant\n        logger.LogError(\"Error 2: {Arg}\", 42);                          // Secondary\n        logger.LogCritical(\"Error 3\");                                  // Secondary\n        logger.LogCritical(\"Error 4: {Arg}\", 42);                       // Secondary\n        logger.Log(LogLevel.Error, \"Error 5\");                          // Secondary\n        logger.Log(LogLevel.Critical, \"Error 6\");                       // Secondary\n\n        while (true)\n        {\n            logger.LogError(\"Error 1\");                                 // Compliant\n        }\n    }\n\n    public void Log_Information(ILogger logger)\n    {\n        logger.LogInformation(\"Info 1\");                                // Noncompliant\n        logger.LogInformation(new Exception(), \"Info 2\");               // Secondary\n        logger.LogInformation(\"Info 3: {Arg}\", 42);                     // Secondary\n        logger.Log(LogLevel.Information, \"Info 4\");                     // Secondary\n\n        while (true)\n        {\n            logger.LogInformation(\"Info 1\");                            // Compliant\n            logger.LogInformation(new Exception(), \"Info 2\");\n        }\n    }\n\n    public void Log_Warning(ILogger logger)\n    {\n        logger.LogWarning(\"Warn 1\");                                    // Noncompliant\n        logger.LogWarning(new Exception(), \"Warn 2\");                   // Secondary\n        logger.LogWarning(\"Warn 3: {Arg}\", 42);                         // Secondary\n        logger.Log(LogLevel.Warning, \"Warn 4\");                         // Secondary\n\n        while (true)\n        {\n            logger.LogWarning(\"Warn 1\");                                // Compliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TooManyLoggingCalls.NLog.cs",
    "content": "﻿using System;\nusing NLog;\n\npublic class Program\n{\n    public void Log_Debug(ILogger logger)\n    {\n        logger.Debug(\"Debug 1\");                                    // Noncompliant\n        logger.Debug(\"Debug 2: {Arg}\", 42);                         // Secondary\n        logger.Debug(new Exception(), \"Debug 2\");                   // Secondary\n        logger.Trace(\"Debug 4\");                                    // Secondary - FP NET-3295\n        logger.Trace(\"Debug 5: {Arg}\", 42);                         // Secondary - FP NET-3295\n        logger.Trace(new Exception(), \"Debug 6\");                   // Secondary - FP NET-3295\n        logger.ConditionalDebug(\"Debug 7\");                         // Secondary\n        logger.ConditionalDebug(\"Debug 8: {Arg}\", 42);              // Secondary\n        logger.ConditionalDebug(new Exception(), \"Debug 9\");        // Secondary\n        logger.ConditionalTrace(\"Debug 10\");                        // Secondary - FP NET-3295\n        logger.ConditionalTrace(\"Debug 11: {Arg}\", 42);             // Secondary - FP NET-3295\n        logger.ConditionalTrace(new Exception(), \"Debug 12\");       // Secondary - FP NET-3295\n\n        while (true)\n        {\n            logger.Debug(\"Debug 1\");                                // Compliant\n            logger.Trace(\"Debug 2\");\n            logger.ConditionalDebug(\"Debug 3\");\n            logger.ConditionalTrace(\"Debug 4\");\n        }\n    }\n\n    public void Log_Error(ILogger logger)\n    {\n        logger.Error(\"Error 1\");                                    // Noncompliant\n        logger.Error(\"Error 2: {Arg}\", 42);                         // Secondary\n        logger.Fatal(\"Error 3\");                                    // Secondary\n        logger.Fatal(\"Error 4: {Arg}\", 42);                         // Secondary\n\n        while (true)\n        {\n            logger.Error(\"Error 1\");                                // Compliant\n        }\n    }\n\n    public void Log_Information(ILogger logger)\n    {\n        logger.Info(\"Info 1\");                                      // Noncompliant\n        logger.Info(new Exception(), \"Info 2\");                     // Secondary\n        logger.Info(\"Info 3: {Arg}\", 42);                           // Secondary\n        logger.Info(\"Info 4: {Arg1} {Arg2}\", 42, 42);               // Secondary\n\n        while (true)\n        {\n            logger.Info(\"Info 1\");                                  // Compliant\n            logger.Info(new Exception(), \"Info 2\");\n        }\n    }\n\n    public void Log_Warning(ILogger logger)\n    {\n        logger.Warn(\"Warn 1\");                                      // Noncompliant\n        logger.Warn(new Exception(), \"Warn 2\");                     // Secondary\n        logger.Warn(\"Warn 3: {Arg}\", 42);                           // Secondary\n        logger.Warn(\"Warn 4: {Arg1} {Arg2}\", 42, 42);               // Secondary\n\n        while (true)\n        {\n            logger.Warn(\"Warn 1\");                                  // Compliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TooManyLoggingCalls.Serilog.cs",
    "content": "﻿using System;\nusing Serilog;\nusing Serilog.Events;\nusing static Serilog.Log;\n\npublic class Program\n{\n    public void Log_Debug()\n    {\n        Log.Debug(\"Debug 1\");                                       // Noncompliant\n        Log.Debug(\"Debug 2\", new Exception());                      // Secondary\n        Log.Verbose(\"Debug 3\");                                     // Secondary\n        Log.Verbose(\"Debug 5: {Arg1} {Arg2}\", 42, 42);              // Secondary\n        Log.Write(LogEventLevel.Debug, \"Debug 6\");                  // Secondary\n        Log.Write(LogEventLevel.Verbose, \"Debug 7\");                // Secondary\n\n        while (true)\n        {\n            Log.Debug(\"Debug 1\");                                   // Compliant\n            Log.Debug(\"Debug 2\", new Exception());\n            Log.Verbose(\"Debug 3\");\n            Log.Verbose(\"Debug 5: {Arg1} {Arg2}\", 42, 42);\n        }\n    }\n\n    public void Log_Error()\n    {\n        Log.Error(\"Error 1\");                                       // Noncompliant\n        Log.Error(\"Error 2: {Arg}\", 42);                            // Secondary\n        Log.Fatal(\"Error 3\");                                       // Secondary\n        Log.Fatal(\"Error 4: {Arg}\", 42);                            // Secondary\n        Log.Write(LogEventLevel.Error, \"Error 6\");                  // Secondary\n        Log.Write(LogEventLevel.Fatal, \"Error 7\");                  // Secondary\n\n        while (true)\n        {\n            Log.Error(\"Error 1\");                                   // Compliant\n        }\n    }\n\n    public void Log_Information()\n    {\n        Log.Information(\"Info 1\");                                  // Noncompliant\n        Log.Information(\"Info 2\", new Exception());                 // Secondary\n        Log.Information(\"Info 3: {Arg}\", 42);                       // Secondary\n        Log.Write(LogEventLevel.Information, \"Info 4\");             // Secondary\n\n        while (true)\n        {\n            Log.Information(\"Info 1\");                              // Compliant\n            Log.Information(\"Info 2\", new Exception());\n        }\n    }\n\n    public void Log_Warning()\n    {\n        Log.Warning(\"Warn 1\");                                      // Noncompliant\n        Log.Warning(\"Warn 2\", new Exception());                     // Secondary\n        Log.Warning(\"Warn 3: {Arg}\", 42);                           // Secondary\n        Log.Write(LogEventLevel.Warning, \"Info 4\");                 // Secondary\n\n        while (true)\n        {\n            Log.Warning(\"Warn 1\");                                  // Compliant\n        }\n    }\n\n    public void Log_ILogger(ILogger logger)\n    {\n        logger.Error(\"Error 1\");                                    // Noncompliant\n        logger.Error(\"Error 2: {Arg}\", 42);                         // Secondary\n\n        Log.Warning(\"Warn 1\");                                      // Compliant\n    }\n\n    public void Log_UsingStatic(ILogger logger)\n    {\n        Error(\"Error 1\");                                           // Noncompliant\n        Error(\"Error 2: {Arg}\", 42);                                // Secondary\n\n        Warning(\"Warn 1\");                                          // Compliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TooManyLoggingCalls.cs",
    "content": "﻿using System;\nusing Microsoft.Extensions.Logging;\nusing AliasedLogger = Microsoft.Extensions.Logging.ILogger;\n\npublic class Program\n{\n    private ILogger logger;\n\n    public void Noncompliant_Basic()\n    {\n        logger.LogInformation(\"Info 1\");    // Noncompliant {{Reduce the number of Information logging calls within this code block from 3 to the 2 allowed.}}\n//      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        logger.LogInformation(\"Info 2\");    // Secondary {{Reduce the number of Information logging calls within this code block from 3 to the 2 allowed.}}\n        logger.LogInformation(\"Info 3\");    // Secondary {{Reduce the number of Information logging calls within this code block from 3 to the 2 allowed.}}\n\n        logger.LogError(\"Error 1\");         // Noncompliant {{Reduce the number of Error logging calls within this code block from 2 to the 1 allowed.}}\n        logger.LogError(\"Error 2\");         // Secondary\n    }\n\n    public void Compliant_Basic()\n    {\n        logger.LogInformation(\"Info 1\");    // Compliant - the number of calls in the same block doesn't exceed the treshold\n        logger.LogInformation(\"Info 2\");\n\n        logger.LogDebug(\"Debug 1\");\n        logger.LogDebug(\"Debug 2\");\n        logger.LogDebug(\"Debug 3\");\n        logger.LogDebug(\"Debug 4\");\n\n        logger.LogError(\"Error 1\");\n\n        logger.LogWarning(\"Warning 1\");\n    }\n\n    public void DifferentMethods_InSameLoggingCategory()\n    {\n        logger.LogDebug(\"Debug 1\");         // Noncompliant\n        logger.LogDebug(\"Debug 2\");         // Secondary\n        logger.LogTrace(\"Trace 1\");         // Secondary\n        logger.LogTrace(\"Trace 2\");         // Secondary\n        logger.LogTrace(\"Trace 3\");         // Secondary\n\n        logger.LogError(\"Error 1\");         // Noncompliant\n        logger.LogCritical(\"Critical 1\");   // Secondary\n    }\n\n    public void MethodsInSameBlock_SeparatedByOtherBlocks_AreCountedTogether()\n    {\n        logger.LogInformation(\"Info 1\");    // Noncompliant\n\n        if (true)\n        {\n            Console.WriteLine();\n        }\n\n        logger.LogInformation(\"Info 2\");    // Secondary\n\n        for (int i = 0; i < 10; i++)\n        {\n            Console.WriteLine();\n        }\n\n        logger.LogInformation(\"Info 3\");    // Secondary\n    }\n\n    public void MethodsInDifferntBlocks_AreNotCountedTogether()\n    {\n        logger.LogInformation(\"Info 1\");    // Compliant - the logging method count could exceed the treshold if they were in the same block, but they aren't\n\n        if (true)\n        {\n            logger.LogInformation(\"Info 2\");\n        }\n\n        for (int i = 0; i < 10; i++)\n        {\n            logger.LogInformation(\"Info 3\");\n\n            for (int j = 0; j < 10; j++)\n            {\n                logger.LogInformation(\"Info 4\");\n            }\n        }\n    }\n\n    public void NestedBlocks()\n    {\n        if (true)\n        {\n            logger.LogInformation(\"Info 1\");    // Noncompliant\n            logger.LogInformation(\"Info 2\");    // Secondary\n            logger.LogInformation(\"Info 3\");    // Secondary\n        }\n\n        for (int i = 0; i < 10; i++)\n        {\n            logger.LogError(\"Error 1\");         // Noncompliant\n\n            for (int j = 0; j < 10; j++)\n            {\n                logger.LogWarning(\"Warning 1\"); // Noncompliant\n                logger.LogWarning(\"Warning 2\"); // Secondary\n            }\n\n            logger.LogError(\"Error 2\");         // Secondary\n        }\n    }\n\n    public void MethodOverloads(int arg1, int arg2)\n    {\n        logger.LogDebug(\"Debug 1\");                                                     // Noncompliant\n        logger.LogDebug(\"Debug 2: {Arg1}\", arg1);                                       // Secondary\n        logger.LogDebug(\"Debug 3: {Arg1} {Arg2}\", arg1, arg2);                          // Secondary\n        logger.LogDebug(new EventId(42), \"Debug 4: {Arg1}\", arg1);                      // Secondary\n        logger.LogDebug(new EventId(42), new Exception(), \"Debug 5: {Arg1}\", arg1);     // Secondary\n\n        logger.LogError(\"Error 1\");                                                     // Noncompliant\n        logger.LogError(new EventId(42), new Exception(), \"Error 2: {Arg1}\", arg1);     // Secondary\n    }\n\n    public void LogMethod_WithLogLevelParameter()\n    {\n        logger.Log(LogLevel.Debug, \"Debug 1\");                      // Noncompliant\n        logger.Log(message: \"Debug 2\", logLevel: LogLevel.Trace);   // Secondary\n        logger.LogDebug(\"Debug 3\");                                 // Secondary\n        logger.LogTrace(\"Debug 4\");                                 // Secondary\n        logger.Log(LogLevel.Debug, \"Debug 5\");                      // Secondary\n\n        logger.Log(LogLevel.Error, \"Error 1\");                      // Noncompliant\n        logger.LogError(\"Error 2\");                                 // Secondary\n\n        logger.Log(LogLevel.None, \"None 1\");                        // Compliant - LogLevel.None doesn't fall to any of the tracked logging categories\n        logger.Log(LogLevel.None, \"None 2\");\n        logger.Log(LogLevel.None, \"None 3\");\n        logger.Log(LogLevel.None, \"None 4\");\n        logger.Log(LogLevel.None, \"None 5\");\n    }\n\n    public void LocalMethodsAndLambdas()\n    {\n        Action<int> simpleLambda = arg =>\n        {\n            logger.LogError(\"Error 1\");                             // Noncompliant\n            logger.LogError(\"Error 2\");                             // Secondary\n        };\n\n        Action parenthesizedLambda = () =>\n        {\n            logger.LogError(\"Error 1\");                             // Noncompliant\n            logger.LogError(\"Error 2\");                             // Secondary\n        };\n\n        Action methodDelegate = delegate()\n        {\n            logger.LogError(\"Error 1\");                             // Noncompliant\n            logger.LogError(\"Error 2\");                             // Secondary\n        };\n\n        Action a1 = () => logger.LogInformation(\"Information 1\");   // Compliant - the log methods are in different lambdas\n        Action a2 = () => logger.LogInformation(\"Information 2\");\n        Action a3 = () => logger.LogInformation(\"Information 3\");\n\n        Action<string> LogWarning = message => Console.WriteLine(\"Warning: \" + message);\n        LogWarning(\"Warning 1\");                                    // Compliant - the method is not from known logging frameworks\n        LogWarning(\"Warning 2\");\n\n        void LocalFunction()\n        {\n            logger.LogError(\"Error 1\");                             // Noncompliant\n            logger.LogError(\"Error 2\");                             // Secondary\n        }\n    }\n\n    public void IfStatements(int arg)\n    {\n        if (arg == 0)\n        {\n            logger.LogError(\"Error 1\");         // Noncompliant\n            logger.LogError(\"Error 2\");         // Secondary\n        }\n        else if (arg == 1)\n        {\n            logger.LogError(\"Error 1\");         // Noncompliant\n            logger.LogError(\"Error 2\");         // Secondary\n        }\n        else\n        {\n            logger.LogError(\"Error 1\");         // Noncompliant\n            logger.LogError(\"Error 2\");         // Secondary\n        }\n\n        if (arg == 0)\n            logger.LogError(\"Error 1\");         // Compliant - only one logging statement in each branch\n        else if (arg == 1)\n            logger.LogError(\"Error 2\");\n        else\n            logger.LogError(\"Error 2\");\n    }\n\n\n    public void SwitchStatements(int arg)\n    {\n        switch (arg)\n        {\n            case 0:\n                logger.LogError(\"Error 1\");             // Compliant - the logging methods are in different branches\n                break;\n            default:\n                logger.LogError(\"Error 2\");\n                break;\n        }\n\n        switch (arg)\n        {\n            case 0:\n                logger.LogWarning(\"Warning 1\");         // FN\n                logger.LogWarning(\"Warning 2\");\n                break;\n            case 1:\n                break;\n        }\n    }\n\n    public void UsingAliasedLogger(AliasedLogger aliasedLogger)\n    {\n        aliasedLogger.LogError(\"Error 1\");              // Noncompliant\n        aliasedLogger.LogError(\"Error 2\");              // Secondary\n    }\n\n    public void LoggerExtensionMethods()\n    {\n        LoggerExtensions.LogError(logger, \"Error 1\");   // Noncompliant\n        logger.LogError(\"Error 2\");                     // Secondary\n    }\n\n    public int Property\n    {\n        get\n        {\n            logger.LogError(\"Error 1\");                 // Noncompliant\n            logger.LogError(\"Error 2\");                 // Secondary\n            return 42;\n        }\n        set\n        {\n            logger.LogError(\"Error 1\");                 // Noncompliant\n            logger.LogError(\"Error 2\");                 // Secondary\n        }\n    }\n\n    public event EventHandler MyEvent\n    {\n        add\n        {\n            logger.LogError(\"Error 1\");                 // Noncompliant\n            logger.LogError(\"Error 2\");                 // Secondary\n        }\n        remove\n        {\n            logger.LogError(\"Error 1\");                 // Noncompliant\n            logger.LogError(\"Error 2\");                 // Secondary\n        }\n    }\n}\n\nnamespace MyNamespace\n{\n    public interface ILogger { }\n    public static class FakeLoggerExtensions\n    {\n        public static void LogError(this ILogger logger, string message) { }\n    }\n\n    public class Test\n    {\n        public void FakeLoggerMethods(ILogger logger)\n        {\n            FakeLoggerExtensions.LogError(logger, \"Error 1\");   // Compliant - not a supported logger type\n            logger.LogError(\"Error 2\");\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TooManyParameters_CustomValues.Latest.cs",
    "content": "﻿using System;\nusing System.Runtime.InteropServices;\n\npublic record R(int a, int b, int c, int d, int e); // Compliant, this ParameterList syntax defines fields, not parameters\n\npublic record BaseRecord\n{\n    public BaseRecord(int i1, int i2, int i3, int i4) // Noncompliant\n    {\n    }\n}\n\npublic record Extend : BaseRecord\n{\n    public Extend(int i1, int i2, int i3, int i4, string s1)    // Compliant, adds only one new\n        : base(i1, i2, i3, i4)\n    {\n    }\n\n    public Extend(int i1, int i2, int i3, int i4, string s1, string s2, string s3, string s4)   // Noncompliant {{Constructor has 4 new parameters, which is greater than the 3 authorized.}}\n        : base(i1, i2, i3, i4)\n    {\n    }\n}\npublic class TooManyParameters : If\n{\n    public static void F1(int p1, int p2, int p3) { }\n\n    public static void F2(int p1, int p2, int p3, int p4) { } // Compliant, interface implementation\n\n    public static void F1(int p1, int p2, int p3, int p4) { } // Noncompliant {{Method has 4 parameters, which is greater than the 3 authorized.}}\n}\n\npublic interface If\n{\n    static abstract void F1(int p1, int p2, int p3);\n    static abstract void F2(int p1, int p2, int p3, int p4); // Noncompliant\n}\n\npublic unsafe partial class LibraryImportAttributeImports\n{\n    [LibraryImport(\"foo.dll\")]\n    public static partial void ExternWithoutMarshaling(int p1, int p2, int p3, int p4); // Compliant, external definition\n\n    // Provide the implementation usually generated by the source generator:\n    // Copy the partial definition with the LibraryImport attribute to a .Net 7 file and use GotoDefinition to see the generated code\n    [System.Runtime.InteropServices.DllImportAttribute(\"foo.dll\", EntryPoint = \"Extern\", ExactSpelling = true)]\n    public static extern partial void ExternWithoutMarshaling(int p1, int p2, int p3, int p4);\n\n    [LibraryImport(\"nativelib\", EntryPoint = \"ExternWithMarshaling\", StringMarshalling = StringMarshalling.Utf16)]\n    internal static partial string ExternWithMarshaling(string str, int p1, int p2, int p3, int p4); // Compliant, external definition\n\n    // Provide the implementation usually generated by the source generator.\n    // Copy the partial definition with the LibraryImport attribute to a .Net 7 file and use GotoDefinition to see the generated code\n    [System.Runtime.CompilerServices.SkipLocalsInitAttribute]\n    internal static partial string ExternWithMarshaling(string str, int p1, int p2, int p3, int p4)\n    {\n        string __retVal;\n        ushort* __retVal_native = default;\n        try\n        {\n            // Pin - Pin data in preparation for calling the P/Invoke.\n            fixed (void* __str_native = &global::System.Runtime.InteropServices.Marshalling.Utf16StringMarshaller.GetPinnableReference(str))\n            {\n                __retVal_native = __PInvoke((ushort*)__str_native, p1, p2, p3, p4);\n            }\n\n            // Unmarshal - Convert native data to managed data.\n            __retVal = global::System.Runtime.InteropServices.Marshalling.Utf16StringMarshaller.ConvertToManaged(__retVal_native);\n        }\n        finally\n        {\n            // Cleanup - Perform required cleanup.\n            global::System.Runtime.InteropServices.Marshalling.Utf16StringMarshaller.Free(__retVal_native);\n        }\n\n        return __retVal;\n        // Local P/Invoke\n        [System.Runtime.InteropServices.DllImportAttribute(\"nativelib\", EntryPoint = \"ExternWithMarshaling\", ExactSpelling = true)]\n        static extern unsafe ushort* __PInvoke(ushort* str, int p1, int p2, int p3, int p4);\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/8156\nnamespace Repro_8156\n{\n    using System.Runtime.CompilerServices;\n\n    class ZeroOverheadMemberAccess\n    {\n        [UnsafeAccessor(UnsafeAccessorKind.Constructor)]\n        extern static UserData CallConstructor(int x1, int x2, int x3, int x4);                 // Compliant: signature has to match target\n\n        [UnsafeAccessorAttribute(UnsafeAccessorKind.Method, Name = \"Method\")]\n        extern static void CallMethod(UserData userData, int x1, int x2, int x3, int x4);       // Compliant: signature has to match target\n\n        [UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = \"StaticMethod\")]\n        extern static void CallStaticMethod(UserData userData, int x1, int x2, int x3, int x4); // Compliant: signature has to match target\n    }\n\n    class UserData\n    {\n        UserData(int x1, int x2, int x3, int x4) { }         // Noncompliant\n\n        void Method(int x1, int x2, int x3) { }              // Compliant\n        static void StaticMethod(int x1, int x2, int x3) { } // Compliant\n    }\n}\n\npublic class MyWrongClass(int p1, int p2, int p3, int p4) { } // Noncompliant {{Constructor has 4 parameters, which is greater than the 3 authorized.}}\n\npublic class SubClass(int p1, int p2, int p3, int p4) : MyWrongClass(p1, p2, p3, p4) { } // Compliant: base class requires them\n\npublic class SubClass2() : MyWrongClass(1, 2, 3, 4) // Compliant\n{\n    public SubClass2(int p1, int p2, int p3, int p4, int p5) : this() { } // Noncompliant\n\n    void Method()\n    {\n        var a = (int p1 = 1, int p2 = 2, int p3 = 3, int p4 = 4) => true; // Noncompliant {{Lambda has 4 parameters, which is greater than the 3 authorized.}}\n    }\n}\n\npublic struct MyWrongStruct(int p1, int p2, int p3, int p4) { } // Noncompliant {{Constructor has 4 parameters, which is greater than the 3 authorized.}}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TooManyParameters_CustomValues.TopLevelStatements.cs",
    "content": "﻿var topLevel = true;\n\nvoid LocalFunctionInTopLevelStatement(int a, int b, int c, int d, int e) // Noncompliant\n{\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TooManyParameters_CustomValues.cs",
    "content": "﻿using System;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\nnamespace Tests.Diagnostics\n{\n    public class TooManyParameters : If\n    {\n        public int this[int a, int b, int c, int d]\n        {\n            get\n            {\n                return a;\n            }\n        }\n\n        ~TooManyParameters()\n        {\n        }\n\n        public TooManyParameters(int p1, int p2, int p3) { }\n        public TooManyParameters(int p1, int p2, int p3, int p4) { } // Noncompliant\n//                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n        public void F1(int p1, int p2, int p3) { }\n\n        public void F2(int p1, int p2, int p3, int p4) { } // Compliant, interface implementation\n\n        public void F1(int p1, int p2, int p3, int p4) { } // Noncompliant {{Method has 4 parameters, which is greater than the 3 authorized.}}\n\n        public void F()\n        {\n            var v1 = new Action<int, int, int>(delegate (int p1, int p2, int p3) { Console.WriteLine(); });\n            var v2 = new Action<int, int, int, int>(delegate (int p1, int p2, int p3, int p4) { Console.WriteLine(); }); // Noncompliant {{Delegate has 4 parameters, which is greater than the 3 authorized.}}\n            var v3 = new Action(delegate { });\n            var v4 = new Action<int, int, int>((int p1, int p2, int p3) => Console.WriteLine());\n            var v5 = new Action<int, int, int, int>((int p1, int p2, int p3, int p4) => Console.WriteLine()); // Noncompliant {{Lambda has 4 parameters, which is greater than the 3 authorized.}}\n//                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            var v6 = new Action<object, object, object>((p1, p2, p3) => Console.WriteLine());\n            var v7 = new Action<object, object, object, object>((p1, p2, p3, p4) => Console.WriteLine()); // Noncompliant\n            F2(1, 2, 3, 4);\n        }\n\n        // see https://github.com/SonarSource/sonar-dotnet/issues/1459\n        // and https://github.com/SonarSource/sonar-dotnet/issues/8156\n        // We should not raise for imported methods according to external definition.\n        [DllImport(\"foo.dll\")]\n        public static extern void Extern(int p1, int p2, int p3, int p4); // Compliant, external definition\n\n        public static extern void ExternNoAttribute(int p1, int p2, int p3, int p4); // Compliant\n\n        [MethodImpl(MethodImplOptions.InternalCall)]\n        public extern void ExternNoStatic(int p1, int p2, int p3, int p4);           // Compliant\n    }\n\n    public interface If\n    {\n        void F1(int p1, int p2, int p3);\n        void F2(int p1, int p2, int p3, int p4); // Noncompliant\n    }\n\n    public class MyWrongClass\n    {\n        public MyWrongClass(string a, string b, string c, string d, string e, string f, string g, string h) // Noncompliant {{Constructor has 8 parameters, which is greater than the 3 authorized.}}\n//                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        {\n        }\n\n        public virtual void Method(int a, int b, int c, int d) // Noncompliant\n        {\n        }\n    }\n\n    public class SubClass : MyWrongClass\n    {\n        // See https://github.com/SonarSource/sonar-dotnet/issues/1015\n        // We should not raise when parent base class forces usage of too many args\n        public SubClass(string a, string b, string c, string d, string e, string f, string g, string h) // Compliant (base class requires them)\n            : base(a, b, c, d, e, f, g, h)\n        {\n        }\n\n        public SubClass()\n            : base(\"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\")\n        { }\n\n        public override void Method(int a, int b, int c, int d) // Compliant, cannot be changed\n        {\n        }\n    }\n\n    public class SubClass2 : TooManyParameters\n    {\n        public SubClass2(int p1, int p2, int p3, string s1, string s2, string s3) // Compliant, base class has 3. This adds only 3 new parameters.\n            : base(p1, p2, p3) { }\n\n        public SubClass2(int p1, int p2, int p3, string s1, string s2, string s3, string s4) // Noncompliant {{Constructor has 4 new parameters, which is greater than the 3 authorized.}}\n            : base(p1, p2, p3) { }\n    }\n\n    public class TooManyParametersLocalFunctions\n    {\n        public void MainMethod(int p1, int p2, int p3)\n        {\n            string OKNumberOfParameters1(int p1, int p2) => \"\";\n            static void OKNumberOfParameters2(int p1, int p2, int p3) { }\n\n            void TooManyParameters1(int p1, int p2, int p3, int p4) { } // Noncompliant {{Local function has 4 parameters, which is greater than the 3 authorized.}}\n            static string TooManyParameters2(int p1, int p2, int p3, int p4, int p5) => \"\"; // Noncompliant {{Local function has 5 parameters, which is greater than the 3 authorized.}}\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TooManyParameters_CustomValues.vb",
    "content": "﻿Imports System\nImports System.Runtime.InteropServices\n\nPublic Class TooManyParameters\n    Implements MyInterface\n\n    Public Event GoodEvent(Sender As Object, e As EventArgs)\n    Public Event Fire(Sender As Object, a As String, b As String, c As String, d As String) ' Noncompliant\n\n    Public Sub New()\n    End Sub\n\n    Public Sub New(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer)\n    End Sub\n\n    Public Sub New(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer, ByVal p4 As Integer) ' Noncompliant {{Constructor has 4 parameters, which is greater than the 3 authorized.}}\n        '         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    End Sub\n\n    Public Sub SubNoParams()\n    End Sub\n\n    Public Function FuncNoParams()\n        Return 1\n    End Function\n\n    Public Sub F1(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer) Implements MyInterface.F1\n    End Sub\n\n    Public Sub F2(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer, ByVal p4 As Integer) Implements MyInterface.F2 ' Compliant, interface implementation\n    End Sub\n\n    Public Sub F1(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer, ByVal p4 As Integer, ByVal p5 As String) ' Noncompliant {{Sub has 5 parameters, which is greater than the 3 authorized.}}\n    End Sub\n\n    Public Function F3(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer) Implements MyInterface.F3\n        Return p1\n    End Function\n\n    Public Function F4(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer, ByVal p4 As Integer) Implements MyInterface.F4 ' Compliant, interface implementation\n        Return p1\n    End Function\n\n    Sub F5(ByRef p1 As Integer, ByRef p2 As Integer, ByRef p3 As Integer, ByRef p4 As Integer) Implements MyInterface.F5\n    End Sub\n\n    Function F6(ByRef p1 As Integer, ByRef p2 As Integer, ByRef p3 As Integer, ByRef p4 As Integer) Implements MyInterface.F6\n        Return p1\n    End Function\n\n    Delegate Sub ThreeParametersSub(one As Integer, two As Integer, three As Integer)\n    Delegate Function ThreeParametersFunction(one As Integer, two As Integer, three As Integer) As Integer\n    Delegate Sub FourParametersSub(one As Integer, two As Integer, three As Integer, four As String) ' Noncompliant\n    '                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    Delegate Function FourParametersFunction(one As Integer, two As Integer, three As Integer, four As String) As Integer ' Noncompliant {{Delegate has 4 parameters, which is greater than the 3 authorized.}}\n    '                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n    Public Sub CallFunctionDelegate(ByVal first As ThreeParametersFunction, ByVal second As FourParametersFunction)\n    End Sub\n\n    Public Sub CallSubDelegate(ByVal first As ThreeParametersSub, ByVal second As FourParametersSub)\n    End Sub\n\n    Public Sub F()\n        Dim v1 = New Action(Of Integer, Integer, Integer)(\n          Function(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer)\n              Console.WriteLine()\n          End Function)\n        Dim v2 = New Action(Of Integer, Integer, Integer, Integer)(\n          Function(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer, ByVal p4 As Integer) ' Noncompliant {{Lambda has 4 parameters, which is greater than the 3 authorized.}}\n              '   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n              Console.WriteLine()\n          End Function)\n        Dim v3 = New Action(Function()\n                            End Function)\n\n        Dim v4 = Function(num As Integer, num2 As Integer, num3 As Integer) num + num2 + num3 + 1\n        Dim v5 = Function(num As Integer, num2 As Integer, num3 As Integer, num4 As Integer) num + num2 + num3 + num4 + 1 ' Noncompliant {{Lambda has 4 parameters, which is greater than the 3 authorized.}}\n        ' the above is a FP because of below\n        CallFunctionDelegate(v4, v5)\n\n        Dim v6 = Sub(num As Integer, num2 As Integer, num3 As Integer) Console.WriteLine()\n        Dim v7 = Sub(num As Integer, num2 As Integer, num3 As Integer, num4 As Integer) Console.WriteLine() ' Noncompliant (FP because of below)\n        CallSubDelegate(v6, v7)\n\n        F2(1, 2, 3, 4)\n    End Sub\n\n    Default Public ReadOnly Property Indexer(a As Integer, b As Integer, c As Integer, d As Integer) As Integer ' Noncompliant\n        Get\n            Return a + b + c + d + 42\n        End Get\n    End Property\n\n    Public ReadOnly Property ParametrizedProperty(a As Integer, b As Integer, c As Integer, d As Integer) As Integer ' Noncompliant\n        Get\n            Return a + b + c + d + 42\n        End Get\n    End Property\n\n    ' We should not raise for imported methods according to external definition.\n    <DllImport(\"foo.dll\")>\n    Public Shared Sub Extern(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer, ByVal p4 As Integer) ' Compliant, external definition\n    End Sub\n\n    Public Declare Function ExternSyntax Lib \"user32.dll\" (hwnd As IntPtr, a As String, b As String, c As String, d As String) As Integer  ' Compliant\nEnd Class\n\nInterface MyInterface\n\n    Sub F1(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer)\n    Sub F2(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer, ByVal p4 As Integer)      ' Noncompliant\n    Function F3(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer)\n    Function F4(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer, ByVal p4 As Integer) ' Noncompliant {{Function has 4 parameters, which is greater than the 3 authorized.}}\n    Sub F5(ByRef p1 As Integer, ByRef p2 As Integer, ByRef p3 As Integer, ByRef p4 As Integer)      ' Noncompliant\n    Function F6(ByRef p1 As Integer, ByRef p2 As Integer, ByRef p3 As Integer, ByRef p4 As Integer) ' Noncompliant\n\nEnd Interface\n\nPublic Class MyWrongClass\n    Public Sub New(ByVal a As String, ByVal b As String, ByVal c As String, ByVal d As String, ByVal e As String, ByVal f As String, ByVal g As String, ByVal h As String) ' Noncompliant\n    End Sub\nEnd Class\n\nPublic Class SubClass\n    Inherits MyWrongClass\n\n    ' We should not raise when parent base class forces usage of too many args\n    Public Sub New(ByVal a As String, ByVal b As String, ByVal c As String, ByVal d As String, ByVal e As String, ByVal f As String, ByVal g As String, ByVal h As String) ' Compliant (base class requires them)\n        MyBase.New(a, b, c, d, e, f, g, h)\n    End Sub\n\n    Public Sub New()\n        MyBase.New(\"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\")\n    End Sub\nEnd Class\n\nPublic Class SubClass2\n    Inherits TooManyParameters\n\n    Public Sub New(p1 As Integer, p2 As Integer, p3 As Integer, s1 As String, s2 As String, s3 As String) ' Compliant, base class has 3. This adds only 3 new parameters.\n        MyBase.New(p1, p2, p3)\n    End Sub\n\n    Public Sub New(p1 As Integer, p2 As Integer, p3 As Integer, s1 As String, s2 As String, s3 As String, s4 As String) ' Noncompliant {{Constructor has 4 new parameters, which is greater than the 3 authorized.}}\n        MyBase.New(p1, p2, p3)\n        'For coverage, other expressions\n        Dim V As Integer\n        V = 0\n        Method(p1, p2, p3, V)\n        Me.Method(p1, p2, p3, V)\n        MyBase.F4(p1, p2, p3, V)\n    End Sub\n\n    Public Sub New(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer, ByVal p4 As Integer) ' Compliant (needs arguments for base constructor)\n        MyBase.New(p1, p2, p3, p4)\n        F5(p1, p2, p3, p4)\n        F2(p1, p2, p3, p4)\n    End Sub\n\n    Private Sub Method(p1 As Integer, p2 As Integer, p3 As Integer, p4 As Integer)  ' Noncompliant\n    End Sub\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TooManyParameters_DefaultValues.cs",
    "content": "﻿using System;\nusing System.Runtime.InteropServices;\n\nnamespace Tests.Diagnostics\n{\n    public class TooManyParameters : If\n    {\n        public int this[int a, int b, int c, int d]\n        {\n            get\n            {\n                return a;\n            }\n        }\n\n        ~TooManyParameters()\n        {\n        }\n\n        public TooManyParameters(int p1, int p2, int p3) { }\n        public TooManyParameters(int p1, int p2, int p3, int p4) { }\n\n        public void F1(int p1, int p2, int p3) { }\n\n        public void F2(int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8, int p9, int p10) { }\n\n        public void F1(int p1, int p2, int p3, int p4) { }\n\n        public void F()\n        {\n            var v1 = new Action<int, int, int>(delegate(int p1, int p2, int p3) { Console.WriteLine(); });\n            var v2 = new Action<int, int, int, int>(delegate(int p1, int p2, int p3, int p4) { Console.WriteLine(); });\n            var v3 = new Action(delegate { });\n            var v4 = new Action<int, int, int>((int p1, int p2, int p3) => Console.WriteLine());\n            var v5 = new Action<int, int, int, int>((int p1, int p2, int p3, int p4) => Console.WriteLine());\n            var v6 = new Action<object, object, object>((p1, p2, p3) => Console.WriteLine());\n            var v7 = new Action<object, object, object, object>((p1, p2, p3, p4) => Console.WriteLine());\n            F2(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);\n        }\n\n        // see https://github.com/SonarSource/sonar-dotnet/issues/1459\n        // We should not raise for imported methods according to external definition.\n        [DllImport(\"foo.dll\")]\n        public static extern void Extern(int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8, int p9, int p10); // Compliant, external definition\n    }\n\n    public interface If\n    {\n        void F1(int p1, int p2, int p3);\n        void F2(int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8, int p9, int p10); // Noncompliant  {{Method has 10 parameters, which is greater than the 7 authorized.}}\n    }\n\n    public class MyWrongClass\n    {\n        public MyWrongClass(string a, string b, string c, string d, string e, string f, string g, string h) // Noncompliant {{Constructor has 8 parameters, which is greater than the 7 authorized.}}\n//                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        {\n        }\n    }\n\n    public class SubClass : MyWrongClass\n    {\n        // See https://github.com/SonarSource/sonar-dotnet/issues/1015\n        // We should not raise when parent base class forces usage of too many args\n        public SubClass(string a, string b, string c, string d, string e, string f, string g, string h) // Compliant (base class requires them)\n            : base(a, b, c, d, e, f, g, h)\n        {\n        }\n\n        public SubClass()\n            : base(\"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\")\n        { }\n    }\n\n    public class SubClass2 : TooManyParameters\n    {\n        public SubClass2(int p1, int p2, int p3, string s1, string s2)\n            : base(p1, p2, p3)\n        {\n\n        }\n    }\n\n    public class WithLocalFunctions\n    {\n        public void Method()\n        {\n            void F1(int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8, int p9, int p10) { } // Noncompliant\n            static void F2(int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8, int p9, int p10) { } // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TooManyParameters_DefaultValues.vb",
    "content": "﻿Imports System\nImports System.Runtime.InteropServices\n\nPublic Class TooManyParameters\n  Implements MyInterface\n\n  Public Sub New(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer)\n  End Sub\n\n  Public Sub New(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer, ByVal p4 As Integer)\n  End Sub\n\n  Public Sub F1(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer) Implements MyInterface.F1\n  End Sub\n\n  Public Sub F2(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer, ByVal p4 As Integer)  Implements MyInterface.F2\n  End Sub\n\n  Public Sub F1(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer, ByVal p4 As Integer, ByVal p5 As String)\n  End Sub\n\n  Public Function F3(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer) Implements MyInterface.F3\n    Return p1\n  End Function\n\n  Public Function F4(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer, ByVal p4 As Integer)  Implements MyInterface.F4\n    Return p1\n  End Function\n\n  Sub F5(ByRef p1 As Integer, ByRef p2 As Integer, ByRef p3 As Integer, ByRef p4 As Integer)  Implements MyInterface.F5\n  End Sub\n\n  Function F6(ByRef p1 As Integer, ByRef p2 As Integer, ByRef p3 As Integer, ByRef p4 As Integer) Implements MyInterface.F6\n    Return p1\n  End Function\n\n  Delegate Sub ThreeParametersSub( one As Integer,  two As Integer,  three As Integer)\n  Delegate Function ThreeParametersFunction(one As Integer,  two As Integer,  three As Integer) As Integer\n  Delegate Sub FourParametersSub( one As Integer,  two As Integer,  three As Integer,  four As String)\n  Delegate Function FourParametersFunction( one As Integer,  two As Integer,  three As Integer,  four As String) As Integer\n\n  Public Sub CallFunctionDelegate(ByVal first As ThreeParametersFunction, ByVal second As FourParametersFunction)\n  End Sub\n\n  Public Sub CallSubDelegate(ByVal first As ThreeParametersSub, ByVal second As FourParametersSub)\n  End Sub\n\n  Public Sub F()\n    Dim v1 = New Action(Of Integer, Integer, Integer)(\n      Function(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer)\n        Console.WriteLine()\n      End Function)\n    Dim v2 = New Action(Of Integer, Integer, Integer, Integer)(\n      Function(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer, ByVal p4 As Integer)\n        Console.WriteLine()\n      End Function)\n    Dim v3 = New Action(Function()\n      End Function)\n\n    Dim v4 = Function(num As Integer, num2 As Integer, num3 As Integer) num + num2 + num3 + 1\n    Dim v5 = Function(num As Integer, num2 As Integer, num3 As Integer, num4 As Integer) num + num2 + num3 + num4 + 1\n    CallFunctionDelegate(v4, v5)\n \n    Dim v6 = Sub(num As Integer, num2 As Integer, num3 As Integer) Console.WriteLine()\n    Dim v7 = Sub(num As Integer, num2 As Integer, num3 As Integer, num4 As Integer) Console.WriteLine()\n    CallSubDelegate(v6, v7)\n\n    F2(1,2,3,4)\n  End Sub\n\n' We should not raise for imported methods according to external definition.\n  <DllImport(\"foo.dll\")>\n  Public Shared Sub Extern(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer, ByVal p4 As Integer)\n  End Sub\nEnd Class\n\nInterface MyInterface\n  Sub F1(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer)\n  Sub F2(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer, ByVal p4 As Integer)\n  Function F3(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer)\n  Function F4(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer, ByVal p4 As Integer)\n  Sub F5(ByRef p1 As Integer, ByRef p2 As Integer, ByRef p3 As Integer, ByRef p4 As Integer)\n  Function F6(ByRef p1 As Integer, ByRef p2 As Integer, ByRef p3 As Integer, ByRef p4 As Integer)\nEnd Interface\n\nPublic Class MyWrongClass\n  Public Sub New(ByVal a As String, ByVal b As String, ByVal c As String, ByVal d As String, ByVal e As String, ByVal f As String, ByVal g As String, ByVal h As String) ' Noncompliant\n  End Sub\nEnd Class\n\nPublic Class SubClass\n  Inherits MyWrongClass\n\n' We should not raise when parent base class forces usage of too many args\n  Public Sub New(ByVal a As String, ByVal b As String, ByVal c As String, ByVal d As String, ByVal e As String, ByVal f As String, ByVal g As String, ByVal h As String) ' Compliant (base class requires them)\n    MyBase.New(a, b, c, d, e, f, g, h)\n  End Sub\n\n  Public Sub New()\n    MyBase.New(\"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\")\n  End Sub\nEnd Class\n\nPublic Class SubClass2\n  Inherits TooManyParameters\n\n  Public Sub New(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer, ByVal s1 As String, ByVal s2 As String)\n    MyBase.New(p1, p2, p3)\n  End Sub\n\n  Public Sub New(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer, ByVal p4 As Integer)\n    MyBase.New(p1, p2, p3, p4)\n    F5(p1, p2, p3, p4)\n    F2(p1, p2, p3, p4)\n  End Sub\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TrackNotImplementedException.CSharp11.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    interface IInterface\n    {\n        static abstract void FooBar();\n    }\n\n    public class SomeClass : IInterface\n    {\n        public static void FooBar()\n        {\n            throw new NotImplementedException(); // Noncompliant\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TrackNotImplementedException.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    class MyException : NotImplementedException { }\n\n    class Program\n    {\n        void Foo()\n        {\n            throw new NotImplementedException(); // Noncompliant {{Implement this method or throw 'NotSupportedException' instead.}}\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        }\n\n        void Bar()\n        {\n            throw new MyException(); // Compliant - we don't check inheritance\n        }\n\n        void FooBar()\n        {\n            var ex = new NotImplementedException(); // Compliant - not thrown\n        }\n\n        void FooBar2()\n        {\n            var ex = new NotImplementedException();\n            throw ex; // Noncompliant\n//          ^^^^^^^^^\n        }\n\n        void ByExpression() => throw new NotImplementedException(); // Noncompliant\n//                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n        int ConditionalExpression(int i)\n            => i == 0 ? 666 : throw new NotImplementedException(); // Noncompliant\n\n        void NullCoalescing(object obj)\n        {\n            x = obj ?? throw new NotImplementedException(); // Noncompliant\n        }\n        private object x;\n\n        NotImplementedException GetNewByExpression() => new NotImplementedException(); // Compliant - not thrown\n    }\n\n    interface IInterface\n    {\n        void FooBar() // Compliant - Default interface methods can be used to extend an already existing API while keeping backwards compatibility.\n        {\n        }\n    }\n\n    public class WithLocalFunctions\n    {\n        public void Method()\n        {\n            void Foo()\n            {\n                throw new NotImplementedException(); // Noncompliant\n//              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            }\n\n            static void Bar()\n            {\n                throw new NotImplementedException(); // Noncompliant\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TryStatementsWithIdenticalCatchShouldBeMerged.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        void Simple()\n        {\n            try { }\n            catch (Exception)\n            {\n            }\n            finally { }\n\n            try { } // Noncompliant {{Combine this 'try' with the one starting on line 9.}}\n            catch (Exception)\n            {\n            }\n            finally { }\n\n            try { }\n            finally { }\n\n            try { } // Noncompliant {{Combine this 'try' with the one starting on line 15.}}\n            catch (Exception)\n            {\n            }\n            finally { }\n\n            try { } // Noncompliant {{Combine this 'try' with the one starting on line 21.}}\n            finally { }\n        }\n\n        void DifferentCatches1()\n        {\n            try { }\n            catch (Exception)\n            {\n            }\n\n            // exception type different\n            try { }\n            catch (ApplicationException)\n            {\n            }\n\n            // catch clauses count different\n            try { }\n            catch (ApplicationException)\n            {\n            }\n            catch (Exception)\n            {\n            }\n\n            // catch content different\n            try { }\n            catch (Exception)\n            {\n                Console.WriteLine();\n                Console.Write(\"\");\n            }\n\n            // has finally\n            try { }\n            catch (Exception)\n            {\n            }\n            finally { }\n\n            // differs than previous by finally content\n            try { }\n            catch (Exception)\n            {\n            }\n            finally\n            {\n                Console.WriteLine();\n                Console.Write(\"\");\n            }\n\n            // False negative - the catch clause has a name for the exception, while the try on #36 does not have a name\n            try { }\n            catch (Exception e)\n            {\n            }\n            finally { }\n\n            // exception filter\n            try { }\n            catch (Exception e) when (string.IsNullOrEmpty(e.Message))\n            {\n            }\n            finally { }\n        }\n\n        void DifferentCatches2()\n        {\n            try { }\n            catch (ApplicationException)\n            {\n            }\n            catch (ArgumentException)\n            {\n            }\n\n            try { } // Noncompliant, same catches, different order\n            catch (ArgumentException)\n            {\n            }\n            catch (ApplicationException)\n            {\n            }\n\n            try { }\n            catch (Exception e) when (e != null)\n            {\n            }\n\n            try { } // Noncompliant, same exception filter\n            catch (Exception e) when (e != null)\n            {\n            }\n        }\n\n        void TryStatementsDifferentNesting()\n        {\n            try\n            {\n                // Child, not on the same level\n                try { }\n                catch (ApplicationException)\n                {\n                }\n                catch (Exception)\n                {\n                }\n            }\n            catch (ApplicationException)\n            {\n            }\n            catch (Exception)\n            {\n            }\n\n            if (true)\n            {\n                // Not on the same level\n                try { }\n                catch (ApplicationException)\n                {\n                }\n                catch (Exception)\n                {\n                }\n            }\n\n            try { } // Noncompliant {{Combine this 'try' with the one starting on line 128.}}\n            catch (ApplicationException)\n            {\n            }\n            catch (Exception)\n            {\n            }\n        }\n\n        string Property\n        {\n            get\n            {\n                try { }\n                finally { }\n\n                try { } // Noncompliant {{Combine this 'try' with the one starting on line 171.}}\n                finally { }\n\n                return \"\";\n            }\n            set\n            {\n                try { }\n                finally { }\n\n                try { } // Noncompliant {{Combine this 'try' with the one starting on line 181.}}\n                finally { }\n            }\n        }\n\n        public Program() // ctor\n        {\n            try { }\n            finally { }\n\n            try { } // Noncompliant {{Combine this 'try' with the one starting on line 191.}}\n            finally { }\n        }\n\n        public void Lambdas()\n        {\n            Action a = () =>\n            {\n                try { }\n                finally { }\n\n                try { } // Noncompliant {{Combine this 'try' with the one starting on line 202.}}\n                finally { }\n            };\n        }\n\n        void CodeBetweenTryBlocks(int x, int y)\n        {\n            try { }\n            catch (Exception) { }\n\n            x++;\n\n            try { }    // Noncompliant FP\n            catch (Exception) { }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TypeExaminationOnSystemType.TopLevelStatements.cs",
    "content": "﻿using System;\nusing Point2D = (int, int);\n\nPoint2D p = new(1, 2);\n\nif (p.GetType().IsInstanceOfType(typeof(Point2D))) // Noncompliant\n{ /* ... */ }\n\ntypeof(Point2D).IsInstanceOfType(\"42\"); // Compliant\ntypeof(Point2D).IsInstanceOfType(typeof(Point2D)); // Noncompliant\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TypeExaminationOnSystemType.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public class TypeExaminationOnSystemType\n    {\n        public void Test()\n        {\n            var type = typeof(int);\n            var ttype = type.GetType(); //Noncompliant {{Remove this use of 'GetType' on a 'System.Type'.}}\n//                          ^^^^^^^^^^\n\n            var s = \"abc\";\n\n            if (s.GetType().IsInstanceOfType(typeof(string))) //Noncompliant {{Pass an argument that is not a 'System.Type' or consider using 'IsAssignableFrom'.}}\n//                                           ^^^^^^^^^^^^^^\n            { /* ... */ }\n\n            if (s.GetType().IsInstanceOfType(\"ssss\".GetType())) // Noncompliant {{Consider removing the 'GetType' call, it's suspicious in an 'IsInstanceOfType' call.}}\n            { /* ... */ }\n\n            if (s.GetType().IsInstanceOfType(typeof(string) // Noncompliant\n                .GetType())) // Noncompliant\n            { /* ... */ }\n\n            if (s.GetType().IsInstanceOfType(\"ssss\"))\n            { /* ... */ }\n\n            var t = s.GetType();\n\n            var x = Type.GetType(\"\");\n\n            typeof(Type).GetType(); // Compliant - can be used by convention to get an instance of ‘System.RuntimeType’. See: https://github.com/SonarSource/sonar-dotnet/issues/4201\n            typeof(System.Type).GetType();\n            typeof(object).GetType(); // Noncompliant - only `typeof(Type)` is considered an exception\n\n            GetType(string.Empty); // Compliant - different `GetType` method\n            IsInstanceOfType(string.Empty); // Compliant - different `IsInstanceOfType` method\n        }\n\n        public Type ResolveType(string id) => Type.GetType(id);\n\n        public void GetType(object o) { }\n\n        public void IsInstanceOfType(object o) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TypeMemberVisibility.Latest.Partial.cs",
    "content": "﻿using System;\n\nnamespace CSharp13\n{\n    internal partial class PartialPropertyClass //Noncompliant\n    {\n        public partial int PropertyA { get { return 42; } } // Secondary\n        private partial int PropertyE { get  { return 42; } }\n    }\n\n    //https://sonarsource.atlassian.net/browse/NET-560\n    partial class OtherPartialPropertyClass // CompliantFN\n    {\n        public partial int PropertyA { get { return 42; } } // Compliant FN\n        private partial int PropertyE { get { return 42; } }\n\n        public partial void VoidMethod();  // Compliant FN\n        partial void AnotherAnotherVoidMethod();\n\n        public partial void DoSomething() { } // Compliant FN\n        private partial void DoSomethingElse() { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TypeMemberVisibility.Latest.cs",
    "content": "﻿using System;\n\nnamespace CSharp9\n{\n    internal record Noncompliant // Noncompliant {{Types should not have members with visibility set higher than the type's visibility}}\n    {\n        public static decimal A = 3.14m;\n//      ^^^^^^ Secondary\n        private protected decimal E = 1m;\n\n        public int PropertyA { get; }\n//      ^^^^^^ Secondary\n        private protected int PropertyE { get; }\n\n        public int GetA() => 1;\n//      ^^^^^^ Secondary\n        private protected int GetE() => 1;\n\n        public event EventHandler ClickA;\n//      ^^^^^^ Secondary\n        private protected event EventHandler ClickE;\n\n        public delegate void DelegateA(string str);\n//      ^^^^^^ Secondary\n        private protected delegate void DelegateE(string str);\n\n        public Noncompliant(int a) {}\n//      ^^^^^^ Secondary\n        private protected Noncompliant(int a, int b, int c, int d, int e) {}\n\n        public int this[int index] => 1;\n//      ^^^^^^ Secondary\n        protected internal int this[string index] => 1;\n\n        public struct NestedStructA { }\n//      ^^^^^^ Secondary\n\n        private protected struct NestedStructE  { }\n\n        public static implicit operator byte(Noncompliant d) => 1; // Compliant: user defined operators need to be public\n        public static explicit operator Noncompliant(byte b) => new Noncompliant(b); // Compliant: user defined operators need to be public\n    }\n\n    internal record NoncompliantPositionalRecord(string Property) // Noncompliant {{Types should not have members with visibility set higher than the type's visibility}}\n    {\n        public static decimal A = 3.14m;\n//      ^^^^^^ Secondary\n    }\n\n    internal class Class // Noncompliant\n    {\n        public record MyRecord { }\n//      ^^^^^^ Secondary\n    }\n\n    internal record Record // Noncompliant\n    {\n        public record MyRecord { }\n//      ^^^^^^ Secondary\n    }\n\n    internal struct Struct // Noncompliant\n    {\n        public record MyRecord { }\n//      ^^^^^^ Secondary\n    }\n\n    public record Compliant // Class visibility upgrade makes members compliant\n    {\n        public static decimal A = 3.14m;\n        internal static decimal C = 1m;\n\n        public int PropertyA { get; }\n        internal int PropertyC { get; }\n\n        public int GetA() => 1;\n        protected internal int GetB() => 1;\n        internal int GetC() => 1;\n\n        public event EventHandler ClickA;\n        public delegate void DelegateA(string str);\n        public int this[int index] => 1;\n\n        public Compliant(int a) {}\n        protected internal Compliant(int a, int b) {}\n        internal Compliant(int a, int b, int c) {}\n\n        public struct NestedStructA\n        {\n            public bool FlipCoin() => false;\n        }\n\n        protected internal struct NestedStructB\n        {\n            internal bool FlipCoin() => false;\n        }\n\n        internal struct NestedStructC\n        {\n            internal bool FlipCoin() => false;\n        }\n\n        public class MyClass { }\n\n        public struct MyStruct { }\n\n        public enum MyEnum { }\n\n        public record MyRecord { }\n    }\n}\n\nnamespace CSharp10\n{\n    internal record struct Noncompliant // Noncompliant {{Types should not have members with visibility set higher than the type's visibility}}\n    //                     ^^^^^^^^^^^^\n    {\n        public Noncompliant() { } // Secondary\n\n        static public decimal A = 3.14m; // Secondary\n        //     ^^^^^^\n        private decimal E = 1m;\n\n        public int PropertyA { get; } = 0; // Secondary\n        private int PropertyE { get; } = 0;\n\n        public int GetA() => 1; // Secondary\n        private int GetE() => 1;\n    }\n\n    internal record struct NoncompliantPositionalRecord(string Property) // Noncompliant\n    {\n        public static decimal A = 3.14m; // Secondary\n    }\n}\n\n\nnamespace CSharp11\n{\n    public interface IContract\n    {\n        static abstract void Do();\n    }\n\n    internal class SomeClass : IContract\n    {\n        public static void Do()\n        {\n            throw new NotImplementedException(); // Compliant because comes from the interface\n        }\n    }\n\n    file class LocalFileClass // file-scoped types have no access modifiers. We don't need to check their members.\n    {\n        public void Foo() { }\n    }\n}\n\nnamespace CSharp13\n{\n    internal partial class PartialPropertyClass //Noncompliant\n    {\n        public partial int PropertyA { get; } // Secondary\n        private partial int PropertyE { get; }\n    }\n\n    internal partial class OtherPartialPropertyClass //Noncompliant\n    {\n        public partial int PropertyA { get; } // Secondary\n        private partial int PropertyE { get; }\n\n        public partial void VoidMethod() { }   // Secondary\n        partial void AnotherVoidMethod();\n\n        public partial void DoSomething(); // Secondary\n        private partial void DoSomethingElse();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TypeMemberVisibility.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    internal class Noncompliant // Noncompliant {{Types should not have members with visibility set higher than the type's visibility}}\n    {\n        public static decimal A = 3.14m;\n//      ^^^^^^ Secondary\n        protected internal static decimal B = 1m; // Improvement idea: check InternalsVisibleTo attributes.\n        internal static decimal C = 1m;\n        protected static decimal D = 1m;\n        private static decimal F = 1m;\n\n        public int PropertyA { get; }\n//      ^^^^^^ Secondary\n        protected internal int PropertyB { get; }\n        internal int PropertyC { get; }\n        protected int PropertyD { get; }\n        private int PropertyF { get; }\n\n        public int GetA() => 1;\n//      ^^^^^^ Secondary\n        protected internal int GetB() => 1;\n        internal int GetC() => 1;\n        protected int GetD() => 1;\n        private int GetF() => 1;\n\n        public event EventHandler ClickA;\n//      ^^^^^^ Secondary\n        protected internal event EventHandler ClickB;\n        internal event EventHandler ClickC;\n        protected event EventHandler ClickD;\n        private event EventHandler ClickF;\n\n        public delegate void DelegateA(string str);\n//      ^^^^^^ Secondary\n        protected internal delegate void DelegateB(string str);\n        internal delegate void DelegateC(string str);\n        protected delegate void DelegateD(string str);\n        private delegate void DelegateF(string str);\n\n        public Noncompliant(int a) {}\n//      ^^^^^^ Secondary\n        protected internal Noncompliant(int a, int b) {}\n        internal Noncompliant(int a, int b, int c) {}\n        protected Noncompliant(int a, int b, int c, int d) {}\n        private Noncompliant(int a, int b, int c, int d, int e, int f) {}\n\n        public int this[int index] => 1;\n//      ^^^^^^ Secondary\n        protected internal int this[string index] => 1;\n\n        public struct NestedStructA\n//      ^^^^^^ Secondary\n        {\n            public bool FlipCoin() => false;\n//          ^^^^^^ Secondary\n        }\n\n        protected internal struct NestedStructB\n        {\n            public bool FlipCoin() => false;\n//          ^^^^^^ Secondary\n        }\n\n        internal struct NestedStructC\n        {\n            public bool FlipCoin() => false;\n//          ^^^^^^ Secondary\n        }\n\n        protected struct NestedStructD\n        {\n            public bool FlipCoin() => false;\n//          ^^^^^^ Secondary\n        }\n\n        public enum Enum\n//      ^^^^^^ Secondary\n        {\n            A\n        }\n\n        public static implicit operator byte(Noncompliant d) => 1;                   // Compliant: user defined operators need to be public\n        public static explicit operator Noncompliant(byte b) => new Noncompliant(b); // Compliant: user defined operators need to be public\n        public static Noncompliant operator +(Noncompliant b) => null;               // Compliant: user defined operators need to be public\n\n        private class NestedPrivateClass\n        {\n            public int PublicProperty { get; }\n//          ^^^^^^ Secondary\n            protected internal int ProtectedInternalProperty { get; } // Compliant: can be used in `InternalsVisibleTo` assemblies\n            internal int InternalProperty { get; } // Compliant: can be used in `InternalsVisibleTo` assemblies\n            protected int ProtectedProperty { get; } // Compliant: can be used in derived type\n            private int PrivateProperty { get; }\n        }\n\n        private class DerivedNestedPrivateClass : NestedPrivateClass\n        {\n            internal DerivedNestedPrivateClass()\n            {\n                var d = ProtectedProperty; // Protected properties can be accessed even if the base class is private.\n            }\n        }\n\n        protected class NestedProtectedClass\n        {\n            public int PropertyA { get; }\n//          ^^^^^^ Secondary\n            internal int PropertyB { get; }\n            protected internal int PropertyC { get; }\n            protected int PropertyD { get; }\n            private int PropertyF { get; }\n        }\n\n        private void Method()\n        {\n            var nestedPrivate = new NestedPrivateClass();\n            var x = nestedPrivate.InternalProperty; // internal properties can be used from nested private classes\n        }\n    }\n\n    internal struct Struct // Noncompliant\n    {\n        public class MyClass { }\n//      ^^^^^^ Secondary\n\n        public struct MyStruct { }\n//      ^^^^^^ Secondary\n        public enum MyEnum { }\n//      ^^^^^^ Secondary\n    }\n\n    public class Compliant // Class visibility upgrade makes members compliant\n    {\n        public static decimal A = 3.14m;\n        protected internal static decimal B = 1m;\n        internal static decimal C = 1m;\n\n        public int PropertyA { get; }\n        protected internal int PropertyB { get; }\n        internal int PropertyC { get; }\n\n        public int GetA() => 1;\n        protected internal int GetB() => 1;\n        internal int GetC() => 1;\n\n        public event EventHandler ClickA;\n        public delegate void DelegateA(string str);\n        public int this[int index] => 1;\n\n        public Compliant(int a) {}\n        protected internal Compliant(int a, int b) {}\n        internal Compliant(int a, int b, int c) {}\n\n        public struct NestedStructA\n        {\n            public bool FlipCoin() => false;\n        }\n\n        protected internal struct NestedStructB\n        {\n            internal bool FlipCoin() => false; // struct cannot have protected members\n        }\n\n        internal struct NestedStructC\n        {\n            internal bool FlipCoin() => false;\n        }\n\n        public class MyClass { }\n\n        public struct MyStruct { }\n\n        public enum MyEnum { }\n    }\n\n    internal sealed class WithMethodOverride\n    {\n        public override string ToString() => string.Empty;  // Compliant - the overriden method is public\n    }\n\n    public interface IContract\n    {\n        void Do();\n    }\n\n    internal class SomeClass: IContract\n    {\n        public void Do()\n        {\n            throw new NotImplementedException();\n        }\n    }\n\n    internal class SomeClass2: IContract // Noncompliant\n    {\n        public void Do()\n        {\n            throw new NotImplementedException();\n        }\n\n        public void DoSomethingElse() { }\n//      ^^^^^^ Secondary\n    }\n\n    public class Base\n    {\n        public Base() { }\n\n        public Base(string x) { }\n\n        public Base(string x, string y) { }\n    }\n\n    internal class Derived : Base // Noncompliant\n    {\n        public Derived() { }\n//      ^^^^^^ Secondary\n\n        public Derived(string x) : base(x) { } // The constructor visibility can be different from the base\n//      ^^^^^^ Secondary\n        internal Derived(string x, string y) : base(x, y) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TypeNamesShouldNotMatchNamespaces.CSharp10.cs",
    "content": "﻿public record struct Web { } // Noncompliant\npublic record struct IO(string Parameter) { } // Noncompliant\n\npublic record class Accessibility { } // Noncompliant\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TypeNamesShouldNotMatchNamespaces.CSharp9.cs",
    "content": "﻿public record Web { } // Noncompliant\npublic record Accessibility { } // Noncompliant\npublic record CompliantName { }\npublic record Runtime(string Parameter) { } // Noncompliant\nrecord IO { } // Compliant (it's not public)\n\nnamespace Tests.Diagnostics\n{\n    public record Linq { } // Noncompliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TypeNamesShouldNotMatchNamespaces.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class Web { } // Noncompliant {{Change the name of type 'Web' to be different from an existing framework namespace.}}\n//               ^^^\n    public enum IO { x };\n//              ^^\n\n    public delegate void Runtime(); // Noncompliant\n//                       ^^^^^^^\n\n    public interface Linq { } // Noncompliant\n//                   ^^^^\n\n    public struct Xaml { } // Noncompliant\n//                ^^^^\n\n    interface System { } // Compliant (it's not public)\n\n    private interface Data { } // Error [CS1527] - Compliant (it's not public)\n\n    namespace Accessibility { }  // Compliant (namespace are not checked)\n\n    interface { } // Error [CS1001]\n\n    public class dIrEcToRySeRvIcEs { } // Noncompliant {{Change the name of type 'dIrEcToRySeRvIcEs' to be different from an existing framework namespace.}}\n}\n\nnamespace All_Variants\n{\n    public class Accessibility { } // Noncompliant\n    public class Activities { } // Noncompliant\n    public class Addin { } // Noncompliant\n    public class Build { } // Noncompliant\n    public class Codedom { } // Noncompliant\n    public class Collections { } // Noncompliant\n    public class Componentmodel { } // Noncompliant\n    public class Configuration { } // Noncompliant\n    public class Csharp { } // Noncompliant\n    public class Custommarshalers { } // Noncompliant\n    public class Data { } // Noncompliant\n    public class Dataflow { } // Noncompliant\n    public class Deployment { } // Noncompliant\n    public class Device { } // Noncompliant\n    public class Diagnostics { } // Noncompliant\n    public class Directoryservices { } // Noncompliant\n    public class Drawing { } // Noncompliant\n    public class Dynamic { } // Noncompliant\n    public class Enterpriseservices { } // Noncompliant\n    public class Globalization { } // Noncompliant\n    public class Identitymodel { } // Noncompliant\n    public class Interopservices { } // Noncompliant\n    public class Io { } // Noncompliant\n    public class Jscript { } // Noncompliant\n    public class Linq { } // Noncompliant\n    public class Location { } // Noncompliant\n    public class Management { } // Noncompliant\n    public class Media { } // Noncompliant\n    public class Messaging { } // Noncompliant\n    public class Microsoft { } // Noncompliant\n    public class Net { } // Noncompliant\n    public class Numerics { } // Noncompliant\n    public class Printing { } // Noncompliant\n    public class Reflection { } // Noncompliant\n    public class Resources { } // Noncompliant\n    public class Runtime { } // Noncompliant\n    public class Security { } // Noncompliant\n    public class Server { } // Noncompliant\n    public class Servicemodel { } // Noncompliant\n    public class Serviceprocess { } // Noncompliant\n    public class Speech { } // Noncompliant\n    public class Sqlserver { } // Noncompliant\n    public class System { } // Noncompliant\n    public class Tasks { } // Noncompliant\n    public class Text { } // Noncompliant\n    public class Threading { } // Noncompliant\n    public class Timers { } // Noncompliant\n    public class Transactions { } // Noncompliant\n    public class Uiautomationclientsideproviders { } // Noncompliant\n    public class Visualbasic { } // Noncompliant\n    public class Visualc { } // Noncompliant\n    public class Web { } // Noncompliant\n    public class Win32 { } // Noncompliant\n    public class Windows { } // Noncompliant\n    public class Workflow { } // Noncompliant\n    public class Xaml { } // Noncompliant\n    public class Xamlgeneratednamespace { } // Noncompliant\n    public class Xml { } // Noncompliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TypeParameterName.vb",
    "content": "﻿Namespace Tests.Diagnostics\n    Public Class Foo(Of t, TOther) ' Noncompliant {{Rename 't' to match the regular expression: '^T(([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?)?'.}}\n'                       ^\n\n        Public Sub Noncompliant(Of tType, TSomeOtherTypeTT)() ' Noncompliant\n'                                  ^^^^^\n        End Sub\n\n        Public Sub Compliant(Of TType, TSomeOtherTypeTT)() ' Compliant\n        End Sub\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TypeParameterName_CustomRegex.vb",
    "content": "﻿Namespace Tests.Diagnostics\n    Public Class Foo(Of AB12, CD34) ' Compliant\n        Public Sub Noncompliant(Of A12B)() ' Noncompliant {{Rename 'A12B' to match the regular expression: '^[A-Z]{2}\\d{2}$'.}}\n'                                  ^^^^\n        End Sub\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/TypesShouldNotExtendOutdatedBaseTypes.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Xml;\n\nnamespace Tests.Diagnostics\n{\n    class Foo1 : System.ApplicationException { } // Noncompliant {{Refactor this type not to derive from an outdated type 'System.ApplicationException'.}}\n//        ^^^^\n\n    class Foo2 : XmlDocument { } // Noncompliant {{Refactor this type not to derive from an outdated type 'System.Xml.XmlDocument'.}}\n\n    class Foo2_Explicit : System.Xml.XmlDocument { } // Noncompliant\n\n    class Foo3 : System.Collections.CollectionBase { } // Noncompliant\n\n    class Foo4 : System.Collections.DictionaryBase { } // Noncompliant\n\n    class Foo5 : System.Collections.Queue { } // Noncompliant\n\n    class Foo6 : System.Collections.ReadOnlyCollectionBase { } // Noncompliant\n\n    class Foo7 : System.Collections.SortedList { } // Noncompliant\n\n    class Foo8 : System.Collections.Stack { } // Noncompliant\n\n    class Foo9 : Stack { } // Noncompliant\n\n    class Foo10 : System.Collections.ICollection\n    {\n        public int Count { get { throw new NotImplementedException(); } }\n\n        public bool IsSynchronized { get { throw new NotImplementedException(); } }\n\n        public object SyncRoot { get { throw new NotImplementedException(); } }\n\n        public void CopyTo(Array array, int index) { throw new NotImplementedException(); }\n\n        public IEnumerator GetEnumerator() { throw new NotImplementedException(); }\n    }\n\n    class Foo11 : Dictionary<int, object> { }\n\n    class Foo12 { }\n\n    class FooBase : XmlDocument { } // Noncompliant\n\n    class FooDerived : FooBase { } // Compliant - doesn't directly implement type\n\n    class Foo13 : InvalidType{ } // Error [CS0246] - unknown type\n\n    class : System.Collections.Stack { } // Error [CS1001] - missing identifier\n}\n\n\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnaryPrefixOperatorRepeated.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n\n    class UnaryPrefixOperatorRepeated\n    {\n        static void NonComp(bool bbb)\n        {\n            int i = 1;\n\n            int k = i; // Fixed\n            int m = + +i; // Compliant\n            int n = - -i; // Compliant, we care only about !\n\n            bool b = false;\n            bool c = !b; // Fixed\n\n            NonComp(!b); // Fixed\n        }\n\n        static void Comp()\n        {\n            int i = 1;\n\n            int j = -i;\n            j = -(-i); // Compliant, not a typo\n            int k = i;\n            int m = i;\n\n            bool b = false;\n            bool c = !b;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnaryPrefixOperatorRepeated.Latest.cs",
    "content": "﻿using System;\nusing System.Numerics;\n\npublic class Noncompliant\n{\n    public void NoncompliantExample(WeirdOperatorOverride woo)\n    {\n        var result = ~~woo; // Noncompliant\n    }\n}\n\npublic class WeirdOperatorOverride : IBitwiseOperators<WeirdOperatorOverride, WeirdOperatorOverride, WeirdOperatorOverride>\n{\n    public static WeirdOperatorOverride operator ~(WeirdOperatorOverride value) => throw new NotImplementedException();\n    public static WeirdOperatorOverride operator &(WeirdOperatorOverride left, WeirdOperatorOverride right) => throw new NotImplementedException();\n    public static WeirdOperatorOverride operator |(WeirdOperatorOverride left, WeirdOperatorOverride right) => throw new NotImplementedException();\n    public static WeirdOperatorOverride operator ^(WeirdOperatorOverride left, WeirdOperatorOverride right) => throw new NotImplementedException();\n}\n\n\npublic class TimerRemaining\n{\n    TimerRemaining countdown = new TimerRemaining()\n    {\n        buffer =\n        {\n            [^~~42] = 0, // Noncompliant\n        }\n    };\n    public int[] buffer = new int[10];\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnaryPrefixOperatorRepeated.TopLevelStatements.cs",
    "content": "﻿nint i = 1;\nnint k = ~~i; // Noncompliant; same as i\n//       ^^\nnint m = + +i; // Compliant\nnint n = - -i; // Compliant, we care only about !\n\nbool b = false;\nbool c = !!!b; // Noncompliant\n\nbool d = !!!b; // Noncompliant {{Use the '!' operator just once or not at all.}}\n\nnuint j = +1;\nj = +(+j); // Compliant, not a typo\nbool e = !b;\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnaryPrefixOperatorRepeated.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n\n    class UnaryPrefixOperatorRepeated\n    {\n        static void NonComp(bool bbb)\n        {\n            int i = 1;\n\n            int k = ~~i; // Noncompliant; same as i\n//                  ^^\n            int m = + +i; // Compliant\n            int n = - -i; // Compliant, we care only about !\n\n            bool b = false;\n            bool c = !!!b; // Noncompliant\n\n            NonComp(!!!b); // Noncompliant {{Use the '!' operator just once or not at all.}}\n        }\n\n        static void Comp()\n        {\n            int i = 1;\n\n            int j = -i;\n            j = -(-i); // Compliant, not a typo\n            int k = i;\n            int m = i;\n\n            bool b = false;\n            bool c = !b;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnaryPrefixOperatorRepeated.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\n\nNamespace Tests.Diagnostics\n    Class UnaryPrefixOperatorRepeated\n        Private Shared Sub NonComp(ByVal bbb As Boolean)\n            Dim i As Integer = 1\n            Dim k As Integer = Not Not i 'Noncompliant {{Use the 'Not' operator just once or not at all.}}\n'                              ^^^^^^^\n            Dim m As Integer = + +i 'Compliant, we care only about Not\n            Dim n As Integer = - -i 'Compliant, we care only about Not\n            Dim b As Boolean = False\n            Dim c As Boolean = Not Not Not b 'Noncompliant\n            NonComp(Not Not Not b) 'Noncompliant\n        End Sub\n\n        Private Shared Sub Comp()\n            Dim i As Integer = 1\n            Dim j As Integer = -i\n            j = -(-i) 'Compliant\n            Dim k As Integer = i\n            Dim m As Integer = i\n            Dim b As Boolean = False\n            Dim c As Boolean = Not b\n        End Sub\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnchangedLocalVariablesShouldBeConst.Fixed.cs",
    "content": "﻿using System;\n\nclass ToReplace\n{\n    void Alias()\n    {\n        const string str = \"str\";\n        const bool b = false;\n        const char ch = 'c';\n        const byte bits = 8;\n        const sbyte sbits = 8;\n        const short int16 = 16;\n        const ushort uint16 = 16;\n        const int int32 = 32;\n        const uint uint32 = 32;\n        const long int64 = 64;\n        const ulong ulongVal = 64;\n        const float single = 32;\n        const double floating = 64;\n        const decimal dec = 128;\n        const ConsoleColor enumeration = ConsoleColor.Red;\n    }\n\n    void Multiple()\n    {\n        int int32_0 = 0,           // Fixed\n            int32_1 = 1;           // Fixed\n\n        int mixed_0 = DateTime.Now.Day, // Compliant\n            mixed_1 = 1,                // Fixed\n            mixed_2;                    // Compliant\n    }\n\n    void Var()\n    {\n        const string refType = \"str\";\n        const int valueType = 42;\n        const ConsoleColor enumeration = ConsoleColor.Red;\n        const AttributeTargets attributeTarget = System.AttributeTargets.All;\n    }\n\n    void Full()\n    {\n        const System.String str = \"str\";\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnchangedLocalVariablesShouldBeConst.Latest.cs",
    "content": "﻿using System;\nusing Person = (string, string);\n\npublic class Sample(string str)\n{\n    public void Method()\n    {\n        string sample1 = $\"{nameof(str)}\";    // Noncompliant, compile-time interpolated string\n        string sample2 = nameof(Person);      // Noncompliant, nameof of alias is compile-time\n        string sample3 = $\"{nameof(Person)}\"; // Noncompliant\n    }\n\n    //https://sonarsource.atlassian.net/browse/NET-534\n    public void Test()\n    {\n        int a = 42; // Noncompliant\n        ref readonly int r = ref a;\n\n        int b = 42; // Compliant\n        ref int x = ref b;\n        x++;\n\n        int c = 42; // Compliant\n        ReadonlyRef(ref c);\n\n        int d = 42; // Compliant\n        InRef(in d);\n    }\n\n    public void ReadonlyRef(ref readonly int number)\n    {\n        int x = number;\n    }\n\n    public void InRef(in int number)\n    {\n        var z = number;\n    }\n}\n\n// https://community.sonarsource.com/t/132389\nnamespace Repro_132389\n{\n    class Repro\n    {\n        public void Method()\n        {\n            int value = 0; // Noncompliant - FP leads to a CS1510\n            value.RefExtension();\n\n            int value1 = 0; // Noncompliant - FP leads to warning CS9193: Argument 0 should be a variable because it is passed to a 'ref readonly' parameter\n            value1.RefReadonlyExtension();\n\n            int value2 = 0; // Noncompliant - TP\n            value2.InExtension();\n        }\n\n        public void MethodWithCS9193()\n        {\n            const int alreadyConst = 0;\n            alreadyConst.RefReadonlyExtension(); // Error [CS9193] - compiler warning \"Argument 0 should be a variable because it is passed to a 'ref readonly' parameter\"\n        }\n    }\n\n    public static class IntExtensions\n    {\n        public static void RefExtension(this ref int value) { }\n        public static void RefReadonlyExtension(this ref readonly int value) { }\n        public static void InExtension(this in int value) { }\n    }\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnchangedLocalVariablesShouldBeConst.ToFix.cs",
    "content": "﻿using System;\n\nclass ToReplace\n{\n    void Alias()\n    {\n        string str = \"str\";   // Noncompliant\n        bool b = false;       // Noncompliant\n        char ch = 'c';        // Noncompliant\n        byte bits = 8;        // Noncompliant\n        sbyte sbits = 8;      // Noncompliant\n        short int16 = 16;     // Noncompliant\n        ushort uint16 = 16;   // Noncompliant\n        int int32 = 32;       // Noncompliant\n        uint uint32 = 32;     // Noncompliant\n        long int64 = 64;      // Noncompliant\n        ulong ulongVal = 64;  // Noncompliant\n        float single = 32;    // Noncompliant\n        double floating = 64; // Noncompliant\n        decimal dec = 128;    // Noncompliant\n        ConsoleColor enumeration = ConsoleColor.Red; // Noncompliant\n    }\n\n    void Multiple()\n    {\n        int int32_0 = 0,           // Noncompliant\n            int32_1 = 1;           // Noncompliant\n\n        int mixed_0 = DateTime.Now.Day, // Compliant\n            mixed_1 = 1,                // Noncompliant\n            mixed_2;                    // Compliant\n    }\n\n    void Var()\n    {\n        var refType = \"str\"; // Noncompliant\n        var valueType = 42;  // Noncompliant\n        var enumeration = ConsoleColor.Red; // Noncompliant;\n        var attributeTarget = System.AttributeTargets.All; // Noncompliant;\n    }\n\n    void Full()\n    {\n        System.String str = \"str\"; // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnchangedLocalVariablesShouldBeConst.TopLevelStatements.cs",
    "content": "﻿#nullable enable\nusing System;\n\nint target = 32; // Noncompliant {{Add the 'const' modifier to 'target'.}}\n//  ^^^^^^\nint usedTarget = 40; // Compliant\nconst int alreadyConst = 32;\n\n(int i, usedTarget) = (target, target);\n(usedTarget, int k) = (alreadyConst, alreadyConst);\n\nvar s1 = $\"This is a {nameof(target)}\";      // Noncompliant {{Add the 'const' modifier to 's1', and replace 'var' with 'string?'.}}\nstring s2 = $\"This is a {nameof(target)}\";   // Noncompliant {{Add the 'const' modifier to 's2'.}}\nvar s3 = \"This is a\" + $\" {nameof(target)}\"; // Noncompliant {{Add the 'const' modifier to 's3', and replace 'var' with 'string?'.}}\nvar s4 = $@\"This is a {nameof(target)}\";     // Noncompliant {{Add the 'const' modifier to 's4', and replace 'var' with 'string?'.}}\nFormattableString s6 = $\"hello\";             // Compliant\n#nullable disable\n\nif (target == alreadyConst)\n{\n}\n\nnint foo = 42; // Noncompliant\n\nnuint bar = 31;\nbar++;\n\nnint foo1 = IntPtr.Zero; // Compliant - IntPtr.Zero is not compile time constant\nnuint bar2 = UIntPtr.Zero; // Compliant - UIntPtr.Zero is not compile time constant\n\nif (target == (int)bar)\n{\n}\n\nint i1 = 32; // Noncompliant \nconst int i2 = 32; // Compliant\n\nIntPtr ptrFoo = 42; // Noncompliant\nUIntPtr foo2 = 42; // Noncompliant\n\nconst IntPtr constFoo = 42; // Compliant\nconst UIntPtr constFoo2 = 42; // Compliant\n\nIntPtr ptrBar = 31; // Compliant\nptrBar++;\n\nIntPtr ptrBar2 = 31; // Compliant\nptrBar2++;\n\nIntPtr zero1 = IntPtr.Zero; // Compliant - IntPtr.Zero is not compile time constant\nUIntPtr zero2 = UIntPtr.Zero; // Compliant - UIntPtr.Zero is not compile time constant\n\nIntPtr compared = 42; // Noncompliant - (==) does not alter the value, should be const\n\nif (compared == 42)\n{\n}\n\nFunc<nint> staticLambda1 = static () =>\n{\n    IntPtr v = 41; // Noncompliant\n    return v;\n};\n\nFunc<nuint> staticLamba2 = static () =>\n{\n    UIntPtr v = 41; // Noncompliant\n    return v;\n};\n\nFunc<int, int> staticLambda = static (t) =>\n{\n    int v = 41; // Noncompliant\n    return v;\n};\n\nFunc<int, int, int> withDiscard = static (_, _) =>\n{\n    int v = 41; // Noncompliant\n    return v;\n};\n\npublic record Rec\n{\n    public Rec()\n    {\n        int target = 32; // Noncompliant {{Add the 'const' modifier to 'target'.}}\n//          ^^^^^^\n        if (target == 1)\n        {\n        }\n    }\n\n    public void Test_Shadowing()\n    {\n        int shadowed = 0;\n        shadowed++;\n\n        void LocalFunction()\n        {\n            int shadowed = 0; // Noncompliant\n        }\n\n        Action a1 = () =>\n        {\n            int shadow = 0; // Noncompliant\n        };\n\n        Action<int> a2 = x =>\n        {\n            int shadow = 0; // Noncompliant\n        };\n\n        Action a3 = delegate ()\n        {\n            int shadow = 0; // Noncompliant\n        };\n    }\n}\n\npublic record RecordWithImplicitOperator\n{\n    public static implicit operator RecordWithImplicitOperator(string value) { return new RecordWithImplicitOperator(); }\n}\n\npublic class Repro_3271\n{\n    public RecordWithImplicitOperator ImplicitOperator()\n    {\n        RecordWithImplicitOperator x = \"Lorem\";\n        return x;\n    }\n\n    public Rec NormalRecordSetToNull()\n    {\n        Rec x = null;   // Noncompliant\n        return x;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnchangedLocalVariablesShouldBeConst.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq.Expressions;\n\nnamespace Tests.Diagnostics\n{\n    class TestUtils\n    {\n        public static void OutParam(out int x)\n        {\n            x = 42;\n        }\n\n        public static void RefParam(ref int x)\n        {\n            x = 42;\n        }\n\n        public static void NormalCall(int x)\n        {\n            x = 42;\n        }\n\n        public static object GetObj() => new object();\n\n        public static implicit operator TestUtils(int val)\n        {\n            return new TestUtils();\n        }\n    }\n\n    class Tests\n    {\n        // RSPEC sample\n        public bool Seek(int[] input)\n        {\n            int target = 32;  // Noncompliant {{Add the 'const' modifier to 'target'.}}\n//              ^^^^^^\n            foreach (int i in input)\n            {\n                if (i == target)\n                {\n                    return true;\n                }\n            }\n            return false;\n        }\n\n        public bool Test_AlreadyConst()\n        {\n            const int target = 32;\n\n            return false;\n        }\n\n        public bool Test_TwoAssignments()\n        {\n            int target = 32;\n            target = 33;\n\n            return false;\n        }\n\n        public bool Test_PostIncrement()\n        {\n            int target = 32;\n            target++;\n\n            return false;\n        }\n\n        public bool Test_PreDecrement()\n        {\n            int target = 32;\n            --target;\n\n            return false;\n        }\n\n        public bool Test_Compare()\n        {\n            int target = 32; // Noncompliant\n\n            if (target == 32)\n            {\n                // bla bla\n            }\n\n            return false;\n        }\n\n        public bool Test_AssignOperators()\n        {\n            int i = 1, j = 1, k = 1, l = 1, m = 32;\n\n            i <<= 1;\n            j *= 1;\n            k -= 1;\n            l /= 1;\n            m %= 1;\n\n            return false;\n        }\n\n        public bool Test_MethodInvocation()\n        {\n            int target = 32; // Noncompliant\n            TestUtils.NormalCall(target);\n\n            return false;\n        }\n\n        public bool Test_RefParameter()\n        {\n            int target = 32;\n            TestUtils.RefParam(ref target);\n\n            return false;\n        }\n\n        public bool Test_OutParameter()\n        {\n            int target = 32;\n            TestUtils.OutParam(out target);\n\n            return false;\n        }\n\n        public bool Test_Lambda()\n        {\n            int target = 32;\n\n            Func<int, int> fun = (t) => { target++; return 1; };\n\n            var x = fun(target);\n\n            return false;\n        }\n\n        public bool Test_InnerFunction()\n        {\n            int target = 32;\n\n            var x = inner(target);\n\n            return false;\n\n            int inner(int t)\n            {\n                target++;\n                return 1;\n            }\n        }\n\n        public bool Test_MultipleVariables()\n        {\n            const int const1 = 386, const2 = 486;\n\n            // Noncompliant@+1 {{Add the 'const' modifier to 'var1'.}}\n            int var1 = 1, var2 = 2; // Noncompliant {{Add the 'const' modifier to 'var2'.}}\n            int var3 = 1, var4 = 2; // Noncompliant {{Add the 'const' modifier to 'var4'.}}\n\n            var3 += 1;\n\n            return false;\n        }\n\n        enum Colors { Red, Blue, Green, Nice };\n\n        public void Test_MultipleTypes(int arg)\n        {\n            char cc = 'c';              // Noncompliant\n            int intVar = 1;             // Noncompliant\n            const int constIntVar = 1;\n            int intVar2 = 1 + constIntVar;  // Noncompliant\n            long longVal = 1;           // Noncompliant\n            short shortVal = 1;         // Noncompliant\n            double doubleVal = 1;       // Noncompliant\n            System.Int16 int16Val = 1;  // Noncompliant\n            ulong ulongVal = 1;         // Noncompliant\n            int bufferSize = 512 * 1024;    // Noncompliant\n            decimal val = 123.456m;     // Noncompliant\n            double val2 = .1d;          // Noncompliant\n\n            Colors c1 = Colors.Nice;    // Noncompliant\n            Colors c2 = (Colors)1;      // Noncompliant\n            Colors c3 = 0.0;            // Noncompliant\n\n            string str1 = \"\";           // Noncompliant\n            string str2 = null;         // Noncompliant\n            string str3 = nameof(arg);  // Noncompliant\n            string str4 = typeof(int).Name;\n            string str5 = \"a\" + \"b\";    // Noncompliant\n            string str6 = @\"a\" + $\"b\";  // Noncompliant. Was FN until Roslyn 3.11.0.\n            string str7 = System.Environment.NewLine;\n            string str8 = String.Empty;\n\n            object obj1 = null;         // Noncompliant\n            object obj2 = new object();\n            object obj3 = TestUtils.GetObj();\n            object obj4 = 1;\n\n            IEnumerable<string> enumerable = null; // Noncompliant\n\n            long? nullable = 100;   // Compliant. Nullables cannot be const.\n            long? nullable2 = null; // Compliant. Nullables cannot be const.\n\n            dynamic value = 42; // Compliant. Const only works with null.\n            TestUtils x = 2;    // Compliant (type with implicit conversion). Const only works with null.\n\n            int[] xx = { 1, 2, 3 };             // Compliant (expression on the right is not constant).\n            int[] y = new int[] { 1, 2, 3 };    // Compliant (expression on the right is not constant).\n            Exception[] z = { };                // Compliant (expression on the right is not constant).\n        }\n\n        public int Test_Property\n        {\n            get\n            {\n                int a = 1; // Noncompliant\n                return a;\n            }\n            set\n            {\n                int a = 1;\n                int b = 1; // Noncompliant\n                a = 2;\n            }\n        }\n\n        public static Tests operator +(Tests a, Tests b)\n        {\n            int i = 1; // Noncompliant\n            return null;\n        }\n\n        public Tests()\n        {\n            int a = 1; // Noncompliant\n        }\n\n\n        public void Test_FalseNegatives()\n        {\n            int a;\n            a = 1;\n        }\n\n        public byte this[int idx]\n        {\n            get\n            {\n                var pos = 0;\n                var seen = 0;\n\n                seen += 1;\n                pos += 1;\n\n                return 1;\n            }\n        }\n\n        static readonly Func<string, bool> LambdaExpressionSyntax = year =>\n        {\n            bool isValid = false; // Compliant\n\n            if (short.TryParse(year, out short shortYear))\n            {\n                isValid = true;\n            }\n\n            return isValid;\n        };\n\n        static readonly Func<string, bool> ParenthesizedLambdaExpressionSyntax = (year) =>\n        {\n            bool isValid = false; // Compliant\n\n            if (short.TryParse(year, out short shortYear))\n            {\n                isValid = true;\n            }\n\n            return isValid;\n        };\n\n        static readonly Func<string, bool> UnchangedLocalValiableInLambda = year =>\n        {\n            bool isValid = false; // Noncompliant\n\n            return isValid;\n        };\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/3271\n    public class Repro_3271\n    {\n        public void GoGoGo()\n        {\n            var tmp = 0;\n            var flag = true;\n            (flag, tmp) = (false, 5);\n        }\n\n        public void UninitializedTuple()\n        {\n            int tmp;\n            bool flag;\n            (flag, tmp) = (false, 5);\n        }\n\n        public void ReadInTuple()\n        {\n            int tmp = 5;            // Noncompliant\n            bool flag = false;      // Noncompliant\n            var x = (flag, tmp);\n        }\n\n        public struct StructWithImplicitOperator\n        {\n            public static implicit operator StructWithImplicitOperator(int value) { return new StructWithImplicitOperator(); }\n        }\n\n        public StructWithImplicitOperator ImplicitOperatorStruct()\n        {\n            StructWithImplicitOperator x = 1;\n            return x;\n        }\n\n        public class ClassWithImplicitOperator\n        {\n            public static implicit operator ClassWithImplicitOperator(int value) { return new ClassWithImplicitOperator(); }\n        }\n\n        public ClassWithImplicitOperator ImplicitOperatorClass()\n        {\n            ClassWithImplicitOperator x = 1;\n            return x;\n        }\n\n        public class NormalClass { }\n\n        public NormalClass NormalClassSetToNull()\n        {\n            NormalClass x = null; // Noncompliant\n            return x;\n        }\n    }\n}\n\nclass ShadowingTest\n{\n    private int Counter = 0;\n    public void Tests()\n    {\n        int Counter = 1; // Noncompliant\n        this.Counter++;\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/4015\npublic class Repro_4015\n{\n    Expression<Func<string>> fieldExpression;\n    Func<string> fieldFunc;\n\n    public void Compliant_SimpleLambda()\n    {\n        string localVariable = null;    // Compliant, changing the Expression<Func<T>> below changes the behavior of the code\n        WithExpressionArgument(x => localVariable);\n    }\n\n    public void Compliant_ParenthesizedLambda()\n    {\n        string localVariable = null;    // Compliant, changing the Expression<Func<T>> below changes the behavior of the code\n        WithExpressionArgument(() => localVariable);\n    }\n\n    public void Compliant_ParenthesizedExpression()\n    {\n        string localVariable = null;\n        WithExpressionArgument(((() => localVariable)));\n    }\n\n    public void Noncompliant_Func()\n    {\n        string localVariable = null;    // Noncompliant, this can be const\n        WithFuncArgument(() => localVariable);\n    }\n\n    public void Compliant_Assignment()\n    {\n        string a = null;\n        string b = null;\n        string c = null;\n        string d = null;\n        var repro = new Repro_4015();\n        Expression<Func<string>> variableExpression;\n\n        // Compliant cases, changing the Expression<Func<T>> below changes the behavior of the code\n        fieldExpression = () => a;\n        WithExpressionArgument(fieldExpression);\n\n        repro.fieldExpression = () => b;\n        WithExpressionArgument(repro.fieldExpression);\n\n        variableExpression = () => c;\n        WithExpressionArgument(variableExpression);\n\n        variableExpression = ((() => d));\n        WithExpressionArgument(variableExpression);\n    }\n\n    public void Noncompliant_Assignment()\n    {\n        string a = null;    // Noncompliant\n        string b = null;    // Noncompliant\n        string c = null;    // Noncompliant\n        var repro = new Repro_4015();\n        Func<string> variableFunc;\n\n        fieldFunc = () => a;\n        WithFuncArgument(fieldFunc);\n\n        repro.fieldFunc = () => b;\n        WithFuncArgument(repro.fieldFunc);\n\n        variableFunc = () => c;\n        WithFuncArgument(variableFunc);\n    }\n\n    private void WithExpressionArgument(Expression<Func<string>> expression)\n    {\n        if (!(expression.Body is MemberExpression))\n        {\n            throw new InvalidOperationException($\"The expression body is a {expression.Body.GetType().Name}, but MemberExpression is expected.\");\n        }\n    }\n\n    private void WithExpressionArgument(Expression<Func<string, string>> expression)\n    {\n        if (!(expression.Body is MemberExpression))\n        {\n            throw new InvalidOperationException($\"The expression body is a {expression.Body.GetType().Name}, but MemberExpression is expected.\");\n        }\n    }\n\n    private void WithFuncArgument(Func<string> expression)\n    {\n        expression();\n    }\n\n    public void UndefinedInvocationSymbol()\n    {\n        string localVariable = null;        // Noncompliant\n        Undefined(() => localVariable);     // Error [CS0103]: The name 'Undefined' does not exist in the current context\n        undefined = () => localVariable;    // Error [CS0103]: The name 'undefined' does not exist in the current context\n    }\n\n    public void IndexerIndexedByLambda_CrazyCoverage()\n    {\n        string localVariable = null;        // Noncompliant\n        this[() => localVariable] = 42;     // Case with lambda on the left side of an assignment\n    }\n\n    public int this[Func<string> key]\n    {\n        get\n        {\n            var k = key();\n            return 42;\n        }\n        set { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnchangedLocalVariablesShouldBeConst.cshtml.ide.g.cs",
    "content": "﻿// https://sonarsource.atlassian.net/browse/NET-1106\n// <auto-generated/>\n#pragma warning disable 1591\nnamespace AspNetCoreGeneratedDocument\n{\n    #line default\n    using TModel = global::System.Object;\n    using global::System;\n    using global::System.Collections.Generic;\n    using global::System.Linq;\n    using global::System.Threading.Tasks;\n    using global::Microsoft.AspNetCore.Mvc;\n    using global::Microsoft.AspNetCore.Mvc.Rendering;\n    using global::Microsoft.AspNetCore.Mvc.ViewFeatures;\n#nullable restore\n#line 1 \"C:\\Users\\sebastien.marichal\\Downloads\\WebApplication1\\WebApplication1\\Views\\Test.cshtml\"\nusing Microsoft.Extensions.Configuration;\n\n#line default\n#line hidden\n#nullable disable\n    [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute(\"Identifier\", \"/Views/Test.cshtml\")]\n    [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute]\n    #nullable restore\n    internal sealed class Views_Test : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic>\n    #nullable disable\n    {\n        #pragma warning disable 219\n        private void __RazorDirectiveTokenHelpers__() {\n        ((global::System.Action)(() => {\n#nullable restore\n#line 33 \"C:\\Users\\sebastien.marichal\\Downloads\\WebApplication1\\WebApplication1\\Views\\Test.cshtml\" // Original location is line 2 but otherwise it would messed with the line numbers\nIConfiguration __typeHelper = default!; // Noncompliant - FP\n\n#line default\n#line hidden\n#nullable disable\n        }\n        ))();\n        ((global::System.Action)(() => {\n#nullable restore\n#line 43 \"C:\\Users\\sebastien.marichal\\Downloads\\WebApplication1\\WebApplication1\\Views\\Test.cshtml\" // Original location is line 2 but otherwise it would messed with the line numbers\nglobal::System.Object Configuration = null!; // Noncompliant - FP It should/can not be const\n#line default\n#line hidden\n#nullable disable\n        }\n        ))();\n        }\n        #pragma warning restore 219\n        #pragma warning disable 0414\n        private static object __o = null;\n        #pragma warning restore 0414\n        #pragma warning disable 1998\n        public async override global::System.Threading.Tasks.Task ExecuteAsync()\n        {\n#nullable restore\n#line 5 \"C:\\Users\\sebastien.marichal\\Downloads\\WebApplication1\\WebApplication1\\Views\\Test.cshtml\"\n if (Configuration != null)\n{\n\n\n#line default\n#line hidden\n#nullable disable\n#nullable restore\n#line 7 \"C:\\Users\\sebastien.marichal\\Downloads\\WebApplication1\\WebApplication1\\Views\\Test.cshtml\"\n__o = Configuration[\"Test\"];\n\n#line default\n#line hidden\n#nullable disable\n#nullable restore\n#line 7 \"C:\\Users\\sebastien.marichal\\Downloads\\WebApplication1\\WebApplication1\\Views\\Test.cshtml\"\n\n}\n\n#line default\n#line hidden\n#nullable disable\n        }\n        #pragma warning restore 1998\n        #nullable restore\n        [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]\n        public IConfiguration Configuration { get; private set; } = default!;\n        #nullable disable\n        #nullable restore\n        [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]\n        public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!;\n        #nullable disable\n        #nullable restore\n        [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]\n        public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!;\n        #nullable disable\n        #nullable restore\n        [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]\n        public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!;\n        #nullable disable\n        #nullable restore\n        [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]\n        public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!;\n        #nullable disable\n        #nullable restore\n        [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]\n        public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<dynamic> Html { get; private set; } = default!;\n        #nullable disable\n    }\n}\n#pragma warning restore 1591\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnconditionalJumpStatement.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\npublic class StaticLocalFunctions\n{\n    public void StaticLocalFunctionInLoop()\n    {\n        while (true)\n        {\n            static void Throw()\n            {\n                throw new InvalidOperationException(\"Message\");\n            }\n        }\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/7987\nclass Repro7987\n{\n    void Test(List<object> items)\n    {\n        var newItems = new List<object>();\n        foreach (var item in items)\n        {\n            LocalFunction(item);\n            continue;                                   // Noncompliant FP\n\n            void LocalFunction(object item)\n            {\n                if (items.Count < 10)\n                    newItems.Add(item);\n            }\n        }\n    }\n}\n\npublic class NullConditionalAssignment\n{\n    public class Sample\n    {\n        public int Value { get; set; }\n    }\n\n    public void Test(Sample sample, int? value)\n    {\n        while (true)\n        {\n            sample?.Value = value ?? throw new InvalidOperationException(); // Compliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnconditionalJumpStatement.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Threading.Tasks;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        public void Test1(string[] strings, int length)\n        {\n            for (int i = 0; i < length; i++)\n            {\n                break; // Noncompliant {{Refactor the containing loop to do more than one iteration.}}\n//              ^^^^^^\n            }\n\n            for (int i = 0; i < length; i++)\n            {\n                continue; // Noncompliant FP https://sonarsource.atlassian.net/browse/NET-2421\n            }\n\n            for (int i = 0; i < length; i++)\n            {\n                return; // Noncompliant\n            }\n\n            for (int i = 0; i < length; i++)\n            {\n                throw new Exception(); // Noncompliant\n            }\n\n            foreach (var s in strings)\n            {\n                break; // Noncompliant\n            }\n\n            foreach (var s in strings)\n            {\n                continue; // Noncompliant FP https://sonarsource.atlassian.net/browse/NET-2421\n            }\n\n            foreach (var s in strings)\n            {\n                return; // Noncompliant\n            }\n\n            foreach (var s in strings)\n            {\n                throw new Exception(); // Noncompliant\n            }\n\n            while (true)\n            {\n                break; // Noncompliant\n            }\n\n            while (true)\n            {\n                continue; // Noncompliant FP https://sonarsource.atlassian.net/browse/NET-2421 \n            }\n\n            while (true)\n            {\n                return; // Noncompliant\n            }\n\n            while (true)\n            {\n                throw new Exception(); // Noncompliant\n            }\n\n            do\n            {\n                break; // Noncompliant\n            }\n            while (true);\n\n            do\n            {\n                continue; // Noncompliant FP https://sonarsource.atlassian.net/browse/NET-2421\n            }\n            while (true);\n\n            do\n            {\n                return; // Noncompliant\n            }\n            while (true);\n\n            do\n            {\n                throw new Exception(); // Noncompliant\n            }\n            while (true);\n        }\n\n        public void Test2(string[] strings, bool stop)\n        {\n            while (true)\n            {\n                if (stop)\n                {\n                    break; // Compliant\n                }\n            }\n\n            while (true)\n            {\n                if (stop)\n                {\n                    continue; // Compliant\n                }\n            }\n\n            while (true)\n            {\n                if (stop)\n                {\n                    return; // Compliant\n                }\n            }\n\n            while (true)\n            {\n                if (stop)\n                {\n                    throw new Exception(); // Compliant\n                }\n            }\n        }\n\n        public void Test3(string[] strings, bool stop)\n        {\n            if (stop)\n            {\n                while (true)\n                {\n                    break; // Noncompliant\n                }\n\n                while (true)\n                {\n                    continue; // Noncompliant FP https://sonarsource.atlassian.net/browse/NET-2421\n                }\n\n                while (true)\n                {\n                    return; // Noncompliant {{Refactor the containing loop to do more than one iteration.}}\n//                  ^^^^^^^\n                }\n\n                while (true)\n                {\n                    throw new Exception(); // Noncompliant {{Refactor the containing loop to do more than one iteration.}}\n//                  ^^^^^^^^^^^^^^^^^^^^^^\n                }\n            }\n        }\n\n        public void Test4(string[] strings, int padding)\n        {\n            while (true)\n            {\n                switch (padding)\n                {\n                    case 1:\n                        break; // Compliant\n                    case 2:\n                        throw new Exception(); // Compliant\n                    default:\n                        break; // Compliant\n                }\n            }\n\n            while (true)\n            {\n                switch (padding)\n                {\n                    case 1:\n                        return; // Compliant\n                    default:\n                        return; // Compliant\n                }\n            }\n        }\n\n        public void Test5(Action doSomething, Action<Exception> logError)\n        {\n            while (true)\n            {\n                try\n                {\n                    doSomething();\n                }\n                catch (Exception e)\n                {\n                    logError(e);\n                    throw; // Compliant\n                }\n            }\n        }\n\n        public Func<int> Test6 = () =>\n        {\n            if (true)\n            {\n                return 5;\n            }\n            else\n            {\n                return 10;\n            }\n        };\n\n        public void Test7()\n        {\n            while (true)\n            {\n                if (Foo())\n                {\n                    continue;\n                }\n\n                break;\n                GetHashCode();\n            }\n        }\n\n        public bool Foo() { return true; }\n\n        public void Test8()\n        {\n            while (true)\n            {\n                if (true)\n                {\n                    break;\n                }\n\n                continue; // Noncompliant FP https://sonarsource.atlassian.net/browse/NET-2421\n            }\n        }\n\n        public void Test9()\n        {\n            while (true)\n            {\n                if (true)\n                {\n                    continue;\n                }\n\n                return; // Compliant\n            }\n        }\n\n        public void Test10()\n        {\n            while (true)\n            {\n                if (true)\n                {\n                    throw new Exception();\n                }\n\n                continue; // Noncompliant FP https://sonarsource.atlassian.net/browse/NET-2421\n            }\n        }\n\n        public void Test11()\n        {\n            while (true)\n            {\n                if (true)\n                {\n                    return;\n                }\n\n                break; // Noncompliant\n            }\n        }\n        public void Test12()\n        {\n            while (true)\n            {\n                foo();\n                bar();\n                continue; // Noncompliant FP https://sonarsource.atlassian.net/browse/NET-2421\n            }\n        }\n        public void Test13()\n        {\n            while (true)\n            {\n                foo();\n                continue; // Noncompliant FP https://sonarsource.atlassian.net/browse/NET-2421\n                bar();\n            }\n        }\n\n        public void Test14()\n        {\n            while (true)\n            {\n                foo();\n                continue; // Noncompliant FP https://sonarsource.atlassian.net/browse/NET-2421\n                bar();\n            }\n        }\n\n        public void Test15()\n        {\n            while (true)\n            {\n                UtilFunc(() =>\n                {\n                    return; // Compliant\n                });\n\n                continue; // Noncompliant FP https://sonarsource.atlassian.net/browse/NET-2421\n            }\n        }\n\n        public void Test16()\n        {\n            while (true)\n            {\n                if (true)\n                {\n                    ;\n                }\n                else\n                {\n                    continue;\n                }\n\n                break; // Compliant\n            }\n        }\n\n        public void Test17()\n        {\n            while (true)\n            {\n                while (true)\n                {\n                    if (true)\n                    {\n                        ;\n                    }\n                    else\n                    {\n                        break;\n                    }\n                }\n\n                break; // Noncompliant\n            }\n        }\n\n        void UtilFunc(Action a)\n        {\n        }\n\n        public bool TestWithRetry(Action doSomething)\n        {\n            for (int i = 0; i < 3; i++)\n            {\n                try\n                {\n                    doSomething();\n                    return true; // Compliant\n                }\n                catch (Exception e)\n                {\n                    if (i == 2)\n                    {\n                        return false; // Compliant\n                    }\n                }\n            }\n\n            return false;\n        }\n\n        public bool TestWithRetry2()\n        {\n            for (int i = 0; i < 3; i++)\n            {\n                try\n                {\n                    return true; // Noncompliant\n                }\n                catch (Exception e)\n                {\n                    if (i == 2)\n                    {\n                        return false; // Compliant\n                    }\n                }\n            }\n\n            return false;\n        }\n\n        public bool TestWithRetry3(Func<bool> doSomething)\n        {\n            for (int i = 0; i < 3; i++)\n            {\n                try\n                {\n                    return (((doSomething()))); // Compliant\n                }\n                catch (Exception e)\n                {\n                    if (i == 2)\n                    {\n                        return false; // Compliant\n                    }\n                }\n            }\n\n            return false;\n        }\n\n        public bool TestWithRetry4(Action doSomething, Action<Exception> logError)\n        {\n            for (int i = 0; i < 3; i++)\n            {\n                try\n                {\n                    doSomething();\n                }\n                catch (Exception e)\n                {\n                    logError(e);\n                }\n                finally\n                {\n                }\n            }\n\n            return true;\n        }\n\n        public async Task<bool> TestWithRetry5(Func<Task<bool>> doSomething)\n        {\n            for (int i = 0; i < 3; i++)\n            {\n                try\n                {\n                    return (((await doSomething()))); // Compliant\n                }\n                catch (Exception e)\n                {\n                    if (i == 2)\n                    {\n                        return false; // Compliant\n                    }\n                }\n            }\n\n            return false;\n        }\n\n        public void ResetRetryTimeout() { }\n        public bool WaitRetryTimeout() { return true; }\n\n        protected virtual FileStream CreateLock(string lockFileName, bool retries)\n        {\n            if (retries) ResetRetryTimeout();\n            FileStream filelock = null;\n            while (true)\n            {\n                try\n                {\n                    filelock = new FileStream(lockFileName,\n                        FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None, 8, FileOptions.DeleteOnClose);\n                    return filelock;\n                }\n                catch (Exception e)\n                {\n                    int code = System.Runtime.InteropServices.Marshal.GetHRForException(e);\n                    if (code == unchecked((int)0x80070020) ||\n                        code == unchecked((int)0x80070021))\n                    {\n                        // Sharing violation\n                        if (!retries) return null;\n                        if (!WaitRetryTimeout()) throw;\n                    }\n                    else\n                    {\n                        // All others are considered an error and we don't retry\n                        throw;\n                    }\n                }\n            };\n        }\n\n        public void foo() { }\n        public void bar() { }\n    }\n\n    class ReproducerClass\n    {\n        ReproducerClass FirstProperty => null;\n        int SecondProperty => throw new Exception();\n\n        int MethodWithPropertyAccess()\n        {\n            while (true)\n            {\n                try\n                {\n                    // SecondProperty will throw, it will be caught and another iteration will happen\n                    return SecondProperty; // Compliant\n                }\n                catch (Exception ex)\n                {\n                }\n            }\n        }\n\n        int MethodWithMemberAccess()\n        {\n            while (true)\n            {\n                try\n                {\n                    // FirstProperty will be null and another iteration will happen\n                    return FirstProperty.SecondProperty; // Compliant\n                }\n                catch (Exception ex)\n                {\n                }\n            }\n        }\n\n        int MethodWithElementAccess(int[] array)\n        {\n            while (true)\n            {\n                try\n                {\n                    return (((array[0]))); // Compliant\n                }\n                catch (Exception ex)\n                {\n                }\n            }\n        }\n\n        int MethodWithAssignmentInsideReturnStatement()\n        {\n            int x;\n            while (true)\n            {\n                try\n                {\n                    return x = SecondProperty; // Compliant\n                }\n                catch (Exception ex)\n                {\n                }\n            }\n        }\n    }\n\n    public class LocalFunctions\n    {\n        public void LocalFunctionInLoop()\n        {\n            while(true)\n            {\n                void Throw()\n                {\n                    throw new InvalidOperationException(\"Message\");\n                }\n            }\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/2441\n    class ReproducerWithDelegate\n    {\n        delegate int Delegate1();\n        void myFunc()\n        {\n            while (true)\n            {\n                Delegate1 d2 = () => { return -1; }; // Compliant\n            }\n        }\n\n        void myFunc2()\n        {\n            while (true)\n            {\n                Delegate1 d1 = delegate () { return -1; }; // Compliant\n            }\n        }\n\n        Func<int> myFunc3()\n        {\n            while (true)\n            {\n                return (Func<int>)delegate () { return -1; }; // Noncompliant\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnconditionalJumpStatement.vb",
    "content": "﻿Imports System\nImports System.IO\nImports System.Threading.Tasks\n\nNamespace Tests.Diagnostics\n    Class Program\n        Public Sub Test1(strings As String())\n            Dim length As Integer = Nothing\n            For i As Integer = 0 To length - 1\n                Exit For\n'               ^^^^^^^^ Noncompliant {{Refactor the containing loop to do more than one iteration.}}\n            Next\n\n            For i As Integer = 0 To length - 1\n                Continue For ' Noncompliant\n            Next\n\n            For i As Integer = 0 To length - 1\n                Return ' Noncompliant\n            Next\n\n            For i As Integer = 0 To length - 1\n                Throw New Exception() ' Noncompliant\n            Next\n\n            For Each s As Char In strings\n                Exit For ' Noncompliant\n            Next\n\n            For Each s As Char In strings\n                Continue For ' Noncompliant\n            Next\n\n            For Each s As Char In strings\n                Return ' Noncompliant\n            Next\n\n            For Each s As Char In strings\n                Throw New Exception() ' Noncompliant\n            Next\n\n            While True\n                Exit While ' Noncompliant\n            End While\n\n            While True\n                Continue While ' Noncompliant\n            End While\n\n            While True\n                Return ' Noncompliant\n            End While\n\n            While True\n                Throw New Exception() ' Noncompliant\n            End While\n\n            Do\n                Exit Do ' Noncompliant\n            Loop While True\n\n            Do\n                Continue Do ' Noncompliant\n            Loop While True\n\n            Do\n                Return ' Noncompliant\n            Loop While True\n\n            Do\n                Throw New Exception() ' Noncompliant\n            Loop While True\n        End Sub\n\n        Public Sub Test2(strings As String(), [stop] As Boolean)\n            While True\n                If [stop] Then\n                    Exit While ' Compliant\n                End If\n            End While\n\n            While True\n                If [stop] Then\n                    Continue While ' Compliant\n                End If\n            End While\n\n            While True\n                If [stop] Then\n                    Return ' Compliant\n                End If\n            End While\n\n            While True\n                If [stop] Then\n                    Throw New Exception() ' Compliant\n                End If\n            End While\n\n            While True\n                If [stop] Then Throw New Exception() ' Compliant\n            End While\n\n            Dim s As String\n            For Each cs As Char In s\n                If Not False Then Return ' Compliant\n            Next\n\n        End Sub\n\n        Public Sub Test3(strings As String(), [stop] As Boolean)\n            If [stop] Then\n                While True\n                    Exit While ' Noncompliant\n                End While\n\n                While True\n                    Continue While ' Noncompliant\n                End While\n\n                While True\n                    Return\n'                   ^^^^^^ Noncompliant {{Refactor the containing loop to do more than one iteration.}}\n                End While\n\n                While True\n                    Throw New Exception()\n'                   ^^^^^^^^^^^^^^^^^^^^^ Noncompliant {{Refactor the containing loop to do more than one iteration.}}\n                End While\n            End If\n        End Sub\n\n        Public Sub Test4(strings As String(), padding As Integer)\n            While True\n                Select Case padding\n                    Case 1\n                        Exit Select ' Compliant\n                    Case 2\n                        Throw New Exception() ' Compliant\n                    Case Else\n                        Exit Select ' Compliant\n                End Select\n            End While\n\n            While True\n                Select Case padding\n                    Case 1\n                        Return ' Compliant\n                    Case Else\n                        Return ' Compliant\n                End Select\n            End While\n        End Sub\n\n        Public Sub Test5(doSomething As Action, logError As Action(Of Exception))\n            While True\n                Try\n                    doSomething()\n                Catch e As Exception\n                    logError(e)\n                    Throw ' Compliant\n                End Try\n            End While\n        End Sub\n\n        Public Test6 As Func(Of Integer) = Function()\n                                               If True Then\n                                                   Return 5\n                                               Else\n                                                   Return 10\n                                               End If\n                                           End Function\n\n        Public Sub Test7()\n            While True\n                If True Then\n                    Continue While\n                End If\n\n                Exit While\n                GetHashCode()\n            End While\n        End Sub\n\n        Public Sub Test8()\n            While True\n                If True Then\n                    Exit While\n                End If\n\n                Continue While ' Noncompliant\n            End While\n        End Sub\n\n        Public Sub Test9()\n            While True\n                If True Then\n                    Continue While\n                End If\n\n\n                Return ' Compliant\n            End While\n        End Sub\n\n        Public Sub Test10()\n            While True\n                If True Then\n                    Throw New Exception()\n                End If\n\n                Continue While ' Noncompliant\n            End While\n        End Sub\n\n        Public Sub Test11()\n            While True\n                If True Then\n                    Return\n                End If\n\n\n                Exit While ' Noncompliant\n            End While\n        End Sub\n        Public Sub Test12()\n            While True\n                bar()\n                baz()\n                Continue While ' Noncompliant\n            End While\n        End Sub\n\n        Private Sub baz()\n            Throw New NotImplementedException()\n        End Sub\n\n        Private Sub bar()\n            Throw New NotImplementedException()\n        End Sub\n\n        Public Sub Test13()\n            While True\n                bar()\n                Continue While ' Noncompliant\n                bar()\n            End While\n        End Sub\n\n        Public Sub Test14()\n            While True\n                bar()\n                Continue While ' Noncompliant\n                bar()\n            End While\n        End Sub\n\n        Public Sub Test15()\n            While True\n                UtilFunc(Function(lambda)\n                             Return True ' Compliant\n                         End Function)\n\n                Continue While ' Noncompliant\n            End While\n        End Sub\n\n        Public Sub Test16()\n            While True\n                If True Then\n\n                Else\n                    Continue While ' Compliant\n                End If\n\n                Exit While\n            End While\n        End Sub\n\n        Public Sub Test17()\n            While True\n                While True\n                    If True Then\n\n                    Else\n                        Exit While\n                    End If\n                End While\n\n                Exit While ' Noncompliant\n            End While\n        End Sub\n\n        Private Sub UtilFunc(a As Func(Of Boolean, Boolean))\n        End Sub\n\n        Public Function TestWithRetry(doSomething As Action) As Boolean\n            For i As Integer = 0 To 2\n                Try\n                    doSomething()\n                    Return True ' Compliant\n                Catch e As Exception\n                    If i = 2 Then\n                        Return False ' Compliant\n                    End If\n                End Try\n            Next\n        End Function\n\n        Public Function TestWithRetry2() As Boolean\n            For i As Integer = 0 To 2\n                Try\n                    Return True ' Noncompliant\n                Catch e As Exception\n                    If i = 2 Then\n                        Return False ' Compliant\n                    End If\n                End Try\n            Next\n        End Function\n\n        Public Function TestWithRetry3(doSomething As Func(Of Boolean)) As Boolean\n            For i As Integer = 0 To 2\n                Try\n                    Return (((doSomething()))) ' Compliant\n                Catch e As Exception\n                    If i = 2 Then\n                        Return False ' Compliant\n                    End If\n                End Try\n            Next\n        End Function\n\n        Public Async Function TestWithRetry5(doSomething As Func(Of Task(Of Boolean))) As Task(Of Boolean)\n            For i As Integer = 0 To 2\n                Try\n                    Return (((Await doSomething()))) ' Compliant\n                Catch e As Exception\n                    If i = 2 Then\n                        Return False ' Compliant\n                    End If\n                End Try\n            Next\n        End Function\n\n        Protected Overridable Function CreateLock(lockFileName As String, retries As Boolean) As FileStream\n            If retries Then\n                ResetRetryTimeout()\n            End If\n            Dim filelock As FileStream = Nothing\n            While True\n                Try\n                    filelock = New FileStream(lockFileName, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None, 8, FileOptions.DeleteOnClose)\n                    Return filelock\n                Catch e As Exception\n                    Dim code As Integer = System.Runtime.InteropServices.Marshal.GetHRForException(e)\n                    If code = CInt(&H80070020) OrElse code = CInt(&H80070021) Then\n                        ' Sharing violation\n                        If Not retries Then\n                            Return Nothing\n                        End If\n                        If Not WaitRetryTimeout() Then\n                            Throw\n                        End If\n                    Else\n                        ' All others are considered an error and we don't retry\n                        Throw\n                    End If\n                End Try\n            End While\n\n\n        End Function\n\n        Private Function WaitRetryTimeout() As Boolean\n            Throw New NotImplementedException()\n        End Function\n\n        Private Sub ResetRetryTimeout()\n            Throw New NotImplementedException()\n        End Sub\n    End Class\n\n    Public Class ReproducerClass\n\n        ReadOnly Property FirstProperty As ReproducerClass\n            Get\n                Return Nothing\n            End Get\n        End Property\n\n        ReadOnly Property SecondProperty As Int32\n            Get\n                Throw New Exception()\n            End Get\n        End Property\n\n        Public Function MethodWithPropertyAccess() As Int32\n              While True\n                Try\n                    Return SecondProperty ' Compliant\n                Catch E As Exception\n\n                End Try\n            End While\n        End Function\n\n        Public Function MethodWithMemberAccess() As Int32\n              While True\n                Try\n                    Return FirstProperty.SecondProperty ' Compliant\n                Catch E As Exception\n\n                End Try\n            End While\n        End Function\n\n        Public Function MethodWithElementAccess(Array As Int32()) As Int32\n              While True\n                Try\n                    Return (((Array(0)))) ' Compliant\n                Catch E As Exception\n\n                End Try\n            End While\n        End Function\n\n        Public Function MethodWithAssignmentInsideReturnStatement() As Int32\n            Dim X As Int32\n              While True\n                Try\n                    return X = SecondProperty ' Compliant\n                Catch E As Exception\n\n                End Try\n            End While\n        End Function\n\n    End Class\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UninvokedEventDeclaration.Latest.Partial.cs",
    "content": "﻿using System;\n\npublic partial class PartialEvents\n{\n    public partial event EventHandler Compliant\n    {\n        add { compliant += value; }\n        remove { compliant -= value; }\n    }\n\n    public partial event EventHandler NonCompliant\n    {\n        add { nonCompliant += value; }\n        remove { nonCompliant -= value; }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UninvokedEventDeclaration.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\npublic record EventInvocations\n{\n    public event EventHandler MyEvent1;\n    public event EventHandler MyEvent2;\n    public event EventHandler MyEvent3;\n    public event EventHandler MyEvent4;\n    public event EventHandler MyEvent5;\n    public event EventHandler MyEvent6;\n    public event EventHandler MyEvent7; // Noncompliant\n\n    public event Action<object, EventArgs> MyAction1;\n    public event Action<object, EventArgs> MyAction2;\n    public event Action<object, EventArgs> MyAction3;\n    public event Action<object, EventArgs> MyAction4;\n    public event Action<object, EventArgs> MyAction5;\n    public event Action<object, EventArgs> MyAction6;\n    public event Action<object, EventArgs> MyAction7;  // Noncompliant\n\n    public void InvokeAll()\n    {\n        MyEvent1(this, EventArgs.Empty);\n        MyEvent2.Invoke(this, EventArgs.Empty);\n        MyEvent3.DynamicInvoke(this, EventArgs.Empty);\n        MyEvent4.BeginInvoke(this, EventArgs.Empty, null, null);\n        this.MyEvent5(this, EventArgs.Empty);\n        MyEvent6?.Invoke(this, EventArgs.Empty);\n\n        MyAction1(this, EventArgs.Empty);\n        MyAction2.Invoke(this, EventArgs.Empty);\n        MyAction3.DynamicInvoke(this, EventArgs.Empty);\n        MyAction4.BeginInvoke(this, EventArgs.Empty, null, null);\n        this.MyAction5(this, EventArgs.Empty);\n        MyAction6?.Invoke(this, EventArgs.Empty);\n    }\n}\n\npublic record EventInvocationsPositionalDeclaration(string Value)\n{\n    public event EventHandler MyEvent1;\n    public event EventHandler MyEvent2; // Noncompliant\n\n    public event Action<object, EventArgs> MyAction1;\n    public event Action<object, EventArgs> MyAction2; // Noncompliant\n\n    public void InvokeAll()\n    {\n        MyEvent1(this, EventArgs.Empty);\n        MyAction1(this, EventArgs.Empty);\n    }\n}\n\nclass UninvokedEventDeclaration<T>\n{\n    private interface IMyInterface<T1>\n    {\n        static abstract event EventHandler<T1> Event8;\n    }\n\n    private class Nested : IMyInterface<T>\n    {\n        private event EventHandler<T> Event5, // Noncompliant {{Remove the unused event 'Event5' or invoke it.}}\n//                                    ^^^^^^\n            Event6; // Noncompliant\n\n        public static event EventHandler<T> Event7; // Noncompliant\n        public static event EventHandler<T> Event8;\n\n        private UninvokedEventDeclaration<int> f;\n\n        public void RegisterEventHandler(Action<object, EventArgs> handler)\n        {\n            Event7 += (o, a) => { };\n            Event8 += (o, a) => { };\n        }\n\n        public void RaiseEvent()\n        {\n            if (Event5 != null)\n            {\n            }\n        }\n    }\n}\n\npublic partial class PartialEvents\n{\n    private EventHandler compliant;\n    private EventHandler nonCompliant;\n    public partial event EventHandler Compliant;    // Compliant https://sonarsource.atlassian.net/browse/NET-2821\n    public partial event EventHandler NonCompliant; // FN, this rule doesn't inspect events with add/remove accessors (yet)\n\n    public virtual void RaiseEvent()\n    {\n        compliant.Invoke(this, EventArgs.Empty);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UninvokedEventDeclaration.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    class UninvokedEventDeclaration<T>\n    {\n        public event Action<object, EventArgs> Event1 // Compliant, event accessors cannot be invoked\n        {\n            add { } // S3237 will report\n            remove { } // S3237 will report\n        }\n        private event Action<object, EventArgs> Event2;\n        private event EventHandler<T> Event3,\n            Event4; // Noncompliant\n\n        public void RegisterEventHandler(Action<object, EventArgs> handler)\n        {\n            Event1 += handler; //we register some event handlers\n            var x = new Nested();\n            x.RegisterEventHandler(null);\n            x.RaiseEvent();\n        }\n\n        private abstract class MyBase<T1>\n        {\n            public abstract event EventHandler<T1> Event7;\n        }\n\n        private interface IMyInterface<T1>\n        {\n            event EventHandler<T1> Event8;\n        }\n\n        private class Nested : MyBase<T>, IMyInterface<T>\n        {\n            private event EventHandler<T> Event5, // Noncompliant {{Remove the unused event 'Event5' or invoke it.}}\n//                                        ^^^^^^\n                Event6; // Noncompliant\n\n            public override event EventHandler<T> Event7;\n            public event EventHandler<T> Event8;\n\n            private UninvokedEventDeclaration<int> f;\n\n            public void RegisterEventHandler(Action<object, EventArgs> handler)\n            {\n                f.Event1 += handler; //we register some event handlers\n                Event7 += (o, a) => { };\n                Event8 += (o, a) => { };\n            }\n\n            public void RaiseEvent()\n            {\n                if (Event5 != null)\n                {\n                    f.Event2(this, EventArgs.Empty);\n                    f.Event3(this, 0);\n                }\n            }\n        }\n    }\n\n    class MyClass\n    {\n        public event EventHandler MyEvent1;\n        public event Action<int> MyEvent2;\n\n        class Nested\n        {\n            public static event EventHandler MyEvent;\n            public static event EventHandler MyEvent3 = MyEvent;\n            public static event EventHandler MyEvent4;\n\n            public void M()\n            {\n                var v = new MyClass();\n\n                object x;\n                x = MyClass.Nested.MyEvent3;\n\n                Console.WriteLine(Nested.MyEvent4);\n\n                if (v.MyEvent1 != null)\n                {\n                    v.MyEvent1.DynamicInvoke(null, null);\n                    v.MyEvent1.Invoke(null, null);\n                }\n\n                v.MyEvent2?.DynamicInvoke(42);\n                v.MyEvent2?.Invoke(42);\n            }\n        }\n    }\n\n    // See https://github.com/SonarSource/sonar-dotnet/issues/1219\n    public class EventAccessor\n    {\n        private event EventHandler privateEvent;\n\n        public event EventHandler PublicEvent\n        {\n            add { privateEvent += value; }\n            remove { privateEvent -= value; }\n        }\n\n        protected void OnEvent1()\n        {\n            PublicEvent += (s, o) => { }; // Need to use the event to be able to trigger issues\n\n            privateEvent?.Invoke(this, EventArgs.Empty);\n        }\n    }\n\n    struct StructTest\n    {\n        public event Action<object, EventArgs> Event1; //Noncompliant\n\n        public void RegisterEventHandler()\n        {\n            Event1 += StructTest_Event1;\n        }\n\n        private void StructTest_Event1(object arg1, EventArgs arg2)\n        {\n            throw new NotImplementedException();\n        }\n    }\n\n    // Shows all different kinds of event invocations\n    public class EventInvocations\n    {\n        public event EventHandler MyEvent1;\n        public event EventHandler MyEvent2;\n        public event EventHandler MyEvent3;\n        public event EventHandler MyEvent4;\n        public event EventHandler MyEvent5;\n        public event EventHandler MyEvent6;\n\n        public event Action<object, EventArgs> MyAction1;\n        public event Action<object, EventArgs> MyAction2;\n        public event Action<object, EventArgs> MyAction3;\n        public event Action<object, EventArgs> MyAction4;\n        public event Action<object, EventArgs> MyAction5;\n        public event Action<object, EventArgs> MyAction6;\n\n        public void InvokeAll()\n        {\n            MyEvent1(this, EventArgs.Empty);\n            MyEvent2.Invoke(this, EventArgs.Empty);\n            MyEvent3.DynamicInvoke(this, EventArgs.Empty);\n            MyEvent4.BeginInvoke(this, EventArgs.Empty, null, null);\n            this.MyEvent5(this, EventArgs.Empty);\n            MyEvent6?.Invoke(this, EventArgs.Empty);\n\n            MyAction1(this, EventArgs.Empty);\n            MyAction2.Invoke(this, EventArgs.Empty);\n            MyAction3.DynamicInvoke(this, EventArgs.Empty);\n            MyAction4.BeginInvoke(this, EventArgs.Empty, null, null);\n            this.MyAction5(this, EventArgs.Empty);\n            MyAction6?.Invoke(this, EventArgs.Empty);\n        }\n    }\n\n    // Shows all different kinds of event invocations from an inner class\n    public class EventInvocationsFromInnerClass\n    {\n        public event EventHandler MyEvent1;\n        public event EventHandler MyEvent2;\n        public event EventHandler MyEvent3;\n        public event EventHandler MyEvent4;\n        public event EventHandler MyEvent5;\n        public event EventHandler MyEvent6;\n\n        public event Action<object, EventArgs> MyAction1;\n        public event Action<object, EventArgs> MyAction2;\n        public event Action<object, EventArgs> MyAction3;\n        public event Action<object, EventArgs> MyAction4;\n        public event Action<object, EventArgs> MyAction5;\n        public event Action<object, EventArgs> MyAction6;\n\n        public class Inner\n        {\n            readonly EventInvocationsFromInnerClass outer;\n            public Inner(EventInvocationsFromInnerClass outer)\n            {\n                this.outer = outer;\n            }\n\n            public void InvokeAll()\n            {\n                outer.MyEvent1(this, EventArgs.Empty);\n                outer.MyEvent2.Invoke(this, EventArgs.Empty);\n                outer.MyEvent3.DynamicInvoke(this, EventArgs.Empty);\n                outer.MyEvent4.BeginInvoke(this, EventArgs.Empty, null, null);\n                outer.MyEvent5(this, EventArgs.Empty);\n                outer.MyEvent6?.Invoke(this, EventArgs.Empty);\n\n                outer.MyAction1(this, EventArgs.Empty);\n                outer.MyAction2.Invoke(this, EventArgs.Empty);\n                outer.MyAction3.DynamicInvoke(this, EventArgs.Empty);\n                outer.MyAction4.BeginInvoke(this, EventArgs.Empty, null, null);\n                outer.MyAction5(this, EventArgs.Empty);\n                outer.MyAction6?.Invoke(this, EventArgs.Empty);\n            }\n        }\n\n        // https://github.com/SonarSource/sonar-dotnet/issues/3931\n        public delegate void SomeDelegate(int a);\n\n        public class ReproForIssue3931\n        {\n            public event SomeDelegate ActuallyUsedEvent; // Noncompliant FP\n            public event SomeDelegate OtherUsedEvent; // Noncompliant FP\n\n            public void SomeMethod()\n            {\n                var invocations = ActuallyUsedEvent.GetInvocationList();\n\n                foreach (var invocation in invocations)\n                {\n                    invocation.DynamicInvoke(1623);\n                }\n\n                var unusedDelegates = OtherUsedEvent.GetInvocationList();\n            }\n        }\n    }\n\n    public class EventTestBase\n    {\n        public event EventHandler Logging;\n\n        public void RunSomethingThatSendAnEvent() => Logging(this, EventArgs.Empty);\n    }\n\n    public class EventChainingDirect\n    {\n        public event EventHandler Logging; // Compliant https://github.com/SonarSource/sonar-dotnet/issues/4276\n\n        public void RunTest()\n        {\n            EventTestBase eventTestBase = new EventTestBase();\n            eventTestBase.Logging += Logging;\n            eventTestBase.RunSomethingThatSendAnEvent();\n        }\n    }\n\n    public class EventChainingLambda\n    {\n        public event EventHandler Logging;\n\n        public void RunTest()\n        {\n            EventTestBase eventTestBase = new EventTestBase();\n            eventTestBase.Logging += (s, e) => Logging(s, e);\n            eventTestBase.RunSomethingThatSendAnEvent();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnnecessaryBitwiseOperation.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public enum Types\n    {\n        Class = 0,\n        Struct = 1,\n        Public = 2,\n        Private = 4\n    }\n\n    class UnnecessaryBitwiseOperation\n    {\n        static void Main(string[] args)\n        {\n            int result;\n            int bitMask = 0x010F;\n\n            result = bitMask; // Fixed\n            result = bitMask;  // Fixed\n            result = bitMask;  // Fixed\n            result = bitMask;  // Fixed\n            var result2 = result;  // Fixed\n\n            result = bitMask & 1; // Compliant\n            result = bitMask | 1; // compliant\n            result = bitMask ^ 1; // Compliant\n            result &= 1; // Compliant\n            result |= 1; // compliant\n            result ^= 1; // Compliant\n\n            long bitMaskLong = 0x010F;\n            long resultLong;\n            resultLong = bitMaskLong; // Fixed\n            resultLong = bitMaskLong & 0L; // Compliant\n            resultLong = bitMaskLong; // Fixed\n            resultLong = bitMaskLong; // Fixed\n            resultLong = bitMaskLong & returnLong(); // Compliant\n            resultLong = bitMaskLong & 0x0F; // Compliant\n\n            var resultULong = 1UL; // Fixed\n            resultULong = 1UL | 18446744073709551615UL; // Compliant\n\n            MyMethod(1UL); // Fixed\n\n            var flags = Types.Class | Types.Private; // Compliant even when Class is zero\n            flags = Types.Class;\n            flags = flags | Types.Private;  // Compliant, even when \"flags\" was initally zero\n        }\n\n        public static void WithUnaryPrefix()\n        {\n            int result;\n            int bitMask = 0x010F;\n            int one = 1;\n            int zero = 0;\n\n            result = bitMask & -one;       // FN - Unary Operator is not supported\n            result &= -one;                // FN - Unary Operator is not supported\n            result = bitMask & - - -+one;  // FN - Unary Operator is not supported\n            result = bitMask | + + +zero;  // FN - Unary Operator is not supported\n            result = bitMask | + + +zero;  // FN - Unary Operator is not supported\n        }\n\n        public void UnaryOperators()\n        {\n            var length = 0x80;\n\n            var bytes1 = 0;\n            bytes1++;\n            _ = bytes1 | 0x80; // Compliant, See: https://github.com/SonarSource/sonar-dotnet/issues/6326\n\n            var bytes2 = 0;\n            ++bytes2;\n            _ = bytes2 | 0x80; // Compliant\n\n            var bytes3 = 0;\n            bytes3--;\n            _ = bytes3 | 0x80; // Compliant\n\n            var bytes4 = 0;\n            --bytes4;\n            _ = bytes4 | 0x80; // Compliant\n\n            var bytes5 = 0;\n            var bytesOther = 0;\n            --bytesOther;      // Other variable is mutated\n            _ = 0x80; // Fixed\n\n            var bytes6 = 0;\n            bytesOther++;      // Other variable is mutated\n            _ = 0x80; // Fixed\n        }\n\n        private static long returnLong()\n        {\n            return 1L;\n        }\n\n        private static void MyMethod(UInt64 u) { }\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/4399\npublic class Repro_4399\n{\n    public void BuildMask(IEnumerable<DayOfWeek> daysOfWeek)\n    {\n        var value = 0;\n        foreach (var dow in daysOfWeek)\n        {\n            value = value | (1 << (int)dow); // Compliant, value changes over iterations\n        }\n    }\n\n    public void Repro(object[] args)\n    {\n        var fail = false;\n        foreach (var arg in args)\n        {\n            fail = fail | !CheckArg(arg);   // Compliant, using short-circuit operator || would change the logic.\n        }\n    }\n\n    private bool CheckArg(object arg) => false;\n\n    public void FindConstant_For_AssignedInsideLoop()\n    {\n        var value = 1;\n        int result;\n        for (var v = 0; v < 42; v++)\n        {\n            value = 0;\n            result = v;     // Fixed\n        }\n    }\n\n    public void FindConstant_For_ReassignedToTheSameValue()\n    {\n        var value = 0;\n        int result;\n        for (var v = 0; v < 42; v++)\n        {\n            result = value | v;     // FN per rule description, but expected behavior for ConstantValueFinder. Variable \"value\" is reassigned inside a loop.\n            value = 0;\n        }\n    }\n\n    public void FindConstant_For()\n    {\n        var value = 0;\n        var unchanged = 0;\n        int result;\n        for (var v = 0; v < 42; v++)\n        {\n            result = value | v;     // Compliant, value changes over iterations\n            result = v; // Fixed\n            value = 1;\n        }\n    }\n\n    public void FindConstant_ForEach(int[] values)\n    {\n        var value = 0;\n        var unchanged = 0;\n        int result;\n        foreach (var v in values)\n        {\n            result = value | v;     // Compliant, value changes over iterations\n            result = v; // Fixed\n            value = 1;\n        }\n        unchanged = 1;\n    }\n\n    public void FindConstant_While(int[] values)\n    {\n        var value = 0;\n        var unchanged = 0;\n        int result;\n        int index = 0;\n        while (index < values.Length)\n        {\n            var v = values[index];\n            result = value | v;     // Compliant, value changes over iterations\n            result = v; // Fixed\n            value = 1;\n            index++;\n        }\n        unchanged = 1;\n    }\n\n    public void FindConstant_Do(int[] values)\n    {\n        var value = 0;\n        var unchanged = 0;\n        int result;\n        var index = 0;\n        do\n        {\n            var v = values[index];\n            result = value | v;     // Compliant, value changes over iterations\n            result = v; // Fixed\n            value = 1;\n            index++;\n        } while (index < values.Length);\n        unchanged = 1;\n    }\n\n    class LocalFields\n    {\n        private int start = 0;\n\n        public int End { get; set; } = 0;\n\n        public void UpdateStart(int val) => start = val;\n\n        public override int GetHashCode()\n        {\n            var value1 = Method() ^ End;\n            var value2 = start ^ End;\n            var value3 = End ^ start;\n            return Method() ^ start;\n\n            int Method() => 42;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnnecessaryBitwiseOperation.Fixed.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\n\nPublic Enum Types\n    [Class] = 0\n    Struct = 1\n    [Public] = 2\n    [Private] = 4\nEnd Enum\n\nClass UnnecessaryBitwiseOperation\n\n    Public Sub Method()\n        Dim Result As Integer\n        Dim Zero As Integer = 0\n        Dim One As Integer = 1\n        Dim BitMask As Integer = &H10F\n\n        Result = BitMask ' Fixed\n        Result = BitMask   ' Fixed\n        Result = BitMask  ' Fixed\n        Result = BitMask  ' Fixed\n        Result = BitMask   ' Fixed\n\n        Result = BitMask And 1  ' Compliant\n        Result = BitMask Or 1   ' Compliant\n        Result = BitMask Xor 1  ' Compliant\n        Result = BitMask Xor One    ' Compliant\n\n        Dim BitMaskLong As Long = &H10F\n        Dim ResultLong As Long\n        ResultLong = BitMaskLong ' Fixed\n        ResultLong = BitMaskLong And 0L     ' Compliant\n        ResultLong = BitMaskLong     ' Fixed\n        ResultLong = BitMaskLong    ' Fixed\n        ResultLong = BitMaskLong And ReturnLong() ' Compliant\n        ResultLong = BitMaskLong And &HF   ' Compliant\n\n        Dim ResultULong As ULong = 1UL     ' Fixed\n        ResultULong = 1UL Or 18446744073709551615UL ' Compliant\n\n        MyMethod(1UL) ' Fixed\n\n        If True AndAlso True Then Return\n        If True OrElse True Then Return\n\n        Dim Flags As Types = Types.Class Or Types.Private   ' Compliant even when class is zero\n        Flags = Types.Class\n        Flags = Flags Or Types.Private      ' Compliant, even when \"flags\" was initally zero\n    End Sub\n\n    Private Shared Function ReturnLong() As Long\n        Return 1L\n    End Function\n\n    Private Shared Sub MyMethod(U As UInt64)\n    End Sub\n\nEnd Class\n\n' https//github.com/SonarSource/sonar-dotnet/issues/4399\nPublic Class Repro_4399\n\n    Public Sub BuildMask(DaysOfWeek As IEnumerable(Of DayOfWeek))\n        Dim Value As Integer = 0\n        For Each dow As DayOfWeek In DaysOfWeek\n            Value = Value Or (1 << CInt(dow))   ' Compliant, value changes over iterations\n        Next\n    End Sub\n\n    Public Sub Repro(Args() As Object)\n        Dim Fail As Boolean = False\n        For Each Arg As Object In Args\n            Fail = Fail Or Not CheckArg(Arg)    ' Compliant, using short-circuit operator OrElse would change the logic.\n        Next\n    End Sub\n\n    Private Function CheckArg(Arg As Object) As Boolean\n    End Function\n\n    Public Sub FindConstant_For_AssignedInsideLoop()\n        Dim Value As Integer = 1\n        Dim Result As Integer\n        For v As Integer = 0 To 41\n            Value = 0\n            Result = v     ' Fixed\n        Next\n    End Sub\n\n    Public Sub FindConstant_For_ReassignedToTheSameValue()\n        Dim Value As Integer = 0\n        Dim Result As Integer\n        For v As Integer = 0 To 41\n            Result = Value Or v     ' FN per rule description, but expected behavior for ConstantValueFinder. Variable \"Value\" is reassigned inside a Loop.\n            Value = 0\n        Next\n    End Sub\n\n    Public Sub FindConstant_For()\n        Dim Value As Integer = 0\n        Dim Unchanged As Integer = 0\n        Dim Result As Integer\n        For v As Integer = 0 To 41\n            Result = Value Or v         ' Compliant, value changes over iterations\n            Result = v     ' Fixed\n            Value = 1\n        Next\n        Unchanged = 1\n    End Sub\n\n    Public Sub FindConstant_ForEach(Values() As Integer)\n        Dim Value As Integer = 0\n        Dim Unchanged As Integer = 0\n        Dim Result As Integer\n        For Each v As Integer In Values\n            Result = Value Or v         ' Compliant, value changes over iterations\n            Result = v     ' Fixed\n            Value = 1\n        Next\n        Unchanged = 1\n    End Sub\n\n    Public Sub FindConstant_While(Values() As Integer)\n        Dim Value As Integer = 0\n        Dim Unchanged As Integer = 0\n        Dim Result As Integer\n        Dim Index As Integer\n        While Index < Values.Length\n            Dim v As Integer = Values(Index)\n            Result = Value Or v         ' Compliant, value changes over iterations\n            Result = v     ' Fixed\n            Value = 1\n            Index += 1\n        End While\n        Unchanged = 1\n    End Sub\n\n    Public Sub FindConstant_DoWhile(Values() As Integer)\n        Dim Value As Integer = 0\n        Dim Unchanged As Integer = 0\n        Dim Result As Integer\n        Dim Index As Integer\n        Do While Index < Values.Length\n            Dim v As Integer = Values(Index)\n            Result = Value Or v         ' Compliant, value changes over iterations\n            Result = v     ' Fixed\n            Value = 1\n            Index += 1\n        Loop\n        Unchanged = 1\n    End Sub\n\n    Public Sub FindConstant_DoUntil(Values() As Integer)\n        Dim Value As Integer = 0\n        Dim Unchanged As Integer = 0\n        Dim Result As Integer\n        Dim Index As Integer\n        Do Until Index >= Values.Length\n            Dim v As Integer = Values(Index)\n            Result = Value Or v         ' Compliant, value changes over iterations\n            Result = v     ' Fixed\n            Value = 1\n            Index += 1\n        Loop\n        Unchanged = 1\n    End Sub\n\n    Public Sub FindConstant_DoLoopWhile(Values() As Integer)\n        Dim Value As Integer = 0\n        Dim Unchanged As Integer = 0\n        Dim Result As Integer\n        Dim Index As Integer\n        Do\n            Dim v As Integer = Values(Index)\n            Result = Value Or v         ' Compliant, value changes over iterations\n            Result = v     ' Fixed\n            Value = 1\n            Index += 1\n        Loop While Index < Values.Length\n        Unchanged = 1\n    End Sub\n\n    Public Sub FindConstant_DoLoopUntil(Values() As Integer)\n        Dim Value As Integer = 0\n        Dim Unchanged As Integer = 0\n        Dim Result As Integer\n        Dim Index As Integer\n        Do\n            Dim v As Integer = Values(Index)\n            Result = Value Or v         ' Compliant, value changes over iterations\n            Result = v     ' Fixed\n            Value = 1\n            Index += 1\n        Loop Until Index >= Values.Length\n        Unchanged = 1\n    End Sub\n\nEnd Class\n\nPublic Class LocalFields\n\n    Private Start As Integer = 0\n\n    Public Property [End] As Integer = 0\n\n    Public Sub UpdateStart(Val As Integer)\n        Start = Val\n    End Sub\n\n    Public Overrides Function GetHashCode() As Integer\n        Dim Value1 = Method() ^ [End]\n        Dim Value2 = Start ^ [End]\n        Dim Value3 = [End] ^ Start\n        Return Method() ^ Start\n    End Function\n\n    Private Function Method() As Integer\n        Return 42\n    End Function\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnnecessaryBitwiseOperation.Latest.cs",
    "content": "﻿using System;\nusing System.Threading.Tasks;\nusing System.Collections.Generic;\nusing System.Threading;\n\npublic class CSharp8\n{\n    public async Task FindConstant_AwaitForEach(IAsyncEnumerable<int> values)\n    {\n        var value = 0;\n        var unchanged = 0;\n        int result;\n        await foreach (var v in values)\n        {\n            result = value | v;     // Compliant, value changes over iterations\n            result = unchanged | v; // Noncompliant\n            value = 1;\n        }\n        unchanged = 1;\n    }\n\n    public void TupleAssignment()\n    {\n        var i = 0;\n        (i, _) = (1, 1);\n        _ = i | 0x80;\n    }\n\n    public void InterlockedMethods()\n    {\n        var bytes1 = 0;\n        Interlocked.Add(ref bytes1, 1);\n        _ = bytes1 | 0x80; // Compliant\n\n        var bytes2 = 0;\n        Interlocked.Decrement(ref bytes2);\n        _ = bytes2 | 0x80; // Compliant\n\n        var bytes3 = 0;\n        Interlocked.Increment(ref bytes3);\n        _ = bytes3 | 0x80; // Compliant\n\n        var bytes4 = 0;\n        Interlocked.And(ref bytes4, 0x80);\n        _ = bytes4 | 0x80; // Compliant\n\n        var bytes5 = 0;\n        Interlocked.Or(ref bytes5, 0x80);\n        _ = bytes5 | 0x80; // Compliant\n\n        var bytes6 = 0;\n        Interlocked.Exchange(ref bytes6, 0x80);\n        _ = bytes6 | 0x80; // Compliant\n\n        var bytes7 = 0;\n        Interlocked.CompareExchange(ref bytes7, 100, 0x80);\n        _ = bytes7 | 0x80; // Compliant\n\n        var bytes8 = 0;\n        var otherBytes = 0;\n        // Other variable passed\n        Interlocked.Increment(ref otherBytes);\n        _ = bytes8 | 0x80; // Noncompliant\n    }\n\n    public void RefOrOut()\n    {\n        var bytes1 = 0;\n        // Not passed by ref\n        _ = Convert.ToString(bytes1);\n        _ = bytes1 | 0x80; // Noncompliant\n\n\n        var bytes2 = 0;\n        // Passed by out\n        _ = int.TryParse(\"1\", out bytes2);\n        _ = bytes2 | 0x80; // Compliant\n\n        // ref tests are in InterlockedMethods()\n    }\n\n    public unsafe void UnaryOperators()\n    {\n#nullable enable\n        var bytes1 = 0;\n        _ = bytes1!; // SuppressNullableWarning does not mutate the value\n        _ = bytes1 | 0x80; // Noncompliant\n#nullable disable\n\n        var bytes2 = 0;\n        _ = +bytes2; // UnaryPlus does not mutate the value\n        _ = bytes2 | 0x80; // Noncompliant\n\n        var bytes3 = 0;\n        _ = -bytes3; // UnaryMinus does not mutate the value\n        _ = bytes3 | 0x80; // Noncompliant\n\n        var bytes4 = 0;\n        _ = ~bytes4; // BitwiseNot does not mutate the value\n        _ = bytes4 | 0x80; // Noncompliant\n\n        // LogicalNot does not mutate and can not be tested here\n\n        var bytes5 = 0;\n        var pointer5 = &bytes5; // The address of operator indicates a possible mutation through the pointer\n        _ = bytes5 | 0x80; // Compliant\n\n        var bytes6 = 0;\n        var pointer6 = &bytes6; // The address of operator indicates a possible mutation through the pointer\n        *pointer6 = 1; // Pointer indirect mutates a value\n        _ = bytes6 | 0x80; // Compliant\n    }\n}\n\npublic class CSharp13\n{\n    public class TimerRemaining\n    {\n        TimerRemaining countdown = new TimerRemaining()\n        {\n            buffer =\n        {\n            [^(42 | 0)] = 1, // Noncompliant\n            [^(42 & -1)] = 2, // Noncompliant\n            [^(42 ^ 0)] = 3, // Noncompliant\n        }\n        };\n        public int[] buffer = new int[10];\n    }\n}\n\npublic class FieldKeyword\n{\n    private int bitMask = 0x010F;\n\n    public int Property\n    {\n        get { return field | 0; }  // Noncompliant\n        set { field = value | 0; } // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnnecessaryBitwiseOperation.TopLevelStatements.cs",
    "content": "﻿using System;\n\nnint resultNint;\nnint bitMaskNint = 0x010F;\nconst nint nOne = 1;\nconst nint nZero = 0;\n\nresultNint = -1 & bitMaskNint;            // Noncompliant\nresultNint = bitMaskNint & -nOne;         // Noncompliant\nresultNint = bitMaskNint | nZero;         // Noncompliant\nresultNint = bitMaskNint ^ nZero;         // Noncompliant\nresultNint = bitMaskNint | IntPtr.Zero;   // Noncompliant\nresultNint = bitMaskNint ^ IntPtr.Zero;   // Noncompliant\nresultNint &= -nOne;                      // Noncompliant\nresultNint |= nZero;                      // Noncompliant\nresultNint ^= nZero;                      // Noncompliant\nvar result2 = resultNint ^= nZero;        // Noncompliant\n\nresultNint = bitMaskNint & - - -+nOne; // Noncompliant\nresultNint = bitMaskNint | + + +nZero; // Noncompliant\n\nresultNint = bitMaskNint & 1;   // Compliant\nresultNint = bitMaskNint | 1;   // Compliant\nresultNint = bitMaskNint ^ 1;   // Compliant\nresultNint &= 1;                // Compliant\nresultNint |= 1;                // Compliant\nresultNint ^= 1;                // Compliant\n\nnuint bitMaskNuint = 0x010F;\nnuint resultNuint;\nconst nuint nuZero = 0;\n\nresultNuint = bitMaskNuint | + + +nuZero;   // Noncompliant\nresultNuint = bitMaskNuint & nuZero;        // Compliant\nresultNuint = bitMaskNuint ^ 0;             // Noncompliant\nresultNuint = bitMaskNuint | 0;             // Noncompliant\nresultNuint = bitMaskNuint | 0x0;           // Noncompliant\nresultNuint = bitMaskNuint ^ UIntPtr.Zero;  // Noncompliant\nresultNuint = bitMaskNuint | UIntPtr.Zero;  // Noncompliant\nresultNuint = bitMaskNuint & returnNuint(); // Compliant\nresultNuint = bitMaskNuint & 0x0F;          // Compliant\n\nMyMethod(1 | 0x00000); // Noncompliant\n\nstatic void MyMethod(nuint u) { }\nstatic nuint returnNuint() => 1;\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnnecessaryBitwiseOperation.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public enum Types\n    {\n        Class = 0,\n        Struct = 1,\n        Public = 2,\n        Private = 4\n    }\n\n    class UnnecessaryBitwiseOperation\n    {\n        static void Main(string[] args)\n        {\n            int result;\n            int bitMask = 0x010F;\n\n            result = -1 & bitMask; // Noncompliant\n//                   ^^^^\n            result = bitMask | 0;  // Noncompliant\n//                           ^^^\n            result = bitMask ^ 0;  // Noncompliant\n            result = bitMask ^ 0;  // Noncompliant {{Remove this unnecessary bit operation.}}\n            result &= -1; // Noncompliant\n            result |= 0;  // Noncompliant\n            result ^= 0;  // Noncompliant\n            var result2 = result ^= 0;  // Noncompliant\n\n            result = bitMask & 1; // Compliant\n            result = bitMask | 1; // compliant\n            result = bitMask ^ 1; // Compliant\n            result &= 1; // Compliant\n            result |= 1; // compliant\n            result ^= 1; // Compliant\n\n            long bitMaskLong = 0x010F;\n            long resultLong;\n            resultLong = bitMaskLong & - - -+1L; // Noncompliant\n            resultLong = bitMaskLong & 0L; // Compliant\n            resultLong = bitMaskLong | 0U; // Noncompliant\n            resultLong = bitMaskLong | 0x0L; // Noncompliant\n            resultLong = bitMaskLong & returnLong(); // Compliant\n            resultLong = bitMaskLong & 0x0F; // Compliant\n\n            var resultULong = 1UL | 0x00000UL; // Noncompliant\n            resultULong = 1UL | 18446744073709551615UL; // Compliant\n\n            MyMethod(1UL | 0x00000UL); // Noncompliant\n\n            var flags = Types.Class | Types.Private; // Compliant even when Class is zero\n            flags = Types.Class;\n            flags = flags | Types.Private;  // Compliant, even when \"flags\" was initally zero\n        }\n\n        public static void WithUnaryPrefix()\n        {\n            int result;\n            int bitMask = 0x010F;\n            int one = 1;\n            int zero = 0;\n\n            result = bitMask & -one;       // FN - Unary Operator is not supported\n            result &= -one;                // FN - Unary Operator is not supported\n            result = bitMask & - - -+one;  // FN - Unary Operator is not supported\n            result = bitMask | + + +zero;  // FN - Unary Operator is not supported\n            result = bitMask | + + +zero;  // FN - Unary Operator is not supported\n        }\n\n        public void UnaryOperators()\n        {\n            var length = 0x80;\n\n            var bytes1 = 0;\n            bytes1++;\n            _ = bytes1 | 0x80; // Compliant, See: https://github.com/SonarSource/sonar-dotnet/issues/6326\n\n            var bytes2 = 0;\n            ++bytes2;\n            _ = bytes2 | 0x80; // Compliant\n\n            var bytes3 = 0;\n            bytes3--;\n            _ = bytes3 | 0x80; // Compliant\n\n            var bytes4 = 0;\n            --bytes4;\n            _ = bytes4 | 0x80; // Compliant\n\n            var bytes5 = 0;\n            var bytesOther = 0;\n            --bytesOther;      // Other variable is mutated\n            _ = bytes5 | 0x80; // Noncompliant\n\n            var bytes6 = 0;\n            bytesOther++;      // Other variable is mutated\n            _ = bytes6 | 0x80; // Noncompliant\n        }\n\n        private static long returnLong()\n        {\n            return 1L;\n        }\n\n        private static void MyMethod(UInt64 u) { }\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/4399\npublic class Repro_4399\n{\n    public void BuildMask(IEnumerable<DayOfWeek> daysOfWeek)\n    {\n        var value = 0;\n        foreach (var dow in daysOfWeek)\n        {\n            value = value | (1 << (int)dow); // Compliant, value changes over iterations\n        }\n    }\n\n    public void Repro(object[] args)\n    {\n        var fail = false;\n        foreach (var arg in args)\n        {\n            fail = fail | !CheckArg(arg);   // Compliant, using short-circuit operator || would change the logic.\n        }\n    }\n\n    private bool CheckArg(object arg) => false;\n\n    public void FindConstant_For_AssignedInsideLoop()\n    {\n        var value = 1;\n        int result;\n        for (var v = 0; v < 42; v++)\n        {\n            value = 0;\n            result = value | v;     // Noncompliant\n        }\n    }\n\n    public void FindConstant_For_ReassignedToTheSameValue()\n    {\n        var value = 0;\n        int result;\n        for (var v = 0; v < 42; v++)\n        {\n            result = value | v;     // FN per rule description, but expected behavior for ConstantValueFinder. Variable \"value\" is reassigned inside a loop.\n            value = 0;\n        }\n    }\n\n    public void FindConstant_For()\n    {\n        var value = 0;\n        var unchanged = 0;\n        int result;\n        for (var v = 0; v < 42; v++)\n        {\n            result = value | v;     // Compliant, value changes over iterations\n            result = unchanged | v; // Noncompliant\n            value = 1;\n        }\n    }\n\n    public void FindConstant_ForEach(int[] values)\n    {\n        var value = 0;\n        var unchanged = 0;\n        int result;\n        foreach (var v in values)\n        {\n            result = value | v;     // Compliant, value changes over iterations\n            result = unchanged | v; // Noncompliant\n            value = 1;\n        }\n        unchanged = 1;\n    }\n\n    public void FindConstant_While(int[] values)\n    {\n        var value = 0;\n        var unchanged = 0;\n        int result;\n        int index = 0;\n        while (index < values.Length)\n        {\n            var v = values[index];\n            result = value | v;     // Compliant, value changes over iterations\n            result = unchanged | v; // Noncompliant\n            value = 1;\n            index++;\n        }\n        unchanged = 1;\n    }\n\n    public void FindConstant_Do(int[] values)\n    {\n        var value = 0;\n        var unchanged = 0;\n        int result;\n        var index = 0;\n        do\n        {\n            var v = values[index];\n            result = value | v;     // Compliant, value changes over iterations\n            result = unchanged | v; // Noncompliant\n            value = 1;\n            index++;\n        } while (index < values.Length);\n        unchanged = 1;\n    }\n\n    class LocalFields\n    {\n        private int start = 0;\n\n        public int End { get; set; } = 0;\n\n        public void UpdateStart(int val) => start = val;\n\n        public override int GetHashCode()\n        {\n            var value1 = Method() ^ End;\n            var value2 = start ^ End;\n            var value3 = End ^ start;\n            return Method() ^ start;\n\n            int Method() => 42;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnnecessaryBitwiseOperation.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\n\nPublic Enum Types\n    [Class] = 0\n    Struct = 1\n    [Public] = 2\n    [Private] = 4\nEnd Enum\n\nClass UnnecessaryBitwiseOperation\n\n    Public Sub Method()\n        Dim Result As Integer\n        Dim Zero As Integer = 0\n        Dim One As Integer = 1\n        Dim BitMask As Integer = &H10F\n\n        Result = -1 And BitMask ' Noncompliant\n        '        ^^^^^^\n        Result = BitMask Or 0   ' Noncompliant\n        '                ^^^^\n        Result = BitMask Xor 0  ' Noncompliant\n        Result = BitMask Xor 0  ' Noncompliant {{Remove this unnecessary bit operation.}}\n        Result = BitMask Xor Zero   ' Noncompliant\n\n        Result = BitMask And 1  ' Compliant\n        Result = BitMask Or 1   ' Compliant\n        Result = BitMask Xor 1  ' Compliant\n        Result = BitMask Xor One    ' Compliant\n\n        Dim BitMaskLong As Long = &H10F\n        Dim ResultLong As Long\n        ResultLong = BitMaskLong And ---+1L ' Noncompliant\n        ResultLong = BitMaskLong And 0L     ' Compliant\n        ResultLong = BitMaskLong Or 0UL     ' Noncompliant\n        ResultLong = BitMaskLong Or &H0L    ' Noncompliant\n        ResultLong = BitMaskLong And ReturnLong() ' Compliant\n        ResultLong = BitMaskLong And &HF   ' Compliant\n\n        Dim ResultULong As ULong = 1UL Or &H0UL     ' Noncompliant\n        ResultULong = 1UL Or 18446744073709551615UL ' Compliant\n\n        MyMethod(1UL Or &H0UL) ' Noncompliant\n\n        If True AndAlso True Then Return\n        If True OrElse True Then Return\n\n        Dim Flags As Types = Types.Class Or Types.Private   ' Compliant even when class is zero\n        Flags = Types.Class\n        Flags = Flags Or Types.Private      ' Compliant, even when \"flags\" was initally zero\n    End Sub\n\n    Private Shared Function ReturnLong() As Long\n        Return 1L\n    End Function\n\n    Private Shared Sub MyMethod(U As UInt64)\n    End Sub\n\nEnd Class\n\n' https//github.com/SonarSource/sonar-dotnet/issues/4399\nPublic Class Repro_4399\n\n    Public Sub BuildMask(DaysOfWeek As IEnumerable(Of DayOfWeek))\n        Dim Value As Integer = 0\n        For Each dow As DayOfWeek In DaysOfWeek\n            Value = Value Or (1 << CInt(dow))   ' Compliant, value changes over iterations\n        Next\n    End Sub\n\n    Public Sub Repro(Args() As Object)\n        Dim Fail As Boolean = False\n        For Each Arg As Object In Args\n            Fail = Fail Or Not CheckArg(Arg)    ' Compliant, using short-circuit operator OrElse would change the logic.\n        Next\n    End Sub\n\n    Private Function CheckArg(Arg As Object) As Boolean\n    End Function\n\n    Public Sub FindConstant_For_AssignedInsideLoop()\n        Dim Value As Integer = 1\n        Dim Result As Integer\n        For v As Integer = 0 To 41\n            Value = 0\n            Result = Value Or v     ' Noncompliant\n        Next\n    End Sub\n\n    Public Sub FindConstant_For_ReassignedToTheSameValue()\n        Dim Value As Integer = 0\n        Dim Result As Integer\n        For v As Integer = 0 To 41\n            Result = Value Or v     ' FN per rule description, but expected behavior for ConstantValueFinder. Variable \"Value\" is reassigned inside a Loop.\n            Value = 0\n        Next\n    End Sub\n\n    Public Sub FindConstant_For()\n        Dim Value As Integer = 0\n        Dim Unchanged As Integer = 0\n        Dim Result As Integer\n        For v As Integer = 0 To 41\n            Result = Value Or v         ' Compliant, value changes over iterations\n            Result = Unchanged Or v     ' Noncompliant\n            Value = 1\n        Next\n        Unchanged = 1\n    End Sub\n\n    Public Sub FindConstant_ForEach(Values() As Integer)\n        Dim Value As Integer = 0\n        Dim Unchanged As Integer = 0\n        Dim Result As Integer\n        For Each v As Integer In Values\n            Result = Value Or v         ' Compliant, value changes over iterations\n            Result = Unchanged Or v     ' Noncompliant\n            Value = 1\n        Next\n        Unchanged = 1\n    End Sub\n\n    Public Sub FindConstant_While(Values() As Integer)\n        Dim Value As Integer = 0\n        Dim Unchanged As Integer = 0\n        Dim Result As Integer\n        Dim Index As Integer\n        While Index < Values.Length\n            Dim v As Integer = Values(Index)\n            Result = Value Or v         ' Compliant, value changes over iterations\n            Result = Unchanged Or v     ' Noncompliant\n            Value = 1\n            Index += 1\n        End While\n        Unchanged = 1\n    End Sub\n\n    Public Sub FindConstant_DoWhile(Values() As Integer)\n        Dim Value As Integer = 0\n        Dim Unchanged As Integer = 0\n        Dim Result As Integer\n        Dim Index As Integer\n        Do While Index < Values.Length\n            Dim v As Integer = Values(Index)\n            Result = Value Or v         ' Compliant, value changes over iterations\n            Result = Unchanged Or v     ' Noncompliant\n            Value = 1\n            Index += 1\n        Loop\n        Unchanged = 1\n    End Sub\n\n    Public Sub FindConstant_DoUntil(Values() As Integer)\n        Dim Value As Integer = 0\n        Dim Unchanged As Integer = 0\n        Dim Result As Integer\n        Dim Index As Integer\n        Do Until Index >= Values.Length\n            Dim v As Integer = Values(Index)\n            Result = Value Or v         ' Compliant, value changes over iterations\n            Result = Unchanged Or v     ' Noncompliant\n            Value = 1\n            Index += 1\n        Loop\n        Unchanged = 1\n    End Sub\n\n    Public Sub FindConstant_DoLoopWhile(Values() As Integer)\n        Dim Value As Integer = 0\n        Dim Unchanged As Integer = 0\n        Dim Result As Integer\n        Dim Index As Integer\n        Do\n            Dim v As Integer = Values(Index)\n            Result = Value Or v         ' Compliant, value changes over iterations\n            Result = Unchanged Or v     ' Noncompliant\n            Value = 1\n            Index += 1\n        Loop While Index < Values.Length\n        Unchanged = 1\n    End Sub\n\n    Public Sub FindConstant_DoLoopUntil(Values() As Integer)\n        Dim Value As Integer = 0\n        Dim Unchanged As Integer = 0\n        Dim Result As Integer\n        Dim Index As Integer\n        Do\n            Dim v As Integer = Values(Index)\n            Result = Value Or v         ' Compliant, value changes over iterations\n            Result = Unchanged Or v     ' Noncompliant\n            Value = 1\n            Index += 1\n        Loop Until Index >= Values.Length\n        Unchanged = 1\n    End Sub\n\nEnd Class\n\nPublic Class LocalFields\n\n    Private Start As Integer = 0\n\n    Public Property [End] As Integer = 0\n\n    Public Sub UpdateStart(Val As Integer)\n        Start = Val\n    End Sub\n\n    Public Overrides Function GetHashCode() As Integer\n        Dim Value1 = Method() ^ [End]\n        Dim Value2 = Start ^ [End]\n        Dim Value3 = [End] ^ Start\n        Return Method() ^ Start\n    End Function\n\n    Private Function Method() As Integer\n        Return 42\n    End Function\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnnecessaryMathematicalComparison.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace SonarAnalyzer.Test.TestCases\n{\n    internal class UnnecessaryMathematicalComparison\n    {\n        public void IsPatterns()\n        {\n            _ = 33 is 55; // Compliant\n            _ = 33 is < 55; // Compliant\n            _ = 33 is <= 55; // Compliant\n            _ = 33 is > 55; // Compliant\n            _ = 33 is >= 55; // Compliant\n            _ = 33 is not 55; // Compliant\n\n            const double d = double.MaxValue;\n            float x = 42;\n            _ = x is d; // Error [CS0266] - cannot implicitly convert type 'double' to 'float'\n        }\n    }\n}\n\npublic class FieldKeyword\n{\n    public ulong Prop\n    {\n        get { return field > float.MaxValue ? 0 : field; } // Noncompliant\n        set { field = float.MinValue < field ? 1uL : 0; }  // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnnecessaryMathematicalComparison.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Security.Cryptography.X509Certificates;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace SonarAnalyzer.Test.TestCases\n{\n    internal class UnnecessaryMathematicalComparison\n    {\n        private T GetValue<T>() => default(T);\n\n        public void Chars() // Rule applies\n        {\n            const char smallChar = char.MinValue;\n            const int smallInt = char.MinValue;\n            const long smallLong = char.MinValue;\n            const float smallFloat = char.MinValue;\n            const double smallDouble = char.MinValue;\n            const decimal smallDecimal = char.MinValue;\n\n            const char bigChar = char.MaxValue;\n            const int bigInt = char.MaxValue;\n            const long bigLong = char.MaxValue;\n            const float bigFloat = char.MaxValue;\n            const double bigDouble = char.MaxValue;\n            const decimal bigDecimal = char.MaxValue;\n\n            var c = GetValue<char>();\n\n            _ = c >= bigChar; // Compliant, not (always true) or (always false)\n            _ = c >= bigInt; // Compliant, not (always true) or (always false)\n            _ = bigLong <= c; // Compliant, not (always true) or (always false)\n            _ = bigFloat <= c; // Compliant, not (always true) or (always false)\n            _ = bigDouble <= c; // Compliant, not (always true) or (always false)\n            _ = bigDecimal <= c; // Compliant, not (always true) or (always false)\n\n            _ = c <= smallChar; // Compliant, not (always true) or (always false)\n            _ = c <= smallInt; // Compliant, not (always true) or (always false)\n            _ = smallLong >= c; // Compliant, not (always true) or (always false)\n            _ = smallFloat >= c; // Compliant, not (always true) or (always false)\n            _ = smallDouble >= c; // Compliant, not (always true) or (always false)\n            _ = smallDecimal >= c; // Compliant, not (always true) or (always false)\n\n            const int veryBig = int.MaxValue;\n            const long verySmall = long.MinValue;\n\n            _ = c < veryBig; // Noncompliant {{Comparison to this constant is useless; the constant is outside the range of type 'char'}}\n            _ = veryBig > c; // Noncompliant {{Comparison to this constant is useless; the constant is outside the range of type 'char'}}\n            _ = c > verySmall; // Noncompliant {{Comparison to this constant is useless; the constant is outside the range of type 'char'}}\n            _ = verySmall < c; // Noncompliant {{Comparison to this constant is useless; the constant is outside the range of type 'char'}}\n            _ = verySmall == c; // Noncompliant {{Comparison to this constant is useless; the constant is outside the range of type 'char'}}\n            _ = c == veryBig; // Noncompliant {{Comparison to this constant is useless; the constant is outside the range of type 'char'}}\n        }\n\n        public void SBytes() // CS0652\n        {\n            const sbyte smallSByte = sbyte.MinValue;\n            const short smallShort = sbyte.MinValue;\n            const int smallInt = sbyte.MinValue;\n            const long smallLong = sbyte.MinValue;\n            const float smallFloat = sbyte.MinValue;\n            const double smallDouble = sbyte.MinValue;\n            const decimal smallDecimal = sbyte.MinValue;\n\n            const sbyte bigSByte = sbyte.MaxValue;\n            const short bigShort = sbyte.MaxValue;\n            const int bigInt = sbyte.MaxValue;\n            const long bigLong = sbyte.MaxValue;\n            const float bigFloat = sbyte.MaxValue;\n            const double bigDouble = sbyte.MaxValue;\n            const decimal bigDecimal = sbyte.MaxValue;\n\n            var sb = GetValue<sbyte>();\n\n            _ = sb >= bigSByte; // Compliant, not (always true) or (always false)\n            _ = sb >= bigShort; // Compliant, not (always true) or (always false)\n            _ = sb >= bigInt; // Compliant, not (always true) or (always false)\n            _ = bigLong <= sb; // Compliant, not (always true) or (always false)\n            _ = bigFloat <= sb; // Compliant, not (always true) or (always false)\n            _ = bigDouble <= sb; // Compliant, not (always true) or (always false)\n            _ = bigDecimal <= sb; // Compliant, not (always true) or (always false)\n\n            _ = sb <= smallSByte; // Compliant, not (always true) or (always false)\n            _ = sb <= smallShort; // Compliant, not (always true) or (always false)\n            _ = sb <= smallInt; // Compliant, not (always true) or (always false)\n            _ = smallLong >= sb; // Compliant, not (always true) or (always false)\n            _ = smallFloat >= sb; // Compliant, not (always true) or (always false)\n            _ = smallDouble >= sb; // Compliant, not (always true) or (always false)\n            _ = smallDecimal >= sb; // Compliant, not (always true) or (always false)\n\n            const int veryBig = int.MaxValue;\n            const long verySmall = long.MinValue;\n\n            _ = sb < veryBig;    // Error [CS0652] - compiler warning \"Comparison to integral constant is out of range of the compared type\"\n            _ = veryBig > sb;    // Error [CS0652] - compiler warning \"Comparison to integral constant is out of range of the compared type\"\n            _ = sb > verySmall;  // Error [CS0652] - compiler warning \"Comparison to integral constant is out of range of the compared type\"\n            _ = verySmall < sb;  // Error [CS0652] - compiler warning \"Comparison to integral constant is out of range of the compared type\"\n            _ = verySmall == sb; // Error [CS0652] - compiler warning \"Comparison to integral constant is out of range of the compared type\"\n            _ = sb == veryBig;   // Error [CS0652] - compiler warning \"Comparison to integral constant is out of range of the compared type\"\n        }\n\n        public void Bytes() // CS0652\n        {\n            const byte smallByte = byte.MinValue;\n            const short smallShort = byte.MinValue;\n            const ushort smallUShort = byte.MinValue;\n            const int smallInt = byte.MinValue;\n            const uint smallUInt = byte.MinValue;\n            const long smallLong = byte.MinValue;\n            const ulong smallULong = byte.MinValue;\n            const float smallFloat = byte.MinValue;\n            const double smallDouble = byte.MinValue;\n            const decimal smallDecimal = byte.MinValue;\n\n            const byte bigByte = byte.MaxValue;\n            const short bigShort = byte.MaxValue;\n            const ushort bigUShort = byte.MaxValue;\n            const int bigInt = byte.MaxValue;\n            const uint bigUInt = byte.MaxValue;\n            const long bigLong = byte.MaxValue;\n            const ulong bigULong = byte.MaxValue;\n            const float bigFloat = byte.MaxValue;\n            const double bigDouble = byte.MaxValue;\n            const decimal bigDecimal = byte.MaxValue;\n\n            var b = GetValue<byte>();\n\n            _ = b >= bigByte; // Compliant, not (always true) or (always false)\n            _ = b >= bigShort; // Compliant, not (always true) or (always false)\n            _ = b >= bigUShort; // Compliant, not (always true) or (always false)\n            _ = b >= bigInt; // Compliant, not (always true) or (always false)\n            _ = b >= bigUInt; // Compliant, not (always true) or (always false)\n            _ = bigLong <= b; // Compliant, not (always true) or (always false)\n            _ = bigULong <= b; // Compliant, not (always true) or (always false)\n            _ = bigFloat <= b; // Compliant, not (always true) or (always false)\n            _ = bigDouble <= b; // Compliant, not (always true) or (always false)\n            _ = bigDecimal <= b; // Compliant, not (always true) or (always false)\n\n            _ = b <= smallByte; // Compliant, not (always true) or (always false)\n            _ = b <= smallShort; // Compliant, not (always true) or (always false)\n            _ = b <= smallUShort; // Compliant, not (always true) or (always false)\n            _ = b <= smallInt; // Compliant, not (always true) or (always false)\n            _ = b <= smallUInt; // Compliant, not (always true) or (always false)\n            _ = smallLong >= b; // Compliant, not (always true) or (always false)\n            _ = smallULong >= b; // Compliant, not (always true) or (always false)\n            _ = smallFloat >= b; // Compliant, not (always true) or (always false)\n            _ = smallDouble >= b; // Compliant, not (always true) or (always false)\n            _ = smallDecimal >= b; // Compliant, not (always true) or (always false)\n\n            const int veryBig = int.MaxValue;\n            const short verySmall = short.MinValue;\n\n            _ = b < veryBig;    // Error [CS0652] - compiler warning \"Comparison to integral constant is out of range of the compared type\"\n            _ = veryBig > b;    // Error [CS0652] - compiler warning \"Comparison to integral constant is out of range of the compared type\"\n            _ = b > verySmall;  // Error [CS0652] - compiler warning \"Comparison to integral constant is out of range of the compared type\"\n            _ = verySmall < b;  // Error [CS0652] - compiler warning \"Comparison to integral constant is out of range of the compared type\"\n            _ = verySmall == b; // Error [CS0652] - compiler warning \"Comparison to integral constant is out of range of the compared type\"\n            _ = b == veryBig;   // Error [CS0652] - compiler warning \"Comparison to integral constant is out of range of the compared type\"\n        }\n\n        public void Shorts() // CS0652\n        {\n            const short smallShort = short.MinValue;\n            const int smallInt = short.MinValue;\n            const long smallLong = short.MinValue;\n            const float smallFloat = short.MinValue;\n            const double smallDouble = short.MinValue;\n            const decimal smallDecimal = short.MinValue;\n\n            const short bigShort = short.MaxValue;\n            const int bigInt = short.MaxValue;\n            const long bigLong = short.MaxValue;\n            const float bigFloat = short.MaxValue;\n            const double bigDouble = short.MaxValue;\n            const decimal bigDecimal = short.MaxValue;\n\n            var s = GetValue<short>();\n\n            _ = s >= bigShort; // Compliant, not (always true) or (always false)\n            _ = s >= bigInt; // Compliant, not (always true) or (always false)\n            _ = bigLong <= s; // Compliant, not (always true) or (always false)\n            _ = bigFloat <= s; // Compliant, not (always true) or (always false)\n            _ = bigDouble <= s; // Compliant, not (always true) or (always false)\n            _ = bigDecimal <= s; // Compliant, not (always true) or (always false)\n\n            _ = s <= smallShort; // Compliant, not (always true) or (always false)\n            _ = s <= smallInt; // Compliant, not (always true) or (always false)\n            _ = smallLong >= s; // Compliant, not (always true) or (always false)\n            _ = smallFloat >= s; // Compliant, not (always true) or (always false)\n            _ = smallDouble >= s; // Compliant, not (always true) or (always false)\n            _ = smallDecimal >= s; // Compliant, not (always true) or (always false)\n\n            const int veryBig = int.MaxValue;\n            const long verySmall = long.MinValue;\n\n            _ = s < veryBig;    // Error [CS0652] - compiler warning \"Comparison to integral constant is out of range of the compared type\"\n            _ = veryBig > s;    // Error [CS0652] - compiler warning \"Comparison to integral constant is out of range of the compared type\"\n            _ = s > verySmall;  // Error [CS0652] - compiler warning \"Comparison to integral constant is out of range of the compared type\"\n            _ = verySmall < s;  // Error [CS0652] - compiler warning \"Comparison to integral constant is out of range of the compared type\"\n            _ = verySmall == s; // Error [CS0652] - compiler warning \"Comparison to integral constant is out of range of the compared type\"\n            _ = s == veryBig;   // Error [CS0652] - compiler warning \"Comparison to integral constant is out of range of the compared type\"\n        }\n\n        public void UShorts() // CS0652\n        {\n            const ushort smallUShort = ushort.MinValue;\n            const int smallInt = ushort.MinValue;\n            const uint smallUInt = ushort.MinValue;\n            const long smallLong = ushort.MinValue;\n            const ulong smallULong = ushort.MinValue;\n            const float smallFloat = ushort.MinValue;\n            const double smallDouble = ushort.MinValue;\n            const decimal smallDecimal = ushort.MinValue;\n\n            const ushort bigUShort = ushort.MaxValue;\n            const int bigInt = ushort.MaxValue;\n            const uint bigUInt = ushort.MaxValue;\n            const long bigLong = ushort.MaxValue;\n            const ulong bigULong = ushort.MaxValue;\n            const float bigFloat = ushort.MaxValue;\n            const double bigDouble = ushort.MaxValue;\n            const decimal bigDecimal = ushort.MaxValue;\n\n            var us = GetValue<ushort>();\n\n            _ = us >= bigUShort; // Compliant, not (always true) or (always false)\n            _ = us >= bigInt; // Compliant, not (always true) or (always false)\n            _ = us >= bigUInt; // Compliant, not (always true) or (always false)\n            _ = bigLong <= us; // Compliant, not (always true) or (always false)\n            _ = bigULong <= us; // Compliant, not (always true) or (always false)\n            _ = bigFloat <= us; // Compliant, not (always true) or (always false)\n            _ = bigDouble <= us; // Compliant, not (always true) or (always false)\n            _ = bigDecimal <= us; // Compliant, not (always true) or (always false)\n\n            _ = us <= smallUShort; // Compliant, not (always true) or (always false)\n            _ = us <= smallInt; // Compliant, not (always true) or (always false)\n            _ = us <= smallUInt; // Compliant, not (always true) or (always false)\n            _ = smallLong >= us; // Compliant, not (always true) or (always false)\n            _ = smallULong >= us; // Compliant, not (always true) or (always false)\n            _ = smallFloat >= us; // Compliant, not (always true) or (always false)\n            _ = smallDouble >= us; // Compliant, not (always true) or (always false)\n            _ = smallDecimal >= us; // Compliant, not (always true) or (always false)\n\n            const int veryBig = int.MaxValue;\n            const long verySmall = long.MinValue;\n\n            _ = us < veryBig;    // Error [CS0652] - compiler warning \"Comparison to integral constant is out of range of the compared type\"\n            _ = veryBig > us;    // Error [CS0652] - compiler warning \"Comparison to integral constant is out of range of the compared type\"\n            _ = us > verySmall;  // Error [CS0652] - compiler warning \"Comparison to integral constant is out of range of the compared type\"\n            _ = verySmall < us;  // Error [CS0652] - compiler warning \"Comparison to integral constant is out of range of the compared type\"\n            _ = verySmall == us; // Error [CS0652] - compiler warning \"Comparison to integral constant is out of range of the compared type\"\n            _ = us == veryBig;   // Error [CS0652] - compiler warning \"Comparison to integral constant is out of range of the compared type\"\n        }\n\n        public void Ints() // CS0652\n        {\n            const int smallInt = int.MinValue;\n            const long smallLong = int.MinValue;\n            const float smallFloat = int.MinValue;\n            const double smallDouble = int.MinValue;\n            const decimal smallDecimal = int.MinValue;\n\n            const int bigInt = int.MaxValue;\n            const uint bigUInt = int.MaxValue;\n            const long bigLong = int.MaxValue;\n            const float bigFloat = int.MaxValue;\n            const double bigDouble = int.MaxValue;\n            const decimal bigDecimal = int.MaxValue;\n\n            var i = GetValue<int>();\n\n            _ = i >= bigInt; // Compliant, not (always true) or (always false)\n            _ = i >= bigUInt; // Compliant, not (always true) or (always false)\n            _ = bigLong <= i; // Compliant, not (always true) or (always false)\n            _ = bigFloat <= i; // Compliant, not (always true) or (always false)\n            _ = bigDouble <= i; // Compliant, not (always true) or (always false)\n            _ = bigDecimal <= i; // Compliant, not (always true) or (always false)\n\n            _ = i <= smallInt; // Compliant, not (always true) or (always false)\n            _ = smallLong >= i; // Compliant, not (always true) or (always false)\n            _ = smallFloat >= i; // Compliant, not (always true) or (always false)\n            _ = smallDouble >= i; // Compliant, not (always true) or (always false)\n            _ = smallDecimal >= i; // Compliant, not (always true) or (always false)\n\n            const long veryBig = long.MaxValue;\n            const long verySmall = long.MinValue;\n\n            _ = i < veryBig;    // Error [CS0652] - compiler warning \"Comparison to integral constant is out of range of the compared type\"\n            _ = veryBig > i;    // Error [CS0652] - compiler warning \"Comparison to integral constant is out of range of the compared type\"\n            _ = i > verySmall;  // Error [CS0652] - compiler warning \"Comparison to integral constant is out of range of the compared type\"\n            _ = verySmall < i;  // Error [CS0652] - compiler warning \"Comparison to integral constant is out of range of the compared type\"\n            _ = verySmall == i; // Error [CS0652] - compiler warning \"Comparison to integral constant is out of range of the compared type\"\n            _ = i == veryBig;   // Error [CS0652] - compiler warning \"Comparison to integral constant is out of range of the compared type\"\n        }\n\n        public void UInts() // CS0652\n        {\n            const uint smallUInt = uint.MinValue;\n            const long smallLong = uint.MinValue;\n            const ulong smallULong = uint.MinValue;\n            const float smallFloat = uint.MinValue;\n            const double smallDouble = uint.MinValue;\n            const decimal smallDecimal = uint.MinValue;\n\n            const uint bigUInt = uint.MaxValue;\n            const long bigLong = uint.MaxValue;\n            const ulong bigULong = uint.MaxValue;\n            const float bigFloat = uint.MaxValue;\n            const double bigDouble = uint.MaxValue;\n            const decimal bigDecimal = uint.MaxValue;\n\n            var ui = GetValue<uint>();\n\n            _ = ui >= bigUInt; // Compliant, not (always true) or (always false)\n            _ = bigLong <= ui; // Compliant, not (always true) or (always false)\n            _ = bigULong <= ui; // Compliant, not (always true) or (always false)\n            _ = bigFloat <= ui; // Compliant, not (always true) or (always false)\n            _ = bigDouble <= ui; // Compliant, not (always true) or (always false)\n            _ = bigDecimal <= ui; // Compliant, not (always true) or (always false)\n\n            _ = ui <= smallUInt; // Compliant, not (always true) or (always false)\n            _ = smallLong >= ui; // Compliant, not (always true) or (always false)\n            _ = smallULong >= ui; // Compliant, not (always true) or (always false)\n            _ = smallFloat >= ui; // Compliant, not (always true) or (always false)\n            _ = smallDouble >= ui; // Compliant, not (always true) or (always false)\n            _ = smallDecimal >= ui; // Compliant, not (always true) or (always false)\n\n            const long veryBig = long.MaxValue;\n            const long verySmall = long.MinValue;\n\n            _ = ui < veryBig;    // Error [CS0652] - compiler warning \"Comparison to integral constant is out of range of the compared type\"\n            _ = veryBig > ui;    // Error [CS0652] - compiler warning \"Comparison to integral constant is out of range of the compared type\"\n            _ = ui > verySmall;  // Error [CS0652] - compiler warning \"Comparison to integral constant is out of range of the compared type\"\n            _ = verySmall < ui;  // Error [CS0652] - compiler warning \"Comparison to integral constant is out of range of the compared type\"\n            _ = verySmall == ui; // Error [CS0652] - compiler warning \"Comparison to integral constant is out of range of the compared type\"\n            _ = ui == veryBig;   // Error [CS0652] - compiler warning \"Comparison to integral constant is out of range of the compared type\"\n        }\n\n        public void Longs() // Rule applies\n        {\n            const long smallLong = long.MinValue;\n            const float smallFloat = long.MinValue;\n            const double smallDouble = long.MinValue;\n            const decimal smallDecimal = long.MinValue;\n\n            const long bigLong = long.MaxValue;\n            const float bigFloat = long.MaxValue;\n            const double bigDouble = long.MaxValue;\n            const decimal bigDecimal = long.MaxValue;\n\n            var l = GetValue<long>();\n\n            _ = bigLong <= l; // Compliant, not (always true) or (always false)\n            _ = bigFloat <= l; // Compliant, not (always true) or (always false)\n            _ = bigDouble <= l; // Compliant, not (always true) or (always false)\n            _ = bigDecimal <= l; // Compliant, not (always true) or (always false)\n\n            _ = smallLong >= l; // Compliant, not (always true) or (always false)\n            _ = smallFloat >= l; // Compliant, not (always true) or (always false)\n            _ = smallDouble >= l; // Compliant, not (always true) or (always false)\n            _ = smallDecimal >= l; // Compliant, not (always true) or (always false)\n\n            const double veryBig = double.MaxValue;\n            const double verySmall = double.MinValue;\n\n            _ = l < veryBig; // Noncompliant {{Comparison to this constant is useless; the constant is outside the range of type 'long'}}\n            _ = veryBig > l; // Noncompliant {{Comparison to this constant is useless; the constant is outside the range of type 'long'}}\n            _ = l > verySmall; // Noncompliant {{Comparison to this constant is useless; the constant is outside the range of type 'long'}}\n            _ = verySmall < l; // Noncompliant {{Comparison to this constant is useless; the constant is outside the range of type 'long'}}\n            _ = verySmall == l; // Noncompliant {{Comparison to this constant is useless; the constant is outside the range of type 'long'}}\n            _ = l == veryBig; // Noncompliant {{Comparison to this constant is useless; the constant is outside the range of type 'long'}}\n        }\n\n        public void ULongs() // Rule applies\n        {\n            const ulong smallULong = ulong.MinValue;\n            const float smallFloat = ulong.MinValue;\n            const double smallDouble = ulong.MinValue;\n            const decimal smallDecimal = ulong.MinValue;\n\n            const ulong bigULong = ulong.MaxValue;\n            const float bigFloat = ulong.MaxValue;\n            const double bigDouble = ulong.MaxValue;\n            const decimal bigDecimal = ulong.MaxValue;\n\n            ulong ul = 42;\n\n            _ = bigULong <= ul; // Compliant, not (always true) or (always false)\n            _ = bigFloat <= ul; // Compliant, not (always true) or (always false)\n            _ = bigDouble <= ul; // Compliant, not (always true) or (always false)\n            _ = bigDecimal <= ul; // Compliant, not (always true) or (always false)\n\n            _ = smallULong >= ul; // Compliant, not (always true) or (always false)\n            _ = smallFloat >= ul; // Compliant, not (always true) or (always false)\n            _ = smallDouble >= ul; // Compliant, not (always true) or (always false)\n            _ = smallDecimal >= ul; // Compliant, not (always true) or (always false)\n\n            const float veryBig = float.MaxValue;\n            const float verySmall = float.MinValue;\n\n            _ = ul < veryBig; // Noncompliant {{Comparison to this constant is useless; the constant is outside the range of type 'ulong'}}\n            _ = veryBig > ul; // Noncompliant {{Comparison to this constant is useless; the constant is outside the range of type 'ulong'}}\n            _ = ul > verySmall; // Noncompliant {{Comparison to this constant is useless; the constant is outside the range of type 'ulong'}}\n            _ = verySmall < ul; // Noncompliant {{Comparison to this constant is useless; the constant is outside the range of type 'ulong'}}\n            _ = verySmall == ul; // Noncompliant {{Comparison to this constant is useless; the constant is outside the range of type 'ulong'}}\n            _ = ul == veryBig; // Noncompliant {{Comparison to this constant is useless; the constant is outside the range of type 'ulong'}}\n        }\n\n        public void Floats() // Rule applies\n        {\n            const float smallFloat = float.MinValue;\n            const double smallDouble = float.MinValue;\n\n            const float bigFloat = float.MaxValue;\n            const double bigDouble = float.MaxValue;\n\n\n            const long l = long.MaxValue;\n            var i = 42;\n\n            System.Single f = GetValue<float>();\n\n            _ = bigFloat <= f; // Compliant, not (always true) or (always false)\n            _ = bigDouble <= f; // Compliant, not (always true) or (always false)\n\n            _ = smallFloat >= f; // Compliant, not (always true) or (always false)\n            _ = smallDouble >= f; // Compliant, not (always true) or (always false)\n\n            const double veryBig = double.MaxValue;\n            const double verySmall = double.MinValue;\n\n            _ = f < veryBig; // Noncompliant {{Comparison to this constant is useless; the constant is outside the range of type 'float'}}\n            _ = veryBig > f; // Noncompliant {{Comparison to this constant is useless; the constant is outside the range of type 'float'}}\n            _ = f > verySmall; // Noncompliant {{Comparison to this constant is useless; the constant is outside the range of type 'float'}}\n            _ = verySmall < f; // Noncompliant {{Comparison to this constant is useless; the constant is outside the range of type 'float'}}\n            _ = verySmall == f; // Noncompliant {{Comparison to this constant is useless; the constant is outside the range of type 'float'}}\n            _ = f == veryBig; // Noncompliant {{Comparison to this constant is useless; the constant is outside the range of type 'float'}}\n        }\n\n        public void ConstantInBothOperands()\n        {\n            const float number1 = 42;\n            const double number2 = double.MaxValue;\n\n            // https://github.com/SonarSource/sonar-dotnet/issues/6745\n            _ = number1 != number2; // Compliant, constant in both operands\n            _ = number1 == number2; // Compliant\n            _ = number1 <= double.MaxValue; // Compliant\n            _ = double.MaxValue >= number2; // Compliant\n\n            _ = 42f != double.MaxValue; // Compliant\n            _ = 42f <= double.MaxValue; // Compliant\n        }\n\n        public void Edgecases()\n        {\n            const float fPositiveInfinity = float.PositiveInfinity;\n            const float fNegativeInfinity = float.NegativeInfinity;\n            const double dPositiveInfinity = double.PositiveInfinity;\n            const double dNegativeInfinity = double.NegativeInfinity;\n\n            const float fNan = float.NaN;\n            const double dNan = double.NaN;\n\n            float f = 42;\n\n            _ = f <= fPositiveInfinity; // Compliant\n            _ = fNegativeInfinity < f; // Compliant\n\n            _ = fNegativeInfinity != f; // Compliant\n            _ = dNegativeInfinity == f; // Compliant\n\n            _ = f >= dPositiveInfinity; // Compliant\n            _ = dNegativeInfinity > f; // Compliant\n            _ = f != fPositiveInfinity; // Compliant\n            _ = f == dPositiveInfinity; // Compliant\n\n\n            _ = f == fNan; // Compliant\n            _ = f != fNan; // Compliant\n            _ = f <= fNan; // Compliant\n            _ = f >= fNan; // Compliant\n            _ = f > fNan; // Compliant\n            _ = f < fNan; // Compliant\n\n            _ = dNan == f; // Compliant\n            _ = dNan != f; // Compliant\n            _ = dNan <= f; // Compliant\n            _ = dNan >= f; // Compliant\n            _ = dNan > f; // Compliant\n            _ = dNan < f; // Compliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnnecessaryUsings.CSharp10.Consumer.cs",
    "content": "﻿// global usings declared in UnnecessaryUsings.CSharp10.Global.cs\n\nglobal using System.Globalization; // FN - is not used in any file\n\nusing System.Text; // Noncompliant\n\nclass TestConsumingGlobalUsings\n{\n    static void Main() { }\n    public double Size(IList list) => list.Count;\n    public void Write(string s) => Console.WriteLine(s);\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnnecessaryUsings.CSharp10.FileScopedNamespace.Fixed.cs",
    "content": "﻿using System;\n\nnamespace MyNamespace0;\n\nusing MySysAlias = System;\nusing System.Collections.Generic;\nusing static System.Console;\n\nclass C\n{\n    MySysAlias.StringComparer x;\n\n    void M(IEnumerable<string> myEnumerable)\n    {\n        WriteLine(\"\");\n        MySysAlias.Console.WriteLine(\"\");\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnnecessaryUsings.CSharp10.FileScopedNamespace.cs",
    "content": "﻿using System;\n\nnamespace MyNamespace0;\n\nusing MySysAlias = System;\nusing System.Linq; // Noncompliant {{Remove this unnecessary 'using'.}}\nusing System.Collections; // Noncompliant\nusing System.Globalization; // Noncompliant\nusing System.Collections.Generic;\nusing static System.Console;\n\nclass C\n{\n    MySysAlias.StringComparer x;\n\n    void M(IEnumerable<string> myEnumerable)\n    {\n        WriteLine(\"\");\n        MySysAlias.Console.WriteLine(\"\");\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnnecessaryUsings.CSharp10.Global.cs",
    "content": "﻿global using System; // compliant - used in UnnecessaryUsings.CSharp10.Consumer.cs\nglobal using System.Linq; // FN - it's not used in any file\nglobal using System.Collections; // compliant  - used in UnnecessaryUsings.CSharp10.Consumer.cs\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnnecessaryUsings.CSharp12.cs",
    "content": "﻿using Person = (string name, string surname); // FN\nusing unsafe IntPointerExt = int*; // FN\nusing IntArray = int[]; // FN\nusing Point3D = (int, int, int);\n\nnamespace ANamespace\n{\n    using Point2D = (int, int); // FN\n    using unsafe IntPointer = int*; // FN: unused\n    using StringArray = string[];\n\n    class MyClass\n    {\n        void AliasType()\n        {\n            var point = new Point3D(1, 2, 3);\n            var stringArray = new StringArray[1];\n        }\n    }\n\n    namespace BNamespace\n    {\n        using unsafe IntPointer = int; // Compliant: used\n\n        unsafe class AliasShadowing(IntPointer* y);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnnecessaryUsings.CSharp9.cs",
    "content": "﻿using System;\nusing System.Linq; // Noncompliant\nusing System.Collections;\n\nConsole.WriteLine(\"a\");\n\nrecord Record\n{\n    public double Size(IList list) => list.Count;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnnecessaryUsings.Fixed.Batch.cs",
    "content": "﻿using System;\nusing System.Runtime.CompilerServices;\nusing System.Threading.Tasks;\nusing System.IO;\nusing System.IO; // Error [CS0105] - compiler warning, duplicate using directive\nusing static System.Console;\nusing static System.DateTime; // FN - System.DateTime is not a namespace symbol\nusing MySysAlias = System;\nusing MyOtherAlias = System.Collections; // FN - aliases not yet supported\nusing MyNamespace1; // Compliant - used inside MyNamspace2 to access Ns1_1\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Reflection;\nusing System.Security.Cryptography;\nusing System.Collections.ObjectModel;\n\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n\nnamespace MyNamespace0\n{\n    class Ns0_0 { }\n}\n\nnamespace MyNamespace1\n{\n    class Ns1_0 { }\n}\n\nnamespace MyNamespace2\n{\n    class Ns2_0\n    {\n        Ns1_0 ns11;\n    }\n}\n\nnamespace MyNamespace2.Level1\n{\n    using MyNamespace0;\n    using MyNamespace0; // Error [CS0105] - compiler warning, duplicate using directive\n    using MyNamespace0; // Error [CS0105] - compiler warning, duplicate using directive\n    using MyNamespace1; // CS0105 does not fire here — duplicates file-level import, not a same-scope duplicate\n\n    class Ns2_1\n    {\n        Ns0_0 ns00;\n        Ns2_0 ns20;\n        Ns1_0 ns11;\n        Ns2_1 ns21;\n    }\n\n    namespace Level2\n    {\n        using MyNamespace1; // CS0105 does not fire here — duplicates file-level import, not a same-scope duplicate\n        using System.IO;    // CS0105 does not fire here — duplicates file-level import, not a same-scope duplicate\n\n        class Ns2_2\n        {\n            Ns1_0 ns11;\n\n            void M(IEnumerable<DateTimeStyles> myEnumerable)\n            {\n                File.ReadAllLines(\"\");\n                WriteLine(\"\");\n                MySysAlias.Console.WriteLine(\"\");\n            }\n        }\n    }\n}\n\nnamespace MyNamespace2.Level1.Level2\n{\n    using MyNamespace0;\n\n    class Ns2_3\n    {\n        Ns0_0 ns00;\n        Ns2_1 ns21;\n    }\n}\n\nnamespace MyNamespace3\n{\n    class Ns3_0 { }\n}\n\nnamespace ReferencesInsideDocumentationTags\n{\n    using System.ComponentModel;\n    using System.Collections.Specialized;\n\n    /// <summary> There is <see cref=\"Win32Exception\"/> or <see cref=\"ListDictionary\"/></summary>\n    class ClassWithDoc { }\n\n    class InnerClass\n    {\n        /// <exception cref=\"AesManaged\"></exception>\n        public void MethodWithDoc() { }\n\n        /// <summary>\n        ///   <seealso cref=\"ReadOnlyCollection{T}\"/>\n        /// </summary>\n        public void MethodWithGenericClassDoc() { }\n\n        /// This is just a comment\n        public void MethodWithoutXMLDoc() { }\n    }\n}\n\nnamespace AwaitExtensionHolder\n{\n\n    internal static class ExtensionHolder\n    {\n        public static TaskAwaiter<int> GetAwaiter(this Func<int> function)\n        {\n            Task<int> task = new Task<int>(function);\n            task.Start();\n            return task.GetAwaiter();\n        }\n    }\n}\n\nnamespace AwaitExtensionUser\n{\n    using AwaitExtensionHolder; // Compliant - statement is needed for the custom await usage\n    class AwaitUser\n    {\n        async void AsyncMethodUsingAwaitExtension()\n        {\n            var result = await new Func<int>(() => 0);\n        }\n    }\n}\n\nnamespace LinqQuery1\n{\n    using System.Linq; // Compliant - statement is needed for query syntax\n    class Usage\n    {\n        public void DoQuery(List<string> myList)\n        {\n            var query = from item in myList select item.GetType();\n        }\n    }\n}\n\nnamespace LinqQuery2\n{\n    using global::System.Linq; // Compliant - statement is needed for query syntax\n    class Usage\n    {\n        public void DoQuery(List<string> myList)\n        {\n            var query = from item in myList select item.GetType();\n        }\n    }\n}\n\nnamespace LinqQuery3.System.Linq { }\n\nnamespace LinqQuery3\n{\n    using global::System.Linq;\n    class Usage\n    {\n        public void DoQuery(List<string> myList)\n        {\n            var query = from item in myList select item.GetType();\n        }\n    }\n}\n\nnamespace NoLinqQuery\n{\n    class UnusedLinqImport { }\n}\n\nnamespace System\n{\n    using Linq; // Compliant - statement is needed for query syntax\n    class Usage\n    {\n        public void DoQuery(List<string> myList)\n        {\n            var query = from item in myList select item.GetType();\n        }\n    }\n}\n\n// This test is for coverage, ensuring the rule does not crash if for some reason the using directive is not found when\n// a QueryExpressionSyntax is in the code\nnamespace LinqQueryWithoutUsing\n{\n    class Usage\n    {\n        public void DoQuery(List<string> myList)\n        {\n            var query = from item in myList select item.GetType(); // Error [CS1935] - Could not find an implementation of the query pattern for source type 'List<string>'.\n        }\n    }\n}\n\nnamespace CollectionInitializerExtensions1\n{\n    public static class ListExtensions\n    {\n        public static void Add(this List<string> list, string firstName, string lastName)\n        {\n            list.Add(firstName + \" \" + lastName);\n        }\n    }\n}\n\nnamespace CollectionInitializerExtensions2\n{\n    public static class ListExtensions\n    {\n        public static void Add(this List<string> list, string firstName, int number)\n        {\n            list.Add(firstName + \" nb\" + number);\n        }\n    }\n}\n\nnamespace CollectionInitializerExtensions3\n{\n    public static class ListExtensions\n    {\n        public static void Add(this List<string> list, int number, string lastName)\n        {\n            list.Add(number + \": \" + lastName);\n        }\n    }\n}\n\nnamespace CollectionInitializerUse\n{\n    using CollectionInitializerExtensions1;\n    using CollectionInitializerExtensions2;\n\n    internal static class Program\n    {\n        private static void Main(string[] args)\n        {\n            var list1 = new List<string>\n            {\n                { \"John\", \"Smith\" },\n                { \"John\", 2 },\n            };\n\n            var list2 = new List<string>\n            { };\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnnecessaryUsings.Fixed.cs",
    "content": "﻿using System;\nusing System.Runtime.CompilerServices;\nusing System.Threading.Tasks;\nusing System.IO;\nusing System.IO; // Error [CS0105] - compiler warning, duplicate using directive\nusing static System.Console;\nusing static System.DateTime; // FN - System.DateTime is not a namespace symbol\nusing MySysAlias = System;\nusing MyOtherAlias = System.Collections; // FN - aliases not yet supported\nusing MyNamespace1; // Compliant - used inside MyNamspace2 to access Ns1_1\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Reflection;\nusing System.Security.Cryptography;\nusing System.Collections.ObjectModel;\n\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n\nnamespace MyNamespace0\n{\n    class Ns0_0 { }\n}\n\nnamespace MyNamespace1\n{\n    class Ns1_0 { }\n}\n\nnamespace MyNamespace2\n{\n    class Ns2_0\n    {\n        Ns1_0 ns11;\n    }\n}\n\nnamespace MyNamespace2.Level1\n{\n    using MyNamespace0;\n    using MyNamespace0; // Error [CS0105] - compiler warning, duplicate using directive\n    using MyNamespace0; // Error [CS0105] - compiler warning, duplicate using directive\n    using MyNamespace1; // CS0105 does not fire here — duplicates file-level import, not a same-scope duplicate\n\n    class Ns2_1\n    {\n        Ns0_0 ns00;\n        Ns2_0 ns20;\n        Ns1_0 ns11;\n        Ns2_1 ns21;\n    }\n\n    namespace Level2\n    {\n        using MyNamespace1; // CS0105 does not fire here — duplicates file-level import, not a same-scope duplicate\n        using System.IO;    // CS0105 does not fire here — duplicates file-level import, not a same-scope duplicate\n\n        class Ns2_2\n        {\n            Ns1_0 ns11;\n\n            void M(IEnumerable<DateTimeStyles> myEnumerable)\n            {\n                File.ReadAllLines(\"\");\n                WriteLine(\"\");\n                MySysAlias.Console.WriteLine(\"\");\n            }\n        }\n    }\n}\n\nnamespace MyNamespace2.Level1.Level2\n{\n    using MyNamespace0;\n\n    class Ns2_3\n    {\n        Ns0_0 ns00;\n        Ns2_1 ns21;\n    }\n}\n\nnamespace MyNamespace3\n{\n    class Ns3_0 { }\n}\n\nnamespace ReferencesInsideDocumentationTags\n{\n    using System.ComponentModel;\n    using System.Collections.Specialized;\n\n    /// <summary> There is <see cref=\"Win32Exception\"/> or <see cref=\"ListDictionary\"/></summary>\n    class ClassWithDoc { }\n\n    class InnerClass\n    {\n        /// <exception cref=\"AesManaged\"></exception>\n        public void MethodWithDoc() { }\n\n        /// <summary>\n        ///   <seealso cref=\"ReadOnlyCollection{T}\"/>\n        /// </summary>\n        public void MethodWithGenericClassDoc() { }\n\n        /// This is just a comment\n        public void MethodWithoutXMLDoc() { }\n    }\n}\n\nnamespace AwaitExtensionHolder\n{\n\n    internal static class ExtensionHolder\n    {\n        public static TaskAwaiter<int> GetAwaiter(this Func<int> function)\n        {\n            Task<int> task = new Task<int>(function);\n            task.Start();\n            return task.GetAwaiter();\n        }\n    }\n}\n\nnamespace AwaitExtensionUser\n{\n    using AwaitExtensionHolder; // Compliant - statement is needed for the custom await usage\n    class AwaitUser\n    {\n        async void AsyncMethodUsingAwaitExtension()\n        {\n            var result = await new Func<int>(() => 0);\n        }\n    }\n}\n\nnamespace LinqQuery1\n{\n    using System.Linq; // Compliant - statement is needed for query syntax\n    class Usage\n    {\n        public void DoQuery(List<string> myList)\n        {\n            var query = from item in myList select item.GetType();\n        }\n    }\n}\n\nnamespace LinqQuery2\n{\n    using global::System.Linq; // Compliant - statement is needed for query syntax\n    class Usage\n    {\n        public void DoQuery(List<string> myList)\n        {\n            var query = from item in myList select item.GetType();\n        }\n    }\n}\n\nnamespace LinqQuery3.System.Linq { }\n\nnamespace LinqQuery3\n{\n    using global::System.Linq;\n    class Usage\n    {\n        public void DoQuery(List<string> myList)\n        {\n            var query = from item in myList select item.GetType();\n        }\n    }\n}\n\nnamespace NoLinqQuery\n{\n    class UnusedLinqImport { }\n}\n\nnamespace System\n{\n    using Linq; // Compliant - statement is needed for query syntax\n    class Usage\n    {\n        public void DoQuery(List<string> myList)\n        {\n            var query = from item in myList select item.GetType();\n        }\n    }\n}\n\n// This test is for coverage, ensuring the rule does not crash if for some reason the using directive is not found when\n// a QueryExpressionSyntax is in the code\nnamespace LinqQueryWithoutUsing\n{\n    class Usage\n    {\n        public void DoQuery(List<string> myList)\n        {\n            var query = from item in myList select item.GetType(); // Error [CS1935] - Could not find an implementation of the query pattern for source type 'List<string>'.\n        }\n    }\n}\n\nnamespace CollectionInitializerExtensions1\n{\n    public static class ListExtensions\n    {\n        public static void Add(this List<string> list, string firstName, string lastName)\n        {\n            list.Add(firstName + \" \" + lastName);\n        }\n    }\n}\n\nnamespace CollectionInitializerExtensions2\n{\n    public static class ListExtensions\n    {\n        public static void Add(this List<string> list, string firstName, int number)\n        {\n            list.Add(firstName + \" nb\" + number);\n        }\n    }\n}\n\nnamespace CollectionInitializerExtensions3\n{\n    public static class ListExtensions\n    {\n        public static void Add(this List<string> list, int number, string lastName)\n        {\n            list.Add(number + \": \" + lastName);\n        }\n    }\n}\n\nnamespace CollectionInitializerUse\n{\n    using CollectionInitializerExtensions1;\n    using CollectionInitializerExtensions2;\n\n    internal static class Program\n    {\n        private static void Main(string[] args)\n        {\n            var list1 = new List<string>\n            {\n                { \"John\", \"Smith\" },\n                { \"John\", 2 },\n            };\n\n            var list2 = new List<string>\n            { };\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnnecessaryUsings.InheritedPropertyBase.cs",
    "content": "﻿namespace ReproS3928.One\n{\n    public abstract class S1128Base\n    {\n        public int Id { get; set; }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnnecessaryUsings.InheritedPropertyChild.cs",
    "content": "﻿using ReproS3928.One;\n\nnamespace ReproS3928.Two\n{\n    public class S1128Child : S1128Base\n    {\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnnecessaryUsings.InheritedPropertyUsage.cs",
    "content": "﻿// https://github.com/SonarSource/sonar-dotnet/issues/7694\nusing ReproS3928.Two;\nusing ReproS3928.One; // FN - This is not needed\n\nnamespace ReproS3928\n{\n    public static class S1128\n    {\n        static void Method()\n        {\n            var _ = new S1128Child()\n            {\n                Id = 42 // Issue raise if this line is commented.\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnnecessaryUsings.TupleDeconstruct.NetCore.cs",
    "content": "﻿// https://github.com/SonarSource/sonar-dotnet/issues/3408\nnamespace Repro_3408\n{\n    namespace OuterVarConsumer\n    {\n        using System; // Compliant, it's needed for tuple deconstruction\n\n        public class Repro3408\n        {\n            public void Consumer()\n            {\n                var (_, y) = Provider.ServiceReturningTuples.GetPair();\n            }\n        }\n    }\n\n    namespace InnerVarConsumer\n    {\n        using System; // Compliant, it's needed for tuple deconstruction\n\n        public class Repro3408\n        {\n            public void Consumer()\n            {\n                (var a, var b) = Provider.ServiceReturningTuples.GetPair();\n            }\n        }\n    }\n\n    namespace Provider\n    {\n        using System;\n\n        public static class ServiceReturningTuples\n        {\n            public static Tuple<string, int> GetPair() => Tuple.Create(\"a\", 1);\n        }\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/3631\nnamespace Repro_3631\n{\n    using System.Collections.Generic;\n\n    namespace Tuple_OuterVarConsumer\n    {\n        using Extensions;   //Noncompliant FP, it's needed for tuple deconstruction\n\n        public class Repro\n        {\n            public void Go(System.Tuple<string, int> pair)\n            {\n                var (key, value) = pair;\n            }\n        }\n    }\n\n    namespace Tuple_InnerVarConsumer\n    {\n        using Extensions;   //Noncompliant FP, it's needed for tuple deconstruction\n\n        public class Repro\n        {\n            public void Go(System.Tuple<string, int> pair)\n            {\n                (var key, var value) = pair;\n            }\n        }\n    }\n\n    namespace KVP_OuterVarConsumer\n    {\n        using Extensions;   //Noncompliant True Positive, the Extensions.Deconstruct exist, but it's not used under .NET Core build. There's KeyValuePair<TKey, TValue).Deconstruct(out TKey key, out TValue value)\n\n        public class Repro\n        {\n            public void Go(KeyValuePair<string, int> pair)\n            {\n                var (key, value) = pair;\n            }\n        }\n    }\n\n    namespace KVP_InnerVarConsumer\n    {\n        using Extensions;   //Noncompliant True Positive, the Extensions.Deconstruct exist, but it's not used under .NET Core build. There's KeyValuePair<TKey, TValue).Deconstruct(out TKey key, out TValue value)\n\n        public class Repro\n        {\n            public void Go(KeyValuePair<string, int> pair)\n            {\n                (var key, var value) = pair;\n            }\n        }\n    }\n\n    namespace KVP_ForEach\n    {\n        using Extensions;   //Noncompliant True Positive, the Extensions.Deconstruct exist, but it's not used under .NET Core build. There's KeyValuePair<TKey, TValue).Deconstruct(out TKey key, out TValue value)\n\n        public class Repro\n        {\n            public void Go(Dictionary<string, int> dict)\n            {\n                foreach (var (key, value) in dict)\n                {\n                }\n            }\n        }\n    }\n\n    namespace Extensions\n    {\n        public static class DeconstructExtensions\n        {\n            public static void Deconstruct<TKey, TValue>(this System.Tuple<TKey, TValue> kvp, out TKey key, out TValue value)\n            {\n                key = kvp.Item1;\n                value = kvp.Item2;\n            }\n\n            public static void Deconstruct<TKey, TValue>(this KeyValuePair<TKey, TValue> kvp, out TKey key, out TValue value)\n            {\n                key = kvp.Key;\n                value = kvp.Value;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnnecessaryUsings.TupleDeconstruct.NetFx.cs",
    "content": "﻿// https://github.com/SonarSource/sonar-dotnet/issues/3408\nnamespace Repro_3408\n{\n    namespace OuterVarConsumer\n    {\n        using System; // Compliant, it's needed for tuple deconstruction\n\n        public class Repro3408\n        {\n            public void Consumer()\n            {\n                var (_, y) = Provider.ServiceReturningTuples.GetPair();\n            }\n        }\n    }\n\n    namespace InnerVarConsumer\n    {\n        using System; // Compliant, it's needed for tuple deconstruction\n\n        public class Repro3408\n        {\n            public void Consumer()\n            {\n                (var a, var b) = Provider.ServiceReturningTuples.GetPair();\n            }\n        }\n    }\n\n    namespace Provider\n    {\n        using System;\n\n        public static class ServiceReturningTuples\n        {\n            public static Tuple<string, int> GetPair() => Tuple.Create(\"a\", 1);\n        }\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/3631\nnamespace Repro_3631\n{\n    using System.Collections.Generic;\n\n    namespace Tuple_OuterVarConsumer\n    {\n        using Extensions;   //Noncompliant FP, it's needed for tuple deconstruction\n\n        public class Repro\n        {\n            public void Go(System.Tuple<string, int> pair)\n            {\n                var (key, value) = pair;\n            }\n        }\n    }\n\n    namespace Tuple_InnerVarConsumer\n    {\n        using Extensions;   //Noncompliant FP, it's needed for tuple deconstruction\n\n        public class Repro\n        {\n            public void Go(System.Tuple<string, int> pair)\n            {\n                (var key, var value) = pair;\n            }\n        }\n    }\n\n    namespace KVP_OuterVarConsumer\n    {\n        using Extensions;   //Noncompliant FP, it's needed for tuple deconstruction under .NET Framework\n\n        public class Repro\n        {\n            public void Go(KeyValuePair<string, int> pair)\n            {\n                var (key, value) = pair;\n            }\n        }\n    }\n\n    namespace KVP_InnerVarConsumer\n    {\n        using Extensions;   //Noncompliant FP, it's needed for tuple deconstruction under .NET Framework\n\n        public class Repro\n        {\n            public void Go(KeyValuePair<string, int> pair)\n            {\n                (var key, var value) = pair;\n            }\n        }\n    }\n\n    namespace KVP_ForEach\n    {\n        using Extensions; //Noncompliant FP, it's needed for tuple deconstruction under .NET Framework\n\n        public class Repro\n        {\n            public void Go(Dictionary<string, int> dict)\n            {\n                foreach (var (key, value) in dict)\n                {\n                }\n            }\n        }\n    }\n\n    namespace Extensions\n    {\n        public static class DeconstructExtensions\n        {\n            public static void Deconstruct<TKey, TValue>(this System.Tuple<TKey, TValue> kvp, out TKey key, out TValue value)\n            {\n                key = kvp.Item1;\n                value = kvp.Item2;\n            }\n\n            public static void Deconstruct<TKey, TValue>(this KeyValuePair<TKey, TValue> kvp, out TKey key, out TValue value)\n            {\n                key = kvp.Key;\n                value = kvp.Value;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnnecessaryUsings.cs",
    "content": "﻿using System;\nusing System.Runtime.CompilerServices;\nusing System.Threading.Tasks;\nusing System.Collections.Concurrent; // Noncompliant {{Remove this unnecessary 'using'.}}\nusing System.IO;\nusing System.IO; // Error [CS0105] - compiler warning, duplicate using directive\nusing static System.Console;\nusing static System.DateTime; // FN - System.DateTime is not a namespace symbol\nusing MySysAlias = System;\nusing MyOtherAlias = System.Collections; // FN - aliases not yet supported\nusing MyNamespace1; // Compliant - used inside MyNamspace2 to access Ns1_1\nusing MyNamespace3; // Noncompliant {{Remove this unnecessary 'using'.}}\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Reflection;\nusing System.Security.Cryptography;\nusing System.Collections.ObjectModel;\n\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n\nnamespace MyNamespace0\n{\n    class Ns0_0 { }\n}\n\nnamespace MyNamespace1\n{\n    class Ns1_0 { }\n}\n\nnamespace MyNamespace2\n{\n    class Ns2_0\n    {\n        Ns1_0 ns11;\n    }\n}\n\nnamespace MyNamespace2.Level1\n{\n    using MyNamespace0;\n    using MyNamespace0; // Error [CS0105] - compiler warning, duplicate using directive\n    using MyNamespace0; // Error [CS0105] - compiler warning, duplicate using directive\n    using MyNamespace1; // CS0105 does not fire here — duplicates file-level import, not a same-scope duplicate\n    using System.Linq; // Noncompliant {{Remove this unnecessary 'using'.}}\n    using MyNamespace2.Level1; // Noncompliant {{Remove this unnecessary 'using'.}}\n    using MyNamespace2; // Noncompliant {{Remove this unnecessary 'using'.}}\n\n    class Ns2_1\n    {\n        Ns0_0 ns00;\n        Ns2_0 ns20;\n        Ns1_0 ns11;\n        Ns2_1 ns21;\n    }\n\n    namespace Level2\n    {\n        using MyNamespace1; // CS0105 does not fire here — duplicates file-level import, not a same-scope duplicate\n        using System.IO;    // CS0105 does not fire here — duplicates file-level import, not a same-scope duplicate\n\n        class Ns2_2\n        {\n            Ns1_0 ns11;\n\n            void M(IEnumerable<DateTimeStyles> myEnumerable)\n            {\n                File.ReadAllLines(\"\");\n                WriteLine(\"\");\n                MySysAlias.Console.WriteLine(\"\");\n            }\n        }\n    }\n}\n\nnamespace MyNamespace2.Level1.Level2\n{\n    using MyNamespace0;\n    using MyNamespace2.Level1; // Noncompliant {{Remove this unnecessary 'using'.}}\n\n    class Ns2_3\n    {\n        Ns0_0 ns00;\n        Ns2_1 ns21;\n    }\n}\n\nnamespace MyNamespace3\n{\n    class Ns3_0 { }\n}\n\nnamespace ReferencesInsideDocumentationTags\n{\n    using System.ComponentModel;\n    using System.Collections.Specialized;\n\n    /// <summary> There is <see cref=\"Win32Exception\"/> or <see cref=\"ListDictionary\"/></summary>\n    class ClassWithDoc { }\n\n    class InnerClass\n    {\n        /// <exception cref=\"AesManaged\"></exception>\n        public void MethodWithDoc() { }\n\n        /// <summary>\n        ///   <seealso cref=\"ReadOnlyCollection{T}\"/>\n        /// </summary>\n        public void MethodWithGenericClassDoc() { }\n\n        /// This is just a comment\n        public void MethodWithoutXMLDoc() { }\n    }\n}\n\nnamespace AwaitExtensionHolder\n{\n\n    internal static class ExtensionHolder\n    {\n        public static TaskAwaiter<int> GetAwaiter(this Func<int> function)\n        {\n            Task<int> task = new Task<int>(function);\n            task.Start();\n            return task.GetAwaiter();\n        }\n    }\n}\n\nnamespace AwaitExtensionUser\n{\n    using AwaitExtensionHolder; // Compliant - statement is needed for the custom await usage\n    class AwaitUser\n    {\n        async void AsyncMethodUsingAwaitExtension()\n        {\n            var result = await new Func<int>(() => 0);\n        }\n    }\n}\n\nnamespace LinqQuery1\n{\n    using System.Linq; // Compliant - statement is needed for query syntax\n    class Usage\n    {\n        public void DoQuery(List<string> myList)\n        {\n            var query = from item in myList select item.GetType();\n        }\n    }\n}\n\nnamespace LinqQuery2\n{\n    using global::System.Linq; // Compliant - statement is needed for query syntax\n    class Usage\n    {\n        public void DoQuery(List<string> myList)\n        {\n            var query = from item in myList select item.GetType();\n        }\n    }\n}\n\nnamespace LinqQuery3.System.Linq { }\n\nnamespace LinqQuery3\n{\n    using System.Linq; // Noncompliant - This is 'LinqQuery3.System.Linq' whose import is indeed unnecessary\n    using global::System.Linq;\n    class Usage\n    {\n        public void DoQuery(List<string> myList)\n        {\n            var query = from item in myList select item.GetType();\n        }\n    }\n}\n\nnamespace NoLinqQuery\n{\n    using System.Linq; // Noncompliant\n    class UnusedLinqImport { }\n}\n\nnamespace System\n{\n    using Linq; // Compliant - statement is needed for query syntax\n    class Usage\n    {\n        public void DoQuery(List<string> myList)\n        {\n            var query = from item in myList select item.GetType();\n        }\n    }\n}\n\n// This test is for coverage, ensuring the rule does not crash if for some reason the using directive is not found when\n// a QueryExpressionSyntax is in the code\nnamespace LinqQueryWithoutUsing\n{\n    class Usage\n    {\n        public void DoQuery(List<string> myList)\n        {\n            var query = from item in myList select item.GetType(); // Error [CS1935] - Could not find an implementation of the query pattern for source type 'List<string>'.\n        }\n    }\n}\n\nnamespace CollectionInitializerExtensions1\n{\n    public static class ListExtensions\n    {\n        public static void Add(this List<string> list, string firstName, string lastName)\n        {\n            list.Add(firstName + \" \" + lastName);\n        }\n    }\n}\n\nnamespace CollectionInitializerExtensions2\n{\n    public static class ListExtensions\n    {\n        public static void Add(this List<string> list, string firstName, int number)\n        {\n            list.Add(firstName + \" nb\" + number);\n        }\n    }\n}\n\nnamespace CollectionInitializerExtensions3\n{\n    public static class ListExtensions\n    {\n        public static void Add(this List<string> list, int number, string lastName)\n        {\n            list.Add(number + \": \" + lastName);\n        }\n    }\n}\n\nnamespace CollectionInitializerUse\n{\n    using CollectionInitializerExtensions1;\n    using CollectionInitializerExtensions2;\n    using CollectionInitializerExtensions3; // Noncompliant - this extension is not used\n\n    internal static class Program\n    {\n        private static void Main(string[] args)\n        {\n            var list1 = new List<string>\n            {\n                { \"John\", \"Smith\" },\n                { \"John\", 2 },\n            };\n\n            var list2 = new List<string>\n            { };\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnnecessaryUsings2.cs",
    "content": "﻿using System;\nusing System.Runtime.CompilerServices;\nusing System.Threading.Tasks;\nusing System.Collections.Concurrent; // Noncompliant {{Remove this unnecessary 'using'.}}\nusing System.IO;\nusing System.IO; // Error [CS0105] - compiler warning, duplicate using directive\nusing static System.Console;\nusing static System.DateTime; // FN - System.DateTime is not a namespace symbol\nusing MySysAlias = System;\nusing MyOtherAlias = System.Collections; // FN - aliases not yet supported\nusing AppendedNamespaceForConcurrencyTest.MyNamespace1; // Compliant - used inside MyNamspace2 to access Ns1_1\nusing AppendedNamespaceForConcurrencyTest.MyNamespace3; // Noncompliant {{Remove this unnecessary 'using'.}}\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Security.Cryptography;\nusing System.Collections.ObjectModel;\n\nnamespace AppendedNamespaceForConcurrencyTest.MyNamespace0\n{\n    class Ns0_0 { }\n}\n\nnamespace AppendedNamespaceForConcurrencyTest.MyNamespace1\n{\n    class Ns1_0 { }\n}\n\nnamespace AppendedNamespaceForConcurrencyTest.MyNamespace2\n{\n    class Ns2_0\n    {\n        Ns1_0 ns11;\n    }\n}\n\nnamespace AppendedNamespaceForConcurrencyTest.MyNamespace2.Level1\n{\n    using MyNamespace0;\n    using MyNamespace0; // Error [CS0105] - compiler warning, duplicate using directive\n    using MyNamespace0; // Error [CS0105] - compiler warning, duplicate using directive\n    using MyNamespace1; // CS0105 does not fire here — duplicates file-level import, not a same-scope duplicate\n    using System.Linq; // Noncompliant {{Remove this unnecessary 'using'.}}\n    using MyNamespace2.Level1; // Noncompliant {{Remove this unnecessary 'using'.}}\n    using MyNamespace2; // Noncompliant {{Remove this unnecessary 'using'.}}\n\n    class Ns2_1\n    {\n        Ns0_0 ns00;\n        Ns2_0 ns20;\n        Ns1_0 ns11;\n        Ns2_1 ns21;\n    }\n\n    namespace Level2\n    {\n        using MyNamespace1; // CS0105 does not fire here — duplicates file-level import, not a same-scope duplicate\n        using System.IO;    // CS0105 does not fire here — duplicates file-level import, not a same-scope duplicate\n\n        class Ns2_2\n        {\n            Ns1_0 ns11;\n\n            void M(IEnumerable<DateTimeStyles> myEnumerable)\n            {\n                File.ReadAllLines(\"\");\n                WriteLine(\"\");\n                MySysAlias.Console.WriteLine(\"\");\n            }\n        }\n    }\n}\n\nnamespace AppendedNamespaceForConcurrencyTest.MyNamespace2.Level1.Level2\n{\n    using MyNamespace0;\n    using MyNamespace2.Level1; // Noncompliant {{Remove this unnecessary 'using'.}}\n\n    class Ns2_3\n    {\n        Ns0_0 ns00;\n        Ns2_1 ns21;\n    }\n}\n\nnamespace AppendedNamespaceForConcurrencyTest.MyNamespace3\n{\n    class Ns3_0 { }\n}\n\nnamespace AppendedNamespaceForConcurrencyTest.ReferencesInsideDocumentationTags\n{\n    using System.ComponentModel;\n    using System.Collections.Specialized;\n\n    /// <summary> There is <see cref=\"Win32Exception\"/> or <see cref=\"ListDictionary\"/></summary>\n    class ClassWithDoc { }\n\n    class InnerClass\n    {\n        /// <exception cref=\"AesManaged\"></exception>\n        public void MethodWithDoc() { }\n\n        /// <summary>\n        ///   <seealso cref=\"ReadOnlyCollection{T}\"/>\n        /// </summary>\n        public void MethodWithGenericClassDoc() { }\n\n        /// This is just a comment\n        public void MethodWithoutXMLDoc() { }\n    }\n}\n\nnamespace AppendedNamespaceForConcurrencyTest.AwaitExtensionHolder\n{\n\n    internal static class ExtensionHolder\n    {\n        public static TaskAwaiter<int> GetAwaiter(this Func<int> function)\n        {\n            Task<int> task = new Task<int>(function);\n            task.Start();\n            return task.GetAwaiter();\n        }\n    }\n}\n\nnamespace AppendedNamespaceForConcurrencyTest.AwaitExtensionUser\n{\n    using AwaitExtensionHolder; // Compliant - statement is needed for the custom await usage\n    class AwaitUser\n    {\n        async void AsyncMethodUsingAwaitExtension()\n        {\n            var result = await new Func<int>(() => 0);\n        }\n    }\n}\n\nnamespace AppendedNamespaceForConcurrencyTest.LinqQuery1\n{\n    using System.Linq; // Compliant - statement is needed for query syntax\n    class Usage\n    {\n        public void DoQuery(List<string> myList)\n        {\n            var query = from item in myList select item.GetType();\n        }\n    }\n}\n\nnamespace AppendedNamespaceForConcurrencyTest.LinqQuery2\n{\n    using global::System.Linq; // Compliant - statement is needed for query syntax\n    class Usage\n    {\n        public void DoQuery(List<string> myList)\n        {\n            var query = from item in myList select item.GetType();\n        }\n    }\n}\n\nnamespace AppendedNamespaceForConcurrencyTest.LinqQuery3.System.Linq { }\n\nnamespace AppendedNamespaceForConcurrencyTest.LinqQuery3\n{\n    using System.Linq; // Noncompliant - This is 'LinqQuery3.System.Linq' whose import is indeed unnecessary\n    using global::System.Linq;\n    class Usage\n    {\n        public void DoQuery(List<string> myList)\n        {\n            var query = from item in myList select item.GetType();\n        }\n    }\n}\n\nnamespace AppendedNamespaceForConcurrencyTest.NoLinqQuery\n{\n    using System.Linq; // Noncompliant\n    class UnusedLinqImport { }\n}\n\n// This test is for coverage, ensuring the rule does not crash if for some reason the using directive is not found when\n// a QueryExpressionSyntax is in the code\nnamespace AppendedNamespaceForConcurrencyTest.LinqQueryWithoutUsing\n{\n    class Usage\n    {\n        public void DoQuery(List<string> myList)\n        {\n            var query = from item in myList select item.GetType(); // Error [CS1935] - Could not find an implementation of the query pattern for source type 'List<string>'.\n        }\n    }\n}\n\nnamespace AppendedNamespaceForConcurrencyTest.CollectionInitializerExtensions1\n{\n    public static class ListExtensions\n    {\n        public static void Add(this List<string> list, string firstName, string lastName)\n        {\n            list.Add(firstName + \" \" + lastName);\n        }\n    }\n}\n\nnamespace AppendedNamespaceForConcurrencyTest.CollectionInitializerExtensions2\n{\n    public static class ListExtensions\n    {\n        public static void Add(this List<string> list, string firstName, int number)\n        {\n            list.Add(firstName + \" nb\" + number);\n        }\n    }\n}\n\nnamespace AppendedNamespaceForConcurrencyTest.CollectionInitializerExtensions3\n{\n    public static class ListExtensions\n    {\n        public static void Add(this List<string> list, int number, string lastName)\n        {\n            list.Add(number + \": \" + lastName);\n        }\n    }\n}\n\nnamespace AppendedNamespaceForConcurrencyTest.CollectionInitializerUse\n{\n    using CollectionInitializerExtensions1;\n    using CollectionInitializerExtensions2;\n    using CollectionInitializerExtensions3; // Noncompliant - this extension is not used\n\n    internal static class Program\n    {\n        private static void Main2(string[] args)\n        {\n            var list1 = new List<string>\n            {\n                { \"John\", \"Smith\" },\n                { \"John\", 2 },\n            };\n\n            var list2 = new List<string>\n            { };\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnnecessaryUsingsFNRepro.cs",
    "content": "﻿using System; // FN - Using System is not needed for built in types (In this case int)\n\nnamespace Repro\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            var number = 42;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnsignedTypesUsage.vb",
    "content": "﻿Imports System\n\nModule Module1\n    Sub Main()\n        Dim foo1 As UShort   ' Noncompliant {{Change this unsigned type to 'Short'.}}\n'                   ^^^^^^\n        Dim foo2 As UInteger ' Noncompliant {{Change this unsigned type to 'Integer'.}}\n        Dim foo3 As ULong    ' Noncompliant {{Change this unsigned type to 'Long'.}}\n        Dim foo4 As System.UInt64 ' Noncompliant\n'                   ^^^^^^^^^^^^^\n        Dim foo5 As UInt64 ' Noncompliant\n        Dim foo6 As UInt64() ' Noncompliant\n'                   ^^^^^^\n        Dim foo7 As UInt64? ' Noncompliant\n'                   ^^^^^^\n        Dim foo8 As Nullable(Of UInt64) ' Noncompliant\n'                               ^^^^^^\n    End Sub\n\n    Sub Main2()\n        Dim foo1 As Short\n        Dim foo2 As Integer\n        Dim foo3 As Long\n        Dim foo4 As System.Int64\n        Dim foo5 As Int64\n        Dim foo6 As Int64()\n        Dim foo7 As Int64?\n        Dim foo8 As Nullable(Of Int64)\n    End Sub\nEnd Module\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnusedPrivateMember.CalledFromGenerated.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public partial class MyClass\n    {\n        private void PrivateMethodOnlyCalledFromGenerated()\n        {\n        }\n\n        internal void InternalMethodOnlyCalledFromGenerated()\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnusedPrivateMember.Fixed.Batch.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\nusing System.Runtime.Serialization;\nusing System.Threading.Tasks;\n\npublic class MyAttribute : Attribute { }\n\nclass UnusedPrivateMember\n{\n    public static void Main() { }\n\n    private class MyOtherClass\n    { }\n\n    private class MyClass\n    {\n        internal MyClass(int i)\n        {\n            var x = (MyOtherClass)null;\n            x = x as MyOtherClass;\n            Console.WriteLine();\n        }\n    }\n\n    private class Gen<T> : MyClass\n    {\n        public Gen() : base(1)\n        {\n            Console.WriteLine();\n        }\n    }\n\n    public UnusedPrivateMember()\n    {\n        MyProperty = 5;\n        MyEvent += UnusedPrivateMember_MyEvent;\n        MyUsedEvent += UnusedPrivateMember_MyUsedEvent;\n        new Gen<int>();\n    }\n\n    private void UnusedPrivateMember_MyUsedEvent(object sender, EventArgs e)\n    {\n        throw new NotImplementedException();\n    }\n\n    private void UnusedPrivateMember_MyEvent()\n    {\n        field3 = 5;\n        throw new NotImplementedException();\n    }\n    private\n        int field3; // Fixed\n    private delegate void Delegate();\n    private event Delegate MyEvent; //Fixed\n    private int[][] array = new int[0][];\n    private Dictionary<int, int> used = new Dictionary<int, int>();\n\n    [MyAttribute] void PrivateMethodWithAttribute() { } // Compliant: due to the attribute\n\n    public int GetValue(int x, int y) => array[x][y];\n\n    public int GetItem(int i) => used[i];\n\n    private Dictionary<int, int> GetDictionary() => null;\n\n    public int GetDictionaryItem(int i) => GetDictionary()[i];\n\n    private event EventHandler<EventArgs> MyUsedEvent\n    {\n        add { }\n        remove { }\n    }\n\n    private int MyProperty\n    {\n        get;\n        set;\n    }\n\n    [My]\n    private class Class1 { }\n\n    private class Class2\n    {\n        private Class2() // Compliant\n        {\n        }\n        private Class2(string i)\n        {\n        }\n        public int field2; // Fixed\n    }\n\n    private interface MyInterface\n    {\n        void Method();\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/6699\n    public void MethodUsingLocalMethod()\n    {\n        LocalMethod();\n\n        void LocalMethod()\n        {\n        }\n    }\n}\n\nclass NewClass1\n{\n    // See https://github.com/SonarSource/sonar-dotnet/issues/888\n    static async Task Main() // Compliant - valid main method since C# 7.1\n    {\n        Console.WriteLine(\"Test\");\n    }\n}\n\nclass NewClass2\n{\n    static async Task<int> Main() // Compliant - valid main method since C# 7.1\n    {\n        Console.WriteLine(\"Test\");\n\n        return 1;\n    }\n}\n\nclass NewClass3\n{\n    static async Task Main(string[] args) // Compliant - valid main method since C# 7.1\n    {\n        Console.WriteLine(\"Test\");\n    }\n}\n\nclass NewClass4\n{\n    static async Task<int> Main(string[] args) // Compliant - valid main method since C# 7.1\n    {\n        Console.WriteLine(\"Test\");\n\n        return 1;\n    }\n}\n\nclass NewClass5\n{\n}\n\npublic static class MyExtension\n{\n    private static void MyMethod<T>(this T self) { \"\".MyMethod<string>(); }\n}\n\npublic class NonExactMatch\n{\n    private static void M(int i) { }    // Compliant, might be called\n    private static void M(string i) { } // Compliant, might be called\n\n    public static void Call(dynamic d)\n    {\n        M(d);\n    }\n}\n\npublic class EventHandlerSample\n{\n    private void MyOnClick(object sender, EventArgs args) { } // Compliant\n}\n\npublic partial class EventHandlerSample1\n{\n    private void MyOnClick(object sender, EventArgs args) { } // Compliant, event handlers in partial classes are not reported\n}\n\npublic class PropertyAccess\n{\n    private int OnlyRead { get; }                                              // Fixed\n    private int OnlySet { get; set; }\n    private int OnlySet2 { set { } }                             // Fixed\n    public int PrivateGetter { set; }                                  // Fixed\n    public int PrivateSetter { get; }                                  // Fixed\n    private int ExpressionBodiedProperty5 { set => _ = value; }           // Fixed\n    private int ExpressionBodiedProperty6 { get => 1; }           // Fixed\n    public int ExpressionBodiedProperty7 { set => _ = value; }    // Fixed\n    public int ExpressionBodiedProperty8 { get => 1; }    // Fixed\n\n    private int BothAccessed { get; set; }\n\n    private int OnlyGet { get { return 42; } }\n\n    public void M()\n    {\n        Console.WriteLine(OnlyRead);\n        OnlySet = 42;\n        (this.OnlySet2) = 42;\n\n        BothAccessed++;\n\n        int? x = 10;\n        x = this?.OnlyGet;\n\n        ExpressionBodiedProperty5 = 0;\n        Console.WriteLine(ExpressionBodiedProperty6);\n    }\n}\n\npublic class Indexer1\n{\n}\n\npublic class Indexer2\n{\n}\n\npublic class Indexer3\n{\n}\n\npublic class Indexer4\n{\n}\n\npublic class Indexer5\n{\n    private int this[int i] { get { return 1; } }    // Fixed\n\n    public void Method()\n    {\n        Console.WriteLine(this[0]);\n    }\n}\n\npublic class Indexer6\n{\n    private int this[int i] { set { _ = value; } }    // Fixed\n\n    public void Method()\n    {\n        this[0] = 42;\n    }\n}\n\n[Serializable]\npublic sealed class GoodException : Exception\n{\n    public GoodException()\n    {\n    }\n    public GoodException(string message)\n        : base(message)\n    {\n    }\n    public GoodException(string message, Exception innerException)\n        : base(message, innerException)\n    {\n    }\n    private GoodException(SerializationInfo info, StreamingContext context) // Compliant because of the serialization\n        : base(info, context)\n    {\n    }\n}\n\npublic class FieldAccess\n{\n    private object field1;\n    private object field2; // Fixed\n    private object field3;\n\n    public FieldAccess()\n    {\n        this.field2 = field3 ?? this.field1?.ToString();\n    }\n}\n\n// As S4487 will raise when a private field is written and not read, S1450 won't raise on these cases\n// These tests where finding issues before with S1450 and should find them with S4487 now\npublic class TestsFormerS1450\n{\n    private int F1 = 0; // Fixed\n\n    public void M1()\n    {\n        ((F1)) = 42;\n    }\n\n    private int F5 = 0; // Fixed\n    private int F6; // Fixed\n    public void M2()\n    {\n        F5 = 42;\n        F6 = 42;\n    }\n\n    private int F14 = 0; // Fixed\n    public void M6(int F14)\n    {\n        this.F14 = 42;\n    }\n    private int F28 = 42; // Fixed\n    public event EventHandler E1\n    {\n        add\n        {\n            F28 = 42;\n        }\n        remove\n        {\n        }\n    }\n\n    private int F36; // Fixed\n    public void M15(int i) => F36 = i + 1;\n}\n\npublic class OutAndRef\n{\n    private int F37; // Fixed\n    public void M37() => int.TryParse(\"1\", out F37);\n\n    private int F38;\n    public void M38() => Modify(ref F38);\n\n    public void Modify(ref int x) => x = 37;\n    public void M39()\n    {\n        int.TryParse(\"1\", out var x);\n        int.TryParse(\"1\", out var F39);\n    }\n}\n\ninternal class MyClass\n{\n    protected MyClass() // Compliant\n    {\n        var a = 1;\n    }\n}\n\ninternal class MyClass2\n{\n}\n\npublic interface IPublicInterface { }\n[Serializable]\npublic sealed class PublicClass : IPublicInterface\n{\n    public static readonly PublicClass Instance = new PublicClass();\n\n    private PublicClass()\n    {\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/8342\nclass Repro_8342\n{\n    [Private1] public void APublicMethod() => APrivateMethodCalledByAPublicMethod();\n    [Private2] internal void AnInternalMethod() { }\n    [Private3] protected void AProtectedMethod() { }\n    [Private4] private void APrivateMethodCalledByAPublicMethod() { }\n\n    private class Private1Attribute : Attribute { }\n    private class Private2Attribute : Attribute { }\n    private class Private3Attribute : Attribute { }\n    private class Private4Attribute : Attribute { }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/8532\n[Serializable]\npublic class Repro_8532\n{\n    private string serializedField;                             // Compliant\n    private string serializedReadWriteProperty { get; set; }    // Compliant\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/9219\nclass Repro_9219\n{\n    [MyAttribute]\n    public bool AttributeOnProperty\n    {\n        get;\n        private set; // Compliant\n    }\n\n    public bool AttributeOnPropertyGetter\n    {\n        [MyAttribute]\n        private get; // Compliant\n        set;\n    }\n\n    public bool AttributeOnPropertySetter\n    {\n        get;\n        [MyAttribute]\n        private set; // Compliant\n    }\n\n    public bool AttributeOnPropertyNoncompliant\n    {\n        [MyAttribute]\n        get;\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/9432\nnamespace Repro_9432\n{\n    partial class OuterClass\n    {\n        public void MethodUsesNestedStruct()\n        {\n            NestedClass.NestedStruct x;\n        }\n\n        private static class NestedClass\n        {\n            // https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.structlayoutattribute\n            [StructLayout(LayoutKind.Sequential)]\n            internal struct NestedStruct\n            {\n                public int Field;                       // Compliant: the unused field can be used to control the physical layout of struct in the memory\n            }\n        }\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/6990\nnamespace Repro_6990\n{\n    public class ChildEventArgs : EventArgs\n    {\n        // Some properties\n    }\n\n    public class InheritedEvent : EventArgs\n    {\n        // Some properties\n    }\n\n    public class SenderObject\n    {\n        // Some things\n    }\n\n    public class Consumer\n    {\n        static void SenderObject_WithChildEvent(SenderObject senderObject, ChildEventArgs e) // Compliant\n        {\n            // Logic\n        }\n\n        static void SenderObject_WithChildEvent(SenderObject senderObject, InheritedEvent e) // Compliant\n        {\n            // Logic\n        }\n\n        static void Comsumer_WithChildEvent(object sender, ChildEventArgs e) // Compliant\n        {\n            // Logic\n        }\n    }\n\n    public class CollectionInitializerUsage\n    {\n        private Compliant items = new Compliant { 1, 2, 3 };\n        private AlsoCompliant also => new AlsoCompliant { 1, 2, 3 };\n        private NonCompliant others = new NonCompliant();\n        private CompliantDictionary dict = new CompliantDictionary { { 1, 1 }, { 2, 2 } };\n        private NonCompliantDictionary otherDict = new NonCompliantDictionary() // This initializer uses the indexer setter and not the Add method.\n        {\n            [1] = 1,\n            [2] = 2\n        };\n\n        private class Compliant : IEnumerable\n        {\n            internal void Add(int item) { } // Compliant, called by collection initializer above\n            public IEnumerator GetEnumerator() => null;\n        }\n\n        private class AlsoCompliant : Compliant\n        {\n            internal void Add(int item) { } // Compliant, called by collection initializer above\n        }\n\n        private class NonCompliant : IEnumerable\n        {\n            public IEnumerator GetEnumerator() => null;\n        }\n\n        private class CompliantDictionary : Dictionary<int, int>\n        {\n            internal void Add(int key, int value) { } // Compliant, called by collection initializer above\n        }\n\n        private class NonCompliantDictionary : Dictionary<int, int>\n        {\n        }\n\n        public void UseFields()\n        {\n            var x = items;\n            var y = also;\n            var z = others;\n            var q = dict;\n            var w = otherDict;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnusedPrivateMember.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\nusing System.Runtime.Serialization;\nusing System.Threading.Tasks;\n\npublic class MyAttribute : Attribute { }\n\nclass UnusedPrivateMember\n{\n    public static void Main() { }\n\n    private class MyOtherClass\n    { }\n\n    private class MyClass\n    {\n        internal MyClass(int i)\n        {\n            var x = (MyOtherClass)null;\n            x = x as MyOtherClass;\n            Console.WriteLine();\n        }\n    }\n\n    private class Gen<T> : MyClass\n    {\n        public Gen() : base(1)\n        {\n            Console.WriteLine();\n        }\n    }\n\n    public UnusedPrivateMember()\n    {\n        MyProperty = 5;\n        MyEvent += UnusedPrivateMember_MyEvent;\n        MyUsedEvent += UnusedPrivateMember_MyUsedEvent;\n        new Gen<int>();\n    }\n\n    private void UnusedPrivateMember_MyUsedEvent(object sender, EventArgs e)\n    {\n        throw new NotImplementedException();\n    }\n\n    private void UnusedPrivateMember_MyEvent()\n    {\n        field3 = 5;\n        throw new NotImplementedException();\n    }\n    private\n        int field3; // Fixed\n    private delegate void Delegate();\n    private event Delegate MyEvent; //Fixed\n    private int[][] array = new int[0][];\n    private Dictionary<int, int> used = new Dictionary<int, int>();\n\n    [MyAttribute] void PrivateMethodWithAttribute() { } // Compliant: due to the attribute\n\n    public int GetValue(int x, int y) => array[x][y];\n\n    public int GetItem(int i) => used[i];\n\n    private Dictionary<int, int> GetDictionary() => null;\n\n    public int GetDictionaryItem(int i) => GetDictionary()[i];\n\n    private event EventHandler<EventArgs> MyUsedEvent\n    {\n        add { }\n        remove { }\n    }\n\n    private int MyProperty\n    {\n        get;\n        set;\n    }\n\n    [My]\n    private class Class1 { }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/6699\n    public void MethodUsingLocalMethod()\n    {\n        LocalMethod();\n\n        void LocalMethod()\n        {\n        }\n    }\n}\n\nclass NewClass1\n{\n    // See https://github.com/SonarSource/sonar-dotnet/issues/888\n    static async Task Main() // Compliant - valid main method since C# 7.1\n    {\n        Console.WriteLine(\"Test\");\n    }\n}\n\nclass NewClass2\n{\n    static async Task<int> Main() // Compliant - valid main method since C# 7.1\n    {\n        Console.WriteLine(\"Test\");\n\n        return 1;\n    }\n}\n\nclass NewClass3\n{\n    static async Task Main(string[] args) // Compliant - valid main method since C# 7.1\n    {\n        Console.WriteLine(\"Test\");\n    }\n}\n\nclass NewClass4\n{\n    static async Task<int> Main(string[] args) // Compliant - valid main method since C# 7.1\n    {\n        Console.WriteLine(\"Test\");\n\n        return 1;\n    }\n}\n\nclass NewClass5\n{\n}\n\npublic static class MyExtension\n{\n    private static void MyMethod<T>(this T self) { \"\".MyMethod<string>(); }\n}\n\npublic class NonExactMatch\n{\n    private static void M(int i) { }    // Compliant, might be called\n    private static void M(string i) { } // Compliant, might be called\n\n    public static void Call(dynamic d)\n    {\n        M(d);\n    }\n}\n\npublic class EventHandlerSample\n{\n    private void MyOnClick(object sender, EventArgs args) { } // Compliant\n}\n\npublic partial class EventHandlerSample1\n{\n    private void MyOnClick(object sender, EventArgs args) { } // Compliant, event handlers in partial classes are not reported\n}\n\npublic class PropertyAccess\n{\n    private int OnlyRead { get; }                                              // Fixed\n    private int OnlySet { get; set; }\n    private int OnlySet2 { set { } }                             // Fixed\n    public int PrivateGetter { set; }                                  // Fixed\n    public int PrivateSetter { get; }                                  // Fixed\n    private int ExpressionBodiedProperty5 { set => _ = value; }           // Fixed\n    private int ExpressionBodiedProperty6 { get => 1; }           // Fixed\n    public int ExpressionBodiedProperty7 { set => _ = value; }    // Fixed\n    public int ExpressionBodiedProperty8 { get => 1; }    // Fixed\n\n    private int BothAccessed { get; set; }\n\n    private int OnlyGet { get { return 42; } }\n\n    public void M()\n    {\n        Console.WriteLine(OnlyRead);\n        OnlySet = 42;\n        (this.OnlySet2) = 42;\n\n        BothAccessed++;\n\n        int? x = 10;\n        x = this?.OnlyGet;\n\n        ExpressionBodiedProperty5 = 0;\n        Console.WriteLine(ExpressionBodiedProperty6);\n    }\n}\n\npublic class Indexer1\n{\n}\n\npublic class Indexer2\n{\n}\n\npublic class Indexer3\n{\n}\n\npublic class Indexer4\n{\n}\n\npublic class Indexer5\n{\n    private int this[int i] { get { return 1; } }    // Fixed\n\n    public void Method()\n    {\n        Console.WriteLine(this[0]);\n    }\n}\n\npublic class Indexer6\n{\n    private int this[int i] { set { _ = value; } }    // Fixed\n\n    public void Method()\n    {\n        this[0] = 42;\n    }\n}\n\n[Serializable]\npublic sealed class GoodException : Exception\n{\n    public GoodException()\n    {\n    }\n    public GoodException(string message)\n        : base(message)\n    {\n    }\n    public GoodException(string message, Exception innerException)\n        : base(message, innerException)\n    {\n    }\n    private GoodException(SerializationInfo info, StreamingContext context) // Compliant because of the serialization\n        : base(info, context)\n    {\n    }\n}\n\npublic class FieldAccess\n{\n    private object field1;\n    private object field2; // Fixed\n    private object field3;\n\n    public FieldAccess()\n    {\n        this.field2 = field3 ?? this.field1?.ToString();\n    }\n}\n\n// As S4487 will raise when a private field is written and not read, S1450 won't raise on these cases\n// These tests where finding issues before with S1450 and should find them with S4487 now\npublic class TestsFormerS1450\n{\n    private int F1 = 0; // Fixed\n\n    public void M1()\n    {\n        ((F1)) = 42;\n    }\n\n    private int F5 = 0; // Fixed\n    private int F6; // Fixed\n    public void M2()\n    {\n        F5 = 42;\n        F6 = 42;\n    }\n\n    private int F14 = 0; // Fixed\n    public void M6(int F14)\n    {\n        this.F14 = 42;\n    }\n    private int F28 = 42; // Fixed\n    public event EventHandler E1\n    {\n        add\n        {\n            F28 = 42;\n        }\n        remove\n        {\n        }\n    }\n\n    private int F36; // Fixed\n    public void M15(int i) => F36 = i + 1;\n}\n\npublic class OutAndRef\n{\n    private int F37; // Fixed\n    public void M37() => int.TryParse(\"1\", out F37);\n\n    private int F38;\n    public void M38() => Modify(ref F38);\n\n    public void Modify(ref int x) => x = 37;\n    public void M39()\n    {\n        int.TryParse(\"1\", out var x);\n        int.TryParse(\"1\", out var F39);\n    }\n}\n\ninternal class MyClass\n{\n    protected MyClass() // Compliant\n    {\n        var a = 1;\n    }\n}\n\ninternal class MyClass2\n{\n}\n\npublic interface IPublicInterface { }\n[Serializable]\npublic sealed class PublicClass : IPublicInterface\n{\n    public static readonly PublicClass Instance = new PublicClass();\n\n    private PublicClass()\n    {\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/8342\nclass Repro_8342\n{\n    [Private1] public void APublicMethod() => APrivateMethodCalledByAPublicMethod();\n    [Private2] internal void AnInternalMethod() { }\n    [Private3] protected void AProtectedMethod() { }\n    [Private4] private void APrivateMethodCalledByAPublicMethod() { }\n\n    private class Private1Attribute : Attribute { }\n    private class Private2Attribute : Attribute { }\n    private class Private3Attribute : Attribute { }\n    private class Private4Attribute : Attribute { }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/8532\n[Serializable]\npublic class Repro_8532\n{\n    private string serializedField;                             // Compliant\n    private string serializedReadWriteProperty { get; set; }    // Compliant\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/9219\nclass Repro_9219\n{\n    [MyAttribute]\n    public bool AttributeOnProperty\n    {\n        get;\n        private set; // Compliant\n    }\n\n    public bool AttributeOnPropertyGetter\n    {\n        [MyAttribute]\n        private get; // Compliant\n        set;\n    }\n\n    public bool AttributeOnPropertySetter\n    {\n        get;\n        [MyAttribute]\n        private set; // Compliant\n    }\n\n    public bool AttributeOnPropertyNoncompliant\n    {\n        [MyAttribute]\n        get;\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/9432\nnamespace Repro_9432\n{\n    partial class OuterClass\n    {\n        public void MethodUsesNestedStruct()\n        {\n            NestedClass.NestedStruct x;\n        }\n\n        private static class NestedClass\n        {\n            // https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.structlayoutattribute\n            [StructLayout(LayoutKind.Sequential)]\n            internal struct NestedStruct\n            {\n                public int Field;                       // Compliant: the unused field can be used to control the physical layout of struct in the memory\n            }\n        }\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/6990\nnamespace Repro_6990\n{\n    public class ChildEventArgs : EventArgs\n    {\n        // Some properties\n    }\n\n    public class InheritedEvent : EventArgs\n    {\n        // Some properties\n    }\n\n    public class SenderObject\n    {\n        // Some things\n    }\n\n    public class Consumer\n    {\n        static void SenderObject_WithChildEvent(SenderObject senderObject, ChildEventArgs e) // Compliant\n        {\n            // Logic\n        }\n\n        static void SenderObject_WithChildEvent(SenderObject senderObject, InheritedEvent e) // Compliant\n        {\n            // Logic\n        }\n\n        static void Comsumer_WithChildEvent(object sender, ChildEventArgs e) // Compliant\n        {\n            // Logic\n        }\n    }\n\n    public class CollectionInitializerUsage\n    {\n        private Compliant items = new Compliant { 1, 2, 3 };\n        private AlsoCompliant also => new AlsoCompliant { 1, 2, 3 };\n        private NonCompliant others = new NonCompliant();\n        private CompliantDictionary dict = new CompliantDictionary { { 1, 1 }, { 2, 2 } };\n        private NonCompliantDictionary otherDict = new NonCompliantDictionary() // This initializer uses the indexer setter and not the Add method.\n        {\n            [1] = 1,\n            [2] = 2\n        };\n\n        private class Compliant : IEnumerable\n        {\n            internal void Add(int item) { } // Compliant, called by collection initializer above\n            public IEnumerator GetEnumerator() => null;\n        }\n\n        private class AlsoCompliant : Compliant\n        {\n            internal void Add(int item) { } // Compliant, called by collection initializer above\n        }\n\n        private class NonCompliant : IEnumerable\n        {\n            public IEnumerator GetEnumerator() => null;\n        }\n\n        private class CompliantDictionary : Dictionary<int, int>\n        {\n            internal void Add(int key, int value) { } // Compliant, called by collection initializer above\n        }\n\n        private class NonCompliantDictionary : Dictionary<int, int>\n        {\n        }\n\n        public void UseFields()\n        {\n            var x = items;\n            var y = also;\n            var z = others;\n            var q = dict;\n            var w = otherDict;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnusedPrivateMember.Generated.cs",
    "content": "﻿// <AUTO-GENERATED>\nusing System;\n\nnamespace Tests.Diagnostics\n{\n    public partial class MyClass\n    {\n        public void Foo()\n        {\n            PrivateMethodOnlyCalledFromGenerated();\n            InternalMethodOnlyCalledFromGenerated();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnusedPrivateMember.Latest.Partial.cs",
    "content": "﻿using System;\n\nnamespace CSharp9\n{\n    public partial class PartialMethods\n    {\n        partial void UnusedMethod(); // Noncompliant\n\n    }\n}\n\nnamespace CSharp13\n{\n    public partial class PartialProperty\n    {\n        partial int PartialProp { get => 42; } // Noncompliant\n    }\n}\n\npublic partial class PartialEvents\n{\n    private partial event EventHandler Compliant { add { compliant += value; } remove { compliant -= value; } } // Compliant https://sonarsource.atlassian.net/browse/NET-2825\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnusedPrivateMember.Latest.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.Text;\nusing System.Collections.Generic;\nusing System.Runtime.Serialization;\nusing System.Threading.Tasks;\nusing System.Runtime.InteropServices;\nusing System.Diagnostics.CodeAnalysis;\nusing Microsoft.Extensions.DependencyInjection;\n\nnamespace CSharp13\n{\n    public partial class PartialProperty\n    {\n        partial int PartialProp { get; } //Noncompliant\n    }\n}\n\nnamespace CSharp12\n{\n    // https://github.com/SonarSource/sonar-dotnet/issues/8024\n    public sealed record Line(decimal Field);\n\n    public sealed class Repro\n    {\n        public Line[] GetLines() => CreateLines();\n\n        private static Line[] CreateLines() => [new(0)];\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/9652\n    class Repro_9652\n    {\n        class Inner\n        {\n            public object? this[int test] => 0;\n            public int this[int x, int y] => 0;\n            public int this[int x, int y, int z] => 0;  // Noncompliant\n            public int this[string a, string b] => 0;\n            private int this[string test] => 0;\n            private int this[double test] => 0;         // Noncompliant\n\n            public int Method() => _ = this[\"\"];\n        }\n\n        class AnotherInner\n        {\n            private static Inner inner = new();\n            public int Method() => inner[\"a\", \"b\"];\n        }\n\n        private int this[int test] => 0;\n\n        public Repro_9652()\n        {\n            var inner = new Inner();\n            _ = inner[0];\n            _ = inner?[0];\n            _ = inner![0];\n            _ = inner!?[0];\n            _ = inner[0].ToString();\n            _ = inner?[0].ToString();\n            _ = inner[0]?.ToString();\n            _ = inner?[0]?.ToString();\n            _ = inner![0].ToString();\n            _ = inner[0]!.ToString();\n            _ = inner![0]!.ToString();\n            _ = inner!?[0]!?.ToString();\n            _ = inner[0, 0];\n            _ = this[0];\n            _ = inner.Method();\n\n            var anotherInner = new AnotherInner();\n            _ = anotherInner.Method();\n        }\n    }\n}\n\nnamespace CSharp11\n{\n    class UnusedPrivateMember\n    {\n        private interface MyInterface\n        {\n            static abstract void Method();\n        }\n\n        private class Class1 : MyInterface // Noncompliant {{Remove the unused private class 'Class1'.}}\n        {\n            public static void Method() { var x = 42; }\n            public void Method1() { var x = Method2(); } // Noncompliant {{Remove the unused private method 'Method1'.}}\n            public static int Method2() { return 2; }\n        }\n    }\n}\nnamespace CSharp10\n{\n    public record struct RecordStruct\n    {\n        public RecordStruct() { }\n\n        private int a = 42; // Noncompliant {{Remove the unused private field 'a'.}}\n\n        private int b = 42;\n        public int B() => b;\n\n        private nint Value { get; init; } = 42;\n\n        private nint UnusedValue { get; init; } = 0; // Compliant - properties with initializer are considered as used.\n\n        public RecordStruct Create() => new() { Value = 1 };\n\n        private interface IFoo // Noncompliant\n        {\n            public void Bar() { }\n        }\n\n        private record struct Nested(string Name, int CategoryId);\n\n        public void UseNested()\n        {\n            Nested d = new(\"name\", 2);\n        }\n\n        private record struct Nested2(string Name, int CategoryId);\n\n        public void UseNested2()\n        {\n            _ = new Nested2(\"name\", 2);\n        }\n\n        private record struct UnusedNested1(string Name, int CategoryId); // Noncompliant\n//                            ^^^^^^^^^^^^^\n        internal record struct UnusedNested2(string Name, int CategoryId); // Noncompliant\n        public record struct UnusedNested3(string Name, int CategoryId);\n        record struct UnusedNested4(string Name, int CategoryId); // Noncompliant\n\n        private int usedInPatternMatching = 1;\n\n        public int UseInPatternMatching(int val) =>\n            val switch\n            {\n                < 0 => usedInPatternMatching,\n                >= 0 => 1\n            };\n\n        private class LocalFunctionAttribute : Attribute { }\n        private class LocalFunctionAttribute2 : Attribute { }\n\n        public void Foo()\n        {\n            [LocalFunction]\n            static void Bar()\n            { }\n\n            [Obsolete]\n            [NotExisting] // Error [CS0246]\n                          // Error@-1 [CS0246]\n            [LocalFunctionAttribute2]\n            [LocalFunction]\n            static void Quix()\n            { }\n\n            [Obsolete]\n            static void ForCoverage() { }\n\n            static void NoAttribute() { } // Noncompliant\n        }\n    }\n\n    public record struct PositionalRecord(string Value)\n    {\n        private int a = 42; // Noncompliant\n        private int b = 42;\n        public int B() => b;\n\n        private record struct UnusedNested(string Name, int CategoryId) { } // Noncompliant\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/2752\n    public class ReproIssue2752\n    {\n        private record struct PrivateRecordStruct\n        {\n            public PrivateRecordStruct() { }\n\n            public uint part1 = 0; // Noncompliant FP. Type is communicated an external call.\n        }\n\n        [DllImport(\"user32.dll\")]\n        private static extern bool ExternalMethod(ref PrivateRecordStruct reference);\n    }\n}\n\nnamespace CSharp9\n{\n    public record Record\n    {\n        private int a; // Noncompliant {{Remove the unused private field 'a'.}}\n\n        private int b;\n        public int B() => b;\n\n        private nint Value { get; init; }\n\n        private nint UnusedValue { get; init; } // Noncompliant\n\n        public Record Create() => new() { Value = 1 };\n\n        private interface IFoo // Noncompliant\n        {\n            public void Bar() { }\n        }\n\n        private record Nested(string Name, int CategoryId);\n\n        public void UseNested()\n        {\n            Nested d = new(\"name\", 2);\n        }\n\n        private record Nested2(string Name, int CategoryId);\n\n        public void UseNested2()\n        {\n            _ = new Nested2(\"name\", 2);\n        }\n\n        private record UnusedNested1(string Name, int CategoryId); // Noncompliant\n//                     ^^^^^^^^^^^^^\n\n        internal record UnusedNested2(string Name, int CategoryId); // Noncompliant\n        public record UnusedNested3(string Name, int CategoryId);\n\n        private int usedInPatternMatching = 1;\n\n        public int UseInPatternMatching(int val) =>\n            val switch\n            {\n                < 0 => usedInPatternMatching,\n                >= 0 => 1\n            };\n\n        private class LocalFunctionAttribute : Attribute { }\n        private class LocalFunctionAttribute2 : Attribute { }\n\n        public void Foo()\n        {\n            [LocalFunction]\n            static void Bar()\n            { }\n\n            [Obsolete]\n            [NotExisting] // Error [CS0246]\n                          // Error@-1 [CS0246]\n            [LocalFunctionAttribute2]\n            [LocalFunction]\n            static void Quix()\n            { }\n\n            [Obsolete]\n            static void ForCoverage() { }\n\n            static void NoAttribute() { } // Noncompliant\n        }\n    }\n\n    public record PositionalRecord(string Value)\n    {\n        private int a; // Noncompliant\n        private int b;\n        public int B() => b;\n\n        private record UnusedNested(string Name, int CategoryId) { } // Noncompliant\n    }\n\n    public class TargetTypedNew\n    {\n        private TargetTypedNew(int arg)\n        {\n            var x = arg;\n        }\n\n        private TargetTypedNew(string arg)                           // Noncompliant\n        {\n            var x = arg;\n        }\n\n        public static TargetTypedNew Create()\n        {\n            return new(42);\n        }\n\n        public static void Foo()\n        {\n            PositionalRecord @record = new PositionalRecord(\"\");\n        }\n    }\n\n    public partial class PartialMethods\n    {\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/2752\n    public class ReproIssue2752\n    {\n        private record PrivateRecordRef\n        {\n            public uint part1; // Noncompliant FP. Type is communicated an external call.\n        }\n\n        [DllImport(\"user32.dll\")]\n        private static extern bool ExternalMethod(ref PrivateRecordRef reference);\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/7904\n    // In record types PrintMembers is used by the runtime to create a string representation of the record.\n    // See also https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/record#printmembers-formatting-in-derived-records\n    public class Repro_7904\n    {\n        public record BaseRecord(int Value);\n\n        public record NoBaseRecord\n        {\n            protected virtual bool PrintMembers(StringBuilder builder) => true;     // Compliant\n        }\n\n        public record HasBaseRecord() : BaseRecord(42)\n        {\n            protected override bool PrintMembers(StringBuilder builder) => true;    // Compliant\n        }\n\n        public sealed record SealedWithNoBaseRecord\n        {\n            private bool PrintMembers(StringBuilder builder) => true;               // Compliant\n        }\n\n        public sealed record SealedWithBaseRecord() : BaseRecord(42)\n        {\n            protected override bool PrintMembers(StringBuilder builder) => true;   // Compliant\n        }\n\n        public sealed record NonMatchingPrintMembers\n        {\n            private int PrintMembers(int arg) => 42;                    // Noncompliant - different return type\n            private bool PrintMembers() => false;                       // Noncompliant - different parameter list\n            private bool PrintMembers(string arg) => false;             // Noncompliant - different parameter list\n\n            public bool MethodWithLocalFunction()\n            {\n                return false;\n\n                bool PrintMembers(StringBuilder builder) => true;       // Noncompliant\n            }\n        }\n\n        public class ClassWithPrintMembers\n        {\n            private bool PrintMembers(StringBuilder builder) => true;   // Noncompliant - not a record\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/9379\n    public static class Repro_9379\n    {\n        public static void Method()\n        {\n            var instance = CreateInstance<ClassInstantiatedThroughReflection>();\n            var instance2 = CreateInstance(typeof(AnotherClassInstantiatedThroughReflection));\n\n            A classViaReflection = new();\n            InitValue(classViaReflection);\n        }\n\n        public static T CreateInstance<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T>() =>\n            (T)Activator.CreateInstance(typeof(T), 42);\n\n        public static object CreateInstance([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type) =>\n            Activator.CreateInstance(type, 42);\n\n        public static void InitValue<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T>(T value) { }\n\n        private class A\n        {\n            private bool a = true; // Noncompliant FP: type argument is inferred and ArgumentList is not present on syntax level (see line 183)\n        }\n\n        private class ClassInstantiatedThroughReflection\n        {\n            private const int PrivateConst = 42;                // Noncompliant - FP\n            private int privateField;                           // Noncompliant - FP\n            private int PrivateProperty { get; set; }           // Noncompliant - FP\n            private void PrivateMethod() { }                    // Noncompliant - FP\n            private ClassInstantiatedThroughReflection() { }\n            private event EventHandler PrivateEvent;            // Noncompliant - FP\n\n            public ClassInstantiatedThroughReflection(int arg)\n            {\n            }\n\n            private class NestedType                            // Noncompliant - FP\n            {\n                private int privateField;                       // Noncompliant - FP\n            }\n        }\n\n        private class AnotherClassInstantiatedThroughReflection\n        {\n            private int privateField;                           // Noncompliant - FP\n        }\n\n        [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]\n        private class TypeDecoratedWithDynamicallyAccessedMembers\n        {\n            private const int PrivateConst = 42;\n            private int privateField;\n            private int PrivateProperty { get; set; }\n            private void PrivateMethod() { }\n            public TypeDecoratedWithDynamicallyAccessedMembers() { }\n            private event EventHandler PrivateEvent;\n\n            private class NestedType\n            {\n                private const int PrivateConst = 42;\n                private int privateField;\n                private int PrivateProperty { get; set; }\n                private void PrivateMethod() { }\n                private NestedType() { }\n                private event EventHandler PrivateEvent;\n            }\n        }\n\n        private class MembersDecoratedWithAttribute                             // Noncompliant\n        {\n            private const int PrivateConst = 42;                                // Noncompliant\n            [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.NonPublicFields)] private const int PrivateConstWithAttribute = 42;\n\n            private int privateField;                                           // Noncompliant\n            [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.NonPublicFields)] private int privateFieldWithAttribute;\n\n            private int PrivateProperty { get; set; }                           // Noncompliant\n            [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.NonPublicProperties)] private int PrivatePropertyWithAttribute { get; set; }\n\n            private void PrivateMethod() { }                                    // Noncompliant\n            [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.NonPublicMethods)] private void PrivateMethodWithAttribute() { }\n\n            private class NestedType { }                                        // Noncompliant\n            [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.NonPublicNestedTypes)] private class NestedTypeWithAttribute { }\n\n            [return: DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.NonPublicMethods)]\n            private int PrivateMethodWithReturn() { return 0; } // Noncompliant\n\n            [return: DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.NonPublicMethods)]\n            private PrivateClass PrivateMethodWithReturnCustomClass() { return null; } // Noncompliant FP\n        }\n\n        private class PrivateClass { }\n\n        private class ArgumentsDecoratedWithAttribute   // Noncompliant\n        {\n            public void PublicMethod() => Method(null); // Noncompliant\n\n            private void Method([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] NestedType arg) { }\n\n            private class NestedType\n            {\n                private NestedType(int arg) { }\n            }\n\n            public record RecordWithAttribute([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.NonPublicFields)] string NotUnused); // Noncompliant\n        }\n\n        private class DerivedFromTypeDecoratedWithDynamicallyAccessedMembers : TypeDecoratedWithDynamicallyAccessedMembers  // Noncompliant\n        {\n            private int privateField;                                                                                       // Noncompliant - [DynamicallyAccessedMembers] attribute is not inherited\n        }\n\n        [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)]\n        private class DynamicallyAccessedMembersOnlyForConstructors\n        {\n            private int privateField; // FN - only public constructors are used are indicated to be used through reflection, not fields\n                                      // The analyzer assumens when the [DynamicallyAccessedMembers] attribute is used, then all members are used through reflection\n        }\n    }\n}\n\nnamespace CustomDynamicallyAccessedMembersAttribute\n{\n    public class DynamicallyAccessedMembersAttribute : Attribute { }\n\n    [DynamicallyAccessedMembers]\n    public class UnusedClassMarkedWithCustomAttribute\n    {\n        private int privateField;\n    }\n}\n\nnamespace CSharp8\n{\n    public interface MyInterface1\n    {\n        public void Method1() { }\n    }\n\n    public class Class1\n    {\n        private interface MyInterface2 // Noncompliant\n        {\n            public void Method1() { }\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/3842\n    public class ReproIssue3842\n    {\n        public void SomeMethod()\n        {\n            ForSwitchArm x = null;\n            var result = (x) switch\n            {\n                null => 1,\n                // normally, when deconstructing in a switch, we don't actually know the type\n                (object x1, object x2) => 2\n            };\n            var y = new ForIsPattern();\n            if (y is (string a, string b))\n            { }\n        }\n\n        private sealed class ForSwitchArm\n        {\n            public void Deconstruct(out object a, out object b) { a = b = null; } // Compliant, Deconstruct methods are ignored\n        }\n\n        private sealed class ForIsPattern\n        {\n            public void Deconstruct(out string a, out string b) { a = b = null; } // Compliant\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/8342\n    public class Repro_8342\n    {\n        [Private1] private protected void APrivateProtectedMethod() { }\n        [Public1, Private2] public void APublicMethodWithMultipleAttributes1() { }\n        [Public1][Private2] public void APublicMethodWithMultipleAttributes2() { }\n\n        private class Private1Attribute : Attribute { }\n        private class Private2Attribute : Attribute { }\n        private class Private3Attribute : Attribute { }  // Noncompliant\n        public class Public1Attribute : Attribute { }    // Compliant: public\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/4102\nnamespace Repro1144\n{\n\n    public interface IMyService { }\n    public interface ISomeExternalDependency { }\n\n    public static class UIServiceCollectionExtensions\n    {\n        public static IServiceCollection AddDefaultMyService(this IServiceCollection services)\n        {\n            services.AddSingleton<IMyService, MyServiceSingleton>();\n            services.AddScoped<IMyService, MyServiceScoped>();\n            services.AddTransient<IMyService, MyServiceTransient>();\n\n            return services;\n        }\n\n        private class MyServiceSingleton : IMyService\n        {\n            private readonly ISomeExternalDependency dependency;\n\n            public MyServiceSingleton(ISomeExternalDependency dependency) => this.dependency = dependency; // Noncompliant FP\n        }\n\n        private class MyServiceScoped : IMyService\n        {\n            private readonly ISomeExternalDependency dependency;\n\n            public MyServiceScoped(ISomeExternalDependency dependency) => this.dependency = dependency; // Noncompliant FP\n        }\n\n        private class MyServiceTransient : IMyService\n        {\n            private readonly ISomeExternalDependency dependency;\n\n            public MyServiceTransient(ISomeExternalDependency dependency) => this.dependency = dependency; // Noncompliant FP\n        }\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/6653\nnamespace Repro6653\n{\n    public class UsingCoalescingAssignmentOperator\n    {\n        private static string StaticField1;\n\n        private string Field0_1;       // Noncompliant, never read nor written\n        private string Field0_2 = \"1\"; // Noncompliant, written by initializer but not read\n        private string Field0_3 = \"1\";\n        private string Field1;\n        private string Field2;\n        private string Field3;\n        private string Field4;\n        private string Field5;\n        private string Field6_1;\n        private string Field6_2;\n        private string Field6_3;\n        private string Field7_1;\n        private string Field7_2;\n        private string Field7_3;\n        private string Field8;\n        private string Field9;\n        private string Field10;\n        private string Field11;\n        private string[] Field12;\n        private string Field13_1;\n        private string Field13_2;\n        private string Field14_1;\n        private string Field14_2;\n        private string Field15_1;\n        private string Field15_2;\n\n        public UsingCoalescingAssignmentOperator(string sPar) { }\n\n        public string this[string sPar] => null;\n\n        public void SomeMethod()\n        {\n            _ = Field0_3;\n            _ = Field1 ??= \"1\";\n            _ = Field2 ??= Field2;\n            _ = Field3 ?? \"1\";\n            _ = Field4 ?? (Field4 ??= \"1\");\n            _ = Field5;\n            _ = Field5 ??= Field5;\n            _ = Field6_1 ??= Field6_2 ??= Field6_3;\n            _ = Field7_1 ??= (Field7_2 ?? Field7_3);\n            _ = \"1\" + (Field8 ??= \"1\");\n            _ = OtherMethod(Field9 ??= \"1\");\n            _ = this[Field10 ??= \"1\"];\n            _ = this.Field11 ?? \"1\";\n            _ = Field12[0] ??= \"1\";\n            _ = Field13_1 ??= (Field13_2 += \"1\");\n            _ = Field14_1 ??= (Field14_2 = \"1\");\n            _ = Field15_1 ??= OtherMethod(Field15_2 = \"1\");\n        }\n\n        public static UsingCoalescingAssignmentOperator StaticMethod() => new UsingCoalescingAssignmentOperator(StaticField1 ??= \"1\");\n\n        private string OtherMethod(string sPar) => null;\n    }\n}\n\nnamespace CSharp7\n{\n    public class ExpressionBodyProperties\n    {\n        private int aField;\n\n        private int Property01\n        {\n            get => aField;\n            set => aField = value; // Noncompliant\n        }\n\n        private int Property02\n        {\n            get => aField; // Noncompliant\n            set => aField = value;\n        }\n\n        public void Method()\n        {\n            int x;\n\n            x = Property01;\n            Property02 = x;\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/2478\n    public class ReproIssue2478\n    {\n        public void SomeMethod()\n        {\n            var (a, (barA, barB)) = new PublicDeconstructWithInnerType();\n\n            var (_, _, c) = new PublicDeconstruct();\n\n            var qix = new MultipleDeconstructors();\n            object b;\n            (a, b, c) = qix;\n\n            (a, b) = ReturnFromMethod();\n\n            (a, b) = new ProtectedInternalDeconstruct();\n\n            (a, b, c) = new Ambiguous(); // Error [CS0121]\n            (a, b) = new NotUsedDifferentArgumentCount();   // Error [CS1501, CS8129]\n            (a, b) = new NotUsedNotVisible();               // Error [CS0411, CS8129]\n        }\n\n        internal void InternalMethod(InternalDeconstruct bar)\n        {\n            var (a, b) = bar;\n        }\n\n        private sealed class PublicDeconstructWithInnerType\n        {\n            public void Deconstruct(out object a, out InternalDeconstruct b) { a = b = null; }\n\n            private void Deconstruct(out object a, out object b) { a = b = null; } // Compliant, Deconstruct methods are ignored\n        }\n\n        internal sealed class InternalDeconstruct\n        {\n            internal void Deconstruct(out object a, out object b) { a = b = null; }\n\n            private void Deconstruct(out object a, out string b, out string c) { a = b = c = null; } // Compliant, Deconstruct methods are ignored\n        }\n\n        private class PublicDeconstruct\n        {\n            public void Deconstruct(out object a, out object b, out object c) { a = b = c = null; }\n\n            protected void Deconstruct(out string a, out string b, out string c) { a = b = c = null; } // Compliant, Deconstruct methods are ignored\n            private void Deconstruct(out object a, out string b, out string c) { a = b = c = null; } // Compliant, Deconstruct methods are ignored\n        }\n\n        private sealed class MultipleDeconstructors\n        {\n            public void Deconstruct(out object a, out object b, out object c) { a = b = c = null; }\n\n            public void Deconstruct(out object a, out object b) // Compliant, Deconstruct methods are ignored\n            {\n                a = b = null;\n            }\n        }\n\n        private class ProtectedInternalDeconstruct\n        {\n            protected internal void Deconstruct(out object a, out object b) { a = b = null; }\n\n            protected internal void Deconstruct(out object a, out object b, out object c) { a = b = c = null; } // Compliant, Deconstruct methods are ignored\n        }\n\n        private class Ambiguous\n        {\n            public void Deconstruct(out string a, out string b, out string c) { a = b = c = null; }\n            public void Deconstruct(out object a, out object b, out object c) { a = b = c = null; } // Compliant, Deconstruct methods are ignored\n        }\n\n        private class NotUsedDifferentArgumentCount\n        {\n            public void Deconstruct(out string a, out string b, out string c) { a = b = c = null; } // Compliant, Deconstruct methods are ignored\n            public void Deconstruct(out string a, out string b, out string c, out string d) { a = b = c = d = null; } // Compliant, Deconstruct methods are ignored\n        }\n\n        private class NotUsedNotVisible\n        {\n            protected void Deconstruct(out object a, out object b) { a = b = null; } // Compliant, Deconstruct methods are ignored\n            private void Deconstruct(out string a, out string b) { a = b = null; } // Compliant, Deconstruct methods are ignored\n        }\n\n        public class InvalidDeconstruct\n        {\n            private void Deconstruct(object a, out object b, out object c) { b = c = a; } // Noncompliant\n            private void Deconstruct() { } // Noncompliant\n\n            private int Deconstruct(out object a, out object b, out object c) // Noncompliant\n            {\n                a = b = c = null;\n                return 42;\n            }\n        }\n\n        private ForMethod ReturnFromMethod() => null;\n        private sealed class ForMethod\n        {\n            public void Deconstruct(out object a, out object b) { a = b = null; }\n        }\n    }\n\n    public class ReproIssue2333\n    {\n        public void Method()\n        {\n            PrivateNestedClass x = new PrivateNestedClass();\n            (x.ReadAndWrite, x.OnlyWriteNoBody, x.OnlyWrite) = (\"A\", \"B\", \"C\");\n            var tuple = (x.ReadAndWrite, x.OnlyRead);\n        }\n\n        private class PrivateNestedClass\n        {\n            private string hasOnlyWrite;\n\n            public string ReadAndWrite { get; set; }        // Setters are compliant, they are used in tuple assignment\n            public string OnlyWriteNoBody { get; set; }     // Compliant, we don't raise on get without body\n\n            public string OnlyRead\n            {\n                get;\n                set;    // Noncompliant\n            }\n\n            public string OnlyWrite\n            {\n                get => hasOnlyWrite;    // Noncompliant\n                set => hasOnlyWrite = value;\n            }\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/2752\n    public class ReproIssue2752\n    {\n        private struct PrivateStructRef\n        {\n            public uint part1; // Noncompliant FP. Type is communicated an external call.\n        }\n\n        private class PrivateClassRef\n        {\n            public uint part1; // Noncompliant FP. Type is communicated an external call.\n        }\n\n        [DllImport(\"user32.dll\")]\n        private static extern bool ExternalMethodWithStruct(ref PrivateStructRef reference);\n\n        [DllImport(\"user32.dll\")]\n        private static extern bool ExternalMethodWithClass(ref PrivateClassRef reference);\n    }\n\n    public class EmptyCtor\n    {\n        // That's invalid syntax, but it is still empty ctor and we should not raise for it, even if it is not used\n        public EmptyCtor() => // Error [CS1525,CS1002]\n}\n\n    public class WithEnums\n    {\n        private enum X // Noncompliant\n        {\n            A\n        }\n\n        public void UseEnum()\n        {\n            var b = Y.B;\n        }\n\n        private enum Y\n        {\n            A,\n            B\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/6724\n    public class Repro_6724\n    {\n        public int PrivateGetter { private get; set; } // Noncompliant\n        public int PrivateSetter { get; private set; } // Noncompliant\n\n        public int ExpressionBodiedPropertyWithPrivateGetter { private get => 1; set => _ = value; } // Noncompliant\n        public int ExpressionBodiedPropertyWithPrivateSetter { get => 1; private set => _ = value; } // Noncompliant\n    }\n}\n\n// https://sonarsource.atlassian.net/browse/NET-675\nnamespace Repro_NET675\n{\n    internal readonly record struct RecordStruct\n    {\n        public string Value { get; }\n\n        private RecordStruct(string value) => Value = value; // Compliant\n\n        public static void Create(string value, out RecordStruct? result)\n        {\n            result = new(value);\n        }\n    }\n\n    internal struct MyStruct\n    {\n        public string Value { get; }\n\n        private MyStruct(string value) => Value = value; // Compliant\n\n        public static void Create(string value, out MyStruct? result)\n        {\n            result = new(value);\n        }\n    }\n\n    internal record class RecordClass\n    {\n        public string Value { get; }\n\n        private RecordClass(string value) => Value = value; // Compliant\n\n        public static void Create(string value, out RecordClass? result)\n        {\n            result = new(value);\n        }\n    }\n\n    internal class MyClass\n    {\n        public string Value { get; }\n\n        private MyClass(string value) => Value = value; // Compliant\n\n        public static void Create(string value, out MyClass? result)\n        {\n            result = new(value);\n        }\n    }\n}\n\npublic static class Extensions // Repro for https://sonarsource.atlassian.net/browse/NET-2644\n{\n    extension(List<string> strings)\n    {\n        public void ExtensionMethods()\n        {\n            PrivateExtensionAsMethod(strings);\n            PrivateStaticExtensionAsMethod();\n\n            strings.PrivateExtensionAsExtension();\n            List<string>.PrivateStaticExtensionAsExtension();\n        }\n\n        private string PrivateExtensionAsMethod() => \"a\";                 // Compliant\n        private static string PrivateStaticExtensionAsMethod() => \"a\";    // Compliant\n\n        private string PrivateExtensionAsExtension() => \"a\";\n        private static string PrivateStaticExtensionAsExtension() => \"a\";\n\n        private string UnusedPrivateMethod() => \"a\";                      // Compliant FN - https://sonarsource.atlassian.net/browse/NET-3503\n        private static string UnusedPrivateStaticMethod() => \"a\";         // Compliant FN - https://sonarsource.atlassian.net/browse/NET-3503\n        private string UnusedPrivateProperty => \"a\";                      // Noncompliant\n    }\n}\n\npublic class NullConditionallAssignment\n{\n    public class Sample\n    {\n        public int Value { get; set; } \n    }\n    public Sample Prop { get; set; }\n    private int CompliantRightSide;     // Compliant\n    private Sample CompliantLeftSide;   // Compliant\n    public void Method()\n    {\n        Prop?.Value = CompliantRightSide;\n        CompliantLeftSide?.Value = 42;\n    }\n}\n\npublic class FieldKeyword\n{\n    private int Prop { get { return field; } set { field = value; } } // Noncompliant\n}\n\npublic partial class PartialEvents\n{\n    private EventHandler compliant;\n    private partial event EventHandler Compliant; // Noncompliant FP https://sonarsource.atlassian.net/browse/NET-2825\n    public void Method()\n    {\n        compliant.Invoke(null, null);\n        Compliant += UnusedPrivateMember_MyUsedEvent;\n    }\n\n    private void UnusedPrivateMember_MyUsedEvent(object sender, EventArgs e) { }\n}\n\n\npublic static class CommunityRepro_ExtensionBlockPublicMembers // Repro for https://community.sonarsource.com/t/180285\n{\n    extension(object instance)\n    {\n        public void PublicMethod() { }                    // Compliant - public extension method, accessible externally\n        public string PublicProperty => \"value\";          // Compliant - public extension property, accessible externally\n        private void UnusedPrivateMethod() { }            // Compliant FN - private methods in extension blocks are not analyzed (gap)\n        private string UnusedPrivateProperty => \"value\";  // Noncompliant - private properties in extension blocks are analyzed\n    }\n}\n\npublic class NET_2805Repro // https://sonarsource.atlassian.net/browse/NET-2805\n{\n    public int CallingMethod(int value) => new WithDebugger(value)[3];\n    [DebuggerDisplay(\"{this[0]}, {this[1]}, {this[2]}, {this[3]}, {this[4]}\")]\n    private readonly record struct WithDebugger(int Value)\n    {\n        public int this[int pos] => (Value >> (pos << 2)) & 7; // Compliant Called by 'new WithDebugger(value)[3]' and DebuggerDisplay,\n    }\n\n    public int AlsoCallingMethod(int value) => new WithoutDebugger(value)[3];\n    readonly record struct WithoutDebugger(int Value)\n    {\n        public int this[int pos] => (Value >> (pos << 2)) & 7; // Compliant\n    }\n\n    public int EverythingIsReferenced() => new IndexerReferencedInternally(0).CallingMethod(0);\n    [DebuggerDisplay(\"{this[0]}, {this[1]}, {this[2]}, {this[3]}, {this[4]}\")]\n    private readonly record struct IndexerReferencedInternally(int Value) // Compliant\n    {\n        public int CallingMethod(int value) => this[3];                   // Compliant\n        private int this[int pos] => (Value >> (pos << 2)) & 7;           // Compliant\n    }\n}\n\npublic class Repro_3596_AD0001<T> // https://sonarsource.atlassian.net/browse/NET-3596\n{\n    private readonly Nullable field;\n    public Repro_3596_AD0001() => field = new(this);\n\n    private class Nullable(Repro_3596_AD0001<T> outer) { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnusedPrivateMember.Performance.cs",
    "content": "﻿// Sample code to repro bug #2472: Analysis of Entity Framework migration files never completes\n// https://github.com/SonarSource/sonar-dotnet/issues/2474\n// Created from end-user repro: https://github.com/ksitarek/sonarscannersample\n// This file was called \"20181005212624_InitialCreate.cs\" in that repo.\n//\n// The single file is enough to cause the issue described in the bug, although there\n// are other large files in the project that might also be problematic.\n//\n// Requires the following NuGet package:\n//  <PackageReference Include = \"Microsoft.EntityFrameworkCore.SqlServer\" Version=\"2.x\" />\n\nusing System;\nusing Microsoft.EntityFrameworkCore.Migrations;\n\nnamespace vtb.Warehouse.Data.Migrations\n{\n    public class InitialCreate : Migration\n    {\n        protected override void Up(MigrationBuilder migrationBuilder)\n        {\n            migrationBuilder.CreateTable(\n                name: \"Buildings\",\n                columns: table => new\n                {\n                    Id = table.Column<Guid>(nullable: false),\n                    Label = table.Column<string>(maxLength: 30, nullable: true)\n                },\n                constraints: table =>\n                {\n                    table.PrimaryKey(\"PK_Buildings\", x => x.Id);\n                });\n\n            migrationBuilder.CreateTable(\n                name: \"Units\",\n                columns: table => new\n                {\n                    Id = table.Column<Guid>(nullable: false),\n                    Label = table.Column<string>(maxLength: 128, nullable: false),\n                    Width = table.Column<long>(nullable: false),\n                    Height = table.Column<long>(nullable: false),\n                    Depth = table.Column<long>(nullable: false),\n                    Weight = table.Column<long>(nullable: false)\n                },\n                constraints: table =>\n                {\n                    table.PrimaryKey(\"PK_Units\", x => x.Id);\n                });\n\n            migrationBuilder.CreateTable(\n                name: \"Racks\",\n                columns: table => new\n                {\n                    Id = table.Column<Guid>(nullable: false),\n                    BuildingId = table.Column<Guid>(nullable: false),\n                    Order = table.Column<int>(nullable: false)\n                },\n                constraints: table =>\n                {\n                    table.PrimaryKey(\"PK_Racks\", x => x.Id);\n                    table.ForeignKey(\n                        name: \"FK_Racks_Buildings_BuildingId\",\n                        column: x => x.BuildingId,\n                        principalTable: \"Buildings\",\n                        principalColumn: \"Id\",\n                        onDelete: ReferentialAction.Cascade);\n                });\n\n            migrationBuilder.CreateTable(\n                name: \"Shelves\",\n                columns: table => new\n                {\n                    Id = table.Column<Guid>(nullable: false),\n                    RackId = table.Column<Guid>(nullable: false),\n                    Width = table.Column<long>(nullable: false),\n                    Height = table.Column<long>(nullable: false),\n                    Depth = table.Column<long>(nullable: false)\n                },\n                constraints: table =>\n                {\n                    table.PrimaryKey(\"PK_Shelves\", x => x.Id);\n                    table.ForeignKey(\n                        name: \"FK_Shelves_Racks_RackId\",\n                        column: x => x.RackId,\n                        principalTable: \"Racks\",\n                        principalColumn: \"Id\",\n                        onDelete: ReferentialAction.Cascade);\n                });\n\n            migrationBuilder.CreateTable(\n                name: \"StorageUnits\",\n                columns: table => new\n                {\n                    Id = table.Column<Guid>(nullable: false),\n                    ShelfId = table.Column<Guid>(nullable: false),\n                    UnitId = table.Column<Guid>(nullable: false),\n                    Quantity = table.Column<int>(nullable: false, defaultValue: 1)\n                },\n                constraints: table =>\n                {\n                    table.PrimaryKey(\"PK_StorageUnits\", x => x.Id);\n                    table.ForeignKey(\n                        name: \"FK_StorageUnits_Shelves_ShelfId\",\n                        column: x => x.ShelfId,\n                        principalTable: \"Shelves\",\n                        principalColumn: \"Id\",\n                        onDelete: ReferentialAction.Cascade);\n                    table.ForeignKey(\n                        name: \"FK_StorageUnits_Units_UnitId\",\n                        column: x => x.UnitId,\n                        principalTable: \"Units\",\n                        principalColumn: \"Id\",\n                        onDelete: ReferentialAction.Cascade);\n                });\n\n            migrationBuilder.InsertData(\n                table: \"Buildings\",\n                columns: new[] { \"Id\", \"Label\" },\n                values: new object[,]\n                {\n                    { new Guid(\"90d06fdc-4112-44b4-ab82-e38c4a2baa98\"), \"ABQ\" },\n                    { new Guid(\"fb77981e-119b-4bb9-ba9b-26ff22c646d5\"), \"SAF\" }\n                });\n\n            migrationBuilder.InsertData(\n                table: \"Units\",\n                columns: new[] { \"Id\", \"Depth\", \"Height\", \"Label\", \"Weight\", \"Width\" },\n                values: new object[,]\n                {\n                    { new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\"), 10L, 350L, \"Screen\", 0L, 200L },\n                    { new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\"), 30L, 300L, \"Keyboard\", 0L, 180L },\n                    { new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\"), 300L, 25L, \"Motherboard\", 0L, 350L }\n                });\n\n            migrationBuilder.InsertData(\n                table: \"Racks\",\n                columns: new[] { \"Id\", \"BuildingId\", \"Order\" },\n                values: new object[,]\n                {\n                    { new Guid(\"6833ef8a-2454-46bf-816e-b3b1157a145e\"), new Guid(\"90d06fdc-4112-44b4-ab82-e38c4a2baa98\"), 0 },\n                    { new Guid(\"243abb4a-2484-42c7-9f01-5b4424040588\"), new Guid(\"fb77981e-119b-4bb9-ba9b-26ff22c646d5\"), 2 },\n                    { new Guid(\"eb64d993-f585-4f8f-9480-de07d2279dd1\"), new Guid(\"fb77981e-119b-4bb9-ba9b-26ff22c646d5\"), 3 },\n                    { new Guid(\"abdda4b1-286c-4ed2-a311-3607f12e7311\"), new Guid(\"fb77981e-119b-4bb9-ba9b-26ff22c646d5\"), 4 },\n                    { new Guid(\"618d021d-cb53-4d34-b590-88ebf1cb6ffb\"), new Guid(\"fb77981e-119b-4bb9-ba9b-26ff22c646d5\"), 5 },\n                    { new Guid(\"518ba58a-bec1-4754-b72a-0fcdc0513981\"), new Guid(\"fb77981e-119b-4bb9-ba9b-26ff22c646d5\"), 6 },\n                    { new Guid(\"1f60e478-5f69-4821-ae97-9f13dba2386f\"), new Guid(\"fb77981e-119b-4bb9-ba9b-26ff22c646d5\"), 7 },\n                    { new Guid(\"a5d9a3df-474d-4063-b56e-d05eca3573ab\"), new Guid(\"fb77981e-119b-4bb9-ba9b-26ff22c646d5\"), 8 },\n                    { new Guid(\"b21fb222-72e2-4de2-94d8-9a18c83b202f\"), new Guid(\"fb77981e-119b-4bb9-ba9b-26ff22c646d5\"), 9 },\n                    { new Guid(\"fa61ebb2-2025-4d91-a461-c621389fa638\"), new Guid(\"fb77981e-119b-4bb9-ba9b-26ff22c646d5\"), 10 },\n                    { new Guid(\"fad135c9-dfdc-4cb9-9ec2-85717c807e3e\"), new Guid(\"fb77981e-119b-4bb9-ba9b-26ff22c646d5\"), 11 },\n                    { new Guid(\"e9ecdb7b-1397-4bc5-ad66-69f23d18128a\"), new Guid(\"fb77981e-119b-4bb9-ba9b-26ff22c646d5\"), 12 },\n                    { new Guid(\"052c61c2-4d54-43ee-b58e-81774c2bbd57\"), new Guid(\"fb77981e-119b-4bb9-ba9b-26ff22c646d5\"), 13 },\n                    { new Guid(\"4940168a-f090-4c68-bb13-ee1d0e642ea6\"), new Guid(\"fb77981e-119b-4bb9-ba9b-26ff22c646d5\"), 1 },\n                    { new Guid(\"ba82b7b8-8337-49e2-b662-2fbbfce02657\"), new Guid(\"fb77981e-119b-4bb9-ba9b-26ff22c646d5\"), 14 },\n                    { new Guid(\"7da472a1-651c-44a2-99f2-ce52f86c1d13\"), new Guid(\"fb77981e-119b-4bb9-ba9b-26ff22c646d5\"), 16 },\n                    { new Guid(\"ed1dfa48-d0fb-40ce-92d6-1bd33f571414\"), new Guid(\"fb77981e-119b-4bb9-ba9b-26ff22c646d5\"), 17 },\n                    { new Guid(\"fa9f084a-7646-4690-9367-9c0d524c8411\"), new Guid(\"fb77981e-119b-4bb9-ba9b-26ff22c646d5\"), 18 },\n                    { new Guid(\"7a630a52-70cb-4ea6-ab49-dc81b867fe20\"), new Guid(\"fb77981e-119b-4bb9-ba9b-26ff22c646d5\"), 19 },\n                    { new Guid(\"ade7f113-3cb6-4404-997d-3037a5b5897a\"), new Guid(\"fb77981e-119b-4bb9-ba9b-26ff22c646d5\"), 20 },\n                    { new Guid(\"62ca507a-1154-4227-918b-e4ff472c6279\"), new Guid(\"fb77981e-119b-4bb9-ba9b-26ff22c646d5\"), 21 },\n                    { new Guid(\"f0f83453-5cc9-4e84-80be-10972a6d7d9c\"), new Guid(\"fb77981e-119b-4bb9-ba9b-26ff22c646d5\"), 22 },\n                    { new Guid(\"e192b321-042f-47c8-b93a-16751e3e7653\"), new Guid(\"fb77981e-119b-4bb9-ba9b-26ff22c646d5\"), 23 },\n                    { new Guid(\"89b63ff3-1cc6-4d25-87b0-9b30da00827c\"), new Guid(\"fb77981e-119b-4bb9-ba9b-26ff22c646d5\"), 24 },\n                    { new Guid(\"6d2da389-f505-4506-b5b8-18d57d1fac52\"), new Guid(\"fb77981e-119b-4bb9-ba9b-26ff22c646d5\"), 25 },\n                    { new Guid(\"86b9bd13-ed73-4dac-87d7-95ee4dcebab9\"), new Guid(\"fb77981e-119b-4bb9-ba9b-26ff22c646d5\"), 26 },\n                    { new Guid(\"6e2be310-4368-48fa-a18f-8c3b84bc195f\"), new Guid(\"fb77981e-119b-4bb9-ba9b-26ff22c646d5\"), 27 },\n                    { new Guid(\"92f60038-40a0-461b-a607-13b906e941a9\"), new Guid(\"fb77981e-119b-4bb9-ba9b-26ff22c646d5\"), 15 },\n                    { new Guid(\"08b55c7c-3747-4025-9dd7-be155f2a54bb\"), new Guid(\"fb77981e-119b-4bb9-ba9b-26ff22c646d5\"), 0 },\n                    { new Guid(\"379a8126-faa5-4cfc-98da-97b344454d69\"), new Guid(\"90d06fdc-4112-44b4-ab82-e38c4a2baa98\"), 29 },\n                    { new Guid(\"9dff5406-13fd-4051-ba33-aa51f500c53e\"), new Guid(\"90d06fdc-4112-44b4-ab82-e38c4a2baa98\"), 28 },\n                    { new Guid(\"39730a50-95cc-43b3-8e46-cafee2ef6235\"), new Guid(\"90d06fdc-4112-44b4-ab82-e38c4a2baa98\"), 1 },\n                    { new Guid(\"47ab1205-32ea-4739-a1a6-f41a58936498\"), new Guid(\"90d06fdc-4112-44b4-ab82-e38c4a2baa98\"), 2 },\n                    { new Guid(\"9050d656-22fd-4dd4-959a-0b66df2d32ee\"), new Guid(\"90d06fdc-4112-44b4-ab82-e38c4a2baa98\"), 3 },\n                    { new Guid(\"bacfde61-7c26-4d90-993c-eb8ae559ba68\"), new Guid(\"90d06fdc-4112-44b4-ab82-e38c4a2baa98\"), 4 },\n                    { new Guid(\"4b840bec-728d-499d-ac3c-3369d09eb9f5\"), new Guid(\"90d06fdc-4112-44b4-ab82-e38c4a2baa98\"), 5 },\n                    { new Guid(\"f654f424-05e0-456d-9556-b0fad270b86f\"), new Guid(\"90d06fdc-4112-44b4-ab82-e38c4a2baa98\"), 6 },\n                    { new Guid(\"a10bd662-2917-4b71-a8bd-147061e8dfc8\"), new Guid(\"90d06fdc-4112-44b4-ab82-e38c4a2baa98\"), 7 },\n                    { new Guid(\"87dec986-250e-492f-b742-72ac264ab058\"), new Guid(\"90d06fdc-4112-44b4-ab82-e38c4a2baa98\"), 8 },\n                    { new Guid(\"584873d3-111a-4080-a371-c4fc859aa208\"), new Guid(\"90d06fdc-4112-44b4-ab82-e38c4a2baa98\"), 9 },\n                    { new Guid(\"3631a8b1-15f8-40b0-abe4-f932eb3aa4c6\"), new Guid(\"90d06fdc-4112-44b4-ab82-e38c4a2baa98\"), 10 },\n                    { new Guid(\"2a4ef2c2-ae16-4517-91b0-3160406e297f\"), new Guid(\"90d06fdc-4112-44b4-ab82-e38c4a2baa98\"), 11 },\n                    { new Guid(\"17d3ce29-4d37-491f-8e65-14069e322d23\"), new Guid(\"90d06fdc-4112-44b4-ab82-e38c4a2baa98\"), 12 },\n                    { new Guid(\"6bd24c6e-017b-4802-8b4d-f7188d9449dc\"), new Guid(\"90d06fdc-4112-44b4-ab82-e38c4a2baa98\"), 13 },\n                    { new Guid(\"97ffbac8-4288-4a7b-877e-4041ed1d3c7d\"), new Guid(\"90d06fdc-4112-44b4-ab82-e38c4a2baa98\"), 14 },\n                    { new Guid(\"7e0d6759-e633-4935-be57-1d3ed356c927\"), new Guid(\"90d06fdc-4112-44b4-ab82-e38c4a2baa98\"), 15 },\n                    { new Guid(\"005f50aa-23fc-4698-a10a-fb6e84280d07\"), new Guid(\"90d06fdc-4112-44b4-ab82-e38c4a2baa98\"), 16 },\n                    { new Guid(\"fddc1a16-8961-4d56-abc0-f7d297164e28\"), new Guid(\"90d06fdc-4112-44b4-ab82-e38c4a2baa98\"), 17 },\n                    { new Guid(\"8ba686b9-c505-4b49-9c74-2293add79f99\"), new Guid(\"90d06fdc-4112-44b4-ab82-e38c4a2baa98\"), 18 },\n                    { new Guid(\"8174b18a-32de-4e25-bc56-0c77d9596091\"), new Guid(\"90d06fdc-4112-44b4-ab82-e38c4a2baa98\"), 19 },\n                    { new Guid(\"f18fdacd-03aa-481b-a9ec-e91d1b7089bb\"), new Guid(\"90d06fdc-4112-44b4-ab82-e38c4a2baa98\"), 20 },\n                    { new Guid(\"f1335d5c-ffb5-4f3c-b336-418f079f2931\"), new Guid(\"90d06fdc-4112-44b4-ab82-e38c4a2baa98\"), 21 },\n                    { new Guid(\"cb24558f-d7a1-46b6-8278-b40bc7303b97\"), new Guid(\"90d06fdc-4112-44b4-ab82-e38c4a2baa98\"), 22 },\n                    { new Guid(\"4069dd1e-3c5e-4633-a0c7-294e0f0b8a73\"), new Guid(\"90d06fdc-4112-44b4-ab82-e38c4a2baa98\"), 23 },\n                    { new Guid(\"9d67d3a0-2004-467c-bcb0-a0995e9a3930\"), new Guid(\"90d06fdc-4112-44b4-ab82-e38c4a2baa98\"), 24 },\n                    { new Guid(\"0c1c8d40-2f3c-43c9-9be7-4c51f19ba244\"), new Guid(\"90d06fdc-4112-44b4-ab82-e38c4a2baa98\"), 25 },\n                    { new Guid(\"29781860-25e1-4054-b999-15cb57504c70\"), new Guid(\"90d06fdc-4112-44b4-ab82-e38c4a2baa98\"), 26 },\n                    { new Guid(\"54428e02-93d3-4403-973b-a0068f6b85c3\"), new Guid(\"90d06fdc-4112-44b4-ab82-e38c4a2baa98\"), 27 },\n                    { new Guid(\"58da385f-9bc7-4214-9298-5c4b6c179d57\"), new Guid(\"fb77981e-119b-4bb9-ba9b-26ff22c646d5\"), 28 },\n                    { new Guid(\"1049a6d0-5614-4882-85da-66c120a8e3af\"), new Guid(\"fb77981e-119b-4bb9-ba9b-26ff22c646d5\"), 29 }\n                });\n\n            migrationBuilder.InsertData(\n                table: \"Shelves\",\n                columns: new[] { \"Id\", \"Depth\", \"Height\", \"RackId\", \"Width\" },\n                values: new object[,]\n                {\n                    { new Guid(\"96a459d8-34db-4ed4-b6f4-452689b100b2\"), 800L, 800L, new Guid(\"6833ef8a-2454-46bf-816e-b3b1157a145e\"), 1200L },\n                    { new Guid(\"3006bbc3-1f10-4621-87c1-646268627b9a\"), 800L, 800L, new Guid(\"b21fb222-72e2-4de2-94d8-9a18c83b202f\"), 1200L },\n                    { new Guid(\"3a87ddd9-d22e-4e20-b41e-7a2178bb0b08\"), 800L, 800L, new Guid(\"b21fb222-72e2-4de2-94d8-9a18c83b202f\"), 1200L },\n                    { new Guid(\"2e4ff5b1-85a9-4fa1-9bb3-55d5486ae305\"), 800L, 800L, new Guid(\"b21fb222-72e2-4de2-94d8-9a18c83b202f\"), 1200L },\n                    { new Guid(\"5787b257-0b2c-4dc3-8331-2280dbb989d6\"), 800L, 800L, new Guid(\"b21fb222-72e2-4de2-94d8-9a18c83b202f\"), 1200L },\n                    { new Guid(\"4c002831-0fa2-4a34-83a5-44ab3e034992\"), 800L, 800L, new Guid(\"fa61ebb2-2025-4d91-a461-c621389fa638\"), 1200L },\n                    { new Guid(\"272d0bf0-d277-49e8-9765-5f8d89a797dc\"), 800L, 800L, new Guid(\"fa61ebb2-2025-4d91-a461-c621389fa638\"), 1200L },\n                    { new Guid(\"ec9a4337-365a-44ad-9cd7-7c22c4e49edb\"), 800L, 800L, new Guid(\"b21fb222-72e2-4de2-94d8-9a18c83b202f\"), 1200L },\n                    { new Guid(\"7fe0075d-9f34-4dfe-9d93-57b63fc4e955\"), 800L, 800L, new Guid(\"fa61ebb2-2025-4d91-a461-c621389fa638\"), 1200L },\n                    { new Guid(\"482f5d25-6e6d-410a-99f6-68d3d9d77206\"), 800L, 800L, new Guid(\"fa61ebb2-2025-4d91-a461-c621389fa638\"), 1200L },\n                    { new Guid(\"f4a55f71-a69e-473b-aa49-0c5d81dafb33\"), 800L, 800L, new Guid(\"fa61ebb2-2025-4d91-a461-c621389fa638\"), 1200L },\n                    { new Guid(\"f490547b-18d1-43a3-a578-44e623084bda\"), 800L, 800L, new Guid(\"fa61ebb2-2025-4d91-a461-c621389fa638\"), 1200L },\n                    { new Guid(\"6924ba58-124b-4fb3-810b-becb9733df7b\"), 800L, 800L, new Guid(\"fa61ebb2-2025-4d91-a461-c621389fa638\"), 1200L },\n                    { new Guid(\"15e976de-8a86-4773-a647-f7ba61aac44c\"), 800L, 800L, new Guid(\"fa61ebb2-2025-4d91-a461-c621389fa638\"), 1200L },\n                    { new Guid(\"5f1156d7-5a82-4780-80f1-f576961dbf0e\"), 800L, 800L, new Guid(\"fa61ebb2-2025-4d91-a461-c621389fa638\"), 1200L },\n                    { new Guid(\"45de9085-dfbf-4253-a653-642e7c0b4855\"), 800L, 800L, new Guid(\"fa61ebb2-2025-4d91-a461-c621389fa638\"), 1200L },\n                    { new Guid(\"373aa72a-3d5d-41b5-b94f-239814aeadca\"), 800L, 800L, new Guid(\"b21fb222-72e2-4de2-94d8-9a18c83b202f\"), 1200L },\n                    { new Guid(\"4f8d7a4f-f906-4647-8e0c-5783a870d5b2\"), 800L, 800L, new Guid(\"b21fb222-72e2-4de2-94d8-9a18c83b202f\"), 1200L },\n                    { new Guid(\"53d84c81-b881-4b64-ba99-3eac12ba8c8f\"), 800L, 800L, new Guid(\"b21fb222-72e2-4de2-94d8-9a18c83b202f\"), 1200L },\n                    { new Guid(\"e058b47c-2d71-45d8-a5ad-190ed5d4f8fd\"), 800L, 800L, new Guid(\"1f60e478-5f69-4821-ae97-9f13dba2386f\"), 1200L },\n                    { new Guid(\"90d2e76e-5034-40bb-bef6-510b5ed210dd\"), 800L, 800L, new Guid(\"1f60e478-5f69-4821-ae97-9f13dba2386f\"), 1200L },\n                    { new Guid(\"ee73a76e-3169-4496-9fe4-e44bd6f703b9\"), 800L, 800L, new Guid(\"1f60e478-5f69-4821-ae97-9f13dba2386f\"), 1200L },\n                    { new Guid(\"bbb55ca6-d027-4614-bce4-d41df4ebe31c\"), 800L, 800L, new Guid(\"a5d9a3df-474d-4063-b56e-d05eca3573ab\"), 1200L },\n                    { new Guid(\"06dcd08f-3ae9-45a2-9c39-3748d7c9fcbf\"), 800L, 800L, new Guid(\"a5d9a3df-474d-4063-b56e-d05eca3573ab\"), 1200L },\n                    { new Guid(\"b4b420fa-6bf9-49ba-94b6-e050fa9a8d8c\"), 800L, 800L, new Guid(\"a5d9a3df-474d-4063-b56e-d05eca3573ab\"), 1200L },\n                    { new Guid(\"8585de7a-3537-4aef-8c38-e17cf6fbad9a\"), 800L, 800L, new Guid(\"a5d9a3df-474d-4063-b56e-d05eca3573ab\"), 1200L },\n                    { new Guid(\"77424bca-eef4-4714-ade5-b397ce2c0779\"), 800L, 800L, new Guid(\"a5d9a3df-474d-4063-b56e-d05eca3573ab\"), 1200L },\n                    { new Guid(\"35a5ec06-c6ed-4616-a5ed-5bd89650a0c8\"), 800L, 800L, new Guid(\"a5d9a3df-474d-4063-b56e-d05eca3573ab\"), 1200L },\n                    { new Guid(\"d35bec08-3dc8-45e4-9c0d-065ace0f8bf2\"), 800L, 800L, new Guid(\"a5d9a3df-474d-4063-b56e-d05eca3573ab\"), 1200L },\n                    { new Guid(\"9d60ed5b-27b7-4119-b4eb-e2e0c242d313\"), 800L, 800L, new Guid(\"a5d9a3df-474d-4063-b56e-d05eca3573ab\"), 1200L },\n                    { new Guid(\"4b9c1acf-42e9-4523-b0e8-5c32a875e228\"), 800L, 800L, new Guid(\"a5d9a3df-474d-4063-b56e-d05eca3573ab\"), 1200L },\n                    { new Guid(\"fd44e61e-e259-47a7-ac42-846b11d099fe\"), 800L, 800L, new Guid(\"a5d9a3df-474d-4063-b56e-d05eca3573ab\"), 1200L },\n                    { new Guid(\"06a42280-44f0-42a1-adfa-391a4063cbd0\"), 800L, 800L, new Guid(\"b21fb222-72e2-4de2-94d8-9a18c83b202f\"), 1200L },\n                    { new Guid(\"71150b5c-dd20-47cc-be20-6baf7bc46cd7\"), 800L, 800L, new Guid(\"b21fb222-72e2-4de2-94d8-9a18c83b202f\"), 1200L },\n                    { new Guid(\"56db97fe-7a5b-4410-ae7b-e6933bce2d60\"), 800L, 800L, new Guid(\"fad135c9-dfdc-4cb9-9ec2-85717c807e3e\"), 1200L },\n                    { new Guid(\"9f39f6c7-2a28-4c52-b46a-c126c4c2d380\"), 800L, 800L, new Guid(\"fad135c9-dfdc-4cb9-9ec2-85717c807e3e\"), 1200L },\n                    { new Guid(\"6c977a83-c4ce-41f3-9d63-59bafcef5181\"), 800L, 800L, new Guid(\"fad135c9-dfdc-4cb9-9ec2-85717c807e3e\"), 1200L },\n                    { new Guid(\"4e72dd9e-76a0-49ab-ab5d-e73b350b5950\"), 800L, 800L, new Guid(\"fad135c9-dfdc-4cb9-9ec2-85717c807e3e\"), 1200L },\n                    { new Guid(\"31909f1d-ea40-43e9-8691-f9919f57a52a\"), 800L, 800L, new Guid(\"052c61c2-4d54-43ee-b58e-81774c2bbd57\"), 1200L },\n                    { new Guid(\"cc0221c8-29bc-46a8-b088-f154e50156ea\"), 800L, 800L, new Guid(\"052c61c2-4d54-43ee-b58e-81774c2bbd57\"), 1200L },\n                    { new Guid(\"7ac46c7b-242c-44a2-b3f3-1f5a56c1f532\"), 800L, 800L, new Guid(\"052c61c2-4d54-43ee-b58e-81774c2bbd57\"), 1200L },\n                    { new Guid(\"99799c23-9a40-43bc-a62f-ec3c8fa6dfad\"), 800L, 800L, new Guid(\"052c61c2-4d54-43ee-b58e-81774c2bbd57\"), 1200L },\n                    { new Guid(\"b3e01989-4f9a-4214-977c-3186ec24548c\"), 800L, 800L, new Guid(\"052c61c2-4d54-43ee-b58e-81774c2bbd57\"), 1200L },\n                    { new Guid(\"759675d3-2ce0-4c8e-9113-ac29de8b6528\"), 800L, 800L, new Guid(\"052c61c2-4d54-43ee-b58e-81774c2bbd57\"), 1200L },\n                    { new Guid(\"44d517a2-9ddd-43d5-9619-db42ab2eef5a\"), 800L, 800L, new Guid(\"052c61c2-4d54-43ee-b58e-81774c2bbd57\"), 1200L },\n                    { new Guid(\"cbe2cf5a-9049-4c0d-b9f4-8d1f831ee1d3\"), 800L, 800L, new Guid(\"ba82b7b8-8337-49e2-b662-2fbbfce02657\"), 1200L },\n                    { new Guid(\"246c6a92-6fa1-4e12-8d28-a472a69cd127\"), 800L, 800L, new Guid(\"ba82b7b8-8337-49e2-b662-2fbbfce02657\"), 1200L },\n                    { new Guid(\"a8c94149-488a-480a-a10b-f3e8b06ffa4d\"), 800L, 800L, new Guid(\"ba82b7b8-8337-49e2-b662-2fbbfce02657\"), 1200L },\n                    { new Guid(\"d6819dde-0299-40b6-8680-a167a307f427\"), 800L, 800L, new Guid(\"ba82b7b8-8337-49e2-b662-2fbbfce02657\"), 1200L },\n                    { new Guid(\"40c1647d-c7d1-4323-9ee2-2acea4e6fa02\"), 800L, 800L, new Guid(\"ba82b7b8-8337-49e2-b662-2fbbfce02657\"), 1200L },\n                    { new Guid(\"1a18c4d9-49d5-4430-bad1-57ee786f0f43\"), 800L, 800L, new Guid(\"ba82b7b8-8337-49e2-b662-2fbbfce02657\"), 1200L },\n                    { new Guid(\"345e5cb4-fd5e-46e0-97de-709fd867bb02\"), 800L, 800L, new Guid(\"ba82b7b8-8337-49e2-b662-2fbbfce02657\"), 1200L },\n                    { new Guid(\"1c487f01-909d-4390-a43f-7fef5aa9dfa7\"), 800L, 800L, new Guid(\"ba82b7b8-8337-49e2-b662-2fbbfce02657\"), 1200L },\n                    { new Guid(\"6baa9f27-adf3-42cc-b62b-3699ba8d9e83\"), 800L, 800L, new Guid(\"052c61c2-4d54-43ee-b58e-81774c2bbd57\"), 1200L },\n                    { new Guid(\"c6f46302-75f0-4741-b047-e98567b4bfcb\"), 800L, 800L, new Guid(\"1f60e478-5f69-4821-ae97-9f13dba2386f\"), 1200L },\n                    { new Guid(\"86d9ddea-b3ea-45b2-a03f-8220dece715a\"), 800L, 800L, new Guid(\"052c61c2-4d54-43ee-b58e-81774c2bbd57\"), 1200L },\n                    { new Guid(\"a3836d87-21b3-4d76-b027-31432e5fc758\"), 800L, 800L, new Guid(\"e9ecdb7b-1397-4bc5-ad66-69f23d18128a\"), 1200L },\n                    { new Guid(\"ccaa532b-111a-4054-aeda-f649ef4b9ab7\"), 800L, 800L, new Guid(\"fad135c9-dfdc-4cb9-9ec2-85717c807e3e\"), 1200L },\n                    { new Guid(\"7d87fc12-7812-4203-858a-779c98154189\"), 800L, 800L, new Guid(\"fad135c9-dfdc-4cb9-9ec2-85717c807e3e\"), 1200L },\n                    { new Guid(\"3fa37c2e-5a29-421c-8b1b-9a3b018a8b1f\"), 800L, 800L, new Guid(\"fad135c9-dfdc-4cb9-9ec2-85717c807e3e\"), 1200L },\n                    { new Guid(\"a7d9c123-fac7-4944-a9ed-5692a79c3dcd\"), 800L, 800L, new Guid(\"fad135c9-dfdc-4cb9-9ec2-85717c807e3e\"), 1200L },\n                    { new Guid(\"e7aec9dc-8ccb-4055-8396-d12854490e50\"), 800L, 800L, new Guid(\"fad135c9-dfdc-4cb9-9ec2-85717c807e3e\"), 1200L },\n                    { new Guid(\"e1569d42-bbd4-4ac3-9096-3b4e58a75b1b\"), 800L, 800L, new Guid(\"fad135c9-dfdc-4cb9-9ec2-85717c807e3e\"), 1200L },\n                    { new Guid(\"2fce94fe-0f98-4a6b-b55a-fc5d88cf4049\"), 800L, 800L, new Guid(\"e9ecdb7b-1397-4bc5-ad66-69f23d18128a\"), 1200L },\n                    { new Guid(\"8a650447-1e22-4fd5-9f79-ff29e5674ed3\"), 800L, 800L, new Guid(\"e9ecdb7b-1397-4bc5-ad66-69f23d18128a\"), 1200L },\n                    { new Guid(\"02348077-17f6-4c88-8262-f67ab70eb270\"), 800L, 800L, new Guid(\"e9ecdb7b-1397-4bc5-ad66-69f23d18128a\"), 1200L },\n                    { new Guid(\"d56bf158-40c3-4e19-8627-d3c7babf9d30\"), 800L, 800L, new Guid(\"e9ecdb7b-1397-4bc5-ad66-69f23d18128a\"), 1200L },\n                    { new Guid(\"8c5f55e4-ee02-49a5-a734-96880855210b\"), 800L, 800L, new Guid(\"e9ecdb7b-1397-4bc5-ad66-69f23d18128a\"), 1200L },\n                    { new Guid(\"3cb8ebd2-bfbc-4eaa-8675-e98bfe9f02ea\"), 800L, 800L, new Guid(\"e9ecdb7b-1397-4bc5-ad66-69f23d18128a\"), 1200L },\n                    { new Guid(\"8f3863cb-e328-4265-8354-0755b52eea66\"), 800L, 800L, new Guid(\"e9ecdb7b-1397-4bc5-ad66-69f23d18128a\"), 1200L },\n                    { new Guid(\"7bbcf26f-90ce-4bca-a2fe-7268e54d6ebf\"), 800L, 800L, new Guid(\"e9ecdb7b-1397-4bc5-ad66-69f23d18128a\"), 1200L },\n                    { new Guid(\"85e13881-0563-4852-93e3-39174ad7ab37\"), 800L, 800L, new Guid(\"e9ecdb7b-1397-4bc5-ad66-69f23d18128a\"), 1200L },\n                    { new Guid(\"aba9067f-d21f-4cdb-891c-170734de8512\"), 800L, 800L, new Guid(\"052c61c2-4d54-43ee-b58e-81774c2bbd57\"), 1200L },\n                    { new Guid(\"622a7d83-2490-4d3d-b0f0-8624dc8edbc2\"), 800L, 800L, new Guid(\"ba82b7b8-8337-49e2-b662-2fbbfce02657\"), 1200L },\n                    { new Guid(\"043f231b-8515-4af5-ad1d-ade4b895b3b7\"), 800L, 800L, new Guid(\"1f60e478-5f69-4821-ae97-9f13dba2386f\"), 1200L },\n                    { new Guid(\"41f2f21b-f599-40ca-822d-78ceda51189c\"), 800L, 800L, new Guid(\"1f60e478-5f69-4821-ae97-9f13dba2386f\"), 1200L },\n                    { new Guid(\"a0136882-071a-4dc0-beee-cfd8fe464e01\"), 800L, 800L, new Guid(\"243abb4a-2484-42c7-9f01-5b4424040588\"), 1200L },\n                    { new Guid(\"95e736a1-b03e-42e3-aa65-ae2b76992cfb\"), 800L, 800L, new Guid(\"243abb4a-2484-42c7-9f01-5b4424040588\"), 1200L },\n                    { new Guid(\"5a1eeaf8-11bd-4596-8658-93dae9388cd8\"), 800L, 800L, new Guid(\"243abb4a-2484-42c7-9f01-5b4424040588\"), 1200L },\n                    { new Guid(\"d7279057-5863-4dc8-9be3-44cef094aaee\"), 800L, 800L, new Guid(\"243abb4a-2484-42c7-9f01-5b4424040588\"), 1200L },\n                    { new Guid(\"f25b0183-d53a-4926-96a1-3ad4315b022e\"), 800L, 800L, new Guid(\"243abb4a-2484-42c7-9f01-5b4424040588\"), 1200L },\n                    { new Guid(\"843695e6-56e4-4aac-af02-67dee0ec525f\"), 800L, 800L, new Guid(\"243abb4a-2484-42c7-9f01-5b4424040588\"), 1200L },\n                    { new Guid(\"74f13e2f-73fb-4969-a674-3e0fc1eada84\"), 800L, 800L, new Guid(\"243abb4a-2484-42c7-9f01-5b4424040588\"), 1200L },\n                    { new Guid(\"2a3a2ae6-d0e5-4ea9-8ddc-0af5fd1ed245\"), 800L, 800L, new Guid(\"243abb4a-2484-42c7-9f01-5b4424040588\"), 1200L },\n                    { new Guid(\"1535fd9e-ddc0-461b-a659-38deb8888bfe\"), 800L, 800L, new Guid(\"243abb4a-2484-42c7-9f01-5b4424040588\"), 1200L },\n                    { new Guid(\"853dd568-f9a0-4a98-8019-45a09335c380\"), 800L, 800L, new Guid(\"eb64d993-f585-4f8f-9480-de07d2279dd1\"), 1200L },\n                    { new Guid(\"a3733264-c532-48a6-82cd-e5223b2c8741\"), 800L, 800L, new Guid(\"eb64d993-f585-4f8f-9480-de07d2279dd1\"), 1200L },\n                    { new Guid(\"183f8ac3-15b5-4d68-9ccb-4fc95c8a31b1\"), 800L, 800L, new Guid(\"eb64d993-f585-4f8f-9480-de07d2279dd1\"), 1200L },\n                    { new Guid(\"7b5a8751-e25e-4236-accd-096f7cecf19a\"), 800L, 800L, new Guid(\"eb64d993-f585-4f8f-9480-de07d2279dd1\"), 1200L },\n                    { new Guid(\"f9beca4d-996f-421a-bc2d-1100a606e597\"), 800L, 800L, new Guid(\"eb64d993-f585-4f8f-9480-de07d2279dd1\"), 1200L },\n                    { new Guid(\"e9096192-8068-4bf8-96a1-688aed778987\"), 800L, 800L, new Guid(\"243abb4a-2484-42c7-9f01-5b4424040588\"), 1200L },\n                    { new Guid(\"9ca89b86-8934-467c-9f42-22133309a7a9\"), 800L, 800L, new Guid(\"4940168a-f090-4c68-bb13-ee1d0e642ea6\"), 1200L },\n                    { new Guid(\"ed3e2331-16b9-4cda-b46a-4522d8fb8c06\"), 800L, 800L, new Guid(\"4940168a-f090-4c68-bb13-ee1d0e642ea6\"), 1200L },\n                    { new Guid(\"4fe76c24-64e4-4fda-921d-3173d508c511\"), 800L, 800L, new Guid(\"4940168a-f090-4c68-bb13-ee1d0e642ea6\"), 1200L },\n                    { new Guid(\"1b5d2854-2d5e-4d3d-820f-225fd86b5243\"), 800L, 800L, new Guid(\"08b55c7c-3747-4025-9dd7-be155f2a54bb\"), 1200L },\n                    { new Guid(\"98b2444d-9dec-4595-bd53-06f3014ccda7\"), 800L, 800L, new Guid(\"08b55c7c-3747-4025-9dd7-be155f2a54bb\"), 1200L },\n                    { new Guid(\"13ae33cf-a77a-4dc4-87a2-4b24d8c6c943\"), 800L, 800L, new Guid(\"08b55c7c-3747-4025-9dd7-be155f2a54bb\"), 1200L },\n                    { new Guid(\"84a875a8-45ac-465c-94ed-68c12bf1df0b\"), 800L, 800L, new Guid(\"08b55c7c-3747-4025-9dd7-be155f2a54bb\"), 1200L },\n                    { new Guid(\"9195be9e-26e8-4b74-9f43-a02f5822848f\"), 800L, 800L, new Guid(\"08b55c7c-3747-4025-9dd7-be155f2a54bb\"), 1200L },\n                    { new Guid(\"d1027193-c60c-4a58-a78a-ffb628e79ef7\"), 800L, 800L, new Guid(\"08b55c7c-3747-4025-9dd7-be155f2a54bb\"), 1200L },\n                    { new Guid(\"b7832786-fa92-4d50-aba5-32626a6291e5\"), 800L, 800L, new Guid(\"08b55c7c-3747-4025-9dd7-be155f2a54bb\"), 1200L },\n                    { new Guid(\"657c51d8-7167-415c-af53-a7238ed65861\"), 800L, 800L, new Guid(\"08b55c7c-3747-4025-9dd7-be155f2a54bb\"), 1200L },\n                    { new Guid(\"95a41871-37d4-4768-9dc1-d0d9724f7f32\"), 800L, 800L, new Guid(\"4940168a-f090-4c68-bb13-ee1d0e642ea6\"), 1200L },\n                    { new Guid(\"0f436dfe-a28c-41bb-ba61-8ba6c0dbcd11\"), 800L, 800L, new Guid(\"4940168a-f090-4c68-bb13-ee1d0e642ea6\"), 1200L },\n                    { new Guid(\"3946b605-5d8b-4d7f-9692-41fef1d3c6fc\"), 800L, 800L, new Guid(\"4940168a-f090-4c68-bb13-ee1d0e642ea6\"), 1200L },\n                    { new Guid(\"af9904e5-9671-45df-9042-15c70a091251\"), 800L, 800L, new Guid(\"4940168a-f090-4c68-bb13-ee1d0e642ea6\"), 1200L },\n                    { new Guid(\"86442e95-b57f-4279-a5e2-97c59ec787ba\"), 800L, 800L, new Guid(\"4940168a-f090-4c68-bb13-ee1d0e642ea6\"), 1200L },\n                    { new Guid(\"a2b765fe-a72b-466c-8014-d7690fb7a2e3\"), 800L, 800L, new Guid(\"4940168a-f090-4c68-bb13-ee1d0e642ea6\"), 1200L },\n                    { new Guid(\"8158b790-e457-479f-b31f-71fa7340babb\"), 800L, 800L, new Guid(\"4940168a-f090-4c68-bb13-ee1d0e642ea6\"), 1200L },\n                    { new Guid(\"4e590fc5-7691-4198-acac-43bab02c33f9\"), 800L, 800L, new Guid(\"eb64d993-f585-4f8f-9480-de07d2279dd1\"), 1200L },\n                    { new Guid(\"c8b369ba-ffd3-43ba-b08a-c81f45b307fd\"), 800L, 800L, new Guid(\"eb64d993-f585-4f8f-9480-de07d2279dd1\"), 1200L },\n                    { new Guid(\"419ee2fa-275a-4ef8-bf95-36517291cb63\"), 800L, 800L, new Guid(\"eb64d993-f585-4f8f-9480-de07d2279dd1\"), 1200L },\n                    { new Guid(\"4bd5378d-bd35-4a33-8c23-95e5ec1cb7c5\"), 800L, 800L, new Guid(\"eb64d993-f585-4f8f-9480-de07d2279dd1\"), 1200L },\n                    { new Guid(\"0b600964-dd4c-4f41-b686-eea2ba254543\"), 800L, 800L, new Guid(\"618d021d-cb53-4d34-b590-88ebf1cb6ffb\"), 1200L },\n                    { new Guid(\"3ad9fe92-50d0-4df9-b648-6d903eca8916\"), 800L, 800L, new Guid(\"618d021d-cb53-4d34-b590-88ebf1cb6ffb\"), 1200L },\n                    { new Guid(\"6a35f0a9-68b1-48fd-83ba-dcbd7ac52097\"), 800L, 800L, new Guid(\"518ba58a-bec1-4754-b72a-0fcdc0513981\"), 1200L },\n                    { new Guid(\"8e2a6e72-0d2d-4f2b-b5e1-bd56a02b87d7\"), 800L, 800L, new Guid(\"518ba58a-bec1-4754-b72a-0fcdc0513981\"), 1200L },\n                    { new Guid(\"9776d720-09b0-473a-8972-df6b16cb09ac\"), 800L, 800L, new Guid(\"518ba58a-bec1-4754-b72a-0fcdc0513981\"), 1200L },\n                    { new Guid(\"cefc7e20-6c2c-42dc-9e20-9a11a64b754c\"), 800L, 800L, new Guid(\"518ba58a-bec1-4754-b72a-0fcdc0513981\"), 1200L },\n                    { new Guid(\"b1719b5f-0212-42b9-bbf5-81aef0e25892\"), 800L, 800L, new Guid(\"518ba58a-bec1-4754-b72a-0fcdc0513981\"), 1200L },\n                    { new Guid(\"8e05d53e-2888-4ffa-9401-fe732f3838d1\"), 800L, 800L, new Guid(\"518ba58a-bec1-4754-b72a-0fcdc0513981\"), 1200L },\n                    { new Guid(\"9decb4cf-d3f3-4177-a1ed-04e0c36fba0b\"), 800L, 800L, new Guid(\"518ba58a-bec1-4754-b72a-0fcdc0513981\"), 1200L },\n                    { new Guid(\"4bd3c96e-051c-44a6-8d2d-0f16e77d9f19\"), 800L, 800L, new Guid(\"518ba58a-bec1-4754-b72a-0fcdc0513981\"), 1200L },\n                    { new Guid(\"e847a173-7142-4393-8925-ccc6738e5e3a\"), 800L, 800L, new Guid(\"518ba58a-bec1-4754-b72a-0fcdc0513981\"), 1200L },\n                    { new Guid(\"790e043f-3dd8-4d6b-9caf-992f4b767fd5\"), 800L, 800L, new Guid(\"518ba58a-bec1-4754-b72a-0fcdc0513981\"), 1200L },\n                    { new Guid(\"b955679f-c1de-4c9f-af0e-b602cf730b0a\"), 800L, 800L, new Guid(\"1f60e478-5f69-4821-ae97-9f13dba2386f\"), 1200L },\n                    { new Guid(\"000aaf92-1996-40dc-ad63-62800ba9cf1e\"), 800L, 800L, new Guid(\"1f60e478-5f69-4821-ae97-9f13dba2386f\"), 1200L },\n                    { new Guid(\"0c4ded81-b68e-4f39-b37b-76372d76e59f\"), 800L, 800L, new Guid(\"1f60e478-5f69-4821-ae97-9f13dba2386f\"), 1200L },\n                    { new Guid(\"79a23324-168a-4c4c-b47b-38cd669066e6\"), 800L, 800L, new Guid(\"618d021d-cb53-4d34-b590-88ebf1cb6ffb\"), 1200L },\n                    { new Guid(\"0f49d651-9eda-46d1-9fc9-7f6f17f4f8f1\"), 800L, 800L, new Guid(\"1f60e478-5f69-4821-ae97-9f13dba2386f\"), 1200L },\n                    { new Guid(\"23618ebc-af2c-409b-8b64-411479b2e8c5\"), 800L, 800L, new Guid(\"618d021d-cb53-4d34-b590-88ebf1cb6ffb\"), 1200L },\n                    { new Guid(\"4d8c6cfb-b1c5-4620-850d-a592efdccd26\"), 800L, 800L, new Guid(\"618d021d-cb53-4d34-b590-88ebf1cb6ffb\"), 1200L },\n                    { new Guid(\"780914d8-58c2-4d5c-bc45-82f6045a5b9b\"), 800L, 800L, new Guid(\"eb64d993-f585-4f8f-9480-de07d2279dd1\"), 1200L },\n                    { new Guid(\"505a80d2-3c08-4aad-97d6-25433195130c\"), 800L, 800L, new Guid(\"abdda4b1-286c-4ed2-a311-3607f12e7311\"), 1200L },\n                    { new Guid(\"6161e1d5-26ce-4002-a35e-f3605d84cd6e\"), 800L, 800L, new Guid(\"abdda4b1-286c-4ed2-a311-3607f12e7311\"), 1200L },\n                    { new Guid(\"7547f8ae-f98b-4cae-aad7-8ef9c06f429e\"), 800L, 800L, new Guid(\"abdda4b1-286c-4ed2-a311-3607f12e7311\"), 1200L },\n                    { new Guid(\"0daea836-1b09-4cf0-8d39-81e52a0c5838\"), 800L, 800L, new Guid(\"abdda4b1-286c-4ed2-a311-3607f12e7311\"), 1200L },\n                    { new Guid(\"027f08ce-0ba4-4d7c-aeca-153a7053a421\"), 800L, 800L, new Guid(\"abdda4b1-286c-4ed2-a311-3607f12e7311\"), 1200L },\n                    { new Guid(\"c54c3aee-cf18-442e-b56f-4136677e2cb8\"), 800L, 800L, new Guid(\"abdda4b1-286c-4ed2-a311-3607f12e7311\"), 1200L },\n                    { new Guid(\"068c403a-5206-4a06-966f-9edd993f4704\"), 800L, 800L, new Guid(\"abdda4b1-286c-4ed2-a311-3607f12e7311\"), 1200L },\n                    { new Guid(\"2225dc05-31f1-459e-bacd-035b7bcb96b3\"), 800L, 800L, new Guid(\"abdda4b1-286c-4ed2-a311-3607f12e7311\"), 1200L },\n                    { new Guid(\"9e3dae9a-b4a8-4054-b57c-b1f405170d62\"), 800L, 800L, new Guid(\"abdda4b1-286c-4ed2-a311-3607f12e7311\"), 1200L },\n                    { new Guid(\"93129c1d-fe61-4781-ac40-2412084658f0\"), 800L, 800L, new Guid(\"abdda4b1-286c-4ed2-a311-3607f12e7311\"), 1200L },\n                    { new Guid(\"0e305a05-a706-47a5-b399-ba357e727d60\"), 800L, 800L, new Guid(\"618d021d-cb53-4d34-b590-88ebf1cb6ffb\"), 1200L },\n                    { new Guid(\"ff7ea0d4-c72c-46de-97da-4f782c80452a\"), 800L, 800L, new Guid(\"618d021d-cb53-4d34-b590-88ebf1cb6ffb\"), 1200L },\n                    { new Guid(\"2d30981b-01d9-4859-ba31-e80eed1e37df\"), 800L, 800L, new Guid(\"618d021d-cb53-4d34-b590-88ebf1cb6ffb\"), 1200L },\n                    { new Guid(\"5401efef-f18a-4f72-a45a-799b946d6fe9\"), 800L, 800L, new Guid(\"618d021d-cb53-4d34-b590-88ebf1cb6ffb\"), 1200L },\n                    { new Guid(\"a802f78d-0fc5-424e-8131-159504f253b6\"), 800L, 800L, new Guid(\"618d021d-cb53-4d34-b590-88ebf1cb6ffb\"), 1200L },\n                    { new Guid(\"243f5726-184e-4703-a97d-aa004d27f009\"), 800L, 800L, new Guid(\"08b55c7c-3747-4025-9dd7-be155f2a54bb\"), 1200L },\n                    { new Guid(\"33dcb15b-3afd-40b3-8f73-4b6109be3cfa\"), 800L, 800L, new Guid(\"ba82b7b8-8337-49e2-b662-2fbbfce02657\"), 1200L },\n                    { new Guid(\"768894b5-ef38-4aba-b048-b639a00ef828\"), 800L, 800L, new Guid(\"92f60038-40a0-461b-a607-13b906e941a9\"), 1200L },\n                    { new Guid(\"201fbe1f-8633-4594-9c1e-f0a9756f389a\"), 800L, 800L, new Guid(\"89b63ff3-1cc6-4d25-87b0-9b30da00827c\"), 1200L },\n                    { new Guid(\"e2ff7dbe-c278-44f6-a687-5787a73804b3\"), 800L, 800L, new Guid(\"89b63ff3-1cc6-4d25-87b0-9b30da00827c\"), 1200L },\n                    { new Guid(\"db26b691-c316-4590-856d-f45a795050a3\"), 800L, 800L, new Guid(\"89b63ff3-1cc6-4d25-87b0-9b30da00827c\"), 1200L },\n                    { new Guid(\"f732529d-7931-4655-ad2f-b00dafd2d752\"), 800L, 800L, new Guid(\"89b63ff3-1cc6-4d25-87b0-9b30da00827c\"), 1200L },\n                    { new Guid(\"01847324-bafa-4ac7-b4ca-ed3832b75c46\"), 800L, 800L, new Guid(\"6d2da389-f505-4506-b5b8-18d57d1fac52\"), 1200L },\n                    { new Guid(\"896922b5-6b1d-4b7d-9db0-1e4395fe7afe\"), 800L, 800L, new Guid(\"6d2da389-f505-4506-b5b8-18d57d1fac52\"), 1200L },\n                    { new Guid(\"3290dad9-a0d9-417e-867e-3376b83d4fe1\"), 800L, 800L, new Guid(\"89b63ff3-1cc6-4d25-87b0-9b30da00827c\"), 1200L },\n                    { new Guid(\"f1ddce41-a5c9-494d-bf4f-e61b6ebdd503\"), 800L, 800L, new Guid(\"6d2da389-f505-4506-b5b8-18d57d1fac52\"), 1200L },\n                    { new Guid(\"84cc241f-773e-4195-a00f-7c7eb8808fe0\"), 800L, 800L, new Guid(\"6d2da389-f505-4506-b5b8-18d57d1fac52\"), 1200L },\n                    { new Guid(\"b0237671-4564-4052-8e16-6a6761e65d45\"), 800L, 800L, new Guid(\"6d2da389-f505-4506-b5b8-18d57d1fac52\"), 1200L },\n                    { new Guid(\"d2183a74-6d58-4d54-b355-7bf8679aeb8e\"), 800L, 800L, new Guid(\"6d2da389-f505-4506-b5b8-18d57d1fac52\"), 1200L },\n                    { new Guid(\"7807c55f-090b-469b-9d7d-5102acee7f8c\"), 800L, 800L, new Guid(\"6d2da389-f505-4506-b5b8-18d57d1fac52\"), 1200L },\n                    { new Guid(\"526e3940-fcce-40a2-ac9d-21d3b24b00e2\"), 800L, 800L, new Guid(\"6d2da389-f505-4506-b5b8-18d57d1fac52\"), 1200L },\n                    { new Guid(\"99fd3cb2-7feb-405f-9587-e2897942617e\"), 800L, 800L, new Guid(\"6d2da389-f505-4506-b5b8-18d57d1fac52\"), 1200L },\n                    { new Guid(\"8eba2159-e158-4a6c-8a1e-5b4e9b85779a\"), 800L, 800L, new Guid(\"6d2da389-f505-4506-b5b8-18d57d1fac52\"), 1200L },\n                    { new Guid(\"a54a8f1e-48b2-403c-9b6c-f18e6615afbd\"), 800L, 800L, new Guid(\"89b63ff3-1cc6-4d25-87b0-9b30da00827c\"), 1200L },\n                    { new Guid(\"0da5b5b8-aa35-445c-b4e2-c0d28e671746\"), 800L, 800L, new Guid(\"89b63ff3-1cc6-4d25-87b0-9b30da00827c\"), 1200L },\n                    { new Guid(\"5ccffe0f-24c7-4ebc-8192-56302842cfbf\"), 800L, 800L, new Guid(\"89b63ff3-1cc6-4d25-87b0-9b30da00827c\"), 1200L },\n                    { new Guid(\"a205fac7-e202-460b-b0ed-3850a341875c\"), 800L, 800L, new Guid(\"f0f83453-5cc9-4e84-80be-10972a6d7d9c\"), 1200L },\n                    { new Guid(\"07cec7b6-3306-4b32-b54b-02412f687633\"), 800L, 800L, new Guid(\"f0f83453-5cc9-4e84-80be-10972a6d7d9c\"), 1200L },\n                    { new Guid(\"4c648425-2dcf-4851-99b6-569cfe5c85db\"), 800L, 800L, new Guid(\"f0f83453-5cc9-4e84-80be-10972a6d7d9c\"), 1200L },\n                    { new Guid(\"4f2cf7b6-0487-4016-9df7-b21a126de0bb\"), 800L, 800L, new Guid(\"e192b321-042f-47c8-b93a-16751e3e7653\"), 1200L },\n                    { new Guid(\"8e5983b2-a712-4710-969e-2428d1311bda\"), 800L, 800L, new Guid(\"e192b321-042f-47c8-b93a-16751e3e7653\"), 1200L },\n                    { new Guid(\"3bf82278-31bc-443a-8b15-2c091247c92b\"), 800L, 800L, new Guid(\"e192b321-042f-47c8-b93a-16751e3e7653\"), 1200L },\n                    { new Guid(\"34f0c534-0086-49e4-a147-bb6f4e74443b\"), 800L, 800L, new Guid(\"e192b321-042f-47c8-b93a-16751e3e7653\"), 1200L },\n                    { new Guid(\"d8b881aa-796f-4f19-bf31-4fc1d458a90d\"), 800L, 800L, new Guid(\"e192b321-042f-47c8-b93a-16751e3e7653\"), 1200L },\n                    { new Guid(\"edb2a09b-18e2-4f24-937d-9fac746b7ca1\"), 800L, 800L, new Guid(\"e192b321-042f-47c8-b93a-16751e3e7653\"), 1200L },\n                    { new Guid(\"9e8e764a-0a6f-48a2-b695-c67cc6a104dc\"), 800L, 800L, new Guid(\"e192b321-042f-47c8-b93a-16751e3e7653\"), 1200L },\n                    { new Guid(\"c8279faf-2cb2-43d9-8e65-6e7b7e29eda6\"), 800L, 800L, new Guid(\"e192b321-042f-47c8-b93a-16751e3e7653\"), 1200L },\n                    { new Guid(\"623071c4-696f-402d-bc1c-f9b9d8e2130d\"), 800L, 800L, new Guid(\"e192b321-042f-47c8-b93a-16751e3e7653\"), 1200L },\n                    { new Guid(\"7baaa456-5575-4340-b47d-88b87f31db29\"), 800L, 800L, new Guid(\"e192b321-042f-47c8-b93a-16751e3e7653\"), 1200L },\n                    { new Guid(\"a1e24af6-9721-45b6-928d-92385d95f466\"), 800L, 800L, new Guid(\"89b63ff3-1cc6-4d25-87b0-9b30da00827c\"), 1200L },\n                    { new Guid(\"2dd3f404-7c42-4bec-8507-ecbbc2c837df\"), 800L, 800L, new Guid(\"89b63ff3-1cc6-4d25-87b0-9b30da00827c\"), 1200L },\n                    { new Guid(\"7e3c0717-c8af-448e-9c07-2ede94df6fbb\"), 800L, 800L, new Guid(\"86b9bd13-ed73-4dac-87d7-95ee4dcebab9\"), 1200L },\n                    { new Guid(\"54b394d0-afb8-48bf-a290-2173a490107d\"), 800L, 800L, new Guid(\"86b9bd13-ed73-4dac-87d7-95ee4dcebab9\"), 1200L },\n                    { new Guid(\"bbecc29d-0d7f-4c80-ba58-a4efe557e9a5\"), 800L, 800L, new Guid(\"86b9bd13-ed73-4dac-87d7-95ee4dcebab9\"), 1200L },\n                    { new Guid(\"3fe5fc61-86a7-4b6b-ad6f-95dd1b459e42\"), 800L, 800L, new Guid(\"86b9bd13-ed73-4dac-87d7-95ee4dcebab9\"), 1200L },\n                    { new Guid(\"b303dc05-702b-4286-bde3-8ea6e3591e27\"), 800L, 800L, new Guid(\"58da385f-9bc7-4214-9298-5c4b6c179d57\"), 1200L },\n                    { new Guid(\"d92f08f7-838e-46bf-b873-76c1c0bd0cc9\"), 800L, 800L, new Guid(\"58da385f-9bc7-4214-9298-5c4b6c179d57\"), 1200L },\n                    { new Guid(\"a67540a2-11a9-43de-9592-232e5b274c91\"), 800L, 800L, new Guid(\"58da385f-9bc7-4214-9298-5c4b6c179d57\"), 1200L },\n                    { new Guid(\"26f4c570-76c8-4851-a8ee-1df8677add1e\"), 800L, 800L, new Guid(\"58da385f-9bc7-4214-9298-5c4b6c179d57\"), 1200L },\n                    { new Guid(\"f9e7d1bf-772d-4d9f-ad30-7fab8b1021ee\"), 800L, 800L, new Guid(\"58da385f-9bc7-4214-9298-5c4b6c179d57\"), 1200L },\n                    { new Guid(\"d43ee7da-84a4-4efd-98f4-a9dc42383660\"), 800L, 800L, new Guid(\"58da385f-9bc7-4214-9298-5c4b6c179d57\"), 1200L },\n                    { new Guid(\"1b015d8b-051c-43f0-b706-46aaff6396e9\"), 800L, 800L, new Guid(\"58da385f-9bc7-4214-9298-5c4b6c179d57\"), 1200L },\n                    { new Guid(\"cbe32f16-c20f-442d-9ed9-a8f88dd37f54\"), 800L, 800L, new Guid(\"1049a6d0-5614-4882-85da-66c120a8e3af\"), 1200L },\n                    { new Guid(\"60818c01-e76b-45d8-acf0-dc29114a79b0\"), 800L, 800L, new Guid(\"1049a6d0-5614-4882-85da-66c120a8e3af\"), 1200L },\n                    { new Guid(\"189d809d-0496-41dd-ac95-723ef14d4c5f\"), 800L, 800L, new Guid(\"1049a6d0-5614-4882-85da-66c120a8e3af\"), 1200L },\n                    { new Guid(\"e7054f82-7233-4bb4-9d76-513cb4749c30\"), 800L, 800L, new Guid(\"1049a6d0-5614-4882-85da-66c120a8e3af\"), 1200L },\n                    { new Guid(\"fa0ee461-1742-4c0b-89dd-25b3d48bf526\"), 800L, 800L, new Guid(\"1049a6d0-5614-4882-85da-66c120a8e3af\"), 1200L },\n                    { new Guid(\"f5f25cfb-1c95-4180-99c1-817cb06a82b1\"), 800L, 800L, new Guid(\"1049a6d0-5614-4882-85da-66c120a8e3af\"), 1200L },\n                    { new Guid(\"f8bad758-5837-4db2-88cb-fad39deb9779\"), 800L, 800L, new Guid(\"1049a6d0-5614-4882-85da-66c120a8e3af\"), 1200L },\n                    { new Guid(\"1030c263-c3f9-4dfd-b200-085b1135475c\"), 800L, 800L, new Guid(\"1049a6d0-5614-4882-85da-66c120a8e3af\"), 1200L },\n                    { new Guid(\"d8f0edb7-ea67-4059-b4e1-e6c6a9b3e5e0\"), 800L, 800L, new Guid(\"58da385f-9bc7-4214-9298-5c4b6c179d57\"), 1200L },\n                    { new Guid(\"a4eb01df-d3ee-499c-b4e4-6d6766dfaa89\"), 800L, 800L, new Guid(\"f0f83453-5cc9-4e84-80be-10972a6d7d9c\"), 1200L },\n                    { new Guid(\"77dd27e3-c146-4981-8155-a9dbf7f8c03c\"), 800L, 800L, new Guid(\"58da385f-9bc7-4214-9298-5c4b6c179d57\"), 1200L },\n                    { new Guid(\"26f13dc3-abeb-4b16-9e6a-95c6b24eb144\"), 800L, 800L, new Guid(\"6e2be310-4368-48fa-a18f-8c3b84bc195f\"), 1200L },\n                    { new Guid(\"19403607-a712-4cc6-8cc0-efe12e160407\"), 800L, 800L, new Guid(\"86b9bd13-ed73-4dac-87d7-95ee4dcebab9\"), 1200L },\n                    { new Guid(\"cb90611c-36d4-42b6-9293-9a35da28078a\"), 800L, 800L, new Guid(\"86b9bd13-ed73-4dac-87d7-95ee4dcebab9\"), 1200L },\n                    { new Guid(\"88ed0b63-d6c2-4bd3-a6c8-1ef2e9fb11d6\"), 800L, 800L, new Guid(\"86b9bd13-ed73-4dac-87d7-95ee4dcebab9\"), 1200L },\n                    { new Guid(\"01eaea33-366b-49d5-9390-318eead8b7ea\"), 800L, 800L, new Guid(\"86b9bd13-ed73-4dac-87d7-95ee4dcebab9\"), 1200L },\n                    { new Guid(\"472c4719-f9a6-41ed-a649-4ef67d79c3a5\"), 800L, 800L, new Guid(\"86b9bd13-ed73-4dac-87d7-95ee4dcebab9\"), 1200L },\n                    { new Guid(\"6bb4d3ed-52b8-4a0d-9311-2ae560df5111\"), 800L, 800L, new Guid(\"86b9bd13-ed73-4dac-87d7-95ee4dcebab9\"), 1200L },\n                    { new Guid(\"880c401f-2baf-4c80-9264-300d5925862f\"), 800L, 800L, new Guid(\"6e2be310-4368-48fa-a18f-8c3b84bc195f\"), 1200L },\n                    { new Guid(\"b3cc7f49-01c8-4f43-ad18-8fa0911587ad\"), 800L, 800L, new Guid(\"6e2be310-4368-48fa-a18f-8c3b84bc195f\"), 1200L },\n                    { new Guid(\"192411f3-dbba-4d92-90fa-b1453894177c\"), 800L, 800L, new Guid(\"6e2be310-4368-48fa-a18f-8c3b84bc195f\"), 1200L },\n                    { new Guid(\"c4ed53cb-6802-4364-b0d8-ad616671abe3\"), 800L, 800L, new Guid(\"6e2be310-4368-48fa-a18f-8c3b84bc195f\"), 1200L },\n                    { new Guid(\"cb84e983-666c-44d5-b47f-da2f97ab70d0\"), 800L, 800L, new Guid(\"6e2be310-4368-48fa-a18f-8c3b84bc195f\"), 1200L },\n                    { new Guid(\"ba8309ed-15c3-4d8f-b402-e174ad6af263\"), 800L, 800L, new Guid(\"6e2be310-4368-48fa-a18f-8c3b84bc195f\"), 1200L },\n                    { new Guid(\"bc0ff59d-cd4b-4b6e-9de3-68be1324d00e\"), 800L, 800L, new Guid(\"6e2be310-4368-48fa-a18f-8c3b84bc195f\"), 1200L },\n                    { new Guid(\"2e579e98-6d5a-47e7-8365-2f60a4449da5\"), 800L, 800L, new Guid(\"6e2be310-4368-48fa-a18f-8c3b84bc195f\"), 1200L },\n                    { new Guid(\"aeea7699-d190-460b-bfc5-3f58c48308af\"), 800L, 800L, new Guid(\"6e2be310-4368-48fa-a18f-8c3b84bc195f\"), 1200L },\n                    { new Guid(\"0d36915f-a08a-437b-9bbf-f8565ca43168\"), 800L, 800L, new Guid(\"58da385f-9bc7-4214-9298-5c4b6c179d57\"), 1200L },\n                    { new Guid(\"0b8241f4-709a-4950-b82d-b072e4737d36\"), 800L, 800L, new Guid(\"92f60038-40a0-461b-a607-13b906e941a9\"), 1200L },\n                    { new Guid(\"54134257-8b1e-4ec0-ad00-73858582772b\"), 800L, 800L, new Guid(\"f0f83453-5cc9-4e84-80be-10972a6d7d9c\"), 1200L },\n                    { new Guid(\"04fcc1d5-3b8a-4ee0-b9b3-69515db3f166\"), 800L, 800L, new Guid(\"f0f83453-5cc9-4e84-80be-10972a6d7d9c\"), 1200L },\n                    { new Guid(\"09237feb-1c5a-4631-a109-837af84a63cf\"), 800L, 800L, new Guid(\"ed1dfa48-d0fb-40ce-92d6-1bd33f571414\"), 1200L },\n                    { new Guid(\"367ac193-c74c-4edf-8815-8ea29c070009\"), 800L, 800L, new Guid(\"ed1dfa48-d0fb-40ce-92d6-1bd33f571414\"), 1200L },\n                    { new Guid(\"e964ab43-5ed2-41b0-84d3-d41c9d61c635\"), 800L, 800L, new Guid(\"ed1dfa48-d0fb-40ce-92d6-1bd33f571414\"), 1200L },\n                    { new Guid(\"32b6007c-6d7f-4524-9543-c5e96a21fb1b\"), 800L, 800L, new Guid(\"ed1dfa48-d0fb-40ce-92d6-1bd33f571414\"), 1200L },\n                    { new Guid(\"89a15257-693d-41a3-bbf7-5933984b4e27\"), 800L, 800L, new Guid(\"ed1dfa48-d0fb-40ce-92d6-1bd33f571414\"), 1200L },\n                    { new Guid(\"f8ae0630-82a2-42bf-9c9c-38da4ec3886c\"), 800L, 800L, new Guid(\"ed1dfa48-d0fb-40ce-92d6-1bd33f571414\"), 1200L },\n                    { new Guid(\"be2c83f9-063a-4d3e-9eae-463fa767e55d\"), 800L, 800L, new Guid(\"ed1dfa48-d0fb-40ce-92d6-1bd33f571414\"), 1200L },\n                    { new Guid(\"ef2e999a-92f8-4bdb-99f2-1342aa7551ac\"), 800L, 800L, new Guid(\"ed1dfa48-d0fb-40ce-92d6-1bd33f571414\"), 1200L },\n                    { new Guid(\"0a4d63b9-0d7c-46c3-8aff-91b4fe3265b1\"), 800L, 800L, new Guid(\"ed1dfa48-d0fb-40ce-92d6-1bd33f571414\"), 1200L },\n                    { new Guid(\"a6f908a5-1d80-459a-8dcb-d08a2a7e5e99\"), 800L, 800L, new Guid(\"fa9f084a-7646-4690-9367-9c0d524c8411\"), 1200L },\n                    { new Guid(\"8de1196c-305d-4bbe-b40f-6c6c831b1e4d\"), 800L, 800L, new Guid(\"fa9f084a-7646-4690-9367-9c0d524c8411\"), 1200L },\n                    { new Guid(\"725792da-2502-410f-9ead-c7fe159c0278\"), 800L, 800L, new Guid(\"fa9f084a-7646-4690-9367-9c0d524c8411\"), 1200L },\n                    { new Guid(\"e6ff91c5-b45c-419b-80f8-6d274d72feda\"), 800L, 800L, new Guid(\"fa9f084a-7646-4690-9367-9c0d524c8411\"), 1200L },\n                    { new Guid(\"a476185a-7db2-47f8-9048-0c64421e0336\"), 800L, 800L, new Guid(\"fa9f084a-7646-4690-9367-9c0d524c8411\"), 1200L },\n                    { new Guid(\"bfef67ef-0a86-4c63-9e53-3261a5c5e893\"), 800L, 800L, new Guid(\"ed1dfa48-d0fb-40ce-92d6-1bd33f571414\"), 1200L },\n                    { new Guid(\"728eca45-de9a-4a25-a3bc-e0107cc7adce\"), 800L, 800L, new Guid(\"7da472a1-651c-44a2-99f2-ce52f86c1d13\"), 1200L },\n                    { new Guid(\"e10983bd-677a-4c30-a625-9ac327f10b19\"), 800L, 800L, new Guid(\"7da472a1-651c-44a2-99f2-ce52f86c1d13\"), 1200L },\n                    { new Guid(\"9a4da83b-1f1b-4be9-9af5-f169fae639d1\"), 800L, 800L, new Guid(\"7da472a1-651c-44a2-99f2-ce52f86c1d13\"), 1200L },\n                    { new Guid(\"d6977daa-ed7e-4bff-ab87-c3073ade4516\"), 800L, 800L, new Guid(\"92f60038-40a0-461b-a607-13b906e941a9\"), 1200L },\n                    { new Guid(\"34cade20-c799-495d-b95a-93aff4f22d84\"), 800L, 800L, new Guid(\"92f60038-40a0-461b-a607-13b906e941a9\"), 1200L },\n                    { new Guid(\"b30cf582-88bf-4dde-897c-725714cf4d1a\"), 800L, 800L, new Guid(\"92f60038-40a0-461b-a607-13b906e941a9\"), 1200L },\n                    { new Guid(\"b856656d-4dff-489e-96ae-566f4dbb3b61\"), 800L, 800L, new Guid(\"92f60038-40a0-461b-a607-13b906e941a9\"), 1200L },\n                    { new Guid(\"0a507f1e-3a73-4fb1-ad69-1fda752e8032\"), 800L, 800L, new Guid(\"92f60038-40a0-461b-a607-13b906e941a9\"), 1200L },\n                    { new Guid(\"fd9c00fe-cb56-4fec-8285-cffadabe75b6\"), 800L, 800L, new Guid(\"92f60038-40a0-461b-a607-13b906e941a9\"), 1200L },\n                    { new Guid(\"6e606718-6c7a-43a7-95ec-99819aa1134f\"), 800L, 800L, new Guid(\"92f60038-40a0-461b-a607-13b906e941a9\"), 1200L },\n                    { new Guid(\"3e5f0488-93cc-4b08-9e9d-295b769eb4a4\"), 800L, 800L, new Guid(\"92f60038-40a0-461b-a607-13b906e941a9\"), 1200L },\n                    { new Guid(\"b9c4da21-1644-4c98-b810-2e25b96d42a3\"), 800L, 800L, new Guid(\"7da472a1-651c-44a2-99f2-ce52f86c1d13\"), 1200L },\n                    { new Guid(\"5923ebd5-7deb-442f-bb55-253476141e37\"), 800L, 800L, new Guid(\"7da472a1-651c-44a2-99f2-ce52f86c1d13\"), 1200L },\n                    { new Guid(\"204b404a-e07e-4e20-9840-f113e238550e\"), 800L, 800L, new Guid(\"7da472a1-651c-44a2-99f2-ce52f86c1d13\"), 1200L },\n                    { new Guid(\"e76d5242-0494-4a60-b41c-41d3b0c5a03f\"), 800L, 800L, new Guid(\"7da472a1-651c-44a2-99f2-ce52f86c1d13\"), 1200L },\n                    { new Guid(\"9b40d552-2567-4896-92bc-a4a3034bcaf4\"), 800L, 800L, new Guid(\"7da472a1-651c-44a2-99f2-ce52f86c1d13\"), 1200L },\n                    { new Guid(\"aef2a1f2-50b6-4dff-8986-7ce9f3c6ca85\"), 800L, 800L, new Guid(\"7da472a1-651c-44a2-99f2-ce52f86c1d13\"), 1200L },\n                    { new Guid(\"a2251a91-4b06-4ada-a043-eefc9cb070fd\"), 800L, 800L, new Guid(\"7da472a1-651c-44a2-99f2-ce52f86c1d13\"), 1200L },\n                    { new Guid(\"6f74c404-63eb-48be-8518-643ed601c5e4\"), 800L, 800L, new Guid(\"fa9f084a-7646-4690-9367-9c0d524c8411\"), 1200L },\n                    { new Guid(\"d6907cf7-998e-4cb5-9141-fba1cfd8ec38\"), 800L, 800L, new Guid(\"fa9f084a-7646-4690-9367-9c0d524c8411\"), 1200L },\n                    { new Guid(\"17f65175-50bc-43e0-a30b-0c83b7c5143e\"), 800L, 800L, new Guid(\"fa9f084a-7646-4690-9367-9c0d524c8411\"), 1200L },\n                    { new Guid(\"490f076a-3c5d-45b4-a106-a79d2f1338b6\"), 800L, 800L, new Guid(\"fa9f084a-7646-4690-9367-9c0d524c8411\"), 1200L },\n                    { new Guid(\"1cac563e-4924-424d-b363-0cf0ec9d9c30\"), 800L, 800L, new Guid(\"ade7f113-3cb6-4404-997d-3037a5b5897a\"), 1200L },\n                    { new Guid(\"38e05a0b-84c3-4726-b588-d2200699a32d\"), 800L, 800L, new Guid(\"ade7f113-3cb6-4404-997d-3037a5b5897a\"), 1200L },\n                    { new Guid(\"8c394487-cf3e-4b85-b614-aead5b34ba6c\"), 800L, 800L, new Guid(\"62ca507a-1154-4227-918b-e4ff472c6279\"), 1200L },\n                    { new Guid(\"dac22f2b-4c4a-4786-b91e-3d9bfea7f225\"), 800L, 800L, new Guid(\"62ca507a-1154-4227-918b-e4ff472c6279\"), 1200L },\n                    { new Guid(\"da7b22c7-9738-44f5-a385-b1e8f5a85d4a\"), 800L, 800L, new Guid(\"62ca507a-1154-4227-918b-e4ff472c6279\"), 1200L },\n                    { new Guid(\"ef7ea7c5-685f-472e-8460-04a09e7d70cc\"), 800L, 800L, new Guid(\"62ca507a-1154-4227-918b-e4ff472c6279\"), 1200L },\n                    { new Guid(\"3524cd22-b771-48e0-ba54-a5dd660edc72\"), 800L, 800L, new Guid(\"62ca507a-1154-4227-918b-e4ff472c6279\"), 1200L },\n                    { new Guid(\"c51dd9b6-e07f-4f74-89e0-60f76d25eca4\"), 800L, 800L, new Guid(\"62ca507a-1154-4227-918b-e4ff472c6279\"), 1200L },\n                    { new Guid(\"94527a6a-e91f-427d-be57-546df759ecb9\"), 800L, 800L, new Guid(\"62ca507a-1154-4227-918b-e4ff472c6279\"), 1200L },\n                    { new Guid(\"af8d92ba-03b5-4de9-9913-9ab4b78e2468\"), 800L, 800L, new Guid(\"62ca507a-1154-4227-918b-e4ff472c6279\"), 1200L },\n                    { new Guid(\"f9206b06-d301-4847-a4e6-646df2b77c98\"), 800L, 800L, new Guid(\"62ca507a-1154-4227-918b-e4ff472c6279\"), 1200L },\n                    { new Guid(\"9741b3c8-4411-4c7f-bb8d-058c959a8377\"), 800L, 800L, new Guid(\"62ca507a-1154-4227-918b-e4ff472c6279\"), 1200L },\n                    { new Guid(\"5da78ef4-75cd-4606-ae91-08cc3619908b\"), 800L, 800L, new Guid(\"f0f83453-5cc9-4e84-80be-10972a6d7d9c\"), 1200L },\n                    { new Guid(\"93e97edc-86ad-4ec2-83e9-dff313ba41fa\"), 800L, 800L, new Guid(\"f0f83453-5cc9-4e84-80be-10972a6d7d9c\"), 1200L },\n                    { new Guid(\"799e0e70-eddb-465d-99c2-ff01c2651cf9\"), 800L, 800L, new Guid(\"f0f83453-5cc9-4e84-80be-10972a6d7d9c\"), 1200L },\n                    { new Guid(\"e9976878-6ae0-4e7c-8b01-1d500210619c\"), 800L, 800L, new Guid(\"ade7f113-3cb6-4404-997d-3037a5b5897a\"), 1200L },\n                    { new Guid(\"3f4d97d5-92ad-4f6f-a206-794cdd5f7cc4\"), 800L, 800L, new Guid(\"f0f83453-5cc9-4e84-80be-10972a6d7d9c\"), 1200L },\n                    { new Guid(\"cc30c1e9-66f2-4199-b124-428b39eb9ced\"), 800L, 800L, new Guid(\"ade7f113-3cb6-4404-997d-3037a5b5897a\"), 1200L },\n                    { new Guid(\"6d0facf2-7f84-4daf-b040-2b5aa00d8304\"), 800L, 800L, new Guid(\"ade7f113-3cb6-4404-997d-3037a5b5897a\"), 1200L },\n                    { new Guid(\"4cf3cce3-768a-4c6b-8fbf-098c87a076e0\"), 800L, 800L, new Guid(\"fa9f084a-7646-4690-9367-9c0d524c8411\"), 1200L },\n                    { new Guid(\"17d30b06-d1f1-4165-9a43-5d3caf1c2031\"), 800L, 800L, new Guid(\"7a630a52-70cb-4ea6-ab49-dc81b867fe20\"), 1200L },\n                    { new Guid(\"04f4685c-a938-4810-bdbf-c4e81be20486\"), 800L, 800L, new Guid(\"7a630a52-70cb-4ea6-ab49-dc81b867fe20\"), 1200L },\n                    { new Guid(\"4b5a9735-d298-4ac1-a71d-46dacba09bbe\"), 800L, 800L, new Guid(\"7a630a52-70cb-4ea6-ab49-dc81b867fe20\"), 1200L },\n                    { new Guid(\"d3d82a59-cf37-4270-ae7d-ca31f15dcad6\"), 800L, 800L, new Guid(\"7a630a52-70cb-4ea6-ab49-dc81b867fe20\"), 1200L },\n                    { new Guid(\"f0b85d79-c774-481f-ad35-bf5d21326afa\"), 800L, 800L, new Guid(\"7a630a52-70cb-4ea6-ab49-dc81b867fe20\"), 1200L },\n                    { new Guid(\"a8fadded-ad3e-4d59-b671-ee213fb8f92b\"), 800L, 800L, new Guid(\"7a630a52-70cb-4ea6-ab49-dc81b867fe20\"), 1200L },\n                    { new Guid(\"549353f2-9e73-411f-b7b7-dde646e45dc3\"), 800L, 800L, new Guid(\"7a630a52-70cb-4ea6-ab49-dc81b867fe20\"), 1200L },\n                    { new Guid(\"53bf0528-ecaa-4330-b6f4-42a89a45d51f\"), 800L, 800L, new Guid(\"7a630a52-70cb-4ea6-ab49-dc81b867fe20\"), 1200L },\n                    { new Guid(\"ce14bc4b-bbad-4667-b0dc-d1070e252251\"), 800L, 800L, new Guid(\"7a630a52-70cb-4ea6-ab49-dc81b867fe20\"), 1200L },\n                    { new Guid(\"76d7446c-b1b8-4636-bf03-b46c5076c1c0\"), 800L, 800L, new Guid(\"7a630a52-70cb-4ea6-ab49-dc81b867fe20\"), 1200L },\n                    { new Guid(\"e7660d39-4497-4b94-9a41-e36928d3525b\"), 800L, 800L, new Guid(\"ade7f113-3cb6-4404-997d-3037a5b5897a\"), 1200L },\n                    { new Guid(\"e4fa0493-edfb-4dc6-866f-f2b85e169661\"), 800L, 800L, new Guid(\"ade7f113-3cb6-4404-997d-3037a5b5897a\"), 1200L },\n                    { new Guid(\"0aa3747d-ce07-45cd-9372-02c2a4929572\"), 800L, 800L, new Guid(\"ade7f113-3cb6-4404-997d-3037a5b5897a\"), 1200L },\n                    { new Guid(\"cfc4a690-aafc-45b9-bfa7-9008a6c0acd8\"), 800L, 800L, new Guid(\"ade7f113-3cb6-4404-997d-3037a5b5897a\"), 1200L },\n                    { new Guid(\"238466fe-5760-418a-a41b-e0cb634f3e47\"), 800L, 800L, new Guid(\"ade7f113-3cb6-4404-997d-3037a5b5897a\"), 1200L },\n                    { new Guid(\"b66c153a-776b-4b19-aa19-50a3710d53b6\"), 800L, 800L, new Guid(\"08b55c7c-3747-4025-9dd7-be155f2a54bb\"), 1200L },\n                    { new Guid(\"610fb97b-7f0c-46d2-86c6-f50010d51a71\"), 800L, 800L, new Guid(\"379a8126-faa5-4cfc-98da-97b344454d69\"), 1200L },\n                    { new Guid(\"de6d8cdf-854e-44e6-9a8a-b83e9309e3c8\"), 800L, 800L, new Guid(\"379a8126-faa5-4cfc-98da-97b344454d69\"), 1200L },\n                    { new Guid(\"b0b08931-a20b-4202-98b2-3748f3186e89\"), 800L, 800L, new Guid(\"584873d3-111a-4080-a371-c4fc859aa208\"), 1200L },\n                    { new Guid(\"dff4d4b7-095c-4be8-ac9b-8f1ff32e8556\"), 800L, 800L, new Guid(\"584873d3-111a-4080-a371-c4fc859aa208\"), 1200L },\n                    { new Guid(\"15b5120a-b935-4f20-b5ae-718baf36a8f6\"), 800L, 800L, new Guid(\"584873d3-111a-4080-a371-c4fc859aa208\"), 1200L },\n                    { new Guid(\"f97a94fd-98b1-44d1-a7d7-d6d8bf9b8695\"), 800L, 800L, new Guid(\"584873d3-111a-4080-a371-c4fc859aa208\"), 1200L },\n                    { new Guid(\"c85e5948-429e-44eb-be6e-57a30ba2d944\"), 800L, 800L, new Guid(\"584873d3-111a-4080-a371-c4fc859aa208\"), 1200L },\n                    { new Guid(\"70166460-04cd-4356-ba2c-f267f3733fe7\"), 800L, 800L, new Guid(\"3631a8b1-15f8-40b0-abe4-f932eb3aa4c6\"), 1200L },\n                    { new Guid(\"d35fcb6e-2809-41bd-b289-730304ddf85c\"), 800L, 800L, new Guid(\"584873d3-111a-4080-a371-c4fc859aa208\"), 1200L },\n                    { new Guid(\"1f3c824b-e840-4aaa-b620-84e1c3b2d3c4\"), 800L, 800L, new Guid(\"3631a8b1-15f8-40b0-abe4-f932eb3aa4c6\"), 1200L },\n                    { new Guid(\"54be9611-f993-427a-b6a9-ec370067f173\"), 800L, 800L, new Guid(\"3631a8b1-15f8-40b0-abe4-f932eb3aa4c6\"), 1200L },\n                    { new Guid(\"e3f77547-42dc-469e-9b5d-36afcbbbc679\"), 800L, 800L, new Guid(\"3631a8b1-15f8-40b0-abe4-f932eb3aa4c6\"), 1200L },\n                    { new Guid(\"cba9735c-2c6f-458a-adff-14187a3daf27\"), 800L, 800L, new Guid(\"3631a8b1-15f8-40b0-abe4-f932eb3aa4c6\"), 1200L },\n                    { new Guid(\"5f8a4ab2-c558-4ab3-b471-f2cdf36fc5bb\"), 800L, 800L, new Guid(\"3631a8b1-15f8-40b0-abe4-f932eb3aa4c6\"), 1200L },\n                    { new Guid(\"28be7546-2ec4-4380-b3a8-6fd5c7984dbd\"), 800L, 800L, new Guid(\"3631a8b1-15f8-40b0-abe4-f932eb3aa4c6\"), 1200L },\n                    { new Guid(\"d0bd1bfa-30db-4941-9578-15c7b51c1a06\"), 800L, 800L, new Guid(\"3631a8b1-15f8-40b0-abe4-f932eb3aa4c6\"), 1200L },\n                    { new Guid(\"4c57620b-af71-4e15-90dd-b5b92b1204f4\"), 800L, 800L, new Guid(\"3631a8b1-15f8-40b0-abe4-f932eb3aa4c6\"), 1200L },\n                    { new Guid(\"cab12b1a-48fc-4d06-b1ea-13b125f50029\"), 800L, 800L, new Guid(\"584873d3-111a-4080-a371-c4fc859aa208\"), 1200L },\n                    { new Guid(\"9809e0ac-ec91-47a3-9663-23ac5566ea15\"), 800L, 800L, new Guid(\"584873d3-111a-4080-a371-c4fc859aa208\"), 1200L },\n                    { new Guid(\"a77a53ea-822b-459c-9a30-0adcde7db3a2\"), 800L, 800L, new Guid(\"584873d3-111a-4080-a371-c4fc859aa208\"), 1200L },\n                    { new Guid(\"3dd4f8fb-1593-42f1-8dea-f2136f7ae3fb\"), 800L, 800L, new Guid(\"a10bd662-2917-4b71-a8bd-147061e8dfc8\"), 1200L },\n                    { new Guid(\"4d4c242d-362a-4d3a-8dfa-25f55c4ff26c\"), 800L, 800L, new Guid(\"a10bd662-2917-4b71-a8bd-147061e8dfc8\"), 1200L },\n                    { new Guid(\"cf6acfbb-843d-4fed-a64f-0b1870e029d3\"), 800L, 800L, new Guid(\"a10bd662-2917-4b71-a8bd-147061e8dfc8\"), 1200L },\n                    { new Guid(\"21f8961d-25d1-4542-aae7-55263446cfbb\"), 800L, 800L, new Guid(\"a10bd662-2917-4b71-a8bd-147061e8dfc8\"), 1200L },\n                    { new Guid(\"11a3f1c6-bf8a-45ca-8309-ad1193efa42c\"), 800L, 800L, new Guid(\"87dec986-250e-492f-b742-72ac264ab058\"), 1200L },\n                    { new Guid(\"7d9868ae-f929-490d-865f-762b80c90d68\"), 800L, 800L, new Guid(\"87dec986-250e-492f-b742-72ac264ab058\"), 1200L },\n                    { new Guid(\"f0b7724e-184d-4ddf-8779-7f9f20196230\"), 800L, 800L, new Guid(\"87dec986-250e-492f-b742-72ac264ab058\"), 1200L },\n                    { new Guid(\"e53d54c9-7b73-4da2-ac93-33482981b7c5\"), 800L, 800L, new Guid(\"87dec986-250e-492f-b742-72ac264ab058\"), 1200L },\n                    { new Guid(\"34bc0e8c-b892-49f4-bf51-f2c5f615f18f\"), 800L, 800L, new Guid(\"87dec986-250e-492f-b742-72ac264ab058\"), 1200L },\n                    { new Guid(\"8bdfd6ac-311a-4b43-9cdb-94a1d2125988\"), 800L, 800L, new Guid(\"87dec986-250e-492f-b742-72ac264ab058\"), 1200L },\n                    { new Guid(\"56f42a94-8676-4f23-ae53-58295484f8df\"), 800L, 800L, new Guid(\"87dec986-250e-492f-b742-72ac264ab058\"), 1200L },\n                    { new Guid(\"9094d8b0-ca84-452f-8079-6fcc4b99d491\"), 800L, 800L, new Guid(\"87dec986-250e-492f-b742-72ac264ab058\"), 1200L },\n                    { new Guid(\"8a74bdd8-ab10-42f0-a98e-7b1046ca046f\"), 800L, 800L, new Guid(\"87dec986-250e-492f-b742-72ac264ab058\"), 1200L },\n                    { new Guid(\"713b15b9-eaf3-4be9-bca5-350a90ac8cf8\"), 800L, 800L, new Guid(\"87dec986-250e-492f-b742-72ac264ab058\"), 1200L },\n                    { new Guid(\"212e06d2-c263-4ec3-b146-cab6b9208053\"), 800L, 800L, new Guid(\"584873d3-111a-4080-a371-c4fc859aa208\"), 1200L },\n                    { new Guid(\"1443fca5-b517-4a75-a4cd-c07e8452a46a\"), 800L, 800L, new Guid(\"3631a8b1-15f8-40b0-abe4-f932eb3aa4c6\"), 1200L },\n                    { new Guid(\"2df9f3bd-9fca-40f9-ae19-5b12f9759b9f\"), 800L, 800L, new Guid(\"2a4ef2c2-ae16-4517-91b0-3160406e297f\"), 1200L },\n                    { new Guid(\"89bbd6cb-4e7d-411e-b6a9-8319fd8f5e2b\"), 800L, 800L, new Guid(\"2a4ef2c2-ae16-4517-91b0-3160406e297f\"), 1200L },\n                    { new Guid(\"28368802-fb18-4f9e-a472-0fffcefcdfae\"), 800L, 800L, new Guid(\"2a4ef2c2-ae16-4517-91b0-3160406e297f\"), 1200L },\n                    { new Guid(\"082438e7-027b-446a-91a8-0ca0c008bd81\"), 800L, 800L, new Guid(\"6bd24c6e-017b-4802-8b4d-f7188d9449dc\"), 1200L },\n                    { new Guid(\"c35636a2-da70-4343-9377-5508485ebee0\"), 800L, 800L, new Guid(\"6bd24c6e-017b-4802-8b4d-f7188d9449dc\"), 1200L },\n                    { new Guid(\"0e4190b7-44e1-49f4-a7ba-41559b0fb3b9\"), 800L, 800L, new Guid(\"6bd24c6e-017b-4802-8b4d-f7188d9449dc\"), 1200L },\n                    { new Guid(\"223813aa-3b47-4f1b-af2b-913547b81ce0\"), 800L, 800L, new Guid(\"6bd24c6e-017b-4802-8b4d-f7188d9449dc\"), 1200L },\n                    { new Guid(\"51728e44-2a5c-493f-afdb-18a6c2128a69\"), 800L, 800L, new Guid(\"6bd24c6e-017b-4802-8b4d-f7188d9449dc\"), 1200L },\n                    { new Guid(\"335f738e-7364-4059-9e84-312623f35083\"), 800L, 800L, new Guid(\"6bd24c6e-017b-4802-8b4d-f7188d9449dc\"), 1200L },\n                    { new Guid(\"1c401f96-c8f6-4b84-a8bc-221f7ed9ed37\"), 800L, 800L, new Guid(\"6bd24c6e-017b-4802-8b4d-f7188d9449dc\"), 1200L },\n                    { new Guid(\"e501b293-b63e-401e-bd12-1e4712b76aae\"), 800L, 800L, new Guid(\"6bd24c6e-017b-4802-8b4d-f7188d9449dc\"), 1200L },\n                    { new Guid(\"917e7e76-82a8-4080-aac2-980f4e3eef18\"), 800L, 800L, new Guid(\"97ffbac8-4288-4a7b-877e-4041ed1d3c7d\"), 1200L },\n                    { new Guid(\"414b6a72-35e4-4781-ba34-f0e72b776a51\"), 800L, 800L, new Guid(\"97ffbac8-4288-4a7b-877e-4041ed1d3c7d\"), 1200L },\n                    { new Guid(\"b4f30fd4-c14d-4577-a6df-1b492fd15443\"), 800L, 800L, new Guid(\"97ffbac8-4288-4a7b-877e-4041ed1d3c7d\"), 1200L },\n                    { new Guid(\"2ce346f0-113c-49b9-82e6-aea800a8dd56\"), 800L, 800L, new Guid(\"97ffbac8-4288-4a7b-877e-4041ed1d3c7d\"), 1200L },\n                    { new Guid(\"a3e7f99d-11cb-4896-8ff5-84716e01feab\"), 800L, 800L, new Guid(\"97ffbac8-4288-4a7b-877e-4041ed1d3c7d\"), 1200L },\n                    { new Guid(\"4c3ea7dd-dce0-4e1a-858e-a1e2cfda654f\"), 800L, 800L, new Guid(\"97ffbac8-4288-4a7b-877e-4041ed1d3c7d\"), 1200L },\n                    { new Guid(\"0612a7d1-e6c9-4508-b0a4-04895b91775c\"), 800L, 800L, new Guid(\"97ffbac8-4288-4a7b-877e-4041ed1d3c7d\"), 1200L },\n                    { new Guid(\"5da3dadd-f733-4c26-902b-f6895ba65e81\"), 800L, 800L, new Guid(\"6bd24c6e-017b-4802-8b4d-f7188d9449dc\"), 1200L },\n                    { new Guid(\"32970c13-8e02-4899-aa5c-8498176ea8ae\"), 800L, 800L, new Guid(\"a10bd662-2917-4b71-a8bd-147061e8dfc8\"), 1200L },\n                    { new Guid(\"5a77ae2a-8ce5-4411-8494-63fcade7fd87\"), 800L, 800L, new Guid(\"6bd24c6e-017b-4802-8b4d-f7188d9449dc\"), 1200L },\n                    { new Guid(\"deb8d789-ba0f-453e-98ca-0bb60dc1c080\"), 800L, 800L, new Guid(\"17d3ce29-4d37-491f-8e65-14069e322d23\"), 1200L },\n                    { new Guid(\"e2e8b9b8-50d3-4673-bce7-fbf0c9601df1\"), 800L, 800L, new Guid(\"2a4ef2c2-ae16-4517-91b0-3160406e297f\"), 1200L },\n                    { new Guid(\"61ce7880-2198-4f2e-8f82-123e2a18818f\"), 800L, 800L, new Guid(\"2a4ef2c2-ae16-4517-91b0-3160406e297f\"), 1200L },\n                    { new Guid(\"68268317-da8e-435e-8f06-448f80880b34\"), 800L, 800L, new Guid(\"2a4ef2c2-ae16-4517-91b0-3160406e297f\"), 1200L },\n                    { new Guid(\"a874f96f-2fbb-40ff-8eba-65a21bd39238\"), 800L, 800L, new Guid(\"2a4ef2c2-ae16-4517-91b0-3160406e297f\"), 1200L },\n                    { new Guid(\"dea69d81-1297-4323-b382-b2866c929a2c\"), 800L, 800L, new Guid(\"2a4ef2c2-ae16-4517-91b0-3160406e297f\"), 1200L },\n                    { new Guid(\"8a76164d-a7b9-428f-87f7-65833464d6f6\"), 800L, 800L, new Guid(\"2a4ef2c2-ae16-4517-91b0-3160406e297f\"), 1200L },\n                    { new Guid(\"11d0531e-a270-4462-85f2-6ea5e5c80c6c\"), 800L, 800L, new Guid(\"2a4ef2c2-ae16-4517-91b0-3160406e297f\"), 1200L },\n                    { new Guid(\"dae38c4f-c4cb-4a67-9e21-94d861c8afff\"), 800L, 800L, new Guid(\"17d3ce29-4d37-491f-8e65-14069e322d23\"), 1200L },\n                    { new Guid(\"d126d83e-252d-4c88-8754-aad5049b3ef3\"), 800L, 800L, new Guid(\"17d3ce29-4d37-491f-8e65-14069e322d23\"), 1200L },\n                    { new Guid(\"e5b7250d-d636-40e6-9068-acf35d72bd68\"), 800L, 800L, new Guid(\"17d3ce29-4d37-491f-8e65-14069e322d23\"), 1200L },\n                    { new Guid(\"6118cc85-5d50-4cb2-8f81-874a8f286ec1\"), 800L, 800L, new Guid(\"17d3ce29-4d37-491f-8e65-14069e322d23\"), 1200L },\n                    { new Guid(\"88b79e1f-8bf4-4d88-9830-670c594e09a6\"), 800L, 800L, new Guid(\"17d3ce29-4d37-491f-8e65-14069e322d23\"), 1200L },\n                    { new Guid(\"8760816e-dc6d-4b9c-a6bd-e4f1d47e03bd\"), 800L, 800L, new Guid(\"17d3ce29-4d37-491f-8e65-14069e322d23\"), 1200L },\n                    { new Guid(\"2f7ab388-28f3-40b8-9b74-d299f44d0c62\"), 800L, 800L, new Guid(\"17d3ce29-4d37-491f-8e65-14069e322d23\"), 1200L },\n                    { new Guid(\"4bded4e9-131e-4475-9af4-5832bb8b1cec\"), 800L, 800L, new Guid(\"17d3ce29-4d37-491f-8e65-14069e322d23\"), 1200L },\n                    { new Guid(\"b1a37338-e6df-429b-b186-bc1bc215cffe\"), 800L, 800L, new Guid(\"17d3ce29-4d37-491f-8e65-14069e322d23\"), 1200L },\n                    { new Guid(\"5e4ef685-e63e-4ac5-8474-c412d5188785\"), 800L, 800L, new Guid(\"97ffbac8-4288-4a7b-877e-4041ed1d3c7d\"), 1200L },\n                    { new Guid(\"906f9a41-cd17-4507-93aa-c4fd96e48047\"), 800L, 800L, new Guid(\"a10bd662-2917-4b71-a8bd-147061e8dfc8\"), 1200L },\n                    { new Guid(\"2fe8928c-2360-4b92-a8d9-084b3864951a\"), 800L, 800L, new Guid(\"a10bd662-2917-4b71-a8bd-147061e8dfc8\"), 1200L },\n                    { new Guid(\"fa3ed3bc-569f-4676-96a5-849bf471588b\"), 800L, 800L, new Guid(\"47ab1205-32ea-4739-a1a6-f41a58936498\"), 1200L },\n                    { new Guid(\"83a43c67-bba9-482a-a8d3-c80247739799\"), 800L, 800L, new Guid(\"47ab1205-32ea-4739-a1a6-f41a58936498\"), 1200L },\n                    { new Guid(\"ec2859f3-d1cf-4286-9751-aebb134b25aa\"), 800L, 800L, new Guid(\"47ab1205-32ea-4739-a1a6-f41a58936498\"), 1200L },\n                    { new Guid(\"71caa39b-4c7e-4433-87c3-cb98a0c6ec9c\"), 800L, 800L, new Guid(\"47ab1205-32ea-4739-a1a6-f41a58936498\"), 1200L },\n                    { new Guid(\"949dcee5-83f3-469e-a4b3-bb9117cdb07a\"), 800L, 800L, new Guid(\"47ab1205-32ea-4739-a1a6-f41a58936498\"), 1200L },\n                    { new Guid(\"73d7add4-418c-41e7-81b2-7234c405bac2\"), 800L, 800L, new Guid(\"47ab1205-32ea-4739-a1a6-f41a58936498\"), 1200L },\n                    { new Guid(\"514694d5-24b4-41a7-a92e-b982e0668b8b\"), 800L, 800L, new Guid(\"39730a50-95cc-43b3-8e46-cafee2ef6235\"), 1200L },\n                    { new Guid(\"f0774a0d-8b20-44c3-a193-e2f7ea03e2d6\"), 800L, 800L, new Guid(\"47ab1205-32ea-4739-a1a6-f41a58936498\"), 1200L },\n                    { new Guid(\"9184e9e6-d867-4256-a844-24bdf0d06575\"), 800L, 800L, new Guid(\"47ab1205-32ea-4739-a1a6-f41a58936498\"), 1200L },\n                    { new Guid(\"b490133d-4f22-4b47-b7ac-3e270f30d961\"), 800L, 800L, new Guid(\"47ab1205-32ea-4739-a1a6-f41a58936498\"), 1200L },\n                    { new Guid(\"d148c7b5-e5a9-4945-8dc0-f39d6e0a0a5b\"), 800L, 800L, new Guid(\"9050d656-22fd-4dd4-959a-0b66df2d32ee\"), 1200L },\n                    { new Guid(\"51f16649-d40e-45e8-83e9-9f909e1389ac\"), 800L, 800L, new Guid(\"9050d656-22fd-4dd4-959a-0b66df2d32ee\"), 1200L },\n                    { new Guid(\"46918cfd-56a0-4ce8-809b-84a1c2f0ffb0\"), 800L, 800L, new Guid(\"9050d656-22fd-4dd4-959a-0b66df2d32ee\"), 1200L },\n                    { new Guid(\"d4b64d33-97f7-44a5-9bc5-d7560b6ce1e7\"), 800L, 800L, new Guid(\"9050d656-22fd-4dd4-959a-0b66df2d32ee\"), 1200L },\n                    { new Guid(\"2ce3efc4-3fb5-45df-b663-3416cbaeffe6\"), 800L, 800L, new Guid(\"47ab1205-32ea-4739-a1a6-f41a58936498\"), 1200L },\n                    { new Guid(\"fec819c8-d1e2-4ad0-866b-df76ccd3302b\"), 800L, 800L, new Guid(\"39730a50-95cc-43b3-8e46-cafee2ef6235\"), 1200L },\n                    { new Guid(\"bdbfaa8c-5bc8-4f16-b840-8b242bf13ba7\"), 800L, 800L, new Guid(\"39730a50-95cc-43b3-8e46-cafee2ef6235\"), 1200L },\n                    { new Guid(\"706b585c-a76c-4c34-97c8-11820e60ae04\"), 800L, 800L, new Guid(\"39730a50-95cc-43b3-8e46-cafee2ef6235\"), 1200L },\n                    { new Guid(\"b16e786f-9c0e-4389-9702-778135955f06\"), 800L, 800L, new Guid(\"6833ef8a-2454-46bf-816e-b3b1157a145e\"), 1200L },\n                    { new Guid(\"b9b7e859-a988-4d14-a233-9bc853203336\"), 800L, 800L, new Guid(\"6833ef8a-2454-46bf-816e-b3b1157a145e\"), 1200L },\n                    { new Guid(\"b910abc4-302a-4603-bcb6-31662a35a53b\"), 800L, 800L, new Guid(\"6833ef8a-2454-46bf-816e-b3b1157a145e\"), 1200L },\n                    { new Guid(\"ea2a22c2-8c89-40b7-8806-1f11964f102e\"), 800L, 800L, new Guid(\"6833ef8a-2454-46bf-816e-b3b1157a145e\"), 1200L },\n                    { new Guid(\"9552d6d5-06f8-40c4-9ace-bdd298bb8643\"), 800L, 800L, new Guid(\"6833ef8a-2454-46bf-816e-b3b1157a145e\"), 1200L },\n                    { new Guid(\"2184b7c7-0cb1-4b2c-89e4-16143ed629d1\"), 800L, 800L, new Guid(\"6833ef8a-2454-46bf-816e-b3b1157a145e\"), 1200L },\n                    { new Guid(\"b8bed9c7-034e-4dc7-a97b-53d6588a5366\"), 800L, 800L, new Guid(\"6833ef8a-2454-46bf-816e-b3b1157a145e\"), 1200L },\n                    { new Guid(\"22c022fe-14e7-4e54-b12c-3d4f5fa99216\"), 800L, 800L, new Guid(\"6833ef8a-2454-46bf-816e-b3b1157a145e\"), 1200L },\n                    { new Guid(\"2880b432-0a24-4a57-8911-005fb57b843b\"), 800L, 800L, new Guid(\"6833ef8a-2454-46bf-816e-b3b1157a145e\"), 1200L },\n                    { new Guid(\"09eb06ed-d18e-4470-9a23-4acc6b99f309\"), 800L, 800L, new Guid(\"39730a50-95cc-43b3-8e46-cafee2ef6235\"), 1200L },\n                    { new Guid(\"afe8b4c4-6922-4656-8893-b4e0c16d8d6e\"), 800L, 800L, new Guid(\"39730a50-95cc-43b3-8e46-cafee2ef6235\"), 1200L },\n                    { new Guid(\"e75597cb-f6b4-4078-81a4-e428961b0535\"), 800L, 800L, new Guid(\"39730a50-95cc-43b3-8e46-cafee2ef6235\"), 1200L },\n                    { new Guid(\"b4230186-bf98-443b-b11d-d83e675c03f2\"), 800L, 800L, new Guid(\"39730a50-95cc-43b3-8e46-cafee2ef6235\"), 1200L },\n                    { new Guid(\"9049ed37-fb31-4d4e-b7cd-63712eb532c4\"), 800L, 800L, new Guid(\"39730a50-95cc-43b3-8e46-cafee2ef6235\"), 1200L },\n                    { new Guid(\"1f30b9e9-6f1f-4837-ba7f-9d04b8ec58cd\"), 800L, 800L, new Guid(\"39730a50-95cc-43b3-8e46-cafee2ef6235\"), 1200L },\n                    { new Guid(\"212003f2-2d1f-4131-80d2-f9406a6f6c90\"), 800L, 800L, new Guid(\"9050d656-22fd-4dd4-959a-0b66df2d32ee\"), 1200L },\n                    { new Guid(\"17be0d81-98f2-4bb4-a2b9-e6f1867836f2\"), 800L, 800L, new Guid(\"9050d656-22fd-4dd4-959a-0b66df2d32ee\"), 1200L },\n                    { new Guid(\"99c2458d-33e7-43ee-bf49-a3558b34e5b7\"), 800L, 800L, new Guid(\"9050d656-22fd-4dd4-959a-0b66df2d32ee\"), 1200L },\n                    { new Guid(\"d79c6c4d-635f-4e41-8c0e-c9b2acd069cd\"), 800L, 800L, new Guid(\"9050d656-22fd-4dd4-959a-0b66df2d32ee\"), 1200L },\n                    { new Guid(\"7bdd0584-157d-49e0-bdc8-e31dde60c466\"), 800L, 800L, new Guid(\"4b840bec-728d-499d-ac3c-3369d09eb9f5\"), 1200L },\n                    { new Guid(\"00aaa4d9-8469-4503-a2a6-ed20d4cf1bae\"), 800L, 800L, new Guid(\"4b840bec-728d-499d-ac3c-3369d09eb9f5\"), 1200L },\n                    { new Guid(\"930e8338-4863-44b7-b5b5-3fd47c70185f\"), 800L, 800L, new Guid(\"4b840bec-728d-499d-ac3c-3369d09eb9f5\"), 1200L },\n                    { new Guid(\"b1651749-1d03-4fb7-b65e-4030cbb8d8cb\"), 800L, 800L, new Guid(\"f654f424-05e0-456d-9556-b0fad270b86f\"), 1200L },\n                    { new Guid(\"1c35570b-4269-46bc-80ee-531b79708c71\"), 800L, 800L, new Guid(\"f654f424-05e0-456d-9556-b0fad270b86f\"), 1200L },\n                    { new Guid(\"e06f5265-deda-40d6-8daf-7d4735c8013d\"), 800L, 800L, new Guid(\"f654f424-05e0-456d-9556-b0fad270b86f\"), 1200L }\n                });\n\n            migrationBuilder.InsertData(\n                table: \"Shelves\",\n                columns: new[] { \"Id\", \"Depth\", \"Height\", \"RackId\", \"Width\" },\n                values: new object[,]\n                {\n                    { new Guid(\"a016bbcd-4a83-41e9-a011-694de705bf77\"), 800L, 800L, new Guid(\"f654f424-05e0-456d-9556-b0fad270b86f\"), 1200L },\n                    { new Guid(\"e479f9df-ef6f-48ad-af3f-61700fa355cd\"), 800L, 800L, new Guid(\"f654f424-05e0-456d-9556-b0fad270b86f\"), 1200L },\n                    { new Guid(\"98ddeb34-68a3-4fce-8c46-44b677e134d4\"), 800L, 800L, new Guid(\"f654f424-05e0-456d-9556-b0fad270b86f\"), 1200L },\n                    { new Guid(\"c2b9dfc8-335b-4c0d-85a4-a2aa6117172b\"), 800L, 800L, new Guid(\"f654f424-05e0-456d-9556-b0fad270b86f\"), 1200L },\n                    { new Guid(\"9af10ff0-2d2a-4ebc-88b5-8a3c4f6a1295\"), 800L, 800L, new Guid(\"f654f424-05e0-456d-9556-b0fad270b86f\"), 1200L },\n                    { new Guid(\"e5b84925-8b91-43ee-990c-06bf32a6bd7b\"), 800L, 800L, new Guid(\"f654f424-05e0-456d-9556-b0fad270b86f\"), 1200L },\n                    { new Guid(\"8559024f-b0c9-4940-ad0a-75c8879960e0\"), 800L, 800L, new Guid(\"f654f424-05e0-456d-9556-b0fad270b86f\"), 1200L },\n                    { new Guid(\"dab947aa-09af-4bb5-8bf5-c4139d310e00\"), 800L, 800L, new Guid(\"a10bd662-2917-4b71-a8bd-147061e8dfc8\"), 1200L },\n                    { new Guid(\"6d712a6c-b5a2-42f8-873f-68c3be27109f\"), 800L, 800L, new Guid(\"a10bd662-2917-4b71-a8bd-147061e8dfc8\"), 1200L },\n                    { new Guid(\"9f237bcd-0c1a-45be-8755-60bff2ff9121\"), 800L, 800L, new Guid(\"4b840bec-728d-499d-ac3c-3369d09eb9f5\"), 1200L },\n                    { new Guid(\"6b2f4d2a-355a-43a7-b98e-f3281df59b67\"), 800L, 800L, new Guid(\"a10bd662-2917-4b71-a8bd-147061e8dfc8\"), 1200L },\n                    { new Guid(\"958d8f02-2716-433a-8278-0046721ea0e9\"), 800L, 800L, new Guid(\"4b840bec-728d-499d-ac3c-3369d09eb9f5\"), 1200L },\n                    { new Guid(\"9c4460f3-3336-4f44-90a8-8fbd831aeba4\"), 800L, 800L, new Guid(\"4b840bec-728d-499d-ac3c-3369d09eb9f5\"), 1200L },\n                    { new Guid(\"4e643e04-294f-4527-b725-566df5e049c4\"), 800L, 800L, new Guid(\"9050d656-22fd-4dd4-959a-0b66df2d32ee\"), 1200L },\n                    { new Guid(\"9e962cab-a5ee-4b07-8e5d-e51b1e254a53\"), 800L, 800L, new Guid(\"9050d656-22fd-4dd4-959a-0b66df2d32ee\"), 1200L },\n                    { new Guid(\"5dab41a8-13c1-4c69-97da-4f2ee37c13ab\"), 800L, 800L, new Guid(\"bacfde61-7c26-4d90-993c-eb8ae559ba68\"), 1200L },\n                    { new Guid(\"2f741891-79fd-4c08-bcd4-c4299b428e68\"), 800L, 800L, new Guid(\"bacfde61-7c26-4d90-993c-eb8ae559ba68\"), 1200L },\n                    { new Guid(\"060e1743-cf14-4bbb-84ed-563903743fd0\"), 800L, 800L, new Guid(\"bacfde61-7c26-4d90-993c-eb8ae559ba68\"), 1200L },\n                    { new Guid(\"a3bb842d-1283-4dab-be41-997ae93b5f35\"), 800L, 800L, new Guid(\"bacfde61-7c26-4d90-993c-eb8ae559ba68\"), 1200L },\n                    { new Guid(\"36ab42a3-74d6-4035-8444-6a3980489e74\"), 800L, 800L, new Guid(\"bacfde61-7c26-4d90-993c-eb8ae559ba68\"), 1200L },\n                    { new Guid(\"7fd65aee-3ed8-447a-ab1b-500c09e58cb8\"), 800L, 800L, new Guid(\"bacfde61-7c26-4d90-993c-eb8ae559ba68\"), 1200L },\n                    { new Guid(\"6a290bf6-d18c-4ab8-a8f4-87b8fc30ef43\"), 800L, 800L, new Guid(\"bacfde61-7c26-4d90-993c-eb8ae559ba68\"), 1200L },\n                    { new Guid(\"203427a5-62df-400f-bdde-84be57a610e5\"), 800L, 800L, new Guid(\"bacfde61-7c26-4d90-993c-eb8ae559ba68\"), 1200L },\n                    { new Guid(\"8c1f91e5-a328-42bd-8a01-9f6f60576a1f\"), 800L, 800L, new Guid(\"bacfde61-7c26-4d90-993c-eb8ae559ba68\"), 1200L },\n                    { new Guid(\"d7f7326a-dcb6-4eaa-a1c6-e41564492a14\"), 800L, 800L, new Guid(\"bacfde61-7c26-4d90-993c-eb8ae559ba68\"), 1200L },\n                    { new Guid(\"a06ad8b4-d7fa-4470-8830-a55e20e1a90e\"), 800L, 800L, new Guid(\"4b840bec-728d-499d-ac3c-3369d09eb9f5\"), 1200L },\n                    { new Guid(\"8e26f802-3253-4d8a-b2e0-5d92d4f2a105\"), 800L, 800L, new Guid(\"4b840bec-728d-499d-ac3c-3369d09eb9f5\"), 1200L },\n                    { new Guid(\"a9185c12-49ad-489a-9896-b6cce36bc117\"), 800L, 800L, new Guid(\"4b840bec-728d-499d-ac3c-3369d09eb9f5\"), 1200L },\n                    { new Guid(\"56f1cc3a-e235-4a33-a88b-6f724c19ed50\"), 800L, 800L, new Guid(\"4b840bec-728d-499d-ac3c-3369d09eb9f5\"), 1200L },\n                    { new Guid(\"9061db0d-04f7-4956-a692-d5721030fe27\"), 800L, 800L, new Guid(\"97ffbac8-4288-4a7b-877e-4041ed1d3c7d\"), 1200L },\n                    { new Guid(\"c277d89d-8c37-4e12-b020-86f99f8d72cc\"), 800L, 800L, new Guid(\"97ffbac8-4288-4a7b-877e-4041ed1d3c7d\"), 1200L },\n                    { new Guid(\"9b0ea92c-c0cc-4af2-a781-3482a0e408cd\"), 800L, 800L, new Guid(\"7e0d6759-e633-4935-be57-1d3ed356c927\"), 1200L },\n                    { new Guid(\"0bb76772-65ae-46b1-bdb4-ba9483d801f3\"), 800L, 800L, new Guid(\"9d67d3a0-2004-467c-bcb0-a0995e9a3930\"), 1200L },\n                    { new Guid(\"0235d982-605a-46b9-ad0a-f5c804379adc\"), 800L, 800L, new Guid(\"9d67d3a0-2004-467c-bcb0-a0995e9a3930\"), 1200L },\n                    { new Guid(\"fa2ee809-3ea8-44c8-aa56-e9aefeea811d\"), 800L, 800L, new Guid(\"9d67d3a0-2004-467c-bcb0-a0995e9a3930\"), 1200L },\n                    { new Guid(\"df71ba96-c703-4ed7-a878-abd388c65639\"), 800L, 800L, new Guid(\"9d67d3a0-2004-467c-bcb0-a0995e9a3930\"), 1200L },\n                    { new Guid(\"f1e8e072-2cce-40dc-8235-049fdab1d82e\"), 800L, 800L, new Guid(\"0c1c8d40-2f3c-43c9-9be7-4c51f19ba244\"), 1200L },\n                    { new Guid(\"b10d0db7-3518-4a12-ba3d-640cff5e83c5\"), 800L, 800L, new Guid(\"0c1c8d40-2f3c-43c9-9be7-4c51f19ba244\"), 1200L },\n                    { new Guid(\"9f213b5c-0795-4952-8f21-aa8f4b65a2ac\"), 800L, 800L, new Guid(\"9d67d3a0-2004-467c-bcb0-a0995e9a3930\"), 1200L },\n                    { new Guid(\"93945621-1f2a-4286-ae9b-8b23319bbf97\"), 800L, 800L, new Guid(\"0c1c8d40-2f3c-43c9-9be7-4c51f19ba244\"), 1200L },\n                    { new Guid(\"94be3796-b848-4007-9ed6-dce0cff9e06c\"), 800L, 800L, new Guid(\"0c1c8d40-2f3c-43c9-9be7-4c51f19ba244\"), 1200L },\n                    { new Guid(\"33767577-7b2b-48ea-af0b-63afdffff20e\"), 800L, 800L, new Guid(\"0c1c8d40-2f3c-43c9-9be7-4c51f19ba244\"), 1200L },\n                    { new Guid(\"749061ca-24cd-4560-bc1b-f0ed66652603\"), 800L, 800L, new Guid(\"0c1c8d40-2f3c-43c9-9be7-4c51f19ba244\"), 1200L },\n                    { new Guid(\"1541a7cc-057f-4618-9a75-7e3c92343c89\"), 800L, 800L, new Guid(\"0c1c8d40-2f3c-43c9-9be7-4c51f19ba244\"), 1200L },\n                    { new Guid(\"a90b8781-7681-4fdd-8187-f780784c3889\"), 800L, 800L, new Guid(\"0c1c8d40-2f3c-43c9-9be7-4c51f19ba244\"), 1200L },\n                    { new Guid(\"30144593-995c-4d30-87e0-ea202dff018d\"), 800L, 800L, new Guid(\"0c1c8d40-2f3c-43c9-9be7-4c51f19ba244\"), 1200L },\n                    { new Guid(\"4f1f91cd-b911-44ca-9b88-043f0aa779ca\"), 800L, 800L, new Guid(\"0c1c8d40-2f3c-43c9-9be7-4c51f19ba244\"), 1200L },\n                    { new Guid(\"84e75391-d321-45ca-bf35-f2b60ba563f2\"), 800L, 800L, new Guid(\"9d67d3a0-2004-467c-bcb0-a0995e9a3930\"), 1200L },\n                    { new Guid(\"79e2614c-6678-435b-87ea-214d9f0ed603\"), 800L, 800L, new Guid(\"9d67d3a0-2004-467c-bcb0-a0995e9a3930\"), 1200L },\n                    { new Guid(\"07a7ebe0-058e-4d5d-9c2b-dfae6ee98c3e\"), 800L, 800L, new Guid(\"9d67d3a0-2004-467c-bcb0-a0995e9a3930\"), 1200L },\n                    { new Guid(\"e4991029-14ed-4d8d-b1fe-a75eaa52dfce\"), 800L, 800L, new Guid(\"cb24558f-d7a1-46b6-8278-b40bc7303b97\"), 1200L },\n                    { new Guid(\"f61ff185-090c-4a21-88f0-d6bbf8ece4c4\"), 800L, 800L, new Guid(\"cb24558f-d7a1-46b6-8278-b40bc7303b97\"), 1200L },\n                    { new Guid(\"3c7ee161-a641-413f-a392-74c17e8f2dc2\"), 800L, 800L, new Guid(\"cb24558f-d7a1-46b6-8278-b40bc7303b97\"), 1200L },\n                    { new Guid(\"7f99cddd-08ac-4548-a582-abd5d604d4ea\"), 800L, 800L, new Guid(\"4069dd1e-3c5e-4633-a0c7-294e0f0b8a73\"), 1200L },\n                    { new Guid(\"8ddf74c3-20e2-4b82-8345-75b54101115d\"), 800L, 800L, new Guid(\"4069dd1e-3c5e-4633-a0c7-294e0f0b8a73\"), 1200L },\n                    { new Guid(\"a94e7ff9-9adb-4e46-ab58-ed5a8c4247c2\"), 800L, 800L, new Guid(\"4069dd1e-3c5e-4633-a0c7-294e0f0b8a73\"), 1200L },\n                    { new Guid(\"de140553-1ecc-4ef6-9cbe-e7a73f7044fe\"), 800L, 800L, new Guid(\"4069dd1e-3c5e-4633-a0c7-294e0f0b8a73\"), 1200L },\n                    { new Guid(\"032cdd7c-8c6c-45a2-896b-6b8512126ca3\"), 800L, 800L, new Guid(\"4069dd1e-3c5e-4633-a0c7-294e0f0b8a73\"), 1200L },\n                    { new Guid(\"1d90af6b-02c1-4a0d-88b9-3e8ef1a07066\"), 800L, 800L, new Guid(\"4069dd1e-3c5e-4633-a0c7-294e0f0b8a73\"), 1200L },\n                    { new Guid(\"e3f445a9-9e1c-443a-a7c1-960f2953aa6f\"), 800L, 800L, new Guid(\"4069dd1e-3c5e-4633-a0c7-294e0f0b8a73\"), 1200L },\n                    { new Guid(\"bedfd5f7-7e2e-4e05-85c1-7d8d59d54025\"), 800L, 800L, new Guid(\"4069dd1e-3c5e-4633-a0c7-294e0f0b8a73\"), 1200L },\n                    { new Guid(\"e3a5f3e2-d003-4163-a830-41ad30c20c49\"), 800L, 800L, new Guid(\"4069dd1e-3c5e-4633-a0c7-294e0f0b8a73\"), 1200L },\n                    { new Guid(\"c54a82cb-5178-4569-a5a0-044ec3f969fd\"), 800L, 800L, new Guid(\"4069dd1e-3c5e-4633-a0c7-294e0f0b8a73\"), 1200L },\n                    { new Guid(\"272c16ac-51d9-4577-a919-57678b309ccd\"), 800L, 800L, new Guid(\"9d67d3a0-2004-467c-bcb0-a0995e9a3930\"), 1200L },\n                    { new Guid(\"bbe15aba-42d4-4bea-8143-80f275f4852d\"), 800L, 800L, new Guid(\"9d67d3a0-2004-467c-bcb0-a0995e9a3930\"), 1200L },\n                    { new Guid(\"a0e20ba3-4bfd-490b-a308-4d0003b40c4c\"), 800L, 800L, new Guid(\"29781860-25e1-4054-b999-15cb57504c70\"), 1200L },\n                    { new Guid(\"be4eff2a-f4e4-4f78-ad33-8c8c6fa446ab\"), 800L, 800L, new Guid(\"29781860-25e1-4054-b999-15cb57504c70\"), 1200L },\n                    { new Guid(\"0ca5a209-c4ab-42f8-99a8-99541ac98c38\"), 800L, 800L, new Guid(\"29781860-25e1-4054-b999-15cb57504c70\"), 1200L },\n                    { new Guid(\"66771d19-8aa1-4226-b35e-e747ad9a92c6\"), 800L, 800L, new Guid(\"29781860-25e1-4054-b999-15cb57504c70\"), 1200L },\n                    { new Guid(\"9c6c4c05-27bd-40b2-8708-6275cd33890c\"), 800L, 800L, new Guid(\"9dff5406-13fd-4051-ba33-aa51f500c53e\"), 1200L },\n                    { new Guid(\"53fed29c-a5c7-488d-a4a4-6672e4a06deb\"), 800L, 800L, new Guid(\"9dff5406-13fd-4051-ba33-aa51f500c53e\"), 1200L },\n                    { new Guid(\"0a4eb699-6706-4b00-b66f-2a97f2dcce36\"), 800L, 800L, new Guid(\"9dff5406-13fd-4051-ba33-aa51f500c53e\"), 1200L },\n                    { new Guid(\"71831ce6-5787-4b1d-b76e-d3920e129779\"), 800L, 800L, new Guid(\"9dff5406-13fd-4051-ba33-aa51f500c53e\"), 1200L },\n                    { new Guid(\"bc951f1b-e492-4d67-a319-72e01c9c6ab1\"), 800L, 800L, new Guid(\"9dff5406-13fd-4051-ba33-aa51f500c53e\"), 1200L },\n                    { new Guid(\"f006cf86-9be0-466e-9d4a-5a7d6b746a97\"), 800L, 800L, new Guid(\"9dff5406-13fd-4051-ba33-aa51f500c53e\"), 1200L },\n                    { new Guid(\"780dbfb4-2974-4e4f-a84d-c802d30dffa6\"), 800L, 800L, new Guid(\"9dff5406-13fd-4051-ba33-aa51f500c53e\"), 1200L },\n                    { new Guid(\"b5174309-0d8c-48e9-82d0-9c840ac8acea\"), 800L, 800L, new Guid(\"379a8126-faa5-4cfc-98da-97b344454d69\"), 1200L },\n                    { new Guid(\"696b26f7-bdc1-4795-b328-94df7198113f\"), 800L, 800L, new Guid(\"379a8126-faa5-4cfc-98da-97b344454d69\"), 1200L },\n                    { new Guid(\"d4e71dfc-8ccf-4b50-9f38-0c29866d005c\"), 800L, 800L, new Guid(\"379a8126-faa5-4cfc-98da-97b344454d69\"), 1200L },\n                    { new Guid(\"fba2b776-c9f5-473f-a43a-9d459e8f2cba\"), 800L, 800L, new Guid(\"379a8126-faa5-4cfc-98da-97b344454d69\"), 1200L },\n                    { new Guid(\"48c43453-5d8e-4ea7-b740-1b60fbde86d0\"), 800L, 800L, new Guid(\"379a8126-faa5-4cfc-98da-97b344454d69\"), 1200L },\n                    { new Guid(\"aef86ee4-8518-4fe8-8dff-e31571becf59\"), 800L, 800L, new Guid(\"379a8126-faa5-4cfc-98da-97b344454d69\"), 1200L },\n                    { new Guid(\"c7014f6c-2915-4533-ad15-2e2ffb250f44\"), 800L, 800L, new Guid(\"379a8126-faa5-4cfc-98da-97b344454d69\"), 1200L },\n                    { new Guid(\"0a5f7026-276e-4ec0-ad51-cf7da90d08b2\"), 800L, 800L, new Guid(\"379a8126-faa5-4cfc-98da-97b344454d69\"), 1200L },\n                    { new Guid(\"3b1c9517-2427-4eb3-a937-feb6e588c84f\"), 800L, 800L, new Guid(\"9dff5406-13fd-4051-ba33-aa51f500c53e\"), 1200L },\n                    { new Guid(\"1101dcdb-2ad6-4f1e-a180-66b714f106f7\"), 800L, 800L, new Guid(\"cb24558f-d7a1-46b6-8278-b40bc7303b97\"), 1200L },\n                    { new Guid(\"690f6041-f432-4ce9-8a93-28c4d03c0e76\"), 800L, 800L, new Guid(\"9dff5406-13fd-4051-ba33-aa51f500c53e\"), 1200L },\n                    { new Guid(\"d4eb4b33-5df0-4aeb-babb-b030779638ed\"), 800L, 800L, new Guid(\"54428e02-93d3-4403-973b-a0068f6b85c3\"), 1200L },\n                    { new Guid(\"842d5acd-51e8-4a97-b581-48c963e7ac9e\"), 800L, 800L, new Guid(\"29781860-25e1-4054-b999-15cb57504c70\"), 1200L },\n                    { new Guid(\"ab806c8f-d0f0-47f7-8210-f5462b0429d2\"), 800L, 800L, new Guid(\"29781860-25e1-4054-b999-15cb57504c70\"), 1200L },\n                    { new Guid(\"835c08ba-1255-4a50-8eda-925bc06d4667\"), 800L, 800L, new Guid(\"29781860-25e1-4054-b999-15cb57504c70\"), 1200L },\n                    { new Guid(\"6fbd988c-0333-4394-987e-86643dc3e531\"), 800L, 800L, new Guid(\"29781860-25e1-4054-b999-15cb57504c70\"), 1200L },\n                    { new Guid(\"cd8d605a-4cc5-4874-94a6-ccdef571cfa0\"), 800L, 800L, new Guid(\"29781860-25e1-4054-b999-15cb57504c70\"), 1200L },\n                    { new Guid(\"ab616b78-ceaa-4f28-b8aa-4d270dc2b4b2\"), 800L, 800L, new Guid(\"29781860-25e1-4054-b999-15cb57504c70\"), 1200L },\n                    { new Guid(\"41b668b9-1e5c-449b-9e82-aee3c68a32a5\"), 800L, 800L, new Guid(\"54428e02-93d3-4403-973b-a0068f6b85c3\"), 1200L },\n                    { new Guid(\"d308f303-146e-4f75-9b6e-5250b519dcb8\"), 800L, 800L, new Guid(\"54428e02-93d3-4403-973b-a0068f6b85c3\"), 1200L },\n                    { new Guid(\"793e8f8d-0b2e-4c7c-864a-e6c882b404a8\"), 800L, 800L, new Guid(\"54428e02-93d3-4403-973b-a0068f6b85c3\"), 1200L },\n                    { new Guid(\"57eabd61-456c-416b-8d25-ea81acfd1e5d\"), 800L, 800L, new Guid(\"54428e02-93d3-4403-973b-a0068f6b85c3\"), 1200L },\n                    { new Guid(\"7e969644-7eba-414a-a11b-d6a2dfaafc1e\"), 800L, 800L, new Guid(\"54428e02-93d3-4403-973b-a0068f6b85c3\"), 1200L },\n                    { new Guid(\"6fce0b5e-2b17-4171-888e-572a27dfbe36\"), 800L, 800L, new Guid(\"54428e02-93d3-4403-973b-a0068f6b85c3\"), 1200L },\n                    { new Guid(\"33a2dc35-3268-4a78-a16e-238d5cefa157\"), 800L, 800L, new Guid(\"54428e02-93d3-4403-973b-a0068f6b85c3\"), 1200L },\n                    { new Guid(\"8e5742f7-6003-48ef-88d9-c5c4004854cd\"), 800L, 800L, new Guid(\"54428e02-93d3-4403-973b-a0068f6b85c3\"), 1200L },\n                    { new Guid(\"fd97be44-027d-4634-8300-a34b0cc75419\"), 800L, 800L, new Guid(\"54428e02-93d3-4403-973b-a0068f6b85c3\"), 1200L },\n                    { new Guid(\"0354e008-141e-4178-8b03-78925e5982c2\"), 800L, 800L, new Guid(\"9dff5406-13fd-4051-ba33-aa51f500c53e\"), 1200L },\n                    { new Guid(\"6c3e7c43-88d0-451d-a4f3-0469888e2dfa\"), 800L, 800L, new Guid(\"cb24558f-d7a1-46b6-8278-b40bc7303b97\"), 1200L },\n                    { new Guid(\"e4f971e6-5d22-4fe6-8a94-e2700406d2ee\"), 800L, 800L, new Guid(\"cb24558f-d7a1-46b6-8278-b40bc7303b97\"), 1200L },\n                    { new Guid(\"e7baf16f-6886-4aae-b349-b5ebe698e85c\"), 800L, 800L, new Guid(\"cb24558f-d7a1-46b6-8278-b40bc7303b97\"), 1200L },\n                    { new Guid(\"6f970cd5-361f-4011-8611-b1fba73e8e74\"), 800L, 800L, new Guid(\"fddc1a16-8961-4d56-abc0-f7d297164e28\"), 1200L },\n                    { new Guid(\"0f2f1167-421e-4a66-afda-ca582a96d29c\"), 800L, 800L, new Guid(\"fddc1a16-8961-4d56-abc0-f7d297164e28\"), 1200L },\n                    { new Guid(\"3c5a30b4-ef90-4e7b-a4db-41e97978459a\"), 800L, 800L, new Guid(\"fddc1a16-8961-4d56-abc0-f7d297164e28\"), 1200L },\n                    { new Guid(\"a4df86e7-0096-4971-8d9c-449db4f08820\"), 800L, 800L, new Guid(\"fddc1a16-8961-4d56-abc0-f7d297164e28\"), 1200L },\n                    { new Guid(\"aab24d65-6f01-4ecc-b6dd-12c8923864d0\"), 800L, 800L, new Guid(\"fddc1a16-8961-4d56-abc0-f7d297164e28\"), 1200L },\n                    { new Guid(\"aaebbe29-6945-4211-9616-0f4a18418cd0\"), 800L, 800L, new Guid(\"fddc1a16-8961-4d56-abc0-f7d297164e28\"), 1200L },\n                    { new Guid(\"2de91b2a-75e5-41ca-aab2-731c619c1425\"), 800L, 800L, new Guid(\"fddc1a16-8961-4d56-abc0-f7d297164e28\"), 1200L },\n                    { new Guid(\"9ea41fb5-4692-4c3e-98dd-e1a4710e0f00\"), 800L, 800L, new Guid(\"fddc1a16-8961-4d56-abc0-f7d297164e28\"), 1200L },\n                    { new Guid(\"d92b63e8-0d92-4a02-9587-e533a021db86\"), 800L, 800L, new Guid(\"fddc1a16-8961-4d56-abc0-f7d297164e28\"), 1200L },\n                    { new Guid(\"887cd1cb-a2d7-4404-ab52-3fdc1c8a9071\"), 800L, 800L, new Guid(\"fddc1a16-8961-4d56-abc0-f7d297164e28\"), 1200L },\n                    { new Guid(\"327dd00b-4fed-4ec3-b38c-c78c54c308f3\"), 800L, 800L, new Guid(\"8ba686b9-c505-4b49-9c74-2293add79f99\"), 1200L },\n                    { new Guid(\"a98e7b61-7d4d-4384-81fd-b11ad76e8e5b\"), 800L, 800L, new Guid(\"8ba686b9-c505-4b49-9c74-2293add79f99\"), 1200L },\n                    { new Guid(\"6735206f-5100-4f21-8a42-c7205104c000\"), 800L, 800L, new Guid(\"8ba686b9-c505-4b49-9c74-2293add79f99\"), 1200L },\n                    { new Guid(\"ab05b7cf-451a-4148-bd51-eadccd5daaba\"), 800L, 800L, new Guid(\"8ba686b9-c505-4b49-9c74-2293add79f99\"), 1200L },\n                    { new Guid(\"7be38ef0-5b42-48c3-a4f0-3646cef3fee4\"), 800L, 800L, new Guid(\"8ba686b9-c505-4b49-9c74-2293add79f99\"), 1200L },\n                    { new Guid(\"e0ae73cf-add1-4b8d-a3ed-5f28aaf3cb70\"), 800L, 800L, new Guid(\"005f50aa-23fc-4698-a10a-fb6e84280d07\"), 1200L },\n                    { new Guid(\"9cdb5c83-6911-4091-a10e-b3e789474605\"), 800L, 800L, new Guid(\"8ba686b9-c505-4b49-9c74-2293add79f99\"), 1200L },\n                    { new Guid(\"18beeee8-a10a-4052-928b-649438a5e56b\"), 800L, 800L, new Guid(\"005f50aa-23fc-4698-a10a-fb6e84280d07\"), 1200L },\n                    { new Guid(\"41bbbd4d-bbcd-4599-95bf-74591b0fa14f\"), 800L, 800L, new Guid(\"005f50aa-23fc-4698-a10a-fb6e84280d07\"), 1200L },\n                    { new Guid(\"10b29ed5-edd2-4d11-8923-270286c8a2f2\"), 800L, 800L, new Guid(\"7e0d6759-e633-4935-be57-1d3ed356c927\"), 1200L },\n                    { new Guid(\"b333be74-403b-488f-b9b9-03391605972a\"), 800L, 800L, new Guid(\"7e0d6759-e633-4935-be57-1d3ed356c927\"), 1200L },\n                    { new Guid(\"5abff486-7f8d-4b5a-abb8-6e0992b76c28\"), 800L, 800L, new Guid(\"7e0d6759-e633-4935-be57-1d3ed356c927\"), 1200L },\n                    { new Guid(\"bda20d97-d051-4088-92e4-7144674be54f\"), 800L, 800L, new Guid(\"7e0d6759-e633-4935-be57-1d3ed356c927\"), 1200L },\n                    { new Guid(\"3b622907-18a2-4f16-8362-0b10fd1a6b1a\"), 800L, 800L, new Guid(\"7e0d6759-e633-4935-be57-1d3ed356c927\"), 1200L },\n                    { new Guid(\"9313a423-ada8-44b4-8198-286ea99e54c9\"), 800L, 800L, new Guid(\"7e0d6759-e633-4935-be57-1d3ed356c927\"), 1200L },\n                    { new Guid(\"8572d363-11e1-4e57-87cc-48b34868c92c\"), 800L, 800L, new Guid(\"7e0d6759-e633-4935-be57-1d3ed356c927\"), 1200L },\n                    { new Guid(\"0836a861-57af-451b-8dc7-77d610bad733\"), 800L, 800L, new Guid(\"7e0d6759-e633-4935-be57-1d3ed356c927\"), 1200L },\n                    { new Guid(\"82259107-35ae-469a-bd6c-16d0c5db1b6c\"), 800L, 800L, new Guid(\"7e0d6759-e633-4935-be57-1d3ed356c927\"), 1200L },\n                    { new Guid(\"715840b3-132f-47d3-90df-97d792ba2765\"), 800L, 800L, new Guid(\"005f50aa-23fc-4698-a10a-fb6e84280d07\"), 1200L },\n                    { new Guid(\"975354b2-7033-4bc3-902f-2f2579bdaf69\"), 800L, 800L, new Guid(\"005f50aa-23fc-4698-a10a-fb6e84280d07\"), 1200L },\n                    { new Guid(\"43b45789-13b1-4973-8cf1-b58ba11097ab\"), 800L, 800L, new Guid(\"005f50aa-23fc-4698-a10a-fb6e84280d07\"), 1200L },\n                    { new Guid(\"18811716-4038-4000-8fa2-582b26d32625\"), 800L, 800L, new Guid(\"005f50aa-23fc-4698-a10a-fb6e84280d07\"), 1200L },\n                    { new Guid(\"a77cf797-1e2d-49af-a420-23c88c0f13f4\"), 800L, 800L, new Guid(\"005f50aa-23fc-4698-a10a-fb6e84280d07\"), 1200L },\n                    { new Guid(\"9756e657-7ba2-4cfb-bb0c-c6112d78fcdf\"), 800L, 800L, new Guid(\"005f50aa-23fc-4698-a10a-fb6e84280d07\"), 1200L },\n                    { new Guid(\"71685317-ca54-45a9-a0fa-dd68f230631b\"), 800L, 800L, new Guid(\"005f50aa-23fc-4698-a10a-fb6e84280d07\"), 1200L },\n                    { new Guid(\"fcc30407-fc47-47b7-831c-ee70a5bb02b6\"), 800L, 800L, new Guid(\"1049a6d0-5614-4882-85da-66c120a8e3af\"), 1200L },\n                    { new Guid(\"fbc06924-eae3-4eef-88f4-8d335cb80b7a\"), 800L, 800L, new Guid(\"8ba686b9-c505-4b49-9c74-2293add79f99\"), 1200L },\n                    { new Guid(\"c62253b3-cd91-4525-9f10-e926087b1d47\"), 800L, 800L, new Guid(\"8ba686b9-c505-4b49-9c74-2293add79f99\"), 1200L },\n                    { new Guid(\"f807cb10-7f3a-4797-9d19-a5a2d761df5b\"), 800L, 800L, new Guid(\"f18fdacd-03aa-481b-a9ec-e91d1b7089bb\"), 1200L },\n                    { new Guid(\"dfcda794-4bc0-4fd1-9559-a6f45bb3fc45\"), 800L, 800L, new Guid(\"f18fdacd-03aa-481b-a9ec-e91d1b7089bb\"), 1200L },\n                    { new Guid(\"10ab01f4-2bd0-4b7f-9e06-93e711c9ee05\"), 800L, 800L, new Guid(\"f1335d5c-ffb5-4f3c-b336-418f079f2931\"), 1200L },\n                    { new Guid(\"3c29864e-03f0-4ad4-8fe1-3b35301be267\"), 800L, 800L, new Guid(\"f1335d5c-ffb5-4f3c-b336-418f079f2931\"), 1200L },\n                    { new Guid(\"737fde2b-8931-4525-9811-8fd1c28d95a5\"), 800L, 800L, new Guid(\"f1335d5c-ffb5-4f3c-b336-418f079f2931\"), 1200L },\n                    { new Guid(\"52ffd4b8-691f-4971-b30a-7bfd044abf58\"), 800L, 800L, new Guid(\"f1335d5c-ffb5-4f3c-b336-418f079f2931\"), 1200L },\n                    { new Guid(\"481948c4-82fe-4908-b1fc-df0711be0745\"), 800L, 800L, new Guid(\"f1335d5c-ffb5-4f3c-b336-418f079f2931\"), 1200L },\n                    { new Guid(\"a68bf952-5254-42a2-8f48-64a1f43a5655\"), 800L, 800L, new Guid(\"f1335d5c-ffb5-4f3c-b336-418f079f2931\"), 1200L },\n                    { new Guid(\"ee7b8600-aeaa-4c4d-96e4-4d2f7f0812ba\"), 800L, 800L, new Guid(\"f1335d5c-ffb5-4f3c-b336-418f079f2931\"), 1200L },\n                    { new Guid(\"a14ce044-b009-45b5-95d8-ddc8a3f62e8c\"), 800L, 800L, new Guid(\"f1335d5c-ffb5-4f3c-b336-418f079f2931\"), 1200L },\n                    { new Guid(\"3aced6bd-d757-44fa-b306-5363628ea1d9\"), 800L, 800L, new Guid(\"f1335d5c-ffb5-4f3c-b336-418f079f2931\"), 1200L },\n                    { new Guid(\"1fb67099-9741-445e-9b0e-a6435be17e8d\"), 800L, 800L, new Guid(\"f1335d5c-ffb5-4f3c-b336-418f079f2931\"), 1200L },\n                    { new Guid(\"daa40ef5-b642-4c6f-b98b-fe9694261b56\"), 800L, 800L, new Guid(\"cb24558f-d7a1-46b6-8278-b40bc7303b97\"), 1200L },\n                    { new Guid(\"11e9cae6-58e0-4d43-aa6e-0c21d9d27550\"), 800L, 800L, new Guid(\"cb24558f-d7a1-46b6-8278-b40bc7303b97\"), 1200L },\n                    { new Guid(\"6d149337-1c11-4522-9164-501ca977fe88\"), 800L, 800L, new Guid(\"cb24558f-d7a1-46b6-8278-b40bc7303b97\"), 1200L },\n                    { new Guid(\"29f4e215-dfbf-477c-8154-98824b35bc34\"), 800L, 800L, new Guid(\"f18fdacd-03aa-481b-a9ec-e91d1b7089bb\"), 1200L },\n                    { new Guid(\"b682185a-3324-4b39-8b5d-613092e1d217\"), 800L, 800L, new Guid(\"8ba686b9-c505-4b49-9c74-2293add79f99\"), 1200L },\n                    { new Guid(\"28d4412b-432c-4535-b69e-a022d8509a2f\"), 800L, 800L, new Guid(\"f18fdacd-03aa-481b-a9ec-e91d1b7089bb\"), 1200L },\n                    { new Guid(\"32c59626-e6e9-47bb-b1a9-0f328519ca40\"), 800L, 800L, new Guid(\"f18fdacd-03aa-481b-a9ec-e91d1b7089bb\"), 1200L },\n                    { new Guid(\"65feb170-5c6a-42e6-b803-fe0b8d89e2ac\"), 800L, 800L, new Guid(\"8ba686b9-c505-4b49-9c74-2293add79f99\"), 1200L },\n                    { new Guid(\"a72d1d93-31f4-4e05-a18a-0a3d1d5aec5d\"), 800L, 800L, new Guid(\"8174b18a-32de-4e25-bc56-0c77d9596091\"), 1200L },\n                    { new Guid(\"7fec1393-aa07-4230-bf44-b466b36363df\"), 800L, 800L, new Guid(\"8174b18a-32de-4e25-bc56-0c77d9596091\"), 1200L },\n                    { new Guid(\"59b6913b-391b-4d76-9c6e-74631a78b6a4\"), 800L, 800L, new Guid(\"8174b18a-32de-4e25-bc56-0c77d9596091\"), 1200L },\n                    { new Guid(\"46b604c2-3b3d-4e02-b8a4-4064d60fc8da\"), 800L, 800L, new Guid(\"8174b18a-32de-4e25-bc56-0c77d9596091\"), 1200L },\n                    { new Guid(\"f6c12f57-2aa8-4898-a34c-dc2991cb0db2\"), 800L, 800L, new Guid(\"8174b18a-32de-4e25-bc56-0c77d9596091\"), 1200L },\n                    { new Guid(\"75f7c677-ecea-4ed5-b368-1637c91ff3c2\"), 800L, 800L, new Guid(\"8174b18a-32de-4e25-bc56-0c77d9596091\"), 1200L },\n                    { new Guid(\"17155aa4-d7c6-44ef-a014-1ba8e6eb0391\"), 800L, 800L, new Guid(\"8174b18a-32de-4e25-bc56-0c77d9596091\"), 1200L },\n                    { new Guid(\"cfc980d0-fe17-4d8a-a34a-64205d7a3313\"), 800L, 800L, new Guid(\"8174b18a-32de-4e25-bc56-0c77d9596091\"), 1200L },\n                    { new Guid(\"ebbb15a2-c36a-441a-92b2-77a615e76496\"), 800L, 800L, new Guid(\"8174b18a-32de-4e25-bc56-0c77d9596091\"), 1200L },\n                    { new Guid(\"3a34e9c2-b749-451c-a47c-70560ac375b1\"), 800L, 800L, new Guid(\"8174b18a-32de-4e25-bc56-0c77d9596091\"), 1200L },\n                    { new Guid(\"4c50914c-e15d-4653-b1f4-c60d8d3ab301\"), 800L, 800L, new Guid(\"f18fdacd-03aa-481b-a9ec-e91d1b7089bb\"), 1200L },\n                    { new Guid(\"1c2a3f75-f726-44f3-9082-3dd199cbfea6\"), 800L, 800L, new Guid(\"f18fdacd-03aa-481b-a9ec-e91d1b7089bb\"), 1200L },\n                    { new Guid(\"b59c3df0-9351-4f0a-ba94-e223a56e7fc8\"), 800L, 800L, new Guid(\"f18fdacd-03aa-481b-a9ec-e91d1b7089bb\"), 1200L },\n                    { new Guid(\"554b9f53-082b-4fa1-83c7-398e59b8ebd5\"), 800L, 800L, new Guid(\"f18fdacd-03aa-481b-a9ec-e91d1b7089bb\"), 1200L },\n                    { new Guid(\"6c0c8e00-c91b-4cc2-93b7-24548acfb659\"), 800L, 800L, new Guid(\"f18fdacd-03aa-481b-a9ec-e91d1b7089bb\"), 1200L },\n                    { new Guid(\"da40c027-1474-4e8a-9f9d-0af3a450ae59\"), 800L, 800L, new Guid(\"1049a6d0-5614-4882-85da-66c120a8e3af\"), 1200L }\n                });\n\n            migrationBuilder.InsertData(\n                table: \"StorageUnits\",\n                columns: new[] { \"Id\", \"Quantity\", \"ShelfId\", \"UnitId\" },\n                values: new object[,]\n                {\n                    { new Guid(\"64413c6f-7e1b-4f87-96a8-22d657909f79\"), 7, new Guid(\"96a459d8-34db-4ed4-b6f4-452689b100b2\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"0c297322-b49c-4965-979e-43eedf9fa573\"), 7, new Guid(\"7fe0075d-9f34-4dfe-9d93-57b63fc4e955\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"25309349-8ddc-4ee6-8dfc-5fbe8ead3a36\"), 3, new Guid(\"272d0bf0-d277-49e8-9765-5f8d89a797dc\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"492f38ba-b44f-47e7-9337-a630fd10390a\"), 5, new Guid(\"272d0bf0-d277-49e8-9765-5f8d89a797dc\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"4fda0b4c-5e4a-4d7f-aeed-aaa45b3884f6\"), 7, new Guid(\"272d0bf0-d277-49e8-9765-5f8d89a797dc\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"2f31ebbb-61fa-485d-b638-813a151f76c3\"), 3, new Guid(\"4c002831-0fa2-4a34-83a5-44ab3e034992\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"65efffd4-33fa-4abc-bfc8-51dc2b8de67f\"), 5, new Guid(\"4c002831-0fa2-4a34-83a5-44ab3e034992\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"9f932393-5168-4754-a892-45b8ebd602c2\"), 7, new Guid(\"4c002831-0fa2-4a34-83a5-44ab3e034992\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"63d49ef6-7497-4735-afa5-326b3da12f1c\"), 3, new Guid(\"5787b257-0b2c-4dc3-8331-2280dbb989d6\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"5101d790-dc82-44a0-944c-9f45bbf33cd9\"), 5, new Guid(\"5787b257-0b2c-4dc3-8331-2280dbb989d6\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"4748b0c0-8394-4ad0-94a7-21794b3c4831\"), 7, new Guid(\"5787b257-0b2c-4dc3-8331-2280dbb989d6\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"3d3da160-0103-423b-8756-03f45b9f225c\"), 3, new Guid(\"2e4ff5b1-85a9-4fa1-9bb3-55d5486ae305\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"1ed0d307-1f1c-4360-8f7d-541b0de863c1\"), 5, new Guid(\"7fe0075d-9f34-4dfe-9d93-57b63fc4e955\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"fe91b559-5128-4d41-8cce-b5b7af03e8c4\"), 5, new Guid(\"2e4ff5b1-85a9-4fa1-9bb3-55d5486ae305\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"06eb8a10-17e2-4add-a013-2763c1eecbd4\"), 3, new Guid(\"3a87ddd9-d22e-4e20-b41e-7a2178bb0b08\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"50117c97-7576-4f7f-8965-18207c0e5baf\"), 5, new Guid(\"3a87ddd9-d22e-4e20-b41e-7a2178bb0b08\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"5397dda7-28db-44fd-8d93-4f9ef7d91a5a\"), 7, new Guid(\"3a87ddd9-d22e-4e20-b41e-7a2178bb0b08\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"18fcf1fb-1a6c-4af4-b05d-82ccec4486c7\"), 3, new Guid(\"3006bbc3-1f10-4621-87c1-646268627b9a\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"3c4825b2-fcd0-4975-b909-e116b41bc3cc\"), 5, new Guid(\"3006bbc3-1f10-4621-87c1-646268627b9a\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"2d8fc34f-69f7-484d-b844-3a2d53718b94\"), 7, new Guid(\"3006bbc3-1f10-4621-87c1-646268627b9a\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"12560aae-4d90-4879-9529-37a2e90e04a2\"), 3, new Guid(\"ec9a4337-365a-44ad-9cd7-7c22c4e49edb\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"573565a5-d970-46fc-81fc-2762ae3907bd\"), 5, new Guid(\"ec9a4337-365a-44ad-9cd7-7c22c4e49edb\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"08cdbacf-1fac-45cb-a248-5be9efff7eea\"), 7, new Guid(\"ec9a4337-365a-44ad-9cd7-7c22c4e49edb\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"234d9b10-160e-4a3e-84fb-c449c5aed479\"), 3, new Guid(\"373aa72a-3d5d-41b5-b94f-239814aeadca\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"1a642836-61a3-4e22-8fa6-8c9cbe01a3ce\"), 5, new Guid(\"373aa72a-3d5d-41b5-b94f-239814aeadca\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"f1481856-74c9-43c7-8b9b-3fd402e7ff4b\"), 7, new Guid(\"2e4ff5b1-85a9-4fa1-9bb3-55d5486ae305\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"3c791791-69d2-4031-a9ce-13cb6395e1a4\"), 7, new Guid(\"373aa72a-3d5d-41b5-b94f-239814aeadca\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"7278847d-a4f2-401f-be04-e733dba8bd52\"), 3, new Guid(\"7fe0075d-9f34-4dfe-9d93-57b63fc4e955\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"3a7ac63f-2c90-4b9a-94cb-d7a09087761e\"), 5, new Guid(\"45de9085-dfbf-4253-a653-642e7c0b4855\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"61c9b017-a852-47f3-a6b6-a03b590379fc\"), 5, new Guid(\"9f39f6c7-2a28-4c52-b46a-c126c4c2d380\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"09a596ff-2ec5-4b7c-8bf3-cf365749eee6\"), 7, new Guid(\"9f39f6c7-2a28-4c52-b46a-c126c4c2d380\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"04410fca-fa0d-438f-a789-ccf2a80eb2e0\"), 3, new Guid(\"56db97fe-7a5b-4410-ae7b-e6933bce2d60\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"277d3862-8973-4739-85cd-a0c9ca3586cf\"), 5, new Guid(\"56db97fe-7a5b-4410-ae7b-e6933bce2d60\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"d1df2a7d-8af5-4f3a-b00b-20fa62ff9685\"), 7, new Guid(\"56db97fe-7a5b-4410-ae7b-e6933bce2d60\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"d8e32078-3200-4d34-8df4-15c40c631e3a\"), 3, new Guid(\"5f1156d7-5a82-4780-80f1-f576961dbf0e\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"0d800bec-0e4f-44c9-9f79-1528422ff2e6\"), 5, new Guid(\"5f1156d7-5a82-4780-80f1-f576961dbf0e\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"7116757b-3ff8-401d-9401-f567dbcc1565\"), 7, new Guid(\"5f1156d7-5a82-4780-80f1-f576961dbf0e\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"34fcf568-cd6a-4377-aac2-570a16e6e8b6\"), 3, new Guid(\"15e976de-8a86-4773-a647-f7ba61aac44c\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"a19ffd5d-b289-40eb-ac33-2a5c19cc5898\"), 5, new Guid(\"15e976de-8a86-4773-a647-f7ba61aac44c\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"6097bbf2-ec10-4d6e-ac18-23676d1d8b79\"), 7, new Guid(\"15e976de-8a86-4773-a647-f7ba61aac44c\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"1bb0964f-5b9f-4a44-8b28-1f2602a8f445\"), 7, new Guid(\"45de9085-dfbf-4253-a653-642e7c0b4855\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"3db9187f-7ab5-423e-ae05-e0ec6c7c26f1\"), 3, new Guid(\"6924ba58-124b-4fb3-810b-becb9733df7b\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"2dee1bb7-35d9-4756-9271-9332484ae381\"), 7, new Guid(\"6924ba58-124b-4fb3-810b-becb9733df7b\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"5f28ea46-0193-462b-a458-84ee06d6a17c\"), 3, new Guid(\"f490547b-18d1-43a3-a578-44e623084bda\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"d476bc5e-47ec-4ac7-9a9f-81a95d4a61d9\"), 5, new Guid(\"f490547b-18d1-43a3-a578-44e623084bda\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"6b6c1b9e-f2d4-4ec2-83d1-7cb34dd49515\"), 7, new Guid(\"f490547b-18d1-43a3-a578-44e623084bda\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"10d891a5-34c9-4ee4-a5e7-a743bda522aa\"), 3, new Guid(\"f4a55f71-a69e-473b-aa49-0c5d81dafb33\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"70f2a56a-bfa0-4d69-90a8-0eb4a9642d8b\"), 5, new Guid(\"f4a55f71-a69e-473b-aa49-0c5d81dafb33\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"d324282b-29ed-41e1-8c18-08055c634ccb\"), 7, new Guid(\"f4a55f71-a69e-473b-aa49-0c5d81dafb33\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"e78a3b80-f953-4658-925b-9ebd57a9f01f\"), 3, new Guid(\"482f5d25-6e6d-410a-99f6-68d3d9d77206\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"fa09e5e4-e541-4318-9ce5-a6dcf613f13d\"), 5, new Guid(\"482f5d25-6e6d-410a-99f6-68d3d9d77206\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"118460b7-0c3d-4bb8-b110-1a43403c91c4\"), 7, new Guid(\"482f5d25-6e6d-410a-99f6-68d3d9d77206\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"98ef22cb-db2f-4e74-9b41-bb7f08262319\"), 3, new Guid(\"45de9085-dfbf-4253-a653-642e7c0b4855\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"901a437e-4b9c-4260-baff-19b581abd843\"), 5, new Guid(\"6924ba58-124b-4fb3-810b-becb9733df7b\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"6eb1f14c-07d7-4459-9178-dd2540b0a738\"), 3, new Guid(\"9f39f6c7-2a28-4c52-b46a-c126c4c2d380\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"f3f5b863-a73f-415f-af7f-db540f6a9eed\"), 3, new Guid(\"4f8d7a4f-f906-4647-8e0c-5783a870d5b2\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"6ea63f8c-7609-4181-92cc-4d354aed00c0\"), 7, new Guid(\"4f8d7a4f-f906-4647-8e0c-5783a870d5b2\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"bebf5f71-e685-4099-80a1-7be3eb3c7bed\"), 5, new Guid(\"8585de7a-3537-4aef-8c38-e17cf6fbad9a\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"f2fee92d-3d28-48ef-a041-006732aa79c2\"), 7, new Guid(\"8585de7a-3537-4aef-8c38-e17cf6fbad9a\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"6d6e6308-d391-4a5c-9e1a-addd41b3d733\"), 3, new Guid(\"b4b420fa-6bf9-49ba-94b6-e050fa9a8d8c\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"7d5e1e2c-d1b2-4b82-b85b-9cf23b899a81\"), 5, new Guid(\"b4b420fa-6bf9-49ba-94b6-e050fa9a8d8c\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"522eac55-7491-4cf2-a080-a889747ad6b0\"), 7, new Guid(\"b4b420fa-6bf9-49ba-94b6-e050fa9a8d8c\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"d273a397-cb87-45d3-b16d-283c6fbe7490\"), 3, new Guid(\"06dcd08f-3ae9-45a2-9c39-3748d7c9fcbf\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"f91e1770-4be6-4493-8324-c2188ec00aff\"), 5, new Guid(\"06dcd08f-3ae9-45a2-9c39-3748d7c9fcbf\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"8e05d288-a8dd-4f76-a9e4-95d276659c7c\"), 7, new Guid(\"06dcd08f-3ae9-45a2-9c39-3748d7c9fcbf\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"95188b44-dbc7-4cfa-b8d6-fffac53e2595\"), 3, new Guid(\"bbb55ca6-d027-4614-bce4-d41df4ebe31c\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"2c59f861-dcd6-4089-b7a4-d02cf99863e9\"), 5, new Guid(\"bbb55ca6-d027-4614-bce4-d41df4ebe31c\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"001f54ba-4e07-4af0-aa5e-98c01b46af8f\"), 7, new Guid(\"bbb55ca6-d027-4614-bce4-d41df4ebe31c\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"449c3d26-9708-4c67-b50e-5b6275944900\"), 3, new Guid(\"8585de7a-3537-4aef-8c38-e17cf6fbad9a\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"d7ab9dc1-594d-4f1e-8757-e2cd44537f62\"), 3, new Guid(\"ee73a76e-3169-4496-9fe4-e44bd6f703b9\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"a74560e1-fbf9-4c41-bc99-f2c04c3b11ac\"), 7, new Guid(\"ee73a76e-3169-4496-9fe4-e44bd6f703b9\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"b6e1ce24-3acd-4236-87d1-e197f9f25fc1\"), 3, new Guid(\"90d2e76e-5034-40bb-bef6-510b5ed210dd\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"5d82ccbb-91b6-47a4-8a29-7c60b2ebb258\"), 5, new Guid(\"90d2e76e-5034-40bb-bef6-510b5ed210dd\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"d8317c95-03f0-441a-b396-85a720ad3e6b\"), 7, new Guid(\"90d2e76e-5034-40bb-bef6-510b5ed210dd\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"b0d24512-e852-4d63-93e5-d443eb670eef\"), 3, new Guid(\"e058b47c-2d71-45d8-a5ad-190ed5d4f8fd\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"8c5047ca-d3b0-4925-8d02-61f2d586ae0a\"), 5, new Guid(\"e058b47c-2d71-45d8-a5ad-190ed5d4f8fd\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"eef8c12d-e32c-4c35-aa67-2285d67f2db3\"), 7, new Guid(\"e058b47c-2d71-45d8-a5ad-190ed5d4f8fd\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"f773caa6-0bb3-4f18-9a29-e12dd4c28244\"), 3, new Guid(\"c6f46302-75f0-4741-b047-e98567b4bfcb\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"27286ec0-ad98-48d7-9922-60dfb7bbd087\"), 5, new Guid(\"c6f46302-75f0-4741-b047-e98567b4bfcb\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"852a7bf9-83ce-44c5-b38d-759680e84cb6\"), 7, new Guid(\"c6f46302-75f0-4741-b047-e98567b4bfcb\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"bae8c44d-742c-4768-baf6-3b6ab7c97664\"), 3, new Guid(\"043f231b-8515-4af5-ad1d-ade4b895b3b7\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"7c89ef3b-ff28-4d0d-bb57-b18699ef9c93\"), 5, new Guid(\"ee73a76e-3169-4496-9fe4-e44bd6f703b9\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"e98f8c98-b285-4f90-9ed0-ddf3b4976735\"), 5, new Guid(\"4f8d7a4f-f906-4647-8e0c-5783a870d5b2\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"919ef4a7-cf15-4af8-ba57-ded5713881db\"), 7, new Guid(\"77424bca-eef4-4714-ade5-b397ce2c0779\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"58e36405-5383-49c5-b3bd-63c99bcb2a53\"), 3, new Guid(\"77424bca-eef4-4714-ade5-b397ce2c0779\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"d870d186-5cdf-47bd-93b9-620fc1e4a720\"), 3, new Guid(\"53d84c81-b881-4b64-ba99-3eac12ba8c8f\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"f12fdf85-65b1-4051-97ef-1273d9c47a06\"), 5, new Guid(\"53d84c81-b881-4b64-ba99-3eac12ba8c8f\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"c8de5c9e-eeaa-4b50-b6e9-ef6671c31b87\"), 7, new Guid(\"53d84c81-b881-4b64-ba99-3eac12ba8c8f\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"0e7f545a-753f-4178-84d0-9ed69022d512\"), 3, new Guid(\"71150b5c-dd20-47cc-be20-6baf7bc46cd7\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"bc8e2959-480b-4e41-9e23-4237d285dd31\"), 5, new Guid(\"71150b5c-dd20-47cc-be20-6baf7bc46cd7\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"035fe31a-5d9f-498f-8c97-f86af0d485c9\"), 7, new Guid(\"71150b5c-dd20-47cc-be20-6baf7bc46cd7\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"e638dbd4-1eee-45bf-8151-15a0ec8604a5\"), 3, new Guid(\"06a42280-44f0-42a1-adfa-391a4063cbd0\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"4f4a5453-18a0-4c50-9253-3382288aeeee\"), 5, new Guid(\"06a42280-44f0-42a1-adfa-391a4063cbd0\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"689abbbf-8751-48b3-b5c4-ec7d8d433ea0\"), 7, new Guid(\"06a42280-44f0-42a1-adfa-391a4063cbd0\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"f45e4d3a-71f9-4bb4-84a2-6ead95e7b183\"), 3, new Guid(\"fd44e61e-e259-47a7-ac42-846b11d099fe\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"756d84a6-efd5-49bc-a24d-e66b87309124\"), 5, new Guid(\"fd44e61e-e259-47a7-ac42-846b11d099fe\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"9a9c6c83-f5bf-42f1-ae9f-e29423891ec0\"), 5, new Guid(\"77424bca-eef4-4714-ade5-b397ce2c0779\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"2227db96-4860-4b15-a9ff-3b6fe697d7a0\"), 7, new Guid(\"fd44e61e-e259-47a7-ac42-846b11d099fe\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"fb89bf8b-9c28-4a71-b8c8-585d5af1e1a3\"), 5, new Guid(\"4b9c1acf-42e9-4523-b0e8-5c32a875e228\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"417528a6-2291-44e7-8f08-21c06194ad11\"), 7, new Guid(\"4b9c1acf-42e9-4523-b0e8-5c32a875e228\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"e487b17e-0bea-43da-a5ed-11d54b3f7468\"), 3, new Guid(\"9d60ed5b-27b7-4119-b4eb-e2e0c242d313\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"300ee812-61bb-4bad-9559-daf6a399cce7\"), 5, new Guid(\"9d60ed5b-27b7-4119-b4eb-e2e0c242d313\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"67d17db8-9f01-4e97-853a-7b9fd4d8f4ee\"), 7, new Guid(\"9d60ed5b-27b7-4119-b4eb-e2e0c242d313\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"53e395d9-ecc9-44a6-a1ea-708277710ec4\"), 3, new Guid(\"d35bec08-3dc8-45e4-9c0d-065ace0f8bf2\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"118c5d4d-274d-42ed-afa8-e87dd0db2f45\"), 5, new Guid(\"d35bec08-3dc8-45e4-9c0d-065ace0f8bf2\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"ebfbb240-a525-4744-975a-07fef7ff785b\"), 7, new Guid(\"d35bec08-3dc8-45e4-9c0d-065ace0f8bf2\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"a49ad14f-4d09-4b15-9149-cad0b6c92c88\"), 3, new Guid(\"35a5ec06-c6ed-4616-a5ed-5bd89650a0c8\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"f25a39fc-0dc5-4eb4-b60f-119c2e1408ca\"), 5, new Guid(\"35a5ec06-c6ed-4616-a5ed-5bd89650a0c8\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"320dfc15-6f15-4cdf-86ee-fb51074c7219\"), 7, new Guid(\"35a5ec06-c6ed-4616-a5ed-5bd89650a0c8\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"e007185e-6621-4ea5-9af6-0b198114764e\"), 3, new Guid(\"4b9c1acf-42e9-4523-b0e8-5c32a875e228\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"36f0ed42-b8b3-4340-b7a7-b128c8168a21\"), 7, new Guid(\"6c977a83-c4ce-41f3-9d63-59bafcef5181\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"4ba47c82-7dd8-4ddc-9c01-79b6c46947df\"), 5, new Guid(\"6c977a83-c4ce-41f3-9d63-59bafcef5181\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"b6929b11-8f5b-4397-99bd-7ce42149f6b1\"), 3, new Guid(\"6c977a83-c4ce-41f3-9d63-59bafcef5181\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"6f78cdee-5ad1-4c7e-9e28-038449e3b970\"), 3, new Guid(\"44d517a2-9ddd-43d5-9619-db42ab2eef5a\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"79b26716-ced0-4a91-bc58-1e1a4497de78\"), 5, new Guid(\"44d517a2-9ddd-43d5-9619-db42ab2eef5a\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"b824d091-c3b6-470c-956b-90eb20966086\"), 7, new Guid(\"44d517a2-9ddd-43d5-9619-db42ab2eef5a\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"365ce8cb-3695-49b0-9f7e-dd14dc089a7f\"), 3, new Guid(\"759675d3-2ce0-4c8e-9113-ac29de8b6528\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"652c3dc3-0b0b-49b0-8c0d-9983d9b9d3ed\"), 5, new Guid(\"759675d3-2ce0-4c8e-9113-ac29de8b6528\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"534f852a-b50e-4f17-a89d-c848602c8fa0\"), 7, new Guid(\"759675d3-2ce0-4c8e-9113-ac29de8b6528\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"734a1dae-f902-4aa6-8435-8fcfcafaddb4\"), 3, new Guid(\"b3e01989-4f9a-4214-977c-3186ec24548c\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"a2587a67-483c-453a-8535-6720db73aa0f\"), 5, new Guid(\"b3e01989-4f9a-4214-977c-3186ec24548c\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"49b7fe5e-6bc1-4d95-88c3-3149fde7d0c2\"), 7, new Guid(\"b3e01989-4f9a-4214-977c-3186ec24548c\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"00f05854-9ce7-4021-885b-dce27536654e\"), 3, new Guid(\"99799c23-9a40-43bc-a62f-ec3c8fa6dfad\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"363f9b6d-215a-4572-b883-548ddbb870bd\"), 5, new Guid(\"99799c23-9a40-43bc-a62f-ec3c8fa6dfad\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"cf7124ab-ef2f-4e3a-86ef-f5657d161d07\"), 7, new Guid(\"cbe2cf5a-9049-4c0d-b9f4-8d1f831ee1d3\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"5c072d89-b985-47ca-9974-f8d7a632ce49\"), 7, new Guid(\"99799c23-9a40-43bc-a62f-ec3c8fa6dfad\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"64fc5e8a-a23b-47b0-b622-4b6092c53d8e\"), 5, new Guid(\"7ac46c7b-242c-44a2-b3f3-1f5a56c1f532\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"06283835-dc08-4442-a9f9-8e4f0a136893\"), 7, new Guid(\"7ac46c7b-242c-44a2-b3f3-1f5a56c1f532\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"4236f71d-7d04-45d6-89cb-298fe3937766\"), 3, new Guid(\"cc0221c8-29bc-46a8-b088-f154e50156ea\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"c3e352a8-1c97-479f-b64b-43b8abac289c\"), 5, new Guid(\"cc0221c8-29bc-46a8-b088-f154e50156ea\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"4ca87f54-6820-43e0-a768-0facea18e41d\"), 7, new Guid(\"cc0221c8-29bc-46a8-b088-f154e50156ea\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"669ab9ba-b296-4f42-908b-6a3d588a815f\"), 3, new Guid(\"31909f1d-ea40-43e9-8691-f9919f57a52a\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"e92ab55e-ad98-45f4-bbaf-b4ade7ba95f3\"), 5, new Guid(\"31909f1d-ea40-43e9-8691-f9919f57a52a\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"8e8df4d8-2507-425e-9647-6870bf1c2507\"), 7, new Guid(\"31909f1d-ea40-43e9-8691-f9919f57a52a\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"6ffd7b89-ef3c-4cd7-adb4-bd04fc225f71\"), 3, new Guid(\"6baa9f27-adf3-42cc-b62b-3699ba8d9e83\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"94529552-494a-4b41-8441-b3fa7796dc63\"), 5, new Guid(\"6baa9f27-adf3-42cc-b62b-3699ba8d9e83\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"36d62491-16dd-45ed-bf1a-a5bf1e604878\"), 7, new Guid(\"6baa9f27-adf3-42cc-b62b-3699ba8d9e83\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"822ab4f8-812c-4f5e-b432-9670d9ea01c3\"), 3, new Guid(\"7ac46c7b-242c-44a2-b3f3-1f5a56c1f532\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"469e2ad9-5c44-4705-b30e-975eb345546d\"), 3, new Guid(\"86d9ddea-b3ea-45b2-a03f-8220dece715a\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"e111321f-789d-42de-850c-d364193a4879\"), 5, new Guid(\"cbe2cf5a-9049-4c0d-b9f4-8d1f831ee1d3\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"1fb5fc0b-7c56-4ddb-8ad2-7753adc6a9c0\"), 7, new Guid(\"246c6a92-6fa1-4e12-8d28-a472a69cd127\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"f68a5d16-2653-4487-a82b-9558af632049\"), 7, new Guid(\"33dcb15b-3afd-40b3-8f73-4b6109be3cfa\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"a5c09fd3-754f-4f0c-add7-08f0bf836d18\"), 3, new Guid(\"622a7d83-2490-4d3d-b0f0-8624dc8edbc2\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"c30b94f4-678d-4161-b3e0-654012657404\"), 5, new Guid(\"622a7d83-2490-4d3d-b0f0-8624dc8edbc2\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"0509c440-f8c1-4268-9395-fa4a124f78ee\"), 7, new Guid(\"622a7d83-2490-4d3d-b0f0-8624dc8edbc2\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"5e966815-0383-4a97-83f9-01d49d63f357\"), 3, new Guid(\"1c487f01-909d-4390-a43f-7fef5aa9dfa7\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"7fba6464-228a-4e71-99b1-3a4a19b62ae1\"), 5, new Guid(\"1c487f01-909d-4390-a43f-7fef5aa9dfa7\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"69fb834c-d23a-4c02-83f5-fbaf943fe5ae\"), 7, new Guid(\"1c487f01-909d-4390-a43f-7fef5aa9dfa7\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"4404d6fd-1d8c-4081-a22d-091b1baf80f9\"), 3, new Guid(\"345e5cb4-fd5e-46e0-97de-709fd867bb02\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"66dd4462-cd48-459a-b2dd-b1112dc819ee\"), 5, new Guid(\"345e5cb4-fd5e-46e0-97de-709fd867bb02\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"b96dd9f3-be0c-453b-b5ab-e6db52115a9e\"), 7, new Guid(\"345e5cb4-fd5e-46e0-97de-709fd867bb02\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"b03a0e82-466e-47d0-b071-4ee1ef4e58e0\"), 3, new Guid(\"1a18c4d9-49d5-4430-bad1-57ee786f0f43\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"04195f04-2e6f-4495-876e-7f665b8d4e08\"), 3, new Guid(\"cbe2cf5a-9049-4c0d-b9f4-8d1f831ee1d3\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"56cda1b3-4c2a-4184-867b-a82146021465\"), 5, new Guid(\"1a18c4d9-49d5-4430-bad1-57ee786f0f43\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"1c6fb279-6ce5-4584-a72f-33b427f60bb2\"), 3, new Guid(\"40c1647d-c7d1-4323-9ee2-2acea4e6fa02\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"97da9e84-229a-46bc-b544-0f1dd2c7c4e8\"), 5, new Guid(\"40c1647d-c7d1-4323-9ee2-2acea4e6fa02\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"a0dabf81-4588-4529-8dbd-0edbe84b15b9\"), 7, new Guid(\"40c1647d-c7d1-4323-9ee2-2acea4e6fa02\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"bce6cd48-409d-4fdd-acbe-3c44c2f1bbad\"), 3, new Guid(\"d6819dde-0299-40b6-8680-a167a307f427\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"c90977b6-bded-4bf6-ac75-def6045a8f41\"), 5, new Guid(\"d6819dde-0299-40b6-8680-a167a307f427\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"ab9b6c0b-c595-4dc8-bd73-54cfba91597a\"), 7, new Guid(\"d6819dde-0299-40b6-8680-a167a307f427\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"210ff957-efd7-405c-801f-feb822dd05a3\"), 3, new Guid(\"a8c94149-488a-480a-a10b-f3e8b06ffa4d\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"3b9bd70c-0b1e-4ac8-9792-36b01359320d\"), 5, new Guid(\"a8c94149-488a-480a-a10b-f3e8b06ffa4d\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"d9ccc1ec-67a1-4d52-bd62-0be78626bd9f\"), 7, new Guid(\"a8c94149-488a-480a-a10b-f3e8b06ffa4d\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"2fff6cfb-dc2e-492d-b3a5-44aeb1c11d4f\"), 3, new Guid(\"246c6a92-6fa1-4e12-8d28-a472a69cd127\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"3bbcaf26-6b77-4028-ba0c-6389237c24a2\"), 5, new Guid(\"246c6a92-6fa1-4e12-8d28-a472a69cd127\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"99d0da46-0f1e-44a7-b95f-59bc6eb11d4b\"), 7, new Guid(\"1a18c4d9-49d5-4430-bad1-57ee786f0f43\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"4fa1caf8-29ba-4bfe-b678-8b3c268854c1\"), 5, new Guid(\"86d9ddea-b3ea-45b2-a03f-8220dece715a\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"b776a4a3-8f86-470e-b445-f1c6ba9ddcac\"), 7, new Guid(\"86d9ddea-b3ea-45b2-a03f-8220dece715a\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"005a142e-fdea-4b59-a487-428073c375ee\"), 3, new Guid(\"aba9067f-d21f-4cdb-891c-170734de8512\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"736d7a15-523f-4430-8fb0-51c4328f7bd1\"), 3, new Guid(\"2fce94fe-0f98-4a6b-b55a-fc5d88cf4049\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"38e206b7-69b4-44c8-8439-afe947b231d3\"), 5, new Guid(\"2fce94fe-0f98-4a6b-b55a-fc5d88cf4049\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"88c7ee8d-eee2-4c63-9c9e-e6367f17d607\"), 7, new Guid(\"2fce94fe-0f98-4a6b-b55a-fc5d88cf4049\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"2e85ad18-6db6-4291-9d72-362ad19781a1\"), 3, new Guid(\"e1569d42-bbd4-4ac3-9096-3b4e58a75b1b\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"bead7740-d2bd-4ddc-82cc-323281675d93\"), 5, new Guid(\"e1569d42-bbd4-4ac3-9096-3b4e58a75b1b\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"8e86c92f-4cc3-4c31-9736-cf092b029301\"), 7, new Guid(\"e1569d42-bbd4-4ac3-9096-3b4e58a75b1b\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"899c02f7-c417-4e09-9fe8-4938a072c88e\"), 3, new Guid(\"e7aec9dc-8ccb-4055-8396-d12854490e50\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"33f0c24e-e83e-42ce-83ee-c655495fe6f6\"), 5, new Guid(\"e7aec9dc-8ccb-4055-8396-d12854490e50\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"486c0e8c-b14d-4736-83fe-e320e7a98cb6\"), 7, new Guid(\"e7aec9dc-8ccb-4055-8396-d12854490e50\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"7e211c8c-50dd-4c4d-85b1-8c8c25aa0f8a\"), 3, new Guid(\"a7d9c123-fac7-4944-a9ed-5692a79c3dcd\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"f66646a1-6c57-42c5-b190-a4db59d73ea8\"), 5, new Guid(\"a7d9c123-fac7-4944-a9ed-5692a79c3dcd\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"ab80d2ea-4f94-44f6-a51d-87fdb7110410\"), 7, new Guid(\"8a650447-1e22-4fd5-9f79-ff29e5674ed3\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"3502d76b-3826-40a5-9332-93172ace6da0\"), 7, new Guid(\"a7d9c123-fac7-4944-a9ed-5692a79c3dcd\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"ea40d8fe-4eaf-4adc-adac-95f3635c8bf8\"), 5, new Guid(\"3fa37c2e-5a29-421c-8b1b-9a3b018a8b1f\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"1b2d7343-875b-47c9-8c4f-0a9f3f5d98e1\"), 7, new Guid(\"3fa37c2e-5a29-421c-8b1b-9a3b018a8b1f\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"bf06d692-373b-47fa-aff0-b51363b0886b\"), 3, new Guid(\"7d87fc12-7812-4203-858a-779c98154189\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"c70d2c74-fe77-4e95-ac80-b2507b211b4e\"), 5, new Guid(\"7d87fc12-7812-4203-858a-779c98154189\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"9aa25bca-f0c8-4a96-b3fc-890cf11d5240\"), 7, new Guid(\"7d87fc12-7812-4203-858a-779c98154189\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"1a608134-a672-41bd-940f-609894a4ef0b\"), 3, new Guid(\"ccaa532b-111a-4054-aeda-f649ef4b9ab7\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"8bb659b9-0a7e-4731-a572-63e299b6468f\"), 5, new Guid(\"ccaa532b-111a-4054-aeda-f649ef4b9ab7\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"f5a72952-b4fa-49dd-a17c-e146d08a9644\"), 7, new Guid(\"ccaa532b-111a-4054-aeda-f649ef4b9ab7\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"81c46d30-11de-4afd-89ca-dea30cae46a2\"), 3, new Guid(\"4e72dd9e-76a0-49ab-ab5d-e73b350b5950\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"b385299a-4bd1-4a02-be12-b4e5a34ae2c4\"), 5, new Guid(\"4e72dd9e-76a0-49ab-ab5d-e73b350b5950\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"6029ae78-6fab-462e-bb28-c39c04d4827a\"), 7, new Guid(\"4e72dd9e-76a0-49ab-ab5d-e73b350b5950\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"c451392d-707d-465b-ba19-6a2c593e752e\"), 3, new Guid(\"3fa37c2e-5a29-421c-8b1b-9a3b018a8b1f\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"cb0c03c0-fb12-48df-8fe8-544a2965fc2e\"), 5, new Guid(\"8a650447-1e22-4fd5-9f79-ff29e5674ed3\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"39a97fc2-d40d-4c00-81c3-c90a657a3bd0\"), 3, new Guid(\"8a650447-1e22-4fd5-9f79-ff29e5674ed3\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"c9610241-7b8d-4a63-b8a4-4f281bfaf520\"), 7, new Guid(\"02348077-17f6-4c88-8262-f67ab70eb270\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"68ecd0bd-dd0a-4d66-8a8e-53eb2f370c2b\"), 5, new Guid(\"aba9067f-d21f-4cdb-891c-170734de8512\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"83950dbf-6c74-4dfe-9da1-0404de4a6d0b\"), 7, new Guid(\"aba9067f-d21f-4cdb-891c-170734de8512\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"638e63d9-e589-4c79-9307-cbc77a679833\"), 3, new Guid(\"a3836d87-21b3-4d76-b027-31432e5fc758\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"1e71b673-6af3-433f-9f0e-c135c23a6053\"), 5, new Guid(\"a3836d87-21b3-4d76-b027-31432e5fc758\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"f3d76a14-c5e3-462f-814b-77c1a7416538\"), 7, new Guid(\"a3836d87-21b3-4d76-b027-31432e5fc758\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"4e823820-6fcf-41d7-a869-2a8dfce79e1d\"), 3, new Guid(\"85e13881-0563-4852-93e3-39174ad7ab37\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"4e53b35a-c956-476a-a823-808b41d9c296\"), 5, new Guid(\"85e13881-0563-4852-93e3-39174ad7ab37\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"302d6e0e-a0b6-4c6d-bc43-bc4f1bdcaf32\"), 7, new Guid(\"85e13881-0563-4852-93e3-39174ad7ab37\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"2328b3a8-4fa3-4302-8ccb-c03332417f5d\"), 3, new Guid(\"7bbcf26f-90ce-4bca-a2fe-7268e54d6ebf\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"42e9d67a-d892-4d2f-a73a-d915a9b0354d\"), 5, new Guid(\"7bbcf26f-90ce-4bca-a2fe-7268e54d6ebf\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"982cd104-01f7-4fa4-896a-5ad10c633a57\"), 7, new Guid(\"7bbcf26f-90ce-4bca-a2fe-7268e54d6ebf\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"9cf1a04a-b427-40e1-92f6-7b1694d43067\"), 3, new Guid(\"8f3863cb-e328-4265-8354-0755b52eea66\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"20ceaf86-a983-460d-a2d2-824b6a4d61fa\"), 5, new Guid(\"8f3863cb-e328-4265-8354-0755b52eea66\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"e2a2f228-a24b-4905-8c51-7e35b1f43adb\"), 7, new Guid(\"8f3863cb-e328-4265-8354-0755b52eea66\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"b1fc9072-dc30-4106-bed6-4a8d2eb6b20c\"), 3, new Guid(\"3cb8ebd2-bfbc-4eaa-8675-e98bfe9f02ea\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"6253c047-9bb4-4fda-b51e-9e11d7b9b072\"), 5, new Guid(\"3cb8ebd2-bfbc-4eaa-8675-e98bfe9f02ea\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"f266e962-7262-4165-b249-945acb8a2355\"), 7, new Guid(\"3cb8ebd2-bfbc-4eaa-8675-e98bfe9f02ea\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"1f22055b-6d63-4a16-81ec-b10e753e9386\"), 3, new Guid(\"8c5f55e4-ee02-49a5-a734-96880855210b\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"ad37f10a-7e45-44bc-b128-548b5ae2395a\"), 5, new Guid(\"8c5f55e4-ee02-49a5-a734-96880855210b\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"f83bda30-26fe-4ef7-b7cf-868dcf5c909a\"), 7, new Guid(\"8c5f55e4-ee02-49a5-a734-96880855210b\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"c5701352-4270-442a-ba83-188e9ff584af\"), 3, new Guid(\"d56bf158-40c3-4e19-8627-d3c7babf9d30\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"6eaa7674-2ad5-4dc6-a998-8b316dc4355e\"), 5, new Guid(\"d56bf158-40c3-4e19-8627-d3c7babf9d30\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"18a98fed-f55b-4502-a116-d1484d1e73e3\"), 7, new Guid(\"d56bf158-40c3-4e19-8627-d3c7babf9d30\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"45eef6c6-0baf-4165-866d-b62935aed802\"), 3, new Guid(\"02348077-17f6-4c88-8262-f67ab70eb270\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"090d1acd-0dbf-44b9-973a-b26f5021439b\"), 5, new Guid(\"02348077-17f6-4c88-8262-f67ab70eb270\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"4383f1ef-ee13-4602-aec9-f34996ae388d\"), 5, new Guid(\"043f231b-8515-4af5-ad1d-ade4b895b3b7\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"5b2afab7-da95-4756-90b8-cfdfe68120c3\"), 5, new Guid(\"33dcb15b-3afd-40b3-8f73-4b6109be3cfa\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"ec8b3fb8-1c15-4495-98f7-029f4ef19fcd\"), 7, new Guid(\"043f231b-8515-4af5-ad1d-ade4b895b3b7\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"be7d183c-2986-4b7d-bdd5-efd3d997b7d6\"), 5, new Guid(\"0f49d651-9eda-46d1-9fc9-7f6f17f4f8f1\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"ae30914e-211e-4806-a49f-6eaf9849c61b\"), 7, new Guid(\"2a3a2ae6-d0e5-4ea9-8ddc-0af5fd1ed245\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"dae3beec-2fb6-45e3-907a-706b26167f11\"), 3, new Guid(\"843695e6-56e4-4aac-af02-67dee0ec525f\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"dfdd5066-ea54-4fc9-b0ee-a0baeaa15818\"), 5, new Guid(\"843695e6-56e4-4aac-af02-67dee0ec525f\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"fe8da5f0-9875-4d67-88bb-95b162cd6446\"), 7, new Guid(\"843695e6-56e4-4aac-af02-67dee0ec525f\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"f754f3de-a5c1-4a57-876d-08b0f4bf1151\"), 3, new Guid(\"f25b0183-d53a-4926-96a1-3ad4315b022e\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"5d0f410b-d678-48e1-926d-444f2d990457\"), 5, new Guid(\"f25b0183-d53a-4926-96a1-3ad4315b022e\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"9afb2479-b3ad-4227-af3a-a16c289e5102\"), 7, new Guid(\"f25b0183-d53a-4926-96a1-3ad4315b022e\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"a3e1eda2-4783-4582-8d77-8b24871cbdde\"), 3, new Guid(\"d7279057-5863-4dc8-9be3-44cef094aaee\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"a67e49f7-b394-426d-acb3-6bf07fc06a0d\"), 5, new Guid(\"d7279057-5863-4dc8-9be3-44cef094aaee\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"985c7caa-a964-4476-9dfd-800562e0289f\"), 7, new Guid(\"d7279057-5863-4dc8-9be3-44cef094aaee\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"94d332c6-3cbe-49d4-a124-b3044302fa6a\"), 3, new Guid(\"5a1eeaf8-11bd-4596-8658-93dae9388cd8\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"706da4bf-f059-44f1-8678-8f6274b5e09e\"), 5, new Guid(\"2a3a2ae6-d0e5-4ea9-8ddc-0af5fd1ed245\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"9b91da47-e78f-4e0d-9b2b-d6edf2e728cd\"), 5, new Guid(\"5a1eeaf8-11bd-4596-8658-93dae9388cd8\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"719a1c5b-9c50-41fe-91f7-979f1b9d63d4\"), 3, new Guid(\"95e736a1-b03e-42e3-aa65-ae2b76992cfb\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"45014045-7b3b-4e07-a407-7551fe76cc05\"), 5, new Guid(\"95e736a1-b03e-42e3-aa65-ae2b76992cfb\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"3b68f67f-8319-4364-a7da-c52b7fb53c58\"), 7, new Guid(\"95e736a1-b03e-42e3-aa65-ae2b76992cfb\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"774827c3-db77-4cdd-8dc3-238df056993b\"), 3, new Guid(\"a0136882-071a-4dc0-beee-cfd8fe464e01\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"27991155-558e-4687-8b51-4394c20c9d3a\"), 5, new Guid(\"a0136882-071a-4dc0-beee-cfd8fe464e01\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"e8393800-d87c-4ba5-a1c4-41dd6584babc\"), 7, new Guid(\"a0136882-071a-4dc0-beee-cfd8fe464e01\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"27bcb34e-a7f8-45ab-926c-038a52ef5d10\"), 3, new Guid(\"74f13e2f-73fb-4969-a674-3e0fc1eada84\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"147a1989-8cca-4324-af7e-70d9daa964ef\"), 5, new Guid(\"74f13e2f-73fb-4969-a674-3e0fc1eada84\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"97cc102b-ca0b-445f-a2b7-e84cef0f50cb\"), 7, new Guid(\"74f13e2f-73fb-4969-a674-3e0fc1eada84\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"1a28c28d-b0c2-459a-b22d-73d77ff6f4bf\"), 3, new Guid(\"9ca89b86-8934-467c-9f42-22133309a7a9\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"1ee3ac80-da25-4acc-a087-b805e5c50b09\"), 5, new Guid(\"9ca89b86-8934-467c-9f42-22133309a7a9\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"b132f0c7-9b30-44c9-bcb4-64f92e371092\"), 7, new Guid(\"5a1eeaf8-11bd-4596-8658-93dae9388cd8\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"984e216d-c558-4aee-9464-0598370f0014\"), 7, new Guid(\"9ca89b86-8934-467c-9f42-22133309a7a9\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"6bf8f428-5d7b-43fa-b620-134f7e6da4be\"), 3, new Guid(\"2a3a2ae6-d0e5-4ea9-8ddc-0af5fd1ed245\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"0f9bafb0-4129-4bfb-bcbd-5116b83ad91f\"), 5, new Guid(\"e9096192-8068-4bf8-96a1-688aed778987\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"dd3ee0ea-a080-4b65-a6a4-237e23789cd1\"), 5, new Guid(\"c8b369ba-ffd3-43ba-b08a-c81f45b307fd\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"51102522-f27c-4807-a687-e848d51de6f4\"), 7, new Guid(\"c8b369ba-ffd3-43ba-b08a-c81f45b307fd\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"8bb7b715-d8c4-4445-be87-c937cf85dc94\"), 3, new Guid(\"4e590fc5-7691-4198-acac-43bab02c33f9\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"585cdd45-09c2-48fd-8839-e4a86ef590f6\"), 5, new Guid(\"4e590fc5-7691-4198-acac-43bab02c33f9\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"b1cfd754-1942-4a6e-836f-2d6f09a09a96\"), 7, new Guid(\"4e590fc5-7691-4198-acac-43bab02c33f9\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"181fd6db-e03b-4248-b9b5-6cf062b2b271\"), 3, new Guid(\"f9beca4d-996f-421a-bc2d-1100a606e597\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"123d3c53-a741-40f2-af33-7454c0bec92e\"), 5, new Guid(\"f9beca4d-996f-421a-bc2d-1100a606e597\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"199a6172-bcee-4019-a74f-1b21241cc247\"), 7, new Guid(\"f9beca4d-996f-421a-bc2d-1100a606e597\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"aeb7fe32-03b1-483a-8c88-c5f865902b32\"), 3, new Guid(\"7b5a8751-e25e-4236-accd-096f7cecf19a\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"eef14b67-21cd-470a-a646-43baae9c49ff\"), 5, new Guid(\"7b5a8751-e25e-4236-accd-096f7cecf19a\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"3f0aafa9-4984-4758-8548-97067ce8835d\"), 7, new Guid(\"7b5a8751-e25e-4236-accd-096f7cecf19a\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"eb2771a2-5773-42af-8b3f-d427e45c54d9\"), 7, new Guid(\"e9096192-8068-4bf8-96a1-688aed778987\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"2487f5a5-7995-49fc-9cc2-49286555afb5\"), 3, new Guid(\"183f8ac3-15b5-4d68-9ccb-4fc95c8a31b1\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"0f0ed205-5743-4d91-9c22-8c9939ea2003\"), 7, new Guid(\"183f8ac3-15b5-4d68-9ccb-4fc95c8a31b1\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"bb82f56c-435e-4841-b001-81aa77119a91\"), 3, new Guid(\"a3733264-c532-48a6-82cd-e5223b2c8741\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"e2daa7bb-1744-43e9-ad37-69a45e5222d0\"), 5, new Guid(\"a3733264-c532-48a6-82cd-e5223b2c8741\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"1cb6523a-feee-4a42-b3dc-f185bc61ffbd\"), 7, new Guid(\"a3733264-c532-48a6-82cd-e5223b2c8741\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"240d8ae7-7af3-4fbd-88c1-c2537ad78715\"), 3, new Guid(\"853dd568-f9a0-4a98-8019-45a09335c380\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"b7cfd413-7b11-4df0-b8cd-eba73f6214cb\"), 5, new Guid(\"853dd568-f9a0-4a98-8019-45a09335c380\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"0b439c21-0095-4275-b4dc-3fd088d56ec0\"), 7, new Guid(\"853dd568-f9a0-4a98-8019-45a09335c380\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"ded88013-96fc-4671-b7d1-e299c94ca529\"), 3, new Guid(\"1535fd9e-ddc0-461b-a659-38deb8888bfe\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"1ac500bd-2725-4349-a4d5-9d586f8b91be\"), 5, new Guid(\"1535fd9e-ddc0-461b-a659-38deb8888bfe\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"9e046c55-4ca9-455a-9981-6798ea1f5c1f\"), 7, new Guid(\"1535fd9e-ddc0-461b-a659-38deb8888bfe\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"8cfd24a1-edc3-4065-a658-349ed936f661\"), 3, new Guid(\"e9096192-8068-4bf8-96a1-688aed778987\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"376e64bd-5973-47bc-8060-2d4def13e2d1\"), 5, new Guid(\"183f8ac3-15b5-4d68-9ccb-4fc95c8a31b1\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"5eb4f019-11e2-4b2a-87e3-a31d8c001407\"), 3, new Guid(\"c8b369ba-ffd3-43ba-b08a-c81f45b307fd\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"47abacc7-82bb-4316-ae7f-4a8279abc96c\"), 3, new Guid(\"ed3e2331-16b9-4cda-b46a-4522d8fb8c06\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"67df32fa-4e6f-4492-92bb-195d0b881df5\"), 7, new Guid(\"ed3e2331-16b9-4cda-b46a-4522d8fb8c06\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"a9878419-e771-49d6-9f97-2b094699c1fd\"), 5, new Guid(\"b7832786-fa92-4d50-aba5-32626a6291e5\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"48f29d04-01d4-4936-8d89-edb8453c4e87\"), 7, new Guid(\"b7832786-fa92-4d50-aba5-32626a6291e5\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"2a9686d8-09fa-4682-8f65-c612f2c8f4a2\"), 3, new Guid(\"d1027193-c60c-4a58-a78a-ffb628e79ef7\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"bfa7a5e9-d54a-4695-a70e-b785177214c2\"), 5, new Guid(\"d1027193-c60c-4a58-a78a-ffb628e79ef7\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"4c50437f-0575-4455-981d-8471cf1ffc4c\"), 7, new Guid(\"d1027193-c60c-4a58-a78a-ffb628e79ef7\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"6bf68446-b163-4991-8090-aba42aa5a89c\"), 3, new Guid(\"9195be9e-26e8-4b74-9f43-a02f5822848f\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"af41490f-89a3-4409-9d96-ad8d5a20893d\"), 5, new Guid(\"9195be9e-26e8-4b74-9f43-a02f5822848f\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"abcca086-d003-469f-bf99-739741929cc9\"), 7, new Guid(\"9195be9e-26e8-4b74-9f43-a02f5822848f\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"e3b70d70-20ba-4a0c-8880-26ebb5304aab\"), 3, new Guid(\"84a875a8-45ac-465c-94ed-68c12bf1df0b\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"aae46459-b2cc-41a9-96ac-a7337daed976\"), 5, new Guid(\"84a875a8-45ac-465c-94ed-68c12bf1df0b\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"e91a18c2-3186-41da-83ba-8e03e1ff8263\"), 7, new Guid(\"84a875a8-45ac-465c-94ed-68c12bf1df0b\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"3e887488-81e8-471e-bf67-f672f463086f\"), 3, new Guid(\"b7832786-fa92-4d50-aba5-32626a6291e5\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"012ec40b-2fba-458e-80ed-e8c3f5159831\"), 3, new Guid(\"13ae33cf-a77a-4dc4-87a2-4b24d8c6c943\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"6a5d1fac-258d-4f5c-88f6-9f5e32715dd3\"), 7, new Guid(\"13ae33cf-a77a-4dc4-87a2-4b24d8c6c943\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"ec699d64-4dda-455c-9e10-d10c33b03bc3\"), 3, new Guid(\"98b2444d-9dec-4595-bd53-06f3014ccda7\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"a520c1e1-556d-4f90-b321-b0e6f3d9cb41\"), 5, new Guid(\"98b2444d-9dec-4595-bd53-06f3014ccda7\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"40d785b0-2bdf-4609-8ec5-4127c36043da\"), 7, new Guid(\"98b2444d-9dec-4595-bd53-06f3014ccda7\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"27d234bc-2529-4d17-ae1b-a925eb64d8b4\"), 3, new Guid(\"1b5d2854-2d5e-4d3d-820f-225fd86b5243\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"5c056278-f92a-4978-ad58-3b66277835fa\"), 5, new Guid(\"1b5d2854-2d5e-4d3d-820f-225fd86b5243\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"dd2ec746-e045-46f6-b47e-14461a0dbd53\"), 7, new Guid(\"1b5d2854-2d5e-4d3d-820f-225fd86b5243\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"28719567-bb65-42bd-a3ad-460cdc410e8d\"), 3, new Guid(\"243f5726-184e-4703-a97d-aa004d27f009\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"df34ea4f-0d4f-433d-881b-4e1bdc8e6174\"), 5, new Guid(\"243f5726-184e-4703-a97d-aa004d27f009\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"75d438f3-d64b-4536-926a-c7680b0f4005\"), 7, new Guid(\"243f5726-184e-4703-a97d-aa004d27f009\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"949fd2bf-77e0-4948-a57d-f05eb5c4fecd\"), 3, new Guid(\"b66c153a-776b-4b19-aa19-50a3710d53b6\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"ffa487f8-e329-48ad-b636-2e763891dfbf\"), 5, new Guid(\"13ae33cf-a77a-4dc4-87a2-4b24d8c6c943\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"6b7d8c2e-8286-4b07-914c-4fefb70c93eb\"), 5, new Guid(\"ed3e2331-16b9-4cda-b46a-4522d8fb8c06\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"f2061a03-464f-4fe3-ac1e-ddd689846d63\"), 7, new Guid(\"657c51d8-7167-415c-af53-a7238ed65861\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"89b9a861-5d10-46ab-a0c8-35466cbd01d4\"), 3, new Guid(\"657c51d8-7167-415c-af53-a7238ed65861\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"2f3bdf68-a669-41d4-89e0-3a20d0f76a29\"), 3, new Guid(\"4fe76c24-64e4-4fda-921d-3173d508c511\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"af68667d-7e91-4f23-872f-d846e2c98ba9\"), 5, new Guid(\"4fe76c24-64e4-4fda-921d-3173d508c511\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"defe36d0-3c8b-4caf-aea0-395accfe4a7a\"), 7, new Guid(\"4fe76c24-64e4-4fda-921d-3173d508c511\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"6d501966-b332-42b8-8959-e1bb8a9af383\"), 3, new Guid(\"8158b790-e457-479f-b31f-71fa7340babb\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"65d47274-ffcf-42a1-9554-9f776a1dfb84\"), 5, new Guid(\"8158b790-e457-479f-b31f-71fa7340babb\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"bf95a2eb-c0fb-4f0f-9a3e-a71f74e328ef\"), 7, new Guid(\"8158b790-e457-479f-b31f-71fa7340babb\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"854bc9df-50b8-4a06-a12c-4e2d25765bff\"), 3, new Guid(\"a2b765fe-a72b-466c-8014-d7690fb7a2e3\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"94e4eec1-990f-4038-a16a-14198d71b4a5\"), 5, new Guid(\"a2b765fe-a72b-466c-8014-d7690fb7a2e3\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"53f47406-ab44-4b97-9a50-465345b706e7\"), 7, new Guid(\"a2b765fe-a72b-466c-8014-d7690fb7a2e3\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"563fe562-a9b3-4943-9293-cbcbdeaa29a7\"), 3, new Guid(\"86442e95-b57f-4279-a5e2-97c59ec787ba\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"2a0d3c2f-ac4b-4265-96c7-d4f8188755a3\"), 5, new Guid(\"86442e95-b57f-4279-a5e2-97c59ec787ba\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"fc1f6b96-8e6a-4109-80f3-e4942cfbf716\"), 5, new Guid(\"657c51d8-7167-415c-af53-a7238ed65861\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"a5089fc3-683c-4e01-9794-9f27807b650f\"), 7, new Guid(\"86442e95-b57f-4279-a5e2-97c59ec787ba\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"7535e20f-342c-45fd-81e4-8dba914b44d0\"), 5, new Guid(\"af9904e5-9671-45df-9042-15c70a091251\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"208c30c0-eb34-44fb-bbdf-6aacd56023ff\"), 7, new Guid(\"af9904e5-9671-45df-9042-15c70a091251\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"d13c3ca2-b020-4aa6-b992-641c4d62a1ba\"), 3, new Guid(\"3946b605-5d8b-4d7f-9692-41fef1d3c6fc\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"1fda2113-45a1-4659-b662-ada8f31ffc63\"), 5, new Guid(\"3946b605-5d8b-4d7f-9692-41fef1d3c6fc\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"4c392a1d-4d25-4ca5-97ec-36fa6c427714\"), 7, new Guid(\"3946b605-5d8b-4d7f-9692-41fef1d3c6fc\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"fc698d16-a0c6-4fbc-baef-6e76ee8b0d8a\"), 3, new Guid(\"0f436dfe-a28c-41bb-ba61-8ba6c0dbcd11\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"351d7018-e367-4254-9dcd-78b5a350af4e\"), 5, new Guid(\"0f436dfe-a28c-41bb-ba61-8ba6c0dbcd11\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"fb523b63-d6cb-4afe-8d99-581994906259\"), 7, new Guid(\"0f436dfe-a28c-41bb-ba61-8ba6c0dbcd11\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"fd08acae-f899-41e8-b721-8bc600cef4e4\"), 3, new Guid(\"95a41871-37d4-4768-9dc1-d0d9724f7f32\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"6a0d8144-ae22-4014-9b87-4dbedf52ece1\"), 5, new Guid(\"95a41871-37d4-4768-9dc1-d0d9724f7f32\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"0afc7d86-dac0-441b-a413-0b7254694280\"), 7, new Guid(\"95a41871-37d4-4768-9dc1-d0d9724f7f32\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"735f1ecd-a18b-4d33-a9d9-ef55af475966\"), 3, new Guid(\"af9904e5-9671-45df-9042-15c70a091251\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"953dd35b-8638-45b3-8eb4-4c9b760ae8bb\"), 7, new Guid(\"419ee2fa-275a-4ef8-bf95-36517291cb63\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"457d6574-69d8-412c-bc36-9b612d85fcc4\"), 5, new Guid(\"419ee2fa-275a-4ef8-bf95-36517291cb63\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"178063dc-cd29-454b-b2ab-7df14e9c8562\"), 3, new Guid(\"419ee2fa-275a-4ef8-bf95-36517291cb63\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"fc855d3b-ff33-4d9f-ae69-41552ccaf6bd\"), 3, new Guid(\"b1719b5f-0212-42b9-bbf5-81aef0e25892\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"4da79007-388a-47f2-88bd-53e73517d660\"), 5, new Guid(\"b1719b5f-0212-42b9-bbf5-81aef0e25892\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"5580ee22-4977-4617-994f-1fadd429f691\"), 7, new Guid(\"b1719b5f-0212-42b9-bbf5-81aef0e25892\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"bafcf46a-aa8a-4e6d-b476-a79c7c5e27d4\"), 3, new Guid(\"cefc7e20-6c2c-42dc-9e20-9a11a64b754c\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"b2504d96-90d6-4a9a-bb79-3789defb2c64\"), 5, new Guid(\"cefc7e20-6c2c-42dc-9e20-9a11a64b754c\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"0f5a6da4-ef77-4899-adbe-7669ddb2ea74\"), 7, new Guid(\"cefc7e20-6c2c-42dc-9e20-9a11a64b754c\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"fd822712-2132-4e6d-9587-7f8fd980e91a\"), 3, new Guid(\"9776d720-09b0-473a-8972-df6b16cb09ac\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"771214a9-2df6-43c4-a831-c0ac0914e6ba\"), 5, new Guid(\"9776d720-09b0-473a-8972-df6b16cb09ac\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"2ca506d7-feb9-4195-8a4e-cf4dc8c38b04\"), 7, new Guid(\"9776d720-09b0-473a-8972-df6b16cb09ac\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"eff6a07d-5605-4553-a7c9-301487ef0ed9\"), 3, new Guid(\"8e2a6e72-0d2d-4f2b-b5e1-bd56a02b87d7\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"b3365eca-abb8-4853-8cde-56d700f71c77\"), 5, new Guid(\"8e2a6e72-0d2d-4f2b-b5e1-bd56a02b87d7\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"3d3a7d7c-cb43-405a-9969-dabab1f80a1a\"), 7, new Guid(\"8e05d53e-2888-4ffa-9401-fe732f3838d1\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"beba91e8-5f47-4e60-add1-aac1f9cb87d0\"), 7, new Guid(\"8e2a6e72-0d2d-4f2b-b5e1-bd56a02b87d7\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"2da1b776-842a-4d49-90db-c12f0a32737e\"), 5, new Guid(\"6a35f0a9-68b1-48fd-83ba-dcbd7ac52097\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"c48a1bb4-ce7e-4c6f-95c7-6cd54da568ae\"), 7, new Guid(\"6a35f0a9-68b1-48fd-83ba-dcbd7ac52097\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"cb61c87f-cfbf-404f-8095-3f0e50cecca0\"), 3, new Guid(\"3ad9fe92-50d0-4df9-b648-6d903eca8916\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"3616042c-c38a-4f4d-82b1-77cc59145f10\"), 5, new Guid(\"3ad9fe92-50d0-4df9-b648-6d903eca8916\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"91c3e93e-5101-4a33-9014-4cdfc74a4e4e\"), 7, new Guid(\"3ad9fe92-50d0-4df9-b648-6d903eca8916\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"f4a39f1a-0192-46db-a479-f834a34822e8\"), 3, new Guid(\"0b600964-dd4c-4f41-b686-eea2ba254543\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"d3034ecd-4aa3-40e9-90f5-443dfd5289ea\"), 5, new Guid(\"0b600964-dd4c-4f41-b686-eea2ba254543\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"a9e8d996-202b-4235-9e97-74d8da32e276\"), 7, new Guid(\"0b600964-dd4c-4f41-b686-eea2ba254543\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"d8553b81-8689-491c-a494-09e458dfeb74\"), 3, new Guid(\"79a23324-168a-4c4c-b47b-38cd669066e6\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"6f217207-6d59-4afc-86e6-dee540a80897\"), 5, new Guid(\"79a23324-168a-4c4c-b47b-38cd669066e6\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"9d8ea24f-15bf-4841-80d7-598e406ba229\"), 7, new Guid(\"79a23324-168a-4c4c-b47b-38cd669066e6\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"ff5e4f0a-f612-431f-bfa5-a9680cc5925d\"), 3, new Guid(\"6a35f0a9-68b1-48fd-83ba-dcbd7ac52097\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"ab7151ff-4cb3-4104-8972-878c31c647aa\"), 3, new Guid(\"23618ebc-af2c-409b-8b64-411479b2e8c5\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"256264bc-8371-482f-a6fe-26963142cd89\"), 5, new Guid(\"8e05d53e-2888-4ffa-9401-fe732f3838d1\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"3ecc6830-4cb2-4fed-aac7-8403db1f14c5\"), 7, new Guid(\"9decb4cf-d3f3-4177-a1ed-04e0c36fba0b\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"4a61fc5c-768d-4e5e-9cf5-588649003136\"), 7, new Guid(\"0f49d651-9eda-46d1-9fc9-7f6f17f4f8f1\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"708569cc-fefc-491a-ba86-111dd60fc8cc\"), 3, new Guid(\"41f2f21b-f599-40ca-822d-78ceda51189c\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"f6f9ff70-1f05-48d0-a4fe-9215ae9c5dd7\"), 5, new Guid(\"41f2f21b-f599-40ca-822d-78ceda51189c\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"8fdaa226-9a64-4708-9e5a-15c1fed92822\"), 7, new Guid(\"41f2f21b-f599-40ca-822d-78ceda51189c\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"0736e542-038f-49d0-a2e4-b27354fedb73\"), 3, new Guid(\"0c4ded81-b68e-4f39-b37b-76372d76e59f\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"941338b3-e0d1-4e70-8daf-da9741516089\"), 5, new Guid(\"0c4ded81-b68e-4f39-b37b-76372d76e59f\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"1ac3ccd4-ee58-4f9c-8278-8f7d9e61bd7c\"), 7, new Guid(\"0c4ded81-b68e-4f39-b37b-76372d76e59f\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"72c0de10-a79f-45ea-8af9-68db9f3f0923\"), 3, new Guid(\"000aaf92-1996-40dc-ad63-62800ba9cf1e\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"23b4da1e-9dac-4a7f-a241-58b889c4b3e0\"), 5, new Guid(\"000aaf92-1996-40dc-ad63-62800ba9cf1e\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"da7d4388-8550-4f68-8cba-b1d137b285f4\"), 7, new Guid(\"000aaf92-1996-40dc-ad63-62800ba9cf1e\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"97f93584-cc56-48d9-ad36-82c9de8f8213\"), 3, new Guid(\"b955679f-c1de-4c9f-af0e-b602cf730b0a\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"4ae1c623-7cdb-4b67-bdb9-37a6062328b8\"), 3, new Guid(\"8e05d53e-2888-4ffa-9401-fe732f3838d1\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"b42adbb7-ebd2-4c0f-9cd7-5ce434806fd5\"), 5, new Guid(\"b955679f-c1de-4c9f-af0e-b602cf730b0a\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"7d0ce525-d136-4d9a-bcc3-73813c5b5968\"), 3, new Guid(\"790e043f-3dd8-4d6b-9caf-992f4b767fd5\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"fe6458de-e2a3-43f0-a28a-d8a4cd07b0cb\"), 5, new Guid(\"790e043f-3dd8-4d6b-9caf-992f4b767fd5\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"09e47150-0ef3-4b21-b8a2-fe3f8df14311\"), 7, new Guid(\"790e043f-3dd8-4d6b-9caf-992f4b767fd5\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"daae7ceb-a1b4-47e0-9094-9cdd1a663d36\"), 3, new Guid(\"e847a173-7142-4393-8925-ccc6738e5e3a\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"31ef7798-4d72-4171-bd0d-e9c551c192f6\"), 5, new Guid(\"e847a173-7142-4393-8925-ccc6738e5e3a\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"f49373c6-bbdf-4394-a3ae-12baf2bc4358\"), 7, new Guid(\"e847a173-7142-4393-8925-ccc6738e5e3a\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"4efc9557-64b9-4390-92bf-c0d92510a711\"), 3, new Guid(\"4bd3c96e-051c-44a6-8d2d-0f16e77d9f19\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"0cbea905-bae0-40b5-a16b-221cc87593b9\"), 5, new Guid(\"4bd3c96e-051c-44a6-8d2d-0f16e77d9f19\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"c9ed8a93-bc0d-4b36-8c2d-8f1a4b3a9197\"), 7, new Guid(\"4bd3c96e-051c-44a6-8d2d-0f16e77d9f19\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"9ae65a61-24ab-4636-9a67-ae42b5a1cd03\"), 3, new Guid(\"9decb4cf-d3f3-4177-a1ed-04e0c36fba0b\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"ed682bde-4ef2-43e3-a187-474dc65eeca1\"), 5, new Guid(\"9decb4cf-d3f3-4177-a1ed-04e0c36fba0b\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"1571f4b4-8955-4f0b-b9dc-fc72050544dd\"), 7, new Guid(\"b955679f-c1de-4c9f-af0e-b602cf730b0a\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"4b6ca3d0-03a1-48be-8d0f-7fa356e418d8\"), 5, new Guid(\"23618ebc-af2c-409b-8b64-411479b2e8c5\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"0d15740e-3fd2-4aa8-8c8c-89dfd8ca7966\"), 7, new Guid(\"23618ebc-af2c-409b-8b64-411479b2e8c5\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"13197581-16a6-4513-b5cc-03c5da935594\"), 3, new Guid(\"a802f78d-0fc5-424e-8131-159504f253b6\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"25ea34de-781f-4188-9090-a8ba79f972c9\"), 3, new Guid(\"c54c3aee-cf18-442e-b56f-4136677e2cb8\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"29e3b5d6-8c34-44c6-8dac-2f0b27078f2e\"), 5, new Guid(\"c54c3aee-cf18-442e-b56f-4136677e2cb8\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"e48bd695-c6c7-4c84-8203-2ddfa502de84\"), 7, new Guid(\"c54c3aee-cf18-442e-b56f-4136677e2cb8\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"f7f9c887-bef7-4051-9513-af9452bae841\"), 3, new Guid(\"027f08ce-0ba4-4d7c-aeca-153a7053a421\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"d583f9f3-d508-4ce1-bc73-259d22892e92\"), 5, new Guid(\"027f08ce-0ba4-4d7c-aeca-153a7053a421\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"6934b61d-7668-4c05-81b4-a0c538476c34\"), 7, new Guid(\"027f08ce-0ba4-4d7c-aeca-153a7053a421\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"e9589874-8c97-419c-8d44-6797bd7f9ce5\"), 3, new Guid(\"0daea836-1b09-4cf0-8d39-81e52a0c5838\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"5b080e2e-14da-4441-8f02-c28c58f6ca3e\"), 5, new Guid(\"0daea836-1b09-4cf0-8d39-81e52a0c5838\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"a7c18f5d-7315-4750-9eab-e852c66d4c00\"), 7, new Guid(\"0daea836-1b09-4cf0-8d39-81e52a0c5838\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"c12b6d7d-a4d0-40dd-84ed-f361c5786725\"), 3, new Guid(\"7547f8ae-f98b-4cae-aad7-8ef9c06f429e\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"e26c21eb-1987-4a40-bbfe-5a67f8405516\"), 5, new Guid(\"7547f8ae-f98b-4cae-aad7-8ef9c06f429e\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"171095b9-a047-42f6-b0dc-9fb102894e90\"), 7, new Guid(\"068c403a-5206-4a06-966f-9edd993f4704\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"1476933f-b992-4d30-8e8d-787530d1d5bf\"), 7, new Guid(\"7547f8ae-f98b-4cae-aad7-8ef9c06f429e\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"cc954a63-0f16-482b-9469-33f821feedca\"), 5, new Guid(\"6161e1d5-26ce-4002-a35e-f3605d84cd6e\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"680339fe-336c-4d6d-9a35-eb95719f67d0\"), 7, new Guid(\"6161e1d5-26ce-4002-a35e-f3605d84cd6e\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"f6a698f2-d614-457c-a47a-4bb62d327448\"), 3, new Guid(\"505a80d2-3c08-4aad-97d6-25433195130c\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"de0aeb4e-4873-4b81-bea5-eaeaf21ba4aa\"), 5, new Guid(\"505a80d2-3c08-4aad-97d6-25433195130c\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"b0e2094f-7c9c-4dc8-ae12-366b730810d6\"), 7, new Guid(\"505a80d2-3c08-4aad-97d6-25433195130c\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"11c75999-16b2-4cb7-8693-9ca4417ed218\"), 3, new Guid(\"780914d8-58c2-4d5c-bc45-82f6045a5b9b\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"ea8aa6ed-6968-49de-8958-1a90cc695a6b\"), 5, new Guid(\"780914d8-58c2-4d5c-bc45-82f6045a5b9b\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"d44d89dd-dbf8-4041-8ddd-32c45b954962\"), 7, new Guid(\"780914d8-58c2-4d5c-bc45-82f6045a5b9b\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"114ae430-2aa2-4d30-9ac2-efaaa046e348\"), 3, new Guid(\"4bd5378d-bd35-4a33-8c23-95e5ec1cb7c5\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"80d9ee39-1dca-445a-86b4-7077752b8307\"), 5, new Guid(\"4bd5378d-bd35-4a33-8c23-95e5ec1cb7c5\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"b60c75e6-70f0-4c02-877a-d569f2cab6ec\"), 7, new Guid(\"4bd5378d-bd35-4a33-8c23-95e5ec1cb7c5\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"6f0ff514-7e1d-4436-99c9-2df577b180a1\"), 3, new Guid(\"6161e1d5-26ce-4002-a35e-f3605d84cd6e\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"6bc02ba9-8f9e-4ea5-a556-03cc9a4fb1c1\"), 5, new Guid(\"068c403a-5206-4a06-966f-9edd993f4704\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"8855fd16-3801-4907-9025-c57790de040f\"), 3, new Guid(\"068c403a-5206-4a06-966f-9edd993f4704\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"9a18d840-82c0-43a2-911a-26de5cfc760f\"), 7, new Guid(\"2225dc05-31f1-459e-bacd-035b7bcb96b3\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"a57a8cfe-dc04-419a-8bd0-1442531624a3\"), 5, new Guid(\"a802f78d-0fc5-424e-8131-159504f253b6\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"7de2243c-3b42-448f-ad1e-5a22386f23b8\"), 7, new Guid(\"a802f78d-0fc5-424e-8131-159504f253b6\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"d8557bbb-9aa6-4f0c-964e-ad41b4122aad\"), 3, new Guid(\"4d8c6cfb-b1c5-4620-850d-a592efdccd26\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"a4826035-e6f6-419a-9a45-a25ce571698d\"), 5, new Guid(\"4d8c6cfb-b1c5-4620-850d-a592efdccd26\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"4abb30ea-88af-45ba-a8c2-fe32cd7faedc\"), 7, new Guid(\"4d8c6cfb-b1c5-4620-850d-a592efdccd26\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"df3ceac9-a1d7-4fa2-9b7c-8e54494ef698\"), 3, new Guid(\"5401efef-f18a-4f72-a45a-799b946d6fe9\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"8ddfa40e-1265-4adf-934c-af322d2de215\"), 5, new Guid(\"5401efef-f18a-4f72-a45a-799b946d6fe9\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"ac96f4a4-05ff-4c5e-8262-6f63bb361bd0\"), 7, new Guid(\"5401efef-f18a-4f72-a45a-799b946d6fe9\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"f2ca2f92-f9b7-4813-9e53-d4d50f8e1f3e\"), 3, new Guid(\"2d30981b-01d9-4859-ba31-e80eed1e37df\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"9ac19479-6487-4164-83e9-7c559829f77d\"), 5, new Guid(\"2d30981b-01d9-4859-ba31-e80eed1e37df\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"0c902470-7faf-45c6-8040-def458f3d9f5\"), 7, new Guid(\"2d30981b-01d9-4859-ba31-e80eed1e37df\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"cc7def0f-7843-4a82-b0ed-9050ef9097e4\"), 3, new Guid(\"ff7ea0d4-c72c-46de-97da-4f782c80452a\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"19479358-7f87-40de-b938-6a9c5f80ff1f\"), 5, new Guid(\"ff7ea0d4-c72c-46de-97da-4f782c80452a\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"5f70e6d6-c5b4-4d9c-beaa-77d549928974\"), 7, new Guid(\"ff7ea0d4-c72c-46de-97da-4f782c80452a\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"2432c1f8-d74f-49de-83d5-869dce0ebd69\"), 3, new Guid(\"0e305a05-a706-47a5-b399-ba357e727d60\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"b26bbeb9-669f-4f5f-bde4-c9aa2c9d9fe2\"), 5, new Guid(\"0e305a05-a706-47a5-b399-ba357e727d60\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"d13a55d6-51fb-4678-9318-66af96bd4f77\"), 7, new Guid(\"0e305a05-a706-47a5-b399-ba357e727d60\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"4e4e95a6-c4cc-40ec-815b-da7435ab935f\"), 3, new Guid(\"93129c1d-fe61-4781-ac40-2412084658f0\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"e55a3a85-e028-4fd9-bec8-96fdc5f3f6de\"), 5, new Guid(\"93129c1d-fe61-4781-ac40-2412084658f0\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"660d5a8f-b61c-4868-b544-b4e7366e282e\"), 7, new Guid(\"93129c1d-fe61-4781-ac40-2412084658f0\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"ec910c84-7534-413c-a5c9-0cd367a50db5\"), 3, new Guid(\"9e3dae9a-b4a8-4054-b57c-b1f405170d62\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"ed3cced0-e37e-4bdc-a12d-b299e18ed8db\"), 5, new Guid(\"9e3dae9a-b4a8-4054-b57c-b1f405170d62\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"e52d98b0-2181-4bd3-b0c2-7a09ffb87302\"), 7, new Guid(\"9e3dae9a-b4a8-4054-b57c-b1f405170d62\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"6d76de6b-9c61-47bc-a5cf-9d6dc726b64e\"), 3, new Guid(\"2225dc05-31f1-459e-bacd-035b7bcb96b3\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"01ea26ee-13e3-4656-a4c5-938679c0e533\"), 5, new Guid(\"2225dc05-31f1-459e-bacd-035b7bcb96b3\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"799a96fd-8f92-416a-bbec-82325a77836a\"), 3, new Guid(\"0f49d651-9eda-46d1-9fc9-7f6f17f4f8f1\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"963a2451-f085-4247-a64b-4aaea6980339\"), 5, new Guid(\"b66c153a-776b-4b19-aa19-50a3710d53b6\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"e6c7d2e9-8d3c-47bc-a37b-69efb4e68bdd\"), 3, new Guid(\"33dcb15b-3afd-40b3-8f73-4b6109be3cfa\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"dde8189d-9040-42e3-ab7a-326837581bc7\"), 5, new Guid(\"0b8241f4-709a-4950-b82d-b072e4737d36\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"06e4cb68-2f5e-4d57-b8ff-629ad62937cc\"), 7, new Guid(\"f1ddce41-a5c9-494d-bf4f-e61b6ebdd503\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"34d65e39-c9ae-46d7-8538-7faa93a3f37c\"), 3, new Guid(\"896922b5-6b1d-4b7d-9db0-1e4395fe7afe\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"72c5a40f-2f4f-4741-935c-639af0c2359a\"), 5, new Guid(\"896922b5-6b1d-4b7d-9db0-1e4395fe7afe\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"41bccffb-b7c9-4c07-bc86-69bd06092f6e\"), 7, new Guid(\"896922b5-6b1d-4b7d-9db0-1e4395fe7afe\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"f0e053ab-c567-47e1-8e60-1aca2456362b\"), 3, new Guid(\"01847324-bafa-4ac7-b4ca-ed3832b75c46\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"fc43e636-bdd5-4002-a9bd-0773c033e717\"), 5, new Guid(\"01847324-bafa-4ac7-b4ca-ed3832b75c46\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"95bea71e-c7d7-474b-b3ba-4f15096ccc9a\"), 7, new Guid(\"01847324-bafa-4ac7-b4ca-ed3832b75c46\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"60c185a4-c9e3-44b5-8552-d7fcc0d32673\"), 3, new Guid(\"f732529d-7931-4655-ad2f-b00dafd2d752\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"33ef7ece-65f4-4348-870d-492944fe69a3\"), 5, new Guid(\"f732529d-7931-4655-ad2f-b00dafd2d752\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"1ee1f9a2-395a-46f6-8b60-c4935709763f\"), 7, new Guid(\"f732529d-7931-4655-ad2f-b00dafd2d752\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"f5070335-23e2-4f37-8e93-5090375ef39b\"), 3, new Guid(\"db26b691-c316-4590-856d-f45a795050a3\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"126c3edd-cada-4f6e-b209-64ae3c2305e6\"), 5, new Guid(\"f1ddce41-a5c9-494d-bf4f-e61b6ebdd503\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"d6737da2-347a-4d96-a360-1990a9cdeabd\"), 5, new Guid(\"db26b691-c316-4590-856d-f45a795050a3\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"51fba113-0f96-4605-94a5-d84848c0679d\"), 3, new Guid(\"e2ff7dbe-c278-44f6-a687-5787a73804b3\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"07b1acbb-d5b2-4f60-8b4a-a5376ede3a8e\"), 5, new Guid(\"e2ff7dbe-c278-44f6-a687-5787a73804b3\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"260432e9-a73b-4bad-8017-492616bd910f\"), 7, new Guid(\"e2ff7dbe-c278-44f6-a687-5787a73804b3\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"a1e52cf7-4ea0-46b1-9258-64bf88a4247f\"), 3, new Guid(\"201fbe1f-8633-4594-9c1e-f0a9756f389a\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"cb72fca2-be4c-42c4-b9a2-27f92680f12a\"), 5, new Guid(\"201fbe1f-8633-4594-9c1e-f0a9756f389a\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"be4db5cb-e609-4aac-bc6a-af23aca4f87c\"), 7, new Guid(\"201fbe1f-8633-4594-9c1e-f0a9756f389a\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"0a340104-06e2-43d5-997c-b6dce69fed95\"), 3, new Guid(\"3290dad9-a0d9-417e-867e-3376b83d4fe1\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"a20d1651-bfcd-4946-b667-17dbf424fb52\"), 5, new Guid(\"3290dad9-a0d9-417e-867e-3376b83d4fe1\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"e36abf9c-41ec-442a-b0b0-99586d9c6e77\"), 7, new Guid(\"3290dad9-a0d9-417e-867e-3376b83d4fe1\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"2f112f52-2197-423f-88d8-0009a0c9ff3b\"), 3, new Guid(\"a54a8f1e-48b2-403c-9b6c-f18e6615afbd\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"4ba2416c-b577-4868-8b5e-69e330902ea2\"), 5, new Guid(\"a54a8f1e-48b2-403c-9b6c-f18e6615afbd\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"e558177f-d9a7-4c10-96a4-a553f50b7d87\"), 7, new Guid(\"db26b691-c316-4590-856d-f45a795050a3\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"5147fb9a-42bc-40d9-bccd-091ba8174dca\"), 7, new Guid(\"a54a8f1e-48b2-403c-9b6c-f18e6615afbd\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"97910874-a15c-4293-9efe-5470eb54ccd6\"), 3, new Guid(\"f1ddce41-a5c9-494d-bf4f-e61b6ebdd503\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"a8c483ec-6b80-4082-94f0-37b22ef16f90\"), 5, new Guid(\"8eba2159-e158-4a6c-8a1e-5b4e9b85779a\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"3bb38131-72dc-44a7-9033-ecbbcc8f51ab\"), 5, new Guid(\"54b394d0-afb8-48bf-a290-2173a490107d\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"d0e96f68-f78f-44c0-9300-a5a7f0ca0fb6\"), 7, new Guid(\"54b394d0-afb8-48bf-a290-2173a490107d\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"553fd8cc-7f13-40a5-80ed-8ef54f955cc5\"), 3, new Guid(\"7e3c0717-c8af-448e-9c07-2ede94df6fbb\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"85ac533f-4aaa-4a55-91d2-2407d2a55e57\"), 5, new Guid(\"7e3c0717-c8af-448e-9c07-2ede94df6fbb\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"45c9c2c2-106e-456b-964f-7e577ad5adee\"), 7, new Guid(\"7e3c0717-c8af-448e-9c07-2ede94df6fbb\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"65cf263d-1893-4431-97dc-6fdeeb16c5f9\"), 3, new Guid(\"99fd3cb2-7feb-405f-9587-e2897942617e\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"9472ea36-04c0-4673-9eaf-8a478bed6a66\"), 5, new Guid(\"99fd3cb2-7feb-405f-9587-e2897942617e\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"b5a391f7-a184-4a62-a14f-661b97b5f61a\"), 7, new Guid(\"99fd3cb2-7feb-405f-9587-e2897942617e\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"fb5bc117-47eb-460a-8be8-3790439bfc3c\"), 3, new Guid(\"526e3940-fcce-40a2-ac9d-21d3b24b00e2\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"def52250-e096-4abe-aee9-6f0599121c45\"), 5, new Guid(\"526e3940-fcce-40a2-ac9d-21d3b24b00e2\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"bf1c82f0-3c0d-4c1b-9c97-e9da816e5cc2\"), 7, new Guid(\"526e3940-fcce-40a2-ac9d-21d3b24b00e2\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"056e04f9-b43f-4037-a781-482807cdd35d\"), 7, new Guid(\"8eba2159-e158-4a6c-8a1e-5b4e9b85779a\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"13abf941-b8ec-4e92-a5f1-31d92271d375\"), 3, new Guid(\"7807c55f-090b-469b-9d7d-5102acee7f8c\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"80b14689-07f8-49da-8cc8-5f8cad75ad35\"), 7, new Guid(\"7807c55f-090b-469b-9d7d-5102acee7f8c\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"fe8e015d-286d-4e84-b570-70b4d6ceb86e\"), 3, new Guid(\"d2183a74-6d58-4d54-b355-7bf8679aeb8e\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"942c8529-98ac-4dae-8fd9-872f7fe0ff23\"), 5, new Guid(\"d2183a74-6d58-4d54-b355-7bf8679aeb8e\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"9c6ce750-4ef7-4aa1-b88f-6f4319a68f27\"), 7, new Guid(\"d2183a74-6d58-4d54-b355-7bf8679aeb8e\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"7d837c72-53ca-4a15-a3c7-4d582d15c195\"), 3, new Guid(\"b0237671-4564-4052-8e16-6a6761e65d45\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"5172ea28-0fd6-4833-939b-3e70166dea1d\"), 5, new Guid(\"b0237671-4564-4052-8e16-6a6761e65d45\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"13b90cb4-f9fd-4016-9550-02faaad49c59\"), 7, new Guid(\"b0237671-4564-4052-8e16-6a6761e65d45\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"bd48bfd6-728f-49e0-a2f8-e1852a568081\"), 3, new Guid(\"84cc241f-773e-4195-a00f-7c7eb8808fe0\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"bd66ecc4-0efd-4101-91d6-cf368a9a1b1d\"), 5, new Guid(\"84cc241f-773e-4195-a00f-7c7eb8808fe0\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"ea889ead-8c16-445b-b7e4-6bb10b8c7305\"), 7, new Guid(\"84cc241f-773e-4195-a00f-7c7eb8808fe0\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"757d9a2b-4d98-4214-b2cb-8253b0457de7\"), 3, new Guid(\"8eba2159-e158-4a6c-8a1e-5b4e9b85779a\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"15695fe1-9510-4f2a-b26a-4ef47ddbf6b1\"), 5, new Guid(\"7807c55f-090b-469b-9d7d-5102acee7f8c\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"cc29c823-0566-49bd-8e48-5fa39f622f02\"), 3, new Guid(\"54b394d0-afb8-48bf-a290-2173a490107d\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"d75e376c-eb52-483f-9eb3-22498ce24fde\"), 3, new Guid(\"0da5b5b8-aa35-445c-b4e2-c0d28e671746\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"ec53be2c-e570-4707-bc61-6d5619894c69\"), 7, new Guid(\"0da5b5b8-aa35-445c-b4e2-c0d28e671746\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"fff35678-5f6f-4d43-8e5d-591d830cfd6d\"), 5, new Guid(\"34f0c534-0086-49e4-a147-bb6f4e74443b\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"9449b964-a7a1-4b1e-9029-9cd4599d3386\"), 7, new Guid(\"34f0c534-0086-49e4-a147-bb6f4e74443b\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"54cf749e-4576-4b39-9346-973ba37f29ec\"), 3, new Guid(\"3bf82278-31bc-443a-8b15-2c091247c92b\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"c11aa0e9-8806-4cb0-827c-23065ca8d12a\"), 5, new Guid(\"3bf82278-31bc-443a-8b15-2c091247c92b\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"cbb272ae-8460-4fea-a60e-d37baab7414b\"), 7, new Guid(\"3bf82278-31bc-443a-8b15-2c091247c92b\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"4ac5a88f-130f-4bec-b763-96f40a9f3c74\"), 3, new Guid(\"8e5983b2-a712-4710-969e-2428d1311bda\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"dda88cf6-5137-4e02-af29-cab873075a81\"), 5, new Guid(\"8e5983b2-a712-4710-969e-2428d1311bda\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"af993538-b467-44c9-9ab6-a5dca886c73d\"), 7, new Guid(\"8e5983b2-a712-4710-969e-2428d1311bda\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"a5fc25bd-3588-4c37-b35a-881760d50a8d\"), 3, new Guid(\"4f2cf7b6-0487-4016-9df7-b21a126de0bb\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"b369c747-5033-496f-ad19-e275edd91858\"), 5, new Guid(\"4f2cf7b6-0487-4016-9df7-b21a126de0bb\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"8d26768b-5164-4a9f-bed7-4cd1e13dc870\"), 7, new Guid(\"4f2cf7b6-0487-4016-9df7-b21a126de0bb\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"a6a8d275-5398-4d9b-a7ab-5cc6b6eac751\"), 3, new Guid(\"34f0c534-0086-49e4-a147-bb6f4e74443b\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"97430adf-9c2a-48d4-8f18-4640c3360ecb\"), 3, new Guid(\"4c648425-2dcf-4851-99b6-569cfe5c85db\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"abf39e55-5f47-46e0-bc6d-e86b238bc4a5\"), 7, new Guid(\"4c648425-2dcf-4851-99b6-569cfe5c85db\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"ff8ff23b-d843-49aa-b3eb-29db4bd6dcef\"), 3, new Guid(\"07cec7b6-3306-4b32-b54b-02412f687633\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"1f0e0c07-df03-4e83-9575-7d6a783b6c33\"), 5, new Guid(\"07cec7b6-3306-4b32-b54b-02412f687633\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"1d7d4449-b18e-4b9f-9788-58c640666060\"), 7, new Guid(\"07cec7b6-3306-4b32-b54b-02412f687633\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") }\n                });\n\n            migrationBuilder.InsertData(\n                table: \"StorageUnits\",\n                columns: new[] { \"Id\", \"Quantity\", \"ShelfId\", \"UnitId\" },\n                values: new object[,]\n                {\n                    { new Guid(\"1bc768d3-d93f-4530-811b-b30b655ff9f2\"), 3, new Guid(\"a205fac7-e202-460b-b0ed-3850a341875c\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"3ab146fa-684f-4f47-8054-13d9336b6987\"), 5, new Guid(\"a205fac7-e202-460b-b0ed-3850a341875c\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"bc422f43-9acc-4f21-a2aa-0acd3ef4e677\"), 7, new Guid(\"a205fac7-e202-460b-b0ed-3850a341875c\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"ce29b18e-4bb2-4b8b-b5a3-685fd5a2550e\"), 3, new Guid(\"a4eb01df-d3ee-499c-b4e4-6d6766dfaa89\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"9f55d3dd-0424-42f5-ba17-35b8584502e3\"), 5, new Guid(\"a4eb01df-d3ee-499c-b4e4-6d6766dfaa89\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"a1426ecd-6e51-4350-b91e-fdfd42122971\"), 7, new Guid(\"a4eb01df-d3ee-499c-b4e4-6d6766dfaa89\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"ac20d863-0a6e-46b2-b908-47dedcd187c6\"), 3, new Guid(\"54134257-8b1e-4ec0-ad00-73858582772b\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"11bbff61-75fa-48d5-bc8f-9c81f39efe5b\"), 5, new Guid(\"4c648425-2dcf-4851-99b6-569cfe5c85db\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"09f7a1c7-3e81-4042-a478-03226005f68c\"), 5, new Guid(\"0da5b5b8-aa35-445c-b4e2-c0d28e671746\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"3d8b5a5f-325b-4e64-b5dc-506a672b998f\"), 7, new Guid(\"d8b881aa-796f-4f19-bf31-4fc1d458a90d\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"9a0ab298-4bbc-4914-8e54-25c0710e37ed\"), 3, new Guid(\"d8b881aa-796f-4f19-bf31-4fc1d458a90d\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"fb5589fa-f93d-448b-bde5-62283578b6fe\"), 3, new Guid(\"5ccffe0f-24c7-4ebc-8192-56302842cfbf\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"d2d4ea7c-4d39-4480-9d0d-5fd877595f32\"), 5, new Guid(\"5ccffe0f-24c7-4ebc-8192-56302842cfbf\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"5a86d6bd-7eee-4ba8-bb84-0f4b5fa468c2\"), 7, new Guid(\"5ccffe0f-24c7-4ebc-8192-56302842cfbf\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"510864ea-921c-4e92-ba3c-cd7a571defc1\"), 3, new Guid(\"2dd3f404-7c42-4bec-8507-ecbbc2c837df\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"f9a46038-3fbb-4264-8575-4046d9535d1b\"), 5, new Guid(\"2dd3f404-7c42-4bec-8507-ecbbc2c837df\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"81bfae3f-64d3-40de-b658-9264f7e6b88f\"), 7, new Guid(\"2dd3f404-7c42-4bec-8507-ecbbc2c837df\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"ace3fd3f-2c52-4ea1-adca-6921cbadc568\"), 3, new Guid(\"a1e24af6-9721-45b6-928d-92385d95f466\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"d6784b19-5fe5-4e92-9704-a07e9f3d4ed7\"), 5, new Guid(\"a1e24af6-9721-45b6-928d-92385d95f466\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"6499cbcd-a275-4da1-92ba-0745bec52021\"), 7, new Guid(\"a1e24af6-9721-45b6-928d-92385d95f466\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"5c6299e5-419c-4a09-bc41-c814eb182ed5\"), 3, new Guid(\"7baaa456-5575-4340-b47d-88b87f31db29\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"fe193894-14ee-47ae-8d08-4fed0da3cb48\"), 5, new Guid(\"7baaa456-5575-4340-b47d-88b87f31db29\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"57260ab9-13ec-45c1-960d-1986d0122db2\"), 5, new Guid(\"d8b881aa-796f-4f19-bf31-4fc1d458a90d\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"125d92a0-441c-450a-b360-59f295795cea\"), 7, new Guid(\"7baaa456-5575-4340-b47d-88b87f31db29\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"a5f0dab8-3747-4a6b-93f4-13a3b8cedbc3\"), 5, new Guid(\"623071c4-696f-402d-bc1c-f9b9d8e2130d\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"834e0400-cd36-419d-9e97-a92127608c30\"), 7, new Guid(\"623071c4-696f-402d-bc1c-f9b9d8e2130d\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"c9e3398e-b9cc-4dc7-958c-2ad893eecc70\"), 3, new Guid(\"c8279faf-2cb2-43d9-8e65-6e7b7e29eda6\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"341eed19-ace6-4b37-a4e9-a05724a383e8\"), 5, new Guid(\"c8279faf-2cb2-43d9-8e65-6e7b7e29eda6\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"7967d661-3402-40c4-bbe3-b820890d17c4\"), 7, new Guid(\"c8279faf-2cb2-43d9-8e65-6e7b7e29eda6\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"86cb3ad8-0bcb-456f-948a-b766f6930c18\"), 3, new Guid(\"9e8e764a-0a6f-48a2-b695-c67cc6a104dc\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"3e665a15-c57c-4142-bb79-d38c4d24698e\"), 5, new Guid(\"9e8e764a-0a6f-48a2-b695-c67cc6a104dc\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"948a80eb-501c-482a-8e12-8c4f4abaa31f\"), 7, new Guid(\"9e8e764a-0a6f-48a2-b695-c67cc6a104dc\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"0dec8b83-bb25-410e-b009-2a755aec9304\"), 3, new Guid(\"edb2a09b-18e2-4f24-937d-9fac746b7ca1\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"156785a5-8a73-49c5-a15f-0cc5165f39e4\"), 5, new Guid(\"edb2a09b-18e2-4f24-937d-9fac746b7ca1\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"0b7fe800-b8e3-4b51-99f3-58e479d3654e\"), 7, new Guid(\"edb2a09b-18e2-4f24-937d-9fac746b7ca1\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"58553a1c-92ed-4cdd-ad18-b70f16b4ca79\"), 3, new Guid(\"623071c4-696f-402d-bc1c-f9b9d8e2130d\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"e59260b0-ecc6-4d2c-a760-10d79f280e5d\"), 7, new Guid(\"bbecc29d-0d7f-4c80-ba58-a4efe557e9a5\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"639dbe0a-963c-4186-8695-2e11985efde6\"), 5, new Guid(\"bbecc29d-0d7f-4c80-ba58-a4efe557e9a5\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"adb1fd61-c489-4d95-aae5-6fca531882be\"), 3, new Guid(\"bbecc29d-0d7f-4c80-ba58-a4efe557e9a5\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"973714a9-2e02-4271-bd79-8d28d898c820\"), 3, new Guid(\"1b015d8b-051c-43f0-b706-46aaff6396e9\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"4fefa5b3-927d-4ccd-8517-f80e87d0dc12\"), 5, new Guid(\"1b015d8b-051c-43f0-b706-46aaff6396e9\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"009bba4f-143b-4992-9984-39010482f2e1\"), 7, new Guid(\"1b015d8b-051c-43f0-b706-46aaff6396e9\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"7a7fdaf7-475e-4caa-a025-3a05fbbb0ae5\"), 3, new Guid(\"d43ee7da-84a4-4efd-98f4-a9dc42383660\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"78201a84-a0a4-448a-b81e-887f4bd1c366\"), 5, new Guid(\"d43ee7da-84a4-4efd-98f4-a9dc42383660\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"60c722b5-373e-4b1c-b440-257c1d9fbbc5\"), 7, new Guid(\"d43ee7da-84a4-4efd-98f4-a9dc42383660\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"02883733-130e-4068-bdd8-1190234b84ef\"), 3, new Guid(\"f9e7d1bf-772d-4d9f-ad30-7fab8b1021ee\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"9f21935d-8c8c-4f11-a970-14dd36a6c33f\"), 5, new Guid(\"f9e7d1bf-772d-4d9f-ad30-7fab8b1021ee\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"525b44b8-1a9a-49b3-8bb3-788deda360fd\"), 7, new Guid(\"f9e7d1bf-772d-4d9f-ad30-7fab8b1021ee\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"d0f5df40-5b13-43a5-8abb-22ddbcdd5115\"), 3, new Guid(\"26f4c570-76c8-4851-a8ee-1df8677add1e\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"7be47bf5-f147-441f-bd59-5236b6cea586\"), 5, new Guid(\"26f4c570-76c8-4851-a8ee-1df8677add1e\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"9e4b190d-aa2a-44b6-9b1d-0aae4bf21422\"), 7, new Guid(\"cbe32f16-c20f-442d-9ed9-a8f88dd37f54\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"1f5a92d8-d07d-4002-b84b-89c8d0de5a3c\"), 7, new Guid(\"26f4c570-76c8-4851-a8ee-1df8677add1e\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"0a1ee762-8109-4023-adf9-76248b3e5364\"), 5, new Guid(\"a67540a2-11a9-43de-9592-232e5b274c91\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"35d82b40-972d-4b60-8788-a070d3218186\"), 7, new Guid(\"a67540a2-11a9-43de-9592-232e5b274c91\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"33ca8b58-b51e-4c91-98c4-d5a928107503\"), 3, new Guid(\"d92f08f7-838e-46bf-b873-76c1c0bd0cc9\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"a413e9cc-fc08-4901-935f-a14e3baf2496\"), 5, new Guid(\"d92f08f7-838e-46bf-b873-76c1c0bd0cc9\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"87802064-87f4-44e1-9a4f-8877a1a2b943\"), 7, new Guid(\"d92f08f7-838e-46bf-b873-76c1c0bd0cc9\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"8743656d-5521-41c3-856b-eb14b091836d\"), 3, new Guid(\"b303dc05-702b-4286-bde3-8ea6e3591e27\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"cd9ebdc4-b9f7-4ccc-904c-8f2fe05d2de5\"), 5, new Guid(\"b303dc05-702b-4286-bde3-8ea6e3591e27\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"2b25408b-6025-4c93-9c6e-60f999a816fe\"), 7, new Guid(\"b303dc05-702b-4286-bde3-8ea6e3591e27\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"fede9b5b-8f16-4a85-8d65-532dabe1855f\"), 3, new Guid(\"d8f0edb7-ea67-4059-b4e1-e6c6a9b3e5e0\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"6c2a55b8-c81e-4e66-b219-78587e61f6fd\"), 5, new Guid(\"d8f0edb7-ea67-4059-b4e1-e6c6a9b3e5e0\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"67813456-bbee-4d6c-8d4c-5be6bc248e1f\"), 7, new Guid(\"d8f0edb7-ea67-4059-b4e1-e6c6a9b3e5e0\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"a9e35e53-c056-46fc-9184-7a62169382ef\"), 3, new Guid(\"a67540a2-11a9-43de-9592-232e5b274c91\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"ab94a0fb-6f6b-4798-92ea-f0f975dbfcda\"), 3, new Guid(\"77dd27e3-c146-4981-8155-a9dbf7f8c03c\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"512ad23b-08a8-4ee2-994d-f04fed018b76\"), 5, new Guid(\"cbe32f16-c20f-442d-9ed9-a8f88dd37f54\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"5f952d7e-e282-4788-abf2-eb1b7c3918ad\"), 7, new Guid(\"60818c01-e76b-45d8-acf0-dc29114a79b0\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"fd29bc5d-ca69-49c8-97c9-0be80563ad5c\"), 7, new Guid(\"da40c027-1474-4e8a-9f9d-0af3a450ae59\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"3ea2e1b8-d0b9-4a00-ba03-ca07719db824\"), 3, new Guid(\"fcc30407-fc47-47b7-831c-ee70a5bb02b6\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"89b94f56-a3b2-4059-9535-e544c1091fed\"), 5, new Guid(\"fcc30407-fc47-47b7-831c-ee70a5bb02b6\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"129e5526-de37-4dba-a1a3-0c85280e33cb\"), 7, new Guid(\"fcc30407-fc47-47b7-831c-ee70a5bb02b6\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"aebcd562-1437-47be-abcf-49e9dddff403\"), 3, new Guid(\"1030c263-c3f9-4dfd-b200-085b1135475c\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"5b521498-dfb8-40de-ba2e-ccb3a514000a\"), 5, new Guid(\"1030c263-c3f9-4dfd-b200-085b1135475c\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"c7097e9e-bfb4-487f-8b0c-51ad5ba4b873\"), 7, new Guid(\"1030c263-c3f9-4dfd-b200-085b1135475c\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"2a5e9c98-70a6-4ad2-b5a9-d56d2e8d0f29\"), 3, new Guid(\"f8bad758-5837-4db2-88cb-fad39deb9779\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"3a796c70-defd-4605-92fd-e2f741c0b26a\"), 5, new Guid(\"f8bad758-5837-4db2-88cb-fad39deb9779\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"cf82c8a6-5d08-4c91-a1d5-b6027ff9b363\"), 7, new Guid(\"f8bad758-5837-4db2-88cb-fad39deb9779\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"40045721-0a22-4282-98bb-c583fd2c857b\"), 3, new Guid(\"f5f25cfb-1c95-4180-99c1-817cb06a82b1\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"9c8e89ee-9baa-464b-b7e8-87fee9270ef4\"), 3, new Guid(\"cbe32f16-c20f-442d-9ed9-a8f88dd37f54\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"a44e72b8-e090-45b9-9e47-db9c17cb8b4f\"), 5, new Guid(\"f5f25cfb-1c95-4180-99c1-817cb06a82b1\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"e4bb80dc-c1cf-4fbc-952f-87bb528622c3\"), 3, new Guid(\"fa0ee461-1742-4c0b-89dd-25b3d48bf526\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"3abc2606-172e-43b5-b0fb-0cfd674ad82e\"), 5, new Guid(\"fa0ee461-1742-4c0b-89dd-25b3d48bf526\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"b2d911d3-9380-498b-ae82-9c0a56d12302\"), 7, new Guid(\"fa0ee461-1742-4c0b-89dd-25b3d48bf526\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"961265c0-b6d5-42fd-8295-2a6de16925ca\"), 3, new Guid(\"e7054f82-7233-4bb4-9d76-513cb4749c30\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"609f7720-bf6d-498e-93fd-c5d2a3d038c1\"), 5, new Guid(\"e7054f82-7233-4bb4-9d76-513cb4749c30\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"a5489980-d48d-45b2-b409-13dff23c746d\"), 7, new Guid(\"e7054f82-7233-4bb4-9d76-513cb4749c30\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"4b5d8418-2271-4baa-8017-eafcbf3dcf06\"), 3, new Guid(\"189d809d-0496-41dd-ac95-723ef14d4c5f\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"72db22fd-a261-48dd-b5cb-e12dca97c7c6\"), 5, new Guid(\"189d809d-0496-41dd-ac95-723ef14d4c5f\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"2ed8e767-7370-4cf5-aaa1-a5e00f4f36dc\"), 7, new Guid(\"189d809d-0496-41dd-ac95-723ef14d4c5f\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"2c37ca09-665a-4c35-8811-320cd50e8f35\"), 3, new Guid(\"60818c01-e76b-45d8-acf0-dc29114a79b0\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"a1fc6807-248d-4a37-bfaf-24fe1c5f3a80\"), 5, new Guid(\"60818c01-e76b-45d8-acf0-dc29114a79b0\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"fb93751d-1fe8-46b2-9cd2-1f82f203c701\"), 7, new Guid(\"f5f25cfb-1c95-4180-99c1-817cb06a82b1\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"80b1585d-9bb3-49c4-a9cb-698ab2290342\"), 5, new Guid(\"77dd27e3-c146-4981-8155-a9dbf7f8c03c\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"21a3186b-9714-4431-9705-26923c7f3121\"), 7, new Guid(\"77dd27e3-c146-4981-8155-a9dbf7f8c03c\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"bd0f93d4-be52-43e9-96eb-5c299c3d9ca3\"), 3, new Guid(\"0d36915f-a08a-437b-9bbf-f8565ca43168\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"d847d2c7-c906-4fbf-b004-9ae48274458c\"), 3, new Guid(\"880c401f-2baf-4c80-9264-300d5925862f\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"917d7ceb-63f5-49d5-ace5-356dbc371292\"), 5, new Guid(\"880c401f-2baf-4c80-9264-300d5925862f\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"d2e29d04-f2c8-44ff-badf-f396b7eb0e18\"), 7, new Guid(\"880c401f-2baf-4c80-9264-300d5925862f\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"e045b59d-c982-4c02-9476-1dd4d01a37b1\"), 3, new Guid(\"6bb4d3ed-52b8-4a0d-9311-2ae560df5111\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"97ac6254-1103-4e5f-9449-88387f9b3fc7\"), 5, new Guid(\"6bb4d3ed-52b8-4a0d-9311-2ae560df5111\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"f26cccb9-2829-4722-975c-1d01d8f37d88\"), 7, new Guid(\"6bb4d3ed-52b8-4a0d-9311-2ae560df5111\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"e709be45-b402-45c7-ad1f-b6a2b5186846\"), 3, new Guid(\"472c4719-f9a6-41ed-a649-4ef67d79c3a5\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"3098635b-8a78-48c6-bfaa-391da184dcf5\"), 5, new Guid(\"472c4719-f9a6-41ed-a649-4ef67d79c3a5\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"f32004cc-5d3a-477c-91be-58cf6e8b77c7\"), 7, new Guid(\"472c4719-f9a6-41ed-a649-4ef67d79c3a5\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"0936eeef-e1da-4048-974a-9e19989458a3\"), 3, new Guid(\"01eaea33-366b-49d5-9390-318eead8b7ea\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"fbf672a1-bcb6-4e7d-b458-282b2159089f\"), 5, new Guid(\"01eaea33-366b-49d5-9390-318eead8b7ea\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"488245d9-a8d2-497f-8814-3eca5d800cad\"), 7, new Guid(\"b3cc7f49-01c8-4f43-ad18-8fa0911587ad\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"543d12f5-e3d7-4d95-a13c-142fc0ca4b45\"), 7, new Guid(\"01eaea33-366b-49d5-9390-318eead8b7ea\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"118796d0-8d55-419d-8c86-7b9db9dec6f2\"), 5, new Guid(\"88ed0b63-d6c2-4bd3-a6c8-1ef2e9fb11d6\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"d5855642-ed2d-403d-970a-3e92c223c4dc\"), 7, new Guid(\"88ed0b63-d6c2-4bd3-a6c8-1ef2e9fb11d6\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"26200b65-f73d-4989-8403-0e96651a48ed\"), 3, new Guid(\"cb90611c-36d4-42b6-9293-9a35da28078a\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"1b47f872-b5fb-43da-8998-c7c540d7696b\"), 5, new Guid(\"cb90611c-36d4-42b6-9293-9a35da28078a\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"67d6aef4-a8ed-496e-be13-c7c7c7c51294\"), 7, new Guid(\"cb90611c-36d4-42b6-9293-9a35da28078a\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"3ce35d8d-b77e-4885-819b-9545f9c1817e\"), 3, new Guid(\"19403607-a712-4cc6-8cc0-efe12e160407\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"0fb1125f-2cd9-43ac-be17-316252e5648c\"), 5, new Guid(\"19403607-a712-4cc6-8cc0-efe12e160407\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"f7ba05c7-795f-4ba5-858c-5fab5625c710\"), 7, new Guid(\"19403607-a712-4cc6-8cc0-efe12e160407\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"8cd8409c-9b6f-4a42-bf7c-9f56284fef57\"), 3, new Guid(\"3fe5fc61-86a7-4b6b-ad6f-95dd1b459e42\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"94b61ce2-5666-4bc2-b00d-b4f43aa25146\"), 5, new Guid(\"3fe5fc61-86a7-4b6b-ad6f-95dd1b459e42\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"e23d5e75-1e55-4734-80ff-f8541a57c06f\"), 7, new Guid(\"3fe5fc61-86a7-4b6b-ad6f-95dd1b459e42\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"9c8392fd-af72-4281-8457-2cc23e7c9b49\"), 3, new Guid(\"88ed0b63-d6c2-4bd3-a6c8-1ef2e9fb11d6\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"c5da0feb-8d64-4606-9099-d600cf7d809e\"), 5, new Guid(\"b3cc7f49-01c8-4f43-ad18-8fa0911587ad\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"3e3ecd4d-5df0-4149-a995-b0f940ed7778\"), 3, new Guid(\"b3cc7f49-01c8-4f43-ad18-8fa0911587ad\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"7fff23c9-a205-4738-9dc0-b88614d8610b\"), 7, new Guid(\"192411f3-dbba-4d92-90fa-b1453894177c\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"f638982a-32a2-4d74-b71a-abc9e1f0c106\"), 5, new Guid(\"0d36915f-a08a-437b-9bbf-f8565ca43168\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"087b7542-5e22-4754-80d3-f04e84d4cc2f\"), 7, new Guid(\"0d36915f-a08a-437b-9bbf-f8565ca43168\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"fb2289f9-aa73-4001-85df-0eee97f8b214\"), 3, new Guid(\"26f13dc3-abeb-4b16-9e6a-95c6b24eb144\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"f21dbdef-7778-43c9-81fc-3676833b3551\"), 5, new Guid(\"26f13dc3-abeb-4b16-9e6a-95c6b24eb144\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"a5458e82-18d2-4015-b6ef-6ca7d013a2bf\"), 7, new Guid(\"26f13dc3-abeb-4b16-9e6a-95c6b24eb144\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"6f005baf-439b-4ec8-a98f-8fd516bf2f36\"), 3, new Guid(\"aeea7699-d190-460b-bfc5-3f58c48308af\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"0c612c03-2315-4188-b798-a01418be76a8\"), 5, new Guid(\"aeea7699-d190-460b-bfc5-3f58c48308af\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"40e36356-4fc2-4949-87d1-67a82480d9c1\"), 7, new Guid(\"aeea7699-d190-460b-bfc5-3f58c48308af\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"f90911b1-0c7f-4560-ab71-13ed02b49712\"), 3, new Guid(\"2e579e98-6d5a-47e7-8365-2f60a4449da5\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"1a995ef0-a31f-4e66-824b-ba71e5fbcfeb\"), 5, new Guid(\"2e579e98-6d5a-47e7-8365-2f60a4449da5\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"f79b44d7-a836-419b-b847-b5ef63951b96\"), 7, new Guid(\"2e579e98-6d5a-47e7-8365-2f60a4449da5\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"d5a336d9-663c-421a-b80a-091cf94e3ed1\"), 3, new Guid(\"bc0ff59d-cd4b-4b6e-9de3-68be1324d00e\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"06c15086-58d7-4d38-b833-3a8dc7c9776e\"), 5, new Guid(\"bc0ff59d-cd4b-4b6e-9de3-68be1324d00e\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"8d12c030-4f48-4f48-b43f-8af6956a7672\"), 7, new Guid(\"bc0ff59d-cd4b-4b6e-9de3-68be1324d00e\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"753bcf68-d76f-49d4-a899-db8d75808c68\"), 3, new Guid(\"ba8309ed-15c3-4d8f-b402-e174ad6af263\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"44e859b9-d8e0-40a5-9586-8cad9daf61b3\"), 5, new Guid(\"ba8309ed-15c3-4d8f-b402-e174ad6af263\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"7f8e2e91-6678-449a-901a-eafffb240e35\"), 7, new Guid(\"ba8309ed-15c3-4d8f-b402-e174ad6af263\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"3f4ddef8-dd64-4ca6-a4fc-476c4c2b3474\"), 3, new Guid(\"cb84e983-666c-44d5-b47f-da2f97ab70d0\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"23ec788c-28ee-45cf-bd4c-267b4a42e82e\"), 5, new Guid(\"cb84e983-666c-44d5-b47f-da2f97ab70d0\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"dc1766dc-b98f-4b6c-a7f2-48def6347e40\"), 7, new Guid(\"cb84e983-666c-44d5-b47f-da2f97ab70d0\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"217a6f55-6959-44f2-88d0-ad9d96ef0282\"), 3, new Guid(\"c4ed53cb-6802-4364-b0d8-ad616671abe3\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"480111f1-8fd8-495d-9cf5-2e2f2af36274\"), 5, new Guid(\"c4ed53cb-6802-4364-b0d8-ad616671abe3\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"ef35c686-14d5-42c1-b78e-ac996bb3d390\"), 7, new Guid(\"c4ed53cb-6802-4364-b0d8-ad616671abe3\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"e6c54f36-23cc-4e4c-b8cf-0718135270fe\"), 3, new Guid(\"192411f3-dbba-4d92-90fa-b1453894177c\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"7c6ff2a3-348e-41dd-aaeb-5387c5763ceb\"), 5, new Guid(\"192411f3-dbba-4d92-90fa-b1453894177c\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"595a2b52-e380-47df-a67e-de578fa2c2cf\"), 5, new Guid(\"54134257-8b1e-4ec0-ad00-73858582772b\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"ce7a623e-4548-48e9-920e-1ce1f42fdc41\"), 7, new Guid(\"0b8241f4-709a-4950-b82d-b072e4737d36\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"d5dd05b6-307e-44a1-9c6c-26797b9c0325\"), 7, new Guid(\"54134257-8b1e-4ec0-ad00-73858582772b\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"5691dfdc-d651-4c8a-889f-446deb3bc1db\"), 5, new Guid(\"3f4d97d5-92ad-4f6f-a206-794cdd5f7cc4\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"e5dab81b-a2c0-4489-9344-99ef830934f8\"), 7, new Guid(\"ef2e999a-92f8-4bdb-99f2-1342aa7551ac\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"9425312f-3fef-4e33-96fb-d0e51826d543\"), 3, new Guid(\"f8ae0630-82a2-42bf-9c9c-38da4ec3886c\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"ebc44f67-3464-4ca2-a193-f388b469a1c8\"), 5, new Guid(\"f8ae0630-82a2-42bf-9c9c-38da4ec3886c\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"035a1be6-af44-4761-8df2-ebf3a61a475a\"), 7, new Guid(\"f8ae0630-82a2-42bf-9c9c-38da4ec3886c\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"3f066aa3-b5d5-48d5-bf97-b2728befed75\"), 3, new Guid(\"89a15257-693d-41a3-bbf7-5933984b4e27\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"9186f4ea-d3e9-4a95-9801-eb6cc0a8efb4\"), 5, new Guid(\"89a15257-693d-41a3-bbf7-5933984b4e27\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"bdadff25-73ea-4363-9ae3-927c9909a890\"), 7, new Guid(\"89a15257-693d-41a3-bbf7-5933984b4e27\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"62fbbf79-cbf8-4d3c-a570-98678f2b661b\"), 3, new Guid(\"32b6007c-6d7f-4524-9543-c5e96a21fb1b\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"88f24abb-66e8-4753-b165-233ee2e663e1\"), 5, new Guid(\"32b6007c-6d7f-4524-9543-c5e96a21fb1b\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"554f5118-f42d-467b-9ca2-f076aff26dec\"), 7, new Guid(\"32b6007c-6d7f-4524-9543-c5e96a21fb1b\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"2f72b6fd-5ca0-4f8a-9d94-3a3c5766f960\"), 3, new Guid(\"e964ab43-5ed2-41b0-84d3-d41c9d61c635\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"64035163-8ef0-45e3-a43b-56c55b0b7311\"), 5, new Guid(\"ef2e999a-92f8-4bdb-99f2-1342aa7551ac\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"d0a5ff0a-1366-4f82-9c52-5f6982033615\"), 5, new Guid(\"e964ab43-5ed2-41b0-84d3-d41c9d61c635\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"88a0f1c3-e75d-4f72-bb82-3de0bb7996af\"), 3, new Guid(\"367ac193-c74c-4edf-8815-8ea29c070009\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"4c7ead0f-087a-404f-81c5-80350bde4196\"), 5, new Guid(\"367ac193-c74c-4edf-8815-8ea29c070009\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"f5c52fe3-adfb-4412-8acc-f56d16d71204\"), 7, new Guid(\"367ac193-c74c-4edf-8815-8ea29c070009\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"fe0ee883-61f9-42b1-bb42-7de89e3c2ac1\"), 3, new Guid(\"09237feb-1c5a-4631-a109-837af84a63cf\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"71d938db-8fb1-4036-9825-ec8d185e3127\"), 5, new Guid(\"09237feb-1c5a-4631-a109-837af84a63cf\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"c5f48035-a815-47a8-bd5f-de84c76cc71b\"), 7, new Guid(\"09237feb-1c5a-4631-a109-837af84a63cf\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"cde9c4bb-36b4-427c-89c2-95daaad8bf21\"), 3, new Guid(\"be2c83f9-063a-4d3e-9eae-463fa767e55d\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"ce420e74-44fc-424e-abc5-58716fc902ce\"), 5, new Guid(\"be2c83f9-063a-4d3e-9eae-463fa767e55d\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"4699c5d7-8eb5-472c-b6f5-735b798a53c6\"), 7, new Guid(\"be2c83f9-063a-4d3e-9eae-463fa767e55d\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"94d825c5-6a22-487d-9344-bac982af5f19\"), 3, new Guid(\"728eca45-de9a-4a25-a3bc-e0107cc7adce\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"6d25272c-bb20-4d4d-8502-28daadcce918\"), 5, new Guid(\"728eca45-de9a-4a25-a3bc-e0107cc7adce\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"657f3be1-daee-4743-a9da-6af5b09f73f3\"), 7, new Guid(\"e964ab43-5ed2-41b0-84d3-d41c9d61c635\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"d9c2f151-8fd2-4b30-9ed9-881d8608211d\"), 7, new Guid(\"728eca45-de9a-4a25-a3bc-e0107cc7adce\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"5c8020b1-9eef-453e-a6dd-5cdab9bd8a86\"), 3, new Guid(\"ef2e999a-92f8-4bdb-99f2-1342aa7551ac\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"d05aaa47-5b4a-4c6e-9d25-8f0c8c5dd726\"), 5, new Guid(\"bfef67ef-0a86-4c63-9e53-3261a5c5e893\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"601cd6c3-b6f5-4e9e-97bb-bcc439adf0ad\"), 5, new Guid(\"d6907cf7-998e-4cb5-9141-fba1cfd8ec38\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"b68129d2-3036-485a-a9e8-db54b61f551f\"), 7, new Guid(\"d6907cf7-998e-4cb5-9141-fba1cfd8ec38\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"b290fe20-2c96-4a4d-ac10-61c21c869d13\"), 3, new Guid(\"6f74c404-63eb-48be-8518-643ed601c5e4\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"4dea7d81-5a9b-437c-a256-40d2509465d9\"), 5, new Guid(\"6f74c404-63eb-48be-8518-643ed601c5e4\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"1dff1878-a072-4dc0-a8b3-8618a78f282c\"), 7, new Guid(\"6f74c404-63eb-48be-8518-643ed601c5e4\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"24761c73-9dfb-4b90-857e-45ca85dd89ff\"), 3, new Guid(\"a476185a-7db2-47f8-9048-0c64421e0336\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"73097829-7937-4159-982d-4ee8ad767b3b\"), 5, new Guid(\"a476185a-7db2-47f8-9048-0c64421e0336\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"41cad846-99c4-4f2e-8f69-83fbc6a8b9cf\"), 7, new Guid(\"a476185a-7db2-47f8-9048-0c64421e0336\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"1c9f39fc-b12d-4212-97c8-650c701dbc12\"), 3, new Guid(\"e6ff91c5-b45c-419b-80f8-6d274d72feda\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"057470a0-54b7-47c4-8d61-2f04add5c03b\"), 5, new Guid(\"e6ff91c5-b45c-419b-80f8-6d274d72feda\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"3435630b-cbaf-4d77-b038-29bfb5413737\"), 7, new Guid(\"e6ff91c5-b45c-419b-80f8-6d274d72feda\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"6dea2732-6dd3-4211-abce-2563f270ea68\"), 7, new Guid(\"bfef67ef-0a86-4c63-9e53-3261a5c5e893\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"dc547a3b-a182-48b4-8980-2e7ceeb64e4a\"), 3, new Guid(\"725792da-2502-410f-9ead-c7fe159c0278\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"da9ed7a4-1dc3-4c18-8264-e5dcfcaa8c66\"), 7, new Guid(\"725792da-2502-410f-9ead-c7fe159c0278\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"45a079ad-8b70-4174-980e-3890cca7c1b8\"), 3, new Guid(\"8de1196c-305d-4bbe-b40f-6c6c831b1e4d\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"8ebc547a-b2c3-4422-b08e-0de71daecf0d\"), 5, new Guid(\"8de1196c-305d-4bbe-b40f-6c6c831b1e4d\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"0d48f6c2-280e-476c-8258-00b41f9b2302\"), 7, new Guid(\"8de1196c-305d-4bbe-b40f-6c6c831b1e4d\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"4a5a11b6-4010-4eb5-a289-22242c1e21ce\"), 3, new Guid(\"a6f908a5-1d80-459a-8dcb-d08a2a7e5e99\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"be7282b8-eee1-4133-9171-91e85b4d7871\"), 5, new Guid(\"a6f908a5-1d80-459a-8dcb-d08a2a7e5e99\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"08109fde-f60b-487f-8ce0-48d0e77bc042\"), 7, new Guid(\"a6f908a5-1d80-459a-8dcb-d08a2a7e5e99\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"61ca5925-8c49-4278-86c4-2ac0400cf680\"), 3, new Guid(\"0a4d63b9-0d7c-46c3-8aff-91b4fe3265b1\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"890bd93c-5116-4c49-a8a1-ce9e85b5ffff\"), 5, new Guid(\"0a4d63b9-0d7c-46c3-8aff-91b4fe3265b1\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"f425bf91-6427-46f6-a8d0-8d8149eb139e\"), 7, new Guid(\"0a4d63b9-0d7c-46c3-8aff-91b4fe3265b1\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"77051b45-6f66-4857-8772-572aa2996c66\"), 3, new Guid(\"bfef67ef-0a86-4c63-9e53-3261a5c5e893\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"3ec84fd2-98b0-47cc-ac89-a9265b2812d9\"), 5, new Guid(\"725792da-2502-410f-9ead-c7fe159c0278\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"47964a6c-a426-4578-86e5-1e11297d6b4a\"), 3, new Guid(\"d6907cf7-998e-4cb5-9141-fba1cfd8ec38\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"666210dc-e9e4-4752-9217-951ee62609d0\"), 3, new Guid(\"e10983bd-677a-4c30-a625-9ac327f10b19\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"35514319-9347-4b85-aaa2-a54ec3baa19c\"), 7, new Guid(\"e10983bd-677a-4c30-a625-9ac327f10b19\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"04b02d1c-29f7-4bc0-ab9d-8db05dd580d0\"), 5, new Guid(\"6e606718-6c7a-43a7-95ec-99819aa1134f\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"6e9381e4-481b-4c8c-809f-a5c171231277\"), 7, new Guid(\"6e606718-6c7a-43a7-95ec-99819aa1134f\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"48c00fa3-08ab-46e2-a68c-c56f052694c0\"), 3, new Guid(\"fd9c00fe-cb56-4fec-8285-cffadabe75b6\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"79c1bd01-b86d-4f73-9396-0e313bd8d2f5\"), 5, new Guid(\"fd9c00fe-cb56-4fec-8285-cffadabe75b6\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"a697e503-b169-4160-9209-c7bdc34c7e2d\"), 7, new Guid(\"fd9c00fe-cb56-4fec-8285-cffadabe75b6\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"7bb6c121-0c10-4355-89bf-00919eb2f64d\"), 3, new Guid(\"0a507f1e-3a73-4fb1-ad69-1fda752e8032\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"355ad200-e610-4930-a31d-331845b0ee08\"), 5, new Guid(\"0a507f1e-3a73-4fb1-ad69-1fda752e8032\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"dce2440a-e603-4ebd-9d3c-95d04ddaa8e5\"), 7, new Guid(\"0a507f1e-3a73-4fb1-ad69-1fda752e8032\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"f4eb85bf-4920-4b29-b465-aa93b1c76ba5\"), 3, new Guid(\"b856656d-4dff-489e-96ae-566f4dbb3b61\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"c60bb740-bf70-4223-acca-20a0b5409b20\"), 5, new Guid(\"b856656d-4dff-489e-96ae-566f4dbb3b61\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"ca9f31b8-2004-4115-89d2-9fe0aa085559\"), 7, new Guid(\"b856656d-4dff-489e-96ae-566f4dbb3b61\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"67c848da-569f-4c8f-882c-90ae105f8798\"), 3, new Guid(\"6e606718-6c7a-43a7-95ec-99819aa1134f\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"be44fbba-8692-4915-bed6-181faabadd47\"), 3, new Guid(\"b30cf582-88bf-4dde-897c-725714cf4d1a\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"858b9116-6e7c-4279-a201-25f3b11bee94\"), 7, new Guid(\"b30cf582-88bf-4dde-897c-725714cf4d1a\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"afddfd48-dacb-4aea-b95e-fb00c19a87fa\"), 3, new Guid(\"34cade20-c799-495d-b95a-93aff4f22d84\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"9d6f31d2-d83b-432a-93bf-c41cd2377b63\"), 5, new Guid(\"34cade20-c799-495d-b95a-93aff4f22d84\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"ddcfbdb0-8beb-4b7f-822d-035adb8760f7\"), 7, new Guid(\"34cade20-c799-495d-b95a-93aff4f22d84\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"6d62a453-f994-4ade-a74a-eb33e87ff44b\"), 3, new Guid(\"d6977daa-ed7e-4bff-ab87-c3073ade4516\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"25e3e426-b818-435b-9c0e-56c741a82bf0\"), 5, new Guid(\"d6977daa-ed7e-4bff-ab87-c3073ade4516\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"2be94560-d3fd-4aea-b69b-833a079a827b\"), 7, new Guid(\"d6977daa-ed7e-4bff-ab87-c3073ade4516\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"1c7b9a71-a521-4251-ae74-006321b20d19\"), 3, new Guid(\"768894b5-ef38-4aba-b048-b639a00ef828\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"bf50e37e-757d-4f98-a869-06929396f286\"), 5, new Guid(\"768894b5-ef38-4aba-b048-b639a00ef828\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"64b143ae-d250-4b75-adf0-717dc139dd13\"), 7, new Guid(\"768894b5-ef38-4aba-b048-b639a00ef828\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"eb2daae3-8666-4fca-b2bd-04ed5a7bdaf9\"), 3, new Guid(\"0b8241f4-709a-4950-b82d-b072e4737d36\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"b3b64377-34a7-4bbf-9067-2e96bb708985\"), 5, new Guid(\"b30cf582-88bf-4dde-897c-725714cf4d1a\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"8e24f540-7045-4526-96cd-b64523052b24\"), 5, new Guid(\"e10983bd-677a-4c30-a625-9ac327f10b19\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"c6c579c5-58d6-46c5-9cc4-b64940732027\"), 7, new Guid(\"3e5f0488-93cc-4b08-9e9d-295b769eb4a4\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"58bcf887-fea5-49e4-a0bb-94374846cb2a\"), 3, new Guid(\"3e5f0488-93cc-4b08-9e9d-295b769eb4a4\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"b2e71d98-f31a-47e7-9caa-255179e403ba\"), 3, new Guid(\"9a4da83b-1f1b-4be9-9af5-f169fae639d1\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"32285907-243b-43d4-8e63-feb5f9218d82\"), 5, new Guid(\"9a4da83b-1f1b-4be9-9af5-f169fae639d1\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"6bb1591e-e77e-4a60-8ee1-478812a1f2ed\"), 7, new Guid(\"9a4da83b-1f1b-4be9-9af5-f169fae639d1\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"53c4f962-820e-4cc7-9876-ea6a24922ed3\"), 3, new Guid(\"a2251a91-4b06-4ada-a043-eefc9cb070fd\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"f585aee7-ca72-4772-840c-3db04af493db\"), 5, new Guid(\"a2251a91-4b06-4ada-a043-eefc9cb070fd\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"8d4a1e81-9e32-4b1f-b314-8ab8a999e8bc\"), 7, new Guid(\"a2251a91-4b06-4ada-a043-eefc9cb070fd\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"25b510df-cd39-4797-8fa4-52a8b7b1e526\"), 3, new Guid(\"aef2a1f2-50b6-4dff-8986-7ce9f3c6ca85\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"e13ec78a-de18-42ef-bab7-f54d33246de7\"), 5, new Guid(\"aef2a1f2-50b6-4dff-8986-7ce9f3c6ca85\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"3233dfca-335c-418a-990a-85b17a06116c\"), 7, new Guid(\"aef2a1f2-50b6-4dff-8986-7ce9f3c6ca85\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"3e7d51b7-316c-473c-a5fc-065ef951b351\"), 3, new Guid(\"9b40d552-2567-4896-92bc-a4a3034bcaf4\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"0587037f-b06d-4d67-91d1-3f2e4e9b57da\"), 5, new Guid(\"9b40d552-2567-4896-92bc-a4a3034bcaf4\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"028004ed-9ead-414a-bb1a-acffde9b990d\"), 5, new Guid(\"3e5f0488-93cc-4b08-9e9d-295b769eb4a4\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"114a33f5-8305-487a-a464-2c685acf1757\"), 7, new Guid(\"9b40d552-2567-4896-92bc-a4a3034bcaf4\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"a3d0978f-1b1a-485c-9597-706ee59d4d38\"), 5, new Guid(\"e76d5242-0494-4a60-b41c-41d3b0c5a03f\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"576c7fe1-2aac-45a3-8efc-583655e94441\"), 7, new Guid(\"e76d5242-0494-4a60-b41c-41d3b0c5a03f\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"aa729821-d15c-4ab3-b715-875ba7a93fdf\"), 3, new Guid(\"204b404a-e07e-4e20-9840-f113e238550e\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"b192ce44-a7de-4c9e-a9c2-f4b81b4fd154\"), 5, new Guid(\"204b404a-e07e-4e20-9840-f113e238550e\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"0c9d9d5c-d493-4ea6-876d-8d10f4e84d94\"), 7, new Guid(\"204b404a-e07e-4e20-9840-f113e238550e\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"e12f87ee-d30c-4eae-938b-41b94b85a712\"), 3, new Guid(\"5923ebd5-7deb-442f-bb55-253476141e37\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"ceb4c100-b24a-4b40-9370-aeed889eb9e6\"), 5, new Guid(\"5923ebd5-7deb-442f-bb55-253476141e37\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"f538afdf-37c9-4ff4-833f-379bf51b8225\"), 7, new Guid(\"5923ebd5-7deb-442f-bb55-253476141e37\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"17b1a314-111e-49ba-8115-ccfbdb5b923c\"), 3, new Guid(\"b9c4da21-1644-4c98-b810-2e25b96d42a3\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"640048b7-cdc4-42c8-96de-9dc13b50a22b\"), 5, new Guid(\"b9c4da21-1644-4c98-b810-2e25b96d42a3\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"1e131b7f-6a2b-499e-b1f4-8906c857d17d\"), 7, new Guid(\"b9c4da21-1644-4c98-b810-2e25b96d42a3\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"882b585f-597a-4b95-a7f1-4b6e4274656b\"), 3, new Guid(\"e76d5242-0494-4a60-b41c-41d3b0c5a03f\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"db30b3e1-f3a6-4d1c-99a0-fc7ddac2916a\"), 7, new Guid(\"17f65175-50bc-43e0-a30b-0c83b7c5143e\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"dcc53953-63e7-46c4-8614-91f267ee1047\"), 5, new Guid(\"17f65175-50bc-43e0-a30b-0c83b7c5143e\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"6618007d-510b-403b-9a87-a393660c9ce0\"), 3, new Guid(\"17f65175-50bc-43e0-a30b-0c83b7c5143e\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"fddce8e5-b74d-481e-afc8-39d64c703ac5\"), 3, new Guid(\"3524cd22-b771-48e0-ba54-a5dd660edc72\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"829333c4-45a0-4c2f-8f57-879b568f63d6\"), 5, new Guid(\"3524cd22-b771-48e0-ba54-a5dd660edc72\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"81347f62-29da-45e2-a83d-de0769b247c7\"), 7, new Guid(\"3524cd22-b771-48e0-ba54-a5dd660edc72\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"c2ce41c9-b5c3-403e-933e-123a10b673a3\"), 3, new Guid(\"ef7ea7c5-685f-472e-8460-04a09e7d70cc\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"adf7615d-a5b0-4d3e-9253-8467730a9e2d\"), 5, new Guid(\"ef7ea7c5-685f-472e-8460-04a09e7d70cc\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"32ef80e8-eede-4a5e-adc8-742bd885ab13\"), 7, new Guid(\"ef7ea7c5-685f-472e-8460-04a09e7d70cc\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"10b295b4-c014-4149-a66c-6b0d2b4a8c79\"), 3, new Guid(\"da7b22c7-9738-44f5-a385-b1e8f5a85d4a\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"8964d1f5-3089-4f37-899d-3ff7219d9e74\"), 5, new Guid(\"da7b22c7-9738-44f5-a385-b1e8f5a85d4a\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"79095189-be89-4f85-93f7-48d291151844\"), 7, new Guid(\"da7b22c7-9738-44f5-a385-b1e8f5a85d4a\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"5a00ceae-1e26-4d1a-86c3-6682a13361ab\"), 3, new Guid(\"dac22f2b-4c4a-4786-b91e-3d9bfea7f225\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"4a95b0e9-ce22-4586-bc4c-843455f3a756\"), 5, new Guid(\"dac22f2b-4c4a-4786-b91e-3d9bfea7f225\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"12db7c02-cd2c-4bc6-94f8-45d7cfb0ea4b\"), 7, new Guid(\"c51dd9b6-e07f-4f74-89e0-60f76d25eca4\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"54f3e443-3ec7-41c0-8227-0088930f0c0f\"), 7, new Guid(\"dac22f2b-4c4a-4786-b91e-3d9bfea7f225\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"f1931338-69fb-435d-909b-02f2eea5f9aa\"), 5, new Guid(\"8c394487-cf3e-4b85-b614-aead5b34ba6c\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"1e16b76f-0d82-4692-95de-4fb95cf6387e\"), 7, new Guid(\"8c394487-cf3e-4b85-b614-aead5b34ba6c\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"aa3d2b1d-2ff4-4b06-b677-77f65191be85\"), 3, new Guid(\"38e05a0b-84c3-4726-b588-d2200699a32d\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"878eb40f-40be-4148-b855-0f847e5d671b\"), 5, new Guid(\"38e05a0b-84c3-4726-b588-d2200699a32d\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"6bdb59a0-f90d-4fc5-8a22-e8eba52fbea8\"), 7, new Guid(\"38e05a0b-84c3-4726-b588-d2200699a32d\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"7703735b-0adb-4783-8203-7624c5270584\"), 3, new Guid(\"1cac563e-4924-424d-b363-0cf0ec9d9c30\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"cc69b3a9-5d33-4899-9be1-8548b146b364\"), 5, new Guid(\"1cac563e-4924-424d-b363-0cf0ec9d9c30\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"2c2cbd89-ea6b-418a-9a03-4fd30ca3e65d\"), 7, new Guid(\"1cac563e-4924-424d-b363-0cf0ec9d9c30\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"6ecdf244-bb77-4801-a019-986fb4d4e355\"), 3, new Guid(\"e9976878-6ae0-4e7c-8b01-1d500210619c\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"f733b693-2a30-4ba7-b1e2-e07635b405af\"), 5, new Guid(\"e9976878-6ae0-4e7c-8b01-1d500210619c\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"2102c47c-18f2-45aa-9b01-e5fbecc4f1ae\"), 7, new Guid(\"e9976878-6ae0-4e7c-8b01-1d500210619c\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"23fa5e43-3525-4731-a193-acb202d183c4\"), 3, new Guid(\"8c394487-cf3e-4b85-b614-aead5b34ba6c\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"7353d697-5a91-425e-870e-7abf35381f88\"), 3, new Guid(\"cc30c1e9-66f2-4199-b124-428b39eb9ced\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"91bc3c0d-6e84-42d5-a412-9fe879474371\"), 5, new Guid(\"c51dd9b6-e07f-4f74-89e0-60f76d25eca4\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"bfbd5999-d9c3-4236-8a51-292ac7974a40\"), 7, new Guid(\"94527a6a-e91f-427d-be57-546df759ecb9\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"bf1e50b0-68a8-4068-81c6-f8e58249a6f0\"), 7, new Guid(\"3f4d97d5-92ad-4f6f-a206-794cdd5f7cc4\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"c6c88693-1bab-4005-b617-7c08958bf4ac\"), 3, new Guid(\"04fcc1d5-3b8a-4ee0-b9b3-69515db3f166\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"777522e2-199f-4407-8ee8-5a2722f0ece0\"), 5, new Guid(\"04fcc1d5-3b8a-4ee0-b9b3-69515db3f166\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"cf1354ca-b340-4fd9-91da-55fbb36791df\"), 7, new Guid(\"04fcc1d5-3b8a-4ee0-b9b3-69515db3f166\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"0a1b6bad-1fb9-4a65-a419-20d0f2c33d9e\"), 3, new Guid(\"799e0e70-eddb-465d-99c2-ff01c2651cf9\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"745ab6f7-0817-46c6-9194-fb18f4e48550\"), 5, new Guid(\"799e0e70-eddb-465d-99c2-ff01c2651cf9\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"6cb348b7-95b4-4691-8f2a-4d9f4caee1ca\"), 7, new Guid(\"799e0e70-eddb-465d-99c2-ff01c2651cf9\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"039c5aa5-1bea-4e8e-bf8b-a3b2dafd9249\"), 3, new Guid(\"93e97edc-86ad-4ec2-83e9-dff313ba41fa\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"c4684186-567a-47a3-aaa4-44c708527946\"), 5, new Guid(\"93e97edc-86ad-4ec2-83e9-dff313ba41fa\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"b8e9243e-8e6c-42cd-8ab8-064a900cfcde\"), 7, new Guid(\"93e97edc-86ad-4ec2-83e9-dff313ba41fa\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"7fa22d2b-4c9f-4e50-8037-1c498041a056\"), 3, new Guid(\"5da78ef4-75cd-4606-ae91-08cc3619908b\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"51ced428-be78-49e9-93ac-a266d14e1b5b\"), 3, new Guid(\"c51dd9b6-e07f-4f74-89e0-60f76d25eca4\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"452d28a2-8753-473e-8ac3-2fe7470ae371\"), 5, new Guid(\"5da78ef4-75cd-4606-ae91-08cc3619908b\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"8790ae04-eb1e-4361-b1ca-f15a36f5232d\"), 3, new Guid(\"9741b3c8-4411-4c7f-bb8d-058c959a8377\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"9d21fa60-add0-43c6-9be9-6f6c74f7cb42\"), 5, new Guid(\"9741b3c8-4411-4c7f-bb8d-058c959a8377\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"153a16e7-2834-427a-a0be-71e1df81399f\"), 7, new Guid(\"9741b3c8-4411-4c7f-bb8d-058c959a8377\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"9cfaef25-1c01-403a-8bb2-c9097b31f332\"), 3, new Guid(\"f9206b06-d301-4847-a4e6-646df2b77c98\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"5abbea70-3480-49ea-bf15-87e4d6eb3f3f\"), 5, new Guid(\"f9206b06-d301-4847-a4e6-646df2b77c98\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"36758238-3be5-4729-9d16-ff5193e1eb16\"), 7, new Guid(\"f9206b06-d301-4847-a4e6-646df2b77c98\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"8d1f5d8f-6d59-4abb-887d-e8a686cf70f6\"), 3, new Guid(\"af8d92ba-03b5-4de9-9913-9ab4b78e2468\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"779ff846-0f6e-433e-b374-53c87773753e\"), 5, new Guid(\"af8d92ba-03b5-4de9-9913-9ab4b78e2468\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"668ad5ff-a541-4e79-87d2-33f8ef5f17e2\"), 7, new Guid(\"af8d92ba-03b5-4de9-9913-9ab4b78e2468\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"6b3f14ad-0108-4e4f-a22e-1e34b4dc6708\"), 3, new Guid(\"94527a6a-e91f-427d-be57-546df759ecb9\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"e00e8095-9bbc-4b53-9e9b-e3ff304f7e8f\"), 5, new Guid(\"94527a6a-e91f-427d-be57-546df759ecb9\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"189b3780-5117-4eaa-9457-69eea45592a5\"), 7, new Guid(\"5da78ef4-75cd-4606-ae91-08cc3619908b\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"42ce7ea8-1144-4552-8067-180a8b758806\"), 5, new Guid(\"cc30c1e9-66f2-4199-b124-428b39eb9ced\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"fe723700-9b60-475c-9c41-bd7e5c2f9566\"), 7, new Guid(\"cc30c1e9-66f2-4199-b124-428b39eb9ced\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"9775d484-a98e-4fe7-8779-c2f6b5cd73ad\"), 3, new Guid(\"238466fe-5760-418a-a41b-e0cb634f3e47\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"4d70a993-ebf9-4b11-835c-acca350930aa\"), 3, new Guid(\"a8fadded-ad3e-4d59-b671-ee213fb8f92b\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"adbccbc3-f6ad-4065-b2a2-950e3211c349\"), 5, new Guid(\"a8fadded-ad3e-4d59-b671-ee213fb8f92b\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"eb08fd83-1262-4e65-804a-8005d68d6c2a\"), 7, new Guid(\"a8fadded-ad3e-4d59-b671-ee213fb8f92b\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"58862499-7cb2-493e-8cee-c9cc6fc409ce\"), 3, new Guid(\"f0b85d79-c774-481f-ad35-bf5d21326afa\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"4a0c643b-a70a-4963-845c-59ee8347aa8c\"), 5, new Guid(\"f0b85d79-c774-481f-ad35-bf5d21326afa\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"a7984337-e997-498b-a42f-88cc83f310a1\"), 7, new Guid(\"f0b85d79-c774-481f-ad35-bf5d21326afa\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"319bacf4-627a-4a97-a83d-95574fc384d6\"), 3, new Guid(\"d3d82a59-cf37-4270-ae7d-ca31f15dcad6\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"d9e2585b-e3c9-49fd-a190-fcdfd55a3498\"), 5, new Guid(\"d3d82a59-cf37-4270-ae7d-ca31f15dcad6\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"bab1340f-2188-440e-8e49-98765d9a900f\"), 7, new Guid(\"d3d82a59-cf37-4270-ae7d-ca31f15dcad6\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"260a7e70-d7a3-4989-8737-e5df7c4ebeb5\"), 3, new Guid(\"4b5a9735-d298-4ac1-a71d-46dacba09bbe\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"2d303b61-0437-462f-98ec-8cf925b6a4fd\"), 5, new Guid(\"4b5a9735-d298-4ac1-a71d-46dacba09bbe\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"08924675-e230-466b-b4f7-10cdb8b02516\"), 7, new Guid(\"549353f2-9e73-411f-b7b7-dde646e45dc3\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"bad3218b-cbc0-4c3e-91ff-bc9c965d671a\"), 7, new Guid(\"4b5a9735-d298-4ac1-a71d-46dacba09bbe\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"b9be6a18-6176-4c5c-b520-cbd60d1e1d7f\"), 5, new Guid(\"04f4685c-a938-4810-bdbf-c4e81be20486\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"c9227a34-d6a1-4711-98ca-aa75741c9d55\"), 7, new Guid(\"04f4685c-a938-4810-bdbf-c4e81be20486\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"dde327f0-6e86-44f9-aa45-ac5df3b1d49a\"), 3, new Guid(\"17d30b06-d1f1-4165-9a43-5d3caf1c2031\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"8506dbb0-6bd1-49a0-863e-5414ea6f36b3\"), 5, new Guid(\"17d30b06-d1f1-4165-9a43-5d3caf1c2031\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"66da9898-7d50-4468-a2ef-c1340f11168e\"), 7, new Guid(\"17d30b06-d1f1-4165-9a43-5d3caf1c2031\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"15eabc4e-0158-4551-a050-d355b2116854\"), 3, new Guid(\"4cf3cce3-768a-4c6b-8fbf-098c87a076e0\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"f46a4788-c500-4e0f-ad0b-daa8b7f6d31b\"), 5, new Guid(\"4cf3cce3-768a-4c6b-8fbf-098c87a076e0\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"6e4930a0-0a93-4888-8707-2f6ae606742f\"), 7, new Guid(\"4cf3cce3-768a-4c6b-8fbf-098c87a076e0\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"d57f40a8-c072-4bc2-903c-214637dc3a3f\"), 3, new Guid(\"490f076a-3c5d-45b4-a106-a79d2f1338b6\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"4f4f6bec-a7cf-475e-9db7-bb49ecf5f668\"), 5, new Guid(\"490f076a-3c5d-45b4-a106-a79d2f1338b6\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"88618ce0-f745-4656-9d33-04c73f18866d\"), 7, new Guid(\"490f076a-3c5d-45b4-a106-a79d2f1338b6\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"08f71f38-fa36-4569-89c4-95a083504c96\"), 3, new Guid(\"04f4685c-a938-4810-bdbf-c4e81be20486\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"86eab8f1-96d4-49f6-aa41-95e438a1fc71\"), 5, new Guid(\"549353f2-9e73-411f-b7b7-dde646e45dc3\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"87402d4c-b902-4cf6-a439-de8f96de581d\"), 3, new Guid(\"549353f2-9e73-411f-b7b7-dde646e45dc3\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"fe5ce1c9-b8ab-4f94-aac0-ef551e716148\"), 7, new Guid(\"53bf0528-ecaa-4330-b6f4-42a89a45d51f\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"aa1f3f53-384a-4708-ae10-1616d59962e7\"), 5, new Guid(\"238466fe-5760-418a-a41b-e0cb634f3e47\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"6ba6f997-7c3a-421c-bda2-83a9bcc7ffef\"), 7, new Guid(\"238466fe-5760-418a-a41b-e0cb634f3e47\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"3d13f1ba-7789-4827-839f-78ef16e887f9\"), 3, new Guid(\"6d0facf2-7f84-4daf-b040-2b5aa00d8304\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"4cccda01-7cb4-42e4-b276-60e7e4bdcfcf\"), 5, new Guid(\"6d0facf2-7f84-4daf-b040-2b5aa00d8304\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"4eea36a9-7b42-47d5-9801-bbe48c3c9dcc\"), 7, new Guid(\"6d0facf2-7f84-4daf-b040-2b5aa00d8304\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"dabb5b67-04c3-459b-bc03-c2b73e3801e2\"), 3, new Guid(\"cfc4a690-aafc-45b9-bfa7-9008a6c0acd8\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"d5c73ad6-6376-4987-8e92-ffbcc3d05f36\"), 5, new Guid(\"cfc4a690-aafc-45b9-bfa7-9008a6c0acd8\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"9629118d-9a5d-4e9e-ab54-6df73a3241af\"), 7, new Guid(\"cfc4a690-aafc-45b9-bfa7-9008a6c0acd8\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"e7d57fff-af12-4f09-abe6-009a21d8ef38\"), 3, new Guid(\"0aa3747d-ce07-45cd-9372-02c2a4929572\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"5e4c5a42-ba71-4cdc-8644-421dced5dbe5\"), 5, new Guid(\"0aa3747d-ce07-45cd-9372-02c2a4929572\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"cb88c237-f69c-4874-a280-1618cd6ffdf8\"), 7, new Guid(\"0aa3747d-ce07-45cd-9372-02c2a4929572\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"1b6a6c91-bae1-489d-8058-267187035024\"), 3, new Guid(\"e4fa0493-edfb-4dc6-866f-f2b85e169661\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"81af2e5a-7053-4e0f-b67d-7388a093e01c\"), 5, new Guid(\"e4fa0493-edfb-4dc6-866f-f2b85e169661\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"b55e0971-7b4b-405a-a75a-a8e5023c44f3\"), 7, new Guid(\"e4fa0493-edfb-4dc6-866f-f2b85e169661\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"80c23e9c-932a-45a3-bb49-1dba41c9e70c\"), 3, new Guid(\"e7660d39-4497-4b94-9a41-e36928d3525b\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"f20d90b9-2c5a-4607-b792-a1005b548937\"), 5, new Guid(\"e7660d39-4497-4b94-9a41-e36928d3525b\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"935fab34-1851-4d20-bb3c-f932cb715b0f\"), 7, new Guid(\"e7660d39-4497-4b94-9a41-e36928d3525b\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"504d551a-20e2-44eb-b236-f535e899397a\"), 3, new Guid(\"76d7446c-b1b8-4636-bf03-b46c5076c1c0\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"722684ce-7821-421e-af9e-5ded8f8fa2b6\"), 5, new Guid(\"76d7446c-b1b8-4636-bf03-b46c5076c1c0\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"e1a523b4-bfbe-49fa-a230-81844c6cfb02\"), 7, new Guid(\"76d7446c-b1b8-4636-bf03-b46c5076c1c0\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"e7544424-c764-4471-be5f-6f3677d1fec6\"), 3, new Guid(\"ce14bc4b-bbad-4667-b0dc-d1070e252251\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"f4eff9d2-eee7-46c8-9692-472ba3eb4fc5\"), 5, new Guid(\"ce14bc4b-bbad-4667-b0dc-d1070e252251\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"888a5049-90c2-42dd-b6d3-2e3d2cb7e97c\"), 7, new Guid(\"ce14bc4b-bbad-4667-b0dc-d1070e252251\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"de526c2f-c15d-4604-9424-50e90704418f\"), 3, new Guid(\"53bf0528-ecaa-4330-b6f4-42a89a45d51f\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"08118462-07e3-4e35-9710-c783ba773643\"), 5, new Guid(\"53bf0528-ecaa-4330-b6f4-42a89a45d51f\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"d7b5bd81-a031-4a7b-a28f-46a50e32cd7e\"), 3, new Guid(\"3f4d97d5-92ad-4f6f-a206-794cdd5f7cc4\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"1e07b7c4-41f2-4cdb-8696-32ff60858c04\"), 7, new Guid(\"b66c153a-776b-4b19-aa19-50a3710d53b6\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"083a3256-1fc4-45e1-9e26-ba6746d35c0b\"), 3, new Guid(\"610fb97b-7f0c-46d2-86c6-f50010d51a71\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"13d69bbb-2680-4e89-93b6-e8f9f1cab3a2\"), 5, new Guid(\"610fb97b-7f0c-46d2-86c6-f50010d51a71\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"be546361-7c0b-448e-a9d8-3c5ee71566b6\"), 3, new Guid(\"1f3c824b-e840-4aaa-b620-84e1c3b2d3c4\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"0723dbe8-c371-450d-9518-fbd5eeffee89\"), 5, new Guid(\"1f3c824b-e840-4aaa-b620-84e1c3b2d3c4\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"29e3e544-c442-4671-a0d8-fe5f7db530f2\"), 7, new Guid(\"1f3c824b-e840-4aaa-b620-84e1c3b2d3c4\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"5083d632-595c-41e6-a480-9fbc086db37f\"), 3, new Guid(\"70166460-04cd-4356-ba2c-f267f3733fe7\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"acd5bfa2-0042-444f-ba00-36cb4177d7c9\"), 5, new Guid(\"70166460-04cd-4356-ba2c-f267f3733fe7\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"4cc71517-acb6-490c-8c17-66473b5d1833\"), 7, new Guid(\"70166460-04cd-4356-ba2c-f267f3733fe7\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"9b177955-7648-4637-bba3-940f8b22e3de\"), 3, new Guid(\"c85e5948-429e-44eb-be6e-57a30ba2d944\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"89d65edb-7749-4422-b769-e0e6d8bcd042\"), 5, new Guid(\"c85e5948-429e-44eb-be6e-57a30ba2d944\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"659c0740-2885-4446-b3c3-747c3d39477e\"), 7, new Guid(\"c85e5948-429e-44eb-be6e-57a30ba2d944\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"136265e3-ad51-4115-993e-b1266ec8d2f3\"), 3, new Guid(\"f97a94fd-98b1-44d1-a7d7-d6d8bf9b8695\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"cde740ad-d757-412a-ba89-0153487bfd5f\"), 5, new Guid(\"f97a94fd-98b1-44d1-a7d7-d6d8bf9b8695\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"c22e0192-af29-40e3-bb77-6681c31ff95a\"), 7, new Guid(\"4c57620b-af71-4e15-90dd-b5b92b1204f4\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"d88a85f8-6c6b-443e-8fe5-5a92cbdd8a6a\"), 7, new Guid(\"f97a94fd-98b1-44d1-a7d7-d6d8bf9b8695\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"1c54b51e-bd8e-4416-b544-7f2a34482914\"), 5, new Guid(\"15b5120a-b935-4f20-b5ae-718baf36a8f6\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"81c27fff-daef-4fcd-bf92-b45d9053d071\"), 7, new Guid(\"15b5120a-b935-4f20-b5ae-718baf36a8f6\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"90d870aa-9fd2-4579-a803-2b15e13ad583\"), 3, new Guid(\"dff4d4b7-095c-4be8-ac9b-8f1ff32e8556\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"e729ab74-5bc0-44a7-ab9f-c34130d93527\"), 5, new Guid(\"dff4d4b7-095c-4be8-ac9b-8f1ff32e8556\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"ffc31f09-0e8a-43f2-a50e-225bc9931485\"), 7, new Guid(\"dff4d4b7-095c-4be8-ac9b-8f1ff32e8556\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"c3efa27a-4a1c-452b-ae3f-a469a343fd83\"), 3, new Guid(\"b0b08931-a20b-4202-98b2-3748f3186e89\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"ed6b555b-7f00-4aba-a57e-15123e72feba\"), 5, new Guid(\"b0b08931-a20b-4202-98b2-3748f3186e89\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"8727437a-bf0d-4e73-b7fd-832e83b7fdbf\"), 7, new Guid(\"b0b08931-a20b-4202-98b2-3748f3186e89\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"878e9f41-7d72-464f-9051-edb654d49325\"), 3, new Guid(\"d35fcb6e-2809-41bd-b289-730304ddf85c\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"b7c4436b-984a-4bb0-b8c7-01db9d23ef12\"), 5, new Guid(\"d35fcb6e-2809-41bd-b289-730304ddf85c\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"e64448e6-459b-41c9-8bca-c2a02c45379d\"), 7, new Guid(\"d35fcb6e-2809-41bd-b289-730304ddf85c\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"3fc3cd92-7e30-4795-9520-8d7ae0dd7cba\"), 3, new Guid(\"15b5120a-b935-4f20-b5ae-718baf36a8f6\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"f7f11d15-942d-4af1-b262-ca62a12f03ef\"), 3, new Guid(\"cab12b1a-48fc-4d06-b1ea-13b125f50029\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"f968326f-c49a-4b98-bb6f-84b437dd9aab\"), 5, new Guid(\"4c57620b-af71-4e15-90dd-b5b92b1204f4\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"f7bfe451-fbc6-48fd-9409-2f69fb29f44c\"), 7, new Guid(\"54be9611-f993-427a-b6a9-ec370067f173\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"4d3439d2-60b7-4b61-9bd5-81589003e033\"), 7, new Guid(\"89bbd6cb-4e7d-411e-b6a9-8319fd8f5e2b\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"04bc21f0-37e1-44cd-a5bb-49cbbfcda8bd\"), 3, new Guid(\"2df9f3bd-9fca-40f9-ae19-5b12f9759b9f\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"3f06a9c6-63e3-44e2-8023-db5218b3c29c\"), 5, new Guid(\"2df9f3bd-9fca-40f9-ae19-5b12f9759b9f\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"8578de44-81a4-49f5-a522-15e234a91fa9\"), 7, new Guid(\"2df9f3bd-9fca-40f9-ae19-5b12f9759b9f\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"dc828120-3955-4456-a3d3-e699946fdeac\"), 3, new Guid(\"1443fca5-b517-4a75-a4cd-c07e8452a46a\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"45737c9d-ef13-4404-aa01-484434b83397\"), 5, new Guid(\"1443fca5-b517-4a75-a4cd-c07e8452a46a\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"69ef862b-425a-4885-a5a5-4e677c2a807a\"), 7, new Guid(\"1443fca5-b517-4a75-a4cd-c07e8452a46a\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"9a3bb820-f8c5-49f0-8ee4-29855e453ed0\"), 3, new Guid(\"d0bd1bfa-30db-4941-9578-15c7b51c1a06\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"96d0c655-6408-46c2-9606-49fade9d0cf7\"), 5, new Guid(\"d0bd1bfa-30db-4941-9578-15c7b51c1a06\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"90c602c8-a235-4997-b479-229e21ee9edf\"), 7, new Guid(\"d0bd1bfa-30db-4941-9578-15c7b51c1a06\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"a19302b2-1400-4e64-b8d0-703c3a897390\"), 3, new Guid(\"28be7546-2ec4-4380-b3a8-6fd5c7984dbd\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"1a5b76ca-7222-4d3d-afce-ce03b5099f4f\"), 3, new Guid(\"4c57620b-af71-4e15-90dd-b5b92b1204f4\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"ea6d1faf-c9d0-4543-a7e8-fe7d4ae15f89\"), 5, new Guid(\"28be7546-2ec4-4380-b3a8-6fd5c7984dbd\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"dae0c4f4-5cd3-48d2-a36d-4c40a8d7f5e7\"), 3, new Guid(\"5f8a4ab2-c558-4ab3-b471-f2cdf36fc5bb\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"314f6851-616b-45b5-9277-e852f7f09521\"), 5, new Guid(\"5f8a4ab2-c558-4ab3-b471-f2cdf36fc5bb\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"e81f87d7-5064-4a84-b120-a3926a894171\"), 7, new Guid(\"5f8a4ab2-c558-4ab3-b471-f2cdf36fc5bb\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"ac49dda5-1ac6-4140-8301-940dc80929f4\"), 3, new Guid(\"cba9735c-2c6f-458a-adff-14187a3daf27\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"f315fa8c-71d2-4396-85d3-d3b756eb8a0c\"), 5, new Guid(\"cba9735c-2c6f-458a-adff-14187a3daf27\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"3af71d8c-2913-49e3-9859-db8c43ea36fe\"), 7, new Guid(\"cba9735c-2c6f-458a-adff-14187a3daf27\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"ad35a5c3-6041-45e0-a5f4-5a7071d9a75b\"), 3, new Guid(\"e3f77547-42dc-469e-9b5d-36afcbbbc679\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"d08ce118-f0c9-4cd7-8757-0550b8aa5bb0\"), 5, new Guid(\"e3f77547-42dc-469e-9b5d-36afcbbbc679\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"a4057528-7fc8-4e28-9f3d-588b4c37f50f\"), 7, new Guid(\"e3f77547-42dc-469e-9b5d-36afcbbbc679\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"34d81e39-2ae0-4da0-9478-1e48da4787d7\"), 3, new Guid(\"54be9611-f993-427a-b6a9-ec370067f173\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"90b1b123-4bee-42f6-9d91-ebe83cbc373d\"), 5, new Guid(\"54be9611-f993-427a-b6a9-ec370067f173\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"118fb864-fca7-4b6c-b8e9-74fba24c3278\"), 7, new Guid(\"28be7546-2ec4-4380-b3a8-6fd5c7984dbd\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"4624be79-007a-41b6-ac2d-73fea2ecb104\"), 5, new Guid(\"89bbd6cb-4e7d-411e-b6a9-8319fd8f5e2b\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"bffcb7aa-cd5c-468d-9082-947b6be8ec81\"), 5, new Guid(\"cab12b1a-48fc-4d06-b1ea-13b125f50029\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"4765e9c4-278b-467a-b956-c65260993576\"), 3, new Guid(\"9809e0ac-ec91-47a3-9663-23ac5566ea15\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"1e4a01f1-d7a2-4b96-8881-7b18c7df0d4a\"), 7, new Guid(\"e53d54c9-7b73-4da2-ac93-33482981b7c5\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"c197b576-5b0b-4fa1-b80c-ad10d27d4b66\"), 3, new Guid(\"f0b7724e-184d-4ddf-8779-7f9f20196230\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"695d987c-e308-4511-904c-3d417d9b8065\"), 5, new Guid(\"f0b7724e-184d-4ddf-8779-7f9f20196230\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"3734357f-a620-408f-a9c3-9c81a594ce9c\"), 7, new Guid(\"f0b7724e-184d-4ddf-8779-7f9f20196230\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"6241c280-1206-4e33-97f9-b6bf5a5854a0\"), 3, new Guid(\"7d9868ae-f929-490d-865f-762b80c90d68\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"dd14e4ea-0663-4004-a8ac-0ad7d0dfe887\"), 5, new Guid(\"7d9868ae-f929-490d-865f-762b80c90d68\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"6d6c4ca8-8740-431a-8828-073ffec1608d\"), 7, new Guid(\"7d9868ae-f929-490d-865f-762b80c90d68\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"0bad3c27-ad8a-4cf9-bd3f-271a4e78aa50\"), 3, new Guid(\"11a3f1c6-bf8a-45ca-8309-ad1193efa42c\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"e85e580e-4adf-4516-9f24-1dfd5c902c20\"), 5, new Guid(\"11a3f1c6-bf8a-45ca-8309-ad1193efa42c\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"9b594d5b-37b1-4248-9e6e-e17a841bb04d\"), 7, new Guid(\"11a3f1c6-bf8a-45ca-8309-ad1193efa42c\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"862032c5-5ef9-4419-b028-01ba721eaa76\"), 3, new Guid(\"21f8961d-25d1-4542-aae7-55263446cfbb\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"76b2508f-7368-45dd-9997-6198155cfc2e\"), 5, new Guid(\"e53d54c9-7b73-4da2-ac93-33482981b7c5\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"38d8e114-35a8-4ac9-bae9-f6fe6e220e24\"), 5, new Guid(\"21f8961d-25d1-4542-aae7-55263446cfbb\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"834a75a1-91b3-4951-b13c-03b6313c1a52\"), 3, new Guid(\"cf6acfbb-843d-4fed-a64f-0b1870e029d3\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"1bdc1855-c045-4237-b7fc-96f8a8804db2\"), 5, new Guid(\"cf6acfbb-843d-4fed-a64f-0b1870e029d3\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"225176b8-18e8-4958-b451-d6a20f60c58a\"), 7, new Guid(\"cf6acfbb-843d-4fed-a64f-0b1870e029d3\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"7962a227-d7be-49b0-926f-c9fc2b450eb0\"), 3, new Guid(\"4d4c242d-362a-4d3a-8dfa-25f55c4ff26c\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"ed6df5b0-b21c-45fb-816b-08f003b2534f\"), 5, new Guid(\"4d4c242d-362a-4d3a-8dfa-25f55c4ff26c\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"324e48a2-1162-4fb0-a3ca-e1913212e89e\"), 7, new Guid(\"4d4c242d-362a-4d3a-8dfa-25f55c4ff26c\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"e2bca67f-2620-4779-b2c2-362c1ec5a7e9\"), 3, new Guid(\"3dd4f8fb-1593-42f1-8dea-f2136f7ae3fb\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"8e767895-ad04-49d1-931b-f502a8b21f5b\"), 5, new Guid(\"3dd4f8fb-1593-42f1-8dea-f2136f7ae3fb\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"c4ffba65-e667-41ce-a5b5-c64bc03a2ea6\"), 7, new Guid(\"3dd4f8fb-1593-42f1-8dea-f2136f7ae3fb\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"5a49f2e5-622a-4783-8c01-2307a4f3a070\"), 3, new Guid(\"32970c13-8e02-4899-aa5c-8498176ea8ae\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"dcb19cb2-532c-4b80-809c-978f1611324b\"), 5, new Guid(\"32970c13-8e02-4899-aa5c-8498176ea8ae\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"0bd04127-be2b-4fb2-a713-9d5854e0c9fb\"), 7, new Guid(\"21f8961d-25d1-4542-aae7-55263446cfbb\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"cfa1f0ff-0b0c-46b1-ac46-e7afd32e49fe\"), 7, new Guid(\"cab12b1a-48fc-4d06-b1ea-13b125f50029\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"1f1d19e8-7ec7-425b-9577-3d9984b1912e\"), 3, new Guid(\"e53d54c9-7b73-4da2-ac93-33482981b7c5\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"3e19600d-4ef0-45ae-8563-a45de03be9d4\"), 5, new Guid(\"34bc0e8c-b892-49f4-bf51-f2c5f615f18f\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"5cff1e71-a75a-4a39-ae7a-437c94801d5c\"), 5, new Guid(\"9809e0ac-ec91-47a3-9663-23ac5566ea15\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"81a6073e-7610-4adf-a09f-c2e49775474f\"), 7, new Guid(\"9809e0ac-ec91-47a3-9663-23ac5566ea15\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"40123693-53cf-4c60-8a86-ac97e24cd2e7\"), 3, new Guid(\"a77a53ea-822b-459c-9a30-0adcde7db3a2\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"747331fa-8ade-4f2c-83d8-cf61774e2984\"), 5, new Guid(\"a77a53ea-822b-459c-9a30-0adcde7db3a2\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"7718e1cd-8fc1-4abc-b06e-72fe4bf49330\"), 7, new Guid(\"a77a53ea-822b-459c-9a30-0adcde7db3a2\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"295ff3d7-2fbe-4f3a-b79e-5f3bc6de0c53\"), 3, new Guid(\"212e06d2-c263-4ec3-b146-cab6b9208053\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"c266183c-69d8-42a9-a43d-3e72c2c056b3\"), 5, new Guid(\"212e06d2-c263-4ec3-b146-cab6b9208053\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"2b91ce65-301e-4e42-85cd-070824672f51\"), 7, new Guid(\"212e06d2-c263-4ec3-b146-cab6b9208053\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"98b1ff5f-cb99-44ba-b254-7c6645bc91f2\"), 3, new Guid(\"713b15b9-eaf3-4be9-bca5-350a90ac8cf8\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"3d198cc9-b5d7-4316-869e-ef6ae9ee82d6\"), 5, new Guid(\"713b15b9-eaf3-4be9-bca5-350a90ac8cf8\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"722b5547-9b1f-4355-8680-83b581062740\"), 7, new Guid(\"713b15b9-eaf3-4be9-bca5-350a90ac8cf8\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"cd7725c9-9bb2-4c1e-818d-6f5979a80777\"), 7, new Guid(\"34bc0e8c-b892-49f4-bf51-f2c5f615f18f\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"5d03a453-80f5-4229-89f7-e0b8fd0251ce\"), 3, new Guid(\"8a74bdd8-ab10-42f0-a98e-7b1046ca046f\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"90cc59ad-d04e-43ac-beed-943030fc9855\"), 7, new Guid(\"8a74bdd8-ab10-42f0-a98e-7b1046ca046f\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"f3534dd0-56d8-461e-8ba5-a64ac242680f\"), 3, new Guid(\"9094d8b0-ca84-452f-8079-6fcc4b99d491\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"b473f43d-cf14-4a13-b9c8-43adccb29c36\"), 5, new Guid(\"9094d8b0-ca84-452f-8079-6fcc4b99d491\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"6697d01f-1c18-45d0-b179-b43ebf8bf6b6\"), 7, new Guid(\"9094d8b0-ca84-452f-8079-6fcc4b99d491\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"87fa1280-7a54-49f9-8064-243e0353c97a\"), 3, new Guid(\"56f42a94-8676-4f23-ae53-58295484f8df\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"7e33dcdf-af2e-4e2f-944e-2f73921203d5\"), 5, new Guid(\"56f42a94-8676-4f23-ae53-58295484f8df\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"72b1b2ae-d917-48e0-973e-3ac0f5d7b56e\"), 7, new Guid(\"56f42a94-8676-4f23-ae53-58295484f8df\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"16b437e8-8808-4345-84c5-22c4179419c8\"), 3, new Guid(\"8bdfd6ac-311a-4b43-9cdb-94a1d2125988\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"ee3b82b9-47c2-4d3d-b037-cbe0f88194f9\"), 5, new Guid(\"8bdfd6ac-311a-4b43-9cdb-94a1d2125988\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"3f372fa2-40c9-4d6f-ac96-eae039c37f43\"), 7, new Guid(\"8bdfd6ac-311a-4b43-9cdb-94a1d2125988\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"270d4992-96a0-419b-aa46-928dab43ca95\"), 3, new Guid(\"34bc0e8c-b892-49f4-bf51-f2c5f615f18f\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"e06379e5-e911-4af6-9c7b-28f2e0ad3ee9\"), 5, new Guid(\"8a74bdd8-ab10-42f0-a98e-7b1046ca046f\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"1084dd92-1226-42d0-9012-e4cc4b19014c\"), 3, new Guid(\"89bbd6cb-4e7d-411e-b6a9-8319fd8f5e2b\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"0d2591e2-5365-473d-b472-781f271bf950\"), 7, new Guid(\"28368802-fb18-4f9e-a472-0fffcefcdfae\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"e4b78553-be2b-4ba4-94d2-43f76bb74207\"), 5, new Guid(\"28368802-fb18-4f9e-a472-0fffcefcdfae\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"10b66f1b-1c64-451e-bbde-fa10126f3962\"), 5, new Guid(\"e501b293-b63e-401e-bd12-1e4712b76aae\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"e97c133e-b9d6-4d03-8435-969de27f8556\"), 7, new Guid(\"e501b293-b63e-401e-bd12-1e4712b76aae\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"ba65bcc6-a6c2-4292-a54a-cd5af249cdec\"), 3, new Guid(\"1c401f96-c8f6-4b84-a8bc-221f7ed9ed37\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"fe7d14c2-0fcb-4c91-9e2e-58ddb69c645e\"), 5, new Guid(\"1c401f96-c8f6-4b84-a8bc-221f7ed9ed37\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"9d0edcaa-6b4d-4b44-ad3d-044c8a83d7c2\"), 7, new Guid(\"1c401f96-c8f6-4b84-a8bc-221f7ed9ed37\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"c3d2b22e-fbd2-4aaa-b741-af1cd4a48efd\"), 3, new Guid(\"335f738e-7364-4059-9e84-312623f35083\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"bca72ca1-ad5f-4b85-a1a3-393cedc7db3e\"), 5, new Guid(\"335f738e-7364-4059-9e84-312623f35083\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"0d544446-5a22-48df-8fee-1bed1c865331\"), 7, new Guid(\"335f738e-7364-4059-9e84-312623f35083\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"fb92d227-21db-4400-87f5-44d34146f99e\"), 3, new Guid(\"51728e44-2a5c-493f-afdb-18a6c2128a69\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"cb930d56-9a73-44e5-beb4-bd011f087ba6\"), 5, new Guid(\"51728e44-2a5c-493f-afdb-18a6c2128a69\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"3a5f1a41-7dac-4e8a-ac81-6168ec8b6c07\"), 7, new Guid(\"51728e44-2a5c-493f-afdb-18a6c2128a69\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"70a4d235-8f10-4802-a3d3-980b8c4aceb4\"), 3, new Guid(\"e501b293-b63e-401e-bd12-1e4712b76aae\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"c53b0777-2a93-4bb5-8518-3e93d18bdc33\"), 3, new Guid(\"223813aa-3b47-4f1b-af2b-913547b81ce0\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"9479c016-787b-4708-b264-241549224432\"), 7, new Guid(\"223813aa-3b47-4f1b-af2b-913547b81ce0\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"d2fbae3d-6399-402f-adb2-492b0c0a9d08\"), 3, new Guid(\"0e4190b7-44e1-49f4-a7ba-41559b0fb3b9\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"2713e78b-d69f-4a22-bf62-9f2bc27fe463\"), 5, new Guid(\"0e4190b7-44e1-49f4-a7ba-41559b0fb3b9\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"99faebc9-54dc-4bcb-95ac-12bd455da930\"), 7, new Guid(\"0e4190b7-44e1-49f4-a7ba-41559b0fb3b9\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"35034306-edb0-4d5a-8c5d-69ba6f0af4d6\"), 3, new Guid(\"c35636a2-da70-4343-9377-5508485ebee0\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"db457dfb-8d1e-4484-81bb-7e8c4164c4ff\"), 5, new Guid(\"c35636a2-da70-4343-9377-5508485ebee0\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"4478e31a-e213-4e35-8027-a1422a0b787d\"), 7, new Guid(\"c35636a2-da70-4343-9377-5508485ebee0\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"84d466fb-cd47-49d2-8e88-11f24e62cfbf\"), 3, new Guid(\"082438e7-027b-446a-91a8-0ca0c008bd81\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"a836f078-f2fb-41a9-aa73-1f3bf79fc69a\"), 5, new Guid(\"082438e7-027b-446a-91a8-0ca0c008bd81\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"8650f499-bf3e-4156-ab0b-03b5d49c659d\"), 7, new Guid(\"082438e7-027b-446a-91a8-0ca0c008bd81\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"77d540cc-63f4-47f3-9e1c-05eeccf19f87\"), 3, new Guid(\"5da3dadd-f733-4c26-902b-f6895ba65e81\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"80ad1375-3bf8-4e92-8907-b87152af3988\"), 5, new Guid(\"223813aa-3b47-4f1b-af2b-913547b81ce0\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"7ccdc3d6-c435-4fba-97ec-c988591aaabc\"), 5, new Guid(\"5da3dadd-f733-4c26-902b-f6895ba65e81\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"8985e001-b97d-49ea-9a4b-de7201833080\"), 7, new Guid(\"917e7e76-82a8-4080-aac2-980f4e3eef18\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"f73d9dd9-addd-4916-8cd9-c3ae39216d63\"), 3, new Guid(\"917e7e76-82a8-4080-aac2-980f4e3eef18\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"358e4336-50e9-4011-b5e4-178e8a31ff2b\"), 3, new Guid(\"9061db0d-04f7-4956-a692-d5721030fe27\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"85a3fa71-2701-4516-88bb-b12d5af8756a\"), 5, new Guid(\"9061db0d-04f7-4956-a692-d5721030fe27\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"6f457e16-f40b-4694-9c81-bed3b90c90c9\"), 7, new Guid(\"9061db0d-04f7-4956-a692-d5721030fe27\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"4cbffed7-1961-47ef-bd34-154e6bd17e9f\"), 3, new Guid(\"5e4ef685-e63e-4ac5-8474-c412d5188785\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"e0bdbb2f-e97a-4a6e-8a23-b89f89e12f75\"), 5, new Guid(\"5e4ef685-e63e-4ac5-8474-c412d5188785\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"fdea64c4-9060-4686-a95c-15ece6a63e7c\"), 7, new Guid(\"5e4ef685-e63e-4ac5-8474-c412d5188785\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"9624544b-0aa8-49b4-b9b3-aa821da68d22\"), 3, new Guid(\"0612a7d1-e6c9-4508-b0a4-04895b91775c\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") }\n                });\n\n            migrationBuilder.InsertData(\n                table: \"StorageUnits\",\n                columns: new[] { \"Id\", \"Quantity\", \"ShelfId\", \"UnitId\" },\n                values: new object[,]\n                {\n                    { new Guid(\"4dc71f08-fe4b-4611-b78c-a7d7c71eaa78\"), 5, new Guid(\"0612a7d1-e6c9-4508-b0a4-04895b91775c\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"1d11c3c3-2c26-4a79-84f3-85695d90d272\"), 7, new Guid(\"0612a7d1-e6c9-4508-b0a4-04895b91775c\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"e73f35f0-5ec8-437f-8a7e-6b2c6657e777\"), 3, new Guid(\"4c3ea7dd-dce0-4e1a-858e-a1e2cfda654f\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"c532e7a2-1f8a-4534-ae56-062dcb9342d0\"), 5, new Guid(\"4c3ea7dd-dce0-4e1a-858e-a1e2cfda654f\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"f82838f0-d2b4-4d12-83a3-9cf52fdc100e\"), 5, new Guid(\"917e7e76-82a8-4080-aac2-980f4e3eef18\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"c4d912dc-1982-45ac-8151-855c42156134\"), 7, new Guid(\"4c3ea7dd-dce0-4e1a-858e-a1e2cfda654f\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"9aae7f13-abf3-4540-857e-6b5a6dd7396f\"), 5, new Guid(\"a3e7f99d-11cb-4896-8ff5-84716e01feab\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"ca06ec71-9a7d-415b-a995-b6069b451601\"), 7, new Guid(\"a3e7f99d-11cb-4896-8ff5-84716e01feab\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"1b4baebd-2f54-4ecf-be6e-8ea5fb5edc61\"), 3, new Guid(\"2ce346f0-113c-49b9-82e6-aea800a8dd56\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"8f7f9421-259b-4a3f-a4e9-0c8f532a700c\"), 5, new Guid(\"2ce346f0-113c-49b9-82e6-aea800a8dd56\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"cf7e47bb-d3f8-4039-b280-d00bcf2036a6\"), 7, new Guid(\"2ce346f0-113c-49b9-82e6-aea800a8dd56\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"7c89ae0a-8580-4a18-9b1b-88ee7cef4ff2\"), 3, new Guid(\"b4f30fd4-c14d-4577-a6df-1b492fd15443\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"3ec65045-b5bd-44fa-a34a-3101c6455165\"), 5, new Guid(\"b4f30fd4-c14d-4577-a6df-1b492fd15443\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"9a9b4a13-4475-432c-95ca-036de9bd725c\"), 7, new Guid(\"b4f30fd4-c14d-4577-a6df-1b492fd15443\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"3b0786e9-809c-4fe6-a0a8-b37e7108dc40\"), 3, new Guid(\"414b6a72-35e4-4781-ba34-f0e72b776a51\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"c24668b1-5a03-4811-abfa-684671c46a4d\"), 5, new Guid(\"414b6a72-35e4-4781-ba34-f0e72b776a51\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"a4189b73-4a3a-4929-9a0b-4945f721aceb\"), 7, new Guid(\"414b6a72-35e4-4781-ba34-f0e72b776a51\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"0a94cf05-4cea-407e-b3c7-3a1720c7a0f9\"), 3, new Guid(\"a3e7f99d-11cb-4896-8ff5-84716e01feab\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"bb695581-fcdc-4391-85a1-68fdadeef467\"), 7, new Guid(\"5da3dadd-f733-4c26-902b-f6895ba65e81\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"249e7993-ebf1-4176-923d-e66301edef59\"), 3, new Guid(\"5a77ae2a-8ce5-4411-8494-63fcade7fd87\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"9d709eb8-e56b-4797-9d5d-a35a20db2dc4\"), 5, new Guid(\"5a77ae2a-8ce5-4411-8494-63fcade7fd87\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"0c574018-4e75-4254-b9ac-921560a77d6b\"), 5, new Guid(\"dae38c4f-c4cb-4a67-9e21-94d861c8afff\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"ea7f0814-2f2c-4dbf-be9b-67b1e9d13fc1\"), 7, new Guid(\"dae38c4f-c4cb-4a67-9e21-94d861c8afff\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"190bd87a-bd7d-45d4-89b2-a84dfeaac19f\"), 3, new Guid(\"11d0531e-a270-4462-85f2-6ea5e5c80c6c\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"95aca2f1-294c-4296-b89f-48fb11bb754f\"), 5, new Guid(\"11d0531e-a270-4462-85f2-6ea5e5c80c6c\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"795d1e71-4402-4a22-a027-9b2598a157a4\"), 7, new Guid(\"11d0531e-a270-4462-85f2-6ea5e5c80c6c\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"d9ed690d-13ba-41a5-8b3d-7dd8cef900fc\"), 3, new Guid(\"8a76164d-a7b9-428f-87f7-65833464d6f6\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"2d025f21-ce6c-4a1d-bb64-28d36bdb8092\"), 5, new Guid(\"8a76164d-a7b9-428f-87f7-65833464d6f6\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"ea3cb8fd-48a9-4dec-9cf6-ca68ae2c1cdf\"), 7, new Guid(\"8a76164d-a7b9-428f-87f7-65833464d6f6\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"856490f4-692d-4950-86fd-d14ececd625e\"), 3, new Guid(\"dea69d81-1297-4323-b382-b2866c929a2c\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"634e150f-585c-4196-b58c-5357b62b7ae8\"), 5, new Guid(\"dea69d81-1297-4323-b382-b2866c929a2c\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"b6e853fd-9785-47a2-bd55-ff41e7155f6f\"), 7, new Guid(\"dea69d81-1297-4323-b382-b2866c929a2c\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"c020f46c-8c95-406d-9c5b-748957527c20\"), 3, new Guid(\"dae38c4f-c4cb-4a67-9e21-94d861c8afff\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"4fc8921c-5ed4-45d6-9ede-f3cf429aa33d\"), 3, new Guid(\"a874f96f-2fbb-40ff-8eba-65a21bd39238\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"0e229c9a-d185-44bb-8939-b9a5a7b37737\"), 7, new Guid(\"a874f96f-2fbb-40ff-8eba-65a21bd39238\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"5b6add23-4e5e-405b-bd56-3ce88349125f\"), 3, new Guid(\"68268317-da8e-435e-8f06-448f80880b34\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"02817f65-c1fc-4193-b2d0-ddba0f5b7144\"), 5, new Guid(\"68268317-da8e-435e-8f06-448f80880b34\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"3f0145d9-3dda-4c12-a55f-2f232ad4cd22\"), 7, new Guid(\"68268317-da8e-435e-8f06-448f80880b34\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"bdae6f99-5bdb-427a-af46-3c3e56aa185f\"), 3, new Guid(\"61ce7880-2198-4f2e-8f82-123e2a18818f\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"de35ef72-208d-49f3-b3f0-daf901455ca7\"), 5, new Guid(\"61ce7880-2198-4f2e-8f82-123e2a18818f\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"609e799f-0712-4ec3-929a-a740cae31738\"), 7, new Guid(\"61ce7880-2198-4f2e-8f82-123e2a18818f\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"97e6cb10-409d-4d47-b89e-ea6712cfc318\"), 3, new Guid(\"e2e8b9b8-50d3-4673-bce7-fbf0c9601df1\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"056c19a1-8387-40d8-bc06-1ff43f0f1825\"), 5, new Guid(\"e2e8b9b8-50d3-4673-bce7-fbf0c9601df1\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"1b08f65c-30b9-429a-a3ce-914bfeb8860b\"), 7, new Guid(\"e2e8b9b8-50d3-4673-bce7-fbf0c9601df1\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"8ea9ce2b-a754-4a1a-a703-319b36e0a7de\"), 3, new Guid(\"28368802-fb18-4f9e-a472-0fffcefcdfae\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"46721565-ab94-4153-b4cd-9cbe3b758324\"), 5, new Guid(\"a874f96f-2fbb-40ff-8eba-65a21bd39238\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"4e65088f-812c-4a3c-8302-bd4ec80c4322\"), 7, new Guid(\"d126d83e-252d-4c88-8754-aad5049b3ef3\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"0bc0f8b3-faba-4c99-82fc-7eedb35bcfd1\"), 5, new Guid(\"d126d83e-252d-4c88-8754-aad5049b3ef3\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"2eaa5ad1-8d54-43b6-9aa6-1ef0e880bd0e\"), 3, new Guid(\"d126d83e-252d-4c88-8754-aad5049b3ef3\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"2292c831-f099-4690-82f4-85d7b116dbb5\"), 7, new Guid(\"5a77ae2a-8ce5-4411-8494-63fcade7fd87\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"e66bae7a-f254-4d16-a473-3dc405f8da82\"), 3, new Guid(\"b1a37338-e6df-429b-b186-bc1bc215cffe\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"b8ddb954-6da7-4129-89c7-3e280cacf702\"), 5, new Guid(\"b1a37338-e6df-429b-b186-bc1bc215cffe\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"deafc535-7e40-4497-aff1-a4bb40262429\"), 7, new Guid(\"b1a37338-e6df-429b-b186-bc1bc215cffe\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"b93ea328-5521-48f1-9419-dc66de275014\"), 3, new Guid(\"deb8d789-ba0f-453e-98ca-0bb60dc1c080\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"18213dfc-622b-438c-9f05-ac8571529987\"), 5, new Guid(\"deb8d789-ba0f-453e-98ca-0bb60dc1c080\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"7942c1af-816b-420d-bd9d-87068d800a4d\"), 7, new Guid(\"deb8d789-ba0f-453e-98ca-0bb60dc1c080\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"3a61a83f-c023-4660-a63c-6a9f9ed725fe\"), 3, new Guid(\"4bded4e9-131e-4475-9af4-5832bb8b1cec\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"0cfc13da-8927-40e9-8610-46eaa1db11b3\"), 5, new Guid(\"4bded4e9-131e-4475-9af4-5832bb8b1cec\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"ecd98249-0450-4f50-aed8-b8434959d2cd\"), 7, new Guid(\"4bded4e9-131e-4475-9af4-5832bb8b1cec\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"73bee781-53f3-4951-9b6e-891c1fcfdc89\"), 3, new Guid(\"2f7ab388-28f3-40b8-9b74-d299f44d0c62\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"8cfbf411-e967-4b93-974b-606547976efb\"), 5, new Guid(\"2f7ab388-28f3-40b8-9b74-d299f44d0c62\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"764e222b-6905-47c1-83f9-874842e042a9\"), 7, new Guid(\"2f7ab388-28f3-40b8-9b74-d299f44d0c62\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"ebb1e3f3-bb5f-41a2-98b7-5ce03711918f\"), 3, new Guid(\"8760816e-dc6d-4b9c-a6bd-e4f1d47e03bd\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"6984d15d-2a0a-4393-85e5-904f365c8e2f\"), 5, new Guid(\"8760816e-dc6d-4b9c-a6bd-e4f1d47e03bd\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"3388e083-e404-4e38-81c1-1a5cec3437aa\"), 7, new Guid(\"8760816e-dc6d-4b9c-a6bd-e4f1d47e03bd\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"854b7b19-fbd1-4d8d-a880-54f045c3606d\"), 3, new Guid(\"88b79e1f-8bf4-4d88-9830-670c594e09a6\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"2482ad13-2c50-4f46-87ba-2f3f130097f6\"), 5, new Guid(\"88b79e1f-8bf4-4d88-9830-670c594e09a6\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"7fc18ca2-3a94-4720-b40f-aa632186ca0e\"), 7, new Guid(\"88b79e1f-8bf4-4d88-9830-670c594e09a6\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"2379137f-ab75-4972-8952-deced041ed78\"), 3, new Guid(\"6118cc85-5d50-4cb2-8f81-874a8f286ec1\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"de06bf0c-090c-449c-affb-38cfd1f4a55b\"), 5, new Guid(\"6118cc85-5d50-4cb2-8f81-874a8f286ec1\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"01f3d7d1-9201-4ed5-8b7e-94f5c65e2117\"), 7, new Guid(\"6118cc85-5d50-4cb2-8f81-874a8f286ec1\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"8ae689c8-1d4c-4481-a2d7-a1a6cb1d3734\"), 3, new Guid(\"e5b7250d-d636-40e6-9068-acf35d72bd68\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"c84e6a93-b0d8-41c9-9f35-c16e6b2c2f95\"), 5, new Guid(\"e5b7250d-d636-40e6-9068-acf35d72bd68\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"dac9c3d1-38f9-4f22-a97b-4485ed3e20d9\"), 7, new Guid(\"e5b7250d-d636-40e6-9068-acf35d72bd68\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"1bbff5e3-6f90-4053-9ef2-fa073481d971\"), 7, new Guid(\"32970c13-8e02-4899-aa5c-8498176ea8ae\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"fd92150c-27d3-47cb-b5a1-89d40f166166\"), 7, new Guid(\"c277d89d-8c37-4e12-b020-86f99f8d72cc\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"d73885c6-eb6e-464a-89a2-906fa6b48a39\"), 3, new Guid(\"906f9a41-cd17-4507-93aa-c4fd96e48047\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"b760e9f5-3bb8-4952-b95d-5bb9b1f287eb\"), 7, new Guid(\"906f9a41-cd17-4507-93aa-c4fd96e48047\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"38cd7cb9-c393-4d7e-9f83-d0bcd3dbc34b\"), 3, new Guid(\"f0774a0d-8b20-44c3-a193-e2f7ea03e2d6\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"c4e64f2e-b4ce-4e9e-944e-b609ba65b1e0\"), 5, new Guid(\"f0774a0d-8b20-44c3-a193-e2f7ea03e2d6\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"11ad23d6-2cd0-4224-81a2-75219ceac10a\"), 7, new Guid(\"f0774a0d-8b20-44c3-a193-e2f7ea03e2d6\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"166cd518-3a01-423f-807e-5b3f954e29a6\"), 3, new Guid(\"73d7add4-418c-41e7-81b2-7234c405bac2\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"b804880c-1a3e-48a9-b0e9-3b3b28cffc56\"), 5, new Guid(\"73d7add4-418c-41e7-81b2-7234c405bac2\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"b452cfac-7da6-405b-8eb9-7c3292bccf43\"), 7, new Guid(\"73d7add4-418c-41e7-81b2-7234c405bac2\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"cb8406f0-dc37-451f-8bcf-203ecc48877b\"), 3, new Guid(\"949dcee5-83f3-469e-a4b3-bb9117cdb07a\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"dd854bfc-c06d-41d2-a2a0-2a65edfb5c66\"), 5, new Guid(\"949dcee5-83f3-469e-a4b3-bb9117cdb07a\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"eaa6788b-eabc-4d0b-b0f1-cc8e91f7bb05\"), 7, new Guid(\"949dcee5-83f3-469e-a4b3-bb9117cdb07a\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"8eada393-9c76-4a73-88cc-8a3731b0006c\"), 3, new Guid(\"71caa39b-4c7e-4433-87c3-cb98a0c6ec9c\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"8a860e3c-78c6-40be-a29d-cf1ec1c5af69\"), 5, new Guid(\"71caa39b-4c7e-4433-87c3-cb98a0c6ec9c\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"9ecf96f8-999a-472d-8fe0-8886c7cb6816\"), 7, new Guid(\"2ce3efc4-3fb5-45df-b663-3416cbaeffe6\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"70302b1b-87a4-4d3c-905a-8e2d5036dc9a\"), 7, new Guid(\"71caa39b-4c7e-4433-87c3-cb98a0c6ec9c\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"e7cc3b84-0b9b-454c-9c48-a099f14e7815\"), 5, new Guid(\"ec2859f3-d1cf-4286-9751-aebb134b25aa\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"ecdfeb65-52d1-4f4f-83af-84cca66b737a\"), 7, new Guid(\"ec2859f3-d1cf-4286-9751-aebb134b25aa\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"7ba91772-627d-429f-983f-49e15eb5144b\"), 3, new Guid(\"83a43c67-bba9-482a-a8d3-c80247739799\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"eb773d43-4991-4539-9f62-daf6f6b884ce\"), 5, new Guid(\"83a43c67-bba9-482a-a8d3-c80247739799\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"2045b3c4-5d7a-4ea9-af98-8270ae0950f3\"), 7, new Guid(\"83a43c67-bba9-482a-a8d3-c80247739799\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"7f7c3a07-84fb-4dcb-ab43-b65187da3128\"), 3, new Guid(\"fa3ed3bc-569f-4676-96a5-849bf471588b\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"ccc1b255-4ccb-458f-80d5-d10378e08955\"), 5, new Guid(\"fa3ed3bc-569f-4676-96a5-849bf471588b\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"ea446718-456b-4f59-9eea-6a9933bed9c9\"), 7, new Guid(\"fa3ed3bc-569f-4676-96a5-849bf471588b\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"13c8035d-408c-4380-9b1e-06f201636e4a\"), 3, new Guid(\"514694d5-24b4-41a7-a92e-b982e0668b8b\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"79d7d83b-fc77-4f88-98e1-f33a08afa300\"), 5, new Guid(\"514694d5-24b4-41a7-a92e-b982e0668b8b\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"f56f4800-1fe0-418b-b427-1cfdee908e0b\"), 7, new Guid(\"514694d5-24b4-41a7-a92e-b982e0668b8b\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"fdb6449b-38a5-415b-8d7f-7f41736aac89\"), 3, new Guid(\"ec2859f3-d1cf-4286-9751-aebb134b25aa\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"b8f799dc-ae99-4af7-8918-f94822d19c80\"), 3, new Guid(\"fec819c8-d1e2-4ad0-866b-df76ccd3302b\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"bb65679d-42a5-4759-8c1a-8db7b29dae05\"), 5, new Guid(\"2ce3efc4-3fb5-45df-b663-3416cbaeffe6\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"76e2dccc-200f-4efe-9797-d204fc27c61b\"), 7, new Guid(\"9184e9e6-d867-4256-a844-24bdf0d06575\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"5aaaa836-c613-4563-a754-37f63b9f5a0a\"), 7, new Guid(\"99c2458d-33e7-43ee-bf49-a3558b34e5b7\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"26afaec9-8e96-49a3-ba22-b48162421a4f\"), 3, new Guid(\"17be0d81-98f2-4bb4-a2b9-e6f1867836f2\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"6c526994-9378-45a9-900c-23bfcf81cd58\"), 5, new Guid(\"17be0d81-98f2-4bb4-a2b9-e6f1867836f2\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"5d5b7e6b-7d84-4c32-a533-b00018dd7f77\"), 7, new Guid(\"17be0d81-98f2-4bb4-a2b9-e6f1867836f2\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"3f9e4ba5-5222-4a10-9a15-1ad61bd35213\"), 3, new Guid(\"212003f2-2d1f-4131-80d2-f9406a6f6c90\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"2edeeccf-e147-4bb2-ad2a-4c6a15c7da92\"), 5, new Guid(\"212003f2-2d1f-4131-80d2-f9406a6f6c90\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"465c7d26-6f14-44b0-aea8-cf0dbe0efbfb\"), 7, new Guid(\"212003f2-2d1f-4131-80d2-f9406a6f6c90\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"7e6e92ca-efb8-453a-9aa4-b37ac991a3aa\"), 3, new Guid(\"d4b64d33-97f7-44a5-9bc5-d7560b6ce1e7\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"9bfafad0-7e12-4a1c-831d-702069066007\"), 5, new Guid(\"d4b64d33-97f7-44a5-9bc5-d7560b6ce1e7\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"71cbe7df-45eb-4a0d-9a89-65646273a840\"), 7, new Guid(\"d4b64d33-97f7-44a5-9bc5-d7560b6ce1e7\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"c048e3a9-8b36-4cfe-8a71-4a7b6e0f6373\"), 3, new Guid(\"46918cfd-56a0-4ce8-809b-84a1c2f0ffb0\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"cd31d93f-b7e6-4ea0-9184-33e9ebec4d0c\"), 3, new Guid(\"2ce3efc4-3fb5-45df-b663-3416cbaeffe6\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"a85a62df-7104-4e72-9f8a-333d86e5c0d7\"), 5, new Guid(\"46918cfd-56a0-4ce8-809b-84a1c2f0ffb0\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"5a4c6738-9804-4ba3-acfd-4697eb2b9887\"), 3, new Guid(\"51f16649-d40e-45e8-83e9-9f909e1389ac\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"53d4295e-136e-4821-9fe7-4f593d180110\"), 5, new Guid(\"51f16649-d40e-45e8-83e9-9f909e1389ac\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"4462f39e-d633-4259-a997-33ee827b2dc1\"), 7, new Guid(\"51f16649-d40e-45e8-83e9-9f909e1389ac\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"32594467-7851-4f30-83fe-91cc8c47a991\"), 3, new Guid(\"d148c7b5-e5a9-4945-8dc0-f39d6e0a0a5b\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"61e3e9e4-140b-4cd1-bbad-67b673d10533\"), 5, new Guid(\"d148c7b5-e5a9-4945-8dc0-f39d6e0a0a5b\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"f68d6de2-a57e-4432-a370-143d65da1d16\"), 7, new Guid(\"d148c7b5-e5a9-4945-8dc0-f39d6e0a0a5b\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"4353281d-2a03-4edd-b214-ee9681bd50d0\"), 3, new Guid(\"b490133d-4f22-4b47-b7ac-3e270f30d961\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"aae78818-0c6d-4267-9aa8-bdc39865b2b6\"), 5, new Guid(\"b490133d-4f22-4b47-b7ac-3e270f30d961\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"186e6b9b-9465-4ec0-b059-5f0b90644d56\"), 7, new Guid(\"b490133d-4f22-4b47-b7ac-3e270f30d961\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"67ff6995-2a48-4c23-a7e5-3d4bdab146e6\"), 3, new Guid(\"9184e9e6-d867-4256-a844-24bdf0d06575\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"dd692f4c-5f0e-4876-91a8-1f1a115f590c\"), 5, new Guid(\"9184e9e6-d867-4256-a844-24bdf0d06575\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"32cd1048-bf80-43e0-99a6-590aa129286c\"), 7, new Guid(\"46918cfd-56a0-4ce8-809b-84a1c2f0ffb0\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"2160da50-e606-4848-b0bb-94bfefab08c3\"), 5, new Guid(\"99c2458d-33e7-43ee-bf49-a3558b34e5b7\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"ef91c63b-6d4f-4428-8b8e-72749dc1d236\"), 5, new Guid(\"fec819c8-d1e2-4ad0-866b-df76ccd3302b\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"b03c002f-955f-42d5-ba6f-1561f94a2bc5\"), 3, new Guid(\"bdbfaa8c-5bc8-4f16-b840-8b242bf13ba7\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"57179991-14f7-443a-aa82-cd5527924159\"), 7, new Guid(\"22c022fe-14e7-4e54-b12c-3d4f5fa99216\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"1fe3ab35-20f9-4170-aa49-16224261e583\"), 3, new Guid(\"b8bed9c7-034e-4dc7-a97b-53d6588a5366\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"6dbcb6fe-1938-45fc-9f68-6ee4a637012d\"), 5, new Guid(\"b8bed9c7-034e-4dc7-a97b-53d6588a5366\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"449bbfba-5fc2-4e70-9692-481b7869d00d\"), 7, new Guid(\"b8bed9c7-034e-4dc7-a97b-53d6588a5366\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"40a113c5-78b5-4918-b9ae-0eecc9678c28\"), 3, new Guid(\"2184b7c7-0cb1-4b2c-89e4-16143ed629d1\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"e9e4f294-cf94-4e75-906a-944c0c03f284\"), 5, new Guid(\"2184b7c7-0cb1-4b2c-89e4-16143ed629d1\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"54ea6d40-522d-4de8-90d6-7193a614acf2\"), 7, new Guid(\"2184b7c7-0cb1-4b2c-89e4-16143ed629d1\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"5390ee83-12a3-4a23-914a-f294cf367c7f\"), 3, new Guid(\"9552d6d5-06f8-40c4-9ace-bdd298bb8643\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"ff18235d-dedd-4af3-90b2-1b3e38c35cbb\"), 5, new Guid(\"9552d6d5-06f8-40c4-9ace-bdd298bb8643\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"270f128e-c808-4b7e-aef9-9e6dfd4178ef\"), 7, new Guid(\"9552d6d5-06f8-40c4-9ace-bdd298bb8643\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"28f9495b-af1f-4f3f-bb51-d4600a83a955\"), 3, new Guid(\"ea2a22c2-8c89-40b7-8806-1f11964f102e\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"45cb9057-a2d0-4581-9e93-d3556d69d6a9\"), 5, new Guid(\"22c022fe-14e7-4e54-b12c-3d4f5fa99216\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"cf721cba-b1c9-4104-8231-9d22ea9ba809\"), 5, new Guid(\"ea2a22c2-8c89-40b7-8806-1f11964f102e\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"4ced0c92-12a1-4c2f-b247-c69c178dec98\"), 3, new Guid(\"b910abc4-302a-4603-bcb6-31662a35a53b\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"633a6ba1-6606-45a9-90e0-3bed3492749b\"), 5, new Guid(\"b910abc4-302a-4603-bcb6-31662a35a53b\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"c37caa40-35bf-4a7e-bfa2-feb86e2854ed\"), 7, new Guid(\"b910abc4-302a-4603-bcb6-31662a35a53b\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"2a1909c2-ee5e-434b-be53-7ec8e7013bec\"), 3, new Guid(\"b9b7e859-a988-4d14-a233-9bc853203336\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"ab836647-7430-4f05-a5d8-c9dcc2c0950e\"), 5, new Guid(\"b9b7e859-a988-4d14-a233-9bc853203336\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"e943efcd-4d36-4f89-bb47-f8a9c4a7642e\"), 7, new Guid(\"b9b7e859-a988-4d14-a233-9bc853203336\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"0e69da76-59ca-480b-bc35-58f8c12cf206\"), 3, new Guid(\"b16e786f-9c0e-4389-9702-778135955f06\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"215f44d9-28ce-4f3e-ab41-85a03466b274\"), 5, new Guid(\"b16e786f-9c0e-4389-9702-778135955f06\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"49fa5cea-86ca-4c55-b096-02c6b71a3ea0\"), 7, new Guid(\"b16e786f-9c0e-4389-9702-778135955f06\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"1dcdace1-7a87-4620-a91c-8b3e78cc0fee\"), 3, new Guid(\"96a459d8-34db-4ed4-b6f4-452689b100b2\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"63f15ad5-c17a-47fa-b9f9-1af9338758d8\"), 5, new Guid(\"96a459d8-34db-4ed4-b6f4-452689b100b2\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"9d0bf89f-3351-4128-af61-12dee303eb6c\"), 7, new Guid(\"ea2a22c2-8c89-40b7-8806-1f11964f102e\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"7d6d3301-28ec-4d17-b729-119b2ed2f280\"), 7, new Guid(\"fec819c8-d1e2-4ad0-866b-df76ccd3302b\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"de01099f-8dda-4e07-b224-684062de29cc\"), 3, new Guid(\"22c022fe-14e7-4e54-b12c-3d4f5fa99216\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"3aea556d-fd1f-412f-be50-933a9ec7a338\"), 5, new Guid(\"2880b432-0a24-4a57-8911-005fb57b843b\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"043fea0d-2033-42a6-aa28-487ad0ae0844\"), 5, new Guid(\"bdbfaa8c-5bc8-4f16-b840-8b242bf13ba7\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"2a88d5bd-99e9-4685-a8a7-8bdde663ec3e\"), 7, new Guid(\"bdbfaa8c-5bc8-4f16-b840-8b242bf13ba7\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"93135e15-a33a-47ee-b64e-edfdfd814424\"), 3, new Guid(\"706b585c-a76c-4c34-97c8-11820e60ae04\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"ebd33fa5-e9b4-4f4d-aeef-c7fd94111256\"), 5, new Guid(\"706b585c-a76c-4c34-97c8-11820e60ae04\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"fc681963-baf7-410c-a59e-05a87440674f\"), 7, new Guid(\"706b585c-a76c-4c34-97c8-11820e60ae04\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"9e217215-e162-4363-88ed-05ee457d43e5\"), 3, new Guid(\"1f30b9e9-6f1f-4837-ba7f-9d04b8ec58cd\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"a62797ee-f02d-40de-aaf0-be4523cf23d9\"), 5, new Guid(\"1f30b9e9-6f1f-4837-ba7f-9d04b8ec58cd\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"02edc632-30cd-48e6-a7fe-98c75a854105\"), 7, new Guid(\"1f30b9e9-6f1f-4837-ba7f-9d04b8ec58cd\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"588a39b1-90bb-46b2-be86-54fb172827f5\"), 3, new Guid(\"9049ed37-fb31-4d4e-b7cd-63712eb532c4\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"dce61336-eee1-4360-98ff-ce9eb21b0397\"), 5, new Guid(\"9049ed37-fb31-4d4e-b7cd-63712eb532c4\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"15c99dcd-7c95-41fe-be88-c05d07925741\"), 7, new Guid(\"9049ed37-fb31-4d4e-b7cd-63712eb532c4\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"8a6a1e48-9324-4a5b-a5d4-3718b5a15ebd\"), 7, new Guid(\"2880b432-0a24-4a57-8911-005fb57b843b\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"4b7b5937-bec0-4f4a-ad0b-6d24d78c04a2\"), 3, new Guid(\"b4230186-bf98-443b-b11d-d83e675c03f2\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"baa64fca-1158-48ec-9177-68af11c0658b\"), 7, new Guid(\"b4230186-bf98-443b-b11d-d83e675c03f2\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"570265ff-1286-4299-aea6-7b67a529e939\"), 3, new Guid(\"e75597cb-f6b4-4078-81a4-e428961b0535\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"3231eda1-022f-4db6-991d-4df5f919de56\"), 5, new Guid(\"e75597cb-f6b4-4078-81a4-e428961b0535\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"b03c0335-81ab-469d-b9f9-900e2f88b454\"), 7, new Guid(\"e75597cb-f6b4-4078-81a4-e428961b0535\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"89c72889-6f99-4a74-8308-90e240bd3bd2\"), 3, new Guid(\"afe8b4c4-6922-4656-8893-b4e0c16d8d6e\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"229b12fc-65b3-4a45-8f18-45ec471e414d\"), 5, new Guid(\"afe8b4c4-6922-4656-8893-b4e0c16d8d6e\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"3e75476f-4de0-4570-8b60-f7106d1a4b84\"), 7, new Guid(\"afe8b4c4-6922-4656-8893-b4e0c16d8d6e\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"1a4b8df4-4381-439b-b1ef-4cfec0f8be68\"), 3, new Guid(\"09eb06ed-d18e-4470-9a23-4acc6b99f309\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"42d1bcd2-8680-450e-bd26-ce9972217d71\"), 5, new Guid(\"09eb06ed-d18e-4470-9a23-4acc6b99f309\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"79b74f45-bd3e-43c6-97b0-a094b8ab240f\"), 7, new Guid(\"09eb06ed-d18e-4470-9a23-4acc6b99f309\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"b01a51be-083a-4ef1-bb56-82a8d59919e5\"), 3, new Guid(\"2880b432-0a24-4a57-8911-005fb57b843b\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"ce4a8804-2b24-408e-af7c-b95198951bed\"), 5, new Guid(\"b4230186-bf98-443b-b11d-d83e675c03f2\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"6e60a99f-e10b-4205-b780-4d09be556331\"), 3, new Guid(\"99c2458d-33e7-43ee-bf49-a3558b34e5b7\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"b5051126-b98a-48c0-983c-46abb6b4128f\"), 7, new Guid(\"d79c6c4d-635f-4e41-8c0e-c9b2acd069cd\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"6cae5ad8-e6dc-4209-99ee-c632a4078ea5\"), 5, new Guid(\"d79c6c4d-635f-4e41-8c0e-c9b2acd069cd\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"5f8949bd-799d-41f5-91df-ee14b261814f\"), 5, new Guid(\"e479f9df-ef6f-48ad-af3f-61700fa355cd\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"a0a2a90b-17ce-4bfa-a8c9-f2ca12ef0019\"), 7, new Guid(\"e479f9df-ef6f-48ad-af3f-61700fa355cd\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"7e8df93c-bb07-47e2-a972-3d9c4e330f18\"), 3, new Guid(\"a016bbcd-4a83-41e9-a011-694de705bf77\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"89e91944-3c76-440b-a035-5ccc4675bc38\"), 5, new Guid(\"a016bbcd-4a83-41e9-a011-694de705bf77\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"33130a24-dd62-4df3-88fe-533b8c4db229\"), 7, new Guid(\"a016bbcd-4a83-41e9-a011-694de705bf77\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"46bb1c11-94c2-400e-910e-d4b8986fc8e7\"), 3, new Guid(\"e06f5265-deda-40d6-8daf-7d4735c8013d\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"a39874bc-33e4-4ec1-b493-a849e4cfd7d7\"), 5, new Guid(\"e06f5265-deda-40d6-8daf-7d4735c8013d\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"43b8e8c3-5902-481c-b575-a9630372c132\"), 7, new Guid(\"e06f5265-deda-40d6-8daf-7d4735c8013d\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"8d41c93b-cbbd-46b0-b619-6c510807ae2c\"), 3, new Guid(\"1c35570b-4269-46bc-80ee-531b79708c71\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"0fb71e7c-d617-4abf-970a-af05abbcd9ca\"), 5, new Guid(\"1c35570b-4269-46bc-80ee-531b79708c71\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"610a80f5-f2ce-4e32-9c62-5d0b491d1f60\"), 7, new Guid(\"1c35570b-4269-46bc-80ee-531b79708c71\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"ebe6f8ae-d6e4-452a-bb82-827e2e4cb367\"), 3, new Guid(\"e479f9df-ef6f-48ad-af3f-61700fa355cd\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"26ec8ee5-c3ec-409c-89f2-be3c74439e70\"), 3, new Guid(\"b1651749-1d03-4fb7-b65e-4030cbb8d8cb\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"d9fd25e0-c11d-48ad-88ca-0146df667fc9\"), 7, new Guid(\"b1651749-1d03-4fb7-b65e-4030cbb8d8cb\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"6d9f1109-f9b7-497b-bd46-714d70493739\"), 3, new Guid(\"930e8338-4863-44b7-b5b5-3fd47c70185f\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"ddc3e2f0-89fd-426c-8063-9bdb20b3a3b3\"), 5, new Guid(\"930e8338-4863-44b7-b5b5-3fd47c70185f\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"b991c416-d045-43f5-8e45-059fbee4c98e\"), 7, new Guid(\"930e8338-4863-44b7-b5b5-3fd47c70185f\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"b1e1969a-a8f0-415b-b9b8-5b6048ff4119\"), 3, new Guid(\"00aaa4d9-8469-4503-a2a6-ed20d4cf1bae\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"19e01e64-4aa6-460f-9556-70cb7b3e3193\"), 5, new Guid(\"00aaa4d9-8469-4503-a2a6-ed20d4cf1bae\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"34156fbf-fcfe-4d03-a6f4-aea195be2485\"), 7, new Guid(\"00aaa4d9-8469-4503-a2a6-ed20d4cf1bae\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"1aad5865-3037-4d9f-b172-6f5626b9bce8\"), 3, new Guid(\"7bdd0584-157d-49e0-bdc8-e31dde60c466\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"38472c4b-2171-41e4-8718-bb6258278d04\"), 5, new Guid(\"7bdd0584-157d-49e0-bdc8-e31dde60c466\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"da2f017f-c116-4702-a731-d0182f9a1346\"), 7, new Guid(\"7bdd0584-157d-49e0-bdc8-e31dde60c466\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"8285bf49-fcb4-4d52-83e1-10b14edcaed6\"), 3, new Guid(\"9f237bcd-0c1a-45be-8755-60bff2ff9121\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"a3816a4c-b6eb-47f4-a5ab-7708a53c8e0c\"), 5, new Guid(\"b1651749-1d03-4fb7-b65e-4030cbb8d8cb\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"a7c7211e-1a18-4dde-8de5-11a80116ff28\"), 5, new Guid(\"9f237bcd-0c1a-45be-8755-60bff2ff9121\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"9a987fdf-183c-40d1-82d7-08a3bd67a1bc\"), 7, new Guid(\"98ddeb34-68a3-4fce-8c46-44b677e134d4\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"979cf5b1-666f-4c56-a346-051a2ef6fef1\"), 3, new Guid(\"98ddeb34-68a3-4fce-8c46-44b677e134d4\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"b16b6be7-ed9e-41fc-b782-63155b02c8ad\"), 3, new Guid(\"6b2f4d2a-355a-43a7-b98e-f3281df59b67\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"8399ea4e-5873-4999-9290-b8433979df5e\"), 5, new Guid(\"6b2f4d2a-355a-43a7-b98e-f3281df59b67\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"974386e1-64b7-4d0e-af6f-23eff783e986\"), 7, new Guid(\"6b2f4d2a-355a-43a7-b98e-f3281df59b67\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"adf7b076-262b-46d3-9f33-984a4d330afa\"), 3, new Guid(\"2fe8928c-2360-4b92-a8d9-084b3864951a\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"c86e41c5-2965-4a08-ade1-ff8473bc8210\"), 5, new Guid(\"2fe8928c-2360-4b92-a8d9-084b3864951a\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"091e7681-9615-4a40-a7da-ab42fc2936ec\"), 7, new Guid(\"2fe8928c-2360-4b92-a8d9-084b3864951a\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"721b8c5c-b845-4593-9028-fc90864410dd\"), 3, new Guid(\"6d712a6c-b5a2-42f8-873f-68c3be27109f\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"ed1f6d5c-b3b5-4835-8e5b-c0d68ef7a2e6\"), 5, new Guid(\"6d712a6c-b5a2-42f8-873f-68c3be27109f\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"b1d7cd94-f0ec-4d03-9a14-bd0955e587ac\"), 7, new Guid(\"6d712a6c-b5a2-42f8-873f-68c3be27109f\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"8240bf24-3ae8-4f91-ba8b-ccd8983e760b\"), 3, new Guid(\"dab947aa-09af-4bb5-8bf5-c4139d310e00\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"9587a9f8-017e-4305-a974-bf7f3ad41b00\"), 5, new Guid(\"dab947aa-09af-4bb5-8bf5-c4139d310e00\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"2638ccd3-7e5e-4e4f-adcb-f115ed70c8f1\"), 5, new Guid(\"98ddeb34-68a3-4fce-8c46-44b677e134d4\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"61772080-d522-4868-a499-d1494da0dc98\"), 7, new Guid(\"dab947aa-09af-4bb5-8bf5-c4139d310e00\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"d7a63754-a607-4e34-bd21-a1f5a639f2ee\"), 5, new Guid(\"8559024f-b0c9-4940-ad0a-75c8879960e0\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"c6ae01a3-5a1b-4dd4-b31e-d1eaa77fc325\"), 7, new Guid(\"8559024f-b0c9-4940-ad0a-75c8879960e0\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"207ffe38-3ef5-4bbe-9533-139c5d6f0b43\"), 3, new Guid(\"e5b84925-8b91-43ee-990c-06bf32a6bd7b\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"e75dd948-ea7f-41e6-a1a3-335fc0e2eb98\"), 5, new Guid(\"e5b84925-8b91-43ee-990c-06bf32a6bd7b\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"f9287655-193a-459d-85c3-4fd9083d444b\"), 7, new Guid(\"e5b84925-8b91-43ee-990c-06bf32a6bd7b\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"ab636c78-0530-497e-b216-ae1e352eb32b\"), 3, new Guid(\"9af10ff0-2d2a-4ebc-88b5-8a3c4f6a1295\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"9729078d-9443-4d43-bc45-276b68266be3\"), 5, new Guid(\"9af10ff0-2d2a-4ebc-88b5-8a3c4f6a1295\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"4986a34a-1e16-43c7-9da7-95f159ca4fa6\"), 7, new Guid(\"9af10ff0-2d2a-4ebc-88b5-8a3c4f6a1295\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"e5035437-cadc-474e-bd07-bb7089095c3f\"), 3, new Guid(\"c2b9dfc8-335b-4c0d-85a4-a2aa6117172b\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"6ead71cd-b0ce-4ed4-9ded-46838d9478a7\"), 5, new Guid(\"c2b9dfc8-335b-4c0d-85a4-a2aa6117172b\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"cc12e0a6-b317-40d0-b632-b478be44db6e\"), 7, new Guid(\"c2b9dfc8-335b-4c0d-85a4-a2aa6117172b\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"4818f548-f058-4b97-bb51-0e1c56f4ee14\"), 3, new Guid(\"8559024f-b0c9-4940-ad0a-75c8879960e0\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"be0f71bd-9990-40d3-870e-63e255bcef0d\"), 7, new Guid(\"9f237bcd-0c1a-45be-8755-60bff2ff9121\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"0559fe22-fce5-40ca-94c7-5f6f0759734b\"), 3, new Guid(\"958d8f02-2716-433a-8278-0046721ea0e9\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"e2a32ad6-1d29-417a-b283-d6dec6b5f5e2\"), 5, new Guid(\"958d8f02-2716-433a-8278-0046721ea0e9\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"5d3d089d-fb17-4059-938f-df53cc2ba11c\"), 5, new Guid(\"7fd65aee-3ed8-447a-ab1b-500c09e58cb8\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"376bda53-2d69-4436-96cb-4a67f2dfa119\"), 7, new Guid(\"7fd65aee-3ed8-447a-ab1b-500c09e58cb8\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"1a5c16f7-d8e3-4106-a892-72d84c14c3e5\"), 3, new Guid(\"36ab42a3-74d6-4035-8444-6a3980489e74\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"6cb44b68-00fe-4981-a76b-261007888ed8\"), 5, new Guid(\"36ab42a3-74d6-4035-8444-6a3980489e74\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"95222e20-c677-4fcf-87d9-da84d0b8eef5\"), 7, new Guid(\"36ab42a3-74d6-4035-8444-6a3980489e74\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"16712f22-152f-4db8-aa5c-63ef15c45e21\"), 3, new Guid(\"a3bb842d-1283-4dab-be41-997ae93b5f35\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"97d92596-49a6-4387-ac94-51fe2d3e38b6\"), 5, new Guid(\"a3bb842d-1283-4dab-be41-997ae93b5f35\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"103b94f4-0115-4204-b6e6-74002df61962\"), 7, new Guid(\"a3bb842d-1283-4dab-be41-997ae93b5f35\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"69aa55d3-340d-462f-bf4d-d399c43b2da8\"), 3, new Guid(\"060e1743-cf14-4bbb-84ed-563903743fd0\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"90ada06f-682a-4c46-a491-d28d5afc5ae5\"), 5, new Guid(\"060e1743-cf14-4bbb-84ed-563903743fd0\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"a601a34a-11bc-4b71-8dd5-1c619f9bfe45\"), 7, new Guid(\"060e1743-cf14-4bbb-84ed-563903743fd0\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"def47a30-3644-4e62-896b-7112678e289f\"), 3, new Guid(\"7fd65aee-3ed8-447a-ab1b-500c09e58cb8\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"378d63b1-9c72-413c-bce0-8a95efd8947a\"), 3, new Guid(\"2f741891-79fd-4c08-bcd4-c4299b428e68\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"1e74da2c-02f1-4465-8a81-9dcdacecc2c1\"), 7, new Guid(\"2f741891-79fd-4c08-bcd4-c4299b428e68\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"66e048b4-d59a-4124-851b-13088f51a9f6\"), 3, new Guid(\"5dab41a8-13c1-4c69-97da-4f2ee37c13ab\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"0625ccd4-939c-4146-a6d4-56cb0db4c94f\"), 5, new Guid(\"5dab41a8-13c1-4c69-97da-4f2ee37c13ab\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"614153fd-32c3-435b-a266-0db331cd4b34\"), 7, new Guid(\"5dab41a8-13c1-4c69-97da-4f2ee37c13ab\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"b062690e-508b-4a3a-8214-3ebb865bfa0c\"), 3, new Guid(\"9e962cab-a5ee-4b07-8e5d-e51b1e254a53\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"f46616d8-0b74-437e-891b-3726b8aaebd5\"), 5, new Guid(\"9e962cab-a5ee-4b07-8e5d-e51b1e254a53\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"666eb83b-da26-403b-81cc-3a78a3a963f5\"), 7, new Guid(\"9e962cab-a5ee-4b07-8e5d-e51b1e254a53\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"01424382-4584-44b3-ae73-8a45b9277765\"), 3, new Guid(\"4e643e04-294f-4527-b725-566df5e049c4\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"32a87af7-70d4-4893-992e-85623cf8b6da\"), 5, new Guid(\"4e643e04-294f-4527-b725-566df5e049c4\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"eb23e6e6-642b-4875-bf76-bd40d0765ee7\"), 7, new Guid(\"4e643e04-294f-4527-b725-566df5e049c4\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"5ece07b8-0f8c-4b67-a0d0-2fe5f590b2c1\"), 3, new Guid(\"d79c6c4d-635f-4e41-8c0e-c9b2acd069cd\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"64eddb4f-5cad-4445-816d-f2d172fbca2b\"), 5, new Guid(\"2f741891-79fd-4c08-bcd4-c4299b428e68\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"3fc74a0d-0127-4680-94e0-954bb694a945\"), 7, new Guid(\"6a290bf6-d18c-4ab8-a8f4-87b8fc30ef43\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"4b4af359-4830-4211-8c16-2d9a448c36f4\"), 5, new Guid(\"6a290bf6-d18c-4ab8-a8f4-87b8fc30ef43\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"5c23ac82-7d3f-4fe7-9fe8-ea02ebf6c577\"), 3, new Guid(\"6a290bf6-d18c-4ab8-a8f4-87b8fc30ef43\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"33c682d3-c0a8-4398-ad6e-337dcbd07671\"), 7, new Guid(\"958d8f02-2716-433a-8278-0046721ea0e9\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"a5478671-edc7-459d-b777-4fcb88914dda\"), 3, new Guid(\"56f1cc3a-e235-4a33-a88b-6f724c19ed50\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"c1eae4b8-c783-49db-9442-f3c310b6683d\"), 5, new Guid(\"56f1cc3a-e235-4a33-a88b-6f724c19ed50\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"35bb2019-1a5a-4335-a68c-71aa1021c1c6\"), 7, new Guid(\"56f1cc3a-e235-4a33-a88b-6f724c19ed50\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"0949bd6e-c2f3-4d23-ba4a-f80e800aa687\"), 3, new Guid(\"9c4460f3-3336-4f44-90a8-8fbd831aeba4\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"40545b9c-2ac0-4d90-85f4-b90b14f2c4e5\"), 5, new Guid(\"9c4460f3-3336-4f44-90a8-8fbd831aeba4\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"98112d15-ca04-4920-8d0a-a01c952cde3a\"), 7, new Guid(\"9c4460f3-3336-4f44-90a8-8fbd831aeba4\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"7b1e6c25-4f5d-4e14-af3d-70e55ebe2047\"), 3, new Guid(\"a9185c12-49ad-489a-9896-b6cce36bc117\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"3345deb2-eeb0-4450-ae11-6ebeb0f224e4\"), 5, new Guid(\"a9185c12-49ad-489a-9896-b6cce36bc117\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"714ca9ce-5c46-4834-b5fd-88e65e37042c\"), 7, new Guid(\"a9185c12-49ad-489a-9896-b6cce36bc117\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"fc946f89-a09e-4a51-b68b-20a5c545db7f\"), 3, new Guid(\"8e26f802-3253-4d8a-b2e0-5d92d4f2a105\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"e9c36d2c-9b9a-461d-a338-5f80aec69d43\"), 5, new Guid(\"8e26f802-3253-4d8a-b2e0-5d92d4f2a105\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"efe94a7a-87e0-4494-940b-e39496462924\"), 7, new Guid(\"8e26f802-3253-4d8a-b2e0-5d92d4f2a105\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"a873e024-4fa7-4047-a731-a6465ed7db5c\"), 3, new Guid(\"a06ad8b4-d7fa-4470-8830-a55e20e1a90e\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"1e54dca3-215c-404c-ab01-41e32f518690\"), 5, new Guid(\"a06ad8b4-d7fa-4470-8830-a55e20e1a90e\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"ba3dcdad-574e-4eb9-bcbe-0cd54038f1f0\"), 7, new Guid(\"a06ad8b4-d7fa-4470-8830-a55e20e1a90e\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"710fdea3-2e9a-4307-a60c-dd5d71c00ac2\"), 3, new Guid(\"d7f7326a-dcb6-4eaa-a1c6-e41564492a14\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"bdae5947-4566-4501-aa4d-c921c7886923\"), 5, new Guid(\"d7f7326a-dcb6-4eaa-a1c6-e41564492a14\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"44fd1292-b783-4e1a-a0f5-01fc49972aa5\"), 7, new Guid(\"d7f7326a-dcb6-4eaa-a1c6-e41564492a14\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"74a44a18-906a-4d75-89e1-ecc3d21c3d82\"), 3, new Guid(\"8c1f91e5-a328-42bd-8a01-9f6f60576a1f\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"955a2cc7-2933-452b-b01a-70e50fefb3ac\"), 5, new Guid(\"8c1f91e5-a328-42bd-8a01-9f6f60576a1f\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"be409c40-e822-4204-a5d1-25ac993177af\"), 7, new Guid(\"8c1f91e5-a328-42bd-8a01-9f6f60576a1f\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"f16fb701-f8c1-4426-b830-8f8c598e803a\"), 3, new Guid(\"203427a5-62df-400f-bdde-84be57a610e5\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"10b7c2ba-1199-43e4-881f-501ca5279587\"), 5, new Guid(\"203427a5-62df-400f-bdde-84be57a610e5\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"23c9eb90-eedc-4e0d-b5aa-2e0fa7b771b7\"), 7, new Guid(\"203427a5-62df-400f-bdde-84be57a610e5\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"75044ea5-34bc-453c-a3c1-a6f7ccf70b24\"), 5, new Guid(\"906f9a41-cd17-4507-93aa-c4fd96e48047\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"c89a0785-8a56-409b-99e6-52845b7f6609\"), 5, new Guid(\"c277d89d-8c37-4e12-b020-86f99f8d72cc\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"ec4b1557-17d2-4f5e-ac92-e0de22fb9874\"), 3, new Guid(\"c277d89d-8c37-4e12-b020-86f99f8d72cc\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"dbd114dc-d530-49c2-b845-4725e816060f\"), 7, new Guid(\"9b0ea92c-c0cc-4af2-a781-3482a0e408cd\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"38952692-714b-4242-a0cb-93ae20c886ce\"), 7, new Guid(\"93945621-1f2a-4286-ae9b-8b23319bbf97\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"7f8ff74a-c69a-4a0f-868b-139bdb572de1\"), 3, new Guid(\"b10d0db7-3518-4a12-ba3d-640cff5e83c5\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"ad75d759-33b0-46a4-8cd3-1752f40b5264\"), 5, new Guid(\"b10d0db7-3518-4a12-ba3d-640cff5e83c5\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"3503f6f3-bbac-4859-b083-2329ecb53dd6\"), 7, new Guid(\"b10d0db7-3518-4a12-ba3d-640cff5e83c5\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"cf088b0f-b603-4b35-9acb-4ef83e319c91\"), 3, new Guid(\"f1e8e072-2cce-40dc-8235-049fdab1d82e\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"7ce7fddc-29d7-415f-b23b-21fe2c19dc1c\"), 5, new Guid(\"f1e8e072-2cce-40dc-8235-049fdab1d82e\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"d7f60294-f486-40c6-a674-1b40e480297c\"), 7, new Guid(\"f1e8e072-2cce-40dc-8235-049fdab1d82e\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"23e2b818-dffd-4ed1-88cc-0be8e09a8b8e\"), 3, new Guid(\"df71ba96-c703-4ed7-a878-abd388c65639\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"c7fb88c4-2712-4927-ac47-6c0906cee866\"), 5, new Guid(\"df71ba96-c703-4ed7-a878-abd388c65639\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"8f35a21f-be61-4d3b-837a-711010f21eba\"), 7, new Guid(\"df71ba96-c703-4ed7-a878-abd388c65639\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"4e1ea921-fc9b-4dc2-a877-405494811a2b\"), 3, new Guid(\"fa2ee809-3ea8-44c8-aa56-e9aefeea811d\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"00729812-20c5-4075-857e-dac9d58b345b\"), 5, new Guid(\"93945621-1f2a-4286-ae9b-8b23319bbf97\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"7f027538-0645-4138-8067-e154bc5473f1\"), 5, new Guid(\"fa2ee809-3ea8-44c8-aa56-e9aefeea811d\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"fc360489-1fed-49e1-970f-e21d21b27088\"), 3, new Guid(\"0235d982-605a-46b9-ad0a-f5c804379adc\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"fd76cc3d-83d7-4dc9-918f-a78adf338a5d\"), 5, new Guid(\"0235d982-605a-46b9-ad0a-f5c804379adc\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"57d52396-50ae-442c-a4be-a7cbc80dc816\"), 7, new Guid(\"0235d982-605a-46b9-ad0a-f5c804379adc\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"1a87d836-5750-4189-a3b4-fad9b07c598d\"), 3, new Guid(\"0bb76772-65ae-46b1-bdb4-ba9483d801f3\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"4db982dd-ad55-4883-af0a-1858e20605c3\"), 5, new Guid(\"0bb76772-65ae-46b1-bdb4-ba9483d801f3\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"15c05812-621a-4fdf-bd32-6b555217e87f\"), 7, new Guid(\"0bb76772-65ae-46b1-bdb4-ba9483d801f3\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"4da7cf66-b485-4b76-a627-e776b717b786\"), 3, new Guid(\"9f213b5c-0795-4952-8f21-aa8f4b65a2ac\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"af95e148-b1cd-409e-899f-df4e04a3559c\"), 5, new Guid(\"9f213b5c-0795-4952-8f21-aa8f4b65a2ac\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"0534c3e3-3e76-4073-b4c5-3fd9c97e20eb\"), 7, new Guid(\"9f213b5c-0795-4952-8f21-aa8f4b65a2ac\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"abae61be-53a5-4185-a8d6-232f3bdeda57\"), 3, new Guid(\"84e75391-d321-45ca-bf35-f2b60ba563f2\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"8dd06dde-a1a6-4e26-955b-25daa9d6d799\"), 5, new Guid(\"84e75391-d321-45ca-bf35-f2b60ba563f2\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"12d1b9b6-598f-4eac-a819-925e22bf487b\"), 7, new Guid(\"fa2ee809-3ea8-44c8-aa56-e9aefeea811d\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"fce63b56-1d3b-46f7-9447-cffa793c8d55\"), 7, new Guid(\"84e75391-d321-45ca-bf35-f2b60ba563f2\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"072fd583-892a-4a80-bc34-637e36008393\"), 3, new Guid(\"93945621-1f2a-4286-ae9b-8b23319bbf97\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"72987644-a739-4a2f-9ae3-c82a4dbfb727\"), 5, new Guid(\"4f1f91cd-b911-44ca-9b88-043f0aa779ca\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"42e5af2e-4f78-46ad-83b7-e9a2c043c659\"), 5, new Guid(\"be4eff2a-f4e4-4f78-ad33-8c8c6fa446ab\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"7e013272-4171-4366-87f9-4139643a3917\"), 7, new Guid(\"be4eff2a-f4e4-4f78-ad33-8c8c6fa446ab\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"faaf7ab4-f76b-4ad9-be5b-2b09cdeec2b7\"), 3, new Guid(\"a0e20ba3-4bfd-490b-a308-4d0003b40c4c\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"266f641d-19ff-45da-8128-9611a98ed9a0\"), 5, new Guid(\"a0e20ba3-4bfd-490b-a308-4d0003b40c4c\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"b0a3dab2-77dd-4ffe-a6ce-33fbe2a2d2f2\"), 7, new Guid(\"a0e20ba3-4bfd-490b-a308-4d0003b40c4c\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"f24a895d-929c-4a71-8b7a-a02c7a9874ef\"), 3, new Guid(\"30144593-995c-4d30-87e0-ea202dff018d\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"7c2c0cf9-2e92-4193-be0f-1b0664eb5c28\"), 5, new Guid(\"30144593-995c-4d30-87e0-ea202dff018d\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"f8559adc-3c35-4d02-a58d-5c935c278998\"), 7, new Guid(\"30144593-995c-4d30-87e0-ea202dff018d\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"a3bf8c64-38cc-46ee-b8b4-3e38e478bf18\"), 3, new Guid(\"a90b8781-7681-4fdd-8187-f780784c3889\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"a11fedc0-0d2b-4386-aaeb-ce7eee6dfbdf\"), 5, new Guid(\"a90b8781-7681-4fdd-8187-f780784c3889\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"f21dd197-7506-4250-8553-9e401a3c9e07\"), 7, new Guid(\"a90b8781-7681-4fdd-8187-f780784c3889\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"26ba0b29-5f0a-4b35-9791-5fe28db0aec3\"), 7, new Guid(\"4f1f91cd-b911-44ca-9b88-043f0aa779ca\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"d2c00593-e285-43f1-94db-6d7641cabf87\"), 3, new Guid(\"1541a7cc-057f-4618-9a75-7e3c92343c89\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"af887fbf-ef65-4e7b-b496-9b86ec939469\"), 7, new Guid(\"1541a7cc-057f-4618-9a75-7e3c92343c89\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"65784a5d-fe9b-487f-bd18-02f0d0da9da0\"), 3, new Guid(\"749061ca-24cd-4560-bc1b-f0ed66652603\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"ca6e5e19-1d49-4c01-b32a-73740cf7ef29\"), 5, new Guid(\"749061ca-24cd-4560-bc1b-f0ed66652603\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"e5d17c94-fdea-4490-aa7d-b7fef0dc79ea\"), 7, new Guid(\"749061ca-24cd-4560-bc1b-f0ed66652603\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"40510783-7a68-4df5-860a-2b0f76a20d66\"), 3, new Guid(\"33767577-7b2b-48ea-af0b-63afdffff20e\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"27e30941-752d-444b-8975-5b6b560d7c02\"), 5, new Guid(\"33767577-7b2b-48ea-af0b-63afdffff20e\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"1bb6ab82-6b1d-4889-890e-b84a4741c5d4\"), 7, new Guid(\"33767577-7b2b-48ea-af0b-63afdffff20e\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"f868d99a-8da9-4bc3-b13b-44b560a49c35\"), 3, new Guid(\"94be3796-b848-4007-9ed6-dce0cff9e06c\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"300c9f1d-092d-468a-9925-c1405c572a6d\"), 5, new Guid(\"94be3796-b848-4007-9ed6-dce0cff9e06c\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"a87d7b38-8fee-43d0-87bd-f766d8fb85ab\"), 7, new Guid(\"94be3796-b848-4007-9ed6-dce0cff9e06c\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"13db22ea-22d5-408f-a793-2c1327f73221\"), 3, new Guid(\"4f1f91cd-b911-44ca-9b88-043f0aa779ca\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"1d364734-a182-4c69-91c2-db4bc7364487\"), 5, new Guid(\"1541a7cc-057f-4618-9a75-7e3c92343c89\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"d56031a2-1636-4888-a79b-6155ace463ee\"), 3, new Guid(\"be4eff2a-f4e4-4f78-ad33-8c8c6fa446ab\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"6afc280b-48a6-4207-b313-0837efc4847d\"), 3, new Guid(\"79e2614c-6678-435b-87ea-214d9f0ed603\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"18e2bf47-8218-45e9-b80e-6db07e8c4da5\"), 7, new Guid(\"79e2614c-6678-435b-87ea-214d9f0ed603\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"79aa8ae2-92e6-47b5-a195-2609501ff8ee\"), 5, new Guid(\"de140553-1ecc-4ef6-9cbe-e7a73f7044fe\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"73174dbb-ba10-4338-b2ce-5d47ac023047\"), 7, new Guid(\"de140553-1ecc-4ef6-9cbe-e7a73f7044fe\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"ddc8656b-9041-4f7f-9b2c-8709f043a0a0\"), 3, new Guid(\"a94e7ff9-9adb-4e46-ab58-ed5a8c4247c2\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"83e2eeb1-3cb9-48a7-aab5-2c9706867fd6\"), 5, new Guid(\"a94e7ff9-9adb-4e46-ab58-ed5a8c4247c2\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"9a1cd14a-2495-4053-9d3b-8eb6be1b7785\"), 7, new Guid(\"a94e7ff9-9adb-4e46-ab58-ed5a8c4247c2\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"84b0c85a-d789-47ed-a92c-ee5697c07eda\"), 3, new Guid(\"8ddf74c3-20e2-4b82-8345-75b54101115d\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"ca6cab74-57cc-445e-9c85-b0155ff8365d\"), 5, new Guid(\"8ddf74c3-20e2-4b82-8345-75b54101115d\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"a05a2289-7f04-4ba6-a014-f0cb0d8482ea\"), 7, new Guid(\"8ddf74c3-20e2-4b82-8345-75b54101115d\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"de67b428-9241-41df-acdd-14a56f3ab178\"), 3, new Guid(\"7f99cddd-08ac-4548-a582-abd5d604d4ea\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"6e46212a-a8fb-4999-8ddf-cc077c6876a4\"), 5, new Guid(\"7f99cddd-08ac-4548-a582-abd5d604d4ea\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"51b91a4f-bde6-4892-8a0a-81c4de856e05\"), 7, new Guid(\"7f99cddd-08ac-4548-a582-abd5d604d4ea\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"5fde2a6c-14fd-4efb-ba8d-a7fb76dcbb12\"), 3, new Guid(\"de140553-1ecc-4ef6-9cbe-e7a73f7044fe\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"b9f44824-ebf0-49f1-a98d-7d1028afd7b1\"), 3, new Guid(\"3c7ee161-a641-413f-a392-74c17e8f2dc2\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"93524e2e-0f98-49ed-b74b-dd09dbab2342\"), 7, new Guid(\"3c7ee161-a641-413f-a392-74c17e8f2dc2\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"f6eb04ae-e3f9-416c-8df2-6acbb7ae3561\"), 3, new Guid(\"f61ff185-090c-4a21-88f0-d6bbf8ece4c4\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"2cd29a0d-9de7-4f19-a231-2993491de5bd\"), 5, new Guid(\"f61ff185-090c-4a21-88f0-d6bbf8ece4c4\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"edbe4b5f-b5e7-412e-8029-4e487f07caa9\"), 7, new Guid(\"f61ff185-090c-4a21-88f0-d6bbf8ece4c4\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"c5c05e0f-a4e0-45a4-8c68-97e3db9992a6\"), 3, new Guid(\"e4991029-14ed-4d8d-b1fe-a75eaa52dfce\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"5baeaafc-250b-4ab9-9137-5b3dbcced68b\"), 5, new Guid(\"e4991029-14ed-4d8d-b1fe-a75eaa52dfce\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"f53cc448-c8d8-4db9-ad19-42fc3e44f6a3\"), 7, new Guid(\"e4991029-14ed-4d8d-b1fe-a75eaa52dfce\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"ed3c695e-c2e4-443c-9762-3156b2014b62\"), 3, new Guid(\"1101dcdb-2ad6-4f1e-a180-66b714f106f7\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"7190763d-8324-4178-b919-8150132ba745\"), 5, new Guid(\"1101dcdb-2ad6-4f1e-a180-66b714f106f7\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"d52aee1e-a855-4e74-87c9-2a8e12b5c836\"), 7, new Guid(\"1101dcdb-2ad6-4f1e-a180-66b714f106f7\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"7781b2ac-95d4-448d-bef0-9a43b65bd8ef\"), 3, new Guid(\"6c3e7c43-88d0-451d-a4f3-0469888e2dfa\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"9d8d8dc1-69ba-4b2a-a74f-04cec286b367\"), 5, new Guid(\"3c7ee161-a641-413f-a392-74c17e8f2dc2\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"85499536-16be-471d-84d4-26960656effe\"), 5, new Guid(\"79e2614c-6678-435b-87ea-214d9f0ed603\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"03c26013-e43f-4cd5-8907-3500999d6f70\"), 7, new Guid(\"032cdd7c-8c6c-45a2-896b-6b8512126ca3\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"81003d75-4644-4ea9-86ed-c85128d83985\"), 3, new Guid(\"032cdd7c-8c6c-45a2-896b-6b8512126ca3\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"14eb44fe-5a86-4eb8-88b3-2a99e335ff95\"), 3, new Guid(\"07a7ebe0-058e-4d5d-9c2b-dfae6ee98c3e\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"fefda8d2-dec4-447a-906b-ecf86ce9fb31\"), 5, new Guid(\"07a7ebe0-058e-4d5d-9c2b-dfae6ee98c3e\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"3c071b49-fa65-4b50-b839-9482d74586ea\"), 7, new Guid(\"07a7ebe0-058e-4d5d-9c2b-dfae6ee98c3e\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"9561325d-229a-4184-a7fd-b92fe8a08021\"), 3, new Guid(\"bbe15aba-42d4-4bea-8143-80f275f4852d\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"252f76ce-25b4-4029-96a4-2d9969f9a593\"), 5, new Guid(\"bbe15aba-42d4-4bea-8143-80f275f4852d\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"ea906609-5778-4419-a243-3d00f6014749\"), 7, new Guid(\"bbe15aba-42d4-4bea-8143-80f275f4852d\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"611d8fd6-4985-48b6-8afd-42121f0797fe\"), 3, new Guid(\"272c16ac-51d9-4577-a919-57678b309ccd\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"04f00390-4ea5-4683-8eb1-1718a72ea9bb\"), 5, new Guid(\"272c16ac-51d9-4577-a919-57678b309ccd\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"5f752904-1b65-412e-a2c3-a17db8cb24b4\"), 7, new Guid(\"272c16ac-51d9-4577-a919-57678b309ccd\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"cdf78568-ea90-45e3-9664-f5ed869aa4b4\"), 3, new Guid(\"c54a82cb-5178-4569-a5a0-044ec3f969fd\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"fb51e346-4b5f-4d5a-a200-bf3395776503\"), 5, new Guid(\"c54a82cb-5178-4569-a5a0-044ec3f969fd\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"93f505e1-14da-4905-a288-f8abddecff7c\"), 5, new Guid(\"032cdd7c-8c6c-45a2-896b-6b8512126ca3\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"8c36e34f-88b7-41a9-ac14-e09f071bc76e\"), 7, new Guid(\"c54a82cb-5178-4569-a5a0-044ec3f969fd\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"32f463fb-11fd-40b7-b102-a05207de8652\"), 5, new Guid(\"e3a5f3e2-d003-4163-a830-41ad30c20c49\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"a43702a0-18ae-4123-9f5a-f28684f3a15c\"), 7, new Guid(\"e3a5f3e2-d003-4163-a830-41ad30c20c49\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"c3bf389a-308d-4eb5-9ed4-6c6580df001e\"), 3, new Guid(\"bedfd5f7-7e2e-4e05-85c1-7d8d59d54025\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"45e3b49c-e59d-4494-9e1d-652892fe8508\"), 5, new Guid(\"bedfd5f7-7e2e-4e05-85c1-7d8d59d54025\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"9a4fd5d3-427d-45c1-a19a-672184d9bb68\"), 7, new Guid(\"bedfd5f7-7e2e-4e05-85c1-7d8d59d54025\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"c2e925d4-9502-4678-bd64-315ff9750693\"), 3, new Guid(\"e3f445a9-9e1c-443a-a7c1-960f2953aa6f\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"74ac2a4d-bea9-4d8e-b898-53eb2a04565f\"), 5, new Guid(\"e3f445a9-9e1c-443a-a7c1-960f2953aa6f\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"0e470268-81f1-4cdc-945f-cc8671a1b90f\"), 7, new Guid(\"e3f445a9-9e1c-443a-a7c1-960f2953aa6f\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"73baa0a0-355c-4b9c-b38b-52585503ecfe\"), 3, new Guid(\"1d90af6b-02c1-4a0d-88b9-3e8ef1a07066\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"cd0d7d5f-4dc3-47fe-8984-061ec29fe312\"), 5, new Guid(\"1d90af6b-02c1-4a0d-88b9-3e8ef1a07066\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"2a7744fc-3ada-4dd0-8cab-bc5a1ddd44e9\"), 7, new Guid(\"1d90af6b-02c1-4a0d-88b9-3e8ef1a07066\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"606bec66-369c-4425-a06d-34f1e45b34b0\"), 3, new Guid(\"e3a5f3e2-d003-4163-a830-41ad30c20c49\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"0d25610b-c8e3-4dc5-814b-8981216cec0f\"), 7, new Guid(\"0ca5a209-c4ab-42f8-99a8-99541ac98c38\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"2ad751ee-d3a8-4ef2-b063-9e11a4dae82e\"), 5, new Guid(\"0ca5a209-c4ab-42f8-99a8-99541ac98c38\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"f937e7b4-b824-44f2-8fbe-e0edff0385b5\"), 3, new Guid(\"0ca5a209-c4ab-42f8-99a8-99541ac98c38\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"476bf034-6fbe-42fb-8fb2-7cac3b5d1573\"), 3, new Guid(\"780dbfb4-2974-4e4f-a84d-c802d30dffa6\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"1689199f-a277-4ee6-9154-4517017f6371\"), 5, new Guid(\"780dbfb4-2974-4e4f-a84d-c802d30dffa6\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"1ecc20a2-4479-448d-b3e8-b20c584db878\"), 7, new Guid(\"780dbfb4-2974-4e4f-a84d-c802d30dffa6\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"01fe9a29-61cf-4852-864b-5c4d40fad136\"), 3, new Guid(\"f006cf86-9be0-466e-9d4a-5a7d6b746a97\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"5c17bf84-1292-4821-a8c1-2a572fe460a9\"), 5, new Guid(\"f006cf86-9be0-466e-9d4a-5a7d6b746a97\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"1500aa57-ac63-4daf-8451-cae12f9533ed\"), 7, new Guid(\"f006cf86-9be0-466e-9d4a-5a7d6b746a97\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"41c5a275-22ca-4770-89df-87b3764941d9\"), 3, new Guid(\"bc951f1b-e492-4d67-a319-72e01c9c6ab1\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"af8a701b-c27d-44b6-a737-a131a93199b4\"), 5, new Guid(\"bc951f1b-e492-4d67-a319-72e01c9c6ab1\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"24850a77-ac25-44f2-abe2-cdae218ac307\"), 7, new Guid(\"bc951f1b-e492-4d67-a319-72e01c9c6ab1\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"1197a63b-4f2f-467a-9580-1436b32826b9\"), 3, new Guid(\"71831ce6-5787-4b1d-b76e-d3920e129779\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"c3d0a1ab-2f1e-4eb0-bcd9-0ba17410871c\"), 5, new Guid(\"71831ce6-5787-4b1d-b76e-d3920e129779\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"4978f1ad-4f6f-448a-b823-5099a58c10d1\"), 7, new Guid(\"b5174309-0d8c-48e9-82d0-9c840ac8acea\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"19efe90a-affc-4e84-9a20-ca64b3f85e36\"), 7, new Guid(\"71831ce6-5787-4b1d-b76e-d3920e129779\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"f1b9edfa-98d9-4504-9243-1796ba728c5b\"), 5, new Guid(\"0a4eb699-6706-4b00-b66f-2a97f2dcce36\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"5b0a8c6d-cf55-48c6-8037-6af169e8a250\"), 7, new Guid(\"0a4eb699-6706-4b00-b66f-2a97f2dcce36\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"4c4ee391-d713-41e2-a1bf-097ebeacb58a\"), 3, new Guid(\"53fed29c-a5c7-488d-a4a4-6672e4a06deb\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"6fa333ac-4b17-4268-ae67-44b713db48e6\"), 5, new Guid(\"53fed29c-a5c7-488d-a4a4-6672e4a06deb\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"aadf29e4-5e35-4c17-9d0a-8f28036590f3\"), 7, new Guid(\"53fed29c-a5c7-488d-a4a4-6672e4a06deb\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"10debc81-1587-480b-9884-f8518efa2454\"), 3, new Guid(\"9c6c4c05-27bd-40b2-8708-6275cd33890c\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"1906e1bc-89d7-45ec-a74f-f144ddc03560\"), 5, new Guid(\"9c6c4c05-27bd-40b2-8708-6275cd33890c\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"355744db-0892-4cf7-872d-910e4671e624\"), 7, new Guid(\"9c6c4c05-27bd-40b2-8708-6275cd33890c\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"ebe18c17-64a0-4055-9ac3-9395724b8010\"), 3, new Guid(\"3b1c9517-2427-4eb3-a937-feb6e588c84f\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"46d15c36-5618-422d-a8de-883be92d88ba\"), 5, new Guid(\"3b1c9517-2427-4eb3-a937-feb6e588c84f\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"2025aa08-7dd7-40fe-8184-a47af3fb4312\"), 7, new Guid(\"3b1c9517-2427-4eb3-a937-feb6e588c84f\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"2fa60e43-bc95-4c85-9333-78e22c300dd3\"), 3, new Guid(\"0a4eb699-6706-4b00-b66f-2a97f2dcce36\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"5419eb28-db30-4c92-b3fb-7e8d4b233d92\"), 3, new Guid(\"690f6041-f432-4ce9-8a93-28c4d03c0e76\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"3c453cda-6165-4344-bc3a-d68580caf6bb\"), 5, new Guid(\"b5174309-0d8c-48e9-82d0-9c840ac8acea\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"bad40cfe-80fd-4e54-a050-4509e0664596\"), 7, new Guid(\"696b26f7-bdc1-4795-b328-94df7198113f\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"b47aa6f1-70ec-43e4-aec3-182b948cb665\"), 7, new Guid(\"610fb97b-7f0c-46d2-86c6-f50010d51a71\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"5272eb2e-912d-49f8-b88a-9af783a952d8\"), 3, new Guid(\"de6d8cdf-854e-44e6-9a8a-b83e9309e3c8\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"1a65a2d4-1434-4668-82b1-08dcafbd35ed\"), 5, new Guid(\"de6d8cdf-854e-44e6-9a8a-b83e9309e3c8\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"88db28bf-7a76-4411-b8b5-bdc88abcf27e\"), 7, new Guid(\"de6d8cdf-854e-44e6-9a8a-b83e9309e3c8\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"885b5046-4030-4e53-9b3f-9b16d91f55a6\"), 3, new Guid(\"0a5f7026-276e-4ec0-ad51-cf7da90d08b2\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"9814055f-148a-40db-a7b7-a1ae6024ae3f\"), 5, new Guid(\"0a5f7026-276e-4ec0-ad51-cf7da90d08b2\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"17624651-7601-43ca-9124-028593e03d08\"), 7, new Guid(\"0a5f7026-276e-4ec0-ad51-cf7da90d08b2\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"35f89717-80a2-4f9f-90a9-43d2919b6781\"), 3, new Guid(\"c7014f6c-2915-4533-ad15-2e2ffb250f44\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"30e726ba-13da-423a-b354-873cd627568a\"), 5, new Guid(\"c7014f6c-2915-4533-ad15-2e2ffb250f44\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"137c5400-b1b7-4b4d-8972-580400cd0b92\"), 7, new Guid(\"c7014f6c-2915-4533-ad15-2e2ffb250f44\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"562c4cca-6003-49bc-9eaa-9ea13332224d\"), 3, new Guid(\"aef86ee4-8518-4fe8-8dff-e31571becf59\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"a1a9b6a6-4f5f-4ccd-9a7b-30c2fab4b0dc\"), 3, new Guid(\"b5174309-0d8c-48e9-82d0-9c840ac8acea\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"39510329-5164-47b5-b51e-50f2757cf073\"), 5, new Guid(\"aef86ee4-8518-4fe8-8dff-e31571becf59\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"a87c771a-328b-406f-93b4-a6a7393e27cc\"), 3, new Guid(\"48c43453-5d8e-4ea7-b740-1b60fbde86d0\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"e4ed3805-9e88-423b-a965-eadf629dc91d\"), 5, new Guid(\"48c43453-5d8e-4ea7-b740-1b60fbde86d0\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"f6831a42-a3c7-486f-b6ab-ce8cf6049692\"), 7, new Guid(\"48c43453-5d8e-4ea7-b740-1b60fbde86d0\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"bc01f296-1888-4c82-ac58-ac6b4c190c72\"), 3, new Guid(\"fba2b776-c9f5-473f-a43a-9d459e8f2cba\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"3a799029-abf9-4901-87c0-72e13552c1ce\"), 5, new Guid(\"fba2b776-c9f5-473f-a43a-9d459e8f2cba\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"10d6d324-b768-4078-825a-b73b5149eb8d\"), 7, new Guid(\"fba2b776-c9f5-473f-a43a-9d459e8f2cba\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"a7dcf0e3-f7f6-4b6f-8053-691aa2dffb20\"), 3, new Guid(\"d4e71dfc-8ccf-4b50-9f38-0c29866d005c\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"0de20993-ce8c-4322-9854-3a04ec815b65\"), 5, new Guid(\"d4e71dfc-8ccf-4b50-9f38-0c29866d005c\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"d6d5e7a3-aa8b-4435-85a2-e0dfbe28b83f\"), 7, new Guid(\"d4e71dfc-8ccf-4b50-9f38-0c29866d005c\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"17e6b5b7-e613-4b07-b111-a9d8daa349ec\"), 3, new Guid(\"696b26f7-bdc1-4795-b328-94df7198113f\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"46424918-25cc-41f6-91cd-9e8f045d7a08\"), 5, new Guid(\"696b26f7-bdc1-4795-b328-94df7198113f\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"ccd6915c-026d-48db-a03f-a0a0abac160d\"), 7, new Guid(\"aef86ee4-8518-4fe8-8dff-e31571becf59\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"b3043e08-732a-4434-b5d2-1fd9679adf1a\"), 5, new Guid(\"690f6041-f432-4ce9-8a93-28c4d03c0e76\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"2ebb96a0-714b-4711-a70b-5f01a51ee81b\"), 7, new Guid(\"690f6041-f432-4ce9-8a93-28c4d03c0e76\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"86a34bd5-f0ec-4ad3-9a60-1be25348e775\"), 3, new Guid(\"0354e008-141e-4178-8b03-78925e5982c2\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"c1889abb-1fe5-453b-a444-1ae7c41bb08c\"), 3, new Guid(\"41b668b9-1e5c-449b-9e82-aee3c68a32a5\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"10bb13f4-a78d-48c9-9f8b-7268b1187770\"), 5, new Guid(\"41b668b9-1e5c-449b-9e82-aee3c68a32a5\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"f39c82bb-a64b-44f0-8e09-e27002ee90e2\"), 7, new Guid(\"41b668b9-1e5c-449b-9e82-aee3c68a32a5\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"2704ac44-ef42-43b3-bce8-66f52d61c214\"), 3, new Guid(\"ab616b78-ceaa-4f28-b8aa-4d270dc2b4b2\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"6776d972-f3d7-4894-9e3c-23fd9f2045a2\"), 5, new Guid(\"ab616b78-ceaa-4f28-b8aa-4d270dc2b4b2\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"a6081aa8-0332-452f-a106-2181b33ab798\"), 7, new Guid(\"ab616b78-ceaa-4f28-b8aa-4d270dc2b4b2\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"09ecfe28-5147-4436-9a7f-a7cb1e791b3f\"), 3, new Guid(\"cd8d605a-4cc5-4874-94a6-ccdef571cfa0\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"37cb3dfb-54a2-4a7c-b048-57ea80f34f8e\"), 5, new Guid(\"cd8d605a-4cc5-4874-94a6-ccdef571cfa0\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"9160119c-4f0a-4f1c-b045-29c50301b1d5\"), 7, new Guid(\"cd8d605a-4cc5-4874-94a6-ccdef571cfa0\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"3867d303-7bdd-40bb-a7a9-7bbcd2d30571\"), 3, new Guid(\"6fbd988c-0333-4394-987e-86643dc3e531\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"b5b5a022-4bd1-4e43-a880-e30b2d02dcaf\"), 5, new Guid(\"6fbd988c-0333-4394-987e-86643dc3e531\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"955e4bde-1cde-4287-bee8-4fba506d25b4\"), 7, new Guid(\"d308f303-146e-4f75-9b6e-5250b519dcb8\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"53d6e24b-c47c-4763-8592-8b1bfe8cf9ed\"), 7, new Guid(\"6fbd988c-0333-4394-987e-86643dc3e531\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"23974d27-4ec0-45dc-a606-719fd0d6c2c7\"), 5, new Guid(\"835c08ba-1255-4a50-8eda-925bc06d4667\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"f5a1d283-214f-4393-a6b8-11073685d6e7\"), 7, new Guid(\"835c08ba-1255-4a50-8eda-925bc06d4667\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"544e0b83-df21-4a68-bac8-87baf637449b\"), 3, new Guid(\"ab806c8f-d0f0-47f7-8210-f5462b0429d2\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"c7961fbe-1581-4ad7-a608-5f4c465c31b5\"), 5, new Guid(\"ab806c8f-d0f0-47f7-8210-f5462b0429d2\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"218717e2-9c88-4980-b106-46372c3959a1\"), 7, new Guid(\"ab806c8f-d0f0-47f7-8210-f5462b0429d2\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"56d6c22f-d58b-45b3-b8dc-ebc1dfdc902b\"), 3, new Guid(\"842d5acd-51e8-4a97-b581-48c963e7ac9e\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"9b27c7b3-aeb5-477d-9ce4-194a68d06896\"), 5, new Guid(\"842d5acd-51e8-4a97-b581-48c963e7ac9e\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"a1992e37-1aa1-433a-9124-69563ab1105a\"), 7, new Guid(\"842d5acd-51e8-4a97-b581-48c963e7ac9e\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"5593fbb0-5c2e-4322-8f1b-2863f49b58eb\"), 3, new Guid(\"66771d19-8aa1-4226-b35e-e747ad9a92c6\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"3630457c-8098-4033-984c-962d2aa733be\"), 5, new Guid(\"66771d19-8aa1-4226-b35e-e747ad9a92c6\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"8a3df54e-2720-4c03-bd5f-fdc7d5595e76\"), 7, new Guid(\"66771d19-8aa1-4226-b35e-e747ad9a92c6\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"0dbbceae-2565-426a-8005-619ea2cea0ac\"), 3, new Guid(\"835c08ba-1255-4a50-8eda-925bc06d4667\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"c1bac1a8-41db-45cb-9b30-466f5a955a2a\"), 5, new Guid(\"d308f303-146e-4f75-9b6e-5250b519dcb8\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"dd12a490-451e-4977-94eb-2bde83335cee\"), 3, new Guid(\"d308f303-146e-4f75-9b6e-5250b519dcb8\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"f5ca83c0-96aa-4a5f-a7e8-20bcb66f824b\"), 7, new Guid(\"793e8f8d-0b2e-4c7c-864a-e6c882b404a8\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"837236ae-bf7d-4537-9469-787221fa653f\"), 5, new Guid(\"0354e008-141e-4178-8b03-78925e5982c2\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"f74feaee-0deb-4899-bb72-b21c45216953\"), 7, new Guid(\"0354e008-141e-4178-8b03-78925e5982c2\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"dadb78fb-f66e-4d64-9523-688f8b9979bc\"), 3, new Guid(\"d4eb4b33-5df0-4aeb-babb-b030779638ed\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"233258a9-3792-4927-9792-f1385bbaaffc\"), 5, new Guid(\"d4eb4b33-5df0-4aeb-babb-b030779638ed\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"539eb59b-10f2-425b-8c72-625baa8cf8f9\"), 7, new Guid(\"d4eb4b33-5df0-4aeb-babb-b030779638ed\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"f43f3a2c-3b0d-47e4-b57d-abd587df85ce\"), 3, new Guid(\"fd97be44-027d-4634-8300-a34b0cc75419\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"c156ce15-3cec-474a-ba8b-dc3d96eb26f8\"), 5, new Guid(\"fd97be44-027d-4634-8300-a34b0cc75419\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"08c8252f-dc2f-4845-8389-4d349b43e992\"), 7, new Guid(\"fd97be44-027d-4634-8300-a34b0cc75419\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"aacca5b7-fef6-4896-9e38-b5995494ce80\"), 3, new Guid(\"8e5742f7-6003-48ef-88d9-c5c4004854cd\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"f4001888-90eb-4fd9-a5f9-411a69f8bd15\"), 5, new Guid(\"8e5742f7-6003-48ef-88d9-c5c4004854cd\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"d6ecb679-8b70-4a43-bdf9-a36b66221e52\"), 7, new Guid(\"8e5742f7-6003-48ef-88d9-c5c4004854cd\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"7f7e86a5-c8fa-4964-815f-a17e82d01159\"), 3, new Guid(\"33a2dc35-3268-4a78-a16e-238d5cefa157\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"a64f9226-032c-4051-9f47-be9846943104\"), 5, new Guid(\"33a2dc35-3268-4a78-a16e-238d5cefa157\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"aaf17c82-91b4-4fb3-a2ad-6e2850653184\"), 7, new Guid(\"33a2dc35-3268-4a78-a16e-238d5cefa157\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"e1f256f3-7db1-4f43-b151-b2c52a268f12\"), 3, new Guid(\"6fce0b5e-2b17-4171-888e-572a27dfbe36\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"a82da227-5ef6-45ce-ad61-4b5efc0dfd5e\"), 5, new Guid(\"6fce0b5e-2b17-4171-888e-572a27dfbe36\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"857f173c-ea0e-4d43-a6b4-a6921e15721f\"), 7, new Guid(\"6fce0b5e-2b17-4171-888e-572a27dfbe36\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"e80652dd-e38c-4a9b-b69a-a0e99e646866\"), 3, new Guid(\"7e969644-7eba-414a-a11b-d6a2dfaafc1e\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"7b37e75a-abe4-4773-ad0e-d1bc65a6286a\"), 5, new Guid(\"7e969644-7eba-414a-a11b-d6a2dfaafc1e\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"a0676c8d-ea17-45c7-8064-4058a15cbda8\"), 7, new Guid(\"7e969644-7eba-414a-a11b-d6a2dfaafc1e\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"d677bb44-db54-4214-b311-eade33941983\"), 3, new Guid(\"57eabd61-456c-416b-8d25-ea81acfd1e5d\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"6e2cb1c0-2df8-4b2e-9675-8e1604cbf0d1\"), 5, new Guid(\"57eabd61-456c-416b-8d25-ea81acfd1e5d\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"20d61998-ec76-4264-863f-d0fe8d55456e\"), 7, new Guid(\"57eabd61-456c-416b-8d25-ea81acfd1e5d\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"94e715de-acb3-4a27-9ba3-b2f02ad75639\"), 3, new Guid(\"793e8f8d-0b2e-4c7c-864a-e6c882b404a8\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"5acedfca-234b-4270-a55a-8c1a262cc6bf\"), 5, new Guid(\"793e8f8d-0b2e-4c7c-864a-e6c882b404a8\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") }\n                });\n\n            migrationBuilder.InsertData(\n                table: \"StorageUnits\",\n                columns: new[] { \"Id\", \"Quantity\", \"ShelfId\", \"UnitId\" },\n                values: new object[,]\n                {\n                    { new Guid(\"18a52efb-d9c9-4af6-9877-69c4ac0b14e2\"), 5, new Guid(\"6c3e7c43-88d0-451d-a4f3-0469888e2dfa\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"50e6b003-e500-422f-9ffc-33133d7a1057\"), 7, new Guid(\"6c3e7c43-88d0-451d-a4f3-0469888e2dfa\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"0d60c0e5-da03-46e6-88ac-dd5cd8766ca7\"), 3, new Guid(\"e4f971e6-5d22-4fe6-8a94-e2700406d2ee\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"c4ceb9d2-ad45-438c-84a3-5744419ecf20\"), 5, new Guid(\"e4f971e6-5d22-4fe6-8a94-e2700406d2ee\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"f369c6f2-c6c6-4308-9ca9-b71d0ee2a4c9\"), 7, new Guid(\"9ea41fb5-4692-4c3e-98dd-e1a4710e0f00\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"68229465-aefc-4271-b8d1-c9d23638d9d5\"), 3, new Guid(\"2de91b2a-75e5-41ca-aab2-731c619c1425\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"26838cdb-0a98-4ea3-8726-797cfb1c432f\"), 5, new Guid(\"2de91b2a-75e5-41ca-aab2-731c619c1425\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"e77fbd81-ca64-4f8a-ad43-492e94f6511f\"), 7, new Guid(\"2de91b2a-75e5-41ca-aab2-731c619c1425\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"100e8965-7f01-4e90-b6dd-7382d07e0477\"), 3, new Guid(\"aaebbe29-6945-4211-9616-0f4a18418cd0\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"cc6d3858-2e79-42ba-83e7-5dd84644b44f\"), 5, new Guid(\"aaebbe29-6945-4211-9616-0f4a18418cd0\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"3b0f57a9-dbcb-4a86-8876-8a22d2d2fbd9\"), 7, new Guid(\"aaebbe29-6945-4211-9616-0f4a18418cd0\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"4ce08123-2e39-4b16-a92b-10a53717c259\"), 3, new Guid(\"aab24d65-6f01-4ecc-b6dd-12c8923864d0\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"84a045d5-1af7-4a22-a67b-f86104b57907\"), 5, new Guid(\"aab24d65-6f01-4ecc-b6dd-12c8923864d0\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"cc7e4199-f5bd-40c4-853f-ad28a1e6dd7b\"), 7, new Guid(\"aab24d65-6f01-4ecc-b6dd-12c8923864d0\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"149b83cc-e475-4b7b-a4f1-f51da8aa6131\"), 3, new Guid(\"a4df86e7-0096-4971-8d9c-449db4f08820\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"051aed5b-da99-4cda-9c0e-b41add8e37b4\"), 5, new Guid(\"9ea41fb5-4692-4c3e-98dd-e1a4710e0f00\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"e106f376-4ca6-4386-84d1-8df11e560756\"), 5, new Guid(\"a4df86e7-0096-4971-8d9c-449db4f08820\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"f3c1bc53-6926-4444-b9ff-777cc39ea5fb\"), 3, new Guid(\"3c5a30b4-ef90-4e7b-a4db-41e97978459a\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"4f65f9ef-783b-4fe7-8051-022b9567a222\"), 5, new Guid(\"3c5a30b4-ef90-4e7b-a4db-41e97978459a\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"04d7f718-2cc0-47ac-b8f2-8b4970b2987f\"), 7, new Guid(\"3c5a30b4-ef90-4e7b-a4db-41e97978459a\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"7c184241-ca42-42ca-806f-39f382f56683\"), 3, new Guid(\"0f2f1167-421e-4a66-afda-ca582a96d29c\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"61249bdb-7e0a-4256-b091-38bd8f50891d\"), 5, new Guid(\"0f2f1167-421e-4a66-afda-ca582a96d29c\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"4115f832-d40e-4aab-9120-e63eb74be82c\"), 7, new Guid(\"0f2f1167-421e-4a66-afda-ca582a96d29c\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"d06ef2c9-2913-44d2-aa93-4700b17d2c01\"), 3, new Guid(\"6f970cd5-361f-4011-8611-b1fba73e8e74\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"f2140061-f6fe-4250-ad36-f9731ca13978\"), 5, new Guid(\"6f970cd5-361f-4011-8611-b1fba73e8e74\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"63a9a61c-da0b-4ee8-a8c7-50d6902d8d6e\"), 7, new Guid(\"6f970cd5-361f-4011-8611-b1fba73e8e74\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"4ffebde7-0aff-4862-90c2-bf422f14214f\"), 3, new Guid(\"e0ae73cf-add1-4b8d-a3ed-5f28aaf3cb70\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"a54b1f9f-02f8-4ef4-98b0-eed803a830be\"), 5, new Guid(\"e0ae73cf-add1-4b8d-a3ed-5f28aaf3cb70\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"bc494bc3-5cf2-46f4-8891-fe96f31c3a32\"), 7, new Guid(\"a4df86e7-0096-4971-8d9c-449db4f08820\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"3d29ce62-dc95-4018-ad72-c9ab375614f8\"), 7, new Guid(\"e0ae73cf-add1-4b8d-a3ed-5f28aaf3cb70\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"fc3d411e-45d2-4e71-8900-8abdafaa2382\"), 3, new Guid(\"9ea41fb5-4692-4c3e-98dd-e1a4710e0f00\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"0669e73e-9d19-4eb0-a06f-09155dd26892\"), 5, new Guid(\"d92b63e8-0d92-4a02-9587-e533a021db86\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"10278703-cb34-4d67-a30b-70b67080ce26\"), 5, new Guid(\"fbc06924-eae3-4eef-88f4-8d335cb80b7a\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"f5b0cf42-1352-4dc0-9b15-54ec024d483c\"), 7, new Guid(\"fbc06924-eae3-4eef-88f4-8d335cb80b7a\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"a1de0a81-1e9e-4aa6-8c55-a04253830b48\"), 3, new Guid(\"9cdb5c83-6911-4091-a10e-b3e789474605\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"4bcf8144-48de-4f4e-97d9-3e47bbb237cc\"), 5, new Guid(\"9cdb5c83-6911-4091-a10e-b3e789474605\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"05fa1c6b-5ebf-4040-803f-96d8cd9ba622\"), 7, new Guid(\"9cdb5c83-6911-4091-a10e-b3e789474605\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"e0df36ff-533d-4600-8848-4de2e5245e39\"), 3, new Guid(\"7be38ef0-5b42-48c3-a4f0-3646cef3fee4\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"fbbdba3d-891b-46d2-b0b4-b4a5a033e647\"), 5, new Guid(\"7be38ef0-5b42-48c3-a4f0-3646cef3fee4\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"8ff454aa-ac04-4e26-a3b6-cb509880275a\"), 7, new Guid(\"7be38ef0-5b42-48c3-a4f0-3646cef3fee4\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"28b1de10-aae3-4711-99e8-3d630b7fd3fe\"), 3, new Guid(\"ab05b7cf-451a-4148-bd51-eadccd5daaba\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"d579337f-37a3-46ae-be1f-f00af11198e4\"), 5, new Guid(\"ab05b7cf-451a-4148-bd51-eadccd5daaba\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"26b784ab-33ae-4b4a-85c1-6fc0ffbf0157\"), 7, new Guid(\"ab05b7cf-451a-4148-bd51-eadccd5daaba\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"b2b39091-93ae-4f11-9dae-fb0ae62e43ff\"), 7, new Guid(\"d92b63e8-0d92-4a02-9587-e533a021db86\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"c83f2c76-af32-46bd-a77c-05621afed82d\"), 3, new Guid(\"6735206f-5100-4f21-8a42-c7205104c000\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"d9889f4e-6b64-4ff8-9a13-93ae8070aa02\"), 7, new Guid(\"6735206f-5100-4f21-8a42-c7205104c000\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"287f56f8-6261-44fc-a228-9152629ad33a\"), 3, new Guid(\"a98e7b61-7d4d-4384-81fd-b11ad76e8e5b\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"0a597c6a-635e-4fff-8620-81c4fe572c86\"), 5, new Guid(\"a98e7b61-7d4d-4384-81fd-b11ad76e8e5b\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"c4727953-0896-475d-9926-da1c1c3010d4\"), 7, new Guid(\"a98e7b61-7d4d-4384-81fd-b11ad76e8e5b\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"a3ea3e57-8527-42f4-b10d-ce5acbd4cb28\"), 3, new Guid(\"327dd00b-4fed-4ec3-b38c-c78c54c308f3\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"da65ebfa-10fa-4804-865f-c1366a295cda\"), 5, new Guid(\"327dd00b-4fed-4ec3-b38c-c78c54c308f3\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"935f9578-997b-4e1c-9674-d1c62071ac1b\"), 7, new Guid(\"327dd00b-4fed-4ec3-b38c-c78c54c308f3\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"e795b943-ea96-4b20-92ad-9e60afc1ed50\"), 3, new Guid(\"887cd1cb-a2d7-4404-ab52-3fdc1c8a9071\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"dfa65b5d-a245-4300-b11d-f695b916e3af\"), 5, new Guid(\"887cd1cb-a2d7-4404-ab52-3fdc1c8a9071\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"36e79c18-5682-4ab8-8aa7-137627a10588\"), 7, new Guid(\"887cd1cb-a2d7-4404-ab52-3fdc1c8a9071\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"9f076fcc-4e89-450c-8022-fdb4bb845e46\"), 3, new Guid(\"d92b63e8-0d92-4a02-9587-e533a021db86\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"67a676d7-6ee6-4f0f-bc2a-335bfba5eacd\"), 5, new Guid(\"6735206f-5100-4f21-8a42-c7205104c000\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"275d2933-335a-4200-85c3-f9fb040fc7d2\"), 3, new Guid(\"18beeee8-a10a-4052-928b-649438a5e56b\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"d51b2fe7-8749-4b49-965c-07a10318fea8\"), 5, new Guid(\"18beeee8-a10a-4052-928b-649438a5e56b\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"2efc19e0-c89d-4b73-81e6-288bad51f475\"), 7, new Guid(\"18beeee8-a10a-4052-928b-649438a5e56b\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"7ac758c7-a223-4ade-8f1f-c92b25c354e8\"), 7, new Guid(\"0836a861-57af-451b-8dc7-77d610bad733\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"c3ea61cd-b66c-45ad-80db-93eb7857f016\"), 3, new Guid(\"8572d363-11e1-4e57-87cc-48b34868c92c\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"c2ffd3e7-35c0-47c1-91db-96042f1cce96\"), 5, new Guid(\"8572d363-11e1-4e57-87cc-48b34868c92c\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"0a71eeaa-a904-4752-81bd-7e38df0475f0\"), 7, new Guid(\"8572d363-11e1-4e57-87cc-48b34868c92c\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"512891ef-7c45-455a-9a18-6e692d6acf96\"), 3, new Guid(\"9313a423-ada8-44b4-8198-286ea99e54c9\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"f47108bf-367e-4f19-a1bb-31f02f4fbd45\"), 5, new Guid(\"9313a423-ada8-44b4-8198-286ea99e54c9\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"fcd37bb7-3d66-404b-84c4-5007d97700b7\"), 7, new Guid(\"9313a423-ada8-44b4-8198-286ea99e54c9\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"c3cff1a5-913d-4598-ab0c-b7377bcd124f\"), 3, new Guid(\"3b622907-18a2-4f16-8362-0b10fd1a6b1a\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"919bf72c-62b4-4063-be26-4abd14852caf\"), 5, new Guid(\"3b622907-18a2-4f16-8362-0b10fd1a6b1a\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"690009f3-fb65-406a-b9ef-66d8c289165f\"), 7, new Guid(\"3b622907-18a2-4f16-8362-0b10fd1a6b1a\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"2908b63d-5ff8-4917-a884-48e6ff8a8a6e\"), 3, new Guid(\"bda20d97-d051-4088-92e4-7144674be54f\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"fd0c93d7-9af4-42d4-b095-cda0c8389419\"), 5, new Guid(\"0836a861-57af-451b-8dc7-77d610bad733\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"c12c8916-89af-4931-b45f-9378de0908c5\"), 5, new Guid(\"bda20d97-d051-4088-92e4-7144674be54f\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"5259d180-7adf-452b-aa90-b2c57e3970e8\"), 3, new Guid(\"5abff486-7f8d-4b5a-abb8-6e0992b76c28\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"875a6be2-efbd-4891-9c95-3f423cce5516\"), 5, new Guid(\"5abff486-7f8d-4b5a-abb8-6e0992b76c28\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"f6875ee5-c5ca-4d89-805e-a89aaf97c686\"), 7, new Guid(\"5abff486-7f8d-4b5a-abb8-6e0992b76c28\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"91a268e8-7b62-44e6-804e-8da95beba2c0\"), 3, new Guid(\"b333be74-403b-488f-b9b9-03391605972a\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"401e6ecf-4e1c-4683-9faf-0e9682f68f8b\"), 5, new Guid(\"b333be74-403b-488f-b9b9-03391605972a\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"fbc47ab6-df75-4410-817a-0a6e1e8eaaf7\"), 7, new Guid(\"b333be74-403b-488f-b9b9-03391605972a\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"a82a230d-5dcb-48b7-bf74-d5fefe8fff2d\"), 3, new Guid(\"10b29ed5-edd2-4d11-8923-270286c8a2f2\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"0bcfb9b0-9e08-4669-936b-1fe92560fc60\"), 5, new Guid(\"10b29ed5-edd2-4d11-8923-270286c8a2f2\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"e5eb8d13-9103-4786-abec-253c503b5527\"), 7, new Guid(\"10b29ed5-edd2-4d11-8923-270286c8a2f2\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"cdc9cd30-8d6e-4a3f-9aa8-837df35ce03e\"), 3, new Guid(\"9b0ea92c-c0cc-4af2-a781-3482a0e408cd\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"4bd6f7af-70ac-4aa5-94d3-e86d999fd3f4\"), 5, new Guid(\"9b0ea92c-c0cc-4af2-a781-3482a0e408cd\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"2a7e33cb-445a-48f3-84da-00b2f7f2cf06\"), 7, new Guid(\"bda20d97-d051-4088-92e4-7144674be54f\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"05676278-3f5c-426b-8696-7c51bc5f3280\"), 3, new Guid(\"0836a861-57af-451b-8dc7-77d610bad733\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"dd60da98-b019-4cd3-a508-8813b3e0d980\"), 7, new Guid(\"82259107-35ae-469a-bd6c-16d0c5db1b6c\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"b53e889e-beb3-4d7e-9f2c-49f1c0fd3201\"), 5, new Guid(\"82259107-35ae-469a-bd6c-16d0c5db1b6c\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"3cae255a-7be7-47f8-a42f-d40e965e1fb7\"), 3, new Guid(\"71685317-ca54-45a9-a0fa-dd68f230631b\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"c9c184f9-e61b-42ee-b98c-4a004b0566f7\"), 5, new Guid(\"71685317-ca54-45a9-a0fa-dd68f230631b\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"9e213ef8-bc71-408c-b52d-f45d8c9f0a82\"), 7, new Guid(\"71685317-ca54-45a9-a0fa-dd68f230631b\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"c4370007-8fab-4f9a-9f31-734e72f53d8e\"), 3, new Guid(\"41bbbd4d-bbcd-4599-95bf-74591b0fa14f\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"e9709a52-9591-44fa-be65-5794dbe16733\"), 5, new Guid(\"41bbbd4d-bbcd-4599-95bf-74591b0fa14f\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"915edd73-e21a-465e-b156-0ee65a39376c\"), 7, new Guid(\"41bbbd4d-bbcd-4599-95bf-74591b0fa14f\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"5447a366-f490-4562-829f-e9c514eb6960\"), 3, new Guid(\"9756e657-7ba2-4cfb-bb0c-c6112d78fcdf\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"adb2dfd8-6ebe-44cb-8a97-e91a247358a1\"), 5, new Guid(\"9756e657-7ba2-4cfb-bb0c-c6112d78fcdf\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"4ca8e4a3-6ef9-45a1-8c39-94360273517e\"), 7, new Guid(\"9756e657-7ba2-4cfb-bb0c-c6112d78fcdf\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"0b9f7317-4010-460f-a411-65a672536006\"), 3, new Guid(\"a77cf797-1e2d-49af-a420-23c88c0f13f4\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"b94f489b-6100-4e8c-827c-7ddcd3f19024\"), 5, new Guid(\"a77cf797-1e2d-49af-a420-23c88c0f13f4\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"5467b347-4709-420a-8bdf-cc804c6545de\"), 7, new Guid(\"a77cf797-1e2d-49af-a420-23c88c0f13f4\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"fe42f1b1-a27f-4538-a759-e0dca7d5bf96\"), 3, new Guid(\"18811716-4038-4000-8fa2-582b26d32625\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"ac4687a3-95ee-4727-a4a5-efaeab4e0300\"), 5, new Guid(\"18811716-4038-4000-8fa2-582b26d32625\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"066638e4-2887-48d5-98aa-83ba7cd5bd75\"), 7, new Guid(\"18811716-4038-4000-8fa2-582b26d32625\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"e484a61c-8507-449d-bcd7-67fdfda79eed\"), 3, new Guid(\"43b45789-13b1-4973-8cf1-b58ba11097ab\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"a0457148-5be9-4df4-8fda-d51848123023\"), 5, new Guid(\"43b45789-13b1-4973-8cf1-b58ba11097ab\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"b7d3cab3-de4f-4ed2-9e74-d01a30c6f799\"), 7, new Guid(\"43b45789-13b1-4973-8cf1-b58ba11097ab\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"390766f6-085f-451d-80be-49772db85e01\"), 3, new Guid(\"975354b2-7033-4bc3-902f-2f2579bdaf69\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"2d3ff987-3c39-4f0c-965d-b00fad494f80\"), 5, new Guid(\"975354b2-7033-4bc3-902f-2f2579bdaf69\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"e6e4773a-7572-4d71-ad66-b5ad9d40039c\"), 7, new Guid(\"975354b2-7033-4bc3-902f-2f2579bdaf69\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"a115da0f-e098-4634-b82b-d08b606e5e3c\"), 3, new Guid(\"715840b3-132f-47d3-90df-97d792ba2765\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"082ca7dd-09cd-4f6b-ba78-c63d25c16fd4\"), 5, new Guid(\"715840b3-132f-47d3-90df-97d792ba2765\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"a7e0dc40-4905-4e65-98e5-7f67ab89405f\"), 7, new Guid(\"715840b3-132f-47d3-90df-97d792ba2765\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"88cc4f93-8b07-44b7-8a09-45081a74f574\"), 3, new Guid(\"82259107-35ae-469a-bd6c-16d0c5db1b6c\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"f0dfefb4-955a-4298-a63e-9ec60ec7cdbe\"), 3, new Guid(\"fbc06924-eae3-4eef-88f4-8d335cb80b7a\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"f43b4743-a47e-44ac-aae6-0dc49f021e6b\"), 5, new Guid(\"da40c027-1474-4e8a-9f9d-0af3a450ae59\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"21286d89-4fd8-4b28-8cca-1a40f61174bd\"), 7, new Guid(\"b682185a-3324-4b39-8b5d-613092e1d217\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"e8a0eac4-3f95-430e-bf8f-b3290a236ec0\"), 3, new Guid(\"b682185a-3324-4b39-8b5d-613092e1d217\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"a473ff22-776e-4f2a-9126-b1d9192c7941\"), 3, new Guid(\"481948c4-82fe-4908-b1fc-df0711be0745\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"6827be1a-c33d-4b18-93cd-f8bcf035c865\"), 5, new Guid(\"481948c4-82fe-4908-b1fc-df0711be0745\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"ba61884c-879e-4eb5-9b4b-3945ec0103f2\"), 7, new Guid(\"481948c4-82fe-4908-b1fc-df0711be0745\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"aeebecb6-7604-42c9-adc3-805946260955\"), 3, new Guid(\"52ffd4b8-691f-4971-b30a-7bfd044abf58\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"48456253-06b0-423f-a288-bb452081480b\"), 5, new Guid(\"52ffd4b8-691f-4971-b30a-7bfd044abf58\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"e67a32b7-290c-49b1-837e-8ef68688f391\"), 7, new Guid(\"52ffd4b8-691f-4971-b30a-7bfd044abf58\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"31d78aa3-8911-48c0-95a7-f9358550278b\"), 3, new Guid(\"737fde2b-8931-4525-9811-8fd1c28d95a5\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"3c704fde-bd36-4dbc-bcf7-254c267fd1b2\"), 5, new Guid(\"737fde2b-8931-4525-9811-8fd1c28d95a5\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"735aa95a-b11d-40e8-85a0-569668a5ba33\"), 7, new Guid(\"737fde2b-8931-4525-9811-8fd1c28d95a5\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"0558a1c1-40e9-46ef-b80d-468c89726639\"), 3, new Guid(\"3c29864e-03f0-4ad4-8fe1-3b35301be267\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"ade98d90-cb43-489d-a93b-d03d00814a60\"), 5, new Guid(\"3c29864e-03f0-4ad4-8fe1-3b35301be267\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"f7ccc61b-c3d9-421f-87e8-c63b4bd63ff4\"), 7, new Guid(\"a68bf952-5254-42a2-8f48-64a1f43a5655\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"89a1f979-901a-4a5a-af52-47a0ef974a17\"), 7, new Guid(\"3c29864e-03f0-4ad4-8fe1-3b35301be267\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"d5d1bd24-10ed-4876-9f4b-9cfa4e9a81b4\"), 5, new Guid(\"10ab01f4-2bd0-4b7f-9e06-93e711c9ee05\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"aeff0b31-e8e4-410f-a541-5d8fbf7f2256\"), 7, new Guid(\"10ab01f4-2bd0-4b7f-9e06-93e711c9ee05\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"752ba181-e012-4c17-96a5-0a75e4b9ffef\"), 3, new Guid(\"dfcda794-4bc0-4fd1-9559-a6f45bb3fc45\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"16aeb265-ec12-479f-90da-8cdfbf3286d2\"), 5, new Guid(\"dfcda794-4bc0-4fd1-9559-a6f45bb3fc45\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"bf86af47-a095-4787-a41f-8b73b1aad3db\"), 7, new Guid(\"dfcda794-4bc0-4fd1-9559-a6f45bb3fc45\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"2f4bc4f5-6d9d-4fd5-a528-082892612714\"), 3, new Guid(\"f807cb10-7f3a-4797-9d19-a5a2d761df5b\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"28e5ce7e-85f9-4a34-8a80-628729b955ca\"), 5, new Guid(\"f807cb10-7f3a-4797-9d19-a5a2d761df5b\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"e627cc2a-1018-4ef2-98a9-6581ca940918\"), 7, new Guid(\"f807cb10-7f3a-4797-9d19-a5a2d761df5b\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"703c98eb-aadb-47bc-af00-a99a59cf2b9e\"), 3, new Guid(\"29f4e215-dfbf-477c-8154-98824b35bc34\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"5fb527be-eb2d-4a15-93c0-ceaf351a1c69\"), 5, new Guid(\"29f4e215-dfbf-477c-8154-98824b35bc34\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"15ea6b4f-ad59-480b-9786-3229e1b2735f\"), 7, new Guid(\"29f4e215-dfbf-477c-8154-98824b35bc34\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"7d37683e-8d9a-411d-b792-4357ec2d1943\"), 3, new Guid(\"10ab01f4-2bd0-4b7f-9e06-93e711c9ee05\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"63cf711f-0f67-4c05-8332-2f83a5be1566\"), 3, new Guid(\"28d4412b-432c-4535-b69e-a022d8509a2f\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"f08651d3-7d4c-48ec-a679-7b0bb97ae8a1\"), 5, new Guid(\"a68bf952-5254-42a2-8f48-64a1f43a5655\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"9bbbf858-b2ff-423d-9270-f388c7e980bf\"), 7, new Guid(\"ee7b8600-aeaa-4c4d-96e4-4d2f7f0812ba\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"d9b9f774-4779-4e93-8848-dd84ca59ed59\"), 7, new Guid(\"e4f971e6-5d22-4fe6-8a94-e2700406d2ee\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"96d59c97-35e2-4129-9132-86f326224ede\"), 3, new Guid(\"e7baf16f-6886-4aae-b349-b5ebe698e85c\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"cef91eaf-e1e9-43f5-b82a-645a7fbad414\"), 5, new Guid(\"e7baf16f-6886-4aae-b349-b5ebe698e85c\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"83ac3a32-bd53-4a77-8984-c61f1cbe1607\"), 7, new Guid(\"e7baf16f-6886-4aae-b349-b5ebe698e85c\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"b7fa4505-b43e-4fc9-93b3-7d0a80aa4c58\"), 3, new Guid(\"6d149337-1c11-4522-9164-501ca977fe88\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"1815f011-c2a0-458c-b104-aa9436090e30\"), 5, new Guid(\"6d149337-1c11-4522-9164-501ca977fe88\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"2567eb9c-369a-49dd-be13-4032b2f0e941\"), 7, new Guid(\"6d149337-1c11-4522-9164-501ca977fe88\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"3408e1ac-20b0-464a-a6bb-e00a8b539310\"), 3, new Guid(\"11e9cae6-58e0-4d43-aa6e-0c21d9d27550\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"93838787-378f-4ede-b708-5eb54fa0c895\"), 5, new Guid(\"11e9cae6-58e0-4d43-aa6e-0c21d9d27550\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"a256dd55-a67f-429a-ba28-51a19c79d4f6\"), 7, new Guid(\"11e9cae6-58e0-4d43-aa6e-0c21d9d27550\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"ae895483-c07f-4440-9bf4-40b42502fa54\"), 3, new Guid(\"daa40ef5-b642-4c6f-b98b-fe9694261b56\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"f7f229f2-e369-4128-a5e2-7293b1ec3cf4\"), 3, new Guid(\"a68bf952-5254-42a2-8f48-64a1f43a5655\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"5561b7c5-f4c4-43b2-a13d-c0535a0ad7d4\"), 5, new Guid(\"daa40ef5-b642-4c6f-b98b-fe9694261b56\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"a0f114ad-ff4e-4d75-8c6c-7eff5bb517ad\"), 3, new Guid(\"1fb67099-9741-445e-9b0e-a6435be17e8d\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"bf2df6db-4716-4a0f-91ce-37a6346215e6\"), 5, new Guid(\"1fb67099-9741-445e-9b0e-a6435be17e8d\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"e4b7f02a-90b7-4992-b928-244a71758af8\"), 7, new Guid(\"1fb67099-9741-445e-9b0e-a6435be17e8d\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"18f5a7f0-49b3-4a76-aad4-fbd67e97b3d9\"), 3, new Guid(\"3aced6bd-d757-44fa-b306-5363628ea1d9\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"90edd6c5-435a-45a0-ac3a-d2c38c8bf312\"), 5, new Guid(\"3aced6bd-d757-44fa-b306-5363628ea1d9\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"5a952f60-3238-4cfc-85cb-225afc60d8d8\"), 7, new Guid(\"3aced6bd-d757-44fa-b306-5363628ea1d9\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"a14fd38f-8028-4b9d-9329-f819400c11bb\"), 3, new Guid(\"a14ce044-b009-45b5-95d8-ddc8a3f62e8c\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"f9d2b090-defe-47a9-8117-5fb581524e35\"), 5, new Guid(\"a14ce044-b009-45b5-95d8-ddc8a3f62e8c\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"1eab51ab-1c8d-4af5-963c-4200e0521d3c\"), 7, new Guid(\"a14ce044-b009-45b5-95d8-ddc8a3f62e8c\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"65a30f46-94d1-493f-a64b-f87f4e70f640\"), 3, new Guid(\"ee7b8600-aeaa-4c4d-96e4-4d2f7f0812ba\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"f7aa05b2-8ea9-49ba-a3d7-8de001a2a3c8\"), 5, new Guid(\"ee7b8600-aeaa-4c4d-96e4-4d2f7f0812ba\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"f82068b7-8bea-4141-86b8-df2afb35fa08\"), 7, new Guid(\"daa40ef5-b642-4c6f-b98b-fe9694261b56\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"80cb5e8b-0b94-4275-a1ab-bbfac68f349d\"), 5, new Guid(\"28d4412b-432c-4535-b69e-a022d8509a2f\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"6c98f077-a19e-47d0-9ecd-64294842c6ac\"), 7, new Guid(\"28d4412b-432c-4535-b69e-a022d8509a2f\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"5c7646d8-7bed-4bda-9c32-ed7300f19364\"), 3, new Guid(\"6c0c8e00-c91b-4cc2-93b7-24548acfb659\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"e41226d9-9459-4b48-bdb9-6835cfd63b86\"), 3, new Guid(\"75f7c677-ecea-4ed5-b368-1637c91ff3c2\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"b331bfc9-4f2f-4d21-b8e0-edaed9c8eef8\"), 5, new Guid(\"75f7c677-ecea-4ed5-b368-1637c91ff3c2\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"3e87703b-0721-4282-8b51-faaaa0a3c2dd\"), 7, new Guid(\"75f7c677-ecea-4ed5-b368-1637c91ff3c2\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"790df7ca-0595-4fce-aa13-1dcdc33688ba\"), 3, new Guid(\"f6c12f57-2aa8-4898-a34c-dc2991cb0db2\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"c7c13571-908c-4a76-b7fa-a4ebf741dbf4\"), 5, new Guid(\"f6c12f57-2aa8-4898-a34c-dc2991cb0db2\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"5e990578-c3cb-429d-82e6-c7b4f5e292c8\"), 7, new Guid(\"f6c12f57-2aa8-4898-a34c-dc2991cb0db2\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"e595d670-6edc-4cec-91d1-6efa2d889fe2\"), 3, new Guid(\"46b604c2-3b3d-4e02-b8a4-4064d60fc8da\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"53709597-9fd9-43b8-b903-c43b7d7df531\"), 5, new Guid(\"46b604c2-3b3d-4e02-b8a4-4064d60fc8da\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"ada4d1f7-5a1d-4363-9ea6-c7ae6755d9df\"), 7, new Guid(\"46b604c2-3b3d-4e02-b8a4-4064d60fc8da\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"82190531-6b27-40f0-a451-092b87c4fa74\"), 3, new Guid(\"59b6913b-391b-4d76-9c6e-74631a78b6a4\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"50cd3ebf-2b53-47eb-ba26-a3c4304aea4a\"), 5, new Guid(\"59b6913b-391b-4d76-9c6e-74631a78b6a4\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"d4b3c5ab-116e-44cf-972e-9e90f3dd591d\"), 7, new Guid(\"17155aa4-d7c6-44ef-a014-1ba8e6eb0391\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"f5f18582-bed5-475f-aaab-2be765e715cc\"), 7, new Guid(\"59b6913b-391b-4d76-9c6e-74631a78b6a4\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"254b4c34-72d0-442b-ad5c-969863abd40c\"), 5, new Guid(\"7fec1393-aa07-4230-bf44-b466b36363df\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"041c3996-09e1-4cbe-934d-60d04fee53ae\"), 7, new Guid(\"7fec1393-aa07-4230-bf44-b466b36363df\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"a4fddefb-3605-43de-bd25-6a3a0f6d0d9b\"), 3, new Guid(\"a72d1d93-31f4-4e05-a18a-0a3d1d5aec5d\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"4b6df2bd-1fa4-488e-a36d-c3858c6d6e23\"), 5, new Guid(\"a72d1d93-31f4-4e05-a18a-0a3d1d5aec5d\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"7f410420-15b4-4b37-8717-100c7ad6fb6a\"), 7, new Guid(\"a72d1d93-31f4-4e05-a18a-0a3d1d5aec5d\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"d311a6e0-5b61-41ae-8bd6-28dab7d719bd\"), 3, new Guid(\"65feb170-5c6a-42e6-b803-fe0b8d89e2ac\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"d797ae95-cf69-4ae1-b347-b5a8992b0ebf\"), 5, new Guid(\"65feb170-5c6a-42e6-b803-fe0b8d89e2ac\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"d23b4c8f-9ac2-4528-9db2-1551c49d852e\"), 7, new Guid(\"65feb170-5c6a-42e6-b803-fe0b8d89e2ac\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"b861ad6f-4103-47f7-bff3-cb343d53e45f\"), 3, new Guid(\"c62253b3-cd91-4525-9f10-e926087b1d47\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"35e08502-6dde-4e82-9ffb-bbd5bc1df232\"), 5, new Guid(\"c62253b3-cd91-4525-9f10-e926087b1d47\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"c7ceea47-8636-49eb-ae09-281885f09f4f\"), 7, new Guid(\"c62253b3-cd91-4525-9f10-e926087b1d47\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"56ac66bd-e144-48df-905d-26ea8e7ac813\"), 3, new Guid(\"7fec1393-aa07-4230-bf44-b466b36363df\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"d83a2976-9577-4e00-bce7-fb5ebe3a3490\"), 5, new Guid(\"17155aa4-d7c6-44ef-a014-1ba8e6eb0391\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"6dfb5f96-c5bd-441c-a5bf-73dc8b7bede3\"), 3, new Guid(\"17155aa4-d7c6-44ef-a014-1ba8e6eb0391\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"971720b8-86aa-46dc-b961-4d8dedfcdb94\"), 7, new Guid(\"cfc980d0-fe17-4d8a-a34a-64205d7a3313\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"72eedd0f-a225-4909-8e39-f22565e43b0b\"), 5, new Guid(\"6c0c8e00-c91b-4cc2-93b7-24548acfb659\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"802a4600-8c1f-4f38-9fab-8661eb1f8000\"), 7, new Guid(\"6c0c8e00-c91b-4cc2-93b7-24548acfb659\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"27f6f5ec-c919-441e-b25d-287f3493ab78\"), 3, new Guid(\"32c59626-e6e9-47bb-b1a9-0f328519ca40\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"071d8bfa-a812-49aa-ae0d-c49c7a51bf7b\"), 5, new Guid(\"32c59626-e6e9-47bb-b1a9-0f328519ca40\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"e2f1545d-f0f3-455e-aed2-ded11d312480\"), 7, new Guid(\"32c59626-e6e9-47bb-b1a9-0f328519ca40\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"bdfb5c34-0715-422d-80bf-52383e65e10d\"), 3, new Guid(\"554b9f53-082b-4fa1-83c7-398e59b8ebd5\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"c748db7d-c079-4b2f-83e2-b7fc49ad1f2c\"), 5, new Guid(\"554b9f53-082b-4fa1-83c7-398e59b8ebd5\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"e01b8a3f-387c-4645-b4ff-eab31483f7e1\"), 7, new Guid(\"554b9f53-082b-4fa1-83c7-398e59b8ebd5\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"ac856b4a-97e9-4db9-bf2a-4b0cd8a3c5a9\"), 3, new Guid(\"b59c3df0-9351-4f0a-ba94-e223a56e7fc8\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"c19d9239-2aa9-411b-b35b-de1512ee1745\"), 5, new Guid(\"b59c3df0-9351-4f0a-ba94-e223a56e7fc8\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"752af513-6b3d-4090-8667-2610c6af9fa6\"), 7, new Guid(\"b59c3df0-9351-4f0a-ba94-e223a56e7fc8\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"247fce0e-a2cf-450d-8e54-89015b4579a6\"), 3, new Guid(\"1c2a3f75-f726-44f3-9082-3dd199cbfea6\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"978a142a-3572-4be4-9439-0ec88636f074\"), 5, new Guid(\"1c2a3f75-f726-44f3-9082-3dd199cbfea6\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"7c2e2e34-2630-42a3-b425-cba402856b86\"), 7, new Guid(\"1c2a3f75-f726-44f3-9082-3dd199cbfea6\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"1d6f53bf-8029-4f9d-aab0-79fa2d3bee3c\"), 3, new Guid(\"4c50914c-e15d-4653-b1f4-c60d8d3ab301\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"9f6a97ab-dd6e-4d02-9498-8700bd3857a5\"), 5, new Guid(\"4c50914c-e15d-4653-b1f4-c60d8d3ab301\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"1218ab7a-ca59-43b0-b6df-f051dd02fae7\"), 7, new Guid(\"4c50914c-e15d-4653-b1f4-c60d8d3ab301\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"6ed54d0b-08d2-4cad-a942-b51fd8a6bb68\"), 3, new Guid(\"3a34e9c2-b749-451c-a47c-70560ac375b1\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"2a70ba92-ae46-489f-9ed9-8136ba83af34\"), 5, new Guid(\"3a34e9c2-b749-451c-a47c-70560ac375b1\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"5b912078-ddd5-4130-a280-16c0f3c324cf\"), 7, new Guid(\"3a34e9c2-b749-451c-a47c-70560ac375b1\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"9abe8098-ce70-459a-abdd-855cebcc7a6b\"), 3, new Guid(\"ebbb15a2-c36a-441a-92b2-77a615e76496\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"2f939750-914f-45d5-a49e-ef2616720431\"), 5, new Guid(\"ebbb15a2-c36a-441a-92b2-77a615e76496\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"c4bdd123-c460-433e-893c-8933c701ed79\"), 7, new Guid(\"ebbb15a2-c36a-441a-92b2-77a615e76496\"), new Guid(\"a3a14389-e3e4-4402-a690-c6dfb3efcb94\") },\n                    { new Guid(\"ee0ab35f-ed0e-42a1-afe5-19f4794a5127\"), 3, new Guid(\"cfc980d0-fe17-4d8a-a34a-64205d7a3313\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"d01fca65-23b0-45d3-afe3-93c5d21834e4\"), 5, new Guid(\"cfc980d0-fe17-4d8a-a34a-64205d7a3313\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") },\n                    { new Guid(\"82445059-70d6-4456-83c3-b042a887dddd\"), 5, new Guid(\"b682185a-3324-4b39-8b5d-613092e1d217\"), new Guid(\"8d45b436-5842-40f9-80d8-80656978d5a4\") },\n                    { new Guid(\"5829c074-1c80-4d7c-8d87-0ceaab165ae5\"), 3, new Guid(\"da40c027-1474-4e8a-9f9d-0af3a450ae59\"), new Guid(\"df7eb6ca-f570-49d6-bbfe-5833dc3e9f1f\") }\n                });\n\n            migrationBuilder.CreateIndex(\n                name: \"IX_Racks_BuildingId_Order\",\n                table: \"Racks\",\n                columns: new[] { \"BuildingId\", \"Order\" },\n                unique: true);\n\n            migrationBuilder.CreateIndex(\n                name: \"IX_Shelves_RackId\",\n                table: \"Shelves\",\n                column: \"RackId\");\n\n            migrationBuilder.CreateIndex(\n                name: \"IX_StorageUnits_ShelfId\",\n                table: \"StorageUnits\",\n                column: \"ShelfId\");\n\n            migrationBuilder.CreateIndex(\n                name: \"IX_StorageUnits_UnitId\",\n                table: \"StorageUnits\",\n                column: \"UnitId\");\n        }\n\n        protected override void Down(MigrationBuilder migrationBuilder)\n        {\n            migrationBuilder.DropTable(\n                name: \"StorageUnits\");\n\n            migrationBuilder.DropTable(\n                name: \"Shelves\");\n\n            migrationBuilder.DropTable(\n                name: \"Units\");\n\n            migrationBuilder.DropTable(\n                name: \"Racks\");\n\n            migrationBuilder.DropTable(\n                name: \"Buildings\");\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnusedPrivateMember.TopLevelStatements.cs",
    "content": "﻿using System;\n\nint a = 0;\nint b = 1;\nConsole.WriteLine(b);\n\nProduct c = new(\"name\", 1);\nProduct d = new(\"name\", 2);\nConsole.WriteLine(d);\n\npublic record Product(string Name, int CategoryId);\n\npublic record Record\n{\n    private int a; // Noncompliant {{Remove the unused private field 'a'.}}\n\n    private int b;\n    public int B() => b;\n\n    private nint Value { get; init; }\n    private nint UnusedValue { get; init; } // Noncompliant\n\n    public Record Create() => new() { Value = 1 };\n\n    private interface IFoo // Noncompliant\n    {\n        public void Bar() { }\n    }\n\n    private record Nested(string Name, int CategoryId);\n\n    public void UseNested()\n    {\n        Nested d = new(\"name\", 2);\n    }\n\n    private record Nested2(string Name, int CategoryId);\n\n    public void UseNested2()\n    {\n        _ = new Nested2(\"name\", 2);\n    }\n\n    private record UnusedNested1(string Name, int CategoryId);   // Noncompliant\n    internal record UnusedNested2(string Name, int CategoryId);  // Noncompliant\n    public record UnusedNested3(string Name, int CategoryId);\n\n    private int usedInPatternMatching = 1;\n\n    public int UseInPatternMatching(int val) =>\n        val switch\n        {\n            < 0 => usedInPatternMatching,\n            >= 0 => 1\n        };\n\n    private class LocalFunctionAttribute : Attribute { }\n\n    public void Foo()\n    {\n        [LocalFunction]\n        static void Bar()\n        { }\n    }\n}\n\npublic class TargetTypedNew\n{\n    private TargetTypedNew(int arg)\n    {\n        var x = arg;\n    }\n\n    private TargetTypedNew(string arg) // Noncompliant - FP\n    {\n        var x = arg;\n    }\n\n    public static TargetTypedNew Create()\n    {\n        return new(42);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnusedPrivateMember.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\nusing System.Runtime.Serialization;\nusing System.Threading.Tasks;\n\npublic class MyAttribute : Attribute { }\n\nclass UnusedPrivateMember\n{\n    public static void Main() { }\n\n    private class MyOtherClass\n    { }\n\n    private class MyClass\n    {\n        internal MyClass(int i)\n        {\n            var x = (MyOtherClass)null;\n            x = x as MyOtherClass;\n            Console.WriteLine();\n        }\n    }\n\n    private class Gen<T> : MyClass\n    {\n        public Gen() : base(1)\n        {\n            Console.WriteLine();\n        }\n\n        public Gen(int i) : this() // Noncompliant {{Remove unused constructor of private type 'Gen'.}}\n        {\n            Console.WriteLine();\n        }\n    }\n\n    public UnusedPrivateMember()\n    {\n        MyProperty = 5;\n        MyEvent += UnusedPrivateMember_MyEvent;\n        MyUsedEvent += UnusedPrivateMember_MyUsedEvent;\n        new Gen<int>();\n    }\n\n    private void UnusedPrivateMember_MyUsedEvent(object sender, EventArgs e)\n    {\n        throw new NotImplementedException();\n    }\n\n    private void UnusedPrivateMember_MyEvent()\n    {\n        field3 = 5;\n        throw new NotImplementedException();\n    }\n\n    private int field, field2; // Noncompliant\n//  ^^^^^^^^^^^^^^^^^^^^^^^^^^\n    private\n        int field3, // Noncompliant {{Remove this unread private field 'field3' or refactor the code to use its value.}}\n            field4; // Noncompliant;\n//          ^^^^^^\n    private int Property // Noncompliant {{Remove the unused private property 'Property'.}}\n    {\n        get; set;\n    }\n    private void Method() { } // Noncompliant {{Remove the unused private method 'Method'.}}\n//               ^^^^^^\n    private class Class { }// Noncompliant {{Remove the unused private class 'Class'.}}\n//                ^^^^^\n    private struct Struct { }// Noncompliant {{Remove the unused private struct 'Struct'.}}\n//                 ^^^^^^\n    private delegate void Delegate();\n    private delegate void Delegate2(); // Noncompliant {{Remove the unused private delegate 'Delegate2'.}}\n    private event Delegate Event; //Noncompliant {{Remove the unused private event 'Event'.}}\n    private event Delegate MyEvent; //Noncompliant {{Remove this unread private field 'MyEvent' or refactor the code to use its value.}}\n    private int[][] array = new int[0][];\n    private Dictionary<int, int> used = new Dictionary<int, int>();\n    private Dictionary<int, int> unused = new Dictionary<int, int>(); // Noncompliant\n\n    [MyAttribute] void PrivateMethodWithAttribute() { } // Compliant: due to the attribute\n\n    public int GetValue(int x, int y) => array[x][y];\n\n    public int GetItem(int i) => used[i];\n\n    private Dictionary<int, int> GetDictionary() => null;\n\n    public int GetDictionaryItem(int i) => GetDictionary()[i];\n\n    private event EventHandler<EventArgs> MyOtherEvent //Noncompliant {{Remove the unused private event 'MyOtherEvent'.}}\n    {\n        add { }\n        remove { }\n    }\n\n    private event EventHandler<EventArgs> MyUsedEvent\n    {\n        add { }\n        remove { }\n    }\n\n    private int MyProperty\n    {\n        get;\n        set;\n    }\n\n    [My]\n    private class Class1 { }\n\n    private class Class2\n    {\n        private Class2() // Compliant\n        {\n        }\n        private Class2(int i) // Noncompliant {{Remove the unused private constructor 'Class2'.}}\n        {\n            new Class2(\"\").field2 = 3;\n        }\n        private Class2(string i)\n        {\n        }\n        public int field; // Noncompliant {{Remove the unused private field 'field'.}}\n        public int field2; // Noncompliant {{Remove this unread private class field 'field2' or refactor the code to use its value.}}\n    }\n\n    private interface MyInterface\n    {\n        void Method();\n    }\n    private class Class3 : MyInterface // Noncompliant {{Remove the unused private class 'Class3'.}}\n    {\n        public void Method() { var x = this[20]; }\n        public void Method1() { var x = Method2(); } // Noncompliant {{Remove the unused private method 'Method1'.}}\n        public static int Method2() { return 2; }\n\n        public int this[int index]\n        {\n            get { return 42; }\n        }\n    }\n\n    internal class Class4 : MyInterface // Noncompliant {{Remove the unused internal class 'Class4'.}}\n    {\n        public void Method() { }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/6699\n    public void MethodUsingLocalMethod()\n    {\n        LocalMethod();\n\n        void LocalMethod()\n        {\n        }\n\n        void UnusedLocalMethod() // Noncompliant {{Remove the unused private local function 'UnusedLocalMethod'.}}\n        {\n        }\n    }\n}\n\nclass NewClass1\n{\n    // See https://github.com/SonarSource/sonar-dotnet/issues/888\n    static async Task Main() // Compliant - valid main method since C# 7.1\n    {\n        Console.WriteLine(\"Test\");\n    }\n}\n\nclass NewClass2\n{\n    static async Task<int> Main() // Compliant - valid main method since C# 7.1\n    {\n        Console.WriteLine(\"Test\");\n\n        return 1;\n    }\n}\n\nclass NewClass3\n{\n    static async Task Main(string[] args) // Compliant - valid main method since C# 7.1\n    {\n        Console.WriteLine(\"Test\");\n    }\n}\n\nclass NewClass4\n{\n    static async Task<int> Main(string[] args) // Compliant - valid main method since C# 7.1\n    {\n        Console.WriteLine(\"Test\");\n\n        return 1;\n    }\n}\n\nclass NewClass5\n{\n    static async Task<string> Main(string[] args) // Noncompliant\n    {\n        Console.WriteLine(\"Test\");\n\n        return \"ok\";\n    }\n}\n\npublic static class MyExtension\n{\n    private static void MyMethod<T>(this T self) { \"\".MyMethod<string>(); }\n}\n\npublic class NonExactMatch\n{\n    private static void M(int i) { }    // Compliant, might be called\n    private static void M(string i) { } // Compliant, might be called\n\n    public static void Call(dynamic d)\n    {\n        M(d);\n    }\n}\n\npublic class EventHandlerSample\n{\n    private void MyOnClick(object sender, EventArgs args) { } // Compliant\n}\n\npublic partial class EventHandlerSample1\n{\n    private void MyOnClick(object sender, EventArgs args) { } // Compliant, event handlers in partial classes are not reported\n}\n\npublic class PropertyAccess\n{\n    private int OnlyRead { get; set; }                                              // Noncompliant {{Remove the unused private set accessor in property 'OnlyRead'.}}\n//                              ^^^\n    private int OnlySet { get; set; }\n    private int OnlySet2 { get { return 42; } set { } }                             // Noncompliant {{Remove the unused private get accessor in property 'OnlySet2'.}}\n//                         ^^^\n    private int NotAccessed { get; set; }                                           // Noncompliant {{Remove the unused private property 'NotAccessed'.}}\n//              ^^^^^^^^^^^\n    public int PrivateGetter { private get; set; }                                  // Noncompliant {{Remove the unused private getter 'get_PrivateGetter'.}}\n//                             ^^^^^^^^^^^^\n    public int PrivateSetter { get; private set; }                                  // Noncompliant {{Remove the unused private setter 'set_PrivateSetter'.}}\n//                                  ^^^^^^^^^^^^\n    private int ExpressionBodiedProperty => 1;                                      // Noncompliant {{Remove the unused private property 'ExpressionBodiedProperty'.}}\n//              ^^^^^^^^^^^^^^^^^^^^^^^^\n    private int ExpressionBodiedProperty2 { get => 1; }                             // Noncompliant\n    private int ExpressionBodiedProperty3 { set => _ = value; }                     // Noncompliant\n    private int ExpressionBodiedProperty4 { get => 1; set => _ = value; }           // Noncompliant\n    private int ExpressionBodiedProperty5 { get => 1; set => _ = value; }           // Noncompliant\n//                                          ^^^\n    private int ExpressionBodiedProperty6 { get => 1; set => _ = value; }           // Noncompliant\n//                                                    ^^^\n    public int ExpressionBodiedProperty7 { private get => 1; set => _ = value; }    // Noncompliant\n    public int ExpressionBodiedProperty8 { get => 1; private set => _ = value; }    // Noncompliant\n\n    private int BothAccessed { get; set; }\n\n    private int OnlyGet { get { return 42; } }\n\n    public void M()\n    {\n        Console.WriteLine(OnlyRead);\n        OnlySet = 42;\n        (this.OnlySet2) = 42;\n\n        BothAccessed++;\n\n        int? x = 10;\n        x = this?.OnlyGet;\n\n        ExpressionBodiedProperty5 = 0;\n        Console.WriteLine(ExpressionBodiedProperty6);\n    }\n}\n\npublic class Indexer1\n{\n    private int this[int i] => 1;                                       // Noncompliant\n//              ^^^^\n}\n\npublic class Indexer2\n{\n    private int this[int i] { get => 1; }                               // Noncompliant\n}\n\npublic class Indexer3\n{\n    private int this[int i] { set => _ = value; }                       // Noncompliant\n}\n\npublic class Indexer4\n{\n    private int this[int i] { get { return 1; } set { _ = value; } }    // Noncompliant\n//              ^^^^\n}\n\npublic class Indexer5\n{\n    private int this[int i] { get { return 1; } set { _ = value; } }    // Noncompliant\n//                                              ^^^\n\n    public void Method()\n    {\n        Console.WriteLine(this[0]);\n    }\n}\n\npublic class Indexer6\n{\n    private int this[int i] { get { return 1; } set { _ = value; } }    // Noncompliant\n//                            ^^^\n\n    public void Method()\n    {\n        this[0] = 42;\n    }\n}\n\n[Serializable]\npublic sealed class GoodException : Exception\n{\n    public GoodException()\n    {\n    }\n    public GoodException(string message)\n        : base(message)\n    {\n    }\n    public GoodException(string message, Exception innerException)\n        : base(message, innerException)\n    {\n    }\n    private GoodException(SerializationInfo info, StreamingContext context) // Compliant because of the serialization\n        : base(info, context)\n    {\n    }\n}\n\npublic class FieldAccess\n{\n    private object field1;\n    private object field2; // Noncompliant {{Remove this unread private field 'field2' or refactor the code to use its value.}}\n    private object field3;\n\n    public FieldAccess()\n    {\n        this.field2 = field3 ?? this.field1?.ToString();\n    }\n}\n\n// As S4487 will raise when a private field is written and not read, S1450 won't raise on these cases\n// These tests where finding issues before with S1450 and should find them with S4487 now\npublic class TestsFormerS1450\n{\n    private int F1 = 0; // Noncompliant {{Remove this unread private field 'F1' or refactor the code to use its value.}}\n\n    public void M1()\n    {\n        ((F1)) = 42;\n    }\n\n    private int F5 = 0; // Noncompliant {{Remove this unread private field 'F5' or refactor the code to use its value.}}\n    private int F6; // Noncompliant {{Remove this unread private field 'F6' or refactor the code to use its value.}}\n    public void M2()\n    {\n        F5 = 42;\n        F6 = 42;\n    }\n\n    private int F14 = 0; // Noncompliant {{Remove this unread private field 'F14' or refactor the code to use its value.}}\n    public void M6(int F14)\n    {\n        this.F14 = 42;\n    }\n    private int F28 = 42; // Noncompliant {{Remove this unread private field 'F28' or refactor the code to use its value.}}\n    public event EventHandler E1\n    {\n        add\n        {\n            F28 = 42;\n        }\n        remove\n        {\n        }\n    }\n\n    private int F36; // Noncompliant {{Remove this unread private field 'F36' or refactor the code to use its value.}}\n    public void M15(int i) => F36 = i + 1;\n}\n\npublic class OutAndRef\n{\n    private int F37; // Noncompliant {{Remove this unread private field 'F37' or refactor the code to use its value.}}\n    public void M37() => int.TryParse(\"1\", out F37);\n\n    private int F38;\n    public void M38() => Modify(ref F38);\n\n    public void Modify(ref int x) => x = 37;\n\n    private int F39; // Noncompliant {{Remove the unused private field 'F39'.}}\n    public void M39()\n    {\n        int.TryParse(\"1\", out var x);\n        int.TryParse(\"1\", out var F39);\n    }\n}\n\ninternal class MyClass\n{\n    protected MyClass() // Compliant\n    {\n        var a = 1;\n    }\n}\n\ninternal class MyClass2\n{\n    private MyClass2() // Noncompliant {{Remove the unused private constructor 'MyClass2'.}}\n    {\n        var a = 1;\n    }\n}\n\npublic interface IPublicInterface { }\n[Serializable]\npublic sealed class PublicClass : IPublicInterface\n{\n    public static readonly PublicClass Instance = new PublicClass();\n\n    private PublicClass()\n    {\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/8342\nclass Repro_8342\n{\n    [Private1] public void APublicMethod() => APrivateMethodCalledByAPublicMethod();\n    [Private2] internal void AnInternalMethod() { }\n    [Private3] protected void AProtectedMethod() { }\n    [Private4] private void APrivateMethodCalledByAPublicMethod() { }\n\n    private class Private1Attribute : Attribute { }\n    private class Private2Attribute : Attribute { }\n    private class Private3Attribute : Attribute { }\n    private class Private4Attribute : Attribute { }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/8532\n[Serializable]\npublic class Repro_8532\n{\n    private string serializedField;                             // Compliant\n    private string serializedReadWriteProperty { get; set; }    // Compliant\n    private string nonSerializedReadOnlyProperty => \"\";         // Noncompliant\n    [NonSerialized] private string nonSerializedProperty;       // Noncompliant\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/9219\nclass Repro_9219\n{\n    [MyAttribute]\n    public bool AttributeOnProperty\n    {\n        get;\n        private set; // Compliant\n    }\n\n    public bool AttributeOnPropertyGetter\n    {\n        [MyAttribute]\n        private get; // Compliant\n        set;\n    }\n\n    public bool AttributeOnPropertySetter\n    {\n        get;\n        [MyAttribute]\n        private set; // Compliant\n    }\n\n    public bool AttributeOnPropertyNoncompliant\n    {\n        [MyAttribute]\n        get;\n        private set; // Noncompliant\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/9432\nnamespace Repro_9432\n{\n    partial class OuterClass\n    {\n        public void MethodUsesNestedStruct()\n        {\n            NestedClass.NestedStruct x;\n        }\n\n        private static class NestedClass\n        {\n            // https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.structlayoutattribute\n            [StructLayout(LayoutKind.Sequential)]\n            internal struct NestedStruct\n            {\n                public int Field;                       // Compliant: the unused field can be used to control the physical layout of struct in the memory\n                public int Property { get; set; }       // Noncompliant: https://stackoverflow.com/questions/28488057/what-is-the-structlayoutattribute-effect-on-properties-in-c\n                public int CalculatedProperty => 42;    // Noncompliant\n                public void Method() { }                // Noncompliant\n                public struct UnusedNestedType { }      // Noncompliant\n            }\n        }\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/6990\nnamespace Repro_6990\n{\n    public class ChildEventArgs : EventArgs\n    {\n        // Some properties\n    }\n\n    public class InheritedEvent : EventArgs\n    {\n        // Some properties\n    }\n\n    public class SenderObject\n    {\n        // Some things\n    }\n\n    public class Consumer\n    {\n        static void SenderObject_WithChildEvent(SenderObject senderObject, ChildEventArgs e) // Compliant\n        {\n            // Logic\n        }\n\n        static void SenderObject_WithChildEvent(SenderObject senderObject, InheritedEvent e) // Compliant\n        {\n            // Logic\n        }\n\n        static void Comsumer_WithChildEvent(object sender, ChildEventArgs e) // Compliant\n        {\n            // Logic\n        }\n    }\n\n    public class CollectionInitializerUsage\n    {\n        private Compliant items = new Compliant { 1, 2, 3 };\n        private AlsoCompliant also => new AlsoCompliant { 1, 2, 3 };\n        private NonCompliant others = new NonCompliant();\n        private CompliantDictionary dict = new CompliantDictionary { { 1, 1 }, { 2, 2 } };\n        private NonCompliantDictionary otherDict = new NonCompliantDictionary() // This initializer uses the indexer setter and not the Add method.\n        {\n            [1] = 1,\n            [2] = 2\n        };\n\n        private class Compliant : IEnumerable\n        {\n            internal void Add(int item) { } // Compliant, called by collection initializer above\n            public IEnumerator GetEnumerator() => null;\n        }\n\n        private class AlsoCompliant : Compliant\n        {\n            internal void Add(int item) { } // Compliant, called by collection initializer above\n        }\n\n        private class NonCompliant : IEnumerable\n        {\n            internal void Add(int item) { } // Noncompliant\n            public IEnumerator GetEnumerator() => null;\n        }\n\n        private class CompliantDictionary : Dictionary<int, int>\n        {\n            internal void Add(int key, int value) { } // Compliant, called by collection initializer above\n        }\n\n        private class NonCompliantDictionary : Dictionary<int, int>\n        {\n            internal void Add(int key, int value) { } // Noncompliant\n        }\n\n        public void UseFields()\n        {\n            var x = items;\n            var y = also;\n            var z = others;\n            var q = dict;\n            var w = otherDict;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnusedPrivateMember.part1.cs",
    "content": "﻿namespace SonarCheck\n{\n    public partial class Partial\n    {\n        void DoWork() // Noncompliant\n        {\n            Initialize();\n        }\n        partial void Initialize();\n    }\n\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnusedPrivateMember.part2.cs",
    "content": "﻿namespace SonarCheck\n{\n    partial class Partial\n    {\n        void Used() { }\n\n        partial void Initialize()\n        {\n            Used();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnusedReturnValue.Latest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\ninterface InterfaceWithDefaultImplementation\n{\n    int SomeMethod() // Compliant, part of the interface\n    {\n        return 42;\n    }\n}\n\nclass SomeClass : InterfaceWithDefaultImplementation\n{\n    public void Test()\n    {\n        ((InterfaceWithDefaultImplementation)this).SomeMethod();\n    }\n}\n\nclass StaticLocalFunctions\n{\n    public void Test()\n    {\n        GetNumberStatic1();\n        var result2 = GetNumberStatic3();\n        GetNumberStatic4(1);\n        GetNumberStaticExpression();\n    }\n\n    static int GetNumberStatic1() { return 42; } // Noncompliant\n    static int GetNumberStatic2() { return 42; } // Compliant -  local functions are outside the scope of this rule\n    static int GetNumberStatic3() { return 42; }\n    static int GetNumberStatic4(int neverUsedVal) { return neverUsedVal; } // Noncompliant\n    static int GetNumberStaticExpression() => 42; // Noncompliant\n}\n\nnamespace Tests.Diagnostics\n{\n    public class UnusedReturnValue\n    {\n        private interface If\n        {\n            static abstract int MyMethodIf();\n        }\n\n        private class Nested : If\n        {\n            public static int MyMethodIf() { return 5; } // Compliant, part of the interface\n\n            public void Test()\n            {\n                Nested.MyMethodIf();\n            }\n        }\n\n        private static int MyMethod() { return 42; } // Noncompliant {{Change return type to 'void'; not a single caller uses the returned value.}}\n//                     ^^^\n        private int MyMethod1() { return 42; } // Compliant, unused, S1144 also reports on it\n        private int MyMethod2() { return 42; }\n        private int MyMethod3() { return 42; }\n        private void MyMethod4() { return; }\n\n        public void Test()\n        {\n            MyMethod();\n            MyMethod4();\n            var i = MyMethod2();\n            Action<int> a = (x) => MyMethod();\n            Func<int> f = () => MyMethod3();\n            SomeGenericMethod<object>();\n\n            SomeGenericMethod2<UnusedReturnValue>();\n            var o = SomeGenericMethod2<object>();\n        }\n\n        private T SomeGenericMethod<T>() where T : class { return null; } // Noncompliant\n        private T SomeGenericMethod2<T>() where T : class { return null; }\n    }\n}\n\npublic static class Extensions\n{\n    public class Sample\n    {\n        public void Test()\n        {\n            this.NonCompliant();\n            var x = this.Compliant();\n        }\n    }\n\n    extension(Sample s)\n    {\n        private int NonCompliant() => 42; // FN https://sonarsource.atlassian.net/browse/NET-2829\n        private int Compliant() => 42;\n    }\n}\n\npublic class FieldKeyword\n{\n    private int Compliant() => 42;\n    public int Prop\n    {\n        get { return field; }\n        set { field = Compliant(); }\n    }\n}\n\npublic class NullConditionalAssignment\n{\n    public class Sample\n    {\n        public int Value { get; set; }\n        private int Compliant() => 42;\n\n        public void Test()\n        {\n            this?.Value = Compliant();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnusedReturnValue.Partial.cs",
    "content": "﻿public partial class Partial\n{\n    void CallGetValue1()\n    {\n        new CallbackUser(myVal => GetValue1());\n    }\n\n    void CallGetValue2()\n    {\n        GetValue2();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnusedReturnValue.TopLevelStatements.cs",
    "content": "﻿using System;\nusing System.Threading.Tasks;\n\nint MyMethod() { return 42; } // Noncompliant {{Change return type to 'void'; not a single caller uses the returned value.}}\nint MyMethod2() { return 42; }\n\nasync Task MyAsyncMethod() { return; }\n\nMyMethod();\nMyAsyncMethod();\nvar i = MyMethod2();\nAction<int> a = (x) => MyMethod();\nSomeGenericMethod<object>();\nvar o = SomeGenericMethod2<object>();\n\nT SomeGenericMethod2<T>() where T : class { return null; }\nT SomeGenericMethod<T>() where T : class { return null; } // Compliant\n\nnew RecordStruct().MyMethod();\ni = new RecordStruct().MyMethod2();\n\nnew PositionalRecordStruct(42).MyMethod();\ni = new PositionalRecordStruct(42).MyMethod2();\n\nnew Record().MyMethod();\ni = new Record().MyMethod2();\n\nnew PositionalRecord(42).MyMethod();\ni = new PositionalRecord(42).MyMethod2();\n\nint NeverUsed(int neverUsedVal) // There should be at least an invocation in order to raise the issue.\n{\n    return neverUsedVal;\n}\n\nrecord struct RecordStruct\n{\n    public int MyMethod() { return 42; } // Compliant\n    public int MyMethod2() { return 42; }\n\n    public void Test()\n    {\n        SomeGenericMethod<object>();\n\n        SomeGenericMethod2<object>();\n        var o = SomeGenericMethod2<object>();\n    }\n\n    private T SomeGenericMethod<T>() where T : class { return null; } // Noncompliant {{Change return type to 'void'; not a single caller uses the returned value.}}\n    private T SomeGenericMethod2<T>() where T : class { return null; }\n}\n\nrecord struct PositionalRecordStruct(int SomeProperty)\n{\n    public int MyMethod() { return 42; } // Compliant\n    public int MyMethod2() { return 42; }\n\n    public void Test()\n    {\n        SomeGenericMethod<object>();\n\n        SomeGenericMethod2<object>();\n        var o = SomeGenericMethod2<object>();\n    }\n\n    private T SomeGenericMethod<T>() where T : class { return null; } // Noncompliant {{Change return type to 'void'; not a single caller uses the returned value.}}\n    private T SomeGenericMethod2<T>() where T : class { return null; }\n}\n\nrecord Record\n{\n    public int MyMethod() { return 42; } // Compliant\n    public int MyMethod2() { return 42; }\n\n    public void Test()\n    {\n        SomeGenericMethod<object>();\n\n        SomeGenericMethod2<object>();\n        var o = SomeGenericMethod2<object>();\n    }\n\n    private T SomeGenericMethod<T>() where T : class { return null; } // Noncompliant\n    private T SomeGenericMethod2<T>() where T : class { return null; }\n}\n\nrecord PositionalRecord(int SomeProperty)\n{\n    public int MyMethod() { return 42; } // Compliant\n    public int MyMethod2() { return 42; }\n\n    public void Test()\n    {\n        SomeGenericMethod<object>();\n\n        SomeGenericMethod2<object>();\n        var o = SomeGenericMethod2<object>();\n    }\n\n    private T SomeGenericMethod<T>() where T : class { return null; } // Noncompliant\n    private T SomeGenericMethod2<T>() where T : class { return null; }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnusedReturnValue.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\n\nnamespace Tests.Diagnostics\n{\n    public class UnusedReturnValue\n    {\n        private interface If\n        {\n            int MyMethodIf();\n        }\n\n        private class Nested : If\n        {\n            int If.MyMethodIf() { return 5; } // Compliant, part of the interface\n\n            public void Test()\n            {\n                ((If)this).MyMethodIf();\n            }\n        }\n\n        private int MyMethod() { return 42; } // Noncompliant {{Change return type to 'void'; not a single caller uses the returned value.}}\n//              ^^^\n        private int MyMethod1() { return 42; } // Compliant, unused, S1144 also reports on it\n        private int MyMethod2() { return 42; }\n        private int MyMethod3() { return 42; }\n        private void MyMethod4() { return; }\n        private int MyMethod5(int neverUsedVal) => neverUsedVal; // Noncompliant\n        private int MyMethod6(int neverUsedVal) // Noncompliant\n        {\n            return neverUsedVal;\n        }\n\n        private async Task MyAsyncMethod() { return; }\n\n        public void Test()\n        {\n            MyMethod();\n            MyMethod4();\n            MyMethod5(1);\n            MyMethod6(1);\n            MyAsyncMethod();\n            var i = MyMethod2();\n            Action<int> a = (x) => MyMethod();\n            Func<int> f = () => MyMethod3();\n            SomeGenericMethod<object>();\n\n            SomeGenericMethod2<UnusedReturnValue>();\n            var o = SomeGenericMethod2<object>();\n        }\n\n        private T SomeGenericMethod<T>() where T : class { return null; } // Noncompliant\n        private T SomeGenericMethod2<T>() where T : class { return null; }\n    }\n\n    public struct UnusedReturnValueInStruct\n    {\n        private int MyMethod() { return 42; } // Noncompliant\n        public void Test()\n        {\n            MyMethod();\n        }\n    }\n\n    public class WithLocalFunctions\n    {\n        int MyProperty\n        {\n            get\n            {\n                GetNumber();\n                return 42;\n\n                int GetNumber() { return 42; } // Noncompliant\n            }\n        }\n\n        public void Method(IEnumerable<string> myEnumerable)\n        {\n            GetNumber1();\n            VoidFunction();\n            var result1 = GetNumber3();\n\n            myEnumerable.Select(GetNumber4);\n\n            GetNumber5(1);\n\n            int GetNumber1() { return 42; } // Noncompliant {{Change return type to 'void'; not a single caller uses the returned value.}}\n//          ^^^\n            int GetNumber2() { return 42; } // Compliant - unused local functions are outside the scope of this rule\n            int GetNumber3() { return 42; }\n            int GetNumber4(string myParam) { return 42; }\n            int GetNumber5(int neverUsedVal) { return neverUsedVal; } // Noncompliant\n\n            void VoidFunction() { return; }\n        }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/7429\n    public class Repro7429\n    {\n        void Method(AnInterface foo)\n        {\n            Func(0);\n            foo?.DoSomething(Func);\n\n            bool Func(int value) => true; // Noncompliant, FP\n        }\n\n        void Method()\n        {\n            Func(0);\n            Func2(Func);\n\n            bool Func(int value) => true; // Noncompliant, FP\n            void Func2(Func<int, bool> method) { }\n        }\n\n        public interface AnInterface\n        {\n            void DoSomething(Func<int, bool> method);\n        }\n    }\n}\n\npublic partial class Partial\n{\n    private int GetValue1()\n    {\n        return 1;\n    }\n\n    private int GetValue2() // Noncompliant\n    {\n        return 1;\n    }\n}\npublic class CallbackUser\n{\n    public CallbackUser(Func<int, int> getValue) { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnusedStringBuilder.Latest.cs",
    "content": "﻿using System.Text;\n\npublic class MyClass\n{\n    public void MyMethod(StringBuilder builder) // Compliant\n    {\n        StringBuilder builder1 = new(); // Compliant\n\n        StringBuilder builder2 = new(); // Noncompliant\n//                    ^^^^^^^^^^^^^^^^\n\n        StringBuilder builder3 = new(); // Noncompliant\n        builder3.Append(builder1.ToString());\n\n        (StringBuilder, StringBuilder) builder4 = (new(), new()); // FN\n\n        StringBuilder builderInLine1 = new(), builderInLine2 = new();\n//                    ^^^^^^^^^^^^^^^^^^^^^^                            Noncompliant\n//                                            ^^^^^^^^^^^^^^^^^^^^^^    Noncompliant@-1\n\n        static void LocalStaticMethod()\n        {\n            StringBuilder builder2 = new StringBuilder(); // Compliant\n            var a = builder2.Length;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnusedStringBuilder.cs",
    "content": "﻿using System.Text;\n\npublic class Program\n{\n    public StringBuilder MyMethod(StringBuilder builder, string myString) // Compliant\n    {\n        StringBuilder sb1 = GetStringBuilder(); // Compliant\n\n        var sb2 = new StringBuilder(); // Compliant\n        ExternalMethod(sb2);\n\n        var sb3 = new StringBuilder(); // Compliant\n        LocalMethod(sb3);\n\n        var sb4 = new StringBuilder(); // Compliant\n\n        StringBuilder sb5 = new StringBuilder(); // Noncompliant {{Remove this \"StringBuilder\"; \".ToString()\" is never called.}}\n//                    ^^^^^^^^^^^^^^^^^^^^^^^^^\n        var sb6 = new StringBuilder(); // Noncompliant\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^\n\n        StringBuilder sb7 = new StringBuilder(); // Noncompliant\n        sb7.Append(sb4.ToString());\n\n        StringBuilder sb8 = new StringBuilder(); // Compliant\n        StringBuilder sb9 = new StringBuilder(); // Noncompliant\n        sb9 = sb8;\n\n        StringBuilder sb10 = new StringBuilder(); // Noncompliant FP see https://github.com/SonarSource/sonar-dotnet/issues/6747\n        sb10.ToStringAndFree();\n\n        if (true)\n        {\n            if (true)\n            {\n                if (true)\n                {\n                    if (true)\n                    {\n                        if (true)\n                        {\n                            var buildernested = new StringBuilder(); // Noncompliant\n                        }\n                    }\n                }\n            }\n        }\n\n        (StringBuilder, StringBuilder) builderTuple = (new StringBuilder(), new StringBuilder()); // FN\n\n        StringBuilder builderInLine1 = new StringBuilder(), builderInLine2 = new StringBuilder();\n//                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                          Noncompliant\n//                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^    Noncompliant@-1\n\n\n        StringBuilder builderCfg = new StringBuilder(); // FN (requires use of cfg with significant impact on performance)\n        if (false)\n        {\n            builderCfg.ToString();\n        }\n\n        StringBuilder builderCalls = new StringBuilder(); // Noncompliant\n        builderCalls.Append(\"Append\");\n        builderCalls.AppendLine(\"AppendLine\");\n        builderCalls.Replace(\"\\r\\n\", \"\\n\");\n        builderCalls.Clear();\n        builderCalls.GetType();\n\n        StringBuilder mySbField = new StringBuilder(); // Noncompliant\n        MyClass myClass = new MyClass();\n        myClass.mySbField.ToString();\n\n        var builderReturn = new StringBuilder(); // Compliant\n        return builderReturn;\n\n        void LocalMethod(StringBuilder local)\n        {\n            local.ToString();\n        }\n    }\n\n    public StringBuilder GetStringBuilder() => // Compliant\n        new StringBuilder();\n\n    public void ExternalMethod(StringBuilder builder) { } // Compliant\n\n    public string AnotherMethod()\n    {\n        var builder = new StringBuilder(); // Compliant\n        return $\"{builder} is ToStringed here\";\n    }\n\n    public void Interpolation_InAssignment()\n    {\n        var builder = new StringBuilder(); // Compliant\n        var text = $\"{builder} is ToStringed here\";\n    }\n\n    public void Scoping()\n    {\n        {\n            var sb = new StringBuilder(); // Noncompliant\n        }\n        {\n            var sb = new StringBuilder();\n            sb.ToString();\n        }\n    }\n\n    public string CompoundAdd()\n    {\n        var sb = new StringBuilder();   // Compliant\n        sb.Append(\"Lorem ipsum\");\n        string ret = \"\";\n        ret += sb;\n        return ret;\n    }\n\n    public string MyProperty\n    {\n        get\n        {\n            var builder1 = new StringBuilder(); // Noncompliant\n            var builder2 = new StringBuilder(); // Compliant\n            return builder2.ToString();\n        }\n    }\n\n    private StringBuilder myField = new StringBuilder(); // Compliant\n}\n\npublic class MyClass\n{\n    public StringBuilder mySbField = new StringBuilder();\n}\n\npublic static class StringBuilderExtensions\n{\n    public static string ToStringAndFree(this StringBuilder sb) => string.Empty;\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/7324\npublic class Repro_7324\n{\n    public string Concat_Prefix()\n    {\n        var sb = new StringBuilder();   // Compliant\n        sb.Append(\"Lorem ipsum\");\n        var ret = \"Prefix: \" + sb;\n        return ret;\n    }\n\n    public string Concat_Infix()\n    {\n        var sb = new StringBuilder();   // Compliant\n        sb.Append(\"Lorem ipsum\");\n        var ret = \"Prefix: \" + sb + \" suffix\";\n        return ret;\n    }\n\n    public string Concat_Suffix()\n    {\n        var sb = new StringBuilder();   // Compliant\n        sb.Append(\"Lorem ipsum\");\n        var ret = sb + \" suffix\";\n        return ret;\n    }\n\n    public string Concat_OutsideDeclaration()\n    {\n        var sb = new StringBuilder();   // Compliant\n        sb.Append(\"Lorem ipsum\");\n        string ret;\n        ret = \"Prefix: \" + sb;\n        return ret;\n    }\n\n    // Repro for NET-3001\n    public void Concat_InAssignment()\n    {\n        var prefix = \"Prefix: \";\n        var sb = new StringBuilder(); // Compliant\n        var ret = prefix + sb;\n    }\n\n    public void Concat_MultipleIdentifiers_InAssignment()\n    {\n        var a1 = \"a1 \";\n        var a2 = \"a2 \";\n        var a3 = \"a3 \";\n        var sb = new StringBuilder(); // Compliant\n        var ret = a1 + a2 + sb + a3;\n    }\n\n    public void Concat_InInvocation(string value)\n    {\n        var prefix = \"Prefix: \";\n        var sb = new StringBuilder(); // Compliant\n        Concat_InInvocation(prefix + sb);\n    }\n}\n\npublic class NullConditionalOperator\n{\n    public void Method()\n    {\n        StringBuilder compliant = new StringBuilder(); // Compliant https://sonarsource.atlassian.net/browse/NET-2832\n        StringBuilder AlsoCompliant = new StringBuilder();\n        var y = compliant?.ToString();\n        var z = AlsoCompliant.ToString();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UnusedStringBuilder.vb",
    "content": "﻿Imports System.Text\n\nPublic Class Program\n    Public Function NotUsed(ByVal builder As StringBuilder) As StringBuilder\n        Dim builder1 As StringBuilder = GetStringBuilder()  ' Compliant\n        Dim builder2 = New StringBuilder()                  ' Compliant\n        ExternalMethod(builder2)\n        Dim builder3 As StringBuilder = New StringBuilder() ' Compliant\n        builder3.ToString()\n        Dim builder4 = New StringBuilder()                  ' Compliant\n        Dim builder5 As StringBuilder = New StringBuilder() ' Noncompliant\n        Dim builder6 = New StringBuilder()                  ' Noncompliant\n        Dim builder7 As StringBuilder = New StringBuilder() ' Noncompliant\n        builder7.Append(builder4.ToString())\n        Dim builder8 As StringBuilder = New StringBuilder() ' Compliant\n        builder8.Append(\"&\").ToString()\n\n        Dim builderInLine1 As StringBuilder = New StringBuilder(), builderInLine2 As StringBuilder = New StringBuilder()\n        '   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                           Noncompliant\n        '                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^    Noncompliant@-1\n\n        Dim sb1, sb2 ' Compliant\n        Dim sb3, sb4 As StringBuilder = New StringBuilder() ' Error [BC30671]: Explicit initialization is not permitted with multiple variables declared with a single type specifier.\n\n        Dim sb5 As StringBuilder = New StringBuilder() ' Compliant\n        Dim sb6 As StringBuilder = New StringBuilder() ' Noncompliant\n        sb6 = sb5\n\n        Dim builderCfg As StringBuilder = New StringBuilder() ' FN (requires use of cfg with significant impact on performance)\n        If False Then\n            builderCfg.ToString()\n        End If\n\n        Dim builderCalls As StringBuilder = New StringBuilder() ' Noncompliant\n        builderCalls.Append(\"Append\")\n        builderCalls.AppendLine(\"AppendLine\")\n        builderCalls.Replace(\"a\", \"b\")\n        builderCalls.Clear()\n\n        Dim builderCalls2 As StringBuilder = New StringBuilder() ' Compliant\n        builderCalls2.Remove(builderCalls2.Length - 1, 1)\n\n        Dim mySbField As StringBuilder = New StringBuilder()    ' Noncompliant\n        Dim [myClass] As [MyClass] = New [MyClass]()\n        [myClass].mySbField.ToString()\n\n        Dim builderReturn = New StringBuilder()                 ' Compliant\n        Return builderReturn\n    End Function\n\n    Public Function GetStringBuilder() As StringBuilder     ' Compliant\n        Return New StringBuilder()\n    End Function\n\n    Public Sub ExternalMethod(ByVal builder As StringBuilder) ' Compliant\n    End Sub\n\n    Public Function AnotherMethod() As String\n        Dim builder = New StringBuilder() ' Compliant\n        Return $\"{builder} is ToStringed here\"\n    End Function\n\n    Public ReadOnly Property MyProperty As String\n        Get\n            Dim builder1 = New StringBuilder()              ' Noncompliant\n            Dim builder2 = New StringBuilder()              ' Compliant\n            Return builder2.ToString()\n        End Get\n    End Property\n\n    Private myField As StringBuilder = New StringBuilder() ' Compliant\nEnd Class\n\nPublic Class [MyClass]\n    Public mySbField As StringBuilder = New StringBuilder()\nEnd Class\n\n' https://github.com/SonarSource/sonar-dotnet/issues/8809\nPublic Class GH8809\n    Public Function ToString() As String\n        Dim builder As New StringBuilder() ' FN\n        builder.AppendLine(\"value\")\n\n        Return String.Empty\n    End Function\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UriShouldNotBeHardcoded.AspNet.cs",
    "content": "﻿using System.Web;\nusing System.Web.Mvc;\nusing static System.Web.HttpContext;\n\nnamespace Tests.Diagnostics\n{\n    public class AspDotNetController : Controller\n    {\n        public ActionResult Foo()\n        {\n            string virtualPath = \"~/scripts/relative.js\"; // Compliant\n            Server.MapPath(virtualPath);\n\n            // System.Web.Mvc.HttpServerUtilityBase\n            Server.MapPath(\"~/scripts/relative.js\");\n            Server.MapPath(\"/scripts/absolute.js\");\n            Server.MapPath(@\"C:\\path\\stuff.txt\"); // Noncompliant (n.b. method will throw exception)\n\n            // System.Web.Mvc.HttpRequestBase\n            Request.MapPath(\"~/scripts/relative.js\");\n            Request.MapPath(\"/scripts/absolute.jss\");\n            Request.MapPath(@\"C:\\path\\stuff.txt\"); // Noncompliant (n.b. method will throw exception)\n\n            // System.Web.Mvc.HttpResponseBase\n            Response.ApplyAppPathModifier(\"~/scripts/relative.js\");\n            Response.ApplyAppPathModifier(\"/scripts/absolute.js\");\n            Response.ApplyAppPathModifier(@\"C:\\path\\stuff.txt\"); // Noncompliant\n\n            // System.Web.VirtualPathUtility (all methods)\n            VirtualPathUtility.GetDirectory(\"~/scripts/relative.js\");\n            VirtualPathUtility.IsAppRelative(\"/scripts/absolute.js\");\n            VirtualPathUtility.GetExtension(\"/scripts/absolute.js\");\n            // ...\n            VirtualPathUtility.GetFileName(@\"C:\\path\\stuff.txt\"); // Noncompliant (n.b. method will throw exception)\n            VirtualPathUtility.Combine(\"root\", @\"C:\\path\\stuff.txt\"); // Noncompliant\n            // ...\n\n            // System.Web.Mvc.UrlHelper\n            UrlHelper urlHelper = new UrlHelper(Current.Request.RequestContext);\n            urlHelper.Content(\"~/scripts/relative.js\");\n            urlHelper.Content(\"/scripts/absolute.js\");\n            urlHelper.Content(@\"C:\\path\\stuff.txt\"); // Noncompliant\n\n            return View();\n        }\n\n        public void Bar()\n        {\n            var scriptPath1 = \"~/bundles/jquery\"; // should not raise\n            var scriptPath2 = \"~/Scripts/jquery-{version}.js\"; // should not raise\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UriShouldNotBeHardcoded.AspNetCore.cs",
    "content": "﻿using System.IO;\nusing Microsoft.AspNetCore.Mvc;\nusing Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Routing;\n\nnamespace Tests.Diagnostics\n{\n    public class DotNetCoreController : Controller\n    {\n        public IActionResult Bar(Microsoft.AspNetCore.Routing.IRouter router)\n        {\n            new Microsoft.AspNetCore.Mvc.VirtualFileResult(@\"C:\\path\\stuff.txt\", \"text/javascript\"); // Noncompliant\n            new Microsoft.AspNetCore.Routing.VirtualPathData(router, @\"C:\\path\\stuff.txt\"); // Noncompliant\n\n            new Microsoft.AspNetCore.Mvc.VirtualFileResult(\"/scripts/file.js\", \"text/javascript\");\n            new Microsoft.AspNetCore.Routing.VirtualPathData(router, \"/my/path\");\n            return View();\n        }\n\n        public void Foo(IRouteBuilder routeBuilder)\n        {\n            routeBuilder.MapAreaRoute(\"/route/x\", \"area\", \"~/route/y\");\n            System.Console.WriteLine(\"/unix/path\"); // Compliant - we ignore unix paths\n        }\n\n        public void Paths()\n        {\n            new System.IO.FileStream(\"/unix/path\", FileMode.CreateNew); // FN\n            System.IO.File.Create(\"~/unix/path\"); // FN\n            System.IO.Directory.Delete(@\"C:\\path\\\"); // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UriShouldNotBeHardcoded.Exceptions.cs",
    "content": "﻿using System.Xml;\n\npublic class RuleExceptions\n{\n    // Repro for https://github.com/SonarSource/sonar-dotnet/issues/8967\n    static XmlNamespaceManager CreateNamespaceManager()\n    {\n        var namespaceManager = new XmlNamespaceManager(new NameTable());\n        namespaceManager.AddNamespace(\"ffc\", \"http://www.redacted.com/namespaces/ffc\"); // Noncompliant FP\n        namespaceManager.AddNamespace(\"dex\", \"http://www.redacted.com/namespaces/dex\"); // Noncompliant FP\n        return namespaceManager;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UriShouldNotBeHardcoded.Latest.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Collections.Generic;\n\nclass PrimaryConstructor(\n    string ctorParamUri = \"file://blah.txt\", // Noncompliant\n    string ctorParam = \"file://blah.txt\") // Compliant\n{\n    void Method(\n        string methodParamUri = \"file://blah.txt\", // Noncompliant\n        string methodParam = \"file://blah.txt\") // Compliant\n    {\n        var lambda = (string lambdaParamUri = \"file://blah.txt\") => lambdaParamUri; // Noncompliant\n        var lambda2 = (string lambdaParam = \"file://blah.txt\") => lambdaParam; // Compliant\n\n        var lambdaMultipleNoncompliances = (string paramUri1 = \"file://blah.txt\", string paramUri2 = \"file://blah.txt\") => paramUri1;\n        //                                                     ^^^^^^^^^^^^^^^^^\n        //                                                                                           ^^^^^^^^^^^^^^^^^@-1\n    }\n}\n\nstruct PrimaryConstructorStruct(\n    string ctorParamUri = \"file://blah.txt\", // Noncompliant\n    string ctorParam = \"file://blah.txt\") // Compliant\n{\n}\n\nrecord class PrimaryConstructorRecordClass(\n    string ctorParamUri = \"file://blah.txt\", // Noncompliant\n    string ctorParam = \"file://blah.txt\") // Compliant\n{\n}\n\nrecord struct PrimaryConstructorRecordStruct(\n    string ctorParamUri = \"file://blah.txt\", // Noncompliant\n    string ctorParam = \"file://blah.txt\") // Compliant\n{\n}\n\n// https://github.com/SonarSource/sonar-dotnet/pull/8146\nclass Repro_8146\n{\n    void Method()\n    {\n        IList<string> uris1 = new[] { \"C:/test.txt\" }; // Noncompliant\n        IList<string> uris2 = [\"C:/test.txt\"]; // Noncompliant\n        IList<string> uris3 = new List<string> { \"file://blah.txt\" }; // Noncompliant\n        var uris4 = new string[1] { \"C:/test.txt\" }; // Noncompliant\n        var uris5 = new[] { \"C:/test.txt\" }; // Noncompliant\n        string[] uris6 = [\"C:/test.txt\"]; // Noncompliant\n        string[][] urisMatrix1 = [[\"C:/test.txt\"]]; // Noncompliant\n        IDictionary<string, string> urisDict = new Dictionary<string, string> { [\"a\"] = \"C:/test.txt\" }; // FN\n        IDictionary<string, string> urisDict2 = new Dictionary<string, string> { [\"urisDict2\"] = \"C:/test.txt\" }; // FN\n\n        IList<string> paths = new[] { \"c:\\\\blah.txt\" }; // Noncompliant\n        IList<string> files = new[] { \"file://blah.txt\" }; // Noncompliant\n        IList<string> urls = new[] { \"http://www.mywebsite.com\" }; // Noncompliant\n        IList<string> urns = new[] { \"http://bar.html\" }; // Noncompliant\n    }\n}\n\npublic class TestCases\n{\n    public void RawStrings()\n    {\n        var fileLiteral = \"\"\"file://blah.txt\"\"\"; // Noncompliant {{Refactor your code not to use hardcoded absolute paths or URIs.}}\n//                        ^^^^^^^^^^^^^^^^^^^^^\n\n        var webUri1 = \"\"\"http://www.mywebsite.com\"\"\"; // Noncompliant\n        var windowsDrivePath1 = \"\"\"c:\\\\blah\\\\blah\\\\blah.txt\"\"\"; // Noncompliant\n        var windowsSharedDrivePath1 = \"\"\"\\\\my-network-drive\\folder\\file.txt\"\"\"; // Noncompliant\n        var x = new Uri(\"\"\"C:/test.txt\"\"\"); // Noncompliant\n\n        var unixPath1 = \"\"\"/my/other/folder\"\"\"; // Compliant - we ignore unix paths by default\n        var unixPath2 = \"\"\"~/blah/blah/blah.txt\"\"\"; // Compliant\n        var unixPath3 = \"\"\"~\\\\blah\\\\blah\\\\blah.txt\"\"\"; // Compliant\n        var windowsPathStartingWithVariable = \"\"\"%AppData%\\\\Adobe\"\"\";\n    }\n\n    public void SpanMatch(Span<char> span, ReadOnlySpan<char> readonlySpan, string simpleString)\n    {\n        var URI = span is \"\"\"\\\\my-network-drive\\folder\\file.txt\"\"\"             // Noncompliant\n                || readonlySpan is \"\"\"\\\\my-network-drive\\folder\\file.txt\"\"\"    // Noncompliant\n                || simpleString is @\"\\\\my-network-drive/folder/file.txt\";      // Noncompliant\n    }\n\n    public void ListPattern(string[] uris)\n    {\n        bool pathFlag = uris is [\"\"\"\\\\my-network-drive\\folder\\file.txt\"\"\"]; // Noncompliant\n    }\n\n    public void Utf8()\n    {\n        var utf8uri = \"file://blah.txt\"u8; // Noncompliant\n        var utf8 = \"file://blah.txt\"u8;\n        var utf8uriRaw = \"\"\"file://blah.txt\"\"\"u8; // Noncompliant\n        var utf8Raw = \"\"\"file://blah.txt\"\"\"u8;\n    }\n}\n\npublic class CSharp13\n{\n    public void EschapeChar()\n    {\n        var fileLiteral = \"file://blah\\e.txt\"; // Noncompliant {{Refactor your code not to use hardcoded absolute paths or URIs.}}\n//                        ^^^^^^^^^^^^^^^^^^^\n\n        var webUri1 = \"http://www.mywebsite.com\\e\"; // Noncompliant\n        var windowsDrivePath1 = \"c:\\\\blah\\\\blah\\\\bla\\eh.txt\"; // Noncompliant\n        var windowsSharedDrivePath1 = \"\"\"\\\\my-n\\eetwork-drive\\folder\\file.txt\"\"\"; // Noncompliant\n        var x = new Uri(\"C:/t\\eest.txt\"); // Noncompliant\n\n        var unixPath1 = \"/my/other/fold\\eer\"; // Compliant - we ignore unix paths by default\n        var unixPath2 = \"~/blah/blah/blah\\e.txt\"; // Compliant\n        var unixPath3 = \"~\\\\blah\\\\blah\\\\blah.\\etxt\"; // Compliant\n        var windowsPathStartingWithVariable = \"%AppData%\\\\Adobe\\e\";\n    }\n}\n\npublic static class Extensions\n{\n    extension(string)\n    {\n        public static string FilePath => \"c:\\\\blah\\\\blah\\\\blah.txt\";    // FN https://sonarsource.atlassian.net/browse/NET-2833\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UriShouldNotBeHardcoded.cs",
    "content": "﻿using System;\nusing System.IO;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        void InvalidCases(string s1, string s2)\n        {\n            var fileLiteral = \"file://blah.txt\"; // Noncompliant {{Refactor your code not to use hardcoded absolute paths or URIs.}}\n//                            ^^^^^^^^^^^^^^^^^\n\n            var webUri1 = \"http://www.mywebsite.com\"; // Noncompliant\n            var webUri2 = \"https://www.mywebsite.com\"; // Noncompliant\n            var webUri3 = \"ftp://www.mywebsite.com\"; // Noncompliant\n\n            var windowsDrivePath1 = \"c:\\\\blah\\\\blah\\\\blah.txt\"; // Noncompliant\n            var windowsDrivePath2 = \"C:\\\\blah\\\\blah\\\\blah.txt\"; // Noncompliant\n            var windowsDrivePath3 = \"C:/blah/blah/blah.txt\"; // Noncompliant\n            var windowsDrivePath4 = @\"C:\\blah\\blah\\blah.txt\"; // Noncompliant\n            var windowsDrivePath5 = @\"C:\\%foo%\\Documents and Settings\\file.txt\"; // Noncompliant\n\n            var windowsSharedDrivePath1 = @\"\\\\my-network-drive\\folder\\file.txt\"; // Noncompliant\n            var windowsSharedDrivePath2 = @\"\\\\my-network-drive\\Documents and Settings\\file.txt\"; // Noncompliant\n            var windowsSharedDrivePath3 = \"\\\\\\\\my-network-drive\\\\folder\\\\file.txt\"; // Noncompliant\n            var windowsSharedDrivePath4 = @\"\\\\my-network-drive\\%foo%\\file.txt\"; // Noncompliant\n            var windowsSharedDrivePath5 = @\"\\\\my-network-drive/folder/file.txt\"; // Noncompliant\n\n            IComparable compatibleTypeUri = \"ftp://www.mywebsite.com\"; // Noncompliant\n\n            var unixPath1 = \"/my/other/folder\"; // Compliant - we ignore unix paths by default\n            var unixPath2 = \"~/blah/blah/blah.txt\"; // Compliant\n            var unixPath3 = \"~\\\\blah\\\\blah\\\\blah.txt\"; // Compliant\n\n            var concatWithDelimiterPath1 = s1 + \"\\\\\" + s2; // Noncompliant {{Remove this hardcoded path-delimiter.}}\n//                                              ^^^^\n            var concatWithDelimiterUri2 = s1 + @\"\\\" + s2; // Noncompliant\n            var concatWithDelimiterUri3 = s1 + \"/\" + s2; // Noncompliant\n            var concatWithDelimiterUriOnLeft = \"/\" + s2; // Noncompliant\n\n            var x = new Uri(\"C:/test.txt\"); // Noncompliant\n            new Uri(new Uri(\"../stuff\"), (\"C:/test.txt\")); // Noncompliant\n            File.OpenRead(@\"\\\\drive\\foo.csv\"); // Noncompliant\n\n            // We don't support non-English variable names. This is happening due to the way the rule checks against\n            // a small set of predefined words that do not include translations.\n            var unixChemin = \"/my/other/folder\"; // Compliant - we ignore unix paths by default\n            var webChemin = \"http://www.mywebsite.com\"; // FN\n            var windowsChemin = \"c:\\\\blah\\\\blah\\\\blah.txt\"; // FN\n\n            var literalConcat = \"http://\" + \"example.com\"; // FN\n            string GetPath() => \"C:/test.txt\"; // FN\n\n            // The rule only checks the string literals that are [arguments in methods/constructors] or [assignment]\n            bool ReturnStatement(string uri)\n            {\n                return uri is \"\\\\my-network-drive\\folder\\file.txt\"; // FN\n            }\n\n\n            bool ExpressionBody(string uri) =>\n                uri is \"\\\\my-network-drive\\folder\\file.txt\"; // FN\n        }\n\n        void ValidCases(string s)\n        {\n            var windowsPathStartingWithVariable = \"%AppData%\\\\Adobe\";\n            var windowsPathWithVariable = \"%appdata%\";\n\n            var relativePath1 = \"./my/folder\";\n            var relativePath2 = @\".\\my\\folder\";\n            var relativePath3 = @\"..\\..\\Documents\";\n            var relativePath4 = @\"../../Documents\";\n            var file = \"file.txt\";\n\n            var driveLetterPath = \"C:\";\n\n            var concat1 = s + \"\\\\\" + s;\n        }\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/7815\nclass ReproFN_7815\n{\n    class MyClass\n    {\n        public string FilePath { get; set; }\n    }\n\n    void Method()\n    {\n        var myClass = new MyClass\n        {\n            FilePath = \"/my/other/folder\" // Compliant - we ignore unix paths by default\n        };\n\n        var myClass2 = new MyClass\n        {\n            FilePath = @\"\\\\my-network-drive\\folder\\file.txt\" // Noncompliant\n        };\n\n        var myClass3 = new MyClass\n        {\n            FilePath = \"http://www.mywebsite.com\" // Noncompliant\n        };\n\n        var myClass4 = new MyClass\n        {\n            FilePath = \"c:\\\\blah\\\\blah\\\\blah.txt\" // Noncompliant\n        };\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/8169\nclass Repro_8169\n{\n    void Method()\n    {\n        (string, string) uris1 = (\"C:/test.txt\", \"C:/test.txt\");       // FN\n        (string uri, string) a = (\"C:/test.txt\", \"C:/test.txt\");       // FN, first\n        (string uri, string uri2) a1 = (\"C:/test.txt\", \"C:/test.txt\"); // FN, first and second\n        (string uri, string uri2) = (\"C:/test.txt\", \"C:/test.txt\");    // FN, first and second\n        (string uri, string) uris = (\"C:/test.txt\", \"C:/test.txt\");    // FN, first and second\n        (string b, (string uri, string c)) a2 = (\"C:/test.txt\", (\"C:/test.txt\", \"C:/test.txt\")); // FN, second\n    }\n}\n\npublic class Properties\n{\n    public string FilePath => \"c:\\\\blah\\\\blah\\\\blah.txt\";               // FN https://sonarsource.atlassian.net/browse/NET-2833\n    public string FilePath2 { get; set; } = \"c:\\\\blah\\\\blah\\\\blah.txt\"; // FN https://sonarsource.atlassian.net/browse/NET-2833\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UriShouldNotBeHardcoded.vb",
    "content": "﻿Imports System\nImports System.IO\n\nClass Program\n    Private Sub InvalidCases(s1 As String, s2 As String, Optional methodParamUri As String = \"file://blah.txt\") ' Noncompliant\n        Dim fileLiteral = \"file://blah.txt\" ' Noncompliant {{Refactor your code not to use hardcoded absolute paths or URIs.}}\n'                         ^^^^^^^^^^^^^^^^^\n        Dim webUri1 = \"http://www.mywebsite.com\" ' Noncompliant\n        Dim webUri2 = \"https://www.mywebsite.com\" ' Noncompliant\n        Dim webUri3 = \"ftp://www.mywebsite.com\" ' Noncompliant\n        Dim windowsDrivePath1 = \"c:\\blah\\blah\\blah.txt\" ' Noncompliant\n        Dim windowsDrivePath2 = \"C:\\blah\\blah\\blah.txt\" ' Noncompliant\n        Dim windowsDrivePath3 = \"C:/blah/blah/blah.txt\" ' Noncompliant\n        Dim windowsDrivePath4 = \"C:\\blah\\blah\\blah.txt\" ' Noncompliant\n        Dim windowsDrivePath5 = \"C:\\%foo%\\Documents and Settings\\file.txt\" ' Noncompliant\n        Dim windowsSharedDrivePath1 = \"\\\\my-network-drive\\folder\\file.txt\" ' Noncompliant\n        Dim windowsSharedDrivePath2 = \"\\\\my-network-drive\\Documents and Settings\\file.txt\" ' Noncompliant\n        Dim windowsSharedDrivePath3 = \"\\\\my-network-drive\\folder\\file.txt\" ' Noncompliant\n        Dim windowsSharedDrivePath4 = \"\\\\my-network-drive\\%foo%\\file.txt\" ' Noncompliant\n        Dim windowsSharedDrivePath5 = \"\\\\my-network-drive/folder/file.txt\" ' Noncompliant\n        Dim unixPath1 = \"/my/other/folder\" ' Compliant - we ignore Unix paths by default\n        Dim unixPath2 = \"~/blah/blah/blah.txt\" ' Compliant - we ignore Unix paths\n        Dim unixPath3 = \"~\\blah\\blah\\blah.txt\" ' Compliant - we ignore Unix paths\n        Dim concatWithDelimiterUri2 = s1 & \"\\\" & s2 ' Noncompliant\n        Dim concatWithDelimiterUri3 = s1 & \"/\" & s2 ' Noncompliant\n'                                          ^^^\n        Dim concatWithDelimiterUri4 = s1 + \"\\\" + s2 ' Noncompliant\n        Dim concatWithDelimiterUri5 = s1 + \"/\" + s2 ' Noncompliant\n        Dim concatWithDelimiterUriOnLeft = \"/\" + s2 ' Noncompliant\n\n        Dim x = New Uri(\"C:/test.txt\") ' Noncompliant\n        Dim z = New Uri(New Uri(\"a\"), (\"C:/test.txt\")) ' Noncompliant\n        File.OpenRead(\"\\\\drive\\foo.csv\") ' Noncompliant\n        File.OpenRead(\"/etc/foo.csv\") ' FN\n        Dim literalConcat = \"http://\" & \"example.com\" ' FN\n    End Sub\n\n    Private Function GetPath() As String\n        Return \"C:/test.txt\" ' FN\n    End Function\n\n    Private Sub ValidCases(s As String, Optional methodParam As String = \"file://blah.txt\") ' Compliant: methodParam doesn't contain uri within the name\n        Dim windowsPathStartingWithVariable = \"%AppData%\\Adobe\"\n        Dim windowsPathWithVariable = \"%appdata%\"\n\n        Dim relativePath1 = \"./my/folder\"\n        Dim relativePath2 = \".\\my\\folder\"\n        Dim relativePath3 = \"..\\..\\Documents\"\n        Dim relativePath4 = \"../../Documents\"\n        Dim file = \"file.txt\"\n\n        Dim driveLetterPath = \"C:\"\n\n        Dim concat1 = Convert.ToString(s & Convert.ToString(\"\\\")) & s\n    End Sub\nEnd Class\n\n' https://github.com/SonarSource/sonar-dotnet/issues/8169\nClass Repro_8169\n    Private Sub Method()\n        Dim uris = (\"C:/test.txt\", \"C:/test.txt\") ' FN\n        Dim a = (\"C:/test.txt\", \"C:/test.txt\")    ' Compliant\n    End Sub\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseAwaitableMethod.Latest.cs",
    "content": "﻿using System.IO;\nusing System.Threading.Tasks;\nusing System;\n\npublic class C\n{\n    public C Child { get; }\n    C this[int i] => null;\n    public static implicit operator int(C c) => default(C);\n\n    C ReturnMethod() => null;\n    Task<C> ReturnMethodAsync() => null;\n\n    async Task OperatorPrecedence() // https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/#operator-precedence\n    {\n        _ = ^ReturnMethod(); // Noncompliant\n        _ = Child?.ReturnMethod()!.Child; // Noncompliant\n        _ = (Child!?.Child?[0]!)?.ReturnMethod()!?.Child[0]!; // Noncompliant\n        _ = (ReturnMethod()!); // Noncompliant\n        _ = (ReturnMethod())!; // Noncompliant\n        _ = ((ReturnMethod())!); // Noncompliant\n    }\n\n    async Task LocalFunctions()\n    {\n        VoidMethod(); // FN\n\n        void VoidMethod() { }\n        Task VoidMethodAsync() => null;\n    }\n\n    async Task InLocalFunction()\n    {\n        async Task AsyncLocalFunction(C c)\n        {\n            c.ReturnMethod(); // Noncompliant\n        }\n        void LocalFunction(C c)\n        {\n            c.ReturnMethod(); // Compliant\n        }\n    }\n}\n\npublic class Sample\n{\n    async Task MethodInvocation(Sample sample)\n    {\n        sample.VoidMethod();            // Noncompliant {{Await VoidMethodAsync instead.}}\n        await sample.VoidMethodAsync(); // Compliant\n    }\n}\n\npublic static class Extensions\n{\n    extension(Sample s)\n    {\n        public void VoidMethod() { }\n        public Task VoidMethodAsync() => Task.CompletedTask;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseAwaitableMethod.Moq.cs",
    "content": "﻿using Moq;\nusing System;\nusing System.Threading.Tasks;\n\npublic interface IReproInterface\n{\n    event EventHandler SomethingHappened;\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/9697\npublic class Repro\n{\n    public async Task AsyncMethod()\n    {\n        await Task.Yield();\n\n        var mock = new Mock<IReproInterface>();\n\n        mock.Raise(i => i.SomethingHappened += null, new EventArgs()); // Noncompliant FP\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseAwaitableMethod.TopLevelStatements.cs",
    "content": "﻿using System.IO;\nusing System.Threading.Tasks;\nusing System;\n\nvar ms = new MemoryStream();\nms.Dispose(); // Noncompliant {{Await DisposeAsync instead.}}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseAwaitableMethod.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing System.Xml;\n\npublic class C\n{\n    public C Child { get; }\n    public Action ActionProperty { get; }\n    public Func<Task> ActionPropertyAsync { get; }\n\n    void VoidMethod() { }\n    Task VoidMethodAsync() => Task.CompletedTask;\n\n    C ReturnMethod() => null;\n    Task<C> ReturnMethodAsync() => Task.FromResult<C>(null);\n\n    bool BoolMethod() => true;\n    Task<bool> BoolMethodAsync() => Task.FromResult(true);\n\n    T GenericMethod<T>() => default(T);\n    Task<T> GenericMethodAsync<T>() => Task.FromResult(default(T));\n\n    C this[int i] => null;\n    public static C operator +(C c) => default(C);\n    public static C operator +(C c1, C c2) => default(C);\n    public static C operator -(C c) => default(C);\n    public static C operator -(C c1, C c2) => default(C);\n    public static C operator !(C c) => default(C);\n    public static C operator ~(C c) => default(C);\n    public static implicit operator int(C c) => default(C);\n\n    async Task MethodInvocations()\n    {\n        VoidMethod(); // Noncompliant {{Await VoidMethodAsync instead.}}\n        await VoidMethodAsync(); // Compliant\n        VoidMethodAsync(); // Compliant: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/cs4014\n        this.VoidMethod(); // Noncompliant\n        this.Child?.VoidMethod(); // Noncompliant\n        this.Child.Child?.VoidMethod(); // Noncompliant\n\n        ReturnMethod(); // Noncompliant\n        _ = ReturnMethod(); // Noncompliant\n        this.ReturnMethod().ReturnMethod().ReturnMethod();\n//      ^^^^^^^^^^^^^^^^^^^\n//      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                   @-1\n//      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^    @-2\n        _ = true ? ReturnMethod() : ReturnMethod();\n        //         ^^^^^^^^^^^^^^\n        //                          ^^^^^^^^^^^^^^           @-1\n        await ReturnMethod().ReturnMethodAsync(); // Noncompliant\n        //    ^^^^^^^^^^^^^^\n\n        GenericMethod<bool>(); // Noncompliant\n\n        // Delegate invokes. Do not report and crash\n        Func<Action> f = new Func<Action>(() => () => { });\n        f()(); // Compliant\n        ActionProperty(); // Compliant\n    }\n\n    public void NonAsyncMethod_VoidReturning()\n    {\n        VoidMethod(); // Compliant\n    }\n\n    public Task NonAsyncMethod_TaskReturning()\n    {\n        VoidMethod(); // Compliant: Enclosing Method must be async\n        return Task.CompletedTask;\n    }\n\n    async Task OperatorPrecedence() // https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/#operator-precedence\n    {\n        _ = new C().ReturnMethod(); // Noncompliant\n        this[0].VoidMethod(); // Noncompliant\n        Child[0].VoidMethod(); // Noncompliant\n        Child.Child[0]?.VoidMethod(); // Noncompliant\n        Child?.Child[0].VoidMethod(); // Noncompliant\n        Child?.Child?[0].VoidMethod(); // Noncompliant\n        Child.Child?[0].VoidMethod(); // Noncompliant\n        Child?.Child?[0]?.VoidMethod(); // Noncompliant\n        _ = Child?.Child?[0]?.ReturnMethod()?.Child[0]; // Noncompliant\n        _ = (ReturnMethod()); // Noncompliant\n        _ = nameof(VoidMethod); // Compliant\n        _ = !BoolMethod(); // Noncompliant\n        _ = BoolMethod() ? ReturnMethod() : default(C);\n        //  ^^^^^^^^^^^^\n        //                 ^^^^^^^^^^^^^^ @-1\n        _ = +ReturnMethod(); // Noncompliant\n        _ = -ReturnMethod(); // Noncompliant\n        _ = !ReturnMethod(); // Noncompliant\n        _ = ~ReturnMethod(); // Noncompliant\n        _ = ReturnMethod() + default(C); // Noncompliant\n        _ = ReturnMethod() - default(C); // Noncompliant\n        _ = ReturnMethod() - !ReturnMethod();\n        //  ^^^^^^^^^^^^^^\n        //                    ^^^^^^^^^^^^^^ @-1\n    }\n\n    async Task ExtensionMethods()\n    {\n        this.ExtVoidMethod(); // Noncompliant\n    }\n}\n\npublic static class Extensions\n{\n    public static void ExtVoidMethod(this C c) { }\n    public static Task ExtVoidMethodAsync(this C c) => Task.CompletedTask;\n}\n\npublic class Overloads\n{\n    public long ImplicitConversionsMethod(int i, IComparable j) => 0;\n    public Task<int> ImplicitConversionsMethodAsync(long otherName1, int otherName2) => Task.FromResult(0);\n    public Task<byte> ImplicitConversionsMethodAsync(byte otherName1, byte otherName2) => Task.FromResult((byte)0);\n\n    public void TypeParameter(C c) { }\n    public Task TypeParameter<T>(T t) where T : C => Task.CompletedTask;\n\n    public async Task Test(int i, byte j)\n    {\n        long l1 = ImplicitConversionsMethod(i, j);              // Noncompliant Can be resolved to first overload\n        long l2 = ImplicitConversionsMethod(i, (IComparable)j); // Compliant No fitting overload\n        var l3 = ImplicitConversionsMethod((byte)i, j);         // Noncompliant Can be resolved to second overload\n        int l4 = (int)ImplicitConversionsMethod((byte)i, j);    // Noncompliant Can be resolved to second overload\n\n        TypeParameter(new C()); // Compliant: Adding \"await\" does never resolve to another overload\n    }\n}\n\npublic class Inheritance\n{\n    class Child : Inheritance\n    {\n        public void OuterVoidMethod() { }\n        public void InnerVoidMethod() { }\n    }\n\n    class GrandChild : Child\n    {\n        public GrandChild Chain { get; }\n\n        public async Task Test()\n        {\n            OuterVoidMethod();                    // Noncompliant\n            this.OuterVoidMethod();               // Noncompliant\n            (this as Child).OuterVoidMethod();    // Noncompliant\n            this.Chain?.OuterVoidMethod();        // Noncompliant\n            this.Chain?.Chain?.OuterVoidMethod(); // Noncompliant\n            InnerVoidMethod();                    // Noncompliant\n            this.InnerVoidMethod();               // Noncompliant\n            (this as Child).InnerVoidMethod();    // Compliant: InnerVoidMethodAsync is defined on GrandChild\n            this.Chain?.InnerVoidMethod();        // Noncompliant\n            this.Chain?.Chain?.InnerVoidMethod(); // Noncompliant\n        }\n\n        public Task InnerVoidMethodAsync() => Task.CompletedTask;\n    }\n\n    public Task OuterVoidMethodAsync() => Task.CompletedTask;\n\n    async Task Test()\n    {\n        var grandChild = new GrandChild();\n        grandChild.OuterVoidMethod();         // Noncompliant\n        grandChild?.OuterVoidMethod();        // Noncompliant\n        grandChild?.Chain?.OuterVoidMethod(); // Noncompliant\n        grandChild.InnerVoidMethod();         // Noncompliant\n        grandChild?.InnerVoidMethod();        // Noncompliant\n        grandChild?.Chain?.InnerVoidMethod(); // Noncompliant\n    }\n}\n\nclass AsynchronousLambdas\n{\n    async Task CallAsyncLambda(StreamReader reader)\n    {\n        await Task.Run(async () =>\n        {\n            await Foo();\n            reader.ReadLine(); // Noncompliant\n        });\n        Func<Task> a = async () =>\n        {\n            await Foo();\n            reader.ReadLine(); // Noncompliant\n        };\n        Func<Task> b = async delegate ()\n        {\n            await Foo();\n            reader.ReadLine(); // Noncompliant\n        };\n    }\n\n    async Task<Action> CreateActionAsync(StreamReader reader)\n    {\n        Action action = () =>\n        {\n            reader.ReadLine();      // Compliant\n        };\n        return action;\n    }\n\n    Task Foo() => null;\n}\n\nclass ObsoletedMethod\n{\n    public void VoidMethod() { }\n    [Obsolete]\n    public Task VoidMethodAsync() => Task.CompletedTask;\n\n    async Task Test()\n    {\n        VoidMethod(); // Compliant: The overload is deprecated\n    }\n}\n\nclass ExpressionTrees\n{\n    public bool BoolMethod() => true;\n    public Task<bool> BoolMethodAsync() => Task.FromResult(true);\n\n    async Task Test()\n    {\n        var queryable = new ExpressionTrees[0].AsQueryable();\n        var qry1 = queryable.Where(x => x.BoolMethod());\n        var qry2 = from x in queryable\n                   where x.BoolMethod()\n                   select x;\n    }\n}\n\nclass WellKnownAsyncParameter\n{\n    void VoidMethod(int arg) { }\n    Task VoidMethodAsync(int arg, CancellationToken token) => Task.CompletedTask;\n\n    async Task Test()\n    {\n        VoidMethod(1); // FN. CancellationToken.None could be provided by the code fix\n    }\n}\n\nclass ResolvesToSelf\n{\n    public void Synchronous() { }\n\n    public async Task SynchronousAsync()\n    {\n        Synchronous(); // Compliant. The fix would cause an endless loop\n    }\n\n    public void Generic<T>() { }\n\n    public async Task GenericAsync<T>()\n    {\n        Generic<T>(); // Compliant. The fix would cause an endless loop\n    }\n}\n\npublic class XmlReaderException\n{\n    async Task TestReader(Stream stream)\n    {\n        using (XmlReader reader = XmlReader.Create(stream))\n        {\n            reader.Read();                           // Compliant, we don't raise for XmlReader methods https://github.com/SonarSource/sonar-dotnet/issues/9336\n            reader.ReadContentAs(typeof(int), null); // Compliant\n            reader.MoveToContent();                  // Compliant\n            reader.ReadContentAsBase64(null, 0, 0);  // Compliant\n            reader.ReadContentAsBinHex(null, 0, 0);  // Compliant\n            reader.ReadContentAsObject();            // Compliant\n            reader.ReadContentAsString();            // Compliant\n            reader.ReadInnerXml();                   // Compliant\n            reader.ReadOuterXml();                   // Compliant\n            reader.ReadValueChunk(null, 0, 0);       // Compliant\n        }\n\n        using (XmlWriter writer = XmlWriter.Create(stream))\n        {\n            writer.WriteStartElement(\"pf\", \"root\", \"http://ns\");    // Compliant, we don't raise for XmlWriter methods https://github.com/SonarSource/sonar-dotnet/issues/9336\n            writer.WriteStartElement(null, \"sub\", null);            // Compliant\n            writer.WriteAttributeString(null, \"att\", null, \"val\");  // Compliant\n            writer.WriteString(\"text\");                             // Compliant\n            writer.WriteEndElement();                               // Compliant\n            writer.WriteProcessingInstruction(\"pName\", \"pValue\");   // Compliant\n            writer.WriteComment(\"cValue\");                          // Compliant\n            writer.WriteCData(\"cdata value\");                       // Compliant\n            writer.WriteEndElement();                               // Compliant\n            writer.Flush();                                         // Compliant\n        }\n    }\n}\n\n// Repro for https://sonarsource.atlassian.net/browse/NET-1468\npublic class TestLockClass\n{\n    private readonly object locktarget;\n    private readonly SemaphoreSlim sm;\n    public async Task DoWorkAsync(CancellationToken cancellationToken)\n    {\n        lock (locktarget)\n        {\n            sm.Wait(); // Noncompliant FP\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseAwaitableMethod_DbDataReader.cs",
    "content": "﻿using System.Data.Common;\nusing System.IO;\nusing System.Threading.Tasks;\n\n// https://sonarsource.atlassian.net/browse/NET-3564\npublic class DbDataReaderColumnReads\n{\n    public async Task Read(DbDataReader reader, int ordinal)\n    {\n        while (await reader.ReadAsync())                           // Compliant - ReadAsync is correct here\n        {\n            _ = reader.IsDBNull(ordinal);                          // Noncompliant FP - IsDBNullAsync exists but is not beneficial without SequentialAccess\n            _ = reader.GetFieldValue<string>(ordinal);             // Noncompliant FP - GetFieldValueAsync exists but is not beneficial without SequentialAccess\n            _ = reader.GetValue(ordinal);                          // Compliant - no GetValueAsync on DbDataReader\n            _ = reader.GetStream(ordinal);                         // Compliant - no GetStreamAsync on DbDataReader\n            _ = reader.GetTextReader(ordinal);                     // Compliant - no GetTextReaderAsync on DbDataReader\n\n            var buffer = new byte[1024];\n            _ = reader.GetBytes(ordinal, 0, buffer, 0, buffer.Length);  // Compliant - no GetBytesAsync on DbDataReader\n\n            var charBuffer = new char[1024];\n            _ = reader.GetChars(ordinal, 0, charBuffer, 0, charBuffer.Length); // Compliant - no GetCharsAsync on DbDataReader\n        }\n    }\n\n    public async Task ReadSync(DbDataReader reader, int ordinal)\n    {\n        while (reader.Read())                                      // Noncompliant - ReadAsync is a valid and beneficial suggestion\n        {\n            _ = reader.IsDBNull(ordinal);                          // Noncompliant FP\n            _ = reader.GetFieldValue<string>(ordinal);             // Noncompliant FP\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseAwaitableMethod_EF.cs",
    "content": "﻿using Microsoft.EntityFrameworkCore;\nusing Microsoft.EntityFrameworkCore.Infrastructure;\nusing System.IO;\nusing System.Threading.Tasks;\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\n\npublic class EntityFramework\n{\n    public async Task Query()\n    {\n        DbSet<object> dbSet = default;\n        dbSet.Add(null);             // Compliant https://github.com/SonarSource/sonar-dotnet/issues/9269\n        dbSet.AddRange(null);        // Compliant https://github.com/SonarSource/sonar-dotnet/issues/9269\n        dbSet.All(x => true);        // Noncompliant\n        dbSet.Any(x => true);        // Noncompliant\n        dbSet.Average(x => 1);       // Noncompliant\n        dbSet.Contains(null);        // Noncompliant\n        dbSet.Count();               // Noncompliant\n        dbSet.ElementAt(1);          // Compliant: EF 8.0 only\n        dbSet.ElementAtOrDefault(1); // Compliant: EF 8.0 only\n        dbSet.ExecuteDelete();       // Noncompliant\n        dbSet.ExecuteUpdate(x => x.SetProperty(x => x.ToString(), x => string.Empty)); // Noncompliant\n        dbSet.Find(null);            // Noncompliant\n        dbSet.First();               // Noncompliant\n        dbSet.FirstOrDefault();      // Noncompliant\n        dbSet.Last();                // Noncompliant\n        dbSet.LastOrDefault();       // Noncompliant\n        dbSet.Load();                // Noncompliant\n        dbSet.LongCount();           // Noncompliant\n        dbSet.Max();                 // Noncompliant\n        dbSet.Min();                 // Noncompliant\n        dbSet.Single();              // Noncompliant\n        dbSet.SingleOrDefault();     // Noncompliant\n        dbSet.Sum(x => 0);           // Noncompliant\n        dbSet.ToArray();             // Noncompliant\n        dbSet.ToDictionary(x => 0);  // Noncompliant\n        dbSet.ToList();              // Noncompliant\n    }\n\n    public async Task NotIQueryable(IEnumerable<object> enumerable)\n    {\n        enumerable.All(x => true); // Compliant not an IQueryable\n        enumerable.ToArray();      // Compliant\n        enumerable.ToList();       // Compliant\n    }\n\n    public async Task Context(DbContext dbContext)\n    {\n        dbContext.Add(null);            // Compliant https://github.com/SonarSource/sonar-dotnet/issues/9269\n        dbContext.AddRange(null);       // Compliant https://github.com/SonarSource/sonar-dotnet/issues/9269\n        dbContext.Dispose();            // Noncompliant\n        dbContext.Find<object>();       // Noncompliant\n        dbContext.Find(typeof(object)); // Noncompliant\n        dbContext.SaveChanges();        // Noncompliant\n    }\n\n    public async Task DatabaseFacade(DatabaseFacade databaseFacade)\n    {\n        databaseFacade.BeginTransaction();     // Noncompliant\n        databaseFacade.CanConnect();           // Noncompliant\n        databaseFacade.CommitTransaction();    // Noncompliant\n        databaseFacade.EnsureCreated();        // Noncompliant\n        databaseFacade.EnsureDeleted();        // Noncompliant\n        databaseFacade.RollbackTransaction();  // Noncompliant\n\n        // Extension methods\n        bool isEnabled = true;\n        databaseFacade.BeginTransaction(System.Data.IsolationLevel.Chaos);                           // Noncompliant\n        databaseFacade.CloseConnection();                                                            // Noncompliant\n        databaseFacade.ExecuteSql($\"Select * From Table Where IsEnabled = {isEnabled}\");             // Noncompliant\n        databaseFacade.ExecuteSqlInterpolated($\"Select * From Table Where IsEnabled = {isEnabled}\"); // Noncompliant\n        databaseFacade.ExecuteSqlRaw(\"Select * From Table Where IsEnabled = @isEnabled\", isEnabled); // Noncompliant\n        databaseFacade.GetAppliedMigrations();                                                       // Noncompliant\n        databaseFacade.GetPendingMigrations();                                                       // Noncompliant\n        databaseFacade.Migrate();                                                                    // Noncompliant\n        databaseFacade.OpenConnection();                                                             // Noncompliant\n        databaseFacade.UseTransaction(null);                                                         // Noncompliant\n    }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/9590\npublic class Repro_9590\n{\n    public async Task DoSomeWork(IDbContextFactory<AppDbContext> factory, MyDbContextFactory factory2, NotADbContextFactory factory3)\n    {\n        using AppDbContext dbContext = factory.CreateDbContext(); // Compliant - CreateDbContextAsync is excluded\n        using AppDbContext dbContext2 = factory2.CreateDbContext(); // Compliant - CreateDbContextAsync is excluded\n        using AppDbContext dbContext3 = factory3.CreateDbContext(); // Noncompliant\n    }\n\n    public class MyDbContextFactory : IDbContextFactory<AppDbContext>\n    {\n        public AppDbContext CreateDbContext() => throw new NotImplementedException();\n\n        public Task<AppDbContext> CreateDbContextAsync() => throw new NotImplementedException();\n    }\n\n    public class NotADbContextFactory\n    {\n        public AppDbContext CreateDbContext() => throw new NotImplementedException();\n\n        public Task<AppDbContext> CreateDbContextAsync() => throw new NotImplementedException();\n    }\n\n    public class AppDbContext : DbContext\n    {\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseAwaitableMethod_FluentValidation.cs",
    "content": "﻿using System;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing FluentValidation;\nusing FluentValidation.Results;\n\npublic class FluentValidationTests_IValidatorT\n{\n    public class IntAbstractValidator : AbstractValidator<int> { }\n\n    public class IntIValidatorT : IValidator<int>\n    {\n        public ValidationResult Validate(int instance) => null;\n        public Task<ValidationResult> ValidateAsync(int instance, CancellationToken cancellation = new CancellationToken()) => null;\n\n        public ValidationResult Validate(IValidationContext context) => null;\n        public Task<ValidationResult> ValidateAsync(IValidationContext context, CancellationToken cancellation = new CancellationToken()) => null;\n        public IValidatorDescriptor CreateDescriptor() => null;\n        public bool CanValidateInstancesOfType(Type type) => true;\n    }\n\n    public class ExplicitIntIValidatorT : IValidator<int>\n    {\n        public ValidationResult Validate(int instance) => null;\n        ValidationResult IValidator<int>.Validate(int instance) => null;\n        Task<ValidationResult> IValidator<int>.ValidateAsync(int instance, CancellationToken cancellation = new CancellationToken()) => null;\n\n        ValidationResult IValidator.Validate(IValidationContext context) => null;\n        Task<ValidationResult> IValidator.ValidateAsync(IValidationContext context, CancellationToken cancellation = new CancellationToken()) => null;\n        IValidatorDescriptor IValidator.CreateDescriptor() => null;\n        bool IValidator.CanValidateInstancesOfType(Type type) => true;\n    }\n\n    public async Task Validate()\n    {\n        var intAbstractValidator = new IntAbstractValidator();\n        intAbstractValidator.Validate(0); // Compliant\n\n        var intIValidatorT = new IntIValidatorT();\n        intIValidatorT.Validate(0); // Compliant\n\n        var explicitIntIValidatorT = new ExplicitIntIValidatorT();\n        explicitIntIValidatorT.Validate(0); // Compliant\n        ((IValidator<int>)explicitIntIValidatorT).Validate(0); // Compliant\n    }\n}\n\n\npublic class FluentValidationTests_IValidator\n{\n    public class Validator : IValidator\n    {\n        public ValidationResult Validate(IValidationContext context) => null;\n        public Task<ValidationResult> ValidateAsync(IValidationContext context, CancellationToken cancellation = new CancellationToken()) => null;\n        public IValidatorDescriptor CreateDescriptor() => null;\n        public bool CanValidateInstancesOfType(Type type) => true;\n    }\n\n    public class ExplicitIValidator : IValidator\n    {\n        public ValidationResult Validate(IValidationContext context) => null;\n        ValidationResult IValidator.Validate(IValidationContext context) => null;\n        Task<ValidationResult> IValidator.ValidateAsync(IValidationContext context, CancellationToken cancellation = new CancellationToken()) => null;\n        IValidatorDescriptor IValidator.CreateDescriptor() => null;\n        bool IValidator.CanValidateInstancesOfType(Type type) => true;\n    }\n\n    public async Task Validate()\n    {\n        var validator = new Validator();\n        validator.Validate(new ValidationContext<int>(0)); // Compliant\n\n        var explicitIntIValidator = new ExplicitIValidator();\n        explicitIntIValidator.Validate(new ValidationContext<int>(0)); // Compliant\n        ((IValidator)explicitIntIValidator).Validate(new ValidationContext<int>(0)); // Compliant\n    }\n}\n\npublic class FluentValidationTests_NotFluentValidation\n{\n    public ValidationResult Validate(IValidationContext context) => null;\n    public Task<ValidationResult> ValidateAsync(IValidationContext context, CancellationToken cancellation = new CancellationToken()) => null;\n\n    public ValidationResult Validate<T>(T instance) => null;\n    public Task<ValidationResult> ValidateAsync<T>(T instance, CancellationToken cancellation = new CancellationToken()) => null;\n\n    public async Task Validate()\n    {\n        Validate(new ValidationContext<int>(0)); // Noncompliant This method does not implement IValidation\n        Validate<int>(0);                        // Noncompliant This method does not implement IValidation<T>\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseAwaitableMethod_MongoDBDriver.cs",
    "content": "﻿using System;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing MongoDB.Driver;\n\npublic record Person(int Id, string Name);\n\npublic class MongoDBDriver\n{\n    public async Task Query(IMongoCollection<Person> personCollection)\n    {\n        var sort = Builders<Person>.Sort.Descending(nameof(Person.Name));\n        // * Find https://mongodb.github.io/mongo-csharp-driver/2.8/apidocs/html/M_MongoDB_Driver_IMongoCollectionExtensions_Find__1_3.htm\n        // * FindAsync https://mongodb.github.io/mongo-csharp-driver/2.8/apidocs/html/M_MongoDB_Driver_IMongoCollectionExtensions_FindAsync__1_3.htm\n        // Speculative binding finds \"FindAsync\" but the return type IAsyncCursor<> of FindAsync is not compatible with return type IFindFluent<,> of \"Find\"\n        // Speculative binding does overload resolution according to the C# rules, which ignore return types.\n        // It seems to ignore the compiler binding error for the following \"Sort\" which is only defined on IFindFluent, but not in IAsyncCursor.\n        var snapshot = await personCollection.Find(s => s.Id > 10) // Compliant https://github.com/SonarSource/sonar-dotnet/issues/9265\n            .Sort(sort) // Not defined on IAsyncCursor (return type of FindAsync)\n            .FirstOrDefaultAsync().ConfigureAwait(false);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseAwaitableMethod_Sockets.cs",
    "content": "﻿using System;\nusing System.Text;\nusing System.IO;\nusing System.Net;\nusing System.Net.Sockets;\nusing System.Threading.Tasks;\nusing System.Collections.Generic;\n\npublic class Sockets\n{\n    public async Task Connect()\n    {\n        var hostEndPoint = new IPEndPoint(new IPAddress(new byte[] { 127, 0, 0, 1 }), 80);\n        var buffer = new List<ArraySegment<byte>>();\n        var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);\n        socket.Connect(hostEndPoint);                               // Noncompliant\n        socket.Accept();                                            // Noncompliant\n        socket.Receive(buffer, SocketFlags.Broadcast);              // Noncompliant\n        socket.Send(buffer, SocketFlags.Broadcast);                 // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseCharOverloadOfStringMethods.Fixed.cs",
    "content": "﻿class Issues\n{\n    bool StartsWith(string str)\n    {\n        return str.StartsWith('a');\n    }\n    bool EndsWith(string str)\n    {\n        return str.EndsWith('z');\n    }\n    bool SwapEscape(string str)\n    {\n        return str.EndsWith('\\'')\n            || str.EndsWith('\"')\n            || str.EndsWith('\"');\n    }\n    bool Escaped(string str)\n    {\n        return str.EndsWith('\\t');\n    }\n\n    void Chained(string str)\n    {\n        var first = str.EndsWith('a').ToString().ToString();\n        var middle = str.Substring(1).EndsWith('a').ToString();\n        var end = str.Substring(1).Substring(1).EndsWith('a');\n\n        var nullConditionalOperator = str.Substring(1)?.EndsWith('a').ToString();\n    }\n}\n\nclass Unchanged\n{\n    public bool EndsWith(string str)\n    {\n        return str.EndsWith(\"12\")\n            || \"ABC\".EndsWith(str);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseCharOverloadOfStringMethods.Framework.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\n\nclass Testcases\n{\n    void Simple()\n    {\n        var str = \"hello\";\n\n        // \"char\" overloads do not exist on .NET Framework\n        str.StartsWith(\"x\");    // Compliant\n        str.EndsWith(\"x\");      // Compliant\n\n        str.StartsWith('x');    // Error [CS1503]\n        str.EndsWith('x');      // Error [CS1503]\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseCharOverloadOfStringMethods.Framework.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.Globalization\nImports System.Linq\n\nClass Testcases\n\n    Sub Simple()\n        Dim str = \"hello\"\n\n        ' \"char\" overloads do not exist on .NET Framework\n        str.StartsWith(\"x\") ' Compliant\n        str.EndsWith(\"x\") ' Compliant\n\n        str.StartsWith(\"x\"c) ' Compliant\n        str.EndsWith(\"x\"c) ' Compliant\n    End Sub\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseCharOverloadOfStringMethods.Latest.cs",
    "content": "﻿class CSharp13\n{\n    bool StartsWithString(string str)\n    {\n        return str.StartsWith(\"\\e\"); //Noncompliant\n    }\n    bool StartsWithChar(string str)\n    {\n        return str.StartsWith('\\e'); //Compliant\n    }\n\n    bool EndsWithString(string str)\n    {\n        return str.EndsWith(\"\\e\"); //Noncompliant\n    }\n    bool EndsWithChar(string str)\n    {\n        return str.EndsWith('\\e'); //Compliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseCharOverloadOfStringMethods.ToFix.cs",
    "content": "﻿class Issues\n{\n    bool StartsWith(string str)\n    {\n        return str.StartsWith(\"a\");\n    }\n    bool EndsWith(string str)\n    {\n        return str.EndsWith(\"z\");\n    }\n    bool SwapEscape(string str)\n    {\n        return str.EndsWith(\"'\")\n            || str.EndsWith(\"\\\"\")\n            || str.EndsWith(@\"\"\"\");\n    }\n    bool Escaped(string str)\n    {\n        return str.EndsWith(\"\\t\");\n    }\n\n    void Chained(string str)\n    {\n        var first = str.EndsWith(\"a\").ToString().ToString();\n        var middle = str.Substring(1).EndsWith(\"a\").ToString();\n        var end = str.Substring(1).Substring(1).EndsWith(\"a\");\n\n        var nullConditionalOperator = str.Substring(1)?.EndsWith(\"a\").ToString();\n    }\n}\n\nclass Unchanged\n{\n    public bool EndsWith(string str)\n    {\n        return str.EndsWith(\"12\")\n            || \"ABC\".EndsWith(str);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseCharOverloadOfStringMethods.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\n\nclass Testcases\n{\n    void Simple()\n    {\n        var str = \"hello\";\n\n        str.StartsWith(\"x\"); // Noncompliant {{\"StartsWith\" overloads that take a \"char\" should be used}}\n        //  ^^^^^^^^^^\n        str.EndsWith(\"x\"); // Noncompliant {{\"EndsWith\" overloads that take a \"char\" should be used}}\n        //  ^^^^^^^^\n\n        str.StartsWith('x'); // Compliant\n        str.EndsWith('x'); // Compliant\n\n        str.StartsWith(\"xx\"); // Compliant (length > 1)\n        str.EndsWith(\"xx\"); // Compliant (length > 1)\n\n        var hString = \"x\";\n        str.StartsWith(hString); // Compliant, only raise on literals\n        str.StartsWith(hString); // Compliant, only raise on literals\n\n        var hChar = 'x';\n        str.StartsWith(hChar); // Compliant\n        str.EndsWith(hChar); // Compliant\n\n        const string hConst = \"x\";\n        str.StartsWith(hConst); // Compliant\n        str.EndsWith(hConst); // Compliant\n\n        str.StartsWith(hConst.ToLower()); // Compliant\n        str.StartsWith(hConst.ToString()); // Compliant\n\n        str.StartsWith(hString, StringComparison.CurrentCulture); // Compliant\n        str.EndsWith(hConst, StringComparison.CurrentCulture); // Compliant \n        str.StartsWith(\"x\", true, CultureInfo.CurrentCulture); // Compliant\n        str.EndsWith(\"x\", true, CultureInfo.CurrentCulture); // Compliant\n\n        const int five = 5;\n        str.StartsWith(five.ToString()); // Compliant\n        str.EndsWith(five.ToString()); // Compliant\n\n        var list = new List<string> { \"hey\" };\n        list.First().StartsWith(\"x\"); // Noncompliant\n        list.Any(x => x.EndsWith(\"x\")); // Noncompliant\n    }\n\n    void Edgecases()\n    {\n        new List<int> { 42 }.Select(x => x.ToString()).Last().Trim().EndsWith(\"x\"); // Noncompliant\n        (true ? \"hey\" : \"hello\").StartsWith(\"x\"); // Noncompliant\n        (\"hey\" ?? \"hello\").EndsWith(\"x\"); // Noncompliant\n        (true ? \"hey\" : (\"hello\" ?? \"heya\")).StartsWith(\"x\"); // Noncompliant\n        (true ? \"hey\" : (\"hello\" ?? \"heya\")).StartsWith(\"x\", StringComparison.CurrentCulture); // Compliant\n    }\n\n    void Chaining()\n    {\n        var str = \"hello\";\n\n        GetString().StartsWith(\"x\"); // Noncompliant\n        GetString().EndsWith(\"x\", StringComparison.InvariantCultureIgnoreCase); // Compliant\n\n        MutateString(MutateString(MutateString(GetString()))).StartsWith(\"x\"); // Noncompliant\n        MutateString(MutateString(MutateString(GetString()))).EndsWith(\"x\", true, CultureInfo.CurrentCulture); // Compliant\n\n        str.Trim().PadLeft(42).PadRight(42).ToLower().StartsWith(\"x\"); // Noncompliant\n        str.Trim().PadLeft(42).PadRight(42).ToLower()?.EndsWith(\"x\"); // Noncompliant\n        str.Trim().PadLeft(42).PadRight(42)?.ToLower().StartsWith(\"x\"); // Noncompliant\n        str.Trim().PadLeft(42).PadRight(42)?.ToLower()?.EndsWith(\"x\"); // Noncompliant\n        str.Trim().PadLeft(42)?.PadRight(42).ToLower().StartsWith(\"x\"); // Noncompliant\n        str.Trim().PadLeft(42)?.PadRight(42).ToLower()?.EndsWith(\"x\"); // Noncompliant\n        str.Trim().PadLeft(42)?.PadRight(42)?.ToLower().StartsWith(\"x\"); // Noncompliant\n        str.Trim().PadLeft(42)?.PadRight(42)?.ToLower()?.EndsWith(\"x\"); // Noncompliant\n        str.Trim()?.PadLeft(42).PadRight(42).ToLower().StartsWith(\"x\"); // Noncompliant\n        str.Trim()?.PadLeft(42).PadRight(42).ToLower()?.EndsWith(\"x\"); // Noncompliant\n        str.Trim()?.PadLeft(42).PadRight(42)?.ToLower().StartsWith(\"x\"); // Noncompliant\n        str.Trim()?.PadLeft(42).PadRight(42)?.ToLower()?.EndsWith(\"x\"); // Noncompliant\n        str.Trim()?.PadLeft(42)?.PadRight(42).ToLower().StartsWith(\"x\"); // Noncompliant\n        str.Trim()?.PadLeft(42)?.PadRight(42).ToLower()?.EndsWith(\"x\"); // Noncompliant\n        str.Trim()?.PadLeft(42)?.PadRight(42)?.ToLower().StartsWith(\"x\"); // Noncompliant\n        str.Trim()?.PadLeft(42)?.PadRight(42)?.ToLower()?.EndsWith(\"x\"); // Noncompliant\n        //                                                ^^^^^^^^\n    }\n\n    static string GetString() => \"42\";\n    static string MutateString(string str) => \"42\";\n\n    void NotCalledOnString()\n    {\n        var fake = new FakeString();\n        fake.StartsWith(\"x\"); // Compliant\n        fake.EndsWith(\"x\"); // Compliant\n        fake.StartsWith('x'); // Compliant\n        fake.EndsWith('x'); // Compliant\n\n        fake.StartsWith(); // Compliant\n        fake.EndsWith(); // Compliant\n    }\n\n    class FakeString\n    {\n        public bool StartsWith(string value) => true;\n        public bool EndsWith(string value) => false;\n\n        public bool StartsWith(char value) => true;\n        public bool EndsWith(char value) => false;\n\n        public bool StartsWith() => true;\n        public bool EndsWith() => false;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseCharOverloadOfStringMethods.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.Globalization\nImports System.Linq\n\nClass Testcases\n    Sub Simple()\n        Dim str = \"hello\"\n\n        str.StartsWith(\"x\") ' Noncompliant {{\"StartsWith\" overloads that take a \"char\" should be used}}\n        '   ^^^^^^^^^^\n        str.EndsWith(\"x\") ' Noncompliant {{\"EndsWith\" overloads that take a \"char\" should be used}}\n        '   ^^^^^^^^\n\n        str.StartsWith(\"x\"c) ' Compliant\n        str.EndsWith(\"x\"c) ' Compliant\n\n        str.StartsWith(\"xx\") ' Compliant (length > 1)\n        str.EndsWith(\"xx\")  ' Compliant (length > 1)\n\n        Dim hString = \"x\"\n        str.StartsWith(hString) ' Compliant, only raise on literals\n        str.EndsWith(hString) ' Compliant, only raise on literals\n\n        Dim hChar As Char = \"x\"\n        str.StartsWith(hChar) ' Compliant\n        str.EndsWith(hChar) ' Compliant\n\n        Const hConst As String = \"x\"\n        str.StartsWith(hConst) ' Compliant\n        str.EndsWith(hConst) ' Compliant\n\n        str.StartsWith(hConst.ToLower()) ' Compliant\n        str.StartsWith(hConst.ToString()) ' Compliant\n\n        str.StartsWith(hString, StringComparison.CurrentCulture) ' Compliant\n        str.EndsWith(hConst, StringComparison.CurrentCulture) ' Compliant \n        str.StartsWith(\"x\", True, CultureInfo.CurrentCulture) ' Compliant\n        str.EndsWith(\"x\", True, CultureInfo.CurrentCulture) ' Compliant\n\n        Const five As Integer = 5\n        str.StartsWith(five.ToString()) ' Compliant\n        str.EndsWith(five.ToString()) ' Compliant\n\n        Dim list = New List(Of String) From {\"hey\"}\n        list.First().StartsWith(\"x\") ' Noncompliant\n        list.Any(Function(x) x.EndsWith(\"x\")) ' Noncompliant\n        list.Select(Function(x) x.ToString()).Last().Trim().EndsWith(\"x\") ' Noncompliant\n    End Sub\n\n    Private Sub Chaining()\n        Dim str = \"hello\"\n\n        GetString().StartsWith(\"x\") ' Noncompliant\n        GetString().EndsWith(\"x\", StringComparison.InvariantCultureIgnoreCase) ' Compliant\n\n        MutateString(MutateString(MutateString(GetString()))).StartsWith(\"x\") ' Noncompliant\n        MutateString(MutateString(MutateString(GetString()))).EndsWith(\"x\", True, CultureInfo.CurrentCulture) ' Compliant\n\n        str.Trim().PadLeft(42).PadRight(42).ToLower().StartsWith(\"x\") ' Noncompliant\n        str.Trim().PadLeft(42).PadRight(42).ToLower()?.EndsWith(\"x\") ' Noncompliant\n        str.Trim().PadLeft(42).PadRight(42)?.ToLower().StartsWith(\"x\") ' Noncompliant\n        str.Trim().PadLeft(42).PadRight(42)?.ToLower()?.EndsWith(\"x\") ' Noncompliant\n        str.Trim().PadLeft(42)?.PadRight(42).ToLower().StartsWith(\"x\") ' Noncompliant\n        str.Trim().PadLeft(42)?.PadRight(42).ToLower()?.EndsWith(\"x\") ' Noncompliant\n        str.Trim().PadLeft(42)?.PadRight(42)?.ToLower().StartsWith(\"x\") ' Noncompliant\n        str.Trim().PadLeft(42)?.PadRight(42)?.ToLower()?.EndsWith(\"x\") ' Noncompliant\n        str.Trim()?.PadLeft(42).PadRight(42).ToLower().StartsWith(\"x\") ' Noncompliant\n        str.Trim()?.PadLeft(42).PadRight(42).ToLower()?.EndsWith(\"x\") ' Noncompliant\n        str.Trim()?.PadLeft(42).PadRight(42)?.ToLower().StartsWith(\"x\") ' Noncompliant\n        str.Trim()?.PadLeft(42).PadRight(42)?.ToLower()?.EndsWith(\"x\") ' Noncompliant\n        str.Trim()?.PadLeft(42)?.PadRight(42).ToLower().StartsWith(\"x\") ' Noncompliant\n        str.Trim()?.PadLeft(42)?.PadRight(42).ToLower()?.EndsWith(\"x\") ' Noncompliant\n        str.Trim()?.PadLeft(42)?.PadRight(42)?.ToLower().StartsWith(\"x\") ' Noncompliant\n        str.Trim()?.PadLeft(42)?.PadRight(42)?.ToLower()?.EndsWith(\"x\") ' Noncompliant\n        '                                                 ^^^^^^^^\n    End Sub\n\n    Private Shared Function GetString() As String\n        Return \"42\"\n    End Function\n\n    Private Shared Function MutateString(ByVal str As String) As String\n        Return \"42\"\n    End Function\n\n    Private Sub NotCalledOnString()\n        Dim fake = New FakeString()\n        fake.StartsWith(\"x\") ' Compliant\n        fake.EndsWith(\"x\") ' Compliant\n        fake.StartsWith(\"x\"c) ' Compliant\n        fake.EndsWith(\"x\"c) ' Compliant\n\n        fake.StartsWith() ' Compliant\n        fake.EndsWith() ' Compliant\n    End Sub\n\n    Private Class FakeString\n        Public Function StartsWith(ByVal value As String) As Boolean\n            Return True\n        End Function\n\n        Public Function EndsWith(ByVal value As String) As Boolean\n            Return False\n        End Function\n\n        Public Function StartsWith(ByVal value As Char) As Boolean\n            Return True\n        End Function\n\n        Public Function EndsWith(ByVal value As Char) As Boolean\n            Return False\n        End Function\n\n        Public Function StartsWith() As Boolean\n            Return False\n        End Function\n\n        Public Function EndsWith() As Boolean\n            Return False\n        End Function\n    End Class\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseConstantLoggingTemplate.cs",
    "content": "﻿using System;\nusing Microsoft.Extensions.Logging;\nusing Microsoft.Extensions.Logging.Abstractions;\nusing AliasedLogger = Microsoft.Extensions.Logging.ILogger;\n\npublic class Program\n{\n    private const string FieldConstant = \"field\";\n    private string _stringField = \"\";\n    private string StringProperty => \"\";\n    private string StringMethod() => \"\";\n\n    public void BasicScenarios(ILogger logger, int arg)\n    {\n        const string localConstant = \"local\";\n        string localVariable = \"\";\n\n        logger.Log(LogLevel.Warning, \"\");                                       // Compliant\n        logger.Log(LogLevel.Warning, \"\", 42);                                   // Compliant - this rule doesn't care whether the additional arguments are properly used\n        logger.Log(LogLevel.Warning, \"{Arg}\", arg);                             // Compliant\n        logger.Log(LogLevel.Warning, localVariable);                            // Compliant\n        logger.Log(LogLevel.Warning, _stringField);                             // Compliant\n        logger.Log(LogLevel.Warning, StringProperty, 42);                       // Compliant\n        logger.Log(LogLevel.Warning, StringMethod(), 42);                       // Compliant\n        logger.Log(message: \"{Param}\", logLevel: LogLevel.Warning, args: 42);   // Compliant\n\n        logger.Log(LogLevel.Warning, $\"{arg}\");                                 // Noncompliant {{Don't use string interpolation in logging message templates.}}\n        //                           ^^^^^^^^\n\n        logger.Log(LogLevel.Warning, \"Argument: \" + arg);                       // Noncompliant {{Don't use string concatenation in logging message templates.}}\n        //                           ^^^^^^^^^^^^^^^^^^\n\n        logger.Log(LogLevel.Warning, string.Format(\"{0}\", arg));                // Noncompliant {{Don't use String.Format in logging message templates.}}\n        //                           ^^^^^^^^^^^^^^^^^^^^^^^^^\n\n        logger.Log(message: $\"{arg}\", logLevel: LogLevel.Warning);              // Noncompliant\n        logger.Log(message: (string)$\"{arg}\", logLevel: LogLevel.Warning);      // Noncompliant\n        //                          ^^^^^^^^\n        logger.Log(LogLevel.Warning, (arg + \" \" + arg).ToLower());              // Noncompliant\n        //                            ^^^^^^^^^^^^^^^\n\n        logger.Log(LogLevel.Warning, \"First \" + \"Second \" + \"Third\");                               // Compliant - all strings in the concatenation are constants, the compiler can optimize it\n        logger.Log(LogLevel.Warning, FieldConstant + localConstant);                                // Compliant\n        logger.Log(LogLevel.Warning, FieldConstant + \"Second\");                                     // Compliant\n        logger.Log(LogLevel.Warning, $\"Constant: {FieldConstant}\");                                 // Compliant, see https://github.com/SonarSource/sonar-dotnet/issues/9247\n        logger.Log(LogLevel.Warning, $\"Constant: {FieldConstant}\" + $\"Constant: {FieldConstant}\");  // Compliant, see https://github.com/SonarSource/sonar-dotnet/issues/9653\n        logger.Log(LogLevel.Warning, FieldConstant + $\"Constant: {FieldConstant}\");                 // Compliant\n        logger.Log(LogLevel.Warning, \"First\" + $\"Constant: {FieldConstant}\");                       // Compliant\n        logger.Log(LogLevel.Warning, \"First \" + arg + \"Third\");                                     // Noncompliant\n        logger.Log(LogLevel.Warning, (\"First \" + \"Second\").ToLower());                              // FN\n\n        logger.Log(LogLevel.Warning, new EventId(42), $\"{arg}\");                // Noncompliant\n        logger.Log(LogLevel.Warning, new Exception(), $\"{arg}\");                // Noncompliant\n        logger.Log(LogLevel.Warning, new Exception(), \"{Arg}\", arg);            // Compliant\n\n        LoggerExtensions.Log(logger, LogLevel.Warning, \"{Arg}\", arg);           // Compliant\n        LoggerExtensions.Log(logger, LogLevel.Warning, $\"{arg}\");               // Noncompliant\n    }\n\n    public void NotLoggingMethod(ILogger logger, int arg)\n    {\n        logger.BeginScope($\"{arg}\", 1, 2, 3);                                   // Compliant - not a log method, the message argument is always evaluated\n    }\n\n    public void ImplementsILogger(NullLogger nullLogger, CustomLogger customLogger, int arg)\n    {\n        nullLogger.Log(LogLevel.Warning, \"Arg: {Arg}\", arg);                    // Compliant\n        nullLogger.Log(LogLevel.Warning, $\"Arg: {arg}\");                        // Noncompliant\n        customLogger.Log(LogLevel.Warning, \"Arg: {Arg}\", arg);                  // Compliant\n        customLogger.Log(LogLevel.Warning, $\"Arg: {arg}\");                      // Noncompliant\n    }\n\n    public void DoesNotImplementILogger(NotILogger notILogger, int arg)\n    {\n        notILogger.Log(LogLevel.Warning, \"Arg: {Arg}\", arg);                    // Compliant\n        notILogger.Log(LogLevel.Warning, $\"Arg: {arg}\");                        // Compliant\n    }\n\n    public void AliasedILogger(AliasedLogger aliasedLogger, int arg)\n    {\n        aliasedLogger.Log(LogLevel.Warning, \"Arg: {Arg}\", arg);                 // Compliant\n        aliasedLogger.Log(LogLevel.Warning, $\"Arg: {arg}\");                     // Noncompliant\n    }\n\n    public class CustomLogger : ILogger\n    {\n        public IDisposable BeginScope<TState>(TState state) => null;\n\n        public bool IsEnabled(LogLevel logLevel) => false;\n\n        public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)\n        {\n        }\n    }\n\n    public class NotILogger\n    {\n        public void Log(LogLevel logLevel, string message, params object[] args)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseConstantsWhereAppropriate.CSharp11.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class Program\n    {\n        static readonly IntPtr intPtr1;     // Compliant\n        static readonly UIntPtr uIntPtr1; // Compliant\n        static readonly nint nint1; // Compliant\n        static readonly nuint nuint1; // Compliant\n\n        static readonly IntPtr intPtr2 = 42; // Compliant, FN, should be const\n        static readonly UIntPtr uIntPtr2 = 42; // Compliant, FN, should be const\n        static readonly nint nint2 = 42; // Compliant, FN, should be const\n        static readonly nuint nuint2 = 42; // Compliant, FN, should be const\n\n        static readonly bool x = true; // Noncompliant\n    }\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseConstantsWhereAppropriate.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class Program\n    {\n        static readonly bool x1 = false;   // Noncompliant {{Replace this 'static readonly' declaration with 'const'.}}\n        static readonly byte x2 = 1;       // Noncompliant\n        static readonly sbyte x3 = 1;      // Noncompliant\n        static readonly char x4 = 'a';     // Noncompliant\n        static readonly decimal x5 = 1;    // Noncompliant\n        static readonly double x6 = 1;     // Noncompliant\n        static readonly float x7 = 1;      // Noncompliant\n        static readonly int x8 = 1;        // Noncompliant\n        static readonly uint x9 = 1;       // Noncompliant\n        static readonly long x10 = 1;      // Noncompliant\n        static readonly ulong x11 = 1;     // Noncompliant\n        static readonly short x12 = 1;     // Noncompliant\n        static readonly ushort x13 = 1;    // Noncompliant\n        static readonly string x14 = \"\";   // Noncompliant\n\n        static readonly int maxVal = int.MaxValue; // Noncompliant\n\n        public static readonly int publicMaxVal = int.MaxValue; // Compliant- public\n        protected static readonly int protectedMaxVal = int.MaxValue; // Compliant - protected\n\n        static readonly object x15 = null; // Compliant\n\n        static readonly bool y1;     // Compliant\n        static readonly byte y2;     // Compliant\n        static readonly sbyte y3;    // Compliant\n        static readonly char y4;     // Compliant\n        static readonly decimal y5;  // Compliant\n        static readonly double y6;   // Compliant\n        static readonly float y7;    // Compliant\n        static readonly int y8;      // Compliant\n        static readonly uint y9;     // Compliant\n        static readonly long y10;    // Compliant\n        static readonly ulong y11;   // Compliant\n        static readonly short y12;   // Compliant\n        static readonly ushort y13;  // Compliant\n        static readonly string y14;  // Compliant\n\n        static readonly string empty = string.Empty; // Compliant\n        static readonly int myValue = GetMyValue(); // Compliant\n        static readonly string[] values = { \"a\", \"b\", \"c\" }; // Compliant\n\n        static int GetMyValue()\n        {\n            return 0;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseCurlyBraces.CSharp7.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public class UseCurlyBraces\n    {\n        public UseCurlyBraces(object obj)\n        {\n            if (obj is string str)\n            {\n                Console.WriteLine(str);\n            }\n            if (obj is string str2) // Noncompliant\n                Console.WriteLine(str2);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseCurlyBraces.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public class UseCurlyBraces\n    {\n        public UseCurlyBraces(object obj)\n        {\n            if (false) ; // Noncompliant\n//          ^^\n            for (int i = 0; i < 10; i++) ; // Noncompliant\n            foreach (int i in new List<int>()) ; // Noncompliant\n            while (false) ; // Noncompliant\n            do; while (false); // Noncompliant {{Add curly braces around the nested statement(s) in this 'do' block.}}\n\n            if (false)\n            {\n            }\n            else; // Noncompliant\n\n            if (false) // Noncompliant\n                if (false)\n                {\n                }\n\n            if (false) { }\n\n            if (false) { }\n            else if (false) { }\n\n            for (int i = 0; i < 10; i++) { }\n            while (false) { }\n            do { } while (false);\n\n            if (obj is string str)\n            {\n                Console.WriteLine(str);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseDateTimeOffsetInsteadOfDateTime.CSharp9.cs",
    "content": "﻿using System;\nusing System.Globalization;\n\nDateTime myDate = new(1); // Noncompliant {{Prefer using \"DateTimeOffset\" instead of \"DateTime\"}}\n//                ^^^^^^\n_ = new DateTime(1, 1, 1, 1, 1, 1, 1, 1, new GregorianCalendar());                   // Noncompliant\n_ = new DateTime(1, 1, 1, 1, 1, 1, 1, 1, DateTimeKind.Utc);                          // Noncompliant\n_ = new DateTime(1, 1, 1, 1, 1, 1, 1, 1, new GregorianCalendar(), DateTimeKind.Utc); // Noncompliant\n\n_ = DateTime.UnixEpoch; // Noncompliant\nSpan<char> span = new();\nmyDate.TryFormat(span, out int myInt);\nmyDate.AddMicroseconds(0);\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseDateTimeOffsetInsteadOfDateTime.Net.vb",
    "content": "﻿Imports System\nImports System.Globalization\n\nPublic Class Program\n    Private Sub Constructors()\n        Dim a = New DateTime(1, 1, 1, 1, 1, 1, 1, 1, New GregorianCalendar())                   ' Noncompliant\n        a = New DateTime(1, 1, 1, 1, 1, 1, 1, 1, DateTimeKind.Utc)                          ' Noncompliant\n        a = New DateTime(1, 1, 1, 1, 1, 1, 1, 1, New GregorianCalendar(), DateTimeKind.Utc) ' Noncompliant\n    End Sub\n\n    Private Sub Fields([date] As Date)\n        Dim a = Date.UnixEpoch ' Noncompliant\n        Dim b = [date].Microsecond\n        Dim c = [date].Nanosecond\n    End Sub\n\n    Private Sub Methods([date] As Date)\n        [date].AddMicroseconds(0)\n    End Sub\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseDateTimeOffsetInsteadOfDateTime.cs",
    "content": "﻿using System;\nusing System.Globalization;\nusing MyAlias = System.DateTime;\n\npublic class Program\n{\n    void Constructors()\n    {\n        _ = new DateTime(1);                                                                 // Noncompliant {{Prefer using \"DateTimeOffset\" instead of \"DateTime\"}}\n//          ^^^^^^^^^^^^^^^\n        _ = new DateTime(1, 1, 1);                                                           // Noncompliant\n        _ = new DateTime(1, 1, 1, new GregorianCalendar());                                  // Noncompliant\n        _ = new DateTime(1, 1, 1, 1, 1, 1);                                                  // Noncompliant\n        _ = new DateTime(1, 1, 1, 1, 1, 1, new GregorianCalendar());                         // Noncompliant\n        _ = new DateTime(1, 1, 1, 1, 1, 1, DateTimeKind.Utc);                                // Noncompliant\n        _ = new DateTime(1, 1, 1, 1, 1, 1, 1);                                               // Noncompliant\n        _ = new DateTime(1, 1, 1, 1, 1, 1, 1, new GregorianCalendar());                      // Noncompliant\n        _ = new DateTime(1, 1, 1, 1, 1, 1, 1, DateTimeKind.Utc);                             // Noncompliant\n        _ = new DateTime(1, 1, 1, 1, 1, 1, 1, new GregorianCalendar(), DateTimeKind.Utc);    // Noncompliant\n        _ = new MyAlias(1);                                                                  // FN\n        _ = new System.DateTime(1);                                                          // Noncompliant\n    }\n\n    void Fields()\n    {\n        _ = DateTime.MaxValue;  // Noncompliant\n//          ^^^^^^^^\n        _ = DateTime.MinValue;  // Noncompliant\n    }\n\n    void StaticProperties()\n    {\n        _ = DateTime.Now; // Noncompliant\n//          ^^^^^^^^\n        _ = DateTime.Today; // Noncompliant\n        _ = DateTime.UtcNow; // Noncompliant\n    }\n\n    void Methods(DateTime date)\n    {\n        date.Add(TimeSpan.Zero);\n        date.AddDays(0);\n        date.AddHours(0);\n        date.AddMilliseconds(0);\n        date.AddMinutes(0);\n        date.AddMonths(0);\n        date.AddSeconds(0);\n        date.AddTicks(0);\n        date.AddYears(0);\n        date.CompareTo(date);\n        DateTime.Compare(date, date);\n        DateTime.DaysInMonth(1, 1);\n        DateTime.Equals(date, date);\n        date.Equals(date);\n        DateTime.FromBinary(1);\n        DateTime.FromFileTime(1);\n        DateTime.FromFileTimeUtc(1);\n        DateTime.FromOADate(1);\n        date.GetDateTimeFormats('a');\n        date.GetHashCode();\n        date.GetTypeCode();\n        date.IsDaylightSavingTime();\n        DateTime.IsLeapYear(1);\n        DateTime.Parse(\"06/01/1993\");\n        DateTime.ParseExact(\"06/01/1993\", \"dd/MM/yyyy\", null);\n        DateTime.SpecifyKind(date, DateTimeKind.Local);\n        date.Subtract(date);\n        date.ToBinary();\n        date.ToFileTime();\n        date.ToFileTimeUtc();\n        date.ToLocalTime();\n        date.ToLongDateString();\n        date.ToLongTimeString();\n        date.ToShortDateString();\n        date.ToShortTimeString();\n        date.ToString();\n        date.ToUniversalTime();\n        DateTime.TryParse(\"06/01/1993\", out date);\n        DateTime.TryParseExact(\"06/01/1993\", \"dd/MM/yyyy\", CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal, out date);\n    }\n\n    void EdgeCases()\n    {\n        var a = DateTime.Now.AddDays(-1).Ticks; // Noncompliant\n        var b = new DateTimeOffset(DateTime.Now); // Noncompliant\n        var typeName = nameof(DateTime); // Compliant\n    }\n}\n\npublic class FakeDateTime\n{\n    void MyMethod() => new DateTime(1); // Compliant\n\n    public class DateTime\n    {\n        public DateTime(int ticks) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseDateTimeOffsetInsteadOfDateTime.vb",
    "content": "﻿Imports System\nImports System.Globalization\nImports MyAlias = System.DateTime\n\nPublic Class Program\n    Private Sub Constructors()\n        Dim a = New DateTime(1)                                                             ' Noncompliant {{Prefer using \"DateTimeOffset\" instead of \"DateTime\"}}\n'               ^^^^^^^^^^^^^^^\n        a = New DateTime(1, 1, 1)                                                           ' Noncompliant\n        a = New DateTime(1, 1, 1, New GregorianCalendar())                                  ' Noncompliant\n        a = New DateTime(1, 1, 1, 1, 1, 1)                                                  ' Noncompliant\n        a = New DateTime(1, 1, 1, 1, 1, 1, New GregorianCalendar())                         ' Noncompliant\n        a = New DateTime(1, 1, 1, 1, 1, 1, DateTimeKind.Utc)                                ' Noncompliant\n        a = New DateTime(1, 1, 1, 1, 1, 1, 1)                                               ' Noncompliant\n        a = New DateTime(1, 1, 1, 1, 1, 1, 1, New GregorianCalendar())                      ' Noncompliant\n        a = New DateTime(1, 1, 1, 1, 1, 1, 1, DateTimeKind.Utc)                             ' Noncompliant\n        a = New DateTime(1, 1, 1, 1, 1, 1, 1, New GregorianCalendar(), DateTimeKind.Utc)    ' Noncompliant\n        a = New Date(1, 1, 1, 1, 1, 1, 1, New GregorianCalendar(), DateTimeKind.Utc)        ' Noncompliant\n        a = New DateTime(1) ' Noncompliant\n        a = New MyAlias(1) ' FN\n        a = New System.DateTime(1) ' Noncompliant\n    End Sub\n\n    Private Sub Fields()\n        Dim a = Date.MaxValue  ' Noncompliant\n'               ^^^^\n        a = Date.MinValue  ' Noncompliant\n        a = DateTime.MinValue ' Noncompliant\n    End Sub\n\n    Private Sub Properties([date] As Date)\n        Dim a = [date].Date\n        Dim b = [date].Day\n        Dim c = [date].DayOfWeek\n        Dim d = [date].DayOfYear\n        Dim e = [date].Hour\n        Dim f = [date].Kind\n        Dim g = [date].Millisecond\n        Dim h = [date].Minute\n        Dim i = [date].Month\n        Dim l = [date].Second\n        Dim m = [date].Ticks\n        Dim n = [date].TimeOfDay\n        Dim o = [date].Year\n    End Sub\n\n    Private Sub StaticProperties()\n        Dim a = Date.Now ' Noncompliant\n'               ^^^^\n        a = Date.Today ' Noncompliant\n        a = Date.UtcNow ' Noncompliant\n    End Sub\n\n    Private Sub Methods([date] As Date)\n        [date].Add(TimeSpan.Zero)\n        [date].AddDays(0)\n        [date].AddHours(0)\n        [date].AddMilliseconds(0)\n        [date].AddMinutes(0)\n        [date].AddMonths(0)\n        [date].AddSeconds(0)\n        [date].AddTicks(0)\n        [date].AddYears(0)\n        [date].CompareTo([date])\n        Date.Compare([date], [date])\n        Date.DaysInMonth(1, 1)\n        Date.Equals([date], [date])\n        [date].Equals([date])\n        Date.FromBinary(1)\n        Date.FromFileTime(1)\n        Date.FromFileTimeUtc(1)\n        Date.FromOADate(1)\n        [date].GetDateTimeFormats(\"a\"c)\n        [date].GetHashCode()\n        [date].GetTypeCode()\n        [date].IsDaylightSavingTime()\n        Date.IsLeapYear(1)\n        Date.Parse(\"06/01/1993\")\n        Date.ParseExact(\"06/01/1993\", \"dd/MM/yyyy\", Nothing)\n        Date.SpecifyKind([date], DateTimeKind.Local)\n        [date].Subtract([date])\n        [date].ToBinary()\n        [date].ToFileTime()\n        [date].ToFileTimeUtc()\n        [date].ToLocalTime()\n        [date].ToLongDateString()\n        [date].ToLongTimeString()\n        [date].ToShortDateString()\n        [date].ToShortTimeString()\n        [date].ToString()\n        [date].ToUniversalTime()\n        Dim myInt As Integer = Nothing\n        Date.TryParse(\"06/01/1993\", [date])\n        Date.TryParseExact(\"06/01/1993\", \"dd/MM/yyyy\", CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal, [date])\n    End Sub\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseFindSystemTimeZoneById.Net.cs",
    "content": "﻿using System;\nusing TimeZoneConverter;\n\npublic class Program\n{\n    public void Noncompliant()\n    {\n        TZConvert.IanaToWindows(\"Asia/Tokyo\"); // Noncompliant {{Use \"TimeZoneInfo.FindSystemTimeZoneById\" directly instead of \"TZConvert.IanaToWindows\"}}\n//                ^^^^^^^^^^^^^\n        TZConvert.WindowsToIana(\"Asia/Tokyo\"); // Noncompliant\n        string resolvedTimeZone;\n        TZConvert.TryIanaToWindows(\"Asia/Tokyo\", out resolvedTimeZone); // Noncompliant\n        TZConvert.TryWindowsToIana(\"Asia/Tokyo\", out resolvedTimeZone); // Noncompliant\n    }\n\n    public void Compliant()\n    {\n        TZConvert.IanaToRails(\"Asia/Tokyo\");\n        string resolvedTimeZone;\n        TZConvert.TryRailsToIana(\"Asia/Tokyo\", out resolvedTimeZone);\n    }\n}\n\npublic class OtherTZConverterUsage\n{\n\n    private class TZConvert\n    {\n        public static string IanaToWindows(string ianaTimeZoneName)\n        {\n            return string.Empty;\n        }\n    }\n\n    private void Compliant()\n    {\n        TZConvert.IanaToWindows(\"Asia/Tokyo\");\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseFindSystemTimeZoneById.Net.vb",
    "content": "﻿Imports TimeZoneConverter\n\nPublic Class Program\n    Public Sub Noncompliant()\n        TZConvert.IanaToWindows(\"Asia/Tokyo\") ' Noncompliant {{Use \"TimeZoneInfo.FindSystemTimeZoneById\" directly instead of \"TZConvert.IanaToWindows\"}}\n        '         ^^^^^^^^^^^^^\n        TZConvert.WindowsToIana(\"Asia/Tokyo\") ' Noncompliant\n        Dim resolvedTimeZone As String\n        TZConvert.TryIanaToWindows(\"Asia/Tokyo\", resolvedTimeZone) ' Noncompliant\n        TZConvert.TryWindowsToIana(\"Asia/Tokyo\", resolvedTimeZone) ' Noncompliant\n    End Sub\n\n    Public Sub Compliant()\n        TZConvert.IanaToRails(\"Asia/Tokyo\")\n        Dim resolvedTimeZone As String\n        TZConvert.TryRailsToIana(\"Asia/Tokyo\", resolvedTimeZone)\n    End Sub\nEnd Class\n\nPublic Class OtherTZConverterUsage\n    Private Class TZConvert\n        Public Shared Function IanaToWindows(ByVal ianaTimeZoneName As String) As String\n            Return String.Empty\n        End Function\n    End Class\n\n    Private Sub Compliant()\n        TZConvert.IanaToWindows(\"Asia/Tokyo\")\n    End Sub\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseFindSystemTimeZoneById.cs",
    "content": "﻿using System;\nusing TimeZoneConverter;\n\npublic class Program\n{\n    public void Compliant()\n    {\n        TZConvert.IanaToWindows(\"Asia/Tokyo\");\n        TZConvert.WindowsToIana(\"Asia/Tokyo\");\n        string resolvedTimeZone;\n        TZConvert.TryIanaToWindows(\"Asia/Tokyo\", out resolvedTimeZone);\n        TZConvert.TryWindowsToIana(\"Asia/Tokyo\", out resolvedTimeZone);\n\n        TZConvert.IanaToRails(\"Asia/Tokyo\");\n        TZConvert.TryRailsToIana(\"Asia/Tokyo\", out resolvedTimeZone);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseFindSystemTimeZoneById.vb",
    "content": "﻿Imports TimeZoneConverter\n\nPublic Class Program\n    Public Sub Compliant()\n        TZConvert.IanaToWindows(\"Asia/Tokyo\")\n        TZConvert.WindowsToIana(\"Asia/Tokyo\")\n        Dim resolvedTimeZone As String\n        TZConvert.TryIanaToWindows(\"Asia/Tokyo\", resolvedTimeZone)\n        TZConvert.TryWindowsToIana(\"Asia/Tokyo\", resolvedTimeZone)\n\n        TZConvert.IanaToRails(\"Asia/Tokyo\")\n        TZConvert.TryRailsToIana(\"Asia/Tokyo\", resolvedTimeZone)\n    End Sub\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseGenericEventHandlerInstances.CSharp11.cs",
    "content": "﻿using System;\nusing System.Windows.Input;\n\nnamespace Tests.Diagnostics\n{\n    public delegate void DelegateEventHandler(object sender, EventArgs e);\n\n    interface IFoo\n    {\n        static abstract event DelegateEventHandler FooFieldEvent; // Noncompliant\n    }\n\n    public class Foo : IFoo\n    {\n        public static event DelegateEventHandler FooFieldEvent;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseGenericEventHandlerInstances.CSharp9.cs",
    "content": "﻿using System;\n\npublic delegate void DelegateEventHandler(object sender, EventArgs e);\n\nrecord WithEvents\n{\n    public event DelegateEventHandler DelegateEvent; // Noncompliant {{Refactor this delegate to use 'System.EventHandler<TEventArgs>'.}}\n//               ^^^^^^^^^^^^^^^^^^^^\n\n    public event EventHandler CanExecuteChanged; // Compliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseGenericEventHandlerInstances.cs",
    "content": "﻿using System;\nusing System.Windows.Input;\n\nnamespace Tests.Diagnostics\n{\n    public delegate void DelegateEventHandler(object sender, EventArgs e);\n    public delegate void DelegateEventHandler2(object sender, int e);\n\n    class Program\n    {\n        public event DelegateEventHandler DelegateEvent; // Noncompliant {{Refactor this delegate to use 'System.EventHandler<TEventArgs>'.}}\n//                   ^^^^^^^^^^^^^^^^^^^^\n        public event DelegateEventHandler2 DelegateEvent2; // Noncompliant\n\n        public event DelegateEventHandler DelegateEvent3 // Noncompliant\n        {\n            add { }\n            remove { }\n        }\n\n        public event EventHandler<EventArgs> CorrectEvent;\n        public event EventHandler OtherCorrectEvent;\n    }\n\n    class SomeCommand : ICommand\n    {\n        public event EventHandler CanExecuteChanged;\n\n        public bool CanExecute(object parameter)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void Execute(object parameter)\n        {\n            throw new NotImplementedException();\n        }\n    }\n\n    interface IFoo\n    {\n        event DelegateEventHandler FooFieldEvent; // Noncompliant\n    }\n\n    public class Foo : IFoo\n    {\n        public event DelegateEventHandler FooFieldEvent;\n\n        public virtual event DelegateEventHandler FooEvent // Noncompliant\n        { add { } remove { } }\n    }\n\n    public class SubFoo : Foo\n    {\n        public override event DelegateEventHandler FooEvent;\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseGenericWithRefParameters.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class Foo\n    {\n        public void Bar(ref object o1, ref object o2)\n//                  ^^^ Noncompliant {{Make this method generic and replace the 'object' parameter with a type parameter.}}\n//                                 ^^ Secondary@-1\n//                                                ^^ Secondary@-2\n        {\n        }\n\n        public void Bar2<T>(ref T ref1, ref T ref2)\n        {\n        }\n\n        public void Bar3(out object o1,\n                         ref Foo o2,\n                         ref object[] o3)\n        {\n            o1 = null;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseIFormatProviderForParsingDateAndTime.cs",
    "content": "﻿using System;\nusing System.Globalization;\nusing System.Linq;\nusing AliasedDateTime = System.DateTime;\nusing static System.DateTime;\n\nclass Test\n{\n    readonly IFormatProvider formatProviderField = new CultureInfo(\"en-US\");\n\n    void DifferentSyntaxScenarios()\n    {\n        _ = DateTime.Parse(\"01/02/2000\");                                               // Noncompliant\n        //  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        DateTime.Parse(\"01/02/2000\");                                                   // Noncompliant\n\n        // using static and using alias\n        Parse(\"01/02/2000\");                                                            // Noncompliant {{Use a format provider when parsing date and time.}}\n        AliasedDateTime.Parse(\"01/02/2000\");                                            // Noncompliant\n        System.DateTime.Parse(\"01/02/2000\");                                            // Noncompliant\n\n        if (DateTime.TryParse(\"01/02/2000\", out var parsedDate))                        // Noncompliant\n        {\n        }\n\n        DateTime.Parse(provider: null, s: \"02/03/2000\", styles: DateTimeStyles.None);   // Noncompliant\n\n        _ = DateTime.Parse(\"01/02/2000\").AddDays(1);                                    // Noncompliant\n\n        _ = new[] { \"01/02/2000\" }.Select(x => DateTime.Parse(x));                      // Noncompliant\n\n        void InnerMethod()\n        {\n            DateTime.Parse(\"01/02/2000\");                                               // Noncompliant\n        }\n    }\n\n    void CallWithNullIFormatProvider()\n    {\n        DateTime.Parse(\"01/02/2000\", null);                                         // Noncompliant\n        DateTime.Parse(\"01/02/2000\", null, DateTimeStyles.None);                    // Noncompliant\n\n        DateTime.Parse(\"01/02/2000\", (null));                                       // FN\n        DateTime.Parse(\"01/02/2000\", (true ? (IFormatProvider)null : null));        // FN\n\n        IFormatProvider nullFormatProvider = null;\n        DateTime.Parse(\"01/02/2000\", nullFormatProvider);                           // FN\n    }\n\n    void CallWithFormatProvider()\n    {\n        DateTime.Parse(\"01/02/2000\", CultureInfo.InvariantCulture);                 // Compliant\n        DateTime.Parse(\"01/02/2000\", CultureInfo.CurrentCulture);                   // Compliant\n        DateTime.Parse(\"01/02/2000\", CultureInfo.GetCultureInfo(\"en-US\"));          // Compliant\n        DateTime.Parse(\"01/02/2000\", formatProviderField);                          // Compliant\n        DateTime.Parse(\"01/02/2000\", this.formatProviderField);                     // Compliant\n    }\n\n    void ParseMethodsOfNonTemporalTypes()\n    {\n        int.Parse(\"1\");                                 // Compliant - this rule only deals with temporal types\n        double.TryParse(\"1.1\", out var parsedDouble);\n    }\n}\n\nclass CustomTypeCalledDateTime\n{\n    public struct DateTime\n    {\n        public static DateTime Parse(string s) => new DateTime();\n    }\n\n    CustomTypeCalledDateTime()\n    {\n        _ = DateTime.Parse(\"01/02/2000\");               // Compliant - this is not System.DateTime\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseIFormatProviderForParsingDateAndTime.vb",
    "content": "﻿Imports System.Globalization\nImports System.DateTime\n\nClass Test\n    ReadOnly formatProviderField As IFormatProvider = New CultureInfo(\"en-US\")\n\n    Sub DifferentSyntaxScenarios()\n        Dim dt = Date.Parse(\"01/02/2000\")                                           ' Noncompliant\n        '        ^^^^^^^^^^^^^^^^^^^^^^^^\n        Date.Parse(\"01/02/2000\")                                                    ' Noncompliant\n\n        Parse(\"01/02/2000\")                                                         ' Noncompliant {{Use a format provider when parsing date and time.}}\n        System.DateTime.Parse(\"01/02/2000\")                                         ' Noncompliant\n        DATETIME.PARSE(\"01/02/2000\")                                                ' Noncompliant\n\n        Dim parsedDate As Date = Nothing\n\n        If Date.TryParse(\"01/02/2000\", parsedDate) Then                             ' Noncompliant\n        End If\n\n        Date.Parse(provider:=Nothing, s:=\"02/03/2000\", styles:=DateTimeStyles.None) ' Noncompliant\n\n        dt = Date.Parse(\"01/02/2000\").AddDays(1)                                    ' Noncompliant\n\n        Dim parsedDates = {\"01/02/2000\"}.Select(Function(x) Date.Parse(x))          ' Noncompliant\n    End Sub\n\n    Sub CallWithNullIFormatProvider()\n        Date.Parse(\"01/02/2000\", Nothing)                                               ' Noncompliant\n        Date.Parse(\"01/02/2000\", Nothing, DateTimeStyles.None)                          ' Noncompliant\n\n        Date.Parse(\"01/02/2000\", (Nothing))                                             ' FN\n        Date.Parse(\"01/02/2000\", If(True, CType(Nothing, IFormatProvider), Nothing))    ' FN\n\n        Dim nullFormatProvider As IFormatProvider = Nothing\n        Date.Parse(\"01/02/2000\", nullFormatProvider)                                    ' FN\n    End Sub\n\n    Sub CallWithFormatProvider()\n        Date.Parse(\"01/02/2000\", CultureInfo.InvariantCulture)                 ' Compliant\n        Date.Parse(\"01/02/2000\", CultureInfo.CurrentCulture)                   ' Compliant\n        Date.Parse(\"01/02/2000\", CultureInfo.GetCultureInfo(\"en-US\"))          ' Compliant\n        Date.Parse(\"01/02/2000\", formatProviderField)                          ' Compliant\n        Date.Parse(\"01/02/2000\", formatProviderField)                          ' Compliant\n    End Sub\n\n    Sub ParseMethodsOfNonTemporalTypes()\n        Integer.Parse(\"1\")                                                      ' Compliant - this rule only deals with temporal types\n        Dim parsedDouble = Nothing\n        Double.TryParse(\"1.1\", parsedDouble)\n    End Sub\nEnd Class\n\nClass CustomTypeCalledDateTime\n    Public Structure DateTime\n        Public Shared Function Parse(s As String) As DateTime\n            Return New DateTime()\n        End Function\n    End Structure\n\n    Sub New()\n        Dim currentTime = DateTime.Parse(\"01/02/2000\")                          ' Compliant - this is not System.DateTime\n    End Sub\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseIndexingInsteadOfLinqMethods.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.InteropServices;\n\nstatic class Program\n{\n    static void Main() { }\n\n    static void InterfaceCases()\n    {\n        IList<int> ilist = new List<int>();\n\n        ilist.First(); // Noncompliant\n        ilist.Last(); // Noncompliant\n        ilist.ElementAt(42); // Noncompliant\n\n        ilist?.First(); // Noncompliant\n        ilist?.Last(); // Noncompliant\n        ilist?.ElementAt(42); // Noncompliant\n\n        ((IList<int>)new List<int> { 42 }).First(); // Noncompliant\n        ((IList<int>)new List<int> { 42 })?.Last(); // Noncompliant\n    }\n\n    static void ListCases()\n    {\n        var list = new List<int>();\n\n        var badFirst = list.First(); // Noncompliant {{Indexing at 0 should be used instead of the \"Enumerable\" extension method \"First\"}}\n        //                  ^^^^^\n        var badLast = list.Last(); // Noncompliant {{Indexing at Count-1 should be used instead of the \"Enumerable\" extension method \"Last\"}}\n        //                 ^^^^\n        var badElementAt = list.ElementAt(42); // Noncompliant {{Indexing should be used instead of the \"Enumerable\" extension method \"ElementAt\"}}\n        //                      ^^^^^^^^^\n        var badFirstNullable = list?.First(); // Noncompliant {{Indexing at 0 should be used instead of the \"Enumerable\" extension method \"First\"}}\n        //                           ^^^^^\n        var badLastNullable = list?.Last(); // Noncompliant {{Indexing at Count-1 should be used instead of the \"Enumerable\" extension method \"Last\"}}\n        //                          ^^^^\n        var badElementAtNullable = list?.ElementAt(42); // Noncompliant {{Indexing should be used instead of the \"Enumerable\" extension method \"ElementAt\"}}\n        //                               ^^^^^^^^^\n\n        Func<List<int>, int> func = l => l.First(); // Noncompliant\n\n        List<int> DoWork() => null;\n\n        DoWork().First(); // Noncompliant\n        DoWork().Last(); // Noncompliant\n        DoWork().ElementAt(42); // Noncompliant\n\n        DoWork()?.First(); // Noncompliant\n        DoWork()?.Last(); // Noncompliant\n        DoWork()?.ElementAt(42); // Noncompliant\n\n        new List<int> { 42 }.First(); // Noncompliant\n        new List<int> { 42 }.Last(); // Noncompliant\n        new List<int> { 42 }.ElementAt(42); // Noncompliant\n    }\n\n    static void IListImplementation()\n    {\n        var implementsIList = new ImplementsIList<int>();\n\n        (true ? implementsIList : implementsIList).First(); // Noncompliant\n        (true ? implementsIList : implementsIList).Last(); // Noncompliant\n        (true ? implementsIList : implementsIList).ElementAt(42); // Noncompliant\n\n        (implementsIList ?? implementsIList).First(); // Noncompliant\n        (implementsIList ?? implementsIList).Last(); // Noncompliant\n        (implementsIList ?? implementsIList).ElementAt(42); // Noncompliant\n\n        (implementsIList ?? (true ? implementsIList : implementsIList)).First(); // Noncompliant\n        (implementsIList ?? (true ? implementsIList : implementsIList)).Last(); // Noncompliant\n        (implementsIList ?? (true ? implementsIList : implementsIList)).ElementAt(42); // Noncompliant\n\n        implementsIList.Fluent().Fluent().Fluent().Fluent().First(); // Noncompliant\n        implementsIList.Fluent().Fluent().Fluent().Fluent()?.Last(); // Noncompliant\n        implementsIList.Fluent().Fluent().Fluent()?.Fluent().ElementAt(42); // Noncompliant\n        implementsIList.Fluent().Fluent().Fluent()?.Fluent()?.First(); // Noncompliant\n        implementsIList.Fluent().Fluent()?.Fluent().Fluent().Last(); // Noncompliant\n        implementsIList.Fluent().Fluent()?.Fluent().Fluent()?.ElementAt(42); // Noncompliant\n        implementsIList.Fluent().Fluent()?.Fluent()?.Fluent().First(); // Noncompliant\n        implementsIList.Fluent().Fluent()?.Fluent()?.Fluent()?.Last(); // Noncompliant\n        implementsIList.Fluent()?.Fluent().Fluent().Fluent().ElementAt(42); // Noncompliant\n        implementsIList.Fluent()?.Fluent().Fluent().Fluent()?.First(); // Noncompliant\n        implementsIList.Fluent()?.Fluent().Fluent()?.Fluent().Last(); // Noncompliant\n        implementsIList.Fluent()?.Fluent().Fluent()?.Fluent()?.ElementAt(42); // Noncompliant\n        implementsIList.Fluent()?.Fluent()?.Fluent().Fluent().First(); // Noncompliant\n        implementsIList.Fluent()?.Fluent()?.Fluent().Fluent()?.Last(); // Noncompliant\n        implementsIList.Fluent()?.Fluent()?.Fluent()?.Fluent().ElementAt(42); // Noncompliant\n        implementsIList.Fluent()?.Fluent()?.Fluent()?.Fluent()?.First(); // Noncompliant\n        //                                                      ^^^^^\n\n        implementsIList.First(x => x == 42); // Compliant, calls with the predicate cannot be replaced with indexes\n        implementsIList.Last(x => x == 42); // Compliant, calls with the predicate cannot be replaced with indexes\n\n        void AcceptsFirstOrLast<T>(Func<T> methodWithNoArguments)\n        { }\n        void AcceptsElementAt<T>(Func<int, T> methodWithOneArgument)\n        { }\n\n        AcceptsFirstOrLast(implementsIList.First); //FN this is not an invocation, just a member access\n        AcceptsFirstOrLast(implementsIList.Last); //FN this is not an invocation, just a member access\n        AcceptsElementAt(implementsIList.ElementAt); //FN this is not an invocation, just a member access\n    }\n\n    static void IReadonlyListImplementation()\n    {\n        var readonlyList = new ImplementsIReadonlyList<int>();\n        readonlyList.First(); // Noncompliant\n        readonlyList.Last(); // Noncompliant\n        readonlyList.ElementAt(42); // Noncompliant\n\n        readonlyList?.First(); // Noncompliant\n        readonlyList?.Last(); // Noncompliant\n        readonlyList?.ElementAt(42); // Noncompliant\n\n        object obj = null;\n        ((IReadOnlyList<int>)obj).First(); // Noncompliant\n        ((IReadOnlyList<int>)null).Last(); // Noncompliant\n        (null as IReadOnlyList<int>).ElementAt(42); // Noncompliant\n    }\n\n    static void TrueNegatives()\n    {\n        var list = new List<int>();\n        _ = list[0]; // Compliant\n        _ = list[list.Count - 1]; // Compliant\n        _ = list[42]; // Compliant\n\n        T First<T>() => default(T);\n        T Last<T>() => default(T);\n        T ElementAt<T>(int index) => default(T);\n\n        First<int>(); // Compliant\n        Last<int>(); // Compliant\n        ElementAt<int>(42); // Compliant\n\n        var fakeList = new FakeList<int>();\n\n        fakeList.First(); // Compliant\n        fakeList.Last(); // Compliant\n        fakeList.ElementAt(42); // Compliant\n\n        var doesNotImplementIList = new DoesNotImplementIList<int>();\n\n        doesNotImplementIList.First(); // Compliant, does not implement IList\n        doesNotImplementIList.Last(); // Compliant, does not implement IList\n        doesNotImplementIList.ElementAt(42); // Compliant, does not implement IList\n    }\n}\n\nclass ImplementsIList<T> : IList<T>\n{\n    public ImplementsIList<T> Fluent() => this;\n    public T this[int index] { get => default(T); set => value = default(T); }\n\n    // Everything below is just to satisfy IList<T> implementation, useless otherwise\n    public int Count => throw new NotImplementedException();\n    public bool IsReadOnly => throw new NotImplementedException();\n    public void Add(T item) { }\n    public void Clear() { }\n    public bool Contains(T item) => false;\n    public void CopyTo(T[] array, int arrayIndex) { }\n    public int IndexOf(T item) => 42;\n    public void Insert(int index, T item) { }\n    public bool Remove(T item) => false;\n    public void RemoveAt(int index) { }\n    public IEnumerator<T> GetEnumerator() => null;\n    IEnumerator IEnumerable.GetEnumerator() => null;\n}\n\nclass ImplementsIReadonlyList<T> : IReadOnlyList<T>\n{\n    public T this[int index] => default(T);\n    public int Count => 42;\n    public IEnumerator<T> GetEnumerator() => null;\n    IEnumerator IEnumerable.GetEnumerator() => null;\n}\n\nclass DoesNotImplementIList<T> : IEnumerable<T>\n{\n    public IEnumerator<T> GetEnumerator() => null;\n    IEnumerator IEnumerable.GetEnumerator() => null;\n}\n\nclass FakeList<T> { }\n\nstatic class FakeListExtensions\n{\n    public static TSource First<TSource>(this FakeList<TSource> source) => default(TSource);\n    public static TSource Last<TSource>(this FakeList<TSource> source) => default(TSource);\n    public static TSource ElementAt<TSource>(this FakeList<TSource> source, int index) => default(TSource);\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseIndexingInsteadOfLinqMethods.vb",
    "content": "﻿Imports System\nImports System.Collections\nImports System.Collections.Generic\nImports System.Linq\n\nModule Module1\n    Sub Main()\n        Dim list As New List(Of Integer)()\n\n        Dim dummy = list(0) ' Compliant\n        dummy = list(list.Count - 1) ' Compliant\n        dummy = list(42) ' Compliant\n\n        Dim badFirst = list.First() ' Noncompliant {{Indexing at 0 should be used instead of the \"Enumerable\" extension method \"First\"}}\n        '                   ^^^^^\n        Dim badLast = list.Last() ' Noncompliant {{Indexing at Count-1 should be used instead of the \"Enumerable\" extension method \"Last\"}}\n        '                  ^^^^\n        Dim badElementAt = list.ElementAt(42) ' Noncompliant {{Indexing should be used instead of the \"Enumerable\" extension method \"ElementAt\"}}\n        '                       ^^^^^^^^^\n        Dim badFirstNullable = list?.First() ' Noncompliant {{Indexing at 0 should be used instead of the \"Enumerable\" extension method \"First\"}}\n        '                            ^^^^^\n        Dim badLastNullable = list?.Last() ' Noncompliant {{Indexing at Count-1 should be used instead of the \"Enumerable\" extension method \"Last\"}}\n        '                           ^^^^\n        Dim badElementAtNullable = list?.ElementAt(42) ' Noncompliant {{Indexing should be used instead of the \"Enumerable\" extension method \"ElementAt\"}}\n        '                                ^^^^^^^^^\n\n        Dim func As Func(Of List(Of Integer), Integer) = Function(l) l.First() ' Noncompliant\n\n        dummy = DoWork().First() ' Noncompliant\n        dummy = DoWork().Last() ' Noncompliant\n        dummy = DoWork().ElementAt(42) ' Noncompliant\n\n        dummy = DoWork()?.First() ' Noncompliant\n        dummy = DoWork()?.Last() ' Noncompliant\n        dummy = DoWork()?.ElementAt(42) ' Noncompliant\n\n        dummy = (New List(Of Integer)() From {42}).First() ' Noncompliant\n        dummy = (New List(Of Integer)() From {42}).Last() ' Noncompliant\n        dummy = (New List(Of Integer)() From {42}).ElementAt(42) ' Noncompliant\n\n        Dim inlineInitialization = {42}.First() ' FN, .GetTypeInfo(CollectionInitializer) returns null\n        inlineInitialization = {42}.Last() ' FN, .GetTypeInfo(CollectionInitializer) returns null\n        inlineInitialization = {42}.ElementAt(42) ' FN, .GetTypeInfo(CollectionInitializer) returns null\n\n        Dim implementsIList = New ImplementsIList(Of Integer)()\n\n        implementsIList.Fluent().Fluent().Fluent().Fluent().First() ' Noncompliant\n        implementsIList.Fluent().Fluent().Fluent().Fluent()?.Last() ' Noncompliant\n        implementsIList.Fluent().Fluent().Fluent()?.Fluent().ElementAt(42) ' Noncompliant\n        implementsIList.Fluent().Fluent().Fluent()?.Fluent()?.First() ' Noncompliant\n        implementsIList.Fluent().Fluent()?.Fluent().Fluent().Last() ' Noncompliant\n        implementsIList.Fluent().Fluent()?.Fluent().Fluent()?.ElementAt(42) ' Noncompliant\n        implementsIList.Fluent().Fluent()?.Fluent()?.Fluent().First() ' Noncompliant\n        implementsIList.Fluent().Fluent()?.Fluent()?.Fluent()?.Last() ' Noncompliant\n        implementsIList.Fluent()?.Fluent().Fluent().Fluent().ElementAt(42) ' Noncompliant\n        implementsIList.Fluent()?.Fluent().Fluent().Fluent()?.First() ' Noncompliant\n        implementsIList.Fluent()?.Fluent().Fluent()?.Fluent().Last() ' Noncompliant\n        implementsIList.Fluent()?.Fluent().Fluent()?.Fluent()?.ElementAt(42) ' Noncompliant\n        implementsIList.Fluent()?.Fluent()?.Fluent().Fluent().First() ' Noncompliant\n        implementsIList.Fluent()?.Fluent()?.Fluent().Fluent()?.Last() ' Noncompliant\n        implementsIList.Fluent()?.Fluent()?.Fluent()?.Fluent().ElementAt(42) ' Noncompliant\n        implementsIList.Fluent()?.Fluent()?.Fluent()?.Fluent()?.First() ' Noncompliant\n        '                                                       ^^^^^\n\n        implementsIList.First(Function(x) x = 42) ' Compliant, calls with the predicate cannot be replaced with indexes\n        implementsIList.Last(Function(x) x = 42) ' Compliant, calls with the predicate cannot be replaced with indexes\n\n        First(Of Integer)() ' Compliant\n        Last(Of Integer)() ' Compliant\n        ElementAt(Of Integer)(42) ' Compliant\n\n        Dim fakeList As New FakeList(Of Integer)()\n\n        fakeList.First() ' Compliant\n        fakeList.Last() ' Compliant\n        fakeList.ElementAt(42) ' Compliant\n\n    End Sub\n\n    Function DoWork() As List(Of Integer)\n        Return Nothing\n    End Function\n\n    Function First(Of T)() As T\n        Return Nothing\n    End Function\n\n    Function Last(Of T)() As T\n        Return Nothing\n    End Function\n\n    Function ElementAt(Of T)(index As Integer) As T\n        Return Nothing\n    End Function\n\n    Class ImplementsIList(Of T)\n        Implements IList(Of T)\n\n        Public Function Fluent() As ImplementsIList(Of T)\n            Return Me\n        End Function\n\n        Default Public Property Item(ByVal index As Integer) As T Implements IList(Of T).Item\n            Get\n                Return Nothing\n            End Get\n            Set(ByVal value As T)\n                value = Nothing\n            End Set\n        End Property\n\n        Public ReadOnly Property Count As Integer Implements IList(Of T).Count\n            Get\n                Return 42\n            End Get\n        End Property\n\n        Public ReadOnly Property IsReadOnly As Boolean Implements IList(Of T).IsReadOnly\n            Get\n                Return True\n            End Get\n        End Property\n\n        Public Sub Add(ByVal item As T) Implements IList(Of T).Add\n        End Sub\n\n        Public Sub Clear() Implements IList(Of T).Clear\n        End Sub\n\n        Public Function Contains(ByVal item As T) As Boolean Implements IList(Of T).Contains\n            Return False\n        End Function\n\n        Public Sub CopyTo(ByVal array() As T, ByVal arrayIndex As Integer) Implements IList(Of T).CopyTo\n        End Sub\n\n        Public Function IndexOf(ByVal item As T) As Integer Implements IList(Of T).IndexOf\n            Return 42\n        End Function\n\n        Public Sub Insert(ByVal index As Integer, ByVal item As T) Implements IList(Of T).Insert\n        End Sub\n\n        Public Function Remove(ByVal item As T) As Boolean Implements IList(Of T).Remove\n            Return False\n        End Function\n\n        Public Sub RemoveAt(ByVal index As Integer) Implements IList(Of T).RemoveAt\n        End Sub\n\n        Public Function GetEnumerator() As IEnumerator(Of T) Implements IEnumerable(Of T).GetEnumerator\n            Return Nothing\n        End Function\n\n        Private Function IEnumerable_GetEnumerator() As IEnumerator Implements IEnumerable.GetEnumerator\n            Return Nothing\n        End Function\n    End Class\n\nEnd Module\n\nClass FakeList(Of T)\nEnd Class\n\nModule FakeListExtensions\n    <System.Runtime.CompilerServices.Extension>\n    Public Function First(Of TSource)(ByVal source As FakeList(Of TSource)) As TSource\n        Return Nothing\n    End Function\n\n    <System.Runtime.CompilerServices.Extension>\n    Public Function Last(Of TSource)(ByVal source As FakeList(Of TSource)) As TSource\n        Return Nothing\n    End Function\n\n    <System.Runtime.CompilerServices.Extension>\n    Public Function ElementAt(Of TSource)(ByVal source As FakeList(Of TSource), ByVal index As Integer) As TSource\n        Return Nothing\n    End Function\nEnd Module\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseLambdaParameterInConcurrentDictionary.CSharp8.cs",
    "content": "﻿using System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Linq;\n\npublic class Programs\n{\n    void GetOrAdd(ConcurrentDictionary<int, int> dictionary, int key)\n    {\n        // GetOrAdd(TKey, Func<TKey,TValue>)\n        dictionary.GetOrAdd(key, _ => key + 42); // Noncompliant {{Use the lambda parameter instead of capturing the argument 'key'}}\n        //                       ^^^^^^^^^^^^^\n        dictionary.GetOrAdd(key, _ => key); // Noncompliant\n\n        dictionary.GetOrAdd(42, _ => key + 42);\n        dictionary.GetOrAdd(key, key => key + 42); // Compliant (the 'key' referenced is the lambda parameter)\n        dictionary.GetOrAdd(42, key => key + 42);\n        dictionary.GetOrAdd(key, delegate (int k) { return key + 42; }); // Noncompliant\n        dictionary.GetOrAdd(key, delegate (int key) { return key + 42; });\n\n        // GetOrAdd(TKey, TValue)\n        dictionary.GetOrAdd(42, 42);\n        dictionary.GetOrAdd(key, 42);\n        dictionary.GetOrAdd(key, key);\n\n        // GetOrAdd<TArg>(TKey, Func<TKey,TArg,TValue>, TArg)\n        dictionary.GetOrAdd(key, (_, arg) => key + 42, 42);   // Noncompliant\n        //                       ^^^^^^^^^^^^^^^^^^^^\n        dictionary.GetOrAdd(key, delegate (int _, int arg) { return key + 42; }, 42);   // Noncompliant\n        dictionary.GetOrAdd(key, (_, arg) => arg + 42, 42);\n        dictionary.GetOrAdd(42, (key, arg) => arg + 42, 42);\n        dictionary.GetOrAdd(key, (key, arg) => arg + 42, 42);\n    }\n\n    void AddOrUpdate(ConcurrentDictionary<int, int> dictionary, int key)\n    {\n        // AddOrUpdate(TKey, Func<TKey,TValue>, Func<TKey,TValue,TValue>)\n        dictionary.AddOrUpdate(key, _ => key, (_, oldValue) => oldValue + 42); // Noncompliant\n        //                          ^^^^^^^^\n        dictionary.AddOrUpdate(key, _ => key, (_, oldValue) => key + 42);\n        //                          ^^^^^^^^ {{Use the lambda parameter instead of capturing the argument 'key'}}\n        //                                    ^^^^^^^^^^^^^^^^^^^^^^^^^ @-1 {{Use the lambda parameter instead of capturing the argument 'key'}}\n        dictionary.AddOrUpdate(key, _ => 42, (_, oldValue) => oldValue + 42);\n        dictionary.AddOrUpdate(42, _ => 42, (_, oldValue) => oldValue + 42);\n        dictionary.AddOrUpdate(42, _ => 42, (key, oldValue) => key + 42);\n\n        // AddOrUpdate(TKey, TValue, Func<TKey,TValue,TValue>)\n        dictionary.AddOrUpdate(key, 42, (_, oldValue) => key + 42); // Noncompliant\n        dictionary.AddOrUpdate(42, key, (_, oldValue) => key + 42);\n        dictionary.AddOrUpdate(42, 42, (_, oldValue) => key + 42);\n        dictionary.AddOrUpdate(key, key, (_, oldValue) => oldValue + 42);\n        dictionary.AddOrUpdate(42, 42, (key, oldValue) => key + 42);\n        dictionary.AddOrUpdate(42, 42, (_, oldValue) => oldValue + 42);\n\n        // AddOrUpdate<TArg>(TKey, Func<TKey,TArg,TValue>, Func<TKey,TValue,TArg,TValue>, TArg)\n        dictionary.AddOrUpdate(key, (_, arg) => key, (_, oldValue, arg) => oldValue + arg, 42); // Noncompliant\n        dictionary.AddOrUpdate(key, (_, arg) => key, (_, oldValue, arg) => oldValue + key + arg, 42);\n        //                          ^^^^^^^^^^^^^^^\n        //                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @-1\n        dictionary.AddOrUpdate(key, (_, arg) => arg, (_, oldValue, arg) => oldValue + arg, 42);\n        dictionary.AddOrUpdate(42, (_, arg) => key, (_, oldValue, arg) => oldValue + arg, 42);\n        dictionary.AddOrUpdate(42, (_, arg) => key, (_, oldValue, arg) => oldValue + arg, 42);\n        dictionary.AddOrUpdate(42, (_, arg) => arg, (_, oldValue, arg) => oldValue + arg, key);\n        dictionary.AddOrUpdate(42, (_, arg) => key, (_, oldValue, arg) => oldValue + arg, key);\n        dictionary.AddOrUpdate(key, (_, arg) => key, (_, key, arg) => arg, key); // Noncompliant\n        dictionary.AddOrUpdate(42, (_, arg) => key, (_, key, arg) => key + arg, key);\n    }\n\n    void CompliantInvocations(ConcurrentDictionary<int, int> dictionary, HidesMethod<int, int> hidesMethod, List<int> list, int key)\n    {\n        dictionary.TryAdd(key, 42);\n        list.Any(x => key > 0);\n        hidesMethod.GetOrAdd(key, _ => key);\n    }\n\n    void MyDictionary(MyConcurrentDictionary dictionary, int key)\n    {\n        dictionary.GetOrAdd(key, _ => key + 42); // Noncompliant\n    }\n\n    void NameOf(ConcurrentDictionary<string, string> dictionary, string key, string str)\n    {\n        dictionary.GetOrAdd(key, _ => nameof(key)); // Compliant\n        dictionary.GetOrAdd(key, x =>\n        {\n            var something = $\"The name should be {nameof(key)} and not {nameof(x)}\"; // Compliant\n            return x;\n        });\n    }\n\n    class MyConcurrentDictionary : ConcurrentDictionary<int, int> { }\n\n    class HidesMethod<TKey, TValue> : ConcurrentDictionary<TKey, TValue>\n    {\n        public TValue GetOrAdd(TKey key, Func<TKey, TValue> valueFactory) => default(TValue);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseLambdaParameterInConcurrentDictionary.vb",
    "content": "﻿Imports System\nImports System.Collections.Concurrent\nImports System.Collections.Generic\nImports System.Linq\n\nPublic Class Programs\n    Private Sub GetOrAdd(ByVal dictionary As ConcurrentDictionary(Of Integer, Integer), ByVal key As Integer)\n        ' GetOrAdd(TKey, Func<TKey,TValue>)\n        dictionary.GetOrAdd(key, Function(__) key + 42) ' Noncompliant {{Use the lambda parameter instead of capturing the argument 'key'}}\n        '                        ^^^^^^^^^^^^^^^^^^^^^\n        dictionary.GetOrAdd(key, Function(__) key) ' Noncompliant\n\n        dictionary.GetOrAdd(42, Function(__) key + 42)\n        dictionary.GetOrAdd(key, Function(key) key + 42) ' Error [BC36641]\n        ' Noncompliant@-1\n        dictionary.GetOrAdd(42, Function(key) key + 42)  ' Error [BC36641]\n\n        ' GetOrAdd(TKey, TValue)\n        dictionary.GetOrAdd(42, 42)\n        dictionary.GetOrAdd(key, 42)\n        dictionary.GetOrAdd(key, key)\n\n        ' GetOrAdd<TArg>(TKey, Func<TKey,TArg,TValue>, TArg)\n        dictionary.GetOrAdd(key, Function(__, arg) key + 42, 42)   ' Noncompliant\n        '                        ^^^^^^^^^^^^^^^^^^^^^^^^^^\n        dictionary.GetOrAdd(key, Function(__, arg) arg + 42, 42)\n        dictionary.GetOrAdd(42, Function(key, arg) arg + 42, 42)  ' Error [BC36641]\n        dictionary.GetOrAdd(key, Function(key, arg) arg + 42, 42) ' Error [BC36641]\n    End Sub\n\n    Private Sub AddOrUpdate(ByVal dictionary As ConcurrentDictionary(Of Integer, Integer), ByVal key As Integer)\n        ' AddOrUpdate(TKey, Func<TKey,TValue>, Func<TKey,TValue,TValue>)\n        dictionary.AddOrUpdate(key, Function(__) key, Function(__, oldValue) oldValue + 42) ' Noncompliant\n        '                           ^^^^^^^^^^^^^^^^\n        dictionary.AddOrUpdate(key, Function(__) key, Function(__, oldValue) key + 42)\n        '                           ^^^^^^^^^^^^^^^^ {{Use the lambda parameter instead of capturing the argument 'key'}}\n        '                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @-1 {{Use the lambda parameter instead of capturing the argument 'key'}}\n        dictionary.AddOrUpdate(key, Function(__) 42, Function(__, oldValue) oldValue + 42)\n        dictionary.AddOrUpdate(42, Function(__) 42, Function(__, oldValue) oldValue + 42)\n        dictionary.AddOrUpdate(42, Function(__) 42, Function(key, oldValue) key + 42) ' Error [BC36641]\n\n        ' AddOrUpdate(TKey, TValue, Func<TKey,TValue,TValue>)\n        dictionary.AddOrUpdate(key, 42, Function(__, oldValue) key + 42) ' Noncompliant\n        dictionary.AddOrUpdate(42, key, Function(__, oldValue) key + 42)\n        dictionary.AddOrUpdate(42, 42, Function(__, oldValue) key + 42)\n        dictionary.AddOrUpdate(key, key, Function(__, oldValue) oldValue + 42)\n        dictionary.AddOrUpdate(42, 42, Function(key, oldValue) key + 42) ' Error [BC36641]\n        dictionary.AddOrUpdate(42, 42, Function(__, oldValue) oldValue + 42)\n\n        ' AddOrUpdate<TArg>(TKey, Func<TKey,TArg,TValue>, Func<TKey,TValue,TArg,TValue>, TArg)\n        dictionary.AddOrUpdate(key, Function(__, arg) key, Function(__, oldValue, arg) oldValue + arg, 42) ' Noncompliant\n        dictionary.AddOrUpdate(key, Function(__, arg) key, Function(__, oldValue, arg) oldValue + key + arg, 42)\n        '                           ^^^^^^^^^^^^^^^^^^^^^\n        '                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @-1\n        dictionary.AddOrUpdate(key, Function(__, arg) arg, Function(__, oldValue, arg) oldValue + arg, 42)\n        dictionary.AddOrUpdate(42, Function(__, arg) key, Function(__, oldValue, arg) oldValue + arg, 42)\n        dictionary.AddOrUpdate(42, Function(__, arg) key, Function(__, oldValue, arg) oldValue + arg, 42)\n        dictionary.AddOrUpdate(42, Function(__, arg) arg, Function(__, oldValue, arg) oldValue + arg, key)\n        dictionary.AddOrUpdate(42, Function(__, arg) key, Function(__, oldValue, arg) oldValue + arg, key)\n        dictionary.AddOrUpdate(key, Function(__, arg) key, Function(__, key, arg) arg, key) ' Error [BC36641]\n        ' Noncompliant@-1\n        dictionary.AddOrUpdate(42, Function(__, arg) key, Function(__, key, arg) key + arg, key) ' Error [BC36641]\n    End Sub\n\n    Private Sub CompliantInvocations(ByVal dictionary As ConcurrentDictionary(Of Integer, Integer), ByVal hidesMethod As HidesMethod(Of Integer, Integer), ByVal list As List(Of Integer), ByVal key As Integer)\n        dictionary.TryAdd(key, 42) ' Compliant\n        list.Any(Function(x) key > 0) ' Compliant\n        hidesMethod.GetOrAdd(key, Function(__) key) ' Compliant\n    End Sub\n\n    Private Sub MyDictionary(ByVal dictionary As MyConcurrentDictionary, ByVal key As Integer)\n        dictionary.GetOrAdd(key, Function(__) key + 42) ' Noncompliant\n    End Sub\n\n    Private Sub [NameOf](ByVal dictionary As ConcurrentDictionary(Of String, String), ByVal key As String, ByVal str As String)\n        dictionary.GetOrAdd(key, Function(__) NameOf(key)) ' Compliant\n        dictionary.GetOrAdd(key, Function(x)\n                                     Dim something = $\"The name should be {NameOf(key)} and not {NameOf(x)}\" ' Compliant\n                                     Return x\n                                 End Function)\n    End Sub\n\n    Class MyConcurrentDictionary\n        Inherits ConcurrentDictionary(Of Integer, Integer)\n    End Class\n\n    Class HidesMethod(Of TKey, TValue)\n        Inherits ConcurrentDictionary(Of TKey, TValue)\n\n        Public Function GetOrAdd(ByVal key As TKey, ByVal valueFactory As Func(Of TKey, TValue)) As TValue\n            Return Nothing\n        End Function\n    End Class\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseNumericLiteralSeparator.CSharp9.cs",
    "content": "﻿nint i1 = 10000000;  // Noncompliant; is this 10 million or 100 million?\nint i2 = 10_000_000;\n\nnuint j1 = 0b01101001010011011110010101011110;  // Noncompliant {{Add underscores to this numeric value for readability.}}\nnuint j2 = 0b01101001_01001101_11100101_01011110;\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseNumericLiteralSeparator.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    class Program\n    {\n        void Invalid()\n        {\n            int i = 10000000;  // Noncompliant; is this 10 million or 100 million?\n            int j = 0b01101001010011011110010101011110;  // Noncompliant {{Add underscores to this numeric value for readability.}}\n//                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            long l = 0x7fffffffffffffffL;  // Noncompliant\n        }\n\n        void Valid()\n        {\n            int i = 10_000_000;\n            int j = 0b01101001_01001101_11100101_01011110;\n            long k = 0x7fff_ffff_ffff_ffffL;\n            var l = 1000;\n            var m = 0b001;\n            var n = 0x000;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseParamsForVariableArguments.Latest.Partial.cs",
    "content": "﻿using System;\nusing System.Runtime.InteropServices;\n\npublic partial class PartialConstructor\n{\n    public partial PartialConstructor(__arglist)    // Noncompliant\n    {\n\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseParamsForVariableArguments.Latest.cs",
    "content": "﻿using System;\nusing System.Runtime.InteropServices;\n\nnamespace Tests.Diagnostics\n{\n    public interface IFoo\n    {\n        static abstract void Foo(__arglist); // Noncompliant\n    }\n\n    public class BaseClass : IFoo\n    {\n        public static void Foo(__arglist) // Compliant - interface implementation\n        {\n        }\n\n        public virtual void Do(__arglist) // Noncompliant\n        {\n        }\n    }\n}\n\npublic class BaseClass(__arglist) // Nomcompliant {{Use the 'params' keyword instead of '__arglist'.}}\n//           ^^^^^^^^^\n{\n    void Foo()\n    {\n        ArgIterator argumentIterator = new ArgIterator(__arglist); // Error [CS0190]\n    }\n}\n\npublic static class Extensions\n{\n    extension(string)\n    {\n        public static string StaticExtension(__arglist) => \"42\"; // Noncompliant\n    }\n    extension(string s)\n    {\n        public string InstanceExtension(__arglist) => \"42\";      // Noncompliant\n    }\n}\n\npublic partial class PartialConstructor\n{\n    public partial PartialConstructor(__arglist);\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseParamsForVariableArguments.cs",
    "content": "﻿using System;\nusing System.Runtime.InteropServices;\n\nnamespace Tests.Diagnostics\n{\n    public interface IFoo\n    {\n        void Foo(__arglist); // Noncompliant\n    }\n\n    public class BaseClass : IFoo\n    {\n        public void Foo(__arglist) // Compliant - interface implementation\n        {\n        }\n\n        public virtual void Do(__arglist) // Noncompliant\n        {\n        }\n    }\n\n    public class Program : BaseClass\n    {\n        public Program(__arglist) { } // Noncompliant {{Use the 'params' keyword instead of '__arglist'.}}\n\n        public void Bar(__arglist) // Noncompliant {{Use the 'params' keyword instead of '__arglist'.}}\n//                  ^^^\n        {\n            ArgIterator argumentIterator = new ArgIterator(__arglist);\n            for (int i = 0; i < argumentIterator.GetRemainingCount(); i++)\n            {\n                Console.WriteLine(\n                    __refvalue(argumentIterator.GetNextArg(), string));\n            }\n        }\n\n        protected void Bar2(__arglist) // Noncompliant\n        {\n            ArgIterator argumentIterator = new ArgIterator(__arglist);\n            for (int i = 0; i < argumentIterator.GetRemainingCount(); i++)\n            {\n                Console.WriteLine(\n                    __refvalue(argumentIterator.GetNextArg(), string));\n            }\n        }\n\n        public void Bar3(int val, string name, __arglist) // Noncompliant\n        {\n            ArgIterator argumentIterator = new ArgIterator(__arglist);\n            for (int i = 0; i < argumentIterator.GetRemainingCount(); i++)\n            {\n                Console.WriteLine(\n                    __refvalue(argumentIterator.GetNextArg(), string));\n            }\n        }\n\n        public override void Do(__arglist) // Compliant - override\n        {\n        }\n\n        [DllImport(\"msvcrt40.dll\")]\n        public static extern int printf(string format, __arglist); // Compliant - interop\n\n        public void Bar4()\n        {\n            printf(\"Hello %s!\\n\", __arglist(\"Bart\"));\n        }\n\n        private class FooBar\n        {\n            public void Bar4(__arglist) // Compliant - private method\n            {\n                ArgIterator argumentIterator = new ArgIterator(__arglist);\n                for (int i = 0; i < argumentIterator.GetRemainingCount(); i++)\n                {\n                    Console.WriteLine(\n                        __refvalue(argumentIterator.GetNextArg(), string));\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UsePascalCaseForNamedPlaceHolders.Latest.cs",
    "content": "﻿using System;\nusing Microsoft.Extensions.Logging;\n\n// https://github.com/SonarSource/sonar-dotnet/issues/9545\npublic class Repro_9545\n{\n    public void Method(ILogger logger, int number)\n    {\n        logger.LogDebug(\"\"\"Repro_9545 filter: {number}\"\"\", number);\n        //              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        //                                     ^^^^^^                                 Secondary @-1\n        logger.LogDebug(\"\"\"\n            Repro_9545 filter: {number}\n            \"\"\", number);                                                          // Noncompliant @-2 ^25#59\n                                                                                   // Secondary @-2 ^33#6\n        logger.LogDebug($@\"{nameof(Repro_9545)} filter: {{number}}\", number);\n        //              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        //                                                ^^^^^^                      Secondary @-1\n        logger.LogDebug(@$\"{nameof(Repro_9545)} filter: {{number}}\", number);\n        //              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        //                                                ^^^^^^                      Secondary @-1\n        logger.LogDebug($$\"\"\"{{nameof(Repro_9545)}} filter: {number}\"\"\", number);\n        //              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        //                                                   ^^^^^^                   Secondary @-1\n        logger.LogDebug($$$\"\"\"\n                           {{{nameof(Repro_9545)}}} filter: {number}\n                           \"\"\", number);                                            // Noncompliant @-2 ^25#106\n                                                                                    // Secondary @-2 ^62#6\n        logger.LogDebug($$$\"\"\"\n                           {{{nameof(\n    Repro_9545)}}} filter: {number}\n                           \"\"\", number);                                            // Noncompliant @-3 ^25#111\n                                                                                    // Secondary @-2 ^29#6\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UsePascalCaseForNamedPlaceHolders.cs",
    "content": "﻿using System;\nusing Microsoft.Extensions.Logging;\n\npublic class Program\n{\n    public void Basics(ILogger logger, int arg)\n    {\n        logger.LogInformation(\"No placeholder\");                    // Compliant\n        logger.LogInformation(\"Arg: {Arg}\", arg);\n        logger.LogInformation(\"Arg: {0}\", arg);\n        logger.LogInformation(\"Arg: {_}\", arg);\n        logger.LogInformation(\"Arg: {_name}\", arg);\n        logger.LogInformation(\"Arg: {_Name}\", arg);\n        logger.LogInformation(\"Arg: {}\", arg);\n        logger.LogInformation(\"Arg: {{arg}}\", arg);\n        logger.LogInformation(\"Arg: {Arg} {Arg}\", arg, arg);\n        logger.LogInformation(\"Arg: {Arg1} {Arg2}\", arg, arg);\n\n        logger.BeginScope(\"scope\");\n        logger.BeginScope(\"{arg}\", arg);\n\n        logger.LogInformation(\"Arg: {arg}\", arg);\n        //                    ^^^^^^^^^^^^ {{Use PascalCase for named placeholders.}}\n        //                           ^^^ Secondary @-1\n\n        logger.LogInformation(\"Arg: {Arg} {arg}\", arg, arg);\n        //                    ^^^^^^^^^^^^^^^^^^\n        //                                 ^^^ Secondary @-1\n\n        logger.LogInformation(\"Arg: {arg} {Arg}\", arg, arg);\n        //                    ^^^^^^^^^^^^^^^^^^\n        //                           ^^^ Secondary @-1\n\n        logger.LogInformation(\"Arg: {arg} {arg}\", arg, arg);\n        //                    ^^^^^^^^^^^^^^^^^^\n        //                           ^^^ Secondary @-1\n        //                                 ^^^ Secondary @-2\n\n        logger.LogInformation(@\"\n             Arg: {arg}\n             {arg}\", arg, arg);\n        // Noncompliant @-3 ^31#46\n        // Secondary @-3    ^20#3\n        // Secondary @-3    ^15#3\n\n        LoggerExtensions.LogInformation(logger, \"Arg: {arg}\", arg); // Noncompliant\n                                                                    // Secondary @-1\n\n        logger.LogInformation(\"Arg: {Argumentvalue}\", arg);         // FN - should be {ArgumentValue}, but the analyzer doesn't use any kind of word dictionary, it only checks the first character\n    }\n\n    public void NamedArguments(ILogger logger, int arg)\n    {\n        logger.LogInformation(args: new object[] { arg }, message: \"Arg: {Arg}\");   // Compliant\n        logger.LogInformation(message: \"Arg: {Arg}\", args: new object[] { arg });   // Compliant\n        logger.LogInformation(args: new object[] { arg }, message: \"Arg: {arg}\");   // Noncompliant\n                                                                                    // Secondary @-1\n        logger.LogInformation(message: \"Arg: {arg}\", args: new object[] { arg });   // Noncompliant\n                                                                                    // Secondary @-1\n    }\n\n    public void IncorrectPlaceholderFormat(ILogger logger, int arg)\n    {\n        logger.LogInformation(\"Arg: {@arg}\", arg);      // Noncompliant\n                                                        // Secondary @-1\n        logger.LogInformation(\"Arg: {&arg}\", arg);\n        logger.LogInformation(\"Arg: {arg,23}\", arg);    // Noncompliant\n                                                        // Secondary @-1\n        logger.LogInformation(\"Arg: {arg,arg}\", arg);\n    }\n\n    public void ClassImplementsILogger(CustomLogger logger, int arg)\n    {\n        logger.LogCritical(\"Arg: {arg}\", arg);                      // Noncompliant\n                                                                    // Secondary @-1\n        logger.LogInformation(\"Arg: {arg}\", arg);                   // Noncompliant\n                                                                    // Secondary @-1\n    }\n\n    public void ClassDoesNotImplementILogger(NotILogger notILogger, int arg)\n    {\n        notILogger.LogInformation(\"Arg: {arg}\", arg);\n        notILogger.LogCritical(\"Arg: {arg}\", arg);\n    }\n\n    public void Interpolation(ILogger logger, int arg)\n    {\n        logger.LogInformation($\"Arg: {arg}\");                       // Compliant\n        logger.LogInformation($\"Arg: {{arg}}\", arg);                // Noncompliant\n                                                                    // Secondary @-1\n        logger.LogInformation($\"{arg}: {{arg}}\", arg);\n        //                    ^^^^^^^^^^^^^^^^^\n        //                               ^^^                           Secondary @-1\n        logger.LogInformation(\"Arg: \" + $\"{{arg}}\", arg);           // FN\n        logger.LogInformation(\"Arg: \" + $\"{arg} {{arg}}\", arg);     // FN\n    }\n\n    public class CustomLogger : ILogger\n    {\n        public IDisposable BeginScope<TState>(TState state) => null;\n        public bool IsEnabled(LogLevel logLevel) => false;\n        public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)\n        {\n        }\n    }\n\n    public class NotILogger\n    {\n        public void LogCritical(string message, params object[] args) { }\n        public void LogInformation(string message, params object[] args) { }\n    }\n\n    public static class NotILoggerExtensions\n    {\n        public static void LogCritical(NotILogger logger, string message, params object[] args) { }\n    }\n\n    // https://github.com/SonarSource/sonar-dotnet/issues/9545\n    public class Repro_9545\n    {\n        public void Method(ILogger logger, int number)\n        {\n            logger.LogDebug($\"{nameof(Repro_9545)} filter: {{number}}\", number);\n            //              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            //                                               ^^^^^^                    Secondary @-1\n            logger.LogDebug($\"Repro_9545 filter: {{number}}\", number);\n            //              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            //                                     ^^^^^^                              Secondary @-1\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseReturnStatement.vb",
    "content": "﻿Imports System\n\nPublic Class ImplicitReturnStatementsAreNoncompliant\n    Implements IInterface\n\n    Public Function AssignedReturnValueOnly() As Integer\n        AssignedReturnValueOnly = 42 ' Noncompliant ^9#23\n    End Function\n\n    Public Function AssignementStatements() As Integer\n        AssignementStatements = 101 ' Noncompliant {{Use a 'Return' statement; assigning returned values to function names is obsolete.}}\n        AssignementStatements += 42 ' Noncompliant {{Use a 'Return' statement; assigning returned values to function names is obsolete.}}\n        AssignementStatements -= 17 ' Noncompliant {{Use a 'Return' statement; assigning returned values to function names is obsolete.}}\n        AssignementStatements *= 99 ' Noncompliant {{Use a 'Return' statement; assigning returned values to function names is obsolete.}}\n        AssignementStatements /= 24 ' Noncompliant {{Use a 'Return' statement; assigning returned values to function names is obsolete.}}\n        AssignementStatements \\= 21 ' Noncompliant {{Use a 'Return' statement; assigning returned values to function names is obsolete.}}\n        AssignementStatements &= 42 ' Noncompliant {{Use a 'Return' statement; assigning returned values to function names is obsolete.}}\n        AssignementStatements ^= 14 ' Noncompliant {{Use a 'Return' statement; assigning returned values to function names is obsolete.}}\n        AssignementStatements <<= 2 ' Noncompliant {{Use a 'Return' statement; assigning returned values to function names is obsolete.}}\n        AssignementStatements >>= 1 ' Noncompliant {{Use a 'Return' statement; assigning returned values to function names is obsolete.}}\n    End Function\n\n    Public Function CaseInsensitive() As Integer\n        CASEINSENSITIVE = 42  ' Noncompliant\n    End Function\n\n    Public Shared Function SharedFunction() As Integer\n        SharedFunction = 42  ' Noncompliant\n    End Function\n\n    Public Function ExplictlyReturnDefaultReturnValue() As Integer\n        Return ExplictlyReturnDefaultReturnValue ' Noncompliant {{Do not make use of the implicit return value.}}\n    End Function\n\n    Public Function ReadAssignementStatements() As Integer\n        Dim value As Integer = ReadAssignementStatements ' Noncompliant  {{Do not make use of the implicit return value.}}\n        value += ReadAssignementStatements  ' Noncompliant {{Do not make use of the implicit return value.}}\n        value -= ReadAssignementStatements  ' Noncompliant {{Do not make use of the implicit return value.}}\n        value *= ReadAssignementStatements  ' Noncompliant {{Do not make use of the implicit return value.}}\n        value /= ReadAssignementStatements  ' Noncompliant {{Do not make use of the implicit return value.}}\n        value \\= ReadAssignementStatements  ' Noncompliant {{Do not make use of the implicit return value.}}\n        value &= ReadAssignementStatements  ' Noncompliant {{Do not make use of the implicit return value.}}\n        value ^= ReadAssignementStatements  ' Noncompliant {{Do not make use of the implicit return value.}}\n        value <<= ReadAssignementStatements ' Noncompliant {{Do not make use of the implicit return value.}}\n        value >>= ReadAssignementStatements ' Noncompliant {{Do not make use of the implicit return value.}}\n        Return value\n    End Function\n\n    Public Function ImplementedInterfaceMethod() As Integer Implements IInterface.ImplementedInterfaceMethod\n        ImplementedInterfaceMethod = 42 ' Noncompliant\n    End Function\n\n    Private Function ArgumentName() As Integer\n        WithExplicitArgumentName(Something:=ArgumentName)    ' Noncompliant\n    End Function\n\n    Private Sub WithExplicitArgumentName(Something As Integer)\n    End Sub\n\n    ' https://github.com/SonarSource/sonar-dotnet/issues/4159\n    Public Function Repro_4159() As String\n        Repro_4159 = NameOf(Exception)  ' Noncompliant\n        Return NameOf(Repro_4159)       ' Compliant\n    End Function\n\nEnd Class\n\nNamespace NamespaceName\n\n    Public Class Something\n    End Class\n\nEnd Namespace\n\nPublic Class Source\n\n    Public Event SomeEvent()\n\nEnd Class\n\nPublic Class DoesNotApplyOn\n    Implements IInterface\n\n    Private WithEvents fSource As Source\n\n    Public Function FunctionWithExplictReturnOnly()\n        Return 42 'Compliant\n    End Function\n\n    Public Sub SubMethods(number As Integer)\n        Dim SubMethods = number ' Compliant\n    End Sub\n\n    Public Function RecursiveFunctionCalls(number As Integer)\n        If number = 42 Then\n            Return 42\n        Else\n            Return RecursiveFunctionCalls(42) ' Compliant, method call\n        End If\n    End Function\n\n    Public Function CallToOtherProperty(other As OtherType) As Integer\n        With other\n            Return .CallToOtherProperty ' Compliant\n        End With\n    End Function\n\n    Public Function CallToOtherFunction(other As OtherType) As Integer\n        With other\n            Return .CallToOtherFunction() ' Compliant\n        End With\n    End Function\n\n    Public Function WriteToOtherProperty() As OtherType\n        Return New OtherType With\n        {\n            .WriteToOtherProperty = 69 ' Compliant\n        }\n    End Function\n\n    Public Function WriteToOtherFunction(other As OtherType) As Integer\n        With other\n            Return .WriteToOtherFunction(42) ' Compliant\n        End With\n    End Function\n\n    Public Function ImplementedInterfaceMethod() As Integer Implements IInterface.ImplementedInterfaceMethod ' Compliant\n        Return 42\n    End Function\n\n    <CustomAttribute>   ' Compliant\n    Public Function CustomAttribute() As Integer\n    End Function\n\n    Private Function ArgumentName() As Integer\n        WithExplicitArgumentName(ArgumentName:=42)  ' Compliant\n    End Function\n\n    Private Sub WithExplicitArgumentName(ArgumentName As Integer)\n    End Sub\n\n    ' https://github.com/SonarSource/sonar-dotnet/issues/4347\n    Public Function OtherType() As OtherType    ' Compliant\n        Dim Ret As OtherType                    ' Compliant\n        Dim X As New OtherType                  ' Compliant\n    End Function\n\n    Public Function NamespaceName() As NamespaceName.Something  'Compliant\n        Dim Ret As NamespaceName.Something                      'Compliant\n    End Function\n\n    Public Function Something() As NamespaceName.Something      'Compliant\n        Dim Ret As NamespaceName.Something                      'Compliant\n    End Function\n\n    Public Sub SomeEvent() Handles fSource.SomeEvent\n        Dim S As Source\n        AddHandler S.SomeEvent, AddressOf SomeEvent\n    End Sub\n\nEnd Class\n\n' https://sonarsource.atlassian.net/browse/NET-1569\nPublic Class Repro_1569\n    Public Function TestFunc() As String\n        Return Invoke(AddressOf TestFunc) ' Compliant\n    End Function\n\n    Public Function AddressOfInAssignment() As String\n        Dim d As Func(Of String) = AddressOf AddressOfInAssignment ' Compliant\n        Return d()\n    End Function\n\n    Private Function Invoke(func As Func(Of String)) As String\n        Return func()\n    End Function\n\nEnd Class\n\nPublic Class OtherType\n    Public Property CallToOtherProperty As Integer\n\n    Public Property WriteToOtherProperty As Integer\n\n    Public Function CallToOtherFunction() As Integer\n        Return 42\n    End Function\n\n    Public Function WriteToOtherFunction(number As Integer) As Integer\n        Return number\n    End Function\nEnd Class\n\nPublic Interface IInterface\n    Function ImplementedInterfaceMethod() As Integer\nEnd Interface\n\nPublic Class CustomAttribute\n    Inherits Attribute\n\nEnd Class\n\n' https://sonarsource.atlassian.net/browse/NET-2559\nPublic Module Repro_2559\n\n    Public Function FunctionNameAndAlsoTypeName() As UInteger\n        Dim G As New Generic(Of FunctionNameAndAlsoTypeName)    ' Compliant\n        GenericMethod(Of FunctionNameAndAlsoTypeName)()         ' Compliant\n    End Function\n\n    Public Sub GenericMethod(Of T)()\n    End Sub\n\nEnd Module\n\nPublic Class FunctionNameAndAlsoTypeName\nEnd Class\n\nPublic Class Generic(Of T)\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseShortCircuitingOperator.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public class UseShortCircuitingOperator\n    {\n        private bool field;\n        private bool Property { get; }\n\n        public UseShortCircuitingOperator()\n        {\n            var b = true || false;   // Fixed\n            b = true && false;       // Fixed\n            b = true && false;\n\n            var i = 1 | 2;\n        }\n\n        public void ExtendedText(bool parameter)\n        {\n            var local = true;\n            var a = true || !true;                  // Fixed\n            a = true || parameter;                  // Fixed\n            a = true || local;                      // Fixed\n            a = true || field;                      // Fixed\n            a = true || Property;                   // Fixed\n            a = true || ReturnSomeBool();           // Fixed\n            a = true || !parameter;                 // Fixed\n            a = true || (parameter ? true : false); // Fixed\n        }\n\n        private bool ReturnSomeBool() =>\n            Environment.Is64BitOperatingSystem;\n\n        public void Repro_8834(bool a, bool b, bool c)\n        {\n            // CodeFix should add parantheses to preserve operator precedence\n            _ = a && b || c; // Fixed\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseShortCircuitingOperator.Fixed.vb",
    "content": "﻿Public Class ClassWithLogicalStatements\n\n    Public Function [And](first As Boolean, second As Boolean) As Boolean\n\n        If first AndAlso second Then ' Fixed\n            Return True\n        End If\n        Return False\n\n    End Function\n\n    Public Function [AndAlso](first As Boolean, second As Boolean) As Boolean\n\n        If first AndAlso second Then 'Compliant, using AndAlso.\n            Return True\n        End If\n        Return False\n\n    End Function\n\n    Public Function [Or](first As Boolean, second As Boolean) As Boolean\n\n        If first OrElse second Then ' Fixed\n            Return True\n        End If\n        Return False\n\n    End Function\n\n    Public Function [OrElse](first As Boolean, second As Boolean) As Boolean\n\n        If first OrElse second Then 'Compliant, using OrElse.\n            Return True\n        End If\n        Return False\n\n    End Function\n\n    Public Function [And](first As Integer, second As Boolean) As Integer\n        Return first And second 'Compliant, bitwise operators\n    End Function\n\n    Public Function [Or](first As Integer, second As Boolean) As Integer\n        Return first Or second 'Compliant, bitwise operators\n    End Function\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseShortCircuitingOperator.Latest.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\n\npublic class FieldKeyword\n{\n    public bool Prop\n    {\n        get\n        {\n            if (true | field)        // Noncompliant\n            {\n                return field | true; // Noncompliant\n            }\n            return false | field;    // Noncompliant\n        }\n    }\n}\n\npublic class NullCondionalAssignment\n{\n    public class Sample\n    {\n        public bool Value { get; set; } \n    }\n\n    public void Method(Sample input)\n    {\n        input?.Value = true | false; // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseShortCircuitingOperator.TopLevelStatements.Fixed.cs",
    "content": "﻿var b = true || false;   // Fixed\nb = true && false;       // Fixed\n\nb = true && false;\n\nvar i = 1 | 2;\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseShortCircuitingOperator.TopLevelStatements.cs",
    "content": "﻿var b = true | false;   // Noncompliant {{Correct this '|' to '||'.}}\nb = true & false;       // Noncompliant {{Correct this '&' to '&&'.}}\n//       ^\n\nb = true && false;\n\nvar i = 1 | 2;\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseShortCircuitingOperator.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public class UseShortCircuitingOperator\n    {\n        private bool field;\n        private bool Property { get; }\n\n        public UseShortCircuitingOperator()\n        {\n            var b = true | false;   // Noncompliant {{Correct this '|' to '||'.}}\n            b = true & false;       // Noncompliant {{Correct this '&' to '&&'.}}\n//                   ^\n            b = true && false;\n\n            var i = 1 | 2;\n        }\n\n        public void ExtendedText(bool parameter)\n        {\n            var local = true;\n            var a = true | !true;                  // Noncompliant {{Correct this '|' to '||'.}}                                                                              Right hand side detected as constant\n            a = true | parameter;                  // Noncompliant {{Correct this '|' to '||'.}}                                                                              Right hand side detected as parameter reference\n            a = true | local;                      // Noncompliant {{Correct this '|' to '||'.}}                                                                              Right hand side detected as local reference\n            a = true | field;                      // Noncompliant {{Correct this '|' to '||'.}}                                                                              Right hand side detected as field reference\n            a = true | Property;                   // Noncompliant {{Correct this '|' to '||'.}}                                                                              Right hand side detected as property reference\n            a = true | ReturnSomeBool();           // Noncompliant {{Correct this '|' to '||' and extract the right operand to a variable if it should always be evaluated.}} Right hand side detected as possible side effect\n            a = true | !parameter;                 // Noncompliant {{Correct this '|' to '||' and extract the right operand to a variable if it should always be evaluated.}} Right hand side detected as possible side effect\n            a = true | (parameter ? true : false); // Noncompliant {{Correct this '|' to '||' and extract the right operand to a variable if it should always be evaluated.}} Right hand side detected as possible side effect\n        }\n\n        private bool ReturnSomeBool() =>\n            Environment.Is64BitOperatingSystem;\n\n        public void Repro_8834(bool a, bool b, bool c)\n        {\n            // CodeFix should add parantheses to preserve operator precedence\n            _ = a && b | c; // Noncompliant\n            //         ^\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseShortCircuitingOperator.vb",
    "content": "﻿Public Class ClassWithLogicalStatements\n\n    Public Function [And](first As Boolean, second As Boolean) As Boolean\n\n        If first And second Then ' Noncompliant {{Correct this 'And' to 'AndAlso'.}}\n'                ^^^\n            Return True\n        End If\n        Return False\n\n    End Function\n\n    Public Function [AndAlso](first As Boolean, second As Boolean) As Boolean\n\n        If first AndAlso second Then 'Compliant, using AndAlso.\n            Return True\n        End If\n        Return False\n\n    End Function\n\n    Public Function [Or](first As Boolean, second As Boolean) As Boolean\n\n        If first Or second Then ' Noncompliant {{Correct this 'Or' to 'OrElse'.}}\n            Return True\n        End If\n        Return False\n\n    End Function\n\n    Public Function [OrElse](first As Boolean, second As Boolean) As Boolean\n\n        If first OrElse second Then 'Compliant, using OrElse.\n            Return True\n        End If\n        Return False\n\n    End Function\n\n    Public Function [And](first As Integer, second As Boolean) As Integer\n        Return first And second 'Compliant, bitwise operators\n    End Function\n\n    Public Function [Or](first As Integer, second As Boolean) As Integer\n        Return first Or second 'Compliant, bitwise operators\n    End Function\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseStringCreate.CSharp10.cs",
    "content": "﻿using System;\nusing System.Globalization;\n\nclass Program\n{\n    void Method(string value, FormattableString formString)\n    {\n        FormattableString.CurrentCulture($\"Value: {value}\"); // Noncompliant {{Use \"string.Create\" instead of \"FormattableString\".}}\n        //                ^^^^^^^^^^^^^^\n        FormattableString.Invariant($\"Value: {value}\"); // Noncompliant {{Use \"string.Create\" instead of \"FormattableString\".}}\n        //                ^^^^^^^^^\n\n        string.Create(CultureInfo.CurrentCulture, $\"Value: {value}\");    // Compliant\n        string.Create(CultureInfo.InvariantCulture, $\"Value: {value}\");  // Compliant\n\n        FormattableString.CurrentCulture(formString); // Compliant\n        FormattableString.Invariant(formString);      // Compliant\n\n        var classImplementingIFormattable = new ClassImplementingIFormattable();\n        classImplementingIFormattable.CurrentCulture($\"Value: {value}\"); // Compliant\n        classImplementingIFormattable.Invariant();                       // Compliant\n    }\n\n    class ClassImplementingIFormattable : IFormattable\n    {\n        public string ToString(string? format, IFormatProvider? formatProvider) => \"\";\n        public string CurrentCulture(FormattableString formattable) => \"\";\n        public string Invariant() => \"\";\n    }\n}\n\nclass CustomFormattableString\n{\n    static class FormattableString\n    {\n        public static string CurrentCulture(string formattable) => \"\";\n        public static string Invariant(string formattable) => \"\";\n    }\n\n    void Test(string value)\n    {\n        FormattableString.CurrentCulture($\"Value: {value}\"); // Compliant\n        FormattableString.Invariant($\"Value: {value}\");      // Compliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseStringCreate.cs",
    "content": "﻿using System;\nusing System.Globalization;\n\npublic class Program\n{\n    void Method(string value)\n    {\n        FormattableString.CurrentCulture($\"Value: {value}\"); // Error [CS0117]\n        FormattableString.Invariant($\"Value: {value}\"); // Compliant (applies to .NET versions after .NET 6, when these string.Create overloads were introduced)\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseStringIsNullOrEmpty.CSharp10.cs",
    "content": "﻿using System;\n\nnamespace Tests.TestCases\n{\n    class UseStringIsNullOrEmpty\n    {\n        public const string ConstEmptyString = \"\";\n        public const string InterPolatedString = $\"{ConstEmptyString}\";\n\n        public void Test(string value)\n        {\n            if (value.Equals(InterPolatedString)) // Noncompliant {{Use 'string.IsNullOrEmpty()' instead of comparing to empty string.}}\n            { }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseStringIsNullOrEmpty.CSharp11.cs",
    "content": "﻿using System;\n\nnamespace Tests.TestCases\n{\n    class UseStringIsNullOrEmpty\n    {\n        public const string ConstEmptyString = \"\"\"\n\n                                               \"\"\";\n\n        public const string InterPolatedString = $$\"\"\"{{ConstEmptyString}}\"\"\";\n\n        public void Test(string value)\n        {\n            if (value.Equals(InterPolatedString)) // Noncompliant {{Use 'string.IsNullOrEmpty()' instead of comparing to empty string.}}\n            { }\n\n            // Noncompliant@+1\n            if (value.Equals(\"\"\"\n                    \n                             \"\"\"))\n\n            { }\n        }\n\n        public void SpanMatch(Span<char> span, ReadOnlySpan<char> readonlySpan)\n        {\n            var a = span is \"\"\"\n\n                            \"\"\"; // Compliant\n\n            var b = readonlySpan is \"\"\"\n\n                                    \"\"\"; // Compliant\n        }\n\n        public bool ListPattern(string[] uris) =>\n            uris is [\"\"\"\n\n                     \"\"\",\n                     \"\"\"\n\n                     \"\"\"]; // Compliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseStringIsNullOrEmpty.cs",
    "content": "﻿using System;\n\nnamespace Tests.TestCases\n{\n    class UseStringIsNullOrEmpty\n    {\n        public static readonly string StaticString = \"\";\n        public const string ConstEmptyString = \"\";\n\n        public void Test(string value, string otherValue)\n        {\n            if (value.Equals(\"\")) // Noncompliant {{Use 'string.IsNullOrEmpty()' instead of comparing to empty string.}}\n//              ^^^^^^^^^^^^^^^^\n            { }\n\n            if (StaticString.Equals(\"\")) // Noncompliant {{Use 'string.IsNullOrEmpty()' instead of comparing to empty string.}}\n//              ^^^^^^^^^^^^^^^^^^^^^^^\n            { }\n\n            if (string.Empty.Equals(value)) // Noncompliant {{Use 'string.IsNullOrEmpty()' instead of comparing to empty string.}}\n//              ^^^^^^^^^^^^^^^^^^^^^^^^^^\n            { }\n\n            if (value.Equals(string.Empty)) // Noncompliant {{Use 'string.IsNullOrEmpty()' instead of comparing to empty string.}}\n//              ^^^^^^^^^^^^^^^^^^^^^^^^^^\n            { }\n\n            if (ConstEmptyString.Equals(value)) // Noncompliant {{Use 'string.IsNullOrEmpty()' instead of comparing to empty string.}}\n//              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            { }\n\n            if (\"\".Equals(value)) // Noncompliant {{Use 'string.IsNullOrEmpty()' instead of comparing to empty string.}}\n//              ^^^^^^^^^^^^^^^^\n            { }\n\n            if (value.Equals(ConstEmptyString)) // Noncompliant {{Use 'string.IsNullOrEmpty()' instead of comparing to empty string.}}\n//              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n            { }\n\n            if (value == \"\") // Compliant\n            { }\n\n            if (value.CompareTo(\"\") == 0) // Compliant\n            { }\n\n            if (value.Equals(StaticString)) // Compliant\n            { }\n\n            if (value.Equals(null)) // Compliant\n            { }\n\n            if (value.Equals(otherValue)) // Compliant\n            { }\n\n            if (\"some value\".Equals(value)) // Compliant\n            { }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseTestableTimeProvider.cs",
    "content": "﻿using System;\n\npublic class DateTimeAsProvider\n{\n    public void Noncompliant()\n    {\n        var now = DateTime.Now; // Noncompliant {{Use a testable (date) time provider instead.}}\n        //        ^^^^^^^^^^^^\n        var utc = DateTime.UtcNow; // Noncompliant\n        var today = DateTime.Today; // Noncompliant\n\n        var offsetNow = DateTimeOffset.Now; // Noncompliant\n        var offsetUTC = DateTimeOffset.UtcNow; // Noncompliant\n    }\n\n    /// <see cref=\"DateTimeOffset.UtcNow\"/> Compliant\n    public void CompliantAre()\n    {\n        var other = DateTime.DaysInMonth(2000, 2); // Compliant\n        var noSystemDateTime = NotSystem.DateTime.Now; // Compliant\n\n        var otherOffset = DateTimeOffset.MaxValue; // Compliant\n        var noSystemDateTimeOffset = NotSystem.DateTimeOffset.Now; // Compliant\n\n        var str = nameof(DateTime.Now); // Compliant\n    }\n}\n\nnamespace NotSystem\n{\n    public class DateTime\n    {\n        public static DateTime Now => new DateTime();\n    }\n\n    public class DateTimeOffset\n    {\n        public static DateTimeOffset Now => new DateTimeOffset();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseTestableTimeProvider.vb",
    "content": "﻿Imports System\n\nPublic Class DateTimeAsProvider\n\n    Public Sub Noncompliant()\n        Dim now As Date = DateTime.Now ' Noncompliant {{Use a testable (date) time provider instead.}}\n        '                 ^^^^^^^^^^^^\n        Dim utc As Date = DateTime.UtcNow ' Noncompliant\n        Dim today As Date = DateTime.Today ' Noncompliant\n        Dim [date] As Date = Date.Now ' Noncompliant\n\n        Dim offsetNow As DateTimeOffset = DateTimeOffset.Now ' Noncompliant\n        Dim offsetUTC As DateTimeOffset = DateTimeOffset.UtcNow ' Noncompliant\n    End Sub\n\n    ''' <see cref=\"DateTimeOffset.UtcNow\"/> Compliant\n    Public Sub CompliantAre()\n        Dim other As Integer = DateTime.DaysInMonth(2000, 2) ' Compliant\n        Dim noSystemDateTime As NotSystem.DateTime = NotSystem.DateTime.Now ' Compliant\n        Dim noSystemtDate As NotSystem.Date = NotSystem.Date.Now ' Compliant\n\n        Dim otherOffset As DateTimeOffset = DateTimeOffset.MaxValue ' Compliant\n        Dim noSystemDateTimeOffset As NotSystem.DateTimeOffset = NotSystem.DateTimeOffset.Now ' Compliant\n\n        Dim str As String = NameOf(Date.Now) 'Compliant\n    End Sub\nEnd Class\n\nNamespace NotSystem\n    Public Class DateTime\n        Public Shared ReadOnly Property Now As DateTime\n            Get\n                Return New DateTime()\n            End Get\n        End Property\n    End Class\n    Public Class [Date]\n        Public Shared ReadOnly Property Now As NotSystem.Date\n            Get\n                Return New NotSystem.Date()\n            End Get\n        End Property\n    End Class\n    Public Class DateTimeOffset\n        Public Shared ReadOnly Property Now As DateTimeOffset\n            Get\n                Return New DateTimeOffset()\n            End Get\n        End Property\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseTrueForAll.Immutable.cs",
    "content": "﻿using System;\nusing System.Linq;\nusing System.Collections.Immutable;\n\nclass ImmutableListTestcases\n{\n    void Playground()\n    {\n        var immutable = ImmutableList<int>.Empty;\n\n        var bad = immutable.All(x => true); // Noncompliant\n        var nullableBad = immutable?.All(x => true); // Noncompliant\n\n        var good = immutable.TrueForAll(x => true); // Compliant\n\n        int[] DoWork() => null;\n        Func<int[], bool> func = l => l.All(x => true); // Noncompliant\n\n        var methodBad = DoWork().All(x => true); // Noncompliant\n        var methodGood = Array.TrueForAll(DoWork(), x => true); // Compliant\n\n        var nullableMethodBad = DoWork()?.All(x => true); // Noncompliant\n        var inlineInitialization = new int[] { 42 }.All(x => true); // Noncompliant\n\n         immutable.Fluent().Fluent().Fluent().Fluent().All(x => true); //Noncompliant\n         immutable.Fluent().Fluent().Fluent().Fluent()?.All(x => true); //Noncompliant\n         immutable.Fluent().Fluent().Fluent()?.Fluent().All(x => true); //Noncompliant\n         immutable.Fluent().Fluent().Fluent()?.Fluent()?.All(x => true); //Noncompliant\n         immutable.Fluent().Fluent()?.Fluent().Fluent().All(x => true); //Noncompliant\n         immutable.Fluent().Fluent()?.Fluent().Fluent()?.All(x => true); //Noncompliant\n         immutable.Fluent().Fluent()?.Fluent()?.Fluent().All(x => true); //Noncompliant\n         immutable.Fluent().Fluent()?.Fluent()?.Fluent()?.All(x => true); //Noncompliant\n         immutable.Fluent()?.Fluent().Fluent().Fluent().All(x => true); //Noncompliant\n         immutable.Fluent()?.Fluent().Fluent().Fluent()?.All(x => true); //Noncompliant\n         immutable.Fluent()?.Fluent().Fluent()?.Fluent().All(x => true); //Noncompliant\n         immutable.Fluent()?.Fluent().Fluent()?.Fluent()?.All(x => true); //Noncompliant\n         immutable.Fluent()?.Fluent()?.Fluent().Fluent().All(x => true); //Noncompliant\n         immutable.Fluent()?.Fluent()?.Fluent().Fluent()?.All(x => true); //Noncompliant\n         immutable.Fluent()?.Fluent()?.Fluent()?.Fluent().All(x => true); //Noncompliant\n         immutable.Fluent()?.Fluent()?.Fluent()?.Fluent()?.All(x => true); //Noncompliant\n    }\n}\n\npublic static class BuilderExtensions\n{\n    public static ImmutableList<int> Fluent(this ImmutableList<int> list) => list;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseTrueForAll.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nclass ListTestcases\n{\n    void Playground()\n    {\n        var list = new List<int>();\n\n        var bad = list.All(x => true); // Noncompliant {{The collection-specific \"TrueForAll\" method should be used instead of the \"All\" extension}}\n        //             ^^^\n\n        var nullableBad = list?.All(x => true); // Noncompliant\n\n        var good = list.TrueForAll(x => true); // Compliant\n\n        List<int> DoWork() => null;\n        Func<List<int>, bool> func = l => l.All(x => true); // Noncompliant\n\n        var methodBad = DoWork().All(x => true); // Noncompliant\n        var methodGood = DoWork().TrueForAll(x => true); // Compliant\n\n        var nullableMethodBad = DoWork()?.All(x => true); // Noncompliant\n        var nullableMethodGood = DoWork()?.TrueForAll(x => true); // Compliant\n\n        var inlineInitialization = new List<int> { 42 }.All(x => true); // Noncompliant\n\n        var imposter = new ContainsAllMethod<int>();\n        imposter.All(x => true); // Compliant\n\n        var badList = new BadList<int>();\n        badList.All(x => true); // Compliant\n\n        var goodList = new GoodList<int>();\n        goodList.All(x => true); // Noncompliant\n\n        var ternary = (true ? list : goodList).All(x => true); // Noncompliant\n        var nullCoalesce = (list ?? goodList).All(x => true); // Noncompliant\n        var ternaryNullCoalesce = (list ?? (true ? list : goodList)).All(x => true); // Noncompliant\n\n         goodList.Fluent().Fluent().Fluent().Fluent().All(x => true); //Noncompliant\n         goodList.Fluent().Fluent().Fluent().Fluent()?.All(x => true); //Noncompliant\n         goodList.Fluent().Fluent().Fluent()?.Fluent().All(x => true); //Noncompliant\n         goodList.Fluent().Fluent().Fluent()?.Fluent()?.All(x => true); //Noncompliant\n         goodList.Fluent().Fluent()?.Fluent().Fluent().All(x => true); //Noncompliant\n         goodList.Fluent().Fluent()?.Fluent().Fluent()?.All(x => true); //Noncompliant\n         goodList.Fluent().Fluent()?.Fluent()?.Fluent().All(x => true); //Noncompliant\n         goodList.Fluent().Fluent()?.Fluent()?.Fluent()?.All(x => true); //Noncompliant\n         goodList.Fluent()?.Fluent().Fluent().Fluent().All(x => true); //Noncompliant\n         goodList.Fluent()?.Fluent().Fluent().Fluent()?.All(x => true); //Noncompliant\n         goodList.Fluent()?.Fluent().Fluent()?.Fluent().All(x => true); //Noncompliant\n         goodList.Fluent()?.Fluent().Fluent()?.Fluent()?.All(x => true); //Noncompliant\n         goodList.Fluent()?.Fluent()?.Fluent().Fluent().All(x => true); //Noncompliant\n         goodList.Fluent()?.Fluent()?.Fluent().Fluent()?.All(x => true); //Noncompliant\n         goodList.Fluent()?.Fluent()?.Fluent()?.Fluent().All(x => true); //Noncompliant\n         goodList.Fluent()?.Fluent()?.Fluent()?.Fluent()?.All(x => true); //Noncompliant\n     //                                                   ^^^\n\n        All<int>(x => true); // Compliant\n        AcceptMethod<int>(goodList.All); //FN this is not an invocation, just a member access\n    }\n\n    bool All<T>(Func<T, bool> predicate) => true;\n    void AcceptMethod<T>(Func<Func<T, bool>, bool> methodThatLooksLikeAll) { }\n\n    class GoodList<T> : List<T>\n    {\n        public GoodList<T> Fluent() => this;\n\n        void CallAll() =>\n            this.All(x => true); // Noncompliant\n    }\n\n    class BadList<T> : List<T>\n    {\n        public bool All(Func<T, bool> predicate) => true;\n    }\n\n    class ContainsAllMethod<T>\n    {\n        public bool All(Func<T, bool> predicate) => true;\n    }\n}\n\nclass ArrayTestcases\n{\n    void Playground()\n    {\n        var array = new int[42];\n\n        var bad = array.All(x => true); // Noncompliant\n        var nullableBad = array?.All(x => true); // Noncompliant\n\n        var good = Array.TrueForAll(array, x => true); // Compliant\n\n        int[] DoWork() => null;\n        Func<int[], bool> func = l => l.All(x => true); // Noncompliant\n\n        var methodBad = DoWork().All(x => true); // Noncompliant\n        var methodGood = Array.TrueForAll(DoWork(), x => true); // Compliant\n\n        var nullableMethodBad = DoWork()?.All(x => true); // Noncompliant\n        var inlineInitialization = new int[] { 42 }.All(x => true); // Noncompliant\n\n         array.ToArray().ToArray().ToArray().ToArray().All(x => true); //Noncompliant\n         array.ToArray().ToArray().ToArray().ToArray()?.All(x => true); //Noncompliant\n         array.ToArray().ToArray().ToArray()?.ToArray().All(x => true); //Noncompliant\n         array.ToArray().ToArray().ToArray()?.ToArray()?.All(x => true); //Noncompliant\n         array.ToArray().ToArray()?.ToArray().ToArray().All(x => true); //Noncompliant\n         array.ToArray().ToArray()?.ToArray().ToArray()?.All(x => true); //Noncompliant\n         array.ToArray().ToArray()?.ToArray()?.ToArray().All(x => true); //Noncompliant\n         array.ToArray().ToArray()?.ToArray()?.ToArray()?.All(x => true); //Noncompliant\n         array.ToArray()?.ToArray().ToArray().ToArray().All(x => true); //Noncompliant\n         array.ToArray()?.ToArray().ToArray().ToArray()?.All(x => true); //Noncompliant\n         array.ToArray()?.ToArray().ToArray()?.ToArray().All(x => true); //Noncompliant\n         array.ToArray()?.ToArray().ToArray()?.ToArray()?.All(x => true); //Noncompliant\n         array.ToArray()?.ToArray()?.ToArray().ToArray().All(x => true); //Noncompliant\n         array.ToArray()?.ToArray()?.ToArray().ToArray()?.All(x => true); //Noncompliant\n         array.ToArray()?.ToArray()?.ToArray()?.ToArray().All(x => true); //Noncompliant\n         array.ToArray()?.ToArray()?.ToArray()?.ToArray()?.All(x => true); //Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseTrueForAll.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.Linq\nImports System.Reflection\n\nClass ListTestcases\n    Private Sub Playground()\n        Dim list = New List(Of Integer)()\n\n        Dim bad = list.All(Function(x) True) ' Noncompliant\n        Dim nullableBad = list?.All(Function(x) True) ' Noncompliant\n\n        Dim good = list.TrueForAll(Function(x) True) ' Compliant\n\n        Dim DoWork As Func(Of List(Of Integer)) = Function() Nothing\n        Dim func As Func(Of List(Of Integer), Boolean) = Function(l) l.All(Function(x) True) ' Noncompliant\n\n        Dim methodBad = DoWork().All(Function(x) True) ' Noncompliant\n        Dim methodGood = DoWork().TrueForAll(Function(x) True) ' Compliant\n\n        Dim nullableMethodBad = DoWork()?.All(Function(x) True) ' Noncompliant\n        Dim nullableMethodGood = DoWork()?.TrueForAll(Function(x) True) ' Compliant\n\n        Dim inlineInitialization = New List(Of Integer) From {42}.All(Function(x) True) ' Noncompliant\n\n        Dim imposter = New ContainsAllMethod(Of Integer)()\n        imposter.All(Function(x) True) ' Compliant\n\n        Dim badList = New BadList(Of Integer)()\n        badList.All(Function(x) True) ' Compliant\n\n        Dim goodList = New GoodList(Of Integer)()\n        goodList.All(Function(x) True) ' Noncompliant\n\n        Dim ternary As List(Of Integer) = If(True, list, goodList)\n        ternary.All(Function(x) True) 'Noncompliant\n\n        goodList.Fluent().Fluent().Fluent().Fluent().All(Function(x) True) 'Noncompliant\n        goodList.Fluent().Fluent().Fluent().Fluent()?.All(Function(x) True) 'Noncompliant\n        goodList.Fluent().Fluent().Fluent()?.Fluent().All(Function(x) True) 'Noncompliant\n        goodList.Fluent().Fluent().Fluent()?.Fluent()?.All(Function(x) True) 'Noncompliant\n        goodList.Fluent().Fluent()?.Fluent().Fluent().All(Function(x) True) 'Noncompliant\n        goodList.Fluent().Fluent()?.Fluent().Fluent()?.All(Function(x) True) 'Noncompliant\n        goodList.Fluent().Fluent()?.Fluent()?.Fluent().All(Function(x) True) 'Noncompliant\n        goodList.Fluent().Fluent()?.Fluent()?.Fluent()?.All(Function(x) True) 'Noncompliant\n        goodList.Fluent()?.Fluent().Fluent().Fluent().All(Function(x) True) 'Noncompliant\n        goodList.Fluent()?.Fluent().Fluent().Fluent()?.All(Function(x) True) 'Noncompliant\n        goodList.Fluent()?.Fluent().Fluent()?.Fluent().All(Function(x) True) 'Noncompliant\n        goodList.Fluent()?.Fluent().Fluent()?.Fluent()?.All(Function(x) True) 'Noncompliant\n        goodList.Fluent()?.Fluent()?.Fluent().Fluent().All(Function(x) True) 'Noncompliant\n        goodList.Fluent()?.Fluent()?.Fluent().Fluent()?.All(Function(x) True) 'Noncompliant\n        goodList.Fluent()?.Fluent()?.Fluent()?.Fluent().All(Function(x) True) 'Noncompliant\n    End Sub\n\n    Class GoodList(Of T)\n        Inherits List(Of T)\n\n        Public Function Fluent() As GoodList(Of T)\n            Return Me\n        End Function\n    End Class\n\n    Class BadList(Of T)\n        Inherits List(Of T)\n\n        Public Function All(predicate As Func(Of T, Boolean)) As Boolean\n            Return True\n        End Function\n    End Class\n\n    Class ContainsAllMethod(Of T)\n        Public Function All(predicate As Func(Of T, Boolean)) As Boolean\n            Return True\n        End Function\n    End Class\nEnd Class\n\nClass ArrayTestcases\n    Private Sub Playground()\n        Dim array = New Integer(41) {}\n\n        Dim bad = array.All(Function(x) True) ' Noncompliant\n        Dim nullableBad = array?.All(Function(x) True) ' Noncompliant\n\n        Dim good = array.TrueForAll(array, Function(x) True) ' Compliant\n\n        Dim func As Func(Of Integer(), Boolean) = Function(l) l.All(Function(x) True) ' Noncompliant\n\n        Dim methodBad = DoWork().All(Function(x) True) ' Noncompliant\n        Dim methodGood = array.TrueForAll(DoWork(), Function(x) True) ' Compliant\n\n        Dim nullableMethodBad = DoWork()?.All(Function(x) True) ' Noncompliant\n        Dim inlineInitialization = {42}.All(Function(x) True) ' FN `.GetTypeInfo(CollectionInitializer)` returns null\n\n        array.ToArray().ToArray().ToArray().ToArray().All(Function(x) True) 'Noncompliant\n        array.ToArray().ToArray().ToArray().ToArray()?.All(Function(x) True) 'Noncompliant\n        array.ToArray().ToArray().ToArray()?.ToArray().All(Function(x) True) 'Noncompliant\n        array.ToArray().ToArray().ToArray()?.ToArray()?.All(Function(x) True) 'Noncompliant\n        array.ToArray().ToArray()?.ToArray().ToArray().All(Function(x) True) 'Noncompliant\n        array.ToArray().ToArray()?.ToArray().ToArray()?.All(Function(x) True) 'Noncompliant\n        array.ToArray().ToArray()?.ToArray()?.ToArray().All(Function(x) True) 'Noncompliant\n        array.ToArray().ToArray()?.ToArray()?.ToArray()?.All(Function(x) True) 'Noncompliant\n        array.ToArray()?.ToArray().ToArray().ToArray().All(Function(x) True) 'Noncompliant\n        array.ToArray()?.ToArray().ToArray().ToArray()?.All(Function(x) True) 'Noncompliant\n        array.ToArray()?.ToArray().ToArray()?.ToArray().All(Function(x) True) 'Noncompliant\n        array.ToArray()?.ToArray().ToArray()?.ToArray()?.All(Function(x) True) 'Noncompliant\n        array.ToArray()?.ToArray()?.ToArray().ToArray().All(Function(x) True) 'Noncompliant\n        array.ToArray()?.ToArray()?.ToArray().ToArray()?.All(Function(x) True) 'Noncompliant\n        array.ToArray()?.ToArray()?.ToArray()?.ToArray().All(Function(x) True) 'Noncompliant\n        array.ToArray()?.ToArray()?.ToArray()?.ToArray()?.All(Function(x) True) 'Noncompliant\n    End Sub\n\n    Private Function DoWork() As Integer()\n        Return Nothing\n    End Function\nEnd Class\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseUnixEpoch.CSharp9.Fixed.cs",
    "content": "﻿using System;\n\nDateTime dateTime = DateTime.UnixEpoch; // Fixed\nDateTimeOffset dateTimeOffset = DateTimeOffset.UnixEpoch; // Fixed\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseUnixEpoch.CSharp9.cs",
    "content": "﻿using System;\n\nDateTime dateTime = new(1970, 1, 1); // Noncompliant\nDateTimeOffset dateTimeOffset = new(1970, 1, 1, 0, 0, 0, TimeSpan.Zero); // Noncompliant\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseUnixEpoch.Fixed.cs",
    "content": "﻿using System;\nusing System.Globalization;\nusing MyAlias = System.DateTime;\n\npublic class Program\n{\n    private readonly DateTime Epoch = DateTime.UnixEpoch; // Fixed\n\n    private readonly DateTimeOffset EpochOff = DateTimeOffset.UnixEpoch; // Fixed\n\n    private const long EpochTicks = 621355968000000000;\n    private const long EpochTicksUnderscores = 621_355_968_000_000_000;\n    private const long EpochTicksBinary = 0b100010011111011111111111010111110111101101011000000000000000;\n    private const long EpochTicksHex = 0x89F7FF5F7B58000;\n    private const long SomeLongConst = 6213;\n\n    void BasicCases(DateTime dateTime)\n    {\n        var timeSpan = dateTime - DateTime.UnixEpoch; // Fixed\n\n        if (dateTime < DateTime.UnixEpoch) // Fixed\n        {\n            return;\n        }\n\n        var compliant0 = new DateTime(1971, 1, 1); // Compliant\n        var compliant1 = new DateTime(1970, 2, 1); // Compliant\n        var compliant2 = new DateTime(1970, 1, 2); // Compliant\n        var compliant3 = DateTime.UnixEpoch; // Compliant\n        var compliant4 = DateTimeOffset.UnixEpoch; // Compliant\n\n        var year = 1970;\n        var dateTime2 = new DateTime(year, 1, 1); // FN\n    }\n\n    void EdgeCases()\n    {\n        var dateTimeOffset = new DateTimeOffset(DateTime.UnixEpoch, new TimeSpan(0, 0, 0)); // Fixed\n        var dateTime = new DateTime(true ? 1970 : 1971, 1, 1); // FN\n        dateTime = DateTime.UnixEpoch; // Fixed\n        dateTime = DateTime.UnixEpoch; // Fixed\n        dateTime = System.DateTime.UnixEpoch; // Fixed\n        dateTime = MyAlias.UnixEpoch; // Fixed\n    }\n\n    void DateTimeConstructors(int ticks, int year, int month, int day, int hour, int minute, int second, int millisecond, Calendar calendar, DateTimeKind kind)\n    {\n        // default date\n        var ctor0_0 = new DateTime(); // Compliant\n\n        // ticks\n        var ctor1_0 = new DateTime(1970); // Compliant\n        var ctor1_1 = new DateTime(ticks); // Compliant\n        var ctor1_2 = new DateTime(ticks: ticks); // Compliant\n        var ctor1_3 = DateTime.UnixEpoch; // Fixed\n        var ctor1_4 = DateTime.UnixEpoch; // Fixed\n        var ctor1_5 = DateTime.UnixEpoch; // Fixed\n        var ctor1_6 = DateTime.UnixEpoch; // Fixed\n        var ctor1_7 = DateTime.UnixEpoch; // Fixed\n        var ctor1_8 = new DateTime(SomeLongConst); // Compliant\n\n        // year, month, and day\n        var ctor2_0 = DateTime.UnixEpoch; // Fixed\n        var ctor2_1 = new DateTime(year, month, day); // Compliant\n        var ctor2_2 = new DateTime(month: month, day: day, year: year); // Compliant\n        var ctor2_3 = DateTime.UnixEpoch; // Fixed\n\n        // year, month, day, and calendar\n        var ctor3_0 = DateTime.UnixEpoch; // Fixed\n        var ctor3_1 = new DateTime(1970, 3, 1, new GregorianCalendar()); // Compliant\n        var ctor3_2 = new DateTime(1970, 1, 1, new ChineseLunisolarCalendar()); // Compliant\n        var ctor3_3 = DateTime.UnixEpoch; // Fixed\n        var ctor3_4 = new DateTime(month: 1, day: 1, calendar: new ChineseLunisolarCalendar(), year: 1970); // Compliant\n\n        // year, month, day, hour, minute, and second\n        var ctor4_0 = DateTime.UnixEpoch; // Fixed\n        var ctor4_1 = new DateTime(1970, 1, 1, 0, 0, 1); // Compliant\n        var ctor4_2 = new DateTime(year: 1970, minute: minute, month: 1, day: 1, hour: 0, second: 0); // Compliant\n        var ctor4_3 = DateTime.UnixEpoch; // Fixed\n\n        // year, month, day, hour, minute, second, and calendar\n        var ctor5_0 = DateTime.UnixEpoch; // Fixed\n        var ctor5_1 = new DateTime(1970, 1, 1, 0, 1, 0, new GregorianCalendar()); // Compliant\n        var ctor5_2 = new DateTime(1970, 1, 1, 0, 0, 0, new ChineseLunisolarCalendar()); // Compliant\n        var ctor5_3 = DateTime.UnixEpoch; // Fixed\n        var ctor5_4 = new DateTime(year: 1970, second: 0, minute: 0, day: 1, month: 1, hour: 0, calendar: calendar); // Compliant\n\n        // year, month, day, hour, minute, second, and DateTimeKind value\n        var ctor6_0 = DateTime.UnixEpoch; // Fixed\n        var ctor6_1 = new DateTime(1970, 1, 1, 1, 0, 0, DateTimeKind.Utc); // Compliant\n        var ctor6_2 = new DateTime(1970, 1, 1, hour, 0, 0, DateTimeKind.Utc); // Compliant\n        var ctor6_3 = DateTime.UnixEpoch; // Fixed\n        var ctor6_4 = new DateTime(month: 1, year: 1970, day: 1, hour: hour, second: 0, minute: 0, kind: DateTimeKind.Utc); // Compliant\n        var ctor6_5 = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Unspecified); // Compliant\n        var ctor6_6 = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Local); // Compliant\n\n        // year, month, day, hour, minute, second, and millisecond\n        var ctor7_0 = DateTime.UnixEpoch; // Fixed\n        var ctor7_1 = new DateTime(1970, 1, 1, 0, 0, 0, 1); // Compliant\n        var ctor7_3 = new DateTime(year, month, day, hour, minute, second, millisecond); // Compliant\n        var ctor7_4 = new DateTime(year: 1970, minute: minute, month: 1, day: 1, hour: 0, millisecond: 0, second: 0); // Compliant\n        var ctor7_5 = DateTime.UnixEpoch; // Fixed\n\n        // year, month, day, hour, minute, second, millisecond, and calendar\n        var ctor8_0 = DateTime.UnixEpoch; // Fixed\n        var ctor8_1 = new DateTime(1970, 1, 1, 0, 0, 0, 1, new GregorianCalendar()); // Compliant\n        var ctor8_2 = new DateTime(1970, 1, 1, 0, 0, 0, 0, new ChineseLunisolarCalendar()); // Compliant\n        var ctor8_3 = DateTime.UnixEpoch; // Fixed\n\n        // year, month, day, hour, minute, second, millisecond, and DateTimeKind value\n        var ctor9_0 = DateTime.UnixEpoch; // Fixed\n        var ctor9_1 = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified); // Compliant\n        var ctor9_2 = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Local); // Compliant\n        var ctor9_3 = DateTime.UnixEpoch; // Fixed\n        var ctor9_4 = new DateTime(year: 1970, minute: 0, month: 1, day: 1, hour: 0, millisecond: 0, second: 0, kind: kind); // Compliant\n\n        // year, month, day, hour, minute, second, millisecond, calendar and DateTimeKind value\n        var ctor10_0 = DateTime.UnixEpoch; // Fixed\n        var ctor10_1 = new DateTime(1970, 1, 1, 0, 0, 0, 0, new GregorianCalendar(), DateTimeKind.Local); // Compliant\n        var ctor10_2 = new DateTime(1970, 1, 1, 0, 0, 0, 0, new ChineseLunisolarCalendar(), DateTimeKind.Utc); // Compliant\n        var ctor10_3 = DateTime.UnixEpoch; // Fixed\n        var ctor10_4 = new DateTime(year: 1970, minute: 0, month: 1, day: 1, hour: 0, calendar: new GregorianCalendar(), millisecond: 0, second: second, kind: DateTimeKind.Utc); // Compliant\n\n        // year, month, day, hour, minute, second, millisecond and microsecond\n        var ctor11_0 = DateTime.UnixEpoch; // Fixed\n        var ctor11_1 = new DateTime(1970, 1, 1, 0, 0, 0, 0, 1); // Compliant\n        var ctor11_2 = DateTime.UnixEpoch; // Fixed\n        var ctor11_3 = new DateTime(year: 1970, microsecond: 0, minute: minute, month: 1, hour: 0, day: 1, millisecond: millisecond, second: 0); // Compliant\n\n        // year, month, day, hour, minute, second, millisecond, microsecond and calendar\n        var ctor12_0 = DateTime.UnixEpoch; // Fixed\n        var ctor12_1 = new DateTime(1970, 1, 1, 0, 0, 0, 0, 1, new GregorianCalendar()); // Compliant\n        var ctor12_2 = new DateTime(1970, 1, 1, 0, 0, 0, 0, 0, new ChineseLunisolarCalendar()); // Compliant\n        var ctor12_3 = DateTime.UnixEpoch; // Fixed\n        var ctor12_4 = new DateTime(year: 1970, minute: minute, month: 1, day: 1, hour: 0, calendar: new GregorianCalendar(), millisecond: 0, second: 0, microsecond: 0); // Compliant\n\n        // year, month, day, hour, minute, second, millisecond, microsecond and DateTimeKind value\n        var ctor13_0 = DateTime.UnixEpoch; // Fixed\n        var ctor13_1 = new DateTime(1970, 1, 1, 0, 0, 0, 0, 1, DateTimeKind.Utc); // Compliant\n        var ctor13_2 = new DateTime(1970, 1, 1, 0, 0, 0, 0, 0, DateTimeKind.Unspecified); // Compliant\n        var ctor13_3 = new DateTime(1970, 1, 1, 0, 0, 0, 0, 0, DateTimeKind.Local); // Compliant\n        var ctor13_4 = DateTime.UnixEpoch; // Fixed\n        var ctor13_5 = new DateTime(year: 1970, minute: minute, month: 1, day: 1, hour: 0, kind: DateTimeKind.Utc, millisecond: 0, second: 0, microsecond: 0); // Compliant\n\n        // year, month, day, hour, minute, second, millisecond, microsecond calendar and DateTimeKind value\n        var ctor14_0 = DateTime.UnixEpoch; // Fixed\n        var ctor14_1 = new DateTime(1970, 1, 1, 0, 0, 0, 0, 1, new GregorianCalendar(), DateTimeKind.Utc); // Compliant\n        var ctor14_2 = new DateTime(1970, 1, 1, 0, 0, 0, 0, 0, new GregorianCalendar(), DateTimeKind.Unspecified); // Compliant\n        var ctor14_3 = new DateTime(1970, 1, 1, 0, 0, 0, 0, 0, new ChineseLunisolarCalendar(), DateTimeKind.Utc); // Compliant\n        var ctor14_4 = DateTime.UnixEpoch; // Fixed\n        var ctor14_5 = new DateTime(year: 1970, minute: minute, month: 1, day: 1, hour: 0, kind: DateTimeKind.Utc, millisecond: 0, second: 0, microsecond: 0, calendar: calendar); // Compliant\n    }\n\n    void DateTimeOffsetConstructors(TimeSpan timeSpan, DateTime dateTime, int ticks, int year, int month, int day, int hour, int minute, int second, int millisecond, int microsecond, Calendar calendar, DateTimeKind kind)\n    {\n        // default date\n        var ctor0_0 = new DateTimeOffset(); // Compliant\n\n        // datetime\n        var ctor1_0 = new DateTimeOffset(new DateTime()); // Compliant\n        var ctor1_1 = new DateTimeOffset(dateTime); // Compliant\n        var ctor1_2 = new DateTimeOffset(DateTime.UnixEpoch); // Fixed\n\n        // datetime and timespan\n        var ctor2_0 = new DateTimeOffset(new DateTime(), TimeSpan.Zero); // Compliant\n        var ctor2_1 = new DateTimeOffset(new DateTime(), timeSpan); // Compliant\n        var ctor2_2 = new DateTimeOffset(DateTime.UnixEpoch, TimeSpan.Zero); // Fixed\n\n        // year, month, day, hour, minute, second, millisecond, offset and calendar\n        var ctor3_0 = new DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, calendar, timeSpan); // Compliant\n        var ctor3_1 = DateTimeOffset.UnixEpoch; // Fixed\n        var ctor3_2 = DateTimeOffset.UnixEpoch; // Fixed\n        var ctor3_3 = new DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, new GregorianCalendar(), new TimeSpan(1)); // Compliant\n        var ctor3_4 = DateTimeOffset.UnixEpoch; // Fixed\n        var ctor3_5 = DateTimeOffset.UnixEpoch; // Fixed\n        var ctor3_6 = new DateTimeOffset(hour: 0, month: 1, day: 1, year: 1970, minute: 0, second: 0, millisecond: 0, calendar: new GregorianCalendar(), offset: new TimeSpan(2)); // Compliant\n        var ctor3_7 = new DateTimeOffset(hour: 0, month: 1, day: 1, year: 1970, minute: 0, second: 0, millisecond: 0, calendar: calendar, offset: new TimeSpan(0)); // Compliant\n\n        // year, month, day, hour, minute, second, millisecond, microsecond, offset and calendar\n        var ctor4_0 = new DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, 0, calendar, timeSpan); // Compliant\n        var ctor4_1 = DateTimeOffset.UnixEpoch; // Fixed\n        var ctor4_2 = DateTimeOffset.UnixEpoch; // Fixed\n        var ctor4_3 = new DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, 0, new GregorianCalendar(), new TimeSpan(1)); // Compliant\n        var ctor4_4 = new DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, 1, new GregorianCalendar(), new TimeSpan(0)); // Compliant\n        var ctor4_5 = DateTimeOffset.UnixEpoch; // Fixed\n        var ctor4_6 = DateTimeOffset.UnixEpoch; // Fixed\n        var ctor4_7 = new DateTimeOffset(hour: 0, month: 1, day: 1, year: 1970, minute: 0, second: 0, microsecond: 0, millisecond: 0, calendar: new GregorianCalendar(), offset: new TimeSpan(2)); // Compliant\n        var ctor4_8 = new DateTimeOffset(hour: 0, month: 1, day: 1, year: 1970, minute: 0, second: 0, microsecond: 0, millisecond: 0, calendar: calendar, offset: new TimeSpan(0)); // Compliant\n        var ctor4_9 = new DateTimeOffset(hour: 0, month: 1, day: 1, year: 1970, minute: 0, second: 0, microsecond: 1, millisecond: 0, calendar: new GregorianCalendar(), offset: new TimeSpan(0)); // Compliant\n\n        // year, month, day, hour, minute, second and offset\n        var ctor5_0 = DateTimeOffset.UnixEpoch; // Fixed\n        var ctor5_1 = new DateTimeOffset(1970, 1, 1, 0, 0, 0, new TimeSpan(1)); // Compliant\n        var ctor5_2 = new DateTimeOffset(1970, 1, 1, 0, 0, 0, timeSpan); // Compliant\n        var ctor5_3 = new DateTimeOffset(1970, 1, 1, 0, 0, 0, timeSpan); // Compliant\n        var ctor5_4 = new DateTimeOffset(1970, 1, 1, 0, 0, 2, new TimeSpan(0)); // Compliant\n        var ctor5_5 = DateTimeOffset.UnixEpoch; // Fixed\n\n        // year, month, day, hour, minute, second, millisecond and offset\n        var ctor6_0 = DateTimeOffset.UnixEpoch; // Fixed\n        var ctor6_1 = DateTimeOffset.UnixEpoch; // Fixed\n        var ctor6_2 = new DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, new TimeSpan(2, 14, 18)); // Compliant\n        var ctor6_3 = new DateTimeOffset(1970, 1, 1, 0, 1, 0, 0, TimeSpan.Zero); // Compliant\n        var ctor6_4 = DateTimeOffset.UnixEpoch; // Fixed\n\n        // year, month, day, hour, minute, second, millisecond and offset\n        var ctor7_0 = DateTimeOffset.UnixEpoch; // Fixed\n        var ctor7_1 = new DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, 0, new TimeSpan(2, 14, 18)); // Compliant\n        var ctor7_2 = DateTimeOffset.UnixEpoch; // Fixed\n        var ctor7_3 = new DateTimeOffset(1970, 1, 1, 0, 1, 0, 0, 0, TimeSpan.Zero); // Compliant\n        var ctor7_4 = DateTimeOffset.UnixEpoch; // Fixed\n    }\n}\n\npublic class FakeDateTime\n{\n    void MyMethod()\n    {\n        _ = new DateTime(1970, 1, 1); // Compliant\n        _ = new DateTime(\"hello\"); // Compliant\n    }\n\n    public class DateTime\n    {\n        public DateTime(int year, int month, int day) { }\n        public DateTime(string ticks) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseUnixEpoch.Fixed.vb",
    "content": "﻿Imports System.Globalization\nImports MyAlias = System.DateTime\n\nPublic Class Program\n    Private ReadOnly Epoch As Date = DateTime.UnixEpoch ' Fixed\n\n    Private ReadOnly EpochOff As DateTimeOffset = DateTimeOffset.UnixEpoch ' Fixed\n\n    Private Const EpochTicks As Long = 621355968000000000\n    Private Const EpochTicksUnderscores As Long = 621_355_968_000_000_000\n    Private Const EpochTicksBinary As Long = &B100010011111011111111111010111110111101101011000000000000000\n    Private Const EpochTicksHex As Long = &H89F7FF5F7B58000\n    Private Const SomeLongConst As Long = 6213\n\n    Private Sub BasicCases(ByVal dateTime As Date)\n        Dim timeSpan = dateTime - DateTime.UnixEpoch ' Fixed\n\n        If dateTime < DateTime.UnixEpoch Then ' Fixed\n            Return\n        End If\n\n        Dim compliant0 = New DateTime(1971, 1, 1) ' Compliant\n        Dim compliant1 = New DateTime(1970, 2, 1) ' Compliant\n        Dim compliant2 = New DateTime(1970, 1, 2) ' Compliant\n        Dim compliant3 = Date.UnixEpoch ' Compliant\n        Dim compliant4 = DateTimeOffset.UnixEpoch ' Compliant\n\n        Dim year = 1970\n        Dim dateTime2 = New DateTime(year, 1, 1) ' FN\n    End Sub\n\n    Private Sub EdgeCases()\n        Dim dateTimeOffset = New DateTimeOffset(DateTime.UnixEpoch, New TimeSpan(0, 0, 0)) ' Fixed\n        Dim dateTime = New DateTime(If(True, 1970, 1971), 1, 1) ' FN\n        dateTime = DATETIME.UnixEpoch ' Fixed\n        Dim dateTime2 As Date = Date.UnixEpoch ' Fixed\n        Dim dateTime3 = System.DateTime.UnixEpoch ' Fixed\n        Dim dateTime4 = MyAlias.UnixEpoch ' Fixed\n    End Sub\n\n    Private Sub DateTimeConstructors(ByVal ticks As Integer, ByVal year As Integer, ByVal month As Integer, ByVal day As Integer, ByVal hour As Integer, ByVal minute As Integer, ByVal second As Integer, ByVal millisecond As Integer, ByVal calendar As Calendar, ByVal kind As DateTimeKind)\n        ' default date\n        Dim ctor0_0 = New DateTime() ' Compliant\n\n        ' ticks\n        Dim ctor1_0 = New DateTime(1970) ' Compliant\n        Dim ctor1_1 = New DateTime(ticks) ' Compliant\n        Dim ctor1_2 = New DateTime(ticks:=ticks) ' Compliant\n        Dim ctor1_3 = DateTime.UnixEpoch ' Fixed\n        Dim ctor1_4 = DateTime.UnixEpoch ' Fixed\n        Dim ctor1_5 = DateTime.UnixEpoch ' Fixed\n        Dim ctor1_6 = DateTime.UnixEpoch ' Fixed\n        Dim ctor1_7 = DateTime.UnixEpoch ' Fixed\n        Dim ctor1_8 = New DateTime(SomeLongConst) ' Compliant\n\n        ' year, month, and day\n        Dim ctor2_0 = DateTime.UnixEpoch ' Fixed\n        Dim ctor2_1 = New DateTime(year, month, day) ' Compliant\n        Dim ctor2_2 = New DateTime(month:=month, day:=day, year:=year) ' Compliant\n        Dim ctor2_3 = DateTime.UnixEpoch ' Fixed\n\n        ' year, month, day, and calendar\n        Dim ctor3_0 = DateTime.UnixEpoch ' Fixed\n        Dim ctor3_1 = New DateTime(1970, 3, 1, New GregorianCalendar()) ' Compliant\n        Dim ctor3_2 = New DateTime(1970, 1, 1, New ChineseLunisolarCalendar()) ' Compliant\n        Dim ctor3_3 = DateTime.UnixEpoch ' Fixed\n        Dim ctor3_4 = New DateTime(month:=1, day:=1, calendar:=New ChineseLunisolarCalendar(), year:=1970) ' Compliant\n\n        ' year, month, day, hour, minute, and second\n        Dim ctor4_0 = DateTime.UnixEpoch ' Fixed\n        Dim ctor4_1 = New DateTime(1970, 1, 1, 0, 0, 1) ' Compliant\n        Dim ctor4_2 = New DateTime(year:=1970, minute:=minute, month:=1, day:=1, hour:=0, second:=0) ' Compliant\n        Dim ctor4_3 = DateTime.UnixEpoch ' Fixed\n\n        ' year, month, day, hour, minute, second, and calendar\n        Dim ctor5_0 = DateTime.UnixEpoch ' Fixed\n        Dim ctor5_1 = New DateTime(1970, 1, 1, 0, 1, 0, New GregorianCalendar()) ' Compliant\n        Dim ctor5_2 = New DateTime(1970, 1, 1, 0, 0, 0, New ChineseLunisolarCalendar()) ' Compliant\n        Dim ctor5_3 = DateTime.UnixEpoch ' Fixed\n        Dim ctor5_4 = New DateTime(year:=1970, second:=0, minute:=0, day:=1, month:=1, hour:=0, calendar:=calendar) ' Compliant\n\n        ' year, month, day, hour, minute, second, and DateTimeKind value\n        Dim ctor6_0 = DateTime.UnixEpoch ' Fixed\n        Dim ctor6_1 = New DateTime(1970, 1, 1, 1, 0, 0, DateTimeKind.Utc) ' Compliant\n        Dim ctor6_2 = New DateTime(1970, 1, 1, hour, 0, 0, DateTimeKind.Utc) ' Compliant\n        Dim ctor6_3 = DateTime.UnixEpoch ' Fixed\n        Dim ctor6_4 = New DateTime(month:=1, year:=1970, day:=1, hour:=hour, second:=0, minute:=0, kind:=DateTimeKind.Utc) ' Compliant\n        Dim ctor6_5 = New DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Unspecified) ' Compliant\n        Dim ctor6_6 = New DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Local) ' Compliant\n\n        ' year, month, day, hour, minute, second, and millisecond\n        Dim ctor7_0 = DateTime.UnixEpoch ' Fixed\n        Dim ctor7_1 = New DateTime(1970, 1, 1, 0, 0, 0, 1) ' Compliant\n        Dim ctor7_3 = New DateTime(year, month, day, hour, minute, second, millisecond) ' Compliant\n        Dim ctor7_4 = New DateTime(year:=1970, minute:=minute, month:=1, day:=1, hour:=0, millisecond:=0, second:=0) ' Compliant\n        Dim ctor7_5 = DateTime.UnixEpoch ' Fixed\n\n        ' year, month, day, hour, minute, second, millisecond, and calendar\n        Dim ctor8_0 = DateTime.UnixEpoch ' Fixed\n        Dim ctor8_1 = New DateTime(1970, 1, 1, 0, 0, 0, 1, New GregorianCalendar()) ' Compliant\n        Dim ctor8_2 = New DateTime(1970, 1, 1, 0, 0, 0, 0, New ChineseLunisolarCalendar()) ' Compliant\n        Dim ctor8_3 = DateTime.UnixEpoch ' Fixed\n\n        ' year, month, day, hour, minute, second, millisecond, and DateTimeKind value\n        Dim ctor9_0 = DateTime.UnixEpoch ' Fixed\n        Dim ctor9_1 = New DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) ' Compliant\n        Dim ctor9_2 = New DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Local) ' Compliant\n        Dim ctor9_3 = DateTime.UnixEpoch ' Fixed\n        Dim ctor9_4 = New DateTime(year:=1970, minute:=0, month:=1, day:=1, hour:=0, millisecond:=0, second:=0, kind:=kind) ' Compliant\n\n        ' year, month, day, hour, minute, second, millisecond, calendar and DateTimeKind value\n        Dim ctor10_0 = DateTime.UnixEpoch ' Fixed\n        Dim ctor10_1 = New DateTime(1970, 1, 1, 0, 0, 0, 0, New GregorianCalendar(), DateTimeKind.Local) ' Compliant\n        Dim ctor10_2 = New DateTime(1970, 1, 1, 0, 0, 0, 0, New ChineseLunisolarCalendar(), DateTimeKind.Utc) ' Compliant\n        Dim ctor10_3 = DateTime.UnixEpoch ' Fixed\n        Dim ctor10_4 = New DateTime(year:=1970, minute:=0, month:=1, day:=1, hour:=0, calendar:=New GregorianCalendar(), millisecond:=0, second:=second, kind:=DateTimeKind.Utc) ' Compliant\n\n        ' year, month, day, hour, minute, second, millisecond and microsecond\n        Dim ctor11_0 = DateTime.UnixEpoch ' Fixed\n        Dim ctor11_1 = New DateTime(1970, 1, 1, 0, 0, 0, 0, 1) ' Compliant\n        Dim ctor11_2 = DateTime.UnixEpoch ' Fixed\n        Dim ctor11_3 = New DateTime(year:=1970, microsecond:=0, minute:=minute, month:=1, hour:=0, day:=1, millisecond:=millisecond, second:=0) ' Compliant\n\n        ' year, month, day, hour, minute, second, millisecond, microsecond and calendar\n        Dim ctor12_0 = DateTime.UnixEpoch ' Fixed\n        Dim ctor12_1 = New DateTime(1970, 1, 1, 0, 0, 0, 0, 1, New GregorianCalendar()) ' Compliant\n        Dim ctor12_2 = New DateTime(1970, 1, 1, 0, 0, 0, 0, 0, New ChineseLunisolarCalendar()) ' Compliant\n        Dim ctor12_3 = DateTime.UnixEpoch ' Fixed\n        Dim ctor12_4 = New DateTime(year:=1970, minute:=minute, month:=1, day:=1, hour:=0, calendar:=New GregorianCalendar(), millisecond:=0, second:=0, microsecond:=0) ' Compliant\n\n        ' year, month, day, hour, minute, second, millisecond, microsecond and DateTimeKind value\n        Dim ctor13_0 = DateTime.UnixEpoch ' Fixed\n        Dim ctor13_1 = New DateTime(1970, 1, 1, 0, 0, 0, 0, 1, DateTimeKind.Utc) ' Compliant\n        Dim ctor13_2 = New DateTime(1970, 1, 1, 0, 0, 0, 0, 0, DateTimeKind.Unspecified) ' Compliant\n        Dim ctor13_3 = New DateTime(1970, 1, 1, 0, 0, 0, 0, 0, DateTimeKind.Local) ' Compliant\n        Dim ctor13_4 = DateTime.UnixEpoch ' Fixed\n        Dim ctor13_5 = New DateTime(year:=1970, minute:=minute, month:=1, day:=1, hour:=0, kind:=DateTimeKind.Utc, millisecond:=0, second:=0, microsecond:=0) ' Compliant\n\n        ' year, month, day, hour, minute, second, millisecond, microsecond calendar and DateTimeKind value\n        Dim ctor14_0 = DateTime.UnixEpoch ' Fixed\n        Dim ctor14_1 = New DateTime(1970, 1, 1, 0, 0, 0, 0, 1, New GregorianCalendar(), DateTimeKind.Utc) ' Compliant\n        Dim ctor14_2 = New DateTime(1970, 1, 1, 0, 0, 0, 0, 0, New GregorianCalendar(), DateTimeKind.Unspecified) ' Compliant\n        Dim ctor14_3 = New DateTime(1970, 1, 1, 0, 0, 0, 0, 0, New ChineseLunisolarCalendar(), DateTimeKind.Utc) ' Compliant\n        Dim ctor14_4 = DateTime.UnixEpoch ' Fixed\n        Dim ctor14_5 = New DateTime(year:=1970, minute:=minute, month:=1, day:=1, hour:=0, kind:=DateTimeKind.Utc, millisecond:=0, second:=0, microsecond:=0, calendar:=calendar) ' Compliant\n    End Sub\n\n    Private Sub DateTimeOffsetConstructors(ByVal timeSpan As TimeSpan, ByVal dateTime As Date, ByVal ticks As Integer, ByVal year As Integer, ByVal month As Integer, ByVal day As Integer, ByVal hour As Integer, ByVal minute As Integer, ByVal second As Integer, ByVal millisecond As Integer, ByVal microsecond As Integer, ByVal calendar As Calendar, ByVal kind As DateTimeKind)\n        ' default date\n        Dim ctor0_0 = New DateTimeOffset() ' Compliant\n\n        ' datetime\n        Dim ctor1_0 = New DateTimeOffset(New DateTime()) ' Compliant\n        Dim ctor1_1 = New DateTimeOffset(dateTime) ' Compliant\n        Dim ctor1_2 = New DateTimeOffset(DateTime.UnixEpoch) ' Fixed\n\n        ' datetime and timespan\n        Dim ctor2_0 = New DateTimeOffset(New DateTime(), TimeSpan.Zero) ' Compliant\n        Dim ctor2_1 = New DateTimeOffset(New DateTime(), timeSpan) ' Compliant\n        Dim ctor2_2 = New DateTimeOffset(DateTime.UnixEpoch, TimeSpan.Zero) ' Fixed\n\n        ' year, month, day, hour, minute, second, millisecond, offset and calendar\n        Dim ctor3_0 = New DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, calendar, timeSpan) ' Compliant\n        Dim ctor3_1 = DateTimeOffset.UnixEpoch ' Fixed\n        Dim ctor3_2 = DateTimeOffset.UnixEpoch ' Fixed\n        Dim ctor3_3 = New DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, New GregorianCalendar(), New TimeSpan(1)) ' Compliant\n        Dim ctor3_4 = DateTimeOffset.UnixEpoch ' Fixed\n        Dim ctor3_5 = DateTimeOffset.UnixEpoch ' Fixed\n        Dim ctor3_6 = New DateTimeOffset(hour:=0, month:=1, day:=1, year:=1970, minute:=0, second:=0, millisecond:=0, calendar:=New GregorianCalendar(), offset:=New TimeSpan(2)) ' Compliant\n        Dim ctor3_7 = New DateTimeOffset(hour:=0, month:=1, day:=1, year:=1970, minute:=0, second:=0, millisecond:=0, calendar:=calendar, offset:=New TimeSpan(0)) ' Compliant\n\n        ' year, month, day, hour, minute, second, millisecond, microsecond, offset and calendar\n        Dim ctor4_0 = New DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, 0, calendar, timeSpan) ' Compliant\n        Dim ctor4_1 = DateTimeOffset.UnixEpoch ' Fixed\n        Dim ctor4_2 = DateTimeOffset.UnixEpoch ' Fixed\n        Dim ctor4_3 = New DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, 0, New GregorianCalendar(), New TimeSpan(1)) ' Compliant\n        Dim ctor4_4 = New DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, 1, New GregorianCalendar(), New TimeSpan(0)) ' Compliant\n        Dim ctor4_5 = DateTimeOffset.UnixEpoch ' Fixed\n        Dim ctor4_6 = DateTimeOffset.UnixEpoch ' Fixed\n        Dim ctor4_7 = New DateTimeOffset(hour:=0, month:=1, day:=1, year:=1970, minute:=0, second:=0, microsecond:=0, millisecond:=0, calendar:=New GregorianCalendar(), offset:=New TimeSpan(2)) ' Compliant\n        Dim ctor4_8 = New DateTimeOffset(hour:=0, month:=1, day:=1, year:=1970, minute:=0, second:=0, microsecond:=0, millisecond:=0, calendar:=calendar, offset:=New TimeSpan(0)) ' Compliant\n        Dim ctor4_9 = New DateTimeOffset(hour:=0, month:=1, day:=1, year:=1970, minute:=0, second:=0, microsecond:=1, millisecond:=0, calendar:=New GregorianCalendar(), offset:=New TimeSpan(0)) ' Compliant\n\n        ' year, month, day, hour, minute, second and offset\n        Dim ctor5_0 = DateTimeOffset.UnixEpoch ' Fixed\n        Dim ctor5_1 = New DateTimeOffset(1970, 1, 1, 0, 0, 0, New TimeSpan(1)) ' Compliant\n        Dim ctor5_2 = New DateTimeOffset(1970, 1, 1, 0, 0, 0, timeSpan) ' Compliant\n        Dim ctor5_3 = New DateTimeOffset(1970, 1, 1, 0, 0, 0, timeSpan) ' Compliant\n        Dim ctor5_4 = New DateTimeOffset(1970, 1, 1, 0, 0, 2, New TimeSpan(0)) ' Compliant\n        Dim ctor5_5 = DateTimeOffset.UnixEpoch ' Fixed\n\n        ' year, month, day, hour, minute, second, millisecond and offset\n        Dim ctor6_0 = DateTimeOffset.UnixEpoch ' Fixed\n        Dim ctor6_1 = DateTimeOffset.UnixEpoch ' Fixed\n        Dim ctor6_2 = New DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, New TimeSpan(2, 14, 18)) ' Compliant\n        Dim ctor6_3 = New DateTimeOffset(1970, 1, 1, 0, 1, 0, 0, TimeSpan.Zero) ' Compliant\n        Dim ctor6_4 = DateTimeOffset.UnixEpoch ' Fixed\n\n        ' year, month, day, hour, minute, second, millisecond and offset\n        Dim ctor7_0 = DateTimeOffset.UnixEpoch ' Fixed\n        Dim ctor7_1 = New DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, 0, New TimeSpan(2, 14, 18)) ' Compliant\n        Dim ctor7_2 = DateTimeOffset.UnixEpoch ' Fixed\n        Dim ctor7_3 = New DateTimeOffset(1970, 1, 1, 0, 1, 0, 0, 0, TimeSpan.Zero) ' Compliant\n        Dim ctor7_4 = DateTimeOffset.UnixEpoch ' Fixed\n    End Sub\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseUnixEpoch.Framework.cs",
    "content": "﻿using System;\nusing System.Globalization;\n\npublic class Program\n{\n    private readonly DateTime Epoch = new DateTime(1970, 1, 1); // Compliant: the UnixEpoch property is available starting from .NET Core 2.1/.NET Standard 2.1, the .NET Framework does not support it\n\n    private readonly DateTimeOffset EpochOff = new DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, TimeSpan.Zero); // Compliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseUnixEpoch.Framework.vb",
    "content": "﻿Imports System.Globalization\n\nPublic Class Program\n    Private ReadOnly Epoch As Date = New DateTime(1970, 1, 1) ' Compliant\n\n    Private ReadOnly EpochOff As DateTimeOffset = New DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, TimeSpan.Zero) ' Compliant\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseUnixEpoch.cs",
    "content": "﻿using System;\nusing System.Globalization;\nusing MyAlias = System.DateTime;\n\npublic class Program\n{\n    private readonly DateTime Epoch = new DateTime(1970, 1, 1); // Noncompliant {{Use \"DateTime.UnixEpoch\" instead of creating DateTime instances that point to the unix epoch time}}\n    //                                ^^^^^^^^^^^^^^^^^^^^^^^^\n\n    private readonly DateTimeOffset EpochOff = new DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, TimeSpan.Zero); // Noncompliant {{Use \"DateTimeOffset.UnixEpoch\" instead of creating DateTimeOffset instances that point to the unix epoch time}}\n    //                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n    private const long EpochTicks = 621355968000000000;\n    private const long EpochTicksUnderscores = 621_355_968_000_000_000;\n    private const long EpochTicksBinary = 0b100010011111011111111111010111110111101101011000000000000000;\n    private const long EpochTicksHex = 0x89F7FF5F7B58000;\n    private const long SomeLongConst = 6213;\n\n    void BasicCases(DateTime dateTime)\n    {\n        var timeSpan = dateTime - new DateTime(1970, 1, 1); // Noncompliant\n\n        if (dateTime < new DateTime(1970, 1, 1)) // Noncompliant\n        {\n            return;\n        }\n\n        var compliant0 = new DateTime(1971, 1, 1); // Compliant\n        var compliant1 = new DateTime(1970, 2, 1); // Compliant\n        var compliant2 = new DateTime(1970, 1, 2); // Compliant\n        var compliant3 = DateTime.UnixEpoch; // Compliant\n        var compliant4 = DateTimeOffset.UnixEpoch; // Compliant\n\n        var year = 1970;\n        var dateTime2 = new DateTime(year, 1, 1); // FN\n    }\n\n    void EdgeCases()\n    {\n        var dateTimeOffset = new DateTimeOffset(new DateTime(1970, 1, 1), new TimeSpan(0, 0, 0)); // Noncompliant\n        var dateTime = new DateTime(true ? 1970 : 1971, 1, 1); // FN\n        dateTime = new DateTime(1970, 01, 01); // Noncompliant\n        dateTime = new DateTime(1970, 0x1, 0x1); // Noncompliant\n        dateTime = new System.DateTime(1970, 1, 1); // Noncompliant\n        dateTime = new MyAlias(1970, 1, 1); // Noncompliant\n    }\n\n    void DateTimeConstructors(int ticks, int year, int month, int day, int hour, int minute, int second, int millisecond, Calendar calendar, DateTimeKind kind)\n    {\n        // default date\n        var ctor0_0 = new DateTime(); // Compliant\n\n        // ticks\n        var ctor1_0 = new DateTime(1970); // Compliant\n        var ctor1_1 = new DateTime(ticks); // Compliant\n        var ctor1_2 = new DateTime(ticks: ticks); // Compliant\n        var ctor1_3 = new DateTime(621355968000000000); // Noncompliant\n        var ctor1_4 = new DateTime(EpochTicks); // Noncompliant: const variables are tracked\n        var ctor1_5 = new DateTime(EpochTicksUnderscores); // Noncompliant: const variables are tracked\n        var ctor1_6 = new DateTime(EpochTicksBinary); // Noncompliant: const variables are tracked\n        var ctor1_7 = new DateTime(EpochTicksHex); // Noncompliant: const variables are tracked\n        var ctor1_8 = new DateTime(SomeLongConst); // Compliant\n\n        // year, month, and day\n        var ctor2_0 = new DateTime(1970, 1, 1); // Noncompliant\n        var ctor2_1 = new DateTime(year, month, day); // Compliant\n        var ctor2_2 = new DateTime(month: month, day: day, year: year); // Compliant\n        var ctor2_3 = new DateTime(month: 1, day: 1, year: 1970); // Noncompliant\n\n        // year, month, day, and calendar\n        var ctor3_0 = new DateTime(1970, 1, 1, new GregorianCalendar()); // Noncompliant\n        var ctor3_1 = new DateTime(1970, 3, 1, new GregorianCalendar()); // Compliant\n        var ctor3_2 = new DateTime(1970, 1, 1, new ChineseLunisolarCalendar()); // Compliant\n        var ctor3_3 = new DateTime(month: 1, day: 1, calendar: new GregorianCalendar(), year: 1970); // Noncompliant\n        var ctor3_4 = new DateTime(month: 1, day: 1, calendar: new ChineseLunisolarCalendar(), year: 1970); // Compliant\n\n        // year, month, day, hour, minute, and second\n        var ctor4_0 = new DateTime(1970, 1, 1, 0, 0, 0); // Noncompliant\n        var ctor4_1 = new DateTime(1970, 1, 1, 0, 0, 1); // Compliant\n        var ctor4_2 = new DateTime(year: 1970, minute: minute, month: 1, day: 1, hour: 0, second: 0); // Compliant\n        var ctor4_3 = new DateTime(year: 1970, minute: 0, month: 1, day: 1, hour: 0, second: 0); // Noncompliant\n\n        // year, month, day, hour, minute, second, and calendar\n        var ctor5_0 = new DateTime(1970, 1, 1, 0, 0, 0, new GregorianCalendar()); // Noncompliant\n        var ctor5_1 = new DateTime(1970, 1, 1, 0, 1, 0, new GregorianCalendar()); // Compliant\n        var ctor5_2 = new DateTime(1970, 1, 1, 0, 0, 0, new ChineseLunisolarCalendar()); // Compliant\n        var ctor5_3 = new DateTime(year: 1970, second: 0, minute: 0, day: 1, month: 1, hour: 0, calendar: new GregorianCalendar()); // Noncompliant\n        var ctor5_4 = new DateTime(year: 1970, second: 0, minute: 0, day: 1, month: 1, hour: 0, calendar: calendar); // Compliant\n\n        // year, month, day, hour, minute, second, and DateTimeKind value\n        var ctor6_0 = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); // Noncompliant\n        var ctor6_1 = new DateTime(1970, 1, 1, 1, 0, 0, DateTimeKind.Utc); // Compliant\n        var ctor6_2 = new DateTime(1970, 1, 1, hour, 0, 0, DateTimeKind.Utc); // Compliant\n        var ctor6_3 = new DateTime(month: 1, year: 1970, day: 1, hour: 0, second: 0, minute: 0, kind: DateTimeKind.Utc); // Noncompliant\n        var ctor6_4 = new DateTime(month: 1, year: 1970, day: 1, hour: hour, second: 0, minute: 0, kind: DateTimeKind.Utc); // Compliant\n        var ctor6_5 = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Unspecified); // Compliant\n        var ctor6_6 = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Local); // Compliant\n\n        // year, month, day, hour, minute, second, and millisecond\n        var ctor7_0 = new DateTime(1970, 1, 1, 0, 0, 0, 0); // Noncompliant\n        var ctor7_1 = new DateTime(1970, 1, 1, 0, 0, 0, 1); // Compliant\n        var ctor7_3 = new DateTime(year, month, day, hour, minute, second, millisecond); // Compliant\n        var ctor7_4 = new DateTime(year: 1970, minute: minute, month: 1, day: 1, hour: 0, millisecond: 0, second: 0); // Compliant\n        var ctor7_5 = new DateTime(year: 1970, minute: 0, month: 1, day: 1, hour: 0, millisecond: 0, second: 0); // Noncompliant\n\n        // year, month, day, hour, minute, second, millisecond, and calendar\n        var ctor8_0 = new DateTime(1970, 1, 1, 0, 0, 0, 0, new GregorianCalendar()); // Noncompliant\n        var ctor8_1 = new DateTime(1970, 1, 1, 0, 0, 0, 1, new GregorianCalendar()); // Compliant\n        var ctor8_2 = new DateTime(1970, 1, 1, 0, 0, 0, 0, new ChineseLunisolarCalendar()); // Compliant\n        var ctor8_3 = new DateTime(year: 1970, minute: 0, month: 1, day: 1, hour: 0, millisecond: 0, second: 0, calendar: new GregorianCalendar()); // Noncompliant\n\n        // year, month, day, hour, minute, second, millisecond, and DateTimeKind value\n        var ctor9_0 = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); // Noncompliant\n        var ctor9_1 = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified); // Compliant\n        var ctor9_2 = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Local); // Compliant\n        var ctor9_3 = new DateTime(year: 1970, minute: 0, month: 1, day: 1, hour: 0, millisecond: 0, second: 0, kind: DateTimeKind.Utc); // Noncompliant\n        var ctor9_4 = new DateTime(year: 1970, minute: 0, month: 1, day: 1, hour: 0, millisecond: 0, second: 0, kind: kind); // Compliant\n\n        // year, month, day, hour, minute, second, millisecond, calendar and DateTimeKind value\n        var ctor10_0 = new DateTime(1970, 1, 1, 0, 0, 0, 0, new GregorianCalendar(), DateTimeKind.Utc); // Noncompliant\n        var ctor10_1 = new DateTime(1970, 1, 1, 0, 0, 0, 0, new GregorianCalendar(), DateTimeKind.Local); // Compliant\n        var ctor10_2 = new DateTime(1970, 1, 1, 0, 0, 0, 0, new ChineseLunisolarCalendar(), DateTimeKind.Utc); // Compliant\n        var ctor10_3 = new DateTime(year: 1970, minute: 0, month: 1, day: 1, hour: 0, calendar: new GregorianCalendar(), millisecond: 0, second: 0, kind: DateTimeKind.Utc); // Noncompliant\n        var ctor10_4 = new DateTime(year: 1970, minute: 0, month: 1, day: 1, hour: 0, calendar: new GregorianCalendar(), millisecond: 0, second: second, kind: DateTimeKind.Utc); // Compliant\n\n        // year, month, day, hour, minute, second, millisecond and microsecond\n        var ctor11_0 = new DateTime(1970, 1, 1, 0, 0, 0, 0, 0); // Noncompliant\n        var ctor11_1 = new DateTime(1970, 1, 1, 0, 0, 0, 0, 1); // Compliant\n        var ctor11_2 = new DateTime(year: 1970, minute: 0, month: 1, day: 1, hour: 0, millisecond: 0, second: 0, microsecond: 0); // Noncompliant\n        var ctor11_3 = new DateTime(year: 1970, microsecond: 0, minute: minute, month: 1, hour: 0, day: 1, millisecond: millisecond, second: 0); // Compliant\n\n        // year, month, day, hour, minute, second, millisecond, microsecond and calendar\n        var ctor12_0 = new DateTime(1970, 1, 1, 0, 0, 0, 0, 0, new GregorianCalendar()); // Noncompliant\n        var ctor12_1 = new DateTime(1970, 1, 1, 0, 0, 0, 0, 1, new GregorianCalendar()); // Compliant\n        var ctor12_2 = new DateTime(1970, 1, 1, 0, 0, 0, 0, 0, new ChineseLunisolarCalendar()); // Compliant\n        var ctor12_3 = new DateTime(year: 1970, minute: 0, month: 1, day: 1, hour: 0, calendar: new GregorianCalendar(), millisecond: 0, second: 0, microsecond: 0); // Noncompliant\n        var ctor12_4 = new DateTime(year: 1970, minute: minute, month: 1, day: 1, hour: 0, calendar: new GregorianCalendar(), millisecond: 0, second: 0, microsecond: 0); // Compliant\n\n        // year, month, day, hour, minute, second, millisecond, microsecond and DateTimeKind value\n        var ctor13_0 = new DateTime(1970, 1, 1, 0, 0, 0, 0, 0, DateTimeKind.Utc); // Noncompliant\n        var ctor13_1 = new DateTime(1970, 1, 1, 0, 0, 0, 0, 1, DateTimeKind.Utc); // Compliant\n        var ctor13_2 = new DateTime(1970, 1, 1, 0, 0, 0, 0, 0, DateTimeKind.Unspecified); // Compliant\n        var ctor13_3 = new DateTime(1970, 1, 1, 0, 0, 0, 0, 0, DateTimeKind.Local); // Compliant\n        var ctor13_4 = new DateTime(year: 1970, minute: 0, month: 1, day: 1, hour: 0, kind: DateTimeKind.Utc, millisecond: 0, second: 0, microsecond: 0); // Noncompliant\n        var ctor13_5 = new DateTime(year: 1970, minute: minute, month: 1, day: 1, hour: 0, kind: DateTimeKind.Utc, millisecond: 0, second: 0, microsecond: 0); // Compliant\n\n        // year, month, day, hour, minute, second, millisecond, microsecond calendar and DateTimeKind value\n        var ctor14_0 = new DateTime(1970, 1, 1, 0, 0, 0, 0, 0, new GregorianCalendar(), DateTimeKind.Utc); // Noncompliant\n        var ctor14_1 = new DateTime(1970, 1, 1, 0, 0, 0, 0, 1, new GregorianCalendar(), DateTimeKind.Utc); // Compliant\n        var ctor14_2 = new DateTime(1970, 1, 1, 0, 0, 0, 0, 0, new GregorianCalendar(), DateTimeKind.Unspecified); // Compliant\n        var ctor14_3 = new DateTime(1970, 1, 1, 0, 0, 0, 0, 0, new ChineseLunisolarCalendar(), DateTimeKind.Utc); // Compliant\n        var ctor14_4 = new DateTime(year: 1970, minute: 0, month: 1, day: 1, hour: 0, kind: DateTimeKind.Utc, millisecond: 0, second: 0, microsecond: 0, calendar: new GregorianCalendar()); // Noncompliant\n        var ctor14_5 = new DateTime(year: 1970, minute: minute, month: 1, day: 1, hour: 0, kind: DateTimeKind.Utc, millisecond: 0, second: 0, microsecond: 0, calendar: calendar); // Compliant\n    }\n\n    void DateTimeOffsetConstructors(TimeSpan timeSpan, DateTime dateTime, int ticks, int year, int month, int day, int hour, int minute, int second, int millisecond, int microsecond, Calendar calendar, DateTimeKind kind)\n    {\n        // default date\n        var ctor0_0 = new DateTimeOffset(); // Compliant\n\n        // datetime\n        var ctor1_0 = new DateTimeOffset(new DateTime()); // Compliant\n        var ctor1_1 = new DateTimeOffset(dateTime); // Compliant\n        var ctor1_2 = new DateTimeOffset(new DateTime(1970, 1, 1)); // Noncompliant\n\n        // datetime and timespan\n        var ctor2_0 = new DateTimeOffset(new DateTime(), TimeSpan.Zero); // Compliant\n        var ctor2_1 = new DateTimeOffset(new DateTime(), timeSpan); // Compliant\n        var ctor2_2 = new DateTimeOffset(new DateTime(1970, 1, 1), TimeSpan.Zero); // Noncompliant\n\n        // year, month, day, hour, minute, second, millisecond, offset and calendar\n        var ctor3_0 = new DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, calendar, timeSpan); // Compliant\n        var ctor3_1 = new DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, new GregorianCalendar(), TimeSpan.Zero); // Noncompliant\n        var ctor3_2 = new DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, new GregorianCalendar(), new TimeSpan(0)); // Noncompliant\n        var ctor3_3 = new DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, new GregorianCalendar(), new TimeSpan(1)); // Compliant\n        var ctor3_4 = new DateTimeOffset(hour: 0, month: 1, day: 1, year: 1970, minute: 0, second: 0, millisecond: 0, calendar: new GregorianCalendar(), offset: TimeSpan.Zero); // Noncompliant\n        var ctor3_5 = new DateTimeOffset(hour: 0, month: 1, day: 1, year: 1970, minute: 0, second: 0, millisecond: 0, calendar: new GregorianCalendar(), offset: new TimeSpan(0)); // Noncompliant\n        var ctor3_6 = new DateTimeOffset(hour: 0, month: 1, day: 1, year: 1970, minute: 0, second: 0, millisecond: 0, calendar: new GregorianCalendar(), offset: new TimeSpan(2)); // Compliant\n        var ctor3_7 = new DateTimeOffset(hour: 0, month: 1, day: 1, year: 1970, minute: 0, second: 0, millisecond: 0, calendar: calendar, offset: new TimeSpan(0)); // Compliant\n\n        // year, month, day, hour, minute, second, millisecond, microsecond, offset and calendar\n        var ctor4_0 = new DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, 0, calendar, timeSpan); // Compliant\n        var ctor4_1 = new DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, 0, new GregorianCalendar(), TimeSpan.Zero); // Noncompliant\n        var ctor4_2 = new DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, 0, new GregorianCalendar(), new TimeSpan(0)); // Noncompliant\n        var ctor4_3 = new DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, 0, new GregorianCalendar(), new TimeSpan(1)); // Compliant\n        var ctor4_4 = new DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, 1, new GregorianCalendar(), new TimeSpan(0)); // Compliant\n        var ctor4_5 = new DateTimeOffset(hour: 0, month: 1, day: 1, year: 1970, minute: 0, second: 0, microsecond: 0, millisecond: 0, calendar: new GregorianCalendar(), offset: TimeSpan.Zero); // Noncompliant\n        var ctor4_6 = new DateTimeOffset(hour: 0, month: 1, day: 1, year: 1970, minute: 0, second: 0, microsecond: 0, millisecond: 0, calendar: new GregorianCalendar(), offset: new TimeSpan(0)); // Noncompliant\n        var ctor4_7 = new DateTimeOffset(hour: 0, month: 1, day: 1, year: 1970, minute: 0, second: 0, microsecond: 0, millisecond: 0, calendar: new GregorianCalendar(), offset: new TimeSpan(2)); // Compliant\n        var ctor4_8 = new DateTimeOffset(hour: 0, month: 1, day: 1, year: 1970, minute: 0, second: 0, microsecond: 0, millisecond: 0, calendar: calendar, offset: new TimeSpan(0)); // Compliant\n        var ctor4_9 = new DateTimeOffset(hour: 0, month: 1, day: 1, year: 1970, minute: 0, second: 0, microsecond: 1, millisecond: 0, calendar: new GregorianCalendar(), offset: new TimeSpan(0)); // Compliant\n\n        // year, month, day, hour, minute, second and offset\n        var ctor5_0 = new DateTimeOffset(1970, 1, 1, 0, 0, 0, new TimeSpan(0)); // Noncompliant\n        var ctor5_1 = new DateTimeOffset(1970, 1, 1, 0, 0, 0, new TimeSpan(1)); // Compliant\n        var ctor5_2 = new DateTimeOffset(1970, 1, 1, 0, 0, 0, timeSpan); // Compliant\n        var ctor5_3 = new DateTimeOffset(1970, 1, 1, 0, 0, 0, timeSpan); // Compliant\n        var ctor5_4 = new DateTimeOffset(1970, 1, 1, 0, 0, 2, new TimeSpan(0)); // Compliant\n        var ctor5_5 = new DateTimeOffset(year: 1970, minute: 0, month: 1, day: 1, hour: 0, second: 0, offset: new TimeSpan(0)); // Noncompliant\n\n        // year, month, day, hour, minute, second, millisecond and offset\n        var ctor6_0 = new DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, new TimeSpan(0)); // Noncompliant\n        var ctor6_1 = new DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, TimeSpan.Zero); // Noncompliant\n        var ctor6_2 = new DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, new TimeSpan(2, 14, 18)); // Compliant\n        var ctor6_3 = new DateTimeOffset(1970, 1, 1, 0, 1, 0, 0, TimeSpan.Zero); // Compliant\n        var ctor6_4 = new DateTimeOffset(year: 1970, minute: 0, month: 1, day: 1, hour: 0, millisecond: 0, second: 0, offset: new TimeSpan(0)); // Noncompliant\n\n        // year, month, day, hour, minute, second, millisecond and offset\n        var ctor7_0 = new DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, 0, new TimeSpan(0)); // Noncompliant\n        var ctor7_1 = new DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, 0, new TimeSpan(2, 14, 18)); // Compliant\n        var ctor7_2 = new DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, 0, TimeSpan.Zero); // Noncompliant\n        var ctor7_3 = new DateTimeOffset(1970, 1, 1, 0, 1, 0, 0, 0, TimeSpan.Zero); // Compliant\n        var ctor7_4 = new DateTimeOffset(year: 1970, minute: 0, microsecond: 0, month: 1, day: 1, hour: 0, millisecond: 0, second: 0, offset: new TimeSpan(0)); // Noncompliant\n    }\n}\n\npublic class FakeDateTime\n{\n    void MyMethod()\n    {\n        _ = new DateTime(1970, 1, 1); // Compliant\n        _ = new DateTime(\"hello\"); // Compliant\n    }\n\n    public class DateTime\n    {\n        public DateTime(int year, int month, int day) { }\n        public DateTime(string ticks) { }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseUnixEpoch.vb",
    "content": "﻿Imports System.Globalization\nImports MyAlias = System.DateTime\n\nPublic Class Program\n    Private ReadOnly Epoch As Date = New DateTime(1970, 1, 1) ' Noncompliant {{Use \"DateTime.UnixEpoch\" instead of creating DateTime instances that point to the unix epoch time}}\n    '                                ^^^^^^^^^^^^^^^^^^^^^^^^\n\n    Private ReadOnly EpochOff As DateTimeOffset = New DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, TimeSpan.Zero) ' Noncompliant {{Use \"DateTimeOffset.UnixEpoch\" instead of creating DateTimeOffset instances that point to the unix epoch time}}\n    '                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n    Private Const EpochTicks As Long = 621355968000000000\n    Private Const EpochTicksUnderscores As Long = 621_355_968_000_000_000\n    Private Const EpochTicksBinary As Long = &B100010011111011111111111010111110111101101011000000000000000\n    Private Const EpochTicksHex As Long = &H89F7FF5F7B58000\n    Private Const SomeLongConst As Long = 6213\n\n    Private Sub BasicCases(ByVal dateTime As Date)\n        Dim timeSpan = dateTime - New DateTime(1970, 1, 1) ' Noncompliant\n\n        If dateTime < New DateTime(1970, 1, 1) Then ' Noncompliant\n            Return\n        End If\n\n        Dim compliant0 = New DateTime(1971, 1, 1) ' Compliant\n        Dim compliant1 = New DateTime(1970, 2, 1) ' Compliant\n        Dim compliant2 = New DateTime(1970, 1, 2) ' Compliant\n        Dim compliant3 = Date.UnixEpoch ' Compliant\n        Dim compliant4 = DateTimeOffset.UnixEpoch ' Compliant\n\n        Dim year = 1970\n        Dim dateTime2 = New DateTime(year, 1, 1) ' FN\n    End Sub\n\n    Private Sub EdgeCases()\n        Dim dateTimeOffset = New DateTimeOffset(New DateTime(1970, 1, 1), New TimeSpan(0, 0, 0)) ' Noncompliant\n        Dim dateTime = New DateTime(If(True, 1970, 1971), 1, 1) ' FN\n        dateTime = New DATETIME(1970, 1, 1) ' Noncompliant\n        Dim dateTime2 As Date = New Date(1970, 1, 1) ' Noncompliant\n        Dim dateTime3 = New System.DateTime(1970, 1, 1) ' Noncompliant\n        Dim dateTime4 = New MyAlias(1970, 1, 1) ' Noncompliant\n    End Sub\n\n    Private Sub DateTimeConstructors(ByVal ticks As Integer, ByVal year As Integer, ByVal month As Integer, ByVal day As Integer, ByVal hour As Integer, ByVal minute As Integer, ByVal second As Integer, ByVal millisecond As Integer, ByVal calendar As Calendar, ByVal kind As DateTimeKind)\n        ' default date\n        Dim ctor0_0 = New DateTime() ' Compliant\n\n        ' ticks\n        Dim ctor1_0 = New DateTime(1970) ' Compliant\n        Dim ctor1_1 = New DateTime(ticks) ' Compliant\n        Dim ctor1_2 = New DateTime(ticks:=ticks) ' Compliant\n        Dim ctor1_3 = New DateTime(621355968000000000) ' Noncompliant\n        Dim ctor1_4 = New DateTime(EpochTicks) ' Noncompliant: const variables are tracked\n        Dim ctor1_5 = New DateTime(EpochTicksUnderscores) ' Noncompliant: const variables are tracked\n        Dim ctor1_6 = New DateTime(EpochTicksBinary) ' Noncompliant: const variables are tracked\n        Dim ctor1_7 = New DateTime(EpochTicksHex) ' Noncompliant: const variables are tracked\n        Dim ctor1_8 = New DateTime(SomeLongConst) ' Compliant\n\n        ' year, month, and day\n        Dim ctor2_0 = New DateTime(1970, 1, 1) ' Noncompliant\n        Dim ctor2_1 = New DateTime(year, month, day) ' Compliant\n        Dim ctor2_2 = New DateTime(month:=month, day:=day, year:=year) ' Compliant\n        Dim ctor2_3 = New DateTime(month:=1, day:=1, year:=1970) ' Noncompliant\n\n        ' year, month, day, and calendar\n        Dim ctor3_0 = New DateTime(1970, 1, 1, New GregorianCalendar()) ' Noncompliant\n        Dim ctor3_1 = New DateTime(1970, 3, 1, New GregorianCalendar()) ' Compliant\n        Dim ctor3_2 = New DateTime(1970, 1, 1, New ChineseLunisolarCalendar()) ' Compliant\n        Dim ctor3_3 = New DateTime(month:=1, day:=1, calendar:=New GregorianCalendar(), year:=1970) ' Noncompliant\n        Dim ctor3_4 = New DateTime(month:=1, day:=1, calendar:=New ChineseLunisolarCalendar(), year:=1970) ' Compliant\n\n        ' year, month, day, hour, minute, and second\n        Dim ctor4_0 = New DateTime(1970, 1, 1, 0, 0, 0) ' Noncompliant\n        Dim ctor4_1 = New DateTime(1970, 1, 1, 0, 0, 1) ' Compliant\n        Dim ctor4_2 = New DateTime(year:=1970, minute:=minute, month:=1, day:=1, hour:=0, second:=0) ' Compliant\n        Dim ctor4_3 = New DateTime(year:=1970, minute:=0, month:=1, day:=1, hour:=0, second:=0) ' Noncompliant\n\n        ' year, month, day, hour, minute, second, and calendar\n        Dim ctor5_0 = New DateTime(1970, 1, 1, 0, 0, 0, New GregorianCalendar()) ' Noncompliant\n        Dim ctor5_1 = New DateTime(1970, 1, 1, 0, 1, 0, New GregorianCalendar()) ' Compliant\n        Dim ctor5_2 = New DateTime(1970, 1, 1, 0, 0, 0, New ChineseLunisolarCalendar()) ' Compliant\n        Dim ctor5_3 = New DateTime(year:=1970, second:=0, minute:=0, day:=1, month:=1, hour:=0, calendar:=New GregorianCalendar()) ' Noncompliant\n        Dim ctor5_4 = New DateTime(year:=1970, second:=0, minute:=0, day:=1, month:=1, hour:=0, calendar:=calendar) ' Compliant\n\n        ' year, month, day, hour, minute, second, and DateTimeKind value\n        Dim ctor6_0 = New DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc) ' Noncompliant\n        Dim ctor6_1 = New DateTime(1970, 1, 1, 1, 0, 0, DateTimeKind.Utc) ' Compliant\n        Dim ctor6_2 = New DateTime(1970, 1, 1, hour, 0, 0, DateTimeKind.Utc) ' Compliant\n        Dim ctor6_3 = New DateTime(month:=1, year:=1970, day:=1, hour:=0, second:=0, minute:=0, kind:=DateTimeKind.Utc) ' Noncompliant\n        Dim ctor6_4 = New DateTime(month:=1, year:=1970, day:=1, hour:=hour, second:=0, minute:=0, kind:=DateTimeKind.Utc) ' Compliant\n        Dim ctor6_5 = New DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Unspecified) ' Compliant\n        Dim ctor6_6 = New DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Local) ' Compliant\n\n        ' year, month, day, hour, minute, second, and millisecond\n        Dim ctor7_0 = New DateTime(1970, 1, 1, 0, 0, 0, 0) ' Noncompliant\n        Dim ctor7_1 = New DateTime(1970, 1, 1, 0, 0, 0, 1) ' Compliant\n        Dim ctor7_3 = New DateTime(year, month, day, hour, minute, second, millisecond) ' Compliant\n        Dim ctor7_4 = New DateTime(year:=1970, minute:=minute, month:=1, day:=1, hour:=0, millisecond:=0, second:=0) ' Compliant\n        Dim ctor7_5 = New DateTime(year:=1970, minute:=0, month:=1, day:=1, hour:=0, millisecond:=0, second:=0) ' Noncompliant\n\n        ' year, month, day, hour, minute, second, millisecond, and calendar\n        Dim ctor8_0 = New DateTime(1970, 1, 1, 0, 0, 0, 0, New GregorianCalendar()) ' Noncompliant\n        Dim ctor8_1 = New DateTime(1970, 1, 1, 0, 0, 0, 1, New GregorianCalendar()) ' Compliant\n        Dim ctor8_2 = New DateTime(1970, 1, 1, 0, 0, 0, 0, New ChineseLunisolarCalendar()) ' Compliant\n        Dim ctor8_3 = New DateTime(year:=1970, minute:=0, month:=1, day:=1, hour:=0, millisecond:=0, second:=0, calendar:=New GregorianCalendar()) ' Noncompliant\n\n        ' year, month, day, hour, minute, second, millisecond, and DateTimeKind value\n        Dim ctor9_0 = New DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc) ' Noncompliant\n        Dim ctor9_1 = New DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) ' Compliant\n        Dim ctor9_2 = New DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Local) ' Compliant\n        Dim ctor9_3 = New DateTime(year:=1970, minute:=0, month:=1, day:=1, hour:=0, millisecond:=0, second:=0, kind:=DateTimeKind.Utc) ' Noncompliant\n        Dim ctor9_4 = New DateTime(year:=1970, minute:=0, month:=1, day:=1, hour:=0, millisecond:=0, second:=0, kind:=kind) ' Compliant\n\n        ' year, month, day, hour, minute, second, millisecond, calendar and DateTimeKind value\n        Dim ctor10_0 = New DateTime(1970, 1, 1, 0, 0, 0, 0, New GregorianCalendar(), DateTimeKind.Utc) ' Noncompliant\n        Dim ctor10_1 = New DateTime(1970, 1, 1, 0, 0, 0, 0, New GregorianCalendar(), DateTimeKind.Local) ' Compliant\n        Dim ctor10_2 = New DateTime(1970, 1, 1, 0, 0, 0, 0, New ChineseLunisolarCalendar(), DateTimeKind.Utc) ' Compliant\n        Dim ctor10_3 = New DateTime(year:=1970, minute:=0, month:=1, day:=1, hour:=0, calendar:=New GregorianCalendar(), millisecond:=0, second:=0, kind:=DateTimeKind.Utc) ' Noncompliant\n        Dim ctor10_4 = New DateTime(year:=1970, minute:=0, month:=1, day:=1, hour:=0, calendar:=New GregorianCalendar(), millisecond:=0, second:=second, kind:=DateTimeKind.Utc) ' Compliant\n\n        ' year, month, day, hour, minute, second, millisecond and microsecond\n        Dim ctor11_0 = New DateTime(1970, 1, 1, 0, 0, 0, 0, 0) ' Noncompliant\n        Dim ctor11_1 = New DateTime(1970, 1, 1, 0, 0, 0, 0, 1) ' Compliant\n        Dim ctor11_2 = New DateTime(year:=1970, minute:=0, month:=1, day:=1, hour:=0, millisecond:=0, second:=0, microsecond:=0) ' Noncompliant\n        Dim ctor11_3 = New DateTime(year:=1970, microsecond:=0, minute:=minute, month:=1, hour:=0, day:=1, millisecond:=millisecond, second:=0) ' Compliant\n\n        ' year, month, day, hour, minute, second, millisecond, microsecond and calendar\n        Dim ctor12_0 = New DateTime(1970, 1, 1, 0, 0, 0, 0, 0, New GregorianCalendar()) ' Noncompliant\n        Dim ctor12_1 = New DateTime(1970, 1, 1, 0, 0, 0, 0, 1, New GregorianCalendar()) ' Compliant\n        Dim ctor12_2 = New DateTime(1970, 1, 1, 0, 0, 0, 0, 0, New ChineseLunisolarCalendar()) ' Compliant\n        Dim ctor12_3 = New DateTime(year:=1970, minute:=0, month:=1, day:=1, hour:=0, calendar:=New GregorianCalendar(), millisecond:=0, second:=0, microsecond:=0) ' Noncompliant\n        Dim ctor12_4 = New DateTime(year:=1970, minute:=minute, month:=1, day:=1, hour:=0, calendar:=New GregorianCalendar(), millisecond:=0, second:=0, microsecond:=0) ' Compliant\n\n        ' year, month, day, hour, minute, second, millisecond, microsecond and DateTimeKind value\n        Dim ctor13_0 = New DateTime(1970, 1, 1, 0, 0, 0, 0, 0, DateTimeKind.Utc) ' Noncompliant\n        Dim ctor13_1 = New DateTime(1970, 1, 1, 0, 0, 0, 0, 1, DateTimeKind.Utc) ' Compliant\n        Dim ctor13_2 = New DateTime(1970, 1, 1, 0, 0, 0, 0, 0, DateTimeKind.Unspecified) ' Compliant\n        Dim ctor13_3 = New DateTime(1970, 1, 1, 0, 0, 0, 0, 0, DateTimeKind.Local) ' Compliant\n        Dim ctor13_4 = New DateTime(year:=1970, minute:=0, month:=1, day:=1, hour:=0, kind:=DateTimeKind.Utc, millisecond:=0, second:=0, microsecond:=0) ' Noncompliant\n        Dim ctor13_5 = New DateTime(year:=1970, minute:=minute, month:=1, day:=1, hour:=0, kind:=DateTimeKind.Utc, millisecond:=0, second:=0, microsecond:=0) ' Compliant\n\n        ' year, month, day, hour, minute, second, millisecond, microsecond calendar and DateTimeKind value\n        Dim ctor14_0 = New DateTime(1970, 1, 1, 0, 0, 0, 0, 0, New GregorianCalendar(), DateTimeKind.Utc) ' Noncompliant\n        Dim ctor14_1 = New DateTime(1970, 1, 1, 0, 0, 0, 0, 1, New GregorianCalendar(), DateTimeKind.Utc) ' Compliant\n        Dim ctor14_2 = New DateTime(1970, 1, 1, 0, 0, 0, 0, 0, New GregorianCalendar(), DateTimeKind.Unspecified) ' Compliant\n        Dim ctor14_3 = New DateTime(1970, 1, 1, 0, 0, 0, 0, 0, New ChineseLunisolarCalendar(), DateTimeKind.Utc) ' Compliant\n        Dim ctor14_4 = New DateTime(year:=1970, minute:=0, month:=1, day:=1, hour:=0, kind:=DateTimeKind.Utc, millisecond:=0, second:=0, microsecond:=0, calendar:=New GregorianCalendar()) ' Noncompliant\n        Dim ctor14_5 = New DateTime(year:=1970, minute:=minute, month:=1, day:=1, hour:=0, kind:=DateTimeKind.Utc, millisecond:=0, second:=0, microsecond:=0, calendar:=calendar) ' Compliant\n    End Sub\n\n    Private Sub DateTimeOffsetConstructors(ByVal timeSpan As TimeSpan, ByVal dateTime As Date, ByVal ticks As Integer, ByVal year As Integer, ByVal month As Integer, ByVal day As Integer, ByVal hour As Integer, ByVal minute As Integer, ByVal second As Integer, ByVal millisecond As Integer, ByVal microsecond As Integer, ByVal calendar As Calendar, ByVal kind As DateTimeKind)\n        ' default date\n        Dim ctor0_0 = New DateTimeOffset() ' Compliant\n\n        ' datetime\n        Dim ctor1_0 = New DateTimeOffset(New DateTime()) ' Compliant\n        Dim ctor1_1 = New DateTimeOffset(dateTime) ' Compliant\n        Dim ctor1_2 = New DateTimeOffset(New DateTime(1970, 1, 1)) ' Noncompliant\n\n        ' datetime and timespan\n        Dim ctor2_0 = New DateTimeOffset(New DateTime(), TimeSpan.Zero) ' Compliant\n        Dim ctor2_1 = New DateTimeOffset(New DateTime(), timeSpan) ' Compliant\n        Dim ctor2_2 = New DateTimeOffset(New DateTime(1970, 1, 1), TimeSpan.Zero) ' Noncompliant\n\n        ' year, month, day, hour, minute, second, millisecond, offset and calendar\n        Dim ctor3_0 = New DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, calendar, timeSpan) ' Compliant\n        Dim ctor3_1 = New DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, New GregorianCalendar(), TimeSpan.Zero) ' Noncompliant\n        Dim ctor3_2 = New DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, New GregorianCalendar(), New TimeSpan(0)) ' Noncompliant\n        Dim ctor3_3 = New DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, New GregorianCalendar(), New TimeSpan(1)) ' Compliant\n        Dim ctor3_4 = New DateTimeOffset(hour:=0, month:=1, day:=1, year:=1970, minute:=0, second:=0, millisecond:=0, calendar:=New GregorianCalendar(), offset:=TimeSpan.Zero) ' Noncompliant\n        Dim ctor3_5 = New DateTimeOffset(hour:=0, month:=1, day:=1, year:=1970, minute:=0, second:=0, millisecond:=0, calendar:=New GregorianCalendar(), offset:=New TimeSpan(0)) ' Noncompliant\n        Dim ctor3_6 = New DateTimeOffset(hour:=0, month:=1, day:=1, year:=1970, minute:=0, second:=0, millisecond:=0, calendar:=New GregorianCalendar(), offset:=New TimeSpan(2)) ' Compliant\n        Dim ctor3_7 = New DateTimeOffset(hour:=0, month:=1, day:=1, year:=1970, minute:=0, second:=0, millisecond:=0, calendar:=calendar, offset:=New TimeSpan(0)) ' Compliant\n\n        ' year, month, day, hour, minute, second, millisecond, microsecond, offset and calendar\n        Dim ctor4_0 = New DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, 0, calendar, timeSpan) ' Compliant\n        Dim ctor4_1 = New DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, 0, New GregorianCalendar(), TimeSpan.Zero) ' Noncompliant\n        Dim ctor4_2 = New DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, 0, New GregorianCalendar(), New TimeSpan(0)) ' Noncompliant\n        Dim ctor4_3 = New DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, 0, New GregorianCalendar(), New TimeSpan(1)) ' Compliant\n        Dim ctor4_4 = New DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, 1, New GregorianCalendar(), New TimeSpan(0)) ' Compliant\n        Dim ctor4_5 = New DateTimeOffset(hour:=0, month:=1, day:=1, year:=1970, minute:=0, second:=0, microsecond:=0, millisecond:=0, calendar:=New GregorianCalendar(), offset:=TimeSpan.Zero) ' Noncompliant\n        Dim ctor4_6 = New DateTimeOffset(hour:=0, month:=1, day:=1, year:=1970, minute:=0, second:=0, microsecond:=0, millisecond:=0, calendar:=New GregorianCalendar(), offset:=New TimeSpan(0)) ' Noncompliant\n        Dim ctor4_7 = New DateTimeOffset(hour:=0, month:=1, day:=1, year:=1970, minute:=0, second:=0, microsecond:=0, millisecond:=0, calendar:=New GregorianCalendar(), offset:=New TimeSpan(2)) ' Compliant\n        Dim ctor4_8 = New DateTimeOffset(hour:=0, month:=1, day:=1, year:=1970, minute:=0, second:=0, microsecond:=0, millisecond:=0, calendar:=calendar, offset:=New TimeSpan(0)) ' Compliant\n        Dim ctor4_9 = New DateTimeOffset(hour:=0, month:=1, day:=1, year:=1970, minute:=0, second:=0, microsecond:=1, millisecond:=0, calendar:=New GregorianCalendar(), offset:=New TimeSpan(0)) ' Compliant\n\n        ' year, month, day, hour, minute, second and offset\n        Dim ctor5_0 = New DateTimeOffset(1970, 1, 1, 0, 0, 0, New TimeSpan(0)) ' Noncompliant\n        Dim ctor5_1 = New DateTimeOffset(1970, 1, 1, 0, 0, 0, New TimeSpan(1)) ' Compliant\n        Dim ctor5_2 = New DateTimeOffset(1970, 1, 1, 0, 0, 0, timeSpan) ' Compliant\n        Dim ctor5_3 = New DateTimeOffset(1970, 1, 1, 0, 0, 0, timeSpan) ' Compliant\n        Dim ctor5_4 = New DateTimeOffset(1970, 1, 1, 0, 0, 2, New TimeSpan(0)) ' Compliant\n        Dim ctor5_5 = New DateTimeOffset(year:=1970, minute:=0, month:=1, day:=1, hour:=0, second:=0, offset:=New TimeSpan(0)) ' Noncompliant\n\n        ' year, month, day, hour, minute, second, millisecond and offset\n        Dim ctor6_0 = New DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, New TimeSpan(0)) ' Noncompliant\n        Dim ctor6_1 = New DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, TimeSpan.Zero) ' Noncompliant\n        Dim ctor6_2 = New DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, New TimeSpan(2, 14, 18)) ' Compliant\n        Dim ctor6_3 = New DateTimeOffset(1970, 1, 1, 0, 1, 0, 0, TimeSpan.Zero) ' Compliant\n        Dim ctor6_4 = New DateTimeOffset(year:=1970, minute:=0, month:=1, day:=1, hour:=0, millisecond:=0, second:=0, offset:=New TimeSpan(0)) ' Noncompliant\n\n        ' year, month, day, hour, minute, second, millisecond and offset\n        Dim ctor7_0 = New DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, 0, New TimeSpan(0)) ' Noncompliant\n        Dim ctor7_1 = New DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, 0, New TimeSpan(2, 14, 18)) ' Compliant\n        Dim ctor7_2 = New DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, 0, TimeSpan.Zero) ' Noncompliant\n        Dim ctor7_3 = New DateTimeOffset(1970, 1, 1, 0, 1, 0, 0, 0, TimeSpan.Zero) ' Compliant\n        Dim ctor7_4 = New DateTimeOffset(year:=1970, minute:=0, microsecond:=0, month:=1, day:=1, hour:=0, millisecond:=0, second:=0, offset:=New TimeSpan(0)) ' Noncompliant\n    End Sub\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseUriInsteadOfString.Latest.Partial.cs",
    "content": "﻿using System;\n\nnamespace CSharp13\n{\n    partial class S3996\n    {\n        partial string Url { get; set; } // Noncompliant {{Change the 'Url' property type to 'System.Uri'.}}\n//              ^^^^^^\n        partial string url // Noncompliant {{Change the 'url' property type to 'System.Uri'.}}\n//              ^^^^^^\n        {\n            get;\n            set;\n        }\n\n        partial string FooUrlBar { get; set; } // Noncompliant {{Change the 'FooUrlBar' property type to 'System.Uri'.}}\n        partial int ThisIsAnUrlProperty { get; set; } // Compliant\n\n        // Urn\n        partial string Urn { get; set; } // Noncompliant {{Change the 'Urn' property type to 'System.Uri'.}}\n//              ^^^^^^\n        partial string FooUrnBar { get; set; } // Noncompliant {{Change the 'FooUrnBar' property type to 'System.Uri'.}}\n\n        // Uri\n        partial string Uri { get; set; } // Noncompliant {{Change the 'Uri' property type to 'System.Uri'.}}\n//              ^^^^^^\n        partial string FooUriBar { get; set; } // Noncompliant {{Change the 'FooUriBar' property type to 'System.Uri'.}}\n\n        partial string Urn2 { get; set; } // Noncompliant\n\n        // Test there are no false positives\n        partial string TurnOff { get; set; } // Compliant\n        partial string Urinal { get; set; } // Compliant\n        partial string Hourly { get; set; } // Compliant\n        partial string urifoo { get; set; } // Compliant\n        partial string urlfoo { get; set; } // Compliant\n        partial string urnfoo { get; set; } // Compliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseUriInsteadOfString.Latest.cs",
    "content": "﻿using System;\n\nnamespace CSharp9\n{\n    public record S3994\n    {\n        public S3994(string uri) { }            // Noncompliant {{Either change this parameter type to 'System.Uri' or provide an overload which takes a 'System.Uri' parameter.}}\n\n        public S3994(string uri, bool blah) { } // Noncompliant {{Either change this parameter type to 'System.Uri' or provide an overload which takes a 'System.Uri' parameter.}}\n\n        public virtual string Url { get; set; } // Noncompliant {{Change the 'Url' property type to 'System.Uri'.}}\n//                     ^^^^^^\n    }\n\n    public record WithParams(string uri) // Noncompliant {{Change the 'uri' property type to 'System.Uri'.}}\n//                           ^^^^^^^^^^\n    {\n        public WithParams(string uri, bool somethingElse) : this(uri) { } // Noncompliant {{Either change this parameter type to 'System.Uri' or provide an overload which takes a 'System.Uri' parameter.}}\n    }\n\n    public record WithTwoStringParams(string uri, bool condition, string anotherUri);\n    //                                ^^^^^^^^^^{{Change the 'uri' property type to 'System.Uri'.}}\n    //                                                            ^^^^^^^^^^^^^^^^^@-1{{Change the 'anotherUri' property type to 'System.Uri'.}}\n}\nnamespace CSharp10\n{\n    public record struct Foo\n    {\n        public Foo(string uri) { }\n\n        public Foo(string uri, bool blah) { }   // Noncompliant {{Either change this parameter type to 'System.Uri' or provide an overload which takes a 'System.Uri' parameter.}}\n\n        public Foo(Uri uri) { }                 // Compliant\n    }\n\n    public record struct S3994\n    {\n        public S3994(string uri) { }            // Noncompliant {{Either change this parameter type to 'System.Uri' or provide an overload which takes a 'System.Uri' parameter.}}\n\n        public S3994(string uri, bool blah) { } // Noncompliant {{Either change this parameter type to 'System.Uri' or provide an overload which takes a 'System.Uri' parameter.}}\n    }\n\n    public record struct WithParams(string uri) // Noncompliant {{Change the 'uri' property type to 'System.Uri'.}}\n    {\n        public WithParams(string uri, bool somethingElse) : this(uri) { } // Noncompliant {{Either change this parameter type to 'System.Uri' or provide an overload which takes a 'System.Uri' parameter.}}\n    }\n}\n\nnamespace CSharp11\n{\n    public class Foo\n    {\n        public Foo(string uri) { }\n        public Foo(Uri uri) { }\n\n        public void Method(string uri) => Method(new Uri(uri));\n        public void Method(Uri uri) { }\n\n        public void Test()\n        {\n            new Foo(\"\"\"www.sonarsource.com\"\"\");              // Noncompliant {{Call the overload that takes a 'System.Uri' as an argument instead.}}\n            new Foo(\"\"\"\n            www.sonarsource.com\n            \"\"\");                                        // Noncompliant@-2\n            new Foo($$\"\"\"\n                www.sonarsource{{\n                1 + 1\n                }}.com\n                \"\"\");                                        // Noncompliant@-4\n            Method(\"\"\"www.sonarsource.com\"\"\");               // Noncompliant\n            Method($$\"\"\"www.sonarsource{{1 + 1}}.com\"\"\");    // Noncompliant\n            Method($\"www.sonarsource{                        // Noncompliant\n                    1 + 1}.com\");\n        }\n    }\n}\n\nnamespace CSharp13\n{\n    partial class S3996\n    {\n        partial string Url { get => \"\"; set { } } // Noncompliant {{Change the 'Url' property type to 'System.Uri'.}}\n//              ^^^^^^\n        partial string url { get => \"\"; set { } }// Noncompliant {{Change the 'url' property type to 'System.Uri'.}}\n//              ^^^^^^\n\n        partial string FooUrlBar { get => \"\"; set { } } // Noncompliant {{Change the 'FooUrlBar' property type to 'System.Uri'.}}\n        partial int ThisIsAnUrlProperty { get => 42; set { } } // Compliant\n\n\n        // Urn\n        partial string Urn { get => \"\"; set { } } // Noncompliant {{Change the 'Urn' property type to 'System.Uri'.}}\n//              ^^^^^^\n        partial string FooUrnBar { get => \"\"; set { } } // Noncompliant {{Change the 'FooUrnBar' property type to 'System.Uri'.}}\n\n        // Uri\n        partial string Uri { get => \"\"; set { } } // Noncompliant {{Change the 'Uri' property type to 'System.Uri'.}}\n//              ^^^^^^\n        partial string FooUriBar { get => \"\"; set { } } // Noncompliant {{Change the 'FooUriBar' property type to 'System.Uri'.}}\n\n        partial string Urn2 // Noncompliant\n        {\n            get => \"\";\n            set => throw new NotSupportedException();\n        }\n\n        // Test there are no false positives\n        partial string TurnOff { get => \"\"; set { } } // Compliant\n        partial string Urinal { get => \"\"; set { } } // Compliant\n        partial string Hourly { get => \"\"; set { } } // Compliant\n        partial string urifoo { get => \"\"; set { } } // Compliant\n        partial string urlfoo { get => \"\"; set { } } // Compliant\n        partial string urnfoo { get => \"\"; set { } } // Compliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseUriInsteadOfString.TopLevelStatements.cs",
    "content": "﻿using System;\n\nFoo p = new(\"www.sonarsource.com\");        // Noncompliant\n\nFoo q = new(\"www.sonarsource.com\", false); // Compliant\n\nstring GetUrl(string url) => \"\";           // Compliant - FN\n\npublic record Foo\n{\n    public Foo(string uri) { }\n\n    public Foo(string uri, bool blah) { }   // Noncompliant {{Either change this parameter type to 'System.Uri' or provide an overload which takes a 'System.Uri' parameter.}}\n\n    public Foo(Uri uri) { }                 // Compliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseUriInsteadOfString.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    #region S3996 Property type\n    class S3996_Foo\n    {\n        public virtual string Url { get; set; } // Noncompliant {{Change the 'Url' property type to 'System.Uri'.}}\n//                     ^^^^^^\n    }\n\n    class S3996_Bar : S3996_Foo\n    {\n        public override string Url { get; set; } // Compliant\n    }\n\n    class S3996\n    {\n        string Url { get; set; } // Noncompliant {{Change the 'Url' property type to 'System.Uri'.}}\n//      ^^^^^^\n        string url // Noncompliant {{Change the 'url' property type to 'System.Uri'.}}\n//      ^^^^^^\n        {\n            get;\n            set;\n        }\n\n        string Url2 => \"\"; // Noncompliant {{Change the 'Url2' property type to 'System.Uri'.}}\n//      ^^^^^^\n        string FooUrlBar { get; set; } // Noncompliant {{Change the 'FooUrlBar' property type to 'System.Uri'.}}\n        int ThisIsAnUrlProperty { get; set; } // Compliant\n\n\n        // Urn\n        string Urn { get; set; } // Noncompliant {{Change the 'Urn' property type to 'System.Uri'.}}\n//      ^^^^^^\n        string FooUrnBar{ get; set; } // Noncompliant {{Change the 'FooUrnBar' property type to 'System.Uri'.}}\n\n\n        // Uri\n        string Uri { get; set; } // Noncompliant {{Change the 'Uri' property type to 'System.Uri'.}}\n//      ^^^^^^\n        string FooUriBar{ get; set; } // Noncompliant {{Change the 'FooUriBar' property type to 'System.Uri'.}}\n\n        string Urn2 // Noncompliant\n        {\n            get => \"\";\n            set => throw new NotSupportedException();\n        }\n\n\n        // Test there are no false positives\n        string TurnOff { get; set; } // Compliant\n        string Urinal { get; set; } // Compliant\n        string Hourly { get; set; } // Compliant\n        string urifoo { get; set; } // Compliant\n        string urlfoo { get; set; } // Compliant\n        string urnfoo { get; set; } // Compliant\n    }\n    #endregion\n\n    #region S3995 Method return type\n\n    class S3995_Foo\n    {\n        public virtual string Uri() => \"\"; // Noncompliant {{Change this return type to 'System.Uri'.}}\n//                     ^^^^^^\n    }\n\n    class S3995_Bar : S3995_Foo\n    {\n        public override string Uri() => \"\"; // Compliant\n    }\n\n    class S3995\n    {\n        // Url\n        string AUrlMethod() => \"\"; // Noncompliant {{Change this return type to 'System.Uri'.}}\n        string UrlMethod() => \"\"; // Noncompliant {{Change this return type to 'System.Uri'.}}\n        int ThisIsAnUrlMethod() => 1; // Compliant\n\n\n        // Urn\n        string AUrnMethod() => \"\"; // Noncompliant {{Change this return type to 'System.Uri'.}}\n        string UrnMethod() => \"\"; // Noncompliant {{Change this return type to 'System.Uri'.}}\n\n\n        // Uri\n        string AUriMethod() => \"\"; // Noncompliant {{Change this return type to 'System.Uri'.}}\n        string UriMethod() => \"\"; // Noncompliant {{Change this return type to 'System.Uri'.}}\n\n\n        // Test there are no false positives\n        string Pouring() => \"\"; // Compliant\n        string Hurl() => \"\"; // Compliant\n    }\n    #endregion\n\n    #region S3994 Parameter type or suitable overload available\n\n    class S3994\n    {\n        public S3994(string uri) { } // Compliant\n        public S3994(Uri uri) { } // Compliant\n\n        public S3994(string uri, bool blah) { } // Noncompliant {{Either change this parameter type to 'System.Uri' or provide an overload which takes a 'System.Uri' parameter.}}\n\n        private S3994(string uri, bool blah, bool foo) { } // Noncompliant {{Either change this parameter type to 'System.Uri' or provide an overload which takes a 'System.Uri' parameter.}}\n\n        public string OverloadedMethod(string url) => OverloadedMethod(new Uri(url)); // Compliant\n        public string OverloadedMethod(Uri url) => \"\"; // Compliant\n\n        public string Method(Uri url) => \"\";\n        public string MethodWithExtraParam(string url, bool somevalue) => \"\"; // Noncompliant {{Either change this parameter type to 'System.Uri' or provide an overload which takes a 'System.Uri' parameter.}}\n\n        public string Method2(Uri url) => \"\";\n        public string Method2WithOptionalParam(string url, bool foo = false) => \"\"; // Noncompliant {{Either change this parameter type to 'System.Uri' or provide an overload which takes a 'System.Uri' parameter.}}\n\n        public string Method3(string url) => \"\"; // Noncompliant {{Either change this parameter type to 'System.Uri' or provide an overload which takes a 'System.Uri' parameter.}}\n        public string Method3Generic<T>(T url) => \"\";\n\n        public string Method4Private(string url) => Method4Private(new Uri(url)); // Compliant\n        private string Method4Private(Uri url) => \"\"; // Compliant\n\n        public string ParamTest(string uri) => \"\"; // Noncompliant {{Either change this parameter type to 'System.Uri' or provide an overload which takes a 'System.Uri' parameter.}}\n//                              ^^^^^^\n        public string ParamTest2(int url) => \"\"; // Compliant\n        public string ParamTestOverload(string uriParam) => \"\"; // Noncompliant {{Either change this parameter type to 'System.Uri' or provide an overload which takes a 'System.Uri' parameter.}}\n//                                      ^^^^^^\n        public string ParamTestOverload(int uriParam) => \"\"; // Compliant\n        public string MultipleParams(string uriParam, object urnParam, string urlParam, string andThisIsFine) => \"\";\n//                                   ^^^^^^ Noncompliant {{Either change this parameter type to 'System.Uri' or provide an overload which takes a 'System.Uri' parameter.}}\n//                                                                     ^^^^^^ Noncompliant@-1 {{Either change this parameter type to 'System.Uri' or provide an overload which takes a 'System.Uri' parameter.}}\n    }\n    #endregion\n\n    #region S3997 Call System.Uri overload from method that accepts string url\n\n    class S3997\n    {\n        public string OverloadedMethod(Uri url) => \"\";\n        public string OverloadedMethod(string url) => OverloadedMethod(new Uri(url)); // Compliant\n\n        public string OverloadedMethod2(Uri url) => \"\";\n        public string OverloadedMethod2(string url)\n        {\n            return OverloadedMethod2(new Uri(url)); // Compliant\n        }\n\n        public string OverloadedMethod3(Uri url) => \"\";\n        public string OverloadedMethod3(string url) // Compliant\n        {\n            OverloadedMethod3(new Uri(url));\n            return \"\";\n        }\n\n        public string OverloadedMethod4(Uri url) => \"\";\n        public string OverloadedMethod4(string url) // Noncompliant {{Refactor this method so it invokes the overload accepting a 'System.Uri' parameter.}}\n        {\n            return \"foo\";\n        }\n\n        public string OverloadedMethod5(Uri url) => \"\";\n        public string OverloadedMethod5(string url) => \"\"; // Noncompliant {{Refactor this method so it invokes the overload accepting a 'System.Uri' parameter.}}\n    }\n    #endregion\n\n    #region S4005 Call the overload that accepts System.Uri\n    class S4005\n    {\n        static void Main()\n        {\n            var p = new S3994(\"www.sonarsource.com\");\n//                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant {{Call the overload that takes a 'System.Uri' as an argument instead.}}\n\n            p.OverloadedMethod(\"www.sonarsource.com\");\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Noncompliant {{Call the overload that takes a 'System.Uri' as an argument instead.}}\n\n            p.MethodWithExtraParam(\"www.sonarsource.com\", true); // Compliant\n            p.Method2WithOptionalParam(\"www.sonarsource.com\"); // Compliant\n            p.Method3(\"www.sonarsource.com\"); // Compliant\n            p.Method4Private(\"www.sonarsource.com\"); // Noncompliant {{Call the overload that takes a 'System.Uri' as an argument instead.}}\n\n            Uri result;\n            // Do not raise issues when using Uri class\n            Uri.TryCreate(\"\", UriKind.Absolute, out result); // Compliant\n\n            result = new Uri(\"foo\");\n            result = new Uri(\"foo\", true);\n        }\n    }\n\n    #endregion\n\n    #region Mix of rules\n    class AllRules\n    {\n        string AllUrlWrong(string url, string uri, string urn) => \"\";\n//      ^^^^^^ Noncompliant {{Change this return type to 'System.Uri'.}}\n//                         ^^^^^^ Noncompliant@-1 {{Either change this parameter type to 'System.Uri' or provide an overload which takes a 'System.Uri' parameter.}}\n//                                     ^^^^^^ Noncompliant@-2 {{Either change this parameter type to 'System.Uri' or provide an overload which takes a 'System.Uri' parameter.}}\n//                                                 ^^^^^^ Noncompliant@-3 {{Either change this parameter type to 'System.Uri' or provide an overload which takes a 'System.Uri' parameter.}}\n\n        string GetTheUrl(string url) => \"\";\n//      ^^^^^^ Noncompliant {{Change this return type to 'System.Uri'.}}\n//             ^^^^^^^^^ Noncompliant@-1 {{Refactor this method so it invokes the overload accepting a 'System.Uri' parameter.}}\n\n        string GetTheUrl(Uri url) => \"\";\n//      ^^^^^^ Noncompliant {{Change this return type to 'System.Uri'.}}\n\n    }\n    #endregion\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseValueParameter.Latest.Partial.cs",
    "content": "﻿using System;\nnamespace Tests.Diagnostics\n{\n    public partial class PartialProperty\n    {\n        public partial int Property1 { get => 42; set { count = 42; } }  // Noncompliant\n        public partial int Property2 { get => 42; init { count = 42; } } // Noncompliant\n        private partial int this[int index] { set { count = 42; } }      // Noncompliant\n    }\n}\n\npublic partial class PartialEvent\n{\n    public partial event EventHandler Noncompliant\n    {\n        add { }     // Noncompliant\n        remove { }  // Noncompliant\n    }\n    public partial event EventHandler Compliant { add { backingField += value; } remove { backingField -= value; } }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseValueParameter.Latest.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    interface IFoo\n    {\n        static abstract int Foo1 { get; set; }\n\n        static abstract event EventHandler Bar4;\n    }\n\n    public class Foo : IFoo\n    {\n        public static int Foo1\n        {\n            get { return 42; }\n            set { } // Compliant because interface implementation\n        }\n\n        public static float Bar2\n        {\n            get { return 42; }\n            set { } // Noncompliant\n        }\n\n        public static float[] Bar3\n        {\n            get { return null; }\n            set\n            {\n                if (value is [1, .., 42])\n                {\n\n                }\n            }\n        }\n\n        public static event EventHandler Bar4\n        {\n            add { } // Compliant because interface implementation\n            remove { } // Compliant because interface implementation\n        }\n    }\n\n    record UseValueParameter\n    {\n        int count;\n\n        public int Count\n        {\n            get { return count; }\n            init { count = 3; } // Noncompliant {{Use the 'value' contextual keyword in this property init accessor declaration.}}\n        }\n\n        public int Count2\n        {\n            get { return count; }\n            set  // Noncompliant\n            {\n                void Foo(int value)\n                {\n                    count = value;\n                }\n            }\n        }\n\n        public int Count3\n        {\n            get => 42;\n            set  // Noncompliant\n            {\n                System.Func<int, int> f = value => value;\n            }\n        }\n\n        public string FirstName { get; init; } = \"Foo\";\n\n        public string LastName { get => string.Empty; init { } } // Noncompliant\n\n        public int this[int i]\n        {\n            get => 0;\n            init // Noncompliant\n            {\n                var x = 1;\n            }\n        }\n    }\n\n    public partial class PartialProperty\n    {\n        private int count;\n        public partial int Property1 { get; set; }\n        public partial int Property2 { get; init; }\n        private partial int this[int index] { set; }\n    }\n}\n\npublic class FieldKeyword\n{\n    public int Noncompliant { get { return field; } init { field = 3; } }  // Noncompliant\n    public int Compliant { get { return field; } init { field = value; } }\n\n}\n\npublic partial class PartialEvent\n{\n    public partial event EventHandler Noncompliant;\n    private EventHandler backingField;\n    public partial event EventHandler Compliant;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseValueParameter.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public interface IDrawing\n    {\n        event EventHandler OnDraw;\n    }\n\n    class UseValueParameter : IDrawing\n    {\n        private int count;\n        public int Count\n        {\n            get { return count; }\n            set { count = 3; } // Noncompliant {{Use the 'value' contextual keyword in this property set accessor declaration.}}\n//          ^^^\n        }\n        public int Count2\n        {\n            get { return count; }\n            set { count = value; }\n        }\n        public int Count3\n        {\n            set // Noncompliant\n            {\n                var val = 5;\n                count = val;\n            }\n        }\n        public int Count5\n        {\n            set\n            {\n                throw new Exception();\n            }\n        }\n\n        public int Count4 => count;\n\n        public int this[int i]\n        {\n            get\n            {\n                return 0;\n            }\n            set // Noncompliant\n            {\n                var x = 1;\n            }\n        }\n\n        event EventHandler PreDrawEvent;\n\n        event EventHandler IDrawing.OnDraw\n        {\n            add // Noncompliant {{Use the 'value' contextual keyword in this event accessor declaration.}}\n            {\n                lock (PreDrawEvent)\n                {\n                }\n            }\n            remove\n            {\n                lock (PreDrawEvent)\n                {\n                    PreDrawEvent -= value;\n                }\n            }\n        }\n    }\n\n    interface IFoo\n    {\n        int Foo1 { get; set; }\n\n        event EventHandler Bar3;\n    }\n\n    public class Foo : IFoo\n    {\n        public virtual int Foo1\n        {\n            get { return 42; }\n            set { } // Compliant because interface implementation\n        }\n\n        public virtual float Bar2\n        {\n            get { return 42; }\n            set { } // Noncompliant\n        }\n\n        public virtual event EventHandler Bar3\n        {\n            add { } // Compliant because interface implementation\n            remove { } // Compliant because interface implementation\n        }\n    }\n\n    public class Bar : Foo\n    {\n        public override int Foo1\n        {\n            get { return 42; }\n            set { } // Compliant because interface implementation\n        }\n\n        public override float Bar2\n        {\n            get { return 42; }\n            set { } // Noncompliant\n        }\n\n        public override event EventHandler Bar3\n        {\n            add { } // Compliant because interface implementation\n            remove { } // Compliant because interface implementation\n        }\n    }\n\n    // implement interface using arrow syntax\n    public class Baz : IFoo\n    {\n        private int foo1;\n\n        public int Foo1\n        {\n            get => 42;\n            set => foo1 = 0; // Noncompliant\n        }\n\n        public event EventHandler Bar3\n        {\n            add => throw new Exception();\n            remove => throw new Exception();\n        }\n    }\n\n    public class NewSyntax\n    {\n        public int ReadonlyGetter { get; }\n\n        public int ArrowedProperty => 1;\n\n        private int field;\n        public int ArrowedAccessors\n        {\n            get => field;\n            set => field = value;\n        }\n\n        private string id;\n\n        public string Id\n        {\n            get => null;\n            set => id = \"\"; // Noncompliant\n        }\n\n        public int A\n        {\n            set => throw new Exception();\n        }\n\n        public event EventHandler E\n        {\n            add => throw new Exception();\n            remove => throw new Exception();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseWhereBeforeOrderBy.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\n\nstatic class Program\n{\n    static List<int> list = new List<int>();\n    static void Main() { }\n\n    static void SimpleCase_OrderBy()\n    {\n        list.OrderBy(x => x).Where(x => true);\n        //                   ^^^^^ {{\"Where\" should be used before \"OrderBy\"}}\n        //   ^^^^^^^ Secondary@-1 {{This \"OrderBy\" precedes a \"Where\" - you should change the order.}}\n\n        list.OrderBy(x => x)?.Where(x => true);\n        //                    ^^^^^ {{\"Where\" should be used before \"OrderBy\"}}\n        //   ^^^^^^^ Secondary@-1\n\n        list?.OrderBy(x => x).Where(x => true);\n        //                    ^^^^^ {{\"Where\" should be used before \"OrderBy\"}}\n        //    ^^^^^^^ Secondary@-1\n\n        list?.OrderBy(x => x)?.Where(x => true);\n        //                     ^^^^^ {{\"Where\" should be used before \"OrderBy\"}}\n        //    ^^^^^^^ Secondary@-1\n    }\n\n    static void SimpleCase_OrderByDescending()\n    {\n        list.OrderByDescending(x => x).Where(x => true);\n        //                             ^^^^^ {{\"Where\" should be used before \"OrderByDescending\"}}\n        //   ^^^^^^^^^^^^^^^^^ Secondary@-1 {{This \"OrderByDescending\" precedes a \"Where\" - you should change the order.}}\n\n        list.OrderByDescending(x => x)?.Where(x => true);\n        //                              ^^^^^ {{\"Where\" should be used before \"OrderByDescending\"}}\n        //   ^^^^^^^^^^^^^^^^^ Secondary@-1\n\n        list?.OrderByDescending(x => x).Where(x => true);\n        //                              ^^^^^ {{\"Where\" should be used before \"OrderByDescending\"}}\n        //    ^^^^^^^^^^^^^^^^^ Secondary@-1\n\n        list?.OrderByDescending(x => x)?.Where(x => true);\n        //                               ^^^^^ {{\"Where\" should be used before \"OrderByDescending\"}}\n        //    ^^^^^^^^^^^^^^^^^ Secondary@-1\n    }\n\n    static void OrderWhereWhere()\n    {\n        list.OrderBy(x => x).Where(x => true).Where(x => false);\n        //                   ^^^^^ {{\"Where\" should be used before \"OrderBy\"}}\n        //   ^^^^^^^ Secondary@-1\n\n        list.OrderBy(x => x)?.Where(x => true)?.Where(x => false);\n        //                    ^^^^^ {{\"Where\" should be used before \"OrderBy\"}}\n        //   ^^^^^^^ Secondary@-1\n\n        list?.OrderBy(x => x).Where(x => true).Where(x => false);\n        //                    ^^^^^ {{\"Where\" should be used before \"OrderBy\"}}\n        //    ^^^^^^^ Secondary@-1\n\n        list?.OrderBy(x => x)?.Where(x => true)?.Where(x => false);\n        //                     ^^^^^ {{\"Where\" should be used before \"OrderBy\"}}\n        //    ^^^^^^^ Secondary@-1\n    }\n\n    static void OrderWhereOrderWhere()\n    {\n        list.OrderBy(x => x).Where(x => true)\n        //                   ^^^^^ {{\"Where\" should be used before \"OrderBy\"}}\n        //   ^^^^^^^ Secondary@-1\n            .OrderBy(x => x).Where(x => true);\n        //                   ^^^^^ {{\"Where\" should be used before \"OrderBy\"}}\n        //   ^^^^^^^ Secondary@-1\n\n        list?.OrderBy(x => x)?.Where(x => true)?\n        //                     ^^^^^ {{\"Where\" should be used before \"OrderBy\"}}\n        //    ^^^^^^^ Secondary@-1\n            .OrderBy(x => x)?.Where(x => true);\n        //                    ^^^^^ {{\"Where\" should be used before \"OrderBy\"}}\n        //   ^^^^^^^ Secondary@-1\n    }\n\n    static void CompliantCases()\n    {\n        list.OrderBy(x => x).Select(x => x).Where(x => true); // Compliant\n        var ordered = list.OrderBy(x => x);\n        ordered.Where(x => true); // Compliant\n\n        var fake = new Fake<int>();\n        fake.OrderBy(x => x).Where(x => true); // Compliant\n\n        var semiFake = new SemiFake<int>();\n        // \"Where\" is the LINQ version, \"OrderBy\" is custom extension\n        semiFake.OrderBy(x => x).Where(x => true); // Compliant\n    }\n\n    static void CustomImplementation()\n    {\n        var mine = new MyEnumerable<int>();\n\n        mine.OrderBy(x => x).Where(x => true);\n        //                   ^^^^^ {{\"Where\" should be used before \"OrderBy\"}}\n        //   ^^^^^^^ Secondary@-1\n\n        mine?.OrderByDescending(x => x)?.Where(x => true);\n        //                               ^^^^^ {{\"Where\" should be used before \"OrderByDescending\"}}\n        //    ^^^^^^^^^^^^^^^^^ Secondary@-1\n    }\n\n}\n\npublic class MyEnumerable<T> : IEnumerable<T>\n{\n    public IEnumerator<T> GetEnumerator() => null;\n    IEnumerator IEnumerable.GetEnumerator() => null;\n}\n\npublic class Fake<T> { }\n\npublic class SemiFake<T> : IEnumerable<T>\n{\n    public IEnumerator<T> GetEnumerator() => null;\n    IEnumerator IEnumerable.GetEnumerator() => null;\n}\n\nstatic class FakeExtensions\n{\n    public static Fake<TSource> Where<TSource>(this Fake<TSource> source, Func<TSource, bool> predicate) => source;\n    public static Fake<TSource> OrderBy<TSource, TKey>(this Fake<TSource> source, Func<TSource, TKey> keySelector) => source;\n    public static SemiFake<TSource> OrderBy<TSource, TKey>(this SemiFake<TSource> source, Func<TSource, TKey> keySelector) => source;\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseWhereBeforeOrderBy.vb",
    "content": "﻿Imports System\nImports System.Collections\nImports System.Collections.Generic\nImports System.Linq\n\nModule Program\n    Private list As New List(Of Integer)\n\n    Sub Main()\n    End Sub\n\n    Private Sub SimpleCase_OrderBy()\n        list.OrderBy(Function(x) x).Where(Function(x) True)\n        '                           ^^^^^ {{\"Where\" should be used before \"OrderBy\"}}\n        '    ^^^^^^^ Secondary@-1 {{This \"OrderBy\" precedes a \"Where\" - you should change the order.}}\n\n        list.OrderBy(Function(x) x)?.Where(Function(x) True)\n        '                            ^^^^^ {{\"Where\" should be used before \"OrderBy\"}}\n        '    ^^^^^^^ Secondary@-1\n\n        list?.OrderBy(Function(x) x).Where(Function(x) True)\n        '                            ^^^^^ {{\"Where\" should be used before \"OrderBy\"}}\n        '     ^^^^^^^ Secondary@-1\n\n        list?.OrderBy(Function(x) x)?.Where(Function(x) True)\n        '                             ^^^^^ {{\"Where\" should be used before \"OrderBy\"}}\n        '     ^^^^^^^ Secondary@-1\n    End Sub\n\n    Private Sub SimpleCase_OrderByDescending()\n        list.OrderByDescending(Function(x) x).Where(Function(x) True)\n        '                                     ^^^^^ {{\"Where\" should be used before \"OrderByDescending\"}}\n        '    ^^^^^^^^^^^^^^^^^ Secondary@-1 {{This \"OrderByDescending\" precedes a \"Where\" - you should change the order.}}\n\n        list.OrderByDescending(Function(x) x)?.Where(Function(x) True)\n        '                                      ^^^^^ {{\"Where\" should be used before \"OrderByDescending\"}}\n        '    ^^^^^^^^^^^^^^^^^ Secondary@-1\n\n        list?.OrderByDescending(Function(x) x).Where(Function(x) True)\n        '                                      ^^^^^ {{\"Where\" should be used before \"OrderByDescending\"}}\n        '     ^^^^^^^^^^^^^^^^^ Secondary@-1\n\n        list?.OrderByDescending(Function(x) x)?.Where(Function(x) True)\n        '                                       ^^^^^ {{\"Where\" should be used before \"OrderByDescending\"}}\n        '     ^^^^^^^^^^^^^^^^^ Secondary@-1\n    End Sub\n\n    Private Sub OrderWhereWhere()\n        list.OrderBy(Function(x) x).Where(Function(x) True).Where(Function(x) False)\n        '                           ^^^^^ {{\"Where\" should be used before \"OrderBy\"}}\n        '    ^^^^^^^ Secondary@-1\n\n        list.OrderBy(Function(x) x)?.Where(Function(x) True)?.Where(Function(x) False)\n        '                            ^^^^^ {{\"Where\" should be used before \"OrderBy\"}}\n        '    ^^^^^^^ Secondary@-1\n\n        list?.OrderBy(Function(x) x).Where(Function(x) True).Where(Function(x) False)\n        '                            ^^^^^ {{\"Where\" should be used before \"OrderBy\"}}\n        '     ^^^^^^^ Secondary@-1\n\n        list?.OrderBy(Function(x) x)?.Where(Function(x) True)?.Where(Function(x) False)\n        '                             ^^^^^ {{\"Where\" should be used before \"OrderBy\"}}\n        '     ^^^^^^^ Secondary@-1\n    End Sub\n\n    Private Sub CompliantCases()\n        list.OrderBy(Function(x) x).[Select](Function(x) x).Where(Function(x) True) ' Compliant\n        Dim ordered = list.OrderBy(Function(x) x)\n        ordered.Where(Function(x) True) ' Compliant\n\n        Dim fake = New Fake(Of Integer)()\n        fake.OrderBy(Function(x) x).Where(Function(x) True) ' Compliant\n\n        Dim semiFake = New SemiFake(Of Integer)()\n        ' \"Where\" is the LINQ version, \"OrderBy\" is custom extension\n        semiFake.OrderBy(Function(x) x).Where(Function(x) True) ' Compliant\n    End Sub\n\n    Private Sub CustomImplementation()\n        Dim mine = New MyEnumerable(Of Integer)()\n\n        mine.OrderBy(Function(x) x).Where(Function(x) True)\n        '                           ^^^^^ {{\"Where\" should be used before \"OrderBy\"}}\n        '    ^^^^^^^ Secondary@-1\n\n        mine?.OrderByDescending(Function(x) x)?.Where(Function(x) True)\n        '                                       ^^^^^ {{\"Where\" should be used before \"OrderByDescending\"}}\n        '     ^^^^^^^^^^^^^^^^^ Secondary@-1\n    End Sub\n\nEnd Module\n\nPublic Class MyEnumerable(Of T)\n    Implements IEnumerable(Of T)\n\n    Public Function GetEnumerator() As IEnumerator(Of T) Implements IEnumerable(Of T).GetEnumerator\n        Return Nothing\n    End Function\n\n    Private Function IEnumerable_GetEnumerator() As IEnumerator Implements IEnumerable.GetEnumerator\n        Return Nothing\n    End Function\nEnd Class\n\nPublic Class Fake(Of T)\nEnd Class\n\nPublic Class SemiFake(Of T)\n    Implements IEnumerable(Of T)\n\n    Public Function GetEnumerator() As IEnumerator(Of T) Implements IEnumerable(Of T).GetEnumerator\n        Return Nothing\n    End Function\n\n    Private Function IEnumerable_GetEnumerator() As IEnumerator Implements IEnumerable.GetEnumerator\n        Return Nothing\n    End Function\nEnd Class\n\nModule FakeExtensions\n    <System.Runtime.CompilerServices.Extension()>\n    Public Function Where(Of TSource)(ByVal source As Fake(Of TSource), ByVal predicate As Func(Of TSource, Boolean)) As Fake(Of TSource)\n        Return source\n    End Function\n\n    <System.Runtime.CompilerServices.Extension()>\n    Public Function OrderBy(Of TSource, TKey)(ByVal source As Fake(Of TSource), ByVal keySelector As Func(Of TSource, TKey)) As Fake(Of TSource)\n        Return source\n    End Function\n\n    <System.Runtime.CompilerServices.Extension()>\n    Public Function OrderBy(Of TSource, TKey)(ByVal source As SemiFake(Of TSource), ByVal keySelector As Func(Of TSource, TKey)) As SemiFake(Of TSource)\n        Return source\n    End Function\nEnd Module\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseWhileLoopInstead.cs",
    "content": "﻿using System;\n\nnamespace Tests.Diagnostics\n{\n    public class Program\n    {\n        public Program()\n        {\n            for (int l = 0; l < 10; l++)\n            {\n            }\n\n            for (char c = 'a'; c <= 'z'; c++)\n            {\n            }\n\n            int i;\n            int j = 10;\n            for (i = 0, Console.WriteLine(\"Start: {0}\", i); i < j; i++, j--, Console.WriteLine(\"i={0}, j={1}\", i, j))\n            {\n                // Body of the loop.\n            }\n\n            for (int k = 0; k < 10;) // Compliant - only the incrementor is missing\n            {\n                k++;\n            }\n\n            int z = 42;\n            for (; z < 50; z++) // Compliant - only the declaration is missing\n            {\n            }\n\n            var x = 5;\n            for (; x < 10;) // Noncompliant {{Replace this 'for' loop with a 'while' loop.}}\n//          ^^^\n            {\n            }\n\n            for (; ; ) // Noncompliant\n            {\n\n            }\n\n            for (i = 0; i < 10;) // Noncompliant\n            {\n\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/UseWithStatement.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.Linq\nImports System.Text\nImports System.Threading.Tasks\n\nNamespace Tests.TestCases\n    Class UseWithStatement\n\n        Property X As Integer\n\n        Sub Main()\n            Dim product As Product\n            product.X.Name = \"\"           ' Noncompliant {{Wrap this and the following 3 statements that use 'product.X' in a 'With' statement.}}\n            product.X.RetailPrice += 0\n            X = product.X.WholesalePrice\n            product.X.ToString()\n\n            Int32.Parse(\"1\")\n            Int32.Parse(\"2\")\n\n\n            Me.X.ToString() ' Compliant\n            If Not Me.X.ToString() = \"\" Then Exit Sub\n\n            Me.X.ToString() ' Compliant\n\n            Me.ToString() ' Compliant, single element access\n            Me.ToString()\n            Me.ToString()\n\n            x.ToString ' Compliant, single element access\n            x.ToString\n            x.ToString\n\n        End Sub\n    End Class\n\n    Class Product\n        Public Property X As Product\n        Public Property Name As String\n        Public Property RetailPrice As Integer\n        Public Property WholesalePrice As Integer\n    End Class\nEnd Namespace\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/CopyPasteTokenAnalyzer/Duplicated.Csharp10.cs",
    "content": "﻿global using System;\nglobal using System.IO;\n\npublic class Sample\n{\n    public void Aaa()\n    {\n        var i = 42;\n        var s = \"Lorem\";\n    }\n\n    public void Bbb()\n    {\n        var i = 42;\n        var s = \"Lorem\";\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/CopyPasteTokenAnalyzer/Duplicated.cs",
    "content": "﻿using System;\nusing System.IO;\n\npublic class Sample\n{\n    public void Aaa()\n    {\n        var i = 42;\n        var s = \"Lorem\";\n    }\n\n    public void Bbb()\n    {\n        var i = 42;\n        var s = \"Lorem\";\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/CopyPasteTokenAnalyzer/DuplicatedDifferentLiterals.cs",
    "content": "﻿public class Sample\n{\n    public void Aaa()\n    {\n        var i = 42;\n        var s = \"Lorem\";\n    }\n\n    public void Bbb()\n    {\n        var i = 1024;\n        var s = \"Ipsum\";\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/CopyPasteTokenAnalyzer/Razor.cshtml",
    "content": "<head>\n    <title>Title</title>\n</head>\n\n@{\n    string message = \"message\";\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/CopyPasteTokenAnalyzer/Razor.razor",
    "content": "@page \"/razor\"\n\n<p>Current count: @currentCount</p>\n\n@code {\n    private int currentCount = 0;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/CopyPasteTokenAnalyzer/Unique.CSharp11.cs",
    "content": "﻿public class Sample\n{\n    public const string Prefix = \"Prefix_\";\n    public const string Suffix = \"_Suffix\";\n    public const string Name = $\"{Prefix}Name{Suffix}\";\n    public const string SingleLineRawString = \"\"\"\"SingleLine\"\"\"\";\n    public const string MultiLineRawString =\n        \"\"\"\"\n        MultiLine\n        \"\"\"\";\n    public const string InterpolatedSingleLineRawString = $\"\"\"\"SingleLine{Prefix}\"\"\"\";\n    public const string InterpolatedMultiLineRawString =\n        $$\"\"\"\"\n        MultiLine{{Suffix}}\n        \"\"\"\";\n\n    public void Aaa()\n    {\n        var x = 42;\n        var interpolatedWithWhitespace = $\"This literal will be $str and there will be another $str between the interpolations: {x} {x}\";\n        var interpolatedVerbatim = $@\"Interpolated Verbatim\";\n        var verbatim = @\"Verbatim\";\n        var UTF8String = \"UTF8 string\"u8;\n        var UTF8SingleLineRawString = \"\"\"\"SingleLine\"\"\"\"u8;\n        var UTF8MultiLineRawString =\n            \"\"\"\"\n        MultiLine\n        \"\"\"\"u8;\n    }\n\n    public void Bbb()\n    {\n        var y = \"value\";\n        var character = 'c';\n\n        (y, var z) =\n            (\"a\",\n             'x');\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/CopyPasteTokenAnalyzer/Unique.CSharp12.cs",
    "content": "﻿class PrimaryConstructor(string a = \"a\", char b = 'b', /* Comment */ double c = 1)\n{\n    void Method()\n    {\n        var lambdaWithDefaultValues = (string x = \"y\",\n                                       char y = 'z', // Comment\n                                       double z = 1) => x;\n        string[] collectionExpressionStr = [\"Hello\",\n                                            \"World\"];\n        char[] collectionExpressionChar = ['a',\n                                           'b'];\n        double[] collectionExpressionDouble = [1, // Comment\n                                               2];\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/CopyPasteTokenAnalyzer/Unique.cs",
    "content": "﻿public class Sample\n{\n    public const string Prefix = \"Prefix_\";\n    public const string Suffix = \"_Suffix\";\n    public const string Name = $\"{Prefix}Name{Suffix}\";\n\n    public void Aaa()\n    {\n        var x = 42;\n        var interpolatedWithWhitespace = $\"This literal will be $str and there will be another $str between the interpolations: {x} {x}\";\n        var interpolatedVerbatim = $@\"Interpolated Verbatim\";\n        var verbatim = @\"Verbatim\";\n    }\n\n    public void Bbb()\n    {\n        var y = \"value\";\n        var character = 'c';\n\n        (y, var z) =\n            (\"a\",\n             'x');\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/CopyPasteTokenAnalyzer/Unique.vb",
    "content": "﻿Public Class Sample\n\n    Public Sub Aaa()\n        Dim x As Integer = 42\n        Dim InterpolatedWithWhitespaceToken As String = $\"This literal should be $str but the whitespace between interpolation will not: {x} {x}\"\n    End Sub\n\n    Public Sub Bbb()\n        Dim a As String = \"value\"\n        Dim b As Integer = 42\n        Dim c As Integer = &H2A\n        Dim d As Integer = &B101010\n        Dim e As Single = 42.42F\n        Dim f As Double = 42.42\n        Dim g As Decimal = 42.42D\n        Dim h As Char = \"x\"c\n    End Sub\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/FileMetadataAnalyzer/Razor.cshtml",
    "content": "<head>\n    <title>Title</title>\n</head>\n\n@{\n    string message = \"message\";\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/FileMetadataAnalyzer/Razor.razor",
    "content": "@page \"/razor\"\n\n<p>Current count: @currentCount</p>\n\n@code {\n    private int currentCount = 0;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/FileMetadataAnalyzer/TEMPORARYGENERATEDFILE_class.cs",
    "content": "﻿using System;\n\nnamespace SomeNamespace\n{\n    class Class_16\n    {\n        static void Method(string[] args)\n        {\n            object obj = null;\n            Console.WriteLine(obj.ToString());\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/FileMetadataAnalyzer/autogenerated_comment.cs",
    "content": "﻿// this is in no way <auto-generated\n\nusing System;\nnamespace SomeNamespace\n{\n    class Class_01\n    {\n        static void Method(string[] args)\n        {\n            object obj = null;\n            Console.WriteLine(obj.ToString());\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/FileMetadataAnalyzer/autogenerated_comment2.cs",
    "content": "﻿// this is <autogenerated\n\nusing System;\n\nnamespace SomeNamespace\n{\n    class Class_02\n    {\n        static void Method(string[] args)\n        {\n            object obj = null;\n            Console.WriteLine(obj.ToString());\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/FileMetadataAnalyzer/class.designer.cs",
    "content": "﻿using System;\n\nnamespace SomeNamespace\n{\n    class Class_03\n    {\n        static void Method(string[] args)\n        {\n            object obj = null;\n            Console.WriteLine(obj.ToString());\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/FileMetadataAnalyzer/class.g.cs",
    "content": "﻿using System;\n\nnamespace SomeNamespace\n{\n    class Class_04\n    {\n        static void Method(string[] args)\n        {\n            object obj = null;\n            Console.WriteLine(obj.ToString());\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/FileMetadataAnalyzer/class.g.something.cs",
    "content": "﻿using System;\n\nnamespace SomeNamespace\n{\n    class Class_05\n    {\n        static void Method(string[] args)\n        {\n            object obj = null;\n            Console.WriteLine(obj.ToString());\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/FileMetadataAnalyzer/class.generated.cs",
    "content": "﻿using System;\n\nnamespace SomeNamespace\n{\n    class Class_06\n    {\n        static void Method(string[] args)\n        {\n            object obj = null;\n            Console.WriteLine(obj.ToString());\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/FileMetadataAnalyzer/class_generated.cs",
    "content": "﻿using System;\n\nnamespace SomeNamespace\n{\n    class Class_07\n    {\n        static void Method(string[] args)\n        {\n            object obj = null;\n            Console.WriteLine(obj.ToString());\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/FileMetadataAnalyzer/compiler_generated.cs",
    "content": "﻿using System;\nusing System.Runtime.CompilerServices;\n\nnamespace SomeNamespace\n{\n    class Class_08\n    {\n        static void Method(string[] args)\n        {\n            object obj = null;\n            Console.WriteLine(obj.ToString());\n        }\n\n        [CompilerGenerated]\n        private void Foo()\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/FileMetadataAnalyzer/compiler_generated_attr.cs",
    "content": "﻿using System;\nusing System.Runtime.CompilerServices;\n\nnamespace SomeNamespace\n{\n    class Class_09\n    {\n        static void Method(string[] args)\n        {\n            object obj = null;\n            Console.WriteLine(obj.ToString());\n        }\n\n        [CompilerGeneratedAttribute]\n        private void Foo()\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/FileMetadataAnalyzer/debugger_non_user_code.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\n\nnamespace SomeNamespace\n{\n    class Class_10\n    {\n        static void Method(string[] args)\n        {\n            object obj = null;\n            Console.WriteLine(obj.ToString());\n        }\n\n        [DebuggerNonUserCode]\n        private void Foo()\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/FileMetadataAnalyzer/debugger_non_user_code_attr.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\n\nnamespace SomeNamespace\n{\n    class Class_11\n    {\n        static void Method(string[] args)\n        {\n            object obj = null;\n            Console.WriteLine(obj.ToString());\n        }\n\n        [DebuggerNonUserCodeAttribute]\n        private void Foo()\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/FileMetadataAnalyzer/generated_code_attr.cs",
    "content": "﻿using System;\nusing System.CodeDom.Compiler;\n\nnamespace SomeNamespace\n{\n    class Class_12\n    {\n        static void Method(string[] args)\n        {\n            object obj = null;\n            Console.WriteLine(obj.ToString());\n        }\n\n        [GeneratedCode(\"foo\", \"bar\")]\n        private void Foo()\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/FileMetadataAnalyzer/generated_code_attr2.cs",
    "content": "﻿using System;\nusing System.CodeDom.Compiler;\n\nnamespace SomeNamespace\n{\n    class Class_13\n    {\n        static void Method(string[] args)\n        {\n            object obj = null;\n            Console.WriteLine(obj.ToString());\n        }\n\n        [GeneratedCodeAttribute(\"foo\", \"bar\")]\n        private void Foo()\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/FileMetadataAnalyzer/generated_code_attr_local_function.cs",
    "content": "﻿using System;\nusing System.CodeDom.Compiler;\n\nnamespace SomeNamespace\n{\n    class Class_With_Local_Function\n    {\n        static void Method(string[] args)\n        {\n            object obj = null;\n            Console.WriteLine(obj.ToString());\n\n            [GeneratedCodeAttribute(\"foo\", \"bar\")]\n            void Foo()\n            {\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/FileMetadataAnalyzer/generated_region.cs",
    "content": "﻿using System;\n\nnamespace SomeNamespace\n{\n    class Class_14\n    {\n        static void Method(string[] args)\n        {\n            object obj = null;\n            Console.WriteLine(obj.ToString());\n            #region this old code slowly degenerated to this state\n            #endregion\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/FileMetadataAnalyzer/generated_region_2.cs",
    "content": "﻿using System;\n\nnamespace SomeNamespace\n{\n    class Class_15\n    {\n        static void Method(string[] args)\n        {\n            object obj = null;\n            Console.WriteLine(obj.ToString());\n            // FN - we don't consider this as generated, although it is\n            #region Windows Form Designer generated code\n            // code\n            #endregion\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/FileMetadataAnalyzer/normal_file.cs",
    "content": "﻿using System;\nnamespace SomeNamespace\n{\n    class Class_01\n    {\n        static void Method(string[] args)\n        {\n            object obj = null;\n            Console.WriteLine(obj.ToString());\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/LogAnalyzer/GeneratedByContent.cs",
    "content": "﻿// This file should be detected as autogenerated based on its content\n// <auto-generated/>\npublic class GeneratedByContent\n{\n    public void DoNothing() { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/LogAnalyzer/GeneratedByContent.vb",
    "content": "﻿' This file should be detected as autogenerated based on its content\n' <auto-generated/>\nPublic Class GeneratedByContent\n\n    Public Sub DoNothing()\n    End Sub\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/LogAnalyzer/GeneratedByName.generated.cs",
    "content": "﻿// This file should be detected as autogenerated based on its name\npublic class GeneratedByName\n{\n    public void DoNothing() { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/LogAnalyzer/GeneratedByName.generated.vb",
    "content": "﻿' This file should be detected as autogenerated based on its name\nPublic Class GeneratedByName\n\n    Public Sub DoNothing()\n    End Sub\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/LogAnalyzer/Generated_cshtml.g.cs",
    "content": "﻿// <auto-generated/>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/LogAnalyzer/Generated_razor.g.cs",
    "content": "﻿// <auto-generated/>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/LogAnalyzer/Normal.cs",
    "content": "﻿public class Normal\n{\n    public void DoNothing() { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/LogAnalyzer/Normal.vb",
    "content": "﻿Public Class Normal\n\n    Public Sub DoNothing()\n    End Sub\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/LogAnalyzer/Second.cs",
    "content": "﻿public class Second\n{\n    public void DoNothing() { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/LogAnalyzer/Second.vb",
    "content": "﻿Public Class Second\n\n    Public Sub DoNothing()\n    End Sub\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/MethodDeclarationsAnalyzer/TestMethodDeclarations.Generated.g.cs",
    "content": "﻿// <auto-generated>\n// This code was generated by a tool.\n// Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.\n// </auto-generated>\n\nnamespace Samples;\n\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\n\n[TestClass]\npublic class SomeGeneratedTests\n{\n    [TestMethod]\n    public void PublicMethod() { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/MethodDeclarationsAnalyzer/TestMethodDeclarations.GlobalNamespace.cs",
    "content": "﻿using Microsoft.VisualStudio.TestTools.UnitTesting;\n\npublic class TestClass\n{\n    [TestMethod]\n    public void TestMethod() { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/MethodDeclarationsAnalyzer/TestMethodDeclarations.GlobalNamespace.vb",
    "content": "﻿Imports Microsoft.VisualStudio.TestTools.UnitTesting\n\nPublic Class TestClass\n    <TestMethod>\n    Public Sub TestMethod()\n    End Sub\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/MethodDeclarationsAnalyzer/TestMethodDeclarations.NoMethods.cs",
    "content": "﻿namespace Samples;\n\npublic class WithoutMethodDeclarations\n{\n    public int Property { get; set; }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/MethodDeclarationsAnalyzer/TestMethodDeclarations.NoMethods.vb",
    "content": "﻿Namespace Samples\n\n    Public Class WithoutMethodDeclarations\n        Public Property Prop As Integer\n    End Class\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/MethodDeclarationsAnalyzer/TestMethodDeclarations.Partial.cs",
    "content": "﻿namespace Samples.CSharp;\n\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\n\npublic partial class PartialClass : BaseClass\n{\n    [TestMethod]\n    public void InSecondFile() { }\n\n    [TestMethod]\n    public partial void PartialMethod() { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/MethodDeclarationsAnalyzer/TestMethodDeclarations.Partial.vb",
    "content": "﻿Imports Microsoft.VisualStudio.TestTools.UnitTesting\n\nNamespace Samples.VB\n\n    Partial Public Class PartialClass\n        <TestMethod>\n        Public Sub InSecondFile()\n        End Sub\n\n        <TestMethod>\n        Private Sub PartialMethod()\n        End Sub\n    End Class\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/MethodDeclarationsAnalyzer/TestMethodDeclarations.cs",
    "content": "﻿namespace Samples.CSharp;\n\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\n\n[TestClass]\npublic class Address\n{\n    [TestMethod]\n    public string GetZipCode() => \"12345\";\n}\n\npublic struct Person\n{\n    [TestMethod]\n    public string GetFullName() => \"John Doe\";\n}\n\n[TestClass]\npublic record class Company\n{\n    [TestMethod]\n    public string GetCompanyName() => \"ACME\";\n}\n\npublic record struct Employee\n{\n    [TestMethod]\n    public string GetEmployeeName() => \"Jane Doe\";\n}\n\npublic enum EnumDeclaration\n{\n    Value1,\n    Value2\n}\n\n[TestClass]\npublic class Visibility\n{\n    [TestMethod]\n    public void PublicMethod() { }\n\n    [TestMethod]\n    protected internal void ProtectedInternalMethod() { }\n\n    [TestMethod]\n    protected void ProtectedMethod() { }\n\n    [TestMethod]\n    internal void InternalMethod() { }\n\n    [TestMethod]\n    private protected void PrivateProtectedMethod() { }\n\n    [TestMethod]\n    private void PrivateMethod() { }\n\n    [TestMethod]\n    void NoAccessModifierMethod() { }\n\n    internal class InternalClass\n    {\n        [TestMethod]\n        public void Method() { }\n    }\n\n    private class PrivateClass\n    {\n        [TestMethod]\n        public void Method() { }\n    }\n}\n\n[TestClass]\nfile class FileClass\n{\n    [TestMethod]\n    public void Method() { }\n}\n\n[TestClass]\nclass NoModifiers\n{\n    [TestMethod]\n    public void Method() { }\n}\n\n[TestClass]\npublic class MultipleMethods\n{\n    [TestMethod]\n    public void Method1() { }\n\n    [TestMethod]\n    public void Method2() { }\n}\n\n[TestClass]\npublic class Overloads\n{\n    [TestMethod]\n    public void Method() { }\n\n    [TestMethod]\n    public void Method(int i) { }\n\n    [TestMethod]\n    public void Method(string s) { }\n\n    [TestMethod]\n    public void Method(int i, string s) { }\n}\n\n[TestClass]\npublic class GenericClass<T>\n{\n    [TestMethod]\n    public void Method() { }\n\n    [TestMethod]\n    public void Method<U>() { }\n}\n\n[TestClass]\npublic class WithGenericMethod\n{\n    [TestMethod]\n    public void Method<T>() { }\n}\n\n[TestClass]\npublic partial class PartialClass : BaseClass\n{\n    [TestMethod]\n    public void InFirstFile() { }\n\n    public partial void PartialMethod(); // Test method attribute is defined in the other file.\n}\n\n[TestClass]\npublic class PropertiesAndIndexers\n{\n    private int[] values;\n\n    public string Property { get; set; }\n\n    public int this[int i]\n    {\n        get => values[i];\n        set => values[i] = value;\n    }\n}\n\n[TestClass]\npublic class LocalFunctions\n{\n    [TestMethod]\n    public void Main()\n    {\n        [TestMethod]\n        void LocalFunction() { }\n    }\n}\n\n[TestClass]\npublic abstract class BaseClass\n{\n    [TestMethod]\n    public void BaseClassMethod() { }\n\n    [TestMethod]\n    public virtual void Method() { }\n}\n\n\npublic class DerivedClass : BaseClass\n{\n    [TestMethod]\n    public override void Method() { }\n}\n\n[TestClass]\npublic class MultipleLevelInheritance : DerivedClass\n{\n    [TestMethod]\n    public void MultipleLevelInheritanceMethod() { }\n}\n\npublic interface IInterfaceWithTestDeclarations\n{\n    [TestMethod]\n    public string GetZipCode();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/MethodDeclarationsAnalyzer/TestMethodDeclarations.vb",
    "content": "﻿Imports Microsoft.VisualStudio.TestTools.UnitTesting\n\nNamespace Samples.VB\n\n    Public Class Address\n        <TestMethod>\n        Public Function GetZipCode() As String\n            Return \"12345\"\n        End Function\n    End Class\n\n    Public Structure Person\n        <TestMethod>\n        Public Function GetFullName() As String\n            Return \"John Doe\"\n        End Function\n    End Structure\n\n    Public Enum EnumDeclaration\n        Value1\n        Value2\n    End Enum\n\n    Public Class Visibility\n        <TestMethod>\n        Public Sub PublicMethod()\n        End Sub\n\n        <TestMethod>\n        Protected Friend Sub ProtectedFriendMethod()\n        End Sub\n\n        <TestMethod>\n        Protected Sub ProtectedMethod()\n        End Sub\n\n        <TestMethod>\n        Friend Sub FriendMethod()\n        End Sub\n\n        <TestMethod>\n        Private Protected Sub PrivateProtectedMethod()\n        End Sub\n\n        <TestMethod>\n        Private Sub PrivateMethod()\n        End Sub\n\n        <TestMethod>\n        Sub NoAccessModifierMethod()\n        End Sub\n\n        Friend Class FriendClass\n            <TestMethod>\n            Public Sub Method()\n            End Sub\n        End Class\n\n        Private Class PrivateClass\n            <TestMethod>\n            Public Sub Method()\n            End Sub\n        End Class\n    End Class\n\n    Class NoModifiers\n        <TestMethod>\n        Public Sub Method()\n        End Sub\n    End Class\n\n    Public Class MultipleMethods\n        <TestMethod>\n        Public Sub Method1()\n        End Sub\n\n        <TestMethod>\n        Public Sub Method2()\n        End Sub\n    End Class\n\n    Public Class OverloadedMethods\n        <TestMethod>\n        Public Sub Method()\n        End Sub\n\n        <TestMethod>\n        Public Sub Method(i As Integer)\n        End Sub\n\n        <TestMethod>\n        Public Sub Method(s As String)\n        End Sub\n\n        <TestMethod>\n        Public Sub Method(i As Integer, s As String)\n        End Sub\n    End Class\n\n    Public Class GenericClass(Of T)\n        <TestMethod>\n        Public Sub Method()\n        End Sub\n\n        <TestMethod>\n        Public Sub Method(Of U)()\n        End Sub\n    End Class\n\n    Public Class WithGenericMethod\n        <TestMethod>\n        Public Sub Method(Of T)()\n        End Sub\n    End Class\n\n    Partial Public Class PartialClass\n        Inherits BaseClass\n\n        <TestMethod>\n        Public Sub InFirstFile()\n        End Sub\n\n        Private Partial Sub PartialMethod() ' Test method attribute is defined in the other file.\n        End Sub\n    End Class\n\n    Public Class PropertiesAndIndexers\n        Private values() As Integer\n\n        Public Property [Property] As String\n\n        Default Public Property Item(index As Integer) As Integer\n            Get\n                Return values(index)\n            End Get\n            Set(value As Integer)\n                values(index) = value\n            End Set\n        End Property\n    End Class\n\n    Public MustInherit Class BaseClass\n        <TestMethod>\n        Public Sub BaseClassMethod()\n        End Sub\n\n        <TestMethod>\n        Public Overridable Sub Method()\n        End Sub\n    End Class\n\n    Public Class DerivedClass\n        Inherits BaseClass\n\n        <TestMethod>\n        Public Overrides Sub Method()\n        End Sub\n    End Class\n\n    Public Class MultipleLevelInheritance\n        Inherits DerivedClass\n\n        <TestMethod>\n        Public Sub MultipleLevelInheritanceMethod()\n        End Sub\n    End Class\n\n    Public Interface IInterfaceWithTestDeclarations\n        <TestMethod>\n        Function GetZipCode() As String\n    End Interface\n\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/MetricsAnalyzer/AllMetrics.cs",
    "content": "﻿// Header comment\n\nusing System;\n\nnamespace Tests\n{\n    public class Program\n    {\n        private int noSonar; // NOSONAR\n        private int field;\n\n        public int Go(bool condition)\n        {\n            if (condition)\n            {\n                return 42;\n            }\n\n            var y = string.Empty;\n            (y, var z) = (\"a\", 'x');\n\n            throw new NotImplementedException();\n        }\n    }\n\n    public record class RecordClass();\n\n    public struct Struct\n    {\n    }\n\n    public record struct RecordStruct();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/MetricsAnalyzer/Component.razor",
    "content": "﻿<h3>Component</h3>\n\n@code {\n\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/MetricsAnalyzer/Metrics.Latest.cs",
    "content": "﻿class PrimaryConstructor(bool condition /* comment */)\n{\n    bool Field = condition;\n\n    int Method()\n    {\n        if (condition)\n        {\n            return 42;\n        }\n        return 0;\n    }\n\n    PrimaryConstructor(bool condition, int n) : this(condition) { }\n}\n\npublic static class Extensions\n{\n    extension(string)\n    {\n        public static int Method()\n        {\n            if (true)\n            {\n                return 0;\n            }\n        }\n    }\n}\n\npublic class FieldKeyword\n{\n    public int Value\n    {\n        get { return field; }\n        set { field = value; }\n    }\n}\n\npublic class NullConditionalAssignment\n{\n    public void Method(FieldKeyword sample)\n    {\n        sample?.Value = 42; \n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/MetricsAnalyzer/Razor.cshtml",
    "content": "<head>\n    <title>Title</title>\n</head>\n\n@{\n    string message = \"message\";\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/MetricsAnalyzer/Razor.razor",
    "content": "@page \"/razor\"\n@namespace RazorNamespace\n<p>Current count: @currentCount</p>                <!-- FN: comment -->\n\n@currentCount                                      <!-- FN: comment -->\n\n@code {                                            // FN: line of code (location mapping issue)\n    private int currentCount = 0;                  // code line\n\n    public class MyClass { }                       // code line\n}                                                  // FN: line of code, comment (location mapping issue)\n\n<p>Current time: @(DateTime.Now)</p>               <!-- code line, FN: comment -->\n\n@for (var i = 0; i < 5; i++)                       // code line\n{                                                  <!-- code line, FN: comment -->\n    <text>Value: @i</text>                         <!-- FN: comment -->\n    <text>test</text>\n}                                                  <!-- code line, FN: comment -->\n\n@{                                                 // FN: code line (location mapping issue)\n    void RenderName(string name)                   // code line\n    {                                              // code line\n        <p>Name: <strong>@name</strong></p>        <!-- FN: comment -->\n        <p>Name: <strong>Hardcoded</strong></p>\n    }                                              <!-- code line, FN: comment -->\n\n    RenderName(\"Mahatma Gandhi\");                  // code line\n    RenderName(\"Martin Luther King, Jr.\");         // code line\n}                                                  // FN: line of code, comment\n\n@if (true)                                         // code line\n{                                                  // code line\n}                                                  <!-- code line, FN: comment -->\n\n@for (var i = 0; i < 5; i++)                       // code line\n{                                                  // code line\n    // comment\n    @:Name: @i                                     // code line, FN: comment \n}                                                  <!-- code line, FN: comment -->\n\n<Component>\n    @currentCount                                  <!-- FN: comment -->\n</Component>\n\n<!-- FN: comment -->\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/MetricsAnalyzer/_Imports.razor",
    "content": "﻿@using System\n@using System.Collections.Generic\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/Event.cs",
    "content": "﻿using System;\n\npublic class Sample\n{\n    public event EventHandler Changed;\n\n    public void Go()\n    {\n        Changed?.Invoke(null, null);\n        Changed += Sample_Changed;\n    }\n\n    private void Sample_Changed(object sender, EventArgs e) { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/Event.vb",
    "content": "﻿Public Class Sample\n\n    Public Event Changed()\n\n    Sub Go()\n        AddHandler Changed, AddressOf Sample_Changed\n\n        RaiseEvent Changed()\n    End Sub\n\n    Sub Sample_Changed() Handles Me.Changed\n    End Sub\n\nEnd class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/ExtensionKeyword.cs",
    "content": "﻿public static class Extensions\n{\n    extension(string s)\n    {\n        public int Length => s.Length;\n\n        public void DoSomething()\n        {\n            var x = 0;\n            x = s.Length;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/Field.EscapedNonKeyword.cs",
    "content": "﻿public class Sample\n{\n    private int @nonkeyword;\n\n    public void Go()\n    {\n        var x = nonkeyword;\n        @nonkeyword = 42;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/Field.EscapedNonKeyword.vb",
    "content": "﻿Public Class Sample\n\n    Private [NonKeyword] As Integer\n\n    Public Sub Go()\n        Dim i As Integer = NonKeyword\n        [NonKeyword] = 42\n    End Sub\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/Field.EscapedSequences.cs",
    "content": "﻿public class Sample\n{\n    private int defaul\\u0074;\n\n    public void Go()\n    {\n        _ = defaul\\u0074;\n        _ = de\\u0066\\u0061ul\\u0074;\n        _ = @default;\n        defaul\\u0074 = 42;\n        de\\u0066\\u0061ul\\u0074 = 42;\n        @default = 42;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/Field.ReservedKeyword.cs",
    "content": "﻿public class Sample\n{\n    private int @default;\n\n    public void Go()\n    {\n        var x = @default;\n        @default = 42;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/Field.ReservedKeyword.vb",
    "content": "﻿Public Class Sample\n\n    Private [Nothing] As Integer\n\n    Public Sub Go()\n        Dim i As Integer = [Nothing]\n        [Nothing] = 42\n    End Sub\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/Field.cs",
    "content": "﻿public class Sample\n{\n    private int field;\n\n    public void Go()\n    {\n        var x = field;\n        field = 42;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/Field.vb",
    "content": "﻿Public Class Sample\n\n    Private field As Integer\n\n    Public Sub Go()\n        Dim i As Integer = field\n        field = 42\n    End Sub\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/LocalFunction.cs",
    "content": "﻿public class Sample\n{\n    public void Go()\n    {\n        var x = LocalMethod();\n\n        int LocalMethod() => 42;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/Method.cs",
    "content": "﻿public class Sample\n{\n    public void Method() { }\n\n    public void method() { }\n\n    public void Go()\n    {\n        Method();\n        method();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/Method.vb",
    "content": "﻿Public Class Sample\n\n    Public Sub Method()\n    End Sub\n\n    Function MyFunction() As Double\n        Return 3.87\n    End Function\n\n    Public Sub Go()\n        Method()\n        MyFunction()\n        mEthOd() ' Different case, same method\n    End Sub\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/Method_Partial1.cs",
    "content": "﻿namespace SonarAnalyzer.Test.TestCases.Utilities.SymbolReferenceAnalyzer;\n\npublic partial class Method_Partial\n{\n    partial void Unimplemented();   // Declaration without implementation\n    public partial void Implemented1() { } // Implementation here\n    public partial void Implemented2();    // Implementation in Partial2\n\n    partial void DeclaredAndImplemented();\n    partial void DeclaredAndImplemented() { }\n\n    public void Reference1()\n    {\n        Unimplemented();\n        Implemented1();\n        Implemented2();\n\n        DeclaredAndImplemented();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/Method_Partial2.cs",
    "content": "﻿namespace SonarAnalyzer.Test.TestCases.Utilities.SymbolReferenceAnalyzer;\n\npublic partial class Method_Partial\n{\n    public partial void Implemented1();    // Implementation in Partial1\n    public partial void Implemented2() { } // Implementation here\n\n    public void Reference2()\n    {\n        Unimplemented();\n        Implemented1();\n        Implemented2();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/MissingDeclaration.cs",
    "content": "﻿namespace Credentials\n{\n    public class Credentials\n    {\n    }\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/NamedType.ReservedKeyword.cs",
    "content": "﻿using System;\n\npublic class @default\n{\n    public static void Go()\n    {\n        var usage = new @default();\n        var useEx = new Exception();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/NamedType.ReservedKeyword.vb",
    "content": "﻿Public Class [Nothing]\n\n    Public Sub Method()\n        Dim sample As [Nothing] = New [Nothing]()\n        Dim s As New [Nothing]()\n        Dim ex As Exception = New Exception()\n    End Sub\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/NamedType.cs",
    "content": "﻿using System;\n\npublic class Sample\n{\n    public static void Go()\n    {\n        var usage = new Sample();\n        var useEx = new Exception();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/NamedType.vb",
    "content": "﻿Public Class Sample\n\n    Public Sub Method()\n        Dim sample As Sample = New Sample()\n        Dim s As New Sample()\n        Dim ex As Exception = New Exception()\n    End Sub\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/Parameter.ReservedKeyword.cs",
    "content": "﻿public class Sample\n{\n    public void EscapedParameter\n        (int @default) // Needs to be on a separate line to have a simple test scaffolding\n    {\n        int x = @default;\n        @default = 42;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/Parameter.ReservedKeyword.vb",
    "content": "﻿Public Class Sample\n\n    Public Sub Method(\n                      [Nothing] As String) ' Needs to be on a separate line to have a simple test scaffolding\n        Dim b As String = [Nothing]\n        [Nothing] = \"value\"\n    End Sub\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/Parameter.cs",
    "content": "﻿public class Sample\n{\n    public void Go\n        (int param) // Needs to be on a separate line to have a simple test scaffolding\n    {\n        var x = param;\n        param = 42;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/Parameter.vb",
    "content": "﻿Public Class Sample\n\n    Public Sub Method(\n                      a As String) ' Needs to be on a separate line to have a simple test scaffolding\n        Dim b as String = a\n        a = \"value\"\n    End Sub\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/PartialConstructor.Partial.cs",
    "content": "﻿public partial class PartialConstructor\n{\n    public partial PartialConstructor()\n    {\n        this.A = 42;\n    }\n\n    public void Build()\n    {\n        var x = new PartialConstructor();\n        x.A = 42;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/PartialConstructor.cs",
    "content": "﻿public partial class PartialConstructor\n{\n    public int A;\n    public partial PartialConstructor();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/PartialEvent.Partial.cs",
    "content": "﻿using System;\n\npublic partial class Sample\n{\n    public partial event EventHandler Changed { add { changed += value; } remove { changed -= value; } }\n\n    public void Go()\n    {\n        changed?.Invoke(null, null);\n        Changed += Sample_Changed;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/PartialEvent.cs",
    "content": "﻿using System;\n\npublic partial class Sample\n{\n    private EventHandler changed;\n    public partial event EventHandler Changed;\n    private void Sample_Changed(object sender, EventArgs e) { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/PrimaryConstructor.cs",
    "content": "﻿static class A\n{\n    public const int I = 1;\n}\n\nclass PrimaryConstructor(int a1 = A.I) { }\n\nclass SubClass(int b1) : PrimaryConstructor(1)\n{\n    private int Field = b1;\n    private int Property { get; set; } = b1;\n    private int b1 = b1;\n\n    int Method() => b1;\n}\n\nclass B(int b1)\n{\n    private int Field = b1;\n    private int Property { get; set; } = b1;\n    public B(int b1, int b2) : this(b1)\n    {\n        var f = (int i = A.I) => i;\n    }\n    int Method() => b1;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/Property.FieldKeyword.cs",
    "content": "﻿public class Sample\n{\n    public int Property { get { return field; } set { field = value; } }\n\n    public int property { get; set; }\n\n    public void Go()\n    {\n        var x = Property;\n        Property = 42;\n        property = 24;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/Property.cs",
    "content": "﻿public class Sample\n{\n    public int Property { get; set; }\n\n    public int property { get; set; }\n\n    public void Go()\n    {\n        var x = Property;\n        Property = 42;\n        property = 24;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/Property.vb",
    "content": "﻿Public Class Sample\n\n    Public Property Name As String\n\n    Public Sub Method()\n        Dim n As String = Name\n        Name = \"John\"\n        Dim x = name ' Different case, same property\n    End Sub\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/Property_Partial1.cs",
    "content": "﻿namespace SonarAnalyzer.Test.TestCases.Utilities.SymbolReferenceAnalyzer;\n\npublic partial class Property_Partial\n{\n    public partial int Property { get => 1; set { } } // Implementation\n\n    partial int DeclaredAndImplemented { get; }\n    partial int DeclaredAndImplemented => 1;\n\n    public void Reference1()\n    {\n        Property = 1;\n        _ = DeclaredAndImplemented;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/Property_Partial2.cs",
    "content": "﻿namespace SonarAnalyzer.Test.TestCases.Utilities.SymbolReferenceAnalyzer;\n\npublic partial class Property_Partial\n{\n    public partial int Property { get; set; } // Declaration\n\n    public void Reference2()\n    {\n        Property = 1;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/Razor.cshtml",
    "content": "<head>\n    <title>Title</title>\n</head>\n\n@{\n    string message = \"message\";\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/Razor.razor",
    "content": "@page \"/razor\"\n@using Microsoft.AspNetCore.Components.Web\n@namespace TestCases\n\n<p>Current count: @currentCount</p>                     <!-- field reference -->\n\n@currentCount                                           <!-- field reference -->\n\n<button @onclick=\"IncrementCount\">Increment</button>    <!-- method reference -->\n\n@IncrementAmount                                        <!-- property reference -->\n\n@code {\n    private int currentCount = 0;                       // Field declaration\n\n    [Parameter]\n    public int IncrementAmount { get; set; } = 1;       // Property declaration\n\n    private void IncrementCount()                       // Method declaration\n    {\n        currentCount += IncrementAmount;                // Property and field reference\n        IncrementAmount += 1;                           // Property reference\n    }\n}\n\n<button @onclick=\"AddTodo\">Add todo</button>            <!-- Method reference -->\n\n<ul>\n    @foreach (var todo in todos)                        // FN: `todo` declaration not found\n    {\n        <li>@todo.Title</li>                            // FN: local var reference not found\n    }\n</ul>\n\n<h3>Todo (@todos.Count(x => !x.IsDone))</h3>            // lambda parameter declaration\n\n@code {\n    private List<ToDo> todos = new();                   // Field declaration\n\n    public void AddTodo()                               // Method declaration\n    {\n        var x = LocalMethod();                          // variable declaration (x) and method reference\n        var y = new DateTime();                         // variable declaration (y)\n\n        int LocalMethod() => 42;                        // Local method declaration\n    }\n}\n\n<p>Explicit expression: @(currentCount)</p>             <!-- Field reference: explicit expression -->\n<p class=\"@Property\"></p>                               <!-- The symbol is not resolved in this case because it's declared in another file (syntax tree) -->\n\n<div @attributes=\"AdditionalAttributes\">\n    <button @onclick=\"(()=>IncrementCount())\">Button with lambda</button>\n</div>\n\n@code {\n    [Parameter(CaptureUnmatchedValues = true)]\n    public IDictionary<string, object>? AdditionalAttributes { get; set; }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/Razor.razor.cs",
    "content": "﻿using Microsoft.AspNetCore.Components;\n\nnamespace TestCases;\n\npublic partial class Razor\n{\n    [Parameter]\n    public string Property { get; set; }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/RazorComponent.razor",
    "content": "@typeparam TSomeVeryLongName where TSomeVeryLongName : class"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/Setter.cs",
    "content": "﻿public class Sample\n{\n    public int PropertyReferencingValueKeyword\n    {\n        get => 0;\n        set\n        {\n            var x = value;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/ToDo.cs",
    "content": "﻿namespace TestCases;\n\npublic class ToDo\n{\n    public string? Title { get; set; }\n    public bool IsDone { get; set; }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/TokenThreshold.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Collections.ObjectModel;\n\nnamespace Repro2429\n{\n    public class DictionaryInitialization\n    {\n        public class FooCollection<K, V> : Dictionary<K, KeyValuePair<int, FooCollection<K, V>>>\n        { }\n\n        public static class Bar\n        {\n            public static readonly ReadOnlyDictionary<string, KeyValuePair<int, FooCollection<string, string>>> Foo =\n                new ReadOnlyDictionary<string, KeyValuePair<int, FooCollection<string, string>>>(new FooCollection<string, string>()\n                {\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                });\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/Tuples.cs",
    "content": "﻿namespace Tests\n{\n    public class Cases\n    {\n        public void M()\n        {\n            var y = string.Empty;\n            (y, var z) = (\"a\", 'x');\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/Tuples.vb",
    "content": "﻿Public Class Sample\n\n    Public Sub Method()\n        Dim holiday As (\n            Name As String,\n            IsHoliday As Boolean\n        )\n        Dim a = holiday.Name\n    End Sub\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/TypeParameter.cs",
    "content": "﻿public class Sample\n    <TItem> // On a separate line for simple test scaffolding\n{\n    public void Go(TItem param)\n    {\n        TItem x = param;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/SymbolReferenceAnalyzer/TypeParameter.vb",
    "content": "﻿Public Class Sample(\n    Of T)\n\n    Public Sub Method(name As T)\n        Dim x as T = name\n    End Sub\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/TokenTypeAnalyzer/IdentifierTokenThreshold.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Collections.ObjectModel;\n\nnamespace Repro2429\n{\n    public class DictionaryInitialization\n    {\n        public class FooCollection<K, V> : Dictionary<K, KeyValuePair<int, FooCollection<K, V>>>\n        { }\n\n        public static class Bar\n        {\n            public static readonly ReadOnlyDictionary<string, KeyValuePair<int, FooCollection<string, string>>> Foo =\n                new ReadOnlyDictionary<string, KeyValuePair<int, FooCollection<string, string>>>(new FooCollection<string, string>()\n                {\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                    {\"1\", new KeyValuePair<int, FooCollection<string, string>>(1, new FooCollection<string, string>())},\n                });\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/TokenTypeAnalyzer/Identifiers.cs",
    "content": "﻿using System;\nusing AliasName = System.Exception;\n\npublic class Sample\n{\n    int aField;\n\n    public Sample() { }\n\n    public void Go(int value)\n    {\n        var g = new Generic<int>();\n        var alias = new AliasName();\n        dynamic d = g;\n        value = 42;\n\n        var y = string.Empty;\n        (y, var z) = (\"a\", 'x');\n    }\n\n    public void ValueAsVariableForCoverage()\n    {\n        string value = null;\n    }\n\n    public int Property\n    {\n        get => aField;\n        set\n        {\n            aField = value;\n        }\n    }\n}\n\npublic class Generic<TItem> { }\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/TokenTypeAnalyzer/Identifiers.vb",
    "content": "﻿Imports System\nImports AliasName = System.Exception\n\nPublic Class Sample\n\n    Private Field As Integer\n\n    Public Sub New()\n    End Sub\n\n    Public Sub Go(Value As Integer)\n        Dim G As New Generic(Of Integer)\n        Dim A As New AliasName\n        Value = 42\n    End Sub\n\n    Public Sub ValueAsVariableForCoverage()\n        Dim Value As String = Nothing\n    End Sub\n\n    Public Property Prop As Integer\n        Get\n            Return Field\n        End Get\n        Set(Value As Integer)\n            Field = Value\n        End Set\n    End Property\n\nEnd Class\n\nPublic Class Generic(Of ItemType)\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/TokenTypeAnalyzer/Razor.cshtml",
    "content": "<head>\n    <title>Title</title>\n</head>\n\n@{\n    string message = \"message\";\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/TokenTypeAnalyzer/Razor.razor",
    "content": "@page \"/razor\"\n\n<p>Current count: @currentCount</p>\n\n@code {\n    private int currentCount = 0;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/TokenTypeAnalyzer/Tokens.Latest.cs",
    "content": "﻿using Point = (int, int);\n\npublic class Sample\n{\n    private const string StringLiteralToken = \"StringLiteralToken\";\n    private const int NumericToken = 42;\n    private string interpolatedWithWhitespaceTokenInside = $\"{NumericToken} {NumericToken}\";\n    public const string SingleLineRawString = \"\"\"\"SingleLine\"\"\"\";\n    public const string MultiLineRawString =\n        \"\"\"\"\n        MultiLine\n        \"\"\"\";\n    public string InterpolatedSingleLineRawString = $\"\"\"\"SingleLine{NumericToken}\"\"\"\";\n    public string InterpolatedMultiLineRawString =\n        $$\"\"\"\"\n        MultiLine{{NumericToken}}\n        \"\"\"\";\n\n    public void A()\n    {\n        var UTF8String = \"UTF8 string\"u8;\n        var UTF8SingleLineRawString = \"\"\"\"SingleLine\"\"\"\"u8;\n        var UTF8MultiLineRawString =\n            \"\"\"\"\n        MultiLine\n        \"\"\"\"u8;\n    }\n}\n\nclass PrimaryConstructor(System.String p1, string p2 = \"default value that should be tokenized as string\" /* a comment */, int p3 = 1)\n{\n    void Method()\n    {\n        var lambdaWithDefaultValues = (string l1 = \"default value that should be tokenized as string\", int l2 = 2) => l1;\n        var usingAliasDirective = new Point(0, 0);\n        string[] collectionExpression = [\"Hello\", \"World\"];\n    }\n}\n\nclass SubClass() : PrimaryConstructor(\"something\")\n{\n    public SubClass(int p1) : this() { }\n}\n\nstatic class Extensions\n{\n    extension(string s)\n    {\n        public int Length => s.Length;\n    }\n}\n\npublic class FieldKeyword\n{\n    public int Value\n    {\n        get { return field; }\n        set { field = value; }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/TokenTypeAnalyzer/Tokens.cs",
    "content": "﻿public class Sample\n{\n    private const string StringLiteralToken = \"StringLiteralToken\";\n    private const int NumericToken = 42;\n    private string interpolatedWithWhitespaceTokenInside = $\"{NumericToken} {NumericToken}\";\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/TokenTypeAnalyzer/Tokens.vb",
    "content": "﻿Public Class Sample\n\n    Private Const StringLiteralToken As String = \"StringLiteralToken\"\n    Private Const NumericToken As Integer = 42\n    Private InterpolatedWithWhitespaceTokenInside As String = $\"{NumericToken} {NumericToken}\"\n\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/TokenTypeAnalyzer/Trivia.cs",
    "content": "﻿// Trailing comment\n\n/* Wrapped comment */\n\n/*\n * Wrapped multiline comment\n */\n\n/// <summary>\n/// Documentation comment\n/// </summary>\nnamespace Test { }\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/Utilities/TokenTypeAnalyzer/Trivia.vb",
    "content": "﻿''' <summary>\n''' Multiline comment\n''' </summary>\nPublic Class Sample\nEnd Class\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ValueTypeShouldImplementIEquatable.CSharp10.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\n\nrecord struct MyStruct // Compliant. Record struct implement IEquatable by definition\n{\n}\n\nrecord struct MyCompliantStruct : IEquatable<MyCompliantStruct> // Compliant\n{\n    public bool Equals(MyCompliantStruct other)\n    {\n        throw new NotImplementedException();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ValueTypeShouldImplementIEquatable.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nstruct MyStruct // Noncompliant {{Implement 'IEquatable<T>' in value type 'MyStruct'.}}\n//     ^^^^^^^^\n{\n}\n\nstruct MyCompliantStruct : IEquatable<MyCompliantStruct> // Compliant\n{\n    public bool Equals(MyCompliantStruct other)\n    {\n        throw new NotImplementedException();\n    }\n}\n\nstruct ComparableStruct : IComparable<ComparableStruct> // Noncompliant\n{\n    public int CompareTo(ComparableStruct other) { return 0; }\n}\n\n// https://github.com/SonarSource/sonar-dotnet/issues/3157\nref struct Repro_3157 // Compliant, ref structs can not implement interfaces\n{\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ValueTypeShouldImplementIEquatable.vb",
    "content": "﻿Public Structure MyCompliantStruct ' Compliant\n    Implements IEquatable(Of MyCompliantStruct)\n\n    Public Overloads Function Equals(other As MyCompliantStruct) As Boolean Implements IEquatable(Of MyCompliantStruct).Equals\n        Return True\n    End Function\nEnd Structure\n\nStructure MyStruct ' Noncompliant {{Implement 'IEquatable<T>' in value type 'MyStruct'.}}\n    '     ^^^^^^^^\nEnd Structure\n\nStructure ComparableStruct ' Noncompliant\n    Implements IComparable(Of ComparableStruct)\n\n    Public Function CompareTo(other As ComparableStruct) As Integer Implements IComparable(Of ComparableStruct).CompareTo\n        Return 0\n    End Function\nEnd Structure\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ValuesUselesslyIncremented.Latest.cs",
    "content": "﻿using System;\nusing System.Numerics;\n\npublic struct S\n{\n    public S()\n    {\n        int i = 0;\n\n        (i, var j) = (i++, 0); // Noncompliant {{Remove this increment or correct the code not to waste it.}}\n        //            ^^^\n        (var k, _) = (i++, 0); // Compliant\n        (_, _) = (i++, 0);     // Compliant\n    }\n\n    public (int, int) M1(int i, int j)\n    {\n        return (i, j++);       // Noncompliant {{Remove this increment or correct the code not to waste it.}}\n        //         ^^^\n    }\n\n    public (int, (int, int)) M2()\n    {\n        var (i, j, k) = (0, 0, 0);\n        return (i++, (j++, k++));\n        //      ^^^                 {{Remove this increment or correct the code not to waste it.}}\n        //            ^^^       @-1 {{Remove this increment or correct the code not to waste it.}}\n        //                 ^^^  @-2 {{Remove this increment or correct the code not to waste it.}}\n    }\n\n    public (int, (int, int)) M3(int i, int j, int k) =>\n        (i++, (j++, k++));      // Noncompliant [lambdaTuple1, lambdaTuple2, lambdaTuple3]\n\n    public (int, (int, int)) M4(int i, int j, int k) =>\n        (i++, M1(j++, k++));    // Noncompliant\n    //   ^^^\n}\n\npublic class Noncompliant\n{\n    public WeirdOperatorOverload ThisExampleIsNoncompliant(WeirdOperatorOverload woo)\n    {\n        return woo--; // Noncompliant\n    }\n}\n\npublic class WeirdOperatorOverload : IDecrementOperators<WeirdOperatorOverload>\n{\n    public static WeirdOperatorOverload operator --(WeirdOperatorOverload value) => throw new NotImplementedException();\n}\n\n\npublic class FieldKeyword\n{\n    public int Noncompliant\n    {\n        get { return field++; }     // Compliant, field is incremented\n        set { field = value++; }    // FN https://sonarsource.atlassian.net/browse/NET-2844\n    }\n}\n\npublic class NullConditionalAssignment\n{\n    public class Sample\n    {\n        public int Value { get; set; }\n    }\n\n    public void TestMethod(Sample sample)\n    {\n        sample?.Value = sample.Value++; // FN https://sonarsource.atlassian.net/browse/NET-2844\n        return sample?.Value++;         // Error [CS1059] The operand of an increment or decrement operator must be a variable, property or indexer\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ValuesUselesslyIncremented.TopLevelStatements.cs",
    "content": "﻿using System;\nusing System.Numerics;\n\nnint i = 0;\ni = i++; // Noncompliant; i is still zero\ni = ++i; // Compliant\n\nnuint u = 0, a = 0;\nu = u++; // Noncompliant; u is still zero\nu = ++u; // Compliant\nu += u++;\na = u++;\n\nint x = (int) u++;\n\nint Compute(nint v) =>\n    (int) v++; // Noncompliant\n//        ^^^\n\nint ComputeArrowBody(int v) =>\n    v--; // Noncompliant\n//  ^^^\n\nreturn (int)i++; // Noncompliant\n\nIntPtr j = 0;\nj = j++; // Noncompliant; i is still zero\nj = ++j; // Compliant\n\nUIntPtr v = 0, b = 0;\nv = v++; // Noncompliant; u is still zero\nv = ++v; // Compliant\nv += v++; // Compliant\nb = v++; // Compliant\n\nint z = (int)u++;\n\nIntPtr ComputeIntPtr(IntPtr v)\n{\n    return v++; // Noncompliant\n//         ^^^\n}\n\nIntPtr ComputeArrowBodyIntPtr(IntPtr v) =>\n    v--; // Noncompliant\n//  ^^^\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/ValuesUselesslyIncremented.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public class ValuesUselesslyIncremented\n    {\n        public int pickNumber()\n        {\n            int i = 0;\n            int j = 0;\n\n            i = i++;    // Noncompliant; i is still zero\n            i += i++;   // Compliant\n\n            return j++; // Noncompliant {{Remove this increment or correct the code not to waste it.}}\n//                 ^^^\n        }\n\n        public int pickNumber2()\n        {\n            int i = 0;\n            int j = 0;\n\n            i++;\n            return ++j;\n        }\n\n        int x = 0;\n        int y = 0;\n        public int pickNumber3()\n        {\n            y = y++;\n            return x++; // Compliant; 0 returned\n        }\n        public int pickNumber3(int i)\n        {\n            return i++; // Noncompliant\n        }\n        public int pickNumber4(ref int i)\n        {\n            return i++; // Compliant\n        }\n\n        public int pickNumber4(int i) => i++; // Noncompliant\n    }\n\n    class Repro_2265\n    {\n        public int i { get; set; }\n        int Method(int i)\n        {\n            new Repro_2265 { i = i++ }; // Noncompliant FP\n            return i;\n        }\n    }\n\n    public class Properties\n    {\n        private int backingField;\n        public int Noncompliant\n        {\n            get { return backingField++; }          // Compliant, value is 'usefully' incremented\n            set { backingField = value++; }         // FN https://sonarsource.atlassian.net/browse/NET-2844\n        }\n\n        public int NoncompliantTest(Properties properties)\n        {\n            properties.Noncompliant = properties.Noncompliant++; // FN https://sonarsource.atlassian.net/browse/NET-2844\n            return properties.Noncompliant++;                    // Compliant, Property is incremented\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/VariableShadowsField.Latest.Partial.cs",
    "content": "﻿using System;\n\npublic partial class VariableShadowsField\n{\n    public void Method(object someParameter)\n    {\n        int myField = 0; // Noncompliant\n        //  ^^^^^^^\n        int myProperty = 0; // Noncompliant\n        //  ^^^^^^^^^^\n    }\n}\n\npublic partial class VariableShadowsFieldPrimaryConstructor\n{\n    void Method()\n    {\n        var a = 0; // Noncompliant\n        //  ^\n    }\n}\n\npublic partial class PartialProperty\n{\n\n    public partial int myPartialProperty { get => 42; set { } }\n\n    public void DoSomething()\n    {\n        int myPartialProperty = 0;  // Noncompliant\n    }\n\n}\n\npublic partial class PartialConstructor\n{\n    public partial PartialConstructor()\n    {\n        int field = 42;             // Noncompliant\n    }\n}\n\npublic partial class PartialEvent\n{\n    public partial event EventHandler myPartialEvent\n    {\n        add { int field = 0;  }     // Noncompliant\n        remove { int field = 0; }   // Noncompliant\n    }\n    public void Shadow()\n    {\n        int myPartialEvent = 0;     // FN https://sonarsource.atlassian.net/browse/NET-2846\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/VariableShadowsField.Latest.cs",
    "content": "﻿using System;\n\npublic class CSharp8LocalFunctions\n{\n    private int field;\n    private int Property { get; set; }\n\n    public void ShadowField()\n    {\n        static void doMore()\n        {\n            int field = 0; // Noncompliant\n        }\n    }\n\n    public void ShadowProperty()\n    {\n        static void doMore()\n        {\n            int Property = 0; // Noncompliant\n        }\n    }\n\n    public void MethodWithLocalVar()\n    {\n        bool isUsed = true;\n\n        void doSomething()\n        {\n            bool isUsed = true; // Compliant - currently the rule only looks at fields and properties\n        }\n\n        static void doMore()\n        {\n            bool isUsed = true; // Compliant\n        }\n    }\n}\n\nclass MyParentClass(int parentClassParam)\n{\n    class MyClass(int a, int b, int c, int d, int e, int f, int g, int h, int i, int j)\n    {\n        public int a = a; // Compliant\n        public int b; // FN\n\n        public int c { get; set; } = c; // Compliant\n        public int d { get; set; } // FN\n\n        public int g = a; // FN {{Rename 'g' which hides the primary constructor parameter with the same name.}}\n\n        class MyChildClass(int childClassParam) { }\n\n        MyClass(int ctorParam, int f) : this(ctorParam, f, 1, 1, 1, 1, 1, 1, 1, 1) { } // Compliant\n\n        void MyMethod()\n        {\n            int parentClassParam = 42; // Compliant\n            int childClassParam = 42; // Compliant\n            int ctorParam = 42; // Compliant\n\n            int f = 42; // Noncompliant {{Rename 'f' which hides the primary constructor parameter with the same name.}}\n            _ = a is object g; // Noncompliant\n            for (int h = 0; h < 10; h++) { } // Noncompliant {{Rename 'h' which hides the primary constructor parameter with the same name.}}\n            for (int a = 0; a < 10; a++) { } // Noncompliant {{Rename 'a' which hides the field with the same name.}}\n            for (int c = 0; c < 10; c++) { } // Noncompliant {{Rename 'c' which hides the property with the same name.}}\n            var lambda = (int h = 1) => h; // Compliant\n            foreach (var (i, j) in new (int, int)[0]) { } // Noncompliant\n                                                          // Noncompliant@-1\n        }\n    }\n}\n\n// Reproducer for https://github.com/SonarSource/sonar-dotnet/issues/8260\nclass Repro_8260(int primaryCtorParam)\n{\n    public static void StaticMethod()\n    {\n        var primaryCtorParam = 42;      // Compliant (primary ctor parameter is not accessible from static method)\n    }\n\n    public void NonStaticMethod()\n    {\n        var primaryCtorParam = 42;      // Noncompliant\n    }\n}\n\npublic partial class VariableShadowsField\n{\n    public int myField;\n    public int myProperty { get; set; }\n}\n\npublic partial class VariableShadowsFieldPrimaryConstructor(int a) { }\n\npublic class SomeClass\n{\n    private byte[] somefield;\n\n    public void SomeMethod(byte[] byteArray)\n    {\n        if (byteArray is [1, 2, 3] somefield) // Noncompliant {{Rename 'somefield' which hides the field with the same name.}}\n        {\n        }\n    }\n}\n\npublic record struct S\n{\n    private int i = 0;\n    private int j = 0;\n    private int k = 0;\n    private int l = 0;\n    private int n = 0;\n    private int p = 0;\n    private int q = 0;\n    private int r = 0;\n    private int s = 0;\n    private int t = 0;\n    private int u = 0;\n    private int v = 0;\n    private int w = 0;\n\n    public S()\n    {\n        (var i, var j) = (0, 0);\n        //   ^\n        //          ^ @-1\n\n        var (k, l) = (0, 0);     // Noncompliant [issue1,issue2]\n        (var m, var n) = (0, 0); // Noncompliant m is not declared as field\n        //          ^\n        var (o, p) = (0, 0);     // Noncompliant\n        (var a, var b) = (0, 0); // Compliant\n        var (c, d) = (0, 0);     // Compliant\n        var (_, _) = (0, 0);     // Compliant\n\n        var (q, (_, r, _), s) = (1, (2, 3, 4), 5);\n        //   ^\n        //          ^        @-1\n        //                 ^ @-2\n        foreach ((var t, var u) in new[] { (1, 2) })\n        //            ^\n        //                   ^ @-1\n        {\n\n        }\n        foreach (var (v, w) in new[] { (1, 2) })\n        //            ^\n        //               ^ @-1\n        {\n\n        }\n    }\n}\npublic partial class PartialProperty\n{\n    public partial int myPartialProperty { get; set; }\n}\n\npublic static class Extensions\n{\n    public class Sample\n    {\n        public int Value { get; set; }\n    }\n\n    private static int field;\n    public static int Property => 42;\n\n    extension(Sample s)\n    {\n        public void ShadowContainerClass()\n        {\n            int field = 0;      // FN https://sonarsource.atlassian.net/browse/NET-2846\n            int Property = 0;   // FN https://sonarsource.atlassian.net/browse/NET-2846\n        }\n\n        public void ShadowExtendedClass()\n        {\n            int value = 0;\n        }\n    }\n}\n\npublic class FieldKeyword\n{\n    private int field;\n    public int Property { get { return field; } set { value = field; } }\n}\n\npublic partial class PartialConstructor\n{\n    private int field;\n    public partial PartialConstructor();\n}\n\npublic partial class PartialEvent\n{\n    private int field;\n    public partial event EventHandler myPartialEvent;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/VariableShadowsField.TopLevelStatements.cs",
    "content": "﻿using System;\n\nConsole.WriteLine(\"Hi!\");\n\nrecord Rec\n{\n    public int @int;\n    public int foo;\n    public int bar;\n\n    public void DoSomething()\n    {\n        int foo = 0; // Noncompliant\n//          ^^^\n        int @int = 42; // Noncompliant\n\n        foreach (var bar in new[] { 1, 2 }) // Noncompliant\n        {\n        }\n    }\n\n    public void PropertyPattern()\n    {\n        _ = new ArgumentException() is\n        {\n            Message: { } bar, // Noncompliant\n        };\n    }\n\n    public void PositionalPattern()\n    {\n        _ = (1, 2) is (_, _) bar; // Noncompliant\n    }\n\n    public void VarPattern()\n    {\n        _ = 1 is var bar; // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/VariableShadowsField.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\n\nnamespace Tests.Diagnostics\n{\n    public class VariableShadowsField\n    {\n        public int myField;\n        public IDisposable myDisposableField;\n        public int myField2;\n        public object myField3;\n        public int @int;\n        public int MyField { get; set; }\n\n        public void doSomething(object someParameter)\n        {\n            int myField = 0, // Noncompliant\n            //  ^^^^^^^\n                other = 5;\n            int @int = 42; // Noncompliant\n\n            for (myField = 0; myField < 10; myField++) // Compliant\n            {\n            }\n            for (int myField2 = 0; myField2 < 10; myField2++) // Noncompliant {{Rename 'myField2' which hides the field with the same name.}}\n            {\n            }\n\n            using (var myField2 = new MemoryStream()) // Noncompliant\n            {\n            }\n            using (var local = new MemoryStream()) // Compliant\n            {\n            }\n            using (myDisposableField = new MemoryStream()) // Compliant\n            {\n            }\n\n            foreach (var myField2 in new[] { 1, 2 }) // Noncompliant\n            {\n            }\n            foreach (var local in new[] { 1, 2 }) // Compliant\n            {\n            }\n\n            if (someParameter is object myField3) // Noncompliant\n            {\n\n            }\n\n            if (someParameter is object myFieldNonExistent) // Compliant\n            {\n\n            }\n        }\n\n        class X\n        {\n            public int f;\n        }\n\n        public unsafe void doSomeUnsafe()\n        {\n            var x = new X();\n\n            fixed (int* myField2 = &x.f) // Noncompliant\n            {\n            }\n            fixed (int* local = &x.f) // Compliant\n            {\n            }\n        }\n\n        public void doSomethingElse(int MyField) // Compliant\n        {\n            this.MyField = MyField;\n        }\n\n        public VariableShadowsField(int myField)\n        {\n            this.myField = myField;\n        }\n\n        public static VariableShadowsField build(int MyField)\n        {\n            return null;\n        }\n    }\n\n    public class WithLocalFunctions\n    {\n        private int field;\n        private int Property { get; set; }\n\n        public void ShadowField()\n        {\n            void doSomething()\n            {\n                int field = 0; // Noncompliant\n            }\n        }\n\n        public void ShadowProperty()\n        {\n            void doSomething()\n            {\n                int Property = 0; // Noncompliant\n            }\n        }\n    }\n\n    public class DeclarationExpressions\n    {\n        private object myField1 = null;\n\n        public void OutDeclarationWithConcreteType()\n        {\n            OutParameter(out object myField1); // Noncompliant\n        }\n\n        public void OutDeclarationWithVar()\n        {\n            OutParameter(out var myField1);    // Noncompliant\n        }\n\n        public void OutReference()\n        {\n            OutParameter(out myField1);        // Compliant\n        }\n\n        public void OutParameter(out object parameter)\n        {\n            parameter = null;\n        }\n    }\n\n    public class Base\n    {\n        private int privateInstanceField = 1;\n        private int privateInstanceProperty { get; set; } = 1;\n        private static int privateStaticField = 1;\n        private static int privateStaticProperty = 1;\n\n        protected int protectedInstanceField = 1;\n        protected int protectedInstanceProperty { get; set; } = 1;\n        protected static int protectedStaticField = 1;\n        protected static int protectedStaticProperty = 1;\n\n        public static void BaseStaticMethod()\n        {\n            var privateInstanceField = 2;       // Compliant (instance field is not accessible from static method)\n            var privateInstanceProperty = 2;    // Compliant (instance property is not accessible from static method)\n\n            var privateStaticField = 2;         // Noncompliant\n            var privateStaticProperty = 2;      // Noncompliant\n        }\n\n        public void BaseInstanceMethod()\n        {\n            var privateInstanceField = 2;       // Noncompliant\n            var privateInstanceProperty = 2;    // Noncompliant\n\n            var privateStaticField = 2;         // Noncompliant\n            var privateStaticProperty = 2;      // Noncompliant\n        }\n    }\n\n    public class Derived : Base\n    {\n        public static void DerivedStaticMethod()\n        {\n            var privateStaticField = 2;         // Compliant (private field from the base class is not accessible in the derived class)\n            var privateStaticProperty = 2;      // Compliant (private property from the base class is not accessible in the derived class)\n\n            var protectedInstanceField = 2;     // Compliant (instance field is not accessible from static method)\n            var protectedInstanceProperty = 2;  // Compliant (instance property is not accessible from static method)\n\n            var protectedStaticField = 2;       // FN - members from the base class are not checked\n            var protectedStaticProperty = 2;    // FN\n        }\n\n        public void DerivedInstanceMethod()\n        {\n            var protectedInstanceField = 2;     // FN\n            var protectedInstanceProperty = 2;  // FN\n\n            var protectedStaticField = 2;       // FN\n            var protectedStaticProperty = 2;    // FN\n        }\n    }\n\n    public static class ClassicExtensions\n    {\n        private static int field;\n        public static int Property => 42;\n\n        public class Sample\n        {\n            public int Value { get; set; }\n        }\n\n        public static void ShadowContainerClass(this Sample sample)\n        {\n            int field = 0;      // Noncompliant\n            int Property = 0;   // Noncompliant\n        }\n\n        public static void ShadowExtendedClass(this Sample sample)\n        {\n            int value = 0;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/VariableUnused.Latest.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\n\nrecord Record\n{\n    void Method()\n    {\n        string unusedString = string.Empty; // Noncompliant\n    }\n}\n\nclass PrimaryConstructorParameterNotUsed(int someInt) { } // Compliant\n\nclass PrimaryConstructorParameterUsedInMethod(int someInt) // Compliant\n{\n    int Method => someInt;\n}\n\npublic class StaticLocalFunctions\n{\n    public void Method()\n    {\n        static void Bar(List<int> list)\n        {\n            list.Select(item => 1);\n\n            list.Select(item =>\n            {\n                var value = 1; // Noncompliant\n                return item;\n            });\n        }\n    }\n}\n\n//https://github.com/SonarSource/sonar-dotnet/issues/3137\npublic class Repro_3137\n{\n    public void GoGoGo(Logger log)\n    {\n        using var scope = log.BeginScope(\"Abc\"); // Compliant, existence of variable represents a state until it's disposed\n        using var _ = log.BeginScope(\"XXX\"); // Underscore is a variable in this case, it's not a discard pattern\n\n        // Locked file represents a state until it's disposed\n        using var stream = File.Create(\"path\");\n    }\n\n    public class Logger\n    {\n        public IDisposable BeginScope(string scope)\n        {\n            return null;\n        }\n    }\n}\n\npublic class RecursivePatterns\n{\n    public void TestMethod()\n    {\n        var x = \"hello\";\n        var tuple = (\"hello\", \"bye\");\n        if (tuple is (string strX, string strY)) // Noncompliant\n//                                        ^^^^\n        {\n            strX += \":)\";\n        }\n\n        if (tuple is (string comX, string comY)) // Compliant\n        {\n            comX += comY;\n        }\n\n        if (x is string { Length: 5 } rec) //Noncompliant\n//                                    ^^^\n        {\n            x += \":)\";\n        }\n        if (x is string { Length: 5 } com) //Compliant\n        {\n            com += \":)\";\n        }\n\n        if (tuple is (string str, { } d)) // Noncompliant\n//                                    ^\n        {\n            str += \":)\";\n        }\n\n        if (tuple is (string y, { } z)) // Noncompliant\n//                           ^\n        {\n            z += \":)\";\n        }\n\n        if (tuple is (string strCom, { } dCom)) // Compliant\n        {\n            strCom += dCom;\n        }\n    }\n}\n\npublic class SomeClass\n{\n    public void SomeMethod(object[] byteArray)\n    {\n        if (byteArray is [1, 2, 3] unusedVar) { }           // Noncompliant\n        if (byteArray is [SomeClass unusdeVar2, 42]) { }    // Noncompliant\n    }\n}\n\npublic record struct S\n{\n    public S()\n    {\n        (var i, var j) = (0, 0); // Noncompliant [issue1, issue2]\n        (var ii, (var jj, var kk)) = (0, (0, 0)); // Noncompliant [issue3, issue4, issue5]\n\n        var (v, p) = (0, 0); // Noncompliant [issue6, issue7]\n        var (vv, (pp, vvv)) = (0, (0, 0)); /// Noncompliant [issue8, issue9, issue10]\n\n        (int, int) x = (0, 0); // Noncompliant\n//                 ^\n        (int, (int, int)) xx = (0, (0, 0)); // Noncompliant\n//                        ^^\n        (int, int) y = (0, 0);\n        y.Item1 = 2;\n\n        var z = (0, 0); // Noncompliant\n\n        var a = 0;\n        (a, var b) = (0, 0); // Noncompliant {{Remove the unused local variable 'b'.}}\n//              ^\n        (a, (int, int) bb) = (0, (0, 0)); // Noncompliant\n//                     ^^\n        (a, var k) = (0, 0);\n        (a, k) = (0, 0);\n\n        (a, (k, var c)) = (0, (0, 0)); // Noncompliant\n//                  ^\n        (a, k) = (0, 0);\n\n        (int, int) used;\n        used.Item1 = 3;\n\n        (int, (int, int)) usedNested;\n        usedNested.Item1 = 3;\n\n        (int, int) notUsed; // Noncompliant\n//                 ^^^^^^^\n        (int, (int, int)) notUsedNested; // Noncompliant\n//                        ^^^^^^^^^^^^^\n    }\n}\n\npublic class NullConditionalAssingment\n{\n    public class Sample\n    {\n        public int Value { get; set; }\n    }\n\n    public void Test()\n    {\n        var rhs = 0;\n        var compliant = new Sample();\n        compliant?.Value = rhs;         // Compliant\n    }\n}\n\npublic class Shadowing\n{\n    public void TwoLambdas()\n    {\n        // C# 8+ allows same-name locals in sibling lambdas. Both x symbols land in the same\n        // code block - using x in the second lambda must not suppress the report for x in the first.\n        _ = ((Func<int>)(() => { var x = 1; return 0; }))();   // Noncompliant\n        _ = ((Func<int>)(() => { var x = 2; return x; }))();   // Compliant\n    }\n}\n\npublic class FieldKeyword\n{\n    public int Value\n    {\n        get\n        {\n            int compliant = 0;\n            field += compliant;         // Compliant\n            return field;\n        }\n        set\n        {\n            int compliant;\n            compliant = field;          // Compliant\n        }\n    }\n}\n\npublic class SwitchExpressions\n{\n    public void Method(object o)\n    {\n        var unused = o switch   // Noncompliant\n        {\n            int n => n * 2,\n            _ => 0\n        };\n\n        var result = o switch   // Compliant\n        {\n            int m => 42,        // Noncompliant - m declared but not used in arm\n            _ => 0\n        };\n        Console.WriteLine(result);\n\n        var value = o switch    // Compliant\n        {\n            int k => k * 2,     // Compliant - k used in arm\n            _ => 0\n        };\n        Console.WriteLine(value);\n    }\n}\n\n[AttributeUsage(AttributeTargets.Parameter)]\npublic class MaxValueAttribute(int max) : Attribute { }\n\npublic class ConstInLambdaParameterAttribute\n{\n    public void Method()\n    {\n        const int limit = 5;\n        Action<int> action = ([MaxValue(limit)] int x) => Console.WriteLine(x); // Compliant - limit referenced in lambda parameter attribute\n        action(1);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/VariableUnused.TopLevelStatements.cs",
    "content": "﻿using System;\n\nstring unusedString = string.Empty; // Noncompliant\n\nC a = new(\"Foo\", \"1.0\");\nC b = new(\"Qux\", \"1.0\");\n\nPair unusedPair = new(a, b); // Noncompliant\n\nvoid ParentMethod() => Invoke(static (x, y) => x++);\n\nvoid ParentMethod2() => Invoke(static (x, y) =>\n{\n    int z = 0; // Noncompliant\n});\n\nvoid Invoke(Action<int, int> action) => action(1, 2);\n\nvoid DeclarationPattern()\n{\n    _ = new object() is object o; // Noncompliant\n}\n\nvoid PropertyPattern()\n{\n    _ = new object() is { } o; // Noncompliant\n}\n\nvoid PositionalPattern()\n{\n    _ = (1, 2) is (_, _) t; // Noncompliant\n}\n\nvoid VarPattern()\n{\n    _ = new object() is var o; // Noncompliant\n}\n\nvoid ParenthesizedDesignation()\n{\n    _ = (1, 2) is var (bar, _); // Noncompliant\n}\n\nrecord C(string Foo, string Bar);\n\nrecord Pair(C A, C B);\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/VariableUnused.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing A;\nusing B;\n\nnamespace Tests.Diagnostics\n{\n    public class VariableUnused\n    {\n        void LinqRangeVariables()\n        {\n            var byteArray = new byte[10];\n\n            _ = from a in byteArray //Compliant\n                let b = a / 2\n                let c = b + a\n                group c by c * b into g\n                join d in new object[0] on g equals d into f\n                select f into z\n                select z;\n\n            _ = from a in byteArray // Compliant\n                let b = a\n                let c = 1\n                group c by b into d\n                where d != null\n                let y = 2\n                let z = 1\n                orderby y\n                select z;\n\n            _ = from a in byteArray // Compliant\n                let b = a\n                let c = 1\n                let d = 8 * 12\n                let e = -13\n                select a * b + c - d / e;\n\n            _ = from a in byteArray                             //Noncompliant\n//                   ^\n                let b = true                                    //Noncompliant\n//                  ^\n                let c = false\n                group c by c into g\n                join d in new object[0] on g equals d into f    //Noncompliant\n//                                                         ^\n                select g into e                                 //Noncompliant\n//                            ^\n                select true;\n\n            var byteArrayB = new byte[10];\n\n            _ = from upper in byteArray\n                from lower in byteArrayB\n                let a = lower - 10\n                let b = upper - 10\n                let c = -10                     //Noncompliant\n                where upper != lower && lower > b\n                orderby a descending\n                select upper;\n\n            _ = from a in byteArray //Noncompliant\n                let b = 0\n                select b;\n\n            _ = from a in byteArray\n                let b = 0\n                where a != 0\n                select b;\n\n            _ = from a in byteArray\n                let b = 0\n                let c = 1   //Noncompliant\n                where a != 0\n                select b;\n\n            _ = from a in byteArray //Noncompliant\n                let b = 0\n                where b != 0\n                select b;\n\n            _ = from a in \"HELLO\"   //Noncompliant\n                let c = \"a\"\n                let b = c   //Noncompliant\n                let z = \"\"\n                where z is null\n                let x = false\n                group x by x into w //Noncompliant\n                let p = \"p\"\n                orderby p descending\n                select p;\n\n            //Nested subquery\n            _ = from a in \"HELLO\"\n                let b = \"a\"\n                group a by b into c\n                select new\n                {\n                    Key = c.Key,\n                    Value =\n                        from z in c //Noncompliant\n                        select \"1\"\n                };\n            // join range variable (JoinClause without 'into') is also tracked\n            _ = from a in byteArray\n                join b in new byte[0] on a equals (byte)0  // Noncompliant {{Remove the unused local variable 'b'.}}\n                select a;\n\n            _ = from a in byteArray\n                join b in new byte[0] on a equals (byte)0  // Compliant\n                select b;\n\n            _ = from _ in byteArray // Compliant, don't report on discard like variables\n                select 1;\n        }\n\n        void F1()\n        {\n            var packageA = DoSomething(\"Foo\", \"1.0\");\n            var packageB = DoSomething(\"Qux\", \"1.0\");\n\n            var localRepository = new Cl { packageA, packageB }; // Noncompliant\n//              ^^^^^^^^^^^^^^^\n\n            using (var x = new StreamReader(\"\")) // Compliant\n            {\n                var v = 5; // Noncompliant {{Remove the unused local variable 'v'.}}\n            }\n\n            int a; // Noncompliant\n            var b = (Action<int>)(\n                _ =>\n                {\n                    int i; // Noncompliant\n                    int j = 42;\n                    Console.WriteLine(\"Hello, world!\" + j);\n                });\n\n            b(5);\n\n            Action notUsed = () => // Noncompliant\n            {\n                Console.WriteLine(\"Hello world.\");\n            };\n\n            _ = 3;\n\n            string c;\n            c = \"Hello, world!\";\n            Console.WriteLine(c);\n\n            string f1 = \"Hello\"; // Noncompliant\n\n            var d = \"\";\n            var e = new List<String> { d };\n            Console.WriteLine(e);\n\n            string f;\n            f = \"something\"; // Compliant, S1854 (Deadstores) reports on this.\n        }\n\n        private object DoSomething(string foo, string p1)\n        {\n            throw new NotImplementedException();\n        }\n\n        void F2(int a)\n        {\n            var _ = 1; // Compliant, don't report on discard like variables\n        }\n\n        void Bar(out string a)\n        {\n            a = \"1\";\n        }\n\n        void F3()\n        {\n            var (_, b) = (1, 2); // Noncompliant\n            //      ^\n\n            Bar(out _);\n        }\n    }\n\n    internal class Cl : List<object>\n    {\n    }\n\n    public class Lambdas\n    {\n        public void Foo(List<int> list)\n        {\n            list.Select(item => 1);\n\n            list.Select(item =>\n                {\n                    var value = 1; // Noncompliant\n                    return item;\n                });\n        }\n    }\n\n    public class WithLocalFunctions\n    {\n        public void Method()\n        {\n            void Foo(List<int> list)\n            {\n                list.Select(item => 1);\n\n                list.Select(item =>\n                {\n                    var value = 1; // Noncompliant\n                    return item;\n                });\n            }\n        }\n    }\n\n    public class Tuples\n    {\n        public static (int foo, int bar) M(string text)\n        {\n            int b = int.Parse(text);\n            return (1, b);\n        }\n\n        public void UnusedTuple()\n        {\n            (int x, int y) t = (1, 2); // Noncompliant\n        }\n\n        public void UsedTuple()\n        {\n            (int x, int y) t = (1, 2);\n            Use(t);\n        }\n\n        private void Use((int, int) t) { }\n    }\n\n    public class CSharpSevenVariableDeclarations\n    {\n        public void Foo()\n        {\n\n            var x = \"hello\";\n            if (x is string s) // Noncompliant\n//                          ^\n            {\n                x += \":)\";\n            }\n\n            if (x is string t) // Compliant\n            {\n               t += \":)\";\n            }\n\n            Bar(out var b); // Noncompliant\n//                      ^\n            Bar(out var c); //Compliant\n            c++;\n\n            void Bar(out int num)\n            {\n                num = 42;\n            }\n            ref string refX = ref x; //Noncompliant\n//                     ^^^^\n            ref string refXX = ref x; //Compliant\n            refXX += \"1\";\n        }\n\n        public void SwitchStatements()\n        {\n            var o = new Shape();\n\n            switch (o)\n            {\n                case Circle c: //Noncompliant\n//                          ^\n                    break;\n                case Square s: //Compliant\n                    s.side = 10;\n                    break;\n                default:\n                    break;\n            }\n        }\n        public class Shape\n        {\n            public int A;\n        }\n\n        public class Square : Shape\n        {\n            public int side = 0;\n        }\n\n        public class Circle : Shape\n        {\n            public int radius = 0;\n        }\n    }\n\n    public class Loops\n    {\n        public void ForEach()\n        {\n            foreach (var unused in new int[] { 1, 2, 3 }) // Compliant\n            { }\n            foreach (var _ in new int[] { 1, 2, 3 })      // Compliant\n            { }\n        }\n\n        public void For()\n        {\n            for (var i = 0; ;) // Compliant\n            { }\n            for (var _ = 0; ;) // Compliant\n            { }\n        }\n\n        public void ForeachDeconstruction(IEnumerable<(int, int)> pairs)\n        {\n            foreach (var (a, b) in pairs) { }       // Noncompliant [issue1, issue2]\n            foreach (var (c, d) in pairs)           // Noncompliant\n            {\n                Console.WriteLine(c);\n            }\n            foreach (var (_, e) in pairs) { }       // Noncompliant\n            foreach (var (f, g) in pairs)           // Compliant\n            {\n                Console.WriteLine(f + g);\n            }\n        }\n    }\n\n    public class Shadowing\n    {\n        public void SequentialBlocks()\n        {\n            { var x = 1; }                                              // Noncompliant - x in second block must not suppress this\n            { var x = 2; Console.WriteLine(x); }\n        }\n\n        public void TwoLocalFunctions()\n        {\n            // Both local functions are in the same code block, so both x symbols are collected together.\n            // Using x in the second must not suppress the report for x in the first.\n            int Fn1() { var x = 1; return 0; }                         // Noncompliant\n            int Fn2() { var x = 2; return x; }                         // Compliant\n            _ = Fn1() + Fn2();\n        }\n    }\n\n    public class LocalConstants\n    {\n        public void Method()\n        {\n            const int unused = 5;   // Noncompliant\n            const int used = 5;\n            Console.WriteLine(used);\n        }\n    }\n\n    public class MultipleDeclarations\n    {\n        public void Method()\n        {\n            int first = 1, second = 2; // Noncompliant\n            Console.WriteLine(second);\n        }\n    }\n\n    public class AnonymousMethods\n    {\n        public void Method()\n        {\n            Action unused = delegate { };   // Noncompliant\n            Action used = delegate { };\n            used();\n\n            Action<int> outer = delegate (int n)  // Compliant\n            {\n                int inner = 42; // Noncompliant\n                Console.WriteLine(n.ToString());\n            };\n            outer(1);\n        }\n    }\n\n    public class NameofExpression\n    {\n        public void Method()\n        {\n            var x = 1;\n            Console.WriteLine(nameof(x)); // Compliant - nameof resolves the symbol\n        }\n    }\n}\n\npublic class TestWithAmbiguous\n{\n\n    public void SomeMethod()\n    {\n        var a = new Ambiguous();    // Noncompliant\n                                    // Error@-1 [CS0104]\n    }\n}\n\nnamespace A\n{\n    public class Ambiguous\n    { }\n}\n\nnamespace B\n{\n    public class Ambiguous\n    { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/VariableUnused.vb",
    "content": "﻿Imports System\nImports System.Collections\nImports System.Collections.Generic\nImports System.IO\nImports System.Linq\n\nNamespace Tests.Diagnostics\n    Public Class VariableUnused\n        Private Sub F1()\n            Dim packageA = DoSomething(\"Foo\", \"1.0\")\n            Dim packageB = DoSomething(\"Qux\", \"1.0\")\n            Dim localRepository = New Cl From { packageA, packageB }\n'               ^^^^^^^^^^^^^^^\n\n            Using x = New StreamReader(\"\")\n                Dim v = 5 ' Noncompliant {{Remove the unused local variable 'v'.}}\n            End Using\n\n            Dim a As Integer ' Noncompliant\n            Dim b = CType((Sub(__)\n                               Dim i As Integer ' Noncompliant\n                               Dim j As Integer = 42\n                               Console.WriteLine(\"Hello, world!\" & j)\n                           End Sub), Action(Of Integer))\n            b(5)\n            Dim c As String\n            c = \"Hello, world!\"\n            Console.WriteLine(c)\n            Dim d = \"\"\n            Dim e = New List(Of String) From {\n                d\n            }\n            Console.WriteLine(e)\n        End Sub\n\n        Private Function DoSomething(ByVal foo As String, ByVal p1 As String) As Object\n            Throw New NotImplementedException()\n        End Function\n\n        Private Sub F2(ByVal a As Integer)\n        End Sub\n    End Class\n\n    Friend Class Cl\n        Inherits List(Of Object)\n    End Class\n\n    Public Class Lambdas\n        Public Sub Foo(ByVal list As List(Of Integer))\n            list.[Select](Function(item) 1)\n            list.[Select](Function(item)\n                              Dim value = 1 ' Noncompliant\n                              Return item\n                          End Function)\n        End Sub\n    End Class\n\n    Public Class LinqRangeVariables\n        Public Sub FromClause(ByVal coll As List(Of String))\n            ' x is the implicit output; no explicit Select means it is never referenced as an identifier — not a FP\n            Dim q1 = From x In coll\n            Console.WriteLine(q1.Count())\n        End Sub\n\n        Public Sub SelectNamedProjection(ByVal coll As List(Of String))\n            ' Name labels the output range variable in the Select clause; it is never referenced as an identifier — not a FP\n            Dim q2 = From x In coll Select Name = x.ToUpper()\n            Console.WriteLine(q2.Count())\n        End Sub\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/VirtualEventField.Fixed.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public class VirtualEventField\n    {\n        public event EventHandler OnRefueled; // Fixed\n\n        public virtual event EventHandler Foo\n        {\n            add\n            {\n                Console.WriteLine(\"Base Foo.add called\");\n            }\n            remove\n            {\n                Console.WriteLine(\"Base Foo.remove called\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/VirtualEventField.Latest.Fixed.cs",
    "content": "﻿using System;\n\npublic record VirtualEventField\n{\n    public event EventHandler OnRefueled; // Fixed\n\n    public virtual event EventHandler Foo\n    {\n        add { Console.WriteLine(\"Base Foo.add called\"); }\n        remove { Console.WriteLine(\"Base Foo.remove called\"); }\n    }\n}\n\npublic interface IVirtualEvent\n{\n    public static event EventHandler OnRefueled; // Fixed\n}\n\npublic partial class PartialEvents\n{\n    public partial event EventHandler Compliant; // Compliant, a partial event cannot be virtual\n    public partial event EventHandler BadEvent; // Fixed\n                                                            // Error@-1 [CS0621]\n                                                            // Error@-2 [CS1585]\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/VirtualEventField.Latest.Partial.cs",
    "content": "﻿using System;\n\npublic partial class PartialEvents\n{\n    public partial event EventHandler Compliant { add { } remove { } }\n    public partial virtual event EventHandler BadEvent { add { } remove { } }   // Error [CS1585]\n                                                                                    // Error@-1 [CS0102]\n                                                                                    // Error@-2 [CS0621]\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/VirtualEventField.Latest.cs",
    "content": "﻿using System;\n\npublic record VirtualEventField\n{\n    public virtual event EventHandler OnRefueled; // Noncompliant {{Remove this 'virtual' modifier of 'OnRefueled'.}}\n//         ^^^^^^^\n\n    public virtual event EventHandler Foo\n    {\n        add { Console.WriteLine(\"Base Foo.add called\"); }\n        remove { Console.WriteLine(\"Base Foo.remove called\"); }\n    }\n}\n\npublic interface IVirtualEvent\n{\n    public static virtual event EventHandler OnRefueled; // Noncompliant {{Remove this 'virtual' modifier of 'OnRefueled'.}}\n}\n\npublic partial class PartialEvents\n{\n    public partial event EventHandler Compliant; // Compliant, a partial event cannot be virtual\n    public partial virtual event EventHandler BadEvent; // Noncompliant\n                                                            // Error@-1 [CS0621]\n                                                            // Error@-2 [CS1585]\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/VirtualEventField.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    public class VirtualEventField\n    {\n        public virtual event EventHandler OnRefueled; // Noncompliant {{Remove this 'virtual' modifier of 'OnRefueled'.}}\n//             ^^^^^^^\n\n        public virtual event EventHandler Foo\n        {\n            add\n            {\n                Console.WriteLine(\"Base Foo.add called\");\n            }\n            remove\n            {\n                Console.WriteLine(\"Base Foo.remove called\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WcfMissingContractAttribute.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Tests.Diagnostics\n{\n    [System.ServiceModel.ServiceContract]\n    interface IMyService1\n    {\n        [System.ServiceModel.OperationContract]\n        int MyServiceMethod();\n        int MyServiceMethod2();\n    }\n\n    [System.ServiceModel.ServiceContract]\n    interface IMyService2 // Noncompliant {{Add the 'OperationContract' attribute to the methods of this interface.}}\n//            ^^^^^^^^^^^\n    {\n        int MyServiceMethod();\n    }\n\n    class IMyService3 // Noncompliant {{Add the 'ServiceContract' attribute to  this class.}}\n    {\n        [System.ServiceModel.OperationContract]\n        int MyServiceMethod() { return 1; }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WcfNonVoidOneWay.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.ServiceModel;\n\nnamespace Tests.Diagnostics\n{\n    public class MyAttribute : Attribute\n    {\n        public bool IsOneWay { get; set; }\n    }\n\n    [ServiceContract]\n    interface IMyService1\n    {\n        [OperationContract]\n        int MyServiceMethod();\n\n        [OperationContract(IsOneWay = true)]\n        int MyServiceMethod2(); // Noncompliant {{This method can't return any values because it is marked as one-way operation.}}\n//      ^^^\n\n        [OperationContract(IsOneWay = false)]\n        int MyServiceMethod3();\n\n        [OperationContract(IsTerminating = true)]\n        [My(IsOneWay = true)]\n        int MyServiceMethod4();\n\n        [OperationContract(IsOneWay = \"mistake\")] // Error [CS0029] - Cannot implicitly convert type 'string' to 'bool' not expected on\n        int MyServiceMethod5();\n\n        [OperationContract(IsOneWay = true, AsyncPattern = true)]\n        IAsyncResult BeginMyServiceMethod6();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WcfNonVoidOneWay.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.ServiceModel\n\nNamespace Tests.Diagnostics\n    Public Class MyAttribute\n        Inherits Attribute\n\n        Public Property isOneWay As Boolean\n    End Class\n\n    <ServiceContract>\n    Interface IMyService1\n        <OperationContract>\n        Function MyServiceMethod() As Integer\n\n        <OperationContract(IsOneWay:=True)>\n        Function MyServiceMethod2() As Integer ' Noncompliant {{This method can't return any values because it is marked as one-way operation.}}\n'                                      ^^^^^^^\n\n        <OperationContract(IsOneWay:=False)>\n        Function MyServiceMethod3() As String\n\n        <OperationContract(IsTerminating:=True)>\n        <My(IsOneWay:=True)>\n        Function MyServiceMethod4() As Integer\n\n        ' Error@+1 [BC30934] - Conversion from 'String' to 'Boolean' cannot occur in a constant expression used as an argument to an attribute.\n        <OperationContract(Action:=\"Action\", IsOneWay:=\"mistake\")>\n        Function MyServiceMethod5() As Integer\n\n        <OperationContract(IsOneWay:=True, AsyncPattern:=True)>\n        Function BeginMyServiceMethod6() As IAsyncResult\n    End Interface\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WeakSslTlsProtocols.CSharp12.cs",
    "content": "﻿using System.Net;\n\nclass WeakSslTlsProtocols(SecurityProtocolType classParam = SecurityProtocolType.Ssl3) // Noncompliant\n{\n    void SecurityProtocolTypeNonComplaint(SecurityProtocolType methodParam = SecurityProtocolType.Ssl3) // Noncompliant\n    {\n        var lambda = (SecurityProtocolType lambdaParam = SecurityProtocolType.Ssl3) => lambdaParam; // Noncompliant\n    }\n}\n\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WeakSslTlsProtocols.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Net;\nusing System.Net.Http;\nusing System.Net.Security;\nusing System.Net.Sockets;\nusing System.Security.Authentication;\n\nnamespace Tests.Diagnostics\n{\n    public class WeakSslTlsProtocols\n    {\n        public void SecurityProtocolTypeNonComplaint()\n        {\n            ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3; // Noncompliant {{Change this code to use a stronger protocol.}}\n//                                                                      ^^^^\n\n            ServicePointManager.SecurityProtocol = ~((SecurityProtocolType.Ssl3)) | SecurityProtocolType.Tls12 | SecurityProtocolType.Tls; // Noncompliant {{Change this code to use a stronger protocol.}}\n//                                                                                                                                    ^^^\n\n            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls; // Noncompliant {{Change this code to use a stronger protocol.}}\n//                                                                      ^^^\n\n            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11; // Noncompliant {{Change this code to use a stronger protocol.}}\n//                                                                      ^^^^^\n\n            ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls12; // Noncompliant {{Change this code to use a stronger protocol.}}\n//                                                                      ^^^^\n\n            ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls11; // Noncompliant {{Change this code to use a stronger protocol.}}\n//                                                                       ^^^^^\n\n            var securityProtocol = SecurityProtocolType.Tls; // Noncompliant {{Change this code to use a stronger protocol.}}\n//                                                      ^^^\n            ServicePointManager.SecurityProtocol = securityProtocol;\n        }\n\n        public void SslProtocolsNonComplaint()\n        {\n            var handler = new HttpClientHandler\n            {\n                SslProtocols = SslProtocols.Ssl2 // Noncompliant {{Change this code to use a stronger protocol.}}\n//                                          ^^^^\n            };\n\n            handler = new HttpClientHandler\n            {\n                SslProtocols = SslProtocols.Ssl3 // Noncompliant {{Change this code to use a stronger protocol.}}\n//                                          ^^^^\n            };\n\n            handler = new HttpClientHandler\n            {\n                SslProtocols = SslProtocols.Default // Noncompliant {{Change this code to use a stronger protocol.}}\n//                                          ^^^^^^^\n            };\n\n            handler = new HttpClientHandler\n            {\n                SslProtocols = SslProtocols.Tls // Noncompliant {{Change this code to use a stronger protocol.}}\n//                                          ^^^\n            };\n\n            handler = new HttpClientHandler\n            {\n                SslProtocols = SslProtocols.Tls11 // Noncompliant {{Change this code to use a stronger protocol.}}\n//                                          ^^^^^\n            };\n\n            handler.SslProtocols |= SslProtocols.Default; // Noncompliant {{Change this code to use a stronger protocol.}}\n//                                               ^^^^^^^\n\n            using var client = new TcpClient(\"tls-v1-0.badssl.com\", 1010);\n            var sslStream = new SslStream(client.GetStream(), false, null, null);\n\n            sslStream.AuthenticateAsClient(\"tls-v1-0.badssl.com\", null, SslProtocols.Tls, true); // Noncompliant {{Change this code to use a stronger protocol.}}\n//                                                                                   ^^^\n\n            sslStream.AuthenticateAsClientAsync(\"tls-v1-0.badssl.com\", null, SslProtocols.Tls, true); // Noncompliant {{Change this code to use a stronger protocol.}}\n//                                                                                        ^^^\n\n            sslStream.AuthenticateAsServer(null, true, SslProtocols.Tls, true); // Noncompliant {{Change this code to use a stronger protocol.}}\n//                                                                  ^^^\n\n            sslStream.AuthenticateAsServerAsync(null, true, SslProtocols.Tls, true); // Noncompliant {{Change this code to use a stronger protocol.}}\n//                                                                       ^^^\n\n            sslStream.BeginAuthenticateAsClient(\"tls-v1-0.badssl.com\", null, SslProtocols.Tls, true, null, null); // Noncompliant {{Change this code to use a stronger protocol.}}\n//                                                                                        ^^^\n\n            sslStream.BeginAuthenticateAsServer(null, true, SslProtocols.Tls, true, null, null); // Noncompliant {{Change this code to use a stronger protocol.}}\n//                                                                       ^^^\n\n            SslProtocols[] protocols = new[]\n            {\n                SslProtocols.Default, // Noncompliant\n//                           ^^^^^^^\n                SslProtocols.None\n            };\n\n            var listExample = new List<SslProtocols>()\n            {\n                SslProtocols.Default, // Noncompliant\n//                           ^^^^^^^\n                SslProtocols.None\n            };\n\n            Dictionary<SslProtocols, bool> shouldUseProtocol = new Dictionary<SslProtocols, bool>()\n            {\n                { SslProtocols.Default, false },  // NonCompliant\n//                             ^^^^^^^\n\n                { SslProtocols.None, true }\n            };\n\n            var numbers = new Dictionary<SslProtocols, string>\n            {\n                [SslProtocols.None] = \"None\",\n                [SslProtocols.Default] = \"Default\", // Noncompliant\n//                            ^^^^^^^\n            };\n        }\n\n        private class Dummy1\n        {\n            public Dummy1() : this(SslProtocols.Default) // Noncompliant\n//                                              ^^^^^^^\n            {\n\n            }\n\n            public Dummy1(SslProtocols protocol)\n            {\n\n            }\n        }\n\n        private class Dummy2 : Dummy1\n        {\n            public Dummy2() : base(SslProtocols.Default) // Noncompliant\n    //                                          ^^^^^^^\n            {\n\n            }\n        }\n\n        public void SecurityProtocolTypeCompliant()\n        {\n            ServicePointManager.SecurityProtocol = SecurityProtocolType.SystemDefault; // Compliant\n            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; // Compliant\n            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls13; // Compliant\n\n            ServicePointManager.SecurityProtocol = ~((SecurityProtocolType.Ssl3)); // Compliant\n            ServicePointManager.SecurityProtocol = ~SecurityProtocolType.Ssl3; // Compliant\n        }\n\n        public void SslProtocolsCompliant()\n        {\n            var handler = new HttpClientHandler\n            {\n                SslProtocols = SslProtocols.Tls13 // Compliant\n            };\n\n            handler = new HttpClientHandler\n            {\n                SslProtocols = SslProtocols.None // Compliant\n            };\n\n            handler.SslProtocols = SslProtocols.Tls12; // Compliant\n\n            var sslProtocol = SslProtocols.None;\n\n            if (sslProtocol != SslProtocols.Default) { } // Compliant\n\n            while (sslProtocol != SslProtocols.Default) { }  // Compliant\n\n            var protocol = SslProtocols.None;\n            bool isSafe = protocol == SslProtocols.Tls ? true : false; // Compliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WeakSslTlsProtocols.vb",
    "content": "﻿Imports System\nImports System.Collections.Generic\nImports System.Linq\nImports System.Text\nImports System.Net\nImports System.Net.Http\nImports System.Net.Security\nImports System.Net.Sockets\nImports System.Security.Authentication\n\nNamespace Tests.Diagnostics\n    Public Class WeakSslTlsProtocols\n\n        Public Sub SecurityProtocolTypeNonComplaint()\n            ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 ' Noncompliant {{Change this code to use a stronger protocol.}}\n'                                                                       ^^^^\n\n            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls ' Noncompliant {{Change this code to use a stronger protocol.}}\n'                                                                       ^^^\n\n            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11 ' Noncompliant {{Change this code to use a stronger protocol.}}\n'                                                                       ^^^^^\n\n            ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 Or SecurityProtocolType.Tls12 ' Noncompliant {{Change this code to use a stronger protocol.}}\n'                                                                       ^^^^\n            Dim securityProtocol = SecurityProtocolType.Tls ' Noncompliant {{Change this code to use a stronger protocol.}}\n'                                                       ^^^\n            ServicePointManager.SecurityProtocol = securityProtocol\n        End Sub\n\n        Public Sub SslProtocolsNonComplaint()\n            Dim HttpHandler As New HttpClientHandler With { .SslProtocols = SslProtocols.Ssl2 } ' Noncompliant {{Change this code to use a stronger protocol.}}\n'                                                                                        ^^^^\n\n            HttpHandler.SslProtocols = SslProtocols.Ssl3 ' Noncompliant {{Change this code to use a stronger protocol.}}\n'                                                   ^^^^\n\n            HttpHandler.SslProtocols = SslProtocols.Tls ' Noncompliant {{Change this code to use a stronger protocol.}}\n'                                                   ^^^\n\n            HttpHandler.SslProtocols = SslProtocols.Default ' Noncompliant {{Change this code to use a stronger protocol.}}\n'                                                   ^^^^^^^\n\n            HttpHandler.SslProtocols = SslProtocols.Tls11 ' Noncompliant {{Change this code to use a stronger protocol.}}\n'                                                   ^^^^^\n\n            Dim client As TcpClient = New TcpClient(\"tls-v1-0.badssl.com\", 1010)\n            Dim sslStream = new SslStream(client.GetStream(), false)\n\n            sslStream.AuthenticateAsClient(\"tls-v1-0.badssl.com\", Nothing, SslProtocols.Tls, true) ' Noncompliant {{Change this code to use a stronger protocol.}}\n'                                                                                       ^^^\n\n            sslStream.AuthenticateAsClientAsync(\"tls-v1-0.badssl.com\", Nothing, SslProtocols.Tls, true) ' Noncompliant {{Change this code to use a stronger protocol.}}\n'                                                                                            ^^^\n\n            sslStream.AuthenticateAsServer(Nothing, true, SslProtocols.Tls, true) ' Noncompliant {{Change this code to use a stronger protocol.}}\n'                                                                      ^^^\n\n            sslStream.AuthenticateAsServerAsync(Nothing, true, SslProtocols.Tls, true) ' Noncompliant {{Change this code to use a stronger protocol.}}\n'                                                                           ^^^\n\n            sslStream.BeginAuthenticateAsClient(\"tls-v1-0.badssl.com\", Nothing, SslProtocols.Tls, true, Nothing, Nothing) ' Noncompliant {{Change this code to use a stronger protocol.}}\n'                                                                                            ^^^\n\n            sslStream.BeginAuthenticateAsServer(Nothing, true, SslProtocols.Tls, true, Nothing, Nothing) ' Noncompliant {{Change this code to use a stronger protocol.}}\n'                                                                           ^^^\n        \n            Dim protocols = New SslProtocols() {SslProtocols.None, SslProtocols.Default } ' Noncompliant\n'                                                                               ^^^^^^^\n        End Sub\n\n        Private Class Dummy1\n\n            Sub New()\n                Me.New(SslProtocols.Default) ' Noncompliant\n'                                   ^^^^^^^\n            End Sub\n\n            Sub New(protocol As SslProtocols)\n\n            End Sub\n\n        End Class\n\n        Private Class Dumym2\n            Inherits Dummy1\n\n            Sub New()\n                MyBase.New(SslProtocols.Default) ' Noncompliant\n'                                       ^^^^^^^\n            End Sub\n\n        End Class\n\n        Public Sub SecurityProtocolTypeCompliant()\n            ServicePointManager.SecurityProtocol = SecurityProtocolType.SystemDefault ' Compliant\n            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 ' Compliant\n            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls13 ' Compliant\n        End Sub\n\n        Public Sub SslProtocolsCompliant()\n            Dim HttpHandler As New HttpClientHandler With { .SslProtocols = SslProtocols.Tls13 } ' Compliant\n\n            HttpHandler.SslProtocols = SslProtocols.Tls12 ' Compliant\n\n            HttpHandler.SslProtocols = SslProtocols.None ' Compliant\n\n            Dim protocols = SslProtocols.None ' Compliant\n\n            if protocols <> SslProtocols.Default Then ' Compliant\n\n            End If\n        End Sub\n\n    End Class\nEnd Namespace\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/CookieShouldBeHttpOnly/ConfigWithoutAttribute/Web.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <system.web>\n    <compilation debug=\"true\" targetFramework=\"4.8\" />\n    <httpRuntime targetFramework=\"4.8\" />\n    <httpCookies />\n  </system.web>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/CookieShouldBeHttpOnly/Formatting/Web.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <system.web>\n    <compilation debug=\"true\" targetFramework=\"4.8\" />\n    <httpRuntime targetFramework=\"4.8\" />\n    <httpCookies\n\n      httpOnlyCookies\n\n      =\n\n      \"true\"\n      requireSSL = \"false\" />\n  </system.web>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/CookieShouldBeHttpOnly/HttpOnlyCookiesConfig/Web.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <system.web>\n    <compilation debug=\"true\" targetFramework=\"4.8\" />\n    <httpRuntime targetFramework=\"4.8\" />\n    <httpCookies httpOnlyCookies=\"true\" requireSSL=\"false\" />\n  </system.web>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/CookieShouldBeHttpOnly/NonHttpOnlyCookiesConfig/Web.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <system.web>\n    <compilation debug=\"true\" targetFramework=\"4.8\" />\n    <httpRuntime targetFramework=\"4.8\" />\n    <httpCookies httpOnlyCookies=\"false\" requireSSL=\"true\" />\n  </system.web>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/CookieShouldBeHttpOnly/UnrelatedConfig/Web.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/CookieShouldBeSecure/ConfigWithoutAttribute/Web.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <system.web>\n    <compilation debug=\"true\" targetFramework=\"4.8\" />\n    <httpRuntime targetFramework=\"4.8\" />\n    <httpCookies />\n  </system.web>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/CookieShouldBeSecure/Formatting/Web.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <system.web>\n    <compilation debug=\"true\" targetFramework=\"4.8\" />\n    <httpRuntime targetFramework=\"4.8\" />\n    <httpCookies\n\n      requireSSL\n\n      =\n\n      \"true\"\n      httpOnlyCookies = \"false\" />\n  </system.web>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/CookieShouldBeSecure/NonSecureCookieConfig/Web.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <system.web>\n    <compilation debug=\"true\" targetFramework=\"4.8\" />\n    <httpRuntime targetFramework=\"4.8\" />\n    <httpCookies requireSSL=\"false\" httpOnlyCookies=\"true\" />\n  </system.web>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/CookieShouldBeSecure/SecureCookieConfig/Web.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <system.web>\n    <compilation debug=\"true\" targetFramework=\"4.8\" />\n    <httpRuntime targetFramework=\"4.8\" />\n    <httpCookies requireSSL=\"true\" httpOnlyCookies=\"false\" />\n  </system.web>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/CookieShouldBeSecure/UnrelatedConfig/Web.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/DatabasePasswordsShouldBeSecure/Corrupt/Web.config",
    "content": "﻿<?xml version=\"1.0\" enc\n\n  <!-- needed for code coverage-->\n  <<<<<<<<<<<<<<<<<<<<<\n  <configuration>\n    <connectionStrings>\n      <add name=\"myConnection\" connectionString=\"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=\" />\n    </connectionStrings>\n  </configura>"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/DatabasePasswordsShouldBeSecure/ExternalConfig/Web.config",
    "content": "﻿<?xml version='1.0' encoding='utf-8'?>\n<configuration>\n  <connectionStrings configSource=\"external.config\"/>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/DatabasePasswordsShouldBeSecure/ExternalConfig/external.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <connectionStrings>\n    <add name=\"Name\"\n     providerName=\"System.Data.ProviderName\"\n     connectionString=\"Valid Connection String;\" />\n    <add name=\"Name\"\n     providerName=\"System.Data.ProviderName\"\n     connectionString=\"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=\" /> <!-- FN -->\n  </connectionStrings>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/DatabasePasswordsShouldBeSecure/Formatting/Web.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <connectionStrings>\n    <add\n      name=\"myConnection1\"\n      connectionString=\"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=\" />  <!-- Noncompliant -->\n<!--  ^^^^^^^^^^^^^^^^ -->\n\n    <add name=\"myConnection2\"\n        connectionString\n         =\n         \"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=\"\n     />\n    <!-- Noncompliant@-4 -->\n  </connectionStrings>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/DatabasePasswordsShouldBeSecure/UnexpectedContent/Web.config",
    "content": "﻿<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.mycompany.app</groupId>\n  <artifactId>my-app</artifactId>\n  <version>1.0-SNAPSHOT</version>\n\n</project>"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/DatabasePasswordsShouldBeSecure/Values/Web.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <connectionStrings>\n    <clear />\n    <add name=\"myConnection1\" connectionString=\"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=\" /> <!-- Noncompliant {{Use a secure password when connecting to this database.}} -->\n    <add name=\"myConnection2\" connectionString=\"PASSWORD=\" /> <!-- FN -->\n    <add name=\"myConnection3\" connectionString=\"Password=\" /> <!-- Noncompliant {{Use a secure password when connecting to this database.}} -->\n    <add name=\"myConnection4\" connectionString=\"Server=myServerAddress;Database=myDataBase;Integrated Security=True\" />\n    <add name=\"myConnection4\" connectionString=\"Server=myServerAddress;Database=myDataBase;Password=;Integrated Security=True\" />\n    <add name=\"CompliantNoPassword\" connectionString=\"Server=myServerAddress;Database=myDataBase;Trusted_Connection=True\" />\n    <add name=\"CompliantTrustedConnectionTrue\" connectionString=\"Server=myServerAddress;Database=myDataBase;Password=;Trusted Connection=True\" />\n    <add name=\"CompliantIntegratedSecurityTrue\" connectionString=\"Server=myServerAddress;Database=myDataBase;Password=;Integrated Security=true\" />\n    <add name=\"CompliantTrustedConnectionYes\" connectionString=\"Server=myServerAddress;Database=myDataBase;Password=;Trusted Connection=Yes\" />\n    <add name=\"CompliantIntegratedSecurityYes\" connectionString=\"Server=myServerAddress;Database=myDataBase;Password=;Integrated Security=yes\" />\n    <add name=\"CompliantIntegratedSecuritySSPI\" connectionString=\"Server=myServerAddress;Database=myDataBase;Password=;Integrated Security=SSPI\" />\n    <add name=\"CompliantTrusted_ConnectionTrue\" connectionString=\"Server=myServerAddress;Database=myDataBase;Password=;Trusted_Connection=True\" />\n    <add name=\"CompliantIntegrated_SecurityTrue\" connectionString=\"Server=myServerAddress;Database=myDataBase;Password=;Integrated_Security=true\" />\n    <add name=\"CompliantTrusted_ConnectionYes\" connectionString=\"Server=myServerAddress;Database=myDataBase;Password=;Trusted_Connection=Yes\" />\n    <add name=\"CompliantIntegrated_SecurityYes\" connectionString=\"Server=myServerAddress;Database=myDataBase;Password=;Integrated_Security=yes\" />\n    <add name=\"CompliantIntegrated_SecuritySSPI\" connectionString=\"Server=myServerAddress;Database=myDataBase;Password=;Integrated_Security=sspi\" />\n    <add name=\"CompliantForS2115_NoncompliantForS2068\" connectionString=\"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=myPassword\" />\n    <!--for coverage-->\n    <add name=\"Name\" providerName=\"System.Data.ProviderName\" />\n  </connectionStrings>\n  <connectionStrings configProtectionProvider=\"RsaProtectedConfigurationProvider\">\n    <!-- ASP.NET 2.0 -->\n    <EncryptedData>\n      <CipherData>\n        <CipherValue>AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAH2</CipherValue>\n      </CipherData>\n    </EncryptedData>\n  </connectionStrings>\n  <configProtectedData defaultProvider=\"RsaProtectedConfigurationProvider\">\n    <providers>\n      <add name=\"RsaProtectedConfigurationProvider\"\n        type=\"System.Configuration.RsaProtectedConfigurationProvider\" />\n    </providers>\n  </configProtectedData>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/DisablingRequestValidation/Corrupt/Web.config",
    "content": "﻿<?xml version=\"1.0\" enc\n\n      <!-- needed for code coverage-->\n      <<<<<<<<<<<<<<<<<<<<<\n  <system.web>\n    <pages validateRequest=\"false\" />\n    <httpRuntime requestValidationMode=\"0.0\" />\n  </system.w"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/DisablingRequestValidation/EdgeValues/3.9/Web.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <system.web>\n    <compilation debug=\"true\" targetFramework=\"4.8\" />\n    <httpRuntime targetFramework=\"4.8\" />\n    <httpRuntime requestValidationMode=\"3.9\" /> <!--Noncompliant-->\n  </system.web>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/DisablingRequestValidation/EdgeValues/5.6/Web.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <system.web>\n    <httpRuntime requestValidationMode=\"5.6\" /> <!--ok-->\n  </system.web>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/DisablingRequestValidation/EdgeValues/Web.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <system.web>\n    <compilation debug=\"true\" targetFramework=\"4.8\" />\n    <httpRuntime targetFramework=\"4.8\" />\n    <pages validateRequest=\"FALSE\" /> <!-- Noncompliant {{Make sure disabling ASP.NET Request Validation feature is safe here.}} -->\n    <httpRuntime requestValidationMode=\"1.2\" /> <!--Noncompliant-->\n  </system.web>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/DisablingRequestValidation/Formatting/Web.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <system.web>\n    <pages\n      validateRequest=\"false\" />  <!-- Noncompliant -->\n<!--  ^^^^^^^^^^^^^^^ -->\n    <httpRuntime\n\n\n      requestValidationMode\n\n      =\n\n      \"0.0\"\n\n\n      />\n    <!-- Noncompliant@-8 -->\n  </system.web>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/DisablingRequestValidation/LowerCase/web.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <system.web>\n    <compilation debug=\"true\" targetFramework=\"4.8\" />\n    <httpRuntime targetFramework=\"4.8\" />\n    <pages validateRequest=\"false\" /> <!--Noncompliant-->\n    <httpRuntime requestValidationMode=\"4.5\" />\n  </system.web>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/DisablingRequestValidation/MultipleFiles/SubFolder/Web.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <system.web>\n    <compilation debug=\"true\" targetFramework=\"4.8\" />\n    <httpRuntime targetFramework=\"4.8\" />\n    <pages validateRequest=\"false\" /> <!--Noncompliant-->\n    <httpRuntime requestValidationMode=\"4.0\" />\n  </system.web>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/DisablingRequestValidation/MultipleFiles/Web.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <system.web>\n    <pages validateRequest=\"true\" />\n    <httpRuntime requestValidationMode=\"0.0\" /> <!-- Noncompliant {{Make sure disabling ASP.NET Request Validation feature is safe here.}} -->\n  </system.web>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/DisablingRequestValidation/TransformCustom/Web.Custom.config",
    "content": "﻿<?xml version=\"1.0\"?>\n<!-- For more information on using Web.config transformation visit https://go.microsoft.com/fwlink/?LinkId=301874 -->\n<configuration xmlns:xdt=\"http://schemas.microsoft.com/XML-Document-Transform\">\n  <system.web>\n    <pages xdt:Transform=\"Replace\" validateRequest=\"false\" /> <!-- Noncompliant {{Make sure disabling ASP.NET Request Validation feature is safe here.}} -->\n    <pages xdt:Transform=\"Replace\" validateRequest=\"true\" />  <!-- OK -->\n\n    <httpRuntime xdt:Transform=\"SetAttributes\" xdt:Locator=\"Match(targetFramework)\" targetFramework=\"4.8\" requestValidationMode=\"0.0\" />  <!--Noncompliant-->\n    <httpRuntime xdt:Transform=\"SetAttributes\" xdt:Locator=\"Match(targetFramework)\" targetFramework=\"4.8\" requestValidationMode=\"4.5\" />  <!-- OK -->\n  </system.web>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/DisablingRequestValidation/TransformDebug/Web.Debug.config",
    "content": "﻿<?xml version=\"1.0\"?>\n<!-- For more information on using Web.config transformation visit https://go.microsoft.com/fwlink/?LinkId=301874 -->\n<configuration xmlns:xdt=\"http://schemas.microsoft.com/XML-Document-Transform\">\n  <system.web>\n    <!-- This is compliant, because we ignore Debug file name Web.Debug.config-->\n    <pages xdt:Transform=\"Replace\" validateRequest=\"false\" />\n    <httpRuntime xdt:Transform=\"SetAttributes\" xdt:Locator=\"Match(targetFramework)\" targetFramework=\"4.8\" requestValidationMode=\"0.0\" />\n  </system.web>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/DisablingRequestValidation/TransformRelease/Web.Release.config",
    "content": "﻿<?xml version=\"1.0\"?>\n<!-- For more information on using Web.config transformation visit https://go.microsoft.com/fwlink/?LinkId=301874 -->\n<configuration xmlns:xdt=\"http://schemas.microsoft.com/XML-Document-Transform\">\n  <system.web>\n    <pages xdt:Transform=\"Replace\" validateRequest=\"false\" /> <!-- Noncompliant {{Make sure disabling ASP.NET Request Validation feature is safe here.}} -->\n    <pages xdt:Transform=\"Replace\" validateRequest=\"true\" />  <!-- OK -->\n\n    <httpRuntime xdt:Transform=\"SetAttributes\" xdt:Locator=\"Match(targetFramework)\" targetFramework=\"4.8\" requestValidationMode=\"0.0\" />  <!--Noncompliant-->\n    <httpRuntime xdt:Transform=\"SetAttributes\" xdt:Locator=\"Match(targetFramework)\" targetFramework=\"4.8\" requestValidationMode=\"4.5\" />  <!-- OK -->\n  </system.web>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/DisablingRequestValidation/UnexpectedContent/Web.config",
    "content": "﻿<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.mycompany.app</groupId>\n  <artifactId>my-app</artifactId>\n  <version>1.0-SNAPSHOT</version>\n\n</project>"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/DisablingRequestValidation/Values/Web.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  For more information on how to configure your ASP.NET application, please visit\n  https://go.microsoft.com/fwlink/?LinkId=301880\n  -->\n<configuration>\n  <appSettings>\n    <add key=\"webpages:Version\" value=\"3.0.0.0\" />\n    <add key=\"webpages:Enabled\" value=\"false\" />\n    <add key=\"ClientValidationEnabled\" value=\"true\" />\n    <add key=\"UnobtrusiveJavaScriptEnabled\" value=\"true\" />\n  </appSettings>\n  <system.web>\n    <compilation debug=\"true\" targetFramework=\"4.8\" />\n    <httpRuntime targetFramework=\"4.8\" />\n    <pages enableViewState=\"true\" />\n    <pages enableViewStateMac=\"true\" />\n    <pages validateRequest=\"false\" /> <!-- Noncompliant {{Make sure disabling ASP.NET Request Validation feature is safe here.}} -->\n<!--       ^^^^^^^^^^^^^^^ -->\n    <httpRuntime requestValidationMode=\"0.0\" /> <!-- Noncompliant {{Make sure disabling ASP.NET Request Validation feature is safe here.}} -->\n<!--             ^^^^^^^^^^^^^^^^^^^^^ -->\n  </system.web>\n  <runtime>\n    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.Web.Helpers\" publicKeyToken=\"31bf3856ad364e35\" />\n        <bindingRedirect oldVersion=\"1.0.0.0-3.0.0.0\" newVersion=\"3.0.0.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.Web.WebPages\" publicKeyToken=\"31bf3856ad364e35\" />\n        <bindingRedirect oldVersion=\"1.0.0.0-3.0.0.0\" newVersion=\"3.0.0.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.Web.Mvc\" publicKeyToken=\"31bf3856ad364e35\" />\n        <bindingRedirect oldVersion=\"1.0.0.0-5.2.7.0\" newVersion=\"5.2.7.0\" />\n      </dependentAssembly>\n    </assemblyBinding>\n  </runtime>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/DoNotHardcodeCredentials/Corrupt/Web.config",
    "content": "﻿<configuration>\n  <connectionStrings>\n    <add connectionString=\"Server=localhost; Database=Test; User=SA; Password=Secret123\"/>\n\n    <<< Corrupted, we don't raise here"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/DoNotHardcodeCredentials/UnexpectedContent/Web.config",
    "content": "﻿<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.mycompany.app</groupId>\n  <artifactId>my-app</artifactId>\n  <version>1.0-SNAPSHOT</version>\n\n</project>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/DoNotHardcodeCredentials/Valid/Web.Custom.config",
    "content": "<configuration>\n  <connectionStrings>\n    <add connectionString=\"Server=localhost; Database=Test; User=SA; Password=Secret123\"/>    <!-- Noncompliant {{\"password\" detected here, make sure this is not a hard-coded credential.}} -->\n  </connectionStrings>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/DoNotHardcodeCredentials/Valid/Web.Debug.config",
    "content": "<?xml version=\"1.0\"?>\n<configuration xmlns:xdt=\"http://schemas.microsoft.com/XML-Document-Transform\">\n  <connectionStrings xdt:Transform=\"Replace\">\n    <add connectionString=\"Server=localhost; Database=Test; User=SA; Password=Secret123\"/>  <!-- Compliant, we don't raise in this file -->\n  </connectionStrings>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/DoNotHardcodeCredentials/Valid/Web.Release.config",
    "content": "<?xml version=\"1.0\"?>\n<configuration xmlns:xdt=\"http://schemas.microsoft.com/XML-Document-Transform\">\n  <connectionStrings xdt:Transform=\"Replace\">\n    <add connectionString=\"Server=localhost; Database=Test; User=SA; Password=Secret123\"/>  <!-- Noncompliant {{\"password\" detected here, make sure this is not a hard-coded credential.}} -->\n  </connectionStrings>\n  <appSettings>\n    <add xdt:Transform=\"Replace\" key=\"Connection\" value=\"Server=localhost; Database=Test; User=SA; Password=Secret123\"/>  <!-- Noncompliant -->\n  </appSettings>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/DoNotHardcodeCredentials/Valid/Web.config",
    "content": "<configuration>\n  <connectionStrings>\n    <clear />\n    <add />\n    <add name=\"bla\" />\n    <add connectionString=\"Server=localhost; Database=Test; User=SA; Password=Secret123\"/>    <!-- Noncompliant {{\"password\" detected here, make sure this is not a hard-coded credential.}} -->\n\n    <!--https://community.sonarsource.com/t/doubt-about-not-detected-hotspot-in-web-config-about-hardcoded-credentials/127100-->\n    <add connectionString=\"Server=localhost; Database=Test; User=SA; Password={Credentials.Password}\"/>    <!-- Noncompliant FP -->\n\n    <!-- Noncompliant@+2 -->\n    <add\n      connectionString\n      =\n      \"Server=localhost; Database=Test; User=SA; Password=Secret123\" />\n    <add >\n    </add>\n    <!--\n      Commented is not supported\n      <add connectionString=\"Server=localhost; Database=Test; User=SA; Password=Secret123\"/>\n    -->\n    <add name=\"a\" connectionString=\"Server=localhost; Database=Test; User=SA; Password=Secret123\"/> <!-- Noncompliant -->\n    <add name=\"a\" connectionString=\"Server=localhost; Database=Test; User=SA; Password=\"/>          <!-- Compliant, should not raise on empty passwords -->\n    <add name=\"a\" connectionString=\"Server=localhost; Database=Test; Integrated Security=True\"/>    <!-- Compliant -->\n    <!-- Noncompliant@+2 -->\n    <add name=\"EF6-with-quotes\"\n         connectionString=\"metadata=res://*/Northwind.csdl|res://*/Northwind.ssdl|res://*/Northwind.msl;\n                           provider=System.Data.SqlClient;\n                           provider connection string=\n                               &quot;Server=localhost; Database=Test;\n                                     User=SA;\n                                     Password=Secret123;\n                                     MultipleActiveResultSets=True&quot;\"\n         providerName=\"System.Data.EntityClient\"/>\n    <add name=\"EF6-singleline\" connectionString=\"metadata=res://*/Northwind.csdl;provider=System.Data.SqlClient;provider connection string=&quot;Server=localhost; Database=Test;User=SA;Password=Secret123&quot;\" providerName=\"System.Data.EntityClient\"/>  <!-- Noncompliant -->\n    <remove name=\"a\" />\n  </connectionStrings>\n  <appSettings>\n    <add key=\"Connection\" value=\"Server=localhost; Database=Test; User=SA; Password=Secret123\"/>    <!-- Noncompliant -->\n    <add key=\"SomeUrl\" value=\"scheme://user:azerty123@domain.com\" />                                <!-- Noncompliant {{Review this hard-coded URI, which may contain a credential.}}\" -->\n  </appSettings>\n  <location path=\"/subpath\">\n    <connectionStrings>\n      <add name=\"subpath\" connectionString=\"Server=localhost; Database=Test; User=SA; Password=Secret123\"/>   <!-- Noncompliant -->\n    </connectionStrings>\n  </location>\n  <CustomSection>\n    <CustomElement CustomAttribute=\"Password=42\" />     <!-- Noncompliant -->\n    <CustomElement>Password=Secret42</CustomElement>    <!-- Noncompliant -->\n    <Password>42</Password>                             <!-- Noncompliant -->\n    <Compliant>42</Compliant>\n  </CustomSection>\n  <Empty>\n    <Password></Password>                               <!-- Compliant, this rule doesn't look for empty passwords -->\n  </Empty>\n  <CustomNamespaces xmlns:xxx=\"http://dotnet.sonarsource.com\">\n    <xxx:Password>42</xxx:Password>                     <!-- Noncompliant -->\n    <Element xxx:CustomAttribute=\"Password=42\" />       <!-- Noncompliant -->\n  </CustomNamespaces>\n  <CustomNamespaces xmlns=\"http://dotnet.sonarsouce.com\">\n    <Password>42</Password>                             <!-- Noncompliant -->\n    <Element CustomAttribute=\"Password=42\" />           <!-- Noncompliant -->\n  </CustomNamespaces>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/DoNotHardcodeSecrets/Corrupt/Web.config",
    "content": "﻿<configuration>\n  <connectionStrings>\n    <add connectionString=\"Server=localhost; Database=Test; User=SA; Password=Secret123\"/>\n\n    <<< Corrupted, we don't raise here"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/DoNotHardcodeSecrets/UnexpectedContent/Web.config",
    "content": "﻿<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.mycompany.app</groupId>\n  <artifactId>my-app</artifactId>\n  <version>1.0-SNAPSHOT</version>\n\n</project>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/DoNotHardcodeSecrets/Valid/Web.Custom.config",
    "content": "<configuration>\n  <connectionStrings>\n    <add connectionString=\"Server=localhost; Database=Test; User=SA; AuthToken=rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\"/>    <!-- Noncompliant {{\"AuthToken\" detected here, make sure this is not a hard-coded secret.}} -->\n  </connectionStrings>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/DoNotHardcodeSecrets/Valid/Web.Debug.config",
    "content": "<?xml version=\"1.0\"?>\n<configuration xmlns:xdt=\"http://schemas.microsoft.com/XML-Document-Transform\">\n  <connectionStrings xdt:Transform=\"Replace\">\n    <add connectionString=\"Server=localhost; Database=Test; User=SA; AuthToken=rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\"/>  <!-- Compliant, we don't raise in this file -->\n  </connectionStrings>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/DoNotHardcodeSecrets/Valid/Web.Release.config",
    "content": "<?xml version=\"1.0\"?>\n<configuration xmlns:xdt=\"http://schemas.microsoft.com/XML-Document-Transform\">\n  <connectionStrings xdt:Transform=\"Replace\">\n    <add connectionString=\"Server=localhost; Database=Test; User=SA; AuthToken=rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\"/>  <!-- Noncompliant {{\"AuthToken\" detected here, make sure this is not a hard-coded secret.}} -->\n  </connectionStrings>\n  <appSettings>\n    <add xdt:Transform=\"Replace\" key=\"Connection\" value=\"Server=localhost; Database=Test; User=SA; AuthToken=rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\"/>  <!-- Noncompliant -->\n  </appSettings>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/DoNotHardcodeSecrets/Valid/Web.config",
    "content": "<configuration>\n  <connectionStrings>\n    <clear />\n    <add />\n    <add name=\"bla\" />\n    <add connectionString=\"Server=localhost; Database=Test; User=SA; AuthToken=rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\"/> <!-- Noncompliant {{\"AuthToken\" detected here, make sure this is not a hard-coded secret.}} -->\n    <!-- Noncompliant@+2 -->\n    <add\n      connectionString\n      =\n      \"Server=localhost; Database=Test; User=SA; AuthToken=rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\" />\n    <add >\n    </add>\n    <!--\n      Commented is not supported\n      <add connectionString=\"Server=localhost; Database=Test; User=SA; AuthToken=rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\"/>\n    -->\n    <add name=\"a\" connectionString=\"Server=localhost; Database=Test; User=SA; AuthToken=rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\"/> <!-- Noncompliant -->\n    <add name=\"a\" connectionString=\"Server=localhost; Database=Test; User=SA; AuthToken:rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\"/> <!-- Noncompliant -->\n    <add name=\"a\" connectionString=\"Server=localhost; Database=Test; User=SA; AuthToken=\"/> <!-- Compliant, should not raise on empty passwords -->\n    <add name=\"a\" connectionString=\"Server=localhost; Database=Test; Integrated Security=True\"/> <!-- Compliant -->\n    <!-- Noncompliant@+2 -->\n    <add name=\"EF6-with-quotes\"\n         connectionString=\"metadata=res://*/Northwind.csdl|res://*/Northwind.ssdl|res://*/Northwind.msl;\n                           provider=System.Data.SqlClient;\n                           provider connection string=\n                               &quot;Server=localhost; Database=Test;\n                                     User=SA;\n                                     AuthToken=rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y;\n                                     MultipleActiveResultSets=True&quot;\"\n         providerName=\"System.Data.EntityClient\"/>\n    <add name=\"EF6-singleline\" connectionString=\"metadata=res://*/Northwind.csdl;provider=System.Data.SqlClient;provider connection string=&quot;Server=localhost; Database=Test;User=SA;AuthToken=rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y&quot;\" providerName=\"System.Data.EntityClient\"/> <!-- Noncompliant -->\n    <remove name=\"a\" />\n  </connectionStrings>\n  <appSettings>\n    <add key=\"Connection\" value=\"Server=localhost; Database=Test; User=SA; AuthToken=rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\"/> <!-- Noncompliant -->\n  </appSettings>\n  <location path=\"/subpath\">\n    <connectionStrings>\n      <add name=\"subpath\" connectionString=\"Server=localhost; Database=Test; User=SA; AuthToken=rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\"/> <!-- Noncompliant -->\n    </connectionStrings>\n  </location>\n  <CustomSection>\n    <CustomElement CustomAttribute=\"AuthToken=rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\" /> <!-- Noncompliant -->\n    <CustomElement>AuthToken=rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y</CustomElement> <!-- Noncompliant -->\n    <AuthToken>rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y</AuthToken> <!-- Noncompliant -->\n    <Compliant>rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y</Compliant>\n  </CustomSection>\n  <Empty>\n    <AuthToken></AuthToken> <!-- Compliant, this rule doesn't look for empty passwords -->\n  </Empty>\n  <CustomNamespaces xmlns:xxx=\"http://dotnet.sonarsource.com\">\n    <xxx:AuthToken>rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y</xxx:AuthToken> <!-- Noncompliant -->\n    <Element xxx:CustomAttribute=\"AuthToken=rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\" /> <!-- Noncompliant -->\n  </CustomNamespaces>\n  <CustomNamespaces xmlns=\"http://dotnet.sonarsouce.com\">\n    <AuthToken>rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y</AuthToken> <!-- Noncompliant -->\n    <Element CustomAttribute=\"AuthToken=rf6acB24J//1FZLRrKpjmBUYSnUX5CHlt/iD5vVVcgVuAIOB6hzcWjDnv16V6hDLevW0Qs4hKPbP1M4YfuDI16sZna1/VGRLkAbTk6xMPs4epH6A3ZqSyyI-H92y\" /><!-- Noncompliant -->\n  </CustomNamespaces>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/RequestsWithExcessiveLength/Corrupt/Web.config",
    "content": "﻿<configuration>\n  <system.web>\n    <httpRuntime maxRequestLength=\"81920\" executionTimeout=\"3600\" />\n    <!-- Sensitive: maxRequestLength is exprimed in KB, so 81920KB = 80MB  -->\n  </system.web>\n  <system.webServer>\n    <security>\n      <requestFiltering>\n        <requestLimits maxAllowedContentLength=\"83886080\" />\n        <!-- Sensitive: maxAllowedContentLength is exprimed in bytes, so 83886080B = 80MB  -->\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/RequestsWithExcessiveLength/UnexpectedContent/Web.config",
    "content": "﻿<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.mycompany.app</groupId>\n  <artifactId>my-app</artifactId>\n  <version>1.0-SNAPSHOT</version>\n\n</project>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/RequestsWithExcessiveLength/Values/ContentLength/Web.config",
    "content": "<configuration>\n  <system.web>\n    <httpRuntime maxRequestLength=\"25600\" />  <!-- Noncompliant  -->\n  </system.web>\n  <system.webServer>\n    <security>\n      <requestFiltering>\n        <requestLimits maxAllowedContentLength=\"83886080\" /> <!-- Noncompliant -->\n      </requestFiltering>\n    </security>\n  </system.webServer>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/RequestsWithExcessiveLength/Values/ContentLength_Compliant/Web.config",
    "content": "<configuration>\n  <system.web>\n    <httpRuntime maxRequestLength=\"81920\" />\n  </system.web>\n  <system.webServer>\n    <security>\n      <requestFiltering>\n        <requestLimits maxAllowedContentLength=\"83886080\" />\n      </requestFiltering>\n    </security>\n  </system.webServer>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/RequestsWithExcessiveLength/Values/CornerCases/Web.config",
    "content": "<configuration>\n  <system.web>\n    <httpRuntime maxRequestLength=\"819200000000000000000\" executionTimeout=\"3600\" />\n    <httpRuntime maxRequestLength=\"1\" executionTimeout=\"3600\" />\n    <httpRuntime maxRequestLength=\"0\" executionTimeout=\"3600\" />\n    <httpRuntime maxRequestLength=\"-1\" executionTimeout=\"3600\" />\n    <httpRuntime maxRequestLength=\"-2147483648\" executionTimeout=\"3600\" />\n    <httpRuntime maxRequestLength=\"0x7FFFFFFF\" executionTimeout=\"3600\" />\n  </system.web>\n  <system.webServer>\n    <security>\n      <requestFiltering>\n        <requestLimits maxAllowedContentLength=\"abcdefg\" />\n      </requestFiltering>\n    </security>\n  </system.webServer>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/RequestsWithExcessiveLength/Values/DefaultSettings/Web.config",
    "content": "<configuration>\n  <system.web>\n  </system.web>\n  <system.webServer>\n    <security>\n      <requestFiltering>\n      </requestFiltering>\n    </security>\n  </system.webServer>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/RequestsWithExcessiveLength/Values/EmptySystemWeb/Web.config",
    "content": "<configuration>\n  <system.web>\n    <httpRuntime />\n  </system.web>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/RequestsWithExcessiveLength/Values/EmptySystemWebServer/Web.config",
    "content": "<configuration>\n  <system.webServer>\n    <security>\n      <requestFiltering>\n        <requestLimits />\n      </requestFiltering>\n    </security>\n  </system.webServer>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/RequestsWithExcessiveLength/Values/InvalidConfig/Web.config",
    "content": "<configuration>\n  <!-- httpRuntime should be inside system.web -->\n  <httpRuntime maxRequestLength=\"81920\" executionTimeout=\"3600\" />\n  <system.web>\n  </system.web>\n  <system.webServer>\n    <security>\n      <!-- requestLimits should be inside requestFiltering -->\n      <requestLimits maxAllowedContentLength=\"83886080\" />\n      <requestFiltering>\n      </requestFiltering>\n    </security>\n  </system.webServer>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/RequestsWithExcessiveLength/Values/NoSystemWeb/Web.config",
    "content": "<configuration>\n  <system.webServer>\n    <security>\n      <requestFiltering>\n        <requestLimits maxAllowedContentLength=\"83886080\" />         <!-- Noncompliant {{Make sure the content length limit is safe here.}} -->\n      </requestFiltering>\n    </security>\n  </system.webServer>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/RequestsWithExcessiveLength/Values/NoSystemWebServer/Web.config",
    "content": "<configuration>\n  <system.web>\n    <httpRuntime maxRequestLength=\"81920\" executionTimeout=\"3600\" /> <!-- Noncompliant {{Make sure the content length limit is safe here.}} -->\n  </system.web>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/RequestsWithExcessiveLength/Values/RequestAndContentLength/Web.config",
    "content": "<configuration>\n  <system.web>\n    <httpRuntime maxRequestLength=\"81920\" executionTimeout=\"3600\" /> <!-- Noncompliant {{Make sure the content length limit is safe here.}} -->\n    <!--         ^^^^^^^^^^^^^^^^ -->\n  </system.web>\n  <system.webServer>\n    <security>\n      <requestFiltering>\n        <requestLimits maxAllowedContentLength=\"83886080\" />         <!-- Noncompliant {{Make sure the content length limit is safe here.}} -->\n        <!--           ^^^^^^^^^^^^^^^^^^^^^^^ -->\n      </requestFiltering>\n    </security>\n  </system.webServer>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/RequestsWithExcessiveLength/Values/RequestLength/Web.config",
    "content": "<configuration>\n  <system.web>\n    <httpRuntime maxRequestLength=\"81920\" executionTimeout=\"3600\" /> <!-- Noncompliant -->\n  </system.web>\n  <system.webServer>\n    <security>\n      <requestFiltering>\n        <requestLimits />\n      </requestFiltering>\n    </security>\n  </system.webServer>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/RequestsWithExcessiveLength/Values/SmallValues/Web.config",
    "content": "<configuration>\n  <system.web>\n    <httpRuntime maxRequestLength=\"4096\" executionTimeout=\"3600\" />\n  </system.web>\n  <system.webServer>\n    <security>\n      <requestFiltering>\n        <requestLimits maxAllowedContentLength=\"4096\" />\n      </requestFiltering>\n    </security>\n  </system.webServer>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/WebConfig/RequestsWithExcessiveLength/Values/ValidValues/Web.config",
    "content": "<configuration>\n  <system.web>\n    <httpRuntime maxRequestLength=\"8192\" executionTimeout=\"3600\" />\n  </system.web>\n  <system.webServer>\n    <security>\n      <requestFiltering>\n        <requestLimits maxAllowedContentLength=\"8388608\" />\n      </requestFiltering>\n    </security>\n  </system.webServer>\n</configuration>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/XMLSignatureCheck.cs",
    "content": "﻿using System.Security.Cryptography;\nusing System.Security.Cryptography.Xml;\nusing System.Xml;\nusing System.Linq;\n\npublic class XMLSignatures\n{\n    public void TestCases(RSACryptoServiceProvider rsaCryptoServiceProvider)\n    {\n        XmlDocument xmlDoc = new XmlDocument() { PreserveWhitespace = true };\n        xmlDoc.Load(\"/data/login.xml\");\n        SignedXml signedXml = new SignedXml(xmlDoc);\n        signedXml.LoadXml((XmlElement)xmlDoc.GetElementsByTagName(\"Signature\").Item(0));\n\n        _ = signedXml.CheckSignature(rsaCryptoServiceProvider);                     // A key is provided.\n        _ = signedXml.CheckSignature(\"other\");                                      // Custom defined extension method.\n        _ = signedXml.CheckSignatureReturningKey(\"other\");                          // Custom defined extension method.\n        _ = new[] { rsaCryptoServiceProvider }.Select(signedXml.CheckSignature);    // Used as an Func<T, bool>, parameter is provided.\n\n        _ = signedXml.CheckSignature();                                             // Noncompliant {{Change this code to only accept signatures computed from a trusted party.}}\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^\n        _ = signedXml.CheckSignatureReturningKey(out var signingKey);               // Noncompliant {{Change this code to only accept signatures computed from a trusted party.}}\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n    }\n}\n\npublic static class SignedXmlExtensions\n{\n    public static bool CheckSignature(this SignedXml signedXml, string other) =>\n        true;\n\n    public static bool CheckSignatureReturningKey(this SignedXml signedXml, string other) =>\n        true;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/XmlExternalEntityShouldNotBeParsed_AlwaysSafe.cs",
    "content": "﻿using System.IO;\nusing System.Xml;\nusing System.Xml.Linq;\nusing System.Xml.Xsl;\n\nnamespace Tests.Diagnostics\n{\n    class AlwaysSafe\n    {\n        // System.Xml.XmlNodeReader is always safe\n        protected void XmlNodeReader_1()\n        {\n            XmlDocument doc = new XmlDocument();\n            doc.XmlResolver = new XmlUrlResolver(); // Noncompliant\n            XmlNodeReader reader = new XmlNodeReader(doc);  // safe even though the XmlDocument is not!\n        }\n\n        protected void ConfiguredWithSecureResolver()\n        {\n            XmlDataDocument doc = new XmlDataDocument();\n            var resolver = new XmlUrlResolver();\n            doc.XmlResolver = new XmlSecureResolver(resolver, \"\"); // XmlSecureResolver is ok\n        }\n\n        // System.Xml.Linq.XElement\n        protected void XElementTest()\n        {\n            XElement xelement = XElement.Load(new MemoryStream()); // always safe\n        }\n    }\n\n    /// <summary>\n    /// There are APIs that become unsafe if an unsafe XmlDocument or XmlTextReader are passed to them.\n    /// As we already track these types and raise on them, there's no need to add noise.\n    /// </summary>\n    class IgnoredToAvoidNoise\n    {\n        // System.Xml.Xsl.XslCompiledTransform\n        protected void XslCompiledTransform(StringWriter stringWriter)\n        {\n            XmlTextReader reader = new XmlTextReader(\"resources/\"); // safe in .NET version 4.5.2+\n            reader.XmlResolver = new XmlUrlResolver(); // Noncompliant\n            // parsing the XML\n            XslCompiledTransform transformer = new XslCompiledTransform();\n            transformer.Load(\"resources/test.xsl\");\n            transformer.Transform(reader, new XsltArgumentList(), stringWriter); // we already raise on XmlTextReader\n        }\n\n        // System.Xml.XmlDictionaryReader\n        protected void XmlDictionaryReader()\n        {\n            XmlReaderSettings settings = new XmlReaderSettings();\n            settings.ProhibitDtd = false;                  // Secondary {{This value enables external entities in XML parsing.}}\n            settings.DtdProcessing = DtdProcessing.Parse;  // Secondary {{This value enables external entities in XML parsing.}}\n            settings.XmlResolver = new XmlUrlResolver();   // Secondary {{This value enables external entities in XML parsing.}}\n            XmlReader reader = XmlReader.Create(new MemoryStream(), settings, \"resources/\"); // Noncompliant\n            XDocument xdocument = XDocument.Load(reader); // we already raise on XmlReader\n        }\n\n        // System.Xml.Linq.XDocument\n        protected void XDocumentTest()\n        {\n            XmlReaderSettings settings = new XmlReaderSettings();\n            settings.ProhibitDtd = false;                  // Secondary {{This value enables external entities in XML parsing.}}\n            settings.DtdProcessing = DtdProcessing.Parse;  // Secondary {{This value enables external entities in XML parsing.}}\n            settings.XmlResolver = new XmlUrlResolver();   // Secondary {{This value enables external entities in XML parsing.}}\n            XmlReader reader = XmlReader.Create(new MemoryStream(), settings, \"resources/\"); // Noncompliant\n            XDocument xdocument = XDocument.Load(reader); // we already raise for the XmlReader config\n        }\n    }\n\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/XmlExternalEntityShouldNotBeParsed_XPathDocument_CSharp9.cs",
    "content": "﻿using System.Xml;\nusing System.Xml.XPath;\n\nXPathDocument xPathDocument1 = new(\"doc.xml\"); // XPathDocument is secure by default starting with .net 4.5.2\n\nXmlReader xmlReader = XmlReader.Create(\"uri\", new() { ProhibitDtd = false, XmlResolver = new XmlUrlResolver() }); // Noncompliant {{Disable access to external entities in XML parsing.}}\n                                                                                                                  // Secondary@-1 {{This value enables external entities in XML parsing.}}\n                                                                                                                  // Secondary@-2 {{This value enables external entities in XML parsing.}}\nXPathDocument xPathDocument2 = new(xmlReader); // Compliant - we already raise the warning for the reader\n\nXmlReader xmlReaderWithIgnore = XmlReader.Create(\"uri\", new XmlReaderSettings { DtdProcessing = DtdProcessing.Ignore });\nXPathDocument xPathDocument3 = new(xmlReaderWithIgnore);\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/XmlExternalEntityShouldNotBeParsed_XPathDocument_Net35.cs",
    "content": "﻿using System;\nusing System.Xml;\nusing System.Xml.XPath;\n\nnamespace SonarAnalyzer.Test.TestCases\n{\n    public class XPathDocumentCases\n    {\n        public void UnsafeByDefault()\n        {\n            var xPathDocument = new XPathDocument(\"doc.xml\"); // Noncompliant - XPathDocument is unsafe by default before .net 4.5.2\n        }\n\n        public void UnsafeXmlReader()\n        {\n            // Secondary@+1\n            var xmlReader = XmlReader.Create(\"uri\", new XmlReaderSettings {ProhibitDtd = false});  // Noncompliant\n            var xPathDocument = new XPathDocument(xmlReader); // Compliant - we already raise the warning for the reader\n        }\n\n        public void SafeXmlReader()\n        {\n            var xmlReader = XmlReader.Create(\"uri\", new XmlReaderSettings {ProhibitDtd = true});\n            var xPathDocument = new XPathDocument(xmlReader);\n        }\n\n        public void XmlReaderAsParameter(XmlReader xmlReader)\n        {\n            var xPathDocument = new XPathDocument(xmlReader); // Compliant\n        }\n    }\n\n    public class VariousUsages\n    {\n        XPathDocument document = new XPathDocument(\"uri\"); // Noncompliant\n\n        public void InsideTryCatch()\n        {\n            try\n            {\n                var xPathDocument = new XPathDocument(\"uri\"); // Noncompliant\n            }\n            catch\n            {\n            }\n        }\n\n        private void LocalFunction()\n        {\n            void LocalFunction()\n            {\n                var xPathDocument = new XPathDocument(\"uri\"); // Noncompliant\n            }\n        }\n\n        private void LambdaFunction()\n        {\n            Func<XPathDocument> documentFactory = () => new XPathDocument(\"uri\"); // Noncompliant\n        }\n\n        private XPathDocument GetDocument() => new XPathDocument(\"uri\"); // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/XmlExternalEntityShouldNotBeParsed_XPathDocument_Net4.cs",
    "content": "﻿using System.Xml;\nusing System.Xml.XPath;\n\nnamespace SonarAnalyzer.Test.TestCases\n{\n    public class XPathDocumentCases\n    {\n        public void UnsafeByDefault()\n        {\n            var xPathDocument = new XPathDocument(\"doc.xml\"); // Noncompliant - XPathDocument is unsafe by default before .net 4.5.2\n        }\n\n        public void UnsafeXmlReader()\n        {\n            // Secondary@+1\n            var xmlReader = XmlReader.Create(\"uri\", new XmlReaderSettings {ProhibitDtd = false});  // Noncompliant\n            var xPathDocument = new XPathDocument(xmlReader); // Compliant - we already raise the warning for the reader\n        }\n\n        public void SafeXmlReader()\n        {\n            var xmlReader = XmlReader.Create(\"uri\", new XmlReaderSettings { DtdProcessing = DtdProcessing.Ignore});\n            var xPathDocument = new XPathDocument(xmlReader);\n        }\n\n        public void XmlReaderAsParameter(XmlReader xmlReader)\n        {\n            var xPathDocument = new XPathDocument(xmlReader);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/XmlExternalEntityShouldNotBeParsed_XPathDocument_Net452.cs",
    "content": "﻿using System;\nusing System.Xml;\nusing System.Xml.XPath;\n\nnamespace SonarAnalyzer.Test.TestCases\n{\n    public class XPathDocumentCases\n    {\n        public void SafeByDefault()\n        {\n            var xPathDocument = new XPathDocument(\"doc.xml\"); // XPathDocument is secure by default starting with .net 4.5.2\n        }\n\n        public void UnsafeXmlReader()\n        {\n            // Secondary@+2\n            // Secondary@+1\n            var xmlReader = XmlReader.Create(\"uri\", new XmlReaderSettings {ProhibitDtd = false, XmlResolver = new XmlUrlResolver()}); // Noncompliant\n            var xPathDocument = new XPathDocument(xmlReader); // Compliant - we already raise the warning for the reader\n        }\n\n        public void SafeXmlReader()\n        {\n            var xmlReader = XmlReader.Create(\"uri\", new XmlReaderSettings { DtdProcessing = DtdProcessing.Ignore});\n            var xPathDocument = new XPathDocument(xmlReader);\n        }\n\n        public void XmlReaderAsParameter(XmlReader xmlReader)\n        {\n            var xPathDocument = new XPathDocument(xmlReader);\n        }\n    }\n\n    public class VariousUsages\n    {\n        XPathDocument document = new XPathDocument(\"uri\");\n\n        public void InsideTryCatch()\n        {\n            try\n            {\n                var xPathDocument = new XPathDocument(\"uri\");\n            }\n            catch\n            {\n            }\n        }\n\n        private void LocalFunction()\n        {\n            void LocalFunction()\n            {\n                var xPathDocument = new XPathDocument(\"uri\");\n            }\n        }\n\n        private void LambdaFunction()\n        {\n            Func<XPathDocument> documentFactory = () => new XPathDocument(\"uri\");\n        }\n\n        private XPathDocument GetDocument() => new XPathDocument(\"uri\");\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/XmlExternalEntityShouldNotBeParsed_XmlDocument.cs",
    "content": "﻿using System;\nusing System.Configuration;\nusing System.IO;\nusing System.Text;\nusing System.Xml;\nusing System.Xml.Linq;\nusing System.Xml.Resolvers;\nusing System.Xml.XPath;\nusing System.Xml.Xsl;\nusing Microsoft.Web.XmlTransform;\n\nnamespace Tests.Diagnostics\n{\n    /// <summary>\n    /// In .NET Framework 4.5.2+, the XmlDocument (and derivates) constructors are safe.\n    /// An unsafe XML Resolver must be set in order to make the XmlDocument unsafe.\n    /// </summary>\n    class NoncompliantTests\n    {\n        XmlDocument doc = new XmlDocument() { XmlResolver = new XmlPreloadedResolver() }; // Noncompliant {{Disable access to external entities in XML parsing.}}\n\n        protected void XmlDocumentTest(XmlUrlResolver xmlUrlResolver)\n        {\n            XmlDocument doc = new XmlDocument();\n            doc.XmlResolver = xmlUrlResolver; // Noncompliant\n        }\n\n        // System.Xml.XmlDataDocument\n        protected void XmlDataDocumentTest()\n        {\n            XmlDataDocument doc = new XmlDataDocument();\n            doc.XmlResolver = new XmlPreloadedResolver(); // Noncompliant\n        }\n\n        // System.Configuration.ConfigXmlDocument\n        protected void ConfigXmlDocumentTest()\n        {\n            ConfigXmlDocument doc = new ConfigXmlDocument();\n            doc.XmlResolver = new XmlPreloadedResolver(); // Noncompliant\n        }\n\n        // Microsoft.Web.XmlTransform.XmlFileInfoDocument\n        protected void XmlFileInfoDocumentTest()\n        {\n            XmlFileInfoDocument doc = new XmlFileInfoDocument();\n            doc.XmlResolver = new XmlPreloadedResolver(); // Noncompliant\n        }\n\n        // Microsoft.Web.XmlTransform.XmlTransformableDocument\n        protected void XmlTransformableDocumentTest()\n        {\n            XmlTransformableDocument doc = new XmlTransformableDocument();\n            doc.XmlResolver = new XmlPreloadedResolver(); // Noncompliant\n        }\n    }\n\n    class CompliantTests_After_Net_4_5_2\n    {\n        protected void XmlDocument_WithSecureResolver(XmlSecureResolver xmlSecureResolver)\n        {\n            XmlDocument doc = new XmlDocument();\n            doc.XmlResolver = xmlSecureResolver;\n        }\n\n        protected void XmlDocument_WithNullResolver(XmlSecureResolver xmlSecureResolver)\n        {\n            XmlDocument doc = new XmlDocument();\n            doc.XmlResolver = null;\n        }\n\n        protected void XmlDataDocumentTest()\n        {\n            XmlDataDocument doc = new XmlDataDocument();\n        }\n\n        protected void ConfigXmlDocumentTest()\n        {\n            ConfigXmlDocument doc = new ConfigXmlDocument();\n        }\n\n        protected void XmlFileInfoDocumentTest()\n        {\n            XmlFileInfoDocument doc = new XmlFileInfoDocument();\n        }\n\n        protected void XmlTransformableDocumentTest()\n        {\n            XmlTransformableDocument doc = new XmlTransformableDocument();\n        }\n    }\n\n    /// <summary>\n    ///  These are not testing the APIs per se, but other test combinations\n    /// </summary>\n    class VariousUnsafeCombinations\n    {\n        public void InsideTryCatch()\n        {\n            ConfigXmlDocument doc;\n            try\n            {\n                doc = new ConfigXmlDocument();\n                doc.XmlResolver = new XmlPreloadedResolver(); // Noncompliant\n            }\n            catch\n            {\n            }\n        }\n\n        public void InsideLoop()\n        {\n            ConfigXmlDocument doc;\n            while (true)\n            {\n                doc = new ConfigXmlDocument();\n                doc.XmlResolver = new XmlPreloadedResolver(); // Noncompliant\n            }\n        }\n\n        private void LocalFunction()\n        {\n            var doc = new ConfigXmlDocument();\n            LocalFunction();\n\n            void LocalFunction()\n            {\n                doc.XmlResolver = new XmlPreloadedResolver(); // Noncompliant\n            }\n        }\n\n        delegate XmlUrlResolver TestDelegate();\n        private void LambdaFunction()\n        {\n            TestDelegate resolverFactory = () => new XmlUrlResolver();\n            var doc = new XmlDocument();\n            doc.XmlResolver = resolverFactory(); // Noncompliant\n        }\n\n        private void SetUnsafeResolverFromMethod()\n        {\n            var doc = new XmlDocument();\n            doc.XmlResolver = GetUrlResolver(); // Noncompliant\n        }\n\n        private XmlUrlResolver GetUrlResolver() => new XmlUrlResolver();\n\n        private void SetUnsafeResolverFromMethodWithTuple()\n        {\n            var doc = new XmlDocument();\n            var tuple = GetUrlResolverInTuple();\n            doc.XmlResolver = tuple.resolver; // Noncompliant\n        }\n\n        private (XmlUrlResolver resolver, int i) GetUrlResolverInTuple() => (new XmlUrlResolver(), 1);\n\n        private void PropagateResolverValue(ConfigXmlDocument doc)\n        {\n            var res1 = new XmlUrlResolver();\n            var res2 = res1;\n            var res3 = res2;\n            doc.XmlResolver = res3; // Noncompliant\n        }\n\n        public string XmlProperty\n        {\n            get\n            {\n                doc = new ConfigXmlDocument();\n                doc.XmlResolver = new XmlPreloadedResolver(); // Noncompliant\n                return \"\";\n            }\n        }\n\n        ConfigXmlDocument doc;\n        // constructor\n        public VariousUnsafeCombinations()\n        {\n            var doc = new ConfigXmlDocument();\n            doc.XmlResolver = new XmlPreloadedResolver(); // Noncompliant\n        }\n\n        // multiple constructor calls for same type\n        public void MultipleConstructorCallsForSameType()\n        {\n            var doc = new ConfigXmlDocument();\n            doc = new ConfigXmlDocument();\n            doc.XmlResolver = new XmlPreloadedResolver(); // Noncompliant\n        }\n\n        // multiple sets of the property, some sanitize some vulnerable, last sanitize\n        public void MultipleSetsLastSanitize()\n        {\n            var doc = new ConfigXmlDocument();\n            doc.XmlResolver = new XmlPreloadedResolver(); // Noncompliant\n            doc.XmlResolver = null;\n        }\n\n        // multiple sets of the property, some sanitize some vulnerable, last vulnerable\n        public void MultipleSetsLastMakeUnsafe()\n        {\n            var doc = new ConfigXmlDocument();\n            doc.XmlResolver = null;\n            doc.XmlResolver = new XmlPreloadedResolver(); // Noncompliant\n        }\n\n        public void MultipleVulnerableApisInSameMethod()\n        {\n            ConfigXmlDocument doc = new ConfigXmlDocument();\n            XmlFileInfoDocument doc2 = new XmlFileInfoDocument();\n            doc.XmlResolver = null;\n            doc2.XmlResolver = new XmlPreloadedResolver(); // Noncompliant\n        }\n\n        public void Caller()\n        {\n            ConfigXmlDocument doc = new ConfigXmlDocument();\n            Callee(doc);\n        }\n\n        public void Callee(ConfigXmlDocument doc)\n        {\n            doc.XmlResolver = new XmlPreloadedResolver(); // Noncompliant\n        }\n\n        public void WithInitializeInsideIf()\n        {\n            XmlDocument doc;\n            if ((doc = new XmlDocument()) != null)\n            {\n                doc.XmlResolver = null; // no DTD resolving\n                doc.Load(\"\");\n            }\n        }\n    }\n }\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/XmlExternalEntityShouldNotBeParsed_XmlDocument_CSharp10.cs",
    "content": "﻿using System.Xml;\nusing System.Xml.Resolvers;\n\nXmlDocument doc = new();\n(doc.XmlResolver, var x) = (new XmlPreloadedResolver(), 0); // Noncompliant\n\nXmlDocument doc2 = new();\n(doc2.XmlResolver, var x2) = (null, 0); // Compliant\n\nXmlDocument doc3 = new();\n(doc3.XmlResolver, var x3) = ((new XmlPreloadedResolver()), 0); // Noncompliant\n\npublic record struct RecordStruct\n{\n    public void SetValueAfterObjectInitialization()\n    {\n        XmlDocument doc1 = new() { XmlResolver = new XmlPreloadedResolver() }; // Compliant, property is set below\n        (doc1.XmlResolver, var x1) = (null, 0);\n\n        XmlDocument doc2 = new() { XmlResolver = new XmlPreloadedResolver() }; // Noncompliant  \n        (doc2.XmlResolver, var x2) = (new XmlPreloadedResolver(), 0); // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/XmlExternalEntityShouldNotBeParsed_XmlDocument_CSharp9.cs",
    "content": "﻿using System.Xml;\nusing System.Xml.Resolvers;\n\nXmlDocument xmlDocument = new(); // Compliant - default constructor is safe in .Net 5\n\nXmlDocument doc1 = new() { XmlResolver = new XmlPreloadedResolver() }; // Noncompliant\n\nXmlDocument doc2 = new();\ndoc2.XmlResolver = new XmlPreloadedResolver(); // Noncompliant\n\nvoid XmlDocumentTest(XmlUrlResolver xmlUrlResolver)\n{\n    XmlDocument doc = new() // Noncompliant\n    {\n        XmlResolver = xmlUrlResolver\n    };\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/XmlExternalEntityShouldNotBeParsed_XmlDocument_Net35.cs",
    "content": "﻿using System;\nusing System.Configuration;\nusing System.IO;\nusing System.Text;\nusing System.Xml;\nusing System.Xml.Linq;\nusing System.Xml.Resolvers;\nusing System.Xml.XPath;\nusing System.Xml.Xsl;\nusing Microsoft.Web.XmlTransform;\n\nnamespace Tests.Diagnostics\n{\n    /// <summary>\n    /// In .NET Framework 3.5, the constructor is unsafe by default.\n    /// </summary>\n    class Test\n    {\n        XmlDocument doc = new XmlDocument(); // Noncompliant\n\n        protected static void XmlDocument_SetUnsafeProperty(XmlUrlResolver xmlUrlResolver)\n        {\n            var doc = new XmlDocument(); // Noncompliant\n            doc.XmlResolver = xmlUrlResolver; // Noncompliant in all versions - and shown twice\n        }\n\n        protected static void XmlDocument_OnlyConstructor()\n        {\n            new XmlDocument(); // Noncompliant before 4.5.2\n        }\n\n        protected void XmlDocument_InsideIf_SanitizeInCondition(bool foo)\n        {\n            var doc = new XmlDocument(); // Noncompliant\n            if (foo)\n            {\n                doc.XmlResolver = null; // conditionally set; not enough\n            }\n        }\n\n        protected void XmlDocument_InsideIf_SanitizeOutsideCondition(bool foo)\n        {\n            var doc = new XmlDocument();\n            if (foo)\n            {\n                doc.XmlResolver = null;\n            }\n            doc.XmlResolver = null; // this is ok\n        }\n\n        public void WithInitializeInsideIf(XmlUrlResolver xmlUrlResolver)\n        {\n            XmlDocument doc;\n            if ((doc = new XmlDocument()) != null)\n            {\n                doc.XmlResolver = null; // no DTD resolving\n                doc.Load(\"\");\n            }\n\n            if ((doc = new XmlDocument()) != null) // Noncompliant\n            {\n                doc.XmlResolver = xmlUrlResolver; // Noncompliant\n                doc.Load(\"\");\n            }\n\n            if ((doc = new XmlDocument()) != null)\n            {\n                doc.XmlResolver = null; // no DTD resolving\n                doc.Load(\"\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/XmlExternalEntityShouldNotBeParsed_XmlDocument_Net4.cs",
    "content": "﻿using System;\nusing System.Configuration;\nusing System.IO;\nusing System.Text;\nusing System.Xml;\nusing System.Xml.Linq;\nusing System.Xml.Resolvers;\nusing System.Xml.XPath;\nusing System.Xml.Xsl;\nusing Microsoft.Web.XmlTransform;\n\nnamespace Tests.Diagnostics\n{\n    /// <summary>\n    /// In .NET Framework 4, the constructor is unsafe by default.\n    /// </summary>\n    class Test\n    {\n        XmlDocument doc = new XmlDocument(); // Noncompliant\n\n        protected static void XmlDocument_MakeUnsafeWithProperty(XmlUrlResolver xmlUrlResolver)\n        {\n            var doc = new XmlDocument(); // Noncompliant\n            doc.XmlResolver = xmlUrlResolver; // Noncompliant, shown twice\n        }\n\n        protected static void XmlDocument_2()\n        {\n            new XmlDocument(); // Noncompliant\n        }\n\n        protected void XmlDocument_SanitizeInsideIf(bool foo)\n        {\n            var doc = new XmlDocument(); // Noncompliant\n            if (foo)\n            {\n                doc.XmlResolver = null; // conditionally set; not enough\n            }\n        }\n\n        protected void XmlDocument_InsideIf_SanitizeAfterIf(bool foo)\n        {\n            var doc = new XmlDocument();\n            if (foo)\n            {\n                doc.XmlResolver = null;\n            }\n            doc.XmlResolver = null; // this is ok\n        }\n\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/XmlExternalEntityShouldNotBeParsed_XmlDocument_UnknownFrameworkVersion.cs",
    "content": "﻿using System;\nusing System.Configuration;\nusing System.IO;\nusing System.Text;\nusing System.Xml;\nusing System.Xml.Linq;\nusing System.Xml.Resolvers;\nusing System.Xml.XPath;\nusing System.Xml.Xsl;\nusing Microsoft.Web.XmlTransform;\n\nnamespace Tests.Diagnostics\n{\n    /// <summary>\n    /// Unknown framework behaves like .NET Framework 4.5.2+\n    /// </summary>\n    class Test\n    {\n        protected static void XmlDocument_MakeUnsafe(XmlUrlResolver xmlUrlResolver)\n        {\n            var doc = new XmlDocument();\n            doc.XmlResolver = xmlUrlResolver; // Noncompliant in all versions\n        }\n\n        protected static void XmlDocument_OnlyConstructor()\n        {\n            new XmlDocument();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/XmlExternalEntityShouldNotBeParsed_XmlReader_CSharp9.cs",
    "content": "﻿using System.IO;\nusing System.Xml;\nusing System.Xml.Linq;\n\n// Secondary@+2\n// Secondary@+1\nXmlReader.Create(\"uri\", new XmlReaderSettings() { DtdProcessing = DtdProcessing.Parse, XmlResolver = new XmlUrlResolver() }).Dispose(); // Noncompliant\n\nvar settings = new XmlReaderSettings()\n{\n    DtdProcessing = DtdProcessing.Parse, // Secondary\n    XmlResolver = new XmlUrlResolver() // Secondary\n};\n\nXmlReader.Create(\"uri\", settings).Dispose(); // Noncompliant\n\nXmlReaderSettings safeSettings = new();\nXmlReaderSettings unsafeSettings = new();\n\nsafeSettings.DtdProcessing = DtdProcessing.Parse;\nunsafeSettings.DtdProcessing = DtdProcessing.Parse;\n\nsafeSettings.XmlResolver = null;\nunsafeSettings.XmlResolver = new XmlUrlResolver();\n\nXmlReader.Create(\"uri\", safeSettings).Dispose(); // Compliant\nXmlReader.Create(\"uri\", unsafeSettings).Dispose(); // Compliant - FN\n\nclass Foo\n{\n    void Bar()\n    {\n        XmlReaderSettings settings = new ();\n        settings.ProhibitDtd = false;                  // Secondary {{This value enables external entities in XML parsing.}}\n        settings.DtdProcessing = DtdProcessing.Parse;  // Secondary {{This value enables external entities in XML parsing.}}\n        settings.XmlResolver = new XmlUrlResolver();   // Secondary {{This value enables external entities in XML parsing.}}\n        XmlReader reader = XmlReader.Create(new MemoryStream(), settings, \"resources/\"); // Noncompliant\n        XDocument xdocument = XDocument.Load(reader); // we already raise on XmlReader\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/XmlExternalEntityShouldNotBeParsed_XmlReader_ExternalParameter.cs",
    "content": "﻿using System.Xml;\n\nnamespace SonarAnalyzer.Test.TestCases\n{\n    public class XmlReaderExternalParameter\n    {\n        internal static readonly XmlReaderSettings InternalSettings = new XmlReaderSettings()\n        {\n            DtdProcessing = DtdProcessing.Parse, // Secondary [1,2]\n            XmlResolver = new XmlUrlResolver()   // Secondary [1,2]\n        };\n\n        private static readonly XmlReader FieldReader = XmlReader.Create(\"uri\", InternalSettings); // Noncompliant [1]\n\n        public void XmlReader_ExternalParameter()\n        {\n            XmlReader.Create(\"uri\", XmlReaderParameterProvider.Settings); // Ok - semantic model cannot resolve symbol info\n\n            XmlReader.Create(\"uri\", InternalSettings); // Noncompliant [2]\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/XmlExternalEntityShouldNotBeParsed_XmlReader_Net35.cs",
    "content": "﻿using System.Xml;\n\nnamespace SonarAnalyzer.Test.TestCases\n{\n    public class XmlExternalEntityShouldNotBeParsed_XmlReader_Net35\n    {\n        public void XmlReader_EnableProhibitDtdAndSetResolver()\n        {\n            var settings = new XmlReaderSettings\n            {\n                ProhibitDtd = false,               // Secondary\n                XmlResolver = new XmlUrlResolver() // Secondary\n            };\n\n            using (XmlReader.Create(\"uri\", settings)) { } // Noncompliant\n        }\n\n        public void XmlReader_DisableProhibitDtd()\n        {\n            //                                                                                  Secondary@+1\n            using (XmlReader.Create(\"uri\", new XmlReaderSettings {ProhibitDtd = false})) { } // Noncompliant\n        }\n\n        public void XmlReader_EnableProhibitDtd()\n        {\n            using (XmlReader.Create(\"uri\", new XmlReaderSettings {ProhibitDtd = true})) { } // Compliant\n        }\n\n        public void XmlReader_DisableProhibitDtdAndSetXmlResolverToNull()\n        {\n            using (XmlReader.Create(\"uri\", new XmlReaderSettings {ProhibitDtd = false, XmlResolver = null})) { } // Compliant\n        }\n\n        public void XmlReader_SecureXmlResolver(XmlSecureResolver secureResolver)\n        {\n            using (XmlReader.Create(\"uri\", new XmlReaderSettings {ProhibitDtd = false, XmlResolver = secureResolver})) { } // Compliant\n        }\n\n        public void XmlReader_SafeByDefault()\n        {\n            using (XmlReader.Create(\"uri\", new XmlReaderSettings())) { }\n        }\n\n        public void XmlReader_NoSettings()\n        {\n            using (XmlReader.Create(\"uri\")) { }\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/XmlExternalEntityShouldNotBeParsed_XmlReader_Net4.cs",
    "content": "﻿using System.Xml;\n\nnamespace SonarAnalyzer.Test.TestCases\n{\n    public class XmlReaderUnsafe\n    {\n        public void XmlReader_NonCompliant_InlineInitialization()\n        {\n            //                                                                                                 Secondary@+1\n            XmlReader.Create(\"uri\", new XmlReaderSettings() { DtdProcessing = DtdProcessing.Parse}).Dispose(); // Noncompliant\n        }\n\n        public void XmlReader_NonCompliant_WithUnsafeSettings_Parse()\n        {\n            var settings = new XmlReaderSettings();\n\n            settings.DtdProcessing = DtdProcessing.Parse; // Secondary\n\n            XmlReader.Create(\"uri\", settings).Dispose();  // Noncompliant\n        }\n\n        public void XmlReader_NonCompliant_WithUnsafeSettings_ParseAndResolver()\n        {\n            var settings = new XmlReaderSettings();\n\n            settings.DtdProcessing = DtdProcessing.Parse; // Secondary\n            settings.XmlResolver = new XmlUrlResolver();  // Secondary\n\n            XmlReader.Create(\"uri\", settings).Dispose();  // Noncompliant\n        }\n\n        public void XmlReader_NonCompliantAndCompliantMix()\n        {\n            var safeSettings = new XmlReaderSettings();\n\n            safeSettings.DtdProcessing = DtdProcessing.Parse;\n            safeSettings.XmlResolver = null;\n\n            var unsafeSettings = new XmlReaderSettings();\n            unsafeSettings.DtdProcessing = DtdProcessing.Parse; // Secondary\n            unsafeSettings.XmlResolver = new XmlUrlResolver();  // Secondary\n\n            XmlReader.Create(\"uri\", safeSettings).Dispose();    // Compliant\n            XmlReader.Create(\"uri\", unsafeSettings).Dispose();  // Noncompliant\n        }\n\n        public void XmlReader_NonCompliant_ObjectInitialization()\n        {\n            var settings = new XmlReaderSettings\n            {\n                DtdProcessing = DtdProcessing.Parse      // Secondary\n            };\n\n            XmlReader.Create(\"uri\", settings).Dispose(); // Noncompliant\n        }\n\n        public void XmlReader_NonCompliant_ResolverAsParameter(XmlUrlResolver urlResolver)\n        {\n            var settings = new XmlReaderSettings\n            {\n                DtdProcessing = DtdProcessing.Parse,     // Secondary\n                XmlResolver = urlResolver                // Secondary\n            };\n\n            XmlReader.Create(\"uri\", settings).Dispose(); // Noncompliant\n        }\n    }\n\n    public class XmlReaderSafe\n    {\n        public void XmlReader_NoSettings()\n        {\n            XmlReader.Create(\"uri\").Dispose(); // Compliant - it is safe by default\n        }\n\n        public void XmlReader_DefaultSettings()\n        {\n            var settings = new XmlReaderSettings();\n\n            XmlReader.Create(\"uri\", settings).Dispose(); // Compliant - both settings and reader are safe by default\n            XmlReader.Create(\"uri\", new XmlReaderSettings()).Dispose(); // Compliant - both settings and reader are safe by default\n        }\n\n        public void XmlReader_DefaultDtdProcessing_NullResolver()\n        {\n            var settings = new XmlReaderSettings();\n\n            settings.XmlResolver = null;\n\n            XmlReader.Create(\"uri\", settings).Dispose(); // Compliant - XmlResolver is null and DtdProcessing is not Parse by default\n        }\n\n        public void XmlReader_DefaultDtdProcessing_SecureResolver(XmlSecureResolver resolver)\n        {\n            var settings = new XmlReaderSettings();\n\n            settings.XmlResolver = resolver;\n\n            XmlReader.Create(\"uri\", settings).Dispose(); // Compliant - XmlResolver is secure and DtdProcessing is not Parse by default\n        }\n\n        public void XmlReader_DefaultDtdProcessing_NullResolverDtoProcessingEnabled()\n        {\n            var settings = new XmlReaderSettings();\n\n            settings.DtdProcessing = DtdProcessing.Parse;\n            settings.XmlResolver = null;\n\n            XmlReader.Create(\"uri\", settings).Dispose(); // Compliant - xml resolver is null\n        }\n\n        public void XmlReader_DefaultDtdProcessing_UnsecureResolver()\n        {\n            var settings = new XmlReaderSettings();\n\n            settings.XmlResolver = new XmlUrlResolver();\n\n            XmlReader.Create(\"uri\", settings).Dispose(); // Compliant - DtdProcessing is not Parse by default\n        }\n\n        public void XmlReader_EnabledDtdProcessing_SecureResolver(XmlSecureResolver secureResolver)\n        {\n            var settings = new XmlReaderSettings();\n\n            settings.DtdProcessing = DtdProcessing.Parse;\n            settings.XmlResolver = secureResolver;\n\n            XmlReader.Create(\"uri\", settings).Dispose(); // Compliant - XmlSecureResolver is secure\n        }\n\n        public void XmlReader_DtdProcessingAsParameter(DtdProcessing processing)\n        {\n            var settings = new XmlReaderSettings\n            {\n                DtdProcessing = processing,\n                XmlResolver = new XmlUrlResolver()\n            };\n\n            XmlReader.Create(\"uri\", settings).Dispose(); // Compliant - we don't track DtdProcessing change between methods\n        }\n\n        public void XmlReader_SettingsAsParameter(XmlReaderSettings settings)\n        {\n            XmlReader.Create(\"uri\", settings).Dispose(); // Compliant - we don't track settings change between methods\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/XmlExternalEntityShouldNotBeParsed_XmlReader_Net452.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Text;\nusing System.Xml;\n\nnamespace SonarAnalyzer.Test.TestCases\n{\n    public class XmlReaderUnsafe\n    {\n        public void XmlReader_NonCompliant_Inline_Settings()\n        {\n            XmlReader.Create(\"uri\", new XmlReaderSettings() // Noncompliant\n            {\n                DtdProcessing = DtdProcessing.Parse, // Secondary\n                XmlResolver = new XmlUrlResolver() // Secondary\n            }).Dispose();\n        }\n\n        public void XmlReader_NonCompliant_ConstructorInitializer()\n        {\n            var settings = new XmlReaderSettings()\n            {\n                DtdProcessing = DtdProcessing.Parse,     // Secondary\n                XmlResolver = new XmlUrlResolver()       // Secondary\n            };\n\n            XmlReader.Create(\"uri\", settings).Dispose(); // Noncompliant\n        }\n\n        public void XmlReader_NonCompliant_InvalidDtdProcessingAndXmlResolver()\n        {\n            var settings = new XmlReaderSettings();\n\n            // Starting with .Net 4.5.2 this is safe because the XmlResolver property is null\n            settings.DtdProcessing = DtdProcessing.Parse; // Secondary\n            settings.XmlResolver = new XmlUrlResolver();  // Secondary\n\n            XmlReader.Create(\"uri\", settings).Dispose();  // Noncompliant\n        }\n\n        public void XmlReader_NonCompliantAndCompliantMix()\n        {\n            var safeSettings = new XmlReaderSettings();\n            var unsafeSettings = new XmlReaderSettings();\n\n            safeSettings.DtdProcessing = DtdProcessing.Parse;\n            unsafeSettings.DtdProcessing = DtdProcessing.Parse;  // Secondary\n\n            safeSettings.XmlResolver = null;\n            unsafeSettings.XmlResolver = new XmlUrlResolver();  // Secondary\n\n            XmlReader.Create(\"uri\", safeSettings).Dispose();    // Compliant\n            XmlReader.Create(\"uri\", unsafeSettings).Dispose();  // Noncompliant\n        }\n    }\n\n    public class XmlReaderSafe\n    {\n        public void XmlReader_NoSettings()\n        {\n            XmlReader.Create(\"uri\").Dispose(); // Compliant\n        }\n\n        public void XmlReader_DefaultSettings()\n        {\n            XmlReader.Create(\"uri\", new XmlReaderSettings()).Dispose(); // Compliant\n        }\n\n        public void XmlReader_InlineSettings_NullResolver()\n        {\n            XmlReader.Create(\"uri\", new XmlReaderSettings() { DtdProcessing = DtdProcessing.Parse }).Dispose(); // Compliant\n            XmlReader.Create(\"uri\", new XmlReaderSettings() { DtdProcessing = DtdProcessing.Parse, XmlResolver = null }).Dispose(); // Compliant\n        }\n\n        public void XmlReader_ConstructorInitializerOnlyParsing()\n        {\n            var settings = new XmlReaderSettings()\n            {\n                DtdProcessing = DtdProcessing.Parse\n            };\n\n            XmlReader.Create(\"uri\", settings).Dispose(); // Compliant - xml resolver is null by default\n        }\n\n        public void XmlReader_ConstructorInitializerOnlyXmlResolver()\n        {\n            var settings = new XmlReaderSettings()\n            {\n                XmlResolver = new XmlUrlResolver()\n            };\n\n            XmlReader.Create(\"uri\", settings).Dispose(); // Compliant - parsing is disabled by default\n        }\n\n        public void XmlReader_DefaultDtdProcessing_SecureResolver(XmlSecureResolver resolver)\n        {\n            var settings = new XmlReaderSettings();\n\n            settings.DtdProcessing = DtdProcessing.Parse;\n            settings.XmlResolver = resolver;\n\n            XmlReader.Create(\"uri\", settings).Dispose(); // Compliant - XmlResolver is secure and DtdProcessing is not Parse by default\n        }\n\n        public void XmlReader_DtdProcessingAsParameter(DtdProcessing processing)\n        {\n            var settings = new XmlReaderSettings\n            {\n                DtdProcessing = processing,\n                XmlResolver = new XmlUrlResolver()\n            };\n\n            XmlReader.Create(\"uri\", settings).Dispose(); // Compliant - we don't track DtdProcessing change between methods\n        }\n\n        public void XmlReader_SettingsAsParameter(XmlReaderSettings settings)\n        {\n            XmlReader.Create(\"uri\", settings).Dispose(); // Compliant - we don't track settings change between methods\n        }\n\n        public void processXml(string xml)\n        {\n            var settings = new XmlReaderSettings();\n\n            settings.ProhibitDtd = false;\n            settings.XmlResolver = new XmlSafeResolver(); // In order to avoid false positives we check the exact type of XmlResolver not to be XmlUrlResolver or XmlPreloadedResolver\n\n            XmlReader.Create(\"uri\", settings).Dispose(); // Compliant\n        }\n    }\n\n    // Example of partial sanitization recommended by microsoft\n    // https://docs.microsoft.com/en-us/archive/msdn-magazine/2009/november/xml-denial-of-service-attacks-and-defenses#defending-against-external-entity-attacks\n    internal class XmlSafeResolver : XmlUrlResolver\n    {\n        public override object GetEntity(Uri absoluteUri, string role, Type ofObjectToReturn)\n        {\n            return null;\n        }\n    }\n\n    internal class VariousUsages\n    {\n        XmlReader secure = XmlReader.Create(\"uri\"); // Compliant\n        XmlReader unsecure = XmlReader.Create(\"uri\", new XmlReaderSettings // Noncompliant\n        {\n            DtdProcessing = DtdProcessing.Parse, // Secondary\n            XmlResolver = new XmlUrlResolver() // Secondary\n        });\n\n        public XmlReader CreateReader(XmlReaderSettings settings)\n        {\n            return XmlReader.Create(\"uri\", settings); // Compliant\n        }\n\n        public XmlReader CreateReader_AndUpdateSettings_Unsecure(XmlReaderSettings settings)\n        {\n            settings.DtdProcessing = DtdProcessing.Parse; // Secondary\n            settings.XmlResolver = new XmlUrlResolver(); // Secondary\n\n            return XmlReader.Create(\"uri\", settings); // Noncompliant\n        }\n\n        public XmlReader CreateReader_AndUpdateSettings_Secure(XmlReaderSettings settings)\n        {\n            settings.DtdProcessing = DtdProcessing.Ignore;\n            settings.XmlResolver = null;\n\n            return XmlReader.Create(\"uri\", settings); // Compliant\n        }\n\n        public void InsideTryCatch()\n        {\n            // Secondary@+1\n            var settings = new XmlReaderSettings { DtdProcessing = DtdProcessing.Parse, XmlResolver = new XmlUrlResolver() }; // Secondary\n            try\n            {\n                XmlNodeReader.Create(\"uri\", settings).Dispose(); // Noncompliant\n            }\n            catch\n            {\n            }\n        }\n\n        private void InsideLocalFunction()\n        {\n            // Secondary@+1\n            var settings = new XmlReaderSettings { DtdProcessing = DtdProcessing.Parse, XmlResolver = new XmlUrlResolver() }; // Secondary\n\n            void LocalFunction()\n            {\n                XmlNodeReader.Create(\"uri\", settings).Dispose(); // Noncompliant\n            }\n        }\n\n        private void InsideLambda()\n        {\n            // Secondary@+1\n            Func<XmlReaderSettings> settingsFactory = () => new XmlReaderSettings { DtdProcessing = DtdProcessing.Parse, XmlResolver = new XmlUrlResolver() }; // Secondary\n\n            var settings = settingsFactory();\n\n            XmlNodeReader.Create(\"uri\", settingsFactory()).Dispose(); // Noncompliant\n        }\n\n        private XmlUrlResolver GetUrlResolver() => new XmlUrlResolver();\n\n        private void SetUnsafeResolverFromMethod()\n        {\n            var settings = new XmlReaderSettings();\n            settings.DtdProcessing = DtdProcessing.Parse; // Secondary\n            settings.XmlResolver = GetUrlResolver(); // Secondary\n\n            XmlNodeReader.Create(\"uri\", settings).Dispose(); // Noncompliant\n        }\n    }\n\n    // https://docs.microsoft.com/en-us/dotnet/api/system.xml.xmlreader?view=netframework-4.8#creating-an-xml-reader\n    internal class ConcreteImplementations\n    {\n        public void XmlNodeReader_Default()\n        {\n            XmlNodeReader.Create(\"uri\").Dispose(); // Compliant\n        }\n\n        public void XmlNodeReader_SecureSettings()\n        {\n            var settings = new XmlReaderSettings { DtdProcessing = DtdProcessing.Ignore, XmlResolver = new XmlUrlResolver() };\n\n            XmlNodeReader.Create(\"uri\", settings).Dispose(); // Compliant\n        }\n\n        public void XmlNodeReader_UnsecureSettings()\n        {\n            // Secondary@+1\n            var settings = new XmlReaderSettings { DtdProcessing = DtdProcessing.Parse, XmlResolver = new XmlUrlResolver() }; // Secondary\n\n            // Although the XmlNodeReader is safe when using the constructor, the Create method is the one from the base class (XmlReader)\n            // and will return an unsecure XmlReader.\n            XmlNodeReader.Create(\"uri\", settings).Dispose(); // Noncompliant\n        }\n\n        public void XmlTextReader_Default()\n        {\n            XmlTextReader.Create(\"uri\").Dispose(); // Compliant\n        }\n\n        public void XmlTextReader_SecureSettings()\n        {\n            var settings = new XmlReaderSettings { DtdProcessing = DtdProcessing.Ignore, XmlResolver = new XmlUrlResolver() };\n\n            XmlTextReader.Create(\"uri\", settings).Dispose(); // Compliant\n        }\n\n        public void XmlTextReader_UnsecureSettings()\n        {\n            // Secondary@+1\n            var settings = new XmlReaderSettings { DtdProcessing = DtdProcessing.Parse, XmlResolver = new XmlUrlResolver() }; // Secondary\n\n            // The Create method is the one from the base class (XmlReader) and will return an unsecure XmlReader.\n            XmlTextReader.Create(\"uri\", settings).Dispose(); // Noncompliant\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/XmlExternalEntityShouldNotBeParsed_XmlReader_ParameterProvider.cs",
    "content": "﻿using System.Xml;\n\nnamespace SonarAnalyzer.Test.TestCases\n{\n    public class XmlReaderParameterProvider\n    {\n        internal static readonly XmlReaderSettings Settings = new XmlReaderSettings\n        {\n            Async = false,\n            DtdProcessing = DtdProcessing.Parse,\n            XmlResolver = new XmlUrlResolver()\n        };\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/XmlExternalEntityShouldNotBeParsed_XmlTextReader.cs",
    "content": "﻿using System.IO;\nusing System.Xml;\n\nnamespace Tests.Diagnostics\n{\n    /// <summary>\n    /// Tests for .NET Framework 4.5.2+\n    /// The constructor is safe. One must assign an unsafe resolver to become unsafe.\n    /// </summary>\n    class NoncompliantTests_After_Net_4_5_2\n    {\n        XmlTextReader reader = new XmlTextReader(\"resources/\") { XmlResolver = new XmlUrlResolver() }; // Noncompliant\n\n        protected void XmlTextReader_ParameterResolver(XmlUrlResolver parameter)\n        {\n            XmlTextReader reader = new XmlTextReader(\"resources/\");\n            // we don't really know it's null or not\n            reader.XmlResolver = parameter; // Noncompliant {{Disable access to external entities in XML parsing.}}\n        }\n\n        protected void XmlTextReader_NewResolver(XmlNameTable table)\n        {\n            XmlTextReader reader = new XmlTextReader(\"resources/\", table);\n            reader.XmlResolver = new XmlUrlResolver(); // Noncompliant\n        }\n\n        protected void XmlTextReader_DifferentConstructorWithNewResolver(string xmlFragment, XmlNodeType fragType, XmlParserContext context)\n        {\n            XmlTextReader reader = new XmlTextReader(xmlFragment, fragType, context);\n            reader.XmlResolver = new XmlUrlResolver(); // Noncompliant\n        }\n\n        protected void XmlTextReader_SetDtdProcessing(XmlNameTable table)\n        {\n            XmlTextReader reader = new XmlTextReader(\"resources/\", table);\n            reader.DtdProcessing = DtdProcessing.Parse; // Noncompliant\n        }\n\n        protected void XmlTextReader_SetDtdProcessingWithNullResolver()\n        {\n            XmlTextReader reader = new XmlTextReader(\"resources/\");\n            reader.DtdProcessing = DtdProcessing.Parse; // Noncompliant\n            reader.XmlResolver = null;\n        }\n\n        protected void XmlTextReader_SetNonNullResolverWithDtdProcessingProhibit()\n        {\n            XmlTextReader reader = new XmlTextReader(\"resources/\");\n            reader.DtdProcessing = DtdProcessing.Prohibit;\n            reader.XmlResolver = new XmlUrlResolver(); // Noncompliant\n        }\n\n        protected void XmlTextReader_WithoutConstructor(XmlTextReader reader)\n        {\n            reader.XmlResolver = new XmlUrlResolver(); // Noncompliant\n        }\n    }\n\n    class CompliantTests_After_Net_4_5_2\n    {\n        // System.Xml.XmlTextReader\n        protected void XmlTextReader_Constructor(XmlNameTable table)\n        {\n            XmlTextReader reader = new XmlTextReader(\"resources/\", table);\n        }\n\n        protected void XmlTextReader_SafeResolver(string xmlFragment, XmlNodeType fragType, XmlParserContext context)\n        {\n            XmlTextReader reader = new XmlTextReader(xmlFragment, fragType, context);\n            reader.XmlResolver = new XmlSecureResolver(null, \"\");\n        }\n\n        protected void XmlTextReader_SetProhibit(XmlNameTable table)\n        {\n            XmlTextReader reader = new XmlTextReader(\"resources/\", table);\n            reader.DtdProcessing = DtdProcessing.Prohibit;\n        }\n\n        protected void XmlTextReader_SetIgnore(XmlNameTable table)\n        {\n            XmlTextReader reader = new XmlTextReader(\"resources/\", table);\n            reader.DtdProcessing = DtdProcessing.Ignore;\n        }\n\n        protected void XmlTextReader_SetIgnoreAndNullResolver(XmlNameTable table)\n        {\n            XmlTextReader reader = new XmlTextReader(\"resources/\", table);\n            reader.DtdProcessing = DtdProcessing.Ignore;\n            reader.XmlResolver = null;\n        }\n    }\n\n    /// <summary>\n    ///  These are not testing the APIs per se, but other test combinations\n    /// </summary>\n    class VariousUnsafeCombinations\n    {\n        private void LoopAndTry()\n        {\n            XmlTextReader reader = new XmlTextReader(\"resources/\");\n            while (true)\n            {\n                reader.DtdProcessing = DtdProcessing.Prohibit;\n            }\n            try\n            {\n                reader.XmlResolver = new XmlUrlResolver(); // Noncompliant\n            }\n            catch\n            {\n\n            }\n        }\n\n        protected void InsideIf_MakeUnsafeInCondition_SanitizeAfter(bool foo)\n        {\n            XmlTextReader reader = new XmlTextReader(\"resources/\");\n            if (foo)\n            {\n                reader.XmlResolver = new XmlUrlResolver(); // Noncompliant\n            }\n            reader.XmlResolver = null; // this is ok\n        }\n\n        protected void InsideIf_SanitizeInsideCondition(bool foo)\n        {\n            XmlTextReader reader = new XmlTextReader(\"resources/\"); // FN\n            if (foo)\n            {\n                reader.XmlResolver = null; // not enough, conditional\n            }\n        }\n\n        protected void InsideIf_MakeUnsafeInCondition(bool foo)\n        {\n            XmlTextReader reader = new XmlTextReader(\"resources/\");\n            if (foo)\n            {\n                reader.XmlResolver = new XmlUrlResolver(); // Noncompliant\n            }\n        }\n\n        public void MultipleVulnerableApisInSameMethod()\n        {\n            XmlTextReader reader1 = new XmlTextReader(\"resources/\");\n            XmlTextReader reader2 = new XmlTextReader(\"resources/\");\n            reader1.XmlResolver = new XmlUrlResolver(); // Noncompliant\n            reader2.XmlResolver = new XmlUrlResolver(); // Noncompliant\n        }\n\n        delegate XmlUrlResolver TestDelegate();\n        private void LambdaFunction()\n        {\n            TestDelegate resolverFactory = () => new XmlUrlResolver();\n            XmlTextReader reader = new XmlTextReader(\"resources/\");\n            reader.XmlResolver = resolverFactory(); // Noncompliant\n        }\n\n        protected void PropagateValues_Parse(XmlNameTable table)\n        {\n            XmlTextReader reader = new XmlTextReader(\"resources/\", table);\n            var parse = DtdProcessing.Parse;\n            reader.DtdProcessing = parse; // Noncompliant\n        }\n\n        protected void PropagateValues_Null(XmlNameTable table)\n        {\n            XmlTextReader reader = new XmlTextReader(\"resources/\", table);\n            XmlUrlResolver nullResolver = null;\n            reader.XmlResolver = nullResolver; // Noncompliant FP\n        }\n\n        public void WithUsingStatement()\n        {\n            using (FileStream fs = new FileStream(\"\", FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Delete))\n            using (XmlTextReader r = new XmlTextReader(fs, XmlNodeType.Element, null))\n            {\n                r.XmlResolver = null; // no DTD resolving\n                while (r.Read())\n                {\n                }\n            }\n\n            using (FileStream fs2 = new FileStream(\"\", FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Delete))\n            using (XmlTextReader r2 = new XmlTextReader(fs2, XmlNodeType.Element, null))\n            {\n                r2.XmlResolver = new XmlUrlResolver(); // Noncompliant\n                while (r2.Read())\n                {\n                }\n            }\n\n        }\n\n        public void WithUsingInsideUsingStatement(bool b)\n        {\n            using (FileStream fs = new FileStream(\"\", FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Delete))\n            using (XmlTextReader r = new XmlTextReader(fs, XmlNodeType.Element, null))\n            {\n                r.XmlResolver = null; // no DTD resolving\n                while (r.Read())\n                {\n                }\n                if (b)\n                {\n\n                }\n                else\n                {\n                    string s = \"\";\n                    if (s != null)\n                    {\n                        using (FileStream innerFs = new FileStream(\"\", FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Delete))\n                        using (XmlTextReader innerReader = new XmlTextReader(fs, XmlNodeType.Element, null))\n                        {\n                            innerReader.XmlResolver = null; // no DTD resolving\n                        }\n                    }\n                }\n            }\n        }\n\n        public void WithUsingExpression()\n        {\n            using FileStream fs = new FileStream(\"\", FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Delete);\n            using XmlTextReader r = new XmlTextReader(fs, XmlNodeType.Element, null);\n            r.XmlResolver = null; // no DTD resolving\n            while (r.Read())\n            {\n            }\n        }\n    }\n\n    public class OtherTests\n    {\n        protected void XmlTextReader_NoAssignmentToResolver(XmlUrlResolver parameter)\n        {\n            XmlTextReader reader = new XmlTextReader(\"resources/\");\n            XmlUrlResolver unusedResolver = new XmlUrlResolver(); // initialized but not assigned\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/XmlExternalEntityShouldNotBeParsed_XmlTextReader_CSharp10.cs",
    "content": "﻿using System.Xml;\n\npublic record struct S\n{\n    void XmlTextReader_NewResolver(XmlNameTable table)\n    {\n        XmlTextReader reader = new(\"resources/\", table);\n        (reader.XmlResolver, var x) = (new XmlUrlResolver(), 0); // Noncompliant\n    }\n\n    public void SetValueAfterObjectInitialization(XmlNameTable table)\n    {\n        XmlTextReader reader1 = new(\"resources/\", table) { XmlResolver = new XmlUrlResolver() }; // Compliant, property is set below\n        (reader1.XmlResolver, var x1) = (null, 0);\n\n        XmlTextReader reader2 = new(\"resources/\", table) { XmlResolver = new XmlUrlResolver() }; // Noncompliant  \n        (reader2.XmlResolver, var x2) = (new XmlUrlResolver(), 0); // Noncompliant\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/XmlExternalEntityShouldNotBeParsed_XmlTextReader_CSharp9.cs",
    "content": "﻿using System.Xml;\n\nXmlTextReader reader = new(\"resources/\") { XmlResolver = new XmlUrlResolver() }; // Noncompliant\n\nvoid XmlTextReader_NewResolver_NotTopLevel()\n{\n    XmlTextReader reader = new(\"resources/\") { XmlResolver = new XmlUrlResolver() }; // Noncompliant\n}\n\nvoid XmlTextReader_NewResolver(XmlNameTable table)\n{\n    XmlTextReader reader = new (\"resources/\", table);\n    reader.XmlResolver = new XmlUrlResolver(); // Noncompliant\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/XmlExternalEntityShouldNotBeParsed_XmlTextReader_Net35.cs",
    "content": "﻿using System.IO;\nusing System.Xml;\n\nnamespace NetFramework35\n{\n    /// <summary>\n    /// In .NET Framework 3.5\n    /// - the constructor is unsafe by default\n    /// - the ProhibitDtd is false by default and should be set to true\n    /// </summary>\n    class XmlTextReaderTest\n    {\n        private const string Url = \"resources/\";\n\n        protected static void XmlTextReader_Constructor()\n        {\n            var reader = new XmlTextReader(Url); // Noncompliant\n        }\n\n        protected static void XmlTextReader_ConstructorWithSanitize()\n        {\n            var reader = new XmlTextReader(Url) { ProhibitDtd = true };\n        }\n\n        protected static void XmlTextReader_SetOnObject(XmlTextReader reader)\n        {\n            reader.ProhibitDtd = false; // Noncompliant\n        }\n\n        protected static void XmlTextReader_Sanitize()\n        {\n            var reader = new XmlTextReader(Url);\n            reader.ProhibitDtd = true; // ok\n        }\n\n        protected static void XmlTextReader_ConstructorWithVulnerableSet()\n        {\n            var reader = new XmlTextReader(Url); // Noncompliant in 3.5\n            reader.ProhibitDtd = false; // Noncompliant duplicate (it's setting what's already default)\n        }\n\n        protected static void XmlTextReader_InsideIf(bool foo)\n        {\n            var reader = new XmlTextReader(Url); // Noncompliant\n            if (foo)\n            {\n                reader.ProhibitDtd = true; // this is set conditionally, so not enough\n            }\n        }\n\n        public void WithUsingStatement()\n        {\n            using (FileStream fs = new FileStream(\"\", FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Delete))\n            using (XmlTextReader r = new XmlTextReader(fs, XmlNodeType.Element, null))\n            {\n                r.XmlResolver = null; // no DTD resolving\n                while (r.Read())\n                {\n                }\n            }\n\n            using (FileStream fs2 = new FileStream(\"\", FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Delete))\n            using (XmlTextReader r2 = new XmlTextReader(fs2, XmlNodeType.Element, null)) // Noncompliant\n            {\n                r2.XmlResolver = new XmlUrlResolver(); // Noncompliant\n                while (r2.Read())\n                {\n                }\n            }\n\n        }\n\n        public void WithUsingInsideUsingStatement(bool b)\n        {\n            using (FileStream fs = new FileStream(\"\", FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Delete))\n            {\n                using (XmlTextReader r = new XmlTextReader(fs, XmlNodeType.Element, null))\n                {\n                    r.XmlResolver = null; // no DTD resolving\n                    while (r.Read())\n                    {\n                    }\n                    if (b)\n                    {\n\n                    }\n                    else\n                    {\n                        string s = \"\";\n                        if (s != null)\n                        {\n                            using (FileStream innerFs = new FileStream(\"\", FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Delete))\n                            using (XmlTextReader innerReader = new XmlTextReader(fs, XmlNodeType.Element, null))\n                            {\n                                innerReader.XmlResolver = null; // no DTD resolving\n                            }\n                        }\n                    }\n                }\n            }\n        }\n\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/XmlExternalEntityShouldNotBeParsed_XmlTextReader_Net4.cs",
    "content": "﻿using System.Xml;\n\nnamespace NetFramework4\n{\n    /// <summary>\n    /// In .NET Framework 4\n    /// - the constructor is unsafe\n    /// - the ProhibitDtd property is deprecated, being replaced by DtdProcessing which by default is Parse\n    /// - to sanitize, the XmlResolver must be set to null or set DtdProcessing to Ignore/Prohibit\n    /// </summary>\n    class XmlTextReaderTest\n    {\n        private const string Url = \"resources/\";\n\n        protected static void XmlTextReader_Constructor()\n        {\n            new XmlTextReader(Url); // Noncompliant\n        }\n\n        protected void XmlTextReader_ConstructorWithSetToNull()\n        {\n            var reader = new XmlTextReader(\"resources/\");\n            reader.XmlResolver = null; // compliant before 4.5.2, as well\n\n            var another = new XmlTextReader(\"resources/\") { XmlResolver = null };\n        }\n\n        protected static XmlTextReader XmlTextReader_SetWithParameter(XmlUrlResolver parameter)\n        {\n            var reader = new XmlTextReader(Url); // Noncompliant\n            reader.XmlResolver = parameter; // Noncompliant - duplicate issue\n            return reader;\n        }\n\n        protected static void XmlTextReader_ValidateWithDtdProcessing_Parse()\n        {\n            var reader = new XmlTextReader(Url);\n            reader.DtdProcessing = DtdProcessing.Prohibit; // ok\n        }\n\n        protected static void XmlTextReader_ValidateWithDtdProcessing_Ignore()\n        {\n            XmlTextReader reader = new XmlTextReader(Url);\n            reader.DtdProcessing = DtdProcessing.Ignore; // ok\n        }\n\n        protected static void XmlTextReader_ValidateAndSet()\n        {\n            XmlTextReader reader = new XmlTextReader(Url);\n            reader.DtdProcessing = DtdProcessing.Ignore; // ok\n            reader.XmlResolver = new XmlUrlResolver(); // Noncompliant - FP, but probably it's not that bad that we raise\n        }\n\n        protected void XmlTextReader_InsideIf(bool foo)\n        {\n            var reader = new XmlTextReader(\"resources/\"); // Noncompliant\n            if (foo)\n            {\n                reader.XmlResolver = null; // conditionally set; not enough\n            }\n        }\n\n        protected void XmlTextReader_InsideIf2(bool foo)\n        {\n            var reader = new XmlTextReader(\"resources/\");\n            if (foo)\n            {\n                reader.XmlResolver = null;\n            }\n            reader.XmlResolver = null; // this is ok\n        }\n\n        protected void XmlTextReader_InsideIf3(bool foo)\n        {\n            var reader = new XmlTextReader(\"resources/\"); // sanitized after the if\n            if (foo)\n            {\n                reader.XmlResolver = new XmlUrlResolver(); // Noncompliant\n            }\n            reader.XmlResolver = null;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestCases/XmlExternalEntityShouldNotBeParsed_XmlTextReader_UnknownFrameworkVersion.cs",
    "content": "﻿using System.Xml;\n\nnamespace NetFrameworkUnknown\n{\n    /// <summary>\n    /// Unknown framework - we assume it is like in .NET Framework 4.5.2 : safe constructor\n    /// </summary>\n    class XmlTextReaderTest\n    {\n        private const string Url = \"resources/\";\n\n        protected static void XmlTextReader_Constructor()\n        {\n            new XmlTextReader(Url);\n        }\n\n        protected void XmlTextReader_SanitizeWithNull()\n        {\n            var reader = new XmlTextReader(\"resources/\");\n            reader.XmlResolver = null;\n        }\n\n        protected void XmlTextReader_SetUnsafeResolver(XmlNameTable table)\n        {\n            XmlTextReader reader = new XmlTextReader(\"resources/\", table);\n            reader.XmlResolver = new XmlUrlResolver(); // Noncompliant\n        }\n\n        protected static XmlTextReader XmlTextReader_SetUnsafeResolverFromParameter(XmlUrlResolver parameter)\n        {\n            var reader = new XmlTextReader(Url);\n            reader.XmlResolver = parameter; // Noncompliant\n            return reader;\n        }\n\n        protected static void XmlTextReader_SanitizeWithProperty()\n        {\n            var reader = new XmlTextReader(Url);\n            reader.DtdProcessing = DtdProcessing.Prohibit;\n        }\n\n        protected static void XmlTextReader_SanitizeWithProperty2()\n        {\n            XmlTextReader reader = new XmlTextReader(Url);\n            reader.DtdProcessing = DtdProcessing.Ignore;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestResources/ProjectOutFolderPath.txt",
    "content": "﻿path\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestResources/SonarLintXml/All_properties_cs/SonarLint.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<AnalysisInput>\n  <Settings>\n    <Setting>\n      <Key>sonar.cs.analyzeRazorCode</Key>\n      <Value>false</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.cs.ignoreHeaderComments</Key>\n      <Value>true</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.cs.analyzeGeneratedCode</Key>\n      <Value>false</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.cs.file.suffixes</Key>\n      <Value>.cs</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.cs.roslyn.ignoreIssues</Key>\n      <Value>false</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.exclusions</Key>\n      <Value>Fake/Exclusions/**/*,Fake/Exclusions/Second*/**/*</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.inclusions</Key>\n      <Value>Fake/Inclusions/**/*,Fake/Inclusions/Second*/**/*</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.global.exclusions</Key>\n      <Value>Fake/GlobalExclusions/**/*,Fake/GlobalExclusions/Second*/**/*</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.test.exclusions</Key>\n      <Value>Fake/TestExclusions/**/*,Fake/TestExclusions/Second*/**/*</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.test.inclusions</Key>\n      <Value>Fake/TestInclusions/**/*,Fake/TestInclusions/Second*/**/*</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.global.test.exclusions</Key>\n      <Value>Fake/GlobalTestExclusions/**/*,Fake/GlobalTestExclusions/Second*/**/*</Value>\n    </Setting>\n  </Settings>\n  <Rules>\n    <Rule>\n      <Key>S2225</Key>\n    </Rule>\n    <Rule>\n      <Key>S2342</Key>\n      <Parameters>\n        <Parameter>\n          <Key>format</Key>\n          <Value>^([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?$</Value>\n        </Parameter>\n        <Parameter>\n          <Key>flagsAttributeFormat</Key>\n          <Value>^([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?s$</Value>\n        </Parameter>\n      </Parameters>\n    </Rule>\n    <Rule>\n      <Key>S2346</Key>\n    </Rule>\n\t<Rule>\n      <Key>S1067</Key>\n      <Parameters>\n        <Parameter>\n          <Key>max</Key>\n          <Value>1</Value>\n        </Parameter>\n      </Parameters>\n    </Rule>\n  </Rules>\n  <Files> \n  </Files>\n</AnalysisInput>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestResources/SonarLintXml/All_properties_vbnet/SonarLint.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<AnalysisInput>\n  <Settings>\n    <Setting>\n      <Key>sonar.vbnet.ignoreHeaderComments</Key>\n      <Value>true</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.vbnet.analyzeGeneratedCode</Key>\n      <Value>false</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.vbnet.file.suffixes</Key>\n      <Value>.vb</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.vbnet.roslyn.ignoreIssues</Key>\n      <Value>false</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.exclusions</Key>\n      <Value>Fake/Exclusions/**/*,Fake/Exclusions/Second*/**/*</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.inclusions</Key>\n      <Value>Fake/Inclusions/**/*,Fake/Inclusions/Second*/**/*</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.global.exclusions</Key>\n      <Value>Fake/GlobalExclusions/**/*,Fake/GlobalExclusions/Second*/**/*</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.test.exclusions</Key>\n      <Value>Fake/TestExclusions/**/*,Fake/TestExclusions/Second*/**/*</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.test.inclusions</Key>\n      <Value>Fake/TestInclusions/**/*,Fake/TestInclusions/Second*/**/*</Value>\n    </Setting>\n    <Setting>\n      <Key>sonar.global.test.exclusions</Key>\n      <Value>Fake/GlobalTestExclusions/**/*,Fake/GlobalTestExclusions/Second*/**/*</Value>\n    </Setting>\n  </Settings>\n  <Rules>\n    <Rule>\n      <Key>S2225</Key>\n    </Rule>\n    <Rule>\n      <Key>S2342</Key>\n      <Parameters>\n        <Parameter>\n          <Key>format</Key>\n          <Value>^([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?$</Value>\n        </Parameter>\n        <Parameter>\n          <Key>flagsAttributeFormat</Key>\n          <Value>^([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?s$</Value>\n        </Parameter>\n      </Parameters>\n    </Rule>\n    <Rule>\n      <Key>S2115</Key>\n    </Rule>\n    <Rule>\n      <Key>S3776</Key>\n      <Parameters>\n        <Parameter>\n          <Key>threshold</Key>\n          <Value>15</Value>\n        </Parameter>\n        <Parameter>\n          <Key>propertyThreshold</Key>\n          <Value>3</Value>\n        </Parameter>\n      </Parameters>\n    </Rule>\n  </Rules>\n  <Files> \n  </Files>\n</AnalysisInput>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestResources/SonarLintXml/Invalid_Xml/SonarLint.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<AnalysisInput\n  <Settings>\n    Setting>\n      <Key>sonar.nothing</Key>\n      <Value>nothing</Value>\n    </Setting>\n  </Settings>\n  <Rles>\n  </Rules>\n  Files> \n  </Files>\n<AnalysisInput>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestResources/SonarProjectConfig/Path_Unix/SonarProjectConfig.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<SonarProjectConfig xmlns=\"http://www.sonarsource.com/msbuild/analyzer/2021/1\">\n  <AnalysisConfigPath>/home/user/.sonarqube/conf/SonarQubeAnalysisConfig.xml</AnalysisConfigPath>\n  <ProjectPath>/home/user/AwesomeBankWeb.CSharp.csproj</ProjectPath>\n  <FilesToAnalyzePath>/home/user/.sonarqube/conf/0/FilesToAnalyze.txt</FilesToAnalyzePath>\n  <OutPath>/home/user/.sonarqube/out/0</OutPath>\n  <ProjectType>Test</ProjectType>\n  <TargetFramework>net5</TargetFramework>\n</SonarProjectConfig>"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestResources/SonarProjectConfig/Path_Windows/SonarProjectConfig.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<SonarProjectConfig xmlns=\"http://www.sonarsource.com/msbuild/analyzer/2021/1\">\n  <AnalysisConfigPath>c:\\foo\\bar\\.sonarqube\\conf\\SonarQubeAnalysisConfig.xml</AnalysisConfigPath>\n  <ProjectPath>C:\\foo\\bar\\AwesomeBankWeb.CSharp\\AwesomeBankWeb.CSharp.csproj</ProjectPath>\n  <FilesToAnalyzePath>c:\\foo\\bar\\.sonarqube\\conf\\0\\FilesToAnalyze.txt</FilesToAnalyzePath>\n  <OutPath>C:\\foo\\bar\\.sonarqube\\out\\0</OutPath>\n  <ProjectType>Product</ProjectType>\n  <TargetFramework>netcoreapp3.1</TargetFramework>\n</SonarProjectConfig>"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/TestSuiteInitialization.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.VisualBasic;\n\nnamespace SonarAnalyzer.Test;\n\n[TestClass]\npublic class TestSuiteInitialization\n{\n    [AssemblyInitialize]\n    public static void AssemblyInit(TestContext context)\n    {\n        ConfigureFluentValidation();\n\n        Console.WriteLine(@\"Running tests initialization...\");\n        Console.WriteLine(@$\"Build reason: {TestEnvironment.BuildReason() ?? \"Not set / Local build\"}\");\n\n        var csVersions = LanguageOptions.Default(LanguageNames.CSharp).Cast<CSharpParseOptions>().Select(x => x.LanguageVersion.ToDisplayString());\n        Console.WriteLine(@\"C# versions used for analysis: \" + string.Join(\", \", csVersions));\n\n        var vbVersions = LanguageOptions.Default(LanguageNames.VisualBasic).Cast<VisualBasicParseOptions>().Select(x => x.LanguageVersion.ToDisplayString());\n        Console.WriteLine(@\"VB.Net versions used for analysis: \" + string.Join(\", \", vbVersions));\n    }\n\n    private static void ConfigureFluentValidation()\n    {\n        AssertionOptions.FormattingOptions.MaxLines = -1;\n        AssertionOptions.FormattingOptions.MaxDepth = 5; // Keeping the default for MaxDepth of 5 as a good compromise. Change it here if needed.\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Trackers/ArgumentTrackerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Text;\nusing SonarAnalyzer.Core.Semantics.Extensions;\nusing SonarAnalyzer.Core.Trackers;\nusing SonarAnalyzer.CSharp.Core.Trackers;\nusing SonarAnalyzer.VisualBasic.Core.Trackers;\nusing CS = Microsoft.CodeAnalysis.CSharp.Syntax;\nusing VB = Microsoft.CodeAnalysis.VisualBasic.Syntax;\n\nnamespace SonarAnalyzer.Test.Trackers;\n\n[TestClass]\npublic class ArgumentTrackerTest\n{\n    [TestMethod]\n    public void Method_SimpleArgument()\n    {\n        var snippet = \"\"\"\n            System.IFormatProvider provider = null;\n            1.ToString($$provider);\n            \"\"\";\n        var context = ArgumentContextCS(WrapInMethodCS(snippet));\n\n        var descriptor = ArgumentDescriptor.MethodInvocation(KnownType.System_Int32, \"ToString\", \"provider\", 0);\n        var result = MatchArgumentCS(context, descriptor);\n        result.Should().BeTrue();\n        context.Parameter.Name.Should().Be(\"provider\");\n        context.Parameter.Type.Name.Should().Be(\"IFormatProvider\");\n    }\n\n    [TestMethod]\n    public void Method_SimpleArgument_VB()\n    {\n        var snippet = \"\"\"\n            Dim provider As System.IFormatProvider = Nothing\n            Dim i As Integer\n            i.ToString($$provider)\n            \"\"\";\n        var context = ArgumentContextVB(WrapInMethodVB(snippet));\n\n        var descriptor = ArgumentDescriptor.MethodInvocation(KnownType.System_Int32, \"ToString\", \"provider\", 0);\n        var result = MatchArgumentVB(context, descriptor);\n        result.Should().BeTrue();\n        context.Parameter.Name.Should().Be(\"provider\");\n        context.Parameter.Type.Name.Should().Be(\"IFormatProvider\");\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"M( $$ ,  , 1)\"\"\", \"i\", true)]\n    [DataRow(\"\"\"M( $$ ,  , 1)\"\"\", \"j\", false)]\n    [DataRow(\"\"\"M(  , $$ , 1)\"\"\", \"j\", true)]\n    [DataRow(\"\"\"M(  ,  , $$1)\"\"\", \"k\", true)]\n    [DataRow(\"\"\"M(  ,  , $$1)\"\"\", \"i\", false)]\n    public void Method_OmittedArgument_VB(string invocation, string parameterName, bool expected)\n    {\n        var snippet = $$\"\"\"\n            Public Class C\n                Public Sub M(Optional i As Integer = 0, Optional j As Integer = 0, Optional k As Integer = 0)\n                    {{invocation}}\n                End Sub\n            End Class\n            \"\"\";\n        var context = ArgumentContextVB(snippet);\n\n        var descriptor = ArgumentDescriptor.MethodInvocation(x => x.Name == \"M\", (s, c) => s.Equals(\"M\", c), x => x.Name == parameterName, _ => true, null);\n        var result = MatchArgumentVB(context, descriptor);\n        result.Should().Be(expected);\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"1.ToString($$provider);\"\"\", 0, true)]\n    [DataRow(\"\"\"1.ToString($$provider);\"\"\", 1, false)]\n    [DataRow(\"\"\"1.ToString(\"\", $$provider);\"\"\", 1, true)]\n    [DataRow(\"\"\"1.ToString(\"\", $$provider);\"\"\", 0, false)]\n    [DataRow(\"\"\"1.ToString(\"\", $$provider: provider);\"\"\", 1, true)]\n    [DataRow(\"\"\"1.ToString(\"\", $$provider: provider);\"\"\", 0, true)]\n    [DataRow(\"\"\"1.ToString($$provider: provider, format: \"\");\"\"\", 1, true)]\n    [DataRow(\"\"\"1.ToString($$provider: provider, format: \"\");\"\"\", 0, true)]\n    public void Method_Position(string invocation, int position, bool expected)\n    {\n        var snippet = $$\"\"\"\n            System.IFormatProvider provider = null;\n            {{invocation}}\n            \"\"\";\n        var context = ArgumentContextCS(WrapInMethodCS(snippet));\n\n        var descriptor = ArgumentDescriptor.MethodInvocation(KnownType.System_Int32, \"ToString\", \"provider\", position);\n        var result = MatchArgumentCS(context, descriptor);\n        result.Should().Be(expected);\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"i.ToString($$provider)\"\"\", 0, true)]\n    [DataRow(\"\"\"i.ToString($$provider)\"\"\", 1, false)]\n    [DataRow(\"\"\"i.ToString(\"\", $$provider)\"\"\", 1, true)]\n    [DataRow(\"\"\"i.ToString(\"\", $$provider)\"\"\", 0, false)]\n    [DataRow(\"\"\"i.ToString(\"\", $$provider:= provider)\"\"\", 1, true)]\n    [DataRow(\"\"\"i.ToString(\"\", $$provider:= provider)\"\"\", 0, true)]\n    [DataRow(\"\"\"i.ToString($$provider:= provider, format:= \"\")\"\"\", 1, true)]\n    [DataRow(\"\"\"i.ToString($$provider:= provider, format:= \"\")\"\"\", 0, true)]\n    public void Method_Position_VB(string invocation, int position, bool expected)\n    {\n        var snippet = $$\"\"\"\n            Dim provider As System.IFormatProvider = Nothing\n            Dim i As Integer\n            {{invocation}}\n            \"\"\";\n        var context = ArgumentContextVB(WrapInMethodVB(snippet));\n\n        var descriptor = ArgumentDescriptor.MethodInvocation(KnownType.System_Int32, \"ToString\", \"provider\", position);\n        var result = MatchArgumentVB(context, descriptor);\n        result.Should().Be(expected);\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"int.TryParse(\"\", $$out var result);\"\"\")]\n    [DataRow(\"\"\"int.TryParse(\"\", System.Globalization.NumberStyles.HexNumber, null, $$out var result);\"\"\")]\n    public void Method_RefOut_True(string invocation)\n    {\n        var snippet = $$\"\"\"\n            System.IFormatProvider provider = null;\n            {{invocation}}\n            \"\"\";\n        var context = ArgumentContextCS(WrapInMethodCS(snippet));\n\n        var descriptor = ArgumentDescriptor.MethodInvocation(KnownType.System_Int32, \"TryParse\", \"result\", _ => true, RefKind.Out);\n        var result = MatchArgumentCS(context, descriptor);\n        result.Should().BeTrue();\n        context.Parameter.RefKind.Should().Be(RefKind.Out);\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"Integer.TryParse(\"\", $$result)\"\"\")]\n    [DataRow(\"\"\"Integer.TryParse(\"\", System.Globalization.NumberStyles.HexNumber, Nothing, $$result)\"\"\")]\n    public void Method_RefOut_True_VB(string invocation)\n    {\n        var snippet = $$\"\"\"\n            Dim provider As System.IFormatProvider = Nothing\n            Dim result As Integer\n            {{invocation}}\n            \"\"\";\n        var context = ArgumentContextVB(WrapInMethodVB(snippet));\n\n        var descriptor = ArgumentDescriptor.MethodInvocation(KnownType.System_Int32, \"TryParse\", \"result\", _ => true, RefKind.Out);\n        var result = MatchArgumentVB(context, descriptor);\n        result.Should().BeTrue();\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"int.TryParse(\"\", $$out var result);\"\"\", RefKind.Ref)]\n    [DataRow(\"\"\"int.TryParse(\"\", $$out var result);\"\"\", RefKind.In)]\n    [DataRow(\"\"\"int.TryParse(\"\", $$out var result);\"\"\", RefKind.RefReadOnlyParameter)]\n    [DataRow(\"\"\"int.TryParse(\"\", System.Globalization.NumberStyles.HexNumber, null, $$out var result);\"\"\", RefKind.Ref)]\n    [DataRow(\"\"\"int.TryParse(\"\", System.Globalization.NumberStyles.HexNumber, null, $$out var result);\"\"\", RefKind.In)]\n    [DataRow(\"\"\"int.TryParse(\"\", System.Globalization.NumberStyles.HexNumber, null, $$out var result);\"\"\", RefKind.RefReadOnlyParameter)]\n    [DataRow(\"\"\"int.TryParse($$\"\", out var result);\"\"\", RefKind.Out)]\n    [DataRow(\"\"\"int.TryParse(\"\", $$System.Globalization.NumberStyles.HexNumber, null, out var result);\"\"\", RefKind.Out)]\n    public void Method_RefOut_False(string invocation, RefKind refKind)\n    {\n        var snippet = $$\"\"\"\n            System.IFormatProvider provider = null;\n            {{invocation}}\n            \"\"\";\n        var context = ArgumentContextCS(WrapInMethodCS(snippet));\n\n        var descriptor = ArgumentDescriptor.MethodInvocation(KnownType.System_Int32, \"TryParse\", \"result\", _ => true, refKind);\n        var result = MatchArgumentCS(context, descriptor);\n        result.Should().BeFalse();\n        context.Parameter.Should().BeNull();\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"int.TryParse(\"\", $$out var result);\"\"\")]\n    [DataRow(\"\"\"int.TryParse(\"\", System.Globalization.NumberStyles.HexNumber, null, $$out var result);\"\"\")]\n    public void Method_RefOut_Unspecified(string invocation)\n    {\n        var snippet = $$\"\"\"\n            System.IFormatProvider provider = null;\n            {{invocation}}\n            \"\"\";\n        var context = ArgumentContextCS(WrapInMethodCS(snippet));\n        var descriptor = ArgumentDescriptor.MethodInvocation(KnownType.System_Int32, \"TryParse\", \"result\", _ => true);\n        var result = MatchArgumentCS(context, descriptor);\n        result.Should().BeTrue();\n        context.Parameter.RefKind.Should().Be(RefKind.Out);\n    }\n\n    [TestMethod]\n    [DataRow(\"in s\")]\n    [DataRow(\"s\")] // \"in\" is optional on the call side\n    [DataRow(\"ref s\")] // Valid, but produces warning CS9191: The 'ref' modifier for argument 1 corresponding to 'in' parameter is equivalent to 'in'. Consider using 'in' instead.\n    public void Method_RefIn(string argument)\n    {\n        var snippet = $$\"\"\"\n            public readonly struct S { public readonly int I; }\n\n            public class C\n            {\n                public void M(in S s) { }\n\n                public void Test()\n                {\n                    var s = new S();\n                    M($${{argument}});\n                }\n            }\n            \"\"\";\n        var context = ArgumentContextCS(snippet);\n        var descriptor = ArgumentDescriptor.MethodInvocation(_ => true, (x, c) => string.Equals(x, \"M\", c), _ => true, _ => true, RefKind.In);\n        var result = MatchArgumentCS(context, descriptor);\n        result.Should().BeTrue();\n        context.Parameter.RefKind.Should().Be(RefKind.In);\n    }\n\n    [TestMethod]\n    [DataRow(\"in s\")]\n    [DataRow(\"s\")] // Valid, produces warning CS9192: Argument 1 should be passed with 'ref' or 'in' keyword\n    [DataRow(\"ref s\")]\n    public void Method_RefReadOnly(string argument)\n    {\n        var snippet = $$\"\"\"\n            public readonly struct S { public readonly int I; }\n\n            public class C\n            {\n                public void M(ref readonly S s) { }\n\n                public void Test()\n                {\n                    var s = new S();\n                    M($${{argument}});\n                }\n            }\n            \"\"\";\n        var context = ArgumentContextCS(snippet);\n\n        var descriptor = ArgumentDescriptor.MethodInvocation(_ => true, (x, c) => string.Equals(x, \"M\", c), _ => true, _ => true, RefKind.RefReadOnlyParameter);\n        var result = MatchArgumentCS(context, descriptor);\n        result.Should().BeTrue();\n        context.Parameter.RefKind.Should().Be(RefKind.RefReadOnlyParameter);\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"new Direct().M($$1);\"\"\", true)]\n    [DataRow(\"\"\"new DirectDifferentParameterName().M($$1);\"\"\", false)] // FN. This would require ExplicitOrImplicitInterfaceImplementations from the internal ISymbolExtensions in Roslyn.\n    [DataRow(\"\"\"(new Explicit() as I).M($$1);\"\"\", true)]\n    [DataRow(\"\"\"(new ExplicitDifferentParameterName() as I).M($$1);\"\"\", true)]\n    public void Method_Inheritance_Interface(string invocation, bool expected)\n    {\n        var snippet = $$\"\"\"\n            interface I\n            {\n                void M(int parameter);\n            }\n            public class Direct: I\n            {\n                public void M(int parameter) { }\n            }\n            public class DirectDifferentParameterName: I\n            {\n                public void M(int renamed) { }\n            }\n            public class Explicit: I\n            {\n                void I.M(int parameter) { }\n            }\n            public class ExplicitDifferentParameterName: I\n            {\n                void I.M(int renamed) { }\n            }\n            public class Test\n            {\n                void M()\n                {\n                    {{invocation}}\n                }\n            }\n            \"\"\";\n        var context = ArgumentContextCS(snippet);\n\n        var descriptor = ArgumentDescriptor.MethodInvocation(_ => true, (m, c) => m.Equals(\"M\", c), x => x.Name == \"parameter\", _ => true, null);\n        var result = MatchArgumentCS(context, descriptor);\n        result.Should().Be(expected);\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"Dim a = New Direct().M($$1)\"\"\", true)]\n    [DataRow(\"\"\"Dim a = New DirectDifferentParameterName().M($$1)\"\"\", false)] // FN. This would require ExplicitOrImplicitInterfaceImplementations from the internal ISymbolExtensions in Roslyn.\n    [DataRow(\"\"\"\n        Dim i As I = New Explicit()\n        i.M($$1)\n        \"\"\", true)]\n    [DataRow(\"\"\"\n        Dim i As I = New ExplicitDifferentParameterName()\n        i.M($$1)\n        \"\"\", true)]\n    public void Method_Inheritance_Interface_VB(string invocation, bool expected)\n    {\n        var snippet = $$\"\"\"\n            Interface I\n                Function M(ByVal parameter As Integer) As Boolean\n            End Interface\n\n            Public Class Direct\n                Implements I\n\n                Public Function M(parameter As Integer) As Boolean Implements I.M\n                End Function\n            End Class\n\n            Public Class DirectDifferentParameterName\n                Implements I\n\n                Public Function M(ByVal renamed As Integer) As Boolean Implements I.M\n                End Function\n            End Class\n\n            Public Class Explicit\n                Implements I\n\n                Private Function M(ByVal parameter As Integer) As Boolean Implements I.M\n                End Function\n            End Class\n\n            Public Class ExplicitDifferentParameterName\n                Implements I\n\n                Private Function M(ByVal renamed As Integer) As Boolean Implements I.M\n                End Function\n            End Class\n\n            Public Class Test\n                Private Sub M()\n                    {{invocation}}\n                End Sub\n            End Class\n            \"\"\";\n        var context = ArgumentContextVB(snippet);\n\n        var descriptor = ArgumentDescriptor.MethodInvocation(_ => true, (m, c) => m.Equals(\"M\", c), x => x.Name == \"parameter\", _ => true, null);\n        var result = MatchArgumentVB(context, descriptor);\n        result.Should().Be(expected);\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"comparer.Compare($$default, default);\"\"\")]\n    [DataRow(\"\"\"new MyComparer<int>().Compare($$1, 2);\"\"\")]\n    public void Method_Inheritance_BaseClasses_Generics(string invocation)\n    {\n        var snippet = $$\"\"\"\n            using System.Collections.Generic;\n            public class MyComparer<T> : Comparer<T>\n            {\n                public MyComparer() { }\n                public override int Compare(T a, T b) => 1; // The original definition uses x and y: int Compare(T? x, T? y)\n            }\n            public class Test\n            {\n                void M<T>(MyComparer<T> comparer)\n                {\n                    {{invocation}}\n                }\n            }\n            \"\"\";\n        var context = ArgumentContextCS(snippet);\n\n        var descriptor = ArgumentDescriptor.MethodInvocation(KnownType.System_Collections_Generic_Comparer_T, \"Compare\", \"x\", 0);\n        var result = MatchArgumentCS(context, descriptor);\n        result.Should().BeTrue();\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"comparer.Compare($$Nothing, Nothing)\"\"\", \"x\", true)]\n    [DataRow(\"\"\"comparer.Compare($$Nothing, Nothing)\"\"\", \"a\", false)]\n    [DataRow(\"\"\"Call New MyComparer(Of Integer)().Compare($$1, 2)\"\"\", \"x\", true)]\n    [DataRow(\"\"\"Call New MyComparer(Of Integer)().Compare($$1, 2)\"\"\", \"a\", false)]\n    public void Method_Inheritance_BaseClasses_Generics_VB(string invocation, string parameterName, bool expected)\n    {\n        var snippet = $$\"\"\"\n            Imports System.Collections.Generic\n\n            Public Class MyComparer(Of T)\n                Inherits Comparer(Of T)\n\n                Public Overrides Function Compare(ByVal a As T, ByVal b As T) As Integer ' The original definition uses x and y\n                    Return 1\n                End Function\n            End Class\n\n            Public Class Test\n                Private Sub M(Of T)(ByVal comparer As MyComparer(Of T))\n                    {{invocation}}\n                End Sub\n            End Class\n            \"\"\";\n        var context = ArgumentContextVB(snippet);\n\n        var descriptor = ArgumentDescriptor.MethodInvocation(KnownType.System_Collections_Generic_Comparer_T, \"Compare\", parameterName, 0);\n        var result = MatchArgumentVB(context, descriptor);\n        result.Should().Be(expected);\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"OnInsert($$1, null);\"\"\")]\n    [DataRow(\"\"\"OnInsert(position: $$1, null);\"\"\")]\n    public void Method_Inheritance_BaseClasses_Overrides(string invocation)\n    {\n        var snippet = $$\"\"\"\n            using System.Collections;\n            public class Collection<T> : CollectionBase\n            {\n                protected override void OnInsert(int position, object value) { }\n\n                void M(T arg)\n                {\n                    {{invocation}}\n                }\n            }\n            \"\"\";\n        var context = ArgumentContextCS(snippet);\n\n        var descriptor = ArgumentDescriptor.MethodInvocation(KnownType.System_Collections_CollectionBase, \"OnInsert\", \"index\", 0);\n        var result = MatchArgumentCS(context, descriptor);\n        result.Should().BeTrue();\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"OnInsert($$1, Nothing)\"\"\")]\n    [DataRow(\"\"\"OnInsert(position:= $$1, Nothing)\"\"\")]\n    public void Method_Inheritance_BaseClasses_Overrides_VB(string invocation)\n    {\n        var snippet = $$\"\"\"\n            Imports System.Collections\n\n            Public Class Collection(Of T)\n                Inherits CollectionBase\n\n                Protected Overrides Sub OnInsert(ByVal position As Integer, ByVal value As Object)\n                End Sub\n\n                Private Sub M(ByVal arg As T)\n                    {{invocation}}\n                End Sub\n            End Class\n            \"\"\";\n        var context = ArgumentContextVB(snippet);\n\n        var descriptor = ArgumentDescriptor.MethodInvocation(KnownType.System_Collections_CollectionBase, \"OnInsert\", \"index\", 0);\n        var result = MatchArgumentVB(context, descriptor);\n        result.Should().BeTrue();\n    }\n\n    [TestMethod]\n    // learn.microsoft.com/en-us/dotnet/api/system.string.format\n    [DataRow(\"\"\"string.Format(\"format\", $$0)\"\"\", \"arg0\")]\n    [DataRow(\"\"\"string.Format(\"format\", 0, $$1)\"\"\", \"arg1\")]\n    [DataRow(\"\"\"string.Format(\"format\", 0, 1, $$2)\"\"\", \"arg2\")]\n    [DataRow(\"\"\"string.Format(\"format\", 0, 1, 2, $$3)\"\"\", \"args\")]\n    [DataRow(\"\"\"string.Format(\"format\", 0, 1, $$2, 3)\"\"\", \"args\")]\n    [DataRow(\"\"\"string.Format(\"format\", 0, $$1, 2, 3)\"\"\", \"args\")]\n    [DataRow(\"\"\"string.Format(\"format\", $$0, 1, 2, 3)\"\"\", \"args\")]\n    [DataRow(\"\"\"string.Format(\"format\", arg2: 2, arg1: 1, $$arg0:0)\"\"\", \"arg0\")]\n    [DataRow(\"\"\"string.Format(\"format\", $$new object[0])\"\"\", \"args\")]\n    public void Method_ParamsArray(string invocation, string parameterName)\n    {\n        var snippet = $$\"\"\"\n                _ = {{invocation}};\n            \"\"\";\n        var context = ArgumentContextCS(WrapInMethodCS(snippet));\n\n        var descriptor = ArgumentDescriptor.MethodInvocation(KnownType.System_String, \"Format\", parameterName, x => x >= 1);\n        var result = MatchArgumentCS(context, descriptor);\n        result.Should().BeTrue();\n    }\n\n    [TestMethod]\n    // learn.microsoft.com/en-us/dotnet/api/system.string.format\n    [DataRow(\"\"\"String.Format(\"format\", $$0)\"\"\", \"arg0\")]\n    [DataRow(\"\"\"String.Format(\"format\", 0, $$1)\"\"\", \"arg1\")]\n    [DataRow(\"\"\"String.Format(\"format\", 0, 1, $$2)\"\"\", \"arg2\")]\n    [DataRow(\"\"\"String.Format(\"format\", 0, 1, 2, $$3)\"\"\", \"args\")]\n    [DataRow(\"\"\"String.Format(\"format\", arg2:=2, arg1:=1, $$arg0:=0)\"\"\", \"arg0\")]\n    [DataRow(\"\"\"String.Format(\"format\", $$New Object(){ })\"\"\", \"args\")]\n    public void Method_ParamsArray_VB(string invocation, string parameterName)\n    {\n        var snippet = $$\"\"\"\n                Dim a = {{invocation}}\n            \"\"\";\n        var context = ArgumentContextVB(WrapInMethodVB(snippet));\n\n        var descriptor = ArgumentDescriptor.MethodInvocation(KnownType.System_String, \"Format\", parameterName, x => x >= 1);\n        var result = MatchArgumentVB(context, descriptor);\n        result.Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void Method_NamelessMethod()\n    {\n        var snippet = \"\"\"\n                using System;\n                class C\n                {\n                    Action<int> ActionReturning() => null;\n\n                    void M()\n                    {\n                        ActionReturning()($$1);\n                    }\n                }\n            \"\"\";\n        var context = ArgumentContextCS(snippet);\n\n        var descriptor = ArgumentDescriptor.MethodInvocation(KnownType.System_Action_T, methodName: string.Empty, \"obj\", 0);\n        var result = MatchArgumentCS(context, descriptor);\n        result.Should().BeTrue();\n        context.Parameter.Name.Should().Be(\"obj\");\n        context.Parameter.ContainingSymbol.Name.Should().Be(\"Invoke\");\n        context.Parameter.ContainingType.Name.Should().Be(\"Action\");\n    }\n\n    [TestMethod]\n    public void Method_InvocationOnProperty()\n    {\n        var snippet = \"\"\"\n                using System.Collections.Generic;\n                class C\n                {\n                    public IList<int> List { get; } = new List<int>();\n                    void M()\n                    {\n                        List.Add($$1); // Add is defined on ICollection<T> while the List property is of type IList<T>, invokedMemberNodeConstraint can figure this out\n                    }\n                }\n            \"\"\";\n        var context = ArgumentContextCS(snippet);\n\n        var descriptor = ArgumentDescriptor.MethodInvocation(\n            invokedMemberConstraint: x => x.Is(KnownType.System_Collections_Generic_ICollection_T, \"Add\"),\n            invokedMemberNameConstraint: (x, c) => string.Equals(x, \"Add\", c),\n            invokedMemberNodeConstraint: (model, language, node) =>\n                node is CS.InvocationExpressionSyntax { Expression: CS.MemberAccessExpressionSyntax { Expression: CS.IdentifierNameSyntax { Identifier.ValueText: { } leftName } left } }\n                    && language.NameComparer.Equals(leftName, \"List\")\n                    && model.GetSymbolInfo(left).Symbol is IPropertySymbol property\n                    && property.Type.Is(KnownType.System_Collections_Generic_IList_T),\n            parameterConstraint: _ => true,\n            argumentListConstraint: (_, _) => true,\n            refKind: null);\n        var result = MatchArgumentCS(context, descriptor);\n        result.Should().BeTrue();\n        context.Parameter.Name.Should().Be(\"item\");\n        context.Parameter.ContainingSymbol.Name.Should().Be(\"Add\");\n        context.Parameter.ContainingType.Name.Should().Be(\"ICollection\");\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"ProcessStartInfo($$\"fileName\")\"\"\", \"fileName\", 0, true)]\n    [DataRow(\"\"\"ProcessStartInfo($$\"fileName\")\"\"\", \"arguments\", 1, false)]\n    [DataRow(\"\"\"ProcessStartInfo(\"fileName\", $$\"arguments\")\"\"\", \"arguments\", 1, true)]\n    [DataRow(\"\"\"ProcessStartInfo(\"fileName\", $$\"arguments\")\"\"\", \"arguments\", 0, false)]\n    [DataRow(\"\"\"ProcessStartInfo($$\"fileName\", \"arguments\")\"\"\", \"arguments\", 1, false)]\n    [DataRow(\"\"\"ProcessStartInfo(arguments: $$\"arguments\", fileName: \"fileName\")\"\"\", \"arguments\", 1, true)]\n    [DataRow(\"\"\"ProcessStartInfo(arguments: $$\"arguments\", fileName: \"fileName\")\"\"\", \"fileName\", 0, false)]\n    [DataRow(\"\"\"ProcessStartInfo(arguments: \"arguments\", $$fileName: \"fileName\")\"\"\", \"fileName\", 0, true)]\n    [DataRow(\"\"\"ProcessStartInfo(arguments: \"arguments\", $$fileName: \"fileName\")\"\"\", \"arguments\", 1, false)]\n    public void Constructor_SimpleArgument(string constructor, string parameterName, int descriptorPosition, bool expected)\n    {\n        var snippet = $$\"\"\"\n            _ = new System.Diagnostics.{{constructor}};\n            \"\"\";\n        var context = ArgumentContextCS(WrapInMethodCS(snippet));\n\n        var descriptor = ArgumentDescriptor.ConstructorInvocation(KnownType.System_Diagnostics_ProcessStartInfo, parameterName, descriptorPosition);\n        var result = MatchArgumentCS(context, descriptor);\n        result.Should().Be(expected);\n        if (expected)\n        {\n            context.Parameter.Name.Should().Be(parameterName);\n            context.Parameter.ContainingSymbol.Name.Should().Be(\".ctor\");\n            context.Parameter.ContainingType.Name.Should().Be(\"ProcessStartInfo\");\n        }\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"ProcessStartInfo($$\"fileName\")\"\"\", \"fileName\", 0, true)]\n    [DataRow(\"\"\"ProcessStartInfo($$\"fileName\")\"\"\", \"arguments\", 1, false)]\n    [DataRow(\"\"\"ProcessStartInfo(\"fileName\", $$\"arguments\")\"\"\", \"arguments\", 1, true)]\n    [DataRow(\"\"\"ProcessStartInfo(\"fileName\", $$\"arguments\")\"\"\", \"arguments\", 0, false)]\n    [DataRow(\"\"\"ProcessStartInfo($$\"fileName\", \"arguments\")\"\"\", \"arguments\", 1, false)]\n    [DataRow(\"\"\"ProcessStartInfo(arguments:= $$\"arguments\", fileName:= \"fileName\")\"\"\", \"arguments\", 1, true)]\n    [DataRow(\"\"\"ProcessStartInfo(arguments:= $$\"arguments\", fileName:= \"fileName\")\"\"\", \"fileName\", 0, false)]\n    [DataRow(\"\"\"ProcessStartInfo(arguments:= \"arguments\", $$fileName:= \"fileName\")\"\"\", \"fileName\", 0, true)]\n    [DataRow(\"\"\"ProcessStartInfo(arguments:= \"arguments\", $$fileName:= \"fileName\")\"\"\", \"arguments\" +\n        \"\", 1, false)]\n    public void Constructor_SimpleArgument_VB(string constructor, string parameterName, int descriptorPosition, bool expected)\n    {\n        var snippet = $$\"\"\"\n            Dim a = New System.Diagnostics.{{constructor}}\n            \"\"\";\n        var context = ArgumentContextVB(WrapInMethodVB(snippet));\n\n        var descriptor = ArgumentDescriptor.ConstructorInvocation(KnownType.System_Diagnostics_ProcessStartInfo, parameterName, descriptorPosition);\n        var result = MatchArgumentVB(context, descriptor);\n        result.Should().Be(expected);\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"($$\"fileName\")\"\"\", \"fileName\", 0, true)]\n    [DataRow(\"\"\"($$\"fileName\")\"\"\", \"arguments\", 1, false)]\n    [DataRow(\"\"\"(\"fileName\", $$\"arguments\")\"\"\", \"arguments\", 1, true)]\n    [DataRow(\"\"\"(\"fileName\", $$\"arguments\")\"\"\", \"arguments\", 0, false)]\n    [DataRow(\"\"\"($$\"fileName\", \"arguments\")\"\"\", \"arguments\", 1, false)]\n    [DataRow(\"\"\"(arguments: $$\"arguments\", fileName: \"fileName\")\"\"\", \"arguments\", 1, true)]\n    [DataRow(\"\"\"(arguments: $$\"arguments\", fileName: \"fileName\")\"\"\", \"fileName\", 0, false)]\n    [DataRow(\"\"\"(arguments: \"arguments\", $$fileName: \"fileName\")\"\"\", \"fileName\", 0, true)]\n    [DataRow(\"\"\"(arguments: \"arguments\", $$fileName: \"fileName\")\"\"\", \"arguments\", 1, false)]\n    public void Constructor_TargetTyped(string constructor, string parameterName, int descriptorPosition, bool expected)\n    {\n        var snippet = $$\"\"\"\n            System.Diagnostics.ProcessStartInfo psi = new{{constructor}};\n            \"\"\";\n        var context = ArgumentContextCS(WrapInMethodCS(snippet));\n\n        var descriptor = ArgumentDescriptor.ConstructorInvocation(KnownType.System_Diagnostics_ProcessStartInfo, parameterName, descriptorPosition);\n        var result = MatchArgumentCS(context, descriptor);\n        result.Should().Be(expected);\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"new Dictionary<TKey, TValue>($$1)\"\"\", \"capacity\", 0, true)]\n    [DataRow(\"\"\"new Dictionary<int, TValue>($$1)\"\"\", \"capacity\", 0, true)]\n    [DataRow(\"\"\"new Dictionary<int, string>($$1)\"\"\", \"capacity\", 0, true)]\n    [DataRow(\"\"\"new Dictionary<TKey, TValue>($$1)\"\"\", \"comparer\", 0, false)]\n    [DataRow(\"\"\"new Dictionary<TKey, TValue>($$1, EqualityComparer<TKey>.Default)\"\"\", \"capacity\", 0, true)]\n    [DataRow(\"\"\"new Dictionary<TKey, TValue>(1, $$EqualityComparer<TKey>.Default)\"\"\", \"comparer\", 1, true)]\n    public void Constructor_Generic(string constructor, string parameterName, int descriptorPosition, bool expected)\n    {\n        var snippet = $$\"\"\"\n            using System.Collections.Generic;\n            class C\n            {\n                public void M<TKey, TValue>() where TKey : notnull\n                {\n                    _ = {{constructor}};\n                }\n            }\n            \"\"\";\n        var context = ArgumentContextCS(snippet);\n\n        var descriptor = ArgumentDescriptor.ConstructorInvocation(KnownType.System_Collections_Generic_Dictionary_TKey_TValue, parameterName, descriptorPosition);\n        var result = MatchArgumentCS(context, descriptor);\n        result.Should().Be(expected);\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"Dim a = new Dictionary(Of TKey, TValue)($$1)\"\"\", \"capacity\", 0, true)]\n    [DataRow(\"\"\"Dim a = new Dictionary(Of Integer, TValue)($$1)\"\"\", \"capacity\", 0, true)]\n    [DataRow(\"\"\"Dim a = new Dictionary(Of Integer, String)($$1)\"\"\", \"capacity\", 0, true)]\n    [DataRow(\"\"\"Dim a = new Dictionary(Of TKey, TValue)($$1)\"\"\", \"comparer\", 0, false)]\n    [DataRow(\"\"\"Dim a = New Dictionary(Of TKey, TValue)($$1, EqualityComparer(Of TKey).Default)\"\"\", \"capacity\", 0, true)]\n    [DataRow(\"\"\"Dim a = new Dictionary(Of TKey, TValue)(1, $$EqualityComparer(Of TKey).Default)\"\"\", \"comparer\", 1, true)]\n    public void Constructor_Generic_VB(string constructor, string parameterName, int descriptorPosition, bool expected)\n    {\n        var snippet = $$\"\"\"\n            Imports System.Collections.Generic\n\n            Class C\n                Public Sub M(Of TKey, TValue)()\n                    {{constructor}}\n                End Sub\n            End Class\n            \"\"\";\n        var context = ArgumentContextVB(snippet);\n\n        var descriptor = ArgumentDescriptor.ConstructorInvocation(KnownType.System_Collections_Generic_Dictionary_TKey_TValue, parameterName, descriptorPosition);\n        var result = MatchArgumentVB(context, descriptor);\n        result.Should().Be(expected);\n    }\n\n    [TestMethod]\n    public void Constructor_BaseCall()\n    {\n        var snippet = $$\"\"\"\n            using System.Collections.Generic;\n            class MyList: List<int>\n            {\n                public MyList(int capacity) : base(capacity) // Forwarded constructor parameter are unsupported\n                {\n                }\n            }\n            public class Test\n            {\n                public void M()\n                {\n                    _ = new MyList($$1); // Requires tracking of the parameter to the base constructor\n                }\n            }\n            \"\"\";\n        var context = ArgumentContextCS(snippet);\n\n        var descriptor = ArgumentDescriptor.ConstructorInvocation(KnownType.System_Collections_Generic_List_T, \"capacity\", 0);\n        var result = MatchArgumentCS(context, descriptor);\n        result.Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void Constructor_BaseCall_VB()\n    {\n        var snippet = $$\"\"\"\n            Imports System.Collections.Generic\n\n            Class MyList\n                Inherits List(Of Integer)\n\n                Public Sub New(ByVal capacity As Integer)\n                    MyBase.New(capacity) ' Passing of the parameter to the base constructor is not followed\n                End Sub\n            End Class\n\n            Public Class Test\n                Public Sub M()\n                    Dim a = New MyList($$1) ' Requires tracking of the parameter to the base constructor\n                End Sub\n            End Class\n            \"\"\";\n        var context = ArgumentContextVB(snippet);\n\n        var descriptor = ArgumentDescriptor.ConstructorInvocation(KnownType.System_Collections_Generic_List_T, \"capacity\", 0);\n        var result = MatchArgumentVB(context, descriptor);\n        result.Should().BeFalse();\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"new NumberList($$1)\"\"\", \"capacity\", 0, false)] // FN. Syntactic checks bail out before the semantic model can resolve the alias\n    [DataRow(\"\"\"new($$1)\"\"\", \"capacity\", 0, true)]             // Target typed new resolves the alias\n    public void Constructor_TypeAlias(string constructor, string parameterName, int descriptorPosition, bool expected)\n    {\n        var snippet = $$\"\"\"\n            using NumberList = System.Collections.Generic.List<int>;\n            class C\n            {\n                public void M()\n                {\n                    NumberList nl = {{constructor}};\n                }\n            }\n            \"\"\";\n        var context = ArgumentContextCS(snippet);\n\n        var descriptor = ArgumentDescriptor.ConstructorInvocation(KnownType.System_Collections_Generic_List_T, parameterName, descriptorPosition);\n        var result = MatchArgumentCS(context, descriptor);\n        result.Should().Be(expected);\n    }\n\n    [TestMethod]\n    public void Constructor_TypeAlias_VB()\n    {\n        var snippet = $$\"\"\"\n            Imports NumberList = System.Collections.Generic.List(Of Integer)\n\n            Class C\n                Public Sub M()\n                    Dim nl As NumberList = New NumberList($$1)\n                End Sub\n            End Class\n            \"\"\";\n        var context = ArgumentContextVB(snippet);\n\n        var descriptor = ArgumentDescriptor.ConstructorInvocation(KnownType.System_Collections_Generic_List_T, \"capacity\", 0);\n        var result = MatchArgumentVB(context, descriptor);\n        result.Should().BeFalse(\"FN. Syntactic check does not respect aliases.\");\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"new($$1, 2)\"\"\", true)]\n    [DataRow(\"\"\"new C(1, $$2)\"\"\", true)]\n    [DataRow(\"\"\"new CAlias(1, $$2)\"\"\", true)]\n    [DataRow(\"\"\"new C($$1)\"\"\", false)]              // Count constraint fails\n    [DataRow(\"\"\"new C(1, 2, $$3)\"\"\", false)]        // Parameter name constraint fails\n    [DataRow(\"\"\"new C($$k: 1, j:2, i:3)\"\"\", false)] // Parameter name constraint fails\n    public void Constructor_CustomLogic(string constructor, bool expected)\n    {\n        var snippet = $$\"\"\"\n            using CAlias = C;\n            class C\n            {\n                public C(int i) { }\n                public C(int j, int i) { }\n                public C(int j, int i, int k) { }\n\n                public void M()\n                {\n                    C c = {{constructor}};\n                }\n            }\n            \"\"\";\n        var context = ArgumentContextCS(snippet);\n\n        var descriptor = ArgumentDescriptor.ConstructorInvocation(invokedMethodSymbol: x => x is { MethodKind: MethodKind.Constructor, ContainingSymbol.Name: \"C\" },\n                                                                  invokedMemberNameConstraint: (c, n) => c.Equals(\"C\", n) || c.Equals(\"CAlias\"),\n                                                                  invokedMemberNodeConstraint: (_, _, _) => true,\n                                                                  parameterConstraint: x => x.Name is \"i\" or \"j\",\n                                                                  argumentListConstraint: (n, i) => i is null or 0 or 1 && n.Count > 1,\n                                                                  refKind: null);\n        var result = MatchArgumentCS(context, descriptor);\n        result.Should().Be(expected);\n    }\n\n    [TestMethod]\n    public void Constructor_InitializerCalls_This()\n    {\n        var snippet = $$\"\"\"\n            class Base\n            {\n                public Base(int i) : this($$i, 1) { }\n                public Base(int i, int j) { }\n            }\n            \"\"\";\n        var context = ArgumentContextCS(snippet);\n\n        var descriptor = ArgumentDescriptor.ConstructorInvocation(invokedMethodSymbol: x => x is { MethodKind: MethodKind.Constructor, ContainingSymbol.Name: \"Base\" },\n                                                                  invokedMemberNameConstraint: (c, n) => c.Equals(\"Base\", n),\n                                                                  invokedMemberNodeConstraint: (_, _, _) => true,\n                                                                  parameterConstraint: x => x.Name is \"i\",\n                                                                  argumentListConstraint: (_, _) => true,\n                                                                  refKind: null);\n        var result = MatchArgumentCS(context, descriptor);\n        result.Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void Constructor_InitializerCalls_Base()\n    {\n        var snippet = $$\"\"\"\n            class Base\n            {\n                public Base(int i) { }\n            }\n            class Derived: Base\n            {\n                public Derived() : base($$1) { }\n            }\n            \"\"\";\n        var context = ArgumentContextCS(snippet);\n\n        var descriptor = ArgumentDescriptor.ConstructorInvocation(invokedMethodSymbol: x => x is { MethodKind: MethodKind.Constructor, ContainingSymbol.Name: \"Base\" },\n                                                                  invokedMemberNameConstraint: (c, n) => c.Equals(\"Base\", n),\n                                                                  invokedMemberNodeConstraint: (_, _, _) => true,\n                                                                  parameterConstraint: x => x.Name is \"i\",\n                                                                  argumentListConstraint: (_, _) => true,\n                                                                  refKind: null);\n        var result = MatchArgumentCS(context, descriptor);\n        result.Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void Constructor_InitializerCalls_Base_MyException()\n    {\n        var snippet = \"\"\"\n            using System;\n\n            class MyException: Exception\n            {\n                public MyException(string message) : base($$message)\n                { }\n            }\n            \"\"\";\n        var context = ArgumentContextCS(snippet);\n\n        var descriptor = ArgumentDescriptor.ConstructorInvocation(KnownType.System_Exception, \"message\", 0);\n        var result = MatchArgumentCS(context, descriptor);\n        result.Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void Constructor_InitializerCalls_Base_MyException_VB()\n    {\n        var snippet = $$\"\"\"\n            Imports System\n\n            Public Class MyException\n                Inherits Exception\n\n                Public Sub New(ByVal message As String)\n                    MyBase.New($$message)\n                End Sub\n            End Class\n            \"\"\";\n        var context = ArgumentContextVB(snippet);\n\n        var descriptor = ArgumentDescriptor.ConstructorInvocation(KnownType.System_Exception, \"message\", 0);\n        var result = MatchArgumentVB(context, descriptor);\n        result.Should().BeFalse(\"FN. MyBase.New and Me.New are not supported.\");\n    }\n\n    [TestMethod]\n    public void Indexer_List_Get()\n    {\n        var snippet = $$\"\"\"\n            var list = new System.Collections.Generic.List<int>();\n            _ = list[$$1];\n            \"\"\";\n        var context = ArgumentContextCS(WrapInMethodCS(snippet));\n\n        var descriptor = ArgumentDescriptor.ElementAccess(KnownType.System_Collections_Generic_List_T, \"list\",\n            x => x is { Name: \"index\", Type.SpecialType: SpecialType.System_Int32, ContainingSymbol: IMethodSymbol { MethodKind: MethodKind.PropertyGet } }, 0);\n        var result = MatchArgumentCS(context, descriptor);\n        result.Should().BeTrue();\n        context.Parameter.Name.Should().Be(\"index\");\n        var associatedSymbol = context.Parameter.ContainingSymbol.Should().BeAssignableTo<IMethodSymbol>().Which.AssociatedSymbol.Should().BeAssignableTo<IPropertySymbol>().Which;\n        associatedSymbol.IsIndexer.Should().BeTrue();\n        associatedSymbol.Name.Should().Be(\"this[]\");\n    }\n\n    [TestMethod]\n    public void Indexer_List_Get_VB()\n    {\n        var snippet = $$\"\"\"\n            Dim list = New System.Collections.Generic.List(Of Integer)()\n            Dim a = list($$1)\n            \"\"\";\n        var context = ArgumentContextVB(WrapInMethodVB(snippet));\n\n        var descriptor = ArgumentDescriptor.ElementAccess(KnownType.System_Collections_Generic_List_T, \"list\",\n            x => x is { Name: \"index\", Type.SpecialType: SpecialType.System_Int32, ContainingSymbol: IMethodSymbol { MethodKind: MethodKind.PropertyGet } }, 0);\n        var result = MatchArgumentVB(context, descriptor);\n        result.Should().BeTrue();\n        context.Parameter.Name.Should().Be(\"index\");\n        var associatedSymbol = context.Parameter.ContainingSymbol.Should().BeAssignableTo<IMethodSymbol>().Which.AssociatedSymbol.Should().BeAssignableTo<IPropertySymbol>().Which;\n        associatedSymbol.IsIndexer.Should().BeTrue();\n        associatedSymbol.Name.Should().Be(\"Item\");\n    }\n\n    [TestMethod]\n    [DataRow(\"list[$$1] = 1;\")]\n    [DataRow(\"(list[$$1], list[2]) = (1, 2);\")]\n    [DataRow(\"list[$$1]++;\")]\n    [DataRow(\"list[$$1]--;\")]\n    public void Indexer_List_Set(string writeExpression)\n    {\n        var snippet = $$\"\"\"\n            var list = new System.Collections.Generic.List<int>();\n            {{writeExpression}};\n            \"\"\";\n        var context = ArgumentContextCS(WrapInMethodCS(snippet));\n\n        var descriptor = ArgumentDescriptor.ElementAccess(KnownType.System_Collections_Generic_List_T,\n            x => x is { Name: \"index\", ContainingSymbol: IMethodSymbol { MethodKind: MethodKind.PropertySet } }, 0);\n        var result = MatchArgumentCS(context, descriptor);\n        result.Should().BeTrue();\n        context.Parameter.ContainingSymbol.Should().BeAssignableTo<IMethodSymbol>().Which.MethodKind.Should().Be(MethodKind.PropertySet);\n    }\n\n    [TestMethod]\n    [DataRow(\"list($$1) = 1\")]\n    [DataRow(\"list($$1) += 1\")]\n    [DataRow(\"list($$1) -= 1\")]\n    public void Indexer_List_Set_VB(string writeExpression)\n    {\n        var snippet = $$\"\"\"\n            Dim list = New System.Collections.Generic.List(Of Integer)()\n            {{writeExpression}}\n            \"\"\";\n        var context = ArgumentContextVB(WrapInMethodVB(snippet));\n\n        var descriptor = ArgumentDescriptor.ElementAccess(KnownType.System_Collections_Generic_List_T,\n            x => x is { Name: \"index\", ContainingSymbol: IMethodSymbol { MethodKind: MethodKind.PropertySet } }, 0);\n        var result = MatchArgumentVB(context, descriptor);\n        result.Should().BeTrue();\n        context.Parameter.ContainingSymbol.Should().BeAssignableTo<IMethodSymbol>().Which.MethodKind.Should().Be(MethodKind.PropertySet);\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"Environment.GetEnvironmentVariables()[$$\"TEMP\"]\"\"\")]\n    [DataRow(\"\"\"Environment.GetEnvironmentVariables()?[$$\"TEMP\"]\"\"\")]\n    public void Indexer_DictionaryGet(string environmentVariableAccess)\n    {\n        var snippet = $$\"\"\"\n            _ = {{environmentVariableAccess}};\n            \"\"\";\n        var context = ArgumentContextCS(WrapInMethodCS(snippet));\n\n        var descriptor = ArgumentDescriptor.ElementAccess(x => x is { MethodKind: MethodKind.PropertyGet, ContainingType.Name: \"IDictionary\" },\n            (n, c) => n.Equals(\"GetEnvironmentVariables\", c), (_, _, _) => true, x => x.Name == \"key\", (_, p) => p is null or 0);\n        var result = MatchArgumentCS(context, descriptor);\n        result.Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void Indexer_DictionaryGet_VB()\n    {\n        var snippet = \"\"\"\n            Dim a = Environment.GetEnvironmentVariables()($$\"TEMP\")\n            \"\"\";\n        var context = ArgumentContextVB(WrapInMethodVB(snippet));\n\n        var descriptor = ArgumentDescriptor.ElementAccess(x => x is { MethodKind: MethodKind.PropertyGet, ContainingType.Name: \"IDictionary\" },\n            (n, c) => n.Equals(\"GetEnvironmentVariables\", c), (_, _, _) => true, x => x.Name == \"key\", (_, p) => p is null or 0);\n        var result = MatchArgumentVB(context, descriptor);\n        result.Should().BeTrue();\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"_ = this[$$0,0];\"\"\", \"x\", true)]\n    [DataRow(\"\"\"_ = this[0,$$0];\"\"\", \"y\", true)]\n    [DataRow(\"\"\"_ = this[$$y: 0,x: 0];\"\"\", \"y\", true)]\n    [DataRow(\"\"\"_ = this[y: 0,$$x: 0];\"\"\", \"x\", true)]\n    [DataRow(\"\"\"this[$$0, 0] = 1;\"\"\", \"x\", false)]\n    [DataRow(\"\"\"this[0, $$0] = 1;\"\"\", \"y\", false)]\n    [DataRow(\"\"\"this[y: $$0, x: 0] = 1;\"\"\", \"y\", false)]\n    [DataRow(\"\"\"this[y: 0, $$x: 0] = 1;\"\"\", \"x\", false)]\n    public void Indexer_MultiDimensional(string access, string parameterName, bool isGetter)\n    {\n        var snippet = $$\"\"\"\n            public class C {\n                public int this[int x, int y]\n                {\n                    get => 1;\n                    set { }\n                }\n\n                public void M() {\n                    {{access}}\n                }\n            }\n            \"\"\";\n        var context = ArgumentContextCS(snippet);\n\n        var descriptor = ArgumentDescriptor.ElementAccess(\n            x => x is { MethodKind: var kind, ContainingType.Name: \"C\" } && (isGetter ? kind == MethodKind.PropertyGet : kind == MethodKind.PropertySet),\n            (_, _) => true,\n            (_, _, _) => true,\n            x => x.Name == parameterName,\n            (_, _) => true);\n        var result = MatchArgumentCS(context, descriptor);\n        result.Should().BeTrue();\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"Dim a = Me($$0, 0)\"\"\", \"x\", true)]\n    [DataRow(\"\"\"Dim a = Me(0, $$0)\"\"\", \"y\", true)]\n    [DataRow(\"\"\"Dim a = Me(y := $$0, x := 0)\"\"\", \"y\", true)]\n    [DataRow(\"\"\"Dim a = Me(y := 0, $$x := 0)\"\"\", \"x\", true)]\n    [DataRow(\"\"\"Me($$0, 0) = 1\"\"\", \"x\", false)]\n    [DataRow(\"\"\"Me(0, $$0) = 1\"\"\", \"y\", false)]\n    [DataRow(\"\"\"Me(y := $$0, x := 0) = 1\"\"\", \"y\", false)]\n    [DataRow(\"\"\"Me(y := 0, $$x := 0) = 1\"\"\", \"x\", false)]\n    public void Indexer_MultiDimensional_VB(string access, string parameterName, bool isGetter)\n    {\n        var snippet = $$\"\"\"\n            Public Class C\n                Default Public Property Item(ByVal x As Integer, ByVal y As Integer) As Integer\n                    Get\n                        Return 1\n                    End Get\n                    Set(ByVal value As Integer)\n                    End Set\n                End Property\n\n                Public Sub M()\n                    {{access}}\n                End Sub\n            End Class\n            \"\"\";\n        var context = ArgumentContextVB(snippet);\n\n        var descriptor = ArgumentDescriptor.ElementAccess(\n            x => x is { MethodKind: var kind, ContainingType.Name: \"C\" } && (isGetter ? kind == MethodKind.PropertyGet : kind == MethodKind.PropertySet),\n            (_, _) => true,\n            (_, _, _) => true,\n            x => x.Name == parameterName,\n            (_, _) => true);\n        var result = MatchArgumentVB(context, descriptor);\n        result.Should().BeTrue();\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"process.Modules[$$0]\"\"\")]\n    [DataRow(\"\"\"process?.Modules[$$0]\"\"\")]\n    [DataRow(\"\"\"process.Modules?[$$0]\"\"\")]\n    [DataRow(\"\"\"process?.Modules?[$$0]\"\"\")]\n    [DataRow(\"\"\"process.Modules[index: $$0]\"\"\")]\n    [DataRow(\"\"\"process?.Modules?[index: $$0]\"\"\")]\n    public void Indexer_ConditionalAccess_Collection(string modulesAccess)\n    {\n        var snippet = $$\"\"\"\n            public class Test\n            {\n                public void M(System.Diagnostics.Process process)\n                {\n                    _ = {{modulesAccess}};\n                }\n            }\n            \"\"\";\n        var context = ArgumentContextCS(snippet);\n\n        var descriptor = ArgumentDescriptor.ElementAccess(x => x is { MethodKind: MethodKind.PropertyGet, ContainingType.Name: \"ProcessModuleCollection\" },\n            (n, c) => n.Equals(\"Modules\", c),\n            (_, _, _) => true,\n            x => x.Name == \"index\",\n            (_, p) => p is null or 0);\n        var result = MatchArgumentCS(context, descriptor);\n        result.Should().BeTrue();\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"processStartInfo.Environment[$$\"TEMP\"]\"\"\")]\n    [DataRow(\"\"\"processStartInfo?.Environment[$$\"TEMP\"]\"\"\")]\n    [DataRow(\"\"\"processStartInfo.Environment?[$$\"TEMP\"]\"\"\")]\n    [DataRow(\"\"\"processStartInfo?.Environment?[$$\"TEMP\"]\"\"\")]\n    [DataRow(\"\"\"processStartInfo.Environment[key: $$\"TEMP\"]\"\"\")]\n    [DataRow(\"\"\"processStartInfo?.Environment?[key: $$\"TEMP\"]\"\"\")]\n    public void Indexer_ConditionalAccess_Dictionary(string environmentAccess)\n    {\n        var snippet = $$\"\"\"\n            public class Test\n            {\n                public void M(System.Diagnostics.ProcessStartInfo processStartInfo)\n                {\n                    _ = {{environmentAccess}};\n                }\n            }\n            \"\"\";\n        var context = ArgumentContextCS(snippet);\n\n        var descriptor = ArgumentDescriptor.ElementAccess(KnownType.System_Collections_Generic_IDictionary_TKey_TValue, \"Environment\", x => x.Name == \"key\", 0);\n        var result = MatchArgumentCS(context, descriptor);\n        result.Should().BeTrue();\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"this[$$\"TEMP\"]\"\"\", true)]\n    [DataRow(\"\"\"this[42, $$\"TEMP\"]\"\"\", false)]\n    [DataRow(\"\"\"this[42, 43, $$\"TEMP\"]\"\"\", true)]\n    public void Indexer_ConditionalPosition(string expression, bool expectedResult)\n    {\n        var snippet = $$\"\"\"\n            public class Test\n            {\n                public int this[string key] => 0;\n                public int this[int a, string key] => 0;\n                public int this[int a, int b, string key] => 0;\n\n                public void M()\n                {\n                    _ = {{expression}};\n                }\n            }\n            \"\"\";\n        var context = ArgumentContextCS(snippet);\n        var descriptor = ArgumentDescriptor.ElementAccess(\n            new KnownType(\"Test\"),\n            x => x.Name == \"key\",\n            x => x is 0 or 2);\n        var result = MatchArgumentCS(context, descriptor);\n        result.Should().Be(expectedResult);\n    }\n\n    [TestMethod]\n    [DataRow(\"System.Int32\", false)]\n    [DataRow(\"System.Collections.Generic.IDictionary\", true)]\n    public void Indexer_WrongKnownType(string type, bool expectedResult)\n    {\n        var snippet = $$\"\"\"\n            public class Test\n            {\n                public void M(System.Diagnostics.ProcessStartInfo psi)\n                {\n                    _ = psi.Environment?[key: $$\"TEMP\"];\n                }\n            }\n            \"\"\";\n        var context = ArgumentContextCS(snippet);\n        var descriptor = ArgumentDescriptor.ElementAccess(\n            new(type, \"TKey\", \"TValue\"),\n            \"Environment\",\n            x => x.Name == \"key\",\n            0);\n        var result = MatchArgumentCS(context, descriptor);\n        result.Should().Be(expectedResult);\n    }\n\n#if NET\n\n    [TestMethod]\n    public void Attribute_ConstructorParameter()\n    {\n        var snippet = $$\"\"\"\n            using System;\n            public class Test\n            {\n                [Obsolete($$\"message\", UrlFormat = \"\")]\n                public void M()\n                {\n                }\n            }\n            \"\"\";\n        var context = ArgumentContextCS(snippet);\n\n        var descriptor = ArgumentDescriptor.AttributeArgument(x => x is { MethodKind: MethodKind.Constructor, ContainingType.Name: \"ObsoleteAttribute\" },\n            (s, c) => s.StartsWith(\"Obsolete\", c),\n            (_, _, _) => true,\n            x => x.Name == \"message\",\n            (_, i) => i is 0);\n        var result = MatchArgumentCS(context, descriptor);\n        result.Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void Attribute_ConstructorParameter_VB()\n    {\n        var snippet = $$\"\"\"\n            Imports System\n\n            Public Class Test\n                <Obsolete($$\"message\", UrlFormat:=\"\")>\n                Public Sub M()\n                End Sub\n            End Class\n            \"\"\";\n        var context = ArgumentContextVB(snippet);\n\n        var descriptor = ArgumentDescriptor.AttributeArgument(x => x is { MethodKind: MethodKind.Constructor, ContainingType.Name: \"ObsoleteAttribute\" },\n            (s, c) => s.StartsWith(\"Obsolete\", c),\n            (_, _, _) => true,\n            x => x.Name == \"message\",\n            (_, i) => i is 0);\n        var result = MatchArgumentVB(context, descriptor);\n        result.Should().BeTrue();\n    }\n\n#endif\n\n    [TestMethod]\n    [DataRow(\"\"\"[Designer($$\"designerTypeName\")]\"\"\", \"designerTypeName\", 0)]\n    [DataRow(\"\"\"[DesignerAttribute($$\"designerTypeName\")]\"\"\", \"designerTypeName\", 0)]\n    [DataRow(\"\"\"[DesignerAttribute($$\"designerTypeName\", \"designerBaseTypeName\")]\"\"\", \"designerTypeName\", 0)]\n    [DataRow(\"\"\"[DesignerAttribute(\"designerTypeName\", $$\"designerBaseTypeName\")]\"\"\", \"designerBaseTypeName\", 1)]\n    [DataRow(\"\"\"[Designer($$designerBaseTypeName: \"designerBaseTypeName\", designerTypeName: \"designerTypeName\")]\"\"\", \"designerBaseTypeName\", 1)]\n    [DataRow(\"\"\"[Designer(designerBaseTypeName: \"designerBaseTypeName\", $$designerTypeName: \"designerTypeName\")]\"\"\", \"designerTypeName\", 0)]\n    [DataRow(\"\"\"[Designer(designerBaseTypeName: \"designerBaseTypeName\", $$designerTypeName: \"designerTypeName\")]\"\"\", \"designerTypeName\", 1)]\n    [DataRow(\"\"\"[Designer($$\"designerTypeName\"$$, \"designerBaseTypeName\"), DesignerCategory(\"Form\")]\"\"\", \"designerTypeName\", 0)]\n    [DataRow(\"\"\"[DesignerCategory(\"Form\"), Designer($$\"designerTypeName\"$$, \"designerBaseTypeName\")]\"\"\", \"designerTypeName\", 0)]\n    public void Attribute_ConstructorParameters(string attribute, string parameterName, int descriptorPosition)\n    {\n        var snippet = $$\"\"\"\n            using System.ComponentModel;\n\n            {{attribute}}\n            public class Test\n            {\n                public void M()\n                {\n                }\n            }\n            \"\"\";\n        var context = ArgumentContextCS(snippet);\n\n        var descriptor = ArgumentDescriptor.AttributeArgument(\"DesignerAttribute\", parameterName, descriptorPosition);\n        var result = MatchArgumentCS(context, descriptor);\n        result.Should().BeTrue();\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"[Obsolete($$\"message\")]\"\"\", \"message\", 0)]\n    [DataRow(\"\"\"[ObsoleteAttribute($$\"message\")]\"\"\", \"message\", 0)]\n    [DataRow(\"\"\"[ObsoleteAttribute($$\"message\", true)]\"\"\", \"message\", 0)]\n    [DataRow(\"\"\"[ObsoleteAttribute(error: true, message: $$\"message\")]\"\"\", \"message\", 0)]\n    public void Attribute_ConstructorParameters_KnownType(string attribute, string parameterName, int parameterPosition)\n    {\n        var snippet = $$\"\"\"\n            using System;\n\n            {{attribute}}\n            public class Test\n            {\n                public void M()\n                {\n                }\n            }\n            \"\"\";\n        var context = ArgumentContextCS(snippet);\n\n        var descriptor = ArgumentDescriptor.AttributeArgument(KnownType.System_ObsoleteAttribute, parameterName, parameterPosition);\n        var result = MatchArgumentCS(context, descriptor);\n        result.Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void Attribute_PropertySetter_WrongMethod()\n    {\n        var snippet = $$\"\"\"\n            [Designer($$designerTypeName = \"hey\")]\n            public class Test { }\n\n            public class Designer : System.Attribute\n            {\n                public string designerTypeName { get; set; }\n            }\n            \"\"\";\n        var context = ArgumentContextCS(snippet);\n\n        // This should call AttributeProperty, not AttributeArgument.\n        var descriptor = ArgumentDescriptor.AttributeArgument(\"Designer\", \"designerTypeName\", 0);\n        var result = MatchArgumentCS(context, descriptor);\n        result.Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void Attribute_ConstructorParameters_WrongMethod()\n    {\n        var snippet = $$\"\"\"\n            [Designer($$\"value\")]\n            public class Test { }\n\n            public class Designer(string designerTypeName) : System.Attribute { }\n            \"\"\";\n        var context = ArgumentContextCS(snippet);\n\n        // This should call AttributeArgument, no AttributeProperty.\n        var descriptor = ArgumentDescriptor.AttributeProperty(\"Designer\", \"designerTypeName\");\n        var result = MatchArgumentCS(context, descriptor);\n        result.Should().BeFalse();\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"<Designer($$\"designerTypeName\")>\"\"\", \"designerTypeName\", 0)]\n    [DataRow(\"\"\"<DesignerAttribute($$\"designerTypeName\")>\"\"\", \"designerTypeName\", 0)]\n    [DataRow(\"\"\"<DesignerAttribute($$\"designerTypeName\", \"designerBaseTypeName\")>\"\"\", \"designerTypeName\", 0)]\n    [DataRow(\"\"\"<DesignerAttribute(\"designerTypeName\", $$\"designerBaseTypeName\")>\"\"\", \"designerBaseTypeName\", 1)]\n    public void Attribute_ConstructorParameters_VB(string attribute, string parameterName, int descriptorPosition)\n    {\n        var snippet = $$\"\"\"\n            Imports System.ComponentModel\n\n            {{attribute}}\n            Public Class Test\n            End Class\n            \"\"\";\n        var context = ArgumentContextVB(snippet);\n\n        var descriptor = ArgumentDescriptor.AttributeArgument(\"DesignerAttribute\", parameterName, descriptorPosition);\n        var result = MatchArgumentVB(context, descriptor);\n        result.Should().BeTrue();\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"[AttributeUsage(AttributeTargets.All,  $$AllowMultiple = true)]\"\"\", \"AllowMultiple\", true)]\n    [DataRow(\"\"\"[AttributeUsage(AttributeTargets.All,  $$AllowMultiple = true, Inherited = true)]\"\"\", \"AllowMultiple\", true)]\n    [DataRow(\"\"\"[AttributeUsage(AttributeTargets.All,  $$AllowMultiple = true, Inherited = true)]\"\"\", \"Inherited\", false)]\n    [DataRow(\"\"\"[AttributeUsage(AttributeTargets.All,  AllowMultiple = true, $$Inherited = true)]\"\"\", \"Inherited\", true)]\n    public void Attribute_PropertySetter(string attribute, string propertyName, bool expected)\n    {\n        var snippet = $$\"\"\"\n            using System;\n\n            {{attribute}}\n            public sealed class TestAttribute: Attribute\n            {\n            }\n            \"\"\";\n        var context = ArgumentContextCS(snippet);\n\n        var descriptor = ArgumentDescriptor.AttributeProperty(\"AttributeUsage\", propertyName);\n        var result = MatchArgumentCS(context, descriptor);\n        result.Should().Be(expected);\n        if (result)\n        {\n            // The mapped parameter is the \"value\" parameter of the property set method.\n            context.Parameter.Name.Should().Be(\"value\");\n            var method = context.Parameter.ContainingSymbol.Should().BeAssignableTo<IMethodSymbol>().Which;\n            method.MethodKind.Should().Be(MethodKind.PropertySet);\n            method.AssociatedSymbol.Should().BeAssignableTo<IPropertySymbol>().Which.Name.Should().Be(propertyName);\n        }\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"[AttributeUsage(AttributeTargets.All,  $$AllowMultiple = true)]\"\"\", \"AllowMultiple\", true)]\n    [DataRow(\"\"\"[AttributeUsage(AttributeTargets.All,  $$AllowMultiple = true, Inherited = true)]\"\"\", \"AllowMultiple\", true)]\n    [DataRow(\"\"\"[AttributeUsage(AttributeTargets.All,  $$AllowMultiple = true, Inherited = true)]\"\"\", \"Inherited\", false)]\n    [DataRow(\"\"\"[AttributeUsage(AttributeTargets.All,  AllowMultiple = true, $$Inherited = true)]\"\"\", \"Inherited\", true)]\n    public void Attribute_PropertySetter_KnownType(string attribute, string propertyName, bool expected)\n    {\n        var snippet = $$\"\"\"\n            using System;\n\n            {{attribute}}\n            public sealed class TestAttribute: Attribute\n            {\n            }\n            \"\"\";\n        var context = ArgumentContextCS(snippet);\n\n        var descriptor = ArgumentDescriptor.AttributeProperty(KnownType.System_AttributeUsageAttribute, propertyName);\n        var result = MatchArgumentCS(context, descriptor);\n        result.Should().Be(expected);\n        if (result)\n        {\n            // The mapped parameter is the \"value\" parameter of the property set method.\n            context.Parameter.Name.Should().Be(\"value\");\n            var method = context.Parameter.ContainingSymbol.Should().BeAssignableTo<IMethodSymbol>().Which;\n            method.MethodKind.Should().Be(MethodKind.PropertySet);\n            method.AssociatedSymbol.Should().BeAssignableTo<IPropertySymbol>().Which.Name.Should().Be(propertyName);\n        }\n    }\n\n    [TestMethod]\n    [DataRow(\"\"\"<AttributeUsage(AttributeTargets.All,  $$AllowMultiple := true)>\"\"\", \"AllowMultiple\", true)]\n    [DataRow(\"\"\"<AttributeUsage(AttributeTargets.All,  $$AllowMultiple := true, Inherited := true)>\"\"\", \"AllowMultiple\", true)]\n    [DataRow(\"\"\"<AttributeUsage(AttributeTargets.All,  $$AllowMultiple := true, Inherited := true)>\"\"\", \"Inherited\", false)]\n    [DataRow(\"\"\"<AttributeUsage(AttributeTargets.All,  AllowMultiple := true, $$Inherited := true)>\"\"\", \"Inherited\", true)]\n    public void Attribute_PropertySetter_VB(string attribute, string propertyName, bool expected)\n    {\n        var snippet = $$\"\"\"\n            Imports System\n\n            {{attribute}}\n            Public NotInheritable Class TestAttribute\n                Inherits Attribute\n            End Class\n            \"\"\";\n        var context = ArgumentContextVB(snippet);\n\n        var descriptor = ArgumentDescriptor.AttributeProperty(\"AttributeUsage\", propertyName);\n        var result = MatchArgumentVB(context, descriptor);\n        result.Should().Be(expected);\n        if (result)\n        {\n            // The mapped parameter is the \"value\" parameter of the property set method.\n            context.Parameter.Name.Should().Be(\"value\");\n            var method = context.Parameter.ContainingSymbol.Should().BeAssignableTo<IMethodSymbol>().Which;\n            method.MethodKind.Should().Be(MethodKind.PropertySet);\n            method.AssociatedSymbol.Should().BeAssignableTo<IPropertySymbol>().Which.Name.Should().Be(propertyName);\n        }\n    }\n\n    private static string WrapInMethodCS(string snippet) =>\n        $$\"\"\"\n        using System;\n        class C\n        {\n            public void M()\n            {\n                {{snippet}}\n            }\n        }\n        \"\"\";\n\n    private static string WrapInMethodVB(string snippet) =>\n        $$\"\"\"\n        Imports System\n        Class C\n            Public Sub M()\n                {{snippet}}\n            End Sub\n        End Class\n        \"\"\";\n\n    private static ArgumentContext ArgumentContextCS(string snippet) =>\n        ArgumentContext(snippet, TestCompiler.CompileCS, typeof(CS.ArgumentSyntax), typeof(CS.AttributeArgumentSyntax));\n\n    private static ArgumentContext ArgumentContextVB(string snippet) =>\n        ArgumentContext(snippet, TestCompiler.CompileVB, typeof(VB.ArgumentSyntax));\n\n    private static ArgumentContext ArgumentContext(string snippet,\n        Func<string, MetadataReference[], (SyntaxTree Tree, SemanticModel Model)> compile, params Type[] descriptorNodeTypes)\n    {\n        var position = snippet.IndexOf(\"$$\");\n        if (position == -1)\n        {\n            throw new InvalidOperationException(\"The $$ maker was not found\");\n        }\n        snippet = snippet.Replace(\"$$\", string.Empty);\n        var (tree, model) = compile(snippet, MetadataReferenceFacade.SystemCollections.Concat(MetadataReferenceFacade.SystemDiagnosticsProcess).ToArray());\n        var node = tree.GetRoot()\n            .DescendantNodesAndSelf(new TextSpan(position, 1)) // root.Find does not work with OmittedArgument\n            .Reverse()\n            .First(x => Array.Exists(descriptorNodeTypes, t => t.IsInstanceOfType(x)));\n        return new(node, model);\n    }\n\n    private static bool MatchArgumentCS(ArgumentContext context, ArgumentDescriptor descriptor) =>\n        MatchArgument<CSharpArgumentTracker, Microsoft.CodeAnalysis.CSharp.SyntaxKind>(context, descriptor);\n\n    private static bool MatchArgumentVB(ArgumentContext context, ArgumentDescriptor descriptor) =>\n        MatchArgument<VisualBasicArgumentTracker, Microsoft.CodeAnalysis.VisualBasic.SyntaxKind>(context, descriptor);\n\n    private static bool MatchArgument<TTracker, TSyntaxKind>(ArgumentContext context, ArgumentDescriptor descriptor)\n        where TTracker : ArgumentTracker<TSyntaxKind>, new()\n        where TSyntaxKind : struct =>\n        new TTracker().MatchArgument(descriptor)(context);\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Trackers/BaseTypeTrackerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\nusing SonarAnalyzer.CSharp.Core.Trackers;\nusing SonarAnalyzer.VisualBasic.Core.Trackers;\nusing CSharpSyntax = Microsoft.CodeAnalysis.CSharp.Syntax;\nusing VBSyntax = Microsoft.CodeAnalysis.VisualBasic.Syntax;\n\nnamespace SonarAnalyzer.Test.Trackers;\n\n[TestClass]\npublic class BaseTypeTrackerTest\n{\n    private const string TestInputCS = @\"\npublic class Sample : System.Exception {}\";\n\n    private const string TestInputVB = @\"\nPublic Class Sample\n    Inherits System.Exception\nEnd Class\";\n\n    [TestMethod]\n    public void MatchSubclassesOf_CS()\n    {\n        var tracker = new CSharpBaseTypeTracker();\n\n        var context = CreateContext<CSharpSyntax.BaseListSyntax>(TestInputCS, AnalyzerLanguage.CSharp, x => Enumerable.Empty<SyntaxNode>());\n        tracker.MatchSubclassesOf(KnownType.System_Exception)(context).Should().BeFalse();\n\n        context = CreateContext<CSharpSyntax.BaseListSyntax>(TestInputCS, AnalyzerLanguage.CSharp, x => null);\n        tracker.MatchSubclassesOf(KnownType.System_Exception)(context).Should().BeFalse();\n\n        context = CreateContext<CSharpSyntax.BaseListSyntax>(TestInputCS, AnalyzerLanguage.CSharp, x => x.Types.Select(x => x.Type));\n        tracker.MatchSubclassesOf(KnownType.System_Exception)(context).Should().BeTrue();\n        tracker.MatchSubclassesOf(KnownType.System_Attribute)(context).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void MatchSubclassesOf_VB()\n    {\n        var tracker = new VisualBasicBaseTypeTracker();\n        var context = CreateContext<VBSyntax.InheritsStatementSyntax>(TestInputVB, AnalyzerLanguage.VisualBasic, x => Enumerable.Empty<SyntaxNode>());\n        tracker.MatchSubclassesOf(KnownType.System_Exception)(context).Should().BeFalse();\n\n        context = CreateContext<VBSyntax.InheritsStatementSyntax>(TestInputVB, AnalyzerLanguage.VisualBasic, x => null);\n        tracker.MatchSubclassesOf(KnownType.System_Exception)(context).Should().BeFalse();\n\n        context = CreateContext<VBSyntax.InheritsStatementSyntax>(TestInputVB, AnalyzerLanguage.VisualBasic, x => x.Types);\n        tracker.MatchSubclassesOf(KnownType.System_Exception)(context).Should().BeTrue();\n        tracker.MatchSubclassesOf(KnownType.System_Attribute)(context).Should().BeFalse();\n    }\n\n    private static BaseTypeContext CreateContext<TSyntaxNodeType>(string testInput, AnalyzerLanguage language, Func<TSyntaxNodeType, IEnumerable<SyntaxNode>> baseTypeNodes)\n        where TSyntaxNodeType : SyntaxNode\n    {\n        var testCode = new SnippetCompiler(testInput, false, language);\n        var node = testCode.Nodes<TSyntaxNodeType>().Single();\n        return new BaseTypeContext(testCode.CreateAnalysisContext(node), baseTypeNodes(node));\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Trackers/BuilderPatternConditionTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\nusing SonarAnalyzer.CSharp.Core.Syntax.Extensions;\nusing SonarAnalyzer.CSharp.Core.Trackers;\nusing SonarAnalyzer.VisualBasic.Core.Syntax.Extensions;\nusing SonarAnalyzer.VisualBasic.Core.Trackers;\nusing BuilderPatternDescriptorCS = SonarAnalyzer.Core.Trackers.BuilderPatternDescriptor<Microsoft.CodeAnalysis.CSharp.SyntaxKind, Microsoft.CodeAnalysis.CSharp.Syntax.InvocationExpressionSyntax>;\nusing BuilderPatternDescriptorVB = SonarAnalyzer.Core.Trackers.BuilderPatternDescriptor<Microsoft.CodeAnalysis.VisualBasic.SyntaxKind, Microsoft.CodeAnalysis.VisualBasic.Syntax.InvocationExpressionSyntax>;\nusing CSharpSyntax = Microsoft.CodeAnalysis.CSharp.Syntax;\nusing VBSyntax = Microsoft.CodeAnalysis.VisualBasic.Syntax;\n\nnamespace SonarAnalyzer.Test.Trackers;\n\n[TestClass]\npublic class BuilderPatternConditionTest\n{\n    private InvocationContext csContext;\n    private InvocationContext vbContext;\n\n    [TestInitialize]\n    public void Initialize()\n    {\n        csContext = CreateContext_CS();\n        vbContext = CreateContext_VB();\n    }\n\n    [TestMethod]\n    public void ConstructorIsSafe_CS()\n    {\n        var safeConstructor = new CSharpBuilderPatternCondition(true, new BuilderPatternDescriptorCS(false, (context) => false));\n        safeConstructor.IsInvalidBuilderInitialization(csContext).Should().BeFalse();\n\n        var unsafeConstructor = new CSharpBuilderPatternCondition(false, new BuilderPatternDescriptorCS(false, (context) => false));\n        unsafeConstructor.IsInvalidBuilderInitialization(csContext).Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void ConstructorIsSafe_VB()\n    {\n        var safeConstructor = new VisualBasicBuilderPatternCondition(true, new BuilderPatternDescriptorVB(false, (context) => false));\n        safeConstructor.IsInvalidBuilderInitialization(vbContext).Should().BeFalse();\n\n        var unsafeConstructor = new VisualBasicBuilderPatternCondition(false, new BuilderPatternDescriptorVB(false, (context) => false));\n        unsafeConstructor.IsInvalidBuilderInitialization(vbContext).Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void IsInvalidBuilderInitialization_CS()\n    {\n        var aaaInvalidator = new BuilderPatternDescriptorCS(false, (context) => context.MethodName == \"Aaa\");\n        var bbbValidator = new BuilderPatternDescriptorCS(true, (context) => context.MethodName == \"Bbb\");\n        var cccInvalidator = new BuilderPatternDescriptorCS(false, (context) => context.MethodName == \"Ccc\");\n\n        var condition1 = new CSharpBuilderPatternCondition(false, bbbValidator);\n        condition1.IsInvalidBuilderInitialization(csContext).Should().BeFalse(); // Invalid constructor validated by method\n\n        var condition2 = new CSharpBuilderPatternCondition(false, cccInvalidator);\n        condition2.IsInvalidBuilderInitialization(csContext).Should().BeTrue(); // Invalid constructor invalidated by method\n\n        var condition3 = new CSharpBuilderPatternCondition(true, cccInvalidator);\n        condition3.IsInvalidBuilderInitialization(csContext).Should().BeTrue(); // Valid constructor invalidated by method\n\n        var condition4 = new CSharpBuilderPatternCondition(true, bbbValidator);\n        condition4.IsInvalidBuilderInitialization(csContext).Should().BeFalse(); // Valid constructor validated by method\n\n        var condition5 = new CSharpBuilderPatternCondition(false, aaaInvalidator, bbbValidator);\n        condition5.IsInvalidBuilderInitialization(csContext).Should().BeFalse(); // Invalid constructor, invalidated by Aaa, validated by Bbb\n\n        var condition6 = new CSharpBuilderPatternCondition(false, bbbValidator, aaaInvalidator); // Configuration order has no effect\n        condition6.IsInvalidBuilderInitialization(csContext).Should().BeFalse(); // Invalid constructor, invalidated by Aaa, validated by Bbb\n\n        var condition7 = new CSharpBuilderPatternCondition(true, bbbValidator, cccInvalidator);\n        condition7.IsInvalidBuilderInitialization(csContext).Should().BeTrue(); // Valid constructor, validated by Bbb, invalidated by Ccc\n\n        var condition8 = new CSharpBuilderPatternCondition(true, cccInvalidator, bbbValidator); // Configuration order has no effect\n        condition8.IsInvalidBuilderInitialization(csContext).Should().BeTrue(); // Valid constructor, validated by Bbb, invalidated by Ccc\n\n        var dddContext = new InvocationContext(FindMethodInvocation_CS(csContext.Node.SyntaxTree, \"Ddd\"), \"Ddd\", csContext.Model);\n        var condition9 = new CSharpBuilderPatternCondition(false);\n        condition9.IsInvalidBuilderInitialization(dddContext).Should().BeFalse(); // Invalid constructor is not tracked through array propagation\n    }\n\n    [TestMethod]\n    public void IsInvalidBuilderInitialization_VB()\n    {\n        var aaaInvalidator = new BuilderPatternDescriptorVB(false, (context) => context.MethodName == \"Aaa\");\n        var bbbValidator = new BuilderPatternDescriptorVB(true, (context) => context.MethodName == \"Bbb\");\n        var cccInvalidator = new BuilderPatternDescriptorVB(false, (context) => context.MethodName == \"Ccc\");\n\n        var condition1 = new VisualBasicBuilderPatternCondition(false, bbbValidator);\n        condition1.IsInvalidBuilderInitialization(vbContext).Should().BeFalse(); // Invalid constructor validated by method\n\n        var condition2 = new VisualBasicBuilderPatternCondition(false, cccInvalidator);\n        condition2.IsInvalidBuilderInitialization(vbContext).Should().BeTrue(); // Invalid constructor invalidated by method\n\n        var condition3 = new VisualBasicBuilderPatternCondition(true, cccInvalidator);\n        condition3.IsInvalidBuilderInitialization(vbContext).Should().BeTrue(); // Valid constructor invalidated by method\n\n        var condition4 = new VisualBasicBuilderPatternCondition(true, bbbValidator);\n        condition4.IsInvalidBuilderInitialization(vbContext).Should().BeFalse(); // Valid constructor validated by method\n\n        var condition5 = new VisualBasicBuilderPatternCondition(false, aaaInvalidator, bbbValidator);\n        condition5.IsInvalidBuilderInitialization(vbContext).Should().BeFalse(); // Invalid constructor, invalidated by Aaa, validated by Bbb\n\n        var condition6 = new VisualBasicBuilderPatternCondition(false, bbbValidator, aaaInvalidator); // Configuration order has no effect\n        condition6.IsInvalidBuilderInitialization(vbContext).Should().BeFalse(); // Invalid constructor, invalidated by Aaa, validated by Bbb\n\n        var condition7 = new VisualBasicBuilderPatternCondition(true, bbbValidator, cccInvalidator);\n        condition7.IsInvalidBuilderInitialization(vbContext).Should().BeTrue(); // Valid constructor, validated by Bbb, invalidated by Ccc\n\n        var condition8 = new VisualBasicBuilderPatternCondition(true, cccInvalidator, bbbValidator); // Configuration order has no effect\n        condition8.IsInvalidBuilderInitialization(vbContext).Should().BeTrue(); // Valid constructor, validated by Bbb, invalidated by Ccc\n\n        var dddContext = new InvocationContext(FindMethodInvocation_VB(vbContext.Node.SyntaxTree, \"Ddd\"), \"Ddd\", vbContext.Model);\n        var condition9 = new VisualBasicBuilderPatternCondition(false);\n        condition9.IsInvalidBuilderInitialization(dddContext).Should().BeFalse(); // Invalid constructor is not tracked through array propagation\n    }\n\n    private static InvocationContext CreateContext_CS()\n    {\n        const string source =\n@\"class X\n{\n    public Item Foo()\n    {\n        var ret = new Item();\n        ret = ret.Aaa();\n        return ret.Bbb().Ccc();\n    }\n\n    public Item Boo()\n    {\n        var arr = new Item[] {new Item()};\n        return arr[0].Ddd();\n    }\n};\nclass Item\n{\n    public Item Aaa() { return this;}\n    public Item Bbb() { return this;}\n    public Item Ccc() { return this;}\n    public Item Ddd() { return this;}\n}\";\n        var snippet = new SnippetCompiler(source, false, AnalyzerLanguage.CSharp);\n        return new InvocationContext(FindMethodInvocation_CS(snippet.Tree, \"Ccc\"), \"Ccc\", snippet.Model);\n    }\n\n    private static InvocationContext CreateContext_VB()\n    {\n        const string source =\n@\"Class X\n\n    Function Foo() As Item\n        Dim Ret As New Item()\n        Ret = Ret.Aaa()\n        Return Ret.Bbb().Ccc()\n    End Function\n\n    Function Boo() As Item\n        Dim Arr() As Item = {New Item}\n        Return Arr(0).Ddd()\n    End Function\n\nEnd Class\n\nClass Item\n\n    Public Function Aaa() As Item\n        Return Me\n    End Function\n\n    Public Function Bbb() As Item\n        Return Me\n    End Function\n\n    Public Function Ccc() As Item\n        Return Me\n    End Function\n\n    Public Function Ddd() As Item\n        Return Me\n    End Function\n\nEnd Class\";\n        var snippet = new SnippetCompiler(source, false, AnalyzerLanguage.VisualBasic);\n        return new InvocationContext(FindMethodInvocation_VB(snippet.Tree, \"Ccc\"), \"Ccc\", snippet.Model);\n    }\n\n    private static SyntaxNode FindMethodInvocation_CS(SyntaxTree tree, string name) =>\n        tree.GetRoot().DescendantNodes()\n            .OfType<CSharpSyntax.InvocationExpressionSyntax>()\n            .Single(x => SyntaxNodeExtensionsCSharp.GetIdentifier(x.Expression)?.ValueText == name);\n\n    private static SyntaxNode FindMethodInvocation_VB(SyntaxTree tree, string name) =>\n        tree.GetRoot().DescendantNodes()\n            .OfType<VBSyntax.InvocationExpressionSyntax>()\n            .Single(x => SyntaxNodeExtensionsVisualBasic.GetIdentifier(x.Expression)?.ValueText == name);\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Trackers/BuilderPatternDescriptorTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing SonarAnalyzer.Core.Trackers;\nusing BuilderPatternDescriptor = SonarAnalyzer.Core.Trackers.BuilderPatternDescriptor<Microsoft.CodeAnalysis.CSharp.SyntaxKind, Microsoft.CodeAnalysis.CSharp.Syntax.InvocationExpressionSyntax>;\n\nnamespace SonarAnalyzer.Test.Trackers;\n\n[TestClass]\npublic class BuilderPatternDescriptorTest\n{\n    [TestMethod]\n    public void IsMatch()\n    {\n        var context = CreateContext();\n        TrackerBase<SyntaxKind, InvocationContext>.Condition trueCondition = _ => true;\n        TrackerBase<SyntaxKind, InvocationContext>.Condition falseCondition = _ => false;\n        BuilderPatternDescriptor descriptor;\n\n        descriptor = new BuilderPatternDescriptor(true);\n        descriptor.IsMatch(context).Should().BeTrue();\n\n        descriptor = new BuilderPatternDescriptor(true, trueCondition);\n        descriptor.IsMatch(context).Should().BeTrue();\n\n        descriptor = new BuilderPatternDescriptor(true, trueCondition, trueCondition);\n        descriptor.IsMatch(context).Should().BeTrue();\n\n        descriptor = new BuilderPatternDescriptor(true, falseCondition);\n        descriptor.IsMatch(context).Should().BeFalse();\n\n        descriptor = new BuilderPatternDescriptor(true, trueCondition, falseCondition);\n        descriptor.IsMatch(context).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void IsValid_Literal()\n    {\n        var context = CreateContext();\n\n        var trueDescriptor = new BuilderPatternDescriptor(true);\n        trueDescriptor.IsValid(null).Should().BeTrue();\n        trueDescriptor.IsValid(context.Node as InvocationExpressionSyntax).Should().BeTrue();\n\n        var falseDescriptor = new BuilderPatternDescriptor(false);\n        falseDescriptor.IsValid(null).Should().BeFalse();\n        falseDescriptor.IsValid(context.Node as InvocationExpressionSyntax).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void IsValid_Lambda()\n    {\n        var context = CreateContext();\n\n        var descriptor = new BuilderPatternDescriptor(x => x is not null);\n        descriptor.IsValid(null).Should().BeFalse();\n        descriptor.IsValid(context.Node as InvocationExpressionSyntax).Should().BeTrue();\n    }\n\n    private static InvocationContext CreateContext()\n    {\n        const string source = @\"class X{void Foo(object x){x.ToString()}};\";\n        var snippet = new SnippetCompiler(source, true, AnalyzerLanguage.CSharp);\n        return new InvocationContext(snippet.Tree.Single<InvocationExpressionSyntax>(), \"ToString\", snippet.Model);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Trackers/ConstantValueFinderTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing SonarAnalyzer.CSharp.Core.Trackers;\n\nnamespace SonarAnalyzer.Test.Trackers;\n\n[TestClass]\npublic class ConstantValueFinderTest\n{\n    [TestMethod]\n    public void FieldDeclaredInAnotherSyntaxTree()\n    {\n        const string code1 = @\"\npublic partial class Sample\n{\n    private static int Original = 42;\n    private int Field = Original;\n}\";\n        const string code2 = @\"\npublic partial class Sample\n{\n    public int Method()\n    {\n        return Field;\n    }\n}\";\n        var compilation = SolutionBuilder.Create().AddProject(AnalyzerLanguage.CSharp).AddSnippets(code1, code2).GetCompilation();\n        var tree = compilation.SyntaxTrees.Single(x => x.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Any());\n        var returnExpression = tree.Single<ReturnStatementSyntax>().Expression;\n        var finder = new CSharpConstantValueFinder(compilation.GetSemanticModel(tree));\n        finder.FindConstant(returnExpression).Should().Be(42);\n    }\n\n    [TestMethod]\n    public void WrongCompilationBeingUsed()\n    {\n        const string firstSnippet = @\"\npublic class Foo\n{\n    private static int Original = 42;\n    private int Field = Original;\n}\";\n        const string secondSnippet = @\"\npublic class Bar\n{\n    private int Field = 42;\n    public int Method()\n    {\n        return Field;\n    }\n}\";\n        var firstCompilation = SolutionBuilder.Create().AddProject(AnalyzerLanguage.CSharp).AddSnippet(firstSnippet).GetCompilation();\n        var secondCompilation = SolutionBuilder.Create().AddProject(AnalyzerLanguage.CSharp).AddSnippet(secondSnippet).GetCompilation();\n        var secondCompilationReturnExpression = secondCompilation.SyntaxTrees.Single().Single<ReturnStatementSyntax>().Expression;\n        var firstCompilationFinder = new CSharpConstantValueFinder(firstCompilation.GetSemanticModel(firstCompilation.SyntaxTrees.Single()));\n        firstCompilationFinder.FindConstant(secondCompilationReturnExpression).Should().BeNull();\n        var secondCompilationFinder = new CSharpConstantValueFinder(secondCompilation.GetSemanticModel(secondCompilation.SyntaxTrees.Single()));\n        secondCompilationFinder.FindConstant(secondCompilationReturnExpression).Should().NotBeNull();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Trackers/ElementAccessTrackerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\nusing SonarAnalyzer.CSharp.Core.Trackers;\nusing SonarAnalyzer.VisualBasic.Core.Trackers;\nusing CSharpSyntax = Microsoft.CodeAnalysis.CSharp.Syntax;\nusing VBSyntax = Microsoft.CodeAnalysis.VisualBasic.Syntax;\n\nnamespace SonarAnalyzer.Test.Trackers;\n\n[TestClass]\npublic class ElementAccessTrackerTest\n{\n    private const string TestInputCS = @\"\npublic class Sample\n{\n    public int this[string key]\n    {\n        get => 42;\n        set { }\n    }\n\n    public void Usage(Sample s, string arg)\n    {\n        s[\"\"key\"\"] = 42;\n        this[\"\"key\"\"] = 42;\n        s[arg] = 42;\n        undefined[\"\"key\"\"] = 42;\n    }\n}\";\n\n    private const string TestInputVB = @\"\nPublic Class Sample\n\n    Default Public Property Item(Key As String) As Integer\n        Get\n            Return 42\n        End Get\n        Set(value As Integer)\n        End Set\n    End Property\n\n    Public Sub NoArgs()\n    End Sub\n\n    Public Sub Usage(S As Sample, Arg As String)\n        S(\"\"key\"\") = 42\n        Me(\"\"key\"\") = 42\n        S(Arg) = 42\n        NoArgs 'and no ParameterList\n        Undefined(\"\"Key\"\") = 42\n    End Sub\n\nEnd Class\";\n\n    [TestMethod]\n    public void ArgumentAtIndexIs_CS()\n    {\n        var context = CreateContext<CSharpSyntax.ElementAccessExpressionSyntax>(TestInputCS, 0, AnalyzerLanguage.CSharp);\n        var tracker = new CSharpElementAccessTracker();\n        tracker.ArgumentAtIndexIs(0, KnownType.System_String)(context).Should().BeTrue();\n        tracker.ArgumentAtIndexIs(0, KnownType.System_Int32)(context).Should().BeFalse();\n        tracker.ArgumentAtIndexIs(42, KnownType.System_String)(context).Should().BeFalse();\n\n        context = CreateContext<CSharpSyntax.ElementAccessExpressionSyntax>(TestInputCS, 3, AnalyzerLanguage.CSharp);\n        tracker.ArgumentAtIndexIs(0, KnownType.System_String)(context).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void ArgumentAtIndexIs_VB()\n    {\n        var context = CreateContext<VBSyntax.InvocationExpressionSyntax>(TestInputVB, 0, AnalyzerLanguage.VisualBasic);\n        var tracker = new CSharpElementAccessTracker();\n        tracker.ArgumentAtIndexIs(0, KnownType.System_String)(context).Should().BeTrue();\n        tracker.ArgumentAtIndexIs(0, KnownType.System_Int32)(context).Should().BeFalse();\n        tracker.ArgumentAtIndexIs(42, KnownType.System_String)(context).Should().BeFalse();\n\n        context = CreateContext<VBSyntax.InvocationExpressionSyntax>(TestInputVB, 4, AnalyzerLanguage.VisualBasic);\n        tracker.ArgumentAtIndexIs(0, KnownType.System_String)(context).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void ArgumentAtIndexEquals_CS()\n    {\n        var context = CreateContext<CSharpSyntax.ElementAccessExpressionSyntax>(TestInputCS, 0, AnalyzerLanguage.CSharp);\n        var tracker = new CSharpElementAccessTracker();\n        tracker.ArgumentAtIndexEquals(0, \"key\")(context).Should().BeTrue();\n        tracker.ArgumentAtIndexEquals(0, \"foo\")(context).Should().BeFalse();\n        tracker.ArgumentAtIndexEquals(42, \"key\")(context).Should().BeFalse();\n\n        context = CreateContext<CSharpSyntax.ElementAccessExpressionSyntax>(TestInputCS, 1, AnalyzerLanguage.CSharp);\n        tracker.ArgumentAtIndexEquals(0, \"key\")(context).Should().BeTrue();\n        tracker.ArgumentAtIndexEquals(0, \"foo\")(context).Should().BeFalse();\n        tracker.ArgumentAtIndexEquals(42, \"key\")(context).Should().BeFalse();\n\n        context = CreateContext<CSharpSyntax.ElementAccessExpressionSyntax>(TestInputCS, 2, AnalyzerLanguage.CSharp);\n        tracker.ArgumentAtIndexEquals(0, \"key\")(context).Should().BeFalse();\n        tracker.ArgumentAtIndexEquals(0, \"foo\")(context).Should().BeFalse();\n        tracker.ArgumentAtIndexEquals(42, \"key\")(context).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void ArgumentAtIndexEquals_VB()\n    {\n        var context = CreateContext<VBSyntax.InvocationExpressionSyntax>(TestInputVB, 0, AnalyzerLanguage.VisualBasic);\n        var tracker = new VisualBasicElementAccessTracker();\n        tracker.ArgumentAtIndexEquals(0, \"key\")(context).Should().BeTrue();\n        tracker.ArgumentAtIndexEquals(0, \"foo\")(context).Should().BeFalse();\n        tracker.ArgumentAtIndexEquals(42, \"key\")(context).Should().BeFalse();\n\n        context = CreateContext<VBSyntax.InvocationExpressionSyntax>(TestInputVB, 1, AnalyzerLanguage.VisualBasic);\n        tracker.ArgumentAtIndexEquals(0, \"key\")(context).Should().BeTrue();\n        tracker.ArgumentAtIndexEquals(0, \"foo\")(context).Should().BeFalse();\n        tracker.ArgumentAtIndexEquals(42, \"key\")(context).Should().BeFalse();\n\n        context = CreateContext<VBSyntax.InvocationExpressionSyntax>(TestInputVB, 2, AnalyzerLanguage.VisualBasic);\n        tracker.ArgumentAtIndexEquals(0, \"key\")(context).Should().BeFalse();\n        tracker.ArgumentAtIndexEquals(0, \"foo\")(context).Should().BeFalse();\n        tracker.ArgumentAtIndexEquals(42, \"key\")(context).Should().BeFalse();\n\n        context = CreateContext<VBSyntax.InvocationExpressionSyntax>(TestInputVB, 3, AnalyzerLanguage.VisualBasic);\n        tracker.ArgumentAtIndexEquals(0, \"key\")(context).Should().BeFalse();\n    }\n\n    private static ElementAccessContext CreateContext<TSyntaxNodeType>(string testInput, int skip, AnalyzerLanguage language) where TSyntaxNodeType : SyntaxNode\n    {\n        var testCode = new SnippetCompiler(testInput, true, language);\n        var node = testCode.Nodes<TSyntaxNodeType>().Skip(skip).First();\n        var context = new ElementAccessContext(testCode.CreateAnalysisContext(node));\n        return context;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Trackers/InvocationTrackerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\nusing SonarAnalyzer.CSharp.Core.Trackers;\nusing SonarAnalyzer.VisualBasic.Core.Trackers;\nusing CS = Microsoft.CodeAnalysis.CSharp.Syntax;\nusing VB = Microsoft.CodeAnalysis.VisualBasic.Syntax;\n\nnamespace SonarAnalyzer.Test.Trackers;\n\n[TestClass]\npublic class InvocationTrackerTest\n{\n    private const string TestInputCS = @\"\npublic class Base\n{\n    private void MyMethod(string a, string b, bool c, int d, object e) {}\n\n    private void Usage(string notAConst)\n    {\n        MyMethod(notAConst, \"\"myConst\"\", true, 4, new object());\n        Undefined();\n    }\n}\";\n\n    private const string TestInputVB = @\"\nPublic Class Base\n    Public Sub MyMethod(ByVal a As String, b As String, ByVal c As Boolean, ByVal d As Integer, ByRef e As Integer, ByVal f As Object)\n    End Sub\n\n    Public Sub NoArgs()\n    End Sub\n\n    Public Sub Usage(ByVal notAConst As String)\n        MyMethod(notAConst, \"\"myConst\"\", True, 4, 5, New Object())\n        NoArgs 'and no ParameterList\n    End Sub\nEnd Class\";\n\n#if NET\n    private const string IsIHeadersDictionaryCode = @\"\nnamespace WebPoc\n{\nusing System.Collections.Generic;\nusing Microsoft.Extensions.Primitives;\n\npublic class PermissiveCorsSimple\n{\n    public void MoreParameters() => new Dictionary<string, StringValues>().Add(\"\"a\"\", new StringValues(), \"\"c\"\");\n\n    public void WrongTypeFirstParameter() => new Dictionary<string, StringValues>().Add(1, new StringValues());\n\n    public void WrongTypeSecondParameter() => new Dictionary<string, StringValues>().Add(\"\"a\"\", 1);\n\n    public void RightCall() => new Dictionary<string, StringValues>().Add(\"\"A\"\", new StringValues());\n}\n\npublic static class Extensions\n{\n    public static void Add(this Dictionary<string, StringValues> d, string a, string b, string c) { }\n\n    public static void Add(this Dictionary<string, StringValues> d, int a, StringValues b) { }\n\n    public static void Add(this Dictionary<string, StringValues> d, string a, int b) { }\n}\n}\n\";\n#endif\n\n    [TestMethod]\n    public void ConstArgumentForParameter_CS()\n    {\n        var context = CreateContext<CS.InvocationExpressionSyntax>(TestInputCS, \"MyMethod\", AnalyzerLanguage.CSharp);\n        var tracker = new CSharpInvocationTracker();\n\n        tracker.ConstArgumentForParameter(context, \"a\").Should().BeNull();\n        tracker.ConstArgumentForParameter(context, \"b\").Should().Be(\"myConst\");\n        tracker.ConstArgumentForParameter(context, \"c\").Should().Be(true);\n        tracker.ConstArgumentForParameter(context, \"d\").Should().Be(4);\n        tracker.ConstArgumentForParameter(context, \"e\").Should().BeNull();\n        tracker.ConstArgumentForParameter(context, \"nonExistingParameterName\").Should().BeNull();\n    }\n\n    [TestMethod]\n    public void ArgumentIsBoolConstant_CS()\n    {\n        var context = CreateContext<CS.InvocationExpressionSyntax>(TestInputCS, \"MyMethod\", AnalyzerLanguage.CSharp);\n        var tracker = new CSharpInvocationTracker();\n\n        tracker.ArgumentIsBoolConstant(\"a\", true)(context).Should().Be(false);\n        tracker.ArgumentIsBoolConstant(\"a\", false)(context).Should().Be(false);\n        tracker.ArgumentIsBoolConstant(\"c\", true)(context).Should().Be(true);\n        tracker.ArgumentIsBoolConstant(\"c\", false)(context).Should().Be(false);\n        tracker.ArgumentIsBoolConstant(\"nonExistingParameterName\", true)(context).Should().Be(false);\n        tracker.ArgumentIsBoolConstant(\"nonExistingParameterName\", false)(context).Should().Be(false);\n    }\n\n    [TestMethod]\n    public void ConstArgumentForParameter_VB()\n    {\n        var context = CreateContext<VB.InvocationExpressionSyntax>(TestInputVB, \"MyMethod\", AnalyzerLanguage.VisualBasic);\n        var tracker = new VisualBasicInvocationTracker();\n\n        tracker.ConstArgumentForParameter(context, \"a\").Should().BeNull();\n        tracker.ConstArgumentForParameter(context, \"b\").Should().Be(\"myConst\");\n        tracker.ConstArgumentForParameter(context, \"c\").Should().Be(true);\n        tracker.ConstArgumentForParameter(context, \"d\").Should().Be(4);\n        tracker.ConstArgumentForParameter(context, \"e\").Should().Be(5);\n        tracker.ConstArgumentForParameter(context, \"f\").Should().BeNull();\n        tracker.ConstArgumentForParameter(context, \"nonExistingParameterName\").Should().BeNull();\n    }\n\n    [TestMethod]\n    public void ArgumentIsBoolConstant_VB()\n    {\n        var context = CreateContext<VB.InvocationExpressionSyntax>(TestInputVB, \"MyMethod\", AnalyzerLanguage.VisualBasic);\n        var tracker = new VisualBasicInvocationTracker();\n\n        tracker.ArgumentIsBoolConstant(\"a\", true)(context).Should().Be(false);\n        tracker.ArgumentIsBoolConstant(\"a\", false)(context).Should().Be(false);\n        tracker.ArgumentIsBoolConstant(\"c\", true)(context).Should().Be(true);\n        tracker.ArgumentIsBoolConstant(\"c\", false)(context).Should().Be(false);\n        tracker.ArgumentIsBoolConstant(\"nonExistingParameterName\", true)(context).Should().Be(false);\n        tracker.ArgumentIsBoolConstant(\"nonExistingParameterName\", false)(context).Should().Be(false);\n    }\n\n    [TestMethod]\n    public void ArgumentAtIndexIsStringConstant_CS()\n    {\n        var context = CreateContext<CS.InvocationExpressionSyntax>(TestInputCS, \"MyMethod\", AnalyzerLanguage.CSharp);\n        var tracker = new CSharpInvocationTracker();\n        tracker.ArgumentAtIndexIsStringConstant(0)(context).Should().BeFalse();\n        tracker.ArgumentAtIndexIsStringConstant(1)(context).Should().BeTrue();\n        tracker.ArgumentAtIndexIsStringConstant(2)(context).Should().BeFalse();\n        tracker.ArgumentAtIndexIsStringConstant(3)(context).Should().BeFalse();\n        tracker.ArgumentAtIndexIsStringConstant(4)(context).Should().BeFalse();\n        tracker.ArgumentAtIndexIsStringConstant(42)(context).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void ArgumentAtIndexIsStringConstant_VB()\n    {\n        var context = CreateContext<VB.InvocationExpressionSyntax>(TestInputVB, \"MyMethod\", AnalyzerLanguage.VisualBasic);\n        var tracker = new VisualBasicInvocationTracker();\n        tracker.ArgumentAtIndexIsStringConstant(0)(context).Should().BeFalse();\n        tracker.ArgumentAtIndexIsStringConstant(1)(context).Should().BeTrue();\n        tracker.ArgumentAtIndexIsStringConstant(2)(context).Should().BeFalse();\n        tracker.ArgumentAtIndexIsStringConstant(3)(context).Should().BeFalse();\n        tracker.ArgumentAtIndexIsStringConstant(4)(context).Should().BeFalse();\n        tracker.ArgumentAtIndexIsStringConstant(5)(context).Should().BeFalse();\n        tracker.ArgumentAtIndexIsStringConstant(42)(context).Should().BeFalse();\n\n        context = CreateContext<VB.InvocationExpressionSyntax>(TestInputVB, \"NoArgs\", AnalyzerLanguage.VisualBasic, 1);\n        tracker.ArgumentAtIndexIsStringConstant(0)(context).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void ArgumentAtIndexIsAny_CS()\n    {\n        var context = CreateContext<CS.InvocationExpressionSyntax>(TestInputCS, \"MyMethod\", AnalyzerLanguage.CSharp);\n        var tracker = new CSharpInvocationTracker();\n        tracker.ArgumentAtIndexIsAny(0, \"myConst\")(context).Should().BeFalse();\n        tracker.ArgumentAtIndexIsAny(1, \"myConst\")(context).Should().BeTrue();\n        tracker.ArgumentAtIndexIsAny(1, \"a\", \"b\", \"myConst\")(context).Should().BeTrue();\n        tracker.ArgumentAtIndexIsAny(1, \"a\", \"b\")(context).Should().BeFalse();\n        tracker.ArgumentAtIndexIsAny(2, \"true\")(context).Should().BeFalse();   // Not a string\n        tracker.ArgumentAtIndexIsAny(42, \"myConst\")(context).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void ArgumentAtIndexIsAny_VB()\n    {\n        var context = CreateContext<VB.InvocationExpressionSyntax>(TestInputVB, \"MyMethod\", AnalyzerLanguage.VisualBasic);\n        var tracker = new VisualBasicInvocationTracker();\n        tracker.ArgumentAtIndexIsAny(0, \"myConst\")(context).Should().BeFalse();\n        tracker.ArgumentAtIndexIsAny(1, \"myConst\")(context).Should().BeTrue();\n        tracker.ArgumentAtIndexIsAny(1, \"a\", \"b\", \"myConst\")(context).Should().BeTrue();\n        tracker.ArgumentAtIndexIsAny(1, \"a\", \"b\")(context).Should().BeFalse();\n        tracker.ArgumentAtIndexIsAny(2, \"true\")(context).Should().BeFalse();   // Not a string\n        tracker.ArgumentAtIndexIsAny(42, \"myConst\")(context).Should().BeFalse();\n\n        context = CreateContext<VB.InvocationExpressionSyntax>(TestInputVB, \"NoArgs\", AnalyzerLanguage.VisualBasic, 1);\n        tracker.ArgumentAtIndexIsAny(0, \"myConst\")(context).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void InvocationConditionForUndefinedMethod()\n    {\n        var context = CreateContext<CS.InvocationExpressionSyntax>(TestInputCS, \"Undefined\", AnalyzerLanguage.CSharp, 1);\n        var tracker = new CSharpInvocationTracker();\n        tracker.MethodIsStatic()(context).Should().BeFalse();\n        tracker.MethodIsExtension()(context).Should().BeFalse();\n        tracker.MethodHasParameters(0)(context).Should().BeFalse();\n        tracker.MethodReturnTypeIs(KnownType.Void)(context).Should().BeFalse();\n    }\n\n#if NET\n    [TestMethod]\n    [DataRow(0, false)]\n    [DataRow(1, false)]\n    [DataRow(2, false)]\n    [DataRow(3, true)]\n    public void IsIHeadersDictionary(int invocationsToSkip, bool expectedValue)\n    {\n        var context = CreateContext<CS.InvocationExpressionSyntax>(IsIHeadersDictionaryCode,\n                                                                             \"MethodName\",\n                                                                             AnalyzerLanguage.CSharp,\n                                                                             invocationsToSkip,\n                                                                             new[] { AspNetCoreMetadataReference.MicrosoftExtensionsPrimitives});\n        var sut = new CSharpInvocationTracker();\n        sut.IsIHeadersDictionary()(context).Should().Be(expectedValue);\n    }\n#endif\n\n    private static InvocationContext CreateContext<TSyntaxNodeType>(string testInput,\n                                                                    string methodName,\n                                                                    AnalyzerLanguage language,\n                                                                    int skip = 0,\n                                                                    IEnumerable<MetadataReference> references = null)\n        where TSyntaxNodeType : SyntaxNode\n    {\n        var testCode = new SnippetCompiler(testInput, true, language, references);\n        var invocationSyntaxNode = testCode.Nodes<TSyntaxNodeType>().Skip(skip).First();\n        var context = new InvocationContext(invocationSyntaxNode, methodName, testCode.Model);\n        return context;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Trackers/MemberDescriptorTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\nusing SonarAnalyzer.CSharp.Core.Syntax.Extensions;\nusing SonarAnalyzer.VisualBasic.Core.Syntax.Extensions;\nusing SyntaxCS = Microsoft.CodeAnalysis.CSharp.Syntax;\nusing SyntaxVB = Microsoft.CodeAnalysis.VisualBasic.Syntax;\n\nnamespace SonarAnalyzer.Test.Trackers;\n\n[TestClass]\npublic class MethodDescriptorTest\n{\n    private static InvocationContext xmlNodeCloneNodeInvocationContext;\n\n    [ClassInitialize]\n    public static void ClassInit(TestContext context)\n    {\n        const string code = @\"\nnamespace Test\n{\n    using System.Xml;\n\n    class Class1\n    {\n        public void DoStuff(XmlNode node)\n        {\n            node.CloneNode(true);\n        }\n    }\n}\n\";\n        var snippet = new SnippetCompiler(code, MetadataReferenceFacade.SystemXml);\n        xmlNodeCloneNodeInvocationContext = CreateContextForMethod(\"XmlNode.CloneNode\", snippet);\n    }\n\n    [TestMethod]\n    public void IsMatch_WhenMethodNameIsNull_ReturnsFalse()\n    {\n        var sut = new MemberDescriptor(KnownType.System_Xml_XmlNode, \"CloneNode\");\n        sut.IsMatch(null, Substitute.For<ITypeSymbol>(), StringComparison.OrdinalIgnoreCase).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void IsMatch_WhenTypeSymbolIsNull_ReturnsFalse()\n    {\n        var sut = new MemberDescriptor(KnownType.System_Xml_XmlNode, \"CloneNode\");\n        sut.IsMatch(\"CloneNode\", null, StringComparison.OrdinalIgnoreCase).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void IsMatch_WhenContainingTypeIsNull_ReturnsFalse()\n    {\n        var method = Substitute.For<IMethodSymbol>();\n        method.ContainingType.Returns((INamedTypeSymbol)null);\n        var lazySymbol = new Lazy<IMethodSymbol>(() => method);\n\n        var sut = new MemberDescriptor(KnownType.System_Xml_XmlNode, \"CloneNode\");\n        sut.IsMatch(\"CloneNode\", lazySymbol, StringComparison.OrdinalIgnoreCase).Should().BeFalse();\n    }\n\n    [DataRow(null, StringComparison.InvariantCultureIgnoreCase)]\n    [DataRow(\"\", StringComparison.InvariantCultureIgnoreCase)]\n    [DataRow(\"Clone\", StringComparison.InvariantCultureIgnoreCase)]\n    [DataRow(\"clonenode\", StringComparison.InvariantCulture)]\n    [TestMethod]\n    public void MatchesAny_WhenMethodNameDoesNotMatch_ReturnsFalseDoesNotEvaluateSymbol(string memberName, StringComparison stringComparison)\n    {\n        var sut = new MemberDescriptor(KnownType.System_Xml_XmlNode, \"CloneNode\");\n        var shouldNotBeUsed = new Lazy<IMethodSymbol>(() => throw new NotSupportedException());\n        MemberDescriptor.MatchesAny(memberName, shouldNotBeUsed, false, stringComparison, sut).Should().BeFalse();\n    }\n\n    [DataRow(null, StringComparison.InvariantCultureIgnoreCase)]\n    [DataRow(\"\", StringComparison.InvariantCultureIgnoreCase)]\n    [DataRow(\"Clone\", StringComparison.InvariantCultureIgnoreCase)]\n    [DataRow(\"clonenode\", StringComparison.InvariantCulture)]\n    [TestMethod]\n    public void IsMatch_WhenMethodNameDoesNotMatch_ReturnsFalseDoesNotEvaluateSymbol(string memberName, StringComparison stringComparison)\n    {\n        var sut = new MemberDescriptor(KnownType.System_Xml_XmlNode, \"CloneNode\");\n        var shouldNotBeUsed = new Lazy<IMethodSymbol>(() => throw new NotSupportedException());\n        sut.IsMatch(memberName, shouldNotBeUsed, stringComparison).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void IsMatch_WhenTypeMatchesButNameIsDifferentCase_ReturnsFalse()\n    {\n        var sut = new MemberDescriptor(KnownType.System_Xml_XmlNode, \"CloneNode\");\n        sut.IsMatch(\"clonenode\", xmlNodeCloneNodeInvocationContext.MethodSymbol, StringComparison.InvariantCulture).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void IsMatch_WhenMethodNameAndTypeMatch_ReturnsTrue()\n    {\n        var sut = new MemberDescriptor(KnownType.System_Xml_XmlNode, \"CloneNode\");\n        sut.IsMatch(\"CloneNode\", xmlNodeCloneNodeInvocationContext.MethodSymbol, StringComparison.InvariantCulture).Should().BeTrue();\n        sut.IsMatch(\"clonenode\", xmlNodeCloneNodeInvocationContext.MethodSymbol, StringComparison.InvariantCultureIgnoreCase).Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void ExactMatchOnly_OverridesAreNotMatched_CS()\n    {\n        const string code = @\"\nnamespace Test\n{\n  class Class1\n  {\n    public void DoStuff()\n    {\n        System.Console.WriteLine();\n        this.WriteLine();\n    }\n\n    private void WriteLine() {}\n  }\n}\n\";\n        var snippet = new SnippetCompiler(code);\n\n        CheckExactMatchOnly_OverridesAreNotMatched(snippet);\n    }\n\n    [TestMethod]\n    public void ExactMatchOnly_OverridesAreNotMatched_VB()\n    {\n        const string code = @\"\nNamespace Test\n    Class Class1\n        Public Sub DoStuff()\n\n            System.Console.WriteLine()\n            Me.WriteLine()\n        End Sub\n\n        Private Sub WriteLine()\n            ' empty\n        End Sub\n    End Class\nEnd Namespace\n\";\n        var snippet = new SnippetCompiler(code, false, AnalyzerLanguage.VisualBasic);\n\n        CheckExactMatchOnly_OverridesAreNotMatched(snippet);\n    }\n\n    [TestMethod]\n    public void ExactMatch_DoesNotMatchOverrides_CS()\n    {\n        const string code = @\"\nnamespace Test\n{\n    using System.Xml;\n\n    class Class1\n    {\n        public void DoStuff(XmlNode node, XmlDocument doc)\n        {\n            node.WriteTo(null);\n            doc.WriteTo(null);\n        }\n    }\n}\n\";\n        var snippet = new SnippetCompiler(code, MetadataReferenceFacade.SystemXml);\n        CheckExactMatch_DoesNotMatchOverrides(snippet);\n    }\n\n    [TestMethod]\n    public void ExactMatch_DoesNotMatchOverrides_VB()\n    {\n        const string code = @\"\nImports System.Xml\nNamespace Test\n    Class Class1\n        Public Sub DoStuff(node As XmlNode, doc As XmlDocument)\n            node.WriteTo(Nothing)\n            doc.WriteTo(Nothing)\n        End Sub\n    End Class\nEnd Namespace\n\";\n        var snippet = new SnippetCompiler(code, false, AnalyzerLanguage.VisualBasic,\n            MetadataReferenceFacade.SystemXml);\n        CheckExactMatch_DoesNotMatchOverrides(snippet);\n    }\n\n    [TestMethod]\n    public void MatchesAny_AndCheckingOverrides_DoesMatchOverrides_CS()\n    {\n        const string code = @\"\nnamespace Test\n{\n    using System.Xml;\n\n    class Class1\n    {\n        public void DoStuff(XmlNode node, XmlDocument doc)\n        {\n            node.WriteTo(null);\n            doc.WriteTo(null);\n        }\n    }\n}\n\";\n        var snippet = new SnippetCompiler(code, MetadataReferenceFacade.SystemXml);\n        CheckMatchesAny_AndCheckingOverrides_DoesMatchOverrides(snippet);\n    }\n\n    [TestMethod]\n    public void MatchesAny_MethodAndTypeCombination_FindsCorrectOne()\n    {\n        var nodeClone = new MemberDescriptor(KnownType.System_Xml_XmlNode, \"Clone\");\n        var nodeCloneNode = new MemberDescriptor(KnownType.System_Xml_XmlNode, \"CloneNode\");\n        var docCloneNode = new MemberDescriptor(KnownType.System_Xml_XmlDocument, \"CloneNode\");\n\n        // this should be false, because on XmlNode we check only Clone(), not CloneNode()\n        // the implementation should correctly map the method name with the type\n        CheckIsMethodOrDerived(false, xmlNodeCloneNodeInvocationContext, nodeClone, docCloneNode);\n        // here, we verify if XmlNode.CloneNode() is called, which is true\n        CheckIsMethodOrDerived(true, xmlNodeCloneNodeInvocationContext, nodeCloneNode, docCloneNode);\n    }\n\n    [TestMethod]\n    public void MatchesAny_AndCheckingOverrides_DoesMatchOverrides_VB()\n    {\n        const string code = @\"\nImports System.Xml\nNamespace Test\n    Class Class1\n        Public Sub DoStuff(node As XmlNode, doc As XmlDocument)\n            node.WriteTo(Nothing)\n            doc.WriteTo(Nothing)\n        End Sub\n    End Class\nEnd Namespace\n\";\n        var snippet = new SnippetCompiler(code, false, AnalyzerLanguage.VisualBasic, MetadataReferenceFacade.SystemXml);\n        CheckMatchesAny_AndCheckingOverrides_DoesMatchOverrides(snippet);\n    }\n\n    [TestMethod]\n    public void CheckMatch_InterfaceMethods_CS()\n    {\n        const string code = @\"\nnamespace Test\n{\n    sealed class Class1 : System.IDisposable\n    {\n        public void Test()\n        {\n            this.Dispose();\n        }\n\n        public void Dispose() { /* no-op */ }\n    }\n}\n\";\n\n        var snippet = new SnippetCompiler(code);\n        DoCheckMatch_InterfaceMethods(snippet);\n    }\n\n    [TestMethod]\n    public void CheckMatch_InterfaceMethods_VB()\n    {\n        const string code = @\"\nNamespace Test\n    NotInheritable Class Class1\n        Implements System.IDisposable\n\n        Public Sub Test()\n            Dispose()\n        End Sub\n\n        Public Sub Dispose() Implements System.IDisposable.Dispose\n            ' no-op\n        End Sub\n    End Class\nEnd Namespace\n\";\n\n        var snippet = new SnippetCompiler(code, false, AnalyzerLanguage.VisualBasic);\n        DoCheckMatch_InterfaceMethods(snippet);\n    }\n\n    [TestMethod]\n    public void CheckMatch_InterfaceMethods_NameMatchButNotOverride_CS()\n    {\n        const string code = @\"\nnamespace Test\n{\n    sealed class Class1 : System.IDisposable\n    {\n        public void Test()\n        {\n            Dispose(42);      // <-- FALSE POSITIVE: shouldn't match since not implementing IDisposable.Dispose\n        }\n\n        public void Dispose(int data) {  /* no-op */ }\n\n        void System.IDisposable.Dispose() { /* no-op */ }\n    }\n}\n\";\n        var snippet = new SnippetCompiler(code);\n        DoCheckMatch_InterfaceMethods(snippet);\n    }\n\n    [TestMethod]\n    public void CheckMatch_InterfaceMethods_NameMatchButNotOverride_VB()\n    {\n        const string code = @\"\nNamespace Test\n    NotInheritable Class Class1\n        Implements System.IDisposable\n\n        Public Sub Test()\n            Dispose(42)     ' <-- FALSE POSITIVE: shouldn't match since not implementing IDisposable.Dispose\n        End Sub\n\n        Public Sub Dispose(Data As Integer)\n            ' no-op\n        End Sub\n\n        Private Sub Dispose() Implements System.IDisposable.Dispose\n            ' no-op\n        End Sub\n    End Class\nEnd Namespace\n\";\n\n        var snippet = new SnippetCompiler(code, false, AnalyzerLanguage.VisualBasic);\n        DoCheckMatch_InterfaceMethods(snippet);\n    }\n\n    [TestMethod]\n    public void CheckMatch_CaseInsensitivity()\n    {\n        const string code = @\"\nNamespace Test\n    NotInheritable Class Class1\n        Implements System.IDisposable\n\n        Public Sub Test()\n            Dispose()\n        End Sub\n\n        Public Sub Dispose() Implements System.IDisposable.Dispose\n            ' no-op\n        End Sub\n    End Class\nEnd Namespace\n\";\n        var snippet = new SnippetCompiler(code, false, AnalyzerLanguage.VisualBasic);\n        var dispose = new MemberDescriptor(KnownType.System_IDisposable, \"Dispose\");\n        var callToDispose = CreateContextForMethod(\"Class1.Dispose\", snippet);\n\n        var result = MemberDescriptor.MatchesAny(\"Dispose\", callToDispose.MethodSymbol, true, StringComparison.Ordinal, dispose);\n        result.Should().Be(true);\n        result = MemberDescriptor.MatchesAny(\"dispose\", callToDispose.MethodSymbol, true, StringComparison.Ordinal, dispose);\n        result.Should().Be(false);\n        result = MemberDescriptor.MatchesAny(\"DISPOSE\", callToDispose.MethodSymbol, true, StringComparison.Ordinal, dispose);\n        result.Should().Be(false);\n\n        result = MemberDescriptor.MatchesAny(\"Dispose\", callToDispose.MethodSymbol, true, StringComparison.OrdinalIgnoreCase, dispose);\n        result.Should().Be(true);\n        result = MemberDescriptor.MatchesAny(\"dispose\", callToDispose.MethodSymbol, true, StringComparison.OrdinalIgnoreCase, dispose);\n        result.Should().Be(true);\n        result = MemberDescriptor.MatchesAny(\"DISPOSE\", callToDispose.MethodSymbol, true, StringComparison.OrdinalIgnoreCase, dispose);\n        result.Should().Be(true);\n    }\n\n    private static InvocationContext CreateContextForMethod(string typeAndMethodName, SnippetCompiler snippet)\n    {\n        var nameParts = typeAndMethodName.Split('.');\n\n        var identifierPairs = snippet.IsCSharp() ? GetCSharpNodes() : GetVbNodes();\n\n        foreach (var (invocation, methodName) in identifierPairs)\n        {\n            var symbol = snippet.Symbol<IMethodSymbol>(invocation);\n            if (symbol.Name == nameParts[1] &&\n                symbol.ContainingType.Name == nameParts[0])\n            {\n                return new InvocationContext(invocation, methodName, snippet.Model);\n            }\n        }\n\n        Assert.Fail($\"Test setup error: could not find method call in test code snippet: {typeAndMethodName}\");\n        return null;\n\n        IEnumerable<(SyntaxNode Node, string Name)> GetCSharpNodes() =>\n            snippet.Nodes<SyntaxCS.InvocationExpressionSyntax>()\n                .Select(x => ((SyntaxNode)x, SyntaxNodeExtensionsCSharp.GetIdentifier(x.Expression)?.ValueText));\n\n        IEnumerable<(SyntaxNode Node, string Name)> GetVbNodes() =>\n            snippet.Nodes<SyntaxVB.InvocationExpressionSyntax>()\n                .Select(x => ((SyntaxNode)x, SyntaxNodeExtensionsVisualBasic.GetIdentifier(x.Expression)?.ValueText));\n    }\n\n    private static void CheckExactMatchOnly_OverridesAreNotMatched(SnippetCompiler snippet)\n    {\n        // Testing for calls to Console.WriteLine\n        var targetMethodSignature = new MemberDescriptor(KnownType.System_Console, \"WriteLine\");\n\n        // 1. Should match Console.WriteLine\n        var callToConsoleWriteLine = CreateContextForMethod(\"Console.WriteLine\", snippet);\n        CheckExactMethod(true, callToConsoleWriteLine, targetMethodSignature);\n\n        // 2. Should not match call to xxx.WriteLine\n        var callClass1WriteLine = CreateContextForMethod(\"Class1.WriteLine\", snippet);\n        CheckExactMethod(false, callClass1WriteLine, new MemberDescriptor(KnownType.System_Console, \"Foo\"),\n            targetMethodSignature,\n            new MemberDescriptor(KnownType.System_Data_DataSet, \".ctor\"));\n\n        // 3. Should match if Console.WriteLine is in the list of candidates\n        CheckExactMethod(false, callClass1WriteLine, targetMethodSignature);\n    }\n\n    private static void CheckExactMatch_DoesNotMatchOverrides(SnippetCompiler snippet)\n    {\n        // XmlDocument derives from XmlNode\n        var nodeWriteTo = new MemberDescriptor(KnownType.System_Xml_XmlNode, \"WriteTo\");\n        var docWriteTo = new MemberDescriptor(KnownType.System_Xml_XmlDocument, \"WriteTo\");\n\n        // 1. Call to node.WriteTo should only match for XmlNode\n        var callToNodeWriteTo = CreateContextForMethod(\"XmlNode.WriteTo\", snippet);\n        CheckExactMethod(true, callToNodeWriteTo, nodeWriteTo);\n        CheckExactMethod(false, callToNodeWriteTo, docWriteTo);\n\n        // 2. Call to doc.WriteTo should only match for XmlDocument\n        var callToDocWriteTo = CreateContextForMethod(\"XmlDocument.WriteTo\", snippet);\n        CheckExactMethod(false, callToDocWriteTo, nodeWriteTo);\n        CheckExactMethod(true, callToDocWriteTo, docWriteTo);\n    }\n\n    private static void CheckMatchesAny_AndCheckingOverrides_DoesMatchOverrides(SnippetCompiler snippet)\n    {\n        // XmlDocument derives from XmlNode\n        var nodeWriteTo = new MemberDescriptor(KnownType.System_Xml_XmlNode, \"WriteTo\");\n        var docWriteTo = new MemberDescriptor(KnownType.System_Xml_XmlDocument, \"WriteTo\");\n\n        // 1. Call to node.WriteTo should only match for XmlNode\n        var callToNodeWriteTo = CreateContextForMethod(\"XmlNode.WriteTo\", snippet);\n        CheckIsMethodOrDerived(true, callToNodeWriteTo, nodeWriteTo);\n        CheckIsMethodOrDerived(false, callToNodeWriteTo, docWriteTo);\n\n        // 2. Call to doc.WriteTo should match for XmlDocument and XmlNode\n        var callToDocWriteTo = CreateContextForMethod(\"XmlDocument.WriteTo\", snippet);\n        CheckIsMethodOrDerived(true, callToDocWriteTo, nodeWriteTo);\n        CheckIsMethodOrDerived(true, callToDocWriteTo, docWriteTo);\n    }\n\n    private static void DoCheckMatch_InterfaceMethods(SnippetCompiler snippet)\n    {\n        var dispose = new MemberDescriptor(KnownType.System_IDisposable, \"Dispose\");\n        var callToDispose = CreateContextForMethod(\"Class1.Dispose\", snippet);\n\n        // Exact match should not match, but matching \"derived\" methods should\n        CheckExactMethod(false, callToDispose, dispose);\n        CheckIsMethodOrDerived(true, callToDispose, dispose);\n    }\n\n    private static void CheckExactMethod(bool expectedOutcome, InvocationContext invocationContext, params MemberDescriptor[] targetMethodSignatures) =>\n        CheckMatchesAny(false, expectedOutcome, invocationContext, targetMethodSignatures);\n\n    private static void CheckIsMethodOrDerived(bool expectedOutcome, InvocationContext invocationContext, params MemberDescriptor[] targetMethodSignatures) =>\n        CheckMatchesAny(true, expectedOutcome, invocationContext, targetMethodSignatures);\n\n    private static void CheckMatchesAny(bool checkDerived, bool expectedOutcome, InvocationContext invocationContext, params MemberDescriptor[] targetMethodSignatures)\n    {\n        var result = MemberDescriptor.MatchesAny(invocationContext.MethodName,\n            invocationContext.MethodSymbol, checkDerived, StringComparison.Ordinal, targetMethodSignatures);\n\n        result.Should().Be(expectedOutcome);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Trackers/MethodDeclarationTrackerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Facade;\nusing SonarAnalyzer.Core.Trackers;\nusing SonarAnalyzer.CSharp.Core.Facade;\nusing SonarAnalyzer.CSharp.Core.Trackers;\nusing SonarAnalyzer.VisualBasic.Core.Facade;\nusing CS = Microsoft.CodeAnalysis.CSharp;\nusing VB = Microsoft.CodeAnalysis.VisualBasic;\n\nnamespace SonarAnalyzer.Test.Trackers;\n\n[TestClass]\npublic class MethodDeclarationTrackerTest\n{\n    private const string TestInputCS = @\"\npublic class Sample\n{\n    public void NoArgs() {}\n}\";\n\n    [TestMethod]\n    public void MatchMethodName()\n    {\n        var tracker = new CSharpMethodDeclarationTracker();\n        var context = CreateContext(TestInputCS, AnalyzerLanguage.CSharp, \"NoArgs\");\n        tracker.MatchMethodName(\"NoArgs\")(context).Should().BeTrue();\n        tracker.MatchMethodName(\"Something\")(context).Should().BeFalse();\n    }\n\n#if NET\n\n    [TestMethod]\n    public void Track_VerifyMethodIdentifierLocations_CS()\n    {\n        const string code = @\"\nabstract record AbstractRecordHasMethodSymbol(string Y); //For Coverage\n\npublic class Sample\n{\n    public Sample() {}\n//         ^^^^^^\n    public void Method()\n//              ^^^^^^\n    {\n        void LocalFunction() { } // Tracking of local functions is not supported\n    }\n    ~Sample() {}\n//   ^^^^^^\n    public int Property\n//             ^^^^^^^^\n//             ^^^^^^^^ @-1\n    {\n        get => 42;\n        set { }\n    }\n    public int InitProperty\n//             ^^^^^^^^^^^^\n//             ^^^^^^^^^^^^ @-1\n    {\n        get => 42;\n        init { }\n    }\n    public int this[int index]\n//             ^^^^\n//             ^^^^ @-1\n    {\n        get => 42;\n        set { }\n    }\n    public event System.EventHandler Event\n//                                   ^^^^^\n//                                   ^^^^^ @-1\n    {\n        add {}\n        remove {}\n    }\n    public static int operator +(Sample a, Sample b) => 42;\n//                             ^\n}\";\n        new VerifierBuilder<TestRule_CS>().AddSnippet(code).WithOptions(LanguageOptions.FromCSharp9).Verify();\n    }\n\n#endif\n\n    [TestMethod]\n    public void Track_VerifyMethodIdentifierLocations_VB()\n    {\n        const string code = @\"\nPublic Class Sample\n\n    Public Sub New()\n        '      ^^^\n    End Sub\n\n    Public Sub Procedure()\n        '      ^^^^^^^^^\n    End Sub\n\n    Public Function SomeFunction() As Integer\n        '           ^^^^^^^^^^^^\n    End Function\n\n    Protected Overrides Sub Finalize()\n        '                   ^^^^^^^^\n        MyBase.Finalize()\n    End Sub\n\n    Public Property Prop As Integer\n        '           ^^^^\n        '           ^^^^ @-1\n        Get\n        End Get\n        Set(value As Integer)\n        End Set\n    End Property\n\n    Default Public Property Indexer(x As Integer, y As Integer) As Integer\n        '                   ^^^^^^^\n        '                   ^^^^^^^ @-1\n        Get\n        End Get\n        Set(value As Integer)\n        End Set\n    End Property\n\n    Public Custom Event Changed As EventHandler\n        '               ^^^^^^^\n        '               ^^^^^^^ @-1\n        '               ^^^^^^^ @-2\n        AddHandler(value As EventHandler)\n        End AddHandler\n        RemoveHandler(value As EventHandler)\n        End RemoveHandler\n        RaiseEvent(sender As Object, e As EventArgs)\n        End RaiseEvent\n    End Event\n\n    Public Shared Operator +(A As Sample, B As Sample) As Integer\n        '                  ^\n    End Operator\n\n    Declare Function ExternalMethod Lib \"\"foo.dll\"\" (lpBuffer As String) As Integer\n\nEnd Class\";\n        new VerifierBuilder<TestRule_VB>().AddSnippet(code).Verify();\n    }\n\n    private static MethodDeclarationContext CreateContext(string testInput, AnalyzerLanguage language, string methodName)\n    {\n        var testCode = new SnippetCompiler(testInput, false, language);\n        var symbol = testCode.MethodSymbol(\"Sample.\" + methodName);\n        return new MethodDeclarationContext(symbol, testCode.Model.Compilation);\n    }\n\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    private class TestRule_CS : TrackerHotspotDiagnosticAnalyzer<CS.SyntaxKind>\n    {\n        protected override ILanguageFacade<CS.SyntaxKind> Language => CSharpFacade.Instance;\n\n        public TestRule_CS() : base(AnalyzerConfiguration.AlwaysEnabled, \"S104\", \"Message\") { } // Any existing rule ID\n\n        protected override void Initialize(TrackerInput input) =>\n            Language.Tracker.MethodDeclaration.Track(input);\n    }\n\n    [DiagnosticAnalyzer(LanguageNames.VisualBasic)]\n    private class TestRule_VB : TrackerHotspotDiagnosticAnalyzer<VB.SyntaxKind>\n    {\n        protected override ILanguageFacade<VB.SyntaxKind> Language => VisualBasicFacade.Instance;\n\n        public TestRule_VB() : base(AnalyzerConfiguration.AlwaysEnabled, \"S104\", \"Message\") { } // Any existing rule ID\n\n        protected override void Initialize(TrackerInput input) =>\n            Language.Tracker.MethodDeclaration.Track(input);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Trackers/ObjectCreationTrackerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\nusing SonarAnalyzer.CSharp.Core.Trackers;\nusing SonarAnalyzer.VisualBasic.Core.Trackers;\nusing CS = Microsoft.CodeAnalysis.CSharp.Syntax;\nusing VB = Microsoft.CodeAnalysis.VisualBasic.Syntax;\n\nnamespace SonarAnalyzer.Test.Trackers;\n\n[TestClass]\npublic class ObjectCreationTrackerTest\n{\n    [TestMethod]\n    public void ConstArgumentForParameter_CS()\n    {\n        const string testInput = @\"\npublic class Base\n{\n    private Base(string a, string b, bool c, int d, object e) {}\n\n    private void Usage(string notAConst)\n    {\n      new Base(notAConst, \"\"myConst\"\", true, 4, new object());\n    }\n}\";\n        var context = CreateContext<CS.ObjectCreationExpressionSyntax>(testInput, AnalyzerLanguage.CSharp);\n        var tracker = new CSharpObjectCreationTracker();\n\n        tracker.ConstArgumentForParameter(context, \"a\").Should().BeNull();\n        tracker.ConstArgumentForParameter(context, \"b\").Should().Be(\"myConst\");\n        tracker.ConstArgumentForParameter(context, \"c\").Should().Be(true);\n        tracker.ConstArgumentForParameter(context, \"d\").Should().Be(4);\n        tracker.ConstArgumentForParameter(context, \"e\").Should().BeNull();\n        tracker.ConstArgumentForParameter(context, \"nonExistingParameterName\").Should().BeNull();\n    }\n\n#if NET\n    [TestMethod]\n    public void ImplicitConstArgumentForParameter_CS()\n    {\n        const string testInput = @\"\npublic class Base\n{\nprivate Base(string a, string b, bool c, int d, object e) {}\n\nprivate Base Usage(string notAConst)\n{\n  return new (notAConst, \"\"myConst\"\", true, 4, new object());\n}\n}\";\n        var context = CreateContext<CS.ImplicitObjectCreationExpressionSyntax>(testInput, AnalyzerLanguage.CSharp);\n        var tracker = new CSharpObjectCreationTracker();\n\n        tracker.ConstArgumentForParameter(context, \"a\").Should().BeNull();\n        tracker.ConstArgumentForParameter(context, \"b\").Should().Be(\"myConst\");\n        tracker.ConstArgumentForParameter(context, \"c\").Should().Be(true);\n        tracker.ConstArgumentForParameter(context, \"d\").Should().Be(4);\n        tracker.ConstArgumentForParameter(context, \"e\").Should().BeNull();\n        tracker.ConstArgumentForParameter(context, \"nonExistingParameterName\").Should().BeNull();\n    }\n#endif\n\n    [TestMethod]\n    public void ConstArgumentForParameter_VB()\n    {\n        const string testInput = @\"\nPublic Class Base\n    Sub New(ByVal a As String, b As String, ByVal c As Boolean, ByVal d As Integer, ByRef e As Integer, ByVal f As Object)\n    End Sub\n\n    Public Sub Usage(ByVal notAConst As String)\n        Dim tmp = New Base(notAConst, \"\"myConst\"\", True, 4, 5, New Object())\n    End Sub\nEnd Class\";\n        var context = CreateContext<VB.ObjectCreationExpressionSyntax>(testInput, AnalyzerLanguage.VisualBasic);\n        var tracker = new VisualBasicObjectCreationTracker();\n\n        tracker.ConstArgumentForParameter(context, \"a\").Should().BeNull();\n        tracker.ConstArgumentForParameter(context, \"b\").Should().Be(\"myConst\");\n        tracker.ConstArgumentForParameter(context, \"c\").Should().Be(true);\n        tracker.ConstArgumentForParameter(context, \"d\").Should().Be(4);\n        tracker.ConstArgumentForParameter(context, \"e\").Should().Be(5);\n        tracker.ConstArgumentForParameter(context, \"f\").Should().BeNull();\n        tracker.ConstArgumentForParameter(context, \"nonExistingParameterName\").Should().BeNull();\n    }\n\n    [TestMethod]\n    public void ObjectCreationConditionForUndefinedSymbol()\n    {\n        const string testInput = @\"\npublic class Base\n{\n    private void Usage(string notAConst)\n    {\n      new Undefined(true);\n    }\n}\";\n        var context = CreateContext<CS.ObjectCreationExpressionSyntax>(testInput, AnalyzerLanguage.CSharp);\n        var tracker = new CSharpObjectCreationTracker();\n        tracker.ArgumentAtIndexIs(0, KnownType.System_Boolean)(context).Should().BeFalse();\n        tracker.WhenDerivesFrom(KnownType.System_Exception)(context).Should().BeFalse();\n        tracker.WhenImplements(KnownType.System_IDisposable)(context).Should().BeFalse();\n        tracker.WhenDerivesOrImplementsAny(KnownType.System_Boolean)(context).Should().BeFalse();\n        tracker.MatchConstructor(KnownType.System_Boolean)(context).Should().BeFalse();\n        tracker.ArgumentAtIndexIsConst(0).Invoke(context).Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void ObjectCreationConditionForNonconstructorSymbols()\n    {\n        const string testInput = @\"\nusing System;\n\npublic class Base : Exception, IDisposable\n{\n    private void Method(bool b) { }\n    public void Dispose() { }\n\n    public void Usage()\n    {\n        Method(true);\n    }\n}\";\n        var context = CreateContext<CS.InvocationExpressionSyntax>(testInput, AnalyzerLanguage.CSharp);   // Created with wrong syntax\n        var tracker = new CSharpObjectCreationTracker();\n        tracker.ArgumentAtIndexIs(0, KnownType.System_Boolean)(context).Should().BeTrue();  // Doesn't care about symbol type\n        tracker.WhenDerivesFrom(KnownType.System_Exception)(context).Should().BeFalse();\n        tracker.WhenImplements(KnownType.System_IDisposable)(context).Should().BeFalse();\n        tracker.WhenDerivesOrImplementsAny(KnownType.System_Exception)(context).Should().BeFalse();\n        tracker.MatchConstructor(KnownType.System_Boolean)(context).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void ObjectCreationNoArgumentsSupplied()\n    {\n        const string testInput = @\"\npublic class Base\n{\n    public int Foo;\n    private void Usage()\n    {\n      new Base { Foo = 42 };\n    }\n}\";\n        var context = CreateContext<CS.ObjectCreationExpressionSyntax>(testInput, AnalyzerLanguage.CSharp);\n        var tracker = new CSharpObjectCreationTracker();\n        tracker.ArgumentAtIndexIsConst(0).Invoke(context).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void AndCondition()\n    {\n        var tracker = new CSharpObjectCreationTracker();\n        CSharpObjectCreationTracker.Condition trueCondition = x => true;\n        CSharpObjectCreationTracker.Condition falseCondition = x => false;\n\n        tracker.And(trueCondition, trueCondition)(null).Should().BeTrue();\n        tracker.And(trueCondition, falseCondition)(null).Should().BeFalse();\n        tracker.And(falseCondition, trueCondition)(null).Should().BeFalse();\n        tracker.And(falseCondition, falseCondition)(null).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void OrCondition()\n    {\n        var tracker = new CSharpObjectCreationTracker();\n        CSharpObjectCreationTracker.Condition trueCondition = x => true;\n        CSharpObjectCreationTracker.Condition falseCondition = x => false;\n\n        tracker.Or(trueCondition, trueCondition)(null).Should().BeTrue();\n        tracker.Or(trueCondition, falseCondition)(null).Should().BeTrue();\n        tracker.Or(falseCondition, trueCondition)(null).Should().BeTrue();\n        tracker.Or(falseCondition, falseCondition)(null).Should().BeFalse();\n\n        tracker.Or(falseCondition, falseCondition, trueCondition)(null).Should().BeTrue();\n        tracker.Or(falseCondition, falseCondition, falseCondition)(null).Should().BeFalse();\n    }\n\n    private static ObjectCreationContext CreateContext<TSyntaxNodeType>(string testInput, AnalyzerLanguage language) where TSyntaxNodeType : SyntaxNode\n    {\n        var testCode = new SnippetCompiler(testInput, true, language);\n        var node = testCode.Nodes<TSyntaxNodeType>().First();\n        var context = new ObjectCreationContext(testCode.CreateAnalysisContext(node));\n        return context;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Trackers/PropertyAccessTrackerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\nusing SonarAnalyzer.CSharp.Core.Trackers;\nusing SonarAnalyzer.VisualBasic.Core.Trackers;\nusing CS = Microsoft.CodeAnalysis.CSharp.Syntax;\nusing VB = Microsoft.CodeAnalysis.VisualBasic.Syntax;\n\nnamespace SonarAnalyzer.Test.Trackers;\n\n[TestClass]\npublic class PropertyAccessTrackerTest\n{\n    private const string TestInputCS = @\"\npublic class Base\n{\n    private int MyProperty {get; set;}\n\n    private void Usage()\n    {\n        var x = this.MyProperty;\n    }\n}\";\n\n    private const string TestInputVB = @\"\nPublic Class Base\n    Public Property MyProperty As Integer\n\n    Public Sub Usage()\n        Dim x As Integer = Me.MyProperty\n    End Sub\nEnd Class\";\n\n    [TestMethod]\n    public void MatchesGetter_CS()\n    {\n        var context = CreateContext<CS.MemberAccessExpressionSyntax>(TestInputCS, \"MyProperty\", AnalyzerLanguage.CSharp);\n        var tracker = new CSharpPropertyAccessTracker();\n\n        tracker.MatchGetter()(context).Should().BeTrue();\n        tracker.MatchSetter()(context).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void MatchesGetter_VB()\n    {\n        var context = CreateContext<VB.MemberAccessExpressionSyntax>(TestInputVB, \"MyProperty\", AnalyzerLanguage.VisualBasic);\n        var tracker = new VisualBasicPropertyAccessTracker();\n\n        tracker.MatchGetter()(context).Should().BeTrue();\n        tracker.MatchSetter()(context).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void AndCondition()\n    {\n        var tracker = new CSharpPropertyAccessTracker();\n        CSharpPropertyAccessTracker.Condition trueCondition = x => true;\n        CSharpPropertyAccessTracker.Condition falseCondition = x => false;\n\n        tracker.And(trueCondition, trueCondition)(null).Should().BeTrue();\n        tracker.And(trueCondition, falseCondition)(null).Should().BeFalse();\n        tracker.And(falseCondition, trueCondition)(null).Should().BeFalse();\n        tracker.And(falseCondition, falseCondition)(null).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void OrCondition()\n    {\n        var tracker = new CSharpPropertyAccessTracker();\n        CSharpPropertyAccessTracker.Condition trueCondition = x => true;\n        CSharpPropertyAccessTracker.Condition falseCondition = x => false;\n\n        tracker.Or(trueCondition, trueCondition)(null).Should().BeTrue();\n        tracker.Or(trueCondition, falseCondition)(null).Should().BeTrue();\n        tracker.Or(falseCondition, trueCondition)(null).Should().BeTrue();\n        tracker.Or(falseCondition, falseCondition)(null).Should().BeFalse();\n\n        tracker.Or(falseCondition, falseCondition, trueCondition)(null).Should().BeTrue();\n        tracker.Or(falseCondition, falseCondition, falseCondition)(null).Should().BeFalse();\n    }\n\n    private static PropertyAccessContext CreateContext<TSyntaxNodeType>(string testInput, string propertyName, AnalyzerLanguage language) where TSyntaxNodeType : SyntaxNode\n    {\n        var testCode = new SnippetCompiler(testInput, false, language);\n        var node = testCode.Nodes<TSyntaxNodeType>().First();\n        return new PropertyAccessContext(testCode.CreateAnalysisContext(node), propertyName);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Wrappers/INamedTypeSymbolExtensionsTests.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing SonarAnalyzer.CSharp.Core.Syntax.Extensions;\nusing StyleCop.Analyzers.Lightup;\nusing NullableAnnotation = SonarAnalyzer.ShimLayer.NullableAnnotation;\n\nnamespace SonarAnalyzer.Test.Wrappers;\n\n[TestClass]\npublic class INamedTypeSymbolExtensionsTests\n{\n    [TestMethod]\n    [DataRow(\"#nullable enable\", \"?\", NullableAnnotation.Annotated)]\n    [DataRow(\"#nullable enable\", \"\", NullableAnnotation.NotAnnotated)]\n    [DataRow(\"\", \"?\", NullableAnnotation.Annotated)]\n    [DataRow(\"\", \"\", NullableAnnotation.None)]\n    public void TypeArgumentNullableAnnotationsFromShimEqualsOriginal(string nullable, string questionMark, NullableAnnotation expected)\n    {\n        var code = $$\"\"\"\n            {{nullable}}\n            using System.Collections.Generic;\n            public class C\n            {\n                public void M()\n                {\n                    IEnumerable<object{{questionMark}}> o = new object[0];\n                    o.ToString();\n                }\n            }\n            \"\"\";\n        ValidateTypeArgumentNullableAnnotations(code, expected);\n    }\n\n    [TestMethod]\n    public void TypeArgumentNullableAnnotationsFromShimEqualsOriginal_MultipleTypeArguments()\n    {\n        var code = \"\"\"\n            #nullable enable\n            using System;\n            public class C\n            {\n                public void M()\n                {\n                    Func<object, object?, object?, object, object?> o = null;\n                    o.ToString();\n                }\n            }\n            \"\"\";\n        ValidateTypeArgumentNullableAnnotations(code,\n            NullableAnnotation.NotAnnotated, NullableAnnotation.Annotated, NullableAnnotation.Annotated, NullableAnnotation.NotAnnotated, NullableAnnotation.Annotated);\n    }\n\n    [TestMethod]\n    public void TypeArgumentNullableAnnotationsFromShimEqualsOriginal_NoTypeArguments()\n    {\n        var code = \"\"\"\n            #nullable enable\n            using System;\n            public class C\n            {\n                public void M()\n                {\n                    object? o = null;\n                    o.ToString();\n                }\n            }\n            \"\"\";\n        ValidateTypeArgumentNullableAnnotations(code);\n    }\n\n    private static void ValidateTypeArgumentNullableAnnotations(string code, params NullableAnnotation[] expected)\n    {\n        var (tree, semanticModel) = TestCompiler.CompileCS(code);\n        var identifier = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Last(x => x.NameIs(\"o\")); // o in o.ToString()\n        var namedType = semanticModel.GetTypeInfo(identifier).Type.Should().BeAssignableTo<INamedTypeSymbol>().Which;\n        var typeArgumentNullabilityShim = namedType.TypeArgumentNullableAnnotations();\n        var typeArgumentNullability = namedType.TypeArgumentNullableAnnotations;\n        typeArgumentNullabilityShim.Should().BeEquivalentTo(expected).And.BeEquivalentTo(typeArgumentNullability.Select(x => (NullableAnnotation)x));\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Wrappers/IOperationWrapperSonarTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing StyleCop.Analyzers.Lightup;\n\nnamespace SonarAnalyzer.Test.Wrappers;\n\n[TestClass]\npublic class IOperationWrapperSonarTest\n{\n    [TestMethod]\n    public void Null_Throws()\n    {\n        Action a = () => new IOperationWrapperSonar(null).ToString();\n        a.Should().Throw<ArgumentNullException>();\n    }\n\n    [TestMethod]\n    public void ValidateReflection()\n    {\n        var sut = CreateWrapper(out var semanticModel);\n        sut.Parent.Should().NotBeNull();\n        sut.Parent.Kind.Should().Be(OperationKind.VariableDeclarator);\n        sut.Instance.Should().NotBeNull();\n        sut.Instance.Kind.Should().Be(OperationKind.VariableInitializer);\n        sut.Children.Should().HaveCount(1);\n        sut.Children.Single().Kind.Should().Be(OperationKind.Literal);\n        sut.Language.Should().Be(\"C#\");\n        sut.IsImplicit.Should().Be(false);\n        sut.SemanticModel.Should().Be(semanticModel);\n    }\n\n    [TestMethod]\n    public void GetHashCode_ReturnsOperationHash()\n    {\n        var sut = CreateWrapper(out _);\n        sut.GetHashCode().Should().Be(sut.Instance.GetHashCode());\n    }\n\n    [TestMethod]\n    public void Equals_ComparesUnderlyingInstance()\n    {\n        var sut = CreateWrapper(out _);\n        var other = new IOperationWrapperSonar(sut.Instance);\n        sut.Equals(other).Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void Equals_NotEqual()\n    {\n        var sut = CreateWrapper(out _);\n        sut.Parent.Should().NotBeNull();\n\n        sut.Equals(null).Should().BeFalse();\n        sut.Equals(\"Other type\").Should().BeFalse();\n        sut.Equals(sut.Parent).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void ToString_ReturnsInstanceToString()\n    {\n        var sut = CreateWrapper(out _);\n        sut.ToString().Should().Be(sut.Instance.ToString());\n    }\n\n    private static IOperationWrapperSonar CreateWrapper(out SemanticModel semanticModel)\n    {\n        const string code = @\"\npublic class Sample\n{\n    public void Method()\n    {\n        var value = 42;\n    }\n}\";\n        var (tree, model) = TestCompiler.CompileCS(code);\n        var declaration = tree.Single<EqualsValueClauseSyntax>();\n        semanticModel = model;\n        return new IOperationWrapperSonar(model.GetOperation(declaration));\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Wrappers/IPropertySymbolExtensionTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing StyleCop.Analyzers.Lightup;\n\nnamespace SonarAnalyzer.Test.Wrappers;\n\n[TestClass]\npublic class IPropertySymbolExtensionTest\n{\n    [TestMethod]\n    [DataRow(\"required\")]\n    [DataRow(\"\")]\n    public void IsRequired(string required)\n    {\n        var net48Attributes = // Compiler attributes to simulate \"this compiler/framework combination supports required members\"\n#if NETFRAMEWORK\n            $$\"\"\"\n            namespace System.Runtime.CompilerServices;\n            public class RequiredMemberAttribute : Attribute { }\n            public class CompilerFeatureRequiredAttribute(string featureName) : Attribute { }\n            \"\"\";\n#else\n            string.Empty;\n#endif\n        var code = $$\"\"\"\n            {{net48Attributes}}\n            public class Test\n            {\n                public {{required}} int Prop { get; set; }\n            }\n            \"\"\";\n        var (tree, model) = TestCompiler.CompileCS(code);\n        var propertyDeclaration = tree.GetRoot().DescendantNodes().OfType<PropertyDeclarationSyntax>().Single();\n        var propertySymbol = model.GetDeclaredSymbol(propertyDeclaration).Should().BeAssignableTo<IPropertySymbol>().Subject;\n        propertySymbol.IsRequired().Should().Be(propertySymbol.IsRequired);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Wrappers/ISymbolNullableExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing StyleCop.Analyzers.Lightup;\nusing NullableAnnotation = SonarAnalyzer.ShimLayer.NullableAnnotation;\n\nnamespace SonarAnalyzer.Test.Wrappers;\n\n[TestClass]\npublic class ISymbolNullableExtensionsTest\n{\n    [TestMethod]\n    [DataRow(true)]\n    [DataRow(false)]\n    public void NullableAnnotation_SimpleAnnitations(bool nullable)\n    {\n        var nullableAnnotation = nullable ? \"?\" : string.Empty;\n        var (tree, model) = TestCompiler.CompileCS($$\"\"\"\n            #nullable enable\n            using System;\n            class C\n            {\n                object{{nullableAnnotation}} ObjectField;\n                object{{nullableAnnotation}}[] ArrayField;\n                object{{nullableAnnotation}} Property { get; set; }\n                event EventHandler{{nullableAnnotation}} MyEvent;\n\n                object{{nullableAnnotation}} Method(object{{nullableAnnotation}} parameter)\n                {\n                    object{{nullableAnnotation}} local;\n                    return null;\n                }\n            }\n            \"\"\");\n        var expected = nullable ? NullableAnnotation.Annotated : NullableAnnotation.NotAnnotated;\n\n        GetSymbol<IFieldSymbol>(\"ObjectField\").NullableAnnotation().Should().Be(expected);\n        GetSymbol<IPropertySymbol>(\"Property\").NullableAnnotation().Should().Be(expected);\n        GetSymbol<IEventSymbol>(\"MyEvent\").NullableAnnotation().Should().Be(expected);\n        GetSymbol<IParameterSymbol>(\"parameter\").NullableAnnotation().Should().Be(expected);\n        GetSymbol<ILocalSymbol>(\"local\").NullableAnnotation().Should().Be(expected);\n        GetSymbol<IFieldSymbol>(\"ArrayField\").Type.Should().BeAssignableTo<IArrayTypeSymbol>().Which.ElementNullableAnnotation().Should().Be(expected);\n        GetSymbol<IMethodSymbol>(\"Method\").ReturnNullableAnnotation().Should().Be(expected);\n\n        T GetSymbol<T>(string name) where T : ISymbol\n        {\n            var node = tree.GetRoot().DescendantTokens().Single(x => x.ValueText == name).Parent;\n            node.Should().NotBeNull();\n            return model.GetDeclaredSymbol(node).Should().BeAssignableTo<T>().Which;\n        }\n    }\n\n    [TestMethod]\n    [DataRow(true)]\n    [DataRow(false)]\n    public void NullableAnnotation_Receiver(bool nullable)\n    {\n        var nullableAnnotation = nullable ? \"?\" : string.Empty;\n        var (tree, model) = TestCompiler.CompileCS($$\"\"\"\n        #nullable enable\n        using System;\n        static class C\n        {\n            static object ExtensionMethod(this object{{nullableAnnotation}} receiver)\n            {\n                return receiver.ExtensionMethod();\n            }\n        }\n        \"\"\");\n        var invocation = tree.GetRoot().DescendantNodesAndSelf().OfType<InvocationExpressionSyntax>().First();\n        var symbol = model.GetSymbolInfo(invocation).Symbol.Should().BeAssignableTo<IMethodSymbol>().Which;\n\n        var expected = nullable ? NullableAnnotation.Annotated : NullableAnnotation.NotAnnotated;\n        symbol.ReceiverNullableAnnotation().Should().Be(expected);\n    }\n\n    [TestMethod]\n    [DataRow(true)]\n    [DataRow(false)]\n    public void NullableAnnotation_ReferenceTypeConstrain(bool nullable)\n    {\n        var nullableAnnotation = nullable ? \"?\" : string.Empty;\n        var (tree, model) = TestCompiler.CompileCS($$\"\"\"\n        #nullable enable\n        using System;\n        class C<T> where T: class\n        {\n            T{{nullableAnnotation}} field;\n        }\n        \"\"\");\n        var fieldDeclaration = tree.GetRoot().DescendantNodesAndSelf().OfType<FieldDeclarationSyntax>().First();\n        var symbol = model.GetDeclaredSymbol(fieldDeclaration.Declaration.Variables[0]).Should().BeAssignableTo<IFieldSymbol>().Which.Type.Should().BeAssignableTo<ITypeParameterSymbol>().Which;\n\n        var expected = nullable ? NullableAnnotation.Annotated : NullableAnnotation.NotAnnotated;\n        symbol.NullableAnnotation().Should().Be(expected);\n        symbol.ReferenceTypeConstraintNullableAnnotation().Should().Be(NullableAnnotation.NotAnnotated);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Wrappers/RegisterSymbolStartActionWrapperTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.ShimLayer.AnalysisContext;\nusing CS = Microsoft.CodeAnalysis.CSharp;\nusing VB = Microsoft.CodeAnalysis.VisualBasic;\n\nnamespace SonarAnalyzer.Test.Wrappers;\n\n[TestClass]\npublic class RegisterSymbolStartActionWrapperTest\n{\n    [TestMethod]\n    public async Task RegisterSymbolStartAction_SymbolStartProperties()\n    {\n        var snippet = new SnippetCompiler(\"\"\"\n            public class C\n            {\n                int i = 0;\n                public void M() => ToString();\n            }\n            \"\"\");\n        var symbolStartWasCalled = false;\n        var compilation = snippet.Compilation.WithAnalyzers([new TestDiagnosticAnalyzer(symbolStart =>\n            {\n                symbolStart.CancellationToken.IsCancellationRequested.Should().BeFalse();\n                symbolStart.Compilation.SyntaxTrees.Should().ContainSingle();\n                symbolStart.Options.Should().NotBeNull();\n                symbolStart.Symbol.Should().BeAssignableTo<INamedTypeSymbol>().Which.Name.Should().Be(\"C\");\n                symbolStartWasCalled = true;\n            }, SymbolKind.NamedType)]);\n        var diagnostics = await compilation.GetAnalyzerDiagnosticsAsync();\n        symbolStartWasCalled.Should().BeTrue();\n        diagnostics.Should().BeEmpty();\n    }\n\n    [TestMethod]\n    public async Task RegisterSymbolStartAction_RegisterCodeBlockAction()\n    {\n        var snippet = new SnippetCompiler(\"\"\"\n            public class C\n            {\n                int i = 0;\n                public void M() => ToString();\n            }\n            \"\"\");\n        var visitedCodeBlocks = new List<string>();\n        var compilation = snippet.Compilation.WithAnalyzers([new TestDiagnosticAnalyzer(symbolStart =>\n            {\n                symbolStart.RegisterCodeBlockAction(block =>\n                {\n                    var node = block.CodeBlock.ToString();\n                    visitedCodeBlocks.Add(node);\n                });\n            }, SymbolKind.NamedType)]);\n        var diagnostics = await compilation.GetAnalyzerDiagnosticsAsync();\n        diagnostics.Should().BeEmpty();\n        visitedCodeBlocks.Should().BeEquivalentTo(\"int i = 0;\", \"public void M() => ToString();\");\n    }\n\n    [TestMethod]\n    public async Task RegisterSymbolStartAction_RegisterCodeBlockAction_ConditionalRegistration()\n    {\n        var snippet = new SnippetCompiler(\"\"\"\n            public class C\n            {\n                int i = 0;\n                public void M() => ToString();\n            }\n            public class D\n            {\n                int j = 0;\n                public void N() => ToString();\n            }\n            \"\"\");\n        var visitedCodeBlocks = new List<string>();\n        var compilation = snippet.Compilation.WithAnalyzers([new TestDiagnosticAnalyzer(symbolStart =>\n            {\n                if (symbolStart.Symbol.Name == \"C\")\n                {\n                    return;\n                }\n\n                symbolStart.RegisterCodeBlockAction(block =>\n                {\n                    var node = block.CodeBlock.ToString();\n                    visitedCodeBlocks.Add(node);\n                });\n            }, SymbolKind.NamedType)]);\n        var diagnostics = await compilation.GetAnalyzerDiagnosticsAsync();\n        diagnostics.Should().BeEmpty();\n        visitedCodeBlocks.Should().BeEquivalentTo(\"int j = 0;\", \"public void N() => ToString();\");\n    }\n\n    [TestMethod]\n    public async Task RegisterSymbolStartAction_RegisterCodeBlockStartAction_CS()\n    {\n        var snippet = new SnippetCompiler(\"\"\"\n            public class C\n            {\n                int i = 0;\n                public void M() => ToString();\n            }\n            \"\"\");\n        var visited = new List<string>();\n        var compilation = snippet.Compilation.WithAnalyzers([new TestDiagnosticAnalyzer(symbolStart =>\n            {\n                symbolStart.RegisterCodeBlockStartAction<CS.SyntaxKind>(blockStart =>\n                {\n                    var node = blockStart.CodeBlock.ToString();\n                    visited.Add(node);\n                    blockStart.RegisterSyntaxNodeAction(nodeContext => visited.Add(nodeContext.Node.ToString()), CS.SyntaxKind.InvocationExpression);\n                });\n            }, SymbolKind.NamedType)]);\n        var diagnostics = await compilation.GetAnalyzerDiagnosticsAsync();\n        diagnostics.Should().BeEmpty();\n        visited.Should().BeEquivalentTo(\"int i = 0;\", \"public void M() => ToString();\", \"ToString()\");\n    }\n\n    [TestMethod]\n    public async Task RegisterSymbolStartAction_RegisterCodeBlockStartAction_VB()\n    {\n        var snippet = new SnippetCompiler(\"\"\"\n            Public Class C\n                Private i As Integer = 0\n\n                Public Sub M()\n                    Call ToString()\n                End Sub\n            End Class\n            \"\"\", ignoreErrors: false, AnalyzerLanguage.VisualBasic);\n        var visited = new List<string>();\n        var compilation = snippet.Compilation.WithAnalyzers([new TestDiagnosticAnalyzer(symbolStart =>\n            {\n                symbolStart.RegisterCodeBlockStartAction<VB.SyntaxKind>(blockStart =>\n                {\n                    var node = blockStart.CodeBlock.ToString();\n                    visited.Add(node);\n                    blockStart.RegisterSyntaxNodeAction(nodeContext => visited.Add(nodeContext.Node.ToString()), VB.SyntaxKind.InvocationExpression);\n                });\n            }, SymbolKind.NamedType)]);\n        var diagnostics = await compilation.GetAnalyzerDiagnosticsAsync();\n        diagnostics.Should().BeEmpty();\n        visited.Should().BeEquivalentTo([\n            \"Private i As Integer = 0\",\n            \"\"\"\n            Public Sub M()\n                    Call ToString()\n                End Sub\n            \"\"\",\n            \"ToString()\"]);\n    }\n\n    [TestMethod]\n    public async Task RegisterSymbolStartAction_RegisterOperationAction()\n    {\n        var snippet = new SnippetCompiler(\"\"\"\n            public class C\n            {\n                int i = 0;\n                public void M()\n                {\n                    ToString();\n                }\n            }\n            \"\"\");\n        var visited = new List<string>();\n        var compilation = snippet.Compilation.WithAnalyzers([new TestDiagnosticAnalyzer(symbolStart =>\n            {\n                symbolStart.RegisterOperationAction(operationContext =>\n                {\n                    var operation = operationContext.Operation.Syntax.ToString();\n                    visited.Add(operation);\n                }, [OperationKind.Invocation]);\n            }, SymbolKind.NamedType)]);\n        var diagnostics = await compilation.GetAnalyzerDiagnosticsAsync();\n        diagnostics.Should().BeEmpty();\n        visited.Should().BeEquivalentTo(\"ToString()\");\n    }\n\n    [TestMethod]\n    public async Task RegisterSymbolStartAction_RegisterOperationBlockAction()\n    {\n        var snippet = new SnippetCompiler(\"\"\"\n            public class C\n            {\n                int i = 0;\n                public void M() => ToString();\n            }\n            \"\"\");\n        var visited = new List<string>();\n        var compilation = snippet.Compilation.WithAnalyzers([new TestDiagnosticAnalyzer(symbolStart =>\n            {\n                symbolStart.RegisterOperationBlockAction(operationBlockContext =>\n                {\n                    var operation = operationBlockContext.OperationBlocks.First().Syntax.ToString();\n                    visited.Add(operation);\n                });\n            }, SymbolKind.NamedType)]);\n        var diagnostics = await compilation.GetAnalyzerDiagnosticsAsync();\n        diagnostics.Should().BeEmpty();\n        visited.Should().BeEquivalentTo(\"= 0\", \"=> ToString()\");\n    }\n\n    [TestMethod]\n    public async Task RegisterSymbolStartAction_RegisterOperationBlockStartAction()\n    {\n        var snippet = new SnippetCompiler(\"\"\"\n            public class C\n            {\n                int i = 0;\n                public void M() => ToString();\n            }\n            \"\"\");\n        var visited = new List<string>();\n        var compilation = snippet.Compilation.WithAnalyzers([new TestDiagnosticAnalyzer(symbolStart =>\n            {\n                symbolStart.RegisterOperationBlockStartAction(operationBlockStartContext =>\n                {\n                    var operation = operationBlockStartContext.OperationBlocks.First().Syntax.ToString();\n                    visited.Add(operation);\n                    operationBlockStartContext.RegisterOperationAction(operationContext => visited.Add(operationContext.Operation.Syntax.ToString()), OperationKind.Invocation);\n                });\n            }, SymbolKind.NamedType)]);\n        var diagnostics = await compilation.GetAnalyzerDiagnosticsAsync();\n        diagnostics.Should().BeEmpty();\n        visited.Should().BeEquivalentTo(\"= 0\", \"=> ToString()\", \"ToString()\");\n    }\n\n    [TestMethod]\n    public async Task RegisterSymbolStartAction_RegisterRegisterSymbolEndAction()\n    {\n        var snippet = new SnippetCompiler(\"\"\"\n            public class C\n            {\n                int i = 0;\n                public void M() => ToString();\n            }\n            \"\"\");\n        var visited = new List<string>();\n        var compilation = snippet.Compilation.WithAnalyzers([new TestDiagnosticAnalyzer(symbolStart =>\n            {\n                symbolStart.RegisterSymbolEndAction(symbolContext =>\n                {\n                    var symbolName = symbolContext.Symbol.Name;\n                    visited.Add(symbolName);\n                });\n            }, SymbolKind.NamedType)]);\n        var diagnostics = await compilation.GetAnalyzerDiagnosticsAsync();\n        diagnostics.Should().BeEmpty();\n        visited.Should().BeEquivalentTo(\"C\");\n    }\n\n    [TestMethod]\n    public async Task RegisterSymbolStartAction_RegisterSyntaxNodeAction_CS()\n    {\n        var snippet = new SnippetCompiler(\"\"\"\n            public class C\n            {\n                int i = 0;\n                public void M() => ToString();\n            }\n            \"\"\");\n        var visited = new List<string>();\n        var compilation = snippet.Compilation.WithAnalyzers([new TestDiagnosticAnalyzer(symbolStart =>\n            {\n                symbolStart.RegisterSyntaxNodeAction(syntaxNodeContext =>\n                {\n                    var nodeName = syntaxNodeContext.Node.ToString();\n                    visited.Add(nodeName);\n                }, CS.SyntaxKind.InvocationExpression, CS.SyntaxKind.EqualsValueClause);\n            }, SymbolKind.NamedType)]);\n        var diagnostics = await compilation.GetAnalyzerDiagnosticsAsync();\n        diagnostics.Should().BeEmpty();\n        visited.Should().BeEquivalentTo(\"= 0\", \"ToString()\");\n    }\n\n    [TestMethod]\n    public async Task RegisterSymbolStartAction_RegisterSyntaxNodeAction_VB()\n    {\n        var snippet = new SnippetCompiler(\"\"\"\n            Public Class C\n                Private i As Integer = 0\n\n                Public Sub M()\n                    Call ToString()\n                End Sub\n            End Class\n            \"\"\", ignoreErrors: false, AnalyzerLanguage.VisualBasic);\n        var visited = new List<string>();\n        var compilation = snippet.Compilation.WithAnalyzers([new TestDiagnosticAnalyzer(symbolStart =>\n            {\n                symbolStart.RegisterSyntaxNodeAction(syntaxNodeContext =>\n                {\n                    var nodeName = syntaxNodeContext.Node.ToString();\n                    visited.Add(nodeName);\n                }, VB.SyntaxKind.InvocationExpression);\n            }, SymbolKind.NamedType)]);\n        var diagnostics = await compilation.GetAnalyzerDiagnosticsAsync();\n        diagnostics.Should().BeEmpty();\n        visited.Should().BeEquivalentTo(\"ToString()\");\n    }\n\n#pragma warning disable RS1001 // Missing diagnostic analyzer attribute\n#pragma warning disable RS1025 // Configure generated code analysis\n#pragma warning disable RS1026 // Enable concurrent execution\n    private sealed class TestDiagnosticAnalyzer : DiagnosticAnalyzer\n    {\n        public Action<SymbolStartAnalysisContextWrapper> Action { get; }\n        public SymbolKind SymbolKind { get; }\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics =>\n            [AnalysisScaffolding.CreateDescriptor(\"TEST\")];\n\n        public TestDiagnosticAnalyzer(Action<SymbolStartAnalysisContextWrapper> action, SymbolKind symbolKind)\n        {\n            Action = action;\n            SymbolKind = symbolKind;\n        }\n\n        public override void Initialize(Microsoft.CodeAnalysis.Diagnostics.AnalysisContext context) =>\n            context.RegisterCompilationStartAction(x =>\n                CompilationStartAnalysisContextExtensions.RegisterSymbolStartAction(x, Action, SymbolKind));\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/Wrappers/TypeInfoExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing SonarAnalyzer.CSharp.Core.Syntax.Extensions;\nusing StyleCop.Analyzers.Lightup;\nusing NullabilityInfo = StyleCop.Analyzers.Lightup.NullabilityInfo;\nusing NullableAnnotation = SonarAnalyzer.ShimLayer.NullableAnnotation;\nusing NullableFlowState = SonarAnalyzer.ShimLayer.NullableFlowState;\n\nnamespace SonarAnalyzer.Test.Wrappers;\n\n[TestClass]\npublic class TypeInfoExtensionsTest\n{\n    [TestMethod]\n    public void NullabilityInfoFromShimEqualsOriginal()\n    {\n        var code = @\"\n#nullable enable\npublic class C\n{\n    public void M()\n    {\n        object? o = null;\n        o.ToString();\n    }\n}\n\";\n        var (tree, semanticModel) = TestCompiler.CompileCS(code);\n        var identifier = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Last(x => x.NameIs(\"o\")); // o in o.ToString()\n        var typeInfo = semanticModel.GetTypeInfo(identifier);\n\n        var nullabilityShim = typeInfo.Nullability();\n        nullabilityShim.Should().Be(new NullabilityInfo(NullableAnnotation.Annotated, NullableFlowState.MaybeNull))\n            .And.BeEquivalentTo(new\n            {\n                typeInfo.Nullability.Annotation,\n                typeInfo.Nullability.FlowState\n            }, options => options.ComparingEnumsByValue());\n\n        var convertedNullability = typeInfo.ConvertedNullability();\n        convertedNullability.Should().Be(new NullabilityInfo(NullableAnnotation.Annotated, NullableFlowState.MaybeNull))\n            .And.BeEquivalentTo(new\n            {\n                typeInfo.ConvertedNullability.Annotation,\n                typeInfo.ConvertedNullability.FlowState\n            }, options => options.ComparingEnumsByValue());\n    }\n\n    [TestMethod]\n    public void NullabilityInfoFromShimEqualsOriginalConvertedNullabilityDiffersNullability()\n    {\n        var code = @\"\n#nullable enable\n\npublic class B { }\n\npublic class C {\n    public void M() {\n        C c = new C();\n        M(c);\n    }\n\n    public void M(B? b) { }\n\n    public static implicit operator B?(C c) => null;\n}\";\n        var (tree, semanticModel) = TestCompiler.CompileCS(code);\n        var identifier = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Last(x => x.NameIs(\"c\")); // c in M(c)\n        var typeInfo = semanticModel.GetTypeInfo(identifier);\n\n        var nullabilityShim = typeInfo.Nullability();\n        nullabilityShim.Should().Be(new NullabilityInfo(NullableAnnotation.NotAnnotated, NullableFlowState.NotNull))\n            .And.BeEquivalentTo(new\n            {\n                typeInfo.Nullability.Annotation,\n                typeInfo.Nullability.FlowState\n            }, options => options.ComparingEnumsByValue());\n\n        var convertedNullability = typeInfo.ConvertedNullability();\n        convertedNullability.Should().Be(new NullabilityInfo(NullableAnnotation.Annotated, NullableFlowState.MaybeNull))\n            .And.BeEquivalentTo(new\n            {\n                typeInfo.ConvertedNullability.Annotation,\n                typeInfo.ConvertedNullability.FlowState\n            }, options => options.ComparingEnumsByValue());\n    }\n\n    [TestMethod]\n    public void NullabilityInfoIsMissingIfNullableDisabled()\n    {\n        var code = @\"\n#nullable disable\npublic class C\n{\n    public void M()\n    {\n        object? o = null;\n        o.ToString();\n    }\n}\n\";\n        var (tree, semanticModel) = TestCompiler.CompileCS(code);\n        var identifier = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Last(x => x.NameIs(\"o\")); // o in o.ToString()\n        var typeInfo = semanticModel.GetTypeInfo(identifier);\n        typeInfo.Nullability().Should().Be(new NullabilityInfo(NullableAnnotation.None, NullableFlowState.None));\n        typeInfo.ConvertedNullability().Should().Be(new NullabilityInfo(NullableAnnotation.None, NullableFlowState.None));\n    }\n\n    [TestMethod]\n    [DataRow(\"Debug.Assert(o != null);\")]\n    [DataRow(\"Debug.Fail(string.Empty);\")]\n    public void NullabilityInfoRecognizesDebug(string debug)\n    {\n        var code = $@\"\n#nullable enable\nusing System.Diagnostics;\npublic class C\n{{\n    public void M()\n    {{\n        object? o = null;\n        {debug}\n        o.ToString();\n    }}\n}}\n\";\n        var (tree, semanticModel) = TestCompiler.CompileCS(code);\n        var identifier = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Last(x => x.NameIs(\"o\")); // o in o.ToString()\n        var typeInfo = semanticModel.GetTypeInfo(identifier);\n        var expected =\n#if NET\n            new NullabilityInfo(NullableAnnotation.NotAnnotated, NullableFlowState.NotNull);\n#else\n            new NullabilityInfo(NullableAnnotation.Annotated, NullableFlowState.MaybeNull);\n#endif\n        typeInfo.Nullability().Should().Be(expected);\n        typeInfo.ConvertedNullability().Should().Be(expected);\n    }\n\n    [TestMethod]\n    [DataRow(typeof(NullableAnnotation), typeof(Microsoft.CodeAnalysis.NullableAnnotation))]\n    [DataRow(typeof(NullableFlowState), typeof(Microsoft.CodeAnalysis.NullableFlowState))]\n    public void NullableEnumsAreIdentical(Type fromShim, Type fromRoslyn)\n    {\n        fromShim.GetEnumNames().Should().Equal(fromRoslyn.GetEnumNames());\n        var enumValues = fromShim.GetEnumValues().Cast<byte>();\n        enumValues.Should().SatisfyRespectively(enumValues.Select(x => new Action<byte>(y => fromShim.GetEnumName(y).Should().Be(fromRoslyn.GetEnumName(y)))),\n            \"the member values should be assigned to the same member names\");\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.Test/packages.lock.json",
    "content": "{\n  \"version\": 1,\n  \"dependencies\": {\n    \".NETFramework,Version=v4.8\": {\n      \"altcover\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[9.0.102, )\",\n        \"resolved\": \"9.0.102\",\n        \"contentHash\": \"q3Rf5t0M9kXlcO5qhsaAe6NrFSNd5enrhKmF/Ezgmomqw34PbUTbRSYjSDNhS3YGDyUrPTkyPn14EfLDJWztcA==\"\n      },\n      \"Combinatorial.MSTest\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[2.0.0, )\",\n        \"resolved\": \"2.0.0\",\n        \"contentHash\": \"9tB2TMPkuEkYYUq64WREHMMyPt9NfKAyuitpK9yw3zbVe6v/vYkClZTR02+yKFUG+g8XHi5LMTt8jHz4RufGqw==\",\n        \"dependencies\": {\n          \"MSTest.TestFramework\": \"4.0.1\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[3.3.1, )\",\n        \"resolved\": \"3.3.1\",\n        \"contentHash\": \"eT+kgNCDdTRbQ5WF6BGx1HI3D5jYfHteza/koefhWC2vNZGxObA74XxwWfg40dy3uUv7dn3OGKLK5GUPLroVog==\"\n      },\n      \"Microsoft.NET.Test.Sdk\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[18.4.0, )\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"w49iZdL4HL6V25l41NVQLXWQ+e71GvSkKVteMrOL02gP/PUkcnO/1yEb2s9FntU4wGmJWfKnyrRAhcMHd9ZZNA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeCoverage\": \"18.4.0\"\n        }\n      },\n      \"Microsoft.NETFramework.ReferenceAssemblies\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.0.3, )\",\n        \"resolved\": \"1.0.3\",\n        \"contentHash\": \"vUc9Npcs14QsyOD01tnv/m8sQUnGTGOw1BCmKcv77LBJY7OxhJ+zJF7UD/sCL3lYNFuqmQEVlkfS4Quif6FyYg==\",\n        \"dependencies\": {\n          \"Microsoft.NETFramework.ReferenceAssemblies.net48\": \"1.0.3\"\n        }\n      },\n      \"MSTest.TestAdapter\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[4.2.1, )\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"lZRgNzaQnffK4XLjM/og4Eoqp/3IkpcyJQQcyKXkPdkzCT3+ghpwHa9zG1xYhQDbUFoc54M+/waLwh31K9stDQ==\",\n        \"dependencies\": {\n          \"MSTest.TestFramework\": \"4.2.1\",\n          \"Microsoft.Testing.Extensions.VSTestBridge\": \"2.2.1\",\n          \"Microsoft.Testing.Platform.MSBuild\": \"2.2.1\",\n          \"System.Threading.Tasks.Extensions\": \"4.5.4\"\n        }\n      },\n      \"MSTest.TestFramework\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[4.2.1, )\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"I4/RbS2TpGZ56CE98+jPbrGlcerYtw2LvPVKzQGvyQQcJDekPy2Kd+fnThXYn+geJ1sW+vA9B7++rFNxvKcWxA==\",\n        \"dependencies\": {\n          \"MSTest.Analyzers\": \"4.2.1\"\n        }\n      },\n      \"NSubstitute\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[5.3.0, )\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"lJ47Cps5Qzr86N99lcwd+OUvQma7+fBgr8+Mn+aOC0WrlqMNkdivaYD9IvnZ5Mqo6Ky3LS7ZI+tUq1/s9ERd0Q==\",\n        \"dependencies\": {\n          \"Castle.Core\": \"5.1.1\",\n          \"System.Threading.Tasks.Extensions\": \"4.3.0\"\n        }\n      },\n      \"SonarAnalyzer.CSharp.Styling\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[10.21.0.135717, )\",\n        \"resolved\": \"10.21.0.135717\",\n        \"contentHash\": \"hl264jF539oB7m2jED5QGM345eFSiDAdoJc8TH0HM6L7ZeqT5TDqZDQeZ8IDP02dVIpH/Fhhn+HsGfEcj8ohyQ==\"\n      },\n      \"StyleCop.Analyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.2.0-beta.556, )\",\n        \"resolved\": \"1.2.0-beta.556\",\n        \"contentHash\": \"llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==\",\n        \"dependencies\": {\n          \"StyleCop.Analyzers.Unstable\": \"1.2.0.556\"\n        }\n      },\n      \"Castle.Core\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.1.1\",\n        \"contentHash\": \"rpYtIczkzGpf+EkZgDr9CClTdemhsrwA/W5hMoPjLkRFnXzH44zDLoovXeKtmxb1ykXK9aJVODSpiJml8CTw2g==\"\n      },\n      \"FluentAssertions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.2.1\",\n        \"contentHash\": \"MilqBF2lZrT0V1azIA6DG6I/snS0rG3A8ohT2Jjkhq6zOFk76nqx4BPnEnzrX6jFVa6xvkDU++z3PebCGZyJ4g==\",\n        \"dependencies\": {\n          \"System.Threading.Tasks.Extensions\": \"4.5.4\"\n        }\n      },\n      \"FluentAssertions.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"0.34.1\",\n        \"contentHash\": \"2BnAAB8CCPdRA9P1+lAvBZOleR2BTmsxGMtGt+LnABJUARGqoGMWEFxG3znZYqHVIrMP0Za/kyw6atyt8x2mzA==\"\n      },\n      \"Google.Protobuf\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"3.6.1\",\n        \"contentHash\": \"741fGeDQjixBJaU2j+0CbrmZXsNJkTn/hWbOh4fLVXndHsCclJmWznCPWrJmPoZKvajBvAz3e8ECJOUvRtwjNQ==\"\n      },\n      \"Humanizer.Core\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.14.1\",\n        \"contentHash\": \"lQKvtaTDOXnoVJ20ibTuSIOf2i0uO0MPbDhd1jm238I+U/2ZnRENj0cktKZhtchBMtCUSRQ5v4xBCUbKNmyVMw==\"\n      },\n      \"Microsoft.ApplicationInsights\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.23.0\",\n        \"contentHash\": \"nWArUZTdU7iqZLycLKWe0TDms48KKGE6pONH2terYNa8REXiqixrMOkf1sk5DHGMaUTqONU2YkS4SAXBhLStgw==\",\n        \"dependencies\": {\n          \"System.Diagnostics.DiagnosticSource\": \"5.0.0\"\n        }\n      },\n      \"Microsoft.Bcl.AsyncInterfaces\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"owmu2Cr3IQ8yQiBleBHlGk8dSQ12oaF2e7TpzwJKEl4m84kkZJjEY1n33L67Y3zM5jPOjmmbdHjbfiL0RqcMRQ==\",\n        \"dependencies\": {\n          \"System.Threading.Tasks.Extensions\": \"4.5.4\"\n        }\n      },\n      \"Microsoft.Build.Framework\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.0.2\",\n        \"contentHash\": \"sOSb+0J4G/jCBW/YqmRuL0eOMXgfw1KQLdC9TkbvfA5xs7uNm+PBQXJCOzSJGXtZcZrtXozcwxPmUiRUbmd7FA==\",\n        \"dependencies\": {\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Diagnostics.DiagnosticSource\": \"9.0.0\",\n          \"System.Memory\": \"4.6.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\",\n          \"System.Text.Json\": \"9.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.6.0\"\n        }\n      },\n      \"Microsoft.Build.Locator\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.11.2\",\n        \"contentHash\": \"tY+/S54G29CGsbL3slVu4vqtpciwVnb3fKOmrhgzEQmu/VziFaWmD/E1e/2KH7cDucuycGSkWsSXndBs5Uawow==\"\n      },\n      \"Microsoft.CodeAnalysis.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0-2.25625.1\",\n        \"contentHash\": \"4Yhh2fnu3G+J0J1lDc8WZVgMjgbynSeTfkl5IFJMFrmiIO0sc7Tjx+f3sFVV8Sd35PrIUWfof0RWc3lAMl7Azg==\"\n      },\n      \"Microsoft.CodeAnalysis.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"uC0qk3jzTQY7i90ehfnCqaOZpBUGJyPMiHJ3c0jOb8yaPBjWzIhVdNxPbeVzI74DB0C+YgBKPLqUkgFZzua5Mg==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Memory\": \"4.6.0\",\n          \"System.Numerics.Vectors\": \"4.6.0\",\n          \"System.Reflection.Metadata\": \"9.0.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\",\n          \"System.Text.Encoding.CodePages\": \"8.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.6.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"SQFNGQF4f7UfDXKxMzzGNMr3fjrPDIjLfmRvvVgDCw+dyvEHDaRfHuKA5q0Pr0/JW0Gcw89TxrxrS/MjwBvluQ==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Memory\": \"4.6.0\",\n          \"System.Numerics.Vectors\": \"4.6.0\",\n          \"System.Reflection.Metadata\": \"9.0.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\",\n          \"System.Text.Encoding.CodePages\": \"8.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.6.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp.Workspaces\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"mRwxchBs3ewXK4dqK4R/eVCx99VIq1k/lhwArlu+fJuV0uzmbkTTRw4jR9gN9sOcAQfX0uV9KQlmCk1yC0JNog==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.Bcl.AsyncInterfaces\": \"9.0.0\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.CSharp\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Composition\": \"9.0.0\",\n          \"System.IO.Pipelines\": \"9.0.0\",\n          \"System.Memory\": \"4.6.0\",\n          \"System.Numerics.Vectors\": \"4.6.0\",\n          \"System.Reflection.Metadata\": \"9.0.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\",\n          \"System.Text.Encoding.CodePages\": \"8.0.0\",\n          \"System.Threading.Channels\": \"8.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.6.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.VisualBasic\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"AJxddsIOmfimuihaLuSAm4c/zskHoL1ypAjIpSOZqHlNm2iuw0twsB8nbKczJyfClqD7+iYjdIeE5EV8WAyxRA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Memory\": \"4.6.0\",\n          \"System.Numerics.Vectors\": \"4.6.0\",\n          \"System.Reflection.Metadata\": \"9.0.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\",\n          \"System.Text.Encoding.CodePages\": \"8.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.6.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"pAGdr4qs7+v287DPiiM8px1cBXnhe8LxymkVGTnCwv2OEjCk5HO2zIoFvype4ivKJTRW3aTUUV8ab+915wbv+w==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.Bcl.AsyncInterfaces\": \"9.0.0\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.VisualBasic\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Composition\": \"9.0.0\",\n          \"System.IO.Pipelines\": \"9.0.0\",\n          \"System.Memory\": \"4.6.0\",\n          \"System.Numerics.Vectors\": \"4.6.0\",\n          \"System.Reflection.Metadata\": \"9.0.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\",\n          \"System.Text.Encoding.CodePages\": \"8.0.0\",\n          \"System.Threading.Channels\": \"8.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.6.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Workspaces.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"QSf1ge9A+XFZbGL+gIqXYBIKlm8QdQVLvHDPZiydG11W6mJY7XBMusrsgIEz6L8GYMzGJKTM78m9icliGMF7NA==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.Bcl.AsyncInterfaces\": \"9.0.0\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Composition\": \"9.0.0\",\n          \"System.IO.Pipelines\": \"9.0.0\",\n          \"System.Memory\": \"4.6.0\",\n          \"System.Numerics.Vectors\": \"4.6.0\",\n          \"System.Reflection.Metadata\": \"9.0.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\",\n          \"System.Text.Encoding.CodePages\": \"8.0.0\",\n          \"System.Threading.Channels\": \"8.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.6.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Workspaces.MSBuild\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"2Mg/ppo5dza1e4DJWX4+RIHMc3FgnYzuHTaLRZDupiK1LTi/PAZ1PBpF/iivHVNKQKwipHE984gy37MbM0RO9Q==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.Bcl.AsyncInterfaces\": \"9.0.0\",\n          \"Microsoft.Build.Framework\": \"18.0.2\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"Microsoft.Extensions.DependencyInjection\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Options\": \"9.0.0\",\n          \"Microsoft.Extensions.Primitives\": \"9.0.0\",\n          \"Microsoft.IO.Redist\": \"6.1.0\",\n          \"Microsoft.VisualStudio.SolutionPersistence\": \"1.0.52\",\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Composition\": \"9.0.0\",\n          \"System.Diagnostics.DiagnosticSource\": \"9.0.0\",\n          \"System.IO.Pipelines\": \"9.0.0\",\n          \"System.Memory\": \"4.6.0\",\n          \"System.Numerics.Vectors\": \"4.6.0\",\n          \"System.Reflection.Metadata\": \"9.0.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\",\n          \"System.Text.Encoding.CodePages\": \"8.0.0\",\n          \"System.Text.Encodings.Web\": \"9.0.0\",\n          \"System.Text.Json\": \"9.0.0\",\n          \"System.Threading.Channels\": \"8.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.6.0\",\n          \"System.ValueTuple\": \"4.5.0\"\n        }\n      },\n      \"Microsoft.CodeCoverage\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"9O0BtCfzCWrkAmK187ugKdq72HHOXoOUjuWFDVc2LsZZ0pOnA9bTt+Sg9q4cF+MoAaUU+MuWtvBuFsnduviJow==\"\n      },\n      \"Microsoft.Composition\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.27\",\n        \"contentHash\": \"pwu80Ohe7SBzZ6i69LVdzowp6V+LaVRzd5F7A6QlD42vQkX0oT7KXKWWPlM/S00w1gnMQMRnEdbtOV12z6rXdQ==\"\n      },\n      \"Microsoft.Extensions.DependencyInjection\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"MCPrg7v3QgNMr0vX4vzRXvkNGgLg8vKWX0nKCWUxu2uPyMsaRgiRc1tHBnbTcfJMhMKj2slE/j2M9oGkd25DNw==\",\n        \"dependencies\": {\n          \"Microsoft.Bcl.AsyncInterfaces\": \"9.0.0\",\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.5.4\"\n        }\n      },\n      \"Microsoft.Extensions.DependencyInjection.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"+6f2qv2a3dLwd5w6JanPIPs47CxRbnk+ZocMJUhv9NxP88VlOcJYZs9jY+MYSjxvady08bUZn6qgiNh7DadGgg==\",\n        \"dependencies\": {\n          \"Microsoft.Bcl.AsyncInterfaces\": \"9.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.5.4\"\n        }\n      },\n      \"Microsoft.Extensions.Logging\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"crjWyORoug0kK7RSNJBTeSE6VX8IQgLf3nUpTB9m62bPXp/tzbnOsnbe8TXEG0AASNaKZddnpHKw7fET8E++Pg==\",\n        \"dependencies\": {\n          \"Microsoft.Bcl.AsyncInterfaces\": \"9.0.0\",\n          \"Microsoft.Extensions.DependencyInjection\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Options\": \"9.0.0\",\n          \"System.Diagnostics.DiagnosticSource\": \"9.0.0\",\n          \"System.ValueTuple\": \"4.5.0\"\n        }\n      },\n      \"Microsoft.Extensions.Logging.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"g0UfujELzlLbHoVG8kPKVBaW470Ewi+jnptGS9KUi6jcb+k2StujtK3m26DFSGGwQ/+bVgZfsWqNzlP6YOejvw==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\",\n          \"System.Buffers\": \"4.5.1\",\n          \"System.Diagnostics.DiagnosticSource\": \"9.0.0\",\n          \"System.Memory\": \"4.5.5\"\n        }\n      },\n      \"Microsoft.Extensions.Options\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"y2146b3jrPI3Q0lokKXdKLpmXqakYbDIPDV6r3M8SqvSf45WwOTzkyfDpxnZXJsJQEpAsAqjUq5Pu8RCJMjubg==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Primitives\": \"9.0.0\",\n          \"System.ValueTuple\": \"4.5.0\"\n        }\n      },\n      \"Microsoft.Extensions.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"N3qEBzmLMYiASUlKxxFIISP4AiwuPTHF5uCh+2CWSwwzAJiIYx0kBJsS30cp1nvhSySFAVi30jecD307jV+8Kg==\",\n        \"dependencies\": {\n          \"System.Memory\": \"4.5.5\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.0.0\"\n        }\n      },\n      \"Microsoft.IO.Redist\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.1.0\",\n        \"contentHash\": \"pTYqyiu9nLeCXROGjKnnYTH9v3yQNgXj3t4v7fOWwh9dgSBIwZbiSi8V76hryG2CgTjUFU+xu8BXPQ122CwAJg==\",\n        \"dependencies\": {\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Memory\": \"4.6.0\"\n        }\n      },\n      \"Microsoft.NETFramework.ReferenceAssemblies.net48\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.3\",\n        \"contentHash\": \"zMk4D+9zyiEWByyQ7oPImPN/Jhpj166Ky0Nlla4eXlNL8hI/BtSJsgR8Inldd4NNpIAH3oh8yym0W2DrhXdSLQ==\"\n      },\n      \"Microsoft.Testing.Extensions.Telemetry\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"7zB8BjffOyvqfHF26rFVPuK0w1fCf5+j1tLuhHIr76CqxXkGb+fMJtq6YNOV+m6qPytExHMXxluk3RgJ+dSIqw==\",\n        \"dependencies\": {\n          \"Microsoft.ApplicationInsights\": \"2.23.0\",\n          \"Microsoft.Testing.Platform\": \"2.2.1\",\n          \"System.Diagnostics.DiagnosticSource\": \"6.0.0\"\n        }\n      },\n      \"Microsoft.Testing.Extensions.TrxReport.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"RD6D1Jx6cKDA5IHd1H2q8ylIuQG3PD+gdULI0JC8CvsRtaypFzTFpB5xDPuQi8o6kAkcM04cBhAiJPxZboNH2Q==\",\n        \"dependencies\": {\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.Testing.Extensions.VSTestBridge\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"D8AGlkNtlTQPe3zf4SLnHBMr13lerMe0RuHSoRfnRatcuX/T7YbRtgn39rWBjKhXsNio0WXKrPKv3gfWE2I46w==\",\n        \"dependencies\": {\n          \"Microsoft.TestPlatform.ObjectModel\": \"18.3.0\",\n          \"Microsoft.Testing.Extensions.Telemetry\": \"2.2.1\",\n          \"Microsoft.Testing.Extensions.TrxReport.Abstractions\": \"2.2.1\",\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.Testing.Platform\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"9bbPuls/b6/vUFzxbSjJLZlJHyKBfOZE5kjIY+ITI2ASqlFPJhR83BdLydJeQOCLEZhEbrEcz5xtt1B69nwSVg==\"\n      },\n      \"Microsoft.Testing.Platform.MSBuild\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"CSJOcZHfKlTyPbS0CTJk6iEnU4gJC+eUA5z72UBnMDRdgVHYOmB8k9Y7jT233gZjnCOQiYFg3acQHRfu2H62nw==\",\n        \"dependencies\": {\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.TestPlatform.ObjectModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.3.0\",\n        \"contentHash\": \"AEIEX2aWdPO9XbtR96eBaJxmXRD9vaI9uQ1T/JbPEKlTAZwYx0ZrMzKyULMdh/HH9Sg03kXCoN7LszQ90o6nPQ==\",\n        \"dependencies\": {\n          \"System.Reflection.Metadata\": \"8.0.0\"\n        }\n      },\n      \"Microsoft.VisualStudio.SolutionPersistence\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.52\",\n        \"contentHash\": \"oNv2JtYXhpdJrX63nibx1JT3uCESOBQ1LAk7Dtz/sr0+laW0KRM6eKp4CZ3MHDR2siIkKsY8MmUkeP5DKkQQ5w==\",\n        \"dependencies\": {\n          \"Microsoft.IO.Redist\": \"6.0.1\",\n          \"System.Memory\": \"4.5.5\",\n          \"System.Threading.Tasks.Extensions\": \"4.5.4\"\n        }\n      },\n      \"MSTest.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"1i9jgE/42KGGyZ4s0MdrYM/Uu/dRYhbRfYQifcO0AZ6vw4sBXRjoQGQRGNSm771AYgPAmoGl0u4sJc2lMET6HQ==\"\n      },\n      \"Newtonsoft.Json\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"13.0.3\",\n        \"contentHash\": \"HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==\"\n      },\n      \"NuGet.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"1mp7zmyAGmQfT93ELC4c+MYOrJ8Ff4ekFZRek4JSVLb/wOO/o0bsPfLmqujCsJ2Hlwc+fpq1TQEnjSEgWdt8ng==\",\n        \"dependencies\": {\n          \"NuGet.Frameworks\": \"7.3.1\",\n          \"System.Collections.Immutable\": \"8.0.0\"\n        }\n      },\n      \"NuGet.Configuration\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"tGxWBo47EQONOaqY+MbEWMrNjFthHgfavLM1HE0RcLyOXVCoQKBlZGV7v0hrS/rJrQKw6ZaBeHetX+ZJgS7Lxg==\",\n        \"dependencies\": {\n          \"NuGet.Common\": \"7.3.1\"\n        }\n      },\n      \"NuGet.Frameworks\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"VUPAE5l/Ir4Gb3dv+v0jq0Qe4nfwxfrfiYN7QhwlGyWPXFKYXSSke1t1bV/ZYd6idtTtRDqJPM49Lt/U8NTocg==\"\n      },\n      \"NuGet.Packaging\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"5bT8uOrNBx4Srhbrd3HonYmyKhWJkvQyTWTYE2jvfPgYx2aCbPmq8MCYko7ce78hEN9mpq2xlrztVhguYPc+GQ==\",\n        \"dependencies\": {\n          \"Newtonsoft.Json\": \"13.0.3\",\n          \"NuGet.Configuration\": \"7.3.1\",\n          \"NuGet.Versioning\": \"7.3.1\",\n          \"System.Text.Json\": \"8.0.5\"\n        }\n      },\n      \"NuGet.Protocol\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"vYd5vtCJ/tpMQjbAs6rrftNgeh5Ip1w7tnEsDZCpGObKgUgOxHQBekCul3TnzmbNgobvJEkDJNaec5/ZBv66Hg==\",\n        \"dependencies\": {\n          \"NuGet.Packaging\": \"7.3.1\",\n          \"System.Text.Json\": \"8.0.5\"\n        }\n      },\n      \"NuGet.Versioning\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"TJrQWSmD1vakfav7qIhDXgDFfaZFfMJ+v6P8tcND9ZqXajD5B/ZzaoGYNzL4D3eDue6vAOUvwzu42G+19JNVUA==\"\n      },\n      \"StyleCop.Analyzers.Unstable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.2.0.556\",\n        \"contentHash\": \"zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==\"\n      },\n      \"System.Buffers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.6.0\",\n        \"contentHash\": \"lN6tZi7Q46zFzAbRYXTIvfXcyvQQgxnY7Xm6C6xQ9784dEL1amjM6S6Iw4ZpsvesAKnRVsM4scrDQaDqSClkjA==\"\n      },\n      \"System.Collections.Immutable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"QhkXUl2gNrQtvPmtBTQHb0YsUrDiDQ2QS09YbtTTiSjGcf7NBqtYbrG/BE06zcBPCKEwQGzIv13IVdXNOSub2w==\",\n        \"dependencies\": {\n          \"System.Memory\": \"4.5.5\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.0.0\"\n        }\n      },\n      \"System.Composition\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"3Djj70fFTraOarSKmRnmRy/zm4YurICm+kiCtI0dYRqGJnLX6nJ+G3WYuFJ173cAPax/gh96REcbNiVqcrypFQ==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\",\n          \"System.Composition.Convention\": \"9.0.0\",\n          \"System.Composition.Hosting\": \"9.0.0\",\n          \"System.Composition.Runtime\": \"9.0.0\",\n          \"System.Composition.TypedParts\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.AttributedModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"iri00l/zIX9g4lHMY+Nz0qV1n40+jFYAmgsaiNn16xvt2RDwlqByNG4wgblagnDYxm3YSQQ0jLlC/7Xlk9CzyA==\"\n      },\n      \"System.Composition.Convention\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"+vuqVP6xpi582XIjJi6OCsIxuoTZfR0M7WWufk3uGDeCl3wGW6KnpylUJ3iiXdPByPE0vR5TjJgR6hDLez4FQg==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.Hosting\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"OFqSeFeJYr7kHxDfaViGM1ymk7d4JxK//VSoNF9Ux0gpqkLsauDZpu89kTHHNdCWfSljbFcvAafGyBoY094btQ==\",\n        \"dependencies\": {\n          \"System.Composition.Runtime\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.Runtime\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"w1HOlQY1zsOWYussjFGZCEYF2UZXgvoYnS94NIu2CBnAGMbXFAX8PY8c92KwUItPmowal68jnVLBCzdrWLeEKA==\"\n      },\n      \"System.Composition.TypedParts\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"aRZlojCCGEHDKqh43jaDgaVpYETsgd7Nx4g1zwLKMtv4iTo0627715ajEFNpEEBTgLmvZuv8K0EVxc3sM4NWJA==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\",\n          \"System.Composition.Hosting\": \"9.0.0\",\n          \"System.Composition.Runtime\": \"9.0.0\"\n        }\n      },\n      \"System.Diagnostics.DiagnosticSource\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"ddppcFpnbohLWdYKr/ZeLZHmmI+DXFgZ3Snq+/E7SwcdW4UnvxmaugkwGywvGVWkHPGCSZjCP+MLzu23AL5SDw==\",\n        \"dependencies\": {\n          \"System.Memory\": \"4.5.5\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.0.0\"\n        }\n      },\n      \"System.IO.Pipelines\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"eA3cinogwaNB4jdjQHOP3Z3EuyiDII7MT35jgtnsA4vkn0LUrrSHsU0nzHTzFzmaFYeKV7MYyMxOocFzsBHpTw==\",\n        \"dependencies\": {\n          \"System.Buffers\": \"4.5.1\",\n          \"System.Memory\": \"4.5.5\",\n          \"System.Threading.Tasks.Extensions\": \"4.5.4\"\n        }\n      },\n      \"System.Memory\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.6.0\",\n        \"contentHash\": \"OEkbBQoklHngJ8UD8ez2AERSk2g+/qpAaSWWCBFbpH727HxDq5ydVkuncBaKcKfwRqXGWx64dS6G1SUScMsitg==\",\n        \"dependencies\": {\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Numerics.Vectors\": \"4.6.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\"\n        }\n      },\n      \"System.Numerics.Vectors\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.6.0\",\n        \"contentHash\": \"t+SoieZsRuEyiw/J+qXUbolyO219tKQQI0+2/YI+Qv7YdGValA6WiuokrNKqjrTNsy5ABWU11bdKOzUdheteXg==\"\n      },\n      \"System.Reflection.Metadata\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"ANiqLu3DxW9kol/hMmTWbt3414t9ftdIuiIU7j80okq2YzAueo120M442xk1kDJWtmZTqWQn7wHDvMRipVOEOQ==\",\n        \"dependencies\": {\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Memory\": \"4.5.5\"\n        }\n      },\n      \"System.Runtime.CompilerServices.Unsafe\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.1.0\",\n        \"contentHash\": \"5o/HZxx6RVqYlhKSq8/zronDkALJZUT2Vz0hx43f0gwe8mwlM0y2nYlqdBwLMzr262Bwvpikeb/yEwkAa5PADg==\"\n      },\n      \"System.Text.Encoding.CodePages\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"OZIsVplFGaVY90G2SbpgU7EnCoOO5pw1t4ic21dBF3/1omrJFpAGoNAVpPyMVOC90/hvgkGG3VFqR13YgZMQfg==\",\n        \"dependencies\": {\n          \"System.Memory\": \"4.5.5\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.0.0\"\n        }\n      },\n      \"System.Text.Encodings.Web\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"e2hMgAErLbKyUUwt18qSBf9T5Y+SFAL3ZedM8fLupkVj8Rj2PZ9oxQ37XX2LF8fTO1wNIxvKpihD7Of7D/NxZw==\",\n        \"dependencies\": {\n          \"System.Buffers\": \"4.5.1\",\n          \"System.Memory\": \"4.5.5\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.0.0\"\n        }\n      },\n      \"System.Text.Json\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"js7+qAu/9mQvnhA4EfGMZNEzXtJCDxgkgj8ohuxq/Qxv+R56G+ljefhiJHOxTNiw54q8vmABCWUwkMulNdlZ4A==\",\n        \"dependencies\": {\n          \"Microsoft.Bcl.AsyncInterfaces\": \"9.0.0\",\n          \"System.Buffers\": \"4.5.1\",\n          \"System.IO.Pipelines\": \"9.0.0\",\n          \"System.Memory\": \"4.5.5\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.0.0\",\n          \"System.Text.Encodings.Web\": \"9.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.5.4\",\n          \"System.ValueTuple\": \"4.5.0\"\n        }\n      },\n      \"System.Threading.Channels\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"CMaFr7v+57RW7uZfZkPExsPB6ljwzhjACWW1gfU35Y56rk72B/Wu+sTqxVmGSk4SFUlPc3cjeKND0zktziyjBA==\",\n        \"dependencies\": {\n          \"System.Threading.Tasks.Extensions\": \"4.5.4\"\n        }\n      },\n      \"System.Threading.Tasks.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.6.0\",\n        \"contentHash\": \"I5G6Y8jb0xRtGUC9Lahy7FUvlYlnGMMkbuKAQBy8Jb7Y6Yn8OlBEiUOY0PqZ0hy6Ua8poVA1ui1tAIiXNxGdsg==\",\n        \"dependencies\": {\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\"\n        }\n      },\n      \"System.ValueTuple\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.5.0\",\n        \"contentHash\": \"okurQJO6NRE/apDIP23ajJ0hpiNmJ+f0BwOlB/cSqTLQlw5upkf+5+96+iG2Jw40G1fCVCyPz/FhIABUjMR+RQ==\"\n      },\n      \"sonaranalyzer.cfg\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer.Lightup\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.core\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Google.Protobuf\": \"[3.6.1, )\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.CFG\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.csharp\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"SonarAnalyzer.CSharp.Core\": \"[10.26.0, )\",\n          \"SonarAnalyzer.Core\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.csharp.core\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.CFG\": \"[10.26.0, )\",\n          \"SonarAnalyzer.Core\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer.lightup\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.testframework\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Combinatorial.MSTest\": \"[2.0.0, )\",\n          \"FluentAssertions\": \"[7.2.1, )\",\n          \"FluentAssertions.Analyzers\": \"[0.34.1, )\",\n          \"MSTest.TestAdapter\": \"[4.2.1, )\",\n          \"MSTest.TestFramework\": \"[4.2.1, )\",\n          \"Microsoft.Build.Locator\": \"[1.11.2, )\",\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[5.3.0, )\",\n          \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": \"[5.3.0, )\",\n          \"Microsoft.CodeAnalysis.Workspaces.MSBuild\": \"[5.3.0, )\",\n          \"Microsoft.NET.Test.Sdk\": \"[18.4.0, )\",\n          \"NSubstitute\": \"[5.3.0, )\",\n          \"NuGet.Protocol\": \"[7.3.1, )\",\n          \"SonarAnalyzer.Core\": \"[10.26.0, )\",\n          \"altcover\": \"[9.0.102, )\"\n        }\n      },\n      \"sonaranalyzer.visualbasic\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": \"[1.3.2, )\",\n          \"SonarAnalyzer.Core\": \"[10.26.0, )\",\n          \"SonarAnalyzer.VisualBasic.Core\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.visualbasic.core\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": \"[1.3.2, )\",\n          \"SonarAnalyzer.CFG\": \"[10.26.0, )\",\n          \"SonarAnalyzer.Core\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      }\n    },\n    \"net10.0\": {\n      \"altcover\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[9.0.102, )\",\n        \"resolved\": \"9.0.102\",\n        \"contentHash\": \"q3Rf5t0M9kXlcO5qhsaAe6NrFSNd5enrhKmF/Ezgmomqw34PbUTbRSYjSDNhS3YGDyUrPTkyPn14EfLDJWztcA==\"\n      },\n      \"Combinatorial.MSTest\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[2.0.0, )\",\n        \"resolved\": \"2.0.0\",\n        \"contentHash\": \"9tB2TMPkuEkYYUq64WREHMMyPt9NfKAyuitpK9yw3zbVe6v/vYkClZTR02+yKFUG+g8XHi5LMTt8jHz4RufGqw==\",\n        \"dependencies\": {\n          \"MSTest.TestFramework\": \"4.0.1\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[3.3.1, )\",\n        \"resolved\": \"3.3.1\",\n        \"contentHash\": \"eT+kgNCDdTRbQ5WF6BGx1HI3D5jYfHteza/koefhWC2vNZGxObA74XxwWfg40dy3uUv7dn3OGKLK5GUPLroVog==\"\n      },\n      \"Microsoft.NET.Test.Sdk\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[18.4.0, )\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"w49iZdL4HL6V25l41NVQLXWQ+e71GvSkKVteMrOL02gP/PUkcnO/1yEb2s9FntU4wGmJWfKnyrRAhcMHd9ZZNA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeCoverage\": \"18.4.0\",\n          \"Microsoft.TestPlatform.TestHost\": \"18.4.0\"\n        }\n      },\n      \"MSTest.TestAdapter\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[4.2.1, )\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"lZRgNzaQnffK4XLjM/og4Eoqp/3IkpcyJQQcyKXkPdkzCT3+ghpwHa9zG1xYhQDbUFoc54M+/waLwh31K9stDQ==\",\n        \"dependencies\": {\n          \"MSTest.TestFramework\": \"4.2.1\",\n          \"Microsoft.Testing.Extensions.VSTestBridge\": \"2.2.1\",\n          \"Microsoft.Testing.Platform.MSBuild\": \"2.2.1\"\n        }\n      },\n      \"MSTest.TestFramework\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[4.2.1, )\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"I4/RbS2TpGZ56CE98+jPbrGlcerYtw2LvPVKzQGvyQQcJDekPy2Kd+fnThXYn+geJ1sW+vA9B7++rFNxvKcWxA==\",\n        \"dependencies\": {\n          \"MSTest.Analyzers\": \"4.2.1\"\n        }\n      },\n      \"NSubstitute\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[5.3.0, )\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"lJ47Cps5Qzr86N99lcwd+OUvQma7+fBgr8+Mn+aOC0WrlqMNkdivaYD9IvnZ5Mqo6Ky3LS7ZI+tUq1/s9ERd0Q==\",\n        \"dependencies\": {\n          \"Castle.Core\": \"5.1.1\"\n        }\n      },\n      \"SonarAnalyzer.CSharp.Styling\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[10.21.0.135717, )\",\n        \"resolved\": \"10.21.0.135717\",\n        \"contentHash\": \"hl264jF539oB7m2jED5QGM345eFSiDAdoJc8TH0HM6L7ZeqT5TDqZDQeZ8IDP02dVIpH/Fhhn+HsGfEcj8ohyQ==\"\n      },\n      \"StyleCop.Analyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.2.0-beta.556, )\",\n        \"resolved\": \"1.2.0-beta.556\",\n        \"contentHash\": \"llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==\",\n        \"dependencies\": {\n          \"StyleCop.Analyzers.Unstable\": \"1.2.0.556\"\n        }\n      },\n      \"Castle.Core\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.1.1\",\n        \"contentHash\": \"rpYtIczkzGpf+EkZgDr9CClTdemhsrwA/W5hMoPjLkRFnXzH44zDLoovXeKtmxb1ykXK9aJVODSpiJml8CTw2g==\",\n        \"dependencies\": {\n          \"System.Diagnostics.EventLog\": \"6.0.0\"\n        }\n      },\n      \"FluentAssertions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.2.1\",\n        \"contentHash\": \"MilqBF2lZrT0V1azIA6DG6I/snS0rG3A8ohT2Jjkhq6zOFk76nqx4BPnEnzrX6jFVa6xvkDU++z3PebCGZyJ4g==\",\n        \"dependencies\": {\n          \"System.Configuration.ConfigurationManager\": \"6.0.0\"\n        }\n      },\n      \"FluentAssertions.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"0.34.1\",\n        \"contentHash\": \"2BnAAB8CCPdRA9P1+lAvBZOleR2BTmsxGMtGt+LnABJUARGqoGMWEFxG3znZYqHVIrMP0Za/kyw6atyt8x2mzA==\"\n      },\n      \"Google.Protobuf\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"3.6.1\",\n        \"contentHash\": \"741fGeDQjixBJaU2j+0CbrmZXsNJkTn/hWbOh4fLVXndHsCclJmWznCPWrJmPoZKvajBvAz3e8ECJOUvRtwjNQ==\",\n        \"dependencies\": {\n          \"NETStandard.Library\": \"1.6.1\"\n        }\n      },\n      \"Humanizer.Core\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.14.1\",\n        \"contentHash\": \"lQKvtaTDOXnoVJ20ibTuSIOf2i0uO0MPbDhd1jm238I+U/2ZnRENj0cktKZhtchBMtCUSRQ5v4xBCUbKNmyVMw==\"\n      },\n      \"Microsoft.ApplicationInsights\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.23.0\",\n        \"contentHash\": \"nWArUZTdU7iqZLycLKWe0TDms48KKGE6pONH2terYNa8REXiqixrMOkf1sk5DHGMaUTqONU2YkS4SAXBhLStgw==\",\n        \"dependencies\": {\n          \"System.Diagnostics.DiagnosticSource\": \"5.0.0\"\n        }\n      },\n      \"Microsoft.Build.Framework\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"17.11.48\",\n        \"contentHash\": \"C3WIMt2wBl4++NX3jSEpTq5KXBhvAV154R4JrYHkfy9JSBcXWiL0mkgpspk5xSdOj+fS/uz7zluIy6bMM1fkkQ==\"\n      },\n      \"Microsoft.Build.Locator\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.11.2\",\n        \"contentHash\": \"tY+/S54G29CGsbL3slVu4vqtpciwVnb3fKOmrhgzEQmu/VziFaWmD/E1e/2KH7cDucuycGSkWsSXndBs5Uawow==\"\n      },\n      \"Microsoft.CodeAnalysis.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0-2.25625.1\",\n        \"contentHash\": \"4Yhh2fnu3G+J0J1lDc8WZVgMjgbynSeTfkl5IFJMFrmiIO0sc7Tjx+f3sFVV8Sd35PrIUWfof0RWc3lAMl7Azg==\"\n      },\n      \"Microsoft.CodeAnalysis.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"uC0qk3jzTQY7i90ehfnCqaOZpBUGJyPMiHJ3c0jOb8yaPBjWzIhVdNxPbeVzI74DB0C+YgBKPLqUkgFZzua5Mg==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"SQFNGQF4f7UfDXKxMzzGNMr3fjrPDIjLfmRvvVgDCw+dyvEHDaRfHuKA5q0Pr0/JW0Gcw89TxrxrS/MjwBvluQ==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp.Workspaces\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"mRwxchBs3ewXK4dqK4R/eVCx99VIq1k/lhwArlu+fJuV0uzmbkTTRw4jR9gN9sOcAQfX0uV9KQlmCk1yC0JNog==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.CSharp\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.VisualBasic\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"AJxddsIOmfimuihaLuSAm4c/zskHoL1ypAjIpSOZqHlNm2iuw0twsB8nbKczJyfClqD7+iYjdIeE5EV8WAyxRA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"pAGdr4qs7+v287DPiiM8px1cBXnhe8LxymkVGTnCwv2OEjCk5HO2zIoFvype4ivKJTRW3aTUUV8ab+915wbv+w==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.VisualBasic\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Workspaces.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"QSf1ge9A+XFZbGL+gIqXYBIKlm8QdQVLvHDPZiydG11W6mJY7XBMusrsgIEz6L8GYMzGJKTM78m9icliGMF7NA==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Workspaces.MSBuild\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"2Mg/ppo5dza1e4DJWX4+RIHMc3FgnYzuHTaLRZDupiK1LTi/PAZ1PBpF/iivHVNKQKwipHE984gy37MbM0RO9Q==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.Build.Framework\": \"17.11.48\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"Microsoft.Extensions.DependencyInjection\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Options\": \"9.0.0\",\n          \"Microsoft.Extensions.Primitives\": \"9.0.0\",\n          \"Microsoft.VisualStudio.SolutionPersistence\": \"1.0.52\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeCoverage\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"9O0BtCfzCWrkAmK187ugKdq72HHOXoOUjuWFDVc2LsZZ0pOnA9bTt+Sg9q4cF+MoAaUU+MuWtvBuFsnduviJow==\"\n      },\n      \"Microsoft.Composition\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.27\",\n        \"contentHash\": \"pwu80Ohe7SBzZ6i69LVdzowp6V+LaVRzd5F7A6QlD42vQkX0oT7KXKWWPlM/S00w1gnMQMRnEdbtOV12z6rXdQ==\"\n      },\n      \"Microsoft.Extensions.DependencyInjection\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"MCPrg7v3QgNMr0vX4vzRXvkNGgLg8vKWX0nKCWUxu2uPyMsaRgiRc1tHBnbTcfJMhMKj2slE/j2M9oGkd25DNw==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.DependencyInjection.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"+6f2qv2a3dLwd5w6JanPIPs47CxRbnk+ZocMJUhv9NxP88VlOcJYZs9jY+MYSjxvady08bUZn6qgiNh7DadGgg==\"\n      },\n      \"Microsoft.Extensions.Logging\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"crjWyORoug0kK7RSNJBTeSE6VX8IQgLf3nUpTB9m62bPXp/tzbnOsnbe8TXEG0AASNaKZddnpHKw7fET8E++Pg==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Options\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.Logging.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"g0UfujELzlLbHoVG8kPKVBaW470Ewi+jnptGS9KUi6jcb+k2StujtK3m26DFSGGwQ/+bVgZfsWqNzlP6YOejvw==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.Options\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"y2146b3jrPI3Q0lokKXdKLpmXqakYbDIPDV6r3M8SqvSf45WwOTzkyfDpxnZXJsJQEpAsAqjUq5Pu8RCJMjubg==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Primitives\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"N3qEBzmLMYiASUlKxxFIISP4AiwuPTHF5uCh+2CWSwwzAJiIYx0kBJsS30cp1nvhSySFAVi30jecD307jV+8Kg==\"\n      },\n      \"Microsoft.Testing.Extensions.Telemetry\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"7zB8BjffOyvqfHF26rFVPuK0w1fCf5+j1tLuhHIr76CqxXkGb+fMJtq6YNOV+m6qPytExHMXxluk3RgJ+dSIqw==\",\n        \"dependencies\": {\n          \"Microsoft.ApplicationInsights\": \"2.23.0\",\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.Testing.Extensions.TrxReport.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"RD6D1Jx6cKDA5IHd1H2q8ylIuQG3PD+gdULI0JC8CvsRtaypFzTFpB5xDPuQi8o6kAkcM04cBhAiJPxZboNH2Q==\",\n        \"dependencies\": {\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.Testing.Extensions.VSTestBridge\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"D8AGlkNtlTQPe3zf4SLnHBMr13lerMe0RuHSoRfnRatcuX/T7YbRtgn39rWBjKhXsNio0WXKrPKv3gfWE2I46w==\",\n        \"dependencies\": {\n          \"Microsoft.TestPlatform.ObjectModel\": \"18.3.0\",\n          \"Microsoft.Testing.Extensions.Telemetry\": \"2.2.1\",\n          \"Microsoft.Testing.Extensions.TrxReport.Abstractions\": \"2.2.1\",\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.Testing.Platform\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"9bbPuls/b6/vUFzxbSjJLZlJHyKBfOZE5kjIY+ITI2ASqlFPJhR83BdLydJeQOCLEZhEbrEcz5xtt1B69nwSVg==\"\n      },\n      \"Microsoft.Testing.Platform.MSBuild\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"CSJOcZHfKlTyPbS0CTJk6iEnU4gJC+eUA5z72UBnMDRdgVHYOmB8k9Y7jT233gZjnCOQiYFg3acQHRfu2H62nw==\",\n        \"dependencies\": {\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.TestPlatform.ObjectModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"4L6m2kS2pY5uJ9cpeRxzW22opr6ttScIRqsOpMDQpgENp/ZwxkkQCcmc6LRSURo2dFaaSW5KVflQZvroiJ7Wzg==\",\n        \"dependencies\": {\n          \"System.Reflection.Metadata\": \"8.0.0\"\n        }\n      },\n      \"Microsoft.TestPlatform.TestHost\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"gZsCHI+zOmZCcKZieIL4Jg14qKD2OGZOmX5DehuIk1EA9BN6Crm0+taXQNEuajOH1G9CCyBxw8VWR4t5tumcng==\",\n        \"dependencies\": {\n          \"Microsoft.TestPlatform.ObjectModel\": \"18.4.0\",\n          \"Newtonsoft.Json\": \"13.0.3\"\n        }\n      },\n      \"Microsoft.VisualStudio.SolutionPersistence\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.52\",\n        \"contentHash\": \"oNv2JtYXhpdJrX63nibx1JT3uCESOBQ1LAk7Dtz/sr0+laW0KRM6eKp4CZ3MHDR2siIkKsY8MmUkeP5DKkQQ5w==\"\n      },\n      \"Microsoft.Win32.SystemEvents\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"hqTM5628jSsQiv+HGpiq3WKBl2c8v1KZfby2J6Pr7pEPlK9waPdgEO6b8A/+/xn/yZ9ulv8HuqK71ONy2tg67A==\"\n      },\n      \"MSTest.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"1i9jgE/42KGGyZ4s0MdrYM/Uu/dRYhbRfYQifcO0AZ6vw4sBXRjoQGQRGNSm771AYgPAmoGl0u4sJc2lMET6HQ==\"\n      },\n      \"Newtonsoft.Json\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"13.0.3\",\n        \"contentHash\": \"HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==\"\n      },\n      \"NuGet.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"1mp7zmyAGmQfT93ELC4c+MYOrJ8Ff4ekFZRek4JSVLb/wOO/o0bsPfLmqujCsJ2Hlwc+fpq1TQEnjSEgWdt8ng==\",\n        \"dependencies\": {\n          \"NuGet.Frameworks\": \"7.3.1\"\n        }\n      },\n      \"NuGet.Configuration\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"tGxWBo47EQONOaqY+MbEWMrNjFthHgfavLM1HE0RcLyOXVCoQKBlZGV7v0hrS/rJrQKw6ZaBeHetX+ZJgS7Lxg==\",\n        \"dependencies\": {\n          \"NuGet.Common\": \"7.3.1\",\n          \"System.Security.Cryptography.ProtectedData\": \"8.0.0\"\n        }\n      },\n      \"NuGet.Frameworks\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"VUPAE5l/Ir4Gb3dv+v0jq0Qe4nfwxfrfiYN7QhwlGyWPXFKYXSSke1t1bV/ZYd6idtTtRDqJPM49Lt/U8NTocg==\"\n      },\n      \"NuGet.Packaging\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"5bT8uOrNBx4Srhbrd3HonYmyKhWJkvQyTWTYE2jvfPgYx2aCbPmq8MCYko7ce78hEN9mpq2xlrztVhguYPc+GQ==\",\n        \"dependencies\": {\n          \"Newtonsoft.Json\": \"13.0.3\",\n          \"NuGet.Configuration\": \"7.3.1\",\n          \"NuGet.Versioning\": \"7.3.1\",\n          \"System.Security.Cryptography.Pkcs\": \"8.0.1\"\n        }\n      },\n      \"NuGet.Protocol\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"vYd5vtCJ/tpMQjbAs6rrftNgeh5Ip1w7tnEsDZCpGObKgUgOxHQBekCul3TnzmbNgobvJEkDJNaec5/ZBv66Hg==\",\n        \"dependencies\": {\n          \"NuGet.Packaging\": \"7.3.1\"\n        }\n      },\n      \"NuGet.Versioning\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"TJrQWSmD1vakfav7qIhDXgDFfaZFfMJ+v6P8tcND9ZqXajD5B/ZzaoGYNzL4D3eDue6vAOUvwzu42G+19JNVUA==\"\n      },\n      \"StyleCop.Analyzers.Unstable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.2.0.556\",\n        \"contentHash\": \"zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==\"\n      },\n      \"System.Collections.Immutable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"AurL6Y5BA1WotzlEvVaIDpqzpIPvYnnldxru8oXJU2yFxFUy3+pNXjXd1ymO+RA0rq0+590Q8gaz2l3Sr7fmqg==\"\n      },\n      \"System.Composition\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"3Djj70fFTraOarSKmRnmRy/zm4YurICm+kiCtI0dYRqGJnLX6nJ+G3WYuFJ173cAPax/gh96REcbNiVqcrypFQ==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\",\n          \"System.Composition.Convention\": \"9.0.0\",\n          \"System.Composition.Hosting\": \"9.0.0\",\n          \"System.Composition.Runtime\": \"9.0.0\",\n          \"System.Composition.TypedParts\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.AttributedModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"iri00l/zIX9g4lHMY+Nz0qV1n40+jFYAmgsaiNn16xvt2RDwlqByNG4wgblagnDYxm3YSQQ0jLlC/7Xlk9CzyA==\"\n      },\n      \"System.Composition.Convention\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"+vuqVP6xpi582XIjJi6OCsIxuoTZfR0M7WWufk3uGDeCl3wGW6KnpylUJ3iiXdPByPE0vR5TjJgR6hDLez4FQg==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.Hosting\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"OFqSeFeJYr7kHxDfaViGM1ymk7d4JxK//VSoNF9Ux0gpqkLsauDZpu89kTHHNdCWfSljbFcvAafGyBoY094btQ==\",\n        \"dependencies\": {\n          \"System.Composition.Runtime\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.Runtime\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"w1HOlQY1zsOWYussjFGZCEYF2UZXgvoYnS94NIu2CBnAGMbXFAX8PY8c92KwUItPmowal68jnVLBCzdrWLeEKA==\"\n      },\n      \"System.Composition.TypedParts\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"aRZlojCCGEHDKqh43jaDgaVpYETsgd7Nx4g1zwLKMtv4iTo0627715ajEFNpEEBTgLmvZuv8K0EVxc3sM4NWJA==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\",\n          \"System.Composition.Hosting\": \"9.0.0\",\n          \"System.Composition.Runtime\": \"9.0.0\"\n        }\n      },\n      \"System.Configuration.ConfigurationManager\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"7T+m0kDSlIPTHIkPMIu6m6tV6qsMqJpvQWW2jIc2qi7sn40qxFo0q+7mEQAhMPXZHMKnWrnv47ntGlM/ejvw3g==\",\n        \"dependencies\": {\n          \"System.Security.Cryptography.ProtectedData\": \"6.0.0\",\n          \"System.Security.Permissions\": \"6.0.0\"\n        }\n      },\n      \"System.Diagnostics.DiagnosticSource\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.0.0\",\n        \"contentHash\": \"tCQTzPsGZh/A9LhhA6zrqCRV4hOHsK90/G7q3Khxmn6tnB1PuNU0cRaKANP2AWcF9bn0zsuOoZOSrHuJk6oNBA==\"\n      },\n      \"System.Diagnostics.EventLog\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"lcyUiXTsETK2ALsZrX+nWuHSIQeazhqPphLfaRxzdGaG93+0kELqpgEHtwWOlQe7+jSFnKwaCAgL4kjeZCQJnw==\"\n      },\n      \"System.Drawing.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"NfuoKUiP2nUWwKZN6twGqXioIe1zVD0RIj2t976A+czLHr2nY454RwwXs6JU9Htc6mwqL6Dn/nEL3dpVf2jOhg==\",\n        \"dependencies\": {\n          \"Microsoft.Win32.SystemEvents\": \"6.0.0\"\n        }\n      },\n      \"System.Reflection.Metadata\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"ptvgrFh7PvWI8bcVqG5rsA/weWM09EnthFHR5SCnS6IN+P4mj6rE1lBDC4U8HL9/57htKAqy4KQ3bBj84cfYyQ==\",\n        \"dependencies\": {\n          \"System.Collections.Immutable\": \"8.0.0\"\n        }\n      },\n      \"System.Security.AccessControl\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"AUADIc0LIEQe7MzC+I0cl0rAT8RrTAKFHl53yHjEUzNVIaUlhFY11vc2ebiVJzVBuOzun6F7FBA+8KAbGTTedQ==\"\n      },\n      \"System.Security.Cryptography.Pkcs\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.1\",\n        \"contentHash\": \"CoCRHFym33aUSf/NtWSVSZa99dkd0Hm7OCZUxORBjRB16LNhIEOf8THPqzIYlvKM0nNDAPTRBa1FxEECrgaxxA==\"\n      },\n      \"System.Security.Cryptography.ProtectedData\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"+TUFINV2q2ifyXauQXRwy4CiBhqvDEDZeVJU7qfxya4aRYOKzVBpN+4acx25VcPB9ywUN6C0n8drWl110PhZEg==\"\n      },\n      \"System.Security.Permissions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"T/uuc7AklkDoxmcJ7LGkyX1CcSviZuLCa4jg3PekfJ7SU0niF0IVTXwUiNVP9DSpzou2PpxJ+eNY2IfDM90ZCg==\",\n        \"dependencies\": {\n          \"System.Security.AccessControl\": \"6.0.0\",\n          \"System.Windows.Extensions\": \"6.0.0\"\n        }\n      },\n      \"System.Windows.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"IXoJOXIqc39AIe+CIR7koBtRGMiCt/LPM3lI+PELtDIy9XdyeSrwXFdWV9dzJ2Awl0paLWUaknLxFQ5HpHZUog==\",\n        \"dependencies\": {\n          \"System.Drawing.Common\": \"6.0.0\"\n        }\n      },\n      \"sonaranalyzer.cfg\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer.Lightup\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.core\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Google.Protobuf\": \"[3.6.1, )\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.CFG\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.csharp\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"SonarAnalyzer.CSharp.Core\": \"[10.26.0, )\",\n          \"SonarAnalyzer.Core\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.csharp.core\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.CFG\": \"[10.26.0, )\",\n          \"SonarAnalyzer.Core\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer.lightup\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.testframework\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Combinatorial.MSTest\": \"[2.0.0, )\",\n          \"FluentAssertions\": \"[7.2.1, )\",\n          \"FluentAssertions.Analyzers\": \"[0.34.1, )\",\n          \"MSTest.TestAdapter\": \"[4.2.1, )\",\n          \"MSTest.TestFramework\": \"[4.2.1, )\",\n          \"Microsoft.Build.Locator\": \"[1.11.2, )\",\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[5.3.0, )\",\n          \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": \"[5.3.0, )\",\n          \"Microsoft.CodeAnalysis.Workspaces.MSBuild\": \"[5.3.0, )\",\n          \"Microsoft.NET.Test.Sdk\": \"[18.4.0, )\",\n          \"NSubstitute\": \"[5.3.0, )\",\n          \"NuGet.Protocol\": \"[7.3.1, )\",\n          \"SonarAnalyzer.Core\": \"[10.26.0, )\",\n          \"altcover\": \"[9.0.102, )\"\n        }\n      },\n      \"sonaranalyzer.visualbasic\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": \"[1.3.2, )\",\n          \"SonarAnalyzer.Core\": \"[10.26.0, )\",\n          \"SonarAnalyzer.VisualBasic.Core\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.visualbasic.core\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": \"[1.3.2, )\",\n          \"SonarAnalyzer.CFG\": \"[10.26.0, )\",\n          \"SonarAnalyzer.Core\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Analyzers/DummyAnalyzer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.AnalysisContext;\nusing CS = Microsoft.CodeAnalysis.CSharp;\nusing VB = Microsoft.CodeAnalysis.VisualBasic;\n\nnamespace SonarAnalyzer.TestFramework.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class DummyAnalyzerCS : DummyAnalyzer<CS.SyntaxKind>\n{\n    protected override CS.SyntaxKind NumericLiteralExpression => CS.SyntaxKind.NumericLiteralExpression;\n}\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class DummyAnalyzerThatThrowsCS : DummyAnalyzerThatThrows<CS.SyntaxKind>\n{\n    protected override CS.SyntaxKind NumericLiteralExpression => CS.SyntaxKind.NumericLiteralExpression;\n}\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic class DummyAnalyzerVB : DummyAnalyzer<VB.SyntaxKind>\n{\n    protected override VB.SyntaxKind NumericLiteralExpression => VB.SyntaxKind.NumericLiteralExpression;\n}\n\npublic abstract class DummyAnalyzer<TSyntaxKind> : SonarDiagnosticAnalyzer where TSyntaxKind : struct\n{\n    private readonly DiagnosticDescriptor rule = AnalysisScaffolding.CreateDescriptorMain(\"SDummy\");\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(rule);\n    public int DummyProperty { get; set; }\n\n    protected abstract TSyntaxKind NumericLiteralExpression { get; }\n\n    protected sealed override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(TestGeneratedCodeRecognizer.Instance, c => c.ReportIssue(rule, c.Node), NumericLiteralExpression);\n}\n\npublic abstract class DummyAnalyzerThatThrows<TSyntaxKind> : SonarDiagnosticAnalyzer where TSyntaxKind : struct\n{\n    private readonly DiagnosticDescriptor rule = AnalysisScaffolding.CreateDescriptorMain(\"SDummyThatThrows\");\n\n    protected abstract TSyntaxKind NumericLiteralExpression { get; }\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => [rule];\n\n    protected sealed override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(TestGeneratedCodeRecognizer.Instance, c => throw new NotSupportedException(), NumericLiteralExpression);\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Analyzers/DummyAnalyzerWithLocation.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing SonarAnalyzer.Core.AnalysisContext;\nusing SonarAnalyzer.Core.Syntax.Extensions;\n\nnamespace SonarAnalyzer.TestFramework.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class DummyAnalyzerWithLocation : SonarDiagnosticAnalyzer\n{\n    private readonly DiagnosticDescriptor rule;\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(rule);\n\n    public DummyAnalyzerWithLocation() : this(\"DummyWithLocation\", DiagnosticDescriptorFactory.MainSourceScopeTag) { }\n\n    public DummyAnalyzerWithLocation(string id, params string[] customTags) =>\n        rule = AnalysisScaffolding.CreateDescriptor(id, customTags);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(TestGeneratedCodeRecognizer.Instance, ReportIssue, SyntaxKind.InvocationExpression);\n\n    private void ReportIssue(SonarSyntaxNodeReportingContext context)\n    {\n        if (context.Node is InvocationExpressionSyntax invocation\n            && invocation.Expression is IdentifierNameSyntax { Identifier.ValueText: \"RaiseHere\" } identifier)\n        {\n            context.ReportIssue(rule, identifier.GetLocation(), invocation.ArgumentList.Arguments.Select(x => x.ToSecondaryLocation()));\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Analyzers/DummyCodeFix.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing SonarAnalyzer.Core.AnalysisContext;\nusing CS = Microsoft.CodeAnalysis.CSharp;\nusing VB = Microsoft.CodeAnalysis.VisualBasic;\n\nnamespace SonarAnalyzer.TestFramework.Analyzers;\n\n[ExportCodeFixProvider(LanguageNames.CSharp)]\npublic class DummyCodeFixCS : DummyCodeFix\n{\n    protected override SyntaxNode NewNode() => CS.SyntaxFactory.LiteralExpression(CS.SyntaxKind.DefaultLiteralExpression);\n}\n\n[ExportCodeFixProvider(LanguageNames.VisualBasic)]\npublic class DummyCodeFixVB : DummyCodeFix\n{\n    protected override SyntaxNode NewNode() => VB.SyntaxFactory.NothingLiteralExpression(VB.SyntaxFactory.Token(VB.SyntaxKind.NothingKeyword));\n}\n\npublic abstract class DummyCodeFix : SonarCodeFix\n{\n    protected abstract SyntaxNode NewNode();\n\n    public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(\"SDummy\");\n\n    protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n    {\n        context.RegisterCodeFix(\"Dummy Action\", _ =>\n        {\n            var oldNode = root.FindNode(context.Diagnostics.Single().Location.SourceSpan);\n            var newRoot = root.ReplaceNode(oldNode, NewNode().WithTriviaFrom(oldNode));\n            return Task.FromResult(context.Document.WithSyntaxRoot(newRoot));\n        }, context.Diagnostics);\n        return Task.CompletedTask;\n    }\n}\n\ninternal class DummyCodeFixNoAttribute : DummyCodeFix\n{\n    protected override SyntaxNode NewNode() => throw new NotSupportedException();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Analyzers/DummyUtilityAnalyzer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Google.Protobuf;\nusing SonarAnalyzer.Core.AnalysisContext;\nusing SonarAnalyzer.Core.Rules;\n\nnamespace SonarAnalyzer.TestFramework.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\ninternal class DummyUtilityAnalyzerCS : DummyUtilityAnalyzer\n{\n    public DummyUtilityAnalyzerCS(string protobufPath, IMessage message) : base(protobufPath, message) { }\n}\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\ninternal class DummyUtilityAnalyzerVB : DummyUtilityAnalyzer\n{\n    public DummyUtilityAnalyzerVB(string protobufPath, IMessage message) : base(protobufPath, message) { }\n}\n\ninternal abstract class DummyUtilityAnalyzer : UtilityAnalyzerBase\n{\n    private readonly string protobufPath;\n    private readonly IMessage message;\n\n    protected DummyUtilityAnalyzer(string protobufPath, IMessage message) : base(\"SDummyUtility\", \"Dummy title\")\n    {\n        this.protobufPath = protobufPath;\n        this.message = message;\n    }\n\n    protected sealed override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterCompilationAction(c =>\n        {\n            using var output = File.Create(protobufPath);\n            message?.WriteDelimitedTo(output);\n        });\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Analyzers/TestAnalyzer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.AnalysisContext;\nusing SonarAnalyzer.Core.Syntax.Utilities;\n\nnamespace SonarAnalyzer.TestFramework.Analyzers;\n\npublic abstract class TestAnalyzer : SonarDiagnosticAnalyzer\n{\n    public static readonly DiagnosticDescriptor Rule = AnalysisScaffolding.CreateDescriptorMain(\"STestAnalyzer\");\n    protected abstract GeneratedCodeRecognizer GeneratedCodeRecognizer { get; }\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => [Rule];\n}\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class TestAnalyzerCS : TestAnalyzer\n{\n    private readonly Action<SonarAnalysisContext, GeneratedCodeRecognizer> initializeAction;\n\n    protected override GeneratedCodeRecognizer GeneratedCodeRecognizer => TestGeneratedCodeRecognizer.Instance;\n\n    public TestAnalyzerCS(Action<SonarAnalysisContext, GeneratedCodeRecognizer> action) =>\n        initializeAction = action;\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        initializeAction(context, GeneratedCodeRecognizer);\n}\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic class TestAnalyzerVB : TestAnalyzer\n{\n    private readonly Action<SonarAnalysisContext, GeneratedCodeRecognizer> initializeAction;\n\n    protected override GeneratedCodeRecognizer GeneratedCodeRecognizer => TestGeneratedCodeRecognizer.Instance;\n\n    public TestAnalyzerVB(Action<SonarAnalysisContext, GeneratedCodeRecognizer> action) =>\n        initializeAction = action;\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        initializeAction(context, GeneratedCodeRecognizer);\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Analyzers/TestGeneratedCodeRecognizer.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Syntax.Utilities;\nusing CS = Microsoft.CodeAnalysis.CSharp;\nusing VB = Microsoft.CodeAnalysis.VisualBasic;\n\nnamespace SonarAnalyzer.TestFramework.Analyzers;\n\npublic sealed class TestGeneratedCodeRecognizer : GeneratedCodeRecognizer\n{\n    public static TestGeneratedCodeRecognizer Instance { get; } = new();\n\n    protected override bool IsTriviaComment(SyntaxTrivia trivia) =>\n        trivia.IsKind(CS.SyntaxKind.SingleLineCommentTrivia)\n        || trivia.IsKind(CS.SyntaxKind.MultiLineCommentTrivia)\n        || trivia.IsKind(VB.SyntaxKind.CommentTrivia);\n\n    protected override string GetAttributeName(SyntaxNode node)\n    {\n        if (node.IsKind(CS.SyntaxKind.Attribute))\n        {\n            return ((CS.Syntax.AttributeSyntax)node).Name.ToString();\n        }\n        else if (node.IsKind(VB.SyntaxKind.Attribute))\n        {\n            return ((VB.Syntax.AttributeSyntax)node).Name.ToString();\n        }\n        else\n        {\n            return string.Empty;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Build/LanguageOptions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing static Microsoft.CodeAnalysis.CSharp.LanguageVersion;\nusing static Microsoft.CodeAnalysis.VisualBasic.LanguageVersion;\nusing CS = Microsoft.CodeAnalysis.CSharp;\nusing VB = Microsoft.CodeAnalysis.VisualBasic;\n\nnamespace SonarAnalyzer.TestFramework.Build;\n\n/// <summary>\n/// Returned values depend on the build environment.\n/// Local run: Only the latest language version is used to simplify debugging.\n/// CI run: All configured versions are returned.\n/// </summary>\npublic static class LanguageOptions\n{\n    private static readonly ImmutableArray<ParseOptions> DefaultParseOptions;\n\n    public static ImmutableArray<ParseOptions> BeforeCSharp7 { get; }\n    public static ImmutableArray<ParseOptions> BeforeCSharp8 { get; }\n    public static ImmutableArray<ParseOptions> BeforeCSharp9 { get; }\n    public static ImmutableArray<ParseOptions> BeforeCSharp10 { get; }\n    public static ImmutableArray<ParseOptions> BeforeCSharp11 { get; }\n    public static ImmutableArray<ParseOptions> BeforeCSharp12 { get; }\n    public static ImmutableArray<ParseOptions> BeforeCSharp13 { get; }\n    public static ImmutableArray<ParseOptions> BeforeCSharp14 { get; }\n\n    public static ImmutableArray<ParseOptions> FromCSharp6 { get; }\n    public static ImmutableArray<ParseOptions> FromCSharp7 { get; }\n    public static ImmutableArray<ParseOptions> FromCSharp8 { get; }\n    public static ImmutableArray<ParseOptions> FromCSharp9 { get; }\n    public static ImmutableArray<ParseOptions> FromCSharp10 { get; }\n    public static ImmutableArray<ParseOptions> FromCSharp11 { get; }\n    public static ImmutableArray<ParseOptions> FromCSharp12 { get; }\n    public static ImmutableArray<ParseOptions> FromCSharp13 { get; }\n    public static ImmutableArray<ParseOptions> FromCSharp14 { get; }\n    public static ImmutableArray<ParseOptions> CSharpPreview { get; }\n\n    public static ImmutableArray<ParseOptions> CSharpLatest { get; }\n    public static ImmutableArray<ParseOptions> VisualBasicLatest { get; }\n\n    public static ImmutableArray<ParseOptions> OnlyCSharp7 { get; }\n\n    public static ImmutableArray<ParseOptions> FromVisualBasic12 { get; }\n    public static ImmutableArray<ParseOptions> FromVisualBasic14 { get; }\n    public static ImmutableArray<ParseOptions> FromVisualBasic15 { get; }\n\n#pragma warning disable S3963 // The static fields are dependent between them so the values cannot be set inline\n\n    static LanguageOptions()\n    {\n        var cs13 = CreateOptions(CSharp13);\n        var cs12 = CreateOptions(CSharp12);\n        var cs11 = CreateOptions(CSharp11);\n        var cs10 = CreateOptions(CSharp10);\n        var cs9 = CreateOptions(CSharp9);\n        var cs8 = CreateOptions(CSharp8);\n        var cs7 = CreateOptions(CSharp7, CSharp7_1, CSharp7_2, CSharp7_3);\n        var vb15 = CreateOptions(VisualBasic15, VisualBasic15_3, VisualBasic15_5);\n\n        BeforeCSharp7 = CreateOptions(CSharp5).Concat(CreateOptions(CSharp6)).FilterByEnvironment();\n        BeforeCSharp8 = BeforeCSharp7.Concat(cs7).FilterByEnvironment();\n        BeforeCSharp9 = BeforeCSharp8.Concat(cs8).FilterByEnvironment();\n        BeforeCSharp10 = BeforeCSharp9.Concat(cs9).FilterByEnvironment();\n        BeforeCSharp11 = BeforeCSharp10.Concat(cs10).FilterByEnvironment();\n        BeforeCSharp12 = BeforeCSharp11.Concat(cs11).FilterByEnvironment();\n        BeforeCSharp13 = BeforeCSharp12.Concat(cs12).FilterByEnvironment();\n        BeforeCSharp14 = BeforeCSharp13.Concat(cs13).FilterByEnvironment();\n\n        FromCSharp14 = CreateOptions(CSharp14).FilterByEnvironment();\n        FromCSharp13 = cs13.Concat(FromCSharp14).FilterByEnvironment();\n        FromCSharp12 = cs12.Concat(FromCSharp13).FilterByEnvironment();\n        FromCSharp11 = cs11.Concat(FromCSharp12).FilterByEnvironment();\n        FromCSharp10 = cs10.Concat(FromCSharp11).FilterByEnvironment();\n        FromCSharp9 = cs9.Concat(FromCSharp10).FilterByEnvironment();\n        FromCSharp8 = cs8.Concat(FromCSharp9).FilterByEnvironment();\n        FromCSharp7 = cs7.Concat(FromCSharp8).FilterByEnvironment();\n        FromCSharp6 = CreateOptions(CSharp6).Concat(FromCSharp7).FilterByEnvironment();\n\n        OnlyCSharp7 = cs7.FilterByEnvironment();\n\n        FromVisualBasic15 = vb15.Concat(CreateOptions(VisualBasic16)).FilterByEnvironment();\n        FromVisualBasic14 = CreateOptions(VisualBasic14).Concat(FromVisualBasic15).FilterByEnvironment();\n        FromVisualBasic12 = CreateOptions(VisualBasic12).Concat(FromVisualBasic14).FilterByEnvironment();\n\n        DefaultParseOptions = FromCSharp7.Concat(FromVisualBasic12).ToImmutableArray(); // Values depends on the build environment\n        CSharpPreview = CreateOptions(Preview).ToImmutableArray();\n        CSharpLatest = CreateOptions(CS.LanguageVersion.Latest).ToImmutableArray();\n        VisualBasicLatest = CreateOptions(VB.LanguageVersion.Latest).ToImmutableArray();\n    }\n#pragma warning restore S3963\n\n    public static IEnumerable<ParseOptions> OrDefault(this IEnumerable<ParseOptions> parseOptions, string language) =>\n        parseOptions is not null && parseOptions.Any() ? parseOptions : Default(language);\n\n    public static IEnumerable<ParseOptions> Default(string language) =>\n        DefaultParseOptions.Where(x => x.Language == language);\n\n    public static ImmutableArray<ParseOptions> Between(CS.LanguageVersion from, CS.LanguageVersion to)\n    {\n        var versions = Between<CS.LanguageVersion>(from, to);\n        return CreateOptions(versions).FilterByEnvironment();\n    }\n\n    public static ImmutableArray<ParseOptions> Between(VB.LanguageVersion from, VB.LanguageVersion to)\n    {\n        var versions = Between<VB.LanguageVersion>(from, to);\n        return CreateOptions(versions).FilterByEnvironment();\n    }\n\n    public static ImmutableArray<ParseOptions> Latest(AnalyzerLanguage language) =>\n        language.LanguageName switch\n        {\n            LanguageNames.CSharp => CSharpLatest,\n            LanguageNames.VisualBasic => VisualBasicLatest,\n            _ => throw new UnexpectedLanguageException(language)\n        };\n\n    private static ImmutableArray<ParseOptions> FilterByEnvironment(this IEnumerable<ParseOptions> options) =>\n        TestEnvironment.IsAzureDevOpsContext && !TestEnvironment.IsPullRequestBuild\n            ? options.ToImmutableArray()\n            : [options.First()]; // Use only the oldest version for local test run and debug\n\n    private static IEnumerable<ParseOptions> CreateOptions(params CS.LanguageVersion[] options) =>\n        options.Select(x => new CS.CSharpParseOptions(x));\n\n    private static IEnumerable<ParseOptions> CreateOptions(params VB.LanguageVersion[] options) =>\n        options.Select(x => new VB.VisualBasicParseOptions(x));\n\n    private static T[] Between<T>(T from, T to) where T : struct, Enum\n    {\n        var comparer = Comparer<T>.Default;\n\n        // Enum comparison is based on the documented numeric ordering. See:\n        // https://learn.microsoft.com/en-us/dotnet/api/microsoft.codeanalysis.csharp.languageversion\n        // https://learn.microsoft.com/en-us/dotnet/api/microsoft.codeanalysis.visualbasic.languageversion\n        return Enum.GetValues(typeof(T))\n            .Cast<T>()\n            .Where(x => comparer.Compare(x, from) >= 0 && comparer.Compare(x, to) <= 0)\n            .ToArray();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Build/ProjectBuilder.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text;\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.TestFramework.Build;\n\npublic readonly struct ProjectBuilder\n{\n    private readonly Lazy<SolutionBuilder> solution;\n    private readonly Project project;\n    private readonly string fileExtension;\n\n    public SolutionBuilder Solution => solution.Value;\n    public Project Project => project;\n\n    private ProjectBuilder(Project project)\n    {\n        this.project = project;\n        fileExtension = project.Language == LanguageNames.CSharp ? \".cs\" : \".vb\";\n        solution = new Lazy<SolutionBuilder>(() => SolutionBuilder.FromSolution(project.Solution));\n    }\n\n    public Compilation GetCompilation(ParseOptions parseOptions = null, CompilationOptions compilationOptions = null)\n    {\n        var projectWithOptions = parseOptions == null ? project : project.WithParseOptions(parseOptions);\n        var compilation = projectWithOptions.GetCompilationAsync().Result;\n        return compilationOptions == null ? compilation : compilation.WithOptions(compilationOptions);\n    }\n\n    public Document FindDocument(string name) =>\n        project.Documents.Single(d => d.Name == name);\n\n    public ProjectBuilder AddReferences(IEnumerable<MetadataReference> references)\n    {\n        if (references == null || !references.Any())\n        {\n            return this;\n        }\n        if (references.Any(x => x.Display.Contains(\"\\\\netstandard\")))\n        {\n            references = references.Concat(MetadataReferenceFacade.NetStandard);\n        }\n        var existingReferences = project.MetadataReferences.ToHashSet();\n        return FromProject(project.AddMetadataReferences(references.Distinct().Where(x => !existingReferences.Contains(x))));\n    }\n\n    public ProjectBuilder AddProjectReference(Func<SolutionBuilder, ProjectId> getProjectId) =>\n        FromProject(project.AddProjectReference(new ProjectReference(getProjectId(Solution))));\n\n    public ProjectBuilder AddDocuments(IEnumerable<string> paths) =>\n        paths.Aggregate(this, (projectBuilder, path) => projectBuilder.AddDocument(path));\n\n    public ProjectBuilder AddAdditionalDocuments(IEnumerable<string> paths) =>\n        paths.Aggregate(this, (projectBuilder, path) => projectBuilder.AddAdditionalDocument(path));\n\n    public ProjectBuilder AddDocument(string path) =>\n        AddDocument(project, GetTestCaseFileRelativePath(path), File.ReadAllText(path, Encoding.UTF8));\n\n    public ProjectBuilder AddAdditionalDocument(string path) =>\n        AddAdditionalDocument(project, GetTestCaseFileRelativePath(path), File.ReadAllText(path, Encoding.UTF8));\n\n    public ProjectBuilder AddSnippets(params string[] snippets) =>\n        snippets.Aggregate(this, (current, snippet) => current.AddSnippet(snippet));\n\n    public ProjectBuilder AddSnippets(IEnumerable<Snippet> snippets) =>\n        snippets.Aggregate(this, (current, snippet) => current.AddSnippet(snippet.Content, snippet.FileName));\n\n    public ProjectBuilder AddSnippet(string code, string fileName = null)\n    {\n        _ = code ?? throw new ArgumentNullException(nameof(code));\n        fileName ??= $\"snippet{project.Documents.Count()}{fileExtension}\";\n        return AddDocument(project, fileName, code);\n    }\n\n    public ProjectBuilder AddAnalyzerReferences(IEnumerable<AnalyzerFileReference> sourceGenerators)\n    {\n        _ = sourceGenerators ?? throw new ArgumentNullException(nameof(sourceGenerators));\n        return FromProject(project.WithAnalyzerReferences(sourceGenerators));\n    }\n\n    public static ProjectBuilder FromProject(Project project) =>\n        new(project);\n\n    private string GetTestCaseFileRelativePath(string path)\n    {\n        var testCases = $\"TestCases{Path.DirectorySeparatorChar}\";\n        _ = path ?? throw new ArgumentNullException(nameof(path));\n        var fileInfo = new FileInfo(path);\n        var testCasesIndex = fileInfo.FullName.IndexOf(testCases, StringComparison.Ordinal);\n        var relativePathFromTestCases = testCasesIndex < 0\n            ? throw new ArgumentException($\"{nameof(path)} must contain '{testCases}'\", nameof(path))\n            : fileInfo.FullName.Substring(testCasesIndex + testCases.Length);\n\n        if (!IsExtensionOfSupportedType(fileInfo))\n        {\n            throw new ArgumentException($\"The file extension '{fileInfo.Extension}' does not match the project language '{project.Language}' nor Razor.\", nameof(path));\n        }\n\n        return relativePathFromTestCases;\n    }\n\n    private bool IsExtensionOfSupportedType(FileInfo fileInfo) =>\n        fileInfo.Extension.Equals(fileExtension, StringComparison.OrdinalIgnoreCase)\n        || (fileInfo.Extension.Equals(\".razor\", StringComparison.OrdinalIgnoreCase) && project.Language == LanguageNames.CSharp)\n        || (fileInfo.Extension.Equals(\".cshtml\", StringComparison.OrdinalIgnoreCase) && project.Language == LanguageNames.CSharp);\n\n    private static ProjectBuilder AddDocument(Project project, string fileName, string fileContent) =>\n        FromProject(project.AddDocument(fileName, fileContent).Project);\n\n    private static ProjectBuilder AddAdditionalDocument(Project project, string fileName, string fileContent) =>\n        FromProject(project.AddAdditionalDocument(Path.Combine(Directory.GetCurrentDirectory(), \"TestCases\", fileName), fileContent).Project);\n\n    public ProjectBuilder AddAnalyzerConfigDocument(string editorConfigPath, string content) =>\n        FromProject(project.AddAnalyzerConfigDocument(editorConfigPath, SourceText.From(content), filePath: editorConfigPath).Project);\n}\n\npublic record Snippet(string Content, string FileName);\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Build/SnippetCompiler.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Reflection;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.VisualBasic;\nusing SonarAnalyzer.Core.AnalysisContext;\nusing CS = Microsoft.CodeAnalysis.CSharp.Syntax;\nusing VB = Microsoft.CodeAnalysis.VisualBasic.Syntax;\n\nnamespace SonarAnalyzer.TestFramework.Build;\n\npublic class SnippetCompiler\n{\n    public Compilation Compilation { get; }\n    public SyntaxTree Tree { get; }\n    public SemanticModel Model { get; }\n\n    public SnippetCompiler(string code, params MetadataReference[] additionalReferences) : this(code, false, AnalyzerLanguage.CSharp, additionalReferences) { }\n\n    public SnippetCompiler(string code, IEnumerable<MetadataReference> additionalReferences) : this(code, false, AnalyzerLanguage.CSharp, additionalReferences) { }\n\n    public SnippetCompiler(string code, bool ignoreErrors, AnalyzerLanguage language, IEnumerable<MetadataReference> additionalReferences = null, OutputKind outputKind = OutputKind.DynamicallyLinkedLibrary, ParseOptions parseOptions = null)\n    {\n        Compilation = SolutionBuilder\n            .Create()\n            .AddProject(language, outputKind)\n            .AddSnippet(code)\n            .AddReferences(additionalReferences ?? [])\n            .GetCompilation(parseOptions);\n\n        if (!ignoreErrors && HasCompilationErrors(Compilation))\n        {\n            DumpCompilationErrors(Compilation);\n            throw new InvalidOperationException(\"Test setup error: test code snippet did not compile. See output window for details.\");\n        }\n\n        Tree = Compilation.SyntaxTrees.First();\n        Model = Compilation.GetSemanticModel(Tree);\n    }\n\n    public bool IsCSharp() =>\n        Compilation.Language == LanguageNames.CSharp;\n\n    public IEnumerable<TSyntaxNodeType> Nodes<TSyntaxNodeType>() where TSyntaxNodeType : SyntaxNode =>\n        Tree.GetRoot().DescendantNodes().OfType<TSyntaxNodeType>();\n\n    public TSymbolType Symbol<TSymbolType>(SyntaxNode node) where TSymbolType : class, ISymbol =>\n        Model.GetSymbolInfo(node).Symbol as TSymbolType;\n\n    public SyntaxNode MethodDeclaration(string typeDotMethodName)\n    {\n        var nameParts = typeDotMethodName.Split('.');\n        SyntaxNode method = null;\n\n        if (IsCSharp())\n        {\n            var type = Nodes<CS.TypeDeclarationSyntax>().First(x => x.Identifier.ValueText == nameParts[0]);\n            method = type.DescendantNodes().OfType<CS.MethodDeclarationSyntax>().First(x => x.Identifier.ValueText == nameParts[1]);\n        }\n        else\n        {\n            var type = Nodes<VB.TypeStatementSyntax>().First(x => x.Identifier.ValueText == nameParts[0]);\n            method = type.Parent.DescendantNodes().OfType<VB.MethodStatementSyntax>().First(x => x.Identifier.ValueText == nameParts[1]);\n        }\n\n        method.Should().NotBeNull(\"Test setup error: could not find method declaration in code snippet: Type: {nameParts[0]}, Method: {nameParts[1]}\");\n        return method;\n    }\n\n    public INamespaceSymbol NamespaceSymbol(string name)\n    {\n        var symbol = Nodes<CS.BaseNamespaceDeclarationSyntax>()\n            .Concat<SyntaxNode>(Nodes<VB.NamespaceStatementSyntax>())\n            .Select(x => Model.GetDeclaredSymbol(x))\n            .First(x => x.Name == name) as INamespaceSymbol;\n\n        symbol.Should().NotBeNull($\"Test setup error: could not find namespace in code snippet: {name}\");\n        return symbol;\n    }\n\n    public IEnumerable<T> DeclaredSymbols<T>() where T : ISymbol\n    {\n        var indentifierKind = IsCSharp() ? (int)Microsoft.CodeAnalysis.CSharp.SyntaxKind.IdentifierToken : (int)Microsoft.CodeAnalysis.VisualBasic.SyntaxKind.IdentifierToken;\n        var identfierTokens = Tree.GetRoot().DescendantTokens().Where(x => x.RawKind == indentifierKind).ToList();\n        var symbols = identfierTokens.Select(x => Model.GetDeclaredSymbol(x.Parent)).OfType<T>().ToList();\n        symbols.Should().NotBeEmpty(\"Test setup error: could not find any symbols of the expected kind in code snippet.\");\n        return symbols;\n    }\n\n    public ISymbol DeclaredSymbol(string name) =>\n        DeclaredSymbols<ISymbol>().Should().ContainSingle(x => x.Name == name).Subject;\n\n    public T DeclaredSymbol<T>(string name) where T : ISymbol =>\n        DeclaredSymbols<T>().Should().ContainSingle(x => x.Name == name).Subject;\n\n    public IMethodSymbol MethodSymbol(string typeDotMethodName)\n    {\n        var method = MethodDeclaration(typeDotMethodName);\n        return Model.GetDeclaredSymbol(method) as IMethodSymbol;\n    }\n\n    public IPropertySymbol PropertySymbol(string typeDotPropertyName)\n    {\n        var nameParts = typeDotPropertyName.Split('.');\n        SyntaxNode property = null;\n\n        if (IsCSharp())\n        {\n            var type = Tree.GetRoot().DescendantNodes().OfType<CS.TypeDeclarationSyntax>().First(x => x.Identifier.ValueText == nameParts[0]);\n            property = type.DescendantNodes().OfType<CS.PropertyDeclarationSyntax>().First(x => x.Identifier.ValueText == nameParts[1]);\n        }\n        else\n        {\n            var type = Tree.GetRoot().DescendantNodes().OfType<VB.TypeStatementSyntax>().First(x => x.Identifier.ValueText == nameParts[0]);\n            property = type.DescendantNodes().OfType<VB.PropertyStatementSyntax>().First(x => x.Identifier.ValueText == nameParts[1]);\n        }\n\n        var symbol = Model.GetDeclaredSymbol(property) as IPropertySymbol;\n        symbol.Should().NotBeNull(\"Test setup error: could not find property in code snippet: Type: {nameParts[0]}, Method: {nameParts[1]}\");\n        return symbol;\n    }\n\n    public INamedTypeSymbol TypeByMetadataName(string metadataName) =>\n        Model.Compilation.GetTypeByMetadataName(metadataName);\n\n    public SonarSyntaxNodeReportingContext CreateAnalysisContext(SyntaxNode node)\n    {\n        var nodeContext = new SyntaxNodeAnalysisContext(node, Model, null, null, null, default);\n        return new(AnalysisScaffolding.CreateSonarAnalysisContext(), nodeContext);\n    }\n\n    public Assembly EmitAssembly()\n    {\n        using var memoryStream = new MemoryStream();\n        Compilation.Emit(memoryStream).Success.Should().BeTrue(\"The provided snippet should emit assembly.\");\n        return Assembly.Load(memoryStream.ToArray());\n    }\n\n    private static bool HasCompilationErrors(Compilation compilation) =>\n        compilation.GetDiagnostics().Any(IsCompilationError);\n\n    private static bool IsCompilationError(Diagnostic diagnostic) =>\n        diagnostic.Severity == DiagnosticSeverity.Error && (diagnostic.Id.StartsWith(\"CS\") || diagnostic.Id.StartsWith(\"BC\"));\n\n    private static void DumpCompilationErrors(Compilation compilation)\n    {\n        Console.WriteLine(\"Diagnostic errors:\");\n        foreach (var d in compilation.GetDiagnostics().Where(IsCompilationError))\n        {\n            Console.WriteLine($\"  {d.Id} Line: {d.Location.GetMappedLineSpan().StartLinePosition.Line}: {d.GetMessage()}\");\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Build/SolutionBuilder.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.VisualBasic;\n\nnamespace SonarAnalyzer.TestFramework.Build;\n\npublic readonly struct SolutionBuilder\n{\n    private const string GeneratedAssemblyName = \"project\";\n\n    private static readonly IEnumerable<GlobalImport> DefaultGlobalImportsVisualBasic = GlobalImport.Parse(\n        \"Microsoft.VisualBasic\",\n        \"System\",\n        \"System.Collections\",\n        \"System.Collections.Generic\",\n        \"System.Data\",\n        \"System.Diagnostics\",\n        \"System.Linq\",\n        \"System.Xml.Linq\",\n        \"System.Threading.Tasks\");\n    private readonly Solution solution;\n\n    public IReadOnlyList<ProjectId> ProjectIds => solution.ProjectIds;\n\n    private SolutionBuilder(Solution solution) =>\n        this.solution = solution;\n\n    public ProjectBuilder AddProject(AnalyzerLanguage language, OutputKind outputKind = OutputKind.DynamicallyLinkedLibrary) =>\n        AddProject(language, $\"{GeneratedAssemblyName}{ProjectIds.Count}\", outputKind);\n\n    public static SolutionBuilder Create() =>\n        FromSolution(new AdhocWorkspace().CurrentSolution);\n\n    public static SolutionBuilder CreateSolutionFromPath(string path, OutputKind outputKind = OutputKind.DynamicallyLinkedLibrary, IEnumerable<MetadataReference> additionalReferences = null) =>\n        Create()\n            .AddProject(AnalyzerLanguage.FromPath(path), outputKind: outputKind)\n            .AddDocument(path)\n            .AddReferences(additionalReferences)\n            .Solution;\n\n    public static SolutionBuilder FromSolution(Solution solution) =>\n        new(solution);\n\n    public ImmutableArray<Compilation> Compile(params ParseOptions[] parseOptions) =>\n        solution.Projects.SelectMany(x => Compile(x, parseOptions)).ToImmutableArray();\n\n    private static IEnumerable<Compilation> Compile(Project project, ParseOptions[] parseOptions) =>\n        parseOptions.OrDefault(project.Language).Select(x => project.WithParseOptions(x).GetCompilationAsync().Result);\n\n    private ProjectBuilder AddProject(AnalyzerLanguage language, string projectName, OutputKind outputKind = OutputKind.DynamicallyLinkedLibrary)\n    {\n        var project = solution.AddProject(projectName, projectName, language.LanguageName);\n        var compilationOptions = project.CompilationOptions.WithOutputKind(outputKind);\n        compilationOptions = language.LanguageName switch\n        {\n            LanguageNames.CSharp => ((CSharpCompilationOptions)compilationOptions).WithAllowUnsafe(true),\n            LanguageNames.VisualBasic => ((VisualBasicCompilationOptions)compilationOptions).WithGlobalImports(DefaultGlobalImportsVisualBasic),\n            _ => throw new UnexpectedLanguageException(language)\n        };\n        project = project.WithCompilationOptions(compilationOptions);\n\n        var projectBuilder = ProjectBuilder.FromProject(project).AddReferences(MetadataReferenceFacade.ProjectDefaultReferences);\n        return language == AnalyzerLanguage.VisualBasic\n            ? projectBuilder.AddReferences(MetadataReferenceFacade.MicrosoftVisualBasic)\n            : projectBuilder;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Common/AnalysisScaffolding.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Xml.Linq;\nusing Microsoft.CodeAnalysis.Text;\nusing NSubstitute;\nusing SonarAnalyzer.Core.AnalysisContext;\nusing SonarAnalyzer.Core.Configuration;\nusing RoslynAnalysisContext = Microsoft.CodeAnalysis.Diagnostics.AnalysisContext;\n\nnamespace SonarAnalyzer.TestFramework.Common;\n\npublic static class AnalysisScaffolding\n{\n    public static SonarAnalysisContext CreateSonarAnalysisContext() =>\n        new(Substitute.For<RoslynAnalysisContext>(), []);\n\n    public static AnalyzerOptions CreateOptions() =>\n        new([]);\n\n    public static AnalyzerOptions CreateOptions(string relativePath)\n    {\n        var text = File.Exists(relativePath) ? SourceText.From(File.ReadAllText(relativePath)) : null;\n        return CreateOptions(relativePath, text);\n    }\n\n    public static AnalyzerOptions CreateOptions(string relativePath, SourceText text)\n    {\n        var additionalText = Substitute.For<AdditionalText>();\n        additionalText.Path.Returns(relativePath);\n        additionalText.GetText(default).Returns(text);\n        return new AnalyzerOptions(ImmutableArray.Create(additionalText));\n    }\n\n    public static DiagnosticDescriptor CreateDescriptorMain(string id = \"Sxxxx\") =>\n        CreateDescriptor(id, DiagnosticDescriptorFactory.MainSourceScopeTag);\n\n    public static DiagnosticDescriptor CreateDescriptor(string id, params string[] customTags) =>\n        new(id, \"Title\", \"Message for \" + id, \"Category\", DiagnosticSeverity.Warning, true, customTags: customTags);\n\n    public static string CreateAnalysisConfig(TestContext context, IEnumerable<string> unchangedFiles) =>\n        CreateAnalysisConfig(context, \"UnchangedFilesPath\", TestFiles.WriteFile(context, \"UnchangedFiles.txt\", unchangedFiles.JoinStr(Environment.NewLine)));\n\n    public static string CreateAnalysisConfig(TestContext context, string settingsId, string settingValue, string sonarQubeVersion = null) =>\n        TestFiles.WriteFile(context, \"SonarQubeAnalysisConfig.xml\", $\"\"\"\n            <?xml version=\"1.0\" encoding=\"utf-8\"?>\n            <AnalysisConfig xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://www.sonarsource.com/msbuild/integration/2015/1\">\n                <SonarQubeVersion>{sonarQubeVersion}</SonarQubeVersion>\n                <AdditionalConfig>\n                    <ConfigSetting Id=\"{settingsId}\" Value=\"{settingValue}\" />\n                </AdditionalConfig>\n            </AnalysisConfig>\n            \"\"\");\n\n    public static string CreateSonarProjectConfigWithFilesToAnalyze(TestContext context, params string[] filesToAnalyze)\n    {\n        var filesToAnalyzePath = TestFiles.TestPath(context, \"FilesToAnalyze.txt\");\n        File.WriteAllLines(filesToAnalyzePath, filesToAnalyze);\n        return CreateSonarProjectConfig(context, \"FilesToAnalyzePath\", filesToAnalyzePath, true);\n    }\n\n    public static string CreateSonarProjectConfigWithUnchangedFiles(TestContext context, params string[] unchangedFiles) =>\n        CreateSonarProjectConfig(context, \"NotImportant\", null, true, CreateAnalysisConfig(context, unchangedFiles));\n\n    public static string CreateSonarProjectConfig(TestContext context, ProjectType projectType, bool isScannerRun = true) =>\n        CreateSonarProjectConfig(context, \"ProjectType\", projectType.ToString(), isScannerRun);\n\n    public static string CreateSonarLintXml(\n        TestContext context,\n        string language = LanguageNames.CSharp,\n        bool analyzeGeneratedCode = false,\n        bool ignoreHeaderComments = false,\n        string[] exclusions = null,\n        string[] inclusions = null,\n        string[] globalExclusions = null,\n        string[] testExclusions = null,\n        string[] testInclusions = null,\n        string[] globalTestExclusions = null,\n        List<SonarLintXmlRule> rulesParameters = null,\n        bool analyzeRazorCode = true) =>\n        TestFiles.WriteFile(context, \"SonarLint.xml\", GenerateSonarLintXmlContent(language, analyzeGeneratedCode, ignoreHeaderComments, exclusions, inclusions, globalExclusions, testExclusions, testInclusions, globalTestExclusions, rulesParameters, analyzeRazorCode));\n\n    public static string GenerateSonarLintXmlContent(\n        string language = LanguageNames.CSharp,\n        bool analyzeGeneratedCode = false,\n        bool ignoreHeaderComments = false,\n        string[] exclusions = null,\n        string[] inclusions = null,\n        string[] globalExclusions = null,\n        string[] testExclusions = null,\n        string[] testInclusions = null,\n        string[] globalTestExclusions = null,\n        List<SonarLintXmlRule> rulesParameters = null,\n        bool analyzeRazorCode = true) =>\n        new XDocument(\n            new XDeclaration(\"1.0\", \"utf-8\", \"yes\"),\n            new XElement(\"AnalysisInput\",\n                new XElement(\"Settings\",\n                    CreateSetting($\"sonar.{(language == LanguageNames.CSharp ? \"cs\" : \"vbnet\")}.analyzeGeneratedCode\", analyzeGeneratedCode.ToString()),\n                    CreateSetting($\"sonar.{(language == LanguageNames.CSharp ? \"cs\" : \"vbnet\")}.ignoreHeaderComments\", ignoreHeaderComments.ToString()),\n                    CreateSetting($\"sonar.{(language == LanguageNames.CSharp ? \"cs\" : \"vbnet\")}.analyzeRazorCode\", analyzeRazorCode.ToString()),\n                    CreateSetting(\"sonar.exclusions\", ConcatenateStringArray(exclusions)),\n                    CreateSetting(\"sonar.inclusions\", ConcatenateStringArray(inclusions)),\n                    CreateSetting(\"sonar.global.exclusions\", ConcatenateStringArray(globalExclusions)),\n                    CreateSetting(\"sonar.test.exclusions\", ConcatenateStringArray(testExclusions)),\n                    CreateSetting(\"sonar.test.inclusions\", ConcatenateStringArray(testInclusions)),\n                    CreateSetting(\"sonar.global.test.exclusions\", ConcatenateStringArray(globalTestExclusions))),\n                new XElement(\"Rules\", CreateRules(rulesParameters)))).ToString();\n\n    public static SonarSyntaxNodeReportingContext CreateNodeReportingContext(SyntaxNode node, SemanticModel model, Action<Diagnostic> reportIssue)\n    {\n        var options = CreateOptions();\n        var containingSymbol = Substitute.For<ISymbol>();\n        var context = new SyntaxNodeAnalysisContext(node, containingSymbol, model, options, reportIssue, _ => true, default);\n        return new SonarSyntaxNodeReportingContext(CreateSonarAnalysisContext(), context);\n    }\n\n    private static IEnumerable<XElement> CreateRules(List<SonarLintXmlRule> ruleParameters)\n    {\n        foreach (var rule in ruleParameters ?? new())\n        {\n            yield return CreateRule(rule);\n        }\n    }\n\n    private static XElement CreateRule(SonarLintXmlRule rule)\n    {\n        var elements = new List<XElement>();\n        foreach (var param in rule.Parameters)\n        {\n            elements.Add(CreateKeyValuePair(\"Parameter\", param.Key, param.Value));\n        }\n        return new(\"Rule\", new XElement(\"Key\", rule.Key), new XElement(\"Parameters\", elements));\n    }\n\n    private static XElement CreateSetting(string key, string value) =>\n        CreateKeyValuePair(\"Setting\", key, value);\n\n    private static XElement CreateKeyValuePair(string containerName, string key, string value) =>\n        new(containerName, new XElement(\"Key\", key), new XElement(\"Value\", value));\n\n    private static string ConcatenateStringArray(string[] array) =>\n        string.Join(\",\", array ?? []);\n\n    private static string CreateSonarProjectConfig(TestContext context, string element, string value, bool isScannerRun, string analysisConfigPath = null)\n    {\n        var sonarProjectConfigPath = TestFiles.TestPath(context, \"SonarProjectConfig.xml\");\n        var outPath = isScannerRun ? Path.GetDirectoryName(sonarProjectConfigPath) : null;\n        analysisConfigPath ??= CreateAnalysisConfig(context, \"NotImportant\", null);\n        var projectConfigContent = $\"\"\"\n            <SonarProjectConfig xmlns=\"http://www.sonarsource.com/msbuild/analyzer/2021/1\">\n                <AnalysisConfigPath>{analysisConfigPath}</AnalysisConfigPath>\n                <ProjectPath>c:\\Project\\Fake.proj</ProjectPath>\n                <OutPath>{outPath}</OutPath>\n                <{element}>{value}</{element}>\n                <TargetFramework>netstandard2.0</TargetFramework>\n            </SonarProjectConfig>\n            \"\"\";\n        File.WriteAllText(sonarProjectConfigPath, projectConfigContent);\n        return sonarProjectConfigPath;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Common/AssertIgnoreScope.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.TestFramework.Common;\n\n/// <summary>\n/// Some of the tests cover exceptions in which we have asserts as well, we want to ignore those asserts during tests.\n/// </summary>\npublic sealed class AssertIgnoreScope : IDisposable\n{\n    private readonly DefaultTraceListener listener;\n\n    public AssertIgnoreScope()\n    {\n        listener = Trace.Listeners.OfType<DefaultTraceListener>().FirstOrDefault();\n        Trace.Listeners.Remove(listener);\n    }\n\n    public void Dispose() =>\n        Trace.Listeners.Add(listener);\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Common/CurrentCultureScope.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Globalization;\n\nnamespace SonarAnalyzer.TestFramework.Common;\n\npublic sealed class CurrentCultureScope : IDisposable\n{\n    private readonly CultureInfo oldCulture;\n    private readonly CultureInfo oldUiCulture;\n\n    public CurrentCultureScope() : this(CultureInfo.InvariantCulture) { }\n\n    public CurrentCultureScope(CultureInfo culture)\n    {\n        var thread = Thread.CurrentThread;\n        oldCulture = thread.CurrentCulture;\n        oldUiCulture = thread.CurrentUICulture;\n        thread.CurrentCulture = culture;\n        thread.CurrentUICulture = culture;\n    }\n\n    public void Dispose()\n    {\n        var thread = Thread.CurrentThread;\n        thread.CurrentCulture = oldCulture;\n        thread.CurrentUICulture = oldUiCulture;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Common/EditorConfigGenerator.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text;\n\nnamespace SonarAnalyzer.TestFramework.Common;\n\n/*\n * This class has copy-pasted logic similar to EditorConfigGenerator in Autoscan .Net.\n * See https://github.com/SonarSource/sonar-dotnet-autoscan/blob/master/AutoScan.NET/Build/EditorConfigGenerator.cs\n*/\npublic class EditorConfigGenerator\n{\n    private readonly string rootPath;\n\n    public EditorConfigGenerator(string rootPath)\n    {\n        if (string.IsNullOrWhiteSpace(rootPath))\n        {\n            throw new ArgumentNullException(nameof(rootPath));\n        }\n        this.rootPath = rootPath;\n    }\n\n    public string Generate(IEnumerable<string> razorFiles) =>\n        razorFiles.Select(x => x.Replace('\\\\', '/')).Select(ToConfigLine).Prepend(\"is_global = true\").JoinStr(Environment.NewLine);\n\n    private string ToConfigLine(string file) =>\n        $\"\"\"\n        [{file}]\n        build_metadata.AdditionalFiles.TargetPath = {Convert.ToBase64String(Encoding.UTF8.GetBytes(TestFiles.GetRelativePath(rootPath, file)))}\n        \"\"\";\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Common/EnvironmentVariableScope.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.TestFramework.Common;\n\n/// <summary>\n/// Defines a scope inside which new environment variables can be set.\n/// The variables will be cleared when the scope is disposed.\n/// </summary>\npublic sealed class EnvironmentVariableScope : IDisposable\n{\n    private IDictionary<string, string> originalValues = new Dictionary<string, string>();\n\n#pragma warning disable S2376 // Write-only properties should not be used\n    public bool EnableConcurrentAnalysis\n    {\n        set => SetVariable(SonarDiagnosticAnalyzer.EnableConcurrentExecutionVariable, value.ToString());\n    }\n#pragma warning restore S2376\n\n    public void SetVariable(string name, string value)\n    {\n        // Store the original value, or null if there isn't one\n        if (!originalValues.ContainsKey(name))\n        {\n            originalValues.Add(name, Environment.GetEnvironmentVariable(name));\n        }\n        Environment.SetEnvironmentVariable(name, value, EnvironmentVariableTarget.Process);\n    }\n\n    public void Dispose()\n    {\n        if (originalValues != null)\n        {\n            foreach (var kvp in originalValues)\n            {\n                Environment.SetEnvironmentVariable(kvp.Key, kvp.Value);\n            }\n            originalValues = null;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Common/FixAllDiagnosticProvider.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CodeFixes;\n\nnamespace SonarAnalyzer.TestFramework.Common;\n\npublic class FixAllDiagnosticProvider : FixAllContext.DiagnosticProvider\n{\n    private readonly IEnumerable<Diagnostic> diagnostics;\n\n    public FixAllDiagnosticProvider(IEnumerable<Diagnostic> diagnostics) =>\n        this.diagnostics = diagnostics;\n\n    public override Task<IEnumerable<Diagnostic>> GetDocumentDiagnosticsAsync(Document document, CancellationToken cancel) =>\n        Task.FromResult(diagnostics);\n\n    public override Task<IEnumerable<Diagnostic>> GetAllDiagnosticsAsync(Project project, CancellationToken cancel) =>\n        throw new NotSupportedException();\n\n    public override Task<IEnumerable<Diagnostic>> GetProjectDiagnosticsAsync(Project project, CancellationToken cancel) =>\n        throw new NotSupportedException();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Common/LogTester.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.TestFramework.Common;\n\npublic sealed class LogTester : IDisposable\n{\n    private readonly TextWriter originalOut;\n    private readonly TextWriter originalError;\n    private readonly StringWriter outWriter = new();\n    private readonly StringWriter errorWriter = new();\n\n    public string OutLogs => outWriter.ToString();\n\n    public LogTester()\n    {\n        originalOut = Console.Out;\n        Console.SetOut(outWriter);\n        originalError = Console.Error;\n        Console.SetError(errorWriter);\n    }\n\n    public void AssertContain(string value) =>\n        outWriter.ToString().Should().ContainIgnoringLineEndings(value);\n\n    public void AssertContainError(string value) =>\n        errorWriter.ToString().Should().ContainIgnoringLineEndings(value);\n\n    public void Dispose()\n    {\n        Console.SetOut(originalOut);\n        Console.SetError(originalError);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Common/Paths.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.TestFramework.Common;\n\npublic static class Paths\n{\n    public static string ProjectRoot { get; }\n    public static string TestsRoot { get; }\n    public static string AnalyzersRoot { get; }\n    public static string Rspec { get; }\n\n    static Paths()\n    {\n        // The AltCover tool has a limitation. It has to be invoked without a parameter for the project/solution path.\n        // Due to this we have to call it from the analyzers folder and the working directory is different when running in CI context.\n        TestsRoot = Path.Combine(FindRoot(\"tests\"), \"tests\");\n        Console.WriteLine(\"Test project root: \" + TestsRoot);\n\n        AnalyzersRoot = Path.GetDirectoryName(TestsRoot);\n        Console.WriteLine(\"Analyzers root: \" + AnalyzersRoot);\n\n        ProjectRoot = FindRoot(\".github\");\n        Console.WriteLine(\"Project root: \" + ProjectRoot);\n\n        Rspec = Path.Combine(ProjectRoot, \"analyzers\", \"rspec\");\n        Console.WriteLine(\"Rspec folder \" + Rspec);\n    }\n\n    /// <summary>\n    /// Returns path to the TestCases folder from the currently executed test project.\n    /// </summary>\n    public static string CurrentTestCases()\n    {\n        // Under AltCover, this starts deeper than usually and we need to avoid the copied TestCases from TFM folder\n        // C:\\...\\sonar-dotnet\\analyzers\\tests\\SonarAnalyzer.TestFramework.Test\\bin\\Debug\\net7.0-windows\\__Instrumented_SonarAnalyzer.TestFramework.Test\\\n        var current = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetFullPath(\".\")));\n        while (current is not null && current != TestsRoot)\n        {\n            var testCases = Path.Combine(current, \"TestCases\");\n            if (Directory.Exists(testCases))\n            {\n                return testCases;\n            }\n            else\n            {\n                current = Path.GetDirectoryName(current);\n            }\n        }\n        return null; // Some test projects don't have TestCases, like the SonarAnalyzer.Enterprise.SymbolicExecution.Test\n    }\n\n    private static string FindRoot(string expectedSubdirectory)\n    {\n        var current = Path.GetFullPath(\".\");\n        var root = Path.GetPathRoot(current);\n        while (current != root)\n        {\n            if (Directory.Exists(Path.Combine(current, expectedSubdirectory)))\n            {\n                return current;\n            }\n            else\n            {\n                current = Path.GetDirectoryName(current);\n            }\n        }\n        throw new InvalidOperationException($\"Could not find TestsRoot directory for '{expectedSubdirectory}' from current path: ${Path.GetFullPath(\".\")}\");\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Common/SdkPathProvider.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Reflection;\n\nnamespace SonarAnalyzer.TestFramework.Common;\n\npublic static class SdkPathProvider\n{\n    private const int DotnetVersion = 10;\n\n    private static readonly string RazorSourceGeneratorPath =\n        Path.Combine(LatestSdkFolder(), \"Sdks\", \"Microsoft.NET.Sdk.Razor\", \"source-generators\", \"Microsoft.CodeAnalysis.Razor.Compiler.dll\");\n\n    public static AnalyzerFileReference[] SourceGenerators { get; } =\n    [\n        new(RazorSourceGeneratorPath, new AssemblyLoader())\n    ];\n\n    public static string LatestSdkFolder() =>\n        LatestFolder(TestConstants.SdkPath, \"dotnet.dll\");\n\n    public static string LatestAspNetCoreSdkFolder() =>\n        LatestFolder(TestConstants.AspNetCorePath, \"Microsoft.AspNetCore.dll\");\n\n    public static string LatestWindowsDesktopSdkFolder() =>\n        LatestFolder(TestConstants.WindowsDesktopPath, \"PresentationCore.dll\");\n\n    public static string LatestFolder(string path, string assemblyName)\n    {\n        if (!Directory.Exists(path))\n        {\n            throw new NotSupportedException(\n                $\"The directory '{path}' does not exist. This may be because you are not using .NET Core. Please note that Razor analysis is only supported when using .NET Core.\");\n        }\n\n        // Due to the preview versions naming convention, we cannot use the folder names as version numbers so we need to look at the file versions of the assemblies from the folder.\n        // When reading the dll versions, the File version (e.g. 9.1.24.40712) is considered instead of the Product version (e.g. 9.1.100-preview.7.24407.12+hash).\n        return Directory.GetDirectories(path, $\"{DotnetVersion}.*\")\n            .OrderBy(x => FromFolderName(x, assemblyName))\n            .Last();\n\n        static Version FromFolderName(string folderName, string assemblyName)\n        {\n            var fv = FileVersionInfo.GetVersionInfo(Path.Combine(folderName, assemblyName));\n            return new Version(fv.FileMajorPart, fv.FileMinorPart, fv.FileBuildPart, fv.FilePrivatePart);\n        }\n    }\n\n    private sealed class AssemblyLoader : IAnalyzerAssemblyLoader\n    {\n        public void AddDependencyLocation(string fullPath) { }\n\n        public Assembly LoadFromPath(string fullPath) => Assembly.LoadFrom(fullPath);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Common/TestCompiler.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Text;\nusing SonarAnalyzer.CFG;\nusing SonarAnalyzer.CFG.Extensions;\nusing SonarAnalyzer.CFG.Roslyn;\nusing SonarAnalyzer.Core.Configuration;\nusing SonarAnalyzer.TestFramework.Build;\nusing StyleCop.Analyzers.Lightup;\nusing CS = Microsoft.CodeAnalysis.CSharp;\nusing VB = Microsoft.CodeAnalysis.VisualBasic;\n\nnamespace SonarAnalyzer.TestFramework.Common;\n\npublic static class TestCompiler\n{\n    public static (SyntaxTree Tree, SemanticModel Model) CompileIgnoreErrorsCS(string snippet, params MetadataReference[] additionalReferences) =>\n        Compile(snippet, true, AnalyzerLanguage.CSharp, additionalReferences);\n\n    public static (SyntaxTree Tree, SemanticModel Model) CompileIgnoreErrorsVB(string snippet, params MetadataReference[] additionalReferences) =>\n        Compile(snippet, true, AnalyzerLanguage.VisualBasic, additionalReferences);\n\n    public static (SyntaxTree Tree, SemanticModel Model) CompileCS(string snippet, params MetadataReference[] additionalReferences) =>\n        Compile(snippet, false, AnalyzerLanguage.CSharp, additionalReferences);\n\n    public static (SyntaxTree Tree, SemanticModel Model) CompileVB(string snippet, params MetadataReference[] additionalReferences) =>\n        Compile(snippet, false, AnalyzerLanguage.VisualBasic, additionalReferences);\n\n    public static (SyntaxTree Tree, SemanticModel Model) Compile(string snippet,\n                                                                 bool ignoreErrors,\n                                                                 AnalyzerLanguage language,\n                                                                 MetadataReference[] additionalReferences = null,\n                                                                 OutputKind outputKind = OutputKind.DynamicallyLinkedLibrary,\n                                                                 ParseOptions parseOptions = null)\n    {\n        var compiled = new SnippetCompiler(snippet, ignoreErrors, language, additionalReferences, outputKind, parseOptions);\n        return (compiled.Tree, compiled.Model);\n    }\n\n    // Get the SyntaxNode between the markers $$ in the snippet\n    public static NodeAndModel<T> NodeBetweenMarkersCS<T>(string snippet, bool getInnermostNodeForTie = false, OutputKind outputKind = OutputKind.DynamicallyLinkedLibrary) where T : SyntaxNode =>\n        NodeBetweenMarkers<T>(snippet, AnalyzerLanguage.CSharp, getInnermostNodeForTie, outputKind);\n\n    public static NodeAndModel<CS.CSharpSyntaxNode> NodeBetweenMarkersCS(string snippet, bool getInnermostNodeForTie = false, OutputKind outputKind = OutputKind.DynamicallyLinkedLibrary) =>\n        NodeBetweenMarkers<CS.CSharpSyntaxNode>(snippet, AnalyzerLanguage.CSharp, getInnermostNodeForTie, outputKind);\n\n    // Get the SyntaxNode between the markers $$ in the snippet\n    public static NodeAndModel<T> NodeBetweenMarkersVB<T>(string snippet, bool getInnermostNodeForTie = false, OutputKind outputKind = OutputKind.DynamicallyLinkedLibrary) where T : SyntaxNode =>\n        NodeBetweenMarkers<T>(snippet, AnalyzerLanguage.VisualBasic, getInnermostNodeForTie, outputKind);\n\n    public static NodeAndModel<VB.VisualBasicSyntaxNode> NodeBetweenMarkersVB(string snippet, bool getInnermostNodeForTie = false, OutputKind outputKind = OutputKind.DynamicallyLinkedLibrary) =>\n        NodeBetweenMarkers<VB.VisualBasicSyntaxNode>(snippet, AnalyzerLanguage.VisualBasic, getInnermostNodeForTie, outputKind);\n\n    // Get the SyntaxToken between the markers $$ in the snippet\n    public static TokenAndModel TokenBetweenMarkersCS(string snippet, bool getInnermostNodeForTie = false, OutputKind outputKind = OutputKind.DynamicallyLinkedLibrary) =>\n        TokenBetweenMarkers(snippet, AnalyzerLanguage.CSharp, getInnermostNodeForTie, outputKind);\n\n    // Get the SyntaxToken between the markers $$ in the snippet\n    public static TokenAndModel TokenBetweenMarkersVB(string snippet, bool getInnermostNodeForTie = false, OutputKind outputKind = OutputKind.DynamicallyLinkedLibrary) =>\n        TokenBetweenMarkers(snippet, AnalyzerLanguage.VisualBasic, getInnermostNodeForTie, outputKind);\n\n    public static ControlFlowGraph CompileCfgBodyCS(string body = null, string additionalParameters = null) =>\n        CompileCfg($$\"\"\"\n            public class Sample\n            {\n                public void Main({{additionalParameters}})\n                {\n                    {{body}}\n                }\n            }\n            \"\"\", AnalyzerLanguage.CSharp);\n\n    public static ControlFlowGraph CompileCfgBodyVB(string body = null) =>\n        CompileCfg($\"\"\"\n            Public Class Sample\n                Public Sub Main()\n                    {body}\n                End Sub\n            End Class\n            \"\"\", AnalyzerLanguage.VisualBasic);\n\n    public static ControlFlowGraph CompileCfgCS(string snippet, bool ignoreErrors = false) =>\n        CompileCfg(snippet, AnalyzerLanguage.CSharp, ignoreErrors);\n\n    public static ControlFlowGraph CompileCfg(string snippet,\n                                              AnalyzerLanguage language,\n                                              bool ignoreErrors = false,\n                                              string localFunctionName = null,\n                                              string anonymousFunctionFragment = null,\n                                              OutputKind outputKind = OutputKind.DynamicallyLinkedLibrary)\n    {\n        var (tree, semanticModel) = Compile(snippet, ignoreErrors, language, outputKind: outputKind);\n        var root = tree.GetRoot();\n        var method = outputKind == OutputKind.ConsoleApplication && root.ChildNodes().OfType<GlobalStatementSyntax>().Any()\n            ? root                                      // Top level statements\n            : root.DescendantNodes().First(IsMethod);\n        var cfg = ControlFlowGraph.Create(method, semanticModel, default);\n        if (localFunctionName is not null && anonymousFunctionFragment is not null)\n        {\n            throw new InvalidOperationException($\"Specify {nameof(localFunctionName)} or {nameof(anonymousFunctionFragment)}.\");\n        }\n        if (localFunctionName is not null)\n        {\n            cfg = cfg.GetLocalFunctionControlFlowGraph(cfg.LocalFunctions.Single(x => x.Name == localFunctionName), default);\n        }\n        else if (anonymousFunctionFragment is not null)\n        {\n            var anonymousFunction = cfg.FlowAnonymousFunctionOperations().SingleOrDefault(x => x.WrappedOperation.Syntax.ToString().Contains(anonymousFunctionFragment));\n            if (anonymousFunction.WrappedOperation is null)\n            {\n                throw new ArgumentException($\"Anonymous function with '{anonymousFunctionFragment}' fragment was not found.\");\n            }\n            cfg = cfg.GetAnonymousFunctionControlFlowGraph(anonymousFunction, default);\n        }\n\n        const string Separator = \"----------\";\n        Console.WriteLine(Separator);\n        Console.Write(CfgSerializer.Serialize(cfg));\n        Console.WriteLine(Separator);\n\n        return cfg;\n\n        bool IsMethod(SyntaxNode node) =>\n            language == AnalyzerLanguage.CSharp\n                ? node.RawKind == (int)CS.SyntaxKind.MethodDeclaration\n                : node.RawKind == (int)VB.SyntaxKind.FunctionBlock || node.RawKind == (int)VB.SyntaxKind.SubBlock;\n    }\n\n    public static IEnumerable<MetadataReference> ProjectTypeReference(ProjectType projectType) =>\n        projectType == ProjectType.Test\n            ? NuGetMetadataReference.MSTestTestFrameworkV1  // Any reference to detect a test project\n            : Enumerable.Empty<MetadataReference>();\n\n    public static string Serialize(IOperationWrapperSonar operation)\n    {\n        _ = operation.Instance ?? throw new ArgumentNullException(nameof(operation));\n        return operation.Instance.Kind + \": \" + operation.Instance.Syntax + (operation.IsImplicit ? \" (Implicit)\" : null);\n    }\n\n    private static NodeAndModel<T> NodeBetweenMarkers<T>(string snippet,\n                                                         AnalyzerLanguage language,\n                                                         bool getInnermostNodeForTie = false,\n                                                         OutputKind outputKind = OutputKind.DynamicallyLinkedLibrary) where T : SyntaxNode\n    {\n        var position = snippet.IndexOf(\"$$\");\n        var lastPosition = snippet.LastIndexOf(\"$$\");\n        var length = lastPosition == position ? 0 : lastPosition - position - \"$$\".Length;\n        snippet = snippet.Replace(\"$$\", string.Empty);\n        var (tree, model) = Compile(snippet, ignoreErrors: false, language, outputKind: outputKind);\n        var node = (T)tree.GetRoot().FindNode(new TextSpan(position, length), getInnermostNodeForTie: getInnermostNodeForTie);\n        return new(node, model);\n    }\n\n    private static TokenAndModel TokenBetweenMarkers(string snippet,\n                                                     AnalyzerLanguage language,\n                                                     bool findInsideTrivia = false,\n                                                     OutputKind outputKind = OutputKind.DynamicallyLinkedLibrary)\n    {\n        var position = snippet.IndexOf(\"$$\");\n        snippet = snippet.Replace(\"$$\", string.Empty);\n        var (tree, model) = TestCompiler.Compile(snippet, ignoreErrors: false, language, outputKind: outputKind);\n        return new(tree.GetRoot().FindToken(position, findInsideTrivia), model);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Common/TestConstants.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.TestFramework.Common;\n\npublic static class TestConstants\n{\n    public const string NuGetLatestVersion = \"LATEST\";\n    public const string DotNetCore220Version = \"2.2.0\";\n    public const string WindowsLineEnding = \"\\r\\n\";\n    public const string UnixLineEnding = \"\\n\";\n    public static readonly string SdkPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), \"dotnet\", \"sdk\");\n    public static readonly string AspNetCorePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), \"dotnet\", \"shared\", \"Microsoft.AspNetCore.App\");\n    public static readonly string WindowsDesktopPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), \"dotnet\", \"shared\", \"Microsoft.WindowsDesktop.App\");\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Common/TestEnvironment.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.TestFramework.Common;\n\npublic static class TestEnvironment\n{\n    public static bool IsAzureDevOpsContext =>\n        BuildReason() is not null;\n\n    public static bool IsPullRequestBuild =>\n         BuildReason() == \"PullRequest\";\n\n    public static string BuildReason() =>\n        Environment.GetEnvironmentVariable(\"BUILD_REASON\");\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Common/TestFiles.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.TestFramework.Common;\n\npublic static class TestFiles\n{\n    public static string ToUnixLineEndings(this string value) =>\n        value.Replace(TestConstants.WindowsLineEnding, TestConstants.UnixLineEnding);\n\n    public static string TestPath(TestContext context, string fileName)\n    {\n        var root = Path.Combine(context.TestRunDirectory, context.FullyQualifiedTestClassName.Replace(\"SonarAnalyzer.Test.\", null));\n        var directoryName = root.Length + context.TestName.Length + fileName.Length > 250   // 260 can throw PathTooLongException\n            ? $\"TooLongTestName.{RootSubdirectoryCount()}\"\n            : context.TestName;\n        var path = Path.Combine(root, directoryName, fileName);\n        Directory.CreateDirectory(Path.GetDirectoryName(path));\n        return path;\n\n        int RootSubdirectoryCount() =>\n            Directory.Exists(root) ? Directory.GetDirectories(root).Length : 0;\n    }\n\n    public static string WriteFile(TestContext context, string fileName, string content = null)\n    {\n        var path = TestPath(context, fileName);\n        File.WriteAllText(path, content);\n        return path;\n    }\n\n    public static string GetRelativePath(string relativeTo, string path)\n    {\n        var itemPath = Path.GetFullPath(path);\n        var isDirectory = path.EndsWith(Path.DirectorySeparatorChar.ToString());\n        var p1 = itemPath.Split([Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], StringSplitOptions.RemoveEmptyEntries);\n        var p2 = relativeTo.Split([Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], StringSplitOptions.RemoveEmptyEntries);\n\n        var i = 0;\n        while (i < p1.Length\n            && i < p2.Length\n            && string.Equals(p1[i], p2[i], StringComparison.OrdinalIgnoreCase))\n        {\n            i++;\n        }\n\n        if (i == 0)\n        {\n            return itemPath;\n        }\n        var relativePath = Path.Combine(Enumerable.Repeat(\"..\", p2.Length - i).Concat(p1.Skip(i).Take(p1.Length - i)).ToArray());\n        if (isDirectory && p1.Length >= p2.Length)\n        {\n            relativePath += Path.DirectorySeparatorChar;\n        }\n        return relativePath;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Extensions/CompilationExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.VisualBasic;\n\nnamespace SonarAnalyzer.TestFramework.Extensions;\n\ninternal static class CompilationExtensions\n{\n    public static string LanguageVersionString(this Compilation compilation) =>\n        compilation switch\n        {\n            CSharpCompilation cs => cs.LanguageVersion.ToString(),\n            VisualBasicCompilation vb => vb.LanguageVersion.ToString(),\n            _ => throw new NotSupportedException($\"Not supported compilation type: '{compilation?.GetType()}'\")\n        };\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Extensions/DiagnosticDescriptorExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.TestFramework.Packaging;\n\nnamespace SonarAnalyzer.TestFramework.Extensions;\n\npublic static class DiagnosticDescriptorExtensions\n{\n    public static bool IsSecurityHotspot(this DiagnosticDescriptor diagnostic)\n    {\n        var type = RuleTypeMappingCS.Rules.GetValueOrDefault(diagnostic.Id) ?? RuleTypeMappingVB.Rules.GetValueOrDefault(diagnostic.Id);\n        return type == \"SECURITY_HOTSPOT\";\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Extensions/StringAssertionsExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing FluentAssertions.Primitives;\n\nnamespace SonarAnalyzer.TestFramework.Extensions;\n\npublic static class StringAssertionsExtensions\n{\n    [CustomAssertion]\n    public static void BeIgnoringLineEndings(this StringAssertions stringAssertions, string expected) =>\n        stringAssertions.Subject.ToUnixLineEndings().Should().Be(expected.ToUnixLineEndings(), $\"Actual value: \\n{stringAssertions.Subject}\\n\");\n\n    [CustomAssertion]\n    public static void ContainIgnoringLineEndings(this StringAssertions stringAssertions, string expected) =>\n        stringAssertions.Subject.ToUnixLineEndings().Should().Contain(expected.ToUnixLineEndings());\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Extensions/SyntaxTreeExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.TestFramework.Extensions;\n\npublic static class SyntaxTreeExtensions\n{\n    public static T First<T>(this SyntaxTree tree) where T : SyntaxNode =>\n        tree.GetRoot().DescendantNodes().OfType<T>().First();\n\n    public static T Single<T>(this SyntaxTree tree) where T : SyntaxNode =>\n        tree.GetRoot().DescendantNodes().OfType<T>().Single();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Extensions/TypeExtensions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Reflection;\n\nnamespace SonarAnalyzer.TestFramework.Extensions;\n\npublic static class TypeExtensions\n{\n    public static AnalyzerLanguage AnalyzerTargetLanguage(this Type analyzerType)\n    {\n        var languages = analyzerType.GetCustomAttributes<DiagnosticAnalyzerAttribute>().SingleOrDefault()?.Languages\n                        ?? throw new NotSupportedException($\"Can not find any language for the given type {analyzerType.Name}!\");\n        return languages.Length == 1\n            ? AnalyzerLanguage.FromName(languages.Single())\n            : throw new NotSupportedException($\"Analyzer can not have multiple languages: {analyzerType.Name}\");\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/MetadataReferences/AspNetCoreMetadataReference.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\n#if NET\n\nusing static SonarAnalyzer.TestFramework.MetadataReferences.MetadataReferenceFactory;\n\nnamespace SonarAnalyzer.TestFramework.MetadataReferences;\n\npublic static class AspNetCoreMetadataReference\n{\n    public static IEnumerable<MetadataReference> BasicReferences =>\n    [\n        MicrosoftAspNetCore,                    // For WebApplication\n        MicrosoftExtensionsHostingAbstractions, // For IHost\n        MicrosoftAspNetCoreHttpAbstractions,    // For HttpContext, RouteValueDictionary\n        MicrosoftAspNetCoreHttpFeatures,\n        MicrosoftAspNetCoreMvcAbstractions,\n        MicrosoftAspNetCoreMvcCore,\n        MicrosoftAspNetCoreMvcRazorPages,       // For RazorPagesEndpointRouteBuilderExtensions.MapFallbackToPage\n        MicrosoftAspNetCoreMvcViewFeatures,\n        MicrosoftAspNetCoreRouting,             // For IEndpointRouteBuilder\n    ];\n\n    public static MetadataReference MicrosoftAspNetCore { get; } = CreateReference(\"Microsoft.AspNetCore.dll\", Sdk.AspNetCore);\n    public static MetadataReference MicrosoftAspNetCoreCors { get; } = CreateReference(\"Microsoft.AspNetCore.Cors.dll\", Sdk.AspNetCore);\n    public static MetadataReference MicrosoftAspNetCoreDiagnostics { get; } = CreateReference(\"Microsoft.AspNetCore.Diagnostics.dll\", Sdk.AspNetCore);\n    public static MetadataReference MicrosoftAspNetCoreHosting { get; } = CreateReference(\"Microsoft.AspNetCore.Hosting.dll\", Sdk.AspNetCore);\n    public static MetadataReference MicrosoftAspNetCoreHostingAbstractions { get; } = CreateReference(\"Microsoft.AspNetCore.Hosting.Abstractions.dll\", Sdk.AspNetCore);\n    public static MetadataReference MicrosoftAspNetCoreHttpAbstractions { get; } = CreateReference(\"Microsoft.AspNetCore.Http.Abstractions.dll\", Sdk.AspNetCore);\n    public static MetadataReference MicrosoftAspNetCoreHttpFeatures { get; } = CreateReference(\"Microsoft.AspNetCore.Http.Features.dll\", Sdk.AspNetCore);\n    public static MetadataReference MicrosoftAspNetCoreHttpResults { get; } = CreateReference(\"Microsoft.AspNetCore.Http.Results.dll\", Sdk.AspNetCore);\n    public static MetadataReference MicrosoftAspNetCoreMvc { get; } = CreateReference(\"Microsoft.AspNetCore.Mvc.dll\", Sdk.AspNetCore);\n    public static MetadataReference MicrosoftAspNetCoreMvcAbstractions { get; } = CreateReference(\"Microsoft.AspNetCore.Mvc.Abstractions.dll\", Sdk.AspNetCore);\n    public static MetadataReference MicrosoftAspNetCoreMvcCore { get; } = CreateReference(\"Microsoft.AspNetCore.Mvc.Core.dll\", Sdk.AspNetCore);\n    public static MetadataReference MicrosoftAspNetCoreMvcRazor { get; } = CreateReference(\"Microsoft.AspNetCore.Mvc.Razor.dll\", Sdk.AspNetCore);\n    public static MetadataReference MicrosoftAspNetCoreMvcRazorPages { get; } = CreateReference(\"Microsoft.AspNetCore.Mvc.RazorPages.dll\", Sdk.AspNetCore);\n    public static MetadataReference MicrosoftAspNetCoreMvcViewFeatures { get; } = CreateReference(\"Microsoft.AspNetCore.Mvc.ViewFeatures.dll\", Sdk.AspNetCore);\n    public static MetadataReference MicrosoftAspNetCoreRouting { get; } = CreateReference(\"Microsoft.AspNetCore.Routing.dll\", Sdk.AspNetCore);\n    public static MetadataReference MicrosoftExtensionsHostingAbstractions { get; } = CreateReference(\"Microsoft.Extensions.Hosting.Abstractions.dll\", Sdk.AspNetCore);\n    public static MetadataReference MicrosoftExtensionsIdentityCore { get; } = CreateReference(\"Microsoft.Extensions.Identity.Core.dll\", Sdk.AspNetCore);\n    public static MetadataReference MicrosoftAspNetCoreCryptographyKeyDerivation { get; } = CreateReference(\"Microsoft.AspNetCore.Cryptography.KeyDerivation.dll\", Sdk.AspNetCore);\n    public static MetadataReference MicrosoftExtensionsDependencyInjectionAbstractions { get; } = CreateReference(\"Microsoft.Extensions.DependencyInjection.Abstractions.dll\", Sdk.AspNetCore);\n    public static MetadataReference MicrosoftExtensionsLoggingAbstractions { get; } = CreateReference(\"Microsoft.Extensions.Logging.Abstractions.dll\", Sdk.AspNetCore);\n    public static MetadataReference MicrosoftExtensionsLoggingEventSource { get; } = CreateReference(\"Microsoft.Extensions.Logging.EventSource.dll\", Sdk.AspNetCore);\n    public static MetadataReference MicrosoftExtensionsPrimitives { get; } = CreateReference(\"Microsoft.Extensions.Primitives.dll\", Sdk.AspNetCore);\n    public static MetadataReference MicrosoftNetHttpHeadersHeaderNames { get; } = CreateReference(\"Microsoft.Net.Http.Headers.dll\", Sdk.AspNetCore);\n}\n\n#endif\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/MetadataReferences/CoreMetadataReference.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\n#if NET\n\nusing static SonarAnalyzer.TestFramework.MetadataReferences.MetadataReferenceFactory;\n\nnamespace SonarAnalyzer.TestFramework.MetadataReferences;\n\npublic static class CoreMetadataReference\n{\n    public static MetadataReference MicrosoftVisualBasic { get; } = CreateReference(\"Microsoft.VisualBasic.dll\");\n    public static MetadataReference MicrosoftVisualBasicCore { get; } = CreateReference(\"Microsoft.VisualBasic.Core.dll\");\n    public static MetadataReference MicrosoftWin32Registry { get; } = CreateReference(\"Microsoft.Win32.Registry.dll\");\n    public static MetadataReference MicrosoftWin32Primitives { get; } = CreateReference(\"Microsoft.Win32.Primitives.dll\");\n    public static MetadataReference MsCorLib { get; } = CreateReference(\"mscorlib.dll\");\n    public static MetadataReference System { get; } = CreateReference(\"System.dll\");\n    public static MetadataReference SystemCollections { get; } = CreateReference(\"System.Collections.dll\");\n    public static MetadataReference SystemCore { get; } = CreateReference(\"System.Core.dll\");\n    public static MetadataReference SystemCollectionsConcurrent { get; } = CreateReference(\"System.Collections.Concurrent.dll\");\n    public static MetadataReference SystemCollectionsImmutable { get; } = CreateReference(\"System.Collections.Immutable.dll\");\n    public static MetadataReference SystemCollectionsSpecialized { get; } = CreateReference(\"System.Collections.Specialized.dll\");\n    public static MetadataReference SystemCollectionsNonGeneric { get; } = CreateReference(\"System.Collections.NonGeneric.dll\");\n    public static MetadataReference SystemComponentModel { get; } = CreateReference(\"System.ComponentModel.dll\");\n    public static MetadataReference SystemComponentModelPrimitives { get; } = CreateReference(\"System.ComponentModel.Primitives.dll\");\n    public static MetadataReference SystemComponentModelTypeConverter { get; } = CreateReference(\"System.ComponentModel.TypeConverter.dll\");\n    public static MetadataReference SystemConsole { get; } = CreateReference(\"System.Console.dll\");\n    public static MetadataReference SystemDataCommon { get; } = CreateReference(\"System.Data.Common.dll\");\n    public static MetadataReference SystemDiagnosticsTraceSource { get; } = CreateReference(\"System.Diagnostics.TraceSource.dll\");\n    public static MetadataReference SystemDiagnosticsProcess { get; } = CreateReference(\"System.Diagnostics.Process.dll\");\n    public static MetadataReference SystemDiagnosticsTools { get; } = CreateReference(\"System.Diagnostics.Tools.dll\");\n    public static MetadataReference SystemGlobalization { get; } = CreateReference(\"System.Globalization.dll\");\n    public static MetadataReference SystemIoCompression { get; } = CreateReference(\"System.IO.Compression.dll\");\n    public static MetadataReference SystemIoCompressionZipFile { get; } = CreateReference(\"System.IO.Compression.ZipFile.dll\");\n    public static MetadataReference SystemIoFileSystem { get; } = CreateReference(\"System.IO.FileSystem.dll\");\n    public static MetadataReference SystemIoFileSystemAccessControl { get; } = CreateReference(\"System.IO.FileSystem.AccessControl.dll\");\n    public static MetadataReference SystemLinq { get; } = CreateReference(\"System.Linq.dll\");\n    public static MetadataReference SystemLinqExpressions { get; } = CreateReference(\"System.Linq.Expressions.dll\");\n    public static MetadataReference SystemLinqQueryable { get; } = CreateReference(\"System.Linq.Queryable.dll\");\n    public static MetadataReference SystemNetHttp { get; } = CreateReference(\"System.Net.Http.dll\");\n    public static MetadataReference SystemNetMail { get; } = CreateReference(\"System.Net.Mail.dll\");\n    public static MetadataReference SystemNetRequests { get; } = CreateReference(\"System.Net.Requests.dll\");\n    public static MetadataReference SystemNetSecurity { get; } = CreateReference(\"System.Net.Security.dll\");\n    public static MetadataReference SystemNetServicePoint { get; } = CreateReference(\"System.Net.ServicePoint.dll\");\n    public static MetadataReference SystemNetSockets { get; } = CreateReference(\"System.Net.Sockets.dll\");\n    public static MetadataReference SystemNetPrimitives { get; } = CreateReference(\"System.Net.Primitives.dll\");\n    public static MetadataReference SystemNetWebClient { get; } = CreateReference(\"System.Net.WebClient.dll\");\n    public static MetadataReference SystemObjectModel { get; } = CreateReference(\"System.ObjectModel.dll\");\n    public static MetadataReference SystemPrivateCoreLib { get; } = CreateReference(\"System.Private.CoreLib.dll\");\n    public static MetadataReference SystemPrivateUri { get; } = CreateReference(\"System.Private.Uri.dll\");\n    public static MetadataReference SystemPrivateXml { get; } = CreateReference(\"System.Private.Xml.dll\");\n    public static MetadataReference SystemPrivateXmlLinq { get; } = CreateReference(\"System.Private.Xml.Linq.dll\");\n    public static MetadataReference SystemRuntime { get; } = CreateReference(\"System.Runtime.dll\");\n    public static MetadataReference SystemRuntimeExtensions { get; } = CreateReference(\"System.Runtime.Extensions.dll\");\n    public static MetadataReference SystemRuntimeInteropServices { get; } = CreateReference(\"System.Runtime.InteropServices.dll\");\n    public static MetadataReference SystemRuntimeSerialization { get; } = CreateReference(\"System.Runtime.Serialization.dll\");\n    public static MetadataReference SystemRuntimeSerializationFormatters { get; } = CreateReference(\"System.Runtime.Serialization.Formatters.dll\");\n    public static MetadataReference SystemRuntimeSerializationPrimitives { get; } = CreateReference(\"System.Runtime.Serialization.Primitives.dll\");\n    public static MetadataReference SystemSecurityAccessControl { get; } = CreateReference(\"System.Security.AccessControl.dll\");\n    public static MetadataReference SystemSecurityClaims { get; } = CreateReference(\"System.Security.Claims.dll\");\n    public static MetadataReference SystemSecurityCryptography { get; } = CreateReference(\"System.Security.Cryptography.dll\");\n    public static MetadataReference SystemSecurityCryptographyX509Certificates { get; } = CreateReference(\"System.Security.Cryptography.X509Certificates.dll\");\n    public static MetadataReference SystemSecurityCryptographyCsp { get; } = CreateReference(\"System.Security.Cryptography.Csp.dll\");\n    public static MetadataReference SystemSecurityCryptographyCng { get; } = CreateReference(\"System.Security.Cryptography.Cng.dll\");\n    public static MetadataReference SystemSecurityCryptographyPrimitives { get; } = CreateReference(\"System.Security.Cryptography.Primitives.dll\");\n    public static MetadataReference SystemSecurityPrincipalWindows { get; } = CreateReference(\"System.Security.Principal.Windows.dll\");\n    public static MetadataReference SystemTextRegularExpressions { get; } = CreateReference(\"System.Text.RegularExpressions.dll\");\n    public static MetadataReference SystemThreading { get; } = CreateReference(\"System.Threading.dll\");\n    public static MetadataReference SystemThreadingTasks { get; } = CreateReference(\"System.Threading.Tasks.dll\");\n    public static MetadataReference SystemThreadingTasksParallel { get; } = CreateReference(\"System.Threading.Tasks.Parallel.dll\");\n    public static MetadataReference SystemXmlReaderWriter { get; } = CreateReference(\"System.Xml.ReaderWriter.dll\");\n    public static MetadataReference SystemXml { get; } = CreateReference(\"System.Xml.dll\");\n    public static MetadataReference SystemXmlXDocument { get; } = CreateReference(\"System.Xml.XDocument.dll\");\n    public static MetadataReference SystemXmlLinq { get; } = CreateReference(\"System.Xml.Linq.dll\");\n    public static MetadataReference SystemWeb { get; } = CreateReference(\"System.Web.dll\");\n}\n#endif\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/MetadataReferences/FrameworkMetadataReference.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\n#if NETFRAMEWORK\n\nusing static SonarAnalyzer.TestFramework.MetadataReferences.MetadataReferenceFactory;\nusing References = System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.MetadataReference>;\n\nnamespace SonarAnalyzer.TestFramework.MetadataReferences;\n\npublic static class FrameworkMetadataReference\n{\n    public static References MicrosoftVisualBasic { get; } = Create(\"Microsoft.VisualBasic.dll\");\n    public static References Mscorlib { get; } = Create(\"mscorlib.dll\");\n\n    public static References PresentationFramework { get; } =\n    [\n        CreateReference(\"PresentationFramework.dll\", \"WPF\"), CreateReference(\"PresentationCore.dll\", \"WPF\"), CreateReference(\"WindowsBase.dll\", \"WPF\")\n    ];\n\n    public static References System { get; } = Create(\"System.dll\");\n    public static References SystemComponentModelComposition { get; } = Create(\"System.ComponentModel.Composition.dll\");\n    public static References SystemNetHttp { get; } = Create(\"System.Net.Http.dll\");\n    public static References SystemIOCompression { get; } = Create(\"System.IO.Compression.dll\");\n    public static References SystemIOCompressionFileSystem { get; } = Create(\"System.IO.Compression.FileSystem.dll\");\n    public static References SystemCore { get; } = Create(\"System.Core.dll\");\n    public static References SystemData { get; } = Create(\"System.Data.dll\");\n    public static References SystemDataLinq { get; } = Create(\"System.Data.Linq.dll\");\n    public static References SystemDataOracleClient { get; } = Create(\"System.Data.OracleClient.dll\");\n    public static References SystemDirectoryServices { get; } = Create(\"System.DirectoryServices.dll\");\n    public static References SystemDrawing { get; } = Create(\"System.Drawing.dll\");\n    public static References SystemGlobalization { get; } = Create(\"System.Globalization.dll\");\n    public static References SystemIdentityModel { get; } = Create(\"System.IdentityModel.dll\");\n    public static References SystemReflection { get; } = Create(\"System.Reflection.dll\");\n    public static References SystemRuntime { get; } = Create(\"System.Runtime.dll\");\n    public static References SystemRuntimeSerialization { get; } = Create(\"System.Runtime.Serialization.dll\");\n    public static References SystemRuntimeSerializationFormattersSoap { get; } = Create(\"System.Runtime.Serialization.Formatters.Soap.dll\");\n    public static References SystemSecurityCryptographyAlgorithms { get; } = Create(\"System.Security.Cryptography.Algorithms.dll\");\n    public static References SystemServiceModel { get; } = Create(\"System.ServiceModel.dll\");\n    public static References SystemThreadingTasks { get; } = Create(\"System.Threading.Tasks.dll\");\n    public static References SystemWeb { get; } = Create(\"System.Web.dll\");\n    public static References SystemWebExtensions { get; } = Create(\"System.Web.Extensions.dll\");\n    public static References SystemWebServices { get; } = Create(\"System.Web.Services.dll\");\n    public static References SystemWindowsForms { get; } = Create(\"System.Windows.Forms.dll\");\n    public static References SystemXaml { get; } = Create(\"System.Xaml.dll\");\n    public static References SystemXml { get; } = Create(\"System.Xml.dll\");\n    public static References SystemXmlLinq { get; } = Create(\"System.Xml.Linq.dll\");\n    public static References SystemXmlXDocument { get; } = Create(\"System.Xml.XDocument.dll\");\n    public static References WindowsBase { get; } = [CreateReference(\"WindowsBase.dll\", \"WPF\")];\n}\n\n#endif\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/MetadataReferences/MetadataReferenceFacade.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing References = System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.MetadataReference>;\n\nnamespace SonarAnalyzer.TestFramework.MetadataReferences;\n\n#pragma warning disable T0030 // Move this expression to the previous line\n\npublic static class MetadataReferenceFacade\n{\n    public static References NetStandard { get; } = MetadataReferenceFactory.Create(\"netstandard.dll\");\n\n    public static References MsCorLib =>\n#if NETFRAMEWORK\n        FrameworkMetadataReference.Mscorlib;\n#else\n        [CoreMetadataReference.MsCorLib];\n#endif\n\n    public static References MicrosoftExtensionsDependencyInjectionAbstractions =>\n#if NETFRAMEWORK\n        NuGetMetadataReference.MicrosoftExtensionsDependencyInjectionAbstractions(TestConstants.DotNetCore220Version);\n#else\n        [AspNetCoreMetadataReference.MicrosoftExtensionsDependencyInjectionAbstractions];\n#endif\n\n    public static References MicrosoftVisualBasic =>\n#if NETFRAMEWORK\n        FrameworkMetadataReference.MicrosoftVisualBasic;\n#else\n        [\n            CoreMetadataReference.MicrosoftVisualBasic,\n            CoreMetadataReference.MicrosoftVisualBasicCore\n        ];\n#endif\n\n    public static References MicrosoftWin32Registry =>\n#if NETFRAMEWORK\n        [];\n#else\n        [CoreMetadataReference.MicrosoftWin32Registry];\n#endif\n\n    public static References MicrosoftWin32Primitives =>\n#if NETFRAMEWORK\n        [];\n#else\n        [CoreMetadataReference.MicrosoftWin32Primitives];\n#endif\n\n    public static References NetStandard21 =>\n#if NETFRAMEWORK\n        NuGetMetadataFactory.Create(\"NETStandard.Library.Ref\", \"2.1.0\", \"netstandard2.1\");\n#else\n        [];\n#endif\n\n    public static References PresentationFramework =>\n#if NETFRAMEWORK\n        FrameworkMetadataReference.PresentationFramework;\n#else\n        [WindowsDesktopMetadataReference.PresentationCore,\n            WindowsDesktopMetadataReference.PresentationFramework,\n            WindowsDesktopMetadataReference.WindowsBase];\n#endif\n\n    public static References SystemCollections =>\n#if NETFRAMEWORK\n        NuGetMetadataReference.SystemCollectionsImmutable(TestConstants.NuGetLatestVersion);\n#else\n        [\n            CoreMetadataReference.SystemCollections,\n            CoreMetadataReference.SystemCollectionsImmutable,\n            CoreMetadataReference.SystemCollectionsNonGeneric,\n            CoreMetadataReference.SystemCollectionsConcurrent\n        ];\n#endif\n\n    public static References SystemData =>\n#if NETFRAMEWORK\n        FrameworkMetadataReference.SystemData;\n#else\n        [\n            CoreMetadataReference.SystemDataCommon\n        ];\n#endif\n\n    public static References SystemDiagnosticsProcess =>\n#if NETFRAMEWORK\n        [];\n#else\n        [\n            CoreMetadataReference.SystemComponentModelPrimitives,   // Type \"Process\" needs this for it's parent type \"Component\"\n            CoreMetadataReference.SystemDiagnosticsProcess\n        ];\n#endif\n\n    public static References SystemDrawing =>\n#if NETFRAMEWORK\n        FrameworkMetadataReference.SystemDrawing;\n#else\n        NuGetMetadataReference.SystemDrawingCommon();\n#endif\n\n    public static References SystemDirectoryServices =>\n#if NETFRAMEWORK\n        FrameworkMetadataReference.SystemDirectoryServices;\n#else\n        NuGetMetadataReference.SystemDDirectoryServices();\n#endif\n\n    public static References SystemIoCompression =>\n#if NETFRAMEWORK\n        FrameworkMetadataReference.SystemIOCompression\n            .Concat(FrameworkMetadataReference.SystemIOCompressionFileSystem);\n#else\n        [\n            CoreMetadataReference.SystemIoCompression,\n            CoreMetadataReference.SystemIoCompressionZipFile\n        ];\n#endif\n\n    public static References SystemMemory =>\n#if NETFRAMEWORK\n        NuGetMetadataReference.SystemMemory();\n#else\n        [];\n#endif\n\n    public static References SystemServiceModel =>\n#if NETFRAMEWORK\n        FrameworkMetadataReference.SystemServiceModel;\n#else\n        NuGetMetadataReference.SystemPrivateServiceModel()\n            .Concat(NuGetMetadataReference.SystemServiceModelPrimitives());\n#endif\n\n    public static References SystemNetHttp =>\n#if NETFRAMEWORK\n        FrameworkMetadataReference.SystemNetHttp;\n#else\n        [\n            CoreMetadataReference.SystemNetHttp,\n            CoreMetadataReference.SystemNetMail,\n            CoreMetadataReference.SystemNetRequests,\n            CoreMetadataReference.SystemNetSecurity,\n            CoreMetadataReference.SystemNetServicePoint,\n            CoreMetadataReference.SystemNetSockets,\n            CoreMetadataReference.SystemNetPrimitives,\n            CoreMetadataReference.SystemNetWebClient\n        ];\n#endif\n\n    public static References SystemSecurityCryptography =>\n#if NETFRAMEWORK\n        FrameworkMetadataReference.SystemSecurityCryptographyAlgorithms;\n#else\n        [\n            CoreMetadataReference.SystemSecurityCryptography,\n            CoreMetadataReference.SystemSecurityCryptographyX509Certificates,\n            CoreMetadataReference.SystemSecurityCryptographyCsp,\n            CoreMetadataReference.SystemSecurityCryptographyCng,\n            CoreMetadataReference.SystemSecurityCryptographyPrimitives\n        ];\n#endif\n\n    public static References SystemSecurityPermissions =>\n#if NETFRAMEWORK\n        [];\n#else\n        NuGetMetadataReference.SystemSecurityPermissions();\n#endif\n\n    public static References SystemThreading =>\n#if NETFRAMEWORK\n        [];\n#else\n        [CoreMetadataReference.SystemThreading];\n#endif\n\n    public static References SystemThreadingTasks =>\n#if NETFRAMEWORK\n        FrameworkMetadataReference.SystemThreadingTasks\n            .Concat(NuGetMetadataReference.SystemThreadingTasksExtensions(\"4.0.0\"));\n#else\n        [CoreMetadataReference.SystemThreadingTasks, CoreMetadataReference.SystemThreadingTasksParallel];\n#endif\n\n    public static References RegularExpressions =>\n#if NETFRAMEWORK\n        [];\n#else\n        [CoreMetadataReference.SystemTextRegularExpressions];\n#endif\n\n    public static References SystemRuntimeSerialization =>\n#if NETFRAMEWORK\n        FrameworkMetadataReference.SystemRuntimeSerialization;\n#else\n        [\n            CoreMetadataReference.SystemRuntimeSerialization,\n            CoreMetadataReference.SystemRuntimeSerializationPrimitives\n        ];\n#endif\n\n    public static References SystemXaml =>\n#if NETFRAMEWORK\n        FrameworkMetadataReference.SystemXaml;\n#else\n        [\n            CoreMetadataReference.SystemXmlReaderWriter,\n            CoreMetadataReference.SystemPrivateXml\n        ];\n#endif\n\n    public static References SystemXml =>\n#if NETFRAMEWORK\n        FrameworkMetadataReference.SystemXml;\n#else\n        NuGetMetadataReference.SystemConfigurationConfigurationManager()\n            .Union([\n                CoreMetadataReference.SystemPrivateXml,\n                CoreMetadataReference.SystemPrivateXmlLinq,\n                CoreMetadataReference.SystemXml,\n                CoreMetadataReference.SystemXmlXDocument,\n                CoreMetadataReference.SystemXmlReaderWriter]);\n#endif\n\n    public static References SystemXmlLinq =>\n#if NETFRAMEWORK\n        FrameworkMetadataReference.SystemXmlLinq;\n#else\n        [CoreMetadataReference.SystemXmlLinq];\n#endif\n\n    public static References SystemWeb =>\n#if NETFRAMEWORK\n        FrameworkMetadataReference.SystemWeb;\n#else\n        [CoreMetadataReference.SystemWeb];\n#endif\n\n    public static References SystemWindowsForms =>\n#if NETFRAMEWORK\n        FrameworkMetadataReference.SystemWindowsForms;\n#else\n        [WindowsDesktopMetadataReference.SystemWindowsForms];\n#endif\n\n    public static References SystemComponentModelComposition =>\n#if NETFRAMEWORK\n        FrameworkMetadataReference.SystemComponentModelComposition;\n#else\n        NuGetMetadataReference.SystemComponentModelComposition();\n#endif\n\n    public static References SystemCompositionAttributedModel =>\n        NuGetMetadataReference.SystemCompositionAttributedModel();\n\n    public static References SystemComponentModelPrimitives =>\n#if NETFRAMEWORK\n        [];\n#else\n        [CoreMetadataReference.SystemComponentModelPrimitives];\n#endif\n\n    public static References SystemComponentModelTypeConverter =>\n#if NETFRAMEWORK\n        [];\n#else\n        [CoreMetadataReference.SystemComponentModelTypeConverter];\n#endif\n\n    public static References SystemNetSockets =>\n#if NETFRAMEWORK\n        [];\n#else\n        [CoreMetadataReference.SystemNetSockets];\n#endif\n\n    public static References SystemNetPrimitives =>\n#if NETFRAMEWORK\n        [];\n#else\n        [CoreMetadataReference.SystemNetPrimitives];\n#endif\n\n    public static References WindowsBase =>\n#if NETFRAMEWORK\n        FrameworkMetadataReference.WindowsBase;\n#else\n        [];\n#endif\n\n    public static References ProjectDefaultReferences =>\n#if NETFRAMEWORK\n        FrameworkMetadataReference.Mscorlib\n            .Concat(FrameworkMetadataReference.System)\n            .Concat(FrameworkMetadataReference.SystemCore)\n            .Concat(FrameworkMetadataReference.SystemRuntime)\n            .Concat(FrameworkMetadataReference.SystemGlobalization);\n#else\n        NetStandard.Concat([\n            CoreMetadataReference.MsCorLib,\n            CoreMetadataReference.System,\n            CoreMetadataReference.SystemCollections,\n            CoreMetadataReference.SystemCollectionsSpecialized,\n            CoreMetadataReference.SystemConsole,\n            CoreMetadataReference.SystemCore,\n            CoreMetadataReference.SystemDiagnosticsTools,\n            CoreMetadataReference.SystemDiagnosticsTraceSource,\n            CoreMetadataReference.SystemGlobalization,\n            CoreMetadataReference.SystemIoFileSystem,\n            CoreMetadataReference.SystemIoFileSystemAccessControl,\n            CoreMetadataReference.SystemLinq,\n            CoreMetadataReference.SystemLinqExpressions,\n            CoreMetadataReference.SystemLinqQueryable,\n            CoreMetadataReference.SystemObjectModel,\n            CoreMetadataReference.SystemPrivateCoreLib,\n            CoreMetadataReference.SystemPrivateUri,\n            CoreMetadataReference.SystemRuntime,\n            CoreMetadataReference.SystemRuntimeExtensions,\n            CoreMetadataReference.SystemRuntimeInteropServices,\n            CoreMetadataReference.SystemSecurityAccessControl,\n            CoreMetadataReference.SystemSecurityPrincipalWindows]);\n#endif\n\n    public static References SystemThreadingTasksExtensions(string version) =>\n#if NETFRAMEWORK\n        NuGetMetadataReference.SystemThreadingTasksExtensions(version);\n#else\n        [CoreMetadataReference.SystemThreadingTasks];\n#endif\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/MetadataReferences/MetadataReferenceFactory.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.TestFramework.MetadataReferences;\n\n#if NET\n\npublic enum Sdk\n{\n    NETCore,    // This is the default folder with system assemblies\n    AspNetCore,\n    WindowsDesktop\n}\n\n#endif\n\ninternal static class MetadataReferenceFactory\n{\n    private static readonly string SystemAssembliesFolder = Path.GetDirectoryName(typeof(object).Assembly.Location);\n\n    public static IEnumerable<MetadataReference> Create(string assemblyName) =>\n        ImmutableArray.Create(CreateReference(assemblyName));\n\n    public static MetadataReference Create(Type type) =>\n        MetadataReference.CreateFromFile(type.Assembly.Location);\n\n#if NET\n\n    public static MetadataReference CreateReference(string assemblyName, Sdk sdk)\n    {\n        var  path = sdk switch\n        {\n            Sdk.AspNetCore => SdkPathProvider.LatestAspNetCoreSdkFolder(),\n            Sdk.WindowsDesktop => SdkPathProvider.LatestWindowsDesktopSdkFolder(),\n            _ => SystemAssembliesFolder\n        };\n\n        return MetadataReference.CreateFromFile(Path.Combine(path, assemblyName));\n    }\n\n#endif\n\n    public static MetadataReference CreateReference(string assemblyName) =>\n        MetadataReference.CreateFromFile(Path.Combine(SystemAssembliesFolder, assemblyName));\n\n    public static MetadataReference CreateReference(string assemblyName, string subFolder) =>\n        MetadataReference.CreateFromFile(Path.Combine(SystemAssembliesFolder, subFolder, assemblyName));\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/MetadataReferences/NuGetMetadataFactory.Package.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Globalization;\nusing NuGet.Common;\nusing NuGet.Configuration;\nusing NuGet.Packaging;\nusing NuGet.Protocol;\nusing NuGet.Protocol.Core.Types;\nusing NuGet.Versioning;\n\nnamespace SonarAnalyzer.TestFramework.MetadataReferences;\n\ninternal static partial class NuGetMetadataFactory\n{\n    private const string PackageVersionPrefix = \"Sonar.\";\n\n    private sealed class Package\n    {\n        private readonly string runtime;\n        private readonly string version;\n\n        public string Id { get; }\n\n        public Package(string id, string version, string runtime)\n        {\n            Id = id;\n            this.runtime = runtime;\n            this.version = version == TestConstants.NuGetLatestVersion\n                ? LatestVersion().Result\n                : version;\n        }\n\n        public string EnsureInstalled()\n        {\n            // Check to see if the specific package is already installed\n            var packageDir = Path.GetFullPath(Path.Combine(PackagesFolder, Id, PackageVersionPrefix + version, runtime is null ? string.Empty : $@\"runtimes\\{runtime}\\\"));\n            if (!Directory.Exists(packageDir))\n            {\n                LogMessage($\"Package not found at {packageDir}, will attempt to download and install.\");\n                InstallPackageAsync(packageDir).Wait();\n            }\n\n            return packageDir;\n        }\n\n        private async Task InstallPackageAsync(string packageDir)\n        {\n            var resource = await NuGetRepository().ConfigureAwait(false);\n            using var packageStream = new MemoryStream();\n            await resource.CopyNupkgToStreamAsync(Id, new NuGetVersion(version), packageStream, new SourceCacheContext(), NullLogger.Instance, default).ConfigureAwait(false);\n            using var packageReader = new PackageArchiveReader(packageStream);\n            var dllFiles = packageReader.GetFiles().Where(x => x.EndsWith(\".dll\", StringComparison.OrdinalIgnoreCase)).ToArray();\n            if (dllFiles.Any())\n            {\n                foreach (var dllFile in dllFiles)\n                {\n                    packageReader.ExtractFile(dllFile, Path.Combine(packageDir, dllFile), NullLogger.Instance);\n                }\n            }\n            else\n            {\n                throw new InvalidOperationException($\"Test setup error: required dlls files are missing in the downloaded package. Package: {Id} Runtime: {runtime}\");\n            }\n        }\n\n        private static async Task<FindPackageByIdResource> NuGetRepository()\n        {\n            // We don't read and verify trustedSigners. These packages are stored in dedicated directories that are not used by regular NuGet restore.\n            var source = SettingsFileName() is { } fileName\n                ? PackageSourceProvider.LoadPackageSources(Settings.LoadSpecificSettings(Paths.AnalyzersRoot, fileName)).Single()   // CI, or Sonar local machine\n                : new PackageSource(\"https://api.nuget.org/v3/index.json\");                                                         // External contributor local machine\n            return await Repository.Factory.GetCoreV3(source).GetResourceAsync<FindPackageByIdResource>().ConfigureAwait(false);\n\n            static string SettingsFileName()\n            {\n                if (File.Exists(Path.Combine(Paths.ProjectRoot, \"CI.NuGet.Config\")))\n                {\n                    return TestEnvironment.IsAzureDevOpsContext ? \"CI.NuGet.Config\" : null;\n                }\n                else\n                {\n                    return \"NuGet.Config\";\n                }\n            }\n        }\n\n        private async Task<string> LatestVersion()\n        {\n            const int VersionCheckDays = 5;\n            var path = Path.Combine(PackagesFolder, Id, \"Sonar.Latest.txt\");\n            var (nextCheck, latest) =\n                File.Exists(path)\n                && File.ReadAllText(path).Split(';') is var values\n                && DateTime.TryParseExact(values[0], \"yyyy-MM-dd\", CultureInfo.InvariantCulture, DateTimeStyles.None, out var nextCheckValue)\n                    ? Pair.From(nextCheckValue, values[1])\n                    : new(DateTime.MinValue, null);\n            LogMessage($\"Next check for latest NuGets: {nextCheck}\");\n            if (nextCheck < DateTime.Now)\n            {\n                var resource = await NuGetRepository().ConfigureAwait(false);\n                var versions = await resource.GetAllVersionsAsync(Id, new SourceCacheContext(), NullLogger.Instance, default).ConfigureAwait(false);\n                latest = versions.OrderByDescending(x => x.Version).First(x => !x.IsPrerelease).OriginalVersion;\n                new FileInfo(path).Directory.Create(); // Ensure that folder exists, if not create one\n                File.WriteAllText(path, $\"{DateTime.Today.AddDays(VersionCheckDays):yyyy-MM-dd};{latest}\");\n            }\n            return latest;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/MetadataReferences/NuGetMetadataFactory.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.TestFramework.MetadataReferences;\n\ninternal static partial class NuGetMetadataFactory\n{\n    // We use the global nuget cache for storing our packages if the NUGET_PACKAGES environment variable is defined.\n    // This is especially helpful on the build agents where the packages are precached\n    // (since we don't need to spawn a new process for calling the nuget.exe to install or copy them from global cache)\n    private static readonly string PackagesFolder;\n\n    private static readonly string[] SortedAllowedDirectories =\n    {\n        \"net\",\n        \"netstandard2.0\",\n        \"netstandard2.1\",\n        \"net7.0\",\n        \"net6.0\",\n        \"net8.0\",\n        \"net9.0\",\n        \"net10.0\",\n        \"net47\",\n        \"net461\",\n        \"netstandard1.6\",\n        \"netstandard1.5\",\n        \"netstandard1.3\",\n        \"netstandard1.1\",\n        \"netstandard1.0\",\n        \"net452\",\n        \"net451\",\n        \"net45\",\n        \"net40\",\n        \"net20\",\n        \"portable-net45\",\n        \"lib\", // This has to be last, some packages have DLLs directly in \"lib\" directory\n    };\n\n    static NuGetMetadataFactory()\n    {\n        PackagesFolder = Environment.GetEnvironmentVariable(\"NUGET_PACKAGES\") ?? Path.Combine(Paths.AnalyzersRoot, \"packages\");\n        LogMessage($\"Using packages from {PackagesFolder}\");\n    }\n\n    /// <param name=\"dllDirectory\">Name of the directory containing DLL files inside *.nupgk/lib/{dllDirectory}/ or *.nupgk/runtimes/{runtime}/lib/{dllDirectory}/ folder.\n    /// This directory name represents target framework in most cases.</param>\n    public static IEnumerable<MetadataReference> Create(string packageId, string packageVersion, string runtime, string dllDirectory) =>\n        Create(new Package(packageId, packageVersion, runtime), new[] { dllDirectory });\n\n    public static IEnumerable<MetadataReference> Create(string packageId, string packageVersion, string runtime = null) =>\n        Create(new Package(packageId, packageVersion, runtime), SortedAllowedDirectories);\n\n    /// <param name=\"allowedDirectories\">List of allowed directories sorted by preference to search for DLL files.</param>\n    private static IEnumerable<MetadataReference> Create(Package package, string[] allowedDirectories)\n    {\n        if (package.Id == \"Microsoft.Build.NoTargets\")\n        {\n            return Enumerable.Empty<MetadataReference>();\n        }\n\n        var packageDir = package.EnsureInstalled();\n        // some packages (see Mono.Posix.NETStandard.1.0.0) may contain target framework only in ref folder\n        var dllsPerDirectory = Directory.GetFiles(packageDir, \"*.dll\", SearchOption.AllDirectories)\n                                        .GroupBy(x => Path.GetDirectoryName(x).Split('+').First())\n                                        .Select(x => new { directory = Path.GetFileName(x.Key), dllPaths = x.AsEnumerable() })\n                                        .ToArray();\n\n        foreach (var allowedDirectory in allowedDirectories)\n        {\n            // dllsPerDirectory can contain the same <directory> from \\lib\\<directory> and \\ref\\<directory>. We don't care who wins.\n            if (dllsPerDirectory.Where(x => x.directory == allowedDirectory).Select(x => x.dllPaths).FirstOrDefault() is { } dllPaths)\n            {\n                foreach (var dllPath in dllPaths)\n                {\n                    LogMessage(\"File: \" + dllPath);\n                }\n                return dllPaths.Select(x => MetadataReference.CreateFromFile(x)).ToArray();\n            }\n        }\n\n        throw new InvalidOperationException($\"No allowed DLL directory was found in {packageDir}. Add new target framework to SortedAllowedDirectories or set dllDirectory argument explicitly.\");\n    }\n\n    private static void LogMessage(string message) =>\n        Console.WriteLine($\"Test setup: {message}\");\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/MetadataReferences/NuGetMetadataReference.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing static SonarAnalyzer.TestFramework.MetadataReferences.NuGetMetadataFactory;\nusing static SonarAnalyzer.TestFramework.MetadataReferences.NugetPackageVersions;\nusing References = System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.MetadataReference>;\n\nnamespace SonarAnalyzer.TestFramework.MetadataReferences;\n\npublic static class NuGetMetadataReference\n{\n#pragma warning disable S103  // Lines should not be too long\n#pragma warning disable T0016 // Add an empty line before this declaration\n#pragma warning disable T0032 // Internal Styling Rule T0032\n    // Hardcoded version\n    public static References MicrosoftVisualStudioQualityToolsUnitTestFramework =>\n        Create(\"VS.QualityTools.UnitTestFramework\", \"15.0.27323.2\", null, \"Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll\");\n    public static References MSTestTestFrameworkV1 => Create(\"MSTest.TestFramework\", MsTest.Ver11);\n    public static References MSTestTestFrameworkV3 => Create(\"MSTest.TestFramework\", MsTest.Ver311);\n    public static References XunitFrameworkV1 => Create(\"xunit\", \"1.9.1\").Concat(Create(\"xunit.extensions\", \"1.9.1\"));\n\n    // Passed version\n    public static References AzureCore(string packageVersion = TestConstants.NuGetLatestVersion) => Create(\"Azure.Core\", packageVersion);\n    public static References AzureIdentity(string packageVersion = TestConstants.NuGetLatestVersion) => Create(\"Azure.Identity\", packageVersion);\n    public static References AzureMessagingServiceBus(string packageVersion = TestConstants.NuGetLatestVersion) => Create(\"Azure.Messaging.ServiceBus\", packageVersion);\n    public static References AzureResourceManager(string packageVersion = TestConstants.NuGetLatestVersion) => Create(\"Azure.ResourceManager\", packageVersion);\n    public static References AzureStorageCommon(string packageVersion = TestConstants.NuGetLatestVersion) => Create(\"Azure.Storage.Common\", packageVersion);\n    public static References AzureStorageBlobs(string packageVersion = TestConstants.NuGetLatestVersion) => Create(\"Azure.Storage.Blobs\", packageVersion);\n    public static References AzureStorageFilesDataLake(string packageVersion = TestConstants.NuGetLatestVersion) => Create(\"Azure.Storage.Files.DataLake\", packageVersion);\n    public static References AzureStorageFilesShares(string packageVersion = TestConstants.NuGetLatestVersion) => Create(\"Azure.Storage.Files.Shares\", packageVersion);\n    public static References AzureStorageQueues(string packageVersion = TestConstants.NuGetLatestVersion) => Create(\"Azure.Storage.Queues\", packageVersion);\n    public static References BouncyCastle(string packageVersion = \"1.8.5\") => Create(\"BouncyCastle\", packageVersion);\n    public static References BouncyCastleCryptography(string packageVersion = TestConstants.NuGetLatestVersion) => Create(\"BouncyCastle.Cryptography\", packageVersion);\n    public static References CastleCore(string packageVersion = \"5.1.1\") => Create(\"Castle.Core\", packageVersion);\n    public static References Dapper(string packageVersion = \"1.50.5\") => Create(\"Dapper\", packageVersion);\n    public static References CommonLoggingCore(string packageVersion = TestConstants.NuGetLatestVersion) => Create(\"Common.Logging.Core\", packageVersion);\n    public static References EntityFramework(string packageVersion = \"6.2.0\") => Create(\"EntityFramework\", packageVersion);\n    public static References FluentAssertions(string packageVersion) =>\n        packageVersion == TestConstants.NuGetLatestVersion\n            ? throw new InvalidOperationException(\"FluentAssertions v8+ requires a paid commercial license. Use a specific v7.x version instead.\")\n            : Create(\"FluentAssertions\", packageVersion);\n    public static References FluentValidation(string packageVersion = TestConstants.NuGetLatestVersion) => Create(\"FluentValidation\", packageVersion);\n    public static References FakeItEasy(string packageVersion) => Create(\"FakeItEasy\", packageVersion);\n    public static References FsCheckXunit(string packageVersion = TestConstants.NuGetLatestVersion) =>\n        [\n            .. Create(\"FsCheck\", packageVersion),\n            .. Create(\"FsCheck.Xunit\", packageVersion),\n            .. XunitFramework(TestConstants.NuGetLatestVersion),\n        ];\n    public static References FsCheckNunit(string packageVersion = TestConstants.NuGetLatestVersion) =>\n        [\n            .. Create(\"FsCheck\", packageVersion),\n            .. Create(\"FsCheck.NUnit\", packageVersion),\n            .. NUnit(TestConstants.NuGetLatestVersion),\n        ];\n    public static References JetBrainsDotMemoryUnit(string packageVersion) => Create(\"JetBrains.DotMemoryUnit\", packageVersion);\n    public static References JustMock(string packageVersion) => Create(\"JustMock\", packageVersion);\n    public static References JWT(string packageVersion) => Create(\"JWT\", packageVersion);\n    public static References Log4Net(string packageVersion, string targetFramework) => Create(\"log4net\", packageVersion, null, targetFramework);\n    public static References MachineSpecifications(string packageVersion) => Create(\"Machine.Specifications\", packageVersion);\n    public static References MicrosoftAspNetCore(string packageVersion) => Create(\"Microsoft.AspNetCore\", packageVersion);\n    public static References MicrosoftAspNetCoreComponents(string packageVersion) => Create(\"Microsoft.AspNetCore.Components\", packageVersion);\n    public static References MicrosoftAspNetCoreComponentsWeb(string packageVersion = TestConstants.NuGetLatestVersion) => Create(\"Microsoft.AspNetCore.Components.Web\", packageVersion);\n    public static References MicrosoftAspNetCoreDiagnostics(string packageVersion) => Create(\"Microsoft.AspNetCore.Diagnostics\", packageVersion);\n    public static References MicrosoftAspNetCoreDiagnosticsEntityFrameworkCore(string packageVersion) => Create(\"Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore\", packageVersion);\n    public static References MicrosoftAspNetCoreHosting(string packageVersion) => Create(\"Microsoft.AspNetCore.Hosting\", packageVersion);\n    public static References MicrosoftAspNetCoreHostingAbstractions(string packageVersion) => Create(\"Microsoft.AspNetCore.Hosting.Abstractions\", packageVersion);\n    public static References MicrosoftAspNetCoreHttpAbstractions(string packageVersion = \"2.2.0\") => Create(\"Microsoft.AspNetCore.Http.Abstractions\", packageVersion);\n    public static References MicrosoftAspNetCoreHttpFeatures(string packageVersion) => Create(\"Microsoft.AspNetCore.Http.Features\", packageVersion);\n    public static References MicrosoftAspNetCoreMvcAbstractions(string packageVersion) => Create(\"Microsoft.AspNetCore.Mvc.Abstractions\", packageVersion);\n    public static References MicrosoftAspNetCoreMvcCore(string packageVersion) => Create(\"Microsoft.AspNetCore.Mvc.Core\", packageVersion);\n    public static References MicrosoftAspNetCoreMvcViewFeatures(string packageVersion) => Create(\"Microsoft.AspNetCore.Mvc.ViewFeatures\", packageVersion);\n    public static References MicrosoftAspNetCoreMvcWebApiCompatShim(string packageVersion) => Create(\"Microsoft.AspNetCore.Mvc.WebApiCompatShim\", packageVersion);\n    public static References MicrosoftAspNetCoreRouting(string packageVersion) => Create(\"Microsoft.AspNetCore.Routing\", packageVersion);\n    public static References MicrosoftAspNetCoreMvcRazorRuntime(string packageVersion = \"2.2.0\") => Create(\"Microsoft.AspNetCore.Razor.Runtime\", packageVersion);\n    public static References MicrosoftAspNetCoreRoutingAbstractions(string packageVersion) => Create(\"Microsoft.AspNetCore.Routing.Abstractions\", packageVersion);\n    // There is no package version of Microsoft.AspNet.Identity that is NOT a pre-release.\n    public static References MicrosoftAspNetIdentity(string packageVersion = \"3.0.0-rc1-final\") => Create(\"Microsoft.AspNet.Identity\", packageVersion);\n    public static References MicrosoftAspNetMvc(string packageVersion) => Create(\"Microsoft.AspNet.Mvc\", packageVersion);\n    public static References MicrosoftAspNetCoreAppRef(string packageVersion) => Create(\"Microsoft.AspNetCore.App.Ref\", packageVersion);\n    public static References MicrosoftAspNetSignalRCore(string packageVersion = \"2.4.1\") => Create(\"Microsoft.AspNet.SignalR.Core\", packageVersion);\n    public static References MicrosoftAspNetWebApiCors(string packageVersion) => Create(\"Microsoft.AspNet.WebApi.Cors\", packageVersion);\n    public static References MicrosoftAzureCosmos(string packageVersion = TestConstants.NuGetLatestVersion) => Create(\"Microsoft.Azure.Cosmos\", packageVersion);\n    public static References MicrosoftAzureDocumentDB(string packageVersion = TestConstants.NuGetLatestVersion) => Create(\"Microsoft.Azure.DocumentDB\", packageVersion);\n    public static References MicrosoftAzureServiceBus(string packageVersion = TestConstants.NuGetLatestVersion) => Create(\"Microsoft.Azure.ServiceBus\", packageVersion);\n    public static References MicrosoftAzureWebJobs(string packageVersion = TestConstants.NuGetLatestVersion) => Create(\"Microsoft.Azure.WebJobs\", packageVersion);\n    public static References MicrosoftAzureWebJobsCore(string packageVersion = TestConstants.NuGetLatestVersion) => Create(\"Microsoft.Azure.WebJobs.Core\", packageVersion);\n    public static References MicrosoftAzureWebJobsExtensionsDurableTask(string packageVersion = TestConstants.NuGetLatestVersion) => Create(\"Microsoft.Azure.WebJobs.Extensions.DurableTask\", packageVersion);\n    public static References MicrosoftAzureWebJobsExtensionsHttp(string packageVersion = TestConstants.NuGetLatestVersion) => Create(\"Microsoft.Azure.WebJobs.Extensions.Http\", packageVersion);\n    public static References MicrosoftBuildNoTargets(string packageVersion = \"3.1.0\") => Create(\"Microsoft.Build.NoTargets\", packageVersion);\n    public static References MicrosoftCodeAnalysisCSharp(string packageVersion = TestConstants.NuGetLatestVersion) =>\n        [\n        ..Create(\"Microsoft.CodeAnalysis.Common\", packageVersion),\n        ..Create(\"Microsoft.CodeAnalysis.CSharp\", packageVersion),\n        ];\n    public static References MicrosoftCodeAnalysisCSharpSourceGeneratorsTesting(string packageVersion = TestConstants.NuGetLatestVersion) =>\n        [\n        ..Create(\"Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing\", packageVersion),\n        ..Create(\"Microsoft.CodeAnalysis.SourceGenerators.Testing\", packageVersion),\n        ];\n    public static References MicrosoftCodeAnalysisAnalyzerTesting(string packageVersion = TestConstants.NuGetLatestVersion) =>\n        [\n        ..Create(\"Microsoft.CodeAnalysis.CSharp.Analyzer.Testing\", packageVersion),\n        ..Create(\"Microsoft.CodeAnalysis.Analyzer.Testing\", packageVersion),\n        ];\n    public static References MicrosoftDataSqlClient(string packageVersion = \"5.1.0\") => Create(\"Microsoft.Data.SqlClient\", packageVersion);\n    public static References MicrosoftDataSqliteCore(string packageVersion = \"2.0.0\") => Create(\"Microsoft.Data.Sqlite.Core\", packageVersion);\n    public static References MicrosoftEntityFramework(string packageVersion) => Create(\"EntityFramework\", packageVersion);\n    public static References MicrosoftEntityFrameworkCore(string packageVersion) => Create(\"Microsoft.EntityFrameworkCore\", packageVersion);\n    public static References MicrosoftEntityFrameworkCoreAbstractions(string packageVersion) => Create(\"Microsoft.EntityFrameworkCore.Abstractions\", packageVersion);\n    public static References MicrosoftEntityFrameworkCoreSqliteCore(string packageVersion) => Create(\"Microsoft.EntityFrameworkCore.Sqlite.Core\", packageVersion);\n    public static References MicrosoftEntityFrameworkCoreSqlServer(string packageVersion) => Create(\"Microsoft.EntityFrameworkCore.SqlServer\", packageVersion);\n    public static References MicrosoftEntityFrameworkCoreRelational(string packageVersion) => Create(\"Microsoft.EntityFrameworkCore.Relational\", packageVersion);\n    public static References MicrosoftExtensionsConfigurationAbstractions(string packageVersion) => Create(\"Microsoft.Extensions.Configuration.Abstractions\", packageVersion);\n    public static References MicrosoftExtensionsDependencyInjectionAbstractions(string packageVersion) => Create(\"Microsoft.Extensions.DependencyInjection.Abstractions\", packageVersion);\n    public static References MicrosoftExtensionsHttp(string packageVersion = TestConstants.NuGetLatestVersion) => Create(\"Microsoft.Extensions.Http\", packageVersion);\n    public static References MicrosoftExtensionsLoggingPackages(string packageVersion) =>\n        Create(\"Microsoft.Extensions.Logging\", packageVersion)\n            .Concat(Create(\"Microsoft.Extensions.Logging.AzureAppServices\", packageVersion))\n            .Concat(Create(\"Microsoft.Extensions.Logging.Abstractions\", packageVersion))\n            .Concat(Create(\"Microsoft.Extensions.Logging.Console\", packageVersion))\n            .Concat(Create(\"Microsoft.Extensions.Logging.Debug\", packageVersion))\n            .Concat(Create(\"Microsoft.Extensions.Logging.EventLog\", packageVersion));\n    public static References MicrosoftExtensionsLoggingAbstractions(string packageVersion = TestConstants.NuGetLatestVersion) => Create(\"Microsoft.Extensions.Logging.Abstractions\", packageVersion);\n    public static References MicrosoftExtensionsOptions(string packageVersion) => Create(\"Microsoft.Extensions.Options\", packageVersion);\n    public static References MicrosoftExtensionsPrimitives(string packageVersion) => Create(\"Microsoft.Extensions.Primitives\", packageVersion);\n    public static References MicrosoftIdentityModelTokens(string packageVersion = TestConstants.NuGetLatestVersion) => Create(\"Microsoft.IdentityModel.Tokens\", packageVersion);\n    public static References MicrosoftJSInterop(string packageVersion) => Create(\"Microsoft.JSInterop\", packageVersion);\n    public static References MicrosoftNetHttpHeaders(string packageVersion) => Create(\"Microsoft.Net.Http.Headers\", packageVersion);\n    public static References MicrosoftNetSdkFunctions(string packageVersion = TestConstants.NuGetLatestVersion) =>\n        Create(\"Microsoft.NET.Sdk.Functions\", packageVersion)\n            .Concat(MicrosoftAzureWebJobs(packageVersion))\n            .Concat(MicrosoftAzureWebJobsCore(packageVersion))\n            .Concat(MicrosoftAzureWebJobsExtensionsHttp(packageVersion))\n            .Concat(MicrosoftExtensionsLoggingPackages(packageVersion))\n            .Concat(MicrosoftAspNetCoreMvcAbstractions(packageVersion))\n            .Concat(MicrosoftAspNetCoreMvcCore(packageVersion))\n            .Concat(MicrosoftAspNetCoreHttpAbstractions(packageVersion));\n    public static References MicrosoftNetWebApiCore(string packageVersion) => Create(\"Microsoft.AspNet.WebApi.Core\", packageVersion);\n    public static References MicrosoftSqlServerCompact(string packageVersion = \"4.0.8876.1\") => Create(\"Microsoft.SqlServer.Compact\", packageVersion);\n    public static References MicrosoftWebXdt(string packageVersion = \"3.0.0\") => Create(\"Microsoft.Web.Xdt\", packageVersion);\n    public static References MongoDBDriver(string packageVersion = TestConstants.NuGetLatestVersion) =>\n        Create(\"MongoDB.Driver\", packageVersion)\n            .Concat(MongoDBDriverCore(packageVersion));\n    public static References MongoDBDriverCore(string packageVersion = TestConstants.NuGetLatestVersion) => Create(\"MongoDB.Driver.Core\", packageVersion);\n    public static References MonoPosixNetStandard(string packageVersion = \"1.0.0\") => Create(\"Mono.Posix.NETStandard\", packageVersion, \"linux-x64\");\n    public static References MonoDataSqlite(string packageVersion = TestConstants.NuGetLatestVersion) => Create(\"Mono.Data.Sqlite\", packageVersion);\n    public static References Moq(string packageVersion) => Create(\"Moq\", packageVersion);\n    public static References MoreLinq(string packageVersion = TestConstants.NuGetLatestVersion) => Create(\"morelinq\", packageVersion);\n    public static References MSTestTestFramework(string packageVersion) => Create(\"MSTest.TestFramework\", packageVersion);\n    public static References MvvmLightLibs(string packageVersion) => Create(\"MvvmLightLibs\", packageVersion);\n    public static References MySqlData(string packageVersion) => Create(\"MySql.Data\", packageVersion);\n    public static References MySqlDataEntityFrameworkCore(string packageVersion = \"8.0.22\") => Create(\"MySql.Data.EntityFrameworkCore\", packageVersion);\n    public static References Nancy(string packageVersion = \"2.0.0\") => Create(\"Nancy\", packageVersion);\n    public static References NFluent(string packageVersion) => Create(\"NFluent\", packageVersion);\n    public static References NLog(string packageVersion = TestConstants.NuGetLatestVersion) => Create(\"NLog\", packageVersion);\n    public static References NHibernate(string packageVersion = \"5.2.2\") => Create(\"NHibernate\", packageVersion);\n    public static References NpgsqlEntityFrameworkCorePostgreSQL(string packageVersion) => Create(\"Npgsql.EntityFrameworkCore.PostgreSQL\", packageVersion);\n    public static References NSubstitute(string packageVersion) => Create(\"NSubstitute\", packageVersion);\n    public static References NewtonsoftJson(string packageVersion) => Create(\"Newtonsoft.Json\", packageVersion);\n    public static References NUnit(string packageVersion) => Create(\"NUnit\", packageVersion);\n    public static References NUnitLite(string packageVersion) => Create(\"NUnitLite\", packageVersion);\n    public static References OracleEntityFrameworkCore(string packageVersion) => Create(\"Oracle.EntityFrameworkCore\", packageVersion);\n    public static References OracleManagedDataAccessCore(string packageVersion = TestConstants.NuGetLatestVersion) => Create(\"Oracle.ManagedDataAccess.Core\", packageVersion);\n    public static References PetaPocoCompiled(string packageVersion = \"6.0.353\") => Create(\"PetaPoco.Compiled\", packageVersion);\n    public static References RhinoMocks(string packageVersion) => Create(\"RhinoMocks\", packageVersion);\n    public static References Shouldly(string packageVersion) => Create(\"Shouldly\", packageVersion);\n    public static References Serilog(string packageVersion = TestConstants.NuGetLatestVersion) => Create(\"Serilog\", packageVersion);\n    public static References SerilogSinksConsole(string packageVersion) => Create(\"Serilog.Sinks.Console\", packageVersion);\n    public static References ServiceStackOrmLite(string packageVersion = \"5.1.0\") => Create(\"ServiceStack.OrmLite\", packageVersion);\n    public static References SpecFlow(string packageVersion) => Create(\"SpecFlow\", packageVersion);\n    public static References SystemCollectionsImmutable(string packageVersion) => Create(\"System.Collections.Immutable\", packageVersion);\n    public static References SystemConfigurationConfigurationManager(string packageVersion = \"4.7.0\") => Create(\"System.Configuration.ConfigurationManager\", packageVersion);\n    public static References SystemComponentModelAnnotations(string packageVersion = \"5.0.0\") => Create(\"System.ComponentModel.Annotations\", packageVersion);\n    public static References SystemComponentModelComposition(string packageVersion = \"4.7.0\") => Create(\"System.ComponentModel.Composition\", packageVersion);\n    public static References SystemComponentModelTypeConverter(string packageVersion = \"4.3.0\") => Create(\"System.ComponentModel.TypeConverter\", packageVersion);\n    public static References SystemCompositionAttributedModel(string packageVersion = \"6.0.0\") => Create(\"System.Composition.AttributedModel\", packageVersion);\n    public static References SystemDataSqlServerCe(string packageVersion) => Create(\"Microsoft.SqlServer.Compact\", packageVersion);\n    public static References SystemDataOdbc(string packageVersion = \"4.5.0\") => Create(\"System.Data.Odbc\", packageVersion);\n    public static References SystemDataSqlClient(string packageVersion = \"4.5.0\") => Create(\"System.Data.SqlClient\", packageVersion);\n    public static References SystemDataSQLiteCore(string packageVersion = \"1.0.109.0\") => Create(\"System.Data.SQLite.Core\", packageVersion);\n    public static References SystemDataOracleClient(string packageVersion = \"1.0.8\") => Create(\"System.Data.OracleClient\", packageVersion);\n    public static References SystemDDirectoryServices(string packageVersion = \"4.7.0\") => Create(\"System.DirectoryServices\", packageVersion);\n    public static References SystemDrawingCommon(string packageVersion = \"4.7.0\") => Create(\"System.Drawing.Common\", packageVersion);\n    public static References SystemIdentityModelTokensJwt(string packageVersion = TestConstants.NuGetLatestVersion) => Create(\"System.IdentityModel.Tokens.Jwt\", packageVersion);\n    public static References SystemMemory(string packageVersion = TestConstants.NuGetLatestVersion) => Create(\"System.Memory\", packageVersion);\n    public static References SystemNetHttp(string packageVersion = TestConstants.NuGetLatestVersion) => Create(\"System.Net.Http\", packageVersion);\n    public static References SystemSecurityCryptographyOpenSsl(string packageVersion = \"4.7.0\") => Create(\"System.Security.Cryptography.OpenSsl\", packageVersion);\n    public static References SystemSecurityCryptographyXml(string packageVersion = TestConstants.NuGetLatestVersion) => Create(\"System.Security.Cryptography.Xml\", packageVersion);\n    public static References SystemSecurityPermissions(string packageVersion = \"4.7.0\") => Create(\"System.Security.Permissions\", packageVersion);\n    public static References SystemPrivateServiceModel(string packageVersion = \"4.7.0\") => Create(\"System.Private.ServiceModel\", packageVersion);\n    public static References SystemServiceModelPrimitives(string packageVersion = \"4.7.0\") => Create(\"System.ServiceModel.Primitives\", packageVersion);\n    public static References SystemTextEncodingsWeb(string packageVersion) => Create(\"System.Text.Encodings.Web\", packageVersion);\n    public static References SystemTextJson(string packageVersion) => Create(\"System.Text.Json\", packageVersion);\n    public static References SystemTextRegularExpressions(string packageVersion = \"4.3.1\") => Create(\"System.Text.RegularExpressions\", packageVersion);\n    public static References SystemThreadingTasksExtensions(string packageVersion) => Create(\"System.Threading.Tasks.Extensions\", packageVersion);\n    public static References SystemValueTuple(string packageVersion) => Create(\"System.ValueTuple\", packageVersion);\n    public static References SwashbuckleAspNetCoreAnnotations(string packageVersion = TestConstants.NuGetLatestVersion) => Create(\"Swashbuckle.AspNetCore.Annotations\", packageVersion);\n    public static References SwashbuckleAspNetCoreSwagger(string packageVersion = TestConstants.NuGetLatestVersion) => Create(\"Swashbuckle.AspNetCore.Swagger\", packageVersion);\n    public static References TimeZoneConverter(string packageVersion = TestConstants.NuGetLatestVersion) => Create(\"TimeZoneConverter\", packageVersion);\n    public static References XunitFramework(string packageVersion) =>\n        [.. Create(\"xunit.assert\", packageVersion), .. Create(\"xunit.extensibility.core\", packageVersion)];\n    public static References XunitFrameworkV3(string packageVersion = TestConstants.NuGetLatestVersion) =>\n        [.. Create(\"xunit.v3.assert\", packageVersion), .. Create(\"xunit.v3.extensibility.core\", packageVersion)];\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/MetadataReferences/NugetPackageVersions.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.TestFramework.MetadataReferences;\n\npublic static class NugetPackageVersions\n{\n    public const string Latest = TestConstants.NuGetLatestVersion;\n\n    public static class FluentAssertionsVersions\n    {\n        public const string Ver1 = \"1.6.0\";\n        public const string Ver4 = \"4.19.4\";\n        public const string Ver5 = \"5.9.0\";\n        public const string Ver7 = \"7.2.2\"; // Last Apache 2.0 licensed version. v8+ requires a paid commercial license.\n    }\n\n    public static class MsTest\n    {\n        public const string Ver11 = \"1.1.11\";\n        public const string Ver12 = \"1.2.0\";\n        public const string Ver37 = \"3.7.3\";\n        public const string Ver38 = \"3.8.0\";\n        public const string Ver311 = \"3.11.0\";\n    }\n\n    public static class NUnit\n    {\n        public const string Ver25 = \"2.5.7.10213\";\n        public const string Ver27 = \"2.7.0\";\n        public const string Ver3 = \"3.11.0\";\n        public const string Ver3Latest = \"3.14.0\";\n        public const string Ver4 = \"4.3.2\";\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/MetadataReferences/WindowsDesktopMetadataReference.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\n#if NET\n\nusing static SonarAnalyzer.TestFramework.MetadataReferences.MetadataReferenceFactory;\n\nnamespace SonarAnalyzer.TestFramework.MetadataReferences;\n\ninternal static class WindowsDesktopMetadataReference\n{\n    internal static MetadataReference PresentationFramework { get; } = CreateReference(\"PresentationFramework.dll\", Sdk.WindowsDesktop);\n    internal static MetadataReference PresentationCore { get; } = CreateReference(\"PresentationCore.dll\", Sdk.WindowsDesktop);\n    internal static MetadataReference SystemWindowsForms { get; } = CreateReference(\"System.Windows.Forms.dll\", Sdk.WindowsDesktop);\n    internal static MetadataReference WindowsBase { get; } = CreateReference(\"WindowsBase.dll\", Sdk.WindowsDesktop);\n}\n\n#endif\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Packaging/RuleTypeMappingCS.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.TestFramework.Packaging;\n\npublic static class RuleTypeMappingCS\n{\n    public static readonly IImmutableDictionary<string, string> Rules = new Dictionary<string, string>\n    {\n        [\"S100\"] = \"CODE_SMELL\",\n        [\"S101\"] = \"CODE_SMELL\",\n        // [\"S102\"],\n        [\"S103\"] = \"CODE_SMELL\",\n        [\"S104\"] = \"CODE_SMELL\",\n        [\"S105\"] = \"CODE_SMELL\",\n        [\"S106\"] = \"CODE_SMELL\",\n        [\"S107\"] = \"CODE_SMELL\",\n        [\"S108\"] = \"CODE_SMELL\",\n        [\"S109\"] = \"CODE_SMELL\",\n        [\"S110\"] = \"CODE_SMELL\",\n        // [\"S111\"],\n        [\"S112\"] = \"CODE_SMELL\",\n        [\"S113\"] = \"CODE_SMELL\",\n        // [\"S114\"],\n        // [\"S115\"],\n        // [\"S116\"],\n        // [\"S117\"],\n        // [\"S118\"],\n        // [\"S119\"],\n        // [\"S120\"],\n        [\"S121\"] = \"CODE_SMELL\",\n        [\"S122\"] = \"CODE_SMELL\",\n        // [\"S123\"],\n        // [\"S124\"],\n        [\"S125\"] = \"CODE_SMELL\",\n        [\"S126\"] = \"CODE_SMELL\",\n        [\"S127\"] = \"CODE_SMELL\",\n        // [\"S128\"],\n        // [\"S129\"],\n        // [\"S130\"],\n        [\"S131\"] = \"CODE_SMELL\",\n        // [\"S132\"],\n        // [\"S133\"],\n        [\"S134\"] = \"CODE_SMELL\",\n        // [\"S135\"],\n        // [\"S136\"],\n        // [\"S137\"],\n        [\"S138\"] = \"CODE_SMELL\",\n        // [\"S139\"],\n        // [\"S140\"],\n        // [\"S141\"],\n        // [\"S142\"],\n        // [\"S143\"],\n        // [\"S144\"],\n        // [\"S145\"],\n        // [\"S146\"],\n        // [\"S147\"],\n        // [\"S148\"],\n        // [\"S149\"],\n        // [\"S150\"],\n        // [\"S151\"],\n        // [\"S152\"],\n        // [\"S153\"],\n        // [\"S154\"],\n        // [\"S155\"],\n        // [\"S156\"],\n        // [\"S157\"],\n        // [\"S158\"],\n        // [\"S159\"],\n        // [\"S160\"],\n        // [\"S161\"],\n        // [\"S162\"],\n        // [\"S163\"],\n        // [\"S164\"],\n        // [\"S165\"],\n        // [\"S166\"],\n        // [\"S167\"],\n        // [\"S168\"],\n        // [\"S169\"],\n        // [\"S170\"],\n        // [\"S171\"],\n        // [\"S172\"],\n        // [\"S173\"],\n        // [\"S174\"],\n        // [\"S175\"],\n        // [\"S176\"],\n        // [\"S177\"],\n        // [\"S178\"],\n        // [\"S179\"],\n        // [\"S180\"],\n        // [\"S181\"],\n        // [\"S182\"],\n        // [\"S183\"],\n        // [\"S184\"],\n        // [\"S185\"],\n        // [\"S186\"],\n        // [\"S187\"],\n        // [\"S188\"],\n        // [\"S189\"],\n        // [\"S190\"],\n        // [\"S191\"],\n        // [\"S192\"],\n        // [\"S193\"],\n        // [\"S194\"],\n        // [\"S195\"],\n        // [\"S196\"],\n        // [\"S197\"],\n        // [\"S198\"],\n        // [\"S199\"],\n        // [\"S200\"],\n        // [\"S201\"],\n        // [\"S202\"],\n        // [\"S203\"],\n        // [\"S204\"],\n        // [\"S205\"],\n        // [\"S206\"],\n        // [\"S207\"],\n        // [\"S208\"],\n        // [\"S209\"],\n        // [\"S210\"],\n        // [\"S211\"],\n        // [\"S212\"],\n        // [\"S213\"],\n        // [\"S214\"],\n        // [\"S215\"],\n        // [\"S216\"],\n        // [\"S217\"],\n        // [\"S218\"],\n        // [\"S219\"],\n        // [\"S220\"],\n        // [\"S221\"],\n        // [\"S222\"],\n        // [\"S223\"],\n        // [\"S224\"],\n        // [\"S225\"],\n        // [\"S226\"],\n        // [\"S227\"],\n        // [\"S228\"],\n        // [\"S229\"],\n        // [\"S230\"],\n        // [\"S231\"],\n        // [\"S232\"],\n        // [\"S233\"],\n        // [\"S234\"],\n        // [\"S235\"],\n        // [\"S236\"],\n        // [\"S237\"],\n        // [\"S238\"],\n        // [\"S239\"],\n        // [\"S240\"],\n        // [\"S241\"],\n        // [\"S242\"],\n        // [\"S243\"],\n        // [\"S244\"],\n        // [\"S245\"],\n        // [\"S246\"],\n        // [\"S247\"],\n        // [\"S248\"],\n        // [\"S249\"],\n        // [\"S250\"],\n        // [\"S251\"],\n        // [\"S252\"],\n        // [\"S253\"],\n        // [\"S254\"],\n        // [\"S255\"],\n        // [\"S256\"],\n        // [\"S257\"],\n        // [\"S258\"],\n        // [\"S259\"],\n        // [\"S260\"],\n        // [\"S261\"],\n        // [\"S262\"],\n        // [\"S263\"],\n        // [\"S264\"],\n        // [\"S265\"],\n        // [\"S266\"],\n        // [\"S267\"],\n        // [\"S268\"],\n        // [\"S269\"],\n        // [\"S270\"],\n        // [\"S271\"],\n        // [\"S272\"],\n        // [\"S273\"],\n        // [\"S274\"],\n        // [\"S275\"],\n        // [\"S276\"],\n        // [\"S277\"],\n        // [\"S278\"],\n        // [\"S279\"],\n        // [\"S280\"],\n        // [\"S281\"],\n        // [\"S282\"],\n        // [\"S283\"],\n        // [\"S284\"],\n        // [\"S285\"],\n        // [\"S286\"],\n        // [\"S287\"],\n        // [\"S288\"],\n        // [\"S289\"],\n        // [\"S290\"],\n        // [\"S291\"],\n        // [\"S292\"],\n        // [\"S293\"],\n        // [\"S294\"],\n        // [\"S295\"],\n        // [\"S296\"],\n        // [\"S297\"],\n        // [\"S298\"],\n        // [\"S299\"],\n        // [\"S300\"],\n        // [\"S301\"],\n        // [\"S302\"],\n        // [\"S303\"],\n        // [\"S304\"],\n        // [\"S305\"],\n        // [\"S306\"],\n        // [\"S307\"],\n        // [\"S308\"],\n        // [\"S309\"],\n        // [\"S310\"],\n        // [\"S311\"],\n        // [\"S312\"],\n        // [\"S313\"],\n        // [\"S314\"],\n        // [\"S315\"],\n        // [\"S316\"],\n        // [\"S317\"],\n        // [\"S318\"],\n        // [\"S319\"],\n        // [\"S320\"],\n        // [\"S321\"],\n        // [\"S322\"],\n        // [\"S323\"],\n        // [\"S324\"],\n        // [\"S325\"],\n        // [\"S326\"],\n        // [\"S327\"],\n        // [\"S328\"],\n        // [\"S329\"],\n        // [\"S330\"],\n        // [\"S331\"],\n        // [\"S332\"],\n        // [\"S333\"],\n        // [\"S334\"],\n        // [\"S335\"],\n        // [\"S336\"],\n        // [\"S337\"],\n        // [\"S338\"],\n        // [\"S339\"],\n        // [\"S340\"],\n        // [\"S341\"],\n        // [\"S342\"],\n        // [\"S343\"],\n        // [\"S344\"],\n        // [\"S345\"],\n        // [\"S346\"],\n        // [\"S347\"],\n        // [\"S348\"],\n        // [\"S349\"],\n        // [\"S350\"],\n        // [\"S351\"],\n        // [\"S352\"],\n        // [\"S353\"],\n        // [\"S354\"],\n        // [\"S355\"],\n        // [\"S356\"],\n        // [\"S357\"],\n        // [\"S358\"],\n        // [\"S359\"],\n        // [\"S360\"],\n        // [\"S361\"],\n        // [\"S362\"],\n        // [\"S363\"],\n        // [\"S364\"],\n        // [\"S365\"],\n        // [\"S366\"],\n        // [\"S367\"],\n        // [\"S368\"],\n        // [\"S369\"],\n        // [\"S370\"],\n        // [\"S371\"],\n        // [\"S372\"],\n        // [\"S373\"],\n        // [\"S374\"],\n        // [\"S375\"],\n        // [\"S376\"],\n        // [\"S377\"],\n        // [\"S378\"],\n        // [\"S379\"],\n        // [\"S380\"],\n        // [\"S381\"],\n        // [\"S382\"],\n        // [\"S383\"],\n        // [\"S384\"],\n        // [\"S385\"],\n        // [\"S386\"],\n        // [\"S387\"],\n        // [\"S388\"],\n        // [\"S389\"],\n        // [\"S390\"],\n        // [\"S391\"],\n        // [\"S392\"],\n        // [\"S393\"],\n        // [\"S394\"],\n        // [\"S395\"],\n        // [\"S396\"],\n        // [\"S397\"],\n        // [\"S398\"],\n        // [\"S399\"],\n        // [\"S400\"],\n        // [\"S401\"],\n        // [\"S402\"],\n        // [\"S403\"],\n        // [\"S404\"],\n        // [\"S405\"],\n        // [\"S406\"],\n        // [\"S407\"],\n        // [\"S408\"],\n        // [\"S409\"],\n        // [\"S410\"],\n        // [\"S411\"],\n        // [\"S412\"],\n        // [\"S413\"],\n        // [\"S414\"],\n        // [\"S415\"],\n        // [\"S416\"],\n        // [\"S417\"],\n        // [\"S418\"],\n        // [\"S419\"],\n        // [\"S420\"],\n        // [\"S421\"],\n        // [\"S422\"],\n        // [\"S423\"],\n        // [\"S424\"],\n        // [\"S425\"],\n        // [\"S426\"],\n        // [\"S427\"],\n        // [\"S428\"],\n        // [\"S429\"],\n        // [\"S430\"],\n        // [\"S431\"],\n        // [\"S432\"],\n        // [\"S433\"],\n        // [\"S434\"],\n        // [\"S435\"],\n        // [\"S436\"],\n        // [\"S437\"],\n        // [\"S438\"],\n        // [\"S439\"],\n        // [\"S440\"],\n        // [\"S441\"],\n        // [\"S442\"],\n        // [\"S443\"],\n        // [\"S444\"],\n        // [\"S445\"],\n        // [\"S446\"],\n        // [\"S447\"],\n        // [\"S448\"],\n        // [\"S449\"],\n        // [\"S450\"],\n        // [\"S451\"],\n        // [\"S452\"],\n        // [\"S453\"],\n        // [\"S454\"],\n        // [\"S455\"],\n        // [\"S456\"],\n        // [\"S457\"],\n        // [\"S458\"],\n        // [\"S459\"],\n        // [\"S460\"],\n        // [\"S461\"],\n        // [\"S462\"],\n        // [\"S463\"],\n        // [\"S464\"],\n        // [\"S465\"],\n        // [\"S466\"],\n        // [\"S467\"],\n        // [\"S468\"],\n        // [\"S469\"],\n        // [\"S470\"],\n        // [\"S471\"],\n        // [\"S472\"],\n        // [\"S473\"],\n        // [\"S474\"],\n        // [\"S475\"],\n        // [\"S476\"],\n        // [\"S477\"],\n        // [\"S478\"],\n        // [\"S479\"],\n        // [\"S480\"],\n        // [\"S481\"],\n        // [\"S482\"],\n        // [\"S483\"],\n        // [\"S484\"],\n        // [\"S485\"],\n        // [\"S486\"],\n        // [\"S487\"],\n        // [\"S488\"],\n        // [\"S489\"],\n        // [\"S490\"],\n        // [\"S491\"],\n        // [\"S492\"],\n        // [\"S493\"],\n        // [\"S494\"],\n        // [\"S495\"],\n        // [\"S496\"],\n        // [\"S497\"],\n        // [\"S498\"],\n        // [\"S499\"],\n        // [\"S500\"],\n        // [\"S501\"],\n        // [\"S502\"],\n        // [\"S503\"],\n        // [\"S504\"],\n        // [\"S505\"],\n        // [\"S506\"],\n        // [\"S507\"],\n        // [\"S508\"],\n        // [\"S509\"],\n        // [\"S510\"],\n        // [\"S511\"],\n        // [\"S512\"],\n        // [\"S513\"],\n        // [\"S514\"],\n        // [\"S515\"],\n        // [\"S516\"],\n        // [\"S517\"],\n        // [\"S518\"],\n        // [\"S519\"],\n        // [\"S520\"],\n        // [\"S521\"],\n        // [\"S522\"],\n        // [\"S523\"],\n        // [\"S524\"],\n        // [\"S525\"],\n        // [\"S526\"],\n        // [\"S527\"],\n        // [\"S528\"],\n        // [\"S529\"],\n        // [\"S530\"],\n        // [\"S531\"],\n        // [\"S532\"],\n        // [\"S533\"],\n        // [\"S534\"],\n        // [\"S535\"],\n        // [\"S536\"],\n        // [\"S537\"],\n        // [\"S538\"],\n        // [\"S539\"],\n        // [\"S540\"],\n        // [\"S541\"],\n        // [\"S542\"],\n        // [\"S543\"],\n        // [\"S544\"],\n        // [\"S545\"],\n        // [\"S546\"],\n        // [\"S547\"],\n        // [\"S548\"],\n        // [\"S549\"],\n        // [\"S550\"],\n        // [\"S551\"],\n        // [\"S552\"],\n        // [\"S553\"],\n        // [\"S554\"],\n        // [\"S555\"],\n        // [\"S556\"],\n        // [\"S557\"],\n        // [\"S558\"],\n        // [\"S559\"],\n        // [\"S560\"],\n        // [\"S561\"],\n        // [\"S562\"],\n        // [\"S563\"],\n        // [\"S564\"],\n        // [\"S565\"],\n        // [\"S566\"],\n        // [\"S567\"],\n        // [\"S568\"],\n        // [\"S569\"],\n        // [\"S570\"],\n        // [\"S571\"],\n        // [\"S572\"],\n        // [\"S573\"],\n        // [\"S574\"],\n        // [\"S575\"],\n        // [\"S576\"],\n        // [\"S577\"],\n        // [\"S578\"],\n        // [\"S579\"],\n        // [\"S580\"],\n        // [\"S581\"],\n        // [\"S582\"],\n        // [\"S583\"],\n        // [\"S584\"],\n        // [\"S585\"],\n        // [\"S586\"],\n        // [\"S587\"],\n        // [\"S588\"],\n        // [\"S589\"],\n        // [\"S590\"],\n        // [\"S591\"],\n        // [\"S592\"],\n        // [\"S593\"],\n        // [\"S594\"],\n        // [\"S595\"],\n        // [\"S596\"],\n        // [\"S597\"],\n        // [\"S598\"],\n        // [\"S599\"],\n        // [\"S600\"],\n        // [\"S601\"],\n        // [\"S602\"],\n        // [\"S603\"],\n        // [\"S604\"],\n        // [\"S605\"],\n        // [\"S606\"],\n        // [\"S607\"],\n        // [\"S608\"],\n        // [\"S609\"],\n        // [\"S610\"],\n        // [\"S611\"],\n        // [\"S612\"],\n        // [\"S613\"],\n        // [\"S614\"],\n        // [\"S615\"],\n        // [\"S616\"],\n        // [\"S617\"],\n        // [\"S618\"],\n        // [\"S619\"],\n        // [\"S620\"],\n        // [\"S621\"],\n        // [\"S622\"],\n        // [\"S623\"],\n        // [\"S624\"],\n        // [\"S625\"],\n        // [\"S626\"],\n        // [\"S627\"],\n        // [\"S628\"],\n        // [\"S629\"],\n        // [\"S630\"],\n        // [\"S631\"],\n        // [\"S632\"],\n        // [\"S633\"],\n        // [\"S634\"],\n        // [\"S635\"],\n        // [\"S636\"],\n        // [\"S637\"],\n        // [\"S638\"],\n        // [\"S639\"],\n        // [\"S640\"],\n        // [\"S641\"],\n        // [\"S642\"],\n        // [\"S643\"],\n        // [\"S644\"],\n        // [\"S645\"],\n        // [\"S646\"],\n        // [\"S647\"],\n        // [\"S648\"],\n        // [\"S649\"],\n        // [\"S650\"],\n        // [\"S651\"],\n        // [\"S652\"],\n        // [\"S653\"],\n        // [\"S654\"],\n        // [\"S655\"],\n        // [\"S656\"],\n        // [\"S657\"],\n        // [\"S658\"],\n        // [\"S659\"],\n        // [\"S660\"],\n        // [\"S661\"],\n        // [\"S662\"],\n        // [\"S663\"],\n        // [\"S664\"],\n        // [\"S665\"],\n        // [\"S666\"],\n        // [\"S667\"],\n        // [\"S668\"],\n        // [\"S669\"],\n        // [\"S670\"],\n        // [\"S671\"],\n        // [\"S672\"],\n        // [\"S673\"],\n        // [\"S674\"],\n        // [\"S675\"],\n        // [\"S676\"],\n        // [\"S677\"],\n        // [\"S678\"],\n        // [\"S679\"],\n        // [\"S680\"],\n        // [\"S681\"],\n        // [\"S682\"],\n        // [\"S683\"],\n        // [\"S684\"],\n        // [\"S685\"],\n        // [\"S686\"],\n        // [\"S687\"],\n        // [\"S688\"],\n        // [\"S689\"],\n        // [\"S690\"],\n        // [\"S691\"],\n        // [\"S692\"],\n        // [\"S693\"],\n        // [\"S694\"],\n        // [\"S695\"],\n        // [\"S696\"],\n        // [\"S697\"],\n        // [\"S698\"],\n        // [\"S699\"],\n        // [\"S700\"],\n        // [\"S701\"],\n        // [\"S702\"],\n        // [\"S703\"],\n        // [\"S704\"],\n        // [\"S705\"],\n        // [\"S706\"],\n        // [\"S707\"],\n        // [\"S708\"],\n        // [\"S709\"],\n        // [\"S710\"],\n        // [\"S711\"],\n        // [\"S712\"],\n        // [\"S713\"],\n        // [\"S714\"],\n        // [\"S715\"],\n        // [\"S716\"],\n        // [\"S717\"],\n        // [\"S718\"],\n        // [\"S719\"],\n        // [\"S720\"],\n        // [\"S721\"],\n        // [\"S722\"],\n        // [\"S723\"],\n        // [\"S724\"],\n        // [\"S725\"],\n        // [\"S726\"],\n        // [\"S727\"],\n        // [\"S728\"],\n        // [\"S729\"],\n        // [\"S730\"],\n        // [\"S731\"],\n        // [\"S732\"],\n        // [\"S733\"],\n        // [\"S734\"],\n        // [\"S735\"],\n        // [\"S736\"],\n        // [\"S737\"],\n        // [\"S738\"],\n        // [\"S739\"],\n        // [\"S740\"],\n        // [\"S741\"],\n        // [\"S742\"],\n        // [\"S743\"],\n        // [\"S744\"],\n        // [\"S745\"],\n        // [\"S746\"],\n        // [\"S747\"],\n        // [\"S748\"],\n        // [\"S749\"],\n        // [\"S750\"],\n        // [\"S751\"],\n        // [\"S752\"],\n        // [\"S753\"],\n        // [\"S754\"],\n        // [\"S755\"],\n        // [\"S756\"],\n        // [\"S757\"],\n        // [\"S758\"],\n        // [\"S759\"],\n        // [\"S760\"],\n        // [\"S761\"],\n        // [\"S762\"],\n        // [\"S763\"],\n        // [\"S764\"],\n        // [\"S765\"],\n        // [\"S766\"],\n        // [\"S767\"],\n        // [\"S768\"],\n        // [\"S769\"],\n        // [\"S770\"],\n        // [\"S771\"],\n        // [\"S772\"],\n        // [\"S773\"],\n        // [\"S774\"],\n        // [\"S775\"],\n        // [\"S776\"],\n        // [\"S777\"],\n        // [\"S778\"],\n        // [\"S779\"],\n        // [\"S780\"],\n        // [\"S781\"],\n        // [\"S782\"],\n        // [\"S783\"],\n        // [\"S784\"],\n        // [\"S785\"],\n        // [\"S786\"],\n        // [\"S787\"],\n        // [\"S788\"],\n        // [\"S789\"],\n        // [\"S790\"],\n        // [\"S791\"],\n        // [\"S792\"],\n        // [\"S793\"],\n        // [\"S794\"],\n        // [\"S795\"],\n        // [\"S796\"],\n        // [\"S797\"],\n        // [\"S798\"],\n        // [\"S799\"],\n        // [\"S800\"],\n        // [\"S801\"],\n        // [\"S802\"],\n        // [\"S803\"],\n        // [\"S804\"],\n        // [\"S805\"],\n        // [\"S806\"],\n        // [\"S807\"],\n        // [\"S808\"],\n        // [\"S809\"],\n        // [\"S810\"],\n        // [\"S811\"],\n        // [\"S812\"],\n        // [\"S813\"],\n        // [\"S814\"],\n        // [\"S815\"],\n        // [\"S816\"],\n        // [\"S817\"],\n        [\"S818\"] = \"CODE_SMELL\",\n        // [\"S819\"],\n        // [\"S820\"],\n        // [\"S821\"],\n        // [\"S822\"],\n        // [\"S823\"],\n        // [\"S824\"],\n        // [\"S825\"],\n        // [\"S826\"],\n        // [\"S827\"],\n        // [\"S828\"],\n        // [\"S829\"],\n        // [\"S830\"],\n        // [\"S831\"],\n        // [\"S832\"],\n        // [\"S833\"],\n        // [\"S834\"],\n        // [\"S835\"],\n        // [\"S836\"],\n        // [\"S837\"],\n        // [\"S838\"],\n        // [\"S839\"],\n        // [\"S840\"],\n        // [\"S841\"],\n        // [\"S842\"],\n        // [\"S843\"],\n        // [\"S844\"],\n        // [\"S845\"],\n        // [\"S846\"],\n        // [\"S847\"],\n        // [\"S848\"],\n        // [\"S849\"],\n        // [\"S850\"],\n        // [\"S851\"],\n        // [\"S852\"],\n        // [\"S853\"],\n        // [\"S854\"],\n        // [\"S855\"],\n        // [\"S856\"],\n        // [\"S857\"],\n        // [\"S858\"],\n        // [\"S859\"],\n        // [\"S860\"],\n        // [\"S861\"],\n        // [\"S862\"],\n        // [\"S863\"],\n        // [\"S864\"],\n        // [\"S865\"],\n        // [\"S866\"],\n        // [\"S867\"],\n        // [\"S868\"],\n        // [\"S869\"],\n        // [\"S870\"],\n        // [\"S871\"],\n        // [\"S872\"],\n        // [\"S873\"],\n        // [\"S874\"],\n        // [\"S875\"],\n        // [\"S876\"],\n        // [\"S877\"],\n        // [\"S878\"],\n        // [\"S879\"],\n        // [\"S880\"],\n        [\"S881\"] = \"CODE_SMELL\",\n        // [\"S882\"],\n        // [\"S883\"],\n        // [\"S884\"],\n        // [\"S885\"],\n        // [\"S886\"],\n        // [\"S887\"],\n        // [\"S888\"],\n        // [\"S889\"],\n        // [\"S890\"],\n        // [\"S891\"],\n        // [\"S892\"],\n        // [\"S893\"],\n        // [\"S894\"],\n        // [\"S895\"],\n        // [\"S896\"],\n        // [\"S897\"],\n        // [\"S898\"],\n        // [\"S899\"],\n        // [\"S900\"],\n        // [\"S901\"],\n        // [\"S902\"],\n        // [\"S903\"],\n        // [\"S904\"],\n        // [\"S905\"],\n        // [\"S906\"],\n        [\"S907\"] = \"CODE_SMELL\",\n        // [\"S908\"],\n        // [\"S909\"],\n        // [\"S910\"],\n        // [\"S911\"],\n        // [\"S912\"],\n        // [\"S913\"],\n        // [\"S914\"],\n        // [\"S915\"],\n        // [\"S916\"],\n        // [\"S917\"],\n        // [\"S918\"],\n        // [\"S919\"],\n        // [\"S920\"],\n        // [\"S921\"],\n        // [\"S922\"],\n        // [\"S923\"],\n        // [\"S924\"],\n        // [\"S925\"],\n        // [\"S926\"],\n        [\"S927\"] = \"CODE_SMELL\",\n        // [\"S928\"],\n        // [\"S929\"],\n        // [\"S930\"],\n        // [\"S931\"],\n        // [\"S932\"],\n        // [\"S933\"],\n        // [\"S934\"],\n        // [\"S935\"],\n        // [\"S936\"],\n        // [\"S937\"],\n        // [\"S938\"],\n        // [\"S939\"],\n        // [\"S940\"],\n        // [\"S941\"],\n        // [\"S942\"],\n        // [\"S943\"],\n        // [\"S944\"],\n        // [\"S945\"],\n        // [\"S946\"],\n        // [\"S947\"],\n        // [\"S948\"],\n        // [\"S949\"],\n        // [\"S950\"],\n        // [\"S951\"],\n        // [\"S952\"],\n        // [\"S953\"],\n        // [\"S954\"],\n        // [\"S955\"],\n        // [\"S956\"],\n        // [\"S957\"],\n        // [\"S958\"],\n        // [\"S959\"],\n        // [\"S960\"],\n        // [\"S961\"],\n        // [\"S962\"],\n        // [\"S963\"],\n        // [\"S964\"],\n        // [\"S965\"],\n        // [\"S966\"],\n        // [\"S967\"],\n        // [\"S968\"],\n        // [\"S969\"],\n        // [\"S970\"],\n        // [\"S971\"],\n        // [\"S972\"],\n        // [\"S973\"],\n        // [\"S974\"],\n        // [\"S975\"],\n        // [\"S976\"],\n        // [\"S977\"],\n        // [\"S978\"],\n        // [\"S979\"],\n        // [\"S980\"],\n        // [\"S981\"],\n        // [\"S982\"],\n        // [\"S983\"],\n        // [\"S984\"],\n        // [\"S985\"],\n        // [\"S986\"],\n        // [\"S987\"],\n        // [\"S988\"],\n        // [\"S989\"],\n        // [\"S990\"],\n        // [\"S991\"],\n        // [\"S992\"],\n        // [\"S993\"],\n        // [\"S994\"],\n        // [\"S995\"],\n        // [\"S996\"],\n        // [\"S997\"],\n        // [\"S998\"],\n        // [\"S999\"],\n        // [\"S1000\"],\n        // [\"S1001\"],\n        // [\"S1002\"],\n        // [\"S1003\"],\n        // [\"S1004\"],\n        // [\"S1005\"],\n        [\"S1006\"] = \"CODE_SMELL\",\n        // [\"S1007\"],\n        // [\"S1008\"],\n        // [\"S1009\"],\n        // [\"S1010\"],\n        // [\"S1011\"],\n        // [\"S1012\"],\n        // [\"S1013\"],\n        // [\"S1014\"],\n        // [\"S1015\"],\n        // [\"S1016\"],\n        // [\"S1017\"],\n        // [\"S1018\"],\n        // [\"S1019\"],\n        // [\"S1020\"],\n        // [\"S1021\"],\n        // [\"S1022\"],\n        // [\"S1023\"],\n        // [\"S1024\"],\n        // [\"S1025\"],\n        // [\"S1026\"],\n        // [\"S1027\"],\n        // [\"S1028\"],\n        // [\"S1029\"],\n        // [\"S1030\"],\n        // [\"S1031\"],\n        // [\"S1032\"],\n        // [\"S1033\"],\n        // [\"S1034\"],\n        // [\"S1035\"],\n        // [\"S1036\"],\n        // [\"S1037\"],\n        // [\"S1038\"],\n        // [\"S1039\"],\n        // [\"S1040\"],\n        // [\"S1041\"],\n        // [\"S1042\"],\n        // [\"S1043\"],\n        // [\"S1044\"],\n        // [\"S1045\"],\n        // [\"S1046\"],\n        // [\"S1047\"],\n        [\"S1048\"] = \"BUG\",\n        // [\"S1049\"],\n        // [\"S1050\"],\n        // [\"S1051\"],\n        // [\"S1052\"],\n        // [\"S1053\"],\n        // [\"S1054\"],\n        // [\"S1055\"],\n        // [\"S1056\"],\n        // [\"S1057\"],\n        // [\"S1058\"],\n        // [\"S1059\"],\n        // [\"S1060\"],\n        // [\"S1061\"],\n        // [\"S1062\"],\n        // [\"S1063\"],\n        // [\"S1064\"],\n        // [\"S1065\"],\n        [\"S1066\"] = \"CODE_SMELL\",\n        [\"S1067\"] = \"CODE_SMELL\",\n        // [\"S1068\"],\n        // [\"S1069\"],\n        // [\"S1070\"],\n        // [\"S1071\"],\n        // [\"S1072\"],\n        // [\"S1073\"],\n        // [\"S1074\"],\n        [\"S1075\"] = \"CODE_SMELL\",\n        // [\"S1076\"],\n        // [\"S1077\"],\n        // [\"S1078\"],\n        // [\"S1079\"],\n        // [\"S1080\"],\n        // [\"S1081\"],\n        // [\"S1082\"],\n        // [\"S1083\"],\n        // [\"S1084\"],\n        // [\"S1085\"],\n        // [\"S1086\"],\n        // [\"S1087\"],\n        // [\"S1088\"],\n        // [\"S1089\"],\n        // [\"S1090\"],\n        // [\"S1091\"],\n        // [\"S1092\"],\n        // [\"S1093\"],\n        // [\"S1094\"],\n        // [\"S1095\"],\n        // [\"S1096\"],\n        // [\"S1097\"],\n        // [\"S1098\"],\n        // [\"S1099\"],\n        // [\"S1100\"],\n        // [\"S1101\"],\n        // [\"S1102\"],\n        // [\"S1103\"],\n        [\"S1104\"] = \"CODE_SMELL\",\n        // [\"S1105\"],\n        // [\"S1106\"],\n        // [\"S1107\"],\n        // [\"S1108\"],\n        [\"S1109\"] = \"CODE_SMELL\",\n        [\"S1110\"] = \"CODE_SMELL\",\n        // [\"S1111\"],\n        // [\"S1112\"],\n        // [\"S1113\"],\n        // [\"S1114\"],\n        // [\"S1115\"],\n        [\"S1116\"] = \"CODE_SMELL\",\n        [\"S1117\"] = \"CODE_SMELL\",\n        [\"S1118\"] = \"CODE_SMELL\",\n        // [\"S1119\"],\n        // [\"S1120\"],\n        [\"S1121\"] = \"CODE_SMELL\",\n        // [\"S1122\"],\n        [\"S1123\"] = \"CODE_SMELL\",\n        // [\"S1124\"],\n        [\"S1125\"] = \"CODE_SMELL\",\n        // [\"S1126\"],\n        // [\"S1127\"],\n        [\"S1128\"] = \"CODE_SMELL\",\n        // [\"S1129\"],\n        // [\"S1130\"],\n        // [\"S1131\"],\n        // [\"S1132\"],\n        [\"S1133\"] = \"CODE_SMELL\",\n        [\"S1134\"] = \"CODE_SMELL\",\n        [\"S1135\"] = \"CODE_SMELL\",\n        // [\"S1136\"],\n        // [\"S1137\"],\n        // [\"S1138\"],\n        // [\"S1139\"],\n        // [\"S1140\"],\n        // [\"S1141\"],\n        // [\"S1142\"],\n        // [\"S1143\"],\n        [\"S1144\"] = \"CODE_SMELL\",\n        // [\"S1145\"],\n        // [\"S1146\"],\n        [\"S1147\"] = \"CODE_SMELL\",\n        // [\"S1148\"],\n        // [\"S1149\"],\n        // [\"S1150\"],\n        [\"S1151\"] = \"CODE_SMELL\",\n        // [\"S1152\"],\n        // [\"S1153\"],\n        // [\"S1154\"],\n        [\"S1155\"] = \"CODE_SMELL\",\n        // [\"S1156\"],\n        // [\"S1157\"],\n        // [\"S1158\"],\n        // [\"S1159\"],\n        // [\"S1160\"],\n        // [\"S1161\"],\n        // [\"S1162\"],\n        [\"S1163\"] = \"CODE_SMELL\",\n        // [\"S1164\"],\n        // [\"S1165\"],\n        // [\"S1166\"],\n        // [\"S1167\"],\n        [\"S1168\"] = \"CODE_SMELL\",\n        // [\"S1169\"],\n        // [\"S1170\"],\n        // [\"S1171\"],\n        [\"S1172\"] = \"CODE_SMELL\",\n        // [\"S1173\"],\n        // [\"S1174\"],\n        // [\"S1175\"],\n        // [\"S1176\"],\n        // [\"S1177\"],\n        // [\"S1178\"],\n        // [\"S1179\"],\n        // [\"S1180\"],\n        // [\"S1181\"],\n        // [\"S1182\"],\n        // [\"S1183\"],\n        // [\"S1184\"],\n        [\"S1185\"] = \"CODE_SMELL\",\n        [\"S1186\"] = \"CODE_SMELL\",\n        // [\"S1187\"],\n        // [\"S1188\"],\n        // [\"S1189\"],\n        // [\"S1190\"],\n        // [\"S1191\"],\n        [\"S1192\"] = \"CODE_SMELL\",\n        // [\"S1193\"],\n        // [\"S1194\"],\n        // [\"S1195\"],\n        // [\"S1196\"],\n        // [\"S1197\"],\n        // [\"S1198\"],\n        [\"S1199\"] = \"CODE_SMELL\",\n        [\"S1200\"] = \"CODE_SMELL\",\n        // [\"S1201\"],\n        // [\"S1202\"],\n        // [\"S1203\"],\n        // [\"S1204\"],\n        // [\"S1205\"],\n        [\"S1206\"] = \"BUG\",\n        // [\"S1207\"],\n        // [\"S1208\"],\n        // [\"S1209\"],\n        [\"S1210\"] = \"CODE_SMELL\",\n        // [\"S1211\"],\n        // [\"S1212\"],\n        // [\"S1213\"],\n        // [\"S1214\"],\n        [\"S1215\"] = \"CODE_SMELL\",\n        // [\"S1216\"],\n        // [\"S1217\"],\n        // [\"S1218\"],\n        // [\"S1219\"],\n        // [\"S1220\"],\n        // [\"S1221\"],\n        // [\"S1222\"],\n        // [\"S1223\"],\n        // [\"S1224\"],\n        // [\"S1225\"],\n        [\"S1226\"] = \"BUG\",\n        [\"S1227\"] = \"CODE_SMELL\",\n        // [\"S1228\"],\n        // [\"S1229\"],\n        // [\"S1230\"],\n        // [\"S1231\"],\n        // [\"S1232\"],\n        // [\"S1233\"],\n        // [\"S1234\"],\n        // [\"S1235\"],\n        // [\"S1236\"],\n        // [\"S1237\"],\n        // [\"S1238\"],\n        // [\"S1239\"],\n        // [\"S1240\"],\n        // [\"S1241\"],\n        // [\"S1242\"],\n        // [\"S1243\"],\n        [\"S1244\"] = \"BUG\",\n        // [\"S1245\"],\n        // [\"S1246\"],\n        // [\"S1247\"],\n        // [\"S1248\"],\n        // [\"S1249\"],\n        // [\"S1250\"],\n        // [\"S1251\"],\n        // [\"S1252\"],\n        // [\"S1253\"],\n        // [\"S1254\"],\n        // [\"S1255\"],\n        // [\"S1256\"],\n        // [\"S1257\"],\n        // [\"S1258\"],\n        // [\"S1259\"],\n        // [\"S1260\"],\n        // [\"S1261\"],\n        // [\"S1262\"],\n        // [\"S1263\"],\n        [\"S1264\"] = \"CODE_SMELL\",\n        // [\"S1265\"],\n        // [\"S1266\"],\n        // [\"S1267\"],\n        // [\"S1268\"],\n        // [\"S1269\"],\n        // [\"S1270\"],\n        // [\"S1271\"],\n        // [\"S1272\"],\n        // [\"S1273\"],\n        // [\"S1274\"],\n        // [\"S1275\"],\n        // [\"S1276\"],\n        // [\"S1277\"],\n        // [\"S1278\"],\n        // [\"S1279\"],\n        // [\"S1280\"],\n        // [\"S1281\"],\n        // [\"S1282\"],\n        // [\"S1283\"],\n        // [\"S1284\"],\n        // [\"S1285\"],\n        // [\"S1286\"],\n        // [\"S1287\"],\n        // [\"S1288\"],\n        // [\"S1289\"],\n        // [\"S1290\"],\n        // [\"S1291\"],\n        // [\"S1292\"],\n        // [\"S1293\"],\n        // [\"S1294\"],\n        // [\"S1295\"],\n        // [\"S1296\"],\n        // [\"S1297\"],\n        // [\"S1298\"],\n        // [\"S1299\"],\n        // [\"S1300\"],\n        [\"S1301\"] = \"CODE_SMELL\",\n        // [\"S1302\"],\n        // [\"S1303\"],\n        // [\"S1304\"],\n        // [\"S1305\"],\n        // [\"S1306\"],\n        // [\"S1307\"],\n        // [\"S1308\"],\n        [\"S1309\"] = \"CODE_SMELL\",\n        // [\"S1310\"],\n        // [\"S1311\"],\n        [\"S1312\"] = \"CODE_SMELL\",\n        [\"S1313\"] = \"SECURITY_HOTSPOT\",\n        // [\"S1314\"],\n        // [\"S1315\"],\n        // [\"S1316\"],\n        // [\"S1317\"],\n        // [\"S1318\"],\n        // [\"S1319\"],\n        // [\"S1320\"],\n        // [\"S1321\"],\n        // [\"S1322\"],\n        // [\"S1323\"],\n        // [\"S1324\"],\n        // [\"S1325\"],\n        // [\"S1326\"],\n        // [\"S1327\"],\n        // [\"S1328\"],\n        // [\"S1329\"],\n        // [\"S1330\"],\n        // [\"S1331\"],\n        // [\"S1332\"],\n        // [\"S1333\"],\n        // [\"S1334\"],\n        // [\"S1335\"],\n        // [\"S1336\"],\n        // [\"S1337\"],\n        // [\"S1338\"],\n        // [\"S1339\"],\n        // [\"S1340\"],\n        // [\"S1341\"],\n        // [\"S1342\"],\n        // [\"S1343\"],\n        // [\"S1344\"],\n        // [\"S1345\"],\n        // [\"S1346\"],\n        // [\"S1347\"],\n        // [\"S1348\"],\n        // [\"S1349\"],\n        // [\"S1350\"],\n        // [\"S1351\"],\n        // [\"S1352\"],\n        // [\"S1353\"],\n        // [\"S1354\"],\n        // [\"S1355\"],\n        // [\"S1356\"],\n        // [\"S1357\"],\n        // [\"S1358\"],\n        // [\"S1359\"],\n        // [\"S1360\"],\n        // [\"S1361\"],\n        // [\"S1362\"],\n        // [\"S1363\"],\n        // [\"S1364\"],\n        // [\"S1365\"],\n        // [\"S1366\"],\n        // [\"S1367\"],\n        // [\"S1368\"],\n        // [\"S1369\"],\n        // [\"S1370\"],\n        // [\"S1371\"],\n        // [\"S1372\"],\n        // [\"S1373\"],\n        // [\"S1374\"],\n        // [\"S1375\"],\n        // [\"S1376\"],\n        // [\"S1377\"],\n        // [\"S1378\"],\n        // [\"S1379\"],\n        // [\"S1380\"],\n        // [\"S1381\"],\n        // [\"S1382\"],\n        // [\"S1383\"],\n        // [\"S1384\"],\n        // [\"S1385\"],\n        // [\"S1386\"],\n        // [\"S1387\"],\n        // [\"S1388\"],\n        // [\"S1389\"],\n        // [\"S1390\"],\n        // [\"S1391\"],\n        // [\"S1392\"],\n        // [\"S1393\"],\n        // [\"S1394\"],\n        // [\"S1395\"],\n        // [\"S1396\"],\n        // [\"S1397\"],\n        // [\"S1398\"],\n        // [\"S1399\"],\n        // [\"S1400\"],\n        // [\"S1401\"],\n        // [\"S1402\"],\n        // [\"S1403\"],\n        // [\"S1404\"],\n        // [\"S1405\"],\n        // [\"S1406\"],\n        // [\"S1407\"],\n        // [\"S1408\"],\n        // [\"S1409\"],\n        // [\"S1410\"],\n        // [\"S1411\"],\n        // [\"S1412\"],\n        // [\"S1413\"],\n        // [\"S1414\"],\n        // [\"S1415\"],\n        // [\"S1416\"],\n        // [\"S1417\"],\n        // [\"S1418\"],\n        // [\"S1419\"],\n        // [\"S1420\"],\n        // [\"S1421\"],\n        // [\"S1422\"],\n        // [\"S1423\"],\n        // [\"S1424\"],\n        // [\"S1425\"],\n        // [\"S1426\"],\n        // [\"S1427\"],\n        // [\"S1428\"],\n        // [\"S1429\"],\n        // [\"S1430\"],\n        // [\"S1431\"],\n        // [\"S1432\"],\n        // [\"S1433\"],\n        // [\"S1434\"],\n        // [\"S1435\"],\n        // [\"S1436\"],\n        // [\"S1437\"],\n        // [\"S1438\"],\n        // [\"S1439\"],\n        // [\"S1440\"],\n        // [\"S1441\"],\n        // [\"S1442\"],\n        // [\"S1443\"],\n        // [\"S1444\"],\n        // [\"S1445\"],\n        // [\"S1446\"],\n        // [\"S1447\"],\n        // [\"S1448\"],\n        [\"S1449\"] = \"CODE_SMELL\",\n        [\"S1450\"] = \"CODE_SMELL\",\n        [\"S1451\"] = \"CODE_SMELL\",\n        // [\"S1452\"],\n        // [\"S1453\"],\n        // [\"S1454\"],\n        // [\"S1455\"],\n        // [\"S1456\"],\n        // [\"S1457\"],\n        // [\"S1458\"],\n        // [\"S1459\"],\n        // [\"S1460\"],\n        // [\"S1461\"],\n        // [\"S1462\"],\n        // [\"S1463\"],\n        // [\"S1464\"],\n        // [\"S1465\"],\n        // [\"S1466\"],\n        // [\"S1467\"],\n        // [\"S1468\"],\n        // [\"S1469\"],\n        // [\"S1470\"],\n        // [\"S1471\"],\n        // [\"S1472\"],\n        // [\"S1473\"],\n        // [\"S1474\"],\n        // [\"S1475\"],\n        // [\"S1476\"],\n        // [\"S1477\"],\n        // [\"S1478\"],\n        [\"S1479\"] = \"CODE_SMELL\",\n        // [\"S1480\"],\n        [\"S1481\"] = \"CODE_SMELL\",\n        // [\"S1482\"],\n        // [\"S1483\"],\n        // [\"S1484\"],\n        // [\"S1485\"],\n        // [\"S1486\"],\n        // [\"S1487\"],\n        // [\"S1488\"],\n        // [\"S1489\"],\n        // [\"S1490\"],\n        // [\"S1491\"],\n        // [\"S1492\"],\n        // [\"S1493\"],\n        // [\"S1494\"],\n        // [\"S1495\"],\n        // [\"S1496\"],\n        // [\"S1497\"],\n        // [\"S1498\"],\n        // [\"S1499\"],\n        // [\"S1500\"],\n        // [\"S1501\"],\n        // [\"S1502\"],\n        // [\"S1503\"],\n        // [\"S1504\"],\n        // [\"S1505\"],\n        // [\"S1506\"],\n        // [\"S1507\"],\n        // [\"S1508\"],\n        // [\"S1509\"],\n        // [\"S1510\"],\n        // [\"S1511\"],\n        // [\"S1512\"],\n        // [\"S1513\"],\n        // [\"S1514\"],\n        // [\"S1515\"],\n        // [\"S1516\"],\n        // [\"S1517\"],\n        // [\"S1518\"],\n        // [\"S1519\"],\n        // [\"S1520\"],\n        // [\"S1521\"],\n        // [\"S1522\"],\n        // [\"S1523\"] = \"SECURITY_HOTSPOT\",\n        // [\"S1524\"],\n        // [\"S1525\"],\n        // [\"S1526\"],\n        // [\"S1527\"],\n        // [\"S1528\"],\n        // [\"S1529\"],\n        // [\"S1530\"],\n        // [\"S1531\"],\n        // [\"S1532\"],\n        // [\"S1533\"],\n        // [\"S1534\"],\n        // [\"S1535\"],\n        // [\"S1536\"],\n        // [\"S1537\"],\n        // [\"S1538\"],\n        // [\"S1539\"],\n        // [\"S1540\"],\n        [\"S1541\"] = \"CODE_SMELL\",\n        // [\"S1542\"],\n        // [\"S1543\"],\n        // [\"S1544\"],\n        // [\"S1545\"],\n        // [\"S1546\"],\n        // [\"S1547\"],\n        // [\"S1548\"],\n        // [\"S1549\"],\n        // [\"S1550\"],\n        // [\"S1551\"],\n        // [\"S1552\"],\n        // [\"S1553\"],\n        // [\"S1554\"],\n        // [\"S1555\"],\n        // [\"S1556\"],\n        // [\"S1557\"],\n        // [\"S1558\"],\n        // [\"S1559\"],\n        // [\"S1560\"],\n        // [\"S1561\"],\n        // [\"S1562\"],\n        // [\"S1563\"],\n        // [\"S1564\"],\n        // [\"S1565\"],\n        // [\"S1566\"],\n        // [\"S1567\"],\n        // [\"S1568\"],\n        // [\"S1569\"],\n        // [\"S1570\"],\n        // [\"S1571\"],\n        // [\"S1572\"],\n        // [\"S1573\"],\n        // [\"S1574\"],\n        // [\"S1575\"],\n        // [\"S1576\"],\n        // [\"S1577\"],\n        // [\"S1578\"],\n        // [\"S1579\"],\n        // [\"S1580\"],\n        // [\"S1581\"],\n        // [\"S1582\"],\n        // [\"S1583\"],\n        // [\"S1584\"],\n        // [\"S1585\"],\n        // [\"S1586\"],\n        // [\"S1587\"],\n        // [\"S1588\"],\n        // [\"S1589\"],\n        // [\"S1590\"],\n        // [\"S1591\"],\n        // [\"S1592\"],\n        // [\"S1593\"],\n        // [\"S1594\"],\n        // [\"S1595\"],\n        // [\"S1596\"],\n        // [\"S1597\"],\n        // [\"S1598\"],\n        // [\"S1599\"],\n        // [\"S1600\"],\n        // [\"S1601\"],\n        // [\"S1602\"],\n        // [\"S1603\"],\n        // [\"S1604\"],\n        // [\"S1605\"],\n        // [\"S1606\"],\n        [\"S1607\"] = \"CODE_SMELL\",\n        // [\"S1608\"],\n        // [\"S1609\"],\n        // [\"S1610\"],\n        // [\"S1611\"],\n        // [\"S1612\"],\n        // [\"S1613\"],\n        // [\"S1614\"],\n        // [\"S1615\"],\n        // [\"S1616\"],\n        // [\"S1617\"],\n        // [\"S1618\"],\n        // [\"S1619\"],\n        // [\"S1620\"],\n        // [\"S1621\"],\n        // [\"S1622\"],\n        // [\"S1623\"],\n        // [\"S1624\"],\n        // [\"S1625\"],\n        // [\"S1626\"],\n        // [\"S1627\"],\n        // [\"S1628\"],\n        // [\"S1629\"],\n        // [\"S1630\"],\n        // [\"S1631\"],\n        // [\"S1632\"],\n        // [\"S1633\"],\n        // [\"S1634\"],\n        // [\"S1635\"],\n        // [\"S1636\"],\n        // [\"S1637\"],\n        // [\"S1638\"],\n        // [\"S1639\"],\n        // [\"S1640\"],\n        // [\"S1641\"],\n        // [\"S1642\"],\n        [\"S1643\"] = \"CODE_SMELL\",\n        // [\"S1644\"],\n        // [\"S1645\"],\n        // [\"S1646\"],\n        // [\"S1647\"],\n        // [\"S1648\"],\n        // [\"S1649\"],\n        // [\"S1650\"],\n        // [\"S1651\"],\n        // [\"S1652\"],\n        // [\"S1653\"],\n        // [\"S1654\"],\n        // [\"S1655\"],\n        [\"S1656\"] = \"BUG\",\n        // [\"S1657\"],\n        // [\"S1658\"],\n        [\"S1659\"] = \"CODE_SMELL\",\n        // [\"S1660\"],\n        // [\"S1661\"],\n        // [\"S1662\"],\n        // [\"S1663\"],\n        // [\"S1664\"],\n        // [\"S1665\"],\n        // [\"S1666\"],\n        // [\"S1667\"],\n        // [\"S1668\"],\n        // [\"S1669\"],\n        // [\"S1670\"],\n        // [\"S1671\"],\n        // [\"S1672\"],\n        // [\"S1673\"],\n        // [\"S1674\"],\n        // [\"S1675\"],\n        // [\"S1676\"],\n        // [\"S1677\"],\n        // [\"S1678\"],\n        // [\"S1679\"],\n        // [\"S1680\"],\n        // [\"S1681\"],\n        // [\"S1682\"],\n        // [\"S1683\"],\n        // [\"S1684\"],\n        // [\"S1685\"],\n        // [\"S1686\"],\n        // [\"S1687\"],\n        // [\"S1688\"],\n        // [\"S1689\"],\n        // [\"S1690\"],\n        // [\"S1691\"],\n        // [\"S1692\"],\n        // [\"S1693\"],\n        [\"S1694\"] = \"CODE_SMELL\",\n        // [\"S1695\"],\n        [\"S1696\"] = \"CODE_SMELL\",\n        // [\"S1697\"],\n        [\"S1698\"] = \"CODE_SMELL\",\n        [\"S1699\"] = \"CODE_SMELL\",\n        // [\"S1700\"],\n        // [\"S1701\"],\n        // [\"S1702\"],\n        // [\"S1703\"],\n        // [\"S1704\"],\n        // [\"S1705\"],\n        // [\"S1706\"],\n        // [\"S1707\"],\n        // [\"S1708\"],\n        // [\"S1709\"],\n        // [\"S1710\"],\n        // [\"S1711\"],\n        // [\"S1712\"],\n        // [\"S1713\"],\n        // [\"S1714\"],\n        // [\"S1715\"],\n        // [\"S1716\"],\n        // [\"S1717\"],\n        // [\"S1718\"],\n        // [\"S1719\"],\n        // [\"S1720\"],\n        // [\"S1721\"],\n        // [\"S1722\"],\n        // [\"S1723\"],\n        // [\"S1724\"],\n        // [\"S1725\"],\n        // [\"S1726\"],\n        // [\"S1727\"],\n        // [\"S1728\"],\n        // [\"S1729\"],\n        // [\"S1730\"],\n        // [\"S1731\"],\n        // [\"S1732\"],\n        // [\"S1733\"],\n        // [\"S1734\"],\n        // [\"S1735\"],\n        // [\"S1736\"],\n        // [\"S1737\"],\n        // [\"S1738\"],\n        // [\"S1739\"],\n        // [\"S1740\"],\n        // [\"S1741\"],\n        // [\"S1742\"],\n        // [\"S1743\"],\n        // [\"S1744\"],\n        // [\"S1745\"],\n        // [\"S1746\"],\n        // [\"S1747\"],\n        // [\"S1748\"],\n        // [\"S1749\"],\n        // [\"S1750\"],\n        [\"S1751\"] = \"BUG\",\n        // [\"S1752\"],\n        // [\"S1753\"],\n        // [\"S1754\"],\n        // [\"S1755\"],\n        // [\"S1756\"],\n        // [\"S1757\"],\n        // [\"S1758\"],\n        // [\"S1759\"],\n        // [\"S1760\"],\n        // [\"S1761\"],\n        // [\"S1762\"],\n        // [\"S1763\"],\n        [\"S1764\"] = \"BUG\",\n        // [\"S1765\"],\n        // [\"S1766\"],\n        // [\"S1767\"],\n        // [\"S1768\"],\n        // [\"S1769\"],\n        // [\"S1770\"],\n        // [\"S1771\"],\n        // [\"S1772\"],\n        // [\"S1773\"],\n        // [\"S1774\"],\n        // [\"S1775\"],\n        // [\"S1776\"],\n        // [\"S1777\"],\n        // [\"S1778\"],\n        // [\"S1779\"],\n        // [\"S1780\"],\n        // [\"S1781\"],\n        // [\"S1782\"],\n        // [\"S1783\"],\n        // [\"S1784\"],\n        // [\"S1785\"],\n        // [\"S1786\"],\n        // [\"S1787\"],\n        // [\"S1788\"],\n        // [\"S1789\"],\n        // [\"S1790\"],\n        // [\"S1791\"],\n        // [\"S1792\"],\n        // [\"S1793\"],\n        // [\"S1794\"],\n        // [\"S1795\"],\n        // [\"S1796\"],\n        // [\"S1797\"],\n        // [\"S1798\"],\n        // [\"S1799\"],\n        // [\"S1800\"],\n        // [\"S1801\"],\n        // [\"S1802\"],\n        // [\"S1803\"],\n        // [\"S1804\"],\n        // [\"S1805\"],\n        // [\"S1806\"],\n        // [\"S1807\"],\n        // [\"S1808\"],\n        // [\"S1809\"],\n        // [\"S1810\"],\n        // [\"S1811\"],\n        // [\"S1812\"],\n        // [\"S1813\"],\n        // [\"S1814\"],\n        // [\"S1815\"],\n        // [\"S1816\"],\n        // [\"S1817\"],\n        // [\"S1818\"],\n        // [\"S1819\"],\n        // [\"S1820\"],\n        [\"S1821\"] = \"CODE_SMELL\",\n        // [\"S1822\"],\n        // [\"S1823\"],\n        // [\"S1824\"],\n        // [\"S1825\"],\n        // [\"S1826\"],\n        // [\"S1827\"],\n        // [\"S1828\"],\n        // [\"S1829\"],\n        // [\"S1830\"],\n        // [\"S1831\"],\n        // [\"S1832\"],\n        // [\"S1833\"],\n        // [\"S1834\"],\n        // [\"S1835\"],\n        // [\"S1836\"],\n        // [\"S1837\"],\n        // [\"S1838\"],\n        // [\"S1839\"],\n        // [\"S1840\"],\n        // [\"S1841\"],\n        // [\"S1842\"],\n        // [\"S1843\"],\n        // [\"S1844\"],\n        // [\"S1845\"],\n        // [\"S1846\"],\n        // [\"S1847\"],\n        [\"S1848\"] = \"BUG\",\n        // [\"S1849\"],\n        // [\"S1850\"],\n        // [\"S1851\"],\n        // [\"S1852\"],\n        // [\"S1853\"],\n        [\"S1854\"] = \"CODE_SMELL\",\n        // [\"S1855\"],\n        // [\"S1856\"],\n        // [\"S1857\"],\n        [\"S1858\"] = \"CODE_SMELL\",\n        // [\"S1859\"],\n        // [\"S1860\"],\n        // [\"S1861\"],\n        [\"S1862\"] = \"BUG\",\n        // [\"S1863\"],\n        // [\"S1864\"],\n        // [\"S1865\"],\n        // [\"S1866\"],\n        // [\"S1867\"],\n        // [\"S1868\"],\n        // [\"S1869\"],\n        // [\"S1870\"],\n        [\"S1871\"] = \"CODE_SMELL\",\n        // [\"S1872\"],\n        // [\"S1873\"],\n        // [\"S1874\"],\n        // [\"S1875\"],\n        // [\"S1876\"],\n        // [\"S1877\"],\n        // [\"S1878\"],\n        // [\"S1879\"],\n        // [\"S1880\"],\n        // [\"S1881\"],\n        // [\"S1882\"],\n        // [\"S1883\"],\n        // [\"S1884\"],\n        // [\"S1885\"],\n        // [\"S1886\"],\n        // [\"S1887\"],\n        // [\"S1888\"],\n        // [\"S1889\"],\n        // [\"S1890\"],\n        // [\"S1891\"],\n        // [\"S1892\"],\n        // [\"S1893\"],\n        // [\"S1894\"],\n        // [\"S1895\"],\n        // [\"S1896\"],\n        // [\"S1897\"],\n        // [\"S1898\"],\n        // [\"S1899\"],\n        // [\"S1900\"],\n        // [\"S1901\"],\n        // [\"S1902\"],\n        // [\"S1903\"],\n        // [\"S1904\"],\n        [\"S1905\"] = \"CODE_SMELL\",\n        // [\"S1906\"],\n        // [\"S1907\"],\n        // [\"S1908\"],\n        // [\"S1909\"],\n        // [\"S1910\"],\n        // [\"S1911\"],\n        // [\"S1912\"],\n        // [\"S1913\"],\n        // [\"S1914\"],\n        // [\"S1915\"],\n        // [\"S1916\"],\n        // [\"S1917\"],\n        // [\"S1918\"],\n        // [\"S1919\"],\n        // [\"S1920\"],\n        // [\"S1921\"],\n        // [\"S1922\"],\n        // [\"S1923\"],\n        // [\"S1924\"],\n        // [\"S1925\"],\n        // [\"S1926\"],\n        // [\"S1927\"],\n        // [\"S1928\"],\n        // [\"S1929\"],\n        // [\"S1930\"],\n        // [\"S1931\"],\n        // [\"S1932\"],\n        // [\"S1933\"],\n        // [\"S1934\"],\n        // [\"S1935\"],\n        // [\"S1936\"],\n        // [\"S1937\"],\n        // [\"S1938\"],\n        [\"S1939\"] = \"CODE_SMELL\",\n        [\"S1940\"] = \"CODE_SMELL\",\n        // [\"S1941\"],\n        // [\"S1942\"],\n        // [\"S1943\"],\n        [\"S1944\"] = \"CODE_SMELL\",\n        // [\"S1945\"],\n        // [\"S1946\"],\n        // [\"S1947\"],\n        // [\"S1948\"],\n        // [\"S1949\"],\n        // [\"S1950\"],\n        // [\"S1951\"],\n        // [\"S1952\"],\n        // [\"S1953\"],\n        // [\"S1954\"],\n        // [\"S1955\"],\n        // [\"S1956\"],\n        // [\"S1957\"],\n        // [\"S1958\"],\n        // [\"S1959\"],\n        // [\"S1960\"],\n        // [\"S1961\"],\n        // [\"S1962\"],\n        // [\"S1963\"],\n        // [\"S1964\"],\n        // [\"S1965\"],\n        // [\"S1966\"],\n        // [\"S1967\"],\n        // [\"S1968\"],\n        // [\"S1969\"],\n        // [\"S1970\"],\n        // [\"S1971\"],\n        // [\"S1972\"],\n        // [\"S1973\"],\n        // [\"S1974\"],\n        // [\"S1975\"],\n        // [\"S1976\"],\n        // [\"S1977\"],\n        // [\"S1978\"],\n        // [\"S1979\"],\n        // [\"S1980\"],\n        // [\"S1981\"],\n        // [\"S1982\"],\n        // [\"S1983\"],\n        // [\"S1984\"],\n        // [\"S1985\"],\n        // [\"S1986\"],\n        // [\"S1987\"],\n        // [\"S1988\"],\n        // [\"S1989\"],\n        // [\"S1990\"],\n        // [\"S1991\"],\n        // [\"S1992\"],\n        // [\"S1993\"],\n        [\"S1994\"] = \"CODE_SMELL\",\n        // [\"S1995\"],\n        // [\"S1996\"],\n        // [\"S1997\"],\n        // [\"S1998\"],\n        // [\"S1999\"],\n        // [\"S2000\"],\n        // [\"S2001\"],\n        // [\"S2002\"],\n        // [\"S2003\"],\n        // [\"S2004\"],\n        // [\"S2005\"],\n        // [\"S2006\"],\n        // [\"S2007\"],\n        // [\"S2008\"],\n        // [\"S2009\"],\n        // [\"S2010\"],\n        // [\"S2011\"],\n        // [\"S2012\"],\n        // [\"S2013\"],\n        // [\"S2014\"],\n        // [\"S2015\"],\n        // [\"S2016\"],\n        // [\"S2017\"],\n        // [\"S2018\"],\n        // [\"S2019\"],\n        // [\"S2020\"],\n        // [\"S2021\"],\n        // [\"S2022\"],\n        // [\"S2023\"],\n        // [\"S2024\"],\n        // [\"S2025\"],\n        // [\"S2026\"],\n        // [\"S2027\"],\n        // [\"S2028\"],\n        // [\"S2029\"],\n        // [\"S2030\"],\n        // [\"S2031\"],\n        // [\"S2032\"],\n        // [\"S2033\"],\n        // [\"S2034\"],\n        // [\"S2035\"],\n        // [\"S2036\"],\n        // [\"S2037\"],\n        // [\"S2038\"],\n        // [\"S2039\"],\n        // [\"S2040\"],\n        // [\"S2041\"],\n        // [\"S2042\"],\n        // [\"S2043\"],\n        // [\"S2044\"],\n        // [\"S2045\"],\n        // [\"S2046\"],\n        // [\"S2047\"],\n        // [\"S2048\"],\n        // [\"S2049\"],\n        // [\"S2050\"],\n        // [\"S2051\"],\n        // [\"S2052\"],\n        [\"S2053\"] = \"VULNERABILITY\",\n        // [\"S2054\"],\n        // [\"S2055\"],\n        // [\"S2056\"],\n        // [\"S2057\"],\n        // [\"S2058\"],\n        // [\"S2059\"],\n        // [\"S2060\"],\n        // [\"S2061\"],\n        // [\"S2062\"],\n        // [\"S2063\"],\n        // [\"S2064\"],\n        // [\"S2065\"],\n        // [\"S2066\"],\n        // [\"S2067\"],\n        [\"S2068\"] = \"VULNERABILITY\",\n        // [\"S2069\"],\n        // [\"S2070\"],\n        // [\"S2071\"],\n        // [\"S2072\"],\n        // [\"S2073\"],\n        // [\"S2074\"],\n        // [\"S2075\"],\n        // [\"S2076\"],\n        [\"S2077\"] = \"SECURITY_HOTSPOT\",\n        // [\"S2078\"],\n        // [\"S2079\"],\n        // [\"S2080\"],\n        // [\"S2081\"],\n        // [\"S2082\"],\n        // [\"S2083\"],\n        // [\"S2084\"],\n        // [\"S2085\"],\n        // [\"S2086\"],\n        // [\"S2087\"],\n        // [\"S2088\"],\n        // [\"S2089\"],\n        // [\"S2090\"],\n        // [\"S2091\"],\n        [\"S2092\"] = \"SECURITY_HOTSPOT\",\n        // [\"S2093\"],\n        [\"S2094\"] = \"CODE_SMELL\",\n        // [\"S2095\"],\n        // [\"S2096\"],\n        // [\"S2097\"],\n        // [\"S2098\"],\n        // [\"S2099\"],\n        // [\"S2100\"],\n        // [\"S2101\"],\n        // [\"S2102\"],\n        // [\"S2103\"],\n        // [\"S2104\"],\n        // [\"S2105\"],\n        // [\"S2106\"],\n        // [\"S2107\"],\n        // [\"S2108\"],\n        // [\"S2109\"],\n        // [\"S2110\"],\n        // [\"S2111\"],\n        // [\"S2112\"],\n        // [\"S2113\"],\n        [\"S2114\"] = \"BUG\",\n        [\"S2115\"] = \"VULNERABILITY\",\n        // [\"S2116\"],\n        // [\"S2117\"],\n        // [\"S2118\"],\n        // [\"S2119\"],\n        // [\"S2120\"],\n        // [\"S2121\"],\n        // [\"S2122\"],\n        [\"S2123\"] = \"BUG\",\n        // [\"S2124\"],\n        // [\"S2125\"],\n        // [\"S2126\"],\n        // [\"S2127\"],\n        // [\"S2128\"],\n        // [\"S2129\"],\n        // [\"S2130\"],\n        // [\"S2131\"],\n        // [\"S2132\"],\n        // [\"S2133\"],\n        // [\"S2134\"],\n        // [\"S2135\"],\n        // [\"S2136\"],\n        // [\"S2137\"],\n        // [\"S2138\"],\n        [\"S2139\"] = \"CODE_SMELL\",\n        // [\"S2140\"],\n        // [\"S2141\"],\n        // [\"S2142\"],\n        // [\"S2143\"],\n        // [\"S2144\"],\n        // [\"S2145\"],\n        // [\"S2146\"],\n        // [\"S2147\"],\n        [\"S2148\"] = \"CODE_SMELL\",\n        // [\"S2149\"],\n        // [\"S2150\"],\n        // [\"S2151\"],\n        // [\"S2152\"],\n        // [\"S2153\"],\n        // [\"S2154\"],\n        // [\"S2155\"],\n        [\"S2156\"] = \"CODE_SMELL\",\n        // [\"S2157\"],\n        // [\"S2158\"],\n        // [\"S2159\"],\n        // [\"S2160\"],\n        // [\"S2161\"],\n        // [\"S2162\"],\n        // [\"S2163\"],\n        // [\"S2164\"],\n        // [\"S2165\"],\n        [\"S2166\"] = \"CODE_SMELL\",\n        // [\"S2167\"],\n        // [\"S2168\"],\n        // [\"S2169\"],\n        // [\"S2170\"],\n        // [\"S2171\"],\n        // [\"S2172\"],\n        // [\"S2173\"],\n        // [\"S2174\"],\n        // [\"S2175\"],\n        // [\"S2176\"],\n        // [\"S2177\"],\n        [\"S2178\"] = \"CODE_SMELL\",\n        // [\"S2179\"],\n        // [\"S2180\"],\n        // [\"S2181\"],\n        // [\"S2182\"],\n        [\"S2183\"] = \"BUG\",\n        [\"S2184\"] = \"BUG\",\n        // [\"S2185\"],\n        // [\"S2186\"],\n        [\"S2187\"] = \"CODE_SMELL\",\n        // [\"S2188\"],\n        // [\"S2189\"],\n        [\"S2190\"] = \"BUG\",\n        // [\"S2191\"],\n        // [\"S2192\"],\n        // [\"S2193\"],\n        // [\"S2194\"],\n        // [\"S2195\"],\n        // [\"S2196\"],\n        [\"S2197\"] = \"CODE_SMELL\",\n        [\"S2198\"] = \"CODE_SMELL\",\n        // [\"S2199\"],\n        // [\"S2200\"],\n        [\"S2201\"] = \"BUG\",\n        // [\"S2202\"],\n        // [\"S2203\"],\n        // [\"S2204\"],\n        // [\"S2205\"],\n        // [\"S2206\"],\n        // [\"S2207\"],\n        // [\"S2208\"],\n        // [\"S2209\"],\n        // [\"S2210\"],\n        // [\"S2211\"],\n        // [\"S2212\"],\n        // [\"S2213\"],\n        // [\"S2214\"],\n        // [\"S2215\"],\n        // [\"S2216\"],\n        // [\"S2217\"],\n        // [\"S2218\"],\n        [\"S2219\"] = \"CODE_SMELL\",\n        // [\"S2220\"],\n        [\"S2221\"] = \"CODE_SMELL\",\n        [\"S2222\"] = \"BUG\",\n        [\"S2223\"] = \"CODE_SMELL\",\n        // [\"S2224\"],\n        [\"S2225\"] = \"BUG\",\n        // [\"S2226\"],\n        // [\"S2227\"],\n        // [\"S2228\"],\n        // [\"S2229\"],\n        // [\"S2230\"],\n        // [\"S2231\"],\n        // [\"S2232\"],\n        // [\"S2233\"],\n        [\"S2234\"] = \"CODE_SMELL\",\n        // [\"S2235\"],\n        // [\"S2236\"],\n        // [\"S2237\"],\n        // [\"S2238\"],\n        // [\"S2239\"],\n        // [\"S2240\"],\n        // [\"S2241\"],\n        // [\"S2242\"],\n        // [\"S2243\"],\n        // [\"S2244\"],\n        [\"S2245\"] = \"SECURITY_HOTSPOT\",\n        // [\"S2246\"],\n        // [\"S2247\"],\n        // [\"S2248\"],\n        // [\"S2249\"],\n        // [\"S2250\"],\n        [\"S2251\"] = \"BUG\",\n        [\"S2252\"] = \"BUG\",\n        // [\"S2253\"],\n        // [\"S2254\"],\n        // [\"S2255\"],\n        // [\"S2256\"],\n        [\"S2257\"] = \"SECURITY_HOTSPOT\",\n        // [\"S2258\"],\n        [\"S2259\"] = \"BUG\",\n        // [\"S2260\"],\n        // [\"S2261\"],\n        // [\"S2262\"],\n        // [\"S2263\"],\n        // [\"S2264\"],\n        // [\"S2265\"],\n        // [\"S2266\"],\n        // [\"S2267\"],\n        // [\"S2268\"],\n        // [\"S2269\"],\n        // [\"S2270\"],\n        // [\"S2271\"],\n        // [\"S2272\"],\n        // [\"S2273\"],\n        // [\"S2274\"],\n        [\"S2275\"] = \"BUG\",\n        // [\"S2276\"],\n        // [\"S2277\"],\n        // [\"S2278\"],\n        // [\"S2279\"],\n        // [\"S2280\"],\n        // [\"S2281\"],\n        // [\"S2282\"],\n        // [\"S2283\"],\n        // [\"S2284\"],\n        // [\"S2285\"],\n        // [\"S2286\"],\n        // [\"S2287\"],\n        // [\"S2288\"],\n        // [\"S2289\"],\n        [\"S2290\"] = \"CODE_SMELL\",\n        [\"S2291\"] = \"CODE_SMELL\",\n        [\"S2292\"] = \"CODE_SMELL\",\n        // [\"S2293\"],\n        // [\"S2294\"],\n        // [\"S2295\"],\n        // [\"S2296\"],\n        // [\"S2297\"],\n        // [\"S2298\"],\n        // [\"S2299\"],\n        // [\"S2300\"],\n        // [\"S2301\"],\n        [\"S2302\"] = \"CODE_SMELL\",\n        // [\"S2303\"],\n        // [\"S2304\"],\n        // [\"S2305\"],\n        [\"S2306\"] = \"CODE_SMELL\",\n        // [\"S2307\"],\n        // [\"S2308\"],\n        // [\"S2309\"],\n        // [\"S2310\"],\n        // [\"S2311\"],\n        // [\"S2312\"],\n        // [\"S2313\"],\n        // [\"S2314\"],\n        // [\"S2315\"],\n        // [\"S2316\"],\n        // [\"S2317\"],\n        // [\"S2318\"],\n        // [\"S2319\"],\n        // [\"S2320\"],\n        // [\"S2321\"],\n        // [\"S2322\"],\n        // [\"S2323\"],\n        // [\"S2324\"],\n        [\"S2325\"] = \"CODE_SMELL\",\n        [\"S2326\"] = \"CODE_SMELL\",\n        [\"S2327\"] = \"CODE_SMELL\",\n        [\"S2328\"] = \"BUG\",\n        // [\"S2329\"],\n        [\"S2330\"] = \"CODE_SMELL\",\n        // [\"S2331\"],\n        // [\"S2332\"],\n        [\"S2333\"] = \"CODE_SMELL\",\n        // [\"S2334\"],\n        // [\"S2335\"],\n        // [\"S2336\"],\n        // [\"S2337\"],\n        // [\"S2338\"],\n        [\"S2339\"] = \"CODE_SMELL\",\n        // [\"S2340\"],\n        // [\"S2341\"],\n        [\"S2342\"] = \"CODE_SMELL\",\n        // [\"S2343\"],\n        [\"S2344\"] = \"CODE_SMELL\",\n        [\"S2345\"] = \"BUG\",\n        [\"S2346\"] = \"CODE_SMELL\",\n        // [\"S2347\"],\n        // [\"S2348\"],\n        // [\"S2349\"],\n        // [\"S2350\"],\n        // [\"S2351\"],\n        // [\"S2352\"],\n        // [\"S2353\"],\n        // [\"S2354\"],\n        // [\"S2355\"],\n        // [\"S2356\"],\n        [\"S2357\"] = \"CODE_SMELL\",\n        // [\"S2358\"],\n        // [\"S2359\"],\n        [\"S2360\"] = \"CODE_SMELL\",\n        // [\"S2361\"],\n        // [\"S2362\"],\n        // [\"S2363\"],\n        // [\"S2364\"],\n        [\"S2365\"] = \"CODE_SMELL\",\n        // [\"S2366\"],\n        // [\"S2367\"],\n        [\"S2368\"] = \"CODE_SMELL\",\n        // [\"S2369\"],\n        // [\"S2370\"],\n        // [\"S2371\"],\n        [\"S2372\"] = \"CODE_SMELL\",\n        // [\"S2373\"],\n        // [\"S2374\"],\n        // [\"S2375\"],\n        [\"S2376\"] = \"CODE_SMELL\",\n        // [\"S2377\"],\n        // [\"S2378\"],\n        // [\"S2379\"],\n        // [\"S2380\"],\n        // [\"S2381\"],\n        // [\"S2382\"],\n        // [\"S2383\"],\n        // [\"S2384\"],\n        // [\"S2385\"],\n        [\"S2386\"] = \"CODE_SMELL\",\n        [\"S2387\"] = \"CODE_SMELL\",\n        // [\"S2388\"],\n        // [\"S2389\"],\n        // [\"S2390\"],\n        // [\"S2391\"],\n        // [\"S2392\"],\n        // [\"S2393\"],\n        // [\"S2394\"],\n        // [\"S2395\"],\n        // [\"S2396\"],\n        // [\"S2397\"],\n        // [\"S2398\"],\n        // [\"S2399\"],\n        // [\"S2400\"],\n        // [\"S2401\"],\n        // [\"S2402\"],\n        // [\"S2403\"],\n        // [\"S2404\"],\n        // [\"S2405\"],\n        // [\"S2406\"],\n        // [\"S2407\"],\n        // [\"S2408\"],\n        // [\"S2409\"],\n        // [\"S2410\"],\n        // [\"S2411\"],\n        // [\"S2412\"],\n        // [\"S2413\"],\n        // [\"S2414\"],\n        // [\"S2415\"],\n        // [\"S2416\"],\n        // [\"S2417\"],\n        // [\"S2418\"],\n        // [\"S2419\"],\n        // [\"S2420\"],\n        // [\"S2421\"],\n        // [\"S2422\"],\n        // [\"S2423\"],\n        // [\"S2424\"],\n        // [\"S2425\"],\n        // [\"S2426\"],\n        // [\"S2427\"],\n        // [\"S2428\"],\n        // [\"S2429\"],\n        // [\"S2430\"],\n        // [\"S2431\"],\n        // [\"S2432\"],\n        // [\"S2433\"],\n        // [\"S2434\"],\n        // [\"S2435\"],\n        [\"S2436\"] = \"CODE_SMELL\",\n        [\"S2437\"] = \"CODE_SMELL\",\n        // [\"S2438\"],\n        // [\"S2439\"],\n        // [\"S2440\"],\n        // [\"S2441\"],\n        // [\"S2442\"],\n        // [\"S2443\"],\n        // [\"S2444\"],\n        [\"S2445\"] = \"BUG\",\n        // [\"S2446\"],\n        // [\"S2447\"],\n        // [\"S2448\"],\n        // [\"S2449\"],\n        // [\"S2450\"],\n        // [\"S2451\"],\n        // [\"S2452\"],\n        // [\"S2453\"],\n        // [\"S2454\"],\n        // [\"S2455\"],\n        // [\"S2456\"],\n        // [\"S2457\"],\n        // [\"S2458\"],\n        // [\"S2459\"],\n        // [\"S2460\"],\n        // [\"S2461\"],\n        // [\"S2462\"],\n        // [\"S2463\"],\n        // [\"S2464\"],\n        // [\"S2465\"],\n        // [\"S2466\"],\n        // [\"S2467\"],\n        // [\"S2468\"],\n        // [\"S2469\"],\n        // [\"S2470\"],\n        // [\"S2471\"],\n        // [\"S2472\"],\n        // [\"S2473\"],\n        // [\"S2474\"],\n        // [\"S2475\"],\n        // [\"S2476\"],\n        // [\"S2477\"],\n        // [\"S2478\"],\n        [\"S2479\"] = \"CODE_SMELL\",\n        // [\"S2480\"],\n        // [\"S2481\"],\n        // [\"S2482\"],\n        // [\"S2483\"],\n        // [\"S2484\"],\n        // [\"S2485\"],\n        [\"S2486\"] = \"CODE_SMELL\",\n        // [\"S2487\"],\n        // [\"S2488\"],\n        // [\"S2489\"],\n        // [\"S2490\"],\n        // [\"S2491\"],\n        // [\"S2492\"],\n        // [\"S2493\"],\n        // [\"S2494\"],\n        // [\"S2495\"],\n        // [\"S2496\"],\n        // [\"S2497\"],\n        // [\"S2498\"],\n        // [\"S2499\"],\n        // [\"S2500\"],\n        // [\"S2501\"],\n        // [\"S2502\"],\n        // [\"S2503\"],\n        // [\"S2504\"],\n        // [\"S2505\"],\n        // [\"S2506\"],\n        // [\"S2507\"],\n        // [\"S2508\"],\n        // [\"S2509\"],\n        // [\"S2510\"],\n        // [\"S2511\"],\n        // [\"S2512\"],\n        // [\"S2513\"],\n        // [\"S2514\"],\n        // [\"S2515\"],\n        // [\"S2516\"],\n        // [\"S2517\"],\n        // [\"S2518\"],\n        // [\"S2519\"],\n        // [\"S2520\"],\n        // [\"S2521\"],\n        // [\"S2522\"],\n        // [\"S2523\"],\n        // [\"S2524\"],\n        // [\"S2525\"],\n        // [\"S2526\"],\n        // [\"S2527\"],\n        // [\"S2528\"],\n        // [\"S2529\"],\n        // [\"S2530\"],\n        // [\"S2531\"],\n        // [\"S2532\"],\n        // [\"S2533\"],\n        // [\"S2534\"],\n        // [\"S2535\"],\n        // [\"S2536\"],\n        // [\"S2537\"],\n        // [\"S2538\"],\n        // [\"S2539\"],\n        // [\"S2540\"],\n        // [\"S2541\"],\n        // [\"S2542\"],\n        // [\"S2543\"],\n        // [\"S2544\"],\n        // [\"S2545\"],\n        // [\"S2546\"],\n        // [\"S2547\"],\n        // [\"S2548\"],\n        // [\"S2549\"],\n        // [\"S2550\"],\n        [\"S2551\"] = \"BUG\",\n        // [\"S2552\"],\n        // [\"S2553\"],\n        // [\"S2554\"],\n        // [\"S2555\"],\n        // [\"S2556\"],\n        // [\"S2557\"],\n        // [\"S2558\"],\n        // [\"S2559\"],\n        // [\"S2560\"],\n        // [\"S2561\"],\n        // [\"S2562\"],\n        // [\"S2563\"],\n        // [\"S2564\"],\n        // [\"S2565\"],\n        // [\"S2566\"],\n        // [\"S2567\"],\n        // [\"S2568\"],\n        // [\"S2569\"],\n        // [\"S2570\"],\n        // [\"S2571\"],\n        // [\"S2572\"],\n        // [\"S2573\"],\n        // [\"S2574\"],\n        // [\"S2575\"],\n        // [\"S2576\"],\n        // [\"S2577\"],\n        // [\"S2578\"],\n        // [\"S2579\"],\n        // [\"S2580\"],\n        // [\"S2581\"],\n        // [\"S2582\"],\n        [\"S2583\"] = \"BUG\",\n        // [\"S2584\"],\n        // [\"S2585\"],\n        // [\"S2586\"],\n        // [\"S2587\"],\n        // [\"S2588\"],\n        [\"S2589\"] = \"CODE_SMELL\",\n        // [\"S2590\"],\n        // [\"S2591\"],\n        // [\"S2592\"],\n        // [\"S2593\"],\n        // [\"S2594\"],\n        // [\"S2595\"],\n        // [\"S2596\"],\n        // [\"S2597\"],\n        // [\"S2598\"],\n        // [\"S2599\"],\n        // [\"S2600\"],\n        // [\"S2601\"],\n        // [\"S2602\"],\n        // [\"S2603\"],\n        // [\"S2604\"],\n        // [\"S2605\"],\n        // [\"S2606\"],\n        // [\"S2607\"],\n        // [\"S2608\"],\n        // [\"S2609\"],\n        // [\"S2610\"],\n        // [\"S2611\"],\n        [\"S2612\"] = \"VULNERABILITY\",\n        // [\"S2613\"],\n        // [\"S2614\"],\n        // [\"S2615\"],\n        // [\"S2616\"],\n        // [\"S2617\"],\n        // [\"S2618\"],\n        // [\"S2619\"],\n        // [\"S2620\"],\n        // [\"S2621\"],\n        // [\"S2622\"],\n        // [\"S2623\"],\n        // [\"S2624\"],\n        // [\"S2625\"],\n        // [\"S2626\"],\n        // [\"S2627\"],\n        // [\"S2628\"],\n        [\"S2629\"] = \"CODE_SMELL\",\n        // [\"S2630\"],\n        // [\"S2631\"],\n        // [\"S2632\"],\n        // [\"S2633\"],\n        // [\"S2634\"],\n        // [\"S2635\"],\n        // [\"S2636\"],\n        // [\"S2637\"],\n        // [\"S2638\"],\n        // [\"S2639\"],\n        // [\"S2640\"],\n        // [\"S2641\"],\n        // [\"S2642\"],\n        // [\"S2643\"],\n        // [\"S2644\"],\n        // [\"S2645\"],\n        // [\"S2646\"],\n        // [\"S2647\"],\n        // [\"S2648\"],\n        // [\"S2649\"],\n        // [\"S2650\"],\n        // [\"S2651\"],\n        // [\"S2652\"],\n        // [\"S2653\"],\n        // [\"S2654\"],\n        // [\"S2655\"],\n        // [\"S2656\"],\n        // [\"S2657\"],\n        // [\"S2658\"],\n        // [\"S2659\"],\n        // [\"S2660\"],\n        // [\"S2661\"],\n        // [\"S2662\"],\n        // [\"S2663\"],\n        // [\"S2664\"],\n        // [\"S2665\"],\n        // [\"S2666\"],\n        // [\"S2667\"],\n        // [\"S2668\"],\n        // [\"S2669\"],\n        // [\"S2670\"],\n        // [\"S2671\"],\n        // [\"S2672\"],\n        // [\"S2673\"],\n        [\"S2674\"] = \"BUG\",\n        // [\"S2675\"],\n        // [\"S2676\"],\n        // [\"S2677\"],\n        // [\"S2678\"],\n        // [\"S2679\"],\n        // [\"S2680\"],\n        [\"S2681\"] = \"CODE_SMELL\",\n        // [\"S2682\"],\n        // [\"S2683\"],\n        // [\"S2684\"],\n        // [\"S2685\"],\n        // [\"S2686\"],\n        // [\"S2687\"],\n        [\"S2688\"] = \"BUG\",\n        // [\"S2689\"],\n        // [\"S2690\"],\n        // [\"S2691\"],\n        [\"S2692\"] = \"CODE_SMELL\",\n        // [\"S2693\"],\n        // [\"S2694\"],\n        // [\"S2695\"],\n        [\"S2696\"] = \"CODE_SMELL\",\n        // [\"S2697\"],\n        // [\"S2698\"],\n        [\"S2699\"] = \"CODE_SMELL\",\n        // [\"S2700\"],\n        [\"S2701\"] = \"CODE_SMELL\",\n        // [\"S2702\"],\n        // [\"S2703\"],\n        // [\"S2704\"],\n        // [\"S2705\"],\n        // [\"S2706\"],\n        // [\"S2707\"],\n        // [\"S2708\"],\n        // [\"S2709\"],\n        // [\"S2710\"],\n        // [\"S2711\"],\n        // [\"S2712\"],\n        // [\"S2713\"],\n        // [\"S2714\"],\n        // [\"S2715\"],\n        // [\"S2716\"],\n        // [\"S2717\"],\n        // [\"S2718\"],\n        // [\"S2719\"],\n        // [\"S2720\"],\n        // [\"S2721\"],\n        // [\"S2722\"],\n        // [\"S2723\"],\n        // [\"S2724\"],\n        // [\"S2725\"],\n        // [\"S2726\"],\n        // [\"S2727\"],\n        // [\"S2728\"],\n        // [\"S2729\"],\n        // [\"S2730\"],\n        // [\"S2731\"],\n        // [\"S2732\"],\n        // [\"S2733\"],\n        // [\"S2734\"],\n        // [\"S2735\"],\n        // [\"S2736\"],\n        [\"S2737\"] = \"CODE_SMELL\",\n        // [\"S2738\"],\n        // [\"S2739\"],\n        // [\"S2740\"],\n        // [\"S2741\"],\n        // [\"S2742\"],\n        [\"S2743\"] = \"CODE_SMELL\",\n        // [\"S2744\"],\n        // [\"S2745\"],\n        // [\"S2746\"],\n        // [\"S2747\"],\n        // [\"S2748\"],\n        // [\"S2749\"],\n        // [\"S2750\"],\n        // [\"S2751\"],\n        // [\"S2752\"],\n        // [\"S2753\"],\n        // [\"S2754\"],\n        [\"S2755\"] = \"VULNERABILITY\",\n        // [\"S2756\"],\n        [\"S2757\"] = \"BUG\",\n        // [\"S2758\"],\n        // [\"S2759\"],\n        [\"S2760\"] = \"CODE_SMELL\",\n        [\"S2761\"] = \"BUG\",\n        // [\"S2762\"],\n        // [\"S2763\"],\n        // [\"S2764\"],\n        // [\"S2765\"],\n        // [\"S2766\"],\n        // [\"S2767\"],\n        // [\"S2768\"],\n        // [\"S2769\"],\n        // [\"S2770\"],\n        // [\"S2771\"],\n        // [\"S2772\"],\n        // [\"S2773\"],\n        // [\"S2774\"],\n        // [\"S2775\"],\n        // [\"S2776\"],\n        // [\"S2777\"],\n        // [\"S2778\"],\n        // [\"S2779\"],\n        // [\"S2780\"],\n        // [\"S2781\"],\n        // [\"S2782\"],\n        // [\"S2783\"],\n        // [\"S2784\"],\n        // [\"S2785\"],\n        // [\"S2786\"],\n        // [\"S2787\"],\n        // [\"S2788\"],\n        // [\"S2789\"],\n        // [\"S2790\"],\n        // [\"S2791\"],\n        // [\"S2792\"],\n        // [\"S2793\"],\n        // [\"S2794\"],\n        // [\"S2795\"],\n        // [\"S2796\"],\n        // [\"S2797\"],\n        // [\"S2798\"],\n        // [\"S2799\"],\n        // [\"S2800\"],\n        // [\"S2801\"],\n        // [\"S2802\"],\n        // [\"S2803\"],\n        // [\"S2804\"],\n        // [\"S2805\"],\n        // [\"S2806\"],\n        // [\"S2807\"],\n        // [\"S2808\"],\n        // [\"S2809\"],\n        // [\"S2810\"],\n        // [\"S2811\"],\n        // [\"S2812\"],\n        // [\"S2813\"],\n        // [\"S2814\"],\n        // [\"S2815\"],\n        // [\"S2816\"],\n        // [\"S2817\"],\n        // [\"S2818\"],\n        // [\"S2819\"],\n        // [\"S2820\"],\n        // [\"S2821\"],\n        // [\"S2822\"],\n        // [\"S2823\"],\n        // [\"S2824\"],\n        // [\"S2825\"],\n        // [\"S2826\"],\n        // [\"S2827\"],\n        // [\"S2828\"],\n        // [\"S2829\"],\n        // [\"S2830\"],\n        // [\"S2831\"],\n        // [\"S2832\"],\n        // [\"S2833\"],\n        // [\"S2834\"],\n        // [\"S2835\"],\n        // [\"S2836\"],\n        // [\"S2837\"],\n        // [\"S2838\"],\n        // [\"S2839\"],\n        // [\"S2840\"],\n        // [\"S2841\"],\n        // [\"S2842\"],\n        // [\"S2843\"],\n        // [\"S2844\"],\n        // [\"S2845\"],\n        // [\"S2846\"],\n        // [\"S2847\"],\n        // [\"S2848\"],\n        // [\"S2849\"],\n        // [\"S2850\"],\n        // [\"S2851\"],\n        // [\"S2852\"],\n        // [\"S2853\"],\n        // [\"S2854\"],\n        // [\"S2855\"],\n        // [\"S2856\"],\n        [\"S2857\"] = \"BUG\",\n        // [\"S2858\"],\n        // [\"S2859\"],\n        // [\"S2860\"],\n        // [\"S2861\"],\n        // [\"S2862\"],\n        // [\"S2863\"],\n        // [\"S2864\"],\n        // [\"S2865\"],\n        // [\"S2866\"],\n        // [\"S2867\"],\n        // [\"S2868\"],\n        // [\"S2869\"],\n        // [\"S2870\"],\n        // [\"S2871\"],\n        // [\"S2872\"],\n        // [\"S2873\"],\n        // [\"S2874\"],\n        // [\"S2875\"],\n        // [\"S2876\"],\n        // [\"S2877\"],\n        // [\"S2878\"],\n        // [\"S2879\"],\n        // [\"S2880\"],\n        // [\"S2881\"],\n        // [\"S2882\"],\n        // [\"S2883\"],\n        // [\"S2884\"],\n        // [\"S2885\"],\n        // [\"S2886\"],\n        // [\"S2887\"],\n        // [\"S2888\"],\n        // [\"S2889\"],\n        // [\"S2890\"],\n        // [\"S2891\"],\n        // [\"S2892\"],\n        // [\"S2893\"],\n        // [\"S2894\"],\n        // [\"S2895\"],\n        // [\"S2896\"],\n        // [\"S2897\"],\n        // [\"S2898\"],\n        // [\"S2899\"],\n        // [\"S2900\"],\n        // [\"S2901\"],\n        // [\"S2902\"],\n        // [\"S2903\"],\n        // [\"S2904\"],\n        // [\"S2905\"],\n        // [\"S2906\"],\n        // [\"S2907\"],\n        // [\"S2908\"],\n        // [\"S2909\"],\n        // [\"S2910\"],\n        // [\"S2911\"],\n        // [\"S2912\"],\n        // [\"S2913\"],\n        // [\"S2914\"],\n        // [\"S2915\"],\n        // [\"S2916\"],\n        // [\"S2917\"],\n        // [\"S2918\"],\n        // [\"S2919\"],\n        // [\"S2920\"],\n        // [\"S2921\"],\n        // [\"S2922\"],\n        // [\"S2923\"],\n        // [\"S2924\"],\n        [\"S2925\"] = \"CODE_SMELL\",\n        // [\"S2926\"],\n        // [\"S2927\"],\n        // [\"S2928\"],\n        // [\"S2929\"],\n        [\"S2930\"] = \"BUG\",\n        [\"S2931\"] = \"BUG\",\n        // [\"S2932\"],\n        [\"S2933\"] = \"CODE_SMELL\",\n        [\"S2934\"] = \"BUG\",\n        // [\"S2935\"],\n        // [\"S2936\"],\n        // [\"S2937\"],\n        // [\"S2938\"],\n        // [\"S2939\"],\n        // [\"S2940\"],\n        // [\"S2941\"],\n        // [\"S2942\"],\n        // [\"S2943\"],\n        // [\"S2944\"],\n        // [\"S2945\"],\n        // [\"S2946\"],\n        // [\"S2947\"],\n        // [\"S2948\"],\n        // [\"S2949\"],\n        // [\"S2950\"],\n        // [\"S2951\"],\n        [\"S2952\"] = \"BUG\",\n        [\"S2953\"] = \"CODE_SMELL\",\n        // [\"S2954\"],\n        [\"S2955\"] = \"BUG\",\n        // [\"S2956\"],\n        // [\"S2957\"],\n        // [\"S2958\"],\n        // [\"S2959\"],\n        // [\"S2960\"],\n        // [\"S2961\"],\n        // [\"S2962\"],\n        // [\"S2963\"],\n        // [\"S2964\"],\n        // [\"S2965\"],\n        // [\"S2966\"],\n        // [\"S2967\"],\n        // [\"S2968\"],\n        // [\"S2969\"],\n        [\"S2970\"] = \"CODE_SMELL\",\n        [\"S2971\"] = \"CODE_SMELL\",\n        // [\"S2972\"],\n        // [\"S2973\"],\n        // [\"S2974\"],\n        // [\"S2975\"],\n        // [\"S2976\"],\n        // [\"S2977\"],\n        // [\"S2978\"],\n        // [\"S2979\"],\n        // [\"S2980\"],\n        // [\"S2981\"],\n        // [\"S2982\"],\n        // [\"S2983\"],\n        // [\"S2984\"],\n        // [\"S2985\"],\n        // [\"S2986\"],\n        // [\"S2987\"],\n        // [\"S2988\"],\n        // [\"S2989\"],\n        // [\"S2990\"],\n        // [\"S2991\"],\n        // [\"S2992\"],\n        // [\"S2993\"],\n        // [\"S2994\"],\n        [\"S2995\"] = \"BUG\",\n        [\"S2996\"] = \"BUG\",\n        [\"S2997\"] = \"BUG\",\n        // [\"S2998\"],\n        // [\"S2999\"],\n        // [\"S3000\"],\n        // [\"S3001\"],\n        // [\"S3002\"],\n        // [\"S3003\"],\n        // [\"S3004\"],\n        [\"S3005\"] = \"BUG\",\n        // [\"S3006\"],\n        // [\"S3007\"],\n        // [\"S3008\"],\n        // [\"S3009\"],\n        [\"S3010\"] = \"CODE_SMELL\",\n        [\"S3011\"] = \"CODE_SMELL\",\n        // [\"S3012\"],\n        // [\"S3013\"],\n        // [\"S3014\"],\n        // [\"S3015\"],\n        // [\"S3016\"],\n        // [\"S3017\"],\n        // [\"S3018\"],\n        // [\"S3019\"],\n        // [\"S3020\"],\n        // [\"S3021\"],\n        // [\"S3022\"],\n        // [\"S3023\"],\n        // [\"S3024\"],\n        // [\"S3025\"],\n        // [\"S3026\"],\n        // [\"S3027\"],\n        // [\"S3028\"],\n        // [\"S3029\"],\n        // [\"S3030\"],\n        // [\"S3031\"],\n        // [\"S3032\"],\n        // [\"S3033\"],\n        // [\"S3034\"],\n        // [\"S3035\"],\n        // [\"S3036\"],\n        // [\"S3037\"],\n        // [\"S3038\"],\n        // [\"S3039\"],\n        // [\"S3040\"],\n        // [\"S3041\"],\n        // [\"S3042\"],\n        // [\"S3043\"],\n        // [\"S3044\"],\n        // [\"S3045\"],\n        // [\"S3046\"],\n        // [\"S3047\"],\n        // [\"S3048\"],\n        // [\"S3049\"],\n        // [\"S3050\"],\n        // [\"S3051\"],\n        [\"S3052\"] = \"CODE_SMELL\",\n        // [\"S3053\"],\n        // [\"S3054\"],\n        // [\"S3055\"],\n        // [\"S3056\"],\n        // [\"S3057\"],\n        // [\"S3058\"],\n        [\"S3059\"] = \"CODE_SMELL\",\n        [\"S3060\"] = \"CODE_SMELL\",\n        // [\"S3061\"],\n        // [\"S3062\"],\n        [\"S3063\"] = \"CODE_SMELL\",\n        // [\"S3064\"],\n        // [\"S3065\"],\n        // [\"S3066\"],\n        // [\"S3067\"],\n        // [\"S3068\"],\n        // [\"S3069\"],\n        // [\"S3070\"],\n        // [\"S3071\"],\n        // [\"S3072\"],\n        // [\"S3073\"],\n        // [\"S3074\"],\n        // [\"S3075\"],\n        // [\"S3076\"],\n        // [\"S3077\"],\n        // [\"S3078\"],\n        // [\"S3079\"],\n        // [\"S3080\"],\n        // [\"S3081\"],\n        // [\"S3082\"],\n        // [\"S3083\"],\n        // [\"S3084\"],\n        // [\"S3085\"],\n        // [\"S3086\"],\n        // [\"S3087\"],\n        // [\"S3088\"],\n        // [\"S3089\"],\n        // [\"S3090\"],\n        // [\"S3091\"],\n        // [\"S3092\"],\n        // [\"S3093\"],\n        // [\"S3094\"],\n        // [\"S3095\"],\n        // [\"S3096\"],\n        // [\"S3097\"],\n        // [\"S3098\"],\n        // [\"S3099\"],\n        // [\"S3100\"],\n        // [\"S3101\"],\n        // [\"S3102\"],\n        // [\"S3103\"],\n        // [\"S3104\"],\n        // [\"S3105\"],\n        // [\"S3106\"],\n        // [\"S3107\"],\n        // [\"S3108\"],\n        // [\"S3109\"],\n        // [\"S3110\"],\n        // [\"S3111\"],\n        // [\"S3112\"],\n        // [\"S3113\"],\n        // [\"S3114\"],\n        // [\"S3115\"],\n        // [\"S3116\"],\n        // [\"S3117\"],\n        // [\"S3118\"],\n        // [\"S3119\"],\n        // [\"S3120\"],\n        // [\"S3121\"],\n        // [\"S3122\"],\n        // [\"S3123\"],\n        // [\"S3124\"],\n        // [\"S3125\"],\n        // [\"S3126\"],\n        // [\"S3127\"],\n        // [\"S3128\"],\n        // [\"S3129\"],\n        // [\"S3130\"],\n        // [\"S3131\"],\n        // [\"S3132\"],\n        // [\"S3133\"],\n        // [\"S3134\"],\n        // [\"S3135\"],\n        // [\"S3136\"],\n        // [\"S3137\"],\n        // [\"S3138\"],\n        // [\"S3139\"],\n        // [\"S3140\"],\n        // [\"S3141\"],\n        // [\"S3142\"],\n        // [\"S3143\"],\n        // [\"S3144\"],\n        // [\"S3145\"],\n        // [\"S3146\"],\n        // [\"S3147\"],\n        // [\"S3148\"],\n        // [\"S3149\"],\n        // [\"S3150\"],\n        // [\"S3151\"],\n        // [\"S3152\"],\n        // [\"S3153\"],\n        // [\"S3154\"],\n        // [\"S3155\"],\n        // [\"S3156\"],\n        // [\"S3157\"],\n        // [\"S3158\"],\n        // [\"S3159\"],\n        // [\"S3160\"],\n        // [\"S3161\"],\n        // [\"S3162\"],\n        // [\"S3163\"],\n        // [\"S3164\"],\n        // [\"S3165\"],\n        // [\"S3166\"],\n        // [\"S3167\"],\n        [\"S3168\"] = \"BUG\",\n        [\"S3169\"] = \"CODE_SMELL\",\n        // [\"S3170\"],\n        // [\"S3171\"],\n        [\"S3172\"] = \"BUG\",\n        // [\"S3173\"],\n        // [\"S3174\"],\n        // [\"S3175\"],\n        // [\"S3176\"],\n        // [\"S3177\"],\n        // [\"S3178\"],\n        // [\"S3179\"],\n        // [\"S3180\"],\n        // [\"S3181\"],\n        // [\"S3182\"],\n        // [\"S3183\"],\n        // [\"S3184\"],\n        // [\"S3185\"],\n        // [\"S3186\"],\n        // [\"S3187\"],\n        // [\"S3188\"],\n        // [\"S3189\"],\n        // [\"S3190\"],\n        // [\"S3191\"],\n        // [\"S3192\"],\n        // [\"S3193\"],\n        // [\"S3194\"],\n        // [\"S3195\"],\n        // [\"S3196\"],\n        // [\"S3197\"],\n        // [\"S3198\"],\n        // [\"S3199\"],\n        // [\"S3200\"],\n        // [\"S3201\"],\n        // [\"S3202\"],\n        // [\"S3203\"],\n        // [\"S3204\"],\n        // [\"S3205\"],\n        // [\"S3206\"],\n        // [\"S3207\"],\n        // [\"S3208\"],\n        // [\"S3209\"],\n        // [\"S3210\"],\n        // [\"S3211\"],\n        // [\"S3212\"],\n        // [\"S3213\"],\n        // [\"S3214\"],\n        [\"S3215\"] = \"CODE_SMELL\",\n        [\"S3216\"] = \"CODE_SMELL\",\n        [\"S3217\"] = \"CODE_SMELL\",\n        [\"S3218\"] = \"CODE_SMELL\",\n        // [\"S3219\"],\n        [\"S3220\"] = \"CODE_SMELL\",\n        // [\"S3221\"],\n        // [\"S3222\"],\n        // [\"S3223\"],\n        // [\"S3224\"],\n        // [\"S3225\"],\n        // [\"S3226\"],\n        // [\"S3227\"],\n        // [\"S3228\"],\n        // [\"S3229\"],\n        // [\"S3230\"],\n        // [\"S3231\"],\n        // [\"S3232\"],\n        // [\"S3233\"],\n        [\"S3234\"] = \"CODE_SMELL\",\n        [\"S3235\"] = \"CODE_SMELL\",\n        [\"S3236\"] = \"CODE_SMELL\",\n        [\"S3237\"] = \"CODE_SMELL\",\n        // [\"S3238\"],\n        // [\"S3239\"],\n        [\"S3240\"] = \"CODE_SMELL\",\n        [\"S3241\"] = \"CODE_SMELL\",\n        [\"S3242\"] = \"CODE_SMELL\",\n        // [\"S3243\"],\n        [\"S3244\"] = \"BUG\",\n        // [\"S3245\"],\n        [\"S3246\"] = \"CODE_SMELL\",\n        [\"S3247\"] = \"CODE_SMELL\",\n        // [\"S3248\"],\n        [\"S3249\"] = \"BUG\",\n        // [\"S3250\"],\n        [\"S3251\"] = \"CODE_SMELL\",\n        // [\"S3252\"],\n        [\"S3253\"] = \"CODE_SMELL\",\n        [\"S3254\"] = \"CODE_SMELL\",\n        // [\"S3255\"],\n        [\"S3256\"] = \"CODE_SMELL\",\n        [\"S3257\"] = \"CODE_SMELL\",\n        // [\"S3258\"],\n        // [\"S3259\"],\n        [\"S3260\"] = \"CODE_SMELL\",\n        [\"S3261\"] = \"CODE_SMELL\",\n        [\"S3262\"] = \"CODE_SMELL\",\n        [\"S3263\"] = \"BUG\",\n        [\"S3264\"] = \"CODE_SMELL\",\n        [\"S3265\"] = \"CODE_SMELL\",\n        // [\"S3266\"],\n        [\"S3267\"] = \"CODE_SMELL\",\n        // [\"S3268\"],\n        // [\"S3269\"],\n        // [\"S3270\"],\n        // [\"S3271\"],\n        // [\"S3272\"],\n        // [\"S3273\"],\n        // [\"S3274\"],\n        // [\"S3275\"],\n        // [\"S3276\"],\n        // [\"S3277\"],\n        // [\"S3278\"],\n        // [\"S3279\"],\n        // [\"S3280\"],\n        // [\"S3281\"],\n        // [\"S3282\"],\n        // [\"S3283\"],\n        // [\"S3284\"],\n        // [\"S3285\"],\n        // [\"S3286\"],\n        // [\"S3287\"],\n        // [\"S3288\"],\n        // [\"S3289\"],\n        // [\"S3290\"],\n        // [\"S3291\"],\n        // [\"S3292\"],\n        // [\"S3293\"],\n        // [\"S3294\"],\n        // [\"S3295\"],\n        // [\"S3296\"],\n        // [\"S3297\"],\n        // [\"S3298\"],\n        // [\"S3299\"],\n        // [\"S3300\"],\n        // [\"S3301\"],\n        // [\"S3302\"],\n        // [\"S3303\"],\n        // [\"S3304\"],\n        // [\"S3305\"],\n        // [\"S3306\"],\n        // [\"S3307\"],\n        // [\"S3308\"],\n        // [\"S3309\"],\n        // [\"S3310\"],\n        // [\"S3311\"],\n        // [\"S3312\"],\n        // [\"S3313\"],\n        // [\"S3314\"],\n        // [\"S3315\"],\n        // [\"S3316\"],\n        // [\"S3317\"],\n        // [\"S3318\"],\n        // [\"S3319\"],\n        // [\"S3320\"],\n        // [\"S3321\"],\n        // [\"S3322\"],\n        // [\"S3323\"],\n        // [\"S3324\"],\n        // [\"S3325\"],\n        // [\"S3326\"],\n        // [\"S3327\"],\n        // [\"S3328\"],\n        [\"S3329\"] = \"VULNERABILITY\",\n        [\"S3330\"] = \"SECURITY_HOTSPOT\",\n        // [\"S3331\"],\n        // [\"S3332\"],\n        // [\"S3333\"],\n        // [\"S3334\"],\n        // [\"S3335\"],\n        // [\"S3336\"],\n        // [\"S3337\"],\n        // [\"S3338\"],\n        // [\"S3339\"],\n        // [\"S3340\"],\n        // [\"S3341\"],\n        // [\"S3342\"],\n        [\"S3343\"] = \"BUG\",\n        // [\"S3344\"],\n        // [\"S3345\"],\n        [\"S3346\"] = \"BUG\",\n        // [\"S3347\"],\n        // [\"S3348\"],\n        // [\"S3349\"],\n        // [\"S3350\"],\n        // [\"S3351\"],\n        // [\"S3352\"],\n        [\"S3353\"] = \"CODE_SMELL\",\n        // [\"S3354\"],\n        // [\"S3355\"],\n        // [\"S3356\"],\n        // [\"S3357\"],\n        [\"S3358\"] = \"CODE_SMELL\",\n        // [\"S3359\"],\n        // [\"S3360\"],\n        // [\"S3361\"],\n        // [\"S3362\"],\n        [\"S3363\"] = \"BUG\",\n        // [\"S3364\"],\n        // [\"S3365\"],\n        [\"S3366\"] = \"CODE_SMELL\",\n        // [\"S3367\"],\n        // [\"S3368\"],\n        // [\"S3369\"],\n        // [\"S3370\"],\n        // [\"S3371\"],\n        // [\"S3372\"],\n        // [\"S3373\"],\n        // [\"S3374\"],\n        // [\"S3375\"],\n        [\"S3376\"] = \"CODE_SMELL\",\n        // [\"S3377\"],\n        // [\"S3378\"],\n        // [\"S3379\"],\n        // [\"S3380\"],\n        // [\"S3381\"],\n        // [\"S3382\"],\n        // [\"S3383\"],\n        // [\"S3384\"],\n        // [\"S3385\"],\n        // [\"S3386\"],\n        // [\"S3387\"],\n        // [\"S3388\"],\n        // [\"S3389\"],\n        // [\"S3390\"],\n        // [\"S3391\"],\n        // [\"S3392\"],\n        // [\"S3393\"],\n        // [\"S3394\"],\n        // [\"S3395\"],\n        // [\"S3396\"],\n        [\"S3397\"] = \"BUG\",\n        [\"S3398\"] = \"CODE_SMELL\",\n        // [\"S3399\"],\n        [\"S3400\"] = \"CODE_SMELL\",\n        // [\"S3401\"],\n        // [\"S3402\"],\n        // [\"S3403\"],\n        // [\"S3404\"],\n        // [\"S3405\"],\n        // [\"S3406\"],\n        // [\"S3407\"],\n        // [\"S3408\"],\n        // [\"S3409\"],\n        // [\"S3410\"],\n        // [\"S3411\"],\n        // [\"S3412\"],\n        // [\"S3413\"],\n        // [\"S3414\"],\n        [\"S3415\"] = \"CODE_SMELL\",\n        [\"S3416\"] = \"CODE_SMELL\",\n        // [\"S3417\"],\n        // [\"S3418\"],\n        // [\"S3419\"],\n        // [\"S3420\"],\n        // [\"S3421\"],\n        // [\"S3422\"],\n        // [\"S3423\"],\n        // [\"S3424\"],\n        // [\"S3425\"],\n        // [\"S3426\"],\n        [\"S3427\"] = \"CODE_SMELL\",\n        // [\"S3428\"],\n        // [\"S3429\"],\n        // [\"S3430\"],\n        [\"S3431\"] = \"CODE_SMELL\",\n        // [\"S3432\"],\n        [\"S3433\"] = \"CODE_SMELL\",\n        // [\"S3434\"],\n        // [\"S3435\"],\n        // [\"S3436\"],\n        // [\"S3437\"],\n        // [\"S3438\"],\n        // [\"S3439\"],\n        [\"S3440\"] = \"CODE_SMELL\",\n        [\"S3441\"] = \"CODE_SMELL\",\n        [\"S3442\"] = \"CODE_SMELL\",\n        [\"S3443\"] = \"CODE_SMELL\",\n        [\"S3444\"] = \"CODE_SMELL\",\n        [\"S3445\"] = \"CODE_SMELL\",\n        // [\"S3446\"],\n        [\"S3447\"] = \"CODE_SMELL\",\n        // [\"S3448\"],\n        [\"S3449\"] = \"BUG\",\n        [\"S3450\"] = \"CODE_SMELL\",\n        [\"S3451\"] = \"CODE_SMELL\",\n        // [\"S3452\"],\n        [\"S3453\"] = \"BUG\",\n        // [\"S3454\"],\n        // [\"S3455\"],\n        [\"S3456\"] = \"BUG\",\n        [\"S3457\"] = \"CODE_SMELL\",\n        [\"S3458\"] = \"CODE_SMELL\",\n        [\"S3459\"] = \"CODE_SMELL\",\n        // [\"S3460\"],\n        // [\"S3461\"],\n        // [\"S3462\"],\n        // [\"S3463\"],\n        [\"S3464\"] = \"BUG\",\n        // [\"S3465\"],\n        [\"S3466\"] = \"BUG\",\n        // [\"S3467\"],\n        // [\"S3468\"],\n        // [\"S3469\"],\n        // [\"S3470\"],\n        // [\"S3471\"],\n        // [\"S3472\"],\n        // [\"S3473\"],\n        // [\"S3474\"],\n        // [\"S3475\"],\n        // [\"S3476\"],\n        // [\"S3477\"],\n        // [\"S3478\"],\n        // [\"S3479\"],\n        // [\"S3480\"],\n        // [\"S3481\"],\n        // [\"S3482\"],\n        // [\"S3483\"],\n        // [\"S3484\"],\n        // [\"S3485\"],\n        // [\"S3486\"],\n        // [\"S3487\"],\n        // [\"S3488\"],\n        // [\"S3489\"],\n        // [\"S3490\"],\n        // [\"S3491\"],\n        // [\"S3492\"],\n        // [\"S3493\"],\n        // [\"S3494\"],\n        // [\"S3495\"],\n        // [\"S3496\"],\n        // [\"S3497\"],\n        // [\"S3498\"],\n        // [\"S3499\"],\n        // [\"S3500\"],\n        // [\"S3501\"],\n        // [\"S3502\"],\n        // [\"S3503\"],\n        // [\"S3504\"],\n        // [\"S3505\"],\n        // [\"S3506\"],\n        // [\"S3507\"],\n        // [\"S3508\"],\n        // [\"S3509\"],\n        // [\"S3510\"],\n        // [\"S3511\"],\n        // [\"S3512\"],\n        // [\"S3513\"],\n        // [\"S3514\"],\n        // [\"S3515\"],\n        // [\"S3516\"],\n        // [\"S3517\"],\n        // [\"S3518\"],\n        // [\"S3519\"],\n        // [\"S3520\"],\n        // [\"S3521\"],\n        // [\"S3522\"],\n        // [\"S3523\"],\n        // [\"S3524\"],\n        // [\"S3525\"],\n        // [\"S3526\"],\n        // [\"S3527\"],\n        // [\"S3528\"],\n        // [\"S3529\"],\n        // [\"S3530\"],\n        // [\"S3531\"],\n        [\"S3532\"] = \"CODE_SMELL\",\n        // [\"S3533\"],\n        // [\"S3534\"],\n        // [\"S3535\"],\n        // [\"S3536\"],\n        // [\"S3537\"],\n        // [\"S3538\"],\n        // [\"S3539\"],\n        // [\"S3540\"],\n        // [\"S3541\"],\n        // [\"S3542\"],\n        // [\"S3543\"],\n        // [\"S3544\"],\n        // [\"S3545\"],\n        // [\"S3546\"],\n        // [\"S3547\"],\n        // [\"S3548\"],\n        // [\"S3549\"],\n        // [\"S3550\"],\n        // [\"S3551\"],\n        // [\"S3552\"],\n        // [\"S3553\"],\n        // [\"S3554\"],\n        // [\"S3555\"],\n        // [\"S3556\"],\n        // [\"S3557\"],\n        // [\"S3558\"],\n        // [\"S3559\"],\n        // [\"S3560\"],\n        // [\"S3561\"],\n        // [\"S3562\"],\n        // [\"S3563\"],\n        // [\"S3564\"],\n        // [\"S3565\"],\n        // [\"S3566\"],\n        // [\"S3567\"],\n        // [\"S3568\"],\n        // [\"S3569\"],\n        // [\"S3570\"],\n        // [\"S3571\"],\n        // [\"S3572\"],\n        // [\"S3573\"],\n        // [\"S3574\"],\n        // [\"S3575\"],\n        // [\"S3576\"],\n        // [\"S3577\"],\n        // [\"S3578\"],\n        // [\"S3579\"],\n        // [\"S3580\"],\n        // [\"S3581\"],\n        // [\"S3582\"],\n        // [\"S3583\"],\n        // [\"S3584\"],\n        // [\"S3585\"],\n        // [\"S3586\"],\n        // [\"S3587\"],\n        // [\"S3588\"],\n        // [\"S3589\"],\n        // [\"S3590\"],\n        // [\"S3591\"],\n        // [\"S3592\"],\n        // [\"S3593\"],\n        // [\"S3594\"],\n        // [\"S3595\"],\n        // [\"S3596\"],\n        [\"S3597\"] = \"CODE_SMELL\",\n        [\"S3598\"] = \"BUG\",\n        // [\"S3599\"],\n        [\"S3600\"] = \"CODE_SMELL\",\n        // [\"S3601\"],\n        // [\"S3602\"],\n        [\"S3603\"] = \"BUG\",\n        [\"S3604\"] = \"CODE_SMELL\",\n        // [\"S3605\"],\n        // [\"S3606\"],\n        // [\"S3607\"],\n        // [\"S3608\"],\n        // [\"S3609\"],\n        [\"S3610\"] = \"BUG\",\n        // [\"S3611\"],\n        // [\"S3612\"],\n        // [\"S3613\"],\n        // [\"S3614\"],\n        // [\"S3615\"],\n        // [\"S3616\"],\n        // [\"S3617\"],\n        // [\"S3618\"],\n        // [\"S3619\"],\n        // [\"S3620\"],\n        // [\"S3621\"],\n        // [\"S3622\"],\n        // [\"S3623\"],\n        // [\"S3624\"],\n        // [\"S3625\"],\n        [\"S3626\"] = \"CODE_SMELL\",\n        // [\"S3627\"],\n        // [\"S3628\"],\n        // [\"S3629\"],\n        // [\"S3630\"],\n        // [\"S3631\"],\n        // [\"S3632\"],\n        // [\"S3633\"],\n        // [\"S3634\"],\n        // [\"S3635\"],\n        // [\"S3636\"],\n        // [\"S3637\"],\n        // [\"S3638\"],\n        // [\"S3639\"],\n        // [\"S3640\"],\n        // [\"S3641\"],\n        // [\"S3642\"],\n        // [\"S3643\"],\n        // [\"S3644\"],\n        // [\"S3645\"],\n        // [\"S3646\"],\n        // [\"S3647\"],\n        // [\"S3648\"],\n        // [\"S3649\"],\n        // [\"S3650\"],\n        // [\"S3651\"],\n        // [\"S3652\"],\n        // [\"S3653\"],\n        // [\"S3654\"],\n        [\"S3655\"] = \"BUG\",\n        // [\"S3656\"],\n        // [\"S3657\"],\n        // [\"S3658\"],\n        // [\"S3659\"],\n        // [\"S3660\"],\n        // [\"S3661\"],\n        // [\"S3662\"],\n        // [\"S3663\"],\n        // [\"S3664\"],\n        // [\"S3665\"],\n        // [\"S3666\"],\n        // [\"S3667\"],\n        // [\"S3668\"],\n        // [\"S3669\"],\n        // [\"S3670\"],\n        // [\"S3671\"],\n        // [\"S3672\"],\n        // [\"S3673\"],\n        // [\"S3674\"],\n        // [\"S3675\"],\n        // [\"S3676\"],\n        // [\"S3677\"],\n        // [\"S3678\"],\n        // [\"S3679\"],\n        // [\"S3680\"],\n        // [\"S3681\"],\n        // [\"S3682\"],\n        // [\"S3683\"],\n        // [\"S3684\"],\n        // [\"S3685\"],\n        // [\"S3686\"],\n        // [\"S3687\"],\n        // [\"S3688\"],\n        // [\"S3689\"],\n        // [\"S3690\"],\n        // [\"S3691\"],\n        // [\"S3692\"],\n        // [\"S3693\"],\n        // [\"S3694\"],\n        // [\"S3695\"],\n        // [\"S3696\"],\n        // [\"S3697\"],\n        // [\"S3698\"],\n        // [\"S3699\"],\n        // [\"S3700\"],\n        // [\"S3701\"],\n        // [\"S3702\"],\n        // [\"S3703\"],\n        // [\"S3704\"],\n        // [\"S3705\"],\n        // [\"S3706\"],\n        // [\"S3707\"],\n        // [\"S3708\"],\n        // [\"S3709\"],\n        // [\"S3710\"],\n        // [\"S3711\"],\n        // [\"S3712\"],\n        // [\"S3713\"],\n        // [\"S3714\"],\n        // [\"S3715\"],\n        // [\"S3716\"],\n        [\"S3717\"] = \"CODE_SMELL\",\n        // [\"S3718\"],\n        // [\"S3719\"],\n        // [\"S3720\"],\n        // [\"S3721\"],\n        // [\"S3722\"],\n        // [\"S3723\"],\n        // [\"S3724\"],\n        // [\"S3725\"],\n        // [\"S3726\"],\n        // [\"S3727\"],\n        // [\"S3728\"],\n        // [\"S3729\"],\n        // [\"S3730\"],\n        // [\"S3731\"],\n        // [\"S3732\"],\n        // [\"S3733\"],\n        // [\"S3734\"],\n        // [\"S3735\"],\n        // [\"S3736\"],\n        // [\"S3737\"],\n        // [\"S3738\"],\n        // [\"S3739\"],\n        // [\"S3740\"],\n        // [\"S3741\"],\n        // [\"S3742\"],\n        // [\"S3743\"],\n        // [\"S3744\"],\n        // [\"S3745\"],\n        // [\"S3746\"],\n        // [\"S3747\"],\n        // [\"S3748\"],\n        // [\"S3749\"],\n        // [\"S3750\"],\n        // [\"S3751\"],\n        // [\"S3752\"],\n        // [\"S3753\"],\n        // [\"S3754\"],\n        // [\"S3755\"],\n        // [\"S3756\"],\n        // [\"S3757\"],\n        // [\"S3758\"],\n        // [\"S3759\"],\n        // [\"S3760\"],\n        // [\"S3761\"],\n        // [\"S3762\"],\n        // [\"S3763\"],\n        // [\"S3764\"],\n        // [\"S3765\"],\n        // [\"S3766\"],\n        // [\"S3767\"],\n        // [\"S3768\"],\n        // [\"S3769\"],\n        // [\"S3770\"],\n        // [\"S3771\"],\n        // [\"S3772\"],\n        // [\"S3773\"],\n        // [\"S3774\"],\n        // [\"S3775\"],\n        [\"S3776\"] = \"CODE_SMELL\",\n        // [\"S3777\"],\n        // [\"S3778\"],\n        // [\"S3779\"],\n        // [\"S3780\"],\n        // [\"S3781\"],\n        // [\"S3782\"],\n        // [\"S3783\"],\n        // [\"S3784\"],\n        // [\"S3785\"],\n        // [\"S3786\"],\n        // [\"S3787\"],\n        // [\"S3788\"],\n        // [\"S3789\"],\n        // [\"S3790\"],\n        // [\"S3791\"],\n        // [\"S3792\"],\n        // [\"S3793\"],\n        // [\"S3794\"],\n        // [\"S3795\"],\n        // [\"S3796\"],\n        // [\"S3797\"],\n        // [\"S3798\"],\n        // [\"S3799\"],\n        // [\"S3800\"],\n        // [\"S3801\"],\n        // [\"S3802\"],\n        // [\"S3803\"],\n        // [\"S3804\"],\n        // [\"S3805\"],\n        // [\"S3806\"],\n        // [\"S3807\"],\n        // [\"S3808\"],\n        // [\"S3809\"],\n        // [\"S3810\"],\n        // [\"S3811\"],\n        // [\"S3812\"],\n        // [\"S3813\"],\n        // [\"S3814\"],\n        // [\"S3815\"],\n        // [\"S3816\"],\n        // [\"S3817\"],\n        // [\"S3818\"],\n        // [\"S3819\"],\n        // [\"S3820\"],\n        // [\"S3821\"],\n        // [\"S3822\"],\n        // [\"S3823\"],\n        // [\"S3824\"],\n        // [\"S3825\"],\n        // [\"S3826\"],\n        // [\"S3827\"],\n        // [\"S3828\"],\n        // [\"S3829\"],\n        // [\"S3830\"],\n        // [\"S3831\"],\n        // [\"S3832\"],\n        // [\"S3833\"],\n        // [\"S3834\"],\n        // [\"S3835\"],\n        // [\"S3836\"],\n        // [\"S3837\"],\n        // [\"S3838\"],\n        // [\"S3839\"],\n        // [\"S3840\"],\n        // [\"S3841\"],\n        // [\"S3842\"],\n        // [\"S3843\"],\n        // [\"S3844\"],\n        // [\"S3845\"],\n        // [\"S3846\"],\n        // [\"S3847\"],\n        // [\"S3848\"],\n        // [\"S3849\"],\n        // [\"S3850\"],\n        // [\"S3851\"],\n        // [\"S3852\"],\n        // [\"S3853\"],\n        // [\"S3854\"],\n        // [\"S3855\"],\n        // [\"S3856\"],\n        // [\"S3857\"],\n        // [\"S3858\"],\n        // [\"S3859\"],\n        // [\"S3860\"],\n        // [\"S3861\"],\n        // [\"S3862\"],\n        // [\"S3863\"],\n        // [\"S3864\"],\n        // [\"S3865\"],\n        // [\"S3866\"],\n        // [\"S3867\"],\n        // [\"S3868\"],\n        [\"S3869\"] = \"BUG\",\n        // [\"S3870\"],\n        [\"S3871\"] = \"CODE_SMELL\",\n        [\"S3872\"] = \"CODE_SMELL\",\n        // [\"S3873\"],\n        [\"S3874\"] = \"CODE_SMELL\",\n        [\"S3875\"] = \"CODE_SMELL\",\n        [\"S3876\"] = \"CODE_SMELL\",\n        [\"S3877\"] = \"CODE_SMELL\",\n        [\"S3878\"] = \"CODE_SMELL\",\n        // [\"S3879\"],\n        [\"S3880\"] = \"CODE_SMELL\",\n        [\"S3881\"] = \"CODE_SMELL\",\n        // [\"S3882\"],\n        // [\"S3883\"],\n        [\"S3884\"] = \"VULNERABILITY\",\n        [\"S3885\"] = \"CODE_SMELL\",\n        // [\"S3886\"],\n        [\"S3887\"] = \"BUG\",\n        // [\"S3888\"],\n        [\"S3889\"] = \"BUG\",\n        // [\"S3890\"],\n        // [\"S3891\"],\n        // [\"S3892\"],\n        // [\"S3893\"],\n        // [\"S3894\"],\n        // [\"S3895\"],\n        // [\"S3896\"],\n        [\"S3897\"] = \"CODE_SMELL\",\n        [\"S3898\"] = \"CODE_SMELL\",\n        // [\"S3899\"],\n        [\"S3900\"] = \"CODE_SMELL\",\n        // [\"S3901\"],\n        [\"S3902\"] = \"CODE_SMELL\",\n        [\"S3903\"] = \"BUG\",\n        [\"S3904\"] = \"CODE_SMELL\",\n        // [\"S3905\"],\n        [\"S3906\"] = \"CODE_SMELL\",\n        // [\"S3907\"],\n        [\"S3908\"] = \"CODE_SMELL\",\n        [\"S3909\"] = \"CODE_SMELL\",\n        // [\"S3910\"],\n        // [\"S3911\"],\n        // [\"S3912\"],\n        // [\"S3913\"],\n        // [\"S3914\"],\n        // [\"S3915\"],\n        // [\"S3916\"],\n        // [\"S3917\"],\n        // [\"S3918\"],\n        // [\"S3919\"],\n        // [\"S3920\"],\n        // [\"S3921\"],\n        // [\"S3922\"],\n        [\"S3923\"] = \"BUG\",\n        // [\"S3924\"],\n        [\"S3925\"] = \"CODE_SMELL\",\n        [\"S3926\"] = \"BUG\",\n        [\"S3927\"] = \"BUG\",\n        [\"S3928\"] = \"CODE_SMELL\",\n        // [\"S3929\"],\n        // [\"S3930\"],\n        // [\"S3931\"],\n        // [\"S3932\"],\n        // [\"S3933\"],\n        // [\"S3934\"],\n        // [\"S3935\"],\n        // [\"S3936\"],\n        [\"S3937\"] = \"CODE_SMELL\",\n        // [\"S3938\"],\n        // [\"S3939\"],\n        // [\"S3940\"],\n        // [\"S3941\"],\n        // [\"S3942\"],\n        // [\"S3943\"],\n        // [\"S3944\"],\n        // [\"S3945\"],\n        // [\"S3946\"],\n        // [\"S3947\"],\n        // [\"S3948\"],\n        [\"S3949\"] = \"BUG\",\n        // [\"S3950\"],\n        // [\"S3951\"],\n        // [\"S3952\"],\n        // [\"S3953\"],\n        // [\"S3954\"],\n        // [\"S3955\"],\n        [\"S3956\"] = \"CODE_SMELL\",\n        // [\"S3957\"],\n        // [\"S3958\"],\n        // [\"S3959\"],\n        // [\"S3960\"],\n        // [\"S3961\"],\n        [\"S3962\"] = \"CODE_SMELL\",\n        [\"S3963\"] = \"CODE_SMELL\",\n        // [\"S3964\"],\n        // [\"S3965\"],\n        [\"S3966\"] = \"CODE_SMELL\",\n        [\"S3967\"] = \"CODE_SMELL\",\n        // [\"S3968\"],\n        // [\"S3969\"],\n        // [\"S3970\"],\n        [\"S3971\"] = \"CODE_SMELL\",\n        [\"S3972\"] = \"CODE_SMELL\",\n        [\"S3973\"] = \"CODE_SMELL\",\n        // [\"S3974\"],\n        // [\"S3975\"],\n        // [\"S3976\"],\n        // [\"S3977\"],\n        // [\"S3978\"],\n        // [\"S3979\"],\n        // [\"S3980\"],\n        [\"S3981\"] = \"BUG\",\n        // [\"S3982\"],\n        // [\"S3983\"],\n        [\"S3984\"] = \"BUG\",\n        // [\"S3985\"],\n        // [\"S3986\"],\n        // [\"S3987\"],\n        // [\"S3988\"],\n        // [\"S3989\"],\n        [\"S3990\"] = \"CODE_SMELL\",\n        // [\"S3991\"],\n        [\"S3992\"] = \"CODE_SMELL\",\n        [\"S3993\"] = \"CODE_SMELL\",\n        [\"S3994\"] = \"CODE_SMELL\",\n        [\"S3995\"] = \"CODE_SMELL\",\n        [\"S3996\"] = \"CODE_SMELL\",\n        [\"S3997\"] = \"CODE_SMELL\",\n        [\"S3998\"] = \"CODE_SMELL\",\n        // [\"S3999\"],\n        [\"S4000\"] = \"CODE_SMELL\",\n        // [\"S4001\"],\n        [\"S4002\"] = \"CODE_SMELL\",\n        // [\"S4003\"],\n        [\"S4004\"] = \"CODE_SMELL\",\n        [\"S4005\"] = \"CODE_SMELL\",\n        // [\"S4006\"],\n        // [\"S4007\"],\n        // [\"S4008\"],\n        // [\"S4009\"],\n        // [\"S4010\"],\n        // [\"S4011\"],\n        // [\"S4012\"],\n        // [\"S4013\"],\n        // [\"S4014\"],\n        [\"S4015\"] = \"CODE_SMELL\",\n        [\"S4016\"] = \"CODE_SMELL\",\n        [\"S4017\"] = \"CODE_SMELL\",\n        [\"S4018\"] = \"CODE_SMELL\",\n        [\"S4019\"] = \"CODE_SMELL\",\n        // [\"S4020\"],\n        // [\"S4021\"],\n        [\"S4022\"] = \"CODE_SMELL\",\n        [\"S4023\"] = \"CODE_SMELL\",\n        // [\"S4024\"],\n        [\"S4025\"] = \"CODE_SMELL\",\n        [\"S4026\"] = \"CODE_SMELL\",\n        [\"S4027\"] = \"CODE_SMELL\",\n        // [\"S4028\"],\n        // [\"S4029\"],\n        // [\"S4030\"],\n        // [\"S4031\"],\n        // [\"S4032\"],\n        // [\"S4033\"],\n        // [\"S4034\"],\n        [\"S4035\"] = \"CODE_SMELL\",\n        [\"S4036\"] = \"SECURITY_HOTSPOT\",\n        // [\"S4037\"],\n        // [\"S4038\"],\n        [\"S4039\"] = \"CODE_SMELL\",\n        [\"S4040\"] = \"CODE_SMELL\",\n        [\"S4041\"] = \"CODE_SMELL\",\n        // [\"S4042\"],\n        // [\"S4043\"],\n        // [\"S4044\"],\n        // [\"S4045\"],\n        // [\"S4046\"],\n        [\"S4047\"] = \"CODE_SMELL\",\n        // [\"S4048\"],\n        [\"S4049\"] = \"CODE_SMELL\",\n        [\"S4050\"] = \"CODE_SMELL\",\n        // [\"S4051\"],\n        [\"S4052\"] = \"CODE_SMELL\",\n        // [\"S4053\"],\n        // [\"S4054\"],\n        [\"S4055\"] = \"CODE_SMELL\",\n        [\"S4056\"] = \"CODE_SMELL\",\n        [\"S4057\"] = \"CODE_SMELL\",\n        [\"S4058\"] = \"CODE_SMELL\",\n        [\"S4059\"] = \"CODE_SMELL\",\n        [\"S4060\"] = \"CODE_SMELL\",\n        [\"S4061\"] = \"CODE_SMELL\",\n        // [\"S4062\"],\n        // [\"S4063\"],\n        // [\"S4064\"],\n        // [\"S4065\"],\n        // [\"S4066\"],\n        // [\"S4067\"],\n        // [\"S4068\"],\n        [\"S4069\"] = \"CODE_SMELL\",\n        [\"S4070\"] = \"CODE_SMELL\",\n        // [\"S4071\"],\n        // [\"S4072\"],\n        // [\"S4073\"],\n        // [\"S4074\"],\n        // [\"S4075\"],\n        // [\"S4076\"],\n        // [\"S4077\"],\n        // [\"S4078\"],\n        // [\"S4079\"],\n        // [\"S4080\"],\n        // [\"S4081\"],\n        // [\"S4082\"],\n        // [\"S4083\"],\n        // [\"S4084\"],\n        // [\"S4085\"],\n        // [\"S4086\"],\n        // [\"S4087\"],\n        // [\"S4088\"],\n        // [\"S4089\"],\n        // [\"S4090\"],\n        // [\"S4091\"],\n        // [\"S4092\"],\n        // [\"S4093\"],\n        // [\"S4094\"],\n        // [\"S4095\"],\n        // [\"S4096\"],\n        // [\"S4097\"],\n        // [\"S4098\"],\n        // [\"S4099\"],\n        // [\"S4100\"],\n        // [\"S4101\"],\n        // [\"S4102\"],\n        // [\"S4103\"],\n        // [\"S4104\"],\n        // [\"S4105\"],\n        // [\"S4106\"],\n        // [\"S4107\"],\n        // [\"S4108\"],\n        // [\"S4109\"],\n        // [\"S4110\"],\n        // [\"S4111\"],\n        // [\"S4112\"],\n        // [\"S4113\"],\n        // [\"S4114\"],\n        // [\"S4115\"],\n        // [\"S4116\"],\n        // [\"S4117\"],\n        // [\"S4118\"],\n        // [\"S4119\"],\n        // [\"S4120\"],\n        // [\"S4121\"],\n        // [\"S4122\"],\n        // [\"S4123\"],\n        // [\"S4124\"],\n        // [\"S4125\"],\n        // [\"S4126\"],\n        // [\"S4127\"],\n        // [\"S4128\"],\n        // [\"S4129\"],\n        // [\"S4130\"],\n        // [\"S4131\"],\n        // [\"S4132\"],\n        // [\"S4133\"],\n        // [\"S4134\"],\n        // [\"S4135\"],\n        [\"S4136\"] = \"CODE_SMELL\",\n        // [\"S4137\"],\n        // [\"S4138\"],\n        // [\"S4139\"],\n        // [\"S4140\"],\n        // [\"S4141\"],\n        // [\"S4142\"],\n        [\"S4143\"] = \"BUG\",\n        [\"S4144\"] = \"CODE_SMELL\",\n        // [\"S4145\"],\n        // [\"S4146\"],\n        // [\"S4147\"],\n        // [\"S4148\"],\n        // [\"S4149\"],\n        // [\"S4150\"],\n        // [\"S4151\"],\n        // [\"S4152\"],\n        // [\"S4153\"],\n        // [\"S4154\"],\n        // [\"S4155\"],\n        // [\"S4156\"],\n        // [\"S4157\"],\n        [\"S4158\"] = \"BUG\",\n        [\"S4159\"] = \"BUG\",\n        // [\"S4160\"],\n        // [\"S4161\"],\n        // [\"S4162\"],\n        // [\"S4163\"],\n        // [\"S4164\"],\n        // [\"S4165\"],\n        // [\"S4166\"],\n        // [\"S4167\"],\n        // [\"S4168\"],\n        // [\"S4169\"],\n        // [\"S4170\"],\n        // [\"S4171\"],\n        // [\"S4172\"],\n        // [\"S4173\"],\n        // [\"S4174\"],\n        // [\"S4175\"],\n        // [\"S4176\"],\n        // [\"S4177\"],\n        // [\"S4178\"],\n        // [\"S4179\"],\n        // [\"S4180\"],\n        // [\"S4181\"],\n        // [\"S4182\"],\n        // [\"S4183\"],\n        // [\"S4184\"],\n        // [\"S4185\"],\n        // [\"S4186\"],\n        // [\"S4187\"],\n        // [\"S4188\"],\n        // [\"S4189\"],\n        // [\"S4190\"],\n        // [\"S4191\"],\n        // [\"S4192\"],\n        // [\"S4193\"],\n        // [\"S4194\"],\n        // [\"S4195\"],\n        // [\"S4196\"],\n        // [\"S4197\"],\n        // [\"S4198\"],\n        // [\"S4199\"],\n        [\"S4200\"] = \"CODE_SMELL\",\n        [\"S4201\"] = \"CODE_SMELL\",\n        // [\"S4202\"],\n        // [\"S4203\"],\n        // [\"S4204\"],\n        // [\"S4205\"],\n        // [\"S4206\"],\n        // [\"S4207\"],\n        // [\"S4208\"],\n        // [\"S4209\"],\n        [\"S4210\"] = \"BUG\",\n        [\"S4211\"] = \"VULNERABILITY\",\n        [\"S4212\"] = \"VULNERABILITY\",\n        // [\"S4213\"],\n        [\"S4214\"] = \"CODE_SMELL\",\n        // [\"S4215\"],\n        // [\"S4216\"],\n        // [\"S4217\"],\n        // [\"S4218\"],\n        // [\"S4219\"],\n        [\"S4220\"] = \"CODE_SMELL\",\n        // [\"S4221\"],\n        // [\"S4222\"],\n        // [\"S4223\"],\n        // [\"S4224\"],\n        [\"S4225\"] = \"CODE_SMELL\",\n        [\"S4226\"] = \"CODE_SMELL\",\n        // [\"S4227\"],\n        // [\"S4228\"],\n        // [\"S4229\"],\n        // [\"S4230\"],\n        // [\"S4231\"],\n        // [\"S4232\"],\n        // [\"S4233\"],\n        // [\"S4234\"],\n        // [\"S4235\"],\n        // [\"S4236\"],\n        // [\"S4237\"],\n        // [\"S4238\"],\n        // [\"S4239\"],\n        // [\"S4240\"],\n        // [\"S4241\"],\n        // [\"S4242\"],\n        // [\"S4243\"],\n        // [\"S4244\"],\n        // [\"S4245\"],\n        // [\"S4246\"],\n        // [\"S4247\"],\n        // [\"S4248\"],\n        // [\"S4249\"],\n        // [\"S4250\"],\n        // [\"S4251\"],\n        // [\"S4252\"],\n        // [\"S4253\"],\n        // [\"S4254\"],\n        // [\"S4255\"],\n        // [\"S4256\"],\n        // [\"S4257\"],\n        // [\"S4258\"],\n        // [\"S4259\"],\n        [\"S4260\"] = \"BUG\",\n        [\"S4261\"] = \"CODE_SMELL\",\n        // [\"S4262\"],\n        // [\"S4263\"],\n        // [\"S4264\"],\n        // [\"S4265\"],\n        // [\"S4266\"],\n        // [\"S4267\"],\n        // [\"S4268\"],\n        // [\"S4269\"],\n        // [\"S4270\"],\n        // [\"S4271\"],\n        // [\"S4272\"],\n        // [\"S4273\"],\n        // [\"S4274\"],\n        [\"S4275\"] = \"BUG\",\n        // [\"S4276\"],\n        [\"S4277\"] = \"BUG\",\n        // [\"S4278\"],\n        // [\"S4279\"],\n        // [\"S4280\"],\n        // [\"S4281\"],\n        // [\"S4282\"],\n        // [\"S4283\"],\n        // [\"S4284\"],\n        // [\"S4285\"],\n        // [\"S4286\"],\n        // [\"S4287\"],\n        // [\"S4288\"],\n        // [\"S4289\"],\n        // [\"S4290\"],\n        // [\"S4291\"],\n        // [\"S4292\"],\n        // [\"S4293\"],\n        // [\"S4294\"],\n        // [\"S4295\"],\n        // [\"S4296\"],\n        // [\"S4297\"],\n        // [\"S4298\"],\n        // [\"S4299\"],\n        // [\"S4300\"],\n        // [\"S4301\"],\n        // [\"S4302\"],\n        // [\"S4303\"],\n        // [\"S4304\"],\n        // [\"S4305\"],\n        // [\"S4306\"],\n        // [\"S4307\"],\n        // [\"S4308\"],\n        // [\"S4309\"],\n        // [\"S4310\"],\n        // [\"S4311\"],\n        // [\"S4312\"],\n        // [\"S4313\"],\n        // [\"S4314\"],\n        // [\"S4315\"],\n        // [\"S4316\"],\n        // [\"S4317\"],\n        // [\"S4318\"],\n        // [\"S4319\"],\n        // [\"S4320\"],\n        // [\"S4321\"],\n        // [\"S4322\"],\n        // [\"S4323\"],\n        // [\"S4324\"],\n        // [\"S4325\"],\n        // [\"S4326\"],\n        // [\"S4327\"],\n        // [\"S4328\"],\n        // [\"S4329\"],\n        // [\"S4330\"],\n        // [\"S4331\"],\n        // [\"S4332\"],\n        // [\"S4333\"],\n        // [\"S4334\"],\n        // [\"S4335\"],\n        // [\"S4336\"],\n        // [\"S4337\"],\n        // [\"S4338\"],\n        // [\"S4339\"],\n        // [\"S4340\"],\n        // [\"S4341\"],\n        // [\"S4342\"],\n        // [\"S4343\"],\n        // [\"S4344\"],\n        // [\"S4345\"],\n        // [\"S4346\"],\n        [\"S4347\"] = \"VULNERABILITY\",\n        // [\"S4348\"],\n        // [\"S4349\"],\n        // [\"S4350\"],\n        // [\"S4351\"],\n        // [\"S4352\"],\n        // [\"S4353\"],\n        // [\"S4354\"],\n        // [\"S4355\"],\n        // [\"S4356\"],\n        // [\"S4357\"],\n        // [\"S4358\"],\n        // [\"S4359\"],\n        // [\"S4360\"],\n        // [\"S4361\"],\n        // [\"S4362\"],\n        // [\"S4363\"],\n        // [\"S4364\"],\n        // [\"S4365\"],\n        // [\"S4366\"],\n        // [\"S4367\"],\n        // [\"S4368\"],\n        // [\"S4369\"],\n        // [\"S4370\"],\n        // [\"S4371\"],\n        // [\"S4372\"],\n        // [\"S4373\"],\n        // [\"S4374\"],\n        // [\"S4375\"],\n        // [\"S4376\"],\n        // [\"S4377\"],\n        // [\"S4378\"],\n        // [\"S4379\"],\n        // [\"S4380\"],\n        // [\"S4381\"],\n        // [\"S4382\"],\n        // [\"S4383\"],\n        // [\"S4384\"],\n        // [\"S4385\"],\n        // [\"S4386\"],\n        // [\"S4387\"],\n        // [\"S4388\"],\n        // [\"S4389\"],\n        // [\"S4390\"],\n        // [\"S4391\"],\n        // [\"S4392\"],\n        // [\"S4393\"],\n        // [\"S4394\"],\n        // [\"S4395\"],\n        // [\"S4396\"],\n        // [\"S4397\"],\n        // [\"S4398\"],\n        // [\"S4399\"],\n        // [\"S4400\"],\n        // [\"S4401\"],\n        // [\"S4402\"],\n        // [\"S4403\"],\n        // [\"S4404\"],\n        // [\"S4405\"],\n        // [\"S4406\"],\n        // [\"S4407\"],\n        // [\"S4408\"],\n        // [\"S4409\"],\n        // [\"S4410\"],\n        // [\"S4411\"],\n        // [\"S4412\"],\n        // [\"S4413\"],\n        // [\"S4414\"],\n        // [\"S4415\"],\n        // [\"S4416\"],\n        // [\"S4417\"],\n        // [\"S4418\"],\n        // [\"S4419\"],\n        // [\"S4420\"],\n        // [\"S4421\"],\n        // [\"S4422\"],\n        [\"S4423\"] = \"VULNERABILITY\",\n        // [\"S4424\"],\n        // [\"S4425\"],\n        [\"S4426\"] = \"VULNERABILITY\",\n        // [\"S4427\"],\n        [\"S4428\"] = \"BUG\",\n        // [\"S4429\"],\n        // [\"S4430\"],\n        // [\"S4431\"],\n        // [\"S4432\"],\n        [\"S4433\"] = \"VULNERABILITY\",\n        // [\"S4434\"],\n        // [\"S4435\"],\n        // [\"S4436\"],\n        // [\"S4437\"],\n        // [\"S4438\"],\n        // [\"S4439\"],\n        // [\"S4440\"],\n        // [\"S4441\"],\n        // [\"S4442\"],\n        // [\"S4443\"],\n        // [\"S4444\"],\n        // [\"S4445\"],\n        // [\"S4446\"],\n        // [\"S4447\"],\n        // [\"S4448\"],\n        // [\"S4449\"],\n        // [\"S4450\"],\n        // [\"S4451\"],\n        // [\"S4452\"],\n        // [\"S4453\"],\n        // [\"S4454\"],\n        // [\"S4455\"],\n        [\"S4456\"] = \"CODE_SMELL\",\n        [\"S4457\"] = \"CODE_SMELL\",\n        // [\"S4458\"],\n        // [\"S4459\"],\n        // [\"S4460\"],\n        // [\"S4461\"],\n        [\"S4462\"] = \"CODE_SMELL\",\n        // [\"S4463\"],\n        // [\"S4464\"],\n        // [\"S4465\"],\n        // [\"S4466\"],\n        // [\"S4467\"],\n        // [\"S4468\"],\n        // [\"S4469\"],\n        // [\"S4470\"],\n        // [\"S4471\"],\n        // [\"S4472\"],\n        // [\"S4473\"],\n        // [\"S4474\"],\n        // [\"S4475\"],\n        // [\"S4476\"],\n        // [\"S4477\"],\n        // [\"S4478\"],\n        // [\"S4479\"],\n        // [\"S4480\"],\n        // [\"S4481\"],\n        // [\"S4482\"],\n        // [\"S4483\"],\n        // [\"S4484\"],\n        // [\"S4485\"],\n        // [\"S4486\"],\n        [\"S4487\"] = \"CODE_SMELL\",\n        // [\"S4488\"],\n        // [\"S4489\"],\n        // [\"S4490\"],\n        // [\"S4491\"],\n        // [\"S4492\"],\n        // [\"S4493\"],\n        // [\"S4494\"],\n        // [\"S4495\"],\n        // [\"S4496\"],\n        // [\"S4497\"],\n        // [\"S4498\"],\n        // [\"S4499\"],\n        // [\"S4500\"],\n        // [\"S4501\"],\n        [\"S4502\"] = \"SECURITY_HOTSPOT\",\n        // [\"S4503\"],\n        // [\"S4504\"],\n        // [\"S4505\"],\n        // [\"S4506\"],\n        [\"S4507\"] = \"SECURITY_HOTSPOT\",\n        // [\"S4508\"],\n        // [\"S4509\"],\n        // [\"S4510\"],\n        // [\"S4511\"],\n        // [\"S4512\"],\n        // [\"S4513\"],\n        // [\"S4514\"],\n        // [\"S4515\"],\n        // [\"S4516\"],\n        // [\"S4517\"],\n        // [\"S4518\"],\n        // [\"S4519\"],\n        // [\"S4520\"],\n        // [\"S4521\"],\n        // [\"S4522\"],\n        // [\"S4523\"],\n        [\"S4524\"] = \"CODE_SMELL\",\n        // [\"S4525\"],\n        // [\"S4526\"],\n        // [\"S4527\"],\n        // [\"S4528\"],\n        // [\"S4529\"] = \"SECURITY_HOTSPOT\",\n        // [\"S4530\"],\n        // [\"S4531\"],\n        // [\"S4532\"],\n        // [\"S4533\"],\n        // [\"S4534\"],\n        // [\"S4535\"],\n        // [\"S4536\"],\n        // [\"S4537\"],\n        // [\"S4538\"],\n        // [\"S4539\"],\n        // [\"S4540\"],\n        // [\"S4541\"],\n        // [\"S4542\"],\n        // [\"S4543\"],\n        // [\"S4544\"],\n        [\"S4545\"] = \"CODE_SMELL\",\n        // [\"S4546\"],\n        // [\"S4547\"],\n        // [\"S4548\"],\n        // [\"S4549\"],\n        // [\"S4550\"],\n        // [\"S4551\"],\n        // [\"S4552\"],\n        // [\"S4553\"],\n        // [\"S4554\"],\n        // [\"S4555\"],\n        // [\"S4556\"],\n        // [\"S4557\"],\n        // [\"S4558\"],\n        // [\"S4559\"],\n        // [\"S4560\"],\n        // [\"S4561\"],\n        // [\"S4562\"],\n        // [\"S4563\"],\n        // [\"S4564\"],\n        // [\"S4565\"],\n        // [\"S4566\"],\n        // [\"S4567\"],\n        // [\"S4568\"],\n        // [\"S4569\"],\n        // [\"S4570\"],\n        // [\"S4571\"],\n        // [\"S4572\"],\n        // [\"S4573\"],\n        // [\"S4574\"],\n        // [\"S4575\"],\n        // [\"S4576\"],\n        // [\"S4577\"],\n        // [\"S4578\"],\n        // [\"S4579\"],\n        // [\"S4580\"],\n        [\"S4581\"] = \"CODE_SMELL\",\n        // [\"S4582\"],\n        [\"S4583\"] = \"BUG\",\n        // [\"S4584\"],\n        // [\"S4585\"],\n        [\"S4586\"] = \"BUG\",\n        // [\"S4587\"],\n        // [\"S4588\"],\n        // [\"S4589\"],\n        // [\"S4590\"],\n        // [\"S4591\"],\n        // [\"S4592\"],\n        // [\"S4593\"],\n        // [\"S4594\"],\n        // [\"S4595\"],\n        // [\"S4596\"],\n        // [\"S4597\"],\n        // [\"S4598\"],\n        // [\"S4599\"],\n        // [\"S4600\"],\n        // [\"S4601\"],\n        // [\"S4602\"],\n        // [\"S4603\"],\n        // [\"S4604\"],\n        // [\"S4605\"],\n        // [\"S4606\"],\n        // [\"S4607\"],\n        // [\"S4608\"],\n        // [\"S4609\"],\n        // [\"S4610\"],\n        // [\"S4611\"],\n        // [\"S4612\"],\n        // [\"S4613\"],\n        // [\"S4614\"],\n        // [\"S4615\"],\n        // [\"S4616\"],\n        // [\"S4617\"],\n        // [\"S4618\"],\n        // [\"S4619\"],\n        // [\"S4620\"],\n        // [\"S4621\"],\n        // [\"S4622\"],\n        // [\"S4623\"],\n        // [\"S4624\"],\n        // [\"S4625\"],\n        // [\"S4626\"],\n        // [\"S4627\"],\n        // [\"S4628\"],\n        // [\"S4629\"],\n        // [\"S4630\"],\n        // [\"S4631\"],\n        // [\"S4632\"],\n        // [\"S4633\"],\n        // [\"S4634\"],\n        [\"S4635\"] = \"CODE_SMELL\",\n        // [\"S4636\"],\n        // [\"S4637\"],\n        // [\"S4638\"],\n        // [\"S4639\"],\n        // [\"S4640\"],\n        // [\"S4641\"],\n        // [\"S4642\"],\n        // [\"S4643\"],\n        // [\"S4644\"],\n        // [\"S4645\"],\n        // [\"S4646\"],\n        // [\"S4647\"],\n        // [\"S4648\"],\n        // [\"S4649\"],\n        // [\"S4650\"],\n        // [\"S4651\"],\n        // [\"S4652\"],\n        // [\"S4653\"],\n        // [\"S4654\"],\n        // [\"S4655\"],\n        // [\"S4656\"],\n        // [\"S4657\"],\n        // [\"S4658\"],\n        // [\"S4659\"],\n        // [\"S4660\"],\n        // [\"S4661\"],\n        // [\"S4662\"],\n        [\"S4663\"] = \"CODE_SMELL\",\n        // [\"S4664\"],\n        // [\"S4665\"],\n        // [\"S4666\"],\n        // [\"S4667\"],\n        // [\"S4668\"],\n        // [\"S4669\"],\n        // [\"S4670\"],\n        // [\"S4671\"],\n        // [\"S4672\"],\n        // [\"S4673\"],\n        // [\"S4674\"],\n        // [\"S4675\"],\n        // [\"S4676\"],\n        // [\"S4677\"],\n        // [\"S4678\"],\n        // [\"S4679\"],\n        // [\"S4680\"],\n        // [\"S4681\"],\n        // [\"S4682\"],\n        // [\"S4683\"],\n        // [\"S4684\"],\n        // [\"S4685\"],\n        // [\"S4686\"],\n        // [\"S4687\"],\n        // [\"S4688\"],\n        // [\"S4689\"],\n        // [\"S4690\"],\n        // [\"S4691\"],\n        // [\"S4692\"],\n        // [\"S4693\"],\n        // [\"S4694\"],\n        // [\"S4695\"],\n        // [\"S4696\"],\n        // [\"S4697\"],\n        // [\"S4698\"],\n        // [\"S4699\"],\n        // [\"S4700\"],\n        // [\"S4701\"],\n        // [\"S4702\"],\n        // [\"S4703\"],\n        // [\"S4704\"],\n        // [\"S4705\"],\n        // [\"S4706\"],\n        // [\"S4707\"],\n        // [\"S4708\"],\n        // [\"S4709\"],\n        // [\"S4710\"],\n        // [\"S4711\"],\n        // [\"S4712\"],\n        // [\"S4713\"],\n        // [\"S4714\"],\n        // [\"S4715\"],\n        // [\"S4716\"],\n        // [\"S4717\"],\n        // [\"S4718\"],\n        // [\"S4719\"],\n        // [\"S4720\"],\n        // [\"S4721\"] = \"SECURITY_HOTSPOT\",\n        // [\"S4722\"],\n        // [\"S4723\"],\n        // [\"S4724\"],\n        // [\"S4725\"],\n        // [\"S4726\"],\n        // [\"S4727\"],\n        // [\"S4728\"],\n        // [\"S4729\"],\n        // [\"S4730\"],\n        // [\"S4731\"],\n        // [\"S4732\"],\n        // [\"S4733\"],\n        // [\"S4734\"],\n        // [\"S4735\"],\n        // [\"S4736\"],\n        // [\"S4737\"],\n        // [\"S4738\"],\n        // [\"S4739\"],\n        // [\"S4740\"],\n        // [\"S4741\"],\n        // [\"S4742\"],\n        // [\"S4743\"],\n        // [\"S4744\"],\n        // [\"S4745\"],\n        // [\"S4746\"],\n        // [\"S4747\"],\n        // [\"S4748\"],\n        // [\"S4749\"],\n        // [\"S4750\"],\n        // [\"S4751\"],\n        // [\"S4752\"],\n        // [\"S4753\"],\n        // [\"S4754\"],\n        // [\"S4755\"],\n        // [\"S4756\"],\n        // [\"S4757\"],\n        // [\"S4758\"],\n        // [\"S4759\"],\n        // [\"S4760\"],\n        // [\"S4761\"],\n        // [\"S4762\"],\n        // [\"S4763\"],\n        // [\"S4764\"],\n        // [\"S4765\"],\n        // [\"S4766\"],\n        // [\"S4767\"],\n        // [\"S4768\"],\n        // [\"S4769\"],\n        // [\"S4770\"],\n        // [\"S4771\"],\n        // [\"S4772\"],\n        // [\"S4773\"],\n        // [\"S4774\"],\n        // [\"S4775\"],\n        // [\"S4776\"],\n        // [\"S4777\"],\n        // [\"S4778\"],\n        // [\"S4779\"],\n        // [\"S4780\"],\n        // [\"S4781\"],\n        // [\"S4782\"],\n        // [\"S4783\"],\n        // [\"S4784\"],\n        // [\"S4785\"],\n        // [\"S4786\"],\n        // [\"S4787\"],\n        // [\"S4788\"],\n        // [\"S4789\"],\n        [\"S4790\"] = \"SECURITY_HOTSPOT\",\n        // [\"S4791\"],\n        [\"S4792\"] = \"SECURITY_HOTSPOT\",\n        // [\"S4793\"],\n        // [\"S4794\"],\n        // [\"S4795\"],\n        // [\"S4796\"],\n        // [\"S4797\"] = \"SECURITY_HOTSPOT\",\n        // [\"S4798\"],\n        // [\"S4799\"],\n        // [\"S4800\"],\n        // [\"S4801\"],\n        // [\"S4802\"],\n        // [\"S4803\"],\n        // [\"S4804\"],\n        // [\"S4805\"],\n        // [\"S4806\"],\n        // [\"S4807\"],\n        // [\"S4808\"],\n        // [\"S4809\"],\n        // [\"S4810\"],\n        // [\"S4811\"],\n        // [\"S4812\"],\n        // [\"S4813\"],\n        // [\"S4814\"],\n        // [\"S4815\"],\n        // [\"S4816\"],\n        // [\"S4817\"] = \"SECURITY_HOTSPOT\",\n        // [\"S4818\"],\n        // [\"S4819\"],\n        // [\"S4820\"],\n        // [\"S4821\"],\n        // [\"S4822\"],\n        // [\"S4823\"],\n        // [\"S4824\"],\n        // [\"S4825\"] = \"SECURITY_HOTSPOT\",\n        // [\"S4826\"],\n        // [\"S4827\"],\n        // [\"S4828\"],\n        // [\"S4829\"],\n        [\"S4830\"] = \"VULNERABILITY\",\n        // [\"S4831\"],\n        // [\"S4832\"],\n        // [\"S4833\"],\n        // [\"S4834\"]\",\n        // [\"S4835\"],\n        // [\"S4836\"],\n        // [\"S4837\"],\n        // [\"S4838\"],\n        // [\"S4839\"],\n        // [\"S4840\"],\n        // [\"S4841\"],\n        // [\"S4842\"],\n        // [\"S4843\"],\n        // [\"S4844\"],\n        // [\"S4845\"],\n        // [\"S4846\"],\n        // [\"S4847\"],\n        // [\"S4848\"],\n        // [\"S4849\"],\n        // [\"S4850\"],\n        // [\"S4851\"],\n        // [\"S4852\"],\n        // [\"S4853\"],\n        // [\"S4854\"],\n        // [\"S4855\"],\n        // [\"S4856\"],\n        // [\"S4857\"],\n        // [\"S4858\"],\n        // [\"S4859\"],\n        // [\"S4860\"],\n        // [\"S4861\"],\n        // [\"S4862\"],\n        // [\"S4863\"],\n        // [\"S4864\"],\n        // [\"S4865\"],\n        // [\"S4866\"],\n        // [\"S4867\"],\n        // [\"S4868\"],\n        // [\"S4869\"],\n        // [\"S4870\"],\n        // [\"S4871\"],\n        // [\"S4872\"],\n        // [\"S4873\"],\n        // [\"S4874\"],\n        // [\"S4875\"],\n        // [\"S4876\"],\n        // [\"S4877\"],\n        // [\"S4878\"],\n        // [\"S4879\"],\n        // [\"S4880\"],\n        // [\"S4881\"],\n        // [\"S4882\"],\n        // [\"S4883\"],\n        // [\"S4884\"],\n        // [\"S4885\"],\n        // [\"S4886\"],\n        // [\"S4887\"],\n        // [\"S4888\"],\n        // [\"S4889\"],\n        // [\"S4890\"],\n        // [\"S4891\"],\n        // [\"S4892\"],\n        // [\"S4893\"],\n        // [\"S4894\"],\n        // [\"S4895\"],\n        // [\"S4896\"],\n        // [\"S4897\"],\n        // [\"S4898\"],\n        // [\"S4899\"],\n        // [\"S4900\"],\n        // [\"S4901\"],\n        // [\"S4902\"],\n        // [\"S4903\"],\n        // [\"S4904\"],\n        // [\"S4905\"],\n        // [\"S4906\"],\n        // [\"S4907\"],\n        // [\"S4908\"],\n        // [\"S4909\"],\n        // [\"S4910\"],\n        // [\"S4911\"],\n        // [\"S4912\"],\n        // [\"S4913\"],\n        // [\"S4914\"],\n        // [\"S4915\"],\n        // [\"S4916\"],\n        // [\"S4917\"],\n        // [\"S4918\"],\n        // [\"S4919\"],\n        // [\"S4920\"],\n        // [\"S4921\"],\n        // [\"S4922\"],\n        // [\"S4923\"],\n        // [\"S4924\"],\n        // [\"S4925\"],\n        // [\"S4926\"],\n        // [\"S4927\"],\n        // [\"S4928\"],\n        // [\"S4929\"],\n        // [\"S4930\"],\n        // [\"S4931\"],\n        // [\"S4932\"],\n        // [\"S4933\"],\n        // [\"S4934\"],\n        // [\"S4935\"],\n        // [\"S4936\"],\n        // [\"S4937\"],\n        // [\"S4938\"],\n        // [\"S4939\"],\n        // [\"S4940\"],\n        // [\"S4941\"],\n        // [\"S4942\"],\n        // [\"S4943\"],\n        // [\"S4944\"],\n        // [\"S4945\"],\n        // [\"S4946\"],\n        // [\"S4947\"],\n        // [\"S4948\"],\n        // [\"S4949\"],\n        // [\"S4950\"],\n        // [\"S4951\"],\n        // [\"S4952\"],\n        // [\"S4953\"],\n        // [\"S4954\"],\n        // [\"S4955\"],\n        // [\"S4956\"],\n        // [\"S4957\"],\n        // [\"S4958\"],\n        // [\"S4959\"],\n        // [\"S4960\"],\n        // [\"S4961\"],\n        // [\"S4962\"],\n        // [\"S4963\"],\n        // [\"S4964\"],\n        // [\"S4965\"],\n        // [\"S4966\"],\n        // [\"S4967\"],\n        // [\"S4968\"],\n        // [\"S4969\"],\n        // [\"S4970\"],\n        // [\"S4971\"],\n        // [\"S4972\"],\n        // [\"S4973\"],\n        // [\"S4974\"],\n        // [\"S4975\"],\n        // [\"S4976\"],\n        // [\"S4977\"],\n        // [\"S4978\"],\n        // [\"S4979\"],\n        // [\"S4980\"],\n        // [\"S4981\"],\n        // [\"S4982\"],\n        // [\"S4983\"],\n        // [\"S4984\"],\n        // [\"S4985\"],\n        // [\"S4986\"],\n        // [\"S4987\"],\n        // [\"S4988\"],\n        // [\"S4989\"],\n        // [\"S4990\"],\n        // [\"S4991\"],\n        // [\"S4992\"],\n        // [\"S4993\"],\n        // [\"S4994\"],\n        // [\"S4995\"],\n        // [\"S4996\"],\n        // [\"S4997\"],\n        // [\"S4998\"],\n        // [\"S4999\"],\n        // [\"S5000\"],\n        // [\"S5001\"],\n        // [\"S5002\"],\n        // [\"S5003\"],\n        // [\"S5004\"],\n        // [\"S5005\"],\n        // [\"S5006\"],\n        // [\"S5007\"],\n        // [\"S5008\"],\n        // [\"S5009\"],\n        // [\"S5010\"],\n        // [\"S5011\"],\n        // [\"S5012\"],\n        // [\"S5013\"],\n        // [\"S5014\"],\n        // [\"S5015\"],\n        // [\"S5016\"],\n        // [\"S5017\"],\n        // [\"S5018\"],\n        // [\"S5019\"],\n        // [\"S5020\"],\n        // [\"S5021\"],\n        // [\"S5022\"],\n        // [\"S5023\"],\n        // [\"S5024\"],\n        // [\"S5025\"],\n        // [\"S5026\"],\n        // [\"S5027\"],\n        // [\"S5028\"],\n        // [\"S5029\"],\n        // [\"S5030\"],\n        // [\"S5031\"],\n        // [\"S5032\"],\n        // [\"S5033\"],\n        [\"S5034\"] = \"CODE_SMELL\",\n        // [\"S5035\"],\n        // [\"S5036\"],\n        // [\"S5037\"],\n        // [\"S5038\"],\n        // [\"S5039\"],\n        // [\"S5040\"],\n        // [\"S5041\"],\n        [\"S5042\"] = \"SECURITY_HOTSPOT\",\n        // [\"S5043\"],\n        // [\"S5044\"],\n        // [\"S5045\"],\n        // [\"S5046\"],\n        // [\"S5047\"],\n        // [\"S5048\"],\n        // [\"S5049\"],\n        // [\"S5050\"],\n        // [\"S5051\"],\n        // [\"S5052\"],\n        // [\"S5053\"],\n        // [\"S5054\"],\n        // [\"S5055\"],\n        // [\"S5056\"],\n        // [\"S5057\"],\n        // [\"S5058\"],\n        // [\"S5059\"],\n        // [\"S5060\"],\n        // [\"S5061\"],\n        // [\"S5062\"],\n        // [\"S5063\"],\n        // [\"S5064\"],\n        // [\"S5065\"],\n        // [\"S5066\"],\n        // [\"S5067\"],\n        // [\"S5068\"],\n        // [\"S5069\"],\n        // [\"S5070\"],\n        // [\"S5071\"],\n        // [\"S5072\"],\n        // [\"S5073\"],\n        // [\"S5074\"],\n        // [\"S5075\"],\n        // [\"S5076\"],\n        // [\"S5077\"],\n        // [\"S5078\"],\n        // [\"S5079\"],\n        // [\"S5080\"],\n        // [\"S5081\"],\n        // [\"S5082\"],\n        // [\"S5083\"],\n        // [\"S5084\"],\n        // [\"S5085\"],\n        // [\"S5086\"],\n        // [\"S5087\"],\n        // [\"S5088\"],\n        // [\"S5089\"],\n        // [\"S5090\"],\n        // [\"S5091\"],\n        // [\"S5092\"],\n        // [\"S5093\"],\n        // [\"S5094\"],\n        // [\"S5095\"],\n        // [\"S5096\"],\n        // [\"S5097\"],\n        // [\"S5098\"],\n        // [\"S5099\"],\n        // [\"S5100\"],\n        // [\"S5101\"],\n        // [\"S5102\"],\n        // [\"S5103\"],\n        // [\"S5104\"],\n        // [\"S5105\"],\n        // [\"S5106\"],\n        // [\"S5107\"],\n        // [\"S5108\"],\n        // [\"S5109\"],\n        // [\"S5110\"],\n        // [\"S5111\"],\n        // [\"S5112\"],\n        // [\"S5113\"],\n        // [\"S5114\"],\n        // [\"S5115\"],\n        // [\"S5116\"],\n        // [\"S5117\"],\n        // [\"S5118\"],\n        // [\"S5119\"],\n        // [\"S5120\"],\n        // [\"S5121\"],\n        [\"S5122\"] = \"SECURITY_HOTSPOT\",\n        // [\"S5123\"],\n        // [\"S5124\"],\n        // [\"S5125\"],\n        // [\"S5126\"],\n        // [\"S5127\"],\n        // [\"S5128\"],\n        // [\"S5129\"],\n        // [\"S5130\"],\n        // [\"S5131\"],\n        // [\"S5132\"],\n        // [\"S5133\"],\n        // [\"S5134\"],\n        // [\"S5135\"],\n        // [\"S5136\"],\n        // [\"S5137\"],\n        // [\"S5138\"],\n        // [\"S5139\"],\n        // [\"S5140\"],\n        // [\"S5141\"],\n        // [\"S5142\"],\n        // [\"S5143\"],\n        // [\"S5144\"],\n        // [\"S5145\"],\n        // [\"S5146\"],\n        // [\"S5147\"],\n        // [\"S5148\"],\n        // [\"S5149\"],\n        // [\"S5150\"],\n        // [\"S5151\"],\n        // [\"S5152\"],\n        // [\"S5153\"],\n        // [\"S5154\"],\n        // [\"S5155\"],\n        // [\"S5156\"],\n        // [\"S5157\"],\n        // [\"S5158\"],\n        // [\"S5159\"],\n        // [\"S5160\"],\n        // [\"S5161\"],\n        // [\"S5162\"],\n        // [\"S5163\"],\n        // [\"S5164\"],\n        // [\"S5165\"],\n        // [\"S5166\"],\n        // [\"S5167\"],\n        // [\"S5168\"],\n        // [\"S5169\"],\n        // [\"S5170\"],\n        // [\"S5171\"],\n        // [\"S5172\"],\n        // [\"S5173\"],\n        // [\"S5174\"],\n        // [\"S5175\"],\n        // [\"S5176\"],\n        // [\"S5177\"],\n        // [\"S5178\"],\n        // [\"S5179\"],\n        // [\"S5180\"],\n        // [\"S5181\"],\n        // [\"S5182\"],\n        // [\"S5183\"],\n        // [\"S5184\"],\n        // [\"S5185\"],\n        // [\"S5186\"],\n        // [\"S5187\"],\n        // [\"S5188\"],\n        // [\"S5189\"],\n        // [\"S5190\"],\n        // [\"S5191\"],\n        // [\"S5192\"],\n        // [\"S5193\"],\n        // [\"S5194\"],\n        // [\"S5195\"],\n        // [\"S5196\"],\n        // [\"S5197\"],\n        // [\"S5198\"],\n        // [\"S5199\"],\n        // [\"S5200\"],\n        // [\"S5201\"],\n        // [\"S5202\"],\n        // [\"S5203\"],\n        // [\"S5204\"],\n        // [\"S5205\"],\n        // [\"S5206\"],\n        // [\"S5207\"],\n        // [\"S5208\"],\n        // [\"S5209\"],\n        // [\"S5210\"],\n        // [\"S5211\"],\n        // [\"S5212\"],\n        // [\"S5213\"],\n        // [\"S5214\"],\n        // [\"S5215\"],\n        // [\"S5216\"],\n        // [\"S5217\"],\n        // [\"S5218\"],\n        // [\"S5219\"],\n        // [\"S5220\"],\n        // [\"S5221\"],\n        // [\"S5222\"],\n        // [\"S5223\"],\n        // [\"S5224\"],\n        // [\"S5225\"],\n        // [\"S5226\"],\n        // [\"S5227\"],\n        // [\"S5228\"],\n        // [\"S5229\"],\n        // [\"S5230\"],\n        // [\"S5231\"],\n        // [\"S5232\"],\n        // [\"S5233\"],\n        // [\"S5234\"],\n        // [\"S5235\"],\n        // [\"S5236\"],\n        // [\"S5237\"],\n        // [\"S5238\"],\n        // [\"S5239\"],\n        // [\"S5240\"],\n        // [\"S5241\"],\n        // [\"S5242\"],\n        // [\"S5243\"],\n        // [\"S5244\"],\n        // [\"S5245\"],\n        // [\"S5246\"],\n        // [\"S5247\"],\n        // [\"S5248\"],\n        // [\"S5249\"],\n        // [\"S5250\"],\n        // [\"S5251\"],\n        // [\"S5252\"],\n        // [\"S5253\"],\n        // [\"S5254\"],\n        // [\"S5255\"],\n        // [\"S5256\"],\n        // [\"S5257\"],\n        // [\"S5258\"],\n        // [\"S5259\"],\n        // [\"S5260\"],\n        // [\"S5261\"],\n        // [\"S5262\"],\n        // [\"S5263\"],\n        // [\"S5264\"],\n        // [\"S5265\"],\n        // [\"S5266\"],\n        // [\"S5267\"],\n        // [\"S5268\"],\n        // [\"S5269\"],\n        // [\"S5270\"],\n        // [\"S5271\"],\n        // [\"S5272\"],\n        // [\"S5273\"],\n        // [\"S5274\"],\n        // [\"S5275\"],\n        // [\"S5276\"],\n        // [\"S5277\"],\n        // [\"S5278\"],\n        // [\"S5279\"],\n        // [\"S5280\"],\n        // [\"S5281\"],\n        // [\"S5282\"],\n        // [\"S5283\"],\n        // [\"S5284\"],\n        // [\"S5285\"],\n        // [\"S5286\"],\n        // [\"S5287\"],\n        // [\"S5288\"],\n        // [\"S5289\"],\n        // [\"S5290\"],\n        // [\"S5291\"],\n        // [\"S5292\"],\n        // [\"S5293\"],\n        // [\"S5294\"],\n        // [\"S5295\"],\n        // [\"S5296\"],\n        // [\"S5297\"],\n        // [\"S5298\"],\n        // [\"S5299\"],\n        // [\"S5300\"],\n        // [\"S5301\"],\n        // [\"S5302\"],\n        // [\"S5303\"],\n        // [\"S5304\"],\n        // [\"S5305\"],\n        // [\"S5306\"],\n        // [\"S5307\"],\n        // [\"S5308\"],\n        // [\"S5309\"],\n        // [\"S5310\"],\n        // [\"S5311\"],\n        // [\"S5312\"],\n        // [\"S5313\"],\n        // [\"S5314\"],\n        // [\"S5315\"],\n        // [\"S5316\"],\n        // [\"S5317\"],\n        // [\"S5318\"],\n        // [\"S5319\"],\n        // [\"S5320\"],\n        // [\"S5321\"],\n        // [\"S5322\"],\n        // [\"S5323\"],\n        // [\"S5324\"],\n        // [\"S5325\"],\n        // [\"S5326\"],\n        // [\"S5327\"],\n        // [\"S5328\"],\n        // [\"S5329\"],\n        // [\"S5330\"],\n        // [\"S5331\"],\n        [\"S5332\"] = \"SECURITY_HOTSPOT\",\n        // [\"S5333\"],\n        // [\"S5334\"],\n        // [\"S5335\"],\n        // [\"S5336\"],\n        // [\"S5337\"],\n        // [\"S5338\"],\n        // [\"S5339\"],\n        // [\"S5340\"],\n        // [\"S5341\"],\n        // [\"S5342\"],\n        // [\"S5343\"],\n        [\"S5344\"] = \"VULNERABILITY\",\n        // [\"S5345\"],\n        // [\"S5346\"],\n        // [\"S5347\"],\n        // [\"S5348\"],\n        // [\"S5349\"],\n        // [\"S5350\"],\n        // [\"S5351\"],\n        // [\"S5352\"],\n        // [\"S5353\"],\n        // [\"S5354\"],\n        // [\"S5355\"],\n        // [\"S5356\"],\n        // [\"S5357\"],\n        // [\"S5358\"],\n        // [\"S5359\"],\n        // [\"S5360\"],\n        // [\"S5361\"],\n        // [\"S5362\"],\n        // [\"S5363\"],\n        // [\"S5364\"],\n        // [\"S5365\"],\n        // [\"S5366\"],\n        // [\"S5367\"],\n        // [\"S5368\"],\n        // [\"S5369\"],\n        // [\"S5370\"],\n        // [\"S5371\"],\n        // [\"S5372\"],\n        // [\"S5373\"],\n        // [\"S5374\"],\n        // [\"S5375\"],\n        // [\"S5376\"],\n        // [\"S5377\"],\n        // [\"S5378\"],\n        // [\"S5379\"],\n        // [\"S5380\"],\n        // [\"S5381\"],\n        // [\"S5382\"],\n        // [\"S5383\"],\n        // [\"S5384\"],\n        // [\"S5385\"],\n        // [\"S5386\"],\n        // [\"S5387\"],\n        // [\"S5388\"],\n        // [\"S5389\"],\n        // [\"S5390\"],\n        // [\"S5391\"],\n        // [\"S5392\"],\n        // [\"S5393\"],\n        // [\"S5394\"],\n        // [\"S5395\"],\n        // [\"S5396\"],\n        // [\"S5397\"],\n        // [\"S5398\"],\n        // [\"S5399\"],\n        // [\"S5400\"],\n        // [\"S5401\"],\n        // [\"S5402\"],\n        // [\"S5403\"],\n        // [\"S5404\"],\n        // [\"S5405\"],\n        // [\"S5406\"],\n        // [\"S5407\"],\n        // [\"S5408\"],\n        // [\"S5409\"],\n        // [\"S5410\"],\n        // [\"S5411\"],\n        // [\"S5412\"],\n        // [\"S5413\"],\n        // [\"S5414\"],\n        // [\"S5415\"],\n        // [\"S5416\"],\n        // [\"S5417\"],\n        // [\"S5418\"],\n        // [\"S5419\"],\n        // [\"S5420\"],\n        // [\"S5421\"],\n        // [\"S5422\"],\n        // [\"S5423\"],\n        // [\"S5424\"],\n        // [\"S5425\"],\n        // [\"S5426\"],\n        // [\"S5427\"],\n        // [\"S5428\"],\n        // [\"S5429\"],\n        // [\"S5430\"],\n        // [\"S5431\"],\n        // [\"S5432\"],\n        // [\"S5433\"],\n        // [\"S5434\"],\n        // [\"S5435\"],\n        // [\"S5436\"],\n        // [\"S5437\"],\n        // [\"S5438\"],\n        // [\"S5439\"],\n        // [\"S5440\"],\n        // [\"S5441\"],\n        // [\"S5442\"],\n        [\"S5443\"] = \"SECURITY_HOTSPOT\",\n        // [\"S5444\"],\n        [\"S5445\"] = \"VULNERABILITY\",\n        // [\"S5446\"],\n        // [\"S5447\"],\n        // [\"S5448\"],\n        // [\"S5449\"],\n        // [\"S5450\"],\n        // [\"S5451\"],\n        // [\"S5452\"],\n        // [\"S5453\"],\n        // [\"S5454\"],\n        // [\"S5455\"],\n        // [\"S5456\"],\n        // [\"S5457\"],\n        // [\"S5458\"],\n        // [\"S5459\"],\n        // [\"S5460\"],\n        // [\"S5461\"],\n        // [\"S5462\"],\n        // [\"S5463\"],\n        // [\"S5464\"],\n        // [\"S5465\"],\n        // [\"S5466\"],\n        // [\"S5467\"],\n        // [\"S5468\"],\n        // [\"S5469\"],\n        // [\"S5470\"],\n        // [\"S5471\"],\n        // [\"S5472\"],\n        // [\"S5473\"],\n        // [\"S5474\"],\n        // [\"S5475\"],\n        // [\"S5476\"],\n        // [\"S5477\"],\n        // [\"S5478\"],\n        // [\"S5479\"],\n        // [\"S5480\"],\n        // [\"S5481\"],\n        // [\"S5482\"],\n        // [\"S5483\"],\n        // [\"S5484\"],\n        // [\"S5485\"],\n        // [\"S5486\"],\n        // [\"S5487\"],\n        // [\"S5488\"],\n        // [\"S5489\"],\n        // [\"S5490\"],\n        // [\"S5491\"],\n        // [\"S5492\"],\n        // [\"S5493\"],\n        // [\"S5494\"],\n        // [\"S5495\"],\n        // [\"S5496\"],\n        // [\"S5497\"],\n        // [\"S5498\"],\n        // [\"S5499\"],\n        // [\"S5500\"],\n        // [\"S5501\"],\n        // [\"S5502\"],\n        // [\"S5503\"],\n        // [\"S5504\"],\n        // [\"S5505\"],\n        // [\"S5506\"],\n        // [\"S5507\"],\n        // [\"S5508\"],\n        // [\"S5509\"],\n        // [\"S5510\"],\n        // [\"S5511\"],\n        // [\"S5512\"],\n        // [\"S5513\"],\n        // [\"S5514\"],\n        // [\"S5515\"],\n        // [\"S5516\"],\n        // [\"S5517\"],\n        // [\"S5518\"],\n        // [\"S5519\"],\n        // [\"S5520\"],\n        // [\"S5521\"],\n        // [\"S5522\"],\n        // [\"S5523\"],\n        // [\"S5524\"],\n        // [\"S5525\"],\n        // [\"S5526\"],\n        // [\"S5527\"],\n        // [\"S5528\"],\n        // [\"S5529\"],\n        // [\"S5530\"],\n        // [\"S5531\"],\n        // [\"S5532\"],\n        // [\"S5533\"],\n        // [\"S5534\"],\n        // [\"S5535\"],\n        // [\"S5536\"],\n        // [\"S5537\"],\n        // [\"S5538\"],\n        // [\"S5539\"],\n        // [\"S5540\"],\n        // [\"S5541\"],\n        [\"S5542\"] = \"VULNERABILITY\",\n        // [\"S5543\"],\n        // [\"S5544\"],\n        // [\"S5545\"],\n        // [\"S5546\"],\n        [\"S5547\"] = \"VULNERABILITY\",\n        // [\"S5548\"],\n        // [\"S5549\"],\n        // [\"S5550\"],\n        // [\"S5551\"],\n        // [\"S5552\"],\n        // [\"S5553\"],\n        // [\"S5554\"],\n        // [\"S5555\"],\n        // [\"S5556\"],\n        // [\"S5557\"],\n        // [\"S5558\"],\n        // [\"S5559\"],\n        // [\"S5560\"],\n        // [\"S5561\"],\n        // [\"S5562\"],\n        // [\"S5563\"],\n        // [\"S5564\"],\n        // [\"S5565\"],\n        // [\"S5566\"],\n        // [\"S5567\"],\n        // [\"S5568\"],\n        // [\"S5569\"],\n        // [\"S5570\"],\n        // [\"S5571\"],\n        // [\"S5572\"],\n        // [\"S5573\"],\n        // [\"S5574\"],\n        // [\"S5575\"],\n        // [\"S5576\"],\n        // [\"S5577\"],\n        // [\"S5578\"],\n        // [\"S5579\"],\n        // [\"S5580\"],\n        // [\"S5581\"],\n        // [\"S5582\"],\n        // [\"S5583\"],\n        // [\"S5584\"],\n        // [\"S5585\"],\n        // [\"S5586\"],\n        // [\"S5587\"],\n        // [\"S5588\"],\n        // [\"S5589\"],\n        // [\"S5590\"],\n        // [\"S5591\"],\n        // [\"S5592\"],\n        // [\"S5593\"],\n        // [\"S5594\"],\n        // [\"S5595\"],\n        // [\"S5596\"],\n        // [\"S5597\"],\n        // [\"S5598\"],\n        // [\"S5599\"],\n        // [\"S5600\"],\n        // [\"S5601\"],\n        // [\"S5602\"],\n        // [\"S5603\"],\n        // [\"S5604\"],\n        // [\"S5605\"],\n        // [\"S5606\"],\n        // [\"S5607\"],\n        // [\"S5608\"],\n        // [\"S5609\"],\n        // [\"S5610\"],\n        // [\"S5611\"],\n        // [\"S5612\"],\n        // [\"S5613\"],\n        // [\"S5614\"],\n        // [\"S5615\"],\n        // [\"S5616\"],\n        // [\"S5617\"],\n        // [\"S5618\"],\n        // [\"S5619\"],\n        // [\"S5620\"],\n        // [\"S5621\"],\n        // [\"S5622\"],\n        // [\"S5623\"],\n        // [\"S5624\"],\n        // [\"S5625\"],\n        // [\"S5626\"],\n        // [\"S5627\"],\n        // [\"S5628\"],\n        // [\"S5629\"],\n        // [\"S5630\"],\n        // [\"S5631\"],\n        // [\"S5632\"],\n        // [\"S5633\"],\n        // [\"S5634\"],\n        // [\"S5635\"],\n        // [\"S5636\"],\n        // [\"S5637\"],\n        // [\"S5638\"],\n        // [\"S5639\"],\n        // [\"S5640\"],\n        // [\"S5641\"],\n        // [\"S5642\"],\n        // [\"S5643\"],\n        // [\"S5644\"],\n        // [\"S5645\"],\n        // [\"S5646\"],\n        // [\"S5647\"],\n        // [\"S5648\"],\n        // [\"S5649\"],\n        // [\"S5650\"],\n        // [\"S5651\"],\n        // [\"S5652\"],\n        // [\"S5653\"],\n        // [\"S5654\"],\n        // [\"S5655\"],\n        // [\"S5656\"],\n        // [\"S5657\"],\n        // [\"S5658\"],\n        [\"S5659\"] = \"VULNERABILITY\",\n        // [\"S5660\"],\n        // [\"S5661\"],\n        // [\"S5662\"],\n        // [\"S5663\"],\n        // [\"S5664\"],\n        // [\"S5665\"],\n        // [\"S5666\"],\n        // [\"S5667\"],\n        // [\"S5668\"],\n        // [\"S5669\"],\n        // [\"S5670\"],\n        // [\"S5671\"],\n        // [\"S5672\"],\n        // [\"S5673\"],\n        // [\"S5674\"],\n        // [\"S5675\"],\n        // [\"S5676\"],\n        // [\"S5677\"],\n        // [\"S5678\"],\n        // [\"S5679\"],\n        // [\"S5680\"],\n        // [\"S5681\"],\n        // [\"S5682\"],\n        // [\"S5683\"],\n        // [\"S5684\"],\n        // [\"S5685\"],\n        // [\"S5686\"],\n        // [\"S5687\"],\n        // [\"S5688\"],\n        // [\"S5689\"],\n        // [\"S5690\"],\n        // [\"S5691\"],\n        // [\"S5692\"],\n        [\"S5693\"] = \"SECURITY_HOTSPOT\",\n        // [\"S5694\"],\n        // [\"S5695\"],\n        // [\"S5696\"],\n        // [\"S5697\"],\n        // [\"S5698\"],\n        // [\"S5699\"],\n        // [\"S5700\"],\n        // [\"S5701\"],\n        // [\"S5702\"],\n        // [\"S5703\"],\n        // [\"S5704\"],\n        // [\"S5705\"],\n        // [\"S5706\"],\n        // [\"S5707\"],\n        // [\"S5708\"],\n        // [\"S5709\"],\n        // [\"S5710\"],\n        // [\"S5711\"],\n        // [\"S5712\"],\n        // [\"S5713\"],\n        // [\"S5714\"],\n        // [\"S5715\"],\n        // [\"S5716\"],\n        // [\"S5717\"],\n        // [\"S5718\"],\n        // [\"S5719\"],\n        // [\"S5720\"],\n        // [\"S5721\"],\n        // [\"S5722\"],\n        // [\"S5723\"],\n        // [\"S5724\"],\n        // [\"S5725\"],\n        // [\"S5726\"],\n        // [\"S5727\"],\n        // [\"S5728\"],\n        // [\"S5729\"],\n        // [\"S5730\"],\n        // [\"S5731\"],\n        // [\"S5732\"],\n        // [\"S5733\"],\n        // [\"S5734\"],\n        // [\"S5735\"],\n        // [\"S5736\"],\n        // [\"S5737\"],\n        // [\"S5738\"],\n        // [\"S5739\"],\n        // [\"S5740\"],\n        // [\"S5741\"],\n        // [\"S5742\"],\n        // [\"S5743\"],\n        // [\"S5744\"],\n        // [\"S5745\"],\n        // [\"S5746\"],\n        // [\"S5747\"],\n        // [\"S5748\"],\n        // [\"S5749\"],\n        // [\"S5750\"],\n        // [\"S5751\"],\n        // [\"S5752\"],\n        [\"S5753\"] = \"SECURITY_HOTSPOT\",\n        // [\"S5754\"],\n        // [\"S5755\"],\n        // [\"S5756\"],\n        // [\"S5757\"],\n        // [\"S5758\"],\n        // [\"S5759\"],\n        // [\"S5760\"],\n        // [\"S5761\"],\n        // [\"S5762\"],\n        // [\"S5763\"],\n        // [\"S5764\"],\n        // [\"S5765\"],\n        [\"S5766\"] = \"SECURITY_HOTSPOT\",\n        // [\"S5767\"],\n        // [\"S5768\"],\n        // [\"S5769\"],\n        // [\"S5770\"],\n        // [\"S5771\"],\n        // [\"S5772\"],\n        [\"S5773\"] = \"VULNERABILITY\",\n        // [\"S5774\"],\n        // [\"S5775\"],\n        // [\"S5776\"],\n        // [\"S5777\"],\n        // [\"S5778\"],\n        // [\"S5779\"],\n        // [\"S5780\"],\n        // [\"S5781\"],\n        // [\"S5782\"],\n        // [\"S5783\"],\n        // [\"S5784\"],\n        // [\"S5785\"],\n        // [\"S5786\"],\n        // [\"S5787\"],\n        // [\"S5788\"],\n        // [\"S5789\"],\n        // [\"S5790\"],\n        // [\"S5791\"],\n        // [\"S5792\"],\n        // [\"S5793\"],\n        // [\"S5794\"],\n        // [\"S5795\"],\n        // [\"S5796\"],\n        // [\"S5797\"],\n        // [\"S5798\"],\n        // [\"S5799\"],\n        // [\"S5800\"],\n        // [\"S5801\"],\n        // [\"S5802\"],\n        // [\"S5803\"],\n        // [\"S5804\"],\n        // [\"S5805\"],\n        // [\"S5806\"],\n        // [\"S5807\"],\n        // [\"S5808\"],\n        // [\"S5809\"],\n        // [\"S5810\"],\n        // [\"S5811\"],\n        // [\"S5812\"],\n        // [\"S5813\"],\n        // [\"S5814\"],\n        // [\"S5815\"],\n        // [\"S5816\"],\n        // [\"S5817\"],\n        // [\"S5818\"],\n        // [\"S5819\"],\n        // [\"S5820\"],\n        // [\"S5821\"],\n        // [\"S5822\"],\n        // [\"S5823\"],\n        // [\"S5824\"],\n        // [\"S5825\"],\n        // [\"S5826\"],\n        // [\"S5827\"],\n        // [\"S5828\"],\n        // [\"S5829\"],\n        // [\"S5830\"],\n        // [\"S5831\"],\n        // [\"S5832\"],\n        // [\"S5833\"],\n        // [\"S5834\"],\n        // [\"S5835\"],\n        // [\"S5836\"],\n        // [\"S5837\"],\n        // [\"S5838\"],\n        // [\"S5839\"],\n        // [\"S5840\"],\n        // [\"S5841\"],\n        // [\"S5842\"],\n        // [\"S5843\"],\n        // [\"S5844\"],\n        // [\"S5845\"],\n        // [\"S5846\"],\n        // [\"S5847\"],\n        // [\"S5848\"],\n        // [\"S5849\"],\n        // [\"S5850\"],\n        // [\"S5851\"],\n        // [\"S5852\"],\n        // [\"S5853\"],\n        // [\"S5854\"],\n        // [\"S5855\"],\n        [\"S5856\"] = \"BUG\",\n        // [\"S5857\"],\n        // [\"S5858\"],\n        // [\"S5859\"],\n        // [\"S5860\"],\n        // [\"S5861\"],\n        // [\"S5862\"],\n        // [\"S5863\"],\n        // [\"S5864\"],\n        // [\"S5865\"],\n        // [\"S5866\"],\n        // [\"S5867\"],\n        // [\"S5868\"],\n        // [\"S5869\"],\n        // [\"S5870\"],\n        // [\"S5871\"],\n        // [\"S5872\"],\n        // [\"S5873\"],\n        // [\"S5874\"],\n        // [\"S5875\"],\n        // [\"S5876\"],\n        // [\"S5877\"],\n        // [\"S5878\"],\n        // [\"S5879\"],\n        // [\"S5880\"],\n        // [\"S5881\"],\n        // [\"S5882\"],\n        // [\"S5883\"],\n        // [\"S5884\"],\n        // [\"S5885\"],\n        // [\"S5886\"],\n        // [\"S5887\"],\n        // [\"S5888\"],\n        // [\"S5889\"],\n        // [\"S5890\"],\n        // [\"S5891\"],\n        // [\"S5892\"],\n        // [\"S5893\"],\n        // [\"S5894\"],\n        // [\"S5895\"],\n        // [\"S5896\"],\n        // [\"S5897\"],\n        // [\"S5898\"],\n        // [\"S5899\"],\n        // [\"S5900\"],\n        // [\"S5901\"],\n        // [\"S5902\"],\n        // [\"S5903\"],\n        // [\"S5904\"],\n        // [\"S5905\"],\n        // [\"S5906\"],\n        // [\"S5907\"],\n        // [\"S5908\"],\n        // [\"S5909\"],\n        // [\"S5910\"],\n        // [\"S5911\"],\n        // [\"S5912\"],\n        // [\"S5913\"],\n        // [\"S5914\"],\n        // [\"S5915\"],\n        // [\"S5916\"],\n        // [\"S5917\"],\n        // [\"S5918\"],\n        // [\"S5919\"],\n        // [\"S5920\"],\n        // [\"S5921\"],\n        // [\"S5922\"],\n        // [\"S5923\"],\n        // [\"S5924\"],\n        // [\"S5925\"],\n        // [\"S5926\"],\n        // [\"S5927\"],\n        // [\"S5928\"],\n        // [\"S5929\"],\n        // [\"S5930\"],\n        // [\"S5931\"],\n        // [\"S5932\"],\n        // [\"S5933\"],\n        // [\"S5934\"],\n        // [\"S5935\"],\n        // [\"S5936\"],\n        // [\"S5937\"],\n        // [\"S5938\"],\n        // [\"S5939\"],\n        // [\"S5940\"],\n        // [\"S5941\"],\n        // [\"S5942\"],\n        // [\"S5943\"],\n        // [\"S5944\"],\n        // [\"S5945\"],\n        // [\"S5946\"],\n        // [\"S5947\"],\n        // [\"S5948\"],\n        // [\"S5949\"],\n        // [\"S5950\"],\n        // [\"S5951\"],\n        // [\"S5952\"],\n        // [\"S5953\"],\n        // [\"S5954\"],\n        // [\"S5955\"],\n        // [\"S5956\"],\n        // [\"S5957\"],\n        // [\"S5958\"],\n        // [\"S5959\"],\n        // [\"S5960\"],\n        // [\"S5961\"],\n        // [\"S5962\"],\n        // [\"S5963\"],\n        // [\"S5964\"],\n        // [\"S5965\"],\n        // [\"S5966\"],\n        // [\"S5967\"],\n        // [\"S5968\"],\n        // [\"S5969\"],\n        // [\"S5970\"],\n        // [\"S5971\"],\n        // [\"S5972\"],\n        // [\"S5973\"],\n        // [\"S5974\"],\n        // [\"S5975\"],\n        // [\"S5976\"],\n        // [\"S5977\"],\n        // [\"S5978\"],\n        // [\"S5979\"],\n        // [\"S5980\"],\n        // [\"S5981\"],\n        // [\"S5982\"],\n        // [\"S5983\"],\n        // [\"S5984\"],\n        // [\"S5985\"],\n        // [\"S5986\"],\n        // [\"S5987\"],\n        // [\"S5988\"],\n        // [\"S5989\"],\n        // [\"S5990\"],\n        // [\"S5991\"],\n        // [\"S5992\"],\n        // [\"S5993\"],\n        // [\"S5994\"],\n        // [\"S5995\"],\n        // [\"S5996\"],\n        // [\"S5997\"],\n        // [\"S5998\"],\n        // [\"S5999\"],\n        // [\"S6000\"],\n        // [\"S6001\"],\n        // [\"S6002\"],\n        // [\"S6003\"],\n        // [\"S6004\"],\n        // [\"S6005\"],\n        // [\"S6006\"],\n        // [\"S6007\"],\n        // [\"S6008\"],\n        // [\"S6009\"],\n        // [\"S6010\"],\n        // [\"S6011\"],\n        // [\"S6012\"],\n        // [\"S6013\"],\n        // [\"S6014\"],\n        // [\"S6015\"],\n        // [\"S6016\"],\n        // [\"S6017\"],\n        // [\"S6018\"],\n        // [\"S6019\"],\n        // [\"S6020\"],\n        // [\"S6021\"],\n        // [\"S6022\"],\n        // [\"S6023\"],\n        // [\"S6024\"],\n        // [\"S6025\"],\n        // [\"S6026\"],\n        // [\"S6027\"],\n        // [\"S6028\"],\n        // [\"S6029\"],\n        // [\"S6030\"],\n        // [\"S6031\"],\n        // [\"S6032\"],\n        // [\"S6033\"],\n        // [\"S6034\"],\n        // [\"S6035\"],\n        // [\"S6036\"],\n        // [\"S6037\"],\n        // [\"S6038\"],\n        // [\"S6039\"],\n        // [\"S6040\"],\n        // [\"S6041\"],\n        // [\"S6042\"],\n        // [\"S6043\"],\n        // [\"S6044\"],\n        // [\"S6045\"],\n        // [\"S6046\"],\n        // [\"S6047\"],\n        // [\"S6048\"],\n        // [\"S6049\"],\n        // [\"S6050\"],\n        // [\"S6051\"],\n        // [\"S6052\"],\n        // [\"S6053\"],\n        // [\"S6054\"],\n        // [\"S6055\"],\n        // [\"S6056\"],\n        // [\"S6057\"],\n        // [\"S6058\"],\n        // [\"S6059\"],\n        // [\"S6060\"],\n        // [\"S6061\"],\n        // [\"S6062\"],\n        // [\"S6063\"],\n        // [\"S6064\"],\n        // [\"S6065\"],\n        // [\"S6066\"],\n        // [\"S6067\"],\n        // [\"S6068\"],\n        // [\"S6069\"],\n        // [\"S6070\"],\n        // [\"S6071\"],\n        // [\"S6072\"],\n        // [\"S6073\"],\n        // [\"S6074\"],\n        // [\"S6075\"],\n        // [\"S6076\"],\n        // [\"S6077\"],\n        // [\"S6078\"],\n        // [\"S6079\"],\n        // [\"S6080\"],\n        // [\"S6081\"],\n        // [\"S6082\"],\n        // [\"S6083\"],\n        // [\"S6084\"],\n        // [\"S6085\"],\n        // [\"S6086\"],\n        // [\"S6087\"],\n        // [\"S6088\"],\n        // [\"S6089\"],\n        // [\"S6090\"],\n        // [\"S6091\"],\n        // [\"S6092\"],\n        // [\"S6093\"],\n        // [\"S6094\"],\n        // [\"S6095\"],\n        // [\"S6096\"],\n        // [\"S6097\"],\n        // [\"S6098\"],\n        // [\"S6099\"],\n        // [\"S6100\"],\n        // [\"S6101\"],\n        // [\"S6102\"],\n        // [\"S6103\"],\n        // [\"S6104\"],\n        // [\"S6105\"],\n        // [\"S6106\"],\n        // [\"S6107\"],\n        // [\"S6108\"],\n        // [\"S6109\"],\n        // [\"S6110\"],\n        // [\"S6111\"],\n        // [\"S6112\"],\n        // [\"S6113\"],\n        // [\"S6114\"],\n        // [\"S6115\"],\n        // [\"S6116\"],\n        // [\"S6117\"],\n        // [\"S6118\"],\n        // [\"S6119\"],\n        // [\"S6120\"],\n        // [\"S6121\"],\n        // [\"S6122\"],\n        // [\"S6123\"],\n        // [\"S6124\"],\n        // [\"S6125\"],\n        // [\"S6126\"],\n        // [\"S6127\"],\n        // [\"S6128\"],\n        // [\"S6129\"],\n        // [\"S6130\"],\n        // [\"S6131\"],\n        // [\"S6132\"],\n        // [\"S6133\"],\n        // [\"S6134\"],\n        // [\"S6135\"],\n        // [\"S6136\"],\n        // [\"S6137\"],\n        // [\"S6138\"],\n        // [\"S6139\"],\n        // [\"S6140\"],\n        // [\"S6141\"],\n        // [\"S6142\"],\n        // [\"S6143\"],\n        // [\"S6144\"],\n        // [\"S6145\"],\n        // [\"S6146\"],\n        // [\"S6147\"],\n        // [\"S6148\"],\n        // [\"S6149\"],\n        // [\"S6150\"],\n        // [\"S6151\"],\n        // [\"S6152\"],\n        // [\"S6153\"],\n        // [\"S6154\"],\n        // [\"S6155\"],\n        // [\"S6156\"],\n        // [\"S6157\"],\n        // [\"S6158\"],\n        // [\"S6159\"],\n        // [\"S6160\"],\n        // [\"S6161\"],\n        // [\"S6162\"],\n        // [\"S6163\"],\n        // [\"S6164\"],\n        // [\"S6165\"],\n        // [\"S6166\"],\n        // [\"S6167\"],\n        // [\"S6168\"],\n        // [\"S6169\"],\n        // [\"S6170\"],\n        // [\"S6171\"],\n        // [\"S6172\"],\n        // [\"S6173\"],\n        // [\"S6174\"],\n        // [\"S6175\"],\n        // [\"S6176\"],\n        // [\"S6177\"],\n        // [\"S6178\"],\n        // [\"S6179\"],\n        // [\"S6180\"],\n        // [\"S6181\"],\n        // [\"S6182\"],\n        // [\"S6183\"],\n        // [\"S6184\"],\n        // [\"S6185\"],\n        // [\"S6186\"],\n        // [\"S6187\"],\n        // [\"S6188\"],\n        // [\"S6189\"],\n        // [\"S6190\"],\n        // [\"S6191\"],\n        // [\"S6192\"],\n        // [\"S6193\"],\n        // [\"S6194\"],\n        // [\"S6195\"],\n        // [\"S6196\"],\n        // [\"S6197\"],\n        // [\"S6198\"],\n        // [\"S6199\"],\n        // [\"S6200\"],\n        // [\"S6201\"],\n        // [\"S6202\"],\n        // [\"S6203\"],\n        // [\"S6204\"],\n        // [\"S6205\"],\n        // [\"S6206\"],\n        // [\"S6207\"],\n        // [\"S6208\"],\n        // [\"S6209\"],\n        // [\"S6210\"],\n        // [\"S6211\"],\n        // [\"S6212\"],\n        // [\"S6213\"],\n        // [\"S6214\"],\n        // [\"S6215\"],\n        // [\"S6216\"],\n        // [\"S6217\"],\n        // [\"S6218\"],\n        // [\"S6219\"],\n        // [\"S6220\"],\n        // [\"S6221\"],\n        // [\"S6222\"],\n        // [\"S6223\"],\n        // [\"S6224\"],\n        // [\"S6225\"],\n        // [\"S6226\"],\n        // [\"S6227\"],\n        // [\"S6228\"],\n        // [\"S6229\"],\n        // [\"S6230\"],\n        // [\"S6231\"],\n        // [\"S6232\"],\n        // [\"S6233\"],\n        // [\"S6234\"],\n        // [\"S6235\"],\n        // [\"S6236\"],\n        // [\"S6237\"],\n        // [\"S6238\"],\n        // [\"S6239\"],\n        // [\"S6240\"],\n        // [\"S6241\"],\n        // [\"S6242\"],\n        // [\"S6243\"],\n        // [\"S6244\"],\n        // [\"S6245\"],\n        // [\"S6246\"],\n        // [\"S6247\"],\n        // [\"S6248\"],\n        // [\"S6249\"],\n        // [\"S6250\"],\n        // [\"S6251\"],\n        // [\"S6252\"],\n        // [\"S6253\"],\n        // [\"S6254\"],\n        // [\"S6255\"],\n        // [\"S6256\"],\n        // [\"S6257\"],\n        // [\"S6258\"],\n        // [\"S6259\"],\n        // [\"S6260\"],\n        // [\"S6261\"],\n        // [\"S6262\"],\n        // [\"S6263\"],\n        // [\"S6264\"],\n        // [\"S6265\"],\n        // [\"S6266\"],\n        // [\"S6267\"],\n        // [\"S6268\"],\n        // [\"S6269\"],\n        // [\"S6270\"],\n        // [\"S6271\"],\n        // [\"S6272\"],\n        // [\"S6273\"],\n        // [\"S6274\"],\n        // [\"S6275\"],\n        // [\"S6276\"],\n        // [\"S6277\"],\n        // [\"S6278\"],\n        // [\"S6279\"],\n        // [\"S6280\"],\n        // [\"S6281\"],\n        // [\"S6282\"],\n        // [\"S6283\"],\n        // [\"S6284\"],\n        // [\"S6285\"],\n        // [\"S6286\"],\n        // [\"S6287\"],\n        // [\"S6288\"],\n        // [\"S6289\"],\n        // [\"S6290\"],\n        // [\"S6291\"],\n        // [\"S6292\"],\n        // [\"S6293\"],\n        // [\"S6294\"],\n        // [\"S6295\"],\n        // [\"S6296\"],\n        // [\"S6297\"],\n        // [\"S6298\"],\n        // [\"S6299\"],\n        // [\"S6300\"],\n        // [\"S6301\"],\n        // [\"S6302\"],\n        // [\"S6303\"],\n        // [\"S6304\"],\n        // [\"S6305\"],\n        // [\"S6306\"],\n        // [\"S6307\"],\n        // [\"S6308\"],\n        // [\"S6309\"],\n        // [\"S6310\"],\n        // [\"S6311\"],\n        // [\"S6312\"],\n        // [\"S6313\"],\n        // [\"S6314\"],\n        // [\"S6315\"],\n        // [\"S6316\"],\n        // [\"S6317\"],\n        // [\"S6318\"],\n        // [\"S6319\"],\n        // [\"S6320\"],\n        // [\"S6321\"],\n        // [\"S6322\"],\n        // [\"S6323\"],\n        // [\"S6324\"],\n        // [\"S6325\"],\n        // [\"S6326\"],\n        // [\"S6327\"],\n        // [\"S6328\"],\n        // [\"S6329\"],\n        // [\"S6330\"],\n        // [\"S6331\"],\n        // [\"S6332\"],\n        // [\"S6333\"],\n        // [\"S6334\"],\n        // [\"S6335\"],\n        // [\"S6336\"],\n        // [\"S6337\"],\n        // [\"S6338\"],\n        // [\"S6339\"],\n        // [\"S6340\"],\n        // [\"S6341\"],\n        // [\"S6342\"],\n        // [\"S6343\"],\n        // [\"S6344\"],\n        // [\"S6345\"],\n        // [\"S6346\"],\n        // [\"S6347\"],\n        // [\"S6348\"],\n        // [\"S6349\"],\n        // [\"S6350\"],\n        // [\"S6351\"],\n        // [\"S6352\"],\n        // [\"S6353\"],\n        [\"S6354\"] = \"CODE_SMELL\",\n        // [\"S6355\"],\n        // [\"S6356\"],\n        // [\"S6357\"],\n        // [\"S6358\"],\n        // [\"S6359\"],\n        // [\"S6360\"],\n        // [\"S6361\"],\n        // [\"S6362\"],\n        // [\"S6363\"],\n        // [\"S6364\"],\n        // [\"S6365\"],\n        // [\"S6366\"],\n        // [\"S6367\"],\n        // [\"S6368\"],\n        // [\"S6369\"],\n        // [\"S6370\"],\n        // [\"S6371\"],\n        // [\"S6372\"],\n        // [\"S6373\"],\n        // [\"S6374\"],\n        // [\"S6375\"],\n        // [\"S6376\"],\n        [\"S6377\"] = \"VULNERABILITY\",\n        // [\"S6378\"],\n        // [\"S6379\"],\n        // [\"S6380\"],\n        // [\"S6381\"],\n        // [\"S6382\"],\n        // [\"S6383\"],\n        // [\"S6384\"],\n        // [\"S6385\"],\n        // [\"S6386\"],\n        // [\"S6387\"],\n        // [\"S6388\"],\n        // [\"S6389\"],\n        // [\"S6390\"],\n        // [\"S6391\"],\n        // [\"S6392\"],\n        // [\"S6393\"],\n        // [\"S6394\"],\n        // [\"S6395\"],\n        // [\"S6396\"],\n        // [\"S6397\"],\n        // [\"S6398\"],\n        // [\"S6399\"],\n        // [\"S6400\"],\n        // [\"S6401\"],\n        // [\"S6402\"],\n        // [\"S6403\"],\n        // [\"S6404\"],\n        // [\"S6405\"],\n        // [\"S6406\"],\n        // [\"S6407\"],\n        // [\"S6408\"],\n        // [\"S6409\"],\n        // [\"S6410\"],\n        // [\"S6411\"],\n        // [\"S6412\"],\n        // [\"S6413\"],\n        // [\"S6414\"],\n        // [\"S6415\"],\n        // [\"S6416\"],\n        // [\"S6417\"],\n        [\"S6418\"] = \"VULNERABILITY\",\n        [\"S6419\"] = \"CODE_SMELL\",\n        [\"S6420\"] = \"CODE_SMELL\",\n        [\"S6421\"] = \"CODE_SMELL\",\n        [\"S6422\"] = \"CODE_SMELL\",\n        [\"S6423\"] = \"CODE_SMELL\",\n        [\"S6424\"] = \"CODE_SMELL\",\n        // [\"S6425\"],\n        // [\"S6426\"],\n        // [\"S6427\"],\n        // [\"S6428\"],\n        // [\"S6429\"],\n        // [\"S6430\"],\n        // [\"S6431\"],\n        // [\"S6432\"],\n        // [\"S6433\"],\n        // [\"S6434\"],\n        // [\"S6435\"],\n        // [\"S6436\"],\n        // [\"S6437\"],\n        // [\"S6438\"],\n        // [\"S6439\"],\n        // [\"S6440\"],\n        // [\"S6441\"],\n        // [\"S6442\"],\n        // [\"S6443\"],\n        [\"S6444\"] = \"SECURITY_HOTSPOT\",\n        // [\"S6445\"],\n        // [\"S6446\"],\n        // [\"S6447\"],\n        // [\"S6448\"],\n        // [\"S6449\"],\n        // [\"S6450\"],\n        // [\"S6451\"],\n        // [\"S6452\"],\n        // [\"S6453\"],\n        // [\"S6454\"],\n        // [\"S6455\"],\n        // [\"S6456\"],\n        // [\"S6457\"],\n        // [\"S6458\"],\n        // [\"S6459\"],\n        // [\"S6460\"],\n        // [\"S6461\"],\n        // [\"S6462\"],\n        // [\"S6463\"],\n        // [\"S6464\"],\n        // [\"S6465\"],\n        // [\"S6466\"],\n        // [\"S6467\"],\n        // [\"S6468\"],\n        // [\"S6469\"],\n        // [\"S6470\"],\n        // [\"S6471\"],\n        // [\"S6472\"],\n        // [\"S6473\"],\n        // [\"S6474\"],\n        // [\"S6475\"],\n        // [\"S6476\"],\n        // [\"S6477\"],\n        // [\"S6478\"],\n        // [\"S6479\"],\n        // [\"S6480\"],\n        // [\"S6481\"],\n        // [\"S6482\"],\n        // [\"S6483\"],\n        // [\"S6484\"],\n        // [\"S6485\"],\n        // [\"S6486\"],\n        // [\"S6487\"],\n        // [\"S6488\"],\n        // [\"S6489\"],\n        // [\"S6490\"],\n        // [\"S6491\"],\n        // [\"S6492\"],\n        // [\"S6493\"],\n        // [\"S6494\"],\n        // [\"S6495\"],\n        // [\"S6496\"],\n        // [\"S6497\"],\n        // [\"S6498\"],\n        // [\"S6499\"],\n        // [\"S6500\"],\n        // [\"S6501\"],\n        // [\"S6502\"],\n        // [\"S6503\"],\n        // [\"S6504\"],\n        // [\"S6505\"],\n        // [\"S6506\"],\n        [\"S6507\"] = \"BUG\",\n        // [\"S6508\"],\n        // [\"S6509\"],\n        // [\"S6510\"],\n        // [\"S6511\"],\n        // [\"S6512\"],\n        [\"S6513\"] = \"CODE_SMELL\",\n        // [\"S6514\"],\n        // [\"S6515\"],\n        // [\"S6516\"],\n        // [\"S6517\"],\n        // [\"S6518\"],\n        // [\"S6519\"],\n        // [\"S6520\"],\n        // [\"S6521\"],\n        // [\"S6522\"],\n        // [\"S6523\"],\n        // [\"S6524\"],\n        // [\"S6525\"],\n        // [\"S6526\"],\n        // [\"S6527\"],\n        // [\"S6528\"],\n        // [\"S6529\"],\n        // [\"S6530\"],\n        // [\"S6531\"],\n        // [\"S6532\"],\n        // [\"S6533\"],\n        // [\"S6534\"],\n        // [\"S6535\"],\n        // [\"S6536\"],\n        // [\"S6537\"],\n        // [\"S6538\"],\n        // [\"S6539\"],\n        // [\"S6540\"],\n        // [\"S6541\"],\n        // [\"S6542\"],\n        // [\"S6543\"],\n        // [\"S6544\"],\n        // [\"S6545\"],\n        // [\"S6546\"],\n        // [\"S6547\"],\n        // [\"S6548\"],\n        // [\"S6549\"],\n        // [\"S6550\"],\n        // [\"S6551\"],\n        // [\"S6552\"],\n        // [\"S6553\"],\n        // [\"S6554\"],\n        // [\"S6555\"],\n        // [\"S6556\"],\n        // [\"S6557\"],\n        // [\"S6558\"],\n        // [\"S6559\"],\n        // [\"S6560\"],\n        [\"S6561\"] = \"CODE_SMELL\",\n        [\"S6562\"] = \"CODE_SMELL\",\n        [\"S6563\"] = \"CODE_SMELL\",\n        // [\"S6564\"],\n        // [\"S6565\"],\n        [\"S6566\"] = \"CODE_SMELL\",\n        // [\"S6567\"],\n        // [\"S6568\"],\n        // [\"S6569\"],\n        // [\"S6570\"],\n        // [\"S6571\"],\n        // [\"S6572\"],\n        // [\"S6573\"],\n        // [\"S6574\"],\n        [\"S6575\"] = \"CODE_SMELL\",\n        // [\"S6576\"],\n        // [\"S6577\"],\n        // [\"S6578\"],\n        // [\"S6579\"],\n        [\"S6580\"] = \"CODE_SMELL\",\n        // [\"S6581\"],\n        // [\"S6582\"],\n        // [\"S6583\"],\n        // [\"S6584\"],\n        [\"S6585\"] = \"CODE_SMELL\",\n        // [\"S6586\"],\n        // [\"S6587\"],\n        [\"S6588\"] = \"CODE_SMELL\",\n        // [\"S6589\"],\n        // [\"S6590\"],\n        // [\"S6591\"],\n        // [\"S6592\"],\n        // [\"S6593\"],\n        // [\"S6594\"],\n        // [\"S6595\"],\n        // [\"S6596\"],\n        // [\"S6597\"],\n        // [\"S6598\"],\n        // [\"S6599\"],\n        // [\"S6600\"],\n        // [\"S6601\"],\n        [\"S6602\"] = \"CODE_SMELL\",\n        [\"S6603\"] = \"CODE_SMELL\",\n        // [\"S6604\"],\n        [\"S6605\"] = \"CODE_SMELL\",\n        // [\"S6606\"],\n        [\"S6607\"] = \"CODE_SMELL\",\n        [\"S6608\"] = \"CODE_SMELL\",\n        [\"S6609\"] = \"CODE_SMELL\",\n        [\"S6610\"] = \"CODE_SMELL\",\n        // [\"S6611\"],\n        [\"S6612\"] = \"CODE_SMELL\",\n        [\"S6613\"] = \"CODE_SMELL\",\n        // [\"S6614\"],\n        // [\"S6615\"],\n        // [\"S6616\"],\n        [\"S6617\"] = \"CODE_SMELL\",\n        [\"S6618\"] = \"CODE_SMELL\",\n        // [\"S6619\"],\n        // [\"S6620\"],\n        // [\"S6621\"],\n        // [\"S6622\"],\n        // [\"S6623\"],\n        // [\"S6624\"],\n        // [\"S6625\"],\n        // [\"S6626\"],\n        // [\"S6627\"],\n        // [\"S6628\"],\n        // [\"S6629\"],\n        // [\"S6630\"],\n        // [\"S6631\"],\n        // [\"S6632\"],\n        // [\"S6633\"],\n        // [\"S6634\"],\n        // [\"S6635\"],\n        // [\"S6636\"],\n        // [\"S6637\"],\n        // [\"S6638\"],\n        // [\"S6639\"],\n        [\"S6640\"] = \"SECURITY_HOTSPOT\",\n        // [\"S6641\"],\n        // [\"S6642\"],\n        // [\"S6643\"],\n        // [\"S6644\"],\n        // [\"S6645\"],\n        // [\"S6646\"],\n        // [\"S6647\"],\n        // [\"S6648\"],\n        // [\"S6649\"],\n        // [\"S6650\"],\n        // [\"S6651\"],\n        // [\"S6652\"],\n        // [\"S6653\"],\n        // [\"S6654\"],\n        // [\"S6655\"],\n        // [\"S6656\"],\n        // [\"S6657\"],\n        // [\"S6658\"],\n        // [\"S6659\"],\n        // [\"S6660\"],\n        // [\"S6661\"],\n        // [\"S6662\"],\n        // [\"S6663\"],\n        [\"S6664\"] = \"CODE_SMELL\",\n        // [\"S6665\"],\n        // [\"S6666\"],\n        [\"S6667\"] = \"CODE_SMELL\",\n        [\"S6668\"] = \"CODE_SMELL\",\n        [\"S6670\"] = \"CODE_SMELL\",\n        [\"S6669\"] = \"CODE_SMELL\",\n        // [\"S6671\"],\n        [\"S6672\"] = \"CODE_SMELL\",\n        [\"S6673\"] = \"CODE_SMELL\",\n        [\"S6674\"] = \"BUG\",\n        [\"S6675\"] = \"CODE_SMELL\",\n        // [\"S6676\"],\n        [\"S6677\"] = \"BUG\",\n        [\"S6678\"] = \"CODE_SMELL\",\n        // [\"S6679\"],\n        // [\"S6680\"],\n        // [\"S6681\"],\n        // [\"S6682\"],\n        // [\"S6683\"],\n        // [\"S6684\"],\n        // [\"S6685\"],\n        // [\"S6686\"],\n        // [\"S6687\"],\n        // [\"S6688\"],\n        // [\"S6689\"],\n        // [\"S6690\"],\n        // [\"S6691\"],\n        // [\"S6692\"],\n        // [\"S6693\"],\n        // [\"S6694\"],\n        // [\"S6695\"],\n        // [\"S6696\"],\n        // [\"S6697\"],\n        // [\"S6698\"],\n        // [\"S6699\"],\n        // [\"S6700\"],\n        // [\"S6701\"],\n        // [\"S6702\"],\n        // [\"S6703\"],\n        // [\"S6704\"],\n        // [\"S6705\"],\n        // [\"S6706\"],\n        // [\"S6707\"],\n        // [\"S6708\"],\n        // [\"S6709\"],\n        // [\"S6710\"],\n        // [\"S6711\"],\n        // [\"S6712\"],\n        // [\"S6713\"],\n        // [\"S6714\"],\n        // [\"S6715\"],\n        // [\"S6716\"],\n        // [\"S6717\"],\n        // [\"S6718\"],\n        // [\"S6719\"],\n        // [\"S6720\"],\n        // [\"S6721\"],\n        // [\"S6722\"],\n        // [\"S6723\"],\n        // [\"S6724\"],\n        // [\"S6725\"],\n        // [\"S6726\"],\n        // [\"S6727\"],\n        // [\"S6728\"],\n        // [\"S6729\"],\n        // [\"S6730\"],\n        // [\"S6731\"],\n        // [\"S6732\"],\n        // [\"S6733\"],\n        // [\"S6734\"],\n        // [\"S6735\"],\n        // [\"S6736\"],\n        // [\"S6737\"],\n        // [\"S6738\"],\n        // [\"S6739\"],\n        // [\"S6740\"],\n        // [\"S6741\"],\n        // [\"S6742\"],\n        // [\"S6743\"],\n        // [\"S6744\"],\n        // [\"S6745\"],\n        // [\"S6746\"],\n        // [\"S6747\"],\n        // [\"S6748\"],\n        // [\"S6749\"],\n        // [\"S6750\"],\n        // [\"S6751\"],\n        // [\"S6752\"],\n        // [\"S6753\"],\n        // [\"S6754\"],\n        // [\"S6755\"],\n        // [\"S6756\"],\n        // [\"S6757\"],\n        // [\"S6758\"],\n        // [\"S6759\"],\n        // [\"S6760\"],\n        // [\"S6761\"],\n        // [\"S6762\"],\n        // [\"S6763\"],\n        // [\"S6764\"],\n        // [\"S6765\"],\n        // [\"S6766\"],\n        // [\"S6767\"],\n        // [\"S6768\"],\n        // [\"S6769\"],\n        // [\"S6770\"],\n        // [\"S6771\"],\n        // [\"S6772\"],\n        // [\"S6773\"],\n        // [\"S6774\"],\n        // [\"S6775\"],\n        // [\"S6776\"],\n        // [\"S6777\"],\n        // [\"S6778\"],\n        // [\"S6779\"],\n        // [\"S6780\"],\n        [\"S6781\"] = \"VULNERABILITY\",\n        // [\"S6782\"],\n        // [\"S6783\"],\n        // [\"S6784\"],\n        // [\"S6785\"],\n        // [\"S6786\"],\n        // [\"S6787\"],\n        // [\"S6788\"],\n        // [\"S6789\"],\n        // [\"S6790\"],\n        // [\"S6791\"],\n        // [\"S6792\"],\n        // [\"S6793\"],\n        // [\"S6794\"],\n        // [\"S6795\"],\n        // [\"S6796\"],\n        [\"S6797\"] = \"BUG\",\n        [\"S6798\"] = \"BUG\",\n        // [\"S6799\"],\n        [\"S6800\"] = \"BUG\",\n        // [\"S6801\"],\n        [\"S6802\"] = \"CODE_SMELL\",\n        [\"S6803\"] = \"CODE_SMELL\",\n        // [\"S6804\"],\n        // [\"S6805\"],\n        // [\"S6806\"],\n        // [\"S6807\"],\n        // [\"S6808\"],\n        // [\"S6809\"],\n        // [\"S6810\"],\n        // [\"S6811\"],\n        // [\"S6812\"],\n        // [\"S6813\"],\n        // [\"S6814\"],\n        // [\"S6815\"],\n        // [\"S6816\"],\n        // [\"S6817\"],\n        // [\"S6818\"],\n        // [\"S6819\"],\n        // [\"S6820\"],\n        // [\"S6821\"],\n        // [\"S6822\"],\n        // [\"S6823\"],\n        // [\"S6824\"],\n        // [\"S6825\"],\n        // [\"S6826\"],\n        // [\"S6827\"],\n        // [\"S6828\"],\n        // [\"S6829\"],\n        // [\"S6830\"],\n        // [\"S6831\"],\n        // [\"S6832\"],\n        // [\"S6833\"],\n        // [\"S6834\"],\n        // [\"S6835\"],\n        // [\"S6836\"],\n        // [\"S6837\"],\n        // [\"S6838\"],\n        // [\"S6839\"],\n        // [\"S6840\"],\n        // [\"S6841\"],\n        // [\"S6842\"],\n        // [\"S6843\"],\n        // [\"S6844\"],\n        // [\"S6845\"],\n        // [\"S6846\"],\n        // [\"S6847\"],\n        // [\"S6848\"],\n        // [\"S6849\"],\n        // [\"S6850\"],\n        // [\"S6851\"],\n        // [\"S6852\"],\n        // [\"S6853\"],\n        // [\"S6854\"],\n        // [\"S6855\"],\n        // [\"S6856\"],\n        // [\"S6857\"],\n        // [\"S6858\"],\n        // [\"S6859\"],\n        // [\"S6860\"],\n        // [\"S6861\"],\n        // [\"S6862\"],\n        // [\"S6863\"],\n        // [\"S6864\"],\n        // [\"S6865\"],\n        // [\"S6866\"],\n        // [\"S6867\"],\n        // [\"S6868\"],\n        // [\"S6869\"],\n        // [\"S6870\"],\n        // [\"S6871\"],\n        // [\"S6872\"],\n        // [\"S6873\"],\n        // [\"S6874\"],\n        // [\"S6875\"],\n        // [\"S6876\"],\n        // [\"S6877\"],\n        // [\"S6878\"],\n        // [\"S6879\"],\n        // [\"S6880\"],\n        // [\"S6881\"],\n        // [\"S6882\"],\n        // [\"S6883\"],\n        // [\"S6884\"],\n        // [\"S6885\"],\n        // [\"S6886\"],\n        // [\"S6887\"],\n        // [\"S6888\"],\n        // [\"S6889\"],\n        // [\"S6890\"],\n        // [\"S6891\"],\n        // [\"S6892\"],\n        // [\"S6893\"],\n        // [\"S6894\"],\n        // [\"S6895\"],\n        // [\"S6896\"],\n        // [\"S6897\"],\n        // [\"S6898\"],\n        // [\"S6899\"],\n        // [\"S6900\"],\n        // [\"S6901\"],\n        // [\"S6902\"],\n        // [\"S6903\"],\n        // [\"S6904\"],\n        // [\"S6905\"],\n        // [\"S6906\"],\n        // [\"S6907\"],\n        // [\"S6908\"],\n        // [\"S6909\"],\n        // [\"S6910\"],\n        // [\"S6911\"],\n        // [\"S6912\"],\n        // [\"S6913\"],\n        // [\"S6914\"],\n        // [\"S6915\"],\n        // [\"S6916\"],\n        // [\"S6917\"],\n        // [\"S6918\"],\n        // [\"S6919\"],\n        // [\"S6920\"],\n        // [\"S6921\"],\n        // [\"S6922\"],\n        // [\"S6923\"],\n        // [\"S6924\"],\n        // [\"S6925\"],\n        // [\"S6926\"],\n        // [\"S6927\"],\n        // [\"S6928\"],\n        // [\"S6929\"],\n        [\"S6930\"] = \"BUG\",\n        [\"S6931\"] = \"CODE_SMELL\",\n        [\"S6932\"] = \"CODE_SMELL\",\n        // [\"S6933\"],\n        [\"S6934\"] = \"CODE_SMELL\",\n        // [\"S6935\"],\n        // [\"S6936\"],\n        // [\"S6937\"],\n        // [\"S6938\"],\n        // [\"S6939\"],\n        // [\"S6940\"],\n        // [\"S6941\"],\n        // [\"S6942\"],\n        // [\"S6943\"],\n        // [\"S6944\"],\n        // [\"S6945\"],\n        // [\"S6946\"],\n        // [\"S6947\"],\n        // [\"S6948\"],\n        // [\"S6949\"],\n        // [\"S6950\"],\n        // [\"S6951\"],\n        // [\"S6952\"],\n        // [\"S6953\"],\n        // [\"S6954\"],\n        // [\"S6955\"],\n        // [\"S6956\"],\n        // [\"S6957\"],\n        // [\"S6958\"],\n        // [\"S6959\"],\n        [\"S6960\"] = \"CODE_SMELL\",\n        [\"S6961\"] = \"CODE_SMELL\",\n        [\"S6962\"] = \"CODE_SMELL\",\n        // [\"S6963\"],\n        [\"S6964\"] = \"CODE_SMELL\",\n        [\"S6965\"] = \"CODE_SMELL\",\n        [\"S6966\"] = \"CODE_SMELL\",\n        [\"S6967\"] = \"CODE_SMELL\",\n        [\"S6968\"] = \"CODE_SMELL\",\n        // [\"S6969\"],\n        // [\"S6970\"],\n        // [\"S6971\"],\n        // [\"S6972\"],\n        // [\"S6973\"],\n        // [\"S6974\"],\n        // [\"S6975\"],\n        // [\"S6976\"],\n        // [\"S6977\"],\n        // [\"S6978\"],\n        // [\"S6979\"],\n        // [\"S6980\"],\n        // [\"S6981\"],\n        // [\"S6982\"],\n        // [\"S6983\"],\n        // [\"S6984\"],\n        // [\"S6985\"],\n        // [\"S6986\"],\n        // [\"S6987\"],\n        // [\"S6988\"],\n        // [\"S6989\"],\n        // [\"S6990\"],\n        // [\"S6991\"],\n        // [\"S6992\"],\n        // [\"S6993\"],\n        // [\"S6994\"],\n        // [\"S6995\"],\n        // [\"S6996\"],\n        // [\"S6997\"],\n        // [\"S6998\"],\n        // [\"S6999\"],\n        // [\"S7000\"],\n        // [\"S7001\"],\n        // [\"S7002\"],\n        // [\"S7003\"],\n        // [\"S7004\"],\n        // [\"S7005\"],\n        // [\"S7006\"],\n        // [\"S7007\"],\n        // [\"S7008\"],\n        // [\"S7009\"],\n        // [\"S7010\"],\n        // [\"S7011\"],\n        // [\"S7012\"],\n        // [\"S7013\"],\n        // [\"S7014\"],\n        // [\"S7015\"],\n        // [\"S7016\"],\n        // [\"S7017\"],\n        // [\"S7018\"],\n        // [\"S7019\"],\n        // [\"S7020\"],\n        // [\"S7021\"],\n        // [\"S7022\"],\n        // [\"S7023\"],\n        // [\"S7024\"],\n        // [\"S7025\"],\n        // [\"S7026\"],\n        // [\"S7027\"],\n        // [\"S7028\"],\n        // [\"S7029\"],\n        // [\"S7030\"],\n        // [\"S7031\"],\n        // [\"S7032\"],\n        // [\"S7033\"],\n        // [\"S7034\"],\n        // [\"S7035\"],\n        // [\"S7036\"],\n        // [\"S7037\"],\n        // [\"S7038\"],\n        [\"S7039\"] = \"VULNERABILITY\",\n        // [\"S7040\"],\n        // [\"S7041\"],\n        // [\"S7042\"],\n        // [\"S7043\"],\n        // [\"S7044\"],\n        // [\"S7045\"],\n        // [\"S7046\"],\n        // [\"S7047\"],\n        // [\"S7048\"],\n        // [\"S7049\"],\n        // [\"S7050\"],\n        // [\"S7051\"],\n        // [\"S7052\"],\n        // [\"S7053\"],\n        // [\"S7054\"],\n        // [\"S7055\"],\n        // [\"S7056\"],\n        // [\"S7057\"],\n        // [\"S7058\"],\n        // [\"S7059\"],\n        // [\"S7060\"],\n        // [\"S7061\"],\n        // [\"S7062\"],\n        // [\"S7063\"],\n        // [\"S7064\"],\n        // [\"S7065\"],\n        // [\"S7066\"],\n        // [\"S7067\"],\n        // [\"S7068\"],\n        // [\"S7069\"],\n        // [\"S7070\"],\n        // [\"S7071\"],\n        // [\"S7072\"],\n        // [\"S7073\"],\n        // [\"S7074\"],\n        // [\"S7075\"],\n        // [\"S7076\"],\n        // [\"S7077\"],\n        // [\"S7078\"],\n        // [\"S7079\"],\n        // [\"S7080\"],\n        // [\"S7081\"],\n        // [\"S7082\"],\n        // [\"S7083\"],\n        // [\"S7084\"],\n        // [\"S7085\"],\n        // [\"S7086\"],\n        // [\"S7087\"],\n        // [\"S7088\"],\n        // [\"S7089\"],\n        // [\"S7090\"],\n        // [\"S7091\"],\n        // [\"S7092\"],\n        // [\"S7093\"],\n        // [\"S7094\"],\n        // [\"S7095\"],\n        // [\"S7096\"],\n        // [\"S7097\"],\n        // [\"S7098\"],\n        // [\"S7099\"],\n        // [\"S7100\"],\n        // [\"S7101\"],\n        // [\"S7102\"],\n        // [\"S7103\"],\n        // [\"S7104\"],\n        // [\"S7105\"],\n        // [\"S7106\"],\n        // [\"S7107\"],\n        // [\"S7108\"],\n        // [\"S7109\"],\n        // [\"S7110\"],\n        // [\"S7111\"],\n        // [\"S7112\"],\n        // [\"S7113\"],\n        // [\"S7114\"],\n        // [\"S7115\"],\n        // [\"S7116\"],\n        // [\"S7117\"],\n        // [\"S7118\"],\n        // [\"S7119\"],\n        // [\"S7120\"],\n        // [\"S7121\"],\n        // [\"S7122\"],\n        // [\"S7123\"],\n        // [\"S7124\"],\n        // [\"S7125\"],\n        // [\"S7126\"],\n        // [\"S7127\"],\n        // [\"S7128\"],\n        // [\"S7129\"],\n        [\"S7130\"] = \"CODE_SMELL\",\n        [\"S7131\"] = \"BUG\",\n        // [\"S7132\"],\n        [\"S7133\"] = \"BUG\",\n        // [\"S7134\"],\n        // [\"S7135\"],\n        // [\"S7136\"],\n        // [\"S7137\"],\n        // [\"S7138\"],\n        // [\"S7139\"],\n        // [\"S7140\"],\n        // [\"S7141\"],\n        // [\"S7142\"],\n        // [\"S7143\"],\n        // [\"S7144\"],\n        // [\"S7145\"],\n        // [\"S7146\"],\n        // [\"S7147\"],\n        // [\"S7148\"],\n        // [\"S7149\"],\n        // [\"S7150\"],\n        // [\"S7151\"],\n        // [\"S7152\"],\n        // [\"S7153\"],\n        // [\"S7154\"],\n        // [\"S7155\"],\n        // [\"S7156\"],\n        // [\"S7157\"],\n        // [\"S7158\"],\n        // [\"S7159\"],\n        // [\"S7160\"],\n        // [\"S7161\"],\n        // [\"S7162\"],\n        // [\"S7163\"],\n        // [\"S7164\"],\n        // [\"S7165\"],\n        // [\"S7166\"],\n        // [\"S7167\"],\n        // [\"S7168\"],\n        // [\"S7169\"],\n        // [\"S7170\"],\n        // [\"S7171\"],\n        // [\"S7172\"],\n        // [\"S7173\"],\n        // [\"S7174\"],\n        // [\"S7175\"],\n        // [\"S7176\"],\n        // [\"S7177\"],\n        // [\"S7178\"],\n        // [\"S7179\"],\n        // [\"S7180\"],\n        // [\"S7181\"],\n        // [\"S7182\"],\n        // [\"S7183\"],\n        // [\"S7184\"],\n        // [\"S7185\"],\n        // [\"S7186\"],\n        // [\"S7187\"],\n        // [\"S7188\"],\n        // [\"S7189\"],\n        // [\"S7190\"],\n        // [\"S7191\"],\n        // [\"S7192\"],\n        // [\"S7193\"],\n        // [\"S7194\"],\n        // [\"S7195\"],\n        // [\"S7196\"],\n        // [\"S7197\"],\n        // [\"S7198\"],\n        // [\"S7199\"],\n        // [\"S7200\"],\n        // [\"S7201\"],\n        // [\"S7202\"],\n        // [\"S7203\"],\n        // [\"S7204\"],\n        // [\"S7205\"],\n        // [\"S7206\"],\n        // [\"S7207\"],\n        // [\"S7208\"],\n        // [\"S7209\"],\n        // [\"S7210\"],\n        // [\"S7211\"],\n        // [\"S7212\"],\n        // [\"S7213\"],\n        // [\"S7214\"],\n        // [\"S7215\"],\n        // [\"S7216\"],\n        // [\"S7217\"],\n        // [\"S7218\"],\n        // [\"S7219\"],\n        // [\"S7220\"],\n        // [\"S7221\"],\n        // [\"S7222\"],\n        // [\"S7223\"],\n        // [\"S7224\"],\n        // [\"S7225\"],\n        // [\"S7226\"],\n        // [\"S7227\"],\n        // [\"S7228\"],\n        // [\"S7229\"],\n        // [\"S7230\"],\n        // [\"S7231\"],\n        // [\"S7232\"],\n        // [\"S7233\"],\n        // [\"S7234\"],\n        // [\"S7235\"],\n        // [\"S7236\"],\n        // [\"S7237\"],\n        // [\"S7238\"],\n        // [\"S7239\"],\n        // [\"S7240\"],\n        // [\"S7241\"],\n        // [\"S7242\"],\n        // [\"S7243\"],\n        // [\"S7244\"],\n        // [\"S7245\"],\n        // [\"S7246\"],\n        // [\"S7247\"],\n        // [\"S7248\"],\n        // [\"S7249\"],\n        // [\"S7250\"],\n        // [\"S7251\"],\n        // [\"S7252\"],\n        // [\"S7253\"],\n        // [\"S7254\"],\n        // [\"S7255\"],\n        // [\"S7256\"],\n        // [\"S7257\"],\n        // [\"S7258\"],\n        // [\"S7259\"],\n        // [\"S7260\"],\n        // [\"S7261\"],\n        // [\"S7262\"],\n        // [\"S7263\"],\n        // [\"S7264\"],\n        // [\"S7265\"],\n        // [\"S7266\"],\n        // [\"S7267\"],\n        // [\"S7268\"],\n        // [\"S7269\"],\n        // [\"S7270\"],\n        // [\"S7271\"],\n        // [\"S7272\"],\n        // [\"S7273\"],\n        // [\"S7274\"],\n        // [\"S7275\"],\n        // [\"S7276\"],\n        // [\"S7277\"],\n        // [\"S7278\"],\n        // [\"S7279\"],\n        // [\"S7280\"],\n        // [\"S7281\"],\n        // [\"S7282\"],\n        // [\"S7283\"],\n        // [\"S7284\"],\n        // [\"S7285\"],\n        // [\"S7286\"],\n        // [\"S7287\"],\n        // [\"S7288\"],\n        // [\"S7289\"],\n        // [\"S7290\"],\n        // [\"S7291\"],\n        // [\"S7292\"],\n        // [\"S7293\"],\n        // [\"S7294\"],\n        // [\"S7295\"],\n        // [\"S7296\"],\n        // [\"S7297\"],\n        // [\"S7298\"],\n        // [\"S7299\"],\n        // [\"S7300\"],\n        // [\"S7301\"],\n        // [\"S7302\"],\n        // [\"S7303\"],\n        // [\"S7304\"],\n        // [\"S7305\"],\n        // [\"S7306\"],\n        // [\"S7307\"],\n        // [\"S7308\"],\n        // [\"S7309\"],\n        // [\"S7310\"],\n        // [\"S7311\"],\n        // [\"S7312\"],\n        // [\"S7313\"],\n        // [\"S7314\"],\n        // [\"S7315\"],\n        // [\"S7316\"],\n        // [\"S7317\"],\n        // [\"S7318\"],\n        // [\"S7319\"],\n        // [\"S7320\"],\n        // [\"S7321\"],\n        // [\"S7322\"],\n        // [\"S7323\"],\n        // [\"S7324\"],\n        // [\"S7325\"],\n        // [\"S7326\"],\n        // [\"S7327\"],\n        // [\"S7328\"],\n        // [\"S7329\"],\n        // [\"S7330\"],\n        // [\"S7331\"],\n        // [\"S7332\"],\n        // [\"S7333\"],\n        // [\"S7334\"],\n        // [\"S7335\"],\n        // [\"S7336\"],\n        // [\"S7337\"],\n        // [\"S7338\"],\n        // [\"S7339\"],\n        // [\"S7340\"],\n        // [\"S7341\"],\n        // [\"S7342\"],\n        // [\"S7343\"],\n        // [\"S7344\"],\n        // [\"S7345\"],\n        // [\"S7346\"],\n        // [\"S7347\"],\n        // [\"S7348\"],\n        // [\"S7349\"],\n        // [\"S7350\"],\n        // [\"S7351\"],\n        // [\"S7352\"],\n        // [\"S7353\"],\n        // [\"S7354\"],\n        // [\"S7355\"],\n        // [\"S7356\"],\n        // [\"S7357\"],\n        // [\"S7358\"],\n        // [\"S7359\"],\n        // [\"S7360\"],\n        // [\"S7361\"],\n        // [\"S7362\"],\n        // [\"S7363\"],\n        // [\"S7364\"],\n        // [\"S7365\"],\n        // [\"S7366\"],\n        // [\"S7367\"],\n        // [\"S7368\"],\n        // [\"S7369\"],\n        // [\"S7370\"],\n        // [\"S7371\"],\n        // [\"S7372\"],\n        // [\"S7373\"],\n        // [\"S7374\"],\n        // [\"S7375\"],\n        // [\"S7376\"],\n        // [\"S7377\"],\n        // [\"S7378\"],\n        // [\"S7379\"],\n        // [\"S7380\"],\n        // [\"S7381\"],\n        // [\"S7382\"],\n        // [\"S7383\"],\n        // [\"S7384\"],\n        // [\"S7385\"],\n        // [\"S7386\"],\n        // [\"S7387\"],\n        // [\"S7388\"],\n        // [\"S7389\"],\n        // [\"S7390\"],\n        // [\"S7391\"],\n        // [\"S7392\"],\n        // [\"S7393\"],\n        // [\"S7394\"],\n        // [\"S7395\"],\n        // [\"S7396\"],\n        // [\"S7397\"],\n        // [\"S7398\"],\n        // [\"S7399\"],\n        // [\"S7400\"],\n        // [\"S7401\"],\n        // [\"S7402\"],\n        // [\"S7403\"],\n        // [\"S7404\"],\n        // [\"S7405\"],\n        // [\"S7406\"],\n        // [\"S7407\"],\n        // [\"S7408\"],\n        // [\"S7409\"],\n        // [\"S7410\"],\n        // [\"S7411\"],\n        // [\"S7412\"],\n        // [\"S7413\"],\n        // [\"S7414\"],\n        // [\"S7415\"],\n        // [\"S7416\"],\n        // [\"S7417\"],\n        // [\"S7418\"],\n        // [\"S7419\"],\n        // [\"S7420\"],\n        // [\"S7421\"],\n        // [\"S7422\"],\n        // [\"S7423\"],\n        // [\"S7424\"],\n        // [\"S7425\"],\n        // [\"S7426\"],\n        // [\"S7427\"],\n        // [\"S7428\"],\n        // [\"S7429\"],\n        // [\"S7430\"],\n        // [\"S7431\"],\n        // [\"S7432\"],\n        // [\"S7433\"],\n        // [\"S7434\"],\n        // [\"S7435\"],\n        // [\"S7436\"],\n        // [\"S7437\"],\n        // [\"S7438\"],\n        // [\"S7439\"],\n        // [\"S7440\"],\n        // [\"S7441\"],\n        // [\"S7442\"],\n        // [\"S7443\"],\n        // [\"S7444\"],\n        // [\"S7445\"],\n        // [\"S7446\"],\n        // [\"S7447\"],\n        // [\"S7448\"],\n        // [\"S7449\"],\n        // [\"S7450\"],\n        // [\"S7451\"],\n        // [\"S7452\"],\n        // [\"S7453\"],\n        // [\"S7454\"],\n        // [\"S7455\"],\n        // [\"S7456\"],\n        // [\"S7457\"],\n        // [\"S7458\"],\n        // [\"S7459\"],\n        // [\"S7460\"],\n        // [\"S7461\"],\n        // [\"S7462\"],\n        // [\"S7463\"],\n        // [\"S7464\"],\n        // [\"S7465\"],\n        // [\"S7466\"],\n        // [\"S7467\"],\n        // [\"S7468\"],\n        // [\"S7469\"],\n        // [\"S7470\"],\n        // [\"S7471\"],\n        // [\"S7472\"],\n        // [\"S7473\"],\n        // [\"S7474\"],\n        // [\"S7475\"],\n        // [\"S7476\"],\n        // [\"S7477\"],\n        // [\"S7478\"],\n        // [\"S7479\"],\n        // [\"S7480\"],\n        // [\"S7481\"],\n        // [\"S7482\"],\n        // [\"S7483\"],\n        // [\"S7484\"],\n        // [\"S7485\"],\n        // [\"S7486\"],\n        // [\"S7487\"],\n        // [\"S7488\"],\n        // [\"S7489\"],\n        // [\"S7490\"],\n        // [\"S7491\"],\n        // [\"S7492\"],\n        // [\"S7493\"],\n        // [\"S7494\"],\n        // [\"S7495\"],\n        // [\"S7496\"],\n        // [\"S7497\"],\n        // [\"S7498\"],\n        // [\"S7499\"],\n        // [\"S7500\"],\n        // [\"S7501\"],\n        // [\"S7502\"],\n        // [\"S7503\"],\n        // [\"S7504\"],\n        // [\"S7505\"],\n        // [\"S7506\"],\n        // [\"S7507\"],\n        // [\"S7508\"],\n        // [\"S7509\"],\n        // [\"S7510\"],\n        // [\"S7511\"],\n        // [\"S7512\"],\n        // [\"S7513\"],\n        // [\"S7514\"],\n        // [\"S7515\"],\n        // [\"S7516\"],\n        // [\"S7517\"],\n        // [\"S7518\"],\n        // [\"S7519\"],\n        // [\"S7520\"],\n        // [\"S7521\"],\n        // [\"S7522\"],\n        // [\"S7523\"],\n        // [\"S7524\"],\n        // [\"S7525\"],\n        // [\"S7526\"],\n        // [\"S7527\"],\n        // [\"S7528\"],\n        // [\"S7529\"],\n        // [\"S7530\"],\n        // [\"S7531\"],\n        // [\"S7532\"],\n        // [\"S7533\"],\n        // [\"S7534\"],\n        // [\"S7535\"],\n        // [\"S7536\"],\n        // [\"S7537\"],\n        // [\"S7538\"],\n        // [\"S7539\"],\n        // [\"S7540\"],\n        // [\"S7541\"],\n        // [\"S7542\"],\n        // [\"S7543\"],\n        // [\"S7544\"],\n        // [\"S7545\"],\n        // [\"S7546\"],\n        // [\"S7547\"],\n        // [\"S7548\"],\n        // [\"S7549\"],\n        // [\"S7550\"],\n        // [\"S7551\"],\n        // [\"S7552\"],\n        // [\"S7553\"],\n        // [\"S7554\"],\n        // [\"S7555\"],\n        // [\"S7556\"],\n        // [\"S7557\"],\n        // [\"S7558\"],\n        // [\"S7559\"],\n        // [\"S7560\"],\n        // [\"S7561\"],\n        // [\"S7562\"],\n        // [\"S7563\"],\n        // [\"S7564\"],\n        // [\"S7565\"],\n        // [\"S7566\"],\n        // [\"S7567\"],\n        // [\"S7568\"],\n        // [\"S7569\"],\n        // [\"S7570\"],\n        // [\"S7571\"],\n        // [\"S7572\"],\n        // [\"S7573\"],\n        // [\"S7574\"],\n        // [\"S7575\"],\n        // [\"S7576\"],\n        // [\"S7577\"],\n        // [\"S7578\"],\n        // [\"S7579\"],\n        // [\"S7580\"],\n        // [\"S7581\"],\n        // [\"S7582\"],\n        // [\"S7583\"],\n        // [\"S7584\"],\n        // [\"S7585\"],\n        // [\"S7586\"],\n        // [\"S7587\"],\n        // [\"S7588\"],\n        // [\"S7589\"],\n        // [\"S7590\"],\n        // [\"S7591\"],\n        // [\"S7592\"],\n        // [\"S7593\"],\n        // [\"S7594\"],\n        // [\"S7595\"],\n        // [\"S7596\"],\n        // [\"S7597\"],\n        // [\"S7598\"],\n        // [\"S7599\"],\n        // [\"S7600\"],\n        // [\"S7601\"],\n        // [\"S7602\"],\n        // [\"S7603\"],\n        // [\"S7604\"],\n        // [\"S7605\"],\n        // [\"S7606\"],\n        // [\"S7607\"],\n        // [\"S7608\"],\n        // [\"S7609\"],\n        // [\"S7610\"],\n        // [\"S7611\"],\n        // [\"S7612\"],\n        // [\"S7613\"],\n        // [\"S7614\"],\n        // [\"S7615\"],\n        // [\"S7616\"],\n        // [\"S7617\"],\n        // [\"S7618\"],\n        // [\"S7619\"],\n        // [\"S7620\"],\n        // [\"S7621\"],\n        // [\"S7622\"],\n        // [\"S7623\"],\n        // [\"S7624\"],\n        // [\"S7625\"],\n        // [\"S7626\"],\n        // [\"S7627\"],\n        // [\"S7628\"],\n        // [\"S7629\"],\n        // [\"S7630\"],\n        // [\"S7631\"],\n        // [\"S7632\"],\n        // [\"S7633\"],\n        // [\"S7634\"],\n        // [\"S7635\"],\n        // [\"S7636\"],\n        // [\"S7637\"],\n        // [\"S7638\"],\n        // [\"S7639\"],\n        // [\"S7640\"],\n        // [\"S7641\"],\n        // [\"S7642\"],\n        // [\"S7643\"],\n        // [\"S7644\"],\n        // [\"S7645\"],\n        // [\"S7646\"],\n        // [\"S7647\"],\n        // [\"S7648\"],\n        // [\"S7649\"],\n        // [\"S7650\"],\n        // [\"S7651\"],\n        // [\"S7652\"],\n        // [\"S7653\"],\n        // [\"S7654\"],\n        // [\"S7655\"],\n        // [\"S7656\"],\n        // [\"S7657\"],\n        // [\"S7658\"],\n        // [\"S7659\"],\n        // [\"S7660\"],\n        // [\"S7661\"],\n        // [\"S7662\"],\n        // [\"S7663\"],\n        // [\"S7664\"],\n        // [\"S7665\"],\n        // [\"S7666\"],\n        // [\"S7667\"],\n        // [\"S7668\"],\n        // [\"S7669\"],\n        // [\"S7670\"],\n        // [\"S7671\"],\n        // [\"S7672\"],\n        // [\"S7673\"],\n        // [\"S7674\"],\n        // [\"S7675\"],\n        // [\"S7676\"],\n        // [\"S7677\"],\n        // [\"S7678\"],\n        // [\"S7679\"],\n        // [\"S7680\"],\n        // [\"S7681\"],\n        // [\"S7682\"],\n        // [\"S7683\"],\n        // [\"S7684\"],\n        // [\"S7685\"],\n        // [\"S7686\"],\n        // [\"S7687\"],\n        // [\"S7688\"],\n        // [\"S7689\"],\n        // [\"S7690\"],\n        // [\"S7691\"],\n        // [\"S7692\"],\n        // [\"S7693\"],\n        // [\"S7694\"],\n        // [\"S7695\"],\n        // [\"S7696\"],\n        // [\"S7697\"],\n        // [\"S7698\"],\n        // [\"S7699\"],\n        // [\"S7700\"],\n        // [\"S7701\"],\n        // [\"S7702\"],\n        // [\"S7703\"],\n        // [\"S7704\"],\n        // [\"S7705\"],\n        // [\"S7706\"],\n        // [\"S7707\"],\n        // [\"S7708\"],\n        // [\"S7709\"],\n        // [\"S7710\"],\n        // [\"S7711\"],\n        // [\"S7712\"],\n        // [\"S7713\"],\n        // [\"S7714\"],\n        // [\"S7715\"],\n        // [\"S7716\"],\n        // [\"S7717\"],\n        // [\"S7718\"],\n        // [\"S7719\"],\n        // [\"S7720\"],\n        // [\"S7721\"],\n        // [\"S7722\"],\n        // [\"S7723\"],\n        // [\"S7724\"],\n        // [\"S7725\"],\n        // [\"S7726\"],\n        // [\"S7727\"],\n        // [\"S7728\"],\n        // [\"S7729\"],\n        // [\"S7730\"],\n        // [\"S7731\"],\n        // [\"S7732\"],\n        // [\"S7733\"],\n        // [\"S7734\"],\n        // [\"S7735\"],\n        // [\"S7736\"],\n        // [\"S7737\"],\n        // [\"S7738\"],\n        // [\"S7739\"],\n        // [\"S7740\"],\n        // [\"S7741\"],\n        // [\"S7742\"],\n        // [\"S7743\"],\n        // [\"S7744\"],\n        // [\"S7745\"],\n        // [\"S7746\"],\n        // [\"S7747\"],\n        // [\"S7748\"],\n        // [\"S7749\"],\n        // [\"S7750\"],\n        // [\"S7751\"],\n        // [\"S7752\"],\n        // [\"S7753\"],\n        // [\"S7754\"],\n        // [\"S7755\"],\n        // [\"S7756\"],\n        // [\"S7757\"],\n        // [\"S7758\"],\n        // [\"S7759\"],\n        // [\"S7760\"],\n        // [\"S7761\"],\n        // [\"S7762\"],\n        // [\"S7763\"],\n        // [\"S7764\"],\n        // [\"S7765\"],\n        // [\"S7766\"],\n        // [\"S7767\"],\n        // [\"S7768\"],\n        // [\"S7769\"],\n        // [\"S7770\"],\n        // [\"S7771\"],\n        // [\"S7772\"],\n        // [\"S7773\"],\n        // [\"S7774\"],\n        // [\"S7775\"],\n        // [\"S7776\"],\n        // [\"S7777\"],\n        // [\"S7778\"],\n        // [\"S7779\"],\n        // [\"S7780\"],\n        // [\"S7781\"],\n        // [\"S7782\"],\n        // [\"S7783\"],\n        // [\"S7784\"],\n        // [\"S7785\"],\n        // [\"S7786\"],\n        // [\"S7787\"],\n        // [\"S7788\"],\n        // [\"S7789\"],\n        // [\"S7790\"],\n        // [\"S7791\"],\n        // [\"S7792\"],\n        // [\"S7793\"],\n        // [\"S7794\"],\n        // [\"S7795\"],\n        // [\"S7796\"],\n        // [\"S7797\"],\n        // [\"S7798\"],\n        // [\"S7799\"],\n        // [\"S7800\"],\n        // [\"S7801\"],\n        // [\"S7802\"],\n        // [\"S7803\"],\n        // [\"S7804\"],\n        // [\"S7805\"],\n        // [\"S7806\"],\n        // [\"S7807\"],\n        // [\"S7808\"],\n        // [\"S7809\"],\n        // [\"S7810\"],\n        // [\"S7811\"],\n        // [\"S7812\"],\n        // [\"S7813\"],\n        // [\"S7814\"],\n        // [\"S7815\"],\n        // [\"S7816\"],\n        // [\"S7817\"],\n        // [\"S7818\"],\n        // [\"S7819\"],\n        // [\"S7820\"],\n        // [\"S7821\"],\n        // [\"S7822\"],\n        // [\"S7823\"],\n        // [\"S7824\"],\n        // [\"S7825\"],\n        // [\"S7826\"],\n        // [\"S7827\"],\n        // [\"S7828\"],\n        // [\"S7829\"],\n        // [\"S7830\"],\n        // [\"S7831\"],\n        // [\"S7832\"],\n        // [\"S7833\"],\n        // [\"S7834\"],\n        // [\"S7835\"],\n        // [\"S7836\"],\n        // [\"S7837\"],\n        // [\"S7838\"],\n        // [\"S7839\"],\n        // [\"S7840\"],\n        // [\"S7841\"],\n        // [\"S7842\"],\n        // [\"S7843\"],\n        // [\"S7844\"],\n        // [\"S7845\"],\n        // [\"S7846\"],\n        // [\"S7847\"],\n        // [\"S7848\"],\n        // [\"S7849\"],\n        // [\"S7850\"],\n        // [\"S7851\"],\n        // [\"S7852\"],\n        // [\"S7853\"],\n        // [\"S7854\"],\n        // [\"S7855\"],\n        // [\"S7856\"],\n        // [\"S7857\"],\n        // [\"S7858\"],\n        // [\"S7859\"],\n        // [\"S7860\"],\n        // [\"S7861\"],\n        // [\"S7862\"],\n        // [\"S7863\"],\n        // [\"S7864\"],\n        // [\"S7865\"],\n        // [\"S7866\"],\n        // [\"S7867\"],\n        // [\"S7868\"],\n        // [\"S7869\"],\n        // [\"S7870\"],\n        // [\"S7871\"],\n        // [\"S7872\"],\n        // [\"S7873\"],\n        // [\"S7874\"],\n        // [\"S7875\"],\n        // [\"S7876\"],\n        // [\"S7877\"],\n        // [\"S7878\"],\n        // [\"S7879\"],\n        // [\"S7880\"],\n        // [\"S7881\"],\n        // [\"S7882\"],\n        // [\"S7883\"],\n        // [\"S7884\"],\n        // [\"S7885\"],\n        // [\"S7886\"],\n        // [\"S7887\"],\n        // [\"S7888\"],\n        // [\"S7889\"],\n        // [\"S7890\"],\n        // [\"S7891\"],\n        // [\"S7892\"],\n        // [\"S7893\"],\n        // [\"S7894\"],\n        // [\"S7895\"],\n        // [\"S7896\"],\n        // [\"S7897\"],\n        // [\"S7898\"],\n        // [\"S7899\"],\n        // [\"S7900\"],\n        // [\"S7901\"],\n        // [\"S7902\"],\n        // [\"S7903\"],\n        // [\"S7904\"],\n        // [\"S7905\"],\n        // [\"S7906\"],\n        // [\"S7907\"],\n        // [\"S7908\"],\n        // [\"S7909\"],\n        // [\"S7910\"],\n        // [\"S7911\"],\n        // [\"S7912\"],\n        // [\"S7913\"],\n        // [\"S7914\"],\n        // [\"S7915\"],\n        // [\"S7916\"],\n        // [\"S7917\"],\n        // [\"S7918\"],\n        // [\"S7919\"],\n        // [\"S7920\"],\n        // [\"S7921\"],\n        // [\"S7922\"],\n        // [\"S7923\"],\n        // [\"S7924\"],\n        // [\"S7925\"],\n        // [\"S7926\"],\n        // [\"S7927\"],\n        // [\"S7928\"],\n        // [\"S7929\"],\n        // [\"S7930\"],\n        // [\"S7931\"],\n        // [\"S7932\"],\n        // [\"S7933\"],\n        // [\"S7934\"],\n        // [\"S7935\"],\n        // [\"S7936\"],\n        // [\"S7937\"],\n        // [\"S7938\"],\n        // [\"S7939\"],\n        // [\"S7940\"],\n        // [\"S7941\"],\n        // [\"S7942\"],\n        // [\"S7943\"],\n        // [\"S7944\"],\n        // [\"S7945\"],\n        // [\"S7946\"],\n        // [\"S7947\"],\n        // [\"S7948\"],\n        // [\"S7949\"],\n        // [\"S7950\"],\n        // [\"S7951\"],\n        // [\"S7952\"],\n        // [\"S7953\"],\n        // [\"S7954\"],\n        // [\"S7955\"],\n        // [\"S7956\"],\n        // [\"S7957\"],\n        // [\"S7958\"],\n        // [\"S7959\"],\n        // [\"S7960\"],\n        // [\"S7961\"],\n        // [\"S7962\"],\n        // [\"S7963\"],\n        // [\"S7964\"],\n        // [\"S7965\"],\n        // [\"S7966\"],\n        // [\"S7967\"],\n        // [\"S7968\"],\n        // [\"S7969\"],\n        // [\"S7970\"],\n        // [\"S7971\"],\n        // [\"S7972\"],\n        // [\"S7973\"],\n        // [\"S7974\"],\n        // [\"S7975\"],\n        // [\"S7976\"],\n        // [\"S7977\"],\n        // [\"S7978\"],\n        // [\"S7979\"],\n        // [\"S7980\"],\n        // [\"S7981\"],\n        // [\"S7982\"],\n        // [\"S7983\"],\n        // [\"S7984\"],\n        // [\"S7985\"],\n        // [\"S7986\"],\n        // [\"S7987\"],\n        // [\"S7988\"],\n        // [\"S7989\"],\n        // [\"S7990\"],\n        // [\"S7991\"],\n        // [\"S7992\"],\n        // [\"S7993\"],\n        // [\"S7994\"],\n        // [\"S7995\"],\n        // [\"S7996\"],\n        // [\"S7997\"],\n        // [\"S7998\"],\n        // [\"S7999\"],\n        // [\"S8000\"],\n        // [\"S8001\"],\n        // [\"S8002\"],\n        // [\"S8003\"],\n        // [\"S8004\"],\n        // [\"S8005\"],\n        // [\"S8006\"],\n        // [\"S8007\"],\n        // [\"S8008\"],\n        // [\"S8009\"],\n        // [\"S8010\"],\n        // [\"S8011\"],\n        // [\"S8012\"],\n        // [\"S8013\"],\n        // [\"S8014\"],\n        // [\"S8015\"],\n        // [\"S8016\"],\n        // [\"S8017\"],\n        // [\"S8018\"],\n        // [\"S8019\"],\n        // [\"S8020\"],\n        // [\"S8021\"],\n        // [\"S8022\"],\n        // [\"S8023\"],\n        // [\"S8024\"],\n        // [\"S8025\"],\n        // [\"S8026\"],\n        // [\"S8027\"],\n        // [\"S8028\"],\n        // [\"S8029\"],\n        // [\"S8030\"],\n        // [\"S8031\"],\n        // [\"S8032\"],\n        // [\"S8033\"],\n        // [\"S8034\"],\n        // [\"S8035\"],\n        // [\"S8036\"],\n        // [\"S8037\"],\n        // [\"S8038\"],\n        // [\"S8039\"],\n        // [\"S8040\"],\n        // [\"S8041\"],\n        // [\"S8042\"],\n        // [\"S8043\"],\n        // [\"S8044\"],\n        // [\"S8045\"],\n        // [\"S8046\"],\n        // [\"S8047\"],\n        // [\"S8048\"],\n        // [\"S8049\"],\n        // [\"S8050\"],\n        // [\"S8051\"],\n        // [\"S8052\"],\n        // [\"S8053\"],\n        // [\"S8054\"],\n        // [\"S8055\"],\n        // [\"S8056\"],\n        // [\"S8057\"],\n        // [\"S8058\"],\n        // [\"S8059\"],\n        // [\"S8060\"],\n        // [\"S8061\"],\n        // [\"S8062\"],\n        // [\"S8063\"],\n        // [\"S8064\"],\n        // [\"S8065\"],\n        // [\"S8066\"],\n        // [\"S8067\"],\n        // [\"S8068\"],\n        // [\"S8069\"],\n        // [\"S8070\"],\n        // [\"S8071\"],\n        // [\"S8072\"],\n        // [\"S8073\"],\n        // [\"S8074\"],\n        // [\"S8075\"],\n        // [\"S8076\"],\n        // [\"S8077\"],\n        // [\"S8078\"],\n        // [\"S8079\"],\n        // [\"S8080\"],\n        // [\"S8081\"],\n        // [\"S8082\"],\n        // [\"S8083\"],\n        // [\"S8084\"],\n        // [\"S8085\"],\n        // [\"S8086\"],\n        // [\"S8087\"],\n        // [\"S8088\"],\n        // [\"S8089\"],\n        // [\"S8090\"],\n        // [\"S8091\"],\n        // [\"S8092\"],\n        // [\"S8093\"],\n        // [\"S8094\"],\n        // [\"S8095\"],\n        // [\"S8096\"],\n        // [\"S8097\"],\n        // [\"S8098\"],\n        // [\"S8099\"],\n        // [\"S8100\"],\n        // [\"S8101\"],\n        // [\"S8102\"],\n        // [\"S8103\"],\n        // [\"S8104\"],\n        // [\"S8105\"],\n        // [\"S8106\"],\n        // [\"S8107\"],\n        // [\"S8108\"],\n        // [\"S8109\"],\n        // [\"S8110\"],\n        // [\"S8111\"],\n        // [\"S8112\"],\n        // [\"S8113\"],\n        // [\"S8114\"],\n        // [\"S8115\"],\n        // [\"S8116\"],\n        // [\"S8117\"],\n        // [\"S8118\"],\n        // [\"S8119\"],\n        // [\"S8120\"],\n        // [\"S8121\"],\n        // [\"S8122\"],\n        // [\"S8123\"],\n        // [\"S8124\"],\n        // [\"S8125\"],\n        // [\"S8126\"],\n        // [\"S8127\"],\n        // [\"S8128\"],\n        // [\"S8129\"],\n        // [\"S8130\"],\n        // [\"S8131\"],\n        // [\"S8132\"],\n        // [\"S8133\"],\n        // [\"S8134\"],\n        // [\"S8135\"],\n        // [\"S8136\"],\n        // [\"S8137\"],\n        // [\"S8138\"],\n        // [\"S8139\"],\n        // [\"S8140\"],\n        // [\"S8141\"],\n        // [\"S8142\"],\n        // [\"S8143\"],\n        // [\"S8144\"],\n        // [\"S8145\"],\n        // [\"S8146\"],\n        // [\"S8147\"],\n        // [\"S8148\"],\n        // [\"S8149\"],\n        // [\"S8150\"],\n        // [\"S8151\"],\n        // [\"S8152\"],\n        // [\"S8153\"],\n        // [\"S8154\"],\n        // [\"S8155\"],\n        // [\"S8156\"],\n        // [\"S8157\"],\n        // [\"S8158\"],\n        // [\"S8159\"],\n        // [\"S8160\"],\n        // [\"S8161\"],\n        // [\"S8162\"],\n        // [\"S8163\"],\n        // [\"S8164\"],\n        // [\"S8165\"],\n        // [\"S8166\"],\n        // [\"S8167\"],\n        // [\"S8168\"],\n        // [\"S8169\"],\n        // [\"S8170\"],\n        // [\"S8171\"],\n        // [\"S8172\"],\n        // [\"S8173\"],\n        // [\"S8174\"],\n        // [\"S8175\"],\n        // [\"S8176\"],\n        // [\"S8177\"],\n        // [\"S8178\"],\n        // [\"S8179\"],\n        // [\"S8180\"],\n        // [\"S8181\"],\n        // [\"S8182\"],\n        // [\"S8183\"],\n        // [\"S8184\"],\n        // [\"S8185\"],\n        // [\"S8186\"],\n        // [\"S8187\"],\n        // [\"S8188\"],\n        // [\"S8189\"],\n        // [\"S8190\"],\n        // [\"S8191\"],\n        // [\"S8192\"],\n        // [\"S8193\"],\n        // [\"S8194\"],\n        // [\"S8195\"],\n        // [\"S8196\"],\n        // [\"S8197\"],\n        // [\"S8198\"],\n        // [\"S8199\"],\n        // [\"S8200\"],\n        // [\"S8201\"],\n        // [\"S8202\"],\n        // [\"S8203\"],\n        // [\"S8204\"],\n        // [\"S8205\"],\n        // [\"S8206\"],\n        // [\"S8207\"],\n        // [\"S8208\"],\n        // [\"S8209\"],\n        // [\"S8210\"],\n        // [\"S8211\"],\n        // [\"S8212\"],\n        // [\"S8213\"],\n        // [\"S8214\"],\n        // [\"S8215\"],\n        // [\"S8216\"],\n        // [\"S8217\"],\n        // [\"S8218\"],\n        // [\"S8219\"],\n        // [\"S8220\"],\n        // [\"S8221\"],\n        // [\"S8222\"],\n        // [\"S8223\"],\n        // [\"S8224\"],\n        // [\"S8225\"],\n        // [\"S8226\"],\n        // [\"S8227\"],\n        // [\"S8228\"],\n        // [\"S8229\"],\n        // [\"S8230\"],\n        // [\"S8231\"],\n        // [\"S8232\"],\n        // [\"S8233\"],\n        // [\"S8234\"],\n        // [\"S8235\"],\n        // [\"S8236\"],\n        // [\"S8237\"],\n        // [\"S8238\"],\n        // [\"S8239\"],\n        // [\"S8240\"],\n        // [\"S8241\"],\n        // [\"S8242\"],\n        // [\"S8243\"],\n        // [\"S8244\"],\n        // [\"S8245\"],\n        // [\"S8246\"],\n        // [\"S8247\"],\n        // [\"S8248\"],\n        // [\"S8249\"],\n        // [\"S8250\"],\n        // [\"S8251\"],\n        // [\"S8252\"],\n        // [\"S8253\"],\n        // [\"S8254\"],\n        // [\"S8255\"],\n        // [\"S8256\"],\n        // [\"S8257\"],\n        // [\"S8258\"],\n        // [\"S8259\"],\n        // [\"S8260\"],\n        // [\"S8261\"],\n        // [\"S8262\"],\n        // [\"S8263\"],\n        // [\"S8264\"],\n        // [\"S8265\"],\n        // [\"S8266\"],\n        // [\"S8267\"],\n        // [\"S8268\"],\n        // [\"S8269\"],\n        // [\"S8270\"],\n        // [\"S8271\"],\n        // [\"S8272\"],\n        // [\"S8273\"],\n        // [\"S8274\"],\n        // [\"S8275\"],\n        // [\"S8276\"],\n        // [\"S8277\"],\n        // [\"S8278\"],\n        // [\"S8279\"],\n        // [\"S8280\"],\n        // [\"S8281\"],\n        // [\"S8282\"],\n        // [\"S8283\"],\n        // [\"S8284\"],\n        // [\"S8285\"],\n        // [\"S8286\"],\n        // [\"S8287\"],\n        // [\"S8288\"],\n        // [\"S8289\"],\n        // [\"S8290\"],\n        // [\"S8291\"],\n        // [\"S8292\"],\n        // [\"S8293\"],\n        // [\"S8294\"],\n        // [\"S8295\"],\n        // [\"S8296\"],\n        // [\"S8297\"],\n        // [\"S8298\"],\n        // [\"S8299\"],\n        // [\"S8300\"],\n        // [\"S8301\"],\n        // [\"S8302\"],\n        // [\"S8303\"],\n        // [\"S8304\"],\n        // [\"S8305\"],\n        // [\"S8306\"],\n        // [\"S8307\"],\n        // [\"S8308\"],\n        // [\"S8309\"],\n        // [\"S8310\"],\n        // [\"S8311\"],\n        // [\"S8312\"],\n        // [\"S8313\"],\n        // [\"S8314\"],\n        // [\"S8315\"],\n        // [\"S8316\"],\n        // [\"S8317\"],\n        // [\"S8318\"],\n        // [\"S8319\"],\n        // [\"S8320\"],\n        // [\"S8321\"],\n        // [\"S8322\"],\n        // [\"S8323\"],\n        // [\"S8324\"],\n        // [\"S8325\"],\n        // [\"S8326\"],\n        // [\"S8327\"],\n        // [\"S8328\"],\n        // [\"S8329\"],\n        // [\"S8330\"],\n        // [\"S8331\"],\n        // [\"S8332\"],\n        // [\"S8333\"],\n        // [\"S8334\"],\n        // [\"S8335\"],\n        // [\"S8336\"],\n        // [\"S8337\"],\n        // [\"S8338\"],\n        // [\"S8339\"],\n        // [\"S8340\"],\n        // [\"S8341\"],\n        // [\"S8342\"],\n        // [\"S8343\"],\n        // [\"S8344\"],\n        // [\"S8345\"],\n        // [\"S8346\"],\n        // [\"S8347\"],\n        // [\"S8348\"],\n        // [\"S8349\"],\n        // [\"S8350\"],\n        // [\"S8351\"],\n        // [\"S8352\"],\n        // [\"S8353\"],\n        // [\"S8354\"],\n        // [\"S8355\"],\n        // [\"S8356\"],\n        // [\"S8357\"],\n        // [\"S8358\"],\n        // [\"S8359\"],\n        // [\"S8360\"],\n        // [\"S8361\"],\n        // [\"S8362\"],\n        // [\"S8363\"],\n        // [\"S8364\"],\n        // [\"S8365\"],\n        // [\"S8366\"],\n        [\"S8367\"] = \"CODE_SMELL\",\n        [\"S8368\"] = \"CODE_SMELL\",\n        // [\"S8369\"],\n        // [\"S8370\"],\n        // [\"S8371\"],\n        // [\"S8372\"],\n        // [\"S8373\"],\n        // [\"S8374\"],\n        // [\"S8375\"],\n        // [\"S8376\"],\n        // [\"S8377\"],\n        // [\"S8378\"],\n        // [\"S8379\"],\n        [\"S8380\"] = \"CODE_SMELL\",\n        [\"S8381\"] = \"CODE_SMELL\",\n        // [\"S8382\"],\n        // [\"S8383\"],\n        // [\"S8384\"],\n        // [\"S8385\"],\n        // [\"S8386\"],\n        // [\"S8387\"],\n        // [\"S8388\"],\n        // [\"S8389\"],\n        // [\"S8390\"],\n        // [\"S8391\"],\n        // [\"S8392\"],\n        // [\"S8393\"],\n        // [\"S8394\"],\n        // [\"S8395\"],\n        // [\"S8396\"],\n        // [\"S8397\"],\n        // [\"S8398\"],\n        // [\"S8399\"],\n        // [\"S8400\"],\n        // [\"S8401\"],\n        // [\"S8402\"],\n        // [\"S8403\"],\n        // [\"S8404\"],\n        // [\"S8405\"],\n        // [\"S8406\"],\n        // [\"S8407\"],\n        // [\"S8408\"],\n        // [\"S8409\"],\n        // [\"S8410\"],\n        // [\"S8411\"],\n        // [\"S8412\"],\n        // [\"S8413\"],\n        // [\"S8414\"],\n        // [\"S8415\"],\n        // [\"S8416\"],\n        // [\"S8417\"],\n        // [\"S8418\"],\n        // [\"S8419\"],\n        // [\"S8420\"],\n        // [\"S8421\"],\n        // [\"S8422\"],\n        // [\"S8423\"],\n        // [\"S8424\"],\n        // [\"S8425\"],\n        // [\"S8426\"],\n        // [\"S8427\"],\n        // [\"S8428\"],\n        // [\"S8429\"],\n        // [\"S8430\"],\n        // [\"S8431\"],\n        // [\"S8432\"],\n        // [\"S8433\"],\n        // [\"S8434\"],\n        // [\"S8435\"],\n        // [\"S8436\"],\n        // [\"S8437\"],\n        // [\"S8438\"],\n        // [\"S8439\"],\n        // [\"S8440\"],\n        // [\"S8441\"],\n        // [\"S8442\"],\n        // [\"S8443\"],\n        // [\"S8444\"],\n        // [\"S8445\"],\n        // [\"S8446\"],\n        // [\"S8447\"],\n        // [\"S8448\"],\n        // [\"S8449\"],\n        // [\"S8450\"],\n        // [\"S8451\"],\n        // [\"S8452\"],\n        // [\"S8453\"],\n        // [\"S8454\"],\n        // [\"S8455\"],\n        // [\"S8456\"],\n        // [\"S8457\"],\n        // [\"S8458\"],\n        // [\"S8459\"],\n        // [\"S8460\"],\n        // [\"S8461\"],\n        // [\"S8462\"],\n        // [\"S8463\"],\n        // [\"S8464\"],\n        // [\"S8465\"],\n        // [\"S8466\"],\n        // [\"S8467\"],\n        // [\"S8468\"],\n        // [\"S8469\"],\n        // [\"S8470\"],\n        // [\"S8471\"],\n        // [\"S8472\"],\n        // [\"S8473\"],\n        // [\"S8474\"],\n        // [\"S8475\"],\n        // [\"S8476\"],\n        // [\"S8477\"],\n        // [\"S8478\"],\n        // [\"S8479\"],\n        // [\"S8480\"],\n        // [\"S8481\"],\n        // [\"S8482\"],\n        // [\"S8483\"],\n        // [\"S8484\"],\n        // [\"S8485\"],\n        // [\"S8486\"],\n        // [\"S8487\"],\n        // [\"S8488\"],\n        // [\"S8489\"],\n        // [\"S8490\"],\n        // [\"S8491\"],\n        // [\"S8492\"],\n        // [\"S8493\"],\n        // [\"S8494\"],\n        // [\"S8495\"],\n        // [\"S8496\"],\n        // [\"S8497\"],\n        // [\"S8498\"],\n        // [\"S8499\"],\n        // [\"S8500\"],\n        // [\"S8501\"],\n        // [\"S8502\"],\n        // [\"S8503\"],\n        // [\"S8504\"],\n        // [\"S8505\"],\n        // [\"S8506\"],\n        // [\"S8507\"],\n        // [\"S8508\"],\n        // [\"S8509\"],\n        // [\"S8510\"],\n        // [\"S8511\"],\n        // [\"S8512\"],\n        // [\"S8513\"],\n        // [\"S8514\"],\n        // [\"S8515\"],\n        // [\"S8516\"],\n        // [\"S8517\"],\n        // [\"S8518\"],\n        // [\"S8519\"],\n        // [\"S8520\"],\n        // [\"S8521\"],\n        // [\"S8522\"],\n        // [\"S8523\"],\n        // [\"S8524\"],\n        // [\"S8525\"],\n        // [\"S8526\"],\n        // [\"S8527\"],\n        // [\"S8528\"],\n        // [\"S8529\"],\n        // [\"S8530\"],\n        // [\"S8531\"],\n        // [\"S8532\"],\n        // [\"S8533\"],\n        // [\"S8534\"],\n        // [\"S8535\"],\n        // [\"S8536\"],\n        // [\"S8537\"],\n        // [\"S8538\"],\n        // [\"S8539\"],\n        // [\"S8540\"],\n        // [\"S8541\"],\n        // [\"S8542\"],\n        // [\"S8543\"],\n        // [\"S8544\"],\n        // [\"S8545\"],\n        // [\"S8546\"],\n        // [\"S8547\"],\n        // [\"S8548\"],\n        // [\"S8549\"],\n        // [\"S8550\"],\n        // [\"S8551\"],\n        // [\"S8552\"],\n        // [\"S8553\"],\n        // [\"S8554\"],\n        // [\"S8555\"],\n        // [\"S8556\"],\n        // [\"S8557\"],\n        // [\"S8558\"],\n        // [\"S8559\"],\n        // [\"S8560\"],\n        // [\"S8561\"],\n        // [\"S8562\"],\n        // [\"S8563\"],\n        // [\"S8564\"],\n        // [\"S8565\"],\n        // [\"S8566\"],\n        // [\"S8567\"],\n        // [\"S8568\"],\n        // [\"S8569\"],\n        // [\"S8570\"],\n        // [\"S8571\"],\n        // [\"S8572\"],\n        // [\"S8573\"],\n        // [\"S8574\"],\n        // [\"S8575\"],\n        // [\"S8576\"],\n        // [\"S8577\"],\n        // [\"S8578\"],\n        // [\"S8579\"],\n        // [\"S8580\"],\n        // [\"S8581\"],\n        // [\"S8582\"],\n        // [\"S8583\"],\n        // [\"S8584\"],\n        // [\"S8585\"],\n        // [\"S8586\"],\n        // [\"S8587\"],\n        // [\"S8588\"],\n        // [\"S8589\"],\n        // [\"S8590\"],\n        // [\"S8591\"],\n        // [\"S8592\"],\n        // [\"S8593\"],\n        // [\"S8594\"],\n        // [\"S8595\"],\n        // [\"S8596\"],\n        // [\"S8597\"],\n        // [\"S8598\"],\n        // [\"S8599\"],\n        // [\"S8600\"],\n        // [\"S8601\"],\n        // [\"S8602\"],\n        // [\"S8603\"],\n        // [\"S8604\"],\n        // [\"S8605\"],\n        // [\"S8606\"],\n        // [\"S8607\"],\n        // [\"S8608\"],\n        // [\"S8609\"],\n        // [\"S8610\"],\n        // [\"S8611\"],\n        // [\"S8612\"],\n        // [\"S8613\"],\n        // [\"S8614\"],\n        // [\"S8615\"],\n        // [\"S8616\"],\n        // [\"S8617\"],\n        // [\"S8618\"],\n        // [\"S8619\"],\n        // [\"S8620\"],\n        // [\"S8621\"],\n        // [\"S8622\"],\n        // [\"S8623\"],\n        // [\"S8624\"],\n        // [\"S8625\"],\n        // [\"S8626\"],\n        // [\"S8627\"],\n        // [\"S8628\"],\n        // [\"S8629\"],\n        // [\"S8630\"],\n        // [\"S8631\"],\n        // [\"S8632\"],\n        // [\"S8633\"],\n        // [\"S8634\"],\n        // [\"S8635\"],\n        // [\"S8636\"],\n        // [\"S8637\"],\n        // [\"S8638\"],\n        // [\"S8639\"],\n        // [\"S8640\"],\n        // [\"S8641\"],\n        // [\"S8642\"],\n        // [\"S8643\"],\n        // [\"S8644\"],\n        // [\"S8645\"],\n        // [\"S8646\"],\n        // [\"S8647\"],\n        // [\"S8648\"],\n        // [\"S8649\"],\n        // [\"S8650\"],\n        // [\"S8651\"],\n        // [\"S8652\"],\n        // [\"S8653\"],\n        // [\"S8654\"],\n        // [\"S8655\"],\n        // [\"S8656\"],\n        // [\"S8657\"],\n        // [\"S8658\"],\n        // [\"S8659\"],\n        // [\"S8660\"],\n        // [\"S8661\"],\n        // [\"S8662\"],\n        // [\"S8663\"],\n        // [\"S8664\"],\n        // [\"S8665\"],\n        // [\"S8666\"],\n        // [\"S8667\"],\n        // [\"S8668\"],\n        // [\"S8669\"],\n        // [\"S8670\"],\n        // [\"S8671\"],\n        // [\"S8672\"],\n        // [\"S8673\"],\n        // [\"S8674\"],\n        // [\"S8675\"],\n        // [\"S8676\"],\n        // [\"S8677\"],\n        // [\"S8678\"],\n        // [\"S8679\"],\n        // [\"S8680\"],\n        // [\"S8681\"],\n        // [\"S8682\"],\n        // [\"S8683\"],\n        // [\"S8684\"],\n        // [\"S8685\"],\n        // [\"S8686\"],\n        // [\"S8687\"],\n        // [\"S8688\"],\n        // [\"S8689\"],\n        // [\"S8690\"],\n        // [\"S8691\"],\n        // [\"S8692\"],\n        // [\"S8693\"],\n        // [\"S8694\"],\n        // [\"S8695\"],\n        // [\"S8696\"],\n        // [\"S8697\"],\n        // [\"S8698\"],\n        // [\"S8699\"],\n        // [\"S8700\"],\n        // [\"S8701\"],\n        // [\"S8702\"],\n        // [\"S8703\"],\n        // [\"S8704\"],\n        // [\"S8705\"],\n        // [\"S8706\"],\n        // [\"S8707\"],\n        // [\"S8708\"],\n        // [\"S8709\"],\n        // [\"S8710\"],\n        // [\"S8711\"],\n        // [\"S8712\"],\n        // [\"S8713\"],\n        // [\"S8714\"],\n        // [\"S8715\"],\n        // [\"S8716\"],\n        // [\"S8717\"],\n        // [\"S8718\"],\n        // [\"S8719\"],\n        // [\"S8720\"],\n        // [\"S8721\"],\n        // [\"S8722\"],\n        // [\"S8723\"],\n        // [\"S8724\"],\n        // [\"S8725\"],\n        // [\"S8726\"],\n        // [\"S8727\"],\n        // [\"S8728\"],\n        // [\"S8729\"],\n        // [\"S8730\"],\n        // [\"S8731\"],\n        // [\"S8732\"],\n        // [\"S8733\"],\n        // [\"S8734\"],\n        // [\"S8735\"],\n        // [\"S8736\"],\n        // [\"S8737\"],\n        // [\"S8738\"],\n        // [\"S8739\"],\n        // [\"S8740\"],\n        // [\"S8741\"],\n        // [\"S8742\"],\n        // [\"S8743\"],\n        // [\"S8744\"],\n        // [\"S8745\"],\n        // [\"S8746\"],\n        // [\"S8747\"],\n        // [\"S8748\"],\n        // [\"S8749\"],\n        // [\"S8750\"],\n        // [\"S8751\"],\n        // [\"S8752\"],\n        // [\"S8753\"],\n        // [\"S8754\"],\n        // [\"S8755\"],\n        // [\"S8756\"],\n        // [\"S8757\"],\n        // [\"S8758\"],\n        // [\"S8759\"],\n        // [\"S8760\"],\n        // [\"S8761\"],\n        // [\"S8762\"],\n        // [\"S8763\"],\n        // [\"S8764\"],\n        // [\"S8765\"],\n        // [\"S8766\"],\n        // [\"S8767\"],\n        // [\"S8768\"],\n        // [\"S8769\"],\n        // [\"S8770\"],\n        // [\"S8771\"],\n        // [\"S8772\"],\n        // [\"S8773\"],\n        // [\"S8774\"],\n        // [\"S8775\"],\n        // [\"S8776\"],\n        // [\"S8777\"],\n        // [\"S8778\"],\n        // [\"S8779\"],\n        // [\"S8780\"],\n        // [\"S8781\"],\n        // [\"S8782\"],\n        // [\"S8783\"],\n        // [\"S8784\"],\n        // [\"S8785\"],\n        // [\"S8786\"],\n        // [\"S8787\"],\n        // [\"S8788\"],\n        // [\"S8789\"],\n        // [\"S8790\"],\n        // [\"S8791\"],\n        // [\"S8792\"],\n        // [\"S8793\"],\n        // [\"S8794\"],\n        // [\"S8795\"],\n        // [\"S8796\"],\n        // [\"S8797\"],\n        // [\"S8798\"],\n        // [\"S8799\"],\n        // [\"S8800\"],\n        // [\"S8801\"],\n        // [\"S8802\"],\n        // [\"S8803\"],\n        // [\"S8804\"],\n        // [\"S8805\"],\n        // [\"S8806\"],\n        // [\"S8807\"],\n        // [\"S8808\"],\n        // [\"S8809\"],\n        // [\"S8810\"],\n        // [\"S8811\"],\n        // [\"S8812\"],\n        // [\"S8813\"],\n        // [\"S8814\"],\n        // [\"S8815\"],\n        // [\"S8816\"],\n        // [\"S8817\"],\n        // [\"S8818\"],\n        // [\"S8819\"],\n        // [\"S8820\"],\n        // [\"S8821\"],\n        // [\"S8822\"],\n        // [\"S8823\"],\n        // [\"S8824\"],\n        // [\"S8825\"],\n        // [\"S8826\"],\n        // [\"S8827\"],\n        // [\"S8828\"],\n        // [\"S8829\"],\n        // [\"S8830\"],\n        // [\"S8831\"],\n        // [\"S8832\"],\n        // [\"S8833\"],\n        // [\"S8834\"],\n        // [\"S8835\"],\n        // [\"S8836\"],\n        // [\"S8837\"],\n        // [\"S8838\"],\n        // [\"S8839\"],\n        // [\"S8840\"],\n        // [\"S8841\"],\n        // [\"S8842\"],\n        // [\"S8843\"],\n        // [\"S8844\"],\n        // [\"S8845\"],\n        // [\"S8846\"],\n        // [\"S8847\"],\n        // [\"S8848\"],\n        // [\"S8849\"],\n        // [\"S8850\"],\n        // [\"S8851\"],\n        // [\"S8852\"],\n        // [\"S8853\"],\n        // [\"S8854\"],\n        // [\"S8855\"],\n        // [\"S8856\"],\n        // [\"S8857\"],\n        // [\"S8858\"],\n        // [\"S8859\"],\n        // [\"S8860\"],\n        // [\"S8861\"],\n        // [\"S8862\"],\n        // [\"S8863\"],\n        // [\"S8864\"],\n        // [\"S8865\"],\n        // [\"S8866\"],\n        // [\"S8867\"],\n        // [\"S8868\"],\n        // [\"S8869\"],\n        // [\"S8870\"],\n        // [\"S8871\"],\n        // [\"S8872\"],\n        // [\"S8873\"],\n        // [\"S8874\"],\n        // [\"S8875\"],\n        // [\"S8876\"],\n        // [\"S8877\"],\n        // [\"S8878\"],\n        // [\"S8879\"],\n        // [\"S8880\"],\n        // [\"S8881\"],\n        // [\"S8882\"],\n        // [\"S8883\"],\n        // [\"S8884\"],\n        // [\"S8885\"],\n        // [\"S8886\"],\n        // [\"S8887\"],\n        // [\"S8888\"],\n        // [\"S8889\"],\n        // [\"S8890\"],\n        // [\"S8891\"],\n        // [\"S8892\"],\n        // [\"S8893\"],\n        // [\"S8894\"],\n        // [\"S8895\"],\n        // [\"S8896\"],\n        // [\"S8897\"],\n        // [\"S8898\"],\n        // [\"S8899\"],\n        // [\"S8900\"],\n        // [\"S8901\"],\n        // [\"S8902\"],\n        // [\"S8903\"],\n        // [\"S8904\"],\n        // [\"S8905\"],\n        // [\"S8906\"],\n        // [\"S8907\"],\n        // [\"S8908\"],\n        // [\"S8909\"],\n        // [\"S8910\"],\n        // [\"S8911\"],\n        // [\"S8912\"],\n        // [\"S8913\"],\n        // [\"S8914\"],\n        // [\"S8915\"],\n        // [\"S8916\"],\n        // [\"S8917\"],\n        // [\"S8918\"],\n        // [\"S8919\"],\n        // [\"S8920\"],\n        // [\"S8921\"],\n        // [\"S8922\"],\n        // [\"S8923\"],\n        // [\"S8924\"],\n        // [\"S8925\"],\n        // [\"S8926\"],\n        // [\"S8927\"],\n        // [\"S8928\"],\n        // [\"S8929\"],\n        // [\"S8930\"],\n        // [\"S8931\"],\n        // [\"S8932\"],\n        // [\"S8933\"],\n        // [\"S8934\"],\n        // [\"S8935\"],\n        // [\"S8936\"],\n        // [\"S8937\"],\n        // [\"S8938\"],\n        // [\"S8939\"],\n        // [\"S8940\"],\n        // [\"S8941\"],\n        // [\"S8942\"],\n        // [\"S8943\"],\n        // [\"S8944\"],\n        // [\"S8945\"],\n        // [\"S8946\"],\n        // [\"S8947\"],\n        // [\"S8948\"],\n        // [\"S8949\"],\n        // [\"S8950\"],\n        // [\"S8951\"],\n        // [\"S8952\"],\n        // [\"S8953\"],\n        // [\"S8954\"],\n        // [\"S8955\"],\n        // [\"S8956\"],\n        // [\"S8957\"],\n        // [\"S8958\"],\n        // [\"S8959\"],\n        // [\"S8960\"],\n        // [\"S8961\"],\n        // [\"S8962\"],\n        // [\"S8963\"],\n        // [\"S8964\"],\n        // [\"S8965\"],\n        // [\"S8966\"],\n        // [\"S8967\"],\n        // [\"S8968\"],\n        // [\"S8969\"],\n        // [\"S8970\"],\n        // [\"S8971\"],\n        // [\"S8972\"],\n        // [\"S8973\"],\n        // [\"S8974\"],\n        // [\"S8975\"],\n        // [\"S8976\"],\n        // [\"S8977\"],\n        // [\"S8978\"],\n        // [\"S8979\"],\n        // [\"S8980\"],\n        // [\"S8981\"],\n        // [\"S8982\"],\n        // [\"S8983\"],\n        // [\"S8984\"],\n        // [\"S8985\"],\n        // [\"S8986\"],\n        // [\"S8987\"],\n        // [\"S8988\"],\n        // [\"S8989\"],\n        // [\"S8990\"],\n        // [\"S8991\"],\n        // [\"S8992\"],\n        // [\"S8993\"],\n        // [\"S8994\"],\n        // [\"S8995\"],\n        // [\"S8996\"],\n        // [\"S8997\"],\n        // [\"S8998\"],\n        // [\"S8999\"],\n        // [\"S9000\"],\n        // [\"S9001\"],\n        // [\"S9002\"],\n        // [\"S9003\"],\n        // [\"S9004\"],\n        // [\"S9005\"],\n        // [\"S9006\"],\n        // [\"S9007\"],\n        // [\"S9008\"],\n        // [\"S9009\"],\n        // [\"S9010\"],\n        // [\"S9011\"],\n        // [\"S9012\"],\n        // [\"S9013\"],\n        // [\"S9014\"],\n        // [\"S9015\"],\n        // [\"S9016\"],\n        // [\"S9017\"],\n        // [\"S9018\"],\n        // [\"S9019\"],\n        // [\"S9020\"],\n        // [\"S9021\"],\n        // [\"S9022\"],\n        // [\"S9023\"],\n        // [\"S9024\"],\n        // [\"S9025\"],\n        // [\"S9026\"],\n        // [\"S9027\"],\n        // [\"S9028\"],\n        // [\"S9029\"],\n        // [\"S9030\"],\n        // [\"S9031\"],\n        // [\"S9032\"],\n        // [\"S9033\"],\n        // [\"S9034\"],\n        // [\"S9035\"],\n        // [\"S9036\"],\n        // [\"S9037\"],\n        // [\"S9038\"],\n        // [\"S9039\"],\n        // [\"S9040\"],\n        // [\"S9041\"],\n        // [\"S9042\"],\n        // [\"S9043\"],\n        // [\"S9044\"],\n        // [\"S9045\"],\n        // [\"S9046\"],\n        // [\"S9047\"],\n        // [\"S9048\"],\n        // [\"S9049\"],\n        // [\"S9050\"],\n        // [\"S9051\"],\n        // [\"S9052\"],\n        // [\"S9053\"],\n        // [\"S9054\"],\n        // [\"S9055\"],\n        // [\"S9056\"],\n        // [\"S9057\"],\n        // [\"S9058\"],\n        // [\"S9059\"],\n        // [\"S9060\"],\n        // [\"S9061\"],\n        // [\"S9062\"],\n        // [\"S9063\"],\n        // [\"S9064\"],\n        // [\"S9065\"],\n        // [\"S9066\"],\n        // [\"S9067\"],\n        // [\"S9068\"],\n        // [\"S9069\"],\n        // [\"S9070\"],\n        // [\"S9071\"],\n        // [\"S9072\"],\n        // [\"S9073\"],\n        // [\"S9074\"],\n        // [\"S9075\"],\n        // [\"S9076\"],\n        // [\"S9077\"],\n        // [\"S9078\"],\n        // [\"S9079\"],\n        // [\"S9080\"],\n        // [\"S9081\"],\n        // [\"S9082\"],\n        // [\"S9083\"],\n        // [\"S9084\"],\n        // [\"S9085\"],\n        // [\"S9086\"],\n        // [\"S9087\"],\n        // [\"S9088\"],\n        // [\"S9089\"],\n        // [\"S9090\"],\n        // [\"S9091\"],\n        // [\"S9092\"],\n        // [\"S9093\"],\n        // [\"S9094\"],\n        // [\"S9095\"],\n        // [\"S9096\"],\n        // [\"S9097\"],\n        // [\"S9098\"],\n        // [\"S9099\"],\n        // [\"S9100\"],\n        // [\"S9101\"],\n        // [\"S9102\"],\n        // [\"S9103\"],\n        // [\"S9104\"],\n        // [\"S9105\"],\n        // [\"S9106\"],\n        // [\"S9107\"],\n        // [\"S9108\"],\n        // [\"S9109\"],\n        // [\"S9110\"],\n        // [\"S9111\"],\n        // [\"S9112\"],\n        // [\"S9113\"],\n        // [\"S9114\"],\n        // [\"S9115\"],\n        // [\"S9116\"],\n        // [\"S9117\"],\n        // [\"S9118\"],\n        // [\"S9119\"],\n        // [\"S9120\"],\n        // [\"S9121\"],\n        // [\"S9122\"],\n        // [\"S9123\"],\n        // [\"S9124\"],\n        // [\"S9125\"],\n        // [\"S9126\"],\n        // [\"S9127\"],\n        // [\"S9128\"],\n        // [\"S9129\"],\n        // [\"S9130\"],\n        // [\"S9131\"],\n        // [\"S9132\"],\n        // [\"S9133\"],\n        // [\"S9134\"],\n        // [\"S9135\"],\n        // [\"S9136\"],\n        // [\"S9137\"],\n        // [\"S9138\"],\n        // [\"S9139\"],\n        // [\"S9140\"],\n        // [\"S9141\"],\n        // [\"S9142\"],\n        // [\"S9143\"],\n        // [\"S9144\"],\n        // [\"S9145\"],\n        // [\"S9146\"],\n        // [\"S9147\"],\n        // [\"S9148\"],\n        // [\"S9149\"],\n        // [\"S9150\"],\n        // [\"S9151\"],\n        // [\"S9152\"],\n        // [\"S9153\"],\n        // [\"S9154\"],\n        // [\"S9155\"],\n        // [\"S9156\"],\n        // [\"S9157\"],\n        // [\"S9158\"],\n        // [\"S9159\"],\n        // [\"S9160\"],\n        // [\"S9161\"],\n        // [\"S9162\"],\n        // [\"S9163\"],\n        // [\"S9164\"],\n        // [\"S9165\"],\n        // [\"S9166\"],\n        // [\"S9167\"],\n        // [\"S9168\"],\n        // [\"S9169\"],\n        // [\"S9170\"],\n        // [\"S9171\"],\n        // [\"S9172\"],\n        // [\"S9173\"],\n        // [\"S9174\"],\n        // [\"S9175\"],\n        // [\"S9176\"],\n        // [\"S9177\"],\n        // [\"S9178\"],\n        // [\"S9179\"],\n        // [\"S9180\"],\n        // [\"S9181\"],\n        // [\"S9182\"],\n        // [\"S9183\"],\n        // [\"S9184\"],\n        // [\"S9185\"],\n        // [\"S9186\"],\n        // [\"S9187\"],\n        // [\"S9188\"],\n        // [\"S9189\"],\n        // [\"S9190\"],\n        // [\"S9191\"],\n        // [\"S9192\"],\n        // [\"S9193\"],\n        // [\"S9194\"],\n        // [\"S9195\"],\n        // [\"S9196\"],\n        // [\"S9197\"],\n        // [\"S9198\"],\n        // [\"S9199\"],\n        // [\"S9200\"],\n        // [\"S9201\"],\n        // [\"S9202\"],\n        // [\"S9203\"],\n        // [\"S9204\"],\n        // [\"S9205\"],\n        // [\"S9206\"],\n        // [\"S9207\"],\n        // [\"S9208\"],\n        // [\"S9209\"],\n        // [\"S9210\"],\n        // [\"S9211\"],\n        // [\"S9212\"],\n        // [\"S9213\"],\n        // [\"S9214\"],\n        // [\"S9215\"],\n        // [\"S9216\"],\n        // [\"S9217\"],\n        // [\"S9218\"],\n        // [\"S9219\"],\n        // [\"S9220\"],\n        // [\"S9221\"],\n        // [\"S9222\"],\n        // [\"S9223\"],\n        // [\"S9224\"],\n        // [\"S9225\"],\n        // [\"S9226\"],\n        // [\"S9227\"],\n        // [\"S9228\"],\n        // [\"S9229\"],\n        // [\"S9230\"],\n        // [\"S9231\"],\n        // [\"S9232\"],\n        // [\"S9233\"],\n        // [\"S9234\"],\n        // [\"S9235\"],\n        // [\"S9236\"],\n        // [\"S9237\"],\n        // [\"S9238\"],\n        // [\"S9239\"],\n        // [\"S9240\"],\n        // [\"S9241\"],\n        // [\"S9242\"],\n        // [\"S9243\"],\n        // [\"S9244\"],\n        // [\"S9245\"],\n        // [\"S9246\"],\n        // [\"S9247\"],\n        // [\"S9248\"],\n        // [\"S9249\"],\n        // [\"S9250\"],\n        // [\"S9251\"],\n        // [\"S9252\"],\n        // [\"S9253\"],\n        // [\"S9254\"],\n        // [\"S9255\"],\n        // [\"S9256\"],\n        // [\"S9257\"],\n        // [\"S9258\"],\n        // [\"S9259\"],\n        // [\"S9260\"],\n        // [\"S9261\"],\n        // [\"S9262\"],\n        // [\"S9263\"],\n        // [\"S9264\"],\n        // [\"S9265\"],\n        // [\"S9266\"],\n        // [\"S9267\"],\n        // [\"S9268\"],\n        // [\"S9269\"],\n        // [\"S9270\"],\n        // [\"S9271\"],\n        // [\"S9272\"],\n        // [\"S9273\"],\n        // [\"S9274\"],\n        // [\"S9275\"],\n        // [\"S9276\"],\n        // [\"S9277\"],\n        // [\"S9278\"],\n        // [\"S9279\"],\n        // [\"S9280\"],\n        // [\"S9281\"],\n        // [\"S9282\"],\n        // [\"S9283\"],\n        // [\"S9284\"],\n        // [\"S9285\"],\n        // [\"S9286\"],\n        // [\"S9287\"],\n        // [\"S9288\"],\n        // [\"S9289\"],\n        // [\"S9290\"],\n        // [\"S9291\"],\n        // [\"S9292\"],\n        // [\"S9293\"],\n        // [\"S9294\"],\n        // [\"S9295\"],\n        // [\"S9296\"],\n        // [\"S9297\"],\n        // [\"S9298\"],\n        // [\"S9299\"],\n        // [\"S9300\"],\n        // [\"S9301\"],\n        // [\"S9302\"],\n        // [\"S9303\"],\n        // [\"S9304\"],\n        // [\"S9305\"],\n        // [\"S9306\"],\n        // [\"S9307\"],\n        // [\"S9308\"],\n        // [\"S9309\"],\n        // [\"S9310\"],\n        // [\"S9311\"],\n        // [\"S9312\"],\n        // [\"S9313\"],\n        // [\"S9314\"],\n        // [\"S9315\"],\n        // [\"S9316\"],\n        // [\"S9317\"],\n        // [\"S9318\"],\n        // [\"S9319\"],\n        // [\"S9320\"],\n        // [\"S9321\"],\n        // [\"S9322\"],\n        // [\"S9323\"],\n        // [\"S9324\"],\n        // [\"S9325\"],\n        // [\"S9326\"],\n        // [\"S9327\"],\n        // [\"S9328\"],\n        // [\"S9329\"],\n        // [\"S9330\"],\n        // [\"S9331\"],\n        // [\"S9332\"],\n        // [\"S9333\"],\n        // [\"S9334\"],\n        // [\"S9335\"],\n        // [\"S9336\"],\n        // [\"S9337\"],\n        // [\"S9338\"],\n        // [\"S9339\"],\n        // [\"S9340\"],\n        // [\"S9341\"],\n        // [\"S9342\"],\n        // [\"S9343\"],\n        // [\"S9344\"],\n        // [\"S9345\"],\n        // [\"S9346\"],\n        // [\"S9347\"],\n        // [\"S9348\"],\n        // [\"S9349\"],\n        // [\"S9350\"],\n        // [\"S9351\"],\n        // [\"S9352\"],\n        // [\"S9353\"],\n        // [\"S9354\"],\n        // [\"S9355\"],\n        // [\"S9356\"],\n        // [\"S9357\"],\n        // [\"S9358\"],\n        // [\"S9359\"],\n        // [\"S9360\"],\n        // [\"S9361\"],\n        // [\"S9362\"],\n        // [\"S9363\"],\n        // [\"S9364\"],\n        // [\"S9365\"],\n        // [\"S9366\"],\n        // [\"S9367\"],\n        // [\"S9368\"],\n        // [\"S9369\"],\n        // [\"S9370\"],\n        // [\"S9371\"],\n        // [\"S9372\"],\n        // [\"S9373\"],\n        // [\"S9374\"],\n        // [\"S9375\"],\n        // [\"S9376\"],\n        // [\"S9377\"],\n        // [\"S9378\"],\n        // [\"S9379\"],\n        // [\"S9380\"],\n        // [\"S9381\"],\n        // [\"S9382\"],\n        // [\"S9383\"],\n        // [\"S9384\"],\n        // [\"S9385\"],\n        // [\"S9386\"],\n        // [\"S9387\"],\n        // [\"S9388\"],\n        // [\"S9389\"],\n        // [\"S9390\"],\n        // [\"S9391\"],\n        // [\"S9392\"],\n        // [\"S9393\"],\n        // [\"S9394\"],\n        // [\"S9395\"],\n        // [\"S9396\"],\n        // [\"S9397\"],\n        // [\"S9398\"],\n        // [\"S9399\"],\n        // [\"S9400\"],\n        // [\"S9401\"],\n        // [\"S9402\"],\n        // [\"S9403\"],\n        // [\"S9404\"],\n        // [\"S9405\"],\n        // [\"S9406\"],\n        // [\"S9407\"],\n        // [\"S9408\"],\n        // [\"S9409\"],\n        // [\"S9410\"],\n        // [\"S9411\"],\n        // [\"S9412\"],\n        // [\"S9413\"],\n        // [\"S9414\"],\n        // [\"S9415\"],\n        // [\"S9416\"],\n        // [\"S9417\"],\n        // [\"S9418\"],\n        // [\"S9419\"],\n        // [\"S9420\"],\n        // [\"S9421\"],\n        // [\"S9422\"],\n        // [\"S9423\"],\n        // [\"S9424\"],\n        // [\"S9425\"],\n        // [\"S9426\"],\n        // [\"S9427\"],\n        // [\"S9428\"],\n        // [\"S9429\"],\n        // [\"S9430\"],\n        // [\"S9431\"],\n        // [\"S9432\"],\n        // [\"S9433\"],\n        // [\"S9434\"],\n        // [\"S9435\"],\n        // [\"S9436\"],\n        // [\"S9437\"],\n        // [\"S9438\"],\n        // [\"S9439\"],\n        // [\"S9440\"],\n        // [\"S9441\"],\n        // [\"S9442\"],\n        // [\"S9443\"],\n        // [\"S9444\"],\n        // [\"S9445\"],\n        // [\"S9446\"],\n        // [\"S9447\"],\n        // [\"S9448\"],\n        // [\"S9449\"],\n        // [\"S9450\"],\n        // [\"S9451\"],\n        // [\"S9452\"],\n        // [\"S9453\"],\n        // [\"S9454\"],\n        // [\"S9455\"],\n        // [\"S9456\"],\n        // [\"S9457\"],\n        // [\"S9458\"],\n        // [\"S9459\"],\n        // [\"S9460\"],\n        // [\"S9461\"],\n        // [\"S9462\"],\n        // [\"S9463\"],\n        // [\"S9464\"],\n        // [\"S9465\"],\n        // [\"S9466\"],\n        // [\"S9467\"],\n        // [\"S9468\"],\n        // [\"S9469\"],\n        // [\"S9470\"],\n        // [\"S9471\"],\n        // [\"S9472\"],\n        // [\"S9473\"],\n        // [\"S9474\"],\n        // [\"S9475\"],\n        // [\"S9476\"],\n        // [\"S9477\"],\n        // [\"S9478\"],\n        // [\"S9479\"],\n        // [\"S9480\"],\n        // [\"S9481\"],\n        // [\"S9482\"],\n        // [\"S9483\"],\n        // [\"S9484\"],\n        // [\"S9485\"],\n        // [\"S9486\"],\n        // [\"S9487\"],\n        // [\"S9488\"],\n        // [\"S9489\"],\n        // [\"S9490\"],\n        // [\"S9491\"],\n        // [\"S9492\"],\n        // [\"S9493\"],\n        // [\"S9494\"],\n        // [\"S9495\"],\n        // [\"S9496\"],\n        // [\"S9497\"],\n        // [\"S9498\"],\n        // [\"S9499\"],\n        // [\"S9500\"],\n        // [\"S9501\"],\n        // [\"S9502\"],\n        // [\"S9503\"],\n        // [\"S9504\"],\n        // [\"S9505\"],\n        // [\"S9506\"],\n        // [\"S9507\"],\n        // [\"S9508\"],\n        // [\"S9509\"],\n        // [\"S9510\"],\n        // [\"S9511\"],\n        // [\"S9512\"],\n        // [\"S9513\"],\n        // [\"S9514\"],\n        // [\"S9515\"],\n        // [\"S9516\"],\n        // [\"S9517\"],\n        // [\"S9518\"],\n        // [\"S9519\"],\n        // [\"S9520\"],\n        // [\"S9521\"],\n        // [\"S9522\"],\n        // [\"S9523\"],\n        // [\"S9524\"],\n        // [\"S9525\"],\n        // [\"S9526\"],\n        // [\"S9527\"],\n        // [\"S9528\"],\n        // [\"S9529\"],\n        // [\"S9530\"],\n        // [\"S9531\"],\n        // [\"S9532\"],\n        // [\"S9533\"],\n        // [\"S9534\"],\n        // [\"S9535\"],\n        // [\"S9536\"],\n        // [\"S9537\"],\n        // [\"S9538\"],\n        // [\"S9539\"],\n        // [\"S9540\"],\n        // [\"S9541\"],\n        // [\"S9542\"],\n        // [\"S9543\"],\n        // [\"S9544\"],\n        // [\"S9545\"],\n        // [\"S9546\"],\n        // [\"S9547\"],\n        // [\"S9548\"],\n        // [\"S9549\"],\n        // [\"S9550\"],\n        // [\"S9551\"],\n        // [\"S9552\"],\n        // [\"S9553\"],\n        // [\"S9554\"],\n        // [\"S9555\"],\n        // [\"S9556\"],\n        // [\"S9557\"],\n        // [\"S9558\"],\n        // [\"S9559\"],\n        // [\"S9560\"],\n        // [\"S9561\"],\n        // [\"S9562\"],\n        // [\"S9563\"],\n        // [\"S9564\"],\n        // [\"S9565\"],\n        // [\"S9566\"],\n        // [\"S9567\"],\n        // [\"S9568\"],\n        // [\"S9569\"],\n        // [\"S9570\"],\n        // [\"S9571\"],\n        // [\"S9572\"],\n        // [\"S9573\"],\n        // [\"S9574\"],\n        // [\"S9575\"],\n        // [\"S9576\"],\n        // [\"S9577\"],\n        // [\"S9578\"],\n        // [\"S9579\"],\n        // [\"S9580\"],\n        // [\"S9581\"],\n        // [\"S9582\"],\n        // [\"S9583\"],\n        // [\"S9584\"],\n        // [\"S9585\"],\n        // [\"S9586\"],\n        // [\"S9587\"],\n        // [\"S9588\"],\n        // [\"S9589\"],\n        // [\"S9590\"],\n        // [\"S9591\"],\n        // [\"S9592\"],\n        // [\"S9593\"],\n        // [\"S9594\"],\n        // [\"S9595\"],\n        // [\"S9596\"],\n        // [\"S9597\"],\n        // [\"S9598\"],\n        // [\"S9599\"],\n        // [\"S9600\"],\n        // [\"S9601\"],\n        // [\"S9602\"],\n        // [\"S9603\"],\n        // [\"S9604\"],\n        // [\"S9605\"],\n        // [\"S9606\"],\n        // [\"S9607\"],\n        // [\"S9608\"],\n        // [\"S9609\"],\n        // [\"S9610\"],\n        // [\"S9611\"],\n        // [\"S9612\"],\n        // [\"S9613\"],\n        // [\"S9614\"],\n        // [\"S9615\"],\n        // [\"S9616\"],\n        // [\"S9617\"],\n        // [\"S9618\"],\n        // [\"S9619\"],\n        // [\"S9620\"],\n        // [\"S9621\"],\n        // [\"S9622\"],\n        // [\"S9623\"],\n        // [\"S9624\"],\n        // [\"S9625\"],\n        // [\"S9626\"],\n        // [\"S9627\"],\n        // [\"S9628\"],\n        // [\"S9629\"],\n        // [\"S9630\"],\n        // [\"S9631\"],\n        // [\"S9632\"],\n        // [\"S9633\"],\n        // [\"S9634\"],\n        // [\"S9635\"],\n        // [\"S9636\"],\n        // [\"S9637\"],\n        // [\"S9638\"],\n        // [\"S9639\"],\n        // [\"S9640\"],\n        // [\"S9641\"],\n        // [\"S9642\"],\n        // [\"S9643\"],\n        // [\"S9644\"],\n        // [\"S9645\"],\n        // [\"S9646\"],\n        // [\"S9647\"],\n        // [\"S9648\"],\n        // [\"S9649\"],\n        // [\"S9650\"],\n        // [\"S9651\"],\n        // [\"S9652\"],\n        // [\"S9653\"],\n        // [\"S9654\"],\n        // [\"S9655\"],\n        // [\"S9656\"],\n        // [\"S9657\"],\n        // [\"S9658\"],\n        // [\"S9659\"],\n        // [\"S9660\"],\n        // [\"S9661\"],\n        // [\"S9662\"],\n        // [\"S9663\"],\n        // [\"S9664\"],\n        // [\"S9665\"],\n        // [\"S9666\"],\n        // [\"S9667\"],\n        // [\"S9668\"],\n        // [\"S9669\"],\n        // [\"S9670\"],\n        // [\"S9671\"],\n        // [\"S9672\"],\n        // [\"S9673\"],\n        // [\"S9674\"],\n        // [\"S9675\"],\n        // [\"S9676\"],\n        // [\"S9677\"],\n        // [\"S9678\"],\n        // [\"S9679\"],\n        // [\"S9680\"],\n        // [\"S9681\"],\n        // [\"S9682\"],\n        // [\"S9683\"],\n        // [\"S9684\"],\n        // [\"S9685\"],\n        // [\"S9686\"],\n        // [\"S9687\"],\n        // [\"S9688\"],\n        // [\"S9689\"],\n        // [\"S9690\"],\n        // [\"S9691\"],\n        // [\"S9692\"],\n        // [\"S9693\"],\n        // [\"S9694\"],\n        // [\"S9695\"],\n        // [\"S9696\"],\n        // [\"S9697\"],\n        // [\"S9698\"],\n        // [\"S9699\"],\n        // [\"S9700\"],\n        // [\"S9701\"],\n        // [\"S9702\"],\n        // [\"S9703\"],\n        // [\"S9704\"],\n        // [\"S9705\"],\n        // [\"S9706\"],\n        // [\"S9707\"],\n        // [\"S9708\"],\n        // [\"S9709\"],\n        // [\"S9710\"],\n        // [\"S9711\"],\n        // [\"S9712\"],\n        // [\"S9713\"],\n        // [\"S9714\"],\n        // [\"S9715\"],\n        // [\"S9716\"],\n        // [\"S9717\"],\n        // [\"S9718\"],\n        // [\"S9719\"],\n        // [\"S9720\"],\n        // [\"S9721\"],\n        // [\"S9722\"],\n        // [\"S9723\"],\n        // [\"S9724\"],\n        // [\"S9725\"],\n        // [\"S9726\"],\n        // [\"S9727\"],\n        // [\"S9728\"],\n        // [\"S9729\"],\n        // [\"S9730\"],\n        // [\"S9731\"],\n        // [\"S9732\"],\n        // [\"S9733\"],\n        // [\"S9734\"],\n        // [\"S9735\"],\n        // [\"S9736\"],\n        // [\"S9737\"],\n        // [\"S9738\"],\n        // [\"S9739\"],\n        // [\"S9740\"],\n        // [\"S9741\"],\n        // [\"S9742\"],\n        // [\"S9743\"],\n        // [\"S9744\"],\n        // [\"S9745\"],\n        // [\"S9746\"],\n        // [\"S9747\"],\n        // [\"S9748\"],\n        // [\"S9749\"],\n        // [\"S9750\"],\n        // [\"S9751\"],\n        // [\"S9752\"],\n        // [\"S9753\"],\n        // [\"S9754\"],\n        // [\"S9755\"],\n        // [\"S9756\"],\n        // [\"S9757\"],\n        // [\"S9758\"],\n        // [\"S9759\"],\n        // [\"S9760\"],\n        // [\"S9761\"],\n        // [\"S9762\"],\n        // [\"S9763\"],\n        // [\"S9764\"],\n        // [\"S9765\"],\n        // [\"S9766\"],\n        // [\"S9767\"],\n        // [\"S9768\"],\n        // [\"S9769\"],\n        // [\"S9770\"],\n        // [\"S9771\"],\n        // [\"S9772\"],\n        // [\"S9773\"],\n        // [\"S9774\"],\n        // [\"S9775\"],\n        // [\"S9776\"],\n        // [\"S9777\"],\n        // [\"S9778\"],\n        // [\"S9779\"],\n        // [\"S9780\"],\n        // [\"S9781\"],\n        // [\"S9782\"],\n        // [\"S9783\"],\n        // [\"S9784\"],\n        // [\"S9785\"],\n        // [\"S9786\"],\n        // [\"S9787\"],\n        // [\"S9788\"],\n        // [\"S9789\"],\n        // [\"S9790\"],\n        // [\"S9791\"],\n        // [\"S9792\"],\n        // [\"S9793\"],\n        // [\"S9794\"],\n        // [\"S9795\"],\n        // [\"S9796\"],\n        // [\"S9797\"],\n        // [\"S9798\"],\n        // [\"S9799\"],\n        // [\"S9800\"],\n        // [\"S9801\"],\n        // [\"S9802\"],\n        // [\"S9803\"],\n        // [\"S9804\"],\n        // [\"S9805\"],\n        // [\"S9806\"],\n        // [\"S9807\"],\n        // [\"S9808\"],\n        // [\"S9809\"],\n        // [\"S9810\"],\n        // [\"S9811\"],\n        // [\"S9812\"],\n        // [\"S9813\"],\n        // [\"S9814\"],\n        // [\"S9815\"],\n        // [\"S9816\"],\n        // [\"S9817\"],\n        // [\"S9818\"],\n        // [\"S9819\"],\n        // [\"S9820\"],\n        // [\"S9821\"],\n        // [\"S9822\"],\n        // [\"S9823\"],\n        // [\"S9824\"],\n        // [\"S9825\"],\n        // [\"S9826\"],\n        // [\"S9827\"],\n        // [\"S9828\"],\n        // [\"S9829\"],\n        // [\"S9830\"],\n        // [\"S9831\"],\n        // [\"S9832\"],\n        // [\"S9833\"],\n        // [\"S9834\"],\n        // [\"S9835\"],\n        // [\"S9836\"],\n        // [\"S9837\"],\n        // [\"S9838\"],\n        // [\"S9839\"],\n        // [\"S9840\"],\n        // [\"S9841\"],\n        // [\"S9842\"],\n        // [\"S9843\"],\n        // [\"S9844\"],\n        // [\"S9845\"],\n        // [\"S9846\"],\n        // [\"S9847\"],\n        // [\"S9848\"],\n        // [\"S9849\"],\n        // [\"S9850\"],\n        // [\"S9851\"],\n        // [\"S9852\"],\n        // [\"S9853\"],\n        // [\"S9854\"],\n        // [\"S9855\"],\n        // [\"S9856\"],\n        // [\"S9857\"],\n        // [\"S9858\"],\n        // [\"S9859\"],\n        // [\"S9860\"],\n        // [\"S9861\"],\n        // [\"S9862\"],\n        // [\"S9863\"],\n        // [\"S9864\"],\n        // [\"S9865\"],\n        // [\"S9866\"],\n        // [\"S9867\"],\n        // [\"S9868\"],\n        // [\"S9869\"],\n        // [\"S9870\"],\n        // [\"S9871\"],\n        // [\"S9872\"],\n        // [\"S9873\"],\n        // [\"S9874\"],\n        // [\"S9875\"],\n        // [\"S9876\"],\n        // [\"S9877\"],\n        // [\"S9878\"],\n        // [\"S9879\"],\n        // [\"S9880\"],\n        // [\"S9881\"],\n        // [\"S9882\"],\n        // [\"S9883\"],\n        // [\"S9884\"],\n        // [\"S9885\"],\n        // [\"S9886\"],\n        // [\"S9887\"],\n        // [\"S9888\"],\n        // [\"S9889\"],\n        // [\"S9890\"],\n        // [\"S9891\"],\n        // [\"S9892\"],\n        // [\"S9893\"],\n        // [\"S9894\"],\n        // [\"S9895\"],\n        // [\"S9896\"],\n        // [\"S9897\"],\n        // [\"S9898\"],\n        // [\"S9899\"],\n        // [\"S9900\"],\n        // [\"S9901\"],\n        // [\"S9902\"],\n        // [\"S9903\"],\n        // [\"S9904\"],\n        // [\"S9905\"],\n        // [\"S9906\"],\n        // [\"S9907\"],\n        // [\"S9908\"],\n        // [\"S9909\"],\n        // [\"S9910\"],\n        // [\"S9911\"],\n        // [\"S9912\"],\n        // [\"S9913\"],\n        // [\"S9914\"],\n        // [\"S9915\"],\n        // [\"S9916\"],\n        // [\"S9917\"],\n        // [\"S9918\"],\n        // [\"S9919\"],\n        // [\"S9920\"],\n        // [\"S9921\"],\n        // [\"S9922\"],\n        // [\"S9923\"],\n        // [\"S9924\"],\n        // [\"S9925\"],\n        // [\"S9926\"],\n        // [\"S9927\"],\n        // [\"S9928\"],\n        // [\"S9929\"],\n        // [\"S9930\"],\n        // [\"S9931\"],\n        // [\"S9932\"],\n        // [\"S9933\"],\n        // [\"S9934\"],\n        // [\"S9935\"],\n        // [\"S9936\"],\n        // [\"S9937\"],\n        // [\"S9938\"],\n        // [\"S9939\"],\n        // [\"S9940\"],\n        // [\"S9941\"],\n        // [\"S9942\"],\n        // [\"S9943\"],\n        // [\"S9944\"],\n        // [\"S9945\"],\n        // [\"S9946\"],\n        // [\"S9947\"],\n        // [\"S9948\"],\n        // [\"S9949\"],\n        // [\"S9950\"],\n        // [\"S9951\"],\n        // [\"S9952\"],\n        // [\"S9953\"],\n        // [\"S9954\"],\n        // [\"S9955\"],\n        // [\"S9956\"],\n        // [\"S9957\"],\n        // [\"S9958\"],\n        // [\"S9959\"],\n        // [\"S9960\"],\n        // [\"S9961\"],\n        // [\"S9962\"],\n        // [\"S9963\"],\n        // [\"S9964\"],\n        // [\"S9965\"],\n        // [\"S9966\"],\n        // [\"S9967\"],\n        // [\"S9968\"],\n        // [\"S9969\"],\n        // [\"S9970\"],\n        // [\"S9971\"],\n        // [\"S9972\"],\n        // [\"S9973\"],\n        // [\"S9974\"],\n        // [\"S9975\"],\n        // [\"S9976\"],\n        // [\"S9977\"],\n        // [\"S9978\"],\n        // [\"S9979\"],\n        // [\"S9980\"],\n        // [\"S9981\"],\n        // [\"S9982\"],\n        // [\"S9983\"],\n        // [\"S9984\"],\n        // [\"S9985\"],\n        // [\"S9986\"],\n        // [\"S9987\"],\n        // [\"S9988\"],\n        // [\"S9989\"],\n        // [\"S9990\"],\n        // [\"S9991\"],\n        // [\"S9992\"],\n        // [\"S9993\"],\n        // [\"S9994\"],\n        // [\"S9995\"],\n        // [\"S9996\"],\n        // [\"S9997\"],\n        // [\"S9998\"],\n        // [\"S9999\"]\n    }.ToImmutableDictionary();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Packaging/RuleTypeMappingVB.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.TestFramework.Packaging;\n\npublic static class RuleTypeMappingVB\n{\n    public static readonly IImmutableDictionary<string, string> Rules = new Dictionary<string, string>\n    {\n        // [\"S100\"],\n        [\"S101\"] = \"CODE_SMELL\",\n        // [\"S102\"],\n        [\"S103\"] = \"CODE_SMELL\",\n        [\"S104\"] = \"CODE_SMELL\",\n        [\"S105\"] = \"CODE_SMELL\",\n        // [\"S106\"],\n        [\"S107\"] = \"CODE_SMELL\",\n        [\"S108\"] = \"CODE_SMELL\",\n        // [\"S109\"],\n        // [\"S110\"],\n        // [\"S111\"],\n        [\"S112\"] = \"CODE_SMELL\",\n        // [\"S113\"],\n        [\"S114\"] = \"CODE_SMELL\",\n        // [\"S115\"],\n        // [\"S116\"],\n        [\"S117\"] = \"CODE_SMELL\",\n        // [\"S118\"],\n        [\"S119\"] = \"CODE_SMELL\",\n        // [\"S120\"],\n        // [\"S121\"],\n        [\"S122\"] = \"CODE_SMELL\",\n        // [\"S123\"],\n        // [\"S124\"],\n        // [\"S125\"],\n        [\"S126\"] = \"CODE_SMELL\",\n        // [\"S127\"],\n        // [\"S128\"],\n        // [\"S129\"],\n        // [\"S130\"],\n        [\"S131\"] = \"CODE_SMELL\",\n        // [\"S132\"],\n        // [\"S133\"],\n        [\"S134\"] = \"CODE_SMELL\",\n        // [\"S135\"],\n        // [\"S136\"],\n        // [\"S137\"],\n        [\"S138\"] = \"CODE_SMELL\",\n        [\"S139\"] = \"CODE_SMELL\",\n        // [\"S140\"],\n        // [\"S141\"],\n        // [\"S142\"],\n        // [\"S143\"],\n        // [\"S144\"],\n        // [\"S145\"],\n        // [\"S146\"],\n        // [\"S147\"],\n        // [\"S148\"],\n        // [\"S149\"],\n        // [\"S150\"],\n        // [\"S151\"],\n        // [\"S152\"],\n        // [\"S153\"],\n        // [\"S154\"],\n        // [\"S155\"],\n        // [\"S156\"],\n        // [\"S157\"],\n        // [\"S158\"],\n        // [\"S159\"],\n        // [\"S160\"],\n        // [\"S161\"],\n        // [\"S162\"],\n        // [\"S163\"],\n        // [\"S164\"],\n        // [\"S165\"],\n        // [\"S166\"],\n        // [\"S167\"],\n        // [\"S168\"],\n        // [\"S169\"],\n        // [\"S170\"],\n        // [\"S171\"],\n        // [\"S172\"],\n        // [\"S173\"],\n        // [\"S174\"],\n        // [\"S175\"],\n        // [\"S176\"],\n        // [\"S177\"],\n        // [\"S178\"],\n        // [\"S179\"],\n        // [\"S180\"],\n        // [\"S181\"],\n        // [\"S182\"],\n        // [\"S183\"],\n        // [\"S184\"],\n        // [\"S185\"],\n        // [\"S186\"],\n        // [\"S187\"],\n        // [\"S188\"],\n        // [\"S189\"],\n        // [\"S190\"],\n        // [\"S191\"],\n        // [\"S192\"],\n        // [\"S193\"],\n        // [\"S194\"],\n        // [\"S195\"],\n        // [\"S196\"],\n        // [\"S197\"],\n        // [\"S198\"],\n        // [\"S199\"],\n        // [\"S200\"],\n        // [\"S201\"],\n        // [\"S202\"],\n        // [\"S203\"],\n        // [\"S204\"],\n        // [\"S205\"],\n        // [\"S206\"],\n        // [\"S207\"],\n        // [\"S208\"],\n        // [\"S209\"],\n        // [\"S210\"],\n        // [\"S211\"],\n        // [\"S212\"],\n        // [\"S213\"],\n        // [\"S214\"],\n        // [\"S215\"],\n        // [\"S216\"],\n        // [\"S217\"],\n        // [\"S218\"],\n        // [\"S219\"],\n        // [\"S220\"],\n        // [\"S221\"],\n        // [\"S222\"],\n        // [\"S223\"],\n        // [\"S224\"],\n        // [\"S225\"],\n        // [\"S226\"],\n        // [\"S227\"],\n        // [\"S228\"],\n        // [\"S229\"],\n        // [\"S230\"],\n        // [\"S231\"],\n        // [\"S232\"],\n        // [\"S233\"],\n        // [\"S234\"],\n        // [\"S235\"],\n        // [\"S236\"],\n        // [\"S237\"],\n        // [\"S238\"],\n        // [\"S239\"],\n        // [\"S240\"],\n        // [\"S241\"],\n        // [\"S242\"],\n        // [\"S243\"],\n        // [\"S244\"],\n        // [\"S245\"],\n        // [\"S246\"],\n        // [\"S247\"],\n        // [\"S248\"],\n        // [\"S249\"],\n        // [\"S250\"],\n        // [\"S251\"],\n        // [\"S252\"],\n        // [\"S253\"],\n        // [\"S254\"],\n        // [\"S255\"],\n        // [\"S256\"],\n        // [\"S257\"],\n        // [\"S258\"],\n        // [\"S259\"],\n        // [\"S260\"],\n        // [\"S261\"],\n        // [\"S262\"],\n        // [\"S263\"],\n        // [\"S264\"],\n        // [\"S265\"],\n        // [\"S266\"],\n        // [\"S267\"],\n        // [\"S268\"],\n        // [\"S269\"],\n        // [\"S270\"],\n        // [\"S271\"],\n        // [\"S272\"],\n        // [\"S273\"],\n        // [\"S274\"],\n        // [\"S275\"],\n        // [\"S276\"],\n        // [\"S277\"],\n        // [\"S278\"],\n        // [\"S279\"],\n        // [\"S280\"],\n        // [\"S281\"],\n        // [\"S282\"],\n        // [\"S283\"],\n        // [\"S284\"],\n        // [\"S285\"],\n        // [\"S286\"],\n        // [\"S287\"],\n        // [\"S288\"],\n        // [\"S289\"],\n        // [\"S290\"],\n        // [\"S291\"],\n        // [\"S292\"],\n        // [\"S293\"],\n        // [\"S294\"],\n        // [\"S295\"],\n        // [\"S296\"],\n        // [\"S297\"],\n        // [\"S298\"],\n        // [\"S299\"],\n        // [\"S300\"],\n        // [\"S301\"],\n        // [\"S302\"],\n        // [\"S303\"],\n        // [\"S304\"],\n        // [\"S305\"],\n        // [\"S306\"],\n        // [\"S307\"],\n        // [\"S308\"],\n        // [\"S309\"],\n        // [\"S310\"],\n        // [\"S311\"],\n        // [\"S312\"],\n        // [\"S313\"],\n        // [\"S314\"],\n        // [\"S315\"],\n        // [\"S316\"],\n        // [\"S317\"],\n        // [\"S318\"],\n        // [\"S319\"],\n        // [\"S320\"],\n        // [\"S321\"],\n        // [\"S322\"],\n        // [\"S323\"],\n        // [\"S324\"],\n        // [\"S325\"],\n        // [\"S326\"],\n        // [\"S327\"],\n        // [\"S328\"],\n        // [\"S329\"],\n        // [\"S330\"],\n        // [\"S331\"],\n        // [\"S332\"],\n        // [\"S333\"],\n        // [\"S334\"],\n        // [\"S335\"],\n        // [\"S336\"],\n        // [\"S337\"],\n        // [\"S338\"],\n        // [\"S339\"],\n        // [\"S340\"],\n        // [\"S341\"],\n        // [\"S342\"],\n        // [\"S343\"],\n        // [\"S344\"],\n        // [\"S345\"],\n        // [\"S346\"],\n        // [\"S347\"],\n        // [\"S348\"],\n        // [\"S349\"],\n        // [\"S350\"],\n        // [\"S351\"],\n        // [\"S352\"],\n        // [\"S353\"],\n        // [\"S354\"],\n        // [\"S355\"],\n        // [\"S356\"],\n        // [\"S357\"],\n        // [\"S358\"],\n        // [\"S359\"],\n        // [\"S360\"],\n        // [\"S361\"],\n        // [\"S362\"],\n        // [\"S363\"],\n        // [\"S364\"],\n        // [\"S365\"],\n        // [\"S366\"],\n        // [\"S367\"],\n        // [\"S368\"],\n        // [\"S369\"],\n        // [\"S370\"],\n        // [\"S371\"],\n        // [\"S372\"],\n        // [\"S373\"],\n        // [\"S374\"],\n        // [\"S375\"],\n        // [\"S376\"],\n        // [\"S377\"],\n        // [\"S378\"],\n        // [\"S379\"],\n        // [\"S380\"],\n        // [\"S381\"],\n        // [\"S382\"],\n        // [\"S383\"],\n        // [\"S384\"],\n        // [\"S385\"],\n        // [\"S386\"],\n        // [\"S387\"],\n        // [\"S388\"],\n        // [\"S389\"],\n        // [\"S390\"],\n        // [\"S391\"],\n        // [\"S392\"],\n        // [\"S393\"],\n        // [\"S394\"],\n        // [\"S395\"],\n        // [\"S396\"],\n        // [\"S397\"],\n        // [\"S398\"],\n        // [\"S399\"],\n        // [\"S400\"],\n        // [\"S401\"],\n        // [\"S402\"],\n        // [\"S403\"],\n        // [\"S404\"],\n        // [\"S405\"],\n        // [\"S406\"],\n        // [\"S407\"],\n        // [\"S408\"],\n        // [\"S409\"],\n        // [\"S410\"],\n        // [\"S411\"],\n        // [\"S412\"],\n        // [\"S413\"],\n        // [\"S414\"],\n        // [\"S415\"],\n        // [\"S416\"],\n        // [\"S417\"],\n        // [\"S418\"],\n        // [\"S419\"],\n        // [\"S420\"],\n        // [\"S421\"],\n        // [\"S422\"],\n        // [\"S423\"],\n        // [\"S424\"],\n        // [\"S425\"],\n        // [\"S426\"],\n        // [\"S427\"],\n        // [\"S428\"],\n        // [\"S429\"],\n        // [\"S430\"],\n        // [\"S431\"],\n        // [\"S432\"],\n        // [\"S433\"],\n        // [\"S434\"],\n        // [\"S435\"],\n        // [\"S436\"],\n        // [\"S437\"],\n        // [\"S438\"],\n        // [\"S439\"],\n        // [\"S440\"],\n        // [\"S441\"],\n        // [\"S442\"],\n        // [\"S443\"],\n        // [\"S444\"],\n        // [\"S445\"],\n        // [\"S446\"],\n        // [\"S447\"],\n        // [\"S448\"],\n        // [\"S449\"],\n        // [\"S450\"],\n        // [\"S451\"],\n        // [\"S452\"],\n        // [\"S453\"],\n        // [\"S454\"],\n        // [\"S455\"],\n        // [\"S456\"],\n        // [\"S457\"],\n        // [\"S458\"],\n        // [\"S459\"],\n        // [\"S460\"],\n        // [\"S461\"],\n        // [\"S462\"],\n        // [\"S463\"],\n        // [\"S464\"],\n        // [\"S465\"],\n        // [\"S466\"],\n        // [\"S467\"],\n        // [\"S468\"],\n        // [\"S469\"],\n        // [\"S470\"],\n        // [\"S471\"],\n        // [\"S472\"],\n        // [\"S473\"],\n        // [\"S474\"],\n        // [\"S475\"],\n        // [\"S476\"],\n        // [\"S477\"],\n        // [\"S478\"],\n        // [\"S479\"],\n        // [\"S480\"],\n        // [\"S481\"],\n        // [\"S482\"],\n        // [\"S483\"],\n        // [\"S484\"],\n        // [\"S485\"],\n        // [\"S486\"],\n        // [\"S487\"],\n        // [\"S488\"],\n        // [\"S489\"],\n        // [\"S490\"],\n        // [\"S491\"],\n        // [\"S492\"],\n        // [\"S493\"],\n        // [\"S494\"],\n        // [\"S495\"],\n        // [\"S496\"],\n        // [\"S497\"],\n        // [\"S498\"],\n        // [\"S499\"],\n        // [\"S500\"],\n        // [\"S501\"],\n        // [\"S502\"],\n        // [\"S503\"],\n        // [\"S504\"],\n        // [\"S505\"],\n        // [\"S506\"],\n        // [\"S507\"],\n        // [\"S508\"],\n        // [\"S509\"],\n        // [\"S510\"],\n        // [\"S511\"],\n        // [\"S512\"],\n        // [\"S513\"],\n        // [\"S514\"],\n        // [\"S515\"],\n        // [\"S516\"],\n        // [\"S517\"],\n        // [\"S518\"],\n        // [\"S519\"],\n        // [\"S520\"],\n        // [\"S521\"],\n        // [\"S522\"],\n        // [\"S523\"],\n        // [\"S524\"],\n        // [\"S525\"],\n        // [\"S526\"],\n        // [\"S527\"],\n        // [\"S528\"],\n        // [\"S529\"],\n        // [\"S530\"],\n        // [\"S531\"],\n        // [\"S532\"],\n        // [\"S533\"],\n        // [\"S534\"],\n        // [\"S535\"],\n        // [\"S536\"],\n        // [\"S537\"],\n        // [\"S538\"],\n        // [\"S539\"],\n        // [\"S540\"],\n        // [\"S541\"],\n        // [\"S542\"],\n        // [\"S543\"],\n        // [\"S544\"],\n        // [\"S545\"],\n        // [\"S546\"],\n        // [\"S547\"],\n        // [\"S548\"],\n        // [\"S549\"],\n        // [\"S550\"],\n        // [\"S551\"],\n        // [\"S552\"],\n        // [\"S553\"],\n        // [\"S554\"],\n        // [\"S555\"],\n        // [\"S556\"],\n        // [\"S557\"],\n        // [\"S558\"],\n        // [\"S559\"],\n        // [\"S560\"],\n        // [\"S561\"],\n        // [\"S562\"],\n        // [\"S563\"],\n        // [\"S564\"],\n        // [\"S565\"],\n        // [\"S566\"],\n        // [\"S567\"],\n        // [\"S568\"],\n        // [\"S569\"],\n        // [\"S570\"],\n        // [\"S571\"],\n        // [\"S572\"],\n        // [\"S573\"],\n        // [\"S574\"],\n        // [\"S575\"],\n        // [\"S576\"],\n        // [\"S577\"],\n        // [\"S578\"],\n        // [\"S579\"],\n        // [\"S580\"],\n        // [\"S581\"],\n        // [\"S582\"],\n        // [\"S583\"],\n        // [\"S584\"],\n        // [\"S585\"],\n        // [\"S586\"],\n        // [\"S587\"],\n        // [\"S588\"],\n        // [\"S589\"],\n        // [\"S590\"],\n        // [\"S591\"],\n        // [\"S592\"],\n        // [\"S593\"],\n        // [\"S594\"],\n        // [\"S595\"],\n        // [\"S596\"],\n        // [\"S597\"],\n        // [\"S598\"],\n        // [\"S599\"],\n        // [\"S600\"],\n        // [\"S601\"],\n        // [\"S602\"],\n        // [\"S603\"],\n        // [\"S604\"],\n        // [\"S605\"],\n        // [\"S606\"],\n        // [\"S607\"],\n        // [\"S608\"],\n        // [\"S609\"],\n        // [\"S610\"],\n        // [\"S611\"],\n        // [\"S612\"],\n        // [\"S613\"],\n        // [\"S614\"],\n        // [\"S615\"],\n        // [\"S616\"],\n        // [\"S617\"],\n        // [\"S618\"],\n        // [\"S619\"],\n        // [\"S620\"],\n        // [\"S621\"],\n        // [\"S622\"],\n        // [\"S623\"],\n        // [\"S624\"],\n        // [\"S625\"],\n        // [\"S626\"],\n        // [\"S627\"],\n        // [\"S628\"],\n        // [\"S629\"],\n        // [\"S630\"],\n        // [\"S631\"],\n        // [\"S632\"],\n        // [\"S633\"],\n        // [\"S634\"],\n        // [\"S635\"],\n        // [\"S636\"],\n        // [\"S637\"],\n        // [\"S638\"],\n        // [\"S639\"],\n        // [\"S640\"],\n        // [\"S641\"],\n        // [\"S642\"],\n        // [\"S643\"],\n        // [\"S644\"],\n        // [\"S645\"],\n        // [\"S646\"],\n        // [\"S647\"],\n        // [\"S648\"],\n        // [\"S649\"],\n        // [\"S650\"],\n        // [\"S651\"],\n        // [\"S652\"],\n        // [\"S653\"],\n        // [\"S654\"],\n        // [\"S655\"],\n        // [\"S656\"],\n        // [\"S657\"],\n        // [\"S658\"],\n        // [\"S659\"],\n        // [\"S660\"],\n        // [\"S661\"],\n        // [\"S662\"],\n        // [\"S663\"],\n        // [\"S664\"],\n        // [\"S665\"],\n        // [\"S666\"],\n        // [\"S667\"],\n        // [\"S668\"],\n        // [\"S669\"],\n        // [\"S670\"],\n        // [\"S671\"],\n        // [\"S672\"],\n        // [\"S673\"],\n        // [\"S674\"],\n        // [\"S675\"],\n        // [\"S676\"],\n        // [\"S677\"],\n        // [\"S678\"],\n        // [\"S679\"],\n        // [\"S680\"],\n        // [\"S681\"],\n        // [\"S682\"],\n        // [\"S683\"],\n        // [\"S684\"],\n        // [\"S685\"],\n        // [\"S686\"],\n        // [\"S687\"],\n        // [\"S688\"],\n        // [\"S689\"],\n        // [\"S690\"],\n        // [\"S691\"],\n        // [\"S692\"],\n        // [\"S693\"],\n        // [\"S694\"],\n        // [\"S695\"],\n        // [\"S696\"],\n        // [\"S697\"],\n        // [\"S698\"],\n        // [\"S699\"],\n        // [\"S700\"],\n        // [\"S701\"],\n        // [\"S702\"],\n        // [\"S703\"],\n        // [\"S704\"],\n        // [\"S705\"],\n        // [\"S706\"],\n        // [\"S707\"],\n        // [\"S708\"],\n        // [\"S709\"],\n        // [\"S710\"],\n        // [\"S711\"],\n        // [\"S712\"],\n        // [\"S713\"],\n        // [\"S714\"],\n        // [\"S715\"],\n        // [\"S716\"],\n        // [\"S717\"],\n        // [\"S718\"],\n        // [\"S719\"],\n        // [\"S720\"],\n        // [\"S721\"],\n        // [\"S722\"],\n        // [\"S723\"],\n        // [\"S724\"],\n        // [\"S725\"],\n        // [\"S726\"],\n        // [\"S727\"],\n        // [\"S728\"],\n        // [\"S729\"],\n        // [\"S730\"],\n        // [\"S731\"],\n        // [\"S732\"],\n        // [\"S733\"],\n        // [\"S734\"],\n        // [\"S735\"],\n        // [\"S736\"],\n        // [\"S737\"],\n        // [\"S738\"],\n        // [\"S739\"],\n        // [\"S740\"],\n        // [\"S741\"],\n        // [\"S742\"],\n        // [\"S743\"],\n        // [\"S744\"],\n        // [\"S745\"],\n        // [\"S746\"],\n        // [\"S747\"],\n        // [\"S748\"],\n        // [\"S749\"],\n        // [\"S750\"],\n        // [\"S751\"],\n        // [\"S752\"],\n        // [\"S753\"],\n        // [\"S754\"],\n        // [\"S755\"],\n        // [\"S756\"],\n        // [\"S757\"],\n        // [\"S758\"],\n        // [\"S759\"],\n        // [\"S760\"],\n        // [\"S761\"],\n        // [\"S762\"],\n        // [\"S763\"],\n        // [\"S764\"],\n        // [\"S765\"],\n        // [\"S766\"],\n        // [\"S767\"],\n        // [\"S768\"],\n        // [\"S769\"],\n        // [\"S770\"],\n        // [\"S771\"],\n        // [\"S772\"],\n        // [\"S773\"],\n        // [\"S774\"],\n        // [\"S775\"],\n        // [\"S776\"],\n        // [\"S777\"],\n        // [\"S778\"],\n        // [\"S779\"],\n        // [\"S780\"],\n        // [\"S781\"],\n        // [\"S782\"],\n        // [\"S783\"],\n        // [\"S784\"],\n        // [\"S785\"],\n        // [\"S786\"],\n        // [\"S787\"],\n        // [\"S788\"],\n        // [\"S789\"],\n        // [\"S790\"],\n        // [\"S791\"],\n        // [\"S792\"],\n        // [\"S793\"],\n        // [\"S794\"],\n        // [\"S795\"],\n        // [\"S796\"],\n        // [\"S797\"],\n        // [\"S798\"],\n        // [\"S799\"],\n        // [\"S800\"],\n        // [\"S801\"],\n        // [\"S802\"],\n        // [\"S803\"],\n        // [\"S804\"],\n        // [\"S805\"],\n        // [\"S806\"],\n        // [\"S807\"],\n        // [\"S808\"],\n        // [\"S809\"],\n        // [\"S810\"],\n        // [\"S811\"],\n        // [\"S812\"],\n        // [\"S813\"],\n        // [\"S814\"],\n        // [\"S815\"],\n        // [\"S816\"],\n        // [\"S817\"],\n        // [\"S818\"],\n        // [\"S819\"],\n        // [\"S820\"],\n        // [\"S821\"],\n        // [\"S822\"],\n        // [\"S823\"],\n        // [\"S824\"],\n        // [\"S825\"],\n        // [\"S826\"],\n        // [\"S827\"],\n        // [\"S828\"],\n        // [\"S829\"],\n        // [\"S830\"],\n        // [\"S831\"],\n        // [\"S832\"],\n        // [\"S833\"],\n        // [\"S834\"],\n        // [\"S835\"],\n        // [\"S836\"],\n        // [\"S837\"],\n        // [\"S838\"],\n        // [\"S839\"],\n        // [\"S840\"],\n        // [\"S841\"],\n        // [\"S842\"],\n        // [\"S843\"],\n        // [\"S844\"],\n        // [\"S845\"],\n        // [\"S846\"],\n        // [\"S847\"],\n        // [\"S848\"],\n        // [\"S849\"],\n        // [\"S850\"],\n        // [\"S851\"],\n        // [\"S852\"],\n        // [\"S853\"],\n        // [\"S854\"],\n        // [\"S855\"],\n        // [\"S856\"],\n        // [\"S857\"],\n        // [\"S858\"],\n        // [\"S859\"],\n        // [\"S860\"],\n        // [\"S861\"],\n        // [\"S862\"],\n        // [\"S863\"],\n        // [\"S864\"],\n        // [\"S865\"],\n        // [\"S866\"],\n        // [\"S867\"],\n        // [\"S868\"],\n        // [\"S869\"],\n        // [\"S870\"],\n        // [\"S871\"],\n        // [\"S872\"],\n        // [\"S873\"],\n        // [\"S874\"],\n        // [\"S875\"],\n        // [\"S876\"],\n        // [\"S877\"],\n        // [\"S878\"],\n        // [\"S879\"],\n        // [\"S880\"],\n        // [\"S881\"],\n        // [\"S882\"],\n        // [\"S883\"],\n        // [\"S884\"],\n        // [\"S885\"],\n        // [\"S886\"],\n        // [\"S887\"],\n        // [\"S888\"],\n        // [\"S889\"],\n        // [\"S890\"],\n        // [\"S891\"],\n        // [\"S892\"],\n        // [\"S893\"],\n        // [\"S894\"],\n        // [\"S895\"],\n        // [\"S896\"],\n        // [\"S897\"],\n        // [\"S898\"],\n        // [\"S899\"],\n        // [\"S900\"],\n        // [\"S901\"],\n        // [\"S902\"],\n        // [\"S903\"],\n        // [\"S904\"],\n        // [\"S905\"],\n        // [\"S906\"],\n        [\"S907\"] = \"CODE_SMELL\",\n        // [\"S908\"],\n        // [\"S909\"],\n        // [\"S910\"],\n        // [\"S911\"],\n        // [\"S912\"],\n        // [\"S913\"],\n        // [\"S914\"],\n        // [\"S915\"],\n        // [\"S916\"],\n        // [\"S917\"],\n        // [\"S918\"],\n        // [\"S919\"],\n        // [\"S920\"],\n        // [\"S921\"],\n        // [\"S922\"],\n        // [\"S923\"],\n        // [\"S924\"],\n        // [\"S925\"],\n        // [\"S926\"],\n        [\"S927\"] = \"CODE_SMELL\",\n        // [\"S928\"],\n        // [\"S929\"],\n        // [\"S930\"],\n        // [\"S931\"],\n        // [\"S932\"],\n        // [\"S933\"],\n        // [\"S934\"],\n        // [\"S935\"],\n        // [\"S936\"],\n        // [\"S937\"],\n        // [\"S938\"],\n        // [\"S939\"],\n        // [\"S940\"],\n        // [\"S941\"],\n        // [\"S942\"],\n        // [\"S943\"],\n        // [\"S944\"],\n        // [\"S945\"],\n        // [\"S946\"],\n        // [\"S947\"],\n        // [\"S948\"],\n        // [\"S949\"],\n        // [\"S950\"],\n        // [\"S951\"],\n        // [\"S952\"],\n        // [\"S953\"],\n        // [\"S954\"],\n        // [\"S955\"],\n        // [\"S956\"],\n        // [\"S957\"],\n        // [\"S958\"],\n        // [\"S959\"],\n        // [\"S960\"],\n        // [\"S961\"],\n        // [\"S962\"],\n        // [\"S963\"],\n        // [\"S964\"],\n        // [\"S965\"],\n        // [\"S966\"],\n        // [\"S967\"],\n        // [\"S968\"],\n        // [\"S969\"],\n        // [\"S970\"],\n        // [\"S971\"],\n        // [\"S972\"],\n        // [\"S973\"],\n        // [\"S974\"],\n        // [\"S975\"],\n        // [\"S976\"],\n        // [\"S977\"],\n        // [\"S978\"],\n        // [\"S979\"],\n        // [\"S980\"],\n        // [\"S981\"],\n        // [\"S982\"],\n        // [\"S983\"],\n        // [\"S984\"],\n        // [\"S985\"],\n        // [\"S986\"],\n        // [\"S987\"],\n        // [\"S988\"],\n        // [\"S989\"],\n        // [\"S990\"],\n        // [\"S991\"],\n        // [\"S992\"],\n        // [\"S993\"],\n        // [\"S994\"],\n        // [\"S995\"],\n        // [\"S996\"],\n        // [\"S997\"],\n        // [\"S998\"],\n        // [\"S999\"],\n        // [\"S1000\"],\n        // [\"S1001\"],\n        // [\"S1002\"],\n        // [\"S1003\"],\n        // [\"S1004\"],\n        // [\"S1005\"],\n        // [\"S1006\"],\n        // [\"S1007\"],\n        // [\"S1008\"],\n        // [\"S1009\"],\n        // [\"S1010\"],\n        // [\"S1011\"],\n        // [\"S1012\"],\n        // [\"S1013\"],\n        // [\"S1014\"],\n        // [\"S1015\"],\n        // [\"S1016\"],\n        // [\"S1017\"],\n        // [\"S1018\"],\n        // [\"S1019\"],\n        // [\"S1020\"],\n        // [\"S1021\"],\n        // [\"S1022\"],\n        // [\"S1023\"],\n        // [\"S1024\"],\n        // [\"S1025\"],\n        // [\"S1026\"],\n        // [\"S1027\"],\n        // [\"S1028\"],\n        // [\"S1029\"],\n        // [\"S1030\"],\n        // [\"S1031\"],\n        // [\"S1032\"],\n        // [\"S1033\"],\n        // [\"S1034\"],\n        // [\"S1035\"],\n        // [\"S1036\"],\n        // [\"S1037\"],\n        // [\"S1038\"],\n        // [\"S1039\"],\n        // [\"S1040\"],\n        // [\"S1041\"],\n        // [\"S1042\"],\n        // [\"S1043\"],\n        // [\"S1044\"],\n        // [\"S1045\"],\n        // [\"S1046\"],\n        // [\"S1047\"],\n        [\"S1048\"] = \"BUG\",\n        // [\"S1049\"],\n        // [\"S1050\"],\n        // [\"S1051\"],\n        // [\"S1052\"],\n        // [\"S1053\"],\n        // [\"S1054\"],\n        // [\"S1055\"],\n        // [\"S1056\"],\n        // [\"S1057\"],\n        // [\"S1058\"],\n        // [\"S1059\"],\n        // [\"S1060\"],\n        // [\"S1061\"],\n        // [\"S1062\"],\n        // [\"S1063\"],\n        // [\"S1064\"],\n        // [\"S1065\"],\n        [\"S1066\"] = \"CODE_SMELL\",\n        [\"S1067\"] = \"CODE_SMELL\",\n        // [\"S1068\"],\n        // [\"S1069\"],\n        // [\"S1070\"],\n        // [\"S1071\"],\n        // [\"S1072\"],\n        // [\"S1073\"],\n        // [\"S1074\"],\n        [\"S1075\"] = \"CODE_SMELL\",\n        // [\"S1076\"],\n        // [\"S1077\"],\n        // [\"S1078\"],\n        // [\"S1079\"],\n        // [\"S1080\"],\n        // [\"S1081\"],\n        // [\"S1082\"],\n        // [\"S1083\"],\n        // [\"S1084\"],\n        // [\"S1085\"],\n        // [\"S1086\"],\n        // [\"S1087\"],\n        // [\"S1088\"],\n        // [\"S1089\"],\n        // [\"S1090\"],\n        // [\"S1091\"],\n        // [\"S1092\"],\n        // [\"S1093\"],\n        // [\"S1094\"],\n        // [\"S1095\"],\n        // [\"S1096\"],\n        // [\"S1097\"],\n        // [\"S1098\"],\n        // [\"S1099\"],\n        // [\"S1100\"],\n        // [\"S1101\"],\n        // [\"S1102\"],\n        // [\"S1103\"],\n        // [\"S1104\"],\n        // [\"S1105\"],\n        // [\"S1106\"],\n        // [\"S1107\"],\n        // [\"S1108\"],\n        // [\"S1109\"],\n        [\"S1110\"] = \"CODE_SMELL\",\n        // [\"S1111\"],\n        // [\"S1112\"],\n        // [\"S1113\"],\n        // [\"S1114\"],\n        // [\"S1115\"],\n        // [\"S1116\"],\n        // [\"S1117\"],\n        // [\"S1118\"],\n        // [\"S1119\"],\n        // [\"S1120\"],\n        // [\"S1121\"],\n        // [\"S1122\"],\n        [\"S1123\"] = \"CODE_SMELL\",\n        // [\"S1124\"],\n        [\"S1125\"] = \"CODE_SMELL\",\n        // [\"S1126\"],\n        // [\"S1127\"],\n        // [\"S1128\"],\n        // [\"S1129\"],\n        // [\"S1130\"],\n        // [\"S1131\"],\n        // [\"S1132\"],\n        [\"S1133\"] = \"CODE_SMELL\",\n        [\"S1134\"] = \"CODE_SMELL\",\n        [\"S1135\"] = \"CODE_SMELL\",\n        // [\"S1136\"],\n        // [\"S1137\"],\n        // [\"S1138\"],\n        // [\"S1139\"],\n        // [\"S1140\"],\n        // [\"S1141\"],\n        // [\"S1142\"],\n        // [\"S1143\"],\n        // [\"S1144\"],\n        // [\"S1145\"],\n        // [\"S1146\"],\n        [\"S1147\"] = \"CODE_SMELL\",\n        // [\"S1148\"],\n        // [\"S1149\"],\n        // [\"S1150\"],\n        [\"S1151\"] = \"CODE_SMELL\",\n        // [\"S1152\"],\n        // [\"S1153\"],\n        // [\"S1154\"],\n        [\"S1155\"] = \"CODE_SMELL\",\n        // [\"S1156\"],\n        // [\"S1157\"],\n        // [\"S1158\"],\n        // [\"S1159\"],\n        // [\"S1160\"],\n        // [\"S1161\"],\n        // [\"S1162\"],\n        [\"S1163\"] = \"CODE_SMELL\",\n        // [\"S1164\"],\n        // [\"S1165\"],\n        // [\"S1166\"],\n        // [\"S1167\"],\n        // [\"S1168\"],\n        // [\"S1169\"],\n        // [\"S1170\"],\n        // [\"S1171\"],\n        [\"S1172\"] = \"CODE_SMELL\",\n        // [\"S1173\"],\n        // [\"S1174\"],\n        // [\"S1175\"],\n        // [\"S1176\"],\n        // [\"S1177\"],\n        // [\"S1178\"],\n        // [\"S1179\"],\n        // [\"S1180\"],\n        // [\"S1181\"],\n        // [\"S1182\"],\n        // [\"S1183\"],\n        // [\"S1184\"],\n        // [\"S1185\"],\n        [\"S1186\"] = \"CODE_SMELL\",\n        // [\"S1187\"],\n        // [\"S1188\"],\n        // [\"S1189\"],\n        // [\"S1190\"],\n        // [\"S1191\"],\n        [\"S1192\"] = \"CODE_SMELL\",\n        // [\"S1193\"],\n        // [\"S1194\"],\n        // [\"S1195\"],\n        // [\"S1196\"],\n        [\"S1197\"] = \"CODE_SMELL\",\n        // [\"S1198\"],\n        // [\"S1199\"],\n        // [\"S1200\"],\n        // [\"S1201\"],\n        // [\"S1202\"],\n        // [\"S1203\"],\n        // [\"S1204\"],\n        // [\"S1205\"],\n        // [\"S1206\"],\n        // [\"S1207\"],\n        // [\"S1208\"],\n        // [\"S1209\"],\n        // [\"S1210\"],\n        // [\"S1211\"],\n        // [\"S1212\"],\n        // [\"S1213\"],\n        // [\"S1214\"],\n        // [\"S1215\"],\n        // [\"S1216\"],\n        // [\"S1217\"],\n        // [\"S1218\"],\n        // [\"S1219\"],\n        // [\"S1220\"],\n        // [\"S1221\"],\n        // [\"S1222\"],\n        // [\"S1223\"],\n        // [\"S1224\"],\n        // [\"S1225\"],\n        [\"S1226\"] = \"BUG\",\n        // [\"S1227\"],\n        // [\"S1228\"],\n        // [\"S1229\"],\n        // [\"S1230\"],\n        // [\"S1231\"],\n        // [\"S1232\"],\n        // [\"S1233\"],\n        // [\"S1234\"],\n        // [\"S1235\"],\n        // [\"S1236\"],\n        // [\"S1237\"],\n        // [\"S1238\"],\n        // [\"S1239\"],\n        // [\"S1240\"],\n        // [\"S1241\"],\n        // [\"S1242\"],\n        // [\"S1243\"],\n        // [\"S1244\"],\n        // [\"S1245\"],\n        // [\"S1246\"],\n        // [\"S1247\"],\n        // [\"S1248\"],\n        // [\"S1249\"],\n        // [\"S1250\"],\n        // [\"S1251\"],\n        // [\"S1252\"],\n        // [\"S1253\"],\n        // [\"S1254\"],\n        // [\"S1255\"],\n        // [\"S1256\"],\n        // [\"S1257\"],\n        // [\"S1258\"],\n        // [\"S1259\"],\n        // [\"S1260\"],\n        // [\"S1261\"],\n        // [\"S1262\"],\n        // [\"S1263\"],\n        // [\"S1264\"],\n        // [\"S1265\"],\n        // [\"S1266\"],\n        // [\"S1267\"],\n        // [\"S1268\"],\n        // [\"S1269\"],\n        // [\"S1270\"],\n        // [\"S1271\"],\n        // [\"S1272\"],\n        // [\"S1273\"],\n        // [\"S1274\"],\n        // [\"S1275\"],\n        // [\"S1276\"],\n        // [\"S1277\"],\n        // [\"S1278\"],\n        // [\"S1279\"],\n        // [\"S1280\"],\n        // [\"S1281\"],\n        // [\"S1282\"],\n        // [\"S1283\"],\n        // [\"S1284\"],\n        // [\"S1285\"],\n        // [\"S1286\"],\n        // [\"S1287\"],\n        // [\"S1288\"],\n        // [\"S1289\"],\n        // [\"S1290\"],\n        // [\"S1291\"],\n        // [\"S1292\"],\n        // [\"S1293\"],\n        // [\"S1294\"],\n        // [\"S1295\"],\n        // [\"S1296\"],\n        // [\"S1297\"],\n        // [\"S1298\"],\n        // [\"S1299\"],\n        // [\"S1300\"],\n        [\"S1301\"] = \"CODE_SMELL\",\n        // [\"S1302\"],\n        // [\"S1303\"],\n        // [\"S1304\"],\n        // [\"S1305\"],\n        // [\"S1306\"],\n        // [\"S1307\"],\n        // [\"S1308\"],\n        // [\"S1309\"],\n        // [\"S1310\"],\n        // [\"S1311\"],\n        // [\"S1312\"],\n        [\"S1313\"] = \"SECURITY_HOTSPOT\",\n        // [\"S1314\"],\n        // [\"S1315\"],\n        // [\"S1316\"],\n        // [\"S1317\"],\n        // [\"S1318\"],\n        // [\"S1319\"],\n        // [\"S1320\"],\n        // [\"S1321\"],\n        // [\"S1322\"],\n        // [\"S1323\"],\n        // [\"S1324\"],\n        // [\"S1325\"],\n        // [\"S1326\"],\n        // [\"S1327\"],\n        // [\"S1328\"],\n        // [\"S1329\"],\n        // [\"S1330\"],\n        // [\"S1331\"],\n        // [\"S1332\"],\n        // [\"S1333\"],\n        // [\"S1334\"],\n        // [\"S1335\"],\n        // [\"S1336\"],\n        // [\"S1337\"],\n        // [\"S1338\"],\n        // [\"S1339\"],\n        // [\"S1340\"],\n        // [\"S1341\"],\n        // [\"S1342\"],\n        // [\"S1343\"],\n        // [\"S1344\"],\n        // [\"S1345\"],\n        // [\"S1346\"],\n        // [\"S1347\"],\n        // [\"S1348\"],\n        // [\"S1349\"],\n        // [\"S1350\"],\n        // [\"S1351\"],\n        // [\"S1352\"],\n        // [\"S1353\"],\n        // [\"S1354\"],\n        // [\"S1355\"],\n        // [\"S1356\"],\n        // [\"S1357\"],\n        // [\"S1358\"],\n        // [\"S1359\"],\n        // [\"S1360\"],\n        // [\"S1361\"],\n        // [\"S1362\"],\n        // [\"S1363\"],\n        // [\"S1364\"],\n        // [\"S1365\"],\n        // [\"S1366\"],\n        // [\"S1367\"],\n        // [\"S1368\"],\n        // [\"S1369\"],\n        // [\"S1370\"],\n        // [\"S1371\"],\n        // [\"S1372\"],\n        // [\"S1373\"],\n        // [\"S1374\"],\n        // [\"S1375\"],\n        // [\"S1376\"],\n        // [\"S1377\"],\n        // [\"S1378\"],\n        // [\"S1379\"],\n        // [\"S1380\"],\n        // [\"S1381\"],\n        // [\"S1382\"],\n        // [\"S1383\"],\n        // [\"S1384\"],\n        // [\"S1385\"],\n        // [\"S1386\"],\n        // [\"S1387\"],\n        // [\"S1388\"],\n        // [\"S1389\"],\n        // [\"S1390\"],\n        // [\"S1391\"],\n        // [\"S1392\"],\n        // [\"S1393\"],\n        // [\"S1394\"],\n        // [\"S1395\"],\n        // [\"S1396\"],\n        // [\"S1397\"],\n        // [\"S1398\"],\n        // [\"S1399\"],\n        // [\"S1400\"],\n        // [\"S1401\"],\n        // [\"S1402\"],\n        // [\"S1403\"],\n        // [\"S1404\"],\n        // [\"S1405\"],\n        // [\"S1406\"],\n        // [\"S1407\"],\n        // [\"S1408\"],\n        // [\"S1409\"],\n        // [\"S1410\"],\n        // [\"S1411\"],\n        // [\"S1412\"],\n        // [\"S1413\"],\n        // [\"S1414\"],\n        // [\"S1415\"],\n        // [\"S1416\"],\n        // [\"S1417\"],\n        // [\"S1418\"],\n        // [\"S1419\"],\n        // [\"S1420\"],\n        // [\"S1421\"],\n        // [\"S1422\"],\n        // [\"S1423\"],\n        // [\"S1424\"],\n        // [\"S1425\"],\n        // [\"S1426\"],\n        // [\"S1427\"],\n        // [\"S1428\"],\n        // [\"S1429\"],\n        // [\"S1430\"],\n        // [\"S1431\"],\n        // [\"S1432\"],\n        // [\"S1433\"],\n        // [\"S1434\"],\n        // [\"S1435\"],\n        // [\"S1436\"],\n        // [\"S1437\"],\n        // [\"S1438\"],\n        // [\"S1439\"],\n        // [\"S1440\"],\n        // [\"S1441\"],\n        // [\"S1442\"],\n        // [\"S1443\"],\n        // [\"S1444\"],\n        // [\"S1445\"],\n        // [\"S1446\"],\n        // [\"S1447\"],\n        // [\"S1448\"],\n        // [\"S1449\"],\n        // [\"S1450\"],\n        [\"S1451\"] = \"CODE_SMELL\",\n        // [\"S1452\"],\n        // [\"S1453\"],\n        // [\"S1454\"],\n        // [\"S1455\"],\n        // [\"S1456\"],\n        // [\"S1457\"],\n        // [\"S1458\"],\n        // [\"S1459\"],\n        // [\"S1460\"],\n        // [\"S1461\"],\n        // [\"S1462\"],\n        // [\"S1463\"],\n        // [\"S1464\"],\n        // [\"S1465\"],\n        // [\"S1466\"],\n        // [\"S1467\"],\n        // [\"S1468\"],\n        // [\"S1469\"],\n        // [\"S1470\"],\n        // [\"S1471\"],\n        // [\"S1472\"],\n        // [\"S1473\"],\n        // [\"S1474\"],\n        // [\"S1475\"],\n        // [\"S1476\"],\n        // [\"S1477\"],\n        // [\"S1478\"],\n        [\"S1479\"] = \"CODE_SMELL\",\n        // [\"S1480\"],\n        [\"S1481\"] = \"CODE_SMELL\",\n        // [\"S1482\"],\n        // [\"S1483\"],\n        // [\"S1484\"],\n        // [\"S1485\"],\n        // [\"S1486\"],\n        // [\"S1487\"],\n        // [\"S1488\"],\n        // [\"S1489\"],\n        // [\"S1490\"],\n        // [\"S1491\"],\n        // [\"S1492\"],\n        // [\"S1493\"],\n        // [\"S1494\"],\n        // [\"S1495\"],\n        // [\"S1496\"],\n        // [\"S1497\"],\n        // [\"S1498\"],\n        // [\"S1499\"],\n        // [\"S1500\"],\n        // [\"S1501\"],\n        // [\"S1502\"],\n        // [\"S1503\"],\n        // [\"S1504\"],\n        // [\"S1505\"],\n        // [\"S1506\"],\n        // [\"S1507\"],\n        // [\"S1508\"],\n        // [\"S1509\"],\n        // [\"S1510\"],\n        // [\"S1511\"],\n        // [\"S1512\"],\n        // [\"S1513\"],\n        // [\"S1514\"],\n        // [\"S1515\"],\n        // [\"S1516\"],\n        // [\"S1517\"],\n        // [\"S1518\"],\n        // [\"S1519\"],\n        // [\"S1520\"],\n        // [\"S1521\"],\n        // [\"S1522\"],\n        // [\"S1523\"] = \"SECURITY_HOTSPOT\",\n        // [\"S1524\"],\n        // [\"S1525\"],\n        // [\"S1526\"],\n        // [\"S1527\"],\n        // [\"S1528\"],\n        // [\"S1529\"],\n        // [\"S1530\"],\n        // [\"S1531\"],\n        // [\"S1532\"],\n        // [\"S1533\"],\n        // [\"S1534\"],\n        // [\"S1535\"],\n        // [\"S1536\"],\n        // [\"S1537\"],\n        // [\"S1538\"],\n        // [\"S1539\"],\n        // [\"S1540\"],\n        [\"S1541\"] = \"CODE_SMELL\",\n        [\"S1542\"] = \"CODE_SMELL\",\n        // [\"S1543\"],\n        // [\"S1544\"],\n        // [\"S1545\"],\n        // [\"S1546\"],\n        // [\"S1547\"],\n        // [\"S1548\"],\n        // [\"S1549\"],\n        // [\"S1550\"],\n        // [\"S1551\"],\n        // [\"S1552\"],\n        // [\"S1553\"],\n        // [\"S1554\"],\n        // [\"S1555\"],\n        // [\"S1556\"],\n        // [\"S1557\"],\n        // [\"S1558\"],\n        // [\"S1559\"],\n        // [\"S1560\"],\n        // [\"S1561\"],\n        // [\"S1562\"],\n        // [\"S1563\"],\n        // [\"S1564\"],\n        // [\"S1565\"],\n        // [\"S1566\"],\n        // [\"S1567\"],\n        // [\"S1568\"],\n        // [\"S1569\"],\n        // [\"S1570\"],\n        // [\"S1571\"],\n        // [\"S1572\"],\n        // [\"S1573\"],\n        // [\"S1574\"],\n        // [\"S1575\"],\n        // [\"S1576\"],\n        // [\"S1577\"],\n        // [\"S1578\"],\n        // [\"S1579\"],\n        // [\"S1580\"],\n        // [\"S1581\"],\n        // [\"S1582\"],\n        // [\"S1583\"],\n        // [\"S1584\"],\n        // [\"S1585\"],\n        // [\"S1586\"],\n        // [\"S1587\"],\n        // [\"S1588\"],\n        // [\"S1589\"],\n        // [\"S1590\"],\n        // [\"S1591\"],\n        // [\"S1592\"],\n        // [\"S1593\"],\n        // [\"S1594\"],\n        // [\"S1595\"],\n        // [\"S1596\"],\n        // [\"S1597\"],\n        // [\"S1598\"],\n        // [\"S1599\"],\n        // [\"S1600\"],\n        // [\"S1601\"],\n        // [\"S1602\"],\n        // [\"S1603\"],\n        // [\"S1604\"],\n        // [\"S1605\"],\n        // [\"S1606\"],\n        // [\"S1607\"],\n        // [\"S1608\"],\n        // [\"S1609\"],\n        // [\"S1610\"],\n        // [\"S1611\"],\n        // [\"S1612\"],\n        // [\"S1613\"],\n        // [\"S1614\"],\n        // [\"S1615\"],\n        // [\"S1616\"],\n        // [\"S1617\"],\n        // [\"S1618\"],\n        // [\"S1619\"],\n        // [\"S1620\"],\n        // [\"S1621\"],\n        // [\"S1622\"],\n        // [\"S1623\"],\n        // [\"S1624\"],\n        // [\"S1625\"],\n        // [\"S1626\"],\n        // [\"S1627\"],\n        // [\"S1628\"],\n        // [\"S1629\"],\n        // [\"S1630\"],\n        // [\"S1631\"],\n        // [\"S1632\"],\n        // [\"S1633\"],\n        // [\"S1634\"],\n        // [\"S1635\"],\n        // [\"S1636\"],\n        // [\"S1637\"],\n        // [\"S1638\"],\n        // [\"S1639\"],\n        // [\"S1640\"],\n        // [\"S1641\"],\n        // [\"S1642\"],\n        [\"S1643\"] = \"CODE_SMELL\",\n        // [\"S1644\"],\n        [\"S1645\"] = \"CODE_SMELL\",\n        // [\"S1646\"],\n        // [\"S1647\"],\n        // [\"S1648\"],\n        // [\"S1649\"],\n        // [\"S1650\"],\n        // [\"S1651\"],\n        // [\"S1652\"],\n        // [\"S1653\"],\n        [\"S1654\"] = \"CODE_SMELL\",\n        // [\"S1655\"],\n        [\"S1656\"] = \"BUG\",\n        // [\"S1657\"],\n        // [\"S1658\"],\n        [\"S1659\"] = \"CODE_SMELL\",\n        // [\"S1660\"],\n        // [\"S1661\"],\n        // [\"S1662\"],\n        // [\"S1663\"],\n        // [\"S1664\"],\n        // [\"S1665\"],\n        // [\"S1666\"],\n        // [\"S1667\"],\n        // [\"S1668\"],\n        // [\"S1669\"],\n        // [\"S1670\"],\n        // [\"S1671\"],\n        // [\"S1672\"],\n        // [\"S1673\"],\n        // [\"S1674\"],\n        // [\"S1675\"],\n        // [\"S1676\"],\n        // [\"S1677\"],\n        // [\"S1678\"],\n        // [\"S1679\"],\n        // [\"S1680\"],\n        // [\"S1681\"],\n        // [\"S1682\"],\n        // [\"S1683\"],\n        // [\"S1684\"],\n        // [\"S1685\"],\n        // [\"S1686\"],\n        // [\"S1687\"],\n        // [\"S1688\"],\n        // [\"S1689\"],\n        // [\"S1690\"],\n        // [\"S1691\"],\n        // [\"S1692\"],\n        // [\"S1693\"],\n        // [\"S1694\"],\n        // [\"S1695\"],\n        // [\"S1696\"],\n        // [\"S1697\"],\n        // [\"S1698\"],\n        // [\"S1699\"],\n        // [\"S1700\"],\n        // [\"S1701\"],\n        // [\"S1702\"],\n        // [\"S1703\"],\n        // [\"S1704\"],\n        // [\"S1705\"],\n        // [\"S1706\"],\n        // [\"S1707\"],\n        // [\"S1708\"],\n        // [\"S1709\"],\n        // [\"S1710\"],\n        // [\"S1711\"],\n        // [\"S1712\"],\n        // [\"S1713\"],\n        // [\"S1714\"],\n        // [\"S1715\"],\n        // [\"S1716\"],\n        // [\"S1717\"],\n        // [\"S1718\"],\n        // [\"S1719\"],\n        // [\"S1720\"],\n        // [\"S1721\"],\n        // [\"S1722\"],\n        // [\"S1723\"],\n        // [\"S1724\"],\n        // [\"S1725\"],\n        // [\"S1726\"],\n        // [\"S1727\"],\n        // [\"S1728\"],\n        // [\"S1729\"],\n        // [\"S1730\"],\n        // [\"S1731\"],\n        // [\"S1732\"],\n        // [\"S1733\"],\n        // [\"S1734\"],\n        // [\"S1735\"],\n        // [\"S1736\"],\n        // [\"S1737\"],\n        // [\"S1738\"],\n        // [\"S1739\"],\n        // [\"S1740\"],\n        // [\"S1741\"],\n        // [\"S1742\"],\n        // [\"S1743\"],\n        // [\"S1744\"],\n        // [\"S1745\"],\n        // [\"S1746\"],\n        // [\"S1747\"],\n        // [\"S1748\"],\n        // [\"S1749\"],\n        // [\"S1750\"],\n        [\"S1751\"] = \"BUG\",\n        // [\"S1752\"],\n        // [\"S1753\"],\n        // [\"S1754\"],\n        // [\"S1755\"],\n        // [\"S1756\"],\n        // [\"S1757\"],\n        // [\"S1758\"],\n        // [\"S1759\"],\n        // [\"S1760\"],\n        // [\"S1761\"],\n        // [\"S1762\"],\n        // [\"S1763\"],\n        [\"S1764\"] = \"BUG\",\n        // [\"S1765\"],\n        // [\"S1766\"],\n        // [\"S1767\"],\n        // [\"S1768\"],\n        // [\"S1769\"],\n        // [\"S1770\"],\n        // [\"S1771\"],\n        // [\"S1772\"],\n        // [\"S1773\"],\n        // [\"S1774\"],\n        // [\"S1775\"],\n        // [\"S1776\"],\n        // [\"S1777\"],\n        // [\"S1778\"],\n        // [\"S1779\"],\n        // [\"S1780\"],\n        // [\"S1781\"],\n        // [\"S1782\"],\n        // [\"S1783\"],\n        // [\"S1784\"],\n        // [\"S1785\"],\n        // [\"S1786\"],\n        // [\"S1787\"],\n        // [\"S1788\"],\n        // [\"S1789\"],\n        // [\"S1790\"],\n        // [\"S1791\"],\n        // [\"S1792\"],\n        // [\"S1793\"],\n        // [\"S1794\"],\n        // [\"S1795\"],\n        // [\"S1796\"],\n        // [\"S1797\"],\n        // [\"S1798\"],\n        // [\"S1799\"],\n        // [\"S1800\"],\n        // [\"S1801\"],\n        // [\"S1802\"],\n        // [\"S1803\"],\n        // [\"S1804\"],\n        // [\"S1805\"],\n        // [\"S1806\"],\n        // [\"S1807\"],\n        // [\"S1808\"],\n        // [\"S1809\"],\n        // [\"S1810\"],\n        // [\"S1811\"],\n        // [\"S1812\"],\n        // [\"S1813\"],\n        // [\"S1814\"],\n        // [\"S1815\"],\n        // [\"S1816\"],\n        // [\"S1817\"],\n        // [\"S1818\"],\n        // [\"S1819\"],\n        // [\"S1820\"],\n        [\"S1821\"] = \"CODE_SMELL\",\n        // [\"S1822\"],\n        // [\"S1823\"],\n        // [\"S1824\"],\n        // [\"S1825\"],\n        // [\"S1826\"],\n        // [\"S1827\"],\n        // [\"S1828\"],\n        // [\"S1829\"],\n        // [\"S1830\"],\n        // [\"S1831\"],\n        // [\"S1832\"],\n        // [\"S1833\"],\n        // [\"S1834\"],\n        // [\"S1835\"],\n        // [\"S1836\"],\n        // [\"S1837\"],\n        // [\"S1838\"],\n        // [\"S1839\"],\n        // [\"S1840\"],\n        // [\"S1841\"],\n        // [\"S1842\"],\n        // [\"S1843\"],\n        // [\"S1844\"],\n        // [\"S1845\"],\n        // [\"S1846\"],\n        // [\"S1847\"],\n        // [\"S1848\"],\n        // [\"S1849\"],\n        // [\"S1850\"],\n        // [\"S1851\"],\n        // [\"S1852\"],\n        // [\"S1853\"],\n        // [\"S1854\"],\n        // [\"S1855\"],\n        // [\"S1856\"],\n        // [\"S1857\"],\n        // [\"S1858\"],\n        // [\"S1859\"],\n        // [\"S1860\"],\n        // [\"S1861\"],\n        [\"S1862\"] = \"BUG\",\n        // [\"S1863\"],\n        // [\"S1864\"],\n        // [\"S1865\"],\n        // [\"S1866\"],\n        // [\"S1867\"],\n        // [\"S1868\"],\n        // [\"S1869\"],\n        // [\"S1870\"],\n        [\"S1871\"] = \"CODE_SMELL\",\n        // [\"S1872\"],\n        // [\"S1873\"],\n        // [\"S1874\"],\n        // [\"S1875\"],\n        // [\"S1876\"],\n        // [\"S1877\"],\n        // [\"S1878\"],\n        // [\"S1879\"],\n        // [\"S1880\"],\n        // [\"S1881\"],\n        // [\"S1882\"],\n        // [\"S1883\"],\n        // [\"S1884\"],\n        // [\"S1885\"],\n        // [\"S1886\"],\n        // [\"S1887\"],\n        // [\"S1888\"],\n        // [\"S1889\"],\n        // [\"S1890\"],\n        // [\"S1891\"],\n        // [\"S1892\"],\n        // [\"S1893\"],\n        // [\"S1894\"],\n        // [\"S1895\"],\n        // [\"S1896\"],\n        // [\"S1897\"],\n        // [\"S1898\"],\n        // [\"S1899\"],\n        // [\"S1900\"],\n        // [\"S1901\"],\n        // [\"S1902\"],\n        // [\"S1903\"],\n        // [\"S1904\"],\n        // [\"S1905\"],\n        // [\"S1906\"],\n        // [\"S1907\"],\n        // [\"S1908\"],\n        // [\"S1909\"],\n        // [\"S1910\"],\n        // [\"S1911\"],\n        // [\"S1912\"],\n        // [\"S1913\"],\n        // [\"S1914\"],\n        // [\"S1915\"],\n        // [\"S1916\"],\n        // [\"S1917\"],\n        // [\"S1918\"],\n        // [\"S1919\"],\n        // [\"S1920\"],\n        // [\"S1921\"],\n        // [\"S1922\"],\n        // [\"S1923\"],\n        // [\"S1924\"],\n        // [\"S1925\"],\n        // [\"S1926\"],\n        // [\"S1927\"],\n        // [\"S1928\"],\n        // [\"S1929\"],\n        // [\"S1930\"],\n        // [\"S1931\"],\n        // [\"S1932\"],\n        // [\"S1933\"],\n        // [\"S1934\"],\n        // [\"S1935\"],\n        // [\"S1936\"],\n        // [\"S1937\"],\n        // [\"S1938\"],\n        // [\"S1939\"],\n        [\"S1940\"] = \"CODE_SMELL\",\n        // [\"S1941\"],\n        // [\"S1942\"],\n        // [\"S1943\"],\n        [\"S1944\"] = \"CODE_SMELL\",\n        // [\"S1945\"],\n        // [\"S1946\"],\n        // [\"S1947\"],\n        // [\"S1948\"],\n        // [\"S1949\"],\n        // [\"S1950\"],\n        // [\"S1951\"],\n        // [\"S1952\"],\n        // [\"S1953\"],\n        // [\"S1954\"],\n        // [\"S1955\"],\n        // [\"S1956\"],\n        // [\"S1957\"],\n        // [\"S1958\"],\n        // [\"S1959\"],\n        // [\"S1960\"],\n        // [\"S1961\"],\n        // [\"S1962\"],\n        // [\"S1963\"],\n        // [\"S1964\"],\n        // [\"S1965\"],\n        // [\"S1966\"],\n        // [\"S1967\"],\n        // [\"S1968\"],\n        // [\"S1969\"],\n        // [\"S1970\"],\n        // [\"S1971\"],\n        // [\"S1972\"],\n        // [\"S1973\"],\n        // [\"S1974\"],\n        // [\"S1975\"],\n        // [\"S1976\"],\n        // [\"S1977\"],\n        // [\"S1978\"],\n        // [\"S1979\"],\n        // [\"S1980\"],\n        // [\"S1981\"],\n        // [\"S1982\"],\n        // [\"S1983\"],\n        // [\"S1984\"],\n        // [\"S1985\"],\n        // [\"S1986\"],\n        // [\"S1987\"],\n        // [\"S1988\"],\n        // [\"S1989\"],\n        // [\"S1990\"],\n        // [\"S1991\"],\n        // [\"S1992\"],\n        // [\"S1993\"],\n        // [\"S1994\"],\n        // [\"S1995\"],\n        // [\"S1996\"],\n        // [\"S1997\"],\n        // [\"S1998\"],\n        // [\"S1999\"],\n        // [\"S2000\"],\n        // [\"S2001\"],\n        // [\"S2002\"],\n        // [\"S2003\"],\n        // [\"S2004\"],\n        // [\"S2005\"],\n        // [\"S2006\"],\n        // [\"S2007\"],\n        // [\"S2008\"],\n        // [\"S2009\"],\n        // [\"S2010\"],\n        // [\"S2011\"],\n        // [\"S2012\"],\n        // [\"S2013\"],\n        // [\"S2014\"],\n        // [\"S2015\"],\n        // [\"S2016\"],\n        // [\"S2017\"],\n        // [\"S2018\"],\n        // [\"S2019\"],\n        // [\"S2020\"],\n        // [\"S2021\"],\n        // [\"S2022\"],\n        // [\"S2023\"],\n        // [\"S2024\"],\n        // [\"S2025\"],\n        // [\"S2026\"],\n        // [\"S2027\"],\n        // [\"S2028\"],\n        // [\"S2029\"],\n        // [\"S2030\"],\n        // [\"S2031\"],\n        // [\"S2032\"],\n        // [\"S2033\"],\n        // [\"S2034\"],\n        // [\"S2035\"],\n        // [\"S2036\"],\n        // [\"S2037\"],\n        // [\"S2038\"],\n        // [\"S2039\"],\n        // [\"S2040\"],\n        // [\"S2041\"],\n        // [\"S2042\"],\n        // [\"S2043\"],\n        // [\"S2044\"],\n        // [\"S2045\"],\n        // [\"S2046\"],\n        // [\"S2047\"],\n        // [\"S2048\"],\n        // [\"S2049\"],\n        // [\"S2050\"],\n        // [\"S2051\"],\n        // [\"S2052\"],\n        [\"S2053\"] = \"VULNERABILITY\",\n        // [\"S2054\"],\n        // [\"S2055\"],\n        // [\"S2056\"],\n        // [\"S2057\"],\n        // [\"S2058\"],\n        // [\"S2059\"],\n        // [\"S2060\"],\n        // [\"S2061\"],\n        // [\"S2062\"],\n        // [\"S2063\"],\n        // [\"S2064\"],\n        // [\"S2065\"],\n        // [\"S2066\"],\n        // [\"S2067\"],\n        [\"S2068\"] = \"VULNERABILITY\",\n        // [\"S2069\"],\n        // [\"S2070\"],\n        // [\"S2071\"],\n        // [\"S2072\"],\n        // [\"S2073\"],\n        // [\"S2074\"],\n        // [\"S2075\"],\n        // [\"S2076\"],\n        [\"S2077\"] = \"SECURITY_HOTSPOT\",\n        // [\"S2078\"],\n        // [\"S2079\"],\n        // [\"S2080\"],\n        // [\"S2081\"],\n        // [\"S2082\"],\n        // [\"S2083\"],\n        // [\"S2084\"],\n        // [\"S2085\"],\n        // [\"S2086\"],\n        // [\"S2087\"],\n        // [\"S2088\"],\n        // [\"S2089\"],\n        // [\"S2090\"],\n        // [\"S2091\"],\n        // [\"S2092\"],\n        // [\"S2093\"],\n        [\"S2094\"] = \"CODE_SMELL\",\n        // [\"S2095\"],\n        // [\"S2096\"],\n        // [\"S2097\"],\n        // [\"S2098\"],\n        // [\"S2099\"],\n        // [\"S2100\"],\n        // [\"S2101\"],\n        // [\"S2102\"],\n        // [\"S2103\"],\n        // [\"S2104\"],\n        // [\"S2105\"],\n        // [\"S2106\"],\n        // [\"S2107\"],\n        // [\"S2108\"],\n        // [\"S2109\"],\n        // [\"S2110\"],\n        // [\"S2111\"],\n        // [\"S2112\"],\n        // [\"S2113\"],\n        // [\"S2114\"],\n        // [\"S2115\"],\n        // [\"S2116\"],\n        // [\"S2117\"],\n        // [\"S2118\"],\n        // [\"S2119\"],\n        // [\"S2120\"],\n        // [\"S2121\"],\n        // [\"S2122\"],\n        // [\"S2123\"],\n        // [\"S2124\"],\n        // [\"S2125\"],\n        // [\"S2126\"],\n        // [\"S2127\"],\n        // [\"S2128\"],\n        // [\"S2129\"],\n        // [\"S2130\"],\n        // [\"S2131\"],\n        // [\"S2132\"],\n        // [\"S2133\"],\n        // [\"S2134\"],\n        // [\"S2135\"],\n        // [\"S2136\"],\n        // [\"S2137\"],\n        // [\"S2138\"],\n        // [\"S2139\"],\n        // [\"S2140\"],\n        // [\"S2141\"],\n        // [\"S2142\"],\n        // [\"S2143\"],\n        // [\"S2144\"],\n        // [\"S2145\"],\n        // [\"S2146\"],\n        // [\"S2147\"],\n        // [\"S2148\"],\n        // [\"S2149\"],\n        // [\"S2150\"],\n        // [\"S2151\"],\n        // [\"S2152\"],\n        // [\"S2153\"],\n        // [\"S2154\"],\n        // [\"S2155\"],\n        // [\"S2156\"],\n        // [\"S2157\"],\n        // [\"S2158\"],\n        // [\"S2159\"],\n        // [\"S2160\"],\n        // [\"S2161\"],\n        // [\"S2162\"],\n        // [\"S2163\"],\n        // [\"S2164\"],\n        // [\"S2165\"],\n        [\"S2166\"] = \"CODE_SMELL\",\n        // [\"S2167\"],\n        // [\"S2168\"],\n        // [\"S2169\"],\n        // [\"S2170\"],\n        // [\"S2171\"],\n        // [\"S2172\"],\n        // [\"S2173\"],\n        // [\"S2174\"],\n        // [\"S2175\"],\n        // [\"S2176\"],\n        // [\"S2177\"],\n        [\"S2178\"] = \"CODE_SMELL\",\n        // [\"S2179\"],\n        // [\"S2180\"],\n        // [\"S2181\"],\n        // [\"S2182\"],\n        // [\"S2183\"],\n        // [\"S2184\"],\n        // [\"S2185\"],\n        // [\"S2186\"],\n        // [\"S2187\"],\n        // [\"S2188\"],\n        // [\"S2189\"],\n        // [\"S2190\"],\n        // [\"S2191\"],\n        // [\"S2192\"],\n        // [\"S2193\"],\n        // [\"S2194\"],\n        // [\"S2195\"],\n        // [\"S2196\"],\n        // [\"S2197\"],\n        // [\"S2198\"],\n        // [\"S2199\"],\n        // [\"S2200\"],\n        // [\"S2201\"],\n        // [\"S2202\"],\n        // [\"S2203\"],\n        // [\"S2204\"],\n        // [\"S2205\"],\n        // [\"S2206\"],\n        // [\"S2207\"],\n        // [\"S2208\"],\n        // [\"S2209\"],\n        // [\"S2210\"],\n        // [\"S2211\"],\n        // [\"S2212\"],\n        // [\"S2213\"],\n        // [\"S2214\"],\n        // [\"S2215\"],\n        // [\"S2216\"],\n        // [\"S2217\"],\n        // [\"S2218\"],\n        // [\"S2219\"],\n        // [\"S2220\"],\n        // [\"S2221\"],\n        [\"S2222\"] = \"BUG\",\n        // [\"S2223\"],\n        // [\"S2224\"],\n        [\"S2225\"] = \"BUG\",\n        // [\"S2226\"],\n        // [\"S2227\"],\n        // [\"S2228\"],\n        // [\"S2229\"],\n        // [\"S2230\"],\n        // [\"S2231\"],\n        // [\"S2232\"],\n        // [\"S2233\"],\n        [\"S2234\"] = \"CODE_SMELL\",\n        // [\"S2235\"],\n        // [\"S2236\"],\n        // [\"S2237\"],\n        // [\"S2238\"],\n        // [\"S2239\"],\n        // [\"S2240\"],\n        // [\"S2241\"],\n        // [\"S2242\"],\n        // [\"S2243\"],\n        // [\"S2244\"],\n        // [\"S2245\"],\n        // [\"S2246\"],\n        // [\"S2247\"],\n        // [\"S2248\"],\n        // [\"S2249\"],\n        // [\"S2250\"],\n        // [\"S2251\"],\n        // [\"S2252\"],\n        // [\"S2253\"],\n        // [\"S2254\"],\n        // [\"S2255\"],\n        // [\"S2256\"],\n        [\"S2257\"] = \"SECURITY_HOTSPOT\",\n        // [\"S2258\"],\n        [\"S2259\"] = \"BUG\",\n        // [\"S2260\"],\n        // [\"S2261\"],\n        // [\"S2262\"],\n        // [\"S2263\"],\n        // [\"S2264\"],\n        // [\"S2265\"],\n        // [\"S2266\"],\n        // [\"S2267\"],\n        // [\"S2268\"],\n        // [\"S2269\"],\n        // [\"S2270\"],\n        // [\"S2271\"],\n        // [\"S2272\"],\n        // [\"S2273\"],\n        // [\"S2274\"],\n        // [\"S2275\"],\n        // [\"S2276\"],\n        // [\"S2277\"],\n        // [\"S2278\"],\n        // [\"S2279\"],\n        // [\"S2280\"],\n        // [\"S2281\"],\n        // [\"S2282\"],\n        // [\"S2283\"],\n        // [\"S2284\"],\n        // [\"S2285\"],\n        // [\"S2286\"],\n        // [\"S2287\"],\n        // [\"S2288\"],\n        // [\"S2289\"],\n        // [\"S2290\"],\n        // [\"S2291\"],\n        // [\"S2292\"],\n        // [\"S2293\"],\n        // [\"S2294\"],\n        // [\"S2295\"],\n        // [\"S2296\"],\n        // [\"S2297\"],\n        // [\"S2298\"],\n        // [\"S2299\"],\n        // [\"S2300\"],\n        // [\"S2301\"],\n        [\"S2302\"] = \"CODE_SMELL\",\n        // [\"S2303\"],\n        [\"S2304\"] = \"CODE_SMELL\",\n        // [\"S2305\"],\n        // [\"S2306\"],\n        // [\"S2307\"],\n        // [\"S2308\"],\n        // [\"S2309\"],\n        // [\"S2310\"],\n        // [\"S2311\"],\n        // [\"S2312\"],\n        // [\"S2313\"],\n        // [\"S2314\"],\n        // [\"S2315\"],\n        // [\"S2316\"],\n        // [\"S2317\"],\n        // [\"S2318\"],\n        // [\"S2319\"],\n        // [\"S2320\"],\n        // [\"S2321\"],\n        // [\"S2322\"],\n        // [\"S2323\"],\n        // [\"S2324\"],\n        // [\"S2325\"],\n        // [\"S2326\"],\n        // [\"S2327\"],\n        // [\"S2328\"],\n        // [\"S2329\"],\n        // [\"S2330\"],\n        // [\"S2331\"],\n        // [\"S2332\"],\n        // [\"S2333\"],\n        // [\"S2334\"],\n        // [\"S2335\"],\n        // [\"S2336\"],\n        // [\"S2337\"],\n        // [\"S2338\"],\n        [\"S2339\"] = \"CODE_SMELL\",\n        [\"S2340\"] = \"CODE_SMELL\",\n        // [\"S2341\"],\n        [\"S2342\"] = \"CODE_SMELL\",\n        [\"S2343\"] = \"CODE_SMELL\",\n        [\"S2344\"] = \"CODE_SMELL\",\n        [\"S2345\"] = \"BUG\",\n        [\"S2346\"] = \"CODE_SMELL\",\n        [\"S2347\"] = \"CODE_SMELL\",\n        [\"S2348\"] = \"CODE_SMELL\",\n        [\"S2349\"] = \"CODE_SMELL\",\n        // [\"S2350\"],\n        // [\"S2351\"],\n        [\"S2352\"] = \"CODE_SMELL\",\n        // [\"S2353\"],\n        [\"S2354\"] = \"CODE_SMELL\",\n        [\"S2355\"] = \"CODE_SMELL\",\n        // [\"S2356\"],\n        [\"S2357\"] = \"CODE_SMELL\",\n        [\"S2358\"] = \"CODE_SMELL\",\n        [\"S2359\"] = \"CODE_SMELL\",\n        [\"S2360\"] = \"CODE_SMELL\",\n        // [\"S2361\"],\n        [\"S2362\"] = \"CODE_SMELL\",\n        [\"S2363\"] = \"CODE_SMELL\",\n        [\"S2364\"] = \"CODE_SMELL\",\n        [\"S2365\"] = \"CODE_SMELL\",\n        [\"S2366\"] = \"CODE_SMELL\",\n        [\"S2367\"] = \"CODE_SMELL\",\n        [\"S2368\"] = \"CODE_SMELL\",\n        [\"S2369\"] = \"CODE_SMELL\",\n        [\"S2370\"] = \"CODE_SMELL\",\n        // [\"S2371\"],\n        [\"S2372\"] = \"CODE_SMELL\",\n        [\"S2373\"] = \"CODE_SMELL\",\n        [\"S2374\"] = \"CODE_SMELL\",\n        [\"S2375\"] = \"CODE_SMELL\",\n        [\"S2376\"] = \"CODE_SMELL\",\n        // [\"S2377\"],\n        // [\"S2378\"],\n        // [\"S2379\"],\n        // [\"S2380\"],\n        // [\"S2381\"],\n        // [\"S2382\"],\n        // [\"S2383\"],\n        // [\"S2384\"],\n        // [\"S2385\"],\n        // [\"S2386\"],\n        [\"S2387\"] = \"CODE_SMELL\",\n        // [\"S2388\"],\n        // [\"S2389\"],\n        // [\"S2390\"],\n        // [\"S2391\"],\n        // [\"S2392\"],\n        // [\"S2393\"],\n        // [\"S2394\"],\n        // [\"S2395\"],\n        // [\"S2396\"],\n        // [\"S2397\"],\n        // [\"S2398\"],\n        // [\"S2399\"],\n        // [\"S2400\"],\n        // [\"S2401\"],\n        // [\"S2402\"],\n        // [\"S2403\"],\n        // [\"S2404\"],\n        // [\"S2405\"],\n        // [\"S2406\"],\n        // [\"S2407\"],\n        // [\"S2408\"],\n        // [\"S2409\"],\n        // [\"S2410\"],\n        // [\"S2411\"],\n        // [\"S2412\"],\n        // [\"S2413\"],\n        // [\"S2414\"],\n        // [\"S2415\"],\n        // [\"S2416\"],\n        // [\"S2417\"],\n        // [\"S2418\"],\n        // [\"S2419\"],\n        // [\"S2420\"],\n        // [\"S2421\"],\n        // [\"S2422\"],\n        // [\"S2423\"],\n        // [\"S2424\"],\n        // [\"S2425\"],\n        // [\"S2426\"],\n        // [\"S2427\"],\n        // [\"S2428\"],\n        [\"S2429\"] = \"CODE_SMELL\",\n        // [\"S2430\"],\n        // [\"S2431\"],\n        // [\"S2432\"],\n        // [\"S2433\"],\n        // [\"S2434\"],\n        // [\"S2435\"],\n        // [\"S2436\"],\n        [\"S2437\"] = \"CODE_SMELL\",\n        // [\"S2438\"],\n        // [\"S2439\"],\n        // [\"S2440\"],\n        // [\"S2441\"],\n        // [\"S2442\"],\n        // [\"S2443\"],\n        // [\"S2444\"],\n        // [\"S2445\"],\n        // [\"S2446\"],\n        // [\"S2447\"],\n        // [\"S2448\"],\n        // [\"S2449\"],\n        // [\"S2450\"],\n        // [\"S2451\"],\n        // [\"S2452\"],\n        // [\"S2453\"],\n        // [\"S2454\"],\n        // [\"S2455\"],\n        // [\"S2456\"],\n        // [\"S2457\"],\n        // [\"S2458\"],\n        // [\"S2459\"],\n        // [\"S2460\"],\n        // [\"S2461\"],\n        // [\"S2462\"],\n        // [\"S2463\"],\n        // [\"S2464\"],\n        // [\"S2465\"],\n        // [\"S2466\"],\n        // [\"S2467\"],\n        // [\"S2468\"],\n        // [\"S2469\"],\n        // [\"S2470\"],\n        // [\"S2471\"],\n        // [\"S2472\"],\n        // [\"S2473\"],\n        // [\"S2474\"],\n        // [\"S2475\"],\n        // [\"S2476\"],\n        // [\"S2477\"],\n        // [\"S2478\"],\n        // [\"S2479\"],\n        // [\"S2480\"],\n        // [\"S2481\"],\n        // [\"S2482\"],\n        // [\"S2483\"],\n        // [\"S2484\"],\n        // [\"S2485\"],\n        // [\"S2486\"],\n        // [\"S2487\"],\n        // [\"S2488\"],\n        // [\"S2489\"],\n        // [\"S2490\"],\n        // [\"S2491\"],\n        // [\"S2492\"],\n        // [\"S2493\"],\n        // [\"S2494\"],\n        // [\"S2495\"],\n        // [\"S2496\"],\n        // [\"S2497\"],\n        // [\"S2498\"],\n        // [\"S2499\"],\n        // [\"S2500\"],\n        // [\"S2501\"],\n        // [\"S2502\"],\n        // [\"S2503\"],\n        // [\"S2504\"],\n        // [\"S2505\"],\n        // [\"S2506\"],\n        // [\"S2507\"],\n        // [\"S2508\"],\n        // [\"S2509\"],\n        // [\"S2510\"],\n        // [\"S2511\"],\n        // [\"S2512\"],\n        // [\"S2513\"],\n        // [\"S2514\"],\n        // [\"S2515\"],\n        // [\"S2516\"],\n        // [\"S2517\"],\n        // [\"S2518\"],\n        // [\"S2519\"],\n        // [\"S2520\"],\n        // [\"S2521\"],\n        // [\"S2522\"],\n        // [\"S2523\"],\n        // [\"S2524\"],\n        // [\"S2525\"],\n        // [\"S2526\"],\n        // [\"S2527\"],\n        // [\"S2528\"],\n        // [\"S2529\"],\n        // [\"S2530\"],\n        // [\"S2531\"],\n        // [\"S2532\"],\n        // [\"S2533\"],\n        // [\"S2534\"],\n        // [\"S2535\"],\n        // [\"S2536\"],\n        // [\"S2537\"],\n        // [\"S2538\"],\n        // [\"S2539\"],\n        // [\"S2540\"],\n        // [\"S2541\"],\n        // [\"S2542\"],\n        // [\"S2543\"],\n        // [\"S2544\"],\n        // [\"S2545\"],\n        // [\"S2546\"],\n        // [\"S2547\"],\n        // [\"S2548\"],\n        // [\"S2549\"],\n        // [\"S2550\"],\n        [\"S2551\"] = \"BUG\",\n        // [\"S2552\"],\n        // [\"S2553\"],\n        // [\"S2554\"],\n        // [\"S2555\"],\n        // [\"S2556\"],\n        // [\"S2557\"],\n        // [\"S2558\"],\n        // [\"S2559\"],\n        // [\"S2560\"],\n        // [\"S2561\"],\n        // [\"S2562\"],\n        // [\"S2563\"],\n        // [\"S2564\"],\n        // [\"S2565\"],\n        // [\"S2566\"],\n        // [\"S2567\"],\n        // [\"S2568\"],\n        // [\"S2569\"],\n        // [\"S2570\"],\n        // [\"S2571\"],\n        // [\"S2572\"],\n        // [\"S2573\"],\n        // [\"S2574\"],\n        // [\"S2575\"],\n        // [\"S2576\"],\n        // [\"S2577\"],\n        // [\"S2578\"],\n        // [\"S2579\"],\n        // [\"S2580\"],\n        // [\"S2581\"],\n        // [\"S2582\"],\n        [\"S2583\"] = \"BUG\",\n        // [\"S2584\"],\n        // [\"S2585\"],\n        // [\"S2586\"],\n        // [\"S2587\"],\n        // [\"S2588\"],\n        [\"S2589\"] = \"CODE_SMELL\",\n        // [\"S2590\"],\n        // [\"S2591\"],\n        // [\"S2592\"],\n        // [\"S2593\"],\n        // [\"S2594\"],\n        // [\"S2595\"],\n        // [\"S2596\"],\n        // [\"S2597\"],\n        // [\"S2598\"],\n        // [\"S2599\"],\n        // [\"S2600\"],\n        // [\"S2601\"],\n        // [\"S2602\"],\n        // [\"S2603\"],\n        // [\"S2604\"],\n        // [\"S2605\"],\n        // [\"S2606\"],\n        // [\"S2607\"],\n        // [\"S2608\"],\n        // [\"S2609\"],\n        // [\"S2610\"],\n        // [\"S2611\"],\n        [\"S2612\"] = \"VULNERABILITY\",\n        // [\"S2613\"],\n        // [\"S2614\"],\n        // [\"S2615\"],\n        // [\"S2616\"],\n        // [\"S2617\"],\n        // [\"S2618\"],\n        // [\"S2619\"],\n        // [\"S2620\"],\n        // [\"S2621\"],\n        // [\"S2622\"],\n        // [\"S2623\"],\n        // [\"S2624\"],\n        // [\"S2625\"],\n        // [\"S2626\"],\n        // [\"S2627\"],\n        // [\"S2628\"],\n        // [\"S2629\"],\n        // [\"S2630\"],\n        // [\"S2631\"],\n        // [\"S2632\"],\n        // [\"S2633\"],\n        // [\"S2634\"],\n        // [\"S2635\"],\n        // [\"S2636\"],\n        // [\"S2637\"],\n        // [\"S2638\"],\n        // [\"S2639\"],\n        // [\"S2640\"],\n        // [\"S2641\"],\n        // [\"S2642\"],\n        // [\"S2643\"],\n        // [\"S2644\"],\n        // [\"S2645\"],\n        // [\"S2646\"],\n        // [\"S2647\"],\n        // [\"S2648\"],\n        // [\"S2649\"],\n        // [\"S2650\"],\n        // [\"S2651\"],\n        // [\"S2652\"],\n        // [\"S2653\"],\n        // [\"S2654\"],\n        // [\"S2655\"],\n        // [\"S2656\"],\n        // [\"S2657\"],\n        // [\"S2658\"],\n        // [\"S2659\"],\n        // [\"S2660\"],\n        // [\"S2661\"],\n        // [\"S2662\"],\n        // [\"S2663\"],\n        // [\"S2664\"],\n        // [\"S2665\"],\n        // [\"S2666\"],\n        // [\"S2667\"],\n        // [\"S2668\"],\n        // [\"S2669\"],\n        // [\"S2670\"],\n        // [\"S2671\"],\n        // [\"S2672\"],\n        // [\"S2673\"],\n        // [\"S2674\"],\n        // [\"S2675\"],\n        // [\"S2676\"],\n        // [\"S2677\"],\n        // [\"S2678\"],\n        // [\"S2679\"],\n        // [\"S2680\"],\n        // [\"S2681\"],\n        // [\"S2682\"],\n        // [\"S2683\"],\n        // [\"S2684\"],\n        // [\"S2685\"],\n        // [\"S2686\"],\n        // [\"S2687\"],\n        // [\"S2688\"],\n        // [\"S2689\"],\n        // [\"S2690\"],\n        // [\"S2691\"],\n        [\"S2692\"] = \"CODE_SMELL\",\n        // [\"S2693\"],\n        // [\"S2694\"],\n        // [\"S2695\"],\n        // [\"S2696\"],\n        // [\"S2697\"],\n        // [\"S2698\"],\n        // [\"S2699\"],\n        // [\"S2700\"],\n        // [\"S2701\"],\n        // [\"S2702\"],\n        // [\"S2703\"],\n        // [\"S2704\"],\n        // [\"S2705\"],\n        // [\"S2706\"],\n        // [\"S2707\"],\n        // [\"S2708\"],\n        // [\"S2709\"],\n        // [\"S2710\"],\n        // [\"S2711\"],\n        // [\"S2712\"],\n        // [\"S2713\"],\n        // [\"S2714\"],\n        // [\"S2715\"],\n        // [\"S2716\"],\n        // [\"S2717\"],\n        // [\"S2718\"],\n        // [\"S2719\"],\n        // [\"S2720\"],\n        // [\"S2721\"],\n        // [\"S2722\"],\n        // [\"S2723\"],\n        // [\"S2724\"],\n        // [\"S2725\"],\n        // [\"S2726\"],\n        // [\"S2727\"],\n        // [\"S2728\"],\n        // [\"S2729\"],\n        // [\"S2730\"],\n        // [\"S2731\"],\n        // [\"S2732\"],\n        // [\"S2733\"],\n        // [\"S2734\"],\n        // [\"S2735\"],\n        // [\"S2736\"],\n        [\"S2737\"] = \"CODE_SMELL\",\n        // [\"S2738\"],\n        // [\"S2739\"],\n        // [\"S2740\"],\n        // [\"S2741\"],\n        // [\"S2742\"],\n        // [\"S2743\"],\n        // [\"S2744\"],\n        // [\"S2745\"],\n        // [\"S2746\"],\n        // [\"S2747\"],\n        // [\"S2748\"],\n        // [\"S2749\"],\n        // [\"S2750\"],\n        // [\"S2751\"],\n        // [\"S2752\"],\n        // [\"S2753\"],\n        // [\"S2754\"],\n        // [\"S2755\"],\n        // [\"S2756\"],\n        [\"S2757\"] = \"BUG\",\n        // [\"S2758\"],\n        // [\"S2759\"],\n        // [\"S2760\"],\n        [\"S2761\"] = \"BUG\",\n        // [\"S2762\"],\n        // [\"S2763\"],\n        // [\"S2764\"],\n        // [\"S2765\"],\n        // [\"S2766\"],\n        // [\"S2767\"],\n        // [\"S2768\"],\n        // [\"S2769\"],\n        // [\"S2770\"],\n        // [\"S2771\"],\n        // [\"S2772\"],\n        // [\"S2773\"],\n        // [\"S2774\"],\n        // [\"S2775\"],\n        // [\"S2776\"],\n        // [\"S2777\"],\n        // [\"S2778\"],\n        // [\"S2779\"],\n        // [\"S2780\"],\n        // [\"S2781\"],\n        // [\"S2782\"],\n        // [\"S2783\"],\n        // [\"S2784\"],\n        // [\"S2785\"],\n        // [\"S2786\"],\n        // [\"S2787\"],\n        // [\"S2788\"],\n        // [\"S2789\"],\n        // [\"S2790\"],\n        // [\"S2791\"],\n        // [\"S2792\"],\n        // [\"S2793\"],\n        // [\"S2794\"],\n        // [\"S2795\"],\n        // [\"S2796\"],\n        // [\"S2797\"],\n        // [\"S2798\"],\n        // [\"S2799\"],\n        // [\"S2800\"],\n        // [\"S2801\"],\n        // [\"S2802\"],\n        // [\"S2803\"],\n        // [\"S2804\"],\n        // [\"S2805\"],\n        // [\"S2806\"],\n        // [\"S2807\"],\n        // [\"S2808\"],\n        // [\"S2809\"],\n        // [\"S2810\"],\n        // [\"S2811\"],\n        // [\"S2812\"],\n        // [\"S2813\"],\n        // [\"S2814\"],\n        // [\"S2815\"],\n        // [\"S2816\"],\n        // [\"S2817\"],\n        // [\"S2818\"],\n        // [\"S2819\"],\n        // [\"S2820\"],\n        // [\"S2821\"],\n        // [\"S2822\"],\n        // [\"S2823\"],\n        // [\"S2824\"],\n        // [\"S2825\"],\n        // [\"S2826\"],\n        // [\"S2827\"],\n        // [\"S2828\"],\n        // [\"S2829\"],\n        // [\"S2830\"],\n        // [\"S2831\"],\n        // [\"S2832\"],\n        // [\"S2833\"],\n        // [\"S2834\"],\n        // [\"S2835\"],\n        // [\"S2836\"],\n        // [\"S2837\"],\n        // [\"S2838\"],\n        // [\"S2839\"],\n        // [\"S2840\"],\n        // [\"S2841\"],\n        // [\"S2842\"],\n        // [\"S2843\"],\n        // [\"S2844\"],\n        // [\"S2845\"],\n        // [\"S2846\"],\n        // [\"S2847\"],\n        // [\"S2848\"],\n        // [\"S2849\"],\n        // [\"S2850\"],\n        // [\"S2851\"],\n        // [\"S2852\"],\n        // [\"S2853\"],\n        // [\"S2854\"],\n        // [\"S2855\"],\n        // [\"S2856\"],\n        // [\"S2857\"],\n        // [\"S2858\"],\n        // [\"S2859\"],\n        // [\"S2860\"],\n        // [\"S2861\"],\n        // [\"S2862\"],\n        // [\"S2863\"],\n        // [\"S2864\"],\n        // [\"S2865\"],\n        // [\"S2866\"],\n        // [\"S2867\"],\n        // [\"S2868\"],\n        // [\"S2869\"],\n        // [\"S2870\"],\n        // [\"S2871\"],\n        // [\"S2872\"],\n        // [\"S2873\"],\n        // [\"S2874\"],\n        // [\"S2875\"],\n        // [\"S2876\"],\n        // [\"S2877\"],\n        // [\"S2878\"],\n        // [\"S2879\"],\n        // [\"S2880\"],\n        // [\"S2881\"],\n        // [\"S2882\"],\n        // [\"S2883\"],\n        // [\"S2884\"],\n        // [\"S2885\"],\n        // [\"S2886\"],\n        // [\"S2887\"],\n        // [\"S2888\"],\n        // [\"S2889\"],\n        // [\"S2890\"],\n        // [\"S2891\"],\n        // [\"S2892\"],\n        // [\"S2893\"],\n        // [\"S2894\"],\n        // [\"S2895\"],\n        // [\"S2896\"],\n        // [\"S2897\"],\n        // [\"S2898\"],\n        // [\"S2899\"],\n        // [\"S2900\"],\n        // [\"S2901\"],\n        // [\"S2902\"],\n        // [\"S2903\"],\n        // [\"S2904\"],\n        // [\"S2905\"],\n        // [\"S2906\"],\n        // [\"S2907\"],\n        // [\"S2908\"],\n        // [\"S2909\"],\n        // [\"S2910\"],\n        // [\"S2911\"],\n        // [\"S2912\"],\n        // [\"S2913\"],\n        // [\"S2914\"],\n        // [\"S2915\"],\n        // [\"S2916\"],\n        // [\"S2917\"],\n        // [\"S2918\"],\n        // [\"S2919\"],\n        // [\"S2920\"],\n        // [\"S2921\"],\n        // [\"S2922\"],\n        // [\"S2923\"],\n        // [\"S2924\"],\n        [\"S2925\"] = \"CODE_SMELL\",\n        // [\"S2926\"],\n        // [\"S2927\"],\n        // [\"S2928\"],\n        // [\"S2929\"],\n        // [\"S2930\"],\n        // [\"S2931\"],\n        // [\"S2932\"],\n        // [\"S2933\"],\n        // [\"S2934\"],\n        // [\"S2935\"],\n        // [\"S2936\"],\n        // [\"S2937\"],\n        // [\"S2938\"],\n        // [\"S2939\"],\n        // [\"S2940\"],\n        // [\"S2941\"],\n        // [\"S2942\"],\n        // [\"S2943\"],\n        // [\"S2944\"],\n        // [\"S2945\"],\n        // [\"S2946\"],\n        // [\"S2947\"],\n        // [\"S2948\"],\n        // [\"S2949\"],\n        // [\"S2950\"],\n        [\"S2951\"] = \"CODE_SMELL\",\n        // [\"S2952\"],\n        // [\"S2953\"],\n        // [\"S2954\"],\n        // [\"S2955\"],\n        // [\"S2956\"],\n        // [\"S2957\"],\n        // [\"S2958\"],\n        // [\"S2959\"],\n        // [\"S2960\"],\n        // [\"S2961\"],\n        // [\"S2962\"],\n        // [\"S2963\"],\n        // [\"S2964\"],\n        // [\"S2965\"],\n        // [\"S2966\"],\n        // [\"S2967\"],\n        // [\"S2968\"],\n        // [\"S2969\"],\n        // [\"S2970\"],\n        // [\"S2971\"],\n        // [\"S2972\"],\n        // [\"S2973\"],\n        // [\"S2974\"],\n        // [\"S2975\"],\n        // [\"S2976\"],\n        // [\"S2977\"],\n        // [\"S2978\"],\n        // [\"S2979\"],\n        // [\"S2980\"],\n        // [\"S2981\"],\n        // [\"S2982\"],\n        // [\"S2983\"],\n        // [\"S2984\"],\n        // [\"S2985\"],\n        // [\"S2986\"],\n        // [\"S2987\"],\n        // [\"S2988\"],\n        // [\"S2989\"],\n        // [\"S2990\"],\n        // [\"S2991\"],\n        // [\"S2992\"],\n        // [\"S2993\"],\n        // [\"S2994\"],\n        // [\"S2995\"],\n        // [\"S2996\"],\n        // [\"S2997\"],\n        // [\"S2998\"],\n        // [\"S2999\"],\n        // [\"S3000\"],\n        // [\"S3001\"],\n        // [\"S3002\"],\n        // [\"S3003\"],\n        // [\"S3004\"],\n        // [\"S3005\"],\n        // [\"S3006\"],\n        // [\"S3007\"],\n        // [\"S3008\"],\n        // [\"S3009\"],\n        // [\"S3010\"],\n        [\"S3011\"] = \"CODE_SMELL\",\n        // [\"S3012\"],\n        // [\"S3013\"],\n        // [\"S3014\"],\n        // [\"S3015\"],\n        // [\"S3016\"],\n        // [\"S3017\"],\n        // [\"S3018\"],\n        // [\"S3019\"],\n        // [\"S3020\"],\n        // [\"S3021\"],\n        // [\"S3022\"],\n        // [\"S3023\"],\n        // [\"S3024\"],\n        // [\"S3025\"],\n        // [\"S3026\"],\n        // [\"S3027\"],\n        // [\"S3028\"],\n        // [\"S3029\"],\n        // [\"S3030\"],\n        // [\"S3031\"],\n        // [\"S3032\"],\n        // [\"S3033\"],\n        // [\"S3034\"],\n        // [\"S3035\"],\n        // [\"S3036\"],\n        // [\"S3037\"],\n        // [\"S3038\"],\n        // [\"S3039\"],\n        // [\"S3040\"],\n        // [\"S3041\"],\n        // [\"S3042\"],\n        // [\"S3043\"],\n        // [\"S3044\"],\n        // [\"S3045\"],\n        // [\"S3046\"],\n        // [\"S3047\"],\n        // [\"S3048\"],\n        // [\"S3049\"],\n        // [\"S3050\"],\n        // [\"S3051\"],\n        // [\"S3052\"],\n        // [\"S3053\"],\n        // [\"S3054\"],\n        // [\"S3055\"],\n        // [\"S3056\"],\n        // [\"S3057\"],\n        // [\"S3058\"],\n        // [\"S3059\"],\n        // [\"S3060\"],\n        // [\"S3061\"],\n        // [\"S3062\"],\n        [\"S3063\"] = \"CODE_SMELL\",\n        // [\"S3064\"],\n        // [\"S3065\"],\n        // [\"S3066\"],\n        // [\"S3067\"],\n        // [\"S3068\"],\n        // [\"S3069\"],\n        // [\"S3070\"],\n        // [\"S3071\"],\n        // [\"S3072\"],\n        // [\"S3073\"],\n        // [\"S3074\"],\n        // [\"S3075\"],\n        // [\"S3076\"],\n        // [\"S3077\"],\n        // [\"S3078\"],\n        // [\"S3079\"],\n        // [\"S3080\"],\n        // [\"S3081\"],\n        // [\"S3082\"],\n        // [\"S3083\"],\n        // [\"S3084\"],\n        // [\"S3085\"],\n        // [\"S3086\"],\n        // [\"S3087\"],\n        // [\"S3088\"],\n        // [\"S3089\"],\n        // [\"S3090\"],\n        // [\"S3091\"],\n        // [\"S3092\"],\n        // [\"S3093\"],\n        // [\"S3094\"],\n        // [\"S3095\"],\n        // [\"S3096\"],\n        // [\"S3097\"],\n        // [\"S3098\"],\n        // [\"S3099\"],\n        // [\"S3100\"],\n        // [\"S3101\"],\n        // [\"S3102\"],\n        // [\"S3103\"],\n        // [\"S3104\"],\n        // [\"S3105\"],\n        // [\"S3106\"],\n        // [\"S3107\"],\n        // [\"S3108\"],\n        // [\"S3109\"],\n        // [\"S3110\"],\n        // [\"S3111\"],\n        // [\"S3112\"],\n        // [\"S3113\"],\n        // [\"S3114\"],\n        // [\"S3115\"],\n        // [\"S3116\"],\n        // [\"S3117\"],\n        // [\"S3118\"],\n        // [\"S3119\"],\n        // [\"S3120\"],\n        // [\"S3121\"],\n        // [\"S3122\"],\n        // [\"S3123\"],\n        // [\"S3124\"],\n        // [\"S3125\"],\n        // [\"S3126\"],\n        // [\"S3127\"],\n        // [\"S3128\"],\n        // [\"S3129\"],\n        // [\"S3130\"],\n        // [\"S3131\"],\n        // [\"S3132\"],\n        // [\"S3133\"],\n        // [\"S3134\"],\n        // [\"S3135\"],\n        // [\"S3136\"],\n        // [\"S3137\"],\n        // [\"S3138\"],\n        // [\"S3139\"],\n        // [\"S3140\"],\n        // [\"S3141\"],\n        // [\"S3142\"],\n        // [\"S3143\"],\n        // [\"S3144\"],\n        // [\"S3145\"],\n        // [\"S3146\"],\n        // [\"S3147\"],\n        // [\"S3148\"],\n        // [\"S3149\"],\n        // [\"S3150\"],\n        // [\"S3151\"],\n        // [\"S3152\"],\n        // [\"S3153\"],\n        // [\"S3154\"],\n        // [\"S3155\"],\n        // [\"S3156\"],\n        // [\"S3157\"],\n        // [\"S3158\"],\n        // [\"S3159\"],\n        // [\"S3160\"],\n        // [\"S3161\"],\n        // [\"S3162\"],\n        // [\"S3163\"],\n        // [\"S3164\"],\n        // [\"S3165\"],\n        // [\"S3166\"],\n        // [\"S3167\"],\n        // [\"S3168\"],\n        // [\"S3169\"],\n        // [\"S3170\"],\n        // [\"S3171\"],\n        // [\"S3172\"],\n        // [\"S3173\"],\n        // [\"S3174\"],\n        // [\"S3175\"],\n        // [\"S3176\"],\n        // [\"S3177\"],\n        // [\"S3178\"],\n        // [\"S3179\"],\n        // [\"S3180\"],\n        // [\"S3181\"],\n        // [\"S3182\"],\n        // [\"S3183\"],\n        // [\"S3184\"],\n        // [\"S3185\"],\n        // [\"S3186\"],\n        // [\"S3187\"],\n        // [\"S3188\"],\n        // [\"S3189\"],\n        // [\"S3190\"],\n        // [\"S3191\"],\n        // [\"S3192\"],\n        // [\"S3193\"],\n        // [\"S3194\"],\n        // [\"S3195\"],\n        // [\"S3196\"],\n        // [\"S3197\"],\n        // [\"S3198\"],\n        // [\"S3199\"],\n        // [\"S3200\"],\n        // [\"S3201\"],\n        // [\"S3202\"],\n        // [\"S3203\"],\n        // [\"S3204\"],\n        // [\"S3205\"],\n        // [\"S3206\"],\n        // [\"S3207\"],\n        // [\"S3208\"],\n        // [\"S3209\"],\n        // [\"S3210\"],\n        // [\"S3211\"],\n        // [\"S3212\"],\n        // [\"S3213\"],\n        // [\"S3214\"],\n        // [\"S3215\"],\n        // [\"S3216\"],\n        // [\"S3217\"],\n        // [\"S3218\"],\n        // [\"S3219\"],\n        // [\"S3220\"],\n        // [\"S3221\"],\n        // [\"S3222\"],\n        // [\"S3223\"],\n        // [\"S3224\"],\n        // [\"S3225\"],\n        // [\"S3226\"],\n        // [\"S3227\"],\n        // [\"S3228\"],\n        // [\"S3229\"],\n        // [\"S3230\"],\n        // [\"S3231\"],\n        // [\"S3232\"],\n        // [\"S3233\"],\n        // [\"S3234\"],\n        // [\"S3235\"],\n        // [\"S3236\"],\n        // [\"S3237\"],\n        // [\"S3238\"],\n        // [\"S3239\"],\n        // [\"S3240\"],\n        // [\"S3241\"],\n        // [\"S3242\"],\n        // [\"S3243\"],\n        // [\"S3244\"],\n        // [\"S3245\"],\n        // [\"S3246\"],\n        // [\"S3247\"],\n        // [\"S3248\"],\n        // [\"S3249\"],\n        // [\"S3250\"],\n        // [\"S3251\"],\n        // [\"S3252\"],\n        // [\"S3253\"],\n        // [\"S3254\"],\n        // [\"S3255\"],\n        // [\"S3256\"],\n        // [\"S3257\"],\n        // [\"S3258\"],\n        // [\"S3259\"],\n        // [\"S3260\"],\n        // [\"S3261\"],\n        // [\"S3262\"],\n        // [\"S3263\"],\n        // [\"S3264\"],\n        // [\"S3265\"],\n        // [\"S3266\"],\n        // [\"S3267\"],\n        // [\"S3268\"],\n        // [\"S3269\"],\n        // [\"S3270\"],\n        // [\"S3271\"],\n        // [\"S3272\"],\n        // [\"S3273\"],\n        // [\"S3274\"],\n        // [\"S3275\"],\n        // [\"S3276\"],\n        // [\"S3277\"],\n        // [\"S3278\"],\n        // [\"S3279\"],\n        // [\"S3280\"],\n        // [\"S3281\"],\n        // [\"S3282\"],\n        // [\"S3283\"],\n        // [\"S3284\"],\n        // [\"S3285\"],\n        // [\"S3286\"],\n        // [\"S3287\"],\n        // [\"S3288\"],\n        // [\"S3289\"],\n        // [\"S3290\"],\n        // [\"S3291\"],\n        // [\"S3292\"],\n        // [\"S3293\"],\n        // [\"S3294\"],\n        // [\"S3295\"],\n        // [\"S3296\"],\n        // [\"S3297\"],\n        // [\"S3298\"],\n        // [\"S3299\"],\n        // [\"S3300\"],\n        // [\"S3301\"],\n        // [\"S3302\"],\n        // [\"S3303\"],\n        // [\"S3304\"],\n        // [\"S3305\"],\n        // [\"S3306\"],\n        // [\"S3307\"],\n        // [\"S3308\"],\n        // [\"S3309\"],\n        // [\"S3310\"],\n        // [\"S3311\"],\n        // [\"S3312\"],\n        // [\"S3313\"],\n        // [\"S3314\"],\n        // [\"S3315\"],\n        // [\"S3316\"],\n        // [\"S3317\"],\n        // [\"S3318\"],\n        // [\"S3319\"],\n        // [\"S3320\"],\n        // [\"S3321\"],\n        // [\"S3322\"],\n        // [\"S3323\"],\n        // [\"S3324\"],\n        // [\"S3325\"],\n        // [\"S3326\"],\n        // [\"S3327\"],\n        // [\"S3328\"],\n        [\"S3329\"] = \"VULNERABILITY\",\n        // [\"S3330\"],\n        // [\"S3331\"],\n        // [\"S3332\"],\n        // [\"S3333\"],\n        // [\"S3334\"],\n        // [\"S3335\"],\n        // [\"S3336\"],\n        // [\"S3337\"],\n        // [\"S3338\"],\n        // [\"S3339\"],\n        // [\"S3340\"],\n        // [\"S3341\"],\n        // [\"S3342\"],\n        // [\"S3343\"],\n        // [\"S3344\"],\n        // [\"S3345\"],\n        // [\"S3346\"],\n        // [\"S3347\"],\n        // [\"S3348\"],\n        // [\"S3349\"],\n        // [\"S3350\"],\n        // [\"S3351\"],\n        // [\"S3352\"],\n        // [\"S3353\"],\n        // [\"S3354\"],\n        // [\"S3355\"],\n        // [\"S3356\"],\n        // [\"S3357\"],\n        [\"S3358\"] = \"CODE_SMELL\",\n        // [\"S3359\"],\n        // [\"S3360\"],\n        // [\"S3361\"],\n        // [\"S3362\"],\n        [\"S3363\"] = \"BUG\",\n        // [\"S3364\"],\n        // [\"S3365\"],\n        // [\"S3366\"],\n        // [\"S3367\"],\n        // [\"S3368\"],\n        // [\"S3369\"],\n        // [\"S3370\"],\n        // [\"S3371\"],\n        // [\"S3372\"],\n        // [\"S3373\"],\n        // [\"S3374\"],\n        // [\"S3375\"],\n        // [\"S3376\"],\n        // [\"S3377\"],\n        // [\"S3378\"],\n        // [\"S3379\"],\n        // [\"S3380\"],\n        // [\"S3381\"],\n        // [\"S3382\"],\n        // [\"S3383\"],\n        // [\"S3384\"],\n        [\"S3385\"] = \"CODE_SMELL\",\n        // [\"S3386\"],\n        // [\"S3387\"],\n        // [\"S3388\"],\n        // [\"S3389\"],\n        // [\"S3390\"],\n        // [\"S3391\"],\n        // [\"S3392\"],\n        // [\"S3393\"],\n        // [\"S3394\"],\n        // [\"S3395\"],\n        // [\"S3396\"],\n        // [\"S3397\"],\n        // [\"S3398\"],\n        // [\"S3399\"],\n        // [\"S3400\"],\n        // [\"S3401\"],\n        // [\"S3402\"],\n        // [\"S3403\"],\n        // [\"S3404\"],\n        // [\"S3405\"],\n        // [\"S3406\"],\n        // [\"S3407\"],\n        // [\"S3408\"],\n        // [\"S3409\"],\n        // [\"S3410\"],\n        // [\"S3411\"],\n        // [\"S3412\"],\n        // [\"S3413\"],\n        // [\"S3414\"],\n        // [\"S3415\"],\n        // [\"S3416\"],\n        // [\"S3417\"],\n        // [\"S3418\"],\n        // [\"S3419\"],\n        // [\"S3420\"],\n        // [\"S3421\"],\n        // [\"S3422\"],\n        // [\"S3423\"],\n        // [\"S3424\"],\n        // [\"S3425\"],\n        // [\"S3426\"],\n        // [\"S3427\"],\n        // [\"S3428\"],\n        // [\"S3429\"],\n        // [\"S3430\"],\n        [\"S3431\"] = \"CODE_SMELL\",\n        // [\"S3432\"],\n        // [\"S3433\"],\n        // [\"S3434\"],\n        // [\"S3435\"],\n        // [\"S3436\"],\n        // [\"S3437\"],\n        // [\"S3438\"],\n        // [\"S3439\"],\n        // [\"S3440\"],\n        // [\"S3441\"],\n        // [\"S3442\"],\n        // [\"S3443\"],\n        // [\"S3444\"],\n        // [\"S3445\"],\n        // [\"S3446\"],\n        // [\"S3447\"],\n        // [\"S3448\"],\n        [\"S3449\"] = \"BUG\",\n        // [\"S3450\"],\n        // [\"S3451\"],\n        // [\"S3452\"],\n        [\"S3453\"] = \"BUG\",\n        // [\"S3454\"],\n        // [\"S3455\"],\n        // [\"S3456\"],\n        // [\"S3457\"],\n        // [\"S3458\"],\n        // [\"S3459\"],\n        // [\"S3460\"],\n        // [\"S3461\"],\n        // [\"S3462\"],\n        // [\"S3463\"],\n        [\"S3464\"] = \"BUG\",\n        // [\"S3465\"],\n        [\"S3466\"] = \"BUG\",\n        // [\"S3467\"],\n        // [\"S3468\"],\n        // [\"S3469\"],\n        // [\"S3470\"],\n        // [\"S3471\"],\n        // [\"S3472\"],\n        // [\"S3473\"],\n        // [\"S3474\"],\n        // [\"S3475\"],\n        // [\"S3476\"],\n        // [\"S3477\"],\n        // [\"S3478\"],\n        // [\"S3479\"],\n        // [\"S3480\"],\n        // [\"S3481\"],\n        // [\"S3482\"],\n        // [\"S3483\"],\n        // [\"S3484\"],\n        // [\"S3485\"],\n        // [\"S3486\"],\n        // [\"S3487\"],\n        // [\"S3488\"],\n        // [\"S3489\"],\n        // [\"S3490\"],\n        // [\"S3491\"],\n        // [\"S3492\"],\n        // [\"S3493\"],\n        // [\"S3494\"],\n        // [\"S3495\"],\n        // [\"S3496\"],\n        // [\"S3497\"],\n        // [\"S3498\"],\n        // [\"S3499\"],\n        // [\"S3500\"],\n        // [\"S3501\"],\n        // [\"S3502\"],\n        // [\"S3503\"],\n        // [\"S3504\"],\n        // [\"S3505\"],\n        // [\"S3506\"],\n        // [\"S3507\"],\n        // [\"S3508\"],\n        // [\"S3509\"],\n        // [\"S3510\"],\n        // [\"S3511\"],\n        // [\"S3512\"],\n        // [\"S3513\"],\n        // [\"S3514\"],\n        // [\"S3515\"],\n        // [\"S3516\"],\n        // [\"S3517\"],\n        // [\"S3518\"],\n        // [\"S3519\"],\n        // [\"S3520\"],\n        // [\"S3521\"],\n        // [\"S3522\"],\n        // [\"S3523\"],\n        // [\"S3524\"],\n        // [\"S3525\"],\n        // [\"S3526\"],\n        // [\"S3527\"],\n        // [\"S3528\"],\n        // [\"S3529\"],\n        // [\"S3530\"],\n        // [\"S3531\"],\n        // [\"S3532\"],\n        // [\"S3533\"],\n        // [\"S3534\"],\n        // [\"S3535\"],\n        // [\"S3536\"],\n        // [\"S3537\"],\n        // [\"S3538\"],\n        // [\"S3539\"],\n        // [\"S3540\"],\n        // [\"S3541\"],\n        // [\"S3542\"],\n        // [\"S3543\"],\n        // [\"S3544\"],\n        // [\"S3545\"],\n        // [\"S3546\"],\n        // [\"S3547\"],\n        // [\"S3548\"],\n        // [\"S3549\"],\n        // [\"S3550\"],\n        // [\"S3551\"],\n        // [\"S3552\"],\n        // [\"S3553\"],\n        // [\"S3554\"],\n        // [\"S3555\"],\n        // [\"S3556\"],\n        // [\"S3557\"],\n        // [\"S3558\"],\n        // [\"S3559\"],\n        // [\"S3560\"],\n        // [\"S3561\"],\n        // [\"S3562\"],\n        // [\"S3563\"],\n        // [\"S3564\"],\n        // [\"S3565\"],\n        // [\"S3566\"],\n        // [\"S3567\"],\n        // [\"S3568\"],\n        // [\"S3569\"],\n        // [\"S3570\"],\n        // [\"S3571\"],\n        // [\"S3572\"],\n        // [\"S3573\"],\n        // [\"S3574\"],\n        // [\"S3575\"],\n        // [\"S3576\"],\n        // [\"S3577\"],\n        // [\"S3578\"],\n        // [\"S3579\"],\n        // [\"S3580\"],\n        // [\"S3581\"],\n        // [\"S3582\"],\n        // [\"S3583\"],\n        // [\"S3584\"],\n        // [\"S3585\"],\n        // [\"S3586\"],\n        // [\"S3587\"],\n        // [\"S3588\"],\n        // [\"S3589\"],\n        // [\"S3590\"],\n        // [\"S3591\"],\n        // [\"S3592\"],\n        // [\"S3593\"],\n        // [\"S3594\"],\n        // [\"S3595\"],\n        // [\"S3596\"],\n        // [\"S3597\"],\n        [\"S3598\"] = \"BUG\",\n        // [\"S3599\"],\n        // [\"S3600\"],\n        // [\"S3601\"],\n        // [\"S3602\"],\n        [\"S3603\"] = \"BUG\",\n        // [\"S3604\"],\n        // [\"S3605\"],\n        // [\"S3606\"],\n        // [\"S3607\"],\n        // [\"S3608\"],\n        // [\"S3609\"],\n        // [\"S3610\"],\n        // [\"S3611\"],\n        // [\"S3612\"],\n        // [\"S3613\"],\n        // [\"S3614\"],\n        // [\"S3615\"],\n        // [\"S3616\"],\n        // [\"S3617\"],\n        // [\"S3618\"],\n        // [\"S3619\"],\n        // [\"S3620\"],\n        // [\"S3621\"],\n        // [\"S3622\"],\n        // [\"S3623\"],\n        // [\"S3624\"],\n        // [\"S3625\"],\n        // [\"S3626\"],\n        // [\"S3627\"],\n        // [\"S3628\"],\n        // [\"S3629\"],\n        // [\"S3630\"],\n        // [\"S3631\"],\n        // [\"S3632\"],\n        // [\"S3633\"],\n        // [\"S3634\"],\n        // [\"S3635\"],\n        // [\"S3636\"],\n        // [\"S3637\"],\n        // [\"S3638\"],\n        // [\"S3639\"],\n        // [\"S3640\"],\n        // [\"S3641\"],\n        // [\"S3642\"],\n        // [\"S3643\"],\n        // [\"S3644\"],\n        // [\"S3645\"],\n        // [\"S3646\"],\n        // [\"S3647\"],\n        // [\"S3648\"],\n        // [\"S3649\"],\n        // [\"S3650\"],\n        // [\"S3651\"],\n        // [\"S3652\"],\n        // [\"S3653\"],\n        // [\"S3654\"],\n        [\"S3655\"] = \"BUG\",\n        // [\"S3656\"],\n        // [\"S3657\"],\n        // [\"S3658\"],\n        // [\"S3659\"],\n        // [\"S3660\"],\n        // [\"S3661\"],\n        // [\"S3662\"],\n        // [\"S3663\"],\n        // [\"S3664\"],\n        // [\"S3665\"],\n        // [\"S3666\"],\n        // [\"S3667\"],\n        // [\"S3668\"],\n        // [\"S3669\"],\n        // [\"S3670\"],\n        // [\"S3671\"],\n        // [\"S3672\"],\n        // [\"S3673\"],\n        // [\"S3674\"],\n        // [\"S3675\"],\n        // [\"S3676\"],\n        // [\"S3677\"],\n        // [\"S3678\"],\n        // [\"S3679\"],\n        // [\"S3680\"],\n        // [\"S3681\"],\n        // [\"S3682\"],\n        // [\"S3683\"],\n        // [\"S3684\"],\n        // [\"S3685\"],\n        // [\"S3686\"],\n        // [\"S3687\"],\n        // [\"S3688\"],\n        // [\"S3689\"],\n        // [\"S3690\"],\n        // [\"S3691\"],\n        // [\"S3692\"],\n        // [\"S3693\"],\n        // [\"S3694\"],\n        // [\"S3695\"],\n        // [\"S3696\"],\n        // [\"S3697\"],\n        // [\"S3698\"],\n        // [\"S3699\"],\n        // [\"S3700\"],\n        // [\"S3701\"],\n        // [\"S3702\"],\n        // [\"S3703\"],\n        // [\"S3704\"],\n        // [\"S3705\"],\n        // [\"S3706\"],\n        // [\"S3707\"],\n        // [\"S3708\"],\n        // [\"S3709\"],\n        // [\"S3710\"],\n        // [\"S3711\"],\n        // [\"S3712\"],\n        // [\"S3713\"],\n        // [\"S3714\"],\n        // [\"S3715\"],\n        // [\"S3716\"],\n        // [\"S3717\"],\n        // [\"S3718\"],\n        // [\"S3719\"],\n        // [\"S3720\"],\n        // [\"S3721\"],\n        // [\"S3722\"],\n        // [\"S3723\"],\n        // [\"S3724\"],\n        // [\"S3725\"],\n        // [\"S3726\"],\n        // [\"S3727\"],\n        // [\"S3728\"],\n        // [\"S3729\"],\n        // [\"S3730\"],\n        // [\"S3731\"],\n        // [\"S3732\"],\n        // [\"S3733\"],\n        // [\"S3734\"],\n        // [\"S3735\"],\n        // [\"S3736\"],\n        // [\"S3737\"],\n        // [\"S3738\"],\n        // [\"S3739\"],\n        // [\"S3740\"],\n        // [\"S3741\"],\n        // [\"S3742\"],\n        // [\"S3743\"],\n        // [\"S3744\"],\n        // [\"S3745\"],\n        // [\"S3746\"],\n        // [\"S3747\"],\n        // [\"S3748\"],\n        // [\"S3749\"],\n        // [\"S3750\"],\n        // [\"S3751\"],\n        // [\"S3752\"],\n        // [\"S3753\"],\n        // [\"S3754\"],\n        // [\"S3755\"],\n        // [\"S3756\"],\n        // [\"S3757\"],\n        // [\"S3758\"],\n        // [\"S3759\"],\n        // [\"S3760\"],\n        // [\"S3761\"],\n        // [\"S3762\"],\n        // [\"S3763\"],\n        // [\"S3764\"],\n        // [\"S3765\"],\n        // [\"S3766\"],\n        // [\"S3767\"],\n        // [\"S3768\"],\n        // [\"S3769\"],\n        // [\"S3770\"],\n        // [\"S3771\"],\n        // [\"S3772\"],\n        // [\"S3773\"],\n        // [\"S3774\"],\n        // [\"S3775\"],\n        [\"S3776\"] = \"CODE_SMELL\",\n        // [\"S3777\"],\n        // [\"S3778\"],\n        // [\"S3779\"],\n        // [\"S3780\"],\n        // [\"S3781\"],\n        // [\"S3782\"],\n        // [\"S3783\"],\n        // [\"S3784\"],\n        // [\"S3785\"],\n        // [\"S3786\"],\n        // [\"S3787\"],\n        // [\"S3788\"],\n        // [\"S3789\"],\n        // [\"S3790\"],\n        // [\"S3791\"],\n        // [\"S3792\"],\n        // [\"S3793\"],\n        // [\"S3794\"],\n        // [\"S3795\"],\n        // [\"S3796\"],\n        // [\"S3797\"],\n        // [\"S3798\"],\n        // [\"S3799\"],\n        // [\"S3800\"],\n        // [\"S3801\"],\n        // [\"S3802\"],\n        // [\"S3803\"],\n        // [\"S3804\"],\n        // [\"S3805\"],\n        // [\"S3806\"],\n        // [\"S3807\"],\n        // [\"S3808\"],\n        // [\"S3809\"],\n        // [\"S3810\"],\n        // [\"S3811\"],\n        // [\"S3812\"],\n        // [\"S3813\"],\n        // [\"S3814\"],\n        // [\"S3815\"],\n        // [\"S3816\"],\n        // [\"S3817\"],\n        // [\"S3818\"],\n        // [\"S3819\"],\n        // [\"S3820\"],\n        // [\"S3821\"],\n        // [\"S3822\"],\n        // [\"S3823\"],\n        // [\"S3824\"],\n        // [\"S3825\"],\n        // [\"S3826\"],\n        // [\"S3827\"],\n        // [\"S3828\"],\n        // [\"S3829\"],\n        // [\"S3830\"],\n        // [\"S3831\"],\n        // [\"S3832\"],\n        // [\"S3833\"],\n        // [\"S3834\"],\n        // [\"S3835\"],\n        // [\"S3836\"],\n        // [\"S3837\"],\n        // [\"S3838\"],\n        // [\"S3839\"],\n        // [\"S3840\"],\n        // [\"S3841\"],\n        // [\"S3842\"],\n        // [\"S3843\"],\n        // [\"S3844\"],\n        // [\"S3845\"],\n        // [\"S3846\"],\n        // [\"S3847\"],\n        // [\"S3848\"],\n        // [\"S3849\"],\n        // [\"S3850\"],\n        // [\"S3851\"],\n        // [\"S3852\"],\n        // [\"S3853\"],\n        // [\"S3854\"],\n        // [\"S3855\"],\n        // [\"S3856\"],\n        // [\"S3857\"],\n        // [\"S3858\"],\n        // [\"S3859\"],\n        [\"S3860\"] = \"CODE_SMELL\",\n        // [\"S3861\"],\n        // [\"S3862\"],\n        // [\"S3863\"],\n        // [\"S3864\"],\n        // [\"S3865\"],\n        [\"S3866\"] = \"CODE_SMELL\",\n        // [\"S3867\"],\n        // [\"S3868\"],\n        [\"S3869\"] = \"BUG\",\n        // [\"S3870\"],\n        [\"S3871\"] = \"CODE_SMELL\",\n        // [\"S3872\"],\n        // [\"S3873\"],\n        // [\"S3874\"],\n        // [\"S3875\"],\n        // [\"S3876\"],\n        // [\"S3877\"],\n        [\"S3878\"] = \"CODE_SMELL\",\n        // [\"S3879\"],\n        // [\"S3880\"],\n        // [\"S3881\"],\n        // [\"S3882\"],\n        // [\"S3883\"],\n        [\"S3884\"] = \"VULNERABILITY\",\n        // [\"S3885\"],\n        // [\"S3886\"],\n        // [\"S3887\"],\n        // [\"S3888\"],\n        [\"S3889\"] = \"BUG\",\n        // [\"S3890\"],\n        // [\"S3891\"],\n        // [\"S3892\"],\n        // [\"S3893\"],\n        // [\"S3894\"],\n        // [\"S3895\"],\n        // [\"S3896\"],\n        // [\"S3897\"],\n        [\"S3898\"] = \"CODE_SMELL\",\n        // [\"S3899\"],\n        [\"S3900\"] = \"CODE_SMELL\",\n        // [\"S3901\"],\n        // [\"S3902\"],\n        [\"S3903\"] = \"BUG\",\n        [\"S3904\"] = \"CODE_SMELL\",\n        // [\"S3905\"],\n        // [\"S3906\"],\n        // [\"S3907\"],\n        // [\"S3908\"],\n        // [\"S3909\"],\n        // [\"S3910\"],\n        // [\"S3911\"],\n        // [\"S3912\"],\n        // [\"S3913\"],\n        // [\"S3914\"],\n        // [\"S3915\"],\n        // [\"S3916\"],\n        // [\"S3917\"],\n        // [\"S3918\"],\n        // [\"S3919\"],\n        // [\"S3920\"],\n        // [\"S3921\"],\n        // [\"S3922\"],\n        [\"S3923\"] = \"BUG\",\n        // [\"S3924\"],\n        // [\"S3925\"],\n        [\"S3926\"] = \"BUG\",\n        [\"S3927\"] = \"BUG\",\n        // [\"S3928\"],\n        // [\"S3929\"],\n        // [\"S3930\"],\n        // [\"S3931\"],\n        // [\"S3932\"],\n        // [\"S3933\"],\n        // [\"S3934\"],\n        // [\"S3935\"],\n        // [\"S3936\"],\n        // [\"S3937\"],\n        // [\"S3938\"],\n        // [\"S3939\"],\n        // [\"S3940\"],\n        // [\"S3941\"],\n        // [\"S3942\"],\n        // [\"S3943\"],\n        // [\"S3944\"],\n        // [\"S3945\"],\n        // [\"S3946\"],\n        // [\"S3947\"],\n        // [\"S3948\"],\n        [\"S3949\"] = \"BUG\",\n        // [\"S3950\"],\n        // [\"S3951\"],\n        // [\"S3952\"],\n        // [\"S3953\"],\n        // [\"S3954\"],\n        // [\"S3955\"],\n        // [\"S3956\"],\n        // [\"S3957\"],\n        // [\"S3958\"],\n        // [\"S3959\"],\n        // [\"S3960\"],\n        // [\"S3961\"],\n        // [\"S3962\"],\n        // [\"S3963\"],\n        // [\"S3964\"],\n        // [\"S3965\"],\n        [\"S3966\"] = \"CODE_SMELL\",\n        // [\"S3967\"],\n        // [\"S3968\"],\n        // [\"S3969\"],\n        // [\"S3970\"],\n        // [\"S3971\"],\n        // [\"S3972\"],\n        // [\"S3973\"],\n        // [\"S3974\"],\n        // [\"S3975\"],\n        // [\"S3976\"],\n        // [\"S3977\"],\n        // [\"S3978\"],\n        // [\"S3979\"],\n        // [\"S3980\"],\n        [\"S3981\"] = \"BUG\",\n        // [\"S3982\"],\n        // [\"S3983\"],\n        // [\"S3984\"],\n        // [\"S3985\"],\n        // [\"S3986\"],\n        // [\"S3987\"],\n        // [\"S3988\"],\n        // [\"S3989\"],\n        [\"S3990\"] = \"CODE_SMELL\",\n        // [\"S3991\"],\n        [\"S3992\"] = \"CODE_SMELL\",\n        // [\"S3993\"],\n        // [\"S3994\"],\n        // [\"S3995\"],\n        // [\"S3996\"],\n        // [\"S3997\"],\n        [\"S3998\"] = \"CODE_SMELL\",\n        // [\"S3999\"],\n        // [\"S4000\"],\n        // [\"S4001\"],\n        // [\"S4002\"],\n        // [\"S4003\"],\n        // [\"S4004\"],\n        // [\"S4005\"],\n        // [\"S4006\"],\n        // [\"S4007\"],\n        // [\"S4008\"],\n        // [\"S4009\"],\n        // [\"S4010\"],\n        // [\"S4011\"],\n        // [\"S4012\"],\n        // [\"S4013\"],\n        // [\"S4014\"],\n        // [\"S4015\"],\n        // [\"S4016\"],\n        // [\"S4017\"],\n        // [\"S4018\"],\n        // [\"S4019\"],\n        // [\"S4020\"],\n        // [\"S4021\"],\n        // [\"S4022\"],\n        // [\"S4023\"],\n        // [\"S4024\"],\n        [\"S4025\"] = \"CODE_SMELL\",\n        // [\"S4026\"],\n        // [\"S4027\"],\n        // [\"S4028\"],\n        // [\"S4029\"],\n        // [\"S4030\"],\n        // [\"S4031\"],\n        // [\"S4032\"],\n        // [\"S4033\"],\n        // [\"S4034\"],\n        // [\"S4035\"],\n        [\"S4036\"] = \"SECURITY_HOTSPOT\",\n        // [\"S4037\"],\n        // [\"S4038\"],\n        // [\"S4039\"],\n        // [\"S4040\"],\n        // [\"S4041\"],\n        // [\"S4042\"],\n        // [\"S4043\"],\n        // [\"S4044\"],\n        // [\"S4045\"],\n        // [\"S4046\"],\n        // [\"S4047\"],\n        // [\"S4048\"],\n        // [\"S4049\"],\n        // [\"S4050\"],\n        // [\"S4051\"],\n        // [\"S4052\"],\n        // [\"S4053\"],\n        // [\"S4054\"],\n        // [\"S4055\"],\n        // [\"S4056\"],\n        // [\"S4057\"],\n        // [\"S4058\"],\n        // [\"S4059\"],\n        [\"S4060\"] = \"CODE_SMELL\",\n        // [\"S4061\"],\n        // [\"S4062\"],\n        // [\"S4063\"],\n        // [\"S4064\"],\n        // [\"S4065\"],\n        // [\"S4066\"],\n        // [\"S4067\"],\n        // [\"S4068\"],\n        // [\"S4069\"],\n        // [\"S4070\"],\n        // [\"S4071\"],\n        // [\"S4072\"],\n        // [\"S4073\"],\n        // [\"S4074\"],\n        // [\"S4075\"],\n        // [\"S4076\"],\n        // [\"S4077\"],\n        // [\"S4078\"],\n        // [\"S4079\"],\n        // [\"S4080\"],\n        // [\"S4081\"],\n        // [\"S4082\"],\n        // [\"S4083\"],\n        // [\"S4084\"],\n        // [\"S4085\"],\n        // [\"S4086\"],\n        // [\"S4087\"],\n        // [\"S4088\"],\n        // [\"S4089\"],\n        // [\"S4090\"],\n        // [\"S4091\"],\n        // [\"S4092\"],\n        // [\"S4093\"],\n        // [\"S4094\"],\n        // [\"S4095\"],\n        // [\"S4096\"],\n        // [\"S4097\"],\n        // [\"S4098\"],\n        // [\"S4099\"],\n        // [\"S4100\"],\n        // [\"S4101\"],\n        // [\"S4102\"],\n        // [\"S4103\"],\n        // [\"S4104\"],\n        // [\"S4105\"],\n        // [\"S4106\"],\n        // [\"S4107\"],\n        // [\"S4108\"],\n        // [\"S4109\"],\n        // [\"S4110\"],\n        // [\"S4111\"],\n        // [\"S4112\"],\n        // [\"S4113\"],\n        // [\"S4114\"],\n        // [\"S4115\"],\n        // [\"S4116\"],\n        // [\"S4117\"],\n        // [\"S4118\"],\n        // [\"S4119\"],\n        // [\"S4120\"],\n        // [\"S4121\"],\n        // [\"S4122\"],\n        // [\"S4123\"],\n        // [\"S4124\"],\n        // [\"S4125\"],\n        // [\"S4126\"],\n        // [\"S4127\"],\n        // [\"S4128\"],\n        // [\"S4129\"],\n        // [\"S4130\"],\n        // [\"S4131\"],\n        // [\"S4132\"],\n        // [\"S4133\"],\n        // [\"S4134\"],\n        // [\"S4135\"],\n        [\"S4136\"] = \"CODE_SMELL\",\n        // [\"S4137\"],\n        // [\"S4138\"],\n        // [\"S4139\"],\n        // [\"S4140\"],\n        // [\"S4141\"],\n        // [\"S4142\"],\n        [\"S4143\"] = \"BUG\",\n        [\"S4144\"] = \"CODE_SMELL\",\n        // [\"S4145\"],\n        // [\"S4146\"],\n        // [\"S4147\"],\n        // [\"S4148\"],\n        // [\"S4149\"],\n        // [\"S4150\"],\n        // [\"S4151\"],\n        // [\"S4152\"],\n        // [\"S4153\"],\n        // [\"S4154\"],\n        // [\"S4155\"],\n        // [\"S4156\"],\n        // [\"S4157\"],\n        [\"S4158\"] = \"BUG\",\n        [\"S4159\"] = \"BUG\",\n        // [\"S4160\"],\n        // [\"S4161\"],\n        // [\"S4162\"],\n        // [\"S4163\"],\n        // [\"S4164\"],\n        // [\"S4165\"],\n        // [\"S4166\"],\n        // [\"S4167\"],\n        // [\"S4168\"],\n        // [\"S4169\"],\n        // [\"S4170\"],\n        // [\"S4171\"],\n        // [\"S4172\"],\n        // [\"S4173\"],\n        // [\"S4174\"],\n        // [\"S4175\"],\n        // [\"S4176\"],\n        // [\"S4177\"],\n        // [\"S4178\"],\n        // [\"S4179\"],\n        // [\"S4180\"],\n        // [\"S4181\"],\n        // [\"S4182\"],\n        // [\"S4183\"],\n        // [\"S4184\"],\n        // [\"S4185\"],\n        // [\"S4186\"],\n        // [\"S4187\"],\n        // [\"S4188\"],\n        // [\"S4189\"],\n        // [\"S4190\"],\n        // [\"S4191\"],\n        // [\"S4192\"],\n        // [\"S4193\"],\n        // [\"S4194\"],\n        // [\"S4195\"],\n        // [\"S4196\"],\n        // [\"S4197\"],\n        // [\"S4198\"],\n        // [\"S4199\"],\n        // [\"S4200\"],\n        [\"S4201\"] = \"CODE_SMELL\",\n        // [\"S4202\"],\n        // [\"S4203\"],\n        // [\"S4204\"],\n        // [\"S4205\"],\n        // [\"S4206\"],\n        // [\"S4207\"],\n        // [\"S4208\"],\n        // [\"S4209\"],\n        [\"S4210\"] = \"BUG\",\n        // [\"S4211\"],\n        // [\"S4212\"],\n        // [\"S4213\"],\n        // [\"S4214\"],\n        // [\"S4215\"],\n        // [\"S4216\"],\n        // [\"S4217\"],\n        // [\"S4218\"],\n        // [\"S4219\"],\n        // [\"S4220\"],\n        // [\"S4221\"],\n        // [\"S4222\"],\n        // [\"S4223\"],\n        // [\"S4224\"],\n        [\"S4225\"] = \"CODE_SMELL\",\n        // [\"S4226\"],\n        // [\"S4227\"],\n        // [\"S4228\"],\n        // [\"S4229\"],\n        // [\"S4230\"],\n        // [\"S4231\"],\n        // [\"S4232\"],\n        // [\"S4233\"],\n        // [\"S4234\"],\n        // [\"S4235\"],\n        // [\"S4236\"],\n        // [\"S4237\"],\n        // [\"S4238\"],\n        // [\"S4239\"],\n        // [\"S4240\"],\n        // [\"S4241\"],\n        // [\"S4242\"],\n        // [\"S4243\"],\n        // [\"S4244\"],\n        // [\"S4245\"],\n        // [\"S4246\"],\n        // [\"S4247\"],\n        // [\"S4248\"],\n        // [\"S4249\"],\n        // [\"S4250\"],\n        // [\"S4251\"],\n        // [\"S4252\"],\n        // [\"S4253\"],\n        // [\"S4254\"],\n        // [\"S4255\"],\n        // [\"S4256\"],\n        // [\"S4257\"],\n        // [\"S4258\"],\n        // [\"S4259\"],\n        [\"S4260\"] = \"BUG\",\n        // [\"S4261\"],\n        // [\"S4262\"],\n        // [\"S4263\"],\n        // [\"S4264\"],\n        // [\"S4265\"],\n        // [\"S4266\"],\n        // [\"S4267\"],\n        // [\"S4268\"],\n        // [\"S4269\"],\n        // [\"S4270\"],\n        // [\"S4271\"],\n        // [\"S4272\"],\n        // [\"S4273\"],\n        // [\"S4274\"],\n        [\"S4275\"] = \"BUG\",\n        // [\"S4276\"],\n        [\"S4277\"] = \"BUG\",\n        // [\"S4278\"],\n        // [\"S4279\"],\n        // [\"S4280\"],\n        // [\"S4281\"],\n        // [\"S4282\"],\n        // [\"S4283\"],\n        // [\"S4284\"],\n        // [\"S4285\"],\n        // [\"S4286\"],\n        // [\"S4287\"],\n        // [\"S4288\"],\n        // [\"S4289\"],\n        // [\"S4290\"],\n        // [\"S4291\"],\n        // [\"S4292\"],\n        // [\"S4293\"],\n        // [\"S4294\"],\n        // [\"S4295\"],\n        // [\"S4296\"],\n        // [\"S4297\"],\n        // [\"S4298\"],\n        // [\"S4299\"],\n        // [\"S4300\"],\n        // [\"S4301\"],\n        // [\"S4302\"],\n        // [\"S4303\"],\n        // [\"S4304\"],\n        // [\"S4305\"],\n        // [\"S4306\"],\n        // [\"S4307\"],\n        // [\"S4308\"],\n        // [\"S4309\"],\n        // [\"S4310\"],\n        // [\"S4311\"],\n        // [\"S4312\"],\n        // [\"S4313\"],\n        // [\"S4314\"],\n        // [\"S4315\"],\n        // [\"S4316\"],\n        // [\"S4317\"],\n        // [\"S4318\"],\n        // [\"S4319\"],\n        // [\"S4320\"],\n        // [\"S4321\"],\n        // [\"S4322\"],\n        // [\"S4323\"],\n        // [\"S4324\"],\n        // [\"S4325\"],\n        // [\"S4326\"],\n        // [\"S4327\"],\n        // [\"S4328\"],\n        // [\"S4329\"],\n        // [\"S4330\"],\n        // [\"S4331\"],\n        // [\"S4332\"],\n        // [\"S4333\"],\n        // [\"S4334\"],\n        // [\"S4335\"],\n        // [\"S4336\"],\n        // [\"S4337\"],\n        // [\"S4338\"],\n        // [\"S4339\"],\n        // [\"S4340\"],\n        // [\"S4341\"],\n        // [\"S4342\"],\n        // [\"S4343\"],\n        // [\"S4344\"],\n        // [\"S4345\"],\n        // [\"S4346\"],\n        // [\"S4347\"],\n        // [\"S4348\"],\n        // [\"S4349\"],\n        // [\"S4350\"],\n        // [\"S4351\"],\n        // [\"S4352\"],\n        // [\"S4353\"],\n        // [\"S4354\"],\n        // [\"S4355\"],\n        // [\"S4356\"],\n        // [\"S4357\"],\n        // [\"S4358\"],\n        // [\"S4359\"],\n        // [\"S4360\"],\n        // [\"S4361\"],\n        // [\"S4362\"],\n        // [\"S4363\"],\n        // [\"S4364\"],\n        // [\"S4365\"],\n        // [\"S4366\"],\n        // [\"S4367\"],\n        // [\"S4368\"],\n        // [\"S4369\"],\n        // [\"S4370\"],\n        // [\"S4371\"],\n        // [\"S4372\"],\n        // [\"S4373\"],\n        // [\"S4374\"],\n        // [\"S4375\"],\n        // [\"S4376\"],\n        // [\"S4377\"],\n        // [\"S4378\"],\n        // [\"S4379\"],\n        // [\"S4380\"],\n        // [\"S4381\"],\n        // [\"S4382\"],\n        // [\"S4383\"],\n        // [\"S4384\"],\n        // [\"S4385\"],\n        // [\"S4386\"],\n        // [\"S4387\"],\n        // [\"S4388\"],\n        // [\"S4389\"],\n        // [\"S4390\"],\n        // [\"S4391\"],\n        // [\"S4392\"],\n        // [\"S4393\"],\n        // [\"S4394\"],\n        // [\"S4395\"],\n        // [\"S4396\"],\n        // [\"S4397\"],\n        // [\"S4398\"],\n        // [\"S4399\"],\n        // [\"S4400\"],\n        // [\"S4401\"],\n        // [\"S4402\"],\n        // [\"S4403\"],\n        // [\"S4404\"],\n        // [\"S4405\"],\n        // [\"S4406\"],\n        // [\"S4407\"],\n        // [\"S4408\"],\n        // [\"S4409\"],\n        // [\"S4410\"],\n        // [\"S4411\"],\n        // [\"S4412\"],\n        // [\"S4413\"],\n        // [\"S4414\"],\n        // [\"S4415\"],\n        // [\"S4416\"],\n        // [\"S4417\"],\n        // [\"S4418\"],\n        // [\"S4419\"],\n        // [\"S4420\"],\n        // [\"S4421\"],\n        // [\"S4422\"],\n        [\"S4423\"] = \"VULNERABILITY\",\n        // [\"S4424\"],\n        // [\"S4425\"],\n        // [\"S4426\"],\n        // [\"S4427\"],\n        [\"S4428\"] = \"BUG\",\n        // [\"S4429\"],\n        // [\"S4430\"],\n        // [\"S4431\"],\n        // [\"S4432\"],\n        // [\"S4433\"],\n        // [\"S4434\"],\n        // [\"S4435\"],\n        // [\"S4436\"],\n        // [\"S4437\"],\n        // [\"S4438\"],\n        // [\"S4439\"],\n        // [\"S4440\"],\n        // [\"S4441\"],\n        // [\"S4442\"],\n        // [\"S4443\"],\n        // [\"S4444\"],\n        // [\"S4445\"],\n        // [\"S4446\"],\n        // [\"S4447\"],\n        // [\"S4448\"],\n        // [\"S4449\"],\n        // [\"S4450\"],\n        // [\"S4451\"],\n        // [\"S4452\"],\n        // [\"S4453\"],\n        // [\"S4454\"],\n        // [\"S4455\"],\n        // [\"S4456\"],\n        // [\"S4457\"],\n        // [\"S4458\"],\n        // [\"S4459\"],\n        // [\"S4460\"],\n        // [\"S4461\"],\n        // [\"S4462\"],\n        // [\"S4463\"],\n        // [\"S4464\"],\n        // [\"S4465\"],\n        // [\"S4466\"],\n        // [\"S4467\"],\n        // [\"S4468\"],\n        // [\"S4469\"],\n        // [\"S4470\"],\n        // [\"S4471\"],\n        // [\"S4472\"],\n        // [\"S4473\"],\n        // [\"S4474\"],\n        // [\"S4475\"],\n        // [\"S4476\"],\n        // [\"S4477\"],\n        // [\"S4478\"],\n        // [\"S4479\"],\n        // [\"S4480\"],\n        // [\"S4481\"],\n        // [\"S4482\"],\n        // [\"S4483\"],\n        // [\"S4484\"],\n        // [\"S4485\"],\n        // [\"S4486\"],\n        // [\"S4487\"],\n        // [\"S4488\"],\n        // [\"S4489\"],\n        // [\"S4490\"],\n        // [\"S4491\"],\n        // [\"S4492\"],\n        // [\"S4493\"],\n        // [\"S4494\"],\n        // [\"S4495\"],\n        // [\"S4496\"],\n        // [\"S4497\"],\n        // [\"S4498\"],\n        // [\"S4499\"],\n        // [\"S4500\"],\n        // [\"S4501\"],\n        // [\"S4502\"],\n        // [\"S4503\"],\n        // [\"S4504\"],\n        // [\"S4505\"],\n        // [\"S4506\"],\n        [\"S4507\"] = \"SECURITY_HOTSPOT\",\n        // [\"S4508\"],\n        // [\"S4509\"],\n        // [\"S4510\"],\n        // [\"S4511\"],\n        // [\"S4512\"],\n        // [\"S4513\"],\n        // [\"S4514\"],\n        // [\"S4515\"],\n        // [\"S4516\"],\n        // [\"S4517\"],\n        // [\"S4518\"],\n        // [\"S4519\"],\n        // [\"S4520\"],\n        // [\"S4521\"],\n        // [\"S4522\"],\n        // [\"S4523\"],\n        // [\"S4524\"],\n        // [\"S4525\"],\n        // [\"S4526\"],\n        // [\"S4527\"],\n        // [\"S4528\"],\n        // [\"S4529\"] = \"SECURITY_HOTSPOT\",\n        // [\"S4530\"],\n        // [\"S4531\"],\n        // [\"S4532\"],\n        // [\"S4533\"],\n        // [\"S4534\"],\n        // [\"S4535\"],\n        // [\"S4536\"],\n        // [\"S4537\"],\n        // [\"S4538\"],\n        // [\"S4539\"],\n        // [\"S4540\"],\n        // [\"S4541\"],\n        // [\"S4542\"],\n        // [\"S4543\"],\n        // [\"S4544\"],\n        [\"S4545\"] = \"CODE_SMELL\",\n        // [\"S4546\"],\n        // [\"S4547\"],\n        // [\"S4548\"],\n        // [\"S4549\"],\n        // [\"S4550\"],\n        // [\"S4551\"],\n        // [\"S4552\"],\n        // [\"S4553\"],\n        // [\"S4554\"],\n        // [\"S4555\"],\n        // [\"S4556\"],\n        // [\"S4557\"],\n        // [\"S4558\"],\n        // [\"S4559\"],\n        // [\"S4560\"],\n        // [\"S4561\"],\n        // [\"S4562\"],\n        // [\"S4563\"],\n        // [\"S4564\"],\n        // [\"S4565\"],\n        // [\"S4566\"],\n        // [\"S4567\"],\n        // [\"S4568\"],\n        // [\"S4569\"],\n        // [\"S4570\"],\n        // [\"S4571\"],\n        // [\"S4572\"],\n        // [\"S4573\"],\n        // [\"S4574\"],\n        // [\"S4575\"],\n        // [\"S4576\"],\n        // [\"S4577\"],\n        // [\"S4578\"],\n        // [\"S4579\"],\n        // [\"S4580\"],\n        [\"S4581\"] = \"CODE_SMELL\",\n        // [\"S4582\"],\n        [\"S4583\"] = \"BUG\",\n        // [\"S4584\"],\n        // [\"S4585\"],\n        [\"S4586\"] = \"BUG\",\n        // [\"S4587\"],\n        // [\"S4588\"],\n        // [\"S4589\"],\n        // [\"S4590\"],\n        // [\"S4591\"],\n        // [\"S4592\"],\n        // [\"S4593\"],\n        // [\"S4594\"],\n        // [\"S4595\"],\n        // [\"S4596\"],\n        // [\"S4597\"],\n        // [\"S4598\"],\n        // [\"S4599\"],\n        // [\"S4600\"],\n        // [\"S4601\"],\n        // [\"S4602\"],\n        // [\"S4603\"],\n        // [\"S4604\"],\n        // [\"S4605\"],\n        // [\"S4606\"],\n        // [\"S4607\"],\n        // [\"S4608\"],\n        // [\"S4609\"],\n        // [\"S4610\"],\n        // [\"S4611\"],\n        // [\"S4612\"],\n        // [\"S4613\"],\n        // [\"S4614\"],\n        // [\"S4615\"],\n        // [\"S4616\"],\n        // [\"S4617\"],\n        // [\"S4618\"],\n        // [\"S4619\"],\n        // [\"S4620\"],\n        // [\"S4621\"],\n        // [\"S4622\"],\n        // [\"S4623\"],\n        // [\"S4624\"],\n        // [\"S4625\"],\n        // [\"S4626\"],\n        // [\"S4627\"],\n        // [\"S4628\"],\n        // [\"S4629\"],\n        // [\"S4630\"],\n        // [\"S4631\"],\n        // [\"S4632\"],\n        // [\"S4633\"],\n        // [\"S4634\"],\n        // [\"S4635\"],\n        // [\"S4636\"],\n        // [\"S4637\"],\n        // [\"S4638\"],\n        // [\"S4639\"],\n        // [\"S4640\"],\n        // [\"S4641\"],\n        // [\"S4642\"],\n        // [\"S4643\"],\n        // [\"S4644\"],\n        // [\"S4645\"],\n        // [\"S4646\"],\n        // [\"S4647\"],\n        // [\"S4648\"],\n        // [\"S4649\"],\n        // [\"S4650\"],\n        // [\"S4651\"],\n        // [\"S4652\"],\n        // [\"S4653\"],\n        // [\"S4654\"],\n        // [\"S4655\"],\n        // [\"S4656\"],\n        // [\"S4657\"],\n        // [\"S4658\"],\n        // [\"S4659\"],\n        // [\"S4660\"],\n        // [\"S4661\"],\n        // [\"S4662\"],\n        [\"S4663\"] = \"CODE_SMELL\",\n        // [\"S4664\"],\n        // [\"S4665\"],\n        // [\"S4666\"],\n        // [\"S4667\"],\n        // [\"S4668\"],\n        // [\"S4669\"],\n        // [\"S4670\"],\n        // [\"S4671\"],\n        // [\"S4672\"],\n        // [\"S4673\"],\n        // [\"S4674\"],\n        // [\"S4675\"],\n        // [\"S4676\"],\n        // [\"S4677\"],\n        // [\"S4678\"],\n        // [\"S4679\"],\n        // [\"S4680\"],\n        // [\"S4681\"],\n        // [\"S4682\"],\n        // [\"S4683\"],\n        // [\"S4684\"],\n        // [\"S4685\"],\n        // [\"S4686\"],\n        // [\"S4687\"],\n        // [\"S4688\"],\n        // [\"S4689\"],\n        // [\"S4690\"],\n        // [\"S4691\"],\n        // [\"S4692\"],\n        // [\"S4693\"],\n        // [\"S4694\"],\n        // [\"S4695\"],\n        // [\"S4696\"],\n        // [\"S4697\"],\n        // [\"S4698\"],\n        // [\"S4699\"],\n        // [\"S4700\"],\n        // [\"S4701\"],\n        // [\"S4702\"],\n        // [\"S4703\"],\n        // [\"S4704\"],\n        // [\"S4705\"],\n        // [\"S4706\"],\n        // [\"S4707\"],\n        // [\"S4708\"],\n        // [\"S4709\"],\n        // [\"S4710\"],\n        // [\"S4711\"],\n        // [\"S4712\"],\n        // [\"S4713\"],\n        // [\"S4714\"],\n        // [\"S4715\"],\n        // [\"S4716\"],\n        // [\"S4717\"],\n        // [\"S4718\"],\n        // [\"S4719\"],\n        // [\"S4720\"],\n        // [\"S4721\"] = \"SECURITY_HOTSPOT\",\n        // [\"S4722\"],\n        // [\"S4723\"],\n        // [\"S4724\"],\n        // [\"S4725\"],\n        // [\"S4726\"],\n        // [\"S4727\"],\n        // [\"S4728\"],\n        // [\"S4729\"],\n        // [\"S4730\"],\n        // [\"S4731\"],\n        // [\"S4732\"],\n        // [\"S4733\"],\n        // [\"S4734\"],\n        // [\"S4735\"],\n        // [\"S4736\"],\n        // [\"S4737\"],\n        // [\"S4738\"],\n        // [\"S4739\"],\n        // [\"S4740\"],\n        // [\"S4741\"],\n        // [\"S4742\"],\n        // [\"S4743\"],\n        // [\"S4744\"],\n        // [\"S4745\"],\n        // [\"S4746\"],\n        // [\"S4747\"],\n        // [\"S4748\"],\n        // [\"S4749\"],\n        // [\"S4750\"],\n        // [\"S4751\"],\n        // [\"S4752\"],\n        // [\"S4753\"],\n        // [\"S4754\"],\n        // [\"S4755\"],\n        // [\"S4756\"],\n        // [\"S4757\"],\n        // [\"S4758\"],\n        // [\"S4759\"],\n        // [\"S4760\"],\n        // [\"S4761\"],\n        // [\"S4762\"],\n        // [\"S4763\"],\n        // [\"S4764\"],\n        // [\"S4765\"],\n        // [\"S4766\"],\n        // [\"S4767\"],\n        // [\"S4768\"],\n        // [\"S4769\"],\n        // [\"S4770\"],\n        // [\"S4771\"],\n        // [\"S4772\"],\n        // [\"S4773\"],\n        // [\"S4774\"],\n        // [\"S4775\"],\n        // [\"S4776\"],\n        // [\"S4777\"],\n        // [\"S4778\"],\n        // [\"S4779\"],\n        // [\"S4780\"],\n        // [\"S4781\"],\n        // [\"S4782\"],\n        // [\"S4783\"],\n        // [\"S4784\"],\n        // [\"S4785\"],\n        // [\"S4786\"],\n        // [\"S4787\"],\n        // [\"S4788\"],\n        // [\"S4789\"],\n        [\"S4790\"] = \"SECURITY_HOTSPOT\",\n        // [\"S4791\"],\n        [\"S4792\"] = \"SECURITY_HOTSPOT\",\n        // [\"S4793\"],\n        // [\"S4794\"],\n        // [\"S4795\"],\n        // [\"S4796\"],\n        // [\"S4797\"] = \"SECURITY_HOTSPOT\",\n        // [\"S4798\"],\n        // [\"S4799\"],\n        // [\"S4800\"],\n        // [\"S4801\"],\n        // [\"S4802\"],\n        // [\"S4803\"],\n        // [\"S4804\"],\n        // [\"S4805\"],\n        // [\"S4806\"],\n        // [\"S4807\"],\n        // [\"S4808\"],\n        // [\"S4809\"],\n        // [\"S4810\"],\n        // [\"S4811\"],\n        // [\"S4812\"],\n        // [\"S4813\"],\n        // [\"S4814\"],\n        // [\"S4815\"],\n        // [\"S4816\"],\n        // [\"S4817\"] = \"SECURITY_HOTSPOT\",\n        // [\"S4818\"],\n        // [\"S4819\"],\n        // [\"S4820\"],\n        // [\"S4821\"],\n        // [\"S4822\"],\n        // [\"S4823\"],\n        // [\"S4824\"],\n        // [\"S4825\"] = \"SECURITY_HOTSPOT\",\n        // [\"S4826\"],\n        // [\"S4827\"],\n        // [\"S4828\"],\n        // [\"S4829\"],\n        [\"S4830\"] = \"VULNERABILITY\",\n        // [\"S4831\"],\n        // [\"S4832\"],\n        // [\"S4833\"],\n        // [\"S4834\"]\",\n        // [\"S4835\"],\n        // [\"S4836\"],\n        // [\"S4837\"],\n        // [\"S4838\"],\n        // [\"S4839\"],\n        // [\"S4840\"],\n        // [\"S4841\"],\n        // [\"S4842\"],\n        // [\"S4843\"],\n        // [\"S4844\"],\n        // [\"S4845\"],\n        // [\"S4846\"],\n        // [\"S4847\"],\n        // [\"S4848\"],\n        // [\"S4849\"],\n        // [\"S4850\"],\n        // [\"S4851\"],\n        // [\"S4852\"],\n        // [\"S4853\"],\n        // [\"S4854\"],\n        // [\"S4855\"],\n        // [\"S4856\"],\n        // [\"S4857\"],\n        // [\"S4858\"],\n        // [\"S4859\"],\n        // [\"S4860\"],\n        // [\"S4861\"],\n        // [\"S4862\"],\n        // [\"S4863\"],\n        // [\"S4864\"],\n        // [\"S4865\"],\n        // [\"S4866\"],\n        // [\"S4867\"],\n        // [\"S4868\"],\n        // [\"S4869\"],\n        // [\"S4870\"],\n        // [\"S4871\"],\n        // [\"S4872\"],\n        // [\"S4873\"],\n        // [\"S4874\"],\n        // [\"S4875\"],\n        // [\"S4876\"],\n        // [\"S4877\"],\n        // [\"S4878\"],\n        // [\"S4879\"],\n        // [\"S4880\"],\n        // [\"S4881\"],\n        // [\"S4882\"],\n        // [\"S4883\"],\n        // [\"S4884\"],\n        // [\"S4885\"],\n        // [\"S4886\"],\n        // [\"S4887\"],\n        // [\"S4888\"],\n        // [\"S4889\"],\n        // [\"S4890\"],\n        // [\"S4891\"],\n        // [\"S4892\"],\n        // [\"S4893\"],\n        // [\"S4894\"],\n        // [\"S4895\"],\n        // [\"S4896\"],\n        // [\"S4897\"],\n        // [\"S4898\"],\n        // [\"S4899\"],\n        // [\"S4900\"],\n        // [\"S4901\"],\n        // [\"S4902\"],\n        // [\"S4903\"],\n        // [\"S4904\"],\n        // [\"S4905\"],\n        // [\"S4906\"],\n        // [\"S4907\"],\n        // [\"S4908\"],\n        // [\"S4909\"],\n        // [\"S4910\"],\n        // [\"S4911\"],\n        // [\"S4912\"],\n        // [\"S4913\"],\n        // [\"S4914\"],\n        // [\"S4915\"],\n        // [\"S4916\"],\n        // [\"S4917\"],\n        // [\"S4918\"],\n        // [\"S4919\"],\n        // [\"S4920\"],\n        // [\"S4921\"],\n        // [\"S4922\"],\n        // [\"S4923\"],\n        // [\"S4924\"],\n        // [\"S4925\"],\n        // [\"S4926\"],\n        // [\"S4927\"],\n        // [\"S4928\"],\n        // [\"S4929\"],\n        // [\"S4930\"],\n        // [\"S4931\"],\n        // [\"S4932\"],\n        // [\"S4933\"],\n        // [\"S4934\"],\n        // [\"S4935\"],\n        // [\"S4936\"],\n        // [\"S4937\"],\n        // [\"S4938\"],\n        // [\"S4939\"],\n        // [\"S4940\"],\n        // [\"S4941\"],\n        // [\"S4942\"],\n        // [\"S4943\"],\n        // [\"S4944\"],\n        // [\"S4945\"],\n        // [\"S4946\"],\n        // [\"S4947\"],\n        // [\"S4948\"],\n        // [\"S4949\"],\n        // [\"S4950\"],\n        // [\"S4951\"],\n        // [\"S4952\"],\n        // [\"S4953\"],\n        // [\"S4954\"],\n        // [\"S4955\"],\n        // [\"S4956\"],\n        // [\"S4957\"],\n        // [\"S4958\"],\n        // [\"S4959\"],\n        // [\"S4960\"],\n        // [\"S4961\"],\n        // [\"S4962\"],\n        // [\"S4963\"],\n        // [\"S4964\"],\n        // [\"S4965\"],\n        // [\"S4966\"],\n        // [\"S4967\"],\n        // [\"S4968\"],\n        // [\"S4969\"],\n        // [\"S4970\"],\n        // [\"S4971\"],\n        // [\"S4972\"],\n        // [\"S4973\"],\n        // [\"S4974\"],\n        // [\"S4975\"],\n        // [\"S4976\"],\n        // [\"S4977\"],\n        // [\"S4978\"],\n        // [\"S4979\"],\n        // [\"S4980\"],\n        // [\"S4981\"],\n        // [\"S4982\"],\n        // [\"S4983\"],\n        // [\"S4984\"],\n        // [\"S4985\"],\n        // [\"S4986\"],\n        // [\"S4987\"],\n        // [\"S4988\"],\n        // [\"S4989\"],\n        // [\"S4990\"],\n        // [\"S4991\"],\n        // [\"S4992\"],\n        // [\"S4993\"],\n        // [\"S4994\"],\n        // [\"S4995\"],\n        // [\"S4996\"],\n        // [\"S4997\"],\n        // [\"S4998\"],\n        // [\"S4999\"],\n        // [\"S5000\"],\n        // [\"S5001\"],\n        // [\"S5002\"],\n        // [\"S5003\"],\n        // [\"S5004\"],\n        // [\"S5005\"],\n        // [\"S5006\"],\n        // [\"S5007\"],\n        // [\"S5008\"],\n        // [\"S5009\"],\n        // [\"S5010\"],\n        // [\"S5011\"],\n        // [\"S5012\"],\n        // [\"S5013\"],\n        // [\"S5014\"],\n        // [\"S5015\"],\n        // [\"S5016\"],\n        // [\"S5017\"],\n        // [\"S5018\"],\n        // [\"S5019\"],\n        // [\"S5020\"],\n        // [\"S5021\"],\n        // [\"S5022\"],\n        // [\"S5023\"],\n        // [\"S5024\"],\n        // [\"S5025\"],\n        // [\"S5026\"],\n        // [\"S5027\"],\n        // [\"S5028\"],\n        // [\"S5029\"],\n        // [\"S5030\"],\n        // [\"S5031\"],\n        // [\"S5032\"],\n        // [\"S5033\"],\n        // [\"S5034\"],\n        // [\"S5035\"],\n        // [\"S5036\"],\n        // [\"S5037\"],\n        // [\"S5038\"],\n        // [\"S5039\"],\n        // [\"S5040\"],\n        // [\"S5041\"],\n        [\"S5042\"] = \"SECURITY_HOTSPOT\",\n        // [\"S5043\"],\n        // [\"S5044\"],\n        // [\"S5045\"],\n        // [\"S5046\"],\n        // [\"S5047\"],\n        // [\"S5048\"],\n        // [\"S5049\"],\n        // [\"S5050\"],\n        // [\"S5051\"],\n        // [\"S5052\"],\n        // [\"S5053\"],\n        // [\"S5054\"],\n        // [\"S5055\"],\n        // [\"S5056\"],\n        // [\"S5057\"],\n        // [\"S5058\"],\n        // [\"S5059\"],\n        // [\"S5060\"],\n        // [\"S5061\"],\n        // [\"S5062\"],\n        // [\"S5063\"],\n        // [\"S5064\"],\n        // [\"S5065\"],\n        // [\"S5066\"],\n        // [\"S5067\"],\n        // [\"S5068\"],\n        // [\"S5069\"],\n        // [\"S5070\"],\n        // [\"S5071\"],\n        // [\"S5072\"],\n        // [\"S5073\"],\n        // [\"S5074\"],\n        // [\"S5075\"],\n        // [\"S5076\"],\n        // [\"S5077\"],\n        // [\"S5078\"],\n        // [\"S5079\"],\n        // [\"S5080\"],\n        // [\"S5081\"],\n        // [\"S5082\"],\n        // [\"S5083\"],\n        // [\"S5084\"],\n        // [\"S5085\"],\n        // [\"S5086\"],\n        // [\"S5087\"],\n        // [\"S5088\"],\n        // [\"S5089\"],\n        // [\"S5090\"],\n        // [\"S5091\"],\n        // [\"S5092\"],\n        // [\"S5093\"],\n        // [\"S5094\"],\n        // [\"S5095\"],\n        // [\"S5096\"],\n        // [\"S5097\"],\n        // [\"S5098\"],\n        // [\"S5099\"],\n        // [\"S5100\"],\n        // [\"S5101\"],\n        // [\"S5102\"],\n        // [\"S5103\"],\n        // [\"S5104\"],\n        // [\"S5105\"],\n        // [\"S5106\"],\n        // [\"S5107\"],\n        // [\"S5108\"],\n        // [\"S5109\"],\n        // [\"S5110\"],\n        // [\"S5111\"],\n        // [\"S5112\"],\n        // [\"S5113\"],\n        // [\"S5114\"],\n        // [\"S5115\"],\n        // [\"S5116\"],\n        // [\"S5117\"],\n        // [\"S5118\"],\n        // [\"S5119\"],\n        // [\"S5120\"],\n        // [\"S5121\"],\n        // [\"S5122\"],\n        // [\"S5123\"],\n        // [\"S5124\"],\n        // [\"S5125\"],\n        // [\"S5126\"],\n        // [\"S5127\"],\n        // [\"S5128\"],\n        // [\"S5129\"],\n        // [\"S5130\"],\n        // [\"S5131\"],\n        // [\"S5132\"],\n        // [\"S5133\"],\n        // [\"S5134\"],\n        // [\"S5135\"],\n        // [\"S5136\"],\n        // [\"S5137\"],\n        // [\"S5138\"],\n        // [\"S5139\"],\n        // [\"S5140\"],\n        // [\"S5141\"],\n        // [\"S5142\"],\n        // [\"S5143\"],\n        // [\"S5144\"],\n        // [\"S5145\"],\n        // [\"S5146\"],\n        // [\"S5147\"],\n        // [\"S5148\"],\n        // [\"S5149\"],\n        // [\"S5150\"],\n        // [\"S5151\"],\n        // [\"S5152\"],\n        // [\"S5153\"],\n        // [\"S5154\"],\n        // [\"S5155\"],\n        // [\"S5156\"],\n        // [\"S5157\"],\n        // [\"S5158\"],\n        // [\"S5159\"],\n        // [\"S5160\"],\n        // [\"S5161\"],\n        // [\"S5162\"],\n        // [\"S5163\"],\n        // [\"S5164\"],\n        // [\"S5165\"],\n        // [\"S5166\"],\n        // [\"S5167\"],\n        // [\"S5168\"],\n        // [\"S5169\"],\n        // [\"S5170\"],\n        // [\"S5171\"],\n        // [\"S5172\"],\n        // [\"S5173\"],\n        // [\"S5174\"],\n        // [\"S5175\"],\n        // [\"S5176\"],\n        // [\"S5177\"],\n        // [\"S5178\"],\n        // [\"S5179\"],\n        // [\"S5180\"],\n        // [\"S5181\"],\n        // [\"S5182\"],\n        // [\"S5183\"],\n        // [\"S5184\"],\n        // [\"S5185\"],\n        // [\"S5186\"],\n        // [\"S5187\"],\n        // [\"S5188\"],\n        // [\"S5189\"],\n        // [\"S5190\"],\n        // [\"S5191\"],\n        // [\"S5192\"],\n        // [\"S5193\"],\n        // [\"S5194\"],\n        // [\"S5195\"],\n        // [\"S5196\"],\n        // [\"S5197\"],\n        // [\"S5198\"],\n        // [\"S5199\"],\n        // [\"S5200\"],\n        // [\"S5201\"],\n        // [\"S5202\"],\n        // [\"S5203\"],\n        // [\"S5204\"],\n        // [\"S5205\"],\n        // [\"S5206\"],\n        // [\"S5207\"],\n        // [\"S5208\"],\n        // [\"S5209\"],\n        // [\"S5210\"],\n        // [\"S5211\"],\n        // [\"S5212\"],\n        // [\"S5213\"],\n        // [\"S5214\"],\n        // [\"S5215\"],\n        // [\"S5216\"],\n        // [\"S5217\"],\n        // [\"S5218\"],\n        // [\"S5219\"],\n        // [\"S5220\"],\n        // [\"S5221\"],\n        // [\"S5222\"],\n        // [\"S5223\"],\n        // [\"S5224\"],\n        // [\"S5225\"],\n        // [\"S5226\"],\n        // [\"S5227\"],\n        // [\"S5228\"],\n        // [\"S5229\"],\n        // [\"S5230\"],\n        // [\"S5231\"],\n        // [\"S5232\"],\n        // [\"S5233\"],\n        // [\"S5234\"],\n        // [\"S5235\"],\n        // [\"S5236\"],\n        // [\"S5237\"],\n        // [\"S5238\"],\n        // [\"S5239\"],\n        // [\"S5240\"],\n        // [\"S5241\"],\n        // [\"S5242\"],\n        // [\"S5243\"],\n        // [\"S5244\"],\n        // [\"S5245\"],\n        // [\"S5246\"],\n        // [\"S5247\"],\n        // [\"S5248\"],\n        // [\"S5249\"],\n        // [\"S5250\"],\n        // [\"S5251\"],\n        // [\"S5252\"],\n        // [\"S5253\"],\n        // [\"S5254\"],\n        // [\"S5255\"],\n        // [\"S5256\"],\n        // [\"S5257\"],\n        // [\"S5258\"],\n        // [\"S5259\"],\n        // [\"S5260\"],\n        // [\"S5261\"],\n        // [\"S5262\"],\n        // [\"S5263\"],\n        // [\"S5264\"],\n        // [\"S5265\"],\n        // [\"S5266\"],\n        // [\"S5267\"],\n        // [\"S5268\"],\n        // [\"S5269\"],\n        // [\"S5270\"],\n        // [\"S5271\"],\n        // [\"S5272\"],\n        // [\"S5273\"],\n        // [\"S5274\"],\n        // [\"S5275\"],\n        // [\"S5276\"],\n        // [\"S5277\"],\n        // [\"S5278\"],\n        // [\"S5279\"],\n        // [\"S5280\"],\n        // [\"S5281\"],\n        // [\"S5282\"],\n        // [\"S5283\"],\n        // [\"S5284\"],\n        // [\"S5285\"],\n        // [\"S5286\"],\n        // [\"S5287\"],\n        // [\"S5288\"],\n        // [\"S5289\"],\n        // [\"S5290\"],\n        // [\"S5291\"],\n        // [\"S5292\"],\n        // [\"S5293\"],\n        // [\"S5294\"],\n        // [\"S5295\"],\n        // [\"S5296\"],\n        // [\"S5297\"],\n        // [\"S5298\"],\n        // [\"S5299\"],\n        // [\"S5300\"],\n        // [\"S5301\"],\n        // [\"S5302\"],\n        // [\"S5303\"],\n        // [\"S5304\"],\n        // [\"S5305\"],\n        // [\"S5306\"],\n        // [\"S5307\"],\n        // [\"S5308\"],\n        // [\"S5309\"],\n        // [\"S5310\"],\n        // [\"S5311\"],\n        // [\"S5312\"],\n        // [\"S5313\"],\n        // [\"S5314\"],\n        // [\"S5315\"],\n        // [\"S5316\"],\n        // [\"S5317\"],\n        // [\"S5318\"],\n        // [\"S5319\"],\n        // [\"S5320\"],\n        // [\"S5321\"],\n        // [\"S5322\"],\n        // [\"S5323\"],\n        // [\"S5324\"],\n        // [\"S5325\"],\n        // [\"S5326\"],\n        // [\"S5327\"],\n        // [\"S5328\"],\n        // [\"S5329\"],\n        // [\"S5330\"],\n        // [\"S5331\"],\n        // [\"S5332\"],\n        // [\"S5333\"],\n        // [\"S5334\"],\n        // [\"S5335\"],\n        // [\"S5336\"],\n        // [\"S5337\"],\n        // [\"S5338\"],\n        // [\"S5339\"],\n        // [\"S5340\"],\n        // [\"S5341\"],\n        // [\"S5342\"],\n        // [\"S5343\"],\n        // [\"S5344\"],\n        // [\"S5345\"],\n        // [\"S5346\"],\n        // [\"S5347\"],\n        // [\"S5348\"],\n        // [\"S5349\"],\n        // [\"S5350\"],\n        // [\"S5351\"],\n        // [\"S5352\"],\n        // [\"S5353\"],\n        // [\"S5354\"],\n        // [\"S5355\"],\n        // [\"S5356\"],\n        // [\"S5357\"],\n        // [\"S5358\"],\n        // [\"S5359\"],\n        // [\"S5360\"],\n        // [\"S5361\"],\n        // [\"S5362\"],\n        // [\"S5363\"],\n        // [\"S5364\"],\n        // [\"S5365\"],\n        // [\"S5366\"],\n        // [\"S5367\"],\n        // [\"S5368\"],\n        // [\"S5369\"],\n        // [\"S5370\"],\n        // [\"S5371\"],\n        // [\"S5372\"],\n        // [\"S5373\"],\n        // [\"S5374\"],\n        // [\"S5375\"],\n        // [\"S5376\"],\n        // [\"S5377\"],\n        // [\"S5378\"],\n        // [\"S5379\"],\n        // [\"S5380\"],\n        // [\"S5381\"],\n        // [\"S5382\"],\n        // [\"S5383\"],\n        // [\"S5384\"],\n        // [\"S5385\"],\n        // [\"S5386\"],\n        // [\"S5387\"],\n        // [\"S5388\"],\n        // [\"S5389\"],\n        // [\"S5390\"],\n        // [\"S5391\"],\n        // [\"S5392\"],\n        // [\"S5393\"],\n        // [\"S5394\"],\n        // [\"S5395\"],\n        // [\"S5396\"],\n        // [\"S5397\"],\n        // [\"S5398\"],\n        // [\"S5399\"],\n        // [\"S5400\"],\n        // [\"S5401\"],\n        // [\"S5402\"],\n        // [\"S5403\"],\n        // [\"S5404\"],\n        // [\"S5405\"],\n        // [\"S5406\"],\n        // [\"S5407\"],\n        // [\"S5408\"],\n        // [\"S5409\"],\n        // [\"S5410\"],\n        // [\"S5411\"],\n        // [\"S5412\"],\n        // [\"S5413\"],\n        // [\"S5414\"],\n        // [\"S5415\"],\n        // [\"S5416\"],\n        // [\"S5417\"],\n        // [\"S5418\"],\n        // [\"S5419\"],\n        // [\"S5420\"],\n        // [\"S5421\"],\n        // [\"S5422\"],\n        // [\"S5423\"],\n        // [\"S5424\"],\n        // [\"S5425\"],\n        // [\"S5426\"],\n        // [\"S5427\"],\n        // [\"S5428\"],\n        // [\"S5429\"],\n        // [\"S5430\"],\n        // [\"S5431\"],\n        // [\"S5432\"],\n        // [\"S5433\"],\n        // [\"S5434\"],\n        // [\"S5435\"],\n        // [\"S5436\"],\n        // [\"S5437\"],\n        // [\"S5438\"],\n        // [\"S5439\"],\n        // [\"S5440\"],\n        // [\"S5441\"],\n        // [\"S5442\"],\n        [\"S5443\"] = \"SECURITY_HOTSPOT\",\n        // [\"S5444\"],\n        [\"S5445\"] = \"VULNERABILITY\",\n        // [\"S5446\"],\n        // [\"S5447\"],\n        // [\"S5448\"],\n        // [\"S5449\"],\n        // [\"S5450\"],\n        // [\"S5451\"],\n        // [\"S5452\"],\n        // [\"S5453\"],\n        // [\"S5454\"],\n        // [\"S5455\"],\n        // [\"S5456\"],\n        // [\"S5457\"],\n        // [\"S5458\"],\n        // [\"S5459\"],\n        // [\"S5460\"],\n        // [\"S5461\"],\n        // [\"S5462\"],\n        // [\"S5463\"],\n        // [\"S5464\"],\n        // [\"S5465\"],\n        // [\"S5466\"],\n        // [\"S5467\"],\n        // [\"S5468\"],\n        // [\"S5469\"],\n        // [\"S5470\"],\n        // [\"S5471\"],\n        // [\"S5472\"],\n        // [\"S5473\"],\n        // [\"S5474\"],\n        // [\"S5475\"],\n        // [\"S5476\"],\n        // [\"S5477\"],\n        // [\"S5478\"],\n        // [\"S5479\"],\n        // [\"S5480\"],\n        // [\"S5481\"],\n        // [\"S5482\"],\n        // [\"S5483\"],\n        // [\"S5484\"],\n        // [\"S5485\"],\n        // [\"S5486\"],\n        // [\"S5487\"],\n        // [\"S5488\"],\n        // [\"S5489\"],\n        // [\"S5490\"],\n        // [\"S5491\"],\n        // [\"S5492\"],\n        // [\"S5493\"],\n        // [\"S5494\"],\n        // [\"S5495\"],\n        // [\"S5496\"],\n        // [\"S5497\"],\n        // [\"S5498\"],\n        // [\"S5499\"],\n        // [\"S5500\"],\n        // [\"S5501\"],\n        // [\"S5502\"],\n        // [\"S5503\"],\n        // [\"S5504\"],\n        // [\"S5505\"],\n        // [\"S5506\"],\n        // [\"S5507\"],\n        // [\"S5508\"],\n        // [\"S5509\"],\n        // [\"S5510\"],\n        // [\"S5511\"],\n        // [\"S5512\"],\n        // [\"S5513\"],\n        // [\"S5514\"],\n        // [\"S5515\"],\n        // [\"S5516\"],\n        // [\"S5517\"],\n        // [\"S5518\"],\n        // [\"S5519\"],\n        // [\"S5520\"],\n        // [\"S5521\"],\n        // [\"S5522\"],\n        // [\"S5523\"],\n        // [\"S5524\"],\n        // [\"S5525\"],\n        // [\"S5526\"],\n        // [\"S5527\"],\n        // [\"S5528\"],\n        // [\"S5529\"],\n        // [\"S5530\"],\n        // [\"S5531\"],\n        // [\"S5532\"],\n        // [\"S5533\"],\n        // [\"S5534\"],\n        // [\"S5535\"],\n        // [\"S5536\"],\n        // [\"S5537\"],\n        // [\"S5538\"],\n        // [\"S5539\"],\n        // [\"S5540\"],\n        // [\"S5541\"],\n        [\"S5542\"] = \"VULNERABILITY\",\n        // [\"S5543\"],\n        // [\"S5544\"],\n        // [\"S5545\"],\n        // [\"S5546\"],\n        [\"S5547\"] = \"VULNERABILITY\",\n        // [\"S5548\"],\n        // [\"S5549\"],\n        // [\"S5550\"],\n        // [\"S5551\"],\n        // [\"S5552\"],\n        // [\"S5553\"],\n        // [\"S5554\"],\n        // [\"S5555\"],\n        // [\"S5556\"],\n        // [\"S5557\"],\n        // [\"S5558\"],\n        // [\"S5559\"],\n        // [\"S5560\"],\n        // [\"S5561\"],\n        // [\"S5562\"],\n        // [\"S5563\"],\n        // [\"S5564\"],\n        // [\"S5565\"],\n        // [\"S5566\"],\n        // [\"S5567\"],\n        // [\"S5568\"],\n        // [\"S5569\"],\n        // [\"S5570\"],\n        // [\"S5571\"],\n        // [\"S5572\"],\n        // [\"S5573\"],\n        // [\"S5574\"],\n        // [\"S5575\"],\n        // [\"S5576\"],\n        // [\"S5577\"],\n        // [\"S5578\"],\n        // [\"S5579\"],\n        // [\"S5580\"],\n        // [\"S5581\"],\n        // [\"S5582\"],\n        // [\"S5583\"],\n        // [\"S5584\"],\n        // [\"S5585\"],\n        // [\"S5586\"],\n        // [\"S5587\"],\n        // [\"S5588\"],\n        // [\"S5589\"],\n        // [\"S5590\"],\n        // [\"S5591\"],\n        // [\"S5592\"],\n        // [\"S5593\"],\n        // [\"S5594\"],\n        // [\"S5595\"],\n        // [\"S5596\"],\n        // [\"S5597\"],\n        // [\"S5598\"],\n        // [\"S5599\"],\n        // [\"S5600\"],\n        // [\"S5601\"],\n        // [\"S5602\"],\n        // [\"S5603\"],\n        // [\"S5604\"],\n        // [\"S5605\"],\n        // [\"S5606\"],\n        // [\"S5607\"],\n        // [\"S5608\"],\n        // [\"S5609\"],\n        // [\"S5610\"],\n        // [\"S5611\"],\n        // [\"S5612\"],\n        // [\"S5613\"],\n        // [\"S5614\"],\n        // [\"S5615\"],\n        // [\"S5616\"],\n        // [\"S5617\"],\n        // [\"S5618\"],\n        // [\"S5619\"],\n        // [\"S5620\"],\n        // [\"S5621\"],\n        // [\"S5622\"],\n        // [\"S5623\"],\n        // [\"S5624\"],\n        // [\"S5625\"],\n        // [\"S5626\"],\n        // [\"S5627\"],\n        // [\"S5628\"],\n        // [\"S5629\"],\n        // [\"S5630\"],\n        // [\"S5631\"],\n        // [\"S5632\"],\n        // [\"S5633\"],\n        // [\"S5634\"],\n        // [\"S5635\"],\n        // [\"S5636\"],\n        // [\"S5637\"],\n        // [\"S5638\"],\n        // [\"S5639\"],\n        // [\"S5640\"],\n        // [\"S5641\"],\n        // [\"S5642\"],\n        // [\"S5643\"],\n        // [\"S5644\"],\n        // [\"S5645\"],\n        // [\"S5646\"],\n        // [\"S5647\"],\n        // [\"S5648\"],\n        // [\"S5649\"],\n        // [\"S5650\"],\n        // [\"S5651\"],\n        // [\"S5652\"],\n        // [\"S5653\"],\n        // [\"S5654\"],\n        // [\"S5655\"],\n        // [\"S5656\"],\n        // [\"S5657\"],\n        // [\"S5658\"],\n        [\"S5659\"] = \"VULNERABILITY\",\n        // [\"S5660\"],\n        // [\"S5661\"],\n        // [\"S5662\"],\n        // [\"S5663\"],\n        // [\"S5664\"],\n        // [\"S5665\"],\n        // [\"S5666\"],\n        // [\"S5667\"],\n        // [\"S5668\"],\n        // [\"S5669\"],\n        // [\"S5670\"],\n        // [\"S5671\"],\n        // [\"S5672\"],\n        // [\"S5673\"],\n        // [\"S5674\"],\n        // [\"S5675\"],\n        // [\"S5676\"],\n        // [\"S5677\"],\n        // [\"S5678\"],\n        // [\"S5679\"],\n        // [\"S5680\"],\n        // [\"S5681\"],\n        // [\"S5682\"],\n        // [\"S5683\"],\n        // [\"S5684\"],\n        // [\"S5685\"],\n        // [\"S5686\"],\n        // [\"S5687\"],\n        // [\"S5688\"],\n        // [\"S5689\"],\n        // [\"S5690\"],\n        // [\"S5691\"],\n        // [\"S5692\"],\n        [\"S5693\"] = \"SECURITY_HOTSPOT\",\n        // [\"S5694\"],\n        // [\"S5695\"],\n        // [\"S5696\"],\n        // [\"S5697\"],\n        // [\"S5698\"],\n        // [\"S5699\"],\n        // [\"S5700\"],\n        // [\"S5701\"],\n        // [\"S5702\"],\n        // [\"S5703\"],\n        // [\"S5704\"],\n        // [\"S5705\"],\n        // [\"S5706\"],\n        // [\"S5707\"],\n        // [\"S5708\"],\n        // [\"S5709\"],\n        // [\"S5710\"],\n        // [\"S5711\"],\n        // [\"S5712\"],\n        // [\"S5713\"],\n        // [\"S5714\"],\n        // [\"S5715\"],\n        // [\"S5716\"],\n        // [\"S5717\"],\n        // [\"S5718\"],\n        // [\"S5719\"],\n        // [\"S5720\"],\n        // [\"S5721\"],\n        // [\"S5722\"],\n        // [\"S5723\"],\n        // [\"S5724\"],\n        // [\"S5725\"],\n        // [\"S5726\"],\n        // [\"S5727\"],\n        // [\"S5728\"],\n        // [\"S5729\"],\n        // [\"S5730\"],\n        // [\"S5731\"],\n        // [\"S5732\"],\n        // [\"S5733\"],\n        // [\"S5734\"],\n        // [\"S5735\"],\n        // [\"S5736\"],\n        // [\"S5737\"],\n        // [\"S5738\"],\n        // [\"S5739\"],\n        // [\"S5740\"],\n        // [\"S5741\"],\n        // [\"S5742\"],\n        // [\"S5743\"],\n        // [\"S5744\"],\n        // [\"S5745\"],\n        // [\"S5746\"],\n        // [\"S5747\"],\n        // [\"S5748\"],\n        // [\"S5749\"],\n        // [\"S5750\"],\n        // [\"S5751\"],\n        // [\"S5752\"],\n        [\"S5753\"] = \"SECURITY_HOTSPOT\",\n        // [\"S5754\"],\n        // [\"S5755\"],\n        // [\"S5756\"],\n        // [\"S5757\"],\n        // [\"S5758\"],\n        // [\"S5759\"],\n        // [\"S5760\"],\n        // [\"S5761\"],\n        // [\"S5762\"],\n        // [\"S5763\"],\n        // [\"S5764\"],\n        // [\"S5765\"],\n        // [\"S5766\"],\n        // [\"S5767\"],\n        // [\"S5768\"],\n        // [\"S5769\"],\n        // [\"S5770\"],\n        // [\"S5771\"],\n        // [\"S5772\"],\n        [\"S5773\"] = \"VULNERABILITY\",\n        // [\"S5774\"],\n        // [\"S5775\"],\n        // [\"S5776\"],\n        // [\"S5777\"],\n        // [\"S5778\"],\n        // [\"S5779\"],\n        // [\"S5780\"],\n        // [\"S5781\"],\n        // [\"S5782\"],\n        // [\"S5783\"],\n        // [\"S5784\"],\n        // [\"S5785\"],\n        // [\"S5786\"],\n        // [\"S5787\"],\n        // [\"S5788\"],\n        // [\"S5789\"],\n        // [\"S5790\"],\n        // [\"S5791\"],\n        // [\"S5792\"],\n        // [\"S5793\"],\n        // [\"S5794\"],\n        // [\"S5795\"],\n        // [\"S5796\"],\n        // [\"S5797\"],\n        // [\"S5798\"],\n        // [\"S5799\"],\n        // [\"S5800\"],\n        // [\"S5801\"],\n        // [\"S5802\"],\n        // [\"S5803\"],\n        // [\"S5804\"],\n        // [\"S5805\"],\n        // [\"S5806\"],\n        // [\"S5807\"],\n        // [\"S5808\"],\n        // [\"S5809\"],\n        // [\"S5810\"],\n        // [\"S5811\"],\n        // [\"S5812\"],\n        // [\"S5813\"],\n        // [\"S5814\"],\n        // [\"S5815\"],\n        // [\"S5816\"],\n        // [\"S5817\"],\n        // [\"S5818\"],\n        // [\"S5819\"],\n        // [\"S5820\"],\n        // [\"S5821\"],\n        // [\"S5822\"],\n        // [\"S5823\"],\n        // [\"S5824\"],\n        // [\"S5825\"],\n        // [\"S5826\"],\n        // [\"S5827\"],\n        // [\"S5828\"],\n        // [\"S5829\"],\n        // [\"S5830\"],\n        // [\"S5831\"],\n        // [\"S5832\"],\n        // [\"S5833\"],\n        // [\"S5834\"],\n        // [\"S5835\"],\n        // [\"S5836\"],\n        // [\"S5837\"],\n        // [\"S5838\"],\n        // [\"S5839\"],\n        // [\"S5840\"],\n        // [\"S5841\"],\n        // [\"S5842\"],\n        // [\"S5843\"],\n        // [\"S5844\"],\n        // [\"S5845\"],\n        // [\"S5846\"],\n        // [\"S5847\"],\n        // [\"S5848\"],\n        // [\"S5849\"],\n        // [\"S5850\"],\n        // [\"S5851\"],\n        // [\"S5852\"],\n        // [\"S5853\"],\n        // [\"S5854\"],\n        // [\"S5855\"],\n        [\"S5856\"] = \"BUG\",\n        // [\"S5857\"],\n        // [\"S5858\"],\n        // [\"S5859\"],\n        // [\"S5860\"],\n        // [\"S5861\"],\n        // [\"S5862\"],\n        // [\"S5863\"],\n        // [\"S5864\"],\n        // [\"S5865\"],\n        // [\"S5866\"],\n        // [\"S5867\"],\n        // [\"S5868\"],\n        // [\"S5869\"],\n        // [\"S5870\"],\n        // [\"S5871\"],\n        // [\"S5872\"],\n        // [\"S5873\"],\n        // [\"S5874\"],\n        // [\"S5875\"],\n        // [\"S5876\"],\n        // [\"S5877\"],\n        // [\"S5878\"],\n        // [\"S5879\"],\n        // [\"S5880\"],\n        // [\"S5881\"],\n        // [\"S5882\"],\n        // [\"S5883\"],\n        // [\"S5884\"],\n        // [\"S5885\"],\n        // [\"S5886\"],\n        // [\"S5887\"],\n        // [\"S5888\"],\n        // [\"S5889\"],\n        // [\"S5890\"],\n        // [\"S5891\"],\n        // [\"S5892\"],\n        // [\"S5893\"],\n        // [\"S5894\"],\n        // [\"S5895\"],\n        // [\"S5896\"],\n        // [\"S5897\"],\n        // [\"S5898\"],\n        // [\"S5899\"],\n        // [\"S5900\"],\n        // [\"S5901\"],\n        // [\"S5902\"],\n        // [\"S5903\"],\n        // [\"S5904\"],\n        // [\"S5905\"],\n        // [\"S5906\"],\n        // [\"S5907\"],\n        // [\"S5908\"],\n        // [\"S5909\"],\n        // [\"S5910\"],\n        // [\"S5911\"],\n        // [\"S5912\"],\n        // [\"S5913\"],\n        // [\"S5914\"],\n        // [\"S5915\"],\n        // [\"S5916\"],\n        // [\"S5917\"],\n        // [\"S5918\"],\n        // [\"S5919\"],\n        // [\"S5920\"],\n        // [\"S5921\"],\n        // [\"S5922\"],\n        // [\"S5923\"],\n        // [\"S5924\"],\n        // [\"S5925\"],\n        // [\"S5926\"],\n        // [\"S5927\"],\n        // [\"S5928\"],\n        // [\"S5929\"],\n        // [\"S5930\"],\n        // [\"S5931\"],\n        // [\"S5932\"],\n        // [\"S5933\"],\n        // [\"S5934\"],\n        // [\"S5935\"],\n        // [\"S5936\"],\n        // [\"S5937\"],\n        // [\"S5938\"],\n        // [\"S5939\"],\n        // [\"S5940\"],\n        // [\"S5941\"],\n        // [\"S5942\"],\n        // [\"S5943\"],\n        [\"S5944\"] = \"CODE_SMELL\",\n        // [\"S5945\"],\n        // [\"S5946\"],\n        // [\"S5947\"],\n        // [\"S5948\"],\n        // [\"S5949\"],\n        // [\"S5950\"],\n        // [\"S5951\"],\n        // [\"S5952\"],\n        // [\"S5953\"],\n        // [\"S5954\"],\n        // [\"S5955\"],\n        // [\"S5956\"],\n        // [\"S5957\"],\n        // [\"S5958\"],\n        // [\"S5959\"],\n        // [\"S5960\"],\n        // [\"S5961\"],\n        // [\"S5962\"],\n        // [\"S5963\"],\n        // [\"S5964\"],\n        // [\"S5965\"],\n        // [\"S5966\"],\n        // [\"S5967\"],\n        // [\"S5968\"],\n        // [\"S5969\"],\n        // [\"S5970\"],\n        // [\"S5971\"],\n        // [\"S5972\"],\n        // [\"S5973\"],\n        // [\"S5974\"],\n        // [\"S5975\"],\n        // [\"S5976\"],\n        // [\"S5977\"],\n        // [\"S5978\"],\n        // [\"S5979\"],\n        // [\"S5980\"],\n        // [\"S5981\"],\n        // [\"S5982\"],\n        // [\"S5983\"],\n        // [\"S5984\"],\n        // [\"S5985\"],\n        // [\"S5986\"],\n        // [\"S5987\"],\n        // [\"S5988\"],\n        // [\"S5989\"],\n        // [\"S5990\"],\n        // [\"S5991\"],\n        // [\"S5992\"],\n        // [\"S5993\"],\n        // [\"S5994\"],\n        // [\"S5995\"],\n        // [\"S5996\"],\n        // [\"S5997\"],\n        // [\"S5998\"],\n        // [\"S5999\"],\n        // [\"S6000\"],\n        // [\"S6001\"],\n        // [\"S6002\"],\n        // [\"S6003\"],\n        // [\"S6004\"],\n        // [\"S6005\"],\n        // [\"S6006\"],\n        // [\"S6007\"],\n        // [\"S6008\"],\n        // [\"S6009\"],\n        // [\"S6010\"],\n        // [\"S6011\"],\n        // [\"S6012\"],\n        // [\"S6013\"],\n        // [\"S6014\"],\n        // [\"S6015\"],\n        // [\"S6016\"],\n        // [\"S6017\"],\n        // [\"S6018\"],\n        // [\"S6019\"],\n        // [\"S6020\"],\n        // [\"S6021\"],\n        // [\"S6022\"],\n        // [\"S6023\"],\n        // [\"S6024\"],\n        // [\"S6025\"],\n        // [\"S6026\"],\n        // [\"S6027\"],\n        // [\"S6028\"],\n        // [\"S6029\"],\n        // [\"S6030\"],\n        // [\"S6031\"],\n        // [\"S6032\"],\n        // [\"S6033\"],\n        // [\"S6034\"],\n        // [\"S6035\"],\n        // [\"S6036\"],\n        // [\"S6037\"],\n        // [\"S6038\"],\n        // [\"S6039\"],\n        // [\"S6040\"],\n        // [\"S6041\"],\n        // [\"S6042\"],\n        // [\"S6043\"],\n        // [\"S6044\"],\n        // [\"S6045\"],\n        // [\"S6046\"],\n        // [\"S6047\"],\n        // [\"S6048\"],\n        // [\"S6049\"],\n        // [\"S6050\"],\n        // [\"S6051\"],\n        // [\"S6052\"],\n        // [\"S6053\"],\n        // [\"S6054\"],\n        // [\"S6055\"],\n        // [\"S6056\"],\n        // [\"S6057\"],\n        // [\"S6058\"],\n        // [\"S6059\"],\n        // [\"S6060\"],\n        // [\"S6061\"],\n        // [\"S6062\"],\n        // [\"S6063\"],\n        // [\"S6064\"],\n        // [\"S6065\"],\n        // [\"S6066\"],\n        // [\"S6067\"],\n        // [\"S6068\"],\n        // [\"S6069\"],\n        // [\"S6070\"],\n        // [\"S6071\"],\n        // [\"S6072\"],\n        // [\"S6073\"],\n        // [\"S6074\"],\n        // [\"S6075\"],\n        // [\"S6076\"],\n        // [\"S6077\"],\n        // [\"S6078\"],\n        // [\"S6079\"],\n        // [\"S6080\"],\n        // [\"S6081\"],\n        // [\"S6082\"],\n        // [\"S6083\"],\n        // [\"S6084\"],\n        // [\"S6085\"],\n        // [\"S6086\"],\n        // [\"S6087\"],\n        // [\"S6088\"],\n        // [\"S6089\"],\n        // [\"S6090\"],\n        // [\"S6091\"],\n        // [\"S6092\"],\n        // [\"S6093\"],\n        // [\"S6094\"],\n        // [\"S6095\"],\n        // [\"S6096\"],\n        // [\"S6097\"],\n        // [\"S6098\"],\n        // [\"S6099\"],\n        // [\"S6100\"],\n        // [\"S6101\"],\n        // [\"S6102\"],\n        // [\"S6103\"],\n        // [\"S6104\"],\n        // [\"S6105\"],\n        // [\"S6106\"],\n        // [\"S6107\"],\n        // [\"S6108\"],\n        // [\"S6109\"],\n        // [\"S6110\"],\n        // [\"S6111\"],\n        // [\"S6112\"],\n        // [\"S6113\"],\n        // [\"S6114\"],\n        // [\"S6115\"],\n        // [\"S6116\"],\n        // [\"S6117\"],\n        // [\"S6118\"],\n        // [\"S6119\"],\n        // [\"S6120\"],\n        // [\"S6121\"],\n        // [\"S6122\"],\n        // [\"S6123\"],\n        // [\"S6124\"],\n        // [\"S6125\"],\n        // [\"S6126\"],\n        // [\"S6127\"],\n        // [\"S6128\"],\n        // [\"S6129\"],\n        // [\"S6130\"],\n        // [\"S6131\"],\n        // [\"S6132\"],\n        // [\"S6133\"],\n        // [\"S6134\"],\n        // [\"S6135\"],\n        // [\"S6136\"],\n        // [\"S6137\"],\n        // [\"S6138\"],\n        // [\"S6139\"],\n        // [\"S6140\"],\n        // [\"S6141\"],\n        // [\"S6142\"],\n        // [\"S6143\"],\n        // [\"S6144\"],\n        [\"S6145\"] = \"CODE_SMELL\",\n        [\"S6146\"] = \"CODE_SMELL\",\n        // [\"S6147\"],\n        // [\"S6148\"],\n        // [\"S6149\"],\n        // [\"S6150\"],\n        // [\"S6151\"],\n        // [\"S6152\"],\n        // [\"S6153\"],\n        // [\"S6154\"],\n        // [\"S6155\"],\n        // [\"S6156\"],\n        // [\"S6157\"],\n        // [\"S6158\"],\n        // [\"S6159\"],\n        // [\"S6160\"],\n        // [\"S6161\"],\n        // [\"S6162\"],\n        // [\"S6163\"],\n        // [\"S6164\"],\n        // [\"S6165\"],\n        // [\"S6166\"],\n        // [\"S6167\"],\n        // [\"S6168\"],\n        // [\"S6169\"],\n        // [\"S6170\"],\n        // [\"S6171\"],\n        // [\"S6172\"],\n        // [\"S6173\"],\n        // [\"S6174\"],\n        // [\"S6175\"],\n        // [\"S6176\"],\n        // [\"S6177\"],\n        // [\"S6178\"],\n        // [\"S6179\"],\n        // [\"S6180\"],\n        // [\"S6181\"],\n        // [\"S6182\"],\n        // [\"S6183\"],\n        // [\"S6184\"],\n        // [\"S6185\"],\n        // [\"S6186\"],\n        // [\"S6187\"],\n        // [\"S6188\"],\n        // [\"S6189\"],\n        // [\"S6190\"],\n        // [\"S6191\"],\n        // [\"S6192\"],\n        // [\"S6193\"],\n        // [\"S6194\"],\n        // [\"S6195\"],\n        // [\"S6196\"],\n        // [\"S6197\"],\n        // [\"S6198\"],\n        // [\"S6199\"],\n        // [\"S6200\"],\n        // [\"S6201\"],\n        // [\"S6202\"],\n        // [\"S6203\"],\n        // [\"S6204\"],\n        // [\"S6205\"],\n        // [\"S6206\"],\n        // [\"S6207\"],\n        // [\"S6208\"],\n        // [\"S6209\"],\n        // [\"S6210\"],\n        // [\"S6211\"],\n        // [\"S6212\"],\n        // [\"S6213\"],\n        // [\"S6214\"],\n        // [\"S6215\"],\n        // [\"S6216\"],\n        // [\"S6217\"],\n        // [\"S6218\"],\n        // [\"S6219\"],\n        // [\"S6220\"],\n        // [\"S6221\"],\n        // [\"S6222\"],\n        // [\"S6223\"],\n        // [\"S6224\"],\n        // [\"S6225\"],\n        // [\"S6226\"],\n        // [\"S6227\"],\n        // [\"S6228\"],\n        // [\"S6229\"],\n        // [\"S6230\"],\n        // [\"S6231\"],\n        // [\"S6232\"],\n        // [\"S6233\"],\n        // [\"S6234\"],\n        // [\"S6235\"],\n        // [\"S6236\"],\n        // [\"S6237\"],\n        // [\"S6238\"],\n        // [\"S6239\"],\n        // [\"S6240\"],\n        // [\"S6241\"],\n        // [\"S6242\"],\n        // [\"S6243\"],\n        // [\"S6244\"],\n        // [\"S6245\"],\n        // [\"S6246\"],\n        // [\"S6247\"],\n        // [\"S6248\"],\n        // [\"S6249\"],\n        // [\"S6250\"],\n        // [\"S6251\"],\n        // [\"S6252\"],\n        // [\"S6253\"],\n        // [\"S6254\"],\n        // [\"S6255\"],\n        // [\"S6256\"],\n        // [\"S6257\"],\n        // [\"S6258\"],\n        // [\"S6259\"],\n        // [\"S6260\"],\n        // [\"S6261\"],\n        // [\"S6262\"],\n        // [\"S6263\"],\n        // [\"S6264\"],\n        // [\"S6265\"],\n        // [\"S6266\"],\n        // [\"S6267\"],\n        // [\"S6268\"],\n        // [\"S6269\"],\n        // [\"S6270\"],\n        // [\"S6271\"],\n        // [\"S6272\"],\n        // [\"S6273\"],\n        // [\"S6274\"],\n        // [\"S6275\"],\n        // [\"S6276\"],\n        // [\"S6277\"],\n        // [\"S6278\"],\n        // [\"S6279\"],\n        // [\"S6280\"],\n        // [\"S6281\"],\n        // [\"S6282\"],\n        // [\"S6283\"],\n        // [\"S6284\"],\n        // [\"S6285\"],\n        // [\"S6286\"],\n        // [\"S6287\"],\n        // [\"S6288\"],\n        // [\"S6289\"],\n        // [\"S6290\"],\n        // [\"S6291\"],\n        // [\"S6292\"],\n        // [\"S6293\"],\n        // [\"S6294\"],\n        // [\"S6295\"],\n        // [\"S6296\"],\n        // [\"S6297\"],\n        // [\"S6298\"],\n        // [\"S6299\"],\n        // [\"S6300\"],\n        // [\"S6301\"],\n        // [\"S6302\"],\n        // [\"S6303\"],\n        // [\"S6304\"],\n        // [\"S6305\"],\n        // [\"S6306\"],\n        // [\"S6307\"],\n        // [\"S6308\"],\n        // [\"S6309\"],\n        // [\"S6310\"],\n        // [\"S6311\"],\n        // [\"S6312\"],\n        // [\"S6313\"],\n        // [\"S6314\"],\n        // [\"S6315\"],\n        // [\"S6316\"],\n        // [\"S6317\"],\n        // [\"S6318\"],\n        // [\"S6319\"],\n        // [\"S6320\"],\n        // [\"S6321\"],\n        // [\"S6322\"],\n        // [\"S6323\"],\n        // [\"S6324\"],\n        // [\"S6325\"],\n        // [\"S6326\"],\n        // [\"S6327\"],\n        // [\"S6328\"],\n        // [\"S6329\"],\n        // [\"S6330\"],\n        // [\"S6331\"],\n        // [\"S6332\"],\n        // [\"S6333\"],\n        // [\"S6334\"],\n        // [\"S6335\"],\n        // [\"S6336\"],\n        // [\"S6337\"],\n        // [\"S6338\"],\n        // [\"S6339\"],\n        // [\"S6340\"],\n        // [\"S6341\"],\n        // [\"S6342\"],\n        // [\"S6343\"],\n        // [\"S6344\"],\n        // [\"S6345\"],\n        // [\"S6346\"],\n        // [\"S6347\"],\n        // [\"S6348\"],\n        // [\"S6349\"],\n        // [\"S6350\"],\n        // [\"S6351\"],\n        // [\"S6352\"],\n        // [\"S6353\"],\n        [\"S6354\"] = \"CODE_SMELL\",\n        // [\"S6355\"],\n        // [\"S6356\"],\n        // [\"S6357\"],\n        // [\"S6358\"],\n        // [\"S6359\"],\n        // [\"S6360\"],\n        // [\"S6361\"],\n        // [\"S6362\"],\n        // [\"S6363\"],\n        // [\"S6364\"],\n        // [\"S6365\"],\n        // [\"S6366\"],\n        // [\"S6367\"],\n        // [\"S6368\"],\n        // [\"S6369\"],\n        // [\"S6370\"],\n        // [\"S6371\"],\n        // [\"S6372\"],\n        // [\"S6373\"],\n        // [\"S6374\"],\n        // [\"S6375\"],\n        // [\"S6376\"],\n        // [\"S6377\"],\n        // [\"S6378\"],\n        // [\"S6379\"],\n        // [\"S6380\"],\n        // [\"S6381\"],\n        // [\"S6382\"],\n        // [\"S6383\"],\n        // [\"S6384\"],\n        // [\"S6385\"],\n        // [\"S6386\"],\n        // [\"S6387\"],\n        // [\"S6388\"],\n        // [\"S6389\"],\n        // [\"S6390\"],\n        // [\"S6391\"],\n        // [\"S6392\"],\n        // [\"S6393\"],\n        // [\"S6394\"],\n        // [\"S6395\"],\n        // [\"S6396\"],\n        // [\"S6397\"],\n        // [\"S6398\"],\n        // [\"S6399\"],\n        // [\"S6400\"],\n        // [\"S6401\"],\n        // [\"S6402\"],\n        // [\"S6403\"],\n        // [\"S6404\"],\n        // [\"S6405\"],\n        // [\"S6406\"],\n        // [\"S6407\"],\n        // [\"S6408\"],\n        // [\"S6409\"],\n        // [\"S6410\"],\n        // [\"S6411\"],\n        // [\"S6412\"],\n        // [\"S6413\"],\n        // [\"S6414\"],\n        // [\"S6415\"],\n        // [\"S6416\"],\n        // [\"S6417\"],\n        [\"S6418\"] = \"VULNERABILITY\",\n        // [\"S6419\"],\n        // [\"S6420\"],\n        // [\"S6421\"],\n        // [\"S6422\"],\n        // [\"S6423\"],\n        // [\"S6424\"],\n        // [\"S6425\"],\n        // [\"S6426\"],\n        // [\"S6427\"],\n        // [\"S6428\"],\n        // [\"S6429\"],\n        // [\"S6430\"],\n        // [\"S6431\"],\n        // [\"S6432\"],\n        // [\"S6433\"],\n        // [\"S6434\"],\n        // [\"S6435\"],\n        // [\"S6436\"],\n        // [\"S6437\"],\n        // [\"S6438\"],\n        // [\"S6439\"],\n        // [\"S6440\"],\n        // [\"S6441\"],\n        // [\"S6442\"],\n        // [\"S6443\"],\n        [\"S6444\"] = \"SECURITY_HOTSPOT\",\n        // [\"S6445\"],\n        // [\"S6446\"],\n        // [\"S6447\"],\n        // [\"S6448\"],\n        // [\"S6449\"],\n        // [\"S6450\"],\n        // [\"S6451\"],\n        // [\"S6452\"],\n        // [\"S6453\"],\n        // [\"S6454\"],\n        // [\"S6455\"],\n        // [\"S6456\"],\n        // [\"S6457\"],\n        // [\"S6458\"],\n        // [\"S6459\"],\n        // [\"S6460\"],\n        // [\"S6461\"],\n        // [\"S6462\"],\n        // [\"S6463\"],\n        // [\"S6464\"],\n        // [\"S6465\"],\n        // [\"S6466\"],\n        // [\"S6467\"],\n        // [\"S6468\"],\n        // [\"S6469\"],\n        // [\"S6470\"],\n        // [\"S6471\"],\n        // [\"S6472\"],\n        // [\"S6473\"],\n        // [\"S6474\"],\n        // [\"S6475\"],\n        // [\"S6476\"],\n        // [\"S6477\"],\n        // [\"S6478\"],\n        // [\"S6479\"],\n        // [\"S6480\"],\n        // [\"S6481\"],\n        // [\"S6482\"],\n        // [\"S6483\"],\n        // [\"S6484\"],\n        // [\"S6485\"],\n        // [\"S6486\"],\n        // [\"S6487\"],\n        // [\"S6488\"],\n        // [\"S6489\"],\n        // [\"S6490\"],\n        // [\"S6491\"],\n        // [\"S6492\"],\n        // [\"S6493\"],\n        // [\"S6494\"],\n        // [\"S6495\"],\n        // [\"S6496\"],\n        // [\"S6497\"],\n        // [\"S6498\"],\n        // [\"S6499\"],\n        // [\"S6500\"],\n        // [\"S6501\"],\n        // [\"S6502\"],\n        // [\"S6503\"],\n        // [\"S6504\"],\n        // [\"S6505\"],\n        // [\"S6506\"],\n        // [\"S6507\"],\n        // [\"S6508\"],\n        // [\"S6509\"],\n        // [\"S6510\"],\n        // [\"S6511\"],\n        // [\"S6512\"],\n        [\"S6513\"] = \"CODE_SMELL\",\n        // [\"S6514\"],\n        // [\"S6515\"],\n        // [\"S6516\"],\n        // [\"S6517\"],\n        // [\"S6518\"],\n        // [\"S6519\"],\n        // [\"S6520\"],\n        // [\"S6521\"],\n        // [\"S6522\"],\n        // [\"S6523\"],\n        // [\"S6524\"],\n        // [\"S6525\"],\n        // [\"S6526\"],\n        // [\"S6527\"],\n        // [\"S6528\"],\n        // [\"S6529\"],\n        // [\"S6530\"],\n        // [\"S6531\"],\n        // [\"S6532\"],\n        // [\"S6533\"],\n        // [\"S6534\"],\n        // [\"S6535\"],\n        // [\"S6536\"],\n        // [\"S6537\"],\n        // [\"S6538\"],\n        // [\"S6539\"],\n        // [\"S6540\"],\n        // [\"S6541\"],\n        // [\"S6542\"],\n        // [\"S6543\"],\n        // [\"S6544\"],\n        // [\"S6545\"],\n        // [\"S6546\"],\n        // [\"S6547\"],\n        // [\"S6548\"],\n        // [\"S6549\"],\n        // [\"S6550\"],\n        // [\"S6551\"],\n        // [\"S6552\"],\n        // [\"S6553\"],\n        // [\"S6554\"],\n        // [\"S6555\"],\n        // [\"S6556\"],\n        // [\"S6557\"],\n        // [\"S6558\"],\n        // [\"S6559\"],\n        // [\"S6560\"],\n        [\"S6561\"] = \"CODE_SMELL\",\n        [\"S6562\"] = \"CODE_SMELL\",\n        [\"S6563\"] = \"CODE_SMELL\",\n        // [\"S6564\"],\n        // [\"S6565\"],\n        [\"S6566\"] = \"CODE_SMELL\",\n        // [\"S6567\"],\n        // [\"S6568\"],\n        // [\"S6569\"],\n        // [\"S6570\"],\n        // [\"S6571\"],\n        // [\"S6572\"],\n        // [\"S6573\"],\n        // [\"S6574\"],\n        [\"S6575\"] = \"CODE_SMELL\",\n        // [\"S6576\"],\n        // [\"S6577\"],\n        // [\"S6578\"],\n        // [\"S6579\"],\n        [\"S6580\"] = \"CODE_SMELL\",\n        // [\"S6581\"],\n        // [\"S6582\"],\n        // [\"S6583\"],\n        // [\"S6584\"],\n        [\"S6585\"] = \"CODE_SMELL\",\n        // [\"S6586\"],\n        // [\"S6587\"],\n        [\"S6588\"] = \"CODE_SMELL\",\n        // [\"S6589\"],\n        // [\"S6590\"],\n        // [\"S6591\"],\n        // [\"S6592\"],\n        // [\"S6593\"],\n        // [\"S6594\"],\n        // [\"S6595\"],\n        // [\"S6596\"],\n        // [\"S6597\"],\n        // [\"S6598\"],\n        // [\"S6599\"],\n        // [\"S6600\"],\n        // [\"S6601\"],\n        [\"S6602\"] = \"CODE_SMELL\",\n        [\"S6603\"] = \"CODE_SMELL\",\n        // [\"S6604\"],\n        [\"S6605\"] = \"CODE_SMELL\",\n        // [\"S6606\"],\n        [\"S6607\"] = \"CODE_SMELL\",\n        [\"S6608\"] = \"CODE_SMELL\",\n        [\"S6609\"] = \"CODE_SMELL\",\n        [\"S6610\"] = \"CODE_SMELL\",\n        // [\"S6611\"],\n        [\"S6612\"] = \"CODE_SMELL\",\n        [\"S6613\"] = \"CODE_SMELL\",\n        // [\"S6614\"],\n        // [\"S6615\"],\n        // [\"S6616\"],\n        [\"S6617\"] = \"CODE_SMELL\",\n        // [\"S6618\"],\n        // [\"S6619\"],\n        // [\"S6620\"],\n        // [\"S6621\"],\n        // [\"S6622\"],\n        // [\"S6623\"],\n        // [\"S6624\"],\n        // [\"S6625\"],\n        // [\"S6626\"],\n        // [\"S6627\"],\n        // [\"S6628\"],\n        // [\"S6629\"],\n        // [\"S6630\"],\n        // [\"S6631\"],\n        // [\"S6632\"],\n        // [\"S6633\"],\n        // [\"S6634\"],\n        // [\"S6635\"],\n        // [\"S6636\"],\n        // [\"S6637\"],\n        // [\"S6638\"],\n        // [\"S6639\"],\n        // [\"S6640\"],\n        // [\"S6641\"],\n        // [\"S6642\"],\n        // [\"S6643\"],\n        // [\"S6644\"],\n        // [\"S6645\"],\n        // [\"S6646\"],\n        // [\"S6647\"],\n        // [\"S6648\"],\n        // [\"S6649\"],\n        // [\"S6650\"],\n        // [\"S6651\"],\n        // [\"S6652\"],\n        // [\"S6653\"],\n        // [\"S6654\"],\n        // [\"S6655\"],\n        // [\"S6656\"],\n        // [\"S6657\"],\n        // [\"S6658\"],\n        // [\"S6659\"],\n        // [\"S6660\"],\n        // [\"S6661\"],\n        // [\"S6662\"],\n        // [\"S6663\"],\n        // [\"S6664\"],\n        // [\"S6665\"],\n        // [\"S6666\"],\n        // [\"S6667\"],\n        // [\"S6668\"],\n        // [\"S6669\"],\n        // [\"S6670\"],\n        // [\"S6671\"],\n        // [\"S6672\"],\n        // [\"S6673\"],\n        // [\"S6674\"],\n        // [\"S6675\"],\n        // [\"S6676\"],\n        // [\"S6677\"],\n        // [\"S6678\"],\n        // [\"S6679\"],\n        // [\"S6680\"],\n        // [\"S6681\"],\n        // [\"S6682\"],\n        // [\"S6683\"],\n        // [\"S6684\"],\n        // [\"S6685\"],\n        // [\"S6686\"],\n        // [\"S6687\"],\n        // [\"S6688\"],\n        // [\"S6689\"],\n        // [\"S6690\"],\n        // [\"S6691\"],\n        // [\"S6692\"],\n        // [\"S6693\"],\n        // [\"S6694\"],\n        // [\"S6695\"],\n        // [\"S6696\"],\n        // [\"S6697\"],\n        // [\"S6698\"],\n        // [\"S6699\"],\n        // [\"S6700\"],\n        // [\"S6701\"],\n        // [\"S6702\"],\n        // [\"S6703\"],\n        // [\"S6704\"],\n        // [\"S6705\"],\n        // [\"S6706\"],\n        // [\"S6707\"],\n        // [\"S6708\"],\n        // [\"S6709\"],\n        // [\"S6710\"],\n        // [\"S6711\"],\n        // [\"S6712\"],\n        // [\"S6713\"],\n        // [\"S6714\"],\n        // [\"S6715\"],\n        // [\"S6716\"],\n        // [\"S6717\"],\n        // [\"S6718\"],\n        // [\"S6719\"],\n        // [\"S6720\"],\n        // [\"S6721\"],\n        // [\"S6722\"],\n        // [\"S6723\"],\n        // [\"S6724\"],\n        // [\"S6725\"],\n        // [\"S6726\"],\n        // [\"S6727\"],\n        // [\"S6728\"],\n        // [\"S6729\"],\n        // [\"S6730\"],\n        // [\"S6731\"],\n        // [\"S6732\"],\n        // [\"S6733\"],\n        // [\"S6734\"],\n        // [\"S6735\"],\n        // [\"S6736\"],\n        // [\"S6737\"],\n        // [\"S6738\"],\n        // [\"S6739\"],\n        // [\"S6740\"],\n        // [\"S6741\"],\n        // [\"S6742\"],\n        // [\"S6743\"],\n        // [\"S6744\"],\n        // [\"S6745\"],\n        // [\"S6746\"],\n        // [\"S6747\"],\n        // [\"S6748\"],\n        // [\"S6749\"],\n        // [\"S6750\"],\n        // [\"S6751\"],\n        // [\"S6752\"],\n        // [\"S6753\"],\n        // [\"S6754\"],\n        // [\"S6755\"],\n        // [\"S6756\"],\n        // [\"S6757\"],\n        // [\"S6758\"],\n        // [\"S6759\"],\n        // [\"S6760\"],\n        // [\"S6761\"],\n        // [\"S6762\"],\n        // [\"S6763\"],\n        // [\"S6764\"],\n        // [\"S6765\"],\n        // [\"S6766\"],\n        // [\"S6767\"],\n        // [\"S6768\"],\n        // [\"S6769\"],\n        // [\"S6770\"],\n        // [\"S6771\"],\n        // [\"S6772\"],\n        // [\"S6773\"],\n        // [\"S6774\"],\n        // [\"S6775\"],\n        // [\"S6776\"],\n        // [\"S6777\"],\n        // [\"S6778\"],\n        // [\"S6779\"],\n        // [\"S6780\"],\n        // [\"S6781\"],\n        // [\"S6782\"],\n        // [\"S6783\"],\n        // [\"S6784\"],\n        // [\"S6785\"],\n        // [\"S6786\"],\n        // [\"S6787\"],\n        // [\"S6788\"],\n        // [\"S6789\"],\n        // [\"S6790\"],\n        // [\"S6791\"],\n        // [\"S6792\"],\n        // [\"S6793\"],\n        // [\"S6794\"],\n        // [\"S6795\"],\n        // [\"S6796\"],\n        // [\"S6797\"],\n        // [\"S6798\"],\n        // [\"S6799\"],\n        // [\"S6800\"],\n        // [\"S6801\"],\n        // [\"S6802\"],\n        // [\"S6803\"],\n        // [\"S6804\"],\n        // [\"S6805\"],\n        // [\"S6806\"],\n        // [\"S6807\"],\n        // [\"S6808\"],\n        // [\"S6809\"],\n        // [\"S6810\"],\n        // [\"S6811\"],\n        // [\"S6812\"],\n        // [\"S6813\"],\n        // [\"S6814\"],\n        // [\"S6815\"],\n        // [\"S6816\"],\n        // [\"S6817\"],\n        // [\"S6818\"],\n        // [\"S6819\"],\n        // [\"S6820\"],\n        // [\"S6821\"],\n        // [\"S6822\"],\n        // [\"S6823\"],\n        // [\"S6824\"],\n        // [\"S6825\"],\n        // [\"S6826\"],\n        // [\"S6827\"],\n        // [\"S6828\"],\n        // [\"S6829\"],\n        // [\"S6830\"],\n        // [\"S6831\"],\n        // [\"S6832\"],\n        // [\"S6833\"],\n        // [\"S6834\"],\n        // [\"S6835\"],\n        // [\"S6836\"],\n        // [\"S6837\"],\n        // [\"S6838\"],\n        // [\"S6839\"],\n        // [\"S6840\"],\n        // [\"S6841\"],\n        // [\"S6842\"],\n        // [\"S6843\"],\n        // [\"S6844\"],\n        // [\"S6845\"],\n        // [\"S6846\"],\n        // [\"S6847\"],\n        // [\"S6848\"],\n        // [\"S6849\"],\n        // [\"S6850\"],\n        // [\"S6851\"],\n        // [\"S6852\"],\n        // [\"S6853\"],\n        // [\"S6854\"],\n        // [\"S6855\"],\n        // [\"S6856\"],\n        // [\"S6857\"],\n        // [\"S6858\"],\n        // [\"S6859\"],\n        // [\"S6860\"],\n        // [\"S6861\"],\n        // [\"S6862\"],\n        // [\"S6863\"],\n        // [\"S6864\"],\n        // [\"S6865\"],\n        // [\"S6866\"],\n        // [\"S6867\"],\n        // [\"S6868\"],\n        // [\"S6869\"],\n        // [\"S6870\"],\n        // [\"S6871\"],\n        // [\"S6872\"],\n        // [\"S6873\"],\n        // [\"S6874\"],\n        // [\"S6875\"],\n        // [\"S6876\"],\n        // [\"S6877\"],\n        // [\"S6878\"],\n        // [\"S6879\"],\n        // [\"S6880\"],\n        // [\"S6881\"],\n        // [\"S6882\"],\n        // [\"S6883\"],\n        // [\"S6884\"],\n        // [\"S6885\"],\n        // [\"S6886\"],\n        // [\"S6887\"],\n        // [\"S6888\"],\n        // [\"S6889\"],\n        // [\"S6890\"],\n        // [\"S6891\"],\n        // [\"S6892\"],\n        // [\"S6893\"],\n        // [\"S6894\"],\n        // [\"S6895\"],\n        // [\"S6896\"],\n        // [\"S6897\"],\n        // [\"S6898\"],\n        // [\"S6899\"],\n        // [\"S6900\"],\n        // [\"S6901\"],\n        // [\"S6902\"],\n        // [\"S6903\"],\n        // [\"S6904\"],\n        // [\"S6905\"],\n        // [\"S6906\"],\n        // [\"S6907\"],\n        // [\"S6908\"],\n        // [\"S6909\"],\n        // [\"S6910\"],\n        // [\"S6911\"],\n        // [\"S6912\"],\n        // [\"S6913\"],\n        // [\"S6914\"],\n        // [\"S6915\"],\n        // [\"S6916\"],\n        // [\"S6917\"],\n        // [\"S6918\"],\n        // [\"S6919\"],\n        // [\"S6920\"],\n        // [\"S6921\"],\n        // [\"S6922\"],\n        // [\"S6923\"],\n        // [\"S6924\"],\n        // [\"S6925\"],\n        // [\"S6926\"],\n        // [\"S6927\"],\n        // [\"S6928\"],\n        // [\"S6929\"],\n        [\"S6930\"] = \"BUG\",\n        [\"S6931\"] = \"CODE_SMELL\",\n        // [\"S6932\"],\n        // [\"S6933\"],\n        // [\"S6934\"],\n        // [\"S6935\"],\n        // [\"S6936\"],\n        // [\"S6937\"],\n        // [\"S6938\"],\n        // [\"S6939\"],\n        // [\"S6940\"],\n        // [\"S6941\"],\n        // [\"S6942\"],\n        // [\"S6943\"],\n        // [\"S6944\"],\n        // [\"S6945\"],\n        // [\"S6946\"],\n        // [\"S6947\"],\n        // [\"S6948\"],\n        // [\"S6949\"],\n        // [\"S6950\"],\n        // [\"S6951\"],\n        // [\"S6952\"],\n        // [\"S6953\"],\n        // [\"S6954\"],\n        // [\"S6955\"],\n        // [\"S6956\"],\n        // [\"S6957\"],\n        // [\"S6958\"],\n        // [\"S6959\"],\n        // [\"S6960\"],\n        // [\"S6961\"],\n        // [\"S6962\"],\n        // [\"S6963\"],\n        // [\"S6964\"],\n        // [\"S6965\"],\n        // [\"S6966\"],\n        // [\"S6967\"],\n        // [\"S6968\"],\n        // [\"S6969\"],\n        // [\"S6970\"],\n        // [\"S6971\"],\n        // [\"S6972\"],\n        // [\"S6973\"],\n        // [\"S6974\"],\n        // [\"S6975\"],\n        // [\"S6976\"],\n        // [\"S6977\"],\n        // [\"S6978\"],\n        // [\"S6979\"],\n        // [\"S6980\"],\n        // [\"S6981\"],\n        // [\"S6982\"],\n        // [\"S6983\"],\n        // [\"S6984\"],\n        // [\"S6985\"],\n        // [\"S6986\"],\n        // [\"S6987\"],\n        // [\"S6988\"],\n        // [\"S6989\"],\n        // [\"S6990\"],\n        // [\"S6991\"],\n        // [\"S6992\"],\n        // [\"S6993\"],\n        // [\"S6994\"],\n        // [\"S6995\"],\n        // [\"S6996\"],\n        // [\"S6997\"],\n        // [\"S6998\"],\n        // [\"S6999\"],\n        // [\"S7000\"],\n        // [\"S7001\"],\n        // [\"S7002\"],\n        // [\"S7003\"],\n        // [\"S7004\"],\n        // [\"S7005\"],\n        // [\"S7006\"],\n        // [\"S7007\"],\n        // [\"S7008\"],\n        // [\"S7009\"],\n        // [\"S7010\"],\n        // [\"S7011\"],\n        // [\"S7012\"],\n        // [\"S7013\"],\n        // [\"S7014\"],\n        // [\"S7015\"],\n        // [\"S7016\"],\n        // [\"S7017\"],\n        // [\"S7018\"],\n        // [\"S7019\"],\n        // [\"S7020\"],\n        // [\"S7021\"],\n        // [\"S7022\"],\n        // [\"S7023\"],\n        // [\"S7024\"],\n        // [\"S7025\"],\n        // [\"S7026\"],\n        // [\"S7027\"],\n        // [\"S7028\"],\n        // [\"S7029\"],\n        // [\"S7030\"],\n        // [\"S7031\"],\n        // [\"S7032\"],\n        // [\"S7033\"],\n        // [\"S7034\"],\n        // [\"S7035\"],\n        // [\"S7036\"],\n        // [\"S7037\"],\n        // [\"S7038\"],\n        // [\"S7039\"],\n        // [\"S7040\"],\n        // [\"S7041\"],\n        // [\"S7042\"],\n        // [\"S7043\"],\n        // [\"S7044\"],\n        // [\"S7045\"],\n        // [\"S7046\"],\n        // [\"S7047\"],\n        // [\"S7048\"],\n        // [\"S7049\"],\n        // [\"S7050\"],\n        // [\"S7051\"],\n        // [\"S7052\"],\n        // [\"S7053\"],\n        // [\"S7054\"],\n        // [\"S7055\"],\n        // [\"S7056\"],\n        // [\"S7057\"],\n        // [\"S7058\"],\n        // [\"S7059\"],\n        // [\"S7060\"],\n        // [\"S7061\"],\n        // [\"S7062\"],\n        // [\"S7063\"],\n        // [\"S7064\"],\n        // [\"S7065\"],\n        // [\"S7066\"],\n        // [\"S7067\"],\n        // [\"S7068\"],\n        // [\"S7069\"],\n        // [\"S7070\"],\n        // [\"S7071\"],\n        // [\"S7072\"],\n        // [\"S7073\"],\n        // [\"S7074\"],\n        // [\"S7075\"],\n        // [\"S7076\"],\n        // [\"S7077\"],\n        // [\"S7078\"],\n        // [\"S7079\"],\n        // [\"S7080\"],\n        // [\"S7081\"],\n        // [\"S7082\"],\n        // [\"S7083\"],\n        // [\"S7084\"],\n        // [\"S7085\"],\n        // [\"S7086\"],\n        // [\"S7087\"],\n        // [\"S7088\"],\n        // [\"S7089\"],\n        // [\"S7090\"],\n        // [\"S7091\"],\n        // [\"S7092\"],\n        // [\"S7093\"],\n        // [\"S7094\"],\n        // [\"S7095\"],\n        // [\"S7096\"],\n        // [\"S7097\"],\n        // [\"S7098\"],\n        // [\"S7099\"],\n        // [\"S7100\"],\n        // [\"S7101\"],\n        // [\"S7102\"],\n        // [\"S7103\"],\n        // [\"S7104\"],\n        // [\"S7105\"],\n        // [\"S7106\"],\n        // [\"S7107\"],\n        // [\"S7108\"],\n        // [\"S7109\"],\n        // [\"S7110\"],\n        // [\"S7111\"],\n        // [\"S7112\"],\n        // [\"S7113\"],\n        // [\"S7114\"],\n        // [\"S7115\"],\n        // [\"S7116\"],\n        // [\"S7117\"],\n        // [\"S7118\"],\n        // [\"S7119\"],\n        // [\"S7120\"],\n        // [\"S7121\"],\n        // [\"S7122\"],\n        // [\"S7123\"],\n        // [\"S7124\"],\n        // [\"S7125\"],\n        // [\"S7126\"],\n        // [\"S7127\"],\n        // [\"S7128\"],\n        // [\"S7129\"],\n        [\"S7130\"] = \"CODE_SMELL\",\n        [\"S7131\"] = \"BUG\",\n        // [\"S7132\"],\n        [\"S7133\"] = \"BUG\",\n        // [\"S7134\"],\n        // [\"S7135\"],\n        // [\"S7136\"],\n        // [\"S7137\"],\n        // [\"S7138\"],\n        // [\"S7139\"],\n        // [\"S7140\"],\n        // [\"S7141\"],\n        // [\"S7142\"],\n        // [\"S7143\"],\n        // [\"S7144\"],\n        // [\"S7145\"],\n        // [\"S7146\"],\n        // [\"S7147\"],\n        // [\"S7148\"],\n        // [\"S7149\"],\n        // [\"S7150\"],\n        // [\"S7151\"],\n        // [\"S7152\"],\n        // [\"S7153\"],\n        // [\"S7154\"],\n        // [\"S7155\"],\n        // [\"S7156\"],\n        // [\"S7157\"],\n        // [\"S7158\"],\n        // [\"S7159\"],\n        // [\"S7160\"],\n        // [\"S7161\"],\n        // [\"S7162\"],\n        // [\"S7163\"],\n        // [\"S7164\"],\n        // [\"S7165\"],\n        // [\"S7166\"],\n        // [\"S7167\"],\n        // [\"S7168\"],\n        // [\"S7169\"],\n        // [\"S7170\"],\n        // [\"S7171\"],\n        // [\"S7172\"],\n        // [\"S7173\"],\n        // [\"S7174\"],\n        // [\"S7175\"],\n        // [\"S7176\"],\n        // [\"S7177\"],\n        // [\"S7178\"],\n        // [\"S7179\"],\n        // [\"S7180\"],\n        // [\"S7181\"],\n        // [\"S7182\"],\n        // [\"S7183\"],\n        // [\"S7184\"],\n        // [\"S7185\"],\n        // [\"S7186\"],\n        // [\"S7187\"],\n        // [\"S7188\"],\n        // [\"S7189\"],\n        // [\"S7190\"],\n        // [\"S7191\"],\n        // [\"S7192\"],\n        // [\"S7193\"],\n        // [\"S7194\"],\n        // [\"S7195\"],\n        // [\"S7196\"],\n        // [\"S7197\"],\n        // [\"S7198\"],\n        // [\"S7199\"],\n        // [\"S7200\"],\n        // [\"S7201\"],\n        // [\"S7202\"],\n        // [\"S7203\"],\n        // [\"S7204\"],\n        // [\"S7205\"],\n        // [\"S7206\"],\n        // [\"S7207\"],\n        // [\"S7208\"],\n        // [\"S7209\"],\n        // [\"S7210\"],\n        // [\"S7211\"],\n        // [\"S7212\"],\n        // [\"S7213\"],\n        // [\"S7214\"],\n        // [\"S7215\"],\n        // [\"S7216\"],\n        // [\"S7217\"],\n        // [\"S7218\"],\n        // [\"S7219\"],\n        // [\"S7220\"],\n        // [\"S7221\"],\n        // [\"S7222\"],\n        // [\"S7223\"],\n        // [\"S7224\"],\n        // [\"S7225\"],\n        // [\"S7226\"],\n        // [\"S7227\"],\n        // [\"S7228\"],\n        // [\"S7229\"],\n        // [\"S7230\"],\n        // [\"S7231\"],\n        // [\"S7232\"],\n        // [\"S7233\"],\n        // [\"S7234\"],\n        // [\"S7235\"],\n        // [\"S7236\"],\n        // [\"S7237\"],\n        // [\"S7238\"],\n        // [\"S7239\"],\n        // [\"S7240\"],\n        // [\"S7241\"],\n        // [\"S7242\"],\n        // [\"S7243\"],\n        // [\"S7244\"],\n        // [\"S7245\"],\n        // [\"S7246\"],\n        // [\"S7247\"],\n        // [\"S7248\"],\n        // [\"S7249\"],\n        // [\"S7250\"],\n        // [\"S7251\"],\n        // [\"S7252\"],\n        // [\"S7253\"],\n        // [\"S7254\"],\n        // [\"S7255\"],\n        // [\"S7256\"],\n        // [\"S7257\"],\n        // [\"S7258\"],\n        // [\"S7259\"],\n        // [\"S7260\"],\n        // [\"S7261\"],\n        // [\"S7262\"],\n        // [\"S7263\"],\n        // [\"S7264\"],\n        // [\"S7265\"],\n        // [\"S7266\"],\n        // [\"S7267\"],\n        // [\"S7268\"],\n        // [\"S7269\"],\n        // [\"S7270\"],\n        // [\"S7271\"],\n        // [\"S7272\"],\n        // [\"S7273\"],\n        // [\"S7274\"],\n        // [\"S7275\"],\n        // [\"S7276\"],\n        // [\"S7277\"],\n        // [\"S7278\"],\n        // [\"S7279\"],\n        // [\"S7280\"],\n        // [\"S7281\"],\n        // [\"S7282\"],\n        // [\"S7283\"],\n        // [\"S7284\"],\n        // [\"S7285\"],\n        // [\"S7286\"],\n        // [\"S7287\"],\n        // [\"S7288\"],\n        // [\"S7289\"],\n        // [\"S7290\"],\n        // [\"S7291\"],\n        // [\"S7292\"],\n        // [\"S7293\"],\n        // [\"S7294\"],\n        // [\"S7295\"],\n        // [\"S7296\"],\n        // [\"S7297\"],\n        // [\"S7298\"],\n        // [\"S7299\"],\n        // [\"S7300\"],\n        // [\"S7301\"],\n        // [\"S7302\"],\n        // [\"S7303\"],\n        // [\"S7304\"],\n        // [\"S7305\"],\n        // [\"S7306\"],\n        // [\"S7307\"],\n        // [\"S7308\"],\n        // [\"S7309\"],\n        // [\"S7310\"],\n        // [\"S7311\"],\n        // [\"S7312\"],\n        // [\"S7313\"],\n        // [\"S7314\"],\n        // [\"S7315\"],\n        // [\"S7316\"],\n        // [\"S7317\"],\n        // [\"S7318\"],\n        // [\"S7319\"],\n        // [\"S7320\"],\n        // [\"S7321\"],\n        // [\"S7322\"],\n        // [\"S7323\"],\n        // [\"S7324\"],\n        // [\"S7325\"],\n        // [\"S7326\"],\n        // [\"S7327\"],\n        // [\"S7328\"],\n        // [\"S7329\"],\n        // [\"S7330\"],\n        // [\"S7331\"],\n        // [\"S7332\"],\n        // [\"S7333\"],\n        // [\"S7334\"],\n        // [\"S7335\"],\n        // [\"S7336\"],\n        // [\"S7337\"],\n        // [\"S7338\"],\n        // [\"S7339\"],\n        // [\"S7340\"],\n        // [\"S7341\"],\n        // [\"S7342\"],\n        // [\"S7343\"],\n        // [\"S7344\"],\n        // [\"S7345\"],\n        // [\"S7346\"],\n        // [\"S7347\"],\n        // [\"S7348\"],\n        // [\"S7349\"],\n        // [\"S7350\"],\n        // [\"S7351\"],\n        // [\"S7352\"],\n        // [\"S7353\"],\n        // [\"S7354\"],\n        // [\"S7355\"],\n        // [\"S7356\"],\n        // [\"S7357\"],\n        // [\"S7358\"],\n        // [\"S7359\"],\n        // [\"S7360\"],\n        // [\"S7361\"],\n        // [\"S7362\"],\n        // [\"S7363\"],\n        // [\"S7364\"],\n        // [\"S7365\"],\n        // [\"S7366\"],\n        // [\"S7367\"],\n        // [\"S7368\"],\n        // [\"S7369\"],\n        // [\"S7370\"],\n        // [\"S7371\"],\n        // [\"S7372\"],\n        // [\"S7373\"],\n        // [\"S7374\"],\n        // [\"S7375\"],\n        // [\"S7376\"],\n        // [\"S7377\"],\n        // [\"S7378\"],\n        // [\"S7379\"],\n        // [\"S7380\"],\n        // [\"S7381\"],\n        // [\"S7382\"],\n        // [\"S7383\"],\n        // [\"S7384\"],\n        // [\"S7385\"],\n        // [\"S7386\"],\n        // [\"S7387\"],\n        // [\"S7388\"],\n        // [\"S7389\"],\n        // [\"S7390\"],\n        // [\"S7391\"],\n        // [\"S7392\"],\n        // [\"S7393\"],\n        // [\"S7394\"],\n        // [\"S7395\"],\n        // [\"S7396\"],\n        // [\"S7397\"],\n        // [\"S7398\"],\n        // [\"S7399\"],\n        // [\"S7400\"],\n        // [\"S7401\"],\n        // [\"S7402\"],\n        // [\"S7403\"],\n        // [\"S7404\"],\n        // [\"S7405\"],\n        // [\"S7406\"],\n        // [\"S7407\"],\n        // [\"S7408\"],\n        // [\"S7409\"],\n        // [\"S7410\"],\n        // [\"S7411\"],\n        // [\"S7412\"],\n        // [\"S7413\"],\n        // [\"S7414\"],\n        // [\"S7415\"],\n        // [\"S7416\"],\n        // [\"S7417\"],\n        // [\"S7418\"],\n        // [\"S7419\"],\n        // [\"S7420\"],\n        // [\"S7421\"],\n        // [\"S7422\"],\n        // [\"S7423\"],\n        // [\"S7424\"],\n        // [\"S7425\"],\n        // [\"S7426\"],\n        // [\"S7427\"],\n        // [\"S7428\"],\n        // [\"S7429\"],\n        // [\"S7430\"],\n        // [\"S7431\"],\n        // [\"S7432\"],\n        // [\"S7433\"],\n        // [\"S7434\"],\n        // [\"S7435\"],\n        // [\"S7436\"],\n        // [\"S7437\"],\n        // [\"S7438\"],\n        // [\"S7439\"],\n        // [\"S7440\"],\n        // [\"S7441\"],\n        // [\"S7442\"],\n        // [\"S7443\"],\n        // [\"S7444\"],\n        // [\"S7445\"],\n        // [\"S7446\"],\n        // [\"S7447\"],\n        // [\"S7448\"],\n        // [\"S7449\"],\n        // [\"S7450\"],\n        // [\"S7451\"],\n        // [\"S7452\"],\n        // [\"S7453\"],\n        // [\"S7454\"],\n        // [\"S7455\"],\n        // [\"S7456\"],\n        // [\"S7457\"],\n        // [\"S7458\"],\n        // [\"S7459\"],\n        // [\"S7460\"],\n        // [\"S7461\"],\n        // [\"S7462\"],\n        // [\"S7463\"],\n        // [\"S7464\"],\n        // [\"S7465\"],\n        // [\"S7466\"],\n        // [\"S7467\"],\n        // [\"S7468\"],\n        // [\"S7469\"],\n        // [\"S7470\"],\n        // [\"S7471\"],\n        // [\"S7472\"],\n        // [\"S7473\"],\n        // [\"S7474\"],\n        // [\"S7475\"],\n        // [\"S7476\"],\n        // [\"S7477\"],\n        // [\"S7478\"],\n        // [\"S7479\"],\n        // [\"S7480\"],\n        // [\"S7481\"],\n        // [\"S7482\"],\n        // [\"S7483\"],\n        // [\"S7484\"],\n        // [\"S7485\"],\n        // [\"S7486\"],\n        // [\"S7487\"],\n        // [\"S7488\"],\n        // [\"S7489\"],\n        // [\"S7490\"],\n        // [\"S7491\"],\n        // [\"S7492\"],\n        // [\"S7493\"],\n        // [\"S7494\"],\n        // [\"S7495\"],\n        // [\"S7496\"],\n        // [\"S7497\"],\n        // [\"S7498\"],\n        // [\"S7499\"],\n        // [\"S7500\"],\n        // [\"S7501\"],\n        // [\"S7502\"],\n        // [\"S7503\"],\n        // [\"S7504\"],\n        // [\"S7505\"],\n        // [\"S7506\"],\n        // [\"S7507\"],\n        // [\"S7508\"],\n        // [\"S7509\"],\n        // [\"S7510\"],\n        // [\"S7511\"],\n        // [\"S7512\"],\n        // [\"S7513\"],\n        // [\"S7514\"],\n        // [\"S7515\"],\n        // [\"S7516\"],\n        // [\"S7517\"],\n        // [\"S7518\"],\n        // [\"S7519\"],\n        // [\"S7520\"],\n        // [\"S7521\"],\n        // [\"S7522\"],\n        // [\"S7523\"],\n        // [\"S7524\"],\n        // [\"S7525\"],\n        // [\"S7526\"],\n        // [\"S7527\"],\n        // [\"S7528\"],\n        // [\"S7529\"],\n        // [\"S7530\"],\n        // [\"S7531\"],\n        // [\"S7532\"],\n        // [\"S7533\"],\n        // [\"S7534\"],\n        // [\"S7535\"],\n        // [\"S7536\"],\n        // [\"S7537\"],\n        // [\"S7538\"],\n        // [\"S7539\"],\n        // [\"S7540\"],\n        // [\"S7541\"],\n        // [\"S7542\"],\n        // [\"S7543\"],\n        // [\"S7544\"],\n        // [\"S7545\"],\n        // [\"S7546\"],\n        // [\"S7547\"],\n        // [\"S7548\"],\n        // [\"S7549\"],\n        // [\"S7550\"],\n        // [\"S7551\"],\n        // [\"S7552\"],\n        // [\"S7553\"],\n        // [\"S7554\"],\n        // [\"S7555\"],\n        // [\"S7556\"],\n        // [\"S7557\"],\n        // [\"S7558\"],\n        // [\"S7559\"],\n        // [\"S7560\"],\n        // [\"S7561\"],\n        // [\"S7562\"],\n        // [\"S7563\"],\n        // [\"S7564\"],\n        // [\"S7565\"],\n        // [\"S7566\"],\n        // [\"S7567\"],\n        // [\"S7568\"],\n        // [\"S7569\"],\n        // [\"S7570\"],\n        // [\"S7571\"],\n        // [\"S7572\"],\n        // [\"S7573\"],\n        // [\"S7574\"],\n        // [\"S7575\"],\n        // [\"S7576\"],\n        // [\"S7577\"],\n        // [\"S7578\"],\n        // [\"S7579\"],\n        // [\"S7580\"],\n        // [\"S7581\"],\n        // [\"S7582\"],\n        // [\"S7583\"],\n        // [\"S7584\"],\n        // [\"S7585\"],\n        // [\"S7586\"],\n        // [\"S7587\"],\n        // [\"S7588\"],\n        // [\"S7589\"],\n        // [\"S7590\"],\n        // [\"S7591\"],\n        // [\"S7592\"],\n        // [\"S7593\"],\n        // [\"S7594\"],\n        // [\"S7595\"],\n        // [\"S7596\"],\n        // [\"S7597\"],\n        // [\"S7598\"],\n        // [\"S7599\"],\n        // [\"S7600\"],\n        // [\"S7601\"],\n        // [\"S7602\"],\n        // [\"S7603\"],\n        // [\"S7604\"],\n        // [\"S7605\"],\n        // [\"S7606\"],\n        // [\"S7607\"],\n        // [\"S7608\"],\n        // [\"S7609\"],\n        // [\"S7610\"],\n        // [\"S7611\"],\n        // [\"S7612\"],\n        // [\"S7613\"],\n        // [\"S7614\"],\n        // [\"S7615\"],\n        // [\"S7616\"],\n        // [\"S7617\"],\n        // [\"S7618\"],\n        // [\"S7619\"],\n        // [\"S7620\"],\n        // [\"S7621\"],\n        // [\"S7622\"],\n        // [\"S7623\"],\n        // [\"S7624\"],\n        // [\"S7625\"],\n        // [\"S7626\"],\n        // [\"S7627\"],\n        // [\"S7628\"],\n        // [\"S7629\"],\n        // [\"S7630\"],\n        // [\"S7631\"],\n        // [\"S7632\"],\n        // [\"S7633\"],\n        // [\"S7634\"],\n        // [\"S7635\"],\n        // [\"S7636\"],\n        // [\"S7637\"],\n        // [\"S7638\"],\n        // [\"S7639\"],\n        // [\"S7640\"],\n        // [\"S7641\"],\n        // [\"S7642\"],\n        // [\"S7643\"],\n        // [\"S7644\"],\n        // [\"S7645\"],\n        // [\"S7646\"],\n        // [\"S7647\"],\n        // [\"S7648\"],\n        // [\"S7649\"],\n        // [\"S7650\"],\n        // [\"S7651\"],\n        // [\"S7652\"],\n        // [\"S7653\"],\n        // [\"S7654\"],\n        // [\"S7655\"],\n        // [\"S7656\"],\n        // [\"S7657\"],\n        // [\"S7658\"],\n        // [\"S7659\"],\n        // [\"S7660\"],\n        // [\"S7661\"],\n        // [\"S7662\"],\n        // [\"S7663\"],\n        // [\"S7664\"],\n        // [\"S7665\"],\n        // [\"S7666\"],\n        // [\"S7667\"],\n        // [\"S7668\"],\n        // [\"S7669\"],\n        // [\"S7670\"],\n        // [\"S7671\"],\n        // [\"S7672\"],\n        // [\"S7673\"],\n        // [\"S7674\"],\n        // [\"S7675\"],\n        // [\"S7676\"],\n        // [\"S7677\"],\n        // [\"S7678\"],\n        // [\"S7679\"],\n        // [\"S7680\"],\n        // [\"S7681\"],\n        // [\"S7682\"],\n        // [\"S7683\"],\n        // [\"S7684\"],\n        // [\"S7685\"],\n        // [\"S7686\"],\n        // [\"S7687\"],\n        // [\"S7688\"],\n        // [\"S7689\"],\n        // [\"S7690\"],\n        // [\"S7691\"],\n        // [\"S7692\"],\n        // [\"S7693\"],\n        // [\"S7694\"],\n        // [\"S7695\"],\n        // [\"S7696\"],\n        // [\"S7697\"],\n        // [\"S7698\"],\n        // [\"S7699\"],\n        // [\"S7700\"],\n        // [\"S7701\"],\n        // [\"S7702\"],\n        // [\"S7703\"],\n        // [\"S7704\"],\n        // [\"S7705\"],\n        // [\"S7706\"],\n        // [\"S7707\"],\n        // [\"S7708\"],\n        // [\"S7709\"],\n        // [\"S7710\"],\n        // [\"S7711\"],\n        // [\"S7712\"],\n        // [\"S7713\"],\n        // [\"S7714\"],\n        // [\"S7715\"],\n        // [\"S7716\"],\n        // [\"S7717\"],\n        // [\"S7718\"],\n        // [\"S7719\"],\n        // [\"S7720\"],\n        // [\"S7721\"],\n        // [\"S7722\"],\n        // [\"S7723\"],\n        // [\"S7724\"],\n        // [\"S7725\"],\n        // [\"S7726\"],\n        // [\"S7727\"],\n        // [\"S7728\"],\n        // [\"S7729\"],\n        // [\"S7730\"],\n        // [\"S7731\"],\n        // [\"S7732\"],\n        // [\"S7733\"],\n        // [\"S7734\"],\n        // [\"S7735\"],\n        // [\"S7736\"],\n        // [\"S7737\"],\n        // [\"S7738\"],\n        // [\"S7739\"],\n        // [\"S7740\"],\n        // [\"S7741\"],\n        // [\"S7742\"],\n        // [\"S7743\"],\n        // [\"S7744\"],\n        // [\"S7745\"],\n        // [\"S7746\"],\n        // [\"S7747\"],\n        // [\"S7748\"],\n        // [\"S7749\"],\n        // [\"S7750\"],\n        // [\"S7751\"],\n        // [\"S7752\"],\n        // [\"S7753\"],\n        // [\"S7754\"],\n        // [\"S7755\"],\n        // [\"S7756\"],\n        // [\"S7757\"],\n        // [\"S7758\"],\n        // [\"S7759\"],\n        // [\"S7760\"],\n        // [\"S7761\"],\n        // [\"S7762\"],\n        // [\"S7763\"],\n        // [\"S7764\"],\n        // [\"S7765\"],\n        // [\"S7766\"],\n        // [\"S7767\"],\n        // [\"S7768\"],\n        // [\"S7769\"],\n        // [\"S7770\"],\n        // [\"S7771\"],\n        // [\"S7772\"],\n        // [\"S7773\"],\n        // [\"S7774\"],\n        // [\"S7775\"],\n        // [\"S7776\"],\n        // [\"S7777\"],\n        // [\"S7778\"],\n        // [\"S7779\"],\n        // [\"S7780\"],\n        // [\"S7781\"],\n        // [\"S7782\"],\n        // [\"S7783\"],\n        // [\"S7784\"],\n        // [\"S7785\"],\n        // [\"S7786\"],\n        // [\"S7787\"],\n        // [\"S7788\"],\n        // [\"S7789\"],\n        // [\"S7790\"],\n        // [\"S7791\"],\n        // [\"S7792\"],\n        // [\"S7793\"],\n        // [\"S7794\"],\n        // [\"S7795\"],\n        // [\"S7796\"],\n        // [\"S7797\"],\n        // [\"S7798\"],\n        // [\"S7799\"],\n        // [\"S7800\"],\n        // [\"S7801\"],\n        // [\"S7802\"],\n        // [\"S7803\"],\n        // [\"S7804\"],\n        // [\"S7805\"],\n        // [\"S7806\"],\n        // [\"S7807\"],\n        // [\"S7808\"],\n        // [\"S7809\"],\n        // [\"S7810\"],\n        // [\"S7811\"],\n        // [\"S7812\"],\n        // [\"S7813\"],\n        // [\"S7814\"],\n        // [\"S7815\"],\n        // [\"S7816\"],\n        // [\"S7817\"],\n        // [\"S7818\"],\n        // [\"S7819\"],\n        // [\"S7820\"],\n        // [\"S7821\"],\n        // [\"S7822\"],\n        // [\"S7823\"],\n        // [\"S7824\"],\n        // [\"S7825\"],\n        // [\"S7826\"],\n        // [\"S7827\"],\n        // [\"S7828\"],\n        // [\"S7829\"],\n        // [\"S7830\"],\n        // [\"S7831\"],\n        // [\"S7832\"],\n        // [\"S7833\"],\n        // [\"S7834\"],\n        // [\"S7835\"],\n        // [\"S7836\"],\n        // [\"S7837\"],\n        // [\"S7838\"],\n        // [\"S7839\"],\n        // [\"S7840\"],\n        // [\"S7841\"],\n        // [\"S7842\"],\n        // [\"S7843\"],\n        // [\"S7844\"],\n        // [\"S7845\"],\n        // [\"S7846\"],\n        // [\"S7847\"],\n        // [\"S7848\"],\n        // [\"S7849\"],\n        // [\"S7850\"],\n        // [\"S7851\"],\n        // [\"S7852\"],\n        // [\"S7853\"],\n        // [\"S7854\"],\n        // [\"S7855\"],\n        // [\"S7856\"],\n        // [\"S7857\"],\n        // [\"S7858\"],\n        // [\"S7859\"],\n        // [\"S7860\"],\n        // [\"S7861\"],\n        // [\"S7862\"],\n        // [\"S7863\"],\n        // [\"S7864\"],\n        // [\"S7865\"],\n        // [\"S7866\"],\n        // [\"S7867\"],\n        // [\"S7868\"],\n        // [\"S7869\"],\n        // [\"S7870\"],\n        // [\"S7871\"],\n        // [\"S7872\"],\n        // [\"S7873\"],\n        // [\"S7874\"],\n        // [\"S7875\"],\n        // [\"S7876\"],\n        // [\"S7877\"],\n        // [\"S7878\"],\n        // [\"S7879\"],\n        // [\"S7880\"],\n        // [\"S7881\"],\n        // [\"S7882\"],\n        // [\"S7883\"],\n        // [\"S7884\"],\n        // [\"S7885\"],\n        // [\"S7886\"],\n        // [\"S7887\"],\n        // [\"S7888\"],\n        // [\"S7889\"],\n        // [\"S7890\"],\n        // [\"S7891\"],\n        // [\"S7892\"],\n        // [\"S7893\"],\n        // [\"S7894\"],\n        // [\"S7895\"],\n        // [\"S7896\"],\n        // [\"S7897\"],\n        // [\"S7898\"],\n        // [\"S7899\"],\n        // [\"S7900\"],\n        // [\"S7901\"],\n        // [\"S7902\"],\n        // [\"S7903\"],\n        // [\"S7904\"],\n        // [\"S7905\"],\n        // [\"S7906\"],\n        // [\"S7907\"],\n        // [\"S7908\"],\n        // [\"S7909\"],\n        // [\"S7910\"],\n        // [\"S7911\"],\n        // [\"S7912\"],\n        // [\"S7913\"],\n        // [\"S7914\"],\n        // [\"S7915\"],\n        // [\"S7916\"],\n        // [\"S7917\"],\n        // [\"S7918\"],\n        // [\"S7919\"],\n        // [\"S7920\"],\n        // [\"S7921\"],\n        // [\"S7922\"],\n        // [\"S7923\"],\n        // [\"S7924\"],\n        // [\"S7925\"],\n        // [\"S7926\"],\n        // [\"S7927\"],\n        // [\"S7928\"],\n        // [\"S7929\"],\n        // [\"S7930\"],\n        // [\"S7931\"],\n        // [\"S7932\"],\n        // [\"S7933\"],\n        // [\"S7934\"],\n        // [\"S7935\"],\n        // [\"S7936\"],\n        // [\"S7937\"],\n        // [\"S7938\"],\n        // [\"S7939\"],\n        // [\"S7940\"],\n        // [\"S7941\"],\n        // [\"S7942\"],\n        // [\"S7943\"],\n        // [\"S7944\"],\n        // [\"S7945\"],\n        // [\"S7946\"],\n        // [\"S7947\"],\n        // [\"S7948\"],\n        // [\"S7949\"],\n        // [\"S7950\"],\n        // [\"S7951\"],\n        // [\"S7952\"],\n        // [\"S7953\"],\n        // [\"S7954\"],\n        // [\"S7955\"],\n        // [\"S7956\"],\n        // [\"S7957\"],\n        // [\"S7958\"],\n        // [\"S7959\"],\n        // [\"S7960\"],\n        // [\"S7961\"],\n        // [\"S7962\"],\n        // [\"S7963\"],\n        // [\"S7964\"],\n        // [\"S7965\"],\n        // [\"S7966\"],\n        // [\"S7967\"],\n        // [\"S7968\"],\n        // [\"S7969\"],\n        // [\"S7970\"],\n        // [\"S7971\"],\n        // [\"S7972\"],\n        // [\"S7973\"],\n        // [\"S7974\"],\n        // [\"S7975\"],\n        // [\"S7976\"],\n        // [\"S7977\"],\n        // [\"S7978\"],\n        // [\"S7979\"],\n        // [\"S7980\"],\n        // [\"S7981\"],\n        // [\"S7982\"],\n        // [\"S7983\"],\n        // [\"S7984\"],\n        // [\"S7985\"],\n        // [\"S7986\"],\n        // [\"S7987\"],\n        // [\"S7988\"],\n        // [\"S7989\"],\n        // [\"S7990\"],\n        // [\"S7991\"],\n        // [\"S7992\"],\n        // [\"S7993\"],\n        // [\"S7994\"],\n        // [\"S7995\"],\n        // [\"S7996\"],\n        // [\"S7997\"],\n        // [\"S7998\"],\n        // [\"S7999\"],\n        // [\"S8000\"],\n        // [\"S8001\"],\n        // [\"S8002\"],\n        // [\"S8003\"],\n        // [\"S8004\"],\n        // [\"S8005\"],\n        // [\"S8006\"],\n        // [\"S8007\"],\n        // [\"S8008\"],\n        // [\"S8009\"],\n        // [\"S8010\"],\n        // [\"S8011\"],\n        // [\"S8012\"],\n        // [\"S8013\"],\n        // [\"S8014\"],\n        // [\"S8015\"],\n        // [\"S8016\"],\n        // [\"S8017\"],\n        // [\"S8018\"],\n        // [\"S8019\"],\n        // [\"S8020\"],\n        // [\"S8021\"],\n        // [\"S8022\"],\n        // [\"S8023\"],\n        // [\"S8024\"],\n        // [\"S8025\"],\n        // [\"S8026\"],\n        // [\"S8027\"],\n        // [\"S8028\"],\n        // [\"S8029\"],\n        // [\"S8030\"],\n        // [\"S8031\"],\n        // [\"S8032\"],\n        // [\"S8033\"],\n        // [\"S8034\"],\n        // [\"S8035\"],\n        // [\"S8036\"],\n        // [\"S8037\"],\n        // [\"S8038\"],\n        // [\"S8039\"],\n        // [\"S8040\"],\n        // [\"S8041\"],\n        // [\"S8042\"],\n        // [\"S8043\"],\n        // [\"S8044\"],\n        // [\"S8045\"],\n        // [\"S8046\"],\n        // [\"S8047\"],\n        // [\"S8048\"],\n        // [\"S8049\"],\n        // [\"S8050\"],\n        // [\"S8051\"],\n        // [\"S8052\"],\n        // [\"S8053\"],\n        // [\"S8054\"],\n        // [\"S8055\"],\n        // [\"S8056\"],\n        // [\"S8057\"],\n        // [\"S8058\"],\n        // [\"S8059\"],\n        // [\"S8060\"],\n        // [\"S8061\"],\n        // [\"S8062\"],\n        // [\"S8063\"],\n        // [\"S8064\"],\n        // [\"S8065\"],\n        // [\"S8066\"],\n        // [\"S8067\"],\n        // [\"S8068\"],\n        // [\"S8069\"],\n        // [\"S8070\"],\n        // [\"S8071\"],\n        // [\"S8072\"],\n        // [\"S8073\"],\n        // [\"S8074\"],\n        // [\"S8075\"],\n        // [\"S8076\"],\n        // [\"S8077\"],\n        // [\"S8078\"],\n        // [\"S8079\"],\n        // [\"S8080\"],\n        // [\"S8081\"],\n        // [\"S8082\"],\n        // [\"S8083\"],\n        // [\"S8084\"],\n        // [\"S8085\"],\n        // [\"S8086\"],\n        // [\"S8087\"],\n        // [\"S8088\"],\n        // [\"S8089\"],\n        // [\"S8090\"],\n        // [\"S8091\"],\n        // [\"S8092\"],\n        // [\"S8093\"],\n        // [\"S8094\"],\n        // [\"S8095\"],\n        // [\"S8096\"],\n        // [\"S8097\"],\n        // [\"S8098\"],\n        // [\"S8099\"],\n        // [\"S8100\"],\n        // [\"S8101\"],\n        // [\"S8102\"],\n        // [\"S8103\"],\n        // [\"S8104\"],\n        // [\"S8105\"],\n        // [\"S8106\"],\n        // [\"S8107\"],\n        // [\"S8108\"],\n        // [\"S8109\"],\n        // [\"S8110\"],\n        // [\"S8111\"],\n        // [\"S8112\"],\n        // [\"S8113\"],\n        // [\"S8114\"],\n        // [\"S8115\"],\n        // [\"S8116\"],\n        // [\"S8117\"],\n        // [\"S8118\"],\n        // [\"S8119\"],\n        // [\"S8120\"],\n        // [\"S8121\"],\n        // [\"S8122\"],\n        // [\"S8123\"],\n        // [\"S8124\"],\n        // [\"S8125\"],\n        // [\"S8126\"],\n        // [\"S8127\"],\n        // [\"S8128\"],\n        // [\"S8129\"],\n        // [\"S8130\"],\n        // [\"S8131\"],\n        // [\"S8132\"],\n        // [\"S8133\"],\n        // [\"S8134\"],\n        // [\"S8135\"],\n        // [\"S8136\"],\n        // [\"S8137\"],\n        // [\"S8138\"],\n        // [\"S8139\"],\n        // [\"S8140\"],\n        // [\"S8141\"],\n        // [\"S8142\"],\n        // [\"S8143\"],\n        // [\"S8144\"],\n        // [\"S8145\"],\n        // [\"S8146\"],\n        // [\"S8147\"],\n        // [\"S8148\"],\n        // [\"S8149\"],\n        // [\"S8150\"],\n        // [\"S8151\"],\n        // [\"S8152\"],\n        // [\"S8153\"],\n        // [\"S8154\"],\n        // [\"S8155\"],\n        // [\"S8156\"],\n        // [\"S8157\"],\n        // [\"S8158\"],\n        // [\"S8159\"],\n        // [\"S8160\"],\n        // [\"S8161\"],\n        // [\"S8162\"],\n        // [\"S8163\"],\n        // [\"S8164\"],\n        // [\"S8165\"],\n        // [\"S8166\"],\n        // [\"S8167\"],\n        // [\"S8168\"],\n        // [\"S8169\"],\n        // [\"S8170\"],\n        // [\"S8171\"],\n        // [\"S8172\"],\n        // [\"S8173\"],\n        // [\"S8174\"],\n        // [\"S8175\"],\n        // [\"S8176\"],\n        // [\"S8177\"],\n        // [\"S8178\"],\n        // [\"S8179\"],\n        // [\"S8180\"],\n        // [\"S8181\"],\n        // [\"S8182\"],\n        // [\"S8183\"],\n        // [\"S8184\"],\n        // [\"S8185\"],\n        // [\"S8186\"],\n        // [\"S8187\"],\n        // [\"S8188\"],\n        // [\"S8189\"],\n        // [\"S8190\"],\n        // [\"S8191\"],\n        // [\"S8192\"],\n        // [\"S8193\"],\n        // [\"S8194\"],\n        // [\"S8195\"],\n        // [\"S8196\"],\n        // [\"S8197\"],\n        // [\"S8198\"],\n        // [\"S8199\"],\n        // [\"S8200\"],\n        // [\"S8201\"],\n        // [\"S8202\"],\n        // [\"S8203\"],\n        // [\"S8204\"],\n        // [\"S8205\"],\n        // [\"S8206\"],\n        // [\"S8207\"],\n        // [\"S8208\"],\n        // [\"S8209\"],\n        // [\"S8210\"],\n        // [\"S8211\"],\n        // [\"S8212\"],\n        // [\"S8213\"],\n        // [\"S8214\"],\n        // [\"S8215\"],\n        // [\"S8216\"],\n        // [\"S8217\"],\n        // [\"S8218\"],\n        // [\"S8219\"],\n        // [\"S8220\"],\n        // [\"S8221\"],\n        // [\"S8222\"],\n        // [\"S8223\"],\n        // [\"S8224\"],\n        // [\"S8225\"],\n        // [\"S8226\"],\n        // [\"S8227\"],\n        // [\"S8228\"],\n        // [\"S8229\"],\n        // [\"S8230\"],\n        // [\"S8231\"],\n        // [\"S8232\"],\n        // [\"S8233\"],\n        // [\"S8234\"],\n        // [\"S8235\"],\n        // [\"S8236\"],\n        // [\"S8237\"],\n        // [\"S8238\"],\n        // [\"S8239\"],\n        // [\"S8240\"],\n        // [\"S8241\"],\n        // [\"S8242\"],\n        // [\"S8243\"],\n        // [\"S8244\"],\n        // [\"S8245\"],\n        // [\"S8246\"],\n        // [\"S8247\"],\n        // [\"S8248\"],\n        // [\"S8249\"],\n        // [\"S8250\"],\n        // [\"S8251\"],\n        // [\"S8252\"],\n        // [\"S8253\"],\n        // [\"S8254\"],\n        // [\"S8255\"],\n        // [\"S8256\"],\n        // [\"S8257\"],\n        // [\"S8258\"],\n        // [\"S8259\"],\n        // [\"S8260\"],\n        // [\"S8261\"],\n        // [\"S8262\"],\n        // [\"S8263\"],\n        // [\"S8264\"],\n        // [\"S8265\"],\n        // [\"S8266\"],\n        // [\"S8267\"],\n        // [\"S8268\"],\n        // [\"S8269\"],\n        // [\"S8270\"],\n        // [\"S8271\"],\n        // [\"S8272\"],\n        // [\"S8273\"],\n        // [\"S8274\"],\n        // [\"S8275\"],\n        // [\"S8276\"],\n        // [\"S8277\"],\n        // [\"S8278\"],\n        // [\"S8279\"],\n        // [\"S8280\"],\n        // [\"S8281\"],\n        // [\"S8282\"],\n        // [\"S8283\"],\n        // [\"S8284\"],\n        // [\"S8285\"],\n        // [\"S8286\"],\n        // [\"S8287\"],\n        // [\"S8288\"],\n        // [\"S8289\"],\n        // [\"S8290\"],\n        // [\"S8291\"],\n        // [\"S8292\"],\n        // [\"S8293\"],\n        // [\"S8294\"],\n        // [\"S8295\"],\n        // [\"S8296\"],\n        // [\"S8297\"],\n        // [\"S8298\"],\n        // [\"S8299\"],\n        // [\"S8300\"],\n        // [\"S8301\"],\n        // [\"S8302\"],\n        // [\"S8303\"],\n        // [\"S8304\"],\n        // [\"S8305\"],\n        // [\"S8306\"],\n        // [\"S8307\"],\n        // [\"S8308\"],\n        // [\"S8309\"],\n        // [\"S8310\"],\n        // [\"S8311\"],\n        // [\"S8312\"],\n        // [\"S8313\"],\n        // [\"S8314\"],\n        // [\"S8315\"],\n        // [\"S8316\"],\n        // [\"S8317\"],\n        // [\"S8318\"],\n        // [\"S8319\"],\n        // [\"S8320\"],\n        // [\"S8321\"],\n        // [\"S8322\"],\n        // [\"S8323\"],\n        // [\"S8324\"],\n        // [\"S8325\"],\n        // [\"S8326\"],\n        // [\"S8327\"],\n        // [\"S8328\"],\n        // [\"S8329\"],\n        // [\"S8330\"],\n        // [\"S8331\"],\n        // [\"S8332\"],\n        // [\"S8333\"],\n        // [\"S8334\"],\n        // [\"S8335\"],\n        // [\"S8336\"],\n        // [\"S8337\"],\n        // [\"S8338\"],\n        // [\"S8339\"],\n        // [\"S8340\"],\n        // [\"S8341\"],\n        // [\"S8342\"],\n        // [\"S8343\"],\n        // [\"S8344\"],\n        // [\"S8345\"],\n        // [\"S8346\"],\n        // [\"S8347\"],\n        // [\"S8348\"],\n        // [\"S8349\"],\n        // [\"S8350\"],\n        // [\"S8351\"],\n        // [\"S8352\"],\n        // [\"S8353\"],\n        // [\"S8354\"],\n        // [\"S8355\"],\n        // [\"S8356\"],\n        // [\"S8357\"],\n        // [\"S8358\"],\n        // [\"S8359\"],\n        // [\"S8360\"],\n        // [\"S8361\"],\n        // [\"S8362\"],\n        // [\"S8363\"],\n        // [\"S8364\"],\n        // [\"S8365\"],\n        // [\"S8366\"],\n        // [\"S8367\"],\n        // [\"S8368\"],\n        // [\"S8369\"],\n        // [\"S8370\"],\n        // [\"S8371\"],\n        // [\"S8372\"],\n        // [\"S8373\"],\n        // [\"S8374\"],\n        // [\"S8375\"],\n        // [\"S8376\"],\n        // [\"S8377\"],\n        // [\"S8378\"],\n        // [\"S8379\"],\n        // [\"S8380\"],\n        // [\"S8381\"],\n        // [\"S8382\"],\n        // [\"S8383\"],\n        // [\"S8384\"],\n        // [\"S8385\"],\n        // [\"S8386\"],\n        // [\"S8387\"],\n        // [\"S8388\"],\n        // [\"S8389\"],\n        // [\"S8390\"],\n        // [\"S8391\"],\n        // [\"S8392\"],\n        // [\"S8393\"],\n        // [\"S8394\"],\n        // [\"S8395\"],\n        // [\"S8396\"],\n        // [\"S8397\"],\n        // [\"S8398\"],\n        // [\"S8399\"],\n        // [\"S8400\"],\n        // [\"S8401\"],\n        // [\"S8402\"],\n        // [\"S8403\"],\n        // [\"S8404\"],\n        // [\"S8405\"],\n        // [\"S8406\"],\n        // [\"S8407\"],\n        // [\"S8408\"],\n        // [\"S8409\"],\n        // [\"S8410\"],\n        // [\"S8411\"],\n        // [\"S8412\"],\n        // [\"S8413\"],\n        // [\"S8414\"],\n        // [\"S8415\"],\n        // [\"S8416\"],\n        // [\"S8417\"],\n        // [\"S8418\"],\n        // [\"S8419\"],\n        // [\"S8420\"],\n        // [\"S8421\"],\n        // [\"S8422\"],\n        // [\"S8423\"],\n        // [\"S8424\"],\n        // [\"S8425\"],\n        // [\"S8426\"],\n        // [\"S8427\"],\n        // [\"S8428\"],\n        // [\"S8429\"],\n        // [\"S8430\"],\n        // [\"S8431\"],\n        // [\"S8432\"],\n        // [\"S8433\"],\n        // [\"S8434\"],\n        // [\"S8435\"],\n        // [\"S8436\"],\n        // [\"S8437\"],\n        // [\"S8438\"],\n        // [\"S8439\"],\n        // [\"S8440\"],\n        // [\"S8441\"],\n        // [\"S8442\"],\n        // [\"S8443\"],\n        // [\"S8444\"],\n        // [\"S8445\"],\n        // [\"S8446\"],\n        // [\"S8447\"],\n        // [\"S8448\"],\n        // [\"S8449\"],\n        // [\"S8450\"],\n        // [\"S8451\"],\n        // [\"S8452\"],\n        // [\"S8453\"],\n        // [\"S8454\"],\n        // [\"S8455\"],\n        // [\"S8456\"],\n        // [\"S8457\"],\n        // [\"S8458\"],\n        // [\"S8459\"],\n        // [\"S8460\"],\n        // [\"S8461\"],\n        // [\"S8462\"],\n        // [\"S8463\"],\n        // [\"S8464\"],\n        // [\"S8465\"],\n        // [\"S8466\"],\n        // [\"S8467\"],\n        // [\"S8468\"],\n        // [\"S8469\"],\n        // [\"S8470\"],\n        // [\"S8471\"],\n        // [\"S8472\"],\n        // [\"S8473\"],\n        // [\"S8474\"],\n        // [\"S8475\"],\n        // [\"S8476\"],\n        // [\"S8477\"],\n        // [\"S8478\"],\n        // [\"S8479\"],\n        // [\"S8480\"],\n        // [\"S8481\"],\n        // [\"S8482\"],\n        // [\"S8483\"],\n        // [\"S8484\"],\n        // [\"S8485\"],\n        // [\"S8486\"],\n        // [\"S8487\"],\n        // [\"S8488\"],\n        // [\"S8489\"],\n        // [\"S8490\"],\n        // [\"S8491\"],\n        // [\"S8492\"],\n        // [\"S8493\"],\n        // [\"S8494\"],\n        // [\"S8495\"],\n        // [\"S8496\"],\n        // [\"S8497\"],\n        // [\"S8498\"],\n        // [\"S8499\"],\n        // [\"S8500\"],\n        // [\"S8501\"],\n        // [\"S8502\"],\n        // [\"S8503\"],\n        // [\"S8504\"],\n        // [\"S8505\"],\n        // [\"S8506\"],\n        // [\"S8507\"],\n        // [\"S8508\"],\n        // [\"S8509\"],\n        // [\"S8510\"],\n        // [\"S8511\"],\n        // [\"S8512\"],\n        // [\"S8513\"],\n        // [\"S8514\"],\n        // [\"S8515\"],\n        // [\"S8516\"],\n        // [\"S8517\"],\n        // [\"S8518\"],\n        // [\"S8519\"],\n        // [\"S8520\"],\n        // [\"S8521\"],\n        // [\"S8522\"],\n        // [\"S8523\"],\n        // [\"S8524\"],\n        // [\"S8525\"],\n        // [\"S8526\"],\n        // [\"S8527\"],\n        // [\"S8528\"],\n        // [\"S8529\"],\n        // [\"S8530\"],\n        // [\"S8531\"],\n        // [\"S8532\"],\n        // [\"S8533\"],\n        // [\"S8534\"],\n        // [\"S8535\"],\n        // [\"S8536\"],\n        // [\"S8537\"],\n        // [\"S8538\"],\n        // [\"S8539\"],\n        // [\"S8540\"],\n        // [\"S8541\"],\n        // [\"S8542\"],\n        // [\"S8543\"],\n        // [\"S8544\"],\n        // [\"S8545\"],\n        // [\"S8546\"],\n        // [\"S8547\"],\n        // [\"S8548\"],\n        // [\"S8549\"],\n        // [\"S8550\"],\n        // [\"S8551\"],\n        // [\"S8552\"],\n        // [\"S8553\"],\n        // [\"S8554\"],\n        // [\"S8555\"],\n        // [\"S8556\"],\n        // [\"S8557\"],\n        // [\"S8558\"],\n        // [\"S8559\"],\n        // [\"S8560\"],\n        // [\"S8561\"],\n        // [\"S8562\"],\n        // [\"S8563\"],\n        // [\"S8564\"],\n        // [\"S8565\"],\n        // [\"S8566\"],\n        // [\"S8567\"],\n        // [\"S8568\"],\n        // [\"S8569\"],\n        // [\"S8570\"],\n        // [\"S8571\"],\n        // [\"S8572\"],\n        // [\"S8573\"],\n        // [\"S8574\"],\n        // [\"S8575\"],\n        // [\"S8576\"],\n        // [\"S8577\"],\n        // [\"S8578\"],\n        // [\"S8579\"],\n        // [\"S8580\"],\n        // [\"S8581\"],\n        // [\"S8582\"],\n        // [\"S8583\"],\n        // [\"S8584\"],\n        // [\"S8585\"],\n        // [\"S8586\"],\n        // [\"S8587\"],\n        // [\"S8588\"],\n        // [\"S8589\"],\n        // [\"S8590\"],\n        // [\"S8591\"],\n        // [\"S8592\"],\n        // [\"S8593\"],\n        // [\"S8594\"],\n        // [\"S8595\"],\n        // [\"S8596\"],\n        // [\"S8597\"],\n        // [\"S8598\"],\n        // [\"S8599\"],\n        // [\"S8600\"],\n        // [\"S8601\"],\n        // [\"S8602\"],\n        // [\"S8603\"],\n        // [\"S8604\"],\n        // [\"S8605\"],\n        // [\"S8606\"],\n        // [\"S8607\"],\n        // [\"S8608\"],\n        // [\"S8609\"],\n        // [\"S8610\"],\n        // [\"S8611\"],\n        // [\"S8612\"],\n        // [\"S8613\"],\n        // [\"S8614\"],\n        // [\"S8615\"],\n        // [\"S8616\"],\n        // [\"S8617\"],\n        // [\"S8618\"],\n        // [\"S8619\"],\n        // [\"S8620\"],\n        // [\"S8621\"],\n        // [\"S8622\"],\n        // [\"S8623\"],\n        // [\"S8624\"],\n        // [\"S8625\"],\n        // [\"S8626\"],\n        // [\"S8627\"],\n        // [\"S8628\"],\n        // [\"S8629\"],\n        // [\"S8630\"],\n        // [\"S8631\"],\n        // [\"S8632\"],\n        // [\"S8633\"],\n        // [\"S8634\"],\n        // [\"S8635\"],\n        // [\"S8636\"],\n        // [\"S8637\"],\n        // [\"S8638\"],\n        // [\"S8639\"],\n        // [\"S8640\"],\n        // [\"S8641\"],\n        // [\"S8642\"],\n        // [\"S8643\"],\n        // [\"S8644\"],\n        // [\"S8645\"],\n        // [\"S8646\"],\n        // [\"S8647\"],\n        // [\"S8648\"],\n        // [\"S8649\"],\n        // [\"S8650\"],\n        // [\"S8651\"],\n        // [\"S8652\"],\n        // [\"S8653\"],\n        // [\"S8654\"],\n        // [\"S8655\"],\n        // [\"S8656\"],\n        // [\"S8657\"],\n        // [\"S8658\"],\n        // [\"S8659\"],\n        // [\"S8660\"],\n        // [\"S8661\"],\n        // [\"S8662\"],\n        // [\"S8663\"],\n        // [\"S8664\"],\n        // [\"S8665\"],\n        // [\"S8666\"],\n        // [\"S8667\"],\n        // [\"S8668\"],\n        // [\"S8669\"],\n        // [\"S8670\"],\n        // [\"S8671\"],\n        // [\"S8672\"],\n        // [\"S8673\"],\n        // [\"S8674\"],\n        // [\"S8675\"],\n        // [\"S8676\"],\n        // [\"S8677\"],\n        // [\"S8678\"],\n        // [\"S8679\"],\n        // [\"S8680\"],\n        // [\"S8681\"],\n        // [\"S8682\"],\n        // [\"S8683\"],\n        // [\"S8684\"],\n        // [\"S8685\"],\n        // [\"S8686\"],\n        // [\"S8687\"],\n        // [\"S8688\"],\n        // [\"S8689\"],\n        // [\"S8690\"],\n        // [\"S8691\"],\n        // [\"S8692\"],\n        // [\"S8693\"],\n        // [\"S8694\"],\n        // [\"S8695\"],\n        // [\"S8696\"],\n        // [\"S8697\"],\n        // [\"S8698\"],\n        // [\"S8699\"],\n        // [\"S8700\"],\n        // [\"S8701\"],\n        // [\"S8702\"],\n        // [\"S8703\"],\n        // [\"S8704\"],\n        // [\"S8705\"],\n        // [\"S8706\"],\n        // [\"S8707\"],\n        // [\"S8708\"],\n        // [\"S8709\"],\n        // [\"S8710\"],\n        // [\"S8711\"],\n        // [\"S8712\"],\n        // [\"S8713\"],\n        // [\"S8714\"],\n        // [\"S8715\"],\n        // [\"S8716\"],\n        // [\"S8717\"],\n        // [\"S8718\"],\n        // [\"S8719\"],\n        // [\"S8720\"],\n        // [\"S8721\"],\n        // [\"S8722\"],\n        // [\"S8723\"],\n        // [\"S8724\"],\n        // [\"S8725\"],\n        // [\"S8726\"],\n        // [\"S8727\"],\n        // [\"S8728\"],\n        // [\"S8729\"],\n        // [\"S8730\"],\n        // [\"S8731\"],\n        // [\"S8732\"],\n        // [\"S8733\"],\n        // [\"S8734\"],\n        // [\"S8735\"],\n        // [\"S8736\"],\n        // [\"S8737\"],\n        // [\"S8738\"],\n        // [\"S8739\"],\n        // [\"S8740\"],\n        // [\"S8741\"],\n        // [\"S8742\"],\n        // [\"S8743\"],\n        // [\"S8744\"],\n        // [\"S8745\"],\n        // [\"S8746\"],\n        // [\"S8747\"],\n        // [\"S8748\"],\n        // [\"S8749\"],\n        // [\"S8750\"],\n        // [\"S8751\"],\n        // [\"S8752\"],\n        // [\"S8753\"],\n        // [\"S8754\"],\n        // [\"S8755\"],\n        // [\"S8756\"],\n        // [\"S8757\"],\n        // [\"S8758\"],\n        // [\"S8759\"],\n        // [\"S8760\"],\n        // [\"S8761\"],\n        // [\"S8762\"],\n        // [\"S8763\"],\n        // [\"S8764\"],\n        // [\"S8765\"],\n        // [\"S8766\"],\n        // [\"S8767\"],\n        // [\"S8768\"],\n        // [\"S8769\"],\n        // [\"S8770\"],\n        // [\"S8771\"],\n        // [\"S8772\"],\n        // [\"S8773\"],\n        // [\"S8774\"],\n        // [\"S8775\"],\n        // [\"S8776\"],\n        // [\"S8777\"],\n        // [\"S8778\"],\n        // [\"S8779\"],\n        // [\"S8780\"],\n        // [\"S8781\"],\n        // [\"S8782\"],\n        // [\"S8783\"],\n        // [\"S8784\"],\n        // [\"S8785\"],\n        // [\"S8786\"],\n        // [\"S8787\"],\n        // [\"S8788\"],\n        // [\"S8789\"],\n        // [\"S8790\"],\n        // [\"S8791\"],\n        // [\"S8792\"],\n        // [\"S8793\"],\n        // [\"S8794\"],\n        // [\"S8795\"],\n        // [\"S8796\"],\n        // [\"S8797\"],\n        // [\"S8798\"],\n        // [\"S8799\"],\n        // [\"S8800\"],\n        // [\"S8801\"],\n        // [\"S8802\"],\n        // [\"S8803\"],\n        // [\"S8804\"],\n        // [\"S8805\"],\n        // [\"S8806\"],\n        // [\"S8807\"],\n        // [\"S8808\"],\n        // [\"S8809\"],\n        // [\"S8810\"],\n        // [\"S8811\"],\n        // [\"S8812\"],\n        // [\"S8813\"],\n        // [\"S8814\"],\n        // [\"S8815\"],\n        // [\"S8816\"],\n        // [\"S8817\"],\n        // [\"S8818\"],\n        // [\"S8819\"],\n        // [\"S8820\"],\n        // [\"S8821\"],\n        // [\"S8822\"],\n        // [\"S8823\"],\n        // [\"S8824\"],\n        // [\"S8825\"],\n        // [\"S8826\"],\n        // [\"S8827\"],\n        // [\"S8828\"],\n        // [\"S8829\"],\n        // [\"S8830\"],\n        // [\"S8831\"],\n        // [\"S8832\"],\n        // [\"S8833\"],\n        // [\"S8834\"],\n        // [\"S8835\"],\n        // [\"S8836\"],\n        // [\"S8837\"],\n        // [\"S8838\"],\n        // [\"S8839\"],\n        // [\"S8840\"],\n        // [\"S8841\"],\n        // [\"S8842\"],\n        // [\"S8843\"],\n        // [\"S8844\"],\n        // [\"S8845\"],\n        // [\"S8846\"],\n        // [\"S8847\"],\n        // [\"S8848\"],\n        // [\"S8849\"],\n        // [\"S8850\"],\n        // [\"S8851\"],\n        // [\"S8852\"],\n        // [\"S8853\"],\n        // [\"S8854\"],\n        // [\"S8855\"],\n        // [\"S8856\"],\n        // [\"S8857\"],\n        // [\"S8858\"],\n        // [\"S8859\"],\n        // [\"S8860\"],\n        // [\"S8861\"],\n        // [\"S8862\"],\n        // [\"S8863\"],\n        // [\"S8864\"],\n        // [\"S8865\"],\n        // [\"S8866\"],\n        // [\"S8867\"],\n        // [\"S8868\"],\n        // [\"S8869\"],\n        // [\"S8870\"],\n        // [\"S8871\"],\n        // [\"S8872\"],\n        // [\"S8873\"],\n        // [\"S8874\"],\n        // [\"S8875\"],\n        // [\"S8876\"],\n        // [\"S8877\"],\n        // [\"S8878\"],\n        // [\"S8879\"],\n        // [\"S8880\"],\n        // [\"S8881\"],\n        // [\"S8882\"],\n        // [\"S8883\"],\n        // [\"S8884\"],\n        // [\"S8885\"],\n        // [\"S8886\"],\n        // [\"S8887\"],\n        // [\"S8888\"],\n        // [\"S8889\"],\n        // [\"S8890\"],\n        // [\"S8891\"],\n        // [\"S8892\"],\n        // [\"S8893\"],\n        // [\"S8894\"],\n        // [\"S8895\"],\n        // [\"S8896\"],\n        // [\"S8897\"],\n        // [\"S8898\"],\n        // [\"S8899\"],\n        // [\"S8900\"],\n        // [\"S8901\"],\n        // [\"S8902\"],\n        // [\"S8903\"],\n        // [\"S8904\"],\n        // [\"S8905\"],\n        // [\"S8906\"],\n        // [\"S8907\"],\n        // [\"S8908\"],\n        // [\"S8909\"],\n        // [\"S8910\"],\n        // [\"S8911\"],\n        // [\"S8912\"],\n        // [\"S8913\"],\n        // [\"S8914\"],\n        // [\"S8915\"],\n        // [\"S8916\"],\n        // [\"S8917\"],\n        // [\"S8918\"],\n        // [\"S8919\"],\n        // [\"S8920\"],\n        // [\"S8921\"],\n        // [\"S8922\"],\n        // [\"S8923\"],\n        // [\"S8924\"],\n        // [\"S8925\"],\n        // [\"S8926\"],\n        // [\"S8927\"],\n        // [\"S8928\"],\n        // [\"S8929\"],\n        // [\"S8930\"],\n        // [\"S8931\"],\n        // [\"S8932\"],\n        // [\"S8933\"],\n        // [\"S8934\"],\n        // [\"S8935\"],\n        // [\"S8936\"],\n        // [\"S8937\"],\n        // [\"S8938\"],\n        // [\"S8939\"],\n        // [\"S8940\"],\n        // [\"S8941\"],\n        // [\"S8942\"],\n        // [\"S8943\"],\n        // [\"S8944\"],\n        // [\"S8945\"],\n        // [\"S8946\"],\n        // [\"S8947\"],\n        // [\"S8948\"],\n        // [\"S8949\"],\n        // [\"S8950\"],\n        // [\"S8951\"],\n        // [\"S8952\"],\n        // [\"S8953\"],\n        // [\"S8954\"],\n        // [\"S8955\"],\n        // [\"S8956\"],\n        // [\"S8957\"],\n        // [\"S8958\"],\n        // [\"S8959\"],\n        // [\"S8960\"],\n        // [\"S8961\"],\n        // [\"S8962\"],\n        // [\"S8963\"],\n        // [\"S8964\"],\n        // [\"S8965\"],\n        // [\"S8966\"],\n        // [\"S8967\"],\n        // [\"S8968\"],\n        // [\"S8969\"],\n        // [\"S8970\"],\n        // [\"S8971\"],\n        // [\"S8972\"],\n        // [\"S8973\"],\n        // [\"S8974\"],\n        // [\"S8975\"],\n        // [\"S8976\"],\n        // [\"S8977\"],\n        // [\"S8978\"],\n        // [\"S8979\"],\n        // [\"S8980\"],\n        // [\"S8981\"],\n        // [\"S8982\"],\n        // [\"S8983\"],\n        // [\"S8984\"],\n        // [\"S8985\"],\n        // [\"S8986\"],\n        // [\"S8987\"],\n        // [\"S8988\"],\n        // [\"S8989\"],\n        // [\"S8990\"],\n        // [\"S8991\"],\n        // [\"S8992\"],\n        // [\"S8993\"],\n        // [\"S8994\"],\n        // [\"S8995\"],\n        // [\"S8996\"],\n        // [\"S8997\"],\n        // [\"S8998\"],\n        // [\"S8999\"],\n        // [\"S9000\"],\n        // [\"S9001\"],\n        // [\"S9002\"],\n        // [\"S9003\"],\n        // [\"S9004\"],\n        // [\"S9005\"],\n        // [\"S9006\"],\n        // [\"S9007\"],\n        // [\"S9008\"],\n        // [\"S9009\"],\n        // [\"S9010\"],\n        // [\"S9011\"],\n        // [\"S9012\"],\n        // [\"S9013\"],\n        // [\"S9014\"],\n        // [\"S9015\"],\n        // [\"S9016\"],\n        // [\"S9017\"],\n        // [\"S9018\"],\n        // [\"S9019\"],\n        // [\"S9020\"],\n        // [\"S9021\"],\n        // [\"S9022\"],\n        // [\"S9023\"],\n        // [\"S9024\"],\n        // [\"S9025\"],\n        // [\"S9026\"],\n        // [\"S9027\"],\n        // [\"S9028\"],\n        // [\"S9029\"],\n        // [\"S9030\"],\n        // [\"S9031\"],\n        // [\"S9032\"],\n        // [\"S9033\"],\n        // [\"S9034\"],\n        // [\"S9035\"],\n        // [\"S9036\"],\n        // [\"S9037\"],\n        // [\"S9038\"],\n        // [\"S9039\"],\n        // [\"S9040\"],\n        // [\"S9041\"],\n        // [\"S9042\"],\n        // [\"S9043\"],\n        // [\"S9044\"],\n        // [\"S9045\"],\n        // [\"S9046\"],\n        // [\"S9047\"],\n        // [\"S9048\"],\n        // [\"S9049\"],\n        // [\"S9050\"],\n        // [\"S9051\"],\n        // [\"S9052\"],\n        // [\"S9053\"],\n        // [\"S9054\"],\n        // [\"S9055\"],\n        // [\"S9056\"],\n        // [\"S9057\"],\n        // [\"S9058\"],\n        // [\"S9059\"],\n        // [\"S9060\"],\n        // [\"S9061\"],\n        // [\"S9062\"],\n        // [\"S9063\"],\n        // [\"S9064\"],\n        // [\"S9065\"],\n        // [\"S9066\"],\n        // [\"S9067\"],\n        // [\"S9068\"],\n        // [\"S9069\"],\n        // [\"S9070\"],\n        // [\"S9071\"],\n        // [\"S9072\"],\n        // [\"S9073\"],\n        // [\"S9074\"],\n        // [\"S9075\"],\n        // [\"S9076\"],\n        // [\"S9077\"],\n        // [\"S9078\"],\n        // [\"S9079\"],\n        // [\"S9080\"],\n        // [\"S9081\"],\n        // [\"S9082\"],\n        // [\"S9083\"],\n        // [\"S9084\"],\n        // [\"S9085\"],\n        // [\"S9086\"],\n        // [\"S9087\"],\n        // [\"S9088\"],\n        // [\"S9089\"],\n        // [\"S9090\"],\n        // [\"S9091\"],\n        // [\"S9092\"],\n        // [\"S9093\"],\n        // [\"S9094\"],\n        // [\"S9095\"],\n        // [\"S9096\"],\n        // [\"S9097\"],\n        // [\"S9098\"],\n        // [\"S9099\"],\n        // [\"S9100\"],\n        // [\"S9101\"],\n        // [\"S9102\"],\n        // [\"S9103\"],\n        // [\"S9104\"],\n        // [\"S9105\"],\n        // [\"S9106\"],\n        // [\"S9107\"],\n        // [\"S9108\"],\n        // [\"S9109\"],\n        // [\"S9110\"],\n        // [\"S9111\"],\n        // [\"S9112\"],\n        // [\"S9113\"],\n        // [\"S9114\"],\n        // [\"S9115\"],\n        // [\"S9116\"],\n        // [\"S9117\"],\n        // [\"S9118\"],\n        // [\"S9119\"],\n        // [\"S9120\"],\n        // [\"S9121\"],\n        // [\"S9122\"],\n        // [\"S9123\"],\n        // [\"S9124\"],\n        // [\"S9125\"],\n        // [\"S9126\"],\n        // [\"S9127\"],\n        // [\"S9128\"],\n        // [\"S9129\"],\n        // [\"S9130\"],\n        // [\"S9131\"],\n        // [\"S9132\"],\n        // [\"S9133\"],\n        // [\"S9134\"],\n        // [\"S9135\"],\n        // [\"S9136\"],\n        // [\"S9137\"],\n        // [\"S9138\"],\n        // [\"S9139\"],\n        // [\"S9140\"],\n        // [\"S9141\"],\n        // [\"S9142\"],\n        // [\"S9143\"],\n        // [\"S9144\"],\n        // [\"S9145\"],\n        // [\"S9146\"],\n        // [\"S9147\"],\n        // [\"S9148\"],\n        // [\"S9149\"],\n        // [\"S9150\"],\n        // [\"S9151\"],\n        // [\"S9152\"],\n        // [\"S9153\"],\n        // [\"S9154\"],\n        // [\"S9155\"],\n        // [\"S9156\"],\n        // [\"S9157\"],\n        // [\"S9158\"],\n        // [\"S9159\"],\n        // [\"S9160\"],\n        // [\"S9161\"],\n        // [\"S9162\"],\n        // [\"S9163\"],\n        // [\"S9164\"],\n        // [\"S9165\"],\n        // [\"S9166\"],\n        // [\"S9167\"],\n        // [\"S9168\"],\n        // [\"S9169\"],\n        // [\"S9170\"],\n        // [\"S9171\"],\n        // [\"S9172\"],\n        // [\"S9173\"],\n        // [\"S9174\"],\n        // [\"S9175\"],\n        // [\"S9176\"],\n        // [\"S9177\"],\n        // [\"S9178\"],\n        // [\"S9179\"],\n        // [\"S9180\"],\n        // [\"S9181\"],\n        // [\"S9182\"],\n        // [\"S9183\"],\n        // [\"S9184\"],\n        // [\"S9185\"],\n        // [\"S9186\"],\n        // [\"S9187\"],\n        // [\"S9188\"],\n        // [\"S9189\"],\n        // [\"S9190\"],\n        // [\"S9191\"],\n        // [\"S9192\"],\n        // [\"S9193\"],\n        // [\"S9194\"],\n        // [\"S9195\"],\n        // [\"S9196\"],\n        // [\"S9197\"],\n        // [\"S9198\"],\n        // [\"S9199\"],\n        // [\"S9200\"],\n        // [\"S9201\"],\n        // [\"S9202\"],\n        // [\"S9203\"],\n        // [\"S9204\"],\n        // [\"S9205\"],\n        // [\"S9206\"],\n        // [\"S9207\"],\n        // [\"S9208\"],\n        // [\"S9209\"],\n        // [\"S9210\"],\n        // [\"S9211\"],\n        // [\"S9212\"],\n        // [\"S9213\"],\n        // [\"S9214\"],\n        // [\"S9215\"],\n        // [\"S9216\"],\n        // [\"S9217\"],\n        // [\"S9218\"],\n        // [\"S9219\"],\n        // [\"S9220\"],\n        // [\"S9221\"],\n        // [\"S9222\"],\n        // [\"S9223\"],\n        // [\"S9224\"],\n        // [\"S9225\"],\n        // [\"S9226\"],\n        // [\"S9227\"],\n        // [\"S9228\"],\n        // [\"S9229\"],\n        // [\"S9230\"],\n        // [\"S9231\"],\n        // [\"S9232\"],\n        // [\"S9233\"],\n        // [\"S9234\"],\n        // [\"S9235\"],\n        // [\"S9236\"],\n        // [\"S9237\"],\n        // [\"S9238\"],\n        // [\"S9239\"],\n        // [\"S9240\"],\n        // [\"S9241\"],\n        // [\"S9242\"],\n        // [\"S9243\"],\n        // [\"S9244\"],\n        // [\"S9245\"],\n        // [\"S9246\"],\n        // [\"S9247\"],\n        // [\"S9248\"],\n        // [\"S9249\"],\n        // [\"S9250\"],\n        // [\"S9251\"],\n        // [\"S9252\"],\n        // [\"S9253\"],\n        // [\"S9254\"],\n        // [\"S9255\"],\n        // [\"S9256\"],\n        // [\"S9257\"],\n        // [\"S9258\"],\n        // [\"S9259\"],\n        // [\"S9260\"],\n        // [\"S9261\"],\n        // [\"S9262\"],\n        // [\"S9263\"],\n        // [\"S9264\"],\n        // [\"S9265\"],\n        // [\"S9266\"],\n        // [\"S9267\"],\n        // [\"S9268\"],\n        // [\"S9269\"],\n        // [\"S9270\"],\n        // [\"S9271\"],\n        // [\"S9272\"],\n        // [\"S9273\"],\n        // [\"S9274\"],\n        // [\"S9275\"],\n        // [\"S9276\"],\n        // [\"S9277\"],\n        // [\"S9278\"],\n        // [\"S9279\"],\n        // [\"S9280\"],\n        // [\"S9281\"],\n        // [\"S9282\"],\n        // [\"S9283\"],\n        // [\"S9284\"],\n        // [\"S9285\"],\n        // [\"S9286\"],\n        // [\"S9287\"],\n        // [\"S9288\"],\n        // [\"S9289\"],\n        // [\"S9290\"],\n        // [\"S9291\"],\n        // [\"S9292\"],\n        // [\"S9293\"],\n        // [\"S9294\"],\n        // [\"S9295\"],\n        // [\"S9296\"],\n        // [\"S9297\"],\n        // [\"S9298\"],\n        // [\"S9299\"],\n        // [\"S9300\"],\n        // [\"S9301\"],\n        // [\"S9302\"],\n        // [\"S9303\"],\n        // [\"S9304\"],\n        // [\"S9305\"],\n        // [\"S9306\"],\n        // [\"S9307\"],\n        // [\"S9308\"],\n        // [\"S9309\"],\n        // [\"S9310\"],\n        // [\"S9311\"],\n        // [\"S9312\"],\n        // [\"S9313\"],\n        // [\"S9314\"],\n        // [\"S9315\"],\n        // [\"S9316\"],\n        // [\"S9317\"],\n        // [\"S9318\"],\n        // [\"S9319\"],\n        // [\"S9320\"],\n        // [\"S9321\"],\n        // [\"S9322\"],\n        // [\"S9323\"],\n        // [\"S9324\"],\n        // [\"S9325\"],\n        // [\"S9326\"],\n        // [\"S9327\"],\n        // [\"S9328\"],\n        // [\"S9329\"],\n        // [\"S9330\"],\n        // [\"S9331\"],\n        // [\"S9332\"],\n        // [\"S9333\"],\n        // [\"S9334\"],\n        // [\"S9335\"],\n        // [\"S9336\"],\n        // [\"S9337\"],\n        // [\"S9338\"],\n        // [\"S9339\"],\n        // [\"S9340\"],\n        // [\"S9341\"],\n        // [\"S9342\"],\n        // [\"S9343\"],\n        // [\"S9344\"],\n        // [\"S9345\"],\n        // [\"S9346\"],\n        // [\"S9347\"],\n        // [\"S9348\"],\n        // [\"S9349\"],\n        // [\"S9350\"],\n        // [\"S9351\"],\n        // [\"S9352\"],\n        // [\"S9353\"],\n        // [\"S9354\"],\n        // [\"S9355\"],\n        // [\"S9356\"],\n        // [\"S9357\"],\n        // [\"S9358\"],\n        // [\"S9359\"],\n        // [\"S9360\"],\n        // [\"S9361\"],\n        // [\"S9362\"],\n        // [\"S9363\"],\n        // [\"S9364\"],\n        // [\"S9365\"],\n        // [\"S9366\"],\n        // [\"S9367\"],\n        // [\"S9368\"],\n        // [\"S9369\"],\n        // [\"S9370\"],\n        // [\"S9371\"],\n        // [\"S9372\"],\n        // [\"S9373\"],\n        // [\"S9374\"],\n        // [\"S9375\"],\n        // [\"S9376\"],\n        // [\"S9377\"],\n        // [\"S9378\"],\n        // [\"S9379\"],\n        // [\"S9380\"],\n        // [\"S9381\"],\n        // [\"S9382\"],\n        // [\"S9383\"],\n        // [\"S9384\"],\n        // [\"S9385\"],\n        // [\"S9386\"],\n        // [\"S9387\"],\n        // [\"S9388\"],\n        // [\"S9389\"],\n        // [\"S9390\"],\n        // [\"S9391\"],\n        // [\"S9392\"],\n        // [\"S9393\"],\n        // [\"S9394\"],\n        // [\"S9395\"],\n        // [\"S9396\"],\n        // [\"S9397\"],\n        // [\"S9398\"],\n        // [\"S9399\"],\n        // [\"S9400\"],\n        // [\"S9401\"],\n        // [\"S9402\"],\n        // [\"S9403\"],\n        // [\"S9404\"],\n        // [\"S9405\"],\n        // [\"S9406\"],\n        // [\"S9407\"],\n        // [\"S9408\"],\n        // [\"S9409\"],\n        // [\"S9410\"],\n        // [\"S9411\"],\n        // [\"S9412\"],\n        // [\"S9413\"],\n        // [\"S9414\"],\n        // [\"S9415\"],\n        // [\"S9416\"],\n        // [\"S9417\"],\n        // [\"S9418\"],\n        // [\"S9419\"],\n        // [\"S9420\"],\n        // [\"S9421\"],\n        // [\"S9422\"],\n        // [\"S9423\"],\n        // [\"S9424\"],\n        // [\"S9425\"],\n        // [\"S9426\"],\n        // [\"S9427\"],\n        // [\"S9428\"],\n        // [\"S9429\"],\n        // [\"S9430\"],\n        // [\"S9431\"],\n        // [\"S9432\"],\n        // [\"S9433\"],\n        // [\"S9434\"],\n        // [\"S9435\"],\n        // [\"S9436\"],\n        // [\"S9437\"],\n        // [\"S9438\"],\n        // [\"S9439\"],\n        // [\"S9440\"],\n        // [\"S9441\"],\n        // [\"S9442\"],\n        // [\"S9443\"],\n        // [\"S9444\"],\n        // [\"S9445\"],\n        // [\"S9446\"],\n        // [\"S9447\"],\n        // [\"S9448\"],\n        // [\"S9449\"],\n        // [\"S9450\"],\n        // [\"S9451\"],\n        // [\"S9452\"],\n        // [\"S9453\"],\n        // [\"S9454\"],\n        // [\"S9455\"],\n        // [\"S9456\"],\n        // [\"S9457\"],\n        // [\"S9458\"],\n        // [\"S9459\"],\n        // [\"S9460\"],\n        // [\"S9461\"],\n        // [\"S9462\"],\n        // [\"S9463\"],\n        // [\"S9464\"],\n        // [\"S9465\"],\n        // [\"S9466\"],\n        // [\"S9467\"],\n        // [\"S9468\"],\n        // [\"S9469\"],\n        // [\"S9470\"],\n        // [\"S9471\"],\n        // [\"S9472\"],\n        // [\"S9473\"],\n        // [\"S9474\"],\n        // [\"S9475\"],\n        // [\"S9476\"],\n        // [\"S9477\"],\n        // [\"S9478\"],\n        // [\"S9479\"],\n        // [\"S9480\"],\n        // [\"S9481\"],\n        // [\"S9482\"],\n        // [\"S9483\"],\n        // [\"S9484\"],\n        // [\"S9485\"],\n        // [\"S9486\"],\n        // [\"S9487\"],\n        // [\"S9488\"],\n        // [\"S9489\"],\n        // [\"S9490\"],\n        // [\"S9491\"],\n        // [\"S9492\"],\n        // [\"S9493\"],\n        // [\"S9494\"],\n        // [\"S9495\"],\n        // [\"S9496\"],\n        // [\"S9497\"],\n        // [\"S9498\"],\n        // [\"S9499\"],\n        // [\"S9500\"],\n        // [\"S9501\"],\n        // [\"S9502\"],\n        // [\"S9503\"],\n        // [\"S9504\"],\n        // [\"S9505\"],\n        // [\"S9506\"],\n        // [\"S9507\"],\n        // [\"S9508\"],\n        // [\"S9509\"],\n        // [\"S9510\"],\n        // [\"S9511\"],\n        // [\"S9512\"],\n        // [\"S9513\"],\n        // [\"S9514\"],\n        // [\"S9515\"],\n        // [\"S9516\"],\n        // [\"S9517\"],\n        // [\"S9518\"],\n        // [\"S9519\"],\n        // [\"S9520\"],\n        // [\"S9521\"],\n        // [\"S9522\"],\n        // [\"S9523\"],\n        // [\"S9524\"],\n        // [\"S9525\"],\n        // [\"S9526\"],\n        // [\"S9527\"],\n        // [\"S9528\"],\n        // [\"S9529\"],\n        // [\"S9530\"],\n        // [\"S9531\"],\n        // [\"S9532\"],\n        // [\"S9533\"],\n        // [\"S9534\"],\n        // [\"S9535\"],\n        // [\"S9536\"],\n        // [\"S9537\"],\n        // [\"S9538\"],\n        // [\"S9539\"],\n        // [\"S9540\"],\n        // [\"S9541\"],\n        // [\"S9542\"],\n        // [\"S9543\"],\n        // [\"S9544\"],\n        // [\"S9545\"],\n        // [\"S9546\"],\n        // [\"S9547\"],\n        // [\"S9548\"],\n        // [\"S9549\"],\n        // [\"S9550\"],\n        // [\"S9551\"],\n        // [\"S9552\"],\n        // [\"S9553\"],\n        // [\"S9554\"],\n        // [\"S9555\"],\n        // [\"S9556\"],\n        // [\"S9557\"],\n        // [\"S9558\"],\n        // [\"S9559\"],\n        // [\"S9560\"],\n        // [\"S9561\"],\n        // [\"S9562\"],\n        // [\"S9563\"],\n        // [\"S9564\"],\n        // [\"S9565\"],\n        // [\"S9566\"],\n        // [\"S9567\"],\n        // [\"S9568\"],\n        // [\"S9569\"],\n        // [\"S9570\"],\n        // [\"S9571\"],\n        // [\"S9572\"],\n        // [\"S9573\"],\n        // [\"S9574\"],\n        // [\"S9575\"],\n        // [\"S9576\"],\n        // [\"S9577\"],\n        // [\"S9578\"],\n        // [\"S9579\"],\n        // [\"S9580\"],\n        // [\"S9581\"],\n        // [\"S9582\"],\n        // [\"S9583\"],\n        // [\"S9584\"],\n        // [\"S9585\"],\n        // [\"S9586\"],\n        // [\"S9587\"],\n        // [\"S9588\"],\n        // [\"S9589\"],\n        // [\"S9590\"],\n        // [\"S9591\"],\n        // [\"S9592\"],\n        // [\"S9593\"],\n        // [\"S9594\"],\n        // [\"S9595\"],\n        // [\"S9596\"],\n        // [\"S9597\"],\n        // [\"S9598\"],\n        // [\"S9599\"],\n        // [\"S9600\"],\n        // [\"S9601\"],\n        // [\"S9602\"],\n        // [\"S9603\"],\n        // [\"S9604\"],\n        // [\"S9605\"],\n        // [\"S9606\"],\n        // [\"S9607\"],\n        // [\"S9608\"],\n        // [\"S9609\"],\n        // [\"S9610\"],\n        // [\"S9611\"],\n        // [\"S9612\"],\n        // [\"S9613\"],\n        // [\"S9614\"],\n        // [\"S9615\"],\n        // [\"S9616\"],\n        // [\"S9617\"],\n        // [\"S9618\"],\n        // [\"S9619\"],\n        // [\"S9620\"],\n        // [\"S9621\"],\n        // [\"S9622\"],\n        // [\"S9623\"],\n        // [\"S9624\"],\n        // [\"S9625\"],\n        // [\"S9626\"],\n        // [\"S9627\"],\n        // [\"S9628\"],\n        // [\"S9629\"],\n        // [\"S9630\"],\n        // [\"S9631\"],\n        // [\"S9632\"],\n        // [\"S9633\"],\n        // [\"S9634\"],\n        // [\"S9635\"],\n        // [\"S9636\"],\n        // [\"S9637\"],\n        // [\"S9638\"],\n        // [\"S9639\"],\n        // [\"S9640\"],\n        // [\"S9641\"],\n        // [\"S9642\"],\n        // [\"S9643\"],\n        // [\"S9644\"],\n        // [\"S9645\"],\n        // [\"S9646\"],\n        // [\"S9647\"],\n        // [\"S9648\"],\n        // [\"S9649\"],\n        // [\"S9650\"],\n        // [\"S9651\"],\n        // [\"S9652\"],\n        // [\"S9653\"],\n        // [\"S9654\"],\n        // [\"S9655\"],\n        // [\"S9656\"],\n        // [\"S9657\"],\n        // [\"S9658\"],\n        // [\"S9659\"],\n        // [\"S9660\"],\n        // [\"S9661\"],\n        // [\"S9662\"],\n        // [\"S9663\"],\n        // [\"S9664\"],\n        // [\"S9665\"],\n        // [\"S9666\"],\n        // [\"S9667\"],\n        // [\"S9668\"],\n        // [\"S9669\"],\n        // [\"S9670\"],\n        // [\"S9671\"],\n        // [\"S9672\"],\n        // [\"S9673\"],\n        // [\"S9674\"],\n        // [\"S9675\"],\n        // [\"S9676\"],\n        // [\"S9677\"],\n        // [\"S9678\"],\n        // [\"S9679\"],\n        // [\"S9680\"],\n        // [\"S9681\"],\n        // [\"S9682\"],\n        // [\"S9683\"],\n        // [\"S9684\"],\n        // [\"S9685\"],\n        // [\"S9686\"],\n        // [\"S9687\"],\n        // [\"S9688\"],\n        // [\"S9689\"],\n        // [\"S9690\"],\n        // [\"S9691\"],\n        // [\"S9692\"],\n        // [\"S9693\"],\n        // [\"S9694\"],\n        // [\"S9695\"],\n        // [\"S9696\"],\n        // [\"S9697\"],\n        // [\"S9698\"],\n        // [\"S9699\"],\n        // [\"S9700\"],\n        // [\"S9701\"],\n        // [\"S9702\"],\n        // [\"S9703\"],\n        // [\"S9704\"],\n        // [\"S9705\"],\n        // [\"S9706\"],\n        // [\"S9707\"],\n        // [\"S9708\"],\n        // [\"S9709\"],\n        // [\"S9710\"],\n        // [\"S9711\"],\n        // [\"S9712\"],\n        // [\"S9713\"],\n        // [\"S9714\"],\n        // [\"S9715\"],\n        // [\"S9716\"],\n        // [\"S9717\"],\n        // [\"S9718\"],\n        // [\"S9719\"],\n        // [\"S9720\"],\n        // [\"S9721\"],\n        // [\"S9722\"],\n        // [\"S9723\"],\n        // [\"S9724\"],\n        // [\"S9725\"],\n        // [\"S9726\"],\n        // [\"S9727\"],\n        // [\"S9728\"],\n        // [\"S9729\"],\n        // [\"S9730\"],\n        // [\"S9731\"],\n        // [\"S9732\"],\n        // [\"S9733\"],\n        // [\"S9734\"],\n        // [\"S9735\"],\n        // [\"S9736\"],\n        // [\"S9737\"],\n        // [\"S9738\"],\n        // [\"S9739\"],\n        // [\"S9740\"],\n        // [\"S9741\"],\n        // [\"S9742\"],\n        // [\"S9743\"],\n        // [\"S9744\"],\n        // [\"S9745\"],\n        // [\"S9746\"],\n        // [\"S9747\"],\n        // [\"S9748\"],\n        // [\"S9749\"],\n        // [\"S9750\"],\n        // [\"S9751\"],\n        // [\"S9752\"],\n        // [\"S9753\"],\n        // [\"S9754\"],\n        // [\"S9755\"],\n        // [\"S9756\"],\n        // [\"S9757\"],\n        // [\"S9758\"],\n        // [\"S9759\"],\n        // [\"S9760\"],\n        // [\"S9761\"],\n        // [\"S9762\"],\n        // [\"S9763\"],\n        // [\"S9764\"],\n        // [\"S9765\"],\n        // [\"S9766\"],\n        // [\"S9767\"],\n        // [\"S9768\"],\n        // [\"S9769\"],\n        // [\"S9770\"],\n        // [\"S9771\"],\n        // [\"S9772\"],\n        // [\"S9773\"],\n        // [\"S9774\"],\n        // [\"S9775\"],\n        // [\"S9776\"],\n        // [\"S9777\"],\n        // [\"S9778\"],\n        // [\"S9779\"],\n        // [\"S9780\"],\n        // [\"S9781\"],\n        // [\"S9782\"],\n        // [\"S9783\"],\n        // [\"S9784\"],\n        // [\"S9785\"],\n        // [\"S9786\"],\n        // [\"S9787\"],\n        // [\"S9788\"],\n        // [\"S9789\"],\n        // [\"S9790\"],\n        // [\"S9791\"],\n        // [\"S9792\"],\n        // [\"S9793\"],\n        // [\"S9794\"],\n        // [\"S9795\"],\n        // [\"S9796\"],\n        // [\"S9797\"],\n        // [\"S9798\"],\n        // [\"S9799\"],\n        // [\"S9800\"],\n        // [\"S9801\"],\n        // [\"S9802\"],\n        // [\"S9803\"],\n        // [\"S9804\"],\n        // [\"S9805\"],\n        // [\"S9806\"],\n        // [\"S9807\"],\n        // [\"S9808\"],\n        // [\"S9809\"],\n        // [\"S9810\"],\n        // [\"S9811\"],\n        // [\"S9812\"],\n        // [\"S9813\"],\n        // [\"S9814\"],\n        // [\"S9815\"],\n        // [\"S9816\"],\n        // [\"S9817\"],\n        // [\"S9818\"],\n        // [\"S9819\"],\n        // [\"S9820\"],\n        // [\"S9821\"],\n        // [\"S9822\"],\n        // [\"S9823\"],\n        // [\"S9824\"],\n        // [\"S9825\"],\n        // [\"S9826\"],\n        // [\"S9827\"],\n        // [\"S9828\"],\n        // [\"S9829\"],\n        // [\"S9830\"],\n        // [\"S9831\"],\n        // [\"S9832\"],\n        // [\"S9833\"],\n        // [\"S9834\"],\n        // [\"S9835\"],\n        // [\"S9836\"],\n        // [\"S9837\"],\n        // [\"S9838\"],\n        // [\"S9839\"],\n        // [\"S9840\"],\n        // [\"S9841\"],\n        // [\"S9842\"],\n        // [\"S9843\"],\n        // [\"S9844\"],\n        // [\"S9845\"],\n        // [\"S9846\"],\n        // [\"S9847\"],\n        // [\"S9848\"],\n        // [\"S9849\"],\n        // [\"S9850\"],\n        // [\"S9851\"],\n        // [\"S9852\"],\n        // [\"S9853\"],\n        // [\"S9854\"],\n        // [\"S9855\"],\n        // [\"S9856\"],\n        // [\"S9857\"],\n        // [\"S9858\"],\n        // [\"S9859\"],\n        // [\"S9860\"],\n        // [\"S9861\"],\n        // [\"S9862\"],\n        // [\"S9863\"],\n        // [\"S9864\"],\n        // [\"S9865\"],\n        // [\"S9866\"],\n        // [\"S9867\"],\n        // [\"S9868\"],\n        // [\"S9869\"],\n        // [\"S9870\"],\n        // [\"S9871\"],\n        // [\"S9872\"],\n        // [\"S9873\"],\n        // [\"S9874\"],\n        // [\"S9875\"],\n        // [\"S9876\"],\n        // [\"S9877\"],\n        // [\"S9878\"],\n        // [\"S9879\"],\n        // [\"S9880\"],\n        // [\"S9881\"],\n        // [\"S9882\"],\n        // [\"S9883\"],\n        // [\"S9884\"],\n        // [\"S9885\"],\n        // [\"S9886\"],\n        // [\"S9887\"],\n        // [\"S9888\"],\n        // [\"S9889\"],\n        // [\"S9890\"],\n        // [\"S9891\"],\n        // [\"S9892\"],\n        // [\"S9893\"],\n        // [\"S9894\"],\n        // [\"S9895\"],\n        // [\"S9896\"],\n        // [\"S9897\"],\n        // [\"S9898\"],\n        // [\"S9899\"],\n        // [\"S9900\"],\n        // [\"S9901\"],\n        // [\"S9902\"],\n        // [\"S9903\"],\n        // [\"S9904\"],\n        // [\"S9905\"],\n        // [\"S9906\"],\n        // [\"S9907\"],\n        // [\"S9908\"],\n        // [\"S9909\"],\n        // [\"S9910\"],\n        // [\"S9911\"],\n        // [\"S9912\"],\n        // [\"S9913\"],\n        // [\"S9914\"],\n        // [\"S9915\"],\n        // [\"S9916\"],\n        // [\"S9917\"],\n        // [\"S9918\"],\n        // [\"S9919\"],\n        // [\"S9920\"],\n        // [\"S9921\"],\n        // [\"S9922\"],\n        // [\"S9923\"],\n        // [\"S9924\"],\n        // [\"S9925\"],\n        // [\"S9926\"],\n        // [\"S9927\"],\n        // [\"S9928\"],\n        // [\"S9929\"],\n        // [\"S9930\"],\n        // [\"S9931\"],\n        // [\"S9932\"],\n        // [\"S9933\"],\n        // [\"S9934\"],\n        // [\"S9935\"],\n        // [\"S9936\"],\n        // [\"S9937\"],\n        // [\"S9938\"],\n        // [\"S9939\"],\n        // [\"S9940\"],\n        // [\"S9941\"],\n        // [\"S9942\"],\n        // [\"S9943\"],\n        // [\"S9944\"],\n        // [\"S9945\"],\n        // [\"S9946\"],\n        // [\"S9947\"],\n        // [\"S9948\"],\n        // [\"S9949\"],\n        // [\"S9950\"],\n        // [\"S9951\"],\n        // [\"S9952\"],\n        // [\"S9953\"],\n        // [\"S9954\"],\n        // [\"S9955\"],\n        // [\"S9956\"],\n        // [\"S9957\"],\n        // [\"S9958\"],\n        // [\"S9959\"],\n        // [\"S9960\"],\n        // [\"S9961\"],\n        // [\"S9962\"],\n        // [\"S9963\"],\n        // [\"S9964\"],\n        // [\"S9965\"],\n        // [\"S9966\"],\n        // [\"S9967\"],\n        // [\"S9968\"],\n        // [\"S9969\"],\n        // [\"S9970\"],\n        // [\"S9971\"],\n        // [\"S9972\"],\n        // [\"S9973\"],\n        // [\"S9974\"],\n        // [\"S9975\"],\n        // [\"S9976\"],\n        // [\"S9977\"],\n        // [\"S9978\"],\n        // [\"S9979\"],\n        // [\"S9980\"],\n        // [\"S9981\"],\n        // [\"S9982\"],\n        // [\"S9983\"],\n        // [\"S9984\"],\n        // [\"S9985\"],\n        // [\"S9986\"],\n        // [\"S9987\"],\n        // [\"S9988\"],\n        // [\"S9989\"],\n        // [\"S9990\"],\n        // [\"S9991\"],\n        // [\"S9992\"],\n        // [\"S9993\"],\n        // [\"S9994\"],\n        // [\"S9995\"],\n        // [\"S9996\"],\n        // [\"S9997\"],\n        // [\"S9998\"],\n        // [\"S9999\"]\n    }.ToImmutableDictionary();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Properties/AssemblyInfo.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Runtime.CompilerServices;\n\n[assembly: InternalsVisibleTo(\"SonarAnalyzer.TestFramework.Test\")]\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/SonarAnalyzer.TestFramework.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <!-- Memory.Test still targets net9.0 because JetBrains.dotMemoryUnit hangs on net10.0. Therefore TestFramework needs to target net9.0 and net10.0. -->\n    <TargetFrameworks>net48;net9.0;net10.0</TargetFrameworks>\n    <SonarQubeTestProject>false</SonarQubeTestProject>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"FluentAssertions\" Version=\"7.2.1\" />\n    <PackageReference Include=\"FluentAssertions.Analyzers\" Version=\"0.34.1\">\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"Microsoft.Build.Locator\" Version=\"1.11.2\" />\n    <PackageReference Include=\"Microsoft.CodeAnalysis.Workspaces.MSBuild\" Version=\"5.3.0\" />\n    <PackageReference Include=\"Microsoft.CodeAnalysis.CSharp.Workspaces\" Version=\"5.3.0\" />\n    <PackageReference Include=\"Microsoft.CodeAnalysis.VisualBasic.Workspaces\" Version=\"5.3.0\" />\n    <PackageReference Include=\"NSubstitute\" Version=\"5.3.0\" />\n    <PackageReference Include=\"NuGet.Protocol\" Version=\"7.3.1\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\src\\SonarAnalyzer.Core\\SonarAnalyzer.Core.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Using Include=\"FluentAssertions\" />\n    <Using Include=\"Microsoft.CodeAnalysis\" />\n    <Using Include=\"Microsoft.CodeAnalysis.Diagnostics\" />\n    <Using Include=\"Microsoft.VisualStudio.TestTools.UnitTesting\" />\n    <Using Include=\"Combinatorial.MSTest\" />\n    <Using Include=\"SonarAnalyzer.Core.Analyzers\" />\n    <Using Include=\"SonarAnalyzer.Core.Common\" />\n    <Using Include=\"SonarAnalyzer.Core.Extensions\" />\n    <Using Include=\"SonarAnalyzer.TestFramework.Common\" />\n    <Using Include=\"SonarAnalyzer.TestFramework.Extensions\" />\n    <Using Include=\"SonarAnalyzer.TestFramework.MetadataReferences\" />\n    <Using Include=\"System.Diagnostics.CodeAnalysis\" />\n    <Using Include=\"System.IO\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Verification/CodeFixVerifier.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing SonarAnalyzer.TestFramework.Verification.IssueValidation;\n\nnamespace SonarAnalyzer.TestFramework.Verification;\n\ninternal class CodeFixVerifier\n{\n    private const string FixedMessage = \"Fixed\";\n\n    private readonly DiagnosticAnalyzer analyzer;\n    private readonly CodeFixProvider codeFix;\n    private readonly Document originalDocument;\n    private readonly string codeFixTitle;\n\n    public CodeFixVerifier(DiagnosticAnalyzer analyzer, CodeFixProvider codeFix, Document originalDocument, string codeFixTitle)\n    {\n        this.analyzer = analyzer;\n        this.codeFix = codeFix;\n        this.originalDocument = originalDocument;\n        this.codeFixTitle = codeFixTitle;\n    }\n\n    public void VerifyWhileDocumentChanges(ParseOptions parseOptions, string pathToExpected)\n    {\n        var state = new State(analyzer, originalDocument, parseOptions);\n        var codeFixExecuted = false;\n        string codeBeforeFix;\n        state.Diagnostics.Should().NotBeEmpty();\n        do\n        {\n            codeBeforeFix = state.ActualCode;\n            if (state.Diagnostics\n                    .Where(x => codeFix.FixableDiagnosticIds.Contains(x.Id))    // Analyzer can also raise other Diagnostics that we can't fix\n                    .SelectMany(x => ActionToApply(codeFix, state.Document, x))\n                    .FirstOrDefault() is { } actionToApply)\n            {\n                state = new State(analyzer, ApplyCodeFix(state.Document, actionToApply), parseOptions);\n                codeFixExecuted = true;\n            }\n        }\n        while (codeBeforeFix != state.ActualCode);\n\n        codeFixExecuted.Should().BeTrue();\n        state.AssertExpected(pathToExpected, nameof(VerifyWhileDocumentChanges) + \" updates the document until all issues are fixed, even if the fix itself creates a new issue again\");\n    }\n\n    public void VerifyFixAllProvider(FixAllProvider fixAllProvider, ParseOptions parseOptions, string pathToExpected)\n    {\n        var state = new State(analyzer, originalDocument, parseOptions);\n        state.Diagnostics.Should().NotBeEmpty();\n\n        var fixAllDiagnosticProvider = new FixAllDiagnosticProvider(state.Diagnostics);\n        var codeActionEquivalenceKey = codeFixTitle ?? CodeFixTitle(codeFix, state);    // We need to find the title of the single action to use\n        var fixAllContext = new FixAllContext(state.Document, codeFix, FixAllScope.Document, codeActionEquivalenceKey, codeFix.FixableDiagnosticIds, fixAllDiagnosticProvider, default);\n        var codeActionToExecute = fixAllProvider.GetFixAsync(fixAllContext).Result;\n        codeActionToExecute.Should().NotBeNull();\n\n        new State(analyzer, ApplyCodeFix(state.Document, codeActionToExecute), parseOptions)\n            .AssertExpected(pathToExpected, $\"{nameof(VerifyFixAllProvider)} runs {fixAllProvider.GetType().Name} once\");\n    }\n\n    private string CodeFixTitle(CodeFixProvider codeFix, State state) =>\n        state.Diagnostics.SelectMany(x => ActionToApply(codeFix, state.Document, x)).First().Title;\n\n    private static Document ApplyCodeFix(Document document, CodeAction codeAction)\n    {\n        var operations = codeAction.GetOperationsAsync(CancellationToken.None).Result;\n        var solution = operations.OfType<ApplyChangesOperation>().Single().ChangedSolution;\n        return solution.GetDocument(document.Id);\n    }\n\n    private IEnumerable<CodeAction> ActionToApply(CodeFixProvider codeFix, Document document, Diagnostic diagnostic)\n    {\n        var actions = new List<CodeAction>();\n        var context = new CodeFixContext(document, diagnostic, (action, _) => actions.Add(action), default);\n        codeFix.RegisterCodeFixesAsync(context).Wait();\n        return actions.Where(x => codeFixTitle is null || x.Title == codeFixTitle);\n    }\n\n    private sealed class State\n    {\n        public readonly Document Document;\n        public readonly ImmutableArray<Diagnostic> Diagnostics;\n        public readonly string ActualCode;\n        private readonly Compilation compilation;\n\n        public State(DiagnosticAnalyzer analyzer, Document document, ParseOptions parseOptions)\n        {\n            var project = document.Project.WithParseOptions(parseOptions);\n            document = project.GetDocument(document.Id);    // There's a new instance with the same ID\n            compilation = project.GetCompilationAsync().Result;\n            Document = document;\n            Diagnostics = DiagnosticVerifier.AnalyzerDiagnostics(compilation, analyzer, CompilationErrorBehavior.Ignore).Where(x => x.Severity != DiagnosticSeverity.Error).ToImmutableArray();\n            ActualCode = document.GetSyntaxRootAsync().Result.GetText().ToString();\n        }\n\n        public void AssertExpected(string pathToExpected, string becauseMessage)\n        {\n            var expected = File.ReadAllText(pathToExpected).ToUnixLineEndings();\n            var actual = ActualCodeWithReplacedComments().ToUnixLineEndings();\n            try\n            {\n                actual.Should().Be(expected, $\"{becauseMessage}. Language: {compilation.LanguageVersionString()}\");\n            }\n            catch\n            {\n                Console.WriteLine();\n                Console.WriteLine($\"--- Actual content of {Path.GetFileName(pathToExpected)} ---\");\n                Console.WriteLine(actual);\n                throw;\n            }\n        }\n\n        private string ActualCodeWithReplacedComments() =>\n            ActualCode.ToUnixLineEndings()\n                .Split(new[] { TestConstants.UnixLineEnding }, StringSplitOptions.None)\n                .Where(x => !IssueLocationCollector.RxPreciseLocation.IsMatch(x))\n                .Select(ReplaceNonCompliantComment)\n                .JoinStr(TestConstants.UnixLineEnding);\n\n        private static string ReplaceNonCompliantComment(string line)\n        {\n            var match = IssueLocationCollector.RxIssue.Match(line);\n            if (!match.Success || match.Groups[\"IssueType\"].Value == \"Error\")\n            {\n                return line;\n            }\n\n            if (match.Groups[\"IssueType\"].Value == \"Noncompliant\")\n            {\n                var startIndex = line.IndexOf(match.Groups[\"IssueType\"].Value);\n                return string.Concat(line.Remove(startIndex), FixedMessage);\n            }\n\n            return line.Replace(match.Value, string.Empty).TrimEnd();\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Verification/DiagnosticVerifier.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.TestFramework.Verification.IssueValidation;\n\nnamespace SonarAnalyzer.TestFramework.Verification;\n\npublic static class DiagnosticVerifier\n{\n    private const string AD0001 = nameof(AD0001);\n    private const string LineContinuationVB12 = \"BC36716\";  // Visual Basic 12.0 does not support line continuation comments.\n    private const string ConcurrentInfix = \".Concurrent\";\n\n    public static int Verify(Compilation compilation,\n                             DiagnosticAnalyzer[] analyzers,\n                             CompilationErrorBehavior checkMode, // ToDo: Remove this parameter in https://github.com/SonarSource/sonar-dotnet/issues/8588\n                             string additionalFilePath,\n                             string[] onlyDiagnostics,\n                             string[] additionalSourceFiles,\n                             bool? concurrentAnalysis = null,\n                             string[] warningsAsErrors = null)\n    {\n        SuppressionHandler.HookSuppression();\n        try\n        {\n            var sources = ExceptRazorGeneratedFiles(compilation.SyntaxTrees)\n                .Select(x => new FileContent(x))\n                .Concat((additionalSourceFiles ?? Array.Empty<string>()).Select(x => new FileContent(x)));\n            var diagnostics = DiagnosticsAndErrors(compilation, analyzers, checkMode, additionalFilePath, onlyDiagnostics, concurrentAnalysis, warningsAsErrors).ToArray();\n            var expected = new CompilationIssues(sources);\n            VerifyNoExceptionThrown(diagnostics);\n            Compare(compilation.LanguageVersionString(), new(diagnostics), expected);\n            // When there are no issues reported from the test (the FileLines analyzer does not report in each call to Verifier.VerifyAnalyzer) we skip the check for the extension method.\n            if (diagnostics.Any(x => x.Severity != DiagnosticSeverity.Error))\n            {\n                SuppressionHandler.ExtensionMethodsCalledForAllDiagnostics(analyzers).Should().BeTrue(\"The ReportIssue should be used instead of ReportDiagnostic\");\n            }\n            return diagnostics.Length;\n        }\n        finally\n        {\n            SuppressionHandler.UnHookSuppression();\n        }\n    }\n\n    public static void VerifyNoIssues(Compilation compilation,\n                                      DiagnosticAnalyzer analyzer,\n                                      CompilationErrorBehavior checkMode = CompilationErrorBehavior.Default,\n                                      string additionalFilePath = null,\n                                      string[] onlyDiagnostics = null) =>\n        AnalyzerDiagnostics(compilation, analyzer, checkMode, additionalFilePath, onlyDiagnostics).Should().BeEmpty();\n\n    public static void VerifyNoIssuesIgnoreErrors(Compilation compilation,\n                                                  DiagnosticAnalyzer analyzer,\n                                                  CompilationErrorBehavior checkMode = CompilationErrorBehavior.Default,\n                                                  string additionalFilePath = null,\n                                                  string[] onlyDiagnostics = null)\n    {\n        var diagnostics = AnalyzerDiagnostics(compilation, analyzer, checkMode, additionalFilePath, onlyDiagnostics);\n        diagnostics.Should().NotContain(x => x.Severity != DiagnosticSeverity.Error);\n    }\n\n    public static IEnumerable<Diagnostic> AnalyzerDiagnostics(Compilation compilation, DiagnosticAnalyzer analyzer, CompilationErrorBehavior checkMode, string additionalFilePath = null, string[] onlyDiagnostics = null) =>\n        AnalyzerDiagnostics(compilation, [analyzer], checkMode, additionalFilePath, onlyDiagnostics);\n\n    public static IEnumerable<Diagnostic> AnalyzerDiagnostics(Compilation compilation, DiagnosticAnalyzer[] analyzers, CompilationErrorBehavior checkMode, string additionalFilePath = null, string[] onlyDiagnostics = null) =>\n        VerifyNoExceptionThrown(DiagnosticsAndErrors(compilation, analyzers, checkMode, additionalFilePath, onlyDiagnostics));\n\n    public static IEnumerable<Diagnostic> AnalyzerExceptions(Compilation compilation, DiagnosticAnalyzer analyzer) =>\n        DiagnosticsAndErrors(compilation, [analyzer], CompilationErrorBehavior.FailTest, null, null).Where(x => x.Id == AD0001);\n\n    private static ImmutableArray<Diagnostic> DiagnosticsAndErrors(Compilation compilation,\n                                                                   DiagnosticAnalyzer[] analyzer,\n                                                                   CompilationErrorBehavior checkMode, // ToDo: Remove in https://github.com/SonarSource/sonar-dotnet/issues/8588\n                                                                   string additionalFilePath,\n                                                                   string[] onlyDiagnostics,\n                                                                   bool? concurrentAnalysis = null,\n                                                                   string[] warningsAsErrors = null)\n    {\n        using var scope = concurrentAnalysis.HasValue ? new EnvironmentVariableScope { EnableConcurrentAnalysis = concurrentAnalysis.Value } : null;\n        onlyDiagnostics ??= [];\n        var supportedDiagnostics = analyzer\n            .SelectMany(x => x.SupportedDiagnostics.Select(d => d.Id))\n            .ToImmutableDictionary(x => x, Severity)\n            .Add(AD0001, ReportDiagnostic.Error);\n        foreach (var id in warningsAsErrors ?? [])\n        {\n            supportedDiagnostics = supportedDiagnostics.SetItem(id, ReportDiagnostic.Error);\n        }\n        var compilationOptions = compilation.Options.WithSpecificDiagnosticOptions(supportedDiagnostics);\n        var analyzerOptions = string.IsNullOrWhiteSpace(additionalFilePath) ? null : AnalysisScaffolding.CreateOptions(additionalFilePath);\n        var diagnostics = compilation\n            .WithOptions(compilationOptions)\n            .WithAnalyzers(analyzer.ToImmutableArray(), analyzerOptions)\n            .GetAllDiagnosticsAsync(default)\n            .Result\n            .Where(x => (x.Severity == DiagnosticSeverity.Error && x.Id != LineContinuationVB12) || supportedDiagnostics.ContainsKey(x.Id));   // No compiler info about new syntax or unused usings\n\n        return checkMode == CompilationErrorBehavior.Ignore    // ToDo: Remove in https://github.com/SonarSource/sonar-dotnet/issues/8588\n            ? diagnostics.Where(x => x.Id == AD0001 || x.Severity != DiagnosticSeverity.Error).ToImmutableArray()\n            : diagnostics.ToImmutableArray();\n\n        ReportDiagnostic Severity(string id) =>\n            onlyDiagnostics.Length == 0 || onlyDiagnostics.Contains(id) ? ReportDiagnostic.Warn : ReportDiagnostic.Suppress;\n    }\n\n    private static void Compare(string languageVersion, CompilationIssues actual, CompilationIssues expected)\n    {\n        var messages = new List<VerificationMessage>();\n        foreach (var filePairs in MatchPairs(actual, expected).GroupBy(x => x.FilePath.Replace(ConcurrentInfix, null)).OrderBy(x => x.Key))\n        {\n            var defaultPairs = new List<IssueLocationPair>();\n            var concurrentPairs = new List<IssueLocationPair>();\n            foreach (var pair in filePairs)\n            {\n                (pair.FilePath.Contains(ConcurrentInfix) ? concurrentPairs : defaultPairs).Add(pair);\n            }\n            messages.AddRange(SerializePairs(languageVersion, defaultPairs, concurrentPairs));\n            messages.Add(VerificationMessage.EmptyLine);\n        }\n        if (messages.Any())\n        {\n            throw new DiagnosticVerifierException(messages);\n        }\n        else\n        {\n            actual.Dump(languageVersion);\n        }\n    }\n\n    private static IEnumerable<VerificationMessage> SerializePairs(string languageVersion, List<IssueLocationPair> defaultPairs, List<IssueLocationPair> concurrentPairs)\n    {\n        if (defaultPairs.Any())\n        {\n            return concurrentPairs.Count switch\n                {   // Avoid redundant message dumps\n                    0 => CreateMessages(defaultPairs),\n                    1 => CreateMessages(defaultPairs).Append(new(null, $\"There is 1 more difference in {SerializePath(concurrentPairs[0].FilePath)}\", null, 0)),\n                    _ => CreateMessages(defaultPairs).Append(new(null, $\"There are {concurrentPairs.Count} more differences in {SerializePath(concurrentPairs[0].FilePath)}\", null, 0))\n                };\n        }\n        else\n        {\n            return CreateMessages(concurrentPairs);\n        }\n\n        IEnumerable<VerificationMessage> CreateMessages(List<IssueLocationPair> pairs)\n        {\n            yield return new(null, $\"There are differences for {languageVersion} {SerializePath(pairs[0].FilePath)}:\", null, 0);\n            foreach (var pair in pairs.OrderBy(x => x.Type).ThenBy(x => x.LineNumber).ThenBy(x => x.Start).ThenBy(x => x.IssueId).ThenBy(x => x.RuleId))\n            {\n                yield return pair.CreateMessage();\n            }\n        }\n\n        static string SerializePath(string path) =>\n            path == string.Empty ? \"<project-level-issue>\" : path;\n    }\n\n    private static IEnumerable<SyntaxTree> ExceptRazorGeneratedFiles(IEnumerable<SyntaxTree> syntaxTrees) =>\n        syntaxTrees.Where(x =>\n            !x.FilePath.EndsWith(\"razor.g.cs\", StringComparison.OrdinalIgnoreCase)\n            && !x.FilePath.EndsWith(\"cshtml.g.cs\", StringComparison.OrdinalIgnoreCase));\n\n    private static IEnumerable<Diagnostic> VerifyNoExceptionThrown(IEnumerable<Diagnostic> diagnostics) =>\n        diagnostics.Should().NotContain(x => x.Id == AD0001).And.Subject;\n\n    private static IEnumerable<IssueLocationPair> MatchPairs(CompilationIssues actual, CompilationIssues expected)\n    {\n        var ret = new List<IssueLocationPair>();\n        // Process file-level issues before project-level that match to any expected file issue\n        // Then process primary before secondary, so we can update primary.IssueId for the purpose of matching secondary issues correctly.\n        foreach (var key in actual.UniqueKeys().OrderBy(x => x.FilePath == string.Empty ? 1 : 0).ThenBy(x => x.Type))\n        {\n            ret.AddRange(MatchDifferences(actual.Remove(key), expected.Remove(key)));\n        }\n        ret.AddRange(expected.Select(x => new IssueLocationPair(null, x)));\n        return ret;\n    }\n\n    private static IEnumerable<IssueLocationPair> MatchDifferences(List<IssueLocation> actualIssues, List<IssueLocation> expectedIssues)\n    {\n        foreach (var actual in actualIssues.ToArray())  // First round removes all perfect matches, so we don't mismatch possible perfect match by imperfect one on the same line.\n        {\n            var expectedIndex = expectedIssues.IndexOf(actual);\n            if (expectedIndex >= 0)\n            {\n                actual.UpdatePrimaryIssueIdFrom(expectedIssues[expectedIndex]);\n                expectedIssues.RemoveAt(expectedIndex);\n                actualIssues.Remove(actual);\n            }\n        }\n        foreach (var actual in actualIssues)\n        {\n            var expected = expectedIssues\n                .OrderBy(x => actual.IssueId == x.IssueId ? 0 : 1)\n                .ThenBy(x => Math.Abs(actual.Start ?? 0 - x.Start ?? 0))\n                .ThenBy(x => Math.Abs(actual.Length ?? 0 - x.Length ?? 0))\n                .FirstOrDefault();\n            if (expected is not null)\n            {\n                actual.UpdatePrimaryIssueIdFrom(expected);\n                expectedIssues.Remove(expected);\n            }\n            yield return new(actual, expected);\n        }\n        foreach (var expected in expectedIssues)\n        {\n            yield return new(null, expected);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Verification/DiagnosticVerifierException.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text;\nusing SonarAnalyzer.TestFramework.Verification.IssueValidation;\n\nnamespace SonarAnalyzer.TestFramework.Verification;\n\npublic sealed class DiagnosticVerifierException : AssertFailedException\n{\n    private readonly string stackTrace;\n\n    public override string StackTrace => stackTrace;\n\n    internal DiagnosticVerifierException(List<VerificationMessage> messages) : base(messages.Select(x => x.FullDescription).JoinStr(Environment.NewLine))\n    {\n        if (messages.Count == 0)\n        {\n            throw new ArgumentException($\"{nameof(messages)} cannot be empty\", nameof(messages));\n        }\n        var builder = new StringBuilder();\n        foreach (var fileMessages in messages.Where(x => x.ShortDescription is not null && File.Exists(x.FullPath)).GroupBy(x => x.FullPath).OrderBy(x => x.Key))\n        {\n            builder.AppendLine(Path.GetFileName(fileMessages.Key));\n            foreach (var message in fileMessages)\n            {\n                builder.AppendLine($\"at {message.ToInvocation()} in {message.FullPath}:line {message.LineNumber}\");\n            }\n            builder.AppendLine(\"---\");    // Empty lines are not rendered => force it with content\n        }\n        stackTrace = builder.ToString();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Verification/IssueValidation/CompilationIssues.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Collections;\n\nnamespace SonarAnalyzer.TestFramework.Verification.IssueValidation;\n\ninternal sealed class CompilationIssues : IEnumerable<IssueLocation>\n{\n    private readonly List<IssueLocation> issues;\n\n    public CompilationIssues(IEnumerable<FileContent> files)\n        : this(files.SelectMany(x => IssueLocationCollector.ExpectedIssueLocations(x.FileName, x.Content.Lines))) { }\n\n    public CompilationIssues(Diagnostic[] diagnostics)\n        : this(ToIssueLocations(diagnostics)) { }\n\n    public CompilationIssues(IEnumerable<IssueLocation> issues) =>\n        this.issues = issues.ToList();\n\n    public IssueLocationKey[] UniqueKeys() =>\n        issues.Select(x => new IssueLocationKey(x)).Distinct().ToArray();\n\n    public List<IssueLocation> Remove(IssueLocationKey key)\n    {\n        var ret = issues.Where(key.IsMatch).ToList();\n        foreach (var issue in ret)\n        {\n            issues.Remove(issue);\n        }\n        return ret;\n    }\n\n    public void Dump(string languageVersion)\n    {\n        foreach (var file in issues.GroupBy(x => Path.GetFileName(x.FilePath)).OrderBy(x => x.Key))\n        {\n            Console.WriteLine($\"Actual {languageVersion} diagnostics {file.Key}:\");\n            foreach (var issue in file.OrderBy(x => x.LineNumber))\n            {\n                Console.WriteLine($\"    {issue.RuleId}, Line: {issue.LineNumber}, [{issue.Start}, {issue.Length}] {issue.Message}\");\n            }\n        }\n    }\n\n    private static IEnumerable<IssueLocation> ToIssueLocations(Diagnostic[] diagnostics)\n    {\n        var ret = new List<IssueLocation>();\n        foreach (var diagnostic in diagnostics)\n        {\n            var primary = new IssueLocation(diagnostic);\n            ret.Add(primary);\n            for (var i = 0; i < diagnostic.AdditionalLocations.Count; i++)\n            {\n                var secondaryMessage = diagnostic.Properties.TryGetValue(i.ToString(), out var message) ? message : null;\n                ret.Add(new IssueLocation(primary, new SecondaryLocation(diagnostic.AdditionalLocations[i], secondaryMessage)));\n            }\n        }\n        return ret;\n    }\n\n    IEnumerator<IssueLocation> IEnumerable<IssueLocation>.GetEnumerator() =>\n        issues.GetEnumerator();\n\n    [ExcludeFromCodeCoverage]\n    IEnumerator IEnumerable.GetEnumerator() =>\n        issues.GetEnumerator();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Verification/IssueValidation/FileContent.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.TestFramework.Verification.IssueValidation;\n\ninternal sealed class FileContent\n{\n    public string FileName { get; }\n    public SourceText Content { get; }\n\n    public FileContent(string fileName) : this(fileName, SourceText.From(System.IO.File.ReadAllText(fileName))) { }\n\n    public FileContent(SyntaxTree tree) : this(tree.FilePath, tree.GetText()) { }\n\n    private FileContent(string fileName, SourceText content)\n    {\n        FileName = fileName;\n        Content = content;\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Verification/IssueValidation/IssueLocation.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Syntax.Extensions;\nusing HashCode = SonarAnalyzer.Core.Common.HashCode;\n\nnamespace SonarAnalyzer.TestFramework.Verification.IssueValidation;\n\ninternal enum IssueType\n{\n    // Order of these member is important for DiagnosticVerifier.\n    Primary,\n    Secondary,\n    Error\n}\n\n[DebuggerDisplay(\"ID:{RuleId} {Type} @{LineNumber} Start:{Start} Length:{Length} ID:{IssueId} {Message} {FilePath}\")]\ninternal sealed class IssueLocation\n{\n    private string issueId;\n\n    public IssueLocation Primary { get; }   // Only for actual secondary issues\n    public string RuleId { get; }           // Diagnostic ID for actual issues\n    public string FilePath { get; }\n    public int LineNumber { get; }\n    public IssueType Type { get; }\n    public string Message { get; }\n    public string IssueId => Primary?.IssueId ?? issueId;   // Issue location ID to pair primary and secondary locations\n    public int? Start { get; set; }\n    public int? Length { get; set; }\n\n    public IssueLocation(Diagnostic diagnostic)\n        : this(diagnostic.Severity == DiagnosticSeverity.Error ? IssueType.Error : IssueType.Primary, diagnostic.Id, diagnostic.GetMessage(), diagnostic.Location, diagnostic.Location.GetLineSpan()) =>\n        issueId = diagnostic.Severity == DiagnosticSeverity.Error ? diagnostic.Id : null;   // Error [CS1001] should assert that expected issueId matches the actual RuleId\n\n    public IssueLocation(IssueLocation primary, SecondaryLocation secondary) : this(IssueType.Secondary, primary.RuleId, secondary.Message, secondary.Location, secondary.Location.GetLineSpan()) =>\n        Primary = primary;\n\n    public IssueLocation(IssueType type, string filePath, int lineNumber, string message, string issueId, int? start, int? length, string ruleId = null)\n    {\n        Type = type;\n        FilePath = filePath;\n        LineNumber = lineNumber;\n        Message = message;\n        this.issueId = issueId;\n        Start = start;\n        Length = length;\n        RuleId = ruleId;\n    }\n\n    private IssueLocation(IssueType type, string ruleId, string message, Location location, FileLinePositionSpan span)\n        : this(type, span.Path ?? string.Empty, location.LineNumberToReport(), message ?? string.Empty, null, span.StartLinePosition.Character, location.SourceSpan.Length, ruleId) { }\n\n    public void UpdatePrimaryIssueIdFrom(IssueLocation expected)\n    {\n        if (Type == IssueType.Primary)\n        {\n            issueId = expected.IssueId;  // Let actual secondary issues find issueId of their expected primary via secondaryIssue.Primary.IssueId\n        }\n    }\n\n    public override int GetHashCode() =>\n        HashCode.Combine(FilePath.GetHashCode(), LineNumber, Type);\n\n    public override bool Equals(object obj) =>\n        obj is IssueLocation issue\n        && (issue.FilePath == string.Empty || FilePath == string.Empty || issue.FilePath == FilePath)\n        && issue.LineNumber == LineNumber\n        && issue.Type == Type\n        && (Type == IssueType.Primary || issue.IssueId == IssueId)   // We ignore issueId for primary issues, as we need to match them only for secondary\n        && EqualOrNull(issue.RuleId, RuleId)\n        && EqualOrNull(issue.Message, Message)\n        && EqualOrNull(issue.Start, Start)\n        && EqualOrNull(issue.Length, Length);\n\n    private static bool EqualOrNull(string first, string second) =>\n        first is null || second is null || first == second;\n\n    private static bool EqualOrNull(int? first, int? second) =>\n        first is null || second is null || first == second;\n}\n\n[DebuggerDisplay(\"{Type} @{LineNumber} {FilePath}\")]\ninternal record IssueLocationKey(IssueType Type, string FilePath, int LineNumber)\n{\n    public IssueLocationKey(IssueLocation issue) : this(issue.Type, issue.FilePath, issue.LineNumber) { }\n\n    public bool IsMatch(IssueLocation issue) =>\n        (FilePath == string.Empty || FilePath == issue.FilePath)\n        && issue.LineNumber == LineNumber\n        && issue.Type == Type;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Verification/IssueValidation/IssueLocationCollector.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text.RegularExpressions;\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.TestFramework.Verification.IssueValidation;\n\n/// <summary>\n/// See <see href=\"https://github.com/SonarSource/sonar-dotnet/blob/master/docs/verifier-syntax.md\">docs/verifier-syntax.md</see> for a comprehensive documentation of the verifier syntax.\n/// </summary>\ninternal static class IssueLocationCollector\n{\n    private const string IssueTypeGroup = \"IssueType\";\n    private const string CommentPattern = @\"(?<Comment>//|'|<!--|/\\*|@\\*)\";\n    private const string PrecisePositionPattern = @\"\\s*(?<Position>\\^+)(\\s+(?<Invalid>\\^+))*\";\n    private const string NoPrecisePositionPattern = @\"(?<!\\s*\\^+\\s)\";\n    private const string IssueTypePattern = @$\"\\s*(?<{IssueTypeGroup}>Noncompliant|Secondary|Error)\";\n    private const string OffsetPattern = @\"(\\s*@(?<Offset>[+-]?\\d+))?\";\n    private const string ExactColumnPattern = @\"(\\s*\\^(?<ColumnStart>\\d+)#(?<Length>\\d+))?\";\n    private const string IssueIdsPattern = @\"(\\s*\\[(?<IssueIds>[^]]+)\\])?\";\n    private const string MessagePattern = @\"(\\s*\\{\\{(?<Message>.+)\\}\\})?\";\n    private const string NotePattern = @\"(?<Note>.*)$\";\n    private const string InvalidNote = @\"(?<Invalid>({|}|@|\\^|#\\d+|Noncompliant|Secondary))\";\n\n    public static readonly Regex RxIssue = CreateRegex($\"{CommentPattern}{NoPrecisePositionPattern}{IssueTypePattern}{OffsetPattern}{ExactColumnPattern}{IssueIdsPattern}{MessagePattern}{NotePattern}\");\n    public static readonly Regex RxPreciseLocation = CreateRegex(@$\"^\\s*{CommentPattern}{PrecisePositionPattern}{IssueTypePattern}?{OffsetPattern}{IssueIdsPattern}{MessagePattern}{NotePattern}\");\n    private static readonly Regex RxInvalidType = CreateRegex($\"{CommentPattern}.*{IssueTypePattern}\");\n    private static readonly Regex RxInvalidPreciseLocation = CreateRegex(@$\"^\\s*{CommentPattern}.*{PrecisePositionPattern}\");\n    private static readonly Regex RxInvalidNote = CreateRegex(InvalidNote, RegexOptions.IgnoreCase);\n\n    public static IList<IssueLocation> ExpectedIssueLocations(string filePath, IEnumerable<TextLine> lines)\n    {\n        var preciseLocations = new List<IssueLocation>();\n        var locations = new List<IssueLocation>();\n        foreach (var line in lines)\n        {\n            var newPreciseLocations = FindPreciseIssueLocations(filePath, line).ToList();\n            if (newPreciseLocations.Any())\n            {\n                preciseLocations.AddRange(newPreciseLocations);\n            }\n            else if (FindIssueLocations(filePath, line).ToList() is var newLocations && newLocations.Any())\n            {\n                locations.AddRange(newLocations);\n            }\n            else\n            {\n                EnsureNoInvalidFormat(filePath, line);\n            }\n        }\n        return EnsureNoDuplicatedPrimaryIds(MergeLocations(locations.ToArray(), preciseLocations.ToList()));\n    }\n\n    internal static /* for testing */ IList<IssueLocation> MergeLocations(IssueLocation[] locations, List<IssueLocation> preciseLocations)\n    {\n        foreach (var location in locations)\n        {\n            var preciseLocationsOnSameLine = preciseLocations.Where(x => x.LineNumber == location.LineNumber).ToList();\n            if (preciseLocationsOnSameLine.Count > 1)\n            {\n                throw UnexpectedPreciseLocationCount(preciseLocationsOnSameLine.Count, preciseLocationsOnSameLine[0].LineNumber);\n            }\n\n            if (preciseLocationsOnSameLine.SingleOrDefault() is { } preciseLocation)\n            {\n                if (location.Start.HasValue)\n                {\n                    throw new InvalidOperationException($\"Unexpected redundant issue location on line {location.LineNumber}. Issue location can be set either with 'precise issue location' or 'exact column location' pattern but not both.\");\n                }\n                location.Start = preciseLocation.Start;\n                location.Length = preciseLocation.Length;\n                preciseLocations.Remove(preciseLocation);\n            }\n        }\n        return locations.Concat(preciseLocations).ToList();\n    }\n\n    internal static /* for testing */ IEnumerable<IssueLocation> FindIssueLocations(string filePath, TextLine line)\n    {\n        var match = RxIssue.Match(line.ToString());\n        if (match.Success)\n        {\n            ValidateNote(filePath, line, match);\n            return CreateIssueLocations(match, filePath, line.LineNumber + 1);\n        }\n        return [];\n    }\n\n    internal static /* for testing */ IEnumerable<IssueLocation> FindPreciseIssueLocations(string filePath, TextLine line)\n    {\n        var match = RxPreciseLocation.Match(line.ToString());\n        if (match.Success)\n        {\n            ValidateNote(filePath, line, match);\n            return CreateIssueLocations(match, filePath, line.LineNumber);\n        }\n\n        return [];\n    }\n\n    private static IEnumerable<IssueLocation> CreateIssueLocations(Match match, string filePath, int originalLineNumber)\n    {\n        var lineNumber = originalLineNumber + Offset();\n        var type = Type();\n        var message = Message();\n        var start = Start() ?? ColumnStart();\n        var length = Length() ?? ColumnLength();\n        var invalid = match.Groups[\"Invalid\"];\n        return invalid.Success\n            ? throw UnexpectedPreciseLocationCount(invalid.Captures.Count + 1, lineNumber)\n            : IssueIds().Select(x => new IssueLocation(type, filePath, lineNumber, message, x, start, length));\n\n        int? Start() =>\n            Group(\"Position\")?.Index;\n\n        int? Length() =>\n            Group(\"Position\")?.Length;\n\n        int? ColumnStart() =>\n            Group(\"ColumnStart\") is { } columnStart ? (int?)int.Parse(columnStart.Value) - 1 : null;\n\n        int? ColumnLength() =>\n            Group(\"Length\") is { } length ? int.Parse(length.Value) : null;\n\n        IssueType Type() =>\n            match.Groups[IssueTypeGroup] switch\n            {\n                { Success: false } => IssueType.Primary,\n                { Value: \"Noncompliant\" } => IssueType.Primary,\n                { Value: \"Secondary\" } => IssueType.Secondary,\n                { Value: \"Error\" } => IssueType.Error,\n                _ => throw new UnexpectedValueException(IssueTypeGroup, match.Groups[IssueTypeGroup].Value)\n            };\n\n        string Message() =>\n            Group(\"Message\")?.Value;\n\n        int Offset() =>\n            Group(\"Offset\") is { } offset ? int.Parse(offset.Value) : 0;\n\n        IEnumerable<string> IssueIds() =>\n            Group(\"IssueIds\") is { } issueIds\n                ? issueIds.Value.Split(',').Select(x => x.Trim()).Where(x => !string.IsNullOrEmpty(x)).OrderBy(x => x)\n                : new string[] { null }; // We have a single issue without ID even if the group did not match\n\n        Group Group(string name) =>\n            match.Groups[name] is { Success: true } group ? group : null;\n    }\n\n    private static void EnsureNoInvalidFormat(string filePath, TextLine line)\n    {\n        var value = line.ToString();\n        var match = RxInvalidType.Match(value);\n        if (match.Success)\n        {\n            var type = match.Groups[IssueTypeGroup].Value;\n            throw new InvalidOperationException($\"\"\"\n                {Path.GetFileName(filePath)} line {line.LineNumber} contains '// ... {type}' comment, but it is not recognized as one of the expected patterns.\n                Either remove the '{type}' word or fix the pattern.\n                \"\"\");\n        }\n        else if (RxInvalidPreciseLocation.IsMatch(value))\n        {\n            throw new InvalidOperationException($\"\"\"\n                {Path.GetFileName(filePath)} line {line.LineNumber} looks like it contains comment for precise location '^^'.\n                Either remove the precise pattern '^^' from the comment, or fix the pattern.\n                \"\"\");\n        }\n    }\n\n    private static IList<IssueLocation> EnsureNoDuplicatedPrimaryIds(IList<IssueLocation> mergedLocations)\n    {\n        var duplicateLocationsIds = mergedLocations\n            .Where(x => x.Type == IssueType.Primary && x.IssueId is not null)\n            .GroupBy(x => x.IssueId)\n            .FirstOrDefault(x => x.Count() > 1);\n        if (duplicateLocationsIds is not null)\n        {\n            var duplicatedIdLines = duplicateLocationsIds.Select(x => x.LineNumber).JoinStr(\", \");\n            throw new InvalidOperationException($\"Primary location with id [{duplicateLocationsIds.Key}] found on multiple lines: {duplicatedIdLines}\");\n        }\n        return mergedLocations;\n    }\n\n    private static void ValidateNote(string filePath, TextLine line, Match match)\n    {\n        var note = match.Groups[\"Note\"].Value;\n        if (note.EndsWith(\"*@\"))    // Razor token for end of comment should not checked against invalid @-1\n        {\n            note = note.Substring(0, note.Length - 2);\n        }\n        if (RxInvalidNote.Match(note) is { Success: true } invalidMatch)\n        {\n            var fullDescription = $$$\"\"\"\n                Unexpected '{{{invalidMatch.Groups[\"Invalid\"].Value}}}' is used after the recognized issue pattern. Remove it, or fix the pattern to the valid format:\n                // ^^^^ (Noncompliant|Secondary|Error) ^1#10 [issue-id1, issue-id2] {{Expected message.}} Final note without significant special characters\n                \"\"\";\n            throw new DiagnosticVerifierException([new VerificationMessage(\"Unexpected Format\", fullDescription, filePath, line.LineNumber + 1)]);\n        }\n    }\n\n    private static Exception UnexpectedPreciseLocationCount(int count, int line) =>\n        new InvalidOperationException($$$\"\"\"\n            Expecting only one precise location per line, found {{{count}}} on line {{{line}}}. If you want to specify more than one precise location per line you need to omit the Noncompliant comment:\n            internal class MyClass : IInterface1 // there should be no Noncompliant comment\n            ^^^^^^^^ {{Do not create internal classes.}}\n                                     ^^^^^^^^^^^ @-1 {{IInterface1 is bad for your health.}}\n            \"\"\");\n\n    private static Regex CreateRegex(string pattern, RegexOptions options = RegexOptions.None) =>\n        new(pattern, options, Constants.DefaultRegexTimeout); // Do NOT use Compiled, it slowed down the execution by 37%\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Verification/IssueValidation/IssueLocationPair.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Text;\n\nnamespace SonarAnalyzer.TestFramework.Verification.IssueValidation;\n\ninternal sealed record IssueLocationPair(IssueLocation Actual, IssueLocation Expected)\n{\n    public string FilePath => Actual?.FilePath ?? Expected.FilePath;\n    public int LineNumber => Actual?.LineNumber ?? Expected.LineNumber;\n    public IssueType Type => Actual?.Type ?? Expected.Type;\n    public int? Start => Actual?.Start ?? Expected.Start;\n    public string IssueId => Actual?.IssueId ?? Expected?.IssueId;\n    public string RuleId => Actual?.RuleId ?? Expected.RuleId;\n\n    public VerificationMessage CreateMessage()\n    {\n        if (Actual is not null && Expected is not null && !new IssueLocationKey(Actual).IsMatch(Expected))\n        {\n            throw new InvalidOperationException(\"Something went horribly wrong. This is supposed to be called only for issues with the same key.\");\n        }\n        var builder = new StringBuilder();\n        var (concise, detailed) = AssertionMessage();\n        builder.Append(\"  Line \").Append(LineNumber);\n        if ((Actual?.Type ?? Expected.Type) == IssueType.Secondary)\n        {\n            builder.Append(\" Secondary location\");\n        }\n        builder.Append(\": \").Append(detailed);\n        if (Type != IssueType.Error)\n        {\n            if (Actual?.RuleId is not null)\n            {\n                builder.Append(\" Rule \").Append(Actual.RuleId);\n            }\n            if ((Actual?.IssueId ?? Expected?.IssueId) is { } issueId)\n            {\n                builder.Append(\" ID \").Append(issueId);\n            }\n        }\n        return new($\"{Type} {concise}\", builder.ToString(), FilePath, LineNumber);\n    }\n\n    private Message AssertionMessage()\n    {\n        if (Actual is null)\n        {\n            return new(\"Missing\", MissingMessage());\n        }\n        else if (Expected is null)\n        {\n            return new(\"Unexpected\", UnexpectedMessage());\n        }\n        else if (Expected.IssueId != Actual.IssueId)\n        {\n            return new(\"Different ID\", $\"The expected issueId '{Expected.IssueId}' does not match the actual issueId '{Actual.IssueId}'\");\n        }\n        else if (Expected.Message is not null && Actual.Message != Expected.Message)\n        {\n            return new(\"Different Message\", $\"The expected message '{Expected.Message}' does not match the actual message '{Actual.Message}'\");\n        }\n        else if (Expected.Start.HasValue && Actual.Start != Expected.Start)\n        {\n            return new(\"Different Location\", $\"Should start on column {Expected.Start} but got column {Actual.Start}\");\n        }\n        else if (Expected.Length.HasValue && Actual.Length != Expected.Length)\n        {\n            return new(\"Different Length\", $\"Should have a length of {Expected.Length} but got a length of {Actual.Length}\");\n        }\n        else\n        {\n            throw new InvalidOperationException(\"Something went wrong. This is not supposed to be called for same issues.\");\n        }\n    }\n\n    private string MissingMessage() =>\n        Expected.Message is null\n            ? \"Missing expected issue\"\n            : $\"Missing expected issue '{Expected.Message}'\";\n\n    private string UnexpectedMessage()\n    {\n        var comment = FilePath.EndsWith(\".vb\", StringComparison.InvariantCultureIgnoreCase) ? \"'\" : \"//\";\n        return Actual.Type == IssueType.Error\n            ? $\"Unexpected error, use {comment} Error [{Actual.RuleId}] {Actual.Message}\"   // We don't want to assert the precise {{Message}}\n            : $\"Unexpected issue '{Actual.Message}'\";\n    }\n\n    private readonly record struct Message(string Concise, string Detailed);\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Verification/IssueValidation/VerificationMessage.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.TestFramework.Verification.IssueValidation;\n\ninternal sealed record VerificationMessage(string ShortDescription, string FullDescription, string FilePath, int LineNumber)\n{\n    public static readonly VerificationMessage EmptyLine = new(null, null, null, 0);\n\n    public string FullPath => Paths.CurrentTestCases() is { } testCases ? Path.Combine(testCases, FilePath) : null;\n\n    public string ToInvocation()\n    {\n        // VS can process \"at What Ever in C:\\...\".\n        // Rider needs    \"at What.Ever() in C:\\...\" to make it clickable.\n        if (!ShortDescription.Contains(' '))\n        {\n            throw new InvalidOperationException(\"Short description must contain space for Rider to display clickable link.\"); // We'll change it to dot: \"What Ever\" -> \"What.Ever()\"\n        }\n        return ShortDescription.Replace(' ', '.') + \"()\";\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Verification/SuppressionHandler.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Collections.Concurrent;\nusing System.Reflection;\nusing SonarAnalyzer.Core.AnalysisContext;\n\nnamespace SonarAnalyzer.TestFramework.Verification;\n\npublic static class SuppressionHandler\n{\n    private static readonly ConcurrentDictionary<string, int> Counters = new();\n    private static readonly PropertyInfo[] ShouldDiagnosticBeReportedProperties = LoadProperties();\n\n    public static void HookSuppression()\n    {\n        var handler = HandleShouldDiagnosticBeReported;\n        foreach (var property in ShouldDiagnosticBeReportedProperties)\n        {\n            property.SetValue(null, handler);\n        }\n    }\n\n    public static void UnHookSuppression()\n    {\n        foreach (var property in ShouldDiagnosticBeReportedProperties)\n        {\n            property.SetValue(null, null);\n        }\n    }\n\n    public static void IncrementReportCount(string ruleId) =>\n        Counters.AddOrUpdate(ruleId, _ => 1, (_, count) => count + 1);\n\n    public static bool ExtensionMethodsCalledForAllDiagnostics(IEnumerable<DiagnosticAnalyzer> analyzers) =>\n        // In general this check is not very precise, because when the tests are run in parallel\n        // we cannot determine which diagnostic was reported from which analyzer instance. In other\n        // words, we cannot distinguish between diagnostics reported from different tests. That's\n        // why we require each diagnostic to be reported through the extension methods at least once.\n        analyzers.SelectMany(x => x.SupportedDiagnostics).Any(x => Counters.TryGetValue(x.Id, out var count) && count > 0);\n\n    private static bool HandleShouldDiagnosticBeReported(SyntaxTree tree, Diagnostic diagnostic)\n    {\n        IncrementReportCount(diagnostic.Id);\n        return true;\n    }\n\n    // We need to do this dynamically, becuase during UT run for SonarAnalyzer.CSharp.Styling.Test, there are two separate static classes SonarAnalysisContext:\n    // - Public SonarAnalysisContext from TestFramework's dependency on SonarAnalyzer.Common, that is accessed by this supression class.\n    // - Internal SonarAnalysisContext from ILMerged Internal.SonarAnalyzer.CSharp.Styling.dll, that is accessed by ReportIssue logic and is actually invoked.\n    private static PropertyInfo[] LoadProperties() =>\n        AppDomain.CurrentDomain.GetAssemblies()\n            .Where(x => x.FullName.Contains(nameof(SonarAnalyzer)))\n            .SelectMany(x => x.GetTypes())\n            .Where(x => x.Name == nameof(SonarAnalysisContext))\n            .Select(x => x.GetProperty(nameof(SonarAnalysisContext.ShouldDiagnosticBeReported)))\n            .ToArray();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Verification/Verifier.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.Reflection;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing Google.Protobuf;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing SonarAnalyzer.Core.Rules;\nusing SonarAnalyzer.TestFramework.Build;\nusing CS = Microsoft.CodeAnalysis.CSharp;\nusing VB = Microsoft.CodeAnalysis.VisualBasic;\n\nnamespace SonarAnalyzer.TestFramework.Verification;\n\ninternal class Verifier\n{\n    private const string TestCases = \"TestCases\";\n\n    private static readonly Regex ImportsRegexVB = new(@\"^\\s*Imports\\s+.+$\", RegexOptions.Multiline | RegexOptions.RightToLeft, Constants.DefaultRegexTimeout);\n    private readonly VerifierBuilder builder;\n    private readonly DiagnosticAnalyzer[] analyzers;\n    private readonly SonarCodeFix codeFix;\n    private readonly AnalyzerLanguage language;\n    private readonly string[] onlyDiagnosticIds;\n    private readonly string[] razorFilePaths;\n\n    public Verifier(VerifierBuilder builder)\n    {\n        this.builder = builder ?? throw new ArgumentNullException(nameof(builder));\n        onlyDiagnosticIds = builder.OnlyDiagnostics.Select(x => x.Id).ToArray();\n        analyzers = builder.Analyzers.Select(x => x()).ToArray();\n        if (!analyzers.Any())\n        {\n            throw new ArgumentException($\"{nameof(builder.Analyzers)} cannot be empty. Use {nameof(VerifierBuilder)}<TAnalyzer> instead or add at least one analyzer using {nameof(builder)}.{nameof(builder.AddAnalyzer)}().\");\n        }\n        if (Array.Exists(analyzers, x => x is null))\n        {\n            throw new ArgumentException(\"Analyzer instance cannot be null.\");\n        }\n        var allLanguages = analyzers.SelectMany(x => x.GetType().GetCustomAttributes<DiagnosticAnalyzerAttribute>()).SelectMany(x => x.Languages).Distinct().ToArray();\n        if (allLanguages.Length > 1)\n        {\n            throw new ArgumentException($\"All {nameof(builder.Analyzers)} must declare the same language in their DiagnosticAnalyzerAttribute.\");\n        }\n        if (builder.TargetFrameworks == TargetFrameworks.None)\n        {\n            throw new ArgumentException($\"{nameof(TargetFrameworks)} cannot be {nameof(TargetFrameworks.None)}.\");\n        }\n        language = AnalyzerLanguage.FromName(allLanguages.Single());\n        if (!builder.Paths.Any() && !builder.Snippets.Any())\n        {\n            throw new ArgumentException($\"{nameof(builder.Paths)} cannot be empty. Add at least one file using {nameof(builder)}.{nameof(builder.AddPaths)}() or {nameof(builder.AddSnippet)}().\");\n        }\n        foreach (var path in builder.Paths)\n        {\n            ValidateExtension(path);\n        }\n        if (builder.ProtobufPath is not null)\n        {\n            ValidateSingleAnalyzer(nameof(builder.ProtobufPath));\n            if (analyzers.Single() is not UtilityAnalyzerBase)\n            {\n                throw new ArgumentException($\"{analyzers.Single().GetType().Name} does not inherit from {nameof(UtilityAnalyzerBase)}.\");\n            }\n        }\n        if (builder.CodeFix is not null)\n        {\n            codeFix = builder.CodeFix();\n            ValidateCodeFix();\n        }\n        razorFilePaths = builder.Paths\n            .Select(TestCasePath)\n            .Where(IsRazorOrCshtml)\n            .Concat(builder.Snippets.Where(x => IsRazorOrCshtml(x.FileName)).Select(x =>\n                {\n                    var tempFilePath = Path.Combine(Directory.GetCurrentDirectory(), \"TestCases\", x.FileName);\n                    // Source snippets need to be on disk for DiagnosticVerifier.Verify to work.\n                    // If this becomes unnecessary, adding source snippets should be reworked to align it with adding content snippets.\n                    File.WriteAllText(tempFilePath, x.Content);\n                    return tempFilePath;\n                }))\n            .ToArray();\n        // Fail early for TFMs, there's no way these can be fixed before calling VerifyXxx()\n        ProcessTargetFramework();\n#if NETFRAMEWORK\n        ProcessLanguageVersions();\n#endif\n    }\n\n    public void Verify()    // This should never have any arguments\n    {\n        if (codeFix is not null)\n        {\n            throw new InvalidOperationException($\"Cannot use {nameof(Verify)} with {nameof(builder.CodeFix)} set.\");\n        }\n        var numberOfIssues = Compile(builder.ConcurrentAnalysis)\n            .Sum(x => DiagnosticVerifier.Verify(\n                        x.Compilation,\n                        analyzers,\n                        builder.ErrorBehavior,\n                        builder.AdditionalFilePath,\n                        onlyDiagnosticIds,\n                        razorFilePaths.Concat(x.AdditionalSourceFiles ?? []).ToArray(),\n                        builder.ConcurrentAnalysis,\n                        builder.WarningsAsErrors.ToArray()));\n        numberOfIssues.Should().BeGreaterThan(0, $\"otherwise you should use '{nameof(VerifyNoIssues)}' instead\");\n    }\n\n    public void VerifyNoIssues()    // This should never have any arguments\n    {\n        foreach (var compilation in Compile(builder.ConcurrentAnalysis))\n        {\n            foreach (var analyzer in analyzers)\n            {\n                DiagnosticVerifier.VerifyNoIssues(compilation.Compilation, analyzer, builder.ErrorBehavior, builder.AdditionalFilePath, onlyDiagnosticIds);\n            }\n        }\n    }\n\n    public void VerifyNoAD0001()    // This should never have any arguments\n    {\n        foreach (var compilation in Compile(builder.ConcurrentAnalysis))\n        {\n            foreach (var analyzer in analyzers)\n            {\n                DiagnosticVerifier.AnalyzerExceptions(compilation.Compilation, analyzer).Should().BeEmpty();\n            }\n        }\n    }\n\n    public void VerifyNoIssuesIgnoreErrors()    // This should never have any arguments\n    {\n        foreach (var compilation in Compile(builder.ConcurrentAnalysis))\n        {\n            foreach (var analyzer in analyzers)\n            {\n                DiagnosticVerifier.VerifyNoIssuesIgnoreErrors(compilation.Compilation, analyzer, builder.ErrorBehavior, builder.AdditionalFilePath, onlyDiagnosticIds);\n            }\n        }\n    }\n\n    public void VerifyCodeFix()     // This should never have any arguments\n    {\n        _ = codeFix ?? throw new InvalidOperationException($\"{nameof(builder.CodeFix)} was not set.\");\n        var document = CreateProject(false).FindDocument(Path.Combine(builder.BasePath ?? string.Empty, Path.GetFileName(builder.Paths.Single())));\n        var codeFixVerifier = new CodeFixVerifier(analyzers.Single(), codeFix, document, builder.CodeFixTitle);\n        var fixAllProvider = codeFix.GetFixAllProvider();\n        foreach (var parseOptions in builder.ParseOptions.OrDefault(language.LanguageName))\n        {\n            codeFixVerifier.VerifyWhileDocumentChanges(parseOptions, TestCasePath(builder.CodeFixedPath));\n            if (fixAllProvider is not null)\n            {\n                codeFixVerifier.VerifyFixAllProvider(fixAllProvider, parseOptions, TestCasePath(builder.CodeFixedPathBatch ?? builder.CodeFixedPath));\n            }\n        }\n    }\n\n    public void VerifyUtilityAnalyzerProducesEmptyProtobuf()     // This should never have any arguments\n    {\n        foreach (var compilation in Compile(false))\n        {\n            DiagnosticVerifier.Verify(compilation.Compilation, analyzers, CompilationErrorBehavior.Default, builder.AdditionalFilePath, [], []);\n            new FileInfo(builder.ProtobufPath).Length.Should().Be(0, \"protobuf file should be empty\");\n        }\n    }\n\n    public void VerifyUtilityAnalyzer<TMessage>(Action<IReadOnlyList<TMessage>> verifyProtobuf)\n        where TMessage : IMessage<TMessage>, new()\n    {\n        foreach (var compilation in Compile(false))\n        {\n            DiagnosticVerifier.Verify(compilation.Compilation, analyzers, CompilationErrorBehavior.Default, builder.AdditionalFilePath, [], []);\n            verifyProtobuf(ReadProtobuf().ToList());\n        }\n\n        IEnumerable<TMessage> ReadProtobuf()\n        {\n            using var input = File.OpenRead(builder.ProtobufPath);\n            var parser = new MessageParser<TMessage>(() => new TMessage());\n            while (input.Position < input.Length)\n            {\n                yield return parser.ParseDelimitedFrom(input);\n            }\n        }\n    }\n\n    public IEnumerable<CompilationData> Compile(bool concurrentAnalysis) =>\n        CreateProject(concurrentAnalysis).Solution.Compile(builder.ParseOptions.ToArray()).Select(x => new CompilationData(x, builder.AdditionalSourceFiles.ToArray()));\n\n    private ProjectBuilder CreateProject(bool concurrentAnalysis)\n    {\n        var paths = builder.Paths.Select(TestCasePath).ToList();\n        var sourceFilePaths = paths.Except(razorFilePaths).ToArray();\n        var sourceSnippets = builder.Snippets.Where(x => !IsRazorOrCshtml(x.FileName)).ToArray();\n        var editorConfigGenerator = new EditorConfigGenerator(Directory.GetCurrentDirectory());\n        var hasRazorFiles = razorFilePaths.Length > 0;\n        concurrentAnalysis = !hasRazorFiles && concurrentAnalysis; // Concurrent analysis is not supported for Razor or cshtml files due to namespace issues\n        var concurrentSourceFiles = concurrentAnalysis && builder.AutogenerateConcurrentFiles ? CreateConcurrencyTest(sourceFilePaths) : [];\n        var projectBuilder = SolutionBuilder.Create()\n            .AddProject(language, builder.OutputKind)\n            .AddSnippets(sourceSnippets)\n            .AddDocuments(sourceFilePaths)\n            .AddDocuments(concurrentSourceFiles)\n            .AddReferences(builder.References);\n        if (builder.CompilationOptionsCustomization is not null)\n        {\n            projectBuilder = ProjectBuilder.FromProject(projectBuilder.Project.WithCompilationOptions(builder.CompilationOptionsCustomization(projectBuilder.Project.CompilationOptions)));\n        }\n        if (hasRazorFiles)\n        {\n            projectBuilder = projectBuilder\n                .AddAdditionalDocuments(razorFilePaths)\n                .AddReferences(NuGetMetadataReference.MicrosoftAspNetCoreAppRef(\"7.0.17\"))\n                .AddReferences(NuGetMetadataReference.SystemTextEncodingsWeb(\"7.0.0\"))\n                .AddAnalyzerReferences(SdkPathProvider.SourceGenerators)\n                .AddAnalyzerConfigDocument(\n                    Path.Combine(Directory.GetCurrentDirectory(), \".editorconfig\"),\n                    editorConfigGenerator.Generate(razorFilePaths));\n        }\n        return projectBuilder;\n    }\n\n    private IEnumerable<string> CreateConcurrencyTest(IEnumerable<string> paths)\n    {\n        foreach (var path in paths)\n        {\n            var newPath = Path.ChangeExtension(path, \".Concurrent\" + Path.GetExtension(path));\n            var content = File.ReadAllText(path, Encoding.UTF8);\n            File.WriteAllText(newPath, InsertConcurrentNamespace(content));\n            yield return newPath;\n        }\n    }\n\n    private string InsertConcurrentNamespace(string content)\n    {\n        return language.LanguageName switch\n        {\n            LanguageNames.CSharp => $\"namespace AppendedNamespaceForConcurrencyTest {{ {content} {Environment.NewLine}}}\",  // Last line can be a comment\n            LanguageNames.VisualBasic => content.Insert(ImportsIndexVB(), \"Namespace AppendedNamespaceForConcurrencyTest : \") + Environment.NewLine + \" : End Namespace\",\n            _ => throw new UnexpectedLanguageException(language)\n        };\n\n        int ImportsIndexVB() =>\n            ImportsRegexVB.Match(content) is { Success: true } match ? match.Index + match.Length + 1 : 0;\n    }\n\n    private string TestCaseDirectory() =>\n        Path.GetFullPath(builder.BasePath is null ? TestCases : Path.Combine(TestCases, builder.BasePath));\n\n    private string TestCasePath(string fileName) =>\n        Path.Combine(TestCaseDirectory(), fileName);\n\n    private void ValidateSingleAnalyzer(string propertyName)\n    {\n        if (builder.Analyzers.Length != 1)\n        {\n            throw new ArgumentException($\"When {propertyName} is set, {nameof(builder.Analyzers)} must contain only 1 analyzer, but {analyzers.Length} were found.\");\n        }\n    }\n\n    private void ValidateExtension(string path)\n    {\n        if (!Path.GetExtension(path).Equals(language.FileExtension, StringComparison.OrdinalIgnoreCase) && !IsRazorOrCshtml(path))\n        {\n            throw new ArgumentException($\"Path '{path}' doesn't match {language.LanguageName} file extension '{language.FileExtension}'.\");\n        }\n    }\n\n    private void ValidateCodeFix()\n    {\n        _ = builder.CodeFixedPath ?? throw new ArgumentException($\"{nameof(builder.CodeFixedPath)} was not set.\");\n        ValidateSingleAnalyzer(nameof(builder.CodeFix));\n        if (builder.Paths.Length != 1)\n        {\n            throw new ArgumentException($\"{nameof(builder.Paths)} must contain only 1 file, but {builder.Paths.Length} were found.\");\n        }\n        if (builder.Snippets.Any())\n        {\n            throw new ArgumentException($\"{nameof(builder.Snippets)} must be empty when {nameof(builder.CodeFix)} is set.\");\n        }\n        ValidateExtension(builder.CodeFixedPath);\n        if (builder.CodeFixedPathBatch is not null)\n        {\n            ValidateExtension(builder.CodeFixedPathBatch);\n        }\n        if (codeFix.GetType().GetCustomAttribute<ExportCodeFixProviderAttribute>() is { } codeFixAttribute)\n        {\n            if (codeFixAttribute.Languages.Single() != language.LanguageName)\n            {\n                throw new ArgumentException($\"{analyzers.Single().GetType().Name} language {language.LanguageName} does not match {codeFix.GetType().Name} language.\");\n            }\n        }\n        else\n        {\n            throw new ArgumentException($\"{codeFix.GetType().Name} does not have {nameof(ExportCodeFixProviderAttribute)}.\");\n        }\n        if (!analyzers.Single().SupportedDiagnostics.Select(x => x.Id).Intersect(codeFix.FixableDiagnosticIds).Any())\n        {\n            throw new ArgumentException($\"{analyzers.Single().GetType().Name} does not support diagnostics fixable by the {codeFix.GetType().Name}.\");\n        }\n    }\n\n    private static bool IsRazorOrCshtml(string path) =>\n        Path.GetExtension(path) is { } extension\n        && (extension.Equals(\".razor\", StringComparison.OrdinalIgnoreCase) || extension.Equals(\".cshtml\", StringComparison.OrdinalIgnoreCase));\n\n    private void ProcessTargetFramework()\n    {\n#if NET\n        CheckTargetFramework(TargetFrameworks.Net);\n#else\n        CheckTargetFramework(TargetFrameworks.NetFramework);\n#endif\n\n        void CheckTargetFramework(TargetFrameworks current)\n        {\n            if ((builder.TargetFrameworks & current) == 0)\n            {\n                Assert.Inconclusive($\"This test should run only under {builder.TargetFrameworks}. Current framework is {current}.\");\n            }\n        }\n    }\n\n#if NETFRAMEWORK\n\n    private void ProcessLanguageVersions()\n    {\n        // Project targeting the latest .NET always runs for latest language versions\n        if (!builder.ParseOptions.IsEmpty && TooHighVersion() is { } languageVersion)\n        {\n            if ((builder.TargetFrameworks & TargetFrameworks.Net) == 0) // The test would never run\n            {\n                Assert.Fail($\"{languageVersion} can only be tested under the .NET build of this project, but {nameof(builder.TargetFrameworks)} is only set to {builder.TargetFrameworks}.\");\n            }\n            else\n            {\n                Assert.Inconclusive($\"{languageVersion} can only be tested under the .NET build of this project.\");\n            }\n        }\n\n        string TooHighVersion() =>\n            language.LanguageName switch\n            {\n                LanguageNames.CSharp =>\n                    builder.ParseOptions.Cast<CS.CSharpParseOptions>().Min(x => x.LanguageVersion) is var minVersionCS\n                    && minVersionCS >= CS.LanguageVersion.CSharp8\n                        ? minVersionCS.ToString()\n                        : null,\n                LanguageNames.VisualBasic =>\n                    builder.ParseOptions.Cast<VB.VisualBasicParseOptions>().Min(x => x.LanguageVersion) is var minVersionVB\n                    && minVersionVB >= VB.LanguageVersion.VisualBasic14\n                        ? minVersionVB.ToString()\n                        : null,\n                _ => throw new UnexpectedLanguageException(language)\n            };\n    }\n\n#endif\n\n    public sealed record CompilationData(Compilation Compilation, string[] AdditionalSourceFiles);\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/Verification/VerifierBuilder.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Google.Protobuf;\nusing SonarAnalyzer.TestFramework.Build;\nusing CS = Microsoft.CodeAnalysis.CSharp;\nusing VB = Microsoft.CodeAnalysis.VisualBasic;\n\nnamespace SonarAnalyzer.TestFramework.Verification;\n\n// ToDo: Remove this enum https://github.com/SonarSource/sonar-dotnet/issues/8588\n[Obsolete(\"This will be removed. Use FailTest if you really have to provide this argument somewhere.\")]\npublic enum CompilationErrorBehavior\n{\n    FailTest,\n    Ignore,\n    Default = FailTest\n}\n\n[Flags]\npublic enum TargetFrameworks\n{\n    None = 0,\n    Net = 1,\n    NetFramework = 2,\n}\n\n/// <summary>\n/// Immutable builder that holds all parameters for rule verification.\n/// </summary>\npublic record VerifierBuilder\n{\n    // All properties are (and should be) immutable.\n    public ImmutableArray<Func<DiagnosticAnalyzer>> Analyzers { get; init; } = [];\n    public string BasePath { get; init; }\n    public Func<SonarCodeFix> CodeFix { get; init; }\n    public string CodeFixedPath { get; init; }\n    public string CodeFixedPathBatch { get; init; }\n    public string CodeFixTitle { get; init; }\n    public bool ConcurrentAnalysis { get; init; } = !Debugger.IsAttached;\n    public bool AutogenerateConcurrentFiles { get; init; } = !Debugger.IsAttached;\n    public CompilationErrorBehavior ErrorBehavior { get; init; } = CompilationErrorBehavior.Default;\n    public ImmutableArray<DiagnosticDescriptor> OnlyDiagnostics { get; init; } = [];\n    public ImmutableArray<string> WarningsAsErrors { get; init; } = [];\n    public OutputKind OutputKind { get; init; } = OutputKind.DynamicallyLinkedLibrary;\n    public Func<CompilationOptions, CompilationOptions> CompilationOptionsCustomization { get; init; }\n    public ImmutableArray<string> Paths { get; init; } = [];\n    public ImmutableArray<string> AdditionalSourceFiles { get; init; } = [];\n    public ImmutableArray<ParseOptions> ParseOptions { get; init; } = [];\n    public string ProtobufPath { get; init; }\n    public ImmutableArray<MetadataReference> References { get; init; } = [];\n    public ImmutableArray<Snippet> Snippets { get; init; } = [];\n    public string AdditionalFilePath { get; init; }\n    public TargetFrameworks TargetFrameworks { get; init; } = TargetFrameworks.Net | TargetFrameworks.NetFramework;\n\n    /// <summary>\n    /// This method solves complicated scenarios. Use 'new VerifierBuilder&lt;TAnalyzer&gt;()' for single analyzer cases with no rule parameters.\n    /// </summary>\n    public VerifierBuilder AddAnalyzer(Func<DiagnosticAnalyzer> createConfiguredAnalyzer) =>\n        this with { Analyzers = Analyzers.Append(createConfiguredAnalyzer).ToImmutableArray() };\n\n    public VerifierBuilder AddPaths(params string[] paths) =>\n        this with { Paths = Paths.Concat(paths).ToImmutableArray(), };\n\n    public VerifierBuilder AddReferences(IEnumerable<MetadataReference> references) =>\n        this with { References = References.Concat(references).ToImmutableArray() };\n\n    public VerifierBuilder AddSnippet(string snippet, string fileName = null) =>\n        this with { Snippets = Snippets.Add(new(snippet, fileName)) };\n\n    public VerifierBuilder AddAdditionalSourceFiles(params string[] additionalSourceFiles) =>\n        this with { AdditionalSourceFiles = AdditionalSourceFiles.Concat(additionalSourceFiles).ToImmutableArray() };\n\n    /// <summary>\n    /// Add a test reference to change the project type to Test project.\n    /// </summary>\n    public VerifierBuilder AddTestReference() =>\n        AddReferences(NuGetMetadataReference.MSTestTestFrameworkV1);\n\n    public VerifierBuilder WithAutogenerateConcurrentFiles(bool autogenerateConcurrentFiles) =>\n        this with { AutogenerateConcurrentFiles = autogenerateConcurrentFiles };\n\n    /// <summary>\n    /// Path infix relative to TestCases directory.\n    /// </summary>\n    /// <remarks>If we ever need to change the root outside the .\\TestCases directory, add WithRootPath(..) while WithBasePath(..) would still append another part after the root path.</remarks>\n    public VerifierBuilder WithBasePath(string basePath) =>\n        this with { BasePath = basePath };\n\n    public VerifierBuilder WithCodeFix<TCodeFix>() where TCodeFix : SonarCodeFix, new() =>\n        this with { CodeFix = () => new TCodeFix() };\n\n    /// <param name=\"codeFixedPathBatch\">Fixed file for cases when FixAllProvider produces different results than applying all code fixes on the same original document.</param>\n    public VerifierBuilder WithCodeFixedPaths(string codeFixedPath, string codeFixedPathBatch = null) =>\n        this with { CodeFixedPath = codeFixedPath, CodeFixedPathBatch = codeFixedPathBatch };\n\n    public VerifierBuilder WithCodeFixTitle(string codeFixTitle) =>\n        this with { CodeFixTitle = codeFixTitle };\n\n    public VerifierBuilder WithWarningsAsErrors(params string[] ids) =>\n        this with { WarningsAsErrors = ids.ToImmutableArray() };\n\n    public VerifierBuilder WithCompilationOptionsCustomization(Func<CompilationOptions, CompilationOptions> compilationOptionsCustomization) =>\n        this with { CompilationOptionsCustomization = compilationOptionsCustomization };\n\n    public VerifierBuilder WithConcurrentAnalysis(bool concurrentAnalysis) =>\n        this with { ConcurrentAnalysis = concurrentAnalysis };\n\n    [Obsolete(\"Do not use CompilationErrorBehavior. Assert errors with // Error [CSxxxx, CSyyyy] instead\")]\n    public VerifierBuilder WithErrorBehavior(CompilationErrorBehavior errorBehavior) =>\n        this with { ErrorBehavior = errorBehavior };\n\n    public VerifierBuilder WithLanguageVersion(CS.LanguageVersion languageVersion) =>\n        WithOptions([new CS.CSharpParseOptions(languageVersion)]);\n\n    public VerifierBuilder WithLanguageVersion(VB.LanguageVersion languageVersion) =>\n        WithOptions([new VB.VisualBasicParseOptions(languageVersion)]);\n\n    public VerifierBuilder WithOnlyDiagnostics(params DiagnosticDescriptor[] onlyDiagnostics) =>\n        this with { OnlyDiagnostics = onlyDiagnostics.ToImmutableArray() };\n\n    public VerifierBuilder WithOptions(ImmutableArray<ParseOptions> parseOptions) =>\n        this with { ParseOptions = parseOptions };\n\n    public VerifierBuilder WithOutputKind(OutputKind outputKind) =>\n        this with { OutputKind = outputKind };\n\n    public VerifierBuilder WithProtobufPath(string protobufPath) =>\n        this with { ProtobufPath = protobufPath };\n\n    public VerifierBuilder WithAdditionalFilePath(string additionalFilePath) =>\n        this with { AdditionalFilePath = additionalFilePath };\n\n    public VerifierBuilder WithNetOnly() =>\n        WithTargetFrameworks(TargetFrameworks.Net);\n\n    public VerifierBuilder WithNetFrameworkOnly() =>\n        WithTargetFrameworks(TargetFrameworks.NetFramework);\n\n    public VerifierBuilder WithTargetFrameworks(TargetFrameworks targetFrameworks) =>\n        this with { TargetFrameworks = targetFrameworks };\n\n    public VerifierBuilder WithTopLevelStatements()\n    {\n        if (ParseOptions.OfType<VB.VisualBasicParseOptions>().Any())\n        {\n            throw new InvalidOperationException($\"{nameof(WithTopLevelStatements)} is not supported with {nameof(VB.VisualBasicParseOptions)}.\");\n        }\n        if (ParseOptions.Cast<CS.CSharpParseOptions>().Any(x => x.LanguageVersion < CS.LanguageVersion.CSharp9))\n        {\n            throw new InvalidOperationException($\"{nameof(WithTopLevelStatements)} is supported from {nameof(CS.LanguageVersion.CSharp9)}.\");\n        }\n        return (ParseOptions.IsEmpty ? WithOptions(LanguageOptions.FromCSharp9) : this)\n            .WithOutputKind(OutputKind.ConsoleApplication)\n            .WithConcurrentAnalysis(false);\n    }\n\n    public IEnumerable<Compilation> Compile() =>\n        Build().Compile(false).Select(x => x.Compilation);\n\n    /// <summary>\n    /// Verifies that the diagnostics match the expected diagnostics and at least one diagnostic is found.\n    /// </summary>\n    public void Verify() =>\n        Build().Verify();\n\n    /// <summary>\n    /// Verifies that no diagnostics are found.\n    /// </summary>\n    public void VerifyNoIssues() =>\n        Build().VerifyNoIssues();\n\n    /// <summary>\n    /// Check that the compilation does not produce any AD0001 issues. Other diagnostics are ignored.\n    /// </summary>\n    public void VerifyNoAD0001() =>\n        Build().VerifyNoAD0001();\n\n    /// <summary>\n    /// Verifies that no diagnostics, except errors, are found.\n    /// </summary>\n    public void VerifyNoIssuesIgnoreErrors() =>\n        Build().VerifyNoIssuesIgnoreErrors();\n\n    public void VerifyCodeFix() =>\n        Build().VerifyCodeFix();\n\n    public void VerifyUtilityAnalyzerProducesEmptyProtobuf() =>\n        Build().VerifyUtilityAnalyzerProducesEmptyProtobuf();\n\n    public void VerifyUtilityAnalyzer<TMessage>(Action<IReadOnlyList<TMessage>> verifyProtobuf)\n        where TMessage : IMessage<TMessage>, new() =>\n        Build().VerifyUtilityAnalyzer(verifyProtobuf);\n\n    internal Verifier Build() =>\n        new(this);\n}\n\npublic record VerifierBuilder<TAnalyzer> : VerifierBuilder\n    where TAnalyzer : DiagnosticAnalyzer, new()\n{\n    public VerifierBuilder() =>\n        Analyzers = new Func<DiagnosticAnalyzer>[] { () => new TAnalyzer() }.ToImmutableArray();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework/packages.lock.json",
    "content": "{\n  \"version\": 1,\n  \"dependencies\": {\n    \".NETFramework,Version=v4.8\": {\n      \"altcover\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[9.0.102, )\",\n        \"resolved\": \"9.0.102\",\n        \"contentHash\": \"q3Rf5t0M9kXlcO5qhsaAe6NrFSNd5enrhKmF/Ezgmomqw34PbUTbRSYjSDNhS3YGDyUrPTkyPn14EfLDJWztcA==\"\n      },\n      \"Combinatorial.MSTest\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[2.0.0, )\",\n        \"resolved\": \"2.0.0\",\n        \"contentHash\": \"9tB2TMPkuEkYYUq64WREHMMyPt9NfKAyuitpK9yw3zbVe6v/vYkClZTR02+yKFUG+g8XHi5LMTt8jHz4RufGqw==\",\n        \"dependencies\": {\n          \"MSTest.TestFramework\": \"4.0.1\"\n        }\n      },\n      \"FluentAssertions\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[7.2.1, )\",\n        \"resolved\": \"7.2.1\",\n        \"contentHash\": \"MilqBF2lZrT0V1azIA6DG6I/snS0rG3A8ohT2Jjkhq6zOFk76nqx4BPnEnzrX6jFVa6xvkDU++z3PebCGZyJ4g==\",\n        \"dependencies\": {\n          \"System.Threading.Tasks.Extensions\": \"4.5.4\"\n        }\n      },\n      \"FluentAssertions.Analyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[0.34.1, )\",\n        \"resolved\": \"0.34.1\",\n        \"contentHash\": \"2BnAAB8CCPdRA9P1+lAvBZOleR2BTmsxGMtGt+LnABJUARGqoGMWEFxG3znZYqHVIrMP0Za/kyw6atyt8x2mzA==\"\n      },\n      \"Microsoft.Build.Locator\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.11.2, )\",\n        \"resolved\": \"1.11.2\",\n        \"contentHash\": \"tY+/S54G29CGsbL3slVu4vqtpciwVnb3fKOmrhgzEQmu/VziFaWmD/E1e/2KH7cDucuycGSkWsSXndBs5Uawow==\"\n      },\n      \"Microsoft.CodeAnalysis.CSharp.Workspaces\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[5.3.0, )\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"mRwxchBs3ewXK4dqK4R/eVCx99VIq1k/lhwArlu+fJuV0uzmbkTTRw4jR9gN9sOcAQfX0uV9KQlmCk1yC0JNog==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.Bcl.AsyncInterfaces\": \"9.0.0\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.CSharp\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Composition\": \"9.0.0\",\n          \"System.IO.Pipelines\": \"9.0.0\",\n          \"System.Memory\": \"4.6.0\",\n          \"System.Numerics.Vectors\": \"4.6.0\",\n          \"System.Reflection.Metadata\": \"9.0.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\",\n          \"System.Text.Encoding.CodePages\": \"8.0.0\",\n          \"System.Threading.Channels\": \"8.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.6.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[3.3.1, )\",\n        \"resolved\": \"3.3.1\",\n        \"contentHash\": \"eT+kgNCDdTRbQ5WF6BGx1HI3D5jYfHteza/koefhWC2vNZGxObA74XxwWfg40dy3uUv7dn3OGKLK5GUPLroVog==\"\n      },\n      \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[5.3.0, )\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"pAGdr4qs7+v287DPiiM8px1cBXnhe8LxymkVGTnCwv2OEjCk5HO2zIoFvype4ivKJTRW3aTUUV8ab+915wbv+w==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.Bcl.AsyncInterfaces\": \"9.0.0\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.VisualBasic\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Composition\": \"9.0.0\",\n          \"System.IO.Pipelines\": \"9.0.0\",\n          \"System.Memory\": \"4.6.0\",\n          \"System.Numerics.Vectors\": \"4.6.0\",\n          \"System.Reflection.Metadata\": \"9.0.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\",\n          \"System.Text.Encoding.CodePages\": \"8.0.0\",\n          \"System.Threading.Channels\": \"8.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.6.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Workspaces.MSBuild\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[5.3.0, )\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"2Mg/ppo5dza1e4DJWX4+RIHMc3FgnYzuHTaLRZDupiK1LTi/PAZ1PBpF/iivHVNKQKwipHE984gy37MbM0RO9Q==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.Bcl.AsyncInterfaces\": \"9.0.0\",\n          \"Microsoft.Build.Framework\": \"18.0.2\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"Microsoft.Extensions.DependencyInjection\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Options\": \"9.0.0\",\n          \"Microsoft.Extensions.Primitives\": \"9.0.0\",\n          \"Microsoft.IO.Redist\": \"6.1.0\",\n          \"Microsoft.VisualStudio.SolutionPersistence\": \"1.0.52\",\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Composition\": \"9.0.0\",\n          \"System.Diagnostics.DiagnosticSource\": \"9.0.0\",\n          \"System.IO.Pipelines\": \"9.0.0\",\n          \"System.Memory\": \"4.6.0\",\n          \"System.Numerics.Vectors\": \"4.6.0\",\n          \"System.Reflection.Metadata\": \"9.0.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\",\n          \"System.Text.Encoding.CodePages\": \"8.0.0\",\n          \"System.Text.Encodings.Web\": \"9.0.0\",\n          \"System.Text.Json\": \"9.0.0\",\n          \"System.Threading.Channels\": \"8.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.6.0\",\n          \"System.ValueTuple\": \"4.5.0\"\n        }\n      },\n      \"Microsoft.NET.Test.Sdk\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[18.4.0, )\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"w49iZdL4HL6V25l41NVQLXWQ+e71GvSkKVteMrOL02gP/PUkcnO/1yEb2s9FntU4wGmJWfKnyrRAhcMHd9ZZNA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeCoverage\": \"18.4.0\"\n        }\n      },\n      \"Microsoft.NETFramework.ReferenceAssemblies\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.0.3, )\",\n        \"resolved\": \"1.0.3\",\n        \"contentHash\": \"vUc9Npcs14QsyOD01tnv/m8sQUnGTGOw1BCmKcv77LBJY7OxhJ+zJF7UD/sCL3lYNFuqmQEVlkfS4Quif6FyYg==\",\n        \"dependencies\": {\n          \"Microsoft.NETFramework.ReferenceAssemblies.net48\": \"1.0.3\"\n        }\n      },\n      \"MSTest.TestAdapter\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[4.2.1, )\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"lZRgNzaQnffK4XLjM/og4Eoqp/3IkpcyJQQcyKXkPdkzCT3+ghpwHa9zG1xYhQDbUFoc54M+/waLwh31K9stDQ==\",\n        \"dependencies\": {\n          \"MSTest.TestFramework\": \"4.2.1\",\n          \"Microsoft.Testing.Extensions.VSTestBridge\": \"2.2.1\",\n          \"Microsoft.Testing.Platform.MSBuild\": \"2.2.1\",\n          \"System.Threading.Tasks.Extensions\": \"4.5.4\"\n        }\n      },\n      \"MSTest.TestFramework\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[4.2.1, )\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"I4/RbS2TpGZ56CE98+jPbrGlcerYtw2LvPVKzQGvyQQcJDekPy2Kd+fnThXYn+geJ1sW+vA9B7++rFNxvKcWxA==\",\n        \"dependencies\": {\n          \"MSTest.Analyzers\": \"4.2.1\"\n        }\n      },\n      \"NSubstitute\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[5.3.0, )\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"lJ47Cps5Qzr86N99lcwd+OUvQma7+fBgr8+Mn+aOC0WrlqMNkdivaYD9IvnZ5Mqo6Ky3LS7ZI+tUq1/s9ERd0Q==\",\n        \"dependencies\": {\n          \"Castle.Core\": \"5.1.1\",\n          \"System.Threading.Tasks.Extensions\": \"4.3.0\"\n        }\n      },\n      \"NuGet.Protocol\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[7.3.1, )\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"vYd5vtCJ/tpMQjbAs6rrftNgeh5Ip1w7tnEsDZCpGObKgUgOxHQBekCul3TnzmbNgobvJEkDJNaec5/ZBv66Hg==\",\n        \"dependencies\": {\n          \"NuGet.Packaging\": \"7.3.1\",\n          \"System.Text.Json\": \"8.0.5\"\n        }\n      },\n      \"SonarAnalyzer.CSharp.Styling\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[10.21.0.135717, )\",\n        \"resolved\": \"10.21.0.135717\",\n        \"contentHash\": \"hl264jF539oB7m2jED5QGM345eFSiDAdoJc8TH0HM6L7ZeqT5TDqZDQeZ8IDP02dVIpH/Fhhn+HsGfEcj8ohyQ==\"\n      },\n      \"StyleCop.Analyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.2.0-beta.556, )\",\n        \"resolved\": \"1.2.0-beta.556\",\n        \"contentHash\": \"llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==\",\n        \"dependencies\": {\n          \"StyleCop.Analyzers.Unstable\": \"1.2.0.556\"\n        }\n      },\n      \"Castle.Core\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.1.1\",\n        \"contentHash\": \"rpYtIczkzGpf+EkZgDr9CClTdemhsrwA/W5hMoPjLkRFnXzH44zDLoovXeKtmxb1ykXK9aJVODSpiJml8CTw2g==\"\n      },\n      \"Google.Protobuf\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"3.6.1\",\n        \"contentHash\": \"741fGeDQjixBJaU2j+0CbrmZXsNJkTn/hWbOh4fLVXndHsCclJmWznCPWrJmPoZKvajBvAz3e8ECJOUvRtwjNQ==\"\n      },\n      \"Humanizer.Core\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.14.1\",\n        \"contentHash\": \"lQKvtaTDOXnoVJ20ibTuSIOf2i0uO0MPbDhd1jm238I+U/2ZnRENj0cktKZhtchBMtCUSRQ5v4xBCUbKNmyVMw==\"\n      },\n      \"Microsoft.ApplicationInsights\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.23.0\",\n        \"contentHash\": \"nWArUZTdU7iqZLycLKWe0TDms48KKGE6pONH2terYNa8REXiqixrMOkf1sk5DHGMaUTqONU2YkS4SAXBhLStgw==\",\n        \"dependencies\": {\n          \"System.Diagnostics.DiagnosticSource\": \"5.0.0\"\n        }\n      },\n      \"Microsoft.Bcl.AsyncInterfaces\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"owmu2Cr3IQ8yQiBleBHlGk8dSQ12oaF2e7TpzwJKEl4m84kkZJjEY1n33L67Y3zM5jPOjmmbdHjbfiL0RqcMRQ==\",\n        \"dependencies\": {\n          \"System.Threading.Tasks.Extensions\": \"4.5.4\"\n        }\n      },\n      \"Microsoft.Build.Framework\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.0.2\",\n        \"contentHash\": \"sOSb+0J4G/jCBW/YqmRuL0eOMXgfw1KQLdC9TkbvfA5xs7uNm+PBQXJCOzSJGXtZcZrtXozcwxPmUiRUbmd7FA==\",\n        \"dependencies\": {\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Diagnostics.DiagnosticSource\": \"9.0.0\",\n          \"System.Memory\": \"4.6.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\",\n          \"System.Text.Json\": \"9.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.6.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0-2.25625.1\",\n        \"contentHash\": \"4Yhh2fnu3G+J0J1lDc8WZVgMjgbynSeTfkl5IFJMFrmiIO0sc7Tjx+f3sFVV8Sd35PrIUWfof0RWc3lAMl7Azg==\"\n      },\n      \"Microsoft.CodeAnalysis.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"uC0qk3jzTQY7i90ehfnCqaOZpBUGJyPMiHJ3c0jOb8yaPBjWzIhVdNxPbeVzI74DB0C+YgBKPLqUkgFZzua5Mg==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Memory\": \"4.6.0\",\n          \"System.Numerics.Vectors\": \"4.6.0\",\n          \"System.Reflection.Metadata\": \"9.0.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\",\n          \"System.Text.Encoding.CodePages\": \"8.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.6.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"SQFNGQF4f7UfDXKxMzzGNMr3fjrPDIjLfmRvvVgDCw+dyvEHDaRfHuKA5q0Pr0/JW0Gcw89TxrxrS/MjwBvluQ==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Memory\": \"4.6.0\",\n          \"System.Numerics.Vectors\": \"4.6.0\",\n          \"System.Reflection.Metadata\": \"9.0.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\",\n          \"System.Text.Encoding.CodePages\": \"8.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.6.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.VisualBasic\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"AJxddsIOmfimuihaLuSAm4c/zskHoL1ypAjIpSOZqHlNm2iuw0twsB8nbKczJyfClqD7+iYjdIeE5EV8WAyxRA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Memory\": \"4.6.0\",\n          \"System.Numerics.Vectors\": \"4.6.0\",\n          \"System.Reflection.Metadata\": \"9.0.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\",\n          \"System.Text.Encoding.CodePages\": \"8.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.6.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Workspaces.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"QSf1ge9A+XFZbGL+gIqXYBIKlm8QdQVLvHDPZiydG11W6mJY7XBMusrsgIEz6L8GYMzGJKTM78m9icliGMF7NA==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.Bcl.AsyncInterfaces\": \"9.0.0\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Composition\": \"9.0.0\",\n          \"System.IO.Pipelines\": \"9.0.0\",\n          \"System.Memory\": \"4.6.0\",\n          \"System.Numerics.Vectors\": \"4.6.0\",\n          \"System.Reflection.Metadata\": \"9.0.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\",\n          \"System.Text.Encoding.CodePages\": \"8.0.0\",\n          \"System.Threading.Channels\": \"8.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.6.0\"\n        }\n      },\n      \"Microsoft.CodeCoverage\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"9O0BtCfzCWrkAmK187ugKdq72HHOXoOUjuWFDVc2LsZZ0pOnA9bTt+Sg9q4cF+MoAaUU+MuWtvBuFsnduviJow==\"\n      },\n      \"Microsoft.Composition\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.27\",\n        \"contentHash\": \"pwu80Ohe7SBzZ6i69LVdzowp6V+LaVRzd5F7A6QlD42vQkX0oT7KXKWWPlM/S00w1gnMQMRnEdbtOV12z6rXdQ==\"\n      },\n      \"Microsoft.Extensions.DependencyInjection\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"MCPrg7v3QgNMr0vX4vzRXvkNGgLg8vKWX0nKCWUxu2uPyMsaRgiRc1tHBnbTcfJMhMKj2slE/j2M9oGkd25DNw==\",\n        \"dependencies\": {\n          \"Microsoft.Bcl.AsyncInterfaces\": \"9.0.0\",\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.5.4\"\n        }\n      },\n      \"Microsoft.Extensions.DependencyInjection.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"+6f2qv2a3dLwd5w6JanPIPs47CxRbnk+ZocMJUhv9NxP88VlOcJYZs9jY+MYSjxvady08bUZn6qgiNh7DadGgg==\",\n        \"dependencies\": {\n          \"Microsoft.Bcl.AsyncInterfaces\": \"9.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.5.4\"\n        }\n      },\n      \"Microsoft.Extensions.Logging\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"crjWyORoug0kK7RSNJBTeSE6VX8IQgLf3nUpTB9m62bPXp/tzbnOsnbe8TXEG0AASNaKZddnpHKw7fET8E++Pg==\",\n        \"dependencies\": {\n          \"Microsoft.Bcl.AsyncInterfaces\": \"9.0.0\",\n          \"Microsoft.Extensions.DependencyInjection\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Options\": \"9.0.0\",\n          \"System.Diagnostics.DiagnosticSource\": \"9.0.0\",\n          \"System.ValueTuple\": \"4.5.0\"\n        }\n      },\n      \"Microsoft.Extensions.Logging.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"g0UfujELzlLbHoVG8kPKVBaW470Ewi+jnptGS9KUi6jcb+k2StujtK3m26DFSGGwQ/+bVgZfsWqNzlP6YOejvw==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\",\n          \"System.Buffers\": \"4.5.1\",\n          \"System.Diagnostics.DiagnosticSource\": \"9.0.0\",\n          \"System.Memory\": \"4.5.5\"\n        }\n      },\n      \"Microsoft.Extensions.Options\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"y2146b3jrPI3Q0lokKXdKLpmXqakYbDIPDV6r3M8SqvSf45WwOTzkyfDpxnZXJsJQEpAsAqjUq5Pu8RCJMjubg==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Primitives\": \"9.0.0\",\n          \"System.ValueTuple\": \"4.5.0\"\n        }\n      },\n      \"Microsoft.Extensions.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"N3qEBzmLMYiASUlKxxFIISP4AiwuPTHF5uCh+2CWSwwzAJiIYx0kBJsS30cp1nvhSySFAVi30jecD307jV+8Kg==\",\n        \"dependencies\": {\n          \"System.Memory\": \"4.5.5\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.0.0\"\n        }\n      },\n      \"Microsoft.IO.Redist\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.1.0\",\n        \"contentHash\": \"pTYqyiu9nLeCXROGjKnnYTH9v3yQNgXj3t4v7fOWwh9dgSBIwZbiSi8V76hryG2CgTjUFU+xu8BXPQ122CwAJg==\",\n        \"dependencies\": {\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Memory\": \"4.6.0\"\n        }\n      },\n      \"Microsoft.NETFramework.ReferenceAssemblies.net48\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.3\",\n        \"contentHash\": \"zMk4D+9zyiEWByyQ7oPImPN/Jhpj166Ky0Nlla4eXlNL8hI/BtSJsgR8Inldd4NNpIAH3oh8yym0W2DrhXdSLQ==\"\n      },\n      \"Microsoft.Testing.Extensions.Telemetry\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"7zB8BjffOyvqfHF26rFVPuK0w1fCf5+j1tLuhHIr76CqxXkGb+fMJtq6YNOV+m6qPytExHMXxluk3RgJ+dSIqw==\",\n        \"dependencies\": {\n          \"Microsoft.ApplicationInsights\": \"2.23.0\",\n          \"Microsoft.Testing.Platform\": \"2.2.1\",\n          \"System.Diagnostics.DiagnosticSource\": \"6.0.0\"\n        }\n      },\n      \"Microsoft.Testing.Extensions.TrxReport.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"RD6D1Jx6cKDA5IHd1H2q8ylIuQG3PD+gdULI0JC8CvsRtaypFzTFpB5xDPuQi8o6kAkcM04cBhAiJPxZboNH2Q==\",\n        \"dependencies\": {\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.Testing.Extensions.VSTestBridge\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"D8AGlkNtlTQPe3zf4SLnHBMr13lerMe0RuHSoRfnRatcuX/T7YbRtgn39rWBjKhXsNio0WXKrPKv3gfWE2I46w==\",\n        \"dependencies\": {\n          \"Microsoft.TestPlatform.ObjectModel\": \"18.3.0\",\n          \"Microsoft.Testing.Extensions.Telemetry\": \"2.2.1\",\n          \"Microsoft.Testing.Extensions.TrxReport.Abstractions\": \"2.2.1\",\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.Testing.Platform\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"9bbPuls/b6/vUFzxbSjJLZlJHyKBfOZE5kjIY+ITI2ASqlFPJhR83BdLydJeQOCLEZhEbrEcz5xtt1B69nwSVg==\"\n      },\n      \"Microsoft.Testing.Platform.MSBuild\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"CSJOcZHfKlTyPbS0CTJk6iEnU4gJC+eUA5z72UBnMDRdgVHYOmB8k9Y7jT233gZjnCOQiYFg3acQHRfu2H62nw==\",\n        \"dependencies\": {\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.TestPlatform.ObjectModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.3.0\",\n        \"contentHash\": \"AEIEX2aWdPO9XbtR96eBaJxmXRD9vaI9uQ1T/JbPEKlTAZwYx0ZrMzKyULMdh/HH9Sg03kXCoN7LszQ90o6nPQ==\",\n        \"dependencies\": {\n          \"System.Reflection.Metadata\": \"8.0.0\"\n        }\n      },\n      \"Microsoft.VisualStudio.SolutionPersistence\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.52\",\n        \"contentHash\": \"oNv2JtYXhpdJrX63nibx1JT3uCESOBQ1LAk7Dtz/sr0+laW0KRM6eKp4CZ3MHDR2siIkKsY8MmUkeP5DKkQQ5w==\",\n        \"dependencies\": {\n          \"Microsoft.IO.Redist\": \"6.0.1\",\n          \"System.Memory\": \"4.5.5\",\n          \"System.Threading.Tasks.Extensions\": \"4.5.4\"\n        }\n      },\n      \"MSTest.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"1i9jgE/42KGGyZ4s0MdrYM/Uu/dRYhbRfYQifcO0AZ6vw4sBXRjoQGQRGNSm771AYgPAmoGl0u4sJc2lMET6HQ==\"\n      },\n      \"Newtonsoft.Json\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"13.0.3\",\n        \"contentHash\": \"HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==\"\n      },\n      \"NuGet.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"1mp7zmyAGmQfT93ELC4c+MYOrJ8Ff4ekFZRek4JSVLb/wOO/o0bsPfLmqujCsJ2Hlwc+fpq1TQEnjSEgWdt8ng==\",\n        \"dependencies\": {\n          \"NuGet.Frameworks\": \"7.3.1\",\n          \"System.Collections.Immutable\": \"8.0.0\"\n        }\n      },\n      \"NuGet.Configuration\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"tGxWBo47EQONOaqY+MbEWMrNjFthHgfavLM1HE0RcLyOXVCoQKBlZGV7v0hrS/rJrQKw6ZaBeHetX+ZJgS7Lxg==\",\n        \"dependencies\": {\n          \"NuGet.Common\": \"7.3.1\"\n        }\n      },\n      \"NuGet.Frameworks\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"VUPAE5l/Ir4Gb3dv+v0jq0Qe4nfwxfrfiYN7QhwlGyWPXFKYXSSke1t1bV/ZYd6idtTtRDqJPM49Lt/U8NTocg==\"\n      },\n      \"NuGet.Packaging\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"5bT8uOrNBx4Srhbrd3HonYmyKhWJkvQyTWTYE2jvfPgYx2aCbPmq8MCYko7ce78hEN9mpq2xlrztVhguYPc+GQ==\",\n        \"dependencies\": {\n          \"Newtonsoft.Json\": \"13.0.3\",\n          \"NuGet.Configuration\": \"7.3.1\",\n          \"NuGet.Versioning\": \"7.3.1\",\n          \"System.Text.Json\": \"8.0.5\"\n        }\n      },\n      \"NuGet.Versioning\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"TJrQWSmD1vakfav7qIhDXgDFfaZFfMJ+v6P8tcND9ZqXajD5B/ZzaoGYNzL4D3eDue6vAOUvwzu42G+19JNVUA==\"\n      },\n      \"StyleCop.Analyzers.Unstable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.2.0.556\",\n        \"contentHash\": \"zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==\"\n      },\n      \"System.Buffers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.6.0\",\n        \"contentHash\": \"lN6tZi7Q46zFzAbRYXTIvfXcyvQQgxnY7Xm6C6xQ9784dEL1amjM6S6Iw4ZpsvesAKnRVsM4scrDQaDqSClkjA==\"\n      },\n      \"System.Collections.Immutable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"QhkXUl2gNrQtvPmtBTQHb0YsUrDiDQ2QS09YbtTTiSjGcf7NBqtYbrG/BE06zcBPCKEwQGzIv13IVdXNOSub2w==\",\n        \"dependencies\": {\n          \"System.Memory\": \"4.5.5\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.0.0\"\n        }\n      },\n      \"System.Composition\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"3Djj70fFTraOarSKmRnmRy/zm4YurICm+kiCtI0dYRqGJnLX6nJ+G3WYuFJ173cAPax/gh96REcbNiVqcrypFQ==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\",\n          \"System.Composition.Convention\": \"9.0.0\",\n          \"System.Composition.Hosting\": \"9.0.0\",\n          \"System.Composition.Runtime\": \"9.0.0\",\n          \"System.Composition.TypedParts\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.AttributedModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"iri00l/zIX9g4lHMY+Nz0qV1n40+jFYAmgsaiNn16xvt2RDwlqByNG4wgblagnDYxm3YSQQ0jLlC/7Xlk9CzyA==\"\n      },\n      \"System.Composition.Convention\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"+vuqVP6xpi582XIjJi6OCsIxuoTZfR0M7WWufk3uGDeCl3wGW6KnpylUJ3iiXdPByPE0vR5TjJgR6hDLez4FQg==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.Hosting\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"OFqSeFeJYr7kHxDfaViGM1ymk7d4JxK//VSoNF9Ux0gpqkLsauDZpu89kTHHNdCWfSljbFcvAafGyBoY094btQ==\",\n        \"dependencies\": {\n          \"System.Composition.Runtime\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.Runtime\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"w1HOlQY1zsOWYussjFGZCEYF2UZXgvoYnS94NIu2CBnAGMbXFAX8PY8c92KwUItPmowal68jnVLBCzdrWLeEKA==\"\n      },\n      \"System.Composition.TypedParts\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"aRZlojCCGEHDKqh43jaDgaVpYETsgd7Nx4g1zwLKMtv4iTo0627715ajEFNpEEBTgLmvZuv8K0EVxc3sM4NWJA==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\",\n          \"System.Composition.Hosting\": \"9.0.0\",\n          \"System.Composition.Runtime\": \"9.0.0\"\n        }\n      },\n      \"System.Diagnostics.DiagnosticSource\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"ddppcFpnbohLWdYKr/ZeLZHmmI+DXFgZ3Snq+/E7SwcdW4UnvxmaugkwGywvGVWkHPGCSZjCP+MLzu23AL5SDw==\",\n        \"dependencies\": {\n          \"System.Memory\": \"4.5.5\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.0.0\"\n        }\n      },\n      \"System.IO.Pipelines\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"eA3cinogwaNB4jdjQHOP3Z3EuyiDII7MT35jgtnsA4vkn0LUrrSHsU0nzHTzFzmaFYeKV7MYyMxOocFzsBHpTw==\",\n        \"dependencies\": {\n          \"System.Buffers\": \"4.5.1\",\n          \"System.Memory\": \"4.5.5\",\n          \"System.Threading.Tasks.Extensions\": \"4.5.4\"\n        }\n      },\n      \"System.Memory\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.6.0\",\n        \"contentHash\": \"OEkbBQoklHngJ8UD8ez2AERSk2g+/qpAaSWWCBFbpH727HxDq5ydVkuncBaKcKfwRqXGWx64dS6G1SUScMsitg==\",\n        \"dependencies\": {\n          \"System.Buffers\": \"4.6.0\",\n          \"System.Numerics.Vectors\": \"4.6.0\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\"\n        }\n      },\n      \"System.Numerics.Vectors\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.6.0\",\n        \"contentHash\": \"t+SoieZsRuEyiw/J+qXUbolyO219tKQQI0+2/YI+Qv7YdGValA6WiuokrNKqjrTNsy5ABWU11bdKOzUdheteXg==\"\n      },\n      \"System.Reflection.Metadata\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"ANiqLu3DxW9kol/hMmTWbt3414t9ftdIuiIU7j80okq2YzAueo120M442xk1kDJWtmZTqWQn7wHDvMRipVOEOQ==\",\n        \"dependencies\": {\n          \"System.Collections.Immutable\": \"9.0.0\",\n          \"System.Memory\": \"4.5.5\"\n        }\n      },\n      \"System.Runtime.CompilerServices.Unsafe\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.1.0\",\n        \"contentHash\": \"5o/HZxx6RVqYlhKSq8/zronDkALJZUT2Vz0hx43f0gwe8mwlM0y2nYlqdBwLMzr262Bwvpikeb/yEwkAa5PADg==\"\n      },\n      \"System.Text.Encoding.CodePages\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"OZIsVplFGaVY90G2SbpgU7EnCoOO5pw1t4ic21dBF3/1omrJFpAGoNAVpPyMVOC90/hvgkGG3VFqR13YgZMQfg==\",\n        \"dependencies\": {\n          \"System.Memory\": \"4.5.5\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.0.0\"\n        }\n      },\n      \"System.Text.Encodings.Web\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"e2hMgAErLbKyUUwt18qSBf9T5Y+SFAL3ZedM8fLupkVj8Rj2PZ9oxQ37XX2LF8fTO1wNIxvKpihD7Of7D/NxZw==\",\n        \"dependencies\": {\n          \"System.Buffers\": \"4.5.1\",\n          \"System.Memory\": \"4.5.5\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.0.0\"\n        }\n      },\n      \"System.Text.Json\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"js7+qAu/9mQvnhA4EfGMZNEzXtJCDxgkgj8ohuxq/Qxv+R56G+ljefhiJHOxTNiw54q8vmABCWUwkMulNdlZ4A==\",\n        \"dependencies\": {\n          \"Microsoft.Bcl.AsyncInterfaces\": \"9.0.0\",\n          \"System.Buffers\": \"4.5.1\",\n          \"System.IO.Pipelines\": \"9.0.0\",\n          \"System.Memory\": \"4.5.5\",\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.0.0\",\n          \"System.Text.Encodings.Web\": \"9.0.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.5.4\",\n          \"System.ValueTuple\": \"4.5.0\"\n        }\n      },\n      \"System.Threading.Channels\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"CMaFr7v+57RW7uZfZkPExsPB6ljwzhjACWW1gfU35Y56rk72B/Wu+sTqxVmGSk4SFUlPc3cjeKND0zktziyjBA==\",\n        \"dependencies\": {\n          \"System.Threading.Tasks.Extensions\": \"4.5.4\"\n        }\n      },\n      \"System.Threading.Tasks.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.6.0\",\n        \"contentHash\": \"I5G6Y8jb0xRtGUC9Lahy7FUvlYlnGMMkbuKAQBy8Jb7Y6Yn8OlBEiUOY0PqZ0hy6Ua8poVA1ui1tAIiXNxGdsg==\",\n        \"dependencies\": {\n          \"System.Runtime.CompilerServices.Unsafe\": \"6.1.0\"\n        }\n      },\n      \"System.ValueTuple\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.5.0\",\n        \"contentHash\": \"okurQJO6NRE/apDIP23ajJ0hpiNmJ+f0BwOlB/cSqTLQlw5upkf+5+96+iG2Jw40G1fCVCyPz/FhIABUjMR+RQ==\"\n      },\n      \"sonaranalyzer.cfg\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer.Lightup\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.core\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Google.Protobuf\": \"[3.6.1, )\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.CFG\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer.lightup\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      }\n    },\n    \"net10.0\": {\n      \"altcover\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[9.0.102, )\",\n        \"resolved\": \"9.0.102\",\n        \"contentHash\": \"q3Rf5t0M9kXlcO5qhsaAe6NrFSNd5enrhKmF/Ezgmomqw34PbUTbRSYjSDNhS3YGDyUrPTkyPn14EfLDJWztcA==\"\n      },\n      \"Combinatorial.MSTest\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[2.0.0, )\",\n        \"resolved\": \"2.0.0\",\n        \"contentHash\": \"9tB2TMPkuEkYYUq64WREHMMyPt9NfKAyuitpK9yw3zbVe6v/vYkClZTR02+yKFUG+g8XHi5LMTt8jHz4RufGqw==\",\n        \"dependencies\": {\n          \"MSTest.TestFramework\": \"4.0.1\"\n        }\n      },\n      \"FluentAssertions\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[7.2.1, )\",\n        \"resolved\": \"7.2.1\",\n        \"contentHash\": \"MilqBF2lZrT0V1azIA6DG6I/snS0rG3A8ohT2Jjkhq6zOFk76nqx4BPnEnzrX6jFVa6xvkDU++z3PebCGZyJ4g==\",\n        \"dependencies\": {\n          \"System.Configuration.ConfigurationManager\": \"6.0.0\"\n        }\n      },\n      \"FluentAssertions.Analyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[0.34.1, )\",\n        \"resolved\": \"0.34.1\",\n        \"contentHash\": \"2BnAAB8CCPdRA9P1+lAvBZOleR2BTmsxGMtGt+LnABJUARGqoGMWEFxG3znZYqHVIrMP0Za/kyw6atyt8x2mzA==\"\n      },\n      \"Microsoft.Build.Locator\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.11.2, )\",\n        \"resolved\": \"1.11.2\",\n        \"contentHash\": \"tY+/S54G29CGsbL3slVu4vqtpciwVnb3fKOmrhgzEQmu/VziFaWmD/E1e/2KH7cDucuycGSkWsSXndBs5Uawow==\"\n      },\n      \"Microsoft.CodeAnalysis.CSharp.Workspaces\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[5.3.0, )\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"mRwxchBs3ewXK4dqK4R/eVCx99VIq1k/lhwArlu+fJuV0uzmbkTTRw4jR9gN9sOcAQfX0uV9KQlmCk1yC0JNog==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.CSharp\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[3.3.1, )\",\n        \"resolved\": \"3.3.1\",\n        \"contentHash\": \"eT+kgNCDdTRbQ5WF6BGx1HI3D5jYfHteza/koefhWC2vNZGxObA74XxwWfg40dy3uUv7dn3OGKLK5GUPLroVog==\"\n      },\n      \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[5.3.0, )\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"pAGdr4qs7+v287DPiiM8px1cBXnhe8LxymkVGTnCwv2OEjCk5HO2zIoFvype4ivKJTRW3aTUUV8ab+915wbv+w==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.VisualBasic\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Workspaces.MSBuild\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[5.3.0, )\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"2Mg/ppo5dza1e4DJWX4+RIHMc3FgnYzuHTaLRZDupiK1LTi/PAZ1PBpF/iivHVNKQKwipHE984gy37MbM0RO9Q==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.Build.Framework\": \"17.11.48\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"Microsoft.Extensions.DependencyInjection\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Options\": \"9.0.0\",\n          \"Microsoft.Extensions.Primitives\": \"9.0.0\",\n          \"Microsoft.VisualStudio.SolutionPersistence\": \"1.0.52\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.NET.Test.Sdk\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[18.4.0, )\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"w49iZdL4HL6V25l41NVQLXWQ+e71GvSkKVteMrOL02gP/PUkcnO/1yEb2s9FntU4wGmJWfKnyrRAhcMHd9ZZNA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeCoverage\": \"18.4.0\",\n          \"Microsoft.TestPlatform.TestHost\": \"18.4.0\"\n        }\n      },\n      \"MSTest.TestAdapter\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[4.2.1, )\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"lZRgNzaQnffK4XLjM/og4Eoqp/3IkpcyJQQcyKXkPdkzCT3+ghpwHa9zG1xYhQDbUFoc54M+/waLwh31K9stDQ==\",\n        \"dependencies\": {\n          \"MSTest.TestFramework\": \"4.2.1\",\n          \"Microsoft.Testing.Extensions.VSTestBridge\": \"2.2.1\",\n          \"Microsoft.Testing.Platform.MSBuild\": \"2.2.1\"\n        }\n      },\n      \"MSTest.TestFramework\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[4.2.1, )\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"I4/RbS2TpGZ56CE98+jPbrGlcerYtw2LvPVKzQGvyQQcJDekPy2Kd+fnThXYn+geJ1sW+vA9B7++rFNxvKcWxA==\",\n        \"dependencies\": {\n          \"MSTest.Analyzers\": \"4.2.1\"\n        }\n      },\n      \"NSubstitute\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[5.3.0, )\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"lJ47Cps5Qzr86N99lcwd+OUvQma7+fBgr8+Mn+aOC0WrlqMNkdivaYD9IvnZ5Mqo6Ky3LS7ZI+tUq1/s9ERd0Q==\",\n        \"dependencies\": {\n          \"Castle.Core\": \"5.1.1\"\n        }\n      },\n      \"NuGet.Protocol\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[7.3.1, )\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"vYd5vtCJ/tpMQjbAs6rrftNgeh5Ip1w7tnEsDZCpGObKgUgOxHQBekCul3TnzmbNgobvJEkDJNaec5/ZBv66Hg==\",\n        \"dependencies\": {\n          \"NuGet.Packaging\": \"7.3.1\"\n        }\n      },\n      \"SonarAnalyzer.CSharp.Styling\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[10.21.0.135717, )\",\n        \"resolved\": \"10.21.0.135717\",\n        \"contentHash\": \"hl264jF539oB7m2jED5QGM345eFSiDAdoJc8TH0HM6L7ZeqT5TDqZDQeZ8IDP02dVIpH/Fhhn+HsGfEcj8ohyQ==\"\n      },\n      \"StyleCop.Analyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.2.0-beta.556, )\",\n        \"resolved\": \"1.2.0-beta.556\",\n        \"contentHash\": \"llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==\",\n        \"dependencies\": {\n          \"StyleCop.Analyzers.Unstable\": \"1.2.0.556\"\n        }\n      },\n      \"Castle.Core\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.1.1\",\n        \"contentHash\": \"rpYtIczkzGpf+EkZgDr9CClTdemhsrwA/W5hMoPjLkRFnXzH44zDLoovXeKtmxb1ykXK9aJVODSpiJml8CTw2g==\",\n        \"dependencies\": {\n          \"System.Diagnostics.EventLog\": \"6.0.0\"\n        }\n      },\n      \"Google.Protobuf\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"3.6.1\",\n        \"contentHash\": \"741fGeDQjixBJaU2j+0CbrmZXsNJkTn/hWbOh4fLVXndHsCclJmWznCPWrJmPoZKvajBvAz3e8ECJOUvRtwjNQ==\",\n        \"dependencies\": {\n          \"NETStandard.Library\": \"1.6.1\"\n        }\n      },\n      \"Humanizer.Core\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.14.1\",\n        \"contentHash\": \"lQKvtaTDOXnoVJ20ibTuSIOf2i0uO0MPbDhd1jm238I+U/2ZnRENj0cktKZhtchBMtCUSRQ5v4xBCUbKNmyVMw==\"\n      },\n      \"Microsoft.ApplicationInsights\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.23.0\",\n        \"contentHash\": \"nWArUZTdU7iqZLycLKWe0TDms48KKGE6pONH2terYNa8REXiqixrMOkf1sk5DHGMaUTqONU2YkS4SAXBhLStgw==\",\n        \"dependencies\": {\n          \"System.Diagnostics.DiagnosticSource\": \"5.0.0\"\n        }\n      },\n      \"Microsoft.Build.Framework\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"17.11.48\",\n        \"contentHash\": \"C3WIMt2wBl4++NX3jSEpTq5KXBhvAV154R4JrYHkfy9JSBcXWiL0mkgpspk5xSdOj+fS/uz7zluIy6bMM1fkkQ==\"\n      },\n      \"Microsoft.CodeAnalysis.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0-2.25625.1\",\n        \"contentHash\": \"4Yhh2fnu3G+J0J1lDc8WZVgMjgbynSeTfkl5IFJMFrmiIO0sc7Tjx+f3sFVV8Sd35PrIUWfof0RWc3lAMl7Azg==\"\n      },\n      \"Microsoft.CodeAnalysis.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"uC0qk3jzTQY7i90ehfnCqaOZpBUGJyPMiHJ3c0jOb8yaPBjWzIhVdNxPbeVzI74DB0C+YgBKPLqUkgFZzua5Mg==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"SQFNGQF4f7UfDXKxMzzGNMr3fjrPDIjLfmRvvVgDCw+dyvEHDaRfHuKA5q0Pr0/JW0Gcw89TxrxrS/MjwBvluQ==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.VisualBasic\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"AJxddsIOmfimuihaLuSAm4c/zskHoL1ypAjIpSOZqHlNm2iuw0twsB8nbKczJyfClqD7+iYjdIeE5EV8WAyxRA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Workspaces.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"QSf1ge9A+XFZbGL+gIqXYBIKlm8QdQVLvHDPZiydG11W6mJY7XBMusrsgIEz6L8GYMzGJKTM78m9icliGMF7NA==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeCoverage\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"9O0BtCfzCWrkAmK187ugKdq72HHOXoOUjuWFDVc2LsZZ0pOnA9bTt+Sg9q4cF+MoAaUU+MuWtvBuFsnduviJow==\"\n      },\n      \"Microsoft.Composition\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.27\",\n        \"contentHash\": \"pwu80Ohe7SBzZ6i69LVdzowp6V+LaVRzd5F7A6QlD42vQkX0oT7KXKWWPlM/S00w1gnMQMRnEdbtOV12z6rXdQ==\"\n      },\n      \"Microsoft.Extensions.DependencyInjection\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"MCPrg7v3QgNMr0vX4vzRXvkNGgLg8vKWX0nKCWUxu2uPyMsaRgiRc1tHBnbTcfJMhMKj2slE/j2M9oGkd25DNw==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.DependencyInjection.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"+6f2qv2a3dLwd5w6JanPIPs47CxRbnk+ZocMJUhv9NxP88VlOcJYZs9jY+MYSjxvady08bUZn6qgiNh7DadGgg==\"\n      },\n      \"Microsoft.Extensions.Logging\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"crjWyORoug0kK7RSNJBTeSE6VX8IQgLf3nUpTB9m62bPXp/tzbnOsnbe8TXEG0AASNaKZddnpHKw7fET8E++Pg==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Options\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.Logging.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"g0UfujELzlLbHoVG8kPKVBaW470Ewi+jnptGS9KUi6jcb+k2StujtK3m26DFSGGwQ/+bVgZfsWqNzlP6YOejvw==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.Options\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"y2146b3jrPI3Q0lokKXdKLpmXqakYbDIPDV6r3M8SqvSf45WwOTzkyfDpxnZXJsJQEpAsAqjUq5Pu8RCJMjubg==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Primitives\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"N3qEBzmLMYiASUlKxxFIISP4AiwuPTHF5uCh+2CWSwwzAJiIYx0kBJsS30cp1nvhSySFAVi30jecD307jV+8Kg==\"\n      },\n      \"Microsoft.Testing.Extensions.Telemetry\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"7zB8BjffOyvqfHF26rFVPuK0w1fCf5+j1tLuhHIr76CqxXkGb+fMJtq6YNOV+m6qPytExHMXxluk3RgJ+dSIqw==\",\n        \"dependencies\": {\n          \"Microsoft.ApplicationInsights\": \"2.23.0\",\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.Testing.Extensions.TrxReport.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"RD6D1Jx6cKDA5IHd1H2q8ylIuQG3PD+gdULI0JC8CvsRtaypFzTFpB5xDPuQi8o6kAkcM04cBhAiJPxZboNH2Q==\",\n        \"dependencies\": {\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.Testing.Extensions.VSTestBridge\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"D8AGlkNtlTQPe3zf4SLnHBMr13lerMe0RuHSoRfnRatcuX/T7YbRtgn39rWBjKhXsNio0WXKrPKv3gfWE2I46w==\",\n        \"dependencies\": {\n          \"Microsoft.TestPlatform.ObjectModel\": \"18.3.0\",\n          \"Microsoft.Testing.Extensions.Telemetry\": \"2.2.1\",\n          \"Microsoft.Testing.Extensions.TrxReport.Abstractions\": \"2.2.1\",\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.Testing.Platform\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"9bbPuls/b6/vUFzxbSjJLZlJHyKBfOZE5kjIY+ITI2ASqlFPJhR83BdLydJeQOCLEZhEbrEcz5xtt1B69nwSVg==\"\n      },\n      \"Microsoft.Testing.Platform.MSBuild\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"CSJOcZHfKlTyPbS0CTJk6iEnU4gJC+eUA5z72UBnMDRdgVHYOmB8k9Y7jT233gZjnCOQiYFg3acQHRfu2H62nw==\",\n        \"dependencies\": {\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.TestPlatform.ObjectModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"4L6m2kS2pY5uJ9cpeRxzW22opr6ttScIRqsOpMDQpgENp/ZwxkkQCcmc6LRSURo2dFaaSW5KVflQZvroiJ7Wzg==\",\n        \"dependencies\": {\n          \"System.Reflection.Metadata\": \"8.0.0\"\n        }\n      },\n      \"Microsoft.TestPlatform.TestHost\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"gZsCHI+zOmZCcKZieIL4Jg14qKD2OGZOmX5DehuIk1EA9BN6Crm0+taXQNEuajOH1G9CCyBxw8VWR4t5tumcng==\",\n        \"dependencies\": {\n          \"Microsoft.TestPlatform.ObjectModel\": \"18.4.0\",\n          \"Newtonsoft.Json\": \"13.0.3\"\n        }\n      },\n      \"Microsoft.VisualStudio.SolutionPersistence\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.52\",\n        \"contentHash\": \"oNv2JtYXhpdJrX63nibx1JT3uCESOBQ1LAk7Dtz/sr0+laW0KRM6eKp4CZ3MHDR2siIkKsY8MmUkeP5DKkQQ5w==\"\n      },\n      \"Microsoft.Win32.SystemEvents\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"hqTM5628jSsQiv+HGpiq3WKBl2c8v1KZfby2J6Pr7pEPlK9waPdgEO6b8A/+/xn/yZ9ulv8HuqK71ONy2tg67A==\"\n      },\n      \"MSTest.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"1i9jgE/42KGGyZ4s0MdrYM/Uu/dRYhbRfYQifcO0AZ6vw4sBXRjoQGQRGNSm771AYgPAmoGl0u4sJc2lMET6HQ==\"\n      },\n      \"Newtonsoft.Json\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"13.0.3\",\n        \"contentHash\": \"HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==\"\n      },\n      \"NuGet.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"1mp7zmyAGmQfT93ELC4c+MYOrJ8Ff4ekFZRek4JSVLb/wOO/o0bsPfLmqujCsJ2Hlwc+fpq1TQEnjSEgWdt8ng==\",\n        \"dependencies\": {\n          \"NuGet.Frameworks\": \"7.3.1\"\n        }\n      },\n      \"NuGet.Configuration\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"tGxWBo47EQONOaqY+MbEWMrNjFthHgfavLM1HE0RcLyOXVCoQKBlZGV7v0hrS/rJrQKw6ZaBeHetX+ZJgS7Lxg==\",\n        \"dependencies\": {\n          \"NuGet.Common\": \"7.3.1\",\n          \"System.Security.Cryptography.ProtectedData\": \"8.0.0\"\n        }\n      },\n      \"NuGet.Frameworks\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"VUPAE5l/Ir4Gb3dv+v0jq0Qe4nfwxfrfiYN7QhwlGyWPXFKYXSSke1t1bV/ZYd6idtTtRDqJPM49Lt/U8NTocg==\"\n      },\n      \"NuGet.Packaging\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"5bT8uOrNBx4Srhbrd3HonYmyKhWJkvQyTWTYE2jvfPgYx2aCbPmq8MCYko7ce78hEN9mpq2xlrztVhguYPc+GQ==\",\n        \"dependencies\": {\n          \"Newtonsoft.Json\": \"13.0.3\",\n          \"NuGet.Configuration\": \"7.3.1\",\n          \"NuGet.Versioning\": \"7.3.1\",\n          \"System.Security.Cryptography.Pkcs\": \"8.0.1\"\n        }\n      },\n      \"NuGet.Versioning\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"TJrQWSmD1vakfav7qIhDXgDFfaZFfMJ+v6P8tcND9ZqXajD5B/ZzaoGYNzL4D3eDue6vAOUvwzu42G+19JNVUA==\"\n      },\n      \"StyleCop.Analyzers.Unstable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.2.0.556\",\n        \"contentHash\": \"zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==\"\n      },\n      \"System.Collections.Immutable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"AurL6Y5BA1WotzlEvVaIDpqzpIPvYnnldxru8oXJU2yFxFUy3+pNXjXd1ymO+RA0rq0+590Q8gaz2l3Sr7fmqg==\"\n      },\n      \"System.Composition\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"3Djj70fFTraOarSKmRnmRy/zm4YurICm+kiCtI0dYRqGJnLX6nJ+G3WYuFJ173cAPax/gh96REcbNiVqcrypFQ==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\",\n          \"System.Composition.Convention\": \"9.0.0\",\n          \"System.Composition.Hosting\": \"9.0.0\",\n          \"System.Composition.Runtime\": \"9.0.0\",\n          \"System.Composition.TypedParts\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.AttributedModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"iri00l/zIX9g4lHMY+Nz0qV1n40+jFYAmgsaiNn16xvt2RDwlqByNG4wgblagnDYxm3YSQQ0jLlC/7Xlk9CzyA==\"\n      },\n      \"System.Composition.Convention\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"+vuqVP6xpi582XIjJi6OCsIxuoTZfR0M7WWufk3uGDeCl3wGW6KnpylUJ3iiXdPByPE0vR5TjJgR6hDLez4FQg==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.Hosting\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"OFqSeFeJYr7kHxDfaViGM1ymk7d4JxK//VSoNF9Ux0gpqkLsauDZpu89kTHHNdCWfSljbFcvAafGyBoY094btQ==\",\n        \"dependencies\": {\n          \"System.Composition.Runtime\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.Runtime\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"w1HOlQY1zsOWYussjFGZCEYF2UZXgvoYnS94NIu2CBnAGMbXFAX8PY8c92KwUItPmowal68jnVLBCzdrWLeEKA==\"\n      },\n      \"System.Composition.TypedParts\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"aRZlojCCGEHDKqh43jaDgaVpYETsgd7Nx4g1zwLKMtv4iTo0627715ajEFNpEEBTgLmvZuv8K0EVxc3sM4NWJA==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\",\n          \"System.Composition.Hosting\": \"9.0.0\",\n          \"System.Composition.Runtime\": \"9.0.0\"\n        }\n      },\n      \"System.Configuration.ConfigurationManager\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"7T+m0kDSlIPTHIkPMIu6m6tV6qsMqJpvQWW2jIc2qi7sn40qxFo0q+7mEQAhMPXZHMKnWrnv47ntGlM/ejvw3g==\",\n        \"dependencies\": {\n          \"System.Security.Cryptography.ProtectedData\": \"6.0.0\",\n          \"System.Security.Permissions\": \"6.0.0\"\n        }\n      },\n      \"System.Diagnostics.DiagnosticSource\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.0.0\",\n        \"contentHash\": \"tCQTzPsGZh/A9LhhA6zrqCRV4hOHsK90/G7q3Khxmn6tnB1PuNU0cRaKANP2AWcF9bn0zsuOoZOSrHuJk6oNBA==\"\n      },\n      \"System.Diagnostics.EventLog\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"lcyUiXTsETK2ALsZrX+nWuHSIQeazhqPphLfaRxzdGaG93+0kELqpgEHtwWOlQe7+jSFnKwaCAgL4kjeZCQJnw==\"\n      },\n      \"System.Drawing.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"NfuoKUiP2nUWwKZN6twGqXioIe1zVD0RIj2t976A+czLHr2nY454RwwXs6JU9Htc6mwqL6Dn/nEL3dpVf2jOhg==\",\n        \"dependencies\": {\n          \"Microsoft.Win32.SystemEvents\": \"6.0.0\"\n        }\n      },\n      \"System.Reflection.Metadata\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"ptvgrFh7PvWI8bcVqG5rsA/weWM09EnthFHR5SCnS6IN+P4mj6rE1lBDC4U8HL9/57htKAqy4KQ3bBj84cfYyQ==\",\n        \"dependencies\": {\n          \"System.Collections.Immutable\": \"8.0.0\"\n        }\n      },\n      \"System.Security.AccessControl\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"AUADIc0LIEQe7MzC+I0cl0rAT8RrTAKFHl53yHjEUzNVIaUlhFY11vc2ebiVJzVBuOzun6F7FBA+8KAbGTTedQ==\"\n      },\n      \"System.Security.Cryptography.Pkcs\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.1\",\n        \"contentHash\": \"CoCRHFym33aUSf/NtWSVSZa99dkd0Hm7OCZUxORBjRB16LNhIEOf8THPqzIYlvKM0nNDAPTRBa1FxEECrgaxxA==\"\n      },\n      \"System.Security.Cryptography.ProtectedData\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"+TUFINV2q2ifyXauQXRwy4CiBhqvDEDZeVJU7qfxya4aRYOKzVBpN+4acx25VcPB9ywUN6C0n8drWl110PhZEg==\"\n      },\n      \"System.Security.Permissions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"T/uuc7AklkDoxmcJ7LGkyX1CcSviZuLCa4jg3PekfJ7SU0niF0IVTXwUiNVP9DSpzou2PpxJ+eNY2IfDM90ZCg==\",\n        \"dependencies\": {\n          \"System.Security.AccessControl\": \"6.0.0\",\n          \"System.Windows.Extensions\": \"6.0.0\"\n        }\n      },\n      \"System.Windows.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"IXoJOXIqc39AIe+CIR7koBtRGMiCt/LPM3lI+PELtDIy9XdyeSrwXFdWV9dzJ2Awl0paLWUaknLxFQ5HpHZUog==\",\n        \"dependencies\": {\n          \"System.Drawing.Common\": \"6.0.0\"\n        }\n      },\n      \"sonaranalyzer.cfg\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer.Lightup\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.core\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Google.Protobuf\": \"[3.6.1, )\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.CFG\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer.lightup\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      }\n    },\n    \"net9.0\": {\n      \"altcover\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[9.0.102, )\",\n        \"resolved\": \"9.0.102\",\n        \"contentHash\": \"q3Rf5t0M9kXlcO5qhsaAe6NrFSNd5enrhKmF/Ezgmomqw34PbUTbRSYjSDNhS3YGDyUrPTkyPn14EfLDJWztcA==\"\n      },\n      \"Combinatorial.MSTest\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[2.0.0, )\",\n        \"resolved\": \"2.0.0\",\n        \"contentHash\": \"9tB2TMPkuEkYYUq64WREHMMyPt9NfKAyuitpK9yw3zbVe6v/vYkClZTR02+yKFUG+g8XHi5LMTt8jHz4RufGqw==\",\n        \"dependencies\": {\n          \"MSTest.TestFramework\": \"4.0.1\"\n        }\n      },\n      \"FluentAssertions\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[7.2.1, )\",\n        \"resolved\": \"7.2.1\",\n        \"contentHash\": \"MilqBF2lZrT0V1azIA6DG6I/snS0rG3A8ohT2Jjkhq6zOFk76nqx4BPnEnzrX6jFVa6xvkDU++z3PebCGZyJ4g==\",\n        \"dependencies\": {\n          \"System.Configuration.ConfigurationManager\": \"6.0.0\"\n        }\n      },\n      \"FluentAssertions.Analyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[0.34.1, )\",\n        \"resolved\": \"0.34.1\",\n        \"contentHash\": \"2BnAAB8CCPdRA9P1+lAvBZOleR2BTmsxGMtGt+LnABJUARGqoGMWEFxG3znZYqHVIrMP0Za/kyw6atyt8x2mzA==\"\n      },\n      \"Microsoft.Build.Locator\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.11.2, )\",\n        \"resolved\": \"1.11.2\",\n        \"contentHash\": \"tY+/S54G29CGsbL3slVu4vqtpciwVnb3fKOmrhgzEQmu/VziFaWmD/E1e/2KH7cDucuycGSkWsSXndBs5Uawow==\"\n      },\n      \"Microsoft.CodeAnalysis.CSharp.Workspaces\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[5.3.0, )\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"mRwxchBs3ewXK4dqK4R/eVCx99VIq1k/lhwArlu+fJuV0uzmbkTTRw4jR9gN9sOcAQfX0uV9KQlmCk1yC0JNog==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.CSharp\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[3.3.1, )\",\n        \"resolved\": \"3.3.1\",\n        \"contentHash\": \"eT+kgNCDdTRbQ5WF6BGx1HI3D5jYfHteza/koefhWC2vNZGxObA74XxwWfg40dy3uUv7dn3OGKLK5GUPLroVog==\"\n      },\n      \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[5.3.0, )\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"pAGdr4qs7+v287DPiiM8px1cBXnhe8LxymkVGTnCwv2OEjCk5HO2zIoFvype4ivKJTRW3aTUUV8ab+915wbv+w==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.VisualBasic\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Workspaces.MSBuild\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[5.3.0, )\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"2Mg/ppo5dza1e4DJWX4+RIHMc3FgnYzuHTaLRZDupiK1LTi/PAZ1PBpF/iivHVNKQKwipHE984gy37MbM0RO9Q==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.Build.Framework\": \"17.11.48\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"Microsoft.Extensions.DependencyInjection\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Options\": \"9.0.0\",\n          \"Microsoft.Extensions.Primitives\": \"9.0.0\",\n          \"Microsoft.VisualStudio.SolutionPersistence\": \"1.0.52\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.NET.Test.Sdk\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[18.4.0, )\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"w49iZdL4HL6V25l41NVQLXWQ+e71GvSkKVteMrOL02gP/PUkcnO/1yEb2s9FntU4wGmJWfKnyrRAhcMHd9ZZNA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeCoverage\": \"18.4.0\",\n          \"Microsoft.TestPlatform.TestHost\": \"18.4.0\"\n        }\n      },\n      \"MSTest.TestAdapter\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[4.2.1, )\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"lZRgNzaQnffK4XLjM/og4Eoqp/3IkpcyJQQcyKXkPdkzCT3+ghpwHa9zG1xYhQDbUFoc54M+/waLwh31K9stDQ==\",\n        \"dependencies\": {\n          \"MSTest.TestFramework\": \"4.2.1\",\n          \"Microsoft.Testing.Extensions.VSTestBridge\": \"2.2.1\",\n          \"Microsoft.Testing.Platform.MSBuild\": \"2.2.1\"\n        }\n      },\n      \"MSTest.TestFramework\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[4.2.1, )\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"I4/RbS2TpGZ56CE98+jPbrGlcerYtw2LvPVKzQGvyQQcJDekPy2Kd+fnThXYn+geJ1sW+vA9B7++rFNxvKcWxA==\",\n        \"dependencies\": {\n          \"MSTest.Analyzers\": \"4.2.1\"\n        }\n      },\n      \"NSubstitute\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[5.3.0, )\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"lJ47Cps5Qzr86N99lcwd+OUvQma7+fBgr8+Mn+aOC0WrlqMNkdivaYD9IvnZ5Mqo6Ky3LS7ZI+tUq1/s9ERd0Q==\",\n        \"dependencies\": {\n          \"Castle.Core\": \"5.1.1\"\n        }\n      },\n      \"NuGet.Protocol\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[7.3.1, )\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"vYd5vtCJ/tpMQjbAs6rrftNgeh5Ip1w7tnEsDZCpGObKgUgOxHQBekCul3TnzmbNgobvJEkDJNaec5/ZBv66Hg==\",\n        \"dependencies\": {\n          \"NuGet.Packaging\": \"7.3.1\"\n        }\n      },\n      \"SonarAnalyzer.CSharp.Styling\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[10.21.0.135717, )\",\n        \"resolved\": \"10.21.0.135717\",\n        \"contentHash\": \"hl264jF539oB7m2jED5QGM345eFSiDAdoJc8TH0HM6L7ZeqT5TDqZDQeZ8IDP02dVIpH/Fhhn+HsGfEcj8ohyQ==\"\n      },\n      \"StyleCop.Analyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.2.0-beta.556, )\",\n        \"resolved\": \"1.2.0-beta.556\",\n        \"contentHash\": \"llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==\",\n        \"dependencies\": {\n          \"StyleCop.Analyzers.Unstable\": \"1.2.0.556\"\n        }\n      },\n      \"Castle.Core\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.1.1\",\n        \"contentHash\": \"rpYtIczkzGpf+EkZgDr9CClTdemhsrwA/W5hMoPjLkRFnXzH44zDLoovXeKtmxb1ykXK9aJVODSpiJml8CTw2g==\",\n        \"dependencies\": {\n          \"System.Diagnostics.EventLog\": \"6.0.0\"\n        }\n      },\n      \"Google.Protobuf\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"3.6.1\",\n        \"contentHash\": \"741fGeDQjixBJaU2j+0CbrmZXsNJkTn/hWbOh4fLVXndHsCclJmWznCPWrJmPoZKvajBvAz3e8ECJOUvRtwjNQ==\",\n        \"dependencies\": {\n          \"NETStandard.Library\": \"1.6.1\"\n        }\n      },\n      \"Humanizer.Core\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.14.1\",\n        \"contentHash\": \"lQKvtaTDOXnoVJ20ibTuSIOf2i0uO0MPbDhd1jm238I+U/2ZnRENj0cktKZhtchBMtCUSRQ5v4xBCUbKNmyVMw==\"\n      },\n      \"Microsoft.ApplicationInsights\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.23.0\",\n        \"contentHash\": \"nWArUZTdU7iqZLycLKWe0TDms48KKGE6pONH2terYNa8REXiqixrMOkf1sk5DHGMaUTqONU2YkS4SAXBhLStgw==\",\n        \"dependencies\": {\n          \"System.Diagnostics.DiagnosticSource\": \"5.0.0\"\n        }\n      },\n      \"Microsoft.Build.Framework\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"17.11.48\",\n        \"contentHash\": \"C3WIMt2wBl4++NX3jSEpTq5KXBhvAV154R4JrYHkfy9JSBcXWiL0mkgpspk5xSdOj+fS/uz7zluIy6bMM1fkkQ==\"\n      },\n      \"Microsoft.CodeAnalysis.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0-2.25625.1\",\n        \"contentHash\": \"4Yhh2fnu3G+J0J1lDc8WZVgMjgbynSeTfkl5IFJMFrmiIO0sc7Tjx+f3sFVV8Sd35PrIUWfof0RWc3lAMl7Azg==\"\n      },\n      \"Microsoft.CodeAnalysis.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"uC0qk3jzTQY7i90ehfnCqaOZpBUGJyPMiHJ3c0jOb8yaPBjWzIhVdNxPbeVzI74DB0C+YgBKPLqUkgFZzua5Mg==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"SQFNGQF4f7UfDXKxMzzGNMr3fjrPDIjLfmRvvVgDCw+dyvEHDaRfHuKA5q0Pr0/JW0Gcw89TxrxrS/MjwBvluQ==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.VisualBasic\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"AJxddsIOmfimuihaLuSAm4c/zskHoL1ypAjIpSOZqHlNm2iuw0twsB8nbKczJyfClqD7+iYjdIeE5EV8WAyxRA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Workspaces.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"QSf1ge9A+XFZbGL+gIqXYBIKlm8QdQVLvHDPZiydG11W6mJY7XBMusrsgIEz6L8GYMzGJKTM78m9icliGMF7NA==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeCoverage\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"9O0BtCfzCWrkAmK187ugKdq72HHOXoOUjuWFDVc2LsZZ0pOnA9bTt+Sg9q4cF+MoAaUU+MuWtvBuFsnduviJow==\"\n      },\n      \"Microsoft.Composition\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.27\",\n        \"contentHash\": \"pwu80Ohe7SBzZ6i69LVdzowp6V+LaVRzd5F7A6QlD42vQkX0oT7KXKWWPlM/S00w1gnMQMRnEdbtOV12z6rXdQ==\"\n      },\n      \"Microsoft.Extensions.DependencyInjection\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"MCPrg7v3QgNMr0vX4vzRXvkNGgLg8vKWX0nKCWUxu2uPyMsaRgiRc1tHBnbTcfJMhMKj2slE/j2M9oGkd25DNw==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.DependencyInjection.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"+6f2qv2a3dLwd5w6JanPIPs47CxRbnk+ZocMJUhv9NxP88VlOcJYZs9jY+MYSjxvady08bUZn6qgiNh7DadGgg==\"\n      },\n      \"Microsoft.Extensions.Logging\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"crjWyORoug0kK7RSNJBTeSE6VX8IQgLf3nUpTB9m62bPXp/tzbnOsnbe8TXEG0AASNaKZddnpHKw7fET8E++Pg==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Options\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.Logging.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"g0UfujELzlLbHoVG8kPKVBaW470Ewi+jnptGS9KUi6jcb+k2StujtK3m26DFSGGwQ/+bVgZfsWqNzlP6YOejvw==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.Options\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"y2146b3jrPI3Q0lokKXdKLpmXqakYbDIPDV6r3M8SqvSf45WwOTzkyfDpxnZXJsJQEpAsAqjUq5Pu8RCJMjubg==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Primitives\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"N3qEBzmLMYiASUlKxxFIISP4AiwuPTHF5uCh+2CWSwwzAJiIYx0kBJsS30cp1nvhSySFAVi30jecD307jV+8Kg==\"\n      },\n      \"Microsoft.Testing.Extensions.Telemetry\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"7zB8BjffOyvqfHF26rFVPuK0w1fCf5+j1tLuhHIr76CqxXkGb+fMJtq6YNOV+m6qPytExHMXxluk3RgJ+dSIqw==\",\n        \"dependencies\": {\n          \"Microsoft.ApplicationInsights\": \"2.23.0\",\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.Testing.Extensions.TrxReport.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"RD6D1Jx6cKDA5IHd1H2q8ylIuQG3PD+gdULI0JC8CvsRtaypFzTFpB5xDPuQi8o6kAkcM04cBhAiJPxZboNH2Q==\",\n        \"dependencies\": {\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.Testing.Extensions.VSTestBridge\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"D8AGlkNtlTQPe3zf4SLnHBMr13lerMe0RuHSoRfnRatcuX/T7YbRtgn39rWBjKhXsNio0WXKrPKv3gfWE2I46w==\",\n        \"dependencies\": {\n          \"Microsoft.TestPlatform.ObjectModel\": \"18.3.0\",\n          \"Microsoft.Testing.Extensions.Telemetry\": \"2.2.1\",\n          \"Microsoft.Testing.Extensions.TrxReport.Abstractions\": \"2.2.1\",\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.Testing.Platform\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"9bbPuls/b6/vUFzxbSjJLZlJHyKBfOZE5kjIY+ITI2ASqlFPJhR83BdLydJeQOCLEZhEbrEcz5xtt1B69nwSVg==\"\n      },\n      \"Microsoft.Testing.Platform.MSBuild\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"CSJOcZHfKlTyPbS0CTJk6iEnU4gJC+eUA5z72UBnMDRdgVHYOmB8k9Y7jT233gZjnCOQiYFg3acQHRfu2H62nw==\",\n        \"dependencies\": {\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.TestPlatform.ObjectModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"4L6m2kS2pY5uJ9cpeRxzW22opr6ttScIRqsOpMDQpgENp/ZwxkkQCcmc6LRSURo2dFaaSW5KVflQZvroiJ7Wzg==\",\n        \"dependencies\": {\n          \"System.Reflection.Metadata\": \"8.0.0\"\n        }\n      },\n      \"Microsoft.TestPlatform.TestHost\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"gZsCHI+zOmZCcKZieIL4Jg14qKD2OGZOmX5DehuIk1EA9BN6Crm0+taXQNEuajOH1G9CCyBxw8VWR4t5tumcng==\",\n        \"dependencies\": {\n          \"Microsoft.TestPlatform.ObjectModel\": \"18.4.0\",\n          \"Newtonsoft.Json\": \"13.0.3\"\n        }\n      },\n      \"Microsoft.VisualStudio.SolutionPersistence\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.52\",\n        \"contentHash\": \"oNv2JtYXhpdJrX63nibx1JT3uCESOBQ1LAk7Dtz/sr0+laW0KRM6eKp4CZ3MHDR2siIkKsY8MmUkeP5DKkQQ5w==\"\n      },\n      \"Microsoft.Win32.SystemEvents\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"hqTM5628jSsQiv+HGpiq3WKBl2c8v1KZfby2J6Pr7pEPlK9waPdgEO6b8A/+/xn/yZ9ulv8HuqK71ONy2tg67A==\"\n      },\n      \"MSTest.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"1i9jgE/42KGGyZ4s0MdrYM/Uu/dRYhbRfYQifcO0AZ6vw4sBXRjoQGQRGNSm771AYgPAmoGl0u4sJc2lMET6HQ==\"\n      },\n      \"Newtonsoft.Json\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"13.0.3\",\n        \"contentHash\": \"HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==\"\n      },\n      \"NuGet.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"1mp7zmyAGmQfT93ELC4c+MYOrJ8Ff4ekFZRek4JSVLb/wOO/o0bsPfLmqujCsJ2Hlwc+fpq1TQEnjSEgWdt8ng==\",\n        \"dependencies\": {\n          \"NuGet.Frameworks\": \"7.3.1\"\n        }\n      },\n      \"NuGet.Configuration\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"tGxWBo47EQONOaqY+MbEWMrNjFthHgfavLM1HE0RcLyOXVCoQKBlZGV7v0hrS/rJrQKw6ZaBeHetX+ZJgS7Lxg==\",\n        \"dependencies\": {\n          \"NuGet.Common\": \"7.3.1\",\n          \"System.Security.Cryptography.ProtectedData\": \"8.0.0\"\n        }\n      },\n      \"NuGet.Frameworks\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"VUPAE5l/Ir4Gb3dv+v0jq0Qe4nfwxfrfiYN7QhwlGyWPXFKYXSSke1t1bV/ZYd6idtTtRDqJPM49Lt/U8NTocg==\"\n      },\n      \"NuGet.Packaging\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"5bT8uOrNBx4Srhbrd3HonYmyKhWJkvQyTWTYE2jvfPgYx2aCbPmq8MCYko7ce78hEN9mpq2xlrztVhguYPc+GQ==\",\n        \"dependencies\": {\n          \"Newtonsoft.Json\": \"13.0.3\",\n          \"NuGet.Configuration\": \"7.3.1\",\n          \"NuGet.Versioning\": \"7.3.1\",\n          \"System.Security.Cryptography.Pkcs\": \"8.0.1\"\n        }\n      },\n      \"NuGet.Versioning\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"TJrQWSmD1vakfav7qIhDXgDFfaZFfMJ+v6P8tcND9ZqXajD5B/ZzaoGYNzL4D3eDue6vAOUvwzu42G+19JNVUA==\"\n      },\n      \"StyleCop.Analyzers.Unstable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.2.0.556\",\n        \"contentHash\": \"zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==\"\n      },\n      \"System.Collections.Immutable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"AurL6Y5BA1WotzlEvVaIDpqzpIPvYnnldxru8oXJU2yFxFUy3+pNXjXd1ymO+RA0rq0+590Q8gaz2l3Sr7fmqg==\"\n      },\n      \"System.Composition\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"3Djj70fFTraOarSKmRnmRy/zm4YurICm+kiCtI0dYRqGJnLX6nJ+G3WYuFJ173cAPax/gh96REcbNiVqcrypFQ==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\",\n          \"System.Composition.Convention\": \"9.0.0\",\n          \"System.Composition.Hosting\": \"9.0.0\",\n          \"System.Composition.Runtime\": \"9.0.0\",\n          \"System.Composition.TypedParts\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.AttributedModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"iri00l/zIX9g4lHMY+Nz0qV1n40+jFYAmgsaiNn16xvt2RDwlqByNG4wgblagnDYxm3YSQQ0jLlC/7Xlk9CzyA==\"\n      },\n      \"System.Composition.Convention\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"+vuqVP6xpi582XIjJi6OCsIxuoTZfR0M7WWufk3uGDeCl3wGW6KnpylUJ3iiXdPByPE0vR5TjJgR6hDLez4FQg==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.Hosting\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"OFqSeFeJYr7kHxDfaViGM1ymk7d4JxK//VSoNF9Ux0gpqkLsauDZpu89kTHHNdCWfSljbFcvAafGyBoY094btQ==\",\n        \"dependencies\": {\n          \"System.Composition.Runtime\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.Runtime\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"w1HOlQY1zsOWYussjFGZCEYF2UZXgvoYnS94NIu2CBnAGMbXFAX8PY8c92KwUItPmowal68jnVLBCzdrWLeEKA==\"\n      },\n      \"System.Composition.TypedParts\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"aRZlojCCGEHDKqh43jaDgaVpYETsgd7Nx4g1zwLKMtv4iTo0627715ajEFNpEEBTgLmvZuv8K0EVxc3sM4NWJA==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\",\n          \"System.Composition.Hosting\": \"9.0.0\",\n          \"System.Composition.Runtime\": \"9.0.0\"\n        }\n      },\n      \"System.Configuration.ConfigurationManager\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"7T+m0kDSlIPTHIkPMIu6m6tV6qsMqJpvQWW2jIc2qi7sn40qxFo0q+7mEQAhMPXZHMKnWrnv47ntGlM/ejvw3g==\",\n        \"dependencies\": {\n          \"System.Security.Cryptography.ProtectedData\": \"6.0.0\",\n          \"System.Security.Permissions\": \"6.0.0\"\n        }\n      },\n      \"System.Diagnostics.DiagnosticSource\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.0.0\",\n        \"contentHash\": \"tCQTzPsGZh/A9LhhA6zrqCRV4hOHsK90/G7q3Khxmn6tnB1PuNU0cRaKANP2AWcF9bn0zsuOoZOSrHuJk6oNBA==\"\n      },\n      \"System.Diagnostics.EventLog\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"lcyUiXTsETK2ALsZrX+nWuHSIQeazhqPphLfaRxzdGaG93+0kELqpgEHtwWOlQe7+jSFnKwaCAgL4kjeZCQJnw==\"\n      },\n      \"System.Drawing.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"NfuoKUiP2nUWwKZN6twGqXioIe1zVD0RIj2t976A+czLHr2nY454RwwXs6JU9Htc6mwqL6Dn/nEL3dpVf2jOhg==\",\n        \"dependencies\": {\n          \"Microsoft.Win32.SystemEvents\": \"6.0.0\"\n        }\n      },\n      \"System.Reflection.Metadata\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"ptvgrFh7PvWI8bcVqG5rsA/weWM09EnthFHR5SCnS6IN+P4mj6rE1lBDC4U8HL9/57htKAqy4KQ3bBj84cfYyQ==\",\n        \"dependencies\": {\n          \"System.Collections.Immutable\": \"8.0.0\"\n        }\n      },\n      \"System.Security.AccessControl\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"AUADIc0LIEQe7MzC+I0cl0rAT8RrTAKFHl53yHjEUzNVIaUlhFY11vc2ebiVJzVBuOzun6F7FBA+8KAbGTTedQ==\"\n      },\n      \"System.Security.Cryptography.Pkcs\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.1\",\n        \"contentHash\": \"CoCRHFym33aUSf/NtWSVSZa99dkd0Hm7OCZUxORBjRB16LNhIEOf8THPqzIYlvKM0nNDAPTRBa1FxEECrgaxxA==\"\n      },\n      \"System.Security.Cryptography.ProtectedData\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"+TUFINV2q2ifyXauQXRwy4CiBhqvDEDZeVJU7qfxya4aRYOKzVBpN+4acx25VcPB9ywUN6C0n8drWl110PhZEg==\"\n      },\n      \"System.Security.Permissions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"T/uuc7AklkDoxmcJ7LGkyX1CcSviZuLCa4jg3PekfJ7SU0niF0IVTXwUiNVP9DSpzou2PpxJ+eNY2IfDM90ZCg==\",\n        \"dependencies\": {\n          \"System.Security.AccessControl\": \"6.0.0\",\n          \"System.Windows.Extensions\": \"6.0.0\"\n        }\n      },\n      \"System.Windows.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"IXoJOXIqc39AIe+CIR7koBtRGMiCt/LPM3lI+PELtDIy9XdyeSrwXFdWV9dzJ2Awl0paLWUaknLxFQ5HpHZUog==\",\n        \"dependencies\": {\n          \"System.Drawing.Common\": \"6.0.0\"\n        }\n      },\n      \"sonaranalyzer.cfg\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer.Lightup\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.core\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Google.Protobuf\": \"[3.6.1, )\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.CFG\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer.lightup\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/Analyzers/TestGeneratedCodeRecognizerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.VisualBasic;\n\nnamespace SonarAnalyzer.Test.TestFramework.Tests.Analyzers;\n\n[TestClass]\npublic class TestGeneratedCodeRecognizerTest\n{\n    [TestMethod]\n    public void IsGenerated_FromAttribute_CS()\n    {\n        var tree = CSharpSyntaxTree.ParseText(\"[GeneratedCode] public class Sample { }\", null, \"File.cs\");\n        TestGeneratedCodeRecognizer.Instance.IsGenerated(tree).Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void IsGenerated_FromAttribute_VB()\n    {\n        var tree = VisualBasicSyntaxTree.ParseText(\"<GeneratedCode>Public Class Sample : End Class\", null, \"File.vb\");\n        TestGeneratedCodeRecognizer.Instance.IsGenerated(tree).Should().BeTrue();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/Build/LanguageOptionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing CS = Microsoft.CodeAnalysis.CSharp;\nusing VB = Microsoft.CodeAnalysis.VisualBasic;\n\nnamespace SonarAnalyzer.TestFramework.Test.Build;\n\n[TestClass]\npublic class LanguageOptionsTest\n{\n    [TestMethod]\n    public void ExpectedLanguageVersion()\n    {\n        var vbOptions = LanguageOptions.FromVisualBasic12.Cast<VB.VisualBasicParseOptions>().Select(x => x.LanguageVersion);\n        var csOptions = LanguageOptions.FromCSharp6.Cast<CS.CSharpParseOptions>().Select(x => x.LanguageVersion);\n        if (!TestEnvironment.IsAzureDevOpsContext || TestEnvironment.IsPullRequestBuild)\n        {\n            csOptions.Should().BeEquivalentTo([CS.LanguageVersion.CSharp6]);\n            vbOptions.Should().BeEquivalentTo([VB.LanguageVersion.VisualBasic12]);\n        }\n        else\n        {\n            // This should fail when we add new language version\n            csOptions.Should().BeEquivalentTo([\n                CS.LanguageVersion.CSharp6,\n                CS.LanguageVersion.CSharp7,\n                CS.LanguageVersion.CSharp7_1,\n                CS.LanguageVersion.CSharp7_2,\n                CS.LanguageVersion.CSharp7_3,\n                CS.LanguageVersion.CSharp8,\n                CS.LanguageVersion.CSharp9,\n                CS.LanguageVersion.CSharp10,\n                CS.LanguageVersion.CSharp11,\n                CS.LanguageVersion.CSharp12,\n                CS.LanguageVersion.CSharp13,\n                CS.LanguageVersion.CSharp14\n            ]);\n\n            vbOptions.Should().BeEquivalentTo([\n                VB.LanguageVersion.VisualBasic12,\n                VB.LanguageVersion.VisualBasic14,\n                VB.LanguageVersion.VisualBasic15,\n                VB.LanguageVersion.VisualBasic15_3,\n                VB.LanguageVersion.VisualBasic15_5,\n                VB.LanguageVersion.VisualBasic16\n            ]);\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/Build/ProjectBuilderTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\n\nnamespace SonarAnalyzer.Test.TestFramework.Tests.Build;\n\n[TestClass]\npublic class ProjectBuilderTest\n{\n    private static readonly ProjectBuilder EmptyCS = SolutionBuilder.Create().AddProject(AnalyzerLanguage.CSharp);\n    private static readonly ProjectBuilder EmptyVB = SolutionBuilder.Create().AddProject(AnalyzerLanguage.VisualBasic);\n\n    [TestMethod]\n    public void AddDocument_Null_Throws() =>\n        EmptyCS.Invoking(x => x.AddDocument(null)).Should().Throw<ArgumentNullException>().Which.ParamName.Should().Be(\"path\");\n\n    [TestMethod]\n    public void AddDocument_NoTestCases_Throws() =>\n        EmptyCS.Invoking(x => x.AddDocument(\"FileOutsideExpectedDirectory.cs\")).Should()\n            .Throw<ArgumentException>()\n            .WithMessage(@\"path must contain 'TestCases\\'*\")\n            .Which.ParamName.Should().Be(\"path\");\n\n    [TestMethod]\n    public void AddDocument_UnsupportedExtension_Throws() =>\n        EmptyCS.Invoking(x => x.AddDocument(@\"TestCases\\File.vb\")).Should()\n            .Throw<ArgumentException>()\n            .WithMessage(\"The file extension '.vb' does not match the project language 'C#' nor Razor.*\")\n            .Which.ParamName.Should().Be(\"path\");\n\n    [TestMethod]\n    public void AddDocument_ValidExtension()\n    {\n        EmptyCS.AddDocument(@\"TestCases\\ProjectBuilder.AddDocument.cs\").FindDocument(\"ProjectBuilder.AddDocument.cs\").Should().NotBeNull();\n        EmptyVB.AddDocument(@\"TestCases\\ProjectBuilder.AddDocument.vb\").FindDocument(\"ProjectBuilder.AddDocument.vb\").Should().NotBeNull();\n    }\n\n    [TestMethod]\n    public void AddDocument_MismatchingExtension()\n    {\n        EmptyCS.Invoking(x => x.AddDocument(@\"TestCases\\ProjectBuilder.AddDocument.vb\")).Should().Throw<ArgumentException>();\n        EmptyVB.Invoking(x => x.AddDocument(@\"TestCases\\ProjectBuilder.AddDocument.cs\")).Should().Throw<ArgumentException>();\n    }\n\n    [TestMethod]\n    public void AddDocument_InvalidExtension()\n    {\n        EmptyCS.Invoking(x => x.AddDocument(@\"TestCases\\ProjectBuilder.AddDocument.unknown\")).Should().Throw<ArgumentException>();\n        EmptyVB.Invoking(x => x.AddDocument(@\"TestCases\\ProjectBuilder.AddDocument.unknown\")).Should().Throw<ArgumentException>();\n    }\n\n    [TestMethod]\n    public void AddAdditionalDocument_SupportsRazorFiles() =>\n        AssertAdditionalDocumentContains(EmptyCS.AddAdditionalDocument(@\"TestCases\\ProjectBuilder.AddDocument.razor\"), \"ProjectBuilder.AddDocument.razor\");\n\n    [TestMethod]\n    public void AddAdditionalDocument_CsharpSupportsCshtmlFiles() =>\n        AssertAdditionalDocumentContains(EmptyCS.AddAdditionalDocument(@\"TestCases\\ProjectBuilder.AddDocument.cshtml\"), \"ProjectBuilder.AddDocument.cshtml\");\n\n    [TestMethod]\n    [DataRow(\"cshtml\")]\n    [DataRow(\"razor\")]\n    public void AddAdditionalDocument_VbnetDoesntSupportRazorFiles(string extension) =>\n        EmptyVB.Invoking(x => x.AddAdditionalDocument(@$\"TestCases\\ProjectBuilder.AddDocument.{extension}\")).Should().Throw<ArgumentException>();\n\n    [TestMethod]\n    public void AddAdditionalDocument_CsharpDoesntSupportVbhtmlFiles() =>\n        EmptyCS.Invoking(x => x.AddAdditionalDocument(@\"TestCases\\ProjectBuilder.AddDocument.vbhtml\")).Should().Throw<ArgumentException>();\n\n    [TestMethod]\n    public void AddAdditionalDocument_VbnetDoesntSupportVbhtmlFiles() =>\n        EmptyVB.Invoking(x => x.AddAdditionalDocument(@\"TestCases\\ProjectBuilder.AddDocument.vbhtml\")).Should().Throw<ArgumentException>();\n\n    [TestMethod]\n    public void AddSnippet_Null_Throws() =>\n        EmptyCS.Invoking(x => x.AddSnippet(null)).Should().Throw<ArgumentNullException>().Which.ParamName.Should().Be(\"code\");\n\n    [TestMethod]\n    public void AddAnalyzerReferences_Null_Throws() =>\n        EmptyCS.Invoking(x => x.AddAnalyzerReferences(null)).Should().Throw<ArgumentNullException>().Which.ParamName.Should().Be(\"sourceGenerators\");\n\n    [TestMethod]\n    public void AddAnalyzerReferences_NullAnalyzer_Throws() =>\n        EmptyCS.Invoking(x => x.AddAnalyzerReferences([null])).Should().Throw<ArgumentNullException>();\n\n    [TestMethod]\n    public void AddAnalyzerReferences_AddAnalyzer() =>\n        EmptyCS.AddAnalyzerReferences(SdkPathProvider.SourceGenerators).Project.AnalyzerReferences.Should().BeEquivalentTo(SdkPathProvider.SourceGenerators);\n\n    private static void AssertAdditionalDocumentContains(ProjectBuilder builder, string fileName) =>\n        builder.Project.AdditionalDocuments.Should().ContainSingle(x => x.Name == Path.Combine(Directory.GetCurrentDirectory(), \"TestCases\", fileName));\n\n    [TestMethod]\n    public void AddAnalyzerConfigDocument_ShouldAddDocumentToProject() =>\n        EmptyCS.AddAnalyzerConfigDocument(\"path/to/config.editorconfig\", \"root = true\").Project\n            .AnalyzerConfigDocuments.SingleOrDefault(d => d.Name == \"path/to/config.editorconfig\").Should().NotBeNull();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/Build/SnippetCompilerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Test.TestFramework.Tests.Build;\n\n[TestClass]\npublic class SnippetCompilerTest\n{\n    [TestMethod]\n    public void AllowsUnsafe_CS()\n    {\n        const string code = \"\"\"\n            public class Sample\n            {\n                public void Main()\n                {\n                    int i = 0;\n                    unsafe\n                    {\n                        i = 42;\n                    }\n                }\n            }\n            \"\"\";\n        var sut = new SnippetCompiler(code);\n        sut.Tree.Should().NotBeNull();\n        sut.Model.Should().NotBeNull();\n    }\n\n    [TestMethod]\n    public void ImportsDefaultNamespaces_VB()\n    {\n        const string code = \"\"\"\n            ' No Using statement for System.Exception\n            Public Class Sample\n                Inherits Exception\n\n            End Class\n            \"\"\";\n        var sut = new SnippetCompiler(code, false, AnalyzerLanguage.VisualBasic);\n        sut.Tree.Should().NotBeNull();\n        sut.Model.Should().NotBeNull();\n    }\n\n    [TestMethod]\n    public void IgnoreErrors_CreatesCompilation()\n    {\n        const string code = \"\"\"\n            public class Sample\n            {\n            // Error CS1519 Invalid token '{' in class, record, struct, or interface member declaration\n            // Error CS1513 } expected\n            {\n            \"\"\";\n        var sut = new SnippetCompiler(code, true, AnalyzerLanguage.CSharp);\n        sut.Tree.Should().NotBeNull();\n        sut.Model.Should().NotBeNull();\n    }\n\n    [TestMethod]\n    public void ValidCode_DoNotIgnoreErrors_CreatesCompilation()\n    {\n        const string code = \"\"\"\n            public class Sample\n            {\n                public void Main()\n                {\n                }\n            }\n            \"\"\";\n        var sut = new SnippetCompiler(code);\n        sut.Tree.Should().NotBeNull();\n        sut.Model.Should().NotBeNull();\n    }\n\n    [TestMethod]\n    public void CodeWithWarning_DoNotIgnoreErrors_CreatesCompilation()\n    {\n        const string code = \"\"\"\n            public class Sample\n            {\n                public void Main()\n                {\n                    // Warning CS0219 The variable 'i' is assigned but its value is never used\n                    int i = 42;\n                    // Warning CS1030 #warning: 'Show CS1030' on this line\n            #warning Show CS1030 on this line\n                }\n            }\n            \"\"\";\n        // Severity=Warning is not an error and should not throw\n        var sut = new SnippetCompiler(code);\n        sut.Tree.Should().NotBeNull();\n        sut.Model.Should().NotBeNull();\n    }\n\n    [TestMethod]\n    public void InvalidCode_DoNotIgnoreErrors_Throws()\n    {\n        const string code = \"\"\"\n            public class Sample\n            {\n            // Error CS1519 Invalid token '{' in a member declaration\n            // Error CS1513 } expected\n            {\n            \"\"\";\n        using var log = new LogTester();\n        Func<SnippetCompiler> f = () => new SnippetCompiler(code);\n        f.Should().Throw<InvalidOperationException>();\n        log.AssertContain(\"CS1519 Line: 4: Invalid token '{' in a member declaration\");\n        log.AssertContain(\"CS1513 Line: 4: } expected\");\n    }\n\n    [TestMethod]\n    public void NamespaceSymbol_NamespaceExists_ReturnsSymbol()\n    {\n        const string code = \"\"\"\n            namespace Test {\n                public class Sample { }\n            }\n            \"\"\";\n        var sut = new SnippetCompiler(code);\n        var namespaceSymbol = sut.NamespaceSymbol(\"Test\");\n        namespaceSymbol.Name.Should().Be(\"Test\");\n    }\n\n    [TestMethod]\n    public void NamespaceSymbol_NestedNamespaces_ReturnsSymbols()\n    {\n        const string code = \"\"\"\n            namespace Test {\n                namespace Nested {\n                    public class Sample { }\n                }\n            }\n            \"\"\";\n        var sut = new SnippetCompiler(code);\n        var namespaceSymbol = sut.NamespaceSymbol(\"Test\");\n        namespaceSymbol.Name.Should().Be(\"Test\");\n        var nestedNamespaceSymbol = sut.NamespaceSymbol(\"Nested\");\n        nestedNamespaceSymbol.Name.Should().Be(\"Nested\");\n    }\n\n    [TestMethod]\n    public void NamespaceSymbol_NestedNamespacesWithDot_ReturnsSymbols()\n    {\n        const string code = \"\"\"\n            namespace Test.Nested {\n                 public class Sample { }\n            }\n            \"\"\";\n        var sut = new SnippetCompiler(code);\n        // Searching in nested namespaces of the form Namespace.NestedNamespace\n        // is not supported by this method. We can get back the symbol of the most nested namespace.\n        var namespaceSymbol = sut.NamespaceSymbol(\"Nested\");\n        namespaceSymbol.Name.Should().Be(\"Nested\");\n    }\n\n    [TestMethod]\n    public void NamespaceSymbol_FileScopedNamespace_ReturnsSymbol()\n    {\n        const string code = \"\"\"\n            namespace Test;\n            public class Sample { }\n\n            \"\"\";\n        var sut = new SnippetCompiler(code);\n        var namespaceSymbol = sut.NamespaceSymbol(\"Test\");\n        namespaceSymbol.Name.Should().Be(\"Test\");\n    }\n\n    [TestMethod]\n    public void MethodDeclaration_CS()\n    {\n        var sut = new SnippetCompiler(\"\"\"\n            public class Sample\n            {\n                public int WrongOne() => 42;\n                public int Method() => 42;\n            }\n            \"\"\");\n        sut.MethodDeclaration(\"Sample.Method\").Should().NotBeNull().And.Subject.ToString().Should().Contain(\"Method()\");\n    }\n\n    [TestMethod]\n    public void MethodDeclaration_VB()\n    {\n        var sut = new SnippetCompiler(\"\"\"\n            Public Class Sample\n                Public Sub WrongOne() : End Sub\n                Public Sub Method1() : End Sub\n                Public Function Method2() : End Function\n            End Class\n            \"\"\", false, AnalyzerLanguage.VisualBasic);\n        sut.MethodDeclaration(\"Sample.Method1\").Should().NotBeNull().And.Subject.ToString().Should().Contain(\"Method1()\");\n        sut.MethodDeclaration(\"Sample.Method2\").Should().NotBeNull().And.Subject.ToString().Should().Contain(\"Method2()\");\n    }\n\n    [TestMethod]\n    public void DeclaredSymbol_CS()\n    {\n        var sut = new SnippetCompiler(\"public class Sample { public class Nested { } }\");\n        var type = sut.DeclaredSymbol(\"Nested\");\n        type.Should().NotBeNull();\n        type.Name.Should().Be(\"Nested\");\n    }\n\n    [TestMethod]\n    public void DeclaredSymbol_VB()\n    {\n        var sut = new SnippetCompiler(\"Public Class Sample : Public Class Nested : End Class : End Class\", false, AnalyzerLanguage.VisualBasic);\n        var type = sut.DeclaredSymbol(\"Nested\");\n        type.Should().NotBeNull();\n        type.Name.Should().Be(\"Nested\");\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/Common/EditorConfigGeneratorTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.TestFramework.Test.Common;\n\n/*\n * This class is copy-pasted from EditorConfigGeneratorTest in Autoscan .Net.\n * See https://github.com/SonarSource/sonar-dotnet-autoscan/blob/master/AutoScan.NET.Test/Build/EditorConfigGeneratorTest.cs\n*/\n[TestClass]\npublic class EditorConfigGeneratorTest\n{\n    [TestMethod]\n    public void EditorConfigGenerator_NullRootPath_Throws()\n    {\n        var createWithNull = () => _ = new EditorConfigGenerator(null);\n        createWithNull.Should().Throw<ArgumentException>().And.ParamName.Should().Be(\"rootPath\");\n    }\n\n    [TestMethod]\n    public void EditorConfigGenerator_EmptyOrWhiteSpaceRootPath_Throws()\n    {\n        var createWithEmpty = () => _ = new EditorConfigGenerator(string.Empty);\n        createWithEmpty.Should().Throw<ArgumentException>().And.ParamName.Should().Be(\"rootPath\");\n\n        var createWithWhiteSpace = () => _ = new EditorConfigGenerator(\"     \");\n        createWithWhiteSpace.Should().Throw<ArgumentException>().And.ParamName.Should().Be(\"rootPath\");\n    }\n\n    [TestMethod]\n    public void GenerateEditorConfig_NullRazorFiles_Throws()\n    {\n        var generateWithNull = () => _ = new EditorConfigGenerator(\"C:/Users\").Generate(null);\n        generateWithNull.Should().Throw<ArgumentNullException>().And.ParamName.Should().Be(\"source\");\n    }\n\n    [TestMethod]\n    public void GenerateEditorConfig_EmptyCollection_ValidEditorConfig()\n    {\n        var rootPath = \"C:/Users/Johnny/source/repos/WebApplication\";\n        var editorConfig = new EditorConfigGenerator(rootPath).Generate([]);\n        editorConfig.Should().Be(\"is_global = true\");\n    }\n\n    [TestMethod]\n    public void GenerateEditorConfig_SingleFile_ValidEditorConfig()\n    {\n        var rootPath = \"C:/Users/Johnny/source/repos/WebApplication\";\n        var razorFile = \"C:/Users/Johnny/source/repos/WebApplication/Component.razor\";\n        var editorConfig = new EditorConfigGenerator(rootPath).Generate([razorFile]);\n        editorConfig.Should().BeIgnoringLineEndings(\"\"\"\n            is_global = true\n            [C:/Users/Johnny/source/repos/WebApplication/Component.razor]\n            build_metadata.AdditionalFiles.TargetPath = Q29tcG9uZW50LnJhem9y\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void GenerateEditorConfig_MultipleFiles_ValidEditorConfig()\n    {\n        var rootPath = \"C:/Users/Johnny/source/repos/WebApplication\";\n        var razorFiles = new List<string>()\n        {\n            \"C:/Users/Johnny/source/repos/WebApplication/Component.razor\",\n            \"C:/Users/Johnny/source/repos/WebApplication/Folder/Child.razor\",\n            \"C:/Users/Johnny/source/repos/Parent.razor\"\n        };\n        var editorConfig = new EditorConfigGenerator(rootPath).Generate(razorFiles);\n        editorConfig.Should().BeIgnoringLineEndings(\"\"\"\n            is_global = true\n            [C:/Users/Johnny/source/repos/WebApplication/Component.razor]\n            build_metadata.AdditionalFiles.TargetPath = Q29tcG9uZW50LnJhem9y\n            [C:/Users/Johnny/source/repos/WebApplication/Folder/Child.razor]\n            build_metadata.AdditionalFiles.TargetPath = Rm9sZGVyXENoaWxkLnJhem9y\n            [C:/Users/Johnny/source/repos/Parent.razor]\n            build_metadata.AdditionalFiles.TargetPath = Li5cUGFyZW50LnJhem9y\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void GenerateEditorConfig_NullFile_Throws()\n    {\n        var rootPath = \"C:/Users/Johnny/source/repos/WebApplication\";\n        var generateWithNullElement = () => _ = new EditorConfigGenerator(rootPath).Generate([null]);\n        generateWithNullElement.Should().Throw<NullReferenceException>();\n    }\n\n    [TestMethod]\n    [DataRow(\"\")]\n    [DataRow(\"          \")]\n    public void GenerateEditorConfig_EmptyFile_Throws(string element)\n    {\n        var rootPath = \"C:/Users/Johnny/source/repos/WebApplication\";\n        var generateWithNullElement = () => _ = new EditorConfigGenerator(rootPath).Generate([element]);\n        generateWithNullElement.Should().Throw<ArgumentException>();\n    }\n\n    [TestMethod]\n    public void GenerateEditorConfig_MixedFiles_Throws()\n    {\n        var rootPath = \"C:/Users/Johnny/source/repos/WebApplication\";\n        var generateMixedWithNullElement = () => _ = new EditorConfigGenerator(rootPath).Generate([null, \"C:/Users/Johnny/source/repos/WebApplication/Component.razor\", string.Empty]);\n        generateMixedWithNullElement.Should().Throw<NullReferenceException>();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/Common/EnvironmentVariableScopeTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Test.TestFramework.Tests.Common;\n\n[TestClass]\npublic class EnvironmentVariableScopeTest\n{\n    private const string VariableName = \"RANDOM__ENVIRONMENT__VARIABLE__THAT__DOES__NOT__EXIST__ANYWHERE\";\n\n    [TestMethod]\n    public void SetVariable_SetsAndRestores()\n    {\n        Environment.GetEnvironmentVariable(VariableName).Should().BeNullOrEmpty();\n        using (var scope = new EnvironmentVariableScope())\n        {\n            scope.SetVariable(VariableName, \"Lorem ipsum\");\n            Environment.GetEnvironmentVariable(VariableName).Should().Be(\"Lorem ipsum\");\n            scope.SetVariable(VariableName, \"Dolor sit amet\");\n            Environment.GetEnvironmentVariable(VariableName).Should().Be(\"Dolor sit amet\");\n        }\n        Environment.GetEnvironmentVariable(VariableName).Should().BeNullOrEmpty();\n    }\n\n    [TestMethod]\n    public void Dispose_Twice_DoesNotFail()\n    {\n        using var outer = new EnvironmentVariableScope();\n        outer.SetVariable(VariableName, \"Original\");\n        var sut = new EnvironmentVariableScope();\n        sut.SetVariable(VariableName, \"SUT\");\n        Environment.GetEnvironmentVariable(VariableName).Should().Be(\"SUT\");\n        sut.Dispose();\n        sut.Invoking(x => x.Dispose()).Should().NotThrow();  // Invoked for the second time\n        Environment.GetEnvironmentVariable(VariableName).Should().Be(\"Original\");\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/Common/LogTesterTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing FluentAssertions.Execution;\n\nnamespace SonarAnalyzer.Test.TestFramework.Tests.Common;\n\n[TestClass]\npublic class LogTesterTest\n{\n    private const string StandardMessage = nameof(StandardMessage);\n    private const string ErrorMessage = nameof(ErrorMessage);\n\n    [TestMethod]\n    public void AssertContain_CapturesStandardStream()\n    {\n        using var sut = new LogTester();\n        Console.WriteLine(StandardMessage);\n        Console.Error.WriteLine(ErrorMessage);\n\n        sut.Invoking(x => x.AssertContain(StandardMessage)).Should().NotThrow();\n        sut.Invoking(x => x.AssertContain(ErrorMessage)).Should().Throw<AssertionFailedException>();\n    }\n\n    [TestMethod]\n    public void AssertContainError_CapturesErrorStream()\n    {\n        using var sut = new LogTester();\n        Console.WriteLine(StandardMessage);\n        Console.Error.WriteLine(ErrorMessage);\n\n        sut.Invoking(x => x.AssertContainError(StandardMessage)).Should().Throw<AssertionFailedException>();\n        sut.Invoking(x => x.AssertContainError(ErrorMessage)).Should().NotThrow();\n    }\n\n    [TestMethod]\n    public void Dispose_StopsCapturing()\n    {\n        Console.WriteLine(StandardMessage);\n        Console.Error.WriteLine(ErrorMessage);\n        var sut = new LogTester();\n        // Nothing to write. Messages were written before and after.\n        sut.Dispose();\n        Console.WriteLine(StandardMessage);\n        Console.Error.WriteLine(ErrorMessage);\n\n        sut.Invoking(x => x.AssertContain(StandardMessage)).Should().Throw<AssertionFailedException>();\n        sut.Invoking(x => x.AssertContainError(ErrorMessage)).Should().Throw<AssertionFailedException>();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/Common/SdkPathProviderTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\n\nnamespace SonarAnalyzer.TestFramework.Test.Common;\n\n[TestClass]\npublic class SdkPathProviderTest\n{\n    private static AnalyzerFileReference RazorSourceGenerator =>\n        SdkPathProvider.SourceGenerators.Single(x => x.FullPath.EndsWith(\"Microsoft.CodeAnalysis.Razor.Compiler.dll\"));\n\n    [TestMethod]\n    public void SourceGenerators_ContainsRazorSourceGenerator() =>\n        SdkPathProvider.SourceGenerators.Should()\n            .Contain(x => x.FullPath.EndsWith(Path.Combine(\"Sdks\", \"Microsoft.NET.Sdk.Razor\", \"source-generators\", \"Microsoft.CodeAnalysis.Razor.Compiler.dll\")));\n\n    [TestMethod]\n    public void RazorSourceGenerator_ExistsLocally() =>\n        File.Exists(RazorSourceGenerator.FullPath).Should().BeTrue();\n\n    [TestMethod]\n    public void RazorSourceGenerator_LoadsCorrectAssembly() =>\n        RazorSourceGenerator.GetAssembly().GetName().Name.Should().Be(\"Microsoft.CodeAnalysis.Razor.Compiler\");\n\n    [TestMethod]\n    public void LatestSdkVersion_ReturnsAssemblyMajor()\n    {\n        var latestSdkFolder = SdkPathProvider.LatestSdkFolder();\n        var latestVersion = Version(latestSdkFolder);\n        latestVersion.Major.Should().Be(typeof(object).Assembly.GetName().Version.Major);\n    }\n\n    [TestMethod]\n    public void LatestSdkVersion_PathDoesNotExists() =>\n        ((Func<string>)(() => SdkPathProvider.LatestFolder(\"C:\\\\NonExistingPath\", \"dotnet.dll\"))).Should().Throw<NotSupportedException>();\n\n    [TestMethod]\n    public void LatestSdkFolder_ReturnLatest()\n    {\n        var latestSdkFolder = SdkPathProvider.LatestSdkFolder();\n        var latestVersion = Version(latestSdkFolder);\n        var parentDirectory = Directory.GetParent(latestSdkFolder);\n        parentDirectory.Name.Should().Be(\"sdk\", \"Parent directory of the latest SDK should be 'sdk'\");\n        Directory.GetDirectories(parentDirectory.FullName, $\"{typeof(object).Assembly.GetName().Version.Major}.*\")\n            .Should().NotContain(x => IsHigherVersion(x, latestVersion), \"There should be no SDK folders with a higher version number than the latest SDK folder\");\n    }\n\n    private static bool IsHigherVersion(string directory, Version referenceVersion) =>\n        Version(directory) is var version && version > referenceVersion;\n\n    private static Version Version(string sdkPath)\n    {\n        var version = FileVersionInfo.GetVersionInfo(Path.Combine(sdkPath, \"dotnet.dll\"));\n        return new Version(version.FileMajorPart, version.FileMinorPart, version.FileBuildPart, version.FilePrivatePart);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/Common/TestCompilerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CFG.Roslyn;\n\nnamespace SonarAnalyzer.Test.TestFramework.Tests.Common;\n\n[TestClass]\npublic class TestCompilerTest\n{\n    private const string CompileCfgLambda = \"\"\"\n        public class Sample\n        {\n            public void Method()\n            {\n                System.Func<int> f = () => 42;\n            }\n        }\n        \"\"\";\n\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    public void CompileCfg_LocalfunctionNameAndAnonymousFunctionFragment_Throws() =>\n        ((Func<ControlFlowGraph>)(() => TestCompiler.CompileCfg(CompileCfgLambda, AnalyzerLanguage.CSharp, false, \"LocalFunctionName\", \"AnonymousFunctionFragment\")))\n            .Should()\n            .Throw<InvalidOperationException>()\n            .WithMessage(\"Specify localFunctionName or anonymousFunctionFragment.\");\n\n    [TestMethod]\n    public void CompileCfg_InvalidAnonymousFunctionFragment_Throws() =>\n        ((Func<ControlFlowGraph>)(() => TestCompiler.CompileCfg(CompileCfgLambda, AnalyzerLanguage.CSharp, false, null, \"InvalidFragment\")))\n            .Should()\n            .Throw<ArgumentException>()\n            .WithMessage(\"Anonymous function with 'InvalidFragment' fragment was not found.\");\n\n    [TestMethod]\n    public void Serialize_Default_Throws() =>\n        ((Func<string>)(() => TestCompiler.Serialize(default))).Should().Throw<ArgumentNullException>().Which.ParamName.Should().Be(\"operation\");\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/Common/TestFilesTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Test.TestFramework.Tests.Common;\n\n[TestClass]\npublic class TestFilesTest\n{\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    public void TestPath_ThisTestHasArbitraryLongNameSoWeTestTheBranchThatDependsOnVeryLongTestNames_ThisIsAFunctionalName_DoNotGetInspiredExlamationMark_ThisIsNotCleanAtAllExclamationMark()\n    {\n        TestFiles.TestPath(TestContext, \"This is also pretty long file name that will make sure we exceed the maximum reasonable file length 1.txt\").Should().Contain(\"TooLongTestName.0\");\n        TestFiles.TestPath(TestContext, \"This is also pretty long file name that will make sure we exceed the maximum reasonable file length 2.txt\").Should().Contain(\"TooLongTestName.1\");\n    }\n\n    [TestMethod]\n    [DataRow(@\"C:\\\", @\"C:\\\", @\"\\\")]\n    [DataRow(@\"C:\\a\", @\"C:\\a\\\", @\"\\\")]\n    [DataRow(@\"C:\\A\", @\"C:\\a\\\", @\"\\\")]\n    [DataRow(@\"C:\\a\\\", @\"C:\\a\", @\"\")]\n    [DataRow(@\"C:\\\", @\"C:\\b\", @\"b\")]\n    [DataRow(@\"C:\\a\", @\"C:\\b\", @\"..\\b\")]\n    [DataRow(@\"C:\\a\", @\"C:\\b\\\", @\"..\\b\\\")]\n    [DataRow(@\"C:\\a\\b\", @\"C:\\a\", @\"..\")]\n    [DataRow(@\"C:\\a\\b\", @\"C:\\a\\\", @\"..\")]\n    [DataRow(@\"C:\\a\\b\\\", @\"C:\\a\", @\"..\")]\n    [DataRow(@\"C:\\a\\b\\\", @\"C:\\a\\\", @\"..\")]\n    [DataRow(@\"C:\\a\\b\\c\", @\"C:\\a\\b\", @\"..\")]\n    [DataRow(@\"C:\\a\\b\\c\", @\"C:\\a\\b\\\", @\"..\")]\n    [DataRow(@\"C:\\a\\b\\c\", @\"C:\\a\", @\"..\\..\")]\n    [DataRow(@\"C:\\a\\b\\c\", @\"C:\\a\\\", @\"..\\..\")]\n    [DataRow(@\"C:\\a\\b\\c\\\", @\"C:\\a\\b\", @\"..\")]\n    [DataRow(@\"C:\\a\\b\\c\\\", @\"C:\\a\\b\\\", @\"..\")]\n    [DataRow(@\"C:\\a\\b\\c\\\", @\"C:\\a\", @\"..\\..\")]\n    [DataRow(@\"C:\\a\\b\\c\\\", @\"C:\\a\\\", @\"..\\..\")]\n    [DataRow(@\"C:\\a\\\", @\"C:\\b\", @\"..\\b\")]\n    [DataRow(@\"C:\\a\", @\"C:\\a\\b\", @\"b\")]\n    [DataRow(@\"C:\\a\", @\"C:\\A\\b\", @\"b\")]\n    [DataRow(@\"C:\\a\", @\"C:\\b\\c\", @\"..\\b\\c\")]\n    [DataRow(@\"C:\\a\\\", @\"C:\\a\\b\", @\"b\")]\n    [DataRow(@\"C:\\\", @\"D:\\\", @\"D:\\\")]\n    [DataRow(@\"C:\\\", @\"D:\\b\", @\"D:\\b\")]\n    [DataRow(@\"C:\\\", @\"D:\\b\\\", @\"D:\\b\\\")]\n    [DataRow(@\"C:\\a\", @\"D:\\b\", @\"D:\\b\")]\n    [DataRow(@\"C:\\a\\\", @\"D:\\b\", @\"D:\\b\")]\n    [DataRow(@\"C:\\ab\", @\"C:\\a\", @\"..\\a\")]\n    [DataRow(@\"C:\\a\", @\"C:\\ab\", @\"..\\ab\")]\n    [DataRow(@\"C:\\\", @\"\\\\LOCALHOST\\Share\\b\", @\"\\\\LOCALHOST\\Share\\b\")]\n    [DataRow(@\"\\\\LOCALHOST\\Share\\a\", @\"\\\\LOCALHOST\\Share\\b\", @\"..\\b\")]\n    public void GetRelativePath_ValidPaths_ReturnsRelativePath(string relativeTo, string path, string expected) =>\n        TestFiles.GetRelativePath(relativeTo, path).Should().Be(expected);\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/Extensions/CompilationExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Test.TestFramework.Tests.MetadataReferences;\n\n[TestClass]\npublic class CompilationExtensionsTest\n{\n    [TestMethod]\n    public void LanguageVersionString_Null() =>\n        ((Func<string>)(() => CompilationExtensions.LanguageVersionString(null))).Should().Throw<NotSupportedException>().WithMessage(\"Not supported compilation type: ''\");\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/MetadataReferences/NuGetMetadataFactoryTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\n\nnamespace SonarAnalyzer.Test.TestFramework.Tests.MetadataReferences;\n\n[TestClass]\npublic class NuGetMetadataFactoryTest\n{\n    [TestMethod]\n    public void EnsureInstalled_InstallsMissingPackage()\n    {\n        const string id = \"PayBySquare.TextGenerator.NET\";  // Small package that is not used for other UTs\n        const string version = \"1.0.0\";\n        var packagesFolder = Environment.GetEnvironmentVariable(\"NUGET_PACKAGES\") ?? Path.Combine(Paths.AnalyzersRoot, \"packages\"); // Same as NuGetMetadataFactory.PackagesFolder\n        var packageDir = Path.GetFullPath(Path.Combine(packagesFolder, id, \"Sonar.\" + version, string.Empty));\n        // We need to delete the package from local cache to force the factory to always download it. Otherwise, the code would (almost*) never be covered on CI runs.\n        if (Directory.Exists(packageDir))\n        {\n            Directory.Delete(packageDir, true);\n        }\n        NuGetMetadataFactory.Create(id, version).Should().NotBeEmpty();\n        Directory.Exists(packageDir).Should().BeTrue();\n        // *Almost, because first run on of the day on a new VM after a release of any LATEST package would randomly mark it as covered.\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/MetadataReferences/NugetPackageVersionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.TestFramework.Test.MetadataReferences;\n\n[TestClass]\npublic class NugetPackageVersionsTest\n{\n    [TestMethod]\n    public void Latest_IsNuGetLatestVersion() =>\n        NugetPackageVersions.Latest.Should().Be(TestConstants.NuGetLatestVersion);\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/SonarAnalyzer.TestFramework.Test.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFramework>net10.0</TargetFramework>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\SonarAnalyzer.TestFramework\\SonarAnalyzer.TestFramework.csproj\" />\n    <ProjectReference Include=\"..\\..\\src\\SonarAnalyzer.CSharp\\SonarAnalyzer.CSharp.csproj\">\n      <Aliases>global,csharp</Aliases>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\src\\SonarAnalyzer.VisualBasic\\SonarAnalyzer.VisualBasic.csproj\">\n      <Aliases>global,vbnet</Aliases>\n    </ProjectReference>\n  </ItemGroup>\n\n  <ItemGroup>\n    <Using Include=\"FluentAssertions\" />\n    <Using Include=\"Microsoft.CodeAnalysis\" />\n    <Using Include=\"Microsoft.CodeAnalysis.Diagnostics\" />\n    <Using Include=\"Microsoft.VisualStudio.TestTools.UnitTesting\" />\n    <Using Include=\"SonarAnalyzer.Core.Common\" />\n    <Using Include=\"SonarAnalyzer.TestFramework.Analyzers\" />\n    <Using Include=\"SonarAnalyzer.TestFramework.Build\" />\n    <Using Include=\"SonarAnalyzer.TestFramework.Common\" />\n    <Using Include=\"SonarAnalyzer.TestFramework.Extensions\" />\n    <Using Include=\"SonarAnalyzer.TestFramework.MetadataReferences\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Compile Remove=\"TestCases\\**\\*\" />\n    <None Include=\"TestCases\\**\\*\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/TestCases/DiagnosticVerifierException.Concurrent.cs",
    "content": "﻿// This file needs to exists with .Concurrent. in the name\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/TestCases/DiagnosticVerifierException.File1.cs",
    "content": "﻿// This file needs to exists for DiagnosticVerifierException.StackTrace to be rendered\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/TestCases/DiagnosticVerifierException.File2.cs",
    "content": "﻿// This file needs to exists for DiagnosticVerifierException.StackTrace to be rendered\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/TestCases/DiagnosticsVerifier/ExpectedIssuesNotRaised.cs",
    "content": "﻿public class ExpectedIssuesNotRaised\n{\n    public void Test(bool a, bool b) // Noncompliant [MyId0]\n    {\n        if (a == b) // Noncompliant\n        { } // Secondary [MyId1]\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/TestCases/DiagnosticsVerifier/ExpectedIssuesNotRaised2.cs",
    "content": "﻿public class ExpectedIssuesNotRaised2\n{\n    public void Test(bool a, bool b) // Noncompliant [MyId0]\n    {\n        if (a == b) // Noncompliant\n        { } // Secondary [MyId1]\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/TestCases/Dummy.SecondaryLocation.CSharp10.razor",
    "content": "﻿\n<p>The solution to all problems is: @(RaiseHere(21))</p>\n@*                                    ^^^^^^^^^ *@\n@*                                              ^^ Secondary@-1 *@\n\n@code\n{\n    private int magicNumber = RaiseHere(42);\n//                            ^^^^^^^^^\n//                                      ^^ Secondary@-1\n    private static int RaiseHere(int nb)\n    {\n        return nb;\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/TestCases/Dummy.SecondaryLocation.cshtml",
    "content": "\n<p>The solution to all problems is: @(RaiseHere(21))</p>\n@*                                    ^^^^^^^^^ *@\n@*                                              ^^ Secondary@-1 *@\n\n@functions\n{\n    private int magicNumber = RaiseHere(42);\n//                            ^^^^^^^^^\n//                                      ^^ Secondary@-1\n    private static int RaiseHere(int nb)\n    {\n        return nb;\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/TestCases/Dummy.SecondaryLocation.razor",
    "content": "\n<p>The solution to all problems is: @(RaiseHere(21))</p> @* wrong location see https://sonarsource.atlassian.net/browse/NET-2052 *@\n@*                                                            ^^^^^^^^^ *@\n@*                                                                      ^^ Secondary@-1 *@\n\n@code\n{\n    private int magicNumber = RaiseHere(42);\n//                            ^^^^^^^^^\n//                                      ^^ Secondary@-1\n    private static int RaiseHere(int nb)\n    {\n        return nb;\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/TestCases/Dummy.cshtml",
    "content": "\n<p>The solution to all problems is: @(RaiseHere())</p> @* Noncompliant *@\n@*                                    ^^^^^^^^^ *@\n\n@functions\n{\n    private int magicNumber = RaiseHere(); // Noncompliant\n//                            ^^^^^^^^^\n    private static int RaiseHere()\n    {\n        return 42;\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/TestCases/Dummy.razor",
    "content": "\n<p>The solution to all problems is: @(RaiseHere())</p> @* Noncompliant *@\n\n@code\n{\n    private int magicNumber = RaiseHere(); // Noncompliant\n//                            ^^^^^^^^^\n    private static int RaiseHere()\n    {\n        return 42;\n    }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/TestCases/DummyExpressions.CSharp10.razor",
    "content": "﻿<p>Explicit expression: @(RaiseHere())</p> @* Noncompliant *@\n@*                        ^^^^^^^^^ *@\n\n<p>Implicit expression: @RaiseHere()</p> @* Noncompliant *@\n@*                       ^^^^^^^^^ *@\n\n<p>Multi-statement block: @{ var result = RaiseHere(); }</p>\n@*                                        ^^^^^^^^^ *@\n\n<p>Control structures: @if(RaiseHere() == 42) { <text>42</text> }</p>\n@*                         ^^^^^^^^^ *@\n\n<p>Loops: @for(var i = 0; i < RaiseHere(); i++) { <text>@i</text> }</p>\n@*                            ^^^^^^^^^ *@\n\n<p>Code blocks: @{ RaiseHere(); }</p>\n@*                 ^^^^^^^^^ *@\n\n<p>Lambda expression: @((Func<int>)(() => RaiseHere()))()</p> @* Noncompliant *@\n@*                                        ^^^^^^^^^ *@\n\n<p>Nested multi-statement block: @{ var result2 = RaiseHere(); var result3 = RaiseHere(); }</p>\n@*                                                ^^^^^^^^^ *@\n@*                                                                           ^^^^^^^^^@-1 *@\n\n<p>Nested control structures: @if(RaiseHere() == 42) { <text>@(RaiseHere() + 1)</text> }</p>\n@*                                ^^^^^^^^^ *@\n@*                                                             ^^^^^^^^^@-1 *@\n\n@code\n{\n    private static int RaiseHere() { return 42; }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/TestCases/DummyExpressions.cshtml",
    "content": "<p>Explicit expression: @(RaiseHere())</p> @* Noncompliant *@\n@*                        ^^^^^^^^^ *@\n\n<p>Implicit expression: @RaiseHere()</p> @* Noncompliant *@\n@*                       ^^^^^^^^^ *@\n\n<p>Multi-statement block: @{ var result = RaiseHere(); }</p>\n@*                                        ^^^^^^^^^ *@\n\n<p>Control structures: @if(RaiseHere() == 42) { <text>42</text> }</p>\n@*                         ^^^^^^^^^ *@\n\n<p>Loops: @for(var i = 0; i < RaiseHere(); i++) { <text>@i</text> }</p>\n@*                            ^^^^^^^^^ *@\n\n<p>Code blocks: @{ RaiseHere(); }</p>\n@*                 ^^^^^^^^^ *@\n\n<p>Lambda expression: @((Func<int>)(() => RaiseHere()))()</p>\n@*                                        ^^^^^^^^^ *@\n\n<p>Nested multi-statement block: @{ var result2 = RaiseHere(); var result3 = RaiseHere(); }</p>\n@*                                                ^^^^^^^^^ *@\n@*                                                                           ^^^^^^^^^@-1 *@\n\n<p>Nested control structures: @if(RaiseHere() == 42) { <text>@(RaiseHere() + 1)</text> }</p>\n@*                                ^^^^^^^^^ *@\n@*                                                             ^^^^^^^^^@-1 *@\n\n@functions\n{\n    private static int RaiseHere() { return 42; }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/TestCases/DummyExpressions.razor",
    "content": "﻿<p>Explicit expression: @(RaiseHere())</p> @* Noncompliant, wrong location see https://sonarsource.atlassian.net/browse/NET-2052 *@\n@*                                                ^^^^^^^^^ *@\n\n<p>Implicit expression: @RaiseHere()</p> @* Noncompliant, wrong location see https://sonarsource.atlassian.net/browse/NET-2052 *@\n@*                                               ^^^^^^^^^ *@\n\n<p>Multi-statement block: @{ var result = RaiseHere(); }</p>\n@*                                        ^^^^^^^^^ *@\n\n<p>Control structures: @if(RaiseHere() == 42) { <text>42</text> }</p>\n@*                         ^^^^^^^^^ *@\n\n<p>Loops: @for(var i = 0; i < RaiseHere(); i++) { <text>@i</text> }</p>\n@*                            ^^^^^^^^^ *@\n\n<p>Code blocks: @{ RaiseHere(); }</p>\n@*                 ^^^^^^^^^ *@\n\n<p>Lambda expression: @((Func<int>)(() => RaiseHere()))()</p> @* Noncompliant, wrong location see https://sonarsource.atlassian.net/browse/NET-2052 *@\n@*                                                                 ^^^^^^^^^ *@\n\n<p>Nested multi-statement block: @{ var result2 = RaiseHere(); var result3 = RaiseHere(); }</p>\n@*                                                ^^^^^^^^^ *@\n@*                                                                           ^^^^^^^^^@-1 *@\n\n<p>Nested control structures: @if(RaiseHere() == 42) { <text>@(RaiseHere() + 1)</text> }</p> @* wrong location see https://sonarsource.atlassian.net/browse/NET-2052 *@\n@*                                ^^^^^^^^^ *@\n@*                                                                                      ^^^^^^^^^@-1 *@\n\n@code\n{\n    private static int RaiseHere() { return 42; }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/TestCases/ProjectBuilder.AddDocument.cs",
    "content": "﻿\n// Used for ProjectBuilder assertions\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/TestCases/ProjectBuilder.AddDocument.cshtml",
    "content": "<p>Currently used for ProjectBuilder assertions only</p>"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/TestCases/ProjectBuilder.AddDocument.razor",
    "content": "<p>Currently used for ProjectBuilder assertions only</p>"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/TestCases/ProjectBuilder.AddDocument.vb",
    "content": "﻿\n' Used for ProjectBuilder assertions\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/TestCases/ProjectBuilder.AddDocument.vbhtml",
    "content": "<p>Currently used for ProjectBuilder assertions only</p>"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/TestCases/Verifier/Verifier.BasePath.cs",
    "content": "﻿internal class VerifierBasePath\n{\n    private int dummy = 42; // Noncompliant {{Message for SDummy}}\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/TestCases/Verifier.BasePathAssertFails.cs",
    "content": "﻿public class Sample\n{\n    private int value = 42;\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/TestCases/VerifyCodeFix.Empty.cs",
    "content": "﻿\nnamespace Tests\n{\n    // Only namespace declaration is needed here to raise the issue\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/Verification/CodeFixProviderTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp;\nusing SonarAnalyzer.Core.AnalysisContext;\nusing SonarAnalyzer.Core.Analyzers;\nusing SonarAnalyzer.Core.Extensions;\nusing SonarAnalyzer.TestFramework.Verification;\n\nnamespace SonarAnalyzer.Test.TestFramework.Tests.Verification;\n\n[TestClass]\npublic class CodeFixProviderTest\n{\n    [TestMethod]\n    public void VerifyCodeFix_WithDuplicateIssues()\n    {\n        const string filename = \"VerifyCodeFix.Empty.cs\";\n        var verifier = new VerifierBuilder<TestDuplicateLocationRule>()\n            .WithCodeFix<TestDuplicateLocationRuleCodeFix>()\n            .AddPaths(filename)\n            .WithCodeFixedPaths(filename);\n        Action a = () => verifier.VerifyCodeFix();\n        a.Should().NotThrow();\n    }\n\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n    private class TestDuplicateLocationRule : SonarDiagnosticAnalyzer\n    {\n        public const string DiagnosticId = \"Test42\";\n\n        private readonly DiagnosticDescriptor rule = AnalysisScaffolding.CreateDescriptorMain(DiagnosticId);\n\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(rule);\n\n        protected override void Initialize(SonarAnalysisContext context) =>\n            context.RegisterNodeAction(TestGeneratedCodeRecognizer.Instance, c =>\n            {\n                // Duplicate issues from different analyzer versions, see https://github.com/SonarSource/sonar-dotnet/issues/1109\n                c.ReportIssue(rule, c.Context.Node);\n                c.ReportIssue(rule, c.Context.Node);\n            }, SyntaxKind.NamespaceDeclaration);\n    }\n\n    [ExportCodeFixProvider(LanguageNames.CSharp)]\n    private class TestDuplicateLocationRuleCodeFix : SonarCodeFix\n    {\n        public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(TestDuplicateLocationRule.DiagnosticId);\n\n        protected override Task RegisterCodeFixesAsync(SyntaxNode root, SonarCodeFixContext context)\n        {\n            context.RegisterCodeFix(\"TestTitle\", c => Task.FromResult(context.Document), context.Diagnostics);\n            return Task.CompletedTask;\n        }\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/Verification/DiagnosticVerifierExceptionTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.TestFramework.Verification;\n\nnamespace SonarAnalyzer.Test.TestFramework.Tests.Verification;\n\n[TestClass]\npublic class DiagnosticVerifierExceptionTest\n{\n    [TestMethod]\n    public void Ctor_Empty_Throws() =>\n        ((Func<DiagnosticVerifierException>)(() => new([]))).Should().Throw<ArgumentException>().WithMessage(\"messages cannot be empty*\");\n\n    [TestMethod]\n    public void Ctor_ShortMessageWithoutSpace_Throws() =>\n        ((Func<DiagnosticVerifierException>)(() => new([new(\"NoSpace\", \"Full Descriptin\", \"DiagnosticVerifierException.File1.cs\", 1)]))).Should()\n            .Throw<InvalidOperationException>()\n            .WithMessage(\"Short description must contain space for Rider to display clickable link.\");\n\n    [TestMethod]\n    public void Message_SerializesAllFullDescriptions() =>\n        new DiagnosticVerifierException(\n            [\n                new(\"Short 1\", \"Full 1\", \"File.cs\", 1),\n                new(\"Short 2\", \"Full 2\", \"File.cs\", 1),\n                new(\"Short 3\", \"Full 3 { Does not break formatting\", \"File.cs\", 1),\n                new(\"Short 4\", \"Full 4 } Does not break formatting\", \"File.cs\", 1)\n            ])\n            .Message\n            .Should()\n            .BeIgnoringLineEndings(\"\"\"\n                Full 1\n                Full 2\n                Full 3 { Does not break formatting\n                Full 4 } Does not break formatting\n                \"\"\");\n\n    [TestMethod]\n    public void StackTrace_SerializesShortDescriptions() =>\n        new DiagnosticVerifierException(\n            [\n                new(\"Short 1\", \"Full 1\", \"DiagnosticVerifierException.File1.cs\", 11),\n                new(\"Short 2\", \"Full 2\", \"DiagnosticVerifierException.File1.cs\", 22),\n                new(\"Short 3\", \"Full 3\", \"DiagnosticVerifierException.File1.cs\", 33),\n                new(\"Short 4\", \"Full 4\", \"DiagnosticVerifierException.File1.cs\", 44),\n            ])\n            .StackTrace\n            .Should()\n            .BeIgnoringLineEndings($\"\"\"\n                DiagnosticVerifierException.File1.cs\n                at Short.1() in {Paths.TestsRoot}\\SonarAnalyzer.TestFramework.Test\\TestCases\\DiagnosticVerifierException.File1.cs:line 11\n                at Short.2() in {Paths.TestsRoot}\\SonarAnalyzer.TestFramework.Test\\TestCases\\DiagnosticVerifierException.File1.cs:line 22\n                at Short.3() in {Paths.TestsRoot}\\SonarAnalyzer.TestFramework.Test\\TestCases\\DiagnosticVerifierException.File1.cs:line 33\n                at Short.4() in {Paths.TestsRoot}\\SonarAnalyzer.TestFramework.Test\\TestCases\\DiagnosticVerifierException.File1.cs:line 44\n                ---\n\n                \"\"\");\n\n    [TestMethod]\n    public void StackTrace_SeparatesMultipleFiles() =>\n        new DiagnosticVerifierException(\n            [\n                new(\"Short 1\", \"Full 1\", \"DiagnosticVerifierException.File1.cs\", 11),\n                new(\"Short 2\", \"Full 2\", \"DiagnosticVerifierException.File1.cs\", 22),\n                new(\"Short 3\", \"Full 3\", \"DiagnosticVerifierException.File2.cs\", 33),\n                new(\"Short 4\", \"Full 4\", \"DiagnosticVerifierException.File2.cs\", 44),\n                new(\"Concurrent File\", \"Full 5\", \"DiagnosticVerifierException.Concurrent.cs\", 55) // This file has \".Concurent.\" in the name and exists on the disk, so it should be listed.\n            ])\n            .StackTrace\n            .Should()\n            .BeIgnoringLineEndings($\"\"\"\n                DiagnosticVerifierException.Concurrent.cs\n                at Concurrent.File() in {Paths.TestsRoot}\\SonarAnalyzer.TestFramework.Test\\TestCases\\DiagnosticVerifierException.Concurrent.cs:line 55\n                ---\n                DiagnosticVerifierException.File1.cs\n                at Short.1() in {Paths.TestsRoot}\\SonarAnalyzer.TestFramework.Test\\TestCases\\DiagnosticVerifierException.File1.cs:line 11\n                at Short.2() in {Paths.TestsRoot}\\SonarAnalyzer.TestFramework.Test\\TestCases\\DiagnosticVerifierException.File1.cs:line 22\n                ---\n                DiagnosticVerifierException.File2.cs\n                at Short.3() in {Paths.TestsRoot}\\SonarAnalyzer.TestFramework.Test\\TestCases\\DiagnosticVerifierException.File2.cs:line 33\n                at Short.4() in {Paths.TestsRoot}\\SonarAnalyzer.TestFramework.Test\\TestCases\\DiagnosticVerifierException.File2.cs:line 44\n                ---\n\n                \"\"\");\n\n    [TestMethod]\n    public void StackTrace_Ignore_NullShortDescription() =>\n        new DiagnosticVerifierException(\n            [\n                new(null, \"Full 1\", \"DiagnosticVerifierException.File1.cs\", 11),\n                new(null, \"Full 2\", \"DiagnosticVerifierException.File1.cs\", 22),\n            ])\n            .StackTrace\n            .Should()\n            .BeEmpty();\n\n    [TestMethod]\n    public void StackTrace_Ignore_NonexistentFiles() =>\n        new DiagnosticVerifierException(\n            [\n                new(\"Short 1\", \"Full 1\", \"Nonexistent.cs\", 11),\n                new(\"Short 2\", \"Full 2\", \"Nonexistent.Concurrent.cs\", 22),\n                new(\"Short 3\", \"Full 3\", \"Snippet0.cs\", 33),\n                new(\"Short 4\", \"Full 4\", \"Snippet1.cs\", 44),\n            ])\n            .StackTrace\n            .Should()\n            .BeEmpty();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/Verification/DiagnosticVerifierTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.VisualBasic;\nusing SonarAnalyzer.TestFramework.Verification;\nusing CS = SonarAnalyzer.CSharp.Rules;\nusing VB = SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.TestFramework.Tests.Verification;\n\n[TestClass]\npublic class DiagnosticVerifierTest\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<CS.BinaryOperationWithIdenticalExpressions>();\n\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    public void PrimaryIssueNotExpected() =>\n        VerifyThrows(\"\"\"\n            public class UnexpectedSecondary\n            {\n                public void Test(bool a, bool b)\n                {\n                    // Secondary@+1\n                    if (a == a)\n                    { }\n                }\n            }\n            \"\"\", \"\"\"\n            There are differences for CSharp7 snippet0.cs:\n              Line 6: Unexpected issue 'Correct one of the identical expressions on both sides of operator '=='.' Rule S1764\n            \"\"\");\n\n    [TestMethod]\n    public void SecondaryIssueNotExpected() =>\n        VerifyThrows(\"\"\"\n            public class UnexpectedSecondary\n            {\n                public void Test(bool a, bool b)\n                {\n                    if (a == a) // Noncompliant\n                    { }\n                }\n            }\n            \"\"\", \"\"\"\n            There are differences for CSharp7 snippet0.cs:\n              Line 5 Secondary location: Unexpected issue ''\n            \"\"\");\n\n    [TestMethod]\n    public void UnexpectedSecondaryIssue_WrongId() =>\n        VerifyThrows(\"\"\"\n            public class UnexpectedSecondary\n            {\n                public void Test(bool a, bool b)\n                {\n                    // Secondary@+1 [myWrongId]\n                    if (a == a) // Noncompliant [myId]\n                    { }\n                }\n            }\n            \"\"\", \"\"\"\n            There are differences for CSharp7 snippet0.cs:\n              Line 6 Secondary location: The expected issueId 'myWrongId' does not match the actual issueId 'myId' Rule S1764 ID myId\n            \"\"\");\n\n    [TestMethod]\n    public void UnexpectedSecondaryIssue_WrongIdWithWrongPrimaryMessageAndLocation() =>\n        VerifyThrows(\"\"\"\n            public class UnexpectedSecondary\n            {\n                public void Test(bool a, bool b)\n                {\n                    // Secondary@+1 [myWrongId]\n                    if (a == a) // Noncompliant ^1#1 {{This has wrong message and location and still needs to match secondary ID}} [myId]\n                    { }\n                }\n            }\n            \"\"\", \"\"\"\n            There are differences for CSharp7 snippet0.cs:\n              Line 6: The expected message 'This has wrong message and location and still needs to match secondary ID' does not match the actual message 'Correct one of the identical expressions on both sides of operator '=='.' Rule S1764\n              Line 6 Secondary location: The expected issueId 'myWrongId' does not match the actual issueId '' Rule S1764 ID myWrongId\n            \"\"\");\n\n    [TestMethod]\n    public void UnexpectedSecondaryIssue_MissingExpectedId() =>\n        VerifyThrows(\"\"\"\n            public class UnexpectedSecondary\n            {\n                public void Test(bool a, bool b)\n                {\n                    // Secondary@+1\n                    if (a == a) // Noncompliant [myId]\n                    { }\n                }\n            }\n            \"\"\", \"\"\"\n            There are differences for CSharp7 snippet0.cs:\n              Line 6 Secondary location: The expected issueId '' does not match the actual issueId 'myId' Rule S1764 ID myId\n            \"\"\");\n\n    [TestMethod]\n    public void UnexpectedSecondaryIssue_MissingActualId() =>\n        VerifyThrows(\"\"\"\n            public class UnexpectedSecondary\n            {\n                public void Test(bool a, bool b)\n                {\n                    // Secondary@+1 [myWrongId]\n                    if (a == a) // Noncompliant\n                    { }\n                }\n            }\n            \"\"\", \"\"\"\n            There are differences for CSharp7 snippet0.cs:\n              Line 6 Secondary location: The expected issueId 'myWrongId' does not match the actual issueId '' Rule S1764 ID myWrongId\n            \"\"\");\n\n    [TestMethod]\n    public void UnexpectedSecondaryIssue_WrongIdWithMultipleIssues() =>\n        VerifyThrows(\"\"\"\n            public class UnexpectedSecondary\n            {\n                public void Test(bool a, bool b)\n                {\n                    if (a == a) { if ( b == b) { } } // Noncompliant [idForAA, idForBB]\n                    // Secondary@-1 [wrongId]\n                    // Secondary@-2 [idForAA]\n                }\n            }\n            \"\"\", \"\"\"\n            There are differences for CSharp7 snippet0.cs:\n              Line 5 Secondary location: The expected issueId 'wrongId' does not match the actual issueId 'idForBB' Rule S1764 ID idForBB\n            \"\"\");\n\n    [TestMethod]\n    public void UnexpectedSecondaryIssue_WrongIdsWithWrongLocations() =>\n        VerifyThrows(\"\"\"\n            public class UnexpectedSecondary\n            {\n                public void Test(bool a, bool b, bool c)\n                {\n                    if (a == a) { if ( b == b) { if ( c == c) { } } } // Noncompliant [idForAA, idForBB, idForCC]\n                    // Secondary@-1 ^0#0 [idForAA] All are on wrong location\n                    // Secondary@-2 ^0#0 [wrongId] They should prefer to match on ID first, then on the closest location\n                    // Secondary@-3 ^0#0 [idForCC]\n                }\n            }\n            \"\"\", \"\"\"\n            There are differences for CSharp7 snippet0.cs:\n              Line 5 Secondary location: Should start on column -1 but got column 12 Rule S1764 ID idForAA\n              Line 5 Secondary location: The expected issueId 'wrongId' does not match the actual issueId 'idForBB' Rule S1764 ID idForBB\n              Line 5 Secondary location: Should start on column -1 but got column 42 Rule S1764 ID idForCC\n            \"\"\");\n\n    [TestMethod]\n    public void SecondaryIssueUnexpectedMessage() =>\n        VerifyThrows(\"\"\"\n            public class UnexpectedSecondary\n            {\n                public void Test(bool a, bool b)\n                {\n                    // Secondary@+1 {{Wrong message}}\n                    if (a == a) // Noncompliant\n                    { }\n                }\n            }\n            \"\"\", \"\"\"\n            There are differences for CSharp7 snippet0.cs:\n              Line 6 Secondary location: The expected message 'Wrong message' does not match the actual message ''\n            \"\"\");\n\n    [TestMethod]\n    public void SecondaryIssueUnexpectedStartPosition() =>\n        VerifyThrows(\"\"\"\n            public class UnexpectedSecondary\n            {\n                public void Test(bool a, bool b)\n                {\n                    if (a == a)\n            //               ^ {{Correct one of the identical expressions on both sides of operator '=='.}}\n            //        ^ Secondary@-1\n                    { }\n                }\n            }\n            \"\"\", \"\"\"\n            There are differences for CSharp7 snippet0.cs:\n              Line 5 Secondary location: Should start on column 10 but got column 12\n            \"\"\");\n\n    [TestMethod]\n    public void SecondaryIssueUnexpectedLength() =>\n        VerifyThrows(\"\"\"\n            public class UnexpectedSecondary\n            {\n                public void Test(bool a, bool b)\n                {\n                    if (a == a)\n            //               ^ {{Correct one of the identical expressions on both sides of operator '=='.}}\n            //          ^^^^ Secondary@-1\n                    { }\n                }\n            }\n            \"\"\", \"\"\"\n            There are differences for CSharp7 snippet0.cs:\n              Line 5 Secondary location: Should have a length of 4 but got a length of 1\n            \"\"\");\n\n    [TestMethod]\n    public void ValidVerification() =>\n        builder.AddSnippet(\"\"\"\n            public class UnexpectedSecondary\n            {\n                public void Test(bool a, bool b)\n                {\n                    // Secondary@+1\n                    if (a == a) // Noncompliant\n                    { }\n                }\n            }\n            \"\"\").Invoking(x => x.Verify()).Should().NotThrow();\n\n    [TestMethod]\n    public void BuildError_CS() =>\n        VerifyThrows(\"\"\"\n            public class UnexpectedBuildError\n            {\n            \"\"\", \"\"\"\n            There are differences for CSharp7 snippet0.cs:\n              Line 2: Unexpected error, use // Error [CS1513] } expected\n            \"\"\");\n\n    [TestMethod]\n    public void BuildError_VB() =>\n        new VerifierBuilder<DummyAnalyzerVB>().AddSnippet(\"Public Class UnexpectedBuildError\")\n            .WithConcurrentAnalysis(false)\n            .Invoking(x => x.Verify())\n            .Should().Throw<DiagnosticVerifierException>()\n            .Which.Message.Should().ContainIgnoringLineEndings(\"\"\"\n                There are differences for VisualBasic12 snippet0.vb:\n                  Line 1: Unexpected error, use ' Error [BC30481] 'Class' statement must end with a matching 'End Class'.\n                \"\"\");\n\n    [TestMethod]\n    public void UnexpectedRemainingOpeningCurlyBrace() =>\n        VerifyThrows(\"\"\"\n            public class UnexpectedRemainingCurlyBrace\n            {\n                public void Test(bool a, bool b)\n                {\n                    if (a == a) // Noncompliant {Wrong format message}\n                    { }\n                }\n            }\n            \"\"\",\n            \"\"\"\n            Unexpected '{' is used after the recognized issue pattern. Remove it, or fix the pattern to the valid format:\n            // ^^^^ (Noncompliant|Secondary|Error) ^1#10 [issue-id1, issue-id2] {{Expected message.}} Final note without significant special characters\n            \"\"\");\n\n    [TestMethod]\n    public void UnexpectedRemainingClosingCurlyBrace() =>\n        VerifyThrows(\"\"\"\n            public class UnexpectedRemainingCurlyBrace\n            {\n                public void Test(bool a, bool b)\n                {\n                    if (a == a) // Noncompliant (Another Wrong format message}\n                    { }\n                }\n            }\n            \"\"\",\n            \"\"\"\n            Unexpected '}' is used after the recognized issue pattern. Remove it, or fix the pattern to the valid format:\n            // ^^^^ (Noncompliant|Secondary|Error) ^1#10 [issue-id1, issue-id2] {{Expected message.}} Final note without significant special characters\n            \"\"\");\n\n    [TestMethod]\n    public void ExpectedIssuesNotRaised() =>\n        VerifyThrows(\"\"\"\n            public class ExpectedIssuesNotRaised\n            {\n                public void Test(bool a, bool b) // Noncompliant [MyId0]\n                {\n                    if (a == b) // Noncompliant\n                    { } // Secondary [MyId1]\n                }\n            }\n            \"\"\", \"\"\"\n            There are differences for CSharp7 snippet0.cs:\n              Line 3: Missing expected issue ID MyId0\n              Line 5: Missing expected issue\n              Line 6 Secondary location: Missing expected issue ID MyId1\n            \"\"\");\n\n    [TestMethod]\n    public void ExpectedIssuesNotRaised_WhileBeingRaisedOnceOnTheSameLine() =>\n        VerifyThrows(\"\"\"\n            public class Sample\n            {\n                public void Test(bool a, bool b)\n                {\n                    if (a == a) { if (a == b) {  }  }   // Noncompliant\n                                                        // Noncompliant@-1\n                                                        // Secondary@-2\n                }\n            }\n            \"\"\", \"\"\"\n            There are differences for CSharp7 snippet0.cs:\n              Line 5: Missing expected issue\n            \"\"\");\n\n    [TestMethod]\n    public void ExpectedIssuesNotRaised_MultipleFiles() =>\n        builder.WithBasePath(\"DiagnosticsVerifier\")\n            .AddPaths(\"ExpectedIssuesNotRaised.cs\", \"ExpectedIssuesNotRaised2.cs\")\n            .WithConcurrentAnalysis(false)\n            .Invoking(x => x.Verify())\n            .Should().Throw<DiagnosticVerifierException>()\n            .WithMessage(\"\"\"\n                There are differences for CSharp7 DiagnosticsVerifier\\ExpectedIssuesNotRaised.cs:\n                  Line 3: Missing expected issue ID MyId0\n                  Line 5: Missing expected issue\n                  Line 6 Secondary location: Missing expected issue ID MyId1\n\n                There are differences for CSharp7 DiagnosticsVerifier\\ExpectedIssuesNotRaised2.cs:\n                  Line 3: Missing expected issue ID MyId0\n                  Line 5: Missing expected issue\n                  Line 6 Secondary location: Missing expected issue ID MyId1\n                \"\"\");\n\n    [TestMethod]\n    public void ProjectLevelIssues_CorrectLocation_WrongMessage()\n    {\n        var project = SolutionBuilder.Create()\n            .AddProject(AnalyzerLanguage.VisualBasic)\n            .AddSnippet(\"' Noncompliant ^1#0 {{This is not the correct message.}}\");\n        var compilation = project.GetCompilation(null, new VisualBasicCompilationOptions(OutputKind.DynamicallyLinkedLibrary, optionExplicit: false));\n        ((Action)(() => DiagnosticVerifier.Verify(compilation, [new VB.OptionExplicitOn()], CompilationErrorBehavior.Default, null, [], [])))\n            .Should().Throw<DiagnosticVerifierException>()\n            .WithMessage(\"\"\"\n                There are differences for VisualBasic17_13 <project-level-issue>:\n                  Line 1: The expected message 'This is not the correct message.' does not match the actual message 'Configure 'Option Explicit On' for assembly 'project0'.' Rule S6146\n                \"\"\");\n    }\n\n    [TestMethod]\n    public void ProjectLevelIssues_WrongLocation()\n    {\n        var project = SolutionBuilder.Create()\n            .AddProject(AnalyzerLanguage.VisualBasic)\n            .AddSnippet(\"' Noncompliant@+1 {{This is expected on a wrong line.}}\");\n        var compilation = project.GetCompilation(null, new VisualBasicCompilationOptions(OutputKind.DynamicallyLinkedLibrary, optionExplicit: false));\n        ((Action)(() => DiagnosticVerifier.Verify(compilation, [new VB.OptionExplicitOn()], CompilationErrorBehavior.Default, null, [], [])))\n            .Should().Throw<DiagnosticVerifierException>()\n            .WithMessage(\"\"\"\n                There are differences for VisualBasic17_13 <project-level-issue>:\n                  Line 1: Unexpected issue 'Configure 'Option Explicit On' for assembly 'project0'.' Rule S6146\n\n                There are differences for VisualBasic17_13 snippet0.vb:\n                  Line 2: Missing expected issue 'This is expected on a wrong line.'\n                \"\"\");\n    }\n\n    [TestMethod]\n    [DataRow(\"First.vb\", \"Second.vb\")]  // File ordering should not confuse the matching\n    [DataRow(\"Second.vb\", \"First.vb\")]\n    public void ProjectLevelIssues_HaveExpectedAnnotationWithPath(string projectLevelIssueFile, string fileLevelIssueFile)\n    {\n        var project = SolutionBuilder.Create()\n            .AddProject(AnalyzerLanguage.VisualBasic)\n            .AddSnippet(\"' Noncompliant ^1#0 {{Configure 'Option Explicit On' for assembly 'project0'.}}\", projectLevelIssueFile)\n            .AddSnippet(\"Option Explicit Off ' Noncompliant ^1#19 {{Change this to 'Option Explicit On'.}}\", fileLevelIssueFile);\n        var compilation = project.GetCompilation(null, new VisualBasicCompilationOptions(OutputKind.DynamicallyLinkedLibrary, optionExplicit: false));\n        ((Action)(() => DiagnosticVerifier.Verify(compilation, [new VB.OptionExplicitOn()], CompilationErrorBehavior.Default, null, [], []))).Should().NotThrow();\n    }\n\n    [TestMethod]\n    public void ProjectLevelIssues_MultipleIssuesRaised()\n    {\n        var project = SolutionBuilder.Create()\n            .AddProject(AnalyzerLanguage.VisualBasic)\n            .AddSnippet(\"\"\"\n                ' Noncompliant ^1#0 {{Configure 'Option Explicit On' for assembly 'project0'.}}\n                ' Noncompliant@-1 ^1#0 {{Configure 'Option Strict On' for assembly 'project0'.}}\n                \"\"\");\n        var compilation = project.GetCompilation(null, new VisualBasicCompilationOptions(OutputKind.DynamicallyLinkedLibrary, optionExplicit: false, optionStrict: OptionStrict.Off));\n        var analyzers = new DiagnosticAnalyzer[] { new VB.OptionExplicitOn(), new VB.OptionStrictOn() };\n        ((Action)(() => DiagnosticVerifier.Verify(compilation, analyzers, CompilationErrorBehavior.Default, null, [], [], true))).Should().NotThrow();\n    }\n\n    [TestMethod]\n    public void DiagnosticsAndErrors_IgnoresLineContinuation_VB()\n    {\n        const string code = \"\"\"\n            <AttributeUsage(AttributeTargets.All)>  ' This linecontinuation comment is not valid in VB 12\n            Public Class Sample\n            End Class\n            \"\"\";\n        var compilation = new SnippetCompiler(code, true, AnalyzerLanguage.VisualBasic, parseOptions: new VisualBasicParseOptions(LanguageVersion.VisualBasic12)).Compilation;\n        // We need to place many \"' Noncompliant\" annotations all over the place, so we ignore this error to avoid doing Noncompliant@+1 on too many places\n        DiagnosticVerifier.AnalyzerDiagnostics(compilation, new DummyAnalyzerVB(), CompilationErrorBehavior.FailTest).Should().BeEmpty();\n    }\n\n    [TestMethod]\n    public void Verify_BuildErrors_AreSortedById() =>\n        VerifyThrows(\"\"\"\n            var almostTopLevel =\n            \"\"\", \"\"\"\n            There are differences for CSharp7 snippet0.cs:\n              Line 1: Unexpected error, use // Error [CS8107] Feature 'top-level statements' is not available in C# 7.0. Please use language version 9.0 or greater.\n              Line 1: Unexpected error, use // Error [CS8805] Program using top-level statements must be an executable.\n              Line 1: Unexpected error, use // Error [CS1002] ; expected\n              Line 1: Unexpected error, use // Error [CS1733] Expected expression\n            \"\"\");\n\n    [TestMethod]\n    public void Verify_ConcurrentFile_DuplicateIssues_Muted() =>\n        CreateConcurrentBuilder(\"var topLevelStatement = 42;\")\n            .Invoking(x => x.Verify())\n            .Should().Throw<DiagnosticVerifierException>()\n            .WithMessage(\"\"\"\n                There are differences for CSharp9 File.cs:\n                  Line 1: Unexpected issue 'Message for SDummy' Rule SDummy\n\n                There are 3 more differences in File.Concurrent.cs\n\n                \"\"\");\n\n    [TestMethod]\n    public void Verify_ConcurrentFile_IssuesOnlyInConcurrent_Reported() =>\n        CreateConcurrentBuilder(\"var topLevelStatement = 42; // Noncompliant\")\n            .Invoking(x => x.Verify())\n            .Should().Throw<DiagnosticVerifierException>()\n            .WithMessage(\"\"\"\n                There are differences for CSharp9 File.Concurrent.cs:\n                  Line 1: Unexpected error, use // Error [CS0825] The contextual keyword 'var' may only appear within a local variable declaration or in script code\n                  Line 1: Unexpected error, use // Error [CS0116] A namespace cannot directly contain members such as fields, methods or statements\n\n                \"\"\");\n\n    private void VerifyThrows(string snippet, string expectedMessage) =>\n        builder.AddSnippet(snippet)\n            .WithConcurrentAnalysis(false)\n            .Invoking(x => x.Verify())\n            .Should().Throw<DiagnosticVerifierException>()\n            .Which.Message.Should().ContainIgnoringLineEndings(expectedMessage);\n\n    private VerifierBuilder CreateConcurrentBuilder(string code) =>\n        new VerifierBuilder<DummyAnalyzerCS>()\n            .AddPaths(TestFiles.WriteFile(TestContext, @\"TestCases\\File.cs\", code))\n            .WithTopLevelStatements()\n            .WithConcurrentAnalysis(true);   // Force concurrent analysis over the top level statements\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/Verification/IssueValidation/CompilationIssuesTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.TestFramework.Verification.IssueValidation.Test;\n\n[TestClass]\npublic class CompilationIssuesTest\n{\n    [TestMethod]\n    public void UniqueKeys() =>\n        CreateSut().UniqueKeys().Should().BeEquivalentTo(new IssueLocationKey[]\n        {\n            new(IssueType.Primary, \"First.cs\", 11),\n            new(IssueType.Secondary, \"First.cs\", 11),\n            new(IssueType.Error, \"First.cs\", 11),\n            new(IssueType.Primary, \"First.cs\", 99),\n            new(IssueType.Primary, \"Second.cs\", 11),\n            new(IssueType.Secondary, \"Third.cs\", 1)\n        });\n\n    [TestMethod]\n    public void UniqueKeys_IteratingIsResilientToRemoval()\n    {\n        var sut = CreateSut();\n        var enumerator = sut.UniqueKeys().GetEnumerator();\n        enumerator.MoveNext();\n        sut.Remove((IssueLocationKey)enumerator.Current);\n        enumerator.Invoking(x => x.MoveNext()).Should().NotThrow();\n    }\n\n    [TestMethod]\n    public void Remove_NoMatch()\n    {\n        var sut = CreateSut();\n        sut.Should().HaveCount(14);\n        sut.Remove(new(IssueType.Primary, \"ThisKeyIsNotPresent.cs\", 11)).Should().BeEmpty();\n        sut.Should().HaveCount(14);\n    }\n\n    [TestMethod]\n    public void Remove_WhenPresent()\n    {\n        var sut = CreateSut();\n        sut.Should().HaveCount(14);\n        sut.Remove(new(IssueType.Primary, \"Second.cs\", 11)).Should().HaveCount(5);\n        sut.Should().HaveCount(9);\n    }\n\n    [TestMethod]\n    public void Remove_WhenPresent_ReturnsAllOccurances()\n    {\n        var sut = CreateSut();\n        sut.Should().HaveCount(14);\n        sut.Remove(new(IssueType.Secondary, \"Third.cs\", 1)).Should().HaveCount(3);\n        sut.Should().HaveCount(11);\n    }\n\n    [TestMethod]\n    public void Dump()\n    {\n        using var log = new LogTester();\n        CreateSut().Dump(\"C# 99\");\n        log.AssertContain(\"\"\"\n            Actual C# 99 diagnostics First.cs:\n                S1111, Line: 11, [1, 10] Lorem ipsum\n                S1111, Line: 11, [9, 10] Lorem ipsum\n                S2222, Line: 11, [1, 10] Lorem 2222 ipsum\n                S2222, Line: 11, [1, 10] Lorem 2222 ipsum\n                CS000, Line: 11, [1, 10] Compilation error\n                S2222, Line: 99, [1, 10] Lorem 2222 ipsum\n            Actual C# 99 diagnostics Second.cs:\n                S2222, Line: 11, [1, 11] Lorem 2222 ipsum\n                S2222, Line: 11, [2, 12] Lorem 2222 ipsum\n                S2222, Line: 11, [3, 13] Lorem 2222 ipsum\n                S2222, Line: 11, [4, 14] Lorem 2222 ipsum\n                S2222, Line: 11, [5, 15] Lorem 2222 ipsum\n            \"\"\");\n    }\n\n    private static CompilationIssues CreateSut() =>\n        new(new IssueLocation[]\n        {\n            new(IssueType.Primary, \"First.cs\", 11, \"Lorem ipsum\", null, 1, 10, \"S1111\"),\n            new(IssueType.Primary, \"First.cs\", 11, \"Lorem ipsum\", null, 9, 10, \"S1111\"),\n            new(IssueType.Primary, \"First.cs\", 99, \"Lorem 2222 ipsum\", null, 1, 10, \"S2222\"),\n            new(IssueType.Primary, \"First.cs\", 11, \"Lorem 2222 ipsum\", null, 1, 10, \"S2222\"),\n            new(IssueType.Secondary, \"First.cs\", 11, \"Lorem 2222 ipsum\", null, 1, 10, \"S2222\"),\n            new(IssueType.Error, \"First.cs\", 11, \"Compilation error\", null, 1, 10, \"CS000\"),\n            new(IssueType.Primary, \"Second.cs\", 11, \"Lorem 2222 ipsum\", null, 1, 11, \"S2222\"),\n            new(IssueType.Primary, \"Second.cs\", 11, \"Lorem 2222 ipsum\", null, 2, 12,  \"S2222\"),\n            new(IssueType.Primary, \"Second.cs\", 11, \"Lorem 2222 ipsum\", null, 3, 13,  \"S2222\"),\n            new(IssueType.Primary, \"Second.cs\", 11, \"Lorem 2222 ipsum\", null, 4, 14,  \"S2222\"),\n            new(IssueType.Primary, \"Second.cs\", 11, \"Lorem 2222 ipsum\", null, 5, 15,  \"S2222\"),\n            new(IssueType.Secondary, \"Third.cs\", 1, \"Identical secondaries\", null, 1, 10,  \"S3333\"),\n            new(IssueType.Secondary, \"Third.cs\", 1, \"Identical secondaries\", null, 1, 10,  \"S3333\"),\n            new(IssueType.Secondary, \"Third.cs\", 1, \"Identical secondaries\", null, 1, 10,  \"S3333\")\n        });\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/Verification/IssueValidation/IssueLocationCollectorTest.ExpectedIssueLocations.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.TestFramework.Verification.IssueValidation.Tests;\n\npublic partial class IssueLocationCollectorTest\n{\n    [TestMethod]\n    public void ExpectedIssueLocations_No_Comments()\n    {\n        const string code = \"\"\"\n            public class Sample\n            {\n                public void Method(object o)\n                {\n                    Console.WriteLine(o);\n                }\n            }\n            \"\"\";\n        IssueLocationCollector.ExpectedIssueLocations(\"File.cs\", SourceText.From(code).Lines).Should().BeEmpty();\n    }\n\n    [TestMethod]\n    public void ExpectedIssueLocations_Locations_CS()\n    {\n        const string code = \"\"\"\n            public class Sample\n            {\n                public void Method(object o) // Noncompliant\n                {\n                    // Noncompliant@+1\n                    Console.WriteLine(o);\n                }\n            }\n            \"\"\";\n        var locations = IssueLocationCollector.ExpectedIssueLocations(\"File.cs\", SourceText.From(code).Lines);\n\n        locations.Should().HaveCount(2);\n        locations.Select(x => x.Type).Should().Equal(IssueType.Primary, IssueType.Primary);\n        locations.Select(x => x.LineNumber).Should().Equal(3, 6);\n    }\n\n    [TestMethod]\n    public void ExpectedIssueLocations_Locations_VB()\n    {\n        const string code = \"\"\"\n            Public class Sample\n\n                Public Sub Bar(o As Object) ' Noncompliant\n                    ' Noncompliant@+1\n                    Console.WriteLine(o)\n                End Sub\n\n            End Class\n            \"\"\";\n        var locations = IssueLocationCollector.ExpectedIssueLocations(\"File.cs\", SourceText.From(code).Lines);\n\n        locations.Should().HaveCount(2);\n        locations.Select(x => x.Type).Should().Equal(IssueType.Primary, IssueType.Primary);\n        locations.Select(x => x.LineNumber).Should().Equal(3, 5);\n    }\n\n    [TestMethod]\n    public void ExpectedIssueLocations_Locations_Xml()\n    {\n        const string code = \"\"\"\n            <Root>\n            <SelfClosing /><!-- Noncompliant -->\n            <SelfClosing /><!-- Noncompliant with additional comment and new line\n            -->\n            <InsideWithSpace><!-- Noncompliant--></InsideWithSpace>\n            <InsideNoSpace><!--Secondary--></InsideNoSpace>\n            <Innocent><!--Noncompliant@+1--></Innocent>\n            <Guilty />\n            <!--\n            Noncompliant - this should not be detected as expected issue\n            -->\n            </Root>\n            \"\"\";\n        var locations = IssueLocationCollector.ExpectedIssueLocations(\"File.cs\", SourceText.From(code).Lines);\n\n        locations.Should().HaveCount(5);\n        locations.Select(x => x.Type).Should().Equal(IssueType.Primary, IssueType.Primary, IssueType.Primary, IssueType.Secondary, IssueType.Primary);\n        locations.Select(x => x.LineNumber).Should().Equal(2, 3, 5, 6, 8);\n    }\n\n    [TestMethod]\n    public void ExpectedIssueLocations_Locations_Razor()\n    {\n        const string code = \"\"\"\n            <p>The solution to all problems is: 42</p>@* Noncompliant *@\n            <p>The solution to all problems is: 42</p>@* Noncompliant with additional comment and new line\n            *@\n            <p>The solution to all problems is: 42</p>@* Secondary *@\n\n            \"\"\";\n        var locations = IssueLocationCollector.ExpectedIssueLocations(\"File.cs\", SourceText.From(code).Lines);\n\n        locations.Should().HaveCount(3);\n        locations.Select(x => x.Type).Should().Equal(IssueType.Primary, IssueType.Primary, IssueType.Secondary);\n        locations.Select(x => x.LineNumber).Should().Equal(1, 2, 4);\n    }\n\n    [TestMethod]\n    public void ExpectedIssueLocations_OnlyCommentedNoncompliant()\n    {\n        const string code = \"\"\"\n            public class MyNoncompliantClass\n            {\n                public void NoncompliantMethod(object o)\n                {\n                    Console.WriteLine(o); // Noncompliant\n                }\n            }\n            \"\"\";\n        var locations = IssueLocationCollector.ExpectedIssueLocations(\"File.cs\", SourceText.From(code).Lines);\n\n        locations.Should().ContainSingle();\n        locations.Select(x => x.Type).Should().Equal(IssueType.Primary);\n        locations.Select(x => x.LineNumber).Should().Equal(5);\n    }\n\n    [TestMethod]\n    public void ExpectedIssueLocations_ExactLocations()\n    {\n        const string code = \"\"\"\n            public class Sample\n            {\n                public void Method(object o)\n            //              ^^^\n            //                         ^ Secondary@-1\n            //                  ^^^^^^ Secondary@-2 [flow]\n            //                   ^^^^ Secondary@-3 [flow] {{Some message}}\n                {\n                    Console.WriteLine(o);\n                }\n            }\n            \"\"\";\n        var locations = IssueLocationCollector.ExpectedIssueLocations(\"File.cs\", SourceText.From(code).Lines);\n\n        locations.Should().HaveCount(4);\n        locations.Select(x => x.Type).Should().BeEquivalentTo([IssueType.Primary, IssueType.Secondary, IssueType.Secondary, IssueType.Secondary]);\n        locations.Select(x => x.LineNumber).Should().Equal(3, 3, 3, 3);\n        locations.Select(x => x.Start).Should().Equal(16, 27, 20, 21);\n        locations.Select(x => x.Length).Should().Equal(3, 1, 6, 4);\n    }\n\n    [TestMethod]\n    public void ExpectedIssueLocations_ExactColumns()\n    {\n        const string code = \"\"\"\n            public class Sample\n            {\n                public void Method(object o) // Noncompliant ^17#3\n                                          // Secondary@-1 ^28#1\n                {\n                    Console.WriteLine(o);\n                }\n            }\n            \"\"\";\n        var locations = IssueLocationCollector.ExpectedIssueLocations(\"File.cs\", SourceText.From(code).Lines);\n        locations.Should().HaveCount(2);\n        locations.Select(x => x.Type).Should().BeEquivalentTo([IssueType.Primary, IssueType.Secondary]);\n        locations.Select(x => x.LineNumber).Should().Equal(3, 3);\n        locations.Select(x => x.Start).Should().Equal(16, 27);\n        locations.Select(x => x.Length).Should().Equal(3, 1);\n    }\n\n    [TestMethod]\n    public void ExpectedIssueLocations_Redundant_Locations()\n    {\n        const string code = \"\"\"\n            public class Sample\n            {\n                public void Method(object o) // Noncompliant ^17#3\n            //              ^^^\n                {\n                    Console.WriteLine(o);\n                }\n            }\n            \"\"\";\n        Action action = () => IssueLocationCollector.ExpectedIssueLocations(\"File.cs\", SourceText.From(code).Lines);\n\n        action.Should().Throw<InvalidOperationException>()\n            .WithMessage(\"Unexpected redundant issue location on line 3. Issue location can be set either with 'precise issue location' or 'exact column location' pattern but not both.\");\n    }\n\n    [TestMethod]\n    public void ExpectedIssueLocations_PrimaryIdWithAndBracketInMessage()\n    {\n        const string code = \"\"\"\n            public class Sample\n            {\n                public void Method(object o) // Noncompliant [myId1] {{A message with brackets [].}}\n                {\n                    Console.WriteLine(o);\n                }\n            }\n            \"\"\";\n        var location = IssueLocationCollector.ExpectedIssueLocations(\"File.cs\", SourceText.From(code).Lines).Should().ContainSingle().Subject;\n        location.Type.Should().Be(IssueType.Primary);\n        location.Message.Should().Be(\"A message with brackets [].\");\n        location.IssueId.Should().Be(\"myId1\");\n    }\n\n    [TestMethod]\n    public void ExpectedIssueLocations_Multiple_PrimaryIds()\n    {\n        const string code = \"\"\"\n            public class Sample\n            {\n                public void Method(object o) // Noncompliant [myId1]\n                {\n                    Console.WriteLine(o); // Noncompliant [myId1]\n                }\n            }\n            \"\"\";\n        Action action = () => IssueLocationCollector.ExpectedIssueLocations(\"File.cs\", SourceText.From(code).Lines);\n\n        action.Should().Throw<InvalidOperationException>().WithMessage(\"Primary location with id [myId1] found on multiple lines: 3, 5\");\n    }\n\n    [TestMethod]\n    public void ExpectedIssueLocations_Invalid_Type_Format()\n    {\n        const string code = \"\"\"\n            public class Sample\n            {\n                public void Method(object o) // Is Noncompliant\n                {\n                    Console.WriteLine(o);\n                }\n            }\n            \"\"\";\n        Action action = () => IssueLocationCollector.ExpectedIssueLocations(\"File.cs\", SourceText.From(code).Lines);\n\n        action.Should().Throw<InvalidOperationException>().WithMessage(\"\"\"\n            File.cs line 2 contains '// ... Noncompliant' comment, but it is not recognized as one of the expected patterns.\n            Either remove the 'Noncompliant' word or fix the pattern.\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void ExpectedIssueLocations_Invalid_Precise_Format()\n    {\n        const string code = \"\"\"\n            public class Sample\n            {\n                public void Method(object o) // Noncompliant\n            //  issue is here   ^^^^^^\n                {\n                    Console.WriteLine(o);\n                }\n            }\n            \"\"\";\n        Action action = () => IssueLocationCollector.ExpectedIssueLocations(\"File.cs\", SourceText.From(code).Lines);\n\n        action.Should().Throw<InvalidOperationException>().WithMessage(\"\"\"\n            File.cs line 3 looks like it contains comment for precise location '^^'.\n            Either remove the precise pattern '^^' from the comment, or fix the pattern.\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void ExpectedBuildErrors_ExpectedErrors()\n    {\n        const string code = \"\"\"\n            public class Sample\n            {\n                public void Method(object o) // Error [CS1234]\n                {\n                    // Error@+1 [CS3456]\n                    Console.WriteLine(o);\n                }\n            }\n            \"\"\";\n        var expectedErrors = IssueLocationCollector.ExpectedIssueLocations(\"File.cs\", SourceText.From(code).Lines).ToList();\n\n        expectedErrors.Should().HaveCount(2);\n        expectedErrors.Select(x => x.Type).Should().Equal(IssueType.Error, IssueType.Error);\n        expectedErrors.Select(x => x.LineNumber).Should().Equal(3, 6);\n    }\n\n    [TestMethod]\n    public void ExpectedBuildErrors_Multiple_ExpectedErrors()\n    {\n        const string code = \"\"\"\n            public class Sample\n            {\n                public void Method(object o) { } // Error [CS1234,CS2345,CS3456]\n            }\n            \"\"\";\n        var expectedErrors = IssueLocationCollector.ExpectedIssueLocations(\"File.cs\", SourceText.From(code).Lines).ToList();\n\n        expectedErrors.Should().HaveCount(3);\n        expectedErrors.Select(x => x.Type).Should().Equal(IssueType.Error, IssueType.Error, IssueType.Error);\n        expectedErrors.Select(x => x.LineNumber).Should().Equal(3, 3, 3);\n        expectedErrors.Select(x => x.IssueId).Should().Equal(\"CS1234\", \"CS2345\", \"CS3456\");\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/Verification/IssueValidation/IssueLocationCollectorTest.FindIssueLocations.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.TestFramework.Verification.IssueValidation.Tests;\n\npublic partial class IssueLocationCollectorTest\n{\n    [TestMethod]\n    public void FindIssueLocations_Noncompliant_With_Two_Flows()\n    {\n        var line = Line(2, \"\"\"\n            if (a > b)\n            {\n                Console.WriteLine(a); //Noncompliant [flow1,flow2]\n            }\n            \"\"\");\n        VerifyIssueLocations(\n            IssueLocationCollector.FindIssueLocations(\"File.cs\", line),\n            expectedTypes: [IssueType.Primary, IssueType.Primary],\n            expectedLineNumbers: [3, 3],\n            expectedMessages: [null, null],\n            expectedIssueIds: [\"flow1\", \"flow2\"]);\n    }\n\n    [TestMethod]\n    public void FindIssueLocations_Noncompliant_With_Offset_Message_And_Flows()\n    {\n        var line = Line(2, \"\"\"\n            if (a > b)\n            {\n                Console.WriteLine(a); //Noncompliant@-1 [flow1,flow2] {{Some message}}\n            }\n            \"\"\");\n        VerifyIssueLocations(\n            IssueLocationCollector.FindIssueLocations(\"File.cs\", line),\n            expectedTypes: [IssueType.Primary, IssueType.Primary],\n            expectedLineNumbers: [2, 2],\n            expectedMessages: [\"Some message\", \"Some message\"],\n            expectedIssueIds: [\"flow1\", \"flow2\"]);\n    }\n\n    [TestMethod]\n    public void FindIssueLocations_Noncompliant_With_Reversed_Message_And_Flows()\n    {\n        var line = Line(2, \"\"\"\n            if (a > b)\n            {\n                Console.WriteLine(a); //Noncompliant {{Some message}} [flow1,flow2]\n            }\n            \"\"\");\n        VerifyIssueLocations(\n            IssueLocationCollector.FindIssueLocations(\"File.cs\", line),\n            expectedTypes: [IssueType.Primary],\n            expectedLineNumbers: [3],\n            expectedMessages: [\"Some message\"],\n            expectedIssueIds: [null]);\n    }\n\n    [TestMethod]\n    public void FindIssueLocations_Noncompliant_With_Offset()\n    {\n        var line = Line(2, \"\"\"\n            if (a > b)\n            {\n                Console.WriteLine(a); //Noncompliant@-1\n            }\n            \"\"\");\n        VerifyIssueLocations(\n            IssueLocationCollector.FindIssueLocations(\"File.cs\", line),\n            expectedTypes: [IssueType.Primary],\n            expectedLineNumbers: [2],\n            expectedMessages: [null],\n            expectedIssueIds: [null]);\n    }\n\n    [TestMethod]\n    public void FindIssueLocations_Noncompliant_With_Message_And_Flows()\n    {\n        var line = Line(2, \"\"\"\n            if (a > b)\n            {\n                Console.WriteLine(a); //Noncompliant [flow1,flow2] {{Some message}}\n            }\n            \"\"\");\n        VerifyIssueLocations(\n            IssueLocationCollector.FindIssueLocations(\"File.cs\", line),\n            expectedTypes: [IssueType.Primary, IssueType.Primary],\n            expectedLineNumbers: [3, 3],\n            expectedMessages: [\"Some message\", \"Some message\"],\n            expectedIssueIds: [\"flow1\", \"flow2\"]);\n    }\n\n    [TestMethod]\n    public void FindIssueLocations_Noncompliant_With_Message()\n    {\n        var line = Line(2, \"\"\"\n            if (a > b)\n            {\n                Console.WriteLine(a); //Noncompliant {{Some message}}\n            }\n            \"\"\");\n        VerifyIssueLocations(\n            IssueLocationCollector.FindIssueLocations(\"File.cs\", line),\n            expectedTypes: [IssueType.Primary],\n            expectedLineNumbers: [3],\n            expectedMessages: [\"Some message\"],\n            expectedIssueIds: [null]);\n    }\n\n    [TestMethod]\n    public void FindIssueLocations_Noncompliant_With_Invalid_Offset()\n    {\n        var line = Line(2, \"\"\"\n            if (a > b)\n            {\n                Console.WriteLine(a); //Noncompliant@=1\n            }\n            \"\"\");\n        ((Func<IEnumerable<IssueLocation>>)(() => IssueLocationCollector.FindIssueLocations(\"File.cs\", line))).Should().Throw<DiagnosticVerifierException>()\n            .WithMessage(\"\"\"\n                Unexpected '@' is used after the recognized issue pattern. Remove it, or fix the pattern to the valid format:\n                // ^^^^ (Noncompliant|Secondary|Error) ^1#10 [issue-id1, issue-id2] {{Expected message.}} Final note without significant special characters\n                \"\"\");\n    }\n\n    [TestMethod]\n    [DataRow(\"Opening { collides with message assertion\")]\n    [DataRow(\"Closing } collides with message assertion\")]\n    [DataRow(\"The @ collides with line offset @-1 or @+1\")]\n    [DataRow(\"The ^ collides numeric location ^1#10 or precise location ^^^^\")]\n    [DataRow(\"The # collides numeric location ^1#10\")]\n    [DataRow(\"Noncompliant collides with itself, on a wrong place\")]\n    [DataRow(\"Secondary collides with itself, on a wrong place\")]\n    public void FindIssueLocations_Noncompliant_InvalidNote(string note)\n    {\n        var line = Line(2, $$$\"\"\"\n            if (a > b)\n            {\n                Console.WriteLine(a); //Noncompliant {{Valid message}} {{{note}}}\n            }\n            \"\"\");\n        ((Func<IEnumerable<IssueLocation>>)(() => IssueLocationCollector.FindIssueLocations(\"File.cs\", line))).Should().Throw<DiagnosticVerifierException>()\n            .WithMessage(\"\"\"\n                Unexpected '*' is used after the recognized issue pattern. Remove it, or fix the pattern to the valid format:\n                // ^^^^ (Noncompliant|Secondary|Error) ^1#10 [issue-id1, issue-id2] {{Expected message.}} Final note without significant special characters\n                \"\"\");\n    }\n\n    [TestMethod]\n    public void FindIssueLocations_Noncompliant_With_Flow()\n    {\n        var line = Line(2, \"\"\"\n            if (a > b)\n            {\n                Console.WriteLine(a); //Noncompliant [last,flow1,flow2]\n            }\n            \"\"\");\n        VerifyIssueLocations(\n            IssueLocationCollector.FindIssueLocations(\"File.cs\", line),\n            expectedTypes: [IssueType.Primary, IssueType.Primary, IssueType.Primary],\n            expectedLineNumbers: [3, 3, 3],\n            expectedMessages: [null, null, null],\n            expectedIssueIds: [\"flow1\", \"flow2\", \"last\"]);\n    }\n\n    [TestMethod]\n    public void FindIssueLocations_Noncompliant()\n    {\n        var line = Line(2, \"\"\"\n            if (a > b)\n            {\n                Console.WriteLine(a); //Noncompliant\n            }\n            \"\"\");\n        VerifyIssueLocations(\n            IssueLocationCollector.FindIssueLocations(\"File.cs\", line),\n            expectedTypes: [IssueType.Primary],\n            expectedLineNumbers: [3],\n            expectedMessages: [null],\n            expectedIssueIds: [null]);\n    }\n\n    [TestMethod]\n    public void FindIssueLocations_Flow_With_Offset_Message_And_Flows()\n    {\n        var line = Line(2, \"\"\"\n            if (a > b)\n            {\n                Console.WriteLine(a); //Secondary@-1 [flow1,flow2] {{Some message}}\n            }\n            \"\"\");\n        VerifyIssueLocations(\n            IssueLocationCollector.FindIssueLocations(\"File.cs\", line),\n            expectedTypes: [IssueType.Secondary, IssueType.Secondary],\n            expectedLineNumbers: [2, 2],\n            expectedMessages: [\"Some message\", \"Some message\"],\n            expectedIssueIds: [\"flow1\", \"flow2\"]);\n    }\n\n    [TestMethod]\n    public void FindIssueLocations_NoComment()\n    {\n        var line = Line(2, \"\"\"\n            if (a > b)\n            {\n                Console.WriteLine(a);\n            }\n            \"\"\");\n        IssueLocationCollector.FindIssueLocations(\"File.cs\", line).Should().BeEmpty();\n    }\n\n    [TestMethod]\n    public void FindIssueLocations_Noncompliant_ExactColumn()\n    {\n        var line = Line(2, \"\"\"\n            if (a > b)\n            {\n                Console.WriteLine(a); //Noncompliant^5#7\n            }\n            \"\"\");\n        VerifyIssueLocations(\n            IssueLocationCollector.FindIssueLocations(\"File.cs\", line),\n            expectedTypes: [IssueType.Primary],\n            expectedLineNumbers: [3],\n            expectedMessages: [null],\n            expectedIssueIds: [null]);\n    }\n\n    [TestMethod]\n    public void FindIssueLocations_Secondary_ExactColumn_Ids()\n    {\n        var line = Line(2, \"\"\"\n            if (a > b)\n            {\n                Console.WriteLine(a); //Secondary ^13#9 [myId]\n            }\n            \"\"\");\n        VerifyIssueLocations(\n            IssueLocationCollector.FindIssueLocations(\"File.cs\", line),\n            expectedTypes: [IssueType.Secondary],\n            expectedLineNumbers: [3],\n            expectedMessages: [null],\n            expectedIssueIds: [\"myId\"]);\n    }\n\n    [TestMethod]\n    public void FindIssueLocations_Noncompliant_Offset_ExactColumn_Message_Whitespaces()\n    {\n        var line = Line(2, \"\"\"\n            if (a > b)\n            {\n                Console.WriteLine(a); // Noncompliant @-2 ^5#16 [myIssueId] {{MyMessage}}\n            }\n            \"\"\");\n        var result = IssueLocationCollector.FindIssueLocations(\"File.cs\", line).ToArray();\n        VerifyIssueLocations(\n            result,\n            expectedTypes: [IssueType.Primary],\n            expectedLineNumbers: [1],\n            expectedMessages: [\"MyMessage\"],\n            expectedIssueIds: [\"myIssueId\"]);\n        result.Select(x => x.Start).Should().Equal(4);\n        result.Select(x => x.Length).Should().Equal(16);\n    }\n\n    [TestMethod]\n    public void FindIssueLocations_Noncompliant_Offset_ExactColumn_Message_NoWhitespace()\n    {\n        var line = Line(2, \"\"\"\n            if (a > b)\n            {\n                Console.WriteLine(a); //Noncompliant@-2^5#16[myIssueId]{{MyMessage}}\n            }\n            \"\"\");\n        var result = IssueLocationCollector.FindIssueLocations(\"File.cs\", line).ToArray();\n        VerifyIssueLocations(\n            result,\n            expectedTypes: [IssueType.Primary],\n            expectedLineNumbers: [1],\n            expectedMessages: [\"MyMessage\"],\n            expectedIssueIds: [\"myIssueId\"]);\n        result.Select(x => x.Start).Should().Equal(4);\n        result.Select(x => x.Length).Should().Equal(16);\n    }\n\n    [TestMethod]\n    public void FindIssueLocations_Noncompliant_Offset_ExactColumn_Message_Whitespaces_Xml()\n    {\n        var line = Line(2, \"\"\"\n            <RootRootRootRootRootRoot />\n\n            <!-- Noncompliant @-2 ^5#16 [myIssueId] {{MyMessage}} -->\n\n            \"\"\");\n        var result = IssueLocationCollector.FindIssueLocations(\"File.cs\", line).ToArray();\n        VerifyIssueLocations(\n            result,\n            expectedTypes: [IssueType.Primary],\n            expectedLineNumbers: [1],\n            expectedMessages: [\"MyMessage\"],\n            expectedIssueIds: [\"myIssueId\"]);\n        result.Select(x => x.Start).Should().Equal(4);\n        result.Select(x => x.Length).Should().Equal(16);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/Verification/IssueValidation/IssueLocationCollectorTest.FindPreciseIssueLocations.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.TestFramework.Verification.IssueValidation.Tests;\n\npublic partial class IssueLocationCollectorTest\n{\n    [TestMethod]\n    public void FindPreciseIssueLocations_NoMessage_NoIds()\n    {\n        var line = Line(3, \"\"\"\n            if (a > b)\n            {\n                Console.WriteLine(a);\n            //          ^^^^^^^^^\n            }\n            \"\"\");\n        VerifyIssueLocations(\n            IssueLocationCollector.FindPreciseIssueLocations(\"File.cs\", line),\n            expectedTypes: [IssueType.Primary],\n            expectedLineNumbers: [3],\n            expectedMessages: [null],\n            expectedIssueIds: [null]);\n    }\n\n    [TestMethod]\n    public void FindPreciseIssueLocations_With_Offset()\n    {\n        var line = Line(3, \"\"\"\n            if (a > b)\n            {\n                Console.WriteLine(a);\n            //          ^^^^^^^^^ @-1\n            }\n            \"\"\");\n        VerifyIssueLocations(\n            IssueLocationCollector.FindPreciseIssueLocations(\"File.cs\", line),\n            expectedTypes: [IssueType.Primary],\n            expectedLineNumbers: [2],\n            expectedMessages: [null],\n            expectedIssueIds: [null]);\n    }\n\n    [TestMethod]\n    public void FindPreciseIssueLocations_NoMessage_NoIds_Secondary()\n    {\n        var line = Line(3, \"\"\"\n            if (a > b)\n            {\n                Console.WriteLine(a);\n            //          ^^^^^^^^^ Secondary\n            }\n            \"\"\");\n        VerifyIssueLocations(\n            IssueLocationCollector.FindPreciseIssueLocations(\"File.cs\", line),\n            expectedTypes: [IssueType.Secondary],\n            expectedLineNumbers: [3],\n            expectedMessages: [null],\n            expectedIssueIds: [null]);\n    }\n\n    [TestMethod]\n    public void FindPreciseIssueLocations_Comment_Secondary()\n    {\n        var line = Line(3, \"\"\"\n            if (a > b)\n            {\n                Console.WriteLine(a);\n            //          ^^^^^^^^^ Secondary Comment\n            }\n            \"\"\");\n        VerifyIssueLocations(\n            IssueLocationCollector.FindPreciseIssueLocations(\"File.cs\", line),\n            expectedTypes: [IssueType.Secondary],\n            expectedLineNumbers: [3],\n            expectedMessages: [null],\n            expectedIssueIds: [null]);\n    }\n\n    [TestMethod]\n    public void FindPreciseIssueLocations_Secondary_With_Offset()\n    {\n        var line = Line(3, \"\"\"\n            if (a > b)\n            {\n                Console.WriteLine(a);\n            //          ^^^^^^^^^ Secondary@-1\n            }\n            \"\"\");\n        VerifyIssueLocations(\n            IssueLocationCollector.FindPreciseIssueLocations(\"File.cs\", line),\n            expectedTypes: [IssueType.Secondary],\n            expectedLineNumbers: [2],\n            expectedMessages: [null],\n            expectedIssueIds: [null]);\n    }\n\n    [TestMethod]\n    public void FindPreciseIssueLocations_IssueIds()\n    {\n        var line = Line(3, \"\"\"\n            if (a > b)\n            {\n                Console.WriteLine(a);\n            //          ^^^^^^^^^ [flow1,flow2]\n            }\n            \"\"\");\n        VerifyIssueLocations(\n            IssueLocationCollector.FindPreciseIssueLocations(\"File.cs\", line),\n            expectedTypes: [IssueType.Primary, IssueType.Primary],\n            expectedLineNumbers: [3, 3],\n            expectedMessages: [null, null],\n            expectedIssueIds: [\"flow1\", \"flow2\"]);\n    }\n\n    [TestMethod]\n    public void FindPreciseIssueLocations_IssueIds_Secondary()\n    {\n        var line = Line(3, \"\"\"\n            if (a > b)\n            {\n                Console.WriteLine(a);\n            //          ^^^^^^^^^ Secondary [last1,flow1,flow2]\n            }\n            \"\"\");\n        VerifyIssueLocations(\n            IssueLocationCollector.FindPreciseIssueLocations(\"File.cs\", line),\n            expectedTypes: [IssueType.Secondary, IssueType.Secondary, IssueType.Secondary],\n            expectedLineNumbers: [3, 3, 3],\n            expectedMessages: [null, null, null],\n            expectedIssueIds: [\"flow1\", \"flow2\", \"last1\"]);\n    }\n\n    [TestMethod]\n    public void FindPreciseIssueLocations_Message_And_IssueIds()\n    {\n        var line = Line(3, \"\"\"\n            if (a > b)\n            {\n                Console.WriteLine(a);\n            //          ^^^^^^^^^ [flow1,flow2] {{Some message}}\n            }\n            \"\"\");\n        VerifyIssueLocations(\n            IssueLocationCollector.FindPreciseIssueLocations(\"File.cs\", line),\n            expectedTypes: [IssueType.Primary, IssueType.Primary],\n            expectedLineNumbers: [3, 3],\n            expectedMessages: [\"Some message\", \"Some message\"],\n            expectedIssueIds: [\"flow1\", \"flow2\"]);\n    }\n\n    [TestMethod]\n    public void FindPreciseIssueLocations_Message_And_IssueIds_Secondary_CS()\n    {\n        var line = Line(3, \"\"\"\n            if (a > b)\n            {\n                Console.WriteLine(a);\n            //          ^^^^^^^^^ Secondary [flow1,flow2] {{Some message}}\n            }\n            \"\"\");\n        VerifyIssueLocations(\n            IssueLocationCollector.FindPreciseIssueLocations(\"File.cs\", line),\n            expectedTypes: [IssueType.Secondary, IssueType.Secondary],\n            expectedLineNumbers: [3, 3],\n            expectedMessages: [\"Some message\", \"Some message\"],\n            expectedIssueIds: [\"flow1\", \"flow2\"]);\n    }\n\n    [TestMethod]\n    public void FindPreciseIssueLocations_Message_And_IssueIds_Secondary_XML()\n    {\n        var line = Line(2, \"\"\"\n            <Root>\n                        <Baaad />\n            <!--        ^^^^^^^^^ Secondary [flow1,flow2] {{Some message}}         -->\n            </Root>\n            \"\"\");\n        VerifyIssueLocations(\n            IssueLocationCollector.FindPreciseIssueLocations(\"File.cs\", line),\n            expectedTypes: [IssueType.Secondary, IssueType.Secondary],\n            expectedLineNumbers: [2, 2],\n            expectedMessages: [\"Some message\", \"Some message\"],\n            expectedIssueIds: [\"flow1\", \"flow2\"]);\n    }\n\n    [TestMethod]\n    public void FindPreciseIssueLocations_Message()\n    {\n        var line = Line(3, \"\"\"\n            if (a > b)\n            {\n                Console.WriteLine(a);\n            //          ^^^^^^^^^ {{Some message}}\n            }\n            \"\"\");\n        VerifyIssueLocations(\n            IssueLocationCollector.FindPreciseIssueLocations(\"File.cs\", line),\n            expectedTypes: [IssueType.Primary],\n            expectedLineNumbers: [3],\n            expectedMessages: [\"Some message\"],\n            expectedIssueIds: [null]);\n    }\n\n    [TestMethod]\n    public void FindPreciseIssueLocations_Message_Secondary()\n    {\n        var line = Line(3, \"\"\"\n            if (a > b)\n            {\n                Console.WriteLine(a);\n            //          ^^^^^^^^^ Secondary {{Some message}}\n            }\n            \"\"\");\n        VerifyIssueLocations(\n            IssueLocationCollector.FindPreciseIssueLocations(\"File.cs\", line),\n            expectedTypes: [IssueType.Secondary],\n            expectedLineNumbers: [3],\n            expectedMessages: [\"Some message\"],\n            expectedIssueIds: [null]);\n    }\n\n    [TestMethod]\n    public void FindPreciseIssueLocations_Full_Secondary()\n    {\n        var line = Line(4, \"\"\"\n            if (a > b)\n            {\n                Console.WriteLine(a);\n            // Extra line\n            //          ^^^^^^^^^ Secondary@-1 [flow1, flow2] {{Some message}} Comment\n            }\n            \"\"\");\n        VerifyIssueLocations(\n            IssueLocationCollector.FindPreciseIssueLocations(\"File.cs\", line),\n            expectedTypes: [IssueType.Secondary, IssueType.Secondary],\n            expectedLineNumbers: [3, 3],\n            expectedMessages: [\"Some message\", \"Some message\"],\n            expectedIssueIds: [\"flow1\", \"flow2\"]);\n    }\n\n    [TestMethod]\n    public void FindPreciseIssueLocations_NoComment()\n    {\n        var line = Line(3, \"\"\"\n            if (a > b)\n            {\n                Console.WriteLine(a);\n            }\n            \"\"\");\n        IssueLocationCollector.FindPreciseIssueLocations(\"File.cs\", line).Should().BeEmpty();\n    }\n\n    [TestMethod]\n    public void FindPreciseIssueLocations_NotStartOfLineIsOk()\n    {\n        var line = Line(3, \"\"\"\n            if (a > b)\n            {\n                Console.WriteLine(a);\n                //      ^^^^^^^^^\n            }\n            \"\"\");\n        var issueLocation = IssueLocationCollector.FindPreciseIssueLocations(\"File.cs\", line).Should().ContainSingle().Subject;\n        issueLocation.Type.Should().Be(IssueType.Primary);\n        issueLocation.LineNumber.Should().Be(3);\n        issueLocation.Start.Should().Be(12);\n        issueLocation.Length.Should().Be(9);\n    }\n\n    [TestMethod]\n    public void FindPreciseIssueLocations_MultiplePatternsOnSameLine()\n    {\n        var line = Line(3, \"\"\"\n            if (a > b)\n            {\n                Console.WriteLine(a);\n            //  ^^^^^^^ ^^^^^^^^^ ^\n            }\n            \"\"\");\n        Action action = () => IssueLocationCollector.FindPreciseIssueLocations(\"File.cs\", line);\n        action.Should().Throw<InvalidOperationException>().WithMessage(\"\"\"\n            Expecting only one precise location per line, found 3 on line 3. If you want to specify more than one precise location per line you need to omit the Noncompliant comment:\n            internal class MyClass : IInterface1 // there should be no Noncompliant comment\n            ^^^^^^^^ {{Do not create internal classes.}}\n                                     ^^^^^^^^^^^ @-1 {{IInterface1 is bad for your health.}}\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void FindPreciseIssueLocations_Xml()\n    {\n        const string code = \"\"\"\n            <Root>\n            <Space><SelfClosing /></Space>\n            <!--   ^^^^^^^^^^^^^^^ -->\n            <NoSpace><SelfClosing /></NoSpace>\n                 <!--^^^^^^^^^^^^^^^-->\n            <Multiline><SelfClosing /></Multiline>\n            <!--       ^^^^^^^^^^^^^^^\n            -->\n            </Root>\n            \"\"\";\n        var line = Line(2, code);\n        var issueLocation = IssueLocationCollector.FindPreciseIssueLocations(\"File.cs\", line).Should().ContainSingle().Subject;\n        issueLocation.Start.Should().Be(7);\n        issueLocation.Length.Should().Be(15);\n\n        line = Line(4, code);\n        issueLocation = IssueLocationCollector.FindPreciseIssueLocations(\"File.cs\", line).Should().ContainSingle().Subject;\n        issueLocation.Start.Should().Be(9);\n        issueLocation.Length.Should().Be(15);\n\n        line = Line(6, code);\n        issueLocation = IssueLocationCollector.FindPreciseIssueLocations(\"File.cs\", line).Should().ContainSingle().Subject;\n        issueLocation.Start.Should().Be(11);\n        issueLocation.Length.Should().Be(15);\n    }\n\n    [TestMethod]\n    public void FindPreciseIssueLocations_RazorWithSpaces()\n    {\n        var line = Line(1, \"\"\"\n            <p>With spaces: 42</p>\n            @*              ^^ *@\n            \"\"\");\n        var issueLocation = IssueLocationCollector.FindPreciseIssueLocations(\"File.cs\", line).Should().ContainSingle().Subject;\n        issueLocation.Start.Should().Be(16);\n        issueLocation.Length.Should().Be(2);\n    }\n\n    [TestMethod]\n    public void FindPreciseIssueLocations_RazorWithoutSpaces()\n    {\n        var line = Line(1, \"\"\"\n            <p>Without spaces: 42</p>\n                             @*^^*@\n            \"\"\");\n        var issueLocation = IssueLocationCollector.FindPreciseIssueLocations(\"File.cs\", line).Should().ContainSingle().Subject;\n        issueLocation.Start.Should().Be(19);\n        issueLocation.Length.Should().Be(2);\n    }\n\n    [TestMethod]\n    public void FindPreciseIssueLocations_RazorWithMultiline()\n    {\n        var line = Line(1, \"\"\"\n            <p>Multiline: 42</p>\n            @*            ^^\n            *@\n            \"\"\");\n        var issueLocation = IssueLocationCollector.FindPreciseIssueLocations(\"File.cs\", line).Should().ContainSingle().Subject;\n        issueLocation.Start.Should().Be(14);\n        issueLocation.Length.Should().Be(2);\n    }\n\n    [TestMethod]\n    public void FindPreciseIssueLocations_Message_And_IssueIds_Secondary_Razor()\n    {\n        var line = Line(1, \"\"\"\n                        <p>The solution is: 42</p>\n            @*                              ^^ Secondary [flow1,flow2] {{Some message}}         *@\n            \"\"\");\n        VerifyIssueLocations(\n            IssueLocationCollector.FindPreciseIssueLocations(\"File.cs\", line),\n            expectedTypes: [IssueType.Secondary, IssueType.Secondary],\n            expectedLineNumbers: [1, 1],\n            expectedMessages: [\"Some message\", \"Some message\"],\n            expectedIssueIds: [\"flow1\", \"flow2\"]);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/Verification/IssueValidation/IssueLocationCollectorTest.MergeLocations.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.TestFramework.Verification.IssueValidation.Tests;\n\npublic partial class IssueLocationCollectorTest\n{\n    [TestMethod]\n    public void MergeLocations_NoIssues() =>\n        IssueLocationCollector.MergeLocations(Array.Empty<IssueLocation>(), new List<IssueLocation>()).Should().BeEmpty();\n\n    [TestMethod]\n    public void MergeLocations_IssuesSameLine()\n    {\n        var result = IssueLocationCollector.MergeLocations(\n            [new(IssueType.Primary, \"File.cs\", 3, \"message 1\", null, null, null)],\n            [new(IssueType.Primary, \"File.cs\", 3, \"message 2\", null, 10, 5)]);\n\n        result.Should().ContainSingle();\n\n        result[0].Message.Should().Be(\"message 1\");\n\n        // We take only Start and Length when merging precise location comments\n        result[0].Start.Should().Be(10);\n        result[0].Length.Should().Be(5);\n    }\n\n    [TestMethod]\n    public void MergeLocations_DifferentIssues_SameSecondaryLocations()\n    {\n        var primary = new IssueLocation[]\n        {\n            new(IssueType.Primary, \"File.cs\", 1, \"Primary 1\", null, null, null),\n            new(IssueType.Primary, \"File.cs\", 2, \"Primary 2\", null, null, null)\n        };\n        var preciseSecondary = new List<IssueLocation>\n        {\n            new(IssueType.Secondary, \"File.cs\", 3, \"Secondary with same message and location\", null, 10, 5),\n            new(IssueType.Secondary, \"File.cs\", 3, \"Secondary with same message and location\", null, 10, 5)\n        };\n        IssueLocationCollector.MergeLocations(primary, preciseSecondary).Should().BeEquivalentTo(primary.Concat(preciseSecondary));\n    }\n\n    [TestMethod]\n    public void MergeLocations_IssuesDifferentLines()\n    {\n        var result = IssueLocationCollector.MergeLocations(\n            [new(IssueType.Primary, \"File.cs\", 3, \"message 1\", null, null, null)],\n            [new(IssueType.Primary, \"File.cs\", 10, \"message 2\", null, 10, 5)]);\n\n        result.Should().HaveCount(2);\n\n        result[0].Message.Should().Be(\"message 1\");\n        result[0].Start.Should().NotHaveValue();\n        result[0].Length.Should().NotHaveValue();\n\n        result[1].Message.Should().Be(\"message 2\");\n        result[1].Start.Should().Be(10);\n        result[1].Length.Should().Be(5);\n    }\n\n    [TestMethod]\n    public void MergeLocations_MoreThanOnePreciseLocationForSameIssue()\n    {\n        Action action = () => IssueLocationCollector.MergeLocations(\n                                [new(IssueType.Primary, \"File.cs\", 3, \"Message\", null, null, null)],\n                                [\n                                    new(IssueType.Primary, \"File.cs\", 3, \"Message\", null, null, null),\n                                    new(IssueType.Primary, \"File.cs\", 3, \"Message\", null, null, null)\n                                ]);\n        action.Should().Throw<InvalidOperationException>();\n    }\n\n    [TestMethod]\n    public void MergeLocations_EmptyIssues_NonEmptyPreciseLocations() =>\n        IssueLocationCollector.MergeLocations([], [new(IssueType.Primary, \"File.cs\", 3, \"Message\", null, null, null)]).Should().ContainSingle();\n\n    [TestMethod]\n    public void MergeLocations_NonEmptyIssues_EmptyPreciseLocations() =>\n        IssueLocationCollector.MergeLocations([new(IssueType.Primary, \"File.cs\", 3, \"Message\", null, null, null)], []).Should().ContainSingle();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/Verification/IssueValidation/IssueLocationCollectorTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.TestFramework.Verification.IssueValidation.Tests;\n\n[TestClass]\npublic partial class IssueLocationCollectorTest\n{\n    private static TextLine Line(int lineNumber, string code) =>\n        SourceText.From(code).Lines[lineNumber];\n\n    private static void VerifyIssueLocations(IEnumerable<IssueLocation> result,\n                                             IEnumerable<IssueType> expectedTypes,\n                                             IEnumerable<int> expectedLineNumbers,\n                                             IEnumerable<string> expectedMessages,\n                                             IEnumerable<string> expectedIssueIds)\n    {\n        var values = result.ToArray();\n        values.Should().HaveSameCount(expectedTypes);\n        result.Select(x => x.Type).Should().Equal(expectedTypes);\n        result.Select(x => x.LineNumber).Should().Equal(expectedLineNumbers);\n        result.Select(x => x.Message).Should().Equal(expectedMessages);\n        result.Select(x => x.IssueId).Should().Equal(expectedIssueIds);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/Verification/IssueValidation/IssueLocationPairTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.TestFramework.Verification.IssueValidation.Test;\n\n[TestClass]\npublic class IssueLocationPairTest\n{\n    private static readonly IssueLocation ActualPrimary = new(IssueType.Primary, \"File.cs\", 42, \"Lorem ipsum\", null, 42, 10, \"S1234\");\n    private static readonly IssueLocation ActualSecondary = new(IssueType.Secondary, \"File.cs\", 42, \"Lorem ipsum\", \"Flag1\", 42, 10, \"S1234\");\n\n    [TestMethod]\n    public void CreateMessage_DifferentKeys() =>\n        new IssueLocationPair(new(IssueType.Primary, \"SomeFile.cs\", 1, \"Message\", null, null, null), new(IssueType.Primary, \"AnotherFile.cs\", 1, \"Message\", null, null, null))\n            .Invoking(x => x.CreateMessage())\n            .Should()\n            .Throw<InvalidOperationException>();\n\n    [TestMethod]\n    public void CreateMessage_PerfectMatch() =>\n        new IssueLocationPair(ActualPrimary, ActualPrimary).Invoking(x => x.CreateMessage()).Should().Throw<InvalidOperationException>();\n\n    [TestMethod]\n    public void CreateMessage_MissingIssue_NoMessage() =>\n        ValidateMessage(null, new(IssueType.Primary, \"File.cs\", 42, null, null, null, null), \"Primary Missing\", \"  Line 42: Missing expected issue\");\n\n    [TestMethod]\n    public void CreateMessage_MissingIssue_WithExpectedMessage() =>\n        ValidateMessage(null, ActualPrimary, \"Primary Missing\", \"  Line 42: Missing expected issue 'Lorem ipsum'\");\n\n    [TestMethod]\n    public void CreateMessage_UnexpectedIssue() =>\n        ValidateMessage(ActualPrimary, null, \"Primary Unexpected\", \"  Line 42: Unexpected issue 'Lorem ipsum' Rule S1234\");\n\n    [TestMethod]\n    public void CreateMessage_SecondaryText() =>\n        ValidateMessage(\n            new(IssueType.Secondary, \"File.cs\", 42, \"Lorem ipsum\", null, null, null, \"S1234\"),\n            null,\n            \"Secondary Unexpected\",\n            \"  Line 42 Secondary location: Unexpected issue 'Lorem ipsum' Rule S1234\");\n\n    [TestMethod]\n    public void CreateMessage_WrongMessage() =>\n        ValidateMessage(\n            ActualSecondary,\n            new(IssueType.Secondary, \"File.cs\", 42, \"Dolor sit\", \"Flag1\", 2, 2),\n            \"Secondary Different Message\",\n            \"  Line 42 Secondary location: The expected message 'Dolor sit' does not match the actual message 'Lorem ipsum' Rule S1234 ID Flag1\");\n\n    [TestMethod]\n    public void CreateMessage_WrongStartLocation()\n    {\n        ValidateMessage(\n            ActualSecondary,\n            new(IssueType.Secondary, \"File.cs\", 42, \"Lorem ipsum\", \"Flag1\", 2, 2),\n            \"Secondary Different Location\",\n            \"  Line 42 Secondary location: Should start on column 2 but got column 42 Rule S1234 ID Flag1\");\n    }\n\n    [TestMethod]\n    public void CreateMessage_WrongLength() =>\n        ValidateMessage(\n            ActualSecondary,\n            new(IssueType.Secondary, \"File.cs\", 42, \"Lorem ipsum\", \"Flag1\", 42, 2),\n            \"Secondary Different Length\",\n            \"  Line 42 Secondary location: Should have a length of 2 but got a length of 10 Rule S1234 ID Flag1\");\n\n    [TestMethod]\n    public void CreateMessage_WrongIssueId() =>\n        ValidateMessage(\n            ActualSecondary,\n            new IssueLocation(IssueType.Secondary, \"File.cs\", 42, \"Lorem ipsum\", \"DifferentId\", 42, 10),\n            \"Secondary Different ID\",\n            \"  Line 42 Secondary location: The expected issueId 'DifferentId' does not match the actual issueId 'Flag1' Rule S1234 ID Flag1\");\n\n    private static void ValidateMessage(IssueLocation actualIssue, IssueLocation expectedIssue, string expectedShortDescription, string expectedFullDescription)\n    {\n        var message = new IssueLocationPair(actualIssue, expectedIssue).CreateMessage();\n        message.ShortDescription.Should().Be(expectedShortDescription);\n        message.FullDescription.Should().Be(expectedFullDescription);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/Verification/IssueValidation/IssueLocationTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.TestFramework.Verification.IssueValidation.Test;\n\n[TestClass]\npublic class IssueLocationTest\n{\n    private static readonly IssueLocation Issue = new(IssueType.Primary, \"File.cs\", 42, \"Lorem ipsum\", null, 42, 10, \"S1234\");\n\n    [TestMethod]\n    public void IssueLocation_Ctor_NoSecondaryMessage_HasEmptyMessage() =>\n        new IssueLocation(Issue, new SecondaryLocation(Location.None, null)).Message.Should().BeEmpty();\n\n    [TestMethod]\n    public void IssueLocation_Ctor_Primary()\n    {\n        var sut = new IssueLocation(Diagnostic.Create(AnalysisScaffolding.CreateDescriptor(\"Sxxxx\"), null));\n        sut.Type.Should().Be(IssueType.Primary);\n        sut.RuleId.Should().Be(\"Sxxxx\");\n        sut.IssueId.Should().BeNull();\n    }\n\n    [TestMethod]\n    public void IssueLocation_Ctor_Error()\n    {\n        var sut = new IssueLocation(Diagnostic.Create(\"CSxxxx\", \"Category\", \"Message\", DiagnosticSeverity.Error, DiagnosticSeverity.Error, true, 0));\n        sut.Type.Should().Be(IssueType.Error);\n        sut.RuleId.Should().Be(\"CSxxxx\");\n        sut.IssueId.Should().Be(\"CSxxxx\");\n    }\n\n    [TestMethod]\n    public void IssueLocation_Ctor_SecondaryLocation()\n    {\n        var sut = new IssueLocation(Issue, new SecondaryLocation(Location.None, null));\n        sut.Type.Should().Be(IssueType.Secondary);\n        sut.RuleId.Should().Be(\"S1234\");\n    }\n\n    [TestMethod]\n    public void IssueLocation_Ctor_NoLocation_HasEmptyFilePath()\n    {\n        var sut = new IssueLocation(Diagnostic.Create(AnalysisScaffolding.CreateDescriptor(\"Sxxxx\"), null));\n        sut.FilePath.Should().BeEmpty();\n        sut.LineNumber.Should().Be(1);\n        sut.Start.Should().Be(0);\n    }\n\n    [TestMethod]\n    public void IssueLocation_GetHashCode_DependsOnlyOnKey()\n    {\n        var hashcode = new IssueLocation(IssueType.Primary, \"File.cs\", 1, \"Msg1\", \"id1\", 2, 4, \"Sxxxx\").GetHashCode();\n        hashcode.Should().Be(new IssueLocation(IssueType.Primary, \"File.cs\", 1, \"Diff\", \"diff\", 99, 99, \"Sdiff\").GetHashCode());\n        hashcode.Should().NotBe(0);\n        hashcode.Should().NotBe(new IssueLocation(IssueType.Primary, \"Diff.cs\", 1, \"Msg1\", \"id1\", 2, 4, \"Sxxxx\").GetHashCode());\n        hashcode.Should().NotBe(new IssueLocation(IssueType.Primary, \"File.cs\", 9, \"Msg1\", \"id1\", 2, 4, \"Sxxxx\").GetHashCode());\n        hashcode.Should().NotBe(new IssueLocation(IssueType.Secondary, \"File.cs\", 1, \"Msg1\", \"id1\", 2, 4, \"Sxxxx\").GetHashCode());\n    }\n\n    [TestMethod]\n    public void IssueLocation_Equals_FullMatch()\n    {\n        var orig = new IssueLocation(IssueType.Primary, \"File.cs\", 1, \"Msg1\", \"id1\", 2, 4, \"Sxxxx\");\n        var same = new IssueLocation(IssueType.Primary, \"File.cs\", 1, \"Msg1\", \"id1\", 2, 4, \"Sxxxx\");\n        var proj = new IssueLocation(IssueType.Primary, string.Empty, 1, \"Msg1\", \"id1\", 2, 4, \"Sxxxx\");\n        orig.Equals(same).Should().BeTrue();\n        orig.Equals(proj).Should().BeTrue();\n        proj.Equals(same).Should().BeTrue();\n        orig.Equals(null).Should().BeFalse();\n        orig.Equals(\"different type\").Should().BeFalse();\n        orig.Equals(new IssueLocation(IssueType.Secondary, \"File.cs\", 1, \"Msg1\", \"id1\", 2, 4, \"Sxxxx\")).Should().BeFalse();\n        orig.Equals(new IssueLocation(IssueType.Primary, \"Diff.cs\", 1, \"Msg1\", \"id1\", 2, 4, \"Sxxxx\")).Should().BeFalse();\n        orig.Equals(new IssueLocation(IssueType.Primary, \"File.cs\", 9, \"Msg1\", \"id1\", 2, 4, \"Sxxxx\")).Should().BeFalse();\n        orig.Equals(new IssueLocation(IssueType.Primary, \"File.cs\", 1, \"Xxxx\", \"id1\", 2, 4, \"Sxxxx\")).Should().BeFalse();\n        orig.Equals(new IssueLocation(IssueType.Primary, \"File.cs\", 1, \"Msg1\", \"id1\", 9, 4, \"Sxxxx\")).Should().BeFalse();\n        orig.Equals(new IssueLocation(IssueType.Primary, \"File.cs\", 1, \"Msg1\", \"id1\", 2, 9, \"Sxxxx\")).Should().BeFalse();\n        orig.Equals(new IssueLocation(IssueType.Primary, \"File.cs\", 1, \"Msg1\", \"id1\", 2, 4, \"Syyyy\")).Should().BeFalse();\n        // Special case, IssueId is not checked for IsPrimary issues\n        orig.Equals(new IssueLocation(IssueType.Primary, \"File.cs\", 1, \"Msg1\", \"xxxx\", 2, 4, \"Sxxxx\")).Should().BeTrue();\n        orig.Equals(new IssueLocation(IssueType.Secondary, \"File.cs\", 1, \"Msg1\", \"xxxx\", 2, 4, \"Sxxxx\")).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void IssueLocation_Equals_IgnoreNull_RuleId()\n    {\n        var hasValue = new IssueLocation(IssueType.Primary, \"File.cs\", 1, \"Msg1\", \"id1\", 2, 4, \"Sxxxx\");\n        var withNull = new IssueLocation(IssueType.Primary, \"File.cs\", 1, \"Msg1\", \"id1\", 2, 4, \"Sxxxx\");\n        hasValue.Equals(withNull).Should().BeTrue();\n        withNull.Equals(hasValue).Should().BeTrue();\n        withNull.Equals(withNull).Should().BeTrue();\n        hasValue.Equals(hasValue).Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void IssueLocation_Equals_IgnoreNull_Message() =>\n        ValidateEqualsIgnoreNull(\n            new IssueLocation(IssueType.Primary, \"File.cs\", 1, \"M1\", \"id1\", 2, 4, \"Sxxxx\"),\n            new IssueLocation(IssueType.Primary, \"File.cs\", 1, null, \"id1\", 2, 4, \"Sxxxx\"));\n\n    [TestMethod]\n    public void IssueLocation_Equals_IgnoreNull_IssueId() =>\n        ValidateEqualsIgnoreNull(\n            new IssueLocation(IssueType.Primary, \"File.cs\", 1, \"M1\", \"i1\", 2, 4, \"Sxxxx\"),\n            new IssueLocation(IssueType.Primary, \"File.cs\", 1, \"M1\", null, 2, 4, \"Sxxxx\"));\n\n    [TestMethod]\n    public void IssueLocation_Equals_IgnoreNull_Start() =>\n        ValidateEqualsIgnoreNull(\n            new IssueLocation(IssueType.Primary, \"File.cs\", 1, \"M1\", \"id1\", 2, 4, \"Sxxxx\"),\n            new IssueLocation(IssueType.Primary, \"File.cs\", 1, \"M1\", \"id1\", null, 4, \"Sxxxx\"));\n\n    [TestMethod]\n    public void IssueLocation__Equals_IgnoreNull_Length() =>\n        ValidateEqualsIgnoreNull(\n            new IssueLocation(IssueType.Primary, \"File.cs\", 1, \"M1\", \"id1\", 2, 4, \"Sxxxx\"),\n            new IssueLocation(IssueType.Primary, \"File.cs\", 1, \"M1\", \"id1\", 2, null, \"Sxxxx\"));\n\n    [TestMethod]\n    public void IssueLocationKey_CreatedFromIssue()\n    {\n        var sut = new IssueLocationKey(Issue);\n        sut.FilePath.Should().Be(\"File.cs\");\n        sut.LineNumber.Should().Be(42);\n        sut.Type.Should().Be(IssueType.Primary);\n    }\n\n    [TestMethod]\n    public void IssueLocationKey_IsMatch_MatchesSameKey() =>\n        new IssueLocationKey(IssueType.Primary, \"File.cs\", 42).IsMatch(Issue).Should().BeTrue();\n\n    [TestMethod]\n    public void IssueLocationKey_IsMatch_ProjectLevelMatchesAnyPath() =>\n        new IssueLocationKey(IssueType.Primary, string.Empty, 42).IsMatch(Issue).Should().BeTrue();\n\n    [TestMethod]\n    public void IssueLocationKey_IsMatch_DifferentFilePath() =>\n        new IssueLocationKey(IssueType.Primary, \"Another.cs\", 42).IsMatch(Issue).Should().BeFalse();\n\n    [TestMethod]\n    public void IssueLocationKey_IsMatch_DifferentLineNumber() =>\n        new IssueLocationKey(IssueType.Primary, \"File.cs\", 1024).IsMatch(Issue).Should().BeFalse();\n\n    [TestMethod]\n    public void IssueLocationKey_IsMatch_DifferentIsPrimary() =>\n        new IssueLocationKey(IssueType.Secondary, \"File.cs\", 42).IsMatch(Issue).Should().BeFalse();\n\n    private static void ValidateEqualsIgnoreNull(IssueLocation hasValue, IssueLocation withNull)\n    {\n        hasValue.Equals(withNull).Should().BeTrue();\n        withNull.Equals(hasValue).Should().BeTrue();\n        withNull.Equals(withNull).Should().BeTrue();\n        hasValue.Equals(hasValue).Should().BeTrue();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/Verification/VerifierBuilderTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.TestFramework.Verification;\nusing CS = Microsoft.CodeAnalysis.CSharp;\nusing VB = Microsoft.CodeAnalysis.VisualBasic;\n\nnamespace SonarAnalyzer.Test.TestFramework.Tests.Verification;\n\n[TestClass]\npublic class VerifierBuilderTest\n{\n    private static readonly VerifierBuilder Empty = new();\n\n    [TestMethod]\n    public void AddAnalyzer_Concatenates_IsImmutable()\n    {\n        var one = Empty.AddAnalyzer(() => new DummyAnalyzerCS());\n        var two = one.AddAnalyzer(() => new DummyAnalyzerCS { DummyProperty = 42 });\n        Empty.Analyzers.Should().BeEmpty();\n        one.Analyzers.Should().ContainSingle().And.ContainSingle(x => ((DummyAnalyzerCS)x()).DummyProperty == 0);\n        two.Analyzers.Should().HaveCount(2)\n            .And.ContainSingle(x => ((DummyAnalyzerCS)x()).DummyProperty == 0)\n            .And.ContainSingle(x => ((DummyAnalyzerCS)x()).DummyProperty == 42);\n    }\n\n    [TestMethod]\n    public void AddAnalyzer_Generic_AddAnalyzer()\n    {\n        var sut = new VerifierBuilder<DummyAnalyzerCS>();\n        sut.Analyzers.Should().ContainSingle().Which().Should().BeOfType<DummyAnalyzerCS>();\n    }\n\n    [TestMethod]\n    public void AddPaths_Concatenates_IsImmutable()\n    {\n        var one = Empty.AddPaths(\"First\");\n        var three = one.AddPaths(\"Second\", \"Third\");\n        Empty.Paths.Should().BeEmpty();\n        one.Paths.Should().ContainSingle().Which.Should().Be(\"First\");\n        three.Paths.Should().BeEquivalentTo(\"First\", \"Second\", \"Third\");\n    }\n\n    [TestMethod]\n    public void AddReferences_Concatenates_IsImmutable()\n    {\n        var one = Empty.AddReferences(MetadataReferenceFacade.MsCorLib);\n        var two = one.AddReferences(MetadataReferenceFacade.SystemData);\n        Empty.References.Should().BeEmpty();\n        one.References.Should().BeEquivalentTo(MetadataReferenceFacade.MsCorLib).And.HaveCount(1);\n        two.References.Should().BeEquivalentTo(MetadataReferenceFacade.MsCorLib.Concat(MetadataReferenceFacade.SystemData)).And.HaveCount(2);\n    }\n\n    [TestMethod]\n    public void AddSnippet_Appends_IsImmutable()\n    {\n        var one = Empty.AddSnippet(\"First\");\n        var two = one.AddSnippet(\"Second\", \"WithFileName.cs\");\n        Empty.Snippets.Should().BeEmpty();\n        one.Snippets.Should().Equal(new Snippet(\"First\", null));\n        two.Snippets.Should().Equal(new Snippet(\"First\", null), new Snippet(\"Second\", \"WithFileName.cs\"));\n    }\n\n    [TestMethod]\n    public void AddTestReference_Concatenates_IsImmutable()\n    {\n        var one = Empty.AddReferences(MetadataReferenceFacade.MsCorLib);\n        var two = one.AddTestReference();\n        Empty.References.Should().BeEmpty();\n        one.References.Should().BeEquivalentTo(MetadataReferenceFacade.MsCorLib).And.HaveCount(1);\n        two.References.Should().BeEquivalentTo(MetadataReferenceFacade.MsCorLib.Concat(NuGetMetadataReference.MSTestTestFrameworkV1));\n    }\n\n    [TestMethod]\n    public void WithWarningsAsErrors_Overwrites_IsImmutable()\n    {\n        var one = Empty.WithWarningsAsErrors(\"CS1111\");\n        var two = one.WithWarningsAsErrors(\"CS2222\");\n        Empty.WarningsAsErrors.Should().BeEmpty();\n        one.WarningsAsErrors.Should().BeEquivalentTo([\"CS1111\"]);\n        two.WarningsAsErrors.Should().BeEquivalentTo([\"CS2222\"]);\n    }\n\n    [TestMethod]\n    public void WithAutogenerateConcurrentFiles_Overwrites_IsImmutable()\n    {\n        var one = Empty.WithAutogenerateConcurrentFiles(false);\n        var two = one.WithAutogenerateConcurrentFiles(true);\n        Empty.AutogenerateConcurrentFiles.Should().BeTrue();\n        one.AutogenerateConcurrentFiles.Should().BeFalse();\n        two.AutogenerateConcurrentFiles.Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void WithBasePath_Overwrites_IsImmutable()\n    {\n        var one = Empty.WithBasePath(\"Hotspots\");\n        var two = one.WithBasePath(\"SymbolicExecution\");\n        Empty.BasePath.Should().BeNull();\n        one.BasePath.Should().Be(\"Hotspots\");\n        two.BasePath.Should().Be(\"SymbolicExecution\");\n    }\n\n    [TestMethod]\n    public void WithCodeFix_Overwrites_IsImmutable()\n    {\n        var one = Empty.WithCodeFix<DummyCodeFixCS>();\n        var two = one.WithCodeFix<DummyCodeFixVB>();\n        Empty.CodeFix.Should().BeNull();\n        one.CodeFix().Should().BeOfType<DummyCodeFixCS>();\n        two.CodeFix().Should().BeOfType<DummyCodeFixVB>();\n    }\n\n    [TestMethod]\n    public void WithCodeFixedPaths_Overwrites_IsImmutable()\n    {\n        var one = Empty.WithCodeFixedPaths(\"First\");\n        var two = one.WithCodeFixedPaths(\"Second\");\n        var withBatch = one.WithCodeFixedPaths(\"Third\", \"Batch\");\n        Empty.CodeFixedPath.Should().BeNull();\n        one.CodeFixedPath.Should().Be(\"First\");\n        two.CodeFixedPath.Should().Be(\"Second\");\n        withBatch.CodeFixedPath.Should().Be(\"Third\");\n        // Batch version should not be modified:\n        Empty.CodeFixedPathBatch.Should().BeNull();\n        one.CodeFixedPathBatch.Should().BeNull();\n        two.CodeFixedPathBatch.Should().BeNull();\n        withBatch.CodeFixedPathBatch.Should().Be(\"Batch\");\n    }\n\n    [TestMethod]\n    public void WithConcurrentAnalysis_Overwrites_IsImmutable()\n    {\n        var one = Empty.WithConcurrentAnalysis(false);\n        var two = one.WithConcurrentAnalysis(true);\n        Empty.ConcurrentAnalysis.Should().BeTrue();\n        one.ConcurrentAnalysis.Should().BeFalse();\n        two.ConcurrentAnalysis.Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void WithCodeFixTitle_Overwrites_IsImmutable()\n    {\n        var one = Empty.WithCodeFixTitle(\"First\");\n        var two = one.WithCodeFixTitle(\"Second\");\n        Empty.CodeFixTitle.Should().BeNull();\n        one.CodeFixTitle.Should().Be(\"First\");\n        two.CodeFixTitle.Should().Be(\"Second\");\n    }\n\n    [TestMethod]\n    public void WithErrorBehavior_Overwrites_IsImmutable()\n    {\n        var one = Empty.WithErrorBehavior(CompilationErrorBehavior.FailTest);\n        var two = one.WithErrorBehavior(CompilationErrorBehavior.Ignore);\n        Empty.ErrorBehavior.Should().Be(CompilationErrorBehavior.Default);\n        one.ErrorBehavior.Should().Be(CompilationErrorBehavior.FailTest);\n        two.ErrorBehavior.Should().Be(CompilationErrorBehavior.Ignore);\n    }\n\n    [TestMethod]\n    public void WithLanguageVersion_Overwrites_IsImmutable_CS()\n    {\n        var one = Empty.WithLanguageVersion(CS.LanguageVersion.CSharp10);\n        var two = one.WithLanguageVersion(CS.LanguageVersion.CSharp7);\n        Empty.ParseOptions.Should().BeEmpty();\n        one.ParseOptions.Should().ContainSingle().Which.Should().BeOfType<CS.CSharpParseOptions>().Which.LanguageVersion.Should().Be(CS.LanguageVersion.CSharp10);\n        two.ParseOptions.Should().ContainSingle().Which.Should().BeOfType<CS.CSharpParseOptions>().Which.LanguageVersion.Should().Be(CS.LanguageVersion.CSharp7);\n    }\n\n    [TestMethod]\n    public void WithLanguageVersion_Overwrites_IsImmutable_VB()\n    {\n        var one = Empty.WithLanguageVersion(VB.LanguageVersion.VisualBasic16);\n        var two = one.WithLanguageVersion(VB.LanguageVersion.VisualBasic10);\n        Empty.ParseOptions.Should().BeEmpty();\n        one.ParseOptions.Should().ContainSingle().Which.Should().BeOfType<VB.VisualBasicParseOptions>().Which.LanguageVersion.Should().Be(VB.LanguageVersion.VisualBasic16);\n        two.ParseOptions.Should().ContainSingle().Which.Should().BeOfType<VB.VisualBasicParseOptions>().Which.LanguageVersion.Should().Be(VB.LanguageVersion.VisualBasic10);\n    }\n\n    [TestMethod]\n    public void WithOnlyDiagnostics_Overwrites_IsImmutable()\n    {\n        var s1111 = AnalysisScaffolding.CreateDescriptor(\"S1111\");\n        var s2222 = AnalysisScaffolding.CreateDescriptor(\"S2222\");\n        var s2223 = AnalysisScaffolding.CreateDescriptor(\"S2223\");\n        var one = Empty.WithOnlyDiagnostics(s1111);\n        var two = one.WithOnlyDiagnostics(s2222, s2223);\n        Empty.OnlyDiagnostics.Should().BeEmpty();\n        one.OnlyDiagnostics.Should().BeEquivalentTo([s1111]);\n        two.OnlyDiagnostics.Should().BeEquivalentTo([s2222, s2223]);\n    }\n\n    [TestMethod]\n    public void WithOptions_Overwrites_IsImmutable()\n    {\n        var only7 = Empty.WithOptions(LanguageOptions.OnlyCSharp7);\n        var from8 = only7.WithOptions(LanguageOptions.FromCSharp8);\n        Empty.ParseOptions.Should().BeEmpty();\n        only7.ParseOptions.Should().BeEquivalentTo(LanguageOptions.OnlyCSharp7);\n        from8.ParseOptions.Should().BeEquivalentTo(LanguageOptions.FromCSharp8);\n    }\n\n    [TestMethod]\n    public void WithOutputKind_Overwrites_IsImmutable()\n    {\n        var one = Empty.WithOutputKind(OutputKind.WindowsApplication);\n        var two = one.WithOutputKind(OutputKind.NetModule);\n        Empty.OutputKind.Should().Be(OutputKind.DynamicallyLinkedLibrary);\n        one.OutputKind.Should().Be(OutputKind.WindowsApplication);\n        two.OutputKind.Should().Be(OutputKind.NetModule);\n    }\n\n    [TestMethod]\n    public void WithProtobufPath_Overwrites_IsImmutable()\n    {\n        var one = Empty.WithProtobufPath(\"First\");\n        var two = one.WithProtobufPath(\"Second\");\n        Empty.ProtobufPath.Should().BeNull();\n        one.ProtobufPath.Should().Be(\"First\");\n        two.ProtobufPath.Should().Be(\"Second\");\n    }\n\n    [TestMethod]\n    public void WithSonarProjectConfig_Overwrites_IsImmutable()\n    {\n        var one = Empty.WithAdditionalFilePath(\"First\");\n        var two = one.WithAdditionalFilePath(\"Second\");\n        var three = two.WithAdditionalFilePath(null);\n        Empty.AdditionalFilePath.Should().BeNull();\n        one.AdditionalFilePath.Should().Be(\"First\");\n        two.AdditionalFilePath.Should().Be(\"Second\");\n        three.AdditionalFilePath.Should().BeNull();\n    }\n\n    [TestMethod]\n    public void WithTargetFramework_Overwrites_IsImmutable()\n    {\n        var one = Empty.WithTargetFrameworks(TargetFrameworks.Net);\n        var two = one.WithTargetFrameworks(TargetFrameworks.NetFramework);\n        Empty.TargetFrameworks.Should().Be(TargetFrameworks.Net | TargetFrameworks.NetFramework);\n        one.TargetFrameworks.Should().Be(TargetFrameworks.Net);\n        two.TargetFrameworks.Should().Be(TargetFrameworks.NetFramework);\n    }\n\n    [TestMethod]\n    public void WithNetOnly() =>\n        Empty.WithNetOnly().TargetFrameworks.Should().Be(TargetFrameworks.Net);\n\n    [TestMethod]\n    public void WithNetFrameworkOnly() =>\n        Empty.WithNetFrameworkOnly().TargetFrameworks.Should().Be(TargetFrameworks.NetFramework);\n\n    [TestMethod]\n    public void WithTopLevelSupport_Overwrites_IsImmutable()\n    {\n        var sut = Empty.WithTopLevelStatements();\n        Empty.OutputKind.Should().Be(OutputKind.DynamicallyLinkedLibrary);\n        Empty.ParseOptions.Should().BeEmpty();\n        sut.OutputKind.Should().Be(OutputKind.ConsoleApplication);\n        sut.ParseOptions.Should().BeEquivalentTo(LanguageOptions.FromCSharp9);\n    }\n\n    [TestMethod]\n    public void WithTopLevelSupport_PreservesParseOptions()\n    {\n        var sut = Empty.WithOptions(LanguageOptions.FromCSharp10).WithTopLevelStatements();\n        sut.OutputKind.Should().Be(OutputKind.ConsoleApplication);\n        sut.ParseOptions.Should().BeEquivalentTo(LanguageOptions.FromCSharp10);\n    }\n\n    [TestMethod]\n    public void WithTopLevelSupport_ForVisualBasicOptions_NotSupported() =>\n        Empty.WithOptions(LanguageOptions.FromVisualBasic15).Invoking(x => x.WithTopLevelStatements()).Should().Throw<InvalidOperationException>()\n            .WithMessage(\"WithTopLevelStatements is not supported with VisualBasicParseOptions.\");\n\n    [TestMethod]\n    public void WithTopLevelSupport_ForOldCSharp_NotSupported() =>\n        Empty.WithOptions(LanguageOptions.FromCSharp8).Invoking(x => x.WithTopLevelStatements()).Should().Throw<InvalidOperationException>()\n            .WithMessage(\"WithTopLevelStatements is supported from CSharp9.\");\n\n    [TestMethod]\n    public void Build_ReturnsVerifier() =>\n        new VerifierBuilder<DummyAnalyzerCS>().AddPaths(\"File.cs\").Build().Should().NotBeNull();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/Verification/VerifierTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing System.IO;\nusing FluentAssertions.Execution;\nusing Microsoft.CodeAnalysis.CSharp;\nusing SonarAnalyzer.Core.Configuration;\nusing SonarAnalyzer.CSharp.Rules;\nusing SonarAnalyzer.Protobuf;\nusing SonarAnalyzer.TestFramework.Verification;\nusing static SonarAnalyzer.TestFramework.Verification.Verifier;\n\nnamespace SonarAnalyzer.Test.TestFramework.Tests.Verification;\n\n[TestClass]\npublic class VerifierTest\n{\n    private static readonly VerifierBuilder DummyCS = new VerifierBuilder<DummyAnalyzerCS>();\n    private static readonly VerifierBuilder DummyVB = new VerifierBuilder<DummyAnalyzerVB>();\n    private static readonly VerifierBuilder DummyCodeFixCS = new VerifierBuilder<DummyAnalyzerCS>().AddPaths(\"Path.cs\").WithCodeFix<DummyCodeFixCS>().WithCodeFixedPaths(\"Expected.cs\");\n\n    private static readonly VerifierBuilder DummyWithLocation = new VerifierBuilder<DummyAnalyzerWithLocation>();\n\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    public void Constructor_Null_Throws() =>\n        ((Func<Verifier>)(() => new(null))).Should().Throw<ArgumentNullException>().And.ParamName.Should().Be(\"builder\");\n\n    [TestMethod]\n    public void Constructor_NoAnalyzers_Throws() =>\n        new VerifierBuilder().Invoking(x => x.Build())\n            .Should().Throw<ArgumentException>()\n            .WithMessage(\"Analyzers cannot be empty. Use VerifierBuilder<TAnalyzer> instead or add at least one analyzer using builder.AddAnalyzer().\");\n\n    [TestMethod]\n    public void Constructor_NullAnalyzers_Throws() =>\n        new VerifierBuilder().AddAnalyzer(() => null).Invoking(x => x.Build())\n            .Should().Throw<ArgumentException>()\n            .WithMessage(\"Analyzer instance cannot be null.\");\n\n    [TestMethod]\n    public void Constructor_NoPaths_Throws() =>\n        DummyCS.Invoking(x => x.Build()).Should().Throw<ArgumentException>().WithMessage(\"Paths cannot be empty. Add at least one file using builder.AddPaths() or AddSnippet().\");\n\n    [TestMethod]\n    public void Constructor_MixedLanguageAnalyzers_Throws() =>\n        DummyCS.AddAnalyzer(static () => new VisualBasic.Rules.OptionStrictOn()).Invoking(x => x.Build())\n            .Should().Throw<ArgumentException>()\n            .WithMessage(\"All Analyzers must declare the same language in their DiagnosticAnalyzerAttribute.\");\n\n    [TestMethod]\n    public void Constructor_TargetFrameworksNone_Throws() =>\n        DummyCS.WithTargetFrameworks(TargetFrameworks.None).Invoking(x => x.Build())\n            .Should().Throw<ArgumentException>()\n            .WithMessage(\"TargetFrameworks cannot be None.\");\n\n    [TestMethod]\n    public void Constructor_MixedLanguagePaths_Throws() =>\n        DummyCS.AddPaths(\"File.txt\").Invoking(x => x.Build())\n            .Should().Throw<ArgumentException>()\n            .WithMessage(\"Path 'File.txt' doesn't match C# file extension '.cs'.\");\n\n    [TestMethod]\n    public void Constructor_CodeFix_MissingCodeFixedPath_Throws() =>\n        DummyCodeFixCS.WithCodeFixedPaths(null).Invoking(x => x.Build())\n            .Should().Throw<ArgumentException>()\n            .WithMessage(\"CodeFixedPath was not set.\");\n\n    [TestMethod]\n    public void Constructor_CodeFix_WrongCodeFixedPath_Throws() =>\n        DummyCodeFixCS.WithCodeFixedPaths(\"File.vb\").Invoking(x => x.Build())\n            .Should().Throw<ArgumentException>()\n            .WithMessage(\"Path 'File.vb' doesn't match C# file extension '.cs'.\");\n\n    [TestMethod]\n    public void Constructor_CodeFix_WrongCodeFixedPathBatch_Throws() =>\n        DummyCodeFixCS.WithCodeFixedPaths(\"File.cs\", \"Batch.vb\").Invoking(x => x.Build())\n            .Should().Throw<ArgumentException>()\n            .WithMessage(\"Path 'Batch.vb' doesn't match C# file extension '.cs'.\");\n\n    [TestMethod]\n    public void Constructor_CodeFix_MultipleAnalyzers_Throws() =>\n        DummyCodeFixCS.AddAnalyzer(() => new DummyAnalyzerCS()).Invoking(x => x.Build())\n            .Should().Throw<ArgumentException>()\n            .WithMessage(\"When CodeFix is set, Analyzers must contain only 1 analyzer, but 2 were found.\");\n\n    [TestMethod]\n    public void Constructor_CodeFix_MultiplePaths_Throws() =>\n        DummyCodeFixCS.AddPaths(\"Second.cs\", \"Third.cs\").Invoking(x => x.Build())\n            .Should().Throw<ArgumentException>()\n            .WithMessage(\"Paths must contain only 1 file, but 3 were found.\");\n\n    [TestMethod]\n    public void Constructor_CodeFix_WithSnippets_Throws() =>\n        DummyCodeFixCS.AddSnippet(\"Wrong\").Invoking(x => x.Build())\n            .Should().Throw<ArgumentException>()\n            .WithMessage(\"Snippets must be empty when CodeFix is set.\");\n\n    [TestMethod]\n    public void Constructor_CodeFix_WrongLanguage_Throws() =>\n        DummyCodeFixCS.WithCodeFix<DummyCodeFixVB>().Invoking(x => x.Build())\n            .Should().Throw<ArgumentException>()\n            .WithMessage(\"DummyAnalyzerCS language C# does not match DummyCodeFixVB language.\");\n\n    [TestMethod]\n    public void Constructor_CodeFix_FixableDiagnosticsNotSupported_Throws() =>\n        DummyCodeFixCS.WithCodeFix<EmptyMethodCodeFix>().Invoking(x => x.Build())\n            .Should().Throw<ArgumentException>()\n            .WithMessage(\"DummyAnalyzerCS does not support diagnostics fixable by the EmptyMethodCodeFix.\");\n\n    [TestMethod]\n    public void Constructor_CodeFix_MissingAttribute_Throws() =>\n        DummyCodeFixCS.WithCodeFix<DummyCodeFixNoAttribute>().Invoking(x => x.Build())\n            .Should().Throw<ArgumentException>()\n            .WithMessage(\"DummyCodeFixNoAttribute does not have ExportCodeFixProviderAttribute.\");\n\n    [TestMethod]\n    public void Constructor_ProtobufPath_MultipleAnalyzers_Throws() =>\n        DummyCS.AddSnippet(\"//Empty\").WithProtobufPath(\"Proto.pb\").AddAnalyzer(() => new DummyAnalyzerCS()).Invoking(x => x.Build())\n            .Should().Throw<ArgumentException>()\n            .WithMessage(\"When ProtobufPath is set, Analyzers must contain only 1 analyzer, but 2 were found.\");\n\n    [TestMethod]\n    public void Constructor_ProtobufPath_WrongAnalyzerType_Throws() =>\n        DummyCS.AddSnippet(\"//Empty\").WithProtobufPath(\"Proto.pb\").Invoking(x => x.Build())\n            .Should().Throw<ArgumentException>()\n            .WithMessage(\"DummyAnalyzerCS does not inherit from UtilityAnalyzerBase.\");\n\n    [TestMethod]\n    public void Constructor_NetFrameworkOnly_ThrowsInconclusive() =>\n        WithSnippetCS(\"Nothing to see here, it will not be analyzed\")\n            .WithNetFrameworkOnly() // Will not run under this SonarAnalyzer.TestFramework.Test .NET-only TFM\n            .Invoking(x => x.Build())\n            .Should().Throw<AssertInconclusiveException>()\n            .WithMessage(\"Assert.Inconclusive failed. This test should run only under NetFramework. Current framework is Net.\");\n\n#if NET\n\n    [TestMethod]\n    public void Verify_RazorWithAssociatedCS() =>\n        DummyCS.AddPaths(WriteFile(\"File.razor\", \"\"\"<p @bind=\"pValue\">Dynamic content</p>\"\"\"))\n            .AddPaths(WriteFile(\"File.razor.cs\", \"\"\"public partial class File { string pValue = \"The value bound\"; int a = 42;  }\"\"\"))\n            .Invoking(x => x.Verify())\n            .Should().Throw<DiagnosticVerifierException>();\n\n    [TestMethod]\n    public void Verify_RazorWithUnrelatedCS() =>\n        DummyCS.AddPaths(WriteFile(\"File.razor\", \"\"\"<p @bind=\"pValue\">Dynamic content</p>\"\"\"))\n            .AddPaths(WriteFile(\"SomeSource.cs\", \"\"\"class SomeSource { int a = 42; }\"\"\"))\n            .Invoking(x => x.Verify())\n            .Should().Throw<DiagnosticVerifierException>();\n\n    [TestMethod]\n    public void Verify_RazorWithUnrelatedIssues() =>\n        DummyCS.AddPaths(WriteFile(\"File.razor\", \"\"\"<p @bind=\"pValue\">Dynamic content</p>\"\"\"))\n            .AddPaths(WriteFile(\"SomeSource.cs\", \"\"\"class SomeSource { int a = 42; }\"\"\"))\n            .AddPaths(WriteFile(\"Sample.cs\", \"\"\"\n                public class Sample\n                {\n                    private int a = 42;     // Noncompliant {{Message for SDummy}}\n                    private int b = 42;     // Noncompliant\n                    private bool c = true;\n                }\n                \"\"\"))\n            .Invoking(x => x.Verify())\n            .Should().Throw<DiagnosticVerifierException>();\n\n    [TestMethod]\n    [DataRow(\"Dummy.SecondaryLocation.razor\")]\n    [DataRow(\"Dummy.SecondaryLocation.cshtml\")]\n    public void Verify_RazorWithAdditionalLocation(string path) =>\n        DummyWithLocation.AddPaths(path)\n            .WithOptions(LanguageOptions.BeforeCSharp10)\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Product))\n            .Verify();\n\n    [TestMethod]\n    [DataRow(\"Dummy.SecondaryLocation.CSharp10.razor\")]\n    [DataRow(\"Dummy.SecondaryLocation.cshtml\")]\n    public void Verify_RazorWithAdditionalLocation_CSharp10(string path) =>\n        DummyWithLocation.AddPaths(path)\n            .WithOptions(LanguageOptions.FromCSharp10)\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Product))\n            .Verify();\n\n    [TestMethod]\n    [DataRow(\"Dummy.razor\")]\n    [DataRow(\"Dummy.cshtml\")]\n    public void Verify_Razor(string path) =>\n        DummyWithLocation.AddPaths(path)\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Product))\n            .Verify();\n\n    [TestMethod]\n    [DataRow(\"DummyExpressions.razor\")]\n    [DataRow(\"DummyExpressions.cshtml\")]\n    public void Verify_RazorExpressions_Locations(string path) =>\n        DummyWithLocation\n            .AddPaths(path)\n            .WithOptions(LanguageOptions.BeforeCSharp10)\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Product))\n            .Verify();\n\n    [TestMethod]\n    [DataRow(\"DummyExpressions.CSharp10.razor\")]\n    [DataRow(\"DummyExpressions.cshtml\")]\n    public void Verify_RazorExpressions_Locations_CSharp10(string path) =>\n        DummyWithLocation\n            .AddPaths(path)\n            .WithOptions(LanguageOptions.FromCSharp10)\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Product))\n            .Verify();\n\n    [TestMethod]\n    [DataRow(\"Dummy.razor\")]\n    [DataRow(\"Dummy.cshtml\")]\n    public void Verify_RazorAnalysisIsDisabled_DoesNotRaise(string path) =>\n        DummyWithLocation.AddPaths(path)\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarLintXml(TestContext, analyzeRazorCode: false))\n            .VerifyNoIssues();\n\n    [TestMethod]\n    [DataRow(\"Dummy.razor\")]\n    [DataRow(\"Dummy.cshtml\")]\n    public void Verify_RazorAnalysisInSLAndNugetContext(string path) =>\n        DummyWithLocation.AddPaths(path)\n            .WithAdditionalFilePath(AnalysisScaffolding.CreateSonarProjectConfig(TestContext, ProjectType.Unknown))\n            .Verify();\n\n    [TestMethod]\n    public void Verify_NetOnly_NoException() =>\n        WithSnippetCS(\"class Sample { private int a = 42; }  // Noncompliant\")\n            .WithNetOnly() // Will run under this SonarAnalyzer.TestFramework.Test .NET-only TFM\n            .Invoking(x => x.Verify())\n            .Should().NotThrow();\n\n    [TestMethod]\n    public void Compile_Razor_DefaultFramework()\n    {\n        var compilation = DummyWithLocation.AddPaths(\"Dummy.razor\")\n            .AddSnippet(\"class Sample(object forceTheTypeToBeUsed) { }\")\n            .WithLanguageVersion(LanguageVersion.CSharp12)\n            .Build()\n            .Compile(false)\n            .Single();\n        compilation.Compilation.GetSpecialType(SpecialType.System_Object).ContainingAssembly.Identity.Version.Major.Should().Be(10, \"This version is the default framework for in-memory compilation\");\n\n        compilation.Compilation.ExternalReferences.Select(x => Path.GetFileName(x.Display)).Should().Contain([\n            \"Microsoft.AspNetCore.dll\",\n            \"Microsoft.AspNetCore.Components.dll\",\n            \"Microsoft.AspNetCore.Components.Web.dll\",\n            \"System.Text.Encodings.Web.dll\"\n        ]);\n    }\n\n    [TestMethod]\n    public void Compile_Razor_AddReferences()\n    {\n        var compilations = DummyWithLocation.AddPaths(\"Dummy.razor\")\n            .AddReferences(NuGetMetadataReference.MicrosoftAzureDocumentDB())\n            .WithLanguageVersion(LanguageVersion.Latest)\n            .Build()\n            .Compile(false);\n        var references = compilations.Single().Compilation.References;\n        references.Should().Contain(x => x.Display.Contains(\"Microsoft.Azure.DocumentDB\"));\n    }\n\n    [TestMethod]\n    public void Compile_Razor_NoReferences()\n    {\n        var compilations = DummyWithLocation.AddPaths(\"Dummy.razor\")\n            .WithLanguageVersion(LanguageVersion.Latest)\n            .Build()\n            .Compile(false);\n        var references = compilations.Single().Compilation.References;\n        references.Should().NotContain(x => x.Display.Contains(\"Microsoft.Azure.DocumentDB\"));\n    }\n\n    [TestMethod]\n    public void Compile_Razor_Snippet()\n    {\n        var compilation = DummyWithLocation\n            .AddSnippet(\"\"\"\n                <p>@Counter</p>\n\n                @code {\n                    int Counter = 0;\n                }\n                \"\"\",\n                \"snippet.razor\")\n            .WithLanguageVersion(LanguageVersion.Latest)\n            .Build()\n            .Compile(false)\n            .Single();\n\n        compilation.Compilation.SyntaxTrees.Should().ContainSingle();\n        ContainsSyntaxTreeWithName(compilation, \"snippet_razor.g.cs\");\n    }\n\n    [TestMethod]\n    public void Compile_Cshtml_Snippet()\n    {\n        var compilation = DummyWithLocation\n            .AddSnippet(\"\"\"\n                @{ var total = 7; }\n                <p>@total</p>\n                \"\"\",\n                \"snippet.cshtml\")\n            .WithLanguageVersion(LanguageVersion.Latest)\n            .Build()\n            .Compile(false)\n            .Single();\n\n        compilation.Compilation.SyntaxTrees.Should().ContainSingle();\n        ContainsSyntaxTreeWithName(compilation, \"snippet_cshtml.g.cs\");\n    }\n\n    [TestMethod]\n    public void Compile_Razor_Snippet_NoName()\n    {\n        var compilation = DummyWithLocation\n            .AddPaths(\"Dummy.cshtml\")\n            .AddSnippet(\"class Sample {}\")\n            .WithLanguageVersion(LanguageVersion.Latest)\n            .Build()\n            .Compile(false)\n            .Single();\n\n        ContainsSyntaxTreeWithName(compilation, \"Dummy_cshtml.g.cs\");\n        ContainsSyntaxTreeWithName(compilation, \"snippet0.cs\");\n    }\n\n    [TestMethod]\n    public void Compile_Razor_Snippet_Name_CSharp()\n    {\n        var compilation = DummyWithLocation\n            .AddPaths(\"Dummy.cshtml\")\n            .AddSnippet(\"class Sample {}\", \"snippet.cs\")\n            .WithLanguageVersion(LanguageVersion.Latest)\n            .Build()\n            .Compile(false)\n            .Single();\n\n        ContainsSyntaxTreeWithName(compilation, \"Dummy_cshtml.g.cs\");\n        ContainsSyntaxTreeWithName(compilation, \"snippet.cs\");\n    }\n\n    [TestMethod]\n    public void Compile_Razor_Snippet_Name_Cshtml()\n    {\n        var compilation = DummyWithLocation\n            .AddPaths(\"Dummy.cshtml\")\n            .AddSnippet(\"class Sample {}\", \"snippet.cshtml\")\n            .WithLanguageVersion(LanguageVersion.Latest)\n            .Build()\n            .Compile(false)\n            .Single();\n\n        ContainsSyntaxTreeWithName(compilation, \"Dummy_cshtml.g.cs\");\n        ContainsSyntaxTreeWithName(compilation, \"snippet_cshtml.g.cs\");\n    }\n\n    [TestMethod]\n    public void Compile_Razor_Snippet_MixedNames()\n    {\n        var compilation = DummyWithLocation\n            .AddPaths(\"Dummy.cshtml\")\n            .AddSnippet(\"class Sample {}\")                     // No name, .0.cs\n            .AddSnippet(\"class Sample {}\")                     // No name, .1.cs\n            .AddSnippet(\"class Sample {}\", \"snippet.cs\")       // Named, c#\n            .AddSnippet(\"class Sample {}\", \"snippet.cshtml\")   // Named, c#\n            .WithLanguageVersion(LanguageVersion.Latest)\n            .Build()\n            .Compile(false)\n            .Single();\n\n        ContainsSyntaxTreeWithName(compilation, \"Dummy_cshtml.g.cs\");\n        ContainsSyntaxTreeWithName(compilation, \"snippet_cshtml.g.cs\");\n        ContainsSyntaxTreeWithName(compilation, \"snippet0.cs\");\n        ContainsSyntaxTreeWithName(compilation, \"snippet1.cs\");\n        ContainsSyntaxTreeWithName(compilation, \"snippet.cs\");\n    }\n\n#endif\n\n    [TestMethod]\n    public void Verify_ThrowsWithCodeFixSet()\n    {\n        var originalPath = WriteFile(\"File.cs\", null);\n        var fixedPath = WriteFile(\"File.Fixed.cs\", null);\n        DummyCS.AddPaths(originalPath).WithCodeFix<DummyCodeFixCS>().WithCodeFixedPaths(fixedPath).Invoking(x => x.Verify())\n            .Should().Throw<InvalidOperationException>()\n            .WithMessage(\"Cannot use Verify with CodeFix set.\");\n    }\n\n    [TestMethod]\n    public void Verify_RaiseExpectedIssues_CS() =>\n        WithSnippetCS(\"\"\"\n            public class Sample\n            {\n                private int a = 42;     // Noncompliant {{Message for SDummy}}\n                private int b = 42;     // Noncompliant\n                private bool c = true;\n            }\n            \"\"\").Invoking(x => x.Verify()).Should().NotThrow();\n\n    [TestMethod]\n    public void Verify_RaiseExpectedIssues_VB() =>\n        WithSnippetVB(\"\"\"\n            Public Class Sample\n                Private A As Integer = 42   ' Noncompliant {{Message for SDummy}}\n                Private B As Integer = 42   ' Noncompliant\n                Private C As Boolean = True\n            End Class\n            \"\"\").Invoking(x => x.Verify()).Should().NotThrow();\n\n    [TestMethod]\n    public void Verify_RaiseUnexpectedIssues_CS() =>\n        WithSnippetCS(\"\"\"\n            public class Sample\n            {\n                private int a = 42;     // FP\n                private int b = 42;     // FP\n                private bool c = true;\n            }\n            \"\"\").Invoking(x => x.Verify()).Should().Throw<DiagnosticVerifierException>().WithMessage(\"\"\"\n            There are differences for CSharp7 File.cs:\n              Line 3: Unexpected issue 'Message for SDummy' Rule SDummy\n              Line 4: Unexpected issue 'Message for SDummy' Rule SDummy\n\n            There are 2 more differences in File.Concurrent.cs\n\n            \"\"\");\n\n    [TestMethod]\n    public void Verify_RaiseUnexpectedIssues_VB() =>\n        WithSnippetVB(\"\"\"\n            Public Class Sample\n                Private A As Integer = 42   ' FP\n                Private B As Integer = 42   ' FP\n                Private C As Boolean = True\n            End Class\n            \"\"\").Invoking(x => x.Verify()).Should().Throw<DiagnosticVerifierException>().WithMessage(\"\"\"\n            There are differences for VisualBasic12 File.vb:\n              Line 2: Unexpected issue 'Message for SDummy' Rule SDummy\n              Line 3: Unexpected issue 'Message for SDummy' Rule SDummy\n\n            There are 2 more differences in File.Concurrent.vb\n\n            \"\"\");\n\n    [TestMethod]\n    public void Verify_MissingExpectedIssues() =>\n        WithSnippetCS(\"\"\"\n            public class Sample\n            {\n                private bool a = true;   // Noncompliant - FN\n                private bool b = true;   // Noncompliant - FN\n                private bool c = true;\n            }\n            \"\"\").Invoking(x => x.Verify()).Should().Throw<DiagnosticVerifierException>().WithMessage(\"\"\"\n            There are differences for CSharp7 File.cs:\n              Line 3: Missing expected issue\n              Line 4: Missing expected issue\n\n            There are 2 more differences in File.Concurrent.cs\n\n            \"\"\");\n\n    [TestMethod]\n    public void Verify_TwoAnalyzers() =>\n        WithSnippetCS(\"\"\"\n            public class Sample\n            {\n                private int a = 42;     // Noncompliant {{Message for SDummy}}\n                                        // Noncompliant@-1\n                private int b = 42;     // Noncompliant\n                                        // Noncompliant@-1\n                private bool c = true;\n            }\n            \"\"\")\n            .AddAnalyzer(() => new DummyAnalyzerCS()) // Duplicate\n            .Invoking(x => x.Verify())\n            .Should().NotThrow();\n\n    [TestMethod]\n    public void Verify_TwoPaths() =>\n        WithSnippetCS(\"\"\"\n            public class First\n            {\n                private bool a = true;     // Noncompliant - FN in File.cs\n            }\n            \"\"\")\n            .AddPaths(WriteFile(\"Second.cs\", \"\"\"\n                public class Second\n                {\n                    private bool a = true;     // Noncompliant - FN in Second.cs\n                }\n                \"\"\"))\n            .WithConcurrentAnalysis(false)\n            .Invoking(x => x.Verify())\n            .Should().Throw<DiagnosticVerifierException>()\n            .WithMessage(\"\"\"\n                There are differences for CSharp7 File.cs:\n                  Line 3: Missing expected issue\n\n                There are differences for CSharp7 Second.cs:\n                  Line 3: Missing expected issue\n                \"\"\");\n\n    [TestMethod]\n    public void Verify_AutogenerateConcurrentFiles()\n    {\n        var builder = WithSnippetCS(\"// Noncompliant - FN\");\n        // Concurrent analysis by-default automatically generates concurrent files - File.Concurrent.cs\n        builder.Invoking(x => x.Verify()).Should().Throw<DiagnosticVerifierException>().WithMessage(\"\"\"\n            There are differences for CSharp7 File.cs:\n              Line 1: Missing expected issue\n\n            There is 1 more difference in File.Concurrent.cs\n            \"\"\");\n        // When AutogenerateConcurrentFiles is turned off, only the provided snippet is analyzed\n        builder.WithAutogenerateConcurrentFiles(false).Invoking(x => x.Verify()).Should().Throw<DiagnosticVerifierException>().WithMessage(\"\"\"\n            There are differences for CSharp7 File.cs:\n              Line 1: Missing expected issue\n\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Verify_TestProject()\n    {\n        var builder = new VerifierBuilder<DoNotWriteToStandardOutput>() // Rule with scope Main\n            .AddSnippet(\"class Sample { void Main() { System.Console.WriteLine(); } }  // Noncompliant\");\n        builder.Invoking(x => x.Verify()).Should().NotThrow();\n        builder.AddTestReference().Invoking(x => x.Verify()).Should().Throw<DiagnosticVerifierException>(\"project references should be recognized as Test code\").WithMessage(\"\"\"\n            There are differences for CSharp7 snippet0.cs:\n              Line 1: Missing expected issue\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Verify_ParseOptions()\n    {\n        var builder = WithSnippetCS(\"\"\"\n            class Sample\n            {\n                int i = 42;                     // Noncompliant\n                System.Exception ex = new();    // C# 9 target-typed new\n            }\n            \"\"\");\n        builder.WithOptions(LanguageOptions.FromCSharp9).Invoking(x => x.Verify()).Should().NotThrow();\n        builder.WithOptions(LanguageOptions.BeforeCSharp9).Invoking(x => x.Verify()).Should().Throw<DiagnosticVerifierException>().WithMessage(\"\"\"\n            There are differences for CSharp5 File.cs:\n              Line 4: Unexpected error, use // Error [CS8026] Feature 'target-typed object creation' is not available in C# 5. Please use language version 9.0 or greater.\n\n            There is 1 more difference in File.Concurrent.cs\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Verify_WithWarningsAsErrors() =>\n        DummyCS.WithWarningsAsErrors(\"CS0219\")\n            .AddSnippet(\"\"\"\n                class Sample\n                {\n                    void M()\n                    {\n                        string unused = \"text\"; // Error [CS0219] The variable 'unused' is assigned but its value is never used.\n                    }\n                }\n                \"\"\")\n            .Invoking(x => x.Verify())\n            .Should().NotThrow();\n\n    [TestMethod]\n    public void Verify_WithWarningsAsErrors_MissingAnnotation_Fails() =>\n        DummyCS.WithWarningsAsErrors(\"CS0219\")\n            .AddSnippet(\"\"\"\n                class Sample\n                {\n                    void M()\n                    {\n                        string unused = \"text\";\n                    }\n                }\n                \"\"\")\n            .Invoking(x => x.Verify())\n            .Should().Throw<DiagnosticVerifierException>()\n            .WithMessage(\"*CS0219*\");\n\n    [TestMethod]\n    public void Verify_BasePath()\n    {\n        DummyCS.AddPaths(\"Nonexistent.cs\").Invoking(x => x.Verify()).Should().Throw<FileNotFoundException>(\"This file should not exist in TestCases directory.\");\n        DummyCS.AddPaths(\"Verifier.BasePathAssertFails.cs\").Invoking(x => x.Verify()).Should().Throw<DiagnosticVerifierException>(\"File should be found in TestCases directory.\");\n        DummyCS.WithBasePath(\"Verifier\").AddPaths(\"Verifier.BasePath.cs\").Invoking(x => x.Verify()).Should().NotThrow();\n    }\n\n    [TestMethod]\n    public void Verify_ErrorBehavior()\n    {\n        var builder = WithSnippetCS(\"\"\"\n            class Sample\n            {\n                int a = 42; // Noncompliant\n            }\n            undefined\n            \"\"\");\n        builder.Invoking(x => x.Verify()).Should().Throw<DiagnosticVerifierException>().WithMessage(\"\"\"\n            There are differences for CSharp7 File.cs:\n              Line 5: Unexpected error, use // Error [CS0246] The type or namespace name 'undefined' could not be found (are you missing a using directive or an assembly reference?)\n              Line 5: Unexpected error, use // Error [CS8107] Feature 'top-level statements' is not available in C# 7.0. Please use language version 9.0 or greater.\n              Line 5: Unexpected error, use // Error [CS8803] Top-level statements must precede namespace and type declarations.\n              Line 5: Unexpected error, use // Error [CS8805] Program using top-level statements must be an executable.\n              Line 5: Unexpected error, use // Error [CS1001] Identifier expected\n              Line 5: Unexpected error, use // Error [CS1002] ; expected\n\n            There is 1 more difference in File.Concurrent.cs\n\n            \"\"\");\n        builder.WithErrorBehavior(CompilationErrorBehavior.FailTest).Invoking(x => x.Verify()).Should().Throw<DiagnosticVerifierException>().WithMessage(\"\"\"\n            There are differences for CSharp7 File.cs:\n              Line 5: Unexpected error, use // Error [CS0246] The type or namespace name 'undefined' could not be found (are you missing a using directive or an assembly reference?)\n              Line 5: Unexpected error, use // Error [CS8107] Feature 'top-level statements' is not available in C# 7.0. Please use language version 9.0 or greater.\n              Line 5: Unexpected error, use // Error [CS8803] Top-level statements must precede namespace and type declarations.\n              Line 5: Unexpected error, use // Error [CS8805] Program using top-level statements must be an executable.\n              Line 5: Unexpected error, use // Error [CS1001] Identifier expected\n              Line 5: Unexpected error, use // Error [CS1002] ; expected\n\n            There is 1 more difference in File.Concurrent.cs\n\n            \"\"\");\n        builder.WithErrorBehavior(CompilationErrorBehavior.Ignore).Invoking(x => x.Verify()).Should().NotThrow();\n    }\n\n    [TestMethod]\n    public void Verify_OnlyDiagnostics()\n    {\n        var builder = new VerifierBuilder<ObsoleteAttributes>().AddPaths(WriteFile(\"File.cs\", \"[System.Obsolete]public class Sample { }\"));\n        builder.Invoking(x => x.Verify()).Should().Throw<DiagnosticVerifierException>().WithMessage(\"\"\"\n            There are differences for CSharp7 File.cs:\n              Line 1: Unexpected issue 'Add an explanation.' Rule S1123\n              Line 1: Unexpected issue 'Do not forget to remove this deprecated code someday.' Rule S1133\n\n            There are 2 more differences in File.Concurrent.cs\n\n            \"\"\");\n        builder.WithOnlyDiagnostics(AnalysisScaffolding.CreateDescriptor(\"S1123\")).Invoking(x => x.Verify()).Should().Throw<DiagnosticVerifierException>().WithMessage(\"\"\"\n            There are differences for CSharp7 File.cs:\n              Line 1: Unexpected issue 'Add an explanation.' Rule S1123\n\n            There is 1 more difference in File.Concurrent.cs\n\n            \"\"\");\n        builder.WithOnlyDiagnostics(AnalysisScaffolding.CreateDescriptor(\"S0000\")).Invoking(x => x.VerifyNoIssues()).Should().NotThrow();\n    }\n\n    [TestMethod]\n    public void Verify_NonConcurrentAnalysis()\n    {\n        var builder = WithSnippetCS(\"var topLevelStatement = 42;  // Noncompliant\").WithOptions(LanguageOptions.FromCSharp9).WithOutputKind(OutputKind.ConsoleApplication);\n        builder.Invoking(x => x.Verify()).Should().Throw<DiagnosticVerifierException>(\"Default Verifier behavior duplicates the source file.\").WithMessage(\"\"\"\n            There are differences for CSharp9 File.Concurrent.cs:\n              Line 1: Unexpected error, use // Error [CS0825] The contextual keyword 'var' may only appear within a local variable declaration or in script code\n              Line 1: Unexpected error, use // Error [CS0116] A namespace cannot directly contain members such as fields, methods or statements\n            \"\"\");\n        builder.WithConcurrentAnalysis(false).Invoking(x => x.Verify()).Should().NotThrow();\n    }\n\n    [TestMethod]\n    public void Verify_OutputKind()\n    {\n        var builder = WithSnippetCS(\"var topLevelStatement = 42;  // Noncompliant\").WithOptions(LanguageOptions.FromCSharp9);\n        builder.WithTopLevelStatements().Invoking(x => x.Verify()).Should().NotThrow();\n        builder.WithOutputKind(OutputKind.ConsoleApplication).WithConcurrentAnalysis(false).Invoking(x => x.Verify()).Should().NotThrow();\n        builder.Invoking(x => x.Verify()).Should().Throw<DiagnosticVerifierException>().WithMessage(\"\"\"\n            There are differences for CSharp9 File.cs:\n              Line 1: Unexpected error, use // Error [CS8805] Program using top-level statements must be an executable.\n\n            There are 2 more differences in File.Concurrent.cs\n\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void Verify_Snippets() =>\n        DummyCS.AddSnippet(\"public class First { }  // Noncompliant [first]  - not raised\")\n            .AddSnippet(\"public class Second { }    // Noncompliant [second] - not raised\")\n            .Invoking(x => x.Verify())\n            .Should().Throw<DiagnosticVerifierException>()\n            .WithMessage(\"\"\"\n                There are differences for CSharp7 snippet0.cs:\n                  Line 1: Missing expected issue ID first\n\n                There are differences for CSharp7 snippet1.cs:\n                  Line 1: Missing expected issue ID second\n                \"\"\");\n\n    [TestMethod]\n    public void VerifyCodeFix_NoCodeFix() =>\n        DummyCS.AddSnippet(\"// Nothing to see here\").Invoking(x => x.VerifyCodeFix()).Should().Throw<InvalidOperationException>().WithMessage(\"CodeFix was not set.\");\n\n    [TestMethod]\n    public void VerifyCodeFix_FixExpected_CS()\n    {\n        var originalPath = WriteFile(\"File.cs\", \"\"\"\n            public class Sample\n            {\n                private int a = 0;     // Noncompliant\n                private int b = 0;     // Noncompliant\n                private bool c = true;\n            }\n            \"\"\");\n        var fixedPath = WriteFile(\"File.Fixed.cs\", \"\"\"\n            public class Sample\n            {\n                private int a = default;     // Fixed\n                private int b = default;     // Fixed\n                private bool c = true;\n            }\n            \"\"\");\n        DummyCS.AddPaths(originalPath).WithCodeFix<DummyCodeFixCS>().WithCodeFixedPaths(fixedPath).Invoking(x => x.VerifyCodeFix()).Should().NotThrow();\n    }\n\n    [TestMethod]\n    public void VerifyCodeFix_FixExpected_VB()\n    {\n        var originalPath = WriteFile(\"File.vb\", \"\"\"\n            Public Class Sample\n                Private A As Integer = 42   ' Noncompliant\n                Private B As Integer = 42   ' Noncompliant\n                Private C As Boolean = True\n            End Class\n            \"\"\");\n        var fixedPath = WriteFile(\"File.Fixed.vb\", \"\"\"\n            Public Class Sample\n                Private A As Integer = Nothing   ' Fixed\n                Private B As Integer = Nothing   ' Fixed\n                Private C As Boolean = True\n            End Class\n            \"\"\");\n        DummyVB.AddPaths(originalPath).WithCodeFix<DummyCodeFixVB>().WithCodeFixedPaths(fixedPath).Invoking(x => x.VerifyCodeFix()).Should().NotThrow();\n    }\n\n    [TestMethod]\n    public void VerifyCodeFix_NotFixed_CS()\n    {\n        var originalPath = WriteFile(\"File.cs\", \"\"\"\n            public class Sample\n            {\n                private int a = 0;     // Noncompliant\n                private int b = 0;     // Noncompliant\n                private bool c = true;\n            }\n            \"\"\");\n        DummyCS.AddPaths(originalPath).WithCodeFix<DummyCodeFixCS>().WithCodeFixedPaths(originalPath).Invoking(x => x.VerifyCodeFix()).Should().Throw<AssertionFailedException>().WithMessage(\"\"\"\n            Expected actual to be the same string because VerifyWhileDocumentChanges updates the document until all issues are fixed, even if the fix itself creates a new issue again. Language: CSharp7, but they differ on line 3 and column 21 (index 42):\n                        ↓ (actual)\n              \"…int a = default;     //…\"\n              \"…int a = 0;     //…\"\n                        ↑ (expected).\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void VerifyCodeFix_NotFixed_VB()\n    {\n        var originalPath = WriteFile(\"File.vb\", \"\"\"\n            Public Class Sample\n                Private A As Integer = 42   ' Noncompliant\n                Private B As Integer = 42   ' Noncompliant\n                Private C As Boolean = True\n            End Class\n            \"\"\");\n        DummyVB.AddPaths(originalPath).WithCodeFix<DummyCodeFixVB>().WithCodeFixedPaths(originalPath).Invoking(x => x.VerifyCodeFix()).Should().Throw<AssertionFailedException>().WithMessage(\"\"\"\n            Expected actual to be the same string because VerifyWhileDocumentChanges updates the document until all issues are fixed, even if the fix itself creates a new issue again. Language: VisualBasic12, but they differ on line 2 and column 28 (index 47):\n                               ↓ (actual)\n              \"…A As Integer = Nothing  …\"\n              \"…A As Integer = 42   '…\"\n                               ↑ (expected).\n            \"\"\");\n    }\n\n    [TestMethod]\n    public void VerifyCodeFix_NoIssueRaised()\n    {\n        var path = WriteFile(\"File.cs\", \"// Nothing to see here\");\n        DummyCS.AddPaths(path).WithCodeFix<DummyCodeFixCS>().WithCodeFixedPaths(path).Invoking(x => x.VerifyCodeFix()).Should().Throw<AssertionFailedException>()\n            .WithMessage(\"Expected state.Diagnostics not to be empty.\");\n    }\n\n    [TestMethod]\n    public void VerifyNoIssues_NoIssues_Succeeds() =>\n        WithSnippetCS(\"// Noncompliant - this comment is ignored\").Invoking(x => x.VerifyNoIssues()).Should().NotThrow();\n\n    [TestMethod]\n    public void VerifyNoIssues_WithIssues_Throws() =>\n        WithSnippetCS(\"\"\"\n            public class Sample\n            {\n                private int a = 42;     // Noncompliant\n            }\n            \"\"\").Invoking(x => x.VerifyNoIssues()).Should().Throw<AssertionFailedException>();\n\n    [TestMethod]\n    public void VerifyNoIssues_InvalidCode_Throws() =>\n        WithSnippetCS(\"Nonsense\").Invoking(x => x.VerifyNoIssues()).Should().Throw<AssertionFailedException>();\n\n    [TestMethod]\n    public void VerifyNoAD0001_AnalyzerException_Fail() =>\n        new VerifierBuilder<DummyAnalyzerThatThrowsCS>()\n            .AddSnippet(\"\"\"\n                public class Class7\n                {\n                    public int X = 7;\n                }\n                \"\"\")\n            .Invoking(x => x.VerifyNoAD0001())\n            .Should().Throw<AssertionFailedException>();\n\n    [TestMethod]\n    public void VerifyNoAD0001_NoAD0001_DoesNotFail() =>\n        new VerifierBuilder<DummyAnalyzerCS>()\n            .AddSnippet(\"\"\"\n                public class Class7\n                {\n                    public int X = 7;\n                }\n                \"\"\")\n            .VerifyNoAD0001();\n\n    [TestMethod]\n    public void VerifyNoIssuesIgnoreErrors_NoIssues_Succeeds() =>\n        WithSnippetCS(\"// Noncompliant - this comment is ignored\").Invoking(x => x.VerifyNoIssuesIgnoreErrors()).Should().NotThrow();\n\n    [TestMethod]\n    public void VerifyNoIssuesIgnoreErrors_WithIssues_Throws() =>\n        WithSnippetCS(\"\"\"\n            public class Sample\n            {\n                private int a = 42;     // Noncompliant\n            }\n            \"\"\").Invoking(x => x.VerifyNoIssuesIgnoreErrors()).Should().Throw<AssertionFailedException>();\n\n    [TestMethod]\n    public void VerifyNoIssuesIgnoreErrors_InvalidCode_Throws() =>\n        WithSnippetCS(\"Nonsense\").Invoking(x => x.VerifyNoIssuesIgnoreErrors()).Should().NotThrow();\n\n    [TestMethod]\n    public void Verify_ConcurrentAnalysis_FileEndingWithComment_CS() =>\n        WithSnippetCS(\"// Nothing to see here, file ends with a comment\").Invoking(x => x.VerifyNoIssues()).Should().NotThrow();\n\n    [TestMethod]\n    public void Verify_ConcurrentAnalysis_FileEndingWithComment_VB() =>\n        WithSnippetVB(\"' Nothing to see here, file ends with a comment\").Invoking(x => x.VerifyNoIssues()).Should().NotThrow();\n\n    [TestMethod]\n    public void VerifyUtilityAnalyzerProducesEmptyProtobuf_EmptyFile()\n    {\n        var protobufPath = TestFiles.TestPath(TestContext, \"Empty.pb\");\n        new VerifierBuilder().AddAnalyzer(() => new DummyUtilityAnalyzerCS(protobufPath, null)).AddSnippet(\"// Nothing to see here\").WithProtobufPath(protobufPath)\n            .Invoking(x => x.VerifyUtilityAnalyzerProducesEmptyProtobuf())\n            .Should().NotThrow();\n    }\n\n    [TestMethod]\n    public void VerifyUtilityAnalyzerProducesEmptyProtobuf_WithContent()\n    {\n        var protobufPath = TestFiles.TestPath(TestContext, \"Empty.pb\");\n        var message = new LogInfo { Text = \"Lorem Ipsum\" };\n        new VerifierBuilder().AddAnalyzer(() => new DummyUtilityAnalyzerCS(protobufPath, message)).AddSnippet(\"// Nothing to see here\").WithProtobufPath(protobufPath)\n            .Invoking(x => x.VerifyUtilityAnalyzerProducesEmptyProtobuf())\n            .Should().Throw<AssertionFailedException>()\n            .WithMessage(\"Expected value to be 0L because protobuf file should be empty, but found *\");\n    }\n\n    [TestMethod]\n    public void VerifyUtilityAnalyzer_CorrectProtobuf_CS()\n    {\n        var protobufPath = TestFiles.TestPath(TestContext, \"Log.pb\");\n        var message = new LogInfo { Text = \"Lorem Ipsum\" };\n        var wasInvoked = false;\n        new VerifierBuilder().AddAnalyzer(() => new DummyUtilityAnalyzerCS(protobufPath, message)).AddSnippet(\"// Nothing to see here\").WithProtobufPath(protobufPath)\n            .VerifyUtilityAnalyzer<LogInfo>(x =>\n            {\n                x.Should().ContainSingle().Which.Text.Should().Be(\"Lorem Ipsum\");\n                wasInvoked = true;\n            });\n        wasInvoked.Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void VerifyUtilityAnalyzer_CorrectProtobuf_VB()\n    {\n        var protobufPath = TestFiles.TestPath(TestContext, \"Log.pb\");\n        var message = new LogInfo { Text = \"Lorem Ipsum\" };\n        var wasInvoked = false;\n        new VerifierBuilder().AddAnalyzer(() => new DummyUtilityAnalyzerVB(protobufPath, message)).AddSnippet(\"' Nothing to see here\").WithProtobufPath(protobufPath)\n            .VerifyUtilityAnalyzer<LogInfo>(x =>\n            {\n                x.Should().ContainSingle().Which.Text.Should().Be(\"Lorem Ipsum\");\n                wasInvoked = true;\n            });\n        wasInvoked.Should().BeTrue();\n    }\n\n    [TestMethod]\n    public void VerifyUtilityAnalyzer_VerifyProtobuf_PropagateFailedAssertion_CS()\n    {\n        var protobufPath = TestFiles.TestPath(TestContext, \"Empty.pb\");\n        new VerifierBuilder().AddAnalyzer(() => new DummyUtilityAnalyzerCS(protobufPath, null)).AddSnippet(\"// Nothing to see here\").WithProtobufPath(protobufPath)\n            .Invoking(x => x.VerifyUtilityAnalyzer<LogInfo>(x => throw new AssertionFailedException(\"Some failed assertion about Protobuf\")))\n            .Should().Throw<AssertionFailedException>()\n            .WithMessage(\"Some failed assertion about Protobuf\");\n    }\n\n    [TestMethod]\n    public void VerifyUtilityAnalyzer_VerifyProtobuf_PropagateFailedAssertion_VB()\n    {\n        var protobufPath = TestFiles.TestPath(TestContext, \"Empty.pb\");\n        new VerifierBuilder().AddAnalyzer(() => new DummyUtilityAnalyzerVB(protobufPath, null)).AddSnippet(\"' Nothing to see here\").WithProtobufPath(protobufPath)\n            .Invoking(x => x.VerifyUtilityAnalyzer<LogInfo>(x => throw new AssertionFailedException(\"Some failed assertion about Protobuf\")))\n            .Should().Throw<AssertionFailedException>()\n            .WithMessage(\"Some failed assertion about Protobuf\");\n    }\n\n    private VerifierBuilder WithSnippetCS(string code) =>\n        DummyCS.AddPaths(WriteFile(\"File.cs\", code));\n\n    private VerifierBuilder WithSnippetVB(string code) =>\n        DummyVB.AddPaths(WriteFile(\"File.vb\", code));\n\n    private string WriteFile(string name, string content) =>\n        TestFiles.WriteFile(TestContext, $@\"TestCases\\{name}\", content);\n\n    private static void ContainsSyntaxTreeWithName(CompilationData compilation, string suffix) =>\n        compilation.Compilation.SyntaxTrees.Select(x => x.FilePath).Should().Contain(x => x.EndsWith(suffix));\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.TestFramework.Test/packages.lock.json",
    "content": "{\n  \"version\": 1,\n  \"dependencies\": {\n    \"net10.0\": {\n      \"altcover\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[9.0.102, )\",\n        \"resolved\": \"9.0.102\",\n        \"contentHash\": \"q3Rf5t0M9kXlcO5qhsaAe6NrFSNd5enrhKmF/Ezgmomqw34PbUTbRSYjSDNhS3YGDyUrPTkyPn14EfLDJWztcA==\"\n      },\n      \"Combinatorial.MSTest\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[2.0.0, )\",\n        \"resolved\": \"2.0.0\",\n        \"contentHash\": \"9tB2TMPkuEkYYUq64WREHMMyPt9NfKAyuitpK9yw3zbVe6v/vYkClZTR02+yKFUG+g8XHi5LMTt8jHz4RufGqw==\",\n        \"dependencies\": {\n          \"MSTest.TestFramework\": \"4.0.1\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[3.3.1, )\",\n        \"resolved\": \"3.3.1\",\n        \"contentHash\": \"eT+kgNCDdTRbQ5WF6BGx1HI3D5jYfHteza/koefhWC2vNZGxObA74XxwWfg40dy3uUv7dn3OGKLK5GUPLroVog==\"\n      },\n      \"Microsoft.NET.Test.Sdk\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[18.4.0, )\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"w49iZdL4HL6V25l41NVQLXWQ+e71GvSkKVteMrOL02gP/PUkcnO/1yEb2s9FntU4wGmJWfKnyrRAhcMHd9ZZNA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeCoverage\": \"18.4.0\",\n          \"Microsoft.TestPlatform.TestHost\": \"18.4.0\"\n        }\n      },\n      \"MSTest.TestAdapter\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[4.2.1, )\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"lZRgNzaQnffK4XLjM/og4Eoqp/3IkpcyJQQcyKXkPdkzCT3+ghpwHa9zG1xYhQDbUFoc54M+/waLwh31K9stDQ==\",\n        \"dependencies\": {\n          \"MSTest.TestFramework\": \"4.2.1\",\n          \"Microsoft.Testing.Extensions.VSTestBridge\": \"2.2.1\",\n          \"Microsoft.Testing.Platform.MSBuild\": \"2.2.1\"\n        }\n      },\n      \"MSTest.TestFramework\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[4.2.1, )\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"I4/RbS2TpGZ56CE98+jPbrGlcerYtw2LvPVKzQGvyQQcJDekPy2Kd+fnThXYn+geJ1sW+vA9B7++rFNxvKcWxA==\",\n        \"dependencies\": {\n          \"MSTest.Analyzers\": \"4.2.1\"\n        }\n      },\n      \"SonarAnalyzer.CSharp.Styling\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[10.21.0.135717, )\",\n        \"resolved\": \"10.21.0.135717\",\n        \"contentHash\": \"hl264jF539oB7m2jED5QGM345eFSiDAdoJc8TH0HM6L7ZeqT5TDqZDQeZ8IDP02dVIpH/Fhhn+HsGfEcj8ohyQ==\"\n      },\n      \"StyleCop.Analyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.2.0-beta.556, )\",\n        \"resolved\": \"1.2.0-beta.556\",\n        \"contentHash\": \"llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==\",\n        \"dependencies\": {\n          \"StyleCop.Analyzers.Unstable\": \"1.2.0.556\"\n        }\n      },\n      \"Castle.Core\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.1.1\",\n        \"contentHash\": \"rpYtIczkzGpf+EkZgDr9CClTdemhsrwA/W5hMoPjLkRFnXzH44zDLoovXeKtmxb1ykXK9aJVODSpiJml8CTw2g==\",\n        \"dependencies\": {\n          \"System.Diagnostics.EventLog\": \"6.0.0\"\n        }\n      },\n      \"FluentAssertions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.2.1\",\n        \"contentHash\": \"MilqBF2lZrT0V1azIA6DG6I/snS0rG3A8ohT2Jjkhq6zOFk76nqx4BPnEnzrX6jFVa6xvkDU++z3PebCGZyJ4g==\",\n        \"dependencies\": {\n          \"System.Configuration.ConfigurationManager\": \"6.0.0\"\n        }\n      },\n      \"FluentAssertions.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"0.34.1\",\n        \"contentHash\": \"2BnAAB8CCPdRA9P1+lAvBZOleR2BTmsxGMtGt+LnABJUARGqoGMWEFxG3znZYqHVIrMP0Za/kyw6atyt8x2mzA==\"\n      },\n      \"Google.Protobuf\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"3.6.1\",\n        \"contentHash\": \"741fGeDQjixBJaU2j+0CbrmZXsNJkTn/hWbOh4fLVXndHsCclJmWznCPWrJmPoZKvajBvAz3e8ECJOUvRtwjNQ==\",\n        \"dependencies\": {\n          \"NETStandard.Library\": \"1.6.1\"\n        }\n      },\n      \"Humanizer.Core\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.14.1\",\n        \"contentHash\": \"lQKvtaTDOXnoVJ20ibTuSIOf2i0uO0MPbDhd1jm238I+U/2ZnRENj0cktKZhtchBMtCUSRQ5v4xBCUbKNmyVMw==\"\n      },\n      \"Microsoft.ApplicationInsights\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.23.0\",\n        \"contentHash\": \"nWArUZTdU7iqZLycLKWe0TDms48KKGE6pONH2terYNa8REXiqixrMOkf1sk5DHGMaUTqONU2YkS4SAXBhLStgw==\",\n        \"dependencies\": {\n          \"System.Diagnostics.DiagnosticSource\": \"5.0.0\"\n        }\n      },\n      \"Microsoft.Build.Framework\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"17.11.48\",\n        \"contentHash\": \"C3WIMt2wBl4++NX3jSEpTq5KXBhvAV154R4JrYHkfy9JSBcXWiL0mkgpspk5xSdOj+fS/uz7zluIy6bMM1fkkQ==\"\n      },\n      \"Microsoft.Build.Locator\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.11.2\",\n        \"contentHash\": \"tY+/S54G29CGsbL3slVu4vqtpciwVnb3fKOmrhgzEQmu/VziFaWmD/E1e/2KH7cDucuycGSkWsSXndBs5Uawow==\"\n      },\n      \"Microsoft.CodeAnalysis.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0-2.25625.1\",\n        \"contentHash\": \"4Yhh2fnu3G+J0J1lDc8WZVgMjgbynSeTfkl5IFJMFrmiIO0sc7Tjx+f3sFVV8Sd35PrIUWfof0RWc3lAMl7Azg==\"\n      },\n      \"Microsoft.CodeAnalysis.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"uC0qk3jzTQY7i90ehfnCqaOZpBUGJyPMiHJ3c0jOb8yaPBjWzIhVdNxPbeVzI74DB0C+YgBKPLqUkgFZzua5Mg==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"SQFNGQF4f7UfDXKxMzzGNMr3fjrPDIjLfmRvvVgDCw+dyvEHDaRfHuKA5q0Pr0/JW0Gcw89TxrxrS/MjwBvluQ==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp.Workspaces\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"mRwxchBs3ewXK4dqK4R/eVCx99VIq1k/lhwArlu+fJuV0uzmbkTTRw4jR9gN9sOcAQfX0uV9KQlmCk1yC0JNog==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.CSharp\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.VisualBasic\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"AJxddsIOmfimuihaLuSAm4c/zskHoL1ypAjIpSOZqHlNm2iuw0twsB8nbKczJyfClqD7+iYjdIeE5EV8WAyxRA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"pAGdr4qs7+v287DPiiM8px1cBXnhe8LxymkVGTnCwv2OEjCk5HO2zIoFvype4ivKJTRW3aTUUV8ab+915wbv+w==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.VisualBasic\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Workspaces.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"QSf1ge9A+XFZbGL+gIqXYBIKlm8QdQVLvHDPZiydG11W6mJY7XBMusrsgIEz6L8GYMzGJKTM78m9icliGMF7NA==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Workspaces.MSBuild\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"2Mg/ppo5dza1e4DJWX4+RIHMc3FgnYzuHTaLRZDupiK1LTi/PAZ1PBpF/iivHVNKQKwipHE984gy37MbM0RO9Q==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.Build.Framework\": \"17.11.48\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"Microsoft.Extensions.DependencyInjection\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Options\": \"9.0.0\",\n          \"Microsoft.Extensions.Primitives\": \"9.0.0\",\n          \"Microsoft.VisualStudio.SolutionPersistence\": \"1.0.52\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeCoverage\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"9O0BtCfzCWrkAmK187ugKdq72HHOXoOUjuWFDVc2LsZZ0pOnA9bTt+Sg9q4cF+MoAaUU+MuWtvBuFsnduviJow==\"\n      },\n      \"Microsoft.Composition\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.27\",\n        \"contentHash\": \"pwu80Ohe7SBzZ6i69LVdzowp6V+LaVRzd5F7A6QlD42vQkX0oT7KXKWWPlM/S00w1gnMQMRnEdbtOV12z6rXdQ==\"\n      },\n      \"Microsoft.Extensions.DependencyInjection\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"MCPrg7v3QgNMr0vX4vzRXvkNGgLg8vKWX0nKCWUxu2uPyMsaRgiRc1tHBnbTcfJMhMKj2slE/j2M9oGkd25DNw==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.DependencyInjection.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"+6f2qv2a3dLwd5w6JanPIPs47CxRbnk+ZocMJUhv9NxP88VlOcJYZs9jY+MYSjxvady08bUZn6qgiNh7DadGgg==\"\n      },\n      \"Microsoft.Extensions.Logging\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"crjWyORoug0kK7RSNJBTeSE6VX8IQgLf3nUpTB9m62bPXp/tzbnOsnbe8TXEG0AASNaKZddnpHKw7fET8E++Pg==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Options\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.Logging.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"g0UfujELzlLbHoVG8kPKVBaW470Ewi+jnptGS9KUi6jcb+k2StujtK3m26DFSGGwQ/+bVgZfsWqNzlP6YOejvw==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.Options\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"y2146b3jrPI3Q0lokKXdKLpmXqakYbDIPDV6r3M8SqvSf45WwOTzkyfDpxnZXJsJQEpAsAqjUq5Pu8RCJMjubg==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Primitives\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"N3qEBzmLMYiASUlKxxFIISP4AiwuPTHF5uCh+2CWSwwzAJiIYx0kBJsS30cp1nvhSySFAVi30jecD307jV+8Kg==\"\n      },\n      \"Microsoft.Testing.Extensions.Telemetry\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"7zB8BjffOyvqfHF26rFVPuK0w1fCf5+j1tLuhHIr76CqxXkGb+fMJtq6YNOV+m6qPytExHMXxluk3RgJ+dSIqw==\",\n        \"dependencies\": {\n          \"Microsoft.ApplicationInsights\": \"2.23.0\",\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.Testing.Extensions.TrxReport.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"RD6D1Jx6cKDA5IHd1H2q8ylIuQG3PD+gdULI0JC8CvsRtaypFzTFpB5xDPuQi8o6kAkcM04cBhAiJPxZboNH2Q==\",\n        \"dependencies\": {\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.Testing.Extensions.VSTestBridge\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"D8AGlkNtlTQPe3zf4SLnHBMr13lerMe0RuHSoRfnRatcuX/T7YbRtgn39rWBjKhXsNio0WXKrPKv3gfWE2I46w==\",\n        \"dependencies\": {\n          \"Microsoft.TestPlatform.ObjectModel\": \"18.3.0\",\n          \"Microsoft.Testing.Extensions.Telemetry\": \"2.2.1\",\n          \"Microsoft.Testing.Extensions.TrxReport.Abstractions\": \"2.2.1\",\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.Testing.Platform\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"9bbPuls/b6/vUFzxbSjJLZlJHyKBfOZE5kjIY+ITI2ASqlFPJhR83BdLydJeQOCLEZhEbrEcz5xtt1B69nwSVg==\"\n      },\n      \"Microsoft.Testing.Platform.MSBuild\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"CSJOcZHfKlTyPbS0CTJk6iEnU4gJC+eUA5z72UBnMDRdgVHYOmB8k9Y7jT233gZjnCOQiYFg3acQHRfu2H62nw==\",\n        \"dependencies\": {\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.TestPlatform.ObjectModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"4L6m2kS2pY5uJ9cpeRxzW22opr6ttScIRqsOpMDQpgENp/ZwxkkQCcmc6LRSURo2dFaaSW5KVflQZvroiJ7Wzg==\",\n        \"dependencies\": {\n          \"System.Reflection.Metadata\": \"8.0.0\"\n        }\n      },\n      \"Microsoft.TestPlatform.TestHost\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"gZsCHI+zOmZCcKZieIL4Jg14qKD2OGZOmX5DehuIk1EA9BN6Crm0+taXQNEuajOH1G9CCyBxw8VWR4t5tumcng==\",\n        \"dependencies\": {\n          \"Microsoft.TestPlatform.ObjectModel\": \"18.4.0\",\n          \"Newtonsoft.Json\": \"13.0.3\"\n        }\n      },\n      \"Microsoft.VisualStudio.SolutionPersistence\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.52\",\n        \"contentHash\": \"oNv2JtYXhpdJrX63nibx1JT3uCESOBQ1LAk7Dtz/sr0+laW0KRM6eKp4CZ3MHDR2siIkKsY8MmUkeP5DKkQQ5w==\"\n      },\n      \"Microsoft.Win32.SystemEvents\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"hqTM5628jSsQiv+HGpiq3WKBl2c8v1KZfby2J6Pr7pEPlK9waPdgEO6b8A/+/xn/yZ9ulv8HuqK71ONy2tg67A==\"\n      },\n      \"MSTest.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"1i9jgE/42KGGyZ4s0MdrYM/Uu/dRYhbRfYQifcO0AZ6vw4sBXRjoQGQRGNSm771AYgPAmoGl0u4sJc2lMET6HQ==\"\n      },\n      \"Newtonsoft.Json\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"13.0.3\",\n        \"contentHash\": \"HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==\"\n      },\n      \"NSubstitute\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"lJ47Cps5Qzr86N99lcwd+OUvQma7+fBgr8+Mn+aOC0WrlqMNkdivaYD9IvnZ5Mqo6Ky3LS7ZI+tUq1/s9ERd0Q==\",\n        \"dependencies\": {\n          \"Castle.Core\": \"5.1.1\"\n        }\n      },\n      \"NuGet.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"1mp7zmyAGmQfT93ELC4c+MYOrJ8Ff4ekFZRek4JSVLb/wOO/o0bsPfLmqujCsJ2Hlwc+fpq1TQEnjSEgWdt8ng==\",\n        \"dependencies\": {\n          \"NuGet.Frameworks\": \"7.3.1\"\n        }\n      },\n      \"NuGet.Configuration\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"tGxWBo47EQONOaqY+MbEWMrNjFthHgfavLM1HE0RcLyOXVCoQKBlZGV7v0hrS/rJrQKw6ZaBeHetX+ZJgS7Lxg==\",\n        \"dependencies\": {\n          \"NuGet.Common\": \"7.3.1\",\n          \"System.Security.Cryptography.ProtectedData\": \"8.0.0\"\n        }\n      },\n      \"NuGet.Frameworks\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"VUPAE5l/Ir4Gb3dv+v0jq0Qe4nfwxfrfiYN7QhwlGyWPXFKYXSSke1t1bV/ZYd6idtTtRDqJPM49Lt/U8NTocg==\"\n      },\n      \"NuGet.Packaging\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"5bT8uOrNBx4Srhbrd3HonYmyKhWJkvQyTWTYE2jvfPgYx2aCbPmq8MCYko7ce78hEN9mpq2xlrztVhguYPc+GQ==\",\n        \"dependencies\": {\n          \"Newtonsoft.Json\": \"13.0.3\",\n          \"NuGet.Configuration\": \"7.3.1\",\n          \"NuGet.Versioning\": \"7.3.1\",\n          \"System.Security.Cryptography.Pkcs\": \"8.0.1\"\n        }\n      },\n      \"NuGet.Protocol\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"vYd5vtCJ/tpMQjbAs6rrftNgeh5Ip1w7tnEsDZCpGObKgUgOxHQBekCul3TnzmbNgobvJEkDJNaec5/ZBv66Hg==\",\n        \"dependencies\": {\n          \"NuGet.Packaging\": \"7.3.1\"\n        }\n      },\n      \"NuGet.Versioning\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"TJrQWSmD1vakfav7qIhDXgDFfaZFfMJ+v6P8tcND9ZqXajD5B/ZzaoGYNzL4D3eDue6vAOUvwzu42G+19JNVUA==\"\n      },\n      \"StyleCop.Analyzers.Unstable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.2.0.556\",\n        \"contentHash\": \"zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==\"\n      },\n      \"System.Collections.Immutable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"AurL6Y5BA1WotzlEvVaIDpqzpIPvYnnldxru8oXJU2yFxFUy3+pNXjXd1ymO+RA0rq0+590Q8gaz2l3Sr7fmqg==\"\n      },\n      \"System.Composition\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"3Djj70fFTraOarSKmRnmRy/zm4YurICm+kiCtI0dYRqGJnLX6nJ+G3WYuFJ173cAPax/gh96REcbNiVqcrypFQ==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\",\n          \"System.Composition.Convention\": \"9.0.0\",\n          \"System.Composition.Hosting\": \"9.0.0\",\n          \"System.Composition.Runtime\": \"9.0.0\",\n          \"System.Composition.TypedParts\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.AttributedModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"iri00l/zIX9g4lHMY+Nz0qV1n40+jFYAmgsaiNn16xvt2RDwlqByNG4wgblagnDYxm3YSQQ0jLlC/7Xlk9CzyA==\"\n      },\n      \"System.Composition.Convention\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"+vuqVP6xpi582XIjJi6OCsIxuoTZfR0M7WWufk3uGDeCl3wGW6KnpylUJ3iiXdPByPE0vR5TjJgR6hDLez4FQg==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.Hosting\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"OFqSeFeJYr7kHxDfaViGM1ymk7d4JxK//VSoNF9Ux0gpqkLsauDZpu89kTHHNdCWfSljbFcvAafGyBoY094btQ==\",\n        \"dependencies\": {\n          \"System.Composition.Runtime\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.Runtime\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"w1HOlQY1zsOWYussjFGZCEYF2UZXgvoYnS94NIu2CBnAGMbXFAX8PY8c92KwUItPmowal68jnVLBCzdrWLeEKA==\"\n      },\n      \"System.Composition.TypedParts\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"aRZlojCCGEHDKqh43jaDgaVpYETsgd7Nx4g1zwLKMtv4iTo0627715ajEFNpEEBTgLmvZuv8K0EVxc3sM4NWJA==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\",\n          \"System.Composition.Hosting\": \"9.0.0\",\n          \"System.Composition.Runtime\": \"9.0.0\"\n        }\n      },\n      \"System.Configuration.ConfigurationManager\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"7T+m0kDSlIPTHIkPMIu6m6tV6qsMqJpvQWW2jIc2qi7sn40qxFo0q+7mEQAhMPXZHMKnWrnv47ntGlM/ejvw3g==\",\n        \"dependencies\": {\n          \"System.Security.Cryptography.ProtectedData\": \"6.0.0\",\n          \"System.Security.Permissions\": \"6.0.0\"\n        }\n      },\n      \"System.Diagnostics.DiagnosticSource\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.0.0\",\n        \"contentHash\": \"tCQTzPsGZh/A9LhhA6zrqCRV4hOHsK90/G7q3Khxmn6tnB1PuNU0cRaKANP2AWcF9bn0zsuOoZOSrHuJk6oNBA==\"\n      },\n      \"System.Diagnostics.EventLog\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"lcyUiXTsETK2ALsZrX+nWuHSIQeazhqPphLfaRxzdGaG93+0kELqpgEHtwWOlQe7+jSFnKwaCAgL4kjeZCQJnw==\"\n      },\n      \"System.Drawing.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"NfuoKUiP2nUWwKZN6twGqXioIe1zVD0RIj2t976A+czLHr2nY454RwwXs6JU9Htc6mwqL6Dn/nEL3dpVf2jOhg==\",\n        \"dependencies\": {\n          \"Microsoft.Win32.SystemEvents\": \"6.0.0\"\n        }\n      },\n      \"System.Reflection.Metadata\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"ptvgrFh7PvWI8bcVqG5rsA/weWM09EnthFHR5SCnS6IN+P4mj6rE1lBDC4U8HL9/57htKAqy4KQ3bBj84cfYyQ==\",\n        \"dependencies\": {\n          \"System.Collections.Immutable\": \"8.0.0\"\n        }\n      },\n      \"System.Security.AccessControl\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"AUADIc0LIEQe7MzC+I0cl0rAT8RrTAKFHl53yHjEUzNVIaUlhFY11vc2ebiVJzVBuOzun6F7FBA+8KAbGTTedQ==\"\n      },\n      \"System.Security.Cryptography.Pkcs\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.1\",\n        \"contentHash\": \"CoCRHFym33aUSf/NtWSVSZa99dkd0Hm7OCZUxORBjRB16LNhIEOf8THPqzIYlvKM0nNDAPTRBa1FxEECrgaxxA==\"\n      },\n      \"System.Security.Cryptography.ProtectedData\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"+TUFINV2q2ifyXauQXRwy4CiBhqvDEDZeVJU7qfxya4aRYOKzVBpN+4acx25VcPB9ywUN6C0n8drWl110PhZEg==\"\n      },\n      \"System.Security.Permissions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"T/uuc7AklkDoxmcJ7LGkyX1CcSviZuLCa4jg3PekfJ7SU0niF0IVTXwUiNVP9DSpzou2PpxJ+eNY2IfDM90ZCg==\",\n        \"dependencies\": {\n          \"System.Security.AccessControl\": \"6.0.0\",\n          \"System.Windows.Extensions\": \"6.0.0\"\n        }\n      },\n      \"System.Windows.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"IXoJOXIqc39AIe+CIR7koBtRGMiCt/LPM3lI+PELtDIy9XdyeSrwXFdWV9dzJ2Awl0paLWUaknLxFQ5HpHZUog==\",\n        \"dependencies\": {\n          \"System.Drawing.Common\": \"6.0.0\"\n        }\n      },\n      \"sonaranalyzer.cfg\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer.Lightup\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.core\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Google.Protobuf\": \"[3.6.1, )\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.CFG\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.csharp\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"SonarAnalyzer.CSharp.Core\": \"[10.26.0, )\",\n          \"SonarAnalyzer.Core\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.csharp.core\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.CFG\": \"[10.26.0, )\",\n          \"SonarAnalyzer.Core\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer.lightup\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.testframework\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Combinatorial.MSTest\": \"[2.0.0, )\",\n          \"FluentAssertions\": \"[7.2.1, )\",\n          \"FluentAssertions.Analyzers\": \"[0.34.1, )\",\n          \"MSTest.TestAdapter\": \"[4.2.1, )\",\n          \"MSTest.TestFramework\": \"[4.2.1, )\",\n          \"Microsoft.Build.Locator\": \"[1.11.2, )\",\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[5.3.0, )\",\n          \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": \"[5.3.0, )\",\n          \"Microsoft.CodeAnalysis.Workspaces.MSBuild\": \"[5.3.0, )\",\n          \"Microsoft.NET.Test.Sdk\": \"[18.4.0, )\",\n          \"NSubstitute\": \"[5.3.0, )\",\n          \"NuGet.Protocol\": \"[7.3.1, )\",\n          \"SonarAnalyzer.Core\": \"[10.26.0, )\",\n          \"altcover\": \"[9.0.102, )\"\n        }\n      },\n      \"sonaranalyzer.visualbasic\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": \"[1.3.2, )\",\n          \"SonarAnalyzer.Core\": \"[10.26.0, )\",\n          \"SonarAnalyzer.VisualBasic.Core\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.visualbasic.core\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": \"[1.3.2, )\",\n          \"SonarAnalyzer.CFG\": \"[10.26.0, )\",\n          \"SonarAnalyzer.Core\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.VisualBasic.Core.Test/Extensions/ISymbolExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing ISymbolExtensionsVB = SonarAnalyzer.VisualBasic.Core.Extensions.ISymbolExtensions;\n\nnamespace SonarAnalyzer.Test.Extensions;\n\n[TestClass]\npublic class ISymbolExtensionsTest\n{\n    [TestMethod]\n    public void GetDescendantNodes_ForNullSourceTree_ReturnsEmpty() =>\n        ISymbolExtensionsVB.GetDescendantNodes(Location.None, SyntaxFactory.ModifiedIdentifier(\"a\")).Should().BeEmpty();\n\n    [TestMethod]\n    public void GetDescendantNodes_ForDifferentSyntaxTrees_ReturnsEmpty()\n    {\n        var first = SyntaxFactory.ParseSyntaxTree(\"Dim a As String\");\n        var identifier = first.Single<ModifiedIdentifierSyntax>();\n\n        var second = SyntaxFactory.ParseSyntaxTree(\"Dim a As String\");\n        ISymbolExtensionsVB.GetDescendantNodes(identifier.GetLocation(), second.GetRoot()).Should().BeEmpty();\n    }\n\n    [TestMethod]\n    public void GetDescendantNodes_ForMissingVariableDeclarator_ReturnsEmpty()\n    {\n        var tree = SyntaxFactory.ParseSyntaxTree(@\"new FileSystemAccessRule(\"\"User\"\", FileSystemRights.ListDirectory, AccessControlType.Allow)\");\n        ISymbolExtensionsVB.GetDescendantNodes(tree.GetRoot().GetLocation(), tree.GetRoot()).Should().BeEmpty();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.VisualBasic.Core.Test/Facade/Implementation/VisualBasicSyntaxFacadeTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Syntax.Utilities;\nusing static Microsoft.CodeAnalysis.VisualBasic.SyntaxFactory;\n\nnamespace SonarAnalyzer.VisualBasic.Core.Facade.Implementation.Test;\n\n[TestClass]\npublic class VisualBasicSyntaxFacadeTest\n{\n    private readonly VisualBasicSyntaxFacade vb = new();\n\n    [TestMethod]\n    public void EnumMembers_Null_VB() =>\n        vb.EnumMembers(null).Should().BeEmpty();\n\n    [TestMethod]\n    public void InvocationIdentifier_Null_VB() =>\n        vb.InvocationIdentifier(null).Should().BeNull();\n\n    [TestMethod]\n    public void ObjectCreationTypeIdentifier_Null_VB() =>\n        vb.ObjectCreationTypeIdentifier(null).Should().BeNull();\n\n    [TestMethod]\n    public void InvocationIdentifier_UnexpectedTypeThrows_VB() =>\n        vb.Invoking(x => x.InvocationIdentifier(IdentifierName(\"ThisIsNotInvocation\"))).Should().Throw<InvalidCastException>();\n\n    [TestMethod]\n    public void ModifierKinds_Null_VB() =>\n        vb.ModifierKinds(null).Should().BeEmpty();\n\n    [TestMethod]\n    public void NodeExpression_Null_VB() =>\n        vb.NodeExpression(null).Should().BeNull();\n\n    [TestMethod]\n    public void NodeExpression_UnexpectedTypeThrows_VB() =>\n        vb.Invoking(x => x.NodeExpression(IdentifierName(\"ThisTypeDoesNotHaveExpression\"))).Should().Throw<InvalidOperationException>();\n\n    [TestMethod]\n    public void NodeIdentifier_Null_VB() =>\n        vb.NodeIdentifier(null).Should().BeNull();\n\n    [TestMethod]\n    public void NodeIdentifier_Unexpected_Returns_Null_VB() =>\n        vb.NodeIdentifier(AttributeList()).Should().BeNull();\n\n    [TestMethod]\n    public void StringValue_UnexpectedType_VB() =>\n        vb.StringValue(ThrowStatement(), null).Should().BeNull();\n\n    [TestMethod]\n    public void StringValue_NodeIsNull_VB() =>\n        vb.StringValue(null, null).Should().BeNull();\n\n    [TestMethod]\n    public void ArgumentNameColon_VB_SimpleNameWithNameColonEquals()\n    {\n        var expression = LiteralExpression(SyntaxKind.TrueLiteralExpression, Token(SyntaxKind.TrueKeyword));\n        var argument = SimpleArgument(NameColonEquals(IdentifierName(\"a\")), expression);\n        vb.ArgumentNameColon(argument).Should().BeOfType<SyntaxToken>().Subject.ValueText.Should().Be(\"a\");\n    }\n\n    [TestMethod]\n    public void ArgumentNameColon_VB_SimpleNameWithoutNameColonEquals()\n    {\n        var expression = LiteralExpression(SyntaxKind.TrueLiteralExpression, Token(SyntaxKind.TrueKeyword));\n        var argument = SimpleArgument(expression);\n        vb.ArgumentNameColon(argument).Should().BeNull();\n    }\n\n    [TestMethod]\n    public void ArgumentNameColon_VB_OmittedArgument()\n    {\n        var argument = OmittedArgument();\n        vb.ArgumentNameColon(argument).Should().BeNull();\n    }\n\n    [TestMethod]\n    public void ArgumentNameColon_VB_RangeArgument()\n    {\n        var literal1 = LiteralExpression(SyntaxKind.NumericLiteralExpression, Literal(1));\n        var literal2 = literal1.WithToken(Literal(2));\n        var argument = RangeArgument(literal1, literal2);\n        vb.ArgumentNameColon(argument).Should().BeNull();\n    }\n\n    [TestMethod]\n    public void ArgumentNameColon_VB_UnsupportedSyntaxKind()\n    {\n        var expression = LiteralExpression(SyntaxKind.TrueLiteralExpression, Token(SyntaxKind.TrueKeyword));\n        vb.ArgumentNameColon(expression).Should().BeNull();\n    }\n\n    [TestMethod]\n    public void ComparisonKind_BinaryExpression_VB()\n    {\n        var binary = BinaryExpression(SyntaxKind.EqualsExpression, IdentifierName(\"a\"), Token(SyntaxKind.EqualsToken), IdentifierName(\"b\"));\n        vb.ComparisonKind(binary).Should().Be(ComparisonKind.Equals);\n    }\n\n    [TestMethod]\n    public void ComparisonKind_NonBinaryExpression_VB() =>\n        vb.ComparisonKind(IdentifierName(\"a\")).Should().Be(ComparisonKind.None);\n\n    [TestMethod]\n    public void ComparisonKind_Null_VB() =>\n        vb.ComparisonKind(null).Should().Be(ComparisonKind.None);\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.VisualBasic.Core.Test/Facade/VisualBasicFacadeTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Core.Facade.Test;\n\n[TestClass]\npublic class VisualBasicFacadeTest\n{\n    [TestMethod]\n    public void MethodParameterLookup_ForInvocation()\n    {\n        var sut = VisualBasicFacade.Instance;\n        var code = \"\"\"\n            Public Class C\n                Public Function M(arg As Integer) As Integer\n                    Return M(1)\n                End Function\n            End Class\n            \"\"\";\n        var (tree, model) = TestCompiler.CompileVB(code);\n        var root = tree.GetRoot();\n        var invocation = root.DescendantNodes().OfType<InvocationExpressionSyntax>().First();\n        var method = model.GetDeclaredSymbol(root.DescendantNodes().OfType<MethodStatementSyntax>().First());\n        var actual = sut.MethodParameterLookup(invocation, method);\n        actual.Should().NotBeNull().And.BeOfType<VisualBasicMethodParameterLookup>();\n    }\n\n    [TestMethod]\n    public void MethodParameterLookup_SemanticModelOverload()\n    {\n        var code = \"\"\"\n            Public Class C\n                Public Function M(arg As Integer) As Integer\n                    Return M(1)\n                End Function\n            End Class\n            \"\"\";\n        var (tree, model) = TestCompiler.CompileVB(code);\n        var actual = VisualBasicFacade.Instance.MethodParameterLookup(tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(), model);\n        actual.Should().NotBeNull().And.BeOfType<VisualBasicMethodParameterLookup>();\n    }\n\n    [TestMethod]\n    public void MethodParameterLookup_ForObjectCreation()\n    {\n        var sut = VisualBasicFacade.Instance;\n        var code = \"\"\"\n            Public Class C\n                Public Sub New(arg As Integer)\n                End Sub\n\n                Public Function M() As C\n                    Return New C(1)\n                End Function\n            End Class\n            \"\"\";\n        var (tree, model) = TestCompiler.CompileVB(code);\n        var root = tree.GetRoot();\n        var creation = root.DescendantNodes().OfType<ObjectCreationExpressionSyntax>().First();\n        var constructor = model.GetDeclaredSymbol(root.DescendantNodes().OfType<SubNewStatementSyntax>().First());\n        var actual = sut.MethodParameterLookup(creation, constructor);\n        actual.Should().NotBeNull().And.BeOfType<VisualBasicMethodParameterLookup>();\n    }\n\n    [TestMethod]\n    public void MethodParameterLookup_ForArgumentList()\n    {\n        var sut = VisualBasicFacade.Instance;\n        var code = \"\"\"\n            Public Class C\n                Public Function M(arg As Integer) As Integer\n                    Return M(1)\n                End Function\n            End Class\n            \"\"\";\n        var (tree, model) = TestCompiler.CompileVB(code);\n        var root = tree.GetRoot();\n        var argumentList = root.DescendantNodes().OfType<ArgumentListSyntax>().First();\n        var method = model.GetDeclaredSymbol(root.DescendantNodes().OfType<MethodStatementSyntax>().First());\n        var actual = sut.MethodParameterLookup(argumentList, method);\n        actual.Should().NotBeNull().And.BeOfType<VisualBasicMethodParameterLookup>();\n    }\n\n    [TestMethod]\n    public void MethodParameterLookup_UnsupportedSyntaxKind()\n    {\n        var sut = VisualBasicFacade.Instance;\n        var code = \"\"\"\n            Public Class C\n                Public Function M(arg As Integer) As Integer\n                    Return M(1)\n                End Function\n            End Class\n            \"\"\";\n        var (tree, model) = TestCompiler.CompileVB(code);\n        var root = tree.GetRoot();\n        var methodDeclaration = root.DescendantNodes().OfType<MethodStatementSyntax>().First();\n        var method = model.GetDeclaredSymbol(methodDeclaration);\n        var actual = () => sut.MethodParameterLookup(methodDeclaration, method); // MethodDeclarationSyntax passed instead of invocation\n        actual.Should().Throw<InvalidOperationException>().Which.Message.Should().StartWith(\"The node of kind FunctionStatement does not have an ArgumentList.\");\n    }\n\n    [TestMethod]\n    public void MethodParameterLookup_Null()\n    {\n        var sut = VisualBasicFacade.Instance;\n        var code = \"\"\"\n            Public Class C\n                Public Function M(arg As Integer) As Integer\n                    Return M(1)\n                End Function\n            End Class\n            \"\"\";\n        var (tree, model) = TestCompiler.CompileVB(code);\n        var root = tree.GetRoot();\n        var method = model.GetDeclaredSymbol(root.DescendantNodes().OfType<MethodStatementSyntax>().First());\n        var actual = sut.MethodParameterLookup(null, method);\n        actual.Should().BeNull();\n    }\n\n    [TestMethod]\n    public void MethodParameterLookup_Null_SemanticModelOverload()\n    {\n        var sut = VisualBasicFacade.Instance;\n        var code = \"\"\"\n            Public Class C\n                Public Function M(arg As Integer) As Integer\n                    Return M(1)\n                End Function\n            End Class\n            \"\"\";\n        var (_, model) = TestCompiler.CompileVB(code);\n        var actual = sut.MethodParameterLookup(null, model);\n        actual.Should().BeNull();\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.VisualBasic.Core.Test/SonarAnalyzer.VisualBasic.Core.Test.csproj",
    "content": "﻿  <Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFramework>net10.0</TargetFramework>\n    <IsPackable>false</IsPackable>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\src\\SonarAnalyzer.VisualBasic.Core\\SonarAnalyzer.VisualBasic.Core.csproj\" />\n    <ProjectReference Include=\"..\\SonarAnalyzer.TestFramework\\SonarAnalyzer.TestFramework.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Using Include=\"FluentAssertions\" />\n    <Using Include=\"Microsoft.CodeAnalysis\" />\n    <Using Include=\"Microsoft.CodeAnalysis.Diagnostics\" />\n    <Using Include=\"Microsoft.CodeAnalysis.VisualBasic\" />\n    <Using Include=\"Microsoft.CodeAnalysis.VisualBasic.Syntax\" />\n    <Using Include=\"Microsoft.VisualStudio.TestTools.UnitTesting\" />\n    <Using Include=\"SonarAnalyzer.Core.Common\" />\n    <Using Include=\"SonarAnalyzer.Core.Extensions\" />\n    <Using Include=\"SonarAnalyzer.Core.Semantics\" />\n    <Using Include=\"SonarAnalyzer.VisualBasic.Core.Extensions\" />\n    <Using Include=\"SonarAnalyzer.VisualBasic.Core.Syntax.Extensions\" />\n    <Using Include=\"SonarAnalyzer.VisualBasic.Core.Syntax.Utilities\" />\n    <Using Include=\"SonarAnalyzer.VisualBasic.Core.Facade\" />\n    <Using Include=\"SonarAnalyzer.TestFramework.Build\" />\n    <Using Include=\"SonarAnalyzer.TestFramework.Common\" />\n    <Using Include=\"SonarAnalyzer.TestFramework.Extensions\" />\n    <Using Include=\"SonarAnalyzer.TestFramework.MetadataReferences\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.VisualBasic.Core.Test/Syntax/Extensions/ExpressionSyntaxExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Core.Syntax.Extensions.Test;\n\n[TestClass]\npublic class ExpressionSyntaxExtensionsTest\n{\n    public TestContext TestContext { get; set; }\n\n    [TestMethod]\n    [DataRow(\"a\", \"a\")]\n    [DataRow(\"Nothing\", \"null\")]\n    [DataRow(\"a + b\", \"null\")]\n    [DataRow(\"Me.a\", \"a\")]\n    [DataRow(\"Me.a.b\", \"a\")]\n    [DataRow(\"a.b\", \"a\")]\n    [DataRow(\"a.b()\", \"a\")]\n    [DataRow(\"a.b().c\", \"a\")]\n    [DataRow(\"a()\", \"a\")]\n    [DataRow(\"a().b\", \"a\")]\n    [DataRow(\"(a.b).c\", \"a\")]\n    [DataRow(\"a.b?.c.d(e)?(f).g?.h\", \"a\")]\n    [DataRow(\"Integer.MaxValue\", \"Integer\")]\n    [DataRow(\"a?.b\", \"a\")]\n    [DataRow(\"a?.b?.c\", \"a\")]\n    public void LeftMostInMemberAccess(string expression, string expected) =>\n        (SyntaxFactory.ParseExpression(expression).LeftMostInMemberAccess?.ToString() ?? \"null\").Should().BeEquivalentTo(expected);\n\n    [TestMethod]\n    [DataRow(\"a\", \"a\")]\n    [DataRow(\"(a)\", \"a\")]\n    [DataRow(\"((a))\", \"a\")]\n    [DataRow(\"(((a)))\", \"a\")]\n    [DataRow(\"(a + b)\", \"a + b\")]\n    [DataRow(\"((a + b))\", \"a + b\")]\n    public void RemoveParentheses(string expression, string expected) =>\n        SyntaxFactory.ParseExpression(expression).RemoveParentheses().ToString().Should().Be(expected);\n\n    [TestMethod]\n    [DataRow(\"a = b\", \"a\", true)]\n    [DataRow(\"a = b\", \"b\", false)]\n    [DataRow(\"a.b = c\", \"a.b\", true)]\n    [DataRow(\"a.b = c\", \"c\", false)]\n    public void IsLeftSideOfAssignment(string statement, string expressionToFind, bool expected) =>\n        Parse(statement).OfType<ExpressionSyntax>().First(x => x.ToString() == expressionToFind).IsLeftSideOfAssignment.Should().Be(expected);\n\n    [TestMethod]\n    [DataRow(\"MyBase.Method()\", true)]\n    [DataRow(\"MyBase.Property\", true)]\n    [DataRow(\"Me.Method()\", false)]\n    [DataRow(\"Me.Property\", false)]\n    [DataRow(\"Other.Method()\", false)]\n    [DataRow(\"Method()\", true)]\n    [DataRow(\"SomeIdentifier\", true)]\n    [DataRow(\"MyBase?.Method()\", true)]\n    [DataRow(\"Me?.Method()\", false)]\n    [DataRow(\"Other?.Method()\", false)]\n    [DataRow(\"42\", false)]\n    public void IsOnBase(string expression, bool expected) =>\n        Parse($\"Dim x = {expression}\").OfType<ExpressionSyntax>().First(x => x.ToString() == expression).IsOnBase.Should().Be(expected);\n\n    [TestMethod]\n    [DataRow(\"a.b\", \"a.b\")]\n    [DataRow(\"(a.b)\", \"a.b\")]\n    [DataRow(\"((a.b))\", \"a.b\")]\n    public void SelfOrTopParenthesizedExpression(string outerExpression, string innerExpression) =>\n        Parse($\"Dim x = {outerExpression}\").OfType<MemberAccessExpressionSyntax>().First(x => x.ToString() == innerExpression)\n            .SelfOrTopParenthesizedExpression\n            .ToString()\n            .Should().Be(outerExpression);\n\n    [TestMethod]\n    [DataRow(\"ToString\", true)]\n    [DataRow(\"TOSTRING\", true)]\n    [DataRow(\"tostring\", true)]\n    [DataRow(\"Other\", false)]\n    [DataRow(\"\", false)]\n    [DataRow(null, false)]\n    public void NameIs(string name, bool expected) =>\n        Parse(\"Dim x = obj.ToString()\").OfType<MemberAccessExpressionSyntax>().Single().NameIs(name).Should().Be(expected);\n\n    [TestMethod]\n    [DataRow(\"42\", true)]\n    [DataRow(\"\\\"Hello\\\"\", true)]\n    [DataRow(\"True\", true)]\n    [DataRow(\"False\", true)]\n    [DataRow(\"Nothing\", true)]\n    [DataRow(\"\\\"c\\\"c\", true)]\n    public void HasConstantValue_Literals(string expression, bool expected)\n    {\n        var (tree, model) = Compile($\"Dim x = {expression}\");\n        tree.GetRoot(TestContext.CancellationToken).DescendantNodes().OfType<VariableDeclaratorSyntax>().Single().Initializer.Value.HasConstantValue(model).Should().Be(expected);\n    }\n\n    [TestMethod]\n    public void HasConstantValue_NonConstant_Parameter()\n    {\n        var (tree, model) = Compile(\"Dim x = a\", \"Sub M(a As Integer)\");\n        tree.GetRoot(TestContext.CancellationToken).DescendantNodes().OfType<VariableDeclaratorSyntax>().Single().Initializer.Value.HasConstantValue(model).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void HasConstantValue_NonConstant_MethodCall()\n    {\n        var (tree, model) = Compile(\"Dim x = GetValue()\", classMembers: \"\"\"\n            Function GetValue() As Integer\n                Return 42\n            End Function\n            \"\"\");\n        tree.GetRoot(TestContext.CancellationToken).DescendantNodes().OfType<VariableDeclaratorSyntax>().Single().Initializer.Value.HasConstantValue(model).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void HasConstantValue_ConstantField()\n    {\n        var (tree, model) = Compile(\"Dim x = MyConst\", classMembers: \"Const MyConst As Integer = 42\");\n        tree.GetRoot(TestContext.CancellationToken).DescendantNodes().OfType<VariableDeclaratorSyntax>().Last().Initializer.Value.HasConstantValue(model).Should().BeTrue();\n    }\n\n    [TestMethod]\n    [DataRow(\"a?.b\", \"a?.b\")]\n    [DataRow(\"a?.b?.c\", \"a?.b?.c\")]\n    [DataRow(\"a?.b.c\", \"a?.b.c\")]\n    public void RootConditionalAccessExpression(string fullExpression, string expectedRoot) =>\n        SyntaxFactory.ParseExpression(fullExpression).DescendantNodesAndSelf().OfType<ConditionalAccessExpressionSyntax>().First().RootConditionalAccessExpression.ToString().Should().Be(expectedRoot);\n\n    private static SyntaxNode[] Parse(string methodBody, string methodSignature = \"Sub M()\", string classMembers = null) =>\n        VisualBasicSyntaxTree.ParseText(WrapInClass(methodBody, methodSignature, classMembers)).GetRoot().DescendantNodes().ToArray();\n\n    private static (SyntaxTree Tree, SemanticModel Model) Compile(string methodBody, string methodSignature = \"Sub M()\", string classMembers = null) =>\n        TestCompiler.CompileVB(WrapInClass(methodBody, methodSignature, classMembers));\n\n    private static string WrapInClass(string methodBody, string methodSignature = \"Sub M()\", string classMembers = null) =>\n        $\"\"\"\n        Class C\n            {classMembers}\n            {methodSignature}\n                {methodBody}\n            End Sub\n        End Class\n        \"\"\";\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.VisualBasic.Core.Test/Syntax/Extensions/InterpolatedStringExpressionSyntaxExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Core.Syntax.Extensions.Test;\n\n[TestClass]\npublic class InterpolatedStringExpressionSyntaxExtensionsTest\n{\n    [TestMethod]\n    [DataRow(@\"Dim methodCall = $\"\"{Foo()}\"\"\")]\n    [DataRow(@\"Dim nestedMethodCall = $\"\"{$\"\"{$\"\"{Foo()}\"\"}\"\"}\"\"\")]\n    [DataRow(@\"Const constant As Integer = 1 : Dim mixConstantNonConstant = $\"\"{notConstant}{constant}\"\"\")]\n    [DataRow(@\"Const constant As Integer = 1 : Dim mixConstantAndLiteral = $\"\"TextValue {constant}\"\"\")]\n    [DataRow(@\"Const constant As Integer = 1 : Dim mix = $\"\"{constant}{$\"\"{Foo()}\"\"}{\"\"{notConstant}\"\"}\"\"\")]\n    public void TryGetGetInterpolatedTextValue_UnsupportedSyntaxKinds_ReturnsFalse_VB(string methodBody)\n    {\n        var (expression, model) = CompileVB(methodBody);\n        InterpolatedStringExpressionSyntaxExtensions.InterpolatedTextValue(expression, model).Should().BeNull();\n    }\n\n    [TestMethod]\n    [DataRow(@\"Dim textOnly = $\"\"TextOnly\"\"\", \"TextOnly\")]\n    [DataRow(@\"Const constantString As String = \"\"Foo\"\" : Dim constantInterpolation As String = $\"\"{constantString} with text.\"\"\", \"Foo with text.\")]\n    [DataRow(@\"Const constantString As String = \"\"Foo\"\" : Dim constantInterpolation As String = $\"\"{$\"\"Nested {constantString}\"\"} with text.\"\"\", \"Nested Foo with text.\")]\n    [DataRow(@\"notConstantString = \"\"SomeValue\"\" : Dim interpolatedString As String = $\"\"{notConstantString}\"\"\", \"SomeValue\")]\n    public void TryGetGetInterpolatedTextValue_SupportedSyntaxKinds_ReturnsTrue_VB(string methodBody, string expectedTextValue)\n    {\n        var (expression, model) = CompileVB(methodBody);\n        InterpolatedStringExpressionSyntaxExtensions.InterpolatedTextValue(expression, model).Should().Be(expectedTextValue);\n    }\n\n    private static (InterpolatedStringExpressionSyntax InterpolatedStringExpression, SemanticModel SemanticModel) CompileVB(string methodBody)\n    {\n        var code = $\"\"\"\n            Public Class C\n                    Public Sub M(ByVal notConstant As Integer, ByVal notConstantString As String)\n                        {methodBody}\n                    End Sub\n\n                    Private Function Foo() As String\n                        Return \"x\"\n                    End Function\n            End Class\n            \"\"\";\n        var (tree, model) = TestCompiler.CompileVB(code);\n        return (tree.First<InterpolatedStringExpressionSyntax>(), model);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.VisualBasic.Core.Test/Syntax/Extensions/InvocationExpressionSyntaxExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace SonarAnalyzer.VisualBasic.Core.Syntax.Extensions.Test;\n\n[TestClass]\npublic class InvocationExpressionSyntaxExtensionsTest\n{\n    [TestMethod]\n    [DataRow(\"System.Array.$$Empty(Of Integer)()$$\", \"System.Array\", \"Empty(Of Integer)\")]\n    [DataRow(\"Me.$$M()$$\", \"Me\", \"M\")]\n    [DataRow(\"A?.$$M()$$\", \"A\", \"M\")]\n    public void TryGetOperands_InvocationNode_ShouldReturnsTrue_VB(string expression, string expectedLeft, string expectedRight)\n    {\n        var code = $$\"\"\"\n            Public Class X\n                Public Property A As X\n                Public Function M() As Integer\n                    Dim unused = {{expression}}\n                    Return 42\n                End Function\n            End Class\n            \"\"\";\n        var node = NodeBetweenMarkers(code, LanguageNames.VisualBasic) as InvocationExpressionSyntax;\n\n        var (left, right) = InvocationExpressionSyntaxExtensions.Operands(node);\n\n        left.Should().NotBeNull();\n        left.ToString().Should().Be(expectedLeft);\n        right.Should().NotBeNull();\n        right.ToString().Should().Be(expectedRight);\n    }\n\n    [TestMethod]\n    [DataRow(\"$$M()$$\")]\n    public void TryGetOperands_InvocationNodeDoesNotContainMemberAccess_ShouldReturnsFalse_VB(string expression)\n    {\n        var code = $$\"\"\"\n            Public Class X\n                Public Property A As X\n                Public Function M() As Integer\n                    Dim unused = {{expression}}\n                    Return 42\n                End Function\n            End Class\n            \"\"\";\n        var node = NodeBetweenMarkers(code, LanguageNames.VisualBasic) as InvocationExpressionSyntax;\n\n        var (left, right) = InvocationExpressionSyntaxExtensions.Operands(node);\n\n        left.Should().BeNull();\n        right.Should().BeNull();\n    }\n\n    [TestMethod]\n    public void HasExactlyNArguments_Null_VB() =>\n        InvocationExpressionSyntaxExtensions.HasExactlyNArguments(null, 42).Should().BeFalse();\n\n    [TestMethod]\n    public void GetMethodCallIdentifier_Null_VB() =>\n        InvocationExpressionSyntaxExtensions.GetMethodCallIdentifier(null).Should().BeNull();\n\n    [TestMethod]\n    public void IsMemberAccessOnKnownType_NotMemberAccessExpression_ReturnsFalse()\n    {\n        var invocationExpression = SyntaxFactory.ParseSyntaxTree(\"\"\"\n            Sub test()\n                test()\n            End Sub\n            \"\"\")\n            .GetRoot()\n            .DescendantNodes()\n            .OfType<InvocationExpressionSyntax>()\n            .Single();\n\n        InvocationExpressionSyntaxExtensions.IsMemberAccessOnKnownType(invocationExpression, null, KnownType.System_String, null).Should().BeFalse();\n    }\n\n    private static SyntaxNode NodeBetweenMarkers(string code, string language)\n    {\n        var position = code.IndexOf(\"$$\");\n        var lastPosition = code.LastIndexOf(\"$$\");\n        var length = lastPosition == position ? 0 : lastPosition - position - \"$$\".Length;\n        code = code.Replace(\"$$\", string.Empty);\n        return TestCompiler.CompileVB(code).Tree.GetRoot().FindNode(new TextSpan(position, length));\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.VisualBasic.Core.Test/Syntax/Extensions/ObjectCreationExpressionSyntaxExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Core.Syntax.Extensions.Test;\n\n[TestClass]\npublic class ObjectCreationExpressionSyntaxExtensionsTest\n{\n    [TestMethod]\n    public void GetObjectCreationTypeIdentifier_Null_VB() =>\n        ObjectCreationExpressionSyntaxExtensions.GetObjectCreationTypeIdentifier(null).Should().BeNull();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.VisualBasic.Core.Test/Syntax/Extensions/SyntaxNodeExtensionsVisualBasicTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Test.Syntax.Extensions;\n\n[TestClass]\npublic partial class SyntaxNodeExtensionsVisualBasicTest\n{\n    private const string Source = \"\"\"\n        Class Example\n            Function Method(Input As Object) As String\n                Dim Qualified As System.Exception\n                Dim GlobalName As Global.System.Exception\n                Return Input.ToString()\n            End Function\n        End Class\n        \"\"\";\n\n    [TestMethod]\n    public void GetName()\n    {\n        var nodes = Parse(Source);\n        GetName(nodes.OfType<ClassStatementSyntax>().Single()).Should().Be(\"Example\");\n        GetName(nodes.OfType<MethodBlockSyntax>().Single()).Should().Be(\"Method\");\n        GetName(nodes.OfType<MethodStatementSyntax>().Single()).Should().Be(\"Method\");\n        GetName(nodes.OfType<ParameterSyntax>().Single()).Should().Be(\"Input\");\n        GetName(nodes.OfType<PredefinedTypeSyntax>().First()).Should().Be(\"Object\");\n        GetName(nodes.OfType<MemberAccessExpressionSyntax>().Single()).Should().Be(\"ToString\");\n        nodes.OfType<IdentifierNameSyntax>().Select(x => GetName(x)).Should().BeEquivalentTo(\"System\", \"Exception\", \"System\", \"Exception\", \"Input\", \"ToString\");\n        nodes.OfType<QualifiedNameSyntax>().Select(x => GetName(x)).Should().BeEquivalentTo(\"Exception\", \"Exception\", \"System\");\n        GetName(nodes.OfType<InvocationExpressionSyntax>().Single()).Should().Be(\"ToString\");\n        GetName(nodes.OfType<ReturnStatementSyntax>().Single()).Should().BeEmpty();\n\n        static string GetName(SyntaxNode node) => SyntaxNodeExtensionsVisualBasic.GetName(node);\n    }\n\n    [TestMethod]\n    public void IsNothingLiteral_Null() =>\n        SyntaxNodeExtensionsVisualBasic.IsNothingLiteral(null).Should().BeFalse();\n\n    [TestMethod]\n    public void NameIs()\n    {\n        var toString = Parse(Source).OfType<MemberAccessExpressionSyntax>().Single();\n        toString.NameIs(\"ToString\").Should().BeTrue();\n        toString.NameIs(\"TOSTRING\").Should().BeTrue();\n        toString.NameIs(\"tostring\").Should().BeTrue();\n        toString.NameIs(\"test\").Should().BeFalse();\n        toString.NameIs(\"\").Should().BeFalse();\n        toString.NameIs(null).Should().BeFalse();\n    }\n\n    private static SyntaxNode[] Parse(string source) =>\n        VisualBasicSyntaxTree.ParseText(source).GetRoot().DescendantNodes().ToArray();\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.VisualBasic.Core.Test/Syntax/Extensions/SyntaxTokenExtensionsTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Syntax.Utilities;\nusing static Microsoft.CodeAnalysis.VisualBasic.SyntaxFactory;\n\nnamespace SonarAnalyzer.VisualBasic.Core.Syntax.Extensions.Test;\n\n[TestClass]\npublic class SyntaxTokenExtensionsTest\n{\n    [TestMethod]\n    [DataRow(SyntaxKind.EqualsToken, ComparisonKind.Equals)]\n    [DataRow(SyntaxKind.LessThanGreaterThanToken, ComparisonKind.NotEquals)]\n    [DataRow(SyntaxKind.LessThanToken, ComparisonKind.LessThan)]\n    [DataRow(SyntaxKind.LessThanEqualsToken, ComparisonKind.LessThanOrEqual)]\n    [DataRow(SyntaxKind.GreaterThanToken, ComparisonKind.GreaterThan)]\n    [DataRow(SyntaxKind.GreaterThanEqualsToken, ComparisonKind.GreaterThanOrEqual)]\n    [DataRow(SyntaxKind.PlusToken, ComparisonKind.None)]\n    public void ToComparisonKind(SyntaxKind tokenKind, ComparisonKind expected) =>\n        Token(tokenKind).ToComparisonKind().Should().Be(expected);\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.VisualBasic.Core.Test/Syntax/Utilities/SafeVisualBasicSyntaxWalkerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Core.Syntax.Utilities.Test;\n\n[TestClass]\npublic class SafeVisualBasicSyntaxWalkerTest\n{\n    [TestMethod]\n    public void GivenSyntaxNodeWithReasonableDepth_SafeVisit_ReturnsTrue() =>\n        new Walker().SafeVisit(SyntaxFactory.ParseSyntaxTree(\"Public Function Main(Arg as Boolean) As Boolean\").GetRoot()).Should().BeTrue();\n\n    [TestMethod]\n    public void GivenSyntaxNodeWithHighDepth_SafeVisit_ReturnsFalse()\n    {\n        var longExpression = Enumerable.Repeat(\"AndAlso Arg\", 7000).JoinStr(\" \");\n        var code = $\"\"\"\n            Public Class Sample\n                Public Function Main(Arg as Boolean) As Boolean\n                    Return Arg {longExpression}\n                End Function\n            End Class\n            \"\"\";\n\n        new Walker().SafeVisit(VisualBasicSyntaxTree.ParseText(code).GetCompilationUnitRoot()).Should().BeFalse();\n    }\n\n    private class Walker : SafeVisualBasicSyntaxWalker { }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.VisualBasic.Core.Test/Trackers/FieldAccessTrackerTest.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.Core.Trackers;\n\nnamespace SonarAnalyzer.VisualBasic.Core.Trackers.Test;\n\n[TestClass]\npublic class FieldAccessTrackerTest\n{\n    [TestMethod]\n    public void MatchSet_VB()\n    {\n        var tracker = new VisualBasicFieldAccessTracker();\n        var context = CreateContext(\"AssignConst\");\n        tracker.MatchSet()(context).Should().BeTrue();\n\n        context = CreateContext(\"Read\");\n        tracker.MatchSet()(context).Should().BeFalse();\n    }\n\n    [TestMethod]\n    public void AssignedValueIsConstant_VB()\n    {\n        var tracker = new VisualBasicFieldAccessTracker();\n        var context = CreateContext(\"AssignConst\");\n        tracker.AssignedValueIsConstant()(context).Should().BeTrue();\n\n        context = CreateContext(\"AssignVariable\");\n        tracker.AssignedValueIsConstant()(context).Should().BeFalse();\n\n        context = CreateContext(\"InvocationArg\");\n        tracker.AssignedValueIsConstant()(context).Should().BeFalse();\n    }\n\n    private static FieldAccessContext CreateContext(string fieldName)\n    {\n        const string code = \"\"\"\n            Public Class Sample\n                Private AssignConst As Integer\n                Private AssignVariable As Integer\n                Private Read As Integer\n                Private InvocationArg As Integer\n\n                Public Sub Usage()\n                    Dim X As Integer = Read\n                    AssignConst = 42\n                    AssignVariable = X\n                    Method(InvocationArg)\n                End Sub\n\n                Private Sub Method(Arg As Integer)\n                End Sub\n            End Class\n            \"\"\";\n        var compiler = new SnippetCompiler(code, false, AnalyzerLanguage.VisualBasic);\n        var node = compiler.Nodes<IdentifierNameSyntax>().First(x => x.ToString() == fieldName);\n        return new FieldAccessContext(compiler.CreateAnalysisContext(node), fieldName);\n    }\n}\n"
  },
  {
    "path": "analyzers/tests/SonarAnalyzer.VisualBasic.Core.Test/packages.lock.json",
    "content": "{\n  \"version\": 1,\n  \"dependencies\": {\n    \"net10.0\": {\n      \"altcover\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[9.0.102, )\",\n        \"resolved\": \"9.0.102\",\n        \"contentHash\": \"q3Rf5t0M9kXlcO5qhsaAe6NrFSNd5enrhKmF/Ezgmomqw34PbUTbRSYjSDNhS3YGDyUrPTkyPn14EfLDJWztcA==\"\n      },\n      \"Combinatorial.MSTest\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[2.0.0, )\",\n        \"resolved\": \"2.0.0\",\n        \"contentHash\": \"9tB2TMPkuEkYYUq64WREHMMyPt9NfKAyuitpK9yw3zbVe6v/vYkClZTR02+yKFUG+g8XHi5LMTt8jHz4RufGqw==\",\n        \"dependencies\": {\n          \"MSTest.TestFramework\": \"4.0.1\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[3.3.1, )\",\n        \"resolved\": \"3.3.1\",\n        \"contentHash\": \"eT+kgNCDdTRbQ5WF6BGx1HI3D5jYfHteza/koefhWC2vNZGxObA74XxwWfg40dy3uUv7dn3OGKLK5GUPLroVog==\"\n      },\n      \"Microsoft.NET.Test.Sdk\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[18.4.0, )\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"w49iZdL4HL6V25l41NVQLXWQ+e71GvSkKVteMrOL02gP/PUkcnO/1yEb2s9FntU4wGmJWfKnyrRAhcMHd9ZZNA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeCoverage\": \"18.4.0\",\n          \"Microsoft.TestPlatform.TestHost\": \"18.4.0\"\n        }\n      },\n      \"MSTest.TestAdapter\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[4.2.1, )\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"lZRgNzaQnffK4XLjM/og4Eoqp/3IkpcyJQQcyKXkPdkzCT3+ghpwHa9zG1xYhQDbUFoc54M+/waLwh31K9stDQ==\",\n        \"dependencies\": {\n          \"MSTest.TestFramework\": \"4.2.1\",\n          \"Microsoft.Testing.Extensions.VSTestBridge\": \"2.2.1\",\n          \"Microsoft.Testing.Platform.MSBuild\": \"2.2.1\"\n        }\n      },\n      \"MSTest.TestFramework\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[4.2.1, )\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"I4/RbS2TpGZ56CE98+jPbrGlcerYtw2LvPVKzQGvyQQcJDekPy2Kd+fnThXYn+geJ1sW+vA9B7++rFNxvKcWxA==\",\n        \"dependencies\": {\n          \"MSTest.Analyzers\": \"4.2.1\"\n        }\n      },\n      \"SonarAnalyzer.CSharp.Styling\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[10.21.0.135717, )\",\n        \"resolved\": \"10.21.0.135717\",\n        \"contentHash\": \"hl264jF539oB7m2jED5QGM345eFSiDAdoJc8TH0HM6L7ZeqT5TDqZDQeZ8IDP02dVIpH/Fhhn+HsGfEcj8ohyQ==\"\n      },\n      \"StyleCop.Analyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[1.2.0-beta.556, )\",\n        \"resolved\": \"1.2.0-beta.556\",\n        \"contentHash\": \"llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==\",\n        \"dependencies\": {\n          \"StyleCop.Analyzers.Unstable\": \"1.2.0.556\"\n        }\n      },\n      \"Castle.Core\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.1.1\",\n        \"contentHash\": \"rpYtIczkzGpf+EkZgDr9CClTdemhsrwA/W5hMoPjLkRFnXzH44zDLoovXeKtmxb1ykXK9aJVODSpiJml8CTw2g==\",\n        \"dependencies\": {\n          \"System.Diagnostics.EventLog\": \"6.0.0\"\n        }\n      },\n      \"FluentAssertions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.2.1\",\n        \"contentHash\": \"MilqBF2lZrT0V1azIA6DG6I/snS0rG3A8ohT2Jjkhq6zOFk76nqx4BPnEnzrX6jFVa6xvkDU++z3PebCGZyJ4g==\",\n        \"dependencies\": {\n          \"System.Configuration.ConfigurationManager\": \"6.0.0\"\n        }\n      },\n      \"FluentAssertions.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"0.34.1\",\n        \"contentHash\": \"2BnAAB8CCPdRA9P1+lAvBZOleR2BTmsxGMtGt+LnABJUARGqoGMWEFxG3znZYqHVIrMP0Za/kyw6atyt8x2mzA==\"\n      },\n      \"Google.Protobuf\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"3.6.1\",\n        \"contentHash\": \"741fGeDQjixBJaU2j+0CbrmZXsNJkTn/hWbOh4fLVXndHsCclJmWznCPWrJmPoZKvajBvAz3e8ECJOUvRtwjNQ==\",\n        \"dependencies\": {\n          \"NETStandard.Library\": \"1.6.1\"\n        }\n      },\n      \"Humanizer.Core\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.14.1\",\n        \"contentHash\": \"lQKvtaTDOXnoVJ20ibTuSIOf2i0uO0MPbDhd1jm238I+U/2ZnRENj0cktKZhtchBMtCUSRQ5v4xBCUbKNmyVMw==\"\n      },\n      \"Microsoft.ApplicationInsights\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.23.0\",\n        \"contentHash\": \"nWArUZTdU7iqZLycLKWe0TDms48KKGE6pONH2terYNa8REXiqixrMOkf1sk5DHGMaUTqONU2YkS4SAXBhLStgw==\",\n        \"dependencies\": {\n          \"System.Diagnostics.DiagnosticSource\": \"5.0.0\"\n        }\n      },\n      \"Microsoft.Build.Framework\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"17.11.48\",\n        \"contentHash\": \"C3WIMt2wBl4++NX3jSEpTq5KXBhvAV154R4JrYHkfy9JSBcXWiL0mkgpspk5xSdOj+fS/uz7zluIy6bMM1fkkQ==\"\n      },\n      \"Microsoft.Build.Locator\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.11.2\",\n        \"contentHash\": \"tY+/S54G29CGsbL3slVu4vqtpciwVnb3fKOmrhgzEQmu/VziFaWmD/E1e/2KH7cDucuycGSkWsSXndBs5Uawow==\"\n      },\n      \"Microsoft.CodeAnalysis.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0-2.25625.1\",\n        \"contentHash\": \"4Yhh2fnu3G+J0J1lDc8WZVgMjgbynSeTfkl5IFJMFrmiIO0sc7Tjx+f3sFVV8Sd35PrIUWfof0RWc3lAMl7Azg==\"\n      },\n      \"Microsoft.CodeAnalysis.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"uC0qk3jzTQY7i90ehfnCqaOZpBUGJyPMiHJ3c0jOb8yaPBjWzIhVdNxPbeVzI74DB0C+YgBKPLqUkgFZzua5Mg==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"SQFNGQF4f7UfDXKxMzzGNMr3fjrPDIjLfmRvvVgDCw+dyvEHDaRfHuKA5q0Pr0/JW0Gcw89TxrxrS/MjwBvluQ==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.CSharp.Workspaces\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"mRwxchBs3ewXK4dqK4R/eVCx99VIq1k/lhwArlu+fJuV0uzmbkTTRw4jR9gN9sOcAQfX0uV9KQlmCk1yC0JNog==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.CSharp\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.VisualBasic\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"AJxddsIOmfimuihaLuSAm4c/zskHoL1ypAjIpSOZqHlNm2iuw0twsB8nbKczJyfClqD7+iYjdIeE5EV8WAyxRA==\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"pAGdr4qs7+v287DPiiM8px1cBXnhe8LxymkVGTnCwv2OEjCk5HO2zIoFvype4ivKJTRW3aTUUV8ab+915wbv+w==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.VisualBasic\": \"[5.3.0]\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Workspaces.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"QSf1ge9A+XFZbGL+gIqXYBIKlm8QdQVLvHDPZiydG11W6mJY7XBMusrsgIEz6L8GYMzGJKTM78m9icliGMF7NA==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Common\": \"[5.3.0]\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeAnalysis.Workspaces.MSBuild\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"2Mg/ppo5dza1e4DJWX4+RIHMc3FgnYzuHTaLRZDupiK1LTi/PAZ1PBpF/iivHVNKQKwipHE984gy37MbM0RO9Q==\",\n        \"dependencies\": {\n          \"Humanizer.Core\": \"2.14.1\",\n          \"Microsoft.Build.Framework\": \"17.11.48\",\n          \"Microsoft.CodeAnalysis.Analyzers\": \"5.3.0-2.25625.1\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[5.3.0]\",\n          \"Microsoft.Extensions.DependencyInjection\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Options\": \"9.0.0\",\n          \"Microsoft.Extensions.Primitives\": \"9.0.0\",\n          \"Microsoft.VisualStudio.SolutionPersistence\": \"1.0.52\",\n          \"System.Composition\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.CodeCoverage\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"9O0BtCfzCWrkAmK187ugKdq72HHOXoOUjuWFDVc2LsZZ0pOnA9bTt+Sg9q4cF+MoAaUU+MuWtvBuFsnduviJow==\"\n      },\n      \"Microsoft.Composition\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.27\",\n        \"contentHash\": \"pwu80Ohe7SBzZ6i69LVdzowp6V+LaVRzd5F7A6QlD42vQkX0oT7KXKWWPlM/S00w1gnMQMRnEdbtOV12z6rXdQ==\"\n      },\n      \"Microsoft.Extensions.DependencyInjection\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"MCPrg7v3QgNMr0vX4vzRXvkNGgLg8vKWX0nKCWUxu2uPyMsaRgiRc1tHBnbTcfJMhMKj2slE/j2M9oGkd25DNw==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.DependencyInjection.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"+6f2qv2a3dLwd5w6JanPIPs47CxRbnk+ZocMJUhv9NxP88VlOcJYZs9jY+MYSjxvady08bUZn6qgiNh7DadGgg==\"\n      },\n      \"Microsoft.Extensions.Logging\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"crjWyORoug0kK7RSNJBTeSE6VX8IQgLf3nUpTB9m62bPXp/tzbnOsnbe8TXEG0AASNaKZddnpHKw7fET8E++Pg==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection\": \"9.0.0\",\n          \"Microsoft.Extensions.Logging.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Options\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.Logging.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"g0UfujELzlLbHoVG8kPKVBaW470Ewi+jnptGS9KUi6jcb+k2StujtK3m26DFSGGwQ/+bVgZfsWqNzlP6YOejvw==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.Options\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"y2146b3jrPI3Q0lokKXdKLpmXqakYbDIPDV6r3M8SqvSf45WwOTzkyfDpxnZXJsJQEpAsAqjUq5Pu8RCJMjubg==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"9.0.0\",\n          \"Microsoft.Extensions.Primitives\": \"9.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"N3qEBzmLMYiASUlKxxFIISP4AiwuPTHF5uCh+2CWSwwzAJiIYx0kBJsS30cp1nvhSySFAVi30jecD307jV+8Kg==\"\n      },\n      \"Microsoft.Testing.Extensions.Telemetry\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"7zB8BjffOyvqfHF26rFVPuK0w1fCf5+j1tLuhHIr76CqxXkGb+fMJtq6YNOV+m6qPytExHMXxluk3RgJ+dSIqw==\",\n        \"dependencies\": {\n          \"Microsoft.ApplicationInsights\": \"2.23.0\",\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.Testing.Extensions.TrxReport.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"RD6D1Jx6cKDA5IHd1H2q8ylIuQG3PD+gdULI0JC8CvsRtaypFzTFpB5xDPuQi8o6kAkcM04cBhAiJPxZboNH2Q==\",\n        \"dependencies\": {\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.Testing.Extensions.VSTestBridge\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"D8AGlkNtlTQPe3zf4SLnHBMr13lerMe0RuHSoRfnRatcuX/T7YbRtgn39rWBjKhXsNio0WXKrPKv3gfWE2I46w==\",\n        \"dependencies\": {\n          \"Microsoft.TestPlatform.ObjectModel\": \"18.3.0\",\n          \"Microsoft.Testing.Extensions.Telemetry\": \"2.2.1\",\n          \"Microsoft.Testing.Extensions.TrxReport.Abstractions\": \"2.2.1\",\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.Testing.Platform\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"9bbPuls/b6/vUFzxbSjJLZlJHyKBfOZE5kjIY+ITI2ASqlFPJhR83BdLydJeQOCLEZhEbrEcz5xtt1B69nwSVg==\"\n      },\n      \"Microsoft.Testing.Platform.MSBuild\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.2.1\",\n        \"contentHash\": \"CSJOcZHfKlTyPbS0CTJk6iEnU4gJC+eUA5z72UBnMDRdgVHYOmB8k9Y7jT233gZjnCOQiYFg3acQHRfu2H62nw==\",\n        \"dependencies\": {\n          \"Microsoft.Testing.Platform\": \"2.2.1\"\n        }\n      },\n      \"Microsoft.TestPlatform.ObjectModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"4L6m2kS2pY5uJ9cpeRxzW22opr6ttScIRqsOpMDQpgENp/ZwxkkQCcmc6LRSURo2dFaaSW5KVflQZvroiJ7Wzg==\",\n        \"dependencies\": {\n          \"System.Reflection.Metadata\": \"8.0.0\"\n        }\n      },\n      \"Microsoft.TestPlatform.TestHost\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"18.4.0\",\n        \"contentHash\": \"gZsCHI+zOmZCcKZieIL4Jg14qKD2OGZOmX5DehuIk1EA9BN6Crm0+taXQNEuajOH1G9CCyBxw8VWR4t5tumcng==\",\n        \"dependencies\": {\n          \"Microsoft.TestPlatform.ObjectModel\": \"18.4.0\",\n          \"Newtonsoft.Json\": \"13.0.3\"\n        }\n      },\n      \"Microsoft.VisualStudio.SolutionPersistence\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.52\",\n        \"contentHash\": \"oNv2JtYXhpdJrX63nibx1JT3uCESOBQ1LAk7Dtz/sr0+laW0KRM6eKp4CZ3MHDR2siIkKsY8MmUkeP5DKkQQ5w==\"\n      },\n      \"Microsoft.Win32.SystemEvents\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"hqTM5628jSsQiv+HGpiq3WKBl2c8v1KZfby2J6Pr7pEPlK9waPdgEO6b8A/+/xn/yZ9ulv8HuqK71ONy2tg67A==\"\n      },\n      \"MSTest.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.2.1\",\n        \"contentHash\": \"1i9jgE/42KGGyZ4s0MdrYM/Uu/dRYhbRfYQifcO0AZ6vw4sBXRjoQGQRGNSm771AYgPAmoGl0u4sJc2lMET6HQ==\"\n      },\n      \"Newtonsoft.Json\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"13.0.3\",\n        \"contentHash\": \"HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==\"\n      },\n      \"NSubstitute\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.3.0\",\n        \"contentHash\": \"lJ47Cps5Qzr86N99lcwd+OUvQma7+fBgr8+Mn+aOC0WrlqMNkdivaYD9IvnZ5Mqo6Ky3LS7ZI+tUq1/s9ERd0Q==\",\n        \"dependencies\": {\n          \"Castle.Core\": \"5.1.1\"\n        }\n      },\n      \"NuGet.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"1mp7zmyAGmQfT93ELC4c+MYOrJ8Ff4ekFZRek4JSVLb/wOO/o0bsPfLmqujCsJ2Hlwc+fpq1TQEnjSEgWdt8ng==\",\n        \"dependencies\": {\n          \"NuGet.Frameworks\": \"7.3.1\"\n        }\n      },\n      \"NuGet.Configuration\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"tGxWBo47EQONOaqY+MbEWMrNjFthHgfavLM1HE0RcLyOXVCoQKBlZGV7v0hrS/rJrQKw6ZaBeHetX+ZJgS7Lxg==\",\n        \"dependencies\": {\n          \"NuGet.Common\": \"7.3.1\",\n          \"System.Security.Cryptography.ProtectedData\": \"8.0.0\"\n        }\n      },\n      \"NuGet.Frameworks\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"VUPAE5l/Ir4Gb3dv+v0jq0Qe4nfwxfrfiYN7QhwlGyWPXFKYXSSke1t1bV/ZYd6idtTtRDqJPM49Lt/U8NTocg==\"\n      },\n      \"NuGet.Packaging\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"5bT8uOrNBx4Srhbrd3HonYmyKhWJkvQyTWTYE2jvfPgYx2aCbPmq8MCYko7ce78hEN9mpq2xlrztVhguYPc+GQ==\",\n        \"dependencies\": {\n          \"Newtonsoft.Json\": \"13.0.3\",\n          \"NuGet.Configuration\": \"7.3.1\",\n          \"NuGet.Versioning\": \"7.3.1\",\n          \"System.Security.Cryptography.Pkcs\": \"8.0.1\"\n        }\n      },\n      \"NuGet.Protocol\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"vYd5vtCJ/tpMQjbAs6rrftNgeh5Ip1w7tnEsDZCpGObKgUgOxHQBekCul3TnzmbNgobvJEkDJNaec5/ZBv66Hg==\",\n        \"dependencies\": {\n          \"NuGet.Packaging\": \"7.3.1\"\n        }\n      },\n      \"NuGet.Versioning\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"7.3.1\",\n        \"contentHash\": \"TJrQWSmD1vakfav7qIhDXgDFfaZFfMJ+v6P8tcND9ZqXajD5B/ZzaoGYNzL4D3eDue6vAOUvwzu42G+19JNVUA==\"\n      },\n      \"StyleCop.Analyzers.Unstable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.2.0.556\",\n        \"contentHash\": \"zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==\"\n      },\n      \"System.Collections.Immutable\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"AurL6Y5BA1WotzlEvVaIDpqzpIPvYnnldxru8oXJU2yFxFUy3+pNXjXd1ymO+RA0rq0+590Q8gaz2l3Sr7fmqg==\"\n      },\n      \"System.Composition\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"3Djj70fFTraOarSKmRnmRy/zm4YurICm+kiCtI0dYRqGJnLX6nJ+G3WYuFJ173cAPax/gh96REcbNiVqcrypFQ==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\",\n          \"System.Composition.Convention\": \"9.0.0\",\n          \"System.Composition.Hosting\": \"9.0.0\",\n          \"System.Composition.Runtime\": \"9.0.0\",\n          \"System.Composition.TypedParts\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.AttributedModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"iri00l/zIX9g4lHMY+Nz0qV1n40+jFYAmgsaiNn16xvt2RDwlqByNG4wgblagnDYxm3YSQQ0jLlC/7Xlk9CzyA==\"\n      },\n      \"System.Composition.Convention\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"+vuqVP6xpi582XIjJi6OCsIxuoTZfR0M7WWufk3uGDeCl3wGW6KnpylUJ3iiXdPByPE0vR5TjJgR6hDLez4FQg==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.Hosting\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"OFqSeFeJYr7kHxDfaViGM1ymk7d4JxK//VSoNF9Ux0gpqkLsauDZpu89kTHHNdCWfSljbFcvAafGyBoY094btQ==\",\n        \"dependencies\": {\n          \"System.Composition.Runtime\": \"9.0.0\"\n        }\n      },\n      \"System.Composition.Runtime\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"w1HOlQY1zsOWYussjFGZCEYF2UZXgvoYnS94NIu2CBnAGMbXFAX8PY8c92KwUItPmowal68jnVLBCzdrWLeEKA==\"\n      },\n      \"System.Composition.TypedParts\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"9.0.0\",\n        \"contentHash\": \"aRZlojCCGEHDKqh43jaDgaVpYETsgd7Nx4g1zwLKMtv4iTo0627715ajEFNpEEBTgLmvZuv8K0EVxc3sM4NWJA==\",\n        \"dependencies\": {\n          \"System.Composition.AttributedModel\": \"9.0.0\",\n          \"System.Composition.Hosting\": \"9.0.0\",\n          \"System.Composition.Runtime\": \"9.0.0\"\n        }\n      },\n      \"System.Configuration.ConfigurationManager\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"7T+m0kDSlIPTHIkPMIu6m6tV6qsMqJpvQWW2jIc2qi7sn40qxFo0q+7mEQAhMPXZHMKnWrnv47ntGlM/ejvw3g==\",\n        \"dependencies\": {\n          \"System.Security.Cryptography.ProtectedData\": \"6.0.0\",\n          \"System.Security.Permissions\": \"6.0.0\"\n        }\n      },\n      \"System.Diagnostics.DiagnosticSource\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.0.0\",\n        \"contentHash\": \"tCQTzPsGZh/A9LhhA6zrqCRV4hOHsK90/G7q3Khxmn6tnB1PuNU0cRaKANP2AWcF9bn0zsuOoZOSrHuJk6oNBA==\"\n      },\n      \"System.Diagnostics.EventLog\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"lcyUiXTsETK2ALsZrX+nWuHSIQeazhqPphLfaRxzdGaG93+0kELqpgEHtwWOlQe7+jSFnKwaCAgL4kjeZCQJnw==\"\n      },\n      \"System.Drawing.Common\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"NfuoKUiP2nUWwKZN6twGqXioIe1zVD0RIj2t976A+czLHr2nY454RwwXs6JU9Htc6mwqL6Dn/nEL3dpVf2jOhg==\",\n        \"dependencies\": {\n          \"Microsoft.Win32.SystemEvents\": \"6.0.0\"\n        }\n      },\n      \"System.Reflection.Metadata\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"ptvgrFh7PvWI8bcVqG5rsA/weWM09EnthFHR5SCnS6IN+P4mj6rE1lBDC4U8HL9/57htKAqy4KQ3bBj84cfYyQ==\",\n        \"dependencies\": {\n          \"System.Collections.Immutable\": \"8.0.0\"\n        }\n      },\n      \"System.Security.AccessControl\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"AUADIc0LIEQe7MzC+I0cl0rAT8RrTAKFHl53yHjEUzNVIaUlhFY11vc2ebiVJzVBuOzun6F7FBA+8KAbGTTedQ==\"\n      },\n      \"System.Security.Cryptography.Pkcs\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.1\",\n        \"contentHash\": \"CoCRHFym33aUSf/NtWSVSZa99dkd0Hm7OCZUxORBjRB16LNhIEOf8THPqzIYlvKM0nNDAPTRBa1FxEECrgaxxA==\"\n      },\n      \"System.Security.Cryptography.ProtectedData\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"+TUFINV2q2ifyXauQXRwy4CiBhqvDEDZeVJU7qfxya4aRYOKzVBpN+4acx25VcPB9ywUN6C0n8drWl110PhZEg==\"\n      },\n      \"System.Security.Permissions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"T/uuc7AklkDoxmcJ7LGkyX1CcSviZuLCa4jg3PekfJ7SU0niF0IVTXwUiNVP9DSpzou2PpxJ+eNY2IfDM90ZCg==\",\n        \"dependencies\": {\n          \"System.Security.AccessControl\": \"6.0.0\",\n          \"System.Windows.Extensions\": \"6.0.0\"\n        }\n      },\n      \"System.Windows.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"6.0.0\",\n        \"contentHash\": \"IXoJOXIqc39AIe+CIR7koBtRGMiCt/LPM3lI+PELtDIy9XdyeSrwXFdWV9dzJ2Awl0paLWUaknLxFQ5HpHZUog==\",\n        \"dependencies\": {\n          \"System.Drawing.Common\": \"6.0.0\"\n        }\n      },\n      \"sonaranalyzer.cfg\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer.Lightup\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.core\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Google.Protobuf\": \"[3.6.1, )\",\n          \"Microsoft.CodeAnalysis.Workspaces.Common\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.CFG\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.shimlayer.lightup\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[1.3.2, )\",\n          \"Microsoft.Composition\": \"[1.0.27, )\",\n          \"SonarAnalyzer.ShimLayer\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      },\n      \"sonaranalyzer.testframework\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Combinatorial.MSTest\": \"[2.0.0, )\",\n          \"FluentAssertions\": \"[7.2.1, )\",\n          \"FluentAssertions.Analyzers\": \"[0.34.1, )\",\n          \"MSTest.TestAdapter\": \"[4.2.1, )\",\n          \"MSTest.TestFramework\": \"[4.2.1, )\",\n          \"Microsoft.Build.Locator\": \"[1.11.2, )\",\n          \"Microsoft.CodeAnalysis.CSharp.Workspaces\": \"[5.3.0, )\",\n          \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": \"[5.3.0, )\",\n          \"Microsoft.CodeAnalysis.Workspaces.MSBuild\": \"[5.3.0, )\",\n          \"Microsoft.NET.Test.Sdk\": \"[18.4.0, )\",\n          \"NSubstitute\": \"[5.3.0, )\",\n          \"NuGet.Protocol\": \"[7.3.1, )\",\n          \"SonarAnalyzer.Core\": \"[10.26.0, )\",\n          \"altcover\": \"[9.0.102, )\"\n        }\n      },\n      \"sonaranalyzer.visualbasic.core\": {\n        \"type\": \"Project\",\n        \"dependencies\": {\n          \"Microsoft.CodeAnalysis.VisualBasic.Workspaces\": \"[1.3.2, )\",\n          \"SonarAnalyzer.CFG\": \"[10.26.0, )\",\n          \"SonarAnalyzer.Core\": \"[10.26.0, )\",\n          \"System.Collections.Immutable\": \"[1.1.37, )\"\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "azure-pipelines.yml",
    "content": "trigger:\n- master\n\npool: .net-bubble-aws-re-team-prod\n\nvariables:\n  - group: sonar-dotnet-variables\n  - group: sonarsource-build-variables\n  - group: artifactory_access\n  # ~https://github.com/SonarSource/re-ci-images/blob/master/docker/mvn/settings-private.xml\n  - name: ARTIFACTORY_PRIVATE_USERNAME\n    value: $[variables.ARTIFACTORY_PRIVATE_READER_USERNAME]\n  - name: ARTIFACTORY_QA_READER_USERNAME\n    value: $[variables.ARTIFACTORY_PRIVATE_READER_USERNAME]\n  - name: UnitTestResultsPath\n    value: '$(Build.SourcesDirectory)\\TestResults'\n  - name: CoveragePath\n    value: '$(Build.SourcesDirectory)\\coverage'\n  - name: UnitTestExclusionsPattern\n    value: 'analyzers/tests/SonarAnalyzer.Test/TestCases/**/*'\n  - name: CpdExclusionsPattern\n    value: 'analyzers/rspec/**'\n\nresources:\n  repositories:\n    - repository: pipelines-yaml-templates\n      type: git\n      name: pipelines-yaml-templates\n      ref:  refs/tags/v3.0.0\n\nstages:\n- stage: build\n  displayName: 'Build:'\n  jobs:\n  - job: build\n    displayName: 'Build'\n    workspace:\n      clean: all\n\n    steps:\n    - powershell: Rename-Item \"analyzers/CI.NuGet.Config\" -NewName \"NuGet.Config\"\n      displayName: \"Prepare NuGet.Config\"\n\n    - task: CmdLine@2\n      displayName: \"NuGet Restore\"\n      env:\n        ARTIFACTORY_USER: $(ARTIFACTORY_PRIVATE_READER_USERNAME)\n        ARTIFACTORY_PASSWORD: $(ARTIFACTORY_PRIVATE_READER_ACCESS_TOKEN)\n      inputs:\n        targetType: 'inline'\n        script: 'dotnet restore --locked-mode --configfile analyzers\\NuGet.Config $(solution)'\n\n    - powershell: .\\scripts\\build\\store-azp-variables.ps1\n      displayName: \"Store AZP Variables\"\n\n    - publish: $(Agent.BuildDirectory)/Azp-Variables\n      artifact: Azp-Variables\n      displayName: \"Publish AZP Variables as pipeline artifact\"\n\n    - template: set-azp-variables-steps.yml@pipelines-yaml-templates\n\n    - powershell: .\\scripts\\set-version.ps1 -Version $(SHORT_VERSION) -BuildNumber $(Build.BuildId) -Branch $(Build.SourceBranchName) -Sha1 $(Build.SourceVersion)\n      displayName: \"Set Version\"\n\n    - task: SonarCloudPrepare@3\n      displayName: '.NET Code Analysis - Begin'\n      inputs:\n        SonarCloud: 'SonarCloud'\n        organization: 'sonarsource'\n        scannerMode: dotnet\n        projectKey: 'sonaranalyzer-dotnet'\n        projectName: 'Sonar .NET Analyzer'\n        projectVersion: '$(SHORT_VERSION)'\n        extraProperties: |\n          sonar.verbose=true\n          sonar.cs.opencover.reportsPaths=\"$(CoveragePath)/*.xml\"\n          sonar.cs.vstest.reportsPaths=\"$(UnitTestResultsPath)/*.trx\"\n          sonar.test.exclusions=\"$(UnitTestExclusionsPattern)\"\n          sonar.cpd.exclusions=$(CpdExclusionsPattern)\n\n    - powershell: |\n        $ProjectNameToken = '$(ProjectName)'  # Workaround for escaping difficulties: Azure DevOps doesn't have ProjectName, so it will not replace it. We need to pass it like that into AltCover via powershell.\n        dotnet build --no-restore analyzers\\src\\SonarAnalyzer.ShimLayer.Generator\\SonarAnalyzer.ShimLayer.Generator.csproj -c $(BuildConfiguration) # Needs a pre-build to prevent file locking issue in SonarAnalyzer.ShimLayer.Generator.Test\n        dotnet test --no-restore $(Solution) -c $(BuildConfiguration) -l trx --results-directory $(UnitTestResultsPath) /p:RunAnalyzers=true /p:AltCover=true,AltCoverForce=true,AltCoverVisibleBranches=true,AltCoverAssemblyFilter=\"testhost|Moq|Humanizer|AltCover|Microsoft|\\.Test^\",AltCoverPathFilter=\"SonarAnalyzer\\.CFG\\\\ShimLayer|SonarAnalyzer\\.ShimLayer\\.CodeGeneration\",AltCoverAttributeFilter=\"ExcludeFromCodeCoverage\",AltCoverReport=\"$(CoveragePath)/coverage.$ProjectNameToken.xml\"\n      displayName: '.NET UTs'\n      env:\n        ARTIFACTORY_USER: $(ARTIFACTORY_PRIVATE_READER_USERNAME)\n        ARTIFACTORY_PASSWORD: $(ARTIFACTORY_PRIVATE_READER_ACCESS_TOKEN)\n\n    - powershell: |\n        dotnet build analyzers\\src\\RuleDescriptorGenerator\\RuleDescriptorGenerator.csproj -c $(BuildConfiguration) /p:RunAnalyzers=true # This does not have a test project => we need to build it separately\n      displayName: '.NET RuleDescriptor Build'\n\n    - task: PublishTestResults@2\n      condition: always()\n      displayName: 'Publish test results'\n      inputs:\n        testRunner: VSTest\n        testResultsFiles: '*.trx'\n        searchFolder: '$(UnitTestResultsPath)'\n        testRunTitle: '$(Agent.JobName)'\n\n    - script: |\n        nuget pack analyzers/packaging/SonarAnalyzer.CFG.nuspec -Version $(FULL_VERSION) -Properties Configuration=$(BuildConfiguration) -OutputDirectory $(Build.ArtifactStagingDirectory)/packages -Verbosity Detailed\n        nuget pack analyzers/packaging/SonarAnalyzer.CSharp.nuspec -Version $(FULL_VERSION) -Properties Configuration=$(BuildConfiguration) -OutputDirectory $(Build.ArtifactStagingDirectory)/packages -Verbosity Detailed\n        nuget pack analyzers/packaging/SonarAnalyzer.CSharp.Styling.nuspec -Version $(FULL_VERSION) -Properties Configuration=$(BuildConfiguration) -OutputDirectory $(Build.ArtifactStagingDirectory)/packages -Verbosity Detailed\n        nuget pack analyzers/packaging/SonarAnalyzer.VisualBasic.nuspec -Version $(FULL_VERSION) -Properties Configuration=$(BuildConfiguration) -OutputDirectory $(Build.ArtifactStagingDirectory)/packages -Verbosity Detailed\n      displayName: \"Build NuGet packages\"\n\n    - task: SonarCloudAnalyze@3\n      displayName: '.NET Code Analysis - End'\n\n    - task: DownloadSecureFile@1\n      displayName: 'Download Maven settings'\n      name: mavenSettings\n      inputs:\n        secureFile: 'maven-settings.xml'\n\n    - task: SonarCloudPrepare@3\n      displayName: 'Prepare code analysis for Java plugin'\n      inputs:\n        SonarCloud: 'SonarCloud'\n        organization: 'sonarsource'\n        scannerMode: 'Other'\n\n    - task: Maven@4\n      displayName: 'Maven build'\n      env:\n        ARTIFACTORY_PRIVATE_READER_USERNAME: $(ARTIFACTORY_PRIVATE_READER_USERNAME)\n        ARTIFACTORY_PRIVATE_READER_PASSWORD: $(ARTIFACTORY_PRIVATE_READER_ACCESS_TOKEN)\n      inputs:\n        goals: 'verify'\n        options: -B --settings $(mavenSettings.secureFilePath) -Pcoverage -Dsonar.projectVersion=$(SHORT_VERSION) -Denable-repo=private\n        publishJUnitResults: true\n        testResultsFiles: '**/surefire-reports/TEST-*.xml'\n        testRunTitle: '$(Agent.JobName)'\n        javaHomeOption: 'JDKVersion'\n        jdkVersionOption: '1.21'\n        mavenOptions: $(MAVEN_OPTS)\n        sonarQubeRunAnalysis: true\n        sqMavenPluginVersionChoice: 'latest'\n\n    - task: CopyFiles@2\n      displayName: \"Copy C# Jars to publish directory\"\n      inputs:\n        Contents: '*.jar'\n        SourceFolder: 'sonar-csharp-plugin/target'\n        TargetFolder: 'plugin-jars/sonar-csharp-plugin'\n\n    - task: CopyFiles@2\n      displayName: \"Copy VB.NET Jars to publish directory\"\n      inputs:\n        Contents: '*.jar'\n        SourceFolder: 'sonar-vbnet-plugin/target'\n        TargetFolder: 'plugin-jars/sonar-vbnet-plugin'\n\n    - publish: plugin-jars\n      artifact: plugin-jars\n      displayName: \"Publish Jars as build artifacts\"\n\n    - publish: '$(Build.ArtifactStagingDirectory)/packages'\n      artifact: 'NuGet Packages'\n      displayName: 'Publish NuGet packages as build artifacts'\n\n    - task: SonarCloudPublish@3\n      displayName: 'Code Analysis - Publish QG'\n      inputs:\n        pollingTimeoutSec: '300'\n"
  },
  {
    "path": "docs/code-of-conduct.md",
    "content": "## Our Pledge\n\nIn the interest of fostering an open and welcoming environment, we as\ncontributors and maintainers pledge to making participation in our project and\nour community a harassment-free experience for everyone, regardless of age, body\nsize, disability, ethnicity, gender identity and expression, level of experience,\nnationality, personal appearance, race, religion, or sexual identity and\norientation.\n\n## Our Standards\n\nExamples of behavior that contributes to creating a positive environment\ninclude:\n\n* Using welcoming and inclusive language\n* Being respectful of differing viewpoints and experiences\n* Gracefully accepting constructive criticism\n* Focusing on what is best for the community\n* Showing empathy towards other community members\n\nExamples of unacceptable behavior by participants include:\n\n* The use of sexualized language or imagery and unwelcome sexual attention or\n  advances\n* Trolling, insulting/derogatory comments, and personal or political attacks\n* Public or private harassment\n* Publishing others' private information, such as a physical or electronic\n  address, without explicit permission\n* Other conduct which could reasonably be considered inappropriate in a\n  professional setting\n\n## Our Responsibilities\n\nProject maintainers are responsible for clarifying the standards of acceptable\nbehavior and are expected to take appropriate and fair corrective action in\nresponse to any instances of unacceptable behavior.\n\nProject maintainers have the right and responsibility to remove, edit, or\nreject comments, commits, code, wiki edits, issues, and other contributions\nthat are not aligned to this Code of Conduct, or to ban temporarily or\npermanently any contributor for other behaviors that they deem inappropriate,\nthreatening, offensive, or harmful.\n\n## Scope\n\nThis Code of Conduct applies both within project spaces and in public spaces\nwhen an individual is representing the project or its community. Examples of\nrepresenting a project or community include using an official project e-mail\naddress, posting via an official social media account, or acting as an appointed\nrepresentative at an online or offline event. Representation of a project may be\nfurther defined and clarified by project maintainers.\n\n## Enforcement\n\nInstances of abusive, harassing, or otherwise unacceptable behavior may be\nreported by contacting the project team at [Community Forum](https://community.sonarsource.com/). All\ncomplaints will be reviewed and investigated and will result in a response that\nis deemed necessary and appropriate to the circumstances. The project team is\nobligated to maintain confidentiality with regard to the reporter of an incident.\nFurther details of specific enforcement policies may be posted separately.\n\nProject maintainers who do not follow or enforce the Code of Conduct in good\nfaith may face temporary or permanent repercussions as determined by other\nmembers of the project's leadership.\n\n## Attribution\n\nThis Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,\navailable at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html\n\n[homepage]: https://www.contributor-covenant.org\n"
  },
  {
    "path": "docs/coding-style.md",
    "content": "﻿# Coding Style\n\n## General\n\nWhen contributing to the project, and if otherwise not mentioned in this document, our coding conventions\nfollow the Microsoft [C# Coding Conventions](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/inside-a-program/coding-conventions)\nand standard [Naming Guidelines](https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/naming-guidelines).\n\nLess is more - keep it simple.\n\nTwo is a group, three is a crowd - guideline for when to extract similar logic.\n\n## Class Members\n\nMembers and types should always have the lowest possible visibility.\n\nOrdering of class members should be the following:\n\n1. Constants\n1. Nested enum declarations\n1. Fields\n1. Abstract members\n1. Properties\n1. Constructors\n1. Methods \n1. Nested types\n\nFurthermore, each of these categories should be ordered from higher to lower accessibility level (public, internal, protected, private).\n\nStatic fields and properties should be placed before instance ones. \n\nStatic methods are preferred to be after instance methods.\n\nOnce grouped as specified above, methods which are called by other methods in the same group should be placed below the callers.\n\n```csharp\npublic int PublicMethod() => 42;\n\nint CallerOne() => Leaf();\n\nint CallerTwo() => Leaf() + PublicMethod();\n\nint Leaf() =>  42;\n```\n\n### Local functions\n\nThere are no strict rules on when to use local functions. It should be decided on a case-by-case basis.\n\nBy default, you should prefer methods over local functions. Use local functions if it makes the code significantly easier to understand. For example:\n- Accessing the method's local state directly, instead of using parameters, reduces noise.\n- The name of the function would not make sense at the class level.\n\nLocal functions should always be placed at the end of a method.\n\n```csharp\npublic int MethodWithLocalFunction(int x)\n{\n    return LocalFunction(x);\n    \n    int LocalFunction(int x) => x;\n}\n```\n\n### Separation\n\nIndividual members must be separated by empty line, except sequence of constants, fields, single-line properties and abstract members. These members should not be separated by empty lines.\n\n```csharp\nprivate const int ValueA = 42;\nprivate const int ValueB = 24;\n\nprivate int valueA;\nprivate int valueB;\n\nprotected abstract int AbstractA { get; }\nprotected abstract void AbstractB();\n\npublic SemanticModel Model { get; }\npublic SyntaxNode Node { get; }\n\npublic int ComplexProperty\n{\n    get => 42;\n    set\n    {\n        // ...\n    }\n}\n\npublic Constructor() { }\n\npublic void MethodA() =>\n    MethodB();\n\npublic void MethodB()\n{\n    // ...\n}\n```\n\n## Naming conventions\n\nUse minimal and valuable names.\n\nDon't use 'Get' method prefixes. Omit it in most of the cases, or use a true verb like `Create`, `Find`, etc.\n\nGeneric words in class names that don't convey meaning (e.g. `Helper`) should be avoided. Overwordy and complex names should be avoided as well.\n\nSingle variable lambdas should use `x` as the variable name (based on lambda calculus λx). Multi variable lambdas should use descriptive names, where `x` can be used for the main iterated item like `(x, index) => ...`. Name `c` can be used for context of Roslyn callback.\n\nShort names can be used as parameter and variable names, namely `SyntaxTree tree`, `SemanticModel model`, `SyntaxNode node` and `CancellationToken cancel`.\n\nAll PowerShell names (parameters, variables, methods, ...) use PascalCasing.\n\n### Unit Tests\n\nUnit tests for common C# and VB.NET rules should use two aliases `using CS = SonarAnalyzer.Rules.CSharp` and `using VB = SonarAnalyzer.Rules.VisualBasic`. Test method names should have `_CS` and `_VB` suffixes.\n\nUnit tests for single language rule should not use alias nor language method suffix.\n\nUnit test namespaces should be the same as the tested production code, with a `.Test` suffix to avoid adding boring `using` statements, e.g. `SonarAnalyzer.Core.Test` project will have `SonarAnalyzer.Core.AnalysisContext.Test` to test classes from `AnalysisContext` namespace.\n\nUnderscore in UT names separates logical groups (tested method, scenario, optionally expected outcome), not individual words.\n\nVariable name `sut` (System Under Test) is recommended in unit tests that really tests a single unit (contrary to our usual rule integration unit tests).\n\nUse semantic names in test cases like `class Sample { }`, `void Method()`, `WithAttribute()`, `Overriden()`, etc. describing the purpose instead of `foo`, `bar`, etc.\n\n## Multi-line statements\n\n* Operators (`&&`, `||`, `and`, `or`, `+`, `:`, `?`, `??` and others) are placed at the beginning of a line.\n    * Indented at the same level if the syntax at the beginning of the previous line is a sibling.\n      ```csharp\n      bool Method() =>\n          A\n          && B; // A and B are siblings => we don't indent\n      ```\n    * Indented one level further otherwise.  \n      ```csharp\n      return A\n          && B; // \"return\" is the parent of A and B => we indent\n      ```\n* Dot before an invocation `.Method()` is placed at the beginning of a line.\n* The comma separating arguments is placed at the end of a line.\n* Method declaration parameters should be on the same line. If S103 is violated, parameters should be placed each on a separate line; the first parameter should be on the same line with the declaration; the other parameters should be aligned with the first parameter.\n    ```csharp\n    public void MethodWithManyParameters(int firstParameter,\n                                         string secondParameter,\n                                         Function<int, string, string> complexParameter);\n    ```\n* Long ternary operator statements should have `?` and `:` on separate lines, aligned with a left-most single indentation.\n    ```csharp\n    object.Property is SomeType something\n    && something.AnotherProperty is OtherType other\n    && other.Value == 42\n        ? object.Parent.Value\n        : object;\n    ```\n* Chained invocations and member accesses violating S103 can have a chain of properties on the first line. Every other `.Invocation()` or `.Member` should be on a separate line, aligned with a left-most single indendation.\n    ```csharp\n    object.Property.Children\n        .Select(x => x.Something)\n        .Where(x => x != null)\n        .OrderBy(x => x.Rank)\n        .ToArray()\n        .Length;\n    ```\n  * Exception from this rule: Chains of assertions can have supporting properties, `.Should()` and assertion on the same line.\n    ```csharp\n    values.Should().HaveCount(2)\n        .And.ContainSingle(x => x.HasConstraint(BoolConstraint.True))\n        .And.ContainSingle(x => x.HasConstraint(BoolConstraint.False));\n    ```\n* Method invocation arguments should be placed on the same line only when they are few and simple. Otherwise, they should be placed on separate lines. The first argument should be on a separate line, aligned with a left-most single indendation.\n    ```csharp\n    object.MethodName(\n        firstArgument,\n        x => x.Bar(),\n        thirdArgument.Property);\n    ```\n  * Exception from this rule: chained LINQ queries where the alignment of parameter expressions should be right-most.\n    ```csharp\n    someEnumerable.Where(x => x.Condition1\n                              && x.Condition2);\n    ```\n  * Exception from this rule: Lambda parameter name and arrow token should be on the same line as the invocation.\n    ```\n    context.RegisterSyntaxNodeAction(c =>\n        {\n            // Action\n        }\n    ```\n* When using an arrow property or an arrow method, the `=>` token must be on the same line as the declaration. Regarding the expression body:\n  * for properties: it should be on the same line as the property declaration. It should be on the following line only when it is too long and would trigger S103.\n  * for methods: it should be on the same line only for trivial cases: literal or simple identifier. Member access, indexer, invocation, and other complex structures should be on the following line.\n\n## Code structure\n\n* Field and property initializations are done directly in the member declaration instead of in a constructor.\n* `if`/`else if` and explicit `else` is used\n  * when it helps to understand overall structure of the method,\n  * especially when each branch ends with a `return` statement.\n* Explicit `else` is not used after input validation.\n* For multiple conditions before the core method logic:\n  * chain conditions in the same `if` statement together with positive logic for best readability (i.e. `if (first && second) { DoSomething(); }`) \n  * when chained conditions cannot be used, use early returns\n  * otherwise, use nested conditions\n* Use positive logic.\n* Use `is null` and `is not null`.\n* Var pattern `is var o` can be used only where variable declarations would require additional nesting.\n* Var pattern `o is { P: var p }` can be used only where `o` can be `null` and `p` is used at least 3 times.\n* Do not use `nullable`.\n* Use `var`, also for `var value = new SomeType();`. Do not use `SomeType value = new();`.\n* Avoid single-use variables, unless they really bring readability value.\n* Avoid primary constructors on normal classes.\n* Avoid empty lines inside methods, unless they bring significant clarity in separating major logical parts (like before assertion in UTs).\n* Avoid Linq query syntax.\n* Tested variable is on the left, like `iterated == 42` or `iterated == searchParameter`.\n* Use fields instead of auto-implemented private or protected properties.\n* Use raw string literals for multi-line strings.\n  ```\n  const string code = \"\"\"\n      First(\"line\");\n      Another(\"line\");\n      \"\"\";\n   ```\n\n## Comments\n\n* Code should contain as few comments as necessary in favor of well-named members and variables.\n* Comments should generally be on separate lines.\n* Comments on the same line with code are acceptable for short lines of code and short comments.\n* Documentation comments for abstract methods and their implementations should be placed only on the abstract method, to avoid duplication. _When reading the implementation, the IDE offers the tooling to peek in the base class and read the method comment._\n* Prefer well-named methods instead of documentation.\n* Avoid superfluous documentation tags, like `<param>` for parameters with obvious name.\n* Avoid using comments for `// Arrange`, `// Act` and `// Assert` in UTs.\n\n## FIXME and ToDo\n\n* `FIXME` should only be used in the code during development as a temporary reminder that there is still work to\nbe done here. A `FIXME` should never appear in a PR or be merged into master.\n\n* `ToDo` can be used to mark part of the code that will need to be updated at a later time. It can be used to\ntrack updates that should be done at some point, but that either cannot be done at that moment, or can be fixed later.\nIdeally, a `ToDo` comment should be followed by an issue number (what needs to be done should be in the github issues).\n\n## Unit Tests\n\n* `VerifierBuilder.AddSnippet` can only be used to assert Compliant/Noncompliant case in parametrized test. Everything else should be in a TestCases file.\n* Avoid empty lines between the `Act` and `Assert` sections. Empty lines beteween the `Arrange` and `Act` sections are encouraged, if possible.\n\n## Regions\n\nGenerally, as we do not want to have classes that are too long, regions are not necessary and should be avoided.\nIt can still be used when and where it makes sense. For instance, when a class having a specific purpose is\nimplementing generic interfaces (such as `IComparable`, `IDisposable`), it can make sense to have regions \nfor the implementation of these interfaces.\n\n## ValueTuples\n\nDo not use `ValueTuples` in production code. The usage in test projects is fine. `ValueTuples` are not supported in MsBuild 14 and while MsBuild 14 is not officially supported anymore, we still don't want to break it, if we can avoid it.\n\n## VB.NET Specifics\n\nEmpty lines should be used between blocks, `Namespace`/`End Namespace` statements, `Class`/`End Class` statements\nand regions to improve readability.\n\n## Test scenarios files\n\nFor any C# rule `TheRule`, there should be at least two test scenarios files:\n* `TheRule.cs`, targeting both .NET Framework and .NET Core and using the default version of C#\n* `TheRule.Latest.cs`, targeting .NET Core only (via `# if NET`) and using the latest version of C#\n\nMore test scenarios files can be created as needed, for code fixes, top-level statements etc.\n\nIn the past, test scenarios were split by language version (e.g. `TheRule.CSharpX.cs`). These files should be migrated, following a Clean as You Code approach.\n"
  },
  {
    "path": "docs/contributing-analyzer.md",
    "content": "# Building, Testing and Debugging the .NET Analyzer\n\nAll C# and VB.NET code analyzers present in SonarQube are being developed here. These analyzers rely on Roslyn 1.3.2 API.\n\nBefore following any of the guides below, if you are external contributor you need to delete `analyzers\\NuGet.Config`.\n\n## Working with the code\n\n1. Clone [this repository](https://github.com/SonarSource/sonar-dotnet.git)\n1. Open `analyzers\\SonarAnalyzer.sln`\n\n## Developing with Visual Studio 2022 or Rider\n\nVisual Studio 2022 version 17.6+ is required to build the project (due to source generators) and run the unit tests.\n\n1. [Visual Studio 2022](https://visualstudio.microsoft.com/vs/) or [Rider](https://www.jetbrains.com/rider/download)\n1. When using Visual Studio, ensure to install the following Workloads:\n    - ASP.NET and web development\n    - .NET desktop development\n    - Visual Studio extension development\n1. Ensure to install *Individual components*:\n    - .NET Framework 4.8 SDK\n    - .NET Framework 4.8 Targeting pack\n    - .NET Framework 4.7.2 Targeting pack\n    - .NET SDK\n    - .NET Compiler Platform SDK\n1. The following environment variables must be set:\n    - **JAVA_HOME** (e.g. `C:\\Program Files\\Java\\jdk-11.0.2`)\n    - **MSBUILD_PATH** - path to the MSBuild.exe executable (MSBuild 16 e.g. `C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin\\MSBuild.exe`)\n    - **NUGET_PATH** - path to the nuget.exe executable (related to the [plugin integration tests](./contributing-analyzer.md#java-its) \n    - **PATH** - the **PATH** variable must contain (*system* scope):\n        - dotnet core installation folder (`C:\\Program Files\\dotnet\\`)\n        - MSBuild bin folder (`C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin`)\n        - visual studo installer folder (for vswhere.exe) (`C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer`)\n        - nuget executable folder (`C:\\Program Files\\nuget`)\n        - JDK bin folder (`C:\\Program Files\\Java\\jdk-11.0.2\\bin`)\n        - %M2_HOME%\\bin (`C:\\Program Files\\JetBrains\\IntelliJ IDEA\\plugins\\maven\\lib\\maven3\\bin` [Maven cli](https://maven.apache.org/install.html). Here installed via IntelliJ IDEA.)\n        - SonarScanner for .NET folder and to the Scanner CLI ([SonarScanner download](https://github.com/SonarSource/sonar-scanner-msbuild/releases))\n    -  **Sonar internal only** These two steps require access to SonarSource internal resources and are not possible for external contributors\n        - **ORCHESTRATOR_CONFIG_URL** - url to `orchestrator.properties` file (for integration tests) in uri form (i.e. `file:///c:/something/orchestrator.properties`). See also: [Documentation in the orchestrator repository](https://github.com/sonarsource/orchestrator#configuration)\n        - **ARTIFACTORY_USER** your repox.jfrog username (see e.g. `orchestrator.properties`)\n        - **ARTIFACTORY_PASSWORD** the identity token for repox.jfrog.\n1. Open `analyzers/SonarAnalyzer.sln`\n\n## Tests\n\n### Running Unit Tests\n\nYou can run the Unit Tests via the Test Explorer of Visual Studio or using `dotnet test analyzers\\SonarAnalyzer.sln`\n\n### Writing Unit Tests\n\nRule tests are written in source files and setup like this:\n\n```cs\npublic class MyAnalyzerTest\n{\n    private readonly VerifierBuilder verifier = new VerifierBuilder<MyAnalyzer>();\n\n    [TestMethod]\n    public void MyAnalyzer_CSharp10()\n    {\n        verifier\n            .AddPaths(\"MyAnalyzer.CSharp10.cs\") // searched in analyzers\\tests\\SonarAnalyzer.Test\\TestCases\\\n            .AddReferences(MetadataReferenceFacade.SystemData);\n            .WithOptions(ParseOptionsHelper.FromCSharp10)\n            .Verify();\n    }\n}\n```\n\nIn the test files [special annotations](verifier-syntax.md) are used to describe the non-compliant code.\n\n```cs\n    private void MyMethod() // Noncompliant {{Remove this unused private method}}\n    //           ^^^^^^^^\n```\n\n### Integration Tests\n\n#### Types of tests\n\nFor most projects, there are JSON files in the [expected](../analyzers/its/expected) folder with expected issues. One JSON file per rule.\n\nFor the [ManuallyAddedNoncompliantIssues](../analyzers/its/sources/ManuallyAddedNoncompliantIssues) project, we verify for each file the issues for one specific rule - like we do for Unit Tests. The first occurrence must specify the rule ID (`// Noncompliant (S9999)`), and the next occurrences can only have `// Noncompliant`. If multiple rules are raising issues in that file, they will be ignored. The framework can only verify one rule per file. Look at some files inside the **ManuallyAddedNoncompliantIssues** project.\n\nThe same applies for **ManuallyAddedNoncompliantIssuesVB**.\n\nFor details on how the parsing works, read the [regression-test.ps1](../analyzers/its/regression-test.ps1) script.\n\n#### Running the tests\nTo run the ITs you will need to follow this pattern:\n\n1. Make sure the project is built: Integration tests don't build the analyzer, but use the results of the latest build (debug or release)\n1. Open the `Developer Command Prompt for VS2022` from the start menu\n1. Go to `PATH_TO_CLONED_REPOSITORY/analyzers/its`\n1. Run `powershell`\n1. Run `.\\regression-test.ps1`\n\nNotes: \n\n1. You can run a single rule using the `-ruleId` parameter (e.g. `.\\regression-test.ps1 -ruleId S1234`)\n1. You can run a single project using the `-project` parameter (e.g. `.\\regression-test.ps1 -project Nancy`)\n\nIf the script ends with `SUCCESS: No differences were found!` (or exit code 0), this means the changes you have made haven't impacted any rule.\n\nIf the script ends with `ERROR: There are differences between the actual and the expected issues.` (or exit code 1),\nthe changes you have made have impacted one or many issues raised by the rules.\n\nNote: if you are facing compilation errors on Windows 10 due to unknown characters, disable `beta use unicode utf-8 for worldwide language support` from your `Region Settings`.\n\n#### Updating the references\nYou can run `.\\update-expected.ps1` to update the list of expected issues. Please review all added/removed/updated issues to confirm they are wanted. Only after reviewing each difference do the commit.\n\n_Note: Integration tests build the code to analyze. If you have an antivirus program on your computer, this may fail with some error messages about an executable file that cannot be open for writing. If this happens, look at the antivirus logs for confirmation, and contact IT team to add an rule to your antivirus program..._\n\n#### Manual differences review\nYou can visualize the differences using:\n\n1. `cd actual`\n1. `git diff --cached`\n\n### Debug an analysis started from the command line / Java ITs\n\nIf you want to debug the analysis of a project, you can add a [`Debugger.Launch()`](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.debugger.launch) breakpoint in the class you want to debug. Rebuild `SonarAnalyzer.sln` and link the analyzer debug binaries to the project you want to debug the analysis for.\n\n- If you are analyzing the project with the Scanner for .NET, after the begin step you can replace the binaries in the local cache (`%TEMP%\\.sonarqube\\resources\\` - the `0` folder for the C# Analyzer, the `1` folder for the VB .NET analyzer), and then run the build.\n- If you don't want to use the Scanner for .NET, you can manually reference the binaries in `analyzers/packaging/binaries/` in the {cs,vb}proj file with `<Analyzer Include=... />` items (see [Directory.Build.targets](../analyzers/its/Directory.Build.targets#L55) as an example)\n\nPlease note that if the rule is not in SonarWay, you will also need to enable it in a RuleSet file and link it in the {cs,vb}proj file with the `<CodeAnalysisRuleSet>` property (see [example](../analyzers/src/Directory.Build.targets#L8)).\n\nThis also works with the Java ITs, as long as the debug assemblies are in the folder which is used by the Java ITs.\n\nWhen running the build and doing the Roslyn analysis, when hitting the `Debugger.Launch()` line, a UI window will prompt you to choose a debugger, where your IDE should show up - you will be able to open the solution and debug.\n\nAfter the debug session, remove the `Debugger.Launch()` line.\n\n### Java ITs\n\n**Internal only**\n\n* Use IntelliJ IDEA\n  * Follow the [Code Style Configuration for Intellij](https://github.com/SonarSource/sonar-developer-toolset#code-style-configuration-for-intellij) instructions\n  * Open the root folder of the repo\n  * Make sure the `its`, `sonar-csharp-plugin`, `sonar-dotnet-core`, and `sonar-vbnet-plugin` folders are are imported as Maven modules (indicated by a blue square). Search for `pom.xml` in the folders and make it a maven project if not.\n* Create `settings.xml` in the `%USERPROFILE%\\.m2` directory. A template can be found in the [Developer box section in the extranet](https://xtranet-sonarsource.atlassian.net/wiki/spaces/DEV/pages/776711/Developer+Box#Maven-Settings). Change the username and password settings with the values from the environment variables above.\n* Run `mvn install clean -DskipTests=true` in the respective directories (pom.xml).\n* Use the IDE to run unit tests in the projects.\n\n## Contributing\n\nPlease see the [How to contribute](../README.md#how-to-contribute) section for details on\ncontributing changes back to the code.\n"
  },
  {
    "path": "docs/contributing-plugin.md",
    "content": "# Building, Testing and Debugging the SonarQube plugin\n\n## Setup your Java environment\n\n- Install the Java Development Kit (JDK) version 11 or later (make sure it's an LTS version) - you can install it from [here](https://www.azul.com/downloads/zulu-community/?version=java-11-lts&os=windows&architecture=x86-64-bit&package=jdk)\n- Install IntelliJ IDEA Community Edition\n- Install Apache Maven \n- Setup the Maven Settings ([internal link](https://xtranet-sonarsource.atlassian.net/wiki/spaces/DEV/pages/776711/Developer+Box))\n- Setup the Orchestrator ([internal link](https://github.com/sonarsource/orchestrator#configuration))\n\n## Working with the code\n\n1. Clone [this repository](https://github.com/SonarSource/sonar-dotnet.git)\n1. Build the plugin\n    1. `dotnet build .\\analyzers\\SonarAnalyzer.sln`\n    1. `mvn clean install`\n\n## Developing with Eclipse or IntelliJ\n\nWhen working with Eclipse or IntelliJ please follow the [sonar guidelines](https://github.com/SonarSource/sonar-developer-toolset)\n\n## Running Tests\n\nAs for any maven project, the command `mvn clean install` automatically runs the unit tests.\n\n## Contributing\n\nPlease see the [How to contribute](../README.md#how-to-contribute) section  for details on contributing changes back to the code.\n"
  },
  {
    "path": "docs/issues.md",
    "content": "# Issue tracking\n\nAll issues for C# and VB.NET code should be reported via our [Community Forum](https://community.sonarsource.com/c/clean-code/fp/7).\n\nYou're welcome to submit any issue that you've found using the C# and VB.NET code analyzers in:\n\n* [SonarQube cloud](https://www.sonarsource.com/products/sonarcloud/)\n* [SonarQube server](https://www.sonarsource.com/products/sonarqube/)\n* [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/)\n* [SonarAnalyzer.CSharp NuGet package](https://www.nuget.org/packages/SonarAnalyzer.CSharp/)\n* [SonarAnalyzer.VisualBasic Nuget package](https://www.nuget.org/packages/SonarAnalyzer.VisualBasic/)\n\nPlease report all exceptions thrown from analyzer as well as False-Positive and False-Negative behavior. Try to provide a minimal reproducible example for each case.\n\nYou can ask for help, request new rule or feature on [Community Forum](https://community.sonarsource.com/).\n\n## Implicit rules\n\n* Any issue without labels needs review.\n* Every issue containing labels is confirmed.\n"
  },
  {
    "path": "docs/regenerate-lock-files.md",
    "content": "# How to re-generate NuGet lock files\n\nIn order to correctly re-generate the lock files, please run the following:\n\n```\nnuget locals all -clear\ngit clean -xfd\ngit rm **/packages.lock.json -f\nnuget restore -LockedMode -ConfigFile \"private\\analyzers\\NuGet.Config\" private\\analyzers\\SonarAnalyzer.sln\n```\n"
  },
  {
    "path": "docs/verifier-syntax.md",
    "content": "## Unit test comment syntax\n\nThe rule unit tests use source files with special annotations in code comments to specify noncompliant code.\n\nThese annotation patterns must appear after a single line comment (the supported comment tokens: `//` for C#, `'` for VB.NET and `<!--` for XML).\n\n### `Noncompliant` primary location comment\n\nUse `Noncompliant` to mark the current line as the primary location of an expected issue.\n\n```cs\n    private void MyMethod() { } // Noncompliant\n```\n\n### Using offsets\n\nUsing `@[+-][0-9]+` after a `Noncompliant` or `Secondary` comment will mark the expected location to be offset by the given number of lines.\n\n```cs\n    private void MyMethod() { } // Noncompliant@+2 - issue is actually expected 2 lines after this comment\n```\n\n### Checking the issue message\n\nThe message raised by the issue can be checked using the `{{expected message}}` pattern.\n\n```cs\n    private void MyMethod() { } // Noncompliant {{Remove this unused private method}}\n```\n\n### Checking the precise/exact location of an issue\n\nOnly one precise location or column location can be present at one time. Precise location is used by adding `^^^^` comment under the location where the issue is expected. The alternative column location pattern can be used by following the `Noncompliant` or `Secondary` comment with `^X#Y` where `X` is the expected start column and Y the length of the issue.\n\n```cs\n    private void MyMethod() { } // Noncompliant\n//  ^^^^^^^\n\n    private void MyMethod() { } // Noncompliant ^4#7\n```\n\n### `Secondary` location comment\n\n`Secondary` is used to mark the expected line of a [secondary location](https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/src/SonarAnalyzer.Common/Common/SecondaryLocation.cs) and must be used together with a primary location.\n\n```cs\n    if (myCondition) // Noncompliant\n    {\n      var a = null; // Secondary\n    }\n```\n\n### Multiple issues per line\n\nTo declare that multiple issues are expected, each issue must be assigned an `[ID]`. All secondary locations associated with an issue must have the same ID. Use offsets to define multiple precise locations on a single line.\n\n```cs\n    var a = null;    // Noncompliant [myId2]\n    if (myCondition) // Noncompliant [myId1, myId3]\n    {\n      a = null;      // Secondary [myId1, myId2]\n    }\n\n    private void MyMethod(int i1, int i2) { }\n    //                    ^^^^^^\n    //                            ^^^^^^ @-1\n```\n\n### Compilation Errors\n\n`Error` will mark the line as the location of a compilation error. This is useful to test code snippets that cannot be compiled, as it is usually the case inside an IDE/Editor. To increase comprehensibility, the error code as well as some comments can be specified. These are ignored by the verification process.\n\n```csharp\n    string x = 2; // Error [CS0029]\n    string x = 2; // Error [CS0029] Cannot implicitly convert int to string\n    string x == 2 // Error [CS1002, CS1525]\n    // Error@+1 [CS0029] Cannot implicitly convert int to string\n    string x = 2; \n```\n\n### Combining multiple patterns\n\nNote that most of the previous patterns can be used together when needed.\n\n```cs\n    private void MyMethod() { } // Noncompliant@+1 ^4#7 [MyIssueId] {{Remove this unused private method}}\n\n    private void MyMethod(int i1, int i2) { }\n    //                    ^^^^^^             {{Message for issue 1}}\n    //                            ^^^^^^ @-1 {{Message for issue 2}}\n```\n\nThe code comment syntax logic is implemented by the [`IssueLocationCollector`](https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/tests/SonarAnalyzer.TestFramework/Verification/IssueValidation/IssueLocationCollector.cs) class.\n"
  },
  {
    "path": "global.json",
    "content": "{\n  \"sdk\": {\n    \"version\": \"10.0.100\",\n    \"rollForward\": \"latestMinor\"\n  }\n}\n"
  },
  {
    "path": "pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <parent>\n    <groupId>org.sonarsource.parent</groupId>\n    <artifactId>parent</artifactId>\n    <version>87.0.0.3057</version>\n  </parent>\n\n  <groupId>org.sonarsource.dotnet</groupId>\n  <artifactId>sonar-dotnet</artifactId>\n  <version>10.26-SNAPSHOT</version>\n  <packaging>pom</packaging>\n\n  <name>Sonar .NET Java Plugin</name>\n  <description>Code Analyzers for .NET</description>\n  <url>https://github.com/SonarSource/sonar-dotnet</url>\n  <inceptionYear>2014</inceptionYear>\n\n  <organization>\n    <name>SonarSource</name>\n    <url>http://www.sonarsource.com</url>\n  </organization>\n\n  <licenses>\n    <license>\n      <name>SSALv1</name>\n      <url>https://sonarsource.com/license/ssal/</url>\n      <distribution>repo</distribution>\n    </license>\n  </licenses>\n\n  <modules>\n    <module>sonar-dotnet-core</module>\n    <module>sonar-csharp-core</module>\n    <module>sonar-csharp-plugin</module>\n    <module>sonar-vbnet-plugin</module>\n    <module>sonar-vbnet-core</module>\n  </modules>\n\n  <scm>\n    <connection>scm:git:git@github.com:SonarSource/sonar-dotnet.git</connection>\n    <developerConnection>scm:git:git@github.com:SonarSource/sonar-dotnet.git</developerConnection>\n    <url>https://github.com/SonarSource/sonar-dotnet</url>\n    <tag>HEAD</tag>\n  </scm>\n\n  <issueManagement>\n    <system>GitHub Issues</system>\n    <url>https://github.com/SonarSource/sonar-dotnet/issues</url>\n  </issueManagement>\n\n  <properties>\n    <!-- Release: enable publication to Bintray -->\n    <artifactsToPublish>${project.groupId}:sonar-csharp-plugin:jar,${project.groupId}:sonar-vbnet-plugin:jar</artifactsToPublish>\n    <artifactsToDownload>${project.groupId}:SonarAnalyzer.CSharp:nupkg,${project.groupId}:SonarAnalyzer.VisualBasic:nupkg</artifactsToDownload>\n    <!-- We are ignoring java doc warnings - this is because we are using JDK 11. Ideally we should not do that. -->\n    <doclint>none</doclint>\n    \n    <sonar.analyzer.commons.version>2.22.0.4796</sonar.analyzer.commons.version>\n    <sonar.plugin.api.version>13.5.0.4319</sonar.plugin.api.version>\n    <sonar.api.impl.version>26.4.0.121862</sonar.api.impl.version>\n    <jdk.min.version>17</jdk.min.version>\n    <maven.compiler.release>${jdk.min.version}</maven.compiler.release>\n    <!-- See: https://github.com/SonarSource/sonar-plugin-api#compatibility -->\n    <plugin.api.min.version>9.14.0.375</plugin.api.min.version>\n\n    <!-- Test dependencies -->\n    <junit.version>6.0.3</junit.version>\n\n    <maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>\n    <sonarAnalyzer.workDirectory>${project.build.directory}/analyzer</sonarAnalyzer.workDirectory>\n    <rspec.directory>${project.build.directory}/../../analyzers/rspec</rspec.directory>\n    <packaging.directory>${project.build.directory}/../../analyzers/packaging</packaging.directory>\n    <maven.deploy.skip>false</maven.deploy.skip>\n  </properties>\n\n  <dependencyManagement>\n    <dependencies>\n      <dependency>\n        <groupId>org.sonarsource.api.plugin</groupId>\n        <artifactId>sonar-plugin-api</artifactId>\n        <version>${sonar.plugin.api.version}</version>\n        <!-- Provided at runtime by SonarQube/Cloud -->\n        <scope>provided</scope>\n      </dependency>\n      <dependency>\n        <groupId>org.sonarsource.analyzer-commons</groupId>\n        <artifactId>sonar-analyzer-commons</artifactId>\n        <version>${sonar.analyzer.commons.version}</version>\n      </dependency>\n      <dependency>\n        <groupId>org.sonarsource.sonarqube</groupId>\n        <artifactId>sonar-plugin-api-impl</artifactId>\n        <version>${sonar.api.impl.version}</version>\n        <scope>test</scope>\n      </dependency>\n      <dependency>\n        <groupId>org.sonarsource.api.plugin</groupId>\n        <artifactId>sonar-plugin-api-test-fixtures</artifactId>\n        <version>${sonar.plugin.api.version}</version>\n        <scope>test</scope>\n      </dependency>\n      <dependency>\n        <groupId>org.slf4j</groupId>\n        <artifactId>slf4j-api</artifactId>\n        <version>1.7.36</version>\n        <scope>test</scope>\n      </dependency>\n      <dependency>\n        <groupId>org.junit</groupId>\n        <artifactId>junit-bom</artifactId>\n        <version>${junit.version}</version>\n        <type>pom</type>\n        <scope>import</scope>\n      </dependency>\n      <dependency>\n        <groupId>org.junit.jupiter</groupId>\n        <artifactId>junit-jupiter-engine</artifactId>\n        <version>${junit.version}</version>\n        <scope>test</scope>\n      </dependency>\n      <dependency>\n        <groupId>org.assertj</groupId>\n        <artifactId>assertj-core</artifactId>\n        <version>3.27.7</version>\n        <scope>test</scope>\n      </dependency>\n      <dependency>\n        <groupId>org.apache.commons</groupId>\n        <artifactId>commons-lang3</artifactId>\n        <version>3.20.0</version>\n        <scope>test</scope>\n      </dependency>\n      <dependency>\n        <groupId>org.mockito</groupId>\n        <artifactId>mockito-core</artifactId>\n        <version>5.23.0</version>\n        <scope>test</scope>\n      </dependency>\n      <dependency>\n        <groupId>org.codehaus.woodstox</groupId>\n        <artifactId>stax2-api</artifactId>\n        <version>4.3.0</version>\n        <exclusions>\n          <exclusion>\n            <groupId>stax</groupId>\n            <artifactId>stax-api</artifactId>\n          </exclusion>\n        </exclusions>\n        <scope>test</scope>\n      </dependency>\n      <dependency>\n        <groupId>org.codehaus.staxmate</groupId>\n        <artifactId>staxmate</artifactId>\n        <version>2.0.1</version>\n        <scope>test</scope>\n      </dependency>\n    </dependencies>\n  </dependencyManagement>\n\n  <profiles>\n    <profile>\n      <id>sign</id>\n      <build>\n        <plugins>\n          <plugin>\n            <groupId>org.simplify4u.plugins</groupId>\n            <artifactId>sign-maven-plugin</artifactId>\n            <!-- This property is defined in the parent pom: https://github.com/SonarSource/parent/blob/66063199466a4bffd46de4780af26eb6456f996d/pom.xml#L64 -->\n            <version>${version.sign.plugin}</version>\n            <executions>\n              <execution>\n                <id>sign-artifacts</id>\n                <phase>verify</phase>\n                <goals>\n                  <goal>sign</goal>\n                </goals>\n                <configuration>\n                  <keyPass>${env.PGP_PASSPHRASE}</keyPass>\n                  <keyFile>${env.SIGNKEY_PATH}</keyFile>\n                </configuration>\n              </execution>\n            </executions>\n          </plugin>\n        </plugins>\n      </build>\n    </profile>\n  </profiles>\n</project>\n"
  },
  {
    "path": "scripts/build/build-utils.ps1",
    "content": ". (Join-Path $PSScriptRoot \"..\\utils.ps1\")\n\nfunction Get-NuGetPath {\n    return Get-ExecutablePath -name \"nuget.exe\" -envVar \"NUGET_PATH\"\n}\n\nfunction Get-VsWherePath {\n    # VsWhere is supposed to be at a fixed path, see https://github.com/Microsoft/vswhere/wiki/Installing\n    if (-not (Test-Path env:VSWHERE_PATH)) {\n         $env:VSWHERE_PATH = ${env:ProgramFiles(x86)} + '\\Microsoft Visual Studio\\Installer\\vswhere.exe'\n    }\n    return Get-ExecutablePath -name \"vswhere.exe\" -envVar \"VSWHERE_PATH\"\n}\n\nfunction Get-MsBuildPath {\n    #If MSBUILD_PATH environment variable is found, the version is not checked and the value of input parameter is ignored.\n    Write-Host \"Trying to find 'msbuild.exe' using 'MSBUILD_PATH' environment variable\"\n    $msbuildPathEnvVar = \"MSBUILD_PATH\"\n    $msbuildPath = [environment]::GetEnvironmentVariable($msbuildPathEnvVar, [System.EnvironmentVariableTarget]::Machine)\n\n    if (!$msbuildPath) {\n        Write-Host \"Environment variable ${msbuildPathEnvVar} not found\"\n        Write-Host \"Trying to find path using 'vswhere.exe'\"\n\n        # Sets the path to MSBuild into an the MSBUILD_PATH environment variable\n        # All subsequent builds after this command will use that MSBuild!\n        # Test if vswhere.exe is in your path. Download from: https://github.com/Microsoft/vswhere/releases\n        $msbuildPath = Exec { & (Get-VsWherePath) -latest -requires Microsoft.Component.MSBuild -find MSBuild\\**\\Bin\\MSBuild.exe } | Select-Object -First 1\n        if ($msbuildPath) {\n            [environment]::SetEnvironmentVariable($msbuildPathEnvVar, $msbuildPath)\n        }\n    }\n\n    if (Test-Path $msbuildPath) {\n        Write-Debug \"Found 'msbuild.exe' at '${msbuildPath}'\"\n        return $msbuildPath\n    }\n\n    throw \"'msbuild.exe' located at '${msbuildPath}' doesn't exist\"\n}\n\nfunction Get-VsTestPath {\n    return Get-ExecutablePath -name \"VSTest.Console.exe\" -envVar \"VSTEST_PATH\"\n}\n\nfunction Get-CodeCoveragePath {\n    $vstest_exe = Get-VsTestPath\n    $codeCoverageDirectory = Join-Path (Get-ChildItem $vstest_exe).Directory \"..\\..\\..\\..\\..\"\n    return Get-ExecutablePath -name \"CodeCoverage.exe\" -directory $codeCoverageDirectory -envVar \"CODE_COVERAGE_PATH\"\n}\n\nfunction Get-MSBuildImportBeforePath([ValidateSet(\"15.0\", \"16.0\", \"17.0\", \"Current\")][string]$msbuildVersion) {\n    return \"$env:USERPROFILE\\AppData\\Local\\Microsoft\\MSBuild\\${msbuildVersion}\\Microsoft.Common.targets\\ImportBefore\"\n}\n\nfunction Get-MSBuildImportBeforePath-SystemX64([ValidateSet(\"15.0\", \"16.0\", \"17.0\", \"Current\")][string]$msbuildVersion) {\n    return \"C:\\Windows\\SysWOW64\\config\\systemprofile\\AppData\\Local\\Microsoft\\MSBuild\\${msbuildVersion}\\Microsoft.Common.targets\\ImportBefore\"\n}\n\n# NuGet\nfunction New-NuGetPackages([string]$binPath) {\n    Write-Header \"Building NuGet packages\"\n\n    $nugetExe = Get-NuGetPath\n    Get-ChildItem \"src\" -Recurse *.nuspec | ForEach-Object {\n        $outputDir = Join-Path $_.DirectoryName $binPath\n\n        Write-Debug \"Creating NuGet package for '$_' in ${outputDir}\"\n\n        $fixedBinPath = $binPath\n        if ($_.Name -Like \"Descriptor.*.nuspec\" -Or $_.Name -Like \"SonarAnalyzer.CFG.*.nuspec\") {\n            $fixedBinPath = \"${binPath}\\net46\"\n        }\n\n        if (Test-Debug) {\n            Exec { & $nugetExe pack $_.FullName -NoPackageAnalysis -OutputDirectory $outputDir `\n                -Prop binPath=$fixedBinPath -Verbosity detailed `\n            } -errorMessage \"ERROR: NuGet package creation FAILED.\"\n        }\n        else {\n            Exec { & $nugetExe pack $_.FullName -NoPackageAnalysis -OutputDirectory $outputDir `\n                -Prop binPath=$fixedBinPath `\n            } -errorMessage \"ERROR: NuGet package creation FAILED.\"\n        }\n    }\n}\n\n# Used by the integration tests in analyzers\\its\\regression-test.ps1\nfunction Restore-Packages ([Parameter(Mandatory = $true, Position = 1)][string]$solutionPath) {\n    $solutionName = Split-Path $solutionPath -Leaf\n    Write-Header \"Restoring NuGet packages for ${solutionName}\"\n\n    $msbuildBinDir = Split-Path -Parent (Get-MsBuildPath)\n\n    if (Test-Debug) {\n        Exec { & (Get-NuGetPath) restore -LockedMode -MSBuildPath $msbuildBinDir -Verbosity detailed $solutionPath`\n        } -errorMessage \"ERROR: Restoring NuGet packages FAILED.\"\n    }\n    else {\n        Exec { & (Get-NuGetPath) restore -LockedMode -MSBuildPath $msbuildBinDir $solutionPath`\n        } -errorMessage \"ERROR: Restoring NuGet packages FAILED.\"\n    }\n}\n\n# Build\nfunction Invoke-MSBuild (\n    [Parameter(Mandatory = $true, Position = 1)][string]$solutionPath,\n    [parameter(ValueFromRemainingArguments = $true)][array]$remainingArgs) {\n\n    $solutionName = Split-Path $solutionPath -leaf\n    Write-Header \"Building solution ${solutionName}\"\n\n    if (Test-Debug) {\n        $remainingArgs += \"/v:detailed\"\n    }\n    else {\n        $remainingArgs += \"/v:quiet\"\n    }\n\n    $msbuildExe = Get-MsBuildPath\n    Exec { & $msbuildExe $solutionPath $remainingArgs `\n    } -errorMessage \"ERROR: Build FAILED.\"\n}\n\n# Tests\nfunction Invoke-UnitTests([string]$binPath, [string]$buildConfiguration) {\n    Write-Header \"Running unit tests\"\n\n    $escapedPath = (Join-Path $binPath \"net48\") -Replace '\\\\', '\\\\'\n\n    Write-Debug \"Running unit tests for\"\n    $testFiles = @()\n    $testDirs = @()\n    Get-ChildItem \".\\tests\" -Recurse -Include \"*.UnitTest.dll\" `\n        | Where-Object { $_.DirectoryName -Match $escapedPath } `\n        | ForEach-Object {\n            $currentFile = $_\n            Write-Debug \"   - ${currentFile}\"\n            $testFiles += $currentFile\n            $testDirs += $currentFile.Directory\n        }\n    $testDirs = $testDirs | Select-Object -Uniq\n\n    Write-Header \"Running unit tests .NET Framework 4.8\"\n    & (Get-VsTestPath) $testFiles /Logger:\"console;verbosity=minimal\" /Parallel /Enablecodecoverage /InIsolation  /TestAdapterPath:$testDirs\n    Test-ExitCode \"ERROR: Unit Tests execution FAILED.\"\n\n    $testProjFileName = \"tests\\SonarAnalyzer.Test\\SonarAnalyzer.Test.csproj\"\n\n    Write-Header \"Running unit tests .NET 6\"\n    dotnet test $testProjFileName -f net6.0 -v minimal -c $buildConfiguration --no-build --no-restore\n    Test-ExitCode \"ERROR: Unit tests for .NET 6 FAILED.\"\n}\n\nfunction Invoke-IntegrationTests() {\n    Write-Header \"Running integration tests\"\n\n    Invoke-InLocation \"its\" {\n        Exec { & git submodule update --init --recursive --depth 1 }\n\n        Exec { & .\\regression-test.ps1 `\n        } -errorMessage \"ERROR: Integration tests FAILED.\"\n    }\n}\n\n# Coverage\nfunction Invoke-CodeCoverage() {\n    Write-Header \"Creating coverage report\"\n\n    $codeCoverageExe = Get-CodeCoveragePath\n\n    Write-Host \"Generating code coverage reports for\"\n    Get-ChildItem \"TestResults\" -Recurse -Include \"*.coverage\" | ForEach-Object {\n        Write-Host \"    -\" $_.FullName\n\n        $filePathWithNewExtension = $_.FullName + \"xml\"\n        if (Test-Path $filePathWithNewExtension) {\n            Write-Debug \"Coveragexml report already exists, removing it\"\n            Remove-Item -Force $filePathWithNewExtension\n        }\n\n        Exec { & $codeCoverageExe analyze /output:$filePathWithNewExtension $_.FullName `\n        } -errorMessage \"ERROR: Code coverage reports generation FAILED.\"\n    }\n}\n"
  },
  {
    "path": "scripts/build/store-azp-variables.ps1",
    "content": "# Save variables to files so they can be used by other tasks and stages\n# -Force to suppress the error message when it exists on reused agent\n# | Out-Null to suppress noisy output report\n$Dir = \"$env:AGENT_BUILDDIRECTORY\\Azp-Variables\"\nNew-Item -ItemType Directory -Path $Dir -Force | Out-Null\n\nfunction WriteVariable($Name, $Value) {\n    $Path = \"${Dir}\\${Name}\"\n    Write-Host \"Writing '${Value}' to ${Path}\"\n    Set-Content -Path $Path -Value $Value\n}\n\n$VersionFilePath = \"$env:BUILD_SOURCESDIRECTORY\\analyzers\\Version.targets\"\n[xml]$Xml = Get-Content \"$VersionFilePath\"\n$ShortVersion = $Xml.Project.PropertyGroup.ShortVersion\n$PatchVersion = if ($ShortVersion.IndexOf(\".\") -eq $ShortVersion.LastIndexOf(\".\")) { \"${ShortVersion}.0\" } else { $ShortVersion }\n\nWriteVariable \"SHORT_VERSION\" $ShortVersion\nWriteVariable \"FULL_VERSION\" \"${PatchVersion}.${env:BUILD_BUILDID}\"\n"
  },
  {
    "path": "scripts/rspec/CopyTestCasesFromRspec.ps1",
    "content": "# For each test case file in the RspecRulePath, copy the file to the OutputFolder with the name $FileName + $Scenario + $Extension\n#\n# The scenario is determined by the following rules:\n# 1. The test case file name contains a dot, e.g. \"MyTestCase.Scenario.razor\"\n#    Then the scenario name is the second part of the file name, e.g. \"Scenario\"\n# 2. The test case file name contain a dot, but the test case file is in a subfolder, e.g. \"MyTestCase\\MyTestCase.Scenario.razor\"\n#    Then the scenario name is the second part of the file name, e.g. \"Scenario\", ignoring the folder name\n# 3. The test case file name does not contain a dot, but the test case file is in a subfolder, e.g. \"MyTestCase\\Scenario.razor\"\n#    Then the scenario name is the file name, e.g. \"Scenario\", ignoring the folder name\n# 4. The test case file name does not contain a dot and the test case file is in the root folder, e.g. \"MyTestCase.razor\"\n#    Then the scenario name is empty, e.g. \"\"\n# 5. In case of multiple test case files with the same scenario name, e.g. \"MyTestCase1.Scenario.razor\" and \"MyTestCase2.Scenario.razor\"\n#    Then the scenario of the first file is \"Scenario\" and the scenario of the second file is \"Scenario.1\" and so on\n#    This is to avoid overwriting the first file with the second file\n#    This also applied to the other rules, e.g. \"MyTestCase\\MyTestCase.Scenario.razor\" and \"MyTestCase\\Scenario.razor\"\n#\n# Example:\n#   1. MyTestCase.Scenario.razor            =>  RuleName.Scenario.razor\n#   2. MyTestCase\\MyTestCase.Scenario.razor =>  RuleName.Scenario.razor\n#   3. MyTestCase\\Scenario.razor            =>  RuleName.Scenario.razor\n#   4. MyTestCase.razor                     =>  RuleName.razor\n#   5. MyTestCase1.Scenario.razor           =>  RuleName.Scenario.razor\n#      MyTestCase2.Scenario.razor           =>  RuleName.Scenario.1.razor\n#\nfunction CopyTestCasesFromRspec($FileName, $RspecRulePath, $OutputFolder) {\n    $TestCaseFileExtension = @(\n        \"*.cs\",\n        \"*.vb\",\n        \"*.razor\",\n        \"*.cshtml\"\n    )\n\n    Get-ChildItem -Recurse -Path $RspecRulePath -Include $TestCaseFileExtension -File | ForEach-Object {\n\n        $scenario = \"\";\n\n        if ($_.BaseName.Contains(\".\"))\n        {\n            $scenario = \".\" + $($_.BaseName -Split \"\\.\" | Select-Object -Last 1)\n        }\n        elseif ($_.Directory.FullName -ne $(Convert-Path $RspecRulePath))\n        {\n            $scenario = \".\" + $_.BaseName\n        }\n\n        $outputPath = \"${OutputFolder}\\$FileName$scenario$($_.Extension)\"\n\n        if (Test-Path -Path $outputPath -PathType Leaf)\n        {\n            $count = (Get-ChildItem -Path $OutputFolder | Where-Object { $_.Name -match \"$FileExtension$scenario(\\.\\d+)?$($_.Extension)\" }).Count\n            $outputPath = \"${OutputFolder}\\$FileName$scenario.$count$($_.Extension)\"\n        }\n\n        Set-Content -NoNewline -Path $outputPath -Value $(Get-Content $_ -Raw) -Encoding UTF8\n    }\n}\n"
  },
  {
    "path": "scripts/rspec/README.md",
    "content": "# General info\n\nThe `rspec.ps1` script downloads and calls the rule-api JAR.\n\nThe `sonarpedia.json` file is used by:\n- the releasability check\n\n# How to use\n\nScript must be run from project root directory. For more details, you can read the powershell code inside `rspec.ps1`.\n\n**Usage 1**: Update all rules or language metadata.\n\nBasically, the rule-api JAR will update: `sonarway_profile*`, `*.html` and `*.json`, `sonarpedia.json` and will generate `RspecStrings.resx`.\n\n```\n./scripts/rspec/rspec cs\n./scripts/rspec/rspec vbnet\n```\n\n**Usage 2**: Pull metadata (replace or create) for single rule.\n\nWhen the rule had been already specified and is on the `master` branch of the [RSPEC repo:](https://github.com/SonarSource/rspec)\n\n`sonarway_profile*` will not be updated!\n\n```\n./scripts/rspec/rspec cs S1234\n```\n\nWhen the rule has been specified according to the [new RSPEC process](https://github.com/SonarSource/rspec#create-or-modify-a-rule), you will need to also give the branch, because the RSPEC branch will be merged only after the implementation is finished.\n\n```\n./scripts/rspec/rspec -language vbnet -ruleKey S1234 -rspecBranch \"rule/add-RSPEC-S1234\"\n```\n\n**Usage 3**: Like *Usage 2*, but also creates scaffolding.\n\n- Should not be used to update, just to create a new rule (including to create the `vbnet` impl for an existing `cs` rule).\n- If it's newly specified, you need to give the `-rspecBranch` parameter (see *Usage 2* above).\n  - Specifying the `-rspecBranch` parameter will also copy all test case files from the RSPEC branch to the `TestCases` folder.\n- For updates, use *Usage 1* or *Usage 2*.\n\n```\n./scripts/rspec/rspec cs S1234 ClassName\n```\n\n# Possible improvements\n\n- For *Usage 3*, check in the script if the scaffolding has already been created and stop if so, issuing a warning message. Currently, running *Usage 3* twice messes up the scaffolding.\n- Change the hardcoded ruleapi link with the environment variable that is now on all computers.\n"
  },
  {
    "path": "scripts/rspec/rspec-templates/Rule.Base.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.Rules;\n\npublic abstract class $DiagnosticClassName$Base<TSyntaxKind> : SonarDiagnosticAnalyzer<TSyntaxKind>\n    where TSyntaxKind : struct\n{\n    private const string DiagnosticId = \"$DiagnosticId$\";\n\n    protected override string MessageFormat => \"FIXME\";\n\n    protected $DiagnosticClassName$Base() : base(DiagnosticId) { }\n}\n"
  },
  {
    "path": "scripts/rspec/rspec-templates/Rule.CS.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.CSharp.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class $DiagnosticClassName$ : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"$DiagnosticId$\";\n    private const string MessageFormat = \"FIXME\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var node = c.Node;\n                if (true)\n                {\n                    c.ReportIssue(Rule, node.GetLocation());\n                }\n            },\n            SyntaxKind.InvocationExpression);\n}\n"
  },
  {
    "path": "scripts/rspec/rspec-templates/Rule.VB.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nnamespace SonarAnalyzer.VisualBasic.Rules;\n\n[DiagnosticAnalyzer(LanguageNames.VisualBasic)]\npublic sealed class $DiagnosticClassName$ : SonarDiagnosticAnalyzer\n{\n    private const string DiagnosticId = \"$DiagnosticId$\";\n    private const string MessageFormat = \"FIXME\";\n\n    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);\n\n    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n\n    protected override void Initialize(SonarAnalysisContext context) =>\n        context.RegisterNodeAction(c =>\n            {\n                var node = c.Node;\n                if (true)\n                {\n                    c.ReportIssue(Rule, node.GetLocation());\n                }\n            },\n            SyntaxKind.InvocationExpression);\n}\n"
  },
  {
    "path": "scripts/rspec/rspec-templates/Test.CS.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.CSharp.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class $DiagnosticClassName$Test\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<$DiagnosticClassName$>();\n\n    [TestMethod]\n    public void $DiagnosticClassName$_CS() =>\n        builder.AddPaths(\"$DiagnosticClassName$.cs\").Verify();\n}\n"
  },
  {
    "path": "scripts/rspec/rspec-templates/Test.VB.cs",
    "content": "﻿/*\n * SonarAnalyzer for .NET\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n\nusing SonarAnalyzer.VisualBasic.Rules;\n\nnamespace SonarAnalyzer.Test.Rules;\n\n[TestClass]\npublic class $DiagnosticClassName$Test\n{\n    private readonly VerifierBuilder builder = new VerifierBuilder<$DiagnosticClassName$>();\n\n    [TestMethod]\n    public void $DiagnosticClassName$_VB() =>\n        builder.AddPaths(\"$DiagnosticClassName$.vb\").Verify();\n}\n"
  },
  {
    "path": "scripts/rspec/rspec-templates/TestCase.CS.cs",
    "content": "﻿using System;\n\npublic class Program\n{\n}\n"
  },
  {
    "path": "scripts/rspec/rspec-templates/TestCase.VB.vb",
    "content": "﻿Public Class Program\n\n    Public Sub Test()\n\n    End Sub\n\nEnd Class\n"
  },
  {
    "path": "scripts/rspec/rspec-templates/TestMethod.VB.cs",
    "content": "﻿    private readonly VerifierBuilder builderVB = new VerifierBuilder<VB.$DiagnosticClassName$>();    // FIXME: Move this up\n\n    [TestMethod]\n    public void $DiagnosticClassName$_VB() =>\n        builderVB.AddPaths(\"$DiagnosticClassName$.vb\").Verify();\n"
  },
  {
    "path": "scripts/rspec/rspec.ps1",
    "content": "<#\n\n.SYNOPSIS\nThis script allows to download metadata for the given language from RSPEC repository.\n\n.DESCRIPTION\nThis script allows to download metadata for the given language from RSPEC repository.\nIf you want to add a rule to both c# and vb.net execute the operation for each language.\n\nUsage: rspec.ps1\n    [cs|vbnet]        The language to synchronize\n    <rulekey>         The specific rule to synchronize\n    <className>       The name to use for the automatically generated classes\n#>\nparam (\n    [Parameter(Mandatory = $true, HelpMessage = \"language: cs or vbnet\", Position = 0)]\n    [ValidateSet(\"cs\", \"vbnet\")]\n    [string]\n    $Language,\n    [Parameter(HelpMessage = \"The key of the rule to add/update, e.g. S1234. If omitted will update all existing rules.\", Position = 1)]\n    [ValidatePattern(\"^S[0-9]+$\")]\n    [string]\n    $RuleKey,\n    [Parameter(HelpMessage = \"The name of the rule class.\", Position = 2)]\n    [string]\n    $ClassName,\n    [Parameter(HelpMessage = \"The branch in the rspec github repo.\", Position = 3)]\n    [string]\n    $RspecBranch\n)\n\nSet-StrictMode -version 1.0\n$ErrorActionPreference = \"Stop\"\n$RuleTemplateFolder = \"${PSScriptRoot}\\\\rspec-templates\"\n# Based on RuleApiCache.computeDefaultCachePath\n# https://github.com/SonarSource/sonar-rule-api/blob/2323b7313c76e7adc2b7df037e96510b90660292/src/main/java/com/sonarsource/ruleapi/utilities/RuleApiCache.java#L20-L25\n$RspecRepositoryPath = \"${Env:USERPROFILE}\\\\.sonar\\\\rule-api\\\\rspec\"\nif (! [string]::IsNullOrEmpty($Env:SONAR_USER_HOME))\n{\n    $RspecRepositoryPath = \"${Env:SONAR_USER_HOME}\\\\rule-api\\\\rspec\"\n}\n\n. ${PSScriptRoot}\\CopyTestCasesFromRspec.ps1\n\n# Finds the latest rule-api jar from Artifactory\n$Query = \"items.find({\n                    `\"repo`\":`\"sonarsource-private-releases`\",\n                    `\"path`\": { `\"`$match`\": `\"com/sonarsource/rule-api/rule-api*`\" },\n                    `\"name`\":{`\"`$match`\":`\"rule-api-*.jar`\" }\n                }).sort({`\"`$desc`\":[`\"created`\"]}).limit(1)\"\n$Headers = @{ \"Authorization\" = \"Bearer $($env:ARTIFACTORY_PASSWORD)\"; \"Content-Type\" = \"text/plain\" }\n$Response = Invoke-RestMethod -Uri \"https://repox.jfrog.io/artifactory/api/search/aql\" -Method Post -Body $Query -Headers $Headers\n\n$FileInfo = $Response.results[0]\n$TargetDir = \"$HOME/.sonar/rule-api\"\n$RuleApiJar = Join-Path $TargetDir $FileInfo.name\n\nif(Test-Path $RuleApiJar) {\n    Write-Host \"Latest rule-api jar found locally at $RuleApiJar\" -ForegroundColor Green\n}\nelse {\n    New-Item -Path $TargetDir -ItemType Directory -Force\n    $DownloadUrl = \"https://repox.jfrog.io/artifactory/$($FileInfo.repo)/$($FileInfo.path)/$($FileInfo.name)\"\n    $RuleApiJarTmp = \"$RuleApiJar.tmp\"\n    Write-Host \"Latest rule-api jar not found locally. Downloading from $DownloadUrl to $RuleApiJar\" -ForegroundColor Yellow\n    $ProgressPreference = 'SilentlyContinue'\n    Invoke-WebRequest -Uri $DownloadUrl -OutFile $RuleApiJarTmp -Headers $Headers\n    $ProgressPreference = 'Continue'\n    Rename-Item -Path $RuleApiJarTmp -NewName $RuleApiJar -Force\n    Write-Host \"Downloaded latest rule-api jar to $RuleApiJar\" -ForegroundColor Green\n}\n\n$AnalyzersPath = \"${PSScriptRoot}\\\\..\\\\..\\\\analyzers\"\n$RulesFolderCommon = \"${AnalyzersPath}\\\\src\\\\SonarAnalyzer.Core\\\\Rules\"\n$RulesFolderCS     = \"${AnalyzersPath}\\\\src\\\\SonarAnalyzer.CSharp\\\\Rules\"\n$RulesFolderVB     = \"${AnalyzersPath}\\\\src\\\\SonarAnalyzer.VisualBasic\\\\Rules\"\n$RulesFolderTests  = \"${AnalyzersPath}\\\\tests\\\\SonarAnalyzer.Test\\\\Rules\"\n$TestCasesFolder   = \"${AnalyzersPath}\\\\tests\\\\SonarAnalyzer.Test\\\\TestCases\"\n\n$SonarpediaMap = @{\n    \"cs\" = \".\\analyzers\\src\\SonarAnalyzer.CSharp\";\n    \"vbnet\" = \".\\analyzers\\src\\SonarAnalyzer.VisualBasic\";\n}\n\nfunction UpdateRuleTypeMapping() {\n    $Rule = Get-Content -Raw \"${AnalyzersPath}\\\\rspec\\\\${Language}\\\\${RuleKey}.json\" | ConvertFrom-Json\n    $RuleType = $Rule.Type\n    if (!$RuleType) {\n        return\n    }\n\n    $FileToEdit = if ($Language -eq \"cs\") {\"RuleTypeMappingCS\"} else {\"RuleTypeMappingVB\"}\n    $TestFile = \"${AnalyzersPath}\\\\tests\\\\SonarAnalyzer.TestFramework\\\\Packaging\\\\$fileToEdit.cs\"\n    (Get-Content \"${TestFile}\") -replace \"//\\s*\\[`\"$ruleKey`\"\\]\", \"[`\"$ruleKey`\"] = `\"$ruleType`\"\" | Set-Content \"${TestFile}\" -Encoding UTF8\n}\n\nfunction GenerateRuleClassesCS() {\n    $FilesMap = @{\n        \"Rule.CS.cs\"     = \"${RulesFolderCS}\\\\${className}.cs\"\n        \"Test.CS.cs\"     = \"${RulesFolderTests}\\\\${className}Test.cs\"\n    }\n\n    if (-Not (Test-Path -Path \"${TestCasesFolder}\\\\${className}.cs\" -PathType Leaf))\n    {\n        $FilesMap[\"TestCase.CS.cs\"] = \"${TestCasesFolder}\\\\${className}.cs\"\n    }\n\n    WriteClasses $FilesMap\n}\n\nfunction GenerateRuleClassesVB() {\n    $ExistingClassName = FindClassName $RulesFolderCS\n\n    $FilesMap = @{}\n    if ($ExistingClassName) {\n        $ClassName = $ExistingClassName\n        AppendTestCaseVB\n    }\n    else {\n        $FilesMap[\"Test.VB.cs\"] = \"${RulesFolderTests}\\\\${ClassName}Test.cs\"\n    }\n\n    $FilesMap[\"Rule.VB.cs\"] = \"${RulesFolderVB}\\\\${ClassName}.cs\"\n\n    if (-Not (Test-Path -Path \"${TestCasesFolder}\\\\${ClassName}.vb\" -PathType Leaf))\n    {\n        $FilesMap[\"TestCase.VB.vb\"] = \"${TestCasesFolder}\\\\${ClassName}.vb\"\n    }\n\n    WriteClasses $FilesMap\n}\n\nfunction GenerateBaseClassIfSecondLanguage()\n{\n    $ClassNameCS = FindClassName $RulesFolderCS\n    $ClassNameVB = FindClassName $RulesFolderVB\n\n    if ($ClassNameCS -And $ClassNameVB) {\n        $ContentCS = Get-Content -Path \"${RulesFolderCS}\\\\${ClassNameCS}.cs\" -Raw\n        $ContentVB = Get-Content -Path \"${RulesFolderVB}\\\\${ClassNameVB}.cs\" -Raw\n\n        $ContentCS = $ContentCS.Replace(\"public sealed class ${ClassNameCS} : SonarDiagnosticAnalyzer\", `\n                                        \"public sealed class ${ClassNameCS} : ${ClassName}Base<SyntaxKind>\")\n        $ContentVB = $ContentVB.Replace(\"public sealed class ${ClassNameVB} : SonarDiagnosticAnalyzer\", `\n                                        \"public sealed class ${ClassNameVB} : ${ClassName}Base<SyntaxKind>\")\n\n        $Line = \"    private const string DiagnosticId = \"\"${ruleKey}\"\";`n\"\n        $ContentCS = $ContentCS.Replace($Line, \"\")\n        $ContentVB = $ContentVB.Replace($Line, \"\")\n\n        $Line = \"    private const string MessageFormat = \"\"FIXME\"\";`n\"\n        $ContentCS = $ContentCS.Replace($Line, \"\")\n        $ContentVB = $ContentVB.Replace($Line, \"\")\n\n        $Line = \"    private static readonly DiagnosticDescriptor Rule = DescriptorFactory.Create(DiagnosticId, MessageFormat);`n\"\n        $ContentCS = $ContentCS.Replace($Line, \"\")\n        $ContentVB = $ContentVB.Replace($Line, \"\")\n\n        $ContentCS = $ContentCS.Replace(\"`n`n`n\", \"`n`n\").Replace(\"`n`n`n\", \"`n`n\")\n        $ContentVB = $ContentVB.Replace(\"`n`n`n\", \"`n`n\").Replace(\"`n`n`n\", \"`n`n\")\n\n        $Line = \"public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\"\n        $ContentCS = $ContentCS.Replace($Line, \"protected override ILanguageFacade<SyntaxKind> Language => CSharpFacade.Instance;\")\n        $ContentVB = $ContentVB.Replace($Line, \"protected override ILanguageFacade<SyntaxKind> Language => VisualBasicFacade.Instance;\")\n\n        Set-Content -NoNewline -Path \"${RulesFolderCS}\\\\${ClassNameCS}.cs\" -Value $ContentCS -Encoding UTF8\n        Set-Content -NoNewline -Path \"${RulesFolderVB}\\\\${ClassNameVB}.cs\" -Value $ContentVB -Encoding UTF8\n\n        $FilesMap = @{}\n        $FilesMap[\"Rule.Base.cs\"] = \"${RulesFolderCommon}\\\\${ClassName}Base.cs\"\n        WriteClasses $FilesMap\n    }\n}\n\nfunction AppendTestCaseVB() {\n    $UsingTokenCS = \"using CS = SonarAnalyzer.CSharp.Rules;`n\"\n    $UsingTokenVB = \"using VB = SonarAnalyzer.VisualBasic.Rules;`n\"\n    $NamespaceToken = \"namespace SonarAnalyzer.Test.Rules\"\n    $OldEndToken = \"    }\" # For files using old namespaces\n    $NewEndToken = \"}\"     # For files using file scoped namespaces\n    $MethodVB = Get-Content -Path \"${RuleTemplateFolder}\\\\TestMethod.VB.cs\" -Raw\n    $Text = Get-Content -Path \"${RulesFolderTests}\\\\${ClassName}Test.cs\" -Raw\n\n    $Text = $Text.Replace(\"using SonarAnalyzer.CSharp.Rules;`n\", \"\")\n    $Text = $Text.Replace($NamespaceToken, \"${UsingTokenCS}${UsingTokenVB}`n${NamespaceToken}\")\n    $Text = $Text.Replace(\"new ${ClassName}\", \"new CS.${ClassName}\")\n    $Text = $Text.Replace(\"<${ClassName}>\", \"<CS.${ClassName}>\")\n    $Text = $Text.Replace(\"builder =\", \"builderCS =\")\n    $Text = $Text.Replace(\"builder.\", \"builderCS.\")\n\n    $EndToken = if ($Text.Contains(\"${namespaceToken};\")) {$NewEndToken} else {$OldEndToken}\n    $Index = $Text.LastIndexOf($EndToken)\n    if ($Index -gt -1) {\n        $Text = $Text.Insert($Index, \"`n${MethodVB}\")\n    }\n    else {\n        $Text = \"${Text}`n${MethodVB}\"\n    }\n\n    $Text = ReplacePlaceHolders $Text\n    Set-Content -NoNewline -Path \"${RulesFolderTests}\\\\${ClassName}Test.cs\" -Value $Text -Encoding UTF8\n}\n\nfunction FindClassName($RulesPath) {\n    $Files = Get-ChildItem -Path $RulesPath -Filter \"*.cs\"\n\n    $QuotedRuleKey = \"`\"$RuleKey`\";\"\n    foreach ($File in $Files) {\n        $Content = $null = Get-Content -Path $File.FullName -Raw\n        if ($Content -match $QuotedRuleKey) {\n            return $File.BaseName\n        }\n    }\n    return $null\n}\n\nfunction WriteClasses($FilesMap) {\n    $FilesMap.GetEnumerator() | ForEach-Object {\n        $Content = Get-Content \"${RuleTemplateFolder}\\\\$($_.Key)\" -Raw\n        $Replaced = ReplacePlaceHolders -text $Content\n\n        Set-Content -NoNewline -Path $_.Value -Value $replaced -Encoding UTF8\n    }\n}\n\nfunction ReplacePlaceHolders($Text) {\n    return $Text.Replace('$DiagnosticClassName$', $ClassName).Replace('$DiagnosticId$', $RuleKey)\n}\n\nif (-Not $Env:GITHUB_TOKEN) {\n    $GhToken = gh auth token 2>$null\n    if ($GhToken) {\n        $Env:GITHUB_TOKEN = $GhToken\n        Write-Host \"GITHUB_TOKEN not set, using token from 'gh auth token'\" -ForegroundColor Yellow\n    }\n}\n\n### SCRIPT START ###\n\n$SonarpediaFolder = $SonarpediaMap.Get_Item($Language)\nWrite-Host \"Will change directory to $SonarpediaFolder to run rule-api (from $RuleApiJar )\"\npushd $SonarpediaFolder\n\nif ($RuleKey) {\n    if ($RspecBranch) {\n        java \"-Dline.separator=`n\" -jar $RuleApiJar generate -rule $RuleKey -branch $RspecBranch\n    }\n    else {\n        java \"-Dline.separator=`n\" -jar $RuleApiJar generate -rule $RuleKey\n    }\n}\nelse {\n    java \"-Dline.separator=`n\" -jar $RuleApiJar update\n}\n\nWrite-Host \"Ran rule-api, will move back to root\"\npopd\n\nif ($ClassName -And $RuleKey) {\n    if ($RspecBranch) {\n        $langFolder = If ($Language -eq \"vbnet\") { \"vbnet\" } Else { \"csharp\" }\n        CopyTestCasesFromRspec $ClassName \"${RspecRepositoryPath}\\\\rules\\\\${RuleKey}\\\\$langFolder\" $TestCasesFolder\n    }\n\n    if ($Language -eq \"cs\") {\n        GenerateRuleClassesCS\n    }\n    elseif ($Language -eq \"vbnet\") {\n        GenerateRuleClassesVB\n    }\n    UpdateRuleTypeMapping\n    GenerateBaseClassIfSecondLanguage\n}\n"
  },
  {
    "path": "scripts/rspec/tests/CopyTestCasesFromRspec.Tests.ps1",
    "content": "# How to run:\n#   $ Invoke-Pester -Output Detailed\n#\n# Requires Pester 5.0.x\n#   https://pester.dev/docs/quick-start\n#   $ Install-Module -Name Pester -Force -SkipPublisherCheck\n#   $ Import-Module Pester -Passthru\nBeforeAll {\n    . $PSScriptRoot/../CopyTestCasesFromRspec.ps1\n\n    $InputFolder = \"TestDrive:\\input\"\n    $OutputFolder = \"TestDrive:\\output\"\n}\n\n$FileExtension = @(\".cs\", \".vb\", \".razor\", \".cshtml\")\n\nDescribe 'CopyTestCasesFromRspec - <_> files' -ForEach $FileExtension {\n    BeforeEach {\n        if (Test-Path $InputFolder)\n        {\n            Remove-Item -Force -Recurse $InputFolder\n        }\n        if (Test-Path $OutputFolder)\n        {\n            Remove-Item -Force -Recurse $OutputFolder\n        }\n\n        New-Item -Path \"TestDrive:\\\" -Name \"input\" -ItemType \"directory\"\n        New-Item -Path \"TestDrive:\\\" -Name \"output\" -ItemType \"directory\"\n    }\n\n\n    It 'should copy <_> file' {\n        New-Item -Path $InputFolder -Name \"SomeTestCase$_\" -ItemType \"file\"\n\n        CopyTestCasesFromRspec \"RuleName\" $InputFolder $OutputFolder\n\n        Get-ChildItem -Path $OutputFolder -File -name | Should -Contain \"RuleName$_\"\n        \"$OutputFolder\\RuleName$_\" | Should -Exist\n    }\n\n    It 'should take into account composed test case name' {\n        New-Item -Path $InputFolder -Name \"SomeTestCase.Scenario1$_\" -ItemType \"file\"\n\n        CopyTestCasesFromRspec \"RuleName\" $InputFolder $OutputFolder\n\n        Get-ChildItem -Path $OutputFolder -File -name | Should -Contain \"RuleName.Scenario1$_\"\n        \"$OutputFolder\\RuleName.Scenario1$_\" | Should -Exist\n    }\n\n    It 'should include file if under a folder with filename used as a scenario' {\n        New-Item -Path $InputFolder -Name \"AFolder\" -ItemType \"directory\"\n        New-Item -Path \"TestDrive:\\input\\AFolder\" -Name \"Scenario1$_\" -ItemType \"file\"\n\n        CopyTestCasesFromRspec \"RuleName\" $InputFolder $OutputFolder\n\n        Get-ChildItem -Path $OutputFolder -File -name | Should -Contain \"RuleName.Scenario1$_\"\n        \"$OutputFolder\\RuleName.Scenario1$_\" | Should -Exist\n    }\n\n    It 'should add a suffix counter when output files have the same name' {\n        New-Item -Path $InputFolder -Name \"SomeTestCase$_\" -ItemType \"file\"\n        New-Item -Path $InputFolder -Name \"SomeOtherTestCases$_\" -ItemType \"file\"\n        New-Item -Path $InputFolder -Name \"ThirdTestCases$_\" -ItemType \"file\"\n\n        CopyTestCasesFromRspec \"RuleName\" $InputFolder $OutputFolder\n\n        Get-ChildItem -Path $OutputFolder -File -name | Should -Contain \"RuleName$_\"\n        Get-ChildItem -Path $OutputFolder -File -name | Should -Contain \"RuleName.1$_\"\n        Get-ChildItem -Path $OutputFolder -File -name | Should -Contain \"RuleName.2$_\"\n        \"$OutputFolder\\RuleName$_\" | Should -Exist\n        \"$OutputFolder\\RuleName.1$_\" | Should -Exist\n        \"$OutputFolder\\RuleName.2$_\" | Should -Exist\n    }\n\n    It 'should add a suffix counter when output files have the same scenario' {\n        New-Item -Path $InputFolder -Name \"SomeTestCase.Scenario$_\" -ItemType \"file\"\n        New-Item -Path $InputFolder -Name \"SomeOtherTestCases.Scenario$_\" -ItemType \"file\"\n        New-Item -Path $InputFolder -Name \"ThirdTestCases.Scenario$_\" -ItemType \"file\"\n\n        CopyTestCasesFromRspec \"RuleName\" $InputFolder $OutputFolder\n\n        Get-ChildItem -Path $OutputFolder -File -name | Should -Contain \"RuleName.Scenario$_\"\n        Get-ChildItem -Path $OutputFolder -File -name | Should -Contain \"RuleName.Scenario.1$_\"\n        Get-ChildItem -Path $OutputFolder -File -name | Should -Contain \"RuleName.Scenario.2$_\"\n        \"$OutputFolder\\RuleName.Scenario$_\" | Should -Exist\n        \"$OutputFolder\\RuleName.Scenario.1$_\" | Should -Exist\n        \"$OutputFolder\\RuleName.Scenario.2$_\" | Should -Exist\n    }\n\n    It 'should add a suffix counter when output files have the same name from different folders' {\n        New-Item -Path $InputFolder -Name \"AFolder\" -ItemType \"directory\"\n        New-Item -Path \"TestDrive:\\input\\AFolder\" -Name \"Scenario$_\" -ItemType \"file\"\n        New-Item -Path $InputFolder -Name \"BFolder\" -ItemType \"directory\"\n        New-Item -Path \"TestDrive:\\input\\BFolder\" -Name \"Scenario$_\" -ItemType \"file\"\n        New-Item -Path $InputFolder -Name \"CFolder\" -ItemType \"directory\"\n        New-Item -Path \"TestDrive:\\input\\CFolder\" -Name \"Scenario$_\" -ItemType \"file\"\n\n        CopyTestCasesFromRspec \"RuleName\" $InputFolder $OutputFolder\n\n        Get-ChildItem -Path $OutputFolder -File -name | Should -Contain \"RuleName.Scenario$_\"\n        Get-ChildItem -Path $OutputFolder -File -name | Should -Contain \"RuleName.Scenario.1$_\"\n        Get-ChildItem -Path $OutputFolder -File -name | Should -Contain \"RuleName.Scenario.2$_\"\n        \"$OutputFolder\\RuleName.Scenario$_\" | Should -Exist\n        \"$OutputFolder\\RuleName.Scenario.1$_\" | Should -Exist\n        \"$OutputFolder\\RuleName.Scenario.2$_\" | Should -Exist\n    }\n}\n"
  },
  {
    "path": "scripts/set-version.ps1",
    "content": "[CmdletBinding()]\nParam(\n    [Parameter(Mandatory = $True, Position = 1)]\n    [ValidatePattern(\"^\\d{1,3}\\.\\d{1,3}(\\.\\d{1,3})?$\")]\n    [String]$Version,\n    [Int]$BuildNumber=0,\n    [String]$Branch,\n    [string]$Sha1\n)\n\nSet-StrictMode -version 2.0\n$ErrorActionPreference = \"Stop\"\n\nfunction UpdatePom($Path, $Version) {\n    Write-Host \"Updating version to $Version in $Path\"\n    # This is done manually, because mvn tries to resolve parent poms from jfrog and that requires heavy orchestration\n    $Pattern = \"<version>.*?-SNAPSHOT</version>\"\n    $Content = Get-Content $Path\n    If ($Content -match $Pattern) {\n        $Content = $Content -replace $Pattern, \"<version>$Version</version>\"\n        Set-Content $Path $Content\n    }\n    Else {\n        throw \"Could not find $Pattern in $Path. This script is not supposed to be run multiple times. Revert your git changes first.\"\n    }\n}\n\nfunction UpdateJava() {\n    Write-Host \"Updating version in Java files\"\n    $MavenVersion = If ($BuildNumber -eq 0) { \"$ShortVersion-SNAPSHOT\" } else { \"${PatchVersion}.${BuildNumber}\" }\n    $Files = Get-ChildItem -Path . -Filter \"pom.xml\" -Recurse\n    foreach ($File in $Files) {\n        UpdatePom $File.FullName $MavenVersion\n    }\n}\n\nfunction UpdateDotNet() {\n    $Path = Resolve-Path \".\\analyzers\\Version.targets\"\n    Write-Host \"Updating $Path to ShortVersion=$ShortVersion, BuildNumber=$BuildNumber, Branch=$Branch, Sha1=$Sha1\"\n    $Xml = [xml](Get-Content $Path)\n    $Xml.Project.PropertyGroup.ShortVersion = $ShortVersion\n    $Xml.Project.PropertyGroup.BuildNumber = $BuildNumber.ToString()\n    $Xml.Project.PropertyGroup.Branch = $Branch\n    $Xml.Project.PropertyGroup.Sha1 = $Sha1\n    $Xml.Save($Path)\n}\n\nPush-Location \"${PSScriptRoot}\\..\"  # Run everything from the root of the repository\ntry {\n    $ShortVersion = If ($Version.EndsWith(\".0\") -and $Version.IndexOf(\".\") -ne $Version.LastIndexOf(\".\")) { $Version.Substring(0, $Version.Length - 2) } else { $Version } # x.y   or x.y.z\n    $PatchVersion = If ($ShortVersion.IndexOf(\".\") -eq $ShortVersion.LastIndexOf(\".\")) { \"$ShortVersion.0\" } else { $ShortVersion }                                       # x.y.0 or x.y.z\n\n    If ($BuildNumber -eq 0) {\n        Write-Host \"Checking out branch version-bump/$ShortVersion\"\n        git checkout -b \"version-bump/$ShortVersion\"\n    }\n\n    UpdateDotNet\n    UpdateJava\n\n    If ($BuildNumber -eq 0) {\n        Write-Host \"Creating Git commit\"\n        git commit -a -m \"Bump version to $ShortVersion\"\n\n        Write-Host \"Restoring packages to update lock files\"\n        dotnet restore private/analyzers/SonarAnalyzer.sln --force-evaluate\n        git commit -a -m \"Update packages.lock.json\"\n\n        Write-Host \"Pushing branch and creating PR\"\n        git push -u origin \"version-bump/$ShortVersion\"\n        gh pr create --title \"Bump version to $ShortVersion\" --body \"\" --web --base master --head \"version-bump/$ShortVersion\"\n    }\n\n    exit 0\n}\ncatch {\n    Write-Host $_\n    Write-Host $_.Exception\n    Write-Host $_.ScriptStackTrace\n    exit 1\n}\nfinally {\n    Pop-Location\n}"
  },
  {
    "path": "scripts/utils.ps1",
    "content": "Add-Type -AssemblyName \"System.IO.Compression.FileSystem\"\n\n# Original: http://jameskovacs.com/2010/02/25/the-exec-problem\nfunction Exec ([scriptblock]$command, [string]$errorMessage = \"ERROR: Command '${command}' FAILED.\") {\n    Write-Debug \"Invoking command:${command}\"\n\n    $output = \"\"\n    & $command | Tee-Object -Variable output\n    if ((-not $?) -or ($lastexitcode -ne 0)) {\n        throw $errorMessage\n    }\n\n    return $output\n}\n\n# Also used in the azure-pipelines.yml\nfunction Test-ExitCode([string]$errorMessage = \"ERROR: Command FAILED.\") {\n    if ((-not $?) -or ($lastexitcode -ne 0)) {\n        throw $errorMessage\n    }\n}\n\n# Sets the current folder and executes the given script.\n# When the script finishes sets the original current folder.\nfunction Invoke-InLocation([string]$path, [scriptblock]$command) {\n    try {\n        Write-Debug \"Changing current directory to: '${path}'\"\n        Push-Location $path\n\n        & $command\n    }\n    finally {\n        Write-Debug \"Changing current directory back to previous one\"\n        Pop-Location\n    }\n}\n\nfunction ConvertTo-UnixLineEndings([string]$fileName) {\n    Get-ChildItem $fileName | ForEach-Object {\n        $currentFile = $_\n        Write-Debug \"Changing line ending for '${currentFile}'\"\n        $content = [IO.File]::ReadAllText($currentFile) -Replace \"`r`n?\", \"`n\"\n        $utf8 = New-Object System.Text.UTF8Encoding $false\n        [IO.File]::WriteAllText($currentFile, $content, $utf8)\n    }\n}\n\nfunction Write-Header([string]$text) {\n    Write-Host\n    Write-Host \"================================================\"\n    Write-Host $text\n    Write-Host \"================================================\"\n}\n\nfunction Get-ExecutablePath([string]$name, [string]$directory, [string]$envVar) {\n    Write-Debug \"Trying to find '${name}' using '${envVar}' environment variable\"\n    $path = [environment]::GetEnvironmentVariable($envVar, \"Process\")\n\n    try {\n        if (!$path) {\n            Write-Debug \"Environment variable not found\"\n\n            if (!$directory) {\n                Write-Debug \"Trying to find path using 'where.exe'\"\n                $path = Exec { & where.exe $name } | Select-Object -First 1\n            }\n            else {\n                Write-Debug \"Trying to find path using 'where.exe' in '${directory}'\"\n                $path = Exec { & where.exe /R $directory $name } | Select-Object -First 1\n            }\n        }\n    }\n    catch {\n        throw \"Failed to locate executable '${name}' on the path\"\n    }\n\n    if (Test-Path $path) {\n        Write-Debug \"Found '${name}' at '${path}'\"\n        [environment]::SetEnvironmentVariable($envVar, $path)\n        return $path\n    }\n\n    throw \"'${name}' located at '${path}' doesn't exist\"\n}\n\nfunction Expand-ZIPFile($source, $destination) {\n    Write-Host \"Unzipping '${source}' into '${destination}'\"\n\n    if (Get-Command \"Expand-Archive\" -errorAction SilentlyContinue) {\n        # PS v5.0+\n        Write-Debug \"Unzipping using 'Expand-Archive'\"\n        Expand-Archive $source $destination -Force\n    }\n    else {\n        if (-Not (Test-Path $destination)) {\n            Write-Debug \"Creating folder '${destination}'\"\n            New-Item $destination -ItemType Directory\n        }\n\n        Write-Debug \"Unzipping using 'Shell.Application'\"\n        $application = New-Object -Com Shell.Application\n\n        $zip = $application.NameSpace($source)\n        $application.NameSpace($destination).CopyHere($zip.items(), 0x14)\n    }\n}\n\nfunction Test-Debug() {\n    return $DebugPreference -ne \"SilentlyContinue\"\n}\n\nfunction Test-FileExists([string]$path) {\n    if (-Not (Test-Path $path)) {\n        throw \"Could not find '${path}'.\"\n    }\n}\n\nfunction CreateFolder([string] $folderName){\n    If (Test-Path $folderName){\n        Remove-Item $folderName -recurse\n    }\n    mkdir $folderName\n}\n"
  },
  {
    "path": "sonar-csharp-core/README.md",
    "content": "# Common code for C\\# SonarQube plugins\n\nThis folder contains the common code for C# plugins for SonarQube.\n\nTo get more information please read the repository main [README](../README.md).\n"
  },
  {
    "path": "sonar-csharp-core/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <parent>\n    <groupId>org.sonarsource.dotnet</groupId>\n    <artifactId>sonar-dotnet</artifactId>\n    <version>10.26-SNAPSHOT</version>\n  </parent>\n\n  <artifactId>sonar-csharp-core</artifactId>\n\n  <name>SonarSource :: C# :: Core</name>\n  <description>Shared code between C# plugins</description>\n  <inceptionYear>2014</inceptionYear>\n\n  <dependencies>\n    <!-- provided at runtime -->\n    <dependency>\n      <groupId>org.sonarsource.api.plugin</groupId>\n      <artifactId>sonar-plugin-api</artifactId>\n    </dependency>\n    <dependency>\n      <groupId>org.slf4j</groupId>\n      <artifactId>slf4j-api</artifactId>\n      <scope>provided</scope>\n    </dependency>\n\n    <!-- Compile dependencies -->\n    <dependency>\n      <groupId>${project.groupId}</groupId>\n      <artifactId>sonar-dotnet-core</artifactId>\n      <version>${project.version}</version>\n    </dependency>\n\n    <!-- unit tests -->\n    <dependency>\n      <groupId>org.junit.jupiter</groupId>\n      <artifactId>junit-jupiter-engine</artifactId>\n    </dependency>\n    <dependency>\n      <groupId>org.sonarsource.api.plugin</groupId>\n      <artifactId>sonar-plugin-api-test-fixtures</artifactId>\n    </dependency>\n    <dependency>\n      <groupId>org.assertj</groupId>\n      <artifactId>assertj-core</artifactId>\n    </dependency>\n    <dependency>\n      <groupId>org.mockito</groupId>\n      <artifactId>mockito-core</artifactId>\n    </dependency>\n    <dependency>\n      <groupId>org.sonarsource.sonarqube</groupId>\n      <artifactId>sonar-plugin-api-impl</artifactId>\n    </dependency>\n  </dependencies>\n\n  <build>\n    <extensions>\n      <extension>\n        <groupId>kr.motd.maven</groupId>\n        <artifactId>os-maven-plugin</artifactId>\n        <version>1.7.1</version>\n      </extension>\n    </extensions>\n    <pluginManagement>\n      <plugins>\n        <plugin>\n          <groupId>org.apache.maven.plugins</groupId>\n          <artifactId>maven-antrun-plugin</artifactId>\n          <version>3.2.0</version>\n        </plugin>\n        <plugin>\n          <groupId>org.codehaus.mojo</groupId>\n          <artifactId>build-helper-maven-plugin</artifactId>\n          <version>3.6.1</version>\n        </plugin>\n      </plugins>\n    </pluginManagement>\n  </build>\n\n</project>\n"
  },
  {
    "path": "sonar-csharp-core/src/main/java/org/sonar/plugins/csharpenterprise/api/ProfileRegistrar.java",
    "content": "/*\n * SonarSource :: C# :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n// This class needs to be in this specific package in order to be accessed by other plugins (e.g. sonar-architecture-csharp-frontend-plugin)\n// See https://docs.sonarsource.com/sonarqube-server/latest/extension-guide/developing-a-plugin/plugin-basics/#exposing-apis-to-other-plugins\npackage org.sonar.plugins.csharpenterprise.api;\n\nimport java.util.Collection;\nimport org.sonar.api.rule.RuleKey;\nimport org.sonar.api.server.ServerSide;\nimport org.sonarsource.api.sonarlint.SonarLintSide;\n\n/**\n * This class can be extended to provide additional rule keys in the builtin default quality profile.\n *\n * <pre>\n *   {@code\n *     public void register(RegistrarContext registrarContext) {\n *       registrarContext.registerDefaultQualityProfileRules(ruleKeys);\n *     }\n *   }\n * </pre>\n */\n@SonarLintSide\n@ServerSide\npublic interface ProfileRegistrar {\n\n  /**\n   * This method is called on server side and during an analysis to modify the builtin default quality profile for csharp.\n   */\n  void register(RegistrarContext registrarContext);\n\n  interface RegistrarContext {\n\n    /**\n     * Registers additional rules into the \"Sonar Way\" default quality profile for the language \"csharp\".\n     */\n    void registerDefaultQualityProfileRules(Collection<RuleKey> ruleKeys);\n\n  }\n\n}\n"
  },
  {
    "path": "sonar-csharp-core/src/main/java/org/sonar/plugins/csharpenterprise/api/package-info.java",
    "content": "/*\n * SonarSource :: C# :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n@ParametersAreNonnullByDefault\npackage org.sonar.plugins.csharpenterprise.api;\n\nimport javax.annotation.ParametersAreNonnullByDefault;\n"
  },
  {
    "path": "sonar-csharp-core/src/main/java/org/sonarsource/csharp/core/CSharpCoreExtensions.java",
    "content": "/*\n * SonarSource :: C# :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.csharp.core;\n\nimport org.sonar.api.Plugin;\nimport org.sonar.api.SonarProduct;\nimport org.sonarsource.dotnet.shared.plugins.CodeCoverageProvider;\nimport org.sonarsource.dotnet.shared.plugins.DotNetRulesDefinition;\nimport org.sonarsource.dotnet.shared.plugins.EncodingPerFile;\nimport org.sonarsource.dotnet.shared.plugins.GlobalProtobufFileProcessor;\nimport org.sonarsource.dotnet.shared.plugins.HashProvider;\nimport org.sonarsource.dotnet.shared.plugins.MethodDeclarationsCollector;\nimport org.sonarsource.dotnet.shared.plugins.ModuleConfiguration;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\nimport org.sonarsource.dotnet.shared.plugins.ProjectTypeCollector;\nimport org.sonarsource.dotnet.shared.plugins.ProtobufDataImporter;\nimport org.sonarsource.dotnet.shared.plugins.RealPathProvider;\nimport org.sonarsource.dotnet.shared.plugins.ReportPathCollector;\nimport org.sonarsource.dotnet.shared.plugins.RoslynDataImporter;\nimport org.sonarsource.dotnet.shared.plugins.RoslynRules;\nimport org.sonarsource.dotnet.shared.plugins.TelemetryCollector;\nimport org.sonarsource.dotnet.shared.plugins.UnitTestResultsProvider;\nimport org.sonarsource.dotnet.shared.plugins.filters.GeneratedFileFilter;\nimport org.sonarsource.dotnet.shared.plugins.filters.WrongEncodingFileFilter;\nimport org.sonarsource.dotnet.shared.plugins.sensors.AnalysisWarningsSensor;\nimport org.sonarsource.dotnet.shared.plugins.sensors.DotNetSensor;\nimport org.sonarsource.dotnet.shared.plugins.sensors.FileTypeSensor;\nimport org.sonarsource.dotnet.shared.plugins.sensors.LogSensor;\nimport org.sonarsource.dotnet.shared.plugins.sensors.MethodDeclarationsSensor;\nimport org.sonarsource.dotnet.shared.plugins.sensors.PropertiesSensor;\nimport org.sonarsource.dotnet.shared.plugins.sensors.TelemetryJsonProcessor;\nimport org.sonarsource.dotnet.shared.plugins.sensors.TelemetryJsonProjectCollector;\nimport org.sonarsource.dotnet.shared.plugins.sensors.TelemetryJsonSensor;\nimport org.sonarsource.dotnet.shared.plugins.sensors.TelemetryProcessor;\nimport org.sonarsource.dotnet.shared.plugins.sensors.TelemetrySensor;\nimport org.sonarsource.dotnet.shared.plugins.telemetryjson.TelemetryJsonCollector;\n\npublic class CSharpCoreExtensions {\n\n  private CSharpCoreExtensions() {\n    // Private constructor to prevent instantiation\n  }\n\n  public static void register(Plugin.Context context, PluginMetadata metadata) {\n    // SLCore (and OmniSharp-based SonarLint) needs only DotNetRulesDefinition and its dependencies. The rest should not be present.\n    context.addExtensions(\n      DotNetRulesDefinition.class,\n      metadata,\n      RoslynRules.class);\n\n    if (context.getRuntime().getProduct() != SonarProduct.SONARLINT) {\n      context.addExtensions(\n        // module-level components (some relying on deprecated Scanner APIs)\n        ModuleConfiguration.class,\n        FileTypeSensor.class,\n        LogSensor.class,\n        MethodDeclarationsCollector.class,\n        MethodDeclarationsSensor.class,\n        TelemetryCollector.class,\n        TelemetrySensor.class,\n        TelemetryProcessor.class,\n        TelemetryJsonCollector.class,\n        TelemetryJsonSensor.class,\n        TelemetryJsonProjectCollector.class,\n        TelemetryJsonProcessor.class,\n        PropertiesSensor.class,\n        RealPathProvider.class,\n        // global components\n        // collectors - they are populated by the module-level sensors\n        ProjectTypeCollector.class,\n        ReportPathCollector.class,\n        CSharpSonarWayProfile.class,\n        GlobalProtobufFileProcessor.class,\n        // sensor\n        DotNetSensor.class,\n        // language-specific\n        CSharpCorePluginMetadata.CSharp.class,\n        CSharpLanguageConfiguration.class,\n        // filters\n        EncodingPerFile.class,\n        WrongEncodingFileFilter.class,\n        GeneratedFileFilter.class,\n        HashProvider.class,\n        // importers / exporters\n        // Analysis warnings sensor is registered only here, without a language filter, to avoid pushing warnings multiple times.\n        AnalysisWarningsSensor.class,\n        CSharpFileCacheSensor.class,\n        ProtobufDataImporter.class,\n        RoslynDataImporter.class);\n\n      context.addExtensions(new CSharpPropertyDefinitions(metadata).create());\n      context.addExtensions(new CodeCoverageProvider(metadata).extensions());\n      context.addExtensions(new UnitTestResultsProvider(metadata).extensions());\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-csharp-core/src/main/java/org/sonarsource/csharp/core/CSharpCorePluginMetadata.java",
    "content": "/*\n * SonarSource :: C# :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.csharp.core;\n\nimport java.util.Objects;\nimport org.sonar.api.config.Configuration;\nimport org.sonar.api.resources.AbstractLanguage;\nimport org.sonarsource.dotnet.shared.plugins.AbstractPropertyDefinitions;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\n\npublic abstract class CSharpCorePluginMetadata implements PluginMetadata {\n\n  @Override\n  public String languageKey() {\n    return CSharp.LANGUAGE_KEY;\n  }\n\n  @Override\n  public String languageName() {\n    return CSharp.LANGUAGE_NAME;\n  }\n\n  @Override\n  public String repositoryKey() {\n    return \"csharpsquid\";\n  }\n\n  @Override\n  public String fileSuffixesKey() {\n    return AbstractPropertyDefinitions.fileSuffixProperty(languageKey());\n  }\n\n  @Override\n  public String fileSuffixesDefaultValue() {\n    return \".cs,.razor\";\n  }\n\n  public class CSharp extends AbstractLanguage {\n    // Do not make these fields public and access them directly. Use the methods in CSharpCorePluginMetadata instead\n    private static final String LANGUAGE_KEY = \"cs\";\n    private static final String LANGUAGE_NAME = \"C#\";\n\n    private final Configuration configuration;\n\n    public CSharp(Configuration configuration) {\n      super(languageKey(), languageName());\n      this.configuration = configuration;\n    }\n\n    @Override\n    public String[] getFileSuffixes() {\n      return configuration.getStringArray(fileSuffixesKey());\n    }\n\n    @Override\n    public boolean equals(Object o) {\n      return super.equals(o) && o instanceof CSharp cSharp && configuration == cSharp.configuration;\n    }\n\n    @Override\n    public int hashCode() {\n      return Objects.hash(super.hashCode(), configuration.hashCode());\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-csharp-core/src/main/java/org/sonarsource/csharp/core/CSharpFileCacheSensor.java",
    "content": "/*\n * SonarSource :: C# :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.csharp.core;\n\nimport org.sonarsource.dotnet.shared.plugins.HashProvider;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\nimport org.sonarsource.dotnet.shared.plugins.sensors.AbstractFileCacheSensor;\n\npublic class CSharpFileCacheSensor extends AbstractFileCacheSensor {\n  public CSharpFileCacheSensor(PluginMetadata metadata, HashProvider hashProvider) {\n    super(metadata, hashProvider);\n  }\n\n  @Override\n  protected String[] additionalSupportedExtensions() {\n    return new String[]{\"cshtml\"};\n  }\n}\n"
  },
  {
    "path": "sonar-csharp-core/src/main/java/org/sonarsource/csharp/core/CSharpLanguageConfiguration.java",
    "content": "/*\n * SonarSource :: C# :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.csharp.core;\n\nimport org.sonar.api.config.Configuration;\nimport org.sonarsource.dotnet.shared.plugins.AbstractLanguageConfiguration;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\n\npublic class CSharpLanguageConfiguration extends AbstractLanguageConfiguration {\n  public CSharpLanguageConfiguration(Configuration configuration, PluginMetadata metadata) {\n    super(configuration, metadata);\n  }\n\n  public boolean analyzeRazorCode() {\n    return configuration.getBoolean(CSharpPropertyDefinitions.getAnalyzeRazorCode(metadata.languageKey())).orElse(true);\n  }\n}\n"
  },
  {
    "path": "sonar-csharp-core/src/main/java/org/sonarsource/csharp/core/CSharpPropertyDefinitions.java",
    "content": "/*\n * SonarSource :: C# :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.csharp.core;\n\nimport java.util.List;\nimport org.sonar.api.PropertyType;\nimport org.sonar.api.config.PropertyDefinition;\nimport org.sonar.api.resources.Qualifiers;\nimport org.sonarsource.dotnet.shared.plugins.AbstractPropertyDefinitions;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\n\npublic class CSharpPropertyDefinitions extends AbstractPropertyDefinitions {\n\n  public CSharpPropertyDefinitions(PluginMetadata metadata) {\n    super(metadata);\n  }\n\n  @Override\n  public List<PropertyDefinition> create() {\n    List<PropertyDefinition> result = super.create();\n    result.add(\n      PropertyDefinition.builder(getAnalyzeRazorCode(metadata.languageKey()))\n        .category(metadata.languageName())\n        .defaultValue(\"true\")\n        .name(\"Analyze Razor code\")\n        .description(\"If set to \\\"true\\\", .razor and .cshtml files will be fully analyzed, this may increase the analysis time.\" +\n          \" If set to \\\"false\\\", .cshtml files will be analyzed for taint vulnerabilities only.\")\n        .onQualifiers(Qualifiers.PROJECT)\n        .type(PropertyType.BOOLEAN)\n        .build());\n    return result;\n  }\n\n  public static String getAnalyzeRazorCode(String languageKey) {\n    return PROP_PREFIX + languageKey + \".analyzeRazorCode\";\n  }\n}\n"
  },
  {
    "path": "sonar-csharp-core/src/main/java/org/sonarsource/csharp/core/CSharpSonarWayProfile.java",
    "content": "/*\n * SonarSource :: C# :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.csharp.core;\n\nimport org.sonar.api.rule.RuleKey;\nimport org.sonar.plugins.csharpenterprise.api.ProfileRegistrar;\nimport org.sonarsource.dotnet.shared.plugins.AbstractSonarWayProfile;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\nimport org.sonarsource.dotnet.shared.plugins.RoslynRules;\n\npublic class CSharpSonarWayProfile extends AbstractSonarWayProfile {\n  private final ProfileRegistrar[] profileRegistrars;\n\n  // The constructors cannot be merged because SonarQube Cloud does not support dependency injection for @Nullable arguments.\n  public CSharpSonarWayProfile(PluginMetadata metadata, RoslynRules roslynRules) {\n    super(metadata, roslynRules);\n    this.profileRegistrars = null;\n  }\n\n  public CSharpSonarWayProfile(PluginMetadata metadata, RoslynRules roslynRules, ProfileRegistrar[] profileRegistrars) {\n    super(metadata, roslynRules);\n    this.profileRegistrars = profileRegistrars;\n  }\n\n  @Override\n  protected void registerRulesFromRegistrars(NewBuiltInQualityProfile profile) {\n    if (profileRegistrars != null) {\n      for (var profileRegistrar : profileRegistrars) {\n        profileRegistrar.register(rules -> {\n          for (RuleKey ruleKey : rules) {\n            profile.activateRule(ruleKey.repository(), ruleKey.rule());\n          }\n        });\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-csharp-core/src/main/java/org/sonarsource/csharp/core/package-info.java",
    "content": "/*\n * SonarSource :: C# :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n@ParametersAreNonnullByDefault\npackage org.sonarsource.csharp.core;\n\nimport javax.annotation.ParametersAreNonnullByDefault;\n"
  },
  {
    "path": "sonar-csharp-core/src/test/java/org/sonarsource/csharp/core/CSharpCoreExtensionsTest.java",
    "content": "/*\n * SonarSource :: C# :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.csharp.core;\n\nimport org.junit.jupiter.api.Test;\nimport org.sonar.api.Plugin;\nimport org.sonar.api.SonarEdition;\nimport org.sonar.api.SonarQubeSide;\nimport org.sonar.api.SonarRuntime;\nimport org.sonar.api.internal.SonarRuntimeImpl;\nimport org.sonar.api.utils.Version;\nimport org.sonarsource.dotnet.shared.plugins.CodeCoverageProvider;\nimport org.sonarsource.dotnet.shared.plugins.DotNetRulesDefinition;\nimport org.sonarsource.dotnet.shared.plugins.EncodingPerFile;\nimport org.sonarsource.dotnet.shared.plugins.GlobalProtobufFileProcessor;\nimport org.sonarsource.dotnet.shared.plugins.HashProvider;\nimport org.sonarsource.dotnet.shared.plugins.MethodDeclarationsCollector;\nimport org.sonarsource.dotnet.shared.plugins.ModuleConfiguration;\nimport org.sonarsource.dotnet.shared.plugins.ProjectTypeCollector;\nimport org.sonarsource.dotnet.shared.plugins.ProtobufDataImporter;\nimport org.sonarsource.dotnet.shared.plugins.RealPathProvider;\nimport org.sonarsource.dotnet.shared.plugins.ReportPathCollector;\nimport org.sonarsource.dotnet.shared.plugins.RoslynDataImporter;\nimport org.sonarsource.dotnet.shared.plugins.RoslynRules;\nimport org.sonarsource.dotnet.shared.plugins.TelemetryCollector;\nimport org.sonarsource.dotnet.shared.plugins.UnitTestResultsProvider;\nimport org.sonarsource.dotnet.shared.plugins.filters.GeneratedFileFilter;\nimport org.sonarsource.dotnet.shared.plugins.filters.WrongEncodingFileFilter;\nimport org.sonarsource.dotnet.shared.plugins.sensors.AnalysisWarningsSensor;\nimport org.sonarsource.dotnet.shared.plugins.sensors.DotNetSensor;\nimport org.sonarsource.dotnet.shared.plugins.sensors.FileTypeSensor;\nimport org.sonarsource.dotnet.shared.plugins.sensors.LogSensor;\nimport org.sonarsource.dotnet.shared.plugins.sensors.MethodDeclarationsSensor;\nimport org.sonarsource.dotnet.shared.plugins.sensors.PropertiesSensor;\nimport org.sonarsource.dotnet.shared.plugins.sensors.TelemetryJsonProcessor;\nimport org.sonarsource.dotnet.shared.plugins.sensors.TelemetryJsonProjectCollector;\nimport org.sonarsource.dotnet.shared.plugins.sensors.TelemetryJsonSensor;\nimport org.sonarsource.dotnet.shared.plugins.sensors.TelemetryProcessor;\nimport org.sonarsource.dotnet.shared.plugins.sensors.TelemetrySensor;\nimport org.sonarsource.dotnet.shared.plugins.telemetryjson.TelemetryJsonCollector;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.sonarsource.dotnet.shared.PropertyUtils.nonProperties;\n\nclass CSharpCoreExtensionsTest {\n\n  @Test\n  void register_scanner() {\n    SonarRuntime sonarRuntime = SonarRuntimeImpl.forSonarQube(Version.create(9, 9), SonarQubeSide.SCANNER, SonarEdition.COMMUNITY);\n    Plugin.Context context = new Plugin.Context(sonarRuntime);\n    CSharpCoreExtensions.register(context, TestCSharpMetadata.INSTANCE);\n    var extensions = context.getExtensions();\n\n    Object[] expectedExtensions = new Object[]{\n      ModuleConfiguration.class,\n      FileTypeSensor.class,\n      LogSensor.class,\n      MethodDeclarationsCollector.class,\n      MethodDeclarationsSensor.class,\n      TelemetryCollector.class,\n      TelemetrySensor.class,\n      TelemetryProcessor.class,\n      TelemetryJsonCollector.class,\n      TelemetryJsonSensor.class,\n      TelemetryJsonProcessor.class,\n      TelemetryJsonProjectCollector.class,\n      RealPathProvider.class,\n      PropertiesSensor.class,\n      ProjectTypeCollector.class,\n      ReportPathCollector.class,\n      CSharpSonarWayProfile.class,\n      DotNetRulesDefinition.class,\n      GlobalProtobufFileProcessor.class,\n      RoslynRules.class,\n      DotNetSensor.class,\n      TestCSharpMetadata.INSTANCE,\n      CSharpCorePluginMetadata.CSharp.class,\n      CSharpLanguageConfiguration.class,\n      EncodingPerFile.class,\n      WrongEncodingFileFilter.class,\n      GeneratedFileFilter.class,\n      HashProvider.class,\n      AnalysisWarningsSensor.class,\n      CSharpFileCacheSensor.class,\n      ProtobufDataImporter.class,\n      RoslynDataImporter.class\n    };\n\n    assertThat(nonProperties(extensions)).contains(expectedExtensions);\n\n    assertThat(extensions).hasSize(\n      expectedExtensions.length\n        + new CodeCoverageProvider(TestCSharpMetadata.INSTANCE).extensions().size()\n        + new UnitTestResultsProvider(TestCSharpMetadata.INSTANCE).extensions().size()\n        + new CSharpPropertyDefinitions(TestCSharpMetadata.INSTANCE).create().size());\n  }\n\n  @Test\n  void register_sonarlint() {\n    SonarRuntime sonarRuntime = SonarRuntimeImpl.forSonarLint(Version.create(9, 9));\n    Plugin.Context context = new Plugin.Context(sonarRuntime);\n    CSharpCoreExtensions.register(context, TestCSharpMetadata.INSTANCE);\n    var extensions = context.getExtensions();\n\n    Object[] expectedExtensions = new Object[]{\n      DotNetRulesDefinition.class,\n      RoslynRules.class,\n      TestCSharpMetadata.INSTANCE,\n    };\n\n    assertThat(extensions).containsExactlyInAnyOrder(expectedExtensions);\n  }\n}\n"
  },
  {
    "path": "sonar-csharp-core/src/test/java/org/sonarsource/csharp/core/CSharpCorePluginMetadataTest.java",
    "content": "/*\n * SonarSource :: C# :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.csharp.core;\n\nimport org.junit.jupiter.api.Test;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nclass CSharpCorePluginMetadataTest {\n\n  @Test\n  void pluginProperties() {\n    CSharpCorePluginMetadata sut = new CSharpCorePluginMetadata() {\n      @Override\n      public String pluginKey() {\n        return null;\n      }\n\n      @Override\n      public String analyzerProjectName() {\n        return null;\n      }\n\n      @Override\n      public String resourcesDirectory() {\n        return null;\n      }\n    };\n    assertThat(sut.languageKey()).isEqualTo(\"cs\");\n    assertThat(sut.languageName()).isEqualTo(\"C#\");\n    assertThat(sut.repositoryKey()).isEqualTo(\"csharpsquid\");\n    assertThat(sut.fileSuffixesKey()).isEqualTo(\"sonar.cs.file.suffixes\");\n    assertThat(sut.fileSuffixesDefaultValue()).isEqualTo(\".cs,.razor\");\n  }\n}\n"
  },
  {
    "path": "sonar-csharp-core/src/test/java/org/sonarsource/csharp/core/CSharpFileCacheSensorTest.java",
    "content": "/*\n * SonarSource :: C# :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.csharp.core;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.nio.file.Path;\nimport java.security.NoSuchAlgorithmException;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\nimport org.junit.jupiter.api.io.TempDir;\nimport org.slf4j.event.Level;\nimport org.sonar.api.batch.fs.InputFile;\nimport org.sonar.api.batch.fs.internal.TestInputFileBuilder;\nimport org.sonar.api.batch.sensor.cache.WriteCache;\nimport org.sonar.api.batch.sensor.internal.SensorContextTester;\nimport org.sonar.api.config.internal.MapSettings;\nimport org.sonar.api.testfixtures.log.LogTesterJUnit5;\nimport org.sonarsource.dotnet.shared.plugins.HashProvider;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.ArgumentMatchers.any;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\nclass CSharpFileCacheSensorTest {\n  @TempDir\n  public Path basePath;\n\n  @RegisterExtension\n  public LogTesterJUnit5 logTester = new LogTesterJUnit5().setLevel(Level.DEBUG);\n\n  @Test\n  void execute_whenCacheIsEnabled_itAddsOnlyTheLanguageFiles() throws IOException, NoSuchAlgorithmException {\n    var canonicalBasePath = new File(basePath.toString()).getCanonicalPath();\n    var settings = new MapSettings();\n    settings.setProperty(TestCSharpMetadata.INSTANCE.fileSuffixesKey(), \".cs\");\n    settings.setProperty(\"sonar.pullrequest.cache.basepath\", canonicalBasePath);\n    var hashProvider = mock(HashProvider.class);\n    when(hashProvider.computeHash(any())).thenReturn(new byte[]{42});\n    var context = SensorContextTester.create(basePath);\n    context.setCacheEnabled(true);\n    context.setSettings(settings);\n    context.setNextCache(mock(WriteCache.class));\n    AddFile(context, basePath.toString(), \"CSharp/Foo.cs\", TestCSharpMetadata.INSTANCE.languageKey());\n    AddFile(context, basePath.toString(), \"CSharp/Foo.cshtml\", TestCSharpMetadata.INSTANCE.languageKey());\n    AddFile(context, basePath.toString(), \"CSharp/Foo.razor\", TestCSharpMetadata.INSTANCE.languageKey());\n    AddFile(context, basePath.toString(), \"VB/Bar.vb\", \"other-language-key\");\n    var sut = new CSharpFileCacheSensor(TestCSharpMetadata.INSTANCE, hashProvider);\n\n    sut.execute(context);\n\n    assertThat(logTester.logs(Level.WARN)).isEmpty();\n    assertThat(logTester.logs(Level.DEBUG)).containsExactly(\n      \"Incremental PR analysis: Preparing to upload file hashes.\",\n      \"Incremental PR analysis: basePathUri: \" + Path.of(canonicalBasePath).toUri(),\n      \"Incremental PR analysis: Adding hash for 'CSharp/Foo.cs' to the cache.\",\n      \"Incremental PR analysis: Adding hash for 'CSharp/Foo.cshtml' to the cache.\",\n      \"Incremental PR analysis: Adding hash for 'CSharp/Foo.razor' to the cache.\"\n    );\n  }\n\n  private static void AddFile(SensorContextTester context, String basePath, String filePath, String languageKey) {\n    context.fileSystem().add(new TestInputFileBuilder(\"project-key\", new File(basePath), new File(basePath, filePath)).setLanguage(languageKey).setType(InputFile.Type.MAIN).build());\n  }\n}\n"
  },
  {
    "path": "sonar-csharp-core/src/test/java/org/sonarsource/csharp/core/CSharpLanguageConfigurationTest.java",
    "content": "/*\n * SonarSource :: C# :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.csharp.core;\n\nimport java.util.Optional;\nimport org.junit.jupiter.api.Test;\nimport org.sonar.api.config.Configuration;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\nclass CSharpLanguageConfigurationTest {\n\n  @Test\n  void reads_correct_language() {\n    Configuration configuration = mock(Configuration.class);\n    when(configuration.getStringArray(\"sonar.cs.roslyn.bugCategories\")).thenReturn(new String[]{\"C#\"});\n    when(configuration.getStringArray(\"sonar.vbnet.roslyn.bugCategories\")).thenReturn(new String[]{\"VB.NET\"});\n    CSharpLanguageConfiguration config = new CSharpLanguageConfiguration(configuration, TestCSharpMetadata.INSTANCE);\n\n    assertThat(config.bugCategories()).containsExactly(\"C#\");\n  }\n\n  @Test\n  void whenSettingIsTrue_analyzeRazorCode_returnsTrue() {\n    Configuration configuration = mock(Configuration.class);\n    when(configuration.getBoolean(\"sonar.cs.analyzeRazorCode\")).thenReturn(Optional.of(true));\n\n    CSharpLanguageConfiguration config = new CSharpLanguageConfiguration(configuration, TestCSharpMetadata.INSTANCE);\n\n    assertThat(config.analyzeRazorCode()).isTrue();\n  }\n\n  @Test\n  void whenSettingIsFalse_analyzeRazorCode_returnsFalse() {\n    Configuration configuration = mock(Configuration.class);\n    when(configuration.getBoolean(\"sonar.cs.analyzeRazorCode\")).thenReturn(Optional.of(false));\n\n    CSharpLanguageConfiguration config = new CSharpLanguageConfiguration(configuration, TestCSharpMetadata.INSTANCE);\n\n    assertThat(config.analyzeRazorCode()).isFalse();\n  }\n\n  @Test\n  void whenSettingIsEmpty_analyzeRazorCode_returnsTrue() {\n    Configuration configuration = mock(Configuration.class);\n    when(configuration.getBoolean(\"sonar.cs.analyzeRazorCode\")).thenReturn(Optional.empty());\n\n    CSharpLanguageConfiguration config = new CSharpLanguageConfiguration(configuration, TestCSharpMetadata.INSTANCE);\n\n    assertThat(config.analyzeRazorCode()).isTrue();\n  }\n}\n"
  },
  {
    "path": "sonar-csharp-core/src/test/java/org/sonarsource/csharp/core/CSharpPropertyDefinitionsTest.java",
    "content": "/*\n * SonarSource :: C# :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.csharp.core;\n\nimport java.util.List;\nimport org.junit.jupiter.api.Test;\nimport org.sonar.api.config.PropertyDefinition;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nclass CSharpPropertyDefinitionsTest {\n\n  @Test\n  void create() {\n    CSharpPropertyDefinitions sut = new CSharpPropertyDefinitions(TestCSharpMetadata.INSTANCE);\n    List<PropertyDefinition> properties = sut.create();\n    assertThat(properties)\n      .hasSize(18)\n      .extracting(PropertyDefinition::name).containsOnlyOnce(\"Analyze Razor code\");\n  }\n\n  @Test\n  void create_containsScannerForDotNetProperties() {\n    CSharpPropertyDefinitions sut = new CSharpPropertyDefinitions(TestCSharpMetadata.INSTANCE);\n    List<PropertyDefinition> properties = sut.create();\n    // These must exist for S4NET to download the ZIP with analyzers from the server and populate the Sonar-cs.ruleset.\n    assertThat(properties)\n      .extracting(PropertyDefinition::key)\n      .contains(\n        \"sonar.cs.analyzer.dotnet.pluginKey\",\n        \"sonar.cs.analyzer.dotnet.pluginVersion\",\n        \"sonar.cs.analyzer.dotnet.staticResourceName\");\n  }\n\n  @Test\n  void create_containsLegacyScannerForDotNetProperties() {\n    CSharpPropertyDefinitions sut = new CSharpPropertyDefinitions(TestCSharpMetadata.INSTANCE);\n    List<PropertyDefinition> properties = sut.create();\n    // These must exist for S4NET <= 9.0.2 to download the ZIP with analyzers from the server and populate the Sonar-cs.ruleset.\n    assertThat(properties)\n      .extracting(PropertyDefinition::key)\n      .contains(\n        \"sonaranalyzer-cs.pluginKey\",\n        \"sonaranalyzer-cs.pluginVersion\",\n        \"sonaranalyzer-cs.staticResourceName\",\n        \"sonaranalyzer-cs.analyzerId\",\n        \"sonaranalyzer-cs.ruleNamespace\");\n  }\n\n  @Test\n  void getAnalyzeRazorCode() {\n    CSharpPropertyDefinitions sut = new CSharpPropertyDefinitions(TestCSharpMetadata.INSTANCE);\n    assertThat(sut.getAnalyzeRazorCode(\"LANG\")).isEqualTo(\"sonar.LANG.analyzeRazorCode\");\n  }\n}\n"
  },
  {
    "path": "sonar-csharp-core/src/test/java/org/sonarsource/csharp/core/CSharpSonarWayProfileTest.java",
    "content": "/*\n * SonarSource :: C# :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.csharp.core;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport org.junit.jupiter.api.BeforeAll;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\nimport org.slf4j.event.Level;\nimport org.sonar.api.rule.RuleKey;\nimport org.sonar.api.server.profile.BuiltInQualityProfilesDefinition.BuiltInQualityProfile;\nimport org.sonar.api.server.profile.BuiltInQualityProfilesDefinition.Context;\nimport org.sonar.api.testfixtures.log.LogTesterJUnit5;\nimport org.sonar.plugins.csharpenterprise.api.ProfileRegistrar;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\nimport org.sonarsource.dotnet.shared.plugins.RoslynRules;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\nclass CSharpSonarWayProfileTest {\n  @RegisterExtension\n  public LogTesterJUnit5 logTester = new LogTesterJUnit5().setLevel(Level.DEBUG);\n\n  private static RoslynRules roslynRules;\n  private static PluginMetadata metadata = new TestCSharpMetadata() {\n    @Override\n    public String resourcesDirectory() {\n      return \"CSharpSonarWayProfileTest\";\n    }\n  };\n\n  @BeforeAll\n  public static void beforeAll() {\n    roslynRules = mock(RoslynRules.class);\n    when(roslynRules.rules()).thenReturn(new ArrayList<>());\n  }\n\n  @Test\n  void profileRegistrars_registerRules() {\n    Context context = new Context();\n    ProfileRegistrar[] profileRegistrars = new ProfileRegistrar[]{\n      registrarContext -> {\n        registrarContext.registerDefaultQualityProfileRules(\n          List.of(RuleKey.of(metadata.repositoryKey(), \"additionalRule\"))\n        );\n      }};\n    CSharpSonarWayProfile sonarWay = new CSharpSonarWayProfile(metadata, roslynRules, profileRegistrars);\n    sonarWay.define(context);\n\n    BuiltInQualityProfile builtIn = context.profile(\"cs\", \"Sonar way\");\n    assertThat(builtIn.language()).isEqualTo(metadata.languageKey());\n    assertThat(builtIn.rule(RuleKey.of(metadata.repositoryKey(), \"additionalRule\"))).isNotNull();\n  }\n}\n"
  },
  {
    "path": "sonar-csharp-core/src/test/java/org/sonarsource/csharp/core/CSharpTest.java",
    "content": "/*\n * SonarSource :: C# :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.csharp.core;\n\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.sonar.api.config.PropertyDefinitions;\nimport org.sonar.api.config.internal.MapSettings;\nimport org.sonar.api.resources.AbstractLanguage;\nimport org.sonar.api.utils.System2;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.Mockito.mock;\n\nclass CSharpTest {\n\n  private MapSettings settings;\n  private CSharpCorePluginMetadata.CSharp csharp;\n\n  @BeforeEach\n  public void init() {\n    PropertyDefinitions defs = new PropertyDefinitions(mock(System2.class),\n      new CSharpPropertyDefinitions(TestCSharpMetadata.INSTANCE).create());\n    settings = new MapSettings(defs);\n    csharp = TestCSharpMetadata.INSTANCE.new CSharp(settings.asConfig());\n  }\n\n  @Test\n  void shouldGetDefaultFileSuffixes() {\n    assertThat(csharp.getFileSuffixes()).containsOnly(\".cs\", \".razor\");\n  }\n\n  @Test\n  void shouldGetCustomFileSuffixes() {\n    settings.setProperty(TestCSharpMetadata.INSTANCE.fileSuffixesKey(), \".cs,.csharp\");\n    assertThat(csharp.getFileSuffixes()).containsOnly(\".cs\", \".csharp\");\n  }\n\n  @Test\n  void equals_and_hashCode_considers_configuration() {\n    MapSettings otherSettings = new MapSettings();\n    otherSettings.setProperty(\"key\", \"value\");\n    TestCSharpMetadata.CSharp otherCSharp = TestCSharpMetadata.INSTANCE.new CSharp(otherSettings.asConfig());\n    TestCSharpMetadata.CSharp sameCSharp = TestCSharpMetadata.INSTANCE.new CSharp(settings.asConfig());\n    FakeCSharp fakeCSharp = new FakeCSharp();\n\n    assertThat(csharp).isEqualTo(sameCSharp)\n      .isNotEqualTo(otherCSharp)\n      .isNotEqualTo(fakeCSharp)\n      .isNotEqualTo(null)\n      .hasSameHashCodeAs(sameCSharp);\n    assertThat(csharp.hashCode()).isNotEqualTo(otherCSharp.hashCode());\n  }\n\n  private class FakeCSharp extends AbstractLanguage {\n\n    public FakeCSharp() {\n      super(TestCSharpMetadata.INSTANCE.languageKey(), TestCSharpMetadata.INSTANCE.languageName());\n    }\n\n    @Override\n    public String[] getFileSuffixes() {\n      return new String[0];\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-csharp-core/src/test/java/org/sonarsource/csharp/core/TestCSharpMetadata.java",
    "content": "/*\n * SonarSource :: C# :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.csharp.core;\n\nclass TestCSharpMetadata extends CSharpCorePluginMetadata {\n\n  public static final TestCSharpMetadata INSTANCE = new TestCSharpMetadata();\n\n  @Override\n  public String pluginKey() {\n    return \"CSharp Test Plugin Key\";\n  }\n\n  @Override\n  public String analyzerProjectName() {\n    return \"CSharp Test Project Name\";\n  }\n\n  @Override\n  public String resourcesDirectory() {\n    return \"CSharp Test Resources Directory\";\n  }\n}\n"
  },
  {
    "path": "sonar-csharp-core/src/test/resources/CSharpSonarWayProfileTest/Sonar_way_profile.json",
    "content": "{\n  \"name\": \"Sonar way\",\n  \"ruleKeys\": [\n  ]\n}\n"
  },
  {
    "path": "sonar-csharp-plugin/README.md",
    "content": "# Code Quality and Security for C\\#\r\n\r\nThis folder contains the code specific to the C# plugin for SonarQube.\r\n\r\nTo get more information please read the repository main [README](../README.md).\r\n"
  },
  {
    "path": "sonar-csharp-plugin/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <parent>\n    <groupId>org.sonarsource.dotnet</groupId>\n    <artifactId>sonar-dotnet</artifactId>\n    <version>10.26-SNAPSHOT</version>\n  </parent>\n\n  <artifactId>sonar-csharp-plugin</artifactId>\n  <packaging>sonar-plugin</packaging>\n\n  <name>SonarC#</name>\n  <description>Code Analyzer for C#</description>\n  <url>http://redirect.sonarsource.com/plugins/csharp.html</url>\n  <inceptionYear>2014</inceptionYear>\n\n  <licenses>\n    <license>\n      <name>SSALv1</name>\n      <url>https://sonarsource.com/license/ssal/</url>\n      <distribution>repo</distribution>\n    </license>\n  </licenses>\n\n  <dependencies>\n    <!-- provided at runtime -->\n    <dependency>\n      <groupId>org.sonarsource.api.plugin</groupId>\n      <artifactId>sonar-plugin-api</artifactId>\n    </dependency>\n    <dependency>\n      <groupId>org.slf4j</groupId>\n      <artifactId>slf4j-api</artifactId>\n      <scope>provided</scope>\n    </dependency>\n\n    <!-- compiled -->\n    <dependency>\n      <groupId>${project.groupId}</groupId>\n      <artifactId>sonar-dotnet-core</artifactId>\n      <version>${project.version}</version>\n    </dependency>\n    <dependency>\n      <groupId>${project.groupId}</groupId>\n      <artifactId>sonar-csharp-core</artifactId>\n      <version>${project.version}</version>\n    </dependency>\n    <dependency>\n      <groupId>org.sonarsource.analyzer-commons</groupId>\n      <artifactId>sonar-analyzer-commons</artifactId>\n    </dependency>\n\n    <!-- test dependencies -->\n    <dependency>\n      <groupId>org.junit.jupiter</groupId>\n      <artifactId>junit-jupiter-engine</artifactId>\n    </dependency>\n    <dependency>\n      <groupId>org.assertj</groupId>\n      <artifactId>assertj-core</artifactId>\n    </dependency>\n    <dependency>\n      <groupId>org.apache.commons</groupId>\n      <artifactId>commons-lang3</artifactId>\n    </dependency>\n    <dependency>\n      <groupId>org.mockito</groupId>\n      <artifactId>mockito-core</artifactId>\n    </dependency>\n    <dependency>\n      <groupId>org.codehaus.woodstox</groupId>\n      <artifactId>stax2-api</artifactId>\n    </dependency>\n    <dependency>\n      <groupId>org.codehaus.staxmate</groupId>\n      <artifactId>staxmate</artifactId>\n      <exclusions>\n        <exclusion>\n          <groupId>org.codehaus.woodstox</groupId>\n          <artifactId>woodstox-core-asl</artifactId>\n        </exclusion>\n        <exclusion>\n          <groupId>stax</groupId>\n          <artifactId>stax-api</artifactId>\n        </exclusion>\n        <exclusion>\n          <groupId>org.codehaus.woodstox</groupId>\n          <artifactId>stax2-api</artifactId>\n        </exclusion>\n      </exclusions>\n    </dependency>\n    <dependency>\n      <groupId>org.sonarsource.sonarqube</groupId>\n      <artifactId>sonar-plugin-api-impl</artifactId>\n      <exclusions>\n        <exclusion>\n          <groupId>junit</groupId>\n          <artifactId>junit</artifactId>\n        </exclusion>\n      </exclusions>\n    </dependency>\n    <dependency>\n      <groupId>org.sonarsource.api.plugin</groupId>\n      <artifactId>sonar-plugin-api-test-fixtures</artifactId>\n    </dependency>\n  </dependencies>\n\n  <build>\n    <resources>\n      <resource>\n        <directory>../</directory>\n        <targetPath>licenses</targetPath>\n        <includes>\n          <include>LICENSE.txt</include>\n        </includes>\n      </resource>\n      <resource>\n        <directory>../Licenses/THIRD_PARTY_LICENSES</directory>\n        <targetPath>licenses/THIRD_PARTY_LICENSES</targetPath>\n        <excludes>\n          <exclude>org.sonarsource.dotnet.sonar-vbnet-core-LICENSE.txt</exclude>\n        </excludes>\n      </resource>\n      <resource>\n        <directory>${sonarAnalyzer.workDirectory}</directory>\n        <includes>\n          <include>org/sonar/plugins/csharp/*.json</include>\n          <include>org/sonar/plugins/csharp/*.html</include>\n          <include>static/SonarAnalyzer-csharp-${project.version}.zip</include>\n        </includes>\n      </resource>\n    </resources>\n\n    <plugins>\n      <plugin>\n        <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId>\n        <artifactId>sonar-packaging-maven-plugin</artifactId>\n        <configuration>\n          <pluginName>C# Code Quality and Security</pluginName>\n          <pluginClass>org.sonar.plugins.csharp.CSharpPlugin</pluginClass>\n          <skipDependenciesPackaging>true</skipDependenciesPackaging>\n          <sonarLintSupported>false</sonarLintSupported>\n          <pluginApiMinVersion>${plugin.api.min.version}</pluginApiMinVersion>\n          <requiredForLanguages>cs</requiredForLanguages>\n        </configuration>\n      </plugin>\n      <plugin>\n        <artifactId>maven-shade-plugin</artifactId>\n        <executions>\n          <execution>\n            <phase>package</phase>\n            <goals>\n              <goal>shade</goal>\n            </goals>\n            <configuration>\n              <shadedArtifactAttached>false</shadedArtifactAttached>\n              <createDependencyReducedPom>false</createDependencyReducedPom>\n              <minimizeJar>true</minimizeJar>\n              <filters>\n                <filter>\n                  <artifact>*:*</artifact>\n                  <excludes>\n                    <exclude>META-INF/LICENSE*</exclude>\n                    <exclude>META-INF/NOTICE*</exclude>\n                    <exclude>META-INF/*.RSA</exclude>\n                    <exclude>META-INF/*.SF</exclude>\n                    <exclude>license/*</exclude>\n                    <exclude>LICENSE*</exclude>\n                    <exclude>NOTICE*</exclude>\n                  </excludes>\n                </filter>\n              </filters>\n            </configuration>\n          </execution>\n        </executions>\n      </plugin>\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-enforcer-plugin</artifactId>\n        <executions>\n          <execution>\n            <id>enforce-plugin-size</id>\n            <goals>\n              <goal>enforce</goal>\n            </goals>\n            <phase>verify</phase>\n            <configuration>\n              <rules>\n                <requireFilesSize>\n                  <maxsize>5800000</maxsize>\n                  <minsize>5600000</minsize>\n                  <files>\n                    <file>${project.build.directory}/${project.build.finalName}.jar</file>\n                  </files>\n                </requireFilesSize>\n              </rules>\n            </configuration>\n          </execution>\n        </executions>\n      </plugin>\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-antrun-plugin</artifactId>\n        <version>3.2.0</version>\n        <executions>\n          <execution>\n            <id>copy-analyzer-data</id>\n            <phase>validate</phase>\n            <configuration>\n              <exportAntProperties>true</exportAntProperties>\n              <target>\n                <copy todir=\"${sonarAnalyzer.workDirectory}/SonarAnalyzer.CSharp\">\n                  <fileset dir=\"${packaging.directory}/binaries/SonarAnalyzer.CSharp/\">\n                    <include name=\"*.dll\"/>\n                  </fileset>\n                </copy>\n                <copy todir=\"${sonarAnalyzer.workDirectory}/SonarAnalyzer.CSharp/licenses/\">\n                  <fileset dir=\"${project.build.directory}/../..\">\n                    <include name=\"LICENSE.txt\"/>\n                  </fileset>\n                </copy>\n                <copy todir=\"${sonarAnalyzer.workDirectory}/SonarAnalyzer.CSharp/licenses/THIRD_PARTY_LICENSES/\">\n                  <fileset dir=\"${packaging.directory}/Licenses/THIRD_PARTY_LICENSES/\">\n                    <include name=\"*.txt\"/>\n                  </fileset>\n                </copy>\n                <zip destfile=\"${sonarAnalyzer.workDirectory}/static/SonarAnalyzer-csharp-${project.version}.zip\"\n                     basedir=\"${sonarAnalyzer.workDirectory}/SonarAnalyzer.CSharp\"/>\n                <copy todir=\"${sonarAnalyzer.workDirectory}/org/sonar/plugins/csharp\">\n                  <fileset dir=\"${rspec.directory}/cs\">\n                    <include name=\"*.json\"/>\n                    <include name=\"*.html\"/>\n                  </fileset>\n                </copy>\n                <exec executable=\"dotnet\"\n                      failonerror=\"true\"\n                      dir=\"${packaging.directory}/binaries/RuleDescriptorGenerator\">\n                  <arg value=\"RuleDescriptorGenerator.dll\"/>\n                  <arg value=\"${sonarAnalyzer.workDirectory}/org/sonar/plugins/csharp/Rules.json\"/>\n                  <arg value=\"${packaging.directory}/binaries/SonarAnalyzer.CSharp/SonarAnalyzer.CSharp.dll\"/>\n                </exec>\n              </target>\n            </configuration>\n            <goals>\n              <goal>run</goal>\n            </goals>\n          </execution>\n        </executions>\n      </plugin>\n    </plugins>\n  </build>\n\n</project>\n"
  },
  {
    "path": "sonar-csharp-plugin/src/main/java/org/sonar/plugins/csharp/CSharpPlugin.java",
    "content": "/*\n * SonarC#\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.csharp;\n\nimport org.sonar.api.Plugin;\nimport org.sonarsource.csharp.core.CSharpCoreExtensions;\nimport org.sonarsource.csharp.core.CSharpCorePluginMetadata;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\n\npublic class CSharpPlugin implements Plugin {\n\n  // Do NOT add any public fields here, and do NOT reference them directly. Add them to PluginMetadata and inject the metadata.\n  static final PluginMetadata METADATA = new CSharpPluginMetadata();\n\n  @Override\n  public void define(Context context) {\n    CSharpCoreExtensions.register(context, METADATA);\n  }\n\n  private static class CSharpPluginMetadata extends CSharpCorePluginMetadata {\n\n    @Override\n    public String pluginKey() {\n      return \"csharp\";\n    }\n\n    @Override\n    public String analyzerProjectName() {\n      return \"SonarAnalyzer.CSharp\";\n    }\n\n    @Override\n    public String resourcesDirectory() {\n      return \"/org/sonar/plugins/csharp\";\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-csharp-plugin/src/main/java/org/sonar/plugins/csharp/package-info.java",
    "content": "/*\n * SonarC#\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n@ParametersAreNonnullByDefault\npackage org.sonar.plugins.csharp;\n\nimport javax.annotation.ParametersAreNonnullByDefault;\n\n"
  },
  {
    "path": "sonar-csharp-plugin/src/test/java/org/sonar/plugins/csharp/CSharpPluginTest.java",
    "content": "/*\n * SonarC#\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.csharp;\n\nimport org.junit.jupiter.api.Test;\nimport org.sonar.api.Plugin;\nimport org.sonar.api.SonarEdition;\nimport org.sonar.api.SonarQubeSide;\nimport org.sonar.api.SonarRuntime;\nimport org.sonar.api.internal.SonarRuntimeImpl;\nimport org.sonar.api.utils.Version;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nclass CSharpPluginTest {\n\n  @Test\n  void getExtensions() {\n    SonarRuntime sonarRuntime = SonarRuntimeImpl.forSonarQube(Version.create(7, 9), SonarQubeSide.SCANNER, SonarEdition.COMMUNITY);\n\n    Plugin.Context context = new Plugin.Context(sonarRuntime);\n    new CSharpPlugin().define(context);\n    assertThat(context.getExtensions()).hasSize(64);\n  }\n\n  @Test\n  void pluginProperties() {\n    assertThat(CSharpPlugin.METADATA.languageKey()).isEqualTo(\"cs\");\n    assertThat(CSharpPlugin.METADATA.languageName()).isEqualTo(\"C#\");\n    assertThat(CSharpPlugin.METADATA.repositoryKey()).isEqualTo(\"csharpsquid\");\n    assertThat(CSharpPlugin.METADATA.fileSuffixesKey()).isEqualTo(\"sonar.cs.file.suffixes\");\n    assertThat(CSharpPlugin.METADATA.fileSuffixesDefaultValue()).isEqualTo(\".cs,.razor\");\n    assertThat(CSharpPlugin.METADATA.resourcesDirectory()).isEqualTo(\"/org/sonar/plugins/csharp\");\n    assertThat(CSharpPlugin.METADATA.pluginKey()).isEqualTo(\"csharp\");\n    assertThat(CSharpPlugin.METADATA.analyzerProjectName()).isEqualTo(\"SonarAnalyzer.CSharp\");\n  }\n}\n"
  },
  {
    "path": "sonar-csharp-plugin/src/test/java/org/sonar/plugins/csharp/CSharpRulesDefinitionTest.java",
    "content": "/*\n * SonarC#\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.csharp;\n\nimport org.junit.jupiter.api.BeforeAll;\nimport org.junit.jupiter.api.Test;\nimport org.sonar.api.SonarEdition;\nimport org.sonar.api.SonarQubeSide;\nimport org.sonar.api.SonarRuntime;\nimport org.sonar.api.internal.SonarRuntimeImpl;\nimport org.sonar.api.server.rule.RulesDefinition;\nimport org.sonar.api.utils.Version;\nimport org.sonarsource.dotnet.shared.plugins.DotNetRulesDefinition;\nimport org.sonarsource.dotnet.shared.plugins.RoslynRules;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nclass CSharpRulesDefinitionTest {\n  private static final RulesDefinition.Context CONTEXT = new RulesDefinition.Context();\n  private static final SonarRuntime SONAR_RUNTIME = SonarRuntimeImpl.forSonarQube(Version.create(10, 10), SonarQubeSide.SCANNER,\n    SonarEdition.COMMUNITY);\n  private static final RoslynRules ROSLYN_RULES = new RoslynRules(CSharpPlugin.METADATA);\n\n  private static RulesDefinition.Repository ruleRepo;\n\n  @BeforeAll\n  static void setupContext() {\n    DotNetRulesDefinition definition = new DotNetRulesDefinition(CSharpPlugin.METADATA, SONAR_RUNTIME, ROSLYN_RULES);\n    definition.define(CONTEXT);\n    ruleRepo = CONTEXT.repository(\"csharpsquid\");\n  }\n\n  @Test\n  void rules_areDefined() {\n    assertThat(CONTEXT.repositories()).hasSize(1);\n    RulesDefinition.Rule s100 = ruleRepo.rule(\"S100\");\n    assertThat(s100).isNotNull();\n    assertThat(s100.name()).isEqualTo(\"Methods and properties should be named in PascalCase\");\n  }\n\n  @Test\n  void symbolicExecutionRules_areNotDefined() {\n    assertThat(CONTEXT.repositories()).hasSize(1);\n    assertThat(ruleRepo.rule(\"S2259\")).isNull();\n  }\n\n  @Test\n  void allRules_haveMetadata() {\n    for (RulesDefinition.Rule rule : ruleRepo.rules()) {\n      assertThat(rule.name()).isNotEmpty();\n      assertThat(rule.type()).isNotNull();\n      assertThat(rule.status()).isNotNull();\n      assertThat(rule.severity()).isNotEmpty();\n    }\n  }\n\n  @Test\n  void allRules_haveHtmlDescription() {\n    for (RulesDefinition.Rule rule : ruleRepo.rules()) {\n      assertThat(rule.htmlDescription()).isNotEmpty().hasSizeGreaterThan(100);\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-csharp-plugin/src/test/java/org/sonar/plugins/csharp/CSharpSonarWayProfileTest.java",
    "content": "/*\n * SonarC#\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.csharp;\n\nimport org.junit.jupiter.api.BeforeAll;\nimport org.junit.jupiter.api.Test;\nimport org.sonar.api.rule.RuleKey;\nimport org.sonar.api.server.profile.BuiltInQualityProfilesDefinition.BuiltInQualityProfile;\nimport org.sonar.api.server.profile.BuiltInQualityProfilesDefinition.Context;\nimport org.sonarsource.csharp.core.CSharpSonarWayProfile;\nimport org.sonarsource.dotnet.shared.plugins.RoslynRules;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nclass CSharpSonarWayProfileTest {\n\n  private static final RoslynRules ROSLYN_RULES = new RoslynRules(CSharpPlugin.METADATA);\n  private static final String REPOSITORY_KEY = CSharpPlugin.METADATA.repositoryKey();\n  private static BuiltInQualityProfile profile;\n\n  @BeforeAll\n  static void setup() {\n    Context context = new Context();\n    CSharpSonarWayProfile profileDef = new CSharpSonarWayProfile(CSharpPlugin.METADATA, ROSLYN_RULES, null);\n    profileDef.define(context);\n    profile = context.profile(\"cs\", \"Sonar way\");\n  }\n\n  @Test\n  void expected_rules_in_sonar_way() {\n    // SonarWay rules\n    assertThat(profile.rule(RuleKey.of(REPOSITORY_KEY, \"S2198\"))).isNotNull();\n    assertThat(profile.rule(RuleKey.of(REPOSITORY_KEY, \"S2223\"))).isNotNull();\n\n    // Non Sonarway rules\n    assertThat(profile.rule(RuleKey.of(REPOSITORY_KEY, \"S2330\"))).isNull();\n    assertThat(profile.rule(RuleKey.of(REPOSITORY_KEY, \"S2952\"))).isNull();\n  }\n\n  @Test\n  void hotspots_in_sonar_way() {\n    assertThat(profile.rule(RuleKey.of(REPOSITORY_KEY, \"S1313\"))).isNotNull();\n    assertThat(profile.rule(RuleKey.of(REPOSITORY_KEY, \"S2068\"))).isNotNull();\n    assertThat(profile.rule(RuleKey.of(REPOSITORY_KEY, \"S2092\"))).isNotNull();\n    assertThat(profile.rule(RuleKey.of(REPOSITORY_KEY, \"S2245\"))).isNotNull();\n    assertThat(profile.rule(RuleKey.of(REPOSITORY_KEY, \"S3330\"))).isNotNull();\n    assertThat(profile.rule(RuleKey.of(REPOSITORY_KEY, \"S4507\"))).isNotNull();\n    assertThat(profile.rule(RuleKey.of(REPOSITORY_KEY, \"S4790\"))).isNotNull();\n    assertThat(profile.rule(RuleKey.of(REPOSITORY_KEY, \"S5042\"))).isNotNull();\n    assertThat(profile.rule(RuleKey.of(REPOSITORY_KEY, \"S2077\"))).isNotNull();\n    assertThat(profile.rule(RuleKey.of(REPOSITORY_KEY, \"S5766\"))).isNotNull();\n  }\n\n  @Test\n  void symbolic_execution_not_in_sonar_way() {\n    assertThat(profile.rule(RuleKey.of(REPOSITORY_KEY, \"S2222\"))).isNull();\n    assertThat(profile.rule(RuleKey.of(REPOSITORY_KEY, \"S2259\"))).isNull();\n    assertThat(profile.rule(RuleKey.of(REPOSITORY_KEY, \"S2583\"))).isNull();\n    assertThat(profile.rule(RuleKey.of(REPOSITORY_KEY, \"S2589\"))).isNull();\n  }\n}\n"
  },
  {
    "path": "sonar-csharp-plugin/src/test/resources/Program.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Diagnostics.CodeAnalysis;\n\n\n//-----------------------------------------------------------------------\n// <copyright file=\"ArgumentValidation.cs\" company=\"SonarSource SA and Microsoft Corporation\">\n//   Copyright (c) SonarSource SA and Microsoft Corporation.  All rights reserved.\n//   Licensed under the MIT License. See License.txt in the project root for license information.\n// </copyright>\n//-----------------------------------------------------------------------\nnamespace ConsoleApplication1\n{\n    /// <summary>\n    /// Static methods that implement aspects of the NUnit framework that cut\n    /// across individual test types, extensions, etc. Some of these use the\n    /// methods of the Reflect class to implement operations specific to the\n    /// NUnit Framework.\n    /// </summary>\n    public class Program\n    {\n        public static int Add(int op1, int op2)\n        {\n            if (op1 == 0)\n            {\n                return op2;\n            }\n\n            if (op2 == 0)\n            {\n                return op1;\n            }\n\n            return op1 + op2;\n        }\n\n        static void Main(string[] args)\n        {\n        }\n    }\n\n    class IFoo\n    {\n    }\n\n    class IBar  // NOSONAR\n    {\n    }\n\n    [SuppressMessage(\"Maintainability\", \"S2326:Unused type parameters should be removed\")]\n    class MoreMath<T> // Noncompliant; <T>is ignored\n    {\n        public int Add<T>(int a, int b) // Noncompliant; <T> is ignored\n        {\n            return a + b;\n        }\n    }\n\n}\n"
  },
  {
    "path": "sonar-csharp-plugin/src/test/scripts/echo.bat",
    "content": "@ECHO OFF\n@ECHO \"Parameter: \" + %1\n"
  },
  {
    "path": "sonar-csharp-plugin/src/test/scripts/echo.sh",
    "content": "#!/bin/sh\necho \"Parameter: \" + $1"
  },
  {
    "path": "sonar-csharp-plugin/src/test/scripts/forever.bat",
    "content": "@ECHO OFF\n\n:LOOP\n  @ping 127.0.0.1 -n 2 -w 1000 > nul\nGOTO LOOP\n"
  },
  {
    "path": "sonar-csharp-plugin/src/test/scripts/forever.sh",
    "content": "#!/bin/sh\nwhile test \"notempty\"\ndo\n  sleep 1\ndone"
  },
  {
    "path": "sonar-dotnet-core/README.md",
    "content": "# Common code for C\\# and VB.NET SonarQube plugins\n\nThis folder contains the common code for the C# and VB.NET plugins for SonarQube.\n\nTo get more information please read the repository main [README](../README.md).\n"
  },
  {
    "path": "sonar-dotnet-core/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <parent>\n    <groupId>org.sonarsource.dotnet</groupId>\n    <artifactId>sonar-dotnet</artifactId>\n    <version>10.26-SNAPSHOT</version>\n  </parent>\n\n  <artifactId>sonar-dotnet-core</artifactId>\n\n  <name>SonarSource :: .NET :: Core</name>\n  <description>Share code between C# and VB.NET plugins</description>\n\n  <properties>\n    <protobuf.version>4.34.1</protobuf.version>\n    <protobuf.compiler>${settings.localRepository}/com/google/protobuf/protoc/${protobuf.version}/protoc-${protobuf.version}-${os.detected.classifier}.exe</protobuf.compiler>\n    <sonar.exclusions>target/generated-sources/protobuf/**</sonar.exclusions>\n  </properties>\n\n  <dependencies>\n    <!-- provided at runtime -->\n    <dependency>\n      <groupId>org.sonarsource.api.plugin</groupId>\n      <artifactId>sonar-plugin-api</artifactId>\n    </dependency>\n    <dependency>\n      <groupId>org.slf4j</groupId>\n      <artifactId>slf4j-api</artifactId>\n      <scope>provided</scope>\n    </dependency>\n\n    <!-- Compile dependencies -->\n    <dependency>\n      <groupId>com.google.code.gson</groupId>\n      <artifactId>gson</artifactId>\n      <version>2.13.2</version>\n    </dependency>\n    <dependency>\n      <groupId>com.google.protobuf</groupId>\n      <artifactId>protobuf-java</artifactId>\n      <version>${protobuf.version}</version>\n    </dependency>\n    <dependency>\n      <groupId>org.sonarsource.analyzer-commons</groupId>\n      <artifactId>sonar-analyzer-commons</artifactId>\n    </dependency>\n    <dependency>\n      <groupId>org.sonarsource.analyzer-commons</groupId>\n      <artifactId>sonar-xml-parsing</artifactId>\n      <version>${sonar.analyzer.commons.version}</version>\n    </dependency>\n\n    <!-- unit tests -->\n    <dependency>\n      <groupId>commons-io</groupId>\n      <artifactId>commons-io</artifactId>\n      <version>2.22.0</version>\n      <scope>test</scope>\n    </dependency>\n    <dependency>\n      <groupId>org.apache.commons</groupId>\n      <artifactId>commons-lang3</artifactId>\n    </dependency>\n    <dependency>\n      <groupId>org.sonarsource.api.plugin</groupId>\n      <artifactId>sonar-plugin-api-test-fixtures</artifactId>\n    </dependency>\n    <dependency>\n      <groupId>org.assertj</groupId>\n      <artifactId>assertj-core</artifactId>\n    </dependency>\n    <dependency>\n      <groupId>org.mockito</groupId>\n      <artifactId>mockito-core</artifactId>\n    </dependency>\n    <dependency>\n      <groupId>org.sonarsource.sonarqube</groupId>\n      <artifactId>sonar-plugin-api-impl</artifactId>\n    </dependency>\n  </dependencies>\n\n  <build>\n    <extensions>\n      <extension>\n        <groupId>kr.motd.maven</groupId>\n        <artifactId>os-maven-plugin</artifactId>\n        <version>1.7.1</version>\n      </extension>\n    </extensions>\n    <pluginManagement>\n      <plugins>\n        <plugin>\n          <groupId>org.apache.maven.plugins</groupId>\n          <artifactId>maven-antrun-plugin</artifactId>\n          <version>3.2.0</version>\n        </plugin>\n        <plugin>\n          <groupId>org.codehaus.mojo</groupId>\n          <artifactId>build-helper-maven-plugin</artifactId>\n          <version>3.6.1</version>\n        </plugin>\n      </plugins>\n    </pluginManagement>\n    <plugins>\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-antrun-plugin</artifactId>\n        <executions>\n          <execution>\n            <id>compile-protobuf-sources</id>\n            <phase>generate-sources</phase>\n            <goals>\n              <goal>run</goal>\n            </goals>\n            <configuration>\n              <target>\n                <property name=\"proto.path\" location=\"${project.basedir}/../analyzers/src/SonarAnalyzer.Core/Protobuf\"/>\n                <fileset id=\"fileset\" dir=\"${proto.path}\">\n                  <include name=\"*.proto\"/>\n                </fileset>\n                <pathconvert refid=\"fileset\" property=\"protos\" pathsep=\" \"/>\n                <mkdir dir=\"${project.build.directory}/generated-sources/protobuf\"/>\n                <chmod file=\"${protobuf.compiler}\" perm=\"u+x\"/>\n                <exec failonerror=\"true\" executable=\"${protobuf.compiler}\">\n                  <arg value=\"--proto_path=${proto.path}\"/>\n                  <arg value=\"--java_out=${project.build.directory}/generated-sources/protobuf\"/>\n                  <arg line=\"${protos}\"/>\n                </exec>\n              </target>\n            </configuration>\n          </execution>\n        </executions>\n        <dependencies>\n          <dependency>\n            <groupId>com.google.protobuf</groupId>\n            <artifactId>protoc</artifactId>\n            <version>${protobuf.version}</version>\n            <classifier>${os.detected.classifier}</classifier>\n            <type>exe</type>\n          </dependency>\n        </dependencies>\n      </plugin>\n      <plugin>\n        <groupId>org.codehaus.mojo</groupId>\n        <artifactId>build-helper-maven-plugin</artifactId>\n        <executions>\n          <execution>\n            <id>add-protobuf-generated-sources</id>\n            <phase>generate-sources</phase>\n            <goals>\n              <goal>add-source</goal>\n            </goals>\n            <configuration>\n              <sources>\n                <source>${project.build.directory}/generated-sources/protobuf</source>\n              </sources>\n            </configuration>\n          </execution>\n        </executions>\n      </plugin>\n    </plugins>\n  </build>\n\n</project>\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonar/plugins/dotnet/tests/FileService.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests;\n\nimport java.util.Optional;\n\npublic interface FileService {\n\n  /**\n   * Returns true if the absolute path is indexed by the scanner and has the correct extension.\n   */\n  boolean isSupportedAbsolute(String absolutePath);\n\n  /**\n   * Returns the absolute path for a deterministic build path.\n   *\n   * Note that the absolute path returned by the Scanner may be different from the absolute path returned by the Operating System\n   * @see org.sonar.api.batch.fs.InputFile#uri()\n   *\n   * @param deterministicBuildPath - the path in the code coverage report when builds are done with the `-deterministic` option\n   */\n  Optional<String> getAbsolutePath(String deterministicBuildPath);\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonar/plugins/dotnet/tests/NUnitTestResults.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests;\n\nimport javax.annotation.Nullable;\n\npublic class NUnitTestResults extends UnitTestResults {\n\n  NUnitTestResults(String outcome, @Nullable String label, @Nullable Long executionTime) {\n    this.tests = 1;\n    this.executionTime = executionTime;\n    switch(outcome) {\n      case \"Passed\",\n           \"Success\":\n        break;\n      case \"Failed\",\n           \"Failure\":\n        if (label != null && label.equals(\"Error\")) {\n          this.errors = 1;\n        } else {\n          this.failures = 1;\n        }\n        break;\n      case \"Error\":\n        this.errors = 1;\n        break;\n      case \"Inconclusive\",\n           \"Ignored\",\n           \"NotRunnable\",\n           \"Skipped\":\n        this.skipped = 1;\n        break;\n      default:\n        throw new IllegalArgumentException(\"Outcome of unit test must match NUnit Test Format\");\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonar/plugins/dotnet/tests/NUnitTestResultsParser.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests;\n\nimport java.io.File;\nimport java.util.List;\nimport java.util.function.Consumer;\nimport java.util.Map;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonar.api.scanner.ScannerSide;\n\n@ScannerSide\npublic class NUnitTestResultsParser implements UnitTestResultParser {\n  private static final Logger LOG = LoggerFactory.getLogger(NUnitTestResultsParser.class);\n\n  @Override\n  public void parse(File file, Map<String, UnitTestResults> unitTestResults, Map<String, String> methodFileMap) {\n    LOG.info(\"Parsing the NUnit Test Results file '{}'.\", file.getAbsolutePath());\n    var parser = new Parser(file, unitTestResults, methodFileMap, List.of(\"test-run\", \"test-results\"));\n\n    Map<String, Consumer<XmlParserHelper>> tagHandlers = Map.of(\n      \"test-suite\", parser::handleTestSuiteTag,\n      \"test-case\", parser::handleTestCaseTag\n    );\n\n    parser.parse(tagHandlers);\n  }\n\n  private static class Parser extends XmlTestReportParser {\n\n    private String dllName;\n\n    Parser(File file,  Map<String, UnitTestResults> unitTestResults, Map<String, String> methodFileMap, List<String> rootTags) {\n      super(file, unitTestResults, methodFileMap, rootTags);\n    }\n\n    private void handleTestSuiteTag(XmlParserHelper xmlParserHelper) {\n      var type = xmlParserHelper.getRequiredAttribute(\"type\");\n      if(type.equals(\"Assembly\")) {\n        var assemblyName = extractName(xmlParserHelper);\n        dllName = extractDllNameFromFilePath(assemblyName);\n        LOG.debug(\"NUnit Assembly found, assembly: {}, Extracted dllName: {}\", assemblyName, dllName);\n      }\n    }\n\n    private void handleTestCaseTag(XmlParserHelper xmlParserHelper) {\n      var result = xmlParserHelper.getRequiredAttribute(\"result\");\n      var label = xmlParserHelper.getAttribute(\"label\");\n      var executionTime = extractExecutionTime(xmlParserHelper);\n      var testResults = new NUnitTestResults(result, label, executionTime);\n      var name = extractName(xmlParserHelper);\n      var fullName = getFullName(name, dllName);\n\n      addTestResultToFile(fullName, testResults);\n    }\n\n    private static Long extractExecutionTime(XmlParserHelper xmlParserHelper) {\n      // NUnit 3\n      var time = xmlParserHelper.getDoubleAttribute(\"duration\");\n      if (time == null) {\n        // NUnit 2\n        time = xmlParserHelper.getDoubleAttribute(\"time\");\n      }\n      return time == null ? null : (long) (time * 1000);\n    }\n\n    private static String extractName(XmlParserHelper xmlParserHelper) {\n      // NUnit 3\n      var name = xmlParserHelper.getAttribute(\"fullname\");\n      if (name == null) {\n        // NUnit 2\n        name = xmlParserHelper.getRequiredAttribute(\"name\");\n      }\n      return name;\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonar/plugins/dotnet/tests/ParseErrorException.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests;\n\nclass ParseErrorException extends RuntimeException {\n\n  private static final long serialVersionUID = 1L;\n\n  ParseErrorException(String message) {\n    super(message);\n  }\n\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonar/plugins/dotnet/tests/PathSuffixPredicate.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests;\n\nimport org.sonar.api.batch.fs.FilePredicate;\nimport org.sonar.api.batch.fs.InputFile;\n\nrecord PathSuffixPredicate(String pathSuffix) implements FilePredicate {\n  @Override\n  public boolean apply(InputFile inputFile) {\n    return inputFile.uri().getPath().endsWith(pathSuffix);\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonar/plugins/dotnet/tests/ScannerFileService.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests;\n\nimport java.util.List;\nimport java.util.Optional;\nimport java.util.regex.Matcher;\nimport java.util.regex.Pattern;\nimport java.util.stream.StreamSupport;\nimport org.sonar.api.batch.fs.FilePredicates;\nimport org.sonar.api.batch.fs.FileSystem;\nimport org.sonar.api.scanner.ScannerSide;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonar.plugins.dotnet.tests.coverage.CoverageParser;\n\n@ScannerSide\npublic class ScannerFileService implements FileService {\n  private static final Logger LOG = LoggerFactory.getLogger(ScannerFileService.class);\n  private static final Pattern DETERMINISTIC_SOURCE_PATH_PREFIX = Pattern.compile(\"^(/_\\\\d*/)\");\n  private FileSystem fileSystem;\n  private String languageKey;\n\n  public ScannerFileService(String languageKey, FileSystem fileSystem) {\n    this.languageKey = languageKey;\n    this.fileSystem = fileSystem;\n  }\n\n  public boolean isSupportedAbsolute(String absolutePath) {\n    FilePredicates fp = fileSystem.predicates();\n    return fileSystem.hasFiles(\n      fp.and(\n        fp.hasAbsolutePath(absolutePath),\n        fp.hasLanguage(languageKey)));\n  }\n\n  public Optional<String> getAbsolutePath(String deterministicBuildPath) {\n    Matcher matcher = DETERMINISTIC_SOURCE_PATH_PREFIX.matcher(deterministicBuildPath.replace('\\\\', '/'));\n    if (matcher.find()) {\n      String pathSuffix = matcher.replaceFirst(\"\");\n      FilePredicates fp = fileSystem.predicates();\n      List<String> foundFiles = StreamSupport\n        .stream(\n          fileSystem.inputFiles(fp.and(fp.hasLanguage(languageKey), new PathSuffixPredicate(pathSuffix))).spliterator(),\n          false)\n        .map(x -> x.absolutePath())\n        .toList();\n\n      if (foundFiles.size() == 1) {\n        String foundFile = foundFiles.get(0);\n        LOG.trace(\"Found indexed file '{}' for '{}' (normalized to '{}').\", foundFile, deterministicBuildPath, pathSuffix);\n        return Optional.of(foundFile);\n      } else if (foundFiles.isEmpty()) {\n        LOG.debug(\"The file '{}' is not indexed or does not have the supported language. Will skip this coverage entry. \"\n            + CoverageParser.VERIFY_SONARPROJECTPROPERTIES_MESSAGE,\n          deterministicBuildPath);\n        return Optional.empty();\n      } else {\n        LOG.debug(\"Found {} indexed files for '{}' (normalized to '{}'). Will skip this coverage entry. \"\n            + CoverageParser.VERIFY_SONARPROJECTPROPERTIES_MESSAGE,\n          foundFiles.size(), deterministicBuildPath, pathSuffix);\n        return Optional.empty();\n      }\n    } else {\n      LOG.debug(\"The file '{}' does not have a deterministic build path and is either not indexed or does not have a supported language. \"\n          + \"Will skip this coverage entry. \" + CoverageParser.VERIFY_SONARPROJECTPROPERTIES_MESSAGE,\n        deterministicBuildPath);\n      return Optional.empty();\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonar/plugins/dotnet/tests/UnitTestConfiguration.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests;\n\npublic record UnitTestConfiguration(String visualStudioTestResultsFilePropertyKey,\n                                    String nunitTestResultsFilePropertyKey,\n                                    String xunitTestResultsFilePropertyKey) {\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonar/plugins/dotnet/tests/UnitTestResultParser.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests;\n\nimport java.io.File;\nimport java.util.Map;\n\ninterface UnitTestResultParser {\n  void parse(File file, Map<String, UnitTestResults> unitTestResults, Map<String, String> methodFileMap);\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonar/plugins/dotnet/tests/UnitTestResults.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests;\n\nimport javax.annotation.CheckForNull;\nimport javax.annotation.Nullable;\n\npublic class UnitTestResults {\n\n  protected int tests;\n  protected int skipped;\n  protected int failures;\n  protected int errors;\n  protected Long executionTime;\n\n  public void add(int tests, int skipped, int failures, int errors, @Nullable Long executionTime) {\n    this.tests += tests;\n    this.skipped += skipped;\n    this.failures += failures;\n    this.errors += errors;\n\n    if (executionTime != null) {\n      if (this.executionTime == null) {\n        this.executionTime = 0L;\n      }\n      this.executionTime += executionTime;\n    }\n  }\n\n  public void add(UnitTestResults unitTestResults) {\n    this.tests += unitTestResults.tests();\n    this.skipped += unitTestResults.skipped();\n    this.failures += unitTestResults.failures();\n    this.errors += unitTestResults.errors();\n    if (unitTestResults.executionTime() != null) {\n      if (this.executionTime == null) {\n        this.executionTime = 0L;\n      }\n      this.executionTime += unitTestResults.executionTime();\n    }\n  }\n\n  public int tests() {\n    return tests;\n  }\n\n  public int skipped() {\n    return skipped;\n  }\n\n  public int failures() {\n    return failures;\n  }\n\n  public int errors() {\n    return errors;\n  }\n\n  @CheckForNull\n  Long executionTime() {\n    return executionTime;\n  }\n\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonar/plugins/dotnet/tests/UnitTestResultsAggregator.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests;\n\nimport java.io.File;\nimport java.util.Collection;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.function.Predicate;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonar.api.config.Configuration;\nimport org.sonar.api.scanner.ScannerSide;\nimport org.sonarsource.dotnet.protobuf.SonarAnalyzer;\n\nimport static org.sonarsource.dotnet.protobuf.SonarAnalyzer.MethodDeclarationsInfo;\n\n/**\n * Aggregate the test results from different reports of potentially different tools (e.g. aggregate a NUnit report with a xUnit one and 3 Visual Studio ones).\n */\n@ScannerSide\npublic class UnitTestResultsAggregator {\n\n  private static final Logger LOG = LoggerFactory.getLogger(UnitTestResultsAggregator.class);\n\n  private final UnitTestConfiguration unitTestConf;\n  private final Configuration configuration;\n  private final VisualStudioTestResultParser visualStudioTestResultsParser;\n  private final NUnitTestResultsParser nUnitTestResultsParser;\n  private final XUnitTestResultsParser xunitTestResultsParser;\n\n  public UnitTestResultsAggregator(UnitTestConfiguration unitTestConf, Configuration configuration) {\n    this(unitTestConf, configuration, new VisualStudioTestResultParser(), new NUnitTestResultsParser(), new XUnitTestResultsParser());\n  }\n\n  UnitTestResultsAggregator(\n    UnitTestConfiguration unitTestConf,\n    Configuration configuration,\n    VisualStudioTestResultParser visualStudioTestResultsFileParser,\n    NUnitTestResultsParser nUnitTestResultsParser,\n    XUnitTestResultsParser xunitTestResultsParser) {\n    this.unitTestConf = unitTestConf;\n    this.configuration = configuration;\n    this.visualStudioTestResultsParser = visualStudioTestResultsFileParser;\n    this.nUnitTestResultsParser = nUnitTestResultsParser;\n    this.xunitTestResultsParser = xunitTestResultsParser;\n  }\n\n  boolean hasUnitTestResultsProperty(Predicate<String> hasKeyPredicate) {\n    return hasVisualStudioTestResultsFile(hasKeyPredicate)\n      || hasNUnitTestResultsFile(hasKeyPredicate)\n      || hasXUnitTestResultsFile(hasKeyPredicate);\n  }\n\n  boolean hasUnitTestResultsProperty() {\n    return hasUnitTestResultsProperty(configuration::hasKey);\n  }\n\n  /**\n   * New metrics aggregation (per file).\n   */\n  Map<String, UnitTestResults> aggregate(WildcardPatternFileProvider wildcardProvider, Collection<SonarAnalyzer.MethodDeclarationsInfo> methodDeclarations) {\n    HashMap<String, String> fileMethodMap = computeMethodFileMap(methodDeclarations);\n    var results = new HashMap<String, UnitTestResults>();\n    if (hasVisualStudioTestResultsFile(configuration::hasKey)) {\n      aggregate(wildcardProvider, configuration.getStringArray(unitTestConf.visualStudioTestResultsFilePropertyKey()), visualStudioTestResultsParser, fileMethodMap, results);\n    }\n    if (hasXUnitTestResultsFile(configuration::hasKey)) {\n      aggregate(wildcardProvider, configuration.getStringArray(unitTestConf.xunitTestResultsFilePropertyKey()), xunitTestResultsParser, fileMethodMap, results);\n    }\n    if (hasNUnitTestResultsFile(configuration::hasKey)) {\n      aggregate(wildcardProvider, configuration.getStringArray(unitTestConf.nunitTestResultsFilePropertyKey()), nUnitTestResultsParser, fileMethodMap, results);\n    }\n    return results;\n  }\n\n  private static void aggregate(\n    WildcardPatternFileProvider wildcardPatternFileProvider,\n    String[] reportFilePatterns,\n    UnitTestResultParser parser,\n    Map<String, String> methodFileMap,\n    Map<String, UnitTestResults> unitTestResultsMap) {\n    for (String reportPathPattern : reportFilePatterns) {\n      if (!reportPathPattern.isEmpty()) {\n        for (File reportFile : wildcardPatternFileProvider.listFiles(reportPathPattern)) {\n          try {\n            parser.parse(reportFile, unitTestResultsMap, methodFileMap);\n          } catch (Exception e) {\n            LOG.warn(\"Could not import unit test report '{}': {}\", reportFile, e.getMessage());\n          }\n        }\n      }\n    }\n  }\n\n  private boolean hasVisualStudioTestResultsFile(Predicate<String> hasKeyPredicate) {\n    return hasKeyPredicate.test(unitTestConf.visualStudioTestResultsFilePropertyKey());\n  }\n\n  private boolean hasNUnitTestResultsFile(Predicate<String> hasKeyPredicate) {\n    return hasKeyPredicate.test(unitTestConf.nunitTestResultsFilePropertyKey());\n  }\n\n  private boolean hasXUnitTestResultsFile(Predicate<String> hasKeyPredicate) {\n    return hasKeyPredicate.test(unitTestConf.xunitTestResultsFilePropertyKey());\n  }\n\n  private static HashMap<String, String> computeMethodFileMap(Collection<SonarAnalyzer.MethodDeclarationsInfo> methodDeclarations) {\n    var results = new HashMap<String, String>();\n    for (MethodDeclarationsInfo methodDeclaration : methodDeclarations) {\n      String assemblyName = methodDeclaration.getAssemblyName();\n      String filePath = methodDeclaration.getFilePath();\n      for (var methodDeclarationInfo : methodDeclaration.getMethodDeclarationsList()) {\n        String key = assemblyName.trim() + \".\" + methodDeclarationInfo.getTypeName().trim() + \".\" + methodDeclarationInfo.getMethodName().trim();\n        results.put(key, filePath);\n      }\n    }\n    return results;\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonar/plugins/dotnet/tests/UnitTestResultsImportSensor.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests;\n\nimport java.io.File;\nimport java.io.Serializable;\nimport java.util.Map;\nimport org.sonar.api.batch.fs.InputComponent;\nimport org.sonar.api.batch.sensor.SensorContext;\nimport org.sonar.api.batch.sensor.SensorDescriptor;\nimport org.sonar.api.measures.CoreMetrics;\nimport org.sonar.api.measures.Metric;\nimport org.sonar.api.notifications.AnalysisWarnings;\nimport org.sonar.api.scanner.sensor.ProjectSensor;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonarsource.dotnet.shared.plugins.MethodDeclarationsCollector;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\nimport org.sonarsource.dotnet.shared.plugins.RealPathProvider;\nimport org.sonarsource.dotnet.shared.plugins.SensorContextUtils;\n\n/**\n * This class is responsible to handle all the C# and VB.NET unit test results reports (parse and report back to SonarQube).\n */\npublic class UnitTestResultsImportSensor implements ProjectSensor {\n\n  private static final Logger LOG = LoggerFactory.getLogger(UnitTestResultsImportSensor.class);\n\n  private final WildcardPatternFileProvider wildcardPatternFileProvider = new WildcardPatternFileProvider(new File(\".\"));\n  private final UnitTestResultsAggregator unitTestResultsAggregator;\n  private final String languageKey;\n  private final String languageName;\n  private final AnalysisWarnings analysisWarnings;\n  private final RealPathProvider realPathProvider;\n  private final MethodDeclarationsCollector collector;\n\n  public UnitTestResultsImportSensor(MethodDeclarationsCollector collector,\n                                     UnitTestResultsAggregator unitTestResultsAggregator,\n                                     PluginMetadata pluginMetadata,\n                                     AnalysisWarnings analysisWarnings,\n                                     RealPathProvider realPathProvider) {\n    this.collector = collector;\n    this.unitTestResultsAggregator = unitTestResultsAggregator;\n    this.languageKey = pluginMetadata.languageKey();\n    this.languageName = pluginMetadata.languageName();\n    this.analysisWarnings = analysisWarnings;\n    this.realPathProvider = realPathProvider;\n  }\n\n  @Override\n  public void describe(SensorDescriptor descriptor) {\n    String name = String.format(\"%s Unit Test Results Import\", this.languageName);\n    descriptor.name(name);\n    descriptor.onlyOnLanguage(this.languageKey);\n    descriptor.onlyWhenConfiguration(c -> unitTestResultsAggregator.hasUnitTestResultsProperty(c::hasKey));\n  }\n\n  @Override\n  public void execute(SensorContext context) {\n    if (unitTestResultsAggregator.hasUnitTestResultsProperty()) {\n      try {\n        addTestMetrics(context);\n      } catch (Exception e) {\n        LOG.warn(\"Could not import unit test report: '{}'\", e.getMessage());\n        analysisWarnings.addUnique(String.format(\"Could not import unit test report for '%s'. Please check the logs for more details.\", languageName));\n      }\n    } else {\n      LOG.debug(\"No unit test results property. Skip Sensor\");\n    }\n  }\n\n  private void addTestMetrics(SensorContext context) {\n    var methodDeclarations = collector.getMethodDeclarations();\n    var aggregatedResultsPerFile = unitTestResultsAggregator.aggregate(wildcardPatternFileProvider, methodDeclarations);\n    addMeasures(context, aggregatedResultsPerFile);\n  }\n\n  private void addMeasures(SensorContext context, Map<String, UnitTestResults> aggregatedResultsPerFile) {\n    for (var entry : aggregatedResultsPerFile.entrySet()) {\n      var path = realPathProvider.getRealPath(entry.getKey());\n      var inputFile = SensorContextUtils.toInputFile(context.fileSystem(), path);\n      if (inputFile == null) {\n        LOG.debug(\"Cannot find the file '{}'. No test results will be imported. Mapped path is '{}'.\", entry.getKey(), path);\n      } else {\n        var results = entry.getValue();\n        if (LOG.isDebugEnabled()) {\n          LOG.debug(\"Adding test metrics for file '{}'. Tests: '{}', Errors: `{}`, Failures: '{}'\", inputFile.filename(), results.tests(), results.errors(), results.failures());\n        }\n        addMeasure(context, inputFile, CoreMetrics.TESTS, results.tests());\n        addMeasure(context, inputFile, CoreMetrics.TEST_ERRORS, results.errors());\n        addMeasure(context, inputFile, CoreMetrics.TEST_FAILURES, results.failures());\n        addMeasure(context, inputFile, CoreMetrics.SKIPPED_TESTS, results.skipped());\n        if (results.executionTime() != null) {\n          addMeasure(context, inputFile, CoreMetrics.TEST_EXECUTION_TIME, results.executionTime());\n        }\n      }\n    }\n  }\n\n  private static <T extends Serializable> void addMeasure(SensorContext context, InputComponent inputComponent, Metric<T> metric, T value) {\n    context.<T>newMeasure().forMetric(metric).on(inputComponent).withValue(value).save();\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonar/plugins/dotnet/tests/VisualStudioTestResultParser.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests;\n\nimport java.io.File;\nimport java.text.DateFormat;\nimport java.text.ParseException;\nimport java.text.SimpleDateFormat;\nimport java.util.Date;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.function.Consumer;\nimport java.util.regex.Pattern;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonar.api.scanner.ScannerSide;\n\n@ScannerSide\npublic class VisualStudioTestResultParser implements UnitTestResultParser {\n\n  private static final Logger LOG = LoggerFactory.getLogger(VisualStudioTestResultParser.class);\n\n  @Override\n  public void parse(File file, Map<String, UnitTestResults> unitTestResults, Map<String, String> methodFileMap) {\n    LOG.info(\"Parsing the Visual Studio Test Results file '{}'.\", file.getAbsolutePath());\n\n    var parser = new Parser(file, unitTestResults, methodFileMap, List.of(\"TestRun\"));\n    Map<String, Consumer<XmlParserHelper>> tagHandlers = Map.of(\n      \"UnitTestResult\", parser::handleUnitTestResultTag,\n      \"UnitTest\", parser::handleUnitTestTag\n    );\n\n    parser.parse(tagHandlers);\n  }\n\n  private static class Parser extends XmlTestReportParser {\n    private final Map<String, UnitTestResults> testIdTestResultMap;\n    // Date Format: // https://github.com/microsoft/vstest/blob/7d34b30433259fb914aaaf276fde663a47b6ef2f/src/Microsoft.TestPlatform.Extensions.TrxLogger/XML/XmlPersistence.cs#L557-L572\n    private final DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SSSXXX\");\n    private final Pattern millisecondsPattern = Pattern.compile(\"(\\\\.(\\\\d{0,3}))\\\\d*+\");\n\n    Parser(File file,  Map<String, UnitTestResults> unitTestResults, Map<String, String> methodFileMap, List<String> rootTags) {\n      super(file, unitTestResults, methodFileMap, rootTags);\n      this.testIdTestResultMap = new HashMap<>();\n    }\n\n    private void handleUnitTestResultTag(XmlParserHelper xmlParserHelper) {\n      var testId = xmlParserHelper.getRequiredAttribute(\"testId\");\n      var outcome = xmlParserHelper.getRequiredAttribute(\"outcome\");\n      var start = getRequiredDateAttribute(xmlParserHelper, \"startTime\");\n      var finish = getRequiredDateAttribute(xmlParserHelper, \"endTime\");\n      var duration = finish.getTime() - start.getTime();\n      var testResult = new VisualStudioTestResults(outcome, duration);\n      if (testIdTestResultMap.containsKey(testId)) {\n        testIdTestResultMap.get(testId).add(testResult);\n      } else {\n        testIdTestResultMap.put(testId, testResult);\n      }\n      LOG.debug(\"Parsed Visual Studio Unit Test - testId: {} outcome: {}, duration: {}\", testId, outcome, duration);\n    }\n\n    private void handleUnitTestTag(XmlParserHelper xmlParserHelper) {\n      var testId = xmlParserHelper.getRequiredAttribute(\"id\");\n\n      String tagName;\n      while ((tagName = xmlParserHelper.nextStartTag()) != null) {\n        if (\"TestMethod\".equals(tagName)) {\n          break;\n        }\n      }\n      if (tagName == null) {\n        throw new ParseErrorException(\"No TestMethod attribute found on UnitTest tag\");\n      }\n\n      var methodName = xmlParserHelper.getRequiredAttribute(\"name\");\n      var className = xmlParserHelper.getRequiredAttribute(\"className\");\n      var codeBase = xmlParserHelper.getRequiredAttribute(\"codeBase\");\n      var dllName = extractDllNameFromFilePath(codeBase);\n      var fullyQualifiedName = getFullName(className + \".\" + methodName, dllName);\n      var testIdTestResult = testIdTestResultMap.get(testId);\n      addTestResultToFile(fullyQualifiedName, testIdTestResult);\n    }\n\n    private Date getRequiredDateAttribute(XmlParserHelper xmlParserHelper, String name) {\n      var value = xmlParserHelper.getRequiredAttribute(name);\n      try {\n        value = keepOnlyMilliseconds(value);\n        return dateFormat.parse(value);\n      } catch (ParseException e) {\n        throw xmlParserHelper.parseError(\"Expected a valid date and time instead of \\\"\" + value + \"\\\" for the attribute \\\"\" + name + \"\\\". \" + e.getMessage());\n      }\n    }\n\n    private String keepOnlyMilliseconds(String value) {\n      var sb = new StringBuilder();\n      var matcher = millisecondsPattern.matcher(value);\n      var trailingZeros = new StringBuilder();\n      while (matcher.find()) {\n        String milliseconds = matcher.group(2);\n        trailingZeros.setLength(0);\n        trailingZeros.append(\"0\".repeat(Math.max(0, 3 - milliseconds.length())));\n        matcher.appendReplacement(sb, \"$1\" + trailingZeros);\n      }\n      matcher.appendTail(sb);\n\n      return sb.toString();\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonar/plugins/dotnet/tests/VisualStudioTestResults.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests;\n\npublic class VisualStudioTestResults extends UnitTestResults {\n\n  VisualStudioTestResults(String outcome, Long executionTime) {\n    this.tests = 1;\n    this.executionTime = executionTime;\n    switch(outcome) {\n      case \"Passed\",\n           \"Warning\":\n        // success\n        break;\n      case \"Failed\":\n        // failure\n        this.failures = 1;\n        break;\n      case \"Error\":\n        // error\n        this.errors = 1;\n        break;\n      case \"PassedButRunAborted\",\n            \"NotExecuted\",\n            \"Inconclusive\",\n            \"Completed\",\n            \"Timeout\",\n            \"Aborted\",\n            \"Blocked\",\n            \"NotRunnable\":\n        //skipped\n        this.skipped = 1;\n        break;\n      default:\n        throw new IllegalArgumentException(\"Outcome of unit test must match VSTest Format\");\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonar/plugins/dotnet/tests/WildcardPatternFileProvider.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests;\n\nimport java.io.File;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.HashSet;\nimport java.util.List;\nimport java.util.Set;\nimport java.util.regex.Pattern;\nimport java.util.stream.Collectors;\nimport org.sonar.api.utils.WildcardPattern;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\npublic class WildcardPatternFileProvider {\n  private static final Logger LOG = LoggerFactory.getLogger(WildcardPatternFileProvider.class);\n\n  private static final String CURRENT_FOLDER = \".\";\n  private static final String PARENT_FOLDER = \"..\";\n\n  private static final String RECURSIVE_PATTERN = \"**\";\n  private static final String ZERO_OR_MORE_PATTERN = \"*\";\n  private static final String ANY_PATTERN = \"?\";\n\n  private static final Pattern SEPARATOR_PATTERN = Pattern.compile(\"[\"+ Pattern.quote(File.separator) +\"/]\");\n\n  private final File baseDir;\n\n  public WildcardPatternFileProvider(File baseDir) {\n    this.baseDir = baseDir;\n  }\n\n  public Set<File> listFiles(String pattern) {\n\n    List<String> elements = Arrays.asList(SEPARATOR_PATTERN.split(pattern));\n\n    List<String> elementsTillFirstWildcard = elementsTillFirstWildcard(elements);\n    String pathTillFirstWildcardElement = toPath(elementsTillFirstWildcard);\n    File fileTillFirstWildcardElement = new File(pathTillFirstWildcardElement);\n\n    File absoluteFileTillFirstWildcardElement = fileTillFirstWildcardElement.isAbsolute() ? fileTillFirstWildcardElement : new File(baseDir, pathTillFirstWildcardElement);\n\n    LOG.debug(\"Pattern matcher extracted prefix/absolute path '{}' from the given pattern '{}'.\",\n      absoluteFileTillFirstWildcardElement.getAbsolutePath(), pattern);\n\n    List<String> wildcardElements = elements.subList(elementsTillFirstWildcard.size(), elements.size());\n    if (wildcardElements.isEmpty()) {\n      if (absoluteFileTillFirstWildcardElement.exists()) {\n        LOG.debug(\"Pattern matcher returns a single file: '{}'.\", absoluteFileTillFirstWildcardElement.getAbsolutePath());\n        return new HashSet<>(Collections.singletonList(absoluteFileTillFirstWildcardElement));\n      } else {\n        LOG.debug(\"Pattern matcher did not find any files matching the pattern '{}'.\", pattern);\n        return Collections.emptySet();\n      }\n    }\n    checkNoCurrentOrParentFolderAccess(wildcardElements);\n\n    WildcardPattern wildcardPattern = WildcardPattern.create(toPath(wildcardElements), File.separator);\n\n    LOG.debug(\"Gathering files for wildcardPattern '{}'.\", wildcardPattern);\n\n    Set<File> result = new HashSet<>();\n    for (File file : listFiles(absoluteFileTillFirstWildcardElement)) {\n      String relativePath = relativize(absoluteFileTillFirstWildcardElement, file);\n\n      if (wildcardPattern.match(relativePath)) {\n        LOG.trace(\"Adding file '{}' to result list.\", file.getAbsolutePath());\n        result.add(file);\n      } else {\n        LOG.trace(\"Skipping file '{}' because it does not match pattern '{}'.\",\n          file.getAbsolutePath(), wildcardPattern);\n      }\n    }\n\n    LOG.debug(\"Pattern matcher returns '{}' files.\", result.size());\n    return result;\n  }\n\n  private static String toPath(List<String> elements) {\n    return elements.stream().collect(Collectors.joining(File.separator));\n  }\n\n  private static List<String> elementsTillFirstWildcard(List<String> elements) {\n    List<String> result = new ArrayList<>();\n    for (String element : elements) {\n      if (containsWildcard(element)) {\n        break;\n      }\n      result.add(element);\n    }\n    return result;\n  }\n\n  private static void checkNoCurrentOrParentFolderAccess(List<String> elements) {\n    for (String element : elements) {\n      if (isCurrentOrParentFolder(element)) {\n        throw new IllegalArgumentException(\"Cannot contain '\" + CURRENT_FOLDER + \"' or '\" + PARENT_FOLDER + \"' after the first wildcard.\");\n      }\n    }\n  }\n\n  private static boolean containsWildcard(String element) {\n    return RECURSIVE_PATTERN.equals(element) ||\n      element.contains(ZERO_OR_MORE_PATTERN) ||\n      element.contains(ANY_PATTERN);\n  }\n\n  private static boolean isCurrentOrParentFolder(String element) {\n    return CURRENT_FOLDER.equals(element) ||\n      PARENT_FOLDER.equals(element);\n  }\n\n  private static Set<File> listFiles(File dir) {\n    Set<File> result = new HashSet<>();\n    listFiles(result, dir);\n    return result;\n  }\n\n  private static void listFiles(Set<File> result, File dir) {\n    File[] files = dir.listFiles();\n    if (files != null) {\n      result.addAll(Arrays.asList(files));\n\n      for (File file : files) {\n        if (file.isDirectory()) {\n          listFiles(result, file);\n        }\n      }\n    }\n  }\n\n  private static String relativize(File parent, File file) {\n    return file.getAbsolutePath().substring(parent.getAbsolutePath().length() + 1);\n  }\n\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonar/plugins/dotnet/tests/XUnitTestResults.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests;\n\nimport javax.annotation.Nullable;\n\npublic class XUnitTestResults extends UnitTestResults {\n\n  XUnitTestResults(String outcome, @Nullable Long executionTime) {\n    this.tests = 1;\n    this.executionTime = executionTime;\n    switch(outcome) {\n      case \"Pass\":\n        break;\n      case \"Fail\":\n        this.failures = 1;\n        break;\n      case \"Skip\",\n           \"NotRun\":\n        this.skipped = 1;\n        break;\n      default:\n        throw new IllegalArgumentException(\"Outcome of unit test must match XUnit Test Format\");\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonar/plugins/dotnet/tests/XUnitTestResultsParser.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests;\n\nimport java.io.File;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.function.Consumer;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonar.api.scanner.ScannerSide;\n\n@ScannerSide\npublic class XUnitTestResultsParser implements UnitTestResultParser {\n  private static final Logger LOG = LoggerFactory.getLogger(XUnitTestResultsParser.class);\n\n  @Override\n  public void parse(File file, Map<String, UnitTestResults> unitTestResults, Map<String, String> methodFileMap) {\n    LOG.info(\"Parsing the XUnit Test Results file '{}'.\", file.getAbsolutePath());\n\n    var parser = new Parser(file, unitTestResults, methodFileMap, List.of(\"assembly\", \"assemblies\"));\n\n    Map<String, Consumer<XmlParserHelper>> tagHandlers = Map.of(\n      \"assembly\", parser::handleAssemblyTag,\n      \"test\", parser::handleTestTag\n    );\n\n    parser.parse(tagHandlers);\n  }\n\n  private static class Parser extends XmlTestReportParser {\n    private String dllName;\n\n    Parser(File file,  Map<String, UnitTestResults> unitTestResults, Map<String, String> methodFileMap, List<String> rootTags) {\n      super(file, unitTestResults, methodFileMap, rootTags);\n    }\n\n    private void handleAssemblyTag(XmlParserHelper xmlParserHelper) {\n      var assemblyName = xmlParserHelper.getRequiredAttribute(\"name\");\n      dllName = extractDllNameFromFilePath(assemblyName);\n      LOG.debug(\"XUnit Assembly found, assembly name: {}, Extracted dllName: {}\", assemblyName, dllName);\n    }\n\n    private void handleTestTag(XmlParserHelper xmlParserHelper) {\n      var result = xmlParserHelper.getRequiredAttribute(\"result\");\n      var time = xmlParserHelper.getDoubleAttribute(\"time\");\n      var type = xmlParserHelper.getRequiredAttribute(\"type\");\n      var method = xmlParserHelper.getRequiredAttribute(\"method\");\n      var executionTime = time == null ? null : (long) (time * 1000);\n      var testResults = new XUnitTestResults(result, executionTime);\n      var fullName = getFullName(type + '.' + method, dllName);\n\n      addTestResultToFile(fullName, testResults);\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonar/plugins/dotnet/tests/XmlParserHelper.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests;\n\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.FileNotFoundException;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.nio.charset.StandardCharsets;\nimport java.util.List;\nimport java.util.Objects;\nimport javax.annotation.Nullable;\nimport javax.xml.stream.Location;\nimport javax.xml.stream.XMLStreamConstants;\nimport javax.xml.stream.XMLStreamException;\nimport javax.xml.stream.XMLStreamReader;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonarsource.analyzer.commons.xml.SafetyFactory;\n\npublic class XmlParserHelper implements AutoCloseable {\n\n  private static final Logger LOG = LoggerFactory.getLogger(XmlParserHelper.class);\n\n  private final File file;\n  private final InputStreamReader reader;\n  private final XMLStreamReader stream;\n\n  public XmlParserHelper(File file) {\n    try {\n      this.file = file;\n      this.reader = new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8);\n      this.stream = createXmlStreamReader();\n\n    } catch (FileNotFoundException | XMLStreamException e) {\n      throw new IllegalStateException(e);\n    }\n  }\n\n  public void checkRootTag(String name) {\n    String rootTag = nextStartTag();\n\n    if (!name.equals(rootTag)) {\n      throw parseError(\"Missing root element <\" + name + \">\");\n    }\n  }\n\n  String checkRootTags(List<String> names) {\n    String rootTag = nextStartTag();\n\n    if (!names.contains(rootTag)) {\n      throw parseError(\"Missing or incorrect root element. Expected one of \" + names.stream().map( s -> \"<\" + s + \">\").toList() + \", but got <\" + rootTag + \"> instead\");\n    }\n    return rootTag;\n  }\n\n  @Nullable\n  public String nextStartTag() {\n    try {\n      while (stream.hasNext()) {\n        if (getNextValid() == XMLStreamConstants.START_ELEMENT) {\n          return stream.getLocalName();\n        }\n      }\n      return null;\n    } catch (XMLStreamException e) {\n      throw new IllegalStateException(\"Error while parsing the XML file: \" + file.getAbsolutePath(), e);\n    }\n  }\n\n  public void checkRequiredAttribute(String name, int expectedValue) {\n    int actualValue = getRequiredIntAttribute(name);\n    if (expectedValue != actualValue) {\n      throw parseError(\"Expected \\\"\" + expectedValue + \"\\\" instead of \\\"\" + actualValue + \"\\\" for the \\\"\" + name + \"\\\" attribute\");\n    }\n  }\n\n  public String getRequiredAttribute(String name) {\n    String value = getAttribute(name);\n    if (value == null) {\n      throw parseError(\"Missing attribute \\\"\" + name + \"\\\" in element <\" + stream.getLocalName() + \">\");\n    }\n\n    return value;\n  }\n\n  public XMLStreamReader stream() {\n    return stream;\n  }\n\n  public int getRequiredIntAttribute(String name) {\n    String value = getRequiredAttribute(name);\n    return tagToIntValue(name, value);\n  }\n\n  @Nullable\n  public String getAttribute(String name) {\n    for (int i = 0; i < stream.getAttributeCount(); i++) {\n      if (name.equals(stream.getAttributeLocalName(i))) {\n        return stream.getAttributeValue(i);\n      }\n    }\n\n    return null;\n  }\n\n  public ParseErrorException parseError(String message) {\n    return new ParseErrorException(message + \" in \" + file.getAbsolutePath() + \" at line \" + stream.getLocation().getLineNumber());\n  }\n\n  @Override\n  public void close() throws IOException {\n    reader.close();\n\n    if (stream != null) {\n      try {\n        stream.close();\n      } catch (XMLStreamException e) {\n        throw new IllegalStateException(e);\n      }\n    }\n  }\n\n  private int getNextValid() throws XMLStreamException {\n    Location lastLocation = stream.getLocation();\n    while (stream.hasNext()) {\n      try {\n        return stream.next();\n      } catch (XMLStreamException e) {\n        Location currentLocation = stream.getLocation();\n        if (isSameLocation(lastLocation, currentLocation)) {\n          // if the next() method throws exception before moving XML pointer forward, we fail here\n          LOG.warn(\"Unable to get next XML event while parsing file '{}'\", file);\n          throw e;\n        }\n        lastLocation = currentLocation;\n      }\n    }\n    return -1;\n  }\n\n  private static boolean isSameLocation(@Nullable Location loc1, @Nullable Location loc2) {\n    return Objects.equals(loc1, loc2) ||\n      (loc1 != null &&\n        loc2 != null &&\n        loc1.getLineNumber() == loc2.getLineNumber() &&\n        loc1.getColumnNumber() == loc2.getColumnNumber() &&\n        loc1.getCharacterOffset() == loc2.getCharacterOffset() &&\n        Objects.equals(loc1.getPublicId(), loc2.getPublicId()) &&\n        Objects.equals(loc1.getSystemId(), loc2.getSystemId()));\n\n  }\n\n  @Nullable\n  public String nextStartOrEndTag() {\n    try {\n      while (stream.hasNext()) {\n        int next = stream.next();\n        if (next == XMLStreamConstants.START_ELEMENT) {\n          return \"<\" + stream.getLocalName() + \">\";\n        } else if (next == XMLStreamConstants.END_ELEMENT) {\n          return \"</\" + stream.getLocalName() + \">\";\n        }\n      }\n\n      return null;\n    } catch (XMLStreamException e) {\n      throw new IllegalStateException(\"Error while parsing the XML file: \" + file.getAbsolutePath(), e);\n    }\n  }\n\n  public int getIntAttributeOrZero(String name) {\n    String value = getAttribute(name);\n    return value == null ? 0 : tagToIntValue(name, value);\n  }\n\n  int tagToIntValue(String name, String value) {\n    try {\n      return Integer.parseInt(value);\n    } catch (NumberFormatException e) {\n      throw parseError(\"Expected an integer instead of \\\"\" + value + \"\\\" for the attribute \\\"\" + name + \"\\\"\");\n    }\n  }\n\n  @Nullable\n  Double getDoubleAttribute(String name) {\n    String value = getAttribute(name);\n    if (value == null) {\n      return null;\n    }\n\n    try {\n      value = value.replace(',', '.');\n      return Double.parseDouble(value);\n    } catch (NumberFormatException e) {\n      throw parseError(\"Expected an double instead of \\\"\" + value + \"\\\" for the attribute \\\"\" + name + \"\\\"\");\n    }\n  }\n\n  XMLStreamReader createXmlStreamReader() throws XMLStreamException {\n    return SafetyFactory.createXMLInputFactory().createXMLStreamReader(reader);\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonar/plugins/dotnet/tests/XmlTestReportParser.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.function.Consumer;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\npublic abstract class XmlTestReportParser {\n\n  private static final Logger LOG = LoggerFactory.getLogger(XmlTestReportParser.class);\n  protected final File file;\n  protected final Map<String, String> methodFileMap;\n  protected final Map<String, UnitTestResults> unitTestResults;\n  protected final List<String> rootTags;\n\n  XmlTestReportParser(File file,  Map<String, UnitTestResults> unitTestResults, Map<String, String> methodFileMap, List<String> rootTags) {\n    this.file = file;\n    this.unitTestResults = unitTestResults;\n    this.methodFileMap = methodFileMap;\n    this.rootTags = rootTags;\n  }\n\n  public void parse(Map<String, Consumer<XmlParserHelper>> tagHandlers) {\n    try (XmlParserHelper xmlParserHelper = new XmlParserHelper(file)) {\n\n      String tag = xmlParserHelper.checkRootTags(rootTags);\n      do {\n        if (tagHandlers.containsKey(tag)) {\n          tagHandlers.get(tag).accept(xmlParserHelper);\n        }\n      } while ((tag = xmlParserHelper.nextStartTag()) != null);\n    } catch (IOException e) {\n      throw new IllegalStateException(\"Unable to close report\", e);\n    }\n  }\n\n  protected void addTestResultToFile(String methodFullName, UnitTestResults testResults) {\n    if(!methodFileMap.containsKey(methodFullName)) {\n      LOG.debug(\"Test method {} cannot be mapped to the test source file. The test will not be included.\", methodFullName);\n      return;\n    }\n\n    String fileName = methodFileMap.get(methodFullName);\n    if (unitTestResults.containsKey(fileName)) {\n      var fileTestResult = unitTestResults.get(fileName);\n      fileTestResult.add(testResults);\n    } else {\n      unitTestResults.put(fileName, testResults);\n    }\n    LOG.debug(\"Added Test Method: {} to File: {}\", methodFullName, fileName);\n  }\n\n  protected String extractDllNameFromFilePath(String filePath) {\n    return filePath.substring(filePath.lastIndexOf(File.separator) + 1, filePath.lastIndexOf('.'));\n  }\n\n  protected String getFullName(String methodName, String dllName) {\n    var separators = List.of(\"<\", \"(\");\n    for (var separator : separators) {\n      if (methodName.contains(separator)) {\n        methodName = methodName.substring(0, methodName.indexOf(separator));\n      }\n    }\n\n    // Remove the generic arguments part from the method name.\n    // GenericClass`2.Method -> GenericClass.Method\n    if (methodName.contains(\"`\")) {\n      var regexPattern = \"`\\\\d+\";\n      methodName = methodName.replaceAll(regexPattern, \"\");\n    }\n    methodName = methodName.replace('+', '.');\n    return String.join(\".\", dllName, methodName);\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonar/plugins/dotnet/tests/coverage/BranchCoverage.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests.coverage;\n\nimport java.util.Objects;\n\n// This class is responsible to keep SQ/SC metrics related to branch coverage\nclass BranchCoverage {\n  private final int line;\n  private int conditions;\n  private int coveredConditions;\n\n  BranchCoverage(int line, int conditions, int coveredConditions) {\n    this.line = line;\n    this.conditions = conditions;\n    this.coveredConditions = coveredConditions;\n  }\n\n  public int getLine() {\n    return line;\n  }\n\n  public int getConditions() {\n    return conditions;\n  }\n\n  int getCoveredConditions() {\n    return coveredConditions;\n  }\n\n  public void add(int conditions, int coveredConditions) {\n    this.conditions += conditions;\n    this.coveredConditions += coveredConditions;\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) {\n      return true;\n    }\n\n    if (o == null || getClass() != o.getClass()) {\n      return false;\n    }\n\n    BranchCoverage other = (BranchCoverage) o;\n\n    return line == other.line &&\n      conditions == other.conditions &&\n      coveredConditions == other.coveredConditions;\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(line, conditions, coveredConditions);\n  }\n\n  @Override\n  public String toString() {\n    return \"Branch coverage [line=\" + line + \", conditions=\" + conditions\n      + \", coveredConditions=\" + coveredConditions + \"]\";\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonar/plugins/dotnet/tests/coverage/CoberturaReportParser.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests.coverage;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.regex.Matcher;\nimport java.util.regex.Pattern;\nimport javax.annotation.Nullable;\nimport javax.xml.stream.XMLStreamException;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonar.plugins.dotnet.tests.FileService;\nimport org.sonar.plugins.dotnet.tests.XmlParserHelper;\n\nimport static org.sonarsource.dotnet.shared.CallableUtils.lazy;\n\npublic final class CoberturaReportParser implements CoverageParser {\n\n  private static final Logger LOG = LoggerFactory.getLogger(CoberturaReportParser.class);\n  private static final Pattern CONDITION_COVERAGE_PATTERN = Pattern.compile(\"\\\\d+%\\\\s*\\\\((\\\\d+)/(\\\\d+)\\\\)\");\n  private final FileService fileService;\n\n  public CoberturaReportParser(FileService fileService) {\n    this.fileService = fileService;\n  }\n\n  @Override\n  public void accept(File file, Coverage coverage) {\n    LOG.debug(\"The current user dir is '{}'.\", lazy(() -> System.getProperty(\"user.dir\")));\n    LOG.info(\"Parsing the Cobertura report {}\", file.getAbsolutePath());\n    new Parser(file, coverage).parse();\n  }\n\n  private class Parser {\n    private final File file;\n    private final Coverage coverage;\n    private final List<String> sources = new ArrayList<>();\n    private final Map<String, CoveredFile> filesByFilename = new HashMap<>();\n    private String currentClassFilename;\n\n    private Parser(File file, Coverage coverage) {\n      this.file = file;\n      this.coverage = coverage;\n    }\n\n    void parse() {\n      try (var xmlParserHelper = new XmlParserHelper(file)) {\n        xmlParserHelper.checkRootTag(\"coverage\");\n        dispatchTags(xmlParserHelper);\n      } catch (IOException e) {\n        throw new IllegalStateException(\"Unable to close report\", e);\n      }\n    }\n\n    private void dispatchTags(XmlParserHelper xmlParserHelper) {\n      String tagName;\n      while ((tagName = xmlParserHelper.nextStartTag()) != null) {\n        if (\"source\".equals(tagName)) {\n          handleSourceTag(xmlParserHelper);\n        } else if (\"class\".equals(tagName)) {\n          handleClassTag(xmlParserHelper);\n        } else if (\"line\".equals(tagName)) {\n          handleLineTag(xmlParserHelper);\n        }\n      }\n    }\n\n    private void handleSourceTag(XmlParserHelper xmlParserHelper) {\n      try {\n        String sourceText = xmlParserHelper.stream().getElementText();\n        if (sourceText != null && !sourceText.isBlank()) {\n          sources.add(sourceText);\n          LOG.debug(\"Cobertura parser: found source '{}'.\", sourceText);\n        }\n      } catch (XMLStreamException e) {\n        LOG.debug(\"Cobertura parser: failed to read <source> element text at line {}.\",\n          xmlParserHelper.stream().getLocation().getLineNumber(), e);\n      }\n    }\n\n    private void handleClassTag(XmlParserHelper xmlParserHelper) {\n      String filename = xmlParserHelper.getRequiredAttribute(\"filename\");\n      currentClassFilename = filename;\n      if (!filesByFilename.containsKey(filename)) {\n        CoveredFile coveredFile = resolveFile(filename);\n        LOG.debug(\"CoveredFile created: {}.\", coveredFile);\n        filesByFilename.put(filename, coveredFile);\n      }\n    }\n\n    private void handleLineTag(XmlParserHelper xmlParserHelper) {\n      CoveredFile coveredFile = filesByFilename.get(currentClassFilename);\n      if (coveredFile == null || !coveredFile.isIndexed()) {\n        return;\n      }\n\n      int line = xmlParserHelper.getRequiredIntAttribute(\"number\");\n      int hits = xmlParserHelper.getRequiredIntAttribute(\"hits\");\n      coverage.addHits(coveredFile.indexedPath(), line, hits);\n      LOG.trace(\"Cobertura parser: add hits for file {}, line '{}', hits '{}'.\", coveredFile, line, hits);\n\n      String branchAttr = xmlParserHelper.getAttribute(\"branch\");\n      String conditionCoverage = xmlParserHelper.getAttribute(\"condition-coverage\");\n      int[] coveredAndTotal = parseConditionCoverage(conditionCoverage);\n      if (!\"True\".equalsIgnoreCase(branchAttr) || coveredAndTotal == null) {\n        return;\n      }\n\n      String filePath = coveredFile.indexedPath();\n      int covered = coveredAndTotal[0];\n      int total = coveredAndTotal[1];\n      String coverageIdentifier = file.getPath();\n\n      List<ParsedCondition> conditions = handleConditions(xmlParserHelper);\n\n      if (conditions.isEmpty()) {\n        addUnmergeableConditions(filePath, line, covered, total, coverageIdentifier);\n      } else {\n        addMergeableConditions(filePath, line, covered, total, conditions, coverageIdentifier);\n      }\n    }\n\n    private List<ParsedCondition> handleConditions(XmlParserHelper xmlParserHelper) {\n      List<ParsedCondition> conditions = new ArrayList<>();\n      String tag;\n      while ((tag = xmlParserHelper.nextStartOrEndTag()) != null) {\n        if (\"</line>\".equals(tag)) {\n          break;\n        } else if (\"<condition>\".equals(tag)) {\n          int number = xmlParserHelper.getRequiredIntAttribute(\"number\");\n          String type = xmlParserHelper.getRequiredAttribute(\"type\");\n          String coverageAttr = xmlParserHelper.getRequiredAttribute(\"coverage\");\n          conditions.add(new ParsedCondition(number, type, coverageAttr));\n        }\n      }\n      return conditions;\n    }\n\n    private void addMergeableConditions(String filePath, int line, int covered, int total,\n      List<ParsedCondition> conditions, String coverageIdentifier) {\n      // Two-pass approach: process jump conditions first, then switches with remaining totals.\n      // The line-level condition-coverage counts all branches (jump + switch combined).\n      // Each jump condition accounts for 2 branches, so we subtract those before processing switches.\n      int remainingTotal = total;\n      int remainingCovered = covered;\n      for (ParsedCondition condition : conditions) {\n        if (\"jump\".equals(condition.type)) {\n          int jumpCovered = addJumpConditions(filePath, line, condition, coverageIdentifier);\n          remainingTotal -= 2;\n          remainingCovered -= jumpCovered;\n        } else if (!\"switch\".equals(condition.type)) {\n          LOG.debug(\"Cobertura parser: unknown condition type '{}' on file '{}', line '{}'. Skipping.\", condition.type, filePath, line);\n        }\n      }\n\n      remainingTotal = Math.max(0, remainingTotal);\n      remainingCovered = Math.max(0, remainingCovered);\n\n      for (ParsedCondition condition : conditions) {\n        if (\"switch\".equals(condition.type)) {\n          addSwitchConditions(filePath, line, remainingCovered, remainingTotal, condition.number, coverageIdentifier);\n        }\n      }\n    }\n\n    private void addUnmergeableConditions(String filePath, int line, int covered, int total, String coverageIdentifier) {\n      for (int i = 0; i < total; i++) {\n        coverage.add(new ConditionData(ConditionData.FORMAT_UNMERGEABLE, filePath, line, new ConditionData.Location(i, 0), i, i < covered ? 1 : 0, coverageIdentifier));\n      }\n      LOG.trace(\"Cobertura parser: add {} unmergeable branch conditions for file '{}', line '{}'.\", total, filePath, line);\n    }\n\n    private void addSwitchConditions(String filePath, int line, int covered, int total, int conditionNumber, String coverageIdentifier) {\n      for (int i = 0; i < total; i++) {\n        coverage.add(new ConditionData(ConditionData.FORMAT_COBERTURA, filePath, line, new ConditionData.Location(conditionNumber, 0), i, i < covered ? 1 : 0, coverageIdentifier));\n      }\n      LOG.trace(\"Cobertura parser: add {} switch branch conditions for file '{}', line '{}', condition number '{}'.\", total, filePath, line, conditionNumber);\n    }\n\n    private int addJumpConditions(String filePath, int line, ParsedCondition condition, String coverageIdentifier) {\n      int percentage = parsePercentage(condition.coverage);\n      var location = new ConditionData.Location(condition.number, 0);\n      int hitPath0 = percentage > 0 ? 1 : 0;\n      int hitPath1 = percentage == 100 ? 1 : 0;\n      coverage.add(new ConditionData(ConditionData.FORMAT_COBERTURA, filePath, line, location, 0, hitPath0, coverageIdentifier));\n      coverage.add(new ConditionData(ConditionData.FORMAT_COBERTURA, filePath, line, location, 1, hitPath1, coverageIdentifier));\n      LOG.trace(\"Cobertura parser: add jump branch conditions for file '{}', line '{}', condition number '{}', coverage '{}%'.\", filePath, line, condition.number, percentage);\n      return hitPath0 + hitPath1;\n    }\n\n    private CoveredFile resolveFile(String filename) {\n      var filenameAsFile = new File(filename);\n      if (filenameAsFile.isAbsolute()) {\n        return createCoveredFile(filenameAsFile);\n      }\n      for (String source : sources) {\n        CoveredFile result = createCoveredFile(new File(source, filename));\n\n        // Potential file resolution ambiguity. There is no feasible fix on our end.\n        if (result.isIndexed()) {\n          return result;\n        }\n      }\n      LOG.debug(\"Cobertura parser: could not resolve relative filename '{}' with any source prefix. Skipping. \" + VERIFY_SONARPROJECTPROPERTIES_MESSAGE, filename);\n      return new CoveredFile(filename, null);\n    }\n\n    private CoveredFile createCoveredFile(File fileToResolve) {\n      String path = fileToResolve.getPath();\n      String canonicalPath;\n      try {\n        canonicalPath = fileToResolve.getCanonicalPath();\n      } catch (IOException e) {\n        LOG.debug(\"Skipping the import of Cobertura code coverage for the invalid file path: {} in report {}. {}\",\n          path, file.getPath(), VERIFY_SONARPROJECTPROPERTIES_MESSAGE, e);\n        return new CoveredFile(path, null);\n      }\n\n      if (fileService.isSupportedAbsolute(canonicalPath)) {\n        return new CoveredFile(path, canonicalPath);\n      } else {\n        return fileService.getAbsolutePath(path)\n          .map(resolved -> new CoveredFile(path, resolved))\n          .orElseGet(() -> new CoveredFile(path, null));\n      }\n    }\n  }\n\n  record ParsedCondition(int number, String type, String coverage) { }\n\n  record CoveredFile(String originalFilename, @Nullable String indexedPath) {\n    boolean isIndexed() {\n      return indexedPath != null;\n    }\n\n    @Override\n    public String toString() {\n      return indexedPath == null\n        ? String.format(\"(path '%s', NO INDEXED PATH)\", originalFilename)\n        : String.format(\"(path '%s', indexed as '%s')\", originalFilename, indexedPath);\n    }\n  }\n\n  @Nullable\n  private static int[] parseConditionCoverage(@Nullable String conditionCoverage) {\n    if (conditionCoverage == null) {\n      return null;\n    }\n    Matcher matcher = CONDITION_COVERAGE_PATTERN.matcher(conditionCoverage);\n    if (!matcher.find()) {\n      LOG.debug(\"Cobertura parser: could not parse condition-coverage '{}'.\", conditionCoverage);\n      return null;\n    }\n    return new int[]{Integer.parseInt(matcher.group(1)), Integer.parseInt(matcher.group(2))};\n  }\n\n  private static int parsePercentage(String coverage) {\n    String trimmed = coverage.trim().replace(\"%\", \"\");\n    try {\n      return Integer.parseInt(trimmed);\n    } catch (NumberFormatException e) {\n      LOG.debug(\"Cobertura parser: could not parse coverage percentage '{}'.\", coverage);\n      return 0;\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonar/plugins/dotnet/tests/coverage/ConditionData.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests.coverage;\n\nclass ConditionData {\n  static final String FORMAT_OPENCOVER = \"opencover\";\n  static final String FORMAT_COBERTURA = \"cobertura\";\n  static final String FORMAT_UNMERGEABLE = \"unmergeable\";\n\n  private final String format;\n  private final Location location;\n  private final int startLine;\n  private final int hits;\n  // identifier for code path\n  private final int path;\n  private final String filePath;\n  private final String coverageIdentifier;\n\n  public ConditionData(String format, String filePath, int startLine, Location location, int path, int hits, String coverageIdentifier) {\n    this.format = format;\n    this.filePath = filePath;\n    this.startLine = startLine;\n    this.location = location;\n    this.path = path;\n    this.hits = hits;\n    this.coverageIdentifier = coverageIdentifier;\n  }\n\n  public String getFormat() {\n    return format;\n  }\n\n  public int getStartLine() {\n    return startLine;\n  }\n\n  public int getHits() {\n    return hits;\n  }\n\n  public int getLocationStart() {\n    return location.start;\n  }\n\n  public int getLocationEnd() {\n    return location.end;\n  }\n\n  public int getPath() {\n    return path;\n  }\n\n  public String getFilePath() {\n    return filePath;\n  }\n\n  public String getCoverageIdentifier() {\n    return coverageIdentifier;\n  }\n\n  public String getUniqueKey() {\n    return String.format(\"%s-%d-%d-%d-%d\", filePath, startLine, location.start, location.end, path);\n  }\n\n  record Location(int start, int end) {\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonar/plugins/dotnet/tests/coverage/Coverage.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests.coverage;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.Comparator;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Set;\nimport java.util.stream.Collectors;\n\npublic class Coverage {\n\n  private static final int MINIMUM_FILE_LINES = 100;\n  private static final int GROW_FACTOR = 2;\n  private static final int SPECIAL_HITS_NON_EXECUTABLE = -1;\n  private final Map<String, int[]> hitsByLineAndFile = new HashMap<>();\n  private final List<ConditionData> conditionData = new ArrayList<>();\n  private boolean branchCoverageUnderreported = false;\n\n  void addHits(String file, int line, int hits) {\n    int[] oldHitsByLine = hitsByLineAndFile.get(file);\n\n    if (oldHitsByLine == null) {\n      oldHitsByLine = new int[Math.max(line, MINIMUM_FILE_LINES)];\n      for (int i = 0; i < oldHitsByLine.length; i++) {\n        oldHitsByLine[i] = SPECIAL_HITS_NON_EXECUTABLE;\n      }\n      hitsByLineAndFile.put(file, oldHitsByLine);\n    } else if (oldHitsByLine.length < line) {\n      int[] tmp = new int[line * GROW_FACTOR];\n      System.arraycopy(oldHitsByLine, 0, tmp, 0, oldHitsByLine.length);\n      for (int i = oldHitsByLine.length; i < tmp.length; i++) {\n        tmp[i] = SPECIAL_HITS_NON_EXECUTABLE;\n      }\n      oldHitsByLine = tmp;\n      hitsByLineAndFile.put(file, oldHitsByLine);\n    }\n\n    int i = line - 1;\n    if (oldHitsByLine[i] == SPECIAL_HITS_NON_EXECUTABLE) {\n      oldHitsByLine[i] = 0;\n    }\n    oldHitsByLine[i] += hits;\n  }\n\n  public void add(ConditionData condition){\n    conditionData.add(condition);\n  }\n\n  List<ConditionData> getConditionData() {\n    return Collections.unmodifiableList(conditionData);\n  }\n\n  public Set<String> files() {\n    return hitsByLineAndFile.keySet();\n  }\n\n  Map<Integer, Integer> hits(String file) {\n    int[] oldHitsByLine = hitsByLineAndFile.get(file);\n    if (oldHitsByLine == null) {\n      return Collections.emptyMap();\n    }\n\n    Map<Integer, Integer> result = new HashMap<>();\n    for (int i = 0; i < oldHitsByLine.length; i++) {\n      if (oldHitsByLine[i] != SPECIAL_HITS_NON_EXECUTABLE) {\n        result.put(i + 1, oldHitsByLine[i]);\n      }\n    }\n\n    return result;\n  }\n\n  List<BranchCoverage> getBranchCoverage(String file) {\n    return conditionData.stream()\n      .filter(point -> point.getFilePath().equals(file))\n      .collect(Collectors.groupingBy(ConditionData::getStartLine)).entrySet().stream()\n      .map(x -> getBranchCoverage(x.getKey(), x.getValue()))\n      .filter(x -> x.getConditions() > 1)\n      .toList();\n  }\n\n  void mergeWith(Coverage otherCoverage) {\n    mergeLineHits(otherCoverage);\n    conditionData.addAll(otherCoverage.conditionData);\n  }\n\n  private void mergeLineHits(Coverage otherCoverage){\n    Map<String, int[]> other = otherCoverage.hitsByLineAndFile;\n\n    for (Map.Entry<String, int[]> entry : other.entrySet()) {\n      String file = entry.getKey();\n      int[] otherHitsByLine = entry.getValue();\n\n      for (int i = otherHitsByLine.length - 1; i >= 0; i--) {\n        addHits(file, i + 1, otherHitsByLine[i]);\n      }\n    }\n  }\n\n  boolean getBranchCoverageUnderreported() {\n    return branchCoverageUnderreported;\n  }\n\n  private BranchCoverage getBranchCoverage(int lineNumber, List<ConditionData> conditions) {\n    // Mapping ConditionData from different coverage reports is fragile due to potential differences in compilation.\n    // Therefore, we use a forgiving approach: First, count the number of conditions per report and take the maximum. Then, map\n    // conditions and count the ones that are covered. If the mapping did not go well, we might find too many covered conditions.\n    // In this case, we cap the amount to the previously calculated maximum and assume all branches are covered.\n    // In case of multiple formats, we take the maximum of the per-format merges.\n    List<ConditionCoverageResult> coverages = conditions.stream()\n      .collect(Collectors.groupingBy(ConditionData::getFormat)).values().stream()\n      .map(Coverage::calculateCoverage)\n      .toList();\n\n    if (coverages.stream().anyMatch(ConditionCoverageResult::underreported)) {\n      branchCoverageUnderreported = true;\n    }\n\n    int maxConditions = coverages.stream().mapToInt(ConditionCoverageResult::totalBranches).max().orElse(0);\n    int coveredConditions = coverages.stream().mapToInt(ConditionCoverageResult::coveredBranches).max().orElse(0);\n\n    return new BranchCoverage(lineNumber, maxConditions, Math.min(coveredConditions, maxConditions));\n  }\n\n  private static ConditionCoverageResult calculateCoverage(List<ConditionData> conditions) {\n    int maxConditions = conditions.stream()\n      .collect(Collectors.groupingBy(ConditionData::getCoverageIdentifier)).values().stream()\n      .map(x -> (int)x.stream().map(ConditionData::getUniqueKey).distinct().count())\n      .max(Comparator.comparingInt(x -> x)).orElse(0);\n\n    int coveredConditions = (int) conditions.stream()\n      .filter(x -> x.getHits() > 0)\n      .map(ConditionData::getUniqueKey).distinct().count();\n\n    // telemetry\n    int sumCoveredPerReport = conditions.stream()\n      .collect(Collectors.groupingBy(ConditionData::getCoverageIdentifier)).values().stream()\n      .mapToInt(group -> (int)group.stream()\n        .filter(x -> x.getHits() > 0)\n        .map(ConditionData::getUniqueKey).distinct().count())\n      .sum();\n\n    return new ConditionCoverageResult(maxConditions, Math.min(coveredConditions, maxConditions), sumCoveredPerReport > coveredConditions);\n  }\n\n  private record ConditionCoverageResult(int totalBranches, int coveredBranches, boolean underreported) {}\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonar/plugins/dotnet/tests/coverage/CoverageAggregator.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests.coverage;\n\nimport java.io.File;\nimport java.util.Set;\nimport java.util.function.Predicate;\nimport org.sonar.api.config.Configuration;\nimport org.sonar.api.notifications.AnalysisWarnings;\nimport org.sonar.api.scanner.ScannerSide;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonar.plugins.dotnet.tests.ScannerFileService;\nimport org.sonar.plugins.dotnet.tests.WildcardPatternFileProvider;\n\n/**\n * Aggregate the coverage results from different reports of potentially different tools (e.g. aggregate a NCover 3 report with a DotCover one and 3 Visual Studio ones).\n */\n@ScannerSide\npublic class CoverageAggregator {\n\n  private static final Logger LOG = LoggerFactory.getLogger(CoverageAggregator.class);\n\n  private final CoverageConfiguration coverageConf;\n  private final Configuration configuration;\n  private final CoverageCache coverageCache;\n  private final NCover3ReportParser ncover3ReportParser;\n  private final OpenCoverReportParser openCoverReportParser;\n  private final DotCoverReportsAggregator dotCoverReportsAggregator;\n  private final VisualStudioCoverageXmlReportParser visualStudioCoverageXmlReportParser;\n  private final CoberturaReportParser coberturaReportParser;\n\n  public CoverageAggregator(CoverageConfiguration coverageConf,\n                            Configuration configuration,\n                            ScannerFileService fileService,\n                            AnalysisWarnings analysisWarnings) {\n    this.coverageConf = coverageConf;\n    this.configuration = configuration;\n    this.coverageCache = new CoverageCache();\n    this.ncover3ReportParser = new NCover3ReportParser(fileService, analysisWarnings);\n    this.openCoverReportParser = new OpenCoverReportParser(fileService);\n    this.dotCoverReportsAggregator = new DotCoverReportsAggregator(new DotCoverReportParser(fileService));\n    this.visualStudioCoverageXmlReportParser = new VisualStudioCoverageXmlReportParser(fileService);\n    this.coberturaReportParser = new CoberturaReportParser(fileService);\n  }\n\n  // visible for testing\n  CoverageAggregator(CoverageConfiguration coverageConf,\n                     Configuration configuration,\n                     CoverageCache coverageCache,\n                     NCover3ReportParser ncover3ReportParser,\n                     OpenCoverReportParser openCoverReportParser,\n                     DotCoverReportsAggregator dotCoverReportsAggregator,\n                     VisualStudioCoverageXmlReportParser visualStudioCoverageXmlReportParser,\n                     CoberturaReportParser coberturaReportParser) {\n\n    this.coverageConf = coverageConf;\n    this.configuration = configuration;\n    this.coverageCache = coverageCache;\n    this.ncover3ReportParser = ncover3ReportParser;\n    this.openCoverReportParser = openCoverReportParser;\n    this.dotCoverReportsAggregator = dotCoverReportsAggregator;\n    this.visualStudioCoverageXmlReportParser = visualStudioCoverageXmlReportParser;\n    this.coberturaReportParser = coberturaReportParser;\n  }\n\n  boolean hasCoverageProperty() {\n    return hasCoverageProperty(configuration::hasKey);\n  }\n\n   // visible for testing\n  boolean hasCoverageProperty(Predicate<String> hasKeyPredicate) {\n    return hasNCover3ReportPaths(hasKeyPredicate)\n      || hasOpenCoverReportPaths(hasKeyPredicate)\n      || hasDotCoverReportPaths(hasKeyPredicate)\n      || hasVisualStudioCoverageXmlReportPaths(hasKeyPredicate)\n      || hasCoberturaReportPaths(hasKeyPredicate);\n  }\n\n  private boolean hasNCover3ReportPaths(Predicate<String> hasKeyPredicate) {\n    return hasKeyPredicate.test(coverageConf.ncover3PropertyKey());\n  }\n\n  private boolean hasOpenCoverReportPaths(Predicate<String> hasKeyPredicate) {\n    return hasKeyPredicate.test(coverageConf.openCoverPropertyKey());\n  }\n\n  private boolean hasDotCoverReportPaths(Predicate<String> hasKeyPredicate) {\n    return hasKeyPredicate.test(coverageConf.dotCoverPropertyKey());\n  }\n\n  private boolean hasVisualStudioCoverageXmlReportPaths(Predicate<String> hasKeyPredicate) {\n    return hasKeyPredicate.test(coverageConf.visualStudioCoverageXmlPropertyKey());\n  }\n\n  private boolean hasCoberturaReportPaths(Predicate<String> hasKeyPredicate) {\n    return hasKeyPredicate.test(coverageConf.coberturaPropertyKey());\n  }\n\n  Coverage aggregate(WildcardPatternFileProvider wildcardPatternFileProvider, Coverage coverage) {\n    if (hasNCover3ReportPaths(configuration::hasKey)) {\n      aggregate(wildcardPatternFileProvider, configuration.getStringArray(coverageConf.ncover3PropertyKey()), ncover3ReportParser, coverage);\n    }\n\n    if (hasOpenCoverReportPaths(configuration::hasKey)) {\n      aggregate(wildcardPatternFileProvider, configuration.getStringArray(coverageConf.openCoverPropertyKey()), openCoverReportParser, coverage);\n    }\n\n    if (hasDotCoverReportPaths(configuration::hasKey)) {\n      aggregate(wildcardPatternFileProvider, configuration.getStringArray(coverageConf.dotCoverPropertyKey()), dotCoverReportsAggregator, coverage);\n    }\n\n    if (hasVisualStudioCoverageXmlReportPaths(configuration::hasKey)) {\n      aggregate(wildcardPatternFileProvider, configuration.getStringArray(coverageConf.visualStudioCoverageXmlPropertyKey()), visualStudioCoverageXmlReportParser, coverage);\n    }\n\n    if (hasCoberturaReportPaths(configuration::hasKey)) {\n      aggregate(wildcardPatternFileProvider, configuration.getStringArray(coverageConf.coberturaPropertyKey()), coberturaReportParser, coverage);\n    }\n\n    return coverage;\n  }\n\n  private void aggregate(WildcardPatternFileProvider wildcardPatternFileProvider, String[] reportPaths, CoverageParser parser, Coverage aggregatedCoverage) {\n    for (String reportPathPattern : reportPaths) {\n      if (!reportPathPattern.isEmpty()) {\n        Set<File> filesMatchingPattern = wildcardPatternFileProvider.listFiles(reportPathPattern);\n        if (filesMatchingPattern.isEmpty()) {\n          LOG.warn(\"Could not find any coverage report file matching the pattern '{}'. Troubleshooting guide: https://community.sonarsource.com/t/37151\", reportPathPattern);\n        } else {\n          mergeParsedCoverageWithAggregatedCoverage(aggregatedCoverage, parser, filesMatchingPattern);\n        }\n      }\n    }\n  }\n\n  private void mergeParsedCoverageWithAggregatedCoverage(Coverage aggregatedCoverage, CoverageParser parser, Set<File> filesMatchingPattern) {\n    for (File reportFile : filesMatchingPattern) {\n      try {\n        aggregatedCoverage.mergeWith(coverageCache.readCoverageFromCacheOrParse(parser, reportFile));\n      } catch (Exception e) {\n        LOG.warn(\"Could not import coverage report '{}' because '{}'. Troubleshooting guide: https://community.sonarsource.com/t/37151\", reportFile, e.getMessage());\n      }\n    }\n  }\n\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonar/plugins/dotnet/tests/coverage/CoverageCache.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests.coverage;\n\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\nimport java.io.File;\nimport java.util.WeakHashMap;\n\nclass CoverageCache {\n\n  private static final Logger LOG = LoggerFactory.getLogger(CoverageCache.class);\n\n  private final WeakHashMap<String, Coverage> cache = new WeakHashMap<>();\n\n  Coverage readCoverageFromCacheOrParse(CoverageParser parser, File reportFile) {\n    String path = reportFile.getAbsolutePath();\n    Coverage coverage = cache.get(path);\n    if (coverage == null) {\n      coverage = new Coverage();\n      parser.accept(reportFile, coverage);\n      cache.put(path, coverage);\n      LOG.info(\"Adding this code coverage report to the cache for later reuse: {}\", path);\n    } else {\n      LOG.info(\"Successfully retrieved this code coverage report results from the cache: {}\", path);\n    }\n    return coverage;\n  }\n\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonar/plugins/dotnet/tests/coverage/CoverageConfiguration.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests.coverage;\n\npublic record CoverageConfiguration(String languageKey,\n                                    String ncover3PropertyKey,\n                                    String openCoverPropertyKey,\n                                    String dotCoverPropertyKey,\n                                    String visualStudioCoverageXmlPropertyKey,\n                                    String coberturaPropertyKey) {\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonar/plugins/dotnet/tests/coverage/CoverageParser.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests.coverage;\n\nimport java.io.File;\nimport java.util.function.BiConsumer;\n\n@FunctionalInterface\npublic interface CoverageParser extends BiConsumer<File, Coverage> {\n  String VERIFY_SONARPROJECTPROPERTIES_MESSAGE = \"Verify sonar.sources in .sonarqube\\\\out\\\\sonar-project.properties.\";\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonar/plugins/dotnet/tests/coverage/CoverageReportImportSensor.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests.coverage;\n\nimport java.io.File;\nimport java.util.Map;\nimport java.util.Set;\nimport org.sonar.api.batch.fs.FilePredicates;\nimport org.sonar.api.batch.fs.InputFile;\nimport org.sonar.api.batch.fs.InputFile.Type;\nimport org.sonar.api.batch.sensor.SensorContext;\nimport org.sonar.api.batch.sensor.SensorDescriptor;\nimport org.sonar.api.batch.sensor.coverage.NewCoverage;\nimport org.sonar.api.scanner.sensor.ProjectSensor;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonar.plugins.dotnet.tests.WildcardPatternFileProvider;\n\nimport static org.sonarsource.dotnet.shared.CallableUtils.lazy;\n\n/**\n * This class is responsible to handle all the C# and VB.NET code coverage reports (parse and report back to SonarQube).\n */\npublic class CoverageReportImportSensor implements ProjectSensor {\n\n  // visible for testing\n  static final File BASE_DIR = new File(\".\");\n\n  private static final Logger LOG = LoggerFactory.getLogger(CoverageReportImportSensor.class);\n\n  private final WildcardPatternFileProvider wildcardPatternFileProvider = new WildcardPatternFileProvider(BASE_DIR);\n  private final CoverageConfiguration coverageConf;\n  private final CoverageAggregator coverageAggregator;\n  private final String languageKey;\n  private final String languageName;\n\n  public CoverageReportImportSensor(CoverageConfiguration coverageConf, CoverageAggregator coverageAggregator,\n                                    String languageKey, String languageName) {\n    this.coverageConf = coverageConf;\n    this.coverageAggregator = coverageAggregator;\n    this.languageKey = languageKey;\n    this.languageName = languageName;\n  }\n\n  @Override\n  public void describe(SensorDescriptor descriptor) {\n    descriptor.name(this.languageName + \" Tests Coverage Report Import\");\n    descriptor.onlyWhenConfiguration(c -> coverageAggregator.hasCoverageProperty(c::hasKey));\n    descriptor.onlyOnLanguage(this.languageKey);\n  }\n\n  @Override\n  public void execute(SensorContext context) {\n    if (!coverageAggregator.hasCoverageProperty()) {\n      LOG.debug(\"No coverage property. Skip Sensor\");\n      return;\n    }\n    analyze(context, new Coverage());\n  }\n\n  void analyze(SensorContext context, Coverage coverage) {\n\n    LOG.debug(\"Analyzing coverage with wildcardPatternFileProvider with base dir '{}' and file separator '{}'.\",\n      BASE_DIR.getAbsolutePath(), File.separator);\n\n    coverageAggregator.aggregate(wildcardPatternFileProvider, coverage);\n\n    Set<String> coverageFiles = coverage.files();\n    FileCountStatistics fileCountStatistics = new FileCountStatistics(coverageFiles.size());\n\n    LOG.debug(\"Analyzing coverage after aggregate found '{}' coverage files.\", coverageFiles.size());\n\n    for (String filePath : coverageFiles) {\n      LOG.trace(\"Counting statistics for '{}'.\", filePath);\n      FilePredicates p = context.fileSystem().predicates();\n      InputFile inputFile = context.fileSystem().inputFile(p.hasAbsolutePath(filePath));\n\n      if (inputFile == null) {\n        fileCountStatistics.projectExcluded++;\n        LOG.debug(\"The file '{}' is either excluded or outside of your solution folder therefore Code \"\n          + \"Coverage will not be imported.\", filePath);\n      } else if (inputFile.type().equals(Type.TEST)) {\n        fileCountStatistics.test++;\n        LOG.debug(\"Skipping '{}' as it is a test file.\", filePath);\n      } else if (!coverageConf.languageKey().equals(inputFile.language())) {\n        LOG.debug(\"Skipping '{}' as conf lang '{}' does not equal file lang '{}'.\", filePath, lazy(coverageConf::languageKey), lazy(inputFile::language));\n        fileCountStatistics.otherLanguageExcluded++;\n      } else {\n        analyzeCoverage(context, coverage, fileCountStatistics, filePath, inputFile);\n      }\n    }\n\n    LOG.debug(\"The total number of file count statistics is '{}'.\", fileCountStatistics.total);\n\n    if (fileCountStatistics.total != 0) {\n      LOG.info(\"{}\", lazy(fileCountStatistics::toString));\n      if (fileCountStatistics.mainWithCoverage == 0) {\n        LOG.warn(\"The Code Coverage report doesn't contain any coverage data for the included files. Troubleshooting guide: https://community.sonarsource.com/t/37151\");\n      } else {\n        var telemetryKey = \"dotnetenterprise.plugin.\" + languageKey + \".coverage.underReported\";\n        var telemetryValue = String.valueOf(coverage.getBranchCoverageUnderreported());\n        LOG.debug(\"Adding metric: {}={}\", telemetryKey, telemetryValue);\n        context.addTelemetryProperty(telemetryKey, telemetryValue);\n      }\n    }\n  }\n\n  private static void analyzeCoverage(SensorContext context, Coverage coverage, FileCountStatistics fileCountStatistics, String filePath, InputFile inputFile) {\n    LOG.trace(\"Checking main file coverage for '{}'.\", filePath);\n    fileCountStatistics.main++;\n    boolean fileHasCoverage = false;\n\n    NewCoverage newCoverage = context.newCoverage().onFile(inputFile);\n    var coverageImportError = false;\n    for (Map.Entry<Integer, Integer> entry : coverage.hits(filePath).entrySet()) {\n      LOG.trace(\"Found entry with key '{}' and value '{}'.\", entry.getKey(), entry.getValue());\n      fileHasCoverage = true;\n      var line = entry.getKey();\n      if (line <= inputFile.lines()){\n        newCoverage.lineHits(line, entry.getValue());\n      } else {\n        coverageImportError = true;\n        LOG.debug(\"Coverage import: Line {} is out of range in the file '{}' (lines: {})\", line, inputFile, inputFile.lines());\n      }\n    }\n    if (coverageImportError){\n      LOG.warn(\"Invalid data found in the coverage report, please check the debug logs for more details and raise an issue on the coverage tool being used.\");\n    }\n\n    for (BranchCoverage branchCoverage : coverage.getBranchCoverage(filePath)) {\n      LOG.trace(\"Found branch coverage entry on line '{}', with total conditions '{}' and covered conditions '{}'.\",\n        branchCoverage.getLine(), branchCoverage.getConditions(), branchCoverage.getCoveredConditions());\n      fileHasCoverage = true;\n      newCoverage.conditions(branchCoverage.getLine(), branchCoverage.getConditions(), branchCoverage.getCoveredConditions());\n    }\n    newCoverage.save();\n\n    if (fileHasCoverage) {\n      fileCountStatistics.mainWithCoverage++;\n      LOG.trace(\"Found some coverage info for the file '{}'.\", filePath);\n    } else {\n      LOG.debug(\"No coverage info found for the file '{}'.\", filePath);\n    }\n  }\n\n  private static class FileCountStatistics {\n\n    private final int total;\n    private int main = 0;\n    private int mainWithCoverage = 0;\n    private int test = 0;\n    private int projectExcluded = 0;\n    private int otherLanguageExcluded = 0;\n\n    private FileCountStatistics(int total) {\n      this.total = total;\n    }\n\n    @Override\n    public String toString() {\n      return \"Coverage Report Statistics: \" +\n        total + \" files, \" +\n        main + \" main files, \" +\n        mainWithCoverage + \" main files with coverage, \" +\n        test + \" test files, \" +\n        projectExcluded + \" project excluded files, \" +\n        otherLanguageExcluded + \" other language files.\";\n    }\n\n  }\n\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonar/plugins/dotnet/tests/coverage/DotCoverReportParser.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests.coverage;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.nio.file.Files;\nimport java.util.regex.Matcher;\nimport java.util.regex.Pattern;\nimport javax.annotation.Nullable;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonar.plugins.dotnet.tests.FileService;\n\npublic class DotCoverReportParser implements CoverageParser {\n\n  private static final String TITLE_START = \"<title>\";\n  private static final String HIGHLIGHT_RANGES_START = \"highlightRanges([\";\n  // the pattern for the information about a sequence point - [lineStart, columnStart, lineEnd, columnEnd, hits]\n  private static final Pattern SEQUENCE_POINT = Pattern.compile(\"\\\\[(\\\\d++),\\\\d++,\\\\d++,\\\\d++,(\\\\d++)]\");\n  private static final Logger LOG = LoggerFactory.getLogger(DotCoverReportParser.class);\n  private final FileService fileService;\n\n  public DotCoverReportParser(FileService fileService) {\n    this.fileService = fileService;\n  }\n\n  @Override\n  public void accept(File file, Coverage coverage) {\n    LOG.info(\"Parsing the dotCover report {}\", file.getAbsolutePath());\n    new Parser(file, coverage).parse();\n  }\n\n  private class Parser {\n\n    private final File file;\n    private final Coverage coverage;\n\n    Parser(File file, Coverage coverage) {\n      this.file = file;\n      this.coverage = coverage;\n    }\n\n    public void parse() {\n      String contents;\n      try {\n        contents = new String(Files.readAllBytes(file.toPath()), StandardCharsets.UTF_8);\n      } catch (IOException e) {\n        throw new IllegalStateException(e);\n      }\n\n      String fileCanonicalPath = extractFileCanonicalPath(contents);\n      if (fileCanonicalPath != null && fileService.isSupportedAbsolute(fileCanonicalPath)) {\n        collectCoverage(fileCanonicalPath, contents);\n      } else {\n        LOG.debug(\"Skipping the import of dotCover code coverage for file '{}' because it is not indexed or\"\n            + \" does not have the supported language. \" + VERIFY_SONARPROJECTPROPERTIES_MESSAGE,\n          fileCanonicalPath);\n      }\n    }\n\n    @Nullable\n    private String extractFileCanonicalPath(String contents) {\n      int indexOfTitleStart = getIndexOf(contents, TITLE_START, 0);\n      int indexOfTitleEnd = getIndexOf(contents, \"</title>\", indexOfTitleStart);\n      String lowerCaseAbsolutePath = contents.substring(indexOfTitleStart + TITLE_START.length(), indexOfTitleEnd);\n      try {\n        return new File(lowerCaseAbsolutePath).getCanonicalPath();\n      } catch (IOException e) {\n        LOG.debug(\"Skipping the import of dotCover code coverage for the invalid file path: \" + lowerCaseAbsolutePath + \".\", e);\n        return null;\n      }\n    }\n\n    private void collectCoverage(String fileCanonicalPath, String contents) {\n      int indexOfScript = getIndexOf(contents, \"<script type=\\\"text/javascript\\\">\", 0);\n      int indexOfRanges = getIndexOf(contents, HIGHLIGHT_RANGES_START, indexOfScript);\n      Matcher sequencePointsMatcher = SEQUENCE_POINT.matcher(contents.substring(indexOfRanges + HIGHLIGHT_RANGES_START.length()));\n\n      while (sequencePointsMatcher.find()) {\n        int lineStart = Integer.parseInt(sequencePointsMatcher.group(1));\n        int hits = Integer.parseInt(sequencePointsMatcher.group(2));\n        coverage.addHits(fileCanonicalPath, lineStart, hits);\n\n        LOG.trace(\"dotCover parser: found coverage for line '{}', hits '{}' when analyzing the path '{}'.\", lineStart, hits, fileCanonicalPath);\n      }\n    }\n\n    private int getIndexOf(String fileContent, String part, int startIndex) {\n      int index = fileContent.indexOf(part, startIndex);\n      if (index == -1) {\n        throw new IllegalArgumentException(\"The report does not contain expected '\" + part + \"'.\");\n      }\n      return index;\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonar/plugins/dotnet/tests/coverage/DotCoverReportsAggregator.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests.coverage;\n\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.util.List;\nimport java.util.stream.Stream;\n\nimport static org.sonarsource.dotnet.shared.CallableUtils.lazy;\n\npublic class DotCoverReportsAggregator implements CoverageParser {\n\n  private static final Logger LOG = LoggerFactory.getLogger(DotCoverReportsAggregator.class);\n\n  private final DotCoverReportParser parser;\n\n  DotCoverReportsAggregator(DotCoverReportParser parser) {\n    this.parser = parser;\n  }\n\n  @Override\n  public void accept(File file, Coverage coverage) {\n    LOG.debug(\"The current user dir is '{}'.\", lazy(() -> System.getProperty(\"user.dir\")));\n    LOG.info(\"Aggregating the HTML reports from '{}'.\", file.getAbsolutePath());\n    checkIsHtml(file);\n\n    String folderName = extractFolderName(file);\n    File folder = new File(file.getParentFile(), folderName + \"/src\");\n    if (!folder.exists()) {\n      throw new IllegalArgumentException(\"The following report dotCover report HTML sources folder cannot be found: \" + folder.getAbsolutePath());\n    }\n\n    List<File> reportFiles = listReportFiles(folder);\n    LOG.debug(\"dotCover aggregator: collected {} report files to parse.\", reportFiles.size());\n\n    for (File reportFile : reportFiles) {\n      if (!isExcluded(reportFile)) {\n        parser.accept(reportFile, coverage);\n      }\n    }\n    if (reportFiles.isEmpty()) {\n      throw new IllegalArgumentException(\"No dotCover report HTML source file found under: \" + folder.getAbsolutePath());\n    }\n  }\n\n  private static List<File> listReportFiles(File folder) {\n    try (Stream<Path> pathStream = Files.list(folder.toPath())) {\n      return pathStream\n        .map(Path::toFile)\n        .filter(f -> f.isFile() && f.getName().endsWith(\".html\"))\n        .toList();\n    } catch (IOException e) {\n      throw new IllegalStateException(e);\n    }\n  }\n\n  private static void checkIsHtml(File file) {\n    String contents;\n    try {\n      contents = new String(Files.readAllBytes(file.toPath()), StandardCharsets.UTF_8);\n    } catch (IOException e) {\n      throw new IllegalStateException(e);\n    }\n    if (!contents.startsWith(\"<!DOCTYPE html>\")) {\n      throw new IllegalArgumentException(\"Only dotCover HTML reports which start with \\\"<!DOCTYPE html>\\\" are supported.\");\n    }\n  }\n\n  private static String extractFolderName(File file) {\n    String name = file.getName();\n    int lastDot = name.lastIndexOf('.');\n    if (lastDot == -1) {\n      throw new IllegalArgumentException(\"The following dotCover report name should have an extension: \" + name);\n    }\n\n    return name.substring(0, lastDot);\n  }\n\n  private static boolean isExcluded(File file) {\n    return \"nosource.html\".equals(file.getName());\n  }\n\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonar/plugins/dotnet/tests/coverage/NCover3ReportParser.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests.coverage;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport org.sonar.api.notifications.AnalysisWarnings;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonar.plugins.dotnet.tests.FileService;\nimport org.sonar.plugins.dotnet.tests.XmlParserHelper;\n\nimport static org.sonarsource.dotnet.shared.CallableUtils.lazy;\n\n/**\n * @deprecated in 8.6 because NCover3 is not supported anymore by NCover LLC\n */\n@Deprecated\npublic class NCover3ReportParser implements CoverageParser {\n\n  private static final String EXCLUDED_ID = \"0\";\n  private static final Logger LOG = LoggerFactory.getLogger(NCover3ReportParser.class);\n  private final FileService fileService;\n  private final AnalysisWarnings analysisWarnings;\n\n  NCover3ReportParser(FileService fileService, AnalysisWarnings analysisWarnings) {\n    this.fileService = fileService;\n    this.analysisWarnings = analysisWarnings;\n  }\n\n  @Override\n  public void accept(File file, Coverage coverage) {\n    LOG.debug(\"The current user dir is '{}'.\", lazy(() -> System.getProperty(\"user.dir\")));\n    LOG.info(\"Parsing the NCover3 report {}\", file.getAbsolutePath());\n    new Parser(file, coverage).parse();\n  }\n\n  private class Parser {\n\n    private final File file;\n    private final Map<String, String> documents = new HashMap<>();\n    private final Coverage coverage;\n\n    Parser(File file, Coverage coverage) {\n      this.file = file;\n      this.coverage = coverage;\n    }\n\n    public void parse() {\n      String deprecationMessage =\"NCover3 coverage import is deprecated since version 8.6 of the plugin. \" +\n        \"Consider using a different code coverage tool instead.\";\n      LOG.warn(deprecationMessage);\n      analysisWarnings.addUnique(deprecationMessage);\n\n      try (XmlParserHelper xmlParserHelper = new XmlParserHelper(file)) {\n        checkRootTag(xmlParserHelper);\n        dispatchTags(xmlParserHelper);\n      } catch (IOException e) {\n        throw new IllegalStateException(\"Unable to close report\", e);\n      }\n    }\n\n    private void dispatchTags(XmlParserHelper xmlParserHelper) {\n      String tagName;\n      while ((tagName = xmlParserHelper.nextStartTag()) != null) {\n        if (\"doc\".equals(tagName)) {\n          handleDocTag(xmlParserHelper);\n        } else if (\"seqpnt\".equals(tagName)) {\n          handleSegmentPointTag(xmlParserHelper);\n        }\n      }\n    }\n\n    private void handleDocTag(XmlParserHelper xmlParserHelper) {\n      String id = xmlParserHelper.getRequiredAttribute(\"id\");\n      String url = xmlParserHelper.getRequiredAttribute(\"url\");\n\n      LOG.trace(\"Analyzing the doc tag with NCover3 ID '{}' and url '{}'.\", id, url);\n\n      if (!isExcludedId(id)) {\n        try {\n          String path = new File(url).getCanonicalPath();\n\n          LOG.trace(\"NCover3 ID '{}' with url '{}' is resolved as '{}'.\", id, url, path);\n\n          documents.put(id, path);\n        } catch (IOException e) {\n          LOG.debug(\"Skipping the import of NCover3 code coverage for the invalid file path: \" + url\n            + \" at line \" + xmlParserHelper.stream().getLocation().getLineNumber(), e);\n        }\n      } else {\n        LOG.debug(\"NCover3 ID '{}' is excluded, so url '{}' was not added.\", id, url);\n      }\n    }\n\n    private boolean isExcludedId(String id) {\n      return EXCLUDED_ID.equals(id);\n    }\n\n    private void handleSegmentPointTag(XmlParserHelper xmlParserHelper) {\n      String doc = xmlParserHelper.getRequiredAttribute(\"doc\");\n      int line = xmlParserHelper.getRequiredIntAttribute(\"l\");\n      int vc = xmlParserHelper.getRequiredIntAttribute(\"vc\");\n\n      if (documents.containsKey(doc) && !isExcludedLine(line)) {\n        String path = documents.get(doc);\n        if (fileService.isSupportedAbsolute(path)) {\n\n          LOG.trace(\"Found coverage for line '{}', vc '{}' when analyzing the doc '{}' with the path '{}'.\",\n            line, vc, doc, path);\n\n          coverage.addHits(path, line, vc);\n        } else {\n          LOG.debug(\"NCover3 doc '{}', line '{}', vc '{}' will be skipped because it has a path '{}'\"\n              + \" which is not indexed or does not have the supported language. \" + VERIFY_SONARPROJECTPROPERTIES_MESSAGE,\n            doc, line, vc, path);\n        }\n      } else if (!isExcludedLine(line)) {\n        LOG.debug(\"NCover3 doc '{}' is not contained in documents and will be skipped.\", doc);\n      }\n    }\n\n    private boolean isExcludedLine(Integer line) {\n      return 0 == line;\n    }\n\n    private void checkRootTag(XmlParserHelper xmlParserHelper) {\n      xmlParserHelper.checkRootTag(\"coverage\");\n      xmlParserHelper.checkRequiredAttribute(\"exportversion\", 3);\n    }\n\n  }\n\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonar/plugins/dotnet/tests/coverage/OpenCoverReportParser.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests.coverage;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport javax.annotation.Nullable;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonar.plugins.dotnet.tests.FileService;\nimport org.sonar.plugins.dotnet.tests.XmlParserHelper;\n\nimport static org.sonarsource.dotnet.shared.CallableUtils.lazy;\n\npublic class OpenCoverReportParser implements CoverageParser {\n\n  private static final Logger LOG = LoggerFactory.getLogger(OpenCoverReportParser.class);\n  private final FileService fileService;\n\n  OpenCoverReportParser(FileService fileService) {\n    this.fileService = fileService;\n  }\n\n  @Override\n  public void accept(File file, Coverage coverage) {\n    LOG.debug(\"The current user dir is '{}'.\", lazy(() -> System.getProperty(\"user.dir\")));\n    LOG.info(\"Parsing the OpenCover report {}\", file.getAbsolutePath());\n    new Parser(file, coverage).parse();\n  }\n\n  private class Parser {\n\n    private final File file;\n    private final Coverage coverage;\n\n    // the key is the file ID, the value is the CoveredFile\n    private final Map<String, CoveredFile> files = new HashMap<>();\n\n    // The \"uid\" attribute of the \"FileRef\" XML tag.\n    // This is needed when the \"SequencePoint\" or \"BranchPoint\" XML tags do not contain the \"fileid\" attribute.\n    private String currentFileRefUid;\n\n    Parser(File file, Coverage coverage) {\n      this.file = file;\n      this.coverage = coverage;\n    }\n\n    public void parse() {\n      try (XmlParserHelper xmlParserHelper = new XmlParserHelper(file)) {\n        xmlParserHelper.checkRootTag(\"CoverageSession\");\n        dispatchTags(xmlParserHelper);\n      } catch (IOException e) {\n        throw new IllegalStateException(\"Unable to close report\", e);\n      }\n    }\n\n    private void dispatchTags(XmlParserHelper xmlParserHelper) {\n      String tagName;\n      while ((tagName = xmlParserHelper.nextStartTag()) != null) {\n        if (\"File\".equals(tagName)) {\n          handleFileTag(xmlParserHelper);\n        } else if (\"FileRef\".equals(tagName)) {\n          handleFileRef(xmlParserHelper);\n        } else if (\"SequencePoint\".equals(tagName)) {\n          handleSequencePointTag(xmlParserHelper);\n        } else if (\"BranchPoint\".equals(tagName)) {\n          handleBranchPointTag(xmlParserHelper);\n        }\n      }\n    }\n\n    private void handleFileRef(XmlParserHelper xmlParserHelper) {\n      this.currentFileRefUid = xmlParserHelper.getRequiredAttribute(\"uid\");\n    }\n\n    private void handleFileTag(XmlParserHelper xmlParserHelper) {\n      String uid = xmlParserHelper.getRequiredAttribute(\"uid\");\n      String pathInCoverageFile = xmlParserHelper.getRequiredAttribute(\"fullPath\");\n\n      String canonicalPath;\n      try {\n        canonicalPath = new File(pathInCoverageFile).getCanonicalPath();\n      } catch (IOException e) {\n        LOG.debug(\"Skipping the import of OpenCover code coverage for the invalid file path: \" + pathInCoverageFile\n          + \" at line \" + xmlParserHelper.stream().getLocation().getLineNumber(), e);\n        return;\n      }\n\n      CoveredFile coveredFile = createCoveredFile(canonicalPath, uid, pathInCoverageFile);\n      LOG.debug(\"CoveredFile created: {}.\", coveredFile);\n      files.put(uid, coveredFile);\n    }\n\n    private void handleSequencePointTag(XmlParserHelper xmlParserHelper) {\n      // Open Cover lacks model documentation but the details can be found in the source code:\n      // https://github.com/OpenCover/opencover/blob/4.7.922/main/OpenCover.Framework/Model/SequencePoint.cs\n      int line = xmlParserHelper.getRequiredIntAttribute(\"sl\");\n      int visitCount = xmlParserHelper.getRequiredIntAttribute(\"vc\");\n\n      String fileId = xmlParserHelper.getAttribute(\"fileid\");\n      if (fileId == null) {\n        fileId = currentFileRefUid;\n      }\n\n      if (files.containsKey(fileId)) {\n        CoveredFile coveredFile = files.get(fileId);\n\n        if (coveredFile.isIndexed()) {\n          coverage.addHits(coveredFile.indexedPath, line, visitCount);\n\n          LOG.trace(\"OpenCover parser: add hits for file {}, line '{}', visitCount '{}'.\",\n            coveredFile, line, visitCount);\n        } else {\n          LOG.debug(\"Skipping the file {}, line '{}', visitCount '{}' because file is not indexed or does not have the supported language. \"\n              + VERIFY_SONARPROJECTPROPERTIES_MESSAGE,\n            coveredFile, line, visitCount);\n        }\n      } else {\n        LOG.debug(\"OpenCover parser (handleSequencePointTag): the fileId '{}' key is not contained in files (entry for line '{}', visitCount '{}').\",\n          fileId, line, visitCount);\n      }\n    }\n\n    private void handleBranchPointTag(XmlParserHelper xmlParserHelper) {\n      String fileId = xmlParserHelper.getAttribute(\"fileid\");\n      if (fileId == null) {\n        fileId = currentFileRefUid;\n      }\n\n      if (files.containsKey(fileId)) {\n        CoveredFile coveredFile = files.get(fileId);\n\n        int line = xmlParserHelper.getIntAttributeOrZero(\"sl\");\n        if (line == 0){\n          LOG.warn(\"OpenCover parser: invalid start line for file {}.\", coveredFile);\n          return;\n        }\n\n        int offset = xmlParserHelper.getRequiredIntAttribute(\"offset\");\n        int offsetEnd = xmlParserHelper.getRequiredIntAttribute(\"offsetend\");\n        int path = xmlParserHelper.getRequiredIntAttribute(\"path\");\n        int visitCount = xmlParserHelper.getRequiredIntAttribute(\"vc\");\n\n        if (coveredFile.isIndexed()) {\n          coverage.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,\n            coveredFile.indexedPath,\n            line,\n            new ConditionData.Location(offset, offsetEnd),\n            path,\n            visitCount,\n            file.getPath()));\n\n          LOG.trace(\"OpenCover parser: add branch hits for file {}, line '{}', offset '{}', visitCount '{}'.\",\n            coveredFile, line, offset, visitCount);\n        } else {\n          LOG.debug(\"OpenCover parser: Skipping branch hits for file {}, line '{}', offset '{}', visitCount '{}' because file\" +\n              \" is not indexed or does not have the supported language. \" + VERIFY_SONARPROJECTPROPERTIES_MESSAGE,\n            coveredFile, line, offset, visitCount);\n        }\n      } else {\n        LOG.debug(\"OpenCover parser (handleBranchPointTag): the fileId '{}' key is not contained in files.\", fileId);\n      }\n    }\n\n    private CoveredFile createCoveredFile(String canonicalPath, String uid, String pathInCoverageFile){\n      if (fileService.isSupportedAbsolute(canonicalPath)) {\n        return new CoveredFile(uid, pathInCoverageFile, canonicalPath);\n      } else {\n        // maybe it's a deterministic build file path\n        return fileService.getAbsolutePath(pathInCoverageFile)\n          .map(path -> new CoveredFile(uid, pathInCoverageFile, path))\n          .orElseGet(() -> new CoveredFile(uid, pathInCoverageFile, null));\n      }\n    }\n  }\n\n  /**\n   * Represents a file mentioned in the OpenCover report list of files, which may or may not be supported by the FileService.\n   * @see FileService\n   */\n  private static class CoveredFile {\n    // the file ID from the OpenCover report\n    final String uid;\n    // the path from the coverage file\n    final String originalPath;\n    // the path which is indexed by the scanner\n    final String indexedPath;\n\n    CoveredFile(String uid, String originalPath, @Nullable String indexedPath) {\n      this.uid = uid;\n      this.originalPath = originalPath;\n      this.indexedPath = indexedPath;\n    }\n\n    /**\n     * @return True if indexedPath is supported/resolved by the FileService, which means it's indexed by the Scanner.\n     * @see FileService#isSupportedAbsolute(String)\n     * @see FileService#getAbsolutePath(String)\n     */\n    boolean isIndexed() {\n      return indexedPath != null;\n    }\n\n    @Override\n    public String toString() {\n      return indexedPath == null\n        ? String.format(\"(ID '%s', path '%s', NO INDEXED PATH)\", uid, originalPath)\n        : String.format(\"(ID '%s', path '%s', indexed as '%s')\", uid, originalPath, indexedPath);\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonar/plugins/dotnet/tests/coverage/SequencePoint.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests.coverage;\n\npublic class SequencePoint {\n  private final int lineStart;\n  private final int lineEnd;\n  private final int hits;\n  private String filePath;\n\n  SequencePoint(String filePath, int lineStart, int lineEnd, int hits) {\n    this(lineStart, lineEnd, hits);\n    this.filePath = filePath;\n  }\n\n  SequencePoint(int lineStart, int lineEnd, int hits){\n    this.lineStart = lineStart;\n    this.lineEnd = lineEnd;\n    this.hits = hits;\n  }\n\n  public String getFilePath() {\n    return filePath;\n  }\n\n  public int getStartLine() {\n    return lineStart;\n  }\n\n  public int getLineEnd() {\n    return lineEnd;\n  }\n\n  public int getHits() {\n    return hits;\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonar/plugins/dotnet/tests/coverage/VisualStudioCoverageXmlReportParser.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests.coverage;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Optional;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonar.plugins.dotnet.tests.FileService;\nimport org.sonar.plugins.dotnet.tests.XmlParserHelper;\n\nimport static org.sonarsource.dotnet.shared.CallableUtils.lazy;\n\npublic class VisualStudioCoverageXmlReportParser implements CoverageParser {\n\n  private static final Logger LOG = LoggerFactory.getLogger(VisualStudioCoverageXmlReportParser.class);\n  private final FileService fileService;\n\n  public VisualStudioCoverageXmlReportParser(FileService fileService) {\n    this.fileService = fileService;\n  }\n\n  @Override\n  public void accept(File file, Coverage coverage) {\n    LOG.debug(\"The current user dir is '{}'.\", lazy(() -> System.getProperty(\"user.dir\")));\n    LOG.info(\"Parsing the Visual Studio coverage XML report {}\", file.getAbsolutePath());\n    new Parser(file, coverage).parse();\n  }\n\n  private class Parser {\n\n    private final File file;\n    private final Map<Integer, List<Integer>> coveredLines = new HashMap<>();\n    private final Map<Integer, List<Integer>> uncoveredLines = new HashMap<>();\n    private final Coverage coverage;\n\n    Parser(File file, Coverage coverage) {\n      this.file = file;\n      this.coverage = coverage;\n    }\n\n    public void parse() {\n      try (XmlParserHelper xmlParserHelper = new XmlParserHelper(file)) {\n        checkRootTag(xmlParserHelper);\n        dispatchTags(xmlParserHelper);\n      } catch (IOException e) {\n        throw new IllegalStateException(\"Unable to close report\", e);\n      }\n    }\n\n    private void dispatchTags(XmlParserHelper xmlParserHelper) {\n      String tagName;\n      while ((tagName = xmlParserHelper.nextStartTag()) != null) {\n        if (\"module\".equals(tagName)) {\n          handleModuleTag();\n        } else if (\"range\".equals(tagName)) {\n          handleRangeTag(xmlParserHelper);\n        } else if (\"source_file\".equals(tagName)) {\n          handleSourceFileTag(xmlParserHelper);\n        }\n      }\n    }\n\n    private void handleModuleTag() {\n      coveredLines.clear();\n      uncoveredLines.clear();\n    }\n\n    private void handleRangeTag(XmlParserHelper xmlParserHelper) {\n      int source = xmlParserHelper.getRequiredIntAttribute(\"source_id\");\n      String covered = xmlParserHelper.getRequiredAttribute(\"covered\");\n\n      int line = xmlParserHelper.getRequiredIntAttribute(\"start_line\");\n\n      if (\"yes\".equals(covered) || \"partial\".equals(covered)) {\n        coveredLines.putIfAbsent(source, new ArrayList<>());\n        coveredLines.get(source).add(line);\n      } else if (\"no\".equals(covered)) {\n        uncoveredLines.putIfAbsent(source, new ArrayList<>());\n        uncoveredLines.get(source).add(line);\n      } else {\n        throw xmlParserHelper.parseError(\"Unsupported \\\"covered\\\" value \\\"\" + covered + \"\\\", expected one of \\\"yes\\\", \\\"partial\\\" or \\\"no\\\"\");\n      }\n    }\n\n    private void handleSourceFileTag(XmlParserHelper xmlParserHelper) {\n      int id = xmlParserHelper.getRequiredIntAttribute(\"id\");\n      String path = xmlParserHelper.getRequiredAttribute(\"path\");\n\n      String canonicalPath;\n      try {\n        canonicalPath = new File(path).getCanonicalPath();\n      } catch (IOException e) {\n        LOG.warn(\"Skipping the import of Visual Studio XML code coverage for the invalid file path: \" + path\n          + \" at line \" + xmlParserHelper.stream().getLocation().getLineNumber(), e);\n        return;\n      }\n\n      if (!fileService.isSupportedAbsolute(canonicalPath)) {\n        Optional<String> absolutePath = fileService.getAbsolutePath(path);\n        if (absolutePath.isPresent()) {\n          canonicalPath = absolutePath.get();\n          LOG.debug(\"Found indexed file '{}' for coverage entry '{}'.\", canonicalPath, path);\n        } else {\n          // debug logging should be done in the fileService\n          return;\n        }\n      }\n\n      if (coveredLines.containsKey(id)) {\n        LOG.trace(\"Found covered lines for id '{}' for path '{}'\", id, canonicalPath);\n\n        for (Integer line : coveredLines.get(id)) {\n          coverage.addHits(canonicalPath, line, 1);\n        }\n      }\n\n      if (uncoveredLines.containsKey(id)) {\n        LOG.trace(\"Found uncovered lines for id '{}' for path '{}'\", id, canonicalPath);\n\n        for (Integer line : uncoveredLines.get(id)) {\n          coverage.addHits(canonicalPath, line, 0);\n        }\n      }\n    }\n\n    private void checkRootTag(XmlParserHelper xmlParserHelper) {\n      xmlParserHelper.checkRootTag(\"results\");\n    }\n\n  }\n\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonar/plugins/dotnet/tests/coverage/package-info.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests.coverage;\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonar/plugins/dotnet/tests/package-info.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n@ParametersAreNonnullByDefault\npackage org.sonar.plugins.dotnet.tests;\n\nimport javax.annotation.ParametersAreNonnullByDefault;\n\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/CallableUtils.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared;\n\nimport java.util.concurrent.Callable;\n\npublic final class CallableUtils {\n  private CallableUtils(){}\n\n  public static Object lazy(Callable<?> callable) {\n    return new Object() {\n      @Override\n      public String toString() {\n        try {\n          Object result = callable.call();\n          return result == null ? \"null\" : result.toString();\n        } catch (Exception exception) {\n          throw new LazyCallException(\"An error occurred when calling a lazy operation\", exception);\n        }\n      }\n    };\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/LazyCallException.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared;\n\npublic class LazyCallException extends RuntimeException {\n  public LazyCallException(String errorMessage, Exception exception) {\n    super(errorMessage, exception);\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/PropertyUtils.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared;\n\nimport org.sonar.api.config.PropertyDefinition;\n\nimport java.util.List;\nimport java.util.Set;\nimport java.util.stream.Collectors;\n\npublic class PropertyUtils {\n  private PropertyUtils() { }\n\n  public static Set<Object> nonProperties(List<Object> extensions) {\n    return extensions.stream()\n      .filter(extension -> !(extension instanceof PropertyDefinition))\n      .collect(Collectors.toSet());\n  }\n\n  public static Set<String> propertyKeys(List<Object> extensions) {\n    return extensions.stream()\n      .filter(PropertyDefinition.class::isInstance)\n      .map(extension -> ((PropertyDefinition) extension).key())\n      .collect(Collectors.toSet());\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/StringUtils.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared;\n\npublic class StringUtils {\n  private StringUtils() {\n    // utility class, forbidden constructor\n  }\n\n  public static String pluralize(String value, long count) {\n    return count == 1\n      ? value\n      : (value + \"s\");\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/package-info.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n@ParametersAreNonnullByDefault\npackage org.sonarsource.dotnet.shared;\n\nimport javax.annotation.ParametersAreNonnullByDefault;\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/AbstractLanguageConfiguration.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.util.HashSet;\nimport java.util.Optional;\nimport java.util.Set;\nimport org.sonar.api.config.Configuration;\nimport org.sonar.api.scanner.ScannerSide;\n\nimport static java.util.Arrays.asList;\n\n@ScannerSide\npublic abstract class AbstractLanguageConfiguration {\n  private static final String SUFFIX = \".sonar\";\n\n  protected final PluginMetadata metadata;\n\n  protected final Configuration configuration;\n\n  protected AbstractLanguageConfiguration(Configuration configuration, PluginMetadata metadata) {\n    this.configuration = configuration;\n    this.metadata = metadata;\n  }\n\n  public boolean ignoreThirdPartyIssues() {\n    return configuration.getBoolean(AbstractPropertyDefinitions.ignoreIssuesProperty(metadata.languageKey())).orElse(false);\n  }\n\n  public Set<String> bugCategories() {\n    return new HashSet<>(asList(configuration.getStringArray(AbstractPropertyDefinitions.bugCategoriesProperty(metadata.languageKey()))));\n  }\n\n  public Set<String> codeSmellCategories() {\n    return new HashSet<>(asList(configuration.getStringArray(AbstractPropertyDefinitions.codeSmellCategoriesProperty(metadata.languageKey()))));\n  }\n\n  public Set<String> vulnerabilityCategories() {\n    return new HashSet<>(asList(configuration.getStringArray(AbstractPropertyDefinitions.vulnerabilityCategoriesProperty(metadata.languageKey()))));\n  }\n\n  public boolean analyzeGeneratedCode() {\n    return configuration.getBoolean(AbstractPropertyDefinitions.analyzeGeneratedCode(metadata.languageKey())).orElse(false);\n  }\n\n  public Optional<Path> outputDir() {\n    // Working directory folder is constructed from SonarOutputDir + \".sonar\". We have to remove the suffix.\n    // e.g. SonarOutputDir = .sonarqube\\out\\.sonar\\ -> .sonarqube\\out\\\n    return configuration\n      .get(\"sonar.working.directory\")\n      .filter(s -> s.endsWith(SUFFIX))\n      .map(AbstractLanguageConfiguration::outputDir);\n  }\n\n  private static Path outputDir(String workingDirectory) {\n    return Paths.get(workingDirectory).getParent();\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/AbstractPropertyDefinitions.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport org.sonar.api.PropertyType;\nimport org.sonar.api.config.PropertyDefinition;\nimport org.sonar.api.resources.Qualifiers;\nimport org.sonar.api.utils.ManifestUtils;\n\n/**\n * This class is responsible to declare all the properties that can be set through SonarQube UI (settings page).\n */\npublic abstract class AbstractPropertyDefinitions {\n  private static final String EXTERNAL_ANALYZERS_CATEGORY = \"External Analyzers\";\n  private static final String LEGACY_PROP_PREFIX = \"sonaranalyzer-\";  // properties that use this are legacy for compatibility with S4NET <= 9.0.2\n  protected static final String PROP_PREFIX = \"sonar.\";\n  public static final String PROJECT_KEY_PROPERTY = PROP_PREFIX + \"projectKey\";\n  public static final String PROJECT_NAME_PROPERTY = PROP_PREFIX + \"projectName\";\n  public static final String PROJECT_BASE_DIR_PROPERTY = PROP_PREFIX + \"projectBaseDir\";\n\n  protected final PluginMetadata metadata;\n\n  protected AbstractPropertyDefinitions(PluginMetadata metadata) {\n    this.metadata = metadata;\n  }\n\n  public List<PropertyDefinition> create() {\n    String languageKey = metadata.languageKey();\n    String languageName = metadata.languageName();\n    String version = projectVersion();\n    List<PropertyDefinition> result = new ArrayList<>();\n    result.add(\n      PropertyDefinition.builder(roslynJsonReportPathProperty(languageKey))\n        .multiValues(true)\n        .hidden()\n        .build());\n    result.add(\n      PropertyDefinition.builder(analyzerWorkDirProperty(languageKey))\n        .multiValues(true)\n        .hidden()\n        .build());\n    result.add(\n      PropertyDefinition.builder(pluginKeyScannerPropertyKey(languageKey))\n        .defaultValue(metadata.pluginKey())\n        .hidden()\n        .build());\n    result.add(\n      PropertyDefinition.builder(pluginVersionScannerPropertyKey(languageKey))\n        .defaultValue(version)\n        .hidden()\n        .build());\n    result.add(\n      PropertyDefinition.builder(staticResourceNameScannerPropertyKey(languageKey))\n        .defaultValue(\"SonarAnalyzer-\" + metadata.pluginKey() + \"-\" + version + \".zip\")\n        .hidden()\n        .build());\n    result.add(\n      PropertyDefinition.builder(fileSuffixProperty(languageKey))\n        .category(languageName)\n        .defaultValue(metadata.fileSuffixesDefaultValue())\n        .name(\"File suffixes\")\n        .description(\"List of suffixes for files to analyze.\")\n        .multiValues(true)\n        .onQualifiers(Qualifiers.PROJECT)\n        .build());\n    result.add(\n      PropertyDefinition.builder(ignoreHeaderCommentsProperty(languageKey))\n        .category(languageName)\n        .defaultValue(\"true\")\n        .name(\"Ignore header comments\")\n        .description(\"If set to \\\"true\\\", the file headers (that are usually the same on each file: \" +\n          \"licensing information for example) are not considered as comments. Thus metrics such as \\\"Comment lines\\\" \" +\n          \"do not get incremented. If set to \\\"false\\\", those file headers are considered as comments and metrics such as \" +\n          \"\\\"Comment lines\\\" get incremented.\")\n        .onQualifiers(Qualifiers.PROJECT)\n        .type(PropertyType.BOOLEAN)\n        .build());\n    result.add(\n      PropertyDefinition.builder(analyzeGeneratedCode(languageKey))\n        .category(languageName)\n        .defaultValue(\"false\")\n        .name(\"Analyze generated code\")\n        .description(\"If set to \\\"true\\\", the files containing generated code are analyzed.\" +\n          \" If set to \\\"false\\\", the files containing generated code are ignored.\")\n        .onQualifiers(Qualifiers.PROJECT)\n        .type(PropertyType.BOOLEAN)\n        .build());\n    result.add(\n      PropertyDefinition.builder(ignoreIssuesProperty(languageKey))\n        .type(PropertyType.BOOLEAN)\n        .category(EXTERNAL_ANALYZERS_CATEGORY)\n        .subCategory(languageName)\n        .index(0)\n        .defaultValue(\"false\")\n        .name(\"Ignore issues from external Roslyn analyzers\")\n        .description(\"If set to 'true', issues reported by external Roslyn analyzers won't be imported.\")\n        .onQualifiers(Qualifiers.PROJECT)\n        .build());\n    result.add(\n      PropertyDefinition.builder(bugCategoriesProperty(languageKey))\n        .type(PropertyType.STRING)\n        .multiValues(true)\n        .category(EXTERNAL_ANALYZERS_CATEGORY)\n        .subCategory(languageName)\n        .index(1)\n        .name(\"Rule categories associated with Bugs\")\n        .description(\"External rule categories to be treated as Bugs.\")\n        .onQualifiers(Qualifiers.PROJECT)\n        .build());\n    result.add(\n      PropertyDefinition.builder(vulnerabilityCategoriesProperty(languageKey))\n        .type(PropertyType.STRING)\n        .multiValues(true)\n        .category(EXTERNAL_ANALYZERS_CATEGORY)\n        .subCategory(languageName)\n        .index(2)\n        .name(\"Rule categories associated with Vulnerabilities\")\n        .description(\"External rule categories to be treated as Vulnerabilities.\")\n        .onQualifiers(Qualifiers.PROJECT)\n        .build());\n    result.add(\n      PropertyDefinition.builder(codeSmellCategoriesProperty(languageKey))\n        .type(PropertyType.STRING)\n        .multiValues(true)\n        .category(EXTERNAL_ANALYZERS_CATEGORY)\n        .subCategory(languageName)\n        .index(3)\n        .name(\"Rule categories associated with Code Smells\")\n        .description(\"External rule categories to be treated as Code Smells. By default, external issues are Code Smells, or Bugs when the severity is error.\")\n        .onQualifiers(Qualifiers.PROJECT)\n        .build());\n    result.add(\n      PropertyDefinition.builder(pluginKeyLegacyScannerPropertyKey(languageKey))\n        .defaultValue(metadata.pluginKey())\n        .hidden()\n        .build());\n    result.add(\n      PropertyDefinition.builder(pluginVersionLegacyScannerPropertyKey(languageKey))\n        .defaultValue(version)\n        .hidden()\n        .build());\n    result.add(\n      PropertyDefinition.builder(staticResourceNameLegacyScannerPropertyKey(languageKey))\n        .defaultValue(\"SonarAnalyzer-\" + metadata.pluginKey() + \"-\" + version + \".zip\")\n        .hidden()\n        .build());\n    result.add(\n      PropertyDefinition.builder(analyzerIdLegacyScannerPropertyKey(languageKey))\n        .defaultValue(metadata.analyzerProjectName())\n        .hidden()\n        .build());\n    result.add(\n      PropertyDefinition.builder(ruleNamespaceLegacyScannerPropertyKey(languageKey))\n        .defaultValue(metadata.analyzerProjectName())\n        .hidden()\n        .build());\n    return result;\n  }\n\n  public static String ignoreHeaderCommentsProperty(String languageKey) {\n    return PROP_PREFIX + languageKey + \".ignoreHeaderComments\";\n  }\n\n  public static String analyzeGeneratedCode(String languageKey) {\n    return PROP_PREFIX + languageKey + \".analyzeGeneratedCode\";\n  }\n\n  public static String fileSuffixProperty(String languageKey) {\n    return PROP_PREFIX + languageKey + \".file.suffixes\";\n  }\n\n  public static String roslynJsonReportPathProperty(String languageKey) {\n    return PROP_PREFIX + languageKey + \".roslyn.reportFilePaths\";\n  }\n\n  public static String telemetryJsonReportPathProperty(String languageKey) {\n    return PROP_PREFIX + languageKey + \".scanner.telemetry\";\n  }\n\n  public static String analyzerWorkDirProperty(String languageKey) {\n    return PROP_PREFIX + languageKey + \".analyzer.projectOutPaths\";\n  }\n\n  public static String ignoreIssuesProperty(String languageKey) {\n    return PROP_PREFIX + languageKey + \".roslyn.ignoreIssues\";\n  }\n\n  public static String bugCategoriesProperty(String languageKey) {\n    return PROP_PREFIX + languageKey + \".roslyn.bugCategories\";\n  }\n\n  public static String codeSmellCategoriesProperty(String languageKey) {\n    return PROP_PREFIX + languageKey + \".roslyn.codeSmellCategories\";\n  }\n\n  public static String vulnerabilityCategoriesProperty(String languageKey) {\n    return PROP_PREFIX + languageKey + \".roslyn.vulnerabilityCategories\";\n  }\n\n  public static String pullRequestCacheBasePath() {\n    return PROP_PREFIX + \"pullrequest.cache.basepath\";\n  }\n\n  public static String pullRequestBase() {\n    return PROP_PREFIX + \"pullrequest.base\";\n  }\n\n  public static String pluginKeyScannerPropertyKey(String languageKey) {\n    return scannerForDotNetProperty(languageKey, \"pluginKey\");\n  }\n\n  public static String pluginVersionScannerPropertyKey(String languageKey) {\n    return scannerForDotNetProperty(languageKey, \"pluginVersion\");\n  }\n\n  public static String staticResourceNameScannerPropertyKey(String languageKey) {\n    return scannerForDotNetProperty(languageKey, \"staticResourceName\");\n  }\n\n  private static String scannerForDotNetProperty(String languageKey, String name) {\n    return PROP_PREFIX + languageKey + \".analyzer.dotnet.\" + name;\n  }\n\n  private static String pluginKeyLegacyScannerPropertyKey(String languageKey) {\n    return LEGACY_PROP_PREFIX + languageKey + \".pluginKey\";\n  }\n\n  private static String pluginVersionLegacyScannerPropertyKey(String languageKey) {\n    return LEGACY_PROP_PREFIX + languageKey + \".pluginVersion\";\n  }\n\n  private static String staticResourceNameLegacyScannerPropertyKey(String languageKey) {\n    return LEGACY_PROP_PREFIX + languageKey + \".staticResourceName\";\n  }\n\n  private static String analyzerIdLegacyScannerPropertyKey(String languageKey) {\n    return LEGACY_PROP_PREFIX + languageKey + \".analyzerId\";\n  }\n\n  private static String ruleNamespaceLegacyScannerPropertyKey(String languageKey) {\n    return LEGACY_PROP_PREFIX + languageKey + \".ruleNamespace\";\n  }\n\n  static String projectVersion() {\n    List<String> propertyValues = ManifestUtils.getPropertyValues(AbstractPropertyDefinitions.class.getClassLoader(), \"Plugin-Version\");\n    return propertyValues.isEmpty() ? \"Version-N/A\" : propertyValues.iterator().next();\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/AbstractSonarWayProfile.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport java.util.Set;\nimport java.util.stream.Collectors;\nimport org.sonar.api.server.profile.BuiltInQualityProfilesDefinition;\nimport org.sonarsource.analyzer.commons.BuiltInQualityProfileJsonLoader;\n\npublic abstract class AbstractSonarWayProfile implements BuiltInQualityProfilesDefinition {\n\n  protected final PluginMetadata metadata;\n  private final RoslynRules roslynRules;\n\n  protected AbstractSonarWayProfile(PluginMetadata metadata, RoslynRules roslynRules) {\n    this.metadata = metadata;\n    this.roslynRules = roslynRules;\n  }\n\n  @Override\n  public void define(Context context) {\n    NewBuiltInQualityProfile sonarWay = context.createBuiltInQualityProfile(\"Sonar way\", metadata.languageKey());\n    String sonarWayJsonPath = metadata.resourcesDirectory() + \"/Sonar_way_profile.json\";\n    Set<String> roslynRuleIDs = roslynRules.rules().stream().map(RoslynRules.Rule::getId).collect(Collectors.toSet());\n    for (String ruleID : BuiltInQualityProfileJsonLoader.loadActiveKeysFromJsonProfile(sonarWayJsonPath)) {\n      if (roslynRuleIDs.contains(ruleID)) {\n        sonarWay.activateRule(metadata.repositoryKey(), ruleID);\n      }\n    }\n    registerRulesFromRegistrars(sonarWay);\n    sonarWay.done();\n  }\n\n  protected void registerRulesFromRegistrars(NewBuiltInQualityProfile profile) {\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/CodeCoverageProvider.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport java.util.Arrays;\nimport java.util.List;\nimport org.sonar.api.batch.fs.FileSystem;\nimport org.sonar.api.config.Configuration;\nimport org.sonar.api.config.PropertyDefinition;\nimport org.sonar.api.notifications.AnalysisWarnings;\nimport org.sonar.api.scanner.ScannerSide;\nimport org.sonar.plugins.dotnet.tests.coverage.CoverageAggregator;\nimport org.sonar.plugins.dotnet.tests.coverage.CoverageConfiguration;\nimport org.sonar.plugins.dotnet.tests.coverage.CoverageReportImportSensor;\nimport org.sonar.plugins.dotnet.tests.ScannerFileService;\n\nimport static org.sonar.api.config.PropertyDefinition.ConfigScope;\n\n@ScannerSide\npublic class CodeCoverageProvider {\n\n  private static final String SUBCATEGORY = \"Code Coverage\";\n  private static final String SONAR_PROPERTY_PREFIX = \"sonar.\";\n\n  private final PluginMetadata pluginMetadata;\n  private final CoverageConfiguration coverageConf;\n\n  public CodeCoverageProvider(PluginMetadata pluginMetadata) {\n    this.pluginMetadata = pluginMetadata;\n    String languageKey = pluginMetadata.languageKey();\n\n    coverageConf = new CoverageConfiguration(\n      languageKey,\n      SONAR_PROPERTY_PREFIX + languageKey + \".ncover3.reportsPaths\",\n      SONAR_PROPERTY_PREFIX + languageKey + \".opencover.reportsPaths\",\n      SONAR_PROPERTY_PREFIX + languageKey + \".dotcover.reportsPaths\",\n      SONAR_PROPERTY_PREFIX + languageKey + \".vscoveragexml.reportsPaths\",\n      SONAR_PROPERTY_PREFIX + languageKey + \".cobertura.reportsPaths\");\n  }\n\n  public List<Object> extensions() {\n    String category = pluginMetadata.languageName();\n\n    return Arrays.asList(\n      this,\n      UnitTestCoverageAggregator.class,\n      UnitTestCoverageReportImportSensor.class,\n\n      PropertyDefinition.builder(coverageConf.ncover3PropertyKey())\n        .name(\"NCover3 Unit Tests Reports Paths\")\n        .description(\"Example: \\\"report.nccov\\\", \\\"report1.nccov,report2.nccov\\\" or \\\"C:/report.nccov\\\"\")\n        .category(category)\n        .subCategory(SUBCATEGORY)\n        .onlyOnConfigScopes(List.of(ConfigScope.PROJECT))\n        .multiValues(true)\n        .build(),\n      PropertyDefinition.builder(coverageConf.openCoverPropertyKey())\n        .name(\"OpenCover Unit Tests Reports Paths\")\n        .description(\"Example: \\\"report.xml\\\", \\\"report1.xml,report2.xml\\\" or \\\"C:/report.xml\\\"\")\n        .category(category)\n        .subCategory(SUBCATEGORY)\n        .onlyOnConfigScopes(List.of(ConfigScope.PROJECT))\n        .multiValues(true)\n        .build(),\n      PropertyDefinition.builder(coverageConf.dotCoverPropertyKey())\n        .name(\"dotCover Unit Tests (HTML) Reports Paths\")\n        .description(\"Example: \\\"report.html\\\", \\\"report1.html,report2.html\\\" or \\\"C:/report.html\\\"\")\n        .category(category)\n        .subCategory(SUBCATEGORY)\n        .onlyOnConfigScopes(List.of(ConfigScope.PROJECT))\n        .multiValues(true)\n        .build(),\n      PropertyDefinition.builder(coverageConf.visualStudioCoverageXmlPropertyKey())\n        .name(\"Visual Studio Unit Tests (XML) Reports Paths\")\n        .description(\"Example: \\\"report.coveragexml\\\", \\\"report1.coveragexml,report2.coveragexml\\\" or \\\"C:/report.coveragexml\\\"\")\n        .category(category)\n        .subCategory(SUBCATEGORY)\n        .onlyOnConfigScopes(List.of(ConfigScope.PROJECT))\n        .multiValues(true)\n        .build(),\n      PropertyDefinition.builder(coverageConf.coberturaPropertyKey())\n        .name(\"Cobertura Unit Tests Reports Paths\")\n        .description(\"Example: \\\"coverage.xml\\\", \\\"report1.xml,report2.xml\\\" or \\\"C:/coverage.xml\\\"\")\n        .category(category)\n        .subCategory(SUBCATEGORY)\n        .onlyOnConfigScopes(List.of(ConfigScope.PROJECT))\n        .multiValues(true)\n        .build());\n  }\n\n  public class UnitTestCoverageAggregator extends CoverageAggregator {\n\n    public UnitTestCoverageAggregator(Configuration configuration, FileSystem fileSystem,\n      AnalysisWarnings analysisWarnings) {\n      super(coverageConf,\n        configuration,\n        new ScannerFileService(coverageConf.languageKey(), fileSystem),\n        analysisWarnings);\n    }\n\n  }\n\n  public class UnitTestCoverageReportImportSensor extends CoverageReportImportSensor {\n\n    public UnitTestCoverageReportImportSensor(UnitTestCoverageAggregator coverageAggregator) {\n      super(coverageConf, coverageAggregator, pluginMetadata.languageKey(), pluginMetadata.languageName());\n    }\n\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/DotNetRulesDefinition.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport org.sonar.api.SonarRuntime;\nimport org.sonar.api.server.rule.RuleParamType;\nimport org.sonar.api.server.rule.RulesDefinition;\nimport org.sonarsource.analyzer.commons.RuleMetadataLoader;\n\npublic class DotNetRulesDefinition implements RulesDefinition {\n  private static final String REPOSITORY_NAME = \"SonarAnalyzer\";\n\n  private final PluginMetadata metadata;\n  private final SonarRuntime sonarRuntime;\n  private final RoslynRules roslynRules;\n\n  public DotNetRulesDefinition(PluginMetadata metadata, SonarRuntime sonarRuntime, RoslynRules roslynRules) {\n    this.metadata = metadata;\n    this.sonarRuntime = sonarRuntime;\n    this.roslynRules = roslynRules;\n  }\n\n  @Override\n  public void define(Context context) {\n    NewRepository repository = context.createRepository(metadata.repositoryKey(), metadata.languageKey()).setName(REPOSITORY_NAME);\n    // Path to SonarWay JSON sets the rule.setActivatedByDefault(true) that is needed by SonarLint in standalone mode\n    RuleMetadataLoader ruleMetadataLoader = new RuleMetadataLoader(metadata.resourcesDirectory(), metadata.resourcesDirectory() + \"/Sonar_way_profile.json\", sonarRuntime);\n    ruleMetadataLoader.addRulesByRuleKey(repository, roslynRules.rules().stream().map(RoslynRules.Rule::getId).toList());\n\n    for (RoslynRules.Rule rule : roslynRules.rules()) {\n      var currentRule = repository.rule(rule.id);\n      if (currentRule != null) {\n        for (RoslynRules.RuleParameter param : rule.parameters) {\n          currentRule.createParam(param.key)\n            .setType(RuleParamType.parse(param.type))\n            .setDescription(param.description)\n            .setDefaultValue(param.defaultValue);\n        }\n      }\n    }\n\n    repository.done();\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/EncodingPerFile.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport java.nio.charset.Charset;\nimport java.nio.charset.StandardCharsets;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonar.api.batch.fs.InputFile;\nimport org.sonar.api.scanner.ScannerSide;\n\n@ScannerSide\npublic class EncodingPerFile {\n  private static final Logger LOG = LoggerFactory.getLogger(EncodingPerFile.class);\n  private final GlobalProtobufFileProcessor globalReportProcessor;\n\n  public EncodingPerFile(GlobalProtobufFileProcessor globalReportProcessor) {\n    this.globalReportProcessor = globalReportProcessor;\n  }\n\n  public boolean encodingMatch(InputFile inputFile) {\n    String uri = inputFile.uri().toString();\n\n    if (!globalReportProcessor.getRoslynEncodingPerUri().containsKey(uri)) {\n      // When there is no entry for a file, it means it was not processed by Roslyn. So we consider encoding to be ok.\n      return true;\n    }\n\n    // Case-Insensitive check\n    Charset roslynEncoding = globalReportProcessor.getRoslynEncodingPerUri().get(uri);\n    if (roslynEncoding == null) {\n      // Roslyn saw the file, but it didn't recognized it's encoding. We fall back to the default encoding and accept the file.\n      LOG.warn(\"Roslyn can not detect encoding for '{}', using default instead.\", uri);\n      return true;\n    }\n\n    Charset sqEncoding = inputFile.charset();\n\n    boolean sameEncoding = sqEncoding.equals(roslynEncoding);\n    if (!sameEncoding) {\n      if (sqEncoding.equals(StandardCharsets.UTF_16LE) && roslynEncoding.equals(StandardCharsets.UTF_16)) {\n        sameEncoding = true;\n      } else {\n        LOG.warn(\"Encoding detected by Roslyn and encoding used by SonarQube do not match for file {}. \"\n            + \"SonarQube encoding is '{}', Roslyn encoding is '{}'. File will be skipped.\",\n          uri, sqEncoding, roslynEncoding);\n      }\n    }\n    return sameEncoding;\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/GlobalProtobufFileProcessor.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport java.net.URI;\nimport java.nio.charset.Charset;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Set;\nimport java.util.TreeMap;\nimport java.util.TreeSet;\nimport javax.annotation.Nullable;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonar.api.batch.Phase;\nimport org.sonar.api.batch.Phase.Name;\nimport org.sonar.api.batch.bootstrap.ProjectBuilder;\nimport org.sonar.api.batch.bootstrap.ProjectDefinition;\nimport org.sonar.api.batch.fs.InputFile;\nimport org.sonarsource.dotnet.shared.plugins.protobuf.FileMetadataImporter;\n\nimport static org.sonarsource.dotnet.shared.plugins.AbstractPropertyDefinitions.analyzerWorkDirProperty;\nimport static org.sonarsource.dotnet.shared.plugins.ProtobufDataImporter.FILEMETADATA_FILENAME;\n\n/**\n * Since SonarQube 7.5, InputFileFilter can only access to global configuration. Use this ProjectBuilder to collect\n * various data in protobuf files that are in every modules.\n */\n@Phase(name = Name.POST)\npublic class GlobalProtobufFileProcessor extends ProjectBuilder {\n\n  private static final Logger LOG = LoggerFactory.getLogger(GlobalProtobufFileProcessor.class);\n\n  private final PluginMetadata metadata;\n\n  // We need case-insensitive string matching for Uri, because Uri for \"file://D:/Something\" is not equal to \"file://d:/something\"\n  private final Map<String, Charset> roslynEncodingPerUri = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);\n  private final Set<String> generatedFileUris = new TreeSet<>(String.CASE_INSENSITIVE_ORDER);\n\n  public GlobalProtobufFileProcessor(PluginMetadata metadata) {\n    this.metadata = metadata;\n  }\n\n  @Override\n  public void build(Context context) {\n    for (ProjectDefinition p : context.projectReactor().getProjects()) {\n      for (Path reportPath : protobufReportPaths(p.properties())) {\n        processMetadataReportIfPresent(reportPath);\n      }\n    }\n  }\n\n  private void processMetadataReportIfPresent(Path reportPath) {\n    Path metadataReportProtobuf = reportPath.resolve(FILEMETADATA_FILENAME);\n    if (metadataReportProtobuf.toFile().exists()) {\n      LOG.debug(\"Processing {}\", metadataReportProtobuf);\n      FileMetadataImporter fileMetadataImporter = new FileMetadataImporter();\n      fileMetadataImporter.accept(metadataReportProtobuf);\n      this.generatedFileUris.addAll(fileMetadataImporter.getGeneratedFileUris().stream().map(URI::toString).toList());\n      for (Map.Entry<URI, Charset> entry : fileMetadataImporter.getEncodingPerUri().entrySet()) {\n        String key = entry.getKey().toString();\n        if (!this.roslynEncodingPerUri.containsKey(key)) {\n          this.roslynEncodingPerUri.put(key, entry.getValue());\n        } else if (this.roslynEncodingPerUri.get(key) != entry.getValue()) {\n          LOG.warn(\"Different encodings {} vs. {} were detected for single file {}. Case-Sensitive paths are not supported.\",\n            this.roslynEncodingPerUri.get(key), entry.getValue(), key);\n        }\n      }\n    }\n  }\n\n  public Map<String, Charset> getRoslynEncodingPerUri() {\n    return Collections.unmodifiableMap(roslynEncodingPerUri);\n  }\n\n  /**\n   * Uri check is Case-Insensitive.\n   */\n  public boolean isGenerated(InputFile inputFile) {\n    return generatedFileUris.contains(inputFile.uri().toString());\n  }\n\n  private List<Path> protobufReportPaths(Map<String, String> moduleProps) {\n    return Arrays.stream(parseAsStringArray(moduleProps.get(analyzerWorkDirProperty(metadata.languageKey()))))\n      .map(x -> Paths.get(x).resolve(ModuleConfiguration.getAnalyzerReportDir(metadata.languageKey())))\n      .toList();\n  }\n\n  /**\n   * A very simplified CSV parser, assuming there is no commas nor quotes in the protobuf paths\n   */\n  private String[] parseAsStringArray(@Nullable String value) {\n    if (value == null) {\n      return new String[0];\n    }\n    List<String> escapedValues = Arrays.asList(value.split(\",\"));\n    return escapedValues\n      .stream()\n      .map(String::trim)\n      .map(s -> removeStart(s, \"\\\"\"))\n      .map(s -> removeEnd(s, \"\\\"\"))\n      .toArray(String[]::new);\n  }\n\n  private static String removeStart(String s, String start) {\n    return s.startsWith(start) ? s.substring(start.length()) : s;\n  }\n\n  private static String removeEnd(String s, String end) {\n    return s.endsWith(end) ? s.substring(0, s.length() - end.length()) : s;\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/HashProvider.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport org.sonar.api.scanner.ScannerSide;\n\nimport java.io.IOException;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.security.MessageDigest;\nimport java.security.NoSuchAlgorithmException;\n\n@ScannerSide\npublic class HashProvider {\n  public byte[] computeHash(Path filePath) throws NoSuchAlgorithmException, IOException {\n    MessageDigest sha256 = MessageDigest.getInstance(\"SHA-256\");\n    byte[] content = Files.readAllBytes(filePath);\n    return sha256.digest(content);\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/MethodDeclarationsCollector.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport java.util.ArrayList;\nimport java.util.Collection;\nimport org.sonar.api.scanner.ScannerSide;\nimport org.sonarsource.dotnet.protobuf.SonarAnalyzer;\n\n/**\n * A simple project wide method declarations collector (created before all module sensors),\n * that allows MethodDeclarationsSensors to add method declarations from different protobuf files.\n */\n@ScannerSide\npublic class MethodDeclarationsCollector {\n  private final ArrayList<SonarAnalyzer.MethodDeclarationsInfo> methodDeclarations = new ArrayList<>();\n\n  public void addDeclaration(SonarAnalyzer.MethodDeclarationsInfo methodDeclaration) {\n    this.methodDeclarations.add(methodDeclaration);\n  }\n\n  public Collection<SonarAnalyzer.MethodDeclarationsInfo> getMethodDeclarations() {\n    return methodDeclarations;\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/ModuleConfiguration.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport java.io.IOException;\nimport java.nio.file.DirectoryStream;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.util.Arrays;\nimport java.util.Collection;\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.Locale;\nimport java.util.stream.StreamSupport;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonar.api.batch.InstantiationStrategy;\nimport org.sonar.api.batch.ScannerSide;\nimport org.sonar.api.config.Configuration;\n\nimport static org.sonarsource.dotnet.shared.CallableUtils.lazy;\nimport static org.sonarsource.dotnet.shared.plugins.AbstractPropertyDefinitions.analyzerWorkDirProperty;\nimport static org.sonarsource.dotnet.shared.plugins.AbstractPropertyDefinitions.roslynJsonReportPathProperty;\nimport static org.sonarsource.dotnet.shared.plugins.AbstractPropertyDefinitions.telemetryJsonReportPathProperty;\n\n/**\n * This configuration is at the level of the project (\"module\" in scanner-cli terminology).\n * <p>\n * Note: even if the concept of \"module\" was dropped from the SQ server side,\n * \"modules\" are still a core concept of the SQ scanner.\n * <p>\n * Module-independent configuration is in {@link AbstractLanguageConfiguration}.\n * <p>\n * Although module support has been dropped in SQ/SC, inside the scanner there is no good replacement for\n * {@link org.sonar.api.batch.ScannerSide}, yet.\n * When a replacement will appear, this code will have to be refactored.\n */\n@ScannerSide\n@InstantiationStrategy(InstantiationStrategy.PER_PROJECT)\npublic class ModuleConfiguration {\n  public static final String TELEMETRY_JSON = \"Telemetry.json\";\n  private static final Logger LOG = LoggerFactory.getLogger(ModuleConfiguration.class);\n  private static final String MSG_SUFFIX = \"Analyzer results won't be loaded from this directory.\";\n\n  private final Configuration configuration;\n  private final String projectKey;\n  private final PluginMetadata metadata;\n\n  public ModuleConfiguration(Configuration configuration, PluginMetadata metadata) {\n    this.configuration = configuration;\n    this.metadata = metadata;\n    this.projectKey = configuration.get(AbstractPropertyDefinitions.PROJECT_KEY_PROPERTY).orElse(\"<NONE>\");\n    LOG.trace(\"Project '{}': AbstractModuleConfiguration has been created.\", projectKey);\n  }\n\n  static String getAnalyzerReportDir(String languageKey) {\n    return \"output-\" + languageKey;\n  }\n\n  /**\n   * Returns path of the directory containing all protobuf files, if:\n   * - Property with it's location is defined\n   * - The directory exists\n   * - The directory contains at least one protobuf\n   */\n  public List<Path> protobufReportPaths() {\n    List<Path> analyzerWorkDirPaths = Arrays.stream(configuration.getStringArray(analyzerWorkDirProperty(metadata.languageKey())))\n      .map(Paths::get)\n      .toList();\n\n    if (analyzerWorkDirPaths.isEmpty() && !configuration.hasKey(\"sonar.tests\")) {\n      LOG.debug(\"Project '{}': Property missing: '{}'. No protobuf files will be loaded for this project.\", projectKey,\n        lazy(() -> analyzerWorkDirProperty(metadata.languageKey())));\n    }\n\n    return analyzerWorkDirPaths.stream().map(x -> x.resolve(getAnalyzerReportDir(metadata.languageKey())))\n      .filter(this::validateOutputDir)\n      .toList();\n  }\n\n  public List<Path> roslynReportPaths() {\n    String[] strPaths = configuration.getStringArray(roslynJsonReportPathProperty(metadata.languageKey()));\n    if (strPaths.length > 0) {\n      LOG.debug(\"Project '{}': The Roslyn JSON report path has '{}'\", projectKey, lazy(() -> String.join(\",\", strPaths)));\n      return Arrays.stream(strPaths)\n        .map(Paths::get)\n        .toList();\n    } else {\n      LOG.debug(\"Project '{}': No Roslyn issues reports have been found.\", projectKey);\n      return Collections.emptyList();\n    }\n  }\n\n  public Collection<Path> telemetryJsonPaths() {\n    var telemetryJson = configuration.getStringArray(telemetryJsonReportPathProperty(metadata.languageKey()));\n    return Arrays.stream(telemetryJson)\n      .map(Paths::get)\n      .filter(Files::exists)\n      .toList();\n  }\n\n  public List<Path> contextPaths() {\n    return Arrays.stream(configuration.getStringArray(analyzerWorkDirProperty(metadata.languageKey())))\n      .map(Paths::get)\n      .map(x -> x.resolve(getAnalyzerReportDir(metadata.languageKey())).resolve(\"Context\"))\n      .toList();\n  }\n\n  private boolean validateOutputDir(Path analyzerOutputDir) {\n    String path = analyzerOutputDir.toString();\n    try {\n      if (!analyzerOutputDir.toFile().exists()) {\n        LOG.debug(\"Project '{}': Analyzer working directory does not exist: '{}'. {}\", projectKey, path, MSG_SUFFIX);\n        return false;\n      }\n\n      try (DirectoryStream<Path> files = Files.newDirectoryStream(analyzerOutputDir, protoFileFilter())) {\n        long count = StreamSupport.stream(files.spliterator(), false).count();\n        if (count == 0) {\n          LOG.debug(\"Project '{}': Analyzer working directory '{}' contains no .pb file(s). {}\", projectKey, path, MSG_SUFFIX);\n          return false;\n        }\n\n        LOG.debug(\"Project '{}': Analyzer working directory '{}' contains {} .pb file(s)\", projectKey, path, count);\n        return true;\n      }\n    } catch (IOException e) {\n      throw new IllegalStateException(\"Could not check for .pb files in '\" + path + \"' for project \" + projectKey, e);\n    }\n  }\n\n  private static DirectoryStream.Filter<Path> protoFileFilter() {\n    return p -> p.getFileName().toString().toLowerCase(Locale.ROOT).endsWith(\".pb\");\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/PluginMetadata.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport org.sonar.api.ExtensionPoint;\nimport org.sonar.api.scanner.ScannerSide;\nimport org.sonar.api.server.ServerSide;\nimport org.sonarsource.api.sonarlint.SonarLintSide;\n\n@ScannerSide\n@ServerSide\n@SonarLintSide\n@ExtensionPoint\npublic interface PluginMetadata {\n\n  String languageKey();\n\n  String pluginKey();\n\n  String languageName();\n\n  String analyzerProjectName();\n\n  String repositoryKey();\n\n  String fileSuffixesKey();\n\n  String fileSuffixesDefaultValue();\n\n  String resourcesDirectory();\n\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/ProjectTypeCollector.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport java.util.Optional;\nimport org.sonar.api.scanner.ScannerSide;\n\nimport static org.sonarsource.dotnet.shared.StringUtils.pluralize;\n\n/**\n * Collects information about what types of files are in each project (MAIN, TEST, both or none).\n * The invoker should make sure that:\n * - no duplicates are added (i.e. call twice for same information)\n * - it is called by the Scanner for MSBuild\n */\n@ScannerSide\npublic class ProjectTypeCollector {\n  private static final String PROJECT = \"project\";\n\n  // Each field holds the number of modules (MSBuild projects) based on the type of files inside.\n  // modules that have only MAIN files\n  private int onlyMain = 0;\n  // modules that have only TEST files\n  private int onlyTest = 0;\n  // modules that have both MAIN and TEST files\n  private int mixed = 0;\n  // modules that have no files\n  private int noFiles = 0;\n\n  public void addProjectInfo(boolean hasMainFiles, boolean hasTestFiles) {\n    if (hasMainFiles && hasTestFiles) {\n      mixed++;\n    } else if (hasMainFiles) {\n      onlyMain++;\n    } else if (hasTestFiles) {\n      onlyTest++;\n    } else {\n      noFiles++;\n    }\n  }\n\n  public boolean hasProjects() {\n    return countProjects() > 0;\n  }\n\n  public Optional<String> getSummary(String languageName) {\n    int projectsCount = countProjects();\n    if (projectsCount == 0) {\n      return Optional.empty();\n    }\n    StringBuilder stringBuilder = new StringBuilder(String.format(\"Found %d MSBuild %s %s:\", projectsCount, languageName, pluralize(PROJECT, projectsCount)));\n    if (onlyMain > 0) {\n      stringBuilder.append(String.format(\" %d MAIN %s.\", onlyMain, pluralize(PROJECT, onlyMain)));\n    }\n    if (onlyTest > 0) {\n      stringBuilder.append(String.format(\" %d TEST %s.\", onlyTest, pluralize(PROJECT, onlyTest)));\n    }\n    if (mixed > 0) {\n      stringBuilder.append(String.format(\" %d with both MAIN and TEST files.\", mixed));\n    }\n    if (noFiles > 0) {\n      stringBuilder.append(String.format(\" %d with no MAIN nor TEST files.\", noFiles));\n    }\n\n    return Optional.of(stringBuilder.toString());\n  }\n\n  private int countProjects() {\n    return onlyMain + onlyTest + mixed + noFiles;\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/ProtobufDataImporter.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport java.io.IOException;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.util.List;\nimport java.util.Locale;\nimport java.util.function.UnaryOperator;\nimport java.util.stream.Stream;\nimport org.sonar.api.batch.sensor.SensorContext;\nimport org.sonar.api.issue.NoSonarFilter;\nimport org.sonar.api.measures.FileLinesContextFactory;\nimport org.sonar.api.scanner.ScannerSide;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonarsource.dotnet.protobuf.SonarAnalyzer.CopyPasteTokenInfo;\nimport org.sonarsource.dotnet.protobuf.SonarAnalyzer.MetricsInfo;\nimport org.sonarsource.dotnet.protobuf.SonarAnalyzer.SymbolReferenceInfo;\nimport org.sonarsource.dotnet.protobuf.SonarAnalyzer.TokenTypeInfo;\nimport org.sonarsource.dotnet.shared.StringUtils;\nimport org.sonarsource.dotnet.shared.plugins.protobuf.CPDTokensImporter;\nimport org.sonarsource.dotnet.shared.plugins.protobuf.HighlightImporter;\nimport org.sonarsource.dotnet.shared.plugins.protobuf.MetricsImporter;\nimport org.sonarsource.dotnet.shared.plugins.protobuf.RawProtobufImporter;\nimport org.sonarsource.dotnet.shared.plugins.protobuf.SymbolRefsImporter;\n\nimport static org.sonarsource.dotnet.shared.CallableUtils.lazy;\n\n@ScannerSide\npublic class ProtobufDataImporter {\n  public static final String CPDTOKENS_FILENAME = \"token-cpd.pb\";\n  public static final String FILEMETADATA_FILENAME = \"file-metadata.pb\";\n  public static final String HIGHLIGHT_FILENAME = \"token-type.pb\";\n  public static final String LOG_FILENAME = \"log.pb\";\n  public static final String TELEMETRY_FILENAME = \"telemetry.pb\";\n  public static final String METHODDECLARATIONS_FILENAME = \"test-method-declarations.pb\";\n  public static final String METRICS_FILENAME = \"metrics.pb\";\n  public static final String SYMBOLREFS_FILENAME = \"symrefs.pb\";\n\n  private static final Logger LOG = LoggerFactory.getLogger(ProtobufDataImporter.class);\n\n  private final FileLinesContextFactory fileLinesContextFactory;\n  private final NoSonarFilter noSonarFilter;\n\n  public ProtobufDataImporter(FileLinesContextFactory fileLinesContextFactory, NoSonarFilter noSonarFilter) {\n    this.fileLinesContextFactory = fileLinesContextFactory;\n    this.noSonarFilter = noSonarFilter;\n  }\n\n  public void importResults(SensorContext context, List<Path> protobufReportsDirectories, UnaryOperator<String> toRealPath) {\n    RawProtobufImporter<MetricsInfo> metricsImporter = new MetricsImporter(context, fileLinesContextFactory, noSonarFilter, toRealPath);\n    RawProtobufImporter<TokenTypeInfo> highlightImporter = new HighlightImporter(context, toRealPath);\n    RawProtobufImporter<SymbolReferenceInfo> symbolRefsImporter = new SymbolRefsImporter(context, toRealPath);\n    RawProtobufImporter<CopyPasteTokenInfo> cpdTokensImporter = new CPDTokensImporter(context, toRealPath);\n\n    for (Path protobufReportsDir : protobufReportsDirectories) {\n      long protoFiles = countProtoFiles(protobufReportsDir);\n      LOG.info(\"Importing results from {} proto {} in '{}'\",\n        protoFiles,\n        lazy(() -> StringUtils.pluralize(\"file\", protoFiles)),\n        protobufReportsDir);\n      // Note: the no-sonar \"measure\" must be imported before issues, otherwise the affected issues won't get excluded!\n      parseProtobuf(metricsImporter, protobufReportsDir, METRICS_FILENAME);\n      parseProtobuf(highlightImporter, protobufReportsDir, HIGHLIGHT_FILENAME);\n      parseProtobuf(symbolRefsImporter, protobufReportsDir, SYMBOLREFS_FILENAME);\n      parseProtobuf(cpdTokensImporter, protobufReportsDir, CPDTOKENS_FILENAME);\n    }\n\n    metricsImporter.save();\n    highlightImporter.save();\n    symbolRefsImporter.save();\n    cpdTokensImporter.save();\n  }\n\n  private static long countProtoFiles(Path dir) {\n    try (Stream<Path> stream = Files.list(dir)) {\n      return stream\n        .filter(p -> p.getFileName().toString().toLowerCase(Locale.ENGLISH).endsWith(\".pb\"))\n        .count();\n    } catch (IOException e) {\n      throw new IllegalStateException(\"unexpected error while reading files in: \" + dir, e);\n    }\n  }\n\n  public static void parseProtobuf(RawProtobufImporter<?> importer, Path workDirectory, String filename) {\n    Path protobuf = workDirectory.resolve(filename);\n    if (protobuf.toFile().exists()) {\n      importer.accept(protobuf);\n    } else {\n      LOG.warn(\"Protobuf file not found: {}\", protobuf);\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/RealPathProvider.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport java.util.function.UnaryOperator;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonar.api.scanner.ScannerSide;\nimport org.sonarsource.api.sonarlint.SonarLintSide;\n\nimport java.io.IOException;\nimport java.nio.file.Paths;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * This class is designed to provide some caching around the transformation from a path to the real path on the system.\n * We are doing some caching because the toRealPath operation can be expensive, and we know that Roslyn paths will always use the same pattern so we expect a lot of read\n */\n@ScannerSide\n@SonarLintSide\npublic class RealPathProvider implements UnaryOperator<String> {\n  private static final Logger LOG = LoggerFactory.getLogger(RealPathProvider.class);\n  private final Map<String, String> cachedPaths = new HashMap<>();\n\n  @Override\n  public String apply(String path) {\n    return cachedPaths.computeIfAbsent(path, this::getRealPath);\n  }\n\n  public String getRealPath(String path) {\n    try {\n      return Paths.get(path).toRealPath().toString();\n    } catch (IOException e) {\n      LOG.debug(\"Failed to retrieve the real full path for '{}'\", path);\n      return path;\n    }\n  }\n}\n\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/ReportPathCollector.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport java.nio.file.Path;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\nimport org.sonar.api.scanner.ScannerSide;\n\n@ScannerSide\npublic class ReportPathCollector {\n  private final List<Path> protobufDirs = new ArrayList<>();\n  private final List<RoslynReport> roslynReports = new ArrayList<>();\n\n  public void addProtobufDirs(List<Path> paths) {\n    protobufDirs.addAll(paths);\n  }\n\n  public List<Path> protobufDirs() {\n    return Collections.unmodifiableList(new ArrayList<>(protobufDirs));\n  }\n\n  public void addRoslynReport(List<RoslynReport> reports) {\n    roslynReports.addAll(reports);\n  }\n\n  public List<RoslynReport> roslynReports() {\n    return Collections.unmodifiableList(new ArrayList<>(roslynReports));\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/RoslynDataImporter.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.function.UnaryOperator;\nimport org.sonar.api.batch.rule.ActiveRule;\nimport org.sonar.api.batch.rule.ActiveRules;\nimport org.sonar.api.batch.sensor.SensorContext;\nimport org.sonar.api.scanner.ScannerSide;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonarsource.dotnet.shared.StringUtils;\nimport org.sonarsource.dotnet.shared.sarif.SarifParserCallback;\nimport org.sonarsource.dotnet.shared.sarif.SarifParserFactory;\n\nimport static org.sonarsource.dotnet.shared.CallableUtils.lazy;\n\n@ScannerSide\npublic class RoslynDataImporter {\n  private static final Logger LOG = LoggerFactory.getLogger(RoslynDataImporter.class);\n  private static final String ROSLYN_REPOSITORY_PREFIX = \"roslyn.\";\n  private final AbstractLanguageConfiguration config;\n  private final PluginMetadata metadata;\n\n  public RoslynDataImporter(PluginMetadata metadata, AbstractLanguageConfiguration config) {\n    this.metadata = metadata;\n    this.config = config;\n  }\n\n  public void importRoslynReports(List<RoslynReport> reports,  final SensorContext context,\n    UnaryOperator<String> toRealPath) {\n    Map<String, String> repositoryKeyByRoslynRuleKey = repoKeyByRoslynRuleKey(context.activeRules());\n    boolean ignoreThirdPartyIssues = config.ignoreThirdPartyIssues();\n    SarifParserCallback callback = new SarifParserCallbackImpl(context, repositoryKeyByRoslynRuleKey, ignoreThirdPartyIssues, config.bugCategories(),\n      config.codeSmellCategories(), config.vulnerabilityCategories());\n\n    LOG.info(\"Importing {} Roslyn {}\", reports.size(), lazy(() -> StringUtils.pluralize(\"report\", reports.size())));\n\n    for (RoslynReport report : reports) {\n      LOG.debug(\"Processing Roslyn report: {}\", report.getReportPath());\n      SarifParserFactory.create(report, toRealPath).accept(callback);\n    }\n  }\n\n  private Map<String, String> repoKeyByRoslynRuleKey(ActiveRules activeRules){\n    Map<String, String> repositoryKeyByRoslynRuleKey = new HashMap<>();\n    for (ActiveRule activeRule : activeRules.findAll()) {\n      if (activeRule.ruleKey().repository().startsWith(ROSLYN_REPOSITORY_PREFIX) || metadata.repositoryKey().equals(activeRule.ruleKey().repository())) {\n        String previousRepositoryKey = repositoryKeyByRoslynRuleKey.put(activeRule.ruleKey().rule(), activeRule.ruleKey().repository());\n        if (previousRepositoryKey != null) {\n          throw new IllegalArgumentException(\"Rule keys must be unique, but \\\"\" + activeRule.ruleKey().rule() +\n            \"\\\" is defined in both the \\\"\" + previousRepositoryKey + \"\\\" and \\\"\" + activeRule.ruleKey().repository() +\n            \"\\\" rule repositories.\");\n        }\n      }\n    }\n    return repositoryKeyByRoslynRuleKey;\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/RoslynReport.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport java.nio.file.Path;\nimport java.util.Objects;\nimport org.sonar.api.scanner.fs.InputProject;\n\npublic class RoslynReport {\n\n  private final InputProject project;\n  private final Path reportPath;\n\n  public RoslynReport(InputProject project, Path reportPath) {\n    this.project = project;\n    this.reportPath = reportPath;\n  }\n\n  public InputProject getProject() {\n    return project;\n  }\n\n  public Path getReportPath() {\n    return reportPath;\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) {\n      return true;\n    }\n    if (o == null || getClass() != o.getClass()) {\n      return false;\n    }\n    RoslynReport that = (RoslynReport) o;\n    return Objects.equals(project, that.project) &&\n      Objects.equals(reportPath, that.reportPath);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(project, reportPath);\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/RoslynRules.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport com.google.gson.Gson;\nimport com.google.gson.reflect.TypeToken;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.lang.reflect.Type;\nimport java.nio.charset.StandardCharsets;\nimport java.util.List;\nimport org.sonar.api.server.ServerSide;\nimport org.sonarsource.api.sonarlint.SonarLintSide;\n\n@ServerSide\n@SonarLintSide\npublic class RoslynRules {\n  private static final Gson GSON = new Gson();\n\n  private final PluginMetadata metadata;\n  private List<Rule> rules;\n\n  public RoslynRules(PluginMetadata metadata) {\n    this.metadata = metadata;\n  }\n\n  public List<Rule> rules() {\n    if (rules == null) {\n      Type ruleListType = new TypeToken<List<Rule>>() {\n      }.getType();\n      rules = GSON.fromJson(readResource(\"Rules.json\"), ruleListType);\n    }\n    return rules;\n  }\n\n  private String readResource(String name) {\n    InputStream stream = getResourceAsStream(metadata.resourcesDirectory() + \"/\" + name);\n    if (stream == null) {\n      throw new IllegalStateException(\"Resource does not exist: \" + name);\n    }\n    try {\n      return new String(stream.readAllBytes(), StandardCharsets.UTF_8);\n    } catch (IOException e) {\n      throw new IllegalStateException(\"Failed to read: \" + name, e);\n    }\n  }\n\n  // Extracted for testing\n  InputStream getResourceAsStream(String name) {\n    return getClass().getResourceAsStream(name);\n  }\n\n  public static final class Rule {\n    String id;\n    RuleParameter[] parameters;\n\n    public String getId() {\n      return id;\n    }\n  }\n\n  public static final class RuleParameter {\n    String key;\n    String description;\n    String type;\n    String defaultValue;\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/SarifParserCallbackImpl.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.Collection;\nimport java.util.Collections;\nimport java.util.HashMap;\nimport java.util.HashSet;\nimport java.util.List;\nimport java.util.Locale;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.Optional;\nimport java.util.Set;\nimport java.util.function.Consumer;\nimport java.util.function.Supplier;\nimport java.util.stream.Collectors;\nimport javax.annotation.Nullable;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonar.api.SonarEdition;\nimport org.sonar.api.batch.fs.InputFile;\nimport org.sonar.api.batch.rule.Severity;\nimport org.sonar.api.batch.sensor.SensorContext;\nimport org.sonar.api.batch.sensor.issue.NewExternalIssue;\nimport org.sonar.api.batch.sensor.issue.NewIssue;\nimport org.sonar.api.batch.sensor.issue.NewIssueLocation;\nimport org.sonar.api.issue.impact.SoftwareQuality;\nimport org.sonar.api.rule.RuleKey;\nimport org.sonar.api.rules.RuleType;\nimport org.sonar.api.scanner.fs.InputProject;\nimport org.sonarsource.dotnet.shared.sarif.Location;\nimport org.sonarsource.dotnet.shared.sarif.SarifParserCallback;\n\n/**\n * This class is responsible to report to SonarQube each issue found in the Roslyn reports.\n */\npublic class SarifParserCallbackImpl implements SarifParserCallback {\n\n  private static final Logger LOG = LoggerFactory.getLogger(SarifParserCallbackImpl.class);\n\n  private static final String EXTERNAL_ENGINE_ID = \"roslyn\";\n  private static final List<String> OWN_REPOSITORIES = Arrays.asList(\"csharpsquid\", \"vbnet\");\n  private final SensorContext context;\n  private final Map<String, String> repositoryKeyByRoslynRuleKey;\n  private final Set<Issue> savedIssues = new HashSet<>();\n  private final Set<ProjectIssue> projectIssues = new HashSet<>();\n  private final boolean ignoreThirdPartyIssues;\n  private final Set<String> bugCategories;\n  private final Set<String> codeSmellCategories;\n  private final Set<String> vulnerabilityCategories;\n  private final Map<String, String> defaultLevelByRuleId = new HashMap<>();\n  private final Map<String, RuleType> ruleTypeByRuleId = new HashMap<>();\n\n  public SarifParserCallbackImpl(SensorContext context, Map<String, String> repositoryKeyByRoslynRuleKey, boolean ignoreThirdPartyIssues, Set<String> bugCategories,\n    Set<String> codeSmellCategories, Set<String> vulnerabilityCategories) {\n    this.context = context;\n    this.repositoryKeyByRoslynRuleKey = repositoryKeyByRoslynRuleKey;\n    this.ignoreThirdPartyIssues = ignoreThirdPartyIssues;\n    this.bugCategories = bugCategories;\n    this.codeSmellCategories = codeSmellCategories;\n    this.vulnerabilityCategories = vulnerabilityCategories;\n  }\n\n  @Override\n  public void onProjectIssue(String ruleId, @Nullable String level, InputProject inputProject, String message) {\n    // Remove duplicate issues.\n    // We do not have enough information (other than the message) to distinguish between different dotnet projects.\n    // Due to this, project level issues should always mention the assembly in their message (see: S3990, S3992, or S3904)\n    if (!projectIssues.add(new ProjectIssue(ruleId, message))) {\n      return;\n    }\n\n    String repositoryKey = repositoryKeyByRoslynRuleKey.get(ruleId);\n    if (repositoryKey != null) {\n      createProjectLevelIssue(ruleId, inputProject, message, repositoryKey);\n    }\n  }\n\n  private void createProjectLevelIssue(String ruleId, InputProject inputProject, String message, String repositoryKey) {\n    logIssue(\"project level\", ruleId, inputProject.toString());\n    NewIssue newIssue = context.newIssue();\n    newIssue\n      .forRule(RuleKey.of(repositoryKey, ruleId))\n      .at(newIssue.newLocation()\n        .on(inputProject)\n        .message(message))\n      .save();\n  }\n\n  @Override\n  public void onFileIssue(String ruleId, @Nullable String level, String absolutePath, Collection<Location> secondaryLocations, String message) {\n    // De-duplicate issues\n    Issue issue = new Issue(ruleId, absolutePath);\n    if (!savedIssues.add(issue)) {\n      return;\n    }\n\n    InputFile inputFile = context.fileSystem().inputFile(context.fileSystem().predicates()\n      .hasAbsolutePath(absolutePath));\n    if (inputFile == null) {\n      logMissingInputFile(ruleId, absolutePath);\n      return;\n    }\n\n    String repositoryKey = repositoryKeyByRoslynRuleKey.get(ruleId);\n    if (repositoryKey != null) {\n      createFileLevelIssue(ruleId, message, repositoryKey, inputFile, secondaryLocations);\n    } else if (shouldCreateExternalIssue(ruleId)) {\n      createFileLevelExternalIssue(ruleId, level, message, inputFile, secondaryLocations);\n    }\n  }\n\n  private void createFileLevelIssue(String ruleId, String message, String repositoryKey, InputFile inputFile, Collection<Location> secondaryLocations) {\n    logIssue(\"file level\", ruleId, inputFile.toString());\n    NewIssue newIssue = context.newIssue();\n    newIssue\n      .forRule(RuleKey.of(repositoryKey, ruleId))\n      .at(newIssue.newLocation()\n        .on(inputFile)\n        .message(message));\n    populateSecondaryLocations(secondaryLocations, newIssue::newLocation, newIssue::addLocation, isSonarSourceRepository(repositoryKey));\n    newIssue.save();\n  }\n\n  private void createFileLevelExternalIssue(String ruleId, @Nullable String level, String message, InputFile inputFile, Collection<Location> secondaryLocations) {\n    logIssue(\"file level external\", ruleId, inputFile.toString());\n    NewExternalIssue newIssue = newExternalIssue(ruleId);\n    newIssue.at(newIssue.newLocation()\n      .on(inputFile)\n      .message(message));\n    setExternalIssueSeverityAndType(ruleId, level, newIssue);\n    populateSecondaryLocations(secondaryLocations, newIssue::newLocation, newIssue::addLocation, true);\n    newIssue.save();\n  }\n\n  @Override\n  public void onIssue(String ruleId, @Nullable String level, Location primaryLocation, Collection<Location> secondaryLocations, boolean withExecutionFlow) {\n    // De-duplicate issues\n    Issue issue = new Issue(ruleId, primaryLocation);\n    if (!savedIssues.add(issue)) {\n      return;\n    }\n\n    InputFile inputFile = context.fileSystem().inputFile(context.fileSystem().predicates()\n      .hasAbsolutePath(primaryLocation.getAbsolutePath()));\n    if (inputFile == null) {\n      logMissingInputFile(ruleId, primaryLocation.getAbsolutePath());\n      return;\n    }\n\n    String repositoryKey = repositoryKeyByRoslynRuleKey.get(ruleId);\n    if (repositoryKey != null) {\n      createIssue(inputFile, ruleId, primaryLocation, secondaryLocations, repositoryKey, withExecutionFlow);\n    } else if (shouldCreateExternalIssue(ruleId)) {\n      createExternalIssue(inputFile, ruleId, level, primaryLocation, secondaryLocations);\n    }\n  }\n\n  private void createExternalIssue(InputFile inputFile, String ruleId, @Nullable String level, Location primaryLocation, Collection<Location> secondaryLocations) {\n    logIssue(\"external\", ruleId, primaryLocation.getAbsolutePath());\n    NewExternalIssue newIssue = newExternalIssue(ruleId);\n    newIssue.at(createIssueLocation(inputFile, primaryLocation, newIssue::newLocation, true));\n    setExternalIssueSeverityAndType(ruleId, level, newIssue);\n    populateSecondaryLocations(secondaryLocations, newIssue::newLocation, newIssue::addLocation, true);\n    newIssue.save();\n  }\n\n  private void setExternalIssueSeverityAndType(String ruleId, @Nullable String level, NewExternalIssue newIssue) {\n    Severity severity;\n    if (level != null) {\n      severity = mapSeverity(level);\n    } else if (defaultLevelByRuleId.containsKey(ruleId)) {\n      severity = mapSeverity(defaultLevelByRuleId.get(ruleId));\n    } else {\n      LOG.warn(\"Rule {} was not found in the SARIF report, assuming default severity\", ruleId);\n      severity = Severity.MAJOR;\n    }\n    var ruleType = Optional.ofNullable(ruleTypeByRuleId.get(ruleId)).orElse(RuleType.CODE_SMELL);\n    newIssue.severity(severity);\n    if (context.runtime().getEdition() != SonarEdition.SONARCLOUD) {\n      newIssue.addImpact(mapSoftwareQuality(ruleType), mapImpactSeverity(severity));\n    }\n    newIssue.type(ruleType);\n  }\n\n  private NewExternalIssue newExternalIssue(String ruleId) {\n    NewExternalIssue newIssue = context.newExternalIssue();\n    newIssue\n      .engineId(EXTERNAL_ENGINE_ID)\n      .ruleId(ruleId);\n    return newIssue;\n  }\n\n  private void createIssue(InputFile inputFile, String ruleId, Location primaryLocation, Collection<Location> secondaryLocations, String repositoryKey, boolean withExecutionFlow) {\n    boolean isSonarSourceRepository = isSonarSourceRepository(repositoryKey);\n    logIssue(\"normal\", ruleId, primaryLocation.getAbsolutePath());\n    NewIssue newIssue = context.newIssue();\n    newIssue\n      .forRule(RuleKey.of(repositoryKey, ruleId))\n      .at(createIssueLocation(inputFile, primaryLocation, newIssue::newLocation, !isSonarSourceRepository));\n    if (withExecutionFlow) {\n      populateExecutionFlow(secondaryLocations, newIssue, !isSonarSourceRepository);\n    } else {\n      populateSecondaryLocations(secondaryLocations, newIssue::newLocation, newIssue::addLocation, !isSonarSourceRepository);\n    }\n    newIssue.save();\n  }\n\n  private void populateExecutionFlow(Collection<Location> locations, NewIssue newIssue, boolean isLocationResilient) {\n    List<NewIssueLocation> newIssueLocations = locations.stream()\n      .map(x -> {\n        InputFile file = context.fileSystem().inputFile(context.fileSystem().predicates().hasAbsolutePath(x.getAbsolutePath()));\n        if (file != null) {\n          return createIssueLocation(file, x, newIssue::newLocation, isLocationResilient);\n        } else {\n          return null;\n        }\n      })\n      .filter(Objects::nonNull)\n      .collect(Collectors.toCollection(ArrayList::new));\n    if (!newIssueLocations.isEmpty()) {\n      Collections.reverse(newIssueLocations);\n      newIssue.addFlow(newIssueLocations, NewIssue.FlowType.EXECUTION, \"Execution Flow\");\n    }\n  }\n\n  private void populateSecondaryLocations(Collection<Location> secondaryLocations, Supplier<NewIssueLocation> newIssueLocationSupplier,\n    Consumer<NewIssueLocation> newIssueLocationConsumer, boolean isLocationResilient) {\n    for (Location secondaryLocation : secondaryLocations) {\n      InputFile inputFile = context.fileSystem().inputFile(context.fileSystem().predicates()\n        .hasAbsolutePath(secondaryLocation.getAbsolutePath()));\n      if (inputFile == null) {\n        continue;\n      }\n\n      NewIssueLocation newIssueLocation = createIssueLocation(inputFile, secondaryLocation, newIssueLocationSupplier, isLocationResilient);\n      newIssueLocationConsumer.accept(newIssueLocation);\n    }\n  }\n\n  private static NewIssueLocation createIssueLocation(InputFile inputFile, Location location, Supplier<NewIssueLocation> newIssueLocationSupplier,\n    boolean isLocationResilient) {\n\n    NewIssueLocation newIssueLocation = newIssueLocationSupplier.get().on(inputFile);\n\n    try {\n      // First, we try to report the issue with the precise location...\n      newIssueLocation = newIssueLocation.at(inputFile.newRange(location.getStartLine(), location.getStartColumn(),\n        location.getEndLine(), location.getEndColumn()));\n\n    } catch (IllegalArgumentException ex1) {\n      LOG.debug(\"Precise issue location cannot be found! Location: {}\", location);\n\n      if (!isLocationResilient && !isLocationInsideRazorFile(location)) {\n        // Our rules should fail if they report on an invalid location except for .razor and .cshtml files where we expect invalid locations due to issues on razor/roslyn side\n        throw ex1;\n      }\n\n      try {\n        // Precise location failed, now try the line...\n        newIssueLocation = newIssueLocation.at(inputFile.selectLine(location.getStartLine()));\n      } catch (IllegalArgumentException ex2) {\n        // Line location failed so let's report at file level (we are sure the file exists).\n        // As the file was already registered previously, there is nothing to do here.\n\n        LOG.debug(\"Line issue location cannot be found! Location: {}\", location);\n      }\n    }\n\n    String message = location.getMessage();\n    if (message != null) {\n      newIssueLocation.message(message);\n    }\n\n    return newIssueLocation;\n  }\n\n  @Override\n  public void onRule(String ruleId, @Nullable String shortDescription, @Nullable String fullDescription, String defaultLevel, @Nullable String category) {\n    if (repositoryKeyByRoslynRuleKey.containsKey(ruleId) || !shouldCreateExternalIssue(ruleId)) {\n      // This is not an external rule\n      return;\n    }\n    defaultLevelByRuleId.put(ruleId, defaultLevel);\n    RuleType ruleType = mapRuleType(category, defaultLevel);\n    ruleTypeByRuleId.put(ruleId, ruleType);\n    context.newAdHocRule()\n      .engineId(EXTERNAL_ENGINE_ID)\n      .ruleId(ruleId)\n      .severity(mapSeverity(defaultLevel))\n      .name(shortDescription != null ? shortDescription : ruleId)\n      .description(fullDescription)\n      .type(ruleType)\n      .save();\n  }\n\n  // Severity mapping as defined in ImpactMapper::convertToRuleSeverity\n  // https://github.com/SonarSource/sonar-plugin-api/blob/44df6a8f35ba3001053799dff2a4c1cbbad37911/plugin-api/src/main/java/org/sonar/api/server/rule/internal/ImpactMapper.java\n  public /* for testing */ static org.sonar.api.issue.impact.Severity mapImpactSeverity(Severity severity) {\n    return switch (severity) {\n      case BLOCKER -> org.sonar.api.issue.impact.Severity.BLOCKER;\n      case CRITICAL -> org.sonar.api.issue.impact.Severity.HIGH;\n      case MAJOR -> org.sonar.api.issue.impact.Severity.MEDIUM;\n      case MINOR -> org.sonar.api.issue.impact.Severity.LOW;\n      case INFO -> org.sonar.api.issue.impact.Severity.INFO;\n      default -> throw new IllegalStateException(\"This severity value \" + severity + \" is illegal.\");\n    };\n  }\n\n  // SoftwareQuality mapping as defined in ImpactMapper::convertToSoftwareQuality\n  // https://github.com/SonarSource/sonar-plugin-api/blob/44df6a8f35ba3001053799dff2a4c1cbbad37911/plugin-api/src/main/java/org/sonar/api/server/rule/internal/ImpactMapper.java\n  public /* for testing */ static SoftwareQuality mapSoftwareQuality(RuleType type) {\n    return switch (type) {\n      case CODE_SMELL -> SoftwareQuality.MAINTAINABILITY;\n      case BUG -> SoftwareQuality.RELIABILITY;\n      case VULNERABILITY -> SoftwareQuality.SECURITY;\n      case SECURITY_HOTSPOT -> throw new IllegalStateException(\"Can not map Security Hotspot to Software Quality\");\n      default -> throw new IllegalStateException(\"Unknown rule type\");\n    };\n  }\n\n  private boolean shouldCreateExternalIssue(String ruleId) {\n    return !ignoreThirdPartyIssues && !ruleId.matches(\"^S\\\\d{3,4}$\");\n  }\n\n  private RuleType mapRuleType(@Nullable String category, String defaultLevel) {\n    if (category != null) {\n      if (bugCategories.contains(category)) {\n        return RuleType.BUG;\n      }\n      if (codeSmellCategories.contains(category)) {\n        return RuleType.CODE_SMELL;\n      }\n      if (vulnerabilityCategories.contains(category)) {\n        return RuleType.VULNERABILITY;\n      }\n    }\n    return \"Error\".equalsIgnoreCase(defaultLevel) ? RuleType.BUG : RuleType.CODE_SMELL;\n  }\n\n  // these are the available severities from Roslyn that need mapping\n  private static Severity mapSeverity(String defaultLevel) {\n    return switch (defaultLevel.toLowerCase(Locale.ENGLISH)) {\n      case \"error\" -> Severity.CRITICAL;\n      case \"warning\" -> Severity.MAJOR;\n      default -> Severity.INFO;\n    };\n  }\n\n  private static boolean isSonarSourceRepository(String repositoryKey) {\n    return OWN_REPOSITORIES.contains(repositoryKey);\n  }\n\n  private static boolean isLocationInsideRazorFile(Location location) {\n    String absolutePath = location.getAbsolutePath();\n\n    return absolutePath.endsWith(\".razor\")\n      || absolutePath.endsWith(\".cshtml\");\n  }\n\n  private void logIssue(String issueType, String ruleId, String location) {\n    LOG.debug(\"Adding {} issue {}: {}\", issueType, ruleId, location);\n  }\n\n  private void logMissingInputFile(String ruleId, String filePath) {\n    LOG.debug(\"Skipping issue {}, input file not found or excluded: {}\", ruleId, filePath);\n  }\n\n  private record ProjectIssue(String ruleId, String message) {\n  }\n\n  private record Issue(String ruleId, String absolutePath, int startLine, int startColumn, int endLine, int endColumn) {\n    Issue(String ruleId, String path) {\n      this(ruleId, path, 0, 0, 0, 0);\n    }\n\n    Issue(String ruleId, Location location) {\n      this(ruleId,\n        location.getAbsolutePath(),\n        location.getStartLine(),\n        location.getStartColumn(),\n        location.getEndLine(),\n        location.getEndColumn());\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/SensorContextUtils.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport javax.annotation.CheckForNull;\nimport org.sonar.api.batch.fs.FilePredicates;\nimport org.sonar.api.batch.fs.FileSystem;\nimport org.sonar.api.batch.fs.InputFile;\nimport org.sonar.api.batch.fs.TextRange;\nimport org.sonarsource.dotnet.protobuf.SonarAnalyzer;\n\nimport java.util.Optional;\n\nimport static org.sonar.api.batch.fs.InputFile.Type;\n\npublic final class SensorContextUtils {\n  private SensorContextUtils() {\n    // utility class, forbidden constructor\n  }\n\n  @CheckForNull\n  public static InputFile toInputFile(FileSystem fs, String file) {\n    return fs.inputFile(fs.predicates().hasPath(file));\n  }\n\n  public static boolean hasFilesOfType(FileSystem fs, Type fileType, String languageKey) {\n    FilePredicates p = fs.predicates();\n    return fs.inputFiles(p.and(p.hasType(fileType), p.hasLanguage(languageKey))).iterator().hasNext();\n  }\n\n  public static boolean hasFilesOfLanguage(FileSystem fs, String languageKey) {\n    FilePredicates p = fs.predicates();\n    return fs.inputFiles(p.hasLanguage(languageKey)).iterator().hasNext();\n  }\n\n  public static boolean hasAnyMainFiles(FileSystem fs) {\n    return fs.inputFiles(fs.predicates().hasType(Type.MAIN)).iterator().hasNext();\n  }\n\n  public static Optional<TextRange> toTextRange(InputFile inputFile, SonarAnalyzer.TextRange pbTextRange) {\n    // We accept data out of range due to the mapping issues on Roslyn side.\n    // The strategy is to throw if the start offset is outside the line; otherwise, if only the end line is out of the range,\n    // trim to the end of the line.\n    // The range is discarded if trimming of the end has made it empty.\n    // The wrong locations are caused by the following issues:\n    // https://github.com/dotnet/roslyn/issues/69248\n    // https://github.com/dotnet/razor/issues/9051\n    // https://github.com/dotnet/razor/issues/9050\n    int startLine = pbTextRange.getStartLine();\n    int startLineOffset = pbTextRange.getStartOffset();\n    int startLineLength = inputFile.selectLine(startLine).end().lineOffset();\n    if (startLineOffset > startLineLength) {\n      startLine++;\n      startLineOffset = 0;\n    }\n\n    int endLine = pbTextRange.getEndLine();\n    int endLineLength = inputFile.selectLine(endLine).end().lineOffset();\n    int endLineOffset = pbTextRange.getEndOffset();\n    if (endLineOffset > endLineLength) {\n      endLineOffset = endLineLength;\n    }\n\n    return startLine < endLine || (startLine == endLine && startLineOffset < endLineOffset)\n      ? Optional.of(inputFile.newRange(startLine, startLineOffset, endLine, endLineOffset))\n      : Optional.empty();\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/TelemetryCollector.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport java.util.ArrayList;\nimport java.util.Collection;\nimport org.sonar.api.scanner.ScannerSide;\nimport org.sonarsource.dotnet.protobuf.SonarAnalyzer;\n\n/**\n * A simple project wide data collector (created before all module sensors),\n * that allows TelemetrySensors to add telemetry messages.\n * It is injected to each TelemetrySensor (for appending messages) and to the project\n * wide TelemetryProcessor (for reading all messages, executed after all module sensors).\n */\n@ScannerSide\npublic class TelemetryCollector {\n  private final ArrayList<SonarAnalyzer.Telemetry> telemetryMessages;\n\n  public TelemetryCollector() {\n    this.telemetryMessages = new ArrayList<>();\n  }\n\n  public void addTelemetry(SonarAnalyzer.Telemetry telemetry) {\n    this.telemetryMessages.add(telemetry);\n  }\n\n  public Collection<SonarAnalyzer.Telemetry> getTelemetryMessages() {\n    return telemetryMessages;\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/UnitTestResultsProvider.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport java.util.Arrays;\nimport java.util.List;\nimport org.sonar.api.config.Configuration;\nimport org.sonar.api.config.PropertyDefinition;\nimport org.sonar.api.scanner.ScannerSide;\nimport org.sonar.plugins.dotnet.tests.UnitTestConfiguration;\nimport org.sonar.plugins.dotnet.tests.UnitTestResultsAggregator;\nimport org.sonar.plugins.dotnet.tests.UnitTestResultsImportSensor;\n\nimport static org.sonar.api.config.PropertyDefinition.ConfigScope;\n\n@ScannerSide\npublic class UnitTestResultsProvider {\n\n  private static final String SUBCATEGORY = \"Unit Tests\";\n\n  private final PluginMetadata pluginMetadata;\n  private final UnitTestConfiguration unitTestConfiguration;\n\n  public UnitTestResultsProvider(PluginMetadata pluginMetadata) {\n    this.pluginMetadata = pluginMetadata;\n    this.unitTestConfiguration = new UnitTestConfiguration(propertyKey(\"vstest\"), propertyKey(\"nunit\"), propertyKey(\"xunit\"));\n  }\n\n  private String propertyKey(String testType) {\n    return \"sonar.\" + pluginMetadata.languageKey() + \".\" + testType + \".reportsPaths\";\n  }\n\n  public List<Object> extensions() {\n    String category = pluginMetadata.languageName();\n    return Arrays.asList(\n      this,\n      DotNetUnitTestResultsAggregator.class,\n      UnitTestResultsImportSensor.class,\n      PropertyDefinition.builder(unitTestConfiguration.visualStudioTestResultsFilePropertyKey())\n        .name(\"Visual Studio Test Reports Paths\")\n        .description(\"Example: \\\"report.trx\\\", \\\"report1.trx,report2.trx\\\" or \\\"C:/report.trx\\\"\")\n        .category(category)\n        .subCategory(SUBCATEGORY)\n        .onlyOnConfigScopes(List.of(ConfigScope.PROJECT))\n        .multiValues(true)\n        .build(),\n      PropertyDefinition.builder(unitTestConfiguration.nunitTestResultsFilePropertyKey())\n        .name(\"NUnit Test Reports Paths\")\n        .description(\"Example: \\\"TestResult.xml\\\", \\\"TestResult1.xml,TestResult2.xml\\\" or \\\"C:/TestResult.xml\\\"\")\n        .category(category)\n        .subCategory(SUBCATEGORY)\n        .onlyOnConfigScopes(List.of(ConfigScope.PROJECT))\n        .multiValues(true)\n        .build(),\n      PropertyDefinition.builder(unitTestConfiguration.xunitTestResultsFilePropertyKey())\n        .name(\"xUnit Test Reports Paths\")\n        .description(\"Example: \\\"TestResult.xml\\\", \\\"TestResult1.xml,TestResult2.xml\\\" or \\\"C:/TestResult.xml\\\"\")\n        .category(category)\n        .subCategory(SUBCATEGORY)\n        .onlyOnConfigScopes(List.of(ConfigScope.PROJECT))\n        .multiValues(true)\n        .build());\n  }\n\n  public class DotNetUnitTestResultsAggregator extends UnitTestResultsAggregator {\n\n    public DotNetUnitTestResultsAggregator(Configuration configuration) {\n      super(unitTestConfiguration, configuration);\n    }\n\n  }\n\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/filters/GeneratedFileFilter.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.filters;\n\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonar.api.batch.fs.InputFile;\nimport org.sonar.api.batch.fs.InputFileFilter;\nimport org.sonarsource.dotnet.shared.plugins.AbstractLanguageConfiguration;\nimport org.sonarsource.dotnet.shared.plugins.GlobalProtobufFileProcessor;\n\n/**\n * This class allows to filter files to process based on whether or not they are auto-generated.\n * This filter refuses (filters) all generated files.\n *\n * Note: the InputFileFilter, starting the scanner-api version 7.6, is evaluated at solution (scanner \"project\") level,\n * thus all its dependencies must be instantiated at solution level.\n */\npublic class GeneratedFileFilter implements InputFileFilter {\n  private static final Logger LOG = LoggerFactory.getLogger(GeneratedFileFilter.class);\n\n  private final GlobalProtobufFileProcessor globalReportProcessor;\n  private final boolean analyzeGeneratedCode;\n\n  public GeneratedFileFilter(GlobalProtobufFileProcessor globalReportProcessor, AbstractLanguageConfiguration configuration) {\n    this.globalReportProcessor = globalReportProcessor;\n    this.analyzeGeneratedCode = configuration.analyzeGeneratedCode();\n    if (analyzeGeneratedCode) {\n      LOG.debug(\"Will analyze generated code\");\n    } else {\n      LOG.debug(\"Will ignore generated code\");\n    }\n  }\n\n  @Override\n  public boolean accept(InputFile inputFile) {\n    if (analyzeGeneratedCode) {\n      return true;\n    }\n    boolean isGenerated = globalReportProcessor.isGenerated(inputFile);\n    if (isGenerated) {\n      LOG.debug(\"Skipping auto generated file: {}\", inputFile);\n    }\n    return !isGenerated;\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/filters/WrongEncodingFileFilter.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.filters;\n\nimport org.sonar.api.batch.fs.InputFile;\nimport org.sonar.api.batch.fs.InputFileFilter;\nimport org.sonarsource.dotnet.shared.plugins.EncodingPerFile;\n\n/**\n * This class allows to filter files to process based on whether or not the encoding detected by Roslyn and SonarQube match.\n * This filter refuses (filters) all files with a different encoding.\n */\npublic class WrongEncodingFileFilter implements InputFileFilter {\n\n  private final EncodingPerFile encodingPerFile;\n\n  public WrongEncodingFileFilter(EncodingPerFile encodingPerFile) {\n    this.encodingPerFile = encodingPerFile;\n  }\n\n  @Override\n  public boolean accept(InputFile inputFile) {\n    return encodingPerFile.encodingMatch(inputFile);\n  }\n\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/filters/package-info.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.filters;\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/package-info.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n@ParametersAreNonnullByDefault\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport javax.annotation.ParametersAreNonnullByDefault;\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/protobuf/CPDTokensImporter.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.protobuf;\n\nimport static org.sonarsource.dotnet.shared.plugins.SensorContextUtils.toTextRange;\n\nimport java.util.function.UnaryOperator;\n\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonar.api.batch.fs.InputFile;\nimport org.sonar.api.batch.sensor.SensorContext;\nimport org.sonar.api.batch.sensor.cpd.NewCpdTokens;\nimport org.sonarsource.dotnet.protobuf.SonarAnalyzer;\nimport org.sonarsource.dotnet.protobuf.SonarAnalyzer.CopyPasteTokenInfo;\n\n/**\n  This class is responsible for reading/importing the CPD tokens that were generated by the C#/VB.NET analyzer.\n */\npublic class CPDTokensImporter extends ProtobufImporter<SonarAnalyzer.CopyPasteTokenInfo> {\n\n  private static final Logger LOG = LoggerFactory.getLogger(CPDTokensImporter.class);\n\n  private final SensorContext context;\n\n  public CPDTokensImporter(SensorContext context, UnaryOperator<String> toRealPath) {\n    super(SonarAnalyzer.CopyPasteTokenInfo.parser(), context, SonarAnalyzer.CopyPasteTokenInfo::getFilePath, toRealPath);\n    this.context = context;\n  }\n\n  @Override\n  void consumeFor(InputFile inputFile, CopyPasteTokenInfo message) {\n    NewCpdTokens cpdTokens = context.newCpdTokens().onFile(inputFile);\n\n    for (SonarAnalyzer.CopyPasteTokenInfo.TokenInfo tokenInfo : message.getTokenInfoList()) {\n      toTextRange(inputFile, tokenInfo.getTextRange())\n        .ifPresentOrElse(\n          textRange -> cpdTokens.addToken(textRange, tokenInfo.getTokenValue()),\n          () -> LOG.debug(\"The reported token was out of the range. File {}, Range {}\", inputFile.filename(), tokenInfo.getTextRange()));\n    }\n    cpdTokens.save();\n  }\n\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/protobuf/FileMetadataImporter.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.protobuf;\n\nimport com.google.protobuf.Parser;\nimport java.net.URI;\nimport java.nio.charset.Charset;\nimport java.nio.file.Paths;\nimport java.util.Collections;\nimport java.util.HashMap;\nimport java.util.HashSet;\nimport java.util.Map;\nimport java.util.Set;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonarsource.dotnet.protobuf.SonarAnalyzer.FileMetadataInfo;\n\n/**\n  This class is responsible of reading/importing the result of the analyzer detection of whether a file is considered as auto-generated or not.\n */\npublic class FileMetadataImporter extends RawProtobufImporter<FileMetadataInfo> {\n\n  private static final Logger LOG = LoggerFactory.getLogger(FileMetadataImporter.class);\n\n  private final Map<URI, Charset> encodingPerUri = new HashMap<>();\n  private final Set<URI> generatedFileUris = new HashSet<>();\n\n  // For testing\n  FileMetadataImporter(Parser<FileMetadataInfo> parser) {\n    super(parser);\n  }\n\n  public FileMetadataImporter() {\n    this(FileMetadataInfo.parser());\n  }\n\n  @Override\n  void consume(FileMetadataInfo message) {\n    URI fileUri = Paths.get(message.getFilePath()).toUri();\n    if (message.getIsGenerated()) {\n      generatedFileUris.add(fileUri);\n    }\n    String roslynEncoding = message.getEncoding();\n    Charset charset = null;\n    if (!roslynEncoding.isEmpty()) {\n      try {\n        charset = Charset.forName(roslynEncoding);\n      } catch (Exception e) {\n        LOG.warn(String.format(\"Unrecognized encoding %s for file %s\", roslynEncoding, message.getFilePath()), e);\n      }\n    }\n    encodingPerUri.put(fileUri, charset);\n  }\n\n  public Map<URI, Charset> getEncodingPerUri() {\n    return Collections.unmodifiableMap(encodingPerUri);\n  }\n\n  public Set<URI> getGeneratedFileUris() {\n    return generatedFileUris;\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/protobuf/HighlightImporter.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.protobuf;\n\nimport static org.sonarsource.dotnet.shared.plugins.SensorContextUtils.toTextRange;\n\nimport java.util.ArrayList;\nimport java.util.function.UnaryOperator;\nimport javax.annotation.CheckForNull;\n\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonar.api.batch.fs.InputFile;\nimport org.sonar.api.batch.fs.TextRange;\nimport org.sonar.api.batch.sensor.SensorContext;\nimport org.sonar.api.batch.sensor.highlighting.NewHighlighting;\nimport org.sonar.api.batch.sensor.highlighting.TypeOfText;\nimport org.sonarsource.dotnet.protobuf.SonarAnalyzer;\nimport org.sonarsource.dotnet.protobuf.SonarAnalyzer.TokenTypeInfo;\n\nimport java.util.HashMap;\nimport java.util.HashSet;\nimport java.util.Map;\n\n/**\n * This class is responsible for reading/importing the highlight info that was processed by the C#/VB.NET analyzer.\n */\npublic class HighlightImporter extends ProtobufImporter<SonarAnalyzer.TokenTypeInfo> {\n\n  private static final Logger LOG = LoggerFactory.getLogger(HighlightImporter.class);\n  private final SensorContext context;\n  private final Map<InputFile, HashSet<TokenTypeInfo.TokenInfo>> fileHighlights = new HashMap<>();\n\n  public HighlightImporter(SensorContext context, UnaryOperator<String> toRealPath) {\n    super(SonarAnalyzer.TokenTypeInfo.parser(), context, SonarAnalyzer.TokenTypeInfo::getFilePath, toRealPath);\n    this.context = context;\n  }\n\n  @Override\n  void consumeFor(InputFile inputFile, TokenTypeInfo message) {\n    for (SonarAnalyzer.TokenTypeInfo.TokenInfo tokenInfo : message.getTokenInfoList()) {\n      fileHighlights\n        .computeIfAbsent(inputFile, f -> new HashSet<>())\n        .add(tokenInfo);\n    }\n  }\n\n  @Override\n  public void save() {\n    for (Map.Entry<InputFile, HashSet<SonarAnalyzer.TokenTypeInfo.TokenInfo>> entry : fileHighlights.entrySet()) {\n      NewHighlighting highlighting = context.newHighlighting().onFile(entry.getKey());\n\n      var ranges = new ArrayList<TextRange>();\n      for (SonarAnalyzer.TokenTypeInfo.TokenInfo message : entry.getValue()) {\n        TypeOfText typeOfText = toType(message.getTokenType());\n        if (typeOfText != null) {\n          var textRange = toTextRange(entry.getKey(), message.getTextRange());\n          if (textRange.isPresent()) {\n            ranges.add(textRange.get());\n            highlighting.highlight(textRange.get(), typeOfText);\n          } else if (LOG.isDebugEnabled()) {\n            LOG.debug(\"The reported token was out of the range. File {}, Range {}\", entry.getKey().filename(), message.getTextRange());\n          }\n        }\n      }\n      if (!ranges.isEmpty()) {\n        doSave(entry.getKey().filename(), highlighting, ranges);\n      }\n    }\n  }\n\n  private static void doSave(String filename, NewHighlighting highlighting, ArrayList<TextRange> ranges) {\n    try {\n      highlighting.save();\n    } catch (Exception ex) {\n      var rangesText = ranges.stream()\n        .sorted((r1, r2) ->\n          r1.start().line() == r2.start().line() && r1.start().lineOffset() == r2.start().lineOffset()\n            ? 0\n            : r1.start().line() < r2.start().line() || (r1.start().line() == r2.start().line() && r1.start().lineOffset() < r2.start().lineOffset())\n            ? -1 : 1)\n        .collect(StringBuilder::new, (sb, r) -> sb.append(r).append(\" \"), StringBuilder::append);\n      var message = String.format(\"The highlighting in the file %s failed with error %s. The highlight ranges found are %s\", filename, ex, rangesText);\n      throw new IllegalStateException(message, ex);\n    }\n  }\n\n  @Override\n  boolean isProcessed(InputFile inputFile) {\n    // we aggregate all highlighting information, no need to process only the first protobuf file\n    return false;\n  }\n\n  @CheckForNull\n  private static TypeOfText toType(SonarAnalyzer.TokenType tokenType) {\n    // Note:\n    // TypeOfText.ANNOTATION -> like a type in C#, so received as DECLARATION_NAME\n    // TypeOfText.STRUCTURED_COMMENT -> not colored differently in C#, so received as COMMENT\n    // TypeOfText.PREPROCESS_DIRECTIVE -> received as KEYWORD\n\n    switch (tokenType) {\n      case NUMERIC_LITERAL:\n        return TypeOfText.CONSTANT;\n\n      case COMMENT:\n        return TypeOfText.COMMENT;\n\n      case KEYWORD:\n        return TypeOfText.KEYWORD;\n\n      case TYPE_NAME:\n        return TypeOfText.KEYWORD_LIGHT;\n\n      case STRING_LITERAL:\n        return TypeOfText.STRING;\n\n      case UNRECOGNIZED,\n           // generated by protobuf\n           UNKNOWN_TOKENTYPE:\n\n      default:\n        // do not color\n        return null;\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/protobuf/LogImporter.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.protobuf;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonarsource.dotnet.protobuf.SonarAnalyzer;\nimport org.sonarsource.dotnet.protobuf.SonarAnalyzer.LogInfo;\n\n/*\n * This class is responsible of reading log messages generated by the C#/VB.NET analyzer.\n */\npublic class LogImporter extends RawProtobufImporter<LogInfo> {\n\n  private static final Logger LOG = LoggerFactory.getLogger(LogImporter.class);\n  private List<LogInfo> messages = new ArrayList<>();\n\n  public LogImporter() {\n    super(SonarAnalyzer.LogInfo.parser());\n  }\n\n  @Override\n  void consume(LogInfo message) {\n    messages.add(message);\n  }\n\n  @Override\n  public void save() {\n    for (LogInfo message : messages) {\n      switch (message.getSeverity()) {\n        case DEBUG:\n          LOG.debug(message.getText());\n          break;\n\n        case INFO:\n          LOG.info(message.getText());\n          break;\n\n        case WARNING:\n          LOG.warn(message.getText());\n          break;\n\n        case UNKNOWN_SEVERITY:\n        default:\n          LOG.warn(\"Unexpected log message severity: {}\", message.getSeverity());\n          LOG.info(message.getText());\n      }\n    }\n\n    messages.clear();\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/protobuf/MethodDeclarationsImporter.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.protobuf;\n\nimport org.sonarsource.dotnet.shared.plugins.MethodDeclarationsCollector;\nimport static org.sonarsource.dotnet.protobuf.SonarAnalyzer.MethodDeclarationsInfo;\n\npublic class MethodDeclarationsImporter extends RawProtobufImporter<MethodDeclarationsInfo> {\n  private final MethodDeclarationsCollector collector;\n\n  public MethodDeclarationsImporter(MethodDeclarationsCollector collector) {\n    super(MethodDeclarationsInfo.parser());\n    this.collector = collector;\n  }\n\n  @Override\n  void consume(MethodDeclarationsInfo declarations) {\n    collector.addDeclaration(declarations);\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/protobuf/MetricsImporter.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.protobuf;\n\nimport java.io.Serializable;\nimport java.util.HashSet;\n\nimport java.util.function.UnaryOperator;\n\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonar.api.batch.fs.InputFile;\nimport org.sonar.api.batch.measure.Metric;\nimport org.sonar.api.batch.sensor.SensorContext;\nimport org.sonar.api.issue.NoSonarFilter;\nimport org.sonar.api.measures.CoreMetrics;\nimport org.sonar.api.measures.FileLinesContext;\nimport org.sonar.api.measures.FileLinesContextFactory;\nimport org.sonarsource.dotnet.protobuf.SonarAnalyzer.MetricsInfo;\n\n/**\n  This class is responsible for reading/importing all the metrics that were generated by the C#/VB.NET analyzers.\n */\npublic class MetricsImporter extends ProtobufImporter<MetricsInfo> {\n\n  private final SensorContext context;\n  private final FileLinesContextFactory fileLinesContextFactory;\n  private final NoSonarFilter noSonarFilter;\n  private static final Logger LOG = LoggerFactory.getLogger(MetricsImporter.class);\n\n  public MetricsImporter(SensorContext context, FileLinesContextFactory fileLinesContextFactory, NoSonarFilter noSonarFilter,\n    UnaryOperator<String> toRealPath) {\n    super(MetricsInfo.parser(), context, MetricsInfo::getFilePath, toRealPath);\n    this.context = context;\n    this.fileLinesContextFactory = fileLinesContextFactory;\n    this.noSonarFilter = noSonarFilter;\n  }\n\n  @Override\n  void consumeFor(InputFile inputFile, MetricsInfo message) {\n    saveMetric(context, inputFile, CoreMetrics.CLASSES, message.getClassCount());\n    saveMetric(context, inputFile, CoreMetrics.STATEMENTS, message.getStatementCount());\n    saveMetric(context, inputFile, CoreMetrics.FUNCTIONS, message.getFunctionCount());\n    saveMetric(context, inputFile, CoreMetrics.COMPLEXITY, message.getComplexity());\n\n    noSonarFilter.noSonarInFile(inputFile, new HashSet<>(message.getNoSonarCommentList()));\n\n    FileLinesContext fileLinesContext = fileLinesContextFactory.createFor(inputFile);\n\n    saveMetric(context, inputFile, CoreMetrics.COMMENT_LINES, message.getNonBlankCommentCount());\n\n    int lineCount = inputFile.lines();\n    for (int line : message.getCodeLineList()) {\n      if (line <= lineCount) {\n        fileLinesContext.setIntValue(CoreMetrics.NCLOC_DATA_KEY, line, 1);\n      } else if (LOG.isDebugEnabled()) {\n        LOG.debug(\"The code line number was out of the range. File {}, Line {}\", inputFile.filename(), line);\n      }\n    }\n    saveMetric(context, inputFile, CoreMetrics.NCLOC, message.getCodeLineCount());\n\n    if (message.getCognitiveComplexity() >= 0) {\n      saveMetric(context, inputFile, CoreMetrics.COGNITIVE_COMPLEXITY, message.getCognitiveComplexity());\n    }\n\n    for (Integer executableLineNumber : message.getExecutableLinesList()) {\n      fileLinesContext.setIntValue(CoreMetrics.EXECUTABLE_LINES_DATA_KEY, executableLineNumber, 1);\n    }\n\n    fileLinesContext.save();\n  }\n\n  private static <T extends Serializable> void saveMetric(SensorContext context, InputFile inputFile, Metric<T> metric, T value) {\n    context.<T>newMeasure()\n      .on(inputFile)\n      .forMetric(metric)\n      .withValue(value)\n      .save();\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/protobuf/ProtobufImporter.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.protobuf;\n\nimport com.google.protobuf.Parser;\nimport java.net.URI;\nimport java.util.HashSet;\nimport java.util.Set;\nimport java.util.function.Function;\nimport java.util.function.UnaryOperator;\nimport org.sonar.api.batch.fs.InputFile;\nimport org.sonar.api.batch.sensor.SensorContext;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonarsource.dotnet.shared.plugins.SensorContextUtils;\n\n/**\n  This class is the base class of all protobuf message importers whose data contain some file path.\n\n  Note that the file path provided by Roslyn might use a different path escaping than the one used by Java, that's why we take a function which transform a path into the\n  system real path (this method is OS dependent).\n */\npublic abstract class ProtobufImporter<T> extends RawProtobufImporter<T> {\n  private static final Logger LOG = LoggerFactory.getLogger(ProtobufImporter.class);\n\n  private final Function<T, String> toFilePath;\n  private final UnaryOperator<String> toRealPath;\n  private final SensorContext context;\n  private final Set<URI> filesProcessed = new HashSet<>();\n\n  ProtobufImporter(Parser<T> parser, SensorContext context, Function<T, String> toFilePath, UnaryOperator<String> toRealPath) {\n    super(parser);\n    this.context = context;\n    this.toFilePath = toFilePath;\n    this.toRealPath = toRealPath;\n  }\n\n  @Override\n  final void consume(T message) {\n    String filePath = toRealPath.apply(toFilePath.apply(message));\n    InputFile inputFile = SensorContextUtils.toInputFile(context.fileSystem(), filePath);\n\n    // file may be null because it's not within the project base dir\n    if (inputFile == null) {\n      LOG.warn(\"File '{}' referenced by the protobuf '{}' does not exist in the analysis context\", filePath,\n        message.getClass().getSimpleName());\n      return;\n    }\n\n    // process each protobuf file only once but allow overriding\n    if (isProcessed(inputFile)) {\n      LOG.debug(\"File '{}' was already processed. Skip it\", inputFile);\n      return;\n    }\n\n    consumeFor(inputFile, message);\n  }\n\n  abstract void consumeFor(InputFile inputFile, T message);\n\n  boolean isProcessed(InputFile inputFile) {\n    return !filesProcessed.add(inputFile.uri());\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/protobuf/RawProtobufImporter.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.protobuf;\n\nimport com.google.protobuf.Parser;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\n\n/**\n  This class is the base class of all protobuf message importers. Those importers allow to read some information generated by the C#/VB.NET analyzers.\n\n  Note that if the protobuf message is supposed to contain some path then you should use the ProtobufImporter class\n */\npublic abstract class RawProtobufImporter<T> {\n\n  private final Parser<T> parser;\n\n  RawProtobufImporter(Parser<T> parser) {\n    this.parser = parser;\n  }\n\n  public void accept(Path protobuf) {\n    try (InputStream inputStream = Files.newInputStream(protobuf)) {\n      while (true) {\n        T message = parser.parseDelimitedFrom(inputStream);\n        if (message == null) {\n          break;\n        }\n        consume(message);\n      }\n    } catch (IOException e) {\n      throw new IllegalStateException(\"unexpected error while parsing protobuf file: \" + protobuf, e);\n    }\n  }\n\n  abstract void consume(T message);\n\n  public void save() {\n    // only highlight importer is using this method for now but we should expand to other importers\n    // when we start merging other protobuf data\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/protobuf/SymbolRefsImporter.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.protobuf;\n\nimport java.util.HashMap;\nimport java.util.HashSet;\nimport java.util.Map;\nimport java.util.Optional;\nimport java.util.function.UnaryOperator;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonar.api.batch.fs.InputFile;\nimport org.sonar.api.batch.fs.TextRange;\nimport org.sonar.api.batch.sensor.SensorContext;\nimport org.sonar.api.batch.sensor.symbol.NewSymbol;\nimport org.sonar.api.batch.sensor.symbol.NewSymbolTable;\nimport org.sonarsource.dotnet.protobuf.SonarAnalyzer;\nimport org.sonarsource.dotnet.protobuf.SonarAnalyzer.SymbolReferenceInfo;\n\nimport static org.sonarsource.dotnet.shared.plugins.SensorContextUtils.toTextRange;\n\n/**\n  This class is responsible for reading/importing the symbol references generated by the analyzer (C# or VB.NET).\n */\npublic class SymbolRefsImporter extends ProtobufImporter<SonarAnalyzer.SymbolReferenceInfo> {\n  private static final Logger LOG = LoggerFactory.getLogger(SymbolRefsImporter.class);\n  private final SensorContext context;\n  private final HashMap<InputFile, HashSet<SonarAnalyzer.SymbolReferenceInfo.SymbolReference>> fileSymbolReferences = new HashMap<>();\n\n  public SymbolRefsImporter(SensorContext context, UnaryOperator<String> toRealPath) {\n    super(SonarAnalyzer.SymbolReferenceInfo.parser(), context, SonarAnalyzer.SymbolReferenceInfo::getFilePath, toRealPath);\n    this.context = context;\n  }\n\n  private static void addReferences(InputFile file, SymbolReferenceInfo.SymbolReference tokenInfo, NewSymbolTable symbolTable) {\n    var declarationRange = toTextRange(file, tokenInfo.getDeclaration());\n    if (declarationRange.isPresent()) {\n      NewSymbol symbol = symbolTable.newSymbol(declarationRange.get());\n      for (SonarAnalyzer.TextRange refTextRange : tokenInfo.getReferenceList()) {\n        var validatedReference = validatedReference(file, refTextRange, declarationRange.get());\n        validatedReference.ifPresent(symbol::newReference);\n      }\n    }\n  }\n\n  private static Optional<TextRange> validatedReference(InputFile file, SonarAnalyzer.TextRange refTextRange, TextRange declarationRange) {\n    var referenceRange = toTextRange(file, refTextRange);\n    if (referenceRange.isEmpty()) {\n      if (LOG.isDebugEnabled()) {\n        LOG.debug(\"The reported token was out of the range. File {}, Range {}\", file.filename(), refTextRange);\n      }\n      return Optional.empty();\n    } else if (declarationRange.overlap(referenceRange.get())) {\n      if (LOG.isDebugEnabled()) {\n        LOG.debug(\"The declaration token at {} overlaps with the referencing token {} in file {}\", declarationRange, referenceRange.get(), file.filename());\n      }\n      return Optional.empty();\n    }\n    return referenceRange;\n  }\n\n  @Override\n  void consumeFor(InputFile inputFile, SymbolReferenceInfo message) {\n    for (SonarAnalyzer.SymbolReferenceInfo.SymbolReference tokenInfo : message.getReferenceList()) {\n      fileSymbolReferences\n        .computeIfAbsent(inputFile, f -> new HashSet<>())\n        .add(tokenInfo);\n    }\n  }\n\n  @Override\n  public void save() {\n    for (Map.Entry<InputFile, HashSet<SonarAnalyzer.SymbolReferenceInfo.SymbolReference>> entry : fileSymbolReferences.entrySet()) {\n      NewSymbolTable symbolTable = context.newSymbolTable().onFile(entry.getKey());\n      for (SonarAnalyzer.SymbolReferenceInfo.SymbolReference tokenInfo : entry.getValue()) {\n        addReferences(entry.getKey(), tokenInfo, symbolTable);\n      }\n      symbolTable.save();\n    }\n  }\n\n  @Override\n  boolean isProcessed(InputFile inputFile) {\n    // we aggregate all symbol reference information, no need to process only the first protobuf file\n    return false;\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/protobuf/TelemetryAggregator.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.protobuf;\n\nimport java.util.AbstractMap;\nimport java.util.Arrays;\nimport java.util.Collection;\nimport java.util.Map;\nimport java.util.stream.Stream;\nimport org.sonarsource.dotnet.protobuf.SonarAnalyzer;\nimport org.sonarsource.dotnet.shared.plugins.telemetryjson.TelemetryUtils;\n\nimport static java.util.function.Function.identity;\nimport static java.util.stream.Collectors.counting;\nimport static java.util.stream.Collectors.groupingBy;\n\npublic class TelemetryAggregator {\n  public final String languageVersion;\n\n  public TelemetryAggregator(String pluginKey, String language) {\n    var pluginLanguageKey = pluginKey + \".\" + language + \".\";\n    this.languageVersion = pluginLanguageKey + \"language_version.%s\";\n  }\n\n  /**\n   * Returns a string based key-value-pair from the given key and value.\n   */\n  private static <V> Map.Entry<String, String> kvp(String key, V value) {\n    return new AbstractMap.SimpleImmutableEntry<>(key, value.toString());\n  }\n\n  private String key(String pattern, String... keys) {\n    // Sanitize any values to comply with the requirement for telemetry keys:\n    // https://discuss.sonarsource.com/t/20103/8\n    var formattedKeys = sanitizeKeys(keys);\n    return pattern.formatted((Object[]) formattedKeys);\n  }\n\n  private String[] sanitizeKeys(String[] keys) {\n    return Arrays.stream(keys).map(TelemetryUtils::sanitizeKey).toArray(String[]::new);\n  }\n\n  private Stream<Map.Entry<String, String>> languageVersion(Stream<String> languageVersions) {\n    var countBy = languageVersions.filter(x -> !x.isEmpty()).collect(groupingBy(identity(), counting()));\n    return countBy.entrySet().stream().map(x -> kvp(\n      key(languageVersion, x.getKey()),\n      x.getValue()));\n  }\n\n  public Collection<Map.Entry<String, String>> aggregate(Collection<SonarAnalyzer.Telemetry> telemetries) {\n    return languageVersion(telemetries.stream().map(SonarAnalyzer.Telemetry::getLanguageVersion)).toList();\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/protobuf/TelemetryImporter.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.protobuf;\n\nimport org.sonarsource.dotnet.protobuf.SonarAnalyzer;\nimport org.sonarsource.dotnet.shared.plugins.TelemetryCollector;\n\npublic class TelemetryImporter extends RawProtobufImporter<SonarAnalyzer.Telemetry> {\n  private final TelemetryCollector collector;\n\n  public TelemetryImporter(TelemetryCollector collector) {\n    super(SonarAnalyzer.Telemetry.parser());\n    this.collector = collector;\n  }\n\n  @Override\n  void consume(SonarAnalyzer.Telemetry message) {\n    collector.addTelemetry(message);\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/protobuf/package-info.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n@ParametersAreNonnullByDefault\npackage org.sonarsource.dotnet.shared.plugins.protobuf;\n\nimport javax.annotation.ParametersAreNonnullByDefault;\n\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/sensors/AbstractFileCacheSensor.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.sensors;\n\nimport java.net.URI;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.util.Arrays;\nimport java.util.Locale;\nimport java.util.stream.Collectors;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonar.api.batch.sensor.SensorContext;\nimport org.sonar.api.batch.sensor.SensorDescriptor;\nimport org.sonar.api.scanner.ScannerSide;\nimport org.sonar.api.scanner.sensor.ProjectSensor;\nimport org.sonarsource.dotnet.shared.plugins.AbstractPropertyDefinitions;\nimport org.sonarsource.dotnet.shared.plugins.HashProvider;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\n\n@ScannerSide\npublic abstract class AbstractFileCacheSensor implements ProjectSensor {\n  private static final Logger LOG = LoggerFactory.getLogger(AbstractFileCacheSensor.class);\n  private final PluginMetadata metadata;\n  private final HashProvider hashProvider;\n\n  protected AbstractFileCacheSensor(PluginMetadata metadata, HashProvider hashProvider) {\n    this.metadata = metadata;\n    this.hashProvider = hashProvider;\n  }\n\n  // Some file extensions are owned by other analyzers (like .cshtml) so we need this workaround to support caching for those files.\n  protected String[] additionalSupportedExtensions() {\n    return new String[0];\n  }\n\n  @Override\n  public void describe(SensorDescriptor descriptor) {\n    descriptor.name(metadata.languageName() + \" File Caching Sensor\");\n    descriptor.onlyOnLanguage(metadata.languageKey());\n  }\n\n  @Override\n  public void execute(SensorContext context) {\n    var configuration = context.config();\n    if (configuration.get(AbstractPropertyDefinitions.pullRequestBase()).isPresent()) {\n      LOG.debug(\"Incremental PR analysis: Cache is not uploaded for pull requests.\");\n      return;\n    }\n\n    if (!context.isCacheEnabled()) {\n      LOG.info(\"Incremental PR analysis: Analysis cache is disabled.\");\n      return;\n    }\n\n    var basePath = configuration.get(AbstractPropertyDefinitions.pullRequestCacheBasePath());\n    if (basePath.isEmpty()) {\n      LOG.warn(\"Incremental PR analysis: Could not determine common base path, cache will not be computed. Consider setting 'sonar.projectBaseDir' property.\");\n      return;\n    }\n    var basePathUri = Paths.get(basePath.get()).toUri();\n    var basePathUpperCase = basePathUri.toString().toUpperCase(Locale.ROOT);\n    LOG.debug(\"Incremental PR analysis: Preparing to upload file hashes.\");\n    LOG.debug(\"Incremental PR analysis: basePathUri: {}\", basePathUri);\n    var fileSystem = context.fileSystem();\n    var predicateFactory = fileSystem.predicates();\n    var filePredicates = Arrays.stream(additionalSupportedExtensions()).map(predicateFactory::hasExtension).collect(Collectors.toList());\n    filePredicates.add(predicateFactory.hasLanguage(metadata.languageKey()));\n\n    fileSystem.inputFiles(predicateFactory.or(filePredicates)).forEach(inputFile -> {\n      // Normalize to unix style separators. The scanner should be able to read the files on both windows and unix.\n      var uri = inputFile.uri();\n      var relative = basePathUri.relativize(uri);\n      if (relative.equals(uri)) {\n        // If relativization failed => try case-insensitive\n        if (uri.toString().toUpperCase(Locale.ROOT).startsWith(basePathUpperCase)) {\n          relative = URI.create(uri.toString().substring(basePathUpperCase.length()));\n        } else {\n          // Having key with absolute path in the cache is useless. S4NET combines those with the base, and they start with \"/\" anyway.\n          LOG.debug(\"Incremental PR analysis: Could not compute relative path for {}\", uri);\n          return;\n        }\n      }\n\n      var key = relative.getPath().replace('\\\\', '/');\n      var next = context.nextCache();\n      try {\n        LOG.debug(\"Incremental PR analysis: Adding hash for '{}' to the cache.\", key);\n        next.write(key, hashProvider.computeHash(Path.of(uri)));\n      } catch (Exception exception) {\n        LOG.warn(\"Incremental PR analysis: An error occurred while computing the hash for \" + key, exception);\n      }\n    });\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/sensors/AnalysisWarningsSensor.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.sensors;\n\nimport com.google.gson.Gson;\nimport com.google.gson.reflect.TypeToken;\nimport org.sonar.api.batch.sensor.SensorContext;\nimport org.sonar.api.batch.sensor.SensorDescriptor;\nimport org.sonar.api.notifications.AnalysisWarnings;\nimport org.sonar.api.scanner.sensor.ProjectSensor;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.InputStreamReader;\nimport java.lang.reflect.Type;\nimport java.nio.charset.StandardCharsets;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.util.List;\nimport java.util.regex.Pattern;\nimport java.util.stream.Stream;\nimport org.sonarsource.dotnet.shared.plugins.AbstractLanguageConfiguration;\n\n/**\n * This class is responsible to handle all the analysis warnings that need to be sent to Sonar Qube/Cloud.\n * It will import the warnings files generated by auto-scan and by the Scanner for .Net.\n */\npublic final class AnalysisWarningsSensor implements ProjectSensor {\n\n  private static final Logger LOG = LoggerFactory.getLogger(AnalysisWarningsSensor.class);\n  private static final Gson GSON = new Gson();\n\n  private static final Pattern AnalysisWarningsPattern = Pattern.compile(\"AnalysisWarnings\\\\..*\\\\.json\");\n  private final AbstractLanguageConfiguration configuration;\n  private final AnalysisWarnings analysisWarnings;\n\n  public AnalysisWarningsSensor(AbstractLanguageConfiguration configuration, AnalysisWarnings analysisWarnings){\n    this.configuration = configuration;\n    this.analysisWarnings = analysisWarnings;\n  }\n\n  @Override\n  public void describe(SensorDescriptor descriptor) {\n    descriptor.name(\"Analysis Warnings import\");\n  }\n\n  @Override\n  public void execute(final SensorContext sensorContext) {\n    // Search for AnalysisWarnings.*.json files:\n    //    .sonarqube\\out\\AnalysisWarnings.AutoScan.json\n    //    .sonarqube\\out\\AnalysisWarnings.Scanner.json\n    configuration.outputDir()\n      .map(AnalysisWarningsSensor::getFilePaths)\n      .ifPresent(this::publishMessages);\n  }\n\n  private static Stream<Path> getFilePaths(Path outputDirectory) {\n    LOG.debug(\"Searching for analysis warnings in {}\", outputDirectory);\n    try {\n      return Files.find(outputDirectory, 1, (path, attributes) -> AnalysisWarningsPattern.matcher(path.toFile().getName()).matches());\n    } catch (IOException exception) {\n      LOG.warn(\"Error occurred while loading analysis analysis warnings\", exception);\n      return Stream.empty();\n    }\n  }\n\n  private void publishMessages(Stream<Path> paths) {\n    Type collectionType = new TypeToken<List<Warning>>(){}.getType();\n    paths.forEach(path -> {\n      LOG.debug(\"Loading analysis warnings from {}\", path.toAbsolutePath());\n      try (InputStream is = Files.newInputStream(path)) {\n        List<Warning> warnings = GSON.fromJson(new InputStreamReader(is, StandardCharsets.UTF_8), collectionType);\n        warnings.forEach(message -> analysisWarnings.addUnique(message.getText()));\n      } catch (Exception exception) {\n        LOG.error(\"Error occurred while publishing analysis warnings\", exception);\n      }\n    });\n  }\n\n  private static class Warning {\n    private String text = \"\";\n\n    public String getText() {\n      return text;\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/sensors/DotNetSensor.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.sensors;\n\nimport java.nio.file.Path;\nimport java.util.List;\nimport java.util.function.UnaryOperator;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonar.api.batch.fs.FileSystem;\nimport org.sonar.api.batch.fs.InputFile.Type;\nimport org.sonar.api.batch.sensor.SensorContext;\nimport org.sonar.api.batch.sensor.SensorDescriptor;\nimport org.sonar.api.notifications.AnalysisWarnings;\nimport org.sonar.api.scanner.sensor.ProjectSensor;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\nimport org.sonarsource.dotnet.shared.plugins.ProjectTypeCollector;\nimport org.sonarsource.dotnet.shared.plugins.ProtobufDataImporter;\nimport org.sonarsource.dotnet.shared.plugins.RealPathProvider;\nimport org.sonarsource.dotnet.shared.plugins.ReportPathCollector;\nimport org.sonarsource.dotnet.shared.plugins.RoslynDataImporter;\nimport org.sonarsource.dotnet.shared.plugins.RoslynReport;\nimport org.sonarsource.dotnet.shared.plugins.SensorContextUtils;\n\nimport static org.sonarsource.dotnet.shared.CallableUtils.lazy;\n\n/**\n * This class is the main sensor for C# and VB.NET which is going to process all Roslyn reports and protobuf contents and then push them to SonarQube.\n * <p>\n * This sensor is a SQ/SC project sensor. It will execute once at the end.\n * Please note that a \"SQ/SC project\" is usually the equivalent of an \"MSBuild solution\".\n */\npublic class DotNetSensor implements ProjectSensor {\n\n  private static final Logger LOG = LoggerFactory.getLogger(DotNetSensor.class);\n  private static final String GET_HELP_MESSAGE = \"You can get help on the community forum: https://community.sonarsource.com\";\n  private static final String READ_MORE_MESSAGE = \"Read more about how the SonarScanner for .NET detects test projects: https://github.com/SonarSource/sonar-scanner-msbuild/wiki/Analysis-of-product-projects-vs.-test-projects\";\n\n  private final ProtobufDataImporter protobufDataImporter;\n  private final RoslynDataImporter roslynDataImporter;\n  private final PluginMetadata pluginMetadata;\n  private final ReportPathCollector reportPathCollector;\n  private final ProjectTypeCollector projectTypeCollector;\n  private final AnalysisWarnings analysisWarnings;\n\n  public DotNetSensor(PluginMetadata pluginMetadata, ReportPathCollector reportPathCollector, ProjectTypeCollector projectTypeCollector,\n    ProtobufDataImporter protobufDataImporter, RoslynDataImporter roslynDataImporter, AnalysisWarnings analysisWarnings) {\n    this.pluginMetadata = pluginMetadata;\n    this.reportPathCollector = reportPathCollector;\n    this.projectTypeCollector = projectTypeCollector;\n    this.protobufDataImporter = protobufDataImporter;\n    this.roslynDataImporter = roslynDataImporter;\n    this.analysisWarnings = analysisWarnings;\n  }\n\n  @Override\n  public void describe(SensorDescriptor descriptor) {\n    descriptor.name(pluginMetadata.languageName())\n      .onlyOnLanguage(pluginMetadata.languageKey());\n  }\n\n  @Override\n  public void execute(SensorContext context) {\n    FileSystem fs = context.fileSystem();\n    boolean hasFilesOfLanguage = SensorContextUtils.hasFilesOfLanguage(fs, pluginMetadata.languageKey());\n    boolean hasProjects = projectTypeCollector.hasProjects();\n    if (hasFilesOfLanguage && hasProjects) {\n      importResults(fs, context);\n    } else {\n      log(hasFilesOfLanguage, hasProjects);\n    }\n    projectTypeCollector.getSummary(pluginMetadata.languageName()).ifPresent(LOG::info);\n  }\n\n  private void importResults(FileSystem fs, SensorContext context) {\n    boolean hasMainFiles = SensorContextUtils.hasFilesOfType(fs, Type.MAIN, pluginMetadata.languageKey());\n    boolean hasTestFiles = SensorContextUtils.hasFilesOfType(fs, Type.TEST, pluginMetadata.languageKey());\n    UnaryOperator<String> toRealPath = new RealPathProvider();\n\n    if (hasTestFiles && !hasMainFiles) {\n      warnThatProjectContainsOnlyTestCode(fs, analysisWarnings, pluginMetadata.languageName());\n    }\n\n    List<Path> protobufPaths = reportPathCollector.protobufDirs();\n    if (protobufPaths.isEmpty()) {\n      LOG.warn(\"No protobuf reports found. The {} files will not have highlighting and metrics. {}\",\n        lazy(pluginMetadata::languageName),\n        GET_HELP_MESSAGE);\n    } else {\n      protobufDataImporter.importResults(context, protobufPaths, toRealPath);\n    }\n\n    List<RoslynReport> roslynReports = reportPathCollector.roslynReports();\n    if (roslynReports.isEmpty()) {\n      LOG.warn(\"No Roslyn issue reports were found. The {} files have not been analyzed. {}\", lazy(pluginMetadata::languageName), GET_HELP_MESSAGE);\n    } else {\n      roslynDataImporter.importRoslynReports(roslynReports, context, toRealPath);\n    }\n  }\n\n  /**\n   * If the project does not contain MAIN or TEST files OR does not have any found .NET projects (implicitly it has not been scanned with the Scanner for .NET)\n   * we should log a warning to the user, because no files will be analyzed.\n   *\n   * @param hasFilesOfLanguage True if ANY files of this sensor language have been indexed.\n   * @param hasProjects  True if at least one .NET project has been found in {@link FileTypeSensor#execute(SensorContext)}.\n   */\n  private void log(boolean hasFilesOfLanguage, boolean hasProjects) {\n    if (hasProjects) {\n      // the scanner for .NET has been used, which means that `hasFilesOfLanguage` is false.\n      assert !hasFilesOfLanguage;\n    } else if (hasFilesOfLanguage) {\n      // the scanner for .NET has _not_ been used.\n      LOG.warn(\"Your project contains {} files which cannot be analyzed with the scanner you are using.\" +\n          \" To analyze C# or VB.NET, you must use the SonarScanner for .NET 5.x or higher, see https://redirect.sonarsource.com/doc/install-configure-scanner-msbuild.html\",\n        lazy(pluginMetadata::languageName));\n    }\n    if (!hasFilesOfLanguage) {\n      logDebugNoFiles();\n    }\n  }\n\n  private static void warnThatProjectContainsOnlyTestCode(FileSystem fs, AnalysisWarnings analysisWarnings, String languageName) {\n    LOG.warn(\"SonarScanner for .NET detected only TEST files and no MAIN files for {} in the current solution. \" +\n        \"Only TEST-code related results will be imported to your SonarQube project. \" +\n        \"Many of our rules (e.g. vulnerabilities) are raised only on MAIN-code. {}\",\n      languageName, READ_MORE_MESSAGE);\n\n    // Before outputting a warning in the User Interface, we want to make sure it's worth the user attention.\n    // There can be cases where a project written in language X has tests written in languages X, Y and Z.\n    // In this case, the fact that there is only test code for languages Y and Z should not trigger a UI warning.\n    if (!SensorContextUtils.hasAnyMainFiles(fs)) {\n      analysisWarnings.addUnique(\n        String.format(\"Your project contains only TEST-code for language %s and no MAIN-code for any language, so only TEST-code related results are imported. \" +\n            \"Many of our rules (e.g. vulnerabilities) are raised only on MAIN-code. %s\",\n          languageName, READ_MORE_MESSAGE));\n    }\n  }\n\n  private static void logDebugNoFiles() {\n    // No MAIN and no TEST files -> skip\n    LOG.debug(\"No files to analyze. Skip Sensor.\");\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/sensors/FileTypeSensor.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.sensors;\n\nimport java.util.Optional;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonar.api.batch.ScannerSide;\nimport org.sonar.api.batch.fs.FileSystem;\nimport org.sonar.api.batch.fs.InputFile.Type;\nimport org.sonar.api.batch.sensor.Sensor;\nimport org.sonar.api.batch.sensor.SensorContext;\nimport org.sonar.api.batch.sensor.SensorDescriptor;\nimport org.sonar.api.config.Configuration;\nimport org.sonarsource.dotnet.shared.plugins.AbstractPropertyDefinitions;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\nimport org.sonarsource.dotnet.shared.plugins.ProjectTypeCollector;\nimport org.sonarsource.dotnet.shared.plugins.SensorContextUtils;\n\nimport static org.sonarsource.dotnet.shared.CallableUtils.lazy;\nimport static org.sonarsource.dotnet.shared.plugins.AbstractPropertyDefinitions.PROJECT_BASE_DIR_PROPERTY;\nimport static org.sonarsource.dotnet.shared.plugins.AbstractPropertyDefinitions.PROJECT_KEY_PROPERTY;\nimport static org.sonarsource.dotnet.shared.plugins.AbstractPropertyDefinitions.PROJECT_NAME_PROPERTY;\n\n/**\n * This class is a non-global sensor used to count the type of files in the .NET projects (i.e. Scanner modules).\n * <p>\n * Why is this needed?\n * - the Scanner for MSBuild categorizes projects as MAIN or TEST\n *   (see <a href=\"https://github.com/SonarSource/sonar-scanner-msbuild/wiki/Analysis-of-product-projects-vs.-test-projects\">...</a>)\n * - in SQ / SC, users can specify which files should be considered as MAIN (sources) or TEST (test sources)\n *   (see <a href=\"https://docs.sonarqube.org/latest/project-administration/narrowing-the-focus/\">...</a>)\n * - the categorization is not obvious, so this additional information should help users debug when needed\n */\n@ScannerSide\npublic class FileTypeSensor implements Sensor {\n  private static final Logger LOG = LoggerFactory.getLogger(FileTypeSensor.class);\n\n  private final ProjectTypeCollector projectTypeCollector;\n  private final PluginMetadata pluginMetadata;\n\n  public FileTypeSensor(ProjectTypeCollector projectTypeCollector, PluginMetadata pluginMetadata) {\n    this.projectTypeCollector = projectTypeCollector;\n    this.pluginMetadata = pluginMetadata;\n  }\n\n  @Override\n  public void describe(SensorDescriptor descriptor) {\n    String name = String.format(\"%s Project Type Information\", pluginMetadata.languageName());\n    descriptor.name(name);\n    // we do not filter by language because we want to be called on projects without sources\n    // (that could reference only shared sources e.g. in .projitems)\n  }\n\n  @Override\n  public void execute(SensorContext context) {\n    FileSystem fs = context.fileSystem();\n    Configuration configuration = context.config();\n\n    boolean hasMainFiles = SensorContextUtils.hasFilesOfType(fs, Type.MAIN, pluginMetadata.languageKey());\n    boolean hasTestFiles = SensorContextUtils.hasFilesOfType(fs, Type.TEST, pluginMetadata.languageKey());\n\n    Optional<String> analyzerWorkDir = getAnalyzerWorkDir(configuration);\n    // We filter based on the \"analyzerWorkDir\" to avoid adding the top-level module, which has no files at all (is an artificial module with no MSBuild project equivalent).\n    // The top-level module has the `sonar.projectKey` and `sonar.projectName` properties, but does not have the \"analyzerWorkDir\" property.\n    if (analyzerWorkDir.isPresent()) {\n      LOG.debug(\"Adding file type information (has MAIN '{}', has TEST '{}') for project '{}' (project key '{}', base dir '{}'). For debug info, see ProjectInfo.xml in '{}'.\",\n        hasMainFiles,\n        hasTestFiles,\n        lazy(() -> getValueOrEmpty(configuration, PROJECT_NAME_PROPERTY)),\n        lazy(() -> getValueOrEmpty(configuration, PROJECT_KEY_PROPERTY)),\n        lazy(() -> getValueOrEmpty(configuration, PROJECT_BASE_DIR_PROPERTY)),\n        lazy(analyzerWorkDir::get));\n      projectTypeCollector.addProjectInfo(hasMainFiles, hasTestFiles);\n    }\n  }\n\n  private Optional<String> getAnalyzerWorkDir(Configuration configuration) {\n    String property = AbstractPropertyDefinitions.analyzerWorkDirProperty(pluginMetadata.languageKey());\n    String[] values = configuration.getStringArray(property);\n    if (values == null || values.length == 0) {\n      return Optional.empty();\n    }\n    return Optional.of(String.join(\", \", values));\n  }\n\n  private static String getValueOrEmpty(Configuration configuration, String key) {\n    Optional<String> optional = configuration.get(key);\n    return optional.isPresent() ? optional.get() : \"\";\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/sensors/LogSensor.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.sensors;\n\nimport java.nio.file.Path;\nimport org.sonar.api.batch.sensor.Sensor;\nimport org.sonar.api.batch.sensor.SensorContext;\nimport org.sonar.api.batch.sensor.SensorDescriptor;\nimport org.sonarsource.dotnet.shared.plugins.ModuleConfiguration;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\nimport org.sonarsource.dotnet.shared.plugins.ProtobufDataImporter;\nimport org.sonarsource.dotnet.shared.plugins.protobuf.LogImporter;\n\nimport static org.sonarsource.dotnet.shared.plugins.ProtobufDataImporter.LOG_FILENAME;\n\npublic class LogSensor implements Sensor {\n  private final PluginMetadata pluginMetadata;\n  private final ModuleConfiguration configuration;\n\n  public LogSensor(PluginMetadata pluginMetadata, ModuleConfiguration configuration) {\n    this.pluginMetadata = pluginMetadata;\n    this.configuration = configuration;\n  }\n\n  @Override\n  public void describe(SensorDescriptor descriptor) {\n    // We don't filter by language to be invoked on projects without sources - when referencing shared project\n    String name = String.format(\"%s Analysis Log\", pluginMetadata.languageName());\n    descriptor.name(name);\n  }\n\n  @Override\n  public void execute(SensorContext context) {\n    LogImporter importer = new LogImporter();\n    for (Path protobufDir : configuration.protobufReportPaths()) {\n      ProtobufDataImporter.parseProtobuf(importer, protobufDir, LOG_FILENAME);\n      importer.save();\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/sensors/MethodDeclarationsSensor.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.sensors;\n\nimport java.nio.file.Path;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonar.api.batch.sensor.Sensor;\nimport org.sonar.api.batch.sensor.SensorContext;\nimport org.sonar.api.batch.sensor.SensorDescriptor;\nimport org.sonarsource.dotnet.shared.plugins.MethodDeclarationsCollector;\nimport org.sonarsource.dotnet.shared.plugins.ModuleConfiguration;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\nimport org.sonarsource.dotnet.shared.plugins.ProtobufDataImporter;\nimport org.sonarsource.dotnet.shared.plugins.protobuf.MethodDeclarationsImporter;\n\nimport static org.sonarsource.dotnet.shared.plugins.ProtobufDataImporter.METHODDECLARATIONS_FILENAME;\n\n/**\n * This sensor is run once per csproj or vbproj build. It reads the protobuf files associated with the project\n * The method declarations are added to the scanner run wide MethodDeclarationsCollector.\n */\npublic class MethodDeclarationsSensor implements Sensor {\n  private static final Logger LOG = LoggerFactory.getLogger(MethodDeclarationsSensor.class);\n  private final PluginMetadata pluginMetadata;\n  private final ModuleConfiguration configuration;\n  private final MethodDeclarationsCollector collector;\n\n  public MethodDeclarationsSensor(MethodDeclarationsCollector collector, PluginMetadata pluginMetadata, ModuleConfiguration configuration) {\n    this.pluginMetadata = pluginMetadata;\n    this.configuration = configuration;\n    this.collector = collector;\n  }\n\n  @Override\n  public void describe(SensorDescriptor descriptor) {\n    String name = String.format(\"%s Method Declarations\", pluginMetadata.languageName());\n    descriptor.name(name);\n  }\n\n  @Override\n  public void execute(SensorContext context) {\n    LOG.debug(\"Start importing method declarations.\");\n    MethodDeclarationsImporter importer = new MethodDeclarationsImporter(collector);\n    for (Path protobufDir : configuration.protobufReportPaths()) {\n      ProtobufDataImporter.parseProtobuf(importer, protobufDir, METHODDECLARATIONS_FILENAME);\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/sensors/PropertiesSensor.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.sensors;\n\nimport java.nio.file.Path;\nimport java.util.List;\nimport org.sonar.api.batch.sensor.Sensor;\nimport org.sonar.api.batch.sensor.SensorContext;\nimport org.sonar.api.batch.sensor.SensorDescriptor;\nimport org.sonarsource.dotnet.shared.plugins.ModuleConfiguration;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\nimport org.sonarsource.dotnet.shared.plugins.ReportPathCollector;\nimport org.sonarsource.dotnet.shared.plugins.RoslynReport;\n\n/**\n * This class is a non-global sensor used to collect all Roslyn reports and all protobufs resulting from the analysis of each and every C#/VB.NET project.\n *\n * Note that this is required because a global sensor cannot access to module specific properties.\n */\npublic class PropertiesSensor implements Sensor {\n  private final ModuleConfiguration configuration;\n  private final ReportPathCollector reportPathCollector;\n  private final PluginMetadata pluginMetadata;\n\n  public PropertiesSensor(ModuleConfiguration configuration, ReportPathCollector reportPathCollector,\n    PluginMetadata pluginMetadata) {\n    this.configuration = configuration;\n    this.reportPathCollector = reportPathCollector;\n    this.pluginMetadata = pluginMetadata;\n  }\n\n  @Override\n  public void describe(SensorDescriptor descriptor) {\n    descriptor.name(pluginMetadata.languageName() + \" Properties\");\n    // we do not filter by language because we want to be called on projects without sources\n    // (that could reference only shared sources e.g. in .projitems)\n  }\n\n  @Override\n  public void execute(SensorContext context) {\n    List<Path> protobufReportPaths = configuration.protobufReportPaths();\n    if (!protobufReportPaths.isEmpty()) {\n      reportPathCollector.addProtobufDirs(protobufReportPaths);\n    }\n\n    List<Path> roslynReportPaths = configuration.roslynReportPaths();\n    if (!roslynReportPaths.isEmpty()) {\n      reportPathCollector.addRoslynReport(roslynReportPaths.stream().map(path -> new RoslynReport(context.project(), path)).toList());\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/sensors/TelemetryJsonProcessor.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.sensors;\n\nimport java.util.concurrent.atomic.AtomicInteger;\nimport javax.annotation.Nonnull;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonar.api.batch.sensor.SensorContext;\nimport org.sonar.api.batch.sensor.SensorDescriptor;\nimport org.sonar.api.scanner.sensor.ProjectSensor;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\nimport org.sonarsource.dotnet.shared.plugins.telemetryjson.TelemetryJsonAggregator;\nimport org.sonarsource.dotnet.shared.plugins.telemetryjson.TelemetryJsonCollector;\n\n/**\n * The TelemetryJsonProcessor is executed once per project (sln) and plugin (vb and c#) after all module sensors (TelemetryJsonSensor) are run.\n * It takes the TelemetryJsonCollector, which contains all telemetry found by the module sensors (.\\sonarqube\\out\\0\\Telemetry.json).\n * In execute, this TelemetryJsonProcessor first executes TelemetryJsonProjectCollector. TelemetryJsonProjectCollector adds the global\n * .\\sonarqube\\out\\Telemetry.*.json to the TelemetryJsonCollector. This is done in the C# plugin and the VB plugin. To avoid adding such telemetry\n * twice, the Telemetry files are marked as processed by the plugin that comes first.\n * This means TelemetryJsonCollector is filled up this way:\n * TelemetryJsonCollector in the C# plugin:\n * 1. csproj specific telemetry is collected by TelemetryJsonSensor\n * 2. TelemetryJsonProjectCollector adds the project wide scanner telemetry (from e.g. the begin step and the end step) and renames the files.\n * TelemetryJsonCollector in the VB plugin\n * 1. vbproj specific telemetry is collected by TelemetryJsonSensor\n * 2. TelemetryJsonProjectCollector tries to add the project wide scanner telemetry, but can not find them because the C# plugin marked them.\n * The order of the C# plugin and VB plugin is non-deterministic, so it could also be the other way around.\n * All telemetry in TelemetryJsonCollector is then aggregated and send to the server (this happens in the C# plugin and the VB plugin).\n */\npublic class TelemetryJsonProcessor implements ProjectSensor {\n  private static final Logger LOG = LoggerFactory.getLogger(TelemetryJsonProcessor.class);\n  private final TelemetryJsonProjectCollector projectSensor;\n  private final PluginMetadata pluginMetadata;\n  private final TelemetryJsonCollector collector;\n\n  public TelemetryJsonProcessor(TelemetryJsonCollector collector, TelemetryJsonProjectCollector projectSensor, PluginMetadata pluginMetadata) {\n    this.collector = collector;\n    this.projectSensor = projectSensor;\n    this.pluginMetadata = pluginMetadata;\n  }\n\n  @Override\n  public void describe(SensorDescriptor sensorDescriptor) {\n    String name = String.format(\"%s Telemetry Json processor\", pluginMetadata.languageName());\n    sensorDescriptor.name(name);\n  }\n\n  @Override\n  public void execute(@Nonnull SensorContext sensorContext) {\n    projectSensor.execute();\n\n    if (collector == null) {\n      LOG.debug(\"TelemetryJsonCollector is null, skipping telemetry processing.\");\n      return;\n    }\n    final var messages = collector.getTelemetry();\n    LOG.debug(\"Found {} telemetry messages.\", messages.size());\n    final var aggregated = new TelemetryJsonAggregator().flatMapTelemetry(messages.stream());\n    final var count = new AtomicInteger();\n    aggregated.forEach(telemetry -> {\n      LOG.debug(\"Adding metric: {}={}\", telemetry.getKey(), telemetry.getValue());\n      sensorContext.addTelemetryProperty(telemetry.getKey(), telemetry.getValue());\n      count.getAndIncrement();\n    });\n    LOG.debug(\"Added {} metrics.\", count);\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/sensors/TelemetryJsonProjectCollector.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.sensors;\n\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.nio.charset.StandardCharsets;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.util.Optional;\nimport java.util.regex.Pattern;\nimport java.util.stream.Stream;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonar.api.scanner.ScannerSide;\nimport org.sonarsource.dotnet.shared.plugins.AbstractLanguageConfiguration;\nimport org.sonarsource.dotnet.shared.plugins.telemetryjson.TelemetryJsonCollector;\nimport org.sonarsource.dotnet.shared.plugins.telemetryjson.TelemetryJsonParser;\n\n/**\n * This class is a dependency of TelemetryJsonProcessor. TelemetryJsonProcessor is instantiated ones per plugin per project.\n * This class is responsible for adding telemetry from .\\sonarqube\\out\\Telemetry.*.json to TelemetryJsonCollector.\n * There are two instances of this class. One registered for the VB plugin and one by the C# plugin. The first of the two plugins\n * that is executed wins, and \"marks\" the Telemetry files as processed by renaming them. That way, the telemetry is only added once.\n * The order of the plugins is non-deterministic, so either of the plugins can pick up the telemetry in a mixed solution.\n * TelemetryJsonProcessor takes all telemetry from TelemetryJsonCollector and sends it to the SQ server. This includes these telemetries:\n * * All module level telemetry collected by TelemetryJsonSensor (language specific)\n * * C# or VB plugin (whoever comes first): The global .\\sonarqube\\out\\Telemetry.*.json telemetry collected by this class\n */\n@ScannerSide\npublic class TelemetryJsonProjectCollector {\n  private static final Logger LOG = LoggerFactory.getLogger(TelemetryJsonProjectCollector.class);\n  private static final Pattern TelemetryPattern = Pattern.compile(\"^Telemetry\\\\..*\\\\.json$\");\n  private final TelemetryJsonCollector collector;\n  private final AbstractLanguageConfiguration configuration;\n\n  public TelemetryJsonProjectCollector(TelemetryJsonCollector collector, AbstractLanguageConfiguration configuration) {\n    this.collector = collector;\n    this.configuration = configuration;\n  }\n\n  public void execute() {\n    configuration.outputDir()\n      .map(TelemetryJsonProjectCollector::getFilePaths)\n      .ifPresent(this::collectTelemetry);\n  }\n\n  private void collectTelemetry(Stream<Path> pathStream) {\n    var parser = new TelemetryJsonParser();\n    pathStream.forEach(file -> markAsProcessed(file).ifPresent(x ->\n    {\n      try (\n        var input = new FileInputStream(x.toFile());\n        var reader = new InputStreamReader(input, StandardCharsets.UTF_8)) {\n        parser.parse(reader).forEach(collector::addTelemetry);\n      } catch (IOException e) {\n        LOG.debug(\"Cannot open telemetry file {}, {}\", file, e.toString());\n      }\n    }));\n  }\n\n  /**\n   * Marks the found telemetry file by renaming it. Returns the new file name or Empty in case of an error.\n   * The rename assures, that any Telemetry file is processed only ones.\n   * This is needed because this class is executed by the VB and the C# plugin but\n   * the telemetry should only be imported once.\n  */\n  private static Optional<Path> markAsProcessed(Path file) {\n    var newFile = file.resolveSibling(\"Processed.\" + file.getFileName());\n    try {\n      var result = Files.move(file, newFile);\n      return Optional.ofNullable(result);\n    } catch (IOException e) {\n      return Optional.empty();\n    }\n  }\n\n  private static Stream<Path> getFilePaths(Path outputDirectory) {\n    LOG.debug(\"Searching for telemetry json in {}\", outputDirectory);\n    try {\n      return Files.find(outputDirectory, 1, (path, attributes) -> TelemetryPattern.matcher(path.toFile().getName()).matches());\n    } catch (IOException exception) {\n      LOG.warn(\"Error occurred while loading telemetry json\", exception);\n      return Stream.empty();\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/sensors/TelemetryJsonSensor.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.sensors;\n\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.nio.charset.StandardCharsets;\nimport javax.annotation.Nonnull;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonar.api.batch.sensor.Sensor;\nimport org.sonar.api.batch.sensor.SensorContext;\nimport org.sonar.api.batch.sensor.SensorDescriptor;\nimport org.sonarsource.dotnet.shared.plugins.ModuleConfiguration;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\nimport org.sonarsource.dotnet.shared.plugins.telemetryjson.TelemetryJsonCollector;\nimport org.sonarsource.dotnet.shared.plugins.telemetryjson.TelemetryJsonParser;\n\n/**\n * This class is executed once per module (csproj/vbproj). It takes the plugin-wide TelemetryJsonCollector and adds found telemetry to it.\n * There are two instances of TelemetryJsonCollector (one for C# and one for VB).\n * The TelemetryJsonProcessor is executed ones per project (sln) per plugin after all TelemetryJsonSensor are executed. It takes the TelemetryJsonCollector\n * and sends them to the server.\n */\npublic class TelemetryJsonSensor implements Sensor {\n\n  private static final Logger LOG = LoggerFactory.getLogger(TelemetryJsonSensor.class);\n  private final PluginMetadata pluginMetadata;\n  private final ModuleConfiguration configuration;\n  private final TelemetryJsonCollector collector;\n\n  public TelemetryJsonSensor(TelemetryJsonCollector collector, PluginMetadata pluginMetadata, ModuleConfiguration configuration) {\n    this.pluginMetadata = pluginMetadata;\n    this.configuration = configuration;\n    this.collector = collector;\n  }\n\n  @Override\n  public void describe(SensorDescriptor sensorDescriptor) {\n    String name = String.format(\"%s Telemetry Json\", pluginMetadata.languageName());\n    sensorDescriptor.name(name).onlyOnLanguage(pluginMetadata.languageKey());\n  }\n\n  @Override\n  public void execute(@Nonnull SensorContext sensorContext) {\n    var parser = new TelemetryJsonParser();\n    for (var file : configuration.telemetryJsonPaths()) {\n      try (\n        var input = new FileInputStream(file.toFile());\n        var reader = new InputStreamReader(input, StandardCharsets.UTF_8)) {\n        parser.parse(reader).forEach(collector::addTelemetry);\n      } catch (IOException e) {\n        LOG.debug(\"Cannot open telemetry file {}, {}\", file, e.toString());\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/sensors/TelemetryProcessor.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.sensors;\n\nimport javax.annotation.Nonnull;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonar.api.batch.sensor.SensorContext;\nimport org.sonar.api.batch.sensor.SensorDescriptor;\nimport org.sonar.api.scanner.sensor.ProjectSensor;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\nimport org.sonarsource.dotnet.shared.plugins.TelemetryCollector;\nimport org.sonarsource.dotnet.shared.plugins.protobuf.TelemetryAggregator;\n\n/**\n * This sensor is run once per run and after all TelemetrySensor are executed.\n * It takes the telemetry messages from the single sensors, aggregates them and adds\n * them to the telemetry.\n */\npublic class TelemetryProcessor implements ProjectSensor {\n  private static final Logger LOG = LoggerFactory.getLogger(TelemetryProcessor.class);\n  private final PluginMetadata pluginMetadata;\n  private final TelemetryCollector collector;\n\n  public TelemetryProcessor(TelemetryCollector collector, PluginMetadata pluginMetadata) {\n    this.pluginMetadata = pluginMetadata;\n    this.collector = collector;\n  }\n\n  @Override\n  public void describe(SensorDescriptor descriptor) {\n    String name = String.format(\"%s Telemetry processor\", pluginMetadata.languageName());\n    descriptor.name(name);\n  }\n\n  @Override\n  public void execute(@Nonnull SensorContext context) {\n    if (collector == null) {\n      LOG.debug(\"TelemetryCollector is null, skipping telemetry processing.\");\n      return;\n    }\n    var aggregator = new TelemetryAggregator(pluginMetadata.pluginKey(), pluginMetadata.languageKey());\n    var messages = collector.getTelemetryMessages();\n    LOG.debug(\"Found {} telemetry messages reported by the analyzers.\", messages.size());\n    var telemetries = aggregator.aggregate(messages);\n    LOG.debug(\"Aggregated {} metrics.\", telemetries.size());\n    telemetries.forEach(telemetry -> {\n      LOG.debug(\"Adding metric: {}={}\", telemetry.getKey(), telemetry.getValue());\n      context.addTelemetryProperty(telemetry.getKey(), telemetry.getValue());\n    });\n    LOG.debug(\"Added {} metrics.\", telemetries.size());\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/sensors/TelemetrySensor.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.sensors;\n\nimport java.nio.file.Path;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.sonar.api.batch.sensor.Sensor;\nimport org.sonar.api.batch.sensor.SensorContext;\nimport org.sonar.api.batch.sensor.SensorDescriptor;\nimport org.sonarsource.dotnet.shared.plugins.ModuleConfiguration;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\nimport org.sonarsource.dotnet.shared.plugins.ProtobufDataImporter;\nimport org.sonarsource.dotnet.shared.plugins.TelemetryCollector;\nimport org.sonarsource.dotnet.shared.plugins.protobuf.TelemetryImporter;\n\nimport static org.sonarsource.dotnet.shared.plugins.ProtobufDataImporter.TELEMETRY_FILENAME;\n\n/**\n * This sensor is run once per csproj or vbproj build. It reads the protobuf files\n * associated with the project (can be more than one in case of multitargeting via &lt;TargetFrameworks&gt;)\n * The telemetry messages are added to the scanner run wide TelemetryCollector and later post-processed by TelemetryProcessor.\n */\npublic class TelemetrySensor implements Sensor {\n  private static final Logger LOG = LoggerFactory.getLogger(TelemetrySensor.class);\n  private final PluginMetadata pluginMetadata;\n  private final ModuleConfiguration configuration;\n  private final TelemetryCollector collector;\n\n  public TelemetrySensor(TelemetryCollector collector, PluginMetadata pluginMetadata, ModuleConfiguration configuration) {\n    this.pluginMetadata = pluginMetadata;\n    this.configuration = configuration;\n    this.collector = collector;\n  }\n\n  @Override\n  public void describe(SensorDescriptor descriptor) {\n    String name = String.format(\"%s Telemetry\", pluginMetadata.languageName());\n    descriptor.name(name).onlyOnLanguage(pluginMetadata.languageKey());\n  }\n\n  @Override\n  public void execute(SensorContext context) {\n    LOG.debug(\"Start importing metrics.\");\n    TelemetryImporter importer = new TelemetryImporter(collector);\n    for (Path protobufDir : configuration.protobufReportPaths()) {\n      ProtobufDataImporter.parseProtobuf(importer, protobufDir, TELEMETRY_FILENAME);\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/sensors/package-info.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.sensors;\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/telemetryjson/TelemetryJsonAggregator.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.telemetryjson;\n\nimport java.util.Map;\nimport java.util.stream.Collectors;\nimport java.util.stream.Stream;\n\npublic class TelemetryJsonAggregator {\n  private static final String TARGET_FRAMEWORK_MONIKER = \"dotnetenterprise.s4net.build.target_framework_moniker\";\n  private static final String CNT_SUFFIX = \".cnt\";\n\n  public Stream<Map.Entry<String, String>> flatMapTelemetry(Stream<Map.Entry<String, String>> telemetry) {\n    var partitioned = telemetry.collect(Collectors.partitioningBy(entry ->\n      // \".cnt\" suffix is an indicator, that the telemetry is supposed to be aggregated by counting the number of occurrences\n      entry.getKey().endsWith(CNT_SUFFIX)\n        // we can not rename \"dotnetenterprise.s4net.build.target_framework_moniker\" to follow the convention because it was already released\n        || entry.getKey().equals(TARGET_FRAMEWORK_MONIKER)));\n\n    var passThrough = partitioned.get(false).stream();\n\n    var aggregated = partitioned.get(true).stream()\n      .collect(Collectors.groupingBy(\n        entry -> stripCntSuffix(entry.getKey()) + \".\" + TelemetryUtils.sanitizeKey(entry.getValue()),\n        Collectors.counting()))\n      .entrySet().stream()\n      .map(entry -> Map.entry(entry.getKey(), Long.toString(entry.getValue())));\n\n    return Stream.concat(passThrough, aggregated);\n  }\n\n  private static String stripCntSuffix(String key) {\n    if (key.endsWith(CNT_SUFFIX)) {\n      return key.substring(0, key.length() - CNT_SUFFIX.length());\n    }\n    return key;\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/telemetryjson/TelemetryJsonCollector.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.telemetryjson;\n\nimport java.util.ArrayList;\nimport java.util.Collection;\nimport java.util.Map;\nimport org.sonar.api.scanner.ScannerSide;\n\n@ScannerSide\npublic class TelemetryJsonCollector {\n  private final ArrayList<Map.Entry<String, String>> telemetry;\n\n  public TelemetryJsonCollector() {\n    this.telemetry = new ArrayList<>();\n  }\n\n  public void addTelemetry(String key, String value) {\n    telemetry.add(Map.entry(key, value));\n  }\n\n  public void addTelemetry(Map.Entry<String, String> telemetry) {\n    this.telemetry.add(telemetry);\n  }\n\n  public Collection<Map.Entry<String, String>> getTelemetry() {\n    return telemetry;\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/telemetryjson/TelemetryJsonParser.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.telemetryjson;\n\nimport com.google.gson.JsonIOException;\nimport com.google.gson.JsonObject;\nimport com.google.gson.JsonPrimitive;\nimport com.google.gson.JsonStreamParser;\nimport com.google.gson.JsonSyntaxException;\nimport java.io.Reader;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.util.stream.Stream;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\n/**\n * Takes a streaming json like\n * <pre>\n *   { key1: 42 }\n *   { key2: \"Hello\" }\n * </pre>\n * and parses it into a list of pairs. Note that the property names might NOT be unique.\n */\npublic class TelemetryJsonParser {\n\n  private static final Logger LOG = LoggerFactory.getLogger(TelemetryJsonParser.class);\n\n  public Stream<Map.Entry<String, String>> parse(Reader jsonReader) {\n    JsonStreamParser p = new JsonStreamParser(jsonReader);\n    var result = new ArrayList<Map.Entry<String, String>>();\n\n    try {\n      collectTelemetry(p, result);\n    } catch (JsonSyntaxException exception) {\n      LOG.debug(\"Parsing of telemetry failed.\");\n    } catch (JsonIOException exception) {\n      LOG.debug(\"Telemetry is empty.\");\n    }\n\n    return result.stream();\n  }\n\n  private static void collectTelemetry(JsonStreamParser parser, ArrayList<Map.Entry<String, String>> result) {\n    parser.forEachRemaining(x ->\n    {\n      if (x instanceof JsonObject object) {   // We expect a stream of something like { key: value }\n        for (var entry : object.entrySet()) { // { key1: value1, key2: value2 } is also okay\n          if (entry.getValue().isJsonPrimitive()) {\n            result.add(Map.entry(entry.getKey(), getString(entry.getValue().getAsJsonPrimitive())));\n          } else {\n            LOG.debug(\"Could not parse telemetry property {}\", x);\n          }\n        }\n      } else {\n        LOG.debug(\"Could not parse telemetry entry {}\", x);\n      }\n    });\n  }\n\n  private static String getString(JsonPrimitive entry) {\n    return entry.isString()\n      ? entry.getAsString()\n      : entry.toString();\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/telemetryjson/TelemetryUtils.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.telemetryjson;\n\npublic class TelemetryUtils {\n\n  private TelemetryUtils() {\n    // Private constructor to hide the implicit public one\n  }\n\n  // See https://github.com/SonarSource/sonar-scanner-msbuild/blob/master/src/SonarScanner.MSBuild.Common/Telemetry/TelemetryUtils.cs\n  // See https://xtranet-sonarsource.atlassian.net/wiki/spaces/DP/pages/3912630334/SonarSource+Telemetry+System+Sending+and+Using+Measures#Naming-conventions\n  public static String sanitizeKey(String x) {\n    var sb = new StringBuilder(x.length());\n    for (char c : x.toCharArray()) {\n      sb.append(c < 128 && Character.isLetterOrDigit(c) ? Character.toLowerCase(c) : '_');\n    }\n    return sb.toString();\n  }\n\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/plugins/telemetryjson/package-info.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.telemetryjson;\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/sarif/Location.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.sarif;\n\nimport javax.annotation.CheckForNull;\n\npublic class Location {\n  private String absolutePath;\n  private String message;\n  private int startLine;\n  private int startColumn;\n  private int endLine;\n  private int endColumn;\n\n  Location(String absolutePath, String message, int startLine, int startColumn, int endLine, int endColumn) {\n    this.absolutePath = absolutePath;\n    this.message = message;\n    this.startLine = startLine;\n    this.startColumn = startColumn;\n    this.endLine = endLine;\n    this.endColumn = endColumn;\n  }\n\n  public String getAbsolutePath() {\n    return absolutePath;\n  }\n\n  @CheckForNull\n  public String getMessage() {\n    return message;\n  }\n\n  public int getStartLine() {\n    return startLine;\n  }\n\n  public int getStartColumn() {\n    return startColumn;\n  }\n\n  public int getEndLine() {\n    return endLine;\n  }\n\n  public int getEndColumn() {\n    return endColumn;\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) {\n      return true;\n    }\n    if (o == null || getClass() != o.getClass()) {\n      return false;\n    }\n\n    Location location = (Location) o;\n\n    if (startLine != location.startLine ||\n        startColumn != location.startColumn ||\n        endLine != location.endLine ||\n        endColumn != location.endColumn) {\n      return false;\n    }\n    return ((absolutePath != null) ? absolutePath.equals(location.absolutePath) : (location.absolutePath == null)) &&\n        ((message != null) ? message.equals(location.message) : (location.message == null));\n  }\n\n  @Override\n  public int hashCode() {\n    int result = absolutePath != null ? absolutePath.hashCode() : 0;\n    result = 31 * result + (message != null ? message.hashCode() : 0);\n    result = 31 * result + startLine;\n    result = 31 * result + startColumn;\n    result = 31 * result + endLine;\n    result = 31 * result + endColumn;\n    return result;\n  }\n\n  @Override\n  public String toString() {\n    return \"Location [absolutePath=\" + absolutePath + \", message=\" + message + \", startLine=\" + startLine + \", startColumn=\" +\n        startColumn + \", endLine=\" + endLine + \", endColumn=\" + endColumn + \"]\";\n  }\n\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/sarif/SarifParser.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.sarif;\n\nimport java.util.function.Consumer;\n\n@FunctionalInterface\npublic interface SarifParser extends Consumer<SarifParserCallback> {\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/sarif/SarifParser01And04.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.sarif;\n\nimport com.google.gson.JsonArray;\nimport com.google.gson.JsonElement;\nimport com.google.gson.JsonObject;\nimport java.util.ArrayList;\nimport java.util.Collection;\nimport java.util.Collections;\nimport java.util.function.UnaryOperator;\nimport javax.annotation.CheckForNull;\nimport javax.annotation.Nullable;\nimport org.sonar.api.scanner.fs.InputProject;\n\nclass SarifParser01And04 implements SarifParser {\n  private static final String FILE_PROTOCOL = \"file:///\";\n  private final InputProject inputProject;\n  private final JsonObject root;\n  private final UnaryOperator<String> toRealPath;\n\n  SarifParser01And04(InputProject inputProject, JsonObject root, UnaryOperator<String> toRealPath) {\n    this.inputProject = inputProject;\n    this.root = root;\n    this.toRealPath = toRealPath;\n  }\n\n  @Override\n  public void accept(SarifParserCallback callback) {\n    if (root.has(\"runLogs\")) {\n      JsonElement runLogs = root.get(\"runLogs\");\n      for (JsonElement runLogElement : runLogs.getAsJsonArray()) {\n        JsonObject runLog = runLogElement.getAsJsonObject();\n        JsonArray results = runLog.getAsJsonArray(\"results\");\n        if (results != null) {\n          handleIssues(results, false, callback);\n        }\n      }\n    } else if (root.has(\"issues\")) {\n      JsonElement issues = root.get(\"issues\");\n      handleIssues(issues.getAsJsonArray(), true, callback);\n    }\n  }\n\n  private void handleIssues(JsonArray issues, boolean offsetStartAtZero, SarifParserCallback callback) {\n    for (JsonElement issueElement : issues) {\n      JsonObject issue = issueElement.getAsJsonObject();\n      handleIssue(issue, offsetStartAtZero, callback);\n    }\n  }\n\n  private void handleIssue(JsonObject issue, boolean offsetStartAtZero, SarifParserCallback callback) {\n    if (isSuppressed(issue)) {\n      return;\n    }\n\n    String ruleId = issue.get(\"ruleId\").getAsString();\n    String message = issue.get(issue.has(\"shortMessage\") ? \"shortMessage\" : \"fullMessage\").getAsString();\n\n    JsonArray locationsArray = issue.getAsJsonArray(\"locations\");\n    if (locationsArray.size() == 0) {\n      callback.onProjectIssue(ruleId, null, inputProject, message);\n      return;\n    }\n\n    JsonObject primaryLocationObject = getAnalysisTargetAt(locationsArray, 0);\n    if (primaryLocationObject == null) {\n      callback.onProjectIssue(ruleId, null, inputProject, message);\n      return;\n    }\n\n    String primaryLocationPath = toRealPath.apply(uriToAbsolutePath(primaryLocationObject.get(\"uri\").getAsString()));\n    Location primaryLocation = getLocation(offsetStartAtZero, primaryLocationObject, primaryLocationPath, message);\n    if (primaryLocation == null) {\n      callback.onFileIssue(ruleId, null, primaryLocationPath, Collections.emptyList(), message);\n      return;\n    }\n\n    Collection<Location> secondaryLocations = new ArrayList<>();\n    for (int i = 1; i < locationsArray.size(); i++) {\n      JsonObject secondaryLocationObject = getAnalysisTargetAt(locationsArray, i);\n      if (secondaryLocationObject != null) {\n        String secondaryLocationPath = toRealPath.apply(uriToAbsolutePath(secondaryLocationObject.get(\"uri\").getAsString()));\n        Location secondaryLocation = getLocation(offsetStartAtZero, secondaryLocationObject, secondaryLocationPath, getSecondaryMessage(issue, i - 1));\n        if (secondaryLocation != null) {\n          secondaryLocations.add(secondaryLocation);\n        }\n      }\n    }\n\n    callback.onIssue(ruleId, null, primaryLocation, secondaryLocations, false);\n  }\n\n  @CheckForNull\n  private static String getSecondaryMessage(JsonObject issue, int index) {\n    JsonObject properties = issue.getAsJsonObject(\"properties\");\n    if (properties == null) {\n      return null;\n    }\n\n    JsonElement messageElement = properties.get(\"customProperties.\" + index);\n    if (messageElement == null) {\n      return null;\n    }\n\n    return messageElement.getAsString();\n  }\n\n  @CheckForNull\n  private static JsonObject getAnalysisTargetAt(JsonArray locationsArray, int index) {\n    JsonObject analysisTargetWrapper = locationsArray.get(index).getAsJsonObject();\n\n    JsonArray analysisTargetArray = analysisTargetWrapper.getAsJsonArray(\"analysisTarget\");\n    if (analysisTargetArray == null || analysisTargetArray.size() == 0) {\n      return null;\n    }\n\n    return analysisTargetArray.get(0).getAsJsonObject();\n  }\n\n  private static Location getLocation(boolean offsetStartAtZero, JsonObject analysisTarget, String absolutePath, @Nullable String message) {\n    JsonObject region = analysisTarget.getAsJsonObject(\"region\");\n    int startLine = region.get(\"startLine\").getAsInt();\n    int startLineFixed = offsetStartAtZero ? (startLine + 1) : startLine;\n\n    JsonElement startColumnOrNull = region.get(\"startColumn\");\n    int startColumn = startColumnOrNull != null ? startColumnOrNull.getAsInt() : 1;\n    int startLineOffset = offsetStartAtZero ? startColumn : (startColumn - 1);\n\n    JsonElement lengthOrNull = region.get(\"length\");\n    if (lengthOrNull != null) {\n      return new Location(absolutePath, message, startLineFixed, startLineOffset, startLineFixed, startLineOffset + lengthOrNull.getAsInt());\n    }\n\n    JsonElement endLineOrNull = region.get(\"endLine\");\n    int endLine = endLineOrNull != null ? endLineOrNull.getAsInt() : startLine;\n    int endLineFixed = offsetStartAtZero ? (endLine + 1) : endLine;\n\n    JsonElement endColumnOrNull = region.get(\"endColumn\");\n    int endColumn;\n    if (endColumnOrNull != null) {\n      endColumn = endColumnOrNull.getAsInt();\n    } else if (endLineOrNull != null) {\n      endColumn = endLine == startLine ? startColumn : 1;\n    } else {\n      endColumn = startColumn;\n    }\n\n    int endLineOffset = offsetStartAtZero ? endColumn : (endColumn - 1);\n\n    if (startLine == endLine && startLineOffset == endLineOffset) {\n      if (startLine == 1) {\n        // File level issue\n        return null;\n      } else if (startLineOffset == 0) {\n        endLineOffset++;\n      } else {\n        startLineOffset--;\n      }\n    }\n\n    return new Location(absolutePath, message, startLineFixed, startLineOffset, endLineFixed, endLineOffset);\n  }\n\n  private static boolean isSuppressed(JsonObject issue) {\n    JsonElement isSuppressedInSource = issue.get(\"isSuppressedInSource\");\n    if (isSuppressedInSource != null) {\n      return isSuppressedInSource.getAsBoolean();\n    }\n\n    JsonElement properties = issue.get(\"properties\");\n    if (properties != null && properties.isJsonObject()) {\n      isSuppressedInSource = properties.getAsJsonObject().get(\"isSuppressedInSource\");\n      if (isSuppressedInSource != null) {\n        return isSuppressedInSource.getAsBoolean();\n      }\n    }\n\n    return false;\n  }\n\n  private static String uriToAbsolutePath(String uri) {\n    if (!uri.startsWith(FILE_PROTOCOL)) {\n      return uri;\n    }\n\n    return uri.substring(FILE_PROTOCOL.length()).replace('/', '\\\\');\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/sarif/SarifParser10.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.sarif;\n\nimport com.google.gson.Gson;\nimport com.google.gson.JsonArray;\nimport com.google.gson.JsonElement;\nimport com.google.gson.JsonObject;\nimport com.google.gson.reflect.TypeToken;\nimport java.io.File;\nimport java.net.URI;\nimport java.util.ArrayList;\nimport java.util.Collection;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Map.Entry;\nimport java.util.function.UnaryOperator;\nimport javax.annotation.CheckForNull;\nimport javax.annotation.Nullable;\nimport org.sonar.api.scanner.fs.InputProject;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\nclass SarifParser10 implements SarifParser {\n  private static final Logger LOG = LoggerFactory.getLogger(SarifParser10.class);\n  private static final String PROPERTIES_PROP = \"properties\";\n  private static final String SECONDARY_LOCATION_AS_EXECUTION_FLOW = \"secondaryLocationAsExecutionFlow\";\n  private static final String LEVEL_PROP = \"level\";\n  private final InputProject inputProject;\n  private final JsonObject root;\n  private final UnaryOperator<String> toRealPath;\n\n  SarifParser10(InputProject inputProject, JsonObject root, UnaryOperator<String> toRealPath) {\n    this.inputProject = inputProject;\n    this.root = root;\n    this.toRealPath = toRealPath;\n  }\n\n  @Override\n  public void accept(SarifParserCallback callback) {\n    if (!root.has(\"runs\")) {\n      return;\n    }\n\n    for (JsonElement runElement : root.get(\"runs\").getAsJsonArray()) {\n      JsonObject run = runElement.getAsJsonObject();\n      // Process rules first\n      if (run.has(\"rules\")) {\n        handleRules(run.getAsJsonObject(\"rules\"), callback);\n      }\n      if (run.has(\"results\")) {\n        handleIssues(run.getAsJsonArray(\"results\"), callback);\n      }\n    }\n  }\n\n  private static void handleRules(JsonObject rules, SarifParserCallback callback) {\n    for (Entry<String, JsonElement> ruleEl : rules.entrySet()) {\n      JsonObject ruleObj = ruleEl.getValue().getAsJsonObject();\n      handleRule(ruleObj, callback);\n    }\n  }\n\n  private static void handleRule(JsonObject ruleObj, SarifParserCallback callback) {\n    String ruleId = ruleObj.get(\"id\").getAsString();\n    String shortDescription = ruleObj.has(\"shortDescription\") ? ruleObj.get(\"shortDescription\").getAsString() : null;\n    String fullDescription = ruleObj.has(\"fullDescription\") ? ruleObj.get(\"fullDescription\").getAsString() : null;\n    String defaultLevel = ruleObj.has(\"defaultLevel\") ? ruleObj.get(\"defaultLevel\").getAsString() : \"warning\";\n    String category = null;\n    if (ruleObj.has(PROPERTIES_PROP)) {\n      JsonObject props = ruleObj.getAsJsonObject(PROPERTIES_PROP);\n      if (props.has(\"category\")) {\n        category = props.get(\"category\").getAsString();\n      }\n    }\n    callback.onRule(ruleId, shortDescription, fullDescription, defaultLevel, category);\n  }\n\n  private void handleIssues(JsonArray results, SarifParserCallback callback) {\n    for (JsonElement resultEl : results) {\n      JsonObject resultObj = resultEl.getAsJsonObject();\n      handleIssue(resultObj, callback);\n    }\n  }\n\n  private void handleIssue(JsonObject resultObj, SarifParserCallback callback) {\n    if (isSuppressed(resultObj)) {\n      return;\n    }\n\n    String ruleId = resultObj.get(\"ruleId\").getAsString();\n    String message = resultObj.has(\"message\") ? resultObj.get(\"message\").getAsString() : null;\n    if (message == null) {\n      LOG.warn(\"Issue raised without a message for rule {}. Content: {}.\", ruleId, resultObj);\n      return;\n    }\n\n    String level = resultObj.has(LEVEL_PROP) ? resultObj.get(LEVEL_PROP).getAsString() : null;\n    if (!handleLocationsElement(resultObj, ruleId, message, callback)) {\n      callback.onProjectIssue(ruleId, level, inputProject, message);\n    }\n  }\n\n  private boolean handleLocationsElement(JsonObject resultObj, String ruleId, String message, SarifParserCallback callback) {\n    if (!resultObj.has(\"locations\")) {\n      return false;\n    }\n\n    String level = resultObj.has(LEVEL_PROP) ? resultObj.get(LEVEL_PROP).getAsString() : null;\n\n    JsonArray locations = resultObj.getAsJsonArray(\"locations\");\n    if (locations.size() != 1) {\n      return false;\n    }\n\n    JsonArray relatedLocations = new JsonArray();\n    boolean relatedLocationAsExecutionFlow = false;\n    if (resultObj.has(\"relatedLocations\")) {\n      relatedLocations = resultObj.getAsJsonArray(\"relatedLocations\");\n    }\n    Map<String, String> messageMap = new HashMap<>();\n    if (resultObj.has(PROPERTIES_PROP)) {\n      JsonObject properties = resultObj.getAsJsonObject(PROPERTIES_PROP);\n      if (properties.has(\"customProperties\")) {\n        messageMap = new Gson().fromJson(properties.get(\"customProperties\"), new TypeToken<Map<String, String>>() {\n        }.getType());\n        relatedLocationAsExecutionFlow = !relatedLocations.isEmpty() && Boolean.parseBoolean(messageMap.remove(SECONDARY_LOCATION_AS_EXECUTION_FLOW));\n      }\n    }\n\n    JsonObject firstIssueLocation = locations.get(0).getAsJsonObject().getAsJsonObject(\"resultFile\");\n    return handleResultFileElement(ruleId, level, message, firstIssueLocation, relatedLocations, messageMap, relatedLocationAsExecutionFlow, callback);\n  }\n\n  private boolean handleResultFileElement(String ruleId, @Nullable String level, String message, JsonObject resultFileObj, JsonArray relatedLocations,\n    Map<String, String> messageMap, boolean relatedLocationAsExecutionFlow, SarifParserCallback callback) {\n    if (!resultFileObj.has(\"uri\") || !resultFileObj.has(\"region\")) {\n      return false;\n    }\n\n    Collection<Location> secondaryLocations = new ArrayList<>();\n    for (JsonElement relatedLocationEl : relatedLocations) {\n      JsonObject relatedLocationObj = relatedLocationEl.getAsJsonObject().getAsJsonObject(\"physicalLocation\");\n      if (!relatedLocationObj.has(\"uri\")) {\n        return false;\n      }\n      String secondaryMessage = messageMap.getOrDefault(String.valueOf(secondaryLocations.size()), null);\n      Location secondaryLocation = handleLocation(relatedLocationObj, secondaryMessage);\n      if (secondaryLocation == null) {\n        return false;\n      }\n      secondaryLocations.add(secondaryLocation);\n    }\n\n    Location primaryLocation = handleLocation(resultFileObj, message);\n    if (primaryLocation == null) {\n      String uri = resultFileObj.get(\"uri\").getAsString();\n      String path = toRealPath.apply(uriToPath(uri));\n      if (relatedLocationAsExecutionFlow) {\n        LOG.warn(\"Unexpected file issue with an execution flow for rule {}. File: {}\", ruleId, path);\n      }\n      callback.onFileIssue(ruleId, level, path, secondaryLocations, message);\n    } else {\n      callback.onIssue(ruleId, level, primaryLocation, secondaryLocations, relatedLocationAsExecutionFlow);\n    }\n\n    return true;\n  }\n\n  @CheckForNull\n  private Location handleLocation(JsonObject locationObj, String message) {\n    String uri = locationObj.get(\"uri\").getAsString();\n    String path = toRealPath.apply(uriToPath(uri));\n    JsonObject region = locationObj.get(\"region\").getAsJsonObject();\n    int startLine = region.get(\"startLine\").getAsInt();\n\n    JsonElement startColumnOrNull = region.get(\"startColumn\");\n    int startColumn = startColumnOrNull != null ? startColumnOrNull.getAsInt() : 1;\n    int startLineOffset = startColumn - 1;\n\n    JsonElement lengthOrNull = region.get(\"length\");\n    if (lengthOrNull != null) {\n      return new Location(path, message, startLine, startLineOffset, startLine, startLineOffset + lengthOrNull.getAsInt());\n    }\n\n    JsonElement endLineOrNull = region.get(\"endLine\");\n    int endLine = endLineOrNull != null ? endLineOrNull.getAsInt() : startLine;\n\n    JsonElement endColumnOrNull = region.get(\"endColumn\");\n    int endColumn;\n    if (endColumnOrNull != null) {\n      endColumn = endColumnOrNull.getAsInt();\n    } else if (endLineOrNull != null) {\n      endColumn = endLine == startLine ? startColumn : 1;\n    } else {\n      endColumn = startColumn;\n    }\n\n    int endLineOffset = endColumn - 1;\n\n    if (startLine == endLine && startLineOffset == endLineOffset) {\n      if (startLine == 1) {\n        // File level issue\n        return null;\n      } else if (startLineOffset == 0) {\n        endLineOffset++;\n      } else {\n        startLineOffset--;\n      }\n    }\n\n    return new Location(path, message, startLine, startLineOffset, endLine, endLineOffset);\n  }\n\n  private static boolean isSuppressed(JsonObject resultObj) {\n    JsonArray suppressionStates = resultObj.getAsJsonArray(\"suppressionStates\");\n    if (suppressionStates != null) {\n      for (JsonElement entry : suppressionStates) {\n        if (\"suppressedInSource\".equals(entry.getAsString())) {\n          return true;\n        }\n      }\n    }\n\n    return false;\n  }\n\n  private static String uriToPath(String uri) {\n    String uriEscaped = uri.replace(\"[\", \"%5B\").replace(\"]\", \"%5D\");\n    String uriPath = URI.create(uriEscaped).getPath();\n    File file = new File(uriPath);\n\n    return file.isAbsolute()\n      ? file.getAbsolutePath()\n      : file.getPath();\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/sarif/SarifParserCallback.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.sarif;\n\nimport java.util.Collection;\nimport javax.annotation.Nullable;\nimport org.sonar.api.scanner.fs.InputProject;\n\npublic interface SarifParserCallback {\n\n  void onProjectIssue(String ruleId, @Nullable String level, InputProject inputProject, String message);\n\n  void onFileIssue(String ruleId, @Nullable String level, String absolutePath, Collection<Location> secondaryLocations, String message);\n\n  void onIssue(String ruleId, @Nullable String level, Location primaryLocation, Collection<Location> secondaryLocations, boolean withExecutionFlow);\n\n  void onRule(String ruleId, @Nullable String shortDescription, @Nullable String fullDescription, String defaultLevel, @Nullable String category);\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/sarif/SarifParserFactory.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.sarif;\n\nimport com.google.gson.JsonObject;\nimport com.google.gson.JsonParser;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.nio.charset.StandardCharsets;\nimport java.nio.file.Files;\nimport java.util.function.UnaryOperator;\nimport org.sonarsource.dotnet.shared.plugins.RoslynReport;\n\npublic class SarifParserFactory {\n  private SarifParserFactory() {\n    // private\n  }\n\n  public static SarifParser create(RoslynReport report, UnaryOperator<String> toRealPath) {\n    try (InputStreamReader reader = new InputStreamReader(Files.newInputStream(report.getReportPath()), StandardCharsets.UTF_8)) {\n\n      JsonParser parser = new JsonParser();\n      JsonObject root = parser.parse(reader).getAsJsonObject();\n      if (root.has(\"version\")) {\n        String version = root.get(\"version\").getAsString();\n\n        return switch (version) {\n          case \"0.4\", \"0.1\" -> new SarifParser01And04(report.getProject(), root, toRealPath);\n          default -> new SarifParser10(report.getProject(), root, toRealPath);\n        };\n      }\n    } catch (IOException e) {\n      throw new IllegalStateException(\"Unable to read the Roslyn SARIF report file: \" + report.getReportPath().toAbsolutePath(), e);\n    }\n\n    throw new IllegalStateException(String.format(\"Unable to parse the Roslyn SARIF report file: %s. Unrecognized format\", report.getReportPath().toAbsolutePath()));\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/java/org/sonarsource/dotnet/shared/sarif/package-info.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n@ParametersAreNonnullByDefault\npackage org.sonarsource.dotnet.shared.sarif;\n\nimport javax.annotation.ParametersAreNonnullByDefault;\n\n"
  },
  {
    "path": "sonar-dotnet-core/src/main/protobuf/.gitignore",
    "content": "*.proto\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonar/plugins/dotnet/tests/NUnitTestResultsParserTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests;\n\nimport java.io.File;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.slf4j.event.Level;\nimport org.sonar.api.testfixtures.log.LogTester;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.assertThrows;\n\npublic class NUnitTestResultsParserTest {\n\n  @Rule\n  public LogTester logTester = new LogTester();\n\n  @Before\n  public void before() {\n    logTester.setLevel(Level.DEBUG);\n  }\n\n  @Test\n  public void valid_nunit3() {\n    Map<String, UnitTestResults> results = new HashMap<>();\n\n    Map<String, String> fileMap = new HashMap<>() {\n      {\n        put(\"NUnitTestProj.NUnitTestProject.UnitTest1.NUnitTestMethod1\", \"C:\\\\dev\\\\Playground\\\\NUnit\\\\UnitTest1.cs\");\n        put(\"NUnitTestProj.NUnitTestProject.UnitTest1.NUnitTestShouldFail\", \"C:\\\\dev\\\\Playground\\\\NUnit\\\\UnitTest1.cs\");\n        put(\"NUnitTestProj.NUnitTestProject.UnitTest1.NUnitTestShouldSkip\", \"C:\\\\dev\\\\Playground\\\\NUnit\\\\UnitTest1.cs\");\n        put(\"NUnitTestProj.NUnitTestProject.UnitTest1.NUnitTestShouldError\", \"C:\\\\dev\\\\Playground\\\\NUnit\\\\UnitTest1.cs\");\n\n        put(\"mock-assembly.NUnit.Tests.Assemblies.MockTestFixture.FailingTest\", \"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\");\n        put(\"mock-assembly.NUnit.Tests.Assemblies.MockTestFixture.MockTest1\", \"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\");\n        put(\"mock-assembly.NUnit.Tests.Assemblies.MockTestFixture.MockTest2\", \"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\");\n        put(\"mock-assembly.NUnit.Tests.Assemblies.MockTestFixture.MockTest3\", \"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\");\n        put(\"mock-assembly.NUnit.Tests.Assemblies.MockTestFixture.MockTest4\", \"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\");\n        put(\"mock-assembly.NUnit.Tests.Assemblies.MockTestFixture.MockTest5\", \"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\");\n        put(\"mock-assembly.NUnit.Tests.Assemblies.MockTestFixture.NotRunnableTest\", \"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\");\n        put(\"mock-assembly.NUnit.Tests.Assemblies.MockTestFixture.TestWithException\", \"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\");\n        put(\"mock-assembly.NUnit.Tests.Assemblies.MockTestFixture.BadFixture\", \"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\");\n        put(\"mock-assembly.NUnit.Tests.FixtureWithTestCases.MethodWithParameters\", \"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\");\n        put(\"mock-assembly.NUnit.Tests.Assemblies.MockTestFixture.InconclusiveTest\", \"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\");\n        put(\"mock-assembly.NUnit.Tests.Assemblies.MockTestFixture.TestWithManyProperties\", \"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\");\n        put(\"mock-assembly.NUnit.Tests.ParameterizedFixture\", \"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\");\n        put(\"mock-assembly.NUnit.Tests.Singletons.OneTestCase.TestCase\", \"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\");\n        put(\"mock-assembly.NUnit.Tests.TestAssembly.MockTestFixture.MyTest\", \"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\");\n      }\n    };\n    var sut = new NUnitTestResultsParser();\n\n    sut.parse(new File(\"src/test/resources/NUnit/valid_nunit3.xml\"), results, fileMap);\n\n    assertThat(results).hasSize(2);\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\NUnit\\\\UnitTest1.cs\").tests()).isEqualTo(4);\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\NUnit\\\\UnitTest1.cs\").failures()).isEqualTo(1);\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\NUnit\\\\UnitTest1.cs\").skipped()).isEqualTo(1);\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\NUnit\\\\UnitTest1.cs\").errors()).isEqualTo(1);\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\NUnit\\\\UnitTest1.cs\").executionTime()).isEqualTo(37);\n\n    assertThat(results.get(\"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\").tests()).isEqualTo(18);\n    assertThat(results.get(\"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\").failures()).isEqualTo(1);\n    assertThat(results.get(\"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\").skipped()).isEqualTo(4);\n    assertThat(results.get(\"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\").errors()).isEqualTo(1);\n    assertThat(results.get(\"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\").executionTime()).isEqualTo(33);\n\n    List<String> infoLogs = logTester.logs(Level.INFO);\n    assertThat(infoLogs).hasSize(1);\n    assertThat(infoLogs.get(0)).startsWith(\"Parsing the NUnit Test Results file \");\n\n    List<String> debugLogs = logTester.logs(Level.DEBUG);\n    assertThat(debugLogs)\n      .hasSize(24)\n      .contains(\n        \"NUnit Assembly found, assembly: C:\\\\dev\\\\Playground\\\\NUnit\\\\bin\\\\Debug\\\\net9.0\\\\NUnitTestProj.dll, Extracted dllName: NUnitTestProj\",\n        \"Added Test Method: NUnitTestProj.NUnitTestProject.UnitTest1.NUnitTestMethod1 to File: C:\\\\dev\\\\Playground\\\\NUnit\\\\UnitTest1.cs\",\n        \"NUnit Assembly found, assembly: D:\\\\Dev\\\\NUnit\\\\nunit-3.0\\\\work\\\\bin\\\\vs2008\\\\Debug\\\\mock-assembly.dll, Extracted dllName: mock-assembly\"\n      );\n  }\n\n  @Test\n  public void valid_nunit2() {\n    Map<String, UnitTestResults> results = new HashMap<>();\n    var sut = new NUnitTestResultsParser();\n\n    Map<String, String> fileMap = new HashMap<>() {\n      {\n        put(\"mock-assembly.NUnit.Tests.Assemblies.MockTestFixture.FailingTest\", \"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\");\n        put(\"mock-assembly.NUnit.Tests.Assemblies.MockTestFixture.InconclusiveTest\", \"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\");\n        put(\"mock-assembly.NUnit.Tests.Assemblies.MockTestFixture.MockTest1\", \"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\");\n        put(\"mock-assembly.NUnit.Tests.Assemblies.MockTestFixture.MockTest2\", \"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\");\n        put(\"mock-assembly.NUnit.Tests.Assemblies.MockTestFixture.MockTest3\", \"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\");\n        put(\"mock-assembly.NUnit.Tests.Assemblies.MockTestFixture.MockTest4\", \"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\");\n        put(\"mock-assembly.NUnit.Tests.Assemblies.MockTestFixture.MockTest5\", \"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\");\n        put(\"mock-assembly.NUnit.Tests.Assemblies.MockTestFixture.NotRunnableTest\", \"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\");\n        put(\"mock-assembly.NUnit.Tests.Assemblies.MockTestFixture.TestWithException\", \"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\");\n        put(\"mock-assembly.NUnit.Tests.FixtureWithTestCases.MethodWithParameters\", \"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\");\n        put(\"mock-assembly.NUnit.Tests.Assemblies.MockTestFixture.TestWithManyProperties\", \"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\");\n        put(\"mock-assembly.NUnit.Tests.ParameterizedFixture\", \"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\");\n        put(\"mock-assembly.NUnit.Tests.FixtureWithTestCases.GenericMethod\", \"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\");\n        put(\"mock-assembly.NUnit.Tests.GenericFixture\", \"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\");\n        put(\"mock-assembly.NUnit.Tests.IgnoredFixture.Test1\", \"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\");\n        put(\"mock-assembly.NUnit.Tests.IgnoredFixture.Test2\", \"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\");\n        put(\"mock-assembly.NUnit.Tests.IgnoredFixture.Test3\", \"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\");\n        put(\"mock-assembly.NUnit.Tests.BadFixture.SomeTest\", \"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\");\n        put(\"mock-assembly.NUnit.Tests.Singletons.OneTestCase.TestCase\", \"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\");\n        put(\"mock-assembly.NUnit.Tests.TestAssembly.MockTestFixture.MyTest\", \"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\");\n      }\n    };\n\n    sut.parse(new File(\"src/test/resources/NUnit/valid_nunit2.xml\"), results, fileMap);\n\n    assertThat(results).hasSize(1);\n    assertThat(results.get(\"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\").tests()).isEqualTo(28);\n    assertThat(results.get(\"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\").failures()).isEqualTo(1);\n    assertThat(results.get(\"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\").skipped()).isEqualTo(8);\n    assertThat(results.get(\"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\").errors()).isEqualTo(1);\n    assertThat(results.get(\"D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\").executionTime()).isEqualTo(27);\n\n    var warnings = logTester.logs(Level.WARN);\n    assertThat(warnings).isEmpty();\n\n    List<String> infoLogs = logTester.logs(Level.INFO);\n    assertThat(infoLogs).hasSize(1);\n    assertThat(infoLogs.get(0)).startsWith(\"Parsing the NUnit Test Results file \");\n\n    List<String> debugLogs = logTester.logs(Level.DEBUG);\n    assertThat(debugLogs)\n      .hasSize(29)\n      .contains(\n        \"Added Test Method: mock-assembly.NUnit.Tests.Assemblies.MockTestFixture.MockTest2 to File: D:\\\\Dev\\\\NUnit\\\\OtherTests.cs\",\n        \"NUnit Assembly found, assembly: \\\\home\\\\charlie\\\\Dev\\\\NUnit\\\\nunit-2.5\\\\work\\\\src\\\\bin\\\\Debug\\\\tests\\\\mock-assembly.dll, Extracted dllName: mock-assembly\"\n      );\n }\n\n  @Test\n  public void valid_no_execution_time() {\n    Map<String, UnitTestResults> results = new HashMap<>();\n\n    var sut = new NUnitTestResultsParser();\n\n    sut.parse(new File(\"src/test/resources/NUnit/valid_no_execution_time.xml\"), results, Map.of(\"NUnitTestProj.NUnitTestProject.UnitTest1.NUnitTestMethod1\", \"C:\\\\dev\\\\Playground\\\\NUnit\\\\UnitTest1.cs\"));\n\n    assertThat(results).hasSize(1);\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\NUnit\\\\UnitTest1.cs\").tests()).isEqualTo(1);\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\NUnit\\\\UnitTest1.cs\").failures()).isZero();\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\NUnit\\\\UnitTest1.cs\").skipped()).isZero();\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\NUnit\\\\UnitTest1.cs\").errors()).isZero();\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\NUnit\\\\UnitTest1.cs\").executionTime()).isNull();\n\n    List<String> infoLogs = logTester.logs(Level.INFO);\n    assertThat(infoLogs).hasSize(1);\n    assertThat(infoLogs.get(0)).startsWith(\"Parsing the NUnit Test Results file \");\n\n    List<String> debugLogs = logTester.logs(Level.DEBUG);\n    assertThat(debugLogs)\n      .hasSize(2)\n      .contains(\n        \"Added Test Method: NUnitTestProj.NUnitTestProject.UnitTest1.NUnitTestMethod1 to File: C:\\\\dev\\\\Playground\\\\NUnit\\\\UnitTest1.cs\",\n        \"NUnit Assembly found, assembly: C:\\\\dev\\\\Playground\\\\NUnit\\\\bin\\\\Debug\\\\net9.0\\\\NUnitTestProj.dll, Extracted dllName: NUnitTestProj\"\n      );\n  }\n\n  @Test\n  public void valid_inheritance() {\n    Map<String, UnitTestResults> results = new HashMap<>();\n\n    Map<String, String> fileMap = new HashMap<>() {\n      {\n        put(\"MudBlazor.UnitTests.MudBlazor.UnitTests.Utilities.AsyncKeyedLock.AsyncKeyedLockNonPooledTests.Async.ThreeDifferentLocksShouldWork\", \"AsyncKeyedLockNonPooledTests.cs\");\n        put(\"MudBlazor.UnitTests.MudBlazor.UnitTests.Utilities.AsyncKeyedLock.AsyncKeyedLockNonPooledTests.Sync.ThreeDifferentLocksShouldWork\", \"AsyncKeyedLockNonPooledTests.cs\");\n      }\n    };\n    var sut = new NUnitTestResultsParser();\n    sut.parse(new File(\"src/test/resources/NUnit/valid_inheritance.xml\"), results, fileMap);\n\n    assertThat(results).hasSize(1);\n    assertThat(results.get(\"AsyncKeyedLockNonPooledTests.cs\").tests()).isEqualTo(2);\n\n    List<String> debugLogs = logTester.logs(Level.DEBUG);\n    assertThat(debugLogs)\n      .hasSize(3)\n      .contains(\n        \"NUnit Assembly found, assembly: C:\\\\dev\\\\trash\\\\MudBlazor\\\\src\\\\MudBlazor.UnitTests\\\\bin\\\\Debug\\\\net8.0\\\\MudBlazor.UnitTests.dll, Extracted dllName: MudBlazor.UnitTests\",\n        \"Added Test Method: MudBlazor.UnitTests.MudBlazor.UnitTests.Utilities.AsyncKeyedLock.AsyncKeyedLockNonPooledTests.Async.ThreeDifferentLocksShouldWork to File: AsyncKeyedLockNonPooledTests.cs\",\n        \"Added Test Method: MudBlazor.UnitTests.MudBlazor.UnitTests.Utilities.AsyncKeyedLock.AsyncKeyedLockNonPooledTests.Sync.ThreeDifferentLocksShouldWork to File: AsyncKeyedLockNonPooledTests.cs\"\n      );\n  }\n\n  @Test\n  public void valid_comma_in_double()\n  {\n    Map<String, UnitTestResults> results = new HashMap<>();\n\n    var sut = new NUnitTestResultsParser();\n\n    sut.parse(new File(\"src/test/resources/NUnit/valid_comma_in_double.xml\"), results, Map.of(\"NUnitTestProj.NUnitTestProject.UnitTest1.CommaInDouble\", \"C:\\\\dev\\\\Playground\\\\NUnit\\\\UnitTest1.cs\"));\n\n    assertThat(results).hasSize(1);\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\NUnit\\\\UnitTest1.cs\").tests()).isEqualTo(1);\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\NUnit\\\\UnitTest1.cs\").failures()).isZero();\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\NUnit\\\\UnitTest1.cs\").skipped()).isZero();\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\NUnit\\\\UnitTest1.cs\").errors()).isZero();\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\NUnit\\\\UnitTest1.cs\").executionTime()).isEqualTo(1041);\n\n    List<String> infoLogs = logTester.logs(Level.INFO);\n    assertThat(infoLogs).hasSize(1);\n    assertThat(infoLogs.get(0)).startsWith(\"Parsing the NUnit Test Results file \");\n\n    List<String> debugLogs = logTester.logs(Level.DEBUG);\n    assertThat(debugLogs)\n      .hasSize(2)\n      .contains(\n        \"Added Test Method: NUnitTestProj.NUnitTestProject.UnitTest1.CommaInDouble to File: C:\\\\dev\\\\Playground\\\\NUnit\\\\UnitTest1.cs\",\n        \"NUnit Assembly found, assembly: C:\\\\dev\\\\Playground\\\\NUnit\\\\bin\\\\Debug\\\\net9.0\\\\NUnitTestProj.dll, Extracted dllName: NUnitTestProj\"\n      );\n  }\n\n  @Test\n  public void test_name_not_mapped() {\n    var sut = new NUnitTestResultsParser();\n    var file = new File(\"src/test/resources/NUnit/test_name_not_mapped.xml\");\n\n    sut.parse(file, new HashMap<>(), Map.of(\"Some.Other.TestMethod\", \"C:\\\\dev\\\\Playground\\\\NUnit.Test\\\\Sample.cs\"));\n\n    List<String> debugLogs = logTester.logs(Level.DEBUG);\n    assertThat(debugLogs).hasSize(2);\n    assertThat(debugLogs.get(1)).isEqualTo(\"Test method NUnitTestProj.NUnitTestProject.UnitTest1.TestMethodDoesNotExist cannot be mapped to the test source file. The test will not be included.\");\n  }\n\n  @Test\n  public void invalid_root() {\n    var sut = new NUnitTestResultsParser();\n    var file = new File(\"src/test/resources/NUnit/invalid_root.xml\");\n\n    var exception = assertThrows(ParseErrorException.class, () -> sut.parse(file, new HashMap<>(), new HashMap<>()));\n    assertThat(exception.getMessage()).startsWith(\"Missing or incorrect root element. Expected one of [<test-run>, <test-results>], but got <foo> instead\");\n  }\n\n  @Test\n  public void invalid_test_outcome() {\n    var sut = new NUnitTestResultsParser();\n    var file = new File(\"src/test/resources/NUnit/invalid_test_outcome.xml\");\n\n    var exception = assertThrows(IllegalArgumentException.class, () -> sut.parse(file,new HashMap<>(), Map.of(\"NUnitTestProj.NUnitTestProject.UnitTest1.InvalidOutcome\", \"C:\\\\dev\\\\Playground\\\\Playground.Test\\\\Sample.cs\")));\n    assertEquals(\"Outcome of unit test must match NUnit Test Format\", exception.getMessage());\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonar/plugins/dotnet/tests/PathSuffixPredicateTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests;\n\nimport java.net.URI;\nimport java.net.URISyntaxException;\nimport java.util.Arrays;\nimport java.util.Collection;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.junit.runners.Parameterized;\nimport org.sonar.api.batch.fs.InputFile;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\n@RunWith(Parameterized.class)\npublic class PathSuffixPredicateTest {\n\n  private String pathSuffix;\n  private String absolutePath;\n  private boolean expectedResult;\n\n  public PathSuffixPredicateTest(String pathSuffix, String absolutePath, boolean expectedResult) {\n    this.pathSuffix = pathSuffix;\n    this.absolutePath = absolutePath;\n    this.expectedResult = expectedResult;\n  }\n\n  @Parameterized.Parameters\n  public static Collection input() {\n    return Arrays.asList(new Object[][] {\n        // Match\n        {\"\", \"\", true},\n        {\"\", \"file.cs\", true},\n        {\"some/path/file.cs\", \"/_/some/path/file.cs\", true},\n        {\"some/path/file.cs\", \"/_/X/Y/some/path/file.cs\", true},\n        {\"some/path/file.cs\", \"/home/test/long/path/some/path/file.cs\", true},\n        {\"some/path/file.cs\", \"some/path/file.cs\", true},\n        // No match\n        {\"some/PATH/file.cs\", \"some/path/file.cs\", false},\n        {\"some/path/file.cs\", \"some/PATH/file.cs\", false},\n        {\"some/path/file.cs\", \"/_/some/PATH/file.cs\", false},\n        {\"some/path/file.cs\", \"/path/file.cs\", false},\n        {\"file.cs\", \"\", false},\n        {\"foo\", \"bar\", false},\n        {\"foo\", \"\", false},\n        {\"\\\\some\\\\path\\\\file.cs\", \"/some/path/file.cs\", false}\n      }\n    );\n  }\n\n  @Test\n  public void test_apply() throws URISyntaxException {\n    PathSuffixPredicate predicate = new PathSuffixPredicate(pathSuffix);\n    assertThat(predicate.apply(mockInput(absolutePath))).isEqualTo(expectedResult);\n  }\n\n  private InputFile mockInput(String path) throws URISyntaxException {\n    URI uri = new URI(path);\n    InputFile inputFile = mock(InputFile.class);\n    when(inputFile.uri()).thenReturn(uri);\n    return inputFile;\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonar/plugins/dotnet/tests/ScannerFileServiceTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests;\n\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.Optional;\nimport java.util.stream.Collectors;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.mockito.ArgumentCaptor;\nimport org.sonar.api.batch.fs.FilePredicate;\nimport org.sonar.api.batch.fs.FilePredicates;\nimport org.sonar.api.batch.fs.FileSystem;\nimport org.sonar.api.batch.fs.InputFile;\nimport org.sonar.api.batch.fs.internal.TestInputFileBuilder;\nimport org.sonar.api.testfixtures.log.LogTester;\nimport org.slf4j.event.Level;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.ArgumentMatchers.any;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.never;\nimport static org.mockito.Mockito.times;\nimport static org.mockito.Mockito.verify;\nimport static org.mockito.Mockito.when;\n\npublic class ScannerFileServiceTest {\n  @Rule\n  public LogTester logTester = new LogTester();\n\n  @Before\n  public void before() {\n    logTester.setLevel(Level.TRACE);\n  }\n\n  @Test\n  public void isSupportedAbsolute_passes_correct_argument() {\n    // arrange\n    FileSystem fs = mock(FileSystem.class);\n    FilePredicates filePredicates = mock(FilePredicates.class);\n\n    ArgumentCaptor<String> argumentCaptor = ArgumentCaptor.forClass(String.class);\n    when(filePredicates.hasAbsolutePath(argumentCaptor.capture())).thenReturn(mock(FilePredicate.class));\n    when(fs.predicates()).thenReturn(filePredicates);\n    when(fs.hasFiles(any())).thenReturn(true);\n\n    // act\n    ScannerFileService sut = new ScannerFileService(\"key\", fs);\n    sut.isSupportedAbsolute(\"/_/some/path/file.cs\");\n\n    // assert\n    assertThat(argumentCaptor.getValue()).isEqualTo(\"/_/some/path/file.cs\");\n    assertThat(logTester.logs()).isEmpty();\n  }\n\n  @Test\n  public void isSupportedAbsolute_returns_fileSystem_result_when_true() {\n    FileSystem fs = createFileSystemForHasFiles(true);\n\n    ScannerFileService sut = new ScannerFileService(\"key\", fs);\n    boolean result = sut.isSupportedAbsolute(\"/_/some/path/file.cs\");\n\n    assertThat(result).isTrue();\n    assertThat(logTester.logs()).isEmpty();\n  }\n\n  @Test\n  public void isSupportedAbsolute_returns_fileSystem_result_when_false() {\n    FileSystem fs = createFileSystemForHasFiles(false);\n\n    ScannerFileService sut = new ScannerFileService(\"key\", fs);\n    boolean result = sut.isSupportedAbsolute(\"/_/some/path/file.cs\");\n\n    assertThat(result).isFalse();\n    assertThat(logTester.logs()).isEmpty();\n  }\n\n  @Test\n  public void getAbsolutePath_passes_correct_arguments_to_filesystem_api() {\n    // arrange\n    FileSystem fs = mock(FileSystem.class);\n    FilePredicates filePredicates = mock(FilePredicates.class);\n    FilePredicate languageKeyMock = mock(FilePredicate.class);\n\n    when(filePredicates.hasLanguage(\"key\")).thenReturn(languageKeyMock);\n    when(fs.predicates()).thenReturn(filePredicates);\n\n    ArgumentCaptor<FilePredicate> andArg1 = ArgumentCaptor.forClass(FilePredicate.class);\n    ArgumentCaptor<FilePredicate> andArg2 = ArgumentCaptor.forClass(FilePredicate.class);\n\n    // act\n    ScannerFileService sut = new ScannerFileService(\"key\", fs);\n    sut.getAbsolutePath(\"/_/foo\");\n\n    // assert\n    verify(filePredicates).and(andArg1.capture(), andArg2.capture());\n    assertThat(andArg1.getValue()).isEqualTo(languageKeyMock);\n    Object argument = andArg2.getValue();\n    assertThat(andArg2.getValue()).isExactlyInstanceOf(PathSuffixPredicate.class);\n    PathSuffixPredicate pathPredicate = (PathSuffixPredicate) argument;\n    assertThat(pathPredicate.pathSuffix()).isEqualTo(\"foo\");\n    verify(fs).inputFiles(any());\n  }\n\n  @Test\n  public void getAbsolutePath_regex_test() {\n    // arrange\n    FileSystem fs = mock(FileSystem.class);\n    FilePredicates filePredicates = mock(FilePredicates.class);\n    when(fs.predicates()).thenReturn(filePredicates);\n    ArgumentCaptor<FilePredicate> captor = ArgumentCaptor.forClass(FilePredicate.class);\n    List<String> testInput = Arrays.asList(\n      \"/_/some/path/file.cs\",\n      \"/_1/some/path/file.cs\",\n      \"/_10/some/path/file.cs\",\n      \"\\\\_2\\\\some\\\\path\\\\file.cs\",\n      \"\\\\_1234\\\\some\\\\path\\\\file.cs\",\n      \"\\\\_9999\\\\some/path/file.cs\");\n\n    // act\n    ScannerFileService sut = new ScannerFileService(\"key\", fs);\n    testInput.forEach(sut::getAbsolutePath);\n\n    // assert\n    verify(filePredicates, times(testInput.size())).and(any(), captor.capture());\n    List<PathSuffixPredicate> predicates = captor.getAllValues().stream().map(obj -> (PathSuffixPredicate) obj).collect(Collectors.toList());\n    for (PathSuffixPredicate predicate : predicates) {\n      assertThat(predicate.pathSuffix()).isEqualTo(\"some/path/file.cs\");\n    }\n  }\n\n  @Test\n  public void getAbsolutePath_when_filesystem_returns_empty_returns_empty() {\n    FileSystem fs = createFileSystemReturningAllFiles(Collections.emptyList());\n\n    // act\n    ScannerFileService sut = new ScannerFileService(\"key\", fs);\n    Optional<String> result = sut.getAbsolutePath(\"/_/some/path/file.cs\");\n\n    // assert\n    assertThat(result).isEmpty();\n    assertThat(logTester.logs(Level.DEBUG)).containsExactly(\"The file '/_/some/path/file.cs' is not indexed or does not have the \"\n      + \"supported language. Will skip this coverage entry. Verify sonar.sources in .sonarqube\\\\out\\\\sonar-project.properties.\");\n  }\n\n  @Test\n  public void getAbsolutePath_when_multiple_indexed_files_match_returns_empty_and_logs() {\n    FileSystem fs = createFileSystemReturningAllFiles(Arrays.asList(mockInput(\"foo\"), mockInput(\"bar\")));\n\n    ScannerFileService sut = new ScannerFileService(\"key\", fs);\n    Optional<String> result = sut.getAbsolutePath(\"/_/some/path/file.cs\");\n\n    assertThat(result).isEmpty();\n    assertThat(logTester.logs(Level.DEBUG)).containsExactly(\"Found 2 indexed files for '/_/some/path/file.cs' (normalized to 'some/path/file.cs'). Will skip this coverage entry. Verify sonar.sources in .sonarqube\\\\out\\\\sonar-project.properties.\");\n  }\n\n  @Test\n  public void getAbsolutePath_when_single_indexed_files_match_returns_file_logs_trace() {\n    InputFile expectedResult = mockInput(\"root/some/path/file.cs\");\n    FileSystem fs = createFileSystemReturningAllFiles(Collections.singleton(expectedResult));\n\n    ScannerFileService sut = new ScannerFileService(\"key\", fs);\n    Optional<String> result = sut.getAbsolutePath(\"/_/path/file.cs\");\n\n    assertThat(result).hasValue(expectedResult.absolutePath());\n    assertThat(logTester.logs(Level.TRACE)).hasSize(1);\n    assertThat(logTester.logs(Level.TRACE).get(0))\n      .isEqualTo(\"Found indexed file 'mod/root/some/path/file.cs' for '/_/path/file.cs' (normalized to 'path/file.cs').\");\n  }\n\n  @Test\n  public void getAbsolutePath_with_no_deterministic_path_in_windows_path_returns_empty() {\n    FileSystem fs = mock(FileSystem.class);\n\n    ScannerFileService sut = new ScannerFileService(\"key\", fs);\n    Optional<String> result = sut.getAbsolutePath(\"C:\\\\_\\\\some\\\\path\\\\file.cs\");\n\n    assertThat(result).isEmpty();\n    verify(fs, never()).predicates();\n    assertThat(logTester.logs(Level.TRACE)).isEmpty();\n    assertThat(logTester.logs(Level.DEBUG)).hasSize(1);\n    assertThat(logTester.logs(Level.DEBUG).get(0)).isEqualTo(\"The file 'C:\\\\_\\\\some\\\\path\\\\file.cs' \"\n      + \"does not have a deterministic build path and is either not indexed or does not have a supported language. \"\n      + \"Will skip this coverage entry. Verify sonar.sources in .sonarqube\\\\out\\\\sonar-project.properties.\");\n  }\n\n  @Test\n  public void getAbsolutePath_with_no_deterministic_source_path_in_unix_path_returns_empty() {\n    FileSystem fs = mock(FileSystem.class);\n\n    ScannerFileService sut = new ScannerFileService(\"key\", fs);\n    Optional<String> result = sut.getAbsolutePath(\"some/path/file.cs\");\n\n    assertThat(result).isEmpty();\n    verify(fs, never()).predicates();\n    assertThat(logTester.logs(Level.TRACE)).isEmpty();\n  }\n\n  private FileSystem createFileSystemReturningAllFiles(Iterable<InputFile> inputFilesResult) {\n    FileSystem fs = mock(FileSystem.class);\n    when(fs.predicates()).thenReturn(mock(FilePredicates.class));\n    when(fs.inputFiles(any())).thenReturn(inputFilesResult);\n    return fs;\n  }\n\n  private FileSystem createFileSystemForHasFiles(boolean result) {\n    FileSystem fs = mock(FileSystem.class);\n    when(fs.hasFiles(any())).thenReturn(result);\n    when(fs.predicates()).thenReturn(mock(FilePredicates.class));\n    return fs;\n  }\n\n  private InputFile mockInput(String path) {\n    return new TestInputFileBuilder(\"mod\", path).setLanguage(\"cs\").build();\n  }\n\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonar/plugins/dotnet/tests/UnitTestResultsAggregatorTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests;\n\nimport java.io.File;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.HashSet;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.ExpectedException;\nimport org.mockito.Mockito;\nimport org.sonar.api.config.Configuration;\nimport org.sonar.api.config.internal.MapSettings;\nimport org.sonar.api.testfixtures.log.LogTester;\nimport org.slf4j.event.Level;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.ArgumentMatchers.any;\nimport static org.mockito.ArgumentMatchers.eq;\nimport static org.mockito.ArgumentMatchers.notNull;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.verify;\nimport static org.mockito.Mockito.when;\nimport static org.sonarsource.dotnet.protobuf.SonarAnalyzer.MethodDeclarationsInfo;\nimport static org.sonarsource.dotnet.protobuf.SonarAnalyzer.MethodDeclarationInfo;\n\npublic class UnitTestResultsAggregatorTest {\n\n  @Rule\n  public ExpectedException thrown = ExpectedException.none();\n\n  @Rule\n  public LogTester logTester = new LogTester();\n\n  @Test\n  public void hasUnitTestResultsProperty() {\n    Configuration configuration = mock(Configuration.class);\n\n    UnitTestConfiguration unitTestConf = new UnitTestConfiguration(\"visualStudioTestResultsFile\", \"nunitTestResultsFile\", \"xunitTestResultsFile\");\n\n    when(configuration.hasKey(\"visualStudioTestResultsFile\")).thenReturn(false);\n    when(configuration.hasKey(\"nunitTestResultsFile\")).thenReturn(false);\n    when(configuration.hasKey(\"xunitTestResultsFile\")).thenReturn(false);\n    assertThat(new UnitTestResultsAggregator(unitTestConf, configuration).hasUnitTestResultsProperty()).isFalse();\n\n    when(configuration.hasKey(\"visualStudioTestResultsFile\")).thenReturn(true);\n    when(configuration.hasKey(\"nunitTestResultsFile\")).thenReturn(false);\n    when(configuration.hasKey(\"xunitTestResultsFile\")).thenReturn(false);\n    assertThat(new UnitTestResultsAggregator(unitTestConf, configuration).hasUnitTestResultsProperty()).isTrue();\n\n    when(configuration.hasKey(\"visualStudioTestResultsFile\")).thenReturn(false);\n    when(configuration.hasKey(\"nunitTestResultsFile\")).thenReturn(true);\n    when(configuration.hasKey(\"xunitTestResultsFile\")).thenReturn(false);\n    assertThat(new UnitTestResultsAggregator(unitTestConf, configuration).hasUnitTestResultsProperty()).isTrue();\n\n    when(configuration.hasKey(\"visualStudioTestResultsFile\")).thenReturn(false);\n    when(configuration.hasKey(\"nunitTestResultsFile\")).thenReturn(false);\n    when(configuration.hasKey(\"xunitTestResultsFile\")).thenReturn(true);\n    assertThat(new UnitTestResultsAggregator(unitTestConf, configuration).hasUnitTestResultsProperty()).isTrue();\n\n    when(configuration.hasKey(\"visualStudioTestResultsFile\")).thenReturn(true);\n    when(configuration.hasKey(\"nunitTestResultsFile\")).thenReturn(true);\n    when(configuration.hasKey(\"xunitTestResultsFile\")).thenReturn(true);\n    assertThat(new UnitTestResultsAggregator(unitTestConf, configuration).hasUnitTestResultsProperty()).isTrue();\n\n    unitTestConf = new UnitTestConfiguration(\"visualStudioTestResultsFile2\", \"nunit2\", \"xunit2\");\n    when(configuration.hasKey(\"visualStudioTestResultsFile\")).thenReturn(true);\n    when(configuration.hasKey(\"nunitTestResultsFile\")).thenReturn(true);\n    when(configuration.hasKey(\"xunitTestResultsFile\")).thenReturn(true);\n    assertThat(new UnitTestResultsAggregator(unitTestConf, configuration).hasUnitTestResultsProperty()).isFalse();\n  }\n\n  @Test\n  public void aggregate_visual_studio_only() {\n    AggregateTestContext context = new AggregateTestContext(\"visualStudioTestResultsFile\", \"foo.trx\");\n    context.run();\n\n    verify(context.visualStudio).parse(eq(new File(\"foo.trx\")), notNull(), any());\n    verify(context.nunit, Mockito.never()).parse(any(), any(), any());\n    verify(context.xunit, Mockito.never()).parse(any(), any(), any());\n  }\n\n  @Test\n  public void aggregate_nunit_only() {\n    AggregateTestContext context = new AggregateTestContext(\"nunitTestResultsFile\", \"foo.xml\");\n    context.run();\n\n    verify(context.visualStudio, Mockito.never()).parse(any(), any(), any());\n    verify(context.nunit).parse(eq(new File(\"foo.xml\")), any(), any());\n    verify(context.xunit, Mockito.never()).parse(any(), any(), any());\n  }\n\n  @Test\n  public void aggregate_xunit_only() {\n    AggregateTestContext context = new AggregateTestContext(\"xunitTestResultsFile\", \"foo.xml\");\n    context.run();\n\n    verify(context.visualStudio, Mockito.never()).parse(any(), any(), any());\n    verify(context.nunit, Mockito.never()).parse(any(), any(), any());\n    verify(context.xunit).parse(eq(new File(\"foo.xml\")), notNull(), any());\n  }\n\n  @Test\n  public void aggregate_all_formats_configured() {\n    AggregateTestContext context = new AggregateTestContext();\n    context.add(\"visualStudioTestResultsFile\", \"vs.trx\");\n    context.add(\"nunitTestResultsFile\", \"nunit.xml\");\n    context.add(\"xunitTestResultsFile\", \"xunit.xml\");\n    context.run();\n\n    verify(context.visualStudio).parse(eq(new File(\"vs.trx\")), notNull(), any());\n    verify(context.nunit).parse(eq(new File(\"nunit.xml\")), any(), any());\n    verify(context.xunit).parse(eq(new File(\"xunit.xml\")), notNull(), any());\n  }\n\n  @Test\n  public void aggregate_none_formats_configured() {\n    AggregateTestContext context = new AggregateTestContext();\n    context.run();\n\n    verify(context.visualStudio, Mockito.never()).parse(any(), any(), any());\n    verify(context.nunit, Mockito.never()).parse(any(), any(), any());\n    verify(context.xunit, Mockito.never()).parse(any(), any(), any());\n  }\n\n  @Test\n  public void aggregate_multiple_files_configured() {\n    AggregateTestContext context = new AggregateTestContext();\n    context.settings.setProperty(\"visualStudioTestResultsFile\", \", *.trx, visualStudioSecond.trx\");\n    when(context.fileProvider.listFiles(\"*.trx\")).thenReturn(new HashSet<>(Collections.singletonList(new File(\"visualStudioFirst.trx\"))));\n    when(context.fileProvider.listFiles(\"visualStudioSecond.trx\")).thenReturn(new HashSet<>(Collections.singletonList(new File(\"visualStudioSecond.trx\"))));\n    context.settings.setProperty(\"nunitTestResultsFile\", \", nunitFirst.xml, nunitSecond.xml\");\n    when(context.fileProvider.listFiles(\"nunitFirst.xml\")).thenReturn(new HashSet<>(Collections.singletonList(new File(\"nunitFirst.xml\"))));\n    when(context.fileProvider.listFiles(\"nunitSecond.xml\")).thenReturn(new HashSet<>(Collections.singletonList(new File(\"nunitSecond.xml\"))));\n    context.settings.setProperty(\"xunitTestResultsFile\", \", xunitFirst.xml, xunitSecond.xml\");\n    when(context.fileProvider.listFiles(\"xunitFirst.xml\")).thenReturn(new HashSet<>(Collections.singletonList(new File(\"xunitFirst.xml\"))));\n    when(context.fileProvider.listFiles(\"xunitSecond.xml\")).thenReturn(new HashSet<>(Collections.singletonList(new File(\"xunitSecond.xml\"))));\n    context.run();\n\n    verify(context.fileProvider).listFiles(\"*.trx\");\n    verify(context.fileProvider).listFiles(\"visualStudioSecond.trx\");\n    verify(context.fileProvider).listFiles(\"nunitFirst.xml\");\n    verify(context.fileProvider).listFiles(\"nunitSecond.xml\");\n    verify(context.fileProvider).listFiles(\"xunitFirst.xml\");\n    verify(context.fileProvider).listFiles(\"xunitSecond.xml\");\n\n    verify(context.visualStudio).parse(eq(new File(\"visualStudioFirst.trx\")), notNull(), any());\n    verify(context.visualStudio).parse(eq(new File(\"visualStudioSecond.trx\")), notNull(), any());\n    verify(context.nunit).parse(eq(new File(\"nunitFirst.xml\")), notNull(), any());\n    verify(context.nunit).parse(eq(new File(\"nunitSecond.xml\")), notNull(), any());\n    verify(context.xunit).parse(eq(new File(\"xunitFirst.xml\")), notNull(), any());\n    verify(context.xunit).parse(eq(new File(\"xunitSecond.xml\")), notNull(), any());\n  }\n\n  @Test\n  public void aggregate_logs_warning_on_exception() {\n    UnitTestConfiguration unitTestConf = new UnitTestConfiguration(\"visualStudioTestResultsFile\", \"nunitTestResultsFile\", \"xunitTestResultsFile\");\n    MapSettings settings = new MapSettings();\n    settings.setProperty(\"visualStudioTestResultsFile\", \"foo.trx\");\n\n    WildcardPatternFileProvider wildcardPatternFileProvider = mock(WildcardPatternFileProvider.class);\n    when(wildcardPatternFileProvider.listFiles(\"foo.trx\")).thenReturn(new HashSet<>(Collections.singletonList(new File(\"foo.trx\"))));\n\n    new UnitTestResultsAggregator(unitTestConf, settings.asConfig())\n      .aggregate(wildcardPatternFileProvider, new ArrayList<>(Collections.emptyList()));\n\n    assertThat(logTester.logs(Level.WARN)).containsOnly(\"Could not import unit test report 'foo.trx': java.io.FileNotFoundException: foo.trx (The system cannot find the file specified)\");\n  }\n\n  @Test\n  public void aggregate_withMethodDeclarations() {\n    AggregateTestContext context = new AggregateTestContext(\"visualStudioTestResultsFile\", \"src/test/resources/visualstudio_test_results/valid.trx\");\n\n    var methodDeclarations = new ArrayList<MethodDeclarationsInfo>();\n    methodDeclarations.add(MethodDeclarationsInfo.newBuilder()\n      .setFilePath(\"C:\\\\dev\\\\Playground\\\\Playground.Test\\\\Sample.cs\")\n      .setAssemblyName(\"Playground.Test.TestProject1\")\n      .addMethodDeclarations(MethodDeclarationInfo.newBuilder()\n        .setTypeName(\"UnitTest1\")\n        .setMethodName(\"TestMethod1\")\n        .build())\n      .addMethodDeclarations(MethodDeclarationInfo.newBuilder()\n        .setTypeName(\"UnitTest2\")\n        .setMethodName(\"TestMethod5\")\n        .build())\n      .build());\n    methodDeclarations.add(MethodDeclarationsInfo.newBuilder()\n      .setFilePath(\"C:\\\\dev\\\\Playground\\\\Playground.Test\\\\UnitTest1.cs\")\n      .setAssemblyName(\"Playground.Test.TestProject1\")\n      .addMethodDeclarations(MethodDeclarationInfo.newBuilder()\n        .setTypeName(\"UnitTest1\")\n        .setMethodName(\"TestShouldFail\")\n        .build())\n      .addMethodDeclarations(MethodDeclarationInfo.newBuilder()\n        .setTypeName(\"UnitTest1\")\n        .setMethodName(\"TestShouldSkip\")\n        .build())\n      .addMethodDeclarations(MethodDeclarationInfo.newBuilder()\n        .setTypeName(\"UnitTest1\")\n        .setMethodName(\"TestShouldError\")\n        .build())\n      .build());\n    var sut = new UnitTestResultsAggregator(context.config, context.settings.asConfig());\n    var resultsMap = sut.aggregate(context.fileProvider, methodDeclarations);\n\n    assertThat(logTester.logs(Level.WARN)).isEmpty();\n    assertThat(resultsMap).hasSize(2);\n    assertThat(resultsMap.get(\"C:\\\\dev\\\\Playground\\\\Playground.Test\\\\Sample.cs\").tests()).isEqualTo(13);\n    assertThat(resultsMap.get(\"C:\\\\dev\\\\Playground\\\\Playground.Test\\\\Sample.cs\").failures()).isZero();\n    assertThat(resultsMap.get(\"C:\\\\dev\\\\Playground\\\\Playground.Test\\\\Sample.cs\").skipped()).isEqualTo(7);\n    assertThat(resultsMap.get(\"C:\\\\dev\\\\Playground\\\\Playground.Test\\\\Sample.cs\").errors()).isEqualTo(1);\n    assertThat(resultsMap.get(\"C:\\\\dev\\\\Playground\\\\Playground.Test\\\\Sample.cs\").executionTime()).isEqualTo(47);\n\n    assertThat(resultsMap.get(\"C:\\\\dev\\\\Playground\\\\Playground.Test\\\\UnitTest1.cs\").tests()).isEqualTo(3);\n    assertThat(resultsMap.get(\"C:\\\\dev\\\\Playground\\\\Playground.Test\\\\UnitTest1.cs\").failures()).isEqualTo(2);\n    assertThat(resultsMap.get(\"C:\\\\dev\\\\Playground\\\\Playground.Test\\\\UnitTest1.cs\").skipped()).isEqualTo(1);\n    assertThat(resultsMap.get(\"C:\\\\dev\\\\Playground\\\\Playground.Test\\\\UnitTest1.cs\").errors()).isZero();\n    assertThat(resultsMap.get(\"C:\\\\dev\\\\Playground\\\\Playground.Test\\\\UnitTest1.cs\").executionTime()).isEqualTo(22);\n\n    assertThat(logTester.logs(Level.INFO)).hasSize(1);\n    assertThat(logTester.logs(Level.INFO).get(0)).startsWith(\"Parsing the Visual Studio Test Results file \");\n  }\n\n  private static class AggregateTestContext {\n    public final MapSettings settings = new MapSettings();\n    public final WildcardPatternFileProvider fileProvider = mock(WildcardPatternFileProvider.class);\n    public final VisualStudioTestResultParser visualStudio = mock(VisualStudioTestResultParser.class);\n    public final XUnitTestResultsParser xunit = mock(XUnitTestResultsParser.class);\n    public final NUnitTestResultsParser nunit = mock(NUnitTestResultsParser.class);\n    public final UnitTestConfiguration config = new UnitTestConfiguration(\"visualStudioTestResultsFile\", \"nunitTestResultsFile\", \"xunitTestResultsFile\");\n\n    public AggregateTestContext() { }\n\n    public AggregateTestContext(String propertyName, String fileName) {\n      add(propertyName, fileName);\n    }\n\n    public void add(String propertyName, String fileName) {\n      settings.setProperty(propertyName, fileName);\n      when(fileProvider.listFiles(fileName)).thenReturn(new HashSet<>(Collections.singletonList(new File(fileName))));\n    }\n\n    public void run() {\n      new UnitTestResultsAggregator(config, settings.asConfig(), visualStudio, nunit, xunit).aggregate(fileProvider, Collections.emptyList());\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonar/plugins/dotnet/tests/UnitTestResultsImportSensorTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.function.Predicate;\nimport org.assertj.core.api.Condition;\nimport org.assertj.core.groups.Tuple;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.TemporaryFolder;\nimport org.sonar.api.batch.fs.InputFile;\nimport org.sonar.api.batch.fs.internal.TestInputFileBuilder;\nimport org.sonar.api.batch.sensor.internal.DefaultSensorDescriptor;\nimport org.sonar.api.batch.sensor.internal.SensorContextTester;\nimport org.sonar.api.config.Configuration;\nimport org.sonar.api.measures.CoreMetrics;\nimport org.sonar.api.notifications.AnalysisWarnings;\nimport org.sonar.api.scanner.sensor.ProjectSensor;\nimport org.sonar.api.testfixtures.log.LogTester;\nimport org.slf4j.event.Level;\nimport org.sonarsource.dotnet.shared.plugins.MethodDeclarationsCollector;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\nimport org.sonarsource.dotnet.shared.plugins.RealPathProvider;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.groups.Tuple.tuple;\nimport static org.mockito.ArgumentMatchers.any;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.verify;\nimport static org.mockito.Mockito.when;\n\npublic class UnitTestResultsImportSensorTest {\n\n  private final RealPathProvider realPathProvider = new RealPathProvider();\n\n  @Rule\n  public TemporaryFolder temp = new TemporaryFolder();\n\n  @Rule\n  public LogTester logTester = new LogTester();\n\n  @Before\n  public void before() {\n    logTester.setLevel(Level.DEBUG);\n  }\n\n  @Test\n  public void should_not_save_metrics_with_empty_execution_time() throws Exception {\n    var metadata = mockCSharpMetadata();\n    var analysisWarnings = mock(AnalysisWarnings.class);\n    var results = new UnitTestResults();\n    results.add(42, 1, 2, 3, null);\n    var fileResults = new HashMap<String, UnitTestResults>();\n    var tempFolder = temp.newFolder();\n    var file = File.createTempFile(\"path\", \".cs\", tempFolder);\n    fileResults.put(file.getName(), results);\n    var aggregator = mock(UnitTestResultsAggregator.class);\n    when(aggregator.hasUnitTestResultsProperty()).thenReturn(true);\n    when(aggregator.aggregate(any(), any())).thenReturn(fileResults);\n    var context = SensorContextTester.create(tempFolder);\n\n    context.fileSystem().add(new TestInputFileBuilder(\"projectKey\", file.getName())\n      .setLanguage(\"cs\")\n      .setType(InputFile.Type.MAIN)\n      .build());\n\n    new UnitTestResultsImportSensor(new MethodDeclarationsCollector(), aggregator, metadata, analysisWarnings, mockPathProvider(file)).execute(context);\n\n    var executionTimeMetric = new Condition<Tuple>(x -> x.toList().get(0) == CoreMetrics.TEST_EXECUTION_TIME_KEY, CoreMetrics.TEST_EXECUTION_TIME_KEY);\n    assertThat(context.measures(\"projectKey:\" + file.getName()))\n      .extracting(\"metric.key\", \"value\")\n      .containsOnly(\n        tuple(CoreMetrics.TESTS_KEY, 42),\n        tuple(CoreMetrics.SKIPPED_TESTS_KEY, 1),\n        tuple(CoreMetrics.TEST_FAILURES_KEY, 2),\n        tuple(CoreMetrics.TEST_ERRORS_KEY, 3))\n      .doNotHave(executionTimeMetric);\n  }\n\n  @Test\n  public void describe_execute_only_when_key_present() {\n    UnitTestResultsAggregator unitTestResultsAggregator = mock(UnitTestResultsAggregator.class);\n    PluginMetadata metadata = mockCSharpMetadata();\n    AnalysisWarnings analysisWarnings = mock(AnalysisWarnings.class);\n\n    Configuration configWithKey = mock(Configuration.class);\n    when(configWithKey.hasKey(\"expectedKey\")).thenReturn(true);\n\n    Configuration configWithoutKey = mock(Configuration.class);\n\n    when(unitTestResultsAggregator.hasUnitTestResultsProperty(any(Predicate.class))).thenAnswer(invocationOnMock -> {\n      Predicate<String> pr = invocationOnMock.getArgument(0);\n      return pr.test(\"expectedKey\");\n    });\n    DefaultSensorDescriptor descriptor = new DefaultSensorDescriptor();\n\n    new UnitTestResultsImportSensor(new MethodDeclarationsCollector(), unitTestResultsAggregator, metadata, analysisWarnings, mock(RealPathProvider.class)).describe(descriptor);\n\n    assertThat(descriptor.configurationPredicate()).accepts(configWithKey);\n    assertThat(descriptor.configurationPredicate()).rejects(configWithoutKey);\n  }\n\n  @Test\n  public void describe_only_on_language() {\n    UnitTestResultsAggregator unitTestResultsAggregator = mock(UnitTestResultsAggregator.class);\n    PluginMetadata metadata = mockCSharpMetadata();\n    AnalysisWarnings analysisWarnings = mock(AnalysisWarnings.class);\n    DefaultSensorDescriptor descriptor = new DefaultSensorDescriptor();\n\n    new UnitTestResultsImportSensor(new MethodDeclarationsCollector(), unitTestResultsAggregator, metadata, analysisWarnings, mock(RealPathProvider.class)).describe(descriptor);\n\n    assertThat(descriptor.languages()).containsOnly(\"cs\");\n  }\n\n  @Test\n  public void isProjectSensor() {\n    assertThat(ProjectSensor.class.isAssignableFrom(UnitTestResultsImportSensor.class)).isTrue();\n  }\n\n  @Test\n  public void import_two_reports_for_same_file() throws Exception {\n    UnitTestResultsAggregator aggregator = mock(UnitTestResultsAggregator.class);\n    PluginMetadata cSharpMetadata = mockCSharpMetadata();\n    PluginMetadata vbNetMetadata = mockVbNetMetadata();\n    AnalysisWarnings analysisWarnings = mock(AnalysisWarnings.class);\n    SensorContextTester context = SensorContextTester.create(temp.newFolder());\n    when(aggregator.hasUnitTestResultsProperty()).thenReturn(true);\n\n    var tempFolder = temp.newFolder();\n    var file = File.createTempFile(\"path\", \".cs\", tempFolder);\n    context.fileSystem().add(new TestInputFileBuilder(\"projectKey\", file.getName())\n      .setLanguage(\"cs\")\n      .setType(InputFile.Type.MAIN)\n      .build());\n\n    UnitTestResults results = new UnitTestResults();\n    results.add(42, 1, 2, 3, 321L);\n    var fileResults = new HashMap<String, UnitTestResults>();\n    fileResults.put(file.getName(), results);\n    when(aggregator.aggregate(any(), any())).thenReturn(fileResults);\n\n    var methodDeclarationsCollector = new MethodDeclarationsCollector();\n    new UnitTestResultsImportSensor(methodDeclarationsCollector, aggregator, cSharpMetadata, analysisWarnings, realPathProvider).execute(context);\n    new UnitTestResultsImportSensor(methodDeclarationsCollector, aggregator, vbNetMetadata, analysisWarnings, realPathProvider).execute(context);\n\n    assertThat(logTester.logs(Level.WARN)).containsExactly(\"Could not import unit test report: 'Can not add the same measure twice'\");\n    verify(analysisWarnings).addUnique(\"Could not import unit test report for 'VB.NET'. Please check the logs for more details.\");\n  }\n\n  @Test\n  public void execute_saves_metrics() throws IOException {\n    UnitTestResultsAggregator aggregator = mock(UnitTestResultsAggregator.class);\n    PluginMetadata metadata = mockCSharpMetadata();\n    AnalysisWarnings analysisWarnings = mock(AnalysisWarnings.class);\n    when(aggregator.hasUnitTestResultsProperty()).thenReturn(true);\n\n    UnitTestResults results = new UnitTestResults();\n    results.add(42, 1, 2, 3, 321L);\n\n    var fileResults = new HashMap<String, UnitTestResults>();\n    var tempFolder = temp.newFolder();\n    var file = File.createTempFile(\"path\", \".cs\", tempFolder);\n    fileResults.put(file.getName(), results);\n    when(aggregator.aggregate(any(), any())).thenReturn(fileResults);\n    SensorContextTester context = SensorContextTester.create(tempFolder);\n    context.fileSystem().add(new TestInputFileBuilder(\"projectKey\", file.getName())\n      .setLanguage(\"cs\")\n      .setType(InputFile.Type.MAIN)\n      .build());\n\n    UnitTestResultsImportSensor sensor = new UnitTestResultsImportSensor(new MethodDeclarationsCollector(), aggregator, metadata, analysisWarnings, mockPathProvider(file));\n    sensor.execute(context);\n\n    assertThat(context.measures(\"projectKey:\" + file.getName()))\n      .extracting(\"metric.key\", \"value\")\n      .containsOnly(\n        tuple(CoreMetrics.TESTS_KEY, 42),\n        tuple(CoreMetrics.SKIPPED_TESTS_KEY, 1),\n        tuple(CoreMetrics.TEST_FAILURES_KEY, 2),\n        tuple(CoreMetrics.TEST_ERRORS_KEY, 3),\n        tuple(CoreMetrics.TEST_EXECUTION_TIME_KEY, 321L));\n  }\n\n  @Test\n  public void execute_warns_when_no_key_is_present() {\n    UnitTestResultsAggregator aggregator = mock(UnitTestResultsAggregator.class);\n    PluginMetadata metadata = mockCSharpMetadata();\n    when(aggregator.hasUnitTestResultsProperty()).thenReturn(false);\n\n    UnitTestResultsImportSensor sensor = new UnitTestResultsImportSensor(new MethodDeclarationsCollector(), aggregator, metadata, null, mock(RealPathProvider.class));\n    sensor.execute(null);\n\n    assertThat(logTester.logs(Level.DEBUG)).containsExactly(\"No unit test results property. Skip Sensor\");\n  }\n\n  @Test\n  public void when_file_path_casing_is_wrong_it_uses_the_real_file_path() throws IOException {\n    var aggregator = mock(UnitTestResultsAggregator.class);\n    var cSharpMetadata = mockCSharpMetadata();\n    var analysisWarnings = mock(AnalysisWarnings.class);\n    var context = SensorContextTester.create(temp.newFolder());\n    when(aggregator.hasUnitTestResultsProperty()).thenReturn(true);\n    var results = new UnitTestResults();\n    results.add(42, 1, 2, 3, 321L);\n    var file = createTempFile(context);\n    var pathProvider = mock(RealPathProvider.class);\n    // The Scanner for .NET reads the file paths from the project files, which are case-insensitive and might be different from the actual names.\n    var wrongCasingFileName = file.getName().toUpperCase();\n    when(pathProvider.getRealPath(wrongCasingFileName)).thenReturn(file.getName());\n\n    var fileResults = new HashMap<String, UnitTestResults>();\n    fileResults.put(wrongCasingFileName, results);\n    when(aggregator.aggregate(any(), any())).thenReturn(fileResults);\n\n    var methodDeclarationsCollector = new MethodDeclarationsCollector();\n    new UnitTestResultsImportSensor(methodDeclarationsCollector, aggregator, cSharpMetadata, analysisWarnings, pathProvider).execute(context);\n\n    assertThat(logTester.logs(Level.DEBUG))\n      .hasSize(1)\n      .containsExactly(\"Adding test metrics for file '\" + file.getName() + \"'. Tests: '42', Errors: `3`, Failures: '2'\");\n  }\n\n  @Test\n  public void when_file_path_cannot_be_found_it_logs_a_warning() throws IOException {\n    var aggregator = mock(UnitTestResultsAggregator.class);\n    var cSharpMetadata = mockCSharpMetadata();\n    var analysisWarnings = mock(AnalysisWarnings.class);\n    var context = SensorContextTester.create(temp.newFolder());\n    when(aggregator.hasUnitTestResultsProperty()).thenReturn(true);\n    var results = new UnitTestResults();\n    results.add(42, 1, 2, 3, 321L);\n    var fileResults = new HashMap<String, UnitTestResults>();\n    fileResults.put(\"nonexistent.cs\", results);\n    when(aggregator.aggregate(any(), any())).thenReturn(fileResults);\n\n    var methodDeclarationsCollector = new MethodDeclarationsCollector();\n    new UnitTestResultsImportSensor(methodDeclarationsCollector, aggregator, cSharpMetadata, analysisWarnings, new RealPathProvider()).execute(context);\n\n    assertThat(logTester.logs(Level.DEBUG))\n      .hasSize(2)\n      .containsExactly(\n        \"Failed to retrieve the real full path for 'nonexistent.cs'\",\n        \"Cannot find the file 'nonexistent.cs'. No test results will be imported. Mapped path is 'nonexistent.cs'.\");\n  }\n\n  private File createTempFile(SensorContextTester context) throws IOException {\n    var tempFolder = temp.newFolder();\n    tempFolder.deleteOnExit();\n\n    var file = File.createTempFile(\"path\", \".cs\", tempFolder);\n    file.deleteOnExit();\n\n    context.fileSystem()\n      .add(new TestInputFileBuilder(\"projectKey\", file.getName())\n      .setLanguage(\"cs\")\n      .setType(InputFile.Type.MAIN)\n      .build());\n\n    return file;\n  }\n\n  private PluginMetadata mockCSharpMetadata() {\n    PluginMetadata metadata = mock(PluginMetadata.class);\n    when(metadata.languageKey()).thenReturn(\"cs\");\n    when(metadata.languageName()).thenReturn(\"C#\");\n    return metadata;\n  }\n\n  private PluginMetadata mockVbNetMetadata() {\n    PluginMetadata metadata = mock(PluginMetadata.class);\n    when(metadata.languageKey()).thenReturn(\"vb\");\n    when(metadata.languageName()).thenReturn(\"VB.NET\");\n    return metadata;\n  }\n\n  private RealPathProvider mockPathProvider(File file) {\n    var pathProvider = mock(RealPathProvider.class);\n    when(pathProvider.getRealPath(any())).thenReturn(file.getAbsolutePath());\n    return pathProvider;\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonar/plugins/dotnet/tests/VisualStudioTestResultParserTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests;\n\nimport java.io.File;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.slf4j.event.Level;\nimport org.sonar.api.testfixtures.log.LogTester;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.junit.Assert.assertThrows;\nimport static org.junit.Assert.assertEquals;\n\npublic class VisualStudioTestResultParserTest {\n\n  @Rule\n  public LogTester logTester = new LogTester();\n\n  @Before\n  public void before() {\n    logTester.setLevel(Level.DEBUG);\n  }\n\n  @Test\n  public void valid() {\n    Map<String, UnitTestResults> results = new HashMap<>();\n    Map<String, String> fileMap = new HashMap<>() {\n      {\n        put(\"Playground.Test.TestProject1.UnitTest1.TestMethod1\", \"C:\\\\dev\\\\Playground\\\\Playground.Test\\\\Sample.cs\");\n        put(\"Playground.Test.TestProject1.UnitTest1.TestShouldFail\", \"C:\\\\dev\\\\Playground\\\\Playground.Test\\\\UnitTest1.cs\");\n        put(\"Playground.Test.TestProject1.UnitTest1.TestShouldSkip\", \"C:\\\\dev\\\\Playground\\\\Playground.Test\\\\UnitTest1.cs\");\n        put(\"Playground.Test.TestProject1.UnitTest1.TestShouldError\", \"C:\\\\dev\\\\Playground\\\\Playground.Test\\\\UnitTest1.cs\");\n        put(\"Playground.Test.TestProject1.UnitTest2.TestMethod5\", \"C:\\\\dev\\\\Playground\\\\Playground.Test\\\\Sample.cs\");\n      }\n    };\n\n    var sut = new VisualStudioTestResultParser();\n\n    sut.parse(new File(\"src/test/resources/visualstudio_test_results/valid.trx\"), results, fileMap);\n\n    assertThat(results).hasSize(2);\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\Playground.Test\\\\Sample.cs\").tests()).isEqualTo(13);\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\Playground.Test\\\\Sample.cs\").failures()).isZero();\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\Playground.Test\\\\Sample.cs\").skipped()).isEqualTo(7);\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\Playground.Test\\\\Sample.cs\").errors()).isEqualTo(1);\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\Playground.Test\\\\Sample.cs\").executionTime()).isEqualTo(47);\n\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\Playground.Test\\\\UnitTest1.cs\").tests()).isEqualTo(3);\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\Playground.Test\\\\UnitTest1.cs\").failures()).isEqualTo(2);\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\Playground.Test\\\\UnitTest1.cs\").skipped()).isEqualTo(1);\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\Playground.Test\\\\UnitTest1.cs\").errors()).isZero();\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\Playground.Test\\\\UnitTest1.cs\").executionTime()).isEqualTo(22);\n\n    List<String> infoLogs = logTester.logs(Level.INFO);\n    assertThat(infoLogs).hasSize(1);\n    assertThat(infoLogs.get(0)).startsWith(\"Parsing the Visual Studio Test Results file \");\n\n    List<String> debugLogs = logTester.logs(Level.DEBUG);\n    assertThat(debugLogs)\n      .hasSize(32)\n      .contains(\n        \"Parsed Visual Studio Unit Test - testId: d7744238-9adf-b364-3d70-ae38261a8cd8 outcome: Failed, duration: 20\",\n        \"Parsed Visual Studio Unit Test - testId: c7dc64cd-0233-3937-7ce3-ae46f9eabe5c outcome: NotExecuted, duration: 0\",\n        \"Added Test Method: Playground.Test.TestProject1.UnitTest1.TestMethod1 to File: C:\\\\dev\\\\Playground\\\\Playground.Test\\\\Sample.cs\",\n        \"Added Test Method: Playground.Test.TestProject1.UnitTest1.TestShouldError to File: C:\\\\dev\\\\Playground\\\\Playground.Test\\\\UnitTest1.cs\"\n      );\n  }\n\n  @Test\n  public void multiple_runs_same_test() {\n    Map<String, UnitTestResults> results = new HashMap<>();\n    Map<String, String> fileMap = new HashMap<>() {\n      {\n        put(\"TestReport.TestReport.Test1.TestMethod1\", \"Sample.cs\");\n      }\n    };\n\n    var sut = new VisualStudioTestResultParser();\n\n    sut.parse(new File(\"src/test/resources/visualstudio_test_results/multiple_runs_same_test.trx\"), results, fileMap);\n\n    assertThat(results).hasSize(1);\n    assertThat(results.get(\"Sample.cs\").tests()).isEqualTo(2);\n    assertThat(results.get(\"Sample.cs\").failures()).isZero();\n    assertThat(results.get(\"Sample.cs\").skipped()).isZero();\n    assertThat(results.get(\"Sample.cs\").errors()).isZero();\n    assertThat(results.get(\"Sample.cs\").executionTime()).isEqualTo(26);\n\n    assertThat(logTester.logs(Level.WARN)).isEmpty();\n\n    var infoLogs = logTester.logs(Level.INFO);\n    assertThat(infoLogs).hasSize(1);\n    assertThat(infoLogs.get(0)).startsWith(\"Parsing the Visual Studio Test Results file \");\n\n    var debugLogs = logTester.logs(Level.DEBUG);\n    assertThat(debugLogs)\n      .hasSize(3)\n      .contains(\n        \"Parsed Visual Studio Unit Test - testId: ab6094d2-07ab-58c5-03e0-a4fb244efd26 outcome: Passed, duration: 24\",\n        \"Parsed Visual Studio Unit Test - testId: ab6094d2-07ab-58c5-03e0-a4fb244efd26 outcome: Passed, duration: 2\",\n        \"Added Test Method: TestReport.TestReport.Test1.TestMethod1 to File: Sample.cs\"\n      );\n  }\n\n  @Test\n  public void test_name_not_mapped() {\n    var sut = new VisualStudioTestResultParser();\n    var file = new File(\"src/test/resources/visualstudio_test_results/test_name_not_mapped.trx\");\n\n    sut.parse(file, new HashMap<>(), Map.of(\"Some.Other.TestMethod\", \"C:\\\\dev\\\\Playground\\\\NUnit.Test\\\\Sample.cs\"));\n\n    List<String> debugLogs = logTester.logs(Level.DEBUG);\n    assertThat(debugLogs).hasSize(2);\n    assertThat(debugLogs.get(1)).isEqualTo(\"Test method Playground.Test.TestProject1.UnitTest1.TestShouldFail cannot be mapped to the test source file. The test will not be included.\");\n  }\n\n  @Test\n  public void invalid_date() {\n    Map<String, UnitTestResults> results = new HashMap<>();\n    var sut = new VisualStudioTestResultParser();\n    var file = new File(\"src/test/resources/visualstudio_test_results/invalid_dates.trx\");\n\n    var exception = assertThrows(ParseErrorException.class, () -> sut.parse(file, results, new HashMap<>()));\n    assertThat(exception.getMessage()).startsWith(\"Expected a valid date and time instead of \\\"2016-xx-14T17:04:31.100+01:00\\\" for the attribute \\\"startTime\\\". Unparseable date: \\\"2016-xx-14T17:04:31.100+01:00\\\" in \");\n  }\n\n  @Test\n  public void invalid_character_fail() {\n    Map<String, UnitTestResults> results = new HashMap<>();\n    var sut = new VisualStudioTestResultParser();\n    var file = new File(\"src/test/resources/visualstudio_test_results/invalid_character.trx\");\n\n    var exception = assertThrows(IllegalStateException.class, () -> sut.parse(file, results, new HashMap<>()));\n\n    assertThat(exception.getMessage()).startsWith(\"Error while parsing the XML file:\");\n  }\n\n  @Test\n  public void test_result_no_test_method() {\n    Map<String, UnitTestResults> results = new HashMap<>();\n    var sut = new VisualStudioTestResultParser();\n    var file = new File(\"src/test/resources/visualstudio_test_results/test_result_no_test_method.trx\");\n\n    var exception =  assertThrows(ParseErrorException.class, () -> sut.parse(file, results, new HashMap<>()));\n    assertEquals(\"No TestMethod attribute found on UnitTest tag\", exception.getMessage());\n  }\n\n  @Test\n  public void invalid_test_outcome() {\n    Map<String, UnitTestResults> results = new HashMap<>();\n    Map<String, String> fileMap = Map.of(\"Playground.Test.TestProject1.UnitTest1.InvalidOutcome\", \"C:\\\\dev\\\\Playground\\\\Playground.Test\\\\Sample.cs\");\n    var sut = new VisualStudioTestResultParser();\n    var file = new File(\"src/test/resources/visualstudio_test_results/invalid_test_outcome.trx\");\n\n    var exception = assertThrows(IllegalArgumentException.class, () -> sut.parse(file, results, fileMap));\n    assertEquals(\"Outcome of unit test must match VSTest Format\", exception.getMessage());\n  }\n\n  @Test\n  public void nunit_project_with_vs_logger() {\n    Map<String, UnitTestResults> results = new HashMap<>();\n    Map<String, String> fileMap = new HashMap<>() {\n      {\n        put(\"Calculator.NUnit3.Calculator.NUnit3.GenericTests.GenericTest\", \"Sample.cs\");\n        put(\"Calculator.NUnit3.Calculator.NUnit3.Derived.TestMethodInBaseClass\", \"Sample.cs\");\n        put(\"Calculator.NUnit3.Calculator.NUnit3.Tests.TestMethod1\", \"Sample.cs\");\n        put(\"Calculator.NUnit3.Calculator.NUnit3.Derived.VirtualMethodInBaseClass\", \"Sample.cs\");\n      }\n    };\n\n    var sut = new VisualStudioTestResultParser();\n\n    sut.parse(new File(\"src/test/resources/visualstudio_test_results/nunitproject_with_vs_logger.trx\"), results, fileMap);\n\n    assertThat(results).hasSize(1);\n    assertThat(results.get(\"Sample.cs\").tests()).isEqualTo(6);\n    assertThat(results.get(\"Sample.cs\").failures()).isZero();\n    assertThat(results.get(\"Sample.cs\").skipped()).isZero();\n    assertThat(results.get(\"Sample.cs\").errors()).isZero();\n    assertThat(results.get(\"Sample.cs\").executionTime()).isEqualTo(10);\n\n    assertThat(logTester.logs(Level.WARN)).isEmpty();\n\n    var infoLogs = logTester.logs(Level.INFO);\n    assertThat(infoLogs).hasSize(1);\n    assertThat(infoLogs.get(0)).startsWith(\"Parsing the Visual Studio Test Results file \");\n\n    var debugLogs = logTester.logs(Level.DEBUG);\n    assertThat(debugLogs)\n      .hasSize(12)\n      .contains(\n        \"Parsed Visual Studio Unit Test - testId: dfbab7a8-4d30-e4af-b7e9-5f143fa0d63c outcome: Passed, duration: 0\",\n        \"Parsed Visual Studio Unit Test - testId: e856dddd-b0b9-1283-7d12-995daa1c2159 outcome: Passed, duration: 0\",\n        \"Parsed Visual Studio Unit Test - testId: 04f8f26c-73f6-0a50-702c-3424ece7fca7 outcome: Passed, duration: 1\",\n        \"Parsed Visual Studio Unit Test - testId: d19495ce-8556-0afa-0598-f28569986b94 outcome: Passed, duration: 2\",\n        \"Parsed Visual Studio Unit Test - testId: b1d90856-8e97-2f05-b5a1-46236018b4f5 outcome: Passed, duration: 0\",\n        \"Parsed Visual Studio Unit Test - testId: 7c7642ed-18fb-4d66-c0f5-3e220f7aa426 outcome: Passed, duration: 7\",\n        \"Added Test Method: Calculator.NUnit3.Calculator.NUnit3.GenericTests.GenericTest to File: Sample.cs\",\n        \"Added Test Method: Calculator.NUnit3.Calculator.NUnit3.GenericTests.GenericTest to File: Sample.cs\",\n        \"Added Test Method: Calculator.NUnit3.Calculator.NUnit3.Derived.TestMethodInBaseClass to File: Sample.cs\",\n        \"Added Test Method: Calculator.NUnit3.Calculator.NUnit3.GenericTests.GenericTest to File: Sample.cs\",\n        \"Added Test Method: Calculator.NUnit3.Calculator.NUnit3.Tests.TestMethod1 to File: Sample.cs\",\n        \"Added Test Method: Calculator.NUnit3.Calculator.NUnit3.Derived.VirtualMethodInBaseClass to File: Sample.cs\"\n      );\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonar/plugins/dotnet/tests/VstsUtils.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests;\n\n// This class has been taken from SonarSource/sonar-scanner-msbuild\npublic class VstsUtils {\n\n  static final String ENV_BUILD_DIRECTORY = \"AGENT_BUILDDIRECTORY\";\n  static final String ENV_SOURCES_DIRECTORY = \"BUILD_SOURCESDIRECTORY\";\n\n  public static Boolean isRunningUnderVsts(){\n    return System.getenv(ENV_BUILD_DIRECTORY) != null;\n  }\n\n  public static String getSourcesDirectory(){\n    return GetVstsEnvironmentVariable(ENV_SOURCES_DIRECTORY);\n  }\n\n  private static String GetVstsEnvironmentVariable(String name){\n    String value = System.getenv(name);\n    if (name == null){\n      throw new IllegalStateException(\"Unable to find VSTS environment variable: \" + name);\n    }\n    return value;\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonar/plugins/dotnet/tests/WildcardPatternFileProviderTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests;\n\nimport java.io.File;\nimport java.util.List;\nimport java.util.Set;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.ExpectedException;\nimport org.junit.rules.TemporaryFolder;\nimport org.sonar.api.testfixtures.log.LogTester;\nimport org.slf4j.event.Level;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\npublic class WildcardPatternFileProviderTest {\n\n  @Rule\n  public TemporaryFolder tmp = new TemporaryFolder();\n\n  @Rule\n  public ExpectedException thrown = ExpectedException.none();\n\n  @Rule\n  public LogTester logTester = new LogTester();\n\n  @Before\n  public void init() throws Exception {\n    logTester.setLevel(Level.TRACE);\n    tmp.newFile(\"foo.txt\");\n    tmp.newFile(\"bar.txt\");\n    tmp.newFolder(\"a\");\n    tmp.newFile(path(\"a\", \"foo.txt\"));\n    tmp.newFolder(\"a\", \"a21\");\n    tmp.newFolder(\"b\");\n\n    tmp.newFolder(\"c\");\n    tmp.newFolder(\"c\", \"c21\");\n    tmp.newFile(path(\"c\", \"c21\", \"foo.txt\"));\n    tmp.newFolder(\"c\", \"c22\");\n    tmp.newFolder(\"c\", \"c22\", \"c31\");\n    tmp.newFile(path(\"c\", \"c22\", \"c31\", \"foo.txt\"));\n    tmp.newFile(path(\"c\", \"c22\", \"c31\", \"bar.txt\"));\n  }\n\n  @Test\n  public void logging_added_and_skipped_files() {\n    File tmpRoot = tmp.getRoot();\n    String givenPattern = new File(tmpRoot, path(\"**\\\\c\\\\c21\", \"foo.txt\")).getAbsolutePath();\n    listFiles(givenPattern);\n\n    List<String> debugLogs = logTester.logs((Level.DEBUG));\n    assertThat(debugLogs).hasSize(3);\n    assertThat(debugLogs.get(0)).isEqualTo(\"Pattern matcher extracted prefix/absolute path '\" + tmpRoot + \"' from the given pattern '\" + givenPattern + \"'.\");\n    assertThat(debugLogs.get(1)).isEqualTo(\"Gathering files for wildcardPattern '**\\\\c\\\\c21\\\\foo.txt'.\");\n    assertThat(debugLogs.get(2)).startsWith(\"Pattern matcher returns '1' files.\");\n\n    List<String> traceLogs = logTester.logs((Level.TRACE));\n    // we don't know the order of logging, so we're just doing a sanity check\n    assertThat(traceLogs).hasSize(13)\n      .contains(\"Skipping file '\" +\n        tmpRoot +\n        \"\\\\c\\\\c22\\\\c31\\\\foo.txt'\" +\n        \" because it does not match pattern '**\\\\c\\\\c21\\\\foo.txt'.\")\n      .contains(\"Adding file '\" + tmpRoot + \"\\\\c\\\\c21\\\\foo.txt\" + \"' to result list.\");\n  }\n\n  @Test\n  public void logging_early_return_absolute_path() {\n    File tmpRoot = tmp.getRoot();\n    String absoluteFilePath = new File(tmpRoot, \"foo.txt\").getAbsolutePath();\n    listFiles(absoluteFilePath);\n\n    List<String> logs = logTester.logs((Level.DEBUG));\n    assertThat(logs).hasSize(2);\n    assertThat(logs.get(0)).isEqualTo(\"Pattern matcher extracted prefix/absolute path '\" + absoluteFilePath + \"' from the given pattern '\" + absoluteFilePath + \"'.\");\n    assertThat(logs.get(1)).isEqualTo(\"Pattern matcher returns a single file: '\" + absoluteFilePath + \"'.\");\n  }\n\n  @Test\n  public void logging_early_return_no_file_found() {\n    File tmpRoot = tmp.getRoot();\n    String nonExistingFilePath = new File(tmpRoot, \"not-existing-file\").getAbsolutePath();\n    listFiles(nonExistingFilePath);\n\n    List<String> logs = logTester.logs((Level.DEBUG));\n    assertThat(logs).hasSize(2);\n    assertThat(logs.get(0)).isEqualTo(\"Pattern matcher extracted prefix/absolute path '\" + nonExistingFilePath + \"' from the given pattern '\" + nonExistingFilePath + \"'.\");\n    assertThat(logs.get(1)).isEqualTo(\"Pattern matcher did not find any files matching the pattern '\" + nonExistingFilePath + \"'.\");\n  }\n\n  @Test\n  public void absolute_paths() {\n    assertThat(listFiles(new File(tmp.getRoot(), \"foo.txt\").getAbsolutePath()))\n      .containsOnly(new File(tmp.getRoot(), \"foo.txt\"));\n\n    assertThat(listFiles(new File(tmp.getRoot(), path(\"c\", \"c22\", \"c31\", \"foo.txt\")).getAbsolutePath()))\n      .containsOnly(new File(tmp.getRoot(), path(\"c\", \"c22\", \"c31\", \"foo.txt\")));\n\n    assertThat(listFiles(new File(tmp.getRoot(), \"nonexisting.txt\").getAbsolutePath())).isEmpty();\n  }\n\n  @Test\n  public void absolute_paths_with_current_and_parent_folder_access() {\n    assertThat(listFiles(new File(tmp.getRoot(), path(\"a\", \"..\", \".\", \"foo.txt\")).getAbsolutePath()))\n      .containsOnly(new File(tmp.getRoot(), path(\"a\", \"..\", \".\", \"foo.txt\")));\n\n    assertThat(listFiles(new File(tmp.getRoot(), path(\"a\", \"..\", \".\", \"foo.txt\")).getAbsolutePath()))\n      .containsOnly(new File(tmp.getRoot(), path(\"a\", \"..\", \".\", \"foo.txt\")));\n\n    assertThat(listFiles(new File(tmp.getRoot(), path(\"a\", \"..\", \".\", \"foo.txt\")).getAbsolutePath()))\n      .containsOnly(new File(tmp.getRoot(), path(\"a\", \"..\", \".\", \"foo.txt\")));\n  }\n\n  @Test\n  public void absolute_paths_with_wildcards() {\n    assertThat(listFiles(new File(tmp.getRoot(), \"*.txt\").getAbsolutePath()))\n      .containsOnly(new File(tmp.getRoot(), \"foo.txt\"), new File(tmp.getRoot(), \"bar.txt\"));\n\n    assertThat(listFiles(new File(tmp.getRoot(), \"f*\").getAbsolutePath()))\n      .containsOnly(new File(tmp.getRoot(), \"foo.txt\"));\n\n    assertThat(listFiles(new File(tmp.getRoot(), \"fo?.txt\").getAbsolutePath()))\n      .containsOnly(new File(tmp.getRoot(), \"foo.txt\"));\n\n    assertThat(listFiles(new File(tmp.getRoot(), \"foo?.txt\").getAbsolutePath())).isEmpty();\n\n    assertThat(listFiles(new File(tmp.getRoot(), path(\"**\", \"foo.txt\")).getAbsolutePath()))\n      .containsOnly(\n        new File(tmp.getRoot(), \"foo.txt\"),\n        new File(tmp.getRoot(), path(\"a\", \"foo.txt\")),\n        new File(tmp.getRoot(), path(\"c\", \"c21\", \"foo.txt\")),\n        new File(tmp.getRoot(), path(\"c\", \"c22\", \"c31\", \"foo.txt\")));\n\n    assertThat(listFiles(new File(tmp.getRoot(), path(\"**\", \"c31\", \"foo.txt\")).getAbsolutePath()))\n      .containsOnly(new File(tmp.getRoot(), path(\"c\", \"c22\", \"c31\", \"foo.txt\")));\n\n    assertThat(listFiles(new File(tmp.getRoot(), path(\"**\", \"c?1\", \"foo.txt\")).getAbsolutePath()))\n      .containsOnly(new File(tmp.getRoot(), path(\"c\", \"c21\", \"foo.txt\")), new File(tmp.getRoot(), path(\"c\", \"c22\", \"c31\", \"foo.txt\")));\n\n    assertThat(listFiles(new File(tmp.getRoot(), path(\"?\", \"**\", \"foo.txt\")).getAbsolutePath()))\n      .containsOnly(\n        new File(tmp.getRoot(), path(\"a\", \"foo.txt\")),\n        new File(tmp.getRoot(), path(\"c\", \"c21\", \"foo.txt\")),\n        new File(tmp.getRoot(), path(\"c\", \"c22\", \"c31\", \"foo.txt\")));\n  }\n\n  @Test\n  public void relative_paths() {\n    assertThat(listFiles(\"foo.txt\", tmp.getRoot()))\n      .containsOnly(new File(tmp.getRoot(), \"foo.txt\"));\n\n    assertThat(listFiles(path(\"c\", \"c22\", \"c31\", \"foo.txt\"), tmp.getRoot()))\n      .containsOnly(new File(tmp.getRoot(), path(\"c\", \"c22\", \"c31\", \"foo.txt\")));\n\n    assertThat(listFiles(\"nonexisting.txt\", tmp.getRoot())).isEmpty();\n  }\n\n  @Test\n  public void relative_paths_with_current_and_parent_folder_access() {\n    assertThat(listFiles(path(\"..\", \"foo.txt\"), new File(tmp.getRoot(), \"a\")))\n      .containsOnly(new File(new File(tmp.getRoot(), \"a\"), path(\"..\", \"foo.txt\")));\n\n    assertThat(listFiles(path(\".\", \"foo.txt\"), tmp.getRoot()))\n      .containsOnly(new File(tmp.getRoot(), path(\".\", \"foo.txt\")));\n\n    assertThat(listFiles(path(\"a\", \"..\", \"foo.txt\"), tmp.getRoot()))\n      .containsOnly(new File(tmp.getRoot(), path(\"a\", \"..\", \"foo.txt\")));\n  }\n\n  @Test\n  public void relative_paths_with_wildcards() {\n    assertThat(listFiles(\"*.txt\", tmp.getRoot()))\n      .containsOnly(new File(tmp.getRoot(), \"foo.txt\"), new File(tmp.getRoot(), \"bar.txt\"));\n\n    assertThat(listFiles(\"f*\", tmp.getRoot()))\n      .containsOnly(new File(tmp.getRoot(), \"foo.txt\"));\n\n    assertThat(listFiles(\"fo?.txt\", tmp.getRoot()))\n      .containsOnly(new File(tmp.getRoot(), \"foo.txt\"));\n\n    assertThat(listFiles(\"foo?.txt\", tmp.getRoot())).isEmpty();\n\n    assertThat(listFiles(path(\"**\", \"foo.txt\"), tmp.getRoot()))\n      .containsOnly(\n        new File(tmp.getRoot(), \"foo.txt\"),\n        new File(tmp.getRoot(), path(\"a\", \"foo.txt\")),\n        new File(tmp.getRoot(), path(\"c\", \"c21\", \"foo.txt\")),\n        new File(tmp.getRoot(), path(\"c\", \"c22\", \"c31\", \"foo.txt\")));\n\n    assertThat(listFiles(path(\"**\", \"c31\", \"foo.txt\"), tmp.getRoot()))\n      .containsOnly(new File(tmp.getRoot(), path(\"c\", \"c22\", \"c31\", \"foo.txt\")));\n\n    assertThat(listFiles(path(\"**\", \"c?1\", \"foo.txt\"), tmp.getRoot()))\n      .containsOnly(new File(tmp.getRoot(), path(\"c\", \"c21\", \"foo.txt\")), new File(tmp.getRoot(), path(\"c\", \"c22\", \"c31\", \"foo.txt\")));\n\n    assertThat(listFiles(path(\"?\", \"**\", \"foo.txt\"), tmp.getRoot()))\n      .containsOnly(\n        new File(tmp.getRoot(), path(\"a\", \"foo.txt\")),\n        new File(tmp.getRoot(), path(\"c\", \"c21\", \"foo.txt\")),\n        new File(tmp.getRoot(), path(\"c\", \"c22\", \"c31\", \"foo.txt\")));\n  }\n\n  @Test\n  public void should_fail_with_current_folder_access_after_wildcard() {\n    thrown.expect(IllegalArgumentException.class);\n    thrown.expectMessage(\"Cannot contain '.' or '..' after the first wildcard.\");\n\n    listFiles(new File(tmp.getRoot(), path(\"?\", \".\", \"foo.txt\")).getAbsolutePath());\n  }\n\n  @Test\n  public void should_fail_with_parent_folder_access_after_wildcard() {\n    thrown.expect(IllegalArgumentException.class);\n    thrown.expectMessage(\"Cannot contain '.' or '..' after the first wildcard.\");\n\n    listFiles(path(\"*\", \"..\", \"foo.txt\"), tmp.getRoot());\n  }\n\n  @Test\n  public void given_pattern_with_mixed_folder_separator_listFiles_supports_pattern() {\n    File tmpRoot = tmp.getRoot();\n    String givenPattern = tmpRoot + File.separator + \"agent_work9\" + File.separator + \"_temp/**/*.trx\";\n\n    listFiles(givenPattern);\n\n    List<String> debugLogs = logTester.logs((Level.DEBUG));\n    assertThat(debugLogs.get(1)).isEqualTo(\"Gathering files for wildcardPattern '**\" + File.separator + \"*.trx'.\");\n  }\n\n  private static String path(String... elements) {\n    return String.join(File.separator, elements);\n  }\n\n  private static Set<File> listFiles(String pattern) {\n    return listFiles(pattern, null);\n  }\n\n  private static Set<File> listFiles(String pattern, File baseDir) {\n    return new WildcardPatternFileProvider(baseDir).listFiles(pattern);\n  }\n\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonar/plugins/dotnet/tests/XUnitTestResultParserTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests;\n\nimport java.io.File;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.slf4j.event.Level;\nimport org.sonar.api.testfixtures.log.LogTester;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.assertThrows;\n\npublic class XUnitTestResultParserTest {\n\n  @Rule\n  public LogTester logTester = new LogTester();\n\n  @Before\n  public void before() {\n    logTester.setLevel(Level.DEBUG);\n  }\n\n  @Test\n  public void valid() {\n    Map<String, UnitTestResults> results = new HashMap<>();\n    Map<String, String> fileMap = new HashMap<>() {\n      {\n        put(\"XUnitTestProj.XUnitTestProject1.UnitTest1.XUnitTestMethod1\", \"C:\\\\dev\\\\Playground\\\\XUnit\\\\UnitTest1.cs\");\n        put(\"XUnitTestProj.XUnitTestProject1.UnitTest1.XUnitTestShouldFail\", \"C:\\\\dev\\\\Playground\\\\XUnit\\\\UnitTest1.cs\");\n        put(\"XUnitTestProj.XUnitTestProject1.UnitTest1.XUnitTestShouldSkip\", \"C:\\\\dev\\\\Playground\\\\XUnit\\\\UnitTest1.cs\");\n        put(\"XUnitTestProj.XUnitTestProject1.UnitTest1.XUnitTestShouldError\", \"C:\\\\dev\\\\Playground\\\\XUnit\\\\UnitTest1.cs\");\n        put(\"XUnitTestProj2.XUnitTestProject2.UnitTest2.XUnitTestNotRun\", \"C:\\\\dev\\\\Playground\\\\XUnit2\\\\UnitTest1.cs\");\n      }\n    };\n\n    var sut = new XUnitTestResultsParser();\n\n    sut.parse(new File(\"src/test/resources/xunit/valid.xml\"), results, fileMap);\n\n    assertThat(results).hasSize(2);\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\XUnit\\\\UnitTest1.cs\").tests()).isEqualTo(4);\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\XUnit\\\\UnitTest1.cs\").failures()).isEqualTo(2);\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\XUnit\\\\UnitTest1.cs\").skipped()).isEqualTo(1);\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\XUnit\\\\UnitTest1.cs\").errors()).isZero();\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\XUnit\\\\UnitTest1.cs\").executionTime()).isEqualTo(5);\n\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\XUnit2\\\\UnitTest1.cs\").tests()).isEqualTo(1);\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\XUnit2\\\\UnitTest1.cs\").failures()).isZero();\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\XUnit2\\\\UnitTest1.cs\").skipped()).isEqualTo(1);\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\XUnit2\\\\UnitTest1.cs\").errors()).isZero();\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\XUnit2\\\\UnitTest1.cs\").executionTime()).isEqualTo(6);\n\n    List<String> infoLogs = logTester.logs(Level.INFO);\n    assertThat(infoLogs).hasSize(1);\n    assertThat(infoLogs.get(0)).startsWith(\"Parsing the XUnit Test Results file \");\n\n    List<String> debugLogs = logTester.logs(Level.DEBUG);\n    assertThat(debugLogs)\n      .hasSize(7)\n      .contains(\n        \"XUnit Assembly found, assembly name: C:\\\\dev\\\\Playground\\\\XUnit\\\\bin\\\\Debug\\\\net9.0\\\\XUnitTestProj.dll, Extracted dllName: XUnitTestProj\",\n        \"Added Test Method: XUnitTestProj.XUnitTestProject1.UnitTest1.XUnitTestShouldFail to File: C:\\\\dev\\\\Playground\\\\XUnit\\\\UnitTest1.cs\",\n        \"XUnit Assembly found, assembly name: C:\\\\dev\\\\Playground\\\\XUnit\\\\bin\\\\Debug\\\\net9.0\\\\XUnitTestProj2.dll, Extracted dllName: XUnitTestProj2\",\n        \"Added Test Method: XUnitTestProj2.XUnitTestProject2.UnitTest2.XUnitTestNotRun to File: C:\\\\dev\\\\Playground\\\\XUnit2\\\\UnitTest1.cs\"\n      );\n  }\n\n  @Test\n  public void valid_no_execution_time() {\n    Map<String, UnitTestResults> results = new HashMap<>();\n    Map<String, String> fileMap = Map.of(\"XUnitTestProj.XUnitTestProject1.UnitTest1.XUnitTestMethod1\", \"C:\\\\dev\\\\Playground\\\\XUnit\\\\UnitTest1.cs\");\n\n    var sut = new XUnitTestResultsParser();\n\n    sut.parse(new File(\"src/test/resources/xunit/valid_no_execution_time.xml\"), results, fileMap);\n\n    assertThat(results).hasSize(1);\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\XUnit\\\\UnitTest1.cs\").tests()).isEqualTo(1);\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\XUnit\\\\UnitTest1.cs\").failures()).isZero();\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\XUnit\\\\UnitTest1.cs\").skipped()).isZero();\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\XUnit\\\\UnitTest1.cs\").errors()).isZero();\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\XUnit\\\\UnitTest1.cs\").executionTime()).isNull();\n\n    List<String> infoLogs = logTester.logs(Level.INFO);\n    assertThat(infoLogs).hasSize(1);\n    assertThat(infoLogs.get(0)).startsWith(\"Parsing the XUnit Test Results file \");\n\n    List<String> debugLogs = logTester.logs(Level.DEBUG);\n    assertThat(debugLogs)\n      .hasSize(2)\n      .contains(\n        \"XUnit Assembly found, assembly name: C:\\\\dev\\\\Playground\\\\XUnit\\\\bin\\\\Debug\\\\net9.0\\\\XUnitTestProj.dll, Extracted dllName: XUnitTestProj\",\n        \"Added Test Method: XUnitTestProj.XUnitTestProject1.UnitTest1.XUnitTestMethod1 to File: C:\\\\dev\\\\Playground\\\\XUnit\\\\UnitTest1.cs\"\n      );\n\n    assertThat(logTester.logs(Level.DEBUG).get(0)).startsWith(\"XUnit Assembly found, assembly name:\");\n    assertThat(logTester.logs(Level.DEBUG).get(1)).startsWith(\"Added Test Method:\");\n  }\n\n  @Test\n  public void valid_data_attribute()\n  {\n    Map<String, UnitTestResults> results = new HashMap<>();\n    Map<String, String> fileMap = Map.of(\"XUnitTestProj.DataDrivenWithXUnit.Test.CalculatorTestWithClassData.Add_ShouldReturnCorrectSum\", \"C:\\\\dev\\\\Playground\\\\XUnit\\\\UnitTest1.cs\");\n\n    var sut = new XUnitTestResultsParser();\n\n    sut.parse(new File(\"src/test/resources/xunit/valid_data_attribute.xml\"), results, fileMap);\n\n    assertThat(results).hasSize(1);\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\XUnit\\\\UnitTest1.cs\").tests()).isEqualTo(2);\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\XUnit\\\\UnitTest1.cs\").failures()).isZero();\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\XUnit\\\\UnitTest1.cs\").skipped()).isZero();\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\XUnit\\\\UnitTest1.cs\").errors()).isZero();\n    assertThat(results.get(\"C:\\\\dev\\\\Playground\\\\XUnit\\\\UnitTest1.cs\").executionTime()).isEqualTo(8);\n\n    List<String> infoLogs = logTester.logs(Level.INFO);\n    assertThat(infoLogs).hasSize(1);\n    assertThat(infoLogs.get(0)).startsWith(\"Parsing the XUnit Test Results file \");\n\n    List<String> debugLogs = logTester.logs(Level.DEBUG);\n    assertThat(debugLogs)\n      .hasSize(3)\n      .contains(\n        \"XUnit Assembly found, assembly name: C:\\\\dev\\\\Playground\\\\XUnit\\\\bin\\\\Debug\\\\net9.0\\\\XUnitTestProj.dll, Extracted dllName: XUnitTestProj\",\n        \"Added Test Method: XUnitTestProj.DataDrivenWithXUnit.Test.CalculatorTestWithClassData.Add_ShouldReturnCorrectSum to File: C:\\\\dev\\\\Playground\\\\XUnit\\\\UnitTest1.cs\"\n      );\n  }\n\n  @Test\n  public void valid_generic_method_csharp() {\n    var sut = new XUnitTestResultsParser();\n    Map<String, String> fileMap = Map.of(\n      \"Calculator.xUnit.Calculator.xUnit.GenericTests.GenericTestMethod\", \"CalculatorTests.cs\",\n      \"Calculator.xUnit.Calculator.xUnit.Derived.VirtualMethodInBaseClass\", \"CalculatorTests.cs\",\n      \"Calculator.xUnit.Calculator.xUnit.Derived.TestMethodInBaseClass\", \"CalculatorTests.cs\",\n      \"Calculator.xUnit.Calculator.xUnit.Tests.TestMethod1\", \"CalculatorTests.cs\",\n      \"Calculator.xUnit.Calculator.xUnit.GenericDerivedFromGenericClass.VirtualMethodInBaseClass\", \"CalculatorTests.cs\",\n      \"Calculator.xUnit.Calculator.xUnit.GenericDerivedFromGenericClass.GenericDerivedFromGenericClass_PassMethod\", \"CalculatorTests.cs\",\n      \"Calculator.xUnit.Calculator.xUnit.GenericDerivedFromGenericClass.TestMethodInBaseClass\", \"CalculatorTests.cs\"\n    );\n    Map<String, UnitTestResults> results = new HashMap<>();\n\n    sut.parse(new File(\"src/test/resources/xunit/valid_generic_methods_csharp.xml\"), results, fileMap);\n\n    assertThat(results).hasSize(1);\n    var calculatorTestsResult = results.get(\"CalculatorTests.cs\");\n    assertThat(calculatorTestsResult.tests()).isEqualTo(8);\n    assertThat(calculatorTestsResult.failures()).isEqualTo(3);\n    assertThat(calculatorTestsResult.skipped()).isZero();\n    assertThat(calculatorTestsResult.errors()).isZero();\n    assertThat(calculatorTestsResult.executionTime()).isEqualTo(29);\n\n    assertThat(logTester.logs(Level.WARN)).isEmpty();\n\n    List<String> infoLogs = logTester.logs(Level.INFO);\n    assertThat(infoLogs).hasSize(1);\n    assertThat(infoLogs.get(0)).startsWith(\"Parsing the XUnit Test Results file \");\n\n    assertThat(logTester.logs(Level.DEBUG))\n      .hasSize(9)\n      .contains(\n        \"XUnit Assembly found, assembly name: Calculator.xUnit\\\\bin\\\\Debug\\\\net9.0\\\\Calculator.xUnit.dll, Extracted dllName: Calculator.xUnit\",\n        \"Added Test Method: Calculator.xUnit.Calculator.xUnit.GenericDerivedFromGenericClass.VirtualMethodInBaseClass to File: CalculatorTests.cs\",\n        \"Added Test Method: Calculator.xUnit.Calculator.xUnit.GenericDerivedFromGenericClass.GenericDerivedFromGenericClass_PassMethod to File: CalculatorTests.cs\",\n        \"Added Test Method: Calculator.xUnit.Calculator.xUnit.GenericDerivedFromGenericClass.TestMethodInBaseClass to File: CalculatorTests.cs\",\n        \"Added Test Method: Calculator.xUnit.Calculator.xUnit.Derived.VirtualMethodInBaseClass to File: CalculatorTests.cs\",\n        \"Added Test Method: Calculator.xUnit.Calculator.xUnit.Derived.TestMethodInBaseClass to File: CalculatorTests.cs\",\n        \"Added Test Method: Calculator.xUnit.Calculator.xUnit.GenericTests.GenericTestMethod to File: CalculatorTests.cs\",\n        \"Added Test Method: Calculator.xUnit.Calculator.xUnit.GenericTests.GenericTestMethod to File: CalculatorTests.cs\",\n        \"Added Test Method: Calculator.xUnit.Calculator.xUnit.Tests.TestMethod1 to File: CalculatorTests.cs\"\n      );\n  }\n\n  @Test\n  public void valid_generic_method_vbnet() {\n    Map<String, String> fileMap = Map.of(\n        \"Calculator.xUnit.Calculator.xUnit.GenericDerivedFromGenericClass.VirtualMethodInBaseClass\", \"CalculatorTests.vb\",\n        \"Calculator.xUnit.Calculator.xUnit.GenericDerivedFromGenericClass.TestMethodInBaseClass\", \"CalculatorTests.vb\",\n        \"Calculator.xUnit.Calculator.xUnit.Derived.VirtualMethodInBaseClass\", \"CalculatorTests.vb\",\n        \"Calculator.xUnit.Calculator.xUnit.Derived.TestMethodInBaseClass\", \"CalculatorTests.vb\",\n        \"Calculator.xUnit.Calculator.xUnit.GenericTests.GenericTestMethod\", \"CalculatorTests.vb\",\n        \"Calculator.xUnit.Calculator.xUnit.Tests.TestMethod1\", \"CalculatorTests.vb\",\n        \"Calculator.xUnit.Calculator.xUnit.GenericDerivedFromGenericClass.GenericMethod\", \"CalculatorTests.vb\"\n      );\n    var sut = new XUnitTestResultsParser();\n    Map<String, UnitTestResults> results = new HashMap<>();\n\n    sut.parse(new File(\"src/test/resources/xunit/valid_generic_methods_vbnet.xml\"), results, fileMap);\n\n    assertThat(results).hasSize(1);\n    var calculatorTestsResult = results.get(\"CalculatorTests.vb\");\n    assertThat(calculatorTestsResult.tests()).isEqualTo(8);\n    assertThat(calculatorTestsResult.failures()).isEqualTo(3);\n    assertThat(calculatorTestsResult.skipped()).isZero();\n    assertThat(calculatorTestsResult.errors()).isZero();\n    assertThat(calculatorTestsResult.executionTime()).isEqualTo(45);\n\n    assertThat(logTester.logs(Level.WARN)).isEmpty();\n\n    List<String> infoLogs = logTester.logs(Level.INFO);\n    assertThat(infoLogs).hasSize(1);\n    assertThat(infoLogs.get(0)).startsWith(\"Parsing the XUnit Test Results file \");\n\n    assertThat(logTester.logs(Level.DEBUG))\n      .hasSize(9)\n      .contains(\n        \"XUnit Assembly found, assembly name: Calculator.xUnit\\\\bin\\\\Debug\\\\net9.0\\\\Calculator.xUnit.dll, Extracted dllName: Calculator.xUnit\",\n        \"Added Test Method: Calculator.xUnit.Calculator.xUnit.GenericDerivedFromGenericClass.VirtualMethodInBaseClass to File: CalculatorTests.vb\",\n        \"Added Test Method: Calculator.xUnit.Calculator.xUnit.GenericDerivedFromGenericClass.GenericMethod to File: CalculatorTests.vb\",\n        \"Added Test Method: Calculator.xUnit.Calculator.xUnit.GenericDerivedFromGenericClass.TestMethodInBaseClass to File: CalculatorTests.vb\",\n        \"Added Test Method: Calculator.xUnit.Calculator.xUnit.Derived.VirtualMethodInBaseClass to File: CalculatorTests.vb\",\n        \"Added Test Method: Calculator.xUnit.Calculator.xUnit.Derived.TestMethodInBaseClass to File: CalculatorTests.vb\",\n        \"Added Test Method: Calculator.xUnit.Calculator.xUnit.GenericTests.GenericTestMethod to File: CalculatorTests.vb\",\n        \"Added Test Method: Calculator.xUnit.Calculator.xUnit.GenericTests.GenericTestMethod to File: CalculatorTests.vb\",\n        \"Added Test Method: Calculator.xUnit.Calculator.xUnit.Tests.TestMethod1 to File: CalculatorTests.vb\"\n      );\n  }\n\n  @Test\n  public void test_name_not_mapped() {\n    var sut = new XUnitTestResultsParser();\n    var file = new File(\"src/test/resources/xunit/test_name_not_mapped.xml\");\n\n    sut.parse(file, new HashMap<>(), Map.of(\"Some.Other.TestMethod\", \"C:\\\\dev\\\\Playground\\\\XUnit.Test\\\\Sample.cs\"));\n\n    List<String> debugLogs = logTester.logs(Level.DEBUG);\n    assertThat(debugLogs).hasSize(2);\n    assertThat(debugLogs.get(1)).isEqualTo(\"Test method XUnitTestProj.XUnitTestProject1.UnitTest1.TestMethodDoesNotExist cannot be mapped to the test source file. The test will not be included.\");\n  }\n\n  @Test\n  public void invalid_root() {\n    var sut = new XUnitTestResultsParser();\n    var file = new File(\"src/test/resources/xunit/invalid_root.xml\");\n    var exception = assertThrows(ParseErrorException.class, () -> sut.parse(file, new HashMap<>(), new HashMap<>()));\n    assertThat(exception.getMessage()).startsWith(\"Missing or incorrect root element. Expected one of [<assembly>, <assemblies>], but got <foo> instead\");\n  }\n\n  @Test\n  public void invalid_test_outcome() {\n    var sut = new XUnitTestResultsParser();\n    var file = new File(\"src/test/resources/xunit/invalid_test_outcome.xml\");\n    Map<String, String> fileMap = Map.of(\"Playground.Test.TestProject1.UnitTest1.InvalidOutcome\", \"C:\\\\dev\\\\Playground\\\\Playground.Test\\\\Sample.cs\");\n\n    var exception = assertThrows(IllegalArgumentException.class, () -> sut.parse(file, new HashMap<>(), fileMap));\n\n    assertEquals(\"Outcome of unit test must match XUnit Test Format\", exception.getMessage());\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonar/plugins/dotnet/tests/XmlParserHelperTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests;\n\nimport java.io.File;\nimport java.util.function.Function;\nimport javax.xml.stream.Location;\nimport javax.xml.stream.XMLStreamException;\nimport javax.xml.stream.XMLStreamReader;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.ExpectedException;\nimport org.mockito.invocation.InvocationOnMock;\nimport org.mockito.stubbing.Answer;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\npublic class XmlParserHelperTest {\n\n  @Rule\n  public ExpectedException thrown = ExpectedException.none();\n\n  @Test\n  public void invalid_prolog() {\n    thrown.expectMessage(\"Error while parsing the XML file: \");\n    thrown.expectMessage(\"invalid_prolog.txt\");\n\n    new XmlParserHelper(new File(\"src/test/resources/xml_parser_helper/invalid_prolog.txt\")).nextStartTag();\n  }\n\n  @Test\n  public void nextStartOrEndTag() {\n    XmlParserHelper xml = new XmlParserHelper(new File(\"src/test/resources/xml_parser_helper/valid.xml\"));\n    assertThat(xml.nextStartOrEndTag()).isEqualTo(\"<foo>\");\n    assertThat(xml.nextStartOrEndTag()).isEqualTo(\"<bar>\");\n    assertThat(xml.nextStartOrEndTag()).isEqualTo(\"</bar>\");\n    assertThat(xml.nextStartOrEndTag()).isEqualTo(\"</foo>\");\n    assertThat(xml.nextStartOrEndTag()).isNull();\n  }\n\n  @Test\n  public void getDoubleAttribute() {\n    XmlParserHelper xml = new XmlParserHelper(new File(\"src/test/resources/xml_parser_helper/valid.xml\"));\n    xml.nextStartTag();\n    assertThat(xml.getDoubleAttribute(\"myDouble\")).isEqualTo(0.123);\n    assertThat(xml.getDoubleAttribute(\"myCommaDouble\")).isEqualTo(1.234);\n    assertThat(xml.getDoubleAttribute(\"nonExisting\")).isNull();\n\n    thrown.expectMessage(\"valid.xml\");\n    thrown.expectMessage(\"Expected an double instead of \\\"hello\\\" for the attribute \\\"myString\\\"\");\n    xml.getDoubleAttribute(\"myString\");\n  }\n\n  @Test\n  public void no_next_valid_tag() throws XMLStreamException {\n    XMLStreamReader mockedReader = mock(XMLStreamReader.class);\n    when(mockedReader.hasNext()).thenAnswer(createAnswerWithCount(i -> i < 3));\n    when(mockedReader.getLocation()).thenAnswer(createAnswerWithCount(XmlParserHelperTest::createLocation));\n    when(mockedReader.next()).thenThrow(XMLStreamException.class);\n\n    XmlParserHelper parser = createParserWithMockReader(mockedReader);\n\n    assertThat(parser.nextStartTag()).isNull();\n  }\n\n  @Test\n  public void null_location() throws XMLStreamException {\n    XMLStreamReader mockedReader = mock(XMLStreamReader.class);\n    when(mockedReader.hasNext()).thenReturn(true);\n    when(mockedReader.next()).thenThrow(XMLStreamException.class);\n\n    XmlParserHelper parser = createParserWithMockReader(mockedReader);\n\n    thrown.expect(IllegalStateException.class);\n    parser.nextStartTag();\n  }\n\n  private static XmlParserHelper createParserWithMockReader(XMLStreamReader mockedReader) {\n    return new XmlParserHelper(new File(\"src/test/resources/xml_parser_helper/valid.xml\")) {\n      @Override\n      XMLStreamReader createXmlStreamReader() {\n        return mockedReader;\n      }\n    };\n  }\n\n  private static Location createLocation(int i) {\n    return new Location() {\n      @Override\n      public int getLineNumber() {\n        return i;\n      }\n\n      @Override\n      public int getColumnNumber() {\n        return 0;\n      }\n\n      @Override\n      public int getCharacterOffset() {\n        return 0;\n      }\n\n      @Override\n      public String getPublicId() {\n        return null;\n      }\n\n      @Override\n      public String getSystemId() {\n        return null;\n      }\n    };\n  }\n\n  private static Answer createAnswerWithCount(Function<Integer, Object> applyFunction) {\n    return new Answer() {\n      private int count = 0;\n\n      @Override\n      public Object answer(InvocationOnMock invocationOnMock) {\n        count++;\n        return applyFunction.apply(count);\n      }\n    };\n  }\n\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonar/plugins/dotnet/tests/coverage/BranchCoverageTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests.coverage;\n\nimport java.util.Objects;\nimport org.junit.Test;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\npublic class BranchCoverageTest {\n  @Test\n  public void givenSameObjectEqualsReturnsTrue() {\n    BranchCoverage coverage = new BranchCoverage(3, 2, 1);\n    assertThat(coverage).isEqualTo(coverage);\n  }\n\n  @Test\n  public void givenNullEqualsReturnsFalse() {\n    assertThat(new BranchCoverage(3, 2, 1)).isNotEqualTo(null);\n  }\n\n  @Test\n  public void givenDifferentClassEqualsReturnsFalse() {\n    assertThat(new BranchCoverage(3, 2, 1)).isNotEqualTo(\"1\");\n  }\n\n  @Test\n  public void givenDifferentLineEqualsReturnsFalse() {\n    assertThat(new BranchCoverage(3, 2, 1)).isNotEqualTo(new BranchCoverage(2, 2, 1));\n  }\n\n  @Test\n  public void givenDifferentConditionsEqualsReturnsFalse() {\n    assertThat(new BranchCoverage(3, 2, 1)).isNotEqualTo(new BranchCoverage(3, 4, 1));\n  }\n\n  @Test\n  public void givenDifferentCoveredConditionsEqualsReturnsFalse() {\n    assertThat(new BranchCoverage(3, 2, 1)).isNotEqualTo(new BranchCoverage(3, 2, 0));\n  }\n\n  @Test\n  public void givenEqualBranchCoverageEqualsReturnsTrue() {\n    assertThat(new BranchCoverage(3, 2, 1)).isEqualTo(new BranchCoverage(3, 2, 1));\n  }\n\n  @Test\n  public void givenLineConditionsAndCoveredConditionsHashCodeConsidersAll() {\n    assertThat(new BranchCoverage(3, 2, 1).hashCode()).isEqualTo(Objects.hash(3, 2, 1));\n  }\n\n  @Test\n  public void toStringTest() {\n    assertThat(new BranchCoverage(3, 2, 1)).hasToString(\"Branch coverage [line=3, conditions=2, coveredConditions=1]\");\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonar/plugins/dotnet/tests/coverage/CoberturaReportParserTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests.coverage;\n\nimport java.io.File;\nimport java.util.List;\nimport java.util.Optional;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.slf4j.event.Level;\nimport org.sonar.api.testfixtures.log.LogTester;\nimport org.sonar.plugins.dotnet.tests.FileService;\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.junit.Assert.assertThrows;\nimport static org.mockito.ArgumentMatchers.anyString;\nimport static org.mockito.ArgumentMatchers.contains;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.times;\nimport static org.mockito.Mockito.verify;\nimport static org.mockito.Mockito.when;\n\npublic class CoberturaReportParserTest {\n\n  @Rule\n  public LogTester logTester = new LogTester();\n\n  private FileService alwaysTrue;\n  private FileService alwaysFalseAndEmpty;\n\n  @Before\n  public void prepare() {\n    logTester.setLevel(Level.TRACE);\n    alwaysTrue = mock(FileService.class);\n    when(alwaysTrue.isSupportedAbsolute(anyString())).thenReturn(true);\n    when(alwaysTrue.getAbsolutePath(anyString())).thenThrow(new UnsupportedOperationException(\"Should not call this\"));\n    alwaysFalseAndEmpty = mock(FileService.class);\n    when(alwaysFalseAndEmpty.isSupportedAbsolute(anyString())).thenReturn(false);\n    when(alwaysFalseAndEmpty.getAbsolutePath(anyString())).thenReturn(Optional.empty());\n  }\n\n  @Test\n  public void invalid_root() {\n    var exception = assertThrows(RuntimeException.class,\n      () -> parseCoverage(\"invalid_root.xml\"));\n    assertThat(exception).hasMessageContaining(\"<coverage>\");\n  }\n\n  @Test\n  public void non_existing_file() {\n    var exception = assertThrows(RuntimeException.class,\n      () -> parseCoverage(\"non_existing_file.xml\"));\n    assertThat(exception).hasMessageContaining(\"non_existing_file.xml\");\n  }\n\n  @Test\n  public void valid_empty() {\n    Coverage coverage = parseCoverage(\"valid_empty.xml\");\n    assertThat(coverage.files()).isEmpty();\n  }\n\n  @Test\n  public void absolute_path_no_sources_resolves_file() {\n    parseCoverage(\"absolute_path_no_sources.xml\");\n    verify(alwaysTrue).isSupportedAbsolute(contains(\"Class1.cs\"));\n    assertThat(logTester.logs(Level.DEBUG)).anyMatch(log -> log.contains(\"CoveredFile created\") && log.contains(\"indexed as\"));\n  }\n\n  @Test\n  public void absolute_path_with_sources_ignores_sources() {\n    parseCoverage(\"absolute_path_with_sources.xml\");\n    verify(alwaysTrue).isSupportedAbsolute(contains(\"Class1.cs\"));\n    assertThat(logTester.logs(Level.DEBUG))\n      .anyMatch(log -> log.contains(\"found source\"))\n      .anyMatch(log -> log.contains(\"CoveredFile created\") && log.contains(\"indexed as\"));\n  }\n\n  @Test\n  public void relative_path_with_sources_uses_first_matching_source() {\n    FileService selectiveService = mock(FileService.class);\n    when(selectiveService.isSupportedAbsolute(anyString())).thenReturn(false);\n    when(selectiveService.isSupportedAbsolute(contains(\"SecondSource\"))).thenReturn(true);\n    when(selectiveService.getAbsolutePath(anyString())).thenReturn(Optional.empty());\n\n    parseCoverage(\"relative_path_with_sources.xml\", selectiveService);\n    // Verify both sources were evaluated: FirstSource was tried and rejected, then SecondSource matched\n    verify(selectiveService, times(2)).isSupportedAbsolute(anyString());\n    assertThat(logTester.logs(Level.DEBUG)).anyMatch(log ->\n      log.contains(\"CoveredFile created\") && log.contains(\"SecondSource\") && log.contains(\"indexed as\"));\n  }\n\n  @Test\n  public void relative_path_with_sources_no_match_skips_file() {\n    parseCoverage(\"relative_path_with_sources.xml\", alwaysFalseAndEmpty);\n    assertThat(logTester.logs(Level.DEBUG)).anyMatch(log -> log.contains(\"could not resolve relative filename\"));\n  }\n\n  @Test\n  public void relative_path_no_sources_skips_file() {\n    parseCoverage(\"relative_path_no_sources.xml\");\n    assertThat(logTester.logs(Level.DEBUG)).anyMatch(log -> log.contains(\"could not resolve relative filename\"));\n  }\n\n  @Test\n  public void multiple_classes_same_filename_resolved_once() {\n    parseCoverage(\"multiple_classes_same_filename.xml\");\n    verify(alwaysTrue, times(1)).isSupportedAbsolute(anyString());\n    long coveredFileLogCount = logTester.logs(Level.DEBUG).stream()\n      .filter(log -> log.contains(\"CoveredFile created\"))\n      .count();\n    assertThat(coveredFileLogCount).isEqualTo(1);\n  }\n\n  @Test\n  public void empty_source_tag_is_ignored() {\n    parseCoverage(\"empty_source_tag.xml\");\n    assertThat(logTester.logs(Level.DEBUG)).noneMatch(log -> log.contains(\"found source\"));\n    verify(alwaysTrue).isSupportedAbsolute(anyString());\n  }\n\n  @Test\n  public void should_not_fail_with_invalid_path() {\n    parseCoverage(\"invalid_path.xml\");\n    assertThat(logTester.logs(Level.DEBUG)).anyMatch(log -> log.contains(\"Skipping the import of Cobertura code coverage for the invalid file path\"));\n  }\n\n  @Test\n  public void source_with_nested_elements_does_not_fail() {\n    parseCoverage(\"source_with_nested_elements.xml\");\n    assertThat(logTester.logs(Level.DEBUG)).anyMatch(log -> log.contains(\"failed to read <source> element text\"));\n    verify(alwaysTrue).isSupportedAbsolute(anyString());\n  }\n\n  @Test\n  public void deterministic_build_path_fallback() {\n    FileService deterministicService = mock(FileService.class);\n    when(deterministicService.isSupportedAbsolute(anyString())).thenReturn(false);\n    when(deterministicService.getAbsolutePath(anyString())).thenReturn(Optional.of(\"C:\\\\resolved\\\\Lib\\\\Class1.cs\"));\n\n    parseCoverage(\"absolute_path_no_sources.xml\", deterministicService);\n    verify(deterministicService).getAbsolutePath(anyString());\n    assertThat(logTester.logs(Level.DEBUG)).anyMatch(log -> log.contains(\"CoveredFile created\") && log.contains(\"indexed as\"));\n  }\n\n  @Test\n  public void line_coverage_adds_hits() {\n    Coverage coverage = parseCoverage(\"line_coverage.xml\");\n    assertThat(coverage.files()).hasSize(2);\n    String file1 = getFilePath(coverage, \"Class1\");\n    assertThat(coverage.hits(file1))\n      .hasSize(3)\n      .containsEntry(10, 6)   // hits=3 from method + hits=3 from class = 6\n      .containsEntry(11, 0)   // hits=0 from method only\n      .containsEntry(15, 1);  // hits=1 from class only\n    String file2 = getFilePath(coverage, \"Class2\");\n    assertThat(coverage.hits(file2))\n      .hasSize(2)\n      .containsEntry(5, 3)    // hits=2 from method + hits=1 from class = 3\n      .containsEntry(20, 4);  // hits=4 from class only\n  }\n\n  @Test\n  public void line_coverage_unresolved_file_skips_lines() {\n    Coverage coverage = parseCoverage(\"line_coverage_unresolved_file.xml\");\n    // Relative path with no sources — file can't resolve, lines are skipped\n    assertThat(coverage.files()).isEmpty();\n  }\n\n  @Test\n  public void branch_jump_conditions_creates_two_condition_data_per_condition() {\n    Coverage coverage = parseCoverage(\"branch_jump_conditions.xml\");\n    String filePath = getFilePath(coverage, \"Class1\");\n    List<ConditionData> conditions = getConditions(coverage, filePath);\n    assertThat(conditions)\n      .hasSize(12)\n      .allMatch(c -> \"cobertura\".equals(c.getFormat()));\n    // condition 24: 100% -> path 0 hit=1, path 1 hit=1\n    List<ConditionData> cond24 = conditions.stream().filter(c -> c.getLocationStart() == 24).toList();\n    assertThat(cond24).hasSize(4); // 2 paths x 2 occurrences\n    assertThat(cond24.stream().filter(c -> c.getPath() == 0).allMatch(c -> c.getHits() == 1)).isTrue();\n    assertThat(cond24.stream().filter(c -> c.getPath() == 1).allMatch(c -> c.getHits() == 1)).isTrue();\n    // condition 36: 50% -> path 0 hit=1, path 1 hit=0\n    List<ConditionData> cond36 = conditions.stream().filter(c -> c.getLocationStart() == 36).toList();\n    assertThat(cond36).hasSize(4);\n    assertThat(cond36.stream().filter(c -> c.getPath() == 0).allMatch(c -> c.getHits() == 1)).isTrue();\n    assertThat(cond36.stream().filter(c -> c.getPath() == 1).allMatch(c -> c.getHits() == 0)).isTrue();\n    // condition 48: 0% -> both paths hit=0\n    List<ConditionData> cond48 = conditions.stream().filter(c -> c.getLocationStart() == 48).toList();\n    assertThat(cond48)\n      .hasSize(4)\n      .allMatch(c -> c.getHits() == 0);\n    // line coverage still recorded\n    assertThat(coverage.hits(filePath)).containsEntry(10, 4).containsEntry(11, 2);\n    assertThat(logTester.logs(Level.TRACE)).anyMatch(log -> log.contains(\"add jump branch conditions\"));\n  }\n\n  @Test\n  public void branch_switch_condition_creates_n_condition_data() {\n    Coverage coverage = parseCoverage(\"branch_switch_condition.xml\");\n    String filePath = getFilePath(coverage, \"Class1\");\n    // Switch with condition-coverage=\"33% (2/6)\" appears twice (method + class)\n    List<ConditionData> conditions = getConditions(coverage, filePath);\n    // 6 paths * 2 occurrences = 12\n    assertThat(conditions)\n      .hasSize(12)\n      .allMatch(c -> \"cobertura\".equals(c.getFormat()))\n      .allMatch(c -> c.getLocationStart() == 48)\n      .allMatch(c -> c.getLocationEnd() == 0);\n    // First 2 of 6 paths have hits (per occurrence)\n    List<ConditionData> firstOccurrence = conditions.stream().limit(6).toList();\n    assertThat(firstOccurrence.stream().filter(c -> c.getPath() < 2).allMatch(c -> c.getHits() == 1)).isTrue();\n    assertThat(firstOccurrence.stream().filter(c -> c.getPath() >= 2).allMatch(c -> c.getHits() == 0)).isTrue();\n    // getBranchCoverage aggregated result: 6 total, 2 covered\n    assertThat(coverage.getBranchCoverage(filePath))\n      .containsExactly(new BranchCoverage(42, 6, 2));\n    assertThat(logTester.logs(Level.TRACE)).anyMatch(log -> log.contains(\"add 6 switch branch conditions\"));\n  }\n\n  @Test\n  public void branch_no_conditions_creates_unmergeable_condition_data() {\n    Coverage coverage = parseCoverage(\"branch_no_conditions.xml\");\n    String filePath = getFilePath(coverage, \"Class1\");\n    List<ConditionData> conditions = getConditions(coverage, filePath);\n    // condition-coverage=\"50% (2/4)\" -> 4 ConditionData\n    assertThat(conditions)\n      .hasSize(4)\n      .allMatch(c -> \"unmergeable\".equals(c.getFormat()))\n      .allMatch(c -> c.getStartLine() == 42);\n    // First 2 have hits, last 2 don't\n    assertThat(conditions.stream().filter(c -> c.getPath() < 2).allMatch(c -> c.getHits() == 1)).isTrue();\n    assertThat(conditions.stream().filter(c -> c.getPath() >= 2).allMatch(c -> c.getHits() == 0)).isTrue();\n    // locationStart equals path index for unmergeable\n    for (ConditionData c : conditions) {\n      assertThat(c.getLocationStart()).isEqualTo(c.getPath());\n    }\n    // line coverage recorded\n    assertThat(coverage.hits(filePath)).containsEntry(42, 2).containsEntry(43, 0);\n    assertThat(logTester.logs(Level.TRACE)).anyMatch(log -> log.contains(\"add 4 unmergeable branch conditions\"));\n  }\n\n  @Test\n  public void branch_mixed_jump_and_switch_conditions() {\n    Coverage coverage = parseCoverage(\"branch_mixed_conditions.xml\");\n    // Class1: 1 jump + 1 switch, condition-coverage=\"50% (3/6)\"\n    // Jump condition 24 (100%): 2 ConditionData, both hit. Consumes 2 branches, 2 covered.\n    // Switch condition 48: remainingTotal=6-2=4, remainingCovered=max(0,3-2)=1 -> 4 ConditionData, 1 hit.\n    String class1Path = getFilePath(coverage, \"Class1\");\n    List<ConditionData> class1Conditions = getConditions(coverage, class1Path);\n    assertThat(class1Conditions)\n      .hasSize(6)\n      .allMatch(c -> \"cobertura\".equals(c.getFormat()));\n    List<ConditionData> jump24 = class1Conditions.stream().filter(c -> c.getLocationStart() == 24).toList();\n    assertThat(jump24)\n      .hasSize(2)\n      .allMatch(c -> c.getHits() == 1);\n    List<ConditionData> switch48 = class1Conditions.stream().filter(c -> c.getLocationStart() == 48).toList();\n    assertThat(switch48).hasSize(4);\n    assertThat(switch48.stream().filter(c -> c.getPath() == 0).allMatch(c -> c.getHits() == 1)).isTrue();\n    assertThat(switch48.stream().filter(c -> c.getPath() >= 1).allMatch(c -> c.getHits() == 0)).isTrue();\n    // Class2: 2 jumps + 1 switch, condition-coverage=\"50% (5/10)\"\n    // Jump 0 (100%): 2 entries, both hit. Consumes 2 branches, 2 covered.\n    // Jump 1 (50%):  2 entries, path0 hit, path1 not. Consumes 2 branches, 1 covered.\n    // Switch 2: remainingTotal=10-4=6, remainingCovered=max(0,5-3)=2 -> 6 entries, 2 hit.\n    String class2Path = getFilePath(coverage, \"Class2\");\n    List<ConditionData> class2Conditions = getConditions(coverage, class2Path);\n    assertThat(class2Conditions)\n      .hasSize(10)\n      .allMatch(c -> \"cobertura\".equals(c.getFormat()));\n\n    List<ConditionData> jump0 = class2Conditions.stream().filter(c -> c.getLocationStart() == 0).toList();\n    assertThat(jump0)\n      .hasSize(2)\n      .allMatch(c -> c.getHits() == 1);\n\n    List<ConditionData> jump1 = class2Conditions.stream().filter(c -> c.getLocationStart() == 1).toList();\n    assertThat(jump1).hasSize(2);\n    assertThat(jump1.stream().filter(c -> c.getPath() == 0).allMatch(c -> c.getHits() == 1)).isTrue();\n    assertThat(jump1.stream().filter(c -> c.getPath() == 1).allMatch(c -> c.getHits() == 0)).isTrue();\n\n    List<ConditionData> switch2 = class2Conditions.stream().filter(c -> c.getLocationStart() == 2).toList();\n    assertThat(switch2).hasSize(6);\n    assertThat(switch2.stream().filter(c -> c.getPath() < 2).allMatch(c -> c.getHits() == 1)).isTrue();\n    assertThat(switch2.stream().filter(c -> c.getPath() >= 2).allMatch(c -> c.getHits() == 0)).isTrue();\n  }\n\n  @Test\n  public void branch_malformed_condition_coverage_treats_as_zero_percent() {\n    Coverage coverage = parseCoverage(\"branch_malformed_condition_coverage.xml\");\n    String filePath = getFilePath(coverage, \"Class1\");\n    List<ConditionData> conditions = getConditions(coverage, filePath);\n    assertThat(conditions)\n      .hasSize(2)\n      .allMatch(c -> c.getHits() == 0);\n    assertThat(logTester.logs(Level.DEBUG)).anyMatch(log -> log.contains(\"could not parse coverage percentage\"));\n  }\n\n  @Test\n  public void branch_missing_condition_coverage_attribute_skips_branch_data() {\n    Coverage coverage = parseCoverage(\"branch_no_condition_coverage_attr.xml\");\n    String filePath = getFilePath(coverage, \"Class1\");\n    assertThat(getConditions(coverage, filePath)).isEmpty();\n    assertThat(coverage.hits(filePath)).containsEntry(10, 3).containsEntry(11, 1);\n  }\n\n  @Test\n  public void branch_unresolved_file_skips_condition_data() {\n    Coverage coverage = parseCoverage(\"branch_unresolved_file.xml\");\n    assertThat(coverage.files()).isEmpty();\n    assertThat(coverage.getConditionData()).isEmpty();\n  }\n\n  private Coverage parseCoverage(String reportFileName) {\n    return parseCoverage(reportFileName, alwaysTrue);\n  }\n\n  private Coverage parseCoverage(String reportFileName, FileService fileService) {\n    Coverage coverage = new Coverage();\n    new CoberturaReportParser(fileService).accept(new File(\"src/test/resources/cobertura/\" + reportFileName), coverage);\n    return coverage;\n  }\n\n  private String getFilePath(Coverage coverage, String className) {\n    return coverage.files().stream()\n      .filter(f -> f.contains(className))\n      .findFirst()\n      .orElseThrow();\n  }\n\n  private List<ConditionData> getConditions(Coverage coverage, String filePath) {\n    return coverage.getConditionData().stream()\n      .filter(c -> c.getFilePath().equals(filePath))\n      .toList();\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonar/plugins/dotnet/tests/coverage/ConditionDataTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests.coverage;\n\nimport org.junit.Test;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\npublic class ConditionDataTest {\n  @Test\n  public void givenConditionData_getUniqueKey_containsFilePathStartLineAndLocations(){\n    assertThat(new ConditionData(\"opencover\", \"path\", 1, new ConditionData.Location(2, 3), 4, 5, \"coverageIdentifier\").getUniqueKey()).isEqualTo(\"path-1-2-3-4\");\n  }\n\n  @Test\n  public void givenConditionData_getFormat_returnsFormat(){\n    assertThat(new ConditionData(\"opencover\", \"path\", 1, new ConditionData.Location(2, 3), 4, 5, \"coverageIdentifier\").getFormat()).isEqualTo(\"opencover\");\n    assertThat(new ConditionData(\"cobertura\", \"path\", 1, new ConditionData.Location(2, 3), 4, 5, \"coverageIdentifier\").getFormat()).isEqualTo(\"cobertura\");\n    assertThat(new ConditionData(\"unmergeable\", \"path\", 1, new ConditionData.Location(2, 3), 4, 5, \"coverageIdentifier\").getFormat()).isEqualTo(\"unmergeable\");\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonar/plugins/dotnet/tests/coverage/CoverageAggregatorTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests.coverage;\n\nimport java.io.File;\nimport java.util.Collections;\nimport java.util.HashSet;\nimport java.util.function.Predicate;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.ExpectedException;\nimport org.mockito.ArgumentCaptor;\nimport org.mockito.Mockito;\nimport org.sonar.api.batch.fs.FileSystem;\nimport org.sonar.api.config.Configuration;\nimport org.sonar.api.config.internal.MapSettings;\nimport org.sonar.api.notifications.AnalysisWarnings;\nimport org.sonar.api.testfixtures.log.LogTester;\nimport org.slf4j.event.Level;\nimport org.sonar.plugins.dotnet.tests.ScannerFileService;\nimport org.sonar.plugins.dotnet.tests.WildcardPatternFileProvider;\nimport org.sonarsource.dotnet.shared.plugins.CodeCoverageProvider;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\n\nimport static java.util.Arrays.asList;\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.ArgumentMatchers.any;\nimport static org.mockito.ArgumentMatchers.anyString;\nimport static org.mockito.Mockito.doThrow;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.times;\nimport static org.mockito.Mockito.verify;\nimport static org.mockito.Mockito.when;\n\npublic class CoverageAggregatorTest {\n\n  @Rule\n  public ExpectedException thrown = ExpectedException.none();\n\n  @Rule\n  public LogTester logTester = new LogTester();\n\n  @Test\n  public void hasCoverageProperty() {\n    Configuration configuration = mock(Configuration.class);\n\n    CoverageConfiguration coverageConf = new CoverageConfiguration(\"\", \"ncover\", \"opencover\", \"dotcover\", \"visualstudio\", \"cobertura\");\n\n    when(configuration.hasKey(\"ncover\")).thenReturn(false);\n    when(configuration.hasKey(\"opencover\")).thenReturn(false);\n    when(configuration.hasKey(\"dotcover\")).thenReturn(false);\n    when(configuration.hasKey(\"visualstudio\")).thenReturn(false);\n    when(configuration.hasKey(\"cobertura\")).thenReturn(false);\n    assertThat(getCoverageAggregator(configuration, coverageConf).hasCoverageProperty()).isFalse();\n\n    when(configuration.hasKey(\"ncover\")).thenReturn(false);\n    when(configuration.hasKey(\"opencover\")).thenReturn(true);\n    when(configuration.hasKey(\"dotcover\")).thenReturn(false);\n    when(configuration.hasKey(\"visualstudio\")).thenReturn(false);\n    when(configuration.hasKey(\"cobertura\")).thenReturn(false);\n    assertThat(getCoverageAggregator(configuration, coverageConf).hasCoverageProperty()).isTrue();\n\n    when(configuration.hasKey(\"ncover\")).thenReturn(false);\n    when(configuration.hasKey(\"opencover\")).thenReturn(false);\n    when(configuration.hasKey(\"dotcover\")).thenReturn(true);\n    when(configuration.hasKey(\"visualstudio\")).thenReturn(false);\n    when(configuration.hasKey(\"cobertura\")).thenReturn(false);\n    assertThat(getCoverageAggregator(configuration, coverageConf).hasCoverageProperty()).isTrue();\n\n    when(configuration.hasKey(\"ncover\")).thenReturn(false);\n    when(configuration.hasKey(\"opencover\")).thenReturn(false);\n    when(configuration.hasKey(\"dotcover\")).thenReturn(false);\n    when(configuration.hasKey(\"visualstudio\")).thenReturn(true);\n    when(configuration.hasKey(\"cobertura\")).thenReturn(false);\n    assertThat(getCoverageAggregator(configuration, coverageConf).hasCoverageProperty()).isTrue();\n\n    when(configuration.hasKey(\"ncover\")).thenReturn(false);\n    when(configuration.hasKey(\"opencover\")).thenReturn(false);\n    when(configuration.hasKey(\"dotcover\")).thenReturn(false);\n    when(configuration.hasKey(\"visualstudio\")).thenReturn(false);\n    when(configuration.hasKey(\"cobertura\")).thenReturn(true);\n    assertThat(getCoverageAggregator(configuration, coverageConf).hasCoverageProperty()).isTrue();\n\n    when(configuration.hasKey(\"ncover\")).thenReturn(true);\n    when(configuration.hasKey(\"opencover\")).thenReturn(true);\n    when(configuration.hasKey(\"dotcover\")).thenReturn(true);\n    when(configuration.hasKey(\"visualstudio\")).thenReturn(true);\n    when(configuration.hasKey(\"cobertura\")).thenReturn(true);\n    assertThat(getCoverageAggregator(configuration, coverageConf).hasCoverageProperty()).isTrue();\n\n    coverageConf = new CoverageConfiguration(\"\", \"ncover2\", \"opencover2\", \"dotcover2\", \"visualstudio2\", \"cobertura2\");\n    when(configuration.hasKey(\"ncover\")).thenReturn(true);\n    when(configuration.hasKey(\"opencover\")).thenReturn(true);\n    when(configuration.hasKey(\"dotcover\")).thenReturn(true);\n    when(configuration.hasKey(\"visualstudio\")).thenReturn(true);\n    when(configuration.hasKey(\"cobertura\")).thenReturn(true);\n    assertThat(getCoverageAggregator(configuration, coverageConf).hasCoverageProperty()).isFalse();\n  }\n\n  private CoverageAggregator getCoverageAggregator(Configuration configuration, CoverageConfiguration coverageConf) {\n    ScannerFileService alwaysTrue = mock(ScannerFileService.class);\n    when(alwaysTrue.isSupportedAbsolute(anyString())).thenReturn(true);\n    return new CoverageAggregator(coverageConf, configuration, alwaysTrue, mock(AnalysisWarnings.class));\n  }\n\n  @Test\n  public void aggregate() {\n    CoverageCache cache = mock(CoverageCache.class);\n    when(cache.readCoverageFromCacheOrParse(Mockito.any(CoverageParser.class), Mockito.any(File.class))).thenAnswer(\n      invocation -> {\n        CoverageParser parser = (CoverageParser) invocation.getArguments()[0];\n        File reportFile = (File) invocation.getArguments()[1];\n        Coverage coverage = new Coverage();\n        parser.accept(reportFile, coverage);\n        return coverage;\n      });\n\n    WildcardPatternFileProvider wildcardPatternFileProvider = mock(WildcardPatternFileProvider.class);\n\n    CoverageConfiguration coverageConf = new CoverageConfiguration(\"\", \"ncover\", \"opencover\", \"dotcover\", \"visualstudio\", \"cobertura\");\n    MapSettings settings = new MapSettings();\n\n    settings.setProperty(\"ncover\", \"foo.nccov\");\n    when(wildcardPatternFileProvider.listFiles(\"foo.nccov\")).thenReturn(new HashSet<>(Collections.singletonList(new File(\"foo.nccov\"))));\n    NCover3ReportParser ncoverParser = mock(NCover3ReportParser.class);\n    OpenCoverReportParser openCoverParser = mock(OpenCoverReportParser.class);\n    DotCoverReportsAggregator dotCoverParser = mock(DotCoverReportsAggregator.class);\n    VisualStudioCoverageXmlReportParser visualStudioCoverageXmlReportParser = mock(VisualStudioCoverageXmlReportParser.class);\n    CoberturaReportParser coberturaParser = mock(CoberturaReportParser.class);\n    Coverage coverage = mock(Coverage.class);\n    ArgumentCaptor<Coverage> captor = ArgumentCaptor.forClass(Coverage.class);\n    new CoverageAggregator(coverageConf, settings.asConfig(), cache, ncoverParser, openCoverParser, dotCoverParser, visualStudioCoverageXmlReportParser, coberturaParser)\n      .aggregate(wildcardPatternFileProvider, coverage);\n    verify(ncoverParser).accept(Mockito.eq(new File(\"foo.nccov\")), captor.capture());\n    verify(cache).readCoverageFromCacheOrParse(Mockito.eq(ncoverParser), Mockito.any(File.class));\n    verify(coverage).mergeWith(captor.getValue());\n    verify(openCoverParser, Mockito.never()).accept(Mockito.any(File.class), Mockito.any(Coverage.class));\n    verify(dotCoverParser, Mockito.never()).accept(Mockito.any(File.class), Mockito.any(Coverage.class));\n    verify(visualStudioCoverageXmlReportParser, Mockito.never()).accept(Mockito.any(File.class), Mockito.any(Coverage.class));\n    verify(coberturaParser, Mockito.never()).accept(Mockito.any(File.class), Mockito.any(Coverage.class));\n\n    settings.clear();\n\n    settings.setProperty(\"opencover\", \"bar.xml\");\n    when(wildcardPatternFileProvider.listFiles(\"bar.xml\")).thenReturn(new HashSet<>(Collections.singletonList(new File(\"bar.xml\"))));\n    ncoverParser = mock(NCover3ReportParser.class);\n    openCoverParser = mock(OpenCoverReportParser.class);\n    dotCoverParser = mock(DotCoverReportsAggregator.class);\n    visualStudioCoverageXmlReportParser = mock(VisualStudioCoverageXmlReportParser.class);\n    coberturaParser = mock(CoberturaReportParser.class);\n    coverage = mock(Coverage.class);\n    captor = ArgumentCaptor.forClass(Coverage.class);\n    new CoverageAggregator(coverageConf, settings.asConfig(), cache, ncoverParser, openCoverParser, dotCoverParser, visualStudioCoverageXmlReportParser, coberturaParser)\n      .aggregate(wildcardPatternFileProvider, coverage);\n    verify(ncoverParser, Mockito.never()).accept(Mockito.any(File.class), Mockito.any(Coverage.class));\n    verify(openCoverParser).accept(Mockito.eq(new File(\"bar.xml\")), captor.capture());\n    verify(cache).readCoverageFromCacheOrParse(Mockito.eq(openCoverParser), Mockito.any(File.class));\n    verify(coverage).mergeWith(captor.getValue());\n    verify(dotCoverParser, Mockito.never()).accept(Mockito.any(File.class), Mockito.any(Coverage.class));\n    verify(visualStudioCoverageXmlReportParser, Mockito.never()).accept(Mockito.any(File.class), Mockito.any(Coverage.class));\n    verify(coberturaParser, Mockito.never()).accept(Mockito.any(File.class), Mockito.any(Coverage.class));\n\n    settings.clear();\n    settings.setProperty(\"dotcover\", \"baz.html\");\n    when(wildcardPatternFileProvider.listFiles(\"baz.html\")).thenReturn(new HashSet<>(Collections.singletonList(new File(\"baz.html\"))));\n    ncoverParser = mock(NCover3ReportParser.class);\n    openCoverParser = mock(OpenCoverReportParser.class);\n    dotCoverParser = mock(DotCoverReportsAggregator.class);\n    visualStudioCoverageXmlReportParser = mock(VisualStudioCoverageXmlReportParser.class);\n    coberturaParser = mock(CoberturaReportParser.class);\n    coverage = mock(Coverage.class);\n    captor = ArgumentCaptor.forClass(Coverage.class);\n    new CoverageAggregator(coverageConf, settings.asConfig(), cache, ncoverParser, openCoverParser, dotCoverParser, visualStudioCoverageXmlReportParser, coberturaParser)\n      .aggregate(wildcardPatternFileProvider, coverage);\n    verify(ncoverParser, Mockito.never()).accept(Mockito.any(File.class), Mockito.any(Coverage.class));\n    verify(openCoverParser, Mockito.never()).accept(Mockito.any(File.class), Mockito.any(Coverage.class));\n    verify(dotCoverParser).accept(Mockito.eq(new File(\"baz.html\")), captor.capture());\n    verify(cache).readCoverageFromCacheOrParse(Mockito.eq(dotCoverParser), Mockito.any(File.class));\n    verify(coverage).mergeWith(captor.getValue());\n    verify(visualStudioCoverageXmlReportParser, Mockito.never()).accept(Mockito.any(File.class), Mockito.any(Coverage.class));\n    verify(coberturaParser, Mockito.never()).accept(Mockito.any(File.class), Mockito.any(Coverage.class));\n\n    settings.clear();\n    settings.setProperty(\"visualstudio\", \"qux.coveragexml\");\n    when(wildcardPatternFileProvider.listFiles(\"qux.coveragexml\")).thenReturn(new HashSet<>(Collections.singletonList(new File(\"qux.coveragexml\"))));\n    ncoverParser = mock(NCover3ReportParser.class);\n    openCoverParser = mock(OpenCoverReportParser.class);\n    dotCoverParser = mock(DotCoverReportsAggregator.class);\n    visualStudioCoverageXmlReportParser = mock(VisualStudioCoverageXmlReportParser.class);\n    coberturaParser = mock(CoberturaReportParser.class);\n    coverage = mock(Coverage.class);\n    captor = ArgumentCaptor.forClass(Coverage.class);\n    new CoverageAggregator(coverageConf, settings.asConfig(), cache, ncoverParser, openCoverParser, dotCoverParser, visualStudioCoverageXmlReportParser, coberturaParser)\n      .aggregate(wildcardPatternFileProvider, coverage);\n    verify(ncoverParser, Mockito.never()).accept(Mockito.any(File.class), Mockito.any(Coverage.class));\n    verify(openCoverParser, Mockito.never()).accept(Mockito.any(File.class), Mockito.any(Coverage.class));\n    verify(dotCoverParser, Mockito.never()).accept(Mockito.any(File.class), Mockito.any(Coverage.class));\n    verify(visualStudioCoverageXmlReportParser).accept(Mockito.eq(new File(\"qux.coveragexml\")), captor.capture());\n    verify(cache).readCoverageFromCacheOrParse(Mockito.eq(visualStudioCoverageXmlReportParser), Mockito.any(File.class));\n    verify(coverage).mergeWith(captor.getValue());\n    verify(coberturaParser, Mockito.never()).accept(Mockito.any(File.class), Mockito.any(Coverage.class));\n\n    settings.clear();\n    settings.setProperty(\"cobertura\", \"corge.xml\");\n    when(wildcardPatternFileProvider.listFiles(\"corge.xml\")).thenReturn(new HashSet<>(Collections.singletonList(new File(\"corge.xml\"))));\n    ncoverParser = mock(NCover3ReportParser.class);\n    openCoverParser = mock(OpenCoverReportParser.class);\n    dotCoverParser = mock(DotCoverReportsAggregator.class);\n    visualStudioCoverageXmlReportParser = mock(VisualStudioCoverageXmlReportParser.class);\n    coberturaParser = mock(CoberturaReportParser.class);\n    coverage = mock(Coverage.class);\n    captor = ArgumentCaptor.forClass(Coverage.class);\n    new CoverageAggregator(coverageConf, settings.asConfig(), cache, ncoverParser, openCoverParser, dotCoverParser, visualStudioCoverageXmlReportParser, coberturaParser)\n      .aggregate(wildcardPatternFileProvider, coverage);\n    verify(ncoverParser, Mockito.never()).accept(Mockito.any(File.class), Mockito.any(Coverage.class));\n    verify(openCoverParser, Mockito.never()).accept(Mockito.any(File.class), Mockito.any(Coverage.class));\n    verify(dotCoverParser, Mockito.never()).accept(Mockito.any(File.class), Mockito.any(Coverage.class));\n    verify(visualStudioCoverageXmlReportParser, Mockito.never()).accept(Mockito.any(File.class), Mockito.any(Coverage.class));\n    verify(coberturaParser).accept(Mockito.eq(new File(\"corge.xml\")), captor.capture());\n    verify(cache).readCoverageFromCacheOrParse(Mockito.eq(coberturaParser), Mockito.any(File.class));\n    verify(coverage).mergeWith(captor.getValue());\n\n    Mockito.reset(wildcardPatternFileProvider);\n\n    settings.clear();\n    settings.setProperty(\"ncover\", \",*.nccov  ,bar.nccov\");\n    when(wildcardPatternFileProvider.listFiles(\"*.nccov\")).thenReturn(new HashSet<>(Collections.singletonList(new File(\"foo.nccov\"))));\n    when(wildcardPatternFileProvider.listFiles(\"bar.nccov\")).thenReturn(new HashSet<>(Collections.singletonList(new File(\"bar.nccov\"))));\n    settings.setProperty(\"opencover\", \"bar.xml\");\n    when(wildcardPatternFileProvider.listFiles(\"bar.xml\")).thenReturn(new HashSet<>(Collections.singletonList(new File(\"bar.xml\"))));\n    settings.setProperty(\"dotcover\", \"baz.html\");\n    when(wildcardPatternFileProvider.listFiles(\"baz.html\")).thenReturn(new HashSet<>(asList(new File(\"baz.html\"))));\n    settings.setProperty(\"visualstudio\", \"qux.coveragexml\");\n    when(wildcardPatternFileProvider.listFiles(\"qux.coveragexml\")).thenReturn(new HashSet<>(asList(new File(\"qux.coveragexml\"))));\n    settings.setProperty(\"cobertura\", \"corge.xml\");\n    when(wildcardPatternFileProvider.listFiles(\"corge.xml\")).thenReturn(new HashSet<>(asList(new File(\"corge.xml\"))));\n    ncoverParser = mock(NCover3ReportParser.class);\n    openCoverParser = mock(OpenCoverReportParser.class);\n    dotCoverParser = mock(DotCoverReportsAggregator.class);\n    visualStudioCoverageXmlReportParser = mock(VisualStudioCoverageXmlReportParser.class);\n    coberturaParser = mock(CoberturaReportParser.class);\n    coverage = mock(Coverage.class);\n    captor = ArgumentCaptor.forClass(Coverage.class);\n\n    new CoverageAggregator(coverageConf, settings.asConfig(), cache, ncoverParser, openCoverParser, dotCoverParser, visualStudioCoverageXmlReportParser, coberturaParser)\n      .aggregate(wildcardPatternFileProvider, coverage);\n\n    verify(wildcardPatternFileProvider).listFiles(\"*.nccov\");\n    verify(wildcardPatternFileProvider).listFiles(\"bar.nccov\");\n    verify(wildcardPatternFileProvider).listFiles(\"bar.xml\");\n    verify(wildcardPatternFileProvider).listFiles(\"baz.html\");\n    verify(wildcardPatternFileProvider).listFiles(\"qux.coveragexml\");\n    verify(wildcardPatternFileProvider).listFiles(\"corge.xml\");\n\n    verify(ncoverParser).accept(Mockito.eq(new File(\"foo.nccov\")), captor.capture());\n    verify(ncoverParser).accept(Mockito.eq(new File(\"bar.nccov\")), captor.capture());\n    verify(openCoverParser).accept(Mockito.eq(new File(\"bar.xml\")), captor.capture());\n    verify(dotCoverParser).accept(Mockito.eq(new File(\"baz.html\")), captor.capture());\n    verify(visualStudioCoverageXmlReportParser).accept(Mockito.eq(new File(\"qux.coveragexml\")), captor.capture());\n    verify(coberturaParser).accept(Mockito.eq(new File(\"corge.xml\")), captor.capture());\n\n    for (Coverage capturedCoverage : captor.getAllValues()) {\n      verify(coverage).mergeWith(capturedCoverage);\n    }\n  }\n\n  @Test\n  public void aggregate_logs_warning_on_exception() {\n    MapSettings settings = new MapSettings();\n    settings.setProperty(\"ncover\", \"foo.nccov\");\n    CoverageConfiguration coverageConf = new CoverageConfiguration(\"\", \"ncover\", \"opencover\", \"dotcover\", \"visualstudio\", \"cobertura\");\n\n    CoverageCache cache = mock(CoverageCache.class);\n    when(cache.readCoverageFromCacheOrParse(Mockito.any(CoverageParser.class), Mockito.any(File.class))).thenReturn(new Coverage());\n\n    WildcardPatternFileProvider wildcardPatternFileProvider = mock(WildcardPatternFileProvider.class);\n    when(wildcardPatternFileProvider.listFiles(\"foo.nccov\")).thenReturn(new HashSet<>(Collections.singletonList(new File(\"foo.nccov\"))));\n\n    Coverage coverage = mock(Coverage.class);\n    doThrow(new IllegalStateException(\"TEST EXCEPTION MESSAGE\")).when(coverage).mergeWith(any());\n\n    new CoverageAggregator(coverageConf, settings.asConfig(), cache, null, null, null, null, null)\n      .aggregate(wildcardPatternFileProvider, coverage);\n\n    assertThat(logTester.logs(Level.WARN)).containsOnly(\"Could not import coverage report 'foo.nccov' because 'TEST EXCEPTION MESSAGE'. Troubleshooting guide: https://community.sonarsource.com/t/37151\");\n  }\n\n  @Test\n  public void aggregate_ncover_report_does_not_exist() {\n    aggregate_report_does_not_exist(\"ncover\", \".nccov\");\n  }\n\n  @Test\n  public void aggregate_opencover_report_does_not_exist() {\n    aggregate_report_does_not_exist(\"opencover\", \".xml\");\n  }\n\n  @Test\n  public void aggregate_dotcover_report_does_not_exist() {\n    aggregate_report_does_not_exist(\"dotcover\", \".html\");\n  }\n\n  @Test\n  public void aggregate_visualstudio_report_does_not_exist() {\n    aggregate_report_does_not_exist(\"visualstudio\", \".coveragexml\");\n  }\n\n  @Test\n  public void aggregate_cobertura_report_does_not_exist() {\n    aggregate_report_does_not_exist(\"cobertura\", \".xml\");\n  }\n\n  // this method needs to be here as the test needs to be in the same package with CoverageAggregator\n  @Test\n  public void when_UnitTestCoverageAggregator_is_created_from_CodeCoverageProvider_calls_uses_properties() {\n    // setup\n    CodeCoverageProvider provider = createTestProvider();\n    CoverageAggregator sut = provider.new UnitTestCoverageAggregator(\n      mock(Configuration.class),\n      mock(FileSystem.class),\n      mock(AnalysisWarnings.class)\n    );\n\n    // act\n    Predicate<String> mockPredicate = mock(Predicate.class);\n    sut.hasCoverageProperty(mockPredicate);\n\n    // verify\n    ArgumentCaptor<String> argument = ArgumentCaptor.forClass(String.class);\n    verify(mockPredicate, times(5)).test(argument.capture());\n    assertThat(argument.getAllValues()).containsExactlyInAnyOrder(\n      \"sonar.KEY.ncover3.reportsPaths\",\n      \"sonar.KEY.opencover.reportsPaths\",\n      \"sonar.KEY.dotcover.reportsPaths\",\n      \"sonar.KEY.vscoveragexml.reportsPaths\",\n      \"sonar.KEY.cobertura.reportsPaths\"\n    );\n  }\n\n  private static CodeCoverageProvider createTestProvider() {\n    PluginMetadata pluginMetadata = mock(PluginMetadata.class);\n    when(pluginMetadata.languageKey()).thenReturn(\"KEY\");\n    return new CodeCoverageProvider(pluginMetadata);\n  }\n\n  private void aggregate_report_does_not_exist(String propertyName, String reportFileExtension) {\n    // Arrange\n    WildcardPatternFileProvider wildcardPatternFileProvider = mock(WildcardPatternFileProvider.class);\n\n    CoverageConfiguration coverageConf = new CoverageConfiguration(\"\", \"ncover\", \"opencover\", \"dotcover\", \"visualstudio\", \"cobertura\");\n    MapSettings settings = new MapSettings();\n\n    String reportFile = \"file-that-does-not-exist\" + reportFileExtension;\n\n    settings.setProperty(propertyName, reportFile);\n    when(wildcardPatternFileProvider.listFiles(reportFile)).thenReturn(new HashSet<>());\n\n    NCover3ReportParser ncoverParser = mock(NCover3ReportParser.class);\n    OpenCoverReportParser openCoverParser = mock(OpenCoverReportParser.class);\n    DotCoverReportsAggregator dotCoverParser = mock(DotCoverReportsAggregator.class);\n    VisualStudioCoverageXmlReportParser visualStudioCoverageXmlReportParser = mock(VisualStudioCoverageXmlReportParser.class);\n    CoberturaReportParser coberturaParser = mock(CoberturaReportParser.class);\n\n    // Act\n    new CoverageAggregator(coverageConf, settings.asConfig(), mock(CoverageCache.class), ncoverParser, openCoverParser, dotCoverParser, visualStudioCoverageXmlReportParser, coberturaParser)\n      .aggregate(wildcardPatternFileProvider, mock(Coverage.class));\n\n    // Assert\n    verify(ncoverParser, Mockito.never()).accept(Mockito.any(File.class), Mockito.any(Coverage.class));\n    verify(openCoverParser, Mockito.never()).accept(Mockito.any(File.class), Mockito.any(Coverage.class));\n    verify(dotCoverParser, Mockito.never()).accept(Mockito.any(File.class), Mockito.any(Coverage.class));\n    verify(visualStudioCoverageXmlReportParser, Mockito.never()).accept(Mockito.any(File.class), Mockito.any(Coverage.class));\n    verify(coberturaParser, Mockito.never()).accept(Mockito.any(File.class), Mockito.any(Coverage.class));\n\n    assertThat(logTester.logs(Level.WARN)).containsOnly(\"Could not find any coverage report file matching the pattern '\" + reportFile + \"'. Troubleshooting guide: https://community.sonarsource.com/t/37151\");\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonar/plugins/dotnet/tests/coverage/CoverageCacheTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests.coverage;\n\nimport org.junit.Test;\nimport org.mockito.Mockito;\n\nimport java.io.File;\n\nimport static org.mockito.Mockito.*;\n\npublic class CoverageCacheTest {\n\n  @Test\n  public void test() {\n    CoverageCache cache = new CoverageCache();\n    CoverageParser parser = mock(CoverageParser.class);\n    File reportFile = mock(File.class);\n    when(reportFile.getAbsolutePath()).thenReturn(\"foo.txt\");\n\n    Coverage coverage = cache.readCoverageFromCacheOrParse(parser, reportFile);\n    verify(parser, Mockito.times(1)).accept(reportFile, coverage);\n\n    cache.readCoverageFromCacheOrParse(parser, reportFile);\n    verify(parser, Mockito.times(1)).accept(Mockito.eq(reportFile), Mockito.any(Coverage.class));\n  }\n\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonar/plugins/dotnet/tests/coverage/CoverageReportImportSensorTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests.coverage;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.util.Collections;\nimport java.util.HashSet;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.function.Predicate;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.TemporaryFolder;\nimport org.mockito.Mockito;\nimport org.sonar.api.batch.fs.InputFile.Type;\nimport org.sonar.api.batch.fs.internal.DefaultInputFile;\nimport org.sonar.api.batch.fs.internal.TestInputFileBuilder;\nimport org.sonar.api.batch.sensor.internal.DefaultSensorDescriptor;\nimport org.sonar.api.batch.sensor.internal.SensorContextTester;\nimport org.sonar.api.config.Configuration;\nimport org.sonar.api.scanner.sensor.ProjectSensor;\nimport org.sonar.api.testfixtures.log.LogTester;\nimport org.slf4j.event.Level;\nimport org.sonar.plugins.dotnet.tests.VstsUtils;\nimport org.sonar.plugins.dotnet.tests.WildcardPatternFileProvider;\n\nimport static java.util.Arrays.asList;\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.ArgumentMatchers.any;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.spy;\nimport static org.mockito.Mockito.verify;\nimport static org.mockito.Mockito.when;\n\npublic class CoverageReportImportSensorTest {\n\n  @Rule\n  public TemporaryFolder temp = createTempFolder();\n\n  @Rule\n  public LogTester logTester = new LogTester();\n\n  private CoverageConfiguration coverageConf = new CoverageConfiguration(\"cs\", \"\", \"\", \"\", \"\", \"\");\n  private CoverageAggregator coverageAggregator = mock(CoverageAggregator.class);\n  private File baseDir;\n  private SensorContextTester context;\n  private DefaultSensorDescriptor descriptor = new DefaultSensorDescriptor();\n\n  @Before\n  public void setUp() throws IOException {\n    logTester.setLevel(Level.TRACE);\n    baseDir = temp.newFolder();\n    context = SensorContextTester.create(baseDir);\n  }\n\n  @Test\n  public void describe_unit_test() {\n    new CoverageReportImportSensor(coverageConf, coverageAggregator, \"cs\", \"C#\")\n      .describe(descriptor);\n\n    assertThat(descriptor.name()).isEqualTo(\"C# Tests Coverage Report Import\");\n  }\n\n  @Test\n  public void isProjectSensor() {\n    assertThat(ProjectSensor.class.isAssignableFrom(CoverageReportImportSensor.class)).isTrue();\n  }\n\n  @Test\n  public void describe_execute_only_when_key_present() {\n    Configuration configWithKey = mock(Configuration.class);\n    when(configWithKey.hasKey(\"expectedKey\")).thenReturn(true);\n\n    Configuration configWithoutKey = mock(Configuration.class);\n\n    when(coverageAggregator.hasCoverageProperty(any(Predicate.class))).thenAnswer((invocationOnMock) -> {\n      Predicate<String> pr = invocationOnMock.getArgument(0);\n      return pr.test(\"expectedKey\");\n    });\n\n    new CoverageReportImportSensor(coverageConf, coverageAggregator, \"cs\", \"C#\")\n      .describe(descriptor);\n\n    assertThat(descriptor.configurationPredicate()).accepts(configWithKey);\n    assertThat(descriptor.configurationPredicate()).rejects(configWithoutKey);\n  }\n\n  @Test\n  public void execute_no_coverage_property() throws Exception {\n    new CoverageReportImportSensor(coverageConf, coverageAggregator, \"cs\", \"C#\")\n      .execute(context);\n\n    assertThat(logTester.logs(Level.INFO)).isEmpty();\n    assertThat(logTester.logs(Level.DEBUG)).containsOnly(\"No coverage property. Skip Sensor\");\n  }\n\n  @Test\n  public void analyze() throws Exception {\n    SensorContextTester localContext = computeCoverageMeasures();\n    assertThat(localContext.lineHits(\"foo:Foo.cs\", 2)).isEqualTo(1);\n    assertThat(localContext.lineHits(\"foo:Foo.cs\", 4)).isZero();\n    assertThat(localContext.coveredConditions(\"foo:Foo.cs\", 1)).isNull();\n    assertThat(localContext.coveredConditions(\"foo:Foo.cs\", 4)).isNull();\n    assertThat(localContext.coveredConditions(\"foo:Foo.cs\", 5)).isEqualTo(1);\n    assertThat(localContext.coveredConditions(\"foo:Foo.cs\", 6)).isEqualTo(2);\n  }\n\n  @Test\n  public void execute_coverage_no_main_file() throws IOException {\n    Coverage coverage = mock(Coverage.class);\n    String fooPath = new File(baseDir, \"Foo.cs\").getAbsolutePath();\n    when(coverage.files()).thenReturn(new HashSet<>(Collections.singletonList(fooPath)));\n\n    context.fileSystem().add(new TestInputFileBuilder(\"foo\", \"Foo.cs\").setLanguage(\"cs\")\n      .setType(Type.TEST).build());\n\n    new CoverageReportImportSensor(coverageConf, coverageAggregator, \"cs\", \"C#\")\n      .analyze(context, coverage);\n\n    assertThat(logTester.logs(Level.INFO)).containsOnly(\"Coverage Report Statistics: \" +\n      \"1 files, 0 main files, 0 main files with coverage, 1 test files, 0 project excluded files, 0 other language files.\");\n    assertThat(logTester.logs(Level.WARN)).contains(\"The Code Coverage report doesn't contain any coverage \"\n      + \"data for the included files. Troubleshooting guide: https://community.sonarsource.com/t/37151\");\n    assertThat(logTester.logs(Level.DEBUG)).contains(\n      \"Analyzing coverage with wildcardPatternFileProvider with base dir '\" + CoverageReportImportSensor.BASE_DIR.getAbsolutePath() + \"' and file separator '\\\\'.\",\n      \"Analyzing coverage after aggregate found '1' coverage files.\",\n      \"Skipping '\" + fooPath + \"' as it is a test file.\",\n      \"The total number of file count statistics is '1'.\");\n    assertThat(logTester.logs(Level.TRACE)).contains(\"Counting statistics for '\" + fooPath + \"'.\");\n  }\n\n  @Test\n  public void execute_coverage_main_file_no_coverage_for_file() throws IOException {\n    Coverage coverage = mock(Coverage.class);\n    String fooPath = new File(baseDir, \"Foo.cs\").getAbsolutePath();\n    when(coverage.files()).thenReturn(new HashSet<>(Collections.singletonList(fooPath)));\n\n    context.fileSystem().add(new TestInputFileBuilder(\"foo\", \"Foo.cs\").setLanguage(\"cs\")\n      .setType(Type.MAIN).build());\n\n    new CoverageReportImportSensor(coverageConf, coverageAggregator, \"cs\", \"C#\")\n      .analyze(context, coverage);\n\n    assertThat(logTester.logs(Level.INFO)).containsOnly(\"Coverage Report Statistics: \" +\n      \"1 files, 1 main files, 0 main files with coverage, 0 test files, 0 project excluded files, 0 other language files.\");\n    assertThat(logTester.logs(Level.WARN)).contains(\"The Code Coverage report doesn't contain any coverage \"\n      + \"data for the included files. Troubleshooting guide: https://community.sonarsource.com/t/37151\");\n    assertThat(logTester.logs(Level.DEBUG)).contains(\n      \"Analyzing coverage with wildcardPatternFileProvider with base dir '\" + CoverageReportImportSensor.BASE_DIR.getAbsolutePath() + \"' and file separator '\\\\'.\",\n      \"Analyzing coverage after aggregate found '1' coverage files.\",\n      \"No coverage info found for the file '\" + fooPath + \"'.\",\n      \"The total number of file count statistics is '1'.\");\n    assertThat(logTester.logs(Level.TRACE)).contains(\n      \"Counting statistics for '\" + fooPath + \"'.\",\n      \"Checking main file coverage for '\" + fooPath + \"'.\");\n  }\n\n  @Test\n  public void execute_coverage_not_indexed_file() throws IOException {\n    Coverage coverage = mock(Coverage.class);\n    String fooPath = new File(baseDir, \"Foo.cs\").getCanonicalPath();\n    when(coverage.files()).thenReturn(new HashSet<>(Collections.singletonList(fooPath)));\n\n    new CoverageReportImportSensor(coverageConf, coverageAggregator, \"cs\", \"C#\")\n      .analyze(context, coverage);\n\n    assertThat(logTester.logs(Level.INFO)).containsOnly(\"Coverage Report Statistics: \" +\n      \"1 files, 0 main files, 0 main files with coverage, 0 test files, 1 project excluded files, 0 other language files.\");\n    assertThat(logTester.logs(Level.DEBUG)).containsOnly(\n      \"Analyzing coverage with wildcardPatternFileProvider with base dir '\" + CoverageReportImportSensor.BASE_DIR.getAbsolutePath() + \"' and file separator '\\\\'.\",\n      \"Analyzing coverage after aggregate found '1' coverage files.\",\n      \"The file '\" + fooPath + \"' is either excluded or outside of \"\n        + \"your solution folder therefore Code Coverage will not be imported.\",\n      \"The total number of file count statistics is '1'.\");\n    assertThat(logTester.logs(Level.TRACE)).contains(\"Counting statistics for '\" + fooPath + \"'.\");\n  }\n\n  @Test\n  public void computeCoverageLoggingOutOfRange() {\n    Coverage coverage = new Coverage();\n    String fooPath = new File(baseDir, \"Foo.cs\").getAbsolutePath();\n    coverage.addHits(fooPath, 1, 1);\n\n    context.fileSystem().add(new TestInputFileBuilder(\"foo\", \"Foo.cs\").setLanguage(\"cs\")\n      .setType(Type.MAIN).build());\n\n    new CoverageReportImportSensor(coverageConf, coverageAggregator, \"cs\", \"C#\")\n      .analyze(context, coverage);\n\n    assertThat(logTester.logs(Level.DEBUG)).contains(\n      \"Coverage import: Line 1 is out of range in the file 'Foo.cs' (lines: -1)\");\n\n    assertThat(logTester.logs(Level.WARN)).contains(\n      \"Invalid data found in the coverage report, please check the debug logs for more details and raise an issue on the coverage tool being used.\");\n  }\n\n  private SensorContextTester computeCoverageMeasures() {\n    Coverage coverage = mock(Coverage.class);\n    String fooPath = new File(baseDir, \"Foo.cs\").getAbsolutePath();\n    String bazPath = new File(baseDir, \"Baz.java\").getAbsolutePath();\n    String barPath = new File(baseDir, \"Bar.cs\").getAbsolutePath();\n    when(coverage.files()).thenReturn(new HashSet<>(asList(fooPath, barPath, bazPath)));\n    when(coverage.hits(fooPath)).thenReturn(Map.of(\n      2, 1,\n      4, 0));\n    when(coverage.hits(barPath)).thenReturn(Map.of(42, 1));\n    when(coverage.hits(bazPath)).thenReturn(Map.of(42, 1));\n    when(coverage.getBranchCoverage(fooPath)).thenReturn(List.of(\n      new BranchCoverage(5, 2, 1),\n      new BranchCoverage(6, 3, 2)));\n\n    DefaultInputFile inputFile = new TestInputFileBuilder(\"foo\", baseDir, new File(baseDir, \"Foo.cs\"))\n      .setLanguage(\"cs\")\n      .initMetadata(\"a\\na\\na\\na\\na\\na\\na\\na\\na\\na\\n\")\n      .build();\n    context.fileSystem().add(inputFile);\n    context.fileSystem().add(new TestInputFileBuilder(\"foo\", \"Baz.java\").setLanguage(\"java\").build());\n\n    new CoverageReportImportSensor(coverageConf, coverageAggregator, \"cs\", \"C#\")\n      .analyze(context, coverage);\n\n    verify(coverageAggregator).aggregate(Mockito.any(WildcardPatternFileProvider.class), Mockito.eq(coverage));\n\n    return context;\n  }\n\n  @Test\n  public void analyze_setsTelemetryFalse_whenNoBranchCoverageUnderreporting() {\n    Coverage coverage = mock(Coverage.class);\n    String fooPath = new File(baseDir, \"Foo.cs\").getAbsolutePath();\n    when(coverage.files()).thenReturn(new HashSet<>(Collections.singletonList(fooPath)));\n    when(coverage.hits(fooPath)).thenReturn(Map.of(1, 1));\n    when(coverage.getBranchCoverage(fooPath)).thenReturn(Collections.emptyList());\n    when(coverage.getBranchCoverageUnderreported()).thenReturn(false);\n\n    context.fileSystem().add(new TestInputFileBuilder(\"foo\", baseDir, new File(baseDir, \"Foo.cs\"))\n      .setLanguage(\"cs\")\n      .setType(Type.MAIN)\n      .initMetadata(\"a\\na\\na\\na\\na\\na\\na\\na\\na\\na\\n\")\n      .build());\n\n    var spyContext = spy(context);\n    new CoverageReportImportSensor(coverageConf, coverageAggregator, \"cs\", \"C#\")\n      .analyze(spyContext, coverage);\n\n    verify(spyContext).addTelemetryProperty(\"dotnetenterprise.plugin.cs.coverage.underReported\", \"false\");\n  }\n\n  @Test\n  public void analyze_setsTelemetryTrue_whenBranchCoverageUnderreported() {\n    Coverage coverage = mock(Coverage.class);\n    String fooPath = new File(baseDir, \"Foo.cs\").getAbsolutePath();\n    when(coverage.files()).thenReturn(new HashSet<>(Collections.singletonList(fooPath)));\n    when(coverage.hits(fooPath)).thenReturn(Map.of(1, 1));\n    when(coverage.getBranchCoverage(fooPath)).thenReturn(Collections.emptyList());\n    when(coverage.getBranchCoverageUnderreported()).thenReturn(true);\n\n    context.fileSystem().add(new TestInputFileBuilder(\"foo\", baseDir, new File(baseDir, \"Foo.cs\"))\n      .setLanguage(\"cs\")\n      .setType(Type.MAIN)\n      .initMetadata(\"a\\na\\na\\na\\na\\na\\na\\na\\na\\na\\n\")\n      .build());\n\n    var spyContext = spy(context);\n    new CoverageReportImportSensor(coverageConf, coverageAggregator, \"cs\", \"C#\")\n      .analyze(spyContext, coverage);\n\n    verify(spyContext).addTelemetryProperty(\"dotnetenterprise.plugin.cs.coverage.underReported\", \"true\");\n  }\n\n  // This method has been taken from SonarSource/sonar-scanner-msbuild\n  private static TemporaryFolder createTempFolder() {\n    // If the test is being run under VSTS then the Scanner will\n    // expect the project to be under the VSTS sources directory\n    File baseDirectory = null;\n\n    if (VstsUtils.isRunningUnderVsts()) {\n      String vstsSourcePath = VstsUtils.getSourcesDirectory();\n      baseDirectory = new File(vstsSourcePath);\n    }\n\n    return new TemporaryFolder(baseDirectory);\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonar/plugins/dotnet/tests/coverage/CoverageTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests.coverage;\n\nimport java.util.Map;\nimport org.junit.Test;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\npublic class CoverageTest {\n\n  @Test\n  public void test() {\n    Coverage coverage = new Coverage();\n    assertThat(coverage.files()).isEmpty();\n    assertThat(coverage.hits(\"foo.txt\")).isEmpty();\n\n    coverage.addHits(\"foo.txt\", 42, 1);\n    assertThat(coverage.files()).containsExactlyInAnyOrder(\"foo.txt\");\n    assertThat(coverage.hits(\"foo.txt\")).isEqualTo(Map.of(42, 1));\n\n    coverage.addHits(\"foo.txt\", 42, 3);\n    assertThat(coverage.files()).containsExactlyInAnyOrder(\"foo.txt\");\n    assertThat(coverage.hits(\"foo.txt\")).isEqualTo(Map.of(42, 4));\n\n    coverage.addHits(\"foo.txt\", 1234, 11);\n    assertThat(coverage.files()).containsExactlyInAnyOrder(\"foo.txt\");\n    assertThat(coverage.hits(\"foo.txt\")).isEqualTo(Map.of(42, 4, 1234, 11));\n\n    coverage.addHits(\"bar.txt\", 1, 2);\n    assertThat(coverage.files()).containsExactlyInAnyOrder(\"foo.txt\", \"bar.txt\");\n    assertThat(coverage.hits(\"foo.txt\")).isEqualTo(Map.of(42, 4, 1234, 11));\n    assertThat(coverage.hits(\"bar.txt\")).isEqualTo(Map.of(1, 2));\n\n    Coverage other = new Coverage();\n\n    coverage.mergeWith(other);\n    assertThat(coverage.files()).containsExactlyInAnyOrder(\"foo.txt\", \"bar.txt\");\n    assertThat(coverage.hits(\"foo.txt\")).isEqualTo(Map.of(42, 4, 1234, 11));\n    assertThat(coverage.hits(\"bar.txt\")).isEqualTo(Map.of(1, 2));\n\n    other.addHits(\"baz.txt\", 2, 7);\n    assertThat(other.files()).containsExactlyInAnyOrder(\"baz.txt\");\n    assertThat(other.hits(\"baz.txt\")).isEqualTo(Map.of(2, 7));\n\n    coverage.mergeWith(other);\n    assertThat(other.files()).containsExactlyInAnyOrder(\"baz.txt\");\n    assertThat(other.hits(\"baz.txt\")).isEqualTo(Map.of(2, 7));\n    assertThat(coverage.files()).containsExactlyInAnyOrder(\"foo.txt\", \"bar.txt\", \"baz.txt\");\n    assertThat(coverage.hits(\"foo.txt\")).isEqualTo(Map.of(42, 4, 1234, 11));\n    assertThat(coverage.hits(\"bar.txt\")).isEqualTo(Map.of(1, 2));\n    assertThat(coverage.hits(\"baz.txt\")).isEqualTo(Map.of(2, 7));\n  }\n\n  @Test\n  public void givenEmptyListOfConditionDatas_getBranchCoverage_returnsEmpty() {\n    Coverage sut = new Coverage();\n\n    assertThat(sut.getBranchCoverage(\"fileName\")).isEmpty();\n  }\n\n  @Test\n  public void givenSingleConditionData_getBranchCoverage_returnsEmpty() {\n    final String filePath = \"filePath\";\n\n    Coverage sut = new Coverage();\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 1, new ConditionData.Location(2, 3), 4, 5, \"coverageIdentifier\"));\n\n    // Normally this case should not happen but if we have only one branch point\n    // we should not report coverage as line coverage is already covering that.\n    assertThat(sut.getBranchCoverage(filePath)).isEmpty();\n  }\n\n  @Test\n  public void givenSingleConditionDataPerFile_getBranchCoverage_returnsEmpty() {\n    final String firstPath = \"firstPath\";\n    final String secondPath = \"secondPath\";\n    final String coverageIdentifier = \"coverageIdentifier\";\n\n    Coverage sut = new Coverage();\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,firstPath, 1, new ConditionData.Location(2, 3), 4, 5, coverageIdentifier));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,secondPath, 1, new ConditionData.Location(6, 7), 8, 9, coverageIdentifier));\n\n    // Normally this case should not happen but if we have only one branch point\n    // we should not report coverage as line coverage is already covering that.\n    assertThat(sut.getBranchCoverage(firstPath)).isEmpty();\n    assertThat(sut.getBranchCoverage(secondPath)).isEmpty();\n  }\n\n  @Test\n  public void givenSingleConditionDataPerLine_getBranchCoverage_returnsEmpty() {\n    final String filePath = \"filePath\";\n    final String coverageIdentifier = \"coverageIdentifier\";\n\n    Coverage sut = new Coverage();\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 1, new ConditionData.Location(2, 3), 4, 5, coverageIdentifier));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 2, new ConditionData.Location(6, 7), 8, 9, coverageIdentifier));\n\n    assertThat(sut.getBranchCoverage(filePath)).isEmpty();\n  }\n\n  @Test\n  public void branchPointsMerging() {\n    final String filePath = \"filePath\";\n    final String coverageIdentifier = \"coverageIdentifier\";\n\n    Coverage sut = new Coverage();\n\n    // Identical branch points are merged\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 1, new ConditionData.Location(1, 2), 0, 1, coverageIdentifier));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 1, new ConditionData.Location(1, 2), 0, 1, coverageIdentifier));\n\n    // Branch points with different line are not aggregated\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 2, new ConditionData.Location(1, 2), 0, 1, coverageIdentifier));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 3, new ConditionData.Location(1, 2), 0, 1, coverageIdentifier));\n\n    // Branch points with different offset are correctly aggregated\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 4, new ConditionData.Location(1, 2), 0, 1, coverageIdentifier));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 4, new ConditionData.Location(2, 2), 0, 1, coverageIdentifier));\n\n    // Branch points with different offsetEnd are correctly aggregated\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 5, new ConditionData.Location(1, 2), 0, 1, coverageIdentifier));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 5, new ConditionData.Location(1, 3), 0, 1, coverageIdentifier));\n\n    // Branch points with different path are correctly aggregated\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 6, new ConditionData.Location(1, 2), 0, 1, coverageIdentifier));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 6, new ConditionData.Location(1, 2), 1, 1, coverageIdentifier));\n\n    assertThat(sut.getBranchCoverage(filePath))\n      .containsExactlyInAnyOrder(\n        // For the first 3 lines we will not report branch coverage since they have only one branch point each.\n        new BranchCoverage(4, 2, 2),\n        new BranchCoverage(5, 2, 2),\n        new BranchCoverage(6, 2, 2)\n      );\n  }\n\n  @Test\n  public void givenMultipleConditionDataPerLine_getBranchCoverage_returnsBranchCoverage() {\n    final String filePath = \"filePath\";\n    final String coverageIdentifier1 = \"coverageIdentifier1\";\n    final String coverageIdentifier2 = \"coverageIdentifier2\";\n\n    Coverage sut = new Coverage();\n    // Both branch points covered\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 1, new ConditionData.Location(1, 3), 0, 1, coverageIdentifier1));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 1, new ConditionData.Location(4, 6), 1, 1, coverageIdentifier1));\n\n    // Only 2 out of 3 branch points covered\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 2, new ConditionData.Location(1, 3), 0, 2, coverageIdentifier1));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 2, new ConditionData.Location(4, 6), 1, 0, coverageIdentifier1));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 2, new ConditionData.Location(6, 8), 2, 4, coverageIdentifier1));\n\n    // No branch points covered\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 3, new ConditionData.Location(1, 3), 0, 0, coverageIdentifier1));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 3, new ConditionData.Location(4, 6), 1, 0, coverageIdentifier1));\n\n    // Same branch points appear multiple times, none covered (when tests are split in multiple test projects)\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 4, new ConditionData.Location(1, 3), 0, 0, coverageIdentifier1));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 4, new ConditionData.Location(4, 6), 1, 0, coverageIdentifier1));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 4, new ConditionData.Location(1, 3), 0, 0, coverageIdentifier2));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 4, new ConditionData.Location(4, 6), 1, 0, coverageIdentifier2));\n\n    // Same branch points appear multiple times, same coverage (when tests are split in multiple test projects)\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 5, new ConditionData.Location(1, 3), 0, 1, coverageIdentifier1));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 5, new ConditionData.Location(4, 6), 1, 0, coverageIdentifier1));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 5, new ConditionData.Location(1, 3), 0, 1, coverageIdentifier2));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 5, new ConditionData.Location(4, 6), 1, 0, coverageIdentifier2));\n\n    // Same branch points appear multiple times, different coverage (when tests are split in multiple test projects)\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 6, new ConditionData.Location(1, 3), 0, 1, coverageIdentifier1));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 6, new ConditionData.Location(4, 6), 1, 0, coverageIdentifier1));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 6, new ConditionData.Location(1, 3), 0, 0, coverageIdentifier2));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 6, new ConditionData.Location(4, 6), 1, 1, coverageIdentifier2));\n\n    assertThat(sut.getBranchCoverage(filePath))\n      .containsExactlyInAnyOrder(\n        new BranchCoverage(1, 2, 2),\n        new BranchCoverage(2, 3, 2),\n        new BranchCoverage(3, 2, 0),\n        new BranchCoverage(4, 2, 0),\n        new BranchCoverage(5, 2, 1),\n        new BranchCoverage(6, 2, 2)\n      );\n  }\n\n  @Test\n  public void givenMultipleConditionDataPerLineInDifferentFiles_getBranchCoverage_returnsBranchCoverage() {\n    final String firstPath = \"firstPath\";\n    final String secondPath = \"secondPath\";\n    final String coverageIdentifier = \"coverageIdentifier\";\n\n    Coverage sut = new Coverage();\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,firstPath, 1, new ConditionData.Location(1, 3), 0, 2, coverageIdentifier));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,firstPath, 1, new ConditionData.Location(4, 6), 1, 1, coverageIdentifier));\n\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,secondPath, 1, new ConditionData.Location(5, 8), 0, 2, coverageIdentifier));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,secondPath, 1, new ConditionData.Location(10, 12), 1, 0, coverageIdentifier));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,secondPath, 1, new ConditionData.Location(12, 14), 2, 0, coverageIdentifier));\n\n    assertThat(sut.getBranchCoverage(firstPath)).containsExactlyInAnyOrder(new BranchCoverage(1, 2, 2));\n    assertThat(sut.getBranchCoverage(secondPath)).containsExactlyInAnyOrder(new BranchCoverage(1, 3, 1));\n  }\n\n  @Test\n  public void givenConditionDataFromFromDifferentReports_getBranchCoverage_returnsBranchCoverage(){\n    final String filePath = \"filePath\";\n    final String coverageIdentifier1 = \"coverageIdentifier1\";\n    final String coverageIdentifier2 = \"coverageIdentifier2\";\n\n    Coverage sut = new Coverage();\n\n    // ConditionData match exactly, coverage is aggregated correctly\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 1, new ConditionData.Location(0, 5), 0, 1, coverageIdentifier1));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 1, new ConditionData.Location(0, 6), 1, 0, coverageIdentifier1));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 1, new ConditionData.Location(0, 5), 0, 0, coverageIdentifier2));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 1, new ConditionData.Location(0, 6), 1, 1, coverageIdentifier2));\n\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 2, new ConditionData.Location(0, 5), 0, 1, coverageIdentifier1));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 2, new ConditionData.Location(0, 6), 1, 0, coverageIdentifier1));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 2, new ConditionData.Location(0, 5), 0, 1, coverageIdentifier2));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 2, new ConditionData.Location(0, 6), 1, 0, coverageIdentifier2));\n\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 3, new ConditionData.Location(0, 5), 0, 1, coverageIdentifier1));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 3, new ConditionData.Location(0, 6), 1, 1, coverageIdentifier1));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 3, new ConditionData.Location(0, 5), 0, 1, coverageIdentifier2));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 3, new ConditionData.Location(0, 6), 1, 0, coverageIdentifier2));\n\n    // ConditionData differ, coverage is reported forgivingly\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 4, new ConditionData.Location(0, 5), 0, 1, coverageIdentifier1));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 4, new ConditionData.Location(0, 6), 1, 0, coverageIdentifier1));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 4, new ConditionData.Location(0, 7), 0, 0, coverageIdentifier2));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 4, new ConditionData.Location(0, 8), 1, 1, coverageIdentifier2));\n\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 5, new ConditionData.Location(0, 5), 0, 1, coverageIdentifier1));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 5, new ConditionData.Location(0, 6), 1, 0, coverageIdentifier1));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 5, new ConditionData.Location(0, 7), 0, 1, coverageIdentifier2));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 5, new ConditionData.Location(0, 8), 1, 0, coverageIdentifier2));\n\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 6, new ConditionData.Location(0, 5), 0, 1, coverageIdentifier1));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 6, new ConditionData.Location(0, 6), 1, 1, coverageIdentifier1));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 6, new ConditionData.Location(0, 7), 0, 1, coverageIdentifier2));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER,filePath, 6, new ConditionData.Location(0, 8), 1, 0, coverageIdentifier2));\n\n    assertThat(sut.getBranchCoverage(filePath))\n      .containsExactlyInAnyOrder(\n        new BranchCoverage(1, 2, 2),\n        new BranchCoverage(2, 2, 1),\n        new BranchCoverage(3, 2, 2),\n        new BranchCoverage(4, 2, 2),\n        new BranchCoverage(5, 2, 2),\n        new BranchCoverage(6, 2, 2)\n      );\n  }\n\n  @Test\n  public void givenTwoCoberturaReports_getBranchCoverage_mergesCorrectly() {\n    final String filePath = \"filePath\";\n    final String report1 = \"coberturaReport1\";\n    final String report2 = \"coberturaReport2\";\n    Coverage sut = new Coverage();\n\n    // Report 1: line 1 has 2 branches, first covered\n    sut.add(new ConditionData(ConditionData.FORMAT_COBERTURA, filePath, 1, new ConditionData.Location(1, 0), 0, 1, report1));\n    sut.add(new ConditionData(ConditionData.FORMAT_COBERTURA, filePath, 1, new ConditionData.Location(1, 0), 1, 0, report1));\n\n    // Report 2: line 1 has 2 branches, second covered\n    sut.add(new ConditionData(ConditionData.FORMAT_COBERTURA, filePath, 1, new ConditionData.Location(1, 0), 0, 0, report2));\n    sut.add(new ConditionData(ConditionData.FORMAT_COBERTURA, filePath, 1, new ConditionData.Location(1, 0), 1, 1, report2));\n\n    // Same format → merged into one group. 2 unique keys, both covered across reports.\n    assertThat(sut.getBranchCoverage(filePath))\n      .containsExactlyInAnyOrder(new BranchCoverage(1, 2, 2));\n  }\n\n  @Test\n  public void givenTwoUnmergeableReports_getBranchCoverage_takesMaxAcrossFormats() {\n    final String filePath = \"filePath\";\n    final String report1 = \"report1\";\n    final String report2 = \"report2\";\n    Coverage sut = new Coverage();\n\n    // Report 1 (unmergeable): line 1 has 3 branches, 2 covered\n    sut.add(new ConditionData(ConditionData.FORMAT_UNMERGEABLE, filePath, 1, new ConditionData.Location(0, 0), 0, 1, report1));\n    sut.add(new ConditionData(ConditionData.FORMAT_UNMERGEABLE, filePath, 1, new ConditionData.Location(1, 0), 1, 1, report1));\n    sut.add(new ConditionData(ConditionData.FORMAT_UNMERGEABLE, filePath, 1, new ConditionData.Location(2, 0), 2, 0, report1));\n\n    // Report 2 (unmergeable): line 1 has 3 branches, 1 covered\n    sut.add(new ConditionData(ConditionData.FORMAT_UNMERGEABLE, filePath, 1, new ConditionData.Location(0, 0), 0, 0, report2));\n    sut.add(new ConditionData(ConditionData.FORMAT_UNMERGEABLE, filePath, 1, new ConditionData.Location(1, 0), 1, 1, report2));\n    sut.add(new ConditionData(ConditionData.FORMAT_UNMERGEABLE, filePath, 1, new ConditionData.Location(2, 0), 2, 0, report2));\n\n    // Same format \"unmergeable\" → single group. Max coverageIdentifier group has 3 branches, 2 covered across reports.\n    assertThat(sut.getBranchCoverage(filePath))\n      .containsExactlyInAnyOrder(new BranchCoverage(1, 3, 2));\n  }\n\n  @Test\n  public void givenOpenCoverUnmergeableAndCobertura_getBranchCoverage_takesMaxAcrossFormats() {\n    final String filePath = \"filePath\";\n    final String openCoverReport = \"openCoverReport\";\n    final String unmergeableReport = \"unmergeableReport\";\n    final String coberturaReport = \"coberturaReport\";\n\n    Coverage sut = new Coverage();\n\n    // OpenCover: line 1 has 2 branches, 1 covered\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER, filePath, 1, new ConditionData.Location(1, 2), 0, 1, openCoverReport));\n    sut.add(new ConditionData(ConditionData.FORMAT_OPENCOVER, filePath, 1, new ConditionData.Location(4, 6), 1, 0, openCoverReport));\n\n    // Unmergeable: line 1 has 4 branches, 2 covered\n    sut.add(new ConditionData(ConditionData.FORMAT_UNMERGEABLE, filePath, 1, new ConditionData.Location(0, 0), 0, 1, unmergeableReport));\n    sut.add(new ConditionData(ConditionData.FORMAT_UNMERGEABLE, filePath, 1, new ConditionData.Location(1, 0), 1, 1, unmergeableReport));\n    sut.add(new ConditionData(ConditionData.FORMAT_UNMERGEABLE, filePath, 1, new ConditionData.Location(2, 0), 2, 0, unmergeableReport));\n    sut.add(new ConditionData(ConditionData.FORMAT_UNMERGEABLE, filePath, 1, new ConditionData.Location(3, 0), 3, 0, unmergeableReport));\n\n    // Cobertura: line 1 has 3 branches, 3 covered\n    sut.add(new ConditionData(ConditionData.FORMAT_COBERTURA, filePath, 1, new ConditionData.Location(1, 0), 0, 1, coberturaReport));\n    sut.add(new ConditionData(ConditionData.FORMAT_COBERTURA, filePath, 1, new ConditionData.Location(1, 0), 1, 1, coberturaReport));\n    sut.add(new ConditionData(ConditionData.FORMAT_COBERTURA, filePath, 1, new ConditionData.Location(1, 0), 2, 1, coberturaReport));\n\n    // Three formats → three groups. OpenCover: (2, 1), Unmergeable: (4, 2), Cobertura: (3, 3). Max: (4, 3).\n    assertThat(sut.getBranchCoverage(filePath))\n      .containsExactlyInAnyOrder(new BranchCoverage(1, 4, 3));\n  }\n\n  @Test\n  public void overlappingCoberturaReports_getBranchCoverageUnderreported_returnsTrue() {\n    final String filePath = \"filePath\";\n    Coverage sut = new Coverage();\n    // These may or may not cover different branches, Cobertura can't distinguish them.\n    sut.add(new ConditionData(ConditionData.FORMAT_COBERTURA, filePath, 1, new ConditionData.Location(1, 0), 0, 1, \"report1\"));\n    sut.add(new ConditionData(ConditionData.FORMAT_COBERTURA, filePath, 1, new ConditionData.Location(1, 0), 1, 0, \"report1\"));\n    sut.add(new ConditionData(ConditionData.FORMAT_COBERTURA, filePath, 1, new ConditionData.Location(1, 0), 0, 1, \"report2\"));\n    sut.add(new ConditionData(ConditionData.FORMAT_COBERTURA, filePath, 1, new ConditionData.Location(1, 0), 1, 0, \"report2\"));\n\n    assertThat(sut.getBranchCoverageUnderreported()).isFalse();\n    sut.getBranchCoverage(filePath);\n    assertThat(sut.getBranchCoverageUnderreported()).isTrue();\n  }\n\n  @Test\n  public void nonOverlappingReports_getBranchCoverageUnderreported_returnsFalse() {\n    final String filePath = \"filePath\";\n    Coverage sut = new Coverage();\n    sut.add(new ConditionData(ConditionData.FORMAT_COBERTURA, filePath, 1, new ConditionData.Location(1, 0), 0, 1, \"report1\"));\n    sut.add(new ConditionData(ConditionData.FORMAT_COBERTURA, filePath, 1, new ConditionData.Location(1, 0), 1, 0, \"report1\"));\n    sut.add(new ConditionData(ConditionData.FORMAT_COBERTURA, filePath, 1, new ConditionData.Location(1, 0), 0, 0, \"report2\"));\n    sut.add(new ConditionData(ConditionData.FORMAT_COBERTURA, filePath, 1, new ConditionData.Location(1, 0), 1, 1, \"report2\"));\n\n    sut.getBranchCoverage(filePath);\n    assertThat(sut.getBranchCoverageUnderreported()).isFalse();\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonar/plugins/dotnet/tests/coverage/DotCoverReportParserTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests.coverage;\n\nimport java.io.File;\nimport org.assertj.core.api.Assertions;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.sonar.api.testfixtures.log.LogTester;\nimport org.slf4j.event.Level;\nimport org.sonar.plugins.dotnet.tests.FileService;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.junit.Assert.assertThrows;\nimport static org.mockito.ArgumentMatchers.anyString;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\npublic class DotCoverReportParserTest {\n\n  @Rule\n  public LogTester logTester = new LogTester();\n\n  private FileService alwaysTrue;\n  private FileService alwaysFalse;\n\n  @Before\n  public void prepare() {\n    logTester.setLevel(Level.TRACE);\n    alwaysTrue = mock(FileService.class);\n    when(alwaysTrue.isSupportedAbsolute(anyString())).thenReturn(true);\n    when(alwaysTrue.getAbsolutePath(anyString())).thenThrow(new UnsupportedOperationException(\"Should not call this\"));\n    alwaysFalse = mock(FileService.class);\n    when(alwaysFalse.isSupportedAbsolute(anyString())).thenReturn(false);\n    when(alwaysFalse.getAbsolutePath(anyString())).thenThrow(new UnsupportedOperationException(\"Should not call this\"));\n  }\n\n  @Test\n  public void no_title() {\n    DotCoverReportParser parser = new DotCoverReportParser(alwaysTrue);\n    File file = new File(\"src/test/resources/dotcover/no_title.html\");\n\n    Exception thrown = assertThrows(IllegalArgumentException.class, () -> parser.accept(file, mock(Coverage.class)));\n\n    assertThat(thrown).hasMessage(\"The report does not contain expected '<title>'.\");\n  }\n\n  @Test\n  public void no_title_end() {\n    DotCoverReportParser parser = new DotCoverReportParser(alwaysTrue);\n    File file = new File(\"src/test/resources/dotcover/no_title_end.html\");\n\n    Exception thrown = assertThrows(IllegalArgumentException.class, () -> parser.accept(file, mock(Coverage.class)));\n\n    assertThat(thrown).hasMessage(\"The report does not contain expected '</title>'.\");\n  }\n\n  @Test\n  public void title_swapped_tags() {\n    DotCoverReportParser parser = new DotCoverReportParser(alwaysTrue);\n    File file = new File(\"src/test/resources/dotcover/title_swapped.html\");\n\n    Exception thrown = assertThrows(IllegalArgumentException.class, () -> parser.accept(file, mock(Coverage.class)));\n\n    assertThat(thrown).hasMessage(\"The report does not contain expected '</title>'.\");\n  }\n\n  @Test\n  public void title_nested_tag() {\n    Coverage coverage = new Coverage();\n    new DotCoverReportParser(alwaysTrue).accept(new File(\"src/test/resources/dotcover/title_nested_tag.html\"), mock(Coverage.class));\n\n    assertThat(coverage.files()).isEmpty(); // the \"title\" is not a valid path\n\n    assertThat(logTester.logs(Level.INFO).get(0)).startsWith(\"Parsing the dotCover report \");\n    assertThat(logTester.logs(Level.TRACE).get(0))\n      .startsWith(\"dotCover parser: found coverage for line '12', hits '0' when analyzing the path '\")\n      .endsWith(\"<title><\\\\t><\\\\ti><\\\\tit><\\\\ts><\\\\titl><\\\\titles><\\\\titlee><\\\\title<<\\\\<\\\\<\\\\<\\\\<\\\\<<<\\\\<<\\\\<\\\\<\\\\<\\\\<\\\\<\\\\<\\\\<\\\\<\\\\<\\\\<\\\\<\\\\<\\\\<\\\\<\\\\<\\\\<\\\\<\\\\<\\\\<\\\\<\\\\<\\\\<\\\\<\\\\<\\\\<\\\\titl<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<'.\");\n  }\n\n  @Test\n  public void no_script() {\n    DotCoverReportParser parser = new DotCoverReportParser(alwaysTrue);\n    File file = new File(\"src/test/resources/dotcover/no_script.html\");\n\n    Exception thrown = assertThrows(IllegalArgumentException.class, () -> parser.accept(file, mock(Coverage.class)));\n\n    assertThat(thrown).hasMessage(\"The report does not contain expected '<script type=\\\"text/javascript\\\">'.\");\n  }\n\n  @Test\n  public void no_highlight() {\n    DotCoverReportParser parser = new DotCoverReportParser(alwaysTrue);\n    File file = new File(\"src/test/resources/dotcover/no_highlight.html\");\n\n    Exception thrown = assertThrows(IllegalArgumentException.class, () -> parser.accept(file, mock(Coverage.class)));\n\n    assertThat(thrown).hasMessage(\"The report does not contain expected 'highlightRanges(['.\");\n  }\n\n  @Test\n  public void valid() throws Exception {\n    Coverage coverage = new Coverage();\n    new DotCoverReportParser(alwaysTrue).accept(new File(\"src/test/resources/dotcover/valid.html\"), coverage);\n\n    String filePath = new File(\"mylibrary\\\\calc.cs\").getCanonicalPath();\n    assertThat(coverage.files()).containsOnly(filePath);\n\n    assertThat(coverage.hits(filePath))\n      .hasSize(16)\n      .contains(\n        Assertions.entry(12, 0),\n        Assertions.entry(13, 0),\n        Assertions.entry(14, 0),\n        Assertions.entry(17, 1),\n        Assertions.entry(18, 1),\n        Assertions.entry(19, 1),\n        Assertions.entry(22, 0),\n        Assertions.entry(23, 0),\n        Assertions.entry(24, 0),\n        Assertions.entry(25, 0),\n        Assertions.entry(26, 0),\n        Assertions.entry(28, 0),\n        Assertions.entry(29, 0),\n        Assertions.entry(32, 0),\n        Assertions.entry(33, 0),\n        Assertions.entry(34, 0));\n\n    assertThat(logTester.logs(Level.INFO).get(0)).startsWith(\"Parsing the dotCover report \");\n    assertThat(logTester.logs(Level.TRACE).get(0))\n      .startsWith(\"dotCover parser: found coverage for line '12', hits '0' when analyzing the path '\");\n  }\n\n  @Test\n  public void valid_big() throws Exception {\n    Coverage coverage = new Coverage();\n    new DotCoverReportParser(alwaysTrue).accept(new File(\"src/test/resources/dotcover/valid_big.html\"), coverage);\n\n    String filePath = new File(\"mylibrary\\\\calc.cs\").getCanonicalPath();\n    assertThat(coverage.files()).containsOnly(filePath);\n    assertThat(coverage.hits(filePath)).hasSize(10000);\n    assertThat(logTester.logs(Level.INFO)).hasSize(1);\n    assertThat(logTester.logs(Level.INFO).get(0)).startsWith(\"Parsing the dotCover report \");\n    assertThat(logTester.logs(Level.TRACE)).hasSize(10000);\n    assertThat(logTester.logs(Level.TRACE).get(0)).startsWith(\"dotCover parser: found coverage for line '24', hits '1' when analyzing the path '\");\n  }\n\n  @Test\n  public void valid_with_multiple_sequence_points_per_line() throws Exception {\n    Coverage coverage = new Coverage();\n    new DotCoverReportParser(alwaysTrue).accept(new File(\"src/test/resources/dotcover/valid_multiple_sequence_points_per_line.html\"), coverage);\n\n    String filePath = new File(\"GetSet\\\\Bar.cs\").getCanonicalPath();\n    assertThat(coverage.files()).containsOnly(filePath);\n    assertThat(coverage.hits(filePath))\n      .hasSize(14)\n      .containsOnly(\n        // 2 hits - only one getter and one setter are covered\n        Assertions.entry(7, 2),\n        Assertions.entry(9, 1),\n        // 2 hits - both get and set are covered\n        Assertions.entry(11, 2),\n        Assertions.entry(13, 1),\n        Assertions.entry(16, 1),\n        Assertions.entry(17, 3),\n        Assertions.entry(21, 1),\n        Assertions.entry(22, 1),\n        Assertions.entry(24, 1),\n        Assertions.entry(25, 1),\n        Assertions.entry(31, 1),\n        Assertions.entry(32, 1),\n        Assertions.entry(33, 1),\n        Assertions.entry(34, 1)\n      );\n  }\n\n  @Test\n  public void predicate_false() {\n    Coverage coverage = new Coverage();\n    new DotCoverReportParser(alwaysFalse).accept(new File(\"src/test/resources/dotcover/valid.html\"), coverage);\n\n    assertThat(coverage.files()).isEmpty();\n\n    assertThat(logTester.logs(Level.INFO).get(0)).startsWith(\"Parsing the dotCover report \");\n    assertThat(logTester.logs(Level.DEBUG).get(0))\n      .startsWith(\"Skipping the import of dotCover code coverage for file '\")\n      .endsWith(\"' because it is not indexed or does not have the supported language. \"\n        + \"Verify sonar.sources in .sonarqube\\\\out\\\\sonar-project.properties.\");\n  }\n\n  @Test\n  public void should_not_fail_with_invalid_path() {\n    new DotCoverReportParser(alwaysTrue).accept(new File(\"src/test/resources/dotcover/invalid_path.html\"), mock(Coverage.class));\n    assertThat(logTester.logs(Level.INFO).get(0)).startsWith(\"Parsing the dotCover report \");\n    assertThat(logTester.logs(Level.DEBUG).get(0))\n      .isEqualTo(\"Skipping the import of dotCover code coverage for the invalid file path: z:\\\\*\\\"?.cs.\");\n  }\n\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonar/plugins/dotnet/tests/coverage/DotCoverReportsAggregatorTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests.coverage;\n\nimport java.io.File;\nimport java.util.List;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.ExpectedException;\nimport org.mockito.Mockito;\nimport org.sonar.api.testfixtures.log.LogTester;\nimport org.slf4j.event.Level;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.verify;\n\npublic class DotCoverReportsAggregatorTest {\n\n  @Rule\n  public LogTester logTester = new LogTester();\n\n  @Rule\n  public ExpectedException thrown = ExpectedException.none();\n\n  @Before\n  public void before() {\n    logTester.setLevel(Level.DEBUG);\n  }\n\n  @Test\n  public void no_sources() {\n    thrown.expect(IllegalArgumentException.class);\n    thrown.expectMessage(\"The following report dotCover report HTML sources folder cannot be found: \");\n    thrown.expectMessage(new File(\"src/test/resources/dotcover_aggregator/no_sources/src\").getAbsolutePath());\n    new DotCoverReportsAggregator(mock(DotCoverReportParser.class)).accept(new File(\"src/test/resources/dotcover_aggregator/no_sources.html\"), mock(Coverage.class));\n  }\n\n  @Test\n  public void not_html() {\n    thrown.expect(IllegalArgumentException.class);\n    thrown.expectMessage(\"Only dotCover HTML reports which start with \\\"<!DOCTYPE html>\\\" are supported.\");\n    new DotCoverReportsAggregator(mock(DotCoverReportParser.class)).accept(new File(\"src/test/resources/dotcover_aggregator/not_html.html\"), mock(Coverage.class));\n  }\n\n  @Test\n  public void no_extension() {\n    thrown.expect(IllegalArgumentException.class);\n    thrown.expectMessage(\"The following dotCover report name should have an extension: no_extension\");\n    new DotCoverReportsAggregator(mock(DotCoverReportParser.class)).accept(new File(\"src/test/resources/dotcover_aggregator/no_extension\"), mock(Coverage.class));\n  }\n\n  @Test\n  public void empty_folder() {\n    thrown.expect(IllegalArgumentException.class);\n    thrown.expectMessage(\"No dotCover report HTML source file found under:\");\n    new DotCoverReportsAggregator(mock(DotCoverReportParser.class)).accept(new File(\"src/test/resources/dotcover_aggregator/empty_folder.html\"), mock(Coverage.class));\n  }\n\n  @Test\n  public void valid() {\n    DotCoverReportParser parser = mock(DotCoverReportParser.class);\n\n    Coverage coverage = new Coverage();\n    new DotCoverReportsAggregator(parser).accept(new File(\"src/test/resources/dotcover_aggregator/foo.bar.html\"), coverage);\n\n    verify(parser).accept(new File(\"src/test/resources/dotcover_aggregator/foo.bar/src/1.html\"), coverage);\n    verify(parser).accept(new File(\"src/test/resources/dotcover_aggregator/foo.bar/src/2.html\"), coverage);\n    verify(parser, Mockito.never()).accept(new File(\"src/test/resources/dotcover_aggregator/foo.bar/src/nosource.html\"), coverage);\n\n    assertThat(logTester.logs(Level.INFO).get(0)).startsWith(\"Aggregating the HTML reports from \");\n    List<String> debugLogs = logTester.logs(Level.DEBUG);\n    assertThat(debugLogs.get(0)).startsWith(\"The current user dir is '\");\n    assertThat(debugLogs.get(1)).isEqualTo(\"dotCover aggregator: collected 3 report files to parse.\");\n  }\n\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonar/plugins/dotnet/tests/coverage/NCover3ReportParserTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests.coverage;\n\nimport java.io.File;\nimport java.util.List;\nimport org.assertj.core.api.Assertions;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.ExpectedException;\nimport org.sonar.api.notifications.AnalysisWarnings;\nimport org.sonar.api.testfixtures.log.LogTester;\nimport org.slf4j.event.Level;\nimport org.sonar.plugins.dotnet.tests.FileService;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.ArgumentMatchers.anyString;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.verify;\nimport static org.mockito.Mockito.when;\n\npublic class NCover3ReportParserTest {\n\n  @Rule\n  public LogTester logTester = new LogTester();\n\n  @Rule\n  public ExpectedException thrown = ExpectedException.none();\n  private FileService alwaysTrue;\n  private FileService alwaysFalse;\n\n  @Before\n  public void prepare() {\n    logTester.setLevel(Level.TRACE);\n    alwaysTrue = mock(FileService.class);\n    when(alwaysTrue.isSupportedAbsolute(anyString())).thenReturn(true);\n    when(alwaysTrue.getAbsolutePath(anyString())).thenThrow(new UnsupportedOperationException(\"Should not call this\"));\n    alwaysFalse = mock(FileService.class);\n    when(alwaysFalse.isSupportedAbsolute(anyString())).thenReturn(false);\n    when(alwaysFalse.getAbsolutePath(anyString())).thenThrow(new UnsupportedOperationException(\"Should not call this\"));\n  }\n\n  private String deprecationMessage = \"NCover3 coverage import is deprecated since version 8.6 of the plugin. \" +\n    \"Consider using a different code coverage tool instead.\";\n\n  @Test\n  public void invalid_root() {\n    thrown.expect(RuntimeException.class);\n    thrown.expectMessage(\"<coverage>\");\n    new NCover3ReportParser(alwaysTrue, mock(AnalysisWarnings.class)).accept(new File(\"src/test/resources/ncover3/invalid_root.nccov\"), mock(Coverage.class));\n  }\n\n  @Test\n  public void wrong_version() {\n    thrown.expect(RuntimeException.class);\n    thrown.expectMessage(\"exportversion\");\n    new NCover3ReportParser(alwaysTrue, mock(AnalysisWarnings.class)).accept(new File(\"src/test/resources/ncover3/wrong_version.nccov\"), mock(Coverage.class));\n  }\n\n  @Test\n  public void no_version() {\n    thrown.expect(RuntimeException.class);\n    thrown.expectMessage(\"exportversion\");\n    new NCover3ReportParser(alwaysTrue, mock(AnalysisWarnings.class)).accept(new File(\"src/test/resources/ncover3/no_version.nccov\"), mock(Coverage.class));\n  }\n\n  @Test\n  public void non_existing_file() {\n    thrown.expect(RuntimeException.class);\n    thrown.expectMessage(\"non_existing_file.nccov\");\n    new NCover3ReportParser(alwaysTrue, mock(AnalysisWarnings.class)).accept(new File(\"src/test/resources/ncover3/non_existing_file.nccov\"), mock(Coverage.class));\n  }\n\n  @Test\n  public void valid() throws Exception {\n    AnalysisWarnings analysisWarnings = mock(AnalysisWarnings.class);\n    Coverage coverage = new Coverage();\n    new NCover3ReportParser(alwaysTrue, analysisWarnings).accept(new File(\"src/test/resources/ncover3/valid.nccov\"), coverage);\n\n    assertThat(coverage.files()).containsOnly(\n      new File(\"MyLibrary\\\\Adder.cs\").getCanonicalPath(),\n      new File(\"MyLibraryNUnitTest\\\\AdderNUnitTest.cs\").getCanonicalPath(),\n      new File(\"MyLibraryTest\\\\AdderTest.cs\").getCanonicalPath(),\n      new File(\"MyLibraryXUnitTest\\\\AdderXUnitTest.cs\").getCanonicalPath());\n\n    assertThat(coverage.hits(new File(\"MyLibrary\\\\Adder.cs\").getCanonicalPath()))\n      .hasSize(11)\n      .contains(\n        Assertions.entry(12, 2),\n        Assertions.entry(14, 0),\n        Assertions.entry(15, 0),\n        Assertions.entry(18, 2),\n        Assertions.entry(22, 4),\n        Assertions.entry(26, 2),\n        Assertions.entry(27, 2),\n        Assertions.entry(31, 4),\n        Assertions.entry(32, 4),\n        Assertions.entry(36, 2),\n        Assertions.entry(37, 2));\n\n    List<String> debugLogs = logTester.logs(Level.DEBUG);\n    assertThat(debugLogs.get(0)).startsWith(\"The current user dir is '\");\n    List<String> traceLogs = logTester.logs(Level.TRACE);\n    assertThat(traceLogs.get(0)).isEqualTo(\"Analyzing the doc tag with NCover3 ID '1' and url 'MyLibrary\\\\Adder.cs'.\");\n    assertThat(traceLogs.get(1))\n      .startsWith(\"NCover3 ID '1' with url 'MyLibrary\\\\Adder.cs' is resolved as '\")\n      .endsWith(\"MyLibrary\\\\Adder.cs'.\");\n\n    assertThat(logTester.logs(Level.WARN)).containsExactly(deprecationMessage);\n    verify(analysisWarnings).addUnique(deprecationMessage);\n  }\n\n  @Test\n  public void log_unsupported_file_extension() throws Exception {\n    AnalysisWarnings analysisWarnings = mock(AnalysisWarnings.class);\n    Coverage coverage = new Coverage();\n    // use \"one_file.nccov\" to easily check the logs (it has only one coverage entry)\n    new NCover3ReportParser(alwaysFalse, analysisWarnings).accept(new File(\"src/test/resources/ncover3/one_file.nccov\"), coverage);\n\n    assertThat(coverage.files()).isEmpty();\n\n    List<String> debugLogs = logTester.logs(Level.DEBUG);\n    assertThat(debugLogs.get(0)).startsWith(\"The current user dir is '\");\n    assertThat(debugLogs.get(1))\n      .startsWith(\"NCover3 doc '1', line '31', vc '4' will be skipped because it has a path '\")\n      .endsWith(\"\\\\MyLibrary\\\\Adder.cs' which is not indexed or does not have the supported language. \"\n        + \"Verify sonar.sources in .sonarqube\\\\out\\\\sonar-project.properties.\");\n    assertThat(debugLogs.get(2))\n      .startsWith(\"NCover3 doc '1', line '32', vc '4' will be skipped because it has a path '\")\n      .endsWith(\"\\\\MyLibrary\\\\Adder.cs' which is not indexed or does not have the supported language. \"\n        + \"Verify sonar.sources in .sonarqube\\\\out\\\\sonar-project.properties.\");\n    List<String> traceLogs = logTester.logs(Level.TRACE);\n    assertThat(traceLogs.get(0)).isEqualTo(\"Analyzing the doc tag with NCover3 ID '1' and url 'MyLibrary\\\\Adder.cs'.\");\n    assertThat(traceLogs.get(1))\n      .startsWith(\"NCover3 ID '1' with url 'MyLibrary\\\\Adder.cs' is resolved as '\")\n      .endsWith(\"MyLibrary\\\\Adder.cs'.\");\n\n    assertThat(logTester.logs(Level.WARN)).containsExactly(deprecationMessage);\n    verify(analysisWarnings).addUnique(deprecationMessage);\n  }\n\n  @Test\n  public void should_not_fail_with_invalid_path() {\n    AnalysisWarnings analysisWarnings = mock(AnalysisWarnings.class);\n    new NCover3ReportParser(alwaysTrue, analysisWarnings).accept(new File(\"src/test/resources/ncover3/invalid_path.nccov\"), mock(Coverage.class));\n    assertThat(logTester.logs(Level.DEBUG).get(0)).startsWith(\"The current user dir is '\");\n    assertThat(logTester.logs(Level.DEBUG)).contains(\n      \"Skipping the import of NCover3 code coverage for the invalid file path: z:\\\\*\\\"?.cs at line 7\");\n    List<String> traceLogs = logTester.logs(Level.TRACE);\n    assertThat(traceLogs.get(0)).isEqualTo(\"Analyzing the doc tag with NCover3 ID '1' and url 'z:\\\\*\\\"?.cs'.\");\n\n    assertThat(logTester.logs(Level.WARN)).containsExactly(deprecationMessage);\n    verify(analysisWarnings).addUnique(deprecationMessage);\n  }\n\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonar/plugins/dotnet/tests/coverage/OpenCoverReportParserTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests.coverage;\n\nimport java.io.File;\nimport java.util.List;\nimport java.util.Optional;\nimport org.assertj.core.api.Assertions;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.ExpectedException;\nimport org.sonar.api.testfixtures.log.LogTester;\nimport org.slf4j.event.Level;\nimport org.sonar.plugins.dotnet.tests.FileService;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.ArgumentMatchers.anyString;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\npublic class OpenCoverReportParserTest {\n\n  @Rule\n  public LogTester logTester = new LogTester();\n\n  @Rule\n  public ExpectedException thrown = ExpectedException.none();\n  private FileService alwaysTrue;\n  private FileService alwaysFalseAndEmpty;\n\n  @Before\n  public void prepare() {\n    logTester.setLevel(Level.TRACE);\n    alwaysTrue = mock(FileService.class);\n    when(alwaysTrue.isSupportedAbsolute(anyString())).thenReturn(true);\n    when(alwaysTrue.getAbsolutePath(anyString())).thenThrow(new UnsupportedOperationException(\"Should not call this\"));\n    alwaysFalseAndEmpty = mock(FileService.class);\n    when(alwaysFalseAndEmpty.isSupportedAbsolute(anyString())).thenReturn(false);\n    when(alwaysFalseAndEmpty.getAbsolutePath(anyString())).thenReturn(Optional.empty());\n  }\n\n  @Test\n  public void invalid_root() {\n    thrown.expectMessage(\"<CoverageSession>\");\n    new OpenCoverReportParser(alwaysTrue).accept(new File(\"src/test/resources/opencover/invalid_root.xml\"), mock(Coverage.class));\n  }\n\n  @Test\n  public void missing_start_line() {\n    thrown.expectMessage(\"Missing attribute \\\"sl\\\" in element <SequencePoint>\");\n    thrown.expectMessage(\"missing_start_line.xml at line 27\");\n    new OpenCoverReportParser(alwaysTrue).accept(new File(\"src/test/resources/opencover/missing_start_line.xml\"), mock(Coverage.class));\n  }\n\n  @Test\n  public void wrong_start_line() {\n    thrown.expectMessage(\"Expected an integer instead of \\\"foo\\\" for the attribute \\\"sl\\\"\");\n    thrown.expectMessage(\"wrong_start_line.xml at line 27\");\n    new OpenCoverReportParser(alwaysTrue).accept(new File(\"src/test/resources/opencover/wrong_start_line.xml\"), mock(Coverage.class));\n  }\n\n  @Test\n  public void non_existing_file() {\n    thrown.expectMessage(\"non_existing_file.xml\");\n    new OpenCoverReportParser(alwaysTrue).accept(new File(\"src/test/resources/opencover/non_existing_file.xml\"), mock(Coverage.class));\n  }\n\n  @Test\n  public void valid() throws Exception {\n    Coverage coverage = new Coverage();\n    new OpenCoverReportParser(alwaysTrue).accept(new File(\"src/test/resources/opencover/valid.xml\"), coverage);\n\n    assertThat(coverage.files()).containsOnly(\n      new File(\"MyLibraryNUnitTest\\\\AdderNUnitTest.cs\").getCanonicalPath(),\n      new File(\"MyLibrary\\\\Adder.cs\").getCanonicalPath(),\n      new File(\"MyLibrary\\\\Multiplier.cs\").getCanonicalPath());\n\n    assertThat(coverage.hits(new File(\"MyLibrary\\\\Adder.cs\").getCanonicalPath()))\n      .hasSize(15)\n      .contains(\n        Assertions.entry(11, 2),\n        Assertions.entry(12, 2),\n        Assertions.entry(13, 0),\n        Assertions.entry(14, 0),\n        Assertions.entry(15, 0),\n        Assertions.entry(18, 2),\n        Assertions.entry(22, 6),\n        Assertions.entry(26, 2),\n        Assertions.entry(27, 2),\n        Assertions.entry(30, 4),\n        Assertions.entry(31, 4),\n        Assertions.entry(32, 4),\n        Assertions.entry(35, 2),\n        Assertions.entry(36, 2),\n        Assertions.entry(37, 2));\n\n    assertThat(coverage.hits(new File(\"MyLibrary\\\\Multiplier.cs\").getCanonicalPath()))\n      .hasSize(3)\n      .contains(\n        Assertions.entry(11, 0),\n        Assertions.entry(12, 0),\n        Assertions.entry(13, 0));\n\n    List<String> debugLogs = logTester.logs(Level.DEBUG);\n    assertThat(debugLogs.get(0)).startsWith(\"The current user dir is '\");\n\n    // FIXME the test case may be wrong https://github.com/SonarSource/sonar-dotnet/issues/4038\n    assertThat(logTester.logs(Level.WARN)).hasSize(6);\n    assertThat(logTester.logs(Level.WARN).get(0))\n      .startsWith(\"OpenCover parser: invalid start line for file (ID '3', path 'MyLibrary\\\\Adder.cs', indexed as\");\n  }\n\n  @Test\n  public void valid_with_no_absolute_path_no_deterministic_build_path() throws Exception {\n    Coverage coverage = new Coverage();\n\n    new OpenCoverReportParser(alwaysFalseAndEmpty).accept(new File(\"src/test/resources/opencover/valid.xml\"), coverage);\n\n    assertThat(coverage.files()).isEmpty();\n    assertThat(coverage.hits(new File(\"MyLibrary\\\\Adder.cs\").getCanonicalPath())).isEmpty();\n\n    assertThat(logTester.logs(Level.INFO).get(0)).startsWith(\"Parsing the OpenCover report \");\n    assertThat(logTester.logs(Level.DEBUG).get(0)).startsWith(\"The current user dir is \");\n\n    // FIXME the test case may be wrong https://github.com/SonarSource/sonar-dotnet/issues/4038\n    assertThat(logTester.logs(Level.WARN))\n      .hasSize(6)\n      .contains(\"OpenCover parser: invalid start line for file (ID '3', path 'MyLibrary\\\\Adder.cs', NO INDEXED PATH).\");\n  }\n\n  @Test\n  public void valid_with_no_absolute_path_deterministic_build_path_found() {\n    Coverage coverage = new Coverage();\n    FileService mockFileService = mock(FileService.class);\n    when(mockFileService.isSupportedAbsolute(anyString())).thenReturn(false);\n    String resolvedDeterministicPath = \"/test/file/Calc.cs\";\n    when(mockFileService.getAbsolutePath(\"MyLibrary\\\\Adder.cs\")).thenReturn(Optional.of(resolvedDeterministicPath));\n    new OpenCoverReportParser(mockFileService).accept(new File(\"src/test/resources/opencover/valid.xml\"), coverage);\n\n    assertThat(coverage.files()).hasSize(1);\n    assertThat(coverage.hits(resolvedDeterministicPath))\n      .hasSize(15)\n      .contains(\n        Assertions.entry(11, 2),\n        Assertions.entry(12, 2),\n        Assertions.entry(13, 0),\n        Assertions.entry(14, 0),\n        Assertions.entry(15, 0),\n        Assertions.entry(18, 2),\n        Assertions.entry(22, 6),\n        Assertions.entry(26, 2),\n        Assertions.entry(27, 2),\n        Assertions.entry(30, 4),\n        Assertions.entry(31, 4),\n        Assertions.entry(32, 4),\n        Assertions.entry(35, 2),\n        Assertions.entry(36, 2),\n        Assertions.entry(37, 2));\n\n    assertThat(logTester.logs(Level.INFO).get(0)).startsWith(\"Parsing the OpenCover report \");\n    List<String> debugLogs = logTester.logs(Level.DEBUG);\n    assertThat(debugLogs)\n      .hasSize(13)\n      .contains(\n        \"CoveredFile created: (ID '3', path 'MyLibrary\\\\Adder.cs', indexed as '/test/file/Calc.cs').\",\n        \"CoveredFile created: (ID '1', path 'MyLibraryNUnitTest\\\\AdderNUnitTest.cs', NO INDEXED PATH).\",\n        \"CoveredFile created: (ID '4', path 'MyLibrary\\\\Multiplier.cs', NO INDEXED PATH).\"\n      );\n\n    // FIXME the test case may be wrong https://github.com/SonarSource/sonar-dotnet/issues/4038\n    assertThat(logTester.logs(Level.WARN)).hasSize(6);\n  }\n\n  @Test\n  public void valid_with_deterministic_source_path_returns_found_path() {\n    Coverage coverage = new Coverage();\n    FileService mockFileService = mock(FileService.class);\n    when(mockFileService.isSupportedAbsolute(anyString())).thenReturn(false);\n    String testAbsolutePath = \"/full/path/to/Foo.cs\";\n    when(mockFileService.getAbsolutePath(\"/_/CoverageTest.DeterministicSourcePaths/CoverageTest.DeterministicSourcePaths/Foo.cs\")).thenReturn(Optional.of(testAbsolutePath));\n    new OpenCoverReportParser(mockFileService).accept(new File(\"src/test/resources/opencover/deterministic_source_paths.xml\"), coverage);\n\n    assertThat(coverage.files()).hasSize(1);\n    assertThat(coverage.hits(testAbsolutePath))\n      .hasSize(6)\n      .containsOnly(\n        Assertions.entry(6, 1),\n        Assertions.entry(7, 1),\n        Assertions.entry(8, 1),\n        Assertions.entry(11, 0),\n        Assertions.entry(12, 0),\n        Assertions.entry(13, 0));\n    assertThat(coverage.getBranchCoverage(testAbsolutePath))\n      .hasSize(1)\n      .containsExactly(new BranchCoverage(7, 2, 1));\n\n    assertThat(logTester.logs(Level.WARN)).isEmpty();\n    assertThat(logTester.logs(Level.INFO).get(0)).startsWith(\"Parsing the OpenCover report \");\n    List<String> debugLogs = logTester.logs(Level.DEBUG);\n    assertThat(debugLogs)\n      .hasSize(7)\n      .contains(\"CoveredFile created: (ID '5', path '/_/CoverageTest.DeterministicSourcePaths/CoverageTest.DeterministicSourcePaths/Foo.cs', indexed as '/full/path/to/Foo.cs').\");\n    assertThat(logTester.logs(Level.TRACE))\n      .hasSize(8)\n      .containsExactlyInAnyOrder(\n        \"OpenCover parser: add hits for file (ID '5', path '/_/CoverageTest.DeterministicSourcePaths/CoverageTest.DeterministicSourcePaths/Foo.cs', indexed as '/full/path/to/Foo.cs'), line '6', visitCount '1'.\",\n        \"OpenCover parser: add hits for file (ID '5', path '/_/CoverageTest.DeterministicSourcePaths/CoverageTest.DeterministicSourcePaths/Foo.cs', indexed as '/full/path/to/Foo.cs'), line '7', visitCount '1'.\",\n        \"OpenCover parser: add hits for file (ID '5', path '/_/CoverageTest.DeterministicSourcePaths/CoverageTest.DeterministicSourcePaths/Foo.cs', indexed as '/full/path/to/Foo.cs'), line '8', visitCount '1'.\",\n        \"OpenCover parser: add branch hits for file (ID '5', path '/_/CoverageTest.DeterministicSourcePaths/CoverageTest.DeterministicSourcePaths/Foo.cs', indexed as '/full/path/to/Foo.cs'), line '7', offset '3', visitCount '0'.\",\n        \"OpenCover parser: add branch hits for file (ID '5', path '/_/CoverageTest.DeterministicSourcePaths/CoverageTest.DeterministicSourcePaths/Foo.cs', indexed as '/full/path/to/Foo.cs'), line '7', offset '3', visitCount '1'.\",\n        \"OpenCover parser: add hits for file (ID '5', path '/_/CoverageTest.DeterministicSourcePaths/CoverageTest.DeterministicSourcePaths/Foo.cs', indexed as '/full/path/to/Foo.cs'), line '11', visitCount '0'.\",\n        \"OpenCover parser: add hits for file (ID '5', path '/_/CoverageTest.DeterministicSourcePaths/CoverageTest.DeterministicSourcePaths/Foo.cs', indexed as '/full/path/to/Foo.cs'), line '12', visitCount '0'.\",\n        \"OpenCover parser: add hits for file (ID '5', path '/_/CoverageTest.DeterministicSourcePaths/CoverageTest.DeterministicSourcePaths/Foo.cs', indexed as '/full/path/to/Foo.cs'), line '13', visitCount '0'.\"\n      );\n  }\n\n  @Test\n  public void branchCoverage() throws Exception {\n    Coverage coverage = new Coverage();\n    String filePath = new File(\"D:\\\\git\\\\BranchCoveragePoc\\\\BranchCoveragePoc\\\\Calculator.cs\").getCanonicalPath();\n\n    new OpenCoverReportParser(alwaysTrue).accept(new File(\"src/test/resources/opencover/coverage_branches.xml\"), coverage);\n\n    assertThat(coverage.files()).containsOnly(filePath);\n    assertThat(coverage.hits(filePath))\n      .hasSize(9)\n      .contains(\n        Assertions.entry(8, 1),\n        Assertions.entry(9, 1),\n        Assertions.entry(10, 1),\n        Assertions.entry(12, 1),\n        Assertions.entry(13, 1),\n        Assertions.entry(14, 2),\n        Assertions.entry(16, 1),\n        Assertions.entry(18, 1),\n        Assertions.entry(25, 1));\n\n    assertThat(coverage.getBranchCoverage(filePath))\n      .hasSize(5)\n      .contains(\n        //  if (x == 0 || y < 0)\n        new BranchCoverage(9, 4, 2),\n\n        // _ = y == 0 || z == 0;\n        new BranchCoverage(12, 2, 1),\n\n        // _ = x == y || y == z;\n        new BranchCoverage(13, 2, 1),\n\n        // _ = y == 0 || z == 0; _ = x == y || y == z;\n        new BranchCoverage(14, 4, 2),\n\n        // return x < 2\n        //    ? y < 3\n        //        ? z < 1\n        //            ? 1\n        //            : 2\n        //        : 3\n        //    : 4;\n        new BranchCoverage(18, 6, 3));\n  }\n\n  @Test\n  public void branchCoverage_codeFile_analyzedByMultipleProjects() throws Exception {\n    Coverage coverage = new Coverage();\n    String filePath = new File(\"BranchCoverage3296\\\\Code\\\\ValueProvider.cs\").getCanonicalPath();\n\n    new OpenCoverReportParser(alwaysTrue).accept(new File(\"src/test/resources/opencover/code_tested_by_multiple_projects.xml\"), coverage);\n    assertThat(coverage.files()).containsOnly(filePath);\n\n    assertThat(coverage.getBranchCoverage(filePath)).containsOnly(new BranchCoverage(5, 2, 2));\n  }\n\n  @Test\n  public void branchCoverage_multipleCodePaths_analyzedByMultipleProjects() throws Exception {\n    Coverage coverage = new Coverage();\n    String filePath = new File(\"SwitchCoverage\\\\SwitchCoverage\\\\Foo.cs\").getCanonicalPath();\n\n    OpenCoverReportParser parser = new OpenCoverReportParser(alwaysTrue);\n\n    parser.accept(new File(\"src/test/resources/opencover/switch_expression_multiple_test_projects_1.xml\"), coverage);\n    parser.accept(new File(\"src/test/resources/opencover/switch_expression_multiple_test_projects_2.xml\"), coverage);\n\n    assertThat(coverage.files()).contains(filePath);\n    assertThat(coverage.hits(filePath))\n      .hasSize(1)\n      .contains(Assertions.entry(8, 4));\n\n    assertThat(coverage.getBranchCoverage(filePath))\n      .hasSize(1)\n      // the switch expression gets transformed to a more complex IL representation, hence 8 conditions\n      .contains(new BranchCoverage(8, 8, 6));\n  }\n\n  @Test\n  public void branchCoverage_codeFile_unsupportedFile() throws Exception {\n    Coverage coverage = new Coverage();\n    String filePath = new File(\"BranchCoverage3296\\\\Code\\\\ValueProvider.cs\").getCanonicalPath();\n\n    // Notice we pass \"alwaysFalseAndEmpty\" as a predicate\n    new OpenCoverReportParser(alwaysFalseAndEmpty).accept(new File(\"src/test/resources/opencover/code_tested_by_multiple_projects.xml\"), coverage);\n    assertThat(coverage.files()).isEmpty();\n    assertThat(coverage.getBranchCoverage(filePath)).isEmpty();\n    assertThat(logTester.logs(Level.DEBUG))\n      .hasSize(9)\n      // 6 logs below\n      // The other logs contain system-dependants paths (e.g. \"The current user dir is ...\", \"CoveredFile created: ...\")\n      .contains(\n        // these are not ordered\n        \"Skipping the file (ID '1', path 'BranchCoverage3296\\\\Code\\\\ValueProvider.cs', NO INDEXED PATH), line '5', visitCount '1' because file is not indexed or does not have the supported language. Verify sonar.sources in .sonarqube\\\\out\\\\sonar-project.properties.\",\n        \"Skipping the file (ID '2', path 'BranchCoverage3296\\\\Code\\\\ValueProvider.cs', NO INDEXED PATH), line '5', visitCount '1' because file is not indexed or does not have the supported language. Verify sonar.sources in .sonarqube\\\\out\\\\sonar-project.properties.\",\n        \"OpenCover parser: Skipping branch hits for file (ID '2', path 'BranchCoverage3296\\\\Code\\\\ValueProvider.cs', NO INDEXED PATH), line '5', offset '1', visitCount '1' because file is not indexed or does not have the supported language. Verify sonar.sources in .sonarqube\\\\out\\\\sonar-project.properties.\",\n        \"OpenCover parser: Skipping branch hits for file (ID '2', path 'BranchCoverage3296\\\\Code\\\\ValueProvider.cs', NO INDEXED PATH), line '5', offset '1', visitCount '0' because file is not indexed or does not have the supported language. Verify sonar.sources in .sonarqube\\\\out\\\\sonar-project.properties.\",\n        \"OpenCover parser: Skipping branch hits for file (ID '1', path 'BranchCoverage3296\\\\Code\\\\ValueProvider.cs', NO INDEXED PATH), line '5', offset '1', visitCount '0' because file is not indexed or does not have the supported language. Verify sonar.sources in .sonarqube\\\\out\\\\sonar-project.properties.\",\n        \"OpenCover parser: Skipping branch hits for file (ID '1', path 'BranchCoverage3296\\\\Code\\\\ValueProvider.cs', NO INDEXED PATH), line '5', offset '1', visitCount '1' because file is not indexed or does not have the supported language. Verify sonar.sources in .sonarqube\\\\out\\\\sonar-project.properties.\");\n  }\n\n  @Test\n  public void branchCoverage_invalidFileId() throws Exception {\n    Coverage coverage = new Coverage();\n    String filePath = new File(\"BranchCoverage3296\\\\Code\\\\ValueProvider.cs\").getCanonicalPath();\n\n    new OpenCoverReportParser(alwaysTrue).accept(new File(\"src/test/resources/opencover/invalid_file_id.xml\"), coverage);\n    assertThat(coverage.files()).containsOnly(filePath);\n\n    assertThat(coverage.getBranchCoverage(filePath)).isEmpty();\n    List<String> debugLogs = logTester.logs(Level.DEBUG);\n    assertThat(debugLogs)\n      .hasSize(7)\n      // 4 logs below\n      // The other logs contain system-dependants paths (e.g. \"The current user dir is ...\", \"CoveredFile created: ...\")\n      .contains(\n        \"OpenCover parser (handleBranchPointTag): the fileId '3' key is not contained in files.\",\n        \"OpenCover parser (handleBranchPointTag): the fileId '4' key is not contained in files.\",\n        \"OpenCover parser (handleBranchPointTag): the fileId '3' key is not contained in files.\",\n        \"OpenCover parser (handleBranchPointTag): the fileId '3' key is not contained in files.\");\n  }\n\n  @Test\n  public void branchCoverage_getter_setter_multiple_sequence_points_per_line() throws Exception {\n    Coverage coverage = new Coverage();\n    new OpenCoverReportParser(alwaysTrue).accept(new File(\"src/test/resources/opencover/valid_case_multiple_sequence_points_per_line.xml\"), coverage);\n\n    String barFilePath = new File(\"GetSet\\\\Bar.cs\").getCanonicalPath();\n    assertThat(coverage.files()).containsOnly(\n      barFilePath,\n      new File(\"GetSet\\\\FooCallsBar.cs\").getCanonicalPath(),\n      new File(\"GetSetTests\\\\BarTests.cs\").getCanonicalPath()\n    );\n    assertThat(coverage.hits(barFilePath))\n      .hasSize(10)\n      .contains(\n        // 2 hits from tests for Bar, 1 hit from tests for FooCallsBar\n        Assertions.entry(11, 3),\n        Assertions.entry(13, 1),\n        // 2 hits from tests for Bar, 1 hit from tests for FooCallsBar\n        Assertions.entry(15, 3),\n        Assertions.entry(17, 1),\n        Assertions.entry(20, 1),\n        Assertions.entry(21, 3),\n        Assertions.entry(25, 1),\n        Assertions.entry(26, 1),\n        Assertions.entry(28, 1),\n        Assertions.entry(29, 1));\n\n    assertThat(coverage.getBranchCoverage(barFilePath))\n      .hasSize(1)\n      .containsOnly(new BranchCoverage(17, 2, 1)); // line 17: ArrowMethod\n\n    List<String> traceLogs = logTester.logs(Level.TRACE);\n    assertThat(traceLogs).hasSize(34);\n  }\n\n  @Test\n  public void log_unsupported_file_extension() {\n    Coverage coverage = new Coverage();\n\n    // to easily check the logs (it has only one coverage entry)\n    new OpenCoverReportParser(alwaysFalseAndEmpty).accept(new File(\"src/test/resources/opencover/one_class.xml\"), coverage);\n\n    assertThat(coverage.files()).isEmpty();\n\n    List<String> debugLogs = logTester.logs(Level.DEBUG);\n    assertThat(debugLogs.get(0)).startsWith(\"The current user dir is '\");\n    assertThat(debugLogs.stream().skip(1))\n      .containsExactlyInAnyOrder(\n        \"CoveredFile created: (ID '1', path 'MyLibraryNUnitTest\\\\AdderNUnitTest.cs', NO INDEXED PATH).\",\n        \"Skipping the file (ID '1', path 'MyLibraryNUnitTest\\\\AdderNUnitTest.cs', NO INDEXED PATH), line '16', visitCount '1' because file is not indexed or does not have the supported language. Verify sonar.sources in .sonarqube\\\\out\\\\sonar-project.properties.\",\n        \"Skipping the file (ID '1', path 'MyLibraryNUnitTest\\\\AdderNUnitTest.cs', NO INDEXED PATH), line '17', visitCount '1' because file is not indexed or does not have the supported language. Verify sonar.sources in .sonarqube\\\\out\\\\sonar-project.properties.\",\n        \"Skipping the file (ID '1', path 'MyLibraryNUnitTest\\\\AdderNUnitTest.cs', NO INDEXED PATH), line '18', visitCount '1' because file is not indexed or does not have the supported language. Verify sonar.sources in .sonarqube\\\\out\\\\sonar-project.properties.\"\n      );\n  }\n\n  @Test\n  public void should_not_fail_with_invalid_path() {\n    new OpenCoverReportParser(alwaysTrue).accept(new File(\"src/test/resources/opencover/invalid_path.xml\"), mock(Coverage.class));\n    List<String> debugLogs = logTester.logs(Level.DEBUG);\n    assertThat(debugLogs.get(0)).startsWith(\"The current user dir is '\");\n    assertThat(debugLogs.get(1)).startsWith(\"Skipping the import of OpenCover code coverage for the invalid file path: z:\\\\*\\\"?.cs at line 150\");\n    assertThat(debugLogs.get(1)).startsWith(\"Skipping the import of OpenCover code coverage for the invalid file path: z:\\\\*\\\"?.cs at line 150\");\n    assertThat(debugLogs.get(8)).startsWith(\"CoveredFile created: (ID '3', path 'MyLibrary\\\\Adder.cs', indexed as\");\n    assertThat(debugLogs.get(9)).startsWith(\"CoveredFile created: (ID '4', path 'MyLibrary\\\\Multiplier.cs', indexed as\");\n    assertThat(debugLogs).contains(\n      \"OpenCover parser (handleSequencePointTag): the fileId '1' key is not contained in files (entry for line '16', visitCount '1').\",\n      \"OpenCover parser (handleSequencePointTag): the fileId '1' key is not contained in files (entry for line '17', visitCount '1').\",\n      \"OpenCover parser (handleSequencePointTag): the fileId '1' key is not contained in files (entry for line '18', visitCount '1').\",\n      \"OpenCover parser (handleSequencePointTag): the fileId '1' key is not contained in files (entry for line '22', visitCount '1').\",\n      \"OpenCover parser (handleSequencePointTag): the fileId '1' key is not contained in files (entry for line '23', visitCount '1').\",\n      \"OpenCover parser (handleSequencePointTag): the fileId '1' key is not contained in files (entry for line '24', visitCount '1').\"\n    );\n  }\n\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonar/plugins/dotnet/tests/coverage/VisualStudioCoverageXmlReportParserTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.dotnet.tests.coverage;\n\nimport java.io.File;\nimport java.util.Optional;\nimport org.assertj.core.api.Assertions;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.ExpectedException;\nimport org.sonar.api.testfixtures.log.LogTester;\nimport org.slf4j.event.Level;\nimport org.sonar.plugins.dotnet.tests.FileService;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.ArgumentMatchers.anyString;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\npublic class VisualStudioCoverageXmlReportParserTest {\n\n  @Rule\n  public LogTester logTester = new LogTester();\n\n  @Rule\n  public ExpectedException thrown = ExpectedException.none();\n  private FileService alwaysTrue;\n  private FileService alwaysFalseAndEmpty;\n\n  @Before\n  public void prepare() {\n    logTester.setLevel(Level.TRACE);\n    alwaysTrue = mock(FileService.class);\n    when(alwaysTrue.isSupportedAbsolute(anyString())).thenReturn(true);\n    when(alwaysTrue.getAbsolutePath(anyString())).thenThrow(new UnsupportedOperationException(\"Should not call this\"));\n    alwaysFalseAndEmpty = mock(FileService.class);\n    when(alwaysFalseAndEmpty.isSupportedAbsolute(anyString())).thenReturn(false);\n    when(alwaysFalseAndEmpty.getAbsolutePath(anyString())).thenReturn(Optional.empty());\n  }\n\n  @Test\n  public void invalid_root() {\n    thrown.expect(RuntimeException.class);\n    thrown.expectMessage(\"<results>\");\n    new VisualStudioCoverageXmlReportParser(alwaysTrue).accept(new File(\"src/test/resources/visualstudio_coverage_xml/invalid_root.coveragexml\"), mock(Coverage.class));\n  }\n\n  @Test\n  public void non_existing_file() {\n    thrown.expect(RuntimeException.class);\n    thrown.expectMessage(\"non_existing_file.coveragexml\");\n    new VisualStudioCoverageXmlReportParser(alwaysTrue).accept(new File(\"src/test/resources/visualstudio_coverage_xml/non_existing_file.coveragexml\"), mock(Coverage.class));\n  }\n\n  @Test\n  public void wrong_covered() {\n    thrown.expect(RuntimeException.class);\n    thrown.expectMessage(\"Unsupported \\\"covered\\\" value \\\"foo\\\", expected one of \\\"yes\\\", \\\"partial\\\" or \\\"no\\\"\");\n    thrown.expectMessage(\"wrong_covered.coveragexml\");\n    thrown.expectMessage(\"line 40\");\n    new VisualStudioCoverageXmlReportParser(alwaysTrue).accept(new File(\"src/test/resources/visualstudio_coverage_xml/wrong_covered.coveragexml\"), mock(Coverage.class));\n  }\n\n  @Test\n  public void valid_with_correct_file_language() throws Exception {\n    Coverage coverage = new Coverage();\n    new VisualStudioCoverageXmlReportParser(alwaysTrue).accept(new File(\"src/test/resources/visualstudio_coverage_xml/valid.coveragexml\"), coverage);\n\n    assertThat(coverage.files()).containsOnly(\n      new File(\"CalcMultiplyTest\\\\MultiplyTest.cs\").getCanonicalPath(),\n      new File(\"MyLibrary\\\\Calc.cs\").getCanonicalPath());\n\n    assertThat(coverage.hits(new File(\"MyLibrary\\\\Calc.cs\").getCanonicalPath()))\n      .hasSize(16)\n      .containsOnly(\n        Assertions.entry(12, 0),\n        Assertions.entry(13, 0),\n        Assertions.entry(14, 0),\n        Assertions.entry(17, 1),\n        Assertions.entry(18, 1),\n        Assertions.entry(19, 1),\n        Assertions.entry(22, 0),\n        Assertions.entry(23, 0),\n        Assertions.entry(24, 0),\n        Assertions.entry(25, 0),\n        Assertions.entry(26, 0),\n        Assertions.entry(28, 0),\n        Assertions.entry(29, 0),\n        Assertions.entry(32, 0),\n        Assertions.entry(33, 0),\n        Assertions.entry(34, 0));\n\n    assertThat(logTester.logs(Level.INFO).get(0)).startsWith(\"Parsing the Visual Studio coverage XML report \");\n    assertThat(logTester.logs(Level.DEBUG).get(0)).startsWith(\"The current user dir is \");\n    assertThat(logTester.logs(Level.TRACE)).hasSize(3);\n    assertThat(logTester.logs(Level.TRACE).get(1))\n      .startsWith(\"Found covered lines for id '0' for path \")\n      .endsWith(\"\\\\MyLibrary\\\\Calc.cs'\");\n  }\n\n  @Test\n  public void valid_with_getter_setter() throws Exception {\n    // see https://github.com/SonarSource/sonar-dotnet/issues/2622\n\n    Coverage coverage = new Coverage();\n    new VisualStudioCoverageXmlReportParser(alwaysTrue).accept(new File(\"src/test/resources/visualstudio_coverage_xml/getter_setter.coveragexml\"), coverage);\n\n    String filePath = new File(\"GetSet\\\\Bar.cs\").getCanonicalPath();\n\n    assertThat(coverage.files()).containsOnly(\n      filePath,\n      new File(\"GetSetTests\\\\BarTests.cs\").getCanonicalPath());\n\n    assertThat(coverage.hits(filePath)).containsExactly(Assertions.entry(11, 1));\n    assertThat(coverage.getBranchCoverage(filePath)).isEmpty();\n\n    assertThat(logTester.logs(Level.INFO).get(0)).startsWith(\"Parsing the Visual Studio coverage XML report \");\n    assertThat(logTester.logs(Level.DEBUG).get(0)).startsWith(\"The current user dir is \");\n    assertThat(logTester.logs(Level.TRACE)).hasSize(3);\n    assertThat(logTester.logs(Level.TRACE).get(1))\n      .startsWith(\"Found covered lines for id '0' for path \")\n      .endsWith(\"\\\\GetSet\\\\Bar.cs'\");\n  }\n\n  @Test\n  public void valid_with_multiple_getter_setter_per_line() throws Exception {\n    // see https://github.com/SonarSource/sonar-dotnet/issues/2622\n\n    Coverage coverage = new Coverage();\n    new VisualStudioCoverageXmlReportParser(alwaysTrue).accept(new File(\"src/test/resources/visualstudio_coverage_xml/getter_setter_multiple_per_line.coveragexml\"), coverage);\n\n    String filePath = new File(\"GetSet\\\\Bar.cs\").getCanonicalPath();\n\n    assertThat(coverage.files()).containsOnly(\n      filePath,\n      new File(\"GetSetTests\\\\BarTests.cs\").getCanonicalPath());\n\n    assertThat(coverage.hits(filePath)).containsOnly(Assertions.entry(11, 2));\n    assertThat(coverage.getBranchCoverage(filePath)).isEmpty();\n\n    assertThat(logTester.logs(Level.INFO).get(0)).startsWith(\"Parsing the Visual Studio coverage XML report \");\n    assertThat(logTester.logs(Level.DEBUG).get(0)).startsWith(\"The current user dir is \");\n    assertThat(logTester.logs(Level.TRACE)).hasSize(3);\n    assertThat(logTester.logs(Level.TRACE).get(0))\n      .startsWith(\"Found covered lines for id '0' for path \")\n      .endsWith(\"\\\\GetSet\\\\Bar.cs'\");\n  }\n\n  @Test\n  public void valid_with_complex_test_case() throws Exception {\n    // see https://github.com/SonarSource/sonar-dotnet/issues/2622\n\n    // the complex case has\n    // - full line coverage\n    // - partial line coverage due to incomplete branch coverage\n    // - partial line coverage due to uncovered getter / setter on a property\n    // - unreachable code\n\n    Coverage coverage = new Coverage();\n    new VisualStudioCoverageXmlReportParser(alwaysTrue).accept(new File(\"src/test/resources/visualstudio_coverage_xml/valid_complex_case.coveragexml\"), coverage);\n\n    String filePath = new File(\"GetSet\\\\Bar.cs\").getCanonicalPath();\n\n    assertThat(coverage.files()).containsOnly(\n      filePath,\n      new File(\"GetSet\\\\FooCallsBar.cs\").getCanonicalPath(),\n      new File(\"GetSetTests\\\\BarTests.cs\").getCanonicalPath());\n\n    assertThat(coverage.hits(filePath))\n      .hasSize(10)\n      .containsOnly(\n        Assertions.entry(11, 2),\n        Assertions.entry(13, 1),\n        Assertions.entry(15, 2),\n        Assertions.entry(17, 1),\n        Assertions.entry(20, 1),\n        Assertions.entry(21, 3),\n        Assertions.entry(25, 1),\n        Assertions.entry(26, 1),\n        Assertions.entry(28, 1),\n        Assertions.entry(29, 1));\n\n    // the unreachable code is taken into consideration by the coverage tool\n    assertThat(coverage.getBranchCoverage(filePath)).isEmpty();\n\n    assertThat(logTester.logs(Level.INFO).get(0)).startsWith(\"Parsing the Visual Studio coverage XML report \");\n    assertThat(logTester.logs(Level.DEBUG).get(0)).startsWith(\"The current user dir is \");\n    assertThat(logTester.logs(Level.TRACE)).hasSize(4);\n    assertThat(logTester.logs(Level.TRACE).get(1))\n      .startsWith(\"Found covered lines for id '1' for path \")\n      .endsWith(\"\\\\GetSet\\\\Bar.cs'\");\n  }\n\n  @Test\n  public void valid_with_no_absolute_path_no_deterministic_build_path() throws Exception {\n    Coverage coverage = new Coverage();\n\n    new VisualStudioCoverageXmlReportParser(alwaysFalseAndEmpty).accept(new File(\"src/test/resources/visualstudio_coverage_xml/valid.coveragexml\"), coverage);\n\n    assertThat(coverage.files()).isEmpty();\n    assertThat(coverage.hits(new File(\"MyLibrary\\\\Calc.cs\").getCanonicalPath())).isEmpty();\n\n    assertThat(logTester.logs(Level.INFO).get(0)).startsWith(\"Parsing the Visual Studio coverage XML report \");\n    assertThat(logTester.logs(Level.DEBUG).get(0)).startsWith(\"The current user dir is \");\n  }\n\n  @Test\n  public void valid_with_no_absolute_path_deterministic_build_path_found() {\n    Coverage coverage = new Coverage();\n    FileService mockFileService = mock(FileService.class);\n    when(mockFileService.isSupportedAbsolute(anyString())).thenReturn(false);\n    String testAbsolutePath = \"/test/file/Calc.cs\";\n    when(mockFileService.getAbsolutePath(anyString())).thenReturn(Optional.of(testAbsolutePath));\n    new VisualStudioCoverageXmlReportParser(mockFileService).accept(new File(\"src/test/resources/visualstudio_coverage_xml/valid.coveragexml\"), coverage);\n\n    assertThat(coverage.files()).hasSize(1);\n    assertThat(coverage.hits(testAbsolutePath)).hasSize(17)\n      // because we return the mockInput for all entries, the below stats are the aggregated stats for all files\n      .containsOnly(\n        Assertions.entry(12, 0),\n        Assertions.entry(13, 1),\n        Assertions.entry(14, 1),\n        Assertions.entry(15, 1),\n        Assertions.entry(17, 1),\n        Assertions.entry(18, 1),\n        Assertions.entry(19, 1),\n        Assertions.entry(22, 0),\n        Assertions.entry(23, 0),\n        Assertions.entry(24, 0),\n        Assertions.entry(25, 0),\n        Assertions.entry(26, 0),\n        Assertions.entry(28, 0),\n        Assertions.entry(29, 0),\n        Assertions.entry(32, 0),\n        Assertions.entry(33, 0),\n        Assertions.entry(34, 0));\n\n    assertThat(logTester.logs(Level.INFO).get(0)).startsWith(\"Parsing the Visual Studio coverage XML report \");\n    assertThat(logTester.logs(Level.DEBUG).get(0)).startsWith(\"The current user dir is \");\n    assertThat(logTester.logs(Level.DEBUG).get(1)).isEqualTo(\"Found indexed file '/test/file/Calc.cs' for coverage entry 'CalcMultiplyTest\\\\MultiplyTest.cs'.\");\n  }\n\n  @Test\n  public void valid_with_deterministic_source_path_returns_found_path() {\n    Coverage coverage = new Coverage();\n    FileService mockFileService = mock(FileService.class);\n    when(mockFileService.isSupportedAbsolute(anyString())).thenReturn(false);\n    String testAbsolutePath = \"/full/path/to/its/projects/CoverageTest.DeterministicSourcePaths/CoverageTest.DeterministicSourcePaths/Foo.cs\";\n    when(mockFileService.getAbsolutePath(\"/_/its/projects/CoverageTest.DeterministicSourcePaths/CoverageTest.DeterministicSourcePaths/Foo.cs\")).thenReturn(Optional.of(testAbsolutePath));\n    new VisualStudioCoverageXmlReportParser(mockFileService).accept(new File(\"src/test/resources/visualstudio_coverage_xml/deterministic_source_paths.coveragexml\"), coverage);\n\n    assertThat(coverage.files()).hasSize(1);\n    assertThat(coverage.hits(testAbsolutePath)).hasSize(6)\n      .containsOnly(\n        Assertions.entry(6, 1),\n        Assertions.entry(7, 1),\n        Assertions.entry(8, 1),\n        Assertions.entry(11, 0),\n        Assertions.entry(12, 0),\n        Assertions.entry(13, 0));\n\n    assertThat(logTester.logs(Level.INFO).get(0)).startsWith(\"Parsing the Visual Studio coverage XML report \");\n    assertThat(logTester.logs(Level.DEBUG)).hasSize(2);\n    assertThat(logTester.logs(Level.DEBUG).get(0)).startsWith(\"The current user dir is \");\n    assertThat(logTester.logs(Level.DEBUG).get(1)).isEqualTo(\"Found indexed file \" +\n      \"'/full/path/to/its/projects/CoverageTest.DeterministicSourcePaths/CoverageTest.DeterministicSourcePaths/Foo.cs'\" +\n      \" for coverage entry '/_/its/projects/CoverageTest.DeterministicSourcePaths/CoverageTest.DeterministicSourcePaths/Foo.cs'.\");\n  }\n\n  @Test\n  public void should_not_fail_with_invalid_path() {\n    new VisualStudioCoverageXmlReportParser(alwaysTrue).accept(new File(\"src/test/resources/visualstudio_coverage_xml/invalid_path.coveragexml\"), mock(Coverage.class));\n    assertThat(logTester.logs(Level.INFO).get(0)).startsWith(\"Parsing the Visual Studio coverage XML report \");\n    assertThat(logTester.logs(Level.DEBUG).get(0)).startsWith(\"The current user dir is \");\n    assertThat(logTester.logs(Level.WARN).get(0))\n      .isEqualTo(\"Skipping the import of Visual Studio XML code coverage for the invalid file path: z:\\\\*\\\"?.cs at line 55\");\n  }\n\n  @Test\n  public void should_not_fail_with_missing_range_information() {\n    new VisualStudioCoverageXmlReportParser(alwaysTrue).accept(new File(\"src/test/resources/visualstudio_coverage_xml/no_ranges.coveragexml\"), mock(Coverage.class));\n    assertThat(logTester.logs(Level.INFO).get(0)).startsWith(\"Parsing the Visual Studio coverage XML report \");\n    assertThat(logTester.logs(Level.DEBUG).get(0)).startsWith(\"The current user dir is \");\n    assertThat(logTester.logs(Level.WARN)).isEmpty();\n    assertThat(logTester.logs(Level.TRACE).get(0))\n      .startsWith(\"Found uncovered lines for id '0' for path \")\n      .endsWith(\"\\\\MyLibrary\\\\Calc.cs'\");\n  }\n\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/CallableUtilsTests.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.assertThrows;\nimport static org.sonarsource.dotnet.shared.CallableUtils.lazy;\n\npublic class CallableUtilsTests {\n\n    @Test\n    public void lazy_null(){\n        var sut = lazy(() -> null);\n        assertEquals(\"null\", sut.toString());\n    }\n\n    @Test\n    public void lazy_value(){\n        var sut = lazy(() -> 1);\n        assertEquals(\"1\", sut.toString());\n    }\n\n    @Test\n    public void lazy_throws(){\n        var message = \"message\";\n        var sut = lazy(() -> throwingMethod(message));\n\n        var exception = assertThrows(LazyCallException.class, sut::toString);\n        assertEquals(\"An error occurred when calling a lazy operation\", exception.getMessage());\n        assertEquals(message, exception.getCause().getMessage());\n    }\n\n    private int throwingMethod(String message) {\n        throw new RuntimeException(message);\n    }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/AbstractLanguageConfigurationTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport java.util.Optional;\nimport org.junit.Test;\nimport org.sonar.api.config.Configuration;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\npublic class AbstractLanguageConfigurationTest {\n\n  @Test\n  public void ignoreExternalIssues_is_false_by_default() {\n    Configuration configuration = mock(Configuration.class);\n    AbstractLanguageConfiguration config = createConfiguration(configuration);\n\n    assertThat(config.ignoreThirdPartyIssues()).isFalse();\n  }\n\n  @Test\n  public void ignoreExternalIssues_is_true_when_set() {\n    Configuration configuration = mock(Configuration.class);\n    when(configuration.getBoolean(\"sonar.cs.roslyn.ignoreIssues\")).thenReturn(Optional.of(true));\n    AbstractLanguageConfiguration config = createConfiguration(configuration);\n\n    assertThat(config.ignoreThirdPartyIssues()).isTrue();\n  }\n\n  @Test\n  public void bugCategories_reads_configuration() {\n    Configuration configuration = mock(Configuration.class);\n    when(configuration.getStringArray(\"sonar.cs.roslyn.bugCategories\")).thenReturn(new String[]{\"A\", \"B\", \"C\"});\n    AbstractLanguageConfiguration config = createConfiguration(configuration);\n\n    assertThat(config.bugCategories()).containsExactly(\"A\", \"B\", \"C\");\n  }\n\n  @Test\n  public void codeSmellCategories_reads_configuration() {\n    Configuration configuration = mock(Configuration.class);\n    when(configuration.getStringArray(\"sonar.cs.roslyn.codeSmellCategories\")).thenReturn(new String[]{\"A\", \"B\", \"C\"});\n    AbstractLanguageConfiguration config = createConfiguration(configuration);\n\n    assertThat(config.codeSmellCategories()).containsExactly(\"A\", \"B\", \"C\");\n  }\n\n  @Test\n  public void vulnerabilityCategories_reads_configuration() {\n    Configuration configuration = mock(Configuration.class);\n    when(configuration.getStringArray(\"sonar.cs.roslyn.vulnerabilityCategories\")).thenReturn(new String[]{\"A\", \"B\", \"C\"});\n    AbstractLanguageConfiguration config = createConfiguration(configuration);\n\n    assertThat(config.vulnerabilityCategories()).containsExactly(\"A\", \"B\", \"C\");\n  }\n\n  @Test\n  public void whenSettingIsTrue_analyzeGeneratedCode_returnsTrue() {\n    Configuration configuration = mock(Configuration.class);\n    when(configuration.getBoolean(\"sonar.cs.analyzeGeneratedCode\")).thenReturn(Optional.of(true));\n\n    AbstractLanguageConfiguration config = createConfiguration(configuration);\n\n    assertThat(config.analyzeGeneratedCode()).isTrue();\n  }\n\n  @Test\n  public void whenSettingIsFalse_analyzeGeneratedCode_returnsFalse() {\n    Configuration configuration = mock(Configuration.class);\n    when(configuration.getBoolean(\"sonar.cs.analyzeGeneratedCode\")).thenReturn(Optional.of(false));\n\n    AbstractLanguageConfiguration config = createConfiguration(configuration);\n\n    assertThat(config.analyzeGeneratedCode()).isFalse();\n  }\n\n  @Test\n  public void whenSettingIsEmpty_analyzeGeneratedCode_returnsFalse() {\n    Configuration configuration = mock(Configuration.class);\n    when(configuration.getBoolean(\"sonar.cs.analyzeGeneratedCode\")).thenReturn(Optional.empty());\n\n    AbstractLanguageConfiguration config = createConfiguration(configuration);\n\n    assertThat(config.analyzeGeneratedCode()).isFalse();\n  }\n\n  private AbstractLanguageConfiguration createConfiguration(Configuration configuration) {\n    PluginMetadata metadata = mock(PluginMetadata.class);\n    when(metadata.languageKey()).thenReturn(\"cs\");\n    return new AbstractLanguageConfiguration(configuration, metadata) {\n    };\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/AbstractPropertyDefinitionsTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport java.util.List;\nimport org.junit.Test;\nimport org.sonar.api.PropertyType;\nimport org.sonar.api.config.PropertyDefinition;\nimport org.sonar.api.utils.ManifestUtils;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.api.Assertions.tuple;\nimport static org.mockito.ArgumentMatchers.any;\nimport static org.mockito.ArgumentMatchers.eq;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.mockStatic;\nimport static org.mockito.Mockito.when;\n\npublic class AbstractPropertyDefinitionsTest {\n\n  @Test\n  public void hidden_properties() {\n    List<PropertyDefinition> properties = createProperties().stream()\n      .filter(x -> !x.global() && x.configScopes().isEmpty()) // Hidden is non-global without scopes\n      .toList();\n    assertThat(properties)\n      .extracting(PropertyDefinition::key, PropertyDefinition::defaultValue)\n      .containsExactlyInAnyOrder(\n        tuple(\"sonar.language-key.roslyn.reportFilePaths\", \"\"),\n        tuple(\"sonar.language-key.analyzer.projectOutPaths\", \"\"),\n        tuple(\"sonar.language-key.analyzer.dotnet.pluginKey\", \"plugin-key\"),\n        tuple(\"sonar.language-key.analyzer.dotnet.pluginVersion\", \"1.2.3.4\"),\n        tuple(\"sonar.language-key.analyzer.dotnet.staticResourceName\", \"SonarAnalyzer-plugin-key-1.2.3.4.zip\"),\n        tuple(\"sonaranalyzer-language-key.pluginKey\", \"plugin-key\"),\n        tuple(\"sonaranalyzer-language-key.pluginVersion\", \"1.2.3.4\"),\n        tuple(\"sonaranalyzer-language-key.staticResourceName\", \"SonarAnalyzer-plugin-key-1.2.3.4.zip\"),\n        tuple(\"sonaranalyzer-language-key.analyzerId\", \"Project-Name\"),\n        tuple(\"sonaranalyzer-language-key.ruleNamespace\", \"Project-Name\"));\n  }\n\n  @Test\n  public void scoped_properties() {\n    List<PropertyDefinition> properties = createProperties().stream()\n      .filter(x -> !x.global() && !x.configScopes().isEmpty())\n      .toList();\n    assertThat(properties).isEmpty();\n  }\n\n  @Test\n  public void global_properties() {\n    List<PropertyDefinition> properties = createProperties().stream()\n      .filter(x -> x.global())\n      .toList();\n    assertThat(properties)\n      .extracting(PropertyDefinition::type, PropertyDefinition::key, PropertyDefinition::category, PropertyDefinition::subCategory, PropertyDefinition::defaultValue)\n      .containsExactlyInAnyOrder(\n        tuple(PropertyType.STRING, \"sonar.language-key.file.suffixes\", \"Language Name\", \"\", null),\n        tuple(PropertyType.BOOLEAN, \"sonar.language-key.ignoreHeaderComments\", \"Language Name\", \"\", \"true\"),\n        tuple(PropertyType.BOOLEAN, \"sonar.language-key.analyzeGeneratedCode\", \"Language Name\", \"\", \"false\"),\n        tuple(PropertyType.BOOLEAN, \"sonar.language-key.roslyn.ignoreIssues\", \"External Analyzers\", \"Language Name\", \"false\"),\n        tuple(PropertyType.STRING, \"sonar.language-key.roslyn.bugCategories\", \"External Analyzers\", \"Language Name\", \"\"),\n        tuple(PropertyType.STRING, \"sonar.language-key.roslyn.vulnerabilityCategories\", \"External Analyzers\", \"Language Name\", \"\"),\n        tuple(PropertyType.STRING, \"sonar.language-key.roslyn.codeSmellCategories\", \"External Analyzers\", \"Language Name\", \"\"));\n  }\n\n  private List<PropertyDefinition> createProperties() {\n    var sut = new AbstractPropertyDefinitions(metadata()) {\n    };\n    try (var manifestMock = mockStatic(ManifestUtils.class)) {\n      manifestMock\n        .when(() -> ManifestUtils.getPropertyValues(any(), eq(\"Plugin-Version\")))\n        .thenReturn(List.of(\"1.2.3.4\"));\n\n      return sut.create();\n    }\n  }\n\n  private static PluginMetadata metadata() {\n    PluginMetadata mock = mock(PluginMetadata.class);\n    when(mock.pluginKey()).thenReturn(\"plugin-key\");\n    when(mock.languageKey()).thenReturn(\"language-key\");\n    when(mock.languageName()).thenReturn(\"Language Name\");\n    when(mock.analyzerProjectName()).thenReturn(\"Project-Name\");\n    return mock;\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/AbstractSonarWayProfileTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport org.junit.BeforeClass;\nimport org.junit.Test;\nimport org.sonar.api.rule.RuleKey;\nimport org.sonar.api.server.profile.BuiltInQualityProfilesDefinition;\nimport org.sonar.api.server.profile.BuiltInQualityProfilesDefinition.Context;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\npublic class AbstractSonarWayProfileTest {\n\n  private static PluginMetadata metadata;\n  private static RoslynRules roslynRules;\n\n  @BeforeClass\n  public static void beforeAll() {\n    metadata = mock(PluginMetadata.class);\n    when(metadata.repositoryKey()).thenReturn(\"REPO\");\n    when(metadata.languageKey()).thenReturn(\"LANG\");\n    when(metadata.resourcesDirectory()).thenReturn(\"/AbstractSonarWayProfile/\");\n\n    RoslynRules.Rule rule1 = new RoslynRules.Rule();\n    rule1.id = \"S-REAL-1\";\n    RoslynRules.Rule rule2 = new RoslynRules.Rule();\n    rule2.id = \"S-REAL-2\";\n    roslynRules = mock(RoslynRules.class);\n  }\n\n  @Test\n  public void define_createsProfile() {\n    AbstractSonarWayProfile sut = new AbstractSonarWayProfile(metadata, roslynRules) {\n    };\n    Context context = new Context();\n    sut.define(context);\n\n    BuiltInQualityProfilesDefinition.BuiltInQualityProfile profile = context.profile(\"LANG\", \"Sonar way\");\n    assertThat(profile).isNotNull();\n  }\n\n  @Test\n  public void define_activateAdditionalRules() {\n    AbstractSonarWayProfile sut = new AbstractSonarWayProfile(metadata, roslynRules) {\n      @Override\n      protected void registerRulesFromRegistrars(NewBuiltInQualityProfile profile) {\n        profile.activateRule(\"OTHER-REPO\", \"OTHER-RULE\");\n      }\n    };\n    Context context = new Context();\n    sut.define(context);\n\n    BuiltInQualityProfilesDefinition.BuiltInQualityProfile profile = context.profile(\"LANG\", \"Sonar way\");\n    assertThat(profile).isNotNull();\n    assertThat(profile.rule(RuleKey.of(\"OTHER-REPO\", \"OTHER-RULE\"))).isNotNull();\n    BuiltInQualityProfilesDefinition.BuiltInQualityProfile otherProfile = context.profile(\"OTHER_LANG\", \"Sonar way\");\n    assertThat(otherProfile).isNull();\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/CodeCoverageProviderTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport org.junit.Test;\nimport org.sonar.api.batch.sensor.SensorDescriptor;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.times;\nimport static org.mockito.Mockito.verify;\nimport static org.mockito.Mockito.when;\nimport static org.sonarsource.dotnet.shared.PropertyUtils.nonProperties;\nimport static org.sonarsource.dotnet.shared.PropertyUtils.propertyKeys;\n\npublic class CodeCoverageProviderTest {\n\n  @Test\n  public void vbnet() {\n    PluginMetadata pluginMetadata = mock(PluginMetadata.class);\n    when(pluginMetadata.languageKey()).thenReturn(\"vbnet\");\n    CodeCoverageProvider provider = new CodeCoverageProvider(pluginMetadata);\n    assertThat(nonProperties(provider.extensions())).containsOnly(\n      provider,\n      CodeCoverageProvider.UnitTestCoverageAggregator.class,\n      CodeCoverageProvider.UnitTestCoverageReportImportSensor.class);\n    assertThat(propertyKeys(provider.extensions())).containsOnly(\n      \"sonar.vbnet.ncover3.reportsPaths\",\n      \"sonar.vbnet.opencover.reportsPaths\",\n      \"sonar.vbnet.dotcover.reportsPaths\",\n      \"sonar.vbnet.vscoveragexml.reportsPaths\",\n      \"sonar.vbnet.cobertura.reportsPaths\");\n  }\n\n  @Test\n  public void csharp() {\n    PluginMetadata pluginMetadata = mock(PluginMetadata.class);\n    when(pluginMetadata.languageKey()).thenReturn(\"cs\");\n    CodeCoverageProvider provider = new CodeCoverageProvider(pluginMetadata);\n    assertThat(nonProperties(provider.extensions())).containsOnly(\n      provider,\n      CodeCoverageProvider.UnitTestCoverageAggregator.class,\n      CodeCoverageProvider.UnitTestCoverageReportImportSensor.class);\n    assertThat(propertyKeys(provider.extensions())).containsOnly(\n      \"sonar.cs.ncover3.reportsPaths\",\n      \"sonar.cs.opencover.reportsPaths\",\n      \"sonar.cs.dotcover.reportsPaths\",\n      \"sonar.cs.vscoveragexml.reportsPaths\",\n      \"sonar.cs.cobertura.reportsPaths\");\n  }\n\n  @Test\n  public void verify_UnitTestCoverageReportImportSensor_constructor_uses_arguments() {\n    // setup\n    CodeCoverageProvider provider = createTestProvider();\n\n    // act\n    CodeCoverageProvider.UnitTestCoverageReportImportSensor sut = provider.new UnitTestCoverageReportImportSensor(\n      mock(CodeCoverageProvider.UnitTestCoverageAggregator.class)\n    );\n\n    // verify that what got passed to the constructor is used later on\n    SensorDescriptor mockDescriptor = mock(SensorDescriptor.class);\n    sut.describe(mockDescriptor);\n\n    verify(mockDescriptor, times(1)).name(\"NAME Tests Coverage Report Import\");\n    verify(mockDescriptor, times(1)).onlyOnLanguage(\"KEY\");\n  }\n\n  private static CodeCoverageProvider createTestProvider() {\n    PluginMetadata pluginMetadata = mock(PluginMetadata.class);\n    when(pluginMetadata.languageKey()).thenReturn(\"KEY\");\n    when(pluginMetadata.languageName()).thenReturn(\"NAME\");\n    return new CodeCoverageProvider(pluginMetadata);\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/DotNetRulesDefinitionTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport java.io.InputStream;\nimport java.util.Set;\nimport org.junit.BeforeClass;\nimport org.junit.Test;\nimport org.sonar.api.SonarEdition;\nimport org.sonar.api.SonarQubeSide;\nimport org.sonar.api.SonarRuntime;\nimport org.sonar.api.internal.SonarRuntimeImpl;\nimport org.sonar.api.rule.RuleStatus;\nimport org.sonar.api.rules.RuleType;\nimport org.sonar.api.server.debt.DebtRemediationFunction;\nimport org.sonar.api.server.rule.RuleParamType;\nimport org.sonar.api.server.rule.RulesDefinition;\nimport org.sonar.api.utils.Version;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\npublic class DotNetRulesDefinitionTest {\n  private static final String PCI_DSS_RULE_KEY = \"S1115\";\n  private static final String OWASP_ASVS_RULE_KEY = \"S1116\";\n  private static final String STIG_RULE_KEY = \"S1117\";\n  private static final String TAGS_RULE_KEY = \"S1111\";\n  private static final String MINIMAL_RULE_KEY = \"S100\";\n  private static final String SINGLE_PARAM_RULE_KEY = \"S1113\";\n  private static final String MULTI_PARAM_RULE_KEY = \"S1112\";\n  private static final String SECURITY_HOTSPOT_RULE_KEY = \"S4502\";\n  private static final String VULNERABILITY_RULE_KEY = \"S2115\";\n  private static final PluginMetadata METADATA = mockMetadata();\n  private static final SonarRuntime SONAR_RUNTIME = SonarRuntimeImpl.forSonarQube(Version.create(10, 10), SonarQubeSide.SCANNER,\n    SonarEdition.COMMUNITY);\n  private static final RoslynRules ROSLYN_RULES = new TestRoslynRules();\n  private static final RulesDefinition.Context CONTEXT = new RulesDefinition.Context();\n\n  private static RulesDefinition.Repository ruleRepo;\n\n  @BeforeClass\n  public static void setupContext() {\n    DotNetRulesDefinition definition = new DotNetRulesDefinition(METADATA, SONAR_RUNTIME, ROSLYN_RULES);\n    definition.define(CONTEXT);\n    ruleRepo = CONTEXT.repository(\"test\");\n  }\n\n  @Test\n  public void nonSonarWayRule_disabledByDefault() {\n    RulesDefinition.Rule rule = ruleRepo.rule(\"S1117\");\n    assertThat(rule).isNotNull();\n    assertThat(rule.activatedByDefault()).isFalse();\n  }\n\n  @Test\n  public void rule_properties_are_loaded() {\n    assertThat(CONTEXT.repositories()).hasSize(1);\n\n    RulesDefinition.Rule s100 = ruleRepo.rule(\"S100\");\n    assertThat(s100).isNotNull();\n    assertThat(s100.activatedByDefault()).isTrue();\n    assertThat(s100.name()).isEqualTo(\"Methods and properties should be named in PascalCase\");\n    assertThat(s100.type()).isEqualTo(RuleType.CODE_SMELL);\n    assertThat(s100.status()).isEqualTo(RuleStatus.READY);\n    assertThat(s100.severity()).isEqualTo(\"MINOR\");\n    assertThat(s100.debtRemediationFunction().type()).isEqualTo(DebtRemediationFunction.Type.CONSTANT_ISSUE);\n    assertThat(s100.debtRemediationFunction().baseEffort()).isEqualTo(\"5min\");\n    assertThat(s100.params()).isEmpty();\n    assertThat(s100.tags()).isEmpty();\n  }\n\n  @Test\n  public void securityStandards_9_5_PCI_DSS_isSet() {\n    assertThat(getSecurityStandards(Version.create(9, 5), PCI_DSS_RULE_KEY))\n      .containsExactlyInAnyOrder(\"pciDss-3.2:6.5.10\", \"pciDss-4.0:6.2.4\");\n  }\n\n  @Test\n  public void securityStandards_9_9_ASVS_isSet() {\n    assertThat(getSecurityStandards(Version.create(9, 9), OWASP_ASVS_RULE_KEY))\n      .containsExactlyInAnyOrder(\"owaspAsvs-4.0:2.10.4\", \"owaspAsvs-4.0:3.5.2\", \"owaspAsvs-4.0:6.4.1\");\n  }\n\n  @Test\n  public void securityStandards_10_10_STIG_isSet() {\n    assertThat(getSecurityStandards(Version.create(10, 10), STIG_RULE_KEY))\n      .containsExactlyInAnyOrder(\"stig-ASD_V5R3:V-222542\", \"stig-ASD_V5R3:V-222603\");\n  }\n\n  @Test\n  public void tags_areSet() {\n    RulesDefinition.Rule rule = ruleRepo.rule(TAGS_RULE_KEY);\n    assertThat(rule.tags()).containsExactlyInAnyOrder(\"cwe\", \"owasp-a10\", \"sans-top25-porous\", \"owasp-a3\");\n  }\n\n  @Test\n  public void tags_areEmpty() {\n    RulesDefinition.Rule rule = ruleRepo.rule(MINIMAL_RULE_KEY);\n    assertThat(rule.tags()).isEmpty();\n  }\n\n  @Test\n  public void remediation_isSet() {\n    assertThat(ruleRepo.rule(\"S1111\").debtRemediationFunction())\n      .hasToString(\"DebtRemediationFunction{type=CONSTANT_ISSUE, gap multiplier=null, base effort=5min}\");\n    assertThat(ruleRepo.rule(\"S1112\").debtRemediationFunction())\n      .hasToString(\"DebtRemediationFunction{type=LINEAR, gap multiplier=10min, base effort=null}\");\n    assertThat(ruleRepo.rule(\"S1113\").debtRemediationFunction())\n      .hasToString(\"DebtRemediationFunction{type=LINEAR_OFFSET, gap multiplier=30min, base effort=4h}\");\n    assertThat(ruleRepo.rule(\"S1114\").debtRemediationFunction()).isNull();\n  }\n\n  @Test\n  public void noParams_paramsIsEmpty() {\n    RulesDefinition.Rule rule = ruleRepo.rule(MINIMAL_RULE_KEY);\n    assertThat(rule.params()).isEmpty();\n  }\n\n  @Test\n  public void singleParam_isSet() {\n    RulesDefinition.Rule rule = ruleRepo.rule(SINGLE_PARAM_RULE_KEY);\n    assertThat(rule.params()).hasSize(1);\n    assertParam(rule.params().get(0), \"answer\", RuleParamType.INTEGER, \"42\", \"Answer to life the universe and everything.\");\n  }\n\n  @Test\n  public void multipleParams_areSet() {\n    RulesDefinition.Rule rule = ruleRepo.rule(MULTI_PARAM_RULE_KEY);\n    assertThat(rule.params()).hasSize(2);\n    assertParam(rule.params().get(0), \"random\", RuleParamType.INTEGER, \"4\", \"chosen by fair dice roll. guaranteed to be random.\");\n    assertParam(rule.params().get(1), \"Tr0ub4dor&3\", RuleParamType.STRING, \"correct horse battery staple\", \"ELI5 entropy please!\");\n  }\n\n  @Test\n  public void securityHotspot_isActivatedByDefault() {\n    RulesDefinition.Rule hardcodedCredentialsRule = ruleRepo.rule(SECURITY_HOTSPOT_RULE_KEY);\n    assertThat(hardcodedCredentialsRule.type()).isEqualTo(RuleType.SECURITY_HOTSPOT);\n    assertThat(hardcodedCredentialsRule.activatedByDefault()).isTrue();\n  }\n\n  @Test\n  public void securityHotspot_hasSecurityStandards() {\n    RulesDefinition.Rule rule = ruleRepo.rule(SECURITY_HOTSPOT_RULE_KEY);\n    assertThat(rule.type()).isEqualTo(RuleType.SECURITY_HOTSPOT);\n    assertThat(rule.securityStandards()).containsExactlyInAnyOrder(\n      \"cwe:352\",\n      \"owaspTop10:a6\",\n      \"owaspTop10-2021:a1\",\n      \"pciDss-3.2:6.5.9\",\n      \"pciDss-4.0:6.2.4\",\n      \"owaspAsvs-4.0:13.2.3\",\n      \"owaspAsvs-4.0:4.2.2\",\n      \"stig-ASD_V5R3:V-222603\");\n  }\n\n  @Test\n  public void vulnerability_hasSecurityStandards() {\n    RulesDefinition.Rule rule = ruleRepo.rule(VULNERABILITY_RULE_KEY);\n    assertThat(rule.type()).isEqualTo(RuleType.VULNERABILITY);\n    assertThat(rule.securityStandards()).containsExactlyInAnyOrder(\n      \"cwe:521\",\n      \"owaspAsvs-4.0:9.2.2\",\n      \"owaspAsvs-4.0:9.2.3\",\n      \"owaspTop10:a2\",\n      \"owaspTop10:a3\",\n      \"owaspTop10-2021:a7\",\n      \"pciDss-3.2:6.5.10\",\n      \"pciDss-4.0:6.2.4\");\n  }\n\n  private static void assertParam(RulesDefinition.Param param, String expectedKey, RuleParamType expectedType,\n    String expectedDefaultValue, String expectedDescription) {\n    assertThat(param.key()).isEqualTo(expectedKey);\n    assertThat(param.type()).isEqualTo(expectedType);\n    assertThat(param.defaultValue()).isEqualTo(expectedDefaultValue);\n    assertThat(param.description()).isEqualTo(expectedDescription);\n  }\n\n  private static Set<String> getSecurityStandards(Version version, String ruleId) {\n    SonarRuntime sonarRuntime = SonarRuntimeImpl.forSonarQube(version, SonarQubeSide.SCANNER, SonarEdition.COMMUNITY);\n    DotNetRulesDefinition sut = new DotNetRulesDefinition(METADATA, sonarRuntime, ROSLYN_RULES);\n    var securityContext = new RulesDefinition.Context();\n    sut.define(securityContext);\n    RulesDefinition.Repository repository = securityContext.repository(\"test\");\n\n    assertThat(repository).isNotNull();\n    RulesDefinition.Rule rule = repository.rule(ruleId);\n    assertThat(rule).isNotNull();\n    return rule.securityStandards();\n  }\n\n  private static PluginMetadata mockMetadata() {\n    PluginMetadata metadata = mock(PluginMetadata.class);\n    when(metadata.repositoryKey()).thenReturn(\"test\");\n    when(metadata.languageKey()).thenReturn(\"test\");\n    when(metadata.resourcesDirectory()).thenReturn(\"/DotNetRulesDefinitionTest/\");\n    return metadata;\n  }\n\n  private static class TestRoslynRules extends RoslynRules {\n\n    TestRoslynRules() {\n      super(METADATA);\n    }\n\n    @Override\n    InputStream getResourceAsStream(String name) {\n      return DotNetRulesDefinitionTest.class.getResourceAsStream(name);\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/EncodingPerFileTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport java.io.IOException;\nimport java.net.URI;\nimport java.nio.charset.Charset;\nimport java.nio.charset.StandardCharsets;\nimport java.util.TreeMap;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.TemporaryFolder;\nimport org.slf4j.event.Level;\nimport org.sonar.api.batch.fs.InputFile;\nimport org.sonar.api.testfixtures.log.LogTester;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\npublic class EncodingPerFileTest {\n  @Rule\n  public TemporaryFolder temp = new TemporaryFolder();\n  @Rule\n  public LogTester logTester = new LogTester();\n\n  private URI fileUri;\n\n  @Before\n  public void prepareTestFile() throws IOException {\n    fileUri = temp.newFile().toURI();\n  }\n\n  @Test\n  public void should_treat_as_match_when_roslyn_entry_missing_for_file() throws IOException {\n    Charset roslynCharset = StandardCharsets.UTF_8;\n    Charset sqCharset = StandardCharsets.UTF_16;\n\n    assertEncodingMatch(roslynCharset, URI.create(\"dummy\"), sqCharset, true);\n  }\n\n  @Test\n  public void should_treat_as_match_and_warn_when_roslyn_encoding_missing() throws IOException {\n    assertEncodingMatch(null, fileUri, null, true);\n\n    assertThat(logTester.logs(Level.WARN)).containsOnly(String.format(\"Roslyn can not detect encoding for '%s', using default instead.\",\n      fileUri.toString()));\n  }\n\n  @Test\n  public void should_treat_as_mismatch_when_roslyn_utf8_and_sq_utf16() throws IOException {\n    Charset roslynCharset = StandardCharsets.UTF_8;\n    Charset sqCharset = StandardCharsets.UTF_16;\n\n    assertEncodingMatch(roslynCharset, fileUri, sqCharset, false);\n  }\n\n  @Test\n  public void should_treat_as_match_when_roslyn_utf16_and_sq_utf16le() throws IOException {\n    Charset roslynCharset = StandardCharsets.UTF_16;\n    Charset sqCharset = StandardCharsets.UTF_16LE;\n\n    assertEncodingMatch(roslynCharset, fileUri, sqCharset, true);\n  }\n\n  @Test\n  public void encoding_per_file_is_not_case_sensitive() throws IOException {\n    Charset sqCharset = StandardCharsets.UTF_16;\n\n    // AbstractGlobalProtobufFileProcessor.getRoslynEncodingPerUri() case-insensitivity is mocked in assertEncodingMatch.\n    // We test that encodingMatch() uses this underlying tree and doesn't change the expected case insensitive behavior.\n    assertEncodingMatch(StandardCharsets.UTF_8, URI.create(fileUri.toString().toUpperCase()), sqCharset, false);\n    assertEncodingMatch(StandardCharsets.UTF_8, URI.create(fileUri.toString().toLowerCase()), sqCharset, false);\n    assertEncodingMatch(StandardCharsets.UTF_16, URI.create(fileUri.toString().toUpperCase()), sqCharset, true);\n    assertEncodingMatch(StandardCharsets.UTF_16, URI.create(fileUri.toString().toLowerCase()), sqCharset, true);\n  }\n\n  private void assertEncodingMatch(Charset roslynCharset, URI fileUri, Charset sqCharset, boolean result) throws IOException {\n    GlobalProtobufFileProcessor processor = mock(GlobalProtobufFileProcessor.class);\n    TreeMap<String, Charset> encodingPerUri = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);\n    encodingPerUri.put(this.fileUri.toString(), roslynCharset);\n    when(processor.getRoslynEncodingPerUri()).thenReturn(encodingPerUri);\n    EncodingPerFile encodingPerFile = new EncodingPerFile(processor);\n    InputFile inputFile = newInputFile(fileUri, sqCharset);\n    assertThat(encodingPerFile.encodingMatch(inputFile)).isEqualTo(result);\n  }\n\n  private InputFile newInputFile(URI uri, Charset charset) {\n    InputFile inputFile = mock(InputFile.class);\n    when(inputFile.uri()).thenReturn(uri);\n    when(inputFile.charset()).thenReturn(charset);\n    return inputFile;\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/GeneratedFileFilterTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport java.nio.file.Paths;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.slf4j.event.Level;\nimport org.sonar.api.batch.fs.InputFile;\nimport org.sonar.api.config.PropertyDefinitions;\nimport org.sonar.api.config.internal.MapSettings;\nimport org.sonar.api.testfixtures.log.LogTester;\nimport org.sonar.api.utils.System2;\nimport org.sonarsource.dotnet.shared.plugins.filters.GeneratedFileFilter;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\npublic class GeneratedFileFilterTest {\n\n  @Rule\n  public LogTester logs = new LogTester();\n\n  private AbstractLanguageConfiguration defaultConfiguration;\n\n  @Before\n  public void setUp() {\n    logs.setLevel(Level.DEBUG);\n    // by default, analyzeGeneratedCode is set to false\n    PluginMetadata metadata = mock(PluginMetadata.class);\n    when(metadata.languageKey()).thenReturn(\"cs\");\n    when(metadata.languageName()).thenReturn(\"C#\");\n    when(metadata.fileSuffixesDefaultValue()).thenReturn(\".cs\");\n    AbstractPropertyDefinitions definitions = new AbstractPropertyDefinitions(metadata) {\n    };\n    MapSettings settings = new MapSettings(new PropertyDefinitions(mock(System2.class), definitions.create()));\n    defaultConfiguration = new AbstractLanguageConfiguration(settings.asConfig(), metadata) {\n    };\n  }\n\n  @Test\n  public void accept_returns_false_for_autogenerated_files() {\n    // Arrange\n    InputFile inputFile = mockInputFile(\"autogenerated\");\n    GeneratedFileFilter filter = createFilter(inputFile, defaultConfiguration);\n\n    // Act\n    Boolean result = filter.accept(inputFile);\n\n    // Assert\n    assertThat(result).isFalse();\n    assertThat(logs.logs(Level.DEBUG)).contains(\"Will ignore generated code\");\n    assertThat(logs.logs(Level.DEBUG)).contains(\"Skipping auto generated file: autogenerated\");\n  }\n\n  @Test\n  public void accept_returns_true_for_nonautogenerated_files() {\n    // Arrange\n    GeneratedFileFilter filter = createFilter(mockInputFile(\"c:\\\\autogenerated\"), defaultConfiguration);\n\n    // Act\n    Boolean result = filter.accept(mockInputFile(\"File1\"));\n\n    // Assert\n    assertThat(result).isTrue();\n    assertThat(logs.logs(Level.DEBUG)).contains(\"Will ignore generated code\");\n  }\n\n  @Test\n  public void accept_returns_true_for_autogenerated_files_when_analyzeGeneratedCode_setting_true() {\n    // Arrange\n    AbstractLanguageConfiguration mockConfiguration = mock(AbstractLanguageConfiguration.class);\n    when(mockConfiguration.analyzeGeneratedCode()).thenReturn(true);\n    InputFile inputFile = mockInputFile(\"autogenerated\");\n    GeneratedFileFilter filter = createFilter(inputFile, mockConfiguration);\n\n    // Act\n    Boolean result = filter.accept(inputFile);\n\n    // Assert\n    assertThat(result).isTrue();\n    assertThat(logs.logs(Level.DEBUG)).contains(\"Will analyze generated code\");\n  }\n\n  private InputFile mockInputFile(String path) {\n    InputFile file = mock(InputFile.class);\n    when(file.uri()).thenReturn(Paths.get(path).toUri());\n    when(file.toString()).thenReturn(path);\n    return file;\n  }\n\n  private GeneratedFileFilter createFilter(InputFile generatedInputFile, AbstractLanguageConfiguration configuration) {\n    GlobalProtobufFileProcessor processor = mock(GlobalProtobufFileProcessor.class);\n    when(processor.isGenerated(generatedInputFile)).thenReturn(true);\n    return new GeneratedFileFilter(processor, configuration);\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/GlobalProtobufFileProcessorTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.io.OutputStream;\nimport java.nio.charset.Charset;\nimport java.nio.charset.StandardCharsets;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.nio.file.StandardOpenOption;\nimport java.util.Map;\nimport javax.annotation.Nullable;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.TemporaryFolder;\nimport org.slf4j.event.Level;\nimport org.sonar.api.batch.bootstrap.ProjectBuilder;\nimport org.sonar.api.batch.bootstrap.ProjectBuilder.Context;\nimport org.sonar.api.batch.bootstrap.ProjectDefinition;\nimport org.sonar.api.batch.bootstrap.ProjectReactor;\nimport org.sonar.api.batch.fs.InputFile;\nimport org.sonar.api.config.Configuration;\nimport org.sonar.api.testfixtures.log.LogTester;\nimport org.sonarsource.dotnet.protobuf.SonarAnalyzer.FileMetadataInfo;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.api.Assertions.entry;\nimport static org.assertj.core.api.Assertions.fail;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\npublic class GlobalProtobufFileProcessorTest {\n\n  @Rule\n  public TemporaryFolder temp = new TemporaryFolder();\n\n  @Rule\n  public LogTester logs = new LogTester();\n\n  private Context context;\n  private GlobalProtobufFileProcessor underTest;\n\n  private ProjectDefinition project1;\n  private ProjectDefinition project2;\n\n  @Before\n  public void prepare() {\n    ProjectDefinition rootProject = ProjectDefinition.create();\n    project1 = ProjectDefinition.create();\n    project2 = ProjectDefinition.create();\n    rootProject.addSubProject(project1);\n    rootProject.addSubProject(project2);\n    context = new ProjectBuilder.Context() {\n      @Override\n      public ProjectReactor projectReactor() {\n        return new ProjectReactor(rootProject);\n      }\n\n      @Override\n      public Configuration config() {\n        return null;\n      }\n    };\n    PluginMetadata metadata = mock(PluginMetadata.class);\n    when(metadata.languageKey()).thenReturn(\"foo\");\n    underTest = new GlobalProtobufFileProcessor(metadata);\n  }\n\n  @Test\n  public void do_nothing_if_no_properties() {\n    underTest.build(context);\n    assertThat(underTest.getRoslynEncodingPerUri()).isEmpty();\n  }\n\n  @Test\n  public void process_generated() throws IOException {\n    project1.setProperty(\"sonar.foo.analyzer.projectOutPaths\", mockGenerated(\"generated11\") + \",\" + mockGenerated(\"generated12\"));\n    project2.setProperty(\"sonar.foo.analyzer.projectOutPaths\", mockGenerated(\"generated2\"));\n\n    underTest.build(context);\n    assertThat(underTest.isGenerated(mockInputFile(\"generated11\"))).isTrue();\n    assertThat(underTest.isGenerated(mockInputFile(\"generated12\"))).isTrue();\n    assertThat(underTest.isGenerated(mockInputFile(\"generated2\"))).isTrue();\n    assertThat(underTest.isGenerated(mockInputFile(\"generated3\"))).isFalse();\n    Map.Entry<String, Charset> expected = entry(toUriString(\"generated2\"), null);\n    assertThat(underTest.getRoslynEncodingPerUri()).contains(expected);\n  }\n\n  @Test\n  public void process_generated_escaped_csv() throws IOException {\n    project1.setProperty(\"sonar.foo.analyzer.projectOutPaths\",\n      \"\\\"\" + mockGenerated(\"generated11\") + \"\\\",\\\"\" + mockGenerated(\"generated12\") + \"\\\"\");\n    project2.setProperty(\"sonar.foo.analyzer.projectOutPaths\", mockGenerated(\"generated2\"));\n\n    underTest.build(context);\n    assertThat(underTest.isGenerated(mockInputFile(\"generated11\"))).isTrue();\n    assertThat(underTest.isGenerated(mockInputFile(\"generated12\"))).isTrue();\n    assertThat(underTest.isGenerated(mockInputFile(\"generated2\"))).isTrue();\n    assertThat(underTest.isGenerated(mockInputFile(\"generated3\"))).isFalse();\n    Map.Entry<String, Charset> expected = entry(toUriString(\"generated2\"), null);\n    assertThat(underTest.getRoslynEncodingPerUri()).contains(expected);\n  }\n\n  @Test\n  public void process_generated_is_not_case_sensitive() throws IOException {\n    project1.setProperty(\"sonar.foo.analyzer.projectOutPaths\", mockGenerated(\"generated\"));\n    project2.setProperty(\"sonar.foo.analyzer.projectOutPaths\", mockGenerated(\"GENERATED\"));\n\n    underTest.build(context);\n    assertThat(underTest.getRoslynEncodingPerUri()).hasSize(1);\n    assertThat(underTest.isGenerated(mockInputFile(\"GeNeRaTeD\"))).isTrue();\n  }\n\n  @Test\n  public void process_encoding() throws IOException {\n    project2.setProperty(\"sonar.foo.analyzer.projectOutPaths\", mockEncoding(\"UTF-8\", \"encodingutf8\"));\n\n    underTest.build(context);\n    assertThat(underTest.getRoslynEncodingPerUri()).containsOnly(entry(toUriString(\"encodingutf8\"), StandardCharsets.UTF_8));\n    assertThat(underTest.isGenerated(mockInputFile(\"encodingutf8\"))).isFalse();\n  }\n\n  @Test\n  public void is_not_case_sensitive() throws IOException {\n    project2.setProperty(\"sonar.foo.analyzer.projectOutPaths\", mockGenerated(\"UPPER/lower/MiXeD\"));\n\n    underTest.build(context);\n    assertThat(underTest.getRoslynEncodingPerUri())\n      .hasSize(1)\n      .containsKey(toUriString(\"UPPER/lower/MiXeD\"))\n      .containsKey(toUriString(\"UPPER/LOWER/MIXED\"))\n      .containsKey(toUriString(\"upper/lower/mixed\"))\n      .containsKey(toUriString(\"upper/LOWER/mIxEd\"));\n\n    assertThat(underTest.isGenerated(mockInputFile(\"UPPER/lower/MiXeD\"))).isTrue();\n    assertThat(underTest.isGenerated(mockInputFile(\"UPPER/LOWER/MIXED\"))).isTrue();\n    assertThat(underTest.isGenerated(mockInputFile(\"upper/lower/mixed\"))).isTrue();\n    assertThat(underTest.isGenerated(mockInputFile(\"upper/LOWER/mIxEd\"))).isTrue();\n  }\n\n  @Test\n  public void warn_about_casing_colission() throws IOException {\n    project1.setProperty(\"sonar.foo.analyzer.projectOutPaths\", mockEncoding(\"UTF-8\", \"collision\") + \",\" + mockEncoding(\"UTF-16\", \"COLLISION\"));\n    project2.setProperty(\"sonar.foo.analyzer.projectOutPaths\", mockEncoding(\"ASCII\", \"CoLLiSioN\"));\n\n    underTest.build(context);\n    assertThat(underTest.getRoslynEncodingPerUri()).hasSize(1).containsKey(toUriString(\"collision\"));\n    assertThat(logs.logs(Level.WARN)).contains(\n      String.format(\"Different encodings UTF-8 vs. UTF-16 were detected for single file %s. Case-Sensitive paths are not supported.\", toUriString(\"COLLISION\")));\n    assertThat(logs.logs(Level.WARN)).contains(\n      String.format(\"Different encodings UTF-8 vs. US-ASCII were detected for single file %s. Case-Sensitive paths are not supported.\", toUriString(\"CoLLiSioN\")));\n  }\n\n  @Test\n  public void do_not_warn_about_casing_colission_for_same_encoding() throws IOException {\n    project1.setProperty(\"sonar.foo.analyzer.projectOutPaths\", mockEncoding(\"UTF-8\", \"collision\") + \",\" + mockEncoding(\"UTF-8\", \"COLLISION\"));\n\n    underTest.build(context);\n    assertThat(underTest.getRoslynEncodingPerUri()).hasSize(1).containsKey(toUriString(\"collision\"));\n    assertThat(logs.logs(Level.WARN).stream().filter(x -> x.contains(\"COLLISION\"))).isEmpty();\n  }\n\n  @Test\n  public void process_encoding_preserve_null_values() throws IOException {\n    project2.setProperty(\"sonar.foo.analyzer.projectOutPaths\", mockEncoding(null, \"encodingnull\").toString());\n\n    underTest.build(context);\n    assertThat(underTest.getRoslynEncodingPerUri()).containsOnly(entry(toUriString(\"encodingnull\"), null));\n    assertThat(underTest.isGenerated(mockInputFile(\"encodingnull\"))).isFalse();\n  }\n\n  @Test\n  public void ignore_missing_files() throws IOException {\n    project1.setProperty(\"sonar.foo.analyzer.projectOutPaths\", \"notExisiting.pb\");\n    project2.setProperty(\"sonar.foo.analyzer.projectOutPaths\", mockGenerated(\"generated2\"));\n\n    underTest.build(context);\n    assertThat(underTest.isGenerated(mockInputFile(\"generated2\"))).isTrue();\n    assertThat(underTest.isGenerated(mockInputFile(\"generated3\"))).isFalse();\n    Map.Entry<String, Charset> expected = entry(toUriString(\"generated2\"), null);\n    assertThat(underTest.getRoslynEncodingPerUri()).containsExactly(expected);\n  }\n\n  private String mockGenerated(String path) throws IOException {\n    File reportPath = temp.newFolder();\n    Path analyzerPath = reportPath.toPath().resolve(\"output-foo\");\n    Files.createDirectories(analyzerPath);\n    try (OutputStream fos = Files.newOutputStream(analyzerPath.resolve(\"file-metadata.pb\"), StandardOpenOption.CREATE)) {\n      try {\n        FileMetadataInfo.newBuilder().setFilePath(path).setIsGenerated(true).build().writeDelimitedTo(fos);\n      } catch (IOException e) {\n        fail(e.getMessage(), e);\n      }\n    }\n    return reportPath.toString();\n  }\n\n  private String mockEncoding(@Nullable String encoding, String path) throws IOException {\n    File reportPath = temp.newFolder();\n    Path analyzerPath = reportPath.toPath().resolve(\"output-foo\");\n    Files.createDirectories(analyzerPath);\n    try (OutputStream fos = Files.newOutputStream(analyzerPath.resolve(\"file-metadata.pb\"), StandardOpenOption.CREATE)) {\n      try {\n        FileMetadataInfo.Builder builder = FileMetadataInfo.newBuilder().setFilePath(path);\n        if (encoding != null) {\n          builder.setEncoding(encoding);\n        }\n        builder.build().writeDelimitedTo(fos);\n      } catch (IOException e) {\n        fail(e.getMessage(), e);\n      }\n    }\n    return reportPath.toString();\n  }\n\n  private String toUriString(String path) {\n    return Paths.get(path).toUri().toString();\n  }\n\n  private InputFile mockInputFile(String path) {\n    InputFile inputFile = mock(InputFile.class);\n    when(inputFile.uri()).thenReturn(Paths.get(path).toUri());\n    return inputFile;\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/HashProviderTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport org.junit.Test;\n\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.nio.file.Path;\nimport java.security.NoSuchAlgorithmException;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\npublic class HashProviderTest {\n  private static final byte[] HEX_ARRAY = \"0123456789abcdef\".getBytes(StandardCharsets.US_ASCII);\n\n  @Test\n  public void computeHash() throws NoSuchAlgorithmException, IOException {\n    HashProvider sut = new HashProvider();\n\n    assertThat(computeHash(sut, \"src/test/resources/HashProvider/EmptyWithBom.cs\")).isEqualTo(\"f1945cd6c19e56b3c1c78943ef5ec18116907a4ca1efc40a57d48ab1db7adfc5\");\n    assertThat(computeHash(sut, \"src/test/resources/HashProvider/EmptyNoBom.cs\")).isEqualTo(\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\");\n    assertThat(computeHash(sut, \"src/test/resources/HashProvider/CodeWithBom.cs\")).isEqualTo(\"b98aaf2ce5a3f9cdf8ab785563951f2309d577baa6351098f78908300fdc610a\");\n    assertThat(computeHash(sut, \"src/test/resources/HashProvider/CodeNoBom.cs\")).isEqualTo(\"8c7535a8e3679bf8cc241b5749cef5fc38243401556f2b7869495c7b48ee4980\");\n    assertThat(computeHash(sut, \"src/test/resources/HashProvider/Utf8.cs\")).isEqualTo(\"13aa54e315a806270810f3a91501f980a095a2ef1bcc53167d4c750a1b78684d\");\n    assertThat(computeHash(sut, \"src/test/resources/HashProvider/Utf16.cs\")).isEqualTo(\"a9b3c4402770855d090ba4b49adeb5ad601cb3bbd6de18495302f45f242ef932\");\n    assertThat(computeHash(sut, \"src/test/resources/HashProvider/Ansi.cs\")).isEqualTo(\"b965073262109da4f106cd90a5eeea025e2441c244af272537afa2cfb03c3ab8\");\n  }\n\n  private static String computeHash(HashProvider sut, String fileName) throws NoSuchAlgorithmException, IOException {\n    return bytesToHex(sut.computeHash(Path.of(fileName)));\n  }\n\n  private static String bytesToHex(byte[] bytes) {\n    byte[] hexChars = new byte[bytes.length * 2];\n    for (int i = 0; i < bytes.length; i++) {\n      int v = bytes[i] & 0xFF; // take care of negative numbers\n      hexChars[i * 2] = HEX_ARRAY[v >>> 4];\n      hexChars[i * 2 + 1] = HEX_ARRAY[v & 0x0F];\n    }\n    return new String(hexChars, StandardCharsets.UTF_8);\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/MethodDeclarationsSensorTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport java.nio.file.Path;\nimport java.util.List;\n\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.TemporaryFolder;\nimport org.slf4j.event.Level;\nimport org.sonar.api.batch.sensor.internal.DefaultSensorDescriptor;\nimport org.sonar.api.batch.sensor.internal.SensorContextTester;\nimport org.sonar.api.testfixtures.log.LogTester;\nimport org.sonarsource.dotnet.shared.plugins.sensors.MethodDeclarationsSensor;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\npublic class MethodDeclarationsSensorTest {\n  private static final String LANG_NAME = \"LANG_NAME\";\n  private static final Path TEST_DATA_DIR = Path.of(\"src/test/resources/MethodDeclarationsSensorTest/protobuf-files\");\n\n  @Rule\n  public TemporaryFolder temp = new TemporaryFolder();\n  @Rule\n  public LogTester logTester = new LogTester();\n\n  private MethodDeclarationsCollector collector;\n  private SensorContextTester context;\n  private MethodDeclarationsSensor sensor;\n\n  @Before\n  public void prepare() {\n    logTester.setLevel(Level.DEBUG);\n    context = SensorContextTester.create(temp.getRoot());\n    PluginMetadata metadata = mock(PluginMetadata.class);\n    when(metadata.languageName()).thenReturn(LANG_NAME);\n    ModuleConfiguration configuration = mock(ModuleConfiguration.class);\n    when(configuration.protobufReportPaths()).thenReturn(List.of(TEST_DATA_DIR));\n    collector = new MethodDeclarationsCollector();\n    sensor = new MethodDeclarationsSensor(collector, metadata, configuration);\n  }\n\n  @Test\n  public void should_describe() {\n    DefaultSensorDescriptor sensorDescriptor = new DefaultSensorDescriptor();\n    sensor.describe(sensorDescriptor);\n    assertThat(sensorDescriptor.name()).isEqualTo(LANG_NAME + \" Method Declarations\");\n  }\n\n  @Test\n  public void executeMethodDeclarationSensor() {\n    sensor.execute(context);\n    assertThat(collector.getMethodDeclarations()).satisfiesExactlyInAnyOrder(\n      m -> {\n        assertThat(m.getFilePath()).endsWith(\"MethodDeclarationsSensorTest\\\\TestMethodImport\\\\TestMethodImport.Tests\\\\TestBase.cs\");\n        assertThat(m.getAssemblyName()).isEqualTo(\"TestMethodImport.Tests\");\n        assertThat(m.getMethodDeclarationsCount()).isEqualTo(1);\n        assertThat(m.getMethodDeclarations(0).getTypeName()).isEqualTo(\"TestMethodImport.Tests.TestBase\");\n        assertThat(m.getMethodDeclarations(0).getMethodName()).isEqualTo(\"TestMethodInBaseClass\");\n      },\n      m -> {\n        assertThat(m.getFilePath()).endsWith(\"MethodDeclarationsSensorTest\\\\TestMethodImport\\\\TestMethodImport.Tests\\\\TestClass.cs\");\n        assertThat(m.getAssemblyName()).isEqualTo(\"TestMethodImport.Tests\");\n        assertThat(m.getMethodDeclarationsCount()).isEqualTo(2);\n        assertThat(m.getMethodDeclarations(0).getTypeName()).isEqualTo(\"TestMethodImport.Tests.TestClass\");\n        assertThat(m.getMethodDeclarations(0).getMethodName()).isEqualTo(\"TestMethod\");\n        assertThat(m.getMethodDeclarations(1).getTypeName()).isEqualTo(\"TestMethodImport.Tests.TestClass\");\n        assertThat(m.getMethodDeclarations(1).getMethodName()).isEqualTo(\"TestMethodInBaseClass\");\n      }\n    );\n    assertThat(logTester.logs()).containsExactly(\"Start importing method declarations.\");\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/ModuleConfigurationTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport java.io.IOException;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.util.Arrays;\nimport java.util.Optional;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.TemporaryFolder;\nimport org.slf4j.event.Level;\nimport org.sonar.api.config.Configuration;\nimport org.sonar.api.internal.apachecommons.lang3.function.Failable;\nimport org.sonar.api.testfixtures.log.LogTester;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\npublic class ModuleConfigurationTest {\n  @Rule\n  public TemporaryFolder temp = new TemporaryFolder();\n  @Rule\n  public LogTester logTester = new LogTester();\n\n  private Path workDir;\n\n  @Before\n  public void setUp() {\n    logTester.setLevel(Level.TRACE);\n    workDir = temp.getRoot().toPath();\n  }\n\n  @Test\n  public void traceObjectCreation() {\n    Configuration configuration = createEmptyMockConfiguration();\n    createModuleConfiguration(configuration);\n    assertThat(logTester.logs(Level.TRACE)).containsOnly(\"Project 'Test Project': AbstractModuleConfiguration has been created.\");\n  }\n\n  @Test\n  public void onlyNewRoslynReportPresent() throws IOException {\n    Path path = temp.newFile(\"roslyn-report.json\").toPath();\n    Path path2 = temp.newFile(\"roslyn-report2.json\").toPath();\n\n    Configuration configuration = createEmptyMockConfiguration();\n    when(configuration.getStringArray(\"sonar.cs.roslyn.reportFilePaths\")).thenReturn(new String[]{path.toString(), path2.toString()});\n\n    ModuleConfiguration config = createModuleConfiguration(configuration);\n    assertThat(config.protobufReportPaths()).isEmpty();\n    assertThat(config.roslynReportPaths()).containsOnly(workDir.resolve(\"roslyn-report.json\"), workDir.resolve(\"roslyn-report2.json\"));\n    assertThat(logTester.logs(Level.DEBUG)).containsExactly(\n      \"Project 'Test Project': Property missing: 'sonar.cs.analyzer.projectOutPaths'. No protobuf files will be loaded for this project.\",\n      \"Project 'Test Project': The Roslyn JSON report path has '\"\n        + workDir.toString() + \"\\\\roslyn-report.json,\"\n        + workDir.toString() + \"\\\\roslyn-report2.json'\");\n  }\n\n  @Test\n  public void giveWarningsWhenGettingProtobufPathAndNoPropertyAvailable() {\n    Configuration configuration = mock(Configuration.class);\n\n    when(configuration.getStringArray(\"sonar.cs.analyzer.projectOutPaths\")).thenReturn(new String[0]);\n    when(configuration.getStringArray(\"sonar.cs.roslyn.reportFilePaths\")).thenReturn(new String[0]);\n    // no projectKey is set\n\n    ModuleConfiguration config = createModuleConfiguration(configuration);\n    assertThat(config.protobufReportPaths()).isEmpty();\n    assertThat(logTester.logs(Level.DEBUG)).containsOnly(\n      \"Project '<NONE>': Property missing: 'sonar.cs.analyzer.projectOutPaths'. No protobuf files will be loaded for this project.\");\n  }\n\n  @Test\n  public void noWarningsWhenGettingProtobufPathAndNoPropertyAvailable_TestProject() {\n    // Test projects have sonar.tests property set, main projects don't\n    Configuration configuration = createEmptyMockConfiguration();\n    when(configuration.hasKey(\"sonar.tests\")).thenReturn(true);\n\n    ModuleConfiguration config = createModuleConfiguration(configuration);\n    assertThat(config.protobufReportPaths()).isEmpty();\n    assertThat(logTester.logs(Level.WARN)).isEmpty();\n    assertThat(logTester.logs(Level.DEBUG)).isEmpty();\n  }\n\n  @Test\n  public void giveWarningsWhenGettingProtobufPathAndNoFolderAvailable() throws IOException {\n    Path path1 = createProtobufOut(\"report\");\n\n    Configuration configuration = createEmptyMockConfiguration();\n    when(configuration.getStringArray(\"sonar.cs.analyzer.projectOutPaths\")).thenReturn(new String[]{path1.toString(), \"non-existing\"});\n\n    ModuleConfiguration config = createModuleConfiguration(configuration);\n    assertThat(config.protobufReportPaths()).containsOnly(path1.resolve(\"output-cs\"));\n    assertThat(logTester.logs(Level.DEBUG))\n      .containsExactly(\n        \"Project 'Test Project': Analyzer working directory '\" + workDir.toString() + \"\\\\report\\\\output-cs' contains 1 .pb file(s)\",\n        \"Project 'Test Project': Analyzer working directory does not exist: 'non-existing\\\\output-cs'. Analyzer results won't be loaded from this directory.\");\n  }\n\n  @Test\n  public void giveWarningsWhenGettingOldProtobufPathAndNoFolderAvailable() {\n    Configuration configuration = createEmptyMockConfiguration();\n    when(configuration.get(\"sonar.cs.analyzer.projectOutPath\")).thenReturn(Optional.of(\"non-existing\"));\n\n    ModuleConfiguration config = createModuleConfiguration(configuration);\n    assertThat(config.protobufReportPaths()).isEmpty();\n    assertThat(logTester.logs(Level.DEBUG)).containsOnly(\n      \"Project 'Test Project': Property missing: 'sonar.cs.analyzer.projectOutPaths'. No protobuf files will be loaded for this project.\"\n    );\n  }\n\n  @Test\n  public void whenProtobufReportsArePresent_informHowManyProtoFilesAreFound() throws IOException {\n    Configuration configuration = createEmptyMockConfiguration();\n    mockProtobufOutPaths(configuration);\n\n    ModuleConfiguration config = createModuleConfiguration(configuration);\n    assertThat(config.protobufReportPaths()).isNotEmpty();\n    assertThat(logTester.logs(Level.DEBUG))\n      .containsExactly(\n        \"Project 'Test Project': Analyzer working directory '\" + workDir.toString() + \"\\\\report1\\\\output-cs' contains 1 .pb file(s)\",\n        \"Project 'Test Project': Analyzer working directory '\" + workDir.toString() + \"\\\\report2\\\\output-cs' contains 1 .pb file(s)\");\n    assertThat(logTester.logs(Level.WARN)).isEmpty();\n  }\n\n  @Test\n  public void whenProtobufReportsArePresent_protobufReportPathsContainsCorrectElements() throws IOException {\n    Configuration configuration = createEmptyMockConfiguration();\n    mockProtobufOutPaths(configuration);\n\n    ModuleConfiguration config = createModuleConfiguration(configuration);\n    assertThat(config.roslynReportPaths()).isEmpty();\n    assertThat(config.protobufReportPaths()).containsOnly(\n      workDir.resolve(\"report1\").resolve(\"output-cs\"),\n      workDir.resolve(\"report2\").resolve(\"output-cs\"));\n    assertThat(logTester.logs(Level.DEBUG))\n      .hasSize(3)\n      .contains(\n        // roslynReportPaths\n        \"Project 'Test Project': No Roslyn issues reports have been found.\",\n        // protobufReportPaths\n        \"Project 'Test Project': Analyzer working directory '\" + workDir.toString() + \"\\\\report1\\\\output-cs' contains 1 .pb file(s)\",\n        \"Project 'Test Project': Analyzer working directory '\" + workDir.toString() + \"\\\\report2\\\\output-cs' contains 1 .pb file(s)\"\n      );\n  }\n\n  @Test\n  public void giveWarningsWhenGettingProtobufPathAndFolderIsEmpty() throws IOException {\n    Path path = workDir.resolve(\"report\");\n    Path outputCs = path.resolve(\"output-cs\");\n    Files.createDirectories(outputCs);\n\n    Configuration configuration = createEmptyMockConfiguration();\n    when(configuration.getStringArray(\"sonar.cs.analyzer.projectOutPaths\")).thenReturn(new String[]{path.toString()});\n\n    ModuleConfiguration config = createModuleConfiguration(configuration);\n    assertThat(config.protobufReportPaths()).isEmpty();\n    assertThat(logTester.logs(Level.DEBUG).get(0)).matches(s -> s.endsWith(\"contains no .pb file(s). Analyzer results won't be loaded from this directory.\"));\n  }\n\n  @Test\n  public void reads_correct_language() {\n    Configuration configuration = mock(Configuration.class);\n    when(configuration.getStringArray(\"sonar.cs.roslyn.reportFilePaths\")).thenReturn(new String[]{\"C#\"});\n    when(configuration.getStringArray(\"sonar.vbnet.roslyn.reportFilePaths\")).thenReturn(new String[]{\"VB.NET\"});\n    ModuleConfiguration config = createModuleConfiguration(configuration);\n\n    assertThat(config.roslynReportPaths()).containsExactly(Paths.get(\"C#\"));\n  }\n\n  @Test\n  public void telemetryJsonPathsAreFound() {\n    Configuration configuration = createEmptyMockConfiguration();\n    var expectedPaths = new Path[]{workDir.resolve(\"0\").resolve(ModuleConfiguration.TELEMETRY_JSON), workDir.resolve(\"1\").resolve(ModuleConfiguration.TELEMETRY_JSON)};\n    Arrays.stream(expectedPaths).forEach(Failable.asConsumer(x -> {\n      Files.createDirectory(x.getParent());\n      Files.createFile(x);\n    }));\n\n    when(configuration.getStringArray(\"sonar.cs.scanner.telemetry\")).thenReturn(Arrays.stream(expectedPaths).map(Path::toString).toArray(String[]::new));\n\n    ModuleConfiguration config = createModuleConfiguration(configuration);\n    assertThat(config.telemetryJsonPaths()).containsExactly(expectedPaths);\n  }\n\n  @Test\n  public void contextPaths() {\n    Configuration configuration = createEmptyMockConfiguration();\n    when(configuration.getStringArray(\"sonar.cs.analyzer.projectOutPaths\"))\n      .thenReturn(new String[]{workDir.resolve(\"report1\").toString(), workDir.resolve(\"report2\").toString()});\n    ModuleConfiguration config = createModuleConfiguration(configuration);\n\n    assertThat(config.contextPaths()).containsExactly(\n      workDir.resolve(\"report1\").resolve(\"output-cs\").resolve(\"Context\"),\n      workDir.resolve(\"report2\").resolve(\"output-cs\").resolve(\"Context\"));\n  }\n\n  private Path createProtobufOut(String name) throws IOException {\n    Path path = workDir.resolve(name);\n    Path outputCs = path.resolve(\"output-cs\");\n    Files.createDirectories(outputCs);\n    Files.createFile(outputCs.resolve(\"dummy.pb\"));\n    return path;\n  }\n\n  private void mockProtobufOutPaths(Configuration configuration) throws IOException {\n    Path path1 = createProtobufOut(\"report1\");\n    Path path2 = createProtobufOut(\"report2\");\n    when(configuration.getStringArray(\"sonar.cs.analyzer.projectOutPaths\")).thenReturn(new String[]{path1.toString(), path2.toString()});\n  }\n\n  private Configuration createEmptyMockConfiguration() {\n    Configuration configuration = mock(Configuration.class);\n\n    when(configuration.getStringArray(\"sonar.cs.analyzer.projectOutPaths\")).thenReturn(new String[0]);\n    when(configuration.getStringArray(\"sonar.cs.roslyn.reportFilePaths\")).thenReturn(new String[0]);\n    when(configuration.get(\"sonar.projectKey\")).thenReturn(Optional.of(\"Test Project\"));\n\n    return configuration;\n  }\n\n  private ModuleConfiguration createModuleConfiguration(Configuration configuration) {\n    PluginMetadata metadata = mock(PluginMetadata.class);\n    when(metadata.languageKey()).thenReturn(\"cs\");\n    return new ModuleConfiguration(configuration, metadata);\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/ProjectTypeCollectorTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport org.junit.Test;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\n// These tests use \"SUT\" (System Under Test) to name the object being tested.\npublic class ProjectTypeCollectorTest {\n  private static final String LANG_NAME = \"LANG\";\n\n  @Test\n  public void withNoProjects() {\n    ProjectTypeCollector sut = new ProjectTypeCollector();\n    assertThat(sut.getSummary(LANG_NAME)).isEmpty();\n    assertThat(sut.hasProjects()).isFalse();\n  }\n\n  @Test\n  public void withNoFiles() {\n    ProjectTypeCollector sut = new ProjectTypeCollector();\n\n    addProjectWithNoFiles(sut);\n\n    assertThat(sut.getSummary(LANG_NAME)).hasValue(\"Found 1 MSBuild LANG project: 1 with no MAIN nor TEST files.\");\n    assertThat(sut.hasProjects()).isTrue();\n  }\n\n  @Test\n  public void withOnlyMainFiles() {\n    ProjectTypeCollector sut = new ProjectTypeCollector();\n\n    addMainProject(sut);\n\n    assertThat(sut.getSummary(LANG_NAME)).hasValue(\"Found 1 MSBuild LANG project: 1 MAIN project.\");\n    assertThat(sut.hasProjects()).isTrue();\n  }\n\n  @Test\n  public void withOnlyTestFile() {\n    ProjectTypeCollector sut = new ProjectTypeCollector();\n\n    addTestProject(sut);\n    addTestProject(sut);\n    addTestProject(sut);\n\n    assertThat(sut.getSummary(LANG_NAME)).hasValue(\"Found 3 MSBuild LANG projects: 3 TEST projects.\");\n    assertThat(sut.hasProjects()).isTrue();\n  }\n\n  @Test\n  public void withBothTypes() {\n    ProjectTypeCollector sut = new ProjectTypeCollector();\n\n    addProjectWithBothTypes(sut);\n\n    assertThat(sut.getSummary(LANG_NAME)).hasValue(\"Found 1 MSBuild LANG project: 1 with both MAIN and TEST files.\");\n    assertThat(sut.hasProjects()).isTrue();\n  }\n\n  @Test\n  public void mixedProjects_test_and_main() {\n    ProjectTypeCollector sut = new ProjectTypeCollector();\n\n    addTestProject(sut);\n    addMainProject(sut);\n    addTestProject(sut);\n\n    assertThat(sut.getSummary(LANG_NAME)).hasValue(\"Found 3 MSBuild LANG projects: 1 MAIN project. 2 TEST projects.\");\n    assertThat(sut.hasProjects()).isTrue();\n  }\n\n  @Test\n  public void mixedProjects_test_and_both() {\n    ProjectTypeCollector sut = new ProjectTypeCollector();\n\n    addTestProject(sut);\n    addProjectWithBothTypes(sut);\n    addTestProject(sut);\n\n    assertThat(sut.getSummary(LANG_NAME)).hasValue(\"Found 3 MSBuild LANG projects: 2 TEST projects. 1 with both MAIN and TEST files.\");\n    assertThat(sut.hasProjects()).isTrue();\n  }\n\n  @Test\n  public void mixedProjects_main_and_both() {\n    ProjectTypeCollector sut = new ProjectTypeCollector();\n\n    addMainProject(sut);\n    addProjectWithBothTypes(sut);\n    addMainProject(sut);\n\n    assertThat(sut.getSummary(LANG_NAME)).hasValue(\"Found 3 MSBuild LANG projects: 2 MAIN projects. 1 with both MAIN and TEST files.\");\n    assertThat(sut.hasProjects()).isTrue();\n  }\n\n  @Test\n  public void mixedProjects_test_none() {\n    ProjectTypeCollector sut = new ProjectTypeCollector();\n\n    addTestProject(sut);\n    addTestProject(sut);\n    addProjectWithNoFiles(sut);\n\n    assertThat(sut.getSummary(LANG_NAME)).hasValue(\"Found 3 MSBuild LANG projects: 2 TEST projects. 1 with no MAIN nor TEST files.\");\n    assertThat(sut.hasProjects()).isTrue();\n  }\n\n  @Test\n  public void mixedProjects_main_none() {\n    ProjectTypeCollector sut = new ProjectTypeCollector();\n\n    addProjectWithNoFiles(sut);\n    addMainProject(sut);\n    addMainProject(sut);\n    addMainProject(sut);\n\n    assertThat(sut.getSummary(LANG_NAME)).hasValue(\"Found 4 MSBuild LANG projects: 3 MAIN projects. 1 with no MAIN nor TEST files.\");\n    assertThat(sut.hasProjects()).isTrue();\n  }\n\n  @Test\n  public void mixedProjects_all_types() {\n    ProjectTypeCollector sut = new ProjectTypeCollector();\n\n    addTestProject(sut);\n    addMainProject(sut);\n    addProjectWithBothTypes(sut);\n\n    assertThat(sut.getSummary(LANG_NAME)).hasValue(\"Found 3 MSBuild LANG projects: 1 MAIN project. 1 TEST project. 1 with both MAIN and TEST files.\");\n    assertThat(sut.hasProjects()).isTrue();\n  }\n\n  @Test\n  public void mixedProjects_all_types_null_or_empty_language_name() {\n    ProjectTypeCollector sut = new ProjectTypeCollector();\n\n    addTestProject(sut);\n    addMainProject(sut);\n    addProjectWithBothTypes(sut);\n\n    // this should not happen in real life, but we want to make sure we don't fail hard\n    assertThat(sut.getSummary(null)).hasValue(\"Found 3 MSBuild null projects: 1 MAIN project. 1 TEST project. 1 with both MAIN and TEST files.\");\n    assertThat(sut.getSummary(\"\")).hasValue(\"Found 3 MSBuild  projects: 1 MAIN project. 1 TEST project. 1 with both MAIN and TEST files.\");\n    assertThat(sut.hasProjects()).isTrue();\n  }\n\n  private void addProjectWithNoFiles(ProjectTypeCollector projectTypeCollector) {\n    projectTypeCollector.addProjectInfo(false, false);\n  }\n\n  private void addTestProject(ProjectTypeCollector projectTypeCollector) {\n    projectTypeCollector.addProjectInfo(false, true);\n  }\n\n  private void addMainProject(ProjectTypeCollector projectTypeCollector) {\n    projectTypeCollector.addProjectInfo(true, false);\n  }\n\n  private void addProjectWithBothTypes(ProjectTypeCollector projectTypeCollector) {\n    projectTypeCollector.addProjectInfo(true, true);\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/ProtobufDataImporterTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport java.io.File;\nimport java.io.OutputStream;\nimport java.nio.charset.StandardCharsets;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.util.Collections;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.TemporaryFolder;\nimport org.sonar.api.batch.fs.InputFile;\nimport org.sonar.api.batch.fs.internal.TestInputFileBuilder;\nimport org.sonar.api.batch.sensor.internal.SensorContextTester;\nimport org.sonar.api.issue.NoSonarFilter;\nimport org.sonar.api.measures.CoreMetrics;\nimport org.sonar.api.measures.FileLinesContext;\nimport org.sonar.api.measures.FileLinesContextFactory;\nimport org.sonar.api.testfixtures.log.LogTester;\nimport org.slf4j.event.Level;\nimport org.sonarsource.dotnet.protobuf.SonarAnalyzer.MetricsInfo;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\npublic class ProtobufDataImporterTest {\n  @Rule\n  public LogTester logTester = new LogTester();\n  @Rule\n  public TemporaryFolder temp = new TemporaryFolder();\n\n  private FileLinesContextFactory fileLinesContextFactory = mock(FileLinesContextFactory.class);\n  private NoSonarFilter noSonarFilter = mock(NoSonarFilter.class);\n  private FileLinesContext fileLinesContext = mock(FileLinesContext.class);\n\n  private SensorContextTester tester;\n  private ProtobufDataImporter dataImporter = new ProtobufDataImporter(fileLinesContextFactory, noSonarFilter);\n  private Path workDir;\n  private InputFile firstFile;\n  private InputFile secondFile;\n\n  @Before\n  public void prepare() throws Exception {\n    logTester.setLevel(Level.DEBUG);\n    workDir = temp.newFolder().toPath();\n    Path csFile = Paths.get(\"src/test/resources/Program.cs\").toAbsolutePath();\n\n    tester = SensorContextTester.create(new File(\"src/test/resources\"));\n    tester.fileSystem().setWorkDir(workDir);\n\n    firstFile = new TestInputFileBuilder(tester.module().key(), \"Program.cs\")\n      .setLanguage(\"cs\")\n      .initMetadata(new String(Files.readAllBytes(csFile), StandardCharsets.UTF_8))\n      .build();\n    tester.fileSystem().add(firstFile);\n\n    secondFile = new TestInputFileBuilder(tester.module().key(), \"Data.cs\")\n      .setLanguage(\"cs\")\n      .initMetadata(new String(Files.readAllBytes(csFile), StandardCharsets.UTF_8))\n      .build();\n    tester.fileSystem().add(secondFile);\n\n    when(fileLinesContextFactory.createFor(firstFile)).thenReturn(fileLinesContext);\n    when(fileLinesContextFactory.createFor(secondFile)).thenReturn(fileLinesContext);\n\n    // create metrics.pb\n    try (OutputStream os = Files.newOutputStream(workDir.resolve(\"metrics.pb\"))) {\n      MetricsInfo.newBuilder().setFilePath(firstFile.filename()).addCodeLine(12).addCodeLine(13).build().writeDelimitedTo(os);\n      MetricsInfo.newBuilder().setFilePath(secondFile.filename()).addCodeLine(42).addCodeLine(43).build().writeDelimitedTo(os);\n    }\n  }\n\n  @Test\n  public void should_import_existing_data() {\n    dataImporter.importResults(tester, Collections.singletonList(workDir), String::toString);\n\n    assertThat(tester.measures(firstFile.key())).isNotEmpty();\n    assertThat(tester.measure(firstFile.key(), CoreMetrics.NCLOC).value()).isEqualTo(2);\n  }\n\n  @Test\n  public void warn_about_files_not_found() {\n    dataImporter.importResults(tester, Collections.singletonList(workDir), String::toString);\n\n    String prefix = \"Protobuf file not found: \";\n    assertThat(logTester.logs(Level.WARN)).containsOnly(\n      prefix + workDir.resolve(\"token-type.pb\"),\n      prefix + workDir.resolve(\"symrefs.pb\"),\n      prefix + workDir.resolve(\"token-cpd.pb\"));\n  }\n\n  @Test\n  public void warn_about_already_processed_files() throws Exception {\n    try (OutputStream os = Files.newOutputStream(workDir.resolve(\"metrics.pb\"))) {\n      MetricsInfo info = MetricsInfo.newBuilder().setFilePath(firstFile.filename()).addCodeLine(12).addCodeLine(13).build();\n      info.writeDelimitedTo(os);\n      info.writeDelimitedTo(os);\n    }\n    dataImporter.importResults(tester, Collections.singletonList(workDir), String::toString);\n\n    assertThat(logTester.logs(Level.DEBUG)).containsOnly(\"File 'Program.cs' was already processed. Skip it\");\n  }\n\n  @Test\n  public void do_not_warn_about_unique_files() {\n    dataImporter.importResults(tester, Collections.singletonList(workDir), String::toString);\n\n    assertThat(logTester.logs(Level.DEBUG)).isEmpty();\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/RealPathProviderTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport java.io.File;\nimport java.io.IOException;\nimport org.junit.Assume;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.TemporaryFolder;\nimport org.sonar.api.testfixtures.log.LogTester;\nimport org.slf4j.event.Level;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\npublic class RealPathProviderTest {\n  @Rule\n  public TemporaryFolder temp = new TemporaryFolder();\n\n  @Rule\n  public LogTester logger = new LogTester();\n\n  @Before\n  public void before() {\n    logger.setLevel(Level.DEBUG);\n  }\n\n  @Test\n  public void when_relative_path_and_file_does_not_exist_returns_same_path() {\n    assertThat(new RealPathProvider().getRealPath(\"File.cs\")).isEqualTo(\"File.cs\");\n    assertThat(logger.logs(Level.DEBUG)).containsOnly(\"Failed to retrieve the real full path for 'File.cs'\");\n  }\n\n  @Test\n  public void when_relative_path_with_back_apostrophe_and_file_does_not_exist_returns_same_path() {\n    assertThat(new RealPathProvider().getRealPath(\"File`1.cs\")).isEqualTo(\"File`1.cs\");\n    assertThat(logger.logs(Level.DEBUG)).containsOnly(\"Failed to retrieve the real full path for 'File`1.cs'\");\n  }\n\n  @Test\n  public void when_relative_path_with_special_characters_and_file_does_not_exist_returns_same_path() {\n    assertThat(new RealPathProvider().getRealPath(\"P@!$%23&+-=r%5E%7B%7Dog_r()a%20m[1].cs\")).isEqualTo(\"P@!$%23&+-=r%5E%7B%7Dog_r()a%20m[1].cs\");\n    assertThat(logger.logs(Level.DEBUG)).containsOnly(\"Failed to retrieve the real full path for 'P@!$%23&+-=r%5E%7B%7Dog_r()a%20m[1].cs'\");\n  }\n\n  @Test\n  public void when_file_exists_fix_case() throws IOException {\n    Assume.assumeTrue(System.getProperty(\"os.name\").toLowerCase().startsWith(\"win\"));\n    File expectedFile = temp.newFile(\"FILE.CS\");\n    expectedFile.createNewFile();\n    assertThat(new RealPathProvider().getRealPath(new File(temp.getRoot(), \"file.cs\").getPath())).isEqualTo(expectedFile.getCanonicalPath());\n    assertThat(logger.logs(Level.DEBUG)).isEmpty();\n  }\n\n  @Test\n  public void cache_process_value_only_once() {\n    RealPathProvider testSubject = new RealPathProvider();\n    assertThat(testSubject.apply(\"File.cs\")).isEqualTo(\"File.cs\");\n    assertThat(testSubject.apply(\"File.cs\")).isEqualTo(\"File.cs\");\n    assertThat(testSubject.apply(\"File.cs\")).isEqualTo(\"File.cs\");\n    assertThat(logger.logs(Level.DEBUG)).containsOnlyOnce(\"Failed to retrieve the real full path for 'File.cs'\");\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/ReportPathCollectorTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.util.Collections;\nimport org.junit.Test;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\npublic class ReportPathCollectorTest {\n  private ReportPathCollector underTest = new ReportPathCollector();\n\n  @Test\n  public void should_save_roslyn_report_paths() {\n    RoslynReport r1 = new RoslynReport(null, Paths.get(\"p1\"));\n    RoslynReport r2 = new RoslynReport(null, Paths.get(\"p2\"));\n    underTest.addRoslynReport(Collections.singletonList(r1));\n    underTest.addRoslynReport(Collections.singletonList(r2));\n    assertThat(underTest.roslynReports()).containsOnly(r1, r2);\n    assertThat(underTest.protobufDirs()).isEmpty();\n  }\n\n  @Test\n  public void should_save_proto_report_paths() {\n    Path p1 = Paths.get(\"p1\");\n    Path p2 = Paths.get(\"p2\");\n    underTest.addProtobufDirs(Collections.singletonList(p1));\n    underTest.addProtobufDirs(Collections.singletonList(p2));\n    assertThat(underTest.protobufDirs()).containsOnly(p1, p2);\n    assertThat(underTest.roslynReports()).isEmpty();\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/RoslynDataImporterTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.nio.file.StandardOpenOption;\nimport java.util.Collections;\nimport java.util.List;\nimport org.apache.commons.io.FileUtils;\nimport org.assertj.core.groups.Tuple;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.ExpectedException;\nimport org.junit.rules.TemporaryFolder;\nimport org.sonar.api.batch.fs.internal.DefaultInputFile;\nimport org.sonar.api.batch.fs.internal.TestInputFileBuilder;\nimport org.sonar.api.batch.rule.internal.ActiveRulesBuilder;\nimport org.sonar.api.batch.rule.internal.NewActiveRule;\nimport org.sonar.api.batch.sensor.internal.SensorContextTester;\nimport org.sonar.api.internal.apachecommons.text.StringEscapeUtils;\nimport org.sonar.api.internal.apachecommons.lang3.StringUtils;\nimport org.sonar.api.rule.RuleKey;\nimport org.sonar.api.testfixtures.log.LogTester;\nimport org.slf4j.event.Level;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\npublic class RoslynDataImporterTest {\n  @Rule\n  public ExpectedException exception = ExpectedException.none();\n  @Rule\n  public TemporaryFolder temp = new TemporaryFolder();\n  @Rule\n  public LogTester logTester = new LogTester();\n\n  private PluginMetadata metadata = csPluginMetadata();\n  private RoslynDataImporter roslynDataImporter = new RoslynDataImporter(metadata, mock(AbstractLanguageConfiguration.class));\n  private SensorContextTester tester;\n  private Path workDir;\n\n  @Before\n  public void setUp() throws IOException {\n    logTester.setLevel(Level.DEBUG);\n    workDir = temp.getRoot().toPath().resolve(\"reports\");\n    Path csFile = Paths.get(\"src/test/resources/Program.cs\").toAbsolutePath();\n\n    // copy test reports to work dir\n    FileUtils.copyDirectory(new File(\"src/test/resources/RoslynDataImporterTest\"), workDir.toFile());\n\n    // replace file path in the roslyn report to point to real cs file in the resources\n    updateCodeFilePathsInReport(\"roslyn-report.json\", false);\n\n    tester = SensorContextTester.create(csFile.getParent());\n\n    DefaultInputFile inputFile = new TestInputFileBuilder(tester.module().key(), csFile.getParent().toFile(), csFile.toFile())\n      .setLanguage(\"cs\")\n      .initMetadata(new String(Files.readAllBytes(csFile), StandardCharsets.UTF_8))\n      .build();\n\n    tester.fileSystem().setWorkDir(workDir);\n    tester.fileSystem().add(inputFile);\n  }\n\n  @Test\n  public void roslynReportIsProcessed() {\n    addActiveRules();\n    roslynDataImporter.importRoslynReports(Collections.singletonList(new RoslynReport(tester.project(), workDir.resolve(\"roslyn-report.json\"))), tester,\n      String::toString);\n\n    assertThat(tester.allIssues())\n      .extracting(\"ruleKey\", \"primaryLocation.textRange.start.line\", \"primaryLocation.message\")\n      .containsOnly(\n        Tuple.tuple(RuleKey.of(\"csharpsquid\", \"[parameters_key]\"), 19,\n          \"Short messages should be used first in Roslyn reports\"),\n        Tuple.tuple(RuleKey.of(\"csharpsquid\", \"[parameters_key]\"), 1,\n          \"There only is a full message in the Roslyn report\"),\n        Tuple.tuple(RuleKey.of(\"roslyn.foo\", \"custom-roslyn\"), 19,\n          \"Custom Roslyn analyzer message\"),\n        Tuple.tuple(RuleKey.of(\"csharpsquid\", \"[parameters_key]\"), null,\n          \"This is an assembly level Roslyn issue with no location\"));\n\n    assertThat(tester.allAdHocRules()).isEmpty();\n    assertThat(tester.allExternalIssues()).hasSize(1);\n    assertThat(logTester.logs(Level.DEBUG)).contains(\"Processing Roslyn report: \" + workDir.resolve(\"roslyn-report.json\"));\n  }\n\n  @Test\n  public void roslynEmptyReportShouldNotFail() {\n    addActiveRules();\n    roslynDataImporter.importRoslynReports(Collections.singletonList(new RoslynReport(null, workDir.resolve(\"roslyn-report-empty.json\"))), tester, String::toString);\n\n    assertThat(tester.allIssues()).isEmpty();\n    assertThat(tester.allExternalIssues()).isEmpty();\n    assertThat(logTester.logs(Level.INFO)).containsExactly(\"Importing 1 Roslyn report\");\n  }\n\n  @Test\n  public void failWithDuplicateRuleKey() {\n    tester.setActiveRules(new ActiveRulesBuilder()\n      .addRule(createRule(\"csharpsquid\", \"[parameters_key]\"))\n      .addRule(createRule(\"roslyn.foo\", \"[parameters_key]\"))\n      .build());\n\n    exception.expectMessage(\"Rule keys must be unique, but \\\"[parameters_key]\\\" is defined in both the \\\"roslyn.foo\\\" and \\\"csharpsquid\\\" rule repositories.\");\n    roslynDataImporter.importRoslynReports(Collections.singletonList(new RoslynReport(null, workDir.resolve(\"roslyn-report.json\"))), tester, String::toString);\n  }\n\n  @Test\n  public void internalIssuesFromExternalRepositoriesWithInvalidLocationShouldNotFail() throws IOException {\n    final String repositoryName = \"roslyn.stylecop.analyzers.cs\";\n    tester.setActiveRules(new ActiveRulesBuilder()\n      .addRule(createRule(repositoryName, \"SA1629\"))\n      .build());\n    Path reportPath = updateCodeFilePathsInReport(\"roslyn-report-invalid-location.json\", true);\n    RoslynReport report = new RoslynReport(tester.project(), reportPath);\n    roslynDataImporter.importRoslynReports(Collections.singletonList(report), tester, String::toString);\n\n    assertThat(tester.allIssues()).hasSize(2);\n    assertThat(tester.allAdHocRules()).isEmpty();\n    assertThat(tester.allExternalIssues()).isEmpty();\n\n    List<String> logs = logTester.logs();\n    assertThat(logs.get(0)).isEqualTo(\"Importing 1 Roslyn report\");\n    assertThat(logs.get(1)).isEqualTo(\"Processing Roslyn report: \" + workDir.resolve(\"roslyn-report-invalid-location.json\"));\n    assertThat(logs.get(2))\n      .startsWith(\"Adding normal issue SA1629:\")\n      .endsWith(\"\\\\resources\\\\Program.cs\");\n    assertThat(logs.get(3))\n      .startsWith(\"Precise issue location cannot be found! Location:\")\n      .endsWith(\"\\\\resources\\\\Program.cs, message=Documentation text should end with a period, startLine=13, startColumn=99, endLine=13, endColumn=100]\");\n    assertThat(logs.get(4))\n      .startsWith(\"Adding normal issue SA1629:\")\n      .endsWith(\"\\\\resources\\\\Program.cs\");\n    assertThat(logs.get(5))\n      .startsWith(\"Precise issue location cannot be found! Location:\")\n      .endsWith(\"\\\\resources\\\\Program.cs, message=Documentation text should end with a period, startLine=100, startColumn=0, endLine=100, endColumn=1]\");\n    assertThat(logs.get(6))\n      .startsWith(\"Line issue location cannot be found! Location:\")\n      .endsWith(\"\\\\resources\\\\Program.cs, message=Documentation text should end with a period, startLine=100, startColumn=0, endLine=100, endColumn=1]\");\n  }\n\n  @Test\n  public void internalIssuesFromCSharpRepositoryWithInvalidLocationShouldFail() throws IOException {\n    assertInvalidLocationFail(\"csharpsquid\", roslynDataImporter);\n  }\n\n  @Test\n  public void internalIssuesFromVBNetRepositoryWithInvalidLocationShouldFail() throws IOException {\n    PluginMetadata vbPluginMetadata = mock(PluginMetadata.class);\n    when(vbPluginMetadata.repositoryKey()).thenReturn(\"vbnet\");\n\n    RoslynDataImporter vbNetRoslynDataImporter = new RoslynDataImporter(vbPluginMetadata, mock(AbstractLanguageConfiguration.class));\n    assertInvalidLocationFail(\"vbnet\", vbNetRoslynDataImporter);\n  }\n\n  private void assertInvalidLocationFail(String repositoryName, RoslynDataImporter sut) throws IOException {\n    tester.setActiveRules(new ActiveRulesBuilder()\n      .addRule(createRule(repositoryName, \"SA1629\"))\n      .build());\n\n    Path reportPath = updateCodeFilePathsInReport(\"roslyn-report-invalid-location.json\", true);\n    RoslynReport report = new RoslynReport(tester.project(), reportPath);\n\n    exception.expectMessage(\"99 is not a valid line offset for pointer. File Program.cs has 15 character(s) at line 13\");\n    sut.importRoslynReports(Collections.singletonList(report), tester, String::toString);\n  }\n\n  private void addActiveRules() {\n    tester.setActiveRules(new ActiveRulesBuilder()\n      .addRule(createRule(\"csharpsquid\", \"[parameters_key]\"))\n      .addRule(createRule(\"csharpsquid\", \"S1186\"))\n      .addRule(createRule(\"roslyn.foo\", \"custom-roslyn\"))\n      .build());\n  }\n\n  // Updates the file paths in the roslyn report to point to real cs file in the resources.\n  private Path updateCodeFilePathsInReport(String reportFileName, boolean useUriPath) throws IOException {\n    Path reportPath = workDir.resolve(reportFileName);\n    Path csFile = Paths.get(\"src/test/resources/Program.cs\").toAbsolutePath();\n\n    // In SARIF Version 0.1 the path is an absolute path but in 1.0.0 it is serialized in URI format.\n    String csFilePath;\n    if (useUriPath) {\n      csFilePath = csFile.toUri().toString();\n    } else {\n      csFilePath = csFile.toString();\n    }\n\n    String reportContent = new String(Files.readAllBytes(reportPath), StandardCharsets.UTF_8);\n    reportContent = StringUtils.replace(reportContent, \"Program.cs\", StringEscapeUtils.escapeEcmaScript(csFilePath));\n    Files.write(reportPath, reportContent.getBytes(StandardCharsets.UTF_8), StandardOpenOption.WRITE);\n    return reportPath;\n  }\n  private NewActiveRule createRule(String repositoryKey, String ruleKey) {\n    return new NewActiveRule.Builder()\n      .setRuleKey(RuleKey.of(repositoryKey, ruleKey))\n      .build();\n  }\n\n  private static PluginMetadata csPluginMetadata() {\n    PluginMetadata metadata = mock(PluginMetadata.class);\n    when(metadata.repositoryKey()).thenReturn(\"csharpsquid\");\n    return metadata;\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/RoslynRulesTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport java.util.List;\nimport org.junit.Test;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.api.Assertions.assertThatExceptionOfType;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\npublic class RoslynRulesTest {\n\n  @Test\n  public void rules_loads_data() {\n    RoslynRules sut = new RoslynRules(mockMetadata(\"/RoslynRulesTest\"));\n    List<RoslynRules.Rule> rules = sut.rules();\n\n    assertThat(rules).hasSize(3);\n    RoslynRules.Rule rule = rules.get(0);\n    assertThat(rule.id).isEqualTo(\"S-NO-PARAMS\");\n    assertThat(rule.parameters).isEmpty();\n\n    rule = rules.get(1);\n    assertThat(rule.id).isEqualTo(\"S-ONE-PARAM\");\n    assertThat(rule.parameters).hasSize(1);\n    assertParameter(rule.parameters[0], \"answer\", \"Answer to life the universe and everything.\", \"INTEGER\", \"42\");\n\n    rule = rules.get(2);\n    assertThat(rule.id).isEqualTo(\"S-TWO-PARAMS\");\n    assertThat(rule.parameters).hasSize(2);\n    assertParameter(rule.parameters[0], \"first\", \"First description.\", \"INTEGER\", \"42\");\n    assertParameter(rule.parameters[1], \"second\", \"Second description.\", \"STRING\", \"2nd default value\");\n  }\n\n  @Test\n  public void test_missing_resource_throws() {\n    RoslynRules sut = new RoslynRules(mockMetadata(\"/org/sonar/plugins/csharp\"));\n    assertThatExceptionOfType(IllegalStateException.class)\n      .isThrownBy(() -> sut.rules())\n      .withMessage(\"Resource does not exist: Rules.json\");\n  }\n\n  private void assertParameter(RoslynRules.RuleParameter parameter, String key, String description, String type, String defaultValue) {\n    assertThat(parameter.key).isEqualTo(key);\n    assertThat(parameter.description).isEqualTo(description);\n    assertThat(parameter.type).isEqualTo(type);\n    assertThat(parameter.defaultValue).isEqualTo(defaultValue);\n  }\n\n  private static PluginMetadata mockMetadata(String resourcesDirectory) {\n    PluginMetadata metadata = mock(PluginMetadata.class);\n    when(metadata.repositoryKey()).thenReturn(\"test\");\n    when(metadata.languageKey()).thenReturn(\"test\");\n    when(metadata.resourcesDirectory()).thenReturn(resourcesDirectory);\n    return metadata;\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/SensorContextUtilsTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.util.Optional;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.TemporaryFolder;\nimport org.sonar.api.batch.fs.InputFile;\nimport org.sonar.api.batch.fs.TextRange;\nimport org.sonar.api.batch.fs.internal.DefaultFileSystem;\nimport org.sonar.api.batch.fs.internal.DefaultInputFile;\nimport org.sonar.api.batch.fs.internal.TestInputFileBuilder;\nimport org.sonarsource.dotnet.protobuf.SonarAnalyzer;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.api.Assertions.fail;\nimport static org.sonar.api.batch.fs.InputFile.Type;\nimport static org.sonarsource.dotnet.shared.plugins.SensorContextUtils.hasAnyMainFiles;\nimport static org.sonarsource.dotnet.shared.plugins.SensorContextUtils.hasFilesOfLanguage;\nimport static org.sonarsource.dotnet.shared.plugins.SensorContextUtils.hasFilesOfType;\nimport static org.sonarsource.dotnet.shared.plugins.SensorContextUtils.toInputFile;\nimport static org.sonarsource.dotnet.shared.plugins.SensorContextUtils.toTextRange;\n\npublic class SensorContextUtilsTest {\n  private static final String LANG_ONE = \"LANG_ONE\";\n  private static final String LANG_TWO = \"LANG_TWO\";\n\n  @Rule\n  public TemporaryFolder temporaryFolder = new TemporaryFolder();\n\n  private DefaultFileSystem fs;\n\n  @Before\n  public void setUp() {\n    fs = new DefaultFileSystem(temporaryFolder.getRoot());\n  }\n\n  @Test\n  public void toInputFile_should_return_file_if_exists() throws IOException {\n    // note: the .getCanonicalFile() is a precaution for filename-shortening on windows\n    File file = temporaryFolder.newFile().getCanonicalFile();\n    fs.add(new TestInputFileBuilder(\"dummy\", file.getName())\n      .setModuleBaseDir(file.getParentFile().toPath())\n      .build());\n    assertThat(toInputFile(fs, file.getName()).uri()).isEqualTo(file.toURI());\n  }\n\n  @Test\n  public void toInputFile_should_return_null_if_file_nonexistent() {\n    assertThat(toInputFile(fs, \"nonexistent\")).isNull();\n  }\n\n  @Test\n  public void toInputFile_should_return_null_if_file_is_a_dir() throws IOException {\n    File folder = temporaryFolder.newFolder();\n    fs.add(new TestInputFileBuilder(\"dummy\", folder.getName()).build());\n    assertThat(toInputFile(fs, \"nonexistent\")).isNull();\n  }\n\n  @Test\n  public void hasFilesOfType_whenNoFiles_returnsFalse() {\n    assertThat(hasFilesOfType(fs, Type.MAIN, LANG_ONE)).isFalse();\n    assertThat(hasFilesOfType(fs, Type.TEST, LANG_ONE)).isFalse();\n  }\n\n  @Test\n  public void hasFilesOfType_whenTypeIsCorrect_andLanguageIsDifferent_returnFalse() {\n    addFileToFileSystem(\"foo\", Type.MAIN, LANG_ONE);\n    assertThat(hasFilesOfType(fs, Type.MAIN, LANG_TWO)).isFalse();\n  }\n\n  @Test\n  public void hasFilesOfType_whenLanguageIsCorrect_andTypeIsDifferent_returnsFalse() {\n    addFileToFileSystem(\"foo\", Type.MAIN, LANG_ONE);\n    assertThat(hasFilesOfType(fs, Type.TEST, LANG_ONE)).isFalse();\n  }\n\n  @Test\n  public void hasFilesOfType_whenLanguageAndTypeAreCorrect_returnsTrue() {\n    addFileToFileSystem(\"foo\", Type.MAIN, LANG_ONE);\n    assertThat(hasFilesOfType(fs, Type.MAIN, LANG_ONE)).isTrue();\n  }\n\n  @Test\n  public void hasMainFiles_whenNoFiles_returnsFalse() {\n    assertThat(hasAnyMainFiles(fs)).isFalse();\n  }\n\n  @Test\n  public void hasMainFiles_whenOnlyTestFiles_returnsFalse() {\n    addFileToFileSystem(\"foo\", Type.TEST, LANG_ONE);\n    assertThat(hasAnyMainFiles(fs)).isFalse();\n  }\n\n  @Test\n  public void hasMainFiles_whenOnlyMainFiles_returnsTrue() {\n    addFileToFileSystem(\"foo\", Type.MAIN, LANG_ONE);\n    assertThat(hasAnyMainFiles(fs)).isTrue();\n  }\n\n  @Test\n  public void hasMainFiles_whenBothTestAndMainFiles_returnsTrue() {\n    addFileToFileSystem(\"foo\", Type.MAIN, LANG_ONE);\n    addFileToFileSystem(\"bar\", Type.TEST, LANG_TWO);\n    assertThat(hasAnyMainFiles(fs)).isTrue();\n  }\n\n  @Test\n  public void hasFilesOfLanguage_whenOnlyThatLanguageExists_returnsTrue() {\n    addFileToFileSystem(\"foo\", Type.MAIN, LANG_ONE);\n    addFileToFileSystem(\"bar\", Type.TEST, LANG_ONE);\n    assertThat(hasFilesOfLanguage(fs, LANG_ONE)).isTrue();\n  }\n\n  @Test\n  public void hasFilesOfLanguage_whenMultipleLanguagesExist_returnsTrue() {\n    addFileToFileSystem(\"fooLang1\", Type.MAIN, LANG_ONE);\n    addFileToFileSystem(\"barLang1\", Type.TEST, LANG_ONE);\n    addFileToFileSystem(\"fooLang2\", Type.MAIN, LANG_TWO);\n    addFileToFileSystem(\"barLang2\", Type.TEST, LANG_TWO);\n    assertThat(hasFilesOfLanguage(fs, LANG_ONE)).isTrue();\n  }\n\n  @Test\n  public void hasFilesOfLanguage_whenOnlyMainFilesOfThatLanguageExist_returnsTrue() {\n    addFileToFileSystem(\"foo\", Type.MAIN, LANG_ONE);\n    assertThat(hasFilesOfLanguage(fs, LANG_ONE)).isTrue();\n  }\n\n  @Test\n  public void hasFilesOfLanguage_whenOnlyTestFilesOfThatLanguageExist_returnsTrue() {\n    addFileToFileSystem(\"bar\", Type.TEST, LANG_ONE);\n    assertThat(hasFilesOfLanguage(fs, LANG_ONE)).isTrue();\n  }\n\n  @Test\n  public void hasFilesOfLanguage_whenOnlyOtherLanguageExists_returnsFalse() {\n    addFileToFileSystem(\"foo\", Type.MAIN, LANG_TWO);\n    addFileToFileSystem(\"bar\", Type.TEST, LANG_TWO);\n    assertThat(hasFilesOfLanguage(fs, LANG_ONE)).isFalse();\n  }\n\n  @Test\n  public void toTextRange_whenMultiLineRangeStartsAtEOL_doesNotFilterOut() {\n    var inputFile = new TestInputFileBuilder(\"mod\", \"source.cs\")\n      .setLanguage(\"cs\")\n      .setType(Type.MAIN)\n      .setContents(\n        \"Some text \\n\" +\n        \"rangeStartingAtEOL1\\n\" +\n        \"Some more text rangeStarting\\n\" +\n        \"AtEOL2 Some other text\")\n      .build();\n    fs.add(inputFile);\n    assertTextRange(toTextRange(inputFile, pbTextRangeOf(1, 10, 2, 18)), 1, 10, 2, 18);\n    assertTextRange(toTextRange(inputFile, pbTextRangeOf(2, 19, 4, 5)), 2, 19, 4, 5);\n  }\n\n  @Test\n  public void toTextRange_whenMultiLineRangeStartsBeyondEOL_trimsStartMovingToNextLine() {\n    var inputFile = new TestInputFileBuilder(\"mod\", \"source.cs\")\n      .setLanguage(\"cs\")\n      .setType(Type.MAIN)\n      .setContents(\"\\tSome text\\nrangeStartingAtEOL1\\nrangeStarting\\nAtEOL2\\nAndSpanning\\nMultipleLines\")\n      .build();\n    fs.add(inputFile);\n\n    // Possible real scenario: 4 spaces transformed into \\t -> new EOL at 10 instead of 13\n    assertTextRange(toTextRange(inputFile, pbTextRangeOf(1, 13, 2, 18)), 2, 0, 2, 18);\n  }\n\n  @Test\n  public void toTextRange_whenMultiLineRangeEndsBeyondEOL_trimsBasedOnEndLineLength() {\n    var inputFile = new TestInputFileBuilder(\"mod\", \"source.cs\")\n      .setLanguage(\"cs\")\n      .setType(Type.MAIN)\n      .setContents(\"Some text multiline\\nRangeWithEndLineOffsetBiggerThanStartLineOffset Some other text\")\n      .build();\n    fs.add(inputFile);\n    assertTextRange(toTextRange(inputFile, pbTextRangeOf(1, 10, 2, 64)), 1, 10, 2, 63);\n  }\n\n  @Test\n  public void toTextRange_whenSingleLineRangeStartsAtEOL_filtersOut() {\n    var inputFile = new TestInputFileBuilder(\"mod\", \"source.cs\")\n      .setLanguage(\"cs\")\n      .setType(Type.MAIN)\n      .setContents(\"Some text\\nSome other text\")\n      .build();\n    fs.add(inputFile);\n    assertThat(toTextRange(inputFile, pbTextRangeOf(1, 9, 1, 12))).isEmpty();\n    assertThat(toTextRange(inputFile, pbTextRangeOf(1, 9, 1, 9))).isEmpty();\n  }\n\n  @Test\n  public void toTextRange_whenSingleLineRangeStartsBeyondEOL_filtersOut() {\n    var inputFile = new TestInputFileBuilder(\"mod\", \"source.cs\")\n      .setLanguage(\"cs\")\n      .setType(Type.MAIN)\n      .setContents(\"Some text\\nSome other text\")\n      .build();\n    fs.add(inputFile);\n    assertThat(toTextRange(inputFile, pbTextRangeOf(1, 10, 1, 12))).isEmpty();\n    assertThat(toTextRange(inputFile, pbTextRangeOf(1, 10, 1, 10))).isEmpty();\n  }\n\n  @Test\n  public void toTextRange_whenSingleLineRangeEndsBeyondEOL_trimsBasedOnEndLineLength() {\n    var inputFile = new TestInputFileBuilder(\"mod\", \"source.cs\")\n      .setLanguage(\"cs\")\n      .setType(Type.MAIN)\n      .setContents(\"Some text singleLineRange\\n\")\n      .build();\n    fs.add(inputFile);\n    assertTextRange(toTextRange(inputFile, pbTextRangeOf(1, 10, 1, 100)), 1, 10, 1, 25);\n  }\n\n  private void addFileToFileSystem(String fileName, InputFile.Type fileType, String language) {\n    DefaultInputFile inputFile = new TestInputFileBuilder(\"mod\", fileName)\n      .setLanguage(language)\n      .setType(fileType)\n      .build();\n    fs.add(inputFile);\n  }\n\n  private SonarAnalyzer.TextRange pbTextRangeOf(int startLine, int startLineOffset, int endLine, int endLineOffset) {\n    return SonarAnalyzer.TextRange.newBuilder()\n      .setStartLine(startLine)\n      .setStartOffset(startLineOffset)\n      .setEndLine(endLine)\n      .setEndOffset(endLineOffset)\n      .build();\n  }\n\n  private void assertTextRange(Optional<TextRange> textRange, int startLine, int startLineOffset, int endLine, int endLineOffset) {\n    textRange.ifPresentOrElse(\n      x -> {\n        assertThat(x.start().line()).isEqualTo(startLine);\n        assertThat(x.start().lineOffset()).isEqualTo(startLineOffset);\n        assertThat(x.end().line()).isEqualTo(endLine);\n        assertThat(x.end().lineOffset()).isEqualTo(endLineOffset);\n      },\n      () -> {\n        fail(\"The provided textRange is empty.\");\n      });\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/UnitTestResultsProviderTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport java.util.List;\n\nimport org.junit.Test;\nimport org.sonar.plugins.dotnet.tests.UnitTestResultsImportSensor;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\nimport static org.sonarsource.dotnet.shared.PropertyUtils.nonProperties;\nimport static org.sonarsource.dotnet.shared.PropertyUtils.propertyKeys;\n\npublic class UnitTestResultsProviderTest {\n\n  @Test\n  public void vbnet() {\n    PluginMetadata pluginMetadata = mock(PluginMetadata.class);\n    when(pluginMetadata.languageKey()).thenReturn(\"vbnet\");\n    UnitTestResultsProvider provider = new UnitTestResultsProvider(pluginMetadata);\n    List extensions = provider.extensions();\n    assertThat(nonProperties(extensions)).containsOnly(\n      provider,\n      UnitTestResultsProvider.DotNetUnitTestResultsAggregator.class,\n      UnitTestResultsImportSensor.class);\n    assertThat(propertyKeys(extensions)).containsOnly(\n      \"sonar.vbnet.vstest.reportsPaths\", \"sonar.vbnet.nunit.reportsPaths\", \"sonar.vbnet.xunit.reportsPaths\");\n  }\n\n  @Test\n  public void csharp() {\n    PluginMetadata pluginMetadata = mock(PluginMetadata.class);\n    when(pluginMetadata.languageKey()).thenReturn(\"cs\");\n    UnitTestResultsProvider provider = new UnitTestResultsProvider(pluginMetadata);\n    List extensions = provider.extensions();\n    assertThat(nonProperties(extensions)).containsOnly(\n      provider,\n      UnitTestResultsProvider.DotNetUnitTestResultsAggregator.class,\n      UnitTestResultsImportSensor.class);\n    assertThat(propertyKeys(extensions)).containsOnly(\n      \"sonar.cs.vstest.reportsPaths\", \"sonar.cs.nunit.reportsPaths\", \"sonar.cs.xunit.reportsPaths\");\n  }\n\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/WrongEncodingFileFilterTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.sonar.api.batch.fs.InputFile;\nimport org.sonarsource.dotnet.shared.plugins.filters.WrongEncodingFileFilter;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\npublic class WrongEncodingFileFilterTest {\n  private WrongEncodingFileFilter filter;\n  private EncodingPerFile encodingPerFile;\n\n  @Before\n  public void setUp() {\n    encodingPerFile = mock(EncodingPerFile.class);\n    filter = new WrongEncodingFileFilter(encodingPerFile);\n  }\n\n  @Test\n  public void should_exclude_files_with_mismatching_encoding() {\n    InputFile file = mock(InputFile.class);\n    when(encodingPerFile.encodingMatch(file)).thenReturn(true);\n    assertThat(filter.accept(file)).isTrue();\n  }\n\n  @Test\n  public void should_accept_files_with_matching_encoding() {\n    InputFile file = mock(InputFile.class);\n    when(encodingPerFile.encodingMatch(file)).thenReturn(false);\n    assertThat(filter.accept(file)).isFalse();\n  }\n\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/protobuf/CPDTokensImporterTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.protobuf;\n\nimport java.io.File;\nimport java.io.FileNotFoundException;\nimport java.io.FileReader;\nimport java.util.List;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.sonar.api.batch.fs.internal.DefaultInputFile;\nimport org.sonar.api.batch.fs.internal.FileMetadata;\nimport org.sonar.api.batch.fs.internal.TestInputFileBuilder;\nimport org.sonar.api.batch.sensor.cpd.internal.TokensLine;\nimport org.sonar.api.batch.sensor.internal.SensorContextTester;\nimport org.sonar.api.notifications.AnalysisWarnings;\nimport org.sonar.api.testfixtures.log.LogTester;\nimport org.slf4j.event.Level;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.Mockito.mock;\nimport static org.sonarsource.dotnet.shared.plugins.ProtobufDataImporter.CPDTOKENS_FILENAME;\n\npublic class CPDTokensImporterTest {\n\n  @Rule\n  public LogTester logs = new LogTester();\n\n  // see src/test/resources/ProtobufImporterTest/README.md for explanation\n  private static final File TEST_DATA_DIR = new File(\"src/test/resources/ProtobufImporterTest\");\n  private static final String TEST_FILE_PATH = \"Program.cs\";\n  private static final File TEST_FILE = new File(TEST_DATA_DIR, TEST_FILE_PATH);\n\n  private SensorContextTester tester = SensorContextTester.create(TEST_DATA_DIR);\n  private CPDTokensImporter underTest = new CPDTokensImporter(tester, String::toString);\n  private File protobuf = new File(TEST_DATA_DIR, CPDTOKENS_FILENAME);\n\n  @Before\n  public void before() {\n    logs.setLevel(Level.DEBUG);\n    assertThat(protobuf).withFailMessage(\"no such file: \" + protobuf).isFile();\n  }\n\n  @Test\n  public void test_copy_paste_tokens_get_imported() throws FileNotFoundException {\n    DefaultInputFile inputFile = new TestInputFileBuilder(\"dummyKey\", TEST_FILE_PATH)\n      .setMetadata(new FileMetadata(mock(AnalysisWarnings.class)).readMetadata(new FileReader(TEST_FILE)))\n      .build();\n    tester.fileSystem().add(inputFile);\n\n    underTest.accept(protobuf.toPath());\n\n    List<TokensLine> lines = tester.cpdTokens(inputFile.key());\n    checkExpectedData(lines);\n  }\n\n  @Test\n  public void ignore_repeated_files() throws FileNotFoundException {\n    DefaultInputFile inputFile = new TestInputFileBuilder(\"dummyKey\", TEST_FILE_PATH)\n      .setMetadata(new FileMetadata(mock(AnalysisWarnings.class)).readMetadata(new FileReader(TEST_FILE)))\n      .build();\n    tester.fileSystem().add(inputFile);\n\n    underTest.accept(protobuf.toPath());\n    underTest.accept(protobuf.toPath());\n\n    List<TokensLine> lines = tester.cpdTokens(inputFile.key());\n    checkExpectedData(lines);\n\n    assertThat(logs.logs(Level.DEBUG)).containsOnly(\"File 'Program.cs' was already processed. Skip it\");\n  }\n\n  private void checkExpectedData(List<TokensLine> lines) {\n    assertThat(lines).hasSize(35);\n\n    assertThat(lines.get(0).getValue()).isEqualTo(\"namespaceConsoleApplication1\");\n    assertThat(lines.get(0).getStartLine()).isEqualTo(15);\n\n    assertThat(lines.get(2).getValue()).isEqualTo(\"publicclassProgram\");\n    assertThat(lines.get(2).getStartLine()).isEqualTo(23);\n\n    assertThat(lines.get(4).getValue()).isEqualTo(\"publicstaticintAdd(intop1,intop2)\");\n    assertThat(lines.get(4).getStartLine()).isEqualTo(25);\n\n    assertThat(lines.get(5).getValue()).isEqualTo(\"{\");\n    assertThat(lines.get(5).getStartLine()).isEqualTo(26);\n\n    assertThat(lines.get(6).getValue()).isEqualTo(\"if(op1==$num)\");\n    assertThat(lines.get(6).getStartLine()).isEqualTo(27);\n  }\n\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/protobuf/FileMetadataImporterTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.protobuf;\n\nimport com.google.protobuf.AbstractParser;\nimport java.io.File;\nimport java.io.FileNotFoundException;\nimport java.io.FileOutputStream;\nimport java.io.IOException;\nimport java.net.URI;\nimport java.nio.charset.Charset;\nimport java.nio.charset.StandardCharsets;\nimport java.nio.file.Paths;\nimport java.util.Map;\nimport java.util.Set;\nimport org.junit.Ignore;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.sonar.api.batch.fs.internal.DefaultInputFile;\nimport org.sonar.api.batch.fs.internal.TestInputFileBuilder;\nimport org.sonar.api.batch.sensor.internal.SensorContextTester;\nimport org.sonar.api.testfixtures.log.LogTester;\nimport org.slf4j.event.Level;\nimport org.sonarsource.dotnet.protobuf.SonarAnalyzer;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.Mockito.mock;\nimport static org.sonarsource.dotnet.shared.plugins.ProtobufDataImporter.FILEMETADATA_FILENAME;\n\npublic class FileMetadataImporterTest {\n  @Rule\n  public LogTester logs = new LogTester();\n\n  // see src/test/resources/ProtobufImporterTest/README.md for explanation\n  private static final File TEST_DATA_DIR = new File(\"src/test/resources/ProtobufImporterTest\");\n  private static final String TEST_FILE_PATH = \"Program.cs\";\n\n  private AbstractParser<SonarAnalyzer.FileMetadataInfo> parser = mock(AbstractParser.class);\n  private FileMetadataImporter fileMetadataImporter = new FileMetadataImporter(parser);\n  private SensorContextTester tester = SensorContextTester.create(TEST_DATA_DIR);\n\n  private File protobuf = new File(TEST_DATA_DIR, FILEMETADATA_FILENAME);\n  private File invalidProtobuf = new File(TEST_DATA_DIR, \"invalid-encoding.pb\");\n\n  @Test\n  public void getGeneratedFilePaths_returns_only_generated_uris() {\n    SonarAnalyzer.FileMetadataInfo.Builder builder = SonarAnalyzer.FileMetadataInfo.newBuilder();\n\n    SonarAnalyzer.FileMetadataInfo message1 = builder.setIsGenerated(true).setFilePath(\"c:\\\\file1\").build();\n    SonarAnalyzer.FileMetadataInfo message2 = builder.setIsGenerated(true).setFilePath(\"/usr/local/src/project/file2\").build();\n    SonarAnalyzer.FileMetadataInfo message3 = builder.setIsGenerated(false).setFilePath(\"c:\\\\file3\").build();\n    SonarAnalyzer.FileMetadataInfo messageSamePath = builder.setIsGenerated(false).setFilePath(\"c:\\\\file3\").build();\n\n    fileMetadataImporter.consume(message1);\n    fileMetadataImporter.consume(message2);\n    fileMetadataImporter.consume(message3);\n    fileMetadataImporter.consume(messageSamePath);\n\n    // Act\n    Set<URI> uris = fileMetadataImporter.getGeneratedFileUris();\n\n    // Assert\n    assertThat(uris.size()).isEqualTo(2);\n    assertThat(uris.contains(Paths.get(\"c:\\\\file1\").toUri())).isTrue();\n    assertThat(uris.contains(Paths.get(\"/usr/local/src/project/file2\").toUri())).isTrue();\n    assertThat(uris.contains(Paths.get(\"c:\\\\file3\").toUri())).isFalse();\n  }\n\n  @Test\n  public void getGeneratedFileUris_returns_empty_set_when_protobuf_is_empty() {\n    // No consume calls means that the protobuf contained no messages\n\n    // Act\n    Set<URI> uris = fileMetadataImporter.getGeneratedFileUris();\n\n    // Assert\n    assertThat(uris.isEmpty()).isTrue();\n  }\n\n  @Ignore(\"this can be used to regenerate the files in case of a change in the protobuf definition\")\n  @Test\n  public void regenerate_test_files() throws IOException {\n    SonarAnalyzer.FileMetadataInfo.newBuilder()\n      .setFilePath(TEST_FILE_PATH).setIsGenerated(false).setEncoding(\"UTF-7\")\n      .build().writeDelimitedTo(new FileOutputStream(invalidProtobuf));\n\n    SonarAnalyzer.FileMetadataInfo.newBuilder()\n      .setFilePath(TEST_FILE_PATH).setIsGenerated(false).setEncoding(\"UTF-8\")\n      .build().writeDelimitedTo(new FileOutputStream(protobuf));\n  }\n\n  @Test\n  public void test_encoding_get_imported() throws FileNotFoundException {\n    DefaultInputFile inputFile = new TestInputFileBuilder(\"dummyKey\", TEST_FILE_PATH)\n      .build();\n    tester.fileSystem().add(inputFile);\n\n    FileMetadataImporter metadataImporter = new FileMetadataImporter();\n    metadataImporter.accept(protobuf.toPath());\n\n    Map<URI, Charset> encodingPerUri = metadataImporter.getEncodingPerUri();\n    assertThat(encodingPerUri).hasSize(1)\n      .containsEntry(Paths.get(TEST_FILE_PATH).toUri(), StandardCharsets.UTF_8);\n  }\n\n  @Test\n  public void test_encoding_warns_for_invalid_encoding() {\n    DefaultInputFile inputFile = new TestInputFileBuilder(\"dummyKey\", TEST_FILE_PATH)\n      .build();\n    tester.fileSystem().add(inputFile);\n\n    FileMetadataImporter metadataImporter = new FileMetadataImporter();\n    metadataImporter.accept(invalidProtobuf.toPath());\n\n    assertThat(logs.logs(Level.WARN)).containsOnly(\"Unrecognized encoding UTF-7 for file Program.cs\");\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/protobuf/HighlightImporterTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.protobuf;\n\nimport java.io.File;\nimport java.io.FileNotFoundException;\nimport java.io.FileReader;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.slf4j.event.Level;\nimport org.sonar.api.batch.fs.internal.DefaultInputFile;\nimport org.sonar.api.batch.fs.internal.FileMetadata;\nimport org.sonar.api.batch.fs.internal.TestInputFileBuilder;\nimport org.sonar.api.batch.sensor.highlighting.TypeOfText;\nimport org.sonar.api.batch.sensor.internal.SensorContextTester;\nimport org.sonar.api.notifications.AnalysisWarnings;\nimport org.sonar.api.testfixtures.log.LogTester;\nimport org.sonarsource.dotnet.protobuf.SonarAnalyzer;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.api.Assertions.assertThatThrownBy;\nimport static org.mockito.Mockito.mock;\nimport static org.sonarsource.dotnet.shared.plugins.ProtobufDataImporter.HIGHLIGHT_FILENAME;\n\npublic class HighlightImporterTest {\n\n  @Rule\n  public LogTester logs = new LogTester();\n\n  // see src/test/resources/ProtobufImporterTest/README.md for explanation\n  private static final File TEST_DATA_DIR = new File(\"src/test/resources/ProtobufImporterTest\");\n  private static final String TEST_FILE_PATH = \"Program.cs\";\n  private static final File TEST_FILE = new File(TEST_DATA_DIR, TEST_FILE_PATH);\n\n  @Test\n  public void test_syntax_highlights_get_imported() throws FileNotFoundException {\n    SensorContextTester tester = SensorContextTester.create(TEST_DATA_DIR);\n\n    DefaultInputFile inputFile = new TestInputFileBuilder(\"dummyKey\", TEST_FILE_PATH)\n      .setMetadata(new FileMetadata(mock(AnalysisWarnings.class)).readMetadata(new FileReader(TEST_FILE)))\n      .build();\n    tester.fileSystem().add(inputFile);\n\n    File protobuf = new File(TEST_DATA_DIR, HIGHLIGHT_FILENAME);\n    assertThat(protobuf).withFailMessage(\"no such file: \" + protobuf).isFile();\n\n    HighlightImporter importer = new HighlightImporter(tester, String::toString);\n    importer.accept(protobuf.toPath());\n    importer.save();\n\n    // using System;\n    assertThat(tester.highlightingTypeAt(inputFile.key(), 1, 0).get(0)).isEqualTo(TypeOfText.KEYWORD);\n    assertThat(tester.highlightingTypeAt(inputFile.key(), 1, 4).get(0)).isEqualTo(TypeOfText.KEYWORD);\n    assertThat(tester.highlightingTypeAt(inputFile.key(), 1, 5)).isEmpty();\n\n    // [SuppressMessage(\"Maintainability\", \"S2326:Unused type parameters should be removed\")]\n    assertThat(tester.highlightingTypeAt(inputFile.key(), 53, 4)).isEmpty();\n    assertThat(tester.highlightingTypeAt(inputFile.key(), 53, 5).get(0)).isEqualTo(TypeOfText.KEYWORD_LIGHT);\n    assertThat(tester.highlightingTypeAt(inputFile.key(), 53, 19).get(0)).isEqualTo(TypeOfText.KEYWORD_LIGHT);\n    assertThat(tester.highlightingTypeAt(inputFile.key(), 53, 20)).isEmpty();\n    assertThat(tester.highlightingTypeAt(inputFile.key(), 53, 21).get(0)).isEqualTo(TypeOfText.STRING);\n    assertThat(tester.highlightingTypeAt(inputFile.key(), 53, 37).get(0)).isEqualTo(TypeOfText.STRING);\n    assertThat(tester.highlightingTypeAt(inputFile.key(), 53, 38)).isEmpty();\n\n    // if (op1 == 0)\n    assertThat(tester.highlightingTypeAt(inputFile.key(), 27, 23).get(0)).isEqualTo(TypeOfText.CONSTANT);\n\n    assertThat(tester.highlightingTypeAt(inputFile.key(), 9, 0).get(0)).isEqualTo(TypeOfText.COMMENT);\n  }\n\n  @Test\n  public void test_syntax_highlights_overlap() throws FileNotFoundException {\n    SensorContextTester tester = SensorContextTester.create(TEST_DATA_DIR);\n    var inputFile = new TestInputFileBuilder(\"dummyKey\", TEST_FILE_PATH)\n      .setMetadata(new FileMetadata(mock(AnalysisWarnings.class)).readMetadata(new FileReader(TEST_FILE)))\n      .build();\n    tester.fileSystem().add(inputFile);\n    HighlightImporter importer = new HighlightImporter(tester, String::toString);\n    var message = SonarAnalyzer.TokenTypeInfo.newBuilder()\n      .setFilePath(inputFile.filename())\n      .addTokenInfo(SonarAnalyzer.TokenTypeInfo.TokenInfo.newBuilder()\n        .setTokenType(SonarAnalyzer.TokenType.KEYWORD)\n        .setTextRange(SonarAnalyzer.TextRange.newBuilder()\n          .setStartLine(1).setStartOffset(1)\n          .setEndLine(1).setEndOffset(8)\n        ).build())\n      .addTokenInfo(SonarAnalyzer.TokenTypeInfo.TokenInfo.newBuilder()\n        .setTokenType(SonarAnalyzer.TokenType.KEYWORD)\n        .setTextRange(SonarAnalyzer.TextRange.newBuilder()\n          .setStartLine(1).setStartOffset(5)\n          .setEndLine(1).setEndOffset(10)\n        ).build())\n      .addTokenInfo(SonarAnalyzer.TokenTypeInfo.TokenInfo.newBuilder()\n        .setTokenType(SonarAnalyzer.TokenType.KEYWORD)\n        .setTextRange(SonarAnalyzer.TextRange.newBuilder()\n          .setStartLine(2).setStartOffset(2)\n          .setEndLine(2).setEndOffset(11)\n        ).build()\n      ).build();\n    importer.consume(message);\n    assertThatThrownBy(importer::save)\n      .isInstanceOf(RuntimeException.class)\n      .hasMessage(\"The highlighting in the file Program.cs failed with error java.lang.IllegalStateException: Cannot register highlighting rule for characters at \" +\n        \"Range[from [line=1, lineOffset=5] to [line=1, lineOffset=10]] as it overlaps at least one existing rule. The highlight ranges found are \" +\n        \"Range[from [line=1, lineOffset=1] to [line=1, lineOffset=8]] \" +\n        \"Range[from [line=1, lineOffset=5] to [line=1, lineOffset=10]] \" +\n        \"Range[from [line=2, lineOffset=2] to [line=2, lineOffset=11]] \");\n    assertThat(logs.logs(Level.ERROR)).isEmpty();\n  }\n\n  @Test\n  public void test_syntax_highlights_empty() throws FileNotFoundException {\n    SensorContextTester tester = SensorContextTester.create(TEST_DATA_DIR);\n    var inputFile = new TestInputFileBuilder(\"dummyKey\", TEST_FILE_PATH)\n      .setMetadata(new FileMetadata(mock(AnalysisWarnings.class)).readMetadata(new FileReader(TEST_FILE)))\n      .build();\n    tester.fileSystem().add(inputFile);\n    HighlightImporter importer = new HighlightImporter(tester, String::toString);\n    var message = SonarAnalyzer.TokenTypeInfo.newBuilder()\n      .setFilePath(inputFile.filename())\n      .addTokenInfo(SonarAnalyzer.TokenTypeInfo.TokenInfo.newBuilder()\n        .setTokenType(SonarAnalyzer.TokenType.UNKNOWN_TOKENTYPE)\n        .setTextRange(SonarAnalyzer.TextRange.newBuilder()\n          .setStartLine(1).setStartOffset(1)\n          .setEndLine(1).setEndOffset(5)\n        ).build())\n      .build();\n    importer.consume(message);\n    importer.save();\n    assertThat(logs.logs()).isEmpty();\n  }\n\n  @Test\n  public void test_syntax_highlights_outOfRange() throws FileNotFoundException {\n    SensorContextTester tester = SensorContextTester.create(TEST_DATA_DIR);\n    var inputFile = new TestInputFileBuilder(\"dummyKey\", TEST_FILE_PATH)\n      .setMetadata(new FileMetadata(mock(AnalysisWarnings.class)).readMetadata(new FileReader(TEST_FILE)))\n      .build();\n    tester.fileSystem().add(inputFile);\n    HighlightImporter importer = new HighlightImporter(tester, String::toString);\n    var message = SonarAnalyzer.TokenTypeInfo.newBuilder()\n      .setFilePath(inputFile.filename())\n      .addTokenInfo(SonarAnalyzer.TokenTypeInfo.TokenInfo.newBuilder()\n        .setTokenType(SonarAnalyzer.TokenType.KEYWORD)\n        .setTextRange(SonarAnalyzer.TextRange.newBuilder()\n          .setStartLine(1_000_000).setStartOffset(1_000_000)\n          .setEndLine(1_000_000).setEndOffset(1_000_000)\n        ).build())\n      .build();\n    importer.consume(message);\n    assertThatThrownBy(importer::save)\n      .isInstanceOf(IllegalArgumentException.class)\n      .hasMessage(\"1000000 is not a valid line for pointer. File Program.cs has 63 line(s)\");\n  }\n\n  @Test\n  public void test_syntax_highlights_invalidRange() throws FileNotFoundException {\n    SensorContextTester tester = SensorContextTester.create(TEST_DATA_DIR);\n    var inputFile = new TestInputFileBuilder(\"dummyKey\", TEST_FILE_PATH)\n      .setMetadata(new FileMetadata(mock(AnalysisWarnings.class)).readMetadata(new FileReader(TEST_FILE)))\n      .build();\n    tester.fileSystem().add(inputFile);\n    HighlightImporter importer = new HighlightImporter(tester, String::toString);\n    var message = SonarAnalyzer.TokenTypeInfo.newBuilder()\n      .setFilePath(inputFile.filename())\n      .addTokenInfo(SonarAnalyzer.TokenTypeInfo.TokenInfo.newBuilder()\n        .setTokenType(SonarAnalyzer.TokenType.KEYWORD)\n        .setTextRange(SonarAnalyzer.TextRange.newBuilder()\n          .setStartLine(2).setStartOffset(5)\n          .setEndLine(1).setEndOffset(6)\n        ).build())\n      .build();\n    importer.consume(message);\n    logs.setLevel(Level.DEBUG);\n    importer.save();\n    assertThat(logs.logs(Level.DEBUG)).containsOnly(\"\"\"\n      The reported token was out of the range. File Program.cs, Range start_line: 2\n      end_line: 1\n      start_offset: 5\n      end_offset: 6\n      \"\"\");\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/protobuf/LogImporterTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.protobuf;\n\nimport java.io.File;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.sonar.api.testfixtures.log.LogTester;\nimport org.slf4j.event.Level;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\npublic class LogImporterTest {\n  // see src/test/resources/ProtobufImporterTest/README.md for explanation\n  private File regularProtobuf = new File(\"src/test/resources/ProtobufImporterTest/custom-log.pb\");\n  private File unknownProfobuf = new File(\"src/test/resources/ProtobufImporterTest/unknown-log.pb\");\n\n  @Rule\n  public LogTester logTester = new LogTester();\n\n  @Before\n  public void before() {\n    logTester.setLevel(Level.DEBUG);\n  }\n\n  @Test\n  public void importLogMessages() {\n    LogImporter sut = new LogImporter();\n    sut.accept(regularProtobuf.toPath());\n    sut.save();\n\n    assertThat(logTester.logs(Level.DEBUG)).hasSize(2).contains(\"First debug line\", \"Second debug line\");\n    assertThat(logTester.logs(Level.INFO)).containsOnly(\"Single info line\");\n    assertThat(logTester.logs(Level.WARN)).containsOnly(\"Single warning line\");\n    assertThat(logTester.logs(Level.ERROR)).isEmpty();\n  }\n\n  @Test\n  public void unknownLogReportedAsInfoWithWarning() {\n    LogImporter sut = new LogImporter();\n    sut.accept(unknownProfobuf.toPath());\n    sut.save();\n\n    assertThat(logTester.logs(Level.DEBUG)).isEmpty();\n    assertThat(logTester.logs(Level.INFO)).containsOnly(\"Unknown severity for Coverage\");\n    assertThat(logTester.logs(Level.WARN)).containsOnly(\"Unexpected log message severity: UNKNOWN_SEVERITY\");\n    assertThat(logTester.logs(Level.ERROR)).isEmpty();\n  }\n\n  @Test\n  public void clearsInternalStateOnSave() {\n    LogImporter sut = new LogImporter();\n    sut.accept(regularProtobuf.toPath());\n    sut.save();\n    assertThat(logTester.logs()).isNotEmpty();\n    logTester.clear();\n\n    sut.save(); // Previous save cleared internal state so it should be empty this time\n    assertThat(logTester.logs()).isEmpty();\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/protobuf/MethodDeclarationsImporterTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.protobuf;\n\nimport java.io.FileOutputStream;\nimport java.io.IOException;\nimport java.nio.file.Path;\nimport org.junit.Test;\nimport org.sonarsource.dotnet.shared.plugins.MethodDeclarationsCollector;\nimport org.sonarsource.dotnet.shared.plugins.testutils.AutoDeletingTempFile;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.sonarsource.dotnet.protobuf.SonarAnalyzer.MethodDeclarationsInfo;\nimport static org.sonarsource.dotnet.protobuf.SonarAnalyzer.MethodDeclarationInfo;\n\npublic class MethodDeclarationsImporterTest {\n  @Test\n  public void importMethodDeclarationsFromSingleFile() throws IOException {\n    var collector = new MethodDeclarationsCollector();\n    var sut = new MethodDeclarationsImporter(collector);\n    try (var tmp = new AutoDeletingTempFile()) {\n      writeMethodDeclarationsToFile(tmp.getFile(),\n        MethodDeclarationsInfo.newBuilder()\n          .setFilePath(\"C:\\\\MyFilePath\\\\Project0\")\n          .setAssemblyName(\"project0\")\n          .addMethodDeclarations(MethodDeclarationInfo.newBuilder()\n            .setTypeName(\"Type1\")\n            .setMethodName(\"Method1\")\n            .build())\n          .build(),\n        MethodDeclarationsInfo.newBuilder()\n          .setFilePath(\"C:\\\\MyFilePath\\\\Project1\")\n          .setAssemblyName(\"project1\")\n          .addMethodDeclarations(MethodDeclarationInfo.newBuilder()\n            .setTypeName(\"Type2\")\n            .setMethodName(\"Method2\")\n            .build())\n          .addMethodDeclarations(MethodDeclarationInfo.newBuilder()\n            .setTypeName(\"Type3\")\n            .setMethodName(\"Method3\")\n            .build())\n          .build());\n      sut.accept(tmp.getFile());\n      sut.save();\n      assertThat(collector.getMethodDeclarations()).satisfiesExactly(\n        m -> {\n          assertThat(m.getFilePath()).isEqualTo(\"C:\\\\MyFilePath\\\\Project0\");\n          assertThat(m.getAssemblyName()).isEqualTo(\"project0\");\n          assertThat(m.getMethodDeclarationsCount()).isEqualTo(1);\n          assertThat(m.getMethodDeclarations(0).getTypeName()).isEqualTo(\"Type1\");\n          assertThat(m.getMethodDeclarations(0).getMethodName()).isEqualTo(\"Method1\");\n        },\n        m -> {\n          assertThat(m.getFilePath()).isEqualTo(\"C:\\\\MyFilePath\\\\Project1\");\n          assertThat(m.getAssemblyName()).isEqualTo(\"project1\");\n          assertThat(m.getMethodDeclarationsCount()).isEqualTo(2);\n          assertThat(m.getMethodDeclarations(0).getTypeName()).isEqualTo(\"Type2\");\n          assertThat(m.getMethodDeclarations(0).getMethodName()).isEqualTo(\"Method2\");\n          assertThat(m.getMethodDeclarations(1).getTypeName()).isEqualTo(\"Type3\");\n          assertThat(m.getMethodDeclarations(1).getMethodName()).isEqualTo(\"Method3\");\n        });\n    }\n  }\n\n  @Test\n  public void importMethodDeclarationsFromMultipleFile() throws IOException {\n    var collector = new MethodDeclarationsCollector();\n    var sut = new MethodDeclarationsImporter(collector);\n    try (\n      var tmp1 = new AutoDeletingTempFile();\n      var tmp2 = new AutoDeletingTempFile()) {\n      writeMethodDeclarationsToFile(tmp1.getFile(),\n        MethodDeclarationsInfo.newBuilder()\n          .setFilePath(\"C:\\\\MyFilePath\\\\Project0\")\n          .setAssemblyName(\"project0\")\n          .addMethodDeclarations(MethodDeclarationInfo.newBuilder()\n            .setTypeName(\"Type1\")\n            .setMethodName(\"Method1\")\n            .build())\n          .build());\n      writeMethodDeclarationsToFile(tmp2.getFile(),\n        MethodDeclarationsInfo.newBuilder()\n          .setFilePath(\"C:\\\\MyFilePath\\\\Project1\")\n          .setAssemblyName(\"project1\")\n          .addMethodDeclarations(MethodDeclarationInfo.newBuilder()\n            .setTypeName(\"Type2\")\n            .setMethodName(\"Method2\")\n            .build())\n          .addMethodDeclarations(MethodDeclarationInfo.newBuilder()\n            .setTypeName(\"Type3\")\n            .setMethodName(\"Method3\")\n            .build())\n          .build());\n      sut.accept(tmp1.getFile());\n      sut.accept(tmp2.getFile());\n      sut.save();\n      assertThat(collector.getMethodDeclarations()).satisfiesExactly(\n        m -> {\n          assertThat(m.getFilePath()).isEqualTo(\"C:\\\\MyFilePath\\\\Project0\");\n          assertThat(m.getAssemblyName()).isEqualTo(\"project0\");\n          assertThat(m.getMethodDeclarationsCount()).isEqualTo(1);\n          assertThat(m.getMethodDeclarations(0).getTypeName()).isEqualTo(\"Type1\");\n          assertThat(m.getMethodDeclarations(0).getMethodName()).isEqualTo(\"Method1\");\n        },\n        m -> {\n          assertThat(m.getFilePath()).isEqualTo(\"C:\\\\MyFilePath\\\\Project1\");\n          assertThat(m.getAssemblyName()).isEqualTo(\"project1\");\n          assertThat(m.getMethodDeclarationsCount()).isEqualTo(2);\n          assertThat(m.getMethodDeclarations(0).getTypeName()).isEqualTo(\"Type2\");\n          assertThat(m.getMethodDeclarations(0).getMethodName()).isEqualTo(\"Method2\");\n          assertThat(m.getMethodDeclarations(1).getTypeName()).isEqualTo(\"Type3\");\n          assertThat(m.getMethodDeclarations(1).getMethodName()).isEqualTo(\"Method3\");\n        });\n    }\n  }\n\n  private static void writeMethodDeclarationsToFile(Path file, MethodDeclarationsInfo... methodDeclarations) throws IOException {\n    try (var output = new FileOutputStream(file.toFile())) {\n      for (var t : methodDeclarations) {\n        t.writeDelimitedTo(output);\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/protobuf/MetricsImporterTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.protobuf;\n\nimport java.io.File;\nimport java.io.FileNotFoundException;\nimport java.io.FileReader;\nimport java.util.Collection;\nimport java.util.Collections;\nimport org.assertj.core.groups.Tuple;\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.sonar.api.batch.fs.InputFile;\nimport org.sonar.api.batch.fs.internal.DefaultInputFile;\nimport org.sonar.api.batch.fs.internal.FileMetadata;\nimport org.sonar.api.batch.fs.internal.TestInputFileBuilder;\nimport org.sonar.api.batch.sensor.internal.SensorContextTester;\nimport org.sonar.api.batch.sensor.measure.Measure;\nimport org.sonar.api.issue.NoSonarFilter;\nimport org.sonar.api.measures.CoreMetrics;\nimport org.sonar.api.measures.FileLinesContext;\nimport org.sonar.api.measures.FileLinesContextFactory;\nimport org.sonar.api.notifications.AnalysisWarnings;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.ArgumentMatchers.any;\nimport static org.mockito.ArgumentMatchers.anyInt;\nimport static org.mockito.ArgumentMatchers.eq;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.never;\nimport static org.mockito.Mockito.times;\nimport static org.mockito.Mockito.verify;\nimport static org.mockito.Mockito.when;\nimport static org.sonarsource.dotnet.shared.plugins.ProtobufDataImporter.METRICS_FILENAME;\n\npublic class MetricsImporterTest {\n\n  // see src/test/resources/ProtobufImporterTest/README.md for explanation\n  private static final File TEST_DATA_DIR = new File(\"src/test/resources/ProtobufImporterTest\");\n  private static final String TEST_FILE_PATH = \"Program.cs\";\n  private static final File TEST_FILE = new File(TEST_DATA_DIR, TEST_FILE_PATH);\n\n  private SensorContextTester tester = SensorContextTester.create(TEST_DATA_DIR);\n  private File protobuf = new File(TEST_DATA_DIR, METRICS_FILENAME);\n\n  @Before\n  public void before() {\n    assertThat(protobuf).withFailMessage(\"no such file: \" + protobuf).isFile();\n  }\n\n  @Test\n  public void test_metrics_get_imported() throws FileNotFoundException {\n    DefaultInputFile inputFile = new TestInputFileBuilder(\"dummyKey\", TEST_FILE_PATH)\n      .setMetadata(new FileMetadata(mock(AnalysisWarnings.class)).readMetadata(new FileReader(TEST_FILE)))\n      .build();\n    tester.fileSystem().add(inputFile);\n\n    FileLinesContext fileLinesContext = mock(FileLinesContext.class);\n    FileLinesContextFactory fileLinesContextFactory = mock(FileLinesContextFactory.class);\n    when(fileLinesContextFactory.createFor(any(InputFile.class))).thenReturn(fileLinesContext);\n\n    NoSonarFilter noSonarFilter = mock(NoSonarFilter.class);\n\n    new MetricsImporter(tester, fileLinesContextFactory, noSonarFilter, String::toString).accept(protobuf.toPath());\n\n    Collection<Measure> measures = tester.measures(inputFile.key());\n    assertThat(measures).hasSize(7);\n\n    // TODO change test data so that all metrics have different expected values\n\n    assertThat(measures).extracting(\"metric\", \"value\")\n      .containsOnly(\n        Tuple.tuple(CoreMetrics.CLASSES, 4),\n        Tuple.tuple(CoreMetrics.STATEMENTS, 6),\n        Tuple.tuple(CoreMetrics.FUNCTIONS, 3),\n        Tuple.tuple(CoreMetrics.COMPLEXITY, 7),\n        Tuple.tuple(CoreMetrics.COMMENT_LINES, 12),\n        Tuple.tuple(CoreMetrics.COGNITIVE_COMPLEXITY, 18),\n        Tuple.tuple(CoreMetrics.NCLOC, 41));\n\n    verify(noSonarFilter).noSonarInFile(inputFile, Collections.singleton(49));\n\n    verify(fileLinesContext).setIntValue(CoreMetrics.EXECUTABLE_LINES_DATA_KEY, 27, 1);\n    verify(fileLinesContext).setIntValue(CoreMetrics.EXECUTABLE_LINES_DATA_KEY, 29, 1);\n    verify(fileLinesContext).setIntValue(CoreMetrics.EXECUTABLE_LINES_DATA_KEY, 32, 1);\n    verify(fileLinesContext).setIntValue(CoreMetrics.EXECUTABLE_LINES_DATA_KEY, 34, 1);\n    verify(fileLinesContext).setIntValue(CoreMetrics.EXECUTABLE_LINES_DATA_KEY, 37, 1);\n    verify(fileLinesContext).setIntValue(CoreMetrics.EXECUTABLE_LINES_DATA_KEY, 58, 1);\n    verify(fileLinesContext, never()).setIntValue(CoreMetrics.EXECUTABLE_LINES_DATA_KEY, 1, 1);\n\n    verify(fileLinesContext).setIntValue(CoreMetrics.NCLOC_DATA_KEY, 1, 1);\n    verify(fileLinesContext, never()).setIntValue(CoreMetrics.NCLOC_DATA_KEY, 7, 1);\n    verify(fileLinesContext, times(41)).setIntValue(eq(CoreMetrics.NCLOC_DATA_KEY), anyInt(), eq(1));\n  }\n\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/protobuf/RazorImporterTestBase.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.protobuf;\n\nimport java.io.File;\nimport java.io.FileNotFoundException;\nimport java.io.FileReader;\nimport java.nio.file.Paths;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.slf4j.event.Level;\nimport org.sonar.api.batch.fs.internal.DefaultInputFile;\nimport org.sonar.api.batch.fs.internal.FileMetadata;\nimport org.sonar.api.batch.fs.internal.TestInputFileBuilder;\nimport org.sonar.api.batch.sensor.internal.SensorContextTester;\nimport org.sonar.api.notifications.AnalysisWarnings;\nimport org.sonar.api.testfixtures.log.LogTester;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.Mockito.mock;\n\npublic class RazorImporterTestBase {\n  protected static final String TEST_DATA_DIR = \"src/test/resources/RazorProtobufImporter\";\n  protected static final String WEB_PROJECT_PATH = Paths.get(TEST_DATA_DIR, \"WebProject\").toString();\n  protected static final String ROSLYN_4_9_DIR = Paths.get(TEST_DATA_DIR, \"Roslyn 4.9\").toString();\n  protected static final String ROSLYN_4_10_DIR = Paths.get(TEST_DATA_DIR, \"Roslyn 4.10\").toString();\n  protected final SensorContextTester sensorContext = SensorContextTester.create(new File(TEST_DATA_DIR));\n\n  @Rule\n  public LogTester logTester = new LogTester();\n\n  protected static String fileName(String filePath) {\n    return Paths.get(filePath).getFileName().toString();\n  }\n\n  @Before\n  public void setUp() {\n    logTester.setLevel(Level.TRACE);\n  }\n\n  protected DefaultInputFile addTestFileToContext(String testFilePath) throws FileNotFoundException {\n    var testFile = new File(WEB_PROJECT_PATH, testFilePath);\n    assertThat(testFile).withFailMessage(\"no such file: \" + testFilePath).isFile();\n    var inputFile = new TestInputFileBuilder(\"dummyKey\", testFilePath)\n      .setMetadata(new FileMetadata(mock(AnalysisWarnings.class)).readMetadata(new FileReader(testFile)))\n      .build();\n    sensorContext.fileSystem().add(inputFile);\n    return inputFile;\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/protobuf/RazorMetricsImporterTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.protobuf;\n\nimport java.io.File;\nimport java.io.FileNotFoundException;\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.function.Function;\nimport java.util.stream.Collectors;\n\nimport org.assertj.core.groups.Tuple;\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.slf4j.event.Level;\nimport org.sonar.api.batch.fs.InputFile;\nimport org.sonar.api.issue.NoSonarFilter;\nimport org.sonar.api.measures.CoreMetrics;\nimport org.sonar.api.measures.FileLinesContext;\nimport org.sonar.api.measures.FileLinesContextFactory;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.ArgumentMatchers.any;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.times;\nimport static org.mockito.Mockito.verify;\nimport static org.mockito.Mockito.when;\nimport static org.sonarsource.dotnet.shared.plugins.ProtobufDataImporter.METRICS_FILENAME;\n\npublic class RazorMetricsImporterTest extends RazorImporterTestBase {\n  private static final File PROTOBUF_4_9_FILE = new File(ROSLYN_4_9_DIR, METRICS_FILENAME);\n  private static final File PROTOBUF_4_10_FILE = new File(ROSLYN_4_10_DIR, METRICS_FILENAME);\n\n  @Before\n  @Override\n  public void setUp() {\n    super.setUp();\n    assertThat(PROTOBUF_4_9_FILE).withFailMessage(\"no such file: \" + PROTOBUF_4_9_FILE).isFile();\n    assertThat(PROTOBUF_4_10_FILE).withFailMessage(\"no such file: \" + PROTOBUF_4_10_FILE).isFile();\n  }\n\n  @Test\n  public void roslyn_metrics_are_imported_before_4_10() throws FileNotFoundException {\n    var inputFile = addTestFileToContext(\"Cases.razor\");\n    var noSonarFilter = mock(NoSonarFilter.class);\n    var fileLinesContext = mock(FileLinesContext.class);\n    var fileLinesContextFactory = mock(FileLinesContextFactory.class);\n    when(fileLinesContextFactory.createFor(any(InputFile.class))).thenReturn(fileLinesContext);\n\n    new MetricsImporter(sensorContext, fileLinesContextFactory, noSonarFilter, RazorImporterTestBase::fileName).accept(PROTOBUF_4_9_FILE.toPath());\n\n    var measures = sensorContext.measures(inputFile.key());\n    assertThat(measures).hasSize(7);\n\n    assertThat(measures).extracting(\"metric\", \"value\")\n      .containsOnly(\n        Tuple.tuple(CoreMetrics.COMPLEXITY, 5),\n        Tuple.tuple(CoreMetrics.FUNCTIONS, 3),\n        Tuple.tuple(CoreMetrics.COMMENT_LINES, 0),\n        Tuple.tuple(CoreMetrics.COGNITIVE_COMPLEXITY, 1),\n        Tuple.tuple(CoreMetrics.CLASSES, 0),\n        Tuple.tuple(CoreMetrics.NCLOC, 13),\n        Tuple.tuple(CoreMetrics.STATEMENTS, 6));\n\n    verify(noSonarFilter).noSonarInFile(inputFile, Collections.emptySet());\n\n    verifyMetrics(fileLinesContext, CoreMetrics.EXECUTABLE_LINES_DATA_KEY, 8, 23, 24);\n    verifyMetrics(fileLinesContext, CoreMetrics.NCLOC_DATA_KEY, 3, 5, 8, 9, 13, 16, 18, 19, 21, 22, 23, 24, 25);\n\n    assertThat(logTester.logs(Level.DEBUG)).isEmpty();\n  }\n\n  @Test\n  public void roslyn_metrics_are_imported_starting_with_4_10() throws FileNotFoundException {\n    var inputFile = addTestFileToContext(\"Cases.razor\");\n    var noSonarFilter = mock(NoSonarFilter.class);\n    var fileLinesContext = mock(FileLinesContext.class);\n    var fileLinesContextFactory = mock(FileLinesContextFactory.class);\n    when(fileLinesContextFactory.createFor(any(InputFile.class))).thenReturn(fileLinesContext);\n\n    new MetricsImporter(sensorContext, fileLinesContextFactory, noSonarFilter, RazorImporterTestBase::fileName).accept(PROTOBUF_4_10_FILE.toPath());\n\n    var measures = sensorContext.measures(inputFile.key());\n    assertThat(measures).hasSize(7);\n\n    assertThat(measures).extracting(\"metric\", \"value\")\n      .containsOnly(\n        Tuple.tuple(CoreMetrics.COMPLEXITY, 5),\n        Tuple.tuple(CoreMetrics.FUNCTIONS, 3),\n        Tuple.tuple(CoreMetrics.COMMENT_LINES, 0),\n        Tuple.tuple(CoreMetrics.COGNITIVE_COMPLEXITY, 1),\n        Tuple.tuple(CoreMetrics.CLASSES, 0),\n        Tuple.tuple(CoreMetrics.NCLOC, 14),\n        Tuple.tuple(CoreMetrics.STATEMENTS, 3));\n\n    verify(noSonarFilter).noSonarInFile(inputFile, Collections.emptySet());\n\n    verifyMetrics(fileLinesContext, CoreMetrics.EXECUTABLE_LINES_DATA_KEY, 8, 23, 24);\n    verifyMetrics(fileLinesContext, CoreMetrics.NCLOC_DATA_KEY, 1, 3, 5, 8, 9, 13, 16, 18, 19, 21, 22, 23, 24, 25);\n\n    assertThat(logTester.logs(Level.DEBUG)).isEmpty();\n  }\n\n  @Test\n  public void roslyn_metrics_out_of_range_with_4_10_debug_enabled() throws FileNotFoundException {\n    addTestFileToContext(\"_Imports.razor\");\n    var fileLinesContextFactory = mock(FileLinesContextFactory.class);\n    when(fileLinesContextFactory.createFor(any(InputFile.class))).thenReturn(mock(FileLinesContext.class));\n\n    new MetricsImporter(sensorContext, fileLinesContextFactory, mock(NoSonarFilter.class), RazorImporterTestBase::fileName).accept(PROTOBUF_4_10_FILE.toPath());\n\n    assertThat(logTester.logs(Level.DEBUG)).containsExactly(\"The code line number was out of the range. File _Imports.razor, Line 4\");\n  }\n\n  @Test\n  public void roslyn_metrics_out_of_range_with_4_10_debug_disabled() throws FileNotFoundException {\n    logTester.setLevel(Level.INFO);\n    addTestFileToContext(\"_Imports.razor\");\n    var fileLinesContextFactory = mock(FileLinesContextFactory.class);\n    when(fileLinesContextFactory.createFor(any(InputFile.class))).thenReturn(mock(FileLinesContext.class));\n\n    new MetricsImporter(sensorContext, fileLinesContextFactory, mock(NoSonarFilter.class), RazorImporterTestBase::fileName).accept(PROTOBUF_4_10_FILE.toPath());\n\n    assertThat(logTester.logs(Level.DEBUG)).isEmpty();\n  }\n\n  private void verifyMetrics(FileLinesContext context, String key, int... values) {\n    var groups = Arrays.stream(values)\n      .boxed()\n      .collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));\n\n    for (int groupKey : groups.keySet()){\n      verify(context, times(groups.get(groupKey).intValue())).setIntValue(key, groupKey, 1);\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/protobuf/RazorSymbolRefsImporterTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.protobuf;\n\nimport java.io.File;\nimport java.io.FileNotFoundException;\nimport java.nio.file.Paths;\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.slf4j.event.Level;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.sonarsource.dotnet.shared.plugins.ProtobufDataImporter.SYMBOLREFS_FILENAME;\n\npublic class RazorSymbolRefsImporterTest extends RazorImporterTestBase {\n  private static final File PROTOBUF_4_9_FILE = new File(ROSLYN_4_9_DIR, SYMBOLREFS_FILENAME);\n  private static final File PROTOBUF_4_10_FILE = new File(ROSLYN_4_10_DIR, SYMBOLREFS_FILENAME);\n\n  @Override\n  @Before\n  public void setUp() {\n    super.setUp();\n    assertThat(PROTOBUF_4_9_FILE).withFailMessage(\"no such file: \" + PROTOBUF_4_9_FILE).isFile();\n  }\n\n  @Test\n  public void test_symbol_refs_get_imported_cases_before_4_10() throws FileNotFoundException {\n\n    verifySymbolRef(PROTOBUF_4_9_FILE);\n  }\n\n  @Test\n  public void test_symbol_refs_get_imported_cases_after_4_10() throws FileNotFoundException {\n    verifySymbolRef(PROTOBUF_4_10_FILE);\n  }\n\n  @Test\n  public void test_symbol_refs_get_imported_overlapSymbolReferences_before_4_10() throws FileNotFoundException {\n    var inputFile = addTestFileToContext(\"OverlapSymbolReferences.razor\");\n    var sut = new SymbolRefsImporter(sensorContext, s -> Paths.get(s).getFileName().toString());\n    sut.accept(PROTOBUF_4_9_FILE.toPath());\n    sut.save();\n\n    var references = sensorContext.referencesForSymbolAt(inputFile.key(), 1, 1);\n    assertThat(references)\n      .isNotNull() // The symbol declaration can be found,\n      .isEmpty();  // but there are no references, due to the overlap.\n\n    assertThat(logTester.logs(Level.DEBUG)).containsExactly(\n      \"The declaration token at Range[from [line=1, lineOffset=0] to [line=1, lineOffset=17]] overlaps with the referencing token Range[from [line=1, lineOffset=6] to [line=1, lineOffset=23]] in file OverlapSymbolReferences.razor\");\n  }\n\n  @Test\n  public void test_symbol_refs_get_imported_overlapSymbolReferences_after_4_10() throws FileNotFoundException {\n    var inputFile = addTestFileToContext(\"OverlapSymbolReferences.razor\");\n    var sut = new SymbolRefsImporter(sensorContext, s -> Paths.get(s).getFileName().toString());\n    sut.accept(PROTOBUF_4_10_FILE.toPath());\n    sut.save();\n\n    // the issue with overlapping symbols has been fixed in dotnet 8.0.5\n    assertThat(sensorContext.referencesForSymbolAt(inputFile.key(), 1, 11)).hasSize(1);\n    assertThat(logTester.logs(Level.DEBUG)).isEmpty();\n  }\n\n  private void verifySymbolRef(File protobuf) throws FileNotFoundException {\n    var inputFile = addTestFileToContext(\"Cases.razor\");\n    var sut = new SymbolRefsImporter(sensorContext, RazorImporterTestBase::fileName);\n    sut.accept(protobuf.toPath());\n    sut.save();\n\n    // a symbol is defined at this location, and referenced at 3 other locations\n    assertThat(sensorContext.referencesForSymbolAt(inputFile.key(), 8, 15)).hasSize(2);\n\n    // ... other similar examples ...\n    assertThat(sensorContext.referencesForSymbolAt(inputFile.key(), 16, 16)).hasSize(4);\n    assertThat(sensorContext.referencesForSymbolAt(inputFile.key(), 19, 15)).hasSize(3);\n    assertThat(sensorContext.referencesForSymbolAt(inputFile.key(), 21, 17)).isEmpty();\n\n    assertThat(logTester.logs(Level.DEBUG)).isEmpty();\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/protobuf/SymbolRefsImporterTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.protobuf;\n\nimport java.io.File;\nimport java.io.FileNotFoundException;\nimport java.io.FileReader;\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.sonar.api.batch.fs.internal.DefaultInputFile;\nimport org.sonar.api.batch.fs.internal.FileMetadata;\nimport org.sonar.api.batch.fs.internal.TestInputFileBuilder;\nimport org.sonar.api.batch.sensor.internal.SensorContextTester;\nimport org.sonar.api.notifications.AnalysisWarnings;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.Mockito.mock;\nimport static org.sonarsource.dotnet.shared.plugins.ProtobufDataImporter.SYMBOLREFS_FILENAME;\n\npublic class SymbolRefsImporterTest {\n\n  // see src/test/resources/ProtobufImporterTest/README.md for explanation\n  private static final File TEST_DATA_DIR = new File(\"src/test/resources/ProtobufImporterTest\");\n  private static final String TEST_FILE_PATH = \"Program.cs\";\n  private static final File TEST_FILE = new File(TEST_DATA_DIR, TEST_FILE_PATH);\n\n  private SensorContextTester tester = SensorContextTester.create(TEST_DATA_DIR);\n  private File protobuf = new File(TEST_DATA_DIR, SYMBOLREFS_FILENAME);\n  SymbolRefsImporter underTest = new SymbolRefsImporter(tester, String::toString);\n\n  @Before\n  public void setUp() {\n    assertThat(protobuf).withFailMessage(\"no such file: \" + protobuf).isFile();\n  }\n\n  @Test\n  public void test_symbolrefs_get_imported() throws FileNotFoundException {\n    DefaultInputFile inputFile = new TestInputFileBuilder(\"dummyKey\", TEST_FILE_PATH)\n      .setMetadata(new FileMetadata(mock(AnalysisWarnings.class)).readMetadata(new FileReader(TEST_FILE)))\n      .build();\n    tester.fileSystem().add(inputFile);\n\n    underTest.accept(protobuf.toPath());\n    underTest.save();\n\n    // a symbol is defined at this location, and referenced at 3 other locations\n    assertThat(tester.referencesForSymbolAt(inputFile.key(), 25, 34)).hasSize(3);\n\n    // ... other similar examples ...\n    assertThat(tester.referencesForSymbolAt(inputFile.key(), 25, 43)).hasSize(3);\n    assertThat(tester.referencesForSymbolAt(inputFile.key(), 56, 30)).hasSize(1);\n    assertThat(tester.referencesForSymbolAt(inputFile.key(), 56, 37)).hasSize(1);\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/protobuf/TelemetryAggregatorLanguageVersionTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.protobuf;\n\nimport java.util.Arrays;\nimport java.util.Collection;\nimport java.util.List;\nimport java.util.Map;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.junit.runners.Parameterized;\nimport org.junit.runners.Parameterized.Parameters;\nimport org.sonarsource.dotnet.protobuf.SonarAnalyzer;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@RunWith(Parameterized.class)\npublic class TelemetryAggregatorLanguageVersionTest {\n  private final String languageVersion;\n  private final String expectedKey;\n\n  @Parameters\n  public static Collection<Object[]> languageVersionInputs() {\n    // languageVersions(String languageVersion, String expectedKey)\n    return Arrays.asList(new Object[][]\n      {\n        {\"CS12\", \"plugin_key.language_key.language_version.cs12\"},\n        {\"   \", \"plugin_key.language_key.language_version.___\"},\n        {\"With Space\", \"plugin_key.language_key.language_version.with_space\"},\n        {\"Non Word Characters #+!\\\"§$%&/(){}\", \"plugin_key.language_key.language_version.non_word_characters______________\"},\n        {\"Non Ascii Characters äöüß😉\", \"plugin_key.language_key.language_version.non_ascii_characters_______\"},\n      });\n  }\n\n  public TelemetryAggregatorLanguageVersionTest(String languageVersion, String expectedKey)\n  {\n    this.languageVersion = languageVersion;\n    this.expectedKey = expectedKey;\n  }\n\n  @Test\n  public void languageVersions_sanitize() {\n    var sut = new TelemetryAggregator(\"plugin_key\", \"language_key\");\n    var telemetries = List.of(SonarAnalyzer.Telemetry.newBuilder().setProjectFullPath(\"A.csproj\").setLanguageVersion(languageVersion).build());\n    var result = sut.aggregate(telemetries);\n    assertThat(result).singleElement().extracting(Map.Entry::getKey).isEqualTo(expectedKey);\n  }\n\n  @Test\n  public void languageVersions_empty() {\n    var sut = new TelemetryAggregator(\"plugin_key\", \"language_key\");\n    var telemetries = List.of(SonarAnalyzer.Telemetry.newBuilder().setProjectFullPath(\"A.csproj\").setLanguageVersion(\"\").build());\n    var result = sut.aggregate(telemetries);\n    assertThat(result).isEmpty();\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/protobuf/TelemetryImporterTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.protobuf;\n\nimport java.io.FileOutputStream;\nimport java.io.IOException;\nimport java.nio.file.Path;\nimport org.junit.Test;\nimport org.sonarsource.dotnet.protobuf.SonarAnalyzer;\nimport org.sonarsource.dotnet.shared.plugins.TelemetryCollector;\nimport org.sonarsource.dotnet.shared.plugins.testutils.AutoDeletingTempFile;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\npublic class TelemetryImporterTest {\n  private static void WriteTelemetryToFile(Path file, SonarAnalyzer.Telemetry... telemetry) throws IOException {\n    try (var output = new FileOutputStream(file.toFile())) {\n      for (var t : telemetry) {\n        t.writeDelimitedTo(output);\n      }\n    }\n  }\n\n  @Test\n  public void importTelemetryMessagesFromSingleFile() throws IOException {\n    TelemetryCollector collector = new TelemetryCollector();\n    TelemetryImporter sut = new TelemetryImporter(collector);\n    try (var tmp = new AutoDeletingTempFile()) {\n      WriteTelemetryToFile(tmp.getFile(),\n        SonarAnalyzer.Telemetry.newBuilder()\n          .setProjectFullPath(\"A.csproj\")\n          .setLanguageVersion(\"cs12\")\n          .build(),\n        // Technically we only expect a single entry in \"telemetry.pb\", but we read it as if there could be multiple\n        // Let's have UT where we have multiple entries, just to be sure we do not regress here.\n        SonarAnalyzer.Telemetry.newBuilder()\n          .setProjectFullPath(\"B.csproj\")\n          .setLanguageVersion(\"cs12\")\n          .build());\n      sut.accept(tmp.getFile());\n      sut.save();\n      assertThat(collector.getTelemetryMessages()).satisfiesExactly(\n        t -> {\n          assertThat(t.getProjectFullPath()).isEqualTo(\"A.csproj\");\n          assertThat(t.getLanguageVersion()).isEqualTo(\"cs12\");\n        },\n        t -> {\n          assertThat(t.getProjectFullPath()).isEqualTo(\"B.csproj\");\n          assertThat(t.getLanguageVersion()).isEqualTo(\"cs12\");\n        });\n    }\n  }\n\n  @Test\n  public void importTelemetryMessagesFromMultipleFile() throws IOException {\n    TelemetryCollector collector = new TelemetryCollector();\n    TelemetryImporter sut = new TelemetryImporter(collector);\n    try (\n      var tmp1 = new AutoDeletingTempFile();\n      var tmp2 = new AutoDeletingTempFile()) {\n      WriteTelemetryToFile(tmp1.getFile(),\n        SonarAnalyzer.Telemetry.newBuilder()\n          .setProjectFullPath(\"A.csproj\")\n          .setLanguageVersion(\"cs12\")\n          .build());\n      WriteTelemetryToFile(tmp2.getFile(),\n        SonarAnalyzer.Telemetry.newBuilder()\n          .setProjectFullPath(\"B.csproj\")\n          .setLanguageVersion(\"cs12\")\n          .build());\n      sut.accept(tmp1.getFile());\n      sut.accept(tmp2.getFile());\n      sut.save();\n      assertThat(collector.getTelemetryMessages()).satisfiesExactly(\n        t -> {\n          assertThat(t.getProjectFullPath()).isEqualTo(\"A.csproj\");\n          assertThat(t.getLanguageVersion()).isEqualTo(\"cs12\");\n        },\n        t -> {\n          assertThat(t.getProjectFullPath()).isEqualTo(\"B.csproj\");\n          assertThat(t.getLanguageVersion()).isEqualTo(\"cs12\");\n        });\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/sensors/AbstractFileCacheSensorTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.sensors;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.net.URI;\nimport java.nio.file.Path;\nimport java.security.NoSuchAlgorithmException;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.TemporaryFolder;\nimport org.slf4j.event.Level;\nimport org.sonar.api.batch.fs.InputFile;\nimport org.sonar.api.batch.fs.internal.TestInputFileBuilder;\nimport org.sonar.api.batch.sensor.SensorContext;\nimport org.sonar.api.batch.sensor.cache.WriteCache;\nimport org.sonar.api.batch.sensor.internal.DefaultSensorDescriptor;\nimport org.sonar.api.batch.sensor.internal.SensorContextTester;\nimport org.sonar.api.config.internal.MapSettings;\nimport org.sonar.api.testfixtures.log.LogTester;\nimport org.sonarsource.dotnet.shared.plugins.HashProvider;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.ArgumentMatchers.any;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\npublic class AbstractFileCacheSensorTest {\n  private static final String LANGUAGE_KEY = \"language-key\";\n  private static final String LANGUAGE_NAME = \"Language Name\";\n\n  @Rule\n  public TemporaryFolder temp = new TemporaryFolder();\n\n  @Rule\n  public LogTester logTester = new LogTester();\n\n  @Before\n  public void before() {\n    logTester.setLevel(Level.DEBUG);\n  }\n\n  @Test\n  public void should_describe() {\n    var sensorDescriptor = new DefaultSensorDescriptor();\n    var sensor = new FileCacheSensor(new HashProvider());\n    sensor.describe(sensorDescriptor);\n\n    assertThat(sensorDescriptor.name()).isEqualTo(\"Language Name File Caching Sensor\");\n    assertThat(sensorDescriptor.languages()).containsOnly(LANGUAGE_KEY);\n  }\n\n  @Test\n  public void execute_whenAnalyzingPullRequest_logsMessage() throws IOException {\n    var settings = new MapSettings().setProperty(\"sonar.pullrequest.base\", \"42\");\n    var context = SensorContextTester.create(temp.newFolder()).setSettings(settings);\n    var sensor = new FileCacheSensor(new HashProvider());\n\n    sensor.execute(context);\n\n    assertThat(logTester.logs(Level.WARN)).isEmpty();\n    assertThat(logTester.logs(Level.DEBUG)).containsExactly(\"Incremental PR analysis: Cache is not uploaded for pull requests.\");\n  }\n\n  @Test\n  public void execute_whenPullRequestCacheBasePathIsNotConfigured_logsWarning() throws IOException {\n    var context = SensorContextTester.create(temp.newFolder());\n    context.setCacheEnabled(true);\n    var sut = new FileCacheSensor(new HashProvider());\n\n    sut.execute(context);\n\n    assertThat(logTester.logs(Level.WARN)).containsExactly(\"Incremental PR analysis: Could not determine common base path, cache will not be computed. Consider setting 'sonar.projectBaseDir' property.\");\n  }\n\n  @Test\n  public void execute_whenCacheIsDisabled_logsWarning() throws IOException {\n    var context = SensorContextTester.create(temp.newFolder());\n    context.setCacheEnabled(false);\n    var sensor = new FileCacheSensor(new HashProvider());\n\n    sensor.execute(context);\n\n    assertThat(logTester.logs(Level.WARN)).isEmpty();\n    assertThat(logTester.logs(Level.INFO)).containsExactly(\"Incremental PR analysis: Analysis cache is disabled.\");\n  }\n\n  @Test\n  public void execute_whenCacheIsEnabled_itAddsTheFiles() throws IOException, NoSuchAlgorithmException {\n    var hashProvider = mock(HashProvider.class);\n    when(hashProvider.computeHash(any())).thenReturn(new byte[]{42});\n    var context = CreateContextForCaching();\n    var sut = new FileCacheSensor(hashProvider);\n\n    sut.execute(context);\n\n    assertThat(logTester.logs(Level.WARN)).isEmpty();\n    assertThat(logTester.logs(Level.DEBUG)).containsExactly(\n      \"Incremental PR analysis: Preparing to upload file hashes.\",\n      \"Incremental PR analysis: basePathUri: \" + readBasePath(context),\n      \"Incremental PR analysis: Adding hash for 'VB/Bar.vb' to the cache.\",\n      \"Incremental PR analysis: Adding hash for 'CSharp/Foo.cs' to the cache.\"\n    );\n  }\n\n  @Test\n  public void execute_whenHashingFails_itLogsAnError() throws IOException, NoSuchAlgorithmException {\n    var hashProvider = mock(HashProvider.class);\n    when(hashProvider.computeHash(any())).thenThrow(new IOException(\"exception message\"));\n    var context = CreateContextForCaching();\n    var sut = new FileCacheSensor(hashProvider);\n\n    sut.execute(context);\n\n    assertThat(logTester.logs(Level.WARN)).containsExactly(\n      \"Incremental PR analysis: An error occurred while computing the hash for VB/Bar.vb\",\n      \"Incremental PR analysis: An error occurred while computing the hash for CSharp/Foo.cs\"\n    );\n\n    assertThat(logTester.logs(Level.DEBUG)).containsExactly(\n      \"Incremental PR analysis: Preparing to upload file hashes.\",\n      \"Incremental PR analysis: basePathUri: \" + readBasePath(context),\n      \"Incremental PR analysis: Adding hash for 'VB/Bar.vb' to the cache.\",\n      \"Incremental PR analysis: Adding hash for 'CSharp/Foo.cs' to the cache.\"\n    );\n  }\n\n  @Test\n  public void execute_basePathCaseMismatch_succeeds() throws IOException, NoSuchAlgorithmException {\n    var hashProvider = mock(HashProvider.class);\n    when(hashProvider.computeHash(any())).thenReturn(new byte[]{42});\n    var basePath = temp.newFolder();\n    var settings = new MapSettings();\n    var basePathString = basePath.getCanonicalPath();           // C:\\\\Users\\Your.Name\\AppData\\Local\\Temp\\junit4048332838121816264\\junit8308465819713760239\n    var basePathDifferentCasing = basePathString.toLowerCase(); // c:\\\\users\\your.name\\appdata\\local\\temp\\junit4048332838121816264\\junit8308465819713760239\n    settings.setProperty(\"sonar.pullrequest.cache.basepath\", basePathDifferentCasing);\n    var context = CreateContextForCaching(basePath, settings);\n    var sut = new FileCacheSensor(hashProvider);\n    sut.execute(context);\n\n    assertThat(basePathDifferentCasing).isNotEqualTo(basePathString);\n    assertThat(basePathDifferentCasing.toUpperCase()).isEqualTo(basePathString.toUpperCase());\n    assertThat(logTester.logs(Level.WARN)).isEmpty();\n    assertThat(logTester.logs(Level.DEBUG)).containsExactly(\n      \"Incremental PR analysis: Preparing to upload file hashes.\",\n      \"Incremental PR analysis: basePathUri: \" + readBasePath(context), // file:///c:/users/your.name/appdata/local/temp/junit4048332838121816264/junit8308465819713760239/\n      \"Incremental PR analysis: Adding hash for 'VB/Bar.vb' to the cache.\",\n      \"Incremental PR analysis: Adding hash for 'CSharp/Foo.cs' to the cache.\"\n    );\n  }\n\n  @Test\n  public void execute_basePathMismatch_doesNotAddKey() throws IOException {\n    var hashProvider = mock(HashProvider.class);\n    var settings = new MapSettings();\n    var basePathFiles = temp.newFolder();\n    var basePathCache = temp.newFolder();\n    settings.setProperty(\"sonar.pullrequest.cache.basepath\", basePathCache.getCanonicalPath());\n    var context = CreateContextForCaching(basePathFiles, settings);\n    var sut = new FileCacheSensor(hashProvider);\n    sut.execute(context);\n\n    assertThat(logTester.logs(Level.WARN)).isEmpty();\n    assertThat(logTester.logs(Level.DEBUG)).containsExactly(\n      \"Incremental PR analysis: Preparing to upload file hashes.\",\n      \"Incremental PR analysis: basePathUri: \" + Path.of(basePathCache.getCanonicalPath()).toUri(),\n      \"Incremental PR analysis: Could not compute relative path for \" + Path.of(basePathFiles.getCanonicalPath()).toUri() + \"VB/Bar.vb\",\n      \"Incremental PR analysis: Could not compute relative path for \" + Path.of(basePathFiles.getCanonicalPath()).toUri() + \"CSharp/Foo.cs\"\n    );\n  }\n\n  private SensorContext CreateContextForCaching() throws IOException {\n    var basePath = temp.newFolder();\n    var settings = new MapSettings();\n    settings.setProperty(\"sonar.pullrequest.cache.basepath\", basePath.getCanonicalPath());\n    return CreateContextForCaching(basePath, settings);\n  }\n\n  private SensorContext CreateContextForCaching(File basePath, MapSettings settings) {\n    var context = SensorContextTester.create(basePath);\n    context.setCacheEnabled(true);\n    context.setSettings(settings);\n    context.setNextCache(mock(WriteCache.class));\n    context.fileSystem().add(new TestInputFileBuilder(\"foo\", basePath, new File(basePath, \"CSharp/Foo.cs\")).setLanguage(LANGUAGE_KEY).setType(InputFile.Type.MAIN).build());\n    context.fileSystem().add(new TestInputFileBuilder(\"bar\", basePath, new File(basePath, \"VB\\\\Bar.vb\")).setLanguage(LANGUAGE_KEY).setType(InputFile.Type.MAIN).build());\n    return context;\n  }\n\n  private static URI readBasePath(SensorContext context) {\n    return Path.of(context.config().get(\"sonar.pullrequest.cache.basepath\").get()).toUri();\n  }\n\n  private static class FileCacheSensor extends AbstractFileCacheSensor {\n    public FileCacheSensor(HashProvider hashProvider) {\n      super(metadata(), hashProvider);\n    }\n  }\n\n  private static PluginMetadata metadata() {\n    PluginMetadata mock = mock(PluginMetadata.class);\n    when(mock.languageKey()).thenReturn(LANGUAGE_KEY);\n    when(mock.languageName()).thenReturn(LANGUAGE_NAME);\n    return mock;\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/sensors/AnalysisWarningsSensorTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.sensors;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.nio.file.StandardCopyOption;\nimport java.util.Optional;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.TemporaryFolder;\nimport org.mockito.Mockito;\nimport org.sonar.api.batch.sensor.internal.DefaultSensorDescriptor;\nimport org.sonar.api.batch.sensor.internal.SensorContextTester;\nimport org.sonar.api.config.Configuration;\nimport org.sonar.api.notifications.AnalysisWarnings;\nimport org.sonar.api.testfixtures.log.LogTester;\nimport org.slf4j.event.Level;\nimport org.sonarsource.dotnet.shared.plugins.AbstractLanguageConfiguration;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.Mockito.anyString;\nimport static org.mockito.Mockito.doThrow;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.never;\nimport static org.mockito.Mockito.times;\nimport static org.mockito.Mockito.verify;\nimport static org.mockito.Mockito.when;\n\npublic class AnalysisWarningsSensorTest {\n  private static final String PLUGIN_KEY = \"PLUGIN_KEY\";\n  private static final String LANG_KEY = \"LANG_KEY\";\n  private static final String LANG_NAME = \"LANG_NAME\";\n\n  private static File basePath;\n  private static File sonarFolder;\n  private static String absoluteBasePath;\n  private static AnalysisWarnings analysisWarningsMock;\n  private static Configuration configurationMock;\n  private static AbstractLanguageConfiguration languageConfigurationMock;\n\n  @Rule\n  public TemporaryFolder temp = new TemporaryFolder();\n\n  @Rule\n  public LogTester logTester = new LogTester();\n\n  @Before\n  public void before() throws IOException {\n    logTester.setLevel(Level.DEBUG);\n    basePath = temp.newFolder();\n    absoluteBasePath = basePath.toPath().toAbsolutePath().toString();\n    sonarFolder = new File(basePath, \".sonar\");\n    var metadata = mock(PluginMetadata.class);\n    when(metadata.pluginKey()).thenReturn(PLUGIN_KEY);\n    when(metadata.languageKey()).thenReturn(LANG_KEY);\n    when(metadata.languageName()).thenReturn(LANG_NAME);\n\n    configurationMock = mock(Configuration.class);\n    languageConfigurationMock = mock(AbstractLanguageConfiguration.class, Mockito.withSettings()\n      .useConstructor(configurationMock, metadata)\n      .defaultAnswer(Mockito.CALLS_REAL_METHODS));\n    analysisWarningsMock = mock(AnalysisWarnings.class);\n  }\n\n  @Test\n  public void should_describe() {\n    DefaultSensorDescriptor sensorDescriptor = new DefaultSensorDescriptor();\n    AnalysisWarningsSensor sensor = new AnalysisWarningsSensor(languageConfigurationMock, analysisWarningsMock);\n    sensor.describe(sensorDescriptor);\n\n    assertThat(sensorDescriptor.name()).isEqualTo(\"Analysis Warnings import\");\n    assertThat(sensorDescriptor.languages()).isEmpty();\n  }\n\n  @Test\n  public void execute_noWorkingDir_doesNotCallAdd() throws IOException {\n    AnalysisWarningsSensor sensor = new AnalysisWarningsSensor(languageConfigurationMock, analysisWarningsMock);\n    sensor.execute(SensorContextTester.create(temp.newFolder()));\n\n    verify(analysisWarningsMock, never()).addUnique(anyString());\n  }\n\n  @Test\n  public void execute_workingDirWithoutSonarSuffix_doesNotCallAdd() throws IOException {\n    when(configurationMock.get(\"sonar.working.directory\")).thenReturn(Optional.of(\"wrong\"));\n\n    AnalysisWarningsSensor sensor = new AnalysisWarningsSensor(languageConfigurationMock, analysisWarningsMock);\n    sensor.execute(SensorContextTester.create(temp.newFolder()));\n\n    verify(analysisWarningsMock, never()).addUnique(anyString());\n  }\n\n  @Test\n  public void execute_missingWorkingDir_doesNotCallAdd() throws IOException {\n    when(configurationMock.get(\"sonar.working.directory\")).thenReturn(Optional.of(\"wrong_path\\\\.sonar\"));\n\n    AnalysisWarningsSensor sensor = new AnalysisWarningsSensor(languageConfigurationMock, analysisWarningsMock);\n    sensor.execute(SensorContextTester.create(temp.newFolder()));\n\n    verify(analysisWarningsMock, never()).addUnique(anyString());\n    assertThat(logTester.logs()).containsExactly(\n      \"Searching for analysis warnings in wrong_path\",\n      \"Error occurred while loading analysis analysis warnings\");\n  }\n\n  @Test\n  public void execute_workingDirWithNoMatchingFiles_doesNotCallAdd() throws IOException {\n    File unrelatedFile = new File(basePath, \"otherFile.json\");\n    unrelatedFile.createNewFile();\n\n    when(configurationMock.get(\"sonar.working.directory\")).thenReturn(Optional.of(sonarFolder.getAbsolutePath()));\n\n    AnalysisWarningsSensor sensor = new AnalysisWarningsSensor(languageConfigurationMock, analysisWarningsMock);\n    sensor.execute(SensorContextTester.create(basePath));\n\n    verify(analysisWarningsMock, never()).addUnique(anyString());\n    assertThat(logTester.logs()).containsExactly(String.format(\"Searching for analysis warnings in %s\", absoluteBasePath));\n  }\n\n  @Test\n  public void execute_workingDirWithWithMatchingFile_addWarnings() throws IOException {\n    copyFile(\"AnalysisWarnings.AutoScan.json\");\n\n    when(configurationMock.get(\"sonar.working.directory\")).thenReturn(Optional.of(sonarFolder.getAbsolutePath()));\n\n    AnalysisWarningsSensor sensor = new AnalysisWarningsSensor(languageConfigurationMock, analysisWarningsMock);\n    sensor.execute(SensorContextTester.create(basePath));\n\n    verify(analysisWarningsMock, times(1)).addUnique(\"First message\");\n    verify(analysisWarningsMock, times(1)).addUnique(\"Second message\");\n    verify(analysisWarningsMock, times(2)).addUnique(anyString());\n    assertThat(logTester.logs()).containsExactly(\n      String.format(\"Searching for analysis warnings in %s\", absoluteBasePath),\n      String.format(\"Loading analysis warnings from %s\\\\AnalysisWarnings.AutoScan.json\", absoluteBasePath));\n  }\n\n  @Test\n  public void execute_workingDirWithWithMatchingFiles_addWarnings() throws IOException {\n    copyFile(\"AnalysisWarnings.AutoScan.json\");\n    copyFile(\"AnalysisWarnings.Scanner.json\");\n\n    when(configurationMock.get(\"sonar.working.directory\")).thenReturn(Optional.of(sonarFolder.getAbsolutePath()));\n\n    AnalysisWarningsSensor sensor = new AnalysisWarningsSensor(languageConfigurationMock, analysisWarningsMock);\n    sensor.execute(SensorContextTester.create(basePath));\n\n    verify(analysisWarningsMock, times(1)).addUnique(\"First message\");\n    verify(analysisWarningsMock, times(1)).addUnique(\"Second message\");\n    verify(analysisWarningsMock, times(1)).addUnique(\"Scanner message\");\n    verify(analysisWarningsMock, times(3)).addUnique(anyString());\n    assertThat(logTester.logs()).containsExactly(\n      String.format(\"Searching for analysis warnings in %s\", absoluteBasePath),\n      String.format(\"Loading analysis warnings from %s\\\\AnalysisWarnings.AutoScan.json\", absoluteBasePath),\n      String.format(\"Loading analysis warnings from %s\\\\AnalysisWarnings.Scanner.json\", absoluteBasePath));\n  }\n\n  @Test\n  public void execute_errorWhenCallingService_addWarnings_logsError() throws IOException {\n    copyFile(\"AnalysisWarnings.AutoScan.json\");\n\n    when(configurationMock.get(\"sonar.working.directory\")).thenReturn(Optional.of(sonarFolder.getAbsolutePath()));\n    doThrow(RuntimeException.class).when(analysisWarningsMock).addUnique(anyString());\n\n    AnalysisWarningsSensor sensor = new AnalysisWarningsSensor(languageConfigurationMock, analysisWarningsMock);\n    sensor.execute(SensorContextTester.create(basePath));\n\n    assertThat(logTester.logs()).containsExactly(\n      String.format(\"Searching for analysis warnings in %s\", absoluteBasePath),\n      String.format(\"Loading analysis warnings from %s\\\\AnalysisWarnings.AutoScan.json\", absoluteBasePath),\n      \"Error occurred while publishing analysis warnings\");\n  }\n\n  private void copyFile(String fileName) throws IOException {\n    Path sourcePath = Paths.get(\"src/test/resources/analysisWarnings/\" + fileName);\n    Path targetPath = Paths.get(basePath.getAbsolutePath(), fileName);\n    Files.copy(sourcePath, targetPath, StandardCopyOption.REPLACE_EXISTING);\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/sensors/DotNetSensorTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.sensors;\n\nimport java.io.File;\nimport java.nio.file.Path;\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.Optional;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.ExpectedException;\nimport org.junit.rules.TemporaryFolder;\nimport org.slf4j.event.Level;\nimport org.sonar.api.batch.fs.InputFile.Type;\nimport org.sonar.api.batch.fs.internal.DefaultInputFile;\nimport org.sonar.api.batch.fs.internal.TestInputFileBuilder;\nimport org.sonar.api.batch.rule.internal.ActiveRulesBuilder;\nimport org.sonar.api.batch.rule.internal.NewActiveRule;\nimport org.sonar.api.batch.sensor.internal.DefaultSensorDescriptor;\nimport org.sonar.api.batch.sensor.internal.SensorContextTester;\nimport org.sonar.api.notifications.AnalysisWarnings;\nimport org.sonar.api.rule.RuleKey;\nimport org.sonar.api.scanner.sensor.ProjectSensor;\nimport org.sonar.api.testfixtures.log.LogTester;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\nimport org.sonarsource.dotnet.shared.plugins.ProjectTypeCollector;\nimport org.sonarsource.dotnet.shared.plugins.ProtobufDataImporter;\nimport org.sonarsource.dotnet.shared.plugins.RealPathProvider;\nimport org.sonarsource.dotnet.shared.plugins.ReportPathCollector;\nimport org.sonarsource.dotnet.shared.plugins.RoslynDataImporter;\nimport org.sonarsource.dotnet.shared.plugins.RoslynReport;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.ArgumentMatchers.any;\nimport static org.mockito.ArgumentMatchers.eq;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.never;\nimport static org.mockito.Mockito.verify;\nimport static org.mockito.Mockito.verifyNoInteractions;\nimport static org.mockito.Mockito.when;\n\npublic class DotNetSensorTest {\n\n  private static final String REPO_KEY = \"REPO_KEY\";\n  private static final String LANG_KEY = \"LANG_KEY\";\n  private static final String A_DIFFERENT_LANG_KEY = \"another language than the tested plugin\";\n  private static final String LANG_NAME = \"LANG_NAME\";\n  private static final String READ_MORE_LOG = \"Read more about how the SonarScanner for .NET detects test projects: https://github\" +\n    \".com/SonarSource/sonar-scanner-msbuild/wiki/Analysis-of-product-projects-vs.-test-projects\";\n\n  @Rule\n  public LogTester logTester = new LogTester();\n  @Rule\n  public ExpectedException thrown = ExpectedException.none();\n  @Rule\n  public TemporaryFolder temp = new TemporaryFolder();\n\n  private List<Path> reportPaths;\n  private RoslynDataImporter roslynDataImporter = mock(RoslynDataImporter.class);\n  private ProtobufDataImporter protobufDataImporter = mock(ProtobufDataImporter.class);\n  private ReportPathCollector reportPathCollector = mock(ReportPathCollector.class);\n  private ProjectTypeCollector projectTypeCollector = mock(ProjectTypeCollector.class);\n  private AnalysisWarnings analysisWarnings = mock(AnalysisWarnings.class);\n  private PluginMetadata pluginMetadata = mock(PluginMetadata.class);\n\n  private SensorContextTester tester;\n  private DotNetSensor sensor;\n  private Path workDir;\n\n  @Before\n  public void prepare() throws Exception {\n    logTester.setLevel(Level.DEBUG);\n    workDir = temp.newFolder().toPath();\n    reportPaths = Collections.singletonList(workDir.getRoot());\n    tester = SensorContextTester.create(new File(\"src/test/resources\"));\n    tester.fileSystem().setWorkDir(workDir);\n    when(reportPathCollector.protobufDirs()).thenReturn(reportPaths);\n    when(projectTypeCollector.getSummary(LANG_NAME)).thenReturn(Optional.of(\"TEST PROJECTS SUMMARY\"));\n    when(projectTypeCollector.hasProjects()).thenReturn(true);\n    when(pluginMetadata.languageKey()).thenReturn(LANG_KEY);\n    when(pluginMetadata.repositoryKey()).thenReturn(REPO_KEY);\n    when(pluginMetadata.languageName()).thenReturn(LANG_NAME);\n    sensor = new DotNetSensor(pluginMetadata, reportPathCollector, projectTypeCollector, protobufDataImporter, roslynDataImporter, analysisWarnings);\n  }\n\n  @Test\n  public void checkDescriptor() {\n    DefaultSensorDescriptor sensorDescriptor = new DefaultSensorDescriptor();\n    sensor.describe(sensorDescriptor);\n    assertThat(sensorDescriptor.languages()).containsOnly(LANG_KEY);\n    assertThat(sensorDescriptor.name()).isEqualTo(LANG_NAME);\n  }\n\n  @Test\n  public void isProjectSensor() {\n    assertThat(ProjectSensor.class.isAssignableFrom(sensor.getClass())).isTrue();\n  }\n\n  @Test\n  public void whenNoProtobufFiles_shouldNotFail() {\n    addMainFileToFileSystem();\n    when(reportPathCollector.protobufDirs()).thenReturn(Collections.emptyList());\n    when(reportPathCollector.roslynReports()).thenReturn(Collections.singletonList(new RoslynReport(null, workDir.getRoot())));\n    tester.setActiveRules(new ActiveRulesBuilder()\n      .addRule(new NewActiveRule.Builder().setRuleKey(RuleKey.of(REPO_KEY, \"S1186\")).build())\n      .addRule(new NewActiveRule.Builder().setRuleKey(RuleKey.of(REPO_KEY, \"[parameters_key]\")).build())\n      .addRule(new NewActiveRule.Builder().setRuleKey(RuleKey.of(\"roslyn.foo\", \"custom-roslyn\")).build())\n      .build());\n\n    sensor.execute(tester);\n\n    assertThat(logTester.logs(Level.DEBUG)).isEmpty();\n    assertThat(logTester.logs(Level.INFO)).containsExactly(\"TEST PROJECTS SUMMARY\");\n    assertThat(logTester.logs(Level.WARN)).containsExactly(\"No protobuf reports found. The \" + LANG_NAME + \" files will not have highlighting and metrics. You can get help on \" +\n      \"the community forum: https://community.sonarsource.com\");\n    verify(analysisWarnings, never()).addUnique(any());\n    verify(reportPathCollector).protobufDirs();\n    verifyNoInteractions(protobufDataImporter);\n    verify(roslynDataImporter).importRoslynReports(eq(Collections.singletonList(new RoslynReport(null, workDir.getRoot()))), eq(tester),\n      any(RealPathProvider.class));\n  }\n\n  @Test\n  public void whenNoRoslynReport_shouldNotFail() {\n    addMainFileToFileSystem();\n\n    sensor.execute(tester);\n\n    verify(reportPathCollector).protobufDirs();\n    verify(protobufDataImporter).importResults(eq(tester), eq(reportPaths), any(RealPathProvider.class));\n    verifyNoInteractions(roslynDataImporter);\n    assertThat(logTester.logs(Level.WARN)).containsExactly(\"No Roslyn issue reports were found. The \" + LANG_NAME + \" files have not been analyzed. You can get help on the \" +\n      \"community forum: https://community.sonarsource.com\");\n    verify(analysisWarnings, never()).addUnique(any());\n    assertThat(logTester.logs(Level.INFO)).containsExactly(\"TEST PROJECTS SUMMARY\");\n    assertThat(logTester.logs(Level.DEBUG)).isEmpty();\n  }\n\n  @Test\n  public void whenReportsArePresent_thereAreNoWarnings() {\n    addMainFileToFileSystem();\n    addRoslynReports();\n\n    sensor.execute(tester);\n\n    verify(reportPathCollector).protobufDirs();\n    verify(protobufDataImporter).importResults(eq(tester), eq(reportPaths), any(RealPathProvider.class));\n    assertThat(logTester.logs(Level.WARN)).isEmpty();\n    verify(analysisWarnings, never()).addUnique(any());\n    assertThat(logTester.logs(Level.INFO)).containsExactly(\"TEST PROJECTS SUMMARY\");\n    assertThat(logTester.logs(Level.DEBUG)).isEmpty();\n  }\n\n  @Test\n  public void whereThereIsNoSummary_doNoLogSummary() {\n    addMainFileToFileSystem();\n    addRoslynReports();\n    when(projectTypeCollector.getSummary(LANG_NAME)).thenReturn(Optional.empty());\n    sensor.execute(tester);\n    assertThat(logTester.logs(Level.WARN)).isEmpty();\n    assertThat(logTester.logs(Level.INFO)).isEmpty();\n    assertThat(logTester.logs(Level.DEBUG)).isEmpty();\n  }\n\n  @Test\n  public void whenThereAreBothMainAndTestFiles_doNotLog() {\n    addMainFileToFileSystem();\n    addTestFileToFileSystem();\n    // add roslyn reports to avoid warnings in the logs for this test\n    addRoslynReports();\n\n    sensor.execute(tester);\n\n    assertThat(logTester.logs(Level.WARN)).isEmpty();\n    assertThat(logTester.logs(Level.DEBUG)).isEmpty();\n    verify(analysisWarnings, never()).addUnique(any());\n  }\n\n  @Test\n  public void whenThereAreOnlyTestFilesInAnotherLanguage_logOnlySkipSensor() {\n    addFileToFileSystem(\"qix\", Type.TEST, A_DIFFERENT_LANG_KEY);\n\n    sensor.execute(tester);\n    assertThat(logTester.logs(Level.WARN)).isEmpty();\n    verify(analysisWarnings, never()).addUnique(any());\n    assertThat(logTester.logs(Level.DEBUG)).containsExactlyInAnyOrder(\"No files to analyze. Skip Sensor.\");\n  }\n\n  @Test\n  public void whenThereAreOnlyMainFilesInAnotherLanguage_logOnlySkipSensor() {\n    addFileToFileSystem(\"qix\", Type.MAIN, A_DIFFERENT_LANG_KEY);\n\n    sensor.execute(tester);\n    assertThat(logTester.logs(Level.WARN)).isEmpty();\n    verify(analysisWarnings, never()).addUnique(any());\n    assertThat(logTester.logs(Level.DEBUG)).containsExactlyInAnyOrder(\"No files to analyze. Skip Sensor.\");\n  }\n\n  @Test\n  public void whenThereAreOnlyTestFilesInPluginLanguage_andNoMainFilesInAnyLanguage_resultsAreImportedAndLogsConsoleAndAnalysisWarnings() {\n    addTestFileToFileSystem();\n    addRoslynReports();\n\n    sensor.execute(tester);\n\n    assertThat(logTester.logs(Level.WARN))\n      .containsExactly(\"SonarScanner for .NET detected only TEST files and no MAIN files for \" + LANG_NAME + \" in the current solution. \" +\n        \"Only TEST-code related results will be imported to your SonarQube project. \" +\n        \"Many of our rules (e.g. vulnerabilities) are raised only on MAIN-code. \" + READ_MORE_LOG);\n    verify(analysisWarnings).addUnique(\"Your project contains only TEST-code for language \" + LANG_NAME +\n      \" and no MAIN-code for any language, so only TEST-code related results are imported. \" +\n      \"Many of our rules (e.g. vulnerabilities) are raised only on MAIN-code. \" + READ_MORE_LOG);\n    verify(reportPathCollector).protobufDirs();\n    verify(protobufDataImporter).importResults(eq(tester), eq(reportPaths), any(RealPathProvider.class));\n    assertThat(logTester.logs(Level.INFO)).containsExactly(\"TEST PROJECTS SUMMARY\");\n    assertThat(logTester.logs(Level.DEBUG)).isEmpty();\n  }\n\n  @Test\n  public void whenThereAreOnlyTestFilesInPluginLanguage_andMainFilesInAnotherLanguage_resultsAreImportedWithWarningsOnlyInConsole() {\n    addTestFileToFileSystem();\n    addFileToFileSystem(\"qix\", Type.MAIN, A_DIFFERENT_LANG_KEY);\n    addRoslynReports();\n\n    sensor.execute(tester);\n\n    assertThat(logTester.logs(Level.WARN))\n      .containsExactly(\"SonarScanner for .NET detected only TEST files and no MAIN files for \" + LANG_NAME + \" in the current solution. \" +\n        \"Only TEST-code related results will be imported to your SonarQube project. \" +\n        \"Many of our rules (e.g. vulnerabilities) are raised only on MAIN-code. \" + READ_MORE_LOG);\n    verify(reportPathCollector).protobufDirs();\n    verify(protobufDataImporter).importResults(eq(tester), eq(reportPaths), any(RealPathProvider.class));\n    assertThat(logTester.logs(Level.INFO)).containsExactly(\"TEST PROJECTS SUMMARY\");\n    assertThat(logTester.logs(Level.DEBUG)).isEmpty();\n  }\n\n  @Test\n  public void whenThereAreNoFiles_logDebug() {\n    sensor.execute(tester);\n\n    assertThat(logTester.logs(Level.WARN)).isEmpty();\n    verify(analysisWarnings, never()).addUnique(any());\n    assertThat(logTester.logs(Level.DEBUG)).containsExactly(\"No files to analyze. Skip Sensor.\");\n  }\n\n  @Test\n  public void whenThereAreMainFiles_andNoProjects_logToUseScannerForNet() {\n    addMainFileToFileSystem();\n    when(projectTypeCollector.hasProjects()).thenReturn(false);\n\n    sensor.execute(tester);\n\n    assertThat(logTester.logs(Level.WARN)).containsExactly(\"Your project contains \" + LANG_NAME + \" files which cannot be analyzed with the scanner you are using.\" +\n      \" To analyze C# or VB.NET, you must use the SonarScanner for .NET 5.x or higher, see https://redirect.sonarsource.com/doc/install-configure-scanner-msbuild.html\");\n    verify(analysisWarnings, never()).addUnique(any());\n  }\n\n  @Test\n  public void whenThereAreTestFiles_andNoProjects_logToUseScannerForNet() {\n    addTestFileToFileSystem();\n    when(projectTypeCollector.hasProjects()).thenReturn(false);\n\n    sensor.execute(tester);\n\n    assertThat(logTester.logs(Level.WARN)).containsExactly(\"Your project contains \" + LANG_NAME + \" files which cannot be analyzed with the scanner you are using.\" +\n      \" To analyze C# or VB.NET, you must use the SonarScanner for .NET 5.x or higher, see https://redirect.sonarsource.com/doc/install-configure-scanner-msbuild.html\");\n    verify(analysisWarnings, never()).addUnique(any());\n  }\n\n  @Test\n  public void whenThereAreMainAndTestFiles_andNoProjects_logToUseScannerForNet() {\n    addMainFileToFileSystem();\n    addTestFileToFileSystem();\n    when(projectTypeCollector.hasProjects()).thenReturn(false);\n\n    sensor.execute(tester);\n\n    assertThat(logTester.logs(Level.WARN)).containsExactly(\"Your project contains \" + LANG_NAME + \" files which cannot be analyzed with the scanner you are using.\" +\n      \" To analyze C# or VB.NET, you must use the SonarScanner for .NET 5.x or higher, see https://redirect.sonarsource.com/doc/install-configure-scanner-msbuild.html\");\n    verify(analysisWarnings, never()).addUnique(any());\n  }\n\n  @Test\n  public void whenThereAreNoFiles_andNoProjects_logDebug() {\n    when(projectTypeCollector.hasProjects()).thenReturn(false);\n\n    sensor.execute(tester);\n\n    assertThat(logTester.logs(Level.WARN)).isEmpty();\n    verify(analysisWarnings, never()).addUnique(any());\n    assertThat(logTester.logs(Level.DEBUG)).containsExactly(\"No files to analyze. Skip Sensor.\");\n  }\n\n  private void addMainFileToFileSystem() {\n    addFileToFileSystem(\"foo.language\", Type.MAIN, LANG_KEY);\n  }\n\n  private void addTestFileToFileSystem() {\n    addFileToFileSystem(\"bar.language\", Type.TEST, LANG_KEY);\n  }\n\n  private void addFileToFileSystem(String fileName, Type fileType, String language) {\n    DefaultInputFile inputFile = new TestInputFileBuilder(\"mod\", fileName)\n      .setLanguage(language)\n      .setType(fileType)\n      .build();\n    tester.fileSystem().add(inputFile);\n  }\n\n  private void addRoslynReports() {\n    when(reportPathCollector.roslynReports()).thenReturn(Collections.singletonList(new RoslynReport(null, workDir.getRoot())));\n    tester.setActiveRules(new ActiveRulesBuilder()\n      .addRule(new NewActiveRule.Builder().setRuleKey(RuleKey.of(REPO_KEY, \"S1186\")).build())\n      .addRule(new NewActiveRule.Builder().setRuleKey(RuleKey.of(REPO_KEY, \"[parameters_key]\")).build())\n      .addRule(new NewActiveRule.Builder().setRuleKey(RuleKey.of(\"roslyn.foo\", \"custom-roslyn\")).build())\n      .build());\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/sensors/FileTypeSensorTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.sensors;\n\nimport java.io.File;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.TemporaryFolder;\nimport org.mockito.ArgumentCaptor;\nimport org.slf4j.event.Level;\nimport org.sonar.api.batch.fs.InputFile.Type;\nimport org.sonar.api.batch.fs.internal.DefaultInputFile;\nimport org.sonar.api.batch.fs.internal.TestInputFileBuilder;\nimport org.sonar.api.batch.sensor.internal.DefaultSensorDescriptor;\nimport org.sonar.api.batch.sensor.internal.SensorContextTester;\nimport org.sonar.api.config.internal.MapSettings;\nimport org.sonar.api.testfixtures.log.LogTester;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\nimport org.sonarsource.dotnet.shared.plugins.ProjectTypeCollector;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.never;\nimport static org.mockito.Mockito.times;\nimport static org.mockito.Mockito.verify;\nimport static org.mockito.Mockito.verifyNoInteractions;\nimport static org.mockito.Mockito.when;\n\npublic class FileTypeSensorTest {\n  private static final String LANG_KEY = \"LANG_KEY\";\n  private static final String LANG_NAME = \"LANG_NAME\";\n\n  @Rule\n  public LogTester logTester = new LogTester();\n  @Rule\n  public TemporaryFolder temp = new TemporaryFolder();\n\n  private MapSettings settingsMock;\n  private SensorContextTester tester;\n  private ProjectTypeCollector projectTypeCollectorMock;\n  private PluginMetadata pluginMetadataMock;\n  private FileTypeSensor sensor;\n\n  @Before\n  public void prepare() throws Exception {\n    logTester.setLevel(Level.DEBUG);\n    settingsMock = mock(MapSettings.class);\n    tester = SensorContextTester.create(new File(\"src/test/resources\"));\n    tester.fileSystem().setWorkDir(temp.newFolder().toPath());\n    tester.setSettings(settingsMock);\n\n    projectTypeCollectorMock = mock(ProjectTypeCollector.class);\n\n    pluginMetadataMock = mock(PluginMetadata.class);\n    when(pluginMetadataMock.languageKey()).thenReturn(LANG_KEY);\n    when(pluginMetadataMock.languageName()).thenReturn(LANG_NAME);\n\n    sensor = new FileTypeSensor(projectTypeCollectorMock, pluginMetadataMock);\n  }\n\n  @Test\n  public void should_describe() {\n    DefaultSensorDescriptor sensorDescriptor = new DefaultSensorDescriptor();\n    sensor.describe(sensorDescriptor);\n    assertThat(sensorDescriptor.name()).isEqualTo(LANG_NAME + \" Project Type Information\");\n    // should not filter per language\n    assertThat(sensorDescriptor.languages()).isEmpty();\n  }\n\n  @Test\n  public void whenProjectOutPaths_returnsNull_shouldNotAddProjectInfo_shouldNotLogOrCallOtherProperties() {\n    // no setup means that all `settingsMock` methods return null\n    // we make it explicit for the setting we are interested in\n    when(settingsMock.getStringArray(\"sonar.LANG_KEY.analyzer.projectOutPaths\")).thenReturn(null);\n\n    sensor.execute(tester);\n\n    assertThat(logTester.logs()).isEmpty();\n    // make sure that the method is called\n    verify(settingsMock, times(1)).getStringArray(\"sonar.LANG_KEY.analyzer.projectOutPaths\");\n    verifyNoInteractions(projectTypeCollectorMock);\n    // the following should be called ONLY IF the `projectOutPaths` is called\n    verify(settingsMock, never()).getString(\"sonar.projectName\");\n    verify(settingsMock, never()).getString(\"sonar.projectKey\");\n    verify(settingsMock, never()).getString(\"sonar.projectBaseDir\");\n    // make sure that `getString` isn't used with `projectOutPaths`\n    // the `projectOutPaths` property is multi-value and should be queried via getStringArray()\n    verify(settingsMock, never()).getString(\"sonar.LANG_KEY.analyzer.projectOutPaths\");\n    // 'projectOutPath' is deprecated since Scanner for MSBuild 4.x and should not be used\n    verify(settingsMock, never()).getString(\"sonar.LANG_KEY.analyzer.projectOutPath\");\n    verify(settingsMock, never()).getStringArray(\"sonar.LANG_KEY.analyzer.projectOutPath\");\n  }\n\n  @Test\n  public void whenProjectOutPaths_returnsEmpty_shouldNotAddProjectInfo_shouldNotLog() {\n    when(settingsMock.getStringArray(\"sonar.LANG_KEY.analyzer.projectOutPaths\")).thenReturn(new String[]{});\n\n    sensor.execute(tester);\n\n    assertThat(logTester.logs()).isEmpty();\n    verifyNoInteractions(projectTypeCollectorMock);\n  }\n\n  @Test\n  public void whenProjectOutPaths_IsPresent_andLanguageKey_notPresent_shouldNotLog() {\n    when(settingsMock.getStringArray(\"sonar.LANG_KEY.analyzer.projectOutPaths\")).thenReturn(arrayOf(\"foo\\\\.sonarqube\\\\out\\\\0\"));\n    when(pluginMetadataMock.languageKey()).thenReturn(null);\n\n    sensor.execute(tester);\n\n    assertThat(logTester.logs()).isEmpty();\n    verifyNoInteractions(projectTypeCollectorMock);\n  }\n\n  @Test\n  public void shouldLogTheCorrectAnalyzerWorkDir() {\n    // in this test we set languageKey() other than LANG_KEY\n\n    when(settingsMock.getString(\"sonar.projectName\")).thenReturn(\"FOO_PROJ\");\n    when(settingsMock.getString(\"sonar.projectKey\")).thenReturn(\"FOO_PROJ:GUID\");\n    when(settingsMock.getString(\"sonar.projectBaseDir\")).thenReturn(\"BASE DIR\");\n    // the following property specifies the analyzer work dir\n    when(settingsMock.getStringArray(\"sonar.cs.analyzer.projectOutPaths\")).thenReturn(arrayOf(\"CS PATH\"));\n    when(settingsMock.getStringArray(\"sonar.vbnet.analyzer.projectOutPaths\")).thenReturn(arrayOf(\"VB PATH\"));\n\n    when(pluginMetadataMock.languageKey()).thenReturn(\"cs\");\n    sensor.execute(tester);\n    assertThat(logTester.logs(Level.DEBUG)).containsExactly(\"Adding file type information (has MAIN 'false', has TEST 'false') for project 'FOO_PROJ' (project key 'FOO_PROJ:GUID', base dir 'BASE DIR'). For debug info, see ProjectInfo.xml in 'CS PATH'.\");\n\n    logTester.clear();\n    when(pluginMetadataMock.languageKey()).thenReturn(\"vbnet\");\n    sensor.execute(tester);\n    assertThat(logTester.logs(Level.DEBUG)).containsExactly(\"Adding file type information (has MAIN 'false', has TEST 'false') for project 'FOO_PROJ' (project key 'FOO_PROJ:GUID', base dir 'BASE DIR'). For debug info, see ProjectInfo.xml in 'VB PATH'.\");\n  }\n\n  @Test\n  public void whenProjectOutPathsPresent_andHasNoFiles_shouldAddCorrectInfo() {\n    when(settingsMock.getStringArray(\"sonar.LANG_KEY.analyzer.projectOutPaths\")).thenReturn(arrayOf(\"foo\\\\.sonarqube\\\\out\\\\0\"));\n\n    sensor.execute(tester);\n\n    assertThat(logTester.logs()).hasSize(1);\n    // we haven't mocked the base dir and project out settings\n    assertThat(logTester.logs(Level.DEBUG)).containsExactly(\"Adding file type information (has MAIN 'false', has TEST 'false') for project '' (project key '', base dir ''). For debug info, see ProjectInfo.xml in 'foo\\\\.sonarqube\\\\out\\\\0'.\");\n    verify(projectTypeCollectorMock, times(1)).addProjectInfo(false, false);\n  }\n\n  @Test\n  public void whenProjectOutPathsPresent_andHasOnlyTestFiles_shouldAddCorrectInfo() {\n    when(settingsMock.getStringArray(\"sonar.LANG_KEY.analyzer.projectOutPaths\")).thenReturn(arrayOf(\"foo\\\\.sonarqube\\\\out\\\\0\"));\n    addFileToFileSystem(\"foo.language\", Type.TEST);\n\n    sensor.execute(tester);\n\n    assertThat(logTester.logs()).hasSize(1);\n    // we haven't mocked the base dir and project out settings\n    assertThat(logTester.logs(Level.DEBUG)).containsExactly(\"Adding file type information (has MAIN 'false', has TEST 'true') for project '' (project key '', base dir ''). For debug info, see ProjectInfo.xml in 'foo\\\\.sonarqube\\\\out\\\\0'.\");\n    verify(projectTypeCollectorMock, times(1)).addProjectInfo(false, true);\n  }\n\n  @Test\n  public void whenProjectOutPathsPresent_andHasOnlyMainFiles_shouldAddCorrectInfo() {\n    when(settingsMock.getStringArray(\"sonar.LANG_KEY.analyzer.projectOutPaths\")).thenReturn(arrayOf(\"foo\\\\.sonarqube\\\\out\\\\0\"));\n    addFileToFileSystem(\"foo.language\", Type.MAIN);\n\n    sensor.execute(tester);\n\n    assertThat(logTester.logs(Level.DEBUG)).containsExactly(\"Adding file type information (has MAIN 'true', has TEST 'false') for project '' (project key '', base dir ''). For debug info, see ProjectInfo.xml in 'foo\\\\.sonarqube\\\\out\\\\0'.\");\n    verify(projectTypeCollectorMock, times(1)).addProjectInfo(true, false);\n  }\n\n  @Test\n  public void whenProjectOutPathsPresent_andHasBothMainAndTestFiles_shouldAddCorrectInfo() {\n    when(settingsMock.getStringArray(\"sonar.LANG_KEY.analyzer.projectOutPaths\")).thenReturn(arrayOf(\"foo\\\\.sonarqube\\\\out\\\\0\"));\n    addFileToFileSystem(\"foo.language\", Type.MAIN);\n    addFileToFileSystem(\"bar.language\", Type.TEST);\n\n    sensor.execute(tester);\n\n    assertThat(logTester.logs(Level.DEBUG)).containsExactly(\"Adding file type information (has MAIN 'true', has TEST 'true') for project '' (project key '', base dir ''). For debug info, see ProjectInfo.xml in 'foo\\\\.sonarqube\\\\out\\\\0'.\");\n    verify(projectTypeCollectorMock, times(1)).addProjectInfo(true, true);\n  }\n\n  @Test\n  public void whenInvokedMultipleTimes_shouldAddInformationForEachInvocation() {\n    when(settingsMock.getStringArray(\"sonar.LANG_KEY.analyzer.projectOutPaths\")).thenReturn(arrayOf(\"foo\\\\.sonarqube\\\\out\\\\0\"));\n    addFileToFileSystem(\"foo.language\", Type.MAIN);\n    sensor.execute(tester);\n\n    when(settingsMock.getString(\"sonar.LANG_KEY.analyzer.projectOutPaths\")).thenReturn(\"foo\\\\.sonarqube\\\\out\\\\1\");\n    // the file system still has 'foo.language', too - so 2 files for 'bar.proj'\n    addFileToFileSystem(\"bar.language\", Type.TEST);\n    sensor.execute(tester);\n\n    ArgumentCaptor<Boolean> mainFilesCaptor = ArgumentCaptor.forClass(Boolean.class);\n    ArgumentCaptor<Boolean> testFilesCaptor = ArgumentCaptor.forClass(Boolean.class);\n\n    verify(projectTypeCollectorMock, times(2)).addProjectInfo(mainFilesCaptor.capture(), testFilesCaptor.capture());\n\n    assertThat(mainFilesCaptor.getAllValues()).containsExactly(true, true);\n    assertThat(testFilesCaptor.getAllValues()).containsExactly(false, true);\n  }\n\n  @Test\n  public void whenGetStringArray_returnsMultiplePaths_shouldLogConcatenatedValues() {\n    when(settingsMock.getStringArray(\"sonar.LANG_KEY.analyzer.projectOutPaths\")).thenReturn(new String[]{\"foo\\\\.sonarqube\\\\out\\\\0\", \"BAR\", \"QUIX\\\\FOO\"});\n    addFileToFileSystem(\"foo.language\", Type.MAIN);\n    addFileToFileSystem(\"bar.language\", Type.TEST);\n\n    sensor.execute(tester);\n\n    assertThat(logTester.logs(Level.DEBUG)).containsExactly(\"Adding file type information (has MAIN 'true', has TEST 'true') for project '' (project key '', base dir ''). For debug info, see ProjectInfo.xml in 'foo\\\\.sonarqube\\\\out\\\\0, BAR, QUIX\\\\FOO'.\");\n    verify(projectTypeCollectorMock, times(1)).addProjectInfo(true, true);\n  }\n\n  private void addFileToFileSystem(String fileName, Type fileType) {\n    DefaultInputFile inputFile = new TestInputFileBuilder(\"mod\", fileName)\n      .setLanguage(LANG_KEY)\n      .setType(fileType)\n      .build();\n    tester.fileSystem().add(inputFile);\n  }\n\n  private static String[] arrayOf(String input) {\n    return new String[]{input};\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/sensors/LogSensorTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.sensors;\n\nimport java.io.File;\nimport java.util.Collections;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.TemporaryFolder;\nimport org.slf4j.event.Level;\nimport org.sonar.api.batch.sensor.internal.DefaultSensorDescriptor;\nimport org.sonar.api.batch.sensor.internal.SensorContextTester;\nimport org.sonar.api.testfixtures.log.LogTester;\nimport org.sonarsource.dotnet.shared.plugins.ModuleConfiguration;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\npublic class LogSensorTest {\n  private static final String LANG_KEY = \"LANG_KEY\";\n  private static final String LANG_NAME = \"LANG_NAME\";\n  // see src/test/resources/ProtobufImporterTest/README.md for explanation. log.pb is copy of custom-log.pb\n  private static final File TEST_DATA_DIR = new File(\"src/test/resources/LogSensorTest\");\n\n  @Rule\n  public TemporaryFolder temp = new TemporaryFolder();\n\n  @Rule\n  public LogTester logTester = new LogTester();\n\n  private SensorContextTester context;\n  private LogSensor sensor;\n\n  @Before\n  public void prepare() {\n    logTester.setLevel(Level.DEBUG);\n    context = SensorContextTester.create(temp.getRoot());\n    PluginMetadata metadata = mock(PluginMetadata.class);\n    when(metadata.languageKey()).thenReturn(LANG_KEY);\n    when(metadata.languageName()).thenReturn(LANG_NAME);\n    ModuleConfiguration configuration = mock(ModuleConfiguration.class);\n    when(configuration.protobufReportPaths()).thenReturn(Collections.singletonList(TEST_DATA_DIR.toPath()));\n    sensor = new LogSensor(metadata, configuration);\n  }\n\n  @Test\n  public void should_describe() {\n    DefaultSensorDescriptor sensorDescriptor = new DefaultSensorDescriptor();\n    sensor.describe(sensorDescriptor);\n    assertThat(sensorDescriptor.name()).isEqualTo(LANG_NAME + \" Analysis Log\");\n    assertThat(sensorDescriptor.languages()).isEmpty();     // should not filter per language\n  }\n\n  @Test\n  public void executeLogsMessages() {\n    sensor.execute(context);\n    assertThat(logTester.logs()).hasSize(4);\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/sensors/PropertiesSensorTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.sensors;\n\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.util.Collections;\nimport org.junit.Test;\nimport org.sonar.api.batch.sensor.SensorContext;\nimport org.sonar.api.batch.sensor.SensorDescriptor;\nimport org.sonarsource.dotnet.shared.plugins.ModuleConfiguration;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\nimport org.sonarsource.dotnet.shared.plugins.ReportPathCollector;\nimport org.sonarsource.dotnet.shared.plugins.RoslynReport;\n\nimport static org.mockito.ArgumentMatchers.any;\nimport static org.mockito.ArgumentMatchers.anyString;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.never;\nimport static org.mockito.Mockito.verify;\nimport static org.mockito.Mockito.verifyNoInteractions;\nimport static org.mockito.Mockito.verifyNoMoreInteractions;\nimport static org.mockito.Mockito.when;\n\npublic class PropertiesSensorTest {\n  private ModuleConfiguration config = mock(ModuleConfiguration.class);\n  private ReportPathCollector reportPathCollector = mock(ReportPathCollector.class);\n\n  PropertiesSensor underTest = new PropertiesSensor(config, reportPathCollector, pluginMetadata());\n\n  private PluginMetadata pluginMetadata() {\n    PluginMetadata metadata = mock(PluginMetadata.class);\n    when(metadata.languageKey()).thenReturn(\"languageKey\");\n    when(metadata.languageName()).thenReturn(\"Lang Name\");\n    return metadata;\n  }\n\n  @Test\n  public void should_collect_properties_from_multiple_modules() {\n    Path roslyn1 = Paths.get(\"roslyn1\");\n    Path roslyn2 = Paths.get(\"roslyn2\");\n    Path proto1 = Paths.get(\"proto1\");\n    Path proto2 = Paths.get(\"proto2\");\n\n    when(config.roslynReportPaths()).thenReturn(Collections.singletonList(roslyn1));\n    when(config.protobufReportPaths()).thenReturn(Collections.singletonList(proto1));\n    underTest.execute(mock(SensorContext.class));\n    verify(reportPathCollector).addProtobufDirs(Collections.singletonList(proto1));\n    verify(reportPathCollector).addRoslynReport(Collections.singletonList(new RoslynReport(null, roslyn1)));\n\n    when(config.roslynReportPaths()).thenReturn(Collections.singletonList(roslyn2));\n    when(config.protobufReportPaths()).thenReturn(Collections.singletonList(proto2));\n    underTest.execute(mock(SensorContext.class));\n    verify(reportPathCollector).addProtobufDirs(Collections.singletonList(proto2));\n    verify(reportPathCollector).addRoslynReport(Collections.singletonList(new RoslynReport(null, roslyn2)));\n\n    verifyNoMoreInteractions(reportPathCollector);\n  }\n\n  @Test\n  public void should_describe() {\n    SensorDescriptor desc = mock(SensorDescriptor.class);\n    when(desc.name(anyString())).thenReturn(desc);\n\n    underTest.describe(desc);\n\n    verify(desc).name(\"Lang Name Properties\");\n    verify(desc, never()).onlyOnLanguage(any());\n    verify(desc, never()).onlyOnLanguages(any());\n    verify(desc, never()).onlyOnFileType(any());\n    verify(desc, never()).onlyWhenConfiguration(any());\n    verify(desc, never()).createIssuesForRuleRepository(any());\n    verify(desc, never()).createIssuesForRuleRepositories(any());\n  }\n\n  @Test\n  public void should_continue_if_report_path_not_present() {\n    when(config.roslynReportPaths()).thenReturn(Collections.emptyList());\n    when(config.protobufReportPaths()).thenReturn(Collections.emptyList());\n    underTest.execute(mock(SensorContext.class));\n    verifyNoInteractions(reportPathCollector);\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/sensors/TelemetryJsonProcessorTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.sensors;\n\nimport java.util.ArrayList;\nimport java.util.Map;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.TemporaryFolder;\nimport org.mockito.stubbing.Answer;\nimport org.slf4j.event.Level;\nimport org.sonar.api.batch.sensor.internal.DefaultSensorDescriptor;\nimport org.sonar.api.batch.sensor.internal.SensorContextTester;\nimport org.sonar.api.testfixtures.log.LogTester;\nimport org.sonarsource.dotnet.shared.plugins.AbstractLanguageConfiguration;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\nimport org.sonarsource.dotnet.shared.plugins.telemetryjson.TelemetryJsonCollector;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.ArgumentMatchers.anyString;\nimport static org.mockito.Mockito.doAnswer;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.spy;\nimport static org.mockito.Mockito.when;\n\npublic class TelemetryJsonProcessorTest {\n  private static final String PLUGIN_KEY = \"PLUGIN_KEY\";\n  private static final String LANG_KEY = \"LANG_KEY\";\n  private static final String LANG_NAME = \"LANG_NAME\";\n\n  private SensorContextTester context;\n  private TelemetryJsonProcessor sensor;\n\n  @Rule\n  public TemporaryFolder temp = new TemporaryFolder();\n  @Rule\n  public LogTester logTester = new LogTester();\n  private TelemetryJsonCollector collector;\n\n  @Before\n  public void prepare() {\n    logTester.setLevel(Level.DEBUG);\n    context = spy(SensorContextTester.create(temp.getRoot()));\n    PluginMetadata metadata = mock(PluginMetadata.class);\n    when(metadata.pluginKey()).thenReturn(PLUGIN_KEY);\n    when(metadata.languageKey()).thenReturn(LANG_KEY);\n    when(metadata.languageName()).thenReturn(LANG_NAME);\n    var config = mock(AbstractLanguageConfiguration.class);\n    collector = new TelemetryJsonCollector();\n    sensor = new TelemetryJsonProcessor(collector, new TelemetryJsonProjectCollector(collector, config), metadata);\n  }\n\n  @Test\n  public void should_describe() {\n    DefaultSensorDescriptor sensorDescriptor = new DefaultSensorDescriptor();\n    sensor.describe(sensorDescriptor);\n    assertThat(sensorDescriptor.name()).isEqualTo(LANG_NAME + \" Telemetry Json processor\");\n    assertThat(sensorDescriptor.languages()).isEmpty();\n  }\n\n  @Test\n  public void executeTelemetryProcessor_withNullCollector() {\n    sensor = new TelemetryJsonProcessor(null, new TelemetryJsonProjectCollector(new TelemetryJsonCollector(), mock(AbstractLanguageConfiguration.class)), mock(PluginMetadata.class));\n    sensor.execute(context);\n    assertThat(logTester.logs()).containsExactly(\n      \"TelemetryJsonCollector is null, skipping telemetry processing.\");\n  }\n\n  @Test\n  public void executeTelemetryProcessor() {\n    collector.addTelemetry(\"key1\", \"value1\");\n    collector.addTelemetry(\"key2\", \"value2\");\n    final var telemetry = new ArrayList<Map.Entry<String, String>>();\n    doAnswer((Answer<Void>) invocationOnMock -> {\n      // Intercept the call to context.addTelemetryProperty and capture the send telemetry in a list\n      telemetry.add(Map.entry(invocationOnMock.getArgument(0), invocationOnMock.getArgument(1)));\n      return null;\n    }).when(context).addTelemetryProperty(anyString(), anyString());\n    sensor.execute(context);\n    assertThat(telemetry).containsExactlyInAnyOrder(\n      Map.entry(\"key1\", \"value1\"),\n      Map.entry(\"key2\", \"value2\"));\n    assertThat(logTester.logs()).containsExactly(\n      \"Found 2 telemetry messages.\",\n      \"Adding metric: key1=value1\",\n      \"Adding metric: key2=value2\",\n      \"Added 2 metrics.\");\n  }\n\n  @Test\n  public void executeTelemetryProcessorWithTelemetryJsonProjectCollector() {\n    collector.addTelemetry(\"key1\", \"value1\");\n    collector.addTelemetry(\"key2\", \"value2\");\n    var projectSensor = new TelemetryJsonProjectCollector(collector, mock(AbstractLanguageConfiguration.class)) {\n      @Override\n      public void execute() {\n        collector.addTelemetry(Map.entry(\"projectKey1\", \"value1\"));\n        collector.addTelemetry(Map.entry(\"projectKey2\", \"value2\"));\n      }\n    };\n    final var telemetry = new ArrayList<Map.Entry<String, String>>();\n    doAnswer((Answer<Void>) invocationOnMock -> {\n      // Intercept the call to context.addTelemetryProperty and capture the send telemetry in a list\n      telemetry.add(Map.entry(invocationOnMock.getArgument(0), invocationOnMock.getArgument(1)));\n      return null;\n    }).when(context).addTelemetryProperty(anyString(), anyString());\n    var telemetryJsonProcessor = new TelemetryJsonProcessor(collector, projectSensor, mock(PluginMetadata.class));\n    telemetryJsonProcessor.execute(context);\n    assertThat(telemetry).containsExactlyInAnyOrder(\n      Map.entry(\"key1\", \"value1\"),\n      Map.entry(\"key2\", \"value2\"),\n      Map.entry(\"projectKey1\", \"value1\"),\n      Map.entry(\"projectKey2\", \"value2\"));\n    assertThat(logTester.logs()).containsExactly(\n      \"Found 4 telemetry messages.\",\n      \"Adding metric: key1=value1\",\n      \"Adding metric: key2=value2\",\n      \"Adding metric: projectKey1=value1\",\n      \"Adding metric: projectKey2=value2\",\n      \"Added 4 metrics.\");\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/sensors/TelemetryJsonProjectSensorTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.sensors;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.nio.file.Files;\nimport java.util.Map;\nimport java.util.Optional;\nimport java.util.stream.Stream;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.TemporaryFolder;\nimport org.mockito.Mockito;\nimport org.slf4j.event.Level;\nimport org.sonar.api.config.Configuration;\nimport org.sonar.api.testfixtures.log.LogTester;\nimport org.sonarsource.dotnet.shared.plugins.AbstractLanguageConfiguration;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\nimport org.sonarsource.dotnet.shared.plugins.telemetryjson.TelemetryJsonCollector;\nimport org.sonarsource.dotnet.shared.plugins.testutils.FileUtils;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.api.Assertions.tuple;\nimport static org.mockito.ArgumentMatchers.any;\nimport static org.mockito.ArgumentMatchers.eq;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.never;\nimport static org.mockito.Mockito.times;\nimport static org.mockito.Mockito.when;\nimport static org.mockito.Mockito.withSettings;\n\npublic class TelemetryJsonProjectSensorTest {\n  private static final String LANG_NAME = \"LANG_NAME\";\n  private static final File TEST_DATA_DIR = new File(\"src/test/resources/TelemetryJsonSensorTest\");\n\n  @Rule\n  public TemporaryFolder temp = new TemporaryFolder();\n\n  @Rule\n  public LogTester logTester = new LogTester();\n\n  private TelemetryJsonCollector collector;\n  private TelemetryJsonProjectCollector sensor;\n\n  @Before\n  public void prepare() throws IOException {\n    logTester.setLevel(Level.DEBUG);\n    FileUtils.copyDirectory(TEST_DATA_DIR.toPath(), temp.getRoot().toPath());\n    PluginMetadata metadata = mock(PluginMetadata.class);\n    when(metadata.languageName()).thenReturn(LANG_NAME);\n    Configuration configuration = mock(Configuration.class);\n    when(configuration.get(\"sonar.working.directory\")).thenReturn(Optional.of(temp.getRoot().toPath().resolve(\".sonar\").toString()));\n    var languageConfiguration = mock(AbstractLanguageConfiguration.class, withSettings()\n      .useConstructor(configuration, metadata)\n      .defaultAnswer(Mockito.CALLS_REAL_METHODS));\n    collector = new TelemetryJsonCollector();\n    sensor = new TelemetryJsonProjectCollector(collector, languageConfiguration);\n  }\n\n  @Test\n  public void executeTelemetrySensor() {\n    sensor.execute();\n    assertThat(collector.getTelemetry()).extracting(Map.Entry::getKey, Map.Entry::getValue).containsExactlyInAnyOrder(\n      tuple(\"Other.key1\", \"value1\"),\n      tuple(\"S4NET.key1\", \"1\"),\n      tuple(\"S4NET.key2\", \"Value2\"));\n    assertThat(logTester.logs()).containsExactly(\n      \"Searching for telemetry json in \" + temp.getRoot(),\n      \"Parsing of telemetry failed.\");\n    assertThat(temp.getRoot().listFiles(File::isFile)).as(\"Files are marked as processed.\").extracting(File::getName)\n      .containsExactlyInAnyOrder(\"Processed.Telemetry.Other.json\", \"Processed.Telemetry.S4NET.json\");\n  }\n\n  @Test\n  public void executeTelemetrySensorNonExistingOutputDir_printsDebugMessage() {\n    var metadata = mock(PluginMetadata.class);\n    var configuration = mock(Configuration.class);\n    when(configuration.get(\"sonar.working.directory\")).thenReturn(Optional.of(\"nonexistentPath/.sonar\"));\n    var languageConfiguration = mock(AbstractLanguageConfiguration.class, withSettings()\n      .useConstructor(configuration, metadata)\n      .defaultAnswer(Mockito.CALLS_REAL_METHODS));\n    collector = new TelemetryJsonCollector();\n    sensor = new TelemetryJsonProjectCollector(collector, languageConfiguration);\n    sensor.execute();\n    assertThat(collector.getTelemetry()).isEmpty();\n    assertThat(logTester.logs()).containsExactly(\n      \"Searching for telemetry json in nonexistentPath\",\n      \"Error occurred while loading telemetry json\");\n  }\n\n  @Test\n  public void executeTelemetrySensorFileCanNotBeOpened() {\n    try (var mocked = Mockito.mockStatic(Files.class, Mockito.CALLS_REAL_METHODS)) {\n      mocked.when(() -> Files.find(eq(temp.getRoot().toPath()), eq(1), any())).thenReturn(Stream.of(\n        temp.getRoot().toPath().resolve(\"NonexistentFile.json\"),\n        temp.getRoot().toPath().resolve(\"Telemetry.S4NET.json\")));\n      sensor.execute();\n      assertThat(collector.getTelemetry()).extracting(Map.Entry::getKey, Map.Entry::getValue).containsExactlyInAnyOrder(\n        tuple(\"S4NET.key1\", \"1\"),\n        tuple(\"S4NET.key2\", \"Value2\"));\n      assertThat(logTester.logs()).containsExactly(\n        \"Searching for telemetry json in \" + temp.getRoot());\n      assertThat(temp.getRoot().listFiles(File::isFile)).as(\"Found files are marked as processed.\").extracting(File::getName)\n        .containsExactlyInAnyOrder(\"Telemetry.Other.json\", \"Processed.Telemetry.S4NET.json\");\n    }\n  }\n\n  @Test\n  public void executeTelemetrySensorRenamedFileCanNotBeOpened_printsDebugMessage() {\n    try (var mocked = Mockito.mockStatic(Files.class)) {\n      var root = temp.getRoot().toPath();\n      var telemetryJson = root.resolve(\"Telemetry.S4NET.json\");\n      var renamedTelemetryJson = root.resolve(\"Processed.Telemetry.S4NET.json\");\n      var nonexistingTelemetryJson = root.resolve(\"Non-existing.json\");\n      // find returns Telemetry.S4NET.json\n      mocked.when(() -> Files.find(eq(root), eq(1), any())).thenReturn(Stream.of(telemetryJson));\n      // move returns nonexistingTelemetryJson, which causes the FileInputStream to fail\n      mocked.when(() -> Files.move(eq(telemetryJson), eq(renamedTelemetryJson))).thenReturn(nonexistingTelemetryJson);\n      sensor.execute();\n      assertThat(collector.getTelemetry()).isEmpty();\n      assertThat(logTester.logs()).containsExactly(\n        \"Searching for telemetry json in \" + temp.getRoot(),\n        \"Cannot open telemetry file \" + telemetryJson + \", java.io.FileNotFoundException: \" + nonexistingTelemetryJson + \" (The system cannot find the file specified)\");\n    }\n  }\n\n  @Test\n  public void executeTelemetrySensor_markedFilesAreIgnoredOnSecondRun() {\n    try (var mocked = Mockito.mockStatic(Files.class, Mockito.CALLS_REAL_METHODS)) {\n      sensor.execute();\n      mocked.verify(() -> Files.find(eq(temp.getRoot().toPath()), eq(1), any()), times(1));\n      mocked.verify(() -> Files.move(any(), any()), times(2).description(\"Two files are marked as processed.\"));\n    }\n    assertThat(collector.getTelemetry()).extracting(Map.Entry::getKey, Map.Entry::getValue).containsExactlyInAnyOrder(\n      tuple(\"Other.key1\", \"value1\"),\n      tuple(\"S4NET.key1\", \"1\"),\n      tuple(\"S4NET.key2\", \"Value2\"));\n    assertThat(logTester.logs()).containsExactly(\n      \"Searching for telemetry json in \" + temp.getRoot(),\n      \"Parsing of telemetry failed.\");\n    assertThat(temp.getRoot().listFiles(File::isFile)).as(\"Files are marked as processed.\").extracting(File::getName)\n      .containsExactlyInAnyOrder(\"Processed.Telemetry.Other.json\", \"Processed.Telemetry.S4NET.json\");\n    // Second execution. This simulates a second plugin trying to collect the Telemetry.*.json files from the root\n    logTester.clear();\n    try (var mocked = Mockito.mockStatic(Files.class, Mockito.CALLS_REAL_METHODS)) {\n      sensor.execute();\n      mocked.verify(() -> Files.find(eq(temp.getRoot().toPath()), eq(1), any()), times(1));\n      mocked.verify(() -> Files.move(any(), any()), never().description(\"No files are marked as processed, because 'find' returned no files\"));\n    }\n    assertThat(logTester.logs()).containsExactly(\n      \"Searching for telemetry json in \" + temp.getRoot());\n    assertThat(temp.getRoot().listFiles(File::isFile)).as(\"The two marked files are still marked as processed and unchanged.\").extracting(File::getName)\n      .containsExactlyInAnyOrder(\"Processed.Telemetry.Other.json\", \"Processed.Telemetry.S4NET.json\");\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/sensors/TelemetryJsonSensorTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.sensors;\n\nimport java.io.File;\nimport java.nio.file.Paths;\nimport java.util.Arrays;\nimport java.util.List;\nimport java.util.Map;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.TemporaryFolder;\nimport org.slf4j.event.Level;\nimport org.sonar.api.batch.sensor.internal.DefaultSensorDescriptor;\nimport org.sonar.api.batch.sensor.internal.SensorContextTester;\nimport org.sonar.api.testfixtures.log.LogTester;\nimport org.sonarsource.dotnet.shared.plugins.ModuleConfiguration;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\nimport org.sonarsource.dotnet.shared.plugins.telemetryjson.TelemetryJsonCollector;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.api.Assertions.tuple;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\npublic class TelemetryJsonSensorTest {\n  private static final String PLUGIN_KEY = \"PLUGIN_KEY\";\n  private static final String LANG_KEY = \"LANG_KEY\";\n  private static final String LANG_NAME = \"LANG_NAME\";\n  private static final File TEST_DATA_DIR = new File(\"src/test/resources/TelemetryJsonSensorTest\");\n\n  @Rule\n  public TemporaryFolder temp = new TemporaryFolder();\n\n  @Rule\n  public LogTester logTester = new LogTester();\n\n  private SensorContextTester context;\n  private TelemetryJsonCollector collector;\n  private TelemetryJsonSensor sensor;\n\n  @Before\n  public void prepare() {\n    logTester.setLevel(Level.DEBUG);\n    context = SensorContextTester.create(temp.getRoot());\n    PluginMetadata metadata = mock(PluginMetadata.class);\n    when(metadata.pluginKey()).thenReturn(PLUGIN_KEY);\n    when(metadata.languageKey()).thenReturn(LANG_KEY);\n    when(metadata.languageName()).thenReturn(LANG_NAME);\n    ModuleConfiguration configuration = mock(ModuleConfiguration.class);\n    when(configuration.telemetryJsonPaths()).thenReturn(\n      Arrays.stream(TEST_DATA_DIR.toPath().toFile().listFiles(File::isDirectory))\n        .flatMap(x -> Arrays.stream(x.toPath().toFile().listFiles()))\n        .map(File::toPath).toList());\n    collector = new TelemetryJsonCollector();\n    sensor = new TelemetryJsonSensor(collector, metadata, configuration);\n  }\n\n  @Test\n  public void should_describe() {\n    DefaultSensorDescriptor sensorDescriptor = new DefaultSensorDescriptor();\n    sensor.describe(sensorDescriptor);\n    assertThat(sensorDescriptor.name()).isEqualTo(LANG_NAME + \" Telemetry Json\");\n    assertThat(sensorDescriptor.languages()).containsExactlyInAnyOrder(\"LANG_KEY\");\n  }\n\n  @Test\n  public void execute_TelemetrySensor() {\n    sensor.execute(context);\n    assertThat(collector.getTelemetry()).extracting(Map.Entry::getKey, Map.Entry::getValue).containsExactlyInAnyOrder(\n      tuple(\"key1\", \"12\"),\n      tuple(\"key1\", \"42\"),\n      tuple(\"key2\", \"Black\"),\n      tuple(\"key3\", \"true\"),\n      tuple(\"key4\", \"3.14\"),\n      tuple(\"key1\", \"-12\"),\n      tuple(\"key1\", \"-42\"),\n      tuple(\"key2\", \"White\"),\n      tuple(\"key3\", \"false\"),\n      tuple(\"key4\", \"1.41\"),\n      tuple(\"key6\", \"value for key6\"),\n      tuple(\"key7\", \"value for key7\"));\n    assertThat(logTester.logs()).containsExactly(\n      \"\"\"\n        Could not parse telemetry property {\"key5\":[]}\"\"\");\n  }\n\n  @Test\n  public void execute_TelemetrySensor_filesDontExist() {\n    var testContext = SensorContextTester.create(temp.getRoot());\n    var file = Paths.get(TEST_DATA_DIR.toString(), \"nonexistentFile.json\");\n    var pluginMetadata = mock(PluginMetadata.class);\n    when(pluginMetadata.pluginKey()).thenReturn(PLUGIN_KEY);\n    when(pluginMetadata.languageKey()).thenReturn(LANG_KEY);\n    when(pluginMetadata.languageName()).thenReturn(LANG_NAME);\n    var configuration = mock(ModuleConfiguration.class);\n    when(configuration.telemetryJsonPaths()).thenReturn(List.of(file));\n    var telemetryJsonCollector = new TelemetryJsonCollector();\n    var telemetryJsonSensor = new TelemetryJsonSensor(telemetryJsonCollector, pluginMetadata, configuration);\n    telemetryJsonSensor.execute(testContext);\n    assertThat(logTester.logs()).singleElement().isEqualTo(\n      \"Cannot open telemetry file \" + file + \", java.io.FileNotFoundException: \" + file + \" (The system cannot find the file specified)\");\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/sensors/TelemetryProcessorTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.sensors;\n\nimport java.util.ArrayList;\nimport org.apache.commons.lang3.tuple.Pair;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.TemporaryFolder;\nimport org.mockito.stubbing.Answer;\nimport org.slf4j.event.Level;\nimport org.sonar.api.batch.sensor.internal.DefaultSensorDescriptor;\nimport org.sonar.api.batch.sensor.internal.SensorContextTester;\nimport org.sonar.api.testfixtures.log.LogTester;\nimport org.sonarsource.dotnet.protobuf.SonarAnalyzer;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\nimport org.sonarsource.dotnet.shared.plugins.TelemetryCollector;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.ArgumentMatchers.anyString;\nimport static org.mockito.Mockito.doAnswer;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.spy;\nimport static org.mockito.Mockito.when;\n\npublic class TelemetryProcessorTest {\n\n  private static final String PLUGIN_KEY = \"PLUGIN_KEY\";\n  private static final String LANG_KEY = \"LANG_KEY\";\n  private static final String LANG_NAME = \"LANG_NAME\";\n\n  private SensorContextTester context;\n  private TelemetryProcessor sensor;\n\n  @Rule\n  public TemporaryFolder temp = new TemporaryFolder();\n  @Rule\n  public LogTester logTester = new LogTester();\n  private TelemetryCollector collector;\n\n  @Before\n  public void prepare() {\n    logTester.setLevel(Level.DEBUG);\n    context = spy(SensorContextTester.create(temp.getRoot()));\n    PluginMetadata metadata = mock(PluginMetadata.class);\n    when(metadata.pluginKey()).thenReturn(PLUGIN_KEY);\n    when(metadata.languageKey()).thenReturn(LANG_KEY);\n    when(metadata.languageName()).thenReturn(LANG_NAME);\n    collector = new TelemetryCollector();\n    sensor = new TelemetryProcessor(collector, metadata);\n  }\n\n  @Test\n  public void should_describe() {\n    DefaultSensorDescriptor sensorDescriptor = new DefaultSensorDescriptor();\n    sensor.describe(sensorDescriptor);\n    assertThat(sensorDescriptor.name()).isEqualTo(LANG_NAME + \" Telemetry processor\");\n    assertThat(sensorDescriptor.languages()).isEmpty();\n  }\n\n  @Test\n  public void executeTelemetryProcessor_withNullCollector() {\n    sensor = new TelemetryProcessor(null, mock(PluginMetadata.class));\n    sensor.execute(context);\n    assertThat(logTester.logs()).containsExactly(\n      \"TelemetryCollector is null, skipping telemetry processing.\");\n  }\n\n  @Test\n  public void executeTelemetryProcessor() {\n    collector.addTelemetry(\n      SonarAnalyzer.Telemetry.newBuilder()\n        .setLanguageVersion(\"CS12\")\n        .build());\n    collector.addTelemetry(\n      SonarAnalyzer.Telemetry.newBuilder()\n        .setLanguageVersion(\"CS12\")\n        .build());\n    collector.addTelemetry(\n      SonarAnalyzer.Telemetry.newBuilder()\n        .setLanguageVersion(\"CS10\")\n        .build());\n    final var telemetry = new ArrayList<Pair<String, String>>();\n    doAnswer((Answer<Void>) invocationOnMock -> {\n      // Intercept the call to context.addTelemetryProperty and capture the send telemetry in a list\n      telemetry.add(Pair.of(invocationOnMock.getArgument(0), invocationOnMock.getArgument(1)));\n      return null;\n    }).when(context).addTelemetryProperty(anyString(), anyString());\n    sensor.execute(context);\n    assertThat(telemetry).containsExactlyInAnyOrder(\n      Pair.of(\"PLUGIN_KEY.LANG_KEY.language_version.cs10\", \"1\"),\n      Pair.of(\"PLUGIN_KEY.LANG_KEY.language_version.cs12\", \"2\"));\n    assertThat(logTester.logs()).containsExactly(\n      \"Found 3 telemetry messages reported by the analyzers.\",\n      \"Aggregated 2 metrics.\",\n      \"Adding metric: PLUGIN_KEY.LANG_KEY.language_version.cs10=1\",\n      \"Adding metric: PLUGIN_KEY.LANG_KEY.language_version.cs12=2\",\n      \"Added 2 metrics.\");\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/sensors/TelemetrySensorTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.sensors;\n\nimport java.io.File;\nimport java.util.Arrays;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.TemporaryFolder;\nimport org.slf4j.event.Level;\nimport org.sonar.api.batch.sensor.internal.DefaultSensorDescriptor;\nimport org.sonar.api.batch.sensor.internal.SensorContextTester;\nimport org.sonar.api.testfixtures.log.LogTester;\nimport org.sonarsource.dotnet.shared.plugins.ModuleConfiguration;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\nimport org.sonarsource.dotnet.shared.plugins.TelemetryCollector;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\npublic class TelemetrySensorTest {\n  private static final String PLUGIN_KEY = \"PLUGIN_KEY\";\n  private static final String LANG_KEY = \"LANG_KEY\";\n  private static final String LANG_NAME = \"LANG_NAME\";\n  // see src/test/resources/TelemetrySensorTest/README.md for explanation.\n  private static final File TEST_DATA_DIR = new File(\"src/test/resources/TelemetrySensorTest\");\n\n  @Rule\n  public TemporaryFolder temp = new TemporaryFolder();\n  @Rule\n  public LogTester logTester = new LogTester();\n\n  private TelemetryCollector collector;\n  private SensorContextTester context;\n  private TelemetrySensor sensor;\n\n  @Before\n  public void prepare() {\n    logTester.setLevel(Level.DEBUG);\n    context = SensorContextTester.create(temp.getRoot());\n    PluginMetadata metadata = mock(PluginMetadata.class);\n    when(metadata.pluginKey()).thenReturn(PLUGIN_KEY);\n    when(metadata.languageKey()).thenReturn(LANG_KEY);\n    when(metadata.languageName()).thenReturn(LANG_NAME);\n    ModuleConfiguration configuration = mock(ModuleConfiguration.class);\n    when(configuration.protobufReportPaths()).thenReturn(\n      Arrays.stream(TEST_DATA_DIR.toPath().toFile().listFiles(File::isDirectory)).map(File::toPath).toList());\n    collector = new TelemetryCollector();\n    sensor = new TelemetrySensor(collector, metadata, configuration);\n  }\n\n  @Test\n  public void should_describe() {\n    DefaultSensorDescriptor sensorDescriptor = new DefaultSensorDescriptor();\n    sensor.describe(sensorDescriptor);\n    assertThat(sensorDescriptor.name()).isEqualTo(LANG_NAME + \" Telemetry\");\n    assertThat(sensorDescriptor.languages()).containsExactlyInAnyOrder(\"LANG_KEY\");\n  }\n\n  @Test\n  public void executeTelemetrySensor() {\n    sensor.execute(context);\n    assertThat(collector.getTelemetryMessages()).satisfiesExactly(\n      t -> assertThat(t.getLanguageVersion()).isEqualTo(\"CS12\"),\n      t -> assertThat(t.getLanguageVersion()).isEqualTo(\"CS12\"));\n    assertThat(logTester.logs()).containsExactly(\n      \"Start importing metrics.\");\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/telemetryjson/TelemetryJsonAggregatorTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.telemetryjson;\n\nimport java.util.Map;\nimport java.util.stream.Stream;\nimport org.junit.Test;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\npublic class TelemetryJsonAggregatorTest {\n\n  private static final String TARGET_FRAMEWORK_MONIKER = \"dotnetenterprise.s4net.build.target_framework_moniker\";\n  private static final String USING_MICROSOFT_NET_SDK = \"dotnetenterprise.s4net.build.using_microsoft_net_sdk\";\n  private static final String DETERMINISTIC = \"dotnetenterprise.s4net.build.deterministic\";\n  private static final String NUGET_PROJECT_STYLE = \"dotnetenterprise.s4net.build.nuget_project_style\";\n\n  @Test\n  public void flatMapTelemetry_PassesThroughUnknownTelemetry()\n  {\n    var sut = new TelemetryJsonAggregator();\n    var result = sut.flatMapTelemetry(Stream.of(\n      Map.entry(\"someKey\", \"someValue\"),\n      Map.entry(\"someKey\", \"someValue\")));\n    assertThat(result).containsExactly(\n      Map.entry(\"someKey\", \"someValue\"),\n      Map.entry(\"someKey\", \"someValue\"));\n  }\n\n  @Test\n  public void flatMapTelemetry_AllSpecialKeysGetCounted() {\n    var sut = new TelemetryJsonAggregator();\n    var result = sut.flatMapTelemetry(Stream.of(\n      Map.entry(TARGET_FRAMEWORK_MONIKER, \".NETCoreApp,Version=v9.0\"),\n      Map.entry(USING_MICROSOFT_NET_SDK + \".cnt\", \"true\"),\n      Map.entry(DETERMINISTIC + \".cnt\", \"false\"),\n      Map.entry(NUGET_PROJECT_STYLE + \".cnt\", \"PackageReference\")));\n    assertThat(result).containsExactlyInAnyOrder(\n      Map.entry(TARGET_FRAMEWORK_MONIKER + \"._netcoreapp_version_v9_0\", \"1\"),\n      Map.entry(USING_MICROSOFT_NET_SDK + \".true\", \"1\"),\n      Map.entry(DETERMINISTIC + \".false\", \"1\"),\n      Map.entry(NUGET_PROJECT_STYLE + \".packagereference\", \"1\"));\n  }\n\n  @Test\n  public void flatMapTelemetry_MixedAggregatedAndPassThroughKeys()\n  {\n    var sut = new TelemetryJsonAggregator();\n    var result = sut.flatMapTelemetry(Stream.of(\n      Map.entry(TARGET_FRAMEWORK_MONIKER, \".NETCoreApp,Version=v9.0\"),\n      Map.entry(TARGET_FRAMEWORK_MONIKER, \".NETStandard,Version=v1.6\"),\n      Map.entry(\"key1\", \"value1\"),\n      Map.entry(TARGET_FRAMEWORK_MONIKER, \".NETStandard,Version=v2.0\"),\n      Map.entry(TARGET_FRAMEWORK_MONIKER, \".NETFramework,Version=v4.7.2\"),\n      Map.entry(TARGET_FRAMEWORK_MONIKER, \".NETCoreApp,Version=v9.0\"),\n      Map.entry(TARGET_FRAMEWORK_MONIKER, \".NETFramework,Version=v4.7.2\"),\n      Map.entry(\"key2\", \"value2\"),\n      Map.entry(TARGET_FRAMEWORK_MONIKER, \".NETStandard,Version=v1.6\"),\n      Map.entry(TARGET_FRAMEWORK_MONIKER, \".NETCoreApp,Version=v9.0\"),\n      Map.entry(USING_MICROSOFT_NET_SDK + \".cnt\", \"true\"),\n      Map.entry(USING_MICROSOFT_NET_SDK + \".cnt\", \"true\"),\n      Map.entry(DETERMINISTIC + \".cnt\", \"false\"),\n      Map.entry(NUGET_PROJECT_STYLE + \".cnt\", \"PackageReference\")));\n    assertThat(result).containsExactlyInAnyOrder(\n      Map.entry(\"key1\", \"value1\"),\n      Map.entry(\"key2\", \"value2\"),\n      Map.entry(TARGET_FRAMEWORK_MONIKER + \"._netstandard_version_v2_0\", \"1\"),\n      Map.entry(TARGET_FRAMEWORK_MONIKER + \"._netframework_version_v4_7_2\", \"2\"),\n      Map.entry(TARGET_FRAMEWORK_MONIKER + \"._netstandard_version_v1_6\", \"2\"),\n      Map.entry(TARGET_FRAMEWORK_MONIKER + \"._netcoreapp_version_v9_0\", \"3\"),\n      Map.entry(USING_MICROSOFT_NET_SDK + \".true\", \"2\"),\n      Map.entry(DETERMINISTIC + \".false\", \"1\"),\n      Map.entry(NUGET_PROJECT_STYLE + \".packagereference\", \"1\"));\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/telemetryjson/TelemetryJsonCollectorTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.telemetryjson;\n\nimport java.util.Map;\nimport org.junit.Test;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.api.Assertions.tuple;\n\npublic class TelemetryJsonCollectorTest {\n  @Test\n  public void newTelemetryJsonCollectorIsEmpty() {\n    var sut = new TelemetryJsonCollector();\n    assertThat(sut.getTelemetry()).isEmpty();\n  }\n\n  @Test\n  public void addedTelemetryIsRetrievable() {\n    var sut = new TelemetryJsonCollector();\n    sut.addTelemetry(\"key1\", \"value1\");\n    sut.addTelemetry(Map.entry(\"key2\", \"value2\"));\n    assertThat(sut.getTelemetry()).extracting(Map.Entry::getKey, Map.Entry::getValue).containsExactly(\n      tuple(\"key1\", \"value1\"),\n      tuple(\"key2\", \"value2\")\n    );\n  }\n\n  @Test\n  public void duplicateKeysArePreserved() {\n    var sut = new TelemetryJsonCollector();\n    sut.addTelemetry(\"key\", \"value1\");\n    sut.addTelemetry(\"key\", \"value2\");\n    assertThat(sut.getTelemetry()).extracting(Map.Entry::getKey, Map.Entry::getValue).containsExactly(\n      tuple(\"key\", \"value1\"),\n      tuple(\"key\", \"value2\")\n    );\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/telemetryjson/TelemetryJsonParserTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.telemetryjson;\n\nimport java.io.StringReader;\nimport java.util.Map;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.slf4j.event.Level;\nimport org.sonar.api.testfixtures.log.LogTester;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.api.Assertions.tuple;\n\npublic class TelemetryJsonParserTest {\n  @Rule\n  public LogTester logTester = new LogTester();\n\n  @Test\n  public void parseLineDelimitedKeyValuePairsWithDifferentTypes() {\n    var sut = new TelemetryJsonParser();\n    try (var reader = new StringReader(\"\"\"\n        { key1: \"value1\" }\n        { key2: 2 }\n        { key3: true }\n        { \"key4\": 3.14 }\n        { \"key5\": 1, \"key6\": 2 }\n        { key1: Duplicate }\n      \"\"\")) {\n      var result = sut.parse(reader);\n      assertThat(result).extracting(Map.Entry::getKey, Map.Entry::getValue).containsExactly(\n        tuple(\"key1\", \"value1\"),\n        tuple(\"key2\", \"2\"),\n        tuple(\"key3\", \"true\"),\n        tuple(\"key4\", \"3.14\"),\n        tuple(\"key5\", \"1\"),\n        tuple(\"key6\", \"2\"),\n        tuple(\"key1\", \"Duplicate\")\n      );\n      assertThat(logTester.getLogs()).isEmpty();\n    }\n  }\n\n  @Test\n  public void parsingArrayWritesDebug() {\n    logTester.setLevel(Level.DEBUG);\n    var sut = new TelemetryJsonParser();\n    try (var reader = new StringReader(\"[{ key1: 42 }]\")) {\n      var result = sut.parse(reader);\n      assertThat(result).isEmpty();\n      assertThat(logTester.logs()).containsExactly(\"\"\"\n        Could not parse telemetry entry [{\"key1\":42}]\"\"\");\n    }\n  }\n\n  @Test\n  public void parsingComplexPropertyWritesDebug() {\n    logTester.setLevel(Level.DEBUG);\n    var sut = new TelemetryJsonParser();\n    try (var reader = new StringReader(\"\"\"\n        { key1: \"value1\" }\n        { key2: { nested: 42 } }\n        { key3: true }\n      \"\"\")) {\n      var result = sut.parse(reader);\n      assertThat(result).extracting(Map.Entry::getKey, Map.Entry::getValue).containsExactly(\n        tuple(\"key1\", \"value1\"),\n        tuple(\"key3\", \"true\"));\n      assertThat(logTester.logs()).containsExactly(\"\"\"\n        Could not parse telemetry property {\"key2\":{\"nested\":42}}\"\"\");\n    }\n  }\n\n  @Test\n  public void parsingMalformedJsonProperty() {\n    logTester.setLevel(Level.DEBUG);\n    var sut = new TelemetryJsonParser();\n    try (var reader = new StringReader(\"\"\"\n        { key1: 12 }\n        { key2: # }\n        { key3: \"valid\" }\n      \"\"\")) {\n      var result = sut.parse(reader);\n      assertThat(result).extracting(Map.Entry::getKey, Map.Entry::getValue).containsExactly(\n        tuple(\"key1\", \"12\"));\n      assertThat(logTester.logs()).containsExactly(\"Parsing of telemetry failed.\");\n    }\n  }\n\n  @Test\n  public void parsingMalformedJson() {\n    logTester.setLevel(Level.DEBUG);\n    var sut = new TelemetryJsonParser();\n    try (var reader = new StringReader(\"\"\"\n        { key1: 42 }\n        { key2: 12\n        { key3: -1 }\n      \"\"\")) {\n      var result = sut.parse(reader);\n      assertThat(result).extracting(Map.Entry::getKey, Map.Entry::getValue).containsExactly(\n        tuple(\"key1\", \"42\"));\n      assertThat(logTester.logs()).containsExactly(\"Parsing of telemetry failed.\");\n    }\n  }\n\n  @Test\n  public void parsingEmptyJson() {\n    logTester.setLevel(Level.DEBUG);\n    var sut = new TelemetryJsonParser();\n    try (var reader = new StringReader(\"\")) {\n      var result = sut.parse(reader);\n      assertThat(result).extracting(Map.Entry::getKey, Map.Entry::getValue).isEmpty();\n      assertThat(logTester.logs()).containsExactly(\"Telemetry is empty.\");\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/telemetryjson/TelemetryUtilsTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.telemetryjson;\n\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.sonar.api.testfixtures.log.LogTester;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.api.Assertions.assertThatThrownBy;\n\npublic class TelemetryUtilsTest {\n  @Rule\n  public LogTester logTester = new LogTester();\n\n  @Test\n  public void sanitizeKey_returnsExpectedString() {\n    assertThat(TelemetryUtils.sanitizeKey(\"\")).isEmpty();\n    assertThat(TelemetryUtils.sanitizeKey(\"something_.12345_///hello\")).isEqualTo(\"something__12345____hello\");\n    assertThat(TelemetryUtils.sanitizeKey(\".NETFramework,Version=v4.7.2\")).isEqualTo(\"_netframework_version_v4_7_2\");\n  }\n\n  @Test\n  public void sanitizeKey_nullInputThrows() {\n    assertThatThrownBy(() -> TelemetryUtils.sanitizeKey(null))\n      .isInstanceOf(NullPointerException.class);\n  }\n}\n\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/testutils/AutoDeletingTempFile.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.testutils;\n\nimport java.io.IOException;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\n\n// Source: https://stackoverflow.com/a/34050507\npublic class AutoDeletingTempFile implements AutoCloseable {\n\n  private final Path file;\n\n  public AutoDeletingTempFile() throws IOException {\n    file = Files.createTempFile(null, null);\n  }\n\n  public Path getFile() {\n    return file;\n  }\n\n  @Override\n  public void close() throws IOException {\n    Files.deleteIfExists(file);\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/testutils/FileUtils.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.testutils;\n\nimport java.io.IOException;\nimport java.nio.file.FileVisitResult;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.nio.file.SimpleFileVisitor;\nimport java.nio.file.StandardCopyOption;\nimport java.nio.file.attribute.BasicFileAttributes;\n\npublic class FileUtils {\n\n  // see also https://stackoverflow.com/a/10068306\n  public static void copyDirectory(Path sourceDir, Path targetDir) throws IOException {\n    // Ensure the source directory exists\n    if (!Files.exists(sourceDir) || !Files.isDirectory(sourceDir)) {\n      throw new IllegalArgumentException(\"Source must be an existing directory\");\n    }\n\n    // Create the target directory if it does not exist\n    if (!Files.exists(targetDir)) {\n      Files.createDirectories(targetDir);\n    }\n\n    // Walk the file tree and copy each file/directory\n    Files.walkFileTree(sourceDir, new SimpleFileVisitor<Path>() {\n      @Override\n      public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {\n        Path targetPath = targetDir.resolve(sourceDir.relativize(dir));\n        if (!Files.exists(targetPath)) {\n          Files.createDirectory(targetPath);\n        }\n        return FileVisitResult.CONTINUE;\n      }\n\n      @Override\n      public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {\n        Path targetPath = targetDir.resolve(sourceDir.relativize(file));\n        Files.copy(file, targetPath, StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.COPY_ATTRIBUTES);\n        return FileVisitResult.CONTINUE;\n      }\n    });\n  }\n}"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/plugins/testutils/ProtobufFilterTool.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.plugins.testutils;\n\nimport com.google.protobuf.MessageLite;\nimport com.google.protobuf.Parser;\nimport java.io.File;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.OutputStream;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.util.Optional;\nimport java.util.function.Function;\nimport java.util.function.Predicate;\nimport org.sonarsource.dotnet.protobuf.SonarAnalyzer;\n\nimport static org.sonarsource.dotnet.shared.plugins.ProtobufDataImporter.CPDTOKENS_FILENAME;\nimport static org.sonarsource.dotnet.shared.plugins.ProtobufDataImporter.HIGHLIGHT_FILENAME;\nimport static org.sonarsource.dotnet.shared.plugins.ProtobufDataImporter.METRICS_FILENAME;\nimport static org.sonarsource.dotnet.shared.plugins.ProtobufDataImporter.SYMBOLREFS_FILENAME;\n\n/**\n * Utility class to filter protobuf binary files to contain a single input-file (Program.cs)\n *\n * See src/test/resources/ProtobufImporterTest/README.md for explanation.\n */\npublic class ProtobufFilterTool {\n\n  private static final File TEST_DATA_DIR = new File(\"sonar-dotnet-core/src/test/resources/RazorProtobufImporter\");\n  private static final String TEST_FILENAME = \"Cases.razor\";\n\n  public static void main(String[] args) throws IOException {\n    String pathSuffix = \"\\\\\" + TEST_FILENAME;\n\n    rewrite(SYMBOLREFS_FILENAME, SonarAnalyzer.SymbolReferenceInfo.parser(),\n      m -> m.getFilePath().endsWith(pathSuffix), m -> m.toBuilder().setFilePath(TEST_FILENAME).build());\n\n    rewrite(HIGHLIGHT_FILENAME, SonarAnalyzer.TokenTypeInfo.parser(),\n      m -> m.getFilePath().endsWith(pathSuffix), m -> m.toBuilder().setFilePath(TEST_FILENAME).build());\n\n    rewrite(CPDTOKENS_FILENAME, SonarAnalyzer.CopyPasteTokenInfo.parser(),\n      m -> m.getFilePath().endsWith(pathSuffix), m -> m.toBuilder().setFilePath(TEST_FILENAME).build());\n\n    rewrite(METRICS_FILENAME, SonarAnalyzer.MetricsInfo.parser(),\n      m -> m.getFilePath().endsWith(pathSuffix), m -> m.toBuilder().setFilePath(TEST_FILENAME).build());\n\n  }\n\n  private static <T extends MessageLite> void rewrite(String filename, Parser<T> parser, Predicate<T> predicate, Function<T, T> rewriter) {\n    Path path = new File(TEST_DATA_DIR, filename).toPath();\n    readFirstMatching(path, parser, predicate).ifPresent(m -> save(path, rewriter.apply(m)));\n  }\n\n  private static <T> Optional<T> readFirstMatching(Path path, Parser<T> parser, Predicate<T> predicate) {\n    try (InputStream inputStream = Files.newInputStream(path)) {\n      while (true) {\n        T message = parser.parseDelimitedFrom(inputStream);\n        if (message == null) {\n          break;\n        }\n        if (predicate.test(message)) {\n          return Optional.of(message);\n        }\n      }\n    } catch (IOException e) {\n      throw new IllegalStateException(\"unexpected error while parsing protobuf file: \" + path, e);\n    }\n    return Optional.empty();\n  }\n\n  private static <T extends MessageLite> void save(Path path, T message) {\n    try (OutputStream output = Files.newOutputStream(path)) {\n      message.writeDelimitedTo(output);\n    } catch (IOException e) {\n      throw new IllegalStateException(\"could not save message to file: \" + path + \" \" + message, e);\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/sarif/SarifParser01And04Test.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.sarif;\n\nimport com.google.gson.JsonObject;\nimport com.google.gson.JsonParser;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\nimport java.util.ArrayList;\nimport java.util.Collection;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.ExpectedException;\nimport org.mockito.InOrder;\nimport org.mockito.Mockito;\nimport org.sonar.api.scanner.fs.InputProject;\nimport org.sonar.api.testfixtures.log.LogTester;\n\nimport static java.util.Collections.emptyList;\nimport static org.mockito.ArgumentMatchers.eq;\nimport static org.mockito.Mockito.inOrder;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.never;\nimport static org.mockito.Mockito.only;\nimport static org.mockito.Mockito.times;\nimport static org.mockito.Mockito.verify;\nimport static org.mockito.Mockito.verifyNoMoreInteractions;\n\npublic class SarifParser01And04Test {\n\n  @Rule\n  public LogTester logTester = new LogTester();\n\n  @Rule\n  public ExpectedException thrown = ExpectedException.none();\n\n  private JsonObject getRoot(String fileName) throws IOException {\n    return JsonParser.parseString(new String(Files.readAllBytes(Paths.get(\"src/test/resources/SarifParserTest/\" + fileName)), StandardCharsets.UTF_8)).getAsJsonObject();\n  }\n\n  @Test\n  public void should_not_fail_ony_empty_report() throws IOException {\n    SarifParserCallback callback = mock(SarifParserCallback.class);\n    new SarifParser01And04(null, getRoot(\"v0_1_empty_issues.json\"), String::toString).accept(callback);\n    new SarifParser01And04(null, getRoot(\"v0_1_empty_no_issues.json\"), String::toString).accept(callback);\n    new SarifParser01And04(null, getRoot(\"v0_4_empty_no_results.json\"), String::toString).accept(callback);\n    new SarifParser01And04(null, getRoot(\"v0_4_empty_no_runLogs.json\"), String::toString).accept(callback);\n    new SarifParser01And04(null, getRoot(\"v0_4_empty_results.json\"), String::toString).accept(callback);\n    new SarifParser01And04(null, getRoot(\"v0_4_empty_runLogs.json\"), String::toString).accept(callback);\n    verify(callback, never()).onIssue(Mockito.anyString(), Mockito.isNull(), Mockito.any(Location.class), Mockito.anyCollection(), Mockito.eq(false));\n  }\n\n  // VS 2015 Update 1\n  @Test\n  public void sarif_version_0_1() throws IOException {\n    SarifParserCallback callback = mock(SarifParserCallback.class);\n\n    new SarifParser01And04(null, getRoot(\"v0_1.json\"), String::toString).accept(callback);\n\n    Location location = new Location(\"C:\\\\Foo.cs\", \"Remove this unused method parameter \\\"args\\\".\", 43, 55, 44, 57);\n    verify(callback).onIssue(\"S1172\", null, location, emptyList(), false);\n    location = new Location(\"C:\\\\Bar.cs\", \"There is just a full message.\", 2, 2, 4, 4);\n    verify(callback).onIssue(\"CA1000\", null, location, emptyList(), false);\n    verify(callback, times(2)).onIssue(Mockito.anyString(), Mockito.isNull(), Mockito.any(Location.class), Mockito.anyCollection(), Mockito.eq(false));\n\n    verify(callback).onProjectIssue(\"AssemblyLevelRule\", null, null, \"This is an assembly level Roslyn issue with no location.\");\n    verify(callback).onProjectIssue(\"NoAnalysisTargetsLocation\", null, null, \"No analysis targets, report at assembly level.\");\n    verify(callback, times(2)).onProjectIssue(Mockito.anyString(), Mockito.isNull(), Mockito.nullable(InputProject.class), Mockito.anyString());\n  }\n\n  // VS 2015 Update 2\n  @Test\n  public void sarif_version_0_4() throws IOException {\n    SarifParserCallback callback = mock(SarifParserCallback.class);\n    new SarifParser01And04(null, getRoot(\"v0_4.json\"), String::toString).accept(callback);\n\n    InOrder inOrder = inOrder(callback);\n\n    Location location = new Location(\"C:\\\\Foo`1.cs\", \"Remove this commented out code.\", 58, 12, 58, 50);\n    inOrder.verify(callback).onIssue(\"S125\", null, location, emptyList(), false);\n    verify(callback, only()).onIssue(Mockito.anyString(), Mockito.isNull(), Mockito.any(Location.class), Mockito.anyCollection(), Mockito.eq(false));\n\n    verify(callback, never()).onProjectIssue(Mockito.anyString(), Mockito.isNull(), Mockito.any(InputProject.class), Mockito.anyString());\n  }\n\n  @Test\n  public void sarif_version_0_4_file_level() throws IOException {\n    SarifParserCallback callback = mock(SarifParserCallback.class);\n    new SarifParser01And04(null, getRoot(\"v0_4_file_level_issue.json\"), String::toString).accept(callback);\n\n    InOrder inOrder = inOrder(callback);\n    inOrder.verify(callback).onFileIssue(eq(\"S104\"), Mockito.isNull(), Mockito.anyString(), eq(emptyList()), eq(\"Dummy\"));\n    inOrder.verify(callback).onFileIssue(eq(\"S105\"), Mockito.isNull(), Mockito.anyString(), eq(emptyList()), eq(\"Dummy\"));\n    Location location = new Location(\"C:\\\\Program.cs\", \"Dummy\", 1, 0, 1, 1);\n    inOrder.verify(callback).onIssue(\"S105\", null, location, emptyList(), false);\n    location = new Location(\"C:\\\\Program.cs\", \"Dummy\", 2, 0, 2, 1);\n    inOrder.verify(callback).onIssue(\"S106\", null, location, emptyList(), false);\n    location = new Location(\"C:\\\\Program.cs\", \"Dummy\", 2, 3, 2, 4);\n    inOrder.verify(callback).onIssue(\"S107\", null, location, emptyList(), false);\n\n    verifyNoMoreInteractions(callback);\n  }\n\n  @Test\n  public void sarif_version_0_4_secondary_locations() throws IOException {\n    SarifParserCallback callback = mock(SarifParserCallback.class);\n    new SarifParser01And04(null, getRoot(\"v0_4_secondary_locations.json\"), String::toString).accept(callback);\n\n    InOrder inOrder = inOrder(callback);\n    Location primaryLocation = new Location(\"c:\\\\primary.cs\", \"Refactor this method to reduce its Cognitive Complexity from 30 to the 15 allowed\",\n      54, 21, 54, 24);\n    Collection<Location> secondaryLocations = new ArrayList<>();\n    secondaryLocations.add(new Location(\"c:\\\\secondary1.cs\", \"+1\", 56, 12, 56, 14));\n    secondaryLocations.add(new Location(\"c:\\\\secondary2.cs\", \"+2 (incl 1 for nesting)\", 65, 16, 65, 18));\n    inOrder.verify(callback).onIssue(\"S3776\", null, primaryLocation, secondaryLocations, false);\n    verifyNoMoreInteractions(callback);\n  }\n\n  @Test\n  public void sarif_version_0_4_secondary_locations_no_messages() throws IOException {\n    SarifParserCallback callback = mock(SarifParserCallback.class);\n    new SarifParser01And04(null, getRoot(\"v0_4_secondary_locations_no_messages.json\"), String::toString).accept(callback);\n\n    InOrder inOrder = inOrder(callback);\n    Location primaryLocation = new Location(\"c:\\\\primary.cs\", \"Refactor this method to reduce its Cognitive Complexity from 30 to the 15 allowed\",\n      54, 21, 54, 24);\n    Collection<Location> secondaryLocations = new ArrayList<>();\n    secondaryLocations.add(new Location(\"c:\\\\secondary1.cs\", null, 56, 12, 56, 14));\n    secondaryLocations.add(new Location(\"c:\\\\secondary2.cs\", null, 65, 16, 65, 18));\n    inOrder.verify(callback).onIssue(\"S3776\", null, primaryLocation, secondaryLocations, false);\n    verifyNoMoreInteractions(callback);\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/sarif/SarifParser10Test.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.sarif;\n\nimport com.google.gson.JsonObject;\nimport com.google.gson.JsonParser;\nimport java.io.File;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\nimport java.util.ArrayList;\nimport java.util.Collection;\nimport java.util.Collections;\nimport java.util.regex.Pattern;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.TemporaryFolder;\nimport org.mockito.InOrder;\nimport org.sonar.api.testfixtures.log.LogTester;\nimport org.slf4j.event.Level;\n\nimport static java.util.Collections.emptyList;\nimport static org.mockito.ArgumentMatchers.any;\nimport static org.mockito.ArgumentMatchers.anyCollection;\nimport static org.mockito.ArgumentMatchers.anyString;\nimport static org.mockito.ArgumentMatchers.eq;\nimport static org.mockito.ArgumentMatchers.isNull;\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.Mockito.inOrder;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.never;\nimport static org.mockito.Mockito.times;\nimport static org.mockito.Mockito.verify;\nimport static org.mockito.Mockito.verifyNoMoreInteractions;\n\npublic class SarifParser10Test {\n\n  @Rule\n  public LogTester logTester = new LogTester();\n\n  @Rule\n  public TemporaryFolder temp = new TemporaryFolder();\n\n  private File baseDir;\n\n  @Before\n  public void prepare() throws Exception {\n    baseDir = temp.newFolder();\n  }\n\n  private JsonObject getRoot(String fileName) throws IOException {\n    String json = new String(Files.readAllBytes(Paths.get(\"src/test/resources/SarifParserTest/\" + fileName)), StandardCharsets.UTF_8);\n    json = json.replaceAll(Pattern.quote(\"%BASEDIR%\"), baseDir.toURI().toASCIIString());\n    return JsonParser.parseString(json).getAsJsonObject();\n  }\n\n  // VS 2015 Update 3\n  @Test\n  public void sarif_version_1_0() throws IOException {\n    SarifParserCallback callback = mock(SarifParserCallback.class);\n    new SarifParser10(null, getRoot(\"v1_0.json\"), String::toString).accept(callback);\n\n    InOrder inOrder = inOrder(callback);\n    inOrder.verify(callback).onRule(anyString(), anyString(), anyString(), anyString(), anyString());\n    Location location = new Location(new File(baseDir, \"Foo.cs\").getAbsolutePath(), \"One issue per line\", 1, 0, 1, 13);\n    inOrder.verify(callback).onIssue(\"S1234\", \"warning\", location, Collections.emptyList(), false);\n    location = new Location(new File(baseDir, \"Bar.cs\").getAbsolutePath(), \"One issue per line\", 2, 0, 2, 33);\n    inOrder.verify(callback).onIssue(\"S1234\", \"warning\", location, Collections.emptyList(), false);\n    verifyNoMoreInteractions(callback);\n  }\n\n  @Test\n  public void sarif_version_1_0_file_level() throws IOException {\n    SarifParserCallback callback = mock(SarifParserCallback.class);\n    new SarifParser10(null, getRoot(\"v1_0_file_level_issue.json\"), String::toString).accept(callback);\n\n    InOrder inOrder = inOrder(callback);\n    String filePath = new File(baseDir, \"Program.cs\").getAbsolutePath();\n    inOrder.verify(callback).onFileIssue(\"S104\", \"warning\", filePath, emptyList(), \"Some dummy message\");\n    inOrder.verify(callback).onFileIssue(eq(\"S105\"), isNull(), eq(filePath), eq(emptyList()), eq(\"Some dummy message\"));\n    Location location = new Location(filePath, \"Some dummy message\", 1, 0, 1, 1);\n    inOrder.verify(callback).onIssue(\"S105\", \"warning\", location, Collections.emptyList(), false);\n    location = new Location(filePath, \"Some dummy message\", 1, 0, 2, 0);\n    inOrder.verify(callback).onIssue(\"S105\", \"warning\", location, Collections.emptyList(), false);\n\n    inOrder.verify(callback).onFileIssue(\"S106\", \"warning\", filePath, emptyList(), \"Some dummy message\");\n\n    verifyNoMoreInteractions(callback);\n  }\n\n  @Test\n  public void sarif_version_1_0_suppressed() throws IOException {\n    SarifParserCallback callback = mock(SarifParserCallback.class);\n    new SarifParser10(null, getRoot(\"v1_0_suppressed.json\"), String::toString).accept(callback);\n\n    InOrder inOrder = inOrder(callback);\n    Location location = new Location(new File(baseDir, \"Bar.cs\").getAbsolutePath(), \"One issue per line\", 2, 0, 2, 33);\n    inOrder.verify(callback).onRule(\"S1234\", \"One issue per line\", \"This rule will create an issue for every source code line\", \"warning\", \"Test\");\n    inOrder.verify(callback).onIssue(\"S1234\", \"warning\", location, emptyList(), false);\n    verifyNoMoreInteractions(callback);\n  }\n\n  // #934\n  @Test\n  public void sarif_version_1_0_file_name_with_illegal_char() throws IOException {\n    SarifParserCallback callback = mock(SarifParserCallback.class);\n    new SarifParser10(null, getRoot(\"v1_0_file_name_with_illegal_char.json\"), String::toString).accept(callback);\n\n    InOrder inOrder = inOrder(callback);\n    inOrder.verify(callback).onRule(\"S1118\", \"Utility classes should not have public constructors\",\n      \"Utility classes, which are collections of static members, are not meant to be instantiated. Even abstract utility classes, which can be extended, should not have public \" +\n        \"constructors.\",\n      \"warning\", \"Sonar Code Smell\");\n    Location location = new Location(new File(baseDir, \"ConsoleApplication1/P@!$#&+-=r^{}og_r()a m[1].cs\").getAbsolutePath(),\n      \"Add a 'protected' constructor or the 'static' keyword to the class declaration.\", 9, 10, 9, 17);\n    inOrder.verify(callback).onIssue(\"S1118\", \"warning\", location, emptyList(), false);\n    verifyNoMoreInteractions(callback);\n  }\n\n  @Test\n  public void sarif_version_1_0_no_message() throws IOException {\n    SarifParserCallback callback = mock(SarifParserCallback.class);\n    new SarifParser10(null, getRoot(\"v1_0_no_message.json\"), String::toString).accept(callback);\n\n    verify(callback).onRule(anyString(), anyString(), anyString(), anyString(), anyString());\n    // In this report we have 2 issues, one without a message and another one with message.\n    // We will push to SQ/SC only the occurrence with message. For the other, a warning is logged.\n    verify(callback, times(1)).onIssue(eq(\"S1234\"), eq(\"warning\"), any(), any(), eq(false));\n    verifyNoMoreInteractions(callback);\n\n    assertThat(logTester.logs(Level.WARN)).hasSize(1);\n    assertThat(logTester.logs(Level.WARN).get(0)).startsWith(\"Issue raised without a message for rule S1234. Content: {\\\"ruleId\\\":\\\"S1234\\\",\\\"level\\\":\\\"warning\\\",\" +\n      \"\\\"locations\\\":[{\\\"resultFile\\\":{\\\"uri\\\":\\\"file:\");\n  }\n\n  @Test\n  public void sarif_version_1_0_no_location() throws IOException {\n    SarifParserCallback callback = mock(SarifParserCallback.class);\n    new SarifParser10(null, getRoot(\"v1_0_no_location.json\"), String::toString).accept(callback);\n\n    InOrder inOrder = inOrder(callback);\n    inOrder.verify(callback).onRule(anyString(), anyString(), anyString(), anyString(), anyString());\n    inOrder.verify(callback).onProjectIssue(\"S1234\", \"warning\", null, \"One issue per line\");\n    verifyNoMoreInteractions(callback);\n  }\n\n  @Test\n  public void sarif_version_1_0_empty_location() throws IOException {\n    SarifParserCallback callback = mock(SarifParserCallback.class);\n    new SarifParser10(null, getRoot(\"v1_0_empty_location.json\"), String::toString).accept(callback);\n\n    InOrder inOrder = inOrder(callback);\n    inOrder.verify(callback).onRule(anyString(), anyString(), anyString(), anyString(), anyString());\n    inOrder.verify(callback).onProjectIssue(\"S1234\", \"warning\", null, \"One issue per line\");\n    verifyNoMoreInteractions(callback);\n  }\n\n  @Test\n  public void sarif_version_1_0_more_rules() throws IOException {\n    SarifParserCallback callback = mock(SarifParserCallback.class);\n    new SarifParser10(null, getRoot(\"v1_0_another.json\"), String::toString).accept(callback);\n\n    InOrder inOrder = inOrder(callback);\n    inOrder.verify(callback, times(3)).onRule(anyString(), anyString(), anyString(), anyString(), anyString());\n    String filePath = new File(baseDir, \"Program.cs\").getAbsolutePath();\n    Location location = new Location(filePath,\n      \"Add a nested comment explaining why this method is empty, throw a \\\"NotSupportedException\\\" or complete the implementation.\",\n      26, 20, 26, 24);\n    inOrder.verify(callback).onIssue(\"S1186\", \"warning\", location, emptyList(), false);\n    location = new Location(filePath, \"Remove this unused method parameter \\\"args\\\".\", 26, 25, 26, 38);\n    inOrder.verify(callback).onIssue(\"S1172\", \"warning\", location, emptyList(), false);\n    location = new Location(filePath, \"Add a \\\"protected\\\" constructor or the \\\"static\\\" keyword to the class declaration.\",\n      9, 17, 9, 24);\n    inOrder.verify(callback).onIssue(\"S1118\", \"warning\", location, emptyList(), false);\n    verifyNoMoreInteractions(callback);\n  }\n\n  @Test\n  public void sarif_path_escaping() throws IOException {\n    SarifParserCallback callback = mock(SarifParserCallback.class);\n    new SarifParser10(null, getRoot(\"v1_0_escaping.json\"), String::toString).accept(callback);\n\n    InOrder inOrder = inOrder(callback);\n    inOrder.verify(callback).onRule(anyString(), anyString(), anyString(), anyString(), anyString());\n    Location location = new Location(new File(baseDir, \"git/Temp Folder SomeRandom!@#$%^&()/csharp/ConsoleApplication1/Program.cs\").getAbsolutePath(),\n      \"Method has 3 parameters, which is greater than the 2 authorized.\", 52, 23, 52, 47);\n    inOrder.verify(callback).onIssue(\"S107\", \"warning\", location, emptyList(), false);\n    verifyNoMoreInteractions(callback);\n  }\n\n  @Test\n  public void dont_fail_on_empty_report() throws IOException {\n    SarifParserCallback callback = mock(SarifParserCallback.class);\n    new SarifParser10(null, getRoot(\"v1_0_empty.json\"), String::toString).accept(callback);\n    verify(callback, never()).onIssue(anyString(), anyString(), any(Location.class), anyCollection(), eq(false));\n  }\n\n  @Test\n  public void sarif_version_1_0_secondary_locations() throws IOException {\n    SarifParserCallback callback = mock(SarifParserCallback.class);\n    new SarifParser10(null, getRoot(\"v1_0_secondary_locations.json\"), String::toString).accept(callback);\n\n    InOrder inOrder = inOrder(callback);\n    inOrder.verify(callback).onRule(eq(\"S1764\"), anyString(), anyString(), anyString(), anyString());\n    inOrder.verify(callback).onRule(eq(\"CS9999\"), anyString(), anyString(), anyString(), anyString());\n    inOrder.verify(callback).onRule(eq(\"S3776\"), anyString(), anyString(), anyString(), anyString());\n    String filePath = new File(baseDir, \"Foo.cs\").getAbsolutePath();\n    Location primaryLocation = new Location(filePath, \"Identical sub-expressions on both sides of operator \\\"==\\\".\",\n      28, 34, 28, 51);\n    Collection<Location> secondaryLocations = new ArrayList<>();\n    secondaryLocations.add(new Location(filePath, null, 28, 13, 28, 30));\n    inOrder.verify(callback).onIssue(\"S1764\", \"warning\", primaryLocation, secondaryLocations, false);\n    inOrder.verify(callback).onFileIssue(eq(\"CS9999\"), eq(\"warning\"), eq(filePath), eq(secondaryLocations), anyString());\n    Collection<Location> secondaryLocationsWithMessage = new ArrayList<>();\n    secondaryLocationsWithMessage.add(new Location(filePath, \"+1\", 28, 13, 28, 30));\n    inOrder.verify(callback).onFileIssue(eq(\"S3776\"), eq(\"warning\"), eq(filePath), eq(secondaryLocationsWithMessage), anyString());\n    verifyNoMoreInteractions(callback);\n  }\n\n  @Test\n  public void sarif_version_1_0_secondary_locations_messages() throws IOException {\n    SarifParserCallback callback = mock(SarifParserCallback.class);\n    new SarifParser10(null, getRoot(\"v1_0_secondary_locations_messages.json\"), String::toString).accept(callback);\n\n    InOrder inOrder = inOrder(callback);\n    inOrder.verify(callback).onRule(anyString(), anyString(), anyString(), anyString(), anyString());\n    String filePath = new File(baseDir, \"Foo.cs\").getAbsolutePath();\n    Location primaryLocation = new Location(filePath, \"Refactor this method to reduce its Cognitive Complexity from 30 to the 15 allowed\",\n      54, 21, 54, 24);\n    Collection<Location> secondaryLocations = new ArrayList<>();\n    secondaryLocations.add(new Location(filePath, \"+1\", 56, 12, 56, 14));\n    secondaryLocations.add(new Location(filePath, \"+2 (incl 1 for nesting)\", 65, 16, 65, 18));\n    secondaryLocations.add(new Location(filePath, \"+1\", 65, 52, 65, 54));\n    inOrder.verify(callback).onIssue(\"S3776\", \"warning\", primaryLocation, secondaryLocations, false);\n    verifyNoMoreInteractions(callback);\n  }\n\n  @Test\n  public void sarif_version_1_0_execution_flow() throws IOException {\n    SarifParserCallback callback = mock(SarifParserCallback.class);\n    new SarifParser10(null, getRoot(\"v1_0_execution_flow.json\"), String::toString).accept(callback);\n\n    InOrder inOrder = inOrder(callback);\n    inOrder.verify(callback).onRule(anyString(), anyString(), anyString(), anyString(), anyString());\n    String filePath = new File(baseDir, \"Foo.cs\").getAbsolutePath();\n    Location primaryLocation = new Location(filePath, \"'text' is null on at least one execution path.\", 308, 29, 308, 33);\n    Collection<Location> secondaryLocations = new ArrayList<>();\n    secondaryLocations.add(new Location(filePath, \"Learning null\", 22, 16, 22, 35));\n    secondaryLocations.add(new Location(filePath, \"Taking assumption\", 22, 16, 22, 35));\n    secondaryLocations.add(new Location(filePath, \"Taking assumption\", 23, 42, 23, 49));\n    secondaryLocations.add(primaryLocation);\n    inOrder.verify(callback).onIssue(\"S2259\", \"warning\", primaryLocation, secondaryLocations, true);\n    verifyNoMoreInteractions(callback);\n  }\n\n  @Test\n  public void sarif_version_1_0_execution_flow_invalid_value() throws IOException {\n    SarifParserCallback callback = mock(SarifParserCallback.class);\n    new SarifParser10(null, getRoot(\"v1_0_invalid_execution_flow_value.json\"), String::toString).accept(callback);\n\n    InOrder inOrder = inOrder(callback);\n    inOrder.verify(callback).onRule(anyString(), anyString(), anyString(), anyString(), anyString());\n    String filePath = new File(baseDir, \"Foo.cs\").getAbsolutePath();\n    Location primaryLocation = new Location(filePath, \"'text' is null on at least one execution path.\", 308, 29, 308, 33);\n    Collection<Location> secondaryLocations = new ArrayList<>();\n    secondaryLocations.add(new Location(filePath, \"Learning null\", 22, 16, 22, 35));\n    secondaryLocations.add(new Location(filePath, \"Taking assumption\", 22, 16, 22, 35));\n    secondaryLocations.add(new Location(filePath, \"Taking assumption\", 23, 42, 23, 49));\n    inOrder.verify(callback).onIssue(\"S2259\", \"warning\", primaryLocation, secondaryLocations, false);\n    verifyNoMoreInteractions(callback);\n  }\n\n  @Test\n  public void sarif_version_1_0_execution_flow_no_secondary_locations() throws IOException {\n    SarifParserCallback callback = mock(SarifParserCallback.class);\n    new SarifParser10(null, getRoot(\"v1_0_execution_flow_no_secondary_locations.json\"), String::toString).accept(callback);\n\n    InOrder inOrder = inOrder(callback);\n    inOrder.verify(callback).onRule(anyString(), anyString(), anyString(), anyString(), anyString());\n    String filePath = new File(baseDir, \"Foo.cs\").getAbsolutePath();\n    Location primaryLocation = new Location(filePath, \"'text' is null on at least one execution path.\", 308, 29, 308, 33);\n    inOrder.verify(callback).onIssue(\"S2259\", \"warning\", primaryLocation, Collections.emptyList(), false);\n    verifyNoMoreInteractions(callback);\n  }\n\n  @Test\n  public void sarif_version_1_0_no_execution_flow() throws IOException {\n    SarifParserCallback callback = mock(SarifParserCallback.class);\n    new SarifParser10(null, getRoot(\"v1_0_no_execution_flow.json\"), String::toString).accept(callback);\n\n    InOrder inOrder = inOrder(callback);\n    inOrder.verify(callback).onRule(anyString(), anyString(), anyString(), anyString(), anyString());\n    String filePath = new File(baseDir, \"Foo.cs\").getAbsolutePath();\n    Location primaryLocation = new Location(filePath, \"'text' is null on at least one execution path.\", 308, 29, 308, 33);\n    Collection<Location> secondaryLocations = new ArrayList<>();\n    secondaryLocations.add(new Location(filePath, \"Learning null\", 22, 16, 22, 35));\n    secondaryLocations.add(new Location(filePath, \"Taking assumption\", 22, 16, 22, 35));\n    secondaryLocations.add(new Location(filePath, \"Taking assumption\", 23, 42, 23, 49));\n    verify(callback).onIssue(\"S2259\", \"warning\", primaryLocation, secondaryLocations, false);\n    verifyNoMoreInteractions(callback);\n  }\n\n  @Test\n  public void sarif_version_1_0_file_issue_with_execution_flow() throws IOException {\n    SarifParserCallback callback = mock(SarifParserCallback.class);\n    new SarifParser10(null, getRoot(\"v1_0_file_level_issue_with_execution_flow.json\"), String::toString).accept(callback);\n\n    assertThat(logTester.logs(Level.WARN)).hasSize(1);\n    assertThat(logTester.logs(Level.WARN).get(0)).startsWith(\"Unexpected file issue with an execution flow for rule S1234. File: \");\n  }\n\n  @Test\n  public void sarif_version_1_0_relative_paths() throws IOException {\n    SarifParserCallback callback = mock(SarifParserCallback.class);\n    new SarifParser10(null, getRoot(\"v1_0_relative_paths.json\"), String::toString).accept(callback);\n    InOrder inOrder = inOrder(callback);\n\n    Location s1144PrimaryLocation = new Location(\"SourceGeneratorPOC.Generators\\\\SourceGeneratorPOC.SourceGenerator\\\\Greetings.cs\", \"Remove the unused private method \" +\n      \"'UnusedMethod'.\", 7, 8, 7, 46);\n    inOrder.verify(callback).onIssue(\"S1144\", \"warning\", s1144PrimaryLocation, new ArrayList<>(), false);\n\n    Location s1186PrimaryLocation = new Location(\"SourceGeneratorPOC.Generators\\\\SourceGeneratorPOC.SourceGenerator\\\\Greetings.cs\", \"Add a nested comment explaining why this \" +\n      \"method is empty, throw a 'NotSupportedException' or complete the implementation.\", 7, 28, 7, 40);\n    inOrder.verify(callback).onIssue(\"S1186\", \"warning\", s1186PrimaryLocation, new ArrayList<>(), false);\n  }\n\n  @Test\n  public void sarif_version_1_0_region_with_length() throws IOException {\n    SarifParserCallback callback = mock(SarifParserCallback.class);\n    new SarifParser10(null, getRoot(\"v1_0_region_with_length.json\"), String::toString).accept(callback);\n    InOrder inOrder = inOrder(callback);\n\n    Location primaryLocation = new Location(\"SourceGeneratorPOC.Generators\\\\SourceGeneratorPOC.SourceGenerator\\\\Greetings.cs\", \"Remove the unused private method 'UnusedMethod'.\"\n      , 7, 8, 7, 46);\n    inOrder.verify(callback).onIssue(\"S1144\", \"warning\", primaryLocation, new ArrayList<>(), false);\n  }\n\n  // https://sonarsource.atlassian.net/browse/NET-1139\n  @Test\n  public void sarif_version_1_0_same_start_end_location() throws IOException {\n    SarifParserCallback callback = mock(SarifParserCallback.class);\n    new SarifParser10(null, getRoot(\"v1_0_same_start_end_location.json\"), String::toString).accept(callback);\n    InOrder inOrder = inOrder(callback);\n    Location primaryLocation = new Location(\"Foo.cs\", \"Fix formatting - middle of line\", 8, 4, 8, 5);\n    inOrder.verify(callback).onIssue(\"IDE0055\", \"note\", primaryLocation, emptyList(), false);\n    primaryLocation = new Location(\"Foo.cs\", \"Fix formatting - start of line\", 8, 0, 8, 1);\n    inOrder.verify(callback).onIssue(\"IDE0055\", \"note\", primaryLocation, emptyList(), false);\n    inOrder.verify(callback).onFileIssue(eq(\"IDE0055\"), anyString(), eq(\"Foo.cs\"), eq(emptyList()), eq(\"Fix formatting - First line\"));\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/sarif/SarifParserCallbackImplTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.sarif;\n\nimport java.util.Collections;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.HashSet;\nimport java.util.AbstractMap.SimpleEntry;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.TemporaryFolder;\nimport org.sonar.api.SonarEdition;\nimport org.sonar.api.SonarQubeSide;\nimport org.sonar.api.batch.fs.TextRange;\nimport org.sonar.api.batch.fs.internal.TestInputFileBuilder;\nimport org.sonar.api.batch.rule.Severity;\nimport org.sonar.api.batch.sensor.internal.SensorContextTester;\nimport org.sonar.api.batch.sensor.issue.ExternalIssue;\nimport org.sonar.api.batch.sensor.issue.Issue;\nimport org.sonar.api.batch.sensor.issue.Issue.Flow;\nimport org.sonar.api.batch.sensor.issue.IssueLocation;\nimport org.sonar.api.batch.sensor.issue.NewIssue;\nimport org.sonar.api.batch.sensor.rule.AdHocRule;\nimport org.sonar.api.internal.SonarRuntimeImpl;\nimport org.sonar.api.issue.impact.SoftwareQuality;\nimport org.sonar.api.rule.RuleKey;\nimport org.sonar.api.rules.RuleType;\nimport org.sonar.api.testfixtures.log.LogTester;\nimport org.slf4j.event.Level;\nimport org.sonar.api.utils.Version;\nimport org.sonarsource.dotnet.shared.plugins.SarifParserCallbackImpl;\n\nimport static java.util.Arrays.asList;\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.emptySet;\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.groups.Tuple.tuple;\nimport static org.junit.Assert.assertThrows;\n\npublic class SarifParserCallbackImplTest {\n  @Rule\n  public TemporaryFolder temp = new TemporaryFolder();\n\n  @Rule\n  public LogTester logTester = new LogTester();\n\n  private SensorContextTester ctx;\n  private final Map<String, String> repositoryKeyByRoslynRuleKey = new HashMap<>();\n\n  private SarifParserCallbackImpl callback;\n\n  @Before\n  public void setUp() {\n    logTester.setLevel(Level.DEBUG);\n    ctx = SensorContextTester.create(temp.getRoot().toPath());\n    repositoryKeyByRoslynRuleKey.put(\"rule1\", \"rule1\");\n    repositoryKeyByRoslynRuleKey.put(\"rule2\", \"rule2\");\n    repositoryKeyByRoslynRuleKey.put(\"rule42\", \"csharpsquid\");\n\n    // file needs to have a few lines so that the issue is within it's range\n    ctx.fileSystem().add(TestInputFileBuilder.create(\"module1\", \"file1\")\n      .setContents(\"My file\\ncontents\\nwith some\\n lines\")\n      .build());\n\n    ctx.fileSystem().add(TestInputFileBuilder.create(\"module1\", \"Dummy.razor\")\n      .setContents(\"My file\\ncontents\\nwith some\\n lines\")\n      .build());\n\n    ctx.fileSystem().add(TestInputFileBuilder.create(\"module1\", \"Dummy.cshtml\")\n      .setContents(\"My file\\ncontents\\nwith some\\n lines\")\n      .build());\n\n    callback = new SarifParserCallbackImpl(ctx, repositoryKeyByRoslynRuleKey, true, emptySet(), emptySet(), emptySet());\n  }\n\n  @Test\n  public void should_add_project_issues() {\n    callback.onProjectIssue(\"rule1\", \"warning\", ctx.project(), \"msg\");\n    assertThat(ctx.allIssues()).hasSize(1);\n    assertThat(ctx.allIssues().iterator().next().primaryLocation().inputComponent().key()).isEqualTo(\"projectKey\");\n    assertThat(ctx.allIssues().iterator().next().ruleKey().rule()).isEqualTo(\"rule1\");\n    assertThat(logTester.logs(Level.DEBUG)).containsOnly(\"Adding project level issue rule1: [key=projectKey]\");\n  }\n\n  @Test\n  public void should_add_file_issues_no_secondary_location() {\n    String absoluteFilePath = temp.getRoot().toPath().resolve(\"file1\").toString();\n    callback.onFileIssue(\"rule1\", \"warning\", absoluteFilePath, emptyList(), \"msg\");\n    assertThat(ctx.allIssues()).hasSize(1);\n    assertThat(ctx.allIssues().iterator().next().primaryLocation().inputComponent().key()).isEqualTo(\"module1:file1\");\n    assertThat(ctx.allIssues().iterator().next().ruleKey().rule()).isEqualTo(\"rule1\");\n    assertThat(logTester.logs(Level.DEBUG)).containsOnly(\"Adding file level issue rule1: file1\");\n    assertThat(ctx.allIssues().iterator().next().flows()).isEmpty();\n  }\n\n  @Test\n  public void should_add_file_issues_with_secondary_location() {\n    String absoluteFilePath = temp.getRoot().toPath().resolve(\"file1\").toString();\n    callback.onFileIssue(\"rule1\", \"warning\", absoluteFilePath, Collections.singletonList(createLocation(\"file1\", 4, 5)), \"msg\");\n    assertThat(ctx.allIssues()).hasSize(1);\n    assertThat(ctx.allIssues().iterator().next().primaryLocation().inputComponent().key()).isEqualTo(\"module1:file1\");\n    assertThat(ctx.allIssues().iterator().next().ruleKey().rule()).isEqualTo(\"rule1\");\n    assertThat(logTester.logs(Level.DEBUG)).containsOnly(\"Adding file level issue rule1: file1\");\n\n    List<Flow> flows = ctx.allIssues().iterator().next().flows();\n    assertThat(flows).hasSize(1);\n    List<IssueLocation> locations = flows.get(0).locations();\n    assertThat(locations).hasSize(1);\n    assertThat(locations.get(0).inputComponent().key()).isEqualTo(\"module1:file1\");\n    TextRange textRange = locations.get(0).textRange();\n    assertThat(textRange.start().lineOffset()).isEqualTo(5);\n    assertThat(textRange.start().line()).isEqualTo(4);\n    assertThat(textRange.end().lineOffset()).isEqualTo(6);\n    assertThat(textRange.end().line()).isEqualTo(4);\n  }\n\n  @Test\n  public void should_create_external_file_issue_for_unknown_rule_key() {\n    String absoluteFilePath = temp.getRoot().toPath().resolve(\"file1\").toString();\n    callback.onFileIssue(\"rule45\", \"warning\", absoluteFilePath, emptyList(), \"msg\");\n    assertThat(ctx.allIssues()).isEmpty();\n    assertThat(ctx.allExternalIssues()).isEmpty();\n\n    callback = new SarifParserCallbackImpl(ctx, repositoryKeyByRoslynRuleKey, false, emptySet(), emptySet(), emptySet());\n    callback.onFileIssue(\"rule45\", \"warning\", absoluteFilePath, emptyList(), \"msg\");\n    callback.onFileIssue(\"S1234\", \"warning\", absoluteFilePath, emptyList(), \"msg\"); // sonar rule, ignored\n\n    assertThat(ctx.allIssues()).isEmpty();\n    assertThat(ctx.allExternalIssues())\n      .extracting(ExternalIssue::ruleId, ExternalIssue::type, ExternalIssue::severity)\n      .containsExactlyInAnyOrder(\n        tuple(\"rule45\", RuleType.CODE_SMELL, Severity.MAJOR));\n\n    assertThat(logTester.logs(Level.DEBUG)).containsOnly(\"Adding file level external issue rule45: file1\");\n  }\n\n  @Test\n  public void should_create_external_file_issue_with_secondary_location() {\n    String absoluteFilePath = temp.getRoot().toPath().resolve(\"file1\").toString();\n    callback = new SarifParserCallbackImpl(ctx, repositoryKeyByRoslynRuleKey, false, emptySet(), emptySet(), emptySet());\n    callback.onFileIssue(\"rule45\", \"warning\", absoluteFilePath, Collections.singletonList(createLocation(\"file1\", 4, 5)), \"msg\");\n\n    assertThat(ctx.allIssues()).isEmpty();\n    assertThat(ctx.allExternalIssues())\n      .extracting(ExternalIssue::ruleId, ExternalIssue::type, ExternalIssue::severity)\n      .containsExactlyInAnyOrder(\n        tuple(\"rule45\", RuleType.CODE_SMELL, Severity.MAJOR));\n    List<Flow> flows = ctx.allExternalIssues().iterator().next().flows();\n    assertThat(flows).hasSize(1);\n    List<IssueLocation> locations = flows.get(0).locations();\n    assertThat(locations).hasSize(1);\n    assertThat(locations.get(0).inputComponent().key()).isEqualTo(\"module1:file1\");\n    TextRange textRange = locations.get(0).textRange();\n    assertThat(textRange.start().lineOffset()).isEqualTo(5);\n    assertThat(textRange.start().line()).isEqualTo(4);\n    assertThat(textRange.end().lineOffset()).isEqualTo(6);\n    assertThat(textRange.end().line()).isEqualTo(4);\n  }\n\n  @Test\n  public void should_ignore_file_issue_with_unknown_file() {\n    callback.onFileIssue(\"rule1\", \"warning\", \"file-unknown\", emptyList(), \"msg\");\n    assertThat(ctx.allIssues()).isEmpty();\n    assertThat(logTester.logs(Level.DEBUG)).containsOnly(\"Skipping issue rule1, input file not found or excluded: file-unknown\");\n  }\n\n  @Test\n  public void should_ignore_issue_with_unknown_file() {\n    callback.onIssue(\"rule1\", \"warning\", createLocation(\"file-unknown\", 2, 3), Collections.emptyList(), false);\n    assertThat(ctx.allIssues()).isEmpty();\n    assertThat(logTester.logs(Level.DEBUG))\n      .containsOnly(String.format(\"Skipping issue rule1, input file not found or excluded: \" + createAbsolutePath(\"file-unknown\")));\n  }\n\n  @Test\n  public void should_ignore_project_issue_with_unknown_rule_key() {\n    callback.onProjectIssue(\"rule45\", \"warning\", ctx.project(), \"msg\");\n    assertThat(ctx.allIssues()).isEmpty();\n    assertThat(ctx.allExternalIssues()).isEmpty();\n\n    callback = new SarifParserCallbackImpl(ctx, repositoryKeyByRoslynRuleKey, true, emptySet(), emptySet(), emptySet());\n\n    callback.onProjectIssue(\"rule45\", \"warning\", ctx.project(), \"msg\");\n\n    assertThat(ctx.allIssues()).isEmpty();\n    assertThat(ctx.allExternalIssues()).isEmpty();\n  }\n\n  @Test\n  public void should_add_issues() {\n    callback.onIssue(\"rule1\", \"warning\", createLocation(\"file1\", 2, 3), Collections.emptyList(), false);\n    callback.onIssue(\"rule2\", \"warning\", createLocation(\"file1\", 2, 3), Collections.emptyList(), false);\n\n    assertThat(ctx.allIssues()).extracting(\"ruleKey\").extracting(\"rule\")\n      .containsOnly(\"rule1\", \"rule2\");\n    assertThat(logTester.logs(Level.DEBUG)).containsOnly(\n      \"Adding normal issue rule1: \" + createAbsolutePath(\"file1\"),\n      \"Adding normal issue rule2: \" + createAbsolutePath(\"file1\")\n    );\n  }\n\n  @Test\n  public void should_add_execution_flow() {\n    callback.onIssue(\"rule1\", \"warning\", createLocation(\"file1\", 2, 3), Collections.singletonList(createLocation(\"file1\", 4, 5)), true);\n\n    assertThat(ctx.allIssues())\n      .extracting(Issue::flows)\n      .hasSize(1)\n      .extracting(x -> x.get(0))\n      .extracting(\n        Flow::type,\n        Flow::description,\n        x -> x.locations().get(0).inputComponent().key(),\n        x -> x.locations().get(0).textRange().start().line(),\n        x -> x.locations().get(0).textRange().start().lineOffset(),\n        x -> x.locations().get(0).textRange().end().line(),\n        x -> x.locations().get(0).textRange().end().lineOffset())\n      .containsOnly(tuple(NewIssue.FlowType.EXECUTION, \"Execution Flow\", \"module1:file1\", 4, 5, 4, 6));\n  }\n\n  @Test\n  public void should_not_add_execution_flow_with_no_secondary_locations() {\n    callback.onIssue(\"rule1\", \"warning\", createLocation(\"file1\", 2, 3), Collections.emptyList(), true);\n\n    assertThat(ctx.allIssues())\n      .extracting(Issue::flows)\n      .allSatisfy(flows -> assertThat(flows).isEmpty());\n  }\n\n  @Test\n  public void should_not_add_execution_flow_with_secondary_locations_invalid_file() {\n    callback.onIssue(\"rule1\", \"warning\", createLocation(\"file1\", 2, 3), Collections.singletonList(createLocation(\"does-not-exit-file\", 4, 5)), true);\n\n    assertThat(ctx.allIssues())\n      .hasSize(1)\n      .extracting(Issue::flows)\n      .allSatisfy(flows -> assertThat(flows).isEmpty());\n  }\n\n  @Test\n  public void should_create_external_issue_for_unknown_rule_key() {\n    callback.onIssue(\"rule45\", \"warning\", createLocation(\"file1\", 2, 3), Collections.emptyList(), false);\n\n    assertThat(ctx.allIssues()).isEmpty();\n    assertThat(ctx.allExternalIssues()).isEmpty();\n\n    callback = new SarifParserCallbackImpl(ctx, repositoryKeyByRoslynRuleKey, false, emptySet(), emptySet(), emptySet());\n\n    callback.onIssue(\"rule45\", \"warning\", createLocation(\"file1\", 2, 3), Collections.emptyList(), false);\n    callback.onIssue(\"S1234\", \"warning\", createLocation(\"file1\", 2, 3), Collections.emptyList(), false); // sonar rule, ignored\n\n    assertThat(ctx.allIssues()).isEmpty();\n    assertThat(ctx.allExternalIssues())\n      .extracting(ExternalIssue::ruleId, ExternalIssue::type, ExternalIssue::severity)\n      .containsExactlyInAnyOrder(\n        tuple(\"rule45\", RuleType.CODE_SMELL, Severity.MAJOR));\n    assertThat(logTester.logs(Level.DEBUG)).containsOnly(\"Adding external issue rule45: \" + createAbsolutePath(\"file1\"));\n  }\n\n  @Test\n  public void should_create_external_issues_with_correct_impact_mapping() {\n    callback = new SarifParserCallbackImpl(ctx, repositoryKeyByRoslynRuleKey, false, emptySet(), emptySet(), emptySet());\n\n    callback.onIssue(\"rule45\", \"warning\", createLocation(\"file1\", 2, 3), Collections.emptyList(), false);\n    callback.onIssue(\"rule46\", \"error\", createLocation(\"file1\", 2, 3), Collections.emptyList(), false);\n    callback.onIssue(\"rule47\", \"info\", createLocation(\"file1\", 2, 3), Collections.emptyList(), false);\n\n    assertThat(ctx.allIssues()).isEmpty();\n    assertThat(ctx.allExternalIssues())\n      .extracting(ExternalIssue::ruleId, x -> x.impacts().entrySet().toArray()[0])\n      .containsExactlyInAnyOrder(\n        tuple(\"rule45\", new SimpleEntry<>(SoftwareQuality.MAINTAINABILITY, org.sonar.api.issue.impact.Severity.MEDIUM)),\n        tuple(\"rule46\", new SimpleEntry<>(SoftwareQuality.MAINTAINABILITY, org.sonar.api.issue.impact.Severity.HIGH)),\n        tuple(\"rule47\", new SimpleEntry<>(SoftwareQuality.MAINTAINABILITY, org.sonar.api.issue.impact.Severity.INFO))\n        );\n    assertThat(logTester.logs(Level.DEBUG)).containsExactlyInAnyOrder(\n      \"Adding external issue rule45: \" + createAbsolutePath(\"file1\"),\n      \"Adding external issue rule46: \" + createAbsolutePath(\"file1\"),\n      \"Adding external issue rule47: \" + createAbsolutePath(\"file1\")\n    );\n  }\n\n  @Test\n  public void should_create_external_issues_without_impact_cloud() {\n    SensorContextTester ctxCloud = SensorContextTester.create(temp.getRoot().toPath());\n    ctxCloud.setRuntime(SonarRuntimeImpl.forSonarQube(Version.create(10, 1), SonarQubeSide.SCANNER, SonarEdition.SONARCLOUD));\n    ctxCloud.fileSystem().add(TestInputFileBuilder.create(\"module1\", \"file1\")\n      .setContents(\"My file\\ncontents\\nwith some\\n lines\")\n      .build());\n    callback = new SarifParserCallbackImpl(ctxCloud, repositoryKeyByRoslynRuleKey, false, emptySet(), emptySet(), emptySet());\n\n    callback.onIssue(\"rule45\", \"warning\", createLocation(\"file1\", 2, 3), Collections.emptyList(), false);\n    callback.onIssue(\"rule46\", \"warning\", createLocation(\"file1\", 2, 3), Collections.emptyList(), false);\n    callback.onIssue(\"rule47\", \"warning\", createLocation(\"file1\", 2, 3), Collections.emptyList(), false);\n    \n    assertThat(ctxCloud.allExternalIssues())\n      .extracting(ExternalIssue::ruleId, x -> x.impacts().keySet())\n      .containsExactlyInAnyOrder(\n        tuple(\"rule45\", Collections.emptySet()),\n        tuple(\"rule46\", Collections.emptySet()),\n        tuple(\"rule47\", Collections.emptySet())\n      );\n  }\n\n  @Test\n  public void external_issue_with_invalid_precise_location_reports_on_line() {\n    callback = new SarifParserCallbackImpl(ctx, repositoryKeyByRoslynRuleKey, false, emptySet(), emptySet(), emptySet());\n\n    // We try to report an issue that contains an invalid startColumn (bigger than the line length) but with a valid start line\n    // So we expect the issue to be reported on the start line.\n    callback.onIssue(\"rule45\", \"warning\", createLocation(\"file1\", 2, 20, 4, 2), Collections.emptyList(), false);\n\n    assertThat(ctx.allIssues()).isEmpty();\n    assertThat(ctx.allExternalIssues())\n      .extracting(ExternalIssue::ruleId,\n        i -> i.primaryLocation().textRange().start().line(),\n        i -> i.primaryLocation().textRange().start().lineOffset(),\n        i -> i.primaryLocation().textRange().end().line(),\n        i -> i.primaryLocation().textRange().end().lineOffset())\n      .containsExactlyInAnyOrder(\n        tuple(\"rule45\", 2, 0, 2, 8));\n  }\n\n  @Test\n  public void external_issue_with_invalid_line_location_reports_on_file() {\n    callback = new SarifParserCallbackImpl(ctx, repositoryKeyByRoslynRuleKey, false, emptySet(), emptySet(), emptySet());\n\n    // We try to report an issue that contains an invalid startLine (bigger than the file length)\n    // So we expect the issue to be reported on the file.\n    callback.onIssue(\"rule45\", \"warning\", createLocation(\"file1\", 10, 12), Collections.emptyList(), false);\n\n    assertThat(ctx.allIssues()).isEmpty();\n    assertThat(ctx.allExternalIssues())\n      .extracting(ExternalIssue::ruleId, i -> i.primaryLocation().inputComponent().key(), i -> i.primaryLocation().textRange())\n      .containsExactlyInAnyOrder(\n        tuple(\"rule45\", \"module1:file1\", null));\n  }\n\n  @Test\n  public void external_issue_with_invalid_precise_location_reports_on_file() {\n    callback = new SarifParserCallbackImpl(ctx, repositoryKeyByRoslynRuleKey, false, emptySet(), emptySet(), emptySet());\n\n    // We try to report an issue that contains an invalid startLine (bigger than the file length)\n    // So we expect the issue to be reported on the file.\n    callback.onIssue(\"rule45\", \"warning\", createLocation(\"file1\", 10, 53, 80, 42), Collections.emptyList(), false);\n\n    assertThat(ctx.allIssues()).isEmpty();\n    assertThat(ctx.allExternalIssues())\n      .extracting(ExternalIssue::ruleId, i -> i.primaryLocation().inputComponent().key(), i -> i.primaryLocation().textRange())\n      .containsExactlyInAnyOrder(\n        tuple(\"rule45\", \"module1:file1\", null));\n  }\n\n  @Test\n  public void should_add_issue_with_secondary_location() {\n    callback.onIssue(\"rule1\", \"warning\", createLocation(\"file1\", 2, 3), Collections.singletonList(createLocation(\"file1\", 4, 5)), false);\n\n    assertThat(ctx.allIssues()).hasSize(1);\n\n    List<Flow> flows = ctx.allIssues().iterator().next().flows();\n    assertThat(flows).hasSize(1);\n\n    List<IssueLocation> locations = flows.get(0).locations();\n    assertThat(locations).hasSize(1);\n\n    assertThat(locations.get(0).inputComponent().key()).isEqualTo(\"module1:file1\");\n    TextRange textRange = locations.get(0).textRange();\n    assertThat(textRange.start().lineOffset()).isEqualTo(5);\n    assertThat(textRange.start().line()).isEqualTo(4);\n    assertThat(textRange.end().lineOffset()).isEqualTo(6);\n    assertThat(textRange.end().line()).isEqualTo(4);\n  }\n\n  @Test\n  public void should_add_issue_with_secondary_location_with_invalid_file() {\n    callback.onIssue(\"rule1\", \"warning\", createLocation(\"file1\", 2, 3), Collections.singletonList(createLocation(\"invalid-file\", 4, 5)), false);\n\n    assertThat(ctx.allIssues())\n      .hasSize(1)\n      .extracting(Issue::flows)\n      .allSatisfy(flows -> assertThat(flows).isEmpty());\n  }\n\n  @Test\n  public void should_ignore_repeated_module_issues() {\n    callback.onProjectIssue(\"rule1\", \"warning\", ctx.project(), \"message\");\n    callback.onProjectIssue(\"rule1\", \"warning\", ctx.project(), \"message\");\n\n    assertThat(ctx.allIssues()).hasSize(1);\n    assertThat(ctx.allIssues()).extracting(\"ruleKey\").extracting(\"rule\")\n      .containsOnly(\"rule1\");\n  }\n\n  @Test\n  public void should_ignore_repeated_file_issues() {\n    callback.onFileIssue(\"rule1\", \"warning\", createAbsolutePath(\"file1\"), emptyList(), \"message\");\n    callback.onFileIssue(\"rule1\", \"warning\", createAbsolutePath(\"file1\"), emptyList(), \"message\");\n\n    assertThat(ctx.allIssues()).hasSize(1);\n    assertThat(ctx.allIssues()).extracting(\"ruleKey\").extracting(\"rule\")\n      .containsOnly(\"rule1\");\n  }\n\n  @Test\n  public void should_ignore_repeated_issues() {\n    callback.onIssue(\"rule1\", \"warning\", createLocation(\"file1\", 2, 3), Collections.emptyList(), false);\n    callback.onIssue(\"rule1\", \"warning\", createLocation(\"file1\", 2, 3), Collections.emptyList(), false);\n\n    assertThat(ctx.allIssues()).hasSize(1);\n    assertThat(ctx.allIssues()).extracting(\"ruleKey\").extracting(\"rule\")\n      .containsOnly(\"rule1\");\n  }\n\n  @Test\n  public void should_register_adhoc_rule() {\n    callback = new SarifParserCallbackImpl(ctx, repositoryKeyByRoslynRuleKey, false, emptySet(), emptySet(), emptySet());\n    callback.onRule(\"rule123\", \"My rule\", \"Rule description\", \"Error\", \"Foo\");\n\n    assertThat(ctx.allAdHocRules())\n      .extracting(AdHocRule::engineId, AdHocRule::ruleId, AdHocRule::name, AdHocRule::description, AdHocRule::severity, AdHocRule::type)\n      .containsExactlyInAnyOrder(tuple(\"roslyn\", \"rule123\", \"My rule\", \"Rule description\", Severity.CRITICAL, RuleType.BUG));\n  }\n\n  @Test\n  public void should_ignore_adhoc_rule_matching_sonar_key() {\n    callback = new SarifParserCallbackImpl(ctx, repositoryKeyByRoslynRuleKey, false, emptySet(), emptySet(), emptySet());\n    callback.onRule(\"SS1234\", \"My rule\", \"Rule description\", \"Error\", \"Foo\"); // does not start with single S\n    callback.onRule(\"S123456\", \"My rule\", \"Rule description\", \"Error\", \"Foo\"); // too long\n    callback.onRule(\"S12345\", \"My rule\", \"Rule description\", \"Error\", \"Foo\"); // too long\n    callback.onRule(\"S1234\", \"My rule\", \"Rule description\", \"Error\", \"Foo\"); // sonar rule\n    callback.onRule(\"S123\", \"My rule\", \"Rule description\", \"Error\", \"Foo\"); // sonar rule\n    callback.onRule(\"S12\", \"My rule\", \"Rule description\", \"Error\", \"Foo\"); // too short\n    callback.onRule(\"S123x\", \"My rule\", \"Rule description\", \"Error\", \"Foo\"); // does not have only digits after S\n\n    assertThat(ctx.allAdHocRules())\n      .extracting(AdHocRule::engineId, AdHocRule::ruleId, AdHocRule::name, AdHocRule::description, AdHocRule::severity, AdHocRule::type)\n      .containsExactlyInAnyOrder(\n        tuple(\"roslyn\", \"SS1234\", \"My rule\", \"Rule description\", Severity.CRITICAL, RuleType.BUG),\n        tuple(\"roslyn\", \"S123456\", \"My rule\", \"Rule description\", Severity.CRITICAL, RuleType.BUG),\n        tuple(\"roslyn\", \"S12345\", \"My rule\", \"Rule description\", Severity.CRITICAL, RuleType.BUG),\n        tuple(\"roslyn\", \"S12\", \"My rule\", \"Rule description\", Severity.CRITICAL, RuleType.BUG),\n        tuple(\"roslyn\", \"S123x\", \"My rule\", \"Rule description\", Severity.CRITICAL, RuleType.BUG));\n  }\n\n  @Test\n  public void should_map_severity_name_and_description() {\n    callback = new SarifParserCallbackImpl(ctx, repositoryKeyByRoslynRuleKey, false, emptySet(), emptySet(), emptySet());\n    callback.onRule(\"S1\", \"My rule1\", \"Rule description\", \"Error\", \"Foo\");\n    callback.onRule(\"S2\", null, null, \"Warning\", \"Foo\");\n    callback.onRule(\"S3\", \"My rule3\", null, \"Info\", \"Foo\");\n    callback.onRule(\"S4\", null, \"Rule description\", \"Note\", \"Foo\");\n\n    assertThat(ctx.allAdHocRules())\n      .extracting(AdHocRule::ruleId, AdHocRule::severity, AdHocRule::name, AdHocRule::description)\n      .containsExactlyInAnyOrder(\n        tuple(\"S1\", Severity.CRITICAL, \"My rule1\", \"Rule description\"),\n        tuple(\"S2\", Severity.MAJOR, \"S2\", null),\n        tuple(\"S3\", Severity.INFO, \"My rule3\", null),\n        tuple(\"S4\", Severity.INFO, \"S4\", \"Rule description\"));\n  }\n\n  @Test\n  public void should_fallback_on_rule_severity() {\n    callback = new SarifParserCallbackImpl(ctx, repositoryKeyByRoslynRuleKey, false, emptySet(), emptySet(), emptySet());\n    callback.onRule(\"rule45\", \"My rule\", \"Rule description\", \"Note\", \"Foo\");\n\n    callback.onIssue(\"rule45\", null, createLocation(\"file1\", 2, 3), Collections.emptyList(), false);\n\n    assertThat(ctx.allExternalIssues()).extracting(ExternalIssue::severity).containsExactly(Severity.INFO);\n  }\n\n  @Test\n  public void should_fallback_on_major_severity() {\n    callback = new SarifParserCallbackImpl(ctx, repositoryKeyByRoslynRuleKey, false, emptySet(), emptySet(), emptySet());\n\n    callback.onIssue(\"rule45\", null, createLocation(\"file1\", 2, 3), Collections.emptyList(), false);\n\n    assertThat(ctx.allExternalIssues()).extracting(ExternalIssue::severity).containsExactly(Severity.MAJOR);\n  }\n\n  @Test\n  public void should_map_rule_type() {\n    callback = new SarifParserCallbackImpl(ctx, repositoryKeyByRoslynRuleKey, false, new HashSet<>(asList(\"bug1\", \"bug2\")), new HashSet<>(asList(\"cs1\", \"cs2\")),\n      new HashSet<>(asList(\"vul1\", \"vul2\")));\n\n    callback.onRule(\"S1\", \"My rule\", \"Rule description\", \"Info\", \"bug1\");\n    callback.onRule(\"S2\", \"My rule\", \"Rule description\", \"Info\", \"cs2\");\n    callback.onRule(\"S3\", \"My rule\", \"Rule description\", \"Info\", \"vul1\");\n    callback.onRule(\"S4\", \"My rule\", \"Rule description\", \"Info\", \"unknown\");\n    callback.onRule(\"S5\", \"My rule\", \"Rule description\", \"Info\", null);\n\n    assertThat(ctx.allAdHocRules())\n      .extracting(AdHocRule::ruleId, AdHocRule::type)\n      .containsExactlyInAnyOrder(\n        tuple(\"S1\", RuleType.BUG),\n        tuple(\"S2\", RuleType.CODE_SMELL),\n        tuple(\"S3\", RuleType.VULNERABILITY),\n        tuple(\"S4\", RuleType.CODE_SMELL),\n        tuple(\"S5\", RuleType.CODE_SMELL));\n  }\n\n  @Test\n  public void issue_with_invalid_precise_location_forRazor_reports_on_line() {\n    assertIssueReportedOnLine(\"Dummy.razor\");\n  }\n\n  @Test\n  public void issue_with_invalid_precise_location_forCshtml_reports_on_line() {\n    assertIssueReportedOnLine(\"Dummy.cshtml\");\n  }\n\n  @Test\n  public void project_level_issues_for_different_projects() {\n    callback = new SarifParserCallbackImpl(ctx, repositoryKeyByRoslynRuleKey, false, emptySet(), emptySet(), emptySet());\n    repositoryKeyByRoslynRuleKey.put(\"S3990\", \"S3990\");\n\n    callback.onProjectIssue(\"S3990\", \"level\", ctx.project(), \"Provide a 'CLSCompliant' attribute for assembly 'First'.\");\n    callback.onProjectIssue(\"S3990\", \"level\", ctx.project(), \"Provide a 'CLSCompliant' attribute for assembly 'First'.\");\n    assertThat(ctx.allIssues()).hasSize(1); // Issues with the same id and message are considered duplicates.\n\n    callback.onProjectIssue(\"S3990\", \"level\", ctx.project(), \"Provide a 'CLSCompliant' attribute for assembly 'Second'.\");\n    assertThat(ctx.allIssues()).hasSize(2); // A different message leads to a different issue\n  }\n\n  @Test\n  public void impact_severity_mapping_is_correct() {\n    assertThat(SarifParserCallbackImpl.mapImpactSeverity(Severity.BLOCKER)).isEqualTo(org.sonar.api.issue.impact.Severity.BLOCKER);\n    assertThat(SarifParserCallbackImpl.mapImpactSeverity(Severity.CRITICAL)).isEqualTo(org.sonar.api.issue.impact.Severity.HIGH);\n    assertThat(SarifParserCallbackImpl.mapImpactSeverity(Severity.MAJOR)).isEqualTo(org.sonar.api.issue.impact.Severity.MEDIUM);\n    assertThat(SarifParserCallbackImpl.mapImpactSeverity(Severity.MINOR)).isEqualTo(org.sonar.api.issue.impact.Severity.LOW);\n    assertThat(SarifParserCallbackImpl.mapImpactSeverity(Severity.INFO)).isEqualTo(org.sonar.api.issue.impact.Severity.INFO);\n  }\n\n  @Test\n  public void impact_softwareQuality_mapping_is_correct() {\n    assertThat(SarifParserCallbackImpl.mapSoftwareQuality(RuleType.CODE_SMELL)).isEqualTo(SoftwareQuality.MAINTAINABILITY);\n    assertThat(SarifParserCallbackImpl.mapSoftwareQuality(RuleType.BUG)).isEqualTo(SoftwareQuality.RELIABILITY);\n    assertThat(SarifParserCallbackImpl.mapSoftwareQuality(RuleType.VULNERABILITY)).isEqualTo(SoftwareQuality.SECURITY);\n    assertThrows(IllegalStateException.class, () -> SarifParserCallbackImpl.mapSoftwareQuality(RuleType.SECURITY_HOTSPOT));\n  }\n\n  private void assertIssueReportedOnLine(String fileName) {\n    callback = new SarifParserCallbackImpl(ctx, repositoryKeyByRoslynRuleKey, false, emptySet(), emptySet(), emptySet());\n\n    // We try to report an issue that contains an invalid startColumn (bigger than the line length) but with a valid start line\n    // So we expect the issue to be reported on the start line.\n    callback.onIssue(\"rule42\", \"warning\", createLocation(fileName, 2, 99, 2, 101), Collections.emptyList(), false);\n\n    assertThat(ctx.allIssues()).hasSize(1)\n      .extracting(Issue::ruleKey,\n        i -> i.primaryLocation().textRange().start().line(),\n        i -> i.primaryLocation().textRange().start().lineOffset(),\n        i -> i.primaryLocation().textRange().end().line(),\n        i -> i.primaryLocation().textRange().end().lineOffset())\n      .containsExactlyInAnyOrder(\n        tuple(RuleKey.of(\"csharpsquid\", \"rule42\"), 2, 0, 2, 8));\n\n    List<String> logs = logTester.logs();\n    assertThat(logs.get(1))\n      .startsWith(\"Precise issue location cannot be found! Location:\")\n      .endsWith(fileName + \", message=msg, startLine=2, startColumn=99, endLine=2, endColumn=101]\");\n  }\n\n  private Location createLocation(String filePath, int line, int column) {\n    return createLocation(filePath, line, column, line, column + 1);\n  }\n\n  private Location createLocation(String filePath, int startLine, int startColumn, int endLine, int endColumn) {\n    return new Location(createAbsolutePath(filePath), \"msg\", startLine, startColumn, endLine, endColumn);\n  }\n\n  private String createAbsolutePath(String filePath) {\n    return temp.getRoot().toPath().resolve(filePath).toString();\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/java/org/sonarsource/dotnet/shared/sarif/SarifParserFactoryTest.java",
    "content": "/*\n * SonarSource :: .NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.dotnet.shared.sarif;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.nio.file.StandardOpenOption;\n\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.ExpectedException;\nimport org.junit.rules.TemporaryFolder;\nimport org.sonarsource.dotnet.shared.plugins.RoslynReport;\n\npublic class SarifParserFactoryTest {\n  @Rule\n  public ExpectedException thrown = ExpectedException.none();\n\n  @Rule\n  public TemporaryFolder temp = new TemporaryFolder();\n\n  @Test\n  public void testNonExisting() {\n    thrown.expectMessage(\"Unable to read the Roslyn SARIF report file: \");\n    thrown.expectMessage(\"non_existing.json\");\n\n    SarifParserFactory.create(new RoslynReport(null, Paths.get(\"non_existing.json\")), String::toString);\n  }\n\n  @Test\n  public void testUnknownVersion() throws IOException {\n    Path f = temp.newFile(\"unknown.json\").toPath();\n    Files.write(f, \"{\\\"$schema\\\": \\\"http://json.schemastore.org/sarif-1.1.0\\\",\\\"version\\\": \\\"1.1.0\\\"}\".getBytes(StandardCharsets.UTF_8), StandardOpenOption.CREATE);\n    SarifParser parser = SarifParserFactory.create(new RoslynReport(null, f), String::toString);\n    assertThat(parser).isInstanceOf(SarifParser10.class);\n  }\n\n  @Test\n  public void testAllJsonFiles() throws IOException {\n    Path folder = Paths.get(\"src/test/resources/SarifParserTest\");\n    Files.list(folder).forEach(f -> assertThat(SarifParserFactory.create(new RoslynReport(null, f), String::toString)).isNotNull());\n  }\n\n  @Test\n  public void testInvalidFormat() throws IOException {\n    thrown.expectMessage(\"Not a JSON Object\");\n\n    Path f = temp.newFile(\"invalid.json\").toPath();\n    Files.write(f, \"trash\".getBytes(StandardCharsets.UTF_8), StandardOpenOption.CREATE);\n    SarifParserFactory.create(new RoslynReport(null, f), String::toString);\n  }\n\n  @Test\n  public void testInvalidJson() throws IOException {\n    thrown.expectMessage(\"Unable to parse the Roslyn SARIF report file:\");\n    thrown.expectMessage(\"invalid.json\");\n    thrown.expectMessage(\"Unrecognized format\");\n\n    Path f = temp.newFile(\"invalid.json\").toPath();\n    Files.write(f, \"{}\".getBytes(StandardCharsets.UTF_8), StandardOpenOption.CREATE);\n    SarifParserFactory.create(new RoslynReport(null, f), String::toString);\n  }\n\n  @Test\n  public void testCreate_v10() {\n    SarifParser parser = SarifParserFactory.create(new RoslynReport(null, Paths.get(\"src/test/resources/SarifParserTest/v1_0.json\")), String::toString);\n    assertThat(parser).isInstanceOf(SarifParser10.class);\n  }\n\n  @Test\n  public void testCreate_v04() {\n    SarifParser parser = SarifParserFactory.create(new RoslynReport(null, Paths.get(\"src/test/resources/SarifParserTest/v0_4.json\")), String::toString);\n    assertThat(parser).isInstanceOf(SarifParser01And04.class);\n\n  }\n\n  @Test\n  public void testCreate_v01() {\n    SarifParser parser = SarifParserFactory.create(new RoslynReport(null, Paths.get(\"src/test/resources/SarifParserTest/v0_1.json\")), String::toString);\n    assertThat(parser).isInstanceOf(SarifParser01And04.class);\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/AbstractSonarWayProfile/Sonar_way_profile.json",
    "content": "{\n  \"name\": \"Sonar way\",\n  \"ruleKeys\": [\n    \"S-REAL-1\",\n    \"S-REAL-2\",\n    \"S-FAKE\"\n  ]\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/Directory.Build.targets",
    "content": "<Project>\n  <PropertyGroup>\n    <RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>\n    <DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>\n  </PropertyGroup>\n</Project>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/DotNetRulesDefinitionTest/Rules.json",
    "content": "[\n  {\n    \"id\": \"S100\",\n    \"parameters\": []\n  },\n  {\n    \"id\": \"S1111\",\n    \"parameters\": []\n  },\n  {\n    \"id\": \"S1112\",\n    \"parameters\": [\n      {\n        \"key\": \"random\",\n        \"description\": \"chosen by fair dice roll. guaranteed to be random.\",\n        \"type\": \"INTEGER\",\n        \"defaultValue\": \"4\"\n      },\n      {\n        \"key\": \"Tr0ub4dor&3\",\n        \"description\": \"ELI5 entropy please!\",\n        \"type\": \"STRING\",\n        \"defaultValue\": \"correct horse battery staple\"\n      }\n    ]\n  },\n  {\n    \"id\": \"S1113\",\n    \"parameters\": [\n      {\n        \"key\": \"answer\",\n        \"description\": \"Answer to life the universe and everything.\",\n        \"type\": \"INTEGER\",\n        \"defaultValue\": \"42\"\n      }\n    ]\n  },\n  {\n    \"id\": \"S1114\",\n    \"parameters\": []\n  },\n  {\n    \"id\": \"S1115\",\n    \"parameters\": []\n  },\n  {\n    \"id\": \"S1116\",\n    \"parameters\": []\n  },\n  {\n    \"id\": \"S1117\",\n    \"parameters\": []\n  },\n  {\n    \"id\": \"S4502\",\n    \"parameters\": []\n  },\n  {\n    \"id\": \"S2115\",\n    \"parameters\": []\n  }\n]\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/DotNetRulesDefinitionTest/S100.html",
    "content": "<h2>Why is this an issue?</h2>\n<p>Shared naming conventions allow teams to collaborate efficiently.</p>\n<p>This rule raises an issue when a method or a property name is not PascalCased.</p>\n<p>For example, the method</p>\n<pre>\npublic int doSomething() {...} // Noncompliant\n</pre>\n<p>should be renamed to</p>\n<pre>\npublic int DoSomething() {...}\n</pre>\n<h3>Exceptions</h3>\n<ul>\n  <li> The rule ignores members in types marked with <code>ComImportAttribute</code> or <code>InterfaceTypeAttribute</code>. </li>\n  <li> The rule ignores <code>extern</code> methods. </li>\n  <li> To reduce noise, two consecutive upper-case characters are allowed unless they form the full name. So, <code>MyXMethod</code> is compliant, but\n  <code>XM</code> is not. </li>\n  <li> The camel casing is not enforced when a name contains the <code>'_'</code> character. </li>\n</ul>\n<pre>\nvoid My_method_(){...} // Noncompliant, leading and trailing underscores are reported\n\nvoid My_method(){...} // Compliant by exception\n</pre>\n<h2>Resources</h2>\n<h3>Documentation</h3>\n<p><a href=\"https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/capitalization-conventions\">Microsoft Capitalization\nConventions</a></p>\n\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/DotNetRulesDefinitionTest/S100.json",
    "content": "{\n  \"title\": \"Methods and properties should be named in PascalCase\",\n  \"type\": \"CODE_SMELL\",\n  \"code\": {\n    \"impacts\": {\n      \"MAINTAINABILITY\": \"LOW\"\n    },\n    \"attribute\": \"IDENTIFIABLE\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Minor\",\n  \"ruleSpecification\": \"RSPEC-100\",\n  \"sqKey\": \"S100\",\n  \"scope\": \"All\",\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/DotNetRulesDefinitionTest/S1111.html",
    "content": "Lorem ipsum \n<b>HTML</b>. <br /><br /><br />End"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/DotNetRulesDefinitionTest/S1111.json",
    "content": "{\n  \"title\": \"Constant remediation\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"cwe\",\n    \"owasp-a10\",\n    \"sans-top25-porous\",\n    \"owasp-a3\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-1111\",\n  \"sqKey\": \"S1111\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      117,\n      532\n    ],\n    \"OWASP\": [\n      \"A3\",\n      \"A10\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A9\"\n    ]\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/DotNetRulesDefinitionTest/S1112.html",
    "content": "Lorem ipsum \n<b>HTML</b>. <br /><br /><br />End"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/DotNetRulesDefinitionTest/S1112.json",
    "content": "{\n  \"title\": \"Linear remediation\",\n  \"type\": \"CODE_SMELL\",\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Linear\",\n    \"linearDesc\": \"Something\",\n    \"linearFactor\": \"10min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-1111\",\n  \"scope\": \"Main\"\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/DotNetRulesDefinitionTest/S1113.html",
    "content": "Lorem ipsum \n<b>HTML</b>. <br /><br /><br />End"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/DotNetRulesDefinitionTest/S1113.json",
    "content": "{\n  \"title\": \"Linear with offset remediation\",\n  \"type\": \"CODE_SMELL\",\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Linear with offset\",\n    \"linearDesc\": \"Number of parents above the defined threshold\",\n    \"linearOffset\": \"4h\",\n    \"linearFactor\": \"30min\"\n  },\n  \"tags\": [],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-1111\",\n  \"scope\": \"Main\"\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/DotNetRulesDefinitionTest/S1114.html",
    "content": "Lorem ipsum \n<b>HTML</b>. <br /><br /><br />End"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/DotNetRulesDefinitionTest/S1114.json",
    "content": "{\n  \"title\": \"No remediation\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"status\": \"ready\",\n  \"tags\": [],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-1111\",\n  \"scope\": \"Main\"\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/DotNetRulesDefinitionTest/S1115.html",
    "content": "Lorem ipsum\n<b>HTML</b>. <br /><br /><br />End"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/DotNetRulesDefinitionTest/S1115.json",
    "content": "{\n  \"title\": \"No remediation\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"status\": \"ready\",\n  \"tags\": [ ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-1115\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"PCI DSS 3.2\": [\n      \"6.5.10\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"6.2.4\"\n    ]\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/DotNetRulesDefinitionTest/S1116.html",
    "content": "Lorem ipsum\n<b>HTML</b>. <br /><br /><br />End"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/DotNetRulesDefinitionTest/S1116.json",
    "content": "{\n  \"title\": \"No remediation\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"status\": \"ready\",\n  \"tags\": [ ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-1116\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"ASVS 4.0\": [\n      \"2.10.4\",\n      \"3.5.2\",\n      \"6.4.1\"\n    ]\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/DotNetRulesDefinitionTest/S1117.html",
    "content": "Lorem ipsum\n<b>HTML</b>. <br /><br /><br />End"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/DotNetRulesDefinitionTest/S1117.json",
    "content": "{\n  \"title\": \"No remediation\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"status\": \"ready\",\n  \"tags\": [ ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-1116\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"STIG ASD_V5R3\": [\n      \"V-222542\",\n      \"V-222603\"\n    ]\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/DotNetRulesDefinitionTest/S2115.html",
    "content": "<p>When accessing a database, an empty password should be avoided as it introduces a weakness.</p>\n<h2>Why is this an issue?</h2>\n<p>When a database does not require a password for authentication, it allows anyone to access and manipulate the data stored within it. Exploiting\nthis vulnerability typically involves identifying the target database and establishing a connection to it without the need for any authentication\ncredentials.</p>\n<h3>What is the potential impact?</h3>\n<p>Once connected, an attacker can perform various malicious actions, such as viewing, modifying, or deleting sensitive information, potentially\nleading to data breaches or unauthorized access to critical systems. It is crucial to address this vulnerability promptly to ensure the security and\nintegrity of the database and the data it contains.</p>\n<h4>Unauthorized Access to Sensitive Data</h4>\n<p>When a database lacks a password for authentication, it opens the door for unauthorized individuals to gain access to sensitive data. This can\ninclude personally identifiable information (PII), financial records, intellectual property, or any other confidential information stored in the\ndatabase. Without proper access controls in place, malicious actors can exploit this vulnerability to retrieve sensitive data, potentially leading to\nidentity theft, financial loss, or reputational damage.</p>\n<h4>Compromise of System Integrity</h4>\n<p>Without a password requirement, unauthorized individuals can gain unrestricted access to a database, potentially compromising the integrity of the\nentire system. Attackers can inject malicious code, alter configurations, or manipulate data within the database, leading to system malfunctions,\nunauthorized system access, or even complete system compromise. This can disrupt business operations, cause financial losses, and expose the\norganization to further security risks.</p>\n<h4>Unwanted Modifications or Deletions</h4>\n<p>The absence of a password for database access allows anyone to make modifications or deletions to the data stored within it. This poses a\nsignificant risk, as unauthorized changes can lead to data corruption, loss of critical information, or the introduction of malicious content. For\nexample, an attacker could modify financial records, tamper with customer orders, or delete important files, causing severe disruptions to business\nprocesses and potentially leading to financial and legal consequences.</p>\n<p>Overall, the lack of a password configured to access a database poses a serious security risk, enabling unauthorized access, data breaches, system\ncompromise, and unwanted modifications or deletions. It is essential to address this vulnerability promptly to safeguard sensitive data, maintain\nsystem integrity, and protect the organization from potential harm.</p>\n<h2>How to fix it in Entity Framework Core</h2>\n<h3>Code examples</h3>\n<p>The following code uses an empty password to connect to a SQL Server database.</p>\n<p>The vulnerability can be fixed by using Windows authentication (sometimes referred to as integrated security).</p>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"302\" data-diff-type=\"noncompliant\">\nprotected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)\n{\n  optionsBuilder.UseSqlServer(\"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=\"); // Noncompliant\n}\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"302\" data-diff-type=\"compliant\">\nprotected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)\n{\n  optionsBuilder.UseSqlServer(\"Server=myServerAddress;Database=myDataBase;Integrated Security=True\");\n}\n</pre>\n<h3>How does this work?</h3>\n<h4>Windows authentication (integrated security)</h4>\n<p>When the connection string includes the <code>Integrated Security=true</code> parameter, it enables Windows authentication (sometimes called\nintegrated security) for the database connection. With integrated security, the user’s Windows credentials are used to authenticate and authorize\naccess to the database. It eliminates the need for a separate username and password for the database connection. Integrated security simplifies\nauthentication and leverages the existing Windows authentication infrastructure for secure database access in your C# application.</p>\n<p>It’s important to note that when using integrated security, the user running the application must have the necessary permissions to access the\ndatabase. Ensure that the user account running the application has the appropriate privileges and is granted access to the database.</p>\n<p>The syntax employed in connection strings varies by provider:</p>\n<table>\n  <colgroup>\n    <col style=\"width: 50%;\">\n    <col style=\"width: 50%;\">\n  </colgroup>\n  <tbody>\n    <tr>\n      <td><p>Syntax</p></td>\n      <td><p>Supported by</p></td>\n    </tr>\n    <tr>\n      <td><p><code>Integrated Security=true;</code></p></td>\n      <td><p>SQL Server, Oracle, Postgres</p></td>\n    </tr>\n    <tr>\n      <td><p><code>Integrated Security=SSPI;</code></p></td>\n      <td><p>SQL Server, OLE DB</p></td>\n    </tr>\n    <tr>\n      <td><p><code>Integrated Security=yes;</code></p></td>\n      <td><p>MySQL</p></td>\n    </tr>\n    <tr>\n      <td><p><code>Trusted_Connection=true;</code></p></td>\n      <td><p>SQL Server</p></td>\n    </tr>\n    <tr>\n      <td><p><code>Trusted_Connection=yes;</code></p></td>\n      <td><p>ODBC</p></td>\n    </tr>\n  </tbody>\n</table>\n<p>Note: Some providers such as MySQL do not support Windows authentication with .NET Core.</p>\n<h3>Pitfalls</h3>\n<h4>Hard-coded passwords</h4>\n<p>It could be tempting to replace the empty password with a hard-coded one. Hard-coding passwords in the code can pose significant security risks.\nHere are a few reasons why it is not recommended:</p>\n<ol>\n  <li> Security Vulnerability: Hard-coded passwords can be easily discovered by anyone who has access to the code, such as other developers or\n  attackers. This can lead to unauthorized access to the database and potential data breaches. </li>\n  <li> Lack of Flexibility: Hard-coded passwords make it difficult to change the password without modifying the code. If the password needs to be\n  updated, it would require recompiling and redeploying the code, which can be time-consuming and error-prone. </li>\n  <li> Version Control Issues: Storing passwords in code can lead to version control issues. If the code is shared or stored in a version control\n  system, the password will be visible to anyone with access to the repository, which is a security risk. </li>\n</ol>\n<p>To mitigate these risks, it is recommended to use secure methods for storing and retrieving passwords, such as using environment variables,\nconfiguration files, or secure key management systems. These methods allow for better security, flexibility, and separation of sensitive information\nfrom the codebase.</p>\n<h2>How to fix it in ASP.NET</h2>\n<h3>Code examples</h3>\n<p>The following configuration file uses an empty password to connect to a database.</p>\n<p>The vulnerability can be fixed by using Windows authentication (sometimes referred to as integrated security)</p>\n<h4>Noncompliant code example</h4>\n<pre data-diff-id=\"301\" data-diff-type=\"noncompliant\">\n&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;configuration&gt;\n  &lt;connectionStrings&gt;\n    &lt;add name=\"myConnection\" connectionString=\"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=\" /&gt; &lt;!-- Noncompliant --&gt;\n  &lt;/connectionStrings&gt;\n&lt;/configuration&gt;\n</pre>\n<h4>Compliant solution</h4>\n<pre data-diff-id=\"301\" data-diff-type=\"compliant\">\n&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;configuration&gt;\n  &lt;connectionStrings&gt;\n    &lt;add name=\"myConnection\" connectionString=\"Server=myServerAddress;Database=myDataBase;Integrated Security=True\" /&gt;\n  &lt;/connectionStrings&gt;\n&lt;/configuration&gt;\n</pre>\n<h3>How does this work?</h3>\n<h4>Windows authentication (integrated security)</h4>\n<p>When the connection string includes the <code>Integrated Security=true</code> parameter, it enables Windows authentication (sometimes called\nintegrated security) for the database connection. With integrated security, the user’s Windows credentials are used to authenticate and authorize\naccess to the database. It eliminates the need for a separate username and password for the database connection. Integrated security simplifies\nauthentication and leverages the existing Windows authentication infrastructure for secure database access in your C# application.</p>\n<p>It’s important to note that when using integrated security, the user running the application must have the necessary permissions to access the\ndatabase. Ensure that the user account running the application has the appropriate privileges and is granted access to the database.</p>\n<p>The syntax employed in connection strings varies by provider:</p>\n<table>\n  <colgroup>\n    <col style=\"width: 50%;\">\n    <col style=\"width: 50%;\">\n  </colgroup>\n  <tbody>\n    <tr>\n      <td><p>Syntax</p></td>\n      <td><p>Supported by</p></td>\n    </tr>\n    <tr>\n      <td><p><code>Integrated Security=true;</code></p></td>\n      <td><p>SQL Server, Oracle, Postgres</p></td>\n    </tr>\n    <tr>\n      <td><p><code>Integrated Security=SSPI;</code></p></td>\n      <td><p>SQL Server, OLE DB</p></td>\n    </tr>\n    <tr>\n      <td><p><code>Integrated Security=yes;</code></p></td>\n      <td><p>MySQL</p></td>\n    </tr>\n    <tr>\n      <td><p><code>Trusted_Connection=true;</code></p></td>\n      <td><p>SQL Server</p></td>\n    </tr>\n    <tr>\n      <td><p><code>Trusted_Connection=yes;</code></p></td>\n      <td><p>ODBC</p></td>\n    </tr>\n  </tbody>\n</table>\n<p>Note: Some providers such as MySQL do not support Windows authentication with .NET Core.</p>\n<h3>Pitfalls</h3>\n<h4>Hard-coded passwords</h4>\n<p>It could be tempting to replace the empty password with a hard-coded one. Hard-coding passwords in the code can pose significant security risks.\nHere are a few reasons why it is not recommended:</p>\n<ol>\n  <li> Security Vulnerability: Hard-coded passwords can be easily discovered by anyone who has access to the code, such as other developers or\n  attackers. This can lead to unauthorized access to the database and potential data breaches. </li>\n  <li> Lack of Flexibility: Hard-coded passwords make it difficult to change the password without modifying the code. If the password needs to be\n  updated, it would require recompiling and redeploying the code, which can be time-consuming and error-prone. </li>\n  <li> Version Control Issues: Storing passwords in code can lead to version control issues. If the code is shared or stored in a version control\n  system, the password will be visible to anyone with access to the repository, which is a security risk. </li>\n</ol>\n<p>To mitigate these risks, it is recommended to use secure methods for storing and retrieving passwords, such as using environment variables,\nconfiguration files, or secure key management systems. These methods allow for better security, flexibility, and separation of sensitive information\nfrom the codebase.</p>\n<h2>Resources</h2>\n<ul>\n  <li> <a href=\"https://docs.microsoft.com/en-us/troubleshoot/aspnet/create-web-config\">Create the Web.config file for an ASP.NET application</a>\n  </li>\n</ul>\n<h3>Standards</h3>\n<ul>\n  <li> OWASP - <a href=\"https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures/\">Top 10 2021 Category A7 - Identification and\n  Authentication Failures</a> </li>\n  <li> OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A2_2017-Broken_Authentication\">Top 10 2017 Category A2 - Broken Authentication</a>\n  </li>\n  <li> OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure\">Top 10 2017 Category A3 - Sensitive Data\n  Exposure</a> </li>\n  <li> CWE - <a href=\"https://cwe.mitre.org/data/definitions/521\">CWE-521 - Weak Password Requirements</a> </li>\n</ul>\n\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/DotNetRulesDefinitionTest/S2115.json",
    "content": "{\n  \"title\": \"A secure password should be used when connecting to a database\",\n  \"type\": \"VULNERABILITY\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"HIGH\"\n    },\n    \"attribute\": \"TRUSTWORTHY\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"45min\"\n  },\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Blocker\",\n  \"ruleSpecification\": \"RSPEC-2115\",\n  \"sqKey\": \"S2115\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      521\n    ],\n    \"OWASP\": [\n      \"A2\",\n      \"A3\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A7\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"6.5.10\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"6.2.4\"\n    ],\n    \"ASVS 4.0\": [\n      \"9.2.2\",\n      \"9.2.3\"\n    ]\n  },\n  \"quickfix\": \"unknown\"\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/DotNetRulesDefinitionTest/S4502.html",
    "content": "<p>A cross-site request forgery (CSRF) attack occurs when a trusted user of a web application can be forced, by an attacker, to perform sensitive\nactions that he didn’t intend, such as updating his profile or sending a message, more generally anything that can change the state of the\napplication.</p>\n<p>The attacker can trick the user/victim to click on a link, corresponding to the privileged action, or to visit a malicious web site that embeds a\nhidden web request and as web browsers automatically include cookies, the actions can be authenticated and sensitive.</p>\n<h2>Ask Yourself Whether</h2>\n<ul>\n  <li> The web application uses cookies to authenticate users. </li>\n  <li> There exist sensitive operations in the web application that can be performed when the user is authenticated. </li>\n  <li> The state / resources of the web application can be modified by doing HTTP POST or HTTP DELETE requests for example. </li>\n</ul>\n<p>There is a risk if you answered yes to any of those questions.</p>\n<h2>Recommended Secure Coding Practices</h2>\n<ul>\n  <li> Protection against CSRF attacks is strongly recommended:\n    <ul>\n      <li> to be activated by default for all <a href=\"https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Safe_methods\">unsafe HTTP\n      methods</a>. </li>\n      <li> implemented, for example, with an unguessable CSRF token </li>\n    </ul>  </li>\n  <li> Of course all sensitive operations should not be performed with <a\n  href=\"https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Safe_methods\">safe HTTP</a> methods like <code>GET</code> which are designed to be\n  used only for information retrieval. </li>\n</ul>\n<h2>Sensitive Code Example</h2>\n<pre>\npublic void ConfigureServices(IServiceCollection services)\n{\n    // ...\n    services.AddControllersWithViews(options =&gt; options.Filters.Add(new IgnoreAntiforgeryTokenAttribute())); // Sensitive\n    // ...\n}\n</pre>\n<pre>\n[HttpPost, IgnoreAntiforgeryToken] // Sensitive\npublic IActionResult ChangeEmail(ChangeEmailModel model) =&gt; View(\"~/Views/...\");\n</pre>\n<h2>Compliant Solution</h2>\n<pre>\npublic void ConfigureServices(IServiceCollection services)\n{\n    // ...\n    services.AddControllersWithViews(options =&gt; options.Filters.Add(new AutoValidateAntiforgeryTokenAttribute()));\n    // or\n    services.AddControllersWithViews(options =&gt; options.Filters.Add(new ValidateAntiForgeryTokenAttribute()));\n    // ...\n}\n</pre>\n<pre>\n[HttpPost]\n[AutoValidateAntiforgeryToken]\npublic IActionResult ChangeEmail(ChangeEmailModel model) =&gt; View(\"~/Views/...\");\n</pre>\n<h2>See</h2>\n<ul>\n  <li> OWASP - <a href=\"https://owasp.org/Top10/A01_2021-Broken_Access_Control/\">Top 10 2021 Category A1 - Broken Access Control</a> </li>\n  <li> CWE - <a href=\"https://cwe.mitre.org/data/definitions/352\">CWE-352 - Cross-Site Request Forgery (CSRF)</a> </li>\n  <li> OWASP - <a href=\"https://owasp.org/www-project-top-ten/2017/A6_2017-Security_Misconfiguration\">Top 10 2017 Category A6 - Security\n  Misconfiguration</a> </li>\n  <li> OWASP - <a href=\"https://owasp.org/www-community/attacks/csrf\">Cross-Site Request Forgery</a> </li>\n  <li> STIG Viewer - <a href=\"https://stigviewer.com/stig/application_security_and_development/2023-06-08/finding/V-222603\">Application Security and\n  Development: V-222603</a> - The application must protect from Cross-Site Request Forgery (CSRF) vulnerabilities. </li>\n  <li> PortSwigger - <a href=\"https://portswigger.net/research/web-storage-the-lesser-evil-for-session-tokens\">Web storage: the lesser evil for\n  session tokens</a> </li>\n</ul>\n\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/DotNetRulesDefinitionTest/S4502.json",
    "content": "{\n  \"title\": \"Disabling CSRF protections is security-sensitive\",\n  \"type\": \"SECURITY_HOTSPOT\",\n  \"code\": {\n    \"impacts\": {\n      \"SECURITY\": \"HIGH\"\n    },\n    \"attribute\": \"CONVENTIONAL\"\n  },\n  \"status\": \"ready\",\n  \"remediation\": {\n    \"func\": \"Constant\\/Issue\",\n    \"constantCost\": \"5min\"\n  },\n  \"tags\": [\n    \"cwe\"\n  ],\n  \"defaultSeverity\": \"Critical\",\n  \"ruleSpecification\": \"RSPEC-4502\",\n  \"sqKey\": \"S4502\",\n  \"scope\": \"Main\",\n  \"securityStandards\": {\n    \"CWE\": [\n      352\n    ],\n    \"OWASP\": [\n      \"A6\"\n    ],\n    \"OWASP Top 10 2021\": [\n      \"A1\"\n    ],\n    \"PCI DSS 3.2\": [\n      \"6.5.9\"\n    ],\n    \"PCI DSS 4.0\": [\n      \"6.2.4\"\n    ],\n    \"ASVS 4.0\": [\n      \"13.2.3\",\n      \"4.2.2\"\n    ],\n    \"STIG ASD_V5R3\": [\n      \"V-222603\"\n    ]\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/DotNetRulesDefinitionTest/Sonar_way_profile.json",
    "content": "{\n  \"name\": \"Sonar way\",\n  \"ruleKeys\": [\n    \"S100\",\n    \"S1111\",\n    \"S1112\",\n    \"S1113\",\n    \"S1114\",\n    \"S1115\",\n    \"S1116\",\n    \"S4502\",\n    \"S2115\"\n  ]\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/HashProvider/Ansi.cs",
    "content": ""
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/HashProvider/CodeNoBom.cs",
    "content": "public class Sample\n{\n\r\tint field;\n\r}\r"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/HashProvider/CodeWithBom.cs",
    "content": "﻿public class Sample\n{\n\r\tint field;\n\r}\r"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/HashProvider/EmptyNoBom.cs",
    "content": ""
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/HashProvider/EmptyWithBom.cs",
    "content": "﻿"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/HashProvider/Utf8.cs",
    "content": "﻿ěščřžýáí"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/LogSensorTest/log.pb",
    "content": "\u0014\b\u0001\u0012\u0010First debug line\u0015\b\u0001\u0012\u0011Second debug line\u0014\b\u0002\u0012\u0010Single info line\u0017\b\u0003\u0012\u0013Single warning line"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/MethodDeclarationsSensorTest/ReadMe.md",
    "content": "# Steps to recreate the protobuf file\n\n- build the plugin locally\n- install it on local instance of SonarQube\n- run the analysis on the [TestMethodImport project](TestMethodImport)\n- copy the generated file from the output directory to the [protobuf-files directory](protobuf-files)"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/MethodDeclarationsSensorTest/TestMethodImport/TestMethodImport.Tests/TestBase.cs",
    "content": "namespace TestMethodImport.Tests;\n\npublic abstract class TestBase\n{\n    [TestMethod]\n    public void TestMethodInBaseClass() =>\n        Assert.AreEqual(1, 1);\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/MethodDeclarationsSensorTest/TestMethodImport/TestMethodImport.Tests/TestClass.cs",
    "content": "﻿namespace TestMethodImport.Tests;\n\n[TestClass]\npublic sealed class TestClass : TestBase\n{\n    [TestMethod]\n    public void TestMethod()\n    {\n    }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/MethodDeclarationsSensorTest/TestMethodImport/TestMethodImport.Tests/TestMethodImport.Tests.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n    <PropertyGroup>\n        <TargetFramework>net9.0</TargetFramework>\n        <LangVersion>latest</LangVersion>\n        <ImplicitUsings>enable</ImplicitUsings>\n        <Nullable>enable</Nullable>\n    </PropertyGroup>\n\n    <ItemGroup>\n        <PackageReference Include=\"Microsoft.NET.Test.Sdk\" Version=\"17.12.0\" />\n        <PackageReference Include=\"MSTest\" Version=\"3.6.4\" />\n    </ItemGroup>\n\n    <ItemGroup>\n        <Using Include=\"Microsoft.VisualStudio.TestTools.UnitTesting\"/>\n    </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/MethodDeclarationsSensorTest/TestMethodImport/TestMethodImport.Tests/packages.lock.json",
    "content": "{\n  \"version\": 1,\n  \"dependencies\": {\n    \"net9.0\": {\n      \"Microsoft.NET.Test.Sdk\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[17.12.0, )\",\n        \"resolved\": \"17.12.0\",\n        \"contentHash\": \"kt/PKBZ91rFCWxVIJZSgVLk+YR+4KxTuHf799ho8WNiK5ZQpJNAEZCAWX86vcKrs+DiYjiibpYKdGZP6+/N17w==\",\n        \"dependencies\": {\n          \"Microsoft.CodeCoverage\": \"17.12.0\",\n          \"Microsoft.TestPlatform.TestHost\": \"17.12.0\"\n        }\n      },\n      \"MSTest\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[3.6.4, )\",\n        \"resolved\": \"3.6.4\",\n        \"contentHash\": \"PDBqb7FT15DBD/LQtAr2Eq/UY9YVTgsY7CD7ZiDnamc/RI+/2VSak6qotTV+x2oyhcRJxE4USRgyqXIRlyU3kw==\",\n        \"dependencies\": {\n          \"MSTest.Analyzers\": \"[3.6.4]\",\n          \"MSTest.TestAdapter\": \"[3.6.4]\",\n          \"MSTest.TestFramework\": \"[3.6.4]\",\n          \"Microsoft.NET.Test.Sdk\": \"17.11.1\"\n        }\n      },\n      \"Microsoft.ApplicationInsights\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.22.0\",\n        \"contentHash\": \"3AOM9bZtku7RQwHyMEY3tQMrHIgjcfRDa6YQpd/QG2LDGvMydSlL9Di+8LLMt7J2RDdfJ7/2jdYv6yHcMJAnNw==\",\n        \"dependencies\": {\n          \"System.Diagnostics.DiagnosticSource\": \"5.0.0\"\n        }\n      },\n      \"Microsoft.CodeCoverage\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"17.12.0\",\n        \"contentHash\": \"4svMznBd5JM21JIG2xZKGNanAHNXplxf/kQDFfLHXQ3OnpJkayRK/TjacFjA+EYmoyuNXHo/sOETEfcYtAzIrA==\"\n      },\n      \"Microsoft.Testing.Extensions.Telemetry\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.4.3\",\n        \"contentHash\": \"dh8jnqWikxQXJ4kWy8B82PtSAlQCnvDKh1128arDmSW5OU5xWA84HwruV3TanXi3ZjIHn1wWFCgtMOhcDNwBow==\",\n        \"dependencies\": {\n          \"Microsoft.ApplicationInsights\": \"2.22.0\",\n          \"Microsoft.Testing.Platform\": \"1.4.3\"\n        }\n      },\n      \"Microsoft.Testing.Extensions.TrxReport.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.4.3\",\n        \"contentHash\": \"16sWznD6ZMok/zgW+vrO6zerCFMD9N+ey9bi1iV/e9xxsQb4V4y/aW6cY/Y7E9jA7pc+aZ6ffZby43yxQOoYZA==\",\n        \"dependencies\": {\n          \"Microsoft.Testing.Platform\": \"1.4.3\"\n        }\n      },\n      \"Microsoft.Testing.Extensions.VSTestBridge\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.4.3\",\n        \"contentHash\": \"xZ6oyNYh2aM5Wb+HJAy1fj2C4CNRVhINXHCjlWs/2C8hEIpdqVSpP3y6HWUN40KpFqyGD4myHGR1Rflm28UpcQ==\",\n        \"dependencies\": {\n          \"Microsoft.ApplicationInsights\": \"2.22.0\",\n          \"Microsoft.TestPlatform.ObjectModel\": \"17.11.1\",\n          \"Microsoft.Testing.Extensions.Telemetry\": \"1.4.3\",\n          \"Microsoft.Testing.Extensions.TrxReport.Abstractions\": \"1.4.3\",\n          \"Microsoft.Testing.Platform\": \"1.4.3\"\n        }\n      },\n      \"Microsoft.Testing.Platform\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.4.3\",\n        \"contentHash\": \"NedIbwl1T7+ZMeg7gwk0Db8/RFLf0siyVpeTcRMMOle6Xl/ujaYOM4Aduo8rEfVqNj3kcQ7blegpyT3dHi+0PA==\"\n      },\n      \"Microsoft.Testing.Platform.MSBuild\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.4.3\",\n        \"contentHash\": \"1gGqgHtiZ6tZn/6Tby+qlKpNe5Ye/5LnxlSsyl4XMZ4m4V+Cu1K1m+gD1zxoxHIvLjgX8mCnQRK95MGBBFuumw==\",\n        \"dependencies\": {\n          \"Microsoft.Testing.Platform\": \"1.4.3\"\n        }\n      },\n      \"Microsoft.TestPlatform.ObjectModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"17.12.0\",\n        \"contentHash\": \"TDqkTKLfQuAaPcEb3pDDWnh7b3SyZF+/W9OZvWFp6eJCIiiYFdSB6taE2I6tWrFw5ywhzOb6sreoGJTI6m3rSQ==\",\n        \"dependencies\": {\n          \"System.Reflection.Metadata\": \"1.6.0\"\n        }\n      },\n      \"Microsoft.TestPlatform.TestHost\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"17.12.0\",\n        \"contentHash\": \"MiPEJQNyADfwZ4pJNpQex+t9/jOClBGMiCiVVFuELCMSX2nmNfvUor3uFVxNNCg30uxDP8JDYfPnMXQzsfzYyg==\",\n        \"dependencies\": {\n          \"Microsoft.TestPlatform.ObjectModel\": \"17.12.0\",\n          \"Newtonsoft.Json\": \"13.0.1\"\n        }\n      },\n      \"MSTest.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"3.6.4\",\n        \"contentHash\": \"4gU/VdItLebmE2+UkOaqffVmVa/in0VeIF9fmN/fG0tj5AHAasjasJcZa9U2uXBNX03cKCWlgWenlhKLz343NQ==\"\n      },\n      \"MSTest.TestAdapter\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"3.6.4\",\n        \"contentHash\": \"YdwseRA+nDhRqD2oPHjCE4KzLEN5B10A61lOslE3N3OvUwHJ6ezyZZjYWf7mrZ8jckCcx/UlBclTzgWUpMpPQw==\",\n        \"dependencies\": {\n          \"Microsoft.Testing.Extensions.VSTestBridge\": \"1.4.3\",\n          \"Microsoft.Testing.Platform.MSBuild\": \"1.4.3\"\n        }\n      },\n      \"MSTest.TestFramework\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"3.6.4\",\n        \"contentHash\": \"3nV+2CJluKmiJpCSqQfXu5idCq35+vqFywjScyauTIz0Zk7KJw7Qpzv8gtwow0To7pxIlIvwkq9rbMB+V6eOow==\"\n      },\n      \"Newtonsoft.Json\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"13.0.1\",\n        \"contentHash\": \"ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==\"\n      },\n      \"System.Diagnostics.DiagnosticSource\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.0.0\",\n        \"contentHash\": \"tCQTzPsGZh/A9LhhA6zrqCRV4hOHsK90/G7q3Khxmn6tnB1PuNU0cRaKANP2AWcF9bn0zsuOoZOSrHuJk6oNBA==\"\n      },\n      \"System.Reflection.Metadata\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.6.0\",\n        \"contentHash\": \"COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==\"\n      }\n    }\n  }\n}"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/MethodDeclarationsSensorTest/TestMethodImport/TestMethodImport.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 12.00\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"TestMethodImport.Tests\", \"TestMethodImport.Tests\\TestMethodImport.Tests.csproj\", \"{BCFD6FBC-6BDD-4DE9-A0E5-E0F28A5071FD}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Any CPU = Debug|Any CPU\n\t\tRelease|Any CPU = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{BCFD6FBC-6BDD-4DE9-A0E5-E0F28A5071FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{BCFD6FBC-6BDD-4DE9-A0E5-E0F28A5071FD}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{BCFD6FBC-6BDD-4DE9-A0E5-E0F28A5071FD}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{BCFD6FBC-6BDD-4DE9-A0E5-E0F28A5071FD}.Release|Any CPU.Build.0 = Release|Any CPU\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/MethodDeclarationsSensorTest/protobuf-files/test-method-declarations.pb",
    "content": "\u0002\n\u0001D:\\src\\sonar\\sonar-dotnet-enterprise\\sonar-dotnet-core\\src\\test\\resources\\MethodDeclarationsSensorTest\\TestMethodImport\\TestMethodImport.Tests\\TestClass.cs\u0012\u0016TestMethodImport.Tests\u001a.\n TestMethodImport.Tests.TestClass\u0012\nTestMethod\u001a9\n TestMethodImport.Tests.TestClass\u0012\u0015TestMethodInBaseClass\u0001\n\u0001D:\\src\\sonar\\sonar-dotnet-enterprise\\sonar-dotnet-core\\src\\test\\resources\\MethodDeclarationsSensorTest\\TestMethodImport\\TestMethodImport.Tests\\TestBase.cs\u0012\u0016TestMethodImport.Tests\u001a8\n\u001fTestMethodImport.Tests.TestBase\u0012\u0015TestMethodInBaseClass"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/Program.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Diagnostics.CodeAnalysis;\n\n\n//-----------------------------------------------------------------------\n// <copyright file=\"ArgumentValidation.cs\" company=\"SonarSource SA and Microsoft Corporation\">\n//   Copyright (c) SonarSource SA and Microsoft Corporation.  All rights reserved.\n//   Licensed under the MIT License. See License.txt in the project root for license information.\n// </copyright>\n//-----------------------------------------------------------------------\nnamespace ConsoleApplication1\n{\n    /// <summary>\n    /// Static methods that implement aspects of the NUnit framework that cut\n    /// across individual test types, extensions, etc. Some of these use the\n    /// methods of the Reflect class to implement operations specific to the\n    /// NUnit Framework.\n    /// </summary>\n    public class Program\n    {\n        public static int Add(int op1, int op2)\n        {\n            if (op1 == 0)\n            {\n                return op2;\n            }\n\n            if (op2 == 0)\n            {\n                return op1;\n            }\n\n            return op1 + op2;\n        }\n\n        static void Main(string[] args)\n        {\n        }\n    }\n\n    class IFoo\n    {\n    }\n\n    class IBar  // NOSONAR\n    {\n    }\n\n    [SuppressMessage(\"Maintainability\", \"S2326:Unused type parameters should be removed\")]\n    class MoreMath<T> // Noncompliant; <T>is ignored\n    {\n        public int Add<T>(int a, int b) // Noncompliant; <T> is ignored\n        {\n            return a + b;\n        }\n    }\n\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/ProtobufImporterTest/Program.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Diagnostics.CodeAnalysis;\n\n\n//-----------------------------------------------------------------------\n// <copyright file=\"ArgumentValidation.cs\" company=\"SonarSource SA and Microsoft Corporation\">\n//   Copyright (c) SonarSource SA and Microsoft Corporation.  All rights reserved.\n//   Licensed under the MIT License. See License.txt in the project root for license information.\n// </copyright>\n//-----------------------------------------------------------------------\nnamespace ConsoleApplication1\n{\n    /// <summary>\n    /// Static methods that implement aspects of the NUnit framework that cut\n    /// across individual test types, extensions, etc. Some of these use the\n    /// methods of the Reflect class to implement operations specific to the\n    /// NUnit Framework.\n    /// </summary>\n    public class Program\n    {\n        public static int Add(int op1, int op2)\n        {\n            if (op1 == 0)\n            {\n                return op2;\n            }\n\n            if (op2 == 0)\n            {\n                return op1;\n            }\n\n            return op1 + op2;\n        }\n\n        static void Main(string[] args)\n        {\n        }\n    }\n\n    class IFoo\n    {\n    }\n\n    class IBar  // NOSONAR\n    {\n    }\n\n    [SuppressMessage(\"Maintainability\", \"S2326:Unused type parameters should be removed\")]\n    class MoreMath<T> // Noncompliant; <T>is ignored\n    {\n        public int Add<T>(int a, int b) // Noncompliant; <T> is ignored\n        {\n            return a + b;\n        }\n    }\n\t\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/ProtobufImporterTest/README.md",
    "content": "Test data generation\n====================\n\nThe test files in this directory are generated with:\n\n1. Copy `Program.cs` into `sonar-examples/projects/languages/csharp/ConsoleApplication1`\n\n2. Open the `ConsoleApplication1` solution, add `Program.cs` to the project, save and build it\n\n3. Install the latest C# plugin in local SonarQube\n\n4. Launch an analysis locally\n\n5. Copy `Program.cs` and `*.pb` files to *this* directory\n\n6. Run `ProtobufFilterTool`, it will:\n    1. Remove all other files from `.pb` files except `Program.cs`\n    2. Replace the absolute path of `Program.cs` with simply `Program.cs`\n\n7. Re-run all the unit tests, update the expected values accordingly\n\n8. Commit, push, release\n\n9. Copy (the relevant) files to C# project, re-run tests, update expected values, etc\n\n### custom-log.pb\n\nLog file was generated in C# unit test like this:\n\n```\nusing var metricsStream = File.Create(@\"<path>\\custom-log.pb\");\nvar messages = new[]\n{\n    new LogInfo {Severity = LogSeverity.Debug, Text = \"First debug line\" },\n    new LogInfo {Severity = LogSeverity.Debug, Text = \"Second debug line\" },\n    new LogInfo {Severity = LogSeverity.Info, Text = \"Single info line\" },\n    new LogInfo {Severity = LogSeverity.Warning, Text = \"Single warning line\" }\n};\nforeach (var message in messages)\n{\n    message.WriteDelimitedTo(metricsStream);\n}\n```\n\n### unknown-log.pb\n\nSame as `custom-log.pb` with this message:\n\n```\nnew LogInfo {Severity = LogSeverity.UnknownSeverity, Text = \"Unknown severity for Coverage\" }\n```\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/ProtobufImporterTest/custom-log.pb",
    "content": "\u0014\b\u0001\u0012\u0010First debug line\u0015\b\u0001\u0012\u0011Second debug line\u0014\b\u0002\u0012\u0010Single info line\u0017\b\u0003\u0012\u0013Single warning line"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/ProtobufImporterTest/file-metadata.pb",
    "content": "\u0013\n\nProgram.cs\u001a\u0005UTF-8"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/ProtobufImporterTest/invalid-encoding.pb",
    "content": "\u0013\n\nProgram.cs\u001a\u0005UTF-7"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/ProtobufImporterTest/metrics.pb",
    "content": "\u0001\n\nProgram.cs\u0010\u0004\u0018\u0006 \u0003(\u00020\u00018\u0007@\u0007H\u0007R 0=0;5=1;10=0;20=0;30=0;60=0;90=0Z\u001d1=2;2=0;4=1;6=0;8=0;10=0;12=0b\u00011j\f\n\u000b\f\r\u0011\u0012\u0013\u0014\u0015\u001668r)\u0001\u0002\u0003\u0004\u0005\u0006\u000f\u0010\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e !\"#%&()*+-./12356789:;<>x\u0012\u0001\u0006\u001b\u001d \"%:"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/ProtobufImporterTest/symrefs.pb",
    "content": "\u0002\n\nProgram.cs\u0012\n\n\b\b\u0017\u0010\u0017\u0018\u0011 \u0018\u0012\n\n\b\b\u0019\u0010\u0019\u0018\u001a \u001d\u0012(\n\b\b\u0019\u0010\u0019\u0018\" %\u0012\b\b\u001b\u0010\u001b\u0018\u0010 \u0013\u0012\b\b\"\u0010\"\u0018\u0017 \u001a\u0012\b\b%\u0010%\u0018\u0013 \u0016\u0012(\n\b\b\u0019\u0010\u0019\u0018+ .\u0012\b\b\u001d\u0010\u001d\u0018\u0017 \u001a\u0012\b\b \u0010 \u0018\u0010 \u0013\u0012\b\b%\u0010%\u0018\u0019 \u001c\u0012\n\n\b\b(\u0010(\u0018\u0014 \u0018\u0012\n\n\b\b(\u0010(\u0018\" &\u0012\n\n\b\b-\u0010-\u0018\n \u000e\u0012\n\n\b\b1\u00101\u0018\n \u000e\u0012\n\n\b\b6\u00106\u0018\n \u0012\u0012\n\n\b\b6\u00106\u0018\u0013 \u0014\u0012\n\n\b\b8\u00108\u0018\u0013 \u0016\u0012\n\n\b\b8\u00108\u0018\u0017 \u0018\u0012\u0014\n\b\b8\u00108\u0018\u001e \u001f\u0012\b\b:\u0010:\u0018\u0013 \u0014\u0012\u0014\n\b\b8\u00108\u0018% &\u0012\b\b:\u0010:\u0018\u0017 \u0018"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/ProtobufImporterTest/token-cpd.pb",
    "content": "\r\n\nProgram.cs\u0012\u0013\n\tnamespace\u0012\u0006\b\u000f\u0010\u000f \t\u0012\u001f\n\u0013ConsoleApplication1\u0012\b\b\u000f\u0010\u000f\u0018\n \u001d\u0012\u000b\n\u0001{\u0012\u0006\b\u0010\u0010\u0010 \u0001\u0012\u0012\n\u0006public\u0012\b\b\u0017\u0010\u0017\u0018\u0004 \n\u0012\u0011\n\u0005class\u0012\b\b\u0017\u0010\u0017\u0018\u000b \u0010\u0012\u0013\n\u0007Program\u0012\b\b\u0017\u0010\u0017\u0018\u0011 \u0018\u0012\r\n\u0001{\u0012\b\b\u0018\u0010\u0018\u0018\u0004 \u0005\u0012\u0012\n\u0006public\u0012\b\b\u0019\u0010\u0019\u0018\b \u000e\u0012\u0012\n\u0006static\u0012\b\b\u0019\u0010\u0019\u0018\u000f \u0015\u0012\u000f\n\u0003int\u0012\b\b\u0019\u0010\u0019\u0018\u0016 \u0019\u0012\u000f\n\u0003Add\u0012\b\b\u0019\u0010\u0019\u0018\u001a \u001d\u0012\r\n\u0001(\u0012\b\b\u0019\u0010\u0019\u0018\u001d \u001e\u0012\u000f\n\u0003int\u0012\b\b\u0019\u0010\u0019\u0018\u001e !\u0012\u000f\n\u0003op1\u0012\b\b\u0019\u0010\u0019\u0018\" %\u0012\r\n\u0001,\u0012\b\b\u0019\u0010\u0019\u0018% &\u0012\u000f\n\u0003int\u0012\b\b\u0019\u0010\u0019\u0018' *\u0012\u000f\n\u0003op2\u0012\b\b\u0019\u0010\u0019\u0018+ .\u0012\r\n\u0001)\u0012\b\b\u0019\u0010\u0019\u0018. /\u0012\r\n\u0001{\u0012\b\b\u001a\u0010\u001a\u0018\b \t\u0012\u000e\n\u0002if\u0012\b\b\u001b\u0010\u001b\u0018\f \u000e\u0012\r\n\u0001(\u0012\b\b\u001b\u0010\u001b\u0018\u000f \u0010\u0012\u000f\n\u0003op1\u0012\b\b\u001b\u0010\u001b\u0018\u0010 \u0013\u0012\u000e\n\u0002==\u0012\b\b\u001b\u0010\u001b\u0018\u0014 \u0016\u0012\u0010\n\u0004$num\u0012\b\b\u001b\u0010\u001b\u0018\u0017 \u0018\u0012\r\n\u0001)\u0012\b\b\u001b\u0010\u001b\u0018\u0018 \u0019\u0012\r\n\u0001{\u0012\b\b\u001c\u0010\u001c\u0018\f \r\u0012\u0012\n\u0006return\u0012\b\b\u001d\u0010\u001d\u0018\u0010 \u0016\u0012\u000f\n\u0003op2\u0012\b\b\u001d\u0010\u001d\u0018\u0017 \u001a\u0012\r\n\u0001;\u0012\b\b\u001d\u0010\u001d\u0018\u001a \u001b\u0012\r\n\u0001}\u0012\b\b\u001e\u0010\u001e\u0018\f \r\u0012\u000e\n\u0002if\u0012\b\b \u0010 \u0018\f \u000e\u0012\r\n\u0001(\u0012\b\b \u0010 \u0018\u000f \u0010\u0012\u000f\n\u0003op2\u0012\b\b \u0010 \u0018\u0010 \u0013\u0012\u000e\n\u0002==\u0012\b\b \u0010 \u0018\u0014 \u0016\u0012\u0010\n\u0004$num\u0012\b\b \u0010 \u0018\u0017 \u0018\u0012\r\n\u0001)\u0012\b\b \u0010 \u0018\u0018 \u0019\u0012\r\n\u0001{\u0012\b\b!\u0010!\u0018\f \r\u0012\u0012\n\u0006return\u0012\b\b\"\u0010\"\u0018\u0010 \u0016\u0012\u000f\n\u0003op1\u0012\b\b\"\u0010\"\u0018\u0017 \u001a\u0012\r\n\u0001;\u0012\b\b\"\u0010\"\u0018\u001a \u001b\u0012\r\n\u0001}\u0012\b\b#\u0010#\u0018\f \r\u0012\u0012\n\u0006return\u0012\b\b%\u0010%\u0018\f \u0012\u0012\u000f\n\u0003op1\u0012\b\b%\u0010%\u0018\u0013 \u0016\u0012\r\n\u0001+\u0012\b\b%\u0010%\u0018\u0017 \u0018\u0012\u000f\n\u0003op2\u0012\b\b%\u0010%\u0018\u0019 \u001c\u0012\r\n\u0001;\u0012\b\b%\u0010%\u0018\u001c \u001d\u0012\r\n\u0001}\u0012\b\b&\u0010&\u0018\b \t\u0012\u0012\n\u0006static\u0012\b\b(\u0010(\u0018\b \u000e\u0012\u0010\n\u0004void\u0012\b\b(\u0010(\u0018\u000f \u0013\u0012\u0010\n\u0004Main\u0012\b\b(\u0010(\u0018\u0014 \u0018\u0012\r\n\u0001(\u0012\b\b(\u0010(\u0018\u0018 \u0019\u0012\u0012\n\u0006string\u0012\b\b(\u0010(\u0018\u0019 \u001f\u0012\r\n\u0001[\u0012\b\b(\u0010(\u0018\u001f  \u0012\r\n\u0001]\u0012\b\b(\u0010(\u0018  !\u0012\u0010\n\u0004args\u0012\b\b(\u0010(\u0018\" &\u0012\r\n\u0001)\u0012\b\b(\u0010(\u0018& '\u0012\r\n\u0001{\u0012\b\b)\u0010)\u0018\b \t\u0012\r\n\u0001}\u0012\b\b*\u0010*\u0018\b \t\u0012\r\n\u0001}\u0012\b\b+\u0010+\u0018\u0004 \u0005\u0012\u0011\n\u0005class\u0012\b\b-\u0010-\u0018\u0004 \t\u0012\u0010\n\u0004IFoo\u0012\b\b-\u0010-\u0018\n \u000e\u0012\r\n\u0001{\u0012\b\b.\u0010.\u0018\u0004 \u0005\u0012\r\n\u0001}\u0012\b\b/\u0010/\u0018\u0004 \u0005\u0012\u0011\n\u0005class\u0012\b\b1\u00101\u0018\u0004 \t\u0012\u0010\n\u0004IBar\u0012\b\b1\u00101\u0018\n \u000e\u0012\r\n\u0001{\u0012\b\b2\u00102\u0018\u0004 \u0005\u0012\r\n\u0001}\u0012\b\b3\u00103\u0018\u0004 \u0005\u0012\r\n\u0001[\u0012\b\b5\u00105\u0018\u0004 \u0005\u0012\u001b\n\u000fSuppressMessage\u0012\b\b5\u00105\u0018\u0005 \u0014\u0012\r\n\u0001(\u0012\b\b5\u00105\u0018\u0014 \u0015\u0012\u0010\n\u0004$str\u0012\b\b5\u00105\u0018\u0015 &\u0012\r\n\u0001,\u0012\b\b5\u00105\u0018& '\u0012\u0010\n\u0004$str\u0012\b\b5\u00105\u0018( X\u0012\r\n\u0001)\u0012\b\b5\u00105\u0018X Y\u0012\r\n\u0001]\u0012\b\b5\u00105\u0018Y Z\u0012\u0011\n\u0005class\u0012\b\b6\u00106\u0018\u0004 \t\u0012\u0014\n\bMoreMath\u0012\b\b6\u00106\u0018\n \u0012\u0012\r\n\u0001<\u0012\b\b6\u00106\u0018\u0012 \u0013\u0012\r\n\u0001T\u0012\b\b6\u00106\u0018\u0013 \u0014\u0012\r\n\u0001>\u0012\b\b6\u00106\u0018\u0014 \u0015\u0012\r\n\u0001{\u0012\b\b7\u00107\u0018\u0004 \u0005\u0012\u0012\n\u0006public\u0012\b\b8\u00108\u0018\b \u000e\u0012\u000f\n\u0003int\u0012\b\b8\u00108\u0018\u000f \u0012\u0012\u000f\n\u0003Add\u0012\b\b8\u00108\u0018\u0013 \u0016\u0012\r\n\u0001<\u0012\b\b8\u00108\u0018\u0016 \u0017\u0012\r\n\u0001T\u0012\b\b8\u00108\u0018\u0017 \u0018\u0012\r\n\u0001>\u0012\b\b8\u00108\u0018\u0018 \u0019\u0012\r\n\u0001(\u0012\b\b8\u00108\u0018\u0019 \u001a\u0012\u000f\n\u0003int\u0012\b\b8\u00108\u0018\u001a \u001d\u0012\r\n\u0001a\u0012\b\b8\u00108\u0018\u001e \u001f\u0012\r\n\u0001,\u0012\b\b8\u00108\u0018\u001f  \u0012\u000f\n\u0003int\u0012\b\b8\u00108\u0018! $\u0012\r\n\u0001b\u0012\b\b8\u00108\u0018% &\u0012\r\n\u0001)\u0012\b\b8\u00108\u0018& '\u0012\r\n\u0001{\u0012\b\b9\u00109\u0018\b \t\u0012\u0012\n\u0006return\u0012\b\b:\u0010:\u0018\f \u0012\u0012\r\n\u0001a\u0012\b\b:\u0010:\u0018\u0013 \u0014\u0012\r\n\u0001+\u0012\b\b:\u0010:\u0018\u0015 \u0016\u0012\r\n\u0001b\u0012\b\b:\u0010:\u0018\u0017 \u0018\u0012\r\n\u0001;\u0012\b\b:\u0010:\u0018\u0018 \u0019\u0012\r\n\u0001}\u0012\b\b;\u0010;\u0018\b \t\u0012\r\n\u0001}\u0012\b\b<\u0010<\u0018\u0004 \u0005\u0012\u000b\n\u0001}\u0012\u0006\b>\u0010> \u0001"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/ProtobufImporterTest/token-type.pb",
    "content": "\u0010\n\nProgram.cs\u0012\n\b\u0004\u0012\u0006\b\u0001\u0010\u0001 \u0005\u0012\n\u0012\b\b\u0001\u0010\u0001\u0018\u0006 \f\u0012\n\u0012\b\b\u0001\u0010\u0001\u0018\f \r\u0012\n\b\u0004\u0012\u0006\b\u0002\u0010\u0002 \u0005\u0012\n\u0012\b\b\u0002\u0010\u0002\u0018\u0006 \f\u0012\n\u0012\b\b\u0002\u0010\u0002\u0018\f \r\u0012\n\u0012\b\b\u0002\u0010\u0002\u0018\r \u0018\u0012\n\u0012\b\b\u0002\u0010\u0002\u0018\u0018 \u0019\u0012\n\u0012\b\b\u0002\u0010\u0002\u0018\u0019  \u0012\n\u0012\b\b\u0002\u0010\u0002\u0018  !\u0012\n\b\u0004\u0012\u0006\b\u0003\u0010\u0003 \u0005\u0012\n\u0012\b\b\u0003\u0010\u0003\u0018\u0006 \f\u0012\n\u0012\b\b\u0003\u0010\u0003\u0018\f \r\u0012\n\u0012\b\b\u0003\u0010\u0003\u0018\r \u0011\u0012\n\u0012\b\b\u0003\u0010\u0003\u0018\u0011 \u0012\u0012\n\b\u0004\u0012\u0006\b\u0004\u0010\u0004 \u0005\u0012\n\u0012\b\b\u0004\u0010\u0004\u0018\u0006 \f\u0012\n\u0012\b\b\u0004\u0010\u0004\u0018\f \r\u0012\n\u0012\b\b\u0004\u0010\u0004\u0018\r \u0011\u0012\n\u0012\b\b\u0004\u0010\u0004\u0018\u0011 \u0012\u0012\n\b\u0004\u0012\u0006\b\u0005\u0010\u0005 \u0005\u0012\n\u0012\b\b\u0005\u0010\u0005\u0018\u0006 \f\u0012\n\u0012\b\b\u0005\u0010\u0005\u0018\f \r\u0012\n\u0012\b\b\u0005\u0010\u0005\u0018\r \u0016\u0012\n\u0012\b\b\u0005\u0010\u0005\u0018\u0016 \u0017\u0012\n\u0012\b\b\u0005\u0010\u0005\u0018\u0017 \u001c\u0012\n\u0012\b\b\u0005\u0010\u0005\u0018\u001c \u001d\u0012\n\b\u0004\u0012\u0006\b\u0006\u0010\u0006 \u0005\u0012\n\u0012\b\b\u0006\u0010\u0006\u0018\u0006 \f\u0012\n\u0012\b\b\u0006\u0010\u0006\u0018\f \r\u0012\n\u0012\b\b\u0006\u0010\u0006\u0018\r \u0018\u0012\n\u0012\b\b\u0006\u0010\u0006\u0018\u0018 \u0019\u0012\n\u0012\b\b\u0006\u0010\u0006\u0018\u0019 %\u0012\n\u0012\b\b\u0006\u0010\u0006\u0018% &\u0012\n\b\u0005\u0012\u0006\b\t\u0010\t I\u0012\n\b\u0005\u0012\u0006\b\n\u0010\n ^\u0012\n\b\u0005\u0012\u0006\b\u000b\u0010\u000b R\u0012\n\b\u0005\u0012\u0006\b\f\u0010\f a\u0012\n\b\u0005\u0012\u0006\b\r\u0010\r \u000f\u0012\n\b\u0005\u0012\u0006\b\u000e\u0010\u000e I\u0012\n\b\u0004\u0012\u0006\b\u000f\u0010\u000f \t\u0012\n\u0012\b\b\u000f\u0010\u000f\u0018\n \u001d\u0012\b\u0012\u0006\b\u0010\u0010\u0010 \u0001\u0012\f\b\u0005\u0012\b\b\u0011\u0010\u0011\u0018\u0004 \u0007\u0012\f\b\u0005\u0012\b\b\u0011\u0010\u0011\u0018\u0007 \b\u0012\f\b\u0005\u0012\b\b\u0011\u0010\u0011\u0018\b \t\u0012\f\b\u0005\u0012\b\b\u0011\u0010\u0011\u0018\t \u0010\u0012\f\b\u0005\u0012\b\b\u0011\u0010\u0011\u0018\u0010 \u0011\u0012\f\b\u0005\u0012\b\b\u0012\u0010\u0012\u0018\u0004 \u0007\u0012\f\b\u0005\u0012\b\b\u0012\u0010\u0012\u0018\u0007 M\u0012\f\b\u0005\u0012\b\b\u0013\u0010\u0013\u0018\u0004 \u0007\u0012\f\b\u0005\u0012\b\b\u0013\u0010\u0013\u0018\u0007 L\u0012\f\b\u0005\u0012\b\b\u0014\u0010\u0014\u0018\u0004 \u0007\u0012\f\b\u0005\u0012\b\b\u0014\u0010\u0014\u0018\u0007 L\u0012\f\b\u0005\u0012\b\b\u0015\u0010\u0015\u0018\u0004 \u0007\u0012\f\b\u0005\u0012\b\b\u0015\u0010\u0015\u0018\u0007 \u0018\u0012\f\b\u0005\u0012\b\b\u0016\u0010\u0016\u0018\u0004 \u0007\u0012\f\b\u0005\u0012\b\b\u0016\u0010\u0016\u0018\u0007 \b\u0012\f\b\u0005\u0012\b\b\u0016\u0010\u0016\u0018\b \n\u0012\f\b\u0005\u0012\b\b\u0016\u0010\u0016\u0018\n \u0011\u0012\f\b\u0005\u0012\b\b\u0016\u0010\u0016\u0018\u0011 \u0012\u0012\f\b\u0004\u0012\b\b\u0017\u0010\u0017\u0018\u0004 \n\u0012\f\b\u0004\u0012\b\b\u0017\u0010\u0017\u0018\u000b \u0010\u0012\f\b\u0001\u0012\b\b\u0017\u0010\u0017\u0018\u0011 \u0018\u0012\n\u0012\b\b\u0018\u0010\u0018\u0018\u0004 \u0005\u0012\f\b\u0004\u0012\b\b\u0019\u0010\u0019\u0018\b \u000e\u0012\f\b\u0004\u0012\b\b\u0019\u0010\u0019\u0018\u000f \u0015\u0012\f\b\u0004\u0012\b\b\u0019\u0010\u0019\u0018\u0016 \u0019\u0012\n\u0012\b\b\u0019\u0010\u0019\u0018\u001a \u001d\u0012\n\u0012\b\b\u0019\u0010\u0019\u0018\u001d \u001e\u0012\f\b\u0004\u0012\b\b\u0019\u0010\u0019\u0018\u001e !\u0012\n\u0012\b\b\u0019\u0010\u0019\u0018\" %\u0012\n\u0012\b\b\u0019\u0010\u0019\u0018% &\u0012\f\b\u0004\u0012\b\b\u0019\u0010\u0019\u0018' *\u0012\n\u0012\b\b\u0019\u0010\u0019\u0018+ .\u0012\n\u0012\b\b\u0019\u0010\u0019\u0018. /\u0012\n\u0012\b\b\u001a\u0010\u001a\u0018\b \t\u0012\f\b\u0004\u0012\b\b\u001b\u0010\u001b\u0018\f \u000e\u0012\n\u0012\b\b\u001b\u0010\u001b\u0018\u000f \u0010\u0012\n\u0012\b\b\u001b\u0010\u001b\u0018\u0010 \u0013\u0012\n\u0012\b\b\u001b\u0010\u001b\u0018\u0014 \u0016\u0012\f\b\u0002\u0012\b\b\u001b\u0010\u001b\u0018\u0017 \u0018\u0012\n\u0012\b\b\u001b\u0010\u001b\u0018\u0018 \u0019\u0012\n\u0012\b\b\u001c\u0010\u001c\u0018\f \r\u0012\f\b\u0004\u0012\b\b\u001d\u0010\u001d\u0018\u0010 \u0016\u0012\n\u0012\b\b\u001d\u0010\u001d\u0018\u0017 \u001a\u0012\n\u0012\b\b\u001d\u0010\u001d\u0018\u001a \u001b\u0012\n\u0012\b\b\u001e\u0010\u001e\u0018\f \r\u0012\f\b\u0004\u0012\b\b \u0010 \u0018\f \u000e\u0012\n\u0012\b\b \u0010 \u0018\u000f \u0010\u0012\n\u0012\b\b \u0010 \u0018\u0010 \u0013\u0012\n\u0012\b\b \u0010 \u0018\u0014 \u0016\u0012\f\b\u0002\u0012\b\b \u0010 \u0018\u0017 \u0018\u0012\n\u0012\b\b \u0010 \u0018\u0018 \u0019\u0012\n\u0012\b\b!\u0010!\u0018\f \r\u0012\f\b\u0004\u0012\b\b\"\u0010\"\u0018\u0010 \u0016\u0012\n\u0012\b\b\"\u0010\"\u0018\u0017 \u001a\u0012\n\u0012\b\b\"\u0010\"\u0018\u001a \u001b\u0012\n\u0012\b\b#\u0010#\u0018\f \r\u0012\f\b\u0004\u0012\b\b%\u0010%\u0018\f \u0012\u0012\n\u0012\b\b%\u0010%\u0018\u0013 \u0016\u0012\n\u0012\b\b%\u0010%\u0018\u0017 \u0018\u0012\n\u0012\b\b%\u0010%\u0018\u0019 \u001c\u0012\n\u0012\b\b%\u0010%\u0018\u001c \u001d\u0012\n\u0012\b\b&\u0010&\u0018\b \t\u0012\f\b\u0004\u0012\b\b(\u0010(\u0018\b \u000e\u0012\f\b\u0004\u0012\b\b(\u0010(\u0018\u000f \u0013\u0012\n\u0012\b\b(\u0010(\u0018\u0014 \u0018\u0012\n\u0012\b\b(\u0010(\u0018\u0018 \u0019\u0012\f\b\u0004\u0012\b\b(\u0010(\u0018\u0019 \u001f\u0012\n\u0012\b\b(\u0010(\u0018\u001f  \u0012\n\u0012\b\b(\u0010(\u0018  !\u0012\n\u0012\b\b(\u0010(\u0018\" &\u0012\n\u0012\b\b(\u0010(\u0018& '\u0012\n\u0012\b\b)\u0010)\u0018\b \t\u0012\n\u0012\b\b*\u0010*\u0018\b \t\u0012\n\u0012\b\b+\u0010+\u0018\u0004 \u0005\u0012\f\b\u0004\u0012\b\b-\u0010-\u0018\u0004 \t\u0012\f\b\u0001\u0012\b\b-\u0010-\u0018\n \u000e\u0012\n\u0012\b\b.\u0010.\u0018\u0004 \u0005\u0012\n\u0012\b\b/\u0010/\u0018\u0004 \u0005\u0012\f\b\u0004\u0012\b\b1\u00101\u0018\u0004 \t\u0012\f\b\u0001\u0012\b\b1\u00101\u0018\n \u000e\u0012\f\b\u0005\u0012\b\b1\u00101\u0018\u0010 \u001a\u0012\n\u0012\b\b2\u00102\u0018\u0004 \u0005\u0012\n\u0012\b\b3\u00103\u0018\u0004 \u0005\u0012\n\u0012\b\b5\u00105\u0018\u0004 \u0005\u0012\f\b\u0001\u0012\b\b5\u00105\u0018\u0005 \u0014\u0012\n\u0012\b\b5\u00105\u0018\u0014 \u0015\u0012\f\b\u0003\u0012\b\b5\u00105\u0018\u0015 &\u0012\n\u0012\b\b5\u00105\u0018& '\u0012\f\b\u0003\u0012\b\b5\u00105\u0018( X\u0012\n\u0012\b\b5\u00105\u0018X Y\u0012\n\u0012\b\b5\u00105\u0018Y Z\u0012\f\b\u0004\u0012\b\b6\u00106\u0018\u0004 \t\u0012\f\b\u0001\u0012\b\b6\u00106\u0018\n \u0012\u0012\n\u0012\b\b6\u00106\u0018\u0012 \u0013\u0012\f\b\u0001\u0012\b\b6\u00106\u0018\u0013 \u0014\u0012\n\u0012\b\b6\u00106\u0018\u0014 \u0015\u0012\f\b\u0005\u0012\b\b6\u00106\u0018\u0016 4\u0012\n\u0012\b\b7\u00107\u0018\u0004 \u0005\u0012\f\b\u0004\u0012\b\b8\u00108\u0018\b \u000e\u0012\f\b\u0004\u0012\b\b8\u00108\u0018\u000f \u0012\u0012\n\u0012\b\b8\u00108\u0018\u0013 \u0016\u0012\n\u0012\b\b8\u00108\u0018\u0016 \u0017\u0012\f\b\u0001\u0012\b\b8\u00108\u0018\u0017 \u0018\u0012\n\u0012\b\b8\u00108\u0018\u0018 \u0019\u0012\n\u0012\b\b8\u00108\u0018\u0019 \u001a\u0012\f\b\u0004\u0012\b\b8\u00108\u0018\u001a \u001d\u0012\n\u0012\b\b8\u00108\u0018\u001e \u001f\u0012\n\u0012\b\b8\u00108\u0018\u001f  \u0012\f\b\u0004\u0012\b\b8\u00108\u0018! $\u0012\n\u0012\b\b8\u00108\u0018% &\u0012\n\u0012\b\b8\u00108\u0018& '\u0012\f\b\u0005\u0012\b\b8\u00108\u0018( G\u0012\n\u0012\b\b9\u00109\u0018\b \t\u0012\f\b\u0004\u0012\b\b:\u0010:\u0018\f \u0012\u0012\n\u0012\b\b:\u0010:\u0018\u0013 \u0014\u0012\n\u0012\b\b:\u0010:\u0018\u0015 \u0016\u0012\n\u0012\b\b:\u0010:\u0018\u0017 \u0018\u0012\n\u0012\b\b:\u0010:\u0018\u0018 \u0019\u0012\n\u0012\b\b;\u0010;\u0018\b \t\u0012\n\u0012\b\b<\u0010<\u0018\u0004 \u0005\u0012\b\u0012\u0006\b>\u0010> \u0001"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/ProtobufImporterTest/unknown-log.pb",
    "content": "\u001f\u0012\u001dUnknown severity for Coverage"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/RazorProtobufImporter/ReadMe.md",
    "content": "### How to re-create the pb files\n\n- Create a Project in SonarQube (manual setup).\n- Open a console in this directory.\n- For all [Roslyn subdirectories](https://github.com/SonarSource/sonar-dotnet-enterprise/tree/master/sonar-dotnet-core/src/test/resources/RazorProtobufImporter) do the following:\n    - Copy the `global.json` file to this directory.\n    - Run the \"BEGIN\" as given by SonarQube.\n    - Run `dotnet build .\\WebProject\\BlazorWebAssembly.csproj`.\n    - Copy the pb files from `.sonarqube\\out\\0\\output-cs` to the Roslyn subdirectory.\n    - Delete the `.sonarqube` and `global.json`.\n- Update the ITs if needed.\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/RazorProtobufImporter/Roslyn 4.10/file-metadata.pb",
    "content": "\u0001\n\u0001C:\\source\\repos\\sonar-dotnet-enterprise\\sonar-dotnet-core\\src\\test\\resources\\RazorProtobufImporter\\WebProject\\obj\\Debug\\net8.0\\BlazorWebAssembly.AssemblyInfo.cs\u0010\u0001\u001a\u0005utf-8\u0001\nxC:\\source\\repos\\sonar-dotnet-enterprise\\sonar-dotnet-core\\src\\test\\resources\\RazorProtobufImporter\\WebProject\\Program.cs\u001a\u0005utf-8\u0001\n\u0001C:\\source\\repos\\sonar-dotnet-enterprise\\sonar-dotnet-core\\src\\test\\resources\\RazorProtobufImporter\\WebProject\\obj\\Debug\\net8.0\\.NETCoreApp,Version=v8.0.AssemblyAttributes.cs\u0010\u0001\u001a\u0005utf-8"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/RazorProtobufImporter/Roslyn 4.10/global.json",
    "content": "{\n  \"sdk\": {\n    \"version\": \"8.0.300\"\n  }\n}"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/RazorProtobufImporter/Roslyn 4.10/log.pb",
    "content": "\u001c\b\u0002\u0012\u0018Roslyn version: 4.10.0.0\u001e\b\u0002\u0012\u001aLanguage version: CSharp12!\b\u0002\u0012\u001dConcurrent execution: enabled\u0002\b\u0001\u0012\u0002File 'C:\\source\\repos\\sonar-dotnet-enterprise\\sonar-dotnet-core\\src\\test\\resources\\RazorProtobufImporter\\WebProject\\obj\\Debug\\net8.0\\Microsoft.CodeAnalysis.Razor.Compiler\\Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator\\_Imports_razor.g.cs' was recognized as razor generated\u0002\b\u0001\u0012\u0002File 'C:\\source\\repos\\sonar-dotnet-enterprise\\sonar-dotnet-core\\src\\test\\resources\\RazorProtobufImporter\\WebProject\\obj\\Debug\\net8.0\\Microsoft.CodeAnalysis.Razor.Compiler\\Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator\\OverlapSymbolReferences_razor.g.cs' was recognized as razor generated\u0002\b\u0001\u0012\u0002File 'C:\\source\\repos\\sonar-dotnet-enterprise\\sonar-dotnet-core\\src\\test\\resources\\RazorProtobufImporter\\WebProject\\obj\\Debug\\net8.0\\Microsoft.CodeAnalysis.Razor.Compiler\\Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator\\Cases_razor.g.cs' was recognized as razor generated\u0001\b\u0001\u0012\u0001File 'C:\\source\\repos\\sonar-dotnet-enterprise\\sonar-dotnet-core\\src\\test\\resources\\RazorProtobufImporter\\WebProject\\obj\\Debug\\net8.0\\BlazorWebAssembly.AssemblyInfo.cs' was recognized as generated\u0001\b\u0001\u0012\u0001File 'C:\\source\\repos\\sonar-dotnet-enterprise\\sonar-dotnet-core\\src\\test\\resources\\RazorProtobufImporter\\WebProject\\obj\\Debug\\net8.0\\.NETCoreApp,Version=v8.0.AssemblyAttributes.cs' was recognized as generated"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/RazorProtobufImporter/Roslyn 4.10/metrics.pb",
    "content": "\u0001\n|C:\\source\\repos\\sonar-dotnet-enterprise\\sonar-dotnet-core\\src\\test\\resources\\RazorProtobufImporter\\WebProject\\_Imports.razor8\u0001r\u0003\u0001\u0004\u0002\u0001\n\u0001C:\\source\\repos\\sonar-dotnet-enterprise\\sonar-dotnet-core\\src\\test\\resources\\RazorProtobufImporter\\WebProject\\OverlapSymbolReferences.razor8\u0001r\u0001\u0001\u0001\nyC:\\source\\repos\\sonar-dotnet-enterprise\\sonar-dotnet-core\\src\\test\\resources\\RazorProtobufImporter\\WebProject\\Cases.razor\u0018\u0003 \u00038\u0005r\u000e\u0001\u0003\u0005\b\t\r\u0010\u0012\u0013\u0015\u0016\u0017\u0018\u0019x\u0001\u0001\u0003\b\u0017\u0018\u0001\nxC:\\source\\repos\\sonar-dotnet-enterprise\\sonar-dotnet-core\\src\\test\\resources\\RazorProtobufImporter\\WebProject\\Program.cs\u0010\u0001 \u00018\u0001r\u0005\u0001\u0003\u0004\u0005\u0006"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/RazorProtobufImporter/Roslyn 4.10/symrefs.pb",
    "content": "~\n|C:\\source\\repos\\sonar-dotnet-enterprise\\sonar-dotnet-core\\src\\test\\resources\\RazorProtobufImporter\\WebProject\\_Imports.razor\u0001\n\u0001C:\\source\\repos\\sonar-dotnet-enterprise\\sonar-dotnet-core\\src\\test\\resources\\RazorProtobufImporter\\WebProject\\OverlapSymbolReferences.razor\u0012\u0014\n\b\b\u0001\u0010\u0001\u0018\u000b \u001c\u0012\b\b\u0001\u0010\u0001\u0018# 4\u0002\nyC:\\source\\repos\\sonar-dotnet-enterprise\\sonar-dotnet-core\\src\\test\\resources\\RazorProtobufImporter\\WebProject\\Cases.razor\u0012\u001e\n\b\b\b\u0010\b\u0018\u000f \u0010\u0012\b\b\b\u0010\b\u0018\u0016 \u0017\u0012\b\b\b\u0010\b\u0018( )\u00122\n\b\b\u0010\u0010\u0010\u0018\u0010 \u001c\u0012\b\b\u0003\u0010\u0003\u0018\u0013 \u001f\u0012\b\b\u0005\u0010\u0005\u0018\u0001 \r\u0012\b\b\b\u0010\b\u0018\u001a &\u0012\b\b\u0017\u0010\u0017\u0018\b \u0014\u0012(\n\b\b\u0013\u0010\u0013\u0018\u000f \u001e\u0012\b\b\r\u0010\r\u0018\u0001 \u0010\u0012\b\b\u0017\u0010\u0017\u0018\u0018 '\u0012\b\b\u0018\u0010\u0018\u0018\b \u0017\u0012\n\n\b\b\u0015\u0010\u0015\u0018\u0011 \u001f\u0001\nxC:\\source\\repos\\sonar-dotnet-enterprise\\sonar-dotnet-core\\src\\test\\resources\\RazorProtobufImporter\\WebProject\\Program.cs\u0012\n\n\b\b\u0003\u0010\u0003\u0018\r \u0014\u0012\n\n\b\b\u0005\u0010\u0005\u0018\u0017 \u001b"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/RazorProtobufImporter/Roslyn 4.10/telemetry.pb",
    "content": "\u0001R\u0001C:\\source\\repos\\sonar-dotnet-enterprise\\sonar-dotnet-core\\src\\test\\resources\\RazorProtobufImporter\\WebProject\\BlazorWebAssembly.csproj\u0001\u0006net8.0\u0001\bCSharp12"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/RazorProtobufImporter/Roslyn 4.10/test-method-declarations.pb",
    "content": ""
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/RazorProtobufImporter/Roslyn 4.10/token-cpd.pb",
    "content": "\u0003\nxC:\\source\\repos\\sonar-dotnet-enterprise\\sonar-dotnet-core\\src\\test\\resources\\RazorProtobufImporter\\WebProject\\Program.cs\u0012\u0013\n\tnamespace\u0012\u0006\b\u0001\u0010\u0001 \t\u0012\u0012\n\u0006WebAss\u0012\b\b\u0001\u0010\u0001\u0018\n \u0010\u0012\r\n\u0001;\u0012\b\b\u0001\u0010\u0001\u0018\u0010 \u0011\u0012\u0010\n\u0006public\u0012\u0006\b\u0003\u0010\u0003 \u0006\u0012\u0011\n\u0005class\u0012\b\b\u0003\u0010\u0003\u0018\u0007 \f\u0012\u0013\n\u0007Program\u0012\b\b\u0003\u0010\u0003\u0018\r \u0014\u0012\u000b\n\u0001{\u0012\u0006\b\u0004\u0010\u0004 \u0001\u0012\u0012\n\u0006public\u0012\b\b\u0005\u0010\u0005\u0018\u0004 \n\u0012\u0012\n\u0006static\u0012\b\b\u0005\u0010\u0005\u0018\u000b \u0011\u0012\u0010\n\u0004void\u0012\b\b\u0005\u0010\u0005\u0018\u0012 \u0016\u0012\u0010\n\u0004Main\u0012\b\b\u0005\u0010\u0005\u0018\u0017 \u001b\u0012\r\n\u0001(\u0012\b\b\u0005\u0010\u0005\u0018\u001b \u001c\u0012\r\n\u0001)\u0012\b\b\u0005\u0010\u0005\u0018\u001c \u001d\u0012\r\n\u0001{\u0012\b\b\u0005\u0010\u0005\u0018\u001e \u001f\u0012\r\n\u0001}\u0012\b\b\u0005\u0010\u0005\u0018  !\u0012\u000b\n\u0001}\u0012\u0006\b\u0006\u0010\u0006 \u0001"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/RazorProtobufImporter/Roslyn 4.10/token-type.pb",
    "content": "\u0001\nxC:\\source\\repos\\sonar-dotnet-enterprise\\sonar-dotnet-core\\src\\test\\resources\\RazorProtobufImporter\\WebProject\\Program.cs\u0012\n\b\u0004\u0012\u0006\b\u0001\u0010\u0001 \t\u0012\n\b\u0004\u0012\u0006\b\u0003\u0010\u0003 \u0006\u0012\f\b\u0004\u0012\b\b\u0003\u0010\u0003\u0018\u0007 \f\u0012\f\b\u0001\u0012\b\b\u0003\u0010\u0003\u0018\r \u0014\u0012\f\b\u0004\u0012\b\b\u0005\u0010\u0005\u0018\u0004 \n\u0012\f\b\u0004\u0012\b\b\u0005\u0010\u0005\u0018\u000b \u0011\u0012\f\b\u0004\u0012\b\b\u0005\u0010\u0005\u0018\u0012 \u0016"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/RazorProtobufImporter/Roslyn 4.9/file-metadata.pb",
    "content": "\u0001\n\u0001C:\\source\\repos\\sonar-dotnet-enterprise\\sonar-dotnet-core\\src\\test\\resources\\RazorProtobufImporter\\WebProject\\obj\\Debug\\net8.0\\BlazorWebAssembly.AssemblyInfo.cs\u0010\u0001\u001a\u0005utf-8\u0001\n\u0001C:\\source\\repos\\sonar-dotnet-enterprise\\sonar-dotnet-core\\src\\test\\resources\\RazorProtobufImporter\\WebProject\\obj\\Debug\\net8.0\\.NETCoreApp,Version=v8.0.AssemblyAttributes.cs\u0010\u0001\u001a\u0005utf-8\u0001\nxC:\\source\\repos\\sonar-dotnet-enterprise\\sonar-dotnet-core\\src\\test\\resources\\RazorProtobufImporter\\WebProject\\Program.cs\u001a\u0005utf-8"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/RazorProtobufImporter/Roslyn 4.9/global.json",
    "content": "{\n  \"sdk\": {\n    \"version\": \"8.0.202\"\n  }\n}"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/RazorProtobufImporter/Roslyn 4.9/log.pb",
    "content": "\u001b\b\u0002\u0012\u0017Roslyn version: 4.9.0.0\u001e\b\u0002\u0012\u001aLanguage version: CSharp12!\b\u0002\u0012\u001dConcurrent execution: enabled\u0001\b\u0001\u0012\u0001File 'Microsoft.CodeAnalysis.Razor.Compiler.SourceGenerators\\Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator\\_Imports_razor.g.cs' was recognized as razor generated\u0001\b\u0001\u0012\u0001File 'Microsoft.CodeAnalysis.Razor.Compiler.SourceGenerators\\Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator\\OverlapSymbolReferences_razor.g.cs' was recognized as razor generated\u0001\b\u0001\u0012\u0001File 'Microsoft.CodeAnalysis.Razor.Compiler.SourceGenerators\\Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator\\Cases_razor.g.cs' was recognized as razor generated\u0001\b\u0001\u0012\u0001File 'C:\\source\\repos\\sonar-dotnet-enterprise\\sonar-dotnet-core\\src\\test\\resources\\RazorProtobufImporter\\WebProject\\obj\\Debug\\net8.0\\BlazorWebAssembly.AssemblyInfo.cs' was recognized as generated\u0001\b\u0001\u0012\u0001File 'C:\\source\\repos\\sonar-dotnet-enterprise\\sonar-dotnet-core\\src\\test\\resources\\RazorProtobufImporter\\WebProject\\obj\\Debug\\net8.0\\.NETCoreApp,Version=v8.0.AssemblyAttributes.cs' was recognized as generated"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/RazorProtobufImporter/Roslyn 4.9/metrics.pb",
    "content": "\u0001\n|C:\\source\\repos\\sonar-dotnet-enterprise\\sonar-dotnet-core\\src\\test\\resources\\RazorProtobufImporter\\WebProject\\_Imports.razor8\u0001r\u0002\u0001\u0002\u0001\n\u0001C:\\source\\repos\\sonar-dotnet-enterprise\\sonar-dotnet-core\\src\\test\\resources\\RazorProtobufImporter\\WebProject\\OverlapSymbolReferences.razor8\u0001r\u0001\u0001\u0001\nyC:\\source\\repos\\sonar-dotnet-enterprise\\sonar-dotnet-core\\src\\test\\resources\\RazorProtobufImporter\\WebProject\\Cases.razor\u0018\u0006 \u00038\u0005r\r\u0003\u0005\b\t\r\u0010\u0012\u0013\u0015\u0016\u0017\u0018\u0019x\u0001\u0001\u0006\u0003\u0005\b\r\u0017\u0018\u0001\nxC:\\source\\repos\\sonar-dotnet-enterprise\\sonar-dotnet-core\\src\\test\\resources\\RazorProtobufImporter\\WebProject\\Program.cs\u0010\u0001 \u00018\u0001r\u0005\u0001\u0003\u0004\u0005\u0006"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/RazorProtobufImporter/Roslyn 4.9/symrefs.pb",
    "content": "~\n|C:\\source\\repos\\sonar-dotnet-enterprise\\sonar-dotnet-core\\src\\test\\resources\\RazorProtobufImporter\\WebProject\\_Imports.razor\u0001\n\u0001C:\\source\\repos\\sonar-dotnet-enterprise\\sonar-dotnet-core\\src\\test\\resources\\RazorProtobufImporter\\WebProject\\OverlapSymbolReferences.razor\u0012\u0012\n\u0006\b\u0001\u0010\u0001 \u0011\u0012\b\b\u0001\u0010\u0001\u0018\u0006 \u0017\u0002\nyC:\\source\\repos\\sonar-dotnet-enterprise\\sonar-dotnet-core\\src\\test\\resources\\RazorProtobufImporter\\WebProject\\Cases.razor\u0012\u001e\n\b\b\b\u0010\b\u0018\u000f \u0010\u0012\b\b\b\u0010\b\u0018\u0016 \u0017\u0012\b\b\b\u0010\b\u0018( )\u00122\n\b\b\u0010\u0010\u0010\u0018\u0010 \u001c\u0012\b\b\u0003\u0010\u0003\u0018\u0013 \u001f\u0012\b\b\u0005\u0010\u0005\u0018\u0001 \r\u0012\b\b\b\u0010\b\u0018\u001a &\u0012\b\b\u0017\u0010\u0017\u0018\b \u0014\u0012(\n\b\b\u0013\u0010\u0013\u0018\u000f \u001e\u0012\b\b\r\u0010\r\u0018\u0001 \u0010\u0012\b\b\u0017\u0010\u0017\u0018\u0018 '\u0012\b\b\u0018\u0010\u0018\u0018\b \u0017\u0012\n\n\b\b\u0015\u0010\u0015\u0018\u0011 \u001f\u0001\nxC:\\source\\repos\\sonar-dotnet-enterprise\\sonar-dotnet-core\\src\\test\\resources\\RazorProtobufImporter\\WebProject\\Program.cs\u0012\n\n\b\b\u0003\u0010\u0003\u0018\r \u0014\u0012\n\n\b\b\u0005\u0010\u0005\u0018\u0017 \u001b"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/RazorProtobufImporter/Roslyn 4.9/telemetry.pb",
    "content": "\u0001R\u0001C:\\source\\repos\\sonar-dotnet-enterprise\\sonar-dotnet-core\\src\\test\\resources\\RazorProtobufImporter\\WebProject\\BlazorWebAssembly.csproj\u0001\u0006net8.0\u0001\bCSharp12"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/RazorProtobufImporter/Roslyn 4.9/test-method-declarations.pb",
    "content": ""
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/RazorProtobufImporter/Roslyn 4.9/token-cpd.pb",
    "content": "\u0003\nxC:\\source\\repos\\sonar-dotnet-enterprise\\sonar-dotnet-core\\src\\test\\resources\\RazorProtobufImporter\\WebProject\\Program.cs\u0012\u0013\n\tnamespace\u0012\u0006\b\u0001\u0010\u0001 \t\u0012\u0012\n\u0006WebAss\u0012\b\b\u0001\u0010\u0001\u0018\n \u0010\u0012\r\n\u0001;\u0012\b\b\u0001\u0010\u0001\u0018\u0010 \u0011\u0012\u0010\n\u0006public\u0012\u0006\b\u0003\u0010\u0003 \u0006\u0012\u0011\n\u0005class\u0012\b\b\u0003\u0010\u0003\u0018\u0007 \f\u0012\u0013\n\u0007Program\u0012\b\b\u0003\u0010\u0003\u0018\r \u0014\u0012\u000b\n\u0001{\u0012\u0006\b\u0004\u0010\u0004 \u0001\u0012\u0012\n\u0006public\u0012\b\b\u0005\u0010\u0005\u0018\u0004 \n\u0012\u0012\n\u0006static\u0012\b\b\u0005\u0010\u0005\u0018\u000b \u0011\u0012\u0010\n\u0004void\u0012\b\b\u0005\u0010\u0005\u0018\u0012 \u0016\u0012\u0010\n\u0004Main\u0012\b\b\u0005\u0010\u0005\u0018\u0017 \u001b\u0012\r\n\u0001(\u0012\b\b\u0005\u0010\u0005\u0018\u001b \u001c\u0012\r\n\u0001)\u0012\b\b\u0005\u0010\u0005\u0018\u001c \u001d\u0012\r\n\u0001{\u0012\b\b\u0005\u0010\u0005\u0018\u001e \u001f\u0012\r\n\u0001}\u0012\b\b\u0005\u0010\u0005\u0018  !\u0012\u000b\n\u0001}\u0012\u0006\b\u0006\u0010\u0006 \u0001"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/RazorProtobufImporter/Roslyn 4.9/token-type.pb",
    "content": "\u0001\nxC:\\source\\repos\\sonar-dotnet-enterprise\\sonar-dotnet-core\\src\\test\\resources\\RazorProtobufImporter\\WebProject\\Program.cs\u0012\n\b\u0004\u0012\u0006\b\u0001\u0010\u0001 \t\u0012\n\b\u0004\u0012\u0006\b\u0003\u0010\u0003 \u0006\u0012\f\b\u0004\u0012\b\b\u0003\u0010\u0003\u0018\u0007 \f\u0012\f\b\u0001\u0012\b\b\u0003\u0010\u0003\u0018\r \u0014\u0012\f\b\u0004\u0012\b\b\u0005\u0010\u0005\u0018\u0004 \n\u0012\f\b\u0004\u0012\b\b\u0005\u0010\u0005\u0018\u000b \u0011\u0012\f\b\u0004\u0012\b\b\u0005\u0010\u0005\u0018\u0012 \u0016"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/RazorProtobufImporter/WebProject/BlazorWebAssembly.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk.BlazorWebAssembly\">\n\t<PropertyGroup>\n\t\t<ProjectGuid>{1250CC30-A343-4A10-A1DE-B1792ADB6244}</ProjectGuid>\n\t\t<TargetFramework>net8.0</TargetFramework>\n\t\t<RuntimeIdentifier>browser-wasm</RuntimeIdentifier>\n\t</PropertyGroup>\n\t<ItemGroup>\n\t\t<PackageReference Include=\"Microsoft.AspNetCore.Components.WebAssembly\" Version=\"8.0.22\" />\n\t\t<PackageReference Include=\"Microsoft.AspNetCore.Components.WebAssembly.DevServer\" Version=\"8.0.22\" PrivateAssets=\"all\" />\n\t\t<PackageReference Include=\"Microsoft.AspNetCore.WebUtilities\" Version=\"8.0.22\" />\n\t</ItemGroup>\n</Project>"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/RazorProtobufImporter/WebProject/Cases.razor",
    "content": "﻿@page \"/cases\"\n\n<p>Current count: @currentCount</p>\n\n@currentCount\n\n<!-- Tabs are intended on the next line  -->\n\t\t\t\t\t@for (int i = 0; i < currentCount; i++)\n\t\t\t\t\t{ }\n\n<button @onclick=\"IncrementCount\">Increment</button>\n\n@IncrementAmount\n\n@code {\n    private int currentCount = 0;\n\n    [Parameter]\n    public int IncrementAmount { get; set; } = 1;\n\n    private void IncrementCount()\n    {\n        currentCount += IncrementAmount;\n        IncrementAmount += 1;\n    }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/RazorProtobufImporter/WebProject/OverlapSymbolReferences.razor",
    "content": "@typeparam TSomeVeryLongName where TSomeVeryLongName : class"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/RazorProtobufImporter/WebProject/Program.cs",
    "content": "﻿namespace WebAss;\n\npublic class Program\n{\n    public static void Main() { }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/RazorProtobufImporter/WebProject/_Imports.razor",
    "content": "﻿@using System\n@using System.Collections.Generic\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/RazorProtobufImporter/WebProject/packages.lock.json",
    "content": "{\n  \"version\": 1,\n  \"dependencies\": {\n    \"net8.0\": {\n      \"Microsoft.AspNetCore.Components.WebAssembly\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[8.0.22, )\",\n        \"resolved\": \"8.0.22\",\n        \"contentHash\": \"oz9Bl/YpSX3r5QrT8BFyBdyoczhs++baR2ct5pSziV+c8DWK4CTOq6RY2LzI+vzLh8G36WntPhwxqnrfrJue/A==\",\n        \"dependencies\": {\n          \"Microsoft.AspNetCore.Components.Web\": \"8.0.22\",\n          \"Microsoft.Extensions.Configuration.Binder\": \"8.0.2\",\n          \"Microsoft.Extensions.Configuration.Json\": \"8.0.1\",\n          \"Microsoft.Extensions.Logging\": \"8.0.1\",\n          \"Microsoft.JSInterop.WebAssembly\": \"8.0.22\"\n        }\n      },\n      \"Microsoft.AspNetCore.Components.WebAssembly.DevServer\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[8.0.22, )\",\n        \"resolved\": \"8.0.22\",\n        \"contentHash\": \"2iSEVIhJ2uPsbYJ5Yg7H3UNWh1unN5QiIwmP8v3rjiVF0Z6UjvENrPqFdWBVJAUVdoLGHaiSCebWGkS0wUpW2A==\"\n      },\n      \"Microsoft.AspNetCore.WebUtilities\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[8.0.22, )\",\n        \"resolved\": \"8.0.22\",\n        \"contentHash\": \"A+XRNRxpOQ91F7lkoqfsbt3TNbYLASmpu/xa/afgyiw1LLEUkl/z9hwg4BnIcZD35m3TE5iAoRqpQD87dVo2oA==\",\n        \"dependencies\": {\n          \"Microsoft.Net.Http.Headers\": \"8.0.22\",\n          \"System.IO.Pipelines\": \"8.0.0\"\n        }\n      },\n      \"Microsoft.NET.ILLink.Tasks\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[8.0.5, )\",\n        \"resolved\": \"8.0.5\",\n        \"contentHash\": \"4ISW1Ndgz86FkIbu5rVlMqhhtojdy5rUlxC/N+9kPh9qbYcvHiCvYbHKzAPVIx9OPYIjT9trXt7JI42Y5Ukq6A==\"\n      },\n      \"Microsoft.NET.Sdk.WebAssembly.Pack\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[8.0.5, )\",\n        \"resolved\": \"8.0.5\",\n        \"contentHash\": \"CABBOqZZEDgiVSjkwUr+pJEGEtQbrT+6dltzJnBDap7mOSvfn53+zwb112hRGB7ynm9ikAocGZTUp+GizbH7XQ==\"\n      },\n      \"Microsoft.AspNetCore.Authorization\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.22\",\n        \"contentHash\": \"D7GY8e30UCkjQO9z2cQ1XT/+T1CSAae+KxojcI5SRb8iKmhVjMrAyspdslGMVhS5zOnPgObUp1666BriQmzv3g==\",\n        \"dependencies\": {\n          \"Microsoft.AspNetCore.Metadata\": \"8.0.22\",\n          \"Microsoft.Extensions.Logging.Abstractions\": \"8.0.3\",\n          \"Microsoft.Extensions.Options\": \"8.0.2\"\n        }\n      },\n      \"Microsoft.AspNetCore.Components\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.22\",\n        \"contentHash\": \"qlW2tz9umukb/XTA+D7p+OiOz6l10rtn0jwh2A46LN8VwikutX5HbCE3pdc1x7eG2LdSKb2OLOTpdhaDp4NB3g==\",\n        \"dependencies\": {\n          \"Microsoft.AspNetCore.Authorization\": \"8.0.22\",\n          \"Microsoft.AspNetCore.Components.Analyzers\": \"8.0.22\"\n        }\n      },\n      \"Microsoft.AspNetCore.Components.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.22\",\n        \"contentHash\": \"Xf/+WuHI1obDwkxUb8w5P+JnaQJEau6r/fDkTvikUvTsMJOwsMAlaG67mJBx31z21jv2SGSPiOWLysBcLagcIQ==\"\n      },\n      \"Microsoft.AspNetCore.Components.Forms\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.22\",\n        \"contentHash\": \"QbuKgMz6oE2FR2kFvoYoXJljdp43IQoHXbqmILVPE9TJ80GlTvE6YLqqHdYInT8+gR7lP9r56AJg9n+RBGEhQA==\",\n        \"dependencies\": {\n          \"Microsoft.AspNetCore.Components\": \"8.0.22\"\n        }\n      },\n      \"Microsoft.AspNetCore.Components.Web\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.22\",\n        \"contentHash\": \"b/ik4mgmL7ncHw9//7mOWnx/BwKdrNO4DUyu3xZuzSt5ABmj1BVTElOCzjLBEewCOCwUIk0LmOqDpzaoXyG/NA==\",\n        \"dependencies\": {\n          \"Microsoft.AspNetCore.Components\": \"8.0.22\",\n          \"Microsoft.AspNetCore.Components.Forms\": \"8.0.22\",\n          \"Microsoft.Extensions.DependencyInjection\": \"8.0.1\",\n          \"Microsoft.Extensions.Primitives\": \"8.0.0\",\n          \"Microsoft.JSInterop\": \"8.0.22\",\n          \"System.IO.Pipelines\": \"8.0.0\"\n        }\n      },\n      \"Microsoft.AspNetCore.Metadata\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.22\",\n        \"contentHash\": \"Ha5M7eC//ZyBzJTc7CmUs0RJkqfBRXc38xzewR8VqZov8jURWuyaSv2XNiokjt7H77cZjQ7sLL0I/RD5JnQ/nA==\"\n      },\n      \"Microsoft.Extensions.Configuration\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"0J/9YNXTMWSZP2p2+nvl8p71zpSwokZXZuJW+VjdErkegAnFdO1XlqtA62SJtgVYHdKu3uPxJHcMR/r35HwFBA==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.Configuration.Abstractions\": \"8.0.0\",\n          \"Microsoft.Extensions.Primitives\": \"8.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.Configuration.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"3lE/iLSutpgX1CC0NOW70FJoGARRHbyKmG7dc0klnUZ9Dd9hS6N/POPWhKhMLCEuNN5nXEY5agmlFtH562vqhQ==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.Primitives\": \"8.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.Configuration.Binder\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.2\",\n        \"contentHash\": \"7IQhGK+wjyGrNsPBjJcZwWAr+Wf6D4+TwOptUt77bWtgNkiV8tDEbhFS+dDamtQFZ2X7kWG9m71iZQRj2x3zgQ==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.Configuration.Abstractions\": \"8.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.Configuration.FileExtensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.1\",\n        \"contentHash\": \"EJzSNO9oaAXnTdtdNO6npPRsIIeZCBSNmdQ091VDO7fBiOtJAAeEq6dtrVXIi3ZyjC5XRSAtVvF8SzcneRHqKQ==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.Configuration\": \"8.0.0\",\n          \"Microsoft.Extensions.Configuration.Abstractions\": \"8.0.0\",\n          \"Microsoft.Extensions.FileProviders.Abstractions\": \"8.0.0\",\n          \"Microsoft.Extensions.FileProviders.Physical\": \"8.0.0\",\n          \"Microsoft.Extensions.Primitives\": \"8.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.Configuration.Json\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.1\",\n        \"contentHash\": \"L89DLNuimOghjV3tLx0ArFDwVEJD6+uGB3BMCMX01kaLzXkaXHb2021xOMl2QOxUxbdePKUZsUY7n2UUkycjRg==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.Configuration\": \"8.0.0\",\n          \"Microsoft.Extensions.Configuration.Abstractions\": \"8.0.0\",\n          \"Microsoft.Extensions.Configuration.FileExtensions\": \"8.0.1\",\n          \"Microsoft.Extensions.FileProviders.Abstractions\": \"8.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.DependencyInjection\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.1\",\n        \"contentHash\": \"BmANAnR5Xd4Oqw7yQ75xOAYODybZQRzdeNucg7kS5wWKd2PNnMdYtJ2Vciy0QLylRmv42DGl5+AFL9izA6F1Rw==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"8.0.2\"\n        }\n      },\n      \"Microsoft.Extensions.DependencyInjection.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.2\",\n        \"contentHash\": \"3iE7UF7MQkCv1cxzCahz+Y/guQbTqieyxyaWKhrRO91itI9cOKO76OHeQDahqG4MmW5umr3CcCvGmK92lWNlbg==\"\n      },\n      \"Microsoft.Extensions.FileProviders.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"ZbaMlhJlpisjuWbvXr4LdAst/1XxH3vZ6A0BsgTphZ2L4PGuxRLz7Jr/S7mkAAnOn78Vu0fKhEgNF5JO3zfjqQ==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.Primitives\": \"8.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.FileProviders.Physical\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"UboiXxpPUpwulHvIAVE36Knq0VSHaAmfrFkegLyBZeaADuKezJ/AIXYAW8F5GBlGk/VaibN2k/Zn1ca8YAfVdA==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.FileProviders.Abstractions\": \"8.0.0\",\n          \"Microsoft.Extensions.FileSystemGlobbing\": \"8.0.0\",\n          \"Microsoft.Extensions.Primitives\": \"8.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.FileSystemGlobbing\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"OK+670i7esqlQrPjdIKRbsyMCe9g5kSLpRRQGSr4Q58AOYEe/hCnfLZprh7viNisSUUQZmMrbbuDaIrP+V1ebQ==\"\n      },\n      \"Microsoft.Extensions.Logging\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.1\",\n        \"contentHash\": \"4x+pzsQEbqxhNf1QYRr5TDkLP9UsLT3A6MdRKDDEgrW7h1ljiEPgTNhKYUhNCCAaVpQECVQ+onA91PTPnIp6Lw==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection\": \"8.0.1\",\n          \"Microsoft.Extensions.Logging.Abstractions\": \"8.0.2\",\n          \"Microsoft.Extensions.Options\": \"8.0.2\"\n        }\n      },\n      \"Microsoft.Extensions.Logging.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.3\",\n        \"contentHash\": \"dL0QGToTxggRLMYY4ZYX5AMwBb+byQBd/5dMiZE07Nv73o6I5Are3C7eQTh7K2+A4ct0PVISSr7TZANbiNb2yQ==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"8.0.2\"\n        }\n      },\n      \"Microsoft.Extensions.Options\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.2\",\n        \"contentHash\": \"dWGKvhFybsaZpGmzkGCbNNwBD1rVlWzrZKANLW/CcbFJpCEceMCGzT7zZwHOGBCbwM0SzBuceMj5HN1LKV1QqA==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.DependencyInjection.Abstractions\": \"8.0.0\",\n          \"Microsoft.Extensions.Primitives\": \"8.0.0\"\n        }\n      },\n      \"Microsoft.Extensions.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"bXJEZrW9ny8vjMF1JV253WeLhpEVzFo1lyaZu1vQ4ZxWUlVvknZ/+ftFgVheLubb4eZPSwwxBeqS1JkCOjxd8g==\"\n      },\n      \"Microsoft.JSInterop\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.22\",\n        \"contentHash\": \"RmReQAbsJXtJZjQEAo2XrpZDplNmvLtysMRGbcQlLwY6A/3/HZ3Y0kR1K6aq9PK5wyF6S5AwRNny09H+L997/Q==\"\n      },\n      \"Microsoft.JSInterop.WebAssembly\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.22\",\n        \"contentHash\": \"gcn+OdIF4UwNR8dgJstr8RrOLGjD1LGAOkrwj72KLevDxNy0bZFYecimozlwUx5epxnuLXxRfZ1lkOu9MeuKHA==\",\n        \"dependencies\": {\n          \"Microsoft.JSInterop\": \"8.0.22\"\n        }\n      },\n      \"Microsoft.Net.Http.Headers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.22\",\n        \"contentHash\": \"LK71l5hgc7s+OlGq/0rY4nido6LyivsKzuBQTr3WPU95se6tEStCALycXQ/m/ulHQcT+deGLAu0bvRI7u7tJdg==\",\n        \"dependencies\": {\n          \"Microsoft.Extensions.Primitives\": \"8.0.0\"\n        }\n      },\n      \"System.IO.Pipelines\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"8.0.0\",\n        \"contentHash\": \"FHNOatmUq0sqJOkTx+UF/9YK1f180cnW5FVqnQMvYUN0elp6wFzbtPSiqbo1/ru8ICp43JM1i7kKkk6GsNGHlA==\"\n      }\n    },\n    \"net8.0/browser-wasm\": {}\n  }\n}"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/RoslynDataImporterTest/roslyn-report-empty.json",
    "content": "{\n  \"version\": \"0.1\",\n  \"toolInfo\": {\n    \"toolName\": \"Microsoft (R) Visual C# Compiler\",\n    \"productVersion\": \"1.0.0\",\n    \"fileVersion\": \"1.0.0\"\n  }\n}"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/RoslynDataImporterTest/roslyn-report-invalid-location.json",
    "content": "{\n  \"$schema\": \"http://json.schemastore.org/sarif-1.0.0\",\n  \"version\": \"1.0.0\",\n  \"runs\": [\n    {\n      \"tool\": {\n        \"name\": \"Microsoft (R) Visual C# Compiler\",\n        \"version\": \"3.5.0.0\",\n        \"fileVersion\": \"3.5.0-beta4-20153-05 (20b9af91)\",\n        \"semanticVersion\": \"3.5.0\",\n        \"language\": \"en-US\"\n      },\n      \"results\": [\n        {\n          \"ruleId\": \"SA1629\",\n          \"level\": \"warning\",\n          \"message\": \"Documentation text should end with a period\",\n          \"locations\": [\n            {\n              \"resultFile\": {\n                \"uri\": \"Program.cs\",\n                \"region\": {\n                  \"startLine\": 13,\n                  \"startColumn\": 100,\n                  \"endLine\": 13,\n                  \"endColumn\": 101\n                }\n              }\n            }\n          ],\n          \"properties\": {\n            \"warningLevel\": 1\n          }\n        },\n        {\n          \"ruleId\": \"SA1629\",\n          \"level\": \"warning\",\n          \"message\": \"Documentation text should end with a period\",\n          \"locations\": [\n            {\n              \"resultFile\": {\n                \"uri\": \"Program.cs\",\n                \"region\": {\n                  \"startLine\": 100,\n                  \"startColumn\": 1,\n                  \"endLine\": 100,\n                  \"endColumn\": 2\n                }\n              }\n            }\n          ],\n          \"properties\": {\n            \"warningLevel\": 1\n          }\n        }\n      ],\n      \"rules\": {\n        \"SA1629\": {\n          \"id\": \"SA1629\",\n          \"shortDescription\": \"Documentation text should end with a period\",\n          \"fullDescription\": \"A section of the XML header documentation for a C# element does not end with a period.\",\n          \"defaultLevel\": \"warning\",\n          \"helpUri\": \"https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1629.md\",\n          \"properties\": {\n            \"category\": \"StyleCop.CSharp.DocumentationRules\",\n            \"isEnabledByDefault\": true\n          }\n        }\n      }\n    }\n  ]\n}"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/RoslynDataImporterTest/roslyn-report.json",
    "content": "{\n  \"version\": \"0.1\",\n  \"toolInfo\": {\n    \"toolName\": \"Microsoft (R) Visual C# Compiler\",\n    \"productVersion\": \"1.0.0\",\n    \"fileVersion\": \"1.0.0\"\n  },\n  \"issues\": [\n    {\n      \"ruleId\": \"[parameters_key]\",\n      \"locations\": [\n        {\n          \"analysisTarget\": [\n            {\n              \"uri\": \"Program.cs\",\n              \"region\": {\n                \"startLine\": 18,\n                \"startColumn\": 9,\n                \"endLine\": 19,\n                \"endColumn\": 11\n              }\n            }\n          ]\n        }\n      ],\n      \"shortMessage\": \"Short messages should be used first in Roslyn reports\",\n      \"fullMessage\": \"This the full message which shouldnt be used\",\n      \"properties\": {\n        \"severity\": \"Warning\",\n        \"warningLevel\": \"2\",\n        \"defaultSeverity\": \"Warning\",\n        \"title\": \"Unreachable code detected\",\n        \"category\": \"Compiler\",\n        \"isEnabledByDefault\": \"True\",\n        \"customTags\": \"Compiler;Telemetry\"\n      }\n    },\n    {\n      \"ruleId\": \"[parameters_key]\",\n      \"locations\": [\n        {\n          \"analysisTarget\": [\n            {\n              \"uri\": \"Program.cs\",\n              \"region\": {\n                \"startLine\": 0,\n                \"startColumn\": 0,\n                \"endLine\": 0,\n                \"endColumn\": 1\n              }\n            }\n          ]\n        }\n      ],\n      \"fullMessage\": \"There only is a full message in the Roslyn report\"\n    },\n    {\n      \"ruleId\": \"CS0067\",\n      \"locations\": [\n        {\n          \"analysisTarget\": [\n            {\n              \"uri\": \"Program.cs\",\n              \"region\": {\n                \"startLine\": 18,\n                \"startColumn\": 11,\n                \"endLine\": 18,\n                \"endColumn\": 16\n              }\n            }\n          ]\n        }\n      ],\n      \"fullMessage\": \"The event 'Program.OnFoo' is never used\"\n    },\n    {\n      \"ruleId\": \"[parameters_key]\",\n      \"locations\": [\n        {\n          \"analysisTarget\": [\n            {\n              \"uri\": \"NonExisting.cs\",\n              \"region\": {\n                \"startLine\": 18,\n                \"startColumn\": 15,\n                \"endLine\": 18,\n                \"endColumn\": 17\n              }\n            }\n          ]\n        }\n      ],\n      \"fullMessage\": \"This issue comes from the Roslyn report\"\n    },\n    {\n      \"ruleId\": \"custom-roslyn\",\n      \"locations\": [\n        {\n          \"analysisTarget\": [\n            {\n              \"uri\": \"Program.cs\",\n              \"region\": {\n                \"startLine\": 18,\n                \"startColumn\": 0,\n                \"endLine\": 18,\n                \"endColumn\": 1\n              }\n            }\n          ]\n        }\n      ],\n      \"fullMessage\": \"Custom Roslyn analyzer message\"\n    },\n    {\n      \"ruleId\": \"[parameters_key]\",\n      \"locations\": [\n      ],\n      \"fullMessage\": \"This is an assembly level Roslyn issue with no location\"\n    }\n  ]\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/RoslynProfileExporterTest/empty_string_value.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RoslynExportProfile Version=\"1.0\">\n  <Configuration>\n    <RuleSet Name=\"Rules for SonarQube\" Description=\"This rule set was automatically generated from SonarQube.\" ToolsVersion=\"14.0\">\n      <Rules AnalyzerId=\"SonarAnalyzer.CSharp\" RuleNamespace=\"SonarAnalyzer.CSharp\">\n        <Rule Id=\"S1000\" Action=\"Warning\" />\n      </Rules>\n    </RuleSet>\n    <AdditionalFiles>\n      <AdditionalFile FileName=\"SonarLint.xml\">PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxBbmFseXNpc0lucHV0Pg0KICA8UnVsZXM+DQogICAgPFJ1bGU+DQogICAgICA8S2V5PlMxMDAwPC9LZXk+DQogICAgICA8UGFyYW1ldGVycz4NCiAgICAgICAgPFBhcmFtZXRlcj4NCiAgICAgICAgICA8S2V5PnBhcmFtPC9LZXk+DQogICAgICAgICAgPFZhbHVlPjwvVmFsdWU+DQogICAgICAgIDwvUGFyYW1ldGVyPg0KICAgICAgPC9QYXJhbWV0ZXJzPg0KICAgIDwvUnVsZT4NCiAgPC9SdWxlcz4NCiAgPEZpbGVzPg0KICA8L0ZpbGVzPg0KPC9BbmFseXNpc0lucHV0Pg0K</AdditionalFile>\n    </AdditionalFiles>\n  </Configuration>\n  <Deployment>\n    <Plugins>\n      <Plugin Key=\"csharp\" Version=\"1.7.0\" StaticResourceName=\"SonarAnalyzer.zip\" />\n    </Plugins>\n    <NuGetPackages>\n      <NuGetPackage Id=\"SonarAnalyzer.CSharp\" Version=\"1.10.0\" />\n    </NuGetPackages>\n  </Deployment>\n</RoslynExportProfile>"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/RoslynProfileExporterTest/mixed.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RoslynExportProfile Version=\"1.0\">\n  <Configuration>\n    <RuleSet Name=\"Rules for SonarQube\" Description=\"This rule set was automatically generated from SonarQube.\" ToolsVersion=\"14.0\">\n      <Rules AnalyzerId=\"SonarAnalyzer.CSharp\" RuleNamespace=\"SonarAnalyzer.CSharp\">\n        <Rule Id=\"S1000\" Action=\"Warning\" />\n        <Rule Id=\"SonarLintInactiveRule\" Action=\"None\" />\n      </Rules>\n      <Rules AnalyzerId=\"custom-roslyn\" RuleNamespace=\"custom-roslyn-namespace\">\n        <Rule Id=\"CA1000\" Action=\"Warning\" />\n        <Rule Id=\"CustomRoslynInactiverule1\" Action=\"None\" />\n      </Rules>\n    </RuleSet>\n    <AdditionalFiles>\n      <AdditionalFile FileName=\"SonarLint.xml\">PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxBbmFseXNpc0lucHV0Pg0KICA8UnVsZXM+DQogICAgPFJ1bGU+DQogICAgICA8S2V5PlMxMDAwPC9LZXk+DQogICAgPC9SdWxlPg0KICA8L1J1bGVzPg0KICA8RmlsZXM+DQogIDwvRmlsZXM+DQo8L0FuYWx5c2lzSW5wdXQ+DQo=</AdditionalFile>\n    </AdditionalFiles>\n  </Configuration>\n  <Deployment>\n    <Plugins>\n      <Plugin Key=\"csharp\" Version=\"1.7.0\" StaticResourceName=\"SonarAnalyzer.zip\" />\n      <Plugin Key=\"customPluginKey\" Version=\"customPluginVersion\" StaticResourceName=\"customPluginStaticResourceName\" />\n    </Plugins>\n    <NuGetPackages>\n      <NuGetPackage Id=\"SonarAnalyzer.CSharp\" Version=\"1.10.0\" />\n      <NuGetPackage Id=\"custom-roslyn-package\" Version=\"custom-rolsyn-version\" />\n    </NuGetPackages>\n  </Deployment>\n</RoslynExportProfile>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/RoslynProfileExporterTest/no_rules.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RoslynExportProfile Version=\"1.0\">\n  <Configuration>\n    <RuleSet Name=\"Rules for SonarQube\" Description=\"This rule set was automatically generated from SonarQube.\" ToolsVersion=\"14.0\">\n    </RuleSet>\n    <AdditionalFiles>\n      <AdditionalFile FileName=\"SonarLint.xml\">PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxBbmFseXNpc0lucHV0Pg0KICA8UnVsZXM+DQogIDwvUnVsZXM+DQogIDxGaWxlcz4NCiAgPC9GaWxlcz4NCjwvQW5hbHlzaXNJbnB1dD4NCg==</AdditionalFile>\n    </AdditionalFiles>\n  </Configuration>\n  <Deployment>\n    <Plugins>\n    </Plugins>\n    <NuGetPackages>\n    </NuGetPackages>\n  </Deployment>\n</RoslynExportProfile>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/RoslynProfileExporterTest/only_sonarlint.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RoslynExportProfile Version=\"1.0\">\n  <Configuration>\n    <RuleSet Name=\"Rules for SonarQube\" Description=\"This rule set was automatically generated from SonarQube.\" ToolsVersion=\"14.0\">\n      <Rules AnalyzerId=\"SonarAnalyzer.CSharp\" RuleNamespace=\"SonarAnalyzer.CSharp\">\n        <Rule Id=\"[template_key&quot;&apos;&lt;&gt;&amp;]\" Action=\"Warning\" />\n        <Rule Id=\"[parameters_key]\" Action=\"Warning\" />\n        <Rule Id=\"InactiveRule\" Action=\"None\" />\n      </Rules>\n    </RuleSet>\n    <AdditionalFiles>\n      <AdditionalFile FileName=\"SonarLint.xml\">PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxBbmFseXNpc0lucHV0Pg0KICA8UnVsZXM+DQogICAgPFJ1bGU+DQogICAgICA8S2V5Plt0ZW1wbGF0ZV9rZXkmcXVvdDsmYXBvczsmbHQ7Jmd0OyZhbXA7XTwvS2V5Pg0KICAgICAgPFBhcmFtZXRlcnM+DQogICAgICAgIDxQYXJhbWV0ZXI+DQogICAgICAgICAgPEtleT5SdWxlS2V5PC9LZXk+DQogICAgICAgICAgPFZhbHVlPlt0ZW1wbGF0ZV9rZXkmcXVvdDsmYXBvczsmbHQ7Jmd0OyZhbXA7XTwvVmFsdWU+DQogICAgICAgIDwvUGFyYW1ldGVyPg0KICAgICAgPC9QYXJhbWV0ZXJzPg0KICAgIDwvUnVsZT4NCiAgICA8UnVsZT4NCiAgICAgIDxLZXk+W3BhcmFtZXRlcnNfa2V5XTwvS2V5Pg0KICAgICAgPFBhcmFtZXRlcnM+DQogICAgICAgIDxQYXJhbWV0ZXI+DQogICAgICAgICAgPEtleT5bcGFyYW0yX2RlZmF1bHRfa2V5XTwvS2V5Pg0KICAgICAgICAgIDxWYWx1ZT5bcGFyYW0yX2RlZmF1bHRfdmFsdWVdPC9WYWx1ZT4NCiAgICAgICAgPC9QYXJhbWV0ZXI+DQogICAgICAgIDxQYXJhbWV0ZXI+DQogICAgICAgICAgPEtleT5bcGFyYW0xX2tleV08L0tleT4NCiAgICAgICAgICA8VmFsdWU+W3BhcmFtMV92YWx1ZV08L1ZhbHVlPg0KICAgICAgICA8L1BhcmFtZXRlcj4NCiAgICAgIDwvUGFyYW1ldGVycz4NCiAgICA8L1J1bGU+DQogIDwvUnVsZXM+DQogIDxGaWxlcz4NCiAgPC9GaWxlcz4NCjwvQW5hbHlzaXNJbnB1dD4NCg==</AdditionalFile>\n    </AdditionalFiles>\n  </Configuration>\n  <Deployment>\n    <Plugins>\n      <Plugin Key=\"csharp\" Version=\"1.7.0\" StaticResourceName=\"SonarAnalyzer.zip\" />\n    </Plugins>\n    <NuGetPackages>\n      <NuGetPackage Id=\"SonarAnalyzer.CSharp\" Version=\"1.10.0\" />\n    </NuGetPackages>\n  </Deployment>\n</RoslynExportProfile>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/RoslynRulesTest/Rules.json",
    "content": "[\n  {\n    \"id\": \"S-NO-PARAMS\",\n    \"parameters\": []\n  },\n  {\n    \"id\": \"S-ONE-PARAM\",\n    \"parameters\": [\n      {\n        \"key\": \"answer\",\n        \"description\": \"Answer to life the universe and everything.\",\n        \"type\": \"INTEGER\",\n        \"defaultValue\": \"42\"\n      }\n    ]\n  },\n  {\n    \"id\": \"S-TWO-PARAMS\",\n    \"parameters\": [\n      {\n        \"key\": \"first\",\n        \"description\": \"First description.\",\n        \"type\": \"INTEGER\",\n        \"defaultValue\": \"42\"\n      },\n      {\n        \"key\": \"second\",\n        \"description\": \"Second description.\",\n        \"type\": \"STRING\",\n        \"defaultValue\": \"2nd default value\"\n      }\n    ]\n  }\n]\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/SarifParserTest/v0_1.json",
    "content": "{\n  \"version\": \"0.1\",\n  \"toolInfo\": {\n    \"toolName\": \"Microsoft (R) Visual C# Compiler\",\n    \"productVersion\": \"1.0.0\",\n    \"fileVersion\": \"1.0.0\"\n  },\n  \"issues\": [\n    {\n      \"ruleId\": \"S1172\",\n      \"locations\": [\n        {\n          \"analysisTarget\": [\n            {\n              \"uri\": \"C:\\\\Foo.cs\",\n              \"region\": {\n                \"startLine\": 42,\n                \"startColumn\": 55,\n                \"endLine\": 43,\n                \"endColumn\": 57\n              }\n            }\n          ]\n        }\n      ],\n      \"shortMessage\": \"Remove this unused method parameter \\\"args\\\".\",\n      \"fullMessage\": \"Unused parameters are misleading. Whatever the value passed to such parameters is, the behavior will be the same.\",\n      \"properties\": {\n        \"severity\": \"Warning\",\n        \"warningLevel\": \"1\",\n        \"defaultSeverity\": \"Warning\",\n        \"title\": \"Unused method parameters should be removed\",\n        \"category\": \"Maintainability\",\n        \"helpLink\": \"http:\\/\\/vs.sonarlint.org\\/rules\\/index.html#version=1.10.0&ruleId=S1172\",\n        \"isEnabledByDefault\": \"True\",\n        \"isSuppressedInSource\": \"False\",\n        \"customTags\": \"Unnecessary\"\n      }\n    },\n    {\n      \"ruleId\": \"S1172\",\n      \"locations\": [\n        {\n          \"analysisTarget\": [\n            {\n              \"uri\": \"C:\\\\Bar.cs\",\n              \"region\": {\n                \"startLine\": 58,\n                \"startColumn\": 55,\n                \"endLine\": 58,\n                \"endColumn\": 57\n              }\n            }\n          ]\n        }\n      ],\n      \"shortMessage\": \"Remove this unused method parameter \\\"args\\\".\",\n      \"fullMessage\": \"Unused parameters are misleading. Whatever the value passed to such parameters is, the behavior will be the same.\",\n      \"properties\": {\n        \"severity\": \"Warning\",\n        \"warningLevel\": \"1\",\n        \"defaultSeverity\": \"Warning\",\n        \"title\": \"Unused method parameters should be removed\",\n        \"category\": \"Maintainability\",\n        \"helpLink\": \"http:\\/\\/vs.sonarlint.org\\/rules\\/index.html#version=1.10.0&ruleId=S1172\",\n        \"isEnabledByDefault\": \"True\",\n        \"isSuppressedInSource\": \"True\",\n        \"customTags\": \"Unnecessary\"\n      }\n    },\n    {\n      \"ruleId\": \"CA1000\",\n      \"locations\": [\n        {\n          \"analysisTarget\": [\n            {\n              \"uri\": \"C:\\\\Bar.cs\",\n              \"region\": {\n                \"startLine\": 1,\n                \"startColumn\": 2,\n                \"endLine\": 3,\n                \"endColumn\": 4\n              }\n            }\n          ]\n        }\n      ],\n      \"fullMessage\": \"There is just a full message.\"\n    },\n    {\n      \"ruleId\": \"AssemblyLevelRule\",\n      \"locations\": [\n      ],\n      \"fullMessage\": \"This is an assembly level Roslyn issue with no location.\"\n    },\n    {\n      \"ruleId\": \"NoAnalysisTargetsLocation\",\n      \"locations\": [\n        {\n        }\n      ],\n      \"fullMessage\": \"No analysis targets, report at assembly level.\"\n    }\n  ]\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/SarifParserTest/v0_1_empty_issues.json",
    "content": "{\n  \"version\": \"0.1\",\n  \"toolInfo\": {\n    \"toolName\": \"Microsoft (R) Visual C# Compiler\",\n    \"productVersion\": \"1.0.0\",\n    \"fileVersion\": \"1.0.0\"\n  },\n  \"issues\": []\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/SarifParserTest/v0_1_empty_no_issues.json",
    "content": "{\n  \"version\": \"0.1\",\n  \"toolInfo\": {\n    \"toolName\": \"Microsoft (R) Visual C# Compiler\",\n    \"productVersion\": \"1.0.0\",\n    \"fileVersion\": \"1.0.0\"\n  }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/SarifParserTest/v0_4.json",
    "content": "{\n  \"version\": \"0.4\",\n  \"runLogs\": [\n    {\n      \"toolInfo\": {\n        \"name\": \"Microsoft (R) Visual C# Compiler\",\n        \"version\": \"1.2.0\",\n        \"fileVersion\": \"1.2.0.60220\"\n      },\n      \"results\": [\n        {\n          \"ruleId\": \"S125\",\n          \"kind\": \"warning\",\n          \"locations\": [\n            {\n              \"analysisTarget\": [\n                {\n                  \"uri\": \"file:\\/\\/\\/C:\\/Foo`1.cs\",\n                  \"region\": {\n                    \"startLine\": 58,\n                    \"startColumn\": 13,\n                    \"endLine\": 58,\n                    \"endColumn\": 51\n                  }\n                }\n              ]\n            }\n          ],\n          \"shortMessage\": \"Remove this commented out code.\",\n          \"fullMessage\": \"Programmers should not comment out code as it bloats programs and reduces readability. Unused code should be deleted and can be retrieved from source control history if required.\",\n          \"properties\": {\n            \"severity\": \"Warning\",\n            \"warningLevel\": \"1\",\n            \"defaultSeverity\": \"Warning\",\n            \"title\": \"Sections of code should not be \\\"commented out\\\"\",\n            \"category\": \"Maintainability\",\n            \"helpLink\": \"http:\\/\\/vs.sonarlint.org\\/rules\\/index.html#version=1.10.0&ruleId=S125\",\n            \"isEnabledByDefault\": \"True\"\n          }\n        },\n        {\n          \"ruleId\": \"S125\",\n          \"kind\": \"warning\",\n          \"locations\": [\n            {\n              \"analysisTarget\": [\n                {\n                  \"uri\": \"file:\\/\\/\\/C:\\/Bar.cs\",\n                  \"region\": {\n                    \"startLine\": 42,\n                    \"startColumn\": 13,\n                    \"endLine\": 42,\n                    \"endColumn\": 51\n                  }\n                }\n              ]\n            }\n          ],\n          \"shortMessage\": \"Remove this commented out code.\",\n          \"fullMessage\": \"Programmers should not comment out code as it bloats programs and reduces readability. Unused code should be deleted and can be retrieved from source control history if required.\",\n          \"isSuppressedInSource\": true,\n          \"properties\": {\n            \"severity\": \"Warning\",\n            \"warningLevel\": \"1\",\n            \"defaultSeverity\": \"Warning\",\n            \"title\": \"Sections of code should not be \\\"commented out\\\"\",\n            \"category\": \"Maintainability\",\n            \"helpLink\": \"http:\\/\\/vs.sonarlint.org\\/rules\\/index.html#version=1.10.0&ruleId=S125\",\n            \"isEnabledByDefault\": \"True\"\n          }\n        }\n      ]\n    }\n  ]\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/SarifParserTest/v0_4_empty_no_results.json",
    "content": "{\n  \"version\": \"0.4\",\n  \"runLogs\": [\n    {\n      \"toolInfo\": {\n        \"name\": \"Microsoft (R) Visual C# Compiler\",\n        \"version\": \"1.2.0\",\n        \"fileVersion\": \"1.2.0.60220\"\n      }\n    }\n  ]\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/SarifParserTest/v0_4_empty_no_runLogs.json",
    "content": "{\n  \"version\": \"0.4\"\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/SarifParserTest/v0_4_empty_results.json",
    "content": "{\n  \"version\": \"0.4\",\n  \"runLogs\": [\n    {\n      \"toolInfo\": {\n        \"name\": \"Microsoft (R) Visual C# Compiler\",\n        \"version\": \"1.2.0\",\n        \"fileVersion\": \"1.2.0.60220\"\n      },\n      \"results\": []\n    }\n  ]\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/SarifParserTest/v0_4_empty_runLogs.json",
    "content": "{\n  \"version\": \"0.4\",\n  \"runLogs\": []\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/SarifParserTest/v0_4_file_level_issue.json",
    "content": "{\n  \"version\": \"0.4\",\n  \"runLogs\": [\n    {\n      \"toolInfo\": {\n        \"name\": \"Microsoft (R) Visual C# Compiler\",\n        \"version\": \"1.2.0\",\n        \"fileVersion\": \"1.2.0.60220\"\n      },\n      \"results\": [\n        {\n          \"ruleId\": \"S104\",\n          \"kind\": \"warning\",\n          \"locations\": [\n            {\n              \"analysisTarget\": [\n                {\n                  \"uri\": \"file:\\/\\/\\/C:\\/Program.cs\",\n                  \"region\": {\n                    \"startLine\": 1,\n                    \"startColumn\": 1,\n                    \"endLine\": 1,\n                    \"endColumn\": 1\n                  }\n                }\n              ]\n            }\n          ],\n          \"shortMessage\": \"Dummy\",\n          \"fullMessage\": \"Dummy.\",\n          \"properties\": {\n            \"severity\": \"Warning\",\n            \"warningLevel\": \"1\",\n            \"defaultSeverity\": \"Warning\",\n            \"title\": \"...\",\n            \"category\": \"Maintainability\",\n            \"helpLink\": \"http:\\/\\/vs.sonarlint.org\\/rules\\/index.html#version=1.10.0&ruleId=S104\",\n            \"isEnabledByDefault\": \"True\"\n          }\n        },\n        {\n          \"ruleId\": \"S105\",\n          \"kind\": \"warning\",\n          \"locations\": [\n            {\n              \"analysisTarget\": [\n                {\n                  \"uri\": \"file:\\/\\/\\/C:\\/Program.cs\",\n                  \"region\": {\n                    \"startLine\": 1,\n                    \"startColumn\": 1,\n                    \"endLine\": 1,\n                    \"endColumn\": 1\n                  }\n                }\n              ]\n            }\n          ],\n          \"shortMessage\": \"Dummy\",\n          \"fullMessage\": \"Dummy.\",\n          \"properties\": {\n            \"severity\": \"Warning\",\n            \"warningLevel\": \"1\",\n            \"defaultSeverity\": \"Warning\",\n            \"title\": \"...\",\n            \"category\": \"Maintainability\",\n            \"helpLink\": \"http:\\/\\/vs.sonarlint.org\\/rules\\/index.html#version=1.10.0&ruleId=S104\",\n            \"isEnabledByDefault\": \"True\"\n          }\n        },\n        {\n          \"ruleId\": \"S105\",\n          \"kind\": \"warning\",\n          \"locations\": [\n            {\n              \"analysisTarget\": [\n                {\n                  \"uri\": \"file:\\/\\/\\/C:\\/Program.cs\",\n                  \"region\": {\n                    \"startLine\": 1,\n                    \"startColumn\": 1,\n                    \"endLine\": 1,\n                    \"endColumn\": 2\n                  }\n                }\n              ]\n            }\n          ],\n          \"shortMessage\": \"Dummy\",\n          \"fullMessage\": \"Dummy.\",\n          \"properties\": {\n            \"severity\": \"Warning\",\n            \"warningLevel\": \"1\",\n            \"defaultSeverity\": \"Warning\",\n            \"title\": \"...\",\n            \"category\": \"Maintainability\",\n            \"helpLink\": \"http:\\/\\/vs.sonarlint.org\\/rules\\/index.html#version=1.10.0&ruleId=S104\",\n            \"isEnabledByDefault\": \"True\"\n          }\n        },\n        {\n          \"ruleId\": \"S106\",\n          \"kind\": \"warning\",\n          \"locations\": [\n            {\n              \"analysisTarget\": [\n                {\n                  \"uri\": \"file:\\/\\/\\/C:\\/Program.cs\",\n                  \"region\": {\n                    \"startLine\": 2,\n                    \"startColumn\": 1,\n                    \"endLine\": 2,\n                    \"endColumn\": 1\n                  }\n                }\n              ]\n            }\n          ],\n          \"shortMessage\": \"Dummy\",\n          \"fullMessage\": \"Dummy.\",\n          \"properties\": {\n            \"severity\": \"Warning\",\n            \"warningLevel\": \"1\",\n            \"defaultSeverity\": \"Warning\",\n            \"title\": \"...\",\n            \"category\": \"Maintainability\",\n            \"helpLink\": \"http:\\/\\/vs.sonarlint.org\\/rules\\/index.html#version=1.10.0&ruleId=S104\",\n            \"isEnabledByDefault\": \"True\"\n          }\n        },\n        {\n          \"ruleId\": \"S107\",\n          \"kind\": \"warning\",\n          \"locations\": [\n            {\n              \"analysisTarget\": [\n                {\n                  \"uri\": \"file:\\/\\/\\/C:\\/Program.cs\",\n                  \"region\": {\n                    \"startLine\": 2,\n                    \"startColumn\": 5,\n                    \"endLine\": 2,\n                    \"endColumn\": 5\n                  }\n                }\n              ]\n            }\n          ],\n          \"shortMessage\": \"Dummy\",\n          \"fullMessage\": \"Dummy.\",\n          \"properties\": {\n            \"severity\": \"Warning\",\n            \"warningLevel\": \"1\",\n            \"defaultSeverity\": \"Warning\",\n            \"title\": \"...\",\n            \"category\": \"Maintainability\",\n            \"helpLink\": \"http:\\/\\/vs.sonarlint.org\\/rules\\/index.html#version=1.10.0&ruleId=S104\",\n            \"isEnabledByDefault\": \"True\"\n          }\n        }\n      ]\n    }\n  ]\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/SarifParserTest/v0_4_secondary_locations.json",
    "content": "{\n  \"version\": \"0.4\",\n  \"runLogs\": [\n    {\n      \"toolInfo\": {\n        \"name\": \"Microsoft (R) Visual C# Compiler\",\n        \"version\": \"1.2.0\",\n        \"fileVersion\": \"1.2.0.60317\"\n      },\n      \"results\": [\n        {\n          \"ruleId\": \"S3776\",\n          \"kind\": \"warning\",\n          \"locations\": [\n            {\n              \"analysisTarget\": [\n                {\n                  \"uri\": \"file:///c:/primary.cs\",\n                  \"region\": {\n                    \"startLine\": 54,\n                    \"startColumn\": 22,\n                    \"endLine\": 54,\n                    \"endColumn\": 25\n                  }\n                }\n              ]\n            },\n            {\n              \"analysisTarget\": [\n                {\n                  \"uri\": \"file:///c:/secondary1.cs\",\n                  \"region\": {\n                    \"startLine\": 56,\n                    \"startColumn\": 13,\n                    \"endLine\": 56,\n                    \"endColumn\": 15\n                  }\n                }\n              ]\n            },\n            {\n              \"analysisTarget\": [\n                {\n                  \"uri\": \"file:///c:/secondary2.cs\",\n                  \"region\": {\n                    \"startLine\": 65,\n                    \"startColumn\": 17,\n                    \"endLine\": 65,\n                    \"endColumn\": 19\n                  }\n                }\n              ]\n            }\n          ],\n          \"shortMessage\": \"Refactor this method to reduce its Cognitive Complexity from 30 to the 15 allowed\",\n          \"fullMessage\": \"Cognitive Complexity is a measure of how hard the control flow of a method is to understand. Methods with high Cognitive Complexity will be difficult to maintain.\",\n          \"isSuppressedInSource\": false,\n          \"properties\": {\n            \"severity\": \"Warning\",\n            \"warningLevel\": \"1\",\n            \"defaultSeverity\": \"Warning\",\n            \"title\": \"Cognitive Complexity of methods should not be too high\",\n            \"category\": \"Sonar Code Smell\",\n            \"helpLink\": \"http:\\/\\/vs.sonarlint.org\\/rules\\/index.html#version=1.23.0.1793&ruleId=S3776\",\n            \"isEnabledByDefault\": \"True\",\n            \"customProperties.0\": \"+1\",\n            \"customProperties.1\": \"+2 (incl 1 for nesting)\"\n          }\n        }\n      ]\n    }\n  ]\n}"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/SarifParserTest/v0_4_secondary_locations_no_messages.json",
    "content": "{\n  \"version\": \"0.4\",\n  \"runLogs\": [\n    {\n      \"toolInfo\": {\n        \"name\": \"Microsoft (R) Visual C# Compiler\",\n        \"version\": \"1.2.0\",\n        \"fileVersion\": \"1.2.0.60317\"\n      },\n      \"results\": [\n        {\n          \"ruleId\": \"S3776\",\n          \"kind\": \"warning\",\n          \"locations\": [\n            {\n              \"analysisTarget\": [\n                {\n                  \"uri\": \"file:///c:/primary.cs\",\n                  \"region\": {\n                    \"startLine\": 54,\n                    \"startColumn\": 22,\n                    \"endLine\": 54,\n                    \"endColumn\": 25\n                  }\n                }\n              ]\n            },\n            {\n              \"analysisTarget\": [\n                {\n                  \"uri\": \"file:///c:/secondary1.cs\",\n                  \"region\": {\n                    \"startLine\": 56,\n                    \"startColumn\": 13,\n                    \"endLine\": 56,\n                    \"endColumn\": 15\n                  }\n                }\n              ]\n            },\n            {\n              \"analysisTarget\": [\n                {\n                  \"uri\": \"file:///c:/secondary2.cs\",\n                  \"region\": {\n                    \"startLine\": 65,\n                    \"startColumn\": 17,\n                    \"endLine\": 65,\n                    \"endColumn\": 19\n                  }\n                }\n              ]\n            }\n          ],\n          \"shortMessage\": \"Refactor this method to reduce its Cognitive Complexity from 30 to the 15 allowed\",\n          \"fullMessage\": \"Cognitive Complexity is a measure of how hard the control flow of a method is to understand. Methods with high Cognitive Complexity will be difficult to maintain.\",\n          \"isSuppressedInSource\": false,\n          \"properties\": {\n            \"severity\": \"Warning\",\n            \"warningLevel\": \"1\",\n            \"defaultSeverity\": \"Warning\",\n            \"title\": \"Cognitive Complexity of methods should not be too high\",\n            \"category\": \"Sonar Code Smell\",\n            \"helpLink\": \"http:\\/\\/vs.sonarlint.org\\/rules\\/index.html#version=1.23.0.1793&ruleId=S3776\",\n            \"isEnabledByDefault\": \"True\"\n          }\n        }\n      ]\n    }\n  ]\n}"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/SarifParserTest/v1_0.json",
    "content": "{\n  \"$schema\": \"http://json.schemastore.org/sarif-1.0.0\",\n  \"version\": \"1.0.0\",\n  \"runs\": [\n    {\n      \"tool\": {\n        \"name\": \"Microsoft (R) Visual C# Compiler\",\n        \"version\": \"1.3.1.0\",\n        \"fileVersion\": \"1.3.1.60616\",\n        \"semanticVersion\": \"1.3.1\",\n        \"language\": \"en-US\"\n      },\n      \"results\": [\n        {\n          \"ruleId\": \"S1234\",\n          \"level\": \"warning\",\n          \"message\": \"One issue per line\",\n          \"locations\": [\n            {\n              \"resultFile\": {\n                \"uri\": \"%BASEDIR%Foo.cs\",\n                \"region\": {\n                  \"startLine\": 1,\n                  \"startColumn\": 1,\n                  \"endLine\": 1,\n                  \"endColumn\": 14\n                }\n              }\n            }\n          ],\n          \"properties\": {\n            \"warningLevel\": 1\n          }\n        },\n        {\n          \"ruleId\": \"S1234\",\n          \"level\": \"warning\",\n          \"message\": \"One issue per line\",\n          \"locations\": [\n            {\n              \"resultFile\": {\n                \"uri\": \"%BASEDIR%Bar.cs\",\n                \"region\": {\n                  \"startLine\": 2,\n                  \"startColumn\": 1,\n                  \"endLine\": 2,\n                  \"endColumn\": 34\n                }\n              }\n            }\n          ],\n          \"properties\": {\n            \"warningLevel\": 1\n          }\n        }\n      ],\n      \"rules\": {\n        \"S1234\": {\n          \"id\": \"S1234\",\n          \"shortDescription\": \"One issue per line\",\n          \"fullDescription\": \"This rule will create an issue for every source code line\",\n          \"defaultLevel\": \"warning\",\n          \"properties\": {\n            \"category\": \"Test\",\n            \"isEnabledByDefault\": true\n          }\n        }\n      }\n    }\n  ]\n}"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/SarifParserTest/v1_0_another.json",
    "content": "{\n  \"$schema\": \"http://json.schemastore.org/sarif-1.0.0\",\n  \"version\": \"1.0.0\",\n  \"runs\": [\n    {\n      \"tool\": {\n        \"name\": \"Microsoft (R) Visual C# Compiler\",\n        \"version\": \"1.3.1.0\",\n        \"fileVersion\": \"1.3.1.60616\",\n        \"semanticVersion\": \"1.3.1\",\n        \"language\": \"en-US\"\n      },\n      \"results\": [\n        {\n          \"ruleId\": \"S1186\",\n          \"level\": \"warning\",\n          \"message\": \"Add a nested comment explaining why this method is empty, throw a \\\"NotSupportedException\\\" or complete the implementation.\",\n          \"locations\": [\n            {\n              \"resultFile\": {\n                \"uri\": \"%BASEDIR%Program.cs\",\n                \"region\": {\n                  \"startLine\": 26,\n                  \"startColumn\": 21,\n                  \"endLine\": 26,\n                  \"endColumn\": 25\n                }\n              }\n            }\n          ],\n          \"properties\": {\n            \"warningLevel\": 1\n          }\n        },\n        {\n          \"ruleId\": \"S1172\",\n          \"level\": \"warning\",\n          \"message\": \"Remove this unused method parameter \\\"args\\\".\",\n          \"locations\": [\n            {\n              \"resultFile\": {\n                \"uri\": \"%BASEDIR%Program.cs\",\n                \"region\": {\n                  \"startLine\": 26,\n                  \"startColumn\": 26,\n                  \"endLine\": 26,\n                  \"endColumn\": 39\n                }\n              }\n            }\n          ],\n          \"properties\": {\n            \"warningLevel\": 1\n          }\n        },\n        {\n          \"ruleId\": \"S1118\",\n          \"level\": \"warning\",\n          \"message\": \"Add a \\\"protected\\\" constructor or the \\\"static\\\" keyword to the class declaration.\",\n          \"locations\": [\n            {\n              \"resultFile\": {\n                \"uri\": \"%BASEDIR%Program.cs\",\n                \"region\": {\n                  \"startLine\": 9,\n                  \"startColumn\": 18,\n                  \"endLine\": 9,\n                  \"endColumn\": 25\n                }\n              }\n            }\n          ],\n          \"properties\": {\n            \"warningLevel\": 1\n          }\n        }\n      ],\n      \"rules\": {\n        \"S1118\": {\n          \"id\": \"S1118\",\n          \"shortDescription\": \"Utility classes should not have public constructors\",\n          \"fullDescription\": \"Utility classes, which are collections of \\\"static\\\" members, are not meant to be instantiated. Even \\\"abstract\\\" utility classes, which can be extended, should not have \\\"public\\\" constructors. C# adds an implicit public constructor to every class which does not explicitly define at least one constructor. Hence, at least one \\\"protected\\\" constructor should be defined if you wish to subclass this utility class. Or the \\\"static\\\" keyword should be added to the class declaration to prevent subclassing.\",\n          \"defaultLevel\": \"warning\",\n          \"helpUri\": \"http://vs.sonarlint.org/rules/index.html#version=1.13.0&ruleId=S1118\",\n          \"properties\": {\n            \"category\": \"Design\",\n            \"isEnabledByDefault\": true\n          }\n        },\n        \"S1172\": {\n          \"id\": \"S1172\",\n          \"shortDescription\": \"Unused method parameters should be removed\",\n          \"fullDescription\": \"Unused parameters are misleading. Whatever the value passed to such parameters is, the behavior will be the same.\",\n          \"defaultLevel\": \"warning\",\n          \"helpUri\": \"http://vs.sonarlint.org/rules/index.html#version=1.13.0&ruleId=S1172\",\n          \"properties\": {\n            \"category\": \"Maintainability\",\n            \"isEnabledByDefault\": true,\n            \"tags\": [\n              \"Unnecessary\"\n            ]\n          }\n        },\n        \"S1186\": {\n          \"id\": \"S1186\",\n          \"shortDescription\": \"Methods should not be empty\",\n          \"fullDescription\": \"There are several reasons for a method not to have a method body: It is an unintentional omission, and should be fixed. It is not yet, or never will be, supported. In this case a \\\"NotSupportedException\\\" should be thrown. The method is an intentionally-blank override. In this case a nested comment should explain the reason for the blank override.\",\n          \"defaultLevel\": \"warning\",\n          \"helpUri\": \"http://vs.sonarlint.org/rules/index.html#version=1.13.0&ruleId=S1186\",\n          \"properties\": {\n            \"category\": \"Reliability\",\n            \"isEnabledByDefault\": true\n          }\n        }\n      }\n    }\n  ]\n}"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/SarifParserTest/v1_0_empty.json",
    "content": "{\n  \"$schema\": \"http://json.schemastore.org/sarif-1.0.0\",\n  \"version\": \"1.0.0\",\n  \"runs\": [\n    {\n      \"tool\": {\n        \"name\": \"Microsoft (R) Visual C# Compiler\",\n        \"version\": \"1.3.1.0\",\n        \"fileVersion\": \"1.3.1.60616\",\n        \"semanticVersion\": \"1.3.1\",\n        \"language\": \"en-US\"\n      },\n      \"results\": [\n      ]\n    }\n  ]\n}"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/SarifParserTest/v1_0_empty_location.json",
    "content": "{\n  \"$schema\": \"http://json.schemastore.org/sarif-1.0.0\",\n  \"version\": \"1.0.0\",\n  \"runs\": [\n    {\n      \"tool\": {\n        \"name\": \"Microsoft (R) Visual C# Compiler\",\n        \"version\": \"1.3.1.0\",\n        \"fileVersion\": \"1.3.1.60616\",\n        \"semanticVersion\": \"1.3.1\",\n        \"language\": \"en-US\"\n      },\n      \"results\": [\n        {\n          \"ruleId\": \"S1234\",\n          \"level\": \"warning\",\n          \"message\": \"One issue per line\",\n          \"locations\": [ ],\n          \"properties\": {\n            \"warningLevel\": 1\n          }\n        }\n      ],\n      \"rules\": {\n        \"S1234\": {\n          \"id\": \"S1234\",\n          \"shortDescription\": \"One issue per line\",\n          \"fullDescription\": \"This rule will create an issue for every source code line\",\n          \"defaultLevel\": \"warning\",\n          \"properties\": {\n            \"category\": \"Test\",\n            \"isEnabledByDefault\": true\n          }\n        }\n      }\n    }\n  ]\n}"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/SarifParserTest/v1_0_escaping.json",
    "content": "{\n  \"$schema\": \"http://json.schemastore.org/sarif-1.0.0\",\n  \"version\": \"1.0.0\",\n  \"runs\": [\n    {\n      \"tool\": {\n        \"name\": \"Microsoft (R) Visual C# Compiler\",\n        \"version\": \"1.3.1.0\",\n        \"fileVersion\": \"1.3.1.60616\",\n        \"semanticVersion\": \"1.3.1\",\n        \"language\": \"en-US\"\n      },\n      \"results\": [\n        {\n          \"ruleId\": \"S107\",\n          \"level\": \"warning\",\n          \"message\": \"Method has 3 parameters, which is greater than the 2 authorized.\",\n          \"locations\": [\n            {\n              \"resultFile\": {\n                \"uri\": \"%BASEDIR%git/Temp%20Folder%20SomeRandom!@%23$%25%5E&()/csharp/ConsoleApplication1/Program.cs\",\n                \"region\": {\n                  \"startLine\": 52,\n                  \"startColumn\": 24,\n                  \"endLine\": 52,\n                  \"endColumn\": 48\n                }\n              }\n            }\n          ],\n          \"properties\": {\n            \"warningLevel\": 1\n          }\n        }\n      ],\n      \"rules\": {\n        \"S107\": {\n          \"id\": \"S107\",\n          \"shortDescription\": \"Methods should not have too many parameters\",\n          \"fullDescription\": \"A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.\",\n          \"defaultLevel\": \"warning\",\n          \"helpUri\": \"http://vs.sonarlint.org/rules/index.html#version=1.13.0&ruleId=S107\",\n          \"properties\": {\n            \"category\": \"Maintainability\",\n            \"isEnabledByDefault\": false\n          }\n        }\n      }\n    }\n  ]\n}"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/SarifParserTest/v1_0_execution_flow.json",
    "content": "{\n  \"$schema\": \"http://json.schemastore.org/sarif-1.0.0\",\n  \"version\": \"1.0.0\",\n  \"runs\": [\n    {\n      \"tool\": {\n        \"name\": \"Microsoft (R) Visual C# Compiler\",\n        \"version\": \"1.3.1.0\",\n        \"fileVersion\": \"1.3.1.60616\",\n        \"semanticVersion\": \"1.3.1\",\n        \"language\": \"en-GB\"\n      },\n      \"results\": [\n        {\n          \"ruleId\": \"S2259\",\n          \"level\": \"warning\",\n          \"message\": \"'text' is null on at least one execution path.\",\n          \"locations\": [\n            {\n              \"resultFile\": {\n                \"uri\": \"%BASEDIR%Foo.cs\",\n                \"region\": {\n                  \"startLine\": 308,\n                  \"startColumn\": 30,\n                  \"endLine\": 308,\n                  \"endColumn\": 34\n                }\n              }\n            }\n          ],\n          \"relatedLocations\": [\n            {\n              \"physicalLocation\": {\n                \"uri\": \"%BASEDIR%Foo.cs\",\n                \"region\": {\n                  \"startLine\": 22,\n                  \"startColumn\": 17,\n                  \"endLine\": 22,\n                  \"endColumn\": 36\n                }\n              }\n            },\n            {\n              \"physicalLocation\": {\n                \"uri\": \"%BASEDIR%Foo.cs\",\n                \"region\": {\n                  \"startLine\": 22,\n                  \"startColumn\": 17,\n                  \"endLine\": 22,\n                  \"endColumn\": 36\n                }\n              }\n            },\n            {\n              \"physicalLocation\": {\n                \"uri\": \"%BASEDIR%Foo.cs\",\n                \"region\": {\n                  \"startLine\": 23,\n                  \"startColumn\": 43,\n                  \"endLine\": 23,\n                  \"endColumn\": 50\n                }\n              }\n            },\n            {\n              \"physicalLocation\": {\n                \"uri\": \"%BASEDIR%Foo.cs\",\n                \"region\": {\n                  \"startLine\": 308,\n                  \"startColumn\": 30,\n                  \"endLine\": 308,\n                  \"endColumn\": 34\n                }\n              }\n            }\n          ],\n          \"properties\": {\n            \"warningLevel\": 1,\n            \"customProperties\": {\n              \"secondaryLocationAsExecutionFlow\": true,\n              \"0\": \"Learning null\",\n              \"1\": \"Taking assumption\",\n              \"2\": \"Taking assumption\",\n              \"3\": \"'text' is null on at least one execution path.\"\n            }\n          }\n        }\n      ],\n      \"rules\": {\n        \"S2259\": {\n          \"id\": \"S2259\",\n          \"shortDescription\": \"Null pointers should not be dereferenced\",\n          \"fullDescription\": \"Accessing a null value will always throw a NullReferenceException most likely causing an abrupt program termination.\",\n          \"defaultLevel\": \"warning\",\n          \"properties\": {\n            \"category\": \"Major Bug\",\n            \"isEnabledByDefault\": true,\n            \"tags\": [\n              \"C#\",\n              \"MainSourceScope\",\n              \"SonarWay\"\n            ]\n          }\n        }\n      }\n    }\n  ]\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/SarifParserTest/v1_0_execution_flow_no_secondary_locations.json",
    "content": "{\n  \"$schema\": \"http://json.schemastore.org/sarif-1.0.0\",\n  \"version\": \"1.0.0\",\n  \"runs\": [\n    {\n      \"tool\": {\n        \"name\": \"Microsoft (R) Visual C# Compiler\",\n        \"version\": \"1.3.1.0\",\n        \"fileVersion\": \"1.3.1.60616\",\n        \"semanticVersion\": \"1.3.1\",\n        \"language\": \"en-GB\"\n      },\n      \"results\": [\n        {\n          \"ruleId\": \"S2259\",\n          \"level\": \"warning\",\n          \"message\": \"'text' is null on at least one execution path.\",\n          \"locations\": [\n            {\n              \"resultFile\": {\n                \"uri\": \"%BASEDIR%Foo.cs\",\n                \"region\": {\n                  \"startLine\": 308,\n                  \"startColumn\": 30,\n                  \"endLine\": 308,\n                  \"endColumn\": 34\n                }\n              }\n            }\n          ],\n          \"properties\": {\n            \"warningLevel\": 1,\n            \"customProperties\": {\n              \"secondaryLocationAsExecutionFlow\": true\n            }\n          }\n        }\n      ],\n      \"rules\": {\n        \"S2259\": {\n          \"id\": \"S2259\",\n          \"shortDescription\": \"Null pointers should not be dereferenced\",\n          \"fullDescription\": \"Accessing a null value will always throw a NullReferenceException most likely causing an abrupt program termination.\",\n          \"defaultLevel\": \"warning\",\n          \"properties\": {\n            \"category\": \"Major Bug\",\n            \"isEnabledByDefault\": true,\n            \"tags\": [\n              \"C#\",\n              \"MainSourceScope\",\n              \"SonarWay\"\n            ]\n          }\n        }\n      }\n    }\n  ]\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/SarifParserTest/v1_0_file_level_issue.json",
    "content": "{\n  \"$schema\": \"http://json.schemastore.org/sarif-1.0.0\",\n  \"version\": \"1.0.0\",\n  \"runs\": [\n    {\n      \"tool\": {\n        \"name\": \"Microsoft (R) Visual C# Compiler\",\n        \"version\": \"1.3.1.0\",\n        \"fileVersion\": \"1.3.1.60616\",\n        \"semanticVersion\": \"1.3.1\",\n        \"language\": \"en-US\"\n      },\n      \"results\": [\n        {\n          \"ruleId\": \"S104\",\n          \"level\": \"warning\",\n          \"message\": \"Some dummy message\",\n          \"locations\": [\n            {\n              \"resultFile\": {\n                \"uri\": \"%BASEDIR%Program.cs\",\n                \"region\": {\n                  \"startLine\": 1,\n                  \"startColumn\": 1,\n                  \"endLine\": 1,\n                  \"endColumn\": 1\n                }\n              }\n            }\n          ],\n          \"properties\": {\n            \"warningLevel\": 1\n          }\n        },\n        {\n          \"ruleId\": \"S105\",\n          \"message\": \"Some dummy message\",\n          \"locations\": [\n            {\n              \"resultFile\": {\n                \"uri\": \"%BASEDIR%Program.cs\",\n                \"region\": {\n                  \"startLine\": 1,\n                  \"startColumn\": 1,\n                  \"endLine\": 1,\n                  \"endColumn\": 1\n                }\n              }\n            }\n          ],\n          \"properties\": {\n            \"warningLevel\": 1\n          }\n        },\n        {\n          \"ruleId\": \"S105\",\n          \"level\": \"warning\",\n          \"message\": \"Some dummy message\",\n          \"locations\": [\n            {\n              \"resultFile\": {\n                \"uri\": \"%BASEDIR%Program.cs\",\n                \"region\": {\n                  \"startLine\": 1,\n                  \"startColumn\": 1,\n                  \"endLine\": 1,\n                  \"endColumn\": 2\n                }\n              }\n            }\n          ],\n          \"properties\": {\n            \"warningLevel\": 1\n          }\n        },\n        {\n          \"ruleId\": \"S105\",\n          \"level\": \"warning\",\n          \"message\": \"Some dummy message\",\n          \"locations\": [\n            {\n              \"resultFile\": {\n                \"uri\": \"%BASEDIR%Program.cs\",\n                \"region\": {\n                  \"startLine\": 1,\n                  \"startColumn\": 1,\n                  \"endLine\": 2,\n                  \"endColumn\": 1\n                }\n              }\n            }\n          ],\n          \"properties\": {\n            \"warningLevel\": 1\n          }\n        },\n        {\n          \"ruleId\": \"S106\",\n          \"level\": \"warning\",\n          \"message\": \"Some dummy message\",\n          \"locations\": [\n            {\n              \"resultFile\": {\n                \"uri\": \"%BASEDIR%Program.cs\",\n                \"region\": {\n                  \"startLine\": 1,\n                  \"startColumn\": 1,\n                  \"endLine\": 1,\n                  \"endColumn\": 1\n                }\n              }\n            }\n          ],\n          \"properties\": {\n            \"warningLevel\": 1\n          }\n        }\n      ]\n    }\n  ]\n}"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/SarifParserTest/v1_0_file_level_issue_with_execution_flow.json",
    "content": "{\n  \"$schema\": \"http://json.schemastore.org/sarif-1.0.0\",\n  \"version\": \"1.0.0\",\n  \"runs\": [\n    {\n      \"tool\": {\n        \"name\": \"Microsoft (R) Visual C# Compiler\",\n        \"version\": \"1.3.1.0\",\n        \"fileVersion\": \"1.3.1.60616\",\n        \"semanticVersion\": \"1.3.1\",\n        \"language\": \"en-GB\"\n      },\n      \"results\": [\n        {\n          \"ruleId\": \"S1234\",\n          \"level\": \"warning\",\n          \"message\": \"'text' is null on at least one execution path.\",\n          \"locations\": [\n            {\n              \"resultFile\": {\n                \"uri\": \"%BASEDIR%Foo.cs\",\n                \"region\": {\n                  \"startLine\": 1,\n                  \"startColumn\": 1,\n                  \"endLine\": 1,\n                  \"endColumn\": 1\n                }\n              }\n            }\n          ],\n          \"relatedLocations\": [\n            {\n              \"physicalLocation\": {\n                \"uri\": \"%BASEDIR%Foo.cs\",\n                \"region\": {\n                  \"startLine\": 22,\n                  \"startColumn\": 17,\n                  \"endLine\": 22,\n                  \"endColumn\": 36\n                }\n              }\n            },\n            {\n              \"physicalLocation\": {\n                \"uri\": \"%BASEDIR%Foo.cs\",\n                \"region\": {\n                  \"startLine\": 22,\n                  \"startColumn\": 17,\n                  \"endLine\": 22,\n                  \"endColumn\": 36\n                }\n              }\n            },\n            {\n              \"physicalLocation\": {\n                \"uri\": \"%BASEDIR%Foo.cs\",\n                \"region\": {\n                  \"startLine\": 23,\n                  \"startColumn\": 43,\n                  \"endLine\": 23,\n                  \"endColumn\": 50\n                }\n              }\n            },\n            {\n              \"physicalLocation\": {\n                \"uri\": \"%BASEDIR%Foo.cs\",\n                \"region\": {\n                  \"startLine\": 308,\n                  \"startColumn\": 30,\n                  \"endLine\": 308,\n                  \"endColumn\": 34\n                }\n              }\n            }\n          ],\n          \"properties\": {\n            \"warningLevel\": 1,\n            \"customProperties\": {\n              \"secondaryLocationAsExecutionFlow\": true,\n              \"0\": \"Learning null\",\n              \"1\": \"Taking assumption\",\n              \"2\": \"Taking assumption\",\n              \"3\": \"'text' is null on at least one execution path.\"\n            }\n          }\n        }\n      ],\n      \"rules\": {\n        \"S2259\": {\n          \"id\": \"S2259\",\n          \"shortDescription\": \"Null pointers should not be dereferenced\",\n          \"fullDescription\": \"Accessing a null value will always throw a NullReferenceException most likely causing an abrupt program termination.\",\n          \"defaultLevel\": \"warning\",\n          \"properties\": {\n            \"category\": \"Major Bug\",\n            \"isEnabledByDefault\": true,\n            \"tags\": [\n              \"C#\",\n              \"MainSourceScope\",\n              \"SonarWay\"\n            ]\n          }\n        }\n      }\n    }\n  ]\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/SarifParserTest/v1_0_file_name_with_illegal_char.json",
    "content": "{\n  \"$schema\": \"http://json.schemastore.org/sarif-1.0.0\",\n  \"version\": \"1.0.0\",\n  \"runs\": [\n    {\n      \"tool\": {\n        \"name\": \"Microsoft (R) Visual C# Compiler\",\n        \"version\": \"1.3.1.0\",\n        \"fileVersion\": \"1.3.1.60616\",\n        \"semanticVersion\": \"1.3.1\",\n        \"language\": \"en-US\"\n      },\n      \"results\": [\n        {\n          \"ruleId\": \"S1118\",\n          \"level\": \"warning\",\n          \"message\": \"Add a 'protected' constructor or the 'static' keyword to the class declaration.\",\n          \"locations\": [\n            {\n              \"resultFile\": {\n                \"uri\": \"%BASEDIR%ConsoleApplication1/P@!$%23&+-=r%5E%7B%7Dog_r()a%20m[1].cs\",\n                \"region\": {\n                  \"startLine\": 9,\n                  \"startColumn\": 11,\n                  \"endLine\": 9,\n                  \"endColumn\": 18\n                }\n              }\n            }\n          ],\n          \"properties\": {\n            \"warningLevel\": 1\n          }\n        }\n      ],\n      \"rules\": {\n        \"S1118\": {\n          \"id\": \"S1118\",\n          \"shortDescription\": \"Utility classes should not have public constructors\",\n          \"fullDescription\": \"Utility classes, which are collections of static members, are not meant to be instantiated. Even abstract utility classes, which can be extended, should not have public constructors.\",\n          \"defaultLevel\": \"warning\",\n          \"properties\": {\n            \"category\": \"Sonar Code Smell\",\n            \"isEnabledByDefault\": true\n          }\n        }\n      }\n    }\n  ]\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/SarifParserTest/v1_0_invalid_execution_flow_value.json",
    "content": "{\n  \"$schema\": \"http://json.schemastore.org/sarif-1.0.0\",\n  \"version\": \"1.0.0\",\n  \"runs\": [\n    {\n      \"tool\": {\n        \"name\": \"Microsoft (R) Visual C# Compiler\",\n        \"version\": \"1.3.1.0\",\n        \"fileVersion\": \"1.3.1.60616\",\n        \"semanticVersion\": \"1.3.1\",\n        \"language\": \"en-GB\"\n      },\n      \"results\": [\n        {\n          \"ruleId\": \"S2259\",\n          \"level\": \"warning\",\n          \"message\": \"'text' is null on at least one execution path.\",\n          \"locations\": [\n            {\n              \"resultFile\": {\n                \"uri\": \"%BASEDIR%Foo.cs\",\n                \"region\": {\n                  \"startLine\": 308,\n                  \"startColumn\": 30,\n                  \"endLine\": 308,\n                  \"endColumn\": 34\n                }\n              }\n            }\n          ],\n          \"relatedLocations\": [\n            {\n              \"physicalLocation\": {\n                \"uri\": \"%BASEDIR%Foo.cs\",\n                \"region\": {\n                  \"startLine\": 22,\n                  \"startColumn\": 17,\n                  \"endLine\": 22,\n                  \"endColumn\": 36\n                }\n              }\n            },\n            {\n              \"physicalLocation\": {\n                \"uri\": \"%BASEDIR%Foo.cs\",\n                \"region\": {\n                  \"startLine\": 22,\n                  \"startColumn\": 17,\n                  \"endLine\": 22,\n                  \"endColumn\": 36\n                }\n              }\n            },\n            {\n              \"physicalLocation\": {\n                \"uri\": \"%BASEDIR%Foo.cs\",\n                \"region\": {\n                  \"startLine\": 23,\n                  \"startColumn\": 43,\n                  \"endLine\": 23,\n                  \"endColumn\": 50\n                }\n              }\n            }\n          ],\n          \"properties\": {\n            \"warningLevel\": 1,\n            \"customProperties\": {\n              \"secondaryLocationAsExecutionFlow\": 42,\n              \"0\": \"Learning null\",\n              \"1\": \"Taking assumption\",\n              \"2\": \"Taking assumption\"\n            }\n          }\n        }\n      ],\n      \"rules\": {\n        \"S2259\": {\n          \"id\": \"S2259\",\n          \"shortDescription\": \"Null pointers should not be dereferenced\",\n          \"fullDescription\": \"Accessing a null value will always throw a NullReferenceException most likely causing an abrupt program termination.\",\n          \"defaultLevel\": \"warning\",\n          \"properties\": {\n            \"category\": \"Major Bug\",\n            \"isEnabledByDefault\": true,\n            \"tags\": [\n              \"C#\",\n              \"MainSourceScope\",\n              \"SonarWay\"\n            ]\n          }\n        }\n      }\n    }\n  ]\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/SarifParserTest/v1_0_no_execution_flow.json",
    "content": "{\n  \"$schema\": \"http://json.schemastore.org/sarif-1.0.0\",\n  \"version\": \"1.0.0\",\n  \"runs\": [\n    {\n      \"tool\": {\n        \"name\": \"Microsoft (R) Visual C# Compiler\",\n        \"version\": \"1.3.1.0\",\n        \"fileVersion\": \"1.3.1.60616\",\n        \"semanticVersion\": \"1.3.1\",\n        \"language\": \"en-GB\"\n      },\n      \"results\": [\n        {\n          \"ruleId\": \"S2259\",\n          \"level\": \"warning\",\n          \"message\": \"'text' is null on at least one execution path.\",\n          \"locations\": [\n            {\n              \"resultFile\": {\n                \"uri\": \"%BASEDIR%Foo.cs\",\n                \"region\": {\n                  \"startLine\": 308,\n                  \"startColumn\": 30,\n                  \"endLine\": 308,\n                  \"endColumn\": 34\n                }\n              }\n            }\n          ],\n          \"relatedLocations\": [\n            {\n              \"physicalLocation\": {\n                \"uri\": \"%BASEDIR%Foo.cs\",\n                \"region\": {\n                  \"startLine\": 22,\n                  \"startColumn\": 17,\n                  \"endLine\": 22,\n                  \"endColumn\": 36\n                }\n              }\n            },\n            {\n              \"physicalLocation\": {\n                \"uri\": \"%BASEDIR%Foo.cs\",\n                \"region\": {\n                  \"startLine\": 22,\n                  \"startColumn\": 17,\n                  \"endLine\": 22,\n                  \"endColumn\": 36\n                }\n              }\n            },\n            {\n              \"physicalLocation\": {\n                \"uri\": \"%BASEDIR%Foo.cs\",\n                \"region\": {\n                  \"startLine\": 23,\n                  \"startColumn\": 43,\n                  \"endLine\": 23,\n                  \"endColumn\": 50\n                }\n              }\n            }\n          ],\n          \"properties\": {\n            \"warningLevel\": 1,\n            \"customProperties\": {\n              \"secondaryLocationAsExecutionFlow\": false,\n              \"0\": \"Learning null\",\n              \"1\": \"Taking assumption\",\n              \"2\": \"Taking assumption\"\n            }\n          }\n        }\n      ],\n      \"rules\": {\n        \"S2259\": {\n          \"id\": \"S2259\",\n          \"shortDescription\": \"Null pointers should not be dereferenced\",\n          \"fullDescription\": \"Accessing a null value will always throw a NullReferenceException most likely causing an abrupt program termination.\",\n          \"defaultLevel\": \"warning\",\n          \"properties\": {\n            \"category\": \"Major Bug\",\n            \"isEnabledByDefault\": true,\n            \"tags\": [\n              \"C#\",\n              \"MainSourceScope\",\n              \"SonarWay\"\n            ]\n          }\n        }\n      }\n    }\n  ]\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/SarifParserTest/v1_0_no_location.json",
    "content": "{\n  \"$schema\": \"http://json.schemastore.org/sarif-1.0.0\",\n  \"version\": \"1.0.0\",\n  \"runs\": [\n    {\n      \"tool\": {\n        \"name\": \"Microsoft (R) Visual C# Compiler\",\n        \"version\": \"1.3.1.0\",\n        \"fileVersion\": \"1.3.1.60616\",\n        \"semanticVersion\": \"1.3.1\",\n        \"language\": \"en-US\"\n      },\n      \"results\": [\n        {\n          \"ruleId\": \"S1234\",\n          \"level\": \"warning\",\n          \"message\": \"One issue per line\",\n          \"properties\": {\n            \"warningLevel\": 1\n          }\n        }\n      ],\n      \"rules\": {\n        \"S1234\": {\n          \"id\": \"S1234\",\n          \"shortDescription\": \"One issue per line\",\n          \"fullDescription\": \"This rule will create an issue for every source code line\",\n          \"defaultLevel\": \"warning\",\n          \"properties\": {\n            \"category\": \"Test\",\n            \"isEnabledByDefault\": true\n          }\n        }\n      }\n    }\n  ]\n}"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/SarifParserTest/v1_0_no_message.json",
    "content": "{\n  \"$schema\": \"http://json.schemastore.org/sarif-1.0.0\",\n  \"version\": \"1.0.0\",\n  \"runs\": [\n    {\n      \"tool\": {\n        \"name\": \"Microsoft (R) Visual C# Compiler\",\n        \"version\": \"1.3.1.0\",\n        \"fileVersion\": \"1.3.1.60616\",\n        \"semanticVersion\": \"1.3.1\",\n        \"language\": \"en-US\"\n      },\n      \"results\": [\n        {\n          \"ruleId\": \"S1234\",\n          \"level\": \"warning\",\n          \"locations\": [\n            {\n              \"resultFile\": {\n                \"uri\": \"%BASEDIR%Foo.cs\",\n                \"region\": {\n                  \"startLine\": 1,\n                  \"startColumn\": 1,\n                  \"endLine\": 1,\n                  \"endColumn\": 14\n                }\n              }\n            }\n          ],\n          \"properties\": {\n            \"warningLevel\": 1\n          }\n        },\n        {\n          \"ruleId\": \"S1234\",\n          \"level\": \"warning\",\n          \"message\": \"message\",\n          \"locations\": [\n            {\n              \"resultFile\": {\n                \"uri\": \"%BASEDIR%Bar.cs\",\n                \"region\": {\n                  \"startLine\": 2,\n                  \"startColumn\": 1,\n                  \"endLine\": 2,\n                  \"endColumn\": 34\n                }\n              }\n            }\n          ],\n          \"properties\": {\n            \"warningLevel\": 1\n          }\n        }\n      ],\n      \"rules\": {\n        \"S1234\": {\n          \"id\": \"S1234\",\n          \"shortDescription\": \"One issue per line\",\n          \"fullDescription\": \"This rule will create an issue for every source code line\",\n          \"defaultLevel\": \"warning\",\n          \"properties\": {\n            \"category\": \"Test\",\n            \"isEnabledByDefault\": true\n          }\n        }\n      }\n    }\n  ]\n}"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/SarifParserTest/v1_0_region_with_length.json",
    "content": "{\n  \"$schema\": \"http://json.schemastore.org/sarif-1.0.0\",\n  \"version\": \"1.0.0\",\n  \"runs\": [\n    {\n      \"tool\": {\n        \"name\": \"Microsoft (R) Visual C# Compiler\",\n        \"version\": \"3.9.0.0\",\n        \"fileVersion\": \"3.9.0-5.21120.8 (accdcb77)\",\n        \"semanticVersion\": \"3.9.0\",\n        \"language\": \"en-US\"\n      },\n      \"results\": [\n        {\n          \"ruleId\": \"S1144\",\n          \"level\": \"warning\",\n          \"message\": \"Remove the unused private method 'UnusedMethod'.\",\n          \"locations\": [\n            {\n              \"resultFile\": {\n                \"uri\": \"SourceGeneratorPOC.Generators/SourceGeneratorPOC.SourceGenerator/Greetings.cs\",\n                \"region\": {\n                  \"startLine\": 7,\n                  \"startColumn\": 9,\n                  \"endLine\": 7,\n                  \"length\": 38\n                }\n              }\n            }\n          ],\n          \"properties\": {\n            \"warningLevel\": 1\n          }\n        }\n      ],\n      \"rules\": {\n        \"S1144\": {\n          \"id\": \"S1144\",\n          \"shortDescription\": \"Unused private types or members should be removed\",\n          \"fullDescription\": \"private or internal types or private members that are never executed or referenced are dead code: unnecessary, inoperative code that should be removed. Cleaning out dead code decreases the size of the maintained codebase, making it easier to understand the program and preventing bugs from being introduced.\",\n          \"defaultLevel\": \"note\",\n          \"properties\": {\n            \"category\": \"Major Code Smell\",\n            \"isEnabledByDefault\": true,\n            \"tags\": [\n              \"C#\",\n              \"SonarWay\",\n              \"MainSourceScope\",\n              \"TestSourceScope\",\n              \"Unnecessary\"\n            ]\n          }\n        }\n      }\n    }\n  ]\n}"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/SarifParserTest/v1_0_relative_paths.json",
    "content": "{\n  \"$schema\": \"http://json.schemastore.org/sarif-1.0.0\",\n  \"version\": \"1.0.0\",\n  \"runs\": [\n    {\n      \"tool\": {\n        \"name\": \"Microsoft (R) Visual C# Compiler\",\n        \"version\": \"3.9.0.0\",\n        \"fileVersion\": \"3.9.0-5.21120.8 (accdcb77)\",\n        \"semanticVersion\": \"3.9.0\",\n        \"language\": \"en-US\"\n      },\n      \"results\": [\n        {\n          \"ruleId\": \"S1144\",\n          \"level\": \"warning\",\n          \"message\": \"Remove the unused private method 'UnusedMethod'.\",\n          \"locations\": [\n            {\n              \"resultFile\": {\n                \"uri\": \"SourceGeneratorPOC.Generators/SourceGeneratorPOC.SourceGenerator/Greetings.cs\",\n                \"region\": {\n                  \"startLine\": 7,\n                  \"startColumn\": 9,\n                  \"endLine\": 7,\n                  \"endColumn\": 47\n                }\n              }\n            }\n          ],\n          \"properties\": {\n            \"warningLevel\": 1\n          }\n        },\n        {\n          \"ruleId\": \"S1186\",\n          \"level\": \"warning\",\n          \"message\": \"Add a nested comment explaining why this method is empty, throw a 'NotSupportedException' or complete the implementation.\",\n          \"locations\": [\n            {\n              \"resultFile\": {\n                \"uri\": \"SourceGeneratorPOC.Generators/SourceGeneratorPOC.SourceGenerator/Greetings.cs\",\n                \"region\": {\n                  \"startLine\": 7,\n                  \"startColumn\": 29,\n                  \"endLine\": 7,\n                  \"endColumn\": 41\n                }\n              }\n            }\n          ],\n          \"properties\": {\n            \"warningLevel\": 1\n          }\n        }\n      ],\n      \"rules\": {\n        \"S1144\": {\n          \"id\": \"S1144\",\n          \"shortDescription\": \"Unused private types or members should be removed\",\n          \"fullDescription\": \"private or internal types or private members that are never executed or referenced are dead code: unnecessary, inoperative code that should be removed. Cleaning out dead code decreases the size of the maintained codebase, making it easier to understand the program and preventing bugs from being introduced.\",\n          \"defaultLevel\": \"note\",\n          \"properties\": {\n            \"category\": \"Major Code Smell\",\n            \"isEnabledByDefault\": true,\n            \"tags\": [\n              \"C#\",\n              \"SonarWay\",\n              \"MainSourceScope\",\n              \"TestSourceScope\",\n              \"Unnecessary\"\n            ]\n          }\n        },\n        \"S1186\": {\n          \"id\": \"S1186\",\n          \"shortDescription\": \"Methods should not be empty\",\n          \"fullDescription\": \"There are several reasons for a method not to have a method body:\",\n          \"defaultLevel\": \"warning\",\n          \"properties\": {\n            \"category\": \"Critical Code Smell\",\n            \"isEnabledByDefault\": true,\n            \"tags\": [\n              \"C#\",\n              \"SonarWay\",\n              \"MainSourceScope\",\n              \"TestSourceScope\"\n            ]\n          }\n        }\n      }\n    }\n  ]\n}"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/SarifParserTest/v1_0_same_start_end_location.json",
    "content": "{\n  \"$schema\": \"http://json.schemastore.org/sarif-1.0.0\",\n  \"version\": \"1.0.0\",\n  \"runs\": [\n    {\n      \"tool\": {\n        \"name\": \"Microsoft (R) Visual C# Compiler\",\n        \"version\": \"4.12.0.0\",\n        \"fileVersion\": \"4.12.0-3.24574.8 (dfa7fc6b)\",\n        \"semanticVersion\": \"4.12.0\",\n        \"language\": \"en-US\"\n      },\n      \"results\": [\n        {\n          \"ruleId\": \"IDE0055\",\n          \"level\": \"note\",\n          \"message\": \"Fix formatting - middle of line\",\n          \"locations\": [\n            {\n              \"resultFile\": {\n                \"uri\": \"Foo.cs\",\n                \"region\": {\n                  \"startLine\": 8,\n                  \"startColumn\": 6,\n                  \"endLine\": 8,\n                  \"endColumn\": 6\n                }\n              }\n            }\n          ],\n          \"properties\": {\n            \"warningLevel\": 1\n          }\n        },\n        {\n          \"ruleId\": \"IDE0055\",\n          \"level\": \"note\",\n          \"message\": \"Fix formatting - start of line\",\n          \"locations\": [\n            {\n              \"resultFile\": {\n                \"uri\": \"Foo.cs\",\n                \"region\": {\n                  \"startLine\": 8,\n                  \"startColumn\": 1,\n                  \"endLine\": 8,\n                  \"endColumn\": 1\n                }\n              }\n            }\n          ],\n          \"properties\": {\n            \"warningLevel\": 1\n          }\n        },\n        {\n          \"ruleId\": \"IDE0055\",\n          \"level\": \"note\",\n          \"message\": \"Fix formatting - First line\",\n          \"locations\": [\n            {\n              \"resultFile\": {\n                \"uri\": \"Foo.cs\",\n                \"region\": {\n                  \"startLine\": 1,\n                  \"startColumn\": 1,\n                  \"endLine\": 1,\n                  \"endColumn\": 1\n                }\n              }\n            }\n          ],\n          \"properties\": {\n            \"warningLevel\": 1\n          }\n        }\n      ],\n      \"rules\": {\n        \"IDE0055\": {\n          \"id\": \"IDE0055\",\n          \"shortDescription\": \"Fix formatting\",\n          \"defaultLevel\": \"note\",\n          \"helpUri\": \"https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0055\",\n          \"properties\": {\n            \"category\": \"Style\",\n            \"isEnabledByDefault\": true,\n            \"tags\": [\n              \"Telemetry\",\n              \"EnforceOnBuild_HighlyRecommended\"\n            ]\n          }\n        }\n      }\n    }\n  ]\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/SarifParserTest/v1_0_secondary_locations.json",
    "content": "{\n  \"$schema\": \"http://json.schemastore.org/sarif-1.0.0\",\n  \"version\": \"1.0.0\",\n  \"runs\": [\n    {\n      \"tool\": {\n        \"name\": \"Microsoft (R) Visual C# Compiler\",\n        \"version\": \"1.3.1.0\",\n        \"fileVersion\": \"1.3.1.60616\",\n        \"semanticVersion\": \"1.3.1\",\n        \"language\": \"en-GB\"\n      },\n      \"results\": [\n        {\n          \"ruleId\": \"S1764\",\n          \"level\": \"warning\",\n          \"message\": \"Identical sub-expressions on both sides of operator \\\"==\\\".\",\n          \"locations\": [\n            {\n              \"resultFile\": {\n                \"uri\": \"%BASEDIR%Foo.cs\",\n                \"region\": {\n                  \"startLine\": 28,\n                  \"startColumn\": 35,\n                  \"endLine\": 28,\n                  \"endColumn\": 52\n                }\n              }\n            }\n          ],\n          \"relatedLocations\": [\n            {\n              \"physicalLocation\": {\n                \"uri\": \"%BASEDIR%Foo.cs\",\n                \"region\": {\n                  \"startLine\": 28,\n                  \"startColumn\": 14,\n                  \"endLine\": 28,\n                  \"endColumn\": 31\n                }\n              }\n            }\n          ],\n          \"properties\": {\n            \"warningLevel\": 1\n          }\n        },\n        {\n          \"ruleId\": \"CS9999\",\n          \"level\": \"warning\",\n          \"message\": \"External file level issue\",\n          \"locations\": [\n            {\n              \"resultFile\": {\n                \"uri\": \"%BASEDIR%Foo.cs\",\n                \"region\": {\n                  \"startLine\": 1,\n                  \"startColumn\": 1,\n                  \"endLine\": 1,\n                  \"endColumn\": 1\n                }\n              }\n            }\n          ],\n          \"relatedLocations\": [\n            {\n              \"physicalLocation\": {\n                \"uri\": \"%BASEDIR%Foo.cs\",\n                \"region\": {\n                  \"startLine\": 28,\n                  \"startColumn\": 14,\n                  \"endLine\": 28,\n                  \"endColumn\": 31\n                }\n              }\n            }\n          ],\n          \"properties\": {\n            \"warningLevel\": 3\n          }\n        },\n        {\n          \"ruleId\": \"S3776\",\n          \"level\": \"warning\",\n          \"message\": \"Refactor this top-level file to reduce its Cognitive Complexity from 1 to the 0 allowed.\",\n          \"locations\": [\n            {\n              \"resultFile\": {\n                \"uri\": \"%BASEDIR%Foo.cs\",\n                \"region\": {\n                  \"startLine\": 1,\n                  \"startColumn\": 1,\n                  \"endLine\": 1,\n                  \"endColumn\": 1\n                }\n              }\n            }\n          ],\n          \"relatedLocations\": [\n            {\n              \"physicalLocation\": {\n                \"uri\": \"%BASEDIR%Foo.cs\",\n                \"region\": {\n                  \"startLine\": 28,\n                  \"startColumn\": 14,\n                  \"endLine\": 28,\n                  \"endColumn\": 31\n                }\n              }\n            }\n          ],\n          \"properties\": {\n            \"warningLevel\": 1,\n            \"customProperties\": {\n              \"0\": \"+1\"\n            }\n          }\n        }\n      ],\n      \"rules\": {\n        \"S1764\": {\n          \"id\": \"S1764\",\n          \"shortDescription\": \"Identical expressions should not be used on both sides of a binary operator\",\n          \"fullDescription\": \"Using the same value on either side of a binary operator is almost always a mistake. In the case of logical operators, it is either a copy/paste error and therefore a bug, or it is simply wasted code, and should be simplified. In the case of bitwise operators and most binary mathematical operators, having the same value on both sides of an operator yields predictable results, and should be simplified.\",\n          \"defaultLevel\": \"warning\",\n          \"helpUri\": \"http://vs.sonarlint.org/rules/index.html#version=1.23.0.0&ruleId=S1764\",\n          \"properties\": {\n            \"category\": \"Sonar Bug\",\n            \"isEnabledByDefault\": true\n          }\n        },\n        \"CS9999\": {\n          \"id\": \"CS9999\",\n          \"shortDescription\": \"External analyzer's file level rule\",\n          \"fullDescription\": \"External analyzer's file level rule\",\n          \"defaultLevel\": \"warning\",\n          \"properties\": {\n            \"category\": \"External Issue\",\n            \"isEnabledByDefault\": true\n          }\n        },\n        \"S3776\": {\n          \"id\": \"S3776\",\n          \"shortDescription\": \"Cognitive Complexity of methods should not be too high\",\n          \"fullDescription\": \"Cognitive Complexity is a measure of how hard the control flow of a method is to understand. Methods with high Cognitive Complexity will be difficult to maintain.\",\n          \"defaultLevel\": \"warning\",\n          \"properties\": {\n            \"category\": \"Critical Code Smell\",\n            \"isEnabledByDefault\": false,\n            \"tags\": [\n              \"C#\",\n              \"SonarWay\",\n              \"MainSourceScope\",\n              \"TestSourceScope\"\n            ]\n          }\n        }\n      }\n    }\n  ]\n}"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/SarifParserTest/v1_0_secondary_locations_messages.json",
    "content": "{\n  \"$schema\": \"http://json.schemastore.org/sarif-1.0.0\",\n  \"version\": \"1.0.0\",\n  \"runs\": [\n    {\n      \"tool\": {\n        \"name\": \"Microsoft (R) Visual C# Compiler\",\n        \"version\": \"1.3.1.0\",\n        \"fileVersion\": \"1.3.1.60616\",\n        \"semanticVersion\": \"1.3.1\",\n        \"language\": \"en-GB\"\n      },\n      \"results\": [\n        {\n          \"ruleId\": \"S3776\",\n          \"level\": \"warning\",\n          \"message\": \"Refactor this method to reduce its Cognitive Complexity from 30 to the 15 allowed\",\n          \"locations\": [\n            {\n              \"resultFile\": {\n                \"uri\": \"%BASEDIR%Foo.cs\",\n                \"region\": {\n                  \"startLine\": 54,\n                  \"startColumn\": 22,\n                  \"endLine\": 54,\n                  \"endColumn\": 25\n                }\n              }\n            }\n          ],\n          \"relatedLocations\": [\n            {\n              \"physicalLocation\": {\n                \"uri\": \"%BASEDIR%Foo.cs\",\n                \"region\": {\n                  \"startLine\": 56,\n                  \"startColumn\": 13,\n                  \"endLine\": 56,\n                  \"endColumn\": 15\n                }\n              }\n            },\n            {\n              \"physicalLocation\": {\n                \"uri\": \"%BASEDIR%Foo.cs\",\n                \"region\": {\n                  \"startLine\": 65,\n                  \"startColumn\": 17,\n                  \"endLine\": 65,\n                  \"endColumn\": 19\n                }\n              }\n            },\n            {\n              \"physicalLocation\": {\n                \"uri\": \"%BASEDIR%Foo.cs\",\n                \"region\": {\n                  \"startLine\": 65,\n                  \"startColumn\": 53,\n                  \"endLine\": 65,\n                  \"endColumn\": 55\n                }\n              }\n            }\n          ],\n          \"properties\": {\n            \"warningLevel\": 1,\n            \"customProperties\": {\n              \"0\": \"+1\",\n              \"1\": \"+2 (incl 1 for nesting)\",\n              \"2\": \"+1\"\n            }\n          }\n        }\n      ],\n      \"rules\": {\n        \"S3776\": {\n          \"id\": \"S3776\",\n          \"shortDescription\": \"Cognitive Complexity of methods should not be too high\",\n          \"fullDescription\": \"Cognitive Complexity is a measure of how hard the control flow of a method is to understand. Methods with high Cognitive Complexity will be difficult to maintain.\",\n          \"defaultLevel\": \"warning\",\n          \"helpUri\": \"http://vs.sonarlint.org/rules/index.html#version=1.23.0.0&ruleId=S3776\",\n          \"properties\": {\n            \"category\": \"Sonar Code Smell\",\n            \"isEnabledByDefault\": true\n          }\n        }\n      }\n    }\n  ]\n}"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/SarifParserTest/v1_0_suppressed.json",
    "content": "{\n  \"$schema\": \"http://json.schemastore.org/sarif-1.0.0\",\n  \"version\": \"1.0.0\",\n  \"runs\": [\n    {\n      \"tool\": {\n        \"name\": \"Microsoft (R) Visual C# Compiler\",\n        \"version\": \"1.3.1.0\",\n        \"fileVersion\": \"1.3.1.60616\",\n        \"semanticVersion\": \"1.3.1\",\n        \"language\": \"en-US\"\n      },\n      \"results\": [\n        {\n          \"ruleId\": \"S1234\",\n          \"level\": \"warning\",\n          \"message\": \"One issue per line\",\n          \"suppressionStates\": [\n            \"suppressedInSource\"\n          ],\n          \"locations\": [\n            {\n              \"resultFile\": {\n                \"uri\": \"%BASEDIR%Foo.cs\",\n                \"region\": {\n                  \"startLine\": 1,\n                  \"startColumn\": 1,\n                  \"endLine\": 1,\n                  \"endColumn\": 14\n                }\n              }\n            }\n          ],\n          \"properties\": {\n            \"warningLevel\": 1\n          }\n        },\n        {\n          \"ruleId\": \"S1234\",\n          \"level\": \"warning\",\n          \"message\": \"One issue per line\",\n          \"locations\": [\n            {\n              \"resultFile\": {\n                \"uri\": \"%BASEDIR%Bar.cs\",\n                \"region\": {\n                  \"startLine\": 2,\n                  \"startColumn\": 1,\n                  \"endLine\": 2,\n                  \"endColumn\": 34\n                }\n              }\n            }\n          ],\n          \"properties\": {\n            \"warningLevel\": 1\n          }\n        }\n      ],\n      \"rules\": {\n        \"S1234\": {\n          \"id\": \"S1234\",\n          \"shortDescription\": \"One issue per line\",\n          \"fullDescription\": \"This rule will create an issue for every source code line\",\n          \"defaultLevel\": \"warning\",\n          \"properties\": {\n            \"category\": \"Test\",\n            \"isEnabledByDefault\": true\n          }\n        }\n      }\n    }\n  ]\n}"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/TelemetryJsonSensorTest/0/Telemetry.json",
    "content": "{key1: 12}\n{key1: 42}\n{\"key2\": \"Black\"}\n{key3: true}\n{key4: 3.14}"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/TelemetryJsonSensorTest/1/Telemetry.json",
    "content": "{key1: -12}\n{key1: -42}\n{\"key2\": \"White\"}\n{key3: false}\n{key4: 1.41}\n{key5: [] }\n{key6: \"value for key6\", key7: \"value for key7\"}"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/TelemetryJsonSensorTest/Telemetry.Other.json",
    "content": "{ \"Other.key1\": \"value1\" }\n{ \"Other.key2\": # }"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/TelemetryJsonSensorTest/Telemetry.S4NET.json",
    "content": "{ \"S4NET.key1\": 1 }\n{ \"S4NET.key2\": \"Value2\" }"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/TelemetrySensorTest/0/telemetry.pb",
    "content": "\u001fR\bA.csproj\u0001\u0004TFM1\u0001\u0004TFM2\u0001\u0004CS12"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/TelemetrySensorTest/1/telemetry.pb",
    "content": "&R\bB.csproj\u0001\u0004TFM1\u0001\u0004TFM2\u0001\u0004TFM3\u0001\u0004CS12"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/TelemetrySensorTest/Readme.md",
    "content": "The files were created by the `importLogMessagesFromMultipleFile()` test.\nThe `telemetry.pb` files can be inspected by [ProtoBufViewer](https://martin-strecker-sonarsource.github.io/ProtoBufViewer/)\nwith the definition file [AnalyzerReport.proto](https://github.com/SonarSource/sonar-dotnet-enterprise/blob/master/analyzers/src/SonarAnalyzer.Core/Protobuf/AnalyzerReport.proto).\n\nThe pb files contain this content:\n\n### 0\\telemetry.pb\n\n``` \nprojectFullPath: A.csproj\ntargetFramework: TFM1\ntargetFramework: TFM2\nlanguageVersion: CS12 \n```\n\n### 1\\telemetry.pb\n\n```\nprojectFullPath: B.csproj\ntargetFramework: TFM1\ntargetFramework: TFM2\ntargetFramework: TFM3\nlanguageVersion: CS12\n```\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/analysisWarnings/AnalysisWarnings.AutoScan.json",
    "content": "[\n  {\n    \"text\": \"First message\"\n  },\n  {\n    \"text\": \"Second message\"\n  }\n]"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/analysisWarnings/AnalysisWarnings.Scanner.json",
    "content": "[\n  {\n    \"text\": \"Scanner message\"\n  }\n]"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/cobertura/absolute_path_no_sources.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<coverage line-rate=\"0\" branch-rate=\"0\" version=\"1.0\" timestamp=\"0\">\n  <packages>\n    <package name=\"Lib\" line-rate=\"0\" branch-rate=\"0\" complexity=\"0\">\n      <classes>\n        <class name=\"Lib.Class1\" filename=\"C:\\Lib\\Class1.cs\" line-rate=\"0\" branch-rate=\"0\" complexity=\"0\">\n          <lines/>\n        </class>\n      </classes>\n    </package>\n  </packages>\n</coverage>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/cobertura/absolute_path_with_sources.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<coverage line-rate=\"0\" branch-rate=\"0\" version=\"1.0\" timestamp=\"0\">\n  <sources>\n    <source>C:\\SomeOtherPath</source>\n  </sources>\n  <packages>\n    <package name=\"Lib\" line-rate=\"0\" branch-rate=\"0\" complexity=\"0\">\n      <classes>\n        <class name=\"Lib.Class1\" filename=\"C:\\Lib\\Class1.cs\" line-rate=\"0\" branch-rate=\"0\" complexity=\"0\">\n          <lines/>\n        </class>\n      </classes>\n    </package>\n  </packages>\n</coverage>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/cobertura/branch_jump_conditions.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<coverage line-rate=\"0\" branch-rate=\"0\" version=\"1.0\" timestamp=\"0\">\n  <packages>\n    <package name=\"Lib\" line-rate=\"0\" branch-rate=\"0\" complexity=\"0\">\n      <classes>\n        <class name=\"Lib.Class1\" filename=\"C:\\Lib\\Class1.cs\" line-rate=\"0\" branch-rate=\"0\" complexity=\"0\">\n          <methods>\n            <method name=\"Method1\" signature=\"void ()\" line-rate=\"0\" branch-rate=\"0\" complexity=\"1\">\n              <lines>\n                <line number=\"10\" hits=\"2\" branch=\"True\" condition-coverage=\"50% (3/6)\">\n                  <conditions>\n                    <condition number=\"24\" type=\"jump\" coverage=\"100%\" />\n                    <condition number=\"36\" type=\"jump\" coverage=\"50%\" />\n                    <condition number=\"48\" type=\"jump\" coverage=\"0%\" />\n                  </conditions>\n                </line>\n                <line number=\"11\" hits=\"1\" branch=\"False\" />\n              </lines>\n            </method>\n          </methods>\n          <lines>\n            <line number=\"10\" hits=\"2\" branch=\"True\" condition-coverage=\"50% (3/6)\">\n              <conditions>\n                <condition number=\"24\" type=\"jump\" coverage=\"100%\" />\n                <condition number=\"36\" type=\"jump\" coverage=\"50%\" />\n                <condition number=\"48\" type=\"jump\" coverage=\"0%\" />\n              </conditions>\n            </line>\n            <line number=\"11\" hits=\"1\" branch=\"False\" />\n          </lines>\n        </class>\n      </classes>\n    </package>\n  </packages>\n</coverage>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/cobertura/branch_malformed_condition_coverage.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<coverage line-rate=\"0\" branch-rate=\"0\" version=\"1.0\" timestamp=\"0\">\n  <packages>\n    <package name=\"Lib\" line-rate=\"0\" branch-rate=\"0\" complexity=\"0\">\n      <classes>\n        <class name=\"Lib.Class1\" filename=\"C:\\Lib\\Class1.cs\" line-rate=\"0\" branch-rate=\"0\" complexity=\"0\">\n          <methods />\n          <lines>\n            <line number=\"10\" hits=\"2\" branch=\"True\" condition-coverage=\"50% (1/2)\">\n              <conditions>\n                <condition number=\"24\" type=\"jump\" coverage=\"not_a_number\" />\n              </conditions>\n            </line>\n          </lines>\n        </class>\n      </classes>\n    </package>\n  </packages>\n</coverage>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/cobertura/branch_mixed_conditions.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<coverage line-rate=\"0\" branch-rate=\"0\" version=\"1.0\" timestamp=\"0\">\n  <packages>\n    <package name=\"Lib\" line-rate=\"0\" branch-rate=\"0\" complexity=\"0\">\n      <classes>\n        <!-- Case: 1 jump + 1 switch -->\n        <class name=\"Lib.Class1\" filename=\"C:\\Lib\\Class1.cs\" line-rate=\"0\" branch-rate=\"0\" complexity=\"0\">\n          <methods />\n          <lines>\n            <line number=\"10\" hits=\"3\" branch=\"True\" condition-coverage=\"50% (3/6)\">\n              <conditions>\n                <condition number=\"24\" type=\"jump\" coverage=\"100%\" />\n                <condition number=\"48\" type=\"switch\" coverage=\"25%\" />\n              </conditions>\n            </line>\n          </lines>\n        </class>\n        <!-- Case: 2 jumps + 1 switch -->\n        <class name=\"Lib.Class2\" filename=\"C:\\Lib\\Class2.cs\" line-rate=\"0\" branch-rate=\"0\" complexity=\"0\">\n          <methods />\n          <lines>\n            <line number=\"20\" hits=\"5\" branch=\"True\" condition-coverage=\"50% (5/10)\">\n              <conditions>\n                <condition number=\"0\" type=\"jump\" coverage=\"100%\" />\n                <condition number=\"1\" type=\"jump\" coverage=\"50%\" />\n                <condition number=\"2\" type=\"switch\" coverage=\"33%\" />\n              </conditions>\n            </line>\n          </lines>\n        </class>\n      </classes>\n    </package>\n  </packages>\n</coverage>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/cobertura/branch_no_condition_coverage_attr.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<coverage line-rate=\"0\" branch-rate=\"0\" version=\"1.0\" timestamp=\"0\">\n  <packages>\n    <package name=\"Lib\" line-rate=\"0\" branch-rate=\"0\" complexity=\"0\">\n      <classes>\n        <class name=\"Lib.Class1\" filename=\"C:\\Lib\\Class1.cs\" line-rate=\"0\" branch-rate=\"0\" complexity=\"0\">\n          <lines>\n            <line number=\"10\" hits=\"3\" branch=\"True\" />\n            <line number=\"11\" hits=\"1\" branch=\"False\" />\n          </lines>\n        </class>\n      </classes>\n    </package>\n  </packages>\n</coverage>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/cobertura/branch_no_conditions.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<coverage line-rate=\"0\" branch-rate=\"0\" version=\"1.0\" timestamp=\"0\">\n  <packages>\n    <package name=\"Lib\" line-rate=\"0\" branch-rate=\"0\" complexity=\"0\">\n      <classes>\n        <class name=\"Lib.Class1\" filename=\"C:\\Lib\\Class1.cs\" line-rate=\"0\" branch-rate=\"0\" complexity=\"0\">\n          <methods />\n          <lines>\n            <line number=\"42\" hits=\"2\" branch=\"True\" condition-coverage=\"50% (2/4)\" />\n            <line number=\"43\" hits=\"0\" branch=\"False\" />\n          </lines>\n        </class>\n      </classes>\n    </package>\n  </packages>\n</coverage>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/cobertura/branch_switch_condition.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<coverage line-rate=\"0\" branch-rate=\"0\" version=\"1.0\" timestamp=\"0\">\n  <packages>\n    <package name=\"Lib\" line-rate=\"0\" branch-rate=\"0\" complexity=\"0\">\n      <classes>\n        <class name=\"Lib.Class1\" filename=\"C:\\Lib\\Class1.cs\" line-rate=\"0\" branch-rate=\"0\" complexity=\"0\">\n          <methods>\n            <method name=\"Method1\" signature=\"void ()\" line-rate=\"0\" branch-rate=\"0\" complexity=\"1\">\n              <lines>\n                <line number=\"42\" hits=\"2\" branch=\"True\" condition-coverage=\"33% (2/6)\">\n                  <conditions>\n                    <condition number=\"48\" type=\"switch\" coverage=\"33%\" />\n                  </conditions>\n                </line>\n              </lines>\n            </method>\n          </methods>\n          <lines>\n            <line number=\"42\" hits=\"2\" branch=\"True\" condition-coverage=\"33% (2/6)\">\n              <conditions>\n                <condition number=\"48\" type=\"switch\" coverage=\"33%\" />\n              </conditions>\n            </line>\n          </lines>\n        </class>\n      </classes>\n    </package>\n  </packages>\n</coverage>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/cobertura/branch_unresolved_file.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<coverage line-rate=\"0\" branch-rate=\"0\" version=\"1.0\" timestamp=\"0\">\n  <packages>\n    <package name=\"Lib\" line-rate=\"0\" branch-rate=\"0\" complexity=\"0\">\n      <classes>\n        <class name=\"Lib.Class1\" filename=\"Lib\\Class1.cs\" line-rate=\"0\" branch-rate=\"0\" complexity=\"0\">\n          <lines>\n            <line number=\"10\" hits=\"3\" branch=\"True\" condition-coverage=\"50% (1/2)\">\n              <conditions>\n                <condition number=\"0\" type=\"jump\" coverage=\"50%\" />\n              </conditions>\n            </line>\n            <line number=\"11\" hits=\"1\" branch=\"False\" />\n          </lines>\n        </class>\n      </classes>\n    </package>\n  </packages>\n</coverage>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/cobertura/empty_source_tag.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<coverage line-rate=\"0\" branch-rate=\"0\" version=\"1.0\" timestamp=\"0\">\n  <sources>\n      <source/>\n  </sources>\n  <packages>\n    <package name=\"Lib\" line-rate=\"0\" branch-rate=\"0\" complexity=\"0\">\n      <classes>\n        <class name=\"Lib.Class1\" filename=\"C:\\Lib\\Class1.cs\" line-rate=\"0\" branch-rate=\"0\" complexity=\"0\">\n          <lines/>\n        </class>\n      </classes>\n    </package>\n  </packages>\n</coverage>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/cobertura/invalid_path.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<coverage line-rate=\"0\" branch-rate=\"0\" version=\"1.0\" timestamp=\"0\">\n  <packages>\n    <package name=\"Lib\" line-rate=\"0\" branch-rate=\"0\" complexity=\"0\">\n      <classes>\n        <class name=\"Lib.Class1\" filename=\"z:\\*&quot;?.cs\" line-rate=\"0\" branch-rate=\"0\" complexity=\"0\">\n          <lines/>\n        </class>\n      </classes>\n    </package>\n  </packages>\n</coverage>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/cobertura/invalid_root.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<foo />\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/cobertura/line_coverage.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<coverage line-rate=\"0\" branch-rate=\"0\" version=\"1.0\" timestamp=\"0\">\n  <packages>\n    <package name=\"Lib\" line-rate=\"0\" branch-rate=\"0\" complexity=\"0\">\n      <classes>\n        <class name=\"Lib.Class1\" filename=\"C:\\Lib\\Class1.cs\" line-rate=\"0\" branch-rate=\"0\" complexity=\"0\">\n          <methods>\n            <method name=\"Method1\" signature=\"void ()\" line-rate=\"0\" branch-rate=\"0\" complexity=\"1\">\n              <lines>\n                <line number=\"10\" hits=\"3\" branch=\"False\"/>\n                <line number=\"11\" hits=\"0\" branch=\"False\"/>\n              </lines>\n            </method>\n          </methods>\n          <lines>\n            <line number=\"10\" hits=\"3\" branch=\"False\"/>\n            <line number=\"15\" hits=\"1\" branch=\"False\"/>\n          </lines>\n        </class>\n        <class name=\"Lib.Class2\" filename=\"C:\\Lib\\Class2.cs\" line-rate=\"0\" branch-rate=\"0\" complexity=\"0\">\n          <methods>\n            <method name=\"Method1\" signature=\"void ()\" line-rate=\"0\" branch-rate=\"0\" complexity=\"1\">\n              <lines>\n                <line number=\"5\" hits=\"2\" branch=\"False\"/>\n              </lines>\n            </method>\n          </methods>\n          <lines>\n            <line number=\"5\" hits=\"1\" branch=\"False\"/>\n            <line number=\"20\" hits=\"4\" branch=\"False\"/>\n          </lines>\n        </class>\n      </classes>\n    </package>\n  </packages>\n</coverage>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/cobertura/line_coverage_unresolved_file.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<coverage line-rate=\"0\" branch-rate=\"0\" version=\"1.0\" timestamp=\"0\">\n  <packages>\n    <package name=\"Lib\" line-rate=\"0\" branch-rate=\"0\" complexity=\"0\">\n      <classes>\n        <class name=\"Lib.Class1\" filename=\"Lib\\Class1.cs\" line-rate=\"0\" branch-rate=\"0\" complexity=\"0\">\n          <lines>\n            <line number=\"10\" hits=\"3\" branch=\"False\"/>\n            <line number=\"15\" hits=\"1\" branch=\"False\"/>\n          </lines>\n        </class>\n      </classes>\n    </package>\n  </packages>\n</coverage>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/cobertura/multiple_classes_same_filename.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<coverage line-rate=\"0\" branch-rate=\"0\" version=\"1.0\" timestamp=\"0\">\n  <packages>\n    <package name=\"Lib\" line-rate=\"0\" branch-rate=\"0\" complexity=\"0\">\n      <classes>\n        <class name=\"Lib.Class1\" filename=\"C:\\Lib\\Class1.cs\" line-rate=\"0\" branch-rate=\"0\" complexity=\"0\">\n          <lines/>\n        </class>\n        <class name=\"Lib.Class1.NestedClass\" filename=\"C:\\Lib\\Class1.cs\" line-rate=\"0\" branch-rate=\"0\" complexity=\"0\">\n          <lines/>\n        </class>\n      </classes>\n    </package>\n  </packages>\n</coverage>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/cobertura/relative_path_no_sources.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<coverage line-rate=\"0\" branch-rate=\"0\" version=\"1.0\" timestamp=\"0\">\n  <packages>\n    <package name=\"Lib\" line-rate=\"0\" branch-rate=\"0\" complexity=\"0\">\n      <classes>\n        <class name=\"Lib.Class1\" filename=\"Lib\\Class1.cs\" line-rate=\"0\" branch-rate=\"0\" complexity=\"0\">\n          <lines/>\n        </class>\n      </classes>\n    </package>\n  </packages>\n</coverage>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/cobertura/relative_path_with_sources.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<coverage line-rate=\"0\" branch-rate=\"0\" version=\"1.0\" timestamp=\"0\">\n  <sources>\n    <source>C:\\FirstSource</source>\n    <source>C:\\SecondSource</source>\n  </sources>\n  <packages>\n    <package name=\"Lib\" line-rate=\"0\" branch-rate=\"0\" complexity=\"0\">\n      <classes>\n        <class name=\"Lib.Class1\" filename=\"Lib\\Class1.cs\" line-rate=\"0\" branch-rate=\"0\" complexity=\"0\">\n          <lines/>\n        </class>\n      </classes>\n    </package>\n  </packages>\n</coverage>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/cobertura/source_with_nested_elements.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<coverage line-rate=\"0\" branch-rate=\"0\" version=\"1.0\" timestamp=\"0\">\n  <sources>\n    <source><nested/>text</source>\n  </sources>\n  <packages>\n    <package name=\"Lib\" line-rate=\"0\" branch-rate=\"0\" complexity=\"0\">\n      <classes>\n        <class name=\"Lib.Class1\" filename=\"C:\\Lib\\Class1.cs\" line-rate=\"0\" branch-rate=\"0\" complexity=\"0\">\n          <lines/>\n        </class>\n      </classes>\n    </package>\n  </packages>\n</coverage>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/cobertura/valid_empty.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<coverage line-rate=\"0\" branch-rate=\"0\" version=\"1.0\" timestamp=\"0\">\n  <packages/>\n</coverage>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/dotcover/invalid_path.html",
    "content": "<!DOCTYPE html>\n<html>\n  <head>\n    <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n    <title>z:\\*\"?.cs</title>\n    <script type=\"text/javascript\" src=\"../js/dotcover.sourceview.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/dotcover.report.css\" />\n  </head>\n  <body>\n    <pre id=\"content\" class=\"source-code\">\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace MyLibrary\n{\n    public class Calc\n    {\n        public static int Add(int left, int right)\n        {\n            return left + right;\n        }\n\n        public static int Multiply(int left, int right)\n        {\n            return left * right;\n        }\n\n        public static int Divide(int left, int right)\n        {\n            if (right == 0)\n            {\n                Console.WriteLine(&quot;ERROR: Division by zero!&quot;);\n            }\n\n            return left / right;\n        }\n\n        public static void horrible_code(out int result)\n        {\n            result = 42;\n        }\n    }\n}\n\n    </pre>\n    <script type=\"text/javascript\">\n      highlightRanges([[12,9,12,10,0]]);\n    </script>\n    <script type=\"text/javascript\">\n      highlightRanges([[12,9,12,10,0],[13,13,13,33,0],[14,9,14,10,0],[22,9,22,10,0],[23,13,23,28,0],[24,13,24,14,0],[25,17,25,63,0],[26,13,26,14,0],[28,13,28,33,0],[29,9,29,10,0],[32,9,32,10,0],[33,13,33,25,0],[34,9,34,10,0],[17,9,17,10,1],[18,13,18,33,1],[19,9,19,10,1]]);\n    </script>\n  </body>\n</html>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/dotcover/no_highlight.html",
    "content": "<!DOCTYPE html>\n<html>\n  <head>\n    <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n    <title>mylibrary\\calc.cs</title>\n    <title>foo</title>\n    <script type=\"text/javascript\" src=\"../js/dotcover.sourceview.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/dotcover.report.css\" />\n  </head>\n  <body>\n    <pre id=\"content\" class=\"source-code\">\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace MyLibrary\n{\n    public class Calc\n    {\n        public static int Add(int left, int right)\n        {\n            return left + right;\n        }\n\n        public static int Multiply(int left, int right)\n        {\n            return left * right;\n        }\n\n        public static int Divide(int left, int right)\n        {\n            if (right == 0)\n            {\n                Console.WriteLine(&quot;ERROR: Division by zero!&quot;);\n            }\n\n            return left / right;\n        }\n\n        public static void horrible_code(out int result)\n        {\n            result = 42;\n        }\n    }\n}\n\n    </pre>\n    <script type=\"text/javascript\">\n      unexpected([[12,9,12,10,0]]);\n    </script>\n    <script type=\"text/javascript\">\n      unexpected([[12,9,12,10,0],[13,13,13,33,0],[14,9,14,10,0],[22,9,22,10,0],[23,13,23,28,0],[24,13,24,14,0],[25,17,25,63,0],[26,13,26,14,0],[28,13,28,33,0],[29,9,29,10,0],[32,9,32,10,0],[33,13,33,25,0],[34,9,34,10,0],[17,9,17,10,1],[18,13,18,33,1],[19,9,19,10,1]]);\n    </script>\n  </body>\n</html>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/dotcover/no_script.html",
    "content": "<!DOCTYPE html>\n<html>\n  <head>\n    <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n    <title>mylibrary\\calc.cs</title>\n    <script type=\"text/javascript\" src=\"../js/dotcover.sourceview.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/dotcover.report.css\" />\n  </head>\n  <body>\n    <pre id=\"content\" class=\"source-code\">\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace MyLibrary\n{\n    public class Calc\n    {\n        public static int Add(int left, int right)\n        {\n            return left + right;\n        }\n\n        public static int Multiply(int left, int right)\n        {\n            return left * right;\n        }\n\n        public static int Divide(int left, int right)\n        {\n            if (right == 0)\n            {\n                Console.WriteLine(&quot;ERROR: Division by zero!&quot;);\n            }\n\n            return left / right;\n        }\n\n        public static void horrible_code(out int result)\n        {\n            result = 42;\n        }\n    }\n}\n\n    </pre>\n  </body>\n</html>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/dotcover/no_title.html",
    "content": "<!DOCTYPE html>\n<html>\n  <head>\n    <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n    <script type=\"text/javascript\" src=\"../js/dotcover.sourceview.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/dotcover.report.css\" />\n  </head>\n  <body>\n    <pre id=\"content\" class=\"source-code\">\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace MyLibrary\n{\n    public class Calc\n    {\n        public static int Add(int left, int right)\n        {\n            return left + right;\n        }\n\n        public static int Multiply(int left, int right)\n        {\n            return left * right;\n        }\n\n        public static int Divide(int left, int right)\n        {\n            if (right == 0)\n            {\n                Console.WriteLine(&quot;ERROR: Division by zero!&quot;);\n            }\n\n            return left / right;\n        }\n\n        public static void horrible_code(out int result)\n        {\n            result = 42;\n        }\n    }\n}\n\n    </pre>\n    <script type=\"text/javascript\">\n      highlightRanges([[12,9,12,10,0]]);\n    </script>\n    <script type=\"text/javascript\">\n      highlightRanges([[12,9,12,10,0],[13,13,13,33,0],[14,9,14,10,0],[22,9,22,10,0],[23,13,23,28,0],[24,13,24,14,0],[25,17,25,63,0],[26,13,26,14,0],[28,13,28,33,0],[29,9,29,10,0],[32,9,32,10,0],[33,13,33,25,0],[34,9,34,10,0],[17,9,17,10,1],[18,13,18,33,1],[19,9,19,10,1]]);\n    </script>\n  </body>\n</html>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/dotcover/no_title_end.html",
    "content": "<!DOCTYPE html>\n<html>\n  <head>\n    <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n    <script type=\"text/javascript\" src=\"../js/dotcover.sourceview.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/dotcover.report.css\" />\n    <title>Missing end tag\n  </head>\n  <body>\n\n  </body>\n</html>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/dotcover/title_nested_tag.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n    <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\"/>\n    <title><title></t></ti></tit></ts></titl></titles></titlee></title<</</</</</<<</<<//</</</</</</</</</</</</</</</</</</</</</</</</</titl<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<</title>\n    <script type=\"text/javascript\" src=\"../js/dotcover.sourceview.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/dotcover.report.css\"/>\n</head>\n<body>\n<pre id=\"content\" class=\"source-code\">\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace MyLibrary\n{\n    public class Calc\n    {\n        public static int Add(int left, int right)\n        {\n            return left + right;\n        }\n\n        public static int Multiply(int left, int right)\n        {\n            return left * right;\n        }\n\n        public static int Divide(int left, int right)\n        {\n            if (right == 0)\n            {\n                Console.WriteLine(&quot;ERROR: Division by zero!&quot;);\n            }\n\n            return left / right;\n        }\n\n        public static void horrible_code(out int result)\n        {\n            result = 42;\n        }\n    }\n}\n    </pre>\n<script type=\"text/javascript\">\n      highlightRanges([[12,9,12,10,0]]);\n\n\n</script>\n<script type=\"text/javascript\">\n      highlightRanges([[12,9,12,10,0],[13,13,13,33,0],[14,9,14,10,0],[22,9,22,10,0],[23,13,23,28,0],[24,13,24,14,0],[25,17,25,63,0],[26,13,26,14,0],[28,13,28,33,0],[29,9,29,10,0],[32,9,32,10,0],[33,13,33,25,0],[34,9,34,10,0],[17,9,17,10,1],[18,13,18,33,1],[19,9,19,10,1]]);\n\n\n</script>\n</body>\n</html>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/dotcover/title_swapped.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n    <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\"/>\n    </title>foo<title>\n</head>\n<body>\n</body>\n</html>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/dotcover/valid.html",
    "content": "<!DOCTYPE html>\n<html>\n  <head>\n    <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n    <title>mylibrary\\calc.cs</title>\n    <title>foo</title>\n    <script type=\"text/javascript\" src=\"../js/dotcover.sourceview.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/dotcover.report.css\" />\n  </head>\n  <body>\n    <pre id=\"content\" class=\"source-code\">\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace MyLibrary\n{\n    public class Calc\n    {\n        public static int Add(int left, int right)\n        {\n            return left + right;\n        }\n\n        public static int Multiply(int left, int right)\n        {\n            return left * right;\n        }\n\n        public static int Divide(int left, int right)\n        {\n            if (right == 0)\n            {\n                Console.WriteLine(&quot;ERROR: Division by zero!&quot;);\n            }\n\n            return left / right;\n        }\n\n        public static void horrible_code(out int result)\n        {\n            result = 42;\n        }\n    }\n}\n\n    </pre>\n    <script type=\"text/javascript\">\n      highlightRanges([[12,9,12,10,0]]);\n    </script>\n    <script type=\"text/javascript\">\n      highlightRanges([[12,9,12,10,0],[13,13,13,33,0],[14,9,14,10,0],[22,9,22,10,0],[23,13,23,28,0],[24,13,24,14,0],[25,17,25,63,0],[26,13,26,14,0],[28,13,28,33,0],[29,9,29,10,0],[32,9,32,10,0],[33,13,33,25,0],[34,9,34,10,0],[17,9,17,10,1],[18,13,18,33,1],[19,9,19,10,1]]);\n    </script>\n  </body>\n</html>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/dotcover/valid_big.html",
    "content": "<!DOCTYPE html>\n<html>\n  <head>\n    <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n    <title>mylibrary\\calc.cs</title>\n    <title>foo</title>\n    <script type=\"text/javascript\" src=\"../js/dotcover.sourceview.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/dotcover.report.css\" />\n  </head>\n  <body>\n    <pre id=\"content\" class=\"source-code\">\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace MyLibrary\n{\n    public class Calc\n    {\n        public static int Add10000(int value)\n        {\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            value = value + 1;\n            return value;\n        }\n    }\n}\n    </pre>\n    <script type=\"text/javascript\">\n      highlightRanges([[24,13,24,30,1],[25,13,25,30,1],[26,13,26,30,1],[27,13,27,30,1],[28,13,28,30,1],[29,13,29,30,1],[30,13,30,30,1],[31,13,31,30,1],[32,13,32,30,1],[33,13,33,30,1],[34,13,34,30,1],[35,13,35,30,1],[36,13,36,30,1],[37,13,37,30,1],[38,13,38,30,1],[39,13,39,30,1],[40,13,40,30,1],[41,13,41,30,1],[42,13,42,30,1],[43,13,43,30,1],[44,13,44,30,1],[45,13,45,30,1],[46,13,46,30,1],[47,13,47,30,1],[48,13,48,30,1],[49,13,49,30,1],[50,13,50,30,1],[51,13,51,30,1],[52,13,52,30,1],[53,13,53,30,1],[54,13,54,30,1],[55,13,55,30,1],[56,13,56,30,1],[57,13,57,30,1],[58,13,58,30,1],[59,13,59,30,1],[60,13,60,30,1],[61,13,61,30,1],[62,13,62,30,1],[63,13,63,30,1],[64,13,64,30,1],[65,13,65,30,1],[66,13,66,30,1],[67,13,67,30,1],[68,13,68,30,1],[69,13,69,30,1],[70,13,70,30,1],[71,13,71,30,1],[72,13,72,30,1],[73,13,73,30,1],[74,13,74,30,1],[75,13,75,30,1],[76,13,76,30,1],[77,13,77,30,1],[78,13,78,30,1],[79,13,79,30,1],[80,13,80,30,1],[81,13,81,30,1],[82,13,82,30,1],[83,13,83,30,1],[84,13,84,30,1],[85,13,85,30,1],[86,13,86,30,1],[87,13,87,30,1],[88,13,88,30,1],[89,13,89,30,1],[90,13,90,30,1],[91,13,91,30,1],[92,13,92,30,1],[93,13,93,30,1],[94,13,94,30,1],[95,13,95,30,1],[96,13,96,30,1],[97,13,97,30,1],[98,13,98,30,1],[99,13,99,30,1],[100,13,100,30,1],[101,13,101,30,1],[102,13,102,30,1],[103,13,103,30,1],[104,13,104,30,1],[105,13,105,30,1],[106,13,106,30,1],[107,13,107,30,1],[108,13,108,30,1],[109,13,109,30,1],[110,13,110,30,1],[111,13,111,30,1],[112,13,112,30,1],[113,13,113,30,1],[114,13,114,30,1],[115,13,115,30,1],[116,13,116,30,1],[117,13,117,30,1],[118,13,118,30,1],[119,13,119,30,1],[120,13,120,30,1],[121,13,121,30,1],[122,13,122,30,1],[123,13,123,30,1],[124,13,124,30,1],[125,13,125,30,1],[126,13,126,30,1],[127,13,127,30,1],[128,13,128,30,1],[129,13,129,30,1],[130,13,130,30,1],[131,13,131,30,1],[132,13,132,30,1],[133,13,133,30,1],[134,13,134,30,1],[135,13,135,30,1],[136,13,136,30,1],[137,13,137,30,1],[138,13,138,30,1],[139,13,139,30,1],[140,13,140,30,1],[141,13,141,30,1],[142,13,142,30,1],[143,13,143,30,1],[144,13,144,30,1],[145,13,145,30,1],[146,13,146,30,1],[147,13,147,30,1],[148,13,148,30,1],[149,13,149,30,1],[150,13,150,30,1],[151,13,151,30,1],[152,13,152,30,1],[153,13,153,30,1],[154,13,154,30,1],[155,13,155,30,1],[156,13,156,30,1],[157,13,157,30,1],[158,13,158,30,1],[159,13,159,30,1],[160,13,160,30,1],[161,13,161,30,1],[162,13,162,30,1],[163,13,163,30,1],[164,13,164,30,1],[165,13,165,30,1],[166,13,166,30,1],[167,13,167,30,1],[168,13,168,30,1],[169,13,169,30,1],[170,13,170,30,1],[171,13,171,30,1],[172,13,172,30,1],[173,13,173,30,1],[174,13,174,30,1],[175,13,175,30,1],[176,13,176,30,1],[177,13,177,30,1],[178,13,178,30,1],[179,13,179,30,1],[180,13,180,30,1],[181,13,181,30,1],[182,13,182,30,1],[183,13,183,30,1],[184,13,184,30,1],[185,13,185,30,1],[186,13,186,30,1],[187,13,187,30,1],[188,13,188,30,1],[189,13,189,30,1],[190,13,190,30,1],[191,13,191,30,1],[192,13,192,30,1],[193,13,193,30,1],[194,13,194,30,1],[195,13,195,30,1],[196,13,196,30,1],[197,13,197,30,1],[198,13,198,30,1],[199,13,199,30,1],[200,13,200,30,1],[201,13,201,30,1],[202,13,202,30,1],[203,13,203,30,1],[204,13,204,30,1],[205,13,205,30,1],[206,13,206,30,1],[207,13,207,30,1],[208,13,208,30,1],[209,13,209,30,1],[210,13,210,30,1],[211,13,211,30,1],[212,13,212,30,1],[213,13,213,30,1],[214,13,214,30,1],[215,13,215,30,1],[216,13,216,30,1],[217,13,217,30,1],[218,13,218,30,1],[219,13,219,30,1],[220,13,220,30,1],[221,13,221,30,1],[222,13,222,30,1],[223,13,223,30,1],[224,13,224,30,1],[225,13,225,30,1],[226,13,226,30,1],[227,13,227,30,1],[228,13,228,30,1],[229,13,229,30,1],[230,13,230,30,1],[231,13,231,30,1],[232,13,232,30,1],[233,13,233,30,1],[234,13,234,30,1],[235,13,235,30,1],[236,13,236,30,1],[237,13,237,30,1],[238,13,238,30,1],[239,13,239,30,1],[240,13,240,30,1],[241,13,241,30,1],[242,13,242,30,1],[243,13,243,30,1],[244,13,244,30,1],[245,13,245,30,1],[246,13,246,30,1],[247,13,247,30,1],[248,13,248,30,1],[249,13,249,30,1],[250,13,250,30,1],[251,13,251,30,1],[252,13,252,30,1],[253,13,253,30,1],[254,13,254,30,1],[255,13,255,30,1],[256,13,256,30,1],[257,13,257,30,1],[258,13,258,30,1],[259,13,259,30,1],[260,13,260,30,1],[261,13,261,30,1],[262,13,262,30,1],[263,13,263,30,1],[264,13,264,30,1],[265,13,265,30,1],[266,13,266,30,1],[267,13,267,30,1],[268,13,268,30,1],[269,13,269,30,1],[270,13,270,30,1],[271,13,271,30,1],[272,13,272,30,1],[273,13,273,30,1],[274,13,274,30,1],[275,13,275,30,1],[276,13,276,30,1],[277,13,277,30,1],[278,13,278,30,1],[279,13,279,30,1],[280,13,280,30,1],[281,13,281,30,1],[282,13,282,30,1],[283,13,283,30,1],[284,13,284,30,1],[285,13,285,30,1],[286,13,286,30,1],[287,13,287,30,1],[288,13,288,30,1],[289,13,289,30,1],[290,13,290,30,1],[291,13,291,30,1],[292,13,292,30,1],[293,13,293,30,1],[294,13,294,30,1],[295,13,295,30,1],[296,13,296,30,1],[297,13,297,30,1],[298,13,298,30,1],[299,13,299,30,1],[300,13,300,30,1],[301,13,301,30,1],[302,13,302,30,1],[303,13,303,30,1],[304,13,304,30,1],[305,13,305,30,1],[306,13,306,30,1],[307,13,307,30,1],[308,13,308,30,1],[309,13,309,30,1],[310,13,310,30,1],[311,13,311,30,1],[312,13,312,30,1],[313,13,313,30,1],[314,13,314,30,1],[315,13,315,30,1],[316,13,316,30,1],[317,13,317,30,1],[318,13,318,30,1],[319,13,319,30,1],[320,13,320,30,1],[321,13,321,30,1],[322,13,322,30,1],[323,13,323,30,1],[324,13,324,30,1],[325,13,325,30,1],[326,13,326,30,1],[327,13,327,30,1],[328,13,328,30,1],[329,13,329,30,1],[330,13,330,30,1],[331,13,331,30,1],[332,13,332,30,1],[333,13,333,30,1],[334,13,334,30,1],[335,13,335,30,1],[336,13,336,30,1],[337,13,337,30,1],[338,13,338,30,1],[339,13,339,30,1],[340,13,340,30,1],[341,13,341,30,1],[342,13,342,30,1],[343,13,343,30,1],[344,13,344,30,1],[345,13,345,30,1],[346,13,346,30,1],[347,13,347,30,1],[348,13,348,30,1],[349,13,349,30,1],[350,13,350,30,1],[351,13,351,30,1],[352,13,352,30,1],[353,13,353,30,1],[354,13,354,30,1],[355,13,355,30,1],[356,13,356,30,1],[357,13,357,30,1],[358,13,358,30,1],[359,13,359,30,1],[360,13,360,30,1],[361,13,361,30,1],[362,13,362,30,1],[363,13,363,30,1],[364,13,364,30,1],[365,13,365,30,1],[366,13,366,30,1],[367,13,367,30,1],[368,13,368,30,1],[369,13,369,30,1],[370,13,370,30,1],[371,13,371,30,1],[372,13,372,30,1],[373,13,373,30,1],[374,13,374,30,1],[375,13,375,30,1],[376,13,376,30,1],[377,13,377,30,1],[378,13,378,30,1],[379,13,379,30,1],[380,13,380,30,1],[381,13,381,30,1],[382,13,382,30,1],[383,13,383,30,1],[384,13,384,30,1],[385,13,385,30,1],[386,13,386,30,1],[387,13,387,30,1],[388,13,388,30,1],[389,13,389,30,1],[390,13,390,30,1],[391,13,391,30,1],[392,13,392,30,1],[393,13,393,30,1],[394,13,394,30,1],[395,13,395,30,1],[396,13,396,30,1],[397,13,397,30,1],[398,13,398,30,1],[399,13,399,30,1],[400,13,400,30,1],[401,13,401,30,1],[402,13,402,30,1],[403,13,403,30,1],[404,13,404,30,1],[405,13,405,30,1],[406,13,406,30,1],[407,13,407,30,1],[408,13,408,30,1],[409,13,409,30,1],[410,13,410,30,1],[411,13,411,30,1],[412,13,412,30,1],[413,13,413,30,1],[414,13,414,30,1],[415,13,415,30,1],[416,13,416,30,1],[417,13,417,30,1],[418,13,418,30,1],[419,13,419,30,1],[420,13,420,30,1],[421,13,421,30,1],[422,13,422,30,1],[423,13,423,30,1],[424,13,424,30,1],[425,13,425,30,1],[426,13,426,30,1],[427,13,427,30,1],[428,13,428,30,1],[429,13,429,30,1],[430,13,430,30,1],[431,13,431,30,1],[432,13,432,30,1],[433,13,433,30,1],[434,13,434,30,1],[435,13,435,30,1],[436,13,436,30,1],[437,13,437,30,1],[438,13,438,30,1],[439,13,439,30,1],[440,13,440,30,1],[441,13,441,30,1],[442,13,442,30,1],[443,13,443,30,1],[444,13,444,30,1],[445,13,445,30,1],[446,13,446,30,1],[447,13,447,30,1],[448,13,448,30,1],[449,13,449,30,1],[450,13,450,30,1],[451,13,451,30,1],[452,13,452,30,1],[453,13,453,30,1],[454,13,454,30,1],[455,13,455,30,1],[456,13,456,30,1],[457,13,457,30,1],[458,13,458,30,1],[459,13,459,30,1],[460,13,460,30,1],[461,13,461,30,1],[462,13,462,30,1],[463,13,463,30,1],[464,13,464,30,1],[465,13,465,30,1],[466,13,466,30,1],[467,13,467,30,1],[468,13,468,30,1],[469,13,469,30,1],[470,13,470,30,1],[471,13,471,30,1],[472,13,472,30,1],[473,13,473,30,1],[474,13,474,30,1],[475,13,475,30,1],[476,13,476,30,1],[477,13,477,30,1],[478,13,478,30,1],[479,13,479,30,1],[480,13,480,30,1],[481,13,481,30,1],[482,13,482,30,1],[483,13,483,30,1],[484,13,484,30,1],[485,13,485,30,1],[486,13,486,30,1],[487,13,487,30,1],[488,13,488,30,1],[489,13,489,30,1],[490,13,490,30,1],[491,13,491,30,1],[492,13,492,30,1],[493,13,493,30,1],[494,13,494,30,1],[495,13,495,30,1],[496,13,496,30,1],[497,13,497,30,1],[498,13,498,30,1],[499,13,499,30,1],[500,13,500,30,1],[501,13,501,30,1],[502,13,502,30,1],[503,13,503,30,1],[504,13,504,30,1],[505,13,505,30,1],[506,13,506,30,1],[507,13,507,30,1],[508,13,508,30,1],[509,13,509,30,1],[510,13,510,30,1],[511,13,511,30,1],[512,13,512,30,1],[513,13,513,30,1],[514,13,514,30,1],[515,13,515,30,1],[516,13,516,30,1],[517,13,517,30,1],[518,13,518,30,1],[519,13,519,30,1],[520,13,520,30,1],[521,13,521,30,1],[522,13,522,30,1],[523,13,523,30,1],[524,13,524,30,1],[525,13,525,30,1],[526,13,526,30,1],[527,13,527,30,1],[528,13,528,30,1],[529,13,529,30,1],[530,13,530,30,1],[531,13,531,30,1],[532,13,532,30,1],[533,13,533,30,1],[534,13,534,30,1],[535,13,535,30,1],[536,13,536,30,1],[537,13,537,30,1],[538,13,538,30,1],[539,13,539,30,1],[540,13,540,30,1],[541,13,541,30,1],[542,13,542,30,1],[543,13,543,30,1],[544,13,544,30,1],[545,13,545,30,1],[546,13,546,30,1],[547,13,547,30,1],[548,13,548,30,1],[549,13,549,30,1],[550,13,550,30,1],[551,13,551,30,1],[552,13,552,30,1],[553,13,553,30,1],[554,13,554,30,1],[555,13,555,30,1],[556,13,556,30,1],[557,13,557,30,1],[558,13,558,30,1],[559,13,559,30,1],[560,13,560,30,1],[561,13,561,30,1],[562,13,562,30,1],[563,13,563,30,1],[564,13,564,30,1],[565,13,565,30,1],[566,13,566,30,1],[567,13,567,30,1],[568,13,568,30,1],[569,13,569,30,1],[570,13,570,30,1],[571,13,571,30,1],[572,13,572,30,1],[573,13,573,30,1],[574,13,574,30,1],[575,13,575,30,1],[576,13,576,30,1],[577,13,577,30,1],[578,13,578,30,1],[579,13,579,30,1],[580,13,580,30,1],[581,13,581,30,1],[582,13,582,30,1],[583,13,583,30,1],[584,13,584,30,1],[585,13,585,30,1],[586,13,586,30,1],[587,13,587,30,1],[588,13,588,30,1],[589,13,589,30,1],[590,13,590,30,1],[591,13,591,30,1],[592,13,592,30,1],[593,13,593,30,1],[594,13,594,30,1],[595,13,595,30,1],[596,13,596,30,1],[597,13,597,30,1],[598,13,598,30,1],[599,13,599,30,1],[600,13,600,30,1],[601,13,601,30,1],[602,13,602,30,1],[603,13,603,30,1],[604,13,604,30,1],[605,13,605,30,1],[606,13,606,30,1],[607,13,607,30,1],[608,13,608,30,1],[609,13,609,30,1],[610,13,610,30,1],[611,13,611,30,1],[612,13,612,30,1],[613,13,613,30,1],[614,13,614,30,1],[615,13,615,30,1],[616,13,616,30,1],[617,13,617,30,1],[618,13,618,30,1],[619,13,619,30,1],[620,13,620,30,1],[621,13,621,30,1],[622,13,622,30,1],[623,13,623,30,1],[624,13,624,30,1],[625,13,625,30,1],[626,13,626,30,1],[627,13,627,30,1],[628,13,628,30,1],[629,13,629,30,1],[630,13,630,30,1],[631,13,631,30,1],[632,13,632,30,1],[633,13,633,30,1],[634,13,634,30,1],[635,13,635,30,1],[636,13,636,30,1],[637,13,637,30,1],[638,13,638,30,1],[639,13,639,30,1],[640,13,640,30,1],[641,13,641,30,1],[642,13,642,30,1],[643,13,643,30,1],[644,13,644,30,1],[645,13,645,30,1],[646,13,646,30,1],[647,13,647,30,1],[648,13,648,30,1],[649,13,649,30,1],[650,13,650,30,1],[651,13,651,30,1],[652,13,652,30,1],[653,13,653,30,1],[654,13,654,30,1],[655,13,655,30,1],[656,13,656,30,1],[657,13,657,30,1],[658,13,658,30,1],[659,13,659,30,1],[660,13,660,30,1],[661,13,661,30,1],[662,13,662,30,1],[663,13,663,30,1],[664,13,664,30,1],[665,13,665,30,1],[666,13,666,30,1],[667,13,667,30,1],[668,13,668,30,1],[669,13,669,30,1],[670,13,670,30,1],[671,13,671,30,1],[672,13,672,30,1],[673,13,673,30,1],[674,13,674,30,1],[675,13,675,30,1],[676,13,676,30,1],[677,13,677,30,1],[678,13,678,30,1],[679,13,679,30,1],[680,13,680,30,1],[681,13,681,30,1],[682,13,682,30,1],[683,13,683,30,1],[684,13,684,30,1],[685,13,685,30,1],[686,13,686,30,1],[687,13,687,30,1],[688,13,688,30,1],[689,13,689,30,1],[690,13,690,30,1],[691,13,691,30,1],[692,13,692,30,1],[693,13,693,30,1],[694,13,694,30,1],[695,13,695,30,1],[696,13,696,30,1],[697,13,697,30,1],[698,13,698,30,1],[699,13,699,30,1],[700,13,700,30,1],[701,13,701,30,1],[702,13,702,30,1],[703,13,703,30,1],[704,13,704,30,1],[705,13,705,30,1],[706,13,706,30,1],[707,13,707,30,1],[708,13,708,30,1],[709,13,709,30,1],[710,13,710,30,1],[711,13,711,30,1],[712,13,712,30,1],[713,13,713,30,1],[714,13,714,30,1],[715,13,715,30,1],[716,13,716,30,1],[717,13,717,30,1],[718,13,718,30,1],[719,13,719,30,1],[720,13,720,30,1],[721,13,721,30,1],[722,13,722,30,1],[723,13,723,30,1],[724,13,724,30,1],[725,13,725,30,1],[726,13,726,30,1],[727,13,727,30,1],[728,13,728,30,1],[729,13,729,30,1],[730,13,730,30,1],[731,13,731,30,1],[732,13,732,30,1],[733,13,733,30,1],[734,13,734,30,1],[735,13,735,30,1],[736,13,736,30,1],[737,13,737,30,1],[738,13,738,30,1],[739,13,739,30,1],[740,13,740,30,1],[741,13,741,30,1],[742,13,742,30,1],[743,13,743,30,1],[744,13,744,30,1],[745,13,745,30,1],[746,13,746,30,1],[747,13,747,30,1],[748,13,748,30,1],[749,13,749,30,1],[750,13,750,30,1],[751,13,751,30,1],[752,13,752,30,1],[753,13,753,30,1],[754,13,754,30,1],[755,13,755,30,1],[756,13,756,30,1],[757,13,757,30,1],[758,13,758,30,1],[759,13,759,30,1],[760,13,760,30,1],[761,13,761,30,1],[762,13,762,30,1],[763,13,763,30,1],[764,13,764,30,1],[765,13,765,30,1],[766,13,766,30,1],[767,13,767,30,1],[768,13,768,30,1],[769,13,769,30,1],[770,13,770,30,1],[771,13,771,30,1],[772,13,772,30,1],[773,13,773,30,1],[774,13,774,30,1],[775,13,775,30,1],[776,13,776,30,1],[777,13,777,30,1],[778,13,778,30,1],[779,13,779,30,1],[780,13,780,30,1],[781,13,781,30,1],[782,13,782,30,1],[783,13,783,30,1],[784,13,784,30,1],[785,13,785,30,1],[786,13,786,30,1],[787,13,787,30,1],[788,13,788,30,1],[789,13,789,30,1],[790,13,790,30,1],[791,13,791,30,1],[792,13,792,30,1],[793,13,793,30,1],[794,13,794,30,1],[795,13,795,30,1],[796,13,796,30,1],[797,13,797,30,1],[798,13,798,30,1],[799,13,799,30,1],[800,13,800,30,1],[801,13,801,30,1],[802,13,802,30,1],[803,13,803,30,1],[804,13,804,30,1],[805,13,805,30,1],[806,13,806,30,1],[807,13,807,30,1],[808,13,808,30,1],[809,13,809,30,1],[810,13,810,30,1],[811,13,811,30,1],[812,13,812,30,1],[813,13,813,30,1],[814,13,814,30,1],[815,13,815,30,1],[816,13,816,30,1],[817,13,817,30,1],[818,13,818,30,1],[819,13,819,30,1],[820,13,820,30,1],[821,13,821,30,1],[822,13,822,30,1],[823,13,823,30,1],[824,13,824,30,1],[825,13,825,30,1],[826,13,826,30,1],[827,13,827,30,1],[828,13,828,30,1],[829,13,829,30,1],[830,13,830,30,1],[831,13,831,30,1],[832,13,832,30,1],[833,13,833,30,1],[834,13,834,30,1],[835,13,835,30,1],[836,13,836,30,1],[837,13,837,30,1],[838,13,838,30,1],[839,13,839,30,1],[840,13,840,30,1],[841,13,841,30,1],[842,13,842,30,1],[843,13,843,30,1],[844,13,844,30,1],[845,13,845,30,1],[846,13,846,30,1],[847,13,847,30,1],[848,13,848,30,1],[849,13,849,30,1],[850,13,850,30,1],[851,13,851,30,1],[852,13,852,30,1],[853,13,853,30,1],[854,13,854,30,1],[855,13,855,30,1],[856,13,856,30,1],[857,13,857,30,1],[858,13,858,30,1],[859,13,859,30,1],[860,13,860,30,1],[861,13,861,30,1],[862,13,862,30,1],[863,13,863,30,1],[864,13,864,30,1],[865,13,865,30,1],[866,13,866,30,1],[867,13,867,30,1],[868,13,868,30,1],[869,13,869,30,1],[870,13,870,30,1],[871,13,871,30,1],[872,13,872,30,1],[873,13,873,30,1],[874,13,874,30,1],[875,13,875,30,1],[876,13,876,30,1],[877,13,877,30,1],[878,13,878,30,1],[879,13,879,30,1],[880,13,880,30,1],[881,13,881,30,1],[882,13,882,30,1],[883,13,883,30,1],[884,13,884,30,1],[885,13,885,30,1],[886,13,886,30,1],[887,13,887,30,1],[888,13,888,30,1],[889,13,889,30,1],[890,13,890,30,1],[891,13,891,30,1],[892,13,892,30,1],[893,13,893,30,1],[894,13,894,30,1],[895,13,895,30,1],[896,13,896,30,1],[897,13,897,30,1],[898,13,898,30,1],[899,13,899,30,1],[900,13,900,30,1],[901,13,901,30,1],[902,13,902,30,1],[903,13,903,30,1],[904,13,904,30,1],[905,13,905,30,1],[906,13,906,30,1],[907,13,907,30,1],[908,13,908,30,1],[909,13,909,30,1],[910,13,910,30,1],[911,13,911,30,1],[912,13,912,30,1],[913,13,913,30,1],[914,13,914,30,1],[915,13,915,30,1],[916,13,916,30,1],[917,13,917,30,1],[918,13,918,30,1],[919,13,919,30,1],[920,13,920,30,1],[921,13,921,30,1],[922,13,922,30,1],[923,13,923,30,1],[924,13,924,30,1],[925,13,925,30,1],[926,13,926,30,1],[927,13,927,30,1],[928,13,928,30,1],[929,13,929,30,1],[930,13,930,30,1],[931,13,931,30,1],[932,13,932,30,1],[933,13,933,30,1],[934,13,934,30,1],[935,13,935,30,1],[936,13,936,30,1],[937,13,937,30,1],[938,13,938,30,1],[939,13,939,30,1],[940,13,940,30,1],[941,13,941,30,1],[942,13,942,30,1],[943,13,943,30,1],[944,13,944,30,1],[945,13,945,30,1],[946,13,946,30,1],[947,13,947,30,1],[948,13,948,30,1],[949,13,949,30,1],[950,13,950,30,1],[951,13,951,30,1],[952,13,952,30,1],[953,13,953,30,1],[954,13,954,30,1],[955,13,955,30,1],[956,13,956,30,1],[957,13,957,30,1],[958,13,958,30,1],[959,13,959,30,1],[960,13,960,30,1],[961,13,961,30,1],[962,13,962,30,1],[963,13,963,30,1],[964,13,964,30,1],[965,13,965,30,1],[966,13,966,30,1],[967,13,967,30,1],[968,13,968,30,1],[969,13,969,30,1],[970,13,970,30,1],[971,13,971,30,1],[972,13,972,30,1],[973,13,973,30,1],[974,13,974,30,1],[975,13,975,30,1],[976,13,976,30,1],[977,13,977,30,1],[978,13,978,30,1],[979,13,979,30,1],[980,13,980,30,1],[981,13,981,30,1],[982,13,982,30,1],[983,13,983,30,1],[984,13,984,30,1],[985,13,985,30,1],[986,13,986,30,1],[987,13,987,30,1],[988,13,988,30,1],[989,13,989,30,1],[990,13,990,30,1],[991,13,991,30,1],[992,13,992,30,1],[993,13,993,30,1],[994,13,994,30,1],[995,13,995,30,1],[996,13,996,30,1],[997,13,997,30,1],[998,13,998,30,1],[999,13,999,30,1],[1000,13,1000,30,1],[1001,13,1001,30,1],[1002,13,1002,30,1],[1003,13,1003,30,1],[1004,13,1004,30,1],[1005,13,1005,30,1],[1006,13,1006,30,1],[1007,13,1007,30,1],[1008,13,1008,30,1],[1009,13,1009,30,1],[1010,13,1010,30,1],[1011,13,1011,30,1],[1012,13,1012,30,1],[1013,13,1013,30,1],[1014,13,1014,30,1],[1015,13,1015,30,1],[1016,13,1016,30,1],[1017,13,1017,30,1],[1018,13,1018,30,1],[1019,13,1019,30,1],[1020,13,1020,30,1],[1021,13,1021,30,1],[1022,13,1022,30,1],[1023,13,1023,30,1],[1024,13,1024,30,1],[1025,13,1025,30,1],[1026,13,1026,30,1],[1027,13,1027,30,1],[1028,13,1028,30,1],[1029,13,1029,30,1],[1030,13,1030,30,1],[1031,13,1031,30,1],[1032,13,1032,30,1],[1033,13,1033,30,1],[1034,13,1034,30,1],[1035,13,1035,30,1],[1036,13,1036,30,1],[1037,13,1037,30,1],[1038,13,1038,30,1],[1039,13,1039,30,1],[1040,13,1040,30,1],[1041,13,1041,30,1],[1042,13,1042,30,1],[1043,13,1043,30,1],[1044,13,1044,30,1],[1045,13,1045,30,1],[1046,13,1046,30,1],[1047,13,1047,30,1],[1048,13,1048,30,1],[1049,13,1049,30,1],[1050,13,1050,30,1],[1051,13,1051,30,1],[1052,13,1052,30,1],[1053,13,1053,30,1],[1054,13,1054,30,1],[1055,13,1055,30,1],[1056,13,1056,30,1],[1057,13,1057,30,1],[1058,13,1058,30,1],[1059,13,1059,30,1],[1060,13,1060,30,1],[1061,13,1061,30,1],[1062,13,1062,30,1],[1063,13,1063,30,1],[1064,13,1064,30,1],[1065,13,1065,30,1],[1066,13,1066,30,1],[1067,13,1067,30,1],[1068,13,1068,30,1],[1069,13,1069,30,1],[1070,13,1070,30,1],[1071,13,1071,30,1],[1072,13,1072,30,1],[1073,13,1073,30,1],[1074,13,1074,30,1],[1075,13,1075,30,1],[1076,13,1076,30,1],[1077,13,1077,30,1],[1078,13,1078,30,1],[1079,13,1079,30,1],[1080,13,1080,30,1],[1081,13,1081,30,1],[1082,13,1082,30,1],[1083,13,1083,30,1],[1084,13,1084,30,1],[1085,13,1085,30,1],[1086,13,1086,30,1],[1087,13,1087,30,1],[1088,13,1088,30,1],[1089,13,1089,30,1],[1090,13,1090,30,1],[1091,13,1091,30,1],[1092,13,1092,30,1],[1093,13,1093,30,1],[1094,13,1094,30,1],[1095,13,1095,30,1],[1096,13,1096,30,1],[1097,13,1097,30,1],[1098,13,1098,30,1],[1099,13,1099,30,1],[1100,13,1100,30,1],[1101,13,1101,30,1],[1102,13,1102,30,1],[1103,13,1103,30,1],[1104,13,1104,30,1],[1105,13,1105,30,1],[1106,13,1106,30,1],[1107,13,1107,30,1],[1108,13,1108,30,1],[1109,13,1109,30,1],[1110,13,1110,30,1],[1111,13,1111,30,1],[1112,13,1112,30,1],[1113,13,1113,30,1],[1114,13,1114,30,1],[1115,13,1115,30,1],[1116,13,1116,30,1],[1117,13,1117,30,1],[1118,13,1118,30,1],[1119,13,1119,30,1],[1120,13,1120,30,1],[1121,13,1121,30,1],[1122,13,1122,30,1],[1123,13,1123,30,1],[1124,13,1124,30,1],[1125,13,1125,30,1],[1126,13,1126,30,1],[1127,13,1127,30,1],[1128,13,1128,30,1],[1129,13,1129,30,1],[1130,13,1130,30,1],[1131,13,1131,30,1],[1132,13,1132,30,1],[1133,13,1133,30,1],[1134,13,1134,30,1],[1135,13,1135,30,1],[1136,13,1136,30,1],[1137,13,1137,30,1],[1138,13,1138,30,1],[1139,13,1139,30,1],[1140,13,1140,30,1],[1141,13,1141,30,1],[1142,13,1142,30,1],[1143,13,1143,30,1],[1144,13,1144,30,1],[1145,13,1145,30,1],[1146,13,1146,30,1],[1147,13,1147,30,1],[1148,13,1148,30,1],[1149,13,1149,30,1],[1150,13,1150,30,1],[1151,13,1151,30,1],[1152,13,1152,30,1],[1153,13,1153,30,1],[1154,13,1154,30,1],[1155,13,1155,30,1],[1156,13,1156,30,1],[1157,13,1157,30,1],[1158,13,1158,30,1],[1159,13,1159,30,1],[1160,13,1160,30,1],[1161,13,1161,30,1],[1162,13,1162,30,1],[1163,13,1163,30,1],[1164,13,1164,30,1],[1165,13,1165,30,1],[1166,13,1166,30,1],[1167,13,1167,30,1],[1168,13,1168,30,1],[1169,13,1169,30,1],[1170,13,1170,30,1],[1171,13,1171,30,1],[1172,13,1172,30,1],[1173,13,1173,30,1],[1174,13,1174,30,1],[1175,13,1175,30,1],[1176,13,1176,30,1],[1177,13,1177,30,1],[1178,13,1178,30,1],[1179,13,1179,30,1],[1180,13,1180,30,1],[1181,13,1181,30,1],[1182,13,1182,30,1],[1183,13,1183,30,1],[1184,13,1184,30,1],[1185,13,1185,30,1],[1186,13,1186,30,1],[1187,13,1187,30,1],[1188,13,1188,30,1],[1189,13,1189,30,1],[1190,13,1190,30,1],[1191,13,1191,30,1],[1192,13,1192,30,1],[1193,13,1193,30,1],[1194,13,1194,30,1],[1195,13,1195,30,1],[1196,13,1196,30,1],[1197,13,1197,30,1],[1198,13,1198,30,1],[1199,13,1199,30,1],[1200,13,1200,30,1],[1201,13,1201,30,1],[1202,13,1202,30,1],[1203,13,1203,30,1],[1204,13,1204,30,1],[1205,13,1205,30,1],[1206,13,1206,30,1],[1207,13,1207,30,1],[1208,13,1208,30,1],[1209,13,1209,30,1],[1210,13,1210,30,1],[1211,13,1211,30,1],[1212,13,1212,30,1],[1213,13,1213,30,1],[1214,13,1214,30,1],[1215,13,1215,30,1],[1216,13,1216,30,1],[1217,13,1217,30,1],[1218,13,1218,30,1],[1219,13,1219,30,1],[1220,13,1220,30,1],[1221,13,1221,30,1],[1222,13,1222,30,1],[1223,13,1223,30,1],[1224,13,1224,30,1],[1225,13,1225,30,1],[1226,13,1226,30,1],[1227,13,1227,30,1],[1228,13,1228,30,1],[1229,13,1229,30,1],[1230,13,1230,30,1],[1231,13,1231,30,1],[1232,13,1232,30,1],[1233,13,1233,30,1],[1234,13,1234,30,1],[1235,13,1235,30,1],[1236,13,1236,30,1],[1237,13,1237,30,1],[1238,13,1238,30,1],[1239,13,1239,30,1],[1240,13,1240,30,1],[1241,13,1241,30,1],[1242,13,1242,30,1],[1243,13,1243,30,1],[1244,13,1244,30,1],[1245,13,1245,30,1],[1246,13,1246,30,1],[1247,13,1247,30,1],[1248,13,1248,30,1],[1249,13,1249,30,1],[1250,13,1250,30,1],[1251,13,1251,30,1],[1252,13,1252,30,1],[1253,13,1253,30,1],[1254,13,1254,30,1],[1255,13,1255,30,1],[1256,13,1256,30,1],[1257,13,1257,30,1],[1258,13,1258,30,1],[1259,13,1259,30,1],[1260,13,1260,30,1],[1261,13,1261,30,1],[1262,13,1262,30,1],[1263,13,1263,30,1],[1264,13,1264,30,1],[1265,13,1265,30,1],[1266,13,1266,30,1],[1267,13,1267,30,1],[1268,13,1268,30,1],[1269,13,1269,30,1],[1270,13,1270,30,1],[1271,13,1271,30,1],[1272,13,1272,30,1],[1273,13,1273,30,1],[1274,13,1274,30,1],[1275,13,1275,30,1],[1276,13,1276,30,1],[1277,13,1277,30,1],[1278,13,1278,30,1],[1279,13,1279,30,1],[1280,13,1280,30,1],[1281,13,1281,30,1],[1282,13,1282,30,1],[1283,13,1283,30,1],[1284,13,1284,30,1],[1285,13,1285,30,1],[1286,13,1286,30,1],[1287,13,1287,30,1],[1288,13,1288,30,1],[1289,13,1289,30,1],[1290,13,1290,30,1],[1291,13,1291,30,1],[1292,13,1292,30,1],[1293,13,1293,30,1],[1294,13,1294,30,1],[1295,13,1295,30,1],[1296,13,1296,30,1],[1297,13,1297,30,1],[1298,13,1298,30,1],[1299,13,1299,30,1],[1300,13,1300,30,1],[1301,13,1301,30,1],[1302,13,1302,30,1],[1303,13,1303,30,1],[1304,13,1304,30,1],[1305,13,1305,30,1],[1306,13,1306,30,1],[1307,13,1307,30,1],[1308,13,1308,30,1],[1309,13,1309,30,1],[1310,13,1310,30,1],[1311,13,1311,30,1],[1312,13,1312,30,1],[1313,13,1313,30,1],[1314,13,1314,30,1],[1315,13,1315,30,1],[1316,13,1316,30,1],[1317,13,1317,30,1],[1318,13,1318,30,1],[1319,13,1319,30,1],[1320,13,1320,30,1],[1321,13,1321,30,1],[1322,13,1322,30,1],[1323,13,1323,30,1],[1324,13,1324,30,1],[1325,13,1325,30,1],[1326,13,1326,30,1],[1327,13,1327,30,1],[1328,13,1328,30,1],[1329,13,1329,30,1],[1330,13,1330,30,1],[1331,13,1331,30,1],[1332,13,1332,30,1],[1333,13,1333,30,1],[1334,13,1334,30,1],[1335,13,1335,30,1],[1336,13,1336,30,1],[1337,13,1337,30,1],[1338,13,1338,30,1],[1339,13,1339,30,1],[1340,13,1340,30,1],[1341,13,1341,30,1],[1342,13,1342,30,1],[1343,13,1343,30,1],[1344,13,1344,30,1],[1345,13,1345,30,1],[1346,13,1346,30,1],[1347,13,1347,30,1],[1348,13,1348,30,1],[1349,13,1349,30,1],[1350,13,1350,30,1],[1351,13,1351,30,1],[1352,13,1352,30,1],[1353,13,1353,30,1],[1354,13,1354,30,1],[1355,13,1355,30,1],[1356,13,1356,30,1],[1357,13,1357,30,1],[1358,13,1358,30,1],[1359,13,1359,30,1],[1360,13,1360,30,1],[1361,13,1361,30,1],[1362,13,1362,30,1],[1363,13,1363,30,1],[1364,13,1364,30,1],[1365,13,1365,30,1],[1366,13,1366,30,1],[1367,13,1367,30,1],[1368,13,1368,30,1],[1369,13,1369,30,1],[1370,13,1370,30,1],[1371,13,1371,30,1],[1372,13,1372,30,1],[1373,13,1373,30,1],[1374,13,1374,30,1],[1375,13,1375,30,1],[1376,13,1376,30,1],[1377,13,1377,30,1],[1378,13,1378,30,1],[1379,13,1379,30,1],[1380,13,1380,30,1],[1381,13,1381,30,1],[1382,13,1382,30,1],[1383,13,1383,30,1],[1384,13,1384,30,1],[1385,13,1385,30,1],[1386,13,1386,30,1],[1387,13,1387,30,1],[1388,13,1388,30,1],[1389,13,1389,30,1],[1390,13,1390,30,1],[1391,13,1391,30,1],[1392,13,1392,30,1],[1393,13,1393,30,1],[1394,13,1394,30,1],[1395,13,1395,30,1],[1396,13,1396,30,1],[1397,13,1397,30,1],[1398,13,1398,30,1],[1399,13,1399,30,1],[1400,13,1400,30,1],[1401,13,1401,30,1],[1402,13,1402,30,1],[1403,13,1403,30,1],[1404,13,1404,30,1],[1405,13,1405,30,1],[1406,13,1406,30,1],[1407,13,1407,30,1],[1408,13,1408,30,1],[1409,13,1409,30,1],[1410,13,1410,30,1],[1411,13,1411,30,1],[1412,13,1412,30,1],[1413,13,1413,30,1],[1414,13,1414,30,1],[1415,13,1415,30,1],[1416,13,1416,30,1],[1417,13,1417,30,1],[1418,13,1418,30,1],[1419,13,1419,30,1],[1420,13,1420,30,1],[1421,13,1421,30,1],[1422,13,1422,30,1],[1423,13,1423,30,1],[1424,13,1424,30,1],[1425,13,1425,30,1],[1426,13,1426,30,1],[1427,13,1427,30,1],[1428,13,1428,30,1],[1429,13,1429,30,1],[1430,13,1430,30,1],[1431,13,1431,30,1],[1432,13,1432,30,1],[1433,13,1433,30,1],[1434,13,1434,30,1],[1435,13,1435,30,1],[1436,13,1436,30,1],[1437,13,1437,30,1],[1438,13,1438,30,1],[1439,13,1439,30,1],[1440,13,1440,30,1],[1441,13,1441,30,1],[1442,13,1442,30,1],[1443,13,1443,30,1],[1444,13,1444,30,1],[1445,13,1445,30,1],[1446,13,1446,30,1],[1447,13,1447,30,1],[1448,13,1448,30,1],[1449,13,1449,30,1],[1450,13,1450,30,1],[1451,13,1451,30,1],[1452,13,1452,30,1],[1453,13,1453,30,1],[1454,13,1454,30,1],[1455,13,1455,30,1],[1456,13,1456,30,1],[1457,13,1457,30,1],[1458,13,1458,30,1],[1459,13,1459,30,1],[1460,13,1460,30,1],[1461,13,1461,30,1],[1462,13,1462,30,1],[1463,13,1463,30,1],[1464,13,1464,30,1],[1465,13,1465,30,1],[1466,13,1466,30,1],[1467,13,1467,30,1],[1468,13,1468,30,1],[1469,13,1469,30,1],[1470,13,1470,30,1],[1471,13,1471,30,1],[1472,13,1472,30,1],[1473,13,1473,30,1],[1474,13,1474,30,1],[1475,13,1475,30,1],[1476,13,1476,30,1],[1477,13,1477,30,1],[1478,13,1478,30,1],[1479,13,1479,30,1],[1480,13,1480,30,1],[1481,13,1481,30,1],[1482,13,1482,30,1],[1483,13,1483,30,1],[1484,13,1484,30,1],[1485,13,1485,30,1],[1486,13,1486,30,1],[1487,13,1487,30,1],[1488,13,1488,30,1],[1489,13,1489,30,1],[1490,13,1490,30,1],[1491,13,1491,30,1],[1492,13,1492,30,1],[1493,13,1493,30,1],[1494,13,1494,30,1],[1495,13,1495,30,1],[1496,13,1496,30,1],[1497,13,1497,30,1],[1498,13,1498,30,1],[1499,13,1499,30,1],[1500,13,1500,30,1],[1501,13,1501,30,1],[1502,13,1502,30,1],[1503,13,1503,30,1],[1504,13,1504,30,1],[1505,13,1505,30,1],[1506,13,1506,30,1],[1507,13,1507,30,1],[1508,13,1508,30,1],[1509,13,1509,30,1],[1510,13,1510,30,1],[1511,13,1511,30,1],[1512,13,1512,30,1],[1513,13,1513,30,1],[1514,13,1514,30,1],[1515,13,1515,30,1],[1516,13,1516,30,1],[1517,13,1517,30,1],[1518,13,1518,30,1],[1519,13,1519,30,1],[1520,13,1520,30,1],[1521,13,1521,30,1],[1522,13,1522,30,1],[1523,13,1523,30,1],[1524,13,1524,30,1],[1525,13,1525,30,1],[1526,13,1526,30,1],[1527,13,1527,30,1],[1528,13,1528,30,1],[1529,13,1529,30,1],[1530,13,1530,30,1],[1531,13,1531,30,1],[1532,13,1532,30,1],[1533,13,1533,30,1],[1534,13,1534,30,1],[1535,13,1535,30,1],[1536,13,1536,30,1],[1537,13,1537,30,1],[1538,13,1538,30,1],[1539,13,1539,30,1],[1540,13,1540,30,1],[1541,13,1541,30,1],[1542,13,1542,30,1],[1543,13,1543,30,1],[1544,13,1544,30,1],[1545,13,1545,30,1],[1546,13,1546,30,1],[1547,13,1547,30,1],[1548,13,1548,30,1],[1549,13,1549,30,1],[1550,13,1550,30,1],[1551,13,1551,30,1],[1552,13,1552,30,1],[1553,13,1553,30,1],[1554,13,1554,30,1],[1555,13,1555,30,1],[1556,13,1556,30,1],[1557,13,1557,30,1],[1558,13,1558,30,1],[1559,13,1559,30,1],[1560,13,1560,30,1],[1561,13,1561,30,1],[1562,13,1562,30,1],[1563,13,1563,30,1],[1564,13,1564,30,1],[1565,13,1565,30,1],[1566,13,1566,30,1],[1567,13,1567,30,1],[1568,13,1568,30,1],[1569,13,1569,30,1],[1570,13,1570,30,1],[1571,13,1571,30,1],[1572,13,1572,30,1],[1573,13,1573,30,1],[1574,13,1574,30,1],[1575,13,1575,30,1],[1576,13,1576,30,1],[1577,13,1577,30,1],[1578,13,1578,30,1],[1579,13,1579,30,1],[1580,13,1580,30,1],[1581,13,1581,30,1],[1582,13,1582,30,1],[1583,13,1583,30,1],[1584,13,1584,30,1],[1585,13,1585,30,1],[1586,13,1586,30,1],[1587,13,1587,30,1],[1588,13,1588,30,1],[1589,13,1589,30,1],[1590,13,1590,30,1],[1591,13,1591,30,1],[1592,13,1592,30,1],[1593,13,1593,30,1],[1594,13,1594,30,1],[1595,13,1595,30,1],[1596,13,1596,30,1],[1597,13,1597,30,1],[1598,13,1598,30,1],[1599,13,1599,30,1],[1600,13,1600,30,1],[1601,13,1601,30,1],[1602,13,1602,30,1],[1603,13,1603,30,1],[1604,13,1604,30,1],[1605,13,1605,30,1],[1606,13,1606,30,1],[1607,13,1607,30,1],[1608,13,1608,30,1],[1609,13,1609,30,1],[1610,13,1610,30,1],[1611,13,1611,30,1],[1612,13,1612,30,1],[1613,13,1613,30,1],[1614,13,1614,30,1],[1615,13,1615,30,1],[1616,13,1616,30,1],[1617,13,1617,30,1],[1618,13,1618,30,1],[1619,13,1619,30,1],[1620,13,1620,30,1],[1621,13,1621,30,1],[1622,13,1622,30,1],[1623,13,1623,30,1],[1624,13,1624,30,1],[1625,13,1625,30,1],[1626,13,1626,30,1],[1627,13,1627,30,1],[1628,13,1628,30,1],[1629,13,1629,30,1],[1630,13,1630,30,1],[1631,13,1631,30,1],[1632,13,1632,30,1],[1633,13,1633,30,1],[1634,13,1634,30,1],[1635,13,1635,30,1],[1636,13,1636,30,1],[1637,13,1637,30,1],[1638,13,1638,30,1],[1639,13,1639,30,1],[1640,13,1640,30,1],[1641,13,1641,30,1],[1642,13,1642,30,1],[1643,13,1643,30,1],[1644,13,1644,30,1],[1645,13,1645,30,1],[1646,13,1646,30,1],[1647,13,1647,30,1],[1648,13,1648,30,1],[1649,13,1649,30,1],[1650,13,1650,30,1],[1651,13,1651,30,1],[1652,13,1652,30,1],[1653,13,1653,30,1],[1654,13,1654,30,1],[1655,13,1655,30,1],[1656,13,1656,30,1],[1657,13,1657,30,1],[1658,13,1658,30,1],[1659,13,1659,30,1],[1660,13,1660,30,1],[1661,13,1661,30,1],[1662,13,1662,30,1],[1663,13,1663,30,1],[1664,13,1664,30,1],[1665,13,1665,30,1],[1666,13,1666,30,1],[1667,13,1667,30,1],[1668,13,1668,30,1],[1669,13,1669,30,1],[1670,13,1670,30,1],[1671,13,1671,30,1],[1672,13,1672,30,1],[1673,13,1673,30,1],[1674,13,1674,30,1],[1675,13,1675,30,1],[1676,13,1676,30,1],[1677,13,1677,30,1],[1678,13,1678,30,1],[1679,13,1679,30,1],[1680,13,1680,30,1],[1681,13,1681,30,1],[1682,13,1682,30,1],[1683,13,1683,30,1],[1684,13,1684,30,1],[1685,13,1685,30,1],[1686,13,1686,30,1],[1687,13,1687,30,1],[1688,13,1688,30,1],[1689,13,1689,30,1],[1690,13,1690,30,1],[1691,13,1691,30,1],[1692,13,1692,30,1],[1693,13,1693,30,1],[1694,13,1694,30,1],[1695,13,1695,30,1],[1696,13,1696,30,1],[1697,13,1697,30,1],[1698,13,1698,30,1],[1699,13,1699,30,1],[1700,13,1700,30,1],[1701,13,1701,30,1],[1702,13,1702,30,1],[1703,13,1703,30,1],[1704,13,1704,30,1],[1705,13,1705,30,1],[1706,13,1706,30,1],[1707,13,1707,30,1],[1708,13,1708,30,1],[1709,13,1709,30,1],[1710,13,1710,30,1],[1711,13,1711,30,1],[1712,13,1712,30,1],[1713,13,1713,30,1],[1714,13,1714,30,1],[1715,13,1715,30,1],[1716,13,1716,30,1],[1717,13,1717,30,1],[1718,13,1718,30,1],[1719,13,1719,30,1],[1720,13,1720,30,1],[1721,13,1721,30,1],[1722,13,1722,30,1],[1723,13,1723,30,1],[1724,13,1724,30,1],[1725,13,1725,30,1],[1726,13,1726,30,1],[1727,13,1727,30,1],[1728,13,1728,30,1],[1729,13,1729,30,1],[1730,13,1730,30,1],[1731,13,1731,30,1],[1732,13,1732,30,1],[1733,13,1733,30,1],[1734,13,1734,30,1],[1735,13,1735,30,1],[1736,13,1736,30,1],[1737,13,1737,30,1],[1738,13,1738,30,1],[1739,13,1739,30,1],[1740,13,1740,30,1],[1741,13,1741,30,1],[1742,13,1742,30,1],[1743,13,1743,30,1],[1744,13,1744,30,1],[1745,13,1745,30,1],[1746,13,1746,30,1],[1747,13,1747,30,1],[1748,13,1748,30,1],[1749,13,1749,30,1],[1750,13,1750,30,1],[1751,13,1751,30,1],[1752,13,1752,30,1],[1753,13,1753,30,1],[1754,13,1754,30,1],[1755,13,1755,30,1],[1756,13,1756,30,1],[1757,13,1757,30,1],[1758,13,1758,30,1],[1759,13,1759,30,1],[1760,13,1760,30,1],[1761,13,1761,30,1],[1762,13,1762,30,1],[1763,13,1763,30,1],[1764,13,1764,30,1],[1765,13,1765,30,1],[1766,13,1766,30,1],[1767,13,1767,30,1],[1768,13,1768,30,1],[1769,13,1769,30,1],[1770,13,1770,30,1],[1771,13,1771,30,1],[1772,13,1772,30,1],[1773,13,1773,30,1],[1774,13,1774,30,1],[1775,13,1775,30,1],[1776,13,1776,30,1],[1777,13,1777,30,1],[1778,13,1778,30,1],[1779,13,1779,30,1],[1780,13,1780,30,1],[1781,13,1781,30,1],[1782,13,1782,30,1],[1783,13,1783,30,1],[1784,13,1784,30,1],[1785,13,1785,30,1],[1786,13,1786,30,1],[1787,13,1787,30,1],[1788,13,1788,30,1],[1789,13,1789,30,1],[1790,13,1790,30,1],[1791,13,1791,30,1],[1792,13,1792,30,1],[1793,13,1793,30,1],[1794,13,1794,30,1],[1795,13,1795,30,1],[1796,13,1796,30,1],[1797,13,1797,30,1],[1798,13,1798,30,1],[1799,13,1799,30,1],[1800,13,1800,30,1],[1801,13,1801,30,1],[1802,13,1802,30,1],[1803,13,1803,30,1],[1804,13,1804,30,1],[1805,13,1805,30,1],[1806,13,1806,30,1],[1807,13,1807,30,1],[1808,13,1808,30,1],[1809,13,1809,30,1],[1810,13,1810,30,1],[1811,13,1811,30,1],[1812,13,1812,30,1],[1813,13,1813,30,1],[1814,13,1814,30,1],[1815,13,1815,30,1],[1816,13,1816,30,1],[1817,13,1817,30,1],[1818,13,1818,30,1],[1819,13,1819,30,1],[1820,13,1820,30,1],[1821,13,1821,30,1],[1822,13,1822,30,1],[1823,13,1823,30,1],[1824,13,1824,30,1],[1825,13,1825,30,1],[1826,13,1826,30,1],[1827,13,1827,30,1],[1828,13,1828,30,1],[1829,13,1829,30,1],[1830,13,1830,30,1],[1831,13,1831,30,1],[1832,13,1832,30,1],[1833,13,1833,30,1],[1834,13,1834,30,1],[1835,13,1835,30,1],[1836,13,1836,30,1],[1837,13,1837,30,1],[1838,13,1838,30,1],[1839,13,1839,30,1],[1840,13,1840,30,1],[1841,13,1841,30,1],[1842,13,1842,30,1],[1843,13,1843,30,1],[1844,13,1844,30,1],[1845,13,1845,30,1],[1846,13,1846,30,1],[1847,13,1847,30,1],[1848,13,1848,30,1],[1849,13,1849,30,1],[1850,13,1850,30,1],[1851,13,1851,30,1],[1852,13,1852,30,1],[1853,13,1853,30,1],[1854,13,1854,30,1],[1855,13,1855,30,1],[1856,13,1856,30,1],[1857,13,1857,30,1],[1858,13,1858,30,1],[1859,13,1859,30,1],[1860,13,1860,30,1],[1861,13,1861,30,1],[1862,13,1862,30,1],[1863,13,1863,30,1],[1864,13,1864,30,1],[1865,13,1865,30,1],[1866,13,1866,30,1],[1867,13,1867,30,1],[1868,13,1868,30,1],[1869,13,1869,30,1],[1870,13,1870,30,1],[1871,13,1871,30,1],[1872,13,1872,30,1],[1873,13,1873,30,1],[1874,13,1874,30,1],[1875,13,1875,30,1],[1876,13,1876,30,1],[1877,13,1877,30,1],[1878,13,1878,30,1],[1879,13,1879,30,1],[1880,13,1880,30,1],[1881,13,1881,30,1],[1882,13,1882,30,1],[1883,13,1883,30,1],[1884,13,1884,30,1],[1885,13,1885,30,1],[1886,13,1886,30,1],[1887,13,1887,30,1],[1888,13,1888,30,1],[1889,13,1889,30,1],[1890,13,1890,30,1],[1891,13,1891,30,1],[1892,13,1892,30,1],[1893,13,1893,30,1],[1894,13,1894,30,1],[1895,13,1895,30,1],[1896,13,1896,30,1],[1897,13,1897,30,1],[1898,13,1898,30,1],[1899,13,1899,30,1],[1900,13,1900,30,1],[1901,13,1901,30,1],[1902,13,1902,30,1],[1903,13,1903,30,1],[1904,13,1904,30,1],[1905,13,1905,30,1],[1906,13,1906,30,1],[1907,13,1907,30,1],[1908,13,1908,30,1],[1909,13,1909,30,1],[1910,13,1910,30,1],[1911,13,1911,30,1],[1912,13,1912,30,1],[1913,13,1913,30,1],[1914,13,1914,30,1],[1915,13,1915,30,1],[1916,13,1916,30,1],[1917,13,1917,30,1],[1918,13,1918,30,1],[1919,13,1919,30,1],[1920,13,1920,30,1],[1921,13,1921,30,1],[1922,13,1922,30,1],[1923,13,1923,30,1],[1924,13,1924,30,1],[1925,13,1925,30,1],[1926,13,1926,30,1],[1927,13,1927,30,1],[1928,13,1928,30,1],[1929,13,1929,30,1],[1930,13,1930,30,1],[1931,13,1931,30,1],[1932,13,1932,30,1],[1933,13,1933,30,1],[1934,13,1934,30,1],[1935,13,1935,30,1],[1936,13,1936,30,1],[1937,13,1937,30,1],[1938,13,1938,30,1],[1939,13,1939,30,1],[1940,13,1940,30,1],[1941,13,1941,30,1],[1942,13,1942,30,1],[1943,13,1943,30,1],[1944,13,1944,30,1],[1945,13,1945,30,1],[1946,13,1946,30,1],[1947,13,1947,30,1],[1948,13,1948,30,1],[1949,13,1949,30,1],[1950,13,1950,30,1],[1951,13,1951,30,1],[1952,13,1952,30,1],[1953,13,1953,30,1],[1954,13,1954,30,1],[1955,13,1955,30,1],[1956,13,1956,30,1],[1957,13,1957,30,1],[1958,13,1958,30,1],[1959,13,1959,30,1],[1960,13,1960,30,1],[1961,13,1961,30,1],[1962,13,1962,30,1],[1963,13,1963,30,1],[1964,13,1964,30,1],[1965,13,1965,30,1],[1966,13,1966,30,1],[1967,13,1967,30,1],[1968,13,1968,30,1],[1969,13,1969,30,1],[1970,13,1970,30,1],[1971,13,1971,30,1],[1972,13,1972,30,1],[1973,13,1973,30,1],[1974,13,1974,30,1],[1975,13,1975,30,1],[1976,13,1976,30,1],[1977,13,1977,30,1],[1978,13,1978,30,1],[1979,13,1979,30,1],[1980,13,1980,30,1],[1981,13,1981,30,1],[1982,13,1982,30,1],[1983,13,1983,30,1],[1984,13,1984,30,1],[1985,13,1985,30,1],[1986,13,1986,30,1],[1987,13,1987,30,1],[1988,13,1988,30,1],[1989,13,1989,30,1],[1990,13,1990,30,1],[1991,13,1991,30,1],[1992,13,1992,30,1],[1993,13,1993,30,1],[1994,13,1994,30,1],[1995,13,1995,30,1],[1996,13,1996,30,1],[1997,13,1997,30,1],[1998,13,1998,30,1],[1999,13,1999,30,1],[2000,13,2000,30,1],[2001,13,2001,30,1],[2002,13,2002,30,1],[2003,13,2003,30,1],[2004,13,2004,30,1],[2005,13,2005,30,1],[2006,13,2006,30,1],[2007,13,2007,30,1],[2008,13,2008,30,1],[2009,13,2009,30,1],[2010,13,2010,30,1],[2011,13,2011,30,1],[2012,13,2012,30,1],[2013,13,2013,30,1],[2014,13,2014,30,1],[2015,13,2015,30,1],[2016,13,2016,30,1],[2017,13,2017,30,1],[2018,13,2018,30,1],[2019,13,2019,30,1],[2020,13,2020,30,1],[2021,13,2021,30,1],[2022,13,2022,30,1],[2023,13,2023,30,1],[2024,13,2024,30,1],[2025,13,2025,30,1],[2026,13,2026,30,1],[2027,13,2027,30,1],[2028,13,2028,30,1],[2029,13,2029,30,1],[2030,13,2030,30,1],[2031,13,2031,30,1],[2032,13,2032,30,1],[2033,13,2033,30,1],[2034,13,2034,30,1],[2035,13,2035,30,1],[2036,13,2036,30,1],[2037,13,2037,30,1],[2038,13,2038,30,1],[2039,13,2039,30,1],[2040,13,2040,30,1],[2041,13,2041,30,1],[2042,13,2042,30,1],[2043,13,2043,30,1],[2044,13,2044,30,1],[2045,13,2045,30,1],[2046,13,2046,30,1],[2047,13,2047,30,1],[2048,13,2048,30,1],[2049,13,2049,30,1],[2050,13,2050,30,1],[2051,13,2051,30,1],[2052,13,2052,30,1],[2053,13,2053,30,1],[2054,13,2054,30,1],[2055,13,2055,30,1],[2056,13,2056,30,1],[2057,13,2057,30,1],[2058,13,2058,30,1],[2059,13,2059,30,1],[2060,13,2060,30,1],[2061,13,2061,30,1],[2062,13,2062,30,1],[2063,13,2063,30,1],[2064,13,2064,30,1],[2065,13,2065,30,1],[2066,13,2066,30,1],[2067,13,2067,30,1],[2068,13,2068,30,1],[2069,13,2069,30,1],[2070,13,2070,30,1],[2071,13,2071,30,1],[2072,13,2072,30,1],[2073,13,2073,30,1],[2074,13,2074,30,1],[2075,13,2075,30,1],[2076,13,2076,30,1],[2077,13,2077,30,1],[2078,13,2078,30,1],[2079,13,2079,30,1],[2080,13,2080,30,1],[2081,13,2081,30,1],[2082,13,2082,30,1],[2083,13,2083,30,1],[2084,13,2084,30,1],[2085,13,2085,30,1],[2086,13,2086,30,1],[2087,13,2087,30,1],[2088,13,2088,30,1],[2089,13,2089,30,1],[2090,13,2090,30,1],[2091,13,2091,30,1],[2092,13,2092,30,1],[2093,13,2093,30,1],[2094,13,2094,30,1],[2095,13,2095,30,1],[2096,13,2096,30,1],[2097,13,2097,30,1],[2098,13,2098,30,1],[2099,13,2099,30,1],[2100,13,2100,30,1],[2101,13,2101,30,1],[2102,13,2102,30,1],[2103,13,2103,30,1],[2104,13,2104,30,1],[2105,13,2105,30,1],[2106,13,2106,30,1],[2107,13,2107,30,1],[2108,13,2108,30,1],[2109,13,2109,30,1],[2110,13,2110,30,1],[2111,13,2111,30,1],[2112,13,2112,30,1],[2113,13,2113,30,1],[2114,13,2114,30,1],[2115,13,2115,30,1],[2116,13,2116,30,1],[2117,13,2117,30,1],[2118,13,2118,30,1],[2119,13,2119,30,1],[2120,13,2120,30,1],[2121,13,2121,30,1],[2122,13,2122,30,1],[2123,13,2123,30,1],[2124,13,2124,30,1],[2125,13,2125,30,1],[2126,13,2126,30,1],[2127,13,2127,30,1],[2128,13,2128,30,1],[2129,13,2129,30,1],[2130,13,2130,30,1],[2131,13,2131,30,1],[2132,13,2132,30,1],[2133,13,2133,30,1],[2134,13,2134,30,1],[2135,13,2135,30,1],[2136,13,2136,30,1],[2137,13,2137,30,1],[2138,13,2138,30,1],[2139,13,2139,30,1],[2140,13,2140,30,1],[2141,13,2141,30,1],[2142,13,2142,30,1],[2143,13,2143,30,1],[2144,13,2144,30,1],[2145,13,2145,30,1],[2146,13,2146,30,1],[2147,13,2147,30,1],[2148,13,2148,30,1],[2149,13,2149,30,1],[2150,13,2150,30,1],[2151,13,2151,30,1],[2152,13,2152,30,1],[2153,13,2153,30,1],[2154,13,2154,30,1],[2155,13,2155,30,1],[2156,13,2156,30,1],[2157,13,2157,30,1],[2158,13,2158,30,1],[2159,13,2159,30,1],[2160,13,2160,30,1],[2161,13,2161,30,1],[2162,13,2162,30,1],[2163,13,2163,30,1],[2164,13,2164,30,1],[2165,13,2165,30,1],[2166,13,2166,30,1],[2167,13,2167,30,1],[2168,13,2168,30,1],[2169,13,2169,30,1],[2170,13,2170,30,1],[2171,13,2171,30,1],[2172,13,2172,30,1],[2173,13,2173,30,1],[2174,13,2174,30,1],[2175,13,2175,30,1],[2176,13,2176,30,1],[2177,13,2177,30,1],[2178,13,2178,30,1],[2179,13,2179,30,1],[2180,13,2180,30,1],[2181,13,2181,30,1],[2182,13,2182,30,1],[2183,13,2183,30,1],[2184,13,2184,30,1],[2185,13,2185,30,1],[2186,13,2186,30,1],[2187,13,2187,30,1],[2188,13,2188,30,1],[2189,13,2189,30,1],[2190,13,2190,30,1],[2191,13,2191,30,1],[2192,13,2192,30,1],[2193,13,2193,30,1],[2194,13,2194,30,1],[2195,13,2195,30,1],[2196,13,2196,30,1],[2197,13,2197,30,1],[2198,13,2198,30,1],[2199,13,2199,30,1],[2200,13,2200,30,1],[2201,13,2201,30,1],[2202,13,2202,30,1],[2203,13,2203,30,1],[2204,13,2204,30,1],[2205,13,2205,30,1],[2206,13,2206,30,1],[2207,13,2207,30,1],[2208,13,2208,30,1],[2209,13,2209,30,1],[2210,13,2210,30,1],[2211,13,2211,30,1],[2212,13,2212,30,1],[2213,13,2213,30,1],[2214,13,2214,30,1],[2215,13,2215,30,1],[2216,13,2216,30,1],[2217,13,2217,30,1],[2218,13,2218,30,1],[2219,13,2219,30,1],[2220,13,2220,30,1],[2221,13,2221,30,1],[2222,13,2222,30,1],[2223,13,2223,30,1],[2224,13,2224,30,1],[2225,13,2225,30,1],[2226,13,2226,30,1],[2227,13,2227,30,1],[2228,13,2228,30,1],[2229,13,2229,30,1],[2230,13,2230,30,1],[2231,13,2231,30,1],[2232,13,2232,30,1],[2233,13,2233,30,1],[2234,13,2234,30,1],[2235,13,2235,30,1],[2236,13,2236,30,1],[2237,13,2237,30,1],[2238,13,2238,30,1],[2239,13,2239,30,1],[2240,13,2240,30,1],[2241,13,2241,30,1],[2242,13,2242,30,1],[2243,13,2243,30,1],[2244,13,2244,30,1],[2245,13,2245,30,1],[2246,13,2246,30,1],[2247,13,2247,30,1],[2248,13,2248,30,1],[2249,13,2249,30,1],[2250,13,2250,30,1],[2251,13,2251,30,1],[2252,13,2252,30,1],[2253,13,2253,30,1],[2254,13,2254,30,1],[2255,13,2255,30,1],[2256,13,2256,30,1],[2257,13,2257,30,1],[2258,13,2258,30,1],[2259,13,2259,30,1],[2260,13,2260,30,1],[2261,13,2261,30,1],[2262,13,2262,30,1],[2263,13,2263,30,1],[2264,13,2264,30,1],[2265,13,2265,30,1],[2266,13,2266,30,1],[2267,13,2267,30,1],[2268,13,2268,30,1],[2269,13,2269,30,1],[2270,13,2270,30,1],[2271,13,2271,30,1],[2272,13,2272,30,1],[2273,13,2273,30,1],[2274,13,2274,30,1],[2275,13,2275,30,1],[2276,13,2276,30,1],[2277,13,2277,30,1],[2278,13,2278,30,1],[2279,13,2279,30,1],[2280,13,2280,30,1],[2281,13,2281,30,1],[2282,13,2282,30,1],[2283,13,2283,30,1],[2284,13,2284,30,1],[2285,13,2285,30,1],[2286,13,2286,30,1],[2287,13,2287,30,1],[2288,13,2288,30,1],[2289,13,2289,30,1],[2290,13,2290,30,1],[2291,13,2291,30,1],[2292,13,2292,30,1],[2293,13,2293,30,1],[2294,13,2294,30,1],[2295,13,2295,30,1],[2296,13,2296,30,1],[2297,13,2297,30,1],[2298,13,2298,30,1],[2299,13,2299,30,1],[2300,13,2300,30,1],[2301,13,2301,30,1],[2302,13,2302,30,1],[2303,13,2303,30,1],[2304,13,2304,30,1],[2305,13,2305,30,1],[2306,13,2306,30,1],[2307,13,2307,30,1],[2308,13,2308,30,1],[2309,13,2309,30,1],[2310,13,2310,30,1],[2311,13,2311,30,1],[2312,13,2312,30,1],[2313,13,2313,30,1],[2314,13,2314,30,1],[2315,13,2315,30,1],[2316,13,2316,30,1],[2317,13,2317,30,1],[2318,13,2318,30,1],[2319,13,2319,30,1],[2320,13,2320,30,1],[2321,13,2321,30,1],[2322,13,2322,30,1],[2323,13,2323,30,1],[2324,13,2324,30,1],[2325,13,2325,30,1],[2326,13,2326,30,1],[2327,13,2327,30,1],[2328,13,2328,30,1],[2329,13,2329,30,1],[2330,13,2330,30,1],[2331,13,2331,30,1],[2332,13,2332,30,1],[2333,13,2333,30,1],[2334,13,2334,30,1],[2335,13,2335,30,1],[2336,13,2336,30,1],[2337,13,2337,30,1],[2338,13,2338,30,1],[2339,13,2339,30,1],[2340,13,2340,30,1],[2341,13,2341,30,1],[2342,13,2342,30,1],[2343,13,2343,30,1],[2344,13,2344,30,1],[2345,13,2345,30,1],[2346,13,2346,30,1],[2347,13,2347,30,1],[2348,13,2348,30,1],[2349,13,2349,30,1],[2350,13,2350,30,1],[2351,13,2351,30,1],[2352,13,2352,30,1],[2353,13,2353,30,1],[2354,13,2354,30,1],[2355,13,2355,30,1],[2356,13,2356,30,1],[2357,13,2357,30,1],[2358,13,2358,30,1],[2359,13,2359,30,1],[2360,13,2360,30,1],[2361,13,2361,30,1],[2362,13,2362,30,1],[2363,13,2363,30,1],[2364,13,2364,30,1],[2365,13,2365,30,1],[2366,13,2366,30,1],[2367,13,2367,30,1],[2368,13,2368,30,1],[2369,13,2369,30,1],[2370,13,2370,30,1],[2371,13,2371,30,1],[2372,13,2372,30,1],[2373,13,2373,30,1],[2374,13,2374,30,1],[2375,13,2375,30,1],[2376,13,2376,30,1],[2377,13,2377,30,1],[2378,13,2378,30,1],[2379,13,2379,30,1],[2380,13,2380,30,1],[2381,13,2381,30,1],[2382,13,2382,30,1],[2383,13,2383,30,1],[2384,13,2384,30,1],[2385,13,2385,30,1],[2386,13,2386,30,1],[2387,13,2387,30,1],[2388,13,2388,30,1],[2389,13,2389,30,1],[2390,13,2390,30,1],[2391,13,2391,30,1],[2392,13,2392,30,1],[2393,13,2393,30,1],[2394,13,2394,30,1],[2395,13,2395,30,1],[2396,13,2396,30,1],[2397,13,2397,30,1],[2398,13,2398,30,1],[2399,13,2399,30,1],[2400,13,2400,30,1],[2401,13,2401,30,1],[2402,13,2402,30,1],[2403,13,2403,30,1],[2404,13,2404,30,1],[2405,13,2405,30,1],[2406,13,2406,30,1],[2407,13,2407,30,1],[2408,13,2408,30,1],[2409,13,2409,30,1],[2410,13,2410,30,1],[2411,13,2411,30,1],[2412,13,2412,30,1],[2413,13,2413,30,1],[2414,13,2414,30,1],[2415,13,2415,30,1],[2416,13,2416,30,1],[2417,13,2417,30,1],[2418,13,2418,30,1],[2419,13,2419,30,1],[2420,13,2420,30,1],[2421,13,2421,30,1],[2422,13,2422,30,1],[2423,13,2423,30,1],[2424,13,2424,30,1],[2425,13,2425,30,1],[2426,13,2426,30,1],[2427,13,2427,30,1],[2428,13,2428,30,1],[2429,13,2429,30,1],[2430,13,2430,30,1],[2431,13,2431,30,1],[2432,13,2432,30,1],[2433,13,2433,30,1],[2434,13,2434,30,1],[2435,13,2435,30,1],[2436,13,2436,30,1],[2437,13,2437,30,1],[2438,13,2438,30,1],[2439,13,2439,30,1],[2440,13,2440,30,1],[2441,13,2441,30,1],[2442,13,2442,30,1],[2443,13,2443,30,1],[2444,13,2444,30,1],[2445,13,2445,30,1],[2446,13,2446,30,1],[2447,13,2447,30,1],[2448,13,2448,30,1],[2449,13,2449,30,1],[2450,13,2450,30,1],[2451,13,2451,30,1],[2452,13,2452,30,1],[2453,13,2453,30,1],[2454,13,2454,30,1],[2455,13,2455,30,1],[2456,13,2456,30,1],[2457,13,2457,30,1],[2458,13,2458,30,1],[2459,13,2459,30,1],[2460,13,2460,30,1],[2461,13,2461,30,1],[2462,13,2462,30,1],[2463,13,2463,30,1],[2464,13,2464,30,1],[2465,13,2465,30,1],[2466,13,2466,30,1],[2467,13,2467,30,1],[2468,13,2468,30,1],[2469,13,2469,30,1],[2470,13,2470,30,1],[2471,13,2471,30,1],[2472,13,2472,30,1],[2473,13,2473,30,1],[2474,13,2474,30,1],[2475,13,2475,30,1],[2476,13,2476,30,1],[2477,13,2477,30,1],[2478,13,2478,30,1],[2479,13,2479,30,1],[2480,13,2480,30,1],[2481,13,2481,30,1],[2482,13,2482,30,1],[2483,13,2483,30,1],[2484,13,2484,30,1],[2485,13,2485,30,1],[2486,13,2486,30,1],[2487,13,2487,30,1],[2488,13,2488,30,1],[2489,13,2489,30,1],[2490,13,2490,30,1],[2491,13,2491,30,1],[2492,13,2492,30,1],[2493,13,2493,30,1],[2494,13,2494,30,1],[2495,13,2495,30,1],[2496,13,2496,30,1],[2497,13,2497,30,1],[2498,13,2498,30,1],[2499,13,2499,30,1],[2500,13,2500,30,1],[2501,13,2501,30,1],[2502,13,2502,30,1],[2503,13,2503,30,1],[2504,13,2504,30,1],[2505,13,2505,30,1],[2506,13,2506,30,1],[2507,13,2507,30,1],[2508,13,2508,30,1],[2509,13,2509,30,1],[2510,13,2510,30,1],[2511,13,2511,30,1],[2512,13,2512,30,1],[2513,13,2513,30,1],[2514,13,2514,30,1],[2515,13,2515,30,1],[2516,13,2516,30,1],[2517,13,2517,30,1],[2518,13,2518,30,1],[2519,13,2519,30,1],[2520,13,2520,30,1],[2521,13,2521,30,1],[2522,13,2522,30,1],[2523,13,2523,30,1],[2524,13,2524,30,1],[2525,13,2525,30,1],[2526,13,2526,30,1],[2527,13,2527,30,1],[2528,13,2528,30,1],[2529,13,2529,30,1],[2530,13,2530,30,1],[2531,13,2531,30,1],[2532,13,2532,30,1],[2533,13,2533,30,1],[2534,13,2534,30,1],[2535,13,2535,30,1],[2536,13,2536,30,1],[2537,13,2537,30,1],[2538,13,2538,30,1],[2539,13,2539,30,1],[2540,13,2540,30,1],[2541,13,2541,30,1],[2542,13,2542,30,1],[2543,13,2543,30,1],[2544,13,2544,30,1],[2545,13,2545,30,1],[2546,13,2546,30,1],[2547,13,2547,30,1],[2548,13,2548,30,1],[2549,13,2549,30,1],[2550,13,2550,30,1],[2551,13,2551,30,1],[2552,13,2552,30,1],[2553,13,2553,30,1],[2554,13,2554,30,1],[2555,13,2555,30,1],[2556,13,2556,30,1],[2557,13,2557,30,1],[2558,13,2558,30,1],[2559,13,2559,30,1],[2560,13,2560,30,1],[2561,13,2561,30,1],[2562,13,2562,30,1],[2563,13,2563,30,1],[2564,13,2564,30,1],[2565,13,2565,30,1],[2566,13,2566,30,1],[2567,13,2567,30,1],[2568,13,2568,30,1],[2569,13,2569,30,1],[2570,13,2570,30,1],[2571,13,2571,30,1],[2572,13,2572,30,1],[2573,13,2573,30,1],[2574,13,2574,30,1],[2575,13,2575,30,1],[2576,13,2576,30,1],[2577,13,2577,30,1],[2578,13,2578,30,1],[2579,13,2579,30,1],[2580,13,2580,30,1],[2581,13,2581,30,1],[2582,13,2582,30,1],[2583,13,2583,30,1],[2584,13,2584,30,1],[2585,13,2585,30,1],[2586,13,2586,30,1],[2587,13,2587,30,1],[2588,13,2588,30,1],[2589,13,2589,30,1],[2590,13,2590,30,1],[2591,13,2591,30,1],[2592,13,2592,30,1],[2593,13,2593,30,1],[2594,13,2594,30,1],[2595,13,2595,30,1],[2596,13,2596,30,1],[2597,13,2597,30,1],[2598,13,2598,30,1],[2599,13,2599,30,1],[2600,13,2600,30,1],[2601,13,2601,30,1],[2602,13,2602,30,1],[2603,13,2603,30,1],[2604,13,2604,30,1],[2605,13,2605,30,1],[2606,13,2606,30,1],[2607,13,2607,30,1],[2608,13,2608,30,1],[2609,13,2609,30,1],[2610,13,2610,30,1],[2611,13,2611,30,1],[2612,13,2612,30,1],[2613,13,2613,30,1],[2614,13,2614,30,1],[2615,13,2615,30,1],[2616,13,2616,30,1],[2617,13,2617,30,1],[2618,13,2618,30,1],[2619,13,2619,30,1],[2620,13,2620,30,1],[2621,13,2621,30,1],[2622,13,2622,30,1],[2623,13,2623,30,1],[2624,13,2624,30,1],[2625,13,2625,30,1],[2626,13,2626,30,1],[2627,13,2627,30,1],[2628,13,2628,30,1],[2629,13,2629,30,1],[2630,13,2630,30,1],[2631,13,2631,30,1],[2632,13,2632,30,1],[2633,13,2633,30,1],[2634,13,2634,30,1],[2635,13,2635,30,1],[2636,13,2636,30,1],[2637,13,2637,30,1],[2638,13,2638,30,1],[2639,13,2639,30,1],[2640,13,2640,30,1],[2641,13,2641,30,1],[2642,13,2642,30,1],[2643,13,2643,30,1],[2644,13,2644,30,1],[2645,13,2645,30,1],[2646,13,2646,30,1],[2647,13,2647,30,1],[2648,13,2648,30,1],[2649,13,2649,30,1],[2650,13,2650,30,1],[2651,13,2651,30,1],[2652,13,2652,30,1],[2653,13,2653,30,1],[2654,13,2654,30,1],[2655,13,2655,30,1],[2656,13,2656,30,1],[2657,13,2657,30,1],[2658,13,2658,30,1],[2659,13,2659,30,1],[2660,13,2660,30,1],[2661,13,2661,30,1],[2662,13,2662,30,1],[2663,13,2663,30,1],[2664,13,2664,30,1],[2665,13,2665,30,1],[2666,13,2666,30,1],[2667,13,2667,30,1],[2668,13,2668,30,1],[2669,13,2669,30,1],[2670,13,2670,30,1],[2671,13,2671,30,1],[2672,13,2672,30,1],[2673,13,2673,30,1],[2674,13,2674,30,1],[2675,13,2675,30,1],[2676,13,2676,30,1],[2677,13,2677,30,1],[2678,13,2678,30,1],[2679,13,2679,30,1],[2680,13,2680,30,1],[2681,13,2681,30,1],[2682,13,2682,30,1],[2683,13,2683,30,1],[2684,13,2684,30,1],[2685,13,2685,30,1],[2686,13,2686,30,1],[2687,13,2687,30,1],[2688,13,2688,30,1],[2689,13,2689,30,1],[2690,13,2690,30,1],[2691,13,2691,30,1],[2692,13,2692,30,1],[2693,13,2693,30,1],[2694,13,2694,30,1],[2695,13,2695,30,1],[2696,13,2696,30,1],[2697,13,2697,30,1],[2698,13,2698,30,1],[2699,13,2699,30,1],[2700,13,2700,30,1],[2701,13,2701,30,1],[2702,13,2702,30,1],[2703,13,2703,30,1],[2704,13,2704,30,1],[2705,13,2705,30,1],[2706,13,2706,30,1],[2707,13,2707,30,1],[2708,13,2708,30,1],[2709,13,2709,30,1],[2710,13,2710,30,1],[2711,13,2711,30,1],[2712,13,2712,30,1],[2713,13,2713,30,1],[2714,13,2714,30,1],[2715,13,2715,30,1],[2716,13,2716,30,1],[2717,13,2717,30,1],[2718,13,2718,30,1],[2719,13,2719,30,1],[2720,13,2720,30,1],[2721,13,2721,30,1],[2722,13,2722,30,1],[2723,13,2723,30,1],[2724,13,2724,30,1],[2725,13,2725,30,1],[2726,13,2726,30,1],[2727,13,2727,30,1],[2728,13,2728,30,1],[2729,13,2729,30,1],[2730,13,2730,30,1],[2731,13,2731,30,1],[2732,13,2732,30,1],[2733,13,2733,30,1],[2734,13,2734,30,1],[2735,13,2735,30,1],[2736,13,2736,30,1],[2737,13,2737,30,1],[2738,13,2738,30,1],[2739,13,2739,30,1],[2740,13,2740,30,1],[2741,13,2741,30,1],[2742,13,2742,30,1],[2743,13,2743,30,1],[2744,13,2744,30,1],[2745,13,2745,30,1],[2746,13,2746,30,1],[2747,13,2747,30,1],[2748,13,2748,30,1],[2749,13,2749,30,1],[2750,13,2750,30,1],[2751,13,2751,30,1],[2752,13,2752,30,1],[2753,13,2753,30,1],[2754,13,2754,30,1],[2755,13,2755,30,1],[2756,13,2756,30,1],[2757,13,2757,30,1],[2758,13,2758,30,1],[2759,13,2759,30,1],[2760,13,2760,30,1],[2761,13,2761,30,1],[2762,13,2762,30,1],[2763,13,2763,30,1],[2764,13,2764,30,1],[2765,13,2765,30,1],[2766,13,2766,30,1],[2767,13,2767,30,1],[2768,13,2768,30,1],[2769,13,2769,30,1],[2770,13,2770,30,1],[2771,13,2771,30,1],[2772,13,2772,30,1],[2773,13,2773,30,1],[2774,13,2774,30,1],[2775,13,2775,30,1],[2776,13,2776,30,1],[2777,13,2777,30,1],[2778,13,2778,30,1],[2779,13,2779,30,1],[2780,13,2780,30,1],[2781,13,2781,30,1],[2782,13,2782,30,1],[2783,13,2783,30,1],[2784,13,2784,30,1],[2785,13,2785,30,1],[2786,13,2786,30,1],[2787,13,2787,30,1],[2788,13,2788,30,1],[2789,13,2789,30,1],[2790,13,2790,30,1],[2791,13,2791,30,1],[2792,13,2792,30,1],[2793,13,2793,30,1],[2794,13,2794,30,1],[2795,13,2795,30,1],[2796,13,2796,30,1],[2797,13,2797,30,1],[2798,13,2798,30,1],[2799,13,2799,30,1],[2800,13,2800,30,1],[2801,13,2801,30,1],[2802,13,2802,30,1],[2803,13,2803,30,1],[2804,13,2804,30,1],[2805,13,2805,30,1],[2806,13,2806,30,1],[2807,13,2807,30,1],[2808,13,2808,30,1],[2809,13,2809,30,1],[2810,13,2810,30,1],[2811,13,2811,30,1],[2812,13,2812,30,1],[2813,13,2813,30,1],[2814,13,2814,30,1],[2815,13,2815,30,1],[2816,13,2816,30,1],[2817,13,2817,30,1],[2818,13,2818,30,1],[2819,13,2819,30,1],[2820,13,2820,30,1],[2821,13,2821,30,1],[2822,13,2822,30,1],[2823,13,2823,30,1],[2824,13,2824,30,1],[2825,13,2825,30,1],[2826,13,2826,30,1],[2827,13,2827,30,1],[2828,13,2828,30,1],[2829,13,2829,30,1],[2830,13,2830,30,1],[2831,13,2831,30,1],[2832,13,2832,30,1],[2833,13,2833,30,1],[2834,13,2834,30,1],[2835,13,2835,30,1],[2836,13,2836,30,1],[2837,13,2837,30,1],[2838,13,2838,30,1],[2839,13,2839,30,1],[2840,13,2840,30,1],[2841,13,2841,30,1],[2842,13,2842,30,1],[2843,13,2843,30,1],[2844,13,2844,30,1],[2845,13,2845,30,1],[2846,13,2846,30,1],[2847,13,2847,30,1],[2848,13,2848,30,1],[2849,13,2849,30,1],[2850,13,2850,30,1],[2851,13,2851,30,1],[2852,13,2852,30,1],[2853,13,2853,30,1],[2854,13,2854,30,1],[2855,13,2855,30,1],[2856,13,2856,30,1],[2857,13,2857,30,1],[2858,13,2858,30,1],[2859,13,2859,30,1],[2860,13,2860,30,1],[2861,13,2861,30,1],[2862,13,2862,30,1],[2863,13,2863,30,1],[2864,13,2864,30,1],[2865,13,2865,30,1],[2866,13,2866,30,1],[2867,13,2867,30,1],[2868,13,2868,30,1],[2869,13,2869,30,1],[2870,13,2870,30,1],[2871,13,2871,30,1],[2872,13,2872,30,1],[2873,13,2873,30,1],[2874,13,2874,30,1],[2875,13,2875,30,1],[2876,13,2876,30,1],[2877,13,2877,30,1],[2878,13,2878,30,1],[2879,13,2879,30,1],[2880,13,2880,30,1],[2881,13,2881,30,1],[2882,13,2882,30,1],[2883,13,2883,30,1],[2884,13,2884,30,1],[2885,13,2885,30,1],[2886,13,2886,30,1],[2887,13,2887,30,1],[2888,13,2888,30,1],[2889,13,2889,30,1],[2890,13,2890,30,1],[2891,13,2891,30,1],[2892,13,2892,30,1],[2893,13,2893,30,1],[2894,13,2894,30,1],[2895,13,2895,30,1],[2896,13,2896,30,1],[2897,13,2897,30,1],[2898,13,2898,30,1],[2899,13,2899,30,1],[2900,13,2900,30,1],[2901,13,2901,30,1],[2902,13,2902,30,1],[2903,13,2903,30,1],[2904,13,2904,30,1],[2905,13,2905,30,1],[2906,13,2906,30,1],[2907,13,2907,30,1],[2908,13,2908,30,1],[2909,13,2909,30,1],[2910,13,2910,30,1],[2911,13,2911,30,1],[2912,13,2912,30,1],[2913,13,2913,30,1],[2914,13,2914,30,1],[2915,13,2915,30,1],[2916,13,2916,30,1],[2917,13,2917,30,1],[2918,13,2918,30,1],[2919,13,2919,30,1],[2920,13,2920,30,1],[2921,13,2921,30,1],[2922,13,2922,30,1],[2923,13,2923,30,1],[2924,13,2924,30,1],[2925,13,2925,30,1],[2926,13,2926,30,1],[2927,13,2927,30,1],[2928,13,2928,30,1],[2929,13,2929,30,1],[2930,13,2930,30,1],[2931,13,2931,30,1],[2932,13,2932,30,1],[2933,13,2933,30,1],[2934,13,2934,30,1],[2935,13,2935,30,1],[2936,13,2936,30,1],[2937,13,2937,30,1],[2938,13,2938,30,1],[2939,13,2939,30,1],[2940,13,2940,30,1],[2941,13,2941,30,1],[2942,13,2942,30,1],[2943,13,2943,30,1],[2944,13,2944,30,1],[2945,13,2945,30,1],[2946,13,2946,30,1],[2947,13,2947,30,1],[2948,13,2948,30,1],[2949,13,2949,30,1],[2950,13,2950,30,1],[2951,13,2951,30,1],[2952,13,2952,30,1],[2953,13,2953,30,1],[2954,13,2954,30,1],[2955,13,2955,30,1],[2956,13,2956,30,1],[2957,13,2957,30,1],[2958,13,2958,30,1],[2959,13,2959,30,1],[2960,13,2960,30,1],[2961,13,2961,30,1],[2962,13,2962,30,1],[2963,13,2963,30,1],[2964,13,2964,30,1],[2965,13,2965,30,1],[2966,13,2966,30,1],[2967,13,2967,30,1],[2968,13,2968,30,1],[2969,13,2969,30,1],[2970,13,2970,30,1],[2971,13,2971,30,1],[2972,13,2972,30,1],[2973,13,2973,30,1],[2974,13,2974,30,1],[2975,13,2975,30,1],[2976,13,2976,30,1],[2977,13,2977,30,1],[2978,13,2978,30,1],[2979,13,2979,30,1],[2980,13,2980,30,1],[2981,13,2981,30,1],[2982,13,2982,30,1],[2983,13,2983,30,1],[2984,13,2984,30,1],[2985,13,2985,30,1],[2986,13,2986,30,1],[2987,13,2987,30,1],[2988,13,2988,30,1],[2989,13,2989,30,1],[2990,13,2990,30,1],[2991,13,2991,30,1],[2992,13,2992,30,1],[2993,13,2993,30,1],[2994,13,2994,30,1],[2995,13,2995,30,1],[2996,13,2996,30,1],[2997,13,2997,30,1],[2998,13,2998,30,1],[2999,13,2999,30,1],[3000,13,3000,30,1],[3001,13,3001,30,1],[3002,13,3002,30,1],[3003,13,3003,30,1],[3004,13,3004,30,1],[3005,13,3005,30,1],[3006,13,3006,30,1],[3007,13,3007,30,1],[3008,13,3008,30,1],[3009,13,3009,30,1],[3010,13,3010,30,1],[3011,13,3011,30,1],[3012,13,3012,30,1],[3013,13,3013,30,1],[3014,13,3014,30,1],[3015,13,3015,30,1],[3016,13,3016,30,1],[3017,13,3017,30,1],[3018,13,3018,30,1],[3019,13,3019,30,1],[3020,13,3020,30,1],[3021,13,3021,30,1],[3022,13,3022,30,1],[3023,13,3023,30,1],[3024,13,3024,30,1],[3025,13,3025,30,1],[3026,13,3026,30,1],[3027,13,3027,30,1],[3028,13,3028,30,1],[3029,13,3029,30,1],[3030,13,3030,30,1],[3031,13,3031,30,1],[3032,13,3032,30,1],[3033,13,3033,30,1],[3034,13,3034,30,1],[3035,13,3035,30,1],[3036,13,3036,30,1],[3037,13,3037,30,1],[3038,13,3038,30,1],[3039,13,3039,30,1],[3040,13,3040,30,1],[3041,13,3041,30,1],[3042,13,3042,30,1],[3043,13,3043,30,1],[3044,13,3044,30,1],[3045,13,3045,30,1],[3046,13,3046,30,1],[3047,13,3047,30,1],[3048,13,3048,30,1],[3049,13,3049,30,1],[3050,13,3050,30,1],[3051,13,3051,30,1],[3052,13,3052,30,1],[3053,13,3053,30,1],[3054,13,3054,30,1],[3055,13,3055,30,1],[3056,13,3056,30,1],[3057,13,3057,30,1],[3058,13,3058,30,1],[3059,13,3059,30,1],[3060,13,3060,30,1],[3061,13,3061,30,1],[3062,13,3062,30,1],[3063,13,3063,30,1],[3064,13,3064,30,1],[3065,13,3065,30,1],[3066,13,3066,30,1],[3067,13,3067,30,1],[3068,13,3068,30,1],[3069,13,3069,30,1],[3070,13,3070,30,1],[3071,13,3071,30,1],[3072,13,3072,30,1],[3073,13,3073,30,1],[3074,13,3074,30,1],[3075,13,3075,30,1],[3076,13,3076,30,1],[3077,13,3077,30,1],[3078,13,3078,30,1],[3079,13,3079,30,1],[3080,13,3080,30,1],[3081,13,3081,30,1],[3082,13,3082,30,1],[3083,13,3083,30,1],[3084,13,3084,30,1],[3085,13,3085,30,1],[3086,13,3086,30,1],[3087,13,3087,30,1],[3088,13,3088,30,1],[3089,13,3089,30,1],[3090,13,3090,30,1],[3091,13,3091,30,1],[3092,13,3092,30,1],[3093,13,3093,30,1],[3094,13,3094,30,1],[3095,13,3095,30,1],[3096,13,3096,30,1],[3097,13,3097,30,1],[3098,13,3098,30,1],[3099,13,3099,30,1],[3100,13,3100,30,1],[3101,13,3101,30,1],[3102,13,3102,30,1],[3103,13,3103,30,1],[3104,13,3104,30,1],[3105,13,3105,30,1],[3106,13,3106,30,1],[3107,13,3107,30,1],[3108,13,3108,30,1],[3109,13,3109,30,1],[3110,13,3110,30,1],[3111,13,3111,30,1],[3112,13,3112,30,1],[3113,13,3113,30,1],[3114,13,3114,30,1],[3115,13,3115,30,1],[3116,13,3116,30,1],[3117,13,3117,30,1],[3118,13,3118,30,1],[3119,13,3119,30,1],[3120,13,3120,30,1],[3121,13,3121,30,1],[3122,13,3122,30,1],[3123,13,3123,30,1],[3124,13,3124,30,1],[3125,13,3125,30,1],[3126,13,3126,30,1],[3127,13,3127,30,1],[3128,13,3128,30,1],[3129,13,3129,30,1],[3130,13,3130,30,1],[3131,13,3131,30,1],[3132,13,3132,30,1],[3133,13,3133,30,1],[3134,13,3134,30,1],[3135,13,3135,30,1],[3136,13,3136,30,1],[3137,13,3137,30,1],[3138,13,3138,30,1],[3139,13,3139,30,1],[3140,13,3140,30,1],[3141,13,3141,30,1],[3142,13,3142,30,1],[3143,13,3143,30,1],[3144,13,3144,30,1],[3145,13,3145,30,1],[3146,13,3146,30,1],[3147,13,3147,30,1],[3148,13,3148,30,1],[3149,13,3149,30,1],[3150,13,3150,30,1],[3151,13,3151,30,1],[3152,13,3152,30,1],[3153,13,3153,30,1],[3154,13,3154,30,1],[3155,13,3155,30,1],[3156,13,3156,30,1],[3157,13,3157,30,1],[3158,13,3158,30,1],[3159,13,3159,30,1],[3160,13,3160,30,1],[3161,13,3161,30,1],[3162,13,3162,30,1],[3163,13,3163,30,1],[3164,13,3164,30,1],[3165,13,3165,30,1],[3166,13,3166,30,1],[3167,13,3167,30,1],[3168,13,3168,30,1],[3169,13,3169,30,1],[3170,13,3170,30,1],[3171,13,3171,30,1],[3172,13,3172,30,1],[3173,13,3173,30,1],[3174,13,3174,30,1],[3175,13,3175,30,1],[3176,13,3176,30,1],[3177,13,3177,30,1],[3178,13,3178,30,1],[3179,13,3179,30,1],[3180,13,3180,30,1],[3181,13,3181,30,1],[3182,13,3182,30,1],[3183,13,3183,30,1],[3184,13,3184,30,1],[3185,13,3185,30,1],[3186,13,3186,30,1],[3187,13,3187,30,1],[3188,13,3188,30,1],[3189,13,3189,30,1],[3190,13,3190,30,1],[3191,13,3191,30,1],[3192,13,3192,30,1],[3193,13,3193,30,1],[3194,13,3194,30,1],[3195,13,3195,30,1],[3196,13,3196,30,1],[3197,13,3197,30,1],[3198,13,3198,30,1],[3199,13,3199,30,1],[3200,13,3200,30,1],[3201,13,3201,30,1],[3202,13,3202,30,1],[3203,13,3203,30,1],[3204,13,3204,30,1],[3205,13,3205,30,1],[3206,13,3206,30,1],[3207,13,3207,30,1],[3208,13,3208,30,1],[3209,13,3209,30,1],[3210,13,3210,30,1],[3211,13,3211,30,1],[3212,13,3212,30,1],[3213,13,3213,30,1],[3214,13,3214,30,1],[3215,13,3215,30,1],[3216,13,3216,30,1],[3217,13,3217,30,1],[3218,13,3218,30,1],[3219,13,3219,30,1],[3220,13,3220,30,1],[3221,13,3221,30,1],[3222,13,3222,30,1],[3223,13,3223,30,1],[3224,13,3224,30,1],[3225,13,3225,30,1],[3226,13,3226,30,1],[3227,13,3227,30,1],[3228,13,3228,30,1],[3229,13,3229,30,1],[3230,13,3230,30,1],[3231,13,3231,30,1],[3232,13,3232,30,1],[3233,13,3233,30,1],[3234,13,3234,30,1],[3235,13,3235,30,1],[3236,13,3236,30,1],[3237,13,3237,30,1],[3238,13,3238,30,1],[3239,13,3239,30,1],[3240,13,3240,30,1],[3241,13,3241,30,1],[3242,13,3242,30,1],[3243,13,3243,30,1],[3244,13,3244,30,1],[3245,13,3245,30,1],[3246,13,3246,30,1],[3247,13,3247,30,1],[3248,13,3248,30,1],[3249,13,3249,30,1],[3250,13,3250,30,1],[3251,13,3251,30,1],[3252,13,3252,30,1],[3253,13,3253,30,1],[3254,13,3254,30,1],[3255,13,3255,30,1],[3256,13,3256,30,1],[3257,13,3257,30,1],[3258,13,3258,30,1],[3259,13,3259,30,1],[3260,13,3260,30,1],[3261,13,3261,30,1],[3262,13,3262,30,1],[3263,13,3263,30,1],[3264,13,3264,30,1],[3265,13,3265,30,1],[3266,13,3266,30,1],[3267,13,3267,30,1],[3268,13,3268,30,1],[3269,13,3269,30,1],[3270,13,3270,30,1],[3271,13,3271,30,1],[3272,13,3272,30,1],[3273,13,3273,30,1],[3274,13,3274,30,1],[3275,13,3275,30,1],[3276,13,3276,30,1],[3277,13,3277,30,1],[3278,13,3278,30,1],[3279,13,3279,30,1],[3280,13,3280,30,1],[3281,13,3281,30,1],[3282,13,3282,30,1],[3283,13,3283,30,1],[3284,13,3284,30,1],[3285,13,3285,30,1],[3286,13,3286,30,1],[3287,13,3287,30,1],[3288,13,3288,30,1],[3289,13,3289,30,1],[3290,13,3290,30,1],[3291,13,3291,30,1],[3292,13,3292,30,1],[3293,13,3293,30,1],[3294,13,3294,30,1],[3295,13,3295,30,1],[3296,13,3296,30,1],[3297,13,3297,30,1],[3298,13,3298,30,1],[3299,13,3299,30,1],[3300,13,3300,30,1],[3301,13,3301,30,1],[3302,13,3302,30,1],[3303,13,3303,30,1],[3304,13,3304,30,1],[3305,13,3305,30,1],[3306,13,3306,30,1],[3307,13,3307,30,1],[3308,13,3308,30,1],[3309,13,3309,30,1],[3310,13,3310,30,1],[3311,13,3311,30,1],[3312,13,3312,30,1],[3313,13,3313,30,1],[3314,13,3314,30,1],[3315,13,3315,30,1],[3316,13,3316,30,1],[3317,13,3317,30,1],[3318,13,3318,30,1],[3319,13,3319,30,1],[3320,13,3320,30,1],[3321,13,3321,30,1],[3322,13,3322,30,1],[3323,13,3323,30,1],[3324,13,3324,30,1],[3325,13,3325,30,1],[3326,13,3326,30,1],[3327,13,3327,30,1],[3328,13,3328,30,1],[3329,13,3329,30,1],[3330,13,3330,30,1],[3331,13,3331,30,1],[3332,13,3332,30,1],[3333,13,3333,30,1],[3334,13,3334,30,1],[3335,13,3335,30,1],[3336,13,3336,30,1],[3337,13,3337,30,1],[3338,13,3338,30,1],[3339,13,3339,30,1],[3340,13,3340,30,1],[3341,13,3341,30,1],[3342,13,3342,30,1],[3343,13,3343,30,1],[3344,13,3344,30,1],[3345,13,3345,30,1],[3346,13,3346,30,1],[3347,13,3347,30,1],[3348,13,3348,30,1],[3349,13,3349,30,1],[3350,13,3350,30,1],[3351,13,3351,30,1],[3352,13,3352,30,1],[3353,13,3353,30,1],[3354,13,3354,30,1],[3355,13,3355,30,1],[3356,13,3356,30,1],[3357,13,3357,30,1],[3358,13,3358,30,1],[3359,13,3359,30,1],[3360,13,3360,30,1],[3361,13,3361,30,1],[3362,13,3362,30,1],[3363,13,3363,30,1],[3364,13,3364,30,1],[3365,13,3365,30,1],[3366,13,3366,30,1],[3367,13,3367,30,1],[3368,13,3368,30,1],[3369,13,3369,30,1],[3370,13,3370,30,1],[3371,13,3371,30,1],[3372,13,3372,30,1],[3373,13,3373,30,1],[3374,13,3374,30,1],[3375,13,3375,30,1],[3376,13,3376,30,1],[3377,13,3377,30,1],[3378,13,3378,30,1],[3379,13,3379,30,1],[3380,13,3380,30,1],[3381,13,3381,30,1],[3382,13,3382,30,1],[3383,13,3383,30,1],[3384,13,3384,30,1],[3385,13,3385,30,1],[3386,13,3386,30,1],[3387,13,3387,30,1],[3388,13,3388,30,1],[3389,13,3389,30,1],[3390,13,3390,30,1],[3391,13,3391,30,1],[3392,13,3392,30,1],[3393,13,3393,30,1],[3394,13,3394,30,1],[3395,13,3395,30,1],[3396,13,3396,30,1],[3397,13,3397,30,1],[3398,13,3398,30,1],[3399,13,3399,30,1],[3400,13,3400,30,1],[3401,13,3401,30,1],[3402,13,3402,30,1],[3403,13,3403,30,1],[3404,13,3404,30,1],[3405,13,3405,30,1],[3406,13,3406,30,1],[3407,13,3407,30,1],[3408,13,3408,30,1],[3409,13,3409,30,1],[3410,13,3410,30,1],[3411,13,3411,30,1],[3412,13,3412,30,1],[3413,13,3413,30,1],[3414,13,3414,30,1],[3415,13,3415,30,1],[3416,13,3416,30,1],[3417,13,3417,30,1],[3418,13,3418,30,1],[3419,13,3419,30,1],[3420,13,3420,30,1],[3421,13,3421,30,1],[3422,13,3422,30,1],[3423,13,3423,30,1],[3424,13,3424,30,1],[3425,13,3425,30,1],[3426,13,3426,30,1],[3427,13,3427,30,1],[3428,13,3428,30,1],[3429,13,3429,30,1],[3430,13,3430,30,1],[3431,13,3431,30,1],[3432,13,3432,30,1],[3433,13,3433,30,1],[3434,13,3434,30,1],[3435,13,3435,30,1],[3436,13,3436,30,1],[3437,13,3437,30,1],[3438,13,3438,30,1],[3439,13,3439,30,1],[3440,13,3440,30,1],[3441,13,3441,30,1],[3442,13,3442,30,1],[3443,13,3443,30,1],[3444,13,3444,30,1],[3445,13,3445,30,1],[3446,13,3446,30,1],[3447,13,3447,30,1],[3448,13,3448,30,1],[3449,13,3449,30,1],[3450,13,3450,30,1],[3451,13,3451,30,1],[3452,13,3452,30,1],[3453,13,3453,30,1],[3454,13,3454,30,1],[3455,13,3455,30,1],[3456,13,3456,30,1],[3457,13,3457,30,1],[3458,13,3458,30,1],[3459,13,3459,30,1],[3460,13,3460,30,1],[3461,13,3461,30,1],[3462,13,3462,30,1],[3463,13,3463,30,1],[3464,13,3464,30,1],[3465,13,3465,30,1],[3466,13,3466,30,1],[3467,13,3467,30,1],[3468,13,3468,30,1],[3469,13,3469,30,1],[3470,13,3470,30,1],[3471,13,3471,30,1],[3472,13,3472,30,1],[3473,13,3473,30,1],[3474,13,3474,30,1],[3475,13,3475,30,1],[3476,13,3476,30,1],[3477,13,3477,30,1],[3478,13,3478,30,1],[3479,13,3479,30,1],[3480,13,3480,30,1],[3481,13,3481,30,1],[3482,13,3482,30,1],[3483,13,3483,30,1],[3484,13,3484,30,1],[3485,13,3485,30,1],[3486,13,3486,30,1],[3487,13,3487,30,1],[3488,13,3488,30,1],[3489,13,3489,30,1],[3490,13,3490,30,1],[3491,13,3491,30,1],[3492,13,3492,30,1],[3493,13,3493,30,1],[3494,13,3494,30,1],[3495,13,3495,30,1],[3496,13,3496,30,1],[3497,13,3497,30,1],[3498,13,3498,30,1],[3499,13,3499,30,1],[3500,13,3500,30,1],[3501,13,3501,30,1],[3502,13,3502,30,1],[3503,13,3503,30,1],[3504,13,3504,30,1],[3505,13,3505,30,1],[3506,13,3506,30,1],[3507,13,3507,30,1],[3508,13,3508,30,1],[3509,13,3509,30,1],[3510,13,3510,30,1],[3511,13,3511,30,1],[3512,13,3512,30,1],[3513,13,3513,30,1],[3514,13,3514,30,1],[3515,13,3515,30,1],[3516,13,3516,30,1],[3517,13,3517,30,1],[3518,13,3518,30,1],[3519,13,3519,30,1],[3520,13,3520,30,1],[3521,13,3521,30,1],[3522,13,3522,30,1],[3523,13,3523,30,1],[3524,13,3524,30,1],[3525,13,3525,30,1],[3526,13,3526,30,1],[3527,13,3527,30,1],[3528,13,3528,30,1],[3529,13,3529,30,1],[3530,13,3530,30,1],[3531,13,3531,30,1],[3532,13,3532,30,1],[3533,13,3533,30,1],[3534,13,3534,30,1],[3535,13,3535,30,1],[3536,13,3536,30,1],[3537,13,3537,30,1],[3538,13,3538,30,1],[3539,13,3539,30,1],[3540,13,3540,30,1],[3541,13,3541,30,1],[3542,13,3542,30,1],[3543,13,3543,30,1],[3544,13,3544,30,1],[3545,13,3545,30,1],[3546,13,3546,30,1],[3547,13,3547,30,1],[3548,13,3548,30,1],[3549,13,3549,30,1],[3550,13,3550,30,1],[3551,13,3551,30,1],[3552,13,3552,30,1],[3553,13,3553,30,1],[3554,13,3554,30,1],[3555,13,3555,30,1],[3556,13,3556,30,1],[3557,13,3557,30,1],[3558,13,3558,30,1],[3559,13,3559,30,1],[3560,13,3560,30,1],[3561,13,3561,30,1],[3562,13,3562,30,1],[3563,13,3563,30,1],[3564,13,3564,30,1],[3565,13,3565,30,1],[3566,13,3566,30,1],[3567,13,3567,30,1],[3568,13,3568,30,1],[3569,13,3569,30,1],[3570,13,3570,30,1],[3571,13,3571,30,1],[3572,13,3572,30,1],[3573,13,3573,30,1],[3574,13,3574,30,1],[3575,13,3575,30,1],[3576,13,3576,30,1],[3577,13,3577,30,1],[3578,13,3578,30,1],[3579,13,3579,30,1],[3580,13,3580,30,1],[3581,13,3581,30,1],[3582,13,3582,30,1],[3583,13,3583,30,1],[3584,13,3584,30,1],[3585,13,3585,30,1],[3586,13,3586,30,1],[3587,13,3587,30,1],[3588,13,3588,30,1],[3589,13,3589,30,1],[3590,13,3590,30,1],[3591,13,3591,30,1],[3592,13,3592,30,1],[3593,13,3593,30,1],[3594,13,3594,30,1],[3595,13,3595,30,1],[3596,13,3596,30,1],[3597,13,3597,30,1],[3598,13,3598,30,1],[3599,13,3599,30,1],[3600,13,3600,30,1],[3601,13,3601,30,1],[3602,13,3602,30,1],[3603,13,3603,30,1],[3604,13,3604,30,1],[3605,13,3605,30,1],[3606,13,3606,30,1],[3607,13,3607,30,1],[3608,13,3608,30,1],[3609,13,3609,30,1],[3610,13,3610,30,1],[3611,13,3611,30,1],[3612,13,3612,30,1],[3613,13,3613,30,1],[3614,13,3614,30,1],[3615,13,3615,30,1],[3616,13,3616,30,1],[3617,13,3617,30,1],[3618,13,3618,30,1],[3619,13,3619,30,1],[3620,13,3620,30,1],[3621,13,3621,30,1],[3622,13,3622,30,1],[3623,13,3623,30,1],[3624,13,3624,30,1],[3625,13,3625,30,1],[3626,13,3626,30,1],[3627,13,3627,30,1],[3628,13,3628,30,1],[3629,13,3629,30,1],[3630,13,3630,30,1],[3631,13,3631,30,1],[3632,13,3632,30,1],[3633,13,3633,30,1],[3634,13,3634,30,1],[3635,13,3635,30,1],[3636,13,3636,30,1],[3637,13,3637,30,1],[3638,13,3638,30,1],[3639,13,3639,30,1],[3640,13,3640,30,1],[3641,13,3641,30,1],[3642,13,3642,30,1],[3643,13,3643,30,1],[3644,13,3644,30,1],[3645,13,3645,30,1],[3646,13,3646,30,1],[3647,13,3647,30,1],[3648,13,3648,30,1],[3649,13,3649,30,1],[3650,13,3650,30,1],[3651,13,3651,30,1],[3652,13,3652,30,1],[3653,13,3653,30,1],[3654,13,3654,30,1],[3655,13,3655,30,1],[3656,13,3656,30,1],[3657,13,3657,30,1],[3658,13,3658,30,1],[3659,13,3659,30,1],[3660,13,3660,30,1],[3661,13,3661,30,1],[3662,13,3662,30,1],[3663,13,3663,30,1],[3664,13,3664,30,1],[3665,13,3665,30,1],[3666,13,3666,30,1],[3667,13,3667,30,1],[3668,13,3668,30,1],[3669,13,3669,30,1],[3670,13,3670,30,1],[3671,13,3671,30,1],[3672,13,3672,30,1],[3673,13,3673,30,1],[3674,13,3674,30,1],[3675,13,3675,30,1],[3676,13,3676,30,1],[3677,13,3677,30,1],[3678,13,3678,30,1],[3679,13,3679,30,1],[3680,13,3680,30,1],[3681,13,3681,30,1],[3682,13,3682,30,1],[3683,13,3683,30,1],[3684,13,3684,30,1],[3685,13,3685,30,1],[3686,13,3686,30,1],[3687,13,3687,30,1],[3688,13,3688,30,1],[3689,13,3689,30,1],[3690,13,3690,30,1],[3691,13,3691,30,1],[3692,13,3692,30,1],[3693,13,3693,30,1],[3694,13,3694,30,1],[3695,13,3695,30,1],[3696,13,3696,30,1],[3697,13,3697,30,1],[3698,13,3698,30,1],[3699,13,3699,30,1],[3700,13,3700,30,1],[3701,13,3701,30,1],[3702,13,3702,30,1],[3703,13,3703,30,1],[3704,13,3704,30,1],[3705,13,3705,30,1],[3706,13,3706,30,1],[3707,13,3707,30,1],[3708,13,3708,30,1],[3709,13,3709,30,1],[3710,13,3710,30,1],[3711,13,3711,30,1],[3712,13,3712,30,1],[3713,13,3713,30,1],[3714,13,3714,30,1],[3715,13,3715,30,1],[3716,13,3716,30,1],[3717,13,3717,30,1],[3718,13,3718,30,1],[3719,13,3719,30,1],[3720,13,3720,30,1],[3721,13,3721,30,1],[3722,13,3722,30,1],[3723,13,3723,30,1],[3724,13,3724,30,1],[3725,13,3725,30,1],[3726,13,3726,30,1],[3727,13,3727,30,1],[3728,13,3728,30,1],[3729,13,3729,30,1],[3730,13,3730,30,1],[3731,13,3731,30,1],[3732,13,3732,30,1],[3733,13,3733,30,1],[3734,13,3734,30,1],[3735,13,3735,30,1],[3736,13,3736,30,1],[3737,13,3737,30,1],[3738,13,3738,30,1],[3739,13,3739,30,1],[3740,13,3740,30,1],[3741,13,3741,30,1],[3742,13,3742,30,1],[3743,13,3743,30,1],[3744,13,3744,30,1],[3745,13,3745,30,1],[3746,13,3746,30,1],[3747,13,3747,30,1],[3748,13,3748,30,1],[3749,13,3749,30,1],[3750,13,3750,30,1],[3751,13,3751,30,1],[3752,13,3752,30,1],[3753,13,3753,30,1],[3754,13,3754,30,1],[3755,13,3755,30,1],[3756,13,3756,30,1],[3757,13,3757,30,1],[3758,13,3758,30,1],[3759,13,3759,30,1],[3760,13,3760,30,1],[3761,13,3761,30,1],[3762,13,3762,30,1],[3763,13,3763,30,1],[3764,13,3764,30,1],[3765,13,3765,30,1],[3766,13,3766,30,1],[3767,13,3767,30,1],[3768,13,3768,30,1],[3769,13,3769,30,1],[3770,13,3770,30,1],[3771,13,3771,30,1],[3772,13,3772,30,1],[3773,13,3773,30,1],[3774,13,3774,30,1],[3775,13,3775,30,1],[3776,13,3776,30,1],[3777,13,3777,30,1],[3778,13,3778,30,1],[3779,13,3779,30,1],[3780,13,3780,30,1],[3781,13,3781,30,1],[3782,13,3782,30,1],[3783,13,3783,30,1],[3784,13,3784,30,1],[3785,13,3785,30,1],[3786,13,3786,30,1],[3787,13,3787,30,1],[3788,13,3788,30,1],[3789,13,3789,30,1],[3790,13,3790,30,1],[3791,13,3791,30,1],[3792,13,3792,30,1],[3793,13,3793,30,1],[3794,13,3794,30,1],[3795,13,3795,30,1],[3796,13,3796,30,1],[3797,13,3797,30,1],[3798,13,3798,30,1],[3799,13,3799,30,1],[3800,13,3800,30,1],[3801,13,3801,30,1],[3802,13,3802,30,1],[3803,13,3803,30,1],[3804,13,3804,30,1],[3805,13,3805,30,1],[3806,13,3806,30,1],[3807,13,3807,30,1],[3808,13,3808,30,1],[3809,13,3809,30,1],[3810,13,3810,30,1],[3811,13,3811,30,1],[3812,13,3812,30,1],[3813,13,3813,30,1],[3814,13,3814,30,1],[3815,13,3815,30,1],[3816,13,3816,30,1],[3817,13,3817,30,1],[3818,13,3818,30,1],[3819,13,3819,30,1],[3820,13,3820,30,1],[3821,13,3821,30,1],[3822,13,3822,30,1],[3823,13,3823,30,1],[3824,13,3824,30,1],[3825,13,3825,30,1],[3826,13,3826,30,1],[3827,13,3827,30,1],[3828,13,3828,30,1],[3829,13,3829,30,1],[3830,13,3830,30,1],[3831,13,3831,30,1],[3832,13,3832,30,1],[3833,13,3833,30,1],[3834,13,3834,30,1],[3835,13,3835,30,1],[3836,13,3836,30,1],[3837,13,3837,30,1],[3838,13,3838,30,1],[3839,13,3839,30,1],[3840,13,3840,30,1],[3841,13,3841,30,1],[3842,13,3842,30,1],[3843,13,3843,30,1],[3844,13,3844,30,1],[3845,13,3845,30,1],[3846,13,3846,30,1],[3847,13,3847,30,1],[3848,13,3848,30,1],[3849,13,3849,30,1],[3850,13,3850,30,1],[3851,13,3851,30,1],[3852,13,3852,30,1],[3853,13,3853,30,1],[3854,13,3854,30,1],[3855,13,3855,30,1],[3856,13,3856,30,1],[3857,13,3857,30,1],[3858,13,3858,30,1],[3859,13,3859,30,1],[3860,13,3860,30,1],[3861,13,3861,30,1],[3862,13,3862,30,1],[3863,13,3863,30,1],[3864,13,3864,30,1],[3865,13,3865,30,1],[3866,13,3866,30,1],[3867,13,3867,30,1],[3868,13,3868,30,1],[3869,13,3869,30,1],[3870,13,3870,30,1],[3871,13,3871,30,1],[3872,13,3872,30,1],[3873,13,3873,30,1],[3874,13,3874,30,1],[3875,13,3875,30,1],[3876,13,3876,30,1],[3877,13,3877,30,1],[3878,13,3878,30,1],[3879,13,3879,30,1],[3880,13,3880,30,1],[3881,13,3881,30,1],[3882,13,3882,30,1],[3883,13,3883,30,1],[3884,13,3884,30,1],[3885,13,3885,30,1],[3886,13,3886,30,1],[3887,13,3887,30,1],[3888,13,3888,30,1],[3889,13,3889,30,1],[3890,13,3890,30,1],[3891,13,3891,30,1],[3892,13,3892,30,1],[3893,13,3893,30,1],[3894,13,3894,30,1],[3895,13,3895,30,1],[3896,13,3896,30,1],[3897,13,3897,30,1],[3898,13,3898,30,1],[3899,13,3899,30,1],[3900,13,3900,30,1],[3901,13,3901,30,1],[3902,13,3902,30,1],[3903,13,3903,30,1],[3904,13,3904,30,1],[3905,13,3905,30,1],[3906,13,3906,30,1],[3907,13,3907,30,1],[3908,13,3908,30,1],[3909,13,3909,30,1],[3910,13,3910,30,1],[3911,13,3911,30,1],[3912,13,3912,30,1],[3913,13,3913,30,1],[3914,13,3914,30,1],[3915,13,3915,30,1],[3916,13,3916,30,1],[3917,13,3917,30,1],[3918,13,3918,30,1],[3919,13,3919,30,1],[3920,13,3920,30,1],[3921,13,3921,30,1],[3922,13,3922,30,1],[3923,13,3923,30,1],[3924,13,3924,30,1],[3925,13,3925,30,1],[3926,13,3926,30,1],[3927,13,3927,30,1],[3928,13,3928,30,1],[3929,13,3929,30,1],[3930,13,3930,30,1],[3931,13,3931,30,1],[3932,13,3932,30,1],[3933,13,3933,30,1],[3934,13,3934,30,1],[3935,13,3935,30,1],[3936,13,3936,30,1],[3937,13,3937,30,1],[3938,13,3938,30,1],[3939,13,3939,30,1],[3940,13,3940,30,1],[3941,13,3941,30,1],[3942,13,3942,30,1],[3943,13,3943,30,1],[3944,13,3944,30,1],[3945,13,3945,30,1],[3946,13,3946,30,1],[3947,13,3947,30,1],[3948,13,3948,30,1],[3949,13,3949,30,1],[3950,13,3950,30,1],[3951,13,3951,30,1],[3952,13,3952,30,1],[3953,13,3953,30,1],[3954,13,3954,30,1],[3955,13,3955,30,1],[3956,13,3956,30,1],[3957,13,3957,30,1],[3958,13,3958,30,1],[3959,13,3959,30,1],[3960,13,3960,30,1],[3961,13,3961,30,1],[3962,13,3962,30,1],[3963,13,3963,30,1],[3964,13,3964,30,1],[3965,13,3965,30,1],[3966,13,3966,30,1],[3967,13,3967,30,1],[3968,13,3968,30,1],[3969,13,3969,30,1],[3970,13,3970,30,1],[3971,13,3971,30,1],[3972,13,3972,30,1],[3973,13,3973,30,1],[3974,13,3974,30,1],[3975,13,3975,30,1],[3976,13,3976,30,1],[3977,13,3977,30,1],[3978,13,3978,30,1],[3979,13,3979,30,1],[3980,13,3980,30,1],[3981,13,3981,30,1],[3982,13,3982,30,1],[3983,13,3983,30,1],[3984,13,3984,30,1],[3985,13,3985,30,1],[3986,13,3986,30,1],[3987,13,3987,30,1],[3988,13,3988,30,1],[3989,13,3989,30,1],[3990,13,3990,30,1],[3991,13,3991,30,1],[3992,13,3992,30,1],[3993,13,3993,30,1],[3994,13,3994,30,1],[3995,13,3995,30,1],[3996,13,3996,30,1],[3997,13,3997,30,1],[3998,13,3998,30,1],[3999,13,3999,30,1],[4000,13,4000,30,1],[4001,13,4001,30,1],[4002,13,4002,30,1],[4003,13,4003,30,1],[4004,13,4004,30,1],[4005,13,4005,30,1],[4006,13,4006,30,1],[4007,13,4007,30,1],[4008,13,4008,30,1],[4009,13,4009,30,1],[4010,13,4010,30,1],[4011,13,4011,30,1],[4012,13,4012,30,1],[4013,13,4013,30,1],[4014,13,4014,30,1],[4015,13,4015,30,1],[4016,13,4016,30,1],[4017,13,4017,30,1],[4018,13,4018,30,1],[4019,13,4019,30,1],[4020,13,4020,30,1],[4021,13,4021,30,1],[4022,13,4022,30,1],[4023,13,4023,30,1],[4024,13,4024,30,1],[4025,13,4025,30,1],[4026,13,4026,30,1],[4027,13,4027,30,1],[4028,13,4028,30,1],[4029,13,4029,30,1],[4030,13,4030,30,1],[4031,13,4031,30,1],[4032,13,4032,30,1],[4033,13,4033,30,1],[4034,13,4034,30,1],[4035,13,4035,30,1],[4036,13,4036,30,1],[4037,13,4037,30,1],[4038,13,4038,30,1],[4039,13,4039,30,1],[4040,13,4040,30,1],[4041,13,4041,30,1],[4042,13,4042,30,1],[4043,13,4043,30,1],[4044,13,4044,30,1],[4045,13,4045,30,1],[4046,13,4046,30,1],[4047,13,4047,30,1],[4048,13,4048,30,1],[4049,13,4049,30,1],[4050,13,4050,30,1],[4051,13,4051,30,1],[4052,13,4052,30,1],[4053,13,4053,30,1],[4054,13,4054,30,1],[4055,13,4055,30,1],[4056,13,4056,30,1],[4057,13,4057,30,1],[4058,13,4058,30,1],[4059,13,4059,30,1],[4060,13,4060,30,1],[4061,13,4061,30,1],[4062,13,4062,30,1],[4063,13,4063,30,1],[4064,13,4064,30,1],[4065,13,4065,30,1],[4066,13,4066,30,1],[4067,13,4067,30,1],[4068,13,4068,30,1],[4069,13,4069,30,1],[4070,13,4070,30,1],[4071,13,4071,30,1],[4072,13,4072,30,1],[4073,13,4073,30,1],[4074,13,4074,30,1],[4075,13,4075,30,1],[4076,13,4076,30,1],[4077,13,4077,30,1],[4078,13,4078,30,1],[4079,13,4079,30,1],[4080,13,4080,30,1],[4081,13,4081,30,1],[4082,13,4082,30,1],[4083,13,4083,30,1],[4084,13,4084,30,1],[4085,13,4085,30,1],[4086,13,4086,30,1],[4087,13,4087,30,1],[4088,13,4088,30,1],[4089,13,4089,30,1],[4090,13,4090,30,1],[4091,13,4091,30,1],[4092,13,4092,30,1],[4093,13,4093,30,1],[4094,13,4094,30,1],[4095,13,4095,30,1],[4096,13,4096,30,1],[4097,13,4097,30,1],[4098,13,4098,30,1],[4099,13,4099,30,1],[4100,13,4100,30,1],[4101,13,4101,30,1],[4102,13,4102,30,1],[4103,13,4103,30,1],[4104,13,4104,30,1],[4105,13,4105,30,1],[4106,13,4106,30,1],[4107,13,4107,30,1],[4108,13,4108,30,1],[4109,13,4109,30,1],[4110,13,4110,30,1],[4111,13,4111,30,1],[4112,13,4112,30,1],[4113,13,4113,30,1],[4114,13,4114,30,1],[4115,13,4115,30,1],[4116,13,4116,30,1],[4117,13,4117,30,1],[4118,13,4118,30,1],[4119,13,4119,30,1],[4120,13,4120,30,1],[4121,13,4121,30,1],[4122,13,4122,30,1],[4123,13,4123,30,1],[4124,13,4124,30,1],[4125,13,4125,30,1],[4126,13,4126,30,1],[4127,13,4127,30,1],[4128,13,4128,30,1],[4129,13,4129,30,1],[4130,13,4130,30,1],[4131,13,4131,30,1],[4132,13,4132,30,1],[4133,13,4133,30,1],[4134,13,4134,30,1],[4135,13,4135,30,1],[4136,13,4136,30,1],[4137,13,4137,30,1],[4138,13,4138,30,1],[4139,13,4139,30,1],[4140,13,4140,30,1],[4141,13,4141,30,1],[4142,13,4142,30,1],[4143,13,4143,30,1],[4144,13,4144,30,1],[4145,13,4145,30,1],[4146,13,4146,30,1],[4147,13,4147,30,1],[4148,13,4148,30,1],[4149,13,4149,30,1],[4150,13,4150,30,1],[4151,13,4151,30,1],[4152,13,4152,30,1],[4153,13,4153,30,1],[4154,13,4154,30,1],[4155,13,4155,30,1],[4156,13,4156,30,1],[4157,13,4157,30,1],[4158,13,4158,30,1],[4159,13,4159,30,1],[4160,13,4160,30,1],[4161,13,4161,30,1],[4162,13,4162,30,1],[4163,13,4163,30,1],[4164,13,4164,30,1],[4165,13,4165,30,1],[4166,13,4166,30,1],[4167,13,4167,30,1],[4168,13,4168,30,1],[4169,13,4169,30,1],[4170,13,4170,30,1],[4171,13,4171,30,1],[4172,13,4172,30,1],[4173,13,4173,30,1],[4174,13,4174,30,1],[4175,13,4175,30,1],[4176,13,4176,30,1],[4177,13,4177,30,1],[4178,13,4178,30,1],[4179,13,4179,30,1],[4180,13,4180,30,1],[4181,13,4181,30,1],[4182,13,4182,30,1],[4183,13,4183,30,1],[4184,13,4184,30,1],[4185,13,4185,30,1],[4186,13,4186,30,1],[4187,13,4187,30,1],[4188,13,4188,30,1],[4189,13,4189,30,1],[4190,13,4190,30,1],[4191,13,4191,30,1],[4192,13,4192,30,1],[4193,13,4193,30,1],[4194,13,4194,30,1],[4195,13,4195,30,1],[4196,13,4196,30,1],[4197,13,4197,30,1],[4198,13,4198,30,1],[4199,13,4199,30,1],[4200,13,4200,30,1],[4201,13,4201,30,1],[4202,13,4202,30,1],[4203,13,4203,30,1],[4204,13,4204,30,1],[4205,13,4205,30,1],[4206,13,4206,30,1],[4207,13,4207,30,1],[4208,13,4208,30,1],[4209,13,4209,30,1],[4210,13,4210,30,1],[4211,13,4211,30,1],[4212,13,4212,30,1],[4213,13,4213,30,1],[4214,13,4214,30,1],[4215,13,4215,30,1],[4216,13,4216,30,1],[4217,13,4217,30,1],[4218,13,4218,30,1],[4219,13,4219,30,1],[4220,13,4220,30,1],[4221,13,4221,30,1],[4222,13,4222,30,1],[4223,13,4223,30,1],[4224,13,4224,30,1],[4225,13,4225,30,1],[4226,13,4226,30,1],[4227,13,4227,30,1],[4228,13,4228,30,1],[4229,13,4229,30,1],[4230,13,4230,30,1],[4231,13,4231,30,1],[4232,13,4232,30,1],[4233,13,4233,30,1],[4234,13,4234,30,1],[4235,13,4235,30,1],[4236,13,4236,30,1],[4237,13,4237,30,1],[4238,13,4238,30,1],[4239,13,4239,30,1],[4240,13,4240,30,1],[4241,13,4241,30,1],[4242,13,4242,30,1],[4243,13,4243,30,1],[4244,13,4244,30,1],[4245,13,4245,30,1],[4246,13,4246,30,1],[4247,13,4247,30,1],[4248,13,4248,30,1],[4249,13,4249,30,1],[4250,13,4250,30,1],[4251,13,4251,30,1],[4252,13,4252,30,1],[4253,13,4253,30,1],[4254,13,4254,30,1],[4255,13,4255,30,1],[4256,13,4256,30,1],[4257,13,4257,30,1],[4258,13,4258,30,1],[4259,13,4259,30,1],[4260,13,4260,30,1],[4261,13,4261,30,1],[4262,13,4262,30,1],[4263,13,4263,30,1],[4264,13,4264,30,1],[4265,13,4265,30,1],[4266,13,4266,30,1],[4267,13,4267,30,1],[4268,13,4268,30,1],[4269,13,4269,30,1],[4270,13,4270,30,1],[4271,13,4271,30,1],[4272,13,4272,30,1],[4273,13,4273,30,1],[4274,13,4274,30,1],[4275,13,4275,30,1],[4276,13,4276,30,1],[4277,13,4277,30,1],[4278,13,4278,30,1],[4279,13,4279,30,1],[4280,13,4280,30,1],[4281,13,4281,30,1],[4282,13,4282,30,1],[4283,13,4283,30,1],[4284,13,4284,30,1],[4285,13,4285,30,1],[4286,13,4286,30,1],[4287,13,4287,30,1],[4288,13,4288,30,1],[4289,13,4289,30,1],[4290,13,4290,30,1],[4291,13,4291,30,1],[4292,13,4292,30,1],[4293,13,4293,30,1],[4294,13,4294,30,1],[4295,13,4295,30,1],[4296,13,4296,30,1],[4297,13,4297,30,1],[4298,13,4298,30,1],[4299,13,4299,30,1],[4300,13,4300,30,1],[4301,13,4301,30,1],[4302,13,4302,30,1],[4303,13,4303,30,1],[4304,13,4304,30,1],[4305,13,4305,30,1],[4306,13,4306,30,1],[4307,13,4307,30,1],[4308,13,4308,30,1],[4309,13,4309,30,1],[4310,13,4310,30,1],[4311,13,4311,30,1],[4312,13,4312,30,1],[4313,13,4313,30,1],[4314,13,4314,30,1],[4315,13,4315,30,1],[4316,13,4316,30,1],[4317,13,4317,30,1],[4318,13,4318,30,1],[4319,13,4319,30,1],[4320,13,4320,30,1],[4321,13,4321,30,1],[4322,13,4322,30,1],[4323,13,4323,30,1],[4324,13,4324,30,1],[4325,13,4325,30,1],[4326,13,4326,30,1],[4327,13,4327,30,1],[4328,13,4328,30,1],[4329,13,4329,30,1],[4330,13,4330,30,1],[4331,13,4331,30,1],[4332,13,4332,30,1],[4333,13,4333,30,1],[4334,13,4334,30,1],[4335,13,4335,30,1],[4336,13,4336,30,1],[4337,13,4337,30,1],[4338,13,4338,30,1],[4339,13,4339,30,1],[4340,13,4340,30,1],[4341,13,4341,30,1],[4342,13,4342,30,1],[4343,13,4343,30,1],[4344,13,4344,30,1],[4345,13,4345,30,1],[4346,13,4346,30,1],[4347,13,4347,30,1],[4348,13,4348,30,1],[4349,13,4349,30,1],[4350,13,4350,30,1],[4351,13,4351,30,1],[4352,13,4352,30,1],[4353,13,4353,30,1],[4354,13,4354,30,1],[4355,13,4355,30,1],[4356,13,4356,30,1],[4357,13,4357,30,1],[4358,13,4358,30,1],[4359,13,4359,30,1],[4360,13,4360,30,1],[4361,13,4361,30,1],[4362,13,4362,30,1],[4363,13,4363,30,1],[4364,13,4364,30,1],[4365,13,4365,30,1],[4366,13,4366,30,1],[4367,13,4367,30,1],[4368,13,4368,30,1],[4369,13,4369,30,1],[4370,13,4370,30,1],[4371,13,4371,30,1],[4372,13,4372,30,1],[4373,13,4373,30,1],[4374,13,4374,30,1],[4375,13,4375,30,1],[4376,13,4376,30,1],[4377,13,4377,30,1],[4378,13,4378,30,1],[4379,13,4379,30,1],[4380,13,4380,30,1],[4381,13,4381,30,1],[4382,13,4382,30,1],[4383,13,4383,30,1],[4384,13,4384,30,1],[4385,13,4385,30,1],[4386,13,4386,30,1],[4387,13,4387,30,1],[4388,13,4388,30,1],[4389,13,4389,30,1],[4390,13,4390,30,1],[4391,13,4391,30,1],[4392,13,4392,30,1],[4393,13,4393,30,1],[4394,13,4394,30,1],[4395,13,4395,30,1],[4396,13,4396,30,1],[4397,13,4397,30,1],[4398,13,4398,30,1],[4399,13,4399,30,1],[4400,13,4400,30,1],[4401,13,4401,30,1],[4402,13,4402,30,1],[4403,13,4403,30,1],[4404,13,4404,30,1],[4405,13,4405,30,1],[4406,13,4406,30,1],[4407,13,4407,30,1],[4408,13,4408,30,1],[4409,13,4409,30,1],[4410,13,4410,30,1],[4411,13,4411,30,1],[4412,13,4412,30,1],[4413,13,4413,30,1],[4414,13,4414,30,1],[4415,13,4415,30,1],[4416,13,4416,30,1],[4417,13,4417,30,1],[4418,13,4418,30,1],[4419,13,4419,30,1],[4420,13,4420,30,1],[4421,13,4421,30,1],[4422,13,4422,30,1],[4423,13,4423,30,1],[4424,13,4424,30,1],[4425,13,4425,30,1],[4426,13,4426,30,1],[4427,13,4427,30,1],[4428,13,4428,30,1],[4429,13,4429,30,1],[4430,13,4430,30,1],[4431,13,4431,30,1],[4432,13,4432,30,1],[4433,13,4433,30,1],[4434,13,4434,30,1],[4435,13,4435,30,1],[4436,13,4436,30,1],[4437,13,4437,30,1],[4438,13,4438,30,1],[4439,13,4439,30,1],[4440,13,4440,30,1],[4441,13,4441,30,1],[4442,13,4442,30,1],[4443,13,4443,30,1],[4444,13,4444,30,1],[4445,13,4445,30,1],[4446,13,4446,30,1],[4447,13,4447,30,1],[4448,13,4448,30,1],[4449,13,4449,30,1],[4450,13,4450,30,1],[4451,13,4451,30,1],[4452,13,4452,30,1],[4453,13,4453,30,1],[4454,13,4454,30,1],[4455,13,4455,30,1],[4456,13,4456,30,1],[4457,13,4457,30,1],[4458,13,4458,30,1],[4459,13,4459,30,1],[4460,13,4460,30,1],[4461,13,4461,30,1],[4462,13,4462,30,1],[4463,13,4463,30,1],[4464,13,4464,30,1],[4465,13,4465,30,1],[4466,13,4466,30,1],[4467,13,4467,30,1],[4468,13,4468,30,1],[4469,13,4469,30,1],[4470,13,4470,30,1],[4471,13,4471,30,1],[4472,13,4472,30,1],[4473,13,4473,30,1],[4474,13,4474,30,1],[4475,13,4475,30,1],[4476,13,4476,30,1],[4477,13,4477,30,1],[4478,13,4478,30,1],[4479,13,4479,30,1],[4480,13,4480,30,1],[4481,13,4481,30,1],[4482,13,4482,30,1],[4483,13,4483,30,1],[4484,13,4484,30,1],[4485,13,4485,30,1],[4486,13,4486,30,1],[4487,13,4487,30,1],[4488,13,4488,30,1],[4489,13,4489,30,1],[4490,13,4490,30,1],[4491,13,4491,30,1],[4492,13,4492,30,1],[4493,13,4493,30,1],[4494,13,4494,30,1],[4495,13,4495,30,1],[4496,13,4496,30,1],[4497,13,4497,30,1],[4498,13,4498,30,1],[4499,13,4499,30,1],[4500,13,4500,30,1],[4501,13,4501,30,1],[4502,13,4502,30,1],[4503,13,4503,30,1],[4504,13,4504,30,1],[4505,13,4505,30,1],[4506,13,4506,30,1],[4507,13,4507,30,1],[4508,13,4508,30,1],[4509,13,4509,30,1],[4510,13,4510,30,1],[4511,13,4511,30,1],[4512,13,4512,30,1],[4513,13,4513,30,1],[4514,13,4514,30,1],[4515,13,4515,30,1],[4516,13,4516,30,1],[4517,13,4517,30,1],[4518,13,4518,30,1],[4519,13,4519,30,1],[4520,13,4520,30,1],[4521,13,4521,30,1],[4522,13,4522,30,1],[4523,13,4523,30,1],[4524,13,4524,30,1],[4525,13,4525,30,1],[4526,13,4526,30,1],[4527,13,4527,30,1],[4528,13,4528,30,1],[4529,13,4529,30,1],[4530,13,4530,30,1],[4531,13,4531,30,1],[4532,13,4532,30,1],[4533,13,4533,30,1],[4534,13,4534,30,1],[4535,13,4535,30,1],[4536,13,4536,30,1],[4537,13,4537,30,1],[4538,13,4538,30,1],[4539,13,4539,30,1],[4540,13,4540,30,1],[4541,13,4541,30,1],[4542,13,4542,30,1],[4543,13,4543,30,1],[4544,13,4544,30,1],[4545,13,4545,30,1],[4546,13,4546,30,1],[4547,13,4547,30,1],[4548,13,4548,30,1],[4549,13,4549,30,1],[4550,13,4550,30,1],[4551,13,4551,30,1],[4552,13,4552,30,1],[4553,13,4553,30,1],[4554,13,4554,30,1],[4555,13,4555,30,1],[4556,13,4556,30,1],[4557,13,4557,30,1],[4558,13,4558,30,1],[4559,13,4559,30,1],[4560,13,4560,30,1],[4561,13,4561,30,1],[4562,13,4562,30,1],[4563,13,4563,30,1],[4564,13,4564,30,1],[4565,13,4565,30,1],[4566,13,4566,30,1],[4567,13,4567,30,1],[4568,13,4568,30,1],[4569,13,4569,30,1],[4570,13,4570,30,1],[4571,13,4571,30,1],[4572,13,4572,30,1],[4573,13,4573,30,1],[4574,13,4574,30,1],[4575,13,4575,30,1],[4576,13,4576,30,1],[4577,13,4577,30,1],[4578,13,4578,30,1],[4579,13,4579,30,1],[4580,13,4580,30,1],[4581,13,4581,30,1],[4582,13,4582,30,1],[4583,13,4583,30,1],[4584,13,4584,30,1],[4585,13,4585,30,1],[4586,13,4586,30,1],[4587,13,4587,30,1],[4588,13,4588,30,1],[4589,13,4589,30,1],[4590,13,4590,30,1],[4591,13,4591,30,1],[4592,13,4592,30,1],[4593,13,4593,30,1],[4594,13,4594,30,1],[4595,13,4595,30,1],[4596,13,4596,30,1],[4597,13,4597,30,1],[4598,13,4598,30,1],[4599,13,4599,30,1],[4600,13,4600,30,1],[4601,13,4601,30,1],[4602,13,4602,30,1],[4603,13,4603,30,1],[4604,13,4604,30,1],[4605,13,4605,30,1],[4606,13,4606,30,1],[4607,13,4607,30,1],[4608,13,4608,30,1],[4609,13,4609,30,1],[4610,13,4610,30,1],[4611,13,4611,30,1],[4612,13,4612,30,1],[4613,13,4613,30,1],[4614,13,4614,30,1],[4615,13,4615,30,1],[4616,13,4616,30,1],[4617,13,4617,30,1],[4618,13,4618,30,1],[4619,13,4619,30,1],[4620,13,4620,30,1],[4621,13,4621,30,1],[4622,13,4622,30,1],[4623,13,4623,30,1],[4624,13,4624,30,1],[4625,13,4625,30,1],[4626,13,4626,30,1],[4627,13,4627,30,1],[4628,13,4628,30,1],[4629,13,4629,30,1],[4630,13,4630,30,1],[4631,13,4631,30,1],[4632,13,4632,30,1],[4633,13,4633,30,1],[4634,13,4634,30,1],[4635,13,4635,30,1],[4636,13,4636,30,1],[4637,13,4637,30,1],[4638,13,4638,30,1],[4639,13,4639,30,1],[4640,13,4640,30,1],[4641,13,4641,30,1],[4642,13,4642,30,1],[4643,13,4643,30,1],[4644,13,4644,30,1],[4645,13,4645,30,1],[4646,13,4646,30,1],[4647,13,4647,30,1],[4648,13,4648,30,1],[4649,13,4649,30,1],[4650,13,4650,30,1],[4651,13,4651,30,1],[4652,13,4652,30,1],[4653,13,4653,30,1],[4654,13,4654,30,1],[4655,13,4655,30,1],[4656,13,4656,30,1],[4657,13,4657,30,1],[4658,13,4658,30,1],[4659,13,4659,30,1],[4660,13,4660,30,1],[4661,13,4661,30,1],[4662,13,4662,30,1],[4663,13,4663,30,1],[4664,13,4664,30,1],[4665,13,4665,30,1],[4666,13,4666,30,1],[4667,13,4667,30,1],[4668,13,4668,30,1],[4669,13,4669,30,1],[4670,13,4670,30,1],[4671,13,4671,30,1],[4672,13,4672,30,1],[4673,13,4673,30,1],[4674,13,4674,30,1],[4675,13,4675,30,1],[4676,13,4676,30,1],[4677,13,4677,30,1],[4678,13,4678,30,1],[4679,13,4679,30,1],[4680,13,4680,30,1],[4681,13,4681,30,1],[4682,13,4682,30,1],[4683,13,4683,30,1],[4684,13,4684,30,1],[4685,13,4685,30,1],[4686,13,4686,30,1],[4687,13,4687,30,1],[4688,13,4688,30,1],[4689,13,4689,30,1],[4690,13,4690,30,1],[4691,13,4691,30,1],[4692,13,4692,30,1],[4693,13,4693,30,1],[4694,13,4694,30,1],[4695,13,4695,30,1],[4696,13,4696,30,1],[4697,13,4697,30,1],[4698,13,4698,30,1],[4699,13,4699,30,1],[4700,13,4700,30,1],[4701,13,4701,30,1],[4702,13,4702,30,1],[4703,13,4703,30,1],[4704,13,4704,30,1],[4705,13,4705,30,1],[4706,13,4706,30,1],[4707,13,4707,30,1],[4708,13,4708,30,1],[4709,13,4709,30,1],[4710,13,4710,30,1],[4711,13,4711,30,1],[4712,13,4712,30,1],[4713,13,4713,30,1],[4714,13,4714,30,1],[4715,13,4715,30,1],[4716,13,4716,30,1],[4717,13,4717,30,1],[4718,13,4718,30,1],[4719,13,4719,30,1],[4720,13,4720,30,1],[4721,13,4721,30,1],[4722,13,4722,30,1],[4723,13,4723,30,1],[4724,13,4724,30,1],[4725,13,4725,30,1],[4726,13,4726,30,1],[4727,13,4727,30,1],[4728,13,4728,30,1],[4729,13,4729,30,1],[4730,13,4730,30,1],[4731,13,4731,30,1],[4732,13,4732,30,1],[4733,13,4733,30,1],[4734,13,4734,30,1],[4735,13,4735,30,1],[4736,13,4736,30,1],[4737,13,4737,30,1],[4738,13,4738,30,1],[4739,13,4739,30,1],[4740,13,4740,30,1],[4741,13,4741,30,1],[4742,13,4742,30,1],[4743,13,4743,30,1],[4744,13,4744,30,1],[4745,13,4745,30,1],[4746,13,4746,30,1],[4747,13,4747,30,1],[4748,13,4748,30,1],[4749,13,4749,30,1],[4750,13,4750,30,1],[4751,13,4751,30,1],[4752,13,4752,30,1],[4753,13,4753,30,1],[4754,13,4754,30,1],[4755,13,4755,30,1],[4756,13,4756,30,1],[4757,13,4757,30,1],[4758,13,4758,30,1],[4759,13,4759,30,1],[4760,13,4760,30,1],[4761,13,4761,30,1],[4762,13,4762,30,1],[4763,13,4763,30,1],[4764,13,4764,30,1],[4765,13,4765,30,1],[4766,13,4766,30,1],[4767,13,4767,30,1],[4768,13,4768,30,1],[4769,13,4769,30,1],[4770,13,4770,30,1],[4771,13,4771,30,1],[4772,13,4772,30,1],[4773,13,4773,30,1],[4774,13,4774,30,1],[4775,13,4775,30,1],[4776,13,4776,30,1],[4777,13,4777,30,1],[4778,13,4778,30,1],[4779,13,4779,30,1],[4780,13,4780,30,1],[4781,13,4781,30,1],[4782,13,4782,30,1],[4783,13,4783,30,1],[4784,13,4784,30,1],[4785,13,4785,30,1],[4786,13,4786,30,1],[4787,13,4787,30,1],[4788,13,4788,30,1],[4789,13,4789,30,1],[4790,13,4790,30,1],[4791,13,4791,30,1],[4792,13,4792,30,1],[4793,13,4793,30,1],[4794,13,4794,30,1],[4795,13,4795,30,1],[4796,13,4796,30,1],[4797,13,4797,30,1],[4798,13,4798,30,1],[4799,13,4799,30,1],[4800,13,4800,30,1],[4801,13,4801,30,1],[4802,13,4802,30,1],[4803,13,4803,30,1],[4804,13,4804,30,1],[4805,13,4805,30,1],[4806,13,4806,30,1],[4807,13,4807,30,1],[4808,13,4808,30,1],[4809,13,4809,30,1],[4810,13,4810,30,1],[4811,13,4811,30,1],[4812,13,4812,30,1],[4813,13,4813,30,1],[4814,13,4814,30,1],[4815,13,4815,30,1],[4816,13,4816,30,1],[4817,13,4817,30,1],[4818,13,4818,30,1],[4819,13,4819,30,1],[4820,13,4820,30,1],[4821,13,4821,30,1],[4822,13,4822,30,1],[4823,13,4823,30,1],[4824,13,4824,30,1],[4825,13,4825,30,1],[4826,13,4826,30,1],[4827,13,4827,30,1],[4828,13,4828,30,1],[4829,13,4829,30,1],[4830,13,4830,30,1],[4831,13,4831,30,1],[4832,13,4832,30,1],[4833,13,4833,30,1],[4834,13,4834,30,1],[4835,13,4835,30,1],[4836,13,4836,30,1],[4837,13,4837,30,1],[4838,13,4838,30,1],[4839,13,4839,30,1],[4840,13,4840,30,1],[4841,13,4841,30,1],[4842,13,4842,30,1],[4843,13,4843,30,1],[4844,13,4844,30,1],[4845,13,4845,30,1],[4846,13,4846,30,1],[4847,13,4847,30,1],[4848,13,4848,30,1],[4849,13,4849,30,1],[4850,13,4850,30,1],[4851,13,4851,30,1],[4852,13,4852,30,1],[4853,13,4853,30,1],[4854,13,4854,30,1],[4855,13,4855,30,1],[4856,13,4856,30,1],[4857,13,4857,30,1],[4858,13,4858,30,1],[4859,13,4859,30,1],[4860,13,4860,30,1],[4861,13,4861,30,1],[4862,13,4862,30,1],[4863,13,4863,30,1],[4864,13,4864,30,1],[4865,13,4865,30,1],[4866,13,4866,30,1],[4867,13,4867,30,1],[4868,13,4868,30,1],[4869,13,4869,30,1],[4870,13,4870,30,1],[4871,13,4871,30,1],[4872,13,4872,30,1],[4873,13,4873,30,1],[4874,13,4874,30,1],[4875,13,4875,30,1],[4876,13,4876,30,1],[4877,13,4877,30,1],[4878,13,4878,30,1],[4879,13,4879,30,1],[4880,13,4880,30,1],[4881,13,4881,30,1],[4882,13,4882,30,1],[4883,13,4883,30,1],[4884,13,4884,30,1],[4885,13,4885,30,1],[4886,13,4886,30,1],[4887,13,4887,30,1],[4888,13,4888,30,1],[4889,13,4889,30,1],[4890,13,4890,30,1],[4891,13,4891,30,1],[4892,13,4892,30,1],[4893,13,4893,30,1],[4894,13,4894,30,1],[4895,13,4895,30,1],[4896,13,4896,30,1],[4897,13,4897,30,1],[4898,13,4898,30,1],[4899,13,4899,30,1],[4900,13,4900,30,1],[4901,13,4901,30,1],[4902,13,4902,30,1],[4903,13,4903,30,1],[4904,13,4904,30,1],[4905,13,4905,30,1],[4906,13,4906,30,1],[4907,13,4907,30,1],[4908,13,4908,30,1],[4909,13,4909,30,1],[4910,13,4910,30,1],[4911,13,4911,30,1],[4912,13,4912,30,1],[4913,13,4913,30,1],[4914,13,4914,30,1],[4915,13,4915,30,1],[4916,13,4916,30,1],[4917,13,4917,30,1],[4918,13,4918,30,1],[4919,13,4919,30,1],[4920,13,4920,30,1],[4921,13,4921,30,1],[4922,13,4922,30,1],[4923,13,4923,30,1],[4924,13,4924,30,1],[4925,13,4925,30,1],[4926,13,4926,30,1],[4927,13,4927,30,1],[4928,13,4928,30,1],[4929,13,4929,30,1],[4930,13,4930,30,1],[4931,13,4931,30,1],[4932,13,4932,30,1],[4933,13,4933,30,1],[4934,13,4934,30,1],[4935,13,4935,30,1],[4936,13,4936,30,1],[4937,13,4937,30,1],[4938,13,4938,30,1],[4939,13,4939,30,1],[4940,13,4940,30,1],[4941,13,4941,30,1],[4942,13,4942,30,1],[4943,13,4943,30,1],[4944,13,4944,30,1],[4945,13,4945,30,1],[4946,13,4946,30,1],[4947,13,4947,30,1],[4948,13,4948,30,1],[4949,13,4949,30,1],[4950,13,4950,30,1],[4951,13,4951,30,1],[4952,13,4952,30,1],[4953,13,4953,30,1],[4954,13,4954,30,1],[4955,13,4955,30,1],[4956,13,4956,30,1],[4957,13,4957,30,1],[4958,13,4958,30,1],[4959,13,4959,30,1],[4960,13,4960,30,1],[4961,13,4961,30,1],[4962,13,4962,30,1],[4963,13,4963,30,1],[4964,13,4964,30,1],[4965,13,4965,30,1],[4966,13,4966,30,1],[4967,13,4967,30,1],[4968,13,4968,30,1],[4969,13,4969,30,1],[4970,13,4970,30,1],[4971,13,4971,30,1],[4972,13,4972,30,1],[4973,13,4973,30,1],[4974,13,4974,30,1],[4975,13,4975,30,1],[4976,13,4976,30,1],[4977,13,4977,30,1],[4978,13,4978,30,1],[4979,13,4979,30,1],[4980,13,4980,30,1],[4981,13,4981,30,1],[4982,13,4982,30,1],[4983,13,4983,30,1],[4984,13,4984,30,1],[4985,13,4985,30,1],[4986,13,4986,30,1],[4987,13,4987,30,1],[4988,13,4988,30,1],[4989,13,4989,30,1],[4990,13,4990,30,1],[4991,13,4991,30,1],[4992,13,4992,30,1],[4993,13,4993,30,1],[4994,13,4994,30,1],[4995,13,4995,30,1],[4996,13,4996,30,1],[4997,13,4997,30,1],[4998,13,4998,30,1],[4999,13,4999,30,1],[5000,13,5000,30,1],[5001,13,5001,30,1],[5002,13,5002,30,1],[5003,13,5003,30,1],[5004,13,5004,30,1],[5005,13,5005,30,1],[5006,13,5006,30,1],[5007,13,5007,30,1],[5008,13,5008,30,1],[5009,13,5009,30,1],[5010,13,5010,30,1],[5011,13,5011,30,1],[5012,13,5012,30,1],[5013,13,5013,30,1],[5014,13,5014,30,1],[5015,13,5015,30,1],[5016,13,5016,30,1],[5017,13,5017,30,1],[5018,13,5018,30,1],[5019,13,5019,30,1],[5020,13,5020,30,1],[5021,13,5021,30,1],[5022,13,5022,30,1],[5023,13,5023,30,1],[5024,13,5024,30,1],[5025,13,5025,30,1],[5026,13,5026,30,1],[5027,13,5027,30,1],[5028,13,5028,30,1],[5029,13,5029,30,1],[5030,13,5030,30,1],[5031,13,5031,30,1],[5032,13,5032,30,1],[5033,13,5033,30,1],[5034,13,5034,30,1],[5035,13,5035,30,1],[5036,13,5036,30,1],[5037,13,5037,30,1],[5038,13,5038,30,1],[5039,13,5039,30,1],[5040,13,5040,30,1],[5041,13,5041,30,1],[5042,13,5042,30,1],[5043,13,5043,30,1],[5044,13,5044,30,1],[5045,13,5045,30,1],[5046,13,5046,30,1],[5047,13,5047,30,1],[5048,13,5048,30,1],[5049,13,5049,30,1],[5050,13,5050,30,1],[5051,13,5051,30,1],[5052,13,5052,30,1],[5053,13,5053,30,1],[5054,13,5054,30,1],[5055,13,5055,30,1],[5056,13,5056,30,1],[5057,13,5057,30,1],[5058,13,5058,30,1],[5059,13,5059,30,1],[5060,13,5060,30,1],[5061,13,5061,30,1],[5062,13,5062,30,1],[5063,13,5063,30,1],[5064,13,5064,30,1],[5065,13,5065,30,1],[5066,13,5066,30,1],[5067,13,5067,30,1],[5068,13,5068,30,1],[5069,13,5069,30,1],[5070,13,5070,30,1],[5071,13,5071,30,1],[5072,13,5072,30,1],[5073,13,5073,30,1],[5074,13,5074,30,1],[5075,13,5075,30,1],[5076,13,5076,30,1],[5077,13,5077,30,1],[5078,13,5078,30,1],[5079,13,5079,30,1],[5080,13,5080,30,1],[5081,13,5081,30,1],[5082,13,5082,30,1],[5083,13,5083,30,1],[5084,13,5084,30,1],[5085,13,5085,30,1],[5086,13,5086,30,1],[5087,13,5087,30,1],[5088,13,5088,30,1],[5089,13,5089,30,1],[5090,13,5090,30,1],[5091,13,5091,30,1],[5092,13,5092,30,1],[5093,13,5093,30,1],[5094,13,5094,30,1],[5095,13,5095,30,1],[5096,13,5096,30,1],[5097,13,5097,30,1],[5098,13,5098,30,1],[5099,13,5099,30,1],[5100,13,5100,30,1],[5101,13,5101,30,1],[5102,13,5102,30,1],[5103,13,5103,30,1],[5104,13,5104,30,1],[5105,13,5105,30,1],[5106,13,5106,30,1],[5107,13,5107,30,1],[5108,13,5108,30,1],[5109,13,5109,30,1],[5110,13,5110,30,1],[5111,13,5111,30,1],[5112,13,5112,30,1],[5113,13,5113,30,1],[5114,13,5114,30,1],[5115,13,5115,30,1],[5116,13,5116,30,1],[5117,13,5117,30,1],[5118,13,5118,30,1],[5119,13,5119,30,1],[5120,13,5120,30,1],[5121,13,5121,30,1],[5122,13,5122,30,1],[5123,13,5123,30,1],[5124,13,5124,30,1],[5125,13,5125,30,1],[5126,13,5126,30,1],[5127,13,5127,30,1],[5128,13,5128,30,1],[5129,13,5129,30,1],[5130,13,5130,30,1],[5131,13,5131,30,1],[5132,13,5132,30,1],[5133,13,5133,30,1],[5134,13,5134,30,1],[5135,13,5135,30,1],[5136,13,5136,30,1],[5137,13,5137,30,1],[5138,13,5138,30,1],[5139,13,5139,30,1],[5140,13,5140,30,1],[5141,13,5141,30,1],[5142,13,5142,30,1],[5143,13,5143,30,1],[5144,13,5144,30,1],[5145,13,5145,30,1],[5146,13,5146,30,1],[5147,13,5147,30,1],[5148,13,5148,30,1],[5149,13,5149,30,1],[5150,13,5150,30,1],[5151,13,5151,30,1],[5152,13,5152,30,1],[5153,13,5153,30,1],[5154,13,5154,30,1],[5155,13,5155,30,1],[5156,13,5156,30,1],[5157,13,5157,30,1],[5158,13,5158,30,1],[5159,13,5159,30,1],[5160,13,5160,30,1],[5161,13,5161,30,1],[5162,13,5162,30,1],[5163,13,5163,30,1],[5164,13,5164,30,1],[5165,13,5165,30,1],[5166,13,5166,30,1],[5167,13,5167,30,1],[5168,13,5168,30,1],[5169,13,5169,30,1],[5170,13,5170,30,1],[5171,13,5171,30,1],[5172,13,5172,30,1],[5173,13,5173,30,1],[5174,13,5174,30,1],[5175,13,5175,30,1],[5176,13,5176,30,1],[5177,13,5177,30,1],[5178,13,5178,30,1],[5179,13,5179,30,1],[5180,13,5180,30,1],[5181,13,5181,30,1],[5182,13,5182,30,1],[5183,13,5183,30,1],[5184,13,5184,30,1],[5185,13,5185,30,1],[5186,13,5186,30,1],[5187,13,5187,30,1],[5188,13,5188,30,1],[5189,13,5189,30,1],[5190,13,5190,30,1],[5191,13,5191,30,1],[5192,13,5192,30,1],[5193,13,5193,30,1],[5194,13,5194,30,1],[5195,13,5195,30,1],[5196,13,5196,30,1],[5197,13,5197,30,1],[5198,13,5198,30,1],[5199,13,5199,30,1],[5200,13,5200,30,1],[5201,13,5201,30,1],[5202,13,5202,30,1],[5203,13,5203,30,1],[5204,13,5204,30,1],[5205,13,5205,30,1],[5206,13,5206,30,1],[5207,13,5207,30,1],[5208,13,5208,30,1],[5209,13,5209,30,1],[5210,13,5210,30,1],[5211,13,5211,30,1],[5212,13,5212,30,1],[5213,13,5213,30,1],[5214,13,5214,30,1],[5215,13,5215,30,1],[5216,13,5216,30,1],[5217,13,5217,30,1],[5218,13,5218,30,1],[5219,13,5219,30,1],[5220,13,5220,30,1],[5221,13,5221,30,1],[5222,13,5222,30,1],[5223,13,5223,30,1],[5224,13,5224,30,1],[5225,13,5225,30,1],[5226,13,5226,30,1],[5227,13,5227,30,1],[5228,13,5228,30,1],[5229,13,5229,30,1],[5230,13,5230,30,1],[5231,13,5231,30,1],[5232,13,5232,30,1],[5233,13,5233,30,1],[5234,13,5234,30,1],[5235,13,5235,30,1],[5236,13,5236,30,1],[5237,13,5237,30,1],[5238,13,5238,30,1],[5239,13,5239,30,1],[5240,13,5240,30,1],[5241,13,5241,30,1],[5242,13,5242,30,1],[5243,13,5243,30,1],[5244,13,5244,30,1],[5245,13,5245,30,1],[5246,13,5246,30,1],[5247,13,5247,30,1],[5248,13,5248,30,1],[5249,13,5249,30,1],[5250,13,5250,30,1],[5251,13,5251,30,1],[5252,13,5252,30,1],[5253,13,5253,30,1],[5254,13,5254,30,1],[5255,13,5255,30,1],[5256,13,5256,30,1],[5257,13,5257,30,1],[5258,13,5258,30,1],[5259,13,5259,30,1],[5260,13,5260,30,1],[5261,13,5261,30,1],[5262,13,5262,30,1],[5263,13,5263,30,1],[5264,13,5264,30,1],[5265,13,5265,30,1],[5266,13,5266,30,1],[5267,13,5267,30,1],[5268,13,5268,30,1],[5269,13,5269,30,1],[5270,13,5270,30,1],[5271,13,5271,30,1],[5272,13,5272,30,1],[5273,13,5273,30,1],[5274,13,5274,30,1],[5275,13,5275,30,1],[5276,13,5276,30,1],[5277,13,5277,30,1],[5278,13,5278,30,1],[5279,13,5279,30,1],[5280,13,5280,30,1],[5281,13,5281,30,1],[5282,13,5282,30,1],[5283,13,5283,30,1],[5284,13,5284,30,1],[5285,13,5285,30,1],[5286,13,5286,30,1],[5287,13,5287,30,1],[5288,13,5288,30,1],[5289,13,5289,30,1],[5290,13,5290,30,1],[5291,13,5291,30,1],[5292,13,5292,30,1],[5293,13,5293,30,1],[5294,13,5294,30,1],[5295,13,5295,30,1],[5296,13,5296,30,1],[5297,13,5297,30,1],[5298,13,5298,30,1],[5299,13,5299,30,1],[5300,13,5300,30,1],[5301,13,5301,30,1],[5302,13,5302,30,1],[5303,13,5303,30,1],[5304,13,5304,30,1],[5305,13,5305,30,1],[5306,13,5306,30,1],[5307,13,5307,30,1],[5308,13,5308,30,1],[5309,13,5309,30,1],[5310,13,5310,30,1],[5311,13,5311,30,1],[5312,13,5312,30,1],[5313,13,5313,30,1],[5314,13,5314,30,1],[5315,13,5315,30,1],[5316,13,5316,30,1],[5317,13,5317,30,1],[5318,13,5318,30,1],[5319,13,5319,30,1],[5320,13,5320,30,1],[5321,13,5321,30,1],[5322,13,5322,30,1],[5323,13,5323,30,1],[5324,13,5324,30,1],[5325,13,5325,30,1],[5326,13,5326,30,1],[5327,13,5327,30,1],[5328,13,5328,30,1],[5329,13,5329,30,1],[5330,13,5330,30,1],[5331,13,5331,30,1],[5332,13,5332,30,1],[5333,13,5333,30,1],[5334,13,5334,30,1],[5335,13,5335,30,1],[5336,13,5336,30,1],[5337,13,5337,30,1],[5338,13,5338,30,1],[5339,13,5339,30,1],[5340,13,5340,30,1],[5341,13,5341,30,1],[5342,13,5342,30,1],[5343,13,5343,30,1],[5344,13,5344,30,1],[5345,13,5345,30,1],[5346,13,5346,30,1],[5347,13,5347,30,1],[5348,13,5348,30,1],[5349,13,5349,30,1],[5350,13,5350,30,1],[5351,13,5351,30,1],[5352,13,5352,30,1],[5353,13,5353,30,1],[5354,13,5354,30,1],[5355,13,5355,30,1],[5356,13,5356,30,1],[5357,13,5357,30,1],[5358,13,5358,30,1],[5359,13,5359,30,1],[5360,13,5360,30,1],[5361,13,5361,30,1],[5362,13,5362,30,1],[5363,13,5363,30,1],[5364,13,5364,30,1],[5365,13,5365,30,1],[5366,13,5366,30,1],[5367,13,5367,30,1],[5368,13,5368,30,1],[5369,13,5369,30,1],[5370,13,5370,30,1],[5371,13,5371,30,1],[5372,13,5372,30,1],[5373,13,5373,30,1],[5374,13,5374,30,1],[5375,13,5375,30,1],[5376,13,5376,30,1],[5377,13,5377,30,1],[5378,13,5378,30,1],[5379,13,5379,30,1],[5380,13,5380,30,1],[5381,13,5381,30,1],[5382,13,5382,30,1],[5383,13,5383,30,1],[5384,13,5384,30,1],[5385,13,5385,30,1],[5386,13,5386,30,1],[5387,13,5387,30,1],[5388,13,5388,30,1],[5389,13,5389,30,1],[5390,13,5390,30,1],[5391,13,5391,30,1],[5392,13,5392,30,1],[5393,13,5393,30,1],[5394,13,5394,30,1],[5395,13,5395,30,1],[5396,13,5396,30,1],[5397,13,5397,30,1],[5398,13,5398,30,1],[5399,13,5399,30,1],[5400,13,5400,30,1],[5401,13,5401,30,1],[5402,13,5402,30,1],[5403,13,5403,30,1],[5404,13,5404,30,1],[5405,13,5405,30,1],[5406,13,5406,30,1],[5407,13,5407,30,1],[5408,13,5408,30,1],[5409,13,5409,30,1],[5410,13,5410,30,1],[5411,13,5411,30,1],[5412,13,5412,30,1],[5413,13,5413,30,1],[5414,13,5414,30,1],[5415,13,5415,30,1],[5416,13,5416,30,1],[5417,13,5417,30,1],[5418,13,5418,30,1],[5419,13,5419,30,1],[5420,13,5420,30,1],[5421,13,5421,30,1],[5422,13,5422,30,1],[5423,13,5423,30,1],[5424,13,5424,30,1],[5425,13,5425,30,1],[5426,13,5426,30,1],[5427,13,5427,30,1],[5428,13,5428,30,1],[5429,13,5429,30,1],[5430,13,5430,30,1],[5431,13,5431,30,1],[5432,13,5432,30,1],[5433,13,5433,30,1],[5434,13,5434,30,1],[5435,13,5435,30,1],[5436,13,5436,30,1],[5437,13,5437,30,1],[5438,13,5438,30,1],[5439,13,5439,30,1],[5440,13,5440,30,1],[5441,13,5441,30,1],[5442,13,5442,30,1],[5443,13,5443,30,1],[5444,13,5444,30,1],[5445,13,5445,30,1],[5446,13,5446,30,1],[5447,13,5447,30,1],[5448,13,5448,30,1],[5449,13,5449,30,1],[5450,13,5450,30,1],[5451,13,5451,30,1],[5452,13,5452,30,1],[5453,13,5453,30,1],[5454,13,5454,30,1],[5455,13,5455,30,1],[5456,13,5456,30,1],[5457,13,5457,30,1],[5458,13,5458,30,1],[5459,13,5459,30,1],[5460,13,5460,30,1],[5461,13,5461,30,1],[5462,13,5462,30,1],[5463,13,5463,30,1],[5464,13,5464,30,1],[5465,13,5465,30,1],[5466,13,5466,30,1],[5467,13,5467,30,1],[5468,13,5468,30,1],[5469,13,5469,30,1],[5470,13,5470,30,1],[5471,13,5471,30,1],[5472,13,5472,30,1],[5473,13,5473,30,1],[5474,13,5474,30,1],[5475,13,5475,30,1],[5476,13,5476,30,1],[5477,13,5477,30,1],[5478,13,5478,30,1],[5479,13,5479,30,1],[5480,13,5480,30,1],[5481,13,5481,30,1],[5482,13,5482,30,1],[5483,13,5483,30,1],[5484,13,5484,30,1],[5485,13,5485,30,1],[5486,13,5486,30,1],[5487,13,5487,30,1],[5488,13,5488,30,1],[5489,13,5489,30,1],[5490,13,5490,30,1],[5491,13,5491,30,1],[5492,13,5492,30,1],[5493,13,5493,30,1],[5494,13,5494,30,1],[5495,13,5495,30,1],[5496,13,5496,30,1],[5497,13,5497,30,1],[5498,13,5498,30,1],[5499,13,5499,30,1],[5500,13,5500,30,1],[5501,13,5501,30,1],[5502,13,5502,30,1],[5503,13,5503,30,1],[5504,13,5504,30,1],[5505,13,5505,30,1],[5506,13,5506,30,1],[5507,13,5507,30,1],[5508,13,5508,30,1],[5509,13,5509,30,1],[5510,13,5510,30,1],[5511,13,5511,30,1],[5512,13,5512,30,1],[5513,13,5513,30,1],[5514,13,5514,30,1],[5515,13,5515,30,1],[5516,13,5516,30,1],[5517,13,5517,30,1],[5518,13,5518,30,1],[5519,13,5519,30,1],[5520,13,5520,30,1],[5521,13,5521,30,1],[5522,13,5522,30,1],[5523,13,5523,30,1],[5524,13,5524,30,1],[5525,13,5525,30,1],[5526,13,5526,30,1],[5527,13,5527,30,1],[5528,13,5528,30,1],[5529,13,5529,30,1],[5530,13,5530,30,1],[5531,13,5531,30,1],[5532,13,5532,30,1],[5533,13,5533,30,1],[5534,13,5534,30,1],[5535,13,5535,30,1],[5536,13,5536,30,1],[5537,13,5537,30,1],[5538,13,5538,30,1],[5539,13,5539,30,1],[5540,13,5540,30,1],[5541,13,5541,30,1],[5542,13,5542,30,1],[5543,13,5543,30,1],[5544,13,5544,30,1],[5545,13,5545,30,1],[5546,13,5546,30,1],[5547,13,5547,30,1],[5548,13,5548,30,1],[5549,13,5549,30,1],[5550,13,5550,30,1],[5551,13,5551,30,1],[5552,13,5552,30,1],[5553,13,5553,30,1],[5554,13,5554,30,1],[5555,13,5555,30,1],[5556,13,5556,30,1],[5557,13,5557,30,1],[5558,13,5558,30,1],[5559,13,5559,30,1],[5560,13,5560,30,1],[5561,13,5561,30,1],[5562,13,5562,30,1],[5563,13,5563,30,1],[5564,13,5564,30,1],[5565,13,5565,30,1],[5566,13,5566,30,1],[5567,13,5567,30,1],[5568,13,5568,30,1],[5569,13,5569,30,1],[5570,13,5570,30,1],[5571,13,5571,30,1],[5572,13,5572,30,1],[5573,13,5573,30,1],[5574,13,5574,30,1],[5575,13,5575,30,1],[5576,13,5576,30,1],[5577,13,5577,30,1],[5578,13,5578,30,1],[5579,13,5579,30,1],[5580,13,5580,30,1],[5581,13,5581,30,1],[5582,13,5582,30,1],[5583,13,5583,30,1],[5584,13,5584,30,1],[5585,13,5585,30,1],[5586,13,5586,30,1],[5587,13,5587,30,1],[5588,13,5588,30,1],[5589,13,5589,30,1],[5590,13,5590,30,1],[5591,13,5591,30,1],[5592,13,5592,30,1],[5593,13,5593,30,1],[5594,13,5594,30,1],[5595,13,5595,30,1],[5596,13,5596,30,1],[5597,13,5597,30,1],[5598,13,5598,30,1],[5599,13,5599,30,1],[5600,13,5600,30,1],[5601,13,5601,30,1],[5602,13,5602,30,1],[5603,13,5603,30,1],[5604,13,5604,30,1],[5605,13,5605,30,1],[5606,13,5606,30,1],[5607,13,5607,30,1],[5608,13,5608,30,1],[5609,13,5609,30,1],[5610,13,5610,30,1],[5611,13,5611,30,1],[5612,13,5612,30,1],[5613,13,5613,30,1],[5614,13,5614,30,1],[5615,13,5615,30,1],[5616,13,5616,30,1],[5617,13,5617,30,1],[5618,13,5618,30,1],[5619,13,5619,30,1],[5620,13,5620,30,1],[5621,13,5621,30,1],[5622,13,5622,30,1],[5623,13,5623,30,1],[5624,13,5624,30,1],[5625,13,5625,30,1],[5626,13,5626,30,1],[5627,13,5627,30,1],[5628,13,5628,30,1],[5629,13,5629,30,1],[5630,13,5630,30,1],[5631,13,5631,30,1],[5632,13,5632,30,1],[5633,13,5633,30,1],[5634,13,5634,30,1],[5635,13,5635,30,1],[5636,13,5636,30,1],[5637,13,5637,30,1],[5638,13,5638,30,1],[5639,13,5639,30,1],[5640,13,5640,30,1],[5641,13,5641,30,1],[5642,13,5642,30,1],[5643,13,5643,30,1],[5644,13,5644,30,1],[5645,13,5645,30,1],[5646,13,5646,30,1],[5647,13,5647,30,1],[5648,13,5648,30,1],[5649,13,5649,30,1],[5650,13,5650,30,1],[5651,13,5651,30,1],[5652,13,5652,30,1],[5653,13,5653,30,1],[5654,13,5654,30,1],[5655,13,5655,30,1],[5656,13,5656,30,1],[5657,13,5657,30,1],[5658,13,5658,30,1],[5659,13,5659,30,1],[5660,13,5660,30,1],[5661,13,5661,30,1],[5662,13,5662,30,1],[5663,13,5663,30,1],[5664,13,5664,30,1],[5665,13,5665,30,1],[5666,13,5666,30,1],[5667,13,5667,30,1],[5668,13,5668,30,1],[5669,13,5669,30,1],[5670,13,5670,30,1],[5671,13,5671,30,1],[5672,13,5672,30,1],[5673,13,5673,30,1],[5674,13,5674,30,1],[5675,13,5675,30,1],[5676,13,5676,30,1],[5677,13,5677,30,1],[5678,13,5678,30,1],[5679,13,5679,30,1],[5680,13,5680,30,1],[5681,13,5681,30,1],[5682,13,5682,30,1],[5683,13,5683,30,1],[5684,13,5684,30,1],[5685,13,5685,30,1],[5686,13,5686,30,1],[5687,13,5687,30,1],[5688,13,5688,30,1],[5689,13,5689,30,1],[5690,13,5690,30,1],[5691,13,5691,30,1],[5692,13,5692,30,1],[5693,13,5693,30,1],[5694,13,5694,30,1],[5695,13,5695,30,1],[5696,13,5696,30,1],[5697,13,5697,30,1],[5698,13,5698,30,1],[5699,13,5699,30,1],[5700,13,5700,30,1],[5701,13,5701,30,1],[5702,13,5702,30,1],[5703,13,5703,30,1],[5704,13,5704,30,1],[5705,13,5705,30,1],[5706,13,5706,30,1],[5707,13,5707,30,1],[5708,13,5708,30,1],[5709,13,5709,30,1],[5710,13,5710,30,1],[5711,13,5711,30,1],[5712,13,5712,30,1],[5713,13,5713,30,1],[5714,13,5714,30,1],[5715,13,5715,30,1],[5716,13,5716,30,1],[5717,13,5717,30,1],[5718,13,5718,30,1],[5719,13,5719,30,1],[5720,13,5720,30,1],[5721,13,5721,30,1],[5722,13,5722,30,1],[5723,13,5723,30,1],[5724,13,5724,30,1],[5725,13,5725,30,1],[5726,13,5726,30,1],[5727,13,5727,30,1],[5728,13,5728,30,1],[5729,13,5729,30,1],[5730,13,5730,30,1],[5731,13,5731,30,1],[5732,13,5732,30,1],[5733,13,5733,30,1],[5734,13,5734,30,1],[5735,13,5735,30,1],[5736,13,5736,30,1],[5737,13,5737,30,1],[5738,13,5738,30,1],[5739,13,5739,30,1],[5740,13,5740,30,1],[5741,13,5741,30,1],[5742,13,5742,30,1],[5743,13,5743,30,1],[5744,13,5744,30,1],[5745,13,5745,30,1],[5746,13,5746,30,1],[5747,13,5747,30,1],[5748,13,5748,30,1],[5749,13,5749,30,1],[5750,13,5750,30,1],[5751,13,5751,30,1],[5752,13,5752,30,1],[5753,13,5753,30,1],[5754,13,5754,30,1],[5755,13,5755,30,1],[5756,13,5756,30,1],[5757,13,5757,30,1],[5758,13,5758,30,1],[5759,13,5759,30,1],[5760,13,5760,30,1],[5761,13,5761,30,1],[5762,13,5762,30,1],[5763,13,5763,30,1],[5764,13,5764,30,1],[5765,13,5765,30,1],[5766,13,5766,30,1],[5767,13,5767,30,1],[5768,13,5768,30,1],[5769,13,5769,30,1],[5770,13,5770,30,1],[5771,13,5771,30,1],[5772,13,5772,30,1],[5773,13,5773,30,1],[5774,13,5774,30,1],[5775,13,5775,30,1],[5776,13,5776,30,1],[5777,13,5777,30,1],[5778,13,5778,30,1],[5779,13,5779,30,1],[5780,13,5780,30,1],[5781,13,5781,30,1],[5782,13,5782,30,1],[5783,13,5783,30,1],[5784,13,5784,30,1],[5785,13,5785,30,1],[5786,13,5786,30,1],[5787,13,5787,30,1],[5788,13,5788,30,1],[5789,13,5789,30,1],[5790,13,5790,30,1],[5791,13,5791,30,1],[5792,13,5792,30,1],[5793,13,5793,30,1],[5794,13,5794,30,1],[5795,13,5795,30,1],[5796,13,5796,30,1],[5797,13,5797,30,1],[5798,13,5798,30,1],[5799,13,5799,30,1],[5800,13,5800,30,1],[5801,13,5801,30,1],[5802,13,5802,30,1],[5803,13,5803,30,1],[5804,13,5804,30,1],[5805,13,5805,30,1],[5806,13,5806,30,1],[5807,13,5807,30,1],[5808,13,5808,30,1],[5809,13,5809,30,1],[5810,13,5810,30,1],[5811,13,5811,30,1],[5812,13,5812,30,1],[5813,13,5813,30,1],[5814,13,5814,30,1],[5815,13,5815,30,1],[5816,13,5816,30,1],[5817,13,5817,30,1],[5818,13,5818,30,1],[5819,13,5819,30,1],[5820,13,5820,30,1],[5821,13,5821,30,1],[5822,13,5822,30,1],[5823,13,5823,30,1],[5824,13,5824,30,1],[5825,13,5825,30,1],[5826,13,5826,30,1],[5827,13,5827,30,1],[5828,13,5828,30,1],[5829,13,5829,30,1],[5830,13,5830,30,1],[5831,13,5831,30,1],[5832,13,5832,30,1],[5833,13,5833,30,1],[5834,13,5834,30,1],[5835,13,5835,30,1],[5836,13,5836,30,1],[5837,13,5837,30,1],[5838,13,5838,30,1],[5839,13,5839,30,1],[5840,13,5840,30,1],[5841,13,5841,30,1],[5842,13,5842,30,1],[5843,13,5843,30,1],[5844,13,5844,30,1],[5845,13,5845,30,1],[5846,13,5846,30,1],[5847,13,5847,30,1],[5848,13,5848,30,1],[5849,13,5849,30,1],[5850,13,5850,30,1],[5851,13,5851,30,1],[5852,13,5852,30,1],[5853,13,5853,30,1],[5854,13,5854,30,1],[5855,13,5855,30,1],[5856,13,5856,30,1],[5857,13,5857,30,1],[5858,13,5858,30,1],[5859,13,5859,30,1],[5860,13,5860,30,1],[5861,13,5861,30,1],[5862,13,5862,30,1],[5863,13,5863,30,1],[5864,13,5864,30,1],[5865,13,5865,30,1],[5866,13,5866,30,1],[5867,13,5867,30,1],[5868,13,5868,30,1],[5869,13,5869,30,1],[5870,13,5870,30,1],[5871,13,5871,30,1],[5872,13,5872,30,1],[5873,13,5873,30,1],[5874,13,5874,30,1],[5875,13,5875,30,1],[5876,13,5876,30,1],[5877,13,5877,30,1],[5878,13,5878,30,1],[5879,13,5879,30,1],[5880,13,5880,30,1],[5881,13,5881,30,1],[5882,13,5882,30,1],[5883,13,5883,30,1],[5884,13,5884,30,1],[5885,13,5885,30,1],[5886,13,5886,30,1],[5887,13,5887,30,1],[5888,13,5888,30,1],[5889,13,5889,30,1],[5890,13,5890,30,1],[5891,13,5891,30,1],[5892,13,5892,30,1],[5893,13,5893,30,1],[5894,13,5894,30,1],[5895,13,5895,30,1],[5896,13,5896,30,1],[5897,13,5897,30,1],[5898,13,5898,30,1],[5899,13,5899,30,1],[5900,13,5900,30,1],[5901,13,5901,30,1],[5902,13,5902,30,1],[5903,13,5903,30,1],[5904,13,5904,30,1],[5905,13,5905,30,1],[5906,13,5906,30,1],[5907,13,5907,30,1],[5908,13,5908,30,1],[5909,13,5909,30,1],[5910,13,5910,30,1],[5911,13,5911,30,1],[5912,13,5912,30,1],[5913,13,5913,30,1],[5914,13,5914,30,1],[5915,13,5915,30,1],[5916,13,5916,30,1],[5917,13,5917,30,1],[5918,13,5918,30,1],[5919,13,5919,30,1],[5920,13,5920,30,1],[5921,13,5921,30,1],[5922,13,5922,30,1],[5923,13,5923,30,1],[5924,13,5924,30,1],[5925,13,5925,30,1],[5926,13,5926,30,1],[5927,13,5927,30,1],[5928,13,5928,30,1],[5929,13,5929,30,1],[5930,13,5930,30,1],[5931,13,5931,30,1],[5932,13,5932,30,1],[5933,13,5933,30,1],[5934,13,5934,30,1],[5935,13,5935,30,1],[5936,13,5936,30,1],[5937,13,5937,30,1],[5938,13,5938,30,1],[5939,13,5939,30,1],[5940,13,5940,30,1],[5941,13,5941,30,1],[5942,13,5942,30,1],[5943,13,5943,30,1],[5944,13,5944,30,1],[5945,13,5945,30,1],[5946,13,5946,30,1],[5947,13,5947,30,1],[5948,13,5948,30,1],[5949,13,5949,30,1],[5950,13,5950,30,1],[5951,13,5951,30,1],[5952,13,5952,30,1],[5953,13,5953,30,1],[5954,13,5954,30,1],[5955,13,5955,30,1],[5956,13,5956,30,1],[5957,13,5957,30,1],[5958,13,5958,30,1],[5959,13,5959,30,1],[5960,13,5960,30,1],[5961,13,5961,30,1],[5962,13,5962,30,1],[5963,13,5963,30,1],[5964,13,5964,30,1],[5965,13,5965,30,1],[5966,13,5966,30,1],[5967,13,5967,30,1],[5968,13,5968,30,1],[5969,13,5969,30,1],[5970,13,5970,30,1],[5971,13,5971,30,1],[5972,13,5972,30,1],[5973,13,5973,30,1],[5974,13,5974,30,1],[5975,13,5975,30,1],[5976,13,5976,30,1],[5977,13,5977,30,1],[5978,13,5978,30,1],[5979,13,5979,30,1],[5980,13,5980,30,1],[5981,13,5981,30,1],[5982,13,5982,30,1],[5983,13,5983,30,1],[5984,13,5984,30,1],[5985,13,5985,30,1],[5986,13,5986,30,1],[5987,13,5987,30,1],[5988,13,5988,30,1],[5989,13,5989,30,1],[5990,13,5990,30,1],[5991,13,5991,30,1],[5992,13,5992,30,1],[5993,13,5993,30,1],[5994,13,5994,30,1],[5995,13,5995,30,1],[5996,13,5996,30,1],[5997,13,5997,30,1],[5998,13,5998,30,1],[5999,13,5999,30,1],[6000,13,6000,30,1],[6001,13,6001,30,1],[6002,13,6002,30,1],[6003,13,6003,30,1],[6004,13,6004,30,1],[6005,13,6005,30,1],[6006,13,6006,30,1],[6007,13,6007,30,1],[6008,13,6008,30,1],[6009,13,6009,30,1],[6010,13,6010,30,1],[6011,13,6011,30,1],[6012,13,6012,30,1],[6013,13,6013,30,1],[6014,13,6014,30,1],[6015,13,6015,30,1],[6016,13,6016,30,1],[6017,13,6017,30,1],[6018,13,6018,30,1],[6019,13,6019,30,1],[6020,13,6020,30,1],[6021,13,6021,30,1],[6022,13,6022,30,1],[6023,13,6023,30,1],[6024,13,6024,30,1],[6025,13,6025,30,1],[6026,13,6026,30,1],[6027,13,6027,30,1],[6028,13,6028,30,1],[6029,13,6029,30,1],[6030,13,6030,30,1],[6031,13,6031,30,1],[6032,13,6032,30,1],[6033,13,6033,30,1],[6034,13,6034,30,1],[6035,13,6035,30,1],[6036,13,6036,30,1],[6037,13,6037,30,1],[6038,13,6038,30,1],[6039,13,6039,30,1],[6040,13,6040,30,1],[6041,13,6041,30,1],[6042,13,6042,30,1],[6043,13,6043,30,1],[6044,13,6044,30,1],[6045,13,6045,30,1],[6046,13,6046,30,1],[6047,13,6047,30,1],[6048,13,6048,30,1],[6049,13,6049,30,1],[6050,13,6050,30,1],[6051,13,6051,30,1],[6052,13,6052,30,1],[6053,13,6053,30,1],[6054,13,6054,30,1],[6055,13,6055,30,1],[6056,13,6056,30,1],[6057,13,6057,30,1],[6058,13,6058,30,1],[6059,13,6059,30,1],[6060,13,6060,30,1],[6061,13,6061,30,1],[6062,13,6062,30,1],[6063,13,6063,30,1],[6064,13,6064,30,1],[6065,13,6065,30,1],[6066,13,6066,30,1],[6067,13,6067,30,1],[6068,13,6068,30,1],[6069,13,6069,30,1],[6070,13,6070,30,1],[6071,13,6071,30,1],[6072,13,6072,30,1],[6073,13,6073,30,1],[6074,13,6074,30,1],[6075,13,6075,30,1],[6076,13,6076,30,1],[6077,13,6077,30,1],[6078,13,6078,30,1],[6079,13,6079,30,1],[6080,13,6080,30,1],[6081,13,6081,30,1],[6082,13,6082,30,1],[6083,13,6083,30,1],[6084,13,6084,30,1],[6085,13,6085,30,1],[6086,13,6086,30,1],[6087,13,6087,30,1],[6088,13,6088,30,1],[6089,13,6089,30,1],[6090,13,6090,30,1],[6091,13,6091,30,1],[6092,13,6092,30,1],[6093,13,6093,30,1],[6094,13,6094,30,1],[6095,13,6095,30,1],[6096,13,6096,30,1],[6097,13,6097,30,1],[6098,13,6098,30,1],[6099,13,6099,30,1],[6100,13,6100,30,1],[6101,13,6101,30,1],[6102,13,6102,30,1],[6103,13,6103,30,1],[6104,13,6104,30,1],[6105,13,6105,30,1],[6106,13,6106,30,1],[6107,13,6107,30,1],[6108,13,6108,30,1],[6109,13,6109,30,1],[6110,13,6110,30,1],[6111,13,6111,30,1],[6112,13,6112,30,1],[6113,13,6113,30,1],[6114,13,6114,30,1],[6115,13,6115,30,1],[6116,13,6116,30,1],[6117,13,6117,30,1],[6118,13,6118,30,1],[6119,13,6119,30,1],[6120,13,6120,30,1],[6121,13,6121,30,1],[6122,13,6122,30,1],[6123,13,6123,30,1],[6124,13,6124,30,1],[6125,13,6125,30,1],[6126,13,6126,30,1],[6127,13,6127,30,1],[6128,13,6128,30,1],[6129,13,6129,30,1],[6130,13,6130,30,1],[6131,13,6131,30,1],[6132,13,6132,30,1],[6133,13,6133,30,1],[6134,13,6134,30,1],[6135,13,6135,30,1],[6136,13,6136,30,1],[6137,13,6137,30,1],[6138,13,6138,30,1],[6139,13,6139,30,1],[6140,13,6140,30,1],[6141,13,6141,30,1],[6142,13,6142,30,1],[6143,13,6143,30,1],[6144,13,6144,30,1],[6145,13,6145,30,1],[6146,13,6146,30,1],[6147,13,6147,30,1],[6148,13,6148,30,1],[6149,13,6149,30,1],[6150,13,6150,30,1],[6151,13,6151,30,1],[6152,13,6152,30,1],[6153,13,6153,30,1],[6154,13,6154,30,1],[6155,13,6155,30,1],[6156,13,6156,30,1],[6157,13,6157,30,1],[6158,13,6158,30,1],[6159,13,6159,30,1],[6160,13,6160,30,1],[6161,13,6161,30,1],[6162,13,6162,30,1],[6163,13,6163,30,1],[6164,13,6164,30,1],[6165,13,6165,30,1],[6166,13,6166,30,1],[6167,13,6167,30,1],[6168,13,6168,30,1],[6169,13,6169,30,1],[6170,13,6170,30,1],[6171,13,6171,30,1],[6172,13,6172,30,1],[6173,13,6173,30,1],[6174,13,6174,30,1],[6175,13,6175,30,1],[6176,13,6176,30,1],[6177,13,6177,30,1],[6178,13,6178,30,1],[6179,13,6179,30,1],[6180,13,6180,30,1],[6181,13,6181,30,1],[6182,13,6182,30,1],[6183,13,6183,30,1],[6184,13,6184,30,1],[6185,13,6185,30,1],[6186,13,6186,30,1],[6187,13,6187,30,1],[6188,13,6188,30,1],[6189,13,6189,30,1],[6190,13,6190,30,1],[6191,13,6191,30,1],[6192,13,6192,30,1],[6193,13,6193,30,1],[6194,13,6194,30,1],[6195,13,6195,30,1],[6196,13,6196,30,1],[6197,13,6197,30,1],[6198,13,6198,30,1],[6199,13,6199,30,1],[6200,13,6200,30,1],[6201,13,6201,30,1],[6202,13,6202,30,1],[6203,13,6203,30,1],[6204,13,6204,30,1],[6205,13,6205,30,1],[6206,13,6206,30,1],[6207,13,6207,30,1],[6208,13,6208,30,1],[6209,13,6209,30,1],[6210,13,6210,30,1],[6211,13,6211,30,1],[6212,13,6212,30,1],[6213,13,6213,30,1],[6214,13,6214,30,1],[6215,13,6215,30,1],[6216,13,6216,30,1],[6217,13,6217,30,1],[6218,13,6218,30,1],[6219,13,6219,30,1],[6220,13,6220,30,1],[6221,13,6221,30,1],[6222,13,6222,30,1],[6223,13,6223,30,1],[6224,13,6224,30,1],[6225,13,6225,30,1],[6226,13,6226,30,1],[6227,13,6227,30,1],[6228,13,6228,30,1],[6229,13,6229,30,1],[6230,13,6230,30,1],[6231,13,6231,30,1],[6232,13,6232,30,1],[6233,13,6233,30,1],[6234,13,6234,30,1],[6235,13,6235,30,1],[6236,13,6236,30,1],[6237,13,6237,30,1],[6238,13,6238,30,1],[6239,13,6239,30,1],[6240,13,6240,30,1],[6241,13,6241,30,1],[6242,13,6242,30,1],[6243,13,6243,30,1],[6244,13,6244,30,1],[6245,13,6245,30,1],[6246,13,6246,30,1],[6247,13,6247,30,1],[6248,13,6248,30,1],[6249,13,6249,30,1],[6250,13,6250,30,1],[6251,13,6251,30,1],[6252,13,6252,30,1],[6253,13,6253,30,1],[6254,13,6254,30,1],[6255,13,6255,30,1],[6256,13,6256,30,1],[6257,13,6257,30,1],[6258,13,6258,30,1],[6259,13,6259,30,1],[6260,13,6260,30,1],[6261,13,6261,30,1],[6262,13,6262,30,1],[6263,13,6263,30,1],[6264,13,6264,30,1],[6265,13,6265,30,1],[6266,13,6266,30,1],[6267,13,6267,30,1],[6268,13,6268,30,1],[6269,13,6269,30,1],[6270,13,6270,30,1],[6271,13,6271,30,1],[6272,13,6272,30,1],[6273,13,6273,30,1],[6274,13,6274,30,1],[6275,13,6275,30,1],[6276,13,6276,30,1],[6277,13,6277,30,1],[6278,13,6278,30,1],[6279,13,6279,30,1],[6280,13,6280,30,1],[6281,13,6281,30,1],[6282,13,6282,30,1],[6283,13,6283,30,1],[6284,13,6284,30,1],[6285,13,6285,30,1],[6286,13,6286,30,1],[6287,13,6287,30,1],[6288,13,6288,30,1],[6289,13,6289,30,1],[6290,13,6290,30,1],[6291,13,6291,30,1],[6292,13,6292,30,1],[6293,13,6293,30,1],[6294,13,6294,30,1],[6295,13,6295,30,1],[6296,13,6296,30,1],[6297,13,6297,30,1],[6298,13,6298,30,1],[6299,13,6299,30,1],[6300,13,6300,30,1],[6301,13,6301,30,1],[6302,13,6302,30,1],[6303,13,6303,30,1],[6304,13,6304,30,1],[6305,13,6305,30,1],[6306,13,6306,30,1],[6307,13,6307,30,1],[6308,13,6308,30,1],[6309,13,6309,30,1],[6310,13,6310,30,1],[6311,13,6311,30,1],[6312,13,6312,30,1],[6313,13,6313,30,1],[6314,13,6314,30,1],[6315,13,6315,30,1],[6316,13,6316,30,1],[6317,13,6317,30,1],[6318,13,6318,30,1],[6319,13,6319,30,1],[6320,13,6320,30,1],[6321,13,6321,30,1],[6322,13,6322,30,1],[6323,13,6323,30,1],[6324,13,6324,30,1],[6325,13,6325,30,1],[6326,13,6326,30,1],[6327,13,6327,30,1],[6328,13,6328,30,1],[6329,13,6329,30,1],[6330,13,6330,30,1],[6331,13,6331,30,1],[6332,13,6332,30,1],[6333,13,6333,30,1],[6334,13,6334,30,1],[6335,13,6335,30,1],[6336,13,6336,30,1],[6337,13,6337,30,1],[6338,13,6338,30,1],[6339,13,6339,30,1],[6340,13,6340,30,1],[6341,13,6341,30,1],[6342,13,6342,30,1],[6343,13,6343,30,1],[6344,13,6344,30,1],[6345,13,6345,30,1],[6346,13,6346,30,1],[6347,13,6347,30,1],[6348,13,6348,30,1],[6349,13,6349,30,1],[6350,13,6350,30,1],[6351,13,6351,30,1],[6352,13,6352,30,1],[6353,13,6353,30,1],[6354,13,6354,30,1],[6355,13,6355,30,1],[6356,13,6356,30,1],[6357,13,6357,30,1],[6358,13,6358,30,1],[6359,13,6359,30,1],[6360,13,6360,30,1],[6361,13,6361,30,1],[6362,13,6362,30,1],[6363,13,6363,30,1],[6364,13,6364,30,1],[6365,13,6365,30,1],[6366,13,6366,30,1],[6367,13,6367,30,1],[6368,13,6368,30,1],[6369,13,6369,30,1],[6370,13,6370,30,1],[6371,13,6371,30,1],[6372,13,6372,30,1],[6373,13,6373,30,1],[6374,13,6374,30,1],[6375,13,6375,30,1],[6376,13,6376,30,1],[6377,13,6377,30,1],[6378,13,6378,30,1],[6379,13,6379,30,1],[6380,13,6380,30,1],[6381,13,6381,30,1],[6382,13,6382,30,1],[6383,13,6383,30,1],[6384,13,6384,30,1],[6385,13,6385,30,1],[6386,13,6386,30,1],[6387,13,6387,30,1],[6388,13,6388,30,1],[6389,13,6389,30,1],[6390,13,6390,30,1],[6391,13,6391,30,1],[6392,13,6392,30,1],[6393,13,6393,30,1],[6394,13,6394,30,1],[6395,13,6395,30,1],[6396,13,6396,30,1],[6397,13,6397,30,1],[6398,13,6398,30,1],[6399,13,6399,30,1],[6400,13,6400,30,1],[6401,13,6401,30,1],[6402,13,6402,30,1],[6403,13,6403,30,1],[6404,13,6404,30,1],[6405,13,6405,30,1],[6406,13,6406,30,1],[6407,13,6407,30,1],[6408,13,6408,30,1],[6409,13,6409,30,1],[6410,13,6410,30,1],[6411,13,6411,30,1],[6412,13,6412,30,1],[6413,13,6413,30,1],[6414,13,6414,30,1],[6415,13,6415,30,1],[6416,13,6416,30,1],[6417,13,6417,30,1],[6418,13,6418,30,1],[6419,13,6419,30,1],[6420,13,6420,30,1],[6421,13,6421,30,1],[6422,13,6422,30,1],[6423,13,6423,30,1],[6424,13,6424,30,1],[6425,13,6425,30,1],[6426,13,6426,30,1],[6427,13,6427,30,1],[6428,13,6428,30,1],[6429,13,6429,30,1],[6430,13,6430,30,1],[6431,13,6431,30,1],[6432,13,6432,30,1],[6433,13,6433,30,1],[6434,13,6434,30,1],[6435,13,6435,30,1],[6436,13,6436,30,1],[6437,13,6437,30,1],[6438,13,6438,30,1],[6439,13,6439,30,1],[6440,13,6440,30,1],[6441,13,6441,30,1],[6442,13,6442,30,1],[6443,13,6443,30,1],[6444,13,6444,30,1],[6445,13,6445,30,1],[6446,13,6446,30,1],[6447,13,6447,30,1],[6448,13,6448,30,1],[6449,13,6449,30,1],[6450,13,6450,30,1],[6451,13,6451,30,1],[6452,13,6452,30,1],[6453,13,6453,30,1],[6454,13,6454,30,1],[6455,13,6455,30,1],[6456,13,6456,30,1],[6457,13,6457,30,1],[6458,13,6458,30,1],[6459,13,6459,30,1],[6460,13,6460,30,1],[6461,13,6461,30,1],[6462,13,6462,30,1],[6463,13,6463,30,1],[6464,13,6464,30,1],[6465,13,6465,30,1],[6466,13,6466,30,1],[6467,13,6467,30,1],[6468,13,6468,30,1],[6469,13,6469,30,1],[6470,13,6470,30,1],[6471,13,6471,30,1],[6472,13,6472,30,1],[6473,13,6473,30,1],[6474,13,6474,30,1],[6475,13,6475,30,1],[6476,13,6476,30,1],[6477,13,6477,30,1],[6478,13,6478,30,1],[6479,13,6479,30,1],[6480,13,6480,30,1],[6481,13,6481,30,1],[6482,13,6482,30,1],[6483,13,6483,30,1],[6484,13,6484,30,1],[6485,13,6485,30,1],[6486,13,6486,30,1],[6487,13,6487,30,1],[6488,13,6488,30,1],[6489,13,6489,30,1],[6490,13,6490,30,1],[6491,13,6491,30,1],[6492,13,6492,30,1],[6493,13,6493,30,1],[6494,13,6494,30,1],[6495,13,6495,30,1],[6496,13,6496,30,1],[6497,13,6497,30,1],[6498,13,6498,30,1],[6499,13,6499,30,1],[6500,13,6500,30,1],[6501,13,6501,30,1],[6502,13,6502,30,1],[6503,13,6503,30,1],[6504,13,6504,30,1],[6505,13,6505,30,1],[6506,13,6506,30,1],[6507,13,6507,30,1],[6508,13,6508,30,1],[6509,13,6509,30,1],[6510,13,6510,30,1],[6511,13,6511,30,1],[6512,13,6512,30,1],[6513,13,6513,30,1],[6514,13,6514,30,1],[6515,13,6515,30,1],[6516,13,6516,30,1],[6517,13,6517,30,1],[6518,13,6518,30,1],[6519,13,6519,30,1],[6520,13,6520,30,1],[6521,13,6521,30,1],[6522,13,6522,30,1],[6523,13,6523,30,1],[6524,13,6524,30,1],[6525,13,6525,30,1],[6526,13,6526,30,1],[6527,13,6527,30,1],[6528,13,6528,30,1],[6529,13,6529,30,1],[6530,13,6530,30,1],[6531,13,6531,30,1],[6532,13,6532,30,1],[6533,13,6533,30,1],[6534,13,6534,30,1],[6535,13,6535,30,1],[6536,13,6536,30,1],[6537,13,6537,30,1],[6538,13,6538,30,1],[6539,13,6539,30,1],[6540,13,6540,30,1],[6541,13,6541,30,1],[6542,13,6542,30,1],[6543,13,6543,30,1],[6544,13,6544,30,1],[6545,13,6545,30,1],[6546,13,6546,30,1],[6547,13,6547,30,1],[6548,13,6548,30,1],[6549,13,6549,30,1],[6550,13,6550,30,1],[6551,13,6551,30,1],[6552,13,6552,30,1],[6553,13,6553,30,1],[6554,13,6554,30,1],[6555,13,6555,30,1],[6556,13,6556,30,1],[6557,13,6557,30,1],[6558,13,6558,30,1],[6559,13,6559,30,1],[6560,13,6560,30,1],[6561,13,6561,30,1],[6562,13,6562,30,1],[6563,13,6563,30,1],[6564,13,6564,30,1],[6565,13,6565,30,1],[6566,13,6566,30,1],[6567,13,6567,30,1],[6568,13,6568,30,1],[6569,13,6569,30,1],[6570,13,6570,30,1],[6571,13,6571,30,1],[6572,13,6572,30,1],[6573,13,6573,30,1],[6574,13,6574,30,1],[6575,13,6575,30,1],[6576,13,6576,30,1],[6577,13,6577,30,1],[6578,13,6578,30,1],[6579,13,6579,30,1],[6580,13,6580,30,1],[6581,13,6581,30,1],[6582,13,6582,30,1],[6583,13,6583,30,1],[6584,13,6584,30,1],[6585,13,6585,30,1],[6586,13,6586,30,1],[6587,13,6587,30,1],[6588,13,6588,30,1],[6589,13,6589,30,1],[6590,13,6590,30,1],[6591,13,6591,30,1],[6592,13,6592,30,1],[6593,13,6593,30,1],[6594,13,6594,30,1],[6595,13,6595,30,1],[6596,13,6596,30,1],[6597,13,6597,30,1],[6598,13,6598,30,1],[6599,13,6599,30,1],[6600,13,6600,30,1],[6601,13,6601,30,1],[6602,13,6602,30,1],[6603,13,6603,30,1],[6604,13,6604,30,1],[6605,13,6605,30,1],[6606,13,6606,30,1],[6607,13,6607,30,1],[6608,13,6608,30,1],[6609,13,6609,30,1],[6610,13,6610,30,1],[6611,13,6611,30,1],[6612,13,6612,30,1],[6613,13,6613,30,1],[6614,13,6614,30,1],[6615,13,6615,30,1],[6616,13,6616,30,1],[6617,13,6617,30,1],[6618,13,6618,30,1],[6619,13,6619,30,1],[6620,13,6620,30,1],[6621,13,6621,30,1],[6622,13,6622,30,1],[6623,13,6623,30,1],[6624,13,6624,30,1],[6625,13,6625,30,1],[6626,13,6626,30,1],[6627,13,6627,30,1],[6628,13,6628,30,1],[6629,13,6629,30,1],[6630,13,6630,30,1],[6631,13,6631,30,1],[6632,13,6632,30,1],[6633,13,6633,30,1],[6634,13,6634,30,1],[6635,13,6635,30,1],[6636,13,6636,30,1],[6637,13,6637,30,1],[6638,13,6638,30,1],[6639,13,6639,30,1],[6640,13,6640,30,1],[6641,13,6641,30,1],[6642,13,6642,30,1],[6643,13,6643,30,1],[6644,13,6644,30,1],[6645,13,6645,30,1],[6646,13,6646,30,1],[6647,13,6647,30,1],[6648,13,6648,30,1],[6649,13,6649,30,1],[6650,13,6650,30,1],[6651,13,6651,30,1],[6652,13,6652,30,1],[6653,13,6653,30,1],[6654,13,6654,30,1],[6655,13,6655,30,1],[6656,13,6656,30,1],[6657,13,6657,30,1],[6658,13,6658,30,1],[6659,13,6659,30,1],[6660,13,6660,30,1],[6661,13,6661,30,1],[6662,13,6662,30,1],[6663,13,6663,30,1],[6664,13,6664,30,1],[6665,13,6665,30,1],[6666,13,6666,30,1],[6667,13,6667,30,1],[6668,13,6668,30,1],[6669,13,6669,30,1],[6670,13,6670,30,1],[6671,13,6671,30,1],[6672,13,6672,30,1],[6673,13,6673,30,1],[6674,13,6674,30,1],[6675,13,6675,30,1],[6676,13,6676,30,1],[6677,13,6677,30,1],[6678,13,6678,30,1],[6679,13,6679,30,1],[6680,13,6680,30,1],[6681,13,6681,30,1],[6682,13,6682,30,1],[6683,13,6683,30,1],[6684,13,6684,30,1],[6685,13,6685,30,1],[6686,13,6686,30,1],[6687,13,6687,30,1],[6688,13,6688,30,1],[6689,13,6689,30,1],[6690,13,6690,30,1],[6691,13,6691,30,1],[6692,13,6692,30,1],[6693,13,6693,30,1],[6694,13,6694,30,1],[6695,13,6695,30,1],[6696,13,6696,30,1],[6697,13,6697,30,1],[6698,13,6698,30,1],[6699,13,6699,30,1],[6700,13,6700,30,1],[6701,13,6701,30,1],[6702,13,6702,30,1],[6703,13,6703,30,1],[6704,13,6704,30,1],[6705,13,6705,30,1],[6706,13,6706,30,1],[6707,13,6707,30,1],[6708,13,6708,30,1],[6709,13,6709,30,1],[6710,13,6710,30,1],[6711,13,6711,30,1],[6712,13,6712,30,1],[6713,13,6713,30,1],[6714,13,6714,30,1],[6715,13,6715,30,1],[6716,13,6716,30,1],[6717,13,6717,30,1],[6718,13,6718,30,1],[6719,13,6719,30,1],[6720,13,6720,30,1],[6721,13,6721,30,1],[6722,13,6722,30,1],[6723,13,6723,30,1],[6724,13,6724,30,1],[6725,13,6725,30,1],[6726,13,6726,30,1],[6727,13,6727,30,1],[6728,13,6728,30,1],[6729,13,6729,30,1],[6730,13,6730,30,1],[6731,13,6731,30,1],[6732,13,6732,30,1],[6733,13,6733,30,1],[6734,13,6734,30,1],[6735,13,6735,30,1],[6736,13,6736,30,1],[6737,13,6737,30,1],[6738,13,6738,30,1],[6739,13,6739,30,1],[6740,13,6740,30,1],[6741,13,6741,30,1],[6742,13,6742,30,1],[6743,13,6743,30,1],[6744,13,6744,30,1],[6745,13,6745,30,1],[6746,13,6746,30,1],[6747,13,6747,30,1],[6748,13,6748,30,1],[6749,13,6749,30,1],[6750,13,6750,30,1],[6751,13,6751,30,1],[6752,13,6752,30,1],[6753,13,6753,30,1],[6754,13,6754,30,1],[6755,13,6755,30,1],[6756,13,6756,30,1],[6757,13,6757,30,1],[6758,13,6758,30,1],[6759,13,6759,30,1],[6760,13,6760,30,1],[6761,13,6761,30,1],[6762,13,6762,30,1],[6763,13,6763,30,1],[6764,13,6764,30,1],[6765,13,6765,30,1],[6766,13,6766,30,1],[6767,13,6767,30,1],[6768,13,6768,30,1],[6769,13,6769,30,1],[6770,13,6770,30,1],[6771,13,6771,30,1],[6772,13,6772,30,1],[6773,13,6773,30,1],[6774,13,6774,30,1],[6775,13,6775,30,1],[6776,13,6776,30,1],[6777,13,6777,30,1],[6778,13,6778,30,1],[6779,13,6779,30,1],[6780,13,6780,30,1],[6781,13,6781,30,1],[6782,13,6782,30,1],[6783,13,6783,30,1],[6784,13,6784,30,1],[6785,13,6785,30,1],[6786,13,6786,30,1],[6787,13,6787,30,1],[6788,13,6788,30,1],[6789,13,6789,30,1],[6790,13,6790,30,1],[6791,13,6791,30,1],[6792,13,6792,30,1],[6793,13,6793,30,1],[6794,13,6794,30,1],[6795,13,6795,30,1],[6796,13,6796,30,1],[6797,13,6797,30,1],[6798,13,6798,30,1],[6799,13,6799,30,1],[6800,13,6800,30,1],[6801,13,6801,30,1],[6802,13,6802,30,1],[6803,13,6803,30,1],[6804,13,6804,30,1],[6805,13,6805,30,1],[6806,13,6806,30,1],[6807,13,6807,30,1],[6808,13,6808,30,1],[6809,13,6809,30,1],[6810,13,6810,30,1],[6811,13,6811,30,1],[6812,13,6812,30,1],[6813,13,6813,30,1],[6814,13,6814,30,1],[6815,13,6815,30,1],[6816,13,6816,30,1],[6817,13,6817,30,1],[6818,13,6818,30,1],[6819,13,6819,30,1],[6820,13,6820,30,1],[6821,13,6821,30,1],[6822,13,6822,30,1],[6823,13,6823,30,1],[6824,13,6824,30,1],[6825,13,6825,30,1],[6826,13,6826,30,1],[6827,13,6827,30,1],[6828,13,6828,30,1],[6829,13,6829,30,1],[6830,13,6830,30,1],[6831,13,6831,30,1],[6832,13,6832,30,1],[6833,13,6833,30,1],[6834,13,6834,30,1],[6835,13,6835,30,1],[6836,13,6836,30,1],[6837,13,6837,30,1],[6838,13,6838,30,1],[6839,13,6839,30,1],[6840,13,6840,30,1],[6841,13,6841,30,1],[6842,13,6842,30,1],[6843,13,6843,30,1],[6844,13,6844,30,1],[6845,13,6845,30,1],[6846,13,6846,30,1],[6847,13,6847,30,1],[6848,13,6848,30,1],[6849,13,6849,30,1],[6850,13,6850,30,1],[6851,13,6851,30,1],[6852,13,6852,30,1],[6853,13,6853,30,1],[6854,13,6854,30,1],[6855,13,6855,30,1],[6856,13,6856,30,1],[6857,13,6857,30,1],[6858,13,6858,30,1],[6859,13,6859,30,1],[6860,13,6860,30,1],[6861,13,6861,30,1],[6862,13,6862,30,1],[6863,13,6863,30,1],[6864,13,6864,30,1],[6865,13,6865,30,1],[6866,13,6866,30,1],[6867,13,6867,30,1],[6868,13,6868,30,1],[6869,13,6869,30,1],[6870,13,6870,30,1],[6871,13,6871,30,1],[6872,13,6872,30,1],[6873,13,6873,30,1],[6874,13,6874,30,1],[6875,13,6875,30,1],[6876,13,6876,30,1],[6877,13,6877,30,1],[6878,13,6878,30,1],[6879,13,6879,30,1],[6880,13,6880,30,1],[6881,13,6881,30,1],[6882,13,6882,30,1],[6883,13,6883,30,1],[6884,13,6884,30,1],[6885,13,6885,30,1],[6886,13,6886,30,1],[6887,13,6887,30,1],[6888,13,6888,30,1],[6889,13,6889,30,1],[6890,13,6890,30,1],[6891,13,6891,30,1],[6892,13,6892,30,1],[6893,13,6893,30,1],[6894,13,6894,30,1],[6895,13,6895,30,1],[6896,13,6896,30,1],[6897,13,6897,30,1],[6898,13,6898,30,1],[6899,13,6899,30,1],[6900,13,6900,30,1],[6901,13,6901,30,1],[6902,13,6902,30,1],[6903,13,6903,30,1],[6904,13,6904,30,1],[6905,13,6905,30,1],[6906,13,6906,30,1],[6907,13,6907,30,1],[6908,13,6908,30,1],[6909,13,6909,30,1],[6910,13,6910,30,1],[6911,13,6911,30,1],[6912,13,6912,30,1],[6913,13,6913,30,1],[6914,13,6914,30,1],[6915,13,6915,30,1],[6916,13,6916,30,1],[6917,13,6917,30,1],[6918,13,6918,30,1],[6919,13,6919,30,1],[6920,13,6920,30,1],[6921,13,6921,30,1],[6922,13,6922,30,1],[6923,13,6923,30,1],[6924,13,6924,30,1],[6925,13,6925,30,1],[6926,13,6926,30,1],[6927,13,6927,30,1],[6928,13,6928,30,1],[6929,13,6929,30,1],[6930,13,6930,30,1],[6931,13,6931,30,1],[6932,13,6932,30,1],[6933,13,6933,30,1],[6934,13,6934,30,1],[6935,13,6935,30,1],[6936,13,6936,30,1],[6937,13,6937,30,1],[6938,13,6938,30,1],[6939,13,6939,30,1],[6940,13,6940,30,1],[6941,13,6941,30,1],[6942,13,6942,30,1],[6943,13,6943,30,1],[6944,13,6944,30,1],[6945,13,6945,30,1],[6946,13,6946,30,1],[6947,13,6947,30,1],[6948,13,6948,30,1],[6949,13,6949,30,1],[6950,13,6950,30,1],[6951,13,6951,30,1],[6952,13,6952,30,1],[6953,13,6953,30,1],[6954,13,6954,30,1],[6955,13,6955,30,1],[6956,13,6956,30,1],[6957,13,6957,30,1],[6958,13,6958,30,1],[6959,13,6959,30,1],[6960,13,6960,30,1],[6961,13,6961,30,1],[6962,13,6962,30,1],[6963,13,6963,30,1],[6964,13,6964,30,1],[6965,13,6965,30,1],[6966,13,6966,30,1],[6967,13,6967,30,1],[6968,13,6968,30,1],[6969,13,6969,30,1],[6970,13,6970,30,1],[6971,13,6971,30,1],[6972,13,6972,30,1],[6973,13,6973,30,1],[6974,13,6974,30,1],[6975,13,6975,30,1],[6976,13,6976,30,1],[6977,13,6977,30,1],[6978,13,6978,30,1],[6979,13,6979,30,1],[6980,13,6980,30,1],[6981,13,6981,30,1],[6982,13,6982,30,1],[6983,13,6983,30,1],[6984,13,6984,30,1],[6985,13,6985,30,1],[6986,13,6986,30,1],[6987,13,6987,30,1],[6988,13,6988,30,1],[6989,13,6989,30,1],[6990,13,6990,30,1],[6991,13,6991,30,1],[6992,13,6992,30,1],[6993,13,6993,30,1],[6994,13,6994,30,1],[6995,13,6995,30,1],[6996,13,6996,30,1],[6997,13,6997,30,1],[6998,13,6998,30,1],[6999,13,6999,30,1],[7000,13,7000,30,1],[7001,13,7001,30,1],[7002,13,7002,30,1],[7003,13,7003,30,1],[7004,13,7004,30,1],[7005,13,7005,30,1],[7006,13,7006,30,1],[7007,13,7007,30,1],[7008,13,7008,30,1],[7009,13,7009,30,1],[7010,13,7010,30,1],[7011,13,7011,30,1],[7012,13,7012,30,1],[7013,13,7013,30,1],[7014,13,7014,30,1],[7015,13,7015,30,1],[7016,13,7016,30,1],[7017,13,7017,30,1],[7018,13,7018,30,1],[7019,13,7019,30,1],[7020,13,7020,30,1],[7021,13,7021,30,1],[7022,13,7022,30,1],[7023,13,7023,30,1],[7024,13,7024,30,1],[7025,13,7025,30,1],[7026,13,7026,30,1],[7027,13,7027,30,1],[7028,13,7028,30,1],[7029,13,7029,30,1],[7030,13,7030,30,1],[7031,13,7031,30,1],[7032,13,7032,30,1],[7033,13,7033,30,1],[7034,13,7034,30,1],[7035,13,7035,30,1],[7036,13,7036,30,1],[7037,13,7037,30,1],[7038,13,7038,30,1],[7039,13,7039,30,1],[7040,13,7040,30,1],[7041,13,7041,30,1],[7042,13,7042,30,1],[7043,13,7043,30,1],[7044,13,7044,30,1],[7045,13,7045,30,1],[7046,13,7046,30,1],[7047,13,7047,30,1],[7048,13,7048,30,1],[7049,13,7049,30,1],[7050,13,7050,30,1],[7051,13,7051,30,1],[7052,13,7052,30,1],[7053,13,7053,30,1],[7054,13,7054,30,1],[7055,13,7055,30,1],[7056,13,7056,30,1],[7057,13,7057,30,1],[7058,13,7058,30,1],[7059,13,7059,30,1],[7060,13,7060,30,1],[7061,13,7061,30,1],[7062,13,7062,30,1],[7063,13,7063,30,1],[7064,13,7064,30,1],[7065,13,7065,30,1],[7066,13,7066,30,1],[7067,13,7067,30,1],[7068,13,7068,30,1],[7069,13,7069,30,1],[7070,13,7070,30,1],[7071,13,7071,30,1],[7072,13,7072,30,1],[7073,13,7073,30,1],[7074,13,7074,30,1],[7075,13,7075,30,1],[7076,13,7076,30,1],[7077,13,7077,30,1],[7078,13,7078,30,1],[7079,13,7079,30,1],[7080,13,7080,30,1],[7081,13,7081,30,1],[7082,13,7082,30,1],[7083,13,7083,30,1],[7084,13,7084,30,1],[7085,13,7085,30,1],[7086,13,7086,30,1],[7087,13,7087,30,1],[7088,13,7088,30,1],[7089,13,7089,30,1],[7090,13,7090,30,1],[7091,13,7091,30,1],[7092,13,7092,30,1],[7093,13,7093,30,1],[7094,13,7094,30,1],[7095,13,7095,30,1],[7096,13,7096,30,1],[7097,13,7097,30,1],[7098,13,7098,30,1],[7099,13,7099,30,1],[7100,13,7100,30,1],[7101,13,7101,30,1],[7102,13,7102,30,1],[7103,13,7103,30,1],[7104,13,7104,30,1],[7105,13,7105,30,1],[7106,13,7106,30,1],[7107,13,7107,30,1],[7108,13,7108,30,1],[7109,13,7109,30,1],[7110,13,7110,30,1],[7111,13,7111,30,1],[7112,13,7112,30,1],[7113,13,7113,30,1],[7114,13,7114,30,1],[7115,13,7115,30,1],[7116,13,7116,30,1],[7117,13,7117,30,1],[7118,13,7118,30,1],[7119,13,7119,30,1],[7120,13,7120,30,1],[7121,13,7121,30,1],[7122,13,7122,30,1],[7123,13,7123,30,1],[7124,13,7124,30,1],[7125,13,7125,30,1],[7126,13,7126,30,1],[7127,13,7127,30,1],[7128,13,7128,30,1],[7129,13,7129,30,1],[7130,13,7130,30,1],[7131,13,7131,30,1],[7132,13,7132,30,1],[7133,13,7133,30,1],[7134,13,7134,30,1],[7135,13,7135,30,1],[7136,13,7136,30,1],[7137,13,7137,30,1],[7138,13,7138,30,1],[7139,13,7139,30,1],[7140,13,7140,30,1],[7141,13,7141,30,1],[7142,13,7142,30,1],[7143,13,7143,30,1],[7144,13,7144,30,1],[7145,13,7145,30,1],[7146,13,7146,30,1],[7147,13,7147,30,1],[7148,13,7148,30,1],[7149,13,7149,30,1],[7150,13,7150,30,1],[7151,13,7151,30,1],[7152,13,7152,30,1],[7153,13,7153,30,1],[7154,13,7154,30,1],[7155,13,7155,30,1],[7156,13,7156,30,1],[7157,13,7157,30,1],[7158,13,7158,30,1],[7159,13,7159,30,1],[7160,13,7160,30,1],[7161,13,7161,30,1],[7162,13,7162,30,1],[7163,13,7163,30,1],[7164,13,7164,30,1],[7165,13,7165,30,1],[7166,13,7166,30,1],[7167,13,7167,30,1],[7168,13,7168,30,1],[7169,13,7169,30,1],[7170,13,7170,30,1],[7171,13,7171,30,1],[7172,13,7172,30,1],[7173,13,7173,30,1],[7174,13,7174,30,1],[7175,13,7175,30,1],[7176,13,7176,30,1],[7177,13,7177,30,1],[7178,13,7178,30,1],[7179,13,7179,30,1],[7180,13,7180,30,1],[7181,13,7181,30,1],[7182,13,7182,30,1],[7183,13,7183,30,1],[7184,13,7184,30,1],[7185,13,7185,30,1],[7186,13,7186,30,1],[7187,13,7187,30,1],[7188,13,7188,30,1],[7189,13,7189,30,1],[7190,13,7190,30,1],[7191,13,7191,30,1],[7192,13,7192,30,1],[7193,13,7193,30,1],[7194,13,7194,30,1],[7195,13,7195,30,1],[7196,13,7196,30,1],[7197,13,7197,30,1],[7198,13,7198,30,1],[7199,13,7199,30,1],[7200,13,7200,30,1],[7201,13,7201,30,1],[7202,13,7202,30,1],[7203,13,7203,30,1],[7204,13,7204,30,1],[7205,13,7205,30,1],[7206,13,7206,30,1],[7207,13,7207,30,1],[7208,13,7208,30,1],[7209,13,7209,30,1],[7210,13,7210,30,1],[7211,13,7211,30,1],[7212,13,7212,30,1],[7213,13,7213,30,1],[7214,13,7214,30,1],[7215,13,7215,30,1],[7216,13,7216,30,1],[7217,13,7217,30,1],[7218,13,7218,30,1],[7219,13,7219,30,1],[7220,13,7220,30,1],[7221,13,7221,30,1],[7222,13,7222,30,1],[7223,13,7223,30,1],[7224,13,7224,30,1],[7225,13,7225,30,1],[7226,13,7226,30,1],[7227,13,7227,30,1],[7228,13,7228,30,1],[7229,13,7229,30,1],[7230,13,7230,30,1],[7231,13,7231,30,1],[7232,13,7232,30,1],[7233,13,7233,30,1],[7234,13,7234,30,1],[7235,13,7235,30,1],[7236,13,7236,30,1],[7237,13,7237,30,1],[7238,13,7238,30,1],[7239,13,7239,30,1],[7240,13,7240,30,1],[7241,13,7241,30,1],[7242,13,7242,30,1],[7243,13,7243,30,1],[7244,13,7244,30,1],[7245,13,7245,30,1],[7246,13,7246,30,1],[7247,13,7247,30,1],[7248,13,7248,30,1],[7249,13,7249,30,1],[7250,13,7250,30,1],[7251,13,7251,30,1],[7252,13,7252,30,1],[7253,13,7253,30,1],[7254,13,7254,30,1],[7255,13,7255,30,1],[7256,13,7256,30,1],[7257,13,7257,30,1],[7258,13,7258,30,1],[7259,13,7259,30,1],[7260,13,7260,30,1],[7261,13,7261,30,1],[7262,13,7262,30,1],[7263,13,7263,30,1],[7264,13,7264,30,1],[7265,13,7265,30,1],[7266,13,7266,30,1],[7267,13,7267,30,1],[7268,13,7268,30,1],[7269,13,7269,30,1],[7270,13,7270,30,1],[7271,13,7271,30,1],[7272,13,7272,30,1],[7273,13,7273,30,1],[7274,13,7274,30,1],[7275,13,7275,30,1],[7276,13,7276,30,1],[7277,13,7277,30,1],[7278,13,7278,30,1],[7279,13,7279,30,1],[7280,13,7280,30,1],[7281,13,7281,30,1],[7282,13,7282,30,1],[7283,13,7283,30,1],[7284,13,7284,30,1],[7285,13,7285,30,1],[7286,13,7286,30,1],[7287,13,7287,30,1],[7288,13,7288,30,1],[7289,13,7289,30,1],[7290,13,7290,30,1],[7291,13,7291,30,1],[7292,13,7292,30,1],[7293,13,7293,30,1],[7294,13,7294,30,1],[7295,13,7295,30,1],[7296,13,7296,30,1],[7297,13,7297,30,1],[7298,13,7298,30,1],[7299,13,7299,30,1],[7300,13,7300,30,1],[7301,13,7301,30,1],[7302,13,7302,30,1],[7303,13,7303,30,1],[7304,13,7304,30,1],[7305,13,7305,30,1],[7306,13,7306,30,1],[7307,13,7307,30,1],[7308,13,7308,30,1],[7309,13,7309,30,1],[7310,13,7310,30,1],[7311,13,7311,30,1],[7312,13,7312,30,1],[7313,13,7313,30,1],[7314,13,7314,30,1],[7315,13,7315,30,1],[7316,13,7316,30,1],[7317,13,7317,30,1],[7318,13,7318,30,1],[7319,13,7319,30,1],[7320,13,7320,30,1],[7321,13,7321,30,1],[7322,13,7322,30,1],[7323,13,7323,30,1],[7324,13,7324,30,1],[7325,13,7325,30,1],[7326,13,7326,30,1],[7327,13,7327,30,1],[7328,13,7328,30,1],[7329,13,7329,30,1],[7330,13,7330,30,1],[7331,13,7331,30,1],[7332,13,7332,30,1],[7333,13,7333,30,1],[7334,13,7334,30,1],[7335,13,7335,30,1],[7336,13,7336,30,1],[7337,13,7337,30,1],[7338,13,7338,30,1],[7339,13,7339,30,1],[7340,13,7340,30,1],[7341,13,7341,30,1],[7342,13,7342,30,1],[7343,13,7343,30,1],[7344,13,7344,30,1],[7345,13,7345,30,1],[7346,13,7346,30,1],[7347,13,7347,30,1],[7348,13,7348,30,1],[7349,13,7349,30,1],[7350,13,7350,30,1],[7351,13,7351,30,1],[7352,13,7352,30,1],[7353,13,7353,30,1],[7354,13,7354,30,1],[7355,13,7355,30,1],[7356,13,7356,30,1],[7357,13,7357,30,1],[7358,13,7358,30,1],[7359,13,7359,30,1],[7360,13,7360,30,1],[7361,13,7361,30,1],[7362,13,7362,30,1],[7363,13,7363,30,1],[7364,13,7364,30,1],[7365,13,7365,30,1],[7366,13,7366,30,1],[7367,13,7367,30,1],[7368,13,7368,30,1],[7369,13,7369,30,1],[7370,13,7370,30,1],[7371,13,7371,30,1],[7372,13,7372,30,1],[7373,13,7373,30,1],[7374,13,7374,30,1],[7375,13,7375,30,1],[7376,13,7376,30,1],[7377,13,7377,30,1],[7378,13,7378,30,1],[7379,13,7379,30,1],[7380,13,7380,30,1],[7381,13,7381,30,1],[7382,13,7382,30,1],[7383,13,7383,30,1],[7384,13,7384,30,1],[7385,13,7385,30,1],[7386,13,7386,30,1],[7387,13,7387,30,1],[7388,13,7388,30,1],[7389,13,7389,30,1],[7390,13,7390,30,1],[7391,13,7391,30,1],[7392,13,7392,30,1],[7393,13,7393,30,1],[7394,13,7394,30,1],[7395,13,7395,30,1],[7396,13,7396,30,1],[7397,13,7397,30,1],[7398,13,7398,30,1],[7399,13,7399,30,1],[7400,13,7400,30,1],[7401,13,7401,30,1],[7402,13,7402,30,1],[7403,13,7403,30,1],[7404,13,7404,30,1],[7405,13,7405,30,1],[7406,13,7406,30,1],[7407,13,7407,30,1],[7408,13,7408,30,1],[7409,13,7409,30,1],[7410,13,7410,30,1],[7411,13,7411,30,1],[7412,13,7412,30,1],[7413,13,7413,30,1],[7414,13,7414,30,1],[7415,13,7415,30,1],[7416,13,7416,30,1],[7417,13,7417,30,1],[7418,13,7418,30,1],[7419,13,7419,30,1],[7420,13,7420,30,1],[7421,13,7421,30,1],[7422,13,7422,30,1],[7423,13,7423,30,1],[7424,13,7424,30,1],[7425,13,7425,30,1],[7426,13,7426,30,1],[7427,13,7427,30,1],[7428,13,7428,30,1],[7429,13,7429,30,1],[7430,13,7430,30,1],[7431,13,7431,30,1],[7432,13,7432,30,1],[7433,13,7433,30,1],[7434,13,7434,30,1],[7435,13,7435,30,1],[7436,13,7436,30,1],[7437,13,7437,30,1],[7438,13,7438,30,1],[7439,13,7439,30,1],[7440,13,7440,30,1],[7441,13,7441,30,1],[7442,13,7442,30,1],[7443,13,7443,30,1],[7444,13,7444,30,1],[7445,13,7445,30,1],[7446,13,7446,30,1],[7447,13,7447,30,1],[7448,13,7448,30,1],[7449,13,7449,30,1],[7450,13,7450,30,1],[7451,13,7451,30,1],[7452,13,7452,30,1],[7453,13,7453,30,1],[7454,13,7454,30,1],[7455,13,7455,30,1],[7456,13,7456,30,1],[7457,13,7457,30,1],[7458,13,7458,30,1],[7459,13,7459,30,1],[7460,13,7460,30,1],[7461,13,7461,30,1],[7462,13,7462,30,1],[7463,13,7463,30,1],[7464,13,7464,30,1],[7465,13,7465,30,1],[7466,13,7466,30,1],[7467,13,7467,30,1],[7468,13,7468,30,1],[7469,13,7469,30,1],[7470,13,7470,30,1],[7471,13,7471,30,1],[7472,13,7472,30,1],[7473,13,7473,30,1],[7474,13,7474,30,1],[7475,13,7475,30,1],[7476,13,7476,30,1],[7477,13,7477,30,1],[7478,13,7478,30,1],[7479,13,7479,30,1],[7480,13,7480,30,1],[7481,13,7481,30,1],[7482,13,7482,30,1],[7483,13,7483,30,1],[7484,13,7484,30,1],[7485,13,7485,30,1],[7486,13,7486,30,1],[7487,13,7487,30,1],[7488,13,7488,30,1],[7489,13,7489,30,1],[7490,13,7490,30,1],[7491,13,7491,30,1],[7492,13,7492,30,1],[7493,13,7493,30,1],[7494,13,7494,30,1],[7495,13,7495,30,1],[7496,13,7496,30,1],[7497,13,7497,30,1],[7498,13,7498,30,1],[7499,13,7499,30,1],[7500,13,7500,30,1],[7501,13,7501,30,1],[7502,13,7502,30,1],[7503,13,7503,30,1],[7504,13,7504,30,1],[7505,13,7505,30,1],[7506,13,7506,30,1],[7507,13,7507,30,1],[7508,13,7508,30,1],[7509,13,7509,30,1],[7510,13,7510,30,1],[7511,13,7511,30,1],[7512,13,7512,30,1],[7513,13,7513,30,1],[7514,13,7514,30,1],[7515,13,7515,30,1],[7516,13,7516,30,1],[7517,13,7517,30,1],[7518,13,7518,30,1],[7519,13,7519,30,1],[7520,13,7520,30,1],[7521,13,7521,30,1],[7522,13,7522,30,1],[7523,13,7523,30,1],[7524,13,7524,30,1],[7525,13,7525,30,1],[7526,13,7526,30,1],[7527,13,7527,30,1],[7528,13,7528,30,1],[7529,13,7529,30,1],[7530,13,7530,30,1],[7531,13,7531,30,1],[7532,13,7532,30,1],[7533,13,7533,30,1],[7534,13,7534,30,1],[7535,13,7535,30,1],[7536,13,7536,30,1],[7537,13,7537,30,1],[7538,13,7538,30,1],[7539,13,7539,30,1],[7540,13,7540,30,1],[7541,13,7541,30,1],[7542,13,7542,30,1],[7543,13,7543,30,1],[7544,13,7544,30,1],[7545,13,7545,30,1],[7546,13,7546,30,1],[7547,13,7547,30,1],[7548,13,7548,30,1],[7549,13,7549,30,1],[7550,13,7550,30,1],[7551,13,7551,30,1],[7552,13,7552,30,1],[7553,13,7553,30,1],[7554,13,7554,30,1],[7555,13,7555,30,1],[7556,13,7556,30,1],[7557,13,7557,30,1],[7558,13,7558,30,1],[7559,13,7559,30,1],[7560,13,7560,30,1],[7561,13,7561,30,1],[7562,13,7562,30,1],[7563,13,7563,30,1],[7564,13,7564,30,1],[7565,13,7565,30,1],[7566,13,7566,30,1],[7567,13,7567,30,1],[7568,13,7568,30,1],[7569,13,7569,30,1],[7570,13,7570,30,1],[7571,13,7571,30,1],[7572,13,7572,30,1],[7573,13,7573,30,1],[7574,13,7574,30,1],[7575,13,7575,30,1],[7576,13,7576,30,1],[7577,13,7577,30,1],[7578,13,7578,30,1],[7579,13,7579,30,1],[7580,13,7580,30,1],[7581,13,7581,30,1],[7582,13,7582,30,1],[7583,13,7583,30,1],[7584,13,7584,30,1],[7585,13,7585,30,1],[7586,13,7586,30,1],[7587,13,7587,30,1],[7588,13,7588,30,1],[7589,13,7589,30,1],[7590,13,7590,30,1],[7591,13,7591,30,1],[7592,13,7592,30,1],[7593,13,7593,30,1],[7594,13,7594,30,1],[7595,13,7595,30,1],[7596,13,7596,30,1],[7597,13,7597,30,1],[7598,13,7598,30,1],[7599,13,7599,30,1],[7600,13,7600,30,1],[7601,13,7601,30,1],[7602,13,7602,30,1],[7603,13,7603,30,1],[7604,13,7604,30,1],[7605,13,7605,30,1],[7606,13,7606,30,1],[7607,13,7607,30,1],[7608,13,7608,30,1],[7609,13,7609,30,1],[7610,13,7610,30,1],[7611,13,7611,30,1],[7612,13,7612,30,1],[7613,13,7613,30,1],[7614,13,7614,30,1],[7615,13,7615,30,1],[7616,13,7616,30,1],[7617,13,7617,30,1],[7618,13,7618,30,1],[7619,13,7619,30,1],[7620,13,7620,30,1],[7621,13,7621,30,1],[7622,13,7622,30,1],[7623,13,7623,30,1],[7624,13,7624,30,1],[7625,13,7625,30,1],[7626,13,7626,30,1],[7627,13,7627,30,1],[7628,13,7628,30,1],[7629,13,7629,30,1],[7630,13,7630,30,1],[7631,13,7631,30,1],[7632,13,7632,30,1],[7633,13,7633,30,1],[7634,13,7634,30,1],[7635,13,7635,30,1],[7636,13,7636,30,1],[7637,13,7637,30,1],[7638,13,7638,30,1],[7639,13,7639,30,1],[7640,13,7640,30,1],[7641,13,7641,30,1],[7642,13,7642,30,1],[7643,13,7643,30,1],[7644,13,7644,30,1],[7645,13,7645,30,1],[7646,13,7646,30,1],[7647,13,7647,30,1],[7648,13,7648,30,1],[7649,13,7649,30,1],[7650,13,7650,30,1],[7651,13,7651,30,1],[7652,13,7652,30,1],[7653,13,7653,30,1],[7654,13,7654,30,1],[7655,13,7655,30,1],[7656,13,7656,30,1],[7657,13,7657,30,1],[7658,13,7658,30,1],[7659,13,7659,30,1],[7660,13,7660,30,1],[7661,13,7661,30,1],[7662,13,7662,30,1],[7663,13,7663,30,1],[7664,13,7664,30,1],[7665,13,7665,30,1],[7666,13,7666,30,1],[7667,13,7667,30,1],[7668,13,7668,30,1],[7669,13,7669,30,1],[7670,13,7670,30,1],[7671,13,7671,30,1],[7672,13,7672,30,1],[7673,13,7673,30,1],[7674,13,7674,30,1],[7675,13,7675,30,1],[7676,13,7676,30,1],[7677,13,7677,30,1],[7678,13,7678,30,1],[7679,13,7679,30,1],[7680,13,7680,30,1],[7681,13,7681,30,1],[7682,13,7682,30,1],[7683,13,7683,30,1],[7684,13,7684,30,1],[7685,13,7685,30,1],[7686,13,7686,30,1],[7687,13,7687,30,1],[7688,13,7688,30,1],[7689,13,7689,30,1],[7690,13,7690,30,1],[7691,13,7691,30,1],[7692,13,7692,30,1],[7693,13,7693,30,1],[7694,13,7694,30,1],[7695,13,7695,30,1],[7696,13,7696,30,1],[7697,13,7697,30,1],[7698,13,7698,30,1],[7699,13,7699,30,1],[7700,13,7700,30,1],[7701,13,7701,30,1],[7702,13,7702,30,1],[7703,13,7703,30,1],[7704,13,7704,30,1],[7705,13,7705,30,1],[7706,13,7706,30,1],[7707,13,7707,30,1],[7708,13,7708,30,1],[7709,13,7709,30,1],[7710,13,7710,30,1],[7711,13,7711,30,1],[7712,13,7712,30,1],[7713,13,7713,30,1],[7714,13,7714,30,1],[7715,13,7715,30,1],[7716,13,7716,30,1],[7717,13,7717,30,1],[7718,13,7718,30,1],[7719,13,7719,30,1],[7720,13,7720,30,1],[7721,13,7721,30,1],[7722,13,7722,30,1],[7723,13,7723,30,1],[7724,13,7724,30,1],[7725,13,7725,30,1],[7726,13,7726,30,1],[7727,13,7727,30,1],[7728,13,7728,30,1],[7729,13,7729,30,1],[7730,13,7730,30,1],[7731,13,7731,30,1],[7732,13,7732,30,1],[7733,13,7733,30,1],[7734,13,7734,30,1],[7735,13,7735,30,1],[7736,13,7736,30,1],[7737,13,7737,30,1],[7738,13,7738,30,1],[7739,13,7739,30,1],[7740,13,7740,30,1],[7741,13,7741,30,1],[7742,13,7742,30,1],[7743,13,7743,30,1],[7744,13,7744,30,1],[7745,13,7745,30,1],[7746,13,7746,30,1],[7747,13,7747,30,1],[7748,13,7748,30,1],[7749,13,7749,30,1],[7750,13,7750,30,1],[7751,13,7751,30,1],[7752,13,7752,30,1],[7753,13,7753,30,1],[7754,13,7754,30,1],[7755,13,7755,30,1],[7756,13,7756,30,1],[7757,13,7757,30,1],[7758,13,7758,30,1],[7759,13,7759,30,1],[7760,13,7760,30,1],[7761,13,7761,30,1],[7762,13,7762,30,1],[7763,13,7763,30,1],[7764,13,7764,30,1],[7765,13,7765,30,1],[7766,13,7766,30,1],[7767,13,7767,30,1],[7768,13,7768,30,1],[7769,13,7769,30,1],[7770,13,7770,30,1],[7771,13,7771,30,1],[7772,13,7772,30,1],[7773,13,7773,30,1],[7774,13,7774,30,1],[7775,13,7775,30,1],[7776,13,7776,30,1],[7777,13,7777,30,1],[7778,13,7778,30,1],[7779,13,7779,30,1],[7780,13,7780,30,1],[7781,13,7781,30,1],[7782,13,7782,30,1],[7783,13,7783,30,1],[7784,13,7784,30,1],[7785,13,7785,30,1],[7786,13,7786,30,1],[7787,13,7787,30,1],[7788,13,7788,30,1],[7789,13,7789,30,1],[7790,13,7790,30,1],[7791,13,7791,30,1],[7792,13,7792,30,1],[7793,13,7793,30,1],[7794,13,7794,30,1],[7795,13,7795,30,1],[7796,13,7796,30,1],[7797,13,7797,30,1],[7798,13,7798,30,1],[7799,13,7799,30,1],[7800,13,7800,30,1],[7801,13,7801,30,1],[7802,13,7802,30,1],[7803,13,7803,30,1],[7804,13,7804,30,1],[7805,13,7805,30,1],[7806,13,7806,30,1],[7807,13,7807,30,1],[7808,13,7808,30,1],[7809,13,7809,30,1],[7810,13,7810,30,1],[7811,13,7811,30,1],[7812,13,7812,30,1],[7813,13,7813,30,1],[7814,13,7814,30,1],[7815,13,7815,30,1],[7816,13,7816,30,1],[7817,13,7817,30,1],[7818,13,7818,30,1],[7819,13,7819,30,1],[7820,13,7820,30,1],[7821,13,7821,30,1],[7822,13,7822,30,1],[7823,13,7823,30,1],[7824,13,7824,30,1],[7825,13,7825,30,1],[7826,13,7826,30,1],[7827,13,7827,30,1],[7828,13,7828,30,1],[7829,13,7829,30,1],[7830,13,7830,30,1],[7831,13,7831,30,1],[7832,13,7832,30,1],[7833,13,7833,30,1],[7834,13,7834,30,1],[7835,13,7835,30,1],[7836,13,7836,30,1],[7837,13,7837,30,1],[7838,13,7838,30,1],[7839,13,7839,30,1],[7840,13,7840,30,1],[7841,13,7841,30,1],[7842,13,7842,30,1],[7843,13,7843,30,1],[7844,13,7844,30,1],[7845,13,7845,30,1],[7846,13,7846,30,1],[7847,13,7847,30,1],[7848,13,7848,30,1],[7849,13,7849,30,1],[7850,13,7850,30,1],[7851,13,7851,30,1],[7852,13,7852,30,1],[7853,13,7853,30,1],[7854,13,7854,30,1],[7855,13,7855,30,1],[7856,13,7856,30,1],[7857,13,7857,30,1],[7858,13,7858,30,1],[7859,13,7859,30,1],[7860,13,7860,30,1],[7861,13,7861,30,1],[7862,13,7862,30,1],[7863,13,7863,30,1],[7864,13,7864,30,1],[7865,13,7865,30,1],[7866,13,7866,30,1],[7867,13,7867,30,1],[7868,13,7868,30,1],[7869,13,7869,30,1],[7870,13,7870,30,1],[7871,13,7871,30,1],[7872,13,7872,30,1],[7873,13,7873,30,1],[7874,13,7874,30,1],[7875,13,7875,30,1],[7876,13,7876,30,1],[7877,13,7877,30,1],[7878,13,7878,30,1],[7879,13,7879,30,1],[7880,13,7880,30,1],[7881,13,7881,30,1],[7882,13,7882,30,1],[7883,13,7883,30,1],[7884,13,7884,30,1],[7885,13,7885,30,1],[7886,13,7886,30,1],[7887,13,7887,30,1],[7888,13,7888,30,1],[7889,13,7889,30,1],[7890,13,7890,30,1],[7891,13,7891,30,1],[7892,13,7892,30,1],[7893,13,7893,30,1],[7894,13,7894,30,1],[7895,13,7895,30,1],[7896,13,7896,30,1],[7897,13,7897,30,1],[7898,13,7898,30,1],[7899,13,7899,30,1],[7900,13,7900,30,1],[7901,13,7901,30,1],[7902,13,7902,30,1],[7903,13,7903,30,1],[7904,13,7904,30,1],[7905,13,7905,30,1],[7906,13,7906,30,1],[7907,13,7907,30,1],[7908,13,7908,30,1],[7909,13,7909,30,1],[7910,13,7910,30,1],[7911,13,7911,30,1],[7912,13,7912,30,1],[7913,13,7913,30,1],[7914,13,7914,30,1],[7915,13,7915,30,1],[7916,13,7916,30,1],[7917,13,7917,30,1],[7918,13,7918,30,1],[7919,13,7919,30,1],[7920,13,7920,30,1],[7921,13,7921,30,1],[7922,13,7922,30,1],[7923,13,7923,30,1],[7924,13,7924,30,1],[7925,13,7925,30,1],[7926,13,7926,30,1],[7927,13,7927,30,1],[7928,13,7928,30,1],[7929,13,7929,30,1],[7930,13,7930,30,1],[7931,13,7931,30,1],[7932,13,7932,30,1],[7933,13,7933,30,1],[7934,13,7934,30,1],[7935,13,7935,30,1],[7936,13,7936,30,1],[7937,13,7937,30,1],[7938,13,7938,30,1],[7939,13,7939,30,1],[7940,13,7940,30,1],[7941,13,7941,30,1],[7942,13,7942,30,1],[7943,13,7943,30,1],[7944,13,7944,30,1],[7945,13,7945,30,1],[7946,13,7946,30,1],[7947,13,7947,30,1],[7948,13,7948,30,1],[7949,13,7949,30,1],[7950,13,7950,30,1],[7951,13,7951,30,1],[7952,13,7952,30,1],[7953,13,7953,30,1],[7954,13,7954,30,1],[7955,13,7955,30,1],[7956,13,7956,30,1],[7957,13,7957,30,1],[7958,13,7958,30,1],[7959,13,7959,30,1],[7960,13,7960,30,1],[7961,13,7961,30,1],[7962,13,7962,30,1],[7963,13,7963,30,1],[7964,13,7964,30,1],[7965,13,7965,30,1],[7966,13,7966,30,1],[7967,13,7967,30,1],[7968,13,7968,30,1],[7969,13,7969,30,1],[7970,13,7970,30,1],[7971,13,7971,30,1],[7972,13,7972,30,1],[7973,13,7973,30,1],[7974,13,7974,30,1],[7975,13,7975,30,1],[7976,13,7976,30,1],[7977,13,7977,30,1],[7978,13,7978,30,1],[7979,13,7979,30,1],[7980,13,7980,30,1],[7981,13,7981,30,1],[7982,13,7982,30,1],[7983,13,7983,30,1],[7984,13,7984,30,1],[7985,13,7985,30,1],[7986,13,7986,30,1],[7987,13,7987,30,1],[7988,13,7988,30,1],[7989,13,7989,30,1],[7990,13,7990,30,1],[7991,13,7991,30,1],[7992,13,7992,30,1],[7993,13,7993,30,1],[7994,13,7994,30,1],[7995,13,7995,30,1],[7996,13,7996,30,1],[7997,13,7997,30,1],[7998,13,7998,30,1],[7999,13,7999,30,1],[8000,13,8000,30,1],[8001,13,8001,30,1],[8002,13,8002,30,1],[8003,13,8003,30,1],[8004,13,8004,30,1],[8005,13,8005,30,1],[8006,13,8006,30,1],[8007,13,8007,30,1],[8008,13,8008,30,1],[8009,13,8009,30,1],[8010,13,8010,30,1],[8011,13,8011,30,1],[8012,13,8012,30,1],[8013,13,8013,30,1],[8014,13,8014,30,1],[8015,13,8015,30,1],[8016,13,8016,30,1],[8017,13,8017,30,1],[8018,13,8018,30,1],[8019,13,8019,30,1],[8020,13,8020,30,1],[8021,13,8021,30,1],[8022,13,8022,30,1],[8023,13,8023,30,1],[8024,13,8024,30,1],[8025,13,8025,30,1],[8026,13,8026,30,1],[8027,13,8027,30,1],[8028,13,8028,30,1],[8029,13,8029,30,1],[8030,13,8030,30,1],[8031,13,8031,30,1],[8032,13,8032,30,1],[8033,13,8033,30,1],[8034,13,8034,30,1],[8035,13,8035,30,1],[8036,13,8036,30,1],[8037,13,8037,30,1],[8038,13,8038,30,1],[8039,13,8039,30,1],[8040,13,8040,30,1],[8041,13,8041,30,1],[8042,13,8042,30,1],[8043,13,8043,30,1],[8044,13,8044,30,1],[8045,13,8045,30,1],[8046,13,8046,30,1],[8047,13,8047,30,1],[8048,13,8048,30,1],[8049,13,8049,30,1],[8050,13,8050,30,1],[8051,13,8051,30,1],[8052,13,8052,30,1],[8053,13,8053,30,1],[8054,13,8054,30,1],[8055,13,8055,30,1],[8056,13,8056,30,1],[8057,13,8057,30,1],[8058,13,8058,30,1],[8059,13,8059,30,1],[8060,13,8060,30,1],[8061,13,8061,30,1],[8062,13,8062,30,1],[8063,13,8063,30,1],[8064,13,8064,30,1],[8065,13,8065,30,1],[8066,13,8066,30,1],[8067,13,8067,30,1],[8068,13,8068,30,1],[8069,13,8069,30,1],[8070,13,8070,30,1],[8071,13,8071,30,1],[8072,13,8072,30,1],[8073,13,8073,30,1],[8074,13,8074,30,1],[8075,13,8075,30,1],[8076,13,8076,30,1],[8077,13,8077,30,1],[8078,13,8078,30,1],[8079,13,8079,30,1],[8080,13,8080,30,1],[8081,13,8081,30,1],[8082,13,8082,30,1],[8083,13,8083,30,1],[8084,13,8084,30,1],[8085,13,8085,30,1],[8086,13,8086,30,1],[8087,13,8087,30,1],[8088,13,8088,30,1],[8089,13,8089,30,1],[8090,13,8090,30,1],[8091,13,8091,30,1],[8092,13,8092,30,1],[8093,13,8093,30,1],[8094,13,8094,30,1],[8095,13,8095,30,1],[8096,13,8096,30,1],[8097,13,8097,30,1],[8098,13,8098,30,1],[8099,13,8099,30,1],[8100,13,8100,30,1],[8101,13,8101,30,1],[8102,13,8102,30,1],[8103,13,8103,30,1],[8104,13,8104,30,1],[8105,13,8105,30,1],[8106,13,8106,30,1],[8107,13,8107,30,1],[8108,13,8108,30,1],[8109,13,8109,30,1],[8110,13,8110,30,1],[8111,13,8111,30,1],[8112,13,8112,30,1],[8113,13,8113,30,1],[8114,13,8114,30,1],[8115,13,8115,30,1],[8116,13,8116,30,1],[8117,13,8117,30,1],[8118,13,8118,30,1],[8119,13,8119,30,1],[8120,13,8120,30,1],[8121,13,8121,30,1],[8122,13,8122,30,1],[8123,13,8123,30,1],[8124,13,8124,30,1],[8125,13,8125,30,1],[8126,13,8126,30,1],[8127,13,8127,30,1],[8128,13,8128,30,1],[8129,13,8129,30,1],[8130,13,8130,30,1],[8131,13,8131,30,1],[8132,13,8132,30,1],[8133,13,8133,30,1],[8134,13,8134,30,1],[8135,13,8135,30,1],[8136,13,8136,30,1],[8137,13,8137,30,1],[8138,13,8138,30,1],[8139,13,8139,30,1],[8140,13,8140,30,1],[8141,13,8141,30,1],[8142,13,8142,30,1],[8143,13,8143,30,1],[8144,13,8144,30,1],[8145,13,8145,30,1],[8146,13,8146,30,1],[8147,13,8147,30,1],[8148,13,8148,30,1],[8149,13,8149,30,1],[8150,13,8150,30,1],[8151,13,8151,30,1],[8152,13,8152,30,1],[8153,13,8153,30,1],[8154,13,8154,30,1],[8155,13,8155,30,1],[8156,13,8156,30,1],[8157,13,8157,30,1],[8158,13,8158,30,1],[8159,13,8159,30,1],[8160,13,8160,30,1],[8161,13,8161,30,1],[8162,13,8162,30,1],[8163,13,8163,30,1],[8164,13,8164,30,1],[8165,13,8165,30,1],[8166,13,8166,30,1],[8167,13,8167,30,1],[8168,13,8168,30,1],[8169,13,8169,30,1],[8170,13,8170,30,1],[8171,13,8171,30,1],[8172,13,8172,30,1],[8173,13,8173,30,1],[8174,13,8174,30,1],[8175,13,8175,30,1],[8176,13,8176,30,1],[8177,13,8177,30,1],[8178,13,8178,30,1],[8179,13,8179,30,1],[8180,13,8180,30,1],[8181,13,8181,30,1],[8182,13,8182,30,1],[8183,13,8183,30,1],[8184,13,8184,30,1],[8185,13,8185,30,1],[8186,13,8186,30,1],[8187,13,8187,30,1],[8188,13,8188,30,1],[8189,13,8189,30,1],[8190,13,8190,30,1],[8191,13,8191,30,1],[8192,13,8192,30,1],[8193,13,8193,30,1],[8194,13,8194,30,1],[8195,13,8195,30,1],[8196,13,8196,30,1],[8197,13,8197,30,1],[8198,13,8198,30,1],[8199,13,8199,30,1],[8200,13,8200,30,1],[8201,13,8201,30,1],[8202,13,8202,30,1],[8203,13,8203,30,1],[8204,13,8204,30,1],[8205,13,8205,30,1],[8206,13,8206,30,1],[8207,13,8207,30,1],[8208,13,8208,30,1],[8209,13,8209,30,1],[8210,13,8210,30,1],[8211,13,8211,30,1],[8212,13,8212,30,1],[8213,13,8213,30,1],[8214,13,8214,30,1],[8215,13,8215,30,1],[8216,13,8216,30,1],[8217,13,8217,30,1],[8218,13,8218,30,1],[8219,13,8219,30,1],[8220,13,8220,30,1],[8221,13,8221,30,1],[8222,13,8222,30,1],[8223,13,8223,30,1],[8224,13,8224,30,1],[8225,13,8225,30,1],[8226,13,8226,30,1],[8227,13,8227,30,1],[8228,13,8228,30,1],[8229,13,8229,30,1],[8230,13,8230,30,1],[8231,13,8231,30,1],[8232,13,8232,30,1],[8233,13,8233,30,1],[8234,13,8234,30,1],[8235,13,8235,30,1],[8236,13,8236,30,1],[8237,13,8237,30,1],[8238,13,8238,30,1],[8239,13,8239,30,1],[8240,13,8240,30,1],[8241,13,8241,30,1],[8242,13,8242,30,1],[8243,13,8243,30,1],[8244,13,8244,30,1],[8245,13,8245,30,1],[8246,13,8246,30,1],[8247,13,8247,30,1],[8248,13,8248,30,1],[8249,13,8249,30,1],[8250,13,8250,30,1],[8251,13,8251,30,1],[8252,13,8252,30,1],[8253,13,8253,30,1],[8254,13,8254,30,1],[8255,13,8255,30,1],[8256,13,8256,30,1],[8257,13,8257,30,1],[8258,13,8258,30,1],[8259,13,8259,30,1],[8260,13,8260,30,1],[8261,13,8261,30,1],[8262,13,8262,30,1],[8263,13,8263,30,1],[8264,13,8264,30,1],[8265,13,8265,30,1],[8266,13,8266,30,1],[8267,13,8267,30,1],[8268,13,8268,30,1],[8269,13,8269,30,1],[8270,13,8270,30,1],[8271,13,8271,30,1],[8272,13,8272,30,1],[8273,13,8273,30,1],[8274,13,8274,30,1],[8275,13,8275,30,1],[8276,13,8276,30,1],[8277,13,8277,30,1],[8278,13,8278,30,1],[8279,13,8279,30,1],[8280,13,8280,30,1],[8281,13,8281,30,1],[8282,13,8282,30,1],[8283,13,8283,30,1],[8284,13,8284,30,1],[8285,13,8285,30,1],[8286,13,8286,30,1],[8287,13,8287,30,1],[8288,13,8288,30,1],[8289,13,8289,30,1],[8290,13,8290,30,1],[8291,13,8291,30,1],[8292,13,8292,30,1],[8293,13,8293,30,1],[8294,13,8294,30,1],[8295,13,8295,30,1],[8296,13,8296,30,1],[8297,13,8297,30,1],[8298,13,8298,30,1],[8299,13,8299,30,1],[8300,13,8300,30,1],[8301,13,8301,30,1],[8302,13,8302,30,1],[8303,13,8303,30,1],[8304,13,8304,30,1],[8305,13,8305,30,1],[8306,13,8306,30,1],[8307,13,8307,30,1],[8308,13,8308,30,1],[8309,13,8309,30,1],[8310,13,8310,30,1],[8311,13,8311,30,1],[8312,13,8312,30,1],[8313,13,8313,30,1],[8314,13,8314,30,1],[8315,13,8315,30,1],[8316,13,8316,30,1],[8317,13,8317,30,1],[8318,13,8318,30,1],[8319,13,8319,30,1],[8320,13,8320,30,1],[8321,13,8321,30,1],[8322,13,8322,30,1],[8323,13,8323,30,1],[8324,13,8324,30,1],[8325,13,8325,30,1],[8326,13,8326,30,1],[8327,13,8327,30,1],[8328,13,8328,30,1],[8329,13,8329,30,1],[8330,13,8330,30,1],[8331,13,8331,30,1],[8332,13,8332,30,1],[8333,13,8333,30,1],[8334,13,8334,30,1],[8335,13,8335,30,1],[8336,13,8336,30,1],[8337,13,8337,30,1],[8338,13,8338,30,1],[8339,13,8339,30,1],[8340,13,8340,30,1],[8341,13,8341,30,1],[8342,13,8342,30,1],[8343,13,8343,30,1],[8344,13,8344,30,1],[8345,13,8345,30,1],[8346,13,8346,30,1],[8347,13,8347,30,1],[8348,13,8348,30,1],[8349,13,8349,30,1],[8350,13,8350,30,1],[8351,13,8351,30,1],[8352,13,8352,30,1],[8353,13,8353,30,1],[8354,13,8354,30,1],[8355,13,8355,30,1],[8356,13,8356,30,1],[8357,13,8357,30,1],[8358,13,8358,30,1],[8359,13,8359,30,1],[8360,13,8360,30,1],[8361,13,8361,30,1],[8362,13,8362,30,1],[8363,13,8363,30,1],[8364,13,8364,30,1],[8365,13,8365,30,1],[8366,13,8366,30,1],[8367,13,8367,30,1],[8368,13,8368,30,1],[8369,13,8369,30,1],[8370,13,8370,30,1],[8371,13,8371,30,1],[8372,13,8372,30,1],[8373,13,8373,30,1],[8374,13,8374,30,1],[8375,13,8375,30,1],[8376,13,8376,30,1],[8377,13,8377,30,1],[8378,13,8378,30,1],[8379,13,8379,30,1],[8380,13,8380,30,1],[8381,13,8381,30,1],[8382,13,8382,30,1],[8383,13,8383,30,1],[8384,13,8384,30,1],[8385,13,8385,30,1],[8386,13,8386,30,1],[8387,13,8387,30,1],[8388,13,8388,30,1],[8389,13,8389,30,1],[8390,13,8390,30,1],[8391,13,8391,30,1],[8392,13,8392,30,1],[8393,13,8393,30,1],[8394,13,8394,30,1],[8395,13,8395,30,1],[8396,13,8396,30,1],[8397,13,8397,30,1],[8398,13,8398,30,1],[8399,13,8399,30,1],[8400,13,8400,30,1],[8401,13,8401,30,1],[8402,13,8402,30,1],[8403,13,8403,30,1],[8404,13,8404,30,1],[8405,13,8405,30,1],[8406,13,8406,30,1],[8407,13,8407,30,1],[8408,13,8408,30,1],[8409,13,8409,30,1],[8410,13,8410,30,1],[8411,13,8411,30,1],[8412,13,8412,30,1],[8413,13,8413,30,1],[8414,13,8414,30,1],[8415,13,8415,30,1],[8416,13,8416,30,1],[8417,13,8417,30,1],[8418,13,8418,30,1],[8419,13,8419,30,1],[8420,13,8420,30,1],[8421,13,8421,30,1],[8422,13,8422,30,1],[8423,13,8423,30,1],[8424,13,8424,30,1],[8425,13,8425,30,1],[8426,13,8426,30,1],[8427,13,8427,30,1],[8428,13,8428,30,1],[8429,13,8429,30,1],[8430,13,8430,30,1],[8431,13,8431,30,1],[8432,13,8432,30,1],[8433,13,8433,30,1],[8434,13,8434,30,1],[8435,13,8435,30,1],[8436,13,8436,30,1],[8437,13,8437,30,1],[8438,13,8438,30,1],[8439,13,8439,30,1],[8440,13,8440,30,1],[8441,13,8441,30,1],[8442,13,8442,30,1],[8443,13,8443,30,1],[8444,13,8444,30,1],[8445,13,8445,30,1],[8446,13,8446,30,1],[8447,13,8447,30,1],[8448,13,8448,30,1],[8449,13,8449,30,1],[8450,13,8450,30,1],[8451,13,8451,30,1],[8452,13,8452,30,1],[8453,13,8453,30,1],[8454,13,8454,30,1],[8455,13,8455,30,1],[8456,13,8456,30,1],[8457,13,8457,30,1],[8458,13,8458,30,1],[8459,13,8459,30,1],[8460,13,8460,30,1],[8461,13,8461,30,1],[8462,13,8462,30,1],[8463,13,8463,30,1],[8464,13,8464,30,1],[8465,13,8465,30,1],[8466,13,8466,30,1],[8467,13,8467,30,1],[8468,13,8468,30,1],[8469,13,8469,30,1],[8470,13,8470,30,1],[8471,13,8471,30,1],[8472,13,8472,30,1],[8473,13,8473,30,1],[8474,13,8474,30,1],[8475,13,8475,30,1],[8476,13,8476,30,1],[8477,13,8477,30,1],[8478,13,8478,30,1],[8479,13,8479,30,1],[8480,13,8480,30,1],[8481,13,8481,30,1],[8482,13,8482,30,1],[8483,13,8483,30,1],[8484,13,8484,30,1],[8485,13,8485,30,1],[8486,13,8486,30,1],[8487,13,8487,30,1],[8488,13,8488,30,1],[8489,13,8489,30,1],[8490,13,8490,30,1],[8491,13,8491,30,1],[8492,13,8492,30,1],[8493,13,8493,30,1],[8494,13,8494,30,1],[8495,13,8495,30,1],[8496,13,8496,30,1],[8497,13,8497,30,1],[8498,13,8498,30,1],[8499,13,8499,30,1],[8500,13,8500,30,1],[8501,13,8501,30,1],[8502,13,8502,30,1],[8503,13,8503,30,1],[8504,13,8504,30,1],[8505,13,8505,30,1],[8506,13,8506,30,1],[8507,13,8507,30,1],[8508,13,8508,30,1],[8509,13,8509,30,1],[8510,13,8510,30,1],[8511,13,8511,30,1],[8512,13,8512,30,1],[8513,13,8513,30,1],[8514,13,8514,30,1],[8515,13,8515,30,1],[8516,13,8516,30,1],[8517,13,8517,30,1],[8518,13,8518,30,1],[8519,13,8519,30,1],[8520,13,8520,30,1],[8521,13,8521,30,1],[8522,13,8522,30,1],[8523,13,8523,30,1],[8524,13,8524,30,1],[8525,13,8525,30,1],[8526,13,8526,30,1],[8527,13,8527,30,1],[8528,13,8528,30,1],[8529,13,8529,30,1],[8530,13,8530,30,1],[8531,13,8531,30,1],[8532,13,8532,30,1],[8533,13,8533,30,1],[8534,13,8534,30,1],[8535,13,8535,30,1],[8536,13,8536,30,1],[8537,13,8537,30,1],[8538,13,8538,30,1],[8539,13,8539,30,1],[8540,13,8540,30,1],[8541,13,8541,30,1],[8542,13,8542,30,1],[8543,13,8543,30,1],[8544,13,8544,30,1],[8545,13,8545,30,1],[8546,13,8546,30,1],[8547,13,8547,30,1],[8548,13,8548,30,1],[8549,13,8549,30,1],[8550,13,8550,30,1],[8551,13,8551,30,1],[8552,13,8552,30,1],[8553,13,8553,30,1],[8554,13,8554,30,1],[8555,13,8555,30,1],[8556,13,8556,30,1],[8557,13,8557,30,1],[8558,13,8558,30,1],[8559,13,8559,30,1],[8560,13,8560,30,1],[8561,13,8561,30,1],[8562,13,8562,30,1],[8563,13,8563,30,1],[8564,13,8564,30,1],[8565,13,8565,30,1],[8566,13,8566,30,1],[8567,13,8567,30,1],[8568,13,8568,30,1],[8569,13,8569,30,1],[8570,13,8570,30,1],[8571,13,8571,30,1],[8572,13,8572,30,1],[8573,13,8573,30,1],[8574,13,8574,30,1],[8575,13,8575,30,1],[8576,13,8576,30,1],[8577,13,8577,30,1],[8578,13,8578,30,1],[8579,13,8579,30,1],[8580,13,8580,30,1],[8581,13,8581,30,1],[8582,13,8582,30,1],[8583,13,8583,30,1],[8584,13,8584,30,1],[8585,13,8585,30,1],[8586,13,8586,30,1],[8587,13,8587,30,1],[8588,13,8588,30,1],[8589,13,8589,30,1],[8590,13,8590,30,1],[8591,13,8591,30,1],[8592,13,8592,30,1],[8593,13,8593,30,1],[8594,13,8594,30,1],[8595,13,8595,30,1],[8596,13,8596,30,1],[8597,13,8597,30,1],[8598,13,8598,30,1],[8599,13,8599,30,1],[8600,13,8600,30,1],[8601,13,8601,30,1],[8602,13,8602,30,1],[8603,13,8603,30,1],[8604,13,8604,30,1],[8605,13,8605,30,1],[8606,13,8606,30,1],[8607,13,8607,30,1],[8608,13,8608,30,1],[8609,13,8609,30,1],[8610,13,8610,30,1],[8611,13,8611,30,1],[8612,13,8612,30,1],[8613,13,8613,30,1],[8614,13,8614,30,1],[8615,13,8615,30,1],[8616,13,8616,30,1],[8617,13,8617,30,1],[8618,13,8618,30,1],[8619,13,8619,30,1],[8620,13,8620,30,1],[8621,13,8621,30,1],[8622,13,8622,30,1],[8623,13,8623,30,1],[8624,13,8624,30,1],[8625,13,8625,30,1],[8626,13,8626,30,1],[8627,13,8627,30,1],[8628,13,8628,30,1],[8629,13,8629,30,1],[8630,13,8630,30,1],[8631,13,8631,30,1],[8632,13,8632,30,1],[8633,13,8633,30,1],[8634,13,8634,30,1],[8635,13,8635,30,1],[8636,13,8636,30,1],[8637,13,8637,30,1],[8638,13,8638,30,1],[8639,13,8639,30,1],[8640,13,8640,30,1],[8641,13,8641,30,1],[8642,13,8642,30,1],[8643,13,8643,30,1],[8644,13,8644,30,1],[8645,13,8645,30,1],[8646,13,8646,30,1],[8647,13,8647,30,1],[8648,13,8648,30,1],[8649,13,8649,30,1],[8650,13,8650,30,1],[8651,13,8651,30,1],[8652,13,8652,30,1],[8653,13,8653,30,1],[8654,13,8654,30,1],[8655,13,8655,30,1],[8656,13,8656,30,1],[8657,13,8657,30,1],[8658,13,8658,30,1],[8659,13,8659,30,1],[8660,13,8660,30,1],[8661,13,8661,30,1],[8662,13,8662,30,1],[8663,13,8663,30,1],[8664,13,8664,30,1],[8665,13,8665,30,1],[8666,13,8666,30,1],[8667,13,8667,30,1],[8668,13,8668,30,1],[8669,13,8669,30,1],[8670,13,8670,30,1],[8671,13,8671,30,1],[8672,13,8672,30,1],[8673,13,8673,30,1],[8674,13,8674,30,1],[8675,13,8675,30,1],[8676,13,8676,30,1],[8677,13,8677,30,1],[8678,13,8678,30,1],[8679,13,8679,30,1],[8680,13,8680,30,1],[8681,13,8681,30,1],[8682,13,8682,30,1],[8683,13,8683,30,1],[8684,13,8684,30,1],[8685,13,8685,30,1],[8686,13,8686,30,1],[8687,13,8687,30,1],[8688,13,8688,30,1],[8689,13,8689,30,1],[8690,13,8690,30,1],[8691,13,8691,30,1],[8692,13,8692,30,1],[8693,13,8693,30,1],[8694,13,8694,30,1],[8695,13,8695,30,1],[8696,13,8696,30,1],[8697,13,8697,30,1],[8698,13,8698,30,1],[8699,13,8699,30,1],[8700,13,8700,30,1],[8701,13,8701,30,1],[8702,13,8702,30,1],[8703,13,8703,30,1],[8704,13,8704,30,1],[8705,13,8705,30,1],[8706,13,8706,30,1],[8707,13,8707,30,1],[8708,13,8708,30,1],[8709,13,8709,30,1],[8710,13,8710,30,1],[8711,13,8711,30,1],[8712,13,8712,30,1],[8713,13,8713,30,1],[8714,13,8714,30,1],[8715,13,8715,30,1],[8716,13,8716,30,1],[8717,13,8717,30,1],[8718,13,8718,30,1],[8719,13,8719,30,1],[8720,13,8720,30,1],[8721,13,8721,30,1],[8722,13,8722,30,1],[8723,13,8723,30,1],[8724,13,8724,30,1],[8725,13,8725,30,1],[8726,13,8726,30,1],[8727,13,8727,30,1],[8728,13,8728,30,1],[8729,13,8729,30,1],[8730,13,8730,30,1],[8731,13,8731,30,1],[8732,13,8732,30,1],[8733,13,8733,30,1],[8734,13,8734,30,1],[8735,13,8735,30,1],[8736,13,8736,30,1],[8737,13,8737,30,1],[8738,13,8738,30,1],[8739,13,8739,30,1],[8740,13,8740,30,1],[8741,13,8741,30,1],[8742,13,8742,30,1],[8743,13,8743,30,1],[8744,13,8744,30,1],[8745,13,8745,30,1],[8746,13,8746,30,1],[8747,13,8747,30,1],[8748,13,8748,30,1],[8749,13,8749,30,1],[8750,13,8750,30,1],[8751,13,8751,30,1],[8752,13,8752,30,1],[8753,13,8753,30,1],[8754,13,8754,30,1],[8755,13,8755,30,1],[8756,13,8756,30,1],[8757,13,8757,30,1],[8758,13,8758,30,1],[8759,13,8759,30,1],[8760,13,8760,30,1],[8761,13,8761,30,1],[8762,13,8762,30,1],[8763,13,8763,30,1],[8764,13,8764,30,1],[8765,13,8765,30,1],[8766,13,8766,30,1],[8767,13,8767,30,1],[8768,13,8768,30,1],[8769,13,8769,30,1],[8770,13,8770,30,1],[8771,13,8771,30,1],[8772,13,8772,30,1],[8773,13,8773,30,1],[8774,13,8774,30,1],[8775,13,8775,30,1],[8776,13,8776,30,1],[8777,13,8777,30,1],[8778,13,8778,30,1],[8779,13,8779,30,1],[8780,13,8780,30,1],[8781,13,8781,30,1],[8782,13,8782,30,1],[8783,13,8783,30,1],[8784,13,8784,30,1],[8785,13,8785,30,1],[8786,13,8786,30,1],[8787,13,8787,30,1],[8788,13,8788,30,1],[8789,13,8789,30,1],[8790,13,8790,30,1],[8791,13,8791,30,1],[8792,13,8792,30,1],[8793,13,8793,30,1],[8794,13,8794,30,1],[8795,13,8795,30,1],[8796,13,8796,30,1],[8797,13,8797,30,1],[8798,13,8798,30,1],[8799,13,8799,30,1],[8800,13,8800,30,1],[8801,13,8801,30,1],[8802,13,8802,30,1],[8803,13,8803,30,1],[8804,13,8804,30,1],[8805,13,8805,30,1],[8806,13,8806,30,1],[8807,13,8807,30,1],[8808,13,8808,30,1],[8809,13,8809,30,1],[8810,13,8810,30,1],[8811,13,8811,30,1],[8812,13,8812,30,1],[8813,13,8813,30,1],[8814,13,8814,30,1],[8815,13,8815,30,1],[8816,13,8816,30,1],[8817,13,8817,30,1],[8818,13,8818,30,1],[8819,13,8819,30,1],[8820,13,8820,30,1],[8821,13,8821,30,1],[8822,13,8822,30,1],[8823,13,8823,30,1],[8824,13,8824,30,1],[8825,13,8825,30,1],[8826,13,8826,30,1],[8827,13,8827,30,1],[8828,13,8828,30,1],[8829,13,8829,30,1],[8830,13,8830,30,1],[8831,13,8831,30,1],[8832,13,8832,30,1],[8833,13,8833,30,1],[8834,13,8834,30,1],[8835,13,8835,30,1],[8836,13,8836,30,1],[8837,13,8837,30,1],[8838,13,8838,30,1],[8839,13,8839,30,1],[8840,13,8840,30,1],[8841,13,8841,30,1],[8842,13,8842,30,1],[8843,13,8843,30,1],[8844,13,8844,30,1],[8845,13,8845,30,1],[8846,13,8846,30,1],[8847,13,8847,30,1],[8848,13,8848,30,1],[8849,13,8849,30,1],[8850,13,8850,30,1],[8851,13,8851,30,1],[8852,13,8852,30,1],[8853,13,8853,30,1],[8854,13,8854,30,1],[8855,13,8855,30,1],[8856,13,8856,30,1],[8857,13,8857,30,1],[8858,13,8858,30,1],[8859,13,8859,30,1],[8860,13,8860,30,1],[8861,13,8861,30,1],[8862,13,8862,30,1],[8863,13,8863,30,1],[8864,13,8864,30,1],[8865,13,8865,30,1],[8866,13,8866,30,1],[8867,13,8867,30,1],[8868,13,8868,30,1],[8869,13,8869,30,1],[8870,13,8870,30,1],[8871,13,8871,30,1],[8872,13,8872,30,1],[8873,13,8873,30,1],[8874,13,8874,30,1],[8875,13,8875,30,1],[8876,13,8876,30,1],[8877,13,8877,30,1],[8878,13,8878,30,1],[8879,13,8879,30,1],[8880,13,8880,30,1],[8881,13,8881,30,1],[8882,13,8882,30,1],[8883,13,8883,30,1],[8884,13,8884,30,1],[8885,13,8885,30,1],[8886,13,8886,30,1],[8887,13,8887,30,1],[8888,13,8888,30,1],[8889,13,8889,30,1],[8890,13,8890,30,1],[8891,13,8891,30,1],[8892,13,8892,30,1],[8893,13,8893,30,1],[8894,13,8894,30,1],[8895,13,8895,30,1],[8896,13,8896,30,1],[8897,13,8897,30,1],[8898,13,8898,30,1],[8899,13,8899,30,1],[8900,13,8900,30,1],[8901,13,8901,30,1],[8902,13,8902,30,1],[8903,13,8903,30,1],[8904,13,8904,30,1],[8905,13,8905,30,1],[8906,13,8906,30,1],[8907,13,8907,30,1],[8908,13,8908,30,1],[8909,13,8909,30,1],[8910,13,8910,30,1],[8911,13,8911,30,1],[8912,13,8912,30,1],[8913,13,8913,30,1],[8914,13,8914,30,1],[8915,13,8915,30,1],[8916,13,8916,30,1],[8917,13,8917,30,1],[8918,13,8918,30,1],[8919,13,8919,30,1],[8920,13,8920,30,1],[8921,13,8921,30,1],[8922,13,8922,30,1],[8923,13,8923,30,1],[8924,13,8924,30,1],[8925,13,8925,30,1],[8926,13,8926,30,1],[8927,13,8927,30,1],[8928,13,8928,30,1],[8929,13,8929,30,1],[8930,13,8930,30,1],[8931,13,8931,30,1],[8932,13,8932,30,1],[8933,13,8933,30,1],[8934,13,8934,30,1],[8935,13,8935,30,1],[8936,13,8936,30,1],[8937,13,8937,30,1],[8938,13,8938,30,1],[8939,13,8939,30,1],[8940,13,8940,30,1],[8941,13,8941,30,1],[8942,13,8942,30,1],[8943,13,8943,30,1],[8944,13,8944,30,1],[8945,13,8945,30,1],[8946,13,8946,30,1],[8947,13,8947,30,1],[8948,13,8948,30,1],[8949,13,8949,30,1],[8950,13,8950,30,1],[8951,13,8951,30,1],[8952,13,8952,30,1],[8953,13,8953,30,1],[8954,13,8954,30,1],[8955,13,8955,30,1],[8956,13,8956,30,1],[8957,13,8957,30,1],[8958,13,8958,30,1],[8959,13,8959,30,1],[8960,13,8960,30,1],[8961,13,8961,30,1],[8962,13,8962,30,1],[8963,13,8963,30,1],[8964,13,8964,30,1],[8965,13,8965,30,1],[8966,13,8966,30,1],[8967,13,8967,30,1],[8968,13,8968,30,1],[8969,13,8969,30,1],[8970,13,8970,30,1],[8971,13,8971,30,1],[8972,13,8972,30,1],[8973,13,8973,30,1],[8974,13,8974,30,1],[8975,13,8975,30,1],[8976,13,8976,30,1],[8977,13,8977,30,1],[8978,13,8978,30,1],[8979,13,8979,30,1],[8980,13,8980,30,1],[8981,13,8981,30,1],[8982,13,8982,30,1],[8983,13,8983,30,1],[8984,13,8984,30,1],[8985,13,8985,30,1],[8986,13,8986,30,1],[8987,13,8987,30,1],[8988,13,8988,30,1],[8989,13,8989,30,1],[8990,13,8990,30,1],[8991,13,8991,30,1],[8992,13,8992,30,1],[8993,13,8993,30,1],[8994,13,8994,30,1],[8995,13,8995,30,1],[8996,13,8996,30,1],[8997,13,8997,30,1],[8998,13,8998,30,1],[8999,13,8999,30,1],[9000,13,9000,30,1],[9001,13,9001,30,1],[9002,13,9002,30,1],[9003,13,9003,30,1],[9004,13,9004,30,1],[9005,13,9005,30,1],[9006,13,9006,30,1],[9007,13,9007,30,1],[9008,13,9008,30,1],[9009,13,9009,30,1],[9010,13,9010,30,1],[9011,13,9011,30,1],[9012,13,9012,30,1],[9013,13,9013,30,1],[9014,13,9014,30,1],[9015,13,9015,30,1],[9016,13,9016,30,1],[9017,13,9017,30,1],[9018,13,9018,30,1],[9019,13,9019,30,1],[9020,13,9020,30,1],[9021,13,9021,30,1],[9022,13,9022,30,1],[9023,13,9023,30,1],[9024,13,9024,30,1],[9025,13,9025,30,1],[9026,13,9026,30,1],[9027,13,9027,30,1],[9028,13,9028,30,1],[9029,13,9029,30,1],[9030,13,9030,30,1],[9031,13,9031,30,1],[9032,13,9032,30,1],[9033,13,9033,30,1],[9034,13,9034,30,1],[9035,13,9035,30,1],[9036,13,9036,30,1],[9037,13,9037,30,1],[9038,13,9038,30,1],[9039,13,9039,30,1],[9040,13,9040,30,1],[9041,13,9041,30,1],[9042,13,9042,30,1],[9043,13,9043,30,1],[9044,13,9044,30,1],[9045,13,9045,30,1],[9046,13,9046,30,1],[9047,13,9047,30,1],[9048,13,9048,30,1],[9049,13,9049,30,1],[9050,13,9050,30,1],[9051,13,9051,30,1],[9052,13,9052,30,1],[9053,13,9053,30,1],[9054,13,9054,30,1],[9055,13,9055,30,1],[9056,13,9056,30,1],[9057,13,9057,30,1],[9058,13,9058,30,1],[9059,13,9059,30,1],[9060,13,9060,30,1],[9061,13,9061,30,1],[9062,13,9062,30,1],[9063,13,9063,30,1],[9064,13,9064,30,1],[9065,13,9065,30,1],[9066,13,9066,30,1],[9067,13,9067,30,1],[9068,13,9068,30,1],[9069,13,9069,30,1],[9070,13,9070,30,1],[9071,13,9071,30,1],[9072,13,9072,30,1],[9073,13,9073,30,1],[9074,13,9074,30,1],[9075,13,9075,30,1],[9076,13,9076,30,1],[9077,13,9077,30,1],[9078,13,9078,30,1],[9079,13,9079,30,1],[9080,13,9080,30,1],[9081,13,9081,30,1],[9082,13,9082,30,1],[9083,13,9083,30,1],[9084,13,9084,30,1],[9085,13,9085,30,1],[9086,13,9086,30,1],[9087,13,9087,30,1],[9088,13,9088,30,1],[9089,13,9089,30,1],[9090,13,9090,30,1],[9091,13,9091,30,1],[9092,13,9092,30,1],[9093,13,9093,30,1],[9094,13,9094,30,1],[9095,13,9095,30,1],[9096,13,9096,30,1],[9097,13,9097,30,1],[9098,13,9098,30,1],[9099,13,9099,30,1],[9100,13,9100,30,1],[9101,13,9101,30,1],[9102,13,9102,30,1],[9103,13,9103,30,1],[9104,13,9104,30,1],[9105,13,9105,30,1],[9106,13,9106,30,1],[9107,13,9107,30,1],[9108,13,9108,30,1],[9109,13,9109,30,1],[9110,13,9110,30,1],[9111,13,9111,30,1],[9112,13,9112,30,1],[9113,13,9113,30,1],[9114,13,9114,30,1],[9115,13,9115,30,1],[9116,13,9116,30,1],[9117,13,9117,30,1],[9118,13,9118,30,1],[9119,13,9119,30,1],[9120,13,9120,30,1],[9121,13,9121,30,1],[9122,13,9122,30,1],[9123,13,9123,30,1],[9124,13,9124,30,1],[9125,13,9125,30,1],[9126,13,9126,30,1],[9127,13,9127,30,1],[9128,13,9128,30,1],[9129,13,9129,30,1],[9130,13,9130,30,1],[9131,13,9131,30,1],[9132,13,9132,30,1],[9133,13,9133,30,1],[9134,13,9134,30,1],[9135,13,9135,30,1],[9136,13,9136,30,1],[9137,13,9137,30,1],[9138,13,9138,30,1],[9139,13,9139,30,1],[9140,13,9140,30,1],[9141,13,9141,30,1],[9142,13,9142,30,1],[9143,13,9143,30,1],[9144,13,9144,30,1],[9145,13,9145,30,1],[9146,13,9146,30,1],[9147,13,9147,30,1],[9148,13,9148,30,1],[9149,13,9149,30,1],[9150,13,9150,30,1],[9151,13,9151,30,1],[9152,13,9152,30,1],[9153,13,9153,30,1],[9154,13,9154,30,1],[9155,13,9155,30,1],[9156,13,9156,30,1],[9157,13,9157,30,1],[9158,13,9158,30,1],[9159,13,9159,30,1],[9160,13,9160,30,1],[9161,13,9161,30,1],[9162,13,9162,30,1],[9163,13,9163,30,1],[9164,13,9164,30,1],[9165,13,9165,30,1],[9166,13,9166,30,1],[9167,13,9167,30,1],[9168,13,9168,30,1],[9169,13,9169,30,1],[9170,13,9170,30,1],[9171,13,9171,30,1],[9172,13,9172,30,1],[9173,13,9173,30,1],[9174,13,9174,30,1],[9175,13,9175,30,1],[9176,13,9176,30,1],[9177,13,9177,30,1],[9178,13,9178,30,1],[9179,13,9179,30,1],[9180,13,9180,30,1],[9181,13,9181,30,1],[9182,13,9182,30,1],[9183,13,9183,30,1],[9184,13,9184,30,1],[9185,13,9185,30,1],[9186,13,9186,30,1],[9187,13,9187,30,1],[9188,13,9188,30,1],[9189,13,9189,30,1],[9190,13,9190,30,1],[9191,13,9191,30,1],[9192,13,9192,30,1],[9193,13,9193,30,1],[9194,13,9194,30,1],[9195,13,9195,30,1],[9196,13,9196,30,1],[9197,13,9197,30,1],[9198,13,9198,30,1],[9199,13,9199,30,1],[9200,13,9200,30,1],[9201,13,9201,30,1],[9202,13,9202,30,1],[9203,13,9203,30,1],[9204,13,9204,30,1],[9205,13,9205,30,1],[9206,13,9206,30,1],[9207,13,9207,30,1],[9208,13,9208,30,1],[9209,13,9209,30,1],[9210,13,9210,30,1],[9211,13,9211,30,1],[9212,13,9212,30,1],[9213,13,9213,30,1],[9214,13,9214,30,1],[9215,13,9215,30,1],[9216,13,9216,30,1],[9217,13,9217,30,1],[9218,13,9218,30,1],[9219,13,9219,30,1],[9220,13,9220,30,1],[9221,13,9221,30,1],[9222,13,9222,30,1],[9223,13,9223,30,1],[9224,13,9224,30,1],[9225,13,9225,30,1],[9226,13,9226,30,1],[9227,13,9227,30,1],[9228,13,9228,30,1],[9229,13,9229,30,1],[9230,13,9230,30,1],[9231,13,9231,30,1],[9232,13,9232,30,1],[9233,13,9233,30,1],[9234,13,9234,30,1],[9235,13,9235,30,1],[9236,13,9236,30,1],[9237,13,9237,30,1],[9238,13,9238,30,1],[9239,13,9239,30,1],[9240,13,9240,30,1],[9241,13,9241,30,1],[9242,13,9242,30,1],[9243,13,9243,30,1],[9244,13,9244,30,1],[9245,13,9245,30,1],[9246,13,9246,30,1],[9247,13,9247,30,1],[9248,13,9248,30,1],[9249,13,9249,30,1],[9250,13,9250,30,1],[9251,13,9251,30,1],[9252,13,9252,30,1],[9253,13,9253,30,1],[9254,13,9254,30,1],[9255,13,9255,30,1],[9256,13,9256,30,1],[9257,13,9257,30,1],[9258,13,9258,30,1],[9259,13,9259,30,1],[9260,13,9260,30,1],[9261,13,9261,30,1],[9262,13,9262,30,1],[9263,13,9263,30,1],[9264,13,9264,30,1],[9265,13,9265,30,1],[9266,13,9266,30,1],[9267,13,9267,30,1],[9268,13,9268,30,1],[9269,13,9269,30,1],[9270,13,9270,30,1],[9271,13,9271,30,1],[9272,13,9272,30,1],[9273,13,9273,30,1],[9274,13,9274,30,1],[9275,13,9275,30,1],[9276,13,9276,30,1],[9277,13,9277,30,1],[9278,13,9278,30,1],[9279,13,9279,30,1],[9280,13,9280,30,1],[9281,13,9281,30,1],[9282,13,9282,30,1],[9283,13,9283,30,1],[9284,13,9284,30,1],[9285,13,9285,30,1],[9286,13,9286,30,1],[9287,13,9287,30,1],[9288,13,9288,30,1],[9289,13,9289,30,1],[9290,13,9290,30,1],[9291,13,9291,30,1],[9292,13,9292,30,1],[9293,13,9293,30,1],[9294,13,9294,30,1],[9295,13,9295,30,1],[9296,13,9296,30,1],[9297,13,9297,30,1],[9298,13,9298,30,1],[9299,13,9299,30,1],[9300,13,9300,30,1],[9301,13,9301,30,1],[9302,13,9302,30,1],[9303,13,9303,30,1],[9304,13,9304,30,1],[9305,13,9305,30,1],[9306,13,9306,30,1],[9307,13,9307,30,1],[9308,13,9308,30,1],[9309,13,9309,30,1],[9310,13,9310,30,1],[9311,13,9311,30,1],[9312,13,9312,30,1],[9313,13,9313,30,1],[9314,13,9314,30,1],[9315,13,9315,30,1],[9316,13,9316,30,1],[9317,13,9317,30,1],[9318,13,9318,30,1],[9319,13,9319,30,1],[9320,13,9320,30,1],[9321,13,9321,30,1],[9322,13,9322,30,1],[9323,13,9323,30,1],[9324,13,9324,30,1],[9325,13,9325,30,1],[9326,13,9326,30,1],[9327,13,9327,30,1],[9328,13,9328,30,1],[9329,13,9329,30,1],[9330,13,9330,30,1],[9331,13,9331,30,1],[9332,13,9332,30,1],[9333,13,9333,30,1],[9334,13,9334,30,1],[9335,13,9335,30,1],[9336,13,9336,30,1],[9337,13,9337,30,1],[9338,13,9338,30,1],[9339,13,9339,30,1],[9340,13,9340,30,1],[9341,13,9341,30,1],[9342,13,9342,30,1],[9343,13,9343,30,1],[9344,13,9344,30,1],[9345,13,9345,30,1],[9346,13,9346,30,1],[9347,13,9347,30,1],[9348,13,9348,30,1],[9349,13,9349,30,1],[9350,13,9350,30,1],[9351,13,9351,30,1],[9352,13,9352,30,1],[9353,13,9353,30,1],[9354,13,9354,30,1],[9355,13,9355,30,1],[9356,13,9356,30,1],[9357,13,9357,30,1],[9358,13,9358,30,1],[9359,13,9359,30,1],[9360,13,9360,30,1],[9361,13,9361,30,1],[9362,13,9362,30,1],[9363,13,9363,30,1],[9364,13,9364,30,1],[9365,13,9365,30,1],[9366,13,9366,30,1],[9367,13,9367,30,1],[9368,13,9368,30,1],[9369,13,9369,30,1],[9370,13,9370,30,1],[9371,13,9371,30,1],[9372,13,9372,30,1],[9373,13,9373,30,1],[9374,13,9374,30,1],[9375,13,9375,30,1],[9376,13,9376,30,1],[9377,13,9377,30,1],[9378,13,9378,30,1],[9379,13,9379,30,1],[9380,13,9380,30,1],[9381,13,9381,30,1],[9382,13,9382,30,1],[9383,13,9383,30,1],[9384,13,9384,30,1],[9385,13,9385,30,1],[9386,13,9386,30,1],[9387,13,9387,30,1],[9388,13,9388,30,1],[9389,13,9389,30,1],[9390,13,9390,30,1],[9391,13,9391,30,1],[9392,13,9392,30,1],[9393,13,9393,30,1],[9394,13,9394,30,1],[9395,13,9395,30,1],[9396,13,9396,30,1],[9397,13,9397,30,1],[9398,13,9398,30,1],[9399,13,9399,30,1],[9400,13,9400,30,1],[9401,13,9401,30,1],[9402,13,9402,30,1],[9403,13,9403,30,1],[9404,13,9404,30,1],[9405,13,9405,30,1],[9406,13,9406,30,1],[9407,13,9407,30,1],[9408,13,9408,30,1],[9409,13,9409,30,1],[9410,13,9410,30,1],[9411,13,9411,30,1],[9412,13,9412,30,1],[9413,13,9413,30,1],[9414,13,9414,30,1],[9415,13,9415,30,1],[9416,13,9416,30,1],[9417,13,9417,30,1],[9418,13,9418,30,1],[9419,13,9419,30,1],[9420,13,9420,30,1],[9421,13,9421,30,1],[9422,13,9422,30,1],[9423,13,9423,30,1],[9424,13,9424,30,1],[9425,13,9425,30,1],[9426,13,9426,30,1],[9427,13,9427,30,1],[9428,13,9428,30,1],[9429,13,9429,30,1],[9430,13,9430,30,1],[9431,13,9431,30,1],[9432,13,9432,30,1],[9433,13,9433,30,1],[9434,13,9434,30,1],[9435,13,9435,30,1],[9436,13,9436,30,1],[9437,13,9437,30,1],[9438,13,9438,30,1],[9439,13,9439,30,1],[9440,13,9440,30,1],[9441,13,9441,30,1],[9442,13,9442,30,1],[9443,13,9443,30,1],[9444,13,9444,30,1],[9445,13,9445,30,1],[9446,13,9446,30,1],[9447,13,9447,30,1],[9448,13,9448,30,1],[9449,13,9449,30,1],[9450,13,9450,30,1],[9451,13,9451,30,1],[9452,13,9452,30,1],[9453,13,9453,30,1],[9454,13,9454,30,1],[9455,13,9455,30,1],[9456,13,9456,30,1],[9457,13,9457,30,1],[9458,13,9458,30,1],[9459,13,9459,30,1],[9460,13,9460,30,1],[9461,13,9461,30,1],[9462,13,9462,30,1],[9463,13,9463,30,1],[9464,13,9464,30,1],[9465,13,9465,30,1],[9466,13,9466,30,1],[9467,13,9467,30,1],[9468,13,9468,30,1],[9469,13,9469,30,1],[9470,13,9470,30,1],[9471,13,9471,30,1],[9472,13,9472,30,1],[9473,13,9473,30,1],[9474,13,9474,30,1],[9475,13,9475,30,1],[9476,13,9476,30,1],[9477,13,9477,30,1],[9478,13,9478,30,1],[9479,13,9479,30,1],[9480,13,9480,30,1],[9481,13,9481,30,1],[9482,13,9482,30,1],[9483,13,9483,30,1],[9484,13,9484,30,1],[9485,13,9485,30,1],[9486,13,9486,30,1],[9487,13,9487,30,1],[9488,13,9488,30,1],[9489,13,9489,30,1],[9490,13,9490,30,1],[9491,13,9491,30,1],[9492,13,9492,30,1],[9493,13,9493,30,1],[9494,13,9494,30,1],[9495,13,9495,30,1],[9496,13,9496,30,1],[9497,13,9497,30,1],[9498,13,9498,30,1],[9499,13,9499,30,1],[9500,13,9500,30,1],[9501,13,9501,30,1],[9502,13,9502,30,1],[9503,13,9503,30,1],[9504,13,9504,30,1],[9505,13,9505,30,1],[9506,13,9506,30,1],[9507,13,9507,30,1],[9508,13,9508,30,1],[9509,13,9509,30,1],[9510,13,9510,30,1],[9511,13,9511,30,1],[9512,13,9512,30,1],[9513,13,9513,30,1],[9514,13,9514,30,1],[9515,13,9515,30,1],[9516,13,9516,30,1],[9517,13,9517,30,1],[9518,13,9518,30,1],[9519,13,9519,30,1],[9520,13,9520,30,1],[9521,13,9521,30,1],[9522,13,9522,30,1],[9523,13,9523,30,1],[9524,13,9524,30,1],[9525,13,9525,30,1],[9526,13,9526,30,1],[9527,13,9527,30,1],[9528,13,9528,30,1],[9529,13,9529,30,1],[9530,13,9530,30,1],[9531,13,9531,30,1],[9532,13,9532,30,1],[9533,13,9533,30,1],[9534,13,9534,30,1],[9535,13,9535,30,1],[9536,13,9536,30,1],[9537,13,9537,30,1],[9538,13,9538,30,1],[9539,13,9539,30,1],[9540,13,9540,30,1],[9541,13,9541,30,1],[9542,13,9542,30,1],[9543,13,9543,30,1],[9544,13,9544,30,1],[9545,13,9545,30,1],[9546,13,9546,30,1],[9547,13,9547,30,1],[9548,13,9548,30,1],[9549,13,9549,30,1],[9550,13,9550,30,1],[9551,13,9551,30,1],[9552,13,9552,30,1],[9553,13,9553,30,1],[9554,13,9554,30,1],[9555,13,9555,30,1],[9556,13,9556,30,1],[9557,13,9557,30,1],[9558,13,9558,30,1],[9559,13,9559,30,1],[9560,13,9560,30,1],[9561,13,9561,30,1],[9562,13,9562,30,1],[9563,13,9563,30,1],[9564,13,9564,30,1],[9565,13,9565,30,1],[9566,13,9566,30,1],[9567,13,9567,30,1],[9568,13,9568,30,1],[9569,13,9569,30,1],[9570,13,9570,30,1],[9571,13,9571,30,1],[9572,13,9572,30,1],[9573,13,9573,30,1],[9574,13,9574,30,1],[9575,13,9575,30,1],[9576,13,9576,30,1],[9577,13,9577,30,1],[9578,13,9578,30,1],[9579,13,9579,30,1],[9580,13,9580,30,1],[9581,13,9581,30,1],[9582,13,9582,30,1],[9583,13,9583,30,1],[9584,13,9584,30,1],[9585,13,9585,30,1],[9586,13,9586,30,1],[9587,13,9587,30,1],[9588,13,9588,30,1],[9589,13,9589,30,1],[9590,13,9590,30,1],[9591,13,9591,30,1],[9592,13,9592,30,1],[9593,13,9593,30,1],[9594,13,9594,30,1],[9595,13,9595,30,1],[9596,13,9596,30,1],[9597,13,9597,30,1],[9598,13,9598,30,1],[9599,13,9599,30,1],[9600,13,9600,30,1],[9601,13,9601,30,1],[9602,13,9602,30,1],[9603,13,9603,30,1],[9604,13,9604,30,1],[9605,13,9605,30,1],[9606,13,9606,30,1],[9607,13,9607,30,1],[9608,13,9608,30,1],[9609,13,9609,30,1],[9610,13,9610,30,1],[9611,13,9611,30,1],[9612,13,9612,30,1],[9613,13,9613,30,1],[9614,13,9614,30,1],[9615,13,9615,30,1],[9616,13,9616,30,1],[9617,13,9617,30,1],[9618,13,9618,30,1],[9619,13,9619,30,1],[9620,13,9620,30,1],[9621,13,9621,30,1],[9622,13,9622,30,1],[9623,13,9623,30,1],[9624,13,9624,30,1],[9625,13,9625,30,1],[9626,13,9626,30,1],[9627,13,9627,30,1],[9628,13,9628,30,1],[9629,13,9629,30,1],[9630,13,9630,30,1],[9631,13,9631,30,1],[9632,13,9632,30,1],[9633,13,9633,30,1],[9634,13,9634,30,1],[9635,13,9635,30,1],[9636,13,9636,30,1],[9637,13,9637,30,1],[9638,13,9638,30,1],[9639,13,9639,30,1],[9640,13,9640,30,1],[9641,13,9641,30,1],[9642,13,9642,30,1],[9643,13,9643,30,1],[9644,13,9644,30,1],[9645,13,9645,30,1],[9646,13,9646,30,1],[9647,13,9647,30,1],[9648,13,9648,30,1],[9649,13,9649,30,1],[9650,13,9650,30,1],[9651,13,9651,30,1],[9652,13,9652,30,1],[9653,13,9653,30,1],[9654,13,9654,30,1],[9655,13,9655,30,1],[9656,13,9656,30,1],[9657,13,9657,30,1],[9658,13,9658,30,1],[9659,13,9659,30,1],[9660,13,9660,30,1],[9661,13,9661,30,1],[9662,13,9662,30,1],[9663,13,9663,30,1],[9664,13,9664,30,1],[9665,13,9665,30,1],[9666,13,9666,30,1],[9667,13,9667,30,1],[9668,13,9668,30,1],[9669,13,9669,30,1],[9670,13,9670,30,1],[9671,13,9671,30,1],[9672,13,9672,30,1],[9673,13,9673,30,1],[9674,13,9674,30,1],[9675,13,9675,30,1],[9676,13,9676,30,1],[9677,13,9677,30,1],[9678,13,9678,30,1],[9679,13,9679,30,1],[9680,13,9680,30,1],[9681,13,9681,30,1],[9682,13,9682,30,1],[9683,13,9683,30,1],[9684,13,9684,30,1],[9685,13,9685,30,1],[9686,13,9686,30,1],[9687,13,9687,30,1],[9688,13,9688,30,1],[9689,13,9689,30,1],[9690,13,9690,30,1],[9691,13,9691,30,1],[9692,13,9692,30,1],[9693,13,9693,30,1],[9694,13,9694,30,1],[9695,13,9695,30,1],[9696,13,9696,30,1],[9697,13,9697,30,1],[9698,13,9698,30,1],[9699,13,9699,30,1],[9700,13,9700,30,1],[9701,13,9701,30,1],[9702,13,9702,30,1],[9703,13,9703,30,1],[9704,13,9704,30,1],[9705,13,9705,30,1],[9706,13,9706,30,1],[9707,13,9707,30,1],[9708,13,9708,30,1],[9709,13,9709,30,1],[9710,13,9710,30,1],[9711,13,9711,30,1],[9712,13,9712,30,1],[9713,13,9713,30,1],[9714,13,9714,30,1],[9715,13,9715,30,1],[9716,13,9716,30,1],[9717,13,9717,30,1],[9718,13,9718,30,1],[9719,13,9719,30,1],[9720,13,9720,30,1],[9721,13,9721,30,1],[9722,13,9722,30,1],[9723,13,9723,30,1],[9724,13,9724,30,1],[9725,13,9725,30,1],[9726,13,9726,30,1],[9727,13,9727,30,1],[9728,13,9728,30,1],[9729,13,9729,30,1],[9730,13,9730,30,1],[9731,13,9731,30,1],[9732,13,9732,30,1],[9733,13,9733,30,1],[9734,13,9734,30,1],[9735,13,9735,30,1],[9736,13,9736,30,1],[9737,13,9737,30,1],[9738,13,9738,30,1],[9739,13,9739,30,1],[9740,13,9740,30,1],[9741,13,9741,30,1],[9742,13,9742,30,1],[9743,13,9743,30,1],[9744,13,9744,30,1],[9745,13,9745,30,1],[9746,13,9746,30,1],[9747,13,9747,30,1],[9748,13,9748,30,1],[9749,13,9749,30,1],[9750,13,9750,30,1],[9751,13,9751,30,1],[9752,13,9752,30,1],[9753,13,9753,30,1],[9754,13,9754,30,1],[9755,13,9755,30,1],[9756,13,9756,30,1],[9757,13,9757,30,1],[9758,13,9758,30,1],[9759,13,9759,30,1],[9760,13,9760,30,1],[9761,13,9761,30,1],[9762,13,9762,30,1],[9763,13,9763,30,1],[9764,13,9764,30,1],[9765,13,9765,30,1],[9766,13,9766,30,1],[9767,13,9767,30,1],[9768,13,9768,30,1],[9769,13,9769,30,1],[9770,13,9770,30,1],[9771,13,9771,30,1],[9772,13,9772,30,1],[9773,13,9773,30,1],[9774,13,9774,30,1],[9775,13,9775,30,1],[9776,13,9776,30,1],[9777,13,9777,30,1],[9778,13,9778,30,1],[9779,13,9779,30,1],[9780,13,9780,30,1],[9781,13,9781,30,1],[9782,13,9782,30,1],[9783,13,9783,30,1],[9784,13,9784,30,1],[9785,13,9785,30,1],[9786,13,9786,30,1],[9787,13,9787,30,1],[9788,13,9788,30,1],[9789,13,9789,30,1],[9790,13,9790,30,1],[9791,13,9791,30,1],[9792,13,9792,30,1],[9793,13,9793,30,1],[9794,13,9794,30,1],[9795,13,9795,30,1],[9796,13,9796,30,1],[9797,13,9797,30,1],[9798,13,9798,30,1],[9799,13,9799,30,1],[9800,13,9800,30,1],[9801,13,9801,30,1],[9802,13,9802,30,1],[9803,13,9803,30,1],[9804,13,9804,30,1],[9805,13,9805,30,1],[9806,13,9806,30,1],[9807,13,9807,30,1],[9808,13,9808,30,1],[9809,13,9809,30,1],[9810,13,9810,30,1],[9811,13,9811,30,1],[9812,13,9812,30,1],[9813,13,9813,30,1],[9814,13,9814,30,1],[9815,13,9815,30,1],[9816,13,9816,30,1],[9817,13,9817,30,1],[9818,13,9818,30,1],[9819,13,9819,30,1],[9820,13,9820,30,1],[9821,13,9821,30,1],[9822,13,9822,30,1],[9823,13,9823,30,1],[9824,13,9824,30,1],[9825,13,9825,30,1],[9826,13,9826,30,1],[9827,13,9827,30,1],[9828,13,9828,30,1],[9829,13,9829,30,1],[9830,13,9830,30,1],[9831,13,9831,30,1],[9832,13,9832,30,1],[9833,13,9833,30,1],[9834,13,9834,30,1],[9835,13,9835,30,1],[9836,13,9836,30,1],[9837,13,9837,30,1],[9838,13,9838,30,1],[9839,13,9839,30,1],[9840,13,9840,30,1],[9841,13,9841,30,1],[9842,13,9842,30,1],[9843,13,9843,30,1],[9844,13,9844,30,1],[9845,13,9845,30,1],[9846,13,9846,30,1],[9847,13,9847,30,1],[9848,13,9848,30,1],[9849,13,9849,30,1],[9850,13,9850,30,1],[9851,13,9851,30,1],[9852,13,9852,30,1],[9853,13,9853,30,1],[9854,13,9854,30,1],[9855,13,9855,30,1],[9856,13,9856,30,1],[9857,13,9857,30,1],[9858,13,9858,30,1],[9859,13,9859,30,1],[9860,13,9860,30,1],[9861,13,9861,30,1],[9862,13,9862,30,1],[9863,13,9863,30,1],[9864,13,9864,30,1],[9865,13,9865,30,1],[9866,13,9866,30,1],[9867,13,9867,30,1],[9868,13,9868,30,1],[9869,13,9869,30,1],[9870,13,9870,30,1],[9871,13,9871,30,1],[9872,13,9872,30,1],[9873,13,9873,30,1],[9874,13,9874,30,1],[9875,13,9875,30,1],[9876,13,9876,30,1],[9877,13,9877,30,1],[9878,13,9878,30,1],[9879,13,9879,30,1],[9880,13,9880,30,1],[9881,13,9881,30,1],[9882,13,9882,30,1],[9883,13,9883,30,1],[9884,13,9884,30,1],[9885,13,9885,30,1],[9886,13,9886,30,1],[9887,13,9887,30,1],[9888,13,9888,30,1],[9889,13,9889,30,1],[9890,13,9890,30,1],[9891,13,9891,30,1],[9892,13,9892,30,1],[9893,13,9893,30,1],[9894,13,9894,30,1],[9895,13,9895,30,1],[9896,13,9896,30,1],[9897,13,9897,30,1],[9898,13,9898,30,1],[9899,13,9899,30,1],[9900,13,9900,30,1],[9901,13,9901,30,1],[9902,13,9902,30,1],[9903,13,9903,30,1],[9904,13,9904,30,1],[9905,13,9905,30,1],[9906,13,9906,30,1],[9907,13,9907,30,1],[9908,13,9908,30,1],[9909,13,9909,30,1],[9910,13,9910,30,1],[9911,13,9911,30,1],[9912,13,9912,30,1],[9913,13,9913,30,1],[9914,13,9914,30,1],[9915,13,9915,30,1],[9916,13,9916,30,1],[9917,13,9917,30,1],[9918,13,9918,30,1],[9919,13,9919,30,1],[9920,13,9920,30,1],[9921,13,9921,30,1],[9922,13,9922,30,1],[9923,13,9923,30,1],[9924,13,9924,30,1],[9925,13,9925,30,1],[9926,13,9926,30,1],[9927,13,9927,30,1],[9928,13,9928,30,1],[9929,13,9929,30,1],[9930,13,9930,30,1],[9931,13,9931,30,1],[9932,13,9932,30,1],[9933,13,9933,30,1],[9934,13,9934,30,1],[9935,13,9935,30,1],[9936,13,9936,30,1],[9937,13,9937,30,1],[9938,13,9938,30,1],[9939,13,9939,30,1],[9940,13,9940,30,1],[9941,13,9941,30,1],[9942,13,9942,30,1],[9943,13,9943,30,1],[9944,13,9944,30,1],[9945,13,9945,30,1],[9946,13,9946,30,1],[9947,13,9947,30,1],[9948,13,9948,30,1],[9949,13,9949,30,1],[9950,13,9950,30,1],[9951,13,9951,30,1],[9952,13,9952,30,1],[9953,13,9953,30,1],[9954,13,9954,30,1],[9955,13,9955,30,1],[9956,13,9956,30,1],[9957,13,9957,30,1],[9958,13,9958,30,1],[9959,13,9959,30,1],[9960,13,9960,30,1],[9961,13,9961,30,1],[9962,13,9962,30,1],[9963,13,9963,30,1],[9964,13,9964,30,1],[9965,13,9965,30,1],[9966,13,9966,30,1],[9967,13,9967,30,1],[9968,13,9968,30,1],[9969,13,9969,30,1],[9970,13,9970,30,1],[9971,13,9971,30,1],[9972,13,9972,30,1],[9973,13,9973,30,1],[9974,13,9974,30,1],[9975,13,9975,30,1],[9976,13,9976,30,1],[9977,13,9977,30,1],[9978,13,9978,30,1],[9979,13,9979,30,1],[9980,13,9980,30,1],[9981,13,9981,30,1],[9982,13,9982,30,1],[9983,13,9983,30,1],[9984,13,9984,30,1],[9985,13,9985,30,1],[9986,13,9986,30,1],[9987,13,9987,30,1],[9988,13,9988,30,1],[9989,13,9989,30,1],[9990,13,9990,30,1],[9991,13,9991,30,1],[9992,13,9992,30,1],[9993,13,9993,30,1],[9994,13,9994,30,1],[9995,13,9995,30,1],[9996,13,9996,30,1],[9997,13,9997,30,1],[9998,13,9998,30,1],[9999,13,9999,30,1],[10000,13,10000,30,1],[10001,13,10001,30,1],[10002,13,10002,30,1],[10003,13,10003,30,1],[10004,13,10004,30,1],[10005,13,10005,30,1],[10006,13,10006,30,1],[10007,13,10007,30,1],[10008,13,10008,30,1],[10009,13,10009,30,1],[10010,13,10010,30,1],[10011,13,10011,30,1],[10012,13,10012,30,1],[10013,13,10013,30,1],[10014,13,10014,30,1],[10015,13,10015,30,1],[10016,13,10016,30,1],[10017,13,10017,30,1],[10018,13,10018,30,1],[10019,13,10019,30,1],[10020,13,10020,30,1],[10021,13,10021,30,1],[10022,13,10022,30,1],[10023,13,10023,30,1]]);\n    </script>\n  </body>\n</html>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/dotcover/valid_multiple_sequence_points_per_line.html",
    "content": "<!DOCTYPE html>\n<!--\nNote: the file paths were manually changed inside the report to be relative.\n\nCommand used to generate the file:\ndotCover.exe analyze \"/TargetExecutable=C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow\\vstest.console.exe\" \"/TargetWorkingDir=.\" \"/TargetArguments=GetSetTests\\bin\\Debug\\GetSetTests.dll\" /Output=\"dotCover.html\" /ReportType=html\n-->\n\n<html>\n  <head>\n    <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n    <title>GetSet\\Bar.cs</title>\n    <script type=\"text/javascript\" src=\"../js/dotcover.sourceview.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/dotcover.report.css\" />\n  </head>\n  <body>\n    <pre id=\"content\" class=\"source-code\">\nusing System;\n\nnamespace GetSet\n{\n    public class Bar\n    {\n        public int CoveredGet { get; set; } public int UncoveredProperty { get; set; } public int CoveredSet { get; set; }\n\n        public int CoveredGetOnSecondLine { get; set; }\n        \n        public int CoveredProperty { get; set; }\n        \n        public int ArrowMethod(bool condition) =&gt; condition ? CoveredGetOnSecondLine : UncoveredProperty;\n        \n        public int BodyMethod()\n        {\n            var x = CoveredProperty; CoveredProperty = 1; goto label; UncoveredProperty = 1;\n\n            UncoveredProperty = 1;\n            \n            label:\n            CoveredSet = 1;\n            \n            return CoveredGet;\n        }\n    }\n\n    public class FooCallsBar\n    {\n        public void CallBar(Bar bar)\n        {\n            Console.WriteLine(bar.CoveredGet);\n            Console.WriteLine(bar.CoveredProperty);\n        }\n    }\n}\n\n    </pre>\n    <script type=\"text/javascript\">\n      highlightRanges([[7,33,7,37,1],[7,38,7,42,0],[7,76,7,80,0],[7,81,7,85,0],[7,112,7,116,0],[7,117,7,121,1],[9,45,9,49,1],[9,50,9,54,0],[11,38,11,42,1],[11,43,11,47,1],[13,51,13,105,1],[16,9,16,10,1],[17,13,17,37,1],[17,38,17,58,1],[17,59,17,70,1],[21,13,21,19,1],[22,13,22,28,1],[24,13,24,31,1],[25,9,25,10,1],[31,9,31,10,1],[32,13,32,47,1],[33,13,33,52,1],[34,9,34,10,1]]);\n    </script>\n  </body>\n</html>"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/dotcover_aggregator/empty_folder/src/.gitignore",
    "content": ""
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/dotcover_aggregator/empty_folder.html",
    "content": "<!DOCTYPE html>\n<html class=\"main\">\n</html>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/dotcover_aggregator/foo.bar/src/1.html",
    "content": ""
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/dotcover_aggregator/foo.bar/src/2.html",
    "content": ""
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/dotcover_aggregator/foo.bar/src/nosource.html",
    "content": ""
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/dotcover_aggregator/foo.bar.html",
    "content": "<!DOCTYPE html>\n<html class=\"main\">\n</html>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/dotcover_aggregator/no_extension",
    "content": "<!DOCTYPE html>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/dotcover_aggregator/no_sources.html",
    "content": "<!DOCTYPE html>\n<html class=\"main\">\n</html>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/dotcover_aggregator/not_html.html",
    "content": ""
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/ncover3/invalid_path.nccov",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- saved from NCover 3.0 Export url='http://www.ncover.com/' -->\n<coverage profilerVersion=\"3.4.18.6937\" driverVersion=\"3.4.18.6937\" exportversion=\"3\" viewdisplayname=\"\" startTime=\"2014-02-06T15:47:06.9555313Z\" measureTime=\"2014-02-06T15:47:09.9262344Z\" projectName=\"New Project\" buildid=\"3a947bd1-ea16-478e-9e0e-315c2dfaed69\" coveragenodeid=\"0\" failed=\"false\" satisfactorybranchthreshold=\"95\" satisfactorycoveragethreshold=\"95\" satisfactorycyclomaticcomplexitythreshold=\"20\" satisfactoryfunctionthreshold=\"80\" satisfactoryunvisitedsequencepoints=\"10\" uiviewtype=\"TreeView\" viewguid=\"New Project\" viewfilterstyle=\"None\" viewreportstyle=\"SequencePointCoveragePercentage\" viewsortstyle=\"Name\">\n  <rebasedpaths />\n  <filters />\n  <documents>\n    <doc id=\"1\" excluded=\"false\" url=\"z:\\*&quot;?.cs\" cs=\"B0BC97C776FACFF27CB56359F2B4FD3A\" csa=\"406ea660-64cf-4c82-b6f0-42d48172a799\" om=\"17\" nid=\"0\" />\n    <doc id=\"3\" excluded=\"false\" url=\"MyLibraryNUnitTest\\AdderNUnitTest.cs\" cs=\"6A759C6D31B76B14D1D3F1E56AD7502B\" csa=\"406ea660-64cf-4c82-b6f0-42d48172a799\" om=\"21\" nid=\"0\" />\n    <doc id=\"2\" excluded=\"false\" url=\"MyLibraryTest\\AdderTest.cs\" cs=\"7E5A9DF8B477B46A538E9A508CDB451C\" csa=\"406ea660-64cf-4c82-b6f0-42d48172a799\" om=\"19\" nid=\"0\" />\n    <doc id=\"4\" excluded=\"false\" url=\"MyLibraryXUnitTest\\AdderXUnitTest.cs\" cs=\"45BAE5F98CB97DF5D5F0E0E0818E3C23\" csa=\"406ea660-64cf-4c82-b6f0-42d48172a799\" om=\"22\" nid=\"0\" />\n    <doc id=\"0\" excluded=\"false\" url=\"None\" cs=\"\" csa=\"00000000-0000-0000-0000-000000000000\" om=\"0\" nid=\"0\" />\n  </documents>\n  <module moduleId=\"17\" name=\"C:\\Users\\Dinesh\\Documents\\Visual Studio 2010\\Projects\\CSharpPlayground\\MyLibrary\\bin\\Debug\\MyLibrary.dll\" assembly=\"MyLibrary\" assemblyIdentity=\"MyLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null, processorArchitecture=MSIL\" nid=\"0\">\n    <class name=\"Foo.A\" signature=\"Foo.A\" excluded=\"false\" nid=\"0\">\n      <method name=\".ctor\" signature=\".ctor() : void\" excluded=\"false\" instrumented=\"false\" cc=\"1\" vc=\"0\" nid=\"0\">\n        <seqpnt vc=\"0\" o=\"6\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"0\" nid=\"0\" />\n      </method>\n    </class>\n    <class name=\"Foo.A`1\" signature=\"Foo.A`1\" excluded=\"false\" nid=\"0\">\n      <method name=\".ctor\" signature=\".ctor() : void\" excluded=\"false\" instrumented=\"false\" cc=\"1\" vc=\"0\" nid=\"0\">\n        <seqpnt vc=\"0\" o=\"6\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"0\" nid=\"0\" />\n      </method>\n    </class>\n    <class name=\"Foo.A`2\" signature=\"Foo.A`2\" excluded=\"false\" nid=\"0\">\n      <method name=\".ctor\" signature=\".ctor() : void\" excluded=\"false\" instrumented=\"false\" cc=\"1\" vc=\"0\" nid=\"0\">\n        <seqpnt vc=\"0\" o=\"6\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"0\" nid=\"0\" />\n      </method>\n    </class>\n    <class name=\"MyLibrary.Adder\" signature=\"MyLibrary.Adder\" excluded=\"false\" nid=\"0\">\n      <method name=\".ctor\" signature=\".ctor() : void\" excluded=\"false\" instrumented=\"false\" cc=\"1\" vc=\"0\" nid=\"0\">\n        <seqpnt vc=\"0\" o=\"6\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"1\" nid=\"0\" />\n      </method>\n      <method name=\"Add\" signature=\"Add(System.Int32 op1,System.Int32 op2) : System.Int32 [static]\" excluded=\"false\" instrumented=\"true\" cc=\"4\" vc=\"2\" nid=\"0\">\n        <seqpnt vc=\"2\" o=\"1\" l=\"12\" el=\"12\" c=\"13\" ec=\"36\" ex=\"false\" fl=\"65536\" doc=\"1\" nid=\"0\" />\n        <seqpnt vc=\"2\" o=\"6\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"1\" nid=\"0\" />\n        <seqpnt vc=\"0\" o=\"13\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"1\" nid=\"0\" />\n        <seqpnt vc=\"2\" o=\"15\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"1\" nid=\"0\" />\n        <seqpnt vc=\"0\" o=\"18\" l=\"14\" el=\"14\" c=\"17\" ec=\"52\" ex=\"false\" fl=\"65536\" doc=\"1\" nid=\"0\" />\n        <seqpnt vc=\"0\" o=\"23\" l=\"15\" el=\"15\" c=\"17\" ec=\"52\" ex=\"false\" fl=\"65536\" doc=\"1\" nid=\"0\" />\n        <seqpnt vc=\"2\" o=\"31\" l=\"18\" el=\"18\" c=\"20\" ec=\"50\" ex=\"false\" fl=\"65536\" doc=\"1\" nid=\"0\" />\n        <seqpnt vc=\"2\" o=\"3C\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"1\" nid=\"0\" />\n        <seqpnt vc=\"2\" o=\"3C\" l=\"22\" el=\"22\" c=\"13\" ec=\"47\" ex=\"false\" fl=\"65536\" doc=\"1\" nid=\"0\" />\n        <seqpnt vc=\"2\" o=\"47\" l=\"22\" el=\"22\" c=\"48\" ec=\"103\" ex=\"false\" fl=\"65536\" doc=\"1\" nid=\"0\" />\n        <seqpnt vc=\"2\" o=\"4C\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"1\" nid=\"0\" />\n        <seqpnt vc=\"2\" o=\"5A\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"1\" nid=\"0\" />\n        <seqpnt vc=\"2\" o=\"60\" l=\"26\" el=\"26\" c=\"13\" ec=\"30\" ex=\"false\" fl=\"65536\" doc=\"1\" nid=\"0\" />\n        <seqpnt vc=\"2\" o=\"66\" l=\"27\" el=\"27\" c=\"9\" ec=\"10\" ex=\"false\" fl=\"65536\" doc=\"1\" nid=\"0\" />\n        <seqpnt vc=\"2\" o=\"67\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"1\" nid=\"0\" />\n      </method>\n      <method name=\"Test1\" signature=\"Test1() : System.Boolean [static]\" excluded=\"false\" instrumented=\"true\" cc=\"1\" vc=\"4\" nid=\"0\">\n        <seqpnt vc=\"4\" o=\"1\" l=\"31\" el=\"31\" c=\"13\" ec=\"25\" ex=\"false\" fl=\"65536\" doc=\"1\" nid=\"0\" />\n        <seqpnt vc=\"4\" o=\"5\" l=\"32\" el=\"32\" c=\"9\" ec=\"10\" ex=\"false\" fl=\"65536\" doc=\"1\" nid=\"0\" />\n        <seqpnt vc=\"4\" o=\"6\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"1\" nid=\"0\" />\n      </method>\n      <method name=\"Test2\" signature=\"Test2() : System.Boolean [static]\" excluded=\"false\" instrumented=\"true\" cc=\"1\" vc=\"2\" nid=\"0\">\n        <seqpnt vc=\"2\" o=\"1\" l=\"36\" el=\"36\" c=\"13\" ec=\"26\" ex=\"false\" fl=\"65536\" doc=\"1\" nid=\"0\" />\n        <seqpnt vc=\"2\" o=\"5\" l=\"37\" el=\"37\" c=\"9\" ec=\"10\" ex=\"false\" fl=\"65536\" doc=\"1\" nid=\"0\" />\n        <seqpnt vc=\"2\" o=\"6\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"1\" nid=\"0\" />\n      </method>\n    </class>\n  </module>\n  <module moduleId=\"21\" name=\"C:\\Users\\Dinesh\\Documents\\Visual Studio 2010\\Projects\\CSharpPlayground\\MyLibraryNUnitTest\\bin\\Debug\\MyLibraryNUnitTest.dll\" assembly=\"MyLibraryNUnitTest\" assemblyIdentity=\"MyLibraryNUnitTest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null, processorArchitecture=MSIL\" nid=\"0\">\n    <class name=\"MyLibraryNUnitTest.AdderNUnitTest\" signature=\"MyLibraryNUnitTest.AdderNUnitTest\" excluded=\"false\" nid=\"0\">\n      <method name=\".ctor\" signature=\".ctor() : void\" excluded=\"false\" instrumented=\"true\" cc=\"1\" vc=\"1\" nid=\"0\">\n        <seqpnt vc=\"1\" o=\"6\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"3\" nid=\"0\" />\n      </method>\n      <method name=\"Add\" signature=\"Add() : void\" excluded=\"false\" instrumented=\"true\" cc=\"1\" vc=\"1\" nid=\"0\">\n        <seqpnt vc=\"1\" o=\"1\" l=\"17\" el=\"17\" c=\"13\" ec=\"51\" ex=\"false\" fl=\"65536\" doc=\"3\" nid=\"0\" />\n        <seqpnt vc=\"1\" o=\"11\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"3\" nid=\"0\" />\n        <seqpnt vc=\"1\" o=\"11\" l=\"18\" el=\"18\" c=\"9\" ec=\"10\" ex=\"false\" fl=\"65536\" doc=\"3\" nid=\"0\" />\n      </method>\n      <method name=\"Add2\" signature=\"Add2() : void\" excluded=\"false\" instrumented=\"true\" cc=\"1\" vc=\"1\" nid=\"0\">\n        <seqpnt vc=\"1\" o=\"1\" l=\"23\" el=\"23\" c=\"13\" ec=\"51\" ex=\"false\" fl=\"65536\" doc=\"3\" nid=\"0\" />\n        <seqpnt vc=\"1\" o=\"11\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"3\" nid=\"0\" />\n        <seqpnt vc=\"1\" o=\"11\" l=\"24\" el=\"24\" c=\"9\" ec=\"10\" ex=\"false\" fl=\"65536\" doc=\"3\" nid=\"0\" />\n      </method>\n    </class>\n  </module>\n  <module moduleId=\"19\" name=\"C:\\Users\\Dinesh\\Documents\\Visual Studio 2010\\Projects\\CSharpPlayground\\MyLibraryTest\\bin\\Debug\\MyLibraryTest.dll\" assembly=\"MyLibraryTest\" assemblyIdentity=\"MyLibraryTest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null, processorArchitecture=MSIL\" nid=\"0\">\n    <class name=\"MyLibraryTest.AdderTest\" signature=\"MyLibraryTest.AdderTest\" excluded=\"false\" nid=\"0\">\n      <method name=\".ctor\" signature=\".ctor() : void\" excluded=\"false\" instrumented=\"false\" cc=\"1\" vc=\"0\" nid=\"0\">\n        <seqpnt vc=\"0\" o=\"6\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"2\" nid=\"0\" />\n      </method>\n      <method name=\"Add\" signature=\"Add() : void\" excluded=\"false\" instrumented=\"false\" cc=\"1\" vc=\"0\" nid=\"0\">\n        <seqpnt vc=\"0\" o=\"1\" l=\"17\" el=\"17\" c=\"13\" ec=\"51\" ex=\"false\" fl=\"65536\" doc=\"2\" nid=\"0\" />\n        <seqpnt vc=\"0\" o=\"11\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"2\" nid=\"0\" />\n        <seqpnt vc=\"0\" o=\"11\" l=\"18\" el=\"18\" c=\"9\" ec=\"10\" ex=\"false\" fl=\"65536\" doc=\"2\" nid=\"0\" />\n      </method>\n    </class>\n  </module>\n  <module moduleId=\"22\" name=\"C:\\Users\\Dinesh\\Documents\\Visual Studio 2010\\Projects\\CSharpPlayground\\MyLibraryXUnitTest\\bin\\Debug\\MyLibraryXUnitTest.dll\" assembly=\"MyLibraryXUnitTest\" assemblyIdentity=\"MyLibraryXUnitTest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null, processorArchitecture=MSIL\" nid=\"0\">\n    <class name=\"MyLibraryXUnitTest.AdderXUnitTest\" signature=\"MyLibraryXUnitTest.AdderXUnitTest\" excluded=\"false\" nid=\"0\">\n      <method name=\".ctor\" signature=\".ctor() : void\" excluded=\"false\" instrumented=\"false\" cc=\"1\" vc=\"0\" nid=\"0\">\n        <seqpnt vc=\"0\" o=\"6\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"4\" nid=\"0\" />\n      </method>\n      <method name=\"Add\" signature=\"Add() : void\" excluded=\"false\" instrumented=\"false\" cc=\"1\" vc=\"0\" nid=\"0\">\n        <seqpnt vc=\"0\" o=\"1\" l=\"16\" el=\"16\" c=\"13\" ec=\"48\" ex=\"false\" fl=\"65536\" doc=\"4\" nid=\"0\" />\n        <seqpnt vc=\"0\" o=\"11\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"4\" nid=\"0\" />\n        <seqpnt vc=\"0\" o=\"11\" l=\"17\" el=\"17\" c=\"9\" ec=\"10\" ex=\"false\" fl=\"65536\" doc=\"4\" nid=\"0\" />\n      </method>\n    </class>\n  </module>\n</coverage>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/ncover3/invalid_root.nccov",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<foo />\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/ncover3/no_version.nccov",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- saved from NCover 3.0 Export url='http://www.ncover.com/' -->\n<coverage profilerVersion=\"3.4.18.6937\" driverVersion=\"3.4.18.6937\" viewdisplayname=\"\" startTime=\"2014-02-06T15:47:06.9555313Z\" measureTime=\"2014-02-06T15:47:09.9262344Z\" projectName=\"New Project\" buildid=\"3a947bd1-ea16-478e-9e0e-315c2dfaed69\" coveragenodeid=\"0\" failed=\"false\" satisfactorybranchthreshold=\"95\" satisfactorycoveragethreshold=\"95\" satisfactorycyclomaticcomplexitythreshold=\"20\" satisfactoryfunctionthreshold=\"80\" satisfactoryunvisitedsequencepoints=\"10\" uiviewtype=\"TreeView\" viewguid=\"New Project\" viewfilterstyle=\"None\" viewreportstyle=\"SequencePointCoveragePercentage\" viewsortstyle=\"Name\">\n</coverage>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/ncover3/one_file.nccov",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- saved from NCover 3.0 Export url='http://www.ncover.com/' -->\n<coverage profilerVersion=\"3.4.18.6937\" driverVersion=\"3.4.18.6937\" exportversion=\"3\" viewdisplayname=\"\" startTime=\"2014-02-06T15:47:06.9555313Z\" measureTime=\"2014-02-06T15:47:09.9262344Z\" projectName=\"New Project\" buildid=\"3a947bd1-ea16-478e-9e0e-315c2dfaed69\" coveragenodeid=\"0\" failed=\"false\" satisfactorybranchthreshold=\"95\" satisfactorycoveragethreshold=\"95\" satisfactorycyclomaticcomplexitythreshold=\"20\" satisfactoryfunctionthreshold=\"80\" satisfactoryunvisitedsequencepoints=\"10\" uiviewtype=\"TreeView\" viewguid=\"New Project\" viewfilterstyle=\"None\" viewreportstyle=\"SequencePointCoveragePercentage\" viewsortstyle=\"Name\">\n  <rebasedpaths />\n  <filters />\n  <documents>\n    <doc id=\"1\" excluded=\"false\" url=\"MyLibrary\\Adder.cs\" cs=\"B0BC97C776FACFF27CB56359F2B4FD3A\" csa=\"406ea660-64cf-4c82-b6f0-42d48172a799\" om=\"17\" nid=\"0\" />\n  </documents>\n  <module moduleId=\"17\" name=\"C:\\Users\\Dinesh\\Documents\\Visual Studio 2010\\Projects\\CSharpPlayground\\MyLibrary\\bin\\Debug\\MyLibrary.dll\" assembly=\"MyLibrary\" assemblyIdentity=\"MyLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null, processorArchitecture=MSIL\" nid=\"0\">\n    <class name=\"MyLibrary.Adder\" signature=\"MyLibrary.Adder\" excluded=\"false\" nid=\"0\">\n      <method name=\"Test1\" signature=\"Test1() : System.Boolean [static]\" excluded=\"false\" instrumented=\"true\" cc=\"1\" vc=\"4\" nid=\"0\">\n        <seqpnt vc=\"4\" o=\"1\" l=\"31\" el=\"31\" c=\"13\" ec=\"25\" ex=\"false\" fl=\"65536\" doc=\"1\" nid=\"0\" />\n        <seqpnt vc=\"4\" o=\"5\" l=\"32\" el=\"32\" c=\"9\" ec=\"10\" ex=\"false\" fl=\"65536\" doc=\"1\" nid=\"0\" />\n      </method>\n    </class>\n  </module>\n</coverage>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/ncover3/valid.nccov",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- saved from NCover 3.0 Export url='http://www.ncover.com/' -->\n<coverage profilerVersion=\"3.4.18.6937\" driverVersion=\"3.4.18.6937\" exportversion=\"3\" viewdisplayname=\"\" startTime=\"2014-02-06T15:47:06.9555313Z\" measureTime=\"2014-02-06T15:47:09.9262344Z\" projectName=\"New Project\" buildid=\"3a947bd1-ea16-478e-9e0e-315c2dfaed69\" coveragenodeid=\"0\" failed=\"false\" satisfactorybranchthreshold=\"95\" satisfactorycoveragethreshold=\"95\" satisfactorycyclomaticcomplexitythreshold=\"20\" satisfactoryfunctionthreshold=\"80\" satisfactoryunvisitedsequencepoints=\"10\" uiviewtype=\"TreeView\" viewguid=\"New Project\" viewfilterstyle=\"None\" viewreportstyle=\"SequencePointCoveragePercentage\" viewsortstyle=\"Name\">\n  <rebasedpaths />\n  <filters />\n  <documents>\n    <doc id=\"1\" excluded=\"false\" url=\"MyLibrary\\Adder.cs\" cs=\"B0BC97C776FACFF27CB56359F2B4FD3A\" csa=\"406ea660-64cf-4c82-b6f0-42d48172a799\" om=\"17\" nid=\"0\" />\n    <doc id=\"3\" excluded=\"false\" url=\"MyLibraryNUnitTest\\AdderNUnitTest.cs\" cs=\"6A759C6D31B76B14D1D3F1E56AD7502B\" csa=\"406ea660-64cf-4c82-b6f0-42d48172a799\" om=\"21\" nid=\"0\" />\n    <doc id=\"2\" excluded=\"false\" url=\"MyLibraryTest\\AdderTest.cs\" cs=\"7E5A9DF8B477B46A538E9A508CDB451C\" csa=\"406ea660-64cf-4c82-b6f0-42d48172a799\" om=\"19\" nid=\"0\" />\n    <doc id=\"4\" excluded=\"false\" url=\"MyLibraryXUnitTest\\AdderXUnitTest.cs\" cs=\"45BAE5F98CB97DF5D5F0E0E0818E3C23\" csa=\"406ea660-64cf-4c82-b6f0-42d48172a799\" om=\"22\" nid=\"0\" />\n    <doc id=\"0\" excluded=\"false\" url=\"None\" cs=\"\" csa=\"00000000-0000-0000-0000-000000000000\" om=\"0\" nid=\"0\" />\n  </documents>\n  <module moduleId=\"17\" name=\"C:\\Users\\Dinesh\\Documents\\Visual Studio 2010\\Projects\\CSharpPlayground\\MyLibrary\\bin\\Debug\\MyLibrary.dll\" assembly=\"MyLibrary\" assemblyIdentity=\"MyLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null, processorArchitecture=MSIL\" nid=\"0\">\n    <class name=\"Foo.A\" signature=\"Foo.A\" excluded=\"false\" nid=\"0\">\n      <method name=\".ctor\" signature=\".ctor() : void\" excluded=\"false\" instrumented=\"false\" cc=\"1\" vc=\"0\" nid=\"0\">\n        <seqpnt vc=\"0\" o=\"6\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"0\" nid=\"0\" />\n      </method>\n    </class>\n    <class name=\"Foo.A`1\" signature=\"Foo.A`1\" excluded=\"false\" nid=\"0\">\n      <method name=\".ctor\" signature=\".ctor() : void\" excluded=\"false\" instrumented=\"false\" cc=\"1\" vc=\"0\" nid=\"0\">\n        <seqpnt vc=\"0\" o=\"6\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"0\" nid=\"0\" />\n      </method>\n    </class>\n    <class name=\"Foo.A`2\" signature=\"Foo.A`2\" excluded=\"false\" nid=\"0\">\n      <method name=\".ctor\" signature=\".ctor() : void\" excluded=\"false\" instrumented=\"false\" cc=\"1\" vc=\"0\" nid=\"0\">\n        <seqpnt vc=\"0\" o=\"6\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"0\" nid=\"0\" />\n      </method>\n    </class>\n    <class name=\"MyLibrary.Adder\" signature=\"MyLibrary.Adder\" excluded=\"false\" nid=\"0\">\n      <method name=\".ctor\" signature=\".ctor() : void\" excluded=\"false\" instrumented=\"false\" cc=\"1\" vc=\"0\" nid=\"0\">\n        <seqpnt vc=\"0\" o=\"6\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"1\" nid=\"0\" />\n      </method>\n      <method name=\"Add\" signature=\"Add(System.Int32 op1,System.Int32 op2) : System.Int32 [static]\" excluded=\"false\" instrumented=\"true\" cc=\"4\" vc=\"2\" nid=\"0\">\n        <seqpnt vc=\"2\" o=\"1\" l=\"12\" el=\"12\" c=\"13\" ec=\"36\" ex=\"false\" fl=\"65536\" doc=\"1\" nid=\"0\" />\n        <seqpnt vc=\"2\" o=\"6\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"1\" nid=\"0\" />\n        <seqpnt vc=\"0\" o=\"13\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"1\" nid=\"0\" />\n        <seqpnt vc=\"2\" o=\"15\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"1\" nid=\"0\" />\n        <seqpnt vc=\"0\" o=\"18\" l=\"14\" el=\"14\" c=\"17\" ec=\"52\" ex=\"false\" fl=\"65536\" doc=\"1\" nid=\"0\" />\n        <seqpnt vc=\"0\" o=\"23\" l=\"15\" el=\"15\" c=\"17\" ec=\"52\" ex=\"false\" fl=\"65536\" doc=\"1\" nid=\"0\" />\n        <seqpnt vc=\"2\" o=\"31\" l=\"18\" el=\"18\" c=\"20\" ec=\"50\" ex=\"false\" fl=\"65536\" doc=\"1\" nid=\"0\" />\n        <seqpnt vc=\"2\" o=\"3C\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"1\" nid=\"0\" />\n        <seqpnt vc=\"2\" o=\"3C\" l=\"22\" el=\"22\" c=\"13\" ec=\"47\" ex=\"false\" fl=\"65536\" doc=\"1\" nid=\"0\" />\n        <seqpnt vc=\"2\" o=\"47\" l=\"22\" el=\"22\" c=\"48\" ec=\"103\" ex=\"false\" fl=\"65536\" doc=\"1\" nid=\"0\" />\n        <seqpnt vc=\"2\" o=\"4C\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"1\" nid=\"0\" />\n        <seqpnt vc=\"2\" o=\"5A\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"1\" nid=\"0\" />\n        <seqpnt vc=\"2\" o=\"60\" l=\"26\" el=\"26\" c=\"13\" ec=\"30\" ex=\"false\" fl=\"65536\" doc=\"1\" nid=\"0\" />\n        <seqpnt vc=\"2\" o=\"66\" l=\"27\" el=\"27\" c=\"9\" ec=\"10\" ex=\"false\" fl=\"65536\" doc=\"1\" nid=\"0\" />\n        <seqpnt vc=\"2\" o=\"67\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"1\" nid=\"0\" />\n      </method>\n      <method name=\"Test1\" signature=\"Test1() : System.Boolean [static]\" excluded=\"false\" instrumented=\"true\" cc=\"1\" vc=\"4\" nid=\"0\">\n        <seqpnt vc=\"4\" o=\"1\" l=\"31\" el=\"31\" c=\"13\" ec=\"25\" ex=\"false\" fl=\"65536\" doc=\"1\" nid=\"0\" />\n        <seqpnt vc=\"4\" o=\"5\" l=\"32\" el=\"32\" c=\"9\" ec=\"10\" ex=\"false\" fl=\"65536\" doc=\"1\" nid=\"0\" />\n        <seqpnt vc=\"4\" o=\"6\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"1\" nid=\"0\" />\n      </method>\n      <method name=\"Test2\" signature=\"Test2() : System.Boolean [static]\" excluded=\"false\" instrumented=\"true\" cc=\"1\" vc=\"2\" nid=\"0\">\n        <seqpnt vc=\"2\" o=\"1\" l=\"36\" el=\"36\" c=\"13\" ec=\"26\" ex=\"false\" fl=\"65536\" doc=\"1\" nid=\"0\" />\n        <seqpnt vc=\"2\" o=\"5\" l=\"37\" el=\"37\" c=\"9\" ec=\"10\" ex=\"false\" fl=\"65536\" doc=\"1\" nid=\"0\" />\n        <seqpnt vc=\"2\" o=\"6\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"1\" nid=\"0\" />\n      </method>\n    </class>\n  </module>\n  <module moduleId=\"21\" name=\"C:\\Users\\Dinesh\\Documents\\Visual Studio 2010\\Projects\\CSharpPlayground\\MyLibraryNUnitTest\\bin\\Debug\\MyLibraryNUnitTest.dll\" assembly=\"MyLibraryNUnitTest\" assemblyIdentity=\"MyLibraryNUnitTest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null, processorArchitecture=MSIL\" nid=\"0\">\n    <class name=\"MyLibraryNUnitTest.AdderNUnitTest\" signature=\"MyLibraryNUnitTest.AdderNUnitTest\" excluded=\"false\" nid=\"0\">\n      <method name=\".ctor\" signature=\".ctor() : void\" excluded=\"false\" instrumented=\"true\" cc=\"1\" vc=\"1\" nid=\"0\">\n        <seqpnt vc=\"1\" o=\"6\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"3\" nid=\"0\" />\n      </method>\n      <method name=\"Add\" signature=\"Add() : void\" excluded=\"false\" instrumented=\"true\" cc=\"1\" vc=\"1\" nid=\"0\">\n        <seqpnt vc=\"1\" o=\"1\" l=\"17\" el=\"17\" c=\"13\" ec=\"51\" ex=\"false\" fl=\"65536\" doc=\"3\" nid=\"0\" />\n        <seqpnt vc=\"1\" o=\"11\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"3\" nid=\"0\" />\n        <seqpnt vc=\"1\" o=\"11\" l=\"18\" el=\"18\" c=\"9\" ec=\"10\" ex=\"false\" fl=\"65536\" doc=\"3\" nid=\"0\" />\n      </method>\n      <method name=\"Add2\" signature=\"Add2() : void\" excluded=\"false\" instrumented=\"true\" cc=\"1\" vc=\"1\" nid=\"0\">\n        <seqpnt vc=\"1\" o=\"1\" l=\"23\" el=\"23\" c=\"13\" ec=\"51\" ex=\"false\" fl=\"65536\" doc=\"3\" nid=\"0\" />\n        <seqpnt vc=\"1\" o=\"11\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"3\" nid=\"0\" />\n        <seqpnt vc=\"1\" o=\"11\" l=\"24\" el=\"24\" c=\"9\" ec=\"10\" ex=\"false\" fl=\"65536\" doc=\"3\" nid=\"0\" />\n      </method>\n    </class>\n  </module>\n  <module moduleId=\"19\" name=\"C:\\Users\\Dinesh\\Documents\\Visual Studio 2010\\Projects\\CSharpPlayground\\MyLibraryTest\\bin\\Debug\\MyLibraryTest.dll\" assembly=\"MyLibraryTest\" assemblyIdentity=\"MyLibraryTest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null, processorArchitecture=MSIL\" nid=\"0\">\n    <class name=\"MyLibraryTest.AdderTest\" signature=\"MyLibraryTest.AdderTest\" excluded=\"false\" nid=\"0\">\n      <method name=\".ctor\" signature=\".ctor() : void\" excluded=\"false\" instrumented=\"false\" cc=\"1\" vc=\"0\" nid=\"0\">\n        <seqpnt vc=\"0\" o=\"6\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"2\" nid=\"0\" />\n      </method>\n      <method name=\"Add\" signature=\"Add() : void\" excluded=\"false\" instrumented=\"false\" cc=\"1\" vc=\"0\" nid=\"0\">\n        <seqpnt vc=\"0\" o=\"1\" l=\"17\" el=\"17\" c=\"13\" ec=\"51\" ex=\"false\" fl=\"65536\" doc=\"2\" nid=\"0\" />\n        <seqpnt vc=\"0\" o=\"11\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"2\" nid=\"0\" />\n        <seqpnt vc=\"0\" o=\"11\" l=\"18\" el=\"18\" c=\"9\" ec=\"10\" ex=\"false\" fl=\"65536\" doc=\"2\" nid=\"0\" />\n      </method>\n    </class>\n  </module>\n  <module moduleId=\"22\" name=\"C:\\Users\\Dinesh\\Documents\\Visual Studio 2010\\Projects\\CSharpPlayground\\MyLibraryXUnitTest\\bin\\Debug\\MyLibraryXUnitTest.dll\" assembly=\"MyLibraryXUnitTest\" assemblyIdentity=\"MyLibraryXUnitTest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null, processorArchitecture=MSIL\" nid=\"0\">\n    <class name=\"MyLibraryXUnitTest.AdderXUnitTest\" signature=\"MyLibraryXUnitTest.AdderXUnitTest\" excluded=\"false\" nid=\"0\">\n      <method name=\".ctor\" signature=\".ctor() : void\" excluded=\"false\" instrumented=\"false\" cc=\"1\" vc=\"0\" nid=\"0\">\n        <seqpnt vc=\"0\" o=\"6\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"4\" nid=\"0\" />\n      </method>\n      <method name=\"Add\" signature=\"Add() : void\" excluded=\"false\" instrumented=\"false\" cc=\"1\" vc=\"0\" nid=\"0\">\n        <seqpnt vc=\"0\" o=\"1\" l=\"16\" el=\"16\" c=\"13\" ec=\"48\" ex=\"false\" fl=\"65536\" doc=\"4\" nid=\"0\" />\n        <seqpnt vc=\"0\" o=\"11\" l=\"0\" el=\"0\" c=\"0\" ec=\"0\" ex=\"false\" fl=\"131072\" doc=\"4\" nid=\"0\" />\n        <seqpnt vc=\"0\" o=\"11\" l=\"17\" el=\"17\" c=\"9\" ec=\"10\" ex=\"false\" fl=\"65536\" doc=\"4\" nid=\"0\" />\n      </method>\n    </class>\n  </module>\n</coverage>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/ncover3/wrong_version.nccov",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- saved from NCover 3.0 Export url='http://www.ncover.com/' -->\n<coverage profilerVersion=\"3.4.18.6937\" driverVersion=\"3.4.18.6937\" exportversion=\"2\" viewdisplayname=\"\" startTime=\"2014-02-06T15:47:06.9555313Z\" measureTime=\"2014-02-06T15:47:09.9262344Z\" projectName=\"New Project\" buildid=\"3a947bd1-ea16-478e-9e0e-315c2dfaed69\" coveragenodeid=\"0\" failed=\"false\" satisfactorybranchthreshold=\"95\" satisfactorycoveragethreshold=\"95\" satisfactorycyclomaticcomplexitythreshold=\"20\" satisfactoryfunctionthreshold=\"80\" satisfactoryunvisitedsequencepoints=\"10\" uiviewtype=\"TreeView\" viewguid=\"New Project\" viewfilterstyle=\"None\" viewreportstyle=\"SequencePointCoveragePercentage\" viewsortstyle=\"Name\">\n</coverage>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/nunit/invalid_root.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<foo />\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/nunit/invalid_test_outcome.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<test-run id=\"0\" name=\"NUnitTestProj.dll\" fullname=\"C:\\dev\\Playground\\NUnit\\bin\\Debug\\net9.0\\NUnitTestProj.dll\" runstate=\"Runnable\" testcasecount=\"1\" result=\"Passed\" total=\"1\" passed=\"1\" failed=\"0\" warnings=\"0\" inconclusive=\"0\" skipped=\"0\" asserts=\"1\" engine-version=\"3.18.1.0\" clr-version=\"9.0.0\" start-time=\"2024-11-20 10:15:12Z\" end-time=\"2024-11-20 10:15:12Z\" duration=\"0.062075\">\n  <command-line><![CDATA[C:\\dev\\Playground\\NUnit\\bin\\Debug\\net9.0\\testhost.dll --port 52057 --endpoint 127.0.0.1:052057 --role client --parentprocessid 2856 --telemetryoptedin false]]></command-line>\n  <test-suite type=\"Assembly\" id=\"0-1005\" name=\"NUnitTestProj.dll\" fullname=\"C:\\dev\\Playground\\NUnit\\bin\\Debug\\net9.0\\NUnitTestProj.dll\" runstate=\"Runnable\" testcasecount=\"1\" result=\"Passed\" site=\"Child\" start-time=\"2024-11-20T10:15:12.7307782Z\" end-time=\"2024-11-20T10:15:12.7774522Z\" duration=\"0.046649\" total=\"1\" passed=\"1\" failed=\"0\" warnings=\"0\" inconclusive=\"0\" skipped=\"0\" asserts=\"1\">\n    <test-suite type=\"TestSuite\" id=\"0-1006\" name=\"NUnitTestProject\" fullname=\"NUnitTestProject\" runstate=\"Runnable\" testcasecount=\"4\" result=\"Passed\" site=\"Child\" start-time=\"2024-11-20T10:15:12.7342887Z\" end-time=\"2024-11-20T10:15:12.7774196Z\" duration=\"0.043131\" total=\"1\" passed=\"1\" failed=\"0\" warnings=\"0\" inconclusive=\"0\" skipped=\"0\" asserts=\"1\">\n      <test-suite type=\"TestFixture\" id=\"0-1000\" name=\"UnitTest1\" fullname=\"NUnitTestProject.UnitTest1\" classname=\"NUnitTestProject.UnitTest1\" runstate=\"Runnable\" testcasecount=\"1\" result=\"Passed\" site=\"Child\" start-time=\"2024-11-20T10:15:12.7350880Z\" end-time=\"2024-11-20T10:15:12.7770812Z\" duration=\"0.041994\" total=\"1\" passed=\"1\" failed=\"0\" warnings=\"0\" inconclusive=\"0\" skipped=\"0\" asserts=\"1\">\n        <test-case id=\"0-1001\" name=\"InvalidOutcome\" fullname=\"NUnitTestProject.UnitTest1.InvalidOutcome\" methodname=\"InvalidOutcome\" classname=\"NUnitTestProject.UnitTest1\" runstate=\"Runnable\" seed=\"477349529\" result=\"Invalid\" asserts=\"1\" start-time=\"2024-11-20T10:15:12.7350880Z\" end-time=\"2024-11-20T10:15:12.7770812Z\" duration=\"0.008230\" />\n      </test-suite>\n    </test-suite>\n  </test-suite>\n</test-run>"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/nunit/readme.md",
    "content": "# Generating Nunit Test Results\n\n## valid_nunit3.xml\n\nThese results are generated from [this project](https://github.com/alex-meseldzija-sonarsource/Playground/tree/main/Nunit) by running the `dotnet test --logger:nunit` command\n\nThis will generate a valid .xml file in Playground/Nunit/TestResults.\n\nAn extra assembly was also added from the [nunit-3 sample report](https://nunit.org/files/testresult_30.txt).\n\n## valid_nunit2.xml\n\nThese results are [the Nunit 2 sample report](https://nunit.org/files/testresult_25.txt)\n\nThis is a valid xml file that was generated from the above Nunit project but with a single cs file consisting of:\n\n```csharp\nnamespace DataDrivenWithNunit.Test\n{\n    public class CalculatorTestWithClassData\n    {\n        [Theory]\n        [ClassData(typeof(TestClassDataGenerator))]\n        public void Add_ShouldReturnCorrectSum(int a, int b, int expected)\n        {\n            // Act\n            int result = Hello.AddNumber(a, b);\n\n            // Assert\n            Assert.Equal(expected, result);\n        }\n\n\n    }\n\n    public class TestClassDataGenerator : IEnumerable<object[]>\n    {\n        public IEnumerator<object[]> GetEnumerator()\n        {\n            yield return new object[] { 2, 3, 5 }; // Test case 1\n            yield return new object[] { -1, 1, 0 }; // Test case 2\n        }\n\n        IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();\n    }\n}\n```\n\n## valid_no_execution_time.xml\n\nThis is a valid .xml file that consists of a single unit test that has had the duration tag removed.\n\n## valid_comma_in_double.xml\n\nThis is a valid .xml file that consists of a single unit test that has had the duration tag modified to have a double with a comma in the value.\n\n```xml\n<test-case duration=\"1,041\" />\n```\n\n## invalid_test_outcome.xml\n\nThis is a valid .xml file that has been modified to have an outcome that doesn't exist.\n\n```xml\n<test-case result=\"InvalidOutcome\"/>\n```\n\n## test_name_not_mapped.xml\n\nThis is a valid .xml file consisting of a single unit test extracted from valid.xml that is then not mapped correctly in the Hashmap provided to the NunitTestResultParser.\n\n## invalid_root.xml\n\nThis is a valid .xml file but not a valid Nunit report, it has had its root tag replace with\n\n```xml\n<foo/>\n```\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/nunit/test_name_not_mapped.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<test-run id=\"0\" name=\"NUnitTestProj.dll\" fullname=\"C:\\dev\\Playground\\NUnit\\bin\\Debug\\net9.0\\NUnitTestProj.dll\" runstate=\"Runnable\" testcasecount=\"1\" result=\"Passed\" total=\"1\" passed=\"1\" failed=\"0\" warnings=\"0\" inconclusive=\"0\" skipped=\"0\" asserts=\"1\" engine-version=\"3.18.1.0\" clr-version=\"9.0.0\" start-time=\"2024-11-20 10:15:12Z\" end-time=\"2024-11-20 10:15:12Z\" duration=\"0.062075\">\n  <command-line><![CDATA[C:\\dev\\Playground\\NUnit\\bin\\Debug\\net9.0\\testhost.dll --port 52057 --endpoint 127.0.0.1:052057 --role client --parentprocessid 2856 --telemetryoptedin false]]></command-line>\n  <test-suite type=\"Assembly\" id=\"0-1005\" name=\"NUnitTestProj.dll\" fullname=\"C:\\dev\\Playground\\NUnit\\bin\\Debug\\net9.0\\NUnitTestProj.dll\" runstate=\"Runnable\" testcasecount=\"1\" result=\"Passed\" site=\"Child\" start-time=\"2024-11-20T10:15:12.7307782Z\" end-time=\"2024-11-20T10:15:12.7774522Z\" duration=\"0.046649\" total=\"1\" passed=\"1\" failed=\"0\" warnings=\"0\" inconclusive=\"0\" skipped=\"0\" asserts=\"1\">\n    <test-suite type=\"TestSuite\" id=\"0-1006\" name=\"NUnitTestProject\" fullname=\"NUnitTestProject\" runstate=\"Runnable\" testcasecount=\"4\" result=\"Passed\" site=\"Child\" start-time=\"2024-11-20T10:15:12.7342887Z\" end-time=\"2024-11-20T10:15:12.7774196Z\" duration=\"0.043131\" total=\"1\" passed=\"1\" failed=\"0\" warnings=\"0\" inconclusive=\"0\" skipped=\"0\" asserts=\"1\">\n      <test-suite type=\"TestFixture\" id=\"0-1000\" name=\"UnitTest1\" fullname=\"NUnitTestProject.UnitTest1\" classname=\"NUnitTestProject.UnitTest1\" runstate=\"Runnable\" testcasecount=\"1\" result=\"Passed\" site=\"Child\" start-time=\"2024-11-20T10:15:12.7350880Z\" end-time=\"2024-11-20T10:15:12.7770812Z\" duration=\"0.041994\" total=\"1\" passed=\"1\" failed=\"0\" warnings=\"0\" inconclusive=\"0\" skipped=\"0\" asserts=\"1\">\n        <test-case id=\"0-1001\" name=\"TestMethodDoesNotExist\" fullname=\"NUnitTestProject.UnitTest1.TestMethodDoesNotExist\" methodname=\"TestMethodDoesNotExist\" classname=\"NUnitTestProject.UnitTest1\" runstate=\"Runnable\" seed=\"477349529\" result=\"Passed\" asserts=\"1\" start-time=\"2024-11-20T10:15:12.7350880Z\" end-time=\"2024-11-20T10:15:12.7770812Z\" duration=\"0.008230\" />\n      </test-suite>\n    </test-suite>\n  </test-suite>\n</test-run>"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/nunit/valid_comma_in_double.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<test-run id=\"0\" name=\"NUnitTestProj.dll\" fullname=\"C:\\dev\\Playground\\NUnit\\bin\\Debug\\net9.0\\NUnitTestProj.dll\" runstate=\"Runnable\" testcasecount=\"1\" result=\"Passed\" total=\"1\" passed=\"1\" failed=\"0\" warnings=\"0\" inconclusive=\"0\" skipped=\"0\" asserts=\"1\" engine-version=\"3.18.1.0\" clr-version=\"9.0.0\" start-time=\"2024-11-20 10:15:12Z\" end-time=\"2024-11-20 10:15:12Z\" duration=\"0.062075\">\n  <command-line><![CDATA[C:\\dev\\Playground\\NUnit\\bin\\Debug\\net9.0\\testhost.dll --port 52057 --endpoint 127.0.0.1:052057 --role client --parentprocessid 2856 --telemetryoptedin false]]></command-line>\n  <test-suite type=\"Assembly\" id=\"0-1005\" name=\"NUnitTestProj.dll\" fullname=\"C:\\dev\\Playground\\NUnit\\bin\\Debug\\net9.0\\NUnitTestProj.dll\" runstate=\"Runnable\" testcasecount=\"1\" result=\"Passed\" site=\"Child\" start-time=\"2024-11-20T10:15:12.7307782Z\" end-time=\"2024-11-20T10:15:12.7774522Z\" duration=\"0.046649\" total=\"1\" passed=\"1\" failed=\"0\" warnings=\"0\" inconclusive=\"0\" skipped=\"0\" asserts=\"1\">\n    <test-suite type=\"TestSuite\" id=\"0-1006\" name=\"NUnitTestProject\" fullname=\"NUnitTestProject\" runstate=\"Runnable\" testcasecount=\"4\" result=\"Passed\" site=\"Child\" start-time=\"2024-11-20T10:15:12.7342887Z\" end-time=\"2024-11-20T10:15:12.7774196Z\" duration=\"0.043131\" total=\"1\" passed=\"1\" failed=\"0\" warnings=\"0\" inconclusive=\"0\" skipped=\"0\" asserts=\"1\">\n      <test-suite type=\"TestFixture\" id=\"0-1000\" name=\"UnitTest1\" fullname=\"NUnitTestProject.UnitTest1\" classname=\"NUnitTestProject.UnitTest1\" runstate=\"Runnable\" testcasecount=\"1\" result=\"Passed\" site=\"Child\" start-time=\"2024-11-20T10:15:12.7350880Z\" end-time=\"2024-11-20T10:15:12.7770812Z\" duration=\"0.041994\" total=\"1\" passed=\"1\" failed=\"0\" warnings=\"0\" inconclusive=\"0\" skipped=\"0\" asserts=\"1\">\n        <test-case id=\"0-1001\" name=\"CommaInDouble\" fullname=\"NUnitTestProject.UnitTest1.CommaInDouble\" methodname=\"CommaInDouble\" classname=\"NUnitTestProject.UnitTest1\" runstate=\"Runnable\" seed=\"477349529\" result=\"Passed\" asserts=\"1\" duration=\"1,041\" />\n      </test-suite>\n    </test-suite>\n  </test-suite>\n</test-run>"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/nunit/valid_inheritance.xml",
    "content": "<test-run id=\"2\" duration=\"182.55608639999969\" testcasecount=\"2\" total=\"2\" passed=\"2\" failed=\"0\" inconclusive=\"0\" skipped=\"4\" result=\"Passed\" start-time=\"2024-12-12T12:43:02Z\" end-time=\"2024-12-12T12:46:17Z\">\n  <test-suite type=\"Assembly\" name=\"MudBlazor.UnitTests.dll\" fullname=\"C:\\dev\\trash\\MudBlazor\\src\\MudBlazor.UnitTests\\bin\\Debug\\net8.0\\MudBlazor.UnitTests.dll\" total=\"2\" passed=\"2\" failed=\"0\" inconclusive=\"0\" skipped=\"4\" result=\"Passed\" start-time=\"2024-12-12T12:43:03Z\" end-time=\"2024-12-12T12:46:16Z\" duration=\"182.5560864\">\n    <test-suite type=\"TestSuite\" name=\"MudBlazor\" fullname=\"MudBlazor\" total=\"2\" passed=\"2\" failed=\"0\" inconclusive=\"0\" skipped=\"1\" result=\"Passed\" start-time=\"2024-12-12T12:43:30Z\" end-time=\"2024-12-12T12:46:16Z\" duration=\"117.4050474\">\n      <test-suite type=\"TestSuite\" name=\"UnitTests\" fullname=\"MudBlazor.UnitTests\" total=\"2\" passed=\"2\" failed=\"0\" inconclusive=\"0\" skipped=\"1\" result=\"Passed\" start-time=\"2024-12-12T12:43:30Z\" end-time=\"2024-12-12T12:46:16Z\" duration=\"117.4050474\">\n        <test-suite type=\"TestSuite\" name=\"Utilities\" fullname=\"MudBlazor.UnitTests.Utilities\" total=\"2\" passed=\"2\" failed=\"0\" inconclusive=\"0\" skipped=\"0\" result=\"Passed\" start-time=\"2024-12-12T12:44:20Z\" end-time=\"2024-12-12T12:46:16Z\" duration=\"116.2476831\">\n          <test-suite type=\"TestSuite\" name=\"AsyncKeyedLock\" fullname=\"MudBlazor.UnitTests.Utilities.AsyncKeyedLock\" total=\"2\" passed=\"2\" failed=\"0\" inconclusive=\"0\" skipped=\"0\" result=\"Passed\" start-time=\"2024-12-12T12:44:20Z\" end-time=\"2024-12-12T12:46:10Z\" duration=\"109.9512386\">\n            <test-suite type=\"TestFixture\" name=\"AsyncKeyedLockNonPooledTests+Async\" fullname=\"MudBlazor.UnitTests.Utilities.AsyncKeyedLock.AsyncKeyedLockNonPooledTests+Async\" classname=\"MudBlazor.UnitTests.Utilities.AsyncKeyedLock.AsyncKeyedLockNonPooledTests+Async\" total=\"1\" passed=\"1\" failed=\"0\" inconclusive=\"0\" skipped=\"0\" result=\"Passed\" start-time=\"2024-12-12T12:44:22Z\" end-time=\"2024-12-12T12:44:25Z\" duration=\"3.3840677\">\n              <test-case name=\"ThreeDifferentLocksShouldWork\" fullname=\"MudBlazor.UnitTests.Utilities.AsyncKeyedLock.AsyncKeyedLockNonPooledTests+Async.ThreeDifferentLocksShouldWork\" methodname=\"ThreeDifferentLocksShouldWork\" classname=\"AsyncKeyedLockNonPooledTests+Async\" result=\"Passed\" start-time=\"2024-12-12T12:44:25Z\" end-time=\"2024-12-12T12:44:25Z\" duration=\"0.000429\" asserts=\"0\" seed=\"1098756806\" />\n            </test-suite>\n            <test-suite type=\"TestFixture\" name=\"AsyncKeyedLockNonPooledTests+Sync\" fullname=\"MudBlazor.UnitTests.Utilities.AsyncKeyedLock.AsyncKeyedLockNonPooledTests+Sync\" classname=\"MudBlazor.UnitTests.Utilities.AsyncKeyedLock.AsyncKeyedLockNonPooledTests+Sync\" total=\"1\" passed=\"1\" failed=\"0\" inconclusive=\"0\" skipped=\"0\" result=\"Passed\" start-time=\"2024-12-12T12:44:25Z\" end-time=\"2024-12-12T12:44:29Z\" duration=\"3.4550188\">\n              <test-case name=\"ThreeDifferentLocksShouldWork\" fullname=\"MudBlazor.UnitTests.Utilities.AsyncKeyedLock.AsyncKeyedLockNonPooledTests+Sync.ThreeDifferentLocksShouldWork\" methodname=\"ThreeDifferentLocksShouldWork\" classname=\"AsyncKeyedLockNonPooledTests+Sync\" result=\"Passed\" start-time=\"2024-12-12T12:44:28Z\" end-time=\"2024-12-12T12:44:28Z\" duration=\"5.3E-05\" asserts=\"0\" seed=\"1599940889\" />\n            </test-suite>\n          </test-suite>\n        </test-suite>\n      </test-suite>\n    </test-suite>\n    <errors />\n  </test-suite>\n</test-run>"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/nunit/valid_no_execution_time.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<test-run id=\"0\" name=\"NUnitTestProj.dll\" fullname=\"C:\\dev\\Playground\\NUnit\\bin\\Debug\\net9.0\\NUnitTestProj.dll\" runstate=\"Runnable\" testcasecount=\"1\" result=\"Passed\" total=\"1\" passed=\"1\" failed=\"0\" warnings=\"0\" inconclusive=\"0\" skipped=\"0\" asserts=\"1\" engine-version=\"3.18.1.0\" clr-version=\"9.0.0\" start-time=\"2024-11-20 10:15:12Z\" end-time=\"2024-11-20 10:15:12Z\" duration=\"0.062075\">\n  <command-line><![CDATA[C:\\dev\\Playground\\NUnit\\bin\\Debug\\net9.0\\testhost.dll --port 52057 --endpoint 127.0.0.1:052057 --role client --parentprocessid 2856 --telemetryoptedin false]]></command-line>\n  <test-suite type=\"Assembly\" id=\"0-1005\" name=\"NUnitTestProj.dll\" fullname=\"C:\\dev\\Playground\\NUnit\\bin\\Debug\\net9.0\\NUnitTestProj.dll\" runstate=\"Runnable\" testcasecount=\"1\" result=\"Passed\" site=\"Child\" start-time=\"2024-11-20T10:15:12.7307782Z\" end-time=\"2024-11-20T10:15:12.7774522Z\" duration=\"0.046649\" total=\"1\" passed=\"1\" failed=\"0\" warnings=\"0\" inconclusive=\"0\" skipped=\"0\" asserts=\"1\">\n    <test-suite type=\"TestSuite\" id=\"0-1006\" name=\"NUnitTestProject\" fullname=\"NUnitTestProject\" runstate=\"Runnable\" testcasecount=\"4\" result=\"Passed\" site=\"Child\" start-time=\"2024-11-20T10:15:12.7342887Z\" end-time=\"2024-11-20T10:15:12.7774196Z\" duration=\"0.043131\" total=\"1\" passed=\"1\" failed=\"0\" warnings=\"0\" inconclusive=\"0\" skipped=\"0\" asserts=\"1\">\n      <test-suite type=\"TestFixture\" id=\"0-1000\" name=\"UnitTest1\" fullname=\"NUnitTestProject.UnitTest1\" classname=\"NUnitTestProject.UnitTest1\" runstate=\"Runnable\" testcasecount=\"1\" result=\"Passed\" site=\"Child\" start-time=\"2024-11-20T10:15:12.7350880Z\" end-time=\"2024-11-20T10:15:12.7770812Z\" duration=\"0.041994\" total=\"1\" passed=\"1\" failed=\"0\" warnings=\"0\" inconclusive=\"0\" skipped=\"0\" asserts=\"1\">\n        <test-case id=\"0-1001\" name=\"NUnitTestMethod1\" fullname=\"NUnitTestProject.UnitTest1.NUnitTestMethod1\" methodname=\"NUnitTestMethod1\" classname=\"NUnitTestProject.UnitTest1\" runstate=\"Runnable\" seed=\"477349529\" result=\"Passed\" asserts=\"1\" />\n      </test-suite>\n    </test-suite>\n  </test-suite>\n</test-run>"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/nunit/valid_nunit2.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<!--This file represents the results of running a test suite-->\n<test-results name=\"\\home\\charlie\\Dev\\NUnit\\nunit-2.5\\work\\src\\bin\\Debug\\tests\\mock-assembly.dll\" total=\"21\" errors=\"1\" failures=\"1\" not-run=\"7\" inconclusive=\"1\" ignored=\"4\" skipped=\"0\" invalid=\"3\" date=\"2010-10-18\" time=\"13:23:35\">\n  <environment nunit-version=\"2.5.8.0\" clr-version=\"2.0.50727.1433\" os-version=\"Unix 2.6.32.25\" platform=\"Unix\" cwd=\"/home/charlie/Dev/NUnit/nunit-2.5/work/src/bin/Debug\" machine-name=\"cedar\" user=\"charlie\" user-domain=\"cedar\" />\n  <culture-info current-culture=\"en-US\" current-uiculture=\"en-US\" />\n  <test-suite type=\"Assembly\" name=\"\\home\\charlie\\Dev\\NUnit\\nunit-2.5\\work\\src\\bin\\Debug\\tests\\mock-assembly.dll\" executed=\"True\" result=\"Failure\" success=\"False\" time=\"0.824\" asserts=\"0\">\n    <results>\n      <test-suite type=\"Namespace\" name=\"NUnit\" executed=\"True\" result=\"Failure\" success=\"False\" time=\"0.807\" asserts=\"0\">\n        <results>\n          <test-suite type=\"Namespace\" name=\"Tests\" executed=\"True\" result=\"Failure\" success=\"False\" time=\"0.803\" asserts=\"0\">\n            <results>\n              <test-suite type=\"Namespace\" name=\"Assemblies\" executed=\"True\" result=\"Failure\" success=\"False\" time=\"0.606\" asserts=\"0\">\n                <results>\n                  <test-suite type=\"TestFixture\" name=\"MockTestFixture\" description=\"Fake Test Fixture\" executed=\"True\" result=\"Failure\" success=\"False\" time=\"0.582\" asserts=\"0\">\n                    <categories>\n                      <category name=\"FixtureCategory\" />\n                    </categories>\n                    <results>\n                      <test-case name=\"NUnit.Tests.Assemblies.MockTestFixture.FailingTest\" executed=\"True\" result=\"Failure\" success=\"False\" time=\"0.013\" asserts=\"0\">\n                        <failure>\n                          <message><![CDATA[Intentional failure]]></message>\n                          <stack-trace><![CDATA[at NUnit.Tests.Assemblies.MockTestFixture.FailingTest () [0x00000] in /home/charlie/Dev/NUnit/nunit-2.5/work/src/tests/mock-assembly/MockAssembly.cs:121]]></stack-trace>\n                        </failure>\n                      </test-case>\n                      <test-case name=\"NUnit.Tests.Assemblies.MockTestFixture.InconclusiveTest\" executed=\"True\" result=\"Inconclusive\" success=\"False\" time=\"0.001\" asserts=\"0\">\n                        <reason>\n                          <message><![CDATA[No valid data]]></message>\n                        </reason>\n                      </test-case>\n                      <test-case name=\"NUnit.Tests.Assemblies.MockTestFixture.MockTest1\" description=\"Mock Test #1\" executed=\"True\" result=\"Success\" success=\"True\" time=\"0.000\" asserts=\"0\" />\n                      <test-case name=\"NUnit.Tests.Assemblies.MockTestFixture.MockTest2\" description=\"This is a really, really, really, really, really, really, really, really, really, really, really, really, really, really, really, really, really, really, really, really, really, really, really, really, really long description\" executed=\"True\" result=\"Success\" success=\"True\" time=\"0.000\" asserts=\"0\">\n                        <categories>\n                          <category name=\"MockCategory\" />\n                        </categories>\n                        <properties>\n                          <property name=\"Severity\" value=\"Critical\" />\n                        </properties>\n                      </test-case>\n                      <test-case name=\"NUnit.Tests.Assemblies.MockTestFixture.MockTest3\" executed=\"True\" result=\"Success\" success=\"True\" time=\"0.001\" asserts=\"0\">\n                        <categories>\n                          <category name=\"AnotherCategory\" />\n                          <category name=\"MockCategory\" />\n                        </categories>\n                        <reason>\n                          <message><![CDATA[Succeeded!]]></message>\n                        </reason>\n                      </test-case>\n                      <test-case name=\"NUnit.Tests.Assemblies.MockTestFixture.MockTest4\" executed=\"False\" result=\"Ignored\">\n                        <categories>\n                          <category name=\"Foo\" />\n                        </categories>\n                        <reason>\n                          <message><![CDATA[ignoring this test method for now]]></message>\n                        </reason>\n                      </test-case>\n                      <test-case name=\"NUnit.Tests.Assemblies.MockTestFixture.MockTest5\" executed=\"False\" result=\"NotRunnable\">\n                        <reason>\n                          <message><![CDATA[Method is not public]]></message>\n                        </reason>\n                      </test-case>\n                      <test-case name=\"NUnit.Tests.Assemblies.MockTestFixture.NotRunnableTest\" executed=\"False\" result=\"NotRunnable\">\n                        <reason>\n                          <message><![CDATA[No arguments were provided]]></message>\n                        </reason>\n                      </test-case>\n                      <test-case name=\"NUnit.Tests.Assemblies.MockTestFixture.TestWithException\" executed=\"True\" result=\"Error\" success=\"False\" time=\"0.001\" asserts=\"0\">\n                        <failure>\n                          <message><![CDATA[System.ApplicationException : Intentional Exception]]></message>\n                          <stack-trace><![CDATA[at NUnit.Tests.Assemblies.MockTestFixture.TestWithException () [0x00000] in /home/charlie/Dev/NUnit/nunit-2.5/work/src/tests/mock-assembly/MockAssembly.cs:153\n]]></stack-trace>\n                        </failure>\n                      </test-case>\n                      <test-case name=\"NUnit.Tests.Assemblies.MockTestFixture.TestWithManyProperties\" executed=\"True\" result=\"Success\" success=\"True\" time=\"0.000\" asserts=\"0\">\n                        <properties>\n                          <property name=\"Size\" value=\"5\" />\n                          <property name=\"TargetMethod\" value=\"SomeClassName\" />\n                        </properties>\n                      </test-case>\n                    </results>\n                  </test-suite>\n                </results>\n              </test-suite>\n              <test-suite type=\"TestFixture\" name=\"BadFixture\" executed=\"False\" result=\"NotRunnable\">\n                <reason>\n                  <message><![CDATA[No suitable constructor was found]]></message>\n                </reason>\n                <results>\n                  <test-case name=\"NUnit.Tests.BadFixture.SomeTest\" executed=\"False\" result=\"NotRunnable\">\n                    <reason>\n                      <message><![CDATA[No suitable constructor was found]]></message>\n                    </reason>\n                  </test-case>\n                </results>\n              </test-suite>\n              <test-suite type=\"TestFixture\" name=\"FixtureWithTestCases\" executed=\"True\" result=\"Success\" success=\"True\" time=\"0.043\" asserts=\"0\">\n                <results>\n                  <test-suite type=\"ParameterizedTest\" name=\"GenericMethod\" executed=\"True\" result=\"Success\" success=\"True\" time=\"0.013\" asserts=\"0\">\n                    <results>\n                      <test-case name=\"NUnit.Tests.FixtureWithTestCases.GenericMethod&lt;Double&gt;(9.2d,11.7d)\" executed=\"True\" result=\"Success\" success=\"True\" time=\"0.007\" asserts=\"1\" />\n                      <test-case name=\"NUnit.Tests.FixtureWithTestCases.GenericMethod&lt;Int32&gt;(2,4)\" executed=\"True\" result=\"Success\" success=\"True\" time=\"0.001\" asserts=\"1\" />\n                    </results>\n                  </test-suite>\n                  <test-suite type=\"ParameterizedTest\" name=\"MethodWithParameters\" executed=\"True\" result=\"Success\" success=\"True\" time=\"0.011\" asserts=\"0\">\n                    <results>\n                      <test-case name=\"NUnit.Tests.FixtureWithTestCases.MethodWithParameters(9,11)\" executed=\"True\" result=\"Success\" success=\"True\" time=\"0.003\" asserts=\"1\" />\n                      <test-case name=\"NUnit.Tests.FixtureWithTestCases.MethodWithParameters(2,2)\" executed=\"True\" result=\"Success\" success=\"True\" time=\"0.000\" asserts=\"1\" />\n                    </results>\n                  </test-suite>\n                </results>\n              </test-suite>\n              <test-suite type=\"GenericFixture\" name=\"GenericFixture&lt;T&gt;\" executed=\"True\" result=\"Success\" success=\"True\" time=\"0.012\" asserts=\"0\">\n                <results>\n                  <test-suite type=\"TestFixture\" name=\"GenericFixture&lt;Double&gt;(11.5d)\" executed=\"True\" result=\"Success\" success=\"True\" time=\"0.011\" asserts=\"0\">\n                    <results>\n                      <test-case name=\"NUnit.Tests.GenericFixture&lt;Double&gt;(11.5d).Test1\" executed=\"True\" result=\"Success\" success=\"True\" time=\"0.000\" asserts=\"0\" />\n                      <test-case name=\"NUnit.Tests.GenericFixture&lt;Double&gt;(11.5d).Test2\" executed=\"True\" result=\"Success\" success=\"True\" time=\"0.000\" asserts=\"0\" />\n                    </results>\n                  </test-suite>\n                  <test-suite type=\"TestFixture\" name=\"GenericFixture&lt;Int32&gt;(5)\" executed=\"True\" result=\"Success\" success=\"True\" time=\"0.001\" asserts=\"0\">\n                    <results>\n                      <test-case name=\"NUnit.Tests.GenericFixture&lt;Int32&gt;(5).Test1\" executed=\"True\" result=\"Success\" success=\"True\" time=\"0.000\" asserts=\"0\" />\n                      <test-case name=\"NUnit.Tests.GenericFixture&lt;Int32&gt;(5).Test2\" executed=\"True\" result=\"Success\" success=\"True\" time=\"0.000\" asserts=\"0\" />\n                    </results>\n                  </test-suite>\n                </results>\n              </test-suite>\n              <test-suite type=\"TestFixture\" name=\"IgnoredFixture\" executed=\"False\" result=\"Ignored\">\n                <reason>\n                  <message><![CDATA[]]></message>\n                </reason>\n                <results>\n                  <test-case name=\"NUnit.Tests.IgnoredFixture.Test1\" executed=\"False\" result=\"Ignored\">\n                    <reason>\n                      <message><![CDATA[]]></message>\n                    </reason>\n                  </test-case>\n                  <test-case name=\"NUnit.Tests.IgnoredFixture.Test2\" executed=\"False\" result=\"Ignored\">\n                    <reason>\n                      <message><![CDATA[]]></message>\n                    </reason>\n                  </test-case>\n                  <test-case name=\"NUnit.Tests.IgnoredFixture.Test3\" executed=\"False\" result=\"Ignored\">\n                    <reason>\n                      <message><![CDATA[]]></message>\n                    </reason>\n                  </test-case>\n                </results>\n              </test-suite>\n              <test-suite type=\"ParameterizedFixture\" name=\"ParameterizedFixture\" executed=\"True\" result=\"Success\" success=\"True\" time=\"0.069\" asserts=\"0\">\n                <results>\n                  <test-suite type=\"TestFixture\" name=\"ParameterizedFixture(42)\" executed=\"True\" result=\"Success\" success=\"True\" time=\"0.048\" asserts=\"0\">\n                    <results>\n                      <test-case name=\"NUnit.Tests.ParameterizedFixture(42).Test1\" executed=\"True\" result=\"Success\" success=\"True\" time=\"0.000\" asserts=\"0\" />\n                      <test-case name=\"NUnit.Tests.ParameterizedFixture(42).Test2\" executed=\"True\" result=\"Success\" success=\"True\" time=\"0.000\" asserts=\"0\" />\n                    </results>\n                  </test-suite>\n                  <test-suite type=\"TestFixture\" name=\"ParameterizedFixture(5)\" executed=\"True\" result=\"Success\" success=\"True\" time=\"0.007\" asserts=\"0\">\n                    <results>\n                      <test-case name=\"NUnit.Tests.ParameterizedFixture(5).Test1\" executed=\"True\" result=\"Success\" success=\"True\" time=\"0.000\" asserts=\"0\" />\n                      <test-case name=\"NUnit.Tests.ParameterizedFixture(5).Test2\" executed=\"True\" result=\"Success\" success=\"True\" time=\"0.000\" asserts=\"0\" />\n                    </results>\n                  </test-suite>\n                </results>\n              </test-suite>\n              <test-suite type=\"Namespace\" name=\"Singletons\" executed=\"True\" result=\"Success\" success=\"True\" time=\"0.005\" asserts=\"0\">\n                <results>\n                  <test-suite type=\"TestFixture\" name=\"OneTestCase\" executed=\"True\" result=\"Success\" success=\"True\" time=\"0.001\" asserts=\"0\">\n                    <results>\n                      <test-case name=\"NUnit.Tests.Singletons.OneTestCase.TestCase\" executed=\"True\" result=\"Success\" success=\"True\" time=\"0.000\" asserts=\"0\" />\n                    </results>\n                  </test-suite>\n                </results>\n              </test-suite>\n              <test-suite type=\"Namespace\" name=\"TestAssembly\" executed=\"True\" result=\"Success\" success=\"True\" time=\"0.005\" asserts=\"0\">\n                <results>\n                  <test-suite type=\"TestFixture\" name=\"MockTestFixture\" executed=\"True\" result=\"Success\" success=\"True\" time=\"0.001\" asserts=\"0\">\n                    <results>\n                      <test-case name=\"NUnit.Tests.TestAssembly.MockTestFixture.MyTest\" executed=\"True\" result=\"Success\" success=\"True\" time=\"0.000\" asserts=\"0\" />\n                    </results>\n                  </test-suite>\n                </results>\n              </test-suite>\n            </results>\n          </test-suite>\n        </results>\n      </test-suite>\n    </results>\n  </test-suite>\n</test-results>"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/nunit/valid_nunit3.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<test-run id=\"0\" name=\"NUnitTestProj.dll\" fullname=\"C:\\dev\\Playground\\NUnit\\bin\\Debug\\net9.0\\NUnitTestProj.dll\" runstate=\"Runnable\" testcasecount=\"4\" result=\"Failed\" total=\"4\" passed=\"1\" failed=\"2\" warnings=\"0\" inconclusive=\"0\" skipped=\"1\" asserts=\"2\" engine-version=\"3.18.1.0\" clr-version=\"9.0.0\" start-time=\"2024-11-20 10:15:12Z\" end-time=\"2024-11-20 10:15:12Z\" duration=\"0.062075\">\n  <command-line><![CDATA[C:\\dev\\Playground\\NUnit\\bin\\Debug\\net9.0\\testhost.dll --port 52057 --endpoint 127.0.0.1:052057 --role client --parentprocessid 2856 --telemetryoptedin false]]></command-line>\n  <test-suite type=\"Assembly\" id=\"0-1005\" name=\"NUnitTestProj.dll\" fullname=\"C:\\dev\\Playground\\NUnit\\bin\\Debug\\net9.0\\NUnitTestProj.dll\" runstate=\"Runnable\" testcasecount=\"4\" result=\"Failed\" site=\"Child\" start-time=\"2024-11-20T10:15:12.7307782Z\" end-time=\"2024-11-20T10:15:12.7774522Z\" duration=\"0.046649\" total=\"4\" passed=\"1\" failed=\"2\" warnings=\"0\" inconclusive=\"0\" skipped=\"1\" asserts=\"2\">\n    <environment framework-version=\"4.2.2.0\" clr-version=\"9.0.0\" os-version=\"Microsoft Windows 10.0.19045\" platform=\"Win32NT\" cwd=\"C:\\dev\\Playground\\NUnit\\bin\\Debug\\net9.0\" machine-name=\"PC-L0109\" user=\"alexander.meseldzija\" user-domain=\"PC-L0109\" culture=\"en-AU\" uiculture=\"en-GB\" os-architecture=\"x64\" />\n    <settings>\n      <setting name=\"SynchronousEvents\" value=\"False\" />\n      <setting name=\"InternalTraceLevel\" value=\"Off\" />\n      <setting name=\"RandomSeed\" value=\"501998260\" />\n      <setting name=\"SkipNonTestAssemblies\" value=\"True\" />\n      <setting name=\"ProcessModel\" value=\"InProcess\" />\n      <setting name=\"DomainUsage\" value=\"Single\" />\n      <setting name=\"DefaultTestNamePattern\" value=\"{m}{a}\" />\n      <setting name=\"WorkDirectory\" value=\"C:\\dev\\Playground\\NUnit\\bin\\Debug\\net9.0\" />\n      <setting name=\"NumberOfTestWorkers\" value=\"16\" />\n    </settings>\n    <properties>\n      <property name=\"_PID\" value=\"57560\" />\n      <property name=\"_APPDOMAIN\" value=\"testhost\" />\n    </properties>\n    <failure>\n      <message><![CDATA[One or more child tests had errors]]></message>\n    </failure>\n    <test-suite type=\"TestSuite\" id=\"0-1006\" name=\"NUnitTestProject\" fullname=\"NUnitTestProject\" runstate=\"Runnable\" testcasecount=\"4\" result=\"Failed\" site=\"Child\" start-time=\"2024-11-20T10:15:12.7342887Z\" end-time=\"2024-11-20T10:15:12.7774196Z\" duration=\"0.043131\" total=\"4\" passed=\"1\" failed=\"2\" warnings=\"0\" inconclusive=\"0\" skipped=\"1\" asserts=\"2\">\n      <failure>\n        <message><![CDATA[One or more child tests had errors]]></message>\n      </failure>\n      <test-suite type=\"TestFixture\" id=\"0-1000\" name=\"UnitTest1\" fullname=\"NUnitTestProject.UnitTest1\" classname=\"NUnitTestProject.UnitTest1\" runstate=\"Runnable\" testcasecount=\"4\" result=\"Failed\" site=\"Child\" start-time=\"2024-11-20T10:15:12.7350880Z\" end-time=\"2024-11-20T10:15:12.7770812Z\" duration=\"0.041994\" total=\"4\" passed=\"1\" failed=\"2\" warnings=\"0\" inconclusive=\"0\" skipped=\"1\" asserts=\"2\">\n        <failure>\n          <message><![CDATA[One or more child tests had errors]]></message>\n        </failure>\n        <test-case id=\"0-1001\" name=\"NUnitTestMethod1\" fullname=\"NUnitTestProject.UnitTest1.NUnitTestMethod1\" methodname=\"NUnitTestMethod1\" classname=\"NUnitTestProject.UnitTest1\" runstate=\"Runnable\" seed=\"477349529\" result=\"Passed\" start-time=\"2024-11-20T10:15:12.7368699Z\" end-time=\"2024-11-20T10:15:12.7450597Z\" duration=\"0.008230\" asserts=\"1\" />\n        <test-case id=\"0-1004\" name=\"NUnitTestShouldError\" fullname=\"NUnitTestProject.UnitTest1.NUnitTestShouldError\" methodname=\"NUnitTestShouldError\" classname=\"NUnitTestProject.UnitTest1\" runstate=\"Runnable\" seed=\"393620580\" result=\"Failed\" label=\"Error\" start-time=\"2024-11-20T10:15:12.7459177Z\" end-time=\"2024-11-20T10:15:12.7520320Z\" duration=\"0.006114\" asserts=\"0\">\n          <failure>\n            <message><![CDATA[System.Exception : This is an error]]></message>\n            <stack-trace><![CDATA[   at NUnitTestProject.UnitTest1.NUnitTestShouldError() in C:\\dev\\Playground\\NUnit\\UnitTest1.cs:line 28\n   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)\n   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)]]></stack-trace>\n          </failure>\n        </test-case>\n        <test-case id=\"0-1002\" name=\"NUnitTestShouldFail\" fullname=\"NUnitTestProject.UnitTest1.NUnitTestShouldFail\" methodname=\"NUnitTestShouldFail\" classname=\"NUnitTestProject.UnitTest1\" runstate=\"Runnable\" seed=\"1704830536\" result=\"Failed\" label=\"HelloThere\" start-time=\"2024-11-20T10:15:12.7521135Z\" end-time=\"2024-11-20T10:15:12.7754970Z\" duration=\"0.023384\" asserts=\"1\">\n          <failure>\n            <message><![CDATA[  Assert.That(false, Is.True)\n  Expected: True\n  But was:  False\n]]></message>\n            <stack-trace><![CDATA[   at NUnitTestProject.UnitTest1.NUnitTestShouldFail() in C:\\dev\\Playground\\NUnit\\UnitTest1.cs:line 15\n]]></stack-trace>\n          </failure>\n          <assertions>\n            <assertion result=\"Failed\">\n              <message><![CDATA[  Assert.That(false, Is.True)\n  Expected: True\n  But was:  False\n]]></message>\n              <stack-trace><![CDATA[   at NUnitTestProject.UnitTest1.NUnitTestShouldFail() in C:\\dev\\Playground\\NUnit\\UnitTest1.cs:line 15\n]]></stack-trace>\n            </assertion>\n          </assertions>\n        </test-case>\n        <test-case id=\"0-1003\" name=\"NUnitTestShouldSkip\" fullname=\"NUnitTestProject.UnitTest1.NUnitTestShouldSkip\" methodname=\"NUnitTestShouldSkip\" classname=\"NUnitTestProject.UnitTest1\" runstate=\"Ignored\" seed=\"2144882532\" result=\"Skipped\" label=\"Ignored\" start-time=\"2024-11-20T10:15:12.7755442Z\" end-time=\"2024-11-20T10:15:12.7758202Z\" duration=\"0.000276\" asserts=\"0\">\n          <properties>\n            <property name=\"_SKIPREASON\" value=\"I said so\" />\n          </properties>\n          <reason>\n            <message><![CDATA[I said so]]></message>\n          </reason>\n        </test-case>\n      </test-suite>\n    </test-suite>\n  </test-suite>\n    <test-suite type=\"Assembly\" id=\"1036\" name=\"mock-assembly.dll\" fullname=\"D:\\Dev\\NUnit\\nunit-3.0\\work\\bin\\vs2008\\Debug\\mock-assembly.dll\" testcasecount=\"25\" result=\"Failed\" time=\"0.154\" total=\"18\" passed=\"12\" failed=\"2\" inconclusive=\"1\" skipped=\"3\" asserts=\"2\">\n    <properties>\n      <property name=\"_PID\" value=\"11928\" />\n      <property name=\"_APPDOMAIN\" value=\"test-domain-mock-assembly.dll\" />\n    </properties>\n    <failure>\n      <message><![CDATA[Child test failed]]></message>\n    </failure>\n    <test-suite type=\"TestFixture\" id=\"1000\" name=\"MockTestFixture\" fullname=\"NUnit.Tests.Assemblies.MockTestFixture\" testcasecount=\"11\" result=\"Failed\" time=\"0.119\" total=\"10\" passed=\"4\" failed=\"2\" inconclusive=\"1\" skipped=\"3\" asserts=\"0\">\n      <properties>\n        <property name=\"Category\" value=\"FixtureCategory\" />\n        <property name=\"Description\" value=\"Fake Test Fixture\" />\n      </properties>\n      <failure>\n        <message><![CDATA[Child test failed]]></message>\n      </failure>\n      <test-case id=\"1005\" name=\"FailingTest\" fullname=\"NUnit.Tests.Assemblies.MockTestFixture.FailingTest\" result=\"Failed\" time=\"0.023\" asserts=\"0\">\n        <failure>\n          <message><![CDATA[Intentional failure]]></message>\n          <stack-trace><![CDATA[   at NUnit.Framework.Assert.Fail(String message, Object[] args) in D:\\Dev\\NUnit\\nunit-3.0\\work\\NUnitFramework\\src\\framework\\Assert.cs:line 142\n   at NUnit.Framework.Assert.Fail(String message) in D:\\Dev\\NUnit\\nunit-3.0\\work\\NUnitFramework\\src\\framework\\Assert.cs:line 152\n   at NUnit.Tests.Assemblies.MockTestFixture.FailingTest() in D:\\Dev\\NUnit\\nunit-3.0\\work\\NUnitFramework\\src\\mock-assembly\\MockAssembly.cs:line 121]]></stack-trace>\n        </failure>\n      </test-case>\n      <test-case id=\"1010\" name=\"InconclusiveTest\" fullname=\"NUnit.Tests.Assemblies.MockTestFixture.InconclusiveTest\" result=\"Inconclusive\" time=\"0.001\" asserts=\"0\" />\n      <test-case id=\"1001\" name=\"MockTest1\" fullname=\"NUnit.Tests.Assemblies.MockTestFixture.MockTest1\" result=\"Passed\" time=\"0.000\" asserts=\"0\">\n        <properties>\n          <property name=\"Description\" value=\"Mock Test #1\" />\n        </properties>\n      </test-case>\n      <test-case id=\"1002\" name=\"MockTest2\" fullname=\"NUnit.Tests.Assemblies.MockTestFixture.MockTest2\" result=\"Passed\" time=\"0.000\" asserts=\"0\">\n        <properties>\n          <property name=\"Severity\" value=\"Critical\" />\n          <property name=\"Description\" value=\"This is a really, really, really, really, really, really, really, really, really, really, really, really, really, really, really, really, really, really, really, really, really, really, really, really, really long description\" />\n          <property name=\"Category\" value=\"MockCategory\" />\n        </properties>\n      </test-case>\n      <test-case id=\"1003\" name=\"MockTest3\" fullname=\"NUnit.Tests.Assemblies.MockTestFixture.MockTest3\" result=\"Passed\" time=\"0.000\" asserts=\"0\">\n        <properties>\n          <property name=\"Category\" value=\"AnotherCategory\" />\n          <property name=\"Category\" value=\"MockCategory\" />\n        </properties>\n      </test-case>\n      <test-case id=\"1007\" name=\"MockTest4\" fullname=\"NUnit.Tests.Assemblies.MockTestFixture.MockTest4\" result=\"Skipped\" label=\"Ignored\" time=\"0.000\" asserts=\"0\">\n        <properties>\n          <property name=\"Category\" value=\"Foo\" />\n          <property name=\"_SKIPREASON\" value=\"ignoring this test method for now\" />\n        </properties>\n        <reason>\n          <message><![CDATA[ignoring this test method for now]]></message>\n        </reason>\n      </test-case>\n      <test-case id=\"1004\" name=\"MockTest5\" fullname=\"NUnit.Tests.Assemblies.MockTestFixture.MockTest5\" result=\"Skipped\" label=\"Invalid\" time=\"0.000\" asserts=\"0\">\n        <properties>\n          <property name=\"_SKIPREASON\" value=\"Method is not public\" />\n        </properties>\n        <reason>\n          <message><![CDATA[Method is not public]]></message>\n        </reason>\n      </test-case>\n      <test-case id=\"1009\" name=\"NotRunnableTest\" fullname=\"NUnit.Tests.Assemblies.MockTestFixture.NotRunnableTest\" result=\"Skipped\" label=\"Invalid\" time=\"0.000\" asserts=\"0\">\n        <properties>\n          <property name=\"_SKIPREASON\" value=\"No arguments were provided\" />\n        </properties>\n        <reason>\n          <message><![CDATA[No arguments were provided]]></message>\n        </reason>\n      </test-case>\n      <test-case id=\"1011\" name=\"TestWithException\" fullname=\"NUnit.Tests.Assemblies.MockTestFixture.TestWithException\" result=\"Failed\" label=\"Error\" time=\"0.002\" asserts=\"0\">\n        <failure>\n          <message><![CDATA[System.ApplicationException : Intentional Exception]]></message>\n          <stack-trace><![CDATA[   at NUnit.Tests.Assemblies.MockTestFixture.MethodThrowsException() in D:\\Dev\\NUnit\\nunit-3.0\\work\\NUnitFramework\\src\\mock-assembly\\MockAssembly.cs:line 158\n   at NUnit.Tests.Assemblies.MockTestFixture.TestWithException() in D:\\Dev\\NUnit\\nunit-3.0\\work\\NUnitFramework\\src\\mock-assembly\\MockAssembly.cs:line 153]]></stack-trace>\n        </failure>\n      </test-case>\n      <test-case id=\"1006\" name=\"TestWithManyProperties\" fullname=\"NUnit.Tests.Assemblies.MockTestFixture.TestWithManyProperties\" result=\"Passed\" time=\"0.000\" asserts=\"0\">\n        <properties>\n          <property name=\"TargetMethod\" value=\"SomeClassName\" />\n          <property name=\"Size\" value=\"5\" />\n        </properties>\n      </test-case>\n    </test-suite>\n    <test-suite type=\"TestFixture\" id=\"1023\" name=\"BadFixture\" fullname=\"NUnit.Tests.BadFixture\" testcasecount=\"1\" result=\"Skipped\" label=\"Invalid\" time=\"0.000\" total=\"0\" passed=\"0\" failed=\"0\" inconclusive=\"0\" skipped=\"0\" asserts=\"0\">\n      <properties>\n        <property name=\"_SKIPREASON\" value=\"No suitable constructor was found\" />\n      </properties>\n      <reason>\n        <message><![CDATA[No suitable constructor was found]]></message>\n      </reason>\n    </test-suite>\n    <test-suite type=\"TestFixture\" id=\"1025\" name=\"FixtureWithTestCases\" fullname=\"NUnit.Tests.FixtureWithTestCases\" testcasecount=\"2\" result=\"Passed\" time=\"0.010\" total=\"2\" passed=\"2\" failed=\"0\" inconclusive=\"0\" skipped=\"0\" asserts=\"2\">\n      <test-suite type=\"ParameterizedMethod\" id=\"1026\" name=\"MethodWithParameters\" fullname=\"NUnit.Tests.FixtureWithTestCases.MethodWithParameters\" testcasecount=\"2\" result=\"Passed\" time=\"0.009\" total=\"2\" passed=\"2\" failed=\"0\" inconclusive=\"0\" skipped=\"0\" asserts=\"2\">\n        <test-case id=\"1027\" name=\"MethodWithParameters(2,2)\" fullname=\"NUnit.Tests.FixtureWithTestCases.MethodWithParameters(2,2)\" result=\"Passed\" time=\"0.006\" asserts=\"1\" />\n        <test-case id=\"1028\" name=\"MethodWithParameters(9,11)\" fullname=\"NUnit.Tests.FixtureWithTestCases.MethodWithParameters(9,11)\" result=\"Passed\" time=\"0.000\" asserts=\"1\" />\n      </test-suite>\n    </test-suite>\n    <test-suite type=\"TestFixture\" id=\"1016\" name=\"IgnoredFixture\" fullname=\"NUnit.Tests.IgnoredFixture\" testcasecount=\"3\" result=\"Skipped\" label=\"Ignored\" time=\"0.000\" total=\"0\" passed=\"0\" failed=\"0\" inconclusive=\"0\" skipped=\"0\" asserts=\"0\">\n      <properties>\n        <property name=\"_SKIPREASON\" value=\"\" />\n      </properties>\n      <reason>\n        <message><![CDATA[]]></message>\n      </reason>\n    </test-suite>\n    <test-suite type=\"ParameterizedFixture\" id=\"1029\" name=\"ParameterizedFixture\" fullname=\"NUnit.Tests.ParameterizedFixture\" testcasecount=\"4\" result=\"Passed\" time=\"0.007\" total=\"4\" passed=\"4\" failed=\"0\" inconclusive=\"0\" skipped=\"0\" asserts=\"0\">\n      <test-suite type=\"TestFixture\" id=\"1030\" name=\"ParameterizedFixture(42)\" fullname=\"NUnit.Tests.ParameterizedFixture(42)\" testcasecount=\"2\" result=\"Passed\" time=\"0.003\" total=\"2\" passed=\"2\" failed=\"0\" inconclusive=\"0\" skipped=\"0\" asserts=\"0\">\n        <test-case id=\"1031\" name=\"Test1\" fullname=\"NUnit.Tests.ParameterizedFixture(42).Test1\" result=\"Passed\" time=\"0.000\" asserts=\"0\" />\n        <test-case id=\"1032\" name=\"Test2\" fullname=\"NUnit.Tests.ParameterizedFixture(42).Test2\" result=\"Passed\" time=\"0.000\" asserts=\"0\" />\n      </test-suite>\n      <test-suite type=\"TestFixture\" id=\"1033\" name=\"ParameterizedFixture(5)\" fullname=\"NUnit.Tests.ParameterizedFixture(5)\" testcasecount=\"2\" result=\"Passed\" time=\"0.002\" total=\"2\" passed=\"2\" failed=\"0\" inconclusive=\"0\" skipped=\"0\" asserts=\"0\">\n        <test-case id=\"1034\" name=\"Test1\" fullname=\"NUnit.Tests.ParameterizedFixture(5).Test1\" result=\"Passed\" time=\"0.000\" asserts=\"0\" />\n        <test-case id=\"1035\" name=\"Test2\" fullname=\"NUnit.Tests.ParameterizedFixture(5).Test2\" result=\"Passed\" time=\"0.000\" asserts=\"0\" />\n      </test-suite>\n    </test-suite>\n    <test-suite type=\"TestFixture\" id=\"1012\" name=\"OneTestCase\" fullname=\"NUnit.Tests.Singletons.OneTestCase\" testcasecount=\"1\" result=\"Passed\" time=\"0.001\" total=\"1\" passed=\"1\" failed=\"0\" inconclusive=\"0\" skipped=\"0\" asserts=\"0\">\n      <test-case id=\"1013\" name=\"TestCase\" fullname=\"NUnit.Tests.Singletons.OneTestCase.TestCase\" result=\"Passed\" time=\"0.000\" asserts=\"0\" />\n    </test-suite>\n    <test-suite type=\"TestFixture\" id=\"1014\" name=\"MockTestFixture\" fullname=\"NUnit.Tests.TestAssembly.MockTestFixture\" testcasecount=\"1\" result=\"Passed\" time=\"0.001\" total=\"1\" passed=\"1\" failed=\"0\" inconclusive=\"0\" skipped=\"0\" asserts=\"0\">\n      <test-case id=\"1015\" name=\"MyTest\" fullname=\"NUnit.Tests.TestAssembly.MockTestFixture.MyTest\" result=\"Passed\" time=\"0.001\" asserts=\"0\" />\n    </test-suite>\n  </test-suite>\n</test-run>"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/opencover/code_tested_by_multiple_projects.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\nBelow is the code for which this coverage file has been created,\ntogether with the commands to generate the file and the tools versions.\n\nNote: the file paths were manually changed inside the report to be relative.\n________________________________________________________\nnamespace Code\n{\n    public class ValueProvider\n    {\n        public int GetValue(bool condition) => condition\n            ? 1\n            : 2;\n    }\n}\n________________________________________________________\nusing Code;\nusing NUnit.Framework;\n\nnamespace FirstTestSuite\n{\n    public class ValueProviderTests\n    {\n        [Test]\n        public void Test1()\n        {\n            Assert.That(new ValueProvider().GetValue(false), Is.EqualTo(2));\n        }\n    }\n}\n________________________________________________________\nusing Code;\nusing NUnit.Framework;\n\nnamespace SecondTestSuite\n{\n    public class Tests\n    {\n        [Test]\n        public void Test1()\n        {\n            Assert.That(new ValueProvider().GetValue(true), Is.EqualTo(1));\n        }\n    }\n}\n-->\n<CoverageSession xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" Version=\"4.7.922.0\">\n    <Summary numSequencePoints=\"2\" visitedSequencePoints=\"2\" numBranchPoints=\"6\" visitedBranchPoints=\"4\" sequenceCoverage=\"100\" branchCoverage=\"66.67\" maxCyclomaticComplexity=\"3\" minCyclomaticComplexity=\"1\" maxCrapScore=\"3\" minCrapScore=\"2\" visitedClasses=\"2\" numClasses=\"2\" visitedMethods=\"2\" numMethods=\"2\" />\n    <Modules>\n        <Module skippedDueTo=\"Filter\" hash=\"19-DB-E7-26-74-3E-B8-3C-B9-3E-89-49-9F-20-99-D9-CF-23-FD-17\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.CoreLib.dll</ModulePath>\n            <ModuleTime>2020-02-18T20:16:14Z</ModuleTime>\n            <ModuleName>System.Private.CoreLib</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5C-D3-E5-60-AC-A8-D6-45-77-6C-59-CA-FE-F1-49-32-B4-41-29-2D\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\dotnet.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:30Z</ModuleTime>\n            <ModuleName>dotnet</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"45-AE-FF-2D-9F-D9-14-AE-5E-58-BC-AD-59-3F-6B-E0-C7-F9-45-CA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Runtime</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D2-6E-C4-85-DC-1F-C3-EB-0C-2E-07-EA-F9-33-C9-A6-25-57-E7-D6\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.DotNet.Cli.Utils.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:38Z</ModuleTime>\n            <ModuleName>Microsoft.DotNet.Cli.Utils</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B8-01-4B-08-49-01-14-1F-52-C1-06-1B-E1-C4-DA-8C-8C-15-88-14\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"3D-ED-2E-29-0D-BD-86-B5-75-96-FF-B0-C8-9D-AD-4E-5B-94-58-57\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Loader.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Loader</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"1E-D4-CD-15-2C-94-E4-C6-19-88-4A-EC-70-23-9C-38-12-8A-35-87\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.DotNet.PlatformAbstractions.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:38Z</ModuleTime>\n            <ModuleName>Microsoft.DotNet.PlatformAbstractions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-0A-47-0B-10-27-7A-98-D6-A5-5B-EC-1C-35-91-93-AB-C0-35-65\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\netstandard.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>netstandard</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"26-14-D7-B5-EB-43-C2-76-01-4F-01-5E-7B-A4-CE-E9-EB-E3-AA-B9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.InteropServices.RuntimeInformation.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices.RuntimeInformation</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A6-81-2A-5B-4A-3D-C8-4D-49-04-DE-1F-DF-02-7C-B4-43-51-DE-1C\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.FileSystem.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.IO.FileSystem</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B9-08-B2-09-3C-61-2C-3E-62-03-05-65-93-6A-84-E5-2C-0D-A7-F4\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.InteropServices.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"AF-4F-3B-E9-D2-80-A0-2E-91-5B-AF-17-34-A9-F1-A6-32-C4-EC-4E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Memory.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Memory</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9C-68-F9-D9-5D-09-7B-AC-36-D7-6D-25-3D-17-F3-72-E5-1A-87-F0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:06Z</ModuleTime>\n            <ModuleName>System.Threading</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"BF-BC-9F-90-71-42-03-E3-AC-AA-D2-39-9E-84-5C-00-62-70-39-BA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Encoding.CodePages.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:46Z</ModuleTime>\n            <ModuleName>System.Text.Encoding.CodePages</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8B-E9-5A-2E-CC-DB-5C-E1-03-05-BA-E1-31-A9-9D-6F-18-10-50-AA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Collections</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8F-A1-95-7C-65-A0-95-11-53-8D-DF-11-6D-3C-AD-5D-AE-2F-D3-73\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Concurrent.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>System.Collections.Concurrent</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A3-6E-3F-5C-23-E9-CE-D4-59-A4-79-82-3A-A2-A6-D2-A6-37-0E-C2\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Thread.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.Thread</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"38-09-CE-F2-E5-95-B5-A8-49-DB-F2-B2-FC-2A-62-56-4F-D2-91-39\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.DotNet.Configurer.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:38Z</ModuleTime>\n            <ModuleName>Microsoft.DotNet.Configurer</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"92-1F-FF-56-13-04-47-E6-38-08-43-E5-EA-24-FA-0D-43-16-F9-E2\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.DotNet.Cli.CommandLine.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:42Z</ModuleTime>\n            <ModuleName>Microsoft.DotNet.Cli.CommandLine</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4D-33-53-11-50-36-83-92-2B-29-8C-5A-FA-19-EF-5A-D4-AA-32-80\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Process.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:38Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Process</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A6-34-21-D2-ED-90-2B-0C-6B-31-85-04-D0-F6-D6-13-31-C9-61-F8\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.DotNet.InternalAbstractions.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:40Z</ModuleTime>\n            <ModuleName>Microsoft.DotNet.InternalAbstractions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"33-87-51-E6-2F-8C-BE-1D-5B-B2-9E-51-10-1B-05-40-2C-E3-E8-1A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Linq.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:40Z</ModuleTime>\n            <ModuleName>System.Linq</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"43-64-EE-FB-2B-CB-04-44-D6-D5-68-E6-00-03-CA-34-D9-9A-35-C6\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Frameworks.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Frameworks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"32-5D-5E-82-60-49-7F-5D-44-D4-1E-BF-57-95-6F-D8-30-A6-C2-E1\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Console.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n            <ModuleName>System.Console</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4E-96-5A-FC-C0-BE-6F-D4-A5-9C-B4-F8-33-D5-85-D1-B9-07-9F-89\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Encoding.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Text.Encoding.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F0-C5-75-3F-22-17-B9-2C-E6-C3-3C-A7-4D-EE-AF-C8-FF-35-92-AC\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.CompilerServices.Unsafe.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Runtime.CompilerServices.Unsafe</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"DD-89-83-66-26-E0-B9-BF-DD-51-53-00-1B-5A-80-96-5A-0A-01-79\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.ApplicationInsights.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:02Z</ModuleTime>\n            <ModuleName>Microsoft.ApplicationInsights</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-F9-21-BB-3C-07-A4-DA-5A-43-89-51-EB-E0-A4-B9-2F-19-F6-7D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.Algorithms.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Algorithms</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"CE-43-2B-40-C0-FF-2C-68-D3-CF-AF-49-07-37-DC-D7-AA-AB-17-F3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Buffers.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:26Z</ModuleTime>\n            <ModuleName>System.Buffers</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"55-8E-C2-A5-09-4D-3F-8C-11-59-AB-41-D5-05-B5-7B-8D-3A-AA-6E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D5-0A-67-87-14-54-BA-3A-F2-2A-2A-B8-15-CE-D1-74-51-44-E5-FC\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Uri.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:26Z</ModuleTime>\n            <ModuleName>System.Private.Uri</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"AB-8D-BE-78-8D-87-D4-81-9F-34-C0-7E-08-39-0F-DB-91-CE-92-49\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.TemplateEngine.Cli.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:46Z</ModuleTime>\n            <ModuleName>Microsoft.TemplateEngine.Cli</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"70-58-B8-D8-D1-66-CB-C6-C4-F9-5F-80-03-7C-74-A2-D8-CA-6A-98\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Reflection.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"57-E8-B3-F8-DB-88-F2-FB-81-BE-34-C3-AD-1E-D4-F0-DD-F0-59-D3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Resources.ResourceManager.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Resources.ResourceManager</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-4C-1D-C3-E8-DB-38-EA-0D-64-CB-BD-58-BC-F2-B0-E2-99-42-93\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Reflection</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4B-5A-EC-05-10-C3-65-A3-7C-C5-D4-52-0E-41-A4-1F-73-88-F9-01\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.XDocument.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Xml.XDocument</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"68-1D-85-11-BD-EC-60-7F-F2-E8-83-FF-C6-D8-D9-CB-28-C8-8B-2A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Xml.Linq.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:30Z</ModuleTime>\n            <ModuleName>System.Private.Xml.Linq</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"23-F9-09-16-3B-71-58-F5-A7-35-CA-89-4D-75-0F-3D-D0-23-DC-EB\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Tasks.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Threading.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"1F-BD-6F-06-01-11-FA-A9-DB-0B-12-95-1E-A0-B6-62-C2-59-ED-05\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Xml.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:38Z</ModuleTime>\n            <ModuleName>System.Private.Xml</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9D-C0-19-0D-B9-0B-71-00-FA-44-3E-7A-92-13-79-FB-D2-34-4F-3D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.RegularExpressions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Text.RegularExpressions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9E-63-EF-9A-D8-E6-C0-64-EB-31-79-F5-8C-35-7D-C2-C5-D2-94-7D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Http.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:44Z</ModuleTime>\n            <ModuleName>System.Net.Http</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2F-E1-13-B8-1E-10-AE-79-4A-CD-F8-AE-C1-F1-E8-22-10-2F-61-17\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.ReaderWriter.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Xml.ReaderWriter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D3-FC-01-5E-22-55-B9-FD-FB-0D-0E-A5-B8-58-05-D8-DC-D2-F5-24\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Tracing.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:36Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Tracing</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2A-48-85-A6-03-C4-07-FD-29-10-28-5A-25-BF-0C-FA-03-A7-98-B2\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Net.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A6-8F-70-B6-4E-19-5D-AD-A4-E6-F3-7F-0E-80-A2-3F-81-B0-99-64\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Globalization.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Globalization</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A5-D1-78-2C-3D-8D-E9-D4-52-E4-0C-B0-3D-34-F4-8D-7A-08-C6-C3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Security.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:26Z</ModuleTime>\n            <ModuleName>System.Net.Security</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B5-88-C5-06-06-46-BA-FC-55-0E-7A-44-AC-31-CD-F3-5B-DF-AE-0B\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.ILGeneration.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.ILGeneration</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2D-D2-58-DD-BA-4D-D9-A2-D8-99-CB-EF-60-05-5F-E6-2B-B1-A8-C7\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.X509Certificates.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.X509Certificates</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F1-9F-EA-39-E9-B6-89-2A-58-18-83-8F-AC-C2-48-C5-4B-91-2A-5E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Requests.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Net.Requests</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"EA-A3-EB-09-A2-39-8F-0D-B1-13-BA-6D-11-3A-EC-93-44-39-5A-D3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.Lightweight.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.Lightweight</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E7-62-66-DE-57-93-B4-25-D0-E5-B1-77-A2-DF-82-65-19-35-D3-96\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.NetworkInformation.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:40Z</ModuleTime>\n            <ModuleName>System.Net.NetworkInformation</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4E-A9-32-5A-D2-0F-84-D8-73-42-C7-0B-6A-3C-7B-C0-89-B7-20-01\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\Microsoft.Win32.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n            <ModuleName>Microsoft.Win32.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C8-E8-31-5D-60-D0-B9-32-02-28-DE-17-96-8F-97-91-72-F8-BE-13\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Reflection.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FA-59-51-C6-D3-6C-0B-D8-35-01-96-30-1E-15-48-22-E9-1D-84-18\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.TemplateEngine.Utils.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:46Z</ModuleTime>\n            <ModuleName>Microsoft.TemplateEngine.Utils</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"96-CF-CB-AB-4F-25-B8-44-23-16-25-EC-27-DB-10-94-9B-5F-78-77\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\Microsoft.Win32.Registry.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>Microsoft.Win32.Registry</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"EF-F5-62-5F-AF-AF-B2-EE-AD-D8-B0-5F-2F-34-FF-0C-C9-DD-5C-66\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Tools.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:36Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Tools</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"32-77-95-87-72-D8-6D-43-AA-DA-36-9B-86-D6-99-7F-41-0E-CF-A5\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Debug.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Debug</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C1-41-1B-16-60-41-0D-35-CE-85-82-6D-04-AB-CE-5C-88-E8-BE-91\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:06Z</ModuleTime>\n            <ModuleName>System.IO</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A5-1D-73-D2-8D-F6-70-B7-B7-8B-00-F4-17-70-7F-2A-98-D3-1C-F9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Encoding.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Text.Encoding</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"CC-FC-9F-9B-3F-02-43-A8-4C-9F-1C-AD-15-23-EF-34-31-D4-A6-0C\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.Compression.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:40Z</ModuleTime>\n            <ModuleName>System.IO.Compression</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"47-20-F1-42-9C-3C-11-60-EE-D5-38-37-4E-D7-48-C3-66-42-34-0F\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.Build.Framework.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:38Z</ModuleTime>\n            <ModuleName>Microsoft.Build.Framework</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E5-F8-08-77-40-69-F3-B4-39-9E-F4-4F-30-35-FF-75-AD-66-E9-C9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:34Z</ModuleTime>\n            <ModuleName>System.ComponentModel.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5E-EA-96-C3-0B-C7-BF-BA-AE-4A-27-D8-9A-9A-67-A2-72-BF-89-1F\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.NonGeneric.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:32Z</ModuleTime>\n            <ModuleName>System.Collections.NonGeneric</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9E-74-A8-58-6C-B8-D8-AD-35-90-C4-AB-A7-24-4E-54-43-53-8E-2F\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.DiagnosticSource.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:34Z</ModuleTime>\n            <ModuleName>System.Diagnostics.DiagnosticSource</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"25-17-3D-BA-13-03-55-32-76-CF-3D-AE-B3-52-14-5F-95-F5-3E-85\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Timer.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.Timer</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"EE-DF-4B-C9-A1-40-03-5F-56-1A-DB-D7-E8-A0-BC-A6-12-34-84-1E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Sockets.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:08Z</ModuleTime>\n            <ModuleName>System.Net.Sockets</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"87-6E-54-67-71-53-FA-C9-68-88-0D-C1-82-45-BE-68-5A-25-55-32\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Overlapped.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Threading.Overlapped</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"19-DB-E7-26-74-3E-B8-3C-B9-3E-89-49-9F-20-99-D9-CF-23-FD-17\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.CoreLib.dll</ModulePath>\n            <ModuleTime>2020-02-18T20:16:14Z</ModuleTime>\n            <ModuleName>System.Private.CoreLib</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E6-CE-DF-D3-05-01-F5-61-41-53-0C-FF-2C-87-01-04-6E-EB-B1-C7\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.NameResolution.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:40Z</ModuleTime>\n            <ModuleName>System.Net.NameResolution</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"76-87-37-3D-BD-CF-7C-E5-90-89-7B-D5-45-86-01-3E-47-72-1F-6D\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\MSBuild.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:43:48Z</ModuleTime>\n            <ModuleName>MSBuild</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"45-AE-FF-2D-9F-D9-14-AE-5E-58-BC-AD-59-3F-6B-E0-C7-F9-45-CA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Runtime</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2F-EF-10-A4-03-CD-85-F5-B3-28-04-C0-CA-59-04-4C-AE-A8-5D-D0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Principal.Windows.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Principal.Windows</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"79-03-C9-B3-67-3A-61-F7-6D-B6-CE-72-A2-3F-68-B5-87-C1-4B-60\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Claims.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.Claims</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"87-DE-C4-EB-AC-4B-76-40-4C-56-AB-F2-05-44-02-D8-77-58-26-00\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Principal.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Principal</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B8-01-4B-08-49-01-14-1F-52-C1-06-1B-E1-C4-DA-8C-8C-15-88-14\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9C-68-F9-D9-5D-09-7B-AC-36-D7-6D-25-3D-17-F3-72-E5-1A-87-F0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:06Z</ModuleTime>\n            <ModuleName>System.Threading</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"23-F9-09-16-3B-71-58-F5-A7-35-CA-89-4D-75-0F-3D-D0-23-DC-EB\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Tasks.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Threading.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"47-20-F1-42-9C-3C-11-60-EE-D5-38-37-4E-D7-48-C3-66-42-34-0F\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.Build.Framework.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:38Z</ModuleTime>\n            <ModuleName>Microsoft.Build.Framework</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-0A-47-0B-10-27-7A-98-D6-A5-5B-EC-1C-35-91-93-AB-C0-35-65\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\netstandard.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>netstandard</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"26-14-D7-B5-EB-43-C2-76-01-4F-01-5E-7B-A4-CE-E9-EB-E3-AA-B9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.InteropServices.RuntimeInformation.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices.RuntimeInformation</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4D-33-53-11-50-36-83-92-2B-29-8C-5A-FA-19-EF-5A-D4-AA-32-80\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Process.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:38Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Process</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E5-F8-08-77-40-69-F3-B4-39-9E-F4-4F-30-35-FF-75-AD-66-E9-C9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:34Z</ModuleTime>\n            <ModuleName>System.ComponentModel.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"33-87-51-E6-2F-8C-BE-1D-5B-B2-9E-51-10-1B-05-40-2C-E3-E8-1A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Linq.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:40Z</ModuleTime>\n            <ModuleName>System.Linq</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9D-C0-19-0D-B9-0B-71-00-FA-44-3E-7A-92-13-79-FB-D2-34-4F-3D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.RegularExpressions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Text.RegularExpressions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8B-E9-5A-2E-CC-DB-5C-E1-03-05-BA-E1-31-A9-9D-6F-18-10-50-AA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Collections</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"AF-4F-3B-E9-D2-80-A0-2E-91-5B-AF-17-34-A9-F1-A6-32-C4-EC-4E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Memory.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Memory</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"CE-43-2B-40-C0-FF-2C-68-D3-CF-AF-49-07-37-DC-D7-AA-AB-17-F3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Buffers.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:26Z</ModuleTime>\n            <ModuleName>System.Buffers</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A6-81-2A-5B-4A-3D-C8-4D-49-04-DE-1F-DF-02-7C-B4-43-51-DE-1C\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.FileSystem.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.IO.FileSystem</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B9-08-B2-09-3C-61-2C-3E-62-03-05-65-93-6A-84-E5-2C-0D-A7-F4\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.InteropServices.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"32-5D-5E-82-60-49-7F-5D-44-D4-1E-BF-57-95-6F-D8-30-A6-C2-E1\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Console.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n            <ModuleName>System.Console</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"58-59-35-07-07-DE-52-C3-80-D9-CC-BF-5D-FA-04-DF-29-C6-52-ED\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.Build.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:40Z</ModuleTime>\n            <ModuleName>Microsoft.Build</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D3-FC-01-5E-22-55-B9-FD-FB-0D-0E-A5-B8-58-05-D8-DC-D2-F5-24\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Tracing.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:36Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Tracing</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"32-77-95-87-72-D8-6D-43-AA-DA-36-9B-86-D6-99-7F-41-0E-CF-A5\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Debug.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Debug</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"BF-BC-9F-90-71-42-03-E3-AC-AA-D2-39-9E-84-5C-00-62-70-39-BA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Encoding.CodePages.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:46Z</ModuleTime>\n            <ModuleName>System.Text.Encoding.CodePages</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FC-9A-A3-24-E8-48-FF-9E-1A-D8-C2-B3-54-1E-A8-DD-B2-E1-E3-96\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.ThreadPool.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.ThreadPool</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8F-A1-95-7C-65-A0-95-11-53-8D-DF-11-6D-3C-AD-5D-AE-2F-D3-73\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Concurrent.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>System.Collections.Concurrent</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"3D-ED-2E-29-0D-BD-86-B5-75-96-FF-B0-C8-9D-AD-4E-5B-94-58-57\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Loader.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Loader</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5C-D3-E5-60-AC-A8-D6-45-77-6C-59-CA-FE-F1-49-32-B4-41-29-2D\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\dotnet.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:30Z</ModuleTime>\n            <ModuleName>dotnet</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"01-AB-1F-C1-0A-AD-1A-D5-69-41-9D-4B-4E-1C-6F-AC-59-05-9A-48\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Immutable.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>System.Collections.Immutable</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"38-09-CE-F2-E5-95-B5-A8-49-DB-F2-B2-FC-2A-62-56-4F-D2-91-39\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.DotNet.Configurer.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:38Z</ModuleTime>\n            <ModuleName>Microsoft.DotNet.Configurer</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"03-C3-25-61-A9-3B-57-DB-78-E8-F7-85-5D-BE-8C-07-5D-B0-8C-AA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.Encoding.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Encoding</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A6-34-21-D2-ED-90-2B-0C-6B-31-85-04-D0-F6-D6-13-31-C9-61-F8\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.DotNet.InternalAbstractions.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:40Z</ModuleTime>\n            <ModuleName>Microsoft.DotNet.InternalAbstractions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D2-6E-C4-85-DC-1F-C3-EB-0C-2E-07-EA-F9-33-C9-A6-25-57-E7-D6\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.DotNet.Cli.Utils.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:38Z</ModuleTime>\n            <ModuleName>Microsoft.DotNet.Cli.Utils</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4E-96-5A-FC-C0-BE-6F-D4-A5-9C-B4-F8-33-D5-85-D1-B9-07-9F-89\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Encoding.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Text.Encoding.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"DD-89-83-66-26-E0-B9-BF-DD-51-53-00-1B-5A-80-96-5A-0A-01-79\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.ApplicationInsights.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:02Z</ModuleTime>\n            <ModuleName>Microsoft.ApplicationInsights</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"1E-D4-CD-15-2C-94-E4-C6-19-88-4A-EC-70-23-9C-38-12-8A-35-87\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.DotNet.PlatformAbstractions.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:38Z</ModuleTime>\n            <ModuleName>Microsoft.DotNet.PlatformAbstractions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D5-0A-67-87-14-54-BA-3A-F2-2A-2A-B8-15-CE-D1-74-51-44-E5-FC\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Uri.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:26Z</ModuleTime>\n            <ModuleName>System.Private.Uri</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F0-C5-75-3F-22-17-B9-2C-E6-C3-3C-A7-4D-EE-AF-C8-FF-35-92-AC\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.CompilerServices.Unsafe.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Runtime.CompilerServices.Unsafe</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"70-58-B8-D8-D1-66-CB-C6-C4-F9-5F-80-03-7C-74-A2-D8-CA-6A-98\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Reflection.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-4C-1D-C3-E8-DB-38-EA-0D-64-CB-BD-58-BC-F2-B0-E2-99-42-93\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Reflection</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4B-5A-EC-05-10-C3-65-A3-7C-C5-D4-52-0E-41-A4-1F-73-88-F9-01\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.XDocument.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Xml.XDocument</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"68-1D-85-11-BD-EC-60-7F-F2-E8-83-FF-C6-D8-D9-CB-28-C8-8B-2A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Xml.Linq.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:30Z</ModuleTime>\n            <ModuleName>System.Private.Xml.Linq</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A3-6E-3F-5C-23-E9-CE-D4-59-A4-79-82-3A-A2-A6-D2-A6-37-0E-C2\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Thread.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.Thread</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"1F-BD-6F-06-01-11-FA-A9-DB-0B-12-95-1E-A0-B6-62-C2-59-ED-05\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Xml.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:38Z</ModuleTime>\n            <ModuleName>System.Private.Xml</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2F-E1-13-B8-1E-10-AE-79-4A-CD-F8-AE-C1-F1-E8-22-10-2F-61-17\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.ReaderWriter.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Xml.ReaderWriter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A6-8F-70-B6-4E-19-5D-AD-A4-E6-F3-7F-0E-80-A2-3F-81-B0-99-64\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Globalization.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Globalization</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"BD-4A-A7-E3-52-A8-34-61-7F-29-11-AF-BF-90-FC-16-AD-AB-40-0B\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Tasks.Dataflow.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:46Z</ModuleTime>\n            <ModuleName>System.Threading.Tasks.Dataflow</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-F9-21-BB-3C-07-A4-DA-5A-43-89-51-EB-E0-A4-B9-2F-19-F6-7D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.Algorithms.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Algorithms</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"55-8E-C2-A5-09-4D-3F-8C-11-59-AB-41-D5-05-B5-7B-8D-3A-AA-6E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"96-CF-CB-AB-4F-25-B8-44-23-16-25-EC-27-DB-10-94-9B-5F-78-77\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\Microsoft.Win32.Registry.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>Microsoft.Win32.Registry</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"57-E8-B3-F8-DB-88-F2-FB-81-BE-34-C3-AD-1E-D4-F0-DD-F0-59-D3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Resources.ResourceManager.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Resources.ResourceManager</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"22-BD-0E-BF-F3-50-23-F4-33-69-45-CA-85-5A-41-AA-FF-98-13-6A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ObjectModel.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.ObjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B5-88-C5-06-06-46-BA-FC-55-0E-7A-44-AC-31-CD-F3-5B-DF-AE-0B\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.ILGeneration.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.ILGeneration</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"EA-A3-EB-09-A2-39-8F-0D-B1-13-BA-6D-11-3A-EC-93-44-39-5A-D3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.Lightweight.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.Lightweight</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C8-E8-31-5D-60-D0-B9-32-02-28-DE-17-96-8F-97-91-72-F8-BE-13\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Reflection.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"66-55-F3-9A-C4-53-63-95-5F-60-D2-19-0F-7E-3B-2B-85-46-FB-8D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.TraceSource.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Diagnostics.TraceSource</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"04-D0-77-B5-F7-72-0B-E6-E8-AA-8F-4B-A0-A0-C9-C0-4C-69-37-D9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Tasks.Parallel.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Threading.Tasks.Parallel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"88-E7-E8-96-8F-48-99-50-8E-E1-DF-4C-0E-D5-D8-C5-0D-62-22-36\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.Build.Tasks.Core.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:38Z</ModuleTime>\n            <ModuleName>Microsoft.Build.Tasks.Core</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"7A-E6-CA-81-95-20-D1-FF-17-80-B7-2A-AB-83-B3-0A-F1-99-1E-2A\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.Build.Utilities.Core.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:42Z</ModuleTime>\n            <ModuleName>Microsoft.Build.Utilities.Core</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E4-51-7F-05-08-F3-02-02-27-8E-E8-21-7C-ED-F0-78-12-BA-03-DA\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Build.Tasks.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:22Z</ModuleTime>\n            <ModuleName>NuGet.Build.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"11-27-AE-76-EA-89-8D-78-90-4F-7C-8D-62-56-14-CD-EF-02-37-D9\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Common.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9A-73-83-D7-DB-DD-27-CD-88-01-22-D7-EF-C7-FF-A7-B2-07-F7-3B\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Commands.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Commands</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"36-E8-16-54-B7-19-BD-A8-2A-38-DC-64-7B-B6-08-2C-AE-DF-59-4A\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.ProjectModel.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:26Z</ModuleTime>\n            <ModuleName>NuGet.ProjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5E-EA-96-C3-0B-C7-BF-BA-AE-4A-27-D8-9A-9A-67-A2-72-BF-89-1F\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.NonGeneric.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:32Z</ModuleTime>\n            <ModuleName>System.Collections.NonGeneric</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4E-A9-32-5A-D2-0F-84-D8-73-42-C7-0B-6A-3C-7B-C0-89-B7-20-01\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\Microsoft.Win32.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n            <ModuleName>Microsoft.Win32.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FC-9A-A3-24-E8-48-FF-9E-1A-D8-C2-B3-54-1E-A8-DD-B2-E1-E3-96\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.ThreadPool.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.ThreadPool</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FE-01-7B-00-A1-9B-C4-BC-2A-13-7F-59-A4-6F-55-59-DD-49-B7-A0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.Pipes.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:04Z</ModuleTime>\n            <ModuleName>System.IO.Pipes</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"87-DE-C4-EB-AC-4B-76-40-4C-56-AB-F2-05-44-02-D8-77-58-26-00\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Principal.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Principal</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"80-8D-68-67-13-D9-19-58-91-D7-B1-B6-1B-CF-9B-3C-AC-80-89-94\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.Build.NuGetSdkResolver.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:36Z</ModuleTime>\n            <ModuleName>Microsoft.Build.NuGetSdkResolver</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"49-E0-50-A5-D9-8A-25-15-AE-1C-26-42-E6-99-0B-49-D2-F5-CB-DA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.FileVersionInfo.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:38Z</ModuleTime>\n            <ModuleName>System.Diagnostics.FileVersionInfo</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"42-A4-D5-63-DA-C9-6B-42-3E-CF-98-F9-FB-80-3B-23-4D-E8-7E-B3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:34Z</ModuleTime>\n            <ModuleName>System.ComponentModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"19-DB-E7-26-74-3E-B8-3C-B9-3E-89-49-9F-20-99-D9-CF-23-FD-17\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.CoreLib.dll</ModulePath>\n            <ModuleTime>2020-02-18T20:16:14Z</ModuleTime>\n            <ModuleName>System.Private.CoreLib</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"76-87-37-3D-BD-CF-7C-E5-90-89-7B-D5-45-86-01-3E-47-72-1F-6D\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\MSBuild.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:43:48Z</ModuleTime>\n            <ModuleName>MSBuild</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"45-AE-FF-2D-9F-D9-14-AE-5E-58-BC-AD-59-3F-6B-E0-C7-F9-45-CA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Runtime</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B8-01-4B-08-49-01-14-1F-52-C1-06-1B-E1-C4-DA-8C-8C-15-88-14\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9C-68-F9-D9-5D-09-7B-AC-36-D7-6D-25-3D-17-F3-72-E5-1A-87-F0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:06Z</ModuleTime>\n            <ModuleName>System.Threading</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"23-F9-09-16-3B-71-58-F5-A7-35-CA-89-4D-75-0F-3D-D0-23-DC-EB\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Tasks.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Threading.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"47-20-F1-42-9C-3C-11-60-EE-D5-38-37-4E-D7-48-C3-66-42-34-0F\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.Build.Framework.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:38Z</ModuleTime>\n            <ModuleName>Microsoft.Build.Framework</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-0A-47-0B-10-27-7A-98-D6-A5-5B-EC-1C-35-91-93-AB-C0-35-65\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\netstandard.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>netstandard</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"26-14-D7-B5-EB-43-C2-76-01-4F-01-5E-7B-A4-CE-E9-EB-E3-AA-B9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.InteropServices.RuntimeInformation.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices.RuntimeInformation</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4D-33-53-11-50-36-83-92-2B-29-8C-5A-FA-19-EF-5A-D4-AA-32-80\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Process.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:38Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Process</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E5-F8-08-77-40-69-F3-B4-39-9E-F4-4F-30-35-FF-75-AD-66-E9-C9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:34Z</ModuleTime>\n            <ModuleName>System.ComponentModel.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"33-87-51-E6-2F-8C-BE-1D-5B-B2-9E-51-10-1B-05-40-2C-E3-E8-1A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Linq.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:40Z</ModuleTime>\n            <ModuleName>System.Linq</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9D-C0-19-0D-B9-0B-71-00-FA-44-3E-7A-92-13-79-FB-D2-34-4F-3D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.RegularExpressions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Text.RegularExpressions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8B-E9-5A-2E-CC-DB-5C-E1-03-05-BA-E1-31-A9-9D-6F-18-10-50-AA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Collections</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"AF-4F-3B-E9-D2-80-A0-2E-91-5B-AF-17-34-A9-F1-A6-32-C4-EC-4E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Memory.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Memory</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"CE-43-2B-40-C0-FF-2C-68-D3-CF-AF-49-07-37-DC-D7-AA-AB-17-F3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Buffers.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:26Z</ModuleTime>\n            <ModuleName>System.Buffers</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A6-81-2A-5B-4A-3D-C8-4D-49-04-DE-1F-DF-02-7C-B4-43-51-DE-1C\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.FileSystem.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.IO.FileSystem</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B9-08-B2-09-3C-61-2C-3E-62-03-05-65-93-6A-84-E5-2C-0D-A7-F4\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.InteropServices.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"32-5D-5E-82-60-49-7F-5D-44-D4-1E-BF-57-95-6F-D8-30-A6-C2-E1\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Console.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n            <ModuleName>System.Console</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"58-59-35-07-07-DE-52-C3-80-D9-CC-BF-5D-FA-04-DF-29-C6-52-ED\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.Build.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:40Z</ModuleTime>\n            <ModuleName>Microsoft.Build</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D3-FC-01-5E-22-55-B9-FD-FB-0D-0E-A5-B8-58-05-D8-DC-D2-F5-24\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Tracing.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:36Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Tracing</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"32-77-95-87-72-D8-6D-43-AA-DA-36-9B-86-D6-99-7F-41-0E-CF-A5\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Debug.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Debug</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"BF-BC-9F-90-71-42-03-E3-AC-AA-D2-39-9E-84-5C-00-62-70-39-BA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Encoding.CodePages.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:46Z</ModuleTime>\n            <ModuleName>System.Text.Encoding.CodePages</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8F-A1-95-7C-65-A0-95-11-53-8D-DF-11-6D-3C-AD-5D-AE-2F-D3-73\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Concurrent.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>System.Collections.Concurrent</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FE-01-7B-00-A1-9B-C4-BC-2A-13-7F-59-A4-6F-55-59-DD-49-B7-A0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.Pipes.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:04Z</ModuleTime>\n            <ModuleName>System.IO.Pipes</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4E-96-5A-FC-C0-BE-6F-D4-A5-9C-B4-F8-33-D5-85-D1-B9-07-9F-89\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Encoding.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Text.Encoding.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FC-03-66-B3-A4-0E-6D-59-00-DF-29-69-D0-2E-C0-08-26-E6-F1-B3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.AccessControl.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.AccessControl</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2F-EF-10-A4-03-CD-85-F5-B3-28-04-C0-CA-59-04-4C-AE-A8-5D-D0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Principal.Windows.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Principal.Windows</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"79-03-C9-B3-67-3A-61-F7-6D-B6-CE-72-A2-3F-68-B5-87-C1-4B-60\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Claims.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.Claims</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"87-DE-C4-EB-AC-4B-76-40-4C-56-AB-F2-05-44-02-D8-77-58-26-00\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Principal.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Principal</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"87-6E-54-67-71-53-FA-C9-68-88-0D-C1-82-45-BE-68-5A-25-55-32\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Overlapped.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Threading.Overlapped</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"87-6E-54-67-71-53-FA-C9-68-88-0D-C1-82-45-BE-68-5A-25-55-32\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Overlapped.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Threading.Overlapped</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A3-6E-3F-5C-23-E9-CE-D4-59-A4-79-82-3A-A2-A6-D2-A6-37-0E-C2\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Thread.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.Thread</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FC-03-66-B3-A4-0E-6D-59-00-DF-29-69-D0-2E-C0-08-26-E6-F1-B3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.AccessControl.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.AccessControl</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2F-EF-10-A4-03-CD-85-F5-B3-28-04-C0-CA-59-04-4C-AE-A8-5D-D0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Principal.Windows.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Principal.Windows</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"79-03-C9-B3-67-3A-61-F7-6D-B6-CE-72-A2-3F-68-B5-87-C1-4B-60\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Claims.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.Claims</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"22-BD-0E-BF-F3-50-23-F4-33-69-45-CA-85-5A-41-AA-FF-98-13-6A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ObjectModel.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.ObjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"BD-4A-A7-E3-52-A8-34-61-7F-29-11-AF-BF-90-FC-16-AD-AB-40-0B\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Tasks.Dataflow.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:46Z</ModuleTime>\n            <ModuleName>System.Threading.Tasks.Dataflow</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"19-DB-E7-26-74-3E-B8-3C-B9-3E-89-49-9F-20-99-D9-CF-23-FD-17\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.CoreLib.dll</ModulePath>\n            <ModuleTime>2020-02-18T20:16:14Z</ModuleTime>\n            <ModuleName>System.Private.CoreLib</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"3D-ED-2E-29-0D-BD-86-B5-75-96-FF-B0-C8-9D-AD-4E-5B-94-58-57\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Loader.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Loader</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5C-D3-E5-60-AC-A8-D6-45-77-6C-59-CA-FE-F1-49-32-B4-41-29-2D\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\dotnet.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:30Z</ModuleTime>\n            <ModuleName>dotnet</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"01-AB-1F-C1-0A-AD-1A-D5-69-41-9D-4B-4E-1C-6F-AC-59-05-9A-48\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Immutable.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>System.Collections.Immutable</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"76-87-37-3D-BD-CF-7C-E5-90-89-7B-D5-45-86-01-3E-47-72-1F-6D\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\MSBuild.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:43:48Z</ModuleTime>\n            <ModuleName>MSBuild</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"45-AE-FF-2D-9F-D9-14-AE-5E-58-BC-AD-59-3F-6B-E0-C7-F9-45-CA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Runtime</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"38-09-CE-F2-E5-95-B5-A8-49-DB-F2-B2-FC-2A-62-56-4F-D2-91-39\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.DotNet.Configurer.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:38Z</ModuleTime>\n            <ModuleName>Microsoft.DotNet.Configurer</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B8-01-4B-08-49-01-14-1F-52-C1-06-1B-E1-C4-DA-8C-8C-15-88-14\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9C-68-F9-D9-5D-09-7B-AC-36-D7-6D-25-3D-17-F3-72-E5-1A-87-F0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:06Z</ModuleTime>\n            <ModuleName>System.Threading</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"23-F9-09-16-3B-71-58-F5-A7-35-CA-89-4D-75-0F-3D-D0-23-DC-EB\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Tasks.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Threading.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"47-20-F1-42-9C-3C-11-60-EE-D5-38-37-4E-D7-48-C3-66-42-34-0F\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.Build.Framework.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:38Z</ModuleTime>\n            <ModuleName>Microsoft.Build.Framework</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-0A-47-0B-10-27-7A-98-D6-A5-5B-EC-1C-35-91-93-AB-C0-35-65\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\netstandard.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>netstandard</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"57-E8-B3-F8-DB-88-F2-FB-81-BE-34-C3-AD-1E-D4-F0-DD-F0-59-D3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Resources.ResourceManager.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Resources.ResourceManager</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"26-14-D7-B5-EB-43-C2-76-01-4F-01-5E-7B-A4-CE-E9-EB-E3-AA-B9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.InteropServices.RuntimeInformation.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices.RuntimeInformation</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4D-33-53-11-50-36-83-92-2B-29-8C-5A-FA-19-EF-5A-D4-AA-32-80\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Process.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:38Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Process</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E5-F8-08-77-40-69-F3-B4-39-9E-F4-4F-30-35-FF-75-AD-66-E9-C9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:34Z</ModuleTime>\n            <ModuleName>System.ComponentModel.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"33-87-51-E6-2F-8C-BE-1D-5B-B2-9E-51-10-1B-05-40-2C-E3-E8-1A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Linq.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:40Z</ModuleTime>\n            <ModuleName>System.Linq</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9D-C0-19-0D-B9-0B-71-00-FA-44-3E-7A-92-13-79-FB-D2-34-4F-3D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.RegularExpressions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Text.RegularExpressions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8B-E9-5A-2E-CC-DB-5C-E1-03-05-BA-E1-31-A9-9D-6F-18-10-50-AA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Collections</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"AF-4F-3B-E9-D2-80-A0-2E-91-5B-AF-17-34-A9-F1-A6-32-C4-EC-4E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Memory.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Memory</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"CE-43-2B-40-C0-FF-2C-68-D3-CF-AF-49-07-37-DC-D7-AA-AB-17-F3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Buffers.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:26Z</ModuleTime>\n            <ModuleName>System.Buffers</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A6-81-2A-5B-4A-3D-C8-4D-49-04-DE-1F-DF-02-7C-B4-43-51-DE-1C\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.FileSystem.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.IO.FileSystem</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B9-08-B2-09-3C-61-2C-3E-62-03-05-65-93-6A-84-E5-2C-0D-A7-F4\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.InteropServices.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"32-5D-5E-82-60-49-7F-5D-44-D4-1E-BF-57-95-6F-D8-30-A6-C2-E1\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Console.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n            <ModuleName>System.Console</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"58-59-35-07-07-DE-52-C3-80-D9-CC-BF-5D-FA-04-DF-29-C6-52-ED\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.Build.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:40Z</ModuleTime>\n            <ModuleName>Microsoft.Build</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D3-FC-01-5E-22-55-B9-FD-FB-0D-0E-A5-B8-58-05-D8-DC-D2-F5-24\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Tracing.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:36Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Tracing</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"32-77-95-87-72-D8-6D-43-AA-DA-36-9B-86-D6-99-7F-41-0E-CF-A5\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Debug.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Debug</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"BF-BC-9F-90-71-42-03-E3-AC-AA-D2-39-9E-84-5C-00-62-70-39-BA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Encoding.CodePages.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:46Z</ModuleTime>\n            <ModuleName>System.Text.Encoding.CodePages</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8F-A1-95-7C-65-A0-95-11-53-8D-DF-11-6D-3C-AD-5D-AE-2F-D3-73\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Concurrent.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>System.Collections.Concurrent</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FE-01-7B-00-A1-9B-C4-BC-2A-13-7F-59-A4-6F-55-59-DD-49-B7-A0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.Pipes.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:04Z</ModuleTime>\n            <ModuleName>System.IO.Pipes</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4E-96-5A-FC-C0-BE-6F-D4-A5-9C-B4-F8-33-D5-85-D1-B9-07-9F-89\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Encoding.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Text.Encoding.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FC-03-66-B3-A4-0E-6D-59-00-DF-29-69-D0-2E-C0-08-26-E6-F1-B3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.AccessControl.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.AccessControl</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2F-EF-10-A4-03-CD-85-F5-B3-28-04-C0-CA-59-04-4C-AE-A8-5D-D0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Principal.Windows.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Principal.Windows</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"79-03-C9-B3-67-3A-61-F7-6D-B6-CE-72-A2-3F-68-B5-87-C1-4B-60\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Claims.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.Claims</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"87-DE-C4-EB-AC-4B-76-40-4C-56-AB-F2-05-44-02-D8-77-58-26-00\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Principal.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Principal</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"87-6E-54-67-71-53-FA-C9-68-88-0D-C1-82-45-BE-68-5A-25-55-32\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Overlapped.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Threading.Overlapped</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A3-6E-3F-5C-23-E9-CE-D4-59-A4-79-82-3A-A2-A6-D2-A6-37-0E-C2\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Thread.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.Thread</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2F-E1-13-B8-1E-10-AE-79-4A-CD-F8-AE-C1-F1-E8-22-10-2F-61-17\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.ReaderWriter.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Xml.ReaderWriter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"22-BD-0E-BF-F3-50-23-F4-33-69-45-CA-85-5A-41-AA-FF-98-13-6A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ObjectModel.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.ObjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"1F-BD-6F-06-01-11-FA-A9-DB-0B-12-95-1E-A0-B6-62-C2-59-ED-05\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Xml.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:38Z</ModuleTime>\n            <ModuleName>System.Private.Xml</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-F9-21-BB-3C-07-A4-DA-5A-43-89-51-EB-E0-A4-B9-2F-19-F6-7D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.Algorithms.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Algorithms</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D5-0A-67-87-14-54-BA-3A-F2-2A-2A-B8-15-CE-D1-74-51-44-E5-FC\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Uri.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:26Z</ModuleTime>\n            <ModuleName>System.Private.Uri</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"BD-4A-A7-E3-52-A8-34-61-7F-29-11-AF-BF-90-FC-16-AD-AB-40-0B\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Tasks.Dataflow.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:46Z</ModuleTime>\n            <ModuleName>System.Threading.Tasks.Dataflow</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"3D-ED-2E-29-0D-BD-86-B5-75-96-FF-B0-C8-9D-AD-4E-5B-94-58-57\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Loader.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Loader</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"96-CF-CB-AB-4F-25-B8-44-23-16-25-EC-27-DB-10-94-9B-5F-78-77\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\Microsoft.Win32.Registry.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>Microsoft.Win32.Registry</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5C-D3-E5-60-AC-A8-D6-45-77-6C-59-CA-FE-F1-49-32-B4-41-29-2D\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\dotnet.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:30Z</ModuleTime>\n            <ModuleName>dotnet</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"01-AB-1F-C1-0A-AD-1A-D5-69-41-9D-4B-4E-1C-6F-AC-59-05-9A-48\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Immutable.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>System.Collections.Immutable</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"66-55-F3-9A-C4-53-63-95-5F-60-D2-19-0F-7E-3B-2B-85-46-FB-8D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.TraceSource.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Diagnostics.TraceSource</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"38-09-CE-F2-E5-95-B5-A8-49-DB-F2-B2-FC-2A-62-56-4F-D2-91-39\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.DotNet.Configurer.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:38Z</ModuleTime>\n            <ModuleName>Microsoft.DotNet.Configurer</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"57-E8-B3-F8-DB-88-F2-FB-81-BE-34-C3-AD-1E-D4-F0-DD-F0-59-D3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Resources.ResourceManager.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Resources.ResourceManager</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2F-E1-13-B8-1E-10-AE-79-4A-CD-F8-AE-C1-F1-E8-22-10-2F-61-17\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.ReaderWriter.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Xml.ReaderWriter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"1F-BD-6F-06-01-11-FA-A9-DB-0B-12-95-1E-A0-B6-62-C2-59-ED-05\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Xml.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:38Z</ModuleTime>\n            <ModuleName>System.Private.Xml</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-F9-21-BB-3C-07-A4-DA-5A-43-89-51-EB-E0-A4-B9-2F-19-F6-7D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.Algorithms.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Algorithms</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D5-0A-67-87-14-54-BA-3A-F2-2A-2A-B8-15-CE-D1-74-51-44-E5-FC\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Uri.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:26Z</ModuleTime>\n            <ModuleName>System.Private.Uri</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"04-D0-77-B5-F7-72-0B-E6-E8-AA-8F-4B-A0-A0-C9-C0-4C-69-37-D9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Tasks.Parallel.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Threading.Tasks.Parallel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"96-CF-CB-AB-4F-25-B8-44-23-16-25-EC-27-DB-10-94-9B-5F-78-77\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\Microsoft.Win32.Registry.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>Microsoft.Win32.Registry</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"66-55-F3-9A-C4-53-63-95-5F-60-D2-19-0F-7E-3B-2B-85-46-FB-8D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.TraceSource.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Diagnostics.TraceSource</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"7A-E6-CA-81-95-20-D1-FF-17-80-B7-2A-AB-83-B3-0A-F1-99-1E-2A\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.Build.Utilities.Core.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:42Z</ModuleTime>\n            <ModuleName>Microsoft.Build.Utilities.Core</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"04-D0-77-B5-F7-72-0B-E6-E8-AA-8F-4B-A0-A0-C9-C0-4C-69-37-D9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Tasks.Parallel.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Threading.Tasks.Parallel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"7A-E6-CA-81-95-20-D1-FF-17-80-B7-2A-AB-83-B3-0A-F1-99-1E-2A\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.Build.Utilities.Core.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:42Z</ModuleTime>\n            <ModuleName>Microsoft.Build.Utilities.Core</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B5-88-C5-06-06-46-BA-FC-55-0E-7A-44-AC-31-CD-F3-5B-DF-AE-0B\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.ILGeneration.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.ILGeneration</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"EA-A3-EB-09-A2-39-8F-0D-B1-13-BA-6D-11-3A-EC-93-44-39-5A-D3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.Lightweight.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.Lightweight</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C8-E8-31-5D-60-D0-B9-32-02-28-DE-17-96-8F-97-91-72-F8-BE-13\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Reflection.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B6-58-2E-A2-A7-DF-F0-53-14-F6-45-D8-42-D5-5A-6B-69-F7-12-C9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Serialization.Formatters.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Serialization.Formatters</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B5-88-C5-06-06-46-BA-FC-55-0E-7A-44-AC-31-CD-F3-5B-DF-AE-0B\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.ILGeneration.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.ILGeneration</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B6-58-2E-A2-A7-DF-F0-53-14-F6-45-D8-42-D5-5A-6B-69-F7-12-C9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Serialization.Formatters.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Serialization.Formatters</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"EA-A3-EB-09-A2-39-8F-0D-B1-13-BA-6D-11-3A-EC-93-44-39-5A-D3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.Lightweight.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.Lightweight</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C8-E8-31-5D-60-D0-B9-32-02-28-DE-17-96-8F-97-91-72-F8-BE-13\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Reflection.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B6-58-2E-A2-A7-DF-F0-53-14-F6-45-D8-42-D5-5A-6B-69-F7-12-C9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Serialization.Formatters.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Serialization.Formatters</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"88-E7-E8-96-8F-48-99-50-8E-E1-DF-4C-0E-D5-D8-C5-0D-62-22-36\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.Build.Tasks.Core.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:38Z</ModuleTime>\n            <ModuleName>Microsoft.Build.Tasks.Core</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"88-E7-E8-96-8F-48-99-50-8E-E1-DF-4C-0E-D5-D8-C5-0D-62-22-36\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.Build.Tasks.Core.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:38Z</ModuleTime>\n            <ModuleName>Microsoft.Build.Tasks.Core</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FC-9A-A3-24-E8-48-FF-9E-1A-D8-C2-B3-54-1E-A8-DD-B2-E1-E3-96\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.ThreadPool.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.ThreadPool</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FC-9A-A3-24-E8-48-FF-9E-1A-D8-C2-B3-54-1E-A8-DD-B2-E1-E3-96\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.ThreadPool.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.ThreadPool</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"17-32-2C-E5-EA-D1-3F-48-26-FC-68-8B-AF-F0-AD-51-5E-49-3A-18\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Sdks\\Microsoft.NET.Sdk\\tools\\netcoreapp2.1\\Microsoft.NET.Build.Tasks.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:26Z</ModuleTime>\n            <ModuleName>Microsoft.NET.Build.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"17-32-2C-E5-EA-D1-3F-48-26-FC-68-8B-AF-F0-AD-51-5E-49-3A-18\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Sdks\\Microsoft.NET.Sdk\\tools\\netcoreapp2.1\\Microsoft.NET.Build.Tasks.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:26Z</ModuleTime>\n            <ModuleName>Microsoft.NET.Build.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"17-32-2C-E5-EA-D1-3F-48-26-FC-68-8B-AF-F0-AD-51-5E-49-3A-18\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Sdks\\Microsoft.NET.Sdk\\tools\\netcoreapp2.1\\Microsoft.NET.Build.Tasks.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:26Z</ModuleTime>\n            <ModuleName>Microsoft.NET.Build.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"43-64-EE-FB-2B-CB-04-44-D6-D5-68-E6-00-03-CA-34-D9-9A-35-C6\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Frameworks.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Frameworks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"43-64-EE-FB-2B-CB-04-44-D6-D5-68-E6-00-03-CA-34-D9-9A-35-C6\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Frameworks.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Frameworks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"43-64-EE-FB-2B-CB-04-44-D6-D5-68-E6-00-03-CA-34-D9-9A-35-C6\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Frameworks.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Frameworks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F2-58-94-5C-AE-F2-A7-8A-8B-30-7C-11-FD-9F-26-D2-52-A0-20-73\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Configuration.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Configuration</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E4-51-7F-05-08-F3-02-02-27-8E-E8-21-7C-ED-F0-78-12-BA-03-DA\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Build.Tasks.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:22Z</ModuleTime>\n            <ModuleName>NuGet.Build.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E4-51-7F-05-08-F3-02-02-27-8E-E8-21-7C-ED-F0-78-12-BA-03-DA\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Build.Tasks.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:22Z</ModuleTime>\n            <ModuleName>NuGet.Build.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"11-27-AE-76-EA-89-8D-78-90-4F-7C-8D-62-56-14-CD-EF-02-37-D9\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Common.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"11-27-AE-76-EA-89-8D-78-90-4F-7C-8D-62-56-14-CD-EF-02-37-D9\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Common.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9A-73-83-D7-DB-DD-27-CD-88-01-22-D7-EF-C7-FF-A7-B2-07-F7-3B\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Commands.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Commands</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9A-73-83-D7-DB-DD-27-CD-88-01-22-D7-EF-C7-FF-A7-B2-07-F7-3B\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Commands.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Commands</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"36-E8-16-54-B7-19-BD-A8-2A-38-DC-64-7B-B6-08-2C-AE-DF-59-4A\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.ProjectModel.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:26Z</ModuleTime>\n            <ModuleName>NuGet.ProjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"36-E8-16-54-B7-19-BD-A8-2A-38-DC-64-7B-B6-08-2C-AE-DF-59-4A\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.ProjectModel.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:26Z</ModuleTime>\n            <ModuleName>NuGet.ProjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5E-EA-96-C3-0B-C7-BF-BA-AE-4A-27-D8-9A-9A-67-A2-72-BF-89-1F\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.NonGeneric.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:32Z</ModuleTime>\n            <ModuleName>System.Collections.NonGeneric</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5E-EA-96-C3-0B-C7-BF-BA-AE-4A-27-D8-9A-9A-67-A2-72-BF-89-1F\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.NonGeneric.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:32Z</ModuleTime>\n            <ModuleName>System.Collections.NonGeneric</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4E-A9-32-5A-D2-0F-84-D8-73-42-C7-0B-6A-3C-7B-C0-89-B7-20-01\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\Microsoft.Win32.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n            <ModuleName>Microsoft.Win32.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4E-A9-32-5A-D2-0F-84-D8-73-42-C7-0B-6A-3C-7B-C0-89-B7-20-01\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\Microsoft.Win32.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n            <ModuleName>Microsoft.Win32.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F2-58-94-5C-AE-F2-A7-8A-8B-30-7C-11-FD-9F-26-D2-52-A0-20-73\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Configuration.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Configuration</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F2-58-94-5C-AE-F2-A7-8A-8B-30-7C-11-FD-9F-26-D2-52-A0-20-73\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Configuration.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Configuration</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4B-5A-EC-05-10-C3-65-A3-7C-C5-D4-52-0E-41-A4-1F-73-88-F9-01\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.XDocument.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Xml.XDocument</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4B-5A-EC-05-10-C3-65-A3-7C-C5-D4-52-0E-41-A4-1F-73-88-F9-01\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.XDocument.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Xml.XDocument</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"68-1D-85-11-BD-EC-60-7F-F2-E8-83-FF-C6-D8-D9-CB-28-C8-8B-2A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Xml.Linq.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:30Z</ModuleTime>\n            <ModuleName>System.Private.Xml.Linq</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"68-1D-85-11-BD-EC-60-7F-F2-E8-83-FF-C6-D8-D9-CB-28-C8-8B-2A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Xml.Linq.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:30Z</ModuleTime>\n            <ModuleName>System.Private.Xml.Linq</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"55-8E-C2-A5-09-4D-3F-8C-11-59-AB-41-D5-05-B5-7B-8D-3A-AA-6E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"55-8E-C2-A5-09-4D-3F-8C-11-59-AB-41-D5-05-B5-7B-8D-3A-AA-6E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"81-0C-F3-3E-51-92-D0-E4-C7-7A-C4-D0-2E-C3-CC-6C-34-E6-D7-18\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Versioning.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:43:48Z</ModuleTime>\n            <ModuleName>NuGet.Versioning</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"81-0C-F3-3E-51-92-D0-E4-C7-7A-C4-D0-2E-C3-CC-6C-34-E6-D7-18\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Versioning.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:43:48Z</ModuleTime>\n            <ModuleName>NuGet.Versioning</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"81-0C-F3-3E-51-92-D0-E4-C7-7A-C4-D0-2E-C3-CC-6C-34-E6-D7-18\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Versioning.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:43:48Z</ModuleTime>\n            <ModuleName>NuGet.Versioning</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"43-64-EE-FB-2B-CB-04-44-D6-D5-68-E6-00-03-CA-34-D9-9A-35-C6\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Frameworks.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Frameworks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"43-64-EE-FB-2B-CB-04-44-D6-D5-68-E6-00-03-CA-34-D9-9A-35-C6\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Frameworks.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Frameworks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"43-64-EE-FB-2B-CB-04-44-D6-D5-68-E6-00-03-CA-34-D9-9A-35-C6\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Frameworks.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Frameworks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"3C-6B-ED-4B-FA-6C-10-19-4A-12-34-FC-E0-70-F3-70-7C-58-BD-82\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Newtonsoft.Json.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:43:48Z</ModuleTime>\n            <ModuleName>Newtonsoft.Json</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"6F-CC-2C-76-AC-42-0E-1D-29-DC-BE-AB-E0-6D-A4-C2-9D-0C-27-23\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Linq.Expressions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:18Z</ModuleTime>\n            <ModuleName>System.Linq.Expressions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"6D-0F-A0-D8-6E-D9-3D-12-46-84-DE-CC-44-CE-CF-2B-96-27-29-EA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.TypeConverter.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:32Z</ModuleTime>\n            <ModuleName>System.ComponentModel.TypeConverter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"18-71-46-94-36-55-BA-42-DC-70-B8-FB-CB-47-53-46-BC-07-97-6F\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Packaging.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Packaging</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8F-CA-FC-BE-CF-59-51-70-73-DF-FA-12-D9-07-FF-31-9C-F2-7B-3A\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.LibraryModel.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.LibraryModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8A-CB-B6-B3-E3-37-ED-90-BE-07-BD-2E-2B-E8-75-50-F6-12-63-7B\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Protocol.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Protocol</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"71-2C-E9-CA-85-B8-8F-D9-04-1B-18-26-60-00-6A-A4-C4-26-BB-A6\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Credentials.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:26Z</ModuleTime>\n            <ModuleName>NuGet.Credentials</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"03-E9-A6-34-43-87-E3-D3-27-29-CB-80-91-3F-B1-99-54-02-59-17\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.DependencyResolver.Core.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.DependencyResolver.Core</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"96-C7-5C-FC-1E-89-3E-67-F0-53-6B-39-C4-C0-61-BC-52-35-9C-A0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Serialization.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Serialization.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"6E-50-A1-2A-7E-70-B6-5C-B5-48-65-1E-90-FC-92-89-65-1A-F5-6F\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Numerics.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Numerics</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B3-44-E0-6E-7A-CB-1B-06-37-3E-84-75-01-86-B8-6B-40-5A-F6-CE\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.TestPlatform.Build.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:46Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.Build</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B3-44-E0-6E-7A-CB-1B-06-37-3E-84-75-01-86-B8-6B-40-5A-F6-CE\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.TestPlatform.Build.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:46Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.Build</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F2-84-10-73-D5-25-3C-C8-54-CA-05-A9-21-5F-EC-4F-D6-B7-11-E4\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\mscorlib.dll</ModulePath>\n            <ModuleTime>2020-02-21T02:00:46Z</ModuleTime>\n            <ModuleName>mscorlib</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F2-84-10-73-D5-25-3C-C8-54-CA-05-A9-21-5F-EC-4F-D6-B7-11-E4\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\mscorlib.dll</ModulePath>\n            <ModuleTime>2020-02-21T02:00:46Z</ModuleTime>\n            <ModuleName>mscorlib</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F0-C5-75-3F-22-17-B9-2C-E6-C3-3C-A7-4D-EE-AF-C8-FF-35-92-AC\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.CompilerServices.Unsafe.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Runtime.CompilerServices.Unsafe</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"36-E8-16-54-B7-19-BD-A8-2A-38-DC-64-7B-B6-08-2C-AE-DF-59-4A\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.ProjectModel.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:26Z</ModuleTime>\n            <ModuleName>NuGet.ProjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F0-C5-75-3F-22-17-B9-2C-E6-C3-3C-A7-4D-EE-AF-C8-FF-35-92-AC\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.CompilerServices.Unsafe.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Runtime.CompilerServices.Unsafe</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"36-E8-16-54-B7-19-BD-A8-2A-38-DC-64-7B-B6-08-2C-AE-DF-59-4A\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.ProjectModel.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:26Z</ModuleTime>\n            <ModuleName>NuGet.ProjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F2-84-10-73-D5-25-3C-C8-54-CA-05-A9-21-5F-EC-4F-D6-B7-11-E4\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\mscorlib.dll</ModulePath>\n            <ModuleTime>2020-02-21T02:00:46Z</ModuleTime>\n            <ModuleName>mscorlib</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"42-A4-D5-63-DA-C9-6B-42-3E-CF-98-F9-FB-80-3B-23-4D-E8-7E-B3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:34Z</ModuleTime>\n            <ModuleName>System.ComponentModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"42-A4-D5-63-DA-C9-6B-42-3E-CF-98-F9-FB-80-3B-23-4D-E8-7E-B3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:34Z</ModuleTime>\n            <ModuleName>System.ComponentModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B3-44-E0-6E-7A-CB-1B-06-37-3E-84-75-01-86-B8-6B-40-5A-F6-CE\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.TestPlatform.Build.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:46Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.Build</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"EF-F5-62-5F-AF-AF-B2-EE-AD-D8-B0-5F-2F-34-FF-0C-C9-DD-5C-66\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Tools.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:36Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Tools</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C1-41-1B-16-60-41-0D-35-CE-85-82-6D-04-AB-CE-5C-88-E8-BE-91\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:06Z</ModuleTime>\n            <ModuleName>System.IO</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A5-1D-73-D2-8D-F6-70-B7-B7-8B-00-F4-17-70-7F-2A-98-D3-1C-F9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Encoding.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Text.Encoding</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"CC-FC-9F-9B-3F-02-43-A8-4C-9F-1C-AD-15-23-EF-34-31-D4-A6-0C\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.Compression.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:40Z</ModuleTime>\n            <ModuleName>System.IO.Compression</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9E-63-EF-9A-D8-E6-C0-64-EB-31-79-F5-8C-35-7D-C2-C5-D2-94-7D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Http.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:44Z</ModuleTime>\n            <ModuleName>System.Net.Http</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2A-48-85-A6-03-C4-07-FD-29-10-28-5A-25-BF-0C-FA-03-A7-98-B2\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Net.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A5-D1-78-2C-3D-8D-E9-D4-52-E4-0C-B0-3D-34-F4-8D-7A-08-C6-C3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Security.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:26Z</ModuleTime>\n            <ModuleName>System.Net.Security</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2D-D2-58-DD-BA-4D-D9-A2-D8-99-CB-EF-60-05-5F-E6-2B-B1-A8-C7\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.X509Certificates.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.X509Certificates</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"36-E8-16-54-B7-19-BD-A8-2A-38-DC-64-7B-B6-08-2C-AE-DF-59-4A\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.ProjectModel.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:26Z</ModuleTime>\n            <ModuleName>NuGet.ProjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"81-0C-F3-3E-51-92-D0-E4-C7-7A-C4-D0-2E-C3-CC-6C-34-E6-D7-18\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Versioning.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:43:48Z</ModuleTime>\n            <ModuleName>NuGet.Versioning</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"18-71-46-94-36-55-BA-42-DC-70-B8-FB-CB-47-53-46-BC-07-97-6F\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Packaging.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Packaging</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"11-27-AE-76-EA-89-8D-78-90-4F-7C-8D-62-56-14-CD-EF-02-37-D9\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Common.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4F-0A-ED-F6-02-69-AD-2A-C5-2B-2C-93-BD-A8-93-87-63-5A-5E-FD\">\n            <ModulePath>BranchCoverage3296\\.sonarqube\\bin\\SonarScanner.MSBuild.Tasks.dll</ModulePath>\n            <ModuleTime>2019-11-06T10:01:08Z</ModuleTime>\n            <ModuleName>SonarScanner.MSBuild.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"06-FE-91-56-B3-97-3C-54-B4-DF-B8-F2-2C-63-4C-B2-7B-B5-56-11\">\n            <ModulePath>BranchCoverage3296\\.sonarqube\\bin\\SonarScanner.MSBuild.Common.dll</ModulePath>\n            <ModuleTime>2019-11-06T10:01:08Z</ModuleTime>\n            <ModuleName>SonarScanner.MSBuild.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"96-BE-1B-A1-47-C7-A9-22-1A-36-76-9C-CD-84-A9-47-AB-29-BF-1F\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.XmlSerializer.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Xml.XmlSerializer</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"06-80-9E-D1-73-4C-C3-26-E9-10-FB-BA-48-03-C8-00-F3-CE-AD-3F\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:30Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"\">\n            <ModulePath>RefEmit_InMemoryManifestModule</ModulePath>\n            <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n            <ModuleName>Microsoft.GeneratedCode</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"\">\n            <ModulePath>RefEmit_InMemoryManifestModule</ModulePath>\n            <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n            <ModuleName>Microsoft.GeneratedCode</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"22-28-72-75-40-0A-51-3A-66-C2-5F-6B-3C-7B-2D-19-EA-73-0E-B4\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Roslyn\\Microsoft.Build.Tasks.CodeAnalysis.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>Microsoft.Build.Tasks.CodeAnalysis</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"\">\n            <ModulePath>RefEmit_InMemoryManifestModule</ModulePath>\n            <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n            <ModuleName>Microsoft.GeneratedCode</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"81-0C-F3-3E-51-92-D0-E4-C7-7A-C4-D0-2E-C3-CC-6C-34-E6-D7-18\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Versioning.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:43:48Z</ModuleTime>\n            <ModuleName>NuGet.Versioning</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"81-0C-F3-3E-51-92-D0-E4-C7-7A-C4-D0-2E-C3-CC-6C-34-E6-D7-18\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Versioning.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:43:48Z</ModuleTime>\n            <ModuleName>NuGet.Versioning</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"18-71-46-94-36-55-BA-42-DC-70-B8-FB-CB-47-53-46-BC-07-97-6F\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Packaging.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Packaging</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"18-71-46-94-36-55-BA-42-DC-70-B8-FB-CB-47-53-46-BC-07-97-6F\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Packaging.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Packaging</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"11-27-AE-76-EA-89-8D-78-90-4F-7C-8D-62-56-14-CD-EF-02-37-D9\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Common.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"11-27-AE-76-EA-89-8D-78-90-4F-7C-8D-62-56-14-CD-EF-02-37-D9\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Common.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2A-48-85-A6-03-C4-07-FD-29-10-28-5A-25-BF-0C-FA-03-A7-98-B2\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Net.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2A-48-85-A6-03-C4-07-FD-29-10-28-5A-25-BF-0C-FA-03-A7-98-B2\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Net.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"88-C2-81-23-88-9B-01-F5-41-12-93-F2-07-C5-30-2F-E9-C7-6C-F6\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Core.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:34Z</ModuleTime>\n            <ModuleName>System.Core</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"88-C2-81-23-88-9B-01-F5-41-12-93-F2-07-C5-30-2F-E9-C7-6C-F6\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Core.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:34Z</ModuleTime>\n            <ModuleName>System.Core</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F5-4A-B0-89-01-16-50-65-5F-DD-4C-B5-70-9E-39-1A-D1-B7-FE-38\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Metadata.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Metadata</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F5-4A-B0-89-01-16-50-65-5F-DD-4C-B5-70-9E-39-1A-D1-B7-FE-38\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Metadata.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Metadata</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"ED-AD-51-03-F6-38-CC-C2-AA-8C-6C-A7-26-44-05-C3-B7-66-2C-5B\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.MemoryMappedFiles.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:04Z</ModuleTime>\n            <ModuleName>System.IO.MemoryMappedFiles</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"ED-AD-51-03-F6-38-CC-C2-AA-8C-6C-A7-26-44-05-C3-B7-66-2C-5B\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.MemoryMappedFiles.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:04Z</ModuleTime>\n            <ModuleName>System.IO.MemoryMappedFiles</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4F-0A-ED-F6-02-69-AD-2A-C5-2B-2C-93-BD-A8-93-87-63-5A-5E-FD\">\n            <ModulePath>BranchCoverage3296\\.sonarqube\\bin\\SonarScanner.MSBuild.Tasks.dll</ModulePath>\n            <ModuleTime>2019-11-06T10:01:08Z</ModuleTime>\n            <ModuleName>SonarScanner.MSBuild.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"06-FE-91-56-B3-97-3C-54-B4-DF-B8-F2-2C-63-4C-B2-7B-B5-56-11\">\n            <ModulePath>BranchCoverage3296\\.sonarqube\\bin\\SonarScanner.MSBuild.Common.dll</ModulePath>\n            <ModuleTime>2019-11-06T10:01:08Z</ModuleTime>\n            <ModuleName>SonarScanner.MSBuild.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4F-0A-ED-F6-02-69-AD-2A-C5-2B-2C-93-BD-A8-93-87-63-5A-5E-FD\">\n            <ModulePath>BranchCoverage3296\\.sonarqube\\bin\\SonarScanner.MSBuild.Tasks.dll</ModulePath>\n            <ModuleTime>2019-11-06T10:01:08Z</ModuleTime>\n            <ModuleName>SonarScanner.MSBuild.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"06-FE-91-56-B3-97-3C-54-B4-DF-B8-F2-2C-63-4C-B2-7B-B5-56-11\">\n            <ModulePath>BranchCoverage3296\\.sonarqube\\bin\\SonarScanner.MSBuild.Common.dll</ModulePath>\n            <ModuleTime>2019-11-06T10:01:08Z</ModuleTime>\n            <ModuleName>SonarScanner.MSBuild.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"96-BE-1B-A1-47-C7-A9-22-1A-36-76-9C-CD-84-A9-47-AB-29-BF-1F\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.XmlSerializer.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Xml.XmlSerializer</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"96-BE-1B-A1-47-C7-A9-22-1A-36-76-9C-CD-84-A9-47-AB-29-BF-1F\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.XmlSerializer.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Xml.XmlSerializer</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"06-80-9E-D1-73-4C-C3-26-E9-10-FB-BA-48-03-C8-00-F3-CE-AD-3F\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:30Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"\">\n            <ModulePath>RefEmit_InMemoryManifestModule</ModulePath>\n            <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n            <ModuleName>Microsoft.GeneratedCode</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"06-80-9E-D1-73-4C-C3-26-E9-10-FB-BA-48-03-C8-00-F3-CE-AD-3F\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:30Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"\">\n            <ModulePath>RefEmit_InMemoryManifestModule</ModulePath>\n            <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n            <ModuleName>Microsoft.GeneratedCode</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"22-28-72-75-40-0A-51-3A-66-C2-5F-6B-3C-7B-2D-19-EA-73-0E-B4\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Roslyn\\Microsoft.Build.Tasks.CodeAnalysis.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>Microsoft.Build.Tasks.CodeAnalysis</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"22-28-72-75-40-0A-51-3A-66-C2-5F-6B-3C-7B-2D-19-EA-73-0E-B4\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Roslyn\\Microsoft.Build.Tasks.CodeAnalysis.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>Microsoft.Build.Tasks.CodeAnalysis</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"\">\n            <ModulePath>RefEmit_InMemoryManifestModule</ModulePath>\n            <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n            <ModuleName>Microsoft.GeneratedCode</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"\">\n            <ModulePath>RefEmit_InMemoryManifestModule</ModulePath>\n            <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n            <ModuleName>Microsoft.GeneratedCode</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"19-DB-E7-26-74-3E-B8-3C-B9-3E-89-49-9F-20-99-D9-CF-23-FD-17\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.CoreLib.dll</ModulePath>\n            <ModuleTime>2020-02-18T20:16:14Z</ModuleTime>\n            <ModuleName>System.Private.CoreLib</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"19-DB-E7-26-74-3E-B8-3C-B9-3E-89-49-9F-20-99-D9-CF-23-FD-17\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.CoreLib.dll</ModulePath>\n            <ModuleTime>2020-02-18T20:16:14Z</ModuleTime>\n            <ModuleName>System.Private.CoreLib</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C5-B4-6F-68-5D-85-FF-B9-B3-F6-E7-E5-87-BC-47-13-C3-03-85-42\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\vstest.console.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:43:48Z</ModuleTime>\n            <ModuleName>vstest.console</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"45-AE-FF-2D-9F-D9-14-AE-5E-58-BC-AD-59-3F-6B-E0-C7-F9-45-CA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Runtime</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C5-B4-6F-68-5D-85-FF-B9-B3-F6-E7-E5-87-BC-47-13-C3-03-85-42\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\vstest.console.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:43:48Z</ModuleTime>\n            <ModuleName>vstest.console</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"45-AE-FF-2D-9F-D9-14-AE-5E-58-BC-AD-59-3F-6B-E0-C7-F9-45-CA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Runtime</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4D-33-53-11-50-36-83-92-2B-29-8C-5A-FA-19-EF-5A-D4-AA-32-80\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Process.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:38Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Process</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E5-F8-08-77-40-69-F3-B4-39-9E-F4-4F-30-35-FF-75-AD-66-E9-C9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:34Z</ModuleTime>\n            <ModuleName>System.ComponentModel.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B8-01-4B-08-49-01-14-1F-52-C1-06-1B-E1-C4-DA-8C-8C-15-88-14\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"92-D6-1E-14-62-24-DB-73-F3-A0-87-8B-5C-9C-71-AE-8C-A6-49-86\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.TestPlatform.CoreUtilities.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:48Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.CoreUtilities</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-0A-47-0B-10-27-7A-98-D6-A5-5B-EC-1C-35-91-93-AB-C0-35-65\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\netstandard.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>netstandard</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"32-77-95-87-72-D8-6D-43-AA-DA-36-9B-86-D6-99-7F-41-0E-CF-A5\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Debug.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Debug</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A3-6E-3F-5C-23-E9-CE-D4-59-A4-79-82-3A-A2-A6-D2-A6-37-0E-C2\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Thread.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.Thread</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4D-33-53-11-50-36-83-92-2B-29-8C-5A-FA-19-EF-5A-D4-AA-32-80\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Process.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:38Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Process</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E5-F8-08-77-40-69-F3-B4-39-9E-F4-4F-30-35-FF-75-AD-66-E9-C9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:34Z</ModuleTime>\n            <ModuleName>System.ComponentModel.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9C-68-F9-D9-5D-09-7B-AC-36-D7-6D-25-3D-17-F3-72-E5-1A-87-F0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:06Z</ModuleTime>\n            <ModuleName>System.Threading</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B8-01-4B-08-49-01-14-1F-52-C1-06-1B-E1-C4-DA-8C-8C-15-88-14\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"32-5D-5E-82-60-49-7F-5D-44-D4-1E-BF-57-95-6F-D8-30-A6-C2-E1\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Console.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n            <ModuleName>System.Console</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"92-D6-1E-14-62-24-DB-73-F3-A0-87-8B-5C-9C-71-AE-8C-A6-49-86\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.TestPlatform.CoreUtilities.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:48Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.CoreUtilities</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-0A-47-0B-10-27-7A-98-D6-A5-5B-EC-1C-35-91-93-AB-C0-35-65\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\netstandard.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>netstandard</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"32-77-95-87-72-D8-6D-43-AA-DA-36-9B-86-D6-99-7F-41-0E-CF-A5\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Debug.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Debug</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A3-6E-3F-5C-23-E9-CE-D4-59-A4-79-82-3A-A2-A6-D2-A6-37-0E-C2\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Thread.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.Thread</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4E-96-5A-FC-C0-BE-6F-D4-A5-9C-B4-F8-33-D5-85-D1-B9-07-9F-89\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Encoding.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Text.Encoding.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9C-68-F9-D9-5D-09-7B-AC-36-D7-6D-25-3D-17-F3-72-E5-1A-87-F0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:06Z</ModuleTime>\n            <ModuleName>System.Threading</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"32-5D-5E-82-60-49-7F-5D-44-D4-1E-BF-57-95-6F-D8-30-A6-C2-E1\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Console.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n            <ModuleName>System.Console</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4E-96-5A-FC-C0-BE-6F-D4-A5-9C-B4-F8-33-D5-85-D1-B9-07-9F-89\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Encoding.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Text.Encoding.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D3-FC-01-5E-22-55-B9-FD-FB-0D-0E-A5-B8-58-05-D8-DC-D2-F5-24\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Tracing.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:36Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Tracing</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D3-FC-01-5E-22-55-B9-FD-FB-0D-0E-A5-B8-58-05-D8-DC-D2-F5-24\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Tracing.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:36Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Tracing</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8B-E9-5A-2E-CC-DB-5C-E1-03-05-BA-E1-31-A9-9D-6F-18-10-50-AA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Collections</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B9-FF-45-54-97-94-E5-EE-F1-55-1C-4C-1D-ED-C5-F1-4E-56-04-D6\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:22Z</ModuleTime>\n            <ModuleName>Microsoft.VisualStudio.TestPlatform.ObjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F4-74-D8-EC-37-07-89-F7-DE-41-4A-0C-45-90-94-9E-A5-09-14-06\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.VisualStudio.TestPlatform.Client.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:22Z</ModuleTime>\n            <ModuleName>Microsoft.VisualStudio.TestPlatform.Client</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4C-5D-3E-A4-C6-A7-88-97-E0-76-1D-3C-13-D7-AB-BC-57-B4-67-F9\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.VisualStudio.TestPlatform.Common.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:47:02Z</ModuleTime>\n            <ModuleName>Microsoft.VisualStudio.TestPlatform.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"33-87-51-E6-2F-8C-BE-1D-5B-B2-9E-51-10-1B-05-40-2C-E3-E8-1A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Linq.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:40Z</ModuleTime>\n            <ModuleName>System.Linq</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8B-E9-5A-2E-CC-DB-5C-E1-03-05-BA-E1-31-A9-9D-6F-18-10-50-AA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Collections</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B9-FF-45-54-97-94-E5-EE-F1-55-1C-4C-1D-ED-C5-F1-4E-56-04-D6\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:22Z</ModuleTime>\n            <ModuleName>Microsoft.VisualStudio.TestPlatform.ObjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F4-74-D8-EC-37-07-89-F7-DE-41-4A-0C-45-90-94-9E-A5-09-14-06\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.VisualStudio.TestPlatform.Client.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:22Z</ModuleTime>\n            <ModuleName>Microsoft.VisualStudio.TestPlatform.Client</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B9-08-B2-09-3C-61-2C-3E-62-03-05-65-93-6A-84-E5-2C-0D-A7-F4\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.InteropServices.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4C-5D-3E-A4-C6-A7-88-97-E0-76-1D-3C-13-D7-AB-BC-57-B4-67-F9\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.VisualStudio.TestPlatform.Common.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:47:02Z</ModuleTime>\n            <ModuleName>Microsoft.VisualStudio.TestPlatform.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"57-E8-B3-F8-DB-88-F2-FB-81-BE-34-C3-AD-1E-D4-F0-DD-F0-59-D3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Resources.ResourceManager.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Resources.ResourceManager</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"33-87-51-E6-2F-8C-BE-1D-5B-B2-9E-51-10-1B-05-40-2C-E3-E8-1A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Linq.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:40Z</ModuleTime>\n            <ModuleName>System.Linq</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B9-08-B2-09-3C-61-2C-3E-62-03-05-65-93-6A-84-E5-2C-0D-A7-F4\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.InteropServices.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"57-E8-B3-F8-DB-88-F2-FB-81-BE-34-C3-AD-1E-D4-F0-DD-F0-59-D3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Resources.ResourceManager.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Resources.ResourceManager</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A6-81-2A-5B-4A-3D-C8-4D-49-04-DE-1F-DF-02-7C-B4-43-51-DE-1C\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.FileSystem.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.IO.FileSystem</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A6-81-2A-5B-4A-3D-C8-4D-49-04-DE-1F-DF-02-7C-B4-43-51-DE-1C\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.FileSystem.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.IO.FileSystem</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2F-E1-13-B8-1E-10-AE-79-4A-CD-F8-AE-C1-F1-E8-22-10-2F-61-17\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.ReaderWriter.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Xml.ReaderWriter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2F-E1-13-B8-1E-10-AE-79-4A-CD-F8-AE-C1-F1-E8-22-10-2F-61-17\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.ReaderWriter.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Xml.ReaderWriter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"1F-BD-6F-06-01-11-FA-A9-DB-0B-12-95-1E-A0-B6-62-C2-59-ED-05\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Xml.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:38Z</ModuleTime>\n            <ModuleName>System.Private.Xml</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C0-AF-8F-C2-7E-FA-FB-83-67-D3-56-10-08-BB-63-E8-4F-C8-F0-D3\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.TestPlatform.PlatformAbstractions.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:48Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.PlatformAbstractions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"25-FA-4B-8B-8A-A0-0A-BA-5F-16-77-6A-F8-D1-03-FD-B2-46-A8-11\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.TestPlatform.Utilities.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:22Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.Utilities</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"26-14-D7-B5-EB-43-C2-76-01-4F-01-5E-7B-A4-CE-E9-EB-E3-AA-B9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.InteropServices.RuntimeInformation.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices.RuntimeInformation</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"1F-BD-6F-06-01-11-FA-A9-DB-0B-12-95-1E-A0-B6-62-C2-59-ED-05\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Xml.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:38Z</ModuleTime>\n            <ModuleName>System.Private.Xml</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C0-AF-8F-C2-7E-FA-FB-83-67-D3-56-10-08-BB-63-E8-4F-C8-F0-D3\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.TestPlatform.PlatformAbstractions.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:48Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.PlatformAbstractions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"25-FA-4B-8B-8A-A0-0A-BA-5F-16-77-6A-F8-D1-03-FD-B2-46-A8-11\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.TestPlatform.Utilities.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:22Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.Utilities</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"26-14-D7-B5-EB-43-C2-76-01-4F-01-5E-7B-A4-CE-E9-EB-E3-AA-B9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.InteropServices.RuntimeInformation.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices.RuntimeInformation</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"43-64-EE-FB-2B-CB-04-44-D6-D5-68-E6-00-03-CA-34-D9-9A-35-C6\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Frameworks.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Frameworks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"43-64-EE-FB-2B-CB-04-44-D6-D5-68-E6-00-03-CA-34-D9-9A-35-C6\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Frameworks.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Frameworks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D5-0A-67-87-14-54-BA-3A-F2-2A-2A-B8-15-CE-D1-74-51-44-E5-FC\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Uri.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:26Z</ModuleTime>\n            <ModuleName>System.Private.Uri</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"AF-4F-3B-E9-D2-80-A0-2E-91-5B-AF-17-34-A9-F1-A6-32-C4-EC-4E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Memory.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Memory</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D5-0A-67-87-14-54-BA-3A-F2-2A-2A-B8-15-CE-D1-74-51-44-E5-FC\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Uri.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:26Z</ModuleTime>\n            <ModuleName>System.Private.Uri</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-F9-21-BB-3C-07-A4-DA-5A-43-89-51-EB-E0-A4-B9-2F-19-F6-7D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.Algorithms.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Algorithms</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"AF-4F-3B-E9-D2-80-A0-2E-91-5B-AF-17-34-A9-F1-A6-32-C4-EC-4E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Memory.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Memory</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-F9-21-BB-3C-07-A4-DA-5A-43-89-51-EB-E0-A4-B9-2F-19-F6-7D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.Algorithms.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Algorithms</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"66-55-F3-9A-C4-53-63-95-5F-60-D2-19-0F-7E-3B-2B-85-46-FB-8D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.TraceSource.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Diagnostics.TraceSource</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"66-55-F3-9A-C4-53-63-95-5F-60-D2-19-0F-7E-3B-2B-85-46-FB-8D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.TraceSource.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Diagnostics.TraceSource</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FC-9A-A3-24-E8-48-FF-9E-1A-D8-C2-B3-54-1E-A8-DD-B2-E1-E3-96\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.ThreadPool.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.ThreadPool</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5E-EA-96-C3-0B-C7-BF-BA-AE-4A-27-D8-9A-9A-67-A2-72-BF-89-1F\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.NonGeneric.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:32Z</ModuleTime>\n            <ModuleName>System.Collections.NonGeneric</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FC-9A-A3-24-E8-48-FF-9E-1A-D8-C2-B3-54-1E-A8-DD-B2-E1-E3-96\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.ThreadPool.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.ThreadPool</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5E-EA-96-C3-0B-C7-BF-BA-AE-4A-27-D8-9A-9A-67-A2-72-BF-89-1F\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.NonGeneric.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:32Z</ModuleTime>\n            <ModuleName>System.Collections.NonGeneric</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5D-6D-F0-C2-3B-E4-3D-F4-31-9F-65-26-E3-6C-69-57-41-07-04-68\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.Extensions.FileSystemGlobbing.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:42Z</ModuleTime>\n            <ModuleName>Microsoft.Extensions.FileSystemGlobbing</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5D-6D-F0-C2-3B-E4-3D-F4-31-9F-65-26-E3-6C-69-57-41-07-04-68\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.Extensions.FileSystemGlobbing.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:42Z</ModuleTime>\n            <ModuleName>Microsoft.Extensions.FileSystemGlobbing</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F6-E7-29-AB-39-E0-7C-13-70-CF-AC-B2-AB-D0-49-87-2A-34-C1-64\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.TestPlatform.CrossPlatEngine.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:22Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.CrossPlatEngine</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F6-E7-29-AB-39-E0-7C-13-70-CF-AC-B2-AB-D0-49-87-2A-34-C1-64\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.TestPlatform.CrossPlatEngine.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:22Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.CrossPlatEngine</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"3D-ED-2E-29-0D-BD-86-B5-75-96-FF-B0-C8-9D-AD-4E-5B-94-58-57\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Loader.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Loader</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"3D-ED-2E-29-0D-BD-86-B5-75-96-FF-B0-C8-9D-AD-4E-5B-94-58-57\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Loader.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Loader</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4A-53-F5-47-1F-79-0D-C2-A0-C2-4E-CF-CA-18-30-0C-4C-0B-1E-EB\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Extensions\\Microsoft.TestPlatform.Extensions.BlameDataCollector.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:32Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.Extensions.BlameDataCollector</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"04-77-E0-D3-40-DA-95-B9-FC-B5-A1-54-7E-38-5B-86-0D-1B-18-A2\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Extensions\\Microsoft.TestPlatform.Extensions.EventLogCollector.dll</ModulePath>\n            <ModuleTime>2020-02-04T18:55:20Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.Extensions.EventLogCollector</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F2-84-10-73-D5-25-3C-C8-54-CA-05-A9-21-5F-EC-4F-D6-B7-11-E4\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\mscorlib.dll</ModulePath>\n            <ModuleTime>2020-02-21T02:00:46Z</ModuleTime>\n            <ModuleName>mscorlib</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"73-E1-7F-C7-2D-C9-99-D8-D5-D4-21-69-B8-EB-65-4F-5D-EE-9F-B3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:26Z</ModuleTime>\n            <ModuleName>System.Xml</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4A-53-F5-47-1F-79-0D-C2-A0-C2-4E-CF-CA-18-30-0C-4C-0B-1E-EB\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Extensions\\Microsoft.TestPlatform.Extensions.BlameDataCollector.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:32Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.Extensions.BlameDataCollector</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8F-10-3B-1F-DD-91-01-95-79-0E-F6-D0-4B-B1-E9-93-CF-9F-3A-18\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Extensions\\Microsoft.TestPlatform.TestHostRuntimeProvider.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:40Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.TestHostRuntimeProvider</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"23-F9-09-16-3B-71-58-F5-A7-35-CA-89-4D-75-0F-3D-D0-23-DC-EB\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Tasks.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Threading.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"04-77-E0-D3-40-DA-95-B9-FC-B5-A1-54-7E-38-5B-86-0D-1B-18-A2\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Extensions\\Microsoft.TestPlatform.Extensions.EventLogCollector.dll</ModulePath>\n            <ModuleTime>2020-02-04T18:55:20Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.Extensions.EventLogCollector</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F2-84-10-73-D5-25-3C-C8-54-CA-05-A9-21-5F-EC-4F-D6-B7-11-E4\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\mscorlib.dll</ModulePath>\n            <ModuleTime>2020-02-21T02:00:46Z</ModuleTime>\n            <ModuleName>mscorlib</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"73-E1-7F-C7-2D-C9-99-D8-D5-D4-21-69-B8-EB-65-4F-5D-EE-9F-B3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:26Z</ModuleTime>\n            <ModuleName>System.Xml</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8F-10-3B-1F-DD-91-01-95-79-0E-F6-D0-4B-B1-E9-93-CF-9F-3A-18\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Extensions\\Microsoft.TestPlatform.TestHostRuntimeProvider.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:40Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.TestHostRuntimeProvider</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"23-F9-09-16-3B-71-58-F5-A7-35-CA-89-4D-75-0F-3D-D0-23-DC-EB\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Tasks.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Threading.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"17-93-DD-90-A8-82-7B-57-C3-76-20-97-82-80-AF-83-9B-1C-6C-60\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.Html.TestLogger.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:36Z</ModuleTime>\n            <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.Html.TestLogger</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FF-FA-57-35-2E-F1-77-97-83-A6-16-E9-B4-A3-70-07-E7-9C-31-25\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:36Z</ModuleTime>\n            <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"17-93-DD-90-A8-82-7B-57-C3-76-20-97-82-80-AF-83-9B-1C-6C-60\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.Html.TestLogger.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:36Z</ModuleTime>\n            <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.Html.TestLogger</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FF-FA-57-35-2E-F1-77-97-83-A6-16-E9-B4-A3-70-07-E7-9C-31-25\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:36Z</ModuleTime>\n            <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F5-4A-B0-89-01-16-50-65-5F-DD-4C-B5-70-9E-39-1A-D1-B7-FE-38\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Metadata.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Metadata</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"01-AB-1F-C1-0A-AD-1A-D5-69-41-9D-4B-4E-1C-6F-AC-59-05-9A-48\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Immutable.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>System.Collections.Immutable</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F5-4A-B0-89-01-16-50-65-5F-DD-4C-B5-70-9E-39-1A-D1-B7-FE-38\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Metadata.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Metadata</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"01-AB-1F-C1-0A-AD-1A-D5-69-41-9D-4B-4E-1C-6F-AC-59-05-9A-48\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Immutable.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>System.Collections.Immutable</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4E-A9-32-5A-D2-0F-84-D8-73-42-C7-0B-6A-3C-7B-C0-89-B7-20-01\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\Microsoft.Win32.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n            <ModuleName>Microsoft.Win32.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4E-A9-32-5A-D2-0F-84-D8-73-42-C7-0B-6A-3C-7B-C0-89-B7-20-01\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\Microsoft.Win32.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n            <ModuleName>Microsoft.Win32.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8F-A1-95-7C-65-A0-95-11-53-8D-DF-11-6D-3C-AD-5D-AE-2F-D3-73\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Concurrent.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>System.Collections.Concurrent</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8F-A1-95-7C-65-A0-95-11-53-8D-DF-11-6D-3C-AD-5D-AE-2F-D3-73\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Concurrent.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>System.Collections.Concurrent</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9D-25-19-27-36-F6-C2-E1-00-4F-1C-5A-3B-B4-6F-F9-7F-69-AB-4E\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.TestPlatform.CommunicationUtilities.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:48Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.CommunicationUtilities</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9D-25-19-27-36-F6-C2-E1-00-4F-1C-5A-3B-B4-6F-F9-7F-69-AB-4E\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.TestPlatform.CommunicationUtilities.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:48Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.CommunicationUtilities</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"3C-6B-ED-4B-FA-6C-10-19-4A-12-34-FC-E0-70-F3-70-7C-58-BD-82\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Newtonsoft.Json.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:43:48Z</ModuleTime>\n            <ModuleName>Newtonsoft.Json</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B6-58-2E-A2-A7-DF-F0-53-14-F6-45-D8-42-D5-5A-6B-69-F7-12-C9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Serialization.Formatters.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Serialization.Formatters</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"3C-6B-ED-4B-FA-6C-10-19-4A-12-34-FC-E0-70-F3-70-7C-58-BD-82\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Newtonsoft.Json.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:43:48Z</ModuleTime>\n            <ModuleName>Newtonsoft.Json</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B6-58-2E-A2-A7-DF-F0-53-14-F6-45-D8-42-D5-5A-6B-69-F7-12-C9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Serialization.Formatters.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Serialization.Formatters</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"25-17-3D-BA-13-03-55-32-76-CF-3D-AE-B3-52-14-5F-95-F5-3E-85\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Timer.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.Timer</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"25-17-3D-BA-13-03-55-32-76-CF-3D-AE-B3-52-14-5F-95-F5-3E-85\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Timer.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.Timer</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2A-48-85-A6-03-C4-07-FD-29-10-28-5A-25-BF-0C-FA-03-A7-98-B2\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Net.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"EE-DF-4B-C9-A1-40-03-5F-56-1A-DB-D7-E8-A0-BC-A6-12-34-84-1E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Sockets.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:08Z</ModuleTime>\n            <ModuleName>System.Net.Sockets</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2A-48-85-A6-03-C4-07-FD-29-10-28-5A-25-BF-0C-FA-03-A7-98-B2\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Net.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"EE-DF-4B-C9-A1-40-03-5F-56-1A-DB-D7-E8-A0-BC-A6-12-34-84-1E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Sockets.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:08Z</ModuleTime>\n            <ModuleName>System.Net.Sockets</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"87-6E-54-67-71-53-FA-C9-68-88-0D-C1-82-45-BE-68-5A-25-55-32\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Overlapped.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Threading.Overlapped</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E6-CE-DF-D3-05-01-F5-61-41-53-0C-FF-2C-87-01-04-6E-EB-B1-C7\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.NameResolution.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:40Z</ModuleTime>\n            <ModuleName>System.Net.NameResolution</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"87-6E-54-67-71-53-FA-C9-68-88-0D-C1-82-45-BE-68-5A-25-55-32\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Overlapped.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Threading.Overlapped</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E6-CE-DF-D3-05-01-F5-61-41-53-0C-FF-2C-87-01-04-6E-EB-B1-C7\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.NameResolution.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:40Z</ModuleTime>\n            <ModuleName>System.Net.NameResolution</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"0C-3A-E6-E1-38-B5-90-C7-A4-B2-35-FE-13-D9-F0-F4-22-8C-DD-7F\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.Extensions.DependencyModel.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:44Z</ModuleTime>\n            <ModuleName>Microsoft.Extensions.DependencyModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"0C-3A-E6-E1-38-B5-90-C7-A4-B2-35-FE-13-D9-F0-F4-22-8C-DD-7F\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.Extensions.DependencyModel.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:44Z</ModuleTime>\n            <ModuleName>Microsoft.Extensions.DependencyModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"6F-CC-2C-76-AC-42-0E-1D-29-DC-BE-AB-E0-6D-A4-C2-9D-0C-27-23\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Linq.Expressions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:18Z</ModuleTime>\n            <ModuleName>System.Linq.Expressions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"6F-CC-2C-76-AC-42-0E-1D-29-DC-BE-AB-E0-6D-A4-C2-9D-0C-27-23\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Linq.Expressions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:18Z</ModuleTime>\n            <ModuleName>System.Linq.Expressions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"6D-0F-A0-D8-6E-D9-3D-12-46-84-DE-CC-44-CE-CF-2B-96-27-29-EA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.TypeConverter.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:32Z</ModuleTime>\n            <ModuleName>System.ComponentModel.TypeConverter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"22-BD-0E-BF-F3-50-23-F4-33-69-45-CA-85-5A-41-AA-FF-98-13-6A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ObjectModel.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.ObjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"6D-0F-A0-D8-6E-D9-3D-12-46-84-DE-CC-44-CE-CF-2B-96-27-29-EA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.TypeConverter.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:32Z</ModuleTime>\n            <ModuleName>System.ComponentModel.TypeConverter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"22-BD-0E-BF-F3-50-23-F4-33-69-45-CA-85-5A-41-AA-FF-98-13-6A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ObjectModel.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.ObjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B8-EE-9E-7D-BB-C0-BA-51-7E-90-FD-C9-D6-FD-CC-4E-A0-46-68-9C\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Json.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n            <ModuleName>System.Text.Json</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"CE-43-2B-40-C0-FF-2C-68-D3-CF-AF-49-07-37-DC-D7-AA-AB-17-F3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Buffers.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:26Z</ModuleTime>\n            <ModuleName>System.Buffers</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B8-EE-9E-7D-BB-C0-BA-51-7E-90-FD-C9-D6-FD-CC-4E-A0-46-68-9C\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Json.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n            <ModuleName>System.Text.Json</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"CE-43-2B-40-C0-FF-2C-68-D3-CF-AF-49-07-37-DC-D7-AA-AB-17-F3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Buffers.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:26Z</ModuleTime>\n            <ModuleName>System.Buffers</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"CE-06-D3-2E-A9-D1-DF-9B-77-17-06-81-56-37-0F-29-3C-26-3C-CF\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Numerics.Vectors.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Numerics.Vectors</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F0-C5-75-3F-22-17-B9-2C-E6-C3-3C-A7-4D-EE-AF-C8-FF-35-92-AC\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.CompilerServices.Unsafe.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Runtime.CompilerServices.Unsafe</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"CE-06-D3-2E-A9-D1-DF-9B-77-17-06-81-56-37-0F-29-3C-26-3C-CF\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Numerics.Vectors.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Numerics.Vectors</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F0-C5-75-3F-22-17-B9-2C-E6-C3-3C-A7-4D-EE-AF-C8-FF-35-92-AC\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.CompilerServices.Unsafe.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Runtime.CompilerServices.Unsafe</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"6E-50-A1-2A-7E-70-B6-5C-B5-48-65-1E-90-FC-92-89-65-1A-F5-6F\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Numerics.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Numerics</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"6E-50-A1-2A-7E-70-B6-5C-B5-48-65-1E-90-FC-92-89-65-1A-F5-6F\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Numerics.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Numerics</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"19-DB-E7-26-74-3E-B8-3C-B9-3E-89-49-9F-20-99-D9-CF-23-FD-17\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.CoreLib.dll</ModulePath>\n            <ModuleTime>2020-02-18T20:16:14Z</ModuleTime>\n            <ModuleName>System.Private.CoreLib</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"19-DB-E7-26-74-3E-B8-3C-B9-3E-89-49-9F-20-99-D9-CF-23-FD-17\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.CoreLib.dll</ModulePath>\n            <ModuleTime>2020-02-18T20:16:14Z</ModuleTime>\n            <ModuleName>System.Private.CoreLib</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"7D-3A-F3-83-6D-97-74-27-C8-E9-63-BA-8D-D0-48-3C-92-E3-0F-27\">\n            <ModulePath>D:\\tools\\nuget\\microsoft.testplatform.testhost\\16.4.0\\build\\netcoreapp2.1\\x64\\testhost.dll</ModulePath>\n            <ModuleTime>2019-10-24T23:20:02Z</ModuleTime>\n            <ModuleName>testhost</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"45-AE-FF-2D-9F-D9-14-AE-5E-58-BC-AD-59-3F-6B-E0-C7-F9-45-CA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Runtime</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"7D-3A-F3-83-6D-97-74-27-C8-E9-63-BA-8D-D0-48-3C-92-E3-0F-27\">\n            <ModulePath>D:\\tools\\nuget\\microsoft.testplatform.testhost\\16.4.0\\build\\netcoreapp2.1\\x64\\testhost.dll</ModulePath>\n            <ModuleTime>2019-10-24T23:20:02Z</ModuleTime>\n            <ModuleName>testhost</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"45-AE-FF-2D-9F-D9-14-AE-5E-58-BC-AD-59-3F-6B-E0-C7-F9-45-CA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Runtime</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"82-51-73-4E-B7-D2-16-2E-C0-8E-C4-E6-62-93-07-C8-18-AE-1F-E3\">\n            <ModulePath>BranchCoverage3296\\SecondTestSuite\\bin\\Debug\\netcoreapp3.1\\Microsoft.TestPlatform.CoreUtilities.dll</ModulePath>\n            <ModuleTime>2019-10-24T23:20:00Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.CoreUtilities</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-0A-47-0B-10-27-7A-98-D6-A5-5B-EC-1C-35-91-93-AB-C0-35-65\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\netstandard.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>netstandard</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D3-FC-01-5E-22-55-B9-FD-FB-0D-0E-A5-B8-58-05-D8-DC-D2-F5-24\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Tracing.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:36Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Tracing</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"82-51-73-4E-B7-D2-16-2E-C0-8E-C4-E6-62-93-07-C8-18-AE-1F-E3\">\n            <ModulePath>BranchCoverage3296\\FirstTestSuite\\bin\\Debug\\netcoreapp3.1\\Microsoft.TestPlatform.CoreUtilities.dll</ModulePath>\n            <ModuleTime>2019-10-24T23:20:00Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.CoreUtilities</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-0A-47-0B-10-27-7A-98-D6-A5-5B-EC-1C-35-91-93-AB-C0-35-65\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\netstandard.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>netstandard</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D3-FC-01-5E-22-55-B9-FD-FB-0D-0E-A5-B8-58-05-D8-DC-D2-F5-24\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Tracing.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:36Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Tracing</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"3C-3B-BB-1E-4C-23-A0-8A-AE-82-07-50-C4-BD-55-77-FD-48-A8-43\">\n            <ModulePath>BranchCoverage3296\\SecondTestSuite\\bin\\Debug\\netcoreapp3.1\\Microsoft.TestPlatform.PlatformAbstractions.dll</ModulePath>\n            <ModuleTime>2019-10-24T23:20:00Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.PlatformAbstractions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B8-01-4B-08-49-01-14-1F-52-C1-06-1B-E1-C4-DA-8C-8C-15-88-14\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"32-77-95-87-72-D8-6D-43-AA-DA-36-9B-86-D6-99-7F-41-0E-CF-A5\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Debug.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Debug</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8B-E9-5A-2E-CC-DB-5C-E1-03-05-BA-E1-31-A9-9D-6F-18-10-50-AA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Collections</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A3-8E-CE-5F-4A-F0-53-BF-7A-86-29-F3-60-31-4E-C2-C7-92-64-BF\">\n            <ModulePath>BranchCoverage3296\\SecondTestSuite\\bin\\Debug\\netcoreapp3.1\\Microsoft.TestPlatform.CrossPlatEngine.dll</ModulePath>\n            <ModuleTime>2019-10-24T23:20:02Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.CrossPlatEngine</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"3A-01-82-3D-B5-F1-23-E3-44-29-52-01-DD-EB-29-DB-C4-C5-8C-CE\">\n            <ModulePath>BranchCoverage3296\\SecondTestSuite\\bin\\Debug\\netcoreapp3.1\\Microsoft.TestPlatform.CommunicationUtilities.dll</ModulePath>\n            <ModuleTime>2019-10-24T23:20:02Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.CommunicationUtilities</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"3C-3B-BB-1E-4C-23-A0-8A-AE-82-07-50-C4-BD-55-77-FD-48-A8-43\">\n            <ModulePath>BranchCoverage3296\\FirstTestSuite\\bin\\Debug\\netcoreapp3.1\\Microsoft.TestPlatform.PlatformAbstractions.dll</ModulePath>\n            <ModuleTime>2019-10-24T23:20:00Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.PlatformAbstractions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"51-13-D1-D9-16-6E-B7-32-DA-55-E3-B7-9D-7A-18-56-62-3D-30-3F\">\n            <ModulePath>BranchCoverage3296\\SecondTestSuite\\bin\\Debug\\netcoreapp3.1\\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll</ModulePath>\n            <ModuleTime>2019-10-24T23:20:00Z</ModuleTime>\n            <ModuleName>Microsoft.VisualStudio.TestPlatform.ObjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B8-01-4B-08-49-01-14-1F-52-C1-06-1B-E1-C4-DA-8C-8C-15-88-14\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"32-77-95-87-72-D8-6D-43-AA-DA-36-9B-86-D6-99-7F-41-0E-CF-A5\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Debug.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Debug</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8C-92-D8-11-B9-57-FB-91-AB-D6-D1-EA-9E-0B-7D-0C-F1-03-BC-6E\">\n            <ModulePath>BranchCoverage3296\\SecondTestSuite\\bin\\Debug\\netcoreapp3.1\\Microsoft.VisualStudio.TestPlatform.Common.dll</ModulePath>\n            <ModuleTime>2019-10-24T23:20:02Z</ModuleTime>\n            <ModuleName>Microsoft.VisualStudio.TestPlatform.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8B-E9-5A-2E-CC-DB-5C-E1-03-05-BA-E1-31-A9-9D-6F-18-10-50-AA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Collections</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"53-D0-A3-B9-10-36-09-21-32-F4-D0-88-75-00-B5-DC-77-89-1D-78\">\n            <ModulePath>BranchCoverage3296\\SecondTestSuite\\bin\\Debug\\netcoreapp3.1\\Newtonsoft.Json.dll</ModulePath>\n            <ModuleTime>2016-06-13T21:06:14Z</ModuleTime>\n            <ModuleName>Newtonsoft.Json</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"96-C7-5C-FC-1E-89-3E-67-F0-53-6B-39-C4-C0-61-BC-52-35-9C-A0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Serialization.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Serialization.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A3-8E-CE-5F-4A-F0-53-BF-7A-86-29-F3-60-31-4E-C2-C7-92-64-BF\">\n            <ModulePath>BranchCoverage3296\\FirstTestSuite\\bin\\Debug\\netcoreapp3.1\\Microsoft.TestPlatform.CrossPlatEngine.dll</ModulePath>\n            <ModuleTime>2019-10-24T23:20:02Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.CrossPlatEngine</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A6-8F-70-B6-4E-19-5D-AD-A4-E6-F3-7F-0E-80-A2-3F-81-B0-99-64\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Globalization.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Globalization</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"3A-01-82-3D-B5-F1-23-E3-44-29-52-01-DD-EB-29-DB-C4-C5-8C-CE\">\n            <ModulePath>BranchCoverage3296\\FirstTestSuite\\bin\\Debug\\netcoreapp3.1\\Microsoft.TestPlatform.CommunicationUtilities.dll</ModulePath>\n            <ModuleTime>2019-10-24T23:20:02Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.CommunicationUtilities</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"51-13-D1-D9-16-6E-B7-32-DA-55-E3-B7-9D-7A-18-56-62-3D-30-3F\">\n            <ModulePath>BranchCoverage3296\\FirstTestSuite\\bin\\Debug\\netcoreapp3.1\\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll</ModulePath>\n            <ModuleTime>2019-10-24T23:20:00Z</ModuleTime>\n            <ModuleName>Microsoft.VisualStudio.TestPlatform.ObjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8C-92-D8-11-B9-57-FB-91-AB-D6-D1-EA-9E-0B-7D-0C-F1-03-BC-6E\">\n            <ModulePath>BranchCoverage3296\\FirstTestSuite\\bin\\Debug\\netcoreapp3.1\\Microsoft.VisualStudio.TestPlatform.Common.dll</ModulePath>\n            <ModuleTime>2019-10-24T23:20:02Z</ModuleTime>\n            <ModuleName>Microsoft.VisualStudio.TestPlatform.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9C-68-F9-D9-5D-09-7B-AC-36-D7-6D-25-3D-17-F3-72-E5-1A-87-F0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:06Z</ModuleTime>\n            <ModuleName>System.Threading</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"53-D0-A3-B9-10-36-09-21-32-F4-D0-88-75-00-B5-DC-77-89-1D-78\">\n            <ModulePath>BranchCoverage3296\\FirstTestSuite\\bin\\Debug\\netcoreapp3.1\\Newtonsoft.Json.dll</ModulePath>\n            <ModuleTime>2016-06-13T21:06:14Z</ModuleTime>\n            <ModuleName>Newtonsoft.Json</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"96-C7-5C-FC-1E-89-3E-67-F0-53-6B-39-C4-C0-61-BC-52-35-9C-A0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Serialization.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Serialization.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A6-8F-70-B6-4E-19-5D-AD-A4-E6-F3-7F-0E-80-A2-3F-81-B0-99-64\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Globalization.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Globalization</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9C-68-F9-D9-5D-09-7B-AC-36-D7-6D-25-3D-17-F3-72-E5-1A-87-F0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:06Z</ModuleTime>\n            <ModuleName>System.Threading</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"66-55-F3-9A-C4-53-63-95-5F-60-D2-19-0F-7E-3B-2B-85-46-FB-8D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.TraceSource.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Diagnostics.TraceSource</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4D-33-53-11-50-36-83-92-2B-29-8C-5A-FA-19-EF-5A-D4-AA-32-80\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Process.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:38Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Process</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E5-F8-08-77-40-69-F3-B4-39-9E-F4-4F-30-35-FF-75-AD-66-E9-C9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:34Z</ModuleTime>\n            <ModuleName>System.ComponentModel.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"AF-4F-3B-E9-D2-80-A0-2E-91-5B-AF-17-34-A9-F1-A6-32-C4-EC-4E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Memory.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Memory</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FC-9A-A3-24-E8-48-FF-9E-1A-D8-C2-B3-54-1E-A8-DD-B2-E1-E3-96\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.ThreadPool.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.ThreadPool</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"66-55-F3-9A-C4-53-63-95-5F-60-D2-19-0F-7E-3B-2B-85-46-FB-8D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.TraceSource.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Diagnostics.TraceSource</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B9-08-B2-09-3C-61-2C-3E-62-03-05-65-93-6A-84-E5-2C-0D-A7-F4\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.InteropServices.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4E-A9-32-5A-D2-0F-84-D8-73-42-C7-0B-6A-3C-7B-C0-89-B7-20-01\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\Microsoft.Win32.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n            <ModuleName>Microsoft.Win32.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2A-48-85-A6-03-C4-07-FD-29-10-28-5A-25-BF-0C-FA-03-A7-98-B2\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Net.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4D-33-53-11-50-36-83-92-2B-29-8C-5A-FA-19-EF-5A-D4-AA-32-80\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Process.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:38Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Process</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E5-F8-08-77-40-69-F3-B4-39-9E-F4-4F-30-35-FF-75-AD-66-E9-C9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:34Z</ModuleTime>\n            <ModuleName>System.ComponentModel.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"23-F9-09-16-3B-71-58-F5-A7-35-CA-89-4D-75-0F-3D-D0-23-DC-EB\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Tasks.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Threading.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"EE-DF-4B-C9-A1-40-03-5F-56-1A-DB-D7-E8-A0-BC-A6-12-34-84-1E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Sockets.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:08Z</ModuleTime>\n            <ModuleName>System.Net.Sockets</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"AF-4F-3B-E9-D2-80-A0-2E-91-5B-AF-17-34-A9-F1-A6-32-C4-EC-4E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Memory.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Memory</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FC-9A-A3-24-E8-48-FF-9E-1A-D8-C2-B3-54-1E-A8-DD-B2-E1-E3-96\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.ThreadPool.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.ThreadPool</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B9-08-B2-09-3C-61-2C-3E-62-03-05-65-93-6A-84-E5-2C-0D-A7-F4\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.InteropServices.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"87-6E-54-67-71-53-FA-C9-68-88-0D-C1-82-45-BE-68-5A-25-55-32\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Overlapped.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Threading.Overlapped</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4E-A9-32-5A-D2-0F-84-D8-73-42-C7-0B-6A-3C-7B-C0-89-B7-20-01\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\Microsoft.Win32.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n            <ModuleName>Microsoft.Win32.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E6-CE-DF-D3-05-01-F5-61-41-53-0C-FF-2C-87-01-04-6E-EB-B1-C7\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.NameResolution.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:40Z</ModuleTime>\n            <ModuleName>System.Net.NameResolution</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2A-48-85-A6-03-C4-07-FD-29-10-28-5A-25-BF-0C-FA-03-A7-98-B2\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Net.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"23-F9-09-16-3B-71-58-F5-A7-35-CA-89-4D-75-0F-3D-D0-23-DC-EB\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Tasks.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Threading.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"EE-DF-4B-C9-A1-40-03-5F-56-1A-DB-D7-E8-A0-BC-A6-12-34-84-1E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Sockets.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:08Z</ModuleTime>\n            <ModuleName>System.Net.Sockets</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"87-6E-54-67-71-53-FA-C9-68-88-0D-C1-82-45-BE-68-5A-25-55-32\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Overlapped.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Threading.Overlapped</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D5-0A-67-87-14-54-BA-3A-F2-2A-2A-B8-15-CE-D1-74-51-44-E5-FC\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Uri.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:26Z</ModuleTime>\n            <ModuleName>System.Private.Uri</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E6-CE-DF-D3-05-01-F5-61-41-53-0C-FF-2C-87-01-04-6E-EB-B1-C7\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.NameResolution.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:40Z</ModuleTime>\n            <ModuleName>System.Net.NameResolution</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D5-0A-67-87-14-54-BA-3A-F2-2A-2A-B8-15-CE-D1-74-51-44-E5-FC\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Uri.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:26Z</ModuleTime>\n            <ModuleName>System.Private.Uri</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2F-EF-10-A4-03-CD-85-F5-B3-28-04-C0-CA-59-04-4C-AE-A8-5D-D0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Principal.Windows.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Principal.Windows</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"79-03-C9-B3-67-3A-61-F7-6D-B6-CE-72-A2-3F-68-B5-87-C1-4B-60\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Claims.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.Claims</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2F-EF-10-A4-03-CD-85-F5-B3-28-04-C0-CA-59-04-4C-AE-A8-5D-D0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Principal.Windows.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Principal.Windows</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"87-DE-C4-EB-AC-4B-76-40-4C-56-AB-F2-05-44-02-D8-77-58-26-00\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Principal.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Principal</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"79-03-C9-B3-67-3A-61-F7-6D-B6-CE-72-A2-3F-68-B5-87-C1-4B-60\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Claims.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.Claims</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"87-DE-C4-EB-AC-4B-76-40-4C-56-AB-F2-05-44-02-D8-77-58-26-00\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Principal.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Principal</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"96-C7-5C-FC-1E-89-3E-67-F0-53-6B-39-C4-C0-61-BC-52-35-9C-A0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Serialization.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Serialization.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2F-EF-10-A4-03-CD-85-F5-B3-28-04-C0-CA-59-04-4C-AE-A8-5D-D0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Principal.Windows.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Principal.Windows</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2F-EF-10-A4-03-CD-85-F5-B3-28-04-C0-CA-59-04-4C-AE-A8-5D-D0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Principal.Windows.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Principal.Windows</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"79-03-C9-B3-67-3A-61-F7-6D-B6-CE-72-A2-3F-68-B5-87-C1-4B-60\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Claims.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.Claims</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"79-03-C9-B3-67-3A-61-F7-6D-B6-CE-72-A2-3F-68-B5-87-C1-4B-60\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Claims.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.Claims</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"87-DE-C4-EB-AC-4B-76-40-4C-56-AB-F2-05-44-02-D8-77-58-26-00\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Principal.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Principal</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"87-DE-C4-EB-AC-4B-76-40-4C-56-AB-F2-05-44-02-D8-77-58-26-00\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Principal.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Principal</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"96-C7-5C-FC-1E-89-3E-67-F0-53-6B-39-C4-C0-61-BC-52-35-9C-A0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Serialization.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Serialization.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"15-E5-50-D1-2F-F4-E8-02-DA-D7-F8-1F-A5-31-2E-52-66-E1-F3-61\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Data.Common.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:06Z</ModuleTime>\n            <ModuleName>System.Data.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"42-A4-D5-63-DA-C9-6B-42-3E-CF-98-F9-FB-80-3B-23-4D-E8-7E-B3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:34Z</ModuleTime>\n            <ModuleName>System.ComponentModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"15-E5-50-D1-2F-F4-E8-02-DA-D7-F8-1F-A5-31-2E-52-66-E1-F3-61\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Data.Common.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:06Z</ModuleTime>\n            <ModuleName>System.Data.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B5-88-C5-06-06-46-BA-FC-55-0E-7A-44-AC-31-CD-F3-5B-DF-AE-0B\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.ILGeneration.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.ILGeneration</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"42-A4-D5-63-DA-C9-6B-42-3E-CF-98-F9-FB-80-3B-23-4D-E8-7E-B3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:34Z</ModuleTime>\n            <ModuleName>System.ComponentModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"EA-A3-EB-09-A2-39-8F-0D-B1-13-BA-6D-11-3A-EC-93-44-39-5A-D3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.Lightweight.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.Lightweight</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C8-E8-31-5D-60-D0-B9-32-02-28-DE-17-96-8F-97-91-72-F8-BE-13\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Reflection.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"\">\n            <ModulePath>RefEmit_InMemoryManifestModule</ModulePath>\n            <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n            <ModuleName>Anonymously Hosted DynamicMethods Assembly</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B5-88-C5-06-06-46-BA-FC-55-0E-7A-44-AC-31-CD-F3-5B-DF-AE-0B\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.ILGeneration.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.ILGeneration</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"EA-A3-EB-09-A2-39-8F-0D-B1-13-BA-6D-11-3A-EC-93-44-39-5A-D3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.Lightweight.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.Lightweight</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C8-E8-31-5D-60-D0-B9-32-02-28-DE-17-96-8F-97-91-72-F8-BE-13\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Reflection.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"\">\n            <ModulePath>RefEmit_InMemoryManifestModule</ModulePath>\n            <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n            <ModuleName>Anonymously Hosted DynamicMethods Assembly</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5B-59-5A-55-C9-41-C5-0A-8E-0B-98-78-A8-43-45-E3-86-A3-5F-91\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Specialized.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Collections.Specialized</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"05-AF-58-DB-DA-32-BF-49-84-01-F1-55-D6-55-6F-40-94-52-FB-50\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Drawing.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:38Z</ModuleTime>\n            <ModuleName>System.Drawing.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5B-59-5A-55-C9-41-C5-0A-8E-0B-98-78-A8-43-45-E3-86-A3-5F-91\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Specialized.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Collections.Specialized</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"05-AF-58-DB-DA-32-BF-49-84-01-F1-55-D6-55-6F-40-94-52-FB-50\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Drawing.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:38Z</ModuleTime>\n            <ModuleName>System.Drawing.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C1-41-1B-16-60-41-0D-35-CE-85-82-6D-04-AB-CE-5C-88-E8-BE-91\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:06Z</ModuleTime>\n            <ModuleName>System.IO</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"17-CC-E7-2C-B7-DA-57-06-96-2B-F7-01-5A-76-38-AA-26-92-87-6D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Dynamic.Runtime.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:38Z</ModuleTime>\n            <ModuleName>System.Dynamic.Runtime</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C1-41-1B-16-60-41-0D-35-CE-85-82-6D-04-AB-CE-5C-88-E8-BE-91\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:06Z</ModuleTime>\n            <ModuleName>System.IO</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"17-CC-E7-2C-B7-DA-57-06-96-2B-F7-01-5A-76-38-AA-26-92-87-6D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Dynamic.Runtime.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:38Z</ModuleTime>\n            <ModuleName>System.Dynamic.Runtime</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"6F-CC-2C-76-AC-42-0E-1D-29-DC-BE-AB-E0-6D-A4-C2-9D-0C-27-23\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Linq.Expressions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:18Z</ModuleTime>\n            <ModuleName>System.Linq.Expressions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-4C-1D-C3-E8-DB-38-EA-0D-64-CB-BD-58-BC-F2-B0-E2-99-42-93\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Reflection</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"70-58-B8-D8-D1-66-CB-C6-C4-F9-5F-80-03-7C-74-A2-D8-CA-6A-98\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Reflection.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"33-87-51-E6-2F-8C-BE-1D-5B-B2-9E-51-10-1B-05-40-2C-E3-E8-1A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Linq.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:40Z</ModuleTime>\n            <ModuleName>System.Linq</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"6F-CC-2C-76-AC-42-0E-1D-29-DC-BE-AB-E0-6D-A4-C2-9D-0C-27-23\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Linq.Expressions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:18Z</ModuleTime>\n            <ModuleName>System.Linq.Expressions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"22-BD-0E-BF-F3-50-23-F4-33-69-45-CA-85-5A-41-AA-FF-98-13-6A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ObjectModel.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.ObjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-4C-1D-C3-E8-DB-38-EA-0D-64-CB-BD-58-BC-F2-B0-E2-99-42-93\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Reflection</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"70-58-B8-D8-D1-66-CB-C6-C4-F9-5F-80-03-7C-74-A2-D8-CA-6A-98\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Reflection.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"33-87-51-E6-2F-8C-BE-1D-5B-B2-9E-51-10-1B-05-40-2C-E3-E8-1A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Linq.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:40Z</ModuleTime>\n            <ModuleName>System.Linq</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4B-5A-EC-05-10-C3-65-A3-7C-C5-D4-52-0E-41-A4-1F-73-88-F9-01\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.XDocument.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Xml.XDocument</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"68-1D-85-11-BD-EC-60-7F-F2-E8-83-FF-C6-D8-D9-CB-28-C8-8B-2A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Xml.Linq.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:30Z</ModuleTime>\n            <ModuleName>System.Private.Xml.Linq</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"22-BD-0E-BF-F3-50-23-F4-33-69-45-CA-85-5A-41-AA-FF-98-13-6A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ObjectModel.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.ObjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4B-5A-EC-05-10-C3-65-A3-7C-C5-D4-52-0E-41-A4-1F-73-88-F9-01\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.XDocument.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Xml.XDocument</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"68-1D-85-11-BD-EC-60-7F-F2-E8-83-FF-C6-D8-D9-CB-28-C8-8B-2A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Xml.Linq.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:30Z</ModuleTime>\n            <ModuleName>System.Private.Xml.Linq</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"1F-BD-6F-06-01-11-FA-A9-DB-0B-12-95-1E-A0-B6-62-C2-59-ED-05\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Xml.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:38Z</ModuleTime>\n            <ModuleName>System.Private.Xml</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9D-C0-19-0D-B9-0B-71-00-FA-44-3E-7A-92-13-79-FB-D2-34-4F-3D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.RegularExpressions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Text.RegularExpressions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"1F-BD-6F-06-01-11-FA-A9-DB-0B-12-95-1E-A0-B6-62-C2-59-ED-05\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Xml.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:38Z</ModuleTime>\n            <ModuleName>System.Private.Xml</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9D-C0-19-0D-B9-0B-71-00-FA-44-3E-7A-92-13-79-FB-D2-34-4F-3D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.RegularExpressions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Text.RegularExpressions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B5-88-C5-06-06-46-BA-FC-55-0E-7A-44-AC-31-CD-F3-5B-DF-AE-0B\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.ILGeneration.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.ILGeneration</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"EA-A3-EB-09-A2-39-8F-0D-B1-13-BA-6D-11-3A-EC-93-44-39-5A-D3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.Lightweight.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.Lightweight</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C8-E8-31-5D-60-D0-B9-32-02-28-DE-17-96-8F-97-91-72-F8-BE-13\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Reflection.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"\">\n            <ModulePath>RefEmit_InMemoryManifestModule</ModulePath>\n            <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n            <ModuleName>Anonymously Hosted DynamicMethods Assembly</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B5-88-C5-06-06-46-BA-FC-55-0E-7A-44-AC-31-CD-F3-5B-DF-AE-0B\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.ILGeneration.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.ILGeneration</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"EA-A3-EB-09-A2-39-8F-0D-B1-13-BA-6D-11-3A-EC-93-44-39-5A-D3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.Lightweight.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.Lightweight</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C8-E8-31-5D-60-D0-B9-32-02-28-DE-17-96-8F-97-91-72-F8-BE-13\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Reflection.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"\">\n            <ModulePath>RefEmit_InMemoryManifestModule</ModulePath>\n            <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n            <ModuleName>Anonymously Hosted DynamicMethods Assembly</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5E-EA-96-C3-0B-C7-BF-BA-AE-4A-27-D8-9A-9A-67-A2-72-BF-89-1F\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.NonGeneric.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:32Z</ModuleTime>\n            <ModuleName>System.Collections.NonGeneric</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5E-EA-96-C3-0B-C7-BF-BA-AE-4A-27-D8-9A-9A-67-A2-72-BF-89-1F\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.NonGeneric.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:32Z</ModuleTime>\n            <ModuleName>System.Collections.NonGeneric</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A6-81-2A-5B-4A-3D-C8-4D-49-04-DE-1F-DF-02-7C-B4-43-51-DE-1C\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.FileSystem.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.IO.FileSystem</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A6-81-2A-5B-4A-3D-C8-4D-49-04-DE-1F-DF-02-7C-B4-43-51-DE-1C\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.FileSystem.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.IO.FileSystem</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"3D-ED-2E-29-0D-BD-86-B5-75-96-FF-B0-C8-9D-AD-4E-5B-94-58-57\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Loader.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Loader</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"3D-ED-2E-29-0D-BD-86-B5-75-96-FF-B0-C8-9D-AD-4E-5B-94-58-57\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Loader.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Loader</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"59-B3-53-C6-DD-77-03-5F-2E-4E-9A-A7-81-4B-56-D8-AB-97-8F-66\">\n            <ModulePath>BranchCoverage3296\\SecondTestSuite\\bin\\Debug\\netcoreapp3.1\\NUnit3.TestAdapter.dll</ModulePath>\n            <ModuleTime>2019-08-30T10:05:18Z</ModuleTime>\n            <ModuleName>NUnit3.TestAdapter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"12-76-CC-1D-71-64-A5-ED-83-74-CD-75-86-B8-02-00-13-2D-7E-D2\">\n            <ModulePath>BranchCoverage3296\\SecondTestSuite\\bin\\Debug\\netcoreapp3.1\\nunit.engine.api.dll</ModulePath>\n            <ModuleTime>2019-03-24T14:23:48Z</ModuleTime>\n            <ModuleName>nunit.engine.api</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"59-B3-53-C6-DD-77-03-5F-2E-4E-9A-A7-81-4B-56-D8-AB-97-8F-66\">\n            <ModulePath>BranchCoverage3296\\FirstTestSuite\\bin\\Debug\\netcoreapp3.1\\NUnit3.TestAdapter.dll</ModulePath>\n            <ModuleTime>2019-08-30T10:05:18Z</ModuleTime>\n            <ModuleName>NUnit3.TestAdapter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"12-76-CC-1D-71-64-A5-ED-83-74-CD-75-86-B8-02-00-13-2D-7E-D2\">\n            <ModulePath>BranchCoverage3296\\FirstTestSuite\\bin\\Debug\\netcoreapp3.1\\nunit.engine.api.dll</ModulePath>\n            <ModuleTime>2019-03-24T14:23:48Z</ModuleTime>\n            <ModuleName>nunit.engine.api</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2F-E1-13-B8-1E-10-AE-79-4A-CD-F8-AE-C1-F1-E8-22-10-2F-61-17\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.ReaderWriter.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Xml.ReaderWriter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A3-6E-3F-5C-23-E9-CE-D4-59-A4-79-82-3A-A2-A6-D2-A6-37-0E-C2\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Thread.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.Thread</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-F9-21-BB-3C-07-A4-DA-5A-43-89-51-EB-E0-A4-B9-2F-19-F6-7D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.Algorithms.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Algorithms</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2F-E1-13-B8-1E-10-AE-79-4A-CD-F8-AE-C1-F1-E8-22-10-2F-61-17\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.ReaderWriter.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Xml.ReaderWriter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A3-6E-3F-5C-23-E9-CE-D4-59-A4-79-82-3A-A2-A6-D2-A6-37-0E-C2\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Thread.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.Thread</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-F9-21-BB-3C-07-A4-DA-5A-43-89-51-EB-E0-A4-B9-2F-19-F6-7D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.Algorithms.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Algorithms</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"25-17-3D-BA-13-03-55-32-76-CF-3D-AE-B3-52-14-5F-95-F5-3E-85\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Timer.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.Timer</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"25-17-3D-BA-13-03-55-32-76-CF-3D-AE-B3-52-14-5F-95-F5-3E-85\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Timer.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.Timer</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"57-E8-B3-F8-DB-88-F2-FB-81-BE-34-C3-AD-1E-D4-F0-DD-F0-59-D3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Resources.ResourceManager.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Resources.ResourceManager</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"26-14-D7-B5-EB-43-C2-76-01-4F-01-5E-7B-A4-CE-E9-EB-E3-AA-B9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.InteropServices.RuntimeInformation.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices.RuntimeInformation</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C1-E6-95-46-6B-22-AB-AD-8C-29-08-C6-4F-A8-BC-C8-E3-D9-B3-83\">\n            <ModulePath>BranchCoverage3296\\SecondTestSuite\\bin\\Debug\\netcoreapp3.1\\NuGet.Frameworks.dll</ModulePath>\n            <ModuleTime>2019-04-01T16:23:50Z</ModuleTime>\n            <ModuleName>NuGet.Frameworks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"57-E8-B3-F8-DB-88-F2-FB-81-BE-34-C3-AD-1E-D4-F0-DD-F0-59-D3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Resources.ResourceManager.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Resources.ResourceManager</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"26-14-D7-B5-EB-43-C2-76-01-4F-01-5E-7B-A4-CE-E9-EB-E3-AA-B9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.InteropServices.RuntimeInformation.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices.RuntimeInformation</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C1-E6-95-46-6B-22-AB-AD-8C-29-08-C6-4F-A8-BC-C8-E3-D9-B3-83\">\n            <ModulePath>BranchCoverage3296\\FirstTestSuite\\bin\\Debug\\netcoreapp3.1\\NuGet.Frameworks.dll</ModulePath>\n            <ModuleTime>2019-04-01T16:23:50Z</ModuleTime>\n            <ModuleName>NuGet.Frameworks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F5-4A-B0-89-01-16-50-65-5F-DD-4C-B5-70-9E-39-1A-D1-B7-FE-38\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Metadata.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Metadata</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"01-AB-1F-C1-0A-AD-1A-D5-69-41-9D-4B-4E-1C-6F-AC-59-05-9A-48\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Immutable.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>System.Collections.Immutable</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F5-4A-B0-89-01-16-50-65-5F-DD-4C-B5-70-9E-39-1A-D1-B7-FE-38\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Metadata.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Metadata</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"01-AB-1F-C1-0A-AD-1A-D5-69-41-9D-4B-4E-1C-6F-AC-59-05-9A-48\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Immutable.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>System.Collections.Immutable</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E5-6F-E2-59-47-64-D2-E4-64-4E-96-55-60-F4-13-5C-EE-05-0B-BE\">\n            <ModulePath>BranchCoverage3296\\SecondTestSuite\\bin\\Debug\\netcoreapp3.1\\nunit.engine.dll</ModulePath>\n            <ModuleTime>2019-03-24T14:23:48Z</ModuleTime>\n            <ModuleName>nunit.engine</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4E-96-5A-FC-C0-BE-6F-D4-A5-9C-B4-F8-33-D5-85-D1-B9-07-9F-89\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Encoding.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Text.Encoding.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E5-6F-E2-59-47-64-D2-E4-64-4E-96-55-60-F4-13-5C-EE-05-0B-BE\">\n            <ModulePath>BranchCoverage3296\\FirstTestSuite\\bin\\Debug\\netcoreapp3.1\\nunit.engine.dll</ModulePath>\n            <ModuleTime>2019-03-24T14:23:48Z</ModuleTime>\n            <ModuleName>nunit.engine</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4E-96-5A-FC-C0-BE-6F-D4-A5-9C-B4-F8-33-D5-85-D1-B9-07-9F-89\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Encoding.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Text.Encoding.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"CE-43-2B-40-C0-FF-2C-68-D3-CF-AF-49-07-37-DC-D7-AA-AB-17-F3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Buffers.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:26Z</ModuleTime>\n            <ModuleName>System.Buffers</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"CE-43-2B-40-C0-FF-2C-68-D3-CF-AF-49-07-37-DC-D7-AA-AB-17-F3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Buffers.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:26Z</ModuleTime>\n            <ModuleName>System.Buffers</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"\">\n            <ModulePath>Mono.Cecil.dll</ModulePath>\n            <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n            <ModuleName>Mono.Cecil</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"31-48-4C-D9-B7-64-1C-85-5D-80-A0-AB-74-1E-29-E1-94-43-80-C0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.FileSystem.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:42Z</ModuleTime>\n            <ModuleName>System.IO.FileSystem.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"\">\n            <ModulePath>Mono.Cecil.dll</ModulePath>\n            <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n            <ModuleName>Mono.Cecil</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"31-48-4C-D9-B7-64-1C-85-5D-80-A0-AB-74-1E-29-E1-94-43-80-C0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.FileSystem.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:42Z</ModuleTime>\n            <ModuleName>System.IO.FileSystem.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A5-1D-73-D2-8D-F6-70-B7-B7-8B-00-F4-17-70-7F-2A-98-D3-1C-F9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Encoding.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Text.Encoding</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A5-1D-73-D2-8D-F6-70-B7-B7-8B-00-F4-17-70-7F-2A-98-D3-1C-F9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Encoding.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Text.Encoding</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F5-DF-92-D4-E4-7D-E2-6F-35-36-11-65-C3-69-FF-1A-0F-BE-4E-52\">\n            <ModulePath>BranchCoverage3296\\SecondTestSuite\\bin\\Debug\\netcoreapp3.1\\SecondTestSuite.dll</ModulePath>\n            <ModuleTime>2020-04-27T06:25:40.5318924Z</ModuleTime>\n            <ModuleName>SecondTestSuite</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9A-F7-44-9B-43-8F-1E-71-60-7A-04-D2-A8-AB-10-07-80-3D-DF-79\">\n            <ModulePath>BranchCoverage3296\\FirstTestSuite\\bin\\Debug\\netcoreapp3.1\\FirstTestSuite.dll</ModulePath>\n            <ModuleTime>2020-04-27T06:25:40.5318924Z</ModuleTime>\n            <ModuleName>FirstTestSuite</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"16-2A-6A-6B-DF-CD-D6-7C-53-72-D1-C2-AE-69-5C-68-F9-E9-F2-2D\">\n            <ModulePath>BranchCoverage3296\\SecondTestSuite\\bin\\Debug\\netcoreapp3.1\\nunit.framework.dll</ModulePath>\n            <ModuleTime>2019-05-14T20:37:24Z</ModuleTime>\n            <ModuleName>nunit.framework</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"16-2A-6A-6B-DF-CD-D6-7C-53-72-D1-C2-AE-69-5C-68-F9-E9-F2-2D\">\n            <ModulePath>BranchCoverage3296\\FirstTestSuite\\bin\\Debug\\netcoreapp3.1\\nunit.framework.dll</ModulePath>\n            <ModuleTime>2019-05-14T20:37:24Z</ModuleTime>\n            <ModuleName>nunit.framework</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"32-5D-5E-82-60-49-7F-5D-44-D4-1E-BF-57-95-6F-D8-30-A6-C2-E1\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Console.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n            <ModuleName>System.Console</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"32-5D-5E-82-60-49-7F-5D-44-D4-1E-BF-57-95-6F-D8-30-A6-C2-E1\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Console.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n            <ModuleName>System.Console</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8F-A1-95-7C-65-A0-95-11-53-8D-DF-11-6D-3C-AD-5D-AE-2F-D3-73\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Concurrent.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>System.Collections.Concurrent</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8F-A1-95-7C-65-A0-95-11-53-8D-DF-11-6D-3C-AD-5D-AE-2F-D3-73\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Concurrent.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>System.Collections.Concurrent</ModuleName>\n            <Classes />\n        </Module>\n        <Module hash=\"8F-EE-CD-E3-B7-04-08-DD-B6-60-C3-50-BE-5C-7C-A3-37-F2-B9-BA\">\n            <Summary numSequencePoints=\"1\" visitedSequencePoints=\"1\" numBranchPoints=\"3\" visitedBranchPoints=\"2\" sequenceCoverage=\"100\" branchCoverage=\"66.67\" maxCyclomaticComplexity=\"3\" minCyclomaticComplexity=\"1\" maxCrapScore=\"3\" minCrapScore=\"2\" visitedClasses=\"1\" numClasses=\"1\" visitedMethods=\"1\" numMethods=\"1\" />\n            <ModulePath>BranchCoverage3296\\FirstTestSuite\\bin\\Debug\\netcoreapp3.1\\Code.dll</ModulePath>\n            <ModuleTime>2020-04-27T06:25:39.7448903Z</ModuleTime>\n            <ModuleName>Code</ModuleName>\n            <Files>\n                <File uid=\"2\" fullPath=\"BranchCoverage3296\\Code\\ValueProvider.cs\" />\n            </Files>\n            <Classes>\n                <Class>\n                    <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"0\" minCyclomaticComplexity=\"0\" maxCrapScore=\"0\" minCrapScore=\"0\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"0\" />\n                    <FullName>&lt;Module&gt;</FullName>\n                    <Methods />\n                </Class>\n                <Class>\n                    <Summary numSequencePoints=\"1\" visitedSequencePoints=\"1\" numBranchPoints=\"3\" visitedBranchPoints=\"2\" sequenceCoverage=\"100\" branchCoverage=\"66.67\" maxCyclomaticComplexity=\"3\" minCyclomaticComplexity=\"1\" maxCrapScore=\"3\" minCrapScore=\"2\" visitedClasses=\"1\" numClasses=\"1\" visitedMethods=\"1\" numMethods=\"1\" />\n                    <FullName>Code.ValueProvider</FullName>\n                    <Methods>\n                        <Method visited=\"true\" cyclomaticComplexity=\"3\" nPathComplexity=\"2\" sequenceCoverage=\"100\" branchCoverage=\"66.67\" crapScore=\"3\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n                            <Summary numSequencePoints=\"1\" visitedSequencePoints=\"1\" numBranchPoints=\"3\" visitedBranchPoints=\"2\" sequenceCoverage=\"100\" branchCoverage=\"66.67\" maxCyclomaticComplexity=\"3\" minCyclomaticComplexity=\"3\" maxCrapScore=\"3\" minCrapScore=\"3\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"1\" numMethods=\"1\" />\n                            <MetadataToken>100663297</MetadataToken>\n                            <Name>System.Int32 Code.ValueProvider::GetValue(System.Boolean)</Name>\n                            <FileRef uid=\"2\" />\n                            <SequencePoints>\n                                <SequencePoint vc=\"1\" uspid=\"1\" ordinal=\"0\" offset=\"0\" sl=\"5\" sc=\"48\" el=\"7\" ec=\"16\" bec=\"2\" bev=\"1\" fileid=\"2\" />\n                            </SequencePoints>\n                            <BranchPoints>\n                                <BranchPoint vc=\"1\" uspid=\"3\" ordinal=\"0\" offset=\"1\" sl=\"5\" path=\"0\" offsetend=\"3\" fileid=\"2\" />\n                                <BranchPoint vc=\"0\" uspid=\"5\" ordinal=\"1\" offset=\"1\" sl=\"5\" path=\"1\" offsetend=\"6\" fileid=\"2\" />\n                            </BranchPoints>\n                            <MethodPoint xsi:type=\"SequencePoint\" vc=\"1\" uspid=\"1\" ordinal=\"0\" offset=\"0\" sl=\"5\" sc=\"48\" el=\"7\" ec=\"16\" bec=\"2\" bev=\"1\" fileid=\"2\" />\n                        </Method>\n                        <Method visited=\"false\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" crapScore=\"2\" isConstructor=\"true\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n                            <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"2\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"0\" />\n                            <MetadataToken>100663298</MetadataToken>\n                            <Name>System.Void Code.ValueProvider::.ctor()</Name>\n                            <SequencePoints />\n                            <BranchPoints />\n                            <MethodPoint vc=\"0\" uspid=\"7\" ordinal=\"0\" offset=\"0\" />\n                        </Method>\n                    </Methods>\n                </Class>\n            </Classes>\n        </Module>\n        <Module hash=\"8F-EE-CD-E3-B7-04-08-DD-B6-60-C3-50-BE-5C-7C-A3-37-F2-B9-BA\">\n            <Summary numSequencePoints=\"1\" visitedSequencePoints=\"1\" numBranchPoints=\"3\" visitedBranchPoints=\"2\" sequenceCoverage=\"100\" branchCoverage=\"66.67\" maxCyclomaticComplexity=\"3\" minCyclomaticComplexity=\"1\" maxCrapScore=\"3\" minCrapScore=\"2\" visitedClasses=\"1\" numClasses=\"1\" visitedMethods=\"1\" numMethods=\"1\" />\n            <ModulePath>BranchCoverage3296\\SecondTestSuite\\bin\\Debug\\netcoreapp3.1\\Code.dll</ModulePath>\n            <ModuleTime>2020-04-27T06:25:39.7448903Z</ModuleTime>\n            <ModuleName>Code</ModuleName>\n            <Files>\n                <File uid=\"1\" fullPath=\"BranchCoverage3296\\Code\\ValueProvider.cs\" />\n            </Files>\n            <Classes>\n                <Class>\n                    <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"0\" minCyclomaticComplexity=\"0\" maxCrapScore=\"0\" minCrapScore=\"0\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"0\" />\n                    <FullName>&lt;Module&gt;</FullName>\n                    <Methods />\n                </Class>\n                <Class>\n                    <Summary numSequencePoints=\"1\" visitedSequencePoints=\"1\" numBranchPoints=\"3\" visitedBranchPoints=\"2\" sequenceCoverage=\"100\" branchCoverage=\"66.67\" maxCyclomaticComplexity=\"3\" minCyclomaticComplexity=\"1\" maxCrapScore=\"3\" minCrapScore=\"2\" visitedClasses=\"1\" numClasses=\"1\" visitedMethods=\"1\" numMethods=\"1\" />\n                    <FullName>Code.ValueProvider</FullName>\n                    <Methods>\n                        <Method visited=\"true\" cyclomaticComplexity=\"3\" nPathComplexity=\"2\" sequenceCoverage=\"100\" branchCoverage=\"66.67\" crapScore=\"3\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n                            <Summary numSequencePoints=\"1\" visitedSequencePoints=\"1\" numBranchPoints=\"3\" visitedBranchPoints=\"2\" sequenceCoverage=\"100\" branchCoverage=\"66.67\" maxCyclomaticComplexity=\"3\" minCyclomaticComplexity=\"3\" maxCrapScore=\"3\" minCrapScore=\"3\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"1\" numMethods=\"1\" />\n                            <MetadataToken>100663297</MetadataToken>\n                            <Name>System.Int32 Code.ValueProvider::GetValue(System.Boolean)</Name>\n                            <FileRef uid=\"1\" />\n                            <SequencePoints>\n                                <SequencePoint vc=\"1\" uspid=\"2\" ordinal=\"0\" offset=\"0\" sl=\"5\" sc=\"48\" el=\"7\" ec=\"16\" bec=\"2\" bev=\"1\" fileid=\"1\" />\n                            </SequencePoints>\n                            <BranchPoints>\n                                <BranchPoint vc=\"0\" uspid=\"4\" ordinal=\"0\" offset=\"1\" sl=\"5\" path=\"0\" offsetend=\"3\" fileid=\"1\" />\n                                <BranchPoint vc=\"1\" uspid=\"6\" ordinal=\"1\" offset=\"1\" sl=\"5\" path=\"1\" offsetend=\"6\" fileid=\"1\" />\n                            </BranchPoints>\n                            <MethodPoint xsi:type=\"SequencePoint\" vc=\"1\" uspid=\"2\" ordinal=\"0\" offset=\"0\" sl=\"5\" sc=\"48\" el=\"7\" ec=\"16\" bec=\"2\" bev=\"1\" fileid=\"1\" />\n                        </Method>\n                        <Method visited=\"false\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" crapScore=\"2\" isConstructor=\"true\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n                            <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"2\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"0\" />\n                            <MetadataToken>100663298</MetadataToken>\n                            <Name>System.Void Code.ValueProvider::.ctor()</Name>\n                            <SequencePoints />\n                            <BranchPoints />\n                            <MethodPoint vc=\"0\" uspid=\"8\" ordinal=\"0\" offset=\"0\" />\n                        </Method>\n                    </Methods>\n                </Class>\n            </Classes>\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"6D-0F-A0-D8-6E-D9-3D-12-46-84-DE-CC-44-CE-CF-2B-96-27-29-EA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.TypeConverter.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:32Z</ModuleTime>\n            <ModuleName>System.ComponentModel.TypeConverter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"6D-0F-A0-D8-6E-D9-3D-12-46-84-DE-CC-44-CE-CF-2B-96-27-29-EA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.TypeConverter.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:32Z</ModuleTime>\n            <ModuleName>System.ComponentModel.TypeConverter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"55-8E-C2-A5-09-4D-3F-8C-11-59-AB-41-D5-05-B5-7B-8D-3A-AA-6E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"55-8E-C2-A5-09-4D-3F-8C-11-59-AB-41-D5-05-B5-7B-8D-3A-AA-6E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Primitives</ModuleName>\n            <Classes />\n        </Module>\n    </Modules>\n</CoverageSession>"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/opencover/coverage_branches.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\nThis file was generated from the following code:\n\nusing System;\n\nnamespace BranchCoveragePoc\n{\n    public class Calculator\n    {\n        public int Compute(int x, int y, int z)\n        {\n            if (x == 0 || y < 0)\n                Console.WriteLine(x);\n\n            _ = y == 0 || z == 0;\n            _ = x == y || y == z;\n            _ = y == 0 || z == 0; _ = x == y || y == z;\n\n            x += 1;\n\n            return x < 2\n                ? y < 3\n                    ? z < 1\n                        ? 1\n                        : 2\n                    : 3\n                : 4;\n        }\n    }\n}\n\nUnit tests:\n\nusing NUnit.Framework;\n\nnamespace BranchCoveragePoc.Tests\n{\n    public class Tests\n    {\n        [Test]\n        public void Test1()\n        {\n            var sut = new Calculator();\n\n            Assert.That(sut.Compute(0, 0, 0).Equals(1));\n        }\n    }\n}\n\nOpenCover version 4.7.922.0\n\nCommands used:\nmsbuild BranchCoveragePoc.sln\nOpenCover.Console.exe -target:\"c:\\Program Files\\dotnet\\dotnet.exe\" -targetargs:\"test\" -output:coverage.xml -register:user -filter:\"+[BranchCoveragePoc*]* -[BranchCoveragePoc.Tests]*\"\n-->\n\n<CoverageSession xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" Version=\"4.7.922.0\">\n    <Summary numSequencePoints=\"10\" visitedSequencePoints=\"10\" numBranchPoints=\"19\" visitedBranchPoints=\"10\" sequenceCoverage=\"100\" branchCoverage=\"52.63\" maxCyclomaticComplexity=\"13\" minCyclomaticComplexity=\"1\" maxCrapScore=\"13\" minCrapScore=\"2\" visitedClasses=\"1\" numClasses=\"1\" visitedMethods=\"1\" numMethods=\"1\" />\n    <Modules>\n        <Module skippedDueTo=\"Filter\" hash=\"BA-A1-94-4D-72-3E-EF-49-B2-32-E7-EE-9F-B3-FC-AD-62-1A-F8-91\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Private.CoreLib.dll</ModulePath>\n            <ModuleTime>2019-12-07T15:40:56Z</ModuleTime>\n            <ModuleName>System.Private.CoreLib</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"63-C0-E7-F4-80-B3-11-B1-AB-7C-EF-FC-73-87-8F-86-CE-D6-69-5D\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\dotnet.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:30Z</ModuleTime>\n            <ModuleName>dotnet</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"7A-56-D1-54-BC-15-85-39-DA-17-17-FE-FB-38-15-4B-78-98-E5-80\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>System.Runtime</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"26-25-9F-9F-94-FF-13-F9-02-9C-57-75-C2-05-6B-4C-E9-36-A0-DD\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.DotNet.Cli.Utils.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:32Z</ModuleTime>\n            <ModuleName>Microsoft.DotNet.Cli.Utils</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"58-49-87-1F-73-BC-F4-63-E6-DC-16-9A-68-00-73-51-18-DF-4D-63\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.Extensions.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:00Z</ModuleTime>\n            <ModuleName>System.Runtime.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"20-E4-29-5C-AD-EA-20-F7-EB-91-43-9A-0D-AC-E8-1B-3C-49-6C-40\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.Loader.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:00Z</ModuleTime>\n            <ModuleName>System.Runtime.Loader</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C4-93-DE-A7-BF-47-C1-77-13-D8-6B-BC-03-6A-0C-BB-0A-39-99-F9\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.DotNet.PlatformAbstractions.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:38Z</ModuleTime>\n            <ModuleName>Microsoft.DotNet.PlatformAbstractions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2C-30-02-8C-B1-A2-1B-A0-1A-27-A6-24-3D-61-D5-E6-96-9D-4C-D8\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\netstandard.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>netstandard</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"CE-5F-A9-D3-D8-4F-06-37-AE-9B-FA-4F-E5-3E-1E-03-B4-77-86-78\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.InteropServices.RuntimeInformation.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:58Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices.RuntimeInformation</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"6F-7C-BF-2C-C9-E7-07-66-16-9B-21-61-19-B6-01-F5-33-81-C0-88\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.IO.FileSystem.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:06Z</ModuleTime>\n            <ModuleName>System.IO.FileSystem</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"54-E5-A6-FF-F6-8C-6A-7D-CE-D2-2A-BF-D5-6B-67-60-2D-88-A0-A6\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.InteropServices.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:02Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"02-FD-78-B1-DD-78-9E-C7-C1-D1-B6-B0-23-9A-FB-A3-98-A6-F6-E5\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Memory.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:08Z</ModuleTime>\n            <ModuleName>System.Memory</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A8-3F-3B-0D-FE-3C-B9-36-6E-33-0B-C3-CA-EE-8E-8A-E1-10-2A-F2\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Threading.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:12Z</ModuleTime>\n            <ModuleName>System.Threading</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C2-47-82-F2-1A-DF-11-49-45-82-64-6E-9D-8A-93-CE-08-F1-9E-D9\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Text.Encoding.CodePages.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:02Z</ModuleTime>\n            <ModuleName>System.Text.Encoding.CodePages</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"7F-B3-05-BA-78-7B-90-86-20-73-A9-0B-A4-53-AD-F9-35-89-0E-88\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Collections.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:36Z</ModuleTime>\n            <ModuleName>System.Collections</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B0-17-92-AC-BB-F5-22-8A-22-BB-36-8A-C4-74-61-16-A1-F1-A5-17\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Collections.Concurrent.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>System.Collections.Concurrent</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4B-23-3C-FB-2C-87-6B-C8-B9-B3-B0-3C-FE-2A-A6-B0-EA-C8-0B-A4\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Threading.Thread.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:04Z</ModuleTime>\n            <ModuleName>System.Threading.Thread</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"65-78-30-2B-C9-50-D2-0B-61-2A-D8-09-F8-73-A7-FD-B9-8D-8E-59\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.DotNet.Configurer.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:00Z</ModuleTime>\n            <ModuleName>Microsoft.DotNet.Configurer</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"30-66-DB-F4-B6-F8-8C-84-13-A4-24-8F-F6-58-50-16-B2-00-A2-38\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.DotNet.Cli.CommandLine.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:00Z</ModuleTime>\n            <ModuleName>Microsoft.DotNet.Cli.CommandLine</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"73-45-14-55-A4-8E-EC-0A-1B-35-EF-E2-6D-BF-6C-6B-96-DA-7F-24\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Diagnostics.Process.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:02Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Process</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"1A-BF-9A-83-48-1A-09-B2-57-64-CE-83-07-87-20-FF-4D-9C-DA-85\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.DotNet.InternalAbstractions.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:00Z</ModuleTime>\n            <ModuleName>Microsoft.DotNet.InternalAbstractions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"01-21-D0-71-7C-59-2D-58-68-0F-75-5A-8C-11-80-8D-31-48-DB-B4\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Linq.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:04Z</ModuleTime>\n            <ModuleName>System.Linq</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"03-28-A9-BB-FA-B4-8F-A7-A3-77-17-9E-21-77-4B-F5-EA-93-2D-F2\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\NuGet.Frameworks.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:38Z</ModuleTime>\n            <ModuleName>NuGet.Frameworks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8F-66-CA-16-CB-91-DB-F4-6A-EC-BC-C3-07-99-05-F9-D2-D5-32-A7\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Console.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>System.Console</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9A-B6-6B-F1-3A-E5-3C-24-16-36-C0-B2-CC-27-44-9B-73-D7-B7-58\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Text.Encoding.Extensions.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:14Z</ModuleTime>\n            <ModuleName>System.Text.Encoding.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"BE-9A-5D-A1-AA-13-AC-DA-D5-C1-FE-D2-21-5E-D6-EF-46-17-D8-BF\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.CompilerServices.Unsafe.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:36Z</ModuleTime>\n            <ModuleName>System.Runtime.CompilerServices.Unsafe</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"69-18-E7-81-40-A9-08-05-90-BE-FA-C1-21-57-65-71-A9-EA-DF-A1\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.ApplicationInsights.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:00Z</ModuleTime>\n            <ModuleName>Microsoft.ApplicationInsights</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9C-AF-40-D7-E0-8E-7D-55-6A-EE-BE-9D-81-85-5F-70-4C-43-3E-8F\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Security.Cryptography.Algorithms.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:02Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Algorithms</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FC-88-C2-48-B1-32-80-2D-6A-AC-48-B8-59-A8-F8-B0-DC-CC-A4-DB\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Buffers.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:58Z</ModuleTime>\n            <ModuleName>System.Buffers</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A1-DB-CA-49-E5-DE-15-8A-D1-27-A7-83-3B-06-C2-FD-AA-93-97-7F\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Private.Uri.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:54Z</ModuleTime>\n            <ModuleName>System.Private.Uri</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C6-1E-E9-70-08-99-FC-7C-56-FD-99-EA-B2-77-BA-86-EC-00-3E-CD\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Security.Cryptography.Primitives.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:06Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FE-CB-B7-96-25-17-F0-81-93-4A-CF-1E-36-56-09-82-59-87-B1-F7\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.TemplateEngine.Cli.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:26Z</ModuleTime>\n            <ModuleName>Microsoft.TemplateEngine.Cli</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"6D-F9-F7-3E-29-9D-20-BD-2F-49-83-2B-B5-0E-C3-9A-24-10-C2-11\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Reflection.Extensions.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:36Z</ModuleTime>\n            <ModuleName>System.Reflection.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F7-22-BE-C3-24-16-7D-05-4F-01-12-91-F4-A3-B7-24-B6-01-82-06\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Reflection.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:34Z</ModuleTime>\n            <ModuleName>System.Reflection</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F9-C8-60-94-E8-BB-9F-56-AB-FF-B7-9F-17-63-1D-7D-9A-8C-5D-90\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Xml.XDocument.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:54Z</ModuleTime>\n            <ModuleName>System.Xml.XDocument</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"67-B0-AA-21-34-86-26-B5-8A-2A-DE-BD-13-F6-E1-DC-C9-A6-C9-11\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Resources.ResourceManager.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>System.Resources.ResourceManager</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8C-61-4B-EA-81-E0-4A-28-1C-92-01-32-97-55-F9-35-20-1B-2E-63\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Private.Xml.Linq.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>System.Private.Xml.Linq</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F9-64-1E-55-2D-9C-5D-82-69-A6-84-14-0D-0F-D7-44-B3-5C-A7-06\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Threading.Tasks.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:34Z</ModuleTime>\n            <ModuleName>System.Threading.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"76-B3-8B-2A-31-E1-F2-2D-97-5B-8E-92-73-70-7A-8F-72-E4-44-63\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Private.Xml.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>System.Private.Xml</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"0A-2F-ED-78-BD-C3-89-28-67-8C-34-6A-6A-42-E0-93-AB-02-7C-5A\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Text.RegularExpressions.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:36Z</ModuleTime>\n            <ModuleName>System.Text.RegularExpressions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"69-FE-D8-1A-39-46-E9-D5-38-AB-56-03-9C-A7-0F-45-ED-B2-D5-89\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Net.Http.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:04Z</ModuleTime>\n            <ModuleName>System.Net.Http</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"1F-AD-B1-AA-7D-FE-11-BC-97-F6-46-27-D7-C8-F7-6D-53-4E-3A-41\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Xml.ReaderWriter.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:26Z</ModuleTime>\n            <ModuleName>System.Xml.ReaderWriter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"58-CE-28-9B-89-FC-5B-7D-F9-DF-DB-E2-82-9F-FB-C8-9A-65-2E-CD\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Diagnostics.Tracing.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:34Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Tracing</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"18-FA-0D-95-F1-C9-6C-5F-3D-ED-64-F5-E7-EA-F2-93-72-0C-61-3D\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Net.Primitives.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:54Z</ModuleTime>\n            <ModuleName>System.Net.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E8-BD-85-B9-4C-23-55-8C-87-8C-7C-65-E6-6E-D5-8C-53-F3-85-9E\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Globalization.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:36Z</ModuleTime>\n            <ModuleName>System.Globalization</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"35-6E-74-A3-51-5E-E3-83-2D-F5-67-19-F3-95-CB-7A-CF-15-60-CA\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Net.Security.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>System.Net.Security</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"6A-14-D9-A1-75-17-BF-9F-6B-FB-5F-B5-AC-8A-2C-94-97-A6-50-92\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Security.Cryptography.X509Certificates.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:36Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.X509Certificates</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C3-0D-A0-B1-74-3B-15-DF-A7-15-4C-96-D4-27-BF-FD-FE-00-A4-EB\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Reflection.Emit.ILGeneration.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:34Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.ILGeneration</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"23-8C-45-0B-A6-E1-AC-BC-02-65-71-CD-F7-1B-E7-CD-B0-77-DB-8D\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Net.Requests.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:58Z</ModuleTime>\n            <ModuleName>System.Net.Requests</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"29-55-21-6F-D0-BC-A0-9F-72-8F-B8-5E-11-57-89-2C-FD-D8-11-99\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Net.NetworkInformation.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:10Z</ModuleTime>\n            <ModuleName>System.Net.NetworkInformation</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"82-A4-6C-57-AF-AA-D5-30-07-87-6E-51-C8-AB-EB-02-D5-17-69-13\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Reflection.Emit.Lightweight.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:00Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.Lightweight</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5A-53-4F-48-AF-B1-EB-60-21-87-B1-28-94-0A-4B-2D-BB-CE-B3-2D\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\Microsoft.Win32.Primitives.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>Microsoft.Win32.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"49-18-F3-D0-44-80-34-0E-8A-59-5F-EC-4C-DE-3E-8A-19-82-A8-F2\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Reflection.Primitives.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:04Z</ModuleTime>\n            <ModuleName>System.Reflection.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"61-88-56-DF-E6-E0-99-C6-F6-44-13-17-10-25-81-0B-73-61-4C-32\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.TemplateEngine.Utils.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:30Z</ModuleTime>\n            <ModuleName>Microsoft.TemplateEngine.Utils</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A4-79-06-40-D5-5F-A9-60-39-5B-4E-11-23-32-9B-D2-91-70-E6-9A\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\Microsoft.Win32.Registry.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:38Z</ModuleTime>\n            <ModuleName>Microsoft.Win32.Registry</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"82-8D-BA-AC-40-85-10-CA-B8-7F-36-2B-6D-AE-A0-F3-2B-F1-B5-F0\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Diagnostics.Tools.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:00Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Tools</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"46-D5-F8-2E-9F-A9-78-CB-94-2A-A7-6D-1A-4D-01-4A-E0-12-4B-7F\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Diagnostics.Debug.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:04Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Debug</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E1-64-90-F4-41-89-3C-1E-7E-3F-55-45-8A-DE-E0-4C-12-C0-CF-75\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.IO.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:34Z</ModuleTime>\n            <ModuleName>System.IO</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"51-D2-F8-10-1F-22-A8-6B-7A-C1-7A-EF-51-5D-75-B1-8B-9B-90-26\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Text.Encoding.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:14Z</ModuleTime>\n            <ModuleName>System.Text.Encoding</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"81-43-50-E3-13-36-9A-61-6C-4D-39-82-8F-7C-96-DB-6B-E6-B3-A2\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.IO.Compression.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:02Z</ModuleTime>\n            <ModuleName>System.IO.Compression</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9A-83-5A-B5-87-CC-A8-C7-79-AC-67-E5-CA-0D-81-86-66-93-37-22\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.Build.Framework.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:24Z</ModuleTime>\n            <ModuleName>Microsoft.Build.Framework</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9B-E9-31-17-1E-42-BF-69-F2-8E-74-6B-F8-6B-B7-D7-F7-77-11-7F\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.ComponentModel.Primitives.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:58Z</ModuleTime>\n            <ModuleName>System.ComponentModel.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"49-AA-09-7E-08-21-F3-64-A1-95-BC-6F-B6-DA-5F-6A-14-4F-DC-60\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Collections.NonGeneric.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>System.Collections.NonGeneric</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"BD-8E-D5-66-41-3B-CC-DE-52-F7-A6-63-3B-98-76-23-3C-72-59-18\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Diagnostics.DiagnosticSource.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:36Z</ModuleTime>\n            <ModuleName>System.Diagnostics.DiagnosticSource</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5D-87-E8-9C-AD-E0-CD-8D-80-D6-09-41-BD-4A-7B-BC-5F-20-2E-5E\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Threading.Timer.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:54Z</ModuleTime>\n            <ModuleName>System.Threading.Timer</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C7-D3-F3-7A-48-47-11-9F-C2-F9-13-66-EA-B5-D6-3D-55-B9-84-22\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Net.Sockets.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:58Z</ModuleTime>\n            <ModuleName>System.Net.Sockets</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"95-BF-E0-EF-5B-E7-8C-85-01-46-96-EC-75-69-2F-30-93-7C-60-35\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Threading.Overlapped.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:10Z</ModuleTime>\n            <ModuleName>System.Threading.Overlapped</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"87-F8-C6-FF-25-C3-3B-82-BB-F1-23-76-08-22-22-37-9C-C7-7D-DC\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Net.NameResolution.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:38Z</ModuleTime>\n            <ModuleName>System.Net.NameResolution</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"BA-A1-94-4D-72-3E-EF-49-B2-32-E7-EE-9F-B3-FC-AD-62-1A-F8-91\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Private.CoreLib.dll</ModulePath>\n            <ModuleTime>2019-12-07T15:40:56Z</ModuleTime>\n            <ModuleName>System.Private.CoreLib</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"60-34-DF-B5-BF-6D-A3-2D-41-D2-11-56-0C-B6-52-0C-51-E7-A8-70\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Security.Principal.Windows.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:06Z</ModuleTime>\n            <ModuleName>System.Security.Principal.Windows</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"73-50-8C-32-9F-B0-51-50-40-3F-4F-AF-67-9D-C7-02-44-E1-7C-A2\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Security.Claims.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:36Z</ModuleTime>\n            <ModuleName>System.Security.Claims</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F2-A4-B7-B1-47-C0-9D-C3-B6-28-9C-2B-4B-F6-C4-95-9C-10-D8-94\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Security.Principal.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:08Z</ModuleTime>\n            <ModuleName>System.Security.Principal</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2F-64-93-42-DC-03-FB-18-D6-2C-17-CE-34-4A-A1-1C-E2-29-83-40\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\MSBuild.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:31:42Z</ModuleTime>\n            <ModuleName>MSBuild</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"7A-56-D1-54-BC-15-85-39-DA-17-17-FE-FB-38-15-4B-78-98-E5-80\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>System.Runtime</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"58-49-87-1F-73-BC-F4-63-E6-DC-16-9A-68-00-73-51-18-DF-4D-63\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.Extensions.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:00Z</ModuleTime>\n            <ModuleName>System.Runtime.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A8-3F-3B-0D-FE-3C-B9-36-6E-33-0B-C3-CA-EE-8E-8A-E1-10-2A-F2\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Threading.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:12Z</ModuleTime>\n            <ModuleName>System.Threading</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F9-64-1E-55-2D-9C-5D-82-69-A6-84-14-0D-0F-D7-44-B3-5C-A7-06\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Threading.Tasks.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:34Z</ModuleTime>\n            <ModuleName>System.Threading.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"CE-5F-A9-D3-D8-4F-06-37-AE-9B-FA-4F-E5-3E-1E-03-B4-77-86-78\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.InteropServices.RuntimeInformation.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:58Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices.RuntimeInformation</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"73-45-14-55-A4-8E-EC-0A-1B-35-EF-E2-6D-BF-6C-6B-96-DA-7F-24\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Diagnostics.Process.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:02Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Process</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9B-E9-31-17-1E-42-BF-69-F2-8E-74-6B-F8-6B-B7-D7-F7-77-11-7F\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.ComponentModel.Primitives.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:58Z</ModuleTime>\n            <ModuleName>System.ComponentModel.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"01-21-D0-71-7C-59-2D-58-68-0F-75-5A-8C-11-80-8D-31-48-DB-B4\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Linq.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:04Z</ModuleTime>\n            <ModuleName>System.Linq</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"0A-2F-ED-78-BD-C3-89-28-67-8C-34-6A-6A-42-E0-93-AB-02-7C-5A\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Text.RegularExpressions.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:36Z</ModuleTime>\n            <ModuleName>System.Text.RegularExpressions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"7F-B3-05-BA-78-7B-90-86-20-73-A9-0B-A4-53-AD-F9-35-89-0E-88\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Collections.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:36Z</ModuleTime>\n            <ModuleName>System.Collections</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"02-FD-78-B1-DD-78-9E-C7-C1-D1-B6-B0-23-9A-FB-A3-98-A6-F6-E5\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Memory.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:08Z</ModuleTime>\n            <ModuleName>System.Memory</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FC-88-C2-48-B1-32-80-2D-6A-AC-48-B8-59-A8-F8-B0-DC-CC-A4-DB\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Buffers.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:58Z</ModuleTime>\n            <ModuleName>System.Buffers</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"6F-7C-BF-2C-C9-E7-07-66-16-9B-21-61-19-B6-01-F5-33-81-C0-88\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.IO.FileSystem.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:06Z</ModuleTime>\n            <ModuleName>System.IO.FileSystem</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"54-E5-A6-FF-F6-8C-6A-7D-CE-D2-2A-BF-D5-6B-67-60-2D-88-A0-A6\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.InteropServices.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:02Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8F-66-CA-16-CB-91-DB-F4-6A-EC-BC-C3-07-99-05-F9-D2-D5-32-A7\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Console.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>System.Console</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9A-83-5A-B5-87-CC-A8-C7-79-AC-67-E5-CA-0D-81-86-66-93-37-22\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.Build.Framework.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:24Z</ModuleTime>\n            <ModuleName>Microsoft.Build.Framework</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2C-30-02-8C-B1-A2-1B-A0-1A-27-A6-24-3D-61-D5-E6-96-9D-4C-D8\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\netstandard.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>netstandard</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"43-C9-D7-7F-9D-1E-19-77-9E-9E-DF-3E-3F-A4-54-FC-7A-B3-25-34\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.Build.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:26Z</ModuleTime>\n            <ModuleName>Microsoft.Build</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"46-D5-F8-2E-9F-A9-78-CB-94-2A-A7-6D-1A-4D-01-4A-E0-12-4B-7F\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Diagnostics.Debug.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:04Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Debug</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C2-47-82-F2-1A-DF-11-49-45-82-64-6E-9D-8A-93-CE-08-F1-9E-D9\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Text.Encoding.CodePages.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:02Z</ModuleTime>\n            <ModuleName>System.Text.Encoding.CodePages</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B0-17-92-AC-BB-F5-22-8A-22-BB-36-8A-C4-74-61-16-A1-F1-A5-17\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Collections.Concurrent.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>System.Collections.Concurrent</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"63-C0-E7-F4-80-B3-11-B1-AB-7C-EF-FC-73-87-8F-86-CE-D6-69-5D\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\dotnet.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:30Z</ModuleTime>\n            <ModuleName>dotnet</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"65-78-30-2B-C9-50-D2-0B-61-2A-D8-09-F8-73-A7-FD-B9-8D-8E-59\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.DotNet.Configurer.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:00Z</ModuleTime>\n            <ModuleName>Microsoft.DotNet.Configurer</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"1A-BF-9A-83-48-1A-09-B2-57-64-CE-83-07-87-20-FF-4D-9C-DA-85\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.DotNet.InternalAbstractions.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:00Z</ModuleTime>\n            <ModuleName>Microsoft.DotNet.InternalAbstractions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"26-25-9F-9F-94-FF-13-F9-02-9C-57-75-C2-05-6B-4C-E9-36-A0-DD\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.DotNet.Cli.Utils.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:32Z</ModuleTime>\n            <ModuleName>Microsoft.DotNet.Cli.Utils</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9A-B6-6B-F1-3A-E5-3C-24-16-36-C0-B2-CC-27-44-9B-73-D7-B7-58\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Text.Encoding.Extensions.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:14Z</ModuleTime>\n            <ModuleName>System.Text.Encoding.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"69-18-E7-81-40-A9-08-05-90-BE-FA-C1-21-57-65-71-A9-EA-DF-A1\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.ApplicationInsights.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:00Z</ModuleTime>\n            <ModuleName>Microsoft.ApplicationInsights</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C4-93-DE-A7-BF-47-C1-77-13-D8-6B-BC-03-6A-0C-BB-0A-39-99-F9\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.DotNet.PlatformAbstractions.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:38Z</ModuleTime>\n            <ModuleName>Microsoft.DotNet.PlatformAbstractions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"BE-9A-5D-A1-AA-13-AC-DA-D5-C1-FE-D2-21-5E-D6-EF-46-17-D8-BF\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.CompilerServices.Unsafe.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:36Z</ModuleTime>\n            <ModuleName>System.Runtime.CompilerServices.Unsafe</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A1-DB-CA-49-E5-DE-15-8A-D1-27-A7-83-3B-06-C2-FD-AA-93-97-7F\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Private.Uri.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:54Z</ModuleTime>\n            <ModuleName>System.Private.Uri</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"6D-F9-F7-3E-29-9D-20-BD-2F-49-83-2B-B5-0E-C3-9A-24-10-C2-11\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Reflection.Extensions.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:36Z</ModuleTime>\n            <ModuleName>System.Reflection.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F7-22-BE-C3-24-16-7D-05-4F-01-12-91-F4-A3-B7-24-B6-01-82-06\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Reflection.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:34Z</ModuleTime>\n            <ModuleName>System.Reflection</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F9-C8-60-94-E8-BB-9F-56-AB-FF-B7-9F-17-63-1D-7D-9A-8C-5D-90\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Xml.XDocument.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:54Z</ModuleTime>\n            <ModuleName>System.Xml.XDocument</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"03-77-DB-FC-14-D5-51-16-64-85-02-C3-8C-75-4C-BB-2E-67-53-7B\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Threading.ThreadPool.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:26Z</ModuleTime>\n            <ModuleName>System.Threading.ThreadPool</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8C-61-4B-EA-81-E0-4A-28-1C-92-01-32-97-55-F9-35-20-1B-2E-63\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Private.Xml.Linq.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>System.Private.Xml.Linq</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4B-23-3C-FB-2C-87-6B-C8-B9-B3-B0-3C-FE-2A-A6-B0-EA-C8-0B-A4\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Threading.Thread.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:04Z</ModuleTime>\n            <ModuleName>System.Threading.Thread</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"76-B3-8B-2A-31-E1-F2-2D-97-5B-8E-92-73-70-7A-8F-72-E4-44-63\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Private.Xml.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>System.Private.Xml</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"1F-AD-B1-AA-7D-FE-11-BC-97-F6-46-27-D7-C8-F7-6D-53-4E-3A-41\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Xml.ReaderWriter.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:26Z</ModuleTime>\n            <ModuleName>System.Xml.ReaderWriter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"58-CE-28-9B-89-FC-5B-7D-F9-DF-DB-E2-82-9F-FB-C8-9A-65-2E-CD\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Diagnostics.Tracing.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:34Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Tracing</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E8-BD-85-B9-4C-23-55-8C-87-8C-7C-65-E6-6E-D5-8C-53-F3-85-9E\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Globalization.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:36Z</ModuleTime>\n            <ModuleName>System.Globalization</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8A-4D-83-7F-AA-13-3E-66-2D-46-E1-9A-90-2F-28-2B-4E-22-71-E0\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Security.Cryptography.Encoding.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:12Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Encoding</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5A-27-05-54-A0-35-F2-7F-AC-DF-14-14-4A-15-65-C6-AA-E1-76-BD\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Threading.Tasks.Dataflow.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:10Z</ModuleTime>\n            <ModuleName>System.Threading.Tasks.Dataflow</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9C-AF-40-D7-E0-8E-7D-55-6A-EE-BE-9D-81-85-5F-70-4C-43-3E-8F\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Security.Cryptography.Algorithms.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:02Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Algorithms</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C6-1E-E9-70-08-99-FC-7C-56-FD-99-EA-B2-77-BA-86-EC-00-3E-CD\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Security.Cryptography.Primitives.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:06Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A4-79-06-40-D5-5F-A9-60-39-5B-4E-11-23-32-9B-D2-91-70-E6-9A\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\Microsoft.Win32.Registry.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:38Z</ModuleTime>\n            <ModuleName>Microsoft.Win32.Registry</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"67-B0-AA-21-34-86-26-B5-8A-2A-DE-BD-13-F6-E1-DC-C9-A6-C9-11\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Resources.ResourceManager.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>System.Resources.ResourceManager</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"58-2E-40-A4-98-FD-50-AE-64-F0-19-8E-9E-B2-4B-5A-67-66-01-7A\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.ObjectModel.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:54Z</ModuleTime>\n            <ModuleName>System.ObjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C3-0D-A0-B1-74-3B-15-DF-A7-15-4C-96-D4-27-BF-FD-FE-00-A4-EB\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Reflection.Emit.ILGeneration.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:34Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.ILGeneration</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"82-A4-6C-57-AF-AA-D5-30-07-87-6E-51-C8-AB-EB-02-D5-17-69-13\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Reflection.Emit.Lightweight.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:00Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.Lightweight</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"49-18-F3-D0-44-80-34-0E-8A-59-5F-EC-4C-DE-3E-8A-19-82-A8-F2\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Reflection.Primitives.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:04Z</ModuleTime>\n            <ModuleName>System.Reflection.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"DA-DE-69-79-37-98-B1-CA-04-44-43-FE-4A-FD-E3-C9-B5-CC-19-CA\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Collections.Immutable.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:34Z</ModuleTime>\n            <ModuleName>System.Collections.Immutable</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D5-25-D8-6D-DE-16-5A-C7-FB-B9-80-19-52-8F-6A-37-88-78-DA-AA\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Diagnostics.TraceSource.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:08Z</ModuleTime>\n            <ModuleName>System.Diagnostics.TraceSource</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"CA-E1-1E-4D-DA-23-E4-A5-C8-E9-7D-32-47-A9-F1-A1-B3-4A-CB-56\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Threading.Tasks.Parallel.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:12Z</ModuleTime>\n            <ModuleName>System.Threading.Tasks.Parallel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5A-F8-9D-01-1A-FB-FD-64-79-EA-B5-A8-EF-E5-E8-2D-77-EA-B3-16\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.Build.Tasks.Core.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:24Z</ModuleTime>\n            <ModuleName>Microsoft.Build.Tasks.Core</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"3D-19-01-88-24-E9-C3-F4-11-53-CE-97-7B-54-B0-84-2E-70-AD-78\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.Build.Utilities.Core.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:00Z</ModuleTime>\n            <ModuleName>Microsoft.Build.Utilities.Core</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D0-19-55-D0-8A-B2-7B-B3-66-1F-3B-1F-A8-96-4F-CE-E8-BD-7B-0D\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\NuGet.Build.Tasks.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:04Z</ModuleTime>\n            <ModuleName>NuGet.Build.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"21-A3-E9-AB-05-16-E7-39-82-60-44-BC-2C-FD-79-4D-54-1B-84-D8\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\NuGet.Commands.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:38Z</ModuleTime>\n            <ModuleName>NuGet.Commands</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"46-3A-B1-67-B2-DC-96-7A-5C-03-7D-C0-C2-48-40-C5-56-DF-45-07\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\NuGet.Common.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:40Z</ModuleTime>\n            <ModuleName>NuGet.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"49-AA-09-7E-08-21-F3-64-A1-95-BC-6F-B6-DA-5F-6A-14-4F-DC-60\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Collections.NonGeneric.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>System.Collections.NonGeneric</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5A-53-4F-48-AF-B1-EB-60-21-87-B1-28-94-0A-4B-2D-BB-CE-B3-2D\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\Microsoft.Win32.Primitives.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>Microsoft.Win32.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"03-77-DB-FC-14-D5-51-16-64-85-02-C3-8C-75-4C-BB-2E-67-53-7B\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Threading.ThreadPool.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:26Z</ModuleTime>\n            <ModuleName>System.Threading.ThreadPool</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5D-AB-0B-4D-B4-3A-05-60-5D-4B-D5-E7-76-AC-94-65-12-35-7E-1D\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.IO.Pipes.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:04Z</ModuleTime>\n            <ModuleName>System.IO.Pipes</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F2-A4-B7-B1-47-C0-9D-C3-B6-28-9C-2B-4B-F6-C4-95-9C-10-D8-94\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Security.Principal.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:08Z</ModuleTime>\n            <ModuleName>System.Security.Principal</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"20-E4-29-5C-AD-EA-20-F7-EB-91-43-9A-0D-AC-E8-1B-3C-49-6C-40\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.Loader.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:00Z</ModuleTime>\n            <ModuleName>System.Runtime.Loader</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"09-5A-50-52-B3-D3-BF-96-3C-DC-65-14-23-03-98-36-D3-FC-10-BE\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.Build.NuGetSdkResolver.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:04Z</ModuleTime>\n            <ModuleName>Microsoft.Build.NuGetSdkResolver</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"3C-59-C2-6B-84-93-30-BB-4B-C0-AC-50-87-5F-19-3A-20-8F-92-34\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Diagnostics.FileVersionInfo.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:00Z</ModuleTime>\n            <ModuleName>System.Diagnostics.FileVersionInfo</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"25-0E-0B-AF-7D-43-95-8D-D9-26-1D-B6-F1-DD-43-B7-E1-0A-0F-B4\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.ComponentModel.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:34Z</ModuleTime>\n            <ModuleName>System.ComponentModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"BA-A1-94-4D-72-3E-EF-49-B2-32-E7-EE-9F-B3-FC-AD-62-1A-F8-91\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Private.CoreLib.dll</ModulePath>\n            <ModuleTime>2019-12-07T15:40:56Z</ModuleTime>\n            <ModuleName>System.Private.CoreLib</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2F-64-93-42-DC-03-FB-18-D6-2C-17-CE-34-4A-A1-1C-E2-29-83-40\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\MSBuild.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:31:42Z</ModuleTime>\n            <ModuleName>MSBuild</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"7A-56-D1-54-BC-15-85-39-DA-17-17-FE-FB-38-15-4B-78-98-E5-80\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>System.Runtime</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"58-49-87-1F-73-BC-F4-63-E6-DC-16-9A-68-00-73-51-18-DF-4D-63\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.Extensions.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:00Z</ModuleTime>\n            <ModuleName>System.Runtime.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A8-3F-3B-0D-FE-3C-B9-36-6E-33-0B-C3-CA-EE-8E-8A-E1-10-2A-F2\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Threading.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:12Z</ModuleTime>\n            <ModuleName>System.Threading</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F9-64-1E-55-2D-9C-5D-82-69-A6-84-14-0D-0F-D7-44-B3-5C-A7-06\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Threading.Tasks.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:34Z</ModuleTime>\n            <ModuleName>System.Threading.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"CE-5F-A9-D3-D8-4F-06-37-AE-9B-FA-4F-E5-3E-1E-03-B4-77-86-78\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.InteropServices.RuntimeInformation.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:58Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices.RuntimeInformation</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"73-45-14-55-A4-8E-EC-0A-1B-35-EF-E2-6D-BF-6C-6B-96-DA-7F-24\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Diagnostics.Process.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:02Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Process</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9B-E9-31-17-1E-42-BF-69-F2-8E-74-6B-F8-6B-B7-D7-F7-77-11-7F\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.ComponentModel.Primitives.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:58Z</ModuleTime>\n            <ModuleName>System.ComponentModel.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"01-21-D0-71-7C-59-2D-58-68-0F-75-5A-8C-11-80-8D-31-48-DB-B4\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Linq.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:04Z</ModuleTime>\n            <ModuleName>System.Linq</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"0A-2F-ED-78-BD-C3-89-28-67-8C-34-6A-6A-42-E0-93-AB-02-7C-5A\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Text.RegularExpressions.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:36Z</ModuleTime>\n            <ModuleName>System.Text.RegularExpressions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"7F-B3-05-BA-78-7B-90-86-20-73-A9-0B-A4-53-AD-F9-35-89-0E-88\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Collections.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:36Z</ModuleTime>\n            <ModuleName>System.Collections</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"02-FD-78-B1-DD-78-9E-C7-C1-D1-B6-B0-23-9A-FB-A3-98-A6-F6-E5\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Memory.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:08Z</ModuleTime>\n            <ModuleName>System.Memory</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FC-88-C2-48-B1-32-80-2D-6A-AC-48-B8-59-A8-F8-B0-DC-CC-A4-DB\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Buffers.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:58Z</ModuleTime>\n            <ModuleName>System.Buffers</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"6F-7C-BF-2C-C9-E7-07-66-16-9B-21-61-19-B6-01-F5-33-81-C0-88\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.IO.FileSystem.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:06Z</ModuleTime>\n            <ModuleName>System.IO.FileSystem</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"54-E5-A6-FF-F6-8C-6A-7D-CE-D2-2A-BF-D5-6B-67-60-2D-88-A0-A6\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.InteropServices.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:02Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8F-66-CA-16-CB-91-DB-F4-6A-EC-BC-C3-07-99-05-F9-D2-D5-32-A7\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Console.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>System.Console</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9A-83-5A-B5-87-CC-A8-C7-79-AC-67-E5-CA-0D-81-86-66-93-37-22\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.Build.Framework.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:24Z</ModuleTime>\n            <ModuleName>Microsoft.Build.Framework</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2C-30-02-8C-B1-A2-1B-A0-1A-27-A6-24-3D-61-D5-E6-96-9D-4C-D8\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\netstandard.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>netstandard</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"43-C9-D7-7F-9D-1E-19-77-9E-9E-DF-3E-3F-A4-54-FC-7A-B3-25-34\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.Build.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:26Z</ModuleTime>\n            <ModuleName>Microsoft.Build</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"46-D5-F8-2E-9F-A9-78-CB-94-2A-A7-6D-1A-4D-01-4A-E0-12-4B-7F\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Diagnostics.Debug.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:04Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Debug</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C2-47-82-F2-1A-DF-11-49-45-82-64-6E-9D-8A-93-CE-08-F1-9E-D9\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Text.Encoding.CodePages.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:02Z</ModuleTime>\n            <ModuleName>System.Text.Encoding.CodePages</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B0-17-92-AC-BB-F5-22-8A-22-BB-36-8A-C4-74-61-16-A1-F1-A5-17\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Collections.Concurrent.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>System.Collections.Concurrent</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5D-AB-0B-4D-B4-3A-05-60-5D-4B-D5-E7-76-AC-94-65-12-35-7E-1D\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.IO.Pipes.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:04Z</ModuleTime>\n            <ModuleName>System.IO.Pipes</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9A-B6-6B-F1-3A-E5-3C-24-16-36-C0-B2-CC-27-44-9B-73-D7-B7-58\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Text.Encoding.Extensions.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:14Z</ModuleTime>\n            <ModuleName>System.Text.Encoding.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5B-60-45-56-D8-E4-3B-37-2B-94-6A-E2-2C-4F-EA-D1-38-B9-75-0D\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Security.AccessControl.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:02Z</ModuleTime>\n            <ModuleName>System.Security.AccessControl</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"60-34-DF-B5-BF-6D-A3-2D-41-D2-11-56-0C-B6-52-0C-51-E7-A8-70\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Security.Principal.Windows.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:06Z</ModuleTime>\n            <ModuleName>System.Security.Principal.Windows</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"73-50-8C-32-9F-B0-51-50-40-3F-4F-AF-67-9D-C7-02-44-E1-7C-A2\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Security.Claims.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:36Z</ModuleTime>\n            <ModuleName>System.Security.Claims</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F2-A4-B7-B1-47-C0-9D-C3-B6-28-9C-2B-4B-F6-C4-95-9C-10-D8-94\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Security.Principal.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:08Z</ModuleTime>\n            <ModuleName>System.Security.Principal</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"95-BF-E0-EF-5B-E7-8C-85-01-46-96-EC-75-69-2F-30-93-7C-60-35\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Threading.Overlapped.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:10Z</ModuleTime>\n            <ModuleName>System.Threading.Overlapped</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4B-23-3C-FB-2C-87-6B-C8-B9-B3-B0-3C-FE-2A-A6-B0-EA-C8-0B-A4\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Threading.Thread.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:04Z</ModuleTime>\n            <ModuleName>System.Threading.Thread</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"95-BF-E0-EF-5B-E7-8C-85-01-46-96-EC-75-69-2F-30-93-7C-60-35\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Threading.Overlapped.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:10Z</ModuleTime>\n            <ModuleName>System.Threading.Overlapped</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5B-60-45-56-D8-E4-3B-37-2B-94-6A-E2-2C-4F-EA-D1-38-B9-75-0D\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Security.AccessControl.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:02Z</ModuleTime>\n            <ModuleName>System.Security.AccessControl</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"60-34-DF-B5-BF-6D-A3-2D-41-D2-11-56-0C-B6-52-0C-51-E7-A8-70\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Security.Principal.Windows.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:06Z</ModuleTime>\n            <ModuleName>System.Security.Principal.Windows</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"73-50-8C-32-9F-B0-51-50-40-3F-4F-AF-67-9D-C7-02-44-E1-7C-A2\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Security.Claims.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:36Z</ModuleTime>\n            <ModuleName>System.Security.Claims</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"58-2E-40-A4-98-FD-50-AE-64-F0-19-8E-9E-B2-4B-5A-67-66-01-7A\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.ObjectModel.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:54Z</ModuleTime>\n            <ModuleName>System.ObjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5A-27-05-54-A0-35-F2-7F-AC-DF-14-14-4A-15-65-C6-AA-E1-76-BD\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Threading.Tasks.Dataflow.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:10Z</ModuleTime>\n            <ModuleName>System.Threading.Tasks.Dataflow</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"58-CE-28-9B-89-FC-5B-7D-F9-DF-DB-E2-82-9F-FB-C8-9A-65-2E-CD\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Diagnostics.Tracing.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:34Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Tracing</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"63-C0-E7-F4-80-B3-11-B1-AB-7C-EF-FC-73-87-8F-86-CE-D6-69-5D\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\dotnet.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:30Z</ModuleTime>\n            <ModuleName>dotnet</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"65-78-30-2B-C9-50-D2-0B-61-2A-D8-09-F8-73-A7-FD-B9-8D-8E-59\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.DotNet.Configurer.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:00Z</ModuleTime>\n            <ModuleName>Microsoft.DotNet.Configurer</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"67-B0-AA-21-34-86-26-B5-8A-2A-DE-BD-13-F6-E1-DC-C9-A6-C9-11\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Resources.ResourceManager.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>System.Resources.ResourceManager</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"1F-AD-B1-AA-7D-FE-11-BC-97-F6-46-27-D7-C8-F7-6D-53-4E-3A-41\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Xml.ReaderWriter.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:26Z</ModuleTime>\n            <ModuleName>System.Xml.ReaderWriter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"76-B3-8B-2A-31-E1-F2-2D-97-5B-8E-92-73-70-7A-8F-72-E4-44-63\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Private.Xml.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>System.Private.Xml</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9C-AF-40-D7-E0-8E-7D-55-6A-EE-BE-9D-81-85-5F-70-4C-43-3E-8F\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Security.Cryptography.Algorithms.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:02Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Algorithms</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A1-DB-CA-49-E5-DE-15-8A-D1-27-A7-83-3B-06-C2-FD-AA-93-97-7F\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Private.Uri.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:54Z</ModuleTime>\n            <ModuleName>System.Private.Uri</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A4-79-06-40-D5-5F-A9-60-39-5B-4E-11-23-32-9B-D2-91-70-E6-9A\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\Microsoft.Win32.Registry.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:38Z</ModuleTime>\n            <ModuleName>Microsoft.Win32.Registry</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D5-25-D8-6D-DE-16-5A-C7-FB-B9-80-19-52-8F-6A-37-88-78-DA-AA\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Diagnostics.TraceSource.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:08Z</ModuleTime>\n            <ModuleName>System.Diagnostics.TraceSource</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"DA-DE-69-79-37-98-B1-CA-04-44-43-FE-4A-FD-E3-C9-B5-CC-19-CA\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Collections.Immutable.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:34Z</ModuleTime>\n            <ModuleName>System.Collections.Immutable</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"CA-E1-1E-4D-DA-23-E4-A5-C8-E9-7D-32-47-A9-F1-A1-B3-4A-CB-56\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Threading.Tasks.Parallel.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:12Z</ModuleTime>\n            <ModuleName>System.Threading.Tasks.Parallel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"3D-19-01-88-24-E9-C3-F4-11-53-CE-97-7B-54-B0-84-2E-70-AD-78\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.Build.Utilities.Core.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:00Z</ModuleTime>\n            <ModuleName>Microsoft.Build.Utilities.Core</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C3-0D-A0-B1-74-3B-15-DF-A7-15-4C-96-D4-27-BF-FD-FE-00-A4-EB\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Reflection.Emit.ILGeneration.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:34Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.ILGeneration</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"82-A4-6C-57-AF-AA-D5-30-07-87-6E-51-C8-AB-EB-02-D5-17-69-13\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Reflection.Emit.Lightweight.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:00Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.Lightweight</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"49-18-F3-D0-44-80-34-0E-8A-59-5F-EC-4C-DE-3E-8A-19-82-A8-F2\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Reflection.Primitives.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:04Z</ModuleTime>\n            <ModuleName>System.Reflection.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"98-61-0B-75-C8-30-E0-AD-6C-F8-89-F2-13-CA-1B-A4-AC-29-7A-6C\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.Serialization.Formatters.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Serialization.Formatters</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"98-61-0B-75-C8-30-E0-AD-6C-F8-89-F2-13-CA-1B-A4-AC-29-7A-6C\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.Serialization.Formatters.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Serialization.Formatters</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5A-F8-9D-01-1A-FB-FD-64-79-EA-B5-A8-EF-E5-E8-2D-77-EA-B3-16\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.Build.Tasks.Core.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:24Z</ModuleTime>\n            <ModuleName>Microsoft.Build.Tasks.Core</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"03-77-DB-FC-14-D5-51-16-64-85-02-C3-8C-75-4C-BB-2E-67-53-7B\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Threading.ThreadPool.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:26Z</ModuleTime>\n            <ModuleName>System.Threading.ThreadPool</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"55-48-DD-00-53-52-46-3C-83-4D-73-EF-CF-FB-AD-30-A3-75-B0-E4\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Sdks\\Microsoft.NET.Sdk\\targets\\..\\tools\\netcoreapp2.1/Microsoft.NET.Build.Tasks.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:40Z</ModuleTime>\n            <ModuleName>Microsoft.NET.Build.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"20-E4-29-5C-AD-EA-20-F7-EB-91-43-9A-0D-AC-E8-1B-3C-49-6C-40\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.Loader.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:00Z</ModuleTime>\n            <ModuleName>System.Runtime.Loader</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"03-28-A9-BB-FA-B4-8F-A7-A3-77-17-9E-21-77-4B-F5-EA-93-2D-F2\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\NuGet.Frameworks.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:38Z</ModuleTime>\n            <ModuleName>NuGet.Frameworks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"55-48-DD-00-53-52-46-3C-83-4D-73-EF-CF-FB-AD-30-A3-75-B0-E4\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Sdks\\Microsoft.NET.Sdk\\targets\\..\\tools\\netcoreapp2.1/Microsoft.NET.Build.Tasks.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:40Z</ModuleTime>\n            <ModuleName>Microsoft.NET.Build.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"03-28-A9-BB-FA-B4-8F-A7-A3-77-17-9E-21-77-4B-F5-EA-93-2D-F2\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\NuGet.Frameworks.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:38Z</ModuleTime>\n            <ModuleName>NuGet.Frameworks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4A-A7-17-7E-D9-22-0D-81-BB-29-56-F3-F4-AC-10-02-2B-F6-A9-52\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\NuGet.Configuration.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:38Z</ModuleTime>\n            <ModuleName>NuGet.Configuration</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D0-19-55-D0-8A-B2-7B-B3-66-1F-3B-1F-A8-96-4F-CE-E8-BD-7B-0D\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\NuGet.Build.Tasks.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:04Z</ModuleTime>\n            <ModuleName>NuGet.Build.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"21-A3-E9-AB-05-16-E7-39-82-60-44-BC-2C-FD-79-4D-54-1B-84-D8\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\NuGet.Commands.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:38Z</ModuleTime>\n            <ModuleName>NuGet.Commands</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"46-3A-B1-67-B2-DC-96-7A-5C-03-7D-C0-C2-48-40-C5-56-DF-45-07\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\NuGet.Common.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:40Z</ModuleTime>\n            <ModuleName>NuGet.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4A-A7-17-7E-D9-22-0D-81-BB-29-56-F3-F4-AC-10-02-2B-F6-A9-52\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\NuGet.Configuration.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:38Z</ModuleTime>\n            <ModuleName>NuGet.Configuration</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"49-AA-09-7E-08-21-F3-64-A1-95-BC-6F-B6-DA-5F-6A-14-4F-DC-60\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Collections.NonGeneric.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>System.Collections.NonGeneric</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5A-53-4F-48-AF-B1-EB-60-21-87-B1-28-94-0A-4B-2D-BB-CE-B3-2D\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\Microsoft.Win32.Primitives.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>Microsoft.Win32.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F9-C8-60-94-E8-BB-9F-56-AB-FF-B7-9F-17-63-1D-7D-9A-8C-5D-90\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Xml.XDocument.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:54Z</ModuleTime>\n            <ModuleName>System.Xml.XDocument</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8C-61-4B-EA-81-E0-4A-28-1C-92-01-32-97-55-F9-35-20-1B-2E-63\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Private.Xml.Linq.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>System.Private.Xml.Linq</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C6-1E-E9-70-08-99-FC-7C-56-FD-99-EA-B2-77-BA-86-EC-00-3E-CD\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Security.Cryptography.Primitives.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:06Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E4-D9-D6-A8-94-E5-9B-B4-DF-D9-7E-09-C9-A6-5C-50-4B-2B-59-1C\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\NuGet.ProjectModel.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:38Z</ModuleTime>\n            <ModuleName>NuGet.ProjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2E-23-9E-41-E8-43-F3-DD-69-8B-D3-1C-D9-E1-66-E0-53-48-22-B3\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\NuGet.Versioning.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:02Z</ModuleTime>\n            <ModuleName>NuGet.Versioning</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E4-D9-D6-A8-94-E5-9B-B4-DF-D9-7E-09-C9-A6-5C-50-4B-2B-59-1C\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\NuGet.ProjectModel.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:38Z</ModuleTime>\n            <ModuleName>NuGet.ProjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2E-23-9E-41-E8-43-F3-DD-69-8B-D3-1C-D9-E1-66-E0-53-48-22-B3\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\NuGet.Versioning.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:02Z</ModuleTime>\n            <ModuleName>NuGet.Versioning</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FD-04-58-11-C2-D9-3D-04-F0-CD-AD-A3-8D-52-9E-EB-45-5E-15-35\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\NuGet.Credentials.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:38Z</ModuleTime>\n            <ModuleName>NuGet.Credentials</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A8-DD-BC-66-54-8A-3E-85-E6-48-84-72-D2-81-CB-07-10-4E-D5-32\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\NuGet.Protocol.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:02Z</ModuleTime>\n            <ModuleName>NuGet.Protocol</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"47-B3-3F-43-BA-2D-BB-14-69-51-0A-2D-88-EF-AE-58-6F-7F-FD-F3\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\NuGet.Packaging.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:38Z</ModuleTime>\n            <ModuleName>NuGet.Packaging</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E6-23-80-78-90-03-92-43-10-5A-67-39-41-83-38-CF-E3-C2-D7-08\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\NuGet.DependencyResolver.Core.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:38Z</ModuleTime>\n            <ModuleName>NuGet.DependencyResolver.Core</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D0-D6-02-0D-1E-72-EF-FA-35-D7-EB-ED-21-5E-50-93-EF-7A-F4-6C\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Newtonsoft.Json.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:31:52Z</ModuleTime>\n            <ModuleName>Newtonsoft.Json</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"24-7F-75-4C-5B-7C-D3-B7-52-3F-7F-21-6C-28-29-FF-18-EA-2A-A2\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Linq.Expressions.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:12Z</ModuleTime>\n            <ModuleName>System.Linq.Expressions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"89-99-BB-FA-78-89-D1-A8-BB-F8-EE-D4-36-89-85-28-3A-00-0E-EE\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.ComponentModel.TypeConverter.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:34Z</ModuleTime>\n            <ModuleName>System.ComponentModel.TypeConverter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5D-DA-51-48-69-5D-6B-39-70-C8-BB-91-C2-57-A3-DB-DA-93-96-4E\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\NuGet.LibraryModel.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:40Z</ModuleTime>\n            <ModuleName>NuGet.LibraryModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9E-DA-78-14-0A-C5-AB-B7-4F-89-4F-47-02-8F-3B-CF-88-0B-07-5D\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.Numerics.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:06Z</ModuleTime>\n            <ModuleName>System.Runtime.Numerics</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"16-CF-B2-3A-6D-82-A8-87-9C-5F-7D-2E-A3-34-A3-60-C7-83-55-EC\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.Serialization.Primitives.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:06Z</ModuleTime>\n            <ModuleName>System.Runtime.Serialization.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"34-F4-E0-89-89-8C-43-6F-D3-89-90-92-E4-36-65-02-8C-ED-17-5E\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.TestPlatform.Build.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:04Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.Build</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"AA-B7-09-DD-FB-08-41-1C-FE-DD-92-6D-89-D0-A8-25-EF-11-34-C0\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\mscorlib.dll</ModulePath>\n            <ModuleTime>2019-12-08T15:31:44Z</ModuleTime>\n            <ModuleName>mscorlib</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"BE-9A-5D-A1-AA-13-AC-DA-D5-C1-FE-D2-21-5E-D6-EF-46-17-D8-BF\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.CompilerServices.Unsafe.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:36Z</ModuleTime>\n            <ModuleName>System.Runtime.CompilerServices.Unsafe</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D0-D6-02-0D-1E-72-EF-FA-35-D7-EB-ED-21-5E-50-93-EF-7A-F4-6C\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Newtonsoft.Json.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:31:52Z</ModuleTime>\n            <ModuleName>Newtonsoft.Json</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"AA-B7-09-DD-FB-08-41-1C-FE-DD-92-6D-89-D0-A8-25-EF-11-34-C0\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\mscorlib.dll</ModulePath>\n            <ModuleTime>2019-12-08T15:31:44Z</ModuleTime>\n            <ModuleName>mscorlib</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"24-7F-75-4C-5B-7C-D3-B7-52-3F-7F-21-6C-28-29-FF-18-EA-2A-A2\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Linq.Expressions.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:12Z</ModuleTime>\n            <ModuleName>System.Linq.Expressions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"89-99-BB-FA-78-89-D1-A8-BB-F8-EE-D4-36-89-85-28-3A-00-0E-EE\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.ComponentModel.TypeConverter.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:34Z</ModuleTime>\n            <ModuleName>System.ComponentModel.TypeConverter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"34-F4-E0-89-89-8C-43-6F-D3-89-90-92-E4-36-65-02-8C-ED-17-5E\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.TestPlatform.Build.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:04Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.Build</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9E-DA-78-14-0A-C5-AB-B7-4F-89-4F-47-02-8F-3B-CF-88-0B-07-5D\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.Numerics.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:06Z</ModuleTime>\n            <ModuleName>System.Runtime.Numerics</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"82-8D-BA-AC-40-85-10-CA-B8-7F-36-2B-6D-AE-A0-F3-2B-F1-B5-F0\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Diagnostics.Tools.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:00Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Tools</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E1-64-90-F4-41-89-3C-1E-7E-3F-55-45-8A-DE-E0-4C-12-C0-CF-75\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.IO.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:34Z</ModuleTime>\n            <ModuleName>System.IO</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"51-D2-F8-10-1F-22-A8-6B-7A-C1-7A-EF-51-5D-75-B1-8B-9B-90-26\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Text.Encoding.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:14Z</ModuleTime>\n            <ModuleName>System.Text.Encoding</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"81-43-50-E3-13-36-9A-61-6C-4D-39-82-8F-7C-96-DB-6B-E6-B3-A2\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.IO.Compression.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:02Z</ModuleTime>\n            <ModuleName>System.IO.Compression</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"25-0E-0B-AF-7D-43-95-8D-D9-26-1D-B6-F1-DD-43-B7-E1-0A-0F-B4\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.ComponentModel.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:34Z</ModuleTime>\n            <ModuleName>System.ComponentModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"47-B3-3F-43-BA-2D-BB-14-69-51-0A-2D-88-EF-AE-58-6F-7F-FD-F3\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\NuGet.Packaging.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:38Z</ModuleTime>\n            <ModuleName>NuGet.Packaging</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"69-FE-D8-1A-39-46-E9-D5-38-AB-56-03-9C-A7-0F-45-ED-B2-D5-89\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Net.Http.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:04Z</ModuleTime>\n            <ModuleName>System.Net.Http</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"18-FA-0D-95-F1-C9-6C-5F-3D-ED-64-F5-E7-EA-F2-93-72-0C-61-3D\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Net.Primitives.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:54Z</ModuleTime>\n            <ModuleName>System.Net.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5D-DA-51-48-69-5D-6B-39-70-C8-BB-91-C2-57-A3-DB-DA-93-96-4E\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\NuGet.LibraryModel.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:40Z</ModuleTime>\n            <ModuleName>NuGet.LibraryModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"35-6E-74-A3-51-5E-E3-83-2D-F5-67-19-F3-95-CB-7A-CF-15-60-CA\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Net.Security.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>System.Net.Security</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"6A-14-D9-A1-75-17-BF-9F-6B-FB-5F-B5-AC-8A-2C-94-97-A6-50-92\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Security.Cryptography.X509Certificates.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:36Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.X509Certificates</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4F-0A-ED-F6-02-69-AD-2A-C5-2B-2C-93-BD-A8-93-87-63-5A-5E-FD\">\n            <ModulePath>D:\\git\\BranchCoveragePoc\\.sonarqube\\bin\\SonarScanner.MSBuild.Tasks.dll</ModulePath>\n            <ModuleTime>2019-11-06T10:01:08Z</ModuleTime>\n            <ModuleName>SonarScanner.MSBuild.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"06-FE-91-56-B3-97-3C-54-B4-DF-B8-F2-2C-63-4C-B2-7B-B5-56-11\">\n            <ModulePath>D:\\git\\BranchCoveragePoc\\.sonarqube\\bin\\SonarScanner.MSBuild.Common.dll</ModulePath>\n            <ModuleTime>2019-11-06T10:01:08Z</ModuleTime>\n            <ModuleName>SonarScanner.MSBuild.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"07-EA-C2-66-42-49-0A-54-2F-18-2A-05-2C-3F-68-E6-12-C9-A7-EC\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Xml.XmlSerializer.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:26Z</ModuleTime>\n            <ModuleName>System.Xml.XmlSerializer</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C2-42-54-77-18-FE-3E-E2-AE-9A-1E-87-6C-70-F3-6B-7B-52-D6-04\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Reflection.Emit.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:54Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"\">\n            <ModulePath>RefEmit_InMemoryManifestModule</ModulePath>\n            <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n            <ModuleName>Microsoft.GeneratedCode</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"\">\n            <ModulePath>RefEmit_InMemoryManifestModule</ModulePath>\n            <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n            <ModuleName>Microsoft.GeneratedCode</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"27-EF-8B-B4-BA-F8-4C-96-92-F2-33-1C-93-79-99-47-94-16-7B-4B\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Roslyn\\Microsoft.Build.Tasks.CodeAnalysis.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:36Z</ModuleTime>\n            <ModuleName>Microsoft.Build.Tasks.CodeAnalysis</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8B-BF-45-5B-30-8B-EF-57-2D-E2-D6-C0-10-72-FC-8E-BD-E1-94-AD\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.Extensions.DependencyModel.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:04Z</ModuleTime>\n            <ModuleName>Microsoft.Extensions.DependencyModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B3-EF-49-CE-72-BC-72-30-16-64-3F-F6-65-73-C2-FC-8C-8D-62-30\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Text.Json.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:04Z</ModuleTime>\n            <ModuleName>System.Text.Json</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"38-60-88-15-1A-12-66-65-4C-5D-BA-6D-05-AD-1C-4F-10-09-9B-EF\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Text.Encodings.Web.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:04Z</ModuleTime>\n            <ModuleName>System.Text.Encodings.Web</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"\">\n            <ModulePath>RefEmit_InMemoryManifestModule</ModulePath>\n            <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n            <ModuleName>Microsoft.GeneratedCode</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"18-FA-0D-95-F1-C9-6C-5F-3D-ED-64-F5-E7-EA-F2-93-72-0C-61-3D\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Net.Primitives.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:54Z</ModuleTime>\n            <ModuleName>System.Net.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"22-A8-F5-E3-76-6D-F2-86-CF-DE-A4-88-69-C5-81-D9-C0-00-CD-C8\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Core.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:10Z</ModuleTime>\n            <ModuleName>System.Core</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"12-F1-70-D9-0A-18-39-5C-75-1D-25-44-E5-AC-87-40-FE-83-04-E8\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Reflection.Metadata.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:36Z</ModuleTime>\n            <ModuleName>System.Reflection.Metadata</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A2-A5-B2-74-6E-8B-49-CE-B5-DC-F4-C6-3B-B7-25-BE-48-DC-E7-21\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.IO.MemoryMappedFiles.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:08Z</ModuleTime>\n            <ModuleName>System.IO.MemoryMappedFiles</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4F-0A-ED-F6-02-69-AD-2A-C5-2B-2C-93-BD-A8-93-87-63-5A-5E-FD\">\n            <ModulePath>D:\\git\\BranchCoveragePoc\\.sonarqube\\bin\\SonarScanner.MSBuild.Tasks.dll</ModulePath>\n            <ModuleTime>2019-11-06T10:01:08Z</ModuleTime>\n            <ModuleName>SonarScanner.MSBuild.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"06-FE-91-56-B3-97-3C-54-B4-DF-B8-F2-2C-63-4C-B2-7B-B5-56-11\">\n            <ModulePath>D:\\git\\BranchCoveragePoc\\.sonarqube\\bin\\SonarScanner.MSBuild.Common.dll</ModulePath>\n            <ModuleTime>2019-11-06T10:01:08Z</ModuleTime>\n            <ModuleName>SonarScanner.MSBuild.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"07-EA-C2-66-42-49-0A-54-2F-18-2A-05-2C-3F-68-E6-12-C9-A7-EC\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Xml.XmlSerializer.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:26Z</ModuleTime>\n            <ModuleName>System.Xml.XmlSerializer</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C2-42-54-77-18-FE-3E-E2-AE-9A-1E-87-6C-70-F3-6B-7B-52-D6-04\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Reflection.Emit.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:54Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"\">\n            <ModulePath>RefEmit_InMemoryManifestModule</ModulePath>\n            <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n            <ModuleName>Microsoft.GeneratedCode</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"27-EF-8B-B4-BA-F8-4C-96-92-F2-33-1C-93-79-99-47-94-16-7B-4B\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Roslyn\\Microsoft.Build.Tasks.CodeAnalysis.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:36Z</ModuleTime>\n            <ModuleName>Microsoft.Build.Tasks.CodeAnalysis</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8B-BF-45-5B-30-8B-EF-57-2D-E2-D6-C0-10-72-FC-8E-BD-E1-94-AD\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.Extensions.DependencyModel.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:04Z</ModuleTime>\n            <ModuleName>Microsoft.Extensions.DependencyModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C4-93-DE-A7-BF-47-C1-77-13-D8-6B-BC-03-6A-0C-BB-0A-39-99-F9\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.DotNet.PlatformAbstractions.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:38Z</ModuleTime>\n            <ModuleName>Microsoft.DotNet.PlatformAbstractions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"3C-59-C2-6B-84-93-30-BB-4B-C0-AC-50-87-5F-19-3A-20-8F-92-34\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Diagnostics.FileVersionInfo.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:00Z</ModuleTime>\n            <ModuleName>System.Diagnostics.FileVersionInfo</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B3-EF-49-CE-72-BC-72-30-16-64-3F-F6-65-73-C2-FC-8C-8D-62-30\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Text.Json.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:04Z</ModuleTime>\n            <ModuleName>System.Text.Json</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"38-60-88-15-1A-12-66-65-4C-5D-BA-6D-05-AD-1C-4F-10-09-9B-EF\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Text.Encodings.Web.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:04Z</ModuleTime>\n            <ModuleName>System.Text.Encodings.Web</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"16-CF-B2-3A-6D-82-A8-87-9C-5F-7D-2E-A3-34-A3-60-C7-83-55-EC\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.Serialization.Primitives.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:06Z</ModuleTime>\n            <ModuleName>System.Runtime.Serialization.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"EA-12-21-C4-D9-0B-9A-F1-26-93-39-CE-0E-F7-9A-26-42-08-D1-3B\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Collections.Specialized.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:12Z</ModuleTime>\n            <ModuleName>System.Collections.Specialized</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"26-5D-42-00-2D-A2-AA-74-6F-2C-42-DE-1A-F9-93-F5-DD-5A-32-DE\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Drawing.Primitives.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:00Z</ModuleTime>\n            <ModuleName>System.Drawing.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"84-C7-9C-58-E1-F8-94-3C-D2-FD-77-39-FC-CB-FB-53-83-21-9A-32\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Data.Common.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:58Z</ModuleTime>\n            <ModuleName>System.Data.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"\">\n            <ModulePath>RefEmit_InMemoryManifestModule</ModulePath>\n            <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n            <ModuleName>Anonymously Hosted DynamicMethods Assembly</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"\">\n            <ModulePath>RefEmit_InMemoryManifestModule</ModulePath>\n            <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n            <ModuleName>Microsoft.GeneratedCode</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"BA-A1-94-4D-72-3E-EF-49-B2-32-E7-EE-9F-B3-FC-AD-62-1A-F8-91\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Private.CoreLib.dll</ModulePath>\n            <ModuleTime>2019-12-07T15:40:56Z</ModuleTime>\n            <ModuleName>System.Private.CoreLib</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C4-71-91-CE-72-56-9A-52-5C-62-92-A2-91-66-71-41-67-1A-67-C2\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\vstest.console.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:02Z</ModuleTime>\n            <ModuleName>vstest.console</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"7A-56-D1-54-BC-15-85-39-DA-17-17-FE-FB-38-15-4B-78-98-E5-80\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>System.Runtime</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"73-45-14-55-A4-8E-EC-0A-1B-35-EF-E2-6D-BF-6C-6B-96-DA-7F-24\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Diagnostics.Process.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:02Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Process</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9B-E9-31-17-1E-42-BF-69-F2-8E-74-6B-F8-6B-B7-D7-F7-77-11-7F\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.ComponentModel.Primitives.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:58Z</ModuleTime>\n            <ModuleName>System.ComponentModel.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"58-49-87-1F-73-BC-F4-63-E6-DC-16-9A-68-00-73-51-18-DF-4D-63\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.Extensions.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:00Z</ModuleTime>\n            <ModuleName>System.Runtime.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"CD-D2-C6-C5-06-62-C3-BB-87-3D-4A-75-B0-DD-2C-B0-3C-FC-DC-39\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.TestPlatform.CoreUtilities.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:30Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.CoreUtilities</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2C-30-02-8C-B1-A2-1B-A0-1A-27-A6-24-3D-61-D5-E6-96-9D-4C-D8\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\netstandard.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>netstandard</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"46-D5-F8-2E-9F-A9-78-CB-94-2A-A7-6D-1A-4D-01-4A-E0-12-4B-7F\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Diagnostics.Debug.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:04Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Debug</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4B-23-3C-FB-2C-87-6B-C8-B9-B3-B0-3C-FE-2A-A6-B0-EA-C8-0B-A4\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Threading.Thread.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:04Z</ModuleTime>\n            <ModuleName>System.Threading.Thread</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A8-3F-3B-0D-FE-3C-B9-36-6E-33-0B-C3-CA-EE-8E-8A-E1-10-2A-F2\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Threading.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:12Z</ModuleTime>\n            <ModuleName>System.Threading</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8F-66-CA-16-CB-91-DB-F4-6A-EC-BC-C3-07-99-05-F9-D2-D5-32-A7\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Console.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>System.Console</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9A-B6-6B-F1-3A-E5-3C-24-16-36-C0-B2-CC-27-44-9B-73-D7-B7-58\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Text.Encoding.Extensions.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:14Z</ModuleTime>\n            <ModuleName>System.Text.Encoding.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"58-CE-28-9B-89-FC-5B-7D-F9-DF-DB-E2-82-9F-FB-C8-9A-65-2E-CD\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Diagnostics.Tracing.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:34Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Tracing</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"7F-B3-05-BA-78-7B-90-86-20-73-A9-0B-A4-53-AD-F9-35-89-0E-88\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Collections.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:36Z</ModuleTime>\n            <ModuleName>System.Collections</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"98-E9-7A-2E-F4-E1-82-47-E8-98-04-6B-4A-2B-72-F2-30-8D-E3-23\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:26Z</ModuleTime>\n            <ModuleName>Microsoft.VisualStudio.TestPlatform.ObjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A3-74-2C-70-8F-BE-40-99-8F-68-2F-2C-9B-AA-8F-1A-4C-6C-EB-35\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.VisualStudio.TestPlatform.Client.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:26Z</ModuleTime>\n            <ModuleName>Microsoft.VisualStudio.TestPlatform.Client</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"AB-C1-BD-99-58-55-02-6C-B7-31-56-05-D1-DD-57-B7-97-D4-A0-BA\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.VisualStudio.TestPlatform.Common.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:28Z</ModuleTime>\n            <ModuleName>Microsoft.VisualStudio.TestPlatform.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"01-21-D0-71-7C-59-2D-58-68-0F-75-5A-8C-11-80-8D-31-48-DB-B4\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Linq.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:04Z</ModuleTime>\n            <ModuleName>System.Linq</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"54-E5-A6-FF-F6-8C-6A-7D-CE-D2-2A-BF-D5-6B-67-60-2D-88-A0-A6\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.InteropServices.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:02Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"67-B0-AA-21-34-86-26-B5-8A-2A-DE-BD-13-F6-E1-DC-C9-A6-C9-11\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Resources.ResourceManager.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>System.Resources.ResourceManager</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"6F-7C-BF-2C-C9-E7-07-66-16-9B-21-61-19-B6-01-F5-33-81-C0-88\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.IO.FileSystem.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:06Z</ModuleTime>\n            <ModuleName>System.IO.FileSystem</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"1F-AD-B1-AA-7D-FE-11-BC-97-F6-46-27-D7-C8-F7-6D-53-4E-3A-41\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Xml.ReaderWriter.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:26Z</ModuleTime>\n            <ModuleName>System.Xml.ReaderWriter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"76-B3-8B-2A-31-E1-F2-2D-97-5B-8E-92-73-70-7A-8F-72-E4-44-63\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Private.Xml.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>System.Private.Xml</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"6F-13-4C-60-9C-BE-3F-0E-05-2E-A5-D4-0D-41-3F-C7-FF-52-70-2E\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.TestPlatform.PlatformAbstractions.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:24Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.PlatformAbstractions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"82-EA-07-24-3A-6F-5A-1E-6B-83-3D-53-F8-78-E2-13-3B-0C-20-B4\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.TestPlatform.Utilities.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:32Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.Utilities</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"CE-5F-A9-D3-D8-4F-06-37-AE-9B-FA-4F-E5-3E-1E-03-B4-77-86-78\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.InteropServices.RuntimeInformation.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:58Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices.RuntimeInformation</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"03-28-A9-BB-FA-B4-8F-A7-A3-77-17-9E-21-77-4B-F5-EA-93-2D-F2\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\NuGet.Frameworks.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:38Z</ModuleTime>\n            <ModuleName>NuGet.Frameworks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A1-DB-CA-49-E5-DE-15-8A-D1-27-A7-83-3B-06-C2-FD-AA-93-97-7F\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Private.Uri.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:54Z</ModuleTime>\n            <ModuleName>System.Private.Uri</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"02-FD-78-B1-DD-78-9E-C7-C1-D1-B6-B0-23-9A-FB-A3-98-A6-F6-E5\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Memory.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:08Z</ModuleTime>\n            <ModuleName>System.Memory</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9C-AF-40-D7-E0-8E-7D-55-6A-EE-BE-9D-81-85-5F-70-4C-43-3E-8F\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Security.Cryptography.Algorithms.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:02Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Algorithms</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D5-25-D8-6D-DE-16-5A-C7-FB-B9-80-19-52-8F-6A-37-88-78-DA-AA\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Diagnostics.TraceSource.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:08Z</ModuleTime>\n            <ModuleName>System.Diagnostics.TraceSource</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"03-77-DB-FC-14-D5-51-16-64-85-02-C3-8C-75-4C-BB-2E-67-53-7B\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Threading.ThreadPool.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:26Z</ModuleTime>\n            <ModuleName>System.Threading.ThreadPool</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"49-AA-09-7E-08-21-F3-64-A1-95-BC-6F-B6-DA-5F-6A-14-4F-DC-60\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Collections.NonGeneric.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>System.Collections.NonGeneric</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A0-6E-A1-BC-AF-8B-5D-CE-6F-24-75-F1-8F-35-DD-AC-0C-BF-A2-67\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.Extensions.FileSystemGlobbing.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:38Z</ModuleTime>\n            <ModuleName>Microsoft.Extensions.FileSystemGlobbing</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"1D-35-6A-1A-0C-00-98-D6-0A-7D-07-A0-8A-BE-09-EB-83-90-9F-1B\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.TestPlatform.CrossPlatEngine.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:28Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.CrossPlatEngine</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"20-E4-29-5C-AD-EA-20-F7-EB-91-43-9A-0D-AC-E8-1B-3C-49-6C-40\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.Loader.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:00Z</ModuleTime>\n            <ModuleName>System.Runtime.Loader</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"CE-6F-A6-A1-E9-78-08-63-14-76-8E-10-65-9D-4C-5E-CE-91-13-39\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Extensions\\Microsoft.TestPlatform.Extensions.BlameDataCollector.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:00Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.Extensions.BlameDataCollector</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"26-8E-67-2F-F9-B2-58-15-79-C3-30-51-AF-DF-A6-AE-93-9D-A1-79\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Extensions\\Microsoft.TestPlatform.Extensions.EventLogCollector.dll</ModulePath>\n            <ModuleTime>2019-09-19T04:32:14Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.Extensions.EventLogCollector</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"AA-B7-09-DD-FB-08-41-1C-FE-DD-92-6D-89-D0-A8-25-EF-11-34-C0\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\mscorlib.dll</ModulePath>\n            <ModuleTime>2019-12-08T15:31:44Z</ModuleTime>\n            <ModuleName>mscorlib</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"85-07-D5-5D-5B-FC-21-81-E5-A7-AA-D3-4F-B0-95-78-56-23-98-FA\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Xml.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:26Z</ModuleTime>\n            <ModuleName>System.Xml</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"57-22-F4-A7-FE-D9-C5-79-57-D3-9A-67-08-22-36-48-F4-F8-33-16\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Extensions\\Microsoft.TestPlatform.TestHostRuntimeProvider.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:34Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.TestHostRuntimeProvider</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F9-64-1E-55-2D-9C-5D-82-69-A6-84-14-0D-0F-D7-44-B3-5C-A7-06\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Threading.Tasks.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:34Z</ModuleTime>\n            <ModuleName>System.Threading.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"13-C5-12-23-05-EB-02-FF-B2-E5-32-71-18-2F-9E-9C-DD-A2-23-4C\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.Html.TestLogger.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:02Z</ModuleTime>\n            <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.Html.TestLogger</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"55-32-97-2D-60-7D-DB-D6-F9-95-19-7A-4A-E2-C3-1B-87-B7-C3-79\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:28Z</ModuleTime>\n            <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"12-F1-70-D9-0A-18-39-5C-75-1D-25-44-E5-AC-87-40-FE-83-04-E8\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Reflection.Metadata.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:36Z</ModuleTime>\n            <ModuleName>System.Reflection.Metadata</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"DA-DE-69-79-37-98-B1-CA-04-44-43-FE-4A-FD-E3-C9-B5-CC-19-CA\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Collections.Immutable.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:34Z</ModuleTime>\n            <ModuleName>System.Collections.Immutable</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5A-53-4F-48-AF-B1-EB-60-21-87-B1-28-94-0A-4B-2D-BB-CE-B3-2D\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\Microsoft.Win32.Primitives.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>Microsoft.Win32.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"3F-57-4D-43-06-A0-2E-31-79-1E-ED-1C-4D-37-9B-40-5D-4D-D7-16\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.TestPlatform.CommunicationUtilities.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:04Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.CommunicationUtilities</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D0-D6-02-0D-1E-72-EF-FA-35-D7-EB-ED-21-5E-50-93-EF-7A-F4-6C\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Newtonsoft.Json.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:31:52Z</ModuleTime>\n            <ModuleName>Newtonsoft.Json</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"98-61-0B-75-C8-30-E0-AD-6C-F8-89-F2-13-CA-1B-A4-AC-29-7A-6C\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.Serialization.Formatters.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Serialization.Formatters</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B0-17-92-AC-BB-F5-22-8A-22-BB-36-8A-C4-74-61-16-A1-F1-A5-17\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Collections.Concurrent.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>System.Collections.Concurrent</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5D-87-E8-9C-AD-E0-CD-8D-80-D6-09-41-BD-4A-7B-BC-5F-20-2E-5E\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Threading.Timer.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:54Z</ModuleTime>\n            <ModuleName>System.Threading.Timer</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"18-FA-0D-95-F1-C9-6C-5F-3D-ED-64-F5-E7-EA-F2-93-72-0C-61-3D\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Net.Primitives.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:54Z</ModuleTime>\n            <ModuleName>System.Net.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C7-D3-F3-7A-48-47-11-9F-C2-F9-13-66-EA-B5-D6-3D-55-B9-84-22\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Net.Sockets.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:58Z</ModuleTime>\n            <ModuleName>System.Net.Sockets</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"95-BF-E0-EF-5B-E7-8C-85-01-46-96-EC-75-69-2F-30-93-7C-60-35\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Threading.Overlapped.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:10Z</ModuleTime>\n            <ModuleName>System.Threading.Overlapped</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"87-F8-C6-FF-25-C3-3B-82-BB-F1-23-76-08-22-22-37-9C-C7-7D-DC\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Net.NameResolution.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:38Z</ModuleTime>\n            <ModuleName>System.Net.NameResolution</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8B-BF-45-5B-30-8B-EF-57-2D-E2-D6-C0-10-72-FC-8E-BD-E1-94-AD\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Microsoft.Extensions.DependencyModel.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:04Z</ModuleTime>\n            <ModuleName>Microsoft.Extensions.DependencyModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"24-7F-75-4C-5B-7C-D3-B7-52-3F-7F-21-6C-28-29-FF-18-EA-2A-A2\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Linq.Expressions.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:12Z</ModuleTime>\n            <ModuleName>System.Linq.Expressions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"89-99-BB-FA-78-89-D1-A8-BB-F8-EE-D4-36-89-85-28-3A-00-0E-EE\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.ComponentModel.TypeConverter.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:34Z</ModuleTime>\n            <ModuleName>System.ComponentModel.TypeConverter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"58-2E-40-A4-98-FD-50-AE-64-F0-19-8E-9E-B2-4B-5A-67-66-01-7A\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.ObjectModel.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:54Z</ModuleTime>\n            <ModuleName>System.ObjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B3-EF-49-CE-72-BC-72-30-16-64-3F-F6-65-73-C2-FC-8C-8D-62-30\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Text.Json.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:04Z</ModuleTime>\n            <ModuleName>System.Text.Json</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FC-88-C2-48-B1-32-80-2D-6A-AC-48-B8-59-A8-F8-B0-DC-CC-A4-DB\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Buffers.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:58Z</ModuleTime>\n            <ModuleName>System.Buffers</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"92-BA-53-E7-E1-15-AB-FA-47-F7-C9-76-E0-A3-56-9F-E4-39-43-15\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Numerics.Vectors.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:58Z</ModuleTime>\n            <ModuleName>System.Numerics.Vectors</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"BE-9A-5D-A1-AA-13-AC-DA-D5-C1-FE-D2-21-5E-D6-EF-46-17-D8-BF\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.CompilerServices.Unsafe.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:36Z</ModuleTime>\n            <ModuleName>System.Runtime.CompilerServices.Unsafe</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9E-DA-78-14-0A-C5-AB-B7-4F-89-4F-47-02-8F-3B-CF-88-0B-07-5D\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.Numerics.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:06Z</ModuleTime>\n            <ModuleName>System.Runtime.Numerics</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"BA-A1-94-4D-72-3E-EF-49-B2-32-E7-EE-9F-B3-FC-AD-62-1A-F8-91\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Private.CoreLib.dll</ModulePath>\n            <ModuleTime>2019-12-07T15:40:56Z</ModuleTime>\n            <ModuleName>System.Private.CoreLib</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"70-DD-87-21-D4-27-59-F1-2C-86-9F-AF-78-F6-FE-D6-13-25-AC-43\">\n            <ModulePath>D:\\git\\BranchCoveragePoc\\BranchCoveragePoc.Tests\\bin\\Debug\\netcoreapp3.1\\testhost.dll</ModulePath>\n            <ModuleTime>2019-10-24T23:20:02Z</ModuleTime>\n            <ModuleName>testhost</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"7A-56-D1-54-BC-15-85-39-DA-17-17-FE-FB-38-15-4B-78-98-E5-80\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>System.Runtime</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"82-51-73-4E-B7-D2-16-2E-C0-8E-C4-E6-62-93-07-C8-18-AE-1F-E3\">\n            <ModulePath>D:\\git\\BranchCoveragePoc\\BranchCoveragePoc.Tests\\bin\\Debug\\netcoreapp3.1\\Microsoft.TestPlatform.CoreUtilities.dll</ModulePath>\n            <ModuleTime>2019-10-24T23:20:00Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.CoreUtilities</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2C-30-02-8C-B1-A2-1B-A0-1A-27-A6-24-3D-61-D5-E6-96-9D-4C-D8\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\netstandard.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>netstandard</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"58-CE-28-9B-89-FC-5B-7D-F9-DF-DB-E2-82-9F-FB-C8-9A-65-2E-CD\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Diagnostics.Tracing.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:34Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Tracing</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"3C-3B-BB-1E-4C-23-A0-8A-AE-82-07-50-C4-BD-55-77-FD-48-A8-43\">\n            <ModulePath>D:\\git\\BranchCoveragePoc\\BranchCoveragePoc.Tests\\bin\\Debug\\netcoreapp3.1\\Microsoft.TestPlatform.PlatformAbstractions.dll</ModulePath>\n            <ModuleTime>2019-10-24T23:20:00Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.PlatformAbstractions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"58-49-87-1F-73-BC-F4-63-E6-DC-16-9A-68-00-73-51-18-DF-4D-63\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.Extensions.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:00Z</ModuleTime>\n            <ModuleName>System.Runtime.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"46-D5-F8-2E-9F-A9-78-CB-94-2A-A7-6D-1A-4D-01-4A-E0-12-4B-7F\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Diagnostics.Debug.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:04Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Debug</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"7F-B3-05-BA-78-7B-90-86-20-73-A9-0B-A4-53-AD-F9-35-89-0E-88\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Collections.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:36Z</ModuleTime>\n            <ModuleName>System.Collections</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A3-8E-CE-5F-4A-F0-53-BF-7A-86-29-F3-60-31-4E-C2-C7-92-64-BF\">\n            <ModulePath>D:\\git\\BranchCoveragePoc\\BranchCoveragePoc.Tests\\bin\\Debug\\netcoreapp3.1\\Microsoft.TestPlatform.CrossPlatEngine.dll</ModulePath>\n            <ModuleTime>2019-10-24T23:20:02Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.CrossPlatEngine</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"3A-01-82-3D-B5-F1-23-E3-44-29-52-01-DD-EB-29-DB-C4-C5-8C-CE\">\n            <ModulePath>D:\\git\\BranchCoveragePoc\\BranchCoveragePoc.Tests\\bin\\Debug\\netcoreapp3.1\\Microsoft.TestPlatform.CommunicationUtilities.dll</ModulePath>\n            <ModuleTime>2019-10-24T23:20:02Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.CommunicationUtilities</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"51-13-D1-D9-16-6E-B7-32-DA-55-E3-B7-9D-7A-18-56-62-3D-30-3F\">\n            <ModulePath>D:\\git\\BranchCoveragePoc\\BranchCoveragePoc.Tests\\bin\\Debug\\netcoreapp3.1\\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll</ModulePath>\n            <ModuleTime>2019-10-24T23:20:00Z</ModuleTime>\n            <ModuleName>Microsoft.VisualStudio.TestPlatform.ObjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8C-92-D8-11-B9-57-FB-91-AB-D6-D1-EA-9E-0B-7D-0C-F1-03-BC-6E\">\n            <ModulePath>D:\\git\\BranchCoveragePoc\\BranchCoveragePoc.Tests\\bin\\Debug\\netcoreapp3.1\\Microsoft.VisualStudio.TestPlatform.Common.dll</ModulePath>\n            <ModuleTime>2019-10-24T23:20:02Z</ModuleTime>\n            <ModuleName>Microsoft.VisualStudio.TestPlatform.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"53-D0-A3-B9-10-36-09-21-32-F4-D0-88-75-00-B5-DC-77-89-1D-78\">\n            <ModulePath>D:\\git\\BranchCoveragePoc\\BranchCoveragePoc.Tests\\bin\\Debug\\netcoreapp3.1\\Newtonsoft.Json.dll</ModulePath>\n            <ModuleTime>2016-06-13T21:06:14Z</ModuleTime>\n            <ModuleName>Newtonsoft.Json</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"16-CF-B2-3A-6D-82-A8-87-9C-5F-7D-2E-A3-34-A3-60-C7-83-55-EC\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.Serialization.Primitives.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:06Z</ModuleTime>\n            <ModuleName>System.Runtime.Serialization.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E8-BD-85-B9-4C-23-55-8C-87-8C-7C-65-E6-6E-D5-8C-53-F3-85-9E\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Globalization.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:36Z</ModuleTime>\n            <ModuleName>System.Globalization</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A8-3F-3B-0D-FE-3C-B9-36-6E-33-0B-C3-CA-EE-8E-8A-E1-10-2A-F2\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Threading.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:12Z</ModuleTime>\n            <ModuleName>System.Threading</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D5-25-D8-6D-DE-16-5A-C7-FB-B9-80-19-52-8F-6A-37-88-78-DA-AA\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Diagnostics.TraceSource.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:08Z</ModuleTime>\n            <ModuleName>System.Diagnostics.TraceSource</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"73-45-14-55-A4-8E-EC-0A-1B-35-EF-E2-6D-BF-6C-6B-96-DA-7F-24\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Diagnostics.Process.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:02Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Process</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9B-E9-31-17-1E-42-BF-69-F2-8E-74-6B-F8-6B-B7-D7-F7-77-11-7F\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.ComponentModel.Primitives.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:58Z</ModuleTime>\n            <ModuleName>System.ComponentModel.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"02-FD-78-B1-DD-78-9E-C7-C1-D1-B6-B0-23-9A-FB-A3-98-A6-F6-E5\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Memory.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:08Z</ModuleTime>\n            <ModuleName>System.Memory</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"03-77-DB-FC-14-D5-51-16-64-85-02-C3-8C-75-4C-BB-2E-67-53-7B\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Threading.ThreadPool.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:26Z</ModuleTime>\n            <ModuleName>System.Threading.ThreadPool</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"54-E5-A6-FF-F6-8C-6A-7D-CE-D2-2A-BF-D5-6B-67-60-2D-88-A0-A6\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.InteropServices.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:02Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5A-53-4F-48-AF-B1-EB-60-21-87-B1-28-94-0A-4B-2D-BB-CE-B3-2D\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\Microsoft.Win32.Primitives.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>Microsoft.Win32.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"18-FA-0D-95-F1-C9-6C-5F-3D-ED-64-F5-E7-EA-F2-93-72-0C-61-3D\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Net.Primitives.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:54Z</ModuleTime>\n            <ModuleName>System.Net.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F9-64-1E-55-2D-9C-5D-82-69-A6-84-14-0D-0F-D7-44-B3-5C-A7-06\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Threading.Tasks.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:34Z</ModuleTime>\n            <ModuleName>System.Threading.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C7-D3-F3-7A-48-47-11-9F-C2-F9-13-66-EA-B5-D6-3D-55-B9-84-22\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Net.Sockets.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:58Z</ModuleTime>\n            <ModuleName>System.Net.Sockets</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"95-BF-E0-EF-5B-E7-8C-85-01-46-96-EC-75-69-2F-30-93-7C-60-35\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Threading.Overlapped.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:10Z</ModuleTime>\n            <ModuleName>System.Threading.Overlapped</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"87-F8-C6-FF-25-C3-3B-82-BB-F1-23-76-08-22-22-37-9C-C7-7D-DC\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Net.NameResolution.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:38Z</ModuleTime>\n            <ModuleName>System.Net.NameResolution</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A1-DB-CA-49-E5-DE-15-8A-D1-27-A7-83-3B-06-C2-FD-AA-93-97-7F\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Private.Uri.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:54Z</ModuleTime>\n            <ModuleName>System.Private.Uri</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"60-34-DF-B5-BF-6D-A3-2D-41-D2-11-56-0C-B6-52-0C-51-E7-A8-70\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Security.Principal.Windows.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:06Z</ModuleTime>\n            <ModuleName>System.Security.Principal.Windows</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"73-50-8C-32-9F-B0-51-50-40-3F-4F-AF-67-9D-C7-02-44-E1-7C-A2\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Security.Claims.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:36Z</ModuleTime>\n            <ModuleName>System.Security.Claims</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"60-34-DF-B5-BF-6D-A3-2D-41-D2-11-56-0C-B6-52-0C-51-E7-A8-70\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Security.Principal.Windows.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:06Z</ModuleTime>\n            <ModuleName>System.Security.Principal.Windows</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F2-A4-B7-B1-47-C0-9D-C3-B6-28-9C-2B-4B-F6-C4-95-9C-10-D8-94\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Security.Principal.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:08Z</ModuleTime>\n            <ModuleName>System.Security.Principal</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"73-50-8C-32-9F-B0-51-50-40-3F-4F-AF-67-9D-C7-02-44-E1-7C-A2\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Security.Claims.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:36Z</ModuleTime>\n            <ModuleName>System.Security.Claims</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F2-A4-B7-B1-47-C0-9D-C3-B6-28-9C-2B-4B-F6-C4-95-9C-10-D8-94\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Security.Principal.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:08Z</ModuleTime>\n            <ModuleName>System.Security.Principal</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"16-CF-B2-3A-6D-82-A8-87-9C-5F-7D-2E-A3-34-A3-60-C7-83-55-EC\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.Serialization.Primitives.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:06Z</ModuleTime>\n            <ModuleName>System.Runtime.Serialization.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"84-C7-9C-58-E1-F8-94-3C-D2-FD-77-39-FC-CB-FB-53-83-21-9A-32\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Data.Common.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:58Z</ModuleTime>\n            <ModuleName>System.Data.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"25-0E-0B-AF-7D-43-95-8D-D9-26-1D-B6-F1-DD-43-B7-E1-0A-0F-B4\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.ComponentModel.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:34Z</ModuleTime>\n            <ModuleName>System.ComponentModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C3-0D-A0-B1-74-3B-15-DF-A7-15-4C-96-D4-27-BF-FD-FE-00-A4-EB\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Reflection.Emit.ILGeneration.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:34Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.ILGeneration</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"82-A4-6C-57-AF-AA-D5-30-07-87-6E-51-C8-AB-EB-02-D5-17-69-13\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Reflection.Emit.Lightweight.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:00Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.Lightweight</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"49-18-F3-D0-44-80-34-0E-8A-59-5F-EC-4C-DE-3E-8A-19-82-A8-F2\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Reflection.Primitives.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:04Z</ModuleTime>\n            <ModuleName>System.Reflection.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"\">\n            <ModulePath>RefEmit_InMemoryManifestModule</ModulePath>\n            <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n            <ModuleName>Anonymously Hosted DynamicMethods Assembly</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"EA-12-21-C4-D9-0B-9A-F1-26-93-39-CE-0E-F7-9A-26-42-08-D1-3B\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Collections.Specialized.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:12Z</ModuleTime>\n            <ModuleName>System.Collections.Specialized</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"26-5D-42-00-2D-A2-AA-74-6F-2C-42-DE-1A-F9-93-F5-DD-5A-32-DE\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Drawing.Primitives.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:00Z</ModuleTime>\n            <ModuleName>System.Drawing.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E1-64-90-F4-41-89-3C-1E-7E-3F-55-45-8A-DE-E0-4C-12-C0-CF-75\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.IO.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:34Z</ModuleTime>\n            <ModuleName>System.IO</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"13-D5-39-62-05-2C-7C-D9-A2-C0-BC-27-AE-D7-0C-61-51-EA-2E-39\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Dynamic.Runtime.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:12Z</ModuleTime>\n            <ModuleName>System.Dynamic.Runtime</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"24-7F-75-4C-5B-7C-D3-B7-52-3F-7F-21-6C-28-29-FF-18-EA-2A-A2\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Linq.Expressions.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:12Z</ModuleTime>\n            <ModuleName>System.Linq.Expressions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F7-22-BE-C3-24-16-7D-05-4F-01-12-91-F4-A3-B7-24-B6-01-82-06\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Reflection.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:34Z</ModuleTime>\n            <ModuleName>System.Reflection</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"6D-F9-F7-3E-29-9D-20-BD-2F-49-83-2B-B5-0E-C3-9A-24-10-C2-11\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Reflection.Extensions.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:36Z</ModuleTime>\n            <ModuleName>System.Reflection.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"01-21-D0-71-7C-59-2D-58-68-0F-75-5A-8C-11-80-8D-31-48-DB-B4\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Linq.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:04Z</ModuleTime>\n            <ModuleName>System.Linq</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"58-2E-40-A4-98-FD-50-AE-64-F0-19-8E-9E-B2-4B-5A-67-66-01-7A\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.ObjectModel.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:54Z</ModuleTime>\n            <ModuleName>System.ObjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F9-C8-60-94-E8-BB-9F-56-AB-FF-B7-9F-17-63-1D-7D-9A-8C-5D-90\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Xml.XDocument.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:54Z</ModuleTime>\n            <ModuleName>System.Xml.XDocument</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8C-61-4B-EA-81-E0-4A-28-1C-92-01-32-97-55-F9-35-20-1B-2E-63\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Private.Xml.Linq.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>System.Private.Xml.Linq</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"76-B3-8B-2A-31-E1-F2-2D-97-5B-8E-92-73-70-7A-8F-72-E4-44-63\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Private.Xml.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>System.Private.Xml</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"0A-2F-ED-78-BD-C3-89-28-67-8C-34-6A-6A-42-E0-93-AB-02-7C-5A\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Text.RegularExpressions.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:36Z</ModuleTime>\n            <ModuleName>System.Text.RegularExpressions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C3-0D-A0-B1-74-3B-15-DF-A7-15-4C-96-D4-27-BF-FD-FE-00-A4-EB\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Reflection.Emit.ILGeneration.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:34Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.ILGeneration</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"82-A4-6C-57-AF-AA-D5-30-07-87-6E-51-C8-AB-EB-02-D5-17-69-13\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Reflection.Emit.Lightweight.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:00Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.Lightweight</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"49-18-F3-D0-44-80-34-0E-8A-59-5F-EC-4C-DE-3E-8A-19-82-A8-F2\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Reflection.Primitives.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:04Z</ModuleTime>\n            <ModuleName>System.Reflection.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"\">\n            <ModulePath>RefEmit_InMemoryManifestModule</ModulePath>\n            <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n            <ModuleName>Anonymously Hosted DynamicMethods Assembly</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"49-AA-09-7E-08-21-F3-64-A1-95-BC-6F-B6-DA-5F-6A-14-4F-DC-60\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Collections.NonGeneric.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>System.Collections.NonGeneric</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"6F-7C-BF-2C-C9-E7-07-66-16-9B-21-61-19-B6-01-F5-33-81-C0-88\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.IO.FileSystem.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:06Z</ModuleTime>\n            <ModuleName>System.IO.FileSystem</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"20-E4-29-5C-AD-EA-20-F7-EB-91-43-9A-0D-AC-E8-1B-3C-49-6C-40\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.Loader.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:00Z</ModuleTime>\n            <ModuleName>System.Runtime.Loader</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"59-B3-53-C6-DD-77-03-5F-2E-4E-9A-A7-81-4B-56-D8-AB-97-8F-66\">\n            <ModulePath>D:\\git\\BranchCoveragePoc\\BranchCoveragePoc.Tests\\bin\\Debug\\netcoreapp3.1\\NUnit3.TestAdapter.dll</ModulePath>\n            <ModuleTime>2019-08-30T10:05:18Z</ModuleTime>\n            <ModuleName>NUnit3.TestAdapter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"12-76-CC-1D-71-64-A5-ED-83-74-CD-75-86-B8-02-00-13-2D-7E-D2\">\n            <ModulePath>D:\\git\\BranchCoveragePoc\\BranchCoveragePoc.Tests\\bin\\Debug\\netcoreapp3.1\\nunit.engine.api.dll</ModulePath>\n            <ModuleTime>2019-03-24T14:23:48Z</ModuleTime>\n            <ModuleName>nunit.engine.api</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"CE-6F-A6-A1-E9-78-08-63-14-76-8E-10-65-9D-4C-5E-CE-91-13-39\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Extensions\\Microsoft.TestPlatform.Extensions.BlameDataCollector.dll</ModulePath>\n            <ModuleTime>2019-12-19T21:32:00Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.Extensions.BlameDataCollector</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"1F-AD-B1-AA-7D-FE-11-BC-97-F6-46-27-D7-C8-F7-6D-53-4E-3A-41\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Xml.ReaderWriter.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:26Z</ModuleTime>\n            <ModuleName>System.Xml.ReaderWriter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"26-8E-67-2F-F9-B2-58-15-79-C3-30-51-AF-DF-A6-AE-93-9D-A1-79\">\n            <ModulePath>c:\\Program Files\\dotnet\\sdk\\3.1.101\\Extensions\\Microsoft.TestPlatform.Extensions.EventLogCollector.dll</ModulePath>\n            <ModuleTime>2019-09-19T04:32:14Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.Extensions.EventLogCollector</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"AA-B7-09-DD-FB-08-41-1C-FE-DD-92-6D-89-D0-A8-25-EF-11-34-C0\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\mscorlib.dll</ModulePath>\n            <ModuleTime>2019-12-08T15:31:44Z</ModuleTime>\n            <ModuleName>mscorlib</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"85-07-D5-5D-5B-FC-21-81-E5-A7-AA-D3-4F-B0-95-78-56-23-98-FA\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Xml.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:26Z</ModuleTime>\n            <ModuleName>System.Xml</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4B-23-3C-FB-2C-87-6B-C8-B9-B3-B0-3C-FE-2A-A6-B0-EA-C8-0B-A4\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Threading.Thread.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:04Z</ModuleTime>\n            <ModuleName>System.Threading.Thread</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9C-AF-40-D7-E0-8E-7D-55-6A-EE-BE-9D-81-85-5F-70-4C-43-3E-8F\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Security.Cryptography.Algorithms.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:02Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Algorithms</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5D-87-E8-9C-AD-E0-CD-8D-80-D6-09-41-BD-4A-7B-BC-5F-20-2E-5E\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Threading.Timer.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:54Z</ModuleTime>\n            <ModuleName>System.Threading.Timer</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"67-B0-AA-21-34-86-26-B5-8A-2A-DE-BD-13-F6-E1-DC-C9-A6-C9-11\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Resources.ResourceManager.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>System.Resources.ResourceManager</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"CE-5F-A9-D3-D8-4F-06-37-AE-9B-FA-4F-E5-3E-1E-03-B4-77-86-78\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Runtime.InteropServices.RuntimeInformation.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:58Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices.RuntimeInformation</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C1-E6-95-46-6B-22-AB-AD-8C-29-08-C6-4F-A8-BC-C8-E3-D9-B3-83\">\n            <ModulePath>D:\\git\\BranchCoveragePoc\\BranchCoveragePoc.Tests\\bin\\Debug\\netcoreapp3.1\\NuGet.Frameworks.dll</ModulePath>\n            <ModuleTime>2019-04-01T16:23:50Z</ModuleTime>\n            <ModuleName>NuGet.Frameworks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"12-F1-70-D9-0A-18-39-5C-75-1D-25-44-E5-AC-87-40-FE-83-04-E8\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Reflection.Metadata.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:36Z</ModuleTime>\n            <ModuleName>System.Reflection.Metadata</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"DA-DE-69-79-37-98-B1-CA-04-44-43-FE-4A-FD-E3-C9-B5-CC-19-CA\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Collections.Immutable.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:34Z</ModuleTime>\n            <ModuleName>System.Collections.Immutable</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E5-6F-E2-59-47-64-D2-E4-64-4E-96-55-60-F4-13-5C-EE-05-0B-BE\">\n            <ModulePath>D:\\git\\BranchCoveragePoc\\BranchCoveragePoc.Tests\\bin\\Debug\\netcoreapp3.1\\nunit.engine.dll</ModulePath>\n            <ModuleTime>2019-03-24T14:23:48Z</ModuleTime>\n            <ModuleName>nunit.engine</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9A-B6-6B-F1-3A-E5-3C-24-16-36-C0-B2-CC-27-44-9B-73-D7-B7-58\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Text.Encoding.Extensions.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:14Z</ModuleTime>\n            <ModuleName>System.Text.Encoding.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FC-88-C2-48-B1-32-80-2D-6A-AC-48-B8-59-A8-F8-B0-DC-CC-A4-DB\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Buffers.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:58Z</ModuleTime>\n            <ModuleName>System.Buffers</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"\">\n            <ModulePath>Mono.Cecil.dll</ModulePath>\n            <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n            <ModuleName>Mono.Cecil</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"DC-73-C0-58-9A-DB-E0-A6-01-79-7C-52-76-91-2E-72-3B-84-80-1A\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.IO.FileSystem.Primitives.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:34Z</ModuleTime>\n            <ModuleName>System.IO.FileSystem.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"51-D2-F8-10-1F-22-A8-6B-7A-C1-7A-EF-51-5D-75-B1-8B-9B-90-26\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Text.Encoding.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:14Z</ModuleTime>\n            <ModuleName>System.Text.Encoding</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A9-0B-65-65-B3-B2-67-7C-DA-EC-62-4D-1A-72-3F-3C-B1-0E-35-AD\">\n            <ModulePath>D:\\git\\BranchCoveragePoc\\BranchCoveragePoc.Tests\\bin\\Debug\\netcoreapp3.1\\BranchCoveragePoc.Tests.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:43:29.5905311Z</ModuleTime>\n            <ModuleName>BranchCoveragePoc.Tests</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"16-2A-6A-6B-DF-CD-D6-7C-53-72-D1-C2-AE-69-5C-68-F9-E9-F2-2D\">\n            <ModulePath>D:\\git\\BranchCoveragePoc\\BranchCoveragePoc.Tests\\bin\\Debug\\netcoreapp3.1\\nunit.framework.dll</ModulePath>\n            <ModuleTime>2019-05-14T21:37:24Z</ModuleTime>\n            <ModuleName>nunit.framework</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8F-66-CA-16-CB-91-DB-F4-6A-EC-BC-C3-07-99-05-F9-D2-D5-32-A7\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Console.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>System.Console</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B0-17-92-AC-BB-F5-22-8A-22-BB-36-8A-C4-74-61-16-A1-F1-A5-17\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Collections.Concurrent.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:39:56Z</ModuleTime>\n            <ModuleName>System.Collections.Concurrent</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"25-0E-0B-AF-7D-43-95-8D-D9-26-1D-B6-F1-DD-43-B7-E1-0A-0F-B4\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.ComponentModel.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:34Z</ModuleTime>\n            <ModuleName>System.ComponentModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module hash=\"2E-1D-56-99-53-35-F9-32-7E-E9-01-AD-24-E9-83-76-EB-C4-6F-3C\">\n            <Summary numSequencePoints=\"10\" visitedSequencePoints=\"10\" numBranchPoints=\"19\" visitedBranchPoints=\"10\" sequenceCoverage=\"100\" branchCoverage=\"52.63\" maxCyclomaticComplexity=\"13\" minCyclomaticComplexity=\"1\" maxCrapScore=\"13\" minCrapScore=\"2\" visitedClasses=\"1\" numClasses=\"1\" visitedMethods=\"1\" numMethods=\"1\" />\n            <ModulePath>D:\\git\\BranchCoveragePoc\\BranchCoveragePoc.Tests\\bin\\Debug\\netcoreapp3.1\\BranchCoveragePoc.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:43:28.7595305Z</ModuleTime>\n            <ModuleName>BranchCoveragePoc</ModuleName>\n            <Files>\n                <File uid=\"1\" fullPath=\"D:\\git\\BranchCoveragePoc\\BranchCoveragePoc\\Calculator.cs\" />\n            </Files>\n            <Classes>\n                <Class>\n                    <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"0\" minCyclomaticComplexity=\"0\" maxCrapScore=\"0\" minCrapScore=\"0\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"0\" />\n                    <FullName>&lt;Module&gt;</FullName>\n                    <Methods />\n                </Class>\n                <Class>\n                    <Summary numSequencePoints=\"10\" visitedSequencePoints=\"10\" numBranchPoints=\"19\" visitedBranchPoints=\"10\" sequenceCoverage=\"100\" branchCoverage=\"52.63\" maxCyclomaticComplexity=\"13\" minCyclomaticComplexity=\"1\" maxCrapScore=\"13\" minCrapScore=\"2\" visitedClasses=\"1\" numClasses=\"1\" visitedMethods=\"1\" numMethods=\"1\" />\n                    <FullName>BranchCoveragePoc.Calculator</FullName>\n                    <Methods>\n                        <Method visited=\"true\" cyclomaticComplexity=\"13\" nPathComplexity=\"512\" sequenceCoverage=\"100\" branchCoverage=\"52.63\" crapScore=\"13\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n                            <Summary numSequencePoints=\"10\" visitedSequencePoints=\"10\" numBranchPoints=\"19\" visitedBranchPoints=\"10\" sequenceCoverage=\"100\" branchCoverage=\"52.63\" maxCyclomaticComplexity=\"13\" minCyclomaticComplexity=\"13\" maxCrapScore=\"13\" minCrapScore=\"13\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"1\" numMethods=\"1\" />\n                            <MetadataToken>100663297</MetadataToken>\n                            <Name>System.Int32 BranchCoveragePoc.Calculator::Compute(System.Int32,System.Int32,System.Int32)</Name>\n                            <FileRef uid=\"1\" />\n                            <SequencePoints>\n                                <SequencePoint vc=\"1\" uspid=\"1\" ordinal=\"0\" offset=\"0\" sl=\"8\" sc=\"9\" el=\"8\" ec=\"10\" bec=\"0\" bev=\"0\" fileid=\"1\" />\n                                <SequencePoint vc=\"1\" uspid=\"2\" ordinal=\"1\" offset=\"1\" sl=\"9\" sc=\"13\" el=\"9\" ec=\"33\" bec=\"4\" bev=\"2\" fileid=\"1\" />\n                                <SequencePoint vc=\"1\" uspid=\"3\" ordinal=\"2\" offset=\"15\" sl=\"10\" sc=\"17\" el=\"10\" ec=\"38\" bec=\"0\" bev=\"0\" fileid=\"1\" />\n                                <SequencePoint vc=\"1\" uspid=\"4\" ordinal=\"3\" offset=\"22\" sl=\"12\" sc=\"13\" el=\"12\" ec=\"34\" bec=\"2\" bev=\"1\" fileid=\"1\" />\n                                <SequencePoint vc=\"1\" uspid=\"5\" ordinal=\"4\" offset=\"33\" sl=\"13\" sc=\"13\" el=\"13\" ec=\"34\" bec=\"2\" bev=\"1\" fileid=\"1\" />\n                                <SequencePoint vc=\"1\" uspid=\"6\" ordinal=\"5\" offset=\"45\" sl=\"14\" sc=\"13\" el=\"14\" ec=\"34\" bec=\"2\" bev=\"1\" fileid=\"1\" />\n                                <SequencePoint vc=\"1\" uspid=\"7\" ordinal=\"6\" offset=\"56\" sl=\"14\" sc=\"35\" el=\"14\" ec=\"56\" bec=\"2\" bev=\"1\" fileid=\"1\" />\n                                <SequencePoint vc=\"1\" uspid=\"8\" ordinal=\"7\" offset=\"68\" sl=\"16\" sc=\"13\" el=\"16\" ec=\"20\" bec=\"0\" bev=\"0\" fileid=\"1\" />\n                                <SequencePoint vc=\"1\" uspid=\"9\" ordinal=\"8\" offset=\"73\" sl=\"18\" sc=\"13\" el=\"24\" ec=\"21\" bec=\"6\" bev=\"3\" fileid=\"1\" />\n                                <SequencePoint vc=\"1\" uspid=\"10\" ordinal=\"9\" offset=\"98\" sl=\"25\" sc=\"9\" el=\"25\" ec=\"10\" bec=\"0\" bev=\"0\" fileid=\"1\" />\n                            </SequencePoints>\n                            <BranchPoints>\n                                <BranchPoint vc=\"0\" uspid=\"11\" ordinal=\"0\" offset=\"2\" sl=\"9\" path=\"0\" offsetend=\"4\" fileid=\"1\" />\n                                <BranchPoint vc=\"1\" uspid=\"12\" ordinal=\"1\" offset=\"2\" sl=\"9\" path=\"1\" offsetend=\"10\" fileid=\"1\" />\n                                <BranchPoint vc=\"1\" uspid=\"13\" ordinal=\"2\" offset=\"13\" sl=\"9\" path=\"0\" offsetend=\"15\" fileid=\"1\" />\n                                <BranchPoint vc=\"0\" uspid=\"14\" ordinal=\"3\" offset=\"13\" sl=\"9\" path=\"1\" offsetend=\"22\" fileid=\"1\" />\n                                <BranchPoint vc=\"0\" uspid=\"15\" ordinal=\"4\" offset=\"23\" sl=\"12\" path=\"0\" offsetend=\"25\" fileid=\"1\" />\n                                <BranchPoint vc=\"1\" uspid=\"16\" ordinal=\"5\" offset=\"23\" sl=\"12\" path=\"1\" offsetend=\"31\" fileid=\"1\" />\n                                <BranchPoint vc=\"0\" uspid=\"17\" ordinal=\"6\" offset=\"35\" sl=\"13\" path=\"0\" offsetend=\"37\" fileid=\"1\" />\n                                <BranchPoint vc=\"1\" uspid=\"18\" ordinal=\"7\" offset=\"35\" sl=\"13\" path=\"1\" offsetend=\"43\" fileid=\"1\" />\n                                <BranchPoint vc=\"0\" uspid=\"19\" ordinal=\"8\" offset=\"46\" sl=\"14\" path=\"0\" offsetend=\"48\" fileid=\"1\" />\n                                <BranchPoint vc=\"1\" uspid=\"20\" ordinal=\"9\" offset=\"46\" sl=\"14\" path=\"1\" offsetend=\"54\" fileid=\"1\" />\n                                <BranchPoint vc=\"0\" uspid=\"21\" ordinal=\"10\" offset=\"58\" sl=\"14\" path=\"0\" offsetend=\"60\" fileid=\"1\" />\n                                <BranchPoint vc=\"1\" uspid=\"22\" ordinal=\"11\" offset=\"58\" sl=\"14\" path=\"1\" offsetend=\"66\" fileid=\"1\" />\n                                <BranchPoint vc=\"0\" uspid=\"23\" ordinal=\"12\" offset=\"75\" sl=\"18\" path=\"0\" offsetend=\"77\" fileid=\"1\" />\n                                <BranchPoint vc=\"1\" uspid=\"24\" ordinal=\"13\" offset=\"75\" sl=\"18\" path=\"1\" offsetend=\"80\" fileid=\"1\" />\n                                <BranchPoint vc=\"0\" uspid=\"25\" ordinal=\"14\" offset=\"82\" sl=\"18\" path=\"0\" offsetend=\"84\" fileid=\"1\" />\n                                <BranchPoint vc=\"1\" uspid=\"26\" ordinal=\"15\" offset=\"82\" sl=\"18\" path=\"1\" offsetend=\"87\" fileid=\"1\" />\n                                <BranchPoint vc=\"0\" uspid=\"27\" ordinal=\"16\" offset=\"89\" sl=\"18\" path=\"0\" offsetend=\"91\" fileid=\"1\" />\n                                <BranchPoint vc=\"1\" uspid=\"28\" ordinal=\"17\" offset=\"89\" sl=\"18\" path=\"1\" offsetend=\"94\" fileid=\"1\" />\n                            </BranchPoints>\n                            <MethodPoint xsi:type=\"SequencePoint\" vc=\"1\" uspid=\"1\" ordinal=\"0\" offset=\"0\" sl=\"8\" sc=\"9\" el=\"8\" ec=\"10\" bec=\"0\" bev=\"0\" fileid=\"1\" />\n                        </Method>\n                        <Method visited=\"false\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" crapScore=\"2\" isConstructor=\"true\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n                            <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"2\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"0\" />\n                            <MetadataToken>100663298</MetadataToken>\n                            <Name>System.Void BranchCoveragePoc.Calculator::.ctor()</Name>\n                            <SequencePoints />\n                            <BranchPoints />\n                            <MethodPoint vc=\"0\" uspid=\"29\" ordinal=\"0\" offset=\"0\" />\n                        </Method>\n                    </Methods>\n                </Class>\n            </Classes>\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"89-99-BB-FA-78-89-D1-A8-BB-F8-EE-D4-36-89-85-28-3A-00-0E-EE\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.ComponentModel.TypeConverter.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:34Z</ModuleTime>\n            <ModuleName>System.ComponentModel.TypeConverter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C6-1E-E9-70-08-99-FC-7C-56-FD-99-EA-B2-77-BA-86-EC-00-3E-CD\">\n            <ModulePath>c:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.1\\System.Security.Cryptography.Primitives.dll</ModulePath>\n            <ModuleTime>2019-12-09T02:40:06Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Primitives</ModuleName>\n            <Classes />\n        </Module>\n    </Modules>\n</CoverageSession>"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/opencover/deterministic_source_paths.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    The `opencover.xml` file from the integration test project CoverageTest.DeterministicSourcePaths.\n-->\n<CoverageSession xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" Version=\"4.7.922.0\">\n  <Summary numSequencePoints=\"9\" visitedSequencePoints=\"4\" numBranchPoints=\"6\" visitedBranchPoints=\"3\" sequenceCoverage=\"44.44\" branchCoverage=\"50\" maxCyclomaticComplexity=\"3\" minCyclomaticComplexity=\"1\" maxCrapScore=\"3\" minCrapScore=\"1\" visitedClasses=\"2\" numClasses=\"3\" visitedMethods=\"2\" numMethods=\"4\" />\n  <Modules>\n    <Module skippedDueTo=\"Filter\" hash=\"F3-64-DC-46-34-AF-1B-66-21-41-5B-A7-BF-4F-BE-44-01-AA-E1-02\">\n      <ModulePath>C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_32\\mscorlib\\v4.0_4.0.0.0__b77a5c561934e089\\mscorlib.dll</ModulePath>\n      <ModuleTime>2020-10-08T02:21:34Z</ModuleTime>\n      <ModuleName>mscorlib</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"FB-8F-E7-1E-29-CE-90-CC-33-64-67-97-1D-E1-5C-B1-E1-01-18-02\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow\\vstest.console.exe</ModulePath>\n      <ModuleTime>2020-11-17T10:47:39.193591Z</ModuleTime>\n      <ModuleName>vstest.console</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"7D-C0-97-9A-55-B3-80-CA-C8-9A-3F-A5-EF-F2-93-47-3E-27-60-B1\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\vstest.console.exe</ModulePath>\n      <ModuleTime>2020-11-17T10:47:41.5114087Z</ModuleTime>\n      <ModuleName>vstest.console</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"52-CC-F7-33-8E-41-4B-53-F1-72-24-D5-2B-96-CF-A7-A7-C3-7A-67\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.TestPlatform.CoreUtilities.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:40.8973952Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.CoreUtilities</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"3E-65-A2-05-7C-67-F0-C6-A0-B8-F5-C9-09-73-B6-EC-86-B4-9C-58\">\n      <ModulePath>C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System\\v4.0_4.0.0.0__b77a5c561934e089\\System.dll</ModulePath>\n      <ModuleTime>2020-10-08T02:21:33.8194762Z</ModuleTime>\n      <ModuleName>System</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"8C-C8-EA-43-CE-0F-45-32-02-BD-3A-E4-A7-2B-10-F9-70-64-53-FC\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:41.033428Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.ObjectModel</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"A6-69-79-9C-27-00-1C-D2-CD-19-92-B2-6D-40-17-61-89-96-E0-EF\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.VisualStudio.TestPlatform.Client.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:41.027426Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Client</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"F2-DC-FD-6A-79-3A-33-F3-A9-FC-22-58-B1-17-BD-0B-29-FB-3A-01\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.VisualStudio.TestPlatform.Common.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:41.0303945Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Common</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"C4-53-EB-F9-35-A0-AF-38-1A-FD-BD-6C-BD-AE-58-59-00-33-FF-F4\">\n      <ModulePath>C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Core\\v4.0_4.0.0.0__b77a5c561934e089\\System.Core.dll</ModulePath>\n      <ModuleTime>2020-10-08T02:21:33.8038507Z</ModuleTime>\n      <ModuleName>System.Core</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"74-FE-A2-EF-DF-FA-23-A2-44-5D-55-4B-D7-FB-D6-3F-B9-AE-BA-1A\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.TestPlatform.PlatformAbstractions.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:40.9024279Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.PlatformAbstractions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"DA-72-DA-8C-56-D2-30-3A-A5-9C-B3-A9-A9-6F-D8-2F-60-43-B5-A9\">\n      <ModulePath>C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Xml\\v4.0_4.0.0.0__b77a5c561934e089\\System.Xml.dll</ModulePath>\n      <ModuleTime>2019-12-07T09:10:37.7737543Z</ModuleTime>\n      <ModuleName>System.Xml</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"E8-D1-D2-D4-CF-9A-37-0B-09-BA-55-31-2E-19-2F-9F-5B-6C-21-94\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.TestPlatform.Utilities.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:40.9033968Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.Utilities</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"80-91-72-00-BE-FA-61-CA-EB-48-F5-FE-C2-FA-FE-90-6B-0E-F5-E8\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\NuGet.Frameworks.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:41.0910388Z</ModuleTime>\n      <ModuleName>NuGet.Frameworks</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"C8-2E-64-82-9F-3E-E5-68-28-EC-A3-5B-05-18-0A-CC-70-C1-0D-04\">\n      <ModulePath>C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Configuration\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Configuration.dll</ModulePath>\n      <ModuleTime>2020-06-05T05:04:05.335002Z</ModuleTime>\n      <ModuleName>System.Configuration</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"21-A3-50-7A-BB-F9-3B-97-D0-86-7E-29-16-61-36-5D-B1-E9-BA-8A\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.Extensions.FileSystemGlobbing.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:40.8673952Z</ModuleTime>\n      <ModuleName>Microsoft.Extensions.FileSystemGlobbing</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"78-16-77-DF-3D-BF-26-C2-86-30-EA-0D-A4-C2-6F-54-F6-9C-F8-10\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.TestPlatform.CrossPlatEngine.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:40.9004304Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.CrossPlatEngine</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"DF-71-F0-70-F2-DE-3E-2E-A3-6B-62-4F-25-08-FB-61-E8-A4-52-04\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.Cci.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:41.8498759Z</ModuleTime>\n      <ModuleName>Microsoft.Cci</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"69-5D-5D-9B-F7-23-8F-39-AB-08-BC-FE-2D-BB-F7-A6-09-5F-62-AF\">\n      <ModulePath>C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Runtime\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Runtime.dll</ModulePath>\n      <ModuleTime>2019-12-07T09:10:34.4923358Z</ModuleTime>\n      <ModuleName>System.Runtime</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"1A-C0-32-0E-C5-53-1C-78-D4-5F-19-7F-02-40-91-22-61-53-E5-46\">\n      <ModulePath>C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Runtime.InteropServices\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Runtime.InteropServices.dll</ModulePath>\n      <ModuleTime>2019-12-07T09:10:35.9300981Z</ModuleTime>\n      <ModuleName>System.Runtime.InteropServices</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"72-01-26-F0-DD-DC-BB-57-6E-36-5A-54-E1-F4-B8-CA-68-01-1D-73\">\n      <ModulePath>C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Collections\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Collections.dll</ModulePath>\n      <ModuleTime>2019-12-07T09:10:34.5705678Z</ModuleTime>\n      <ModuleName>System.Collections</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"D9-7F-13-49-07-59-EF-B3-60-B1-A4-A8-8F-3E-90-92-59-6D-0D-47\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.TestPlatform.Extensions.BlameDataCollector.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:40.6073957Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.Extensions.BlameDataCollector</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"59-5E-C2-EB-1C-5C-46-B2-F5-40-95-38-E0-0A-CC-6B-56-56-2E-A2\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.TestPlatform.Extensions.EventLogCollector.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:40.6083968Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.Extensions.EventLogCollector</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"53-A7-EC-47-09-5F-20-DE-57-12-35-77-FD-9A-5E-51-5C-21-03-2A\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.TestPlatform.TestHostRuntimeProvider.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:40.6103967Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.TestHostRuntimeProvider</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"8E-33-48-17-CA-F5-F5-F1-5F-20-3B-27-A8-F2-1C-A1-C1-E6-46-C6\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.VisualStudio.ArchitectureTools.PEReader.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:40.916394Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.ArchitectureTools.PEReader</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"DF-F5-25-6D-B9-3D-D0-DE-5D-80-ED-16-5B-C2-96-6F-C0-F0-03-3C\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.VisualStudio.Coverage.Interop.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:40.9273974Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.Coverage.Interop</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"C5-CF-3A-D2-3D-A1-D5-3C-41-45-57-5A-E2-D5-F8-B5-AB-22-6A-B8\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.Fakes.DataCollector.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:41.8518768Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.Fakes.DataCollector</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"71-9B-E1-F7-A6-9B-DF-45-0F-84-65-68-DE-9E-87-26-B2-3F-51-B1\">\n      <ModulePath>C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\netstandard\\v4.0_2.0.0.0__cc7b13ffcd2ddd51\\netstandard.dll</ModulePath>\n      <ModuleTime>2019-12-07T09:10:37.6330785Z</ModuleTime>\n      <ModuleName>netstandard</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"1D-F5-D4-F7-A1-88-8F-1F-34-91-89-1B-C7-1E-30-B4-3E-1A-1E-E3\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.CodedWebTestAdapter.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:40.6303965Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.CodedWebTestAdapter</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"18-BD-0B-F5-16-68-1D-75-D4-B9-DD-92-EB-78-F4-91-3F-D9-75-C2\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.TmiAdapter.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:40.6353959Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.TmiAdapter</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"98-04-50-2E-45-23-1B-1F-A5-63-92-C2-5F-33-24-7A-C2-6A-E2-67\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.VisualStudio.QualityTools.Common.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:40.951425Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.QualityTools.Common</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"46-68-37-B3-49-49-46-CB-16-67-11-1A-3C-64-C9-64-6B-AF-72-CB\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.GenericTestAdapter.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:40.6313962Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.GenericTestAdapter</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"C0-26-82-AB-9B-D2-3B-29-B2-70-DE-B1-73-77-EA-B6-E8-A7-6B-C7\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.Html.TestLogger.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:40.6333955Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.Html.TestLogger</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"16-F3-60-52-6F-63-81-46-4C-34-CC-8B-5D-1E-38-AD-55-FB-9B-37\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.OrderedTestAdapter.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:40.6343964Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.OrderedTestAdapter</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"EC-4A-96-01-44-D5-48-7A-06-AB-DA-39-D9-26-19-E4-C0-E3-E2-2F\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:40.6383953Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"DB-3F-9F-AF-81-65-85-1F-9D-84-D2-5A-A4-21-E0-CF-CB-EE-9E-1A\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.VSTestIntegration.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:40.6423952Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.VSTestIntegration</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"57-0B-96-56-D9-D4-E4-AB-25-A8-DE-40-36-A4-9D-EC-B5-20-E5-3F\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:41.0184256Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.QualityTools.UnitTestFramework</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"72-A3-7E-C1-C3-DF-5F-24-DB-60-00-05-87-2A-9E-28-53-99-BA-4B\">\n      <ModulePath>C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_32\\System.Data\\v4.0_4.0.0.0__b77a5c561934e089\\System.Data.dll</ModulePath>\n      <ModuleTime>2020-09-04T22:37:08Z</ModuleTime>\n      <ModuleName>System.Data</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"5A-1E-CD-C4-DB-0C-DF-EB-C6-1E-68-93-B1-EA-8E-44-F5-88-B9-0C\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.WebTestAdapter.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:40.6443954Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.WebTestAdapter</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"21-65-12-66-26-34-CD-C5-91-D8-7D-87-EC-CF-4D-50-25-E0-F5-1A\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestTools.CppUnitTestFramework.ComInterfaces.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:40.6463971Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestTools.CppUnitTestFramework.ComInterfaces</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"64-FA-DF-19-78-2D-5B-8F-26-20-07-25-2D-6D-03-30-B0-B2-DF-15\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestTools.CppUnitTestFramework.CppUnitTestExtension.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:40.6483974Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestTools.CppUnitTestFramework.CppUnitTestExtension</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"C8-9D-8B-1D-6F-7E-BA-56-4C-20-91-48-AE-3D-41-D5-94-69-F6-66\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestTools.DataCollection.MediaRecorder.Model.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:40.6493957Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestTools.DataCollection.MediaRecorder.Model</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"A1-EF-14-6A-23-6F-9A-13-7C-62-4A-AD-FA-AE-E7-D0-C7-88-52-37\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestTools.DataCollection.VideoRecorderCollector.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:40.6513959Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestTools.DataCollection.VideoRecorderCollector</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"28-68-70-3E-A1-6D-4E-78-E4-37-57-6B-7D-57-AC-48-D8-3C-BB-49\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TraceDataCollector.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:40.6543963Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TraceDataCollector</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"B8-3D-83-4A-96-9F-F0-2F-F0-36-70-70-B9-EC-A6-CE-86-0E-15-36\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.IntelliTrace.Core.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:40.892428Z</ModuleTime>\n      <ModuleName>Microsoft.IntelliTrace.Core</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"F1-D3-C4-19-F0-A3-97-CA-EE-78-EA-BA-5F-97-56-C8-6D-7F-01-45\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\System.Reflection.Metadata.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:41.16107Z</ModuleTime>\n      <ModuleName>System.Reflection.Metadata</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"8E-25-51-80-B6-FC-23-97-DE-18-0B-AA-0D-F2-A4-AD-97-C1-6A-8D\">\n      <ModulePath>C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.IO\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.IO.dll</ModulePath>\n      <ModuleTime>2019-12-07T09:10:34.5552678Z</ModuleTime>\n      <ModuleName>System.IO</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"FB-BF-29-CE-7B-65-70-2C-55-E7-9A-03-D5-24-9F-04-A1-39-0C-A6\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\System.Collections.Immutable.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:41.1530675Z</ModuleTime>\n      <ModuleName>System.Collections.Immutable</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"A9-B8-38-52-F8-47-F1-F7-B1-42-BD-5D-0D-13-50-FA-8A-F5-08-DC\">\n      <ModulePath>C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Reflection\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Reflection.dll</ModulePath>\n      <ModuleTime>2019-12-07T09:10:36.0237545Z</ModuleTime>\n      <ModuleName>System.Reflection</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"29-E2-55-07-C8-69-DD-86-D5-1E-15-EB-9A-30-ED-35-C2-B9-03-56\">\n      <ModulePath>C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.IO.FileSystem\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.IO.FileSystem.dll</ModulePath>\n      <ModuleTime>2019-12-07T09:10:36.0095245Z</ModuleTime>\n      <ModuleName>System.IO.FileSystem</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"A5-4A-8D-3E-92-F3-E6-8A-37-31-3B-55-FF-F9-42-71-EA-75-C1-69\">\n      <ModulePath>C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.IO.MemoryMappedFiles\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.IO.MemoryMappedFiles.dll</ModulePath>\n      <ModuleTime>2019-12-07T09:10:34.5552678Z</ModuleTime>\n      <ModuleName>System.IO.MemoryMappedFiles</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"43-A6-0D-38-57-A9-43-74-96-CC-94-35-A8-4D-BE-B5-A6-1E-21-29\">\n      <ModulePath>C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Runtime.Handles\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Runtime.Handles.dll</ModulePath>\n      <ModuleTime>2019-12-07T09:10:37.6643716Z</ModuleTime>\n      <ModuleName>System.Runtime.Handles</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"0D-4A-54-7F-D3-8D-3F-CB-0E-41-6D-19-BA-DE-3E-8E-24-AC-CF-F5\">\n      <ModulePath>C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Reflection.Extensions\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Reflection.Extensions.dll</ModulePath>\n      <ModuleTime>2019-12-07T09:10:37.7113237Z</ModuleTime>\n      <ModuleName>System.Reflection.Extensions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"C6-18-EC-70-A3-C4-0D-6D-5D-3C-70-6D-21-0F-07-83-E2-12-E9-30\">\n      <ModulePath>C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Threading\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Threading.dll</ModulePath>\n      <ModuleTime>2019-12-07T09:10:34.5860246Z</ModuleTime>\n      <ModuleName>System.Threading</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"3B-54-9E-DF-F9-FC-C4-94-AC-51-5D-4C-31-68-2A-24-99-9B-3C-FA\">\n      <ModulePath>C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Text.Encoding\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Text.Encoding.dll</ModulePath>\n      <ModuleTime>2019-12-07T09:10:36.0705812Z</ModuleTime>\n      <ModuleName>System.Text.Encoding</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"E6-96-E0-ED-94-95-52-F4-BC-21-B7-D5-9B-3E-92-E7-68-62-3B-E3\">\n      <ModulePath>C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Runtime.Extensions\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Runtime.Extensions.dll</ModulePath>\n      <ModuleTime>2019-12-07T09:10:37.6174386Z</ModuleTime>\n      <ModuleName>System.Runtime.Extensions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"A9-B5-99-95-3D-BC-63-C8-0C-36-BC-93-7E-F1-FA-63-10-36-B9-50\">\n      <ModulePath>C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Text.Encoding.Extensions\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Text.Encoding.Extensions.dll</ModulePath>\n      <ModuleTime>2019-12-07T09:10:36.1495949Z</ModuleTime>\n      <ModuleName>System.Text.Encoding.Extensions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"6C-B4-E1-9B-E1-27-BD-26-63-B8-F0-70-A6-93-6A-40-DA-B3-BD-47\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.VisualStudio.TestPlatform.Fakes.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:41.8528765Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Fakes</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"BB-CA-02-A4-89-49-32-0E-55-F9-C0-78-EB-63-AF-47-66-20-1E-15\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.TestPlatform.CommunicationUtilities.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:40.8964311Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.CommunicationUtilities</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"B5-1B-96-FC-E9-14-AA-DD-50-9B-EE-C3-63-9E-D8-B5-80-68-BF-6A\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Newtonsoft.Json.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:41.0870368Z</ModuleTime>\n      <ModuleName>Newtonsoft.Json</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"06-F9-8E-1A-FC-D4-91-9C-D0-32-40-16-3E-61-65-7F-A6-8C-FD-30\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.Extensions.DependencyModel.dll</ModulePath>\n      <ModuleTime>2020-11-17T10:47:40.8664344Z</ModuleTime>\n      <ModuleName>Microsoft.Extensions.DependencyModel</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"43-F3-56-07-A4-36-04-65-02-B8-6E-DA-43-D8-74-19-B9-44-30-E1\">\n      <ModulePath>C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Numerics\\v4.0_4.0.0.0__b77a5c561934e089\\System.Numerics.dll</ModulePath>\n      <ModuleTime>2019-12-07T09:10:37.6330785Z</ModuleTime>\n      <ModuleName>System.Numerics</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"B7-88-55-91-79-CC-62-E3-1E-DF-7A-2C-74-35-F8-CD-B4-30-E7-EC\">\n      <ModulePath>C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Runtime.InteropServices.RuntimeInformation\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Runtime.InteropServices.RuntimeInformation.dll</ModulePath>\n      <ModuleTime>2019-12-07T09:10:36.0558875Z</ModuleTime>\n      <ModuleName>System.Runtime.InteropServices.RuntimeInformation</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"E8-17-58-53-B3-AF-2B-F3-C5-CD-B0-72-6C-F3-BC-1F-B5-B7-47-A8\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Private.CoreLib.dll</ModulePath>\n      <ModuleTime>2020-09-22T21:29:36Z</ModuleTime>\n      <ModuleName>System.Private.CoreLib</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"84-19-AD-81-8F-07-C4-DA-0C-76-0C-0D-B2-E6-1B-C2-C9-72-6B-2C\">\n      <ModulePath>C:\\Users\\Andrei\\.nuget\\packages\\microsoft.testplatform.testhost\\16.5.0\\build\\netcoreapp2.1\\x64\\testhost.dll</ModulePath>\n      <ModuleTime>2020-02-04T19:55:24Z</ModuleTime>\n      <ModuleName>testhost</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"C5-0B-07-EF-7A-61-7A-99-30-F2-63-71-AA-42-E0-CC-91-BB-FC-07\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Runtime.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:06:56Z</ModuleTime>\n      <ModuleName>System.Runtime</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"72-CD-4C-29-1F-8A-A2-EE-EE-49-B7-39-D7-D2-59-25-D4-15-8A-47\">\n      <ModulePath>C:\\Workspace\\sonar-dotnet\\its\\projects\\CoverageTest.DeterministicSourcePaths\\CoverageTest.DeterministicSourcePaths.Tests\\bin\\Debug\\netcoreapp3.1\\Microsoft.TestPlatform.CoreUtilities.dll</ModulePath>\n      <ModuleTime>2020-02-04T19:55:22Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.CoreUtilities</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"84-48-B0-1C-CC-25-05-23-54-96-F5-FC-02-3F-3B-20-BA-FB-39-0D\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\netstandard.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:06:52Z</ModuleTime>\n      <ModuleName>netstandard</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"5A-FB-C0-18-35-0F-BF-33-E9-09-93-73-65-6C-AA-BA-FB-28-5E-B0\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Diagnostics.Tracing.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:07:00Z</ModuleTime>\n      <ModuleName>System.Diagnostics.Tracing</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"03-17-2D-A2-47-E8-DA-D5-28-CB-74-74-E2-56-70-6A-C0-5A-AB-58\">\n      <ModulePath>C:\\Workspace\\sonar-dotnet\\its\\projects\\CoverageTest.DeterministicSourcePaths\\CoverageTest.DeterministicSourcePaths.Tests\\bin\\Debug\\netcoreapp3.1\\Microsoft.TestPlatform.PlatformAbstractions.dll</ModulePath>\n      <ModuleTime>2020-02-04T19:55:22Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.PlatformAbstractions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"E4-CC-CF-B9-3C-B6-1F-E5-6D-4C-FD-DD-44-FD-E5-AC-BF-9C-A6-49\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Runtime.Extensions.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:06:56Z</ModuleTime>\n      <ModuleName>System.Runtime.Extensions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"B4-0F-D9-E5-08-79-7C-FE-AF-CB-3A-0F-6B-D3-0B-27-98-A7-6A-3B\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Diagnostics.Debug.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:06:58Z</ModuleTime>\n      <ModuleName>System.Diagnostics.Debug</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"75-5C-A3-B3-4C-5B-DF-41-91-A2-A8-84-EB-65-A9-75-67-6F-00-2F\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Collections.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:06:54Z</ModuleTime>\n      <ModuleName>System.Collections</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"C3-FB-C2-9E-95-BB-9F-EC-54-E9-D6-2E-96-6F-43-6E-95-D3-F0-A1\">\n      <ModulePath>C:\\Workspace\\sonar-dotnet\\its\\projects\\CoverageTest.DeterministicSourcePaths\\CoverageTest.DeterministicSourcePaths.Tests\\bin\\Debug\\netcoreapp3.1\\Microsoft.TestPlatform.CrossPlatEngine.dll</ModulePath>\n      <ModuleTime>2020-02-04T19:55:24Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.CrossPlatEngine</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"7E-1F-2A-CD-BD-DB-46-49-18-E0-16-C3-50-2A-47-26-74-E0-FA-63\">\n      <ModulePath>C:\\Workspace\\sonar-dotnet\\its\\projects\\CoverageTest.DeterministicSourcePaths\\CoverageTest.DeterministicSourcePaths.Tests\\bin\\Debug\\netcoreapp3.1\\Microsoft.TestPlatform.CommunicationUtilities.dll</ModulePath>\n      <ModuleTime>2020-02-04T19:55:24Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.CommunicationUtilities</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"40-25-A6-0F-A5-B4-71-8F-77-23-6F-C1-FC-B2-A9-94-DA-7B-5F-2E\">\n      <ModulePath>C:\\Workspace\\sonar-dotnet\\its\\projects\\CoverageTest.DeterministicSourcePaths\\CoverageTest.DeterministicSourcePaths.Tests\\bin\\Debug\\netcoreapp3.1\\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll</ModulePath>\n      <ModuleTime>2020-02-04T19:55:22Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.ObjectModel</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"C9-48-8A-EF-A0-7E-17-43-0F-BC-D2-F3-4D-26-76-B6-7D-DE-DF-67\">\n      <ModulePath>C:\\Workspace\\sonar-dotnet\\its\\projects\\CoverageTest.DeterministicSourcePaths\\CoverageTest.DeterministicSourcePaths.Tests\\bin\\Debug\\netcoreapp3.1\\Microsoft.VisualStudio.TestPlatform.Common.dll</ModulePath>\n      <ModuleTime>2020-02-04T19:55:24Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Common</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"53-D0-A3-B9-10-36-09-21-32-F4-D0-88-75-00-B5-DC-77-89-1D-78\">\n      <ModulePath>C:\\Workspace\\sonar-dotnet\\its\\projects\\CoverageTest.DeterministicSourcePaths\\CoverageTest.DeterministicSourcePaths.Tests\\bin\\Debug\\netcoreapp3.1\\Newtonsoft.Json.dll</ModulePath>\n      <ModuleTime>2016-06-13T21:06:14Z</ModuleTime>\n      <ModuleName>Newtonsoft.Json</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"ED-DD-36-7C-3E-CD-41-3B-EB-25-57-16-9C-6F-E9-F7-6E-5C-A0-83\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Runtime.Serialization.Primitives.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:06:58Z</ModuleTime>\n      <ModuleName>System.Runtime.Serialization.Primitives</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"BC-75-DE-6F-8B-4F-DA-00-A7-F4-11-15-CA-8C-1B-42-F6-5A-EC-BA\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Globalization.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:07:00Z</ModuleTime>\n      <ModuleName>System.Globalization</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"47-E6-41-24-74-E6-DF-13-CB-96-AD-74-6C-F1-FB-8A-0B-95-D0-49\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Threading.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:07:04Z</ModuleTime>\n      <ModuleName>System.Threading</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"2B-36-FE-B6-96-B8-70-FB-64-4C-18-59-2C-2B-D9-3B-59-12-25-9C\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Diagnostics.TraceSource.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:07:00Z</ModuleTime>\n      <ModuleName>System.Diagnostics.TraceSource</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"32-05-DF-9E-12-18-0E-7B-45-4F-99-82-6D-70-EF-6B-93-C6-2E-00\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Diagnostics.Process.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:06:58Z</ModuleTime>\n      <ModuleName>System.Diagnostics.Process</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"E3-7A-FE-69-20-DE-92-3C-03-95-A9-5A-6A-F8-10-FC-D8-80-19-94\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.ComponentModel.Primitives.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:06:54Z</ModuleTime>\n      <ModuleName>System.ComponentModel.Primitives</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"67-74-83-4C-01-D0-A2-79-17-78-A7-9A-33-EE-FC-F6-08-20-D5-72\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Memory.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:07:04Z</ModuleTime>\n      <ModuleName>System.Memory</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"0D-58-19-49-6F-43-9F-B0-D0-2E-93-CA-A7-96-F8-36-85-74-5B-23\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Threading.ThreadPool.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:06:14Z</ModuleTime>\n      <ModuleName>System.Threading.ThreadPool</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"92-7C-E0-9D-ED-A8-39-E9-7D-93-80-DE-5E-8E-02-83-C6-48-27-BB\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Runtime.InteropServices.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:06:56Z</ModuleTime>\n      <ModuleName>System.Runtime.InteropServices</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"6B-BD-3A-D1-03-F1-DE-FF-8B-26-54-C1-E6-CE-C8-54-22-C5-A8-04\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\Microsoft.Win32.Primitives.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:06:54Z</ModuleTime>\n      <ModuleName>Microsoft.Win32.Primitives</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"C6-54-35-EB-74-FE-02-E8-D5-D1-3A-16-FD-3C-D2-A3-D7-C0-1E-E0\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Net.Primitives.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:06:50Z</ModuleTime>\n      <ModuleName>System.Net.Primitives</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"17-28-0C-F3-C4-16-F4-8A-71-37-19-B7-5F-2F-66-DB-02-21-FD-FD\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Threading.Tasks.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:07:06Z</ModuleTime>\n      <ModuleName>System.Threading.Tasks</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"89-2F-B2-7E-79-FD-B3-86-54-77-92-B4-D7-40-B7-6A-B5-A1-4D-10\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Net.Sockets.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:06:50Z</ModuleTime>\n      <ModuleName>System.Net.Sockets</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"DA-C9-82-5F-C0-EE-62-5F-C4-20-A1-60-BB-D4-28-BC-3D-51-22-38\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Threading.Overlapped.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:07:06Z</ModuleTime>\n      <ModuleName>System.Threading.Overlapped</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"FE-1E-E5-0D-85-0E-7F-8B-15-67-82-9A-60-E4-76-02-8D-DE-46-66\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Net.NameResolution.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:07:06Z</ModuleTime>\n      <ModuleName>System.Net.NameResolution</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"F9-78-22-6A-6A-EA-D6-A6-72-05-72-E8-B7-30-78-12-F8-A2-2C-07\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Private.Uri.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:06:52Z</ModuleTime>\n      <ModuleName>System.Private.Uri</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"87-95-FF-58-E2-77-0D-A5-E6-AF-A9-1C-8B-F0-77-BE-BA-F4-07-23\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Security.Principal.Windows.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:07:00Z</ModuleTime>\n      <ModuleName>System.Security.Principal.Windows</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"45-8E-0B-91-1E-A5-ED-5A-CD-63-2F-F3-7E-82-1E-15-4D-E1-36-42\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Security.Claims.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:06:58Z</ModuleTime>\n      <ModuleName>System.Security.Claims</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"19-77-51-26-A9-E8-2F-F1-0C-2F-1B-8C-2D-6E-F8-2A-FA-E0-F3-1E\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Security.Principal.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:07:20Z</ModuleTime>\n      <ModuleName>System.Security.Principal</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"01-A6-55-30-50-42-B1-C7-61-5A-E0-0D-2E-23-90-7B-53-84-D7-D8\">\n      <ModulePath>C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Runtime.Serialization\\v4.0_4.0.0.0__b77a5c561934e089\\System.Runtime.Serialization.dll</ModulePath>\n      <ModuleTime>2020-08-05T02:39:55.9298663Z</ModuleTime>\n      <ModuleName>System.Runtime.Serialization</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"76-4F-F2-57-05-34-3B-14-F0-74-D8-74-52-87-6D-06-AD-25-14-77\">\n      <ModulePath>C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Xml.Linq\\v4.0_4.0.0.0__b77a5c561934e089\\System.Xml.Linq.dll</ModulePath>\n      <ModuleTime>2019-12-07T09:10:35.962301Z</ModuleTime>\n      <ModuleName>System.Xml.Linq</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"EE-09-04-67-9C-06-25-14-F9-8F-46-81-C0-78-F9-BF-E4-43-EE-BE\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.IO.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:07:02Z</ModuleTime>\n      <ModuleName>System.IO</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"48-00-FE-82-BF-2D-A7-64-91-D6-A5-A5-88-88-02-2A-FB-DA-39-D2\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Dynamic.Runtime.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:07:02Z</ModuleTime>\n      <ModuleName>System.Dynamic.Runtime</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"70-9D-1E-E5-CD-DB-7E-19-16-75-51-2B-26-05-FF-71-DA-77-AF-BC\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Linq.Expressions.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:07:04Z</ModuleTime>\n      <ModuleName>System.Linq.Expressions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"75-99-58-35-C5-29-2E-51-D9-25-2D-A3-31-28-1F-4D-EF-20-57-6D\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Reflection.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:06:54Z</ModuleTime>\n      <ModuleName>System.Reflection</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"5E-AA-4C-FF-F7-5B-E8-16-70-F3-32-06-59-ED-2C-EB-E3-C0-6B-41\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Reflection.Extensions.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:06:54Z</ModuleTime>\n      <ModuleName>System.Reflection.Extensions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"2E-24-12-47-3A-90-50-3D-D6-86-2B-C6-1D-6C-7D-30-43-71-41-81\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Linq.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:07:04Z</ModuleTime>\n      <ModuleName>System.Linq</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"FA-34-B3-26-5E-CA-D6-5B-5D-A0-22-5C-A6-2A-52-4F-9F-87-C7-93\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.ObjectModel.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:06:52Z</ModuleTime>\n      <ModuleName>System.ObjectModel</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"00-B9-3E-22-57-40-E6-BF-0A-7D-C6-71-EF-A3-36-0B-AB-5E-30-F1\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Xml.XDocument.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:06:14Z</ModuleTime>\n      <ModuleName>System.Xml.XDocument</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"AE-67-60-DC-53-02-AE-EC-ED-74-85-99-00-DE-1E-F3-04-E2-C7-CB\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Private.Xml.Linq.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:06:54Z</ModuleTime>\n      <ModuleName>System.Private.Xml.Linq</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"35-80-65-49-C2-7C-0D-14-80-AD-29-FA-E0-83-AD-BD-3F-1D-7A-B5\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Private.Xml.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:06:54Z</ModuleTime>\n      <ModuleName>System.Private.Xml</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"8E-53-4C-91-31-1B-EA-80-65-1E-AC-FD-66-83-7D-FC-71-01-C1-81\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Text.RegularExpressions.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:07:02Z</ModuleTime>\n      <ModuleName>System.Text.RegularExpressions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"22-18-9A-95-65-A4-AD-7D-0A-54-06-20-47-6A-3C-F4-B5-96-7B-04\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Reflection.Emit.ILGeneration.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:06:54Z</ModuleTime>\n      <ModuleName>System.Reflection.Emit.ILGeneration</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"C9-D3-81-B6-32-42-EB-0D-A2-90-0D-C0-73-54-04-1F-47-BB-9F-98\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Reflection.Emit.Lightweight.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:06:54Z</ModuleTime>\n      <ModuleName>System.Reflection.Emit.Lightweight</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"7F-BE-6F-84-E9-FD-4F-14-BB-57-D6-9E-40-9C-51-D2-69-75-19-D6\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Reflection.Primitives.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:06:54Z</ModuleTime>\n      <ModuleName>System.Reflection.Primitives</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"\">\n      <ModulePath>RefEmit_InMemoryManifestModule</ModulePath>\n      <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n      <ModuleName>Anonymously Hosted DynamicMethods Assembly</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"3F-88-09-7E-44-5D-8E-CE-18-49-9F-BD-7B-A5-90-46-A5-AC-D6-7F\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Collections.NonGeneric.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:06:56Z</ModuleTime>\n      <ModuleName>System.Collections.NonGeneric</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"C5-5D-61-FC-43-EB-FB-B0-0E-3A-A5-32-D1-F3-1E-93-04-62-21-E4\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.IO.FileSystem.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:07:02Z</ModuleTime>\n      <ModuleName>System.IO.FileSystem</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"2E-4D-9B-4F-B3-C8-EA-2F-89-C0-8F-1E-8E-ED-30-99-D3-C1-A5-80\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Runtime.Loader.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:06:58Z</ModuleTime>\n      <ModuleName>System.Runtime.Loader</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"5C-37-15-25-14-5D-AA-CD-FE-A1-58-0B-02-CA-F0-06-3B-F0-75-3E\">\n      <ModulePath>C:\\Workspace\\sonar-dotnet\\its\\projects\\CoverageTest.DeterministicSourcePaths\\CoverageTest.DeterministicSourcePaths.Tests\\bin\\Debug\\netcoreapp3.1\\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll</ModulePath>\n      <ModuleTime>2020-02-03T08:45:56Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"9D-1A-06-D1-57-63-4E-2B-7F-60-AB-7C-A1-0C-67-26-0C-72-0B-31\">\n      <ModulePath>C:\\Workspace\\sonar-dotnet\\its\\projects\\CoverageTest.DeterministicSourcePaths\\CoverageTest.DeterministicSourcePaths.Tests\\bin\\Debug\\netcoreapp3.1\\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</ModulePath>\n      <ModuleTime>2020-02-03T08:42:14Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.TestFramework</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"14-23-11-33-8A-3E-C2-95-9C-AF-E0-44-A0-4E-01-93-24-28-69-36\">\n      <ModulePath>C:\\Workspace\\sonar-dotnet\\its\\projects\\CoverageTest.DeterministicSourcePaths\\CoverageTest.DeterministicSourcePaths.Tests\\bin\\Debug\\netcoreapp3.1\\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll</ModulePath>\n      <ModuleTime>2020-02-03T08:43:54Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"18-52-46-8F-91-31-7C-89-18-7F-98-66-A5-FF-E4-26-5C-68-8E-0A\">\n      <ModulePath>C:\\Workspace\\sonar-dotnet\\its\\projects\\CoverageTest.DeterministicSourcePaths\\CoverageTest.DeterministicSourcePaths.Tests\\bin\\Debug\\netcoreapp3.1\\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll</ModulePath>\n      <ModuleTime>2020-02-03T08:52:28Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"7D-37-62-BB-D2-EA-D6-C8-D2-45-E1-94-59-83-0F-7C-DF-3C-BA-BA\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Xml.ReaderWriter.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:06:14Z</ModuleTime>\n      <ModuleName>System.Xml.ReaderWriter</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"43-A9-B0-BD-2D-A0-50-93-2C-B4-A4-44-C9-E3-42-47-9A-01-9D-1A\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Threading.Thread.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:06:14Z</ModuleTime>\n      <ModuleName>System.Threading.Thread</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"31-DC-60-A9-AC-2D-62-B2-C8-05-6E-48-F8-38-C7-4C-66-22-7F-FE\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Security.Cryptography.Algorithms.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:07:00Z</ModuleTime>\n      <ModuleName>System.Security.Cryptography.Algorithms</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"CA-71-8B-5A-44-7C-F4-29-BB-9D-07-00-FD-BB-B0-16-7C-76-80-C5\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Threading.Timer.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:06:38Z</ModuleTime>\n      <ModuleName>System.Threading.Timer</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"84-9E-37-F1-5D-0D-60-82-2E-1D-B0-91-EF-E8-2F-0F-25-5F-CB-A1\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Resources.ResourceManager.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:06:56Z</ModuleTime>\n      <ModuleName>System.Resources.ResourceManager</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"73-5D-56-A1-F6-B2-13-6C-D5-B7-00-E8-64-4D-5F-1C-0C-CC-17-B9\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Runtime.InteropServices.RuntimeInformation.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:07:04Z</ModuleTime>\n      <ModuleName>System.Runtime.InteropServices.RuntimeInformation</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"C1-E6-95-46-6B-22-AB-AD-8C-29-08-C6-4F-A8-BC-C8-E3-D9-B3-83\">\n      <ModulePath>C:\\Workspace\\sonar-dotnet\\its\\projects\\CoverageTest.DeterministicSourcePaths\\CoverageTest.DeterministicSourcePaths.Tests\\bin\\Debug\\netcoreapp3.1\\NuGet.Frameworks.dll</ModulePath>\n      <ModuleTime>2019-04-01T16:23:50Z</ModuleTime>\n      <ModuleName>NuGet.Frameworks</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"02-EC-05-B0-1C-14-D0-09-5A-AD-BD-EE-99-87-60-A9-46-E8-00-BF\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Text.Encoding.Extensions.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:07:24Z</ModuleTime>\n      <ModuleName>System.Text.Encoding.Extensions</ModuleName>\n      <Classes />\n    </Module>\n    <Module hash=\"8E-94-F6-54-A0-D8-E5-C6-88-A4-50-BD-42-3C-22-0E-0C-86-05-56\">\n      <Summary numSequencePoints=\"3\" visitedSequencePoints=\"1\" numBranchPoints=\"2\" visitedBranchPoints=\"1\" sequenceCoverage=\"33.33\" branchCoverage=\"50\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"1\" visitedClasses=\"1\" numClasses=\"2\" visitedMethods=\"1\" numMethods=\"2\" />\n      <ModulePath>C:\\Workspace\\sonar-dotnet\\its\\projects\\CoverageTest.DeterministicSourcePaths\\CoverageTest.DeterministicSourcePaths.Tests\\bin\\Debug\\netcoreapp3.1\\CoverageTest.DeterministicSourcePaths.Tests.dll</ModulePath>\n      <ModuleTime>2021-02-05T11:05:42.2434243Z</ModuleTime>\n      <ModuleName>CoverageTest.DeterministicSourcePaths.Tests</ModuleName>\n      <Files>\n        <File uid=\"1\" fullPath=\"C:\\Users\\Andrei\\.nuget\\packages\\microsoft.net.test.sdk\\16.5.0\\build\\netcoreapp2.1\\Microsoft.NET.Test.Sdk.Program.cs\" />\n        <File uid=\"2\" fullPath=\"C:\\Workspace\\sonar-dotnet\\its\\projects\\CoverageTest.DeterministicSourcePaths\\CoverageTest.DeterministicSourcePaths.Tests\\FooTests.cs\" />\n      </Files>\n      <Classes>\n        <Class>\n          <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"0\" minCyclomaticComplexity=\"0\" maxCrapScore=\"0\" minCrapScore=\"0\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"0\" />\n          <FullName>&lt;Module&gt;</FullName>\n          <Methods />\n        </Class>\n        <Class>\n          <Summary numSequencePoints=\"2\" visitedSequencePoints=\"0\" numBranchPoints=\"1\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"2\" visitedClasses=\"0\" numClasses=\"1\" visitedMethods=\"0\" numMethods=\"1\" />\n          <FullName>AutoGeneratedProgram</FullName>\n          <Methods>\n            <Method visited=\"false\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" crapScore=\"2\" isConstructor=\"false\" isStatic=\"true\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"2\" visitedSequencePoints=\"0\" numBranchPoints=\"1\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"2\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"1\" />\n              <MetadataToken>100663297</MetadataToken>\n              <Name>System.Void AutoGeneratedProgram::Main(System.String[])</Name>\n              <FileRef uid=\"1\" />\n              <SequencePoints>\n                <SequencePoint vc=\"0\" uspid=\"1\" ordinal=\"0\" offset=\"0\" sl=\"4\" sc=\"60\" el=\"4\" ec=\"61\" bec=\"0\" bev=\"0\" fileid=\"1\" />\n                <SequencePoint vc=\"0\" uspid=\"2\" ordinal=\"1\" offset=\"1\" sl=\"4\" sc=\"61\" el=\"4\" ec=\"62\" bec=\"0\" bev=\"0\" fileid=\"1\" />\n              </SequencePoints>\n              <BranchPoints />\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"0\" uspid=\"1\" ordinal=\"0\" offset=\"0\" sl=\"4\" sc=\"60\" el=\"4\" ec=\"61\" bec=\"0\" bev=\"0\" fileid=\"1\" />\n            </Method>\n            <Method visited=\"false\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" crapScore=\"2\" isConstructor=\"true\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"2\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"0\" />\n              <MetadataToken>100663298</MetadataToken>\n              <Name>System.Void AutoGeneratedProgram::.ctor()</Name>\n              <SequencePoints />\n              <BranchPoints />\n              <MethodPoint vc=\"0\" uspid=\"3\" ordinal=\"0\" offset=\"0\" />\n            </Method>\n          </Methods>\n        </Class>\n        <Class>\n          <Summary numSequencePoints=\"1\" visitedSequencePoints=\"1\" numBranchPoints=\"1\" visitedBranchPoints=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"1\" visitedClasses=\"1\" numClasses=\"1\" visitedMethods=\"1\" numMethods=\"1\" />\n          <FullName>Repro3362.Tests.UnitTest1</FullName>\n          <Methods>\n            <Method visited=\"true\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"100\" branchCoverage=\"100\" crapScore=\"1\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"1\" visitedSequencePoints=\"1\" numBranchPoints=\"1\" visitedBranchPoints=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"1\" minCrapScore=\"1\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"1\" numMethods=\"1\" />\n              <MetadataToken>100663299</MetadataToken>\n              <Name>System.Void Repro3362.Tests.UnitTest1::TestMethod1()</Name>\n              <FileRef uid=\"2\" />\n              <SequencePoints>\n                <SequencePoint vc=\"1\" uspid=\"4\" ordinal=\"0\" offset=\"0\" sl=\"9\" sc=\"38\" el=\"9\" ec=\"61\" bec=\"0\" bev=\"0\" fileid=\"2\" />\n              </SequencePoints>\n              <BranchPoints />\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"1\" uspid=\"4\" ordinal=\"0\" offset=\"0\" sl=\"9\" sc=\"38\" el=\"9\" ec=\"61\" bec=\"0\" bev=\"0\" fileid=\"2\" />\n            </Method>\n            <Method visited=\"false\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" crapScore=\"2\" isConstructor=\"true\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"2\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"0\" />\n              <MetadataToken>100663300</MetadataToken>\n              <Name>System.Void Repro3362.Tests.UnitTest1::.ctor()</Name>\n              <SequencePoints />\n              <BranchPoints />\n              <MethodPoint vc=\"0\" uspid=\"5\" ordinal=\"0\" offset=\"0\" />\n            </Method>\n          </Methods>\n        </Class>\n      </Classes>\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"84-05-62-D0-66-EC-A8-8B-13-0C-28-0B-67-25-E5-73-BA-D8-FB-7A\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.IO.FileSystem.Primitives.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:07:04Z</ModuleTime>\n      <ModuleName>System.IO.FileSystem.Primitives</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"48-69-8F-D3-34-45-06-46-29-98-3A-0A-71-C5-1A-6D-78-02-46-35\">\n      <ModulePath>C:\\Workspace\\sonar-dotnet\\its\\projects\\CoverageTest.DeterministicSourcePaths\\CoverageTest.DeterministicSourcePaths.Tests\\bin\\Debug\\netcoreapp3.1\\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</ModulePath>\n      <ModuleTime>2020-02-03T08:43:06Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"6E-4B-78-D5-5F-D2-70-75-6F-04-83-D5-3B-9D-7B-1A-38-12-53-CE\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.ComponentModel.TypeConverter.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:06:56Z</ModuleTime>\n      <ModuleName>System.ComponentModel.TypeConverter</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"29-23-20-63-FA-C8-B6-84-BC-B1-E8-3A-4B-56-91-93-57-61-9F-A2\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Collections.Concurrent.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:06:52Z</ModuleTime>\n      <ModuleName>System.Collections.Concurrent</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"6A-1A-F8-09-3E-65-B3-2B-31-94-4A-F3-55-45-E2-16-3B-65-AC-40\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Diagnostics.TextWriterTraceListener.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:06:58Z</ModuleTime>\n      <ModuleName>System.Diagnostics.TextWriterTraceListener</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"5A-DE-0A-86-0A-77-E3-B9-CB-A9-02-72-0F-43-5F-CE-F5-E5-BF-EF\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Console.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:06:58Z</ModuleTime>\n      <ModuleName>System.Console</ModuleName>\n      <Classes />\n    </Module>\n    <Module hash=\"00-D6-99-21-1D-6E-4C-84-5B-1D-64-64-E0-2B-BD-77-CE-8C-60-B4\">\n      <Summary numSequencePoints=\"6\" visitedSequencePoints=\"3\" numBranchPoints=\"4\" visitedBranchPoints=\"2\" sequenceCoverage=\"50\" branchCoverage=\"50\" maxCyclomaticComplexity=\"3\" minCyclomaticComplexity=\"1\" maxCrapScore=\"3\" minCrapScore=\"2\" visitedClasses=\"1\" numClasses=\"1\" visitedMethods=\"1\" numMethods=\"2\" />\n      <ModulePath>C:\\Workspace\\sonar-dotnet\\its\\projects\\CoverageTest.DeterministicSourcePaths\\CoverageTest.DeterministicSourcePaths.Tests\\bin\\Debug\\netcoreapp3.1\\CoverageTest.DeterministicSourcePaths.dll</ModulePath>\n      <ModuleTime>2021-02-05T11:05:40.9085403Z</ModuleTime>\n      <ModuleName>CoverageTest.DeterministicSourcePaths</ModuleName>\n      <Files>\n        <File uid=\"5\" fullPath=\"/_/CoverageTest.DeterministicSourcePaths/CoverageTest.DeterministicSourcePaths/Foo.cs\" />\n      </Files>\n      <Classes>\n        <Class>\n          <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"0\" minCyclomaticComplexity=\"0\" maxCrapScore=\"0\" minCrapScore=\"0\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"0\" />\n          <FullName>&lt;Module&gt;</FullName>\n          <Methods />\n        </Class>\n        <Class>\n          <Summary numSequencePoints=\"6\" visitedSequencePoints=\"3\" numBranchPoints=\"4\" visitedBranchPoints=\"2\" sequenceCoverage=\"50\" branchCoverage=\"50\" maxCyclomaticComplexity=\"3\" minCyclomaticComplexity=\"1\" maxCrapScore=\"3\" minCrapScore=\"2\" visitedClasses=\"1\" numClasses=\"1\" visitedMethods=\"1\" numMethods=\"2\" />\n          <FullName>Repro3362.Foo</FullName>\n          <Methods>\n            <Method visited=\"true\" cyclomaticComplexity=\"3\" nPathComplexity=\"2\" sequenceCoverage=\"100\" branchCoverage=\"66.67\" crapScore=\"3\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"3\" visitedSequencePoints=\"3\" numBranchPoints=\"3\" visitedBranchPoints=\"2\" sequenceCoverage=\"100\" branchCoverage=\"66.67\" maxCyclomaticComplexity=\"3\" minCyclomaticComplexity=\"3\" maxCrapScore=\"3\" minCrapScore=\"3\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"1\" numMethods=\"1\" />\n              <MetadataToken>100663297</MetadataToken>\n              <Name>System.Void Repro3362.Foo::Covered(System.Boolean)</Name>\n              <FileRef uid=\"5\" />\n              <SequencePoints>\n                <SequencePoint vc=\"1\" uspid=\"6\" ordinal=\"0\" offset=\"0\" sl=\"6\" sc=\"9\" el=\"6\" ec=\"10\" bec=\"0\" bev=\"0\" fileid=\"5\" />\n                <SequencePoint vc=\"1\" uspid=\"7\" ordinal=\"1\" offset=\"1\" sl=\"7\" sc=\"13\" el=\"7\" ec=\"41\" bec=\"2\" bev=\"1\" fileid=\"5\" />\n                <SequencePoint vc=\"1\" uspid=\"8\" ordinal=\"2\" offset=\"11\" sl=\"8\" sc=\"9\" el=\"8\" ec=\"10\" bec=\"0\" bev=\"0\" fileid=\"5\" />\n              </SequencePoints>\n              <BranchPoints>\n                <BranchPoint vc=\"0\" uspid=\"9\" ordinal=\"0\" offset=\"3\" sl=\"7\" path=\"0\" offsetend=\"5\" fileid=\"5\" />\n                <BranchPoint vc=\"1\" uspid=\"10\" ordinal=\"1\" offset=\"3\" sl=\"7\" path=\"1\" offsetend=\"8\" fileid=\"5\" />\n              </BranchPoints>\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"1\" uspid=\"6\" ordinal=\"0\" offset=\"0\" sl=\"6\" sc=\"9\" el=\"6\" ec=\"10\" bec=\"0\" bev=\"0\" fileid=\"5\" />\n            </Method>\n            <Method visited=\"false\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" crapScore=\"2\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"3\" visitedSequencePoints=\"0\" numBranchPoints=\"1\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"2\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"1\" />\n              <MetadataToken>100663298</MetadataToken>\n              <Name>System.Void Repro3362.Foo::NotCovered()</Name>\n              <FileRef uid=\"5\" />\n              <SequencePoints>\n                <SequencePoint vc=\"0\" uspid=\"11\" ordinal=\"0\" offset=\"0\" sl=\"11\" sc=\"9\" el=\"11\" ec=\"10\" bec=\"0\" bev=\"0\" fileid=\"5\" />\n                <SequencePoint vc=\"0\" uspid=\"12\" ordinal=\"1\" offset=\"1\" sl=\"12\" sc=\"13\" el=\"12\" ec=\"27\" bec=\"0\" bev=\"0\" fileid=\"5\" />\n                <SequencePoint vc=\"0\" uspid=\"13\" ordinal=\"2\" offset=\"3\" sl=\"13\" sc=\"9\" el=\"13\" ec=\"10\" bec=\"0\" bev=\"0\" fileid=\"5\" />\n              </SequencePoints>\n              <BranchPoints />\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"0\" uspid=\"11\" ordinal=\"0\" offset=\"0\" sl=\"11\" sc=\"9\" el=\"11\" ec=\"10\" bec=\"0\" bev=\"0\" fileid=\"5\" />\n            </Method>\n            <Method visited=\"false\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" crapScore=\"2\" isConstructor=\"true\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"2\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"0\" />\n              <MetadataToken>100663299</MetadataToken>\n              <Name>System.Void Repro3362.Foo::.ctor()</Name>\n              <SequencePoints />\n              <BranchPoints />\n              <MethodPoint vc=\"0\" uspid=\"14\" ordinal=\"0\" offset=\"0\" />\n            </Method>\n          </Methods>\n        </Class>\n      </Classes>\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"AB-E2-A2-F6-B1-60-6B-31-62-3B-B1-75-3F-AE-15-5A-7B-2C-1D-93\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.9\\System.Security.Cryptography.Primitives.dll</ModulePath>\n      <ModuleTime>2020-09-23T11:07:00Z</ModuleTime>\n      <ModuleName>System.Security.Cryptography.Primitives</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"80-40-BF-BD-20-3E-0F-4A-3E-B6-3F-77-9F-58-81-24-B9-DF-08-AB\">\n      <ModulePath>C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\SMDiagnostics\\v4.0_4.0.0.0__b77a5c561934e089\\SMDiagnostics.dll</ModulePath>\n      <ModuleTime>2020-08-05T02:39:55.9298663Z</ModuleTime>\n      <ModuleName>SMDiagnostics</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"65-32-21-56-AF-4E-2A-1B-63-AA-5B-0C-6F-33-E5-30-CE-22-79-8B\">\n      <ModulePath>C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.ServiceModel.Internals\\v4.0_4.0.0.0__31bf3856ad364e35\\System.ServiceModel.Internals.dll</ModulePath>\n      <ModuleTime>2020-08-05T02:39:55.9298663Z</ModuleTime>\n      <ModuleName>System.ServiceModel.Internals</ModuleName>\n      <Classes />\n    </Module>\n  </Modules>\n</CoverageSession>"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/opencover/invalid_file_id.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\nBelow is the code for which this coverage file has been created,\ntogether with the commands to generate the file and the tools versions.\n\nNote:\n - the file paths were manually changed inside the report to be relative\n - the file id was modified to be invalid\n\n________________________________________________________\nnamespace Code\n{\n    public class ValueProvider\n    {\n        public int GetValue(bool condition) => condition\n            ? 1\n            : 2;\n    }\n}\n________________________________________________________\nusing Code;\nusing NUnit.Framework;\n\nnamespace FirstTestSuite\n{\n    public class ValueProviderTests\n    {\n        [Test]\n        public void Test1()\n        {\n            Assert.That(new ValueProvider().GetValue(false), Is.EqualTo(2));\n        }\n    }\n}\n________________________________________________________\nusing Code;\nusing NUnit.Framework;\n\nnamespace SecondTestSuite\n{\n    public class Tests\n    {\n        [Test]\n        public void Test1()\n        {\n            Assert.That(new ValueProvider().GetValue(true), Is.EqualTo(1));\n        }\n    }\n}\n-->\n<CoverageSession xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" Version=\"4.7.922.0\">\n    <Summary numSequencePoints=\"2\" visitedSequencePoints=\"2\" numBranchPoints=\"6\" visitedBranchPoints=\"4\" sequenceCoverage=\"100\" branchCoverage=\"66.67\" maxCyclomaticComplexity=\"3\" minCyclomaticComplexity=\"1\" maxCrapScore=\"3\" minCrapScore=\"2\" visitedClasses=\"2\" numClasses=\"2\" visitedMethods=\"2\" numMethods=\"2\" />\n    <Modules>\n        <Module skippedDueTo=\"Filter\" hash=\"19-DB-E7-26-74-3E-B8-3C-B9-3E-89-49-9F-20-99-D9-CF-23-FD-17\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.CoreLib.dll</ModulePath>\n            <ModuleTime>2020-02-18T20:16:14Z</ModuleTime>\n            <ModuleName>System.Private.CoreLib</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5C-D3-E5-60-AC-A8-D6-45-77-6C-59-CA-FE-F1-49-32-B4-41-29-2D\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\dotnet.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:30Z</ModuleTime>\n            <ModuleName>dotnet</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"45-AE-FF-2D-9F-D9-14-AE-5E-58-BC-AD-59-3F-6B-E0-C7-F9-45-CA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Runtime</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D2-6E-C4-85-DC-1F-C3-EB-0C-2E-07-EA-F9-33-C9-A6-25-57-E7-D6\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.DotNet.Cli.Utils.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:38Z</ModuleTime>\n            <ModuleName>Microsoft.DotNet.Cli.Utils</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B8-01-4B-08-49-01-14-1F-52-C1-06-1B-E1-C4-DA-8C-8C-15-88-14\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"3D-ED-2E-29-0D-BD-86-B5-75-96-FF-B0-C8-9D-AD-4E-5B-94-58-57\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Loader.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Loader</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"1E-D4-CD-15-2C-94-E4-C6-19-88-4A-EC-70-23-9C-38-12-8A-35-87\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.DotNet.PlatformAbstractions.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:38Z</ModuleTime>\n            <ModuleName>Microsoft.DotNet.PlatformAbstractions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-0A-47-0B-10-27-7A-98-D6-A5-5B-EC-1C-35-91-93-AB-C0-35-65\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\netstandard.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>netstandard</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"26-14-D7-B5-EB-43-C2-76-01-4F-01-5E-7B-A4-CE-E9-EB-E3-AA-B9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.InteropServices.RuntimeInformation.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices.RuntimeInformation</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A6-81-2A-5B-4A-3D-C8-4D-49-04-DE-1F-DF-02-7C-B4-43-51-DE-1C\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.FileSystem.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.IO.FileSystem</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B9-08-B2-09-3C-61-2C-3E-62-03-05-65-93-6A-84-E5-2C-0D-A7-F4\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.InteropServices.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"AF-4F-3B-E9-D2-80-A0-2E-91-5B-AF-17-34-A9-F1-A6-32-C4-EC-4E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Memory.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Memory</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9C-68-F9-D9-5D-09-7B-AC-36-D7-6D-25-3D-17-F3-72-E5-1A-87-F0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:06Z</ModuleTime>\n            <ModuleName>System.Threading</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"BF-BC-9F-90-71-42-03-E3-AC-AA-D2-39-9E-84-5C-00-62-70-39-BA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Encoding.CodePages.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:46Z</ModuleTime>\n            <ModuleName>System.Text.Encoding.CodePages</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8B-E9-5A-2E-CC-DB-5C-E1-03-05-BA-E1-31-A9-9D-6F-18-10-50-AA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Collections</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8F-A1-95-7C-65-A0-95-11-53-8D-DF-11-6D-3C-AD-5D-AE-2F-D3-73\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Concurrent.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>System.Collections.Concurrent</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A3-6E-3F-5C-23-E9-CE-D4-59-A4-79-82-3A-A2-A6-D2-A6-37-0E-C2\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Thread.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.Thread</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"38-09-CE-F2-E5-95-B5-A8-49-DB-F2-B2-FC-2A-62-56-4F-D2-91-39\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.DotNet.Configurer.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:38Z</ModuleTime>\n            <ModuleName>Microsoft.DotNet.Configurer</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"92-1F-FF-56-13-04-47-E6-38-08-43-E5-EA-24-FA-0D-43-16-F9-E2\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.DotNet.Cli.CommandLine.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:42Z</ModuleTime>\n            <ModuleName>Microsoft.DotNet.Cli.CommandLine</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4D-33-53-11-50-36-83-92-2B-29-8C-5A-FA-19-EF-5A-D4-AA-32-80\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Process.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:38Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Process</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A6-34-21-D2-ED-90-2B-0C-6B-31-85-04-D0-F6-D6-13-31-C9-61-F8\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.DotNet.InternalAbstractions.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:40Z</ModuleTime>\n            <ModuleName>Microsoft.DotNet.InternalAbstractions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"33-87-51-E6-2F-8C-BE-1D-5B-B2-9E-51-10-1B-05-40-2C-E3-E8-1A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Linq.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:40Z</ModuleTime>\n            <ModuleName>System.Linq</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"43-64-EE-FB-2B-CB-04-44-D6-D5-68-E6-00-03-CA-34-D9-9A-35-C6\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Frameworks.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Frameworks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"32-5D-5E-82-60-49-7F-5D-44-D4-1E-BF-57-95-6F-D8-30-A6-C2-E1\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Console.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n            <ModuleName>System.Console</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4E-96-5A-FC-C0-BE-6F-D4-A5-9C-B4-F8-33-D5-85-D1-B9-07-9F-89\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Encoding.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Text.Encoding.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F0-C5-75-3F-22-17-B9-2C-E6-C3-3C-A7-4D-EE-AF-C8-FF-35-92-AC\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.CompilerServices.Unsafe.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Runtime.CompilerServices.Unsafe</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"DD-89-83-66-26-E0-B9-BF-DD-51-53-00-1B-5A-80-96-5A-0A-01-79\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.ApplicationInsights.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:02Z</ModuleTime>\n            <ModuleName>Microsoft.ApplicationInsights</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-F9-21-BB-3C-07-A4-DA-5A-43-89-51-EB-E0-A4-B9-2F-19-F6-7D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.Algorithms.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Algorithms</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"CE-43-2B-40-C0-FF-2C-68-D3-CF-AF-49-07-37-DC-D7-AA-AB-17-F3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Buffers.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:26Z</ModuleTime>\n            <ModuleName>System.Buffers</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"55-8E-C2-A5-09-4D-3F-8C-11-59-AB-41-D5-05-B5-7B-8D-3A-AA-6E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D5-0A-67-87-14-54-BA-3A-F2-2A-2A-B8-15-CE-D1-74-51-44-E5-FC\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Uri.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:26Z</ModuleTime>\n            <ModuleName>System.Private.Uri</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"AB-8D-BE-78-8D-87-D4-81-9F-34-C0-7E-08-39-0F-DB-91-CE-92-49\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.TemplateEngine.Cli.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:46Z</ModuleTime>\n            <ModuleName>Microsoft.TemplateEngine.Cli</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"70-58-B8-D8-D1-66-CB-C6-C4-F9-5F-80-03-7C-74-A2-D8-CA-6A-98\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Reflection.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"57-E8-B3-F8-DB-88-F2-FB-81-BE-34-C3-AD-1E-D4-F0-DD-F0-59-D3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Resources.ResourceManager.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Resources.ResourceManager</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-4C-1D-C3-E8-DB-38-EA-0D-64-CB-BD-58-BC-F2-B0-E2-99-42-93\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Reflection</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4B-5A-EC-05-10-C3-65-A3-7C-C5-D4-52-0E-41-A4-1F-73-88-F9-01\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.XDocument.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Xml.XDocument</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"68-1D-85-11-BD-EC-60-7F-F2-E8-83-FF-C6-D8-D9-CB-28-C8-8B-2A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Xml.Linq.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:30Z</ModuleTime>\n            <ModuleName>System.Private.Xml.Linq</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"23-F9-09-16-3B-71-58-F5-A7-35-CA-89-4D-75-0F-3D-D0-23-DC-EB\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Tasks.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Threading.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"1F-BD-6F-06-01-11-FA-A9-DB-0B-12-95-1E-A0-B6-62-C2-59-ED-05\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Xml.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:38Z</ModuleTime>\n            <ModuleName>System.Private.Xml</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9D-C0-19-0D-B9-0B-71-00-FA-44-3E-7A-92-13-79-FB-D2-34-4F-3D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.RegularExpressions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Text.RegularExpressions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9E-63-EF-9A-D8-E6-C0-64-EB-31-79-F5-8C-35-7D-C2-C5-D2-94-7D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Http.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:44Z</ModuleTime>\n            <ModuleName>System.Net.Http</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2F-E1-13-B8-1E-10-AE-79-4A-CD-F8-AE-C1-F1-E8-22-10-2F-61-17\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.ReaderWriter.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Xml.ReaderWriter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D3-FC-01-5E-22-55-B9-FD-FB-0D-0E-A5-B8-58-05-D8-DC-D2-F5-24\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Tracing.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:36Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Tracing</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2A-48-85-A6-03-C4-07-FD-29-10-28-5A-25-BF-0C-FA-03-A7-98-B2\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Net.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A6-8F-70-B6-4E-19-5D-AD-A4-E6-F3-7F-0E-80-A2-3F-81-B0-99-64\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Globalization.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Globalization</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A5-D1-78-2C-3D-8D-E9-D4-52-E4-0C-B0-3D-34-F4-8D-7A-08-C6-C3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Security.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:26Z</ModuleTime>\n            <ModuleName>System.Net.Security</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B5-88-C5-06-06-46-BA-FC-55-0E-7A-44-AC-31-CD-F3-5B-DF-AE-0B\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.ILGeneration.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.ILGeneration</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2D-D2-58-DD-BA-4D-D9-A2-D8-99-CB-EF-60-05-5F-E6-2B-B1-A8-C7\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.X509Certificates.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.X509Certificates</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F1-9F-EA-39-E9-B6-89-2A-58-18-83-8F-AC-C2-48-C5-4B-91-2A-5E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Requests.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Net.Requests</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"EA-A3-EB-09-A2-39-8F-0D-B1-13-BA-6D-11-3A-EC-93-44-39-5A-D3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.Lightweight.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.Lightweight</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E7-62-66-DE-57-93-B4-25-D0-E5-B1-77-A2-DF-82-65-19-35-D3-96\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.NetworkInformation.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:40Z</ModuleTime>\n            <ModuleName>System.Net.NetworkInformation</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4E-A9-32-5A-D2-0F-84-D8-73-42-C7-0B-6A-3C-7B-C0-89-B7-20-01\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\Microsoft.Win32.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n            <ModuleName>Microsoft.Win32.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C8-E8-31-5D-60-D0-B9-32-02-28-DE-17-96-8F-97-91-72-F8-BE-13\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Reflection.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FA-59-51-C6-D3-6C-0B-D8-35-01-96-30-1E-15-48-22-E9-1D-84-18\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.TemplateEngine.Utils.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:46Z</ModuleTime>\n            <ModuleName>Microsoft.TemplateEngine.Utils</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"96-CF-CB-AB-4F-25-B8-44-23-16-25-EC-27-DB-10-94-9B-5F-78-77\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\Microsoft.Win32.Registry.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>Microsoft.Win32.Registry</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"EF-F5-62-5F-AF-AF-B2-EE-AD-D8-B0-5F-2F-34-FF-0C-C9-DD-5C-66\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Tools.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:36Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Tools</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"32-77-95-87-72-D8-6D-43-AA-DA-36-9B-86-D6-99-7F-41-0E-CF-A5\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Debug.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Debug</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C1-41-1B-16-60-41-0D-35-CE-85-82-6D-04-AB-CE-5C-88-E8-BE-91\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:06Z</ModuleTime>\n            <ModuleName>System.IO</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A5-1D-73-D2-8D-F6-70-B7-B7-8B-00-F4-17-70-7F-2A-98-D3-1C-F9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Encoding.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Text.Encoding</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"CC-FC-9F-9B-3F-02-43-A8-4C-9F-1C-AD-15-23-EF-34-31-D4-A6-0C\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.Compression.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:40Z</ModuleTime>\n            <ModuleName>System.IO.Compression</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"47-20-F1-42-9C-3C-11-60-EE-D5-38-37-4E-D7-48-C3-66-42-34-0F\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.Build.Framework.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:38Z</ModuleTime>\n            <ModuleName>Microsoft.Build.Framework</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E5-F8-08-77-40-69-F3-B4-39-9E-F4-4F-30-35-FF-75-AD-66-E9-C9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:34Z</ModuleTime>\n            <ModuleName>System.ComponentModel.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5E-EA-96-C3-0B-C7-BF-BA-AE-4A-27-D8-9A-9A-67-A2-72-BF-89-1F\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.NonGeneric.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:32Z</ModuleTime>\n            <ModuleName>System.Collections.NonGeneric</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9E-74-A8-58-6C-B8-D8-AD-35-90-C4-AB-A7-24-4E-54-43-53-8E-2F\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.DiagnosticSource.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:34Z</ModuleTime>\n            <ModuleName>System.Diagnostics.DiagnosticSource</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"25-17-3D-BA-13-03-55-32-76-CF-3D-AE-B3-52-14-5F-95-F5-3E-85\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Timer.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.Timer</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"EE-DF-4B-C9-A1-40-03-5F-56-1A-DB-D7-E8-A0-BC-A6-12-34-84-1E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Sockets.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:08Z</ModuleTime>\n            <ModuleName>System.Net.Sockets</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"87-6E-54-67-71-53-FA-C9-68-88-0D-C1-82-45-BE-68-5A-25-55-32\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Overlapped.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Threading.Overlapped</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"19-DB-E7-26-74-3E-B8-3C-B9-3E-89-49-9F-20-99-D9-CF-23-FD-17\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.CoreLib.dll</ModulePath>\n            <ModuleTime>2020-02-18T20:16:14Z</ModuleTime>\n            <ModuleName>System.Private.CoreLib</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E6-CE-DF-D3-05-01-F5-61-41-53-0C-FF-2C-87-01-04-6E-EB-B1-C7\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.NameResolution.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:40Z</ModuleTime>\n            <ModuleName>System.Net.NameResolution</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"76-87-37-3D-BD-CF-7C-E5-90-89-7B-D5-45-86-01-3E-47-72-1F-6D\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\MSBuild.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:43:48Z</ModuleTime>\n            <ModuleName>MSBuild</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"45-AE-FF-2D-9F-D9-14-AE-5E-58-BC-AD-59-3F-6B-E0-C7-F9-45-CA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Runtime</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2F-EF-10-A4-03-CD-85-F5-B3-28-04-C0-CA-59-04-4C-AE-A8-5D-D0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Principal.Windows.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Principal.Windows</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"79-03-C9-B3-67-3A-61-F7-6D-B6-CE-72-A2-3F-68-B5-87-C1-4B-60\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Claims.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.Claims</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"87-DE-C4-EB-AC-4B-76-40-4C-56-AB-F2-05-44-02-D8-77-58-26-00\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Principal.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Principal</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B8-01-4B-08-49-01-14-1F-52-C1-06-1B-E1-C4-DA-8C-8C-15-88-14\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9C-68-F9-D9-5D-09-7B-AC-36-D7-6D-25-3D-17-F3-72-E5-1A-87-F0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:06Z</ModuleTime>\n            <ModuleName>System.Threading</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"23-F9-09-16-3B-71-58-F5-A7-35-CA-89-4D-75-0F-3D-D0-23-DC-EB\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Tasks.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Threading.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"47-20-F1-42-9C-3C-11-60-EE-D5-38-37-4E-D7-48-C3-66-42-34-0F\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.Build.Framework.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:38Z</ModuleTime>\n            <ModuleName>Microsoft.Build.Framework</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-0A-47-0B-10-27-7A-98-D6-A5-5B-EC-1C-35-91-93-AB-C0-35-65\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\netstandard.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>netstandard</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"26-14-D7-B5-EB-43-C2-76-01-4F-01-5E-7B-A4-CE-E9-EB-E3-AA-B9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.InteropServices.RuntimeInformation.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices.RuntimeInformation</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4D-33-53-11-50-36-83-92-2B-29-8C-5A-FA-19-EF-5A-D4-AA-32-80\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Process.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:38Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Process</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E5-F8-08-77-40-69-F3-B4-39-9E-F4-4F-30-35-FF-75-AD-66-E9-C9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:34Z</ModuleTime>\n            <ModuleName>System.ComponentModel.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"33-87-51-E6-2F-8C-BE-1D-5B-B2-9E-51-10-1B-05-40-2C-E3-E8-1A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Linq.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:40Z</ModuleTime>\n            <ModuleName>System.Linq</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9D-C0-19-0D-B9-0B-71-00-FA-44-3E-7A-92-13-79-FB-D2-34-4F-3D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.RegularExpressions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Text.RegularExpressions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8B-E9-5A-2E-CC-DB-5C-E1-03-05-BA-E1-31-A9-9D-6F-18-10-50-AA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Collections</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"AF-4F-3B-E9-D2-80-A0-2E-91-5B-AF-17-34-A9-F1-A6-32-C4-EC-4E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Memory.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Memory</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"CE-43-2B-40-C0-FF-2C-68-D3-CF-AF-49-07-37-DC-D7-AA-AB-17-F3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Buffers.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:26Z</ModuleTime>\n            <ModuleName>System.Buffers</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A6-81-2A-5B-4A-3D-C8-4D-49-04-DE-1F-DF-02-7C-B4-43-51-DE-1C\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.FileSystem.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.IO.FileSystem</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B9-08-B2-09-3C-61-2C-3E-62-03-05-65-93-6A-84-E5-2C-0D-A7-F4\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.InteropServices.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"32-5D-5E-82-60-49-7F-5D-44-D4-1E-BF-57-95-6F-D8-30-A6-C2-E1\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Console.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n            <ModuleName>System.Console</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"58-59-35-07-07-DE-52-C3-80-D9-CC-BF-5D-FA-04-DF-29-C6-52-ED\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.Build.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:40Z</ModuleTime>\n            <ModuleName>Microsoft.Build</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D3-FC-01-5E-22-55-B9-FD-FB-0D-0E-A5-B8-58-05-D8-DC-D2-F5-24\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Tracing.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:36Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Tracing</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"32-77-95-87-72-D8-6D-43-AA-DA-36-9B-86-D6-99-7F-41-0E-CF-A5\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Debug.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Debug</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"BF-BC-9F-90-71-42-03-E3-AC-AA-D2-39-9E-84-5C-00-62-70-39-BA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Encoding.CodePages.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:46Z</ModuleTime>\n            <ModuleName>System.Text.Encoding.CodePages</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FC-9A-A3-24-E8-48-FF-9E-1A-D8-C2-B3-54-1E-A8-DD-B2-E1-E3-96\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.ThreadPool.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.ThreadPool</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8F-A1-95-7C-65-A0-95-11-53-8D-DF-11-6D-3C-AD-5D-AE-2F-D3-73\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Concurrent.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>System.Collections.Concurrent</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"3D-ED-2E-29-0D-BD-86-B5-75-96-FF-B0-C8-9D-AD-4E-5B-94-58-57\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Loader.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Loader</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5C-D3-E5-60-AC-A8-D6-45-77-6C-59-CA-FE-F1-49-32-B4-41-29-2D\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\dotnet.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:30Z</ModuleTime>\n            <ModuleName>dotnet</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"01-AB-1F-C1-0A-AD-1A-D5-69-41-9D-4B-4E-1C-6F-AC-59-05-9A-48\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Immutable.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>System.Collections.Immutable</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"38-09-CE-F2-E5-95-B5-A8-49-DB-F2-B2-FC-2A-62-56-4F-D2-91-39\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.DotNet.Configurer.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:38Z</ModuleTime>\n            <ModuleName>Microsoft.DotNet.Configurer</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"03-C3-25-61-A9-3B-57-DB-78-E8-F7-85-5D-BE-8C-07-5D-B0-8C-AA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.Encoding.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Encoding</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A6-34-21-D2-ED-90-2B-0C-6B-31-85-04-D0-F6-D6-13-31-C9-61-F8\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.DotNet.InternalAbstractions.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:40Z</ModuleTime>\n            <ModuleName>Microsoft.DotNet.InternalAbstractions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D2-6E-C4-85-DC-1F-C3-EB-0C-2E-07-EA-F9-33-C9-A6-25-57-E7-D6\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.DotNet.Cli.Utils.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:38Z</ModuleTime>\n            <ModuleName>Microsoft.DotNet.Cli.Utils</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4E-96-5A-FC-C0-BE-6F-D4-A5-9C-B4-F8-33-D5-85-D1-B9-07-9F-89\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Encoding.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Text.Encoding.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"DD-89-83-66-26-E0-B9-BF-DD-51-53-00-1B-5A-80-96-5A-0A-01-79\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.ApplicationInsights.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:02Z</ModuleTime>\n            <ModuleName>Microsoft.ApplicationInsights</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"1E-D4-CD-15-2C-94-E4-C6-19-88-4A-EC-70-23-9C-38-12-8A-35-87\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.DotNet.PlatformAbstractions.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:38Z</ModuleTime>\n            <ModuleName>Microsoft.DotNet.PlatformAbstractions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D5-0A-67-87-14-54-BA-3A-F2-2A-2A-B8-15-CE-D1-74-51-44-E5-FC\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Uri.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:26Z</ModuleTime>\n            <ModuleName>System.Private.Uri</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F0-C5-75-3F-22-17-B9-2C-E6-C3-3C-A7-4D-EE-AF-C8-FF-35-92-AC\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.CompilerServices.Unsafe.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Runtime.CompilerServices.Unsafe</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"70-58-B8-D8-D1-66-CB-C6-C4-F9-5F-80-03-7C-74-A2-D8-CA-6A-98\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Reflection.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-4C-1D-C3-E8-DB-38-EA-0D-64-CB-BD-58-BC-F2-B0-E2-99-42-93\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Reflection</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4B-5A-EC-05-10-C3-65-A3-7C-C5-D4-52-0E-41-A4-1F-73-88-F9-01\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.XDocument.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Xml.XDocument</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"68-1D-85-11-BD-EC-60-7F-F2-E8-83-FF-C6-D8-D9-CB-28-C8-8B-2A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Xml.Linq.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:30Z</ModuleTime>\n            <ModuleName>System.Private.Xml.Linq</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A3-6E-3F-5C-23-E9-CE-D4-59-A4-79-82-3A-A2-A6-D2-A6-37-0E-C2\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Thread.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.Thread</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"1F-BD-6F-06-01-11-FA-A9-DB-0B-12-95-1E-A0-B6-62-C2-59-ED-05\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Xml.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:38Z</ModuleTime>\n            <ModuleName>System.Private.Xml</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2F-E1-13-B8-1E-10-AE-79-4A-CD-F8-AE-C1-F1-E8-22-10-2F-61-17\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.ReaderWriter.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Xml.ReaderWriter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A6-8F-70-B6-4E-19-5D-AD-A4-E6-F3-7F-0E-80-A2-3F-81-B0-99-64\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Globalization.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Globalization</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"BD-4A-A7-E3-52-A8-34-61-7F-29-11-AF-BF-90-FC-16-AD-AB-40-0B\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Tasks.Dataflow.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:46Z</ModuleTime>\n            <ModuleName>System.Threading.Tasks.Dataflow</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-F9-21-BB-3C-07-A4-DA-5A-43-89-51-EB-E0-A4-B9-2F-19-F6-7D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.Algorithms.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Algorithms</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"55-8E-C2-A5-09-4D-3F-8C-11-59-AB-41-D5-05-B5-7B-8D-3A-AA-6E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"96-CF-CB-AB-4F-25-B8-44-23-16-25-EC-27-DB-10-94-9B-5F-78-77\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\Microsoft.Win32.Registry.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>Microsoft.Win32.Registry</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"57-E8-B3-F8-DB-88-F2-FB-81-BE-34-C3-AD-1E-D4-F0-DD-F0-59-D3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Resources.ResourceManager.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Resources.ResourceManager</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"22-BD-0E-BF-F3-50-23-F4-33-69-45-CA-85-5A-41-AA-FF-98-13-6A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ObjectModel.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.ObjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B5-88-C5-06-06-46-BA-FC-55-0E-7A-44-AC-31-CD-F3-5B-DF-AE-0B\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.ILGeneration.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.ILGeneration</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"EA-A3-EB-09-A2-39-8F-0D-B1-13-BA-6D-11-3A-EC-93-44-39-5A-D3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.Lightweight.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.Lightweight</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C8-E8-31-5D-60-D0-B9-32-02-28-DE-17-96-8F-97-91-72-F8-BE-13\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Reflection.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"66-55-F3-9A-C4-53-63-95-5F-60-D2-19-0F-7E-3B-2B-85-46-FB-8D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.TraceSource.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Diagnostics.TraceSource</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"04-D0-77-B5-F7-72-0B-E6-E8-AA-8F-4B-A0-A0-C9-C0-4C-69-37-D9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Tasks.Parallel.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Threading.Tasks.Parallel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"88-E7-E8-96-8F-48-99-50-8E-E1-DF-4C-0E-D5-D8-C5-0D-62-22-36\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.Build.Tasks.Core.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:38Z</ModuleTime>\n            <ModuleName>Microsoft.Build.Tasks.Core</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"7A-E6-CA-81-95-20-D1-FF-17-80-B7-2A-AB-83-B3-0A-F1-99-1E-2A\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.Build.Utilities.Core.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:42Z</ModuleTime>\n            <ModuleName>Microsoft.Build.Utilities.Core</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E4-51-7F-05-08-F3-02-02-27-8E-E8-21-7C-ED-F0-78-12-BA-03-DA\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Build.Tasks.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:22Z</ModuleTime>\n            <ModuleName>NuGet.Build.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"11-27-AE-76-EA-89-8D-78-90-4F-7C-8D-62-56-14-CD-EF-02-37-D9\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Common.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9A-73-83-D7-DB-DD-27-CD-88-01-22-D7-EF-C7-FF-A7-B2-07-F7-3B\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Commands.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Commands</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"36-E8-16-54-B7-19-BD-A8-2A-38-DC-64-7B-B6-08-2C-AE-DF-59-4A\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.ProjectModel.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:26Z</ModuleTime>\n            <ModuleName>NuGet.ProjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5E-EA-96-C3-0B-C7-BF-BA-AE-4A-27-D8-9A-9A-67-A2-72-BF-89-1F\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.NonGeneric.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:32Z</ModuleTime>\n            <ModuleName>System.Collections.NonGeneric</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4E-A9-32-5A-D2-0F-84-D8-73-42-C7-0B-6A-3C-7B-C0-89-B7-20-01\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\Microsoft.Win32.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n            <ModuleName>Microsoft.Win32.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FC-9A-A3-24-E8-48-FF-9E-1A-D8-C2-B3-54-1E-A8-DD-B2-E1-E3-96\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.ThreadPool.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.ThreadPool</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FE-01-7B-00-A1-9B-C4-BC-2A-13-7F-59-A4-6F-55-59-DD-49-B7-A0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.Pipes.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:04Z</ModuleTime>\n            <ModuleName>System.IO.Pipes</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"87-DE-C4-EB-AC-4B-76-40-4C-56-AB-F2-05-44-02-D8-77-58-26-00\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Principal.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Principal</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"80-8D-68-67-13-D9-19-58-91-D7-B1-B6-1B-CF-9B-3C-AC-80-89-94\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.Build.NuGetSdkResolver.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:36Z</ModuleTime>\n            <ModuleName>Microsoft.Build.NuGetSdkResolver</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"49-E0-50-A5-D9-8A-25-15-AE-1C-26-42-E6-99-0B-49-D2-F5-CB-DA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.FileVersionInfo.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:38Z</ModuleTime>\n            <ModuleName>System.Diagnostics.FileVersionInfo</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"42-A4-D5-63-DA-C9-6B-42-3E-CF-98-F9-FB-80-3B-23-4D-E8-7E-B3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:34Z</ModuleTime>\n            <ModuleName>System.ComponentModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"19-DB-E7-26-74-3E-B8-3C-B9-3E-89-49-9F-20-99-D9-CF-23-FD-17\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.CoreLib.dll</ModulePath>\n            <ModuleTime>2020-02-18T20:16:14Z</ModuleTime>\n            <ModuleName>System.Private.CoreLib</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"76-87-37-3D-BD-CF-7C-E5-90-89-7B-D5-45-86-01-3E-47-72-1F-6D\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\MSBuild.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:43:48Z</ModuleTime>\n            <ModuleName>MSBuild</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"45-AE-FF-2D-9F-D9-14-AE-5E-58-BC-AD-59-3F-6B-E0-C7-F9-45-CA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Runtime</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B8-01-4B-08-49-01-14-1F-52-C1-06-1B-E1-C4-DA-8C-8C-15-88-14\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9C-68-F9-D9-5D-09-7B-AC-36-D7-6D-25-3D-17-F3-72-E5-1A-87-F0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:06Z</ModuleTime>\n            <ModuleName>System.Threading</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"23-F9-09-16-3B-71-58-F5-A7-35-CA-89-4D-75-0F-3D-D0-23-DC-EB\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Tasks.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Threading.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"47-20-F1-42-9C-3C-11-60-EE-D5-38-37-4E-D7-48-C3-66-42-34-0F\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.Build.Framework.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:38Z</ModuleTime>\n            <ModuleName>Microsoft.Build.Framework</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-0A-47-0B-10-27-7A-98-D6-A5-5B-EC-1C-35-91-93-AB-C0-35-65\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\netstandard.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>netstandard</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"26-14-D7-B5-EB-43-C2-76-01-4F-01-5E-7B-A4-CE-E9-EB-E3-AA-B9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.InteropServices.RuntimeInformation.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices.RuntimeInformation</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4D-33-53-11-50-36-83-92-2B-29-8C-5A-FA-19-EF-5A-D4-AA-32-80\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Process.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:38Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Process</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E5-F8-08-77-40-69-F3-B4-39-9E-F4-4F-30-35-FF-75-AD-66-E9-C9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:34Z</ModuleTime>\n            <ModuleName>System.ComponentModel.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"33-87-51-E6-2F-8C-BE-1D-5B-B2-9E-51-10-1B-05-40-2C-E3-E8-1A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Linq.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:40Z</ModuleTime>\n            <ModuleName>System.Linq</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9D-C0-19-0D-B9-0B-71-00-FA-44-3E-7A-92-13-79-FB-D2-34-4F-3D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.RegularExpressions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Text.RegularExpressions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8B-E9-5A-2E-CC-DB-5C-E1-03-05-BA-E1-31-A9-9D-6F-18-10-50-AA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Collections</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"AF-4F-3B-E9-D2-80-A0-2E-91-5B-AF-17-34-A9-F1-A6-32-C4-EC-4E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Memory.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Memory</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"CE-43-2B-40-C0-FF-2C-68-D3-CF-AF-49-07-37-DC-D7-AA-AB-17-F3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Buffers.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:26Z</ModuleTime>\n            <ModuleName>System.Buffers</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A6-81-2A-5B-4A-3D-C8-4D-49-04-DE-1F-DF-02-7C-B4-43-51-DE-1C\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.FileSystem.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.IO.FileSystem</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B9-08-B2-09-3C-61-2C-3E-62-03-05-65-93-6A-84-E5-2C-0D-A7-F4\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.InteropServices.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"32-5D-5E-82-60-49-7F-5D-44-D4-1E-BF-57-95-6F-D8-30-A6-C2-E1\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Console.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n            <ModuleName>System.Console</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"58-59-35-07-07-DE-52-C3-80-D9-CC-BF-5D-FA-04-DF-29-C6-52-ED\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.Build.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:40Z</ModuleTime>\n            <ModuleName>Microsoft.Build</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D3-FC-01-5E-22-55-B9-FD-FB-0D-0E-A5-B8-58-05-D8-DC-D2-F5-24\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Tracing.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:36Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Tracing</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"32-77-95-87-72-D8-6D-43-AA-DA-36-9B-86-D6-99-7F-41-0E-CF-A5\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Debug.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Debug</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"BF-BC-9F-90-71-42-03-E3-AC-AA-D2-39-9E-84-5C-00-62-70-39-BA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Encoding.CodePages.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:46Z</ModuleTime>\n            <ModuleName>System.Text.Encoding.CodePages</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8F-A1-95-7C-65-A0-95-11-53-8D-DF-11-6D-3C-AD-5D-AE-2F-D3-73\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Concurrent.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>System.Collections.Concurrent</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FE-01-7B-00-A1-9B-C4-BC-2A-13-7F-59-A4-6F-55-59-DD-49-B7-A0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.Pipes.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:04Z</ModuleTime>\n            <ModuleName>System.IO.Pipes</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4E-96-5A-FC-C0-BE-6F-D4-A5-9C-B4-F8-33-D5-85-D1-B9-07-9F-89\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Encoding.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Text.Encoding.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FC-03-66-B3-A4-0E-6D-59-00-DF-29-69-D0-2E-C0-08-26-E6-F1-B3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.AccessControl.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.AccessControl</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2F-EF-10-A4-03-CD-85-F5-B3-28-04-C0-CA-59-04-4C-AE-A8-5D-D0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Principal.Windows.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Principal.Windows</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"79-03-C9-B3-67-3A-61-F7-6D-B6-CE-72-A2-3F-68-B5-87-C1-4B-60\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Claims.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.Claims</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"87-DE-C4-EB-AC-4B-76-40-4C-56-AB-F2-05-44-02-D8-77-58-26-00\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Principal.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Principal</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"87-6E-54-67-71-53-FA-C9-68-88-0D-C1-82-45-BE-68-5A-25-55-32\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Overlapped.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Threading.Overlapped</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"87-6E-54-67-71-53-FA-C9-68-88-0D-C1-82-45-BE-68-5A-25-55-32\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Overlapped.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Threading.Overlapped</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A3-6E-3F-5C-23-E9-CE-D4-59-A4-79-82-3A-A2-A6-D2-A6-37-0E-C2\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Thread.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.Thread</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FC-03-66-B3-A4-0E-6D-59-00-DF-29-69-D0-2E-C0-08-26-E6-F1-B3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.AccessControl.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.AccessControl</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2F-EF-10-A4-03-CD-85-F5-B3-28-04-C0-CA-59-04-4C-AE-A8-5D-D0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Principal.Windows.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Principal.Windows</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"79-03-C9-B3-67-3A-61-F7-6D-B6-CE-72-A2-3F-68-B5-87-C1-4B-60\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Claims.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.Claims</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"22-BD-0E-BF-F3-50-23-F4-33-69-45-CA-85-5A-41-AA-FF-98-13-6A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ObjectModel.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.ObjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"BD-4A-A7-E3-52-A8-34-61-7F-29-11-AF-BF-90-FC-16-AD-AB-40-0B\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Tasks.Dataflow.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:46Z</ModuleTime>\n            <ModuleName>System.Threading.Tasks.Dataflow</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"19-DB-E7-26-74-3E-B8-3C-B9-3E-89-49-9F-20-99-D9-CF-23-FD-17\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.CoreLib.dll</ModulePath>\n            <ModuleTime>2020-02-18T20:16:14Z</ModuleTime>\n            <ModuleName>System.Private.CoreLib</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"3D-ED-2E-29-0D-BD-86-B5-75-96-FF-B0-C8-9D-AD-4E-5B-94-58-57\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Loader.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Loader</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5C-D3-E5-60-AC-A8-D6-45-77-6C-59-CA-FE-F1-49-32-B4-41-29-2D\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\dotnet.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:30Z</ModuleTime>\n            <ModuleName>dotnet</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"01-AB-1F-C1-0A-AD-1A-D5-69-41-9D-4B-4E-1C-6F-AC-59-05-9A-48\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Immutable.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>System.Collections.Immutable</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"76-87-37-3D-BD-CF-7C-E5-90-89-7B-D5-45-86-01-3E-47-72-1F-6D\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\MSBuild.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:43:48Z</ModuleTime>\n            <ModuleName>MSBuild</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"45-AE-FF-2D-9F-D9-14-AE-5E-58-BC-AD-59-3F-6B-E0-C7-F9-45-CA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Runtime</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"38-09-CE-F2-E5-95-B5-A8-49-DB-F2-B2-FC-2A-62-56-4F-D2-91-39\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.DotNet.Configurer.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:38Z</ModuleTime>\n            <ModuleName>Microsoft.DotNet.Configurer</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B8-01-4B-08-49-01-14-1F-52-C1-06-1B-E1-C4-DA-8C-8C-15-88-14\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9C-68-F9-D9-5D-09-7B-AC-36-D7-6D-25-3D-17-F3-72-E5-1A-87-F0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:06Z</ModuleTime>\n            <ModuleName>System.Threading</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"23-F9-09-16-3B-71-58-F5-A7-35-CA-89-4D-75-0F-3D-D0-23-DC-EB\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Tasks.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Threading.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"47-20-F1-42-9C-3C-11-60-EE-D5-38-37-4E-D7-48-C3-66-42-34-0F\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.Build.Framework.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:38Z</ModuleTime>\n            <ModuleName>Microsoft.Build.Framework</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-0A-47-0B-10-27-7A-98-D6-A5-5B-EC-1C-35-91-93-AB-C0-35-65\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\netstandard.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>netstandard</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"57-E8-B3-F8-DB-88-F2-FB-81-BE-34-C3-AD-1E-D4-F0-DD-F0-59-D3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Resources.ResourceManager.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Resources.ResourceManager</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"26-14-D7-B5-EB-43-C2-76-01-4F-01-5E-7B-A4-CE-E9-EB-E3-AA-B9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.InteropServices.RuntimeInformation.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices.RuntimeInformation</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4D-33-53-11-50-36-83-92-2B-29-8C-5A-FA-19-EF-5A-D4-AA-32-80\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Process.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:38Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Process</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E5-F8-08-77-40-69-F3-B4-39-9E-F4-4F-30-35-FF-75-AD-66-E9-C9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:34Z</ModuleTime>\n            <ModuleName>System.ComponentModel.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"33-87-51-E6-2F-8C-BE-1D-5B-B2-9E-51-10-1B-05-40-2C-E3-E8-1A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Linq.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:40Z</ModuleTime>\n            <ModuleName>System.Linq</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9D-C0-19-0D-B9-0B-71-00-FA-44-3E-7A-92-13-79-FB-D2-34-4F-3D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.RegularExpressions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Text.RegularExpressions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8B-E9-5A-2E-CC-DB-5C-E1-03-05-BA-E1-31-A9-9D-6F-18-10-50-AA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Collections</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"AF-4F-3B-E9-D2-80-A0-2E-91-5B-AF-17-34-A9-F1-A6-32-C4-EC-4E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Memory.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Memory</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"CE-43-2B-40-C0-FF-2C-68-D3-CF-AF-49-07-37-DC-D7-AA-AB-17-F3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Buffers.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:26Z</ModuleTime>\n            <ModuleName>System.Buffers</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A6-81-2A-5B-4A-3D-C8-4D-49-04-DE-1F-DF-02-7C-B4-43-51-DE-1C\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.FileSystem.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.IO.FileSystem</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B9-08-B2-09-3C-61-2C-3E-62-03-05-65-93-6A-84-E5-2C-0D-A7-F4\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.InteropServices.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"32-5D-5E-82-60-49-7F-5D-44-D4-1E-BF-57-95-6F-D8-30-A6-C2-E1\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Console.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n            <ModuleName>System.Console</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"58-59-35-07-07-DE-52-C3-80-D9-CC-BF-5D-FA-04-DF-29-C6-52-ED\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.Build.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:40Z</ModuleTime>\n            <ModuleName>Microsoft.Build</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D3-FC-01-5E-22-55-B9-FD-FB-0D-0E-A5-B8-58-05-D8-DC-D2-F5-24\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Tracing.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:36Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Tracing</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"32-77-95-87-72-D8-6D-43-AA-DA-36-9B-86-D6-99-7F-41-0E-CF-A5\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Debug.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Debug</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"BF-BC-9F-90-71-42-03-E3-AC-AA-D2-39-9E-84-5C-00-62-70-39-BA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Encoding.CodePages.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:46Z</ModuleTime>\n            <ModuleName>System.Text.Encoding.CodePages</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8F-A1-95-7C-65-A0-95-11-53-8D-DF-11-6D-3C-AD-5D-AE-2F-D3-73\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Concurrent.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>System.Collections.Concurrent</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FE-01-7B-00-A1-9B-C4-BC-2A-13-7F-59-A4-6F-55-59-DD-49-B7-A0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.Pipes.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:04Z</ModuleTime>\n            <ModuleName>System.IO.Pipes</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4E-96-5A-FC-C0-BE-6F-D4-A5-9C-B4-F8-33-D5-85-D1-B9-07-9F-89\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Encoding.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Text.Encoding.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FC-03-66-B3-A4-0E-6D-59-00-DF-29-69-D0-2E-C0-08-26-E6-F1-B3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.AccessControl.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.AccessControl</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2F-EF-10-A4-03-CD-85-F5-B3-28-04-C0-CA-59-04-4C-AE-A8-5D-D0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Principal.Windows.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Principal.Windows</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"79-03-C9-B3-67-3A-61-F7-6D-B6-CE-72-A2-3F-68-B5-87-C1-4B-60\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Claims.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.Claims</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"87-DE-C4-EB-AC-4B-76-40-4C-56-AB-F2-05-44-02-D8-77-58-26-00\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Principal.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Principal</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"87-6E-54-67-71-53-FA-C9-68-88-0D-C1-82-45-BE-68-5A-25-55-32\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Overlapped.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Threading.Overlapped</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A3-6E-3F-5C-23-E9-CE-D4-59-A4-79-82-3A-A2-A6-D2-A6-37-0E-C2\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Thread.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.Thread</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2F-E1-13-B8-1E-10-AE-79-4A-CD-F8-AE-C1-F1-E8-22-10-2F-61-17\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.ReaderWriter.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Xml.ReaderWriter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"22-BD-0E-BF-F3-50-23-F4-33-69-45-CA-85-5A-41-AA-FF-98-13-6A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ObjectModel.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.ObjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"1F-BD-6F-06-01-11-FA-A9-DB-0B-12-95-1E-A0-B6-62-C2-59-ED-05\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Xml.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:38Z</ModuleTime>\n            <ModuleName>System.Private.Xml</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-F9-21-BB-3C-07-A4-DA-5A-43-89-51-EB-E0-A4-B9-2F-19-F6-7D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.Algorithms.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Algorithms</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D5-0A-67-87-14-54-BA-3A-F2-2A-2A-B8-15-CE-D1-74-51-44-E5-FC\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Uri.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:26Z</ModuleTime>\n            <ModuleName>System.Private.Uri</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"BD-4A-A7-E3-52-A8-34-61-7F-29-11-AF-BF-90-FC-16-AD-AB-40-0B\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Tasks.Dataflow.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:46Z</ModuleTime>\n            <ModuleName>System.Threading.Tasks.Dataflow</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"3D-ED-2E-29-0D-BD-86-B5-75-96-FF-B0-C8-9D-AD-4E-5B-94-58-57\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Loader.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Loader</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"96-CF-CB-AB-4F-25-B8-44-23-16-25-EC-27-DB-10-94-9B-5F-78-77\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\Microsoft.Win32.Registry.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>Microsoft.Win32.Registry</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5C-D3-E5-60-AC-A8-D6-45-77-6C-59-CA-FE-F1-49-32-B4-41-29-2D\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\dotnet.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:30Z</ModuleTime>\n            <ModuleName>dotnet</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"01-AB-1F-C1-0A-AD-1A-D5-69-41-9D-4B-4E-1C-6F-AC-59-05-9A-48\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Immutable.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>System.Collections.Immutable</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"66-55-F3-9A-C4-53-63-95-5F-60-D2-19-0F-7E-3B-2B-85-46-FB-8D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.TraceSource.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Diagnostics.TraceSource</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"38-09-CE-F2-E5-95-B5-A8-49-DB-F2-B2-FC-2A-62-56-4F-D2-91-39\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.DotNet.Configurer.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:38Z</ModuleTime>\n            <ModuleName>Microsoft.DotNet.Configurer</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"57-E8-B3-F8-DB-88-F2-FB-81-BE-34-C3-AD-1E-D4-F0-DD-F0-59-D3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Resources.ResourceManager.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Resources.ResourceManager</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2F-E1-13-B8-1E-10-AE-79-4A-CD-F8-AE-C1-F1-E8-22-10-2F-61-17\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.ReaderWriter.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Xml.ReaderWriter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"1F-BD-6F-06-01-11-FA-A9-DB-0B-12-95-1E-A0-B6-62-C2-59-ED-05\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Xml.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:38Z</ModuleTime>\n            <ModuleName>System.Private.Xml</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-F9-21-BB-3C-07-A4-DA-5A-43-89-51-EB-E0-A4-B9-2F-19-F6-7D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.Algorithms.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Algorithms</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D5-0A-67-87-14-54-BA-3A-F2-2A-2A-B8-15-CE-D1-74-51-44-E5-FC\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Uri.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:26Z</ModuleTime>\n            <ModuleName>System.Private.Uri</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"04-D0-77-B5-F7-72-0B-E6-E8-AA-8F-4B-A0-A0-C9-C0-4C-69-37-D9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Tasks.Parallel.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Threading.Tasks.Parallel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"96-CF-CB-AB-4F-25-B8-44-23-16-25-EC-27-DB-10-94-9B-5F-78-77\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\Microsoft.Win32.Registry.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>Microsoft.Win32.Registry</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"66-55-F3-9A-C4-53-63-95-5F-60-D2-19-0F-7E-3B-2B-85-46-FB-8D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.TraceSource.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Diagnostics.TraceSource</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"7A-E6-CA-81-95-20-D1-FF-17-80-B7-2A-AB-83-B3-0A-F1-99-1E-2A\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.Build.Utilities.Core.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:42Z</ModuleTime>\n            <ModuleName>Microsoft.Build.Utilities.Core</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"04-D0-77-B5-F7-72-0B-E6-E8-AA-8F-4B-A0-A0-C9-C0-4C-69-37-D9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Tasks.Parallel.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Threading.Tasks.Parallel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"7A-E6-CA-81-95-20-D1-FF-17-80-B7-2A-AB-83-B3-0A-F1-99-1E-2A\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.Build.Utilities.Core.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:42Z</ModuleTime>\n            <ModuleName>Microsoft.Build.Utilities.Core</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B5-88-C5-06-06-46-BA-FC-55-0E-7A-44-AC-31-CD-F3-5B-DF-AE-0B\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.ILGeneration.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.ILGeneration</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"EA-A3-EB-09-A2-39-8F-0D-B1-13-BA-6D-11-3A-EC-93-44-39-5A-D3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.Lightweight.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.Lightweight</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C8-E8-31-5D-60-D0-B9-32-02-28-DE-17-96-8F-97-91-72-F8-BE-13\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Reflection.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B6-58-2E-A2-A7-DF-F0-53-14-F6-45-D8-42-D5-5A-6B-69-F7-12-C9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Serialization.Formatters.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Serialization.Formatters</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B5-88-C5-06-06-46-BA-FC-55-0E-7A-44-AC-31-CD-F3-5B-DF-AE-0B\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.ILGeneration.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.ILGeneration</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B6-58-2E-A2-A7-DF-F0-53-14-F6-45-D8-42-D5-5A-6B-69-F7-12-C9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Serialization.Formatters.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Serialization.Formatters</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"EA-A3-EB-09-A2-39-8F-0D-B1-13-BA-6D-11-3A-EC-93-44-39-5A-D3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.Lightweight.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.Lightweight</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C8-E8-31-5D-60-D0-B9-32-02-28-DE-17-96-8F-97-91-72-F8-BE-13\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Reflection.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B6-58-2E-A2-A7-DF-F0-53-14-F6-45-D8-42-D5-5A-6B-69-F7-12-C9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Serialization.Formatters.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Serialization.Formatters</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"88-E7-E8-96-8F-48-99-50-8E-E1-DF-4C-0E-D5-D8-C5-0D-62-22-36\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.Build.Tasks.Core.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:38Z</ModuleTime>\n            <ModuleName>Microsoft.Build.Tasks.Core</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"88-E7-E8-96-8F-48-99-50-8E-E1-DF-4C-0E-D5-D8-C5-0D-62-22-36\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.Build.Tasks.Core.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:38Z</ModuleTime>\n            <ModuleName>Microsoft.Build.Tasks.Core</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FC-9A-A3-24-E8-48-FF-9E-1A-D8-C2-B3-54-1E-A8-DD-B2-E1-E3-96\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.ThreadPool.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.ThreadPool</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FC-9A-A3-24-E8-48-FF-9E-1A-D8-C2-B3-54-1E-A8-DD-B2-E1-E3-96\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.ThreadPool.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.ThreadPool</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"17-32-2C-E5-EA-D1-3F-48-26-FC-68-8B-AF-F0-AD-51-5E-49-3A-18\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Sdks\\Microsoft.NET.Sdk\\tools\\netcoreapp2.1\\Microsoft.NET.Build.Tasks.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:26Z</ModuleTime>\n            <ModuleName>Microsoft.NET.Build.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"17-32-2C-E5-EA-D1-3F-48-26-FC-68-8B-AF-F0-AD-51-5E-49-3A-18\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Sdks\\Microsoft.NET.Sdk\\tools\\netcoreapp2.1\\Microsoft.NET.Build.Tasks.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:26Z</ModuleTime>\n            <ModuleName>Microsoft.NET.Build.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"17-32-2C-E5-EA-D1-3F-48-26-FC-68-8B-AF-F0-AD-51-5E-49-3A-18\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Sdks\\Microsoft.NET.Sdk\\tools\\netcoreapp2.1\\Microsoft.NET.Build.Tasks.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:26Z</ModuleTime>\n            <ModuleName>Microsoft.NET.Build.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"43-64-EE-FB-2B-CB-04-44-D6-D5-68-E6-00-03-CA-34-D9-9A-35-C6\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Frameworks.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Frameworks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"43-64-EE-FB-2B-CB-04-44-D6-D5-68-E6-00-03-CA-34-D9-9A-35-C6\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Frameworks.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Frameworks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"43-64-EE-FB-2B-CB-04-44-D6-D5-68-E6-00-03-CA-34-D9-9A-35-C6\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Frameworks.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Frameworks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F2-58-94-5C-AE-F2-A7-8A-8B-30-7C-11-FD-9F-26-D2-52-A0-20-73\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Configuration.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Configuration</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E4-51-7F-05-08-F3-02-02-27-8E-E8-21-7C-ED-F0-78-12-BA-03-DA\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Build.Tasks.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:22Z</ModuleTime>\n            <ModuleName>NuGet.Build.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E4-51-7F-05-08-F3-02-02-27-8E-E8-21-7C-ED-F0-78-12-BA-03-DA\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Build.Tasks.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:22Z</ModuleTime>\n            <ModuleName>NuGet.Build.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"11-27-AE-76-EA-89-8D-78-90-4F-7C-8D-62-56-14-CD-EF-02-37-D9\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Common.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"11-27-AE-76-EA-89-8D-78-90-4F-7C-8D-62-56-14-CD-EF-02-37-D9\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Common.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9A-73-83-D7-DB-DD-27-CD-88-01-22-D7-EF-C7-FF-A7-B2-07-F7-3B\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Commands.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Commands</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9A-73-83-D7-DB-DD-27-CD-88-01-22-D7-EF-C7-FF-A7-B2-07-F7-3B\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Commands.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Commands</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"36-E8-16-54-B7-19-BD-A8-2A-38-DC-64-7B-B6-08-2C-AE-DF-59-4A\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.ProjectModel.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:26Z</ModuleTime>\n            <ModuleName>NuGet.ProjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"36-E8-16-54-B7-19-BD-A8-2A-38-DC-64-7B-B6-08-2C-AE-DF-59-4A\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.ProjectModel.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:26Z</ModuleTime>\n            <ModuleName>NuGet.ProjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5E-EA-96-C3-0B-C7-BF-BA-AE-4A-27-D8-9A-9A-67-A2-72-BF-89-1F\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.NonGeneric.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:32Z</ModuleTime>\n            <ModuleName>System.Collections.NonGeneric</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5E-EA-96-C3-0B-C7-BF-BA-AE-4A-27-D8-9A-9A-67-A2-72-BF-89-1F\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.NonGeneric.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:32Z</ModuleTime>\n            <ModuleName>System.Collections.NonGeneric</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4E-A9-32-5A-D2-0F-84-D8-73-42-C7-0B-6A-3C-7B-C0-89-B7-20-01\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\Microsoft.Win32.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n            <ModuleName>Microsoft.Win32.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4E-A9-32-5A-D2-0F-84-D8-73-42-C7-0B-6A-3C-7B-C0-89-B7-20-01\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\Microsoft.Win32.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n            <ModuleName>Microsoft.Win32.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F2-58-94-5C-AE-F2-A7-8A-8B-30-7C-11-FD-9F-26-D2-52-A0-20-73\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Configuration.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Configuration</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F2-58-94-5C-AE-F2-A7-8A-8B-30-7C-11-FD-9F-26-D2-52-A0-20-73\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Configuration.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Configuration</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4B-5A-EC-05-10-C3-65-A3-7C-C5-D4-52-0E-41-A4-1F-73-88-F9-01\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.XDocument.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Xml.XDocument</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4B-5A-EC-05-10-C3-65-A3-7C-C5-D4-52-0E-41-A4-1F-73-88-F9-01\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.XDocument.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Xml.XDocument</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"68-1D-85-11-BD-EC-60-7F-F2-E8-83-FF-C6-D8-D9-CB-28-C8-8B-2A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Xml.Linq.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:30Z</ModuleTime>\n            <ModuleName>System.Private.Xml.Linq</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"68-1D-85-11-BD-EC-60-7F-F2-E8-83-FF-C6-D8-D9-CB-28-C8-8B-2A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Xml.Linq.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:30Z</ModuleTime>\n            <ModuleName>System.Private.Xml.Linq</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"55-8E-C2-A5-09-4D-3F-8C-11-59-AB-41-D5-05-B5-7B-8D-3A-AA-6E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"55-8E-C2-A5-09-4D-3F-8C-11-59-AB-41-D5-05-B5-7B-8D-3A-AA-6E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"81-0C-F3-3E-51-92-D0-E4-C7-7A-C4-D0-2E-C3-CC-6C-34-E6-D7-18\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Versioning.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:43:48Z</ModuleTime>\n            <ModuleName>NuGet.Versioning</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"81-0C-F3-3E-51-92-D0-E4-C7-7A-C4-D0-2E-C3-CC-6C-34-E6-D7-18\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Versioning.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:43:48Z</ModuleTime>\n            <ModuleName>NuGet.Versioning</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"81-0C-F3-3E-51-92-D0-E4-C7-7A-C4-D0-2E-C3-CC-6C-34-E6-D7-18\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Versioning.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:43:48Z</ModuleTime>\n            <ModuleName>NuGet.Versioning</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"43-64-EE-FB-2B-CB-04-44-D6-D5-68-E6-00-03-CA-34-D9-9A-35-C6\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Frameworks.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Frameworks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"43-64-EE-FB-2B-CB-04-44-D6-D5-68-E6-00-03-CA-34-D9-9A-35-C6\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Frameworks.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Frameworks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"43-64-EE-FB-2B-CB-04-44-D6-D5-68-E6-00-03-CA-34-D9-9A-35-C6\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Frameworks.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Frameworks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"3C-6B-ED-4B-FA-6C-10-19-4A-12-34-FC-E0-70-F3-70-7C-58-BD-82\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Newtonsoft.Json.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:43:48Z</ModuleTime>\n            <ModuleName>Newtonsoft.Json</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"6F-CC-2C-76-AC-42-0E-1D-29-DC-BE-AB-E0-6D-A4-C2-9D-0C-27-23\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Linq.Expressions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:18Z</ModuleTime>\n            <ModuleName>System.Linq.Expressions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"6D-0F-A0-D8-6E-D9-3D-12-46-84-DE-CC-44-CE-CF-2B-96-27-29-EA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.TypeConverter.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:32Z</ModuleTime>\n            <ModuleName>System.ComponentModel.TypeConverter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"18-71-46-94-36-55-BA-42-DC-70-B8-FB-CB-47-53-46-BC-07-97-6F\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Packaging.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Packaging</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8F-CA-FC-BE-CF-59-51-70-73-DF-FA-12-D9-07-FF-31-9C-F2-7B-3A\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.LibraryModel.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.LibraryModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8A-CB-B6-B3-E3-37-ED-90-BE-07-BD-2E-2B-E8-75-50-F6-12-63-7B\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Protocol.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Protocol</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"71-2C-E9-CA-85-B8-8F-D9-04-1B-18-26-60-00-6A-A4-C4-26-BB-A6\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Credentials.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:26Z</ModuleTime>\n            <ModuleName>NuGet.Credentials</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"03-E9-A6-34-43-87-E3-D3-27-29-CB-80-91-3F-B1-99-54-02-59-17\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.DependencyResolver.Core.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.DependencyResolver.Core</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"96-C7-5C-FC-1E-89-3E-67-F0-53-6B-39-C4-C0-61-BC-52-35-9C-A0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Serialization.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Serialization.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"6E-50-A1-2A-7E-70-B6-5C-B5-48-65-1E-90-FC-92-89-65-1A-F5-6F\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Numerics.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Numerics</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B3-44-E0-6E-7A-CB-1B-06-37-3E-84-75-01-86-B8-6B-40-5A-F6-CE\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.TestPlatform.Build.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:46Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.Build</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B3-44-E0-6E-7A-CB-1B-06-37-3E-84-75-01-86-B8-6B-40-5A-F6-CE\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.TestPlatform.Build.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:46Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.Build</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F2-84-10-73-D5-25-3C-C8-54-CA-05-A9-21-5F-EC-4F-D6-B7-11-E4\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\mscorlib.dll</ModulePath>\n            <ModuleTime>2020-02-21T02:00:46Z</ModuleTime>\n            <ModuleName>mscorlib</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F2-84-10-73-D5-25-3C-C8-54-CA-05-A9-21-5F-EC-4F-D6-B7-11-E4\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\mscorlib.dll</ModulePath>\n            <ModuleTime>2020-02-21T02:00:46Z</ModuleTime>\n            <ModuleName>mscorlib</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F0-C5-75-3F-22-17-B9-2C-E6-C3-3C-A7-4D-EE-AF-C8-FF-35-92-AC\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.CompilerServices.Unsafe.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Runtime.CompilerServices.Unsafe</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"36-E8-16-54-B7-19-BD-A8-2A-38-DC-64-7B-B6-08-2C-AE-DF-59-4A\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.ProjectModel.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:26Z</ModuleTime>\n            <ModuleName>NuGet.ProjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F0-C5-75-3F-22-17-B9-2C-E6-C3-3C-A7-4D-EE-AF-C8-FF-35-92-AC\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.CompilerServices.Unsafe.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Runtime.CompilerServices.Unsafe</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"36-E8-16-54-B7-19-BD-A8-2A-38-DC-64-7B-B6-08-2C-AE-DF-59-4A\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.ProjectModel.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:26Z</ModuleTime>\n            <ModuleName>NuGet.ProjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F2-84-10-73-D5-25-3C-C8-54-CA-05-A9-21-5F-EC-4F-D6-B7-11-E4\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\mscorlib.dll</ModulePath>\n            <ModuleTime>2020-02-21T02:00:46Z</ModuleTime>\n            <ModuleName>mscorlib</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"42-A4-D5-63-DA-C9-6B-42-3E-CF-98-F9-FB-80-3B-23-4D-E8-7E-B3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:34Z</ModuleTime>\n            <ModuleName>System.ComponentModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"42-A4-D5-63-DA-C9-6B-42-3E-CF-98-F9-FB-80-3B-23-4D-E8-7E-B3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:34Z</ModuleTime>\n            <ModuleName>System.ComponentModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B3-44-E0-6E-7A-CB-1B-06-37-3E-84-75-01-86-B8-6B-40-5A-F6-CE\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.TestPlatform.Build.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:46Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.Build</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"EF-F5-62-5F-AF-AF-B2-EE-AD-D8-B0-5F-2F-34-FF-0C-C9-DD-5C-66\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Tools.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:36Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Tools</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C1-41-1B-16-60-41-0D-35-CE-85-82-6D-04-AB-CE-5C-88-E8-BE-91\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:06Z</ModuleTime>\n            <ModuleName>System.IO</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A5-1D-73-D2-8D-F6-70-B7-B7-8B-00-F4-17-70-7F-2A-98-D3-1C-F9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Encoding.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Text.Encoding</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"CC-FC-9F-9B-3F-02-43-A8-4C-9F-1C-AD-15-23-EF-34-31-D4-A6-0C\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.Compression.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:40Z</ModuleTime>\n            <ModuleName>System.IO.Compression</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9E-63-EF-9A-D8-E6-C0-64-EB-31-79-F5-8C-35-7D-C2-C5-D2-94-7D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Http.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:44Z</ModuleTime>\n            <ModuleName>System.Net.Http</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2A-48-85-A6-03-C4-07-FD-29-10-28-5A-25-BF-0C-FA-03-A7-98-B2\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Net.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A5-D1-78-2C-3D-8D-E9-D4-52-E4-0C-B0-3D-34-F4-8D-7A-08-C6-C3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Security.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:26Z</ModuleTime>\n            <ModuleName>System.Net.Security</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2D-D2-58-DD-BA-4D-D9-A2-D8-99-CB-EF-60-05-5F-E6-2B-B1-A8-C7\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.X509Certificates.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.X509Certificates</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"36-E8-16-54-B7-19-BD-A8-2A-38-DC-64-7B-B6-08-2C-AE-DF-59-4A\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.ProjectModel.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:26Z</ModuleTime>\n            <ModuleName>NuGet.ProjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"81-0C-F3-3E-51-92-D0-E4-C7-7A-C4-D0-2E-C3-CC-6C-34-E6-D7-18\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Versioning.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:43:48Z</ModuleTime>\n            <ModuleName>NuGet.Versioning</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"18-71-46-94-36-55-BA-42-DC-70-B8-FB-CB-47-53-46-BC-07-97-6F\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Packaging.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Packaging</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"11-27-AE-76-EA-89-8D-78-90-4F-7C-8D-62-56-14-CD-EF-02-37-D9\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Common.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4F-0A-ED-F6-02-69-AD-2A-C5-2B-2C-93-BD-A8-93-87-63-5A-5E-FD\">\n            <ModulePath>BranchCoverage3296\\.sonarqube\\bin\\SonarScanner.MSBuild.Tasks.dll</ModulePath>\n            <ModuleTime>2019-11-06T10:01:08Z</ModuleTime>\n            <ModuleName>SonarScanner.MSBuild.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"06-FE-91-56-B3-97-3C-54-B4-DF-B8-F2-2C-63-4C-B2-7B-B5-56-11\">\n            <ModulePath>BranchCoverage3296\\.sonarqube\\bin\\SonarScanner.MSBuild.Common.dll</ModulePath>\n            <ModuleTime>2019-11-06T10:01:08Z</ModuleTime>\n            <ModuleName>SonarScanner.MSBuild.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"96-BE-1B-A1-47-C7-A9-22-1A-36-76-9C-CD-84-A9-47-AB-29-BF-1F\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.XmlSerializer.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Xml.XmlSerializer</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"06-80-9E-D1-73-4C-C3-26-E9-10-FB-BA-48-03-C8-00-F3-CE-AD-3F\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:30Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"\">\n            <ModulePath>RefEmit_InMemoryManifestModule</ModulePath>\n            <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n            <ModuleName>Microsoft.GeneratedCode</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"\">\n            <ModulePath>RefEmit_InMemoryManifestModule</ModulePath>\n            <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n            <ModuleName>Microsoft.GeneratedCode</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"22-28-72-75-40-0A-51-3A-66-C2-5F-6B-3C-7B-2D-19-EA-73-0E-B4\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Roslyn\\Microsoft.Build.Tasks.CodeAnalysis.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>Microsoft.Build.Tasks.CodeAnalysis</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"\">\n            <ModulePath>RefEmit_InMemoryManifestModule</ModulePath>\n            <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n            <ModuleName>Microsoft.GeneratedCode</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"81-0C-F3-3E-51-92-D0-E4-C7-7A-C4-D0-2E-C3-CC-6C-34-E6-D7-18\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Versioning.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:43:48Z</ModuleTime>\n            <ModuleName>NuGet.Versioning</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"81-0C-F3-3E-51-92-D0-E4-C7-7A-C4-D0-2E-C3-CC-6C-34-E6-D7-18\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Versioning.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:43:48Z</ModuleTime>\n            <ModuleName>NuGet.Versioning</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"18-71-46-94-36-55-BA-42-DC-70-B8-FB-CB-47-53-46-BC-07-97-6F\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Packaging.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Packaging</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"18-71-46-94-36-55-BA-42-DC-70-B8-FB-CB-47-53-46-BC-07-97-6F\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Packaging.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Packaging</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"11-27-AE-76-EA-89-8D-78-90-4F-7C-8D-62-56-14-CD-EF-02-37-D9\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Common.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"11-27-AE-76-EA-89-8D-78-90-4F-7C-8D-62-56-14-CD-EF-02-37-D9\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Common.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2A-48-85-A6-03-C4-07-FD-29-10-28-5A-25-BF-0C-FA-03-A7-98-B2\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Net.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2A-48-85-A6-03-C4-07-FD-29-10-28-5A-25-BF-0C-FA-03-A7-98-B2\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Net.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"88-C2-81-23-88-9B-01-F5-41-12-93-F2-07-C5-30-2F-E9-C7-6C-F6\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Core.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:34Z</ModuleTime>\n            <ModuleName>System.Core</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"88-C2-81-23-88-9B-01-F5-41-12-93-F2-07-C5-30-2F-E9-C7-6C-F6\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Core.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:34Z</ModuleTime>\n            <ModuleName>System.Core</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F5-4A-B0-89-01-16-50-65-5F-DD-4C-B5-70-9E-39-1A-D1-B7-FE-38\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Metadata.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Metadata</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F5-4A-B0-89-01-16-50-65-5F-DD-4C-B5-70-9E-39-1A-D1-B7-FE-38\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Metadata.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Metadata</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"ED-AD-51-03-F6-38-CC-C2-AA-8C-6C-A7-26-44-05-C3-B7-66-2C-5B\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.MemoryMappedFiles.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:04Z</ModuleTime>\n            <ModuleName>System.IO.MemoryMappedFiles</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"ED-AD-51-03-F6-38-CC-C2-AA-8C-6C-A7-26-44-05-C3-B7-66-2C-5B\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.MemoryMappedFiles.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:04Z</ModuleTime>\n            <ModuleName>System.IO.MemoryMappedFiles</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4F-0A-ED-F6-02-69-AD-2A-C5-2B-2C-93-BD-A8-93-87-63-5A-5E-FD\">\n            <ModulePath>BranchCoverage3296\\.sonarqube\\bin\\SonarScanner.MSBuild.Tasks.dll</ModulePath>\n            <ModuleTime>2019-11-06T10:01:08Z</ModuleTime>\n            <ModuleName>SonarScanner.MSBuild.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"06-FE-91-56-B3-97-3C-54-B4-DF-B8-F2-2C-63-4C-B2-7B-B5-56-11\">\n            <ModulePath>BranchCoverage3296\\.sonarqube\\bin\\SonarScanner.MSBuild.Common.dll</ModulePath>\n            <ModuleTime>2019-11-06T10:01:08Z</ModuleTime>\n            <ModuleName>SonarScanner.MSBuild.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4F-0A-ED-F6-02-69-AD-2A-C5-2B-2C-93-BD-A8-93-87-63-5A-5E-FD\">\n            <ModulePath>BranchCoverage3296\\.sonarqube\\bin\\SonarScanner.MSBuild.Tasks.dll</ModulePath>\n            <ModuleTime>2019-11-06T10:01:08Z</ModuleTime>\n            <ModuleName>SonarScanner.MSBuild.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"06-FE-91-56-B3-97-3C-54-B4-DF-B8-F2-2C-63-4C-B2-7B-B5-56-11\">\n            <ModulePath>BranchCoverage3296\\.sonarqube\\bin\\SonarScanner.MSBuild.Common.dll</ModulePath>\n            <ModuleTime>2019-11-06T10:01:08Z</ModuleTime>\n            <ModuleName>SonarScanner.MSBuild.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"96-BE-1B-A1-47-C7-A9-22-1A-36-76-9C-CD-84-A9-47-AB-29-BF-1F\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.XmlSerializer.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Xml.XmlSerializer</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"96-BE-1B-A1-47-C7-A9-22-1A-36-76-9C-CD-84-A9-47-AB-29-BF-1F\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.XmlSerializer.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Xml.XmlSerializer</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"06-80-9E-D1-73-4C-C3-26-E9-10-FB-BA-48-03-C8-00-F3-CE-AD-3F\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:30Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"\">\n            <ModulePath>RefEmit_InMemoryManifestModule</ModulePath>\n            <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n            <ModuleName>Microsoft.GeneratedCode</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"06-80-9E-D1-73-4C-C3-26-E9-10-FB-BA-48-03-C8-00-F3-CE-AD-3F\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:30Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"\">\n            <ModulePath>RefEmit_InMemoryManifestModule</ModulePath>\n            <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n            <ModuleName>Microsoft.GeneratedCode</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"22-28-72-75-40-0A-51-3A-66-C2-5F-6B-3C-7B-2D-19-EA-73-0E-B4\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Roslyn\\Microsoft.Build.Tasks.CodeAnalysis.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>Microsoft.Build.Tasks.CodeAnalysis</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"22-28-72-75-40-0A-51-3A-66-C2-5F-6B-3C-7B-2D-19-EA-73-0E-B4\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Roslyn\\Microsoft.Build.Tasks.CodeAnalysis.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>Microsoft.Build.Tasks.CodeAnalysis</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"\">\n            <ModulePath>RefEmit_InMemoryManifestModule</ModulePath>\n            <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n            <ModuleName>Microsoft.GeneratedCode</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"\">\n            <ModulePath>RefEmit_InMemoryManifestModule</ModulePath>\n            <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n            <ModuleName>Microsoft.GeneratedCode</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"19-DB-E7-26-74-3E-B8-3C-B9-3E-89-49-9F-20-99-D9-CF-23-FD-17\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.CoreLib.dll</ModulePath>\n            <ModuleTime>2020-02-18T20:16:14Z</ModuleTime>\n            <ModuleName>System.Private.CoreLib</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"19-DB-E7-26-74-3E-B8-3C-B9-3E-89-49-9F-20-99-D9-CF-23-FD-17\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.CoreLib.dll</ModulePath>\n            <ModuleTime>2020-02-18T20:16:14Z</ModuleTime>\n            <ModuleName>System.Private.CoreLib</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C5-B4-6F-68-5D-85-FF-B9-B3-F6-E7-E5-87-BC-47-13-C3-03-85-42\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\vstest.console.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:43:48Z</ModuleTime>\n            <ModuleName>vstest.console</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"45-AE-FF-2D-9F-D9-14-AE-5E-58-BC-AD-59-3F-6B-E0-C7-F9-45-CA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Runtime</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C5-B4-6F-68-5D-85-FF-B9-B3-F6-E7-E5-87-BC-47-13-C3-03-85-42\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\vstest.console.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:43:48Z</ModuleTime>\n            <ModuleName>vstest.console</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"45-AE-FF-2D-9F-D9-14-AE-5E-58-BC-AD-59-3F-6B-E0-C7-F9-45-CA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Runtime</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4D-33-53-11-50-36-83-92-2B-29-8C-5A-FA-19-EF-5A-D4-AA-32-80\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Process.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:38Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Process</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E5-F8-08-77-40-69-F3-B4-39-9E-F4-4F-30-35-FF-75-AD-66-E9-C9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:34Z</ModuleTime>\n            <ModuleName>System.ComponentModel.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B8-01-4B-08-49-01-14-1F-52-C1-06-1B-E1-C4-DA-8C-8C-15-88-14\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"92-D6-1E-14-62-24-DB-73-F3-A0-87-8B-5C-9C-71-AE-8C-A6-49-86\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.TestPlatform.CoreUtilities.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:48Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.CoreUtilities</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-0A-47-0B-10-27-7A-98-D6-A5-5B-EC-1C-35-91-93-AB-C0-35-65\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\netstandard.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>netstandard</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"32-77-95-87-72-D8-6D-43-AA-DA-36-9B-86-D6-99-7F-41-0E-CF-A5\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Debug.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Debug</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A3-6E-3F-5C-23-E9-CE-D4-59-A4-79-82-3A-A2-A6-D2-A6-37-0E-C2\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Thread.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.Thread</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4D-33-53-11-50-36-83-92-2B-29-8C-5A-FA-19-EF-5A-D4-AA-32-80\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Process.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:38Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Process</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E5-F8-08-77-40-69-F3-B4-39-9E-F4-4F-30-35-FF-75-AD-66-E9-C9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:34Z</ModuleTime>\n            <ModuleName>System.ComponentModel.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9C-68-F9-D9-5D-09-7B-AC-36-D7-6D-25-3D-17-F3-72-E5-1A-87-F0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:06Z</ModuleTime>\n            <ModuleName>System.Threading</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B8-01-4B-08-49-01-14-1F-52-C1-06-1B-E1-C4-DA-8C-8C-15-88-14\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"32-5D-5E-82-60-49-7F-5D-44-D4-1E-BF-57-95-6F-D8-30-A6-C2-E1\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Console.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n            <ModuleName>System.Console</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"92-D6-1E-14-62-24-DB-73-F3-A0-87-8B-5C-9C-71-AE-8C-A6-49-86\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.TestPlatform.CoreUtilities.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:48Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.CoreUtilities</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-0A-47-0B-10-27-7A-98-D6-A5-5B-EC-1C-35-91-93-AB-C0-35-65\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\netstandard.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>netstandard</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"32-77-95-87-72-D8-6D-43-AA-DA-36-9B-86-D6-99-7F-41-0E-CF-A5\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Debug.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Debug</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A3-6E-3F-5C-23-E9-CE-D4-59-A4-79-82-3A-A2-A6-D2-A6-37-0E-C2\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Thread.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.Thread</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4E-96-5A-FC-C0-BE-6F-D4-A5-9C-B4-F8-33-D5-85-D1-B9-07-9F-89\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Encoding.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Text.Encoding.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9C-68-F9-D9-5D-09-7B-AC-36-D7-6D-25-3D-17-F3-72-E5-1A-87-F0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:06Z</ModuleTime>\n            <ModuleName>System.Threading</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"32-5D-5E-82-60-49-7F-5D-44-D4-1E-BF-57-95-6F-D8-30-A6-C2-E1\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Console.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n            <ModuleName>System.Console</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4E-96-5A-FC-C0-BE-6F-D4-A5-9C-B4-F8-33-D5-85-D1-B9-07-9F-89\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Encoding.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Text.Encoding.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D3-FC-01-5E-22-55-B9-FD-FB-0D-0E-A5-B8-58-05-D8-DC-D2-F5-24\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Tracing.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:36Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Tracing</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D3-FC-01-5E-22-55-B9-FD-FB-0D-0E-A5-B8-58-05-D8-DC-D2-F5-24\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Tracing.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:36Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Tracing</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8B-E9-5A-2E-CC-DB-5C-E1-03-05-BA-E1-31-A9-9D-6F-18-10-50-AA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Collections</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B9-FF-45-54-97-94-E5-EE-F1-55-1C-4C-1D-ED-C5-F1-4E-56-04-D6\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:22Z</ModuleTime>\n            <ModuleName>Microsoft.VisualStudio.TestPlatform.ObjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F4-74-D8-EC-37-07-89-F7-DE-41-4A-0C-45-90-94-9E-A5-09-14-06\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.VisualStudio.TestPlatform.Client.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:22Z</ModuleTime>\n            <ModuleName>Microsoft.VisualStudio.TestPlatform.Client</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4C-5D-3E-A4-C6-A7-88-97-E0-76-1D-3C-13-D7-AB-BC-57-B4-67-F9\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.VisualStudio.TestPlatform.Common.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:47:02Z</ModuleTime>\n            <ModuleName>Microsoft.VisualStudio.TestPlatform.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"33-87-51-E6-2F-8C-BE-1D-5B-B2-9E-51-10-1B-05-40-2C-E3-E8-1A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Linq.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:40Z</ModuleTime>\n            <ModuleName>System.Linq</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8B-E9-5A-2E-CC-DB-5C-E1-03-05-BA-E1-31-A9-9D-6F-18-10-50-AA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Collections</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B9-FF-45-54-97-94-E5-EE-F1-55-1C-4C-1D-ED-C5-F1-4E-56-04-D6\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:22Z</ModuleTime>\n            <ModuleName>Microsoft.VisualStudio.TestPlatform.ObjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F4-74-D8-EC-37-07-89-F7-DE-41-4A-0C-45-90-94-9E-A5-09-14-06\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.VisualStudio.TestPlatform.Client.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:22Z</ModuleTime>\n            <ModuleName>Microsoft.VisualStudio.TestPlatform.Client</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B9-08-B2-09-3C-61-2C-3E-62-03-05-65-93-6A-84-E5-2C-0D-A7-F4\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.InteropServices.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4C-5D-3E-A4-C6-A7-88-97-E0-76-1D-3C-13-D7-AB-BC-57-B4-67-F9\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.VisualStudio.TestPlatform.Common.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:47:02Z</ModuleTime>\n            <ModuleName>Microsoft.VisualStudio.TestPlatform.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"57-E8-B3-F8-DB-88-F2-FB-81-BE-34-C3-AD-1E-D4-F0-DD-F0-59-D3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Resources.ResourceManager.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Resources.ResourceManager</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"33-87-51-E6-2F-8C-BE-1D-5B-B2-9E-51-10-1B-05-40-2C-E3-E8-1A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Linq.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:40Z</ModuleTime>\n            <ModuleName>System.Linq</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B9-08-B2-09-3C-61-2C-3E-62-03-05-65-93-6A-84-E5-2C-0D-A7-F4\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.InteropServices.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"57-E8-B3-F8-DB-88-F2-FB-81-BE-34-C3-AD-1E-D4-F0-DD-F0-59-D3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Resources.ResourceManager.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Resources.ResourceManager</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A6-81-2A-5B-4A-3D-C8-4D-49-04-DE-1F-DF-02-7C-B4-43-51-DE-1C\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.FileSystem.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.IO.FileSystem</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A6-81-2A-5B-4A-3D-C8-4D-49-04-DE-1F-DF-02-7C-B4-43-51-DE-1C\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.FileSystem.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.IO.FileSystem</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2F-E1-13-B8-1E-10-AE-79-4A-CD-F8-AE-C1-F1-E8-22-10-2F-61-17\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.ReaderWriter.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Xml.ReaderWriter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2F-E1-13-B8-1E-10-AE-79-4A-CD-F8-AE-C1-F1-E8-22-10-2F-61-17\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.ReaderWriter.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Xml.ReaderWriter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"1F-BD-6F-06-01-11-FA-A9-DB-0B-12-95-1E-A0-B6-62-C2-59-ED-05\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Xml.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:38Z</ModuleTime>\n            <ModuleName>System.Private.Xml</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C0-AF-8F-C2-7E-FA-FB-83-67-D3-56-10-08-BB-63-E8-4F-C8-F0-D3\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.TestPlatform.PlatformAbstractions.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:48Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.PlatformAbstractions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"25-FA-4B-8B-8A-A0-0A-BA-5F-16-77-6A-F8-D1-03-FD-B2-46-A8-11\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.TestPlatform.Utilities.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:22Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.Utilities</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"26-14-D7-B5-EB-43-C2-76-01-4F-01-5E-7B-A4-CE-E9-EB-E3-AA-B9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.InteropServices.RuntimeInformation.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices.RuntimeInformation</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"1F-BD-6F-06-01-11-FA-A9-DB-0B-12-95-1E-A0-B6-62-C2-59-ED-05\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Xml.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:38Z</ModuleTime>\n            <ModuleName>System.Private.Xml</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C0-AF-8F-C2-7E-FA-FB-83-67-D3-56-10-08-BB-63-E8-4F-C8-F0-D3\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.TestPlatform.PlatformAbstractions.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:48Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.PlatformAbstractions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"25-FA-4B-8B-8A-A0-0A-BA-5F-16-77-6A-F8-D1-03-FD-B2-46-A8-11\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.TestPlatform.Utilities.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:22Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.Utilities</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"26-14-D7-B5-EB-43-C2-76-01-4F-01-5E-7B-A4-CE-E9-EB-E3-AA-B9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.InteropServices.RuntimeInformation.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices.RuntimeInformation</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"43-64-EE-FB-2B-CB-04-44-D6-D5-68-E6-00-03-CA-34-D9-9A-35-C6\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Frameworks.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Frameworks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"43-64-EE-FB-2B-CB-04-44-D6-D5-68-E6-00-03-CA-34-D9-9A-35-C6\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\NuGet.Frameworks.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:24Z</ModuleTime>\n            <ModuleName>NuGet.Frameworks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D5-0A-67-87-14-54-BA-3A-F2-2A-2A-B8-15-CE-D1-74-51-44-E5-FC\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Uri.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:26Z</ModuleTime>\n            <ModuleName>System.Private.Uri</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"AF-4F-3B-E9-D2-80-A0-2E-91-5B-AF-17-34-A9-F1-A6-32-C4-EC-4E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Memory.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Memory</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D5-0A-67-87-14-54-BA-3A-F2-2A-2A-B8-15-CE-D1-74-51-44-E5-FC\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Uri.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:26Z</ModuleTime>\n            <ModuleName>System.Private.Uri</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-F9-21-BB-3C-07-A4-DA-5A-43-89-51-EB-E0-A4-B9-2F-19-F6-7D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.Algorithms.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Algorithms</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"AF-4F-3B-E9-D2-80-A0-2E-91-5B-AF-17-34-A9-F1-A6-32-C4-EC-4E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Memory.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Memory</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-F9-21-BB-3C-07-A4-DA-5A-43-89-51-EB-E0-A4-B9-2F-19-F6-7D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.Algorithms.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Algorithms</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"66-55-F3-9A-C4-53-63-95-5F-60-D2-19-0F-7E-3B-2B-85-46-FB-8D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.TraceSource.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Diagnostics.TraceSource</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"66-55-F3-9A-C4-53-63-95-5F-60-D2-19-0F-7E-3B-2B-85-46-FB-8D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.TraceSource.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Diagnostics.TraceSource</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FC-9A-A3-24-E8-48-FF-9E-1A-D8-C2-B3-54-1E-A8-DD-B2-E1-E3-96\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.ThreadPool.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.ThreadPool</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5E-EA-96-C3-0B-C7-BF-BA-AE-4A-27-D8-9A-9A-67-A2-72-BF-89-1F\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.NonGeneric.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:32Z</ModuleTime>\n            <ModuleName>System.Collections.NonGeneric</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FC-9A-A3-24-E8-48-FF-9E-1A-D8-C2-B3-54-1E-A8-DD-B2-E1-E3-96\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.ThreadPool.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.ThreadPool</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5E-EA-96-C3-0B-C7-BF-BA-AE-4A-27-D8-9A-9A-67-A2-72-BF-89-1F\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.NonGeneric.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:32Z</ModuleTime>\n            <ModuleName>System.Collections.NonGeneric</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5D-6D-F0-C2-3B-E4-3D-F4-31-9F-65-26-E3-6C-69-57-41-07-04-68\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.Extensions.FileSystemGlobbing.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:42Z</ModuleTime>\n            <ModuleName>Microsoft.Extensions.FileSystemGlobbing</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5D-6D-F0-C2-3B-E4-3D-F4-31-9F-65-26-E3-6C-69-57-41-07-04-68\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.Extensions.FileSystemGlobbing.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:42Z</ModuleTime>\n            <ModuleName>Microsoft.Extensions.FileSystemGlobbing</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F6-E7-29-AB-39-E0-7C-13-70-CF-AC-B2-AB-D0-49-87-2A-34-C1-64\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.TestPlatform.CrossPlatEngine.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:22Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.CrossPlatEngine</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F6-E7-29-AB-39-E0-7C-13-70-CF-AC-B2-AB-D0-49-87-2A-34-C1-64\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.TestPlatform.CrossPlatEngine.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:45:22Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.CrossPlatEngine</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"3D-ED-2E-29-0D-BD-86-B5-75-96-FF-B0-C8-9D-AD-4E-5B-94-58-57\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Loader.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Loader</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"3D-ED-2E-29-0D-BD-86-B5-75-96-FF-B0-C8-9D-AD-4E-5B-94-58-57\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Loader.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Loader</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4A-53-F5-47-1F-79-0D-C2-A0-C2-4E-CF-CA-18-30-0C-4C-0B-1E-EB\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Extensions\\Microsoft.TestPlatform.Extensions.BlameDataCollector.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:32Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.Extensions.BlameDataCollector</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"04-77-E0-D3-40-DA-95-B9-FC-B5-A1-54-7E-38-5B-86-0D-1B-18-A2\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Extensions\\Microsoft.TestPlatform.Extensions.EventLogCollector.dll</ModulePath>\n            <ModuleTime>2020-02-04T18:55:20Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.Extensions.EventLogCollector</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F2-84-10-73-D5-25-3C-C8-54-CA-05-A9-21-5F-EC-4F-D6-B7-11-E4\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\mscorlib.dll</ModulePath>\n            <ModuleTime>2020-02-21T02:00:46Z</ModuleTime>\n            <ModuleName>mscorlib</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"73-E1-7F-C7-2D-C9-99-D8-D5-D4-21-69-B8-EB-65-4F-5D-EE-9F-B3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:26Z</ModuleTime>\n            <ModuleName>System.Xml</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4A-53-F5-47-1F-79-0D-C2-A0-C2-4E-CF-CA-18-30-0C-4C-0B-1E-EB\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Extensions\\Microsoft.TestPlatform.Extensions.BlameDataCollector.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:32Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.Extensions.BlameDataCollector</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8F-10-3B-1F-DD-91-01-95-79-0E-F6-D0-4B-B1-E9-93-CF-9F-3A-18\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Extensions\\Microsoft.TestPlatform.TestHostRuntimeProvider.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:40Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.TestHostRuntimeProvider</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"23-F9-09-16-3B-71-58-F5-A7-35-CA-89-4D-75-0F-3D-D0-23-DC-EB\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Tasks.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Threading.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"04-77-E0-D3-40-DA-95-B9-FC-B5-A1-54-7E-38-5B-86-0D-1B-18-A2\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Extensions\\Microsoft.TestPlatform.Extensions.EventLogCollector.dll</ModulePath>\n            <ModuleTime>2020-02-04T18:55:20Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.Extensions.EventLogCollector</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F2-84-10-73-D5-25-3C-C8-54-CA-05-A9-21-5F-EC-4F-D6-B7-11-E4\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\mscorlib.dll</ModulePath>\n            <ModuleTime>2020-02-21T02:00:46Z</ModuleTime>\n            <ModuleName>mscorlib</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"73-E1-7F-C7-2D-C9-99-D8-D5-D4-21-69-B8-EB-65-4F-5D-EE-9F-B3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:26Z</ModuleTime>\n            <ModuleName>System.Xml</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8F-10-3B-1F-DD-91-01-95-79-0E-F6-D0-4B-B1-E9-93-CF-9F-3A-18\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Extensions\\Microsoft.TestPlatform.TestHostRuntimeProvider.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:40Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.TestHostRuntimeProvider</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"23-F9-09-16-3B-71-58-F5-A7-35-CA-89-4D-75-0F-3D-D0-23-DC-EB\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Tasks.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Threading.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"17-93-DD-90-A8-82-7B-57-C3-76-20-97-82-80-AF-83-9B-1C-6C-60\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.Html.TestLogger.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:36Z</ModuleTime>\n            <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.Html.TestLogger</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FF-FA-57-35-2E-F1-77-97-83-A6-16-E9-B4-A3-70-07-E7-9C-31-25\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:36Z</ModuleTime>\n            <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"17-93-DD-90-A8-82-7B-57-C3-76-20-97-82-80-AF-83-9B-1C-6C-60\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.Html.TestLogger.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:36Z</ModuleTime>\n            <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.Html.TestLogger</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FF-FA-57-35-2E-F1-77-97-83-A6-16-E9-B4-A3-70-07-E7-9C-31-25\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:36Z</ModuleTime>\n            <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F5-4A-B0-89-01-16-50-65-5F-DD-4C-B5-70-9E-39-1A-D1-B7-FE-38\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Metadata.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Metadata</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"01-AB-1F-C1-0A-AD-1A-D5-69-41-9D-4B-4E-1C-6F-AC-59-05-9A-48\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Immutable.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>System.Collections.Immutable</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F5-4A-B0-89-01-16-50-65-5F-DD-4C-B5-70-9E-39-1A-D1-B7-FE-38\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Metadata.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Metadata</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"01-AB-1F-C1-0A-AD-1A-D5-69-41-9D-4B-4E-1C-6F-AC-59-05-9A-48\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Immutable.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>System.Collections.Immutable</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4E-A9-32-5A-D2-0F-84-D8-73-42-C7-0B-6A-3C-7B-C0-89-B7-20-01\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\Microsoft.Win32.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n            <ModuleName>Microsoft.Win32.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4E-A9-32-5A-D2-0F-84-D8-73-42-C7-0B-6A-3C-7B-C0-89-B7-20-01\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\Microsoft.Win32.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n            <ModuleName>Microsoft.Win32.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8F-A1-95-7C-65-A0-95-11-53-8D-DF-11-6D-3C-AD-5D-AE-2F-D3-73\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Concurrent.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>System.Collections.Concurrent</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8F-A1-95-7C-65-A0-95-11-53-8D-DF-11-6D-3C-AD-5D-AE-2F-D3-73\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Concurrent.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>System.Collections.Concurrent</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9D-25-19-27-36-F6-C2-E1-00-4F-1C-5A-3B-B4-6F-F9-7F-69-AB-4E\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.TestPlatform.CommunicationUtilities.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:48Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.CommunicationUtilities</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9D-25-19-27-36-F6-C2-E1-00-4F-1C-5A-3B-B4-6F-F9-7F-69-AB-4E\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.TestPlatform.CommunicationUtilities.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:48Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.CommunicationUtilities</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"3C-6B-ED-4B-FA-6C-10-19-4A-12-34-FC-E0-70-F3-70-7C-58-BD-82\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Newtonsoft.Json.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:43:48Z</ModuleTime>\n            <ModuleName>Newtonsoft.Json</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B6-58-2E-A2-A7-DF-F0-53-14-F6-45-D8-42-D5-5A-6B-69-F7-12-C9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Serialization.Formatters.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Serialization.Formatters</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"3C-6B-ED-4B-FA-6C-10-19-4A-12-34-FC-E0-70-F3-70-7C-58-BD-82\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Newtonsoft.Json.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:43:48Z</ModuleTime>\n            <ModuleName>Newtonsoft.Json</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B6-58-2E-A2-A7-DF-F0-53-14-F6-45-D8-42-D5-5A-6B-69-F7-12-C9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Serialization.Formatters.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Serialization.Formatters</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"25-17-3D-BA-13-03-55-32-76-CF-3D-AE-B3-52-14-5F-95-F5-3E-85\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Timer.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.Timer</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"25-17-3D-BA-13-03-55-32-76-CF-3D-AE-B3-52-14-5F-95-F5-3E-85\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Timer.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.Timer</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2A-48-85-A6-03-C4-07-FD-29-10-28-5A-25-BF-0C-FA-03-A7-98-B2\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Net.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"EE-DF-4B-C9-A1-40-03-5F-56-1A-DB-D7-E8-A0-BC-A6-12-34-84-1E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Sockets.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:08Z</ModuleTime>\n            <ModuleName>System.Net.Sockets</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2A-48-85-A6-03-C4-07-FD-29-10-28-5A-25-BF-0C-FA-03-A7-98-B2\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Net.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"EE-DF-4B-C9-A1-40-03-5F-56-1A-DB-D7-E8-A0-BC-A6-12-34-84-1E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Sockets.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:08Z</ModuleTime>\n            <ModuleName>System.Net.Sockets</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"87-6E-54-67-71-53-FA-C9-68-88-0D-C1-82-45-BE-68-5A-25-55-32\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Overlapped.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Threading.Overlapped</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E6-CE-DF-D3-05-01-F5-61-41-53-0C-FF-2C-87-01-04-6E-EB-B1-C7\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.NameResolution.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:40Z</ModuleTime>\n            <ModuleName>System.Net.NameResolution</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"87-6E-54-67-71-53-FA-C9-68-88-0D-C1-82-45-BE-68-5A-25-55-32\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Overlapped.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Threading.Overlapped</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E6-CE-DF-D3-05-01-F5-61-41-53-0C-FF-2C-87-01-04-6E-EB-B1-C7\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.NameResolution.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:40Z</ModuleTime>\n            <ModuleName>System.Net.NameResolution</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"0C-3A-E6-E1-38-B5-90-C7-A4-B2-35-FE-13-D9-F0-F4-22-8C-DD-7F\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.Extensions.DependencyModel.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:44Z</ModuleTime>\n            <ModuleName>Microsoft.Extensions.DependencyModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"0C-3A-E6-E1-38-B5-90-C7-A4-B2-35-FE-13-D9-F0-F4-22-8C-DD-7F\">\n            <ModulePath>C:\\Program Files\\dotnet\\sdk\\3.1.201\\Microsoft.Extensions.DependencyModel.dll</ModulePath>\n            <ModuleTime>2020-03-18T15:44:44Z</ModuleTime>\n            <ModuleName>Microsoft.Extensions.DependencyModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"6F-CC-2C-76-AC-42-0E-1D-29-DC-BE-AB-E0-6D-A4-C2-9D-0C-27-23\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Linq.Expressions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:18Z</ModuleTime>\n            <ModuleName>System.Linq.Expressions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"6F-CC-2C-76-AC-42-0E-1D-29-DC-BE-AB-E0-6D-A4-C2-9D-0C-27-23\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Linq.Expressions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:18Z</ModuleTime>\n            <ModuleName>System.Linq.Expressions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"6D-0F-A0-D8-6E-D9-3D-12-46-84-DE-CC-44-CE-CF-2B-96-27-29-EA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.TypeConverter.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:32Z</ModuleTime>\n            <ModuleName>System.ComponentModel.TypeConverter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"22-BD-0E-BF-F3-50-23-F4-33-69-45-CA-85-5A-41-AA-FF-98-13-6A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ObjectModel.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.ObjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"6D-0F-A0-D8-6E-D9-3D-12-46-84-DE-CC-44-CE-CF-2B-96-27-29-EA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.TypeConverter.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:32Z</ModuleTime>\n            <ModuleName>System.ComponentModel.TypeConverter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"22-BD-0E-BF-F3-50-23-F4-33-69-45-CA-85-5A-41-AA-FF-98-13-6A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ObjectModel.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.ObjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B8-EE-9E-7D-BB-C0-BA-51-7E-90-FD-C9-D6-FD-CC-4E-A0-46-68-9C\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Json.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n            <ModuleName>System.Text.Json</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"CE-43-2B-40-C0-FF-2C-68-D3-CF-AF-49-07-37-DC-D7-AA-AB-17-F3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Buffers.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:26Z</ModuleTime>\n            <ModuleName>System.Buffers</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B8-EE-9E-7D-BB-C0-BA-51-7E-90-FD-C9-D6-FD-CC-4E-A0-46-68-9C\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Json.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n            <ModuleName>System.Text.Json</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"CE-43-2B-40-C0-FF-2C-68-D3-CF-AF-49-07-37-DC-D7-AA-AB-17-F3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Buffers.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:26Z</ModuleTime>\n            <ModuleName>System.Buffers</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"CE-06-D3-2E-A9-D1-DF-9B-77-17-06-81-56-37-0F-29-3C-26-3C-CF\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Numerics.Vectors.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Numerics.Vectors</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F0-C5-75-3F-22-17-B9-2C-E6-C3-3C-A7-4D-EE-AF-C8-FF-35-92-AC\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.CompilerServices.Unsafe.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Runtime.CompilerServices.Unsafe</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"CE-06-D3-2E-A9-D1-DF-9B-77-17-06-81-56-37-0F-29-3C-26-3C-CF\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Numerics.Vectors.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Numerics.Vectors</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F0-C5-75-3F-22-17-B9-2C-E6-C3-3C-A7-4D-EE-AF-C8-FF-35-92-AC\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.CompilerServices.Unsafe.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Runtime.CompilerServices.Unsafe</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"6E-50-A1-2A-7E-70-B6-5C-B5-48-65-1E-90-FC-92-89-65-1A-F5-6F\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Numerics.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Numerics</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"6E-50-A1-2A-7E-70-B6-5C-B5-48-65-1E-90-FC-92-89-65-1A-F5-6F\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Numerics.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Numerics</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"19-DB-E7-26-74-3E-B8-3C-B9-3E-89-49-9F-20-99-D9-CF-23-FD-17\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.CoreLib.dll</ModulePath>\n            <ModuleTime>2020-02-18T20:16:14Z</ModuleTime>\n            <ModuleName>System.Private.CoreLib</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"19-DB-E7-26-74-3E-B8-3C-B9-3E-89-49-9F-20-99-D9-CF-23-FD-17\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.CoreLib.dll</ModulePath>\n            <ModuleTime>2020-02-18T20:16:14Z</ModuleTime>\n            <ModuleName>System.Private.CoreLib</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"7D-3A-F3-83-6D-97-74-27-C8-E9-63-BA-8D-D0-48-3C-92-E3-0F-27\">\n            <ModulePath>D:\\tools\\nuget\\microsoft.testplatform.testhost\\16.4.0\\build\\netcoreapp2.1\\x64\\testhost.dll</ModulePath>\n            <ModuleTime>2019-10-24T23:20:02Z</ModuleTime>\n            <ModuleName>testhost</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"45-AE-FF-2D-9F-D9-14-AE-5E-58-BC-AD-59-3F-6B-E0-C7-F9-45-CA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Runtime</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"7D-3A-F3-83-6D-97-74-27-C8-E9-63-BA-8D-D0-48-3C-92-E3-0F-27\">\n            <ModulePath>D:\\tools\\nuget\\microsoft.testplatform.testhost\\16.4.0\\build\\netcoreapp2.1\\x64\\testhost.dll</ModulePath>\n            <ModuleTime>2019-10-24T23:20:02Z</ModuleTime>\n            <ModuleName>testhost</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"45-AE-FF-2D-9F-D9-14-AE-5E-58-BC-AD-59-3F-6B-E0-C7-F9-45-CA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Runtime</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"82-51-73-4E-B7-D2-16-2E-C0-8E-C4-E6-62-93-07-C8-18-AE-1F-E3\">\n            <ModulePath>BranchCoverage3296\\SecondTestSuite\\bin\\Debug\\netcoreapp3.1\\Microsoft.TestPlatform.CoreUtilities.dll</ModulePath>\n            <ModuleTime>2019-10-24T23:20:00Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.CoreUtilities</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-0A-47-0B-10-27-7A-98-D6-A5-5B-EC-1C-35-91-93-AB-C0-35-65\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\netstandard.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>netstandard</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D3-FC-01-5E-22-55-B9-FD-FB-0D-0E-A5-B8-58-05-D8-DC-D2-F5-24\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Tracing.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:36Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Tracing</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"82-51-73-4E-B7-D2-16-2E-C0-8E-C4-E6-62-93-07-C8-18-AE-1F-E3\">\n            <ModulePath>BranchCoverage3296\\FirstTestSuite\\bin\\Debug\\netcoreapp3.1\\Microsoft.TestPlatform.CoreUtilities.dll</ModulePath>\n            <ModuleTime>2019-10-24T23:20:00Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.CoreUtilities</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-0A-47-0B-10-27-7A-98-D6-A5-5B-EC-1C-35-91-93-AB-C0-35-65\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\netstandard.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>netstandard</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D3-FC-01-5E-22-55-B9-FD-FB-0D-0E-A5-B8-58-05-D8-DC-D2-F5-24\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Tracing.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:36Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Tracing</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"3C-3B-BB-1E-4C-23-A0-8A-AE-82-07-50-C4-BD-55-77-FD-48-A8-43\">\n            <ModulePath>BranchCoverage3296\\SecondTestSuite\\bin\\Debug\\netcoreapp3.1\\Microsoft.TestPlatform.PlatformAbstractions.dll</ModulePath>\n            <ModuleTime>2019-10-24T23:20:00Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.PlatformAbstractions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B8-01-4B-08-49-01-14-1F-52-C1-06-1B-E1-C4-DA-8C-8C-15-88-14\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"32-77-95-87-72-D8-6D-43-AA-DA-36-9B-86-D6-99-7F-41-0E-CF-A5\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Debug.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Debug</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8B-E9-5A-2E-CC-DB-5C-E1-03-05-BA-E1-31-A9-9D-6F-18-10-50-AA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Collections</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A3-8E-CE-5F-4A-F0-53-BF-7A-86-29-F3-60-31-4E-C2-C7-92-64-BF\">\n            <ModulePath>BranchCoverage3296\\SecondTestSuite\\bin\\Debug\\netcoreapp3.1\\Microsoft.TestPlatform.CrossPlatEngine.dll</ModulePath>\n            <ModuleTime>2019-10-24T23:20:02Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.CrossPlatEngine</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"3A-01-82-3D-B5-F1-23-E3-44-29-52-01-DD-EB-29-DB-C4-C5-8C-CE\">\n            <ModulePath>BranchCoverage3296\\SecondTestSuite\\bin\\Debug\\netcoreapp3.1\\Microsoft.TestPlatform.CommunicationUtilities.dll</ModulePath>\n            <ModuleTime>2019-10-24T23:20:02Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.CommunicationUtilities</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"3C-3B-BB-1E-4C-23-A0-8A-AE-82-07-50-C4-BD-55-77-FD-48-A8-43\">\n            <ModulePath>BranchCoverage3296\\FirstTestSuite\\bin\\Debug\\netcoreapp3.1\\Microsoft.TestPlatform.PlatformAbstractions.dll</ModulePath>\n            <ModuleTime>2019-10-24T23:20:00Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.PlatformAbstractions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"51-13-D1-D9-16-6E-B7-32-DA-55-E3-B7-9D-7A-18-56-62-3D-30-3F\">\n            <ModulePath>BranchCoverage3296\\SecondTestSuite\\bin\\Debug\\netcoreapp3.1\\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll</ModulePath>\n            <ModuleTime>2019-10-24T23:20:00Z</ModuleTime>\n            <ModuleName>Microsoft.VisualStudio.TestPlatform.ObjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B8-01-4B-08-49-01-14-1F-52-C1-06-1B-E1-C4-DA-8C-8C-15-88-14\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"32-77-95-87-72-D8-6D-43-AA-DA-36-9B-86-D6-99-7F-41-0E-CF-A5\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Debug.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Debug</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8C-92-D8-11-B9-57-FB-91-AB-D6-D1-EA-9E-0B-7D-0C-F1-03-BC-6E\">\n            <ModulePath>BranchCoverage3296\\SecondTestSuite\\bin\\Debug\\netcoreapp3.1\\Microsoft.VisualStudio.TestPlatform.Common.dll</ModulePath>\n            <ModuleTime>2019-10-24T23:20:02Z</ModuleTime>\n            <ModuleName>Microsoft.VisualStudio.TestPlatform.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8B-E9-5A-2E-CC-DB-5C-E1-03-05-BA-E1-31-A9-9D-6F-18-10-50-AA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Collections</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"53-D0-A3-B9-10-36-09-21-32-F4-D0-88-75-00-B5-DC-77-89-1D-78\">\n            <ModulePath>BranchCoverage3296\\SecondTestSuite\\bin\\Debug\\netcoreapp3.1\\Newtonsoft.Json.dll</ModulePath>\n            <ModuleTime>2016-06-13T21:06:14Z</ModuleTime>\n            <ModuleName>Newtonsoft.Json</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"96-C7-5C-FC-1E-89-3E-67-F0-53-6B-39-C4-C0-61-BC-52-35-9C-A0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Serialization.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Serialization.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A3-8E-CE-5F-4A-F0-53-BF-7A-86-29-F3-60-31-4E-C2-C7-92-64-BF\">\n            <ModulePath>BranchCoverage3296\\FirstTestSuite\\bin\\Debug\\netcoreapp3.1\\Microsoft.TestPlatform.CrossPlatEngine.dll</ModulePath>\n            <ModuleTime>2019-10-24T23:20:02Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.CrossPlatEngine</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A6-8F-70-B6-4E-19-5D-AD-A4-E6-F3-7F-0E-80-A2-3F-81-B0-99-64\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Globalization.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Globalization</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"3A-01-82-3D-B5-F1-23-E3-44-29-52-01-DD-EB-29-DB-C4-C5-8C-CE\">\n            <ModulePath>BranchCoverage3296\\FirstTestSuite\\bin\\Debug\\netcoreapp3.1\\Microsoft.TestPlatform.CommunicationUtilities.dll</ModulePath>\n            <ModuleTime>2019-10-24T23:20:02Z</ModuleTime>\n            <ModuleName>Microsoft.TestPlatform.CommunicationUtilities</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"51-13-D1-D9-16-6E-B7-32-DA-55-E3-B7-9D-7A-18-56-62-3D-30-3F\">\n            <ModulePath>BranchCoverage3296\\FirstTestSuite\\bin\\Debug\\netcoreapp3.1\\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll</ModulePath>\n            <ModuleTime>2019-10-24T23:20:00Z</ModuleTime>\n            <ModuleName>Microsoft.VisualStudio.TestPlatform.ObjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8C-92-D8-11-B9-57-FB-91-AB-D6-D1-EA-9E-0B-7D-0C-F1-03-BC-6E\">\n            <ModulePath>BranchCoverage3296\\FirstTestSuite\\bin\\Debug\\netcoreapp3.1\\Microsoft.VisualStudio.TestPlatform.Common.dll</ModulePath>\n            <ModuleTime>2019-10-24T23:20:02Z</ModuleTime>\n            <ModuleName>Microsoft.VisualStudio.TestPlatform.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9C-68-F9-D9-5D-09-7B-AC-36-D7-6D-25-3D-17-F3-72-E5-1A-87-F0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:06Z</ModuleTime>\n            <ModuleName>System.Threading</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"53-D0-A3-B9-10-36-09-21-32-F4-D0-88-75-00-B5-DC-77-89-1D-78\">\n            <ModulePath>BranchCoverage3296\\FirstTestSuite\\bin\\Debug\\netcoreapp3.1\\Newtonsoft.Json.dll</ModulePath>\n            <ModuleTime>2016-06-13T21:06:14Z</ModuleTime>\n            <ModuleName>Newtonsoft.Json</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"96-C7-5C-FC-1E-89-3E-67-F0-53-6B-39-C4-C0-61-BC-52-35-9C-A0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Serialization.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Serialization.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A6-8F-70-B6-4E-19-5D-AD-A4-E6-F3-7F-0E-80-A2-3F-81-B0-99-64\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Globalization.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Globalization</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9C-68-F9-D9-5D-09-7B-AC-36-D7-6D-25-3D-17-F3-72-E5-1A-87-F0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:06Z</ModuleTime>\n            <ModuleName>System.Threading</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"66-55-F3-9A-C4-53-63-95-5F-60-D2-19-0F-7E-3B-2B-85-46-FB-8D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.TraceSource.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Diagnostics.TraceSource</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4D-33-53-11-50-36-83-92-2B-29-8C-5A-FA-19-EF-5A-D4-AA-32-80\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Process.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:38Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Process</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E5-F8-08-77-40-69-F3-B4-39-9E-F4-4F-30-35-FF-75-AD-66-E9-C9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:34Z</ModuleTime>\n            <ModuleName>System.ComponentModel.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"AF-4F-3B-E9-D2-80-A0-2E-91-5B-AF-17-34-A9-F1-A6-32-C4-EC-4E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Memory.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Memory</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FC-9A-A3-24-E8-48-FF-9E-1A-D8-C2-B3-54-1E-A8-DD-B2-E1-E3-96\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.ThreadPool.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.ThreadPool</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"66-55-F3-9A-C4-53-63-95-5F-60-D2-19-0F-7E-3B-2B-85-46-FB-8D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.TraceSource.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Diagnostics.TraceSource</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B9-08-B2-09-3C-61-2C-3E-62-03-05-65-93-6A-84-E5-2C-0D-A7-F4\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.InteropServices.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4E-A9-32-5A-D2-0F-84-D8-73-42-C7-0B-6A-3C-7B-C0-89-B7-20-01\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\Microsoft.Win32.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n            <ModuleName>Microsoft.Win32.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2A-48-85-A6-03-C4-07-FD-29-10-28-5A-25-BF-0C-FA-03-A7-98-B2\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Net.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4D-33-53-11-50-36-83-92-2B-29-8C-5A-FA-19-EF-5A-D4-AA-32-80\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Process.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:38Z</ModuleTime>\n            <ModuleName>System.Diagnostics.Process</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E5-F8-08-77-40-69-F3-B4-39-9E-F4-4F-30-35-FF-75-AD-66-E9-C9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:34Z</ModuleTime>\n            <ModuleName>System.ComponentModel.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"23-F9-09-16-3B-71-58-F5-A7-35-CA-89-4D-75-0F-3D-D0-23-DC-EB\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Tasks.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Threading.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"EE-DF-4B-C9-A1-40-03-5F-56-1A-DB-D7-E8-A0-BC-A6-12-34-84-1E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Sockets.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:08Z</ModuleTime>\n            <ModuleName>System.Net.Sockets</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"AF-4F-3B-E9-D2-80-A0-2E-91-5B-AF-17-34-A9-F1-A6-32-C4-EC-4E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Memory.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.Memory</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"FC-9A-A3-24-E8-48-FF-9E-1A-D8-C2-B3-54-1E-A8-DD-B2-E1-E3-96\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.ThreadPool.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.ThreadPool</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B9-08-B2-09-3C-61-2C-3E-62-03-05-65-93-6A-84-E5-2C-0D-A7-F4\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.InteropServices.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"87-6E-54-67-71-53-FA-C9-68-88-0D-C1-82-45-BE-68-5A-25-55-32\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Overlapped.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Threading.Overlapped</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4E-A9-32-5A-D2-0F-84-D8-73-42-C7-0B-6A-3C-7B-C0-89-B7-20-01\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\Microsoft.Win32.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n            <ModuleName>Microsoft.Win32.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E6-CE-DF-D3-05-01-F5-61-41-53-0C-FF-2C-87-01-04-6E-EB-B1-C7\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.NameResolution.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:40Z</ModuleTime>\n            <ModuleName>System.Net.NameResolution</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2A-48-85-A6-03-C4-07-FD-29-10-28-5A-25-BF-0C-FA-03-A7-98-B2\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Net.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"23-F9-09-16-3B-71-58-F5-A7-35-CA-89-4D-75-0F-3D-D0-23-DC-EB\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Tasks.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Threading.Tasks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"EE-DF-4B-C9-A1-40-03-5F-56-1A-DB-D7-E8-A0-BC-A6-12-34-84-1E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Sockets.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:08Z</ModuleTime>\n            <ModuleName>System.Net.Sockets</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"87-6E-54-67-71-53-FA-C9-68-88-0D-C1-82-45-BE-68-5A-25-55-32\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Overlapped.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Threading.Overlapped</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D5-0A-67-87-14-54-BA-3A-F2-2A-2A-B8-15-CE-D1-74-51-44-E5-FC\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Uri.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:26Z</ModuleTime>\n            <ModuleName>System.Private.Uri</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E6-CE-DF-D3-05-01-F5-61-41-53-0C-FF-2C-87-01-04-6E-EB-B1-C7\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.NameResolution.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:40Z</ModuleTime>\n            <ModuleName>System.Net.NameResolution</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"D5-0A-67-87-14-54-BA-3A-F2-2A-2A-B8-15-CE-D1-74-51-44-E5-FC\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Uri.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:26Z</ModuleTime>\n            <ModuleName>System.Private.Uri</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2F-EF-10-A4-03-CD-85-F5-B3-28-04-C0-CA-59-04-4C-AE-A8-5D-D0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Principal.Windows.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Principal.Windows</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"79-03-C9-B3-67-3A-61-F7-6D-B6-CE-72-A2-3F-68-B5-87-C1-4B-60\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Claims.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.Claims</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2F-EF-10-A4-03-CD-85-F5-B3-28-04-C0-CA-59-04-4C-AE-A8-5D-D0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Principal.Windows.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Principal.Windows</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"87-DE-C4-EB-AC-4B-76-40-4C-56-AB-F2-05-44-02-D8-77-58-26-00\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Principal.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Principal</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"79-03-C9-B3-67-3A-61-F7-6D-B6-CE-72-A2-3F-68-B5-87-C1-4B-60\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Claims.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.Claims</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"87-DE-C4-EB-AC-4B-76-40-4C-56-AB-F2-05-44-02-D8-77-58-26-00\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Principal.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Principal</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"96-C7-5C-FC-1E-89-3E-67-F0-53-6B-39-C4-C0-61-BC-52-35-9C-A0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Serialization.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Serialization.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2F-EF-10-A4-03-CD-85-F5-B3-28-04-C0-CA-59-04-4C-AE-A8-5D-D0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Principal.Windows.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Principal.Windows</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2F-EF-10-A4-03-CD-85-F5-B3-28-04-C0-CA-59-04-4C-AE-A8-5D-D0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Principal.Windows.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Principal.Windows</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"79-03-C9-B3-67-3A-61-F7-6D-B6-CE-72-A2-3F-68-B5-87-C1-4B-60\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Claims.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.Claims</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"79-03-C9-B3-67-3A-61-F7-6D-B6-CE-72-A2-3F-68-B5-87-C1-4B-60\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Claims.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.Claims</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"87-DE-C4-EB-AC-4B-76-40-4C-56-AB-F2-05-44-02-D8-77-58-26-00\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Principal.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Principal</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"87-DE-C4-EB-AC-4B-76-40-4C-56-AB-F2-05-44-02-D8-77-58-26-00\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Principal.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Principal</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"96-C7-5C-FC-1E-89-3E-67-F0-53-6B-39-C4-C0-61-BC-52-35-9C-A0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Serialization.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Serialization.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"15-E5-50-D1-2F-F4-E8-02-DA-D7-F8-1F-A5-31-2E-52-66-E1-F3-61\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Data.Common.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:06Z</ModuleTime>\n            <ModuleName>System.Data.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"42-A4-D5-63-DA-C9-6B-42-3E-CF-98-F9-FB-80-3B-23-4D-E8-7E-B3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:34Z</ModuleTime>\n            <ModuleName>System.ComponentModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"15-E5-50-D1-2F-F4-E8-02-DA-D7-F8-1F-A5-31-2E-52-66-E1-F3-61\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Data.Common.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:06Z</ModuleTime>\n            <ModuleName>System.Data.Common</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B5-88-C5-06-06-46-BA-FC-55-0E-7A-44-AC-31-CD-F3-5B-DF-AE-0B\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.ILGeneration.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.ILGeneration</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"42-A4-D5-63-DA-C9-6B-42-3E-CF-98-F9-FB-80-3B-23-4D-E8-7E-B3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:34Z</ModuleTime>\n            <ModuleName>System.ComponentModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"EA-A3-EB-09-A2-39-8F-0D-B1-13-BA-6D-11-3A-EC-93-44-39-5A-D3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.Lightweight.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.Lightweight</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C8-E8-31-5D-60-D0-B9-32-02-28-DE-17-96-8F-97-91-72-F8-BE-13\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Reflection.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"\">\n            <ModulePath>RefEmit_InMemoryManifestModule</ModulePath>\n            <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n            <ModuleName>Anonymously Hosted DynamicMethods Assembly</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B5-88-C5-06-06-46-BA-FC-55-0E-7A-44-AC-31-CD-F3-5B-DF-AE-0B\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.ILGeneration.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.ILGeneration</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"EA-A3-EB-09-A2-39-8F-0D-B1-13-BA-6D-11-3A-EC-93-44-39-5A-D3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.Lightweight.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.Lightweight</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C8-E8-31-5D-60-D0-B9-32-02-28-DE-17-96-8F-97-91-72-F8-BE-13\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Reflection.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"\">\n            <ModulePath>RefEmit_InMemoryManifestModule</ModulePath>\n            <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n            <ModuleName>Anonymously Hosted DynamicMethods Assembly</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5B-59-5A-55-C9-41-C5-0A-8E-0B-98-78-A8-43-45-E3-86-A3-5F-91\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Specialized.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Collections.Specialized</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"05-AF-58-DB-DA-32-BF-49-84-01-F1-55-D6-55-6F-40-94-52-FB-50\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Drawing.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:38Z</ModuleTime>\n            <ModuleName>System.Drawing.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5B-59-5A-55-C9-41-C5-0A-8E-0B-98-78-A8-43-45-E3-86-A3-5F-91\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Specialized.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n            <ModuleName>System.Collections.Specialized</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"05-AF-58-DB-DA-32-BF-49-84-01-F1-55-D6-55-6F-40-94-52-FB-50\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Drawing.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:38Z</ModuleTime>\n            <ModuleName>System.Drawing.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C1-41-1B-16-60-41-0D-35-CE-85-82-6D-04-AB-CE-5C-88-E8-BE-91\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:06Z</ModuleTime>\n            <ModuleName>System.IO</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"17-CC-E7-2C-B7-DA-57-06-96-2B-F7-01-5A-76-38-AA-26-92-87-6D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Dynamic.Runtime.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:38Z</ModuleTime>\n            <ModuleName>System.Dynamic.Runtime</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C1-41-1B-16-60-41-0D-35-CE-85-82-6D-04-AB-CE-5C-88-E8-BE-91\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:06Z</ModuleTime>\n            <ModuleName>System.IO</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"17-CC-E7-2C-B7-DA-57-06-96-2B-F7-01-5A-76-38-AA-26-92-87-6D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Dynamic.Runtime.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:38Z</ModuleTime>\n            <ModuleName>System.Dynamic.Runtime</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"6F-CC-2C-76-AC-42-0E-1D-29-DC-BE-AB-E0-6D-A4-C2-9D-0C-27-23\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Linq.Expressions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:18Z</ModuleTime>\n            <ModuleName>System.Linq.Expressions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-4C-1D-C3-E8-DB-38-EA-0D-64-CB-BD-58-BC-F2-B0-E2-99-42-93\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Reflection</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"70-58-B8-D8-D1-66-CB-C6-C4-F9-5F-80-03-7C-74-A2-D8-CA-6A-98\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Reflection.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"33-87-51-E6-2F-8C-BE-1D-5B-B2-9E-51-10-1B-05-40-2C-E3-E8-1A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Linq.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:40Z</ModuleTime>\n            <ModuleName>System.Linq</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"6F-CC-2C-76-AC-42-0E-1D-29-DC-BE-AB-E0-6D-A4-C2-9D-0C-27-23\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Linq.Expressions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:18Z</ModuleTime>\n            <ModuleName>System.Linq.Expressions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"22-BD-0E-BF-F3-50-23-F4-33-69-45-CA-85-5A-41-AA-FF-98-13-6A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ObjectModel.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.ObjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-4C-1D-C3-E8-DB-38-EA-0D-64-CB-BD-58-BC-F2-B0-E2-99-42-93\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Reflection</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"70-58-B8-D8-D1-66-CB-C6-C4-F9-5F-80-03-7C-74-A2-D8-CA-6A-98\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Reflection.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"33-87-51-E6-2F-8C-BE-1D-5B-B2-9E-51-10-1B-05-40-2C-E3-E8-1A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Linq.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:40Z</ModuleTime>\n            <ModuleName>System.Linq</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4B-5A-EC-05-10-C3-65-A3-7C-C5-D4-52-0E-41-A4-1F-73-88-F9-01\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.XDocument.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Xml.XDocument</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"68-1D-85-11-BD-EC-60-7F-F2-E8-83-FF-C6-D8-D9-CB-28-C8-8B-2A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Xml.Linq.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:30Z</ModuleTime>\n            <ModuleName>System.Private.Xml.Linq</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"22-BD-0E-BF-F3-50-23-F4-33-69-45-CA-85-5A-41-AA-FF-98-13-6A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ObjectModel.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.ObjectModel</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4B-5A-EC-05-10-C3-65-A3-7C-C5-D4-52-0E-41-A4-1F-73-88-F9-01\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.XDocument.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Xml.XDocument</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"68-1D-85-11-BD-EC-60-7F-F2-E8-83-FF-C6-D8-D9-CB-28-C8-8B-2A\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Xml.Linq.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:30Z</ModuleTime>\n            <ModuleName>System.Private.Xml.Linq</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"1F-BD-6F-06-01-11-FA-A9-DB-0B-12-95-1E-A0-B6-62-C2-59-ED-05\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Xml.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:38Z</ModuleTime>\n            <ModuleName>System.Private.Xml</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9D-C0-19-0D-B9-0B-71-00-FA-44-3E-7A-92-13-79-FB-D2-34-4F-3D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.RegularExpressions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Text.RegularExpressions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"1F-BD-6F-06-01-11-FA-A9-DB-0B-12-95-1E-A0-B6-62-C2-59-ED-05\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Xml.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:38Z</ModuleTime>\n            <ModuleName>System.Private.Xml</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9D-C0-19-0D-B9-0B-71-00-FA-44-3E-7A-92-13-79-FB-D2-34-4F-3D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.RegularExpressions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Text.RegularExpressions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B5-88-C5-06-06-46-BA-FC-55-0E-7A-44-AC-31-CD-F3-5B-DF-AE-0B\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.ILGeneration.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.ILGeneration</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"EA-A3-EB-09-A2-39-8F-0D-B1-13-BA-6D-11-3A-EC-93-44-39-5A-D3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.Lightweight.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.Lightweight</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C8-E8-31-5D-60-D0-B9-32-02-28-DE-17-96-8F-97-91-72-F8-BE-13\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Reflection.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"\">\n            <ModulePath>RefEmit_InMemoryManifestModule</ModulePath>\n            <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n            <ModuleName>Anonymously Hosted DynamicMethods Assembly</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"B5-88-C5-06-06-46-BA-FC-55-0E-7A-44-AC-31-CD-F3-5B-DF-AE-0B\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.ILGeneration.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.ILGeneration</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"EA-A3-EB-09-A2-39-8F-0D-B1-13-BA-6D-11-3A-EC-93-44-39-5A-D3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.Lightweight.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Emit.Lightweight</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C8-E8-31-5D-60-D0-B9-32-02-28-DE-17-96-8F-97-91-72-F8-BE-13\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n            <ModuleName>System.Reflection.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"\">\n            <ModulePath>RefEmit_InMemoryManifestModule</ModulePath>\n            <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n            <ModuleName>Anonymously Hosted DynamicMethods Assembly</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5E-EA-96-C3-0B-C7-BF-BA-AE-4A-27-D8-9A-9A-67-A2-72-BF-89-1F\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.NonGeneric.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:32Z</ModuleTime>\n            <ModuleName>System.Collections.NonGeneric</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"5E-EA-96-C3-0B-C7-BF-BA-AE-4A-27-D8-9A-9A-67-A2-72-BF-89-1F\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.NonGeneric.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:32Z</ModuleTime>\n            <ModuleName>System.Collections.NonGeneric</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A6-81-2A-5B-4A-3D-C8-4D-49-04-DE-1F-DF-02-7C-B4-43-51-DE-1C\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.FileSystem.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.IO.FileSystem</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A6-81-2A-5B-4A-3D-C8-4D-49-04-DE-1F-DF-02-7C-B4-43-51-DE-1C\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.FileSystem.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n            <ModuleName>System.IO.FileSystem</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"3D-ED-2E-29-0D-BD-86-B5-75-96-FF-B0-C8-9D-AD-4E-5B-94-58-57\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Loader.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Loader</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"3D-ED-2E-29-0D-BD-86-B5-75-96-FF-B0-C8-9D-AD-4E-5B-94-58-57\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Loader.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.Loader</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"59-B3-53-C6-DD-77-03-5F-2E-4E-9A-A7-81-4B-56-D8-AB-97-8F-66\">\n            <ModulePath>BranchCoverage3296\\SecondTestSuite\\bin\\Debug\\netcoreapp3.1\\NUnit3.TestAdapter.dll</ModulePath>\n            <ModuleTime>2019-08-30T10:05:18Z</ModuleTime>\n            <ModuleName>NUnit3.TestAdapter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"12-76-CC-1D-71-64-A5-ED-83-74-CD-75-86-B8-02-00-13-2D-7E-D2\">\n            <ModulePath>BranchCoverage3296\\SecondTestSuite\\bin\\Debug\\netcoreapp3.1\\nunit.engine.api.dll</ModulePath>\n            <ModuleTime>2019-03-24T14:23:48Z</ModuleTime>\n            <ModuleName>nunit.engine.api</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"59-B3-53-C6-DD-77-03-5F-2E-4E-9A-A7-81-4B-56-D8-AB-97-8F-66\">\n            <ModulePath>BranchCoverage3296\\FirstTestSuite\\bin\\Debug\\netcoreapp3.1\\NUnit3.TestAdapter.dll</ModulePath>\n            <ModuleTime>2019-08-30T10:05:18Z</ModuleTime>\n            <ModuleName>NUnit3.TestAdapter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"12-76-CC-1D-71-64-A5-ED-83-74-CD-75-86-B8-02-00-13-2D-7E-D2\">\n            <ModulePath>BranchCoverage3296\\FirstTestSuite\\bin\\Debug\\netcoreapp3.1\\nunit.engine.api.dll</ModulePath>\n            <ModuleTime>2019-03-24T14:23:48Z</ModuleTime>\n            <ModuleName>nunit.engine.api</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2F-E1-13-B8-1E-10-AE-79-4A-CD-F8-AE-C1-F1-E8-22-10-2F-61-17\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.ReaderWriter.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Xml.ReaderWriter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A3-6E-3F-5C-23-E9-CE-D4-59-A4-79-82-3A-A2-A6-D2-A6-37-0E-C2\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Thread.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.Thread</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-F9-21-BB-3C-07-A4-DA-5A-43-89-51-EB-E0-A4-B9-2F-19-F6-7D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.Algorithms.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Algorithms</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"2F-E1-13-B8-1E-10-AE-79-4A-CD-F8-AE-C1-F1-E8-22-10-2F-61-17\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.ReaderWriter.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n            <ModuleName>System.Xml.ReaderWriter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A3-6E-3F-5C-23-E9-CE-D4-59-A4-79-82-3A-A2-A6-D2-A6-37-0E-C2\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Thread.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.Thread</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"08-F9-21-BB-3C-07-A4-DA-5A-43-89-51-EB-E0-A4-B9-2F-19-F6-7D\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.Algorithms.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Algorithms</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"25-17-3D-BA-13-03-55-32-76-CF-3D-AE-B3-52-14-5F-95-F5-3E-85\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Timer.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.Timer</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"25-17-3D-BA-13-03-55-32-76-CF-3D-AE-B3-52-14-5F-95-F5-3E-85\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Timer.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n            <ModuleName>System.Threading.Timer</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"57-E8-B3-F8-DB-88-F2-FB-81-BE-34-C3-AD-1E-D4-F0-DD-F0-59-D3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Resources.ResourceManager.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Resources.ResourceManager</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"26-14-D7-B5-EB-43-C2-76-01-4F-01-5E-7B-A4-CE-E9-EB-E3-AA-B9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.InteropServices.RuntimeInformation.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices.RuntimeInformation</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C1-E6-95-46-6B-22-AB-AD-8C-29-08-C6-4F-A8-BC-C8-E3-D9-B3-83\">\n            <ModulePath>BranchCoverage3296\\SecondTestSuite\\bin\\Debug\\netcoreapp3.1\\NuGet.Frameworks.dll</ModulePath>\n            <ModuleTime>2019-04-01T16:23:50Z</ModuleTime>\n            <ModuleName>NuGet.Frameworks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"57-E8-B3-F8-DB-88-F2-FB-81-BE-34-C3-AD-1E-D4-F0-DD-F0-59-D3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Resources.ResourceManager.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Resources.ResourceManager</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"26-14-D7-B5-EB-43-C2-76-01-4F-01-5E-7B-A4-CE-E9-EB-E3-AA-B9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.InteropServices.RuntimeInformation.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n            <ModuleName>System.Runtime.InteropServices.RuntimeInformation</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"C1-E6-95-46-6B-22-AB-AD-8C-29-08-C6-4F-A8-BC-C8-E3-D9-B3-83\">\n            <ModulePath>BranchCoverage3296\\FirstTestSuite\\bin\\Debug\\netcoreapp3.1\\NuGet.Frameworks.dll</ModulePath>\n            <ModuleTime>2019-04-01T16:23:50Z</ModuleTime>\n            <ModuleName>NuGet.Frameworks</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F5-4A-B0-89-01-16-50-65-5F-DD-4C-B5-70-9E-39-1A-D1-B7-FE-38\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Metadata.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Metadata</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"01-AB-1F-C1-0A-AD-1A-D5-69-41-9D-4B-4E-1C-6F-AC-59-05-9A-48\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Immutable.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>System.Collections.Immutable</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F5-4A-B0-89-01-16-50-65-5F-DD-4C-B5-70-9E-39-1A-D1-B7-FE-38\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Metadata.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n            <ModuleName>System.Reflection.Metadata</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"01-AB-1F-C1-0A-AD-1A-D5-69-41-9D-4B-4E-1C-6F-AC-59-05-9A-48\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Immutable.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>System.Collections.Immutable</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E5-6F-E2-59-47-64-D2-E4-64-4E-96-55-60-F4-13-5C-EE-05-0B-BE\">\n            <ModulePath>BranchCoverage3296\\SecondTestSuite\\bin\\Debug\\netcoreapp3.1\\nunit.engine.dll</ModulePath>\n            <ModuleTime>2019-03-24T14:23:48Z</ModuleTime>\n            <ModuleName>nunit.engine</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4E-96-5A-FC-C0-BE-6F-D4-A5-9C-B4-F8-33-D5-85-D1-B9-07-9F-89\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Encoding.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Text.Encoding.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"E5-6F-E2-59-47-64-D2-E4-64-4E-96-55-60-F4-13-5C-EE-05-0B-BE\">\n            <ModulePath>BranchCoverage3296\\FirstTestSuite\\bin\\Debug\\netcoreapp3.1\\nunit.engine.dll</ModulePath>\n            <ModuleTime>2019-03-24T14:23:48Z</ModuleTime>\n            <ModuleName>nunit.engine</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"4E-96-5A-FC-C0-BE-6F-D4-A5-9C-B4-F8-33-D5-85-D1-B9-07-9F-89\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Encoding.Extensions.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Text.Encoding.Extensions</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"CE-43-2B-40-C0-FF-2C-68-D3-CF-AF-49-07-37-DC-D7-AA-AB-17-F3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Buffers.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:26Z</ModuleTime>\n            <ModuleName>System.Buffers</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"CE-43-2B-40-C0-FF-2C-68-D3-CF-AF-49-07-37-DC-D7-AA-AB-17-F3\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Buffers.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:26Z</ModuleTime>\n            <ModuleName>System.Buffers</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"\">\n            <ModulePath>Mono.Cecil.dll</ModulePath>\n            <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n            <ModuleName>Mono.Cecil</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"31-48-4C-D9-B7-64-1C-85-5D-80-A0-AB-74-1E-29-E1-94-43-80-C0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.FileSystem.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:42Z</ModuleTime>\n            <ModuleName>System.IO.FileSystem.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"\">\n            <ModulePath>Mono.Cecil.dll</ModulePath>\n            <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n            <ModuleName>Mono.Cecil</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"31-48-4C-D9-B7-64-1C-85-5D-80-A0-AB-74-1E-29-E1-94-43-80-C0\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.FileSystem.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:42Z</ModuleTime>\n            <ModuleName>System.IO.FileSystem.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A5-1D-73-D2-8D-F6-70-B7-B7-8B-00-F4-17-70-7F-2A-98-D3-1C-F9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Encoding.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Text.Encoding</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"A5-1D-73-D2-8D-F6-70-B7-B7-8B-00-F4-17-70-7F-2A-98-D3-1C-F9\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Encoding.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n            <ModuleName>System.Text.Encoding</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"F5-DF-92-D4-E4-7D-E2-6F-35-36-11-65-C3-69-FF-1A-0F-BE-4E-52\">\n            <ModulePath>BranchCoverage3296\\SecondTestSuite\\bin\\Debug\\netcoreapp3.1\\SecondTestSuite.dll</ModulePath>\n            <ModuleTime>2020-04-27T06:25:40.5318924Z</ModuleTime>\n            <ModuleName>SecondTestSuite</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"9A-F7-44-9B-43-8F-1E-71-60-7A-04-D2-A8-AB-10-07-80-3D-DF-79\">\n            <ModulePath>BranchCoverage3296\\FirstTestSuite\\bin\\Debug\\netcoreapp3.1\\FirstTestSuite.dll</ModulePath>\n            <ModuleTime>2020-04-27T06:25:40.5318924Z</ModuleTime>\n            <ModuleName>FirstTestSuite</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"16-2A-6A-6B-DF-CD-D6-7C-53-72-D1-C2-AE-69-5C-68-F9-E9-F2-2D\">\n            <ModulePath>BranchCoverage3296\\SecondTestSuite\\bin\\Debug\\netcoreapp3.1\\nunit.framework.dll</ModulePath>\n            <ModuleTime>2019-05-14T20:37:24Z</ModuleTime>\n            <ModuleName>nunit.framework</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"16-2A-6A-6B-DF-CD-D6-7C-53-72-D1-C2-AE-69-5C-68-F9-E9-F2-2D\">\n            <ModulePath>BranchCoverage3296\\FirstTestSuite\\bin\\Debug\\netcoreapp3.1\\nunit.framework.dll</ModulePath>\n            <ModuleTime>2019-05-14T20:37:24Z</ModuleTime>\n            <ModuleName>nunit.framework</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"32-5D-5E-82-60-49-7F-5D-44-D4-1E-BF-57-95-6F-D8-30-A6-C2-E1\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Console.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n            <ModuleName>System.Console</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"32-5D-5E-82-60-49-7F-5D-44-D4-1E-BF-57-95-6F-D8-30-A6-C2-E1\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Console.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n            <ModuleName>System.Console</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8F-A1-95-7C-65-A0-95-11-53-8D-DF-11-6D-3C-AD-5D-AE-2F-D3-73\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Concurrent.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>System.Collections.Concurrent</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"8F-A1-95-7C-65-A0-95-11-53-8D-DF-11-6D-3C-AD-5D-AE-2F-D3-73\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Concurrent.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n            <ModuleName>System.Collections.Concurrent</ModuleName>\n            <Classes />\n        </Module>\n        <Module hash=\"8F-EE-CD-E3-B7-04-08-DD-B6-60-C3-50-BE-5C-7C-A3-37-F2-B9-BA\">\n            <Summary numSequencePoints=\"1\" visitedSequencePoints=\"1\" numBranchPoints=\"3\" visitedBranchPoints=\"2\" sequenceCoverage=\"100\" branchCoverage=\"66.67\" maxCyclomaticComplexity=\"3\" minCyclomaticComplexity=\"1\" maxCrapScore=\"3\" minCrapScore=\"2\" visitedClasses=\"1\" numClasses=\"1\" visitedMethods=\"1\" numMethods=\"1\" />\n            <ModulePath>BranchCoverage3296\\FirstTestSuite\\bin\\Debug\\netcoreapp3.1\\Code.dll</ModulePath>\n            <ModuleTime>2020-04-27T06:25:39.7448903Z</ModuleTime>\n            <ModuleName>Code</ModuleName>\n            <Files>\n                <File uid=\"2\" fullPath=\"BranchCoverage3296\\Code\\ValueProvider.cs\" />\n            </Files>\n            <Classes>\n                <Class>\n                    <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"0\" minCyclomaticComplexity=\"0\" maxCrapScore=\"0\" minCrapScore=\"0\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"0\" />\n                    <FullName>&lt;Module&gt;</FullName>\n                    <Methods />\n                </Class>\n                <Class>\n                    <Summary numSequencePoints=\"1\" visitedSequencePoints=\"1\" numBranchPoints=\"3\" visitedBranchPoints=\"2\" sequenceCoverage=\"100\" branchCoverage=\"66.67\" maxCyclomaticComplexity=\"3\" minCyclomaticComplexity=\"1\" maxCrapScore=\"3\" minCrapScore=\"2\" visitedClasses=\"1\" numClasses=\"1\" visitedMethods=\"1\" numMethods=\"1\" />\n                    <FullName>Code.ValueProvider</FullName>\n                    <Methods>\n                        <Method visited=\"true\" cyclomaticComplexity=\"3\" nPathComplexity=\"2\" sequenceCoverage=\"100\" branchCoverage=\"66.67\" crapScore=\"3\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n                            <Summary numSequencePoints=\"1\" visitedSequencePoints=\"1\" numBranchPoints=\"3\" visitedBranchPoints=\"2\" sequenceCoverage=\"100\" branchCoverage=\"66.67\" maxCyclomaticComplexity=\"3\" minCyclomaticComplexity=\"3\" maxCrapScore=\"3\" minCrapScore=\"3\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"1\" numMethods=\"1\" />\n                            <MetadataToken>100663297</MetadataToken>\n                            <Name>System.Int32 Code.ValueProvider::GetValue(System.Boolean)</Name>\n                            <FileRef uid=\"2\" />\n                            <SequencePoints>\n                                <SequencePoint vc=\"1\" uspid=\"1\" ordinal=\"0\" offset=\"0\" sl=\"5\" sc=\"48\" el=\"7\" ec=\"16\" bec=\"2\" bev=\"1\" fileid=\"2\" />\n                            </SequencePoints>\n                            <BranchPoints>\n                                <BranchPoint vc=\"1\" uspid=\"3\" ordinal=\"0\" offset=\"1\" sl=\"5\" path=\"0\" offsetend=\"3\" fileid=\"3\" />\n                                <BranchPoint vc=\"0\" uspid=\"5\" ordinal=\"1\" offset=\"1\" sl=\"5\" path=\"1\" offsetend=\"6\" fileid=\"4\" />\n                            </BranchPoints>\n                            <MethodPoint xsi:type=\"SequencePoint\" vc=\"1\" uspid=\"1\" ordinal=\"0\" offset=\"0\" sl=\"5\" sc=\"48\" el=\"7\" ec=\"16\" bec=\"2\" bev=\"1\" fileid=\"2\" />\n                        </Method>\n                        <Method visited=\"false\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" crapScore=\"2\" isConstructor=\"true\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n                            <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"2\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"0\" />\n                            <MetadataToken>100663298</MetadataToken>\n                            <Name>System.Void Code.ValueProvider::.ctor()</Name>\n                            <SequencePoints />\n                            <BranchPoints />\n                            <MethodPoint vc=\"0\" uspid=\"7\" ordinal=\"0\" offset=\"0\" />\n                        </Method>\n                    </Methods>\n                </Class>\n            </Classes>\n        </Module>\n        <Module hash=\"8F-EE-CD-E3-B7-04-08-DD-B6-60-C3-50-BE-5C-7C-A3-37-F2-B9-BA\">\n            <Summary numSequencePoints=\"1\" visitedSequencePoints=\"1\" numBranchPoints=\"3\" visitedBranchPoints=\"2\" sequenceCoverage=\"100\" branchCoverage=\"66.67\" maxCyclomaticComplexity=\"3\" minCyclomaticComplexity=\"1\" maxCrapScore=\"3\" minCrapScore=\"2\" visitedClasses=\"1\" numClasses=\"1\" visitedMethods=\"1\" numMethods=\"1\" />\n            <ModulePath>BranchCoverage3296\\SecondTestSuite\\bin\\Debug\\netcoreapp3.1\\Code.dll</ModulePath>\n            <ModuleTime>2020-04-27T06:25:39.7448903Z</ModuleTime>\n            <ModuleName>Code</ModuleName>\n            <Files>\n                <File uid=\"1\" fullPath=\"BranchCoverage3296\\Code\\ValueProvider.cs\" />\n            </Files>\n            <Classes>\n                <Class>\n                    <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"0\" minCyclomaticComplexity=\"0\" maxCrapScore=\"0\" minCrapScore=\"0\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"0\" />\n                    <FullName>&lt;Module&gt;</FullName>\n                    <Methods />\n                </Class>\n                <Class>\n                    <Summary numSequencePoints=\"1\" visitedSequencePoints=\"1\" numBranchPoints=\"3\" visitedBranchPoints=\"2\" sequenceCoverage=\"100\" branchCoverage=\"66.67\" maxCyclomaticComplexity=\"3\" minCyclomaticComplexity=\"1\" maxCrapScore=\"3\" minCrapScore=\"2\" visitedClasses=\"1\" numClasses=\"1\" visitedMethods=\"1\" numMethods=\"1\" />\n                    <FullName>Code.ValueProvider</FullName>\n                    <Methods>\n                        <Method visited=\"true\" cyclomaticComplexity=\"3\" nPathComplexity=\"2\" sequenceCoverage=\"100\" branchCoverage=\"66.67\" crapScore=\"3\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n                            <Summary numSequencePoints=\"1\" visitedSequencePoints=\"1\" numBranchPoints=\"3\" visitedBranchPoints=\"2\" sequenceCoverage=\"100\" branchCoverage=\"66.67\" maxCyclomaticComplexity=\"3\" minCyclomaticComplexity=\"3\" maxCrapScore=\"3\" minCrapScore=\"3\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"1\" numMethods=\"1\" />\n                            <MetadataToken>100663297</MetadataToken>\n                            <Name>System.Int32 Code.ValueProvider::GetValue(System.Boolean)</Name>\n                            <FileRef uid=\"1\" />\n                            <SequencePoints>\n                                <SequencePoint vc=\"1\" uspid=\"2\" ordinal=\"0\" offset=\"0\" sl=\"5\" sc=\"48\" el=\"7\" ec=\"16\" bec=\"2\" bev=\"1\" fileid=\"1\" />\n                            </SequencePoints>\n                            <BranchPoints>\n                                <BranchPoint vc=\"0\" uspid=\"4\" ordinal=\"0\" offset=\"1\" sl=\"5\" path=\"0\" offsetend=\"3\" fileid=\"3\" />\n                                <BranchPoint vc=\"1\" uspid=\"6\" ordinal=\"1\" offset=\"1\" sl=\"5\" path=\"1\" offsetend=\"6\" fileid=\"3\" />\n                            </BranchPoints>\n                            <MethodPoint xsi:type=\"SequencePoint\" vc=\"1\" uspid=\"2\" ordinal=\"0\" offset=\"0\" sl=\"5\" sc=\"48\" el=\"7\" ec=\"16\" bec=\"2\" bev=\"1\" fileid=\"1\" />\n                        </Method>\n                        <Method visited=\"false\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" crapScore=\"2\" isConstructor=\"true\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n                            <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"2\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"0\" />\n                            <MetadataToken>100663298</MetadataToken>\n                            <Name>System.Void Code.ValueProvider::.ctor()</Name>\n                            <SequencePoints />\n                            <BranchPoints />\n                            <MethodPoint vc=\"0\" uspid=\"8\" ordinal=\"0\" offset=\"0\" />\n                        </Method>\n                    </Methods>\n                </Class>\n            </Classes>\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"6D-0F-A0-D8-6E-D9-3D-12-46-84-DE-CC-44-CE-CF-2B-96-27-29-EA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.TypeConverter.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:32Z</ModuleTime>\n            <ModuleName>System.ComponentModel.TypeConverter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"6D-0F-A0-D8-6E-D9-3D-12-46-84-DE-CC-44-CE-CF-2B-96-27-29-EA\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.TypeConverter.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:05:32Z</ModuleTime>\n            <ModuleName>System.ComponentModel.TypeConverter</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"55-8E-C2-A5-09-4D-3F-8C-11-59-AB-41-D5-05-B5-7B-8D-3A-AA-6E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Primitives</ModuleName>\n            <Classes />\n        </Module>\n        <Module skippedDueTo=\"Filter\" hash=\"55-8E-C2-A5-09-4D-3F-8C-11-59-AB-41-D5-05-B5-7B-8D-3A-AA-6E\">\n            <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.Primitives.dll</ModulePath>\n            <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n            <ModuleName>System.Security.Cryptography.Primitives</ModuleName>\n            <Classes />\n        </Module>\n    </Modules>\n</CoverageSession>"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/opencover/invalid_path.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<CoverageSession xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n  <Summary numSequencePoints=\"28\" visitedSequencePoints=\"20\" numBranchPoints=\"12\" visitedBranchPoints=\"8\" sequenceCoverage=\"71.43\" branchCoverage=\"66.67\" maxCyclomaticComplexity=\"4\" minCyclomaticComplexity=\"1\" />\n  <Modules>\n    <Module skippedDueTo=\"Filter\" hash=\"54-D4-51-C6-FF-08-C9-23-DD-60-29-FB-72-FC-DE-35-B4-41-DA-06\">\n      <FullName>C:\\Windows\\assembly\\GAC_64\\mscorlib\\2.0.0.0__b77a5c561934e089\\mscorlib.dll</FullName>\n      <ModuleName>mscorlib</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"F9-04-A8-31-CD-FB-23-72-95-63-5D-14-9A-A0-66-8E-7F-44-93-7A\">\n      <FullName>C:\\Windows\\assembly\\GAC_64\\mscorlib\\2.0.0.0__b77a5c561934e089\\sorttbls.nlp</FullName>\n      <ModuleName>mscorlib</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"6E-30-2E-50-36-FB-60-2C-8E-50-C0-83-54-8B-CC-EA-A8-91-B6-CC\">\n      <FullName>C:\\Windows\\assembly\\GAC_64\\mscorlib\\2.0.0.0__b77a5c561934e089\\sortkey.nlp</FullName>\n      <ModuleName>mscorlib</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"F9-CA-B6-79-63-CB-31-8A-0D-DC-C3-D0-43-F8-28-C3-F0-95-F9-E7\">\n      <FullName>c:\\Program Files (x86)\\NUnit 2.6.3\\bin\\nunit-console.exe</FullName>\n      <ModuleName>nunit-console</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"2A-C4-E5-DE-F3-EE-AD-84-E1-65-84-CC-15-90-76-96-E7-01-44-4E\">\n      <FullName>C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\lib\\nunit-console-runner.dll</FullName>\n      <ModuleName>nunit-console-runner</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"33-E1-CA-24-52-5A-B7-C7-C4-AF-91-2C-A9-4A-C0-37-67-0D-5B-FE\">\n      <FullName>C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\lib\\nunit.core.dll</FullName>\n      <ModuleName>nunit.core</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"74-74-F6-87-59-E1-5F-4F-5F-5E-6E-82-50-E8-E2-46-D4-86-15-76\">\n      <FullName>C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\lib\\nunit.util.dll</FullName>\n      <ModuleName>nunit.util</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"D3-A4-4D-85-55-F7-CE-EF-A5-90-AA-EF-58-E0-9F-B6-CC-27-99-53\">\n      <FullName>C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\lib\\nunit.core.interfaces.dll</FullName>\n      <ModuleName>nunit.core.interfaces</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"2C-99-EE-29-D5-25-03-C4-0E-40-26-9B-F7-DF-C2-68-6E-74-74-31\">\n      <FullName>C:\\Windows\\assembly\\GAC_MSIL\\System.Configuration\\2.0.0.0__b03f5f7f11d50a3a\\System.Configuration.dll</FullName>\n      <ModuleName>System.Configuration</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"D3-99-70-9D-4C-FD-70-CC-82-00-AA-75-7A-54-8C-25-AC-54-B1-BF\">\n      <FullName>C:\\Windows\\assembly\\GAC_MSIL\\System\\2.0.0.0__b77a5c561934e089\\System.dll</FullName>\n      <ModuleName>System</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"C4-AD-0A-97-FF-1D-61-5F-88-89-A6-25-BD-02-5E-E5-F5-1D-6F-20\">\n      <FullName>C:\\Windows\\assembly\\GAC_MSIL\\System.Xml\\2.0.0.0__b77a5c561934e089\\System.Xml.dll</FullName>\n      <ModuleName>System.Xml</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"92-44-10-37-4C-84-2D-65-E3-A0-6A-B9-9F-01-42-6A-27-41-4A-8C\">\n      <FullName>C:\\Windows\\assembly\\GAC_MSIL\\System.Runtime.Remoting\\2.0.0.0__b77a5c561934e089\\System.Runtime.Remoting.dll</FullName>\n      <ModuleName>System.Runtime.Remoting</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"E1-6B-09-74-39-13-D1-98-9B-D2-7B-04-C8-8F-57-18-D7-9F-22-BA\">\n      <FullName>C:\\Windows\\Microsoft.Net\\assembly\\GAC_64\\mscorlib\\v4.0_4.0.0.0__b77a5c561934e089\\mscorlib.dll</FullName>\n      <ModuleName>mscorlib</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"87-52-C5-B2-2F-D3-F5-4F-58-BF-89-4A-88-59-6D-CE-F4-7F-6A-3B\">\n      <FullName>C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\nunit-agent.exe</FullName>\n      <ModuleName>nunit-agent</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"33-E1-CA-24-52-5A-B7-C7-C4-AF-91-2C-A9-4A-C0-37-67-0D-5B-FE\">\n      <FullName>C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\lib\\nunit.core.dll</FullName>\n      <ModuleName>nunit.core</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"74-74-F6-87-59-E1-5F-4F-5F-5E-6E-82-50-E8-E2-46-D4-86-15-76\">\n      <FullName>C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\lib\\nunit.util.dll</FullName>\n      <ModuleName>nunit.util</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"D3-A4-4D-85-55-F7-CE-EF-A5-90-AA-EF-58-E0-9F-B6-CC-27-99-53\">\n      <FullName>C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\lib\\nunit.core.interfaces.dll</FullName>\n      <ModuleName>nunit.core.interfaces</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"1B-30-81-91-69-2E-50-BD-B9-CC-A1-5B-46-3A-D5-62-E3-7E-58-C4\">\n      <FullName>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System\\v4.0_4.0.0.0__b77a5c561934e089\\System.dll</FullName>\n      <ModuleName>System</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"E8-47-7A-41-67-F7-5A-91-1D-B2-1A-48-85-F5-81-AF-DE-91-B4-C2\">\n      <FullName>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Runtime.Remoting\\v4.0_4.0.0.0__b77a5c561934e089\\System.Runtime.Remoting.dll</FullName>\n      <ModuleName>System.Runtime.Remoting</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"57-C7-F0-53-3B-97-01-CD-67-C1-80-37-68-7F-8F-89-D0-76-B4-48\">\n      <FullName>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Configuration\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Configuration.dll</FullName>\n      <ModuleName>System.Configuration</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"88-AF-AF-B3-FF-8A-DE-A7-50-A8-49-A8-87-FF-70-25-57-19-89-27\">\n      <FullName>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Xml\\v4.0_4.0.0.0__b77a5c561934e089\\System.Xml.dll</FullName>\n      <ModuleName>System.Xml</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"37-B7-01-DE-3F-2D-BD-A2-E5-87-BA-4F-BE-B4-83-E0-93-20-AD-5A\">\n      <FullName>C:\\Windows\\Microsoft.Net\\assembly\\GAC_64\\System.Web\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Web.dll</FullName>\n      <ModuleName>System.Web</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"F6-A6-9F-51-A3-09-AC-3A-FF-DB-AE-4D-25-AE-9C-74-61-4E-0C-75\">\n      <FullName>C:\\Windows\\assembly\\GAC_64\\System.Web\\2.0.0.0__b03f5f7f11d50a3a\\System.Web.dll</FullName>\n      <ModuleName>System.Web</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"33-E1-CA-24-52-5A-B7-C7-C4-AF-91-2C-A9-4A-C0-37-67-0D-5B-FE\">\n      <FullName>C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\lib\\nunit.core.dll</FullName>\n      <ModuleName>nunit.core</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"1B-30-81-91-69-2E-50-BD-B9-CC-A1-5B-46-3A-D5-62-E3-7E-58-C4\">\n      <FullName>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System\\v4.0_4.0.0.0__b77a5c561934e089\\System.dll</FullName>\n      <ModuleName>System</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"88-AF-AF-B3-FF-8A-DE-A7-50-A8-49-A8-87-FF-70-25-57-19-89-27\">\n      <FullName>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Xml\\v4.0_4.0.0.0__b77a5c561934e089\\System.Xml.dll</FullName>\n      <ModuleName>System.Xml</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"57-C7-F0-53-3B-97-01-CD-67-C1-80-37-68-7F-8F-89-D0-76-B4-48\">\n      <FullName>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Configuration\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Configuration.dll</FullName>\n      <ModuleName>System.Configuration</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"D3-A4-4D-85-55-F7-CE-EF-A5-90-AA-EF-58-E0-9F-B6-CC-27-99-53\">\n      <FullName>C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\lib\\nunit.core.interfaces.dll</FullName>\n      <ModuleName>nunit.core.interfaces</ModuleName>\n      <Classes />\n    </Module>\n    <Module hash=\"DE-2D-20-DB-C7-7A-F5-8E-3C-33-9B-1D-83-2A-1E-48-F8-A8-EB-7B\">\n      <Summary numSequencePoints=\"6\" visitedSequencePoints=\"6\" numBranchPoints=\"2\" visitedBranchPoints=\"2\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n      <FullName>C:\\Users\\Dinesh\\Documents\\Visual Studio 2010\\Projects\\CSharpPlayground\\MyLibraryNUnitTest\\bin\\Debug\\MyLibraryNUnitTest.dll</FullName>\n      <ModuleName>MyLibraryNUnitTest</ModuleName>\n      <Files>\n        <File uid=\"1\" fullPath=\"z:\\*&quot;?.cs\" />\n      </Files>\n      <Classes>\n        <Class>\n          <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"0\" minCyclomaticComplexity=\"0\" />\n          <FullName>&lt;Module&gt;</FullName>\n          <Methods />\n        </Class>\n        <Class>\n          <Summary numSequencePoints=\"6\" visitedSequencePoints=\"6\" numBranchPoints=\"2\" visitedBranchPoints=\"2\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n          <FullName>MyLibraryNUnitTest.AdderNUnitTest</FullName>\n          <Methods>\n            <Method visited=\"true\" cyclomaticComplexity=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"3\" visitedSequencePoints=\"3\" numBranchPoints=\"1\" visitedBranchPoints=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n              <MetadataToken>100663297</MetadataToken>\n              <Name>System.Void MyLibraryNUnitTest.AdderNUnitTest::Add()</Name>\n              <FileRef uid=\"1\" />\n              <SequencePoints>\n                <SequencePoint vc=\"1\" uspid=\"1\" ordinal=\"0\" offset=\"0\" sl=\"16\" sc=\"9\" el=\"16\" ec=\"10\" />\n                <SequencePoint vc=\"1\" uspid=\"2\" ordinal=\"1\" offset=\"1\" sl=\"17\" sc=\"13\" el=\"17\" ec=\"51\" />\n                <SequencePoint vc=\"1\" uspid=\"3\" ordinal=\"2\" offset=\"17\" sl=\"18\" sc=\"9\" el=\"18\" ec=\"10\" />\n              </SequencePoints>\n              <BranchPoints />\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"1\" uspid=\"1\" ordinal=\"0\" offset=\"0\" sl=\"16\" sc=\"9\" el=\"16\" ec=\"10\" />\n            </Method>\n            <Method visited=\"true\" cyclomaticComplexity=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"3\" visitedSequencePoints=\"3\" numBranchPoints=\"1\" visitedBranchPoints=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n              <MetadataToken>100663298</MetadataToken>\n              <Name>System.Void MyLibraryNUnitTest.AdderNUnitTest::Add2()</Name>\n              <FileRef uid=\"1\" />\n              <SequencePoints>\n                <SequencePoint vc=\"1\" uspid=\"4\" ordinal=\"0\" offset=\"0\" sl=\"22\" sc=\"9\" el=\"22\" ec=\"10\" />\n                <SequencePoint vc=\"1\" uspid=\"5\" ordinal=\"1\" offset=\"1\" sl=\"23\" sc=\"13\" el=\"23\" ec=\"51\" />\n                <SequencePoint vc=\"1\" uspid=\"6\" ordinal=\"2\" offset=\"17\" sl=\"24\" sc=\"9\" el=\"24\" ec=\"10\" />\n              </SequencePoints>\n              <BranchPoints />\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"1\" uspid=\"4\" ordinal=\"0\" offset=\"0\" sl=\"22\" sc=\"9\" el=\"22\" ec=\"10\" />\n            </Method>\n            <Method visited=\"true\" cyclomaticComplexity=\"1\" sequenceCoverage=\"0\" branchCoverage=\"0\" isConstructor=\"true\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n              <MetadataToken>100663299</MetadataToken>\n              <Name>System.Void MyLibraryNUnitTest.AdderNUnitTest::.ctor()</Name>\n              <SequencePoints />\n              <BranchPoints />\n              <MethodPoint vc=\"1\" uspid=\"7\" ordinal=\"0\" offset=\"0\" />\n            </Method>\n          </Methods>\n        </Class>\n      </Classes>\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"42-83-FE-A6-9F-01-8E-2C-E8-41-E9-25-3E-1E-0D-99-81-76-6B-C9\">\n      <FullName>C:\\Users\\Dinesh\\Documents\\Visual Studio 2010\\Projects\\CSharpPlayground\\MyLibraryNUnitTest\\bin\\Debug\\nunit.framework.dll</FullName>\n      <ModuleName>nunit.framework</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"2A-C4-E5-DE-F3-EE-AD-84-E1-65-84-CC-15-90-76-96-E7-01-44-4E\">\n      <FullName>C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\lib\\nunit-console-runner.dll</FullName>\n      <ModuleName>nunit-console-runner</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"E8-47-7A-41-67-F7-5A-91-1D-B2-1A-48-85-F5-81-AF-DE-91-B4-C2\">\n      <FullName>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Runtime.Remoting\\v4.0_4.0.0.0__b77a5c561934e089\\System.Runtime.Remoting.dll</FullName>\n      <ModuleName>System.Runtime.Remoting</ModuleName>\n      <Classes />\n    </Module>\n    <Module hash=\"B1-CF-91-59-2E-7C-F5-48-46-09-DF-45-D3-08-55-46-D8-A2-AD-BE\">\n      <Summary numSequencePoints=\"22\" visitedSequencePoints=\"14\" numBranchPoints=\"10\" visitedBranchPoints=\"6\" sequenceCoverage=\"63.64\" branchCoverage=\"60\" maxCyclomaticComplexity=\"4\" minCyclomaticComplexity=\"1\" />\n      <FullName>C:\\Users\\Dinesh\\Documents\\Visual Studio 2010\\Projects\\CSharpPlayground\\MyLibraryNUnitTest\\bin\\Debug\\MyLibrary.dll</FullName>\n      <ModuleName>MyLibrary</ModuleName>\n      <Files>\n        <File uid=\"3\" fullPath=\"MyLibrary\\Adder.cs\" />\n        <File uid=\"4\" fullPath=\"MyLibrary\\Multiplier.cs\" />\n      </Files>\n      <Classes>\n        <Class>\n          <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"0\" minCyclomaticComplexity=\"0\" />\n          <FullName>&lt;Module&gt;</FullName>\n          <Methods />\n        </Class>\n        <Class>\n          <Summary numSequencePoints=\"19\" visitedSequencePoints=\"14\" numBranchPoints=\"9\" visitedBranchPoints=\"6\" sequenceCoverage=\"73.68\" branchCoverage=\"66.67\" maxCyclomaticComplexity=\"4\" minCyclomaticComplexity=\"1\" />\n          <FullName>MyLibrary.Adder</FullName>\n          <Methods>\n            <Method visited=\"true\" cyclomaticComplexity=\"4\" sequenceCoverage=\"61.54\" branchCoverage=\"57.14\" isConstructor=\"false\" isStatic=\"true\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"13\" visitedSequencePoints=\"8\" numBranchPoints=\"7\" visitedBranchPoints=\"4\" sequenceCoverage=\"61.54\" branchCoverage=\"57.14\" maxCyclomaticComplexity=\"4\" minCyclomaticComplexity=\"4\" />\n              <MetadataToken>100663297</MetadataToken>\n              <Name>System.Int32 MyLibrary.Adder::Add(System.Int32,System.Int32)</Name>\n              <FileRef uid=\"3\" />\n              <SequencePoints>\n                <SequencePoint vc=\"2\" uspid=\"8\" ordinal=\"0\" offset=\"0\" sl=\"11\" sc=\"9\" el=\"11\" ec=\"10\" />\n                <SequencePoint vc=\"2\" uspid=\"9\" ordinal=\"1\" offset=\"1\" sl=\"12\" sc=\"13\" el=\"12\" ec=\"36\" />\n                <SequencePoint vc=\"0\" uspid=\"10\" ordinal=\"2\" offset=\"23\" sl=\"13\" sc=\"13\" el=\"13\" ec=\"14\" />\n                <SequencePoint vc=\"0\" uspid=\"11\" ordinal=\"3\" offset=\"24\" sl=\"14\" sc=\"17\" el=\"14\" ec=\"52\" />\n                <SequencePoint vc=\"0\" uspid=\"12\" ordinal=\"4\" offset=\"35\" sl=\"15\" sc=\"17\" el=\"15\" ec=\"52\" />\n                <SequencePoint vc=\"0\" uspid=\"13\" ordinal=\"5\" offset=\"46\" sl=\"18\" sc=\"13\" el=\"18\" ec=\"14\" />\n                <SequencePoint vc=\"2\" uspid=\"14\" ordinal=\"6\" offset=\"49\" sl=\"18\" sc=\"20\" el=\"18\" ec=\"50\" />\n                <SequencePoint vc=\"2\" uspid=\"15\" ordinal=\"7\" offset=\"60\" sl=\"22\" sc=\"13\" el=\"22\" ec=\"47\" />\n                <SequencePoint vc=\"2\" uspid=\"16\" ordinal=\"8\" offset=\"71\" sl=\"22\" sc=\"48\" el=\"22\" ec=\"60\" />\n                <SequencePoint vc=\"2\" uspid=\"17\" ordinal=\"9\" offset=\"83\" sl=\"22\" sc=\"61\" el=\"22\" ec=\"90\" />\n                <SequencePoint vc=\"0\" uspid=\"18\" ordinal=\"10\" offset=\"96\" sl=\"22\" sc=\"96\" el=\"22\" ec=\"129\" />\n                <SequencePoint vc=\"2\" uspid=\"19\" ordinal=\"11\" offset=\"107\" sl=\"26\" sc=\"13\" el=\"26\" ec=\"30\" />\n                <SequencePoint vc=\"2\" uspid=\"20\" ordinal=\"12\" offset=\"113\" sl=\"27\" sc=\"9\" el=\"27\" ec=\"10\" />\n              </SequencePoints>\n              <BranchPoints>\n                <BranchPoint vc=\"2\" uspid=\"21\" ordinal=\"0\" offset=\"6\" path=\"0\" />\n                <BranchPoint vc=\"0\" uspid=\"22\" ordinal=\"1\" offset=\"6\" path=\"1\" />\n                <BranchPoint vc=\"0\" uspid=\"23\" ordinal=\"2\" offset=\"21\" path=\"0\" />\n                <BranchPoint vc=\"2\" uspid=\"24\" ordinal=\"3\" offset=\"21\" path=\"1\" />\n                <BranchPoint vc=\"2\" uspid=\"25\" ordinal=\"4\" offset=\"81\" path=\"0\" />\n                <BranchPoint vc=\"0\" uspid=\"26\" ordinal=\"5\" offset=\"81\" path=\"1\" />\n              </BranchPoints>\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"2\" uspid=\"8\" ordinal=\"0\" offset=\"0\" sl=\"11\" sc=\"9\" el=\"11\" ec=\"10\" />\n            </Method>\n            <Method visited=\"true\" cyclomaticComplexity=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" isConstructor=\"false\" isStatic=\"true\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"3\" visitedSequencePoints=\"3\" numBranchPoints=\"1\" visitedBranchPoints=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n              <MetadataToken>100663298</MetadataToken>\n              <Name>System.Boolean MyLibrary.Adder::Test1()</Name>\n              <FileRef uid=\"3\" />\n              <SequencePoints>\n                <SequencePoint vc=\"4\" uspid=\"27\" ordinal=\"0\" offset=\"0\" sl=\"30\" sc=\"9\" el=\"30\" ec=\"10\" />\n                <SequencePoint vc=\"4\" uspid=\"28\" ordinal=\"1\" offset=\"1\" sl=\"31\" sc=\"13\" el=\"31\" ec=\"25\" />\n                <SequencePoint vc=\"4\" uspid=\"29\" ordinal=\"2\" offset=\"5\" sl=\"32\" sc=\"9\" el=\"32\" ec=\"10\" />\n              </SequencePoints>\n              <BranchPoints />\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"4\" uspid=\"27\" ordinal=\"0\" offset=\"0\" sl=\"30\" sc=\"9\" el=\"30\" ec=\"10\" />\n            </Method>\n            <Method visited=\"true\" cyclomaticComplexity=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" isConstructor=\"false\" isStatic=\"true\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"3\" visitedSequencePoints=\"3\" numBranchPoints=\"1\" visitedBranchPoints=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n              <MetadataToken>100663299</MetadataToken>\n              <Name>System.Boolean MyLibrary.Adder::Test2()</Name>\n              <FileRef uid=\"3\" />\n              <SequencePoints>\n                <SequencePoint vc=\"2\" uspid=\"30\" ordinal=\"0\" offset=\"0\" sl=\"35\" sc=\"9\" el=\"35\" ec=\"10\" />\n                <SequencePoint vc=\"2\" uspid=\"31\" ordinal=\"1\" offset=\"1\" sl=\"36\" sc=\"13\" el=\"36\" ec=\"26\" />\n                <SequencePoint vc=\"2\" uspid=\"32\" ordinal=\"2\" offset=\"5\" sl=\"37\" sc=\"9\" el=\"37\" ec=\"10\" />\n              </SequencePoints>\n              <BranchPoints />\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"2\" uspid=\"30\" ordinal=\"0\" offset=\"0\" sl=\"35\" sc=\"9\" el=\"35\" ec=\"10\" />\n            </Method>\n            <Method visited=\"false\" cyclomaticComplexity=\"1\" sequenceCoverage=\"0\" branchCoverage=\"0\" isConstructor=\"true\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n              <MetadataToken>100663300</MetadataToken>\n              <Name>System.Void MyLibrary.Adder::.ctor()</Name>\n              <SequencePoints />\n              <BranchPoints />\n              <MethodPoint vc=\"0\" uspid=\"33\" ordinal=\"0\" offset=\"0\" />\n            </Method>\n          </Methods>\n        </Class>\n        <Class>\n          <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n          <FullName>Foo.A</FullName>\n          <Methods>\n            <Method visited=\"false\" cyclomaticComplexity=\"1\" sequenceCoverage=\"0\" branchCoverage=\"0\" isConstructor=\"true\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n              <MetadataToken>100663301</MetadataToken>\n              <Name>System.Void Foo.A::.ctor()</Name>\n              <SequencePoints />\n              <BranchPoints />\n              <MethodPoint vc=\"0\" uspid=\"34\" ordinal=\"0\" offset=\"0\" />\n            </Method>\n          </Methods>\n        </Class>\n        <Class>\n          <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n          <FullName>Foo.A`1</FullName>\n          <Methods>\n            <Method visited=\"false\" cyclomaticComplexity=\"1\" sequenceCoverage=\"0\" branchCoverage=\"0\" isConstructor=\"true\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n              <MetadataToken>100663302</MetadataToken>\n              <Name>System.Void Foo.A`1::.ctor()</Name>\n              <SequencePoints />\n              <BranchPoints />\n              <MethodPoint vc=\"0\" uspid=\"35\" ordinal=\"0\" offset=\"0\" />\n            </Method>\n          </Methods>\n        </Class>\n        <Class>\n          <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n          <FullName>Foo.A`2</FullName>\n          <Methods>\n            <Method visited=\"false\" cyclomaticComplexity=\"1\" sequenceCoverage=\"0\" branchCoverage=\"0\" isConstructor=\"true\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n              <MetadataToken>100663303</MetadataToken>\n              <Name>System.Void Foo.A`2::.ctor()</Name>\n              <SequencePoints />\n              <BranchPoints />\n              <MethodPoint vc=\"0\" uspid=\"36\" ordinal=\"0\" offset=\"0\" />\n            </Method>\n          </Methods>\n        </Class>\n        <Class>\n          <Summary numSequencePoints=\"3\" visitedSequencePoints=\"0\" numBranchPoints=\"1\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n          <FullName>MyLibrary.Multiplier</FullName>\n          <Methods>\n            <Method visited=\"false\" cyclomaticComplexity=\"1\" sequenceCoverage=\"0\" branchCoverage=\"0\" isConstructor=\"false\" isStatic=\"true\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"3\" visitedSequencePoints=\"0\" numBranchPoints=\"1\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n              <MetadataToken>100663304</MetadataToken>\n              <Name>System.Int32 MyLibrary.Multiplier::Multiply(System.Int32,System.Int32)</Name>\n              <FileRef uid=\"4\" />\n              <SequencePoints>\n                <SequencePoint vc=\"0\" uspid=\"37\" ordinal=\"0\" offset=\"0\" sl=\"11\" sc=\"9\" el=\"11\" ec=\"10\" />\n                <SequencePoint vc=\"0\" uspid=\"38\" ordinal=\"1\" offset=\"1\" sl=\"12\" sc=\"13\" el=\"12\" ec=\"30\" />\n                <SequencePoint vc=\"0\" uspid=\"39\" ordinal=\"2\" offset=\"7\" sl=\"13\" sc=\"9\" el=\"13\" ec=\"10\" />\n              </SequencePoints>\n              <BranchPoints />\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"0\" uspid=\"37\" ordinal=\"0\" offset=\"0\" sl=\"11\" sc=\"9\" el=\"11\" ec=\"10\" />\n            </Method>\n            <Method visited=\"false\" cyclomaticComplexity=\"1\" sequenceCoverage=\"0\" branchCoverage=\"0\" isConstructor=\"true\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n              <MetadataToken>100663305</MetadataToken>\n              <Name>System.Void MyLibrary.Multiplier::.ctor()</Name>\n              <SequencePoints />\n              <BranchPoints />\n              <MethodPoint vc=\"0\" uspid=\"40\" ordinal=\"0\" offset=\"0\" />\n            </Method>\n          </Methods>\n        </Class>\n      </Classes>\n    </Module>\n  </Modules>\n</CoverageSession>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/opencover/invalid_root.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<foo />\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/opencover/missing_start_line.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<CoverageSession xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n  <Summary numSequencePoints=\"28\" visitedSequencePoints=\"20\" numBranchPoints=\"12\" visitedBranchPoints=\"8\" sequenceCoverage=\"71.43\" branchCoverage=\"66.67\" maxCyclomaticComplexity=\"4\" minCyclomaticComplexity=\"1\" />\n    <Module hash=\"DE-2D-20-DB-C7-7A-F5-8E-3C-33-9B-1D-83-2A-1E-48-F8-A8-EB-7B\">\n      <Summary numSequencePoints=\"6\" visitedSequencePoints=\"6\" numBranchPoints=\"2\" visitedBranchPoints=\"2\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n      <FullName>C:\\Users\\Dinesh\\Documents\\Visual Studio 2010\\Projects\\CSharpPlayground\\MyLibraryNUnitTest\\bin\\Debug\\MyLibraryNUnitTest.dll</FullName>\n      <ModuleName>MyLibraryNUnitTest</ModuleName>\n      <Files>\n        <File uid=\"1\" fullPath=\"MyLibraryNUnitTest\\AdderNUnitTest.cs\" />\n      </Files>\n      <Classes>\n        <Class>\n          <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"0\" minCyclomaticComplexity=\"0\" />\n          <FullName>&lt;Module&gt;</FullName>\n          <Methods />\n        </Class>\n        <Class>\n          <Summary numSequencePoints=\"6\" visitedSequencePoints=\"6\" numBranchPoints=\"2\" visitedBranchPoints=\"2\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n          <FullName>MyLibraryNUnitTest.AdderNUnitTest</FullName>\n          <Methods>\n            <Method visited=\"true\" cyclomaticComplexity=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"3\" visitedSequencePoints=\"3\" numBranchPoints=\"1\" visitedBranchPoints=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n              <MetadataToken>100663297</MetadataToken>\n              <Name>System.Void MyLibraryNUnitTest.AdderNUnitTest::Add()</Name>\n              <FileRef uid=\"1\" />\n              <SequencePoints>\n                <SequencePoint vc=\"1\" uspid=\"1\" ordinal=\"0\" offset=\"0\" el=\"16\" ec=\"10\" />\n              </SequencePoints>\n              <BranchPoints />\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"1\" uspid=\"1\" ordinal=\"0\" offset=\"0\" sl=\"16\" sc=\"9\" el=\"16\" ec=\"10\" />\n            </Method>\n          </Methods>\n        </Class>\n      </Classes>\n    </Module>\n  </Modules>\n</CoverageSession>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/opencover/one_class.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<CoverageSession xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n  <Summary numSequencePoints=\"28\" visitedSequencePoints=\"20\" numBranchPoints=\"12\" visitedBranchPoints=\"8\" sequenceCoverage=\"71.43\" branchCoverage=\"66.67\" maxCyclomaticComplexity=\"4\" minCyclomaticComplexity=\"1\" />\n  <Modules>\n    <Module skippedDueTo=\"Filter\" hash=\"54-D4-51-C6-FF-08-C9-23-DD-60-29-FB-72-FC-DE-35-B4-41-DA-06\">\n      <FullName>C:\\Windows\\assembly\\GAC_64\\mscorlib\\2.0.0.0__b77a5c561934e089\\mscorlib.dll</FullName>\n      <ModuleName>mscorlib</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"F9-04-A8-31-CD-FB-23-72-95-63-5D-14-9A-A0-66-8E-7F-44-93-7A\">\n      <FullName>C:\\Windows\\assembly\\GAC_64\\mscorlib\\2.0.0.0__b77a5c561934e089\\sorttbls.nlp</FullName>\n      <ModuleName>mscorlib</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"6E-30-2E-50-36-FB-60-2C-8E-50-C0-83-54-8B-CC-EA-A8-91-B6-CC\">\n      <FullName>C:\\Windows\\assembly\\GAC_64\\mscorlib\\2.0.0.0__b77a5c561934e089\\sortkey.nlp</FullName>\n      <ModuleName>mscorlib</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"F9-CA-B6-79-63-CB-31-8A-0D-DC-C3-D0-43-F8-28-C3-F0-95-F9-E7\">\n      <FullName>c:\\Program Files (x86)\\NUnit 2.6.3\\bin\\nunit-console.exe</FullName>\n      <ModuleName>nunit-console</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"2A-C4-E5-DE-F3-EE-AD-84-E1-65-84-CC-15-90-76-96-E7-01-44-4E\">\n      <FullName>C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\lib\\nunit-console-runner.dll</FullName>\n      <ModuleName>nunit-console-runner</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"33-E1-CA-24-52-5A-B7-C7-C4-AF-91-2C-A9-4A-C0-37-67-0D-5B-FE\">\n      <FullName>C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\lib\\nunit.core.dll</FullName>\n      <ModuleName>nunit.core</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"74-74-F6-87-59-E1-5F-4F-5F-5E-6E-82-50-E8-E2-46-D4-86-15-76\">\n      <FullName>C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\lib\\nunit.util.dll</FullName>\n      <ModuleName>nunit.util</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"D3-A4-4D-85-55-F7-CE-EF-A5-90-AA-EF-58-E0-9F-B6-CC-27-99-53\">\n      <FullName>C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\lib\\nunit.core.interfaces.dll</FullName>\n      <ModuleName>nunit.core.interfaces</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"2C-99-EE-29-D5-25-03-C4-0E-40-26-9B-F7-DF-C2-68-6E-74-74-31\">\n      <FullName>C:\\Windows\\assembly\\GAC_MSIL\\System.Configuration\\2.0.0.0__b03f5f7f11d50a3a\\System.Configuration.dll</FullName>\n      <ModuleName>System.Configuration</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"D3-99-70-9D-4C-FD-70-CC-82-00-AA-75-7A-54-8C-25-AC-54-B1-BF\">\n      <FullName>C:\\Windows\\assembly\\GAC_MSIL\\System\\2.0.0.0__b77a5c561934e089\\System.dll</FullName>\n      <ModuleName>System</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"C4-AD-0A-97-FF-1D-61-5F-88-89-A6-25-BD-02-5E-E5-F5-1D-6F-20\">\n      <FullName>C:\\Windows\\assembly\\GAC_MSIL\\System.Xml\\2.0.0.0__b77a5c561934e089\\System.Xml.dll</FullName>\n      <ModuleName>System.Xml</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"92-44-10-37-4C-84-2D-65-E3-A0-6A-B9-9F-01-42-6A-27-41-4A-8C\">\n      <FullName>C:\\Windows\\assembly\\GAC_MSIL\\System.Runtime.Remoting\\2.0.0.0__b77a5c561934e089\\System.Runtime.Remoting.dll</FullName>\n      <ModuleName>System.Runtime.Remoting</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"E1-6B-09-74-39-13-D1-98-9B-D2-7B-04-C8-8F-57-18-D7-9F-22-BA\">\n      <FullName>C:\\Windows\\Microsoft.Net\\assembly\\GAC_64\\mscorlib\\v4.0_4.0.0.0__b77a5c561934e089\\mscorlib.dll</FullName>\n      <ModuleName>mscorlib</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"87-52-C5-B2-2F-D3-F5-4F-58-BF-89-4A-88-59-6D-CE-F4-7F-6A-3B\">\n      <FullName>C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\nunit-agent.exe</FullName>\n      <ModuleName>nunit-agent</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"33-E1-CA-24-52-5A-B7-C7-C4-AF-91-2C-A9-4A-C0-37-67-0D-5B-FE\">\n      <FullName>C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\lib\\nunit.core.dll</FullName>\n      <ModuleName>nunit.core</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"74-74-F6-87-59-E1-5F-4F-5F-5E-6E-82-50-E8-E2-46-D4-86-15-76\">\n      <FullName>C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\lib\\nunit.util.dll</FullName>\n      <ModuleName>nunit.util</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"D3-A4-4D-85-55-F7-CE-EF-A5-90-AA-EF-58-E0-9F-B6-CC-27-99-53\">\n      <FullName>C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\lib\\nunit.core.interfaces.dll</FullName>\n      <ModuleName>nunit.core.interfaces</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"1B-30-81-91-69-2E-50-BD-B9-CC-A1-5B-46-3A-D5-62-E3-7E-58-C4\">\n      <FullName>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System\\v4.0_4.0.0.0__b77a5c561934e089\\System.dll</FullName>\n      <ModuleName>System</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"E8-47-7A-41-67-F7-5A-91-1D-B2-1A-48-85-F5-81-AF-DE-91-B4-C2\">\n      <FullName>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Runtime.Remoting\\v4.0_4.0.0.0__b77a5c561934e089\\System.Runtime.Remoting.dll</FullName>\n      <ModuleName>System.Runtime.Remoting</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"57-C7-F0-53-3B-97-01-CD-67-C1-80-37-68-7F-8F-89-D0-76-B4-48\">\n      <FullName>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Configuration\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Configuration.dll</FullName>\n      <ModuleName>System.Configuration</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"88-AF-AF-B3-FF-8A-DE-A7-50-A8-49-A8-87-FF-70-25-57-19-89-27\">\n      <FullName>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Xml\\v4.0_4.0.0.0__b77a5c561934e089\\System.Xml.dll</FullName>\n      <ModuleName>System.Xml</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"37-B7-01-DE-3F-2D-BD-A2-E5-87-BA-4F-BE-B4-83-E0-93-20-AD-5A\">\n      <FullName>C:\\Windows\\Microsoft.Net\\assembly\\GAC_64\\System.Web\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Web.dll</FullName>\n      <ModuleName>System.Web</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"F6-A6-9F-51-A3-09-AC-3A-FF-DB-AE-4D-25-AE-9C-74-61-4E-0C-75\">\n      <FullName>C:\\Windows\\assembly\\GAC_64\\System.Web\\2.0.0.0__b03f5f7f11d50a3a\\System.Web.dll</FullName>\n      <ModuleName>System.Web</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"33-E1-CA-24-52-5A-B7-C7-C4-AF-91-2C-A9-4A-C0-37-67-0D-5B-FE\">\n      <FullName>C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\lib\\nunit.core.dll</FullName>\n      <ModuleName>nunit.core</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"1B-30-81-91-69-2E-50-BD-B9-CC-A1-5B-46-3A-D5-62-E3-7E-58-C4\">\n      <FullName>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System\\v4.0_4.0.0.0__b77a5c561934e089\\System.dll</FullName>\n      <ModuleName>System</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"88-AF-AF-B3-FF-8A-DE-A7-50-A8-49-A8-87-FF-70-25-57-19-89-27\">\n      <FullName>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Xml\\v4.0_4.0.0.0__b77a5c561934e089\\System.Xml.dll</FullName>\n      <ModuleName>System.Xml</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"57-C7-F0-53-3B-97-01-CD-67-C1-80-37-68-7F-8F-89-D0-76-B4-48\">\n      <FullName>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Configuration\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Configuration.dll</FullName>\n      <ModuleName>System.Configuration</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"D3-A4-4D-85-55-F7-CE-EF-A5-90-AA-EF-58-E0-9F-B6-CC-27-99-53\">\n      <FullName>C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\lib\\nunit.core.interfaces.dll</FullName>\n      <ModuleName>nunit.core.interfaces</ModuleName>\n      <Classes />\n    </Module>\n    <Module hash=\"DE-2D-20-DB-C7-7A-F5-8E-3C-33-9B-1D-83-2A-1E-48-F8-A8-EB-7B\">\n      <Summary numSequencePoints=\"6\" visitedSequencePoints=\"6\" numBranchPoints=\"2\" visitedBranchPoints=\"2\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n      <FullName>C:\\Users\\Dinesh\\Documents\\Visual Studio 2010\\Projects\\CSharpPlayground\\MyLibraryNUnitTest\\bin\\Debug\\MyLibraryNUnitTest.dll</FullName>\n      <ModuleName>MyLibraryNUnitTest</ModuleName>\n      <Files>\n        <File uid=\"1\" fullPath=\"MyLibraryNUnitTest\\AdderNUnitTest.cs\" />\n      </Files>\n      <Classes>\n        <Class>\n          <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"0\" minCyclomaticComplexity=\"0\" />\n          <FullName>&lt;Module&gt;</FullName>\n          <Methods />\n        </Class>\n        <Class>\n          <Summary numSequencePoints=\"6\" visitedSequencePoints=\"6\" numBranchPoints=\"2\" visitedBranchPoints=\"2\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n          <FullName>MyLibraryNUnitTest.AdderNUnitTest</FullName>\n          <Methods>\n            <Method visited=\"true\" cyclomaticComplexity=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"3\" visitedSequencePoints=\"3\" numBranchPoints=\"1\" visitedBranchPoints=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n              <MetadataToken>100663297</MetadataToken>\n              <Name>System.Void MyLibraryNUnitTest.AdderNUnitTest::Add()</Name>\n              <FileRef uid=\"1\" />\n              <SequencePoints>\n                <SequencePoint vc=\"1\" uspid=\"1\" ordinal=\"0\" offset=\"0\" sl=\"16\" sc=\"9\" el=\"16\" ec=\"10\" />\n                <SequencePoint vc=\"1\" uspid=\"2\" ordinal=\"1\" offset=\"1\" sl=\"17\" sc=\"13\" el=\"17\" ec=\"51\" />\n                <SequencePoint vc=\"1\" uspid=\"3\" ordinal=\"2\" offset=\"17\" sl=\"18\" sc=\"9\" el=\"18\" ec=\"10\" />\n              </SequencePoints>\n              <BranchPoints />\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"1\" uspid=\"1\" ordinal=\"0\" offset=\"0\" sl=\"16\" sc=\"9\" el=\"16\" ec=\"10\" />\n            </Method>\n          </Methods>\n        </Class>\n      </Classes>\n    </Module>\n  </Modules>\n</CoverageSession>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/opencover/switch_expression_multiple_test_projects_1.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\nThis file was generated from the following code:\n\nusing System;\n\nnamespace SwitchCoverage\n{\n    public class Foo\n    {\n        public int Bar(string input) =>\n            input switch\n            {\n                \"one\" => 1,\n                \"two\" => 2,\n                \"three\" => 3,\n                _ => 0\n            };\n    }\n}\n\nUnit tests:\n\n// first test project\n\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\nusing SwitchCoverage;\n\nnamespace SwitchCoverageTest1\n{\n    [TestClass]\n    public class UnitTest1\n    {\n        [TestMethod]\n        public void TestMethod1()\n        {\n            Foo foo = new Foo();\n            Assert.AreEqual(1, foo.Bar(\"one\"));\n        }\n\n        [TestMethod]\n        public void TestMethod2()\n        {\n            Foo foo = new Foo();\n            Assert.AreEqual(2, foo.Bar(\"two\"));\n        }\n    }\n}\n\nOpenCover version 4.7.922.0\n\n-->\n<CoverageSession xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" Version=\"4.7.922.0\">\n  <Summary numSequencePoints=\"11\" visitedSequencePoints=\"9\" numBranchPoints=\"12\" visitedBranchPoints=\"7\" sequenceCoverage=\"81.82\" branchCoverage=\"58.33\" maxCyclomaticComplexity=\"5\" minCyclomaticComplexity=\"1\" maxCrapScore=\"5\" minCrapScore=\"1\" visitedClasses=\"2\" numClasses=\"3\" visitedMethods=\"3\" numMethods=\"4\" />\n  <Modules>\n    <Module skippedDueTo=\"Filter\" hash=\"19-A7-6E-09-56-92-7B-53-8D-DF-A8-1D-B0-92-BB-59-0C-61-4F-3C\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_32\\mscorlib\\v4.0_4.0.0.0__b77a5c561934e089\\mscorlib.dll</ModulePath>\n      <ModuleTime>2020-01-09T19:46:54Z</ModuleTime>\n      <ModuleName>mscorlib</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"48-2E-45-6A-CA-72-5E-5B-34-6F-E1-50-FE-70-35-1E-7A-52-9E-E1\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow\\vstest.console.exe</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>vstest.console</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"24-2C-03-2B-89-E0-30-E5-1F-11-C5-DC-6E-F5-2F-8E-5C-D1-37-51\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\vstest.console.exe</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>vstest.console</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"04-01-50-98-6C-72-A9-53-65-FF-BD-3F-FC-34-85-98-02-8C-55-7F\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.TestPlatform.CoreUtilities.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.CoreUtilities</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"4A-9D-81-85-DC-CF-74-ED-91-AC-6F-7B-37-3D-3E-0B-36-5C-56-66\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System\\v4.0_4.0.0.0__b77a5c561934e089\\System.dll</ModulePath>\n      <ModuleTime>2019-07-24T02:58:28Z</ModuleTime>\n      <ModuleName>System</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"B4-5F-71-54-5A-B1-43-E8-C8-B1-6F-51-A6-9A-FB-F3-EF-09-6F-71\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.ObjectModel</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"46-E1-5B-DC-5A-27-47-7B-BF-6B-55-98-50-04-1C-DE-F1-84-E6-6D\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.VisualStudio.TestPlatform.Client.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Client</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"EA-40-4C-75-4E-CC-64-CB-E0-0B-95-E4-AC-4E-14-0E-4E-43-CA-2B\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.VisualStudio.TestPlatform.Common.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Common</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"CC-DB-8A-78-1D-14-03-CA-9E-57-77-AD-02-B0-11-1E-9D-D0-F8-EB\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Core\\v4.0_4.0.0.0__b77a5c561934e089\\System.Core.dll</ModulePath>\n      <ModuleTime>2019-12-07T06:03:04Z</ModuleTime>\n      <ModuleName>System.Core</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"D2-F0-F2-FF-AE-D0-90-7D-B9-F6-15-6E-D5-06-05-87-03-53-98-79\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.TestPlatform.PlatformAbstractions.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.PlatformAbstractions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"2D-4E-7D-93-79-73-1D-3F-7A-CD-83-B3-5F-27-A4-33-E4-E0-D0-C0\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Xml\\v4.0_4.0.0.0__b77a5c561934e089\\System.Xml.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.3313185Z</ModuleTime>\n      <ModuleName>System.Xml</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"05-17-3D-5A-70-23-25-42-99-2A-6A-D4-9E-05-F1-BC-D8-01-CA-D5\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.TestPlatform.Utilities.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.Utilities</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"2A-7B-17-4D-5F-56-2E-65-AC-46-D1-7B-18-CB-45-61-99-7F-97-68\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Configuration\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Configuration.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.5645591Z</ModuleTime>\n      <ModuleName>System.Configuration</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"EB-76-12-F8-2F-06-94-4A-61-1C-23-3B-80-33-5E-18-0B-E5-A4-72\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.TestPlatform.CrossPlatEngine.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.CrossPlatEngine</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"06-19-22-50-4F-B6-BD-65-A0-C7-8C-DE-34-EA-A5-8F-DC-ED-2D-B8\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.TestPlatform.Extensions.BlameDataCollector.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.Extensions.BlameDataCollector</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"91-1A-F0-77-87-7A-78-F3-40-53-63-26-E3-B3-36-1E-8A-2C-E4-9C\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.TestPlatform.Extensions.EventLogCollector.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.Extensions.EventLogCollector</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"D7-A7-84-27-C4-A9-66-B8-8A-20-FF-57-E3-CB-C9-AD-9A-3B-B7-51\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.TestPlatform.TestHostRuntimeProvider.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.TestHostRuntimeProvider</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"D7-BF-31-BE-60-D4-B9-90-1B-91-BC-82-6E-42-CB-49-44-2F-6D-7C\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.VisualStudio.ArchitectureTools.PEReader.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.ArchitectureTools.PEReader</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"2D-C8-72-FE-35-9B-0E-78-1A-8C-2C-40-D9-83-6C-FA-C5-5F-75-D7\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.VisualStudio.Coverage.Interop.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.Coverage.Interop</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"F6-8B-50-0B-D5-4A-17-3D-09-28-19-BF-31-6A-B6-8B-E3-58-A8-9A\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.CodedWebTestAdapter.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.CodedWebTestAdapter</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"F2-D6-52-FE-00-A7-FE-8D-D4-24-AC-E7-A3-04-21-5A-AD-48-32-50\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.TmiAdapter.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.TmiAdapter</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"22-1F-5F-67-0C-DD-DE-1F-03-8C-89-85-2D-9A-AD-F4-95-AA-69-5B\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.VisualStudio.QualityTools.Common.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.QualityTools.Common</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"7E-38-11-17-B0-30-5D-45-76-2A-18-90-F0-18-13-4E-C1-B2-16-0F\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.GenericTestAdapter.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.GenericTestAdapter</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"D9-C5-A7-55-C2-10-DA-E0-F9-C2-DF-B2-06-83-F8-EE-B0-DB-E7-E2\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.OrderedTestAdapter.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.OrderedTestAdapter</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"12-6C-F5-E3-C7-CD-E3-77-C0-CA-1C-B3-6A-92-95-AE-F9-6C-A0-DA\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"46-46-34-57-D9-E0-CB-B4-8F-54-39-13-6F-43-4F-62-5D-6B-18-36\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.VSTestIntegration.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.VSTestIntegration</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"8A-70-99-42-21-64-D6-DA-93-8F-15-58-04-49-95-95-03-34-FD-B6\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.QualityTools.UnitTestFramework</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"CD-B4-80-7E-ED-87-A1-F3-81-CB-3E-96-C0-CC-4B-81-BD-74-C4-D1\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_32\\System.Data\\v4.0_4.0.0.0__b77a5c561934e089\\System.Data.dll</ModulePath>\n      <ModuleTime>2019-12-07T06:03:04Z</ModuleTime>\n      <ModuleName>System.Data</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"19-13-48-7E-B8-6D-86-0B-82-11-D0-29-88-B9-86-65-5D-CE-BB-B6\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.WebTestAdapter.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.WebTestAdapter</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"D8-54-DB-4C-35-8D-F0-9E-02-E7-C0-E3-8A-1F-38-28-64-B8-00-3C\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestTools.CppUnitTestFramework.ComInterfaces.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestTools.CppUnitTestFramework.ComInterfaces</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"AC-E8-F2-CF-48-EF-9B-55-DD-C4-50-E6-CF-EC-B3-35-AB-A6-D8-7B\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestTools.CppUnitTestFramework.CppUnitTestExtension.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestTools.CppUnitTestFramework.CppUnitTestExtension</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"60-03-96-F9-3B-1E-0D-18-F9-FE-FF-B9-4F-1B-28-3D-B7-20-39-7D\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestTools.DataCollection.MediaRecorder.Model.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestTools.DataCollection.MediaRecorder.Model</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"1D-26-3E-64-63-BC-40-62-7F-BA-67-38-AF-77-E8-9D-28-02-66-7C\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestTools.DataCollection.VideoRecorderCollector.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestTools.DataCollection.VideoRecorderCollector</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"D5-C4-56-DC-17-09-1C-EA-87-1C-E8-F5-C7-29-D4-20-74-8C-96-35\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TraceDataCollector.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TraceDataCollector</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"41-D1-74-75-40-0C-09-3F-D4-4E-F1-AB-6F-1E-70-75-98-12-5B-FC\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.IntelliTrace.Core.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.IntelliTrace.Core</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"F1-D3-C4-19-F0-A3-97-CA-EE-78-EA-BA-5F-97-56-C8-6D-7F-01-45\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\System.Reflection.Metadata.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>System.Reflection.Metadata</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"2A-5F-EB-FC-1F-8B-9B-DB-11-DF-AF-03-EE-EB-43-40-AC-5D-A5-08\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Runtime\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Runtime.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:17.086231Z</ModuleTime>\n      <ModuleName>System.Runtime</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"31-10-26-68-D1-64-10-03-21-09-D6-38-CC-CB-5F-68-D2-33-83-4E\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Runtime.InteropServices\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Runtime.InteropServices.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.4098692Z</ModuleTime>\n      <ModuleName>System.Runtime.InteropServices</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"42-26-9C-31-27-41-D7-11-67-3E-B9-52-F7-0B-89-F7-CF-DB-2A-9F\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.IO\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.IO.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.0307581Z</ModuleTime>\n      <ModuleName>System.IO</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"FB-BF-29-CE-7B-65-70-2C-55-E7-9A-03-D5-24-9F-04-A1-39-0C-A6\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\System.Collections.Immutable.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>System.Collections.Immutable</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"22-1F-F0-50-FF-7F-A0-29-DD-0C-1D-EE-12-A3-59-6D-ED-3D-47-14\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Reflection\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Reflection.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:16.8724675Z</ModuleTime>\n      <ModuleName>System.Reflection</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"53-77-EF-FE-9F-F9-EC-6E-7E-76-60-FF-15-66-89-40-9C-E0-20-59\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.IO.FileSystem\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.IO.FileSystem.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.0377466Z</ModuleTime>\n      <ModuleName>System.IO.FileSystem</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"27-DB-AC-1A-E3-0E-68-D9-4E-FB-01-38-58-7B-D4-0C-0C-06-3C-E2\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.IO.MemoryMappedFiles\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.IO.MemoryMappedFiles.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.5565597Z</ModuleTime>\n      <ModuleName>System.IO.MemoryMappedFiles</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"96-37-10-95-D6-A0-48-4B-95-E2-45-ED-F2-CC-F8-38-62-7F-B7-4A\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Runtime.Handles\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Runtime.Handles.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:17.0957374Z</ModuleTime>\n      <ModuleName>System.Runtime.Handles</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"20-90-4A-17-B6-9E-64-0F-FC-76-F1-38-55-AA-15-D2-A0-C7-C2-50\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Reflection.Extensions\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Reflection.Extensions.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:14.6041956Z</ModuleTime>\n      <ModuleName>System.Reflection.Extensions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"31-06-17-24-21-7B-94-95-95-7B-E6-A3-ED-8E-C4-61-76-81-50-E7\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Threading\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Threading.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.2693238Z</ModuleTime>\n      <ModuleName>System.Threading</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"8F-B6-AF-17-6D-95-F2-1A-C9-07-A2-52-08-07-0F-4B-AB-A1-B6-5A\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Text.Encoding\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Text.Encoding.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.1026701Z</ModuleTime>\n      <ModuleName>System.Text.Encoding</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"D7-63-79-55-E2-7C-07-44-05-DC-65-F2-1A-28-3F-C9-73-76-03-F4\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Runtime.Extensions\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Runtime.Extensions.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.6209693Z</ModuleTime>\n      <ModuleName>System.Runtime.Extensions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"BC-98-94-53-F1-64-6C-E2-64-06-9F-E1-73-E4-90-7C-0B-99-EF-63\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Text.Encoding.Extensions\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Text.Encoding.Extensions.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.1275958Z</ModuleTime>\n      <ModuleName>System.Text.Encoding.Extensions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"2A-2A-6C-70-82-27-5B-98-E6-EB-41-91-C0-3F-75-CB-8A-0B-FE-FD\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.TestPlatform.CommunicationUtilities.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.CommunicationUtilities</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"6B-0D-A7-56-17-A2-26-94-93-DC-1A-68-5D-7A-0B-07-F2-E4-8C-75\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Newtonsoft.Json.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Newtonsoft.Json</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"06-F9-8E-1A-FC-D4-91-9C-D0-32-40-16-3E-61-65-7F-A6-8C-FD-30\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.Extensions.DependencyModel.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.Extensions.DependencyModel</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"B7-47-70-CB-BE-3B-AE-84-BF-DC-39-49-BE-C0-48-89-A3-C9-6E-61\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Numerics\\v4.0_4.0.0.0__b77a5c561934e089\\System.Numerics.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.417806Z</ModuleTime>\n      <ModuleName>System.Numerics</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"EF-12-A7-1D-68-2E-E3-7A-F6-5E-43-AD-77-01-E8-BC-1B-19-CE-66\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Runtime.InteropServices.RuntimeInformation\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Runtime.InteropServices.RuntimeInformation.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:16.8561084Z</ModuleTime>\n      <ModuleName>System.Runtime.InteropServices.RuntimeInformation</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"19-DB-E7-26-74-3E-B8-3C-B9-3E-89-49-9F-20-99-D9-CF-23-FD-17\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.CoreLib.dll</ModulePath>\n      <ModuleTime>2020-02-18T20:16:14Z</ModuleTime>\n      <ModuleName>System.Private.CoreLib</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"2D-24-9E-08-28-FF-DB-00-08-DF-87-04-1B-84-6A-4D-EC-11-E9-CB\">\n      <ModulePath>SwitchCoverage\\SwitchCoverageTest1\\bin\\Debug\\netcoreapp3.1\\testhost.dll</ModulePath>\n      <ModuleTime>2020-02-04T19:55:24Z</ModuleTime>\n      <ModuleName>testhost</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"45-AE-FF-2D-9F-D9-14-AE-5E-58-BC-AD-59-3F-6B-E0-C7-F9-45-CA\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n      <ModuleName>System.Runtime</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"72-CD-4C-29-1F-8A-A2-EE-EE-49-B7-39-D7-D2-59-25-D4-15-8A-47\">\n      <ModulePath>SwitchCoverage\\SwitchCoverageTest1\\bin\\Debug\\netcoreapp3.1\\Microsoft.TestPlatform.CoreUtilities.dll</ModulePath>\n      <ModuleTime>2020-02-04T19:55:22Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.CoreUtilities</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"08-0A-47-0B-10-27-7A-98-D6-A5-5B-EC-1C-35-91-93-AB-C0-35-65\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\netstandard.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n      <ModuleName>netstandard</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"D3-FC-01-5E-22-55-B9-FD-FB-0D-0E-A5-B8-58-05-D8-DC-D2-F5-24\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Tracing.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:36Z</ModuleTime>\n      <ModuleName>System.Diagnostics.Tracing</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"03-17-2D-A2-47-E8-DA-D5-28-CB-74-74-E2-56-70-6A-C0-5A-AB-58\">\n      <ModulePath>SwitchCoverage\\SwitchCoverageTest1\\bin\\Debug\\netcoreapp3.1\\Microsoft.TestPlatform.PlatformAbstractions.dll</ModulePath>\n      <ModuleTime>2020-02-04T19:55:22Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.PlatformAbstractions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"B8-01-4B-08-49-01-14-1F-52-C1-06-1B-E1-C4-DA-8C-8C-15-88-14\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Extensions.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n      <ModuleName>System.Runtime.Extensions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"32-77-95-87-72-D8-6D-43-AA-DA-36-9B-86-D6-99-7F-41-0E-CF-A5\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Debug.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n      <ModuleName>System.Diagnostics.Debug</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"8B-E9-5A-2E-CC-DB-5C-E1-03-05-BA-E1-31-A9-9D-6F-18-10-50-AA\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n      <ModuleName>System.Collections</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"C3-FB-C2-9E-95-BB-9F-EC-54-E9-D6-2E-96-6F-43-6E-95-D3-F0-A1\">\n      <ModulePath>SwitchCoverage\\SwitchCoverageTest1\\bin\\Debug\\netcoreapp3.1\\Microsoft.TestPlatform.CrossPlatEngine.dll</ModulePath>\n      <ModuleTime>2020-02-04T19:55:24Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.CrossPlatEngine</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"7E-1F-2A-CD-BD-DB-46-49-18-E0-16-C3-50-2A-47-26-74-E0-FA-63\">\n      <ModulePath>SwitchCoverage\\SwitchCoverageTest1\\bin\\Debug\\netcoreapp3.1\\Microsoft.TestPlatform.CommunicationUtilities.dll</ModulePath>\n      <ModuleTime>2020-02-04T19:55:24Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.CommunicationUtilities</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"40-25-A6-0F-A5-B4-71-8F-77-23-6F-C1-FC-B2-A9-94-DA-7B-5F-2E\">\n      <ModulePath>SwitchCoverage\\SwitchCoverageTest1\\bin\\Debug\\netcoreapp3.1\\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll</ModulePath>\n      <ModuleTime>2020-02-04T19:55:22Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.ObjectModel</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"C9-48-8A-EF-A0-7E-17-43-0F-BC-D2-F3-4D-26-76-B6-7D-DE-DF-67\">\n      <ModulePath>SwitchCoverage\\SwitchCoverageTest1\\bin\\Debug\\netcoreapp3.1\\Microsoft.VisualStudio.TestPlatform.Common.dll</ModulePath>\n      <ModuleTime>2020-02-04T19:55:24Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Common</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"53-D0-A3-B9-10-36-09-21-32-F4-D0-88-75-00-B5-DC-77-89-1D-78\">\n      <ModulePath>SwitchCoverage\\SwitchCoverageTest1\\bin\\Debug\\netcoreapp3.1\\Newtonsoft.Json.dll</ModulePath>\n      <ModuleTime>2016-06-13T21:06:14Z</ModuleTime>\n      <ModuleName>Newtonsoft.Json</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"96-C7-5C-FC-1E-89-3E-67-F0-53-6B-39-C4-C0-61-BC-52-35-9C-A0\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Serialization.Primitives.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n      <ModuleName>System.Runtime.Serialization.Primitives</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"A6-8F-70-B6-4E-19-5D-AD-A4-E6-F3-7F-0E-80-A2-3F-81-B0-99-64\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Globalization.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n      <ModuleName>System.Globalization</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"9C-68-F9-D9-5D-09-7B-AC-36-D7-6D-25-3D-17-F3-72-E5-1A-87-F0\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:06Z</ModuleTime>\n      <ModuleName>System.Threading</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"66-55-F3-9A-C4-53-63-95-5F-60-D2-19-0F-7E-3B-2B-85-46-FB-8D\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.TraceSource.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n      <ModuleName>System.Diagnostics.TraceSource</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"4D-33-53-11-50-36-83-92-2B-29-8C-5A-FA-19-EF-5A-D4-AA-32-80\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Process.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:38Z</ModuleTime>\n      <ModuleName>System.Diagnostics.Process</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"E5-F8-08-77-40-69-F3-B4-39-9E-F4-4F-30-35-FF-75-AD-66-E9-C9\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.Primitives.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:34Z</ModuleTime>\n      <ModuleName>System.ComponentModel.Primitives</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"AF-4F-3B-E9-D2-80-A0-2E-91-5B-AF-17-34-A9-F1-A6-32-C4-EC-4E\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Memory.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n      <ModuleName>System.Memory</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"FC-9A-A3-24-E8-48-FF-9E-1A-D8-C2-B3-54-1E-A8-DD-B2-E1-E3-96\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.ThreadPool.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n      <ModuleName>System.Threading.ThreadPool</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"B9-08-B2-09-3C-61-2C-3E-62-03-05-65-93-6A-84-E5-2C-0D-A7-F4\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.InteropServices.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n      <ModuleName>System.Runtime.InteropServices</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"4E-A9-32-5A-D2-0F-84-D8-73-42-C7-0B-6A-3C-7B-C0-89-B7-20-01\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\Microsoft.Win32.Primitives.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n      <ModuleName>Microsoft.Win32.Primitives</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"2A-48-85-A6-03-C4-07-FD-29-10-28-5A-25-BF-0C-FA-03-A7-98-B2\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Primitives.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n      <ModuleName>System.Net.Primitives</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"23-F9-09-16-3B-71-58-F5-A7-35-CA-89-4D-75-0F-3D-D0-23-DC-EB\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Tasks.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n      <ModuleName>System.Threading.Tasks</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"EE-DF-4B-C9-A1-40-03-5F-56-1A-DB-D7-E8-A0-BC-A6-12-34-84-1E\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Sockets.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:08Z</ModuleTime>\n      <ModuleName>System.Net.Sockets</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"87-6E-54-67-71-53-FA-C9-68-88-0D-C1-82-45-BE-68-5A-25-55-32\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Overlapped.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n      <ModuleName>System.Threading.Overlapped</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"E6-CE-DF-D3-05-01-F5-61-41-53-0C-FF-2C-87-01-04-6E-EB-B1-C7\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.NameResolution.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:06:40Z</ModuleTime>\n      <ModuleName>System.Net.NameResolution</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"D5-0A-67-87-14-54-BA-3A-F2-2A-2A-B8-15-CE-D1-74-51-44-E5-FC\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Uri.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:26Z</ModuleTime>\n      <ModuleName>System.Private.Uri</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"2F-EF-10-A4-03-CD-85-F5-B3-28-04-C0-CA-59-04-4C-AE-A8-5D-D0\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Principal.Windows.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n      <ModuleName>System.Security.Principal.Windows</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"79-03-C9-B3-67-3A-61-F7-6D-B6-CE-72-A2-3F-68-B5-87-C1-4B-60\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Claims.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n      <ModuleName>System.Security.Claims</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"87-DE-C4-EB-AC-4B-76-40-4C-56-AB-F2-05-44-02-D8-77-58-26-00\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Principal.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n      <ModuleName>System.Security.Principal</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"2A-8E-FF-4D-F2-A7-D6-AA-9E-44-17-D8-8A-11-71-D4-7C-19-DA-FF\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Runtime.Serialization\\v4.0_4.0.0.0__b77a5c561934e089\\System.Runtime.Serialization.dll</ModulePath>\n      <ModuleTime>2020-01-09T19:46:54Z</ModuleTime>\n      <ModuleName>System.Runtime.Serialization</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"32-74-EF-25-E3-A9-11-0C-F0-FD-2D-7E-1A-97-75-45-D0-5E-8A-A8\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Xml.Linq\\v4.0_4.0.0.0__b77a5c561934e089\\System.Xml.Linq.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.5069748Z</ModuleTime>\n      <ModuleName>System.Xml.Linq</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"C1-41-1B-16-60-41-0D-35-CE-85-82-6D-04-AB-CE-5C-88-E8-BE-91\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:06:06Z</ModuleTime>\n      <ModuleName>System.IO</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"17-CC-E7-2C-B7-DA-57-06-96-2B-F7-01-5A-76-38-AA-26-92-87-6D\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Dynamic.Runtime.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:38Z</ModuleTime>\n      <ModuleName>System.Dynamic.Runtime</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"6F-CC-2C-76-AC-42-0E-1D-29-DC-BE-AB-E0-6D-A4-C2-9D-0C-27-23\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Linq.Expressions.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:06:18Z</ModuleTime>\n      <ModuleName>System.Linq.Expressions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"08-4C-1D-C3-E8-DB-38-EA-0D-64-CB-BD-58-BC-F2-B0-E2-99-42-93\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n      <ModuleName>System.Reflection</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"70-58-B8-D8-D1-66-CB-C6-C4-F9-5F-80-03-7C-74-A2-D8-CA-6A-98\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Extensions.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n      <ModuleName>System.Reflection.Extensions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"33-87-51-E6-2F-8C-BE-1D-5B-B2-9E-51-10-1B-05-40-2C-E3-E8-1A\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Linq.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:06:40Z</ModuleTime>\n      <ModuleName>System.Linq</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"22-BD-0E-BF-F3-50-23-F4-33-69-45-CA-85-5A-41-AA-FF-98-13-6A\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ObjectModel.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n      <ModuleName>System.ObjectModel</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"4B-5A-EC-05-10-C3-65-A3-7C-C5-D4-52-0E-41-A4-1F-73-88-F9-01\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.XDocument.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n      <ModuleName>System.Xml.XDocument</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"68-1D-85-11-BD-EC-60-7F-F2-E8-83-FF-C6-D8-D9-CB-28-C8-8B-2A\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Xml.Linq.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:30Z</ModuleTime>\n      <ModuleName>System.Private.Xml.Linq</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"1F-BD-6F-06-01-11-FA-A9-DB-0B-12-95-1E-A0-B6-62-C2-59-ED-05\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Xml.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:38Z</ModuleTime>\n      <ModuleName>System.Private.Xml</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"9D-C0-19-0D-B9-0B-71-00-FA-44-3E-7A-92-13-79-FB-D2-34-4F-3D\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.RegularExpressions.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n      <ModuleName>System.Text.RegularExpressions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"B5-88-C5-06-06-46-BA-FC-55-0E-7A-44-AC-31-CD-F3-5B-DF-AE-0B\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.ILGeneration.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n      <ModuleName>System.Reflection.Emit.ILGeneration</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"EA-A3-EB-09-A2-39-8F-0D-B1-13-BA-6D-11-3A-EC-93-44-39-5A-D3\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.Lightweight.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n      <ModuleName>System.Reflection.Emit.Lightweight</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"C8-E8-31-5D-60-D0-B9-32-02-28-DE-17-96-8F-97-91-72-F8-BE-13\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Primitives.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n      <ModuleName>System.Reflection.Primitives</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"\">\n      <ModulePath>RefEmit_InMemoryManifestModule</ModulePath>\n      <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n      <ModuleName>Anonymously Hosted DynamicMethods Assembly</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"5E-EA-96-C3-0B-C7-BF-BA-AE-4A-27-D8-9A-9A-67-A2-72-BF-89-1F\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.NonGeneric.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:32Z</ModuleTime>\n      <ModuleName>System.Collections.NonGeneric</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"A6-81-2A-5B-4A-3D-C8-4D-49-04-DE-1F-DF-02-7C-B4-43-51-DE-1C\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.FileSystem.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n      <ModuleName>System.IO.FileSystem</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"3D-ED-2E-29-0D-BD-86-B5-75-96-FF-B0-C8-9D-AD-4E-5B-94-58-57\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Loader.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n      <ModuleName>System.Runtime.Loader</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"5C-37-15-25-14-5D-AA-CD-FE-A1-58-0B-02-CA-F0-06-3B-F0-75-3E\">\n      <ModulePath>SwitchCoverage\\SwitchCoverageTest1\\bin\\Debug\\netcoreapp3.1\\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll</ModulePath>\n      <ModuleTime>2020-02-03T08:45:56Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"9D-1A-06-D1-57-63-4E-2B-7F-60-AB-7C-A1-0C-67-26-0C-72-0B-31\">\n      <ModulePath>SwitchCoverage\\SwitchCoverageTest1\\bin\\Debug\\netcoreapp3.1\\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</ModulePath>\n      <ModuleTime>2020-02-03T08:42:14Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.TestFramework</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"14-23-11-33-8A-3E-C2-95-9C-AF-E0-44-A0-4E-01-93-24-28-69-36\">\n      <ModulePath>SwitchCoverage\\SwitchCoverageTest1\\bin\\Debug\\netcoreapp3.1\\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll</ModulePath>\n      <ModuleTime>2020-02-03T08:43:54Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"18-52-46-8F-91-31-7C-89-18-7F-98-66-A5-FF-E4-26-5C-68-8E-0A\">\n      <ModulePath>SwitchCoverage\\SwitchCoverageTest1\\bin\\Debug\\netcoreapp3.1\\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll</ModulePath>\n      <ModuleTime>2020-02-03T08:52:28Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"06-19-22-50-4F-B6-BD-65-A0-C7-8C-DE-34-EA-A5-8F-DC-ED-2D-B8\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.TestPlatform.Extensions.BlameDataCollector.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.Extensions.BlameDataCollector</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"73-E1-7F-C7-2D-C9-99-D8-D5-D4-21-69-B8-EB-65-4F-5D-EE-9F-B3\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:26Z</ModuleTime>\n      <ModuleName>System.Xml</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"2F-E1-13-B8-1E-10-AE-79-4A-CD-F8-AE-C1-F1-E8-22-10-2F-61-17\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.ReaderWriter.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n      <ModuleName>System.Xml.ReaderWriter</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"F2-84-10-73-D5-25-3C-C8-54-CA-05-A9-21-5F-EC-4F-D6-B7-11-E4\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\mscorlib.dll</ModulePath>\n      <ModuleTime>2020-02-21T02:00:46Z</ModuleTime>\n      <ModuleName>mscorlib</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"91-1A-F0-77-87-7A-78-F3-40-53-63-26-E3-B3-36-1E-8A-2C-E4-9C\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.TestPlatform.Extensions.EventLogCollector.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.Extensions.EventLogCollector</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"1D-26-3E-64-63-BC-40-62-7F-BA-67-38-AF-77-E8-9D-28-02-66-7C\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestTools.DataCollection.VideoRecorderCollector.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestTools.DataCollection.VideoRecorderCollector</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"60-03-96-F9-3B-1E-0D-18-F9-FE-FF-B9-4F-1B-28-3D-B7-20-39-7D\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestTools.DataCollection.MediaRecorder.Model.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestTools.DataCollection.MediaRecorder.Model</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"D5-C4-56-DC-17-09-1C-EA-87-1C-E8-F5-C7-29-D4-20-74-8C-96-35\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TraceDataCollector.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TraceDataCollector</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"88-C2-81-23-88-9B-01-F5-41-12-93-F2-07-C5-30-2F-E9-C7-6C-F6\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Core.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:34Z</ModuleTime>\n      <ModuleName>System.Core</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"4A-25-21-3A-BE-77-81-CD-7C-8A-13-F5-C1-EC-79-31-83-0D-13-AA\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.ArchitectureTools.PEReader.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.ArchitectureTools.PEReader</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"A4-7B-EB-61-14-FF-0A-F1-6C-B1-3D-60-27-46-D9-09-64-D7-5C-4A\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.StackTrace.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:36Z</ModuleTime>\n      <ModuleName>System.Diagnostics.StackTrace</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"F5-4A-B0-89-01-16-50-65-5F-DD-4C-B5-70-9E-39-1A-D1-B7-FE-38\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Metadata.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n      <ModuleName>System.Reflection.Metadata</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"01-AB-1F-C1-0A-AD-1A-D5-69-41-9D-4B-4E-1C-6F-AC-59-05-9A-48\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Immutable.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n      <ModuleName>System.Collections.Immutable</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"A3-6E-3F-5C-23-E9-CE-D4-59-A4-79-82-3A-A2-A6-D2-A6-37-0E-C2\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Thread.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n      <ModuleName>System.Threading.Thread</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"08-F9-21-BB-3C-07-A4-DA-5A-43-89-51-EB-E0-A4-B9-2F-19-F6-7D\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.Algorithms.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n      <ModuleName>System.Security.Cryptography.Algorithms</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"25-17-3D-BA-13-03-55-32-76-CF-3D-AE-B3-52-14-5F-95-F5-3E-85\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Timer.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n      <ModuleName>System.Threading.Timer</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"57-E8-B3-F8-DB-88-F2-FB-81-BE-34-C3-AD-1E-D4-F0-DD-F0-59-D3\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Resources.ResourceManager.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n      <ModuleName>System.Resources.ResourceManager</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"26-14-D7-B5-EB-43-C2-76-01-4F-01-5E-7B-A4-CE-E9-EB-E3-AA-B9\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.InteropServices.RuntimeInformation.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n      <ModuleName>System.Runtime.InteropServices.RuntimeInformation</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"C1-E6-95-46-6B-22-AB-AD-8C-29-08-C6-4F-A8-BC-C8-E3-D9-B3-83\">\n      <ModulePath>SwitchCoverage\\SwitchCoverageTest1\\bin\\Debug\\netcoreapp3.1\\NuGet.Frameworks.dll</ModulePath>\n      <ModuleTime>2019-04-01T16:23:50Z</ModuleTime>\n      <ModuleName>NuGet.Frameworks</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"4E-96-5A-FC-C0-BE-6F-D4-A5-9C-B4-F8-33-D5-85-D1-B9-07-9F-89\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Encoding.Extensions.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n      <ModuleName>System.Text.Encoding.Extensions</ModuleName>\n      <Classes />\n    </Module>\n    <Module hash=\"E6-3B-3B-75-A4-24-FB-65-6E-8F-F1-96-BF-3A-02-2B-FD-07-C2-11\">\n      <Summary numSequencePoints=\"10\" visitedSequencePoints=\"8\" numBranchPoints=\"3\" visitedBranchPoints=\"2\" sequenceCoverage=\"80\" branchCoverage=\"66.67\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"1\" visitedClasses=\"1\" numClasses=\"2\" visitedMethods=\"2\" numMethods=\"3\" />\n      <ModulePath>SwitchCoverage\\SwitchCoverageTest1\\bin\\Debug\\netcoreapp3.1\\SwitchCoverageTest1.dll</ModulePath>\n      <ModuleTime>2020-04-27T15:20:59.1349436Z</ModuleTime>\n      <ModuleName>SwitchCoverageTest1</ModuleName>\n      <Files>\n        <File uid=\"1\" fullPath=\"C:\\Users\\Andrei\\.nuget\\packages\\microsoft.net.test.sdk\\16.5.0\\build\\netcoreapp2.1\\Microsoft.NET.Test.Sdk.Program.cs\" />\n        <File uid=\"2\" fullPath=\"SwitchCoverage\\SwitchCoverageTest1\\UnitTest1.cs\" />\n      </Files>\n      <Classes>\n        <Class>\n          <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"0\" minCyclomaticComplexity=\"0\" maxCrapScore=\"0\" minCrapScore=\"0\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"0\" />\n          <FullName>&lt;Module&gt;</FullName>\n          <Methods />\n        </Class>\n        <Class>\n          <Summary numSequencePoints=\"2\" visitedSequencePoints=\"0\" numBranchPoints=\"1\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"2\" visitedClasses=\"0\" numClasses=\"1\" visitedMethods=\"0\" numMethods=\"1\" />\n          <FullName>AutoGeneratedProgram</FullName>\n          <Methods>\n            <Method visited=\"false\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" crapScore=\"2\" isConstructor=\"false\" isStatic=\"true\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"2\" visitedSequencePoints=\"0\" numBranchPoints=\"1\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"2\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"1\" />\n              <MetadataToken>100663297</MetadataToken>\n              <Name>System.Void AutoGeneratedProgram::Main(System.String[])</Name>\n              <FileRef uid=\"1\" />\n              <SequencePoints>\n                <SequencePoint vc=\"0\" uspid=\"1\" ordinal=\"0\" offset=\"0\" sl=\"4\" sc=\"60\" el=\"4\" ec=\"61\" bec=\"0\" bev=\"0\" fileid=\"1\" />\n                <SequencePoint vc=\"0\" uspid=\"2\" ordinal=\"1\" offset=\"1\" sl=\"4\" sc=\"61\" el=\"4\" ec=\"62\" bec=\"0\" bev=\"0\" fileid=\"1\" />\n              </SequencePoints>\n              <BranchPoints />\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"0\" uspid=\"1\" ordinal=\"0\" offset=\"0\" sl=\"4\" sc=\"60\" el=\"4\" ec=\"61\" bec=\"0\" bev=\"0\" fileid=\"1\" />\n            </Method>\n            <Method visited=\"false\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" crapScore=\"2\" isConstructor=\"true\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"2\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"0\" />\n              <MetadataToken>100663298</MetadataToken>\n              <Name>System.Void AutoGeneratedProgram::.ctor()</Name>\n              <SequencePoints />\n              <BranchPoints />\n              <MethodPoint vc=\"0\" uspid=\"3\" ordinal=\"0\" offset=\"0\" />\n            </Method>\n          </Methods>\n        </Class>\n        <Class>\n          <Summary numSequencePoints=\"8\" visitedSequencePoints=\"8\" numBranchPoints=\"2\" visitedBranchPoints=\"2\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"1\" visitedClasses=\"1\" numClasses=\"1\" visitedMethods=\"2\" numMethods=\"2\" />\n          <FullName>SwitchCoverageTest1.UnitTest1</FullName>\n          <Methods>\n            <Method visited=\"true\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"100\" branchCoverage=\"100\" crapScore=\"1\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"4\" visitedSequencePoints=\"4\" numBranchPoints=\"1\" visitedBranchPoints=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"1\" minCrapScore=\"1\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"1\" numMethods=\"1\" />\n              <MetadataToken>100663299</MetadataToken>\n              <Name>System.Void SwitchCoverageTest1.UnitTest1::TestMethod1()</Name>\n              <FileRef uid=\"2\" />\n              <SequencePoints>\n                <SequencePoint vc=\"1\" uspid=\"4\" ordinal=\"0\" offset=\"0\" sl=\"11\" sc=\"9\" el=\"11\" ec=\"10\" bec=\"0\" bev=\"0\" fileid=\"2\" />\n                <SequencePoint vc=\"1\" uspid=\"5\" ordinal=\"1\" offset=\"1\" sl=\"12\" sc=\"13\" el=\"12\" ec=\"33\" bec=\"0\" bev=\"0\" fileid=\"2\" />\n                <SequencePoint vc=\"1\" uspid=\"6\" ordinal=\"2\" offset=\"7\" sl=\"13\" sc=\"13\" el=\"13\" ec=\"48\" bec=\"0\" bev=\"0\" fileid=\"2\" />\n                <SequencePoint vc=\"1\" uspid=\"7\" ordinal=\"3\" offset=\"25\" sl=\"14\" sc=\"9\" el=\"14\" ec=\"10\" bec=\"0\" bev=\"0\" fileid=\"2\" />\n              </SequencePoints>\n              <BranchPoints />\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"1\" uspid=\"4\" ordinal=\"0\" offset=\"0\" sl=\"11\" sc=\"9\" el=\"11\" ec=\"10\" bec=\"0\" bev=\"0\" fileid=\"2\" />\n            </Method>\n            <Method visited=\"true\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"100\" branchCoverage=\"100\" crapScore=\"1\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"4\" visitedSequencePoints=\"4\" numBranchPoints=\"1\" visitedBranchPoints=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"1\" minCrapScore=\"1\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"1\" numMethods=\"1\" />\n              <MetadataToken>100663300</MetadataToken>\n              <Name>System.Void SwitchCoverageTest1.UnitTest1::TestMethod2()</Name>\n              <FileRef uid=\"2\" />\n              <SequencePoints>\n                <SequencePoint vc=\"1\" uspid=\"8\" ordinal=\"0\" offset=\"0\" sl=\"18\" sc=\"9\" el=\"18\" ec=\"10\" bec=\"0\" bev=\"0\" fileid=\"2\" />\n                <SequencePoint vc=\"1\" uspid=\"9\" ordinal=\"1\" offset=\"1\" sl=\"19\" sc=\"13\" el=\"19\" ec=\"33\" bec=\"0\" bev=\"0\" fileid=\"2\" />\n                <SequencePoint vc=\"1\" uspid=\"10\" ordinal=\"2\" offset=\"7\" sl=\"20\" sc=\"13\" el=\"20\" ec=\"48\" bec=\"0\" bev=\"0\" fileid=\"2\" />\n                <SequencePoint vc=\"1\" uspid=\"11\" ordinal=\"3\" offset=\"25\" sl=\"21\" sc=\"9\" el=\"21\" ec=\"10\" bec=\"0\" bev=\"0\" fileid=\"2\" />\n              </SequencePoints>\n              <BranchPoints />\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"1\" uspid=\"8\" ordinal=\"0\" offset=\"0\" sl=\"18\" sc=\"9\" el=\"18\" ec=\"10\" bec=\"0\" bev=\"0\" fileid=\"2\" />\n            </Method>\n            <Method visited=\"false\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" crapScore=\"2\" isConstructor=\"true\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"2\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"0\" />\n              <MetadataToken>100663301</MetadataToken>\n              <Name>System.Void SwitchCoverageTest1.UnitTest1::.ctor()</Name>\n              <SequencePoints />\n              <BranchPoints />\n              <MethodPoint vc=\"0\" uspid=\"12\" ordinal=\"0\" offset=\"0\" />\n            </Method>\n          </Methods>\n        </Class>\n      </Classes>\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"31-48-4C-D9-B7-64-1C-85-5D-80-A0-AB-74-1E-29-E1-94-43-80-C0\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.FileSystem.Primitives.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:42Z</ModuleTime>\n      <ModuleName>System.IO.FileSystem.Primitives</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"48-69-8F-D3-34-45-06-46-29-98-3A-0A-71-C5-1A-6D-78-02-46-35\">\n      <ModulePath>SwitchCoverage\\SwitchCoverageTest1\\bin\\Debug\\netcoreapp3.1\\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</ModulePath>\n      <ModuleTime>2020-02-03T08:43:06Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"6D-0F-A0-D8-6E-D9-3D-12-46-84-DE-CC-44-CE-CF-2B-96-27-29-EA\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.TypeConverter.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:32Z</ModuleTime>\n      <ModuleName>System.ComponentModel.TypeConverter</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"8F-A1-95-7C-65-A0-95-11-53-8D-DF-11-6D-3C-AD-5D-AE-2F-D3-73\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Concurrent.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n      <ModuleName>System.Collections.Concurrent</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"D0-59-FE-7C-7F-0D-36-55-42-D4-35-5B-11-52-FF-15-85-1C-6D-DB\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.TextWriterTraceListener.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:36Z</ModuleTime>\n      <ModuleName>System.Diagnostics.TextWriterTraceListener</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"32-5D-5E-82-60-49-7F-5D-44-D4-1E-BF-57-95-6F-D8-30-A6-C2-E1\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Console.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n      <ModuleName>System.Console</ModuleName>\n      <Classes />\n    </Module>\n    <Module hash=\"BB-9C-0F-8E-5F-FC-F9-90-9C-2F-D8-CF-15-63-3A-5B-F3-6D-AE-DE\">\n      <Summary numSequencePoints=\"1\" visitedSequencePoints=\"1\" numBranchPoints=\"9\" visitedBranchPoints=\"5\" sequenceCoverage=\"100\" branchCoverage=\"55.56\" maxCyclomaticComplexity=\"5\" minCyclomaticComplexity=\"1\" maxCrapScore=\"5\" minCrapScore=\"2\" visitedClasses=\"1\" numClasses=\"1\" visitedMethods=\"1\" numMethods=\"1\" />\n      <ModulePath>SwitchCoverage\\SwitchCoverageTest1\\bin\\Debug\\netcoreapp3.1\\SwitchCoverage.dll</ModulePath>\n      <ModuleTime>2020-04-27T15:20:56.9319773Z</ModuleTime>\n      <ModuleName>SwitchCoverage</ModuleName>\n      <Files>\n        <File uid=\"5\" fullPath=\"SwitchCoverage\\SwitchCoverage\\Foo.cs\" />\n      </Files>\n      <Classes>\n        <Class>\n          <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"0\" minCyclomaticComplexity=\"0\" maxCrapScore=\"0\" minCrapScore=\"0\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"0\" />\n          <FullName>&lt;Module&gt;</FullName>\n          <Methods />\n        </Class>\n        <Class>\n          <Summary numSequencePoints=\"1\" visitedSequencePoints=\"1\" numBranchPoints=\"9\" visitedBranchPoints=\"5\" sequenceCoverage=\"100\" branchCoverage=\"55.56\" maxCyclomaticComplexity=\"5\" minCyclomaticComplexity=\"1\" maxCrapScore=\"5\" minCrapScore=\"2\" visitedClasses=\"1\" numClasses=\"1\" visitedMethods=\"1\" numMethods=\"1\" />\n          <FullName>SwitchCoverage.Foo</FullName>\n          <Methods>\n            <Method visited=\"true\" cyclomaticComplexity=\"5\" nPathComplexity=\"16\" sequenceCoverage=\"100\" branchCoverage=\"55.56\" crapScore=\"5\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"1\" visitedSequencePoints=\"1\" numBranchPoints=\"9\" visitedBranchPoints=\"5\" sequenceCoverage=\"100\" branchCoverage=\"55.56\" maxCyclomaticComplexity=\"5\" minCyclomaticComplexity=\"5\" maxCrapScore=\"5\" minCrapScore=\"5\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"1\" numMethods=\"1\" />\n              <MetadataToken>100663297</MetadataToken>\n              <Name>System.Int32 SwitchCoverage.Foo::Bar(System.String)</Name>\n              <FileRef uid=\"5\" />\n              <SequencePoints>\n                <SequencePoint vc=\"2\" uspid=\"13\" ordinal=\"0\" offset=\"0\" sl=\"8\" sc=\"13\" el=\"14\" ec=\"14\" bec=\"7\" bev=\"4\" fileid=\"5\" />\n              </SequencePoints>\n              <BranchPoints>\n                <BranchPoint vc=\"2\" uspid=\"14\" ordinal=\"0\" offset=\"1\" sl=\"8\" path=\"0\" offsetend=\"3\" fileid=\"5\" />\n                <BranchPoint vc=\"0\" uspid=\"15\" ordinal=\"1\" offset=\"1\" sl=\"8\" path=\"1\" offsetend=\"56\" fileid=\"5\" />\n                <BranchPoint vc=\"1\" uspid=\"16\" ordinal=\"2\" offset=\"14\" sl=\"8\" path=\"0\" offsetend=\"16\" fileid=\"5\" />\n                <BranchPoint vc=\"1\" uspid=\"17\" ordinal=\"3\" offset=\"14\" sl=\"8\" path=\"1\" offsetend=\"44\" fileid=\"5\" />\n                <BranchPoint vc=\"0\" uspid=\"18\" ordinal=\"4\" offset=\"27\" sl=\"8\" path=\"0\" offsetend=\"29\" fileid=\"5\" />\n                <BranchPoint vc=\"1\" uspid=\"19\" ordinal=\"5\" offset=\"27\" sl=\"8\" path=\"1\" offsetend=\"48\" fileid=\"5\" />\n                <BranchPoint vc=\"0\" uspid=\"20\" ordinal=\"6\" offset=\"40\" sl=\"8\" path=\"0\" offsetchain=\"42\" offsetend=\"56\" fileid=\"5\" />\n                <BranchPoint vc=\"0\" uspid=\"21\" ordinal=\"7\" offset=\"40\" sl=\"8\" path=\"1\" offsetend=\"52\" fileid=\"5\" />\n              </BranchPoints>\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"2\" uspid=\"13\" ordinal=\"0\" offset=\"0\" sl=\"8\" sc=\"13\" el=\"14\" ec=\"14\" bec=\"7\" bev=\"4\" fileid=\"5\" />\n            </Method>\n            <Method visited=\"false\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" crapScore=\"2\" isConstructor=\"true\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"2\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"0\" />\n              <MetadataToken>100663298</MetadataToken>\n              <Name>System.Void SwitchCoverage.Foo::.ctor()</Name>\n              <SequencePoints />\n              <BranchPoints />\n              <MethodPoint vc=\"0\" uspid=\"22\" ordinal=\"0\" offset=\"0\" />\n            </Method>\n          </Methods>\n        </Class>\n      </Classes>\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"55-8E-C2-A5-09-4D-3F-8C-11-59-AB-41-D5-05-B5-7B-8D-3A-AA-6E\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.Primitives.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n      <ModuleName>System.Security.Cryptography.Primitives</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"AA-A1-B5-37-5B-A3-3F-60-8A-4D-0B-A0-48-E4-49-D8-49-E0-96-D9\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\SMDiagnostics\\v4.0_4.0.0.0__b77a5c561934e089\\SMDiagnostics.dll</ModulePath>\n      <ModuleTime>2020-01-09T19:46:54Z</ModuleTime>\n      <ModuleName>SMDiagnostics</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"BB-80-4D-57-28-4C-C5-76-72-6F-11-E7-E6-86-43-26-A9-62-89-CD\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.ServiceModel.Internals\\v4.0_4.0.0.0__31bf3856ad364e35\\System.ServiceModel.Internals.dll</ModulePath>\n      <ModuleTime>2020-01-09T19:46:54Z</ModuleTime>\n      <ModuleName>System.ServiceModel.Internals</ModuleName>\n      <Classes />\n    </Module>\n  </Modules>\n</CoverageSession>"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/opencover/switch_expression_multiple_test_projects_2.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\nThis file was generated from the following code:\n\nusing System;\n\nnamespace SwitchCoverage\n{\n    public class Foo\n    {\n        public int Bar(string input) =>\n            input switch\n            {\n                \"one\" => 1,\n                \"two\" => 2,\n                \"three\" => 3,\n                _ => 0\n            };\n    }\n}\n\nUnit tests:\n\n// second test project\n\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\nusing SwitchCoverage;\n\nnamespace SwitchCoverageTest2\n{\n    [TestClass]\n    public class Tests\n    {\n\n        [TestMethod]\n        public void Test1()\n        {\n            Foo foo = new Foo();\n            Assert.AreEqual(1, foo.Bar(\"one\"));\n        }\n\n        [TestMethod]\n        public void Test3()\n        {\n            Foo foo = new Foo();\n            Assert.AreEqual(3, foo.Bar(\"three\"));\n        }\n\n    }\n}\n\nOpenCover version 4.7.922.0\n\n-->\n<CoverageSession xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" Version=\"4.7.922.0\">\n  <Summary numSequencePoints=\"11\" visitedSequencePoints=\"9\" numBranchPoints=\"12\" visitedBranchPoints=\"8\" sequenceCoverage=\"81.82\" branchCoverage=\"66.67\" maxCyclomaticComplexity=\"5\" minCyclomaticComplexity=\"1\" maxCrapScore=\"5\" minCrapScore=\"1\" visitedClasses=\"2\" numClasses=\"3\" visitedMethods=\"3\" numMethods=\"4\" />\n  <Modules>\n    <Module skippedDueTo=\"Filter\" hash=\"19-A7-6E-09-56-92-7B-53-8D-DF-A8-1D-B0-92-BB-59-0C-61-4F-3C\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_32\\mscorlib\\v4.0_4.0.0.0__b77a5c561934e089\\mscorlib.dll</ModulePath>\n      <ModuleTime>2020-01-09T19:46:54Z</ModuleTime>\n      <ModuleName>mscorlib</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"48-2E-45-6A-CA-72-5E-5B-34-6F-E1-50-FE-70-35-1E-7A-52-9E-E1\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow\\vstest.console.exe</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>vstest.console</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"24-2C-03-2B-89-E0-30-E5-1F-11-C5-DC-6E-F5-2F-8E-5C-D1-37-51\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\vstest.console.exe</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>vstest.console</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"04-01-50-98-6C-72-A9-53-65-FF-BD-3F-FC-34-85-98-02-8C-55-7F\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.TestPlatform.CoreUtilities.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.CoreUtilities</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"4A-9D-81-85-DC-CF-74-ED-91-AC-6F-7B-37-3D-3E-0B-36-5C-56-66\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System\\v4.0_4.0.0.0__b77a5c561934e089\\System.dll</ModulePath>\n      <ModuleTime>2019-07-24T02:58:28Z</ModuleTime>\n      <ModuleName>System</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"B4-5F-71-54-5A-B1-43-E8-C8-B1-6F-51-A6-9A-FB-F3-EF-09-6F-71\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.ObjectModel</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"46-E1-5B-DC-5A-27-47-7B-BF-6B-55-98-50-04-1C-DE-F1-84-E6-6D\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.VisualStudio.TestPlatform.Client.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Client</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"EA-40-4C-75-4E-CC-64-CB-E0-0B-95-E4-AC-4E-14-0E-4E-43-CA-2B\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.VisualStudio.TestPlatform.Common.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Common</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"CC-DB-8A-78-1D-14-03-CA-9E-57-77-AD-02-B0-11-1E-9D-D0-F8-EB\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Core\\v4.0_4.0.0.0__b77a5c561934e089\\System.Core.dll</ModulePath>\n      <ModuleTime>2019-12-07T06:03:04Z</ModuleTime>\n      <ModuleName>System.Core</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"D2-F0-F2-FF-AE-D0-90-7D-B9-F6-15-6E-D5-06-05-87-03-53-98-79\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.TestPlatform.PlatformAbstractions.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.PlatformAbstractions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"2D-4E-7D-93-79-73-1D-3F-7A-CD-83-B3-5F-27-A4-33-E4-E0-D0-C0\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Xml\\v4.0_4.0.0.0__b77a5c561934e089\\System.Xml.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.3313185Z</ModuleTime>\n      <ModuleName>System.Xml</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"05-17-3D-5A-70-23-25-42-99-2A-6A-D4-9E-05-F1-BC-D8-01-CA-D5\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.TestPlatform.Utilities.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.Utilities</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"2A-7B-17-4D-5F-56-2E-65-AC-46-D1-7B-18-CB-45-61-99-7F-97-68\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Configuration\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Configuration.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.5645591Z</ModuleTime>\n      <ModuleName>System.Configuration</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"EB-76-12-F8-2F-06-94-4A-61-1C-23-3B-80-33-5E-18-0B-E5-A4-72\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.TestPlatform.CrossPlatEngine.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.CrossPlatEngine</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"06-19-22-50-4F-B6-BD-65-A0-C7-8C-DE-34-EA-A5-8F-DC-ED-2D-B8\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.TestPlatform.Extensions.BlameDataCollector.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.Extensions.BlameDataCollector</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"91-1A-F0-77-87-7A-78-F3-40-53-63-26-E3-B3-36-1E-8A-2C-E4-9C\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.TestPlatform.Extensions.EventLogCollector.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.Extensions.EventLogCollector</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"D7-A7-84-27-C4-A9-66-B8-8A-20-FF-57-E3-CB-C9-AD-9A-3B-B7-51\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.TestPlatform.TestHostRuntimeProvider.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.TestHostRuntimeProvider</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"D7-BF-31-BE-60-D4-B9-90-1B-91-BC-82-6E-42-CB-49-44-2F-6D-7C\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.VisualStudio.ArchitectureTools.PEReader.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.ArchitectureTools.PEReader</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"2D-C8-72-FE-35-9B-0E-78-1A-8C-2C-40-D9-83-6C-FA-C5-5F-75-D7\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.VisualStudio.Coverage.Interop.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.Coverage.Interop</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"F6-8B-50-0B-D5-4A-17-3D-09-28-19-BF-31-6A-B6-8B-E3-58-A8-9A\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.CodedWebTestAdapter.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.CodedWebTestAdapter</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"F2-D6-52-FE-00-A7-FE-8D-D4-24-AC-E7-A3-04-21-5A-AD-48-32-50\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.TmiAdapter.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.TmiAdapter</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"22-1F-5F-67-0C-DD-DE-1F-03-8C-89-85-2D-9A-AD-F4-95-AA-69-5B\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.VisualStudio.QualityTools.Common.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.QualityTools.Common</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"7E-38-11-17-B0-30-5D-45-76-2A-18-90-F0-18-13-4E-C1-B2-16-0F\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.GenericTestAdapter.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.GenericTestAdapter</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"D9-C5-A7-55-C2-10-DA-E0-F9-C2-DF-B2-06-83-F8-EE-B0-DB-E7-E2\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.OrderedTestAdapter.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.OrderedTestAdapter</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"12-6C-F5-E3-C7-CD-E3-77-C0-CA-1C-B3-6A-92-95-AE-F9-6C-A0-DA\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"46-46-34-57-D9-E0-CB-B4-8F-54-39-13-6F-43-4F-62-5D-6B-18-36\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.VSTestIntegration.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.VSTestIntegration</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"8A-70-99-42-21-64-D6-DA-93-8F-15-58-04-49-95-95-03-34-FD-B6\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.QualityTools.UnitTestFramework</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"CD-B4-80-7E-ED-87-A1-F3-81-CB-3E-96-C0-CC-4B-81-BD-74-C4-D1\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_32\\System.Data\\v4.0_4.0.0.0__b77a5c561934e089\\System.Data.dll</ModulePath>\n      <ModuleTime>2019-12-07T06:03:04Z</ModuleTime>\n      <ModuleName>System.Data</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"19-13-48-7E-B8-6D-86-0B-82-11-D0-29-88-B9-86-65-5D-CE-BB-B6\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.WebTestAdapter.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.WebTestAdapter</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"D8-54-DB-4C-35-8D-F0-9E-02-E7-C0-E3-8A-1F-38-28-64-B8-00-3C\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestTools.CppUnitTestFramework.ComInterfaces.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestTools.CppUnitTestFramework.ComInterfaces</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"AC-E8-F2-CF-48-EF-9B-55-DD-C4-50-E6-CF-EC-B3-35-AB-A6-D8-7B\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestTools.CppUnitTestFramework.CppUnitTestExtension.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestTools.CppUnitTestFramework.CppUnitTestExtension</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"60-03-96-F9-3B-1E-0D-18-F9-FE-FF-B9-4F-1B-28-3D-B7-20-39-7D\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestTools.DataCollection.MediaRecorder.Model.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestTools.DataCollection.MediaRecorder.Model</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"1D-26-3E-64-63-BC-40-62-7F-BA-67-38-AF-77-E8-9D-28-02-66-7C\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestTools.DataCollection.VideoRecorderCollector.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestTools.DataCollection.VideoRecorderCollector</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"D5-C4-56-DC-17-09-1C-EA-87-1C-E8-F5-C7-29-D4-20-74-8C-96-35\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TraceDataCollector.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TraceDataCollector</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"41-D1-74-75-40-0C-09-3F-D4-4E-F1-AB-6F-1E-70-75-98-12-5B-FC\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.IntelliTrace.Core.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.IntelliTrace.Core</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"F1-D3-C4-19-F0-A3-97-CA-EE-78-EA-BA-5F-97-56-C8-6D-7F-01-45\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\System.Reflection.Metadata.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>System.Reflection.Metadata</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"2A-5F-EB-FC-1F-8B-9B-DB-11-DF-AF-03-EE-EB-43-40-AC-5D-A5-08\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Runtime\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Runtime.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:17.086231Z</ModuleTime>\n      <ModuleName>System.Runtime</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"31-10-26-68-D1-64-10-03-21-09-D6-38-CC-CB-5F-68-D2-33-83-4E\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Runtime.InteropServices\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Runtime.InteropServices.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.4098692Z</ModuleTime>\n      <ModuleName>System.Runtime.InteropServices</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"42-26-9C-31-27-41-D7-11-67-3E-B9-52-F7-0B-89-F7-CF-DB-2A-9F\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.IO\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.IO.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.0307581Z</ModuleTime>\n      <ModuleName>System.IO</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"FB-BF-29-CE-7B-65-70-2C-55-E7-9A-03-D5-24-9F-04-A1-39-0C-A6\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\System.Collections.Immutable.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>System.Collections.Immutable</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"22-1F-F0-50-FF-7F-A0-29-DD-0C-1D-EE-12-A3-59-6D-ED-3D-47-14\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Reflection\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Reflection.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:16.8724675Z</ModuleTime>\n      <ModuleName>System.Reflection</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"53-77-EF-FE-9F-F9-EC-6E-7E-76-60-FF-15-66-89-40-9C-E0-20-59\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.IO.FileSystem\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.IO.FileSystem.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.0377466Z</ModuleTime>\n      <ModuleName>System.IO.FileSystem</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"27-DB-AC-1A-E3-0E-68-D9-4E-FB-01-38-58-7B-D4-0C-0C-06-3C-E2\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.IO.MemoryMappedFiles\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.IO.MemoryMappedFiles.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.5565597Z</ModuleTime>\n      <ModuleName>System.IO.MemoryMappedFiles</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"96-37-10-95-D6-A0-48-4B-95-E2-45-ED-F2-CC-F8-38-62-7F-B7-4A\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Runtime.Handles\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Runtime.Handles.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:17.0957374Z</ModuleTime>\n      <ModuleName>System.Runtime.Handles</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"20-90-4A-17-B6-9E-64-0F-FC-76-F1-38-55-AA-15-D2-A0-C7-C2-50\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Reflection.Extensions\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Reflection.Extensions.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:14.6041956Z</ModuleTime>\n      <ModuleName>System.Reflection.Extensions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"31-06-17-24-21-7B-94-95-95-7B-E6-A3-ED-8E-C4-61-76-81-50-E7\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Threading\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Threading.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.2693238Z</ModuleTime>\n      <ModuleName>System.Threading</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"8F-B6-AF-17-6D-95-F2-1A-C9-07-A2-52-08-07-0F-4B-AB-A1-B6-5A\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Text.Encoding\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Text.Encoding.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.1026701Z</ModuleTime>\n      <ModuleName>System.Text.Encoding</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"D7-63-79-55-E2-7C-07-44-05-DC-65-F2-1A-28-3F-C9-73-76-03-F4\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Runtime.Extensions\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Runtime.Extensions.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.6209693Z</ModuleTime>\n      <ModuleName>System.Runtime.Extensions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"BC-98-94-53-F1-64-6C-E2-64-06-9F-E1-73-E4-90-7C-0B-99-EF-63\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Text.Encoding.Extensions\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Text.Encoding.Extensions.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.1275958Z</ModuleTime>\n      <ModuleName>System.Text.Encoding.Extensions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"2A-2A-6C-70-82-27-5B-98-E6-EB-41-91-C0-3F-75-CB-8A-0B-FE-FD\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.TestPlatform.CommunicationUtilities.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.CommunicationUtilities</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"6B-0D-A7-56-17-A2-26-94-93-DC-1A-68-5D-7A-0B-07-F2-E4-8C-75\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Newtonsoft.Json.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Newtonsoft.Json</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"06-F9-8E-1A-FC-D4-91-9C-D0-32-40-16-3E-61-65-7F-A6-8C-FD-30\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.Extensions.DependencyModel.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.Extensions.DependencyModel</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"B7-47-70-CB-BE-3B-AE-84-BF-DC-39-49-BE-C0-48-89-A3-C9-6E-61\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Numerics\\v4.0_4.0.0.0__b77a5c561934e089\\System.Numerics.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.417806Z</ModuleTime>\n      <ModuleName>System.Numerics</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"EF-12-A7-1D-68-2E-E3-7A-F6-5E-43-AD-77-01-E8-BC-1B-19-CE-66\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Runtime.InteropServices.RuntimeInformation\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Runtime.InteropServices.RuntimeInformation.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:16.8561084Z</ModuleTime>\n      <ModuleName>System.Runtime.InteropServices.RuntimeInformation</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"19-DB-E7-26-74-3E-B8-3C-B9-3E-89-49-9F-20-99-D9-CF-23-FD-17\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.CoreLib.dll</ModulePath>\n      <ModuleTime>2020-02-18T20:16:14Z</ModuleTime>\n      <ModuleName>System.Private.CoreLib</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"2D-24-9E-08-28-FF-DB-00-08-DF-87-04-1B-84-6A-4D-EC-11-E9-CB\">\n      <ModulePath>SwitchCoverage\\UnitTestProject2\\bin\\Debug\\netcoreapp3.1\\testhost.dll</ModulePath>\n      <ModuleTime>2020-02-04T19:55:24Z</ModuleTime>\n      <ModuleName>testhost</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"45-AE-FF-2D-9F-D9-14-AE-5E-58-BC-AD-59-3F-6B-E0-C7-F9-45-CA\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n      <ModuleName>System.Runtime</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"72-CD-4C-29-1F-8A-A2-EE-EE-49-B7-39-D7-D2-59-25-D4-15-8A-47\">\n      <ModulePath>SwitchCoverage\\UnitTestProject2\\bin\\Debug\\netcoreapp3.1\\Microsoft.TestPlatform.CoreUtilities.dll</ModulePath>\n      <ModuleTime>2020-02-04T19:55:22Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.CoreUtilities</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"08-0A-47-0B-10-27-7A-98-D6-A5-5B-EC-1C-35-91-93-AB-C0-35-65\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\netstandard.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n      <ModuleName>netstandard</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"D3-FC-01-5E-22-55-B9-FD-FB-0D-0E-A5-B8-58-05-D8-DC-D2-F5-24\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Tracing.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:36Z</ModuleTime>\n      <ModuleName>System.Diagnostics.Tracing</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"03-17-2D-A2-47-E8-DA-D5-28-CB-74-74-E2-56-70-6A-C0-5A-AB-58\">\n      <ModulePath>SwitchCoverage\\UnitTestProject2\\bin\\Debug\\netcoreapp3.1\\Microsoft.TestPlatform.PlatformAbstractions.dll</ModulePath>\n      <ModuleTime>2020-02-04T19:55:22Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.PlatformAbstractions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"B8-01-4B-08-49-01-14-1F-52-C1-06-1B-E1-C4-DA-8C-8C-15-88-14\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Extensions.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n      <ModuleName>System.Runtime.Extensions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"32-77-95-87-72-D8-6D-43-AA-DA-36-9B-86-D6-99-7F-41-0E-CF-A5\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Debug.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n      <ModuleName>System.Diagnostics.Debug</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"8B-E9-5A-2E-CC-DB-5C-E1-03-05-BA-E1-31-A9-9D-6F-18-10-50-AA\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n      <ModuleName>System.Collections</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"C3-FB-C2-9E-95-BB-9F-EC-54-E9-D6-2E-96-6F-43-6E-95-D3-F0-A1\">\n      <ModulePath>SwitchCoverage\\UnitTestProject2\\bin\\Debug\\netcoreapp3.1\\Microsoft.TestPlatform.CrossPlatEngine.dll</ModulePath>\n      <ModuleTime>2020-02-04T19:55:24Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.CrossPlatEngine</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"7E-1F-2A-CD-BD-DB-46-49-18-E0-16-C3-50-2A-47-26-74-E0-FA-63\">\n      <ModulePath>SwitchCoverage\\UnitTestProject2\\bin\\Debug\\netcoreapp3.1\\Microsoft.TestPlatform.CommunicationUtilities.dll</ModulePath>\n      <ModuleTime>2020-02-04T19:55:24Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.CommunicationUtilities</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"40-25-A6-0F-A5-B4-71-8F-77-23-6F-C1-FC-B2-A9-94-DA-7B-5F-2E\">\n      <ModulePath>SwitchCoverage\\UnitTestProject2\\bin\\Debug\\netcoreapp3.1\\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll</ModulePath>\n      <ModuleTime>2020-02-04T19:55:22Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.ObjectModel</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"C9-48-8A-EF-A0-7E-17-43-0F-BC-D2-F3-4D-26-76-B6-7D-DE-DF-67\">\n      <ModulePath>SwitchCoverage\\UnitTestProject2\\bin\\Debug\\netcoreapp3.1\\Microsoft.VisualStudio.TestPlatform.Common.dll</ModulePath>\n      <ModuleTime>2020-02-04T19:55:24Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Common</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"53-D0-A3-B9-10-36-09-21-32-F4-D0-88-75-00-B5-DC-77-89-1D-78\">\n      <ModulePath>SwitchCoverage\\UnitTestProject2\\bin\\Debug\\netcoreapp3.1\\Newtonsoft.Json.dll</ModulePath>\n      <ModuleTime>2016-06-13T21:06:14Z</ModuleTime>\n      <ModuleName>Newtonsoft.Json</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"96-C7-5C-FC-1E-89-3E-67-F0-53-6B-39-C4-C0-61-BC-52-35-9C-A0\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Serialization.Primitives.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n      <ModuleName>System.Runtime.Serialization.Primitives</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"A6-8F-70-B6-4E-19-5D-AD-A4-E6-F3-7F-0E-80-A2-3F-81-B0-99-64\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Globalization.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n      <ModuleName>System.Globalization</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"9C-68-F9-D9-5D-09-7B-AC-36-D7-6D-25-3D-17-F3-72-E5-1A-87-F0\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:06Z</ModuleTime>\n      <ModuleName>System.Threading</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"66-55-F3-9A-C4-53-63-95-5F-60-D2-19-0F-7E-3B-2B-85-46-FB-8D\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.TraceSource.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n      <ModuleName>System.Diagnostics.TraceSource</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"4D-33-53-11-50-36-83-92-2B-29-8C-5A-FA-19-EF-5A-D4-AA-32-80\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.Process.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:38Z</ModuleTime>\n      <ModuleName>System.Diagnostics.Process</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"E5-F8-08-77-40-69-F3-B4-39-9E-F4-4F-30-35-FF-75-AD-66-E9-C9\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.Primitives.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:34Z</ModuleTime>\n      <ModuleName>System.ComponentModel.Primitives</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"AF-4F-3B-E9-D2-80-A0-2E-91-5B-AF-17-34-A9-F1-A6-32-C4-EC-4E\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Memory.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n      <ModuleName>System.Memory</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"FC-9A-A3-24-E8-48-FF-9E-1A-D8-C2-B3-54-1E-A8-DD-B2-E1-E3-96\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.ThreadPool.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n      <ModuleName>System.Threading.ThreadPool</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"B9-08-B2-09-3C-61-2C-3E-62-03-05-65-93-6A-84-E5-2C-0D-A7-F4\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.InteropServices.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n      <ModuleName>System.Runtime.InteropServices</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"4E-A9-32-5A-D2-0F-84-D8-73-42-C7-0B-6A-3C-7B-C0-89-B7-20-01\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\Microsoft.Win32.Primitives.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n      <ModuleName>Microsoft.Win32.Primitives</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"2A-48-85-A6-03-C4-07-FD-29-10-28-5A-25-BF-0C-FA-03-A7-98-B2\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Primitives.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n      <ModuleName>System.Net.Primitives</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"23-F9-09-16-3B-71-58-F5-A7-35-CA-89-4D-75-0F-3D-D0-23-DC-EB\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Tasks.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:28Z</ModuleTime>\n      <ModuleName>System.Threading.Tasks</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"EE-DF-4B-C9-A1-40-03-5F-56-1A-DB-D7-E8-A0-BC-A6-12-34-84-1E\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.Sockets.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:08Z</ModuleTime>\n      <ModuleName>System.Net.Sockets</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"87-6E-54-67-71-53-FA-C9-68-88-0D-C1-82-45-BE-68-5A-25-55-32\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Overlapped.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n      <ModuleName>System.Threading.Overlapped</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"E6-CE-DF-D3-05-01-F5-61-41-53-0C-FF-2C-87-01-04-6E-EB-B1-C7\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Net.NameResolution.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:06:40Z</ModuleTime>\n      <ModuleName>System.Net.NameResolution</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"D5-0A-67-87-14-54-BA-3A-F2-2A-2A-B8-15-CE-D1-74-51-44-E5-FC\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Uri.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:26Z</ModuleTime>\n      <ModuleName>System.Private.Uri</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"2F-EF-10-A4-03-CD-85-F5-B3-28-04-C0-CA-59-04-4C-AE-A8-5D-D0\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Principal.Windows.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n      <ModuleName>System.Security.Principal.Windows</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"79-03-C9-B3-67-3A-61-F7-6D-B6-CE-72-A2-3F-68-B5-87-C1-4B-60\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Claims.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n      <ModuleName>System.Security.Claims</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"87-DE-C4-EB-AC-4B-76-40-4C-56-AB-F2-05-44-02-D8-77-58-26-00\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Principal.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n      <ModuleName>System.Security.Principal</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"2A-8E-FF-4D-F2-A7-D6-AA-9E-44-17-D8-8A-11-71-D4-7C-19-DA-FF\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Runtime.Serialization\\v4.0_4.0.0.0__b77a5c561934e089\\System.Runtime.Serialization.dll</ModulePath>\n      <ModuleTime>2020-01-09T19:46:54Z</ModuleTime>\n      <ModuleName>System.Runtime.Serialization</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"32-74-EF-25-E3-A9-11-0C-F0-FD-2D-7E-1A-97-75-45-D0-5E-8A-A8\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Xml.Linq\\v4.0_4.0.0.0__b77a5c561934e089\\System.Xml.Linq.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.5069748Z</ModuleTime>\n      <ModuleName>System.Xml.Linq</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"C1-41-1B-16-60-41-0D-35-CE-85-82-6D-04-AB-CE-5C-88-E8-BE-91\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:06:06Z</ModuleTime>\n      <ModuleName>System.IO</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"17-CC-E7-2C-B7-DA-57-06-96-2B-F7-01-5A-76-38-AA-26-92-87-6D\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Dynamic.Runtime.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:38Z</ModuleTime>\n      <ModuleName>System.Dynamic.Runtime</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"6F-CC-2C-76-AC-42-0E-1D-29-DC-BE-AB-E0-6D-A4-C2-9D-0C-27-23\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Linq.Expressions.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:06:18Z</ModuleTime>\n      <ModuleName>System.Linq.Expressions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"08-4C-1D-C3-E8-DB-38-EA-0D-64-CB-BD-58-BC-F2-B0-E2-99-42-93\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n      <ModuleName>System.Reflection</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"70-58-B8-D8-D1-66-CB-C6-C4-F9-5F-80-03-7C-74-A2-D8-CA-6A-98\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Extensions.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n      <ModuleName>System.Reflection.Extensions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"33-87-51-E6-2F-8C-BE-1D-5B-B2-9E-51-10-1B-05-40-2C-E3-E8-1A\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Linq.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:06:40Z</ModuleTime>\n      <ModuleName>System.Linq</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"22-BD-0E-BF-F3-50-23-F4-33-69-45-CA-85-5A-41-AA-FF-98-13-6A\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ObjectModel.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n      <ModuleName>System.ObjectModel</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"4B-5A-EC-05-10-C3-65-A3-7C-C5-D4-52-0E-41-A4-1F-73-88-F9-01\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.XDocument.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n      <ModuleName>System.Xml.XDocument</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"68-1D-85-11-BD-EC-60-7F-F2-E8-83-FF-C6-D8-D9-CB-28-C8-8B-2A\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Xml.Linq.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:30Z</ModuleTime>\n      <ModuleName>System.Private.Xml.Linq</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"1F-BD-6F-06-01-11-FA-A9-DB-0B-12-95-1E-A0-B6-62-C2-59-ED-05\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Private.Xml.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:38Z</ModuleTime>\n      <ModuleName>System.Private.Xml</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"9D-C0-19-0D-B9-0B-71-00-FA-44-3E-7A-92-13-79-FB-D2-34-4F-3D\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.RegularExpressions.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n      <ModuleName>System.Text.RegularExpressions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"B5-88-C5-06-06-46-BA-FC-55-0E-7A-44-AC-31-CD-F3-5B-DF-AE-0B\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.ILGeneration.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n      <ModuleName>System.Reflection.Emit.ILGeneration</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"EA-A3-EB-09-A2-39-8F-0D-B1-13-BA-6D-11-3A-EC-93-44-39-5A-D3\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Emit.Lightweight.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n      <ModuleName>System.Reflection.Emit.Lightweight</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"C8-E8-31-5D-60-D0-B9-32-02-28-DE-17-96-8F-97-91-72-F8-BE-13\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Primitives.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:34Z</ModuleTime>\n      <ModuleName>System.Reflection.Primitives</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"\">\n      <ModulePath>RefEmit_InMemoryManifestModule</ModulePath>\n      <ModuleTime>0001-01-01T00:00:00</ModuleTime>\n      <ModuleName>Anonymously Hosted DynamicMethods Assembly</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"5E-EA-96-C3-0B-C7-BF-BA-AE-4A-27-D8-9A-9A-67-A2-72-BF-89-1F\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.NonGeneric.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:32Z</ModuleTime>\n      <ModuleName>System.Collections.NonGeneric</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"A6-81-2A-5B-4A-3D-C8-4D-49-04-DE-1F-DF-02-7C-B4-43-51-DE-1C\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.FileSystem.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:06:08Z</ModuleTime>\n      <ModuleName>System.IO.FileSystem</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"3D-ED-2E-29-0D-BD-86-B5-75-96-FF-B0-C8-9D-AD-4E-5B-94-58-57\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.Loader.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n      <ModuleName>System.Runtime.Loader</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"5C-37-15-25-14-5D-AA-CD-FE-A1-58-0B-02-CA-F0-06-3B-F0-75-3E\">\n      <ModulePath>SwitchCoverage\\UnitTestProject2\\bin\\Debug\\netcoreapp3.1\\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll</ModulePath>\n      <ModuleTime>2020-02-03T08:45:56Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"9D-1A-06-D1-57-63-4E-2B-7F-60-AB-7C-A1-0C-67-26-0C-72-0B-31\">\n      <ModulePath>SwitchCoverage\\UnitTestProject2\\bin\\Debug\\netcoreapp3.1\\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</ModulePath>\n      <ModuleTime>2020-02-03T08:42:14Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.TestFramework</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"14-23-11-33-8A-3E-C2-95-9C-AF-E0-44-A0-4E-01-93-24-28-69-36\">\n      <ModulePath>SwitchCoverage\\UnitTestProject2\\bin\\Debug\\netcoreapp3.1\\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll</ModulePath>\n      <ModuleTime>2020-02-03T08:43:54Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"18-52-46-8F-91-31-7C-89-18-7F-98-66-A5-FF-E4-26-5C-68-8E-0A\">\n      <ModulePath>SwitchCoverage\\UnitTestProject2\\bin\\Debug\\netcoreapp3.1\\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll</ModulePath>\n      <ModuleTime>2020-02-03T08:52:28Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"06-19-22-50-4F-B6-BD-65-A0-C7-8C-DE-34-EA-A5-8F-DC-ED-2D-B8\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.TestPlatform.Extensions.BlameDataCollector.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.Extensions.BlameDataCollector</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"73-E1-7F-C7-2D-C9-99-D8-D5-D4-21-69-B8-EB-65-4F-5D-EE-9F-B3\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:26Z</ModuleTime>\n      <ModuleName>System.Xml</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"2F-E1-13-B8-1E-10-AE-79-4A-CD-F8-AE-C1-F1-E8-22-10-2F-61-17\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Xml.ReaderWriter.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:28Z</ModuleTime>\n      <ModuleName>System.Xml.ReaderWriter</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"F2-84-10-73-D5-25-3C-C8-54-CA-05-A9-21-5F-EC-4F-D6-B7-11-E4\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\mscorlib.dll</ModulePath>\n      <ModuleTime>2020-02-21T02:00:46Z</ModuleTime>\n      <ModuleName>mscorlib</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"91-1A-F0-77-87-7A-78-F3-40-53-63-26-E3-B3-36-1E-8A-2C-E4-9C\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.TestPlatform.Extensions.EventLogCollector.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.Extensions.EventLogCollector</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"1D-26-3E-64-63-BC-40-62-7F-BA-67-38-AF-77-E8-9D-28-02-66-7C\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestTools.DataCollection.VideoRecorderCollector.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestTools.DataCollection.VideoRecorderCollector</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"60-03-96-F9-3B-1E-0D-18-F9-FE-FF-B9-4F-1B-28-3D-B7-20-39-7D\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestTools.DataCollection.MediaRecorder.Model.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestTools.DataCollection.MediaRecorder.Model</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"D5-C4-56-DC-17-09-1C-EA-87-1C-E8-F5-C7-29-D4-20-74-8C-96-35\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TraceDataCollector.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TraceDataCollector</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"88-C2-81-23-88-9B-01-F5-41-12-93-F2-07-C5-30-2F-E9-C7-6C-F6\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Core.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:34Z</ModuleTime>\n      <ModuleName>System.Core</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"4A-25-21-3A-BE-77-81-CD-7C-8A-13-F5-C1-EC-79-31-83-0D-13-AA\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.ArchitectureTools.PEReader.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.ArchitectureTools.PEReader</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"A4-7B-EB-61-14-FF-0A-F1-6C-B1-3D-60-27-46-D9-09-64-D7-5C-4A\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.StackTrace.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:36Z</ModuleTime>\n      <ModuleName>System.Diagnostics.StackTrace</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"F5-4A-B0-89-01-16-50-65-5F-DD-4C-B5-70-9E-39-1A-D1-B7-FE-38\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Reflection.Metadata.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n      <ModuleName>System.Reflection.Metadata</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"01-AB-1F-C1-0A-AD-1A-D5-69-41-9D-4B-4E-1C-6F-AC-59-05-9A-48\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Immutable.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n      <ModuleName>System.Collections.Immutable</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"A3-6E-3F-5C-23-E9-CE-D4-59-A4-79-82-3A-A2-A6-D2-A6-37-0E-C2\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Thread.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n      <ModuleName>System.Threading.Thread</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"08-F9-21-BB-3C-07-A4-DA-5A-43-89-51-EB-E0-A4-B9-2F-19-F6-7D\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.Algorithms.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:40Z</ModuleTime>\n      <ModuleName>System.Security.Cryptography.Algorithms</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"25-17-3D-BA-13-03-55-32-76-CF-3D-AE-B3-52-14-5F-95-F5-3E-85\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Threading.Timer.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:24Z</ModuleTime>\n      <ModuleName>System.Threading.Timer</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"57-E8-B3-F8-DB-88-F2-FB-81-BE-34-C3-AD-1E-D4-F0-DD-F0-59-D3\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Resources.ResourceManager.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:32Z</ModuleTime>\n      <ModuleName>System.Resources.ResourceManager</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"26-14-D7-B5-EB-43-C2-76-01-4F-01-5E-7B-A4-CE-E9-EB-E3-AA-B9\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Runtime.InteropServices.RuntimeInformation.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:36Z</ModuleTime>\n      <ModuleName>System.Runtime.InteropServices.RuntimeInformation</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"C1-E6-95-46-6B-22-AB-AD-8C-29-08-C6-4F-A8-BC-C8-E3-D9-B3-83\">\n      <ModulePath>SwitchCoverage\\UnitTestProject2\\bin\\Debug\\netcoreapp3.1\\NuGet.Frameworks.dll</ModulePath>\n      <ModuleTime>2019-04-01T16:23:50Z</ModuleTime>\n      <ModuleName>NuGet.Frameworks</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"4E-96-5A-FC-C0-BE-6F-D4-A5-9C-B4-F8-33-D5-85-D1-B9-07-9F-89\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Text.Encoding.Extensions.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:44Z</ModuleTime>\n      <ModuleName>System.Text.Encoding.Extensions</ModuleName>\n      <Classes />\n    </Module>\n    <Module hash=\"C4-7F-F9-78-0C-CD-56-0E-F3-63-61-42-3D-4F-F6-09-2A-5B-0B-53\">\n      <Summary numSequencePoints=\"10\" visitedSequencePoints=\"8\" numBranchPoints=\"3\" visitedBranchPoints=\"2\" sequenceCoverage=\"80\" branchCoverage=\"66.67\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"1\" visitedClasses=\"1\" numClasses=\"2\" visitedMethods=\"2\" numMethods=\"3\" />\n      <ModulePath>SwitchCoverage\\UnitTestProject2\\bin\\Debug\\netcoreapp3.1\\UnitTestProject2.dll</ModulePath>\n      <ModuleTime>2020-04-27T15:21:52.9041962Z</ModuleTime>\n      <ModuleName>UnitTestProject2</ModuleName>\n      <Files>\n        <File uid=\"1\" fullPath=\"C:\\Users\\Andrei\\.nuget\\packages\\microsoft.net.test.sdk\\16.5.0\\build\\netcoreapp2.1\\Microsoft.NET.Test.Sdk.Program.cs\" />\n        <File uid=\"2\" fullPath=\"SwitchCoverage\\UnitTestProject2\\UnitTest1.cs\" />\n      </Files>\n      <Classes>\n        <Class>\n          <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"0\" minCyclomaticComplexity=\"0\" maxCrapScore=\"0\" minCrapScore=\"0\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"0\" />\n          <FullName>&lt;Module&gt;</FullName>\n          <Methods />\n        </Class>\n        <Class>\n          <Summary numSequencePoints=\"2\" visitedSequencePoints=\"0\" numBranchPoints=\"1\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"2\" visitedClasses=\"0\" numClasses=\"1\" visitedMethods=\"0\" numMethods=\"1\" />\n          <FullName>AutoGeneratedProgram</FullName>\n          <Methods>\n            <Method visited=\"false\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" crapScore=\"2\" isConstructor=\"false\" isStatic=\"true\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"2\" visitedSequencePoints=\"0\" numBranchPoints=\"1\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"2\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"1\" />\n              <MetadataToken>100663297</MetadataToken>\n              <Name>System.Void AutoGeneratedProgram::Main(System.String[])</Name>\n              <FileRef uid=\"1\" />\n              <SequencePoints>\n                <SequencePoint vc=\"0\" uspid=\"1\" ordinal=\"0\" offset=\"0\" sl=\"4\" sc=\"60\" el=\"4\" ec=\"61\" bec=\"0\" bev=\"0\" fileid=\"1\" />\n                <SequencePoint vc=\"0\" uspid=\"2\" ordinal=\"1\" offset=\"1\" sl=\"4\" sc=\"61\" el=\"4\" ec=\"62\" bec=\"0\" bev=\"0\" fileid=\"1\" />\n              </SequencePoints>\n              <BranchPoints />\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"0\" uspid=\"1\" ordinal=\"0\" offset=\"0\" sl=\"4\" sc=\"60\" el=\"4\" ec=\"61\" bec=\"0\" bev=\"0\" fileid=\"1\" />\n            </Method>\n            <Method visited=\"false\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" crapScore=\"2\" isConstructor=\"true\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"2\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"0\" />\n              <MetadataToken>100663298</MetadataToken>\n              <Name>System.Void AutoGeneratedProgram::.ctor()</Name>\n              <SequencePoints />\n              <BranchPoints />\n              <MethodPoint vc=\"0\" uspid=\"3\" ordinal=\"0\" offset=\"0\" />\n            </Method>\n          </Methods>\n        </Class>\n        <Class>\n          <Summary numSequencePoints=\"8\" visitedSequencePoints=\"8\" numBranchPoints=\"2\" visitedBranchPoints=\"2\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"1\" visitedClasses=\"1\" numClasses=\"1\" visitedMethods=\"2\" numMethods=\"2\" />\n          <FullName>SwitchCoverageTest2.Tests</FullName>\n          <Methods>\n            <Method visited=\"true\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"100\" branchCoverage=\"100\" crapScore=\"1\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"4\" visitedSequencePoints=\"4\" numBranchPoints=\"1\" visitedBranchPoints=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"1\" minCrapScore=\"1\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"1\" numMethods=\"1\" />\n              <MetadataToken>100663299</MetadataToken>\n              <Name>System.Void SwitchCoverageTest2.Tests::Test1()</Name>\n              <FileRef uid=\"2\" />\n              <SequencePoints>\n                <SequencePoint vc=\"1\" uspid=\"4\" ordinal=\"0\" offset=\"0\" sl=\"12\" sc=\"9\" el=\"12\" ec=\"10\" bec=\"0\" bev=\"0\" fileid=\"2\" />\n                <SequencePoint vc=\"1\" uspid=\"5\" ordinal=\"1\" offset=\"1\" sl=\"13\" sc=\"13\" el=\"13\" ec=\"33\" bec=\"0\" bev=\"0\" fileid=\"2\" />\n                <SequencePoint vc=\"1\" uspid=\"6\" ordinal=\"2\" offset=\"7\" sl=\"14\" sc=\"13\" el=\"14\" ec=\"48\" bec=\"0\" bev=\"0\" fileid=\"2\" />\n                <SequencePoint vc=\"1\" uspid=\"7\" ordinal=\"3\" offset=\"25\" sl=\"15\" sc=\"9\" el=\"15\" ec=\"10\" bec=\"0\" bev=\"0\" fileid=\"2\" />\n              </SequencePoints>\n              <BranchPoints />\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"1\" uspid=\"4\" ordinal=\"0\" offset=\"0\" sl=\"12\" sc=\"9\" el=\"12\" ec=\"10\" bec=\"0\" bev=\"0\" fileid=\"2\" />\n            </Method>\n            <Method visited=\"true\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"100\" branchCoverage=\"100\" crapScore=\"1\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"4\" visitedSequencePoints=\"4\" numBranchPoints=\"1\" visitedBranchPoints=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"1\" minCrapScore=\"1\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"1\" numMethods=\"1\" />\n              <MetadataToken>100663300</MetadataToken>\n              <Name>System.Void SwitchCoverageTest2.Tests::Test3()</Name>\n              <FileRef uid=\"2\" />\n              <SequencePoints>\n                <SequencePoint vc=\"1\" uspid=\"8\" ordinal=\"0\" offset=\"0\" sl=\"19\" sc=\"9\" el=\"19\" ec=\"10\" bec=\"0\" bev=\"0\" fileid=\"2\" />\n                <SequencePoint vc=\"1\" uspid=\"9\" ordinal=\"1\" offset=\"1\" sl=\"20\" sc=\"13\" el=\"20\" ec=\"33\" bec=\"0\" bev=\"0\" fileid=\"2\" />\n                <SequencePoint vc=\"1\" uspid=\"10\" ordinal=\"2\" offset=\"7\" sl=\"21\" sc=\"13\" el=\"21\" ec=\"50\" bec=\"0\" bev=\"0\" fileid=\"2\" />\n                <SequencePoint vc=\"1\" uspid=\"11\" ordinal=\"3\" offset=\"25\" sl=\"22\" sc=\"9\" el=\"22\" ec=\"10\" bec=\"0\" bev=\"0\" fileid=\"2\" />\n              </SequencePoints>\n              <BranchPoints />\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"1\" uspid=\"8\" ordinal=\"0\" offset=\"0\" sl=\"19\" sc=\"9\" el=\"19\" ec=\"10\" bec=\"0\" bev=\"0\" fileid=\"2\" />\n            </Method>\n            <Method visited=\"false\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" crapScore=\"2\" isConstructor=\"true\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"2\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"0\" />\n              <MetadataToken>100663301</MetadataToken>\n              <Name>System.Void SwitchCoverageTest2.Tests::.ctor()</Name>\n              <SequencePoints />\n              <BranchPoints />\n              <MethodPoint vc=\"0\" uspid=\"12\" ordinal=\"0\" offset=\"0\" />\n            </Method>\n          </Methods>\n        </Class>\n      </Classes>\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"31-48-4C-D9-B7-64-1C-85-5D-80-A0-AB-74-1E-29-E1-94-43-80-C0\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.IO.FileSystem.Primitives.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:42Z</ModuleTime>\n      <ModuleName>System.IO.FileSystem.Primitives</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"48-69-8F-D3-34-45-06-46-29-98-3A-0A-71-C5-1A-6D-78-02-46-35\">\n      <ModulePath>SwitchCoverage\\UnitTestProject2\\bin\\Debug\\netcoreapp3.1\\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</ModulePath>\n      <ModuleTime>2020-02-03T08:43:06Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"6D-0F-A0-D8-6E-D9-3D-12-46-84-DE-CC-44-CE-CF-2B-96-27-29-EA\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.ComponentModel.TypeConverter.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:32Z</ModuleTime>\n      <ModuleName>System.ComponentModel.TypeConverter</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"8F-A1-95-7C-65-A0-95-11-53-8D-DF-11-6D-3C-AD-5D-AE-2F-D3-73\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Collections.Concurrent.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:24Z</ModuleTime>\n      <ModuleName>System.Collections.Concurrent</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"D0-59-FE-7C-7F-0D-36-55-42-D4-35-5B-11-52-FF-15-85-1C-6D-DB\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Diagnostics.TextWriterTraceListener.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:36Z</ModuleTime>\n      <ModuleName>System.Diagnostics.TextWriterTraceListener</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"32-5D-5E-82-60-49-7F-5D-44-D4-1E-BF-57-95-6F-D8-30-A6-C2-E1\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Console.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:05:30Z</ModuleTime>\n      <ModuleName>System.Console</ModuleName>\n      <Classes />\n    </Module>\n    <Module hash=\"BB-9C-0F-8E-5F-FC-F9-90-9C-2F-D8-CF-15-63-3A-5B-F3-6D-AE-DE\">\n      <Summary numSequencePoints=\"1\" visitedSequencePoints=\"1\" numBranchPoints=\"9\" visitedBranchPoints=\"6\" sequenceCoverage=\"100\" branchCoverage=\"66.67\" maxCyclomaticComplexity=\"5\" minCyclomaticComplexity=\"1\" maxCrapScore=\"5\" minCrapScore=\"2\" visitedClasses=\"1\" numClasses=\"1\" visitedMethods=\"1\" numMethods=\"1\" />\n      <ModulePath>SwitchCoverage\\UnitTestProject2\\bin\\Debug\\netcoreapp3.1\\SwitchCoverage.dll</ModulePath>\n      <ModuleTime>2020-04-27T15:20:56.9319773Z</ModuleTime>\n      <ModuleName>SwitchCoverage</ModuleName>\n      <Files>\n        <File uid=\"5\" fullPath=\"SwitchCoverage\\SwitchCoverage\\Foo.cs\" />\n      </Files>\n      <Classes>\n        <Class>\n          <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"0\" minCyclomaticComplexity=\"0\" maxCrapScore=\"0\" minCrapScore=\"0\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"0\" />\n          <FullName>&lt;Module&gt;</FullName>\n          <Methods />\n        </Class>\n        <Class>\n          <Summary numSequencePoints=\"1\" visitedSequencePoints=\"1\" numBranchPoints=\"9\" visitedBranchPoints=\"6\" sequenceCoverage=\"100\" branchCoverage=\"66.67\" maxCyclomaticComplexity=\"5\" minCyclomaticComplexity=\"1\" maxCrapScore=\"5\" minCrapScore=\"2\" visitedClasses=\"1\" numClasses=\"1\" visitedMethods=\"1\" numMethods=\"1\" />\n          <FullName>SwitchCoverage.Foo</FullName>\n          <Methods>\n            <Method visited=\"true\" cyclomaticComplexity=\"5\" nPathComplexity=\"16\" sequenceCoverage=\"100\" branchCoverage=\"66.67\" crapScore=\"5\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"1\" visitedSequencePoints=\"1\" numBranchPoints=\"9\" visitedBranchPoints=\"6\" sequenceCoverage=\"100\" branchCoverage=\"66.67\" maxCyclomaticComplexity=\"5\" minCyclomaticComplexity=\"5\" maxCrapScore=\"5\" minCrapScore=\"5\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"1\" numMethods=\"1\" />\n              <MetadataToken>100663297</MetadataToken>\n              <Name>System.Int32 SwitchCoverage.Foo::Bar(System.String)</Name>\n              <FileRef uid=\"5\" />\n              <SequencePoints>\n                <SequencePoint vc=\"2\" uspid=\"13\" ordinal=\"0\" offset=\"0\" sl=\"8\" sc=\"13\" el=\"14\" ec=\"14\" bec=\"7\" bev=\"5\" fileid=\"5\" />\n              </SequencePoints>\n              <BranchPoints>\n                <BranchPoint vc=\"2\" uspid=\"14\" ordinal=\"0\" offset=\"1\" sl=\"8\" path=\"0\" offsetend=\"3\" fileid=\"5\" />\n                <BranchPoint vc=\"0\" uspid=\"15\" ordinal=\"1\" offset=\"1\" sl=\"8\" path=\"1\" offsetend=\"56\" fileid=\"5\" />\n                <BranchPoint vc=\"1\" uspid=\"16\" ordinal=\"2\" offset=\"14\" sl=\"8\" path=\"0\" offsetend=\"16\" fileid=\"5\" />\n                <BranchPoint vc=\"1\" uspid=\"17\" ordinal=\"3\" offset=\"14\" sl=\"8\" path=\"1\" offsetend=\"44\" fileid=\"5\" />\n                <BranchPoint vc=\"1\" uspid=\"18\" ordinal=\"4\" offset=\"27\" sl=\"8\" path=\"0\" offsetend=\"29\" fileid=\"5\" />\n                <BranchPoint vc=\"0\" uspid=\"19\" ordinal=\"5\" offset=\"27\" sl=\"8\" path=\"1\" offsetend=\"48\" fileid=\"5\" />\n                <BranchPoint vc=\"0\" uspid=\"20\" ordinal=\"6\" offset=\"40\" sl=\"8\" path=\"0\" offsetchain=\"42\" offsetend=\"56\" fileid=\"5\" />\n                <BranchPoint vc=\"1\" uspid=\"21\" ordinal=\"7\" offset=\"40\" sl=\"8\" path=\"1\" offsetend=\"52\" fileid=\"5\" />\n              </BranchPoints>\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"2\" uspid=\"13\" ordinal=\"0\" offset=\"0\" sl=\"8\" sc=\"13\" el=\"14\" ec=\"14\" bec=\"7\" bev=\"5\" fileid=\"5\" />\n            </Method>\n            <Method visited=\"false\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" crapScore=\"2\" isConstructor=\"true\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"2\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"0\" />\n              <MetadataToken>100663298</MetadataToken>\n              <Name>System.Void SwitchCoverage.Foo::.ctor()</Name>\n              <SequencePoints />\n              <BranchPoints />\n              <MethodPoint vc=\"0\" uspid=\"22\" ordinal=\"0\" offset=\"0\" />\n            </Method>\n          </Methods>\n        </Class>\n      </Classes>\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"55-8E-C2-A5-09-4D-3F-8C-11-59-AB-41-D5-05-B5-7B-8D-3A-AA-6E\">\n      <ModulePath>C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\3.1.3\\System.Security.Cryptography.Primitives.dll</ModulePath>\n      <ModuleTime>2020-02-28T19:04:42Z</ModuleTime>\n      <ModuleName>System.Security.Cryptography.Primitives</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"AA-A1-B5-37-5B-A3-3F-60-8A-4D-0B-A0-48-E4-49-D8-49-E0-96-D9\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\SMDiagnostics\\v4.0_4.0.0.0__b77a5c561934e089\\SMDiagnostics.dll</ModulePath>\n      <ModuleTime>2020-01-09T19:46:54Z</ModuleTime>\n      <ModuleName>SMDiagnostics</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"BB-80-4D-57-28-4C-C5-76-72-6F-11-E7-E6-86-43-26-A9-62-89-CD\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.ServiceModel.Internals\\v4.0_4.0.0.0__31bf3856ad364e35\\System.ServiceModel.Internals.dll</ModulePath>\n      <ModuleTime>2020-01-09T19:46:54Z</ModuleTime>\n      <ModuleName>System.ServiceModel.Internals</ModuleName>\n      <Classes />\n    </Module>\n  </Modules>\n</CoverageSession>"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/opencover/valid.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<CoverageSession xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n  <Summary numSequencePoints=\"28\" visitedSequencePoints=\"20\" numBranchPoints=\"12\" visitedBranchPoints=\"8\" sequenceCoverage=\"71.43\" branchCoverage=\"66.67\" maxCyclomaticComplexity=\"4\" minCyclomaticComplexity=\"1\" />\n  <Modules>\n    <Module skippedDueTo=\"Filter\" hash=\"54-D4-51-C6-FF-08-C9-23-DD-60-29-FB-72-FC-DE-35-B4-41-DA-06\">\n      <FullName>C:\\Windows\\assembly\\GAC_64\\mscorlib\\2.0.0.0__b77a5c561934e089\\mscorlib.dll</FullName>\n      <ModuleName>mscorlib</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"F9-04-A8-31-CD-FB-23-72-95-63-5D-14-9A-A0-66-8E-7F-44-93-7A\">\n      <FullName>C:\\Windows\\assembly\\GAC_64\\mscorlib\\2.0.0.0__b77a5c561934e089\\sorttbls.nlp</FullName>\n      <ModuleName>mscorlib</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"6E-30-2E-50-36-FB-60-2C-8E-50-C0-83-54-8B-CC-EA-A8-91-B6-CC\">\n      <FullName>C:\\Windows\\assembly\\GAC_64\\mscorlib\\2.0.0.0__b77a5c561934e089\\sortkey.nlp</FullName>\n      <ModuleName>mscorlib</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"F9-CA-B6-79-63-CB-31-8A-0D-DC-C3-D0-43-F8-28-C3-F0-95-F9-E7\">\n      <FullName>c:\\Program Files (x86)\\NUnit 2.6.3\\bin\\nunit-console.exe</FullName>\n      <ModuleName>nunit-console</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"2A-C4-E5-DE-F3-EE-AD-84-E1-65-84-CC-15-90-76-96-E7-01-44-4E\">\n      <FullName>C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\lib\\nunit-console-runner.dll</FullName>\n      <ModuleName>nunit-console-runner</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"33-E1-CA-24-52-5A-B7-C7-C4-AF-91-2C-A9-4A-C0-37-67-0D-5B-FE\">\n      <FullName>C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\lib\\nunit.core.dll</FullName>\n      <ModuleName>nunit.core</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"74-74-F6-87-59-E1-5F-4F-5F-5E-6E-82-50-E8-E2-46-D4-86-15-76\">\n      <FullName>C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\lib\\nunit.util.dll</FullName>\n      <ModuleName>nunit.util</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"D3-A4-4D-85-55-F7-CE-EF-A5-90-AA-EF-58-E0-9F-B6-CC-27-99-53\">\n      <FullName>C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\lib\\nunit.core.interfaces.dll</FullName>\n      <ModuleName>nunit.core.interfaces</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"2C-99-EE-29-D5-25-03-C4-0E-40-26-9B-F7-DF-C2-68-6E-74-74-31\">\n      <FullName>C:\\Windows\\assembly\\GAC_MSIL\\System.Configuration\\2.0.0.0__b03f5f7f11d50a3a\\System.Configuration.dll</FullName>\n      <ModuleName>System.Configuration</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"D3-99-70-9D-4C-FD-70-CC-82-00-AA-75-7A-54-8C-25-AC-54-B1-BF\">\n      <FullName>C:\\Windows\\assembly\\GAC_MSIL\\System\\2.0.0.0__b77a5c561934e089\\System.dll</FullName>\n      <ModuleName>System</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"C4-AD-0A-97-FF-1D-61-5F-88-89-A6-25-BD-02-5E-E5-F5-1D-6F-20\">\n      <FullName>C:\\Windows\\assembly\\GAC_MSIL\\System.Xml\\2.0.0.0__b77a5c561934e089\\System.Xml.dll</FullName>\n      <ModuleName>System.Xml</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"92-44-10-37-4C-84-2D-65-E3-A0-6A-B9-9F-01-42-6A-27-41-4A-8C\">\n      <FullName>C:\\Windows\\assembly\\GAC_MSIL\\System.Runtime.Remoting\\2.0.0.0__b77a5c561934e089\\System.Runtime.Remoting.dll</FullName>\n      <ModuleName>System.Runtime.Remoting</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"E1-6B-09-74-39-13-D1-98-9B-D2-7B-04-C8-8F-57-18-D7-9F-22-BA\">\n      <FullName>C:\\Windows\\Microsoft.Net\\assembly\\GAC_64\\mscorlib\\v4.0_4.0.0.0__b77a5c561934e089\\mscorlib.dll</FullName>\n      <ModuleName>mscorlib</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"87-52-C5-B2-2F-D3-F5-4F-58-BF-89-4A-88-59-6D-CE-F4-7F-6A-3B\">\n      <FullName>C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\nunit-agent.exe</FullName>\n      <ModuleName>nunit-agent</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"33-E1-CA-24-52-5A-B7-C7-C4-AF-91-2C-A9-4A-C0-37-67-0D-5B-FE\">\n      <FullName>C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\lib\\nunit.core.dll</FullName>\n      <ModuleName>nunit.core</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"74-74-F6-87-59-E1-5F-4F-5F-5E-6E-82-50-E8-E2-46-D4-86-15-76\">\n      <FullName>C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\lib\\nunit.util.dll</FullName>\n      <ModuleName>nunit.util</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"D3-A4-4D-85-55-F7-CE-EF-A5-90-AA-EF-58-E0-9F-B6-CC-27-99-53\">\n      <FullName>C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\lib\\nunit.core.interfaces.dll</FullName>\n      <ModuleName>nunit.core.interfaces</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"1B-30-81-91-69-2E-50-BD-B9-CC-A1-5B-46-3A-D5-62-E3-7E-58-C4\">\n      <FullName>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System\\v4.0_4.0.0.0__b77a5c561934e089\\System.dll</FullName>\n      <ModuleName>System</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"E8-47-7A-41-67-F7-5A-91-1D-B2-1A-48-85-F5-81-AF-DE-91-B4-C2\">\n      <FullName>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Runtime.Remoting\\v4.0_4.0.0.0__b77a5c561934e089\\System.Runtime.Remoting.dll</FullName>\n      <ModuleName>System.Runtime.Remoting</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"57-C7-F0-53-3B-97-01-CD-67-C1-80-37-68-7F-8F-89-D0-76-B4-48\">\n      <FullName>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Configuration\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Configuration.dll</FullName>\n      <ModuleName>System.Configuration</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"88-AF-AF-B3-FF-8A-DE-A7-50-A8-49-A8-87-FF-70-25-57-19-89-27\">\n      <FullName>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Xml\\v4.0_4.0.0.0__b77a5c561934e089\\System.Xml.dll</FullName>\n      <ModuleName>System.Xml</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"37-B7-01-DE-3F-2D-BD-A2-E5-87-BA-4F-BE-B4-83-E0-93-20-AD-5A\">\n      <FullName>C:\\Windows\\Microsoft.Net\\assembly\\GAC_64\\System.Web\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Web.dll</FullName>\n      <ModuleName>System.Web</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"F6-A6-9F-51-A3-09-AC-3A-FF-DB-AE-4D-25-AE-9C-74-61-4E-0C-75\">\n      <FullName>C:\\Windows\\assembly\\GAC_64\\System.Web\\2.0.0.0__b03f5f7f11d50a3a\\System.Web.dll</FullName>\n      <ModuleName>System.Web</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"33-E1-CA-24-52-5A-B7-C7-C4-AF-91-2C-A9-4A-C0-37-67-0D-5B-FE\">\n      <FullName>C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\lib\\nunit.core.dll</FullName>\n      <ModuleName>nunit.core</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"1B-30-81-91-69-2E-50-BD-B9-CC-A1-5B-46-3A-D5-62-E3-7E-58-C4\">\n      <FullName>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System\\v4.0_4.0.0.0__b77a5c561934e089\\System.dll</FullName>\n      <ModuleName>System</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"88-AF-AF-B3-FF-8A-DE-A7-50-A8-49-A8-87-FF-70-25-57-19-89-27\">\n      <FullName>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Xml\\v4.0_4.0.0.0__b77a5c561934e089\\System.Xml.dll</FullName>\n      <ModuleName>System.Xml</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"57-C7-F0-53-3B-97-01-CD-67-C1-80-37-68-7F-8F-89-D0-76-B4-48\">\n      <FullName>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Configuration\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Configuration.dll</FullName>\n      <ModuleName>System.Configuration</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"D3-A4-4D-85-55-F7-CE-EF-A5-90-AA-EF-58-E0-9F-B6-CC-27-99-53\">\n      <FullName>C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\lib\\nunit.core.interfaces.dll</FullName>\n      <ModuleName>nunit.core.interfaces</ModuleName>\n      <Classes />\n    </Module>\n    <Module hash=\"DE-2D-20-DB-C7-7A-F5-8E-3C-33-9B-1D-83-2A-1E-48-F8-A8-EB-7B\">\n      <Summary numSequencePoints=\"6\" visitedSequencePoints=\"6\" numBranchPoints=\"2\" visitedBranchPoints=\"2\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n      <FullName>C:\\Users\\Dinesh\\Documents\\Visual Studio 2010\\Projects\\CSharpPlayground\\MyLibraryNUnitTest\\bin\\Debug\\MyLibraryNUnitTest.dll</FullName>\n      <ModuleName>MyLibraryNUnitTest</ModuleName>\n      <Files>\n        <File uid=\"1\" fullPath=\"MyLibraryNUnitTest\\AdderNUnitTest.cs\" />\n      </Files>\n      <Classes>\n        <Class>\n          <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"0\" minCyclomaticComplexity=\"0\" />\n          <FullName>&lt;Module&gt;</FullName>\n          <Methods />\n        </Class>\n        <Class>\n          <Summary numSequencePoints=\"6\" visitedSequencePoints=\"6\" numBranchPoints=\"2\" visitedBranchPoints=\"2\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n          <FullName>MyLibraryNUnitTest.AdderNUnitTest</FullName>\n          <Methods>\n            <Method visited=\"true\" cyclomaticComplexity=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"3\" visitedSequencePoints=\"3\" numBranchPoints=\"1\" visitedBranchPoints=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n              <MetadataToken>100663297</MetadataToken>\n              <Name>System.Void MyLibraryNUnitTest.AdderNUnitTest::Add()</Name>\n              <FileRef uid=\"1\" />\n              <SequencePoints>\n                <SequencePoint vc=\"1\" uspid=\"1\" ordinal=\"0\" offset=\"0\" sl=\"16\" sc=\"9\" el=\"16\" ec=\"10\" />\n                <SequencePoint vc=\"1\" uspid=\"2\" ordinal=\"1\" offset=\"1\" sl=\"17\" sc=\"13\" el=\"17\" ec=\"51\" />\n                <SequencePoint vc=\"1\" uspid=\"3\" ordinal=\"2\" offset=\"17\" sl=\"18\" sc=\"9\" el=\"18\" ec=\"10\" />\n              </SequencePoints>\n              <BranchPoints />\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"1\" uspid=\"1\" ordinal=\"0\" offset=\"0\" sl=\"16\" sc=\"9\" el=\"16\" ec=\"10\" />\n            </Method>\n            <Method visited=\"true\" cyclomaticComplexity=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"3\" visitedSequencePoints=\"3\" numBranchPoints=\"1\" visitedBranchPoints=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n              <MetadataToken>100663298</MetadataToken>\n              <Name>System.Void MyLibraryNUnitTest.AdderNUnitTest::Add2()</Name>\n              <FileRef uid=\"1\" />\n              <SequencePoints>\n                <SequencePoint vc=\"1\" uspid=\"4\" ordinal=\"0\" offset=\"0\" sl=\"22\" sc=\"9\" el=\"22\" ec=\"10\" />\n                <SequencePoint vc=\"1\" uspid=\"5\" ordinal=\"1\" offset=\"1\" sl=\"23\" sc=\"13\" el=\"23\" ec=\"51\" />\n                <SequencePoint vc=\"1\" uspid=\"6\" ordinal=\"2\" offset=\"17\" sl=\"24\" sc=\"9\" el=\"24\" ec=\"10\" />\n              </SequencePoints>\n              <BranchPoints />\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"1\" uspid=\"4\" ordinal=\"0\" offset=\"0\" sl=\"22\" sc=\"9\" el=\"22\" ec=\"10\" />\n            </Method>\n            <Method visited=\"true\" cyclomaticComplexity=\"1\" sequenceCoverage=\"0\" branchCoverage=\"0\" isConstructor=\"true\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n              <MetadataToken>100663299</MetadataToken>\n              <Name>System.Void MyLibraryNUnitTest.AdderNUnitTest::.ctor()</Name>\n              <SequencePoints />\n              <BranchPoints />\n              <MethodPoint vc=\"1\" uspid=\"7\" ordinal=\"0\" offset=\"0\" />\n            </Method>\n          </Methods>\n        </Class>\n      </Classes>\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"42-83-FE-A6-9F-01-8E-2C-E8-41-E9-25-3E-1E-0D-99-81-76-6B-C9\">\n      <FullName>C:\\Users\\Dinesh\\Documents\\Visual Studio 2010\\Projects\\CSharpPlayground\\MyLibraryNUnitTest\\bin\\Debug\\nunit.framework.dll</FullName>\n      <ModuleName>nunit.framework</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"2A-C4-E5-DE-F3-EE-AD-84-E1-65-84-CC-15-90-76-96-E7-01-44-4E\">\n      <FullName>C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\lib\\nunit-console-runner.dll</FullName>\n      <ModuleName>nunit-console-runner</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"E8-47-7A-41-67-F7-5A-91-1D-B2-1A-48-85-F5-81-AF-DE-91-B4-C2\">\n      <FullName>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Runtime.Remoting\\v4.0_4.0.0.0__b77a5c561934e089\\System.Runtime.Remoting.dll</FullName>\n      <ModuleName>System.Runtime.Remoting</ModuleName>\n      <Classes />\n    </Module>\n    <Module hash=\"B1-CF-91-59-2E-7C-F5-48-46-09-DF-45-D3-08-55-46-D8-A2-AD-BE\">\n      <Summary numSequencePoints=\"22\" visitedSequencePoints=\"14\" numBranchPoints=\"10\" visitedBranchPoints=\"6\" sequenceCoverage=\"63.64\" branchCoverage=\"60\" maxCyclomaticComplexity=\"4\" minCyclomaticComplexity=\"1\" />\n      <FullName>C:\\Users\\Dinesh\\Documents\\Visual Studio 2010\\Projects\\CSharpPlayground\\MyLibraryNUnitTest\\bin\\Debug\\MyLibrary.dll</FullName>\n      <ModuleName>MyLibrary</ModuleName>\n      <Files>\n        <File uid=\"3\" fullPath=\"MyLibrary\\Adder.cs\" />\n        <File uid=\"4\" fullPath=\"MyLibrary\\Multiplier.cs\" />\n      </Files>\n      <Classes>\n        <Class>\n          <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"0\" minCyclomaticComplexity=\"0\" />\n          <FullName>&lt;Module&gt;</FullName>\n          <Methods />\n        </Class>\n        <Class>\n          <Summary numSequencePoints=\"19\" visitedSequencePoints=\"14\" numBranchPoints=\"9\" visitedBranchPoints=\"6\" sequenceCoverage=\"73.68\" branchCoverage=\"66.67\" maxCyclomaticComplexity=\"4\" minCyclomaticComplexity=\"1\" />\n          <FullName>MyLibrary.Adder</FullName>\n          <Methods>\n            <Method visited=\"true\" cyclomaticComplexity=\"4\" sequenceCoverage=\"61.54\" branchCoverage=\"57.14\" isConstructor=\"false\" isStatic=\"true\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"13\" visitedSequencePoints=\"8\" numBranchPoints=\"7\" visitedBranchPoints=\"4\" sequenceCoverage=\"61.54\" branchCoverage=\"57.14\" maxCyclomaticComplexity=\"4\" minCyclomaticComplexity=\"4\" />\n              <MetadataToken>100663297</MetadataToken>\n              <Name>System.Int32 MyLibrary.Adder::Add(System.Int32,System.Int32)</Name>\n              <FileRef uid=\"3\" />\n              <SequencePoints>\n                <SequencePoint vc=\"2\" uspid=\"8\" ordinal=\"0\" offset=\"0\" sl=\"11\" sc=\"9\" el=\"11\" ec=\"10\" />\n                <SequencePoint vc=\"2\" uspid=\"9\" ordinal=\"1\" offset=\"1\" sl=\"12\" sc=\"13\" el=\"12\" ec=\"36\" />\n                <SequencePoint vc=\"0\" uspid=\"10\" ordinal=\"2\" offset=\"23\" sl=\"13\" sc=\"13\" el=\"13\" ec=\"14\" />\n                <SequencePoint vc=\"0\" uspid=\"11\" ordinal=\"3\" offset=\"24\" sl=\"14\" sc=\"17\" el=\"14\" ec=\"52\" />\n                <SequencePoint vc=\"0\" uspid=\"12\" ordinal=\"4\" offset=\"35\" sl=\"15\" sc=\"17\" el=\"15\" ec=\"52\" />\n                <SequencePoint vc=\"0\" uspid=\"13\" ordinal=\"5\" offset=\"46\" sl=\"18\" sc=\"13\" el=\"18\" ec=\"14\" />\n                <SequencePoint vc=\"2\" uspid=\"14\" ordinal=\"6\" offset=\"49\" sl=\"18\" sc=\"20\" el=\"18\" ec=\"50\" />\n                <SequencePoint vc=\"2\" uspid=\"15\" ordinal=\"7\" offset=\"60\" sl=\"22\" sc=\"13\" el=\"22\" ec=\"47\" />\n                <SequencePoint vc=\"2\" uspid=\"16\" ordinal=\"8\" offset=\"71\" sl=\"22\" sc=\"48\" el=\"22\" ec=\"60\" />\n                <SequencePoint vc=\"2\" uspid=\"17\" ordinal=\"9\" offset=\"83\" sl=\"22\" sc=\"61\" el=\"22\" ec=\"90\" />\n                <SequencePoint vc=\"0\" uspid=\"18\" ordinal=\"10\" offset=\"96\" sl=\"22\" sc=\"96\" el=\"22\" ec=\"129\" />\n                <SequencePoint vc=\"2\" uspid=\"19\" ordinal=\"11\" offset=\"107\" sl=\"26\" sc=\"13\" el=\"26\" ec=\"30\" />\n\n                <!-- Moved below to test SONARNTEST-31\n                <SequencePoint vc=\"2\" uspid=\"20\" ordinal=\"12\" offset=\"113\" sl=\"27\" sc=\"9\" el=\"27\" ec=\"10\" />\n                -->\n              </SequencePoints>\n              <BranchPoints>\n                <BranchPoint vc=\"2\" uspid=\"21\" ordinal=\"0\" offset=\"6\" path=\"0\" />\n                <BranchPoint vc=\"0\" uspid=\"22\" ordinal=\"1\" offset=\"6\" path=\"1\" />\n                <BranchPoint vc=\"0\" uspid=\"23\" ordinal=\"2\" offset=\"21\" path=\"0\" />\n                <BranchPoint vc=\"2\" uspid=\"24\" ordinal=\"3\" offset=\"21\" path=\"1\" />\n                <BranchPoint vc=\"2\" uspid=\"25\" ordinal=\"4\" offset=\"81\" path=\"0\" />\n                <BranchPoint vc=\"0\" uspid=\"26\" ordinal=\"5\" offset=\"81\" path=\"1\" />\n              </BranchPoints>\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"2\" uspid=\"8\" ordinal=\"0\" offset=\"0\" sl=\"11\" sc=\"9\" el=\"11\" ec=\"10\" />\n            </Method>\n            <Method visited=\"true\" cyclomaticComplexity=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" isConstructor=\"false\" isStatic=\"true\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"3\" visitedSequencePoints=\"3\" numBranchPoints=\"1\" visitedBranchPoints=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n              <MetadataToken>100663298</MetadataToken>\n              <Name>System.Boolean MyLibrary.Adder::Test1()</Name>\n              <FileRef uid=\"3\" />\n              <SequencePoints>\n                <SequencePoint vc=\"4\" uspid=\"27\" ordinal=\"0\" offset=\"0\" sl=\"30\" sc=\"9\" el=\"30\" ec=\"10\" />\n                <SequencePoint vc=\"4\" uspid=\"28\" ordinal=\"1\" offset=\"1\" sl=\"31\" sc=\"13\" el=\"31\" ec=\"25\" />\n                <SequencePoint vc=\"4\" uspid=\"29\" ordinal=\"2\" offset=\"5\" sl=\"32\" sc=\"9\" el=\"32\" ec=\"10\" />\n              </SequencePoints>\n              <BranchPoints />\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"4\" uspid=\"27\" ordinal=\"0\" offset=\"0\" sl=\"30\" sc=\"9\" el=\"30\" ec=\"10\" />\n            </Method>\n            <Method visited=\"true\" cyclomaticComplexity=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" isConstructor=\"false\" isStatic=\"true\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"3\" visitedSequencePoints=\"3\" numBranchPoints=\"1\" visitedBranchPoints=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n              <MetadataToken>100663299</MetadataToken>\n              <Name>System.Boolean MyLibrary.Adder::Test2()</Name>\n              <FileRef uid=\"3\" />\n              <SequencePoints>\n                <SequencePoint vc=\"2\" uspid=\"30\" ordinal=\"0\" offset=\"0\" sl=\"35\" sc=\"9\" el=\"35\" ec=\"10\" />\n                <SequencePoint vc=\"2\" uspid=\"31\" ordinal=\"1\" offset=\"1\" sl=\"36\" sc=\"13\" el=\"36\" ec=\"26\" />\n                <SequencePoint vc=\"2\" uspid=\"32\" ordinal=\"2\" offset=\"5\" sl=\"37\" sc=\"9\" el=\"37\" ec=\"10\" />\n              </SequencePoints>\n              <BranchPoints />\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"2\" uspid=\"30\" ordinal=\"0\" offset=\"0\" sl=\"35\" sc=\"9\" el=\"35\" ec=\"10\" />\n            </Method>\n            <Method visited=\"false\" cyclomaticComplexity=\"1\" sequenceCoverage=\"0\" branchCoverage=\"0\" isConstructor=\"true\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n              <MetadataToken>100663300</MetadataToken>\n              <Name>System.Void MyLibrary.Adder::.ctor()</Name>\n              <SequencePoints />\n              <BranchPoints />\n              <MethodPoint vc=\"0\" uspid=\"33\" ordinal=\"0\" offset=\"0\" />\n            </Method>\n          </Methods>\n        </Class>\n        <Class>\n          <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n          <FullName>Foo.A</FullName>\n          <Methods>\n            <Method visited=\"false\" cyclomaticComplexity=\"1\" sequenceCoverage=\"0\" branchCoverage=\"0\" isConstructor=\"true\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n              <MetadataToken>100663301</MetadataToken>\n              <Name>System.Void Foo.A::.ctor()</Name>\n              <SequencePoints />\n              <BranchPoints />\n              <MethodPoint vc=\"0\" uspid=\"34\" ordinal=\"0\" offset=\"0\" />\n            </Method>\n          </Methods>\n        </Class>\n        <Class>\n          <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n          <FullName>Foo.A`1</FullName>\n          <Methods>\n            <Method visited=\"false\" cyclomaticComplexity=\"1\" sequenceCoverage=\"0\" branchCoverage=\"0\" isConstructor=\"true\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n              <MetadataToken>100663302</MetadataToken>\n              <Name>System.Void Foo.A`1::.ctor()</Name>\n              <SequencePoints />\n              <BranchPoints />\n              <MethodPoint vc=\"0\" uspid=\"35\" ordinal=\"0\" offset=\"0\" />\n            </Method>\n          </Methods>\n        </Class>\n        <Class>\n          <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n          <FullName>Foo.A`2</FullName>\n          <Methods>\n            <Method visited=\"false\" cyclomaticComplexity=\"1\" sequenceCoverage=\"0\" branchCoverage=\"0\" isConstructor=\"true\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n              <MetadataToken>100663303</MetadataToken>\n              <Name>System.Void Foo.A`2::.ctor()</Name>\n              <SequencePoints />\n              <BranchPoints />\n              <MethodPoint vc=\"0\" uspid=\"36\" ordinal=\"0\" offset=\"0\" />\n            </Method>\n          </Methods>\n        </Class>\n        <Class>\n          <Summary numSequencePoints=\"3\" visitedSequencePoints=\"0\" numBranchPoints=\"1\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n          <FullName>MyLibrary.Multiplier</FullName>\n          <Methods>\n            <Method visited=\"false\" cyclomaticComplexity=\"1\" sequenceCoverage=\"0\" branchCoverage=\"0\" isConstructor=\"false\" isStatic=\"true\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"3\" visitedSequencePoints=\"0\" numBranchPoints=\"1\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n              <MetadataToken>100663304</MetadataToken>\n              <Name>System.Int32 MyLibrary.Multiplier::Multiply(System.Int32,System.Int32)</Name>\n              <FileRef uid=\"4\" />\n              <SequencePoints>\n                <SequencePoint vc=\"0\" uspid=\"37\" ordinal=\"0\" offset=\"0\" sl=\"11\" sc=\"9\" el=\"11\" ec=\"10\" />\n                <SequencePoint vc=\"0\" uspid=\"38\" ordinal=\"1\" offset=\"1\" sl=\"12\" sc=\"13\" el=\"12\" ec=\"30\" />\n                <SequencePoint vc=\"0\" uspid=\"39\" ordinal=\"2\" offset=\"7\" sl=\"13\" sc=\"9\" el=\"13\" ec=\"10\" />\n\n                <!-- SONARNTEST-31 -->\n                <SequencePoint vc=\"2\" uspid=\"20\" ordinal=\"12\" offset=\"113\" sl=\"27\" sc=\"9\" el=\"27\" ec=\"10\" fileid=\"3\" />\n              </SequencePoints>\n              <BranchPoints />\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"0\" uspid=\"37\" ordinal=\"0\" offset=\"0\" sl=\"11\" sc=\"9\" el=\"11\" ec=\"10\" />\n            </Method>\n            <Method visited=\"false\" cyclomaticComplexity=\"1\" sequenceCoverage=\"0\" branchCoverage=\"0\" isConstructor=\"true\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n              <MetadataToken>100663305</MetadataToken>\n              <Name>System.Void MyLibrary.Multiplier::.ctor()</Name>\n              <SequencePoints />\n              <BranchPoints />\n              <MethodPoint vc=\"0\" uspid=\"40\" ordinal=\"0\" offset=\"0\" />\n            </Method>\n          </Methods>\n        </Class>\n      </Classes>\n    </Module>\n  </Modules>\n</CoverageSession>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/opencover/valid_case_multiple_sequence_points_per_line.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\nBelow is the code for which this coverage file has been created,\ntogether with the commands to generate the file and the tools versions.\n\nNote: the file paths were manually changed inside the report to be relative.\n________________________________________________________\n\nnamespace GetSet\n{\n    public class Bar\n    {\n        public int CoveredGet { get; set; } public int UncoveredProperty { get; set; } public int CoveredSet { get; set; }\n\n        public int CoveredGetOnSecondLine { get; set; }\n\n        public int CoveredProperty { get; set; }\n\n        public int ArrowMethod(bool condition) => condition ? CoveredGetOnSecondLine : UncoveredProperty;\n\n        public int BodyMethod()\n        {\n            var x = CoveredProperty; CoveredProperty = 1; goto label; UncoveredProperty = 1;\n\n            UncoveredProperty = 1;\n\n            label:\n            CoveredSet = 1;\n\n            return CoveredGet;\n        }\n    }\n}\n\nnamespace GetSet\n{\n    public class FooCallsBar\n    {\n        public void CallBar(Bar bar)\n        {\n            Console.WriteLine(bar.CoveredGet);\n            Console.WriteLine(bar.CoveredProperty);\n        }\n    }\n}\n________________________________________________________\n\nusing GetSet;\n\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\n\nnamespace GetSetTests\n{\n    [TestClass]\n    public class BarTests\n    {\n        [TestMethod]\n        public void CallMethods()\n        {\n            Bar bar = new Bar();\n            bar.BodyMethod();\n            bar.ArrowMethod(true);\n        }\n\n        [TestMethod]\n        public void CallBarViaFoo()\n        {\n            FooCallsBar fooCallsBar = new FooCallsBar();\n            fooCallsBar.CallBar(new Bar());\n        }\n    }\n}\n________________________________________________________\n\nmsbuild .\\GetSetCoverage.sln /t:Rebuild\nOpenCover.Console.exe -output:\"opencover.xml\" -register:administrator -target:\"PATH_TO\\vstest.console.exe\" -targetargs:\"PATH_TO\\GetSetTests.dll\"\n\nOpenCover version 4.7.922.0\n-->\n<CoverageSession xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" Version=\"4.7.922.0\">\n  <Summary numSequencePoints=\"32\" visitedSequencePoints=\"27\" numBranchPoints=\"17\" visitedBranchPoints=\"11\" sequenceCoverage=\"84.38\" branchCoverage=\"64.71\" maxCyclomaticComplexity=\"2\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"1\" visitedClasses=\"3\" numClasses=\"3\" visitedMethods=\"10\" numMethods=\"15\" />\n  <Modules>\n    <Module skippedDueTo=\"Filter\" hash=\"AC-E9-5B-E2-17-18-10-1B-85-F1-52-BC-0C-F5-DD-D8-7F-63-43-3C\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_32\\mscorlib\\v4.0_4.0.0.0__b77a5c561934e089\\mscorlib.dll</ModulePath>\n      <ModuleTime>2019-12-07T06:03:04Z</ModuleTime>\n      <ModuleName>mscorlib</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"48-2E-45-6A-CA-72-5E-5B-34-6F-E1-50-FE-70-35-1E-7A-52-9E-E1\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow\\vstest.console.exe</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>vstest.console</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"24-2C-03-2B-89-E0-30-E5-1F-11-C5-DC-6E-F5-2F-8E-5C-D1-37-51\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\vstest.console.exe</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>vstest.console</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"04-01-50-98-6C-72-A9-53-65-FF-BD-3F-FC-34-85-98-02-8C-55-7F\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.TestPlatform.CoreUtilities.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.CoreUtilities</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"4A-9D-81-85-DC-CF-74-ED-91-AC-6F-7B-37-3D-3E-0B-36-5C-56-66\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System\\v4.0_4.0.0.0__b77a5c561934e089\\System.dll</ModulePath>\n      <ModuleTime>2019-07-24T02:58:28Z</ModuleTime>\n      <ModuleName>System</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"B4-5F-71-54-5A-B1-43-E8-C8-B1-6F-51-A6-9A-FB-F3-EF-09-6F-71\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.ObjectModel</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"46-E1-5B-DC-5A-27-47-7B-BF-6B-55-98-50-04-1C-DE-F1-84-E6-6D\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.VisualStudio.TestPlatform.Client.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Client</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"EA-40-4C-75-4E-CC-64-CB-E0-0B-95-E4-AC-4E-14-0E-4E-43-CA-2B\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.VisualStudio.TestPlatform.Common.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Common</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"CC-DB-8A-78-1D-14-03-CA-9E-57-77-AD-02-B0-11-1E-9D-D0-F8-EB\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Core\\v4.0_4.0.0.0__b77a5c561934e089\\System.Core.dll</ModulePath>\n      <ModuleTime>2019-12-07T06:03:04Z</ModuleTime>\n      <ModuleName>System.Core</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"D2-F0-F2-FF-AE-D0-90-7D-B9-F6-15-6E-D5-06-05-87-03-53-98-79\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.TestPlatform.PlatformAbstractions.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.PlatformAbstractions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"2D-4E-7D-93-79-73-1D-3F-7A-CD-83-B3-5F-27-A4-33-E4-E0-D0-C0\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Xml\\v4.0_4.0.0.0__b77a5c561934e089\\System.Xml.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.3313185Z</ModuleTime>\n      <ModuleName>System.Xml</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"05-17-3D-5A-70-23-25-42-99-2A-6A-D4-9E-05-F1-BC-D8-01-CA-D5\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.TestPlatform.Utilities.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.Utilities</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"2A-7B-17-4D-5F-56-2E-65-AC-46-D1-7B-18-CB-45-61-99-7F-97-68\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Configuration\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Configuration.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.5645591Z</ModuleTime>\n      <ModuleName>System.Configuration</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"EB-76-12-F8-2F-06-94-4A-61-1C-23-3B-80-33-5E-18-0B-E5-A4-72\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.TestPlatform.CrossPlatEngine.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.CrossPlatEngine</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"06-19-22-50-4F-B6-BD-65-A0-C7-8C-DE-34-EA-A5-8F-DC-ED-2D-B8\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.TestPlatform.Extensions.BlameDataCollector.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.Extensions.BlameDataCollector</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"91-1A-F0-77-87-7A-78-F3-40-53-63-26-E3-B3-36-1E-8A-2C-E4-9C\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.TestPlatform.Extensions.EventLogCollector.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.Extensions.EventLogCollector</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"D7-A7-84-27-C4-A9-66-B8-8A-20-FF-57-E3-CB-C9-AD-9A-3B-B7-51\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.TestPlatform.TestHostRuntimeProvider.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.TestHostRuntimeProvider</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"D7-BF-31-BE-60-D4-B9-90-1B-91-BC-82-6E-42-CB-49-44-2F-6D-7C\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.VisualStudio.ArchitectureTools.PEReader.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.ArchitectureTools.PEReader</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"2D-C8-72-FE-35-9B-0E-78-1A-8C-2C-40-D9-83-6C-FA-C5-5F-75-D7\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.VisualStudio.Coverage.Interop.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.Coverage.Interop</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"F6-8B-50-0B-D5-4A-17-3D-09-28-19-BF-31-6A-B6-8B-E3-58-A8-9A\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.CodedWebTestAdapter.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.CodedWebTestAdapter</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"F2-D6-52-FE-00-A7-FE-8D-D4-24-AC-E7-A3-04-21-5A-AD-48-32-50\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.TmiAdapter.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.TmiAdapter</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"22-1F-5F-67-0C-DD-DE-1F-03-8C-89-85-2D-9A-AD-F4-95-AA-69-5B\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.VisualStudio.QualityTools.Common.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.QualityTools.Common</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"7E-38-11-17-B0-30-5D-45-76-2A-18-90-F0-18-13-4E-C1-B2-16-0F\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.GenericTestAdapter.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.GenericTestAdapter</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"D9-C5-A7-55-C2-10-DA-E0-F9-C2-DF-B2-06-83-F8-EE-B0-DB-E7-E2\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.OrderedTestAdapter.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.OrderedTestAdapter</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"12-6C-F5-E3-C7-CD-E3-77-C0-CA-1C-B3-6A-92-95-AE-F9-6C-A0-DA\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"46-46-34-57-D9-E0-CB-B4-8F-54-39-13-6F-43-4F-62-5D-6B-18-36\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.VSTestIntegration.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.VSTestIntegration</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"8A-70-99-42-21-64-D6-DA-93-8F-15-58-04-49-95-95-03-34-FD-B6\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.QualityTools.UnitTestFramework</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"CD-B4-80-7E-ED-87-A1-F3-81-CB-3E-96-C0-CC-4B-81-BD-74-C4-D1\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_32\\System.Data\\v4.0_4.0.0.0__b77a5c561934e089\\System.Data.dll</ModulePath>\n      <ModuleTime>2019-12-07T06:03:04Z</ModuleTime>\n      <ModuleName>System.Data</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"19-13-48-7E-B8-6D-86-0B-82-11-D0-29-88-B9-86-65-5D-CE-BB-B6\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.WebTestAdapter.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Extensions.WebTestAdapter</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"D8-54-DB-4C-35-8D-F0-9E-02-E7-C0-E3-8A-1F-38-28-64-B8-00-3C\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestTools.CppUnitTestFramework.ComInterfaces.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestTools.CppUnitTestFramework.ComInterfaces</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"AC-E8-F2-CF-48-EF-9B-55-DD-C4-50-E6-CF-EC-B3-35-AB-A6-D8-7B\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestTools.CppUnitTestFramework.CppUnitTestExtension.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestTools.CppUnitTestFramework.CppUnitTestExtension</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"60-03-96-F9-3B-1E-0D-18-F9-FE-FF-B9-4F-1B-28-3D-B7-20-39-7D\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestTools.DataCollection.MediaRecorder.Model.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestTools.DataCollection.MediaRecorder.Model</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"1D-26-3E-64-63-BC-40-62-7F-BA-67-38-AF-77-E8-9D-28-02-66-7C\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TestTools.DataCollection.VideoRecorderCollector.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestTools.DataCollection.VideoRecorderCollector</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"D5-C4-56-DC-17-09-1C-EA-87-1C-E8-F5-C7-29-D4-20-74-8C-96-35\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\Microsoft.VisualStudio.TraceDataCollector.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TraceDataCollector</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"41-D1-74-75-40-0C-09-3F-D4-4E-F1-AB-6F-1E-70-75-98-12-5B-FC\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.IntelliTrace.Core.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.IntelliTrace.Core</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"F1-D3-C4-19-F0-A3-97-CA-EE-78-EA-BA-5F-97-56-C8-6D-7F-01-45\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\System.Reflection.Metadata.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>System.Reflection.Metadata</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"2A-5F-EB-FC-1F-8B-9B-DB-11-DF-AF-03-EE-EB-43-40-AC-5D-A5-08\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Runtime\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Runtime.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:17.086231Z</ModuleTime>\n      <ModuleName>System.Runtime</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"31-10-26-68-D1-64-10-03-21-09-D6-38-CC-CB-5F-68-D2-33-83-4E\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Runtime.InteropServices\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Runtime.InteropServices.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.4098692Z</ModuleTime>\n      <ModuleName>System.Runtime.InteropServices</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"42-26-9C-31-27-41-D7-11-67-3E-B9-52-F7-0B-89-F7-CF-DB-2A-9F\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.IO\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.IO.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.0307581Z</ModuleTime>\n      <ModuleName>System.IO</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"FB-BF-29-CE-7B-65-70-2C-55-E7-9A-03-D5-24-9F-04-A1-39-0C-A6\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\System.Collections.Immutable.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>System.Collections.Immutable</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"22-1F-F0-50-FF-7F-A0-29-DD-0C-1D-EE-12-A3-59-6D-ED-3D-47-14\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Reflection\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Reflection.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:16.8724675Z</ModuleTime>\n      <ModuleName>System.Reflection</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"53-77-EF-FE-9F-F9-EC-6E-7E-76-60-FF-15-66-89-40-9C-E0-20-59\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.IO.FileSystem\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.IO.FileSystem.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.0377466Z</ModuleTime>\n      <ModuleName>System.IO.FileSystem</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"27-DB-AC-1A-E3-0E-68-D9-4E-FB-01-38-58-7B-D4-0C-0C-06-3C-E2\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.IO.MemoryMappedFiles\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.IO.MemoryMappedFiles.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.5565597Z</ModuleTime>\n      <ModuleName>System.IO.MemoryMappedFiles</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"96-37-10-95-D6-A0-48-4B-95-E2-45-ED-F2-CC-F8-38-62-7F-B7-4A\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Runtime.Handles\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Runtime.Handles.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:17.0957374Z</ModuleTime>\n      <ModuleName>System.Runtime.Handles</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"20-90-4A-17-B6-9E-64-0F-FC-76-F1-38-55-AA-15-D2-A0-C7-C2-50\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Reflection.Extensions\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Reflection.Extensions.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:14.6041956Z</ModuleTime>\n      <ModuleName>System.Reflection.Extensions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"31-06-17-24-21-7B-94-95-95-7B-E6-A3-ED-8E-C4-61-76-81-50-E7\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Threading\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Threading.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.2693238Z</ModuleTime>\n      <ModuleName>System.Threading</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"8F-B6-AF-17-6D-95-F2-1A-C9-07-A2-52-08-07-0F-4B-AB-A1-B6-5A\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Text.Encoding\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Text.Encoding.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.1026701Z</ModuleTime>\n      <ModuleName>System.Text.Encoding</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"D7-63-79-55-E2-7C-07-44-05-DC-65-F2-1A-28-3F-C9-73-76-03-F4\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Runtime.Extensions\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Runtime.Extensions.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.6209693Z</ModuleTime>\n      <ModuleName>System.Runtime.Extensions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"BC-98-94-53-F1-64-6C-E2-64-06-9F-E1-73-E4-90-7C-0B-99-EF-63\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Text.Encoding.Extensions\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Text.Encoding.Extensions.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.1275958Z</ModuleTime>\n      <ModuleName>System.Text.Encoding.Extensions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"C2-9E-D2-D3-C2-EC-A6-09-42-B6-46-57-9F-26-83-3F-49-7D-C4-26\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.VisualStudio.TestPlatform.Fakes.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.Fakes</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"2A-2A-6C-70-82-27-5B-98-E6-EB-41-91-C0-3F-75-CB-8A-0B-FE-FD\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.TestPlatform.CommunicationUtilities.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.CommunicationUtilities</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"6B-0D-A7-56-17-A2-26-94-93-DC-1A-68-5D-7A-0B-07-F2-E4-8C-75\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Newtonsoft.Json.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Newtonsoft.Json</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"67-97-99-39-84-F7-16-4E-E7-62-EA-DC-7C-83-21-8F-A9-D9-A1-A0\">\n      <ModulePath>GetSetTests\\bin\\Debug\\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll</ModulePath>\n      <ModuleTime>2018-06-05T10:51:36Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"44-8F-EE-BC-56-83-22-04-15-20-82-7D-BF-FA-A8-E8-9C-33-D9-E8\">\n      <ModulePath>GetSetTests\\bin\\Debug\\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</ModulePath>\n      <ModuleTime>2018-06-05T10:47:02Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.TestFramework</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"6F-CB-80-19-07-E6-7F-D6-F9-1D-EB-CD-AD-79-88-FA-B9-E8-91-A5\">\n      <ModulePath>GetSetTests\\bin\\Debug\\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll</ModulePath>\n      <ModuleTime>2018-06-05T10:50:06Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"4D-AE-CD-82-E0-4B-E2-0F-CA-8E-B6-ED-56-65-84-57-EF-28-68-42\">\n      <ModulePath>GetSetTests\\bin\\Debug\\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll</ModulePath>\n      <ModuleTime>2018-06-05T10:54:38Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"C5-40-F9-D4-B7-14-5D-9F-61-1D-28-89-97-2D-28-DD-3E-A4-AA-8C\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.ComponentModel.Composition\\v4.0_4.0.0.0__b77a5c561934e089\\System.ComponentModel.Composition.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.2663154Z</ModuleTime>\n      <ModuleName>System.ComponentModel.Composition</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"6B-BE-41-8B-12-55-D6-F7-2C-7A-2F-32-4D-B3-C1-63-E6-35-28-12\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Collections\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Collections.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:14.3209419Z</ModuleTime>\n      <ModuleName>System.Collections</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"EE-2B-56-7A-68-02-A5-7E-5B-3B-FC-C3-18-76-17-C1-2C-F9-FC-AE\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Linq\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Linq.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:16.9683232Z</ModuleTime>\n      <ModuleName>System.Linq</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"19-24-63-7E-D0-E9-AA-5B-77-93-3B-DA-E4-01-B5-2B-8C-61-6E-32\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Xml.ReaderWriter\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Xml.ReaderWriter.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.1340843Z</ModuleTime>\n      <ModuleName>System.Xml.ReaderWriter</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"DC-57-0C-FF-68-B1-0F-63-33-55-EE-AD-AD-9D-95-7F-52-58-79-12\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Xml.XDocument\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Xml.XDocument.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.1525295Z</ModuleTime>\n      <ModuleName>System.Xml.XDocument</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"32-74-EF-25-E3-A9-11-0C-F0-FD-2D-7E-1A-97-75-45-D0-5E-8A-A8\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Xml.Linq\\v4.0_4.0.0.0__b77a5c561934e089\\System.Xml.Linq.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.5069748Z</ModuleTime>\n      <ModuleName>System.Xml.Linq</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"98-6B-6E-6B-F6-F7-63-4F-B2-83-84-4A-13-A1-DF-C1-6E-B5-2B-02\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Globalization\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Globalization.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.0952004Z</ModuleTime>\n      <ModuleName>System.Globalization</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"B4-5F-71-54-5A-B1-43-E8-C8-B1-6F-51-A6-9A-FB-F3-EF-09-6F-71\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.ObjectModel</ModuleName>\n      <Classes />\n    </Module>\n    <Module hash=\"5D-3F-4C-B6-17-D2-8D-25-25-F8-F3-CE-0B-8E-4D-D6-3D-29-D8-BF\">\n      <Summary numSequencePoints=\"9\" visitedSequencePoints=\"9\" numBranchPoints=\"2\" visitedBranchPoints=\"2\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"1\" visitedClasses=\"1\" numClasses=\"1\" visitedMethods=\"2\" numMethods=\"2\" />\n      <ModulePath>GetSetTests\\bin\\Debug\\GetSetTests.dll</ModulePath>\n      <ModuleTime>2020-03-26T16:40:36.2260208Z</ModuleTime>\n      <ModuleName>GetSetTests</ModuleName>\n      <Files>\n        <File uid=\"1\" fullPath=\"GetSetTests\\BarTests.cs\" />\n      </Files>\n      <Classes>\n        <Class>\n          <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"0\" minCyclomaticComplexity=\"0\" maxCrapScore=\"0\" minCrapScore=\"0\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"0\" />\n          <FullName>&lt;Module&gt;</FullName>\n          <Methods />\n        </Class>\n        <Class>\n          <Summary numSequencePoints=\"9\" visitedSequencePoints=\"9\" numBranchPoints=\"2\" visitedBranchPoints=\"2\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"1\" visitedClasses=\"1\" numClasses=\"1\" visitedMethods=\"2\" numMethods=\"2\" />\n          <FullName>GetSetTests.BarTests</FullName>\n          <Methods>\n            <Method visited=\"true\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"100\" branchCoverage=\"100\" crapScore=\"1\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"5\" visitedSequencePoints=\"5\" numBranchPoints=\"1\" visitedBranchPoints=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"1\" minCrapScore=\"1\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"1\" numMethods=\"1\" />\n              <MetadataToken>100663297</MetadataToken>\n              <Name>System.Void GetSetTests.BarTests::CallMethods()</Name>\n              <FileRef uid=\"1\" />\n              <SequencePoints>\n                <SequencePoint vc=\"1\" uspid=\"1\" ordinal=\"0\" offset=\"0\" sl=\"13\" sc=\"9\" el=\"13\" ec=\"10\" bec=\"0\" bev=\"0\" fileid=\"1\" />\n                <SequencePoint vc=\"1\" uspid=\"2\" ordinal=\"1\" offset=\"1\" sl=\"14\" sc=\"13\" el=\"14\" ec=\"33\" bec=\"0\" bev=\"0\" fileid=\"1\" />\n                <SequencePoint vc=\"1\" uspid=\"3\" ordinal=\"2\" offset=\"7\" sl=\"15\" sc=\"13\" el=\"15\" ec=\"30\" bec=\"0\" bev=\"0\" fileid=\"1\" />\n                <SequencePoint vc=\"1\" uspid=\"4\" ordinal=\"3\" offset=\"14\" sl=\"16\" sc=\"13\" el=\"16\" ec=\"35\" bec=\"0\" bev=\"0\" fileid=\"1\" />\n                <SequencePoint vc=\"1\" uspid=\"5\" ordinal=\"4\" offset=\"22\" sl=\"17\" sc=\"9\" el=\"17\" ec=\"10\" bec=\"0\" bev=\"0\" fileid=\"1\" />\n              </SequencePoints>\n              <BranchPoints />\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"1\" uspid=\"1\" ordinal=\"0\" offset=\"0\" sl=\"13\" sc=\"9\" el=\"13\" ec=\"10\" bec=\"0\" bev=\"0\" fileid=\"1\" />\n            </Method>\n            <Method visited=\"true\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"100\" branchCoverage=\"100\" crapScore=\"1\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"4\" visitedSequencePoints=\"4\" numBranchPoints=\"1\" visitedBranchPoints=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"1\" minCrapScore=\"1\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"1\" numMethods=\"1\" />\n              <MetadataToken>100663298</MetadataToken>\n              <Name>System.Void GetSetTests.BarTests::CallBarViaFoo()</Name>\n              <FileRef uid=\"1\" />\n              <SequencePoints>\n                <SequencePoint vc=\"1\" uspid=\"6\" ordinal=\"0\" offset=\"0\" sl=\"21\" sc=\"9\" el=\"21\" ec=\"10\" bec=\"0\" bev=\"0\" fileid=\"1\" />\n                <SequencePoint vc=\"1\" uspid=\"7\" ordinal=\"1\" offset=\"1\" sl=\"22\" sc=\"13\" el=\"22\" ec=\"57\" bec=\"0\" bev=\"0\" fileid=\"1\" />\n                <SequencePoint vc=\"1\" uspid=\"8\" ordinal=\"2\" offset=\"7\" sl=\"23\" sc=\"13\" el=\"23\" ec=\"44\" bec=\"0\" bev=\"0\" fileid=\"1\" />\n                <SequencePoint vc=\"1\" uspid=\"9\" ordinal=\"3\" offset=\"19\" sl=\"24\" sc=\"9\" el=\"24\" ec=\"10\" bec=\"0\" bev=\"0\" fileid=\"1\" />\n              </SequencePoints>\n              <BranchPoints />\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"1\" uspid=\"6\" ordinal=\"0\" offset=\"0\" sl=\"21\" sc=\"9\" el=\"21\" ec=\"10\" bec=\"0\" bev=\"0\" fileid=\"1\" />\n            </Method>\n            <Method visited=\"false\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" crapScore=\"2\" isConstructor=\"true\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"2\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"0\" />\n              <MetadataToken>100663299</MetadataToken>\n              <Name>System.Void GetSetTests.BarTests::.ctor()</Name>\n              <SequencePoints />\n              <BranchPoints />\n              <MethodPoint vc=\"0\" uspid=\"10\" ordinal=\"0\" offset=\"0\" />\n            </Method>\n          </Methods>\n        </Class>\n      </Classes>\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"D2-F0-F2-FF-AE-D0-90-7D-B9-F6-15-6E-D5-06-05-87-03-53-98-79\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.TestPlatform.PlatformAbstractions.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.PlatformAbstractions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"4D-AE-CD-82-E0-4B-E2-0F-CA-8E-B6-ED-56-65-84-57-EF-28-68-42\">\n      <ModulePath>GetSetTests\\bin\\Debug\\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll</ModulePath>\n      <ModuleTime>2018-06-05T10:54:38Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"4A-9D-81-85-DC-CF-74-ED-91-AC-6F-7B-37-3D-3E-0B-36-5C-56-66\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System\\v4.0_4.0.0.0__b77a5c561934e089\\System.dll</ModulePath>\n      <ModuleTime>2019-07-24T02:58:28Z</ModuleTime>\n      <ModuleName>System</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"0D-5D-97-72-83-71-7E-38-04-5B-09-7F-4A-00-D8-E1-22-BE-E7-18\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow\\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.ObjectModel</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"6F-0D-72-50-01-9F-5A-13-E7-FF-65-AC-14-11-3D-9F-BE-89-EF-98\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow\\Microsoft.TestPlatform.CoreUtilities.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.CoreUtilities</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"D2-F0-F2-FF-AE-D0-90-7D-B9-F6-15-6E-D5-06-05-87-03-53-98-79\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.TestPlatform.PlatformAbstractions.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.PlatformAbstractions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"4D-AE-CD-82-E0-4B-E2-0F-CA-8E-B6-ED-56-65-84-57-EF-28-68-42\">\n      <ModulePath>GetSetTests\\bin\\Debug\\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll</ModulePath>\n      <ModuleTime>2018-06-05T10:54:38Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"67-97-99-39-84-F7-16-4E-E7-62-EA-DC-7C-83-21-8F-A9-D9-A1-A0\">\n      <ModulePath>GetSetTests\\bin\\Debug\\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll</ModulePath>\n      <ModuleTime>2018-06-05T10:51:36Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"44-8F-EE-BC-56-83-22-04-15-20-82-7D-BF-FA-A8-E8-9C-33-D9-E8\">\n      <ModulePath>GetSetTests\\bin\\Debug\\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</ModulePath>\n      <ModuleTime>2018-06-05T10:47:02Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.TestFramework</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"6F-CB-80-19-07-E6-7F-D6-F9-1D-EB-CD-AD-79-88-FA-B9-E8-91-A5\">\n      <ModulePath>GetSetTests\\bin\\Debug\\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll</ModulePath>\n      <ModuleTime>2018-06-05T10:50:06Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"81-51-15-1E-F9-E5-85-B3-3E-FC-CE-28-F6-AD-DB-80-30-DE-EA-15\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Threading.Tasks\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Threading.Tasks.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.2728178Z</ModuleTime>\n      <ModuleName>System.Threading.Tasks</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"B4-5F-71-54-5A-B1-43-E8-C8-B1-6F-51-A6-9A-FB-F3-EF-09-6F-71\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.ObjectModel</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"A8-50-D9-1C-8B-DC-20-58-85-7A-3E-54-32-47-8A-0C-09-98-E9-26\">\n      <ModulePath>GetSetTests\\bin\\Debug\\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</ModulePath>\n      <ModuleTime>2018-06-05T10:53:44Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"7A-89-9A-7F-3B-FC-24-C2-03-A3-4A-1A-A1-5F-F2-F0-AD-93-B3-BA\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Runtime.Serialization\\v4.0_4.0.0.0__b77a5c561934e089\\System.Runtime.Serialization.dll</ModulePath>\n      <ModuleTime>2019-12-07T06:03:04Z</ModuleTime>\n      <ModuleName>System.Runtime.Serialization</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"Filter\" hash=\"62-BF-4A-BD-89-82-82-B9-5A-D8-A4-37-C1-B1-1F-B1-EF-65-8A-1C\">\n      <ModulePath>C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Collections.Concurrent\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Collections.Concurrent.dll</ModulePath>\n      <ModuleTime>2019-08-20T16:07:19.5470779Z</ModuleTime>\n      <ModuleName>System.Collections.Concurrent</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"D2-F0-F2-FF-AE-D0-90-7D-B9-F6-15-6E-D5-06-05-87-03-53-98-79\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.TestPlatform.PlatformAbstractions.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.PlatformAbstractions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"4D-AE-CD-82-E0-4B-E2-0F-CA-8E-B6-ED-56-65-84-57-EF-28-68-42\">\n      <ModulePath>GetSetTests\\bin\\Debug\\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll</ModulePath>\n      <ModuleTime>2018-06-05T10:54:38Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"0D-5D-97-72-83-71-7E-38-04-5B-09-7F-4A-00-D8-E1-22-BE-E7-18\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow\\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.ObjectModel</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"6F-0D-72-50-01-9F-5A-13-E7-FF-65-AC-14-11-3D-9F-BE-89-EF-98\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow\\Microsoft.TestPlatform.CoreUtilities.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.CoreUtilities</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"D2-F0-F2-FF-AE-D0-90-7D-B9-F6-15-6E-D5-06-05-87-03-53-98-79\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.TestPlatform.PlatformAbstractions.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.TestPlatform.PlatformAbstractions</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"4D-AE-CD-82-E0-4B-E2-0F-CA-8E-B6-ED-56-65-84-57-EF-28-68-42\">\n      <ModulePath>GetSetTests\\bin\\Debug\\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll</ModulePath>\n      <ModuleTime>2018-06-05T10:54:38Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"67-97-99-39-84-F7-16-4E-E7-62-EA-DC-7C-83-21-8F-A9-D9-A1-A0\">\n      <ModulePath>GetSetTests\\bin\\Debug\\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll</ModulePath>\n      <ModuleTime>2018-06-05T10:51:36Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"44-8F-EE-BC-56-83-22-04-15-20-82-7D-BF-FA-A8-E8-9C-33-D9-E8\">\n      <ModulePath>GetSetTests\\bin\\Debug\\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</ModulePath>\n      <ModuleTime>2018-06-05T10:47:02Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.TestFramework</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"6F-CB-80-19-07-E6-7F-D6-F9-1D-EB-CD-AD-79-88-FA-B9-E8-91-A5\">\n      <ModulePath>GetSetTests\\bin\\Debug\\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll</ModulePath>\n      <ModuleTime>2018-06-05T10:50:06Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"A8-50-D9-1C-8B-DC-20-58-85-7A-3E-54-32-47-8A-0C-09-98-E9-26\">\n      <ModulePath>GetSetTests\\bin\\Debug\\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</ModulePath>\n      <ModuleTime>2018-06-05T10:53:44Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions</ModuleName>\n      <Classes />\n    </Module>\n    <Module hash=\"2C-E8-22-B7-4F-7F-A2-DD-B0-5F-98-68-00-1C-73-7E-2A-CA-31-CA\">\n      <Summary numSequencePoints=\"23\" visitedSequencePoints=\"18\" numBranchPoints=\"15\" visitedBranchPoints=\"9\" sequenceCoverage=\"78.26\" branchCoverage=\"60\" maxCyclomaticComplexity=\"2\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"1\" visitedClasses=\"2\" numClasses=\"2\" visitedMethods=\"8\" numMethods=\"13\" />\n      <ModulePath>GetSetTests\\bin\\Debug\\GetSet.dll</ModulePath>\n      <ModuleTime>2020-03-26T16:40:34.1085222Z</ModuleTime>\n      <ModuleName>GetSet</ModuleName>\n      <Files>\n        <File uid=\"3\" fullPath=\"GetSet\\Bar.cs\" />\n        <File uid=\"4\" fullPath=\"GetSet\\FooCallsBar.cs\" />\n      </Files>\n      <Classes>\n        <Class>\n          <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"0\" minCyclomaticComplexity=\"0\" maxCrapScore=\"0\" minCrapScore=\"0\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"0\" />\n          <FullName>&lt;Module&gt;</FullName>\n          <Methods />\n        </Class>\n        <Class>\n          <Summary numSequencePoints=\"19\" visitedSequencePoints=\"14\" numBranchPoints=\"14\" visitedBranchPoints=\"8\" sequenceCoverage=\"73.68\" branchCoverage=\"57.14\" maxCyclomaticComplexity=\"2\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"1\" visitedClasses=\"1\" numClasses=\"1\" visitedMethods=\"7\" numMethods=\"12\" />\n          <FullName>GetSet.Bar</FullName>\n          <Methods>\n            <Method visited=\"true\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"100\" branchCoverage=\"100\" crapScore=\"1\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"true\" isSetter=\"false\">\n              <Summary numSequencePoints=\"1\" visitedSequencePoints=\"1\" numBranchPoints=\"1\" visitedBranchPoints=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"1\" minCrapScore=\"1\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"1\" numMethods=\"1\" />\n              <MetadataToken>100663297</MetadataToken>\n              <Name>System.Int32 GetSet.Bar::get_CoveredGet()</Name>\n              <FileRef uid=\"3\" />\n              <SequencePoints>\n                <SequencePoint vc=\"2\" uspid=\"11\" ordinal=\"0\" offset=\"0\" sl=\"11\" sc=\"33\" el=\"11\" ec=\"37\" bec=\"0\" bev=\"0\" fileid=\"3\" />\n              </SequencePoints>\n              <BranchPoints />\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"2\" uspid=\"11\" ordinal=\"0\" offset=\"0\" sl=\"11\" sc=\"33\" el=\"11\" ec=\"37\" bec=\"0\" bev=\"0\" fileid=\"3\" />\n            </Method>\n            <Method visited=\"false\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" crapScore=\"2\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"false\" isSetter=\"true\">\n              <Summary numSequencePoints=\"1\" visitedSequencePoints=\"0\" numBranchPoints=\"1\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"2\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"1\" />\n              <MetadataToken>100663298</MetadataToken>\n              <Name>System.Void GetSet.Bar::set_CoveredGet(System.Int32)</Name>\n              <FileRef uid=\"3\" />\n              <SequencePoints>\n                <SequencePoint vc=\"0\" uspid=\"12\" ordinal=\"0\" offset=\"0\" sl=\"11\" sc=\"38\" el=\"11\" ec=\"42\" bec=\"0\" bev=\"0\" fileid=\"3\" />\n              </SequencePoints>\n              <BranchPoints />\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"0\" uspid=\"12\" ordinal=\"0\" offset=\"0\" sl=\"11\" sc=\"38\" el=\"11\" ec=\"42\" bec=\"0\" bev=\"0\" fileid=\"3\" />\n            </Method>\n            <Method visited=\"false\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" crapScore=\"2\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"true\" isSetter=\"false\">\n              <Summary numSequencePoints=\"1\" visitedSequencePoints=\"0\" numBranchPoints=\"1\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"2\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"1\" />\n              <MetadataToken>100663299</MetadataToken>\n              <Name>System.Int32 GetSet.Bar::get_UncoveredProperty()</Name>\n              <FileRef uid=\"3\" />\n              <SequencePoints>\n                <SequencePoint vc=\"0\" uspid=\"13\" ordinal=\"0\" offset=\"0\" sl=\"11\" sc=\"76\" el=\"11\" ec=\"80\" bec=\"0\" bev=\"0\" fileid=\"3\" />\n              </SequencePoints>\n              <BranchPoints />\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"0\" uspid=\"13\" ordinal=\"0\" offset=\"0\" sl=\"11\" sc=\"76\" el=\"11\" ec=\"80\" bec=\"0\" bev=\"0\" fileid=\"3\" />\n            </Method>\n            <Method visited=\"false\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" crapScore=\"2\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"false\" isSetter=\"true\">\n              <Summary numSequencePoints=\"1\" visitedSequencePoints=\"0\" numBranchPoints=\"1\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"2\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"1\" />\n              <MetadataToken>100663300</MetadataToken>\n              <Name>System.Void GetSet.Bar::set_UncoveredProperty(System.Int32)</Name>\n              <FileRef uid=\"3\" />\n              <SequencePoints>\n                <SequencePoint vc=\"0\" uspid=\"14\" ordinal=\"0\" offset=\"0\" sl=\"11\" sc=\"81\" el=\"11\" ec=\"85\" bec=\"0\" bev=\"0\" fileid=\"3\" />\n              </SequencePoints>\n              <BranchPoints />\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"0\" uspid=\"14\" ordinal=\"0\" offset=\"0\" sl=\"11\" sc=\"81\" el=\"11\" ec=\"85\" bec=\"0\" bev=\"0\" fileid=\"3\" />\n            </Method>\n            <Method visited=\"false\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" crapScore=\"2\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"true\" isSetter=\"false\">\n              <Summary numSequencePoints=\"1\" visitedSequencePoints=\"0\" numBranchPoints=\"1\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"2\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"1\" />\n              <MetadataToken>100663301</MetadataToken>\n              <Name>System.Int32 GetSet.Bar::get_CoveredSet()</Name>\n              <FileRef uid=\"3\" />\n              <SequencePoints>\n                <SequencePoint vc=\"0\" uspid=\"15\" ordinal=\"0\" offset=\"0\" sl=\"11\" sc=\"112\" el=\"11\" ec=\"116\" bec=\"0\" bev=\"0\" fileid=\"3\" />\n              </SequencePoints>\n              <BranchPoints />\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"0\" uspid=\"15\" ordinal=\"0\" offset=\"0\" sl=\"11\" sc=\"112\" el=\"11\" ec=\"116\" bec=\"0\" bev=\"0\" fileid=\"3\" />\n            </Method>\n            <Method visited=\"true\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"100\" branchCoverage=\"100\" crapScore=\"1\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"false\" isSetter=\"true\">\n              <Summary numSequencePoints=\"1\" visitedSequencePoints=\"1\" numBranchPoints=\"1\" visitedBranchPoints=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"1\" minCrapScore=\"1\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"1\" numMethods=\"1\" />\n              <MetadataToken>100663302</MetadataToken>\n              <Name>System.Void GetSet.Bar::set_CoveredSet(System.Int32)</Name>\n              <FileRef uid=\"3\" />\n              <SequencePoints>\n                <SequencePoint vc=\"1\" uspid=\"16\" ordinal=\"0\" offset=\"0\" sl=\"11\" sc=\"117\" el=\"11\" ec=\"121\" bec=\"0\" bev=\"0\" fileid=\"3\" />\n              </SequencePoints>\n              <BranchPoints />\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"1\" uspid=\"16\" ordinal=\"0\" offset=\"0\" sl=\"11\" sc=\"117\" el=\"11\" ec=\"121\" bec=\"0\" bev=\"0\" fileid=\"3\" />\n            </Method>\n            <Method visited=\"true\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"100\" branchCoverage=\"100\" crapScore=\"1\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"true\" isSetter=\"false\">\n              <Summary numSequencePoints=\"1\" visitedSequencePoints=\"1\" numBranchPoints=\"1\" visitedBranchPoints=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"1\" minCrapScore=\"1\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"1\" numMethods=\"1\" />\n              <MetadataToken>100663303</MetadataToken>\n              <Name>System.Int32 GetSet.Bar::get_CoveredGetOnSecondLine()</Name>\n              <FileRef uid=\"3\" />\n              <SequencePoints>\n                <SequencePoint vc=\"1\" uspid=\"17\" ordinal=\"0\" offset=\"0\" sl=\"13\" sc=\"45\" el=\"13\" ec=\"49\" bec=\"0\" bev=\"0\" fileid=\"3\" />\n              </SequencePoints>\n              <BranchPoints />\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"1\" uspid=\"17\" ordinal=\"0\" offset=\"0\" sl=\"13\" sc=\"45\" el=\"13\" ec=\"49\" bec=\"0\" bev=\"0\" fileid=\"3\" />\n            </Method>\n            <Method visited=\"false\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" crapScore=\"2\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"false\" isSetter=\"true\">\n              <Summary numSequencePoints=\"1\" visitedSequencePoints=\"0\" numBranchPoints=\"1\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"2\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"1\" />\n              <MetadataToken>100663304</MetadataToken>\n              <Name>System.Void GetSet.Bar::set_CoveredGetOnSecondLine(System.Int32)</Name>\n              <FileRef uid=\"3\" />\n              <SequencePoints>\n                <SequencePoint vc=\"0\" uspid=\"18\" ordinal=\"0\" offset=\"0\" sl=\"13\" sc=\"50\" el=\"13\" ec=\"54\" bec=\"0\" bev=\"0\" fileid=\"3\" />\n              </SequencePoints>\n              <BranchPoints />\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"0\" uspid=\"18\" ordinal=\"0\" offset=\"0\" sl=\"13\" sc=\"50\" el=\"13\" ec=\"54\" bec=\"0\" bev=\"0\" fileid=\"3\" />\n            </Method>\n            <Method visited=\"true\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"100\" branchCoverage=\"100\" crapScore=\"1\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"true\" isSetter=\"false\">\n              <Summary numSequencePoints=\"1\" visitedSequencePoints=\"1\" numBranchPoints=\"1\" visitedBranchPoints=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"1\" minCrapScore=\"1\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"1\" numMethods=\"1\" />\n              <MetadataToken>100663305</MetadataToken>\n              <Name>System.Int32 GetSet.Bar::get_CoveredProperty()</Name>\n              <FileRef uid=\"3\" />\n              <SequencePoints>\n                <SequencePoint vc=\"2\" uspid=\"19\" ordinal=\"0\" offset=\"0\" sl=\"15\" sc=\"38\" el=\"15\" ec=\"42\" bec=\"0\" bev=\"0\" fileid=\"3\" />\n              </SequencePoints>\n              <BranchPoints />\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"2\" uspid=\"19\" ordinal=\"0\" offset=\"0\" sl=\"15\" sc=\"38\" el=\"15\" ec=\"42\" bec=\"0\" bev=\"0\" fileid=\"3\" />\n            </Method>\n            <Method visited=\"true\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"100\" branchCoverage=\"100\" crapScore=\"1\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"false\" isSetter=\"true\">\n              <Summary numSequencePoints=\"1\" visitedSequencePoints=\"1\" numBranchPoints=\"1\" visitedBranchPoints=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"1\" minCrapScore=\"1\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"1\" numMethods=\"1\" />\n              <MetadataToken>100663306</MetadataToken>\n              <Name>System.Void GetSet.Bar::set_CoveredProperty(System.Int32)</Name>\n              <FileRef uid=\"3\" />\n              <SequencePoints>\n                <SequencePoint vc=\"1\" uspid=\"20\" ordinal=\"0\" offset=\"0\" sl=\"15\" sc=\"43\" el=\"15\" ec=\"47\" bec=\"0\" bev=\"0\" fileid=\"3\" />\n              </SequencePoints>\n              <BranchPoints />\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"1\" uspid=\"20\" ordinal=\"0\" offset=\"0\" sl=\"15\" sc=\"43\" el=\"15\" ec=\"47\" bec=\"0\" bev=\"0\" fileid=\"3\" />\n            </Method>\n            <Method visited=\"true\" cyclomaticComplexity=\"2\" nPathComplexity=\"2\" sequenceCoverage=\"100\" branchCoverage=\"66.67\" crapScore=\"2\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"1\" visitedSequencePoints=\"1\" numBranchPoints=\"3\" visitedBranchPoints=\"2\" sequenceCoverage=\"100\" branchCoverage=\"66.67\" maxCyclomaticComplexity=\"2\" minCyclomaticComplexity=\"2\" maxCrapScore=\"2\" minCrapScore=\"2\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"1\" numMethods=\"1\" />\n              <MetadataToken>100663307</MetadataToken>\n              <Name>System.Int32 GetSet.Bar::ArrowMethod(System.Boolean)</Name>\n              <FileRef uid=\"3\" />\n              <SequencePoints>\n                <SequencePoint vc=\"1\" uspid=\"21\" ordinal=\"0\" offset=\"0\" sl=\"17\" sc=\"51\" el=\"17\" ec=\"105\" bec=\"2\" bev=\"1\" fileid=\"3\" />\n              </SequencePoints>\n              <BranchPoints>\n                <BranchPoint vc=\"0\" uspid=\"22\" ordinal=\"0\" offset=\"1\" sl=\"17\" path=\"0\" offsetend=\"3\" fileid=\"3\" />\n                <BranchPoint vc=\"1\" uspid=\"23\" ordinal=\"1\" offset=\"1\" sl=\"17\" path=\"1\" offsetend=\"11\" fileid=\"3\" />\n              </BranchPoints>\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"1\" uspid=\"21\" ordinal=\"0\" offset=\"0\" sl=\"17\" sc=\"51\" el=\"17\" ec=\"105\" bec=\"2\" bev=\"1\" fileid=\"3\" />\n            </Method>\n            <Method visited=\"true\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"100\" branchCoverage=\"100\" crapScore=\"1\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"8\" visitedSequencePoints=\"8\" numBranchPoints=\"1\" visitedBranchPoints=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"1\" minCrapScore=\"1\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"1\" numMethods=\"1\" />\n              <MetadataToken>100663308</MetadataToken>\n              <Name>System.Int32 GetSet.Bar::BodyMethod()</Name>\n              <FileRef uid=\"3\" />\n              <SequencePoints>\n                <SequencePoint vc=\"1\" uspid=\"24\" ordinal=\"0\" offset=\"0\" sl=\"20\" sc=\"9\" el=\"20\" ec=\"10\" bec=\"0\" bev=\"0\" fileid=\"3\" />\n                <SequencePoint vc=\"1\" uspid=\"25\" ordinal=\"1\" offset=\"1\" sl=\"21\" sc=\"13\" el=\"21\" ec=\"37\" bec=\"0\" bev=\"0\" fileid=\"3\" />\n                <SequencePoint vc=\"1\" uspid=\"26\" ordinal=\"2\" offset=\"8\" sl=\"21\" sc=\"38\" el=\"21\" ec=\"58\" bec=\"0\" bev=\"0\" fileid=\"3\" />\n                <SequencePoint vc=\"1\" uspid=\"27\" ordinal=\"3\" offset=\"16\" sl=\"21\" sc=\"59\" el=\"21\" ec=\"70\" bec=\"0\" bev=\"0\" fileid=\"3\" />\n                <SequencePoint vc=\"1\" uspid=\"28\" ordinal=\"4\" offset=\"18\" sl=\"25\" sc=\"13\" el=\"25\" ec=\"19\" bec=\"0\" bev=\"0\" fileid=\"3\" />\n                <SequencePoint vc=\"1\" uspid=\"29\" ordinal=\"5\" offset=\"19\" sl=\"26\" sc=\"13\" el=\"26\" ec=\"28\" bec=\"0\" bev=\"0\" fileid=\"3\" />\n                <SequencePoint vc=\"1\" uspid=\"30\" ordinal=\"6\" offset=\"27\" sl=\"28\" sc=\"13\" el=\"28\" ec=\"31\" bec=\"0\" bev=\"0\" fileid=\"3\" />\n                <SequencePoint vc=\"1\" uspid=\"31\" ordinal=\"7\" offset=\"36\" sl=\"29\" sc=\"9\" el=\"29\" ec=\"10\" bec=\"0\" bev=\"0\" fileid=\"3\" />\n              </SequencePoints>\n              <BranchPoints />\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"1\" uspid=\"24\" ordinal=\"0\" offset=\"0\" sl=\"20\" sc=\"9\" el=\"20\" ec=\"10\" bec=\"0\" bev=\"0\" fileid=\"3\" />\n            </Method>\n            <Method visited=\"false\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" crapScore=\"2\" isConstructor=\"true\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"2\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"0\" />\n              <MetadataToken>100663309</MetadataToken>\n              <Name>System.Void GetSet.Bar::.ctor()</Name>\n              <SequencePoints />\n              <BranchPoints />\n              <MethodPoint vc=\"0\" uspid=\"32\" ordinal=\"0\" offset=\"0\" />\n            </Method>\n          </Methods>\n        </Class>\n        <Class>\n          <Summary numSequencePoints=\"4\" visitedSequencePoints=\"4\" numBranchPoints=\"1\" visitedBranchPoints=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"1\" visitedClasses=\"1\" numClasses=\"1\" visitedMethods=\"1\" numMethods=\"1\" />\n          <FullName>GetSet.FooCallsBar</FullName>\n          <Methods>\n            <Method visited=\"true\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"100\" branchCoverage=\"100\" crapScore=\"1\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"4\" visitedSequencePoints=\"4\" numBranchPoints=\"1\" visitedBranchPoints=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"1\" minCrapScore=\"1\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"1\" numMethods=\"1\" />\n              <MetadataToken>100663310</MetadataToken>\n              <Name>System.Void GetSet.FooCallsBar::CallBar(GetSet.Bar)</Name>\n              <FileRef uid=\"4\" />\n              <SequencePoints>\n                <SequencePoint vc=\"1\" uspid=\"33\" ordinal=\"0\" offset=\"0\" sl=\"8\" sc=\"9\" el=\"8\" ec=\"10\" bec=\"0\" bev=\"0\" fileid=\"4\" />\n                <SequencePoint vc=\"1\" uspid=\"34\" ordinal=\"1\" offset=\"1\" sl=\"9\" sc=\"13\" el=\"9\" ec=\"47\" bec=\"0\" bev=\"0\" fileid=\"4\" />\n                <SequencePoint vc=\"1\" uspid=\"35\" ordinal=\"2\" offset=\"13\" sl=\"10\" sc=\"13\" el=\"10\" ec=\"52\" bec=\"0\" bev=\"0\" fileid=\"4\" />\n                <SequencePoint vc=\"1\" uspid=\"36\" ordinal=\"3\" offset=\"25\" sl=\"11\" sc=\"9\" el=\"11\" ec=\"10\" bec=\"0\" bev=\"0\" fileid=\"4\" />\n              </SequencePoints>\n              <BranchPoints />\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"1\" uspid=\"33\" ordinal=\"0\" offset=\"0\" sl=\"8\" sc=\"9\" el=\"8\" ec=\"10\" bec=\"0\" bev=\"0\" fileid=\"4\" />\n            </Method>\n            <Method visited=\"false\" cyclomaticComplexity=\"1\" nPathComplexity=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" crapScore=\"2\" isConstructor=\"true\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" maxCrapScore=\"2\" minCrapScore=\"2\" visitedClasses=\"0\" numClasses=\"0\" visitedMethods=\"0\" numMethods=\"0\" />\n              <MetadataToken>100663311</MetadataToken>\n              <Name>System.Void GetSet.FooCallsBar::.ctor()</Name>\n              <SequencePoints />\n              <BranchPoints />\n              <MethodPoint vc=\"0\" uspid=\"37\" ordinal=\"0\" offset=\"0\" />\n            </Method>\n          </Methods>\n        </Class>\n      </Classes>\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"57-3F-D6-FE-63-EA-91-95-B9-00-43-52-80-9C-53-B3-35-C6-78-49\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.VisualStudio.QualityTools.ExecutionCommon.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.QualityTools.ExecutionCommon</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"24-1F-39-C7-BB-07-E7-36-EA-E1-73-6A-DA-FF-F6-14-68-82-90-8C\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.VisualStudio.QualityTools.Resource.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.QualityTools.Resource</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"01-FF-C0-3F-50-34-88-96-3D-0B-32-43-6C-6E-0B-77-AB-E9-65-F2\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.VisualStudio.QualityTools.WebTestFramework.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.QualityTools.WebTestFramework</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"B4-5F-71-54-5A-B1-43-E8-C8-B1-6F-51-A6-9A-FB-F3-EF-09-6F-71\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.ObjectModel</ModuleName>\n      <Classes />\n    </Module>\n    <Module skippedDueTo=\"MissingPdb\" hash=\"B4-5F-71-54-5A-B1-43-E8-C8-B1-6F-51-A6-9A-FB-F3-EF-09-6F-71\">\n      <ModulePath>C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll</ModulePath>\n      <ModuleTime>2020-01-13T13:43:12.2277411Z</ModuleTime>\n      <ModuleName>Microsoft.VisualStudio.TestPlatform.ObjectModel</ModuleName>\n      <Classes />\n    </Module>\n  </Modules>\n</CoverageSession>"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/opencover/wrong_start_line.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<CoverageSession xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n  <Summary numSequencePoints=\"28\" visitedSequencePoints=\"20\" numBranchPoints=\"12\" visitedBranchPoints=\"8\" sequenceCoverage=\"71.43\" branchCoverage=\"66.67\" maxCyclomaticComplexity=\"4\" minCyclomaticComplexity=\"1\" />\n    <Module hash=\"DE-2D-20-DB-C7-7A-F5-8E-3C-33-9B-1D-83-2A-1E-48-F8-A8-EB-7B\">\n      <Summary numSequencePoints=\"6\" visitedSequencePoints=\"6\" numBranchPoints=\"2\" visitedBranchPoints=\"2\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n      <FullName>C:\\Users\\Dinesh\\Documents\\Visual Studio 2010\\Projects\\CSharpPlayground\\MyLibraryNUnitTest\\bin\\Debug\\MyLibraryNUnitTest.dll</FullName>\n      <ModuleName>MyLibraryNUnitTest</ModuleName>\n      <Files>\n        <File uid=\"1\" fullPath=\"MyLibraryNUnitTest\\AdderNUnitTest.cs\" />\n      </Files>\n      <Classes>\n        <Class>\n          <Summary numSequencePoints=\"0\" visitedSequencePoints=\"0\" numBranchPoints=\"0\" visitedBranchPoints=\"0\" sequenceCoverage=\"0\" branchCoverage=\"0\" maxCyclomaticComplexity=\"0\" minCyclomaticComplexity=\"0\" />\n          <FullName>&lt;Module&gt;</FullName>\n          <Methods />\n        </Class>\n        <Class>\n          <Summary numSequencePoints=\"6\" visitedSequencePoints=\"6\" numBranchPoints=\"2\" visitedBranchPoints=\"2\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n          <FullName>MyLibraryNUnitTest.AdderNUnitTest</FullName>\n          <Methods>\n            <Method visited=\"true\" cyclomaticComplexity=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\n              <Summary numSequencePoints=\"3\" visitedSequencePoints=\"3\" numBranchPoints=\"1\" visitedBranchPoints=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" maxCyclomaticComplexity=\"1\" minCyclomaticComplexity=\"1\" />\n              <MetadataToken>100663297</MetadataToken>\n              <Name>System.Void MyLibraryNUnitTest.AdderNUnitTest::Add()</Name>\n              <FileRef uid=\"1\" />\n              <SequencePoints>\n                <SequencePoint vc=\"1\" uspid=\"1\" ordinal=\"0\" offset=\"0\" sl=\"foo\" el=\"16\" ec=\"10\" />\n              </SequencePoints>\n              <BranchPoints />\n              <MethodPoint xsi:type=\"SequencePoint\" vc=\"1\" uspid=\"1\" ordinal=\"0\" offset=\"0\" sl=\"16\" sc=\"9\" el=\"16\" ec=\"10\" />\n            </Method>\n          </Methods>\n        </Class>\n      </Classes>\n    </Module>\n  </Modules>\n</CoverageSession>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/samples/ReadMe.md",
    "content": "# Sample projects\n\nThe projects in this folder are used for generating samples like unit test or coverage reports.\n\n## How to generate test reports\n\n### xUnit\n\n```powershell\ndotnet test .\\Calculator.xUnit\\Calculator.xUnit.csproj --logger:xunit\n```\n\n### MSTest\n\n```powershell\ndotnet test .\\Calculator.MSTest\\Calculator.MSTest.csproj --logger:trx\n```\n\n### NUnit 3 & 4\n\n```powershell\ndotnet test .\\Calculator.NUnit3\\Calculator.NUnit3.csproj --logger:nunit\ndotnet test .\\Calculator.NUnit4\\Calculator.NUnit4.csproj --logger:nunit\n```\n\n## Delete all the test results folders\n\n```powershell\nGet-ChildItem . -Include TestResults -Recurse -Force | Remove-Item -Recurse -Force\n```\n\n## Regenerate all the test reports\n\n```powershell\n# Delete all the test results folders\nGet-ChildItem . -Include TestResults -Recurse -Force | Remove-Item -Recurse -Force\n\n# Rebuild the solution\ndotnet clean\ndotnet build --no-incremental -nr:false\n\n# Run the tests and generate the test reports\ndotnet test .\\Calculator.xUnit\\Calculator.xUnit.csproj --logger:xunit\ndotnet test .\\Calculator.MSTest\\Calculator.MSTest.csproj --logger:trx\ndotnet test .\\Calculator.NUnit3\\Calculator.NUnit3.csproj --logger:nunit\ndotnet test .\\Calculator.NUnit4\\Calculator.NUnit4.csproj --logger:nunit\n```\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/samples/csharp/Calculator/Calculator/Calculator.cs",
    "content": "﻿namespace Calculator;\n\npublic class Calculator\n{\n    public int Add(int a, int b, Predicate<int> predicate)\n    {\n        var sum = a + b;\n        return predicate(sum)\n            ? sum\n            : 0;\n    }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/samples/csharp/Calculator/Calculator/Calculator.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n    <PropertyGroup>\n        <TargetFramework>net9.0</TargetFramework>\n        <ImplicitUsings>enable</ImplicitUsings>\n        <Nullable>enable</Nullable>\n    </PropertyGroup>\n\n</Project>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/samples/csharp/Calculator/Calculator/packages.lock.json",
    "content": "{\n  \"version\": 1,\n  \"dependencies\": {\n    \"net9.0\": {}\n  }\n}"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/samples/csharp/Calculator/Calculator.MSTest/Calculator.MSTest.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n    <PropertyGroup>\n        <TargetFramework>net9.0</TargetFramework>\n        <LangVersion>latest</LangVersion>\n        <ImplicitUsings>enable</ImplicitUsings>\n        <Nullable>enable</Nullable>\n        <RootNamespace>Calculator.Tests</RootNamespace>\n    </PropertyGroup>\n\n    <ItemGroup>\n        <PackageReference Include=\"Microsoft.NET.Test.Sdk\" Version=\"17.12.0\" />\n        <PackageReference Include=\"MSTest\" Version=\"3.6.3\" />\n    </ItemGroup>\n\n    <ItemGroup>\n        <Using Include=\"Microsoft.VisualStudio.TestTools.UnitTesting\"/>\n    </ItemGroup>\n\n    <ItemGroup>\n      <ProjectReference Include=\"..\\Calculator\\Calculator.csproj\" />\n    </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/samples/csharp/Calculator/Calculator.MSTest/CalculatorTests.cs",
    "content": "﻿namespace Calculator.Tests;\n\n[TestClass]\npublic sealed class CalculatorTests\n{\n    [TestMethod]\n    public void TestMethod1()\n    {\n        var calculator = new Calculator();\n        var result = calculator.Add(1, 2, x => x > 0);\n        Assert.AreEqual(3, result);\n    }\n\n    [TestMethod]\n    public void GenericMethod<T>() where T : class =>\n        Assert.AreEqual(1, 1);\n}\n\n[TestClass]\npublic abstract class BaseClass<T> where T : class\n{\n    [TestMethod]\n    public void TestMethodInBaseClass() =>\n        Assert.AreEqual(1, 1);\n\n    [TestMethod]\n    public virtual void VirtualMethodInBaseClass() =>\n        Assert.AreEqual(1, 1);\n}\n\n[TestClass]\npublic sealed class Derived : BaseClass<string>\n{\n    [TestMethod]\n    public override void VirtualMethodInBaseClass() =>\n        Assert.AreEqual(1, 1);\n}\n\n[TestClass]\npublic sealed class GenericCalculatorTests<T> : BaseClass<T> where T : class\n{\n    [TestMethod]\n    public void Method() =>\n        Assert.AreEqual(1, 1);\n\n    [TestMethod]\n    public void GenericMethod<T>() =>\n        Assert.AreEqual(1, 1);\n\n    [TestMethod]\n    public override void VirtualMethodInBaseClass() =>\n        Assert.AreEqual(1, 1);\n}\n\n[TestClass]\npublic class GenericTests\n{\n    [DataTestMethod]\n    [DataRow(typeof(int))]\n    [DataRow(typeof(string))]\n    public void GenericTestMethod<T>(Type type)\n    {\n    }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/samples/csharp/Calculator/Calculator.MSTest/MSTestSettings.cs",
    "content": "﻿[assembly: Parallelize(Scope = ExecutionScope.MethodLevel)]\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/samples/csharp/Calculator/Calculator.MSTest/packages.lock.json",
    "content": "{\n  \"version\": 1,\n  \"dependencies\": {\n    \"net9.0\": {\n      \"Microsoft.NET.Test.Sdk\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[17.12.0, )\",\n        \"resolved\": \"17.12.0\",\n        \"contentHash\": \"kt/PKBZ91rFCWxVIJZSgVLk+YR+4KxTuHf799ho8WNiK5ZQpJNAEZCAWX86vcKrs+DiYjiibpYKdGZP6+/N17w==\",\n        \"dependencies\": {\n          \"Microsoft.CodeCoverage\": \"17.12.0\",\n          \"Microsoft.TestPlatform.TestHost\": \"17.12.0\"\n        }\n      },\n      \"MSTest\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[3.6.3, )\",\n        \"resolved\": \"3.6.3\",\n        \"contentHash\": \"1W6UIJK6RJMIDHWVZ+TlEnzGG0TwhKgY6qlPIo1dc/qvHPKOL3XpN8lv1+VHspibv+7gq/76dYlT2y0S44aopg==\",\n        \"dependencies\": {\n          \"MSTest.Analyzers\": \"[3.6.3]\",\n          \"MSTest.TestAdapter\": \"[3.6.3]\",\n          \"MSTest.TestFramework\": \"[3.6.3]\",\n          \"Microsoft.NET.Test.Sdk\": \"17.11.1\"\n        }\n      },\n      \"Microsoft.ApplicationInsights\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.22.0\",\n        \"contentHash\": \"3AOM9bZtku7RQwHyMEY3tQMrHIgjcfRDa6YQpd/QG2LDGvMydSlL9Di+8LLMt7J2RDdfJ7/2jdYv6yHcMJAnNw==\",\n        \"dependencies\": {\n          \"System.Diagnostics.DiagnosticSource\": \"5.0.0\"\n        }\n      },\n      \"Microsoft.CodeCoverage\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"17.12.0\",\n        \"contentHash\": \"4svMznBd5JM21JIG2xZKGNanAHNXplxf/kQDFfLHXQ3OnpJkayRK/TjacFjA+EYmoyuNXHo/sOETEfcYtAzIrA==\"\n      },\n      \"Microsoft.Testing.Extensions.Telemetry\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.4.3\",\n        \"contentHash\": \"dh8jnqWikxQXJ4kWy8B82PtSAlQCnvDKh1128arDmSW5OU5xWA84HwruV3TanXi3ZjIHn1wWFCgtMOhcDNwBow==\",\n        \"dependencies\": {\n          \"Microsoft.ApplicationInsights\": \"2.22.0\",\n          \"Microsoft.Testing.Platform\": \"1.4.3\"\n        }\n      },\n      \"Microsoft.Testing.Extensions.TrxReport.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.4.3\",\n        \"contentHash\": \"16sWznD6ZMok/zgW+vrO6zerCFMD9N+ey9bi1iV/e9xxsQb4V4y/aW6cY/Y7E9jA7pc+aZ6ffZby43yxQOoYZA==\",\n        \"dependencies\": {\n          \"Microsoft.Testing.Platform\": \"1.4.3\"\n        }\n      },\n      \"Microsoft.Testing.Extensions.VSTestBridge\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.4.3\",\n        \"contentHash\": \"xZ6oyNYh2aM5Wb+HJAy1fj2C4CNRVhINXHCjlWs/2C8hEIpdqVSpP3y6HWUN40KpFqyGD4myHGR1Rflm28UpcQ==\",\n        \"dependencies\": {\n          \"Microsoft.ApplicationInsights\": \"2.22.0\",\n          \"Microsoft.TestPlatform.ObjectModel\": \"17.11.1\",\n          \"Microsoft.Testing.Extensions.Telemetry\": \"1.4.3\",\n          \"Microsoft.Testing.Extensions.TrxReport.Abstractions\": \"1.4.3\",\n          \"Microsoft.Testing.Platform\": \"1.4.3\"\n        }\n      },\n      \"Microsoft.Testing.Platform\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.4.3\",\n        \"contentHash\": \"NedIbwl1T7+ZMeg7gwk0Db8/RFLf0siyVpeTcRMMOle6Xl/ujaYOM4Aduo8rEfVqNj3kcQ7blegpyT3dHi+0PA==\"\n      },\n      \"Microsoft.Testing.Platform.MSBuild\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.4.3\",\n        \"contentHash\": \"1gGqgHtiZ6tZn/6Tby+qlKpNe5Ye/5LnxlSsyl4XMZ4m4V+Cu1K1m+gD1zxoxHIvLjgX8mCnQRK95MGBBFuumw==\",\n        \"dependencies\": {\n          \"Microsoft.Testing.Platform\": \"1.4.3\"\n        }\n      },\n      \"Microsoft.TestPlatform.ObjectModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"17.12.0\",\n        \"contentHash\": \"TDqkTKLfQuAaPcEb3pDDWnh7b3SyZF+/W9OZvWFp6eJCIiiYFdSB6taE2I6tWrFw5ywhzOb6sreoGJTI6m3rSQ==\",\n        \"dependencies\": {\n          \"System.Reflection.Metadata\": \"1.6.0\"\n        }\n      },\n      \"Microsoft.TestPlatform.TestHost\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"17.12.0\",\n        \"contentHash\": \"MiPEJQNyADfwZ4pJNpQex+t9/jOClBGMiCiVVFuELCMSX2nmNfvUor3uFVxNNCg30uxDP8JDYfPnMXQzsfzYyg==\",\n        \"dependencies\": {\n          \"Microsoft.TestPlatform.ObjectModel\": \"17.12.0\",\n          \"Newtonsoft.Json\": \"13.0.1\"\n        }\n      },\n      \"MSTest.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"3.6.3\",\n        \"contentHash\": \"TfM4wkpgJ9YKqQp3BjDGLCAckRwEuRvcE6Nw4Ge3r8dw6GOCpFKavyigTyD+IjV3SoMd0LvUDdjh5MGW0Oe8Wg==\"\n      },\n      \"MSTest.TestAdapter\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"3.6.3\",\n        \"contentHash\": \"i3KbdAjLO0W9xlvbhZa9u0wh6X+VZ1yTBsUVlVKtx8B9CXa4rFXPcx3yPysB9gbALmhgAjFza4RRoNyXY9IoXQ==\",\n        \"dependencies\": {\n          \"Microsoft.Testing.Extensions.VSTestBridge\": \"1.4.3\",\n          \"Microsoft.Testing.Platform.MSBuild\": \"1.4.3\"\n        }\n      },\n      \"MSTest.TestFramework\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"3.6.3\",\n        \"contentHash\": \"jockRcUoLJMeHzLqFcMnZBrWy7tS32JP7shlepDDJuf5A6HO2PwAefXzhvprcWNkfpEwmR0KihSO2HRXwNbTng==\"\n      },\n      \"Newtonsoft.Json\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"13.0.1\",\n        \"contentHash\": \"ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==\"\n      },\n      \"System.Diagnostics.DiagnosticSource\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.0.0\",\n        \"contentHash\": \"tCQTzPsGZh/A9LhhA6zrqCRV4hOHsK90/G7q3Khxmn6tnB1PuNU0cRaKANP2AWcF9bn0zsuOoZOSrHuJk6oNBA==\"\n      },\n      \"System.Reflection.Metadata\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.6.0\",\n        \"contentHash\": \"COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==\"\n      },\n      \"calculator\": {\n        \"type\": \"Project\"\n      }\n    }\n  }\n}"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/samples/csharp/Calculator/Calculator.NUnit3/Calculator.NUnit3.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n    <PropertyGroup>\n        <TargetFramework>net9.0</TargetFramework>\n        <LangVersion>latest</LangVersion>\n        <ImplicitUsings>enable</ImplicitUsings>\n        <Nullable>enable</Nullable>\n        <IsPackable>false</IsPackable>\n    </PropertyGroup>\n\n    <ItemGroup>\n        <PackageReference Include=\"coverlet.collector\" Version=\"6.0.2\"/>\n        <PackageReference Include=\"Microsoft.NET.Test.Sdk\" Version=\"17.12.0\" />\n        <PackageReference Include=\"NUnit\" Version=\"3.14.0\"/>\n        <PackageReference Include=\"NUnit.Analyzers\" Version=\"3.10.0\"/>\n        <PackageReference Include=\"NUnit3TestAdapter\" Version=\"3.17.0\"/>\n        <PackageReference Include=\"NunitXml.TestLogger\" Version=\"3.1.20\" />\n    </ItemGroup>\n\n    <ItemGroup>\n        <Using Include=\"NUnit.Framework\"/>\n    </ItemGroup>\n\n    <ItemGroup>\n      <ProjectReference Include=\"..\\Calculator\\Calculator.csproj\" />\n    </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/samples/csharp/Calculator/Calculator.NUnit3/CalculatorTests.cs",
    "content": "﻿namespace Calculator.NUnit3;\n\n[TestFixture]\npublic class Tests\n{\n    [Test]\n    public void TestMethod1()\n    {\n        var calculator = new Calculator();\n        var result = calculator.Add(1, 2, x => x > 0);\n        Assert.That(result, Is.EqualTo(3));\n    }\n}\n\n[TestFixture]\npublic class BaseClass<T> where T : class\n{\n    [Test]\n    public void TestMethodInBaseClass() =>\n        Assert.AreEqual(1, 1);\n\n    [Test]\n    public virtual void VirtualMethodInBaseClass() =>\n        Assert.AreEqual(1, 1);\n}\n\n[TestFixture]\npublic sealed class Derived : BaseClass<string>\n{\n    [Test]\n    public override void VirtualMethodInBaseClass() =>\n        Assert.AreEqual(1, 1);\n}\n\n[TestFixture]\npublic sealed class GenericCalculatorTests<T> : BaseClass<T> where T : class\n{\n    [Test]\n    public void Method() =>\n        Assert.AreEqual(1, 1);\n\n    [Test]\n    public void GenericMethod<T>() =>\n        Assert.AreEqual(1, 1);\n\n    [Test]\n    public override void VirtualMethodInBaseClass() =>\n        Assert.AreEqual(1, 1);\n}\n\n[TestFixture]\npublic class GenericTests\n{\n    [TestCase(42)]\n    [TestCase(\"string\")]\n    [TestCase(double.Epsilon)]\n    public void GenericTest<T>(T instance)\n    {\n        Console.WriteLine(instance);\n    }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/samples/csharp/Calculator/Calculator.NUnit3/packages.lock.json",
    "content": "{\n  \"version\": 1,\n  \"dependencies\": {\n    \"net9.0\": {\n      \"coverlet.collector\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[6.0.2, )\",\n        \"resolved\": \"6.0.2\",\n        \"contentHash\": \"bJShQ6uWRTQ100ZeyiMqcFlhP7WJ+bCuabUs885dJiBEzMsJMSFr7BOyeCw4rgvQokteGi5rKQTlkhfQPUXg2A==\"\n      },\n      \"Microsoft.NET.Test.Sdk\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[17.12.0, )\",\n        \"resolved\": \"17.12.0\",\n        \"contentHash\": \"kt/PKBZ91rFCWxVIJZSgVLk+YR+4KxTuHf799ho8WNiK5ZQpJNAEZCAWX86vcKrs+DiYjiibpYKdGZP6+/N17w==\",\n        \"dependencies\": {\n          \"Microsoft.CodeCoverage\": \"17.12.0\",\n          \"Microsoft.TestPlatform.TestHost\": \"17.12.0\"\n        }\n      },\n      \"NUnit\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[3.14.0, )\",\n        \"resolved\": \"3.14.0\",\n        \"contentHash\": \"R7iPwD7kbOaP3o2zldWJbWeMQAvDKD0uld27QvA3PAALl1unl7x0v2J7eGiJOYjimV/BuGT4VJmr45RjS7z4LA==\",\n        \"dependencies\": {\n          \"NETStandard.Library\": \"2.0.0\"\n        }\n      },\n      \"NUnit.Analyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[3.10.0, )\",\n        \"resolved\": \"3.10.0\",\n        \"contentHash\": \"+F2deTIQms+hJNzuoO68zgP1ftH61+meBx8iMn/90owv+eZpFTyQberapJ87jBm8f22/mwQnWufemjEVIvW11g==\"\n      },\n      \"NUnit3TestAdapter\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[3.17.0, )\",\n        \"resolved\": \"3.17.0\",\n        \"contentHash\": \"I9MNvK+GM2yXrHPitwZkAZKU9sYI2OO/8wKC+VuBD7V3z+ySQ1pSopX/urr0ooedI8/TIcajYPRO4vGRr7AM8A==\",\n        \"dependencies\": {\n          \"Microsoft.DotNet.InternalAbstractions\": \"1.0.0\",\n          \"System.ComponentModel.EventBasedAsync\": \"4.3.0\",\n          \"System.ComponentModel.TypeConverter\": \"4.3.0\",\n          \"System.Diagnostics.Process\": \"4.3.0\",\n          \"System.Reflection\": \"4.3.0\",\n          \"System.Runtime.InteropServices.RuntimeInformation\": \"4.3.0\",\n          \"System.Threading.Thread\": \"4.3.0\",\n          \"System.Xml.XPath.XmlDocument\": \"4.3.0\",\n          \"System.Xml.XmlDocument\": \"4.3.0\"\n        }\n      },\n      \"NunitXml.TestLogger\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[3.1.20, )\",\n        \"resolved\": \"3.1.20\",\n        \"contentHash\": \"Pd9EYPNsQGaKYW+F+l7vTuvDjp8tzTYLqqfLM1Sz5WwLHhvnaJArQZjw/93WF3i07Rxb50WFVu0kjrjKCVFHDg==\"\n      },\n      \"Microsoft.CodeCoverage\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"17.12.0\",\n        \"contentHash\": \"4svMznBd5JM21JIG2xZKGNanAHNXplxf/kQDFfLHXQ3OnpJkayRK/TjacFjA+EYmoyuNXHo/sOETEfcYtAzIrA==\"\n      },\n      \"Microsoft.DotNet.InternalAbstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.0.0\",\n        \"contentHash\": \"AAguUq7YyKk3yDWPoWA8DrLZvURxB/LrDdTn1h5lmPeznkFUpfC3p459w5mQYQE0qpquf/CkSQZ0etiV5vRHFA==\",\n        \"dependencies\": {\n          \"System.AppContext\": \"4.1.0\",\n          \"System.Collections\": \"4.0.11\",\n          \"System.IO\": \"4.1.0\",\n          \"System.IO.FileSystem\": \"4.0.1\",\n          \"System.Reflection.TypeExtensions\": \"4.1.0\",\n          \"System.Runtime.Extensions\": \"4.1.0\",\n          \"System.Runtime.InteropServices\": \"4.1.0\",\n          \"System.Runtime.InteropServices.RuntimeInformation\": \"4.0.0\"\n        }\n      },\n      \"Microsoft.NETCore.Platforms\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.1.0\",\n        \"contentHash\": \"kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==\"\n      },\n      \"Microsoft.NETCore.Targets\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.1.0\",\n        \"contentHash\": \"aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg==\"\n      },\n      \"Microsoft.TestPlatform.ObjectModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"17.12.0\",\n        \"contentHash\": \"TDqkTKLfQuAaPcEb3pDDWnh7b3SyZF+/W9OZvWFp6eJCIiiYFdSB6taE2I6tWrFw5ywhzOb6sreoGJTI6m3rSQ==\",\n        \"dependencies\": {\n          \"System.Reflection.Metadata\": \"1.6.0\"\n        }\n      },\n      \"Microsoft.TestPlatform.TestHost\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"17.12.0\",\n        \"contentHash\": \"MiPEJQNyADfwZ4pJNpQex+t9/jOClBGMiCiVVFuELCMSX2nmNfvUor3uFVxNNCg30uxDP8JDYfPnMXQzsfzYyg==\",\n        \"dependencies\": {\n          \"Microsoft.TestPlatform.ObjectModel\": \"17.12.0\",\n          \"Newtonsoft.Json\": \"13.0.1\"\n        }\n      },\n      \"Microsoft.Win32.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"9ZQKCWxH7Ijp9BfahvL2Zyf1cJIk8XYLF6Yjzr2yi0b2cOut/HQ31qf1ThHAgCc3WiZMdnWcfJCgN82/0UunxA==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.1.0\",\n          \"Microsoft.NETCore.Targets\": \"1.1.0\",\n          \"System.Runtime\": \"4.3.0\"\n        }\n      },\n      \"Microsoft.Win32.Registry\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"Lw1/VwLH1yxz6SfFEjVRCN0pnflLEsWgnV4qsdJ512/HhTwnKXUG+zDQ4yTO3K/EJQemGoNaBHX5InISNKTzUQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.1.0\",\n          \"System.Collections\": \"4.3.0\",\n          \"System.Globalization\": \"4.3.0\",\n          \"System.Resources.ResourceManager\": \"4.3.0\",\n          \"System.Runtime\": \"4.3.0\",\n          \"System.Runtime.Extensions\": \"4.3.0\",\n          \"System.Runtime.Handles\": \"4.3.0\",\n          \"System.Runtime.InteropServices\": \"4.3.0\"\n        }\n      },\n      \"NETStandard.Library\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.0.0\",\n        \"contentHash\": \"7jnbRU+L08FXKMxqUflxEXtVymWvNOrS8yHgu9s6EM8Anr6T/wIX4nZ08j/u3Asz+tCufp3YVwFSEvFTPYmBPA==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.1.0\"\n        }\n      },\n      \"Newtonsoft.Json\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"13.0.1\",\n        \"contentHash\": \"ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==\"\n      },\n      \"runtime.native.System\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"c/qWt2LieNZIj1jGnVNsE2Kl23Ya2aSTBuXMD6V7k9KWr6l16Tqdwq+hJScEpWER9753NWC8h96PaVNY5Ld7Jw==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.1.0\",\n          \"Microsoft.NETCore.Targets\": \"1.1.0\"\n        }\n      },\n      \"System.AppContext\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"3QjO4jNV7PdKkmQAVp9atA+usVnKRwI3Kx1nMwJ93T0LcQfx7pKAYk0nKz5wn1oP5iqlhZuy6RXOFdhr7rDwow==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.1.0\"\n        }\n      },\n      \"System.Collections\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"3Dcj85/TBdVpL5Zr+gEEBUuFe2icOnLalmEh9hfck1PTYbbyWuZgh4fmm2ysCLTrqLQw6t3TgTyJ+VLp+Qb+Lw==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.1.0\",\n          \"Microsoft.NETCore.Targets\": \"1.1.0\",\n          \"System.Runtime\": \"4.3.0\"\n        }\n      },\n      \"System.Collections.NonGeneric\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"prtjIEMhGUnQq6RnPEYLpFt8AtLbp9yq2zxOSrY7KJJZrw25Fi97IzBqY7iqssbM61Ek5b8f3MG/sG1N2sN5KA==\",\n        \"dependencies\": {\n          \"System.Diagnostics.Debug\": \"4.3.0\",\n          \"System.Globalization\": \"4.3.0\",\n          \"System.Resources.ResourceManager\": \"4.3.0\",\n          \"System.Runtime\": \"4.3.0\",\n          \"System.Runtime.Extensions\": \"4.3.0\",\n          \"System.Threading\": \"4.3.0\"\n        }\n      },\n      \"System.Collections.Specialized\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"Epx8PoVZR0iuOnJJDzp7pWvdfMMOAvpUo95pC4ScH2mJuXkKA2Y4aR3cG9qt2klHgSons1WFh4kcGW7cSXvrxg==\",\n        \"dependencies\": {\n          \"System.Collections.NonGeneric\": \"4.3.0\",\n          \"System.Globalization\": \"4.3.0\",\n          \"System.Globalization.Extensions\": \"4.3.0\",\n          \"System.Resources.ResourceManager\": \"4.3.0\",\n          \"System.Runtime\": \"4.3.0\",\n          \"System.Runtime.Extensions\": \"4.3.0\",\n          \"System.Threading\": \"4.3.0\"\n        }\n      },\n      \"System.ComponentModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"VyGn1jGRZVfxnh8EdvDCi71v3bMXrsu8aYJOwoV7SNDLVhiEqwP86pPMyRGsDsxhXAm2b3o9OIqeETfN5qfezw==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.3.0\"\n        }\n      },\n      \"System.ComponentModel.EventBasedAsync\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"fCFl8f0XdwA/BuoNrVBB5D0Y48/hv2J+w4xSDdXQitXZsR6UCSOrDVE7TCUraY802ENwcHUnUCv4En8CupDU1g==\",\n        \"dependencies\": {\n          \"System.Resources.ResourceManager\": \"4.3.0\",\n          \"System.Runtime\": \"4.3.0\",\n          \"System.Threading\": \"4.3.0\",\n          \"System.Threading.Tasks\": \"4.3.0\"\n        }\n      },\n      \"System.ComponentModel.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"j8GUkCpM8V4d4vhLIIoBLGey2Z5bCkMVNjEZseyAlm4n5arcsJOeI3zkUP+zvZgzsbLTYh4lYeP/ZD/gdIAPrw==\",\n        \"dependencies\": {\n          \"System.ComponentModel\": \"4.3.0\",\n          \"System.Resources.ResourceManager\": \"4.3.0\",\n          \"System.Runtime\": \"4.3.0\"\n        }\n      },\n      \"System.ComponentModel.TypeConverter\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"16pQ6P+EdhcXzPiEK4kbA953Fu0MNG2ovxTZU81/qsCd1zPRsKc3uif5NgvllCY598k6bI0KUyKW8fanlfaDQg==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.3.0\",\n          \"System.Collections.NonGeneric\": \"4.3.0\",\n          \"System.Collections.Specialized\": \"4.3.0\",\n          \"System.ComponentModel\": \"4.3.0\",\n          \"System.ComponentModel.Primitives\": \"4.3.0\",\n          \"System.Globalization\": \"4.3.0\",\n          \"System.Linq\": \"4.3.0\",\n          \"System.Reflection\": \"4.3.0\",\n          \"System.Reflection.Extensions\": \"4.3.0\",\n          \"System.Reflection.Primitives\": \"4.3.0\",\n          \"System.Reflection.TypeExtensions\": \"4.3.0\",\n          \"System.Resources.ResourceManager\": \"4.3.0\",\n          \"System.Runtime\": \"4.3.0\",\n          \"System.Runtime.Extensions\": \"4.3.0\",\n          \"System.Threading\": \"4.3.0\"\n        }\n      },\n      \"System.Diagnostics.Debug\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"ZUhUOdqmaG5Jk3Xdb8xi5kIyQYAA4PnTNlHx1mu9ZY3qv4ELIdKbnL/akbGaKi2RnNUWaZsAs31rvzFdewTj2g==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.1.0\",\n          \"Microsoft.NETCore.Targets\": \"1.1.0\",\n          \"System.Runtime\": \"4.3.0\"\n        }\n      },\n      \"System.Diagnostics.Process\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"J0wOX07+QASQblsfxmIMFc9Iq7KTXYL3zs2G/Xc704Ylv3NpuVdo6gij6V3PGiptTxqsK0K7CdXenRvKUnkA2g==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.1.0\",\n          \"Microsoft.Win32.Primitives\": \"4.3.0\",\n          \"Microsoft.Win32.Registry\": \"4.3.0\",\n          \"System.Collections\": \"4.3.0\",\n          \"System.Diagnostics.Debug\": \"4.3.0\",\n          \"System.Globalization\": \"4.3.0\",\n          \"System.IO\": \"4.3.0\",\n          \"System.IO.FileSystem\": \"4.3.0\",\n          \"System.IO.FileSystem.Primitives\": \"4.3.0\",\n          \"System.Resources.ResourceManager\": \"4.3.0\",\n          \"System.Runtime\": \"4.3.0\",\n          \"System.Runtime.Extensions\": \"4.3.0\",\n          \"System.Runtime.Handles\": \"4.3.0\",\n          \"System.Runtime.InteropServices\": \"4.3.0\",\n          \"System.Text.Encoding\": \"4.3.0\",\n          \"System.Text.Encoding.Extensions\": \"4.3.0\",\n          \"System.Threading\": \"4.3.0\",\n          \"System.Threading.Tasks\": \"4.3.0\",\n          \"System.Threading.Thread\": \"4.3.0\",\n          \"System.Threading.ThreadPool\": \"4.3.0\",\n          \"runtime.native.System\": \"4.3.0\"\n        }\n      },\n      \"System.Globalization\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"kYdVd2f2PAdFGblzFswE4hkNANJBKRmsfa2X5LG2AcWE1c7/4t0pYae1L8vfZ5xvE2nK/R9JprtToA61OSHWIg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.1.0\",\n          \"Microsoft.NETCore.Targets\": \"1.1.0\",\n          \"System.Runtime\": \"4.3.0\"\n        }\n      },\n      \"System.Globalization.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"FhKmdR6MPG+pxow6wGtNAWdZh7noIOpdD5TwQ3CprzgIE1bBBoim0vbR1+AWsWjQmU7zXHgQo4TWSP6lCeiWcQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.1.0\",\n          \"System.Globalization\": \"4.3.0\",\n          \"System.Resources.ResourceManager\": \"4.3.0\",\n          \"System.Runtime\": \"4.3.0\",\n          \"System.Runtime.Extensions\": \"4.3.0\",\n          \"System.Runtime.InteropServices\": \"4.3.0\"\n        }\n      },\n      \"System.IO\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"3qjaHvxQPDpSOYICjUoTsmoq5u6QJAFRUITgeT/4gqkF1bajbSmb1kwSxEA8AHlofqgcKJcM8udgieRNhaJ5Cg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.1.0\",\n          \"Microsoft.NETCore.Targets\": \"1.1.0\",\n          \"System.Runtime\": \"4.3.0\",\n          \"System.Text.Encoding\": \"4.3.0\",\n          \"System.Threading.Tasks\": \"4.3.0\"\n        }\n      },\n      \"System.IO.FileSystem\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"3wEMARTnuio+ulnvi+hkRNROYwa1kylvYahhcLk4HSoVdl+xxTFVeVlYOfLwrDPImGls0mDqbMhrza8qnWPTdA==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.1.0\",\n          \"Microsoft.NETCore.Targets\": \"1.1.0\",\n          \"System.IO\": \"4.3.0\",\n          \"System.IO.FileSystem.Primitives\": \"4.3.0\",\n          \"System.Runtime\": \"4.3.0\",\n          \"System.Runtime.Handles\": \"4.3.0\",\n          \"System.Text.Encoding\": \"4.3.0\",\n          \"System.Threading.Tasks\": \"4.3.0\"\n        }\n      },\n      \"System.IO.FileSystem.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"6QOb2XFLch7bEc4lIcJH49nJN2HV+OC3fHDgsLVsBVBk3Y4hFAnOBGzJ2lUu7CyDDFo9IBWkSsnbkT6IBwwiMw==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.3.0\"\n        }\n      },\n      \"System.Linq\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"5DbqIUpsDp0dFftytzuMmc0oeMdQwjcP/EWxsksIz/w1TcFRkZ3yKKz0PqiYFMmEwPSWw+qNVqD7PJ889JzHbw==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.3.0\",\n          \"System.Diagnostics.Debug\": \"4.3.0\",\n          \"System.Resources.ResourceManager\": \"4.3.0\",\n          \"System.Runtime\": \"4.3.0\",\n          \"System.Runtime.Extensions\": \"4.3.0\"\n        }\n      },\n      \"System.Reflection\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"KMiAFoW7MfJGa9nDFNcfu+FpEdiHpWgTcS2HdMpDvt9saK3y/G4GwprPyzqjFH9NTaGPQeWNHU+iDlDILj96aQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.1.0\",\n          \"Microsoft.NETCore.Targets\": \"1.1.0\",\n          \"System.IO\": \"4.3.0\",\n          \"System.Reflection.Primitives\": \"4.3.0\",\n          \"System.Runtime\": \"4.3.0\"\n        }\n      },\n      \"System.Reflection.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"rJkrJD3kBI5B712aRu4DpSIiHRtr6QlfZSQsb0hYHrDCZORXCFjQfoipo2LaMUHoT9i1B7j7MnfaEKWDFmFQNQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.1.0\",\n          \"Microsoft.NETCore.Targets\": \"1.1.0\",\n          \"System.Reflection\": \"4.3.0\",\n          \"System.Runtime\": \"4.3.0\"\n        }\n      },\n      \"System.Reflection.Metadata\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.6.0\",\n        \"contentHash\": \"COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==\"\n      },\n      \"System.Reflection.Primitives\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"5RXItQz5As4xN2/YUDxdpsEkMhvw3e6aNveFXUn4Hl/udNTCNhnKp8lT9fnc3MhvGKh1baak5CovpuQUXHAlIA==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.1.0\",\n          \"Microsoft.NETCore.Targets\": \"1.1.0\",\n          \"System.Runtime\": \"4.3.0\"\n        }\n      },\n      \"System.Reflection.TypeExtensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"7u6ulLcZbyxB5Gq0nMkQttcdBTx57ibzw+4IOXEfR+sXYQoHvjW5LTLyNr8O22UIMrqYbchJQJnos4eooYzYJA==\",\n        \"dependencies\": {\n          \"System.Reflection\": \"4.3.0\",\n          \"System.Runtime\": \"4.3.0\"\n        }\n      },\n      \"System.Resources.ResourceManager\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"/zrcPkkWdZmI4F92gL/TPumP98AVDu/Wxr3CSJGQQ+XN6wbRZcyfSKVoPo17ilb3iOr0cCRqJInGwNMolqhS8A==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.1.0\",\n          \"Microsoft.NETCore.Targets\": \"1.1.0\",\n          \"System.Globalization\": \"4.3.0\",\n          \"System.Reflection\": \"4.3.0\",\n          \"System.Runtime\": \"4.3.0\"\n        }\n      },\n      \"System.Runtime\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.1.0\",\n          \"Microsoft.NETCore.Targets\": \"1.1.0\"\n        }\n      },\n      \"System.Runtime.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"guW0uK0fn5fcJJ1tJVXYd7/1h5F+pea1r7FLSOz/f8vPEqbR2ZAknuRDvTQ8PzAilDveOxNjSfr0CHfIQfFk8g==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.1.0\",\n          \"Microsoft.NETCore.Targets\": \"1.1.0\",\n          \"System.Runtime\": \"4.3.0\"\n        }\n      },\n      \"System.Runtime.Handles\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"OKiSUN7DmTWeYb3l51A7EYaeNMnvxwE249YtZz7yooT4gOZhmTjIn48KgSsw2k2lYdLgTKNJw/ZIfSElwDRVgg==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.1.0\",\n          \"Microsoft.NETCore.Targets\": \"1.1.0\",\n          \"System.Runtime\": \"4.3.0\"\n        }\n      },\n      \"System.Runtime.InteropServices\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"uv1ynXqiMK8mp1GM3jDqPCFN66eJ5w5XNomaK2XD+TuCroNTLFGeZ+WCmBMcBDyTFKou3P6cR6J/QsaqDp7fGQ==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.1.0\",\n          \"Microsoft.NETCore.Targets\": \"1.1.0\",\n          \"System.Reflection\": \"4.3.0\",\n          \"System.Reflection.Primitives\": \"4.3.0\",\n          \"System.Runtime\": \"4.3.0\",\n          \"System.Runtime.Handles\": \"4.3.0\"\n        }\n      },\n      \"System.Runtime.InteropServices.RuntimeInformation\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"cbz4YJMqRDR7oLeMRbdYv7mYzc++17lNhScCX0goO2XpGWdvAt60CGN+FHdePUEHCe/Jy9jUlvNAiNdM+7jsOw==\",\n        \"dependencies\": {\n          \"System.Reflection\": \"4.3.0\",\n          \"System.Reflection.Extensions\": \"4.3.0\",\n          \"System.Resources.ResourceManager\": \"4.3.0\",\n          \"System.Runtime\": \"4.3.0\",\n          \"System.Runtime.InteropServices\": \"4.3.0\",\n          \"System.Threading\": \"4.3.0\",\n          \"runtime.native.System\": \"4.3.0\"\n        }\n      },\n      \"System.Text.Encoding\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.1.0\",\n          \"Microsoft.NETCore.Targets\": \"1.1.0\",\n          \"System.Runtime\": \"4.3.0\"\n        }\n      },\n      \"System.Text.Encoding.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"YVMK0Bt/A43RmwizJoZ22ei2nmrhobgeiYwFzC4YAN+nue8RF6djXDMog0UCn+brerQoYVyaS+ghy9P/MUVcmw==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.1.0\",\n          \"Microsoft.NETCore.Targets\": \"1.1.0\",\n          \"System.Runtime\": \"4.3.0\",\n          \"System.Text.Encoding\": \"4.3.0\"\n        }\n      },\n      \"System.Text.RegularExpressions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"RpT2DA+L660cBt1FssIE9CAGpLFdFPuheB7pLpKpn6ZXNby7jDERe8Ua/Ne2xGiwLVG2JOqziiaVCGDon5sKFA==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.3.0\"\n        }\n      },\n      \"System.Threading\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"VkUS0kOBcUf3Wwm0TSbrevDDZ6BlM+b/HRiapRFWjM5O0NS0LviG0glKmFK+hhPDd1XFeSdU1GmlLhb2CoVpIw==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.3.0\",\n          \"System.Threading.Tasks\": \"4.3.0\"\n        }\n      },\n      \"System.Threading.Tasks\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"LbSxKEdOUhVe8BezB/9uOGGppt+nZf6e1VFyw6v3DN6lqitm0OSn2uXMOdtP0M3W4iMcqcivm2J6UgqiwwnXiA==\",\n        \"dependencies\": {\n          \"Microsoft.NETCore.Platforms\": \"1.1.0\",\n          \"Microsoft.NETCore.Targets\": \"1.1.0\",\n          \"System.Runtime\": \"4.3.0\"\n        }\n      },\n      \"System.Threading.Tasks.Extensions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"npvJkVKl5rKXrtl1Kkm6OhOUaYGEiF9wFbppFRWSMoApKzt2PiPHT2Bb8a5sAWxprvdOAtvaARS9QYMznEUtug==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.3.0\",\n          \"System.Runtime\": \"4.3.0\",\n          \"System.Threading.Tasks\": \"4.3.0\"\n        }\n      },\n      \"System.Threading.Thread\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"OHmbT+Zz065NKII/ZHcH9XO1dEuLGI1L2k7uYss+9C1jLxTC9kTZZuzUOyXHayRk+dft9CiDf3I/QZ0t8JKyBQ==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.3.0\"\n        }\n      },\n      \"System.Threading.ThreadPool\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"k/+g4b7vjdd4aix83sTgC9VG6oXYKAktSfNIJUNGxPEj7ryEOfzHHhfnmsZvjxawwcD9HyWXKCXmPjX8U4zeSw==\",\n        \"dependencies\": {\n          \"System.Runtime\": \"4.3.0\",\n          \"System.Runtime.Handles\": \"4.3.0\"\n        }\n      },\n      \"System.Xml.ReaderWriter\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"GrprA+Z0RUXaR4N7/eW71j1rgMnEnEVlgii49GZyAjTH7uliMnrOU3HNFBr6fEDBCJCIdlVNq9hHbaDR621XBA==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.3.0\",\n          \"System.Diagnostics.Debug\": \"4.3.0\",\n          \"System.Globalization\": \"4.3.0\",\n          \"System.IO\": \"4.3.0\",\n          \"System.IO.FileSystem\": \"4.3.0\",\n          \"System.IO.FileSystem.Primitives\": \"4.3.0\",\n          \"System.Resources.ResourceManager\": \"4.3.0\",\n          \"System.Runtime\": \"4.3.0\",\n          \"System.Runtime.Extensions\": \"4.3.0\",\n          \"System.Runtime.InteropServices\": \"4.3.0\",\n          \"System.Text.Encoding\": \"4.3.0\",\n          \"System.Text.Encoding.Extensions\": \"4.3.0\",\n          \"System.Text.RegularExpressions\": \"4.3.0\",\n          \"System.Threading.Tasks\": \"4.3.0\",\n          \"System.Threading.Tasks.Extensions\": \"4.3.0\"\n        }\n      },\n      \"System.Xml.XmlDocument\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"lJ8AxvkX7GQxpC6GFCeBj8ThYVyQczx2+f/cWHJU8tjS7YfI6Cv6bon70jVEgs2CiFbmmM8b9j1oZVx0dSI2Ww==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.3.0\",\n          \"System.Diagnostics.Debug\": \"4.3.0\",\n          \"System.Globalization\": \"4.3.0\",\n          \"System.IO\": \"4.3.0\",\n          \"System.Resources.ResourceManager\": \"4.3.0\",\n          \"System.Runtime\": \"4.3.0\",\n          \"System.Runtime.Extensions\": \"4.3.0\",\n          \"System.Text.Encoding\": \"4.3.0\",\n          \"System.Threading\": \"4.3.0\",\n          \"System.Xml.ReaderWriter\": \"4.3.0\"\n        }\n      },\n      \"System.Xml.XPath\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"v1JQ5SETnQusqmS3RwStF7vwQ3L02imIzl++sewmt23VGygix04pEH+FCj1yWb+z4GDzKiljr1W7Wfvrx0YwgA==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.3.0\",\n          \"System.Diagnostics.Debug\": \"4.3.0\",\n          \"System.Globalization\": \"4.3.0\",\n          \"System.IO\": \"4.3.0\",\n          \"System.Resources.ResourceManager\": \"4.3.0\",\n          \"System.Runtime\": \"4.3.0\",\n          \"System.Runtime.Extensions\": \"4.3.0\",\n          \"System.Threading\": \"4.3.0\",\n          \"System.Xml.ReaderWriter\": \"4.3.0\"\n        }\n      },\n      \"System.Xml.XPath.XmlDocument\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"A/uxsWi/Ifzkmd4ArTLISMbfFs6XpRPsXZonrIqyTY70xi8t+mDtvSM5Os0RqyRDobjMBwIDHDL4NOIbkDwf7A==\",\n        \"dependencies\": {\n          \"System.Collections\": \"4.3.0\",\n          \"System.Globalization\": \"4.3.0\",\n          \"System.IO\": \"4.3.0\",\n          \"System.Resources.ResourceManager\": \"4.3.0\",\n          \"System.Runtime\": \"4.3.0\",\n          \"System.Runtime.Extensions\": \"4.3.0\",\n          \"System.Threading\": \"4.3.0\",\n          \"System.Xml.ReaderWriter\": \"4.3.0\",\n          \"System.Xml.XPath\": \"4.3.0\",\n          \"System.Xml.XmlDocument\": \"4.3.0\"\n        }\n      },\n      \"calculator\": {\n        \"type\": \"Project\"\n      }\n    }\n  }\n}"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/samples/csharp/Calculator/Calculator.NUnit4/Calculator.NUnit4.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n    <PropertyGroup>\n        <TargetFramework>net9.0</TargetFramework>\n        <LangVersion>latest</LangVersion>\n        <ImplicitUsings>enable</ImplicitUsings>\n        <Nullable>enable</Nullable>\n        <IsPackable>false</IsPackable>\n    </PropertyGroup>\n\n    <ItemGroup>\n        <PackageReference Include=\"coverlet.collector\" Version=\"6.0.2\"/>\n        <PackageReference Include=\"Microsoft.NET.Test.Sdk\" Version=\"17.12.0\" />\n        <PackageReference Include=\"NUnit\" Version=\"4.2.2\"/>\n        <PackageReference Include=\"NUnit.Analyzers\" Version=\"4.3.0\"/>\n        <PackageReference Include=\"NUnit3TestAdapter\" Version=\"4.6.0\"/>\n        <PackageReference Include=\"NunitXml.TestLogger\" Version=\"4.1.0\" />\n    </ItemGroup>\n\n    <ItemGroup>\n        <Using Include=\"NUnit.Framework\"/>\n    </ItemGroup>\n\n    <ItemGroup>\n      <ProjectReference Include=\"..\\Calculator\\Calculator.csproj\" />\n    </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/samples/csharp/Calculator/Calculator.NUnit4/CalculatorTests.cs",
    "content": "﻿namespace Calculator.NUnit4;\n\n[TestFixture]\npublic class Tests\n{\n    [Test]\n    public void TestMethod1()\n    {\n        var calculator = new Calculator();\n        var result = calculator.Add(1, 2, x => x > 0);\n        Assert.That(result, Is.EqualTo(3));\n    }\n}\n\n[TestFixture]\npublic class BaseClass<T> where T : class\n{\n    [Test]\n    public void TestMethodInBaseClass() =>\n        Assert.That(3, Is.EqualTo(3));\n\n    [Test]\n    public virtual void VirtualMethodInBaseClass() =>\n        Assert.That(3, Is.EqualTo(3));\n}\n\n[TestFixture]\npublic sealed class Derived : BaseClass<string>\n{\n    [Test]\n    public override void VirtualMethodInBaseClass() =>\n        Assert.That(3, Is.EqualTo(3));\n}\n\n[TestFixture]\npublic sealed class GenericCalculatorTests<T> : BaseClass<T> where T : class\n{\n    [Test]\n    public void Method() =>\n        Assert.That(3, Is.EqualTo(3));\n\n    [Test]\n    public void GenericMethod<T>() =>\n        Assert.That(3, Is.EqualTo(3));\n\n    [Test]\n    public override void VirtualMethodInBaseClass() =>\n        Assert.That(3, Is.EqualTo(3));\n}\n\n[TestFixture]\npublic class GenericTests\n{\n    [TestCase(42)]\n    [TestCase(\"string\")]\n    [TestCase(double.Epsilon)]\n    public void GenericTest<T>(T instance)\n    {\n        Console.WriteLine(instance);\n    }\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/samples/csharp/Calculator/Calculator.NUnit4/packages.lock.json",
    "content": "{\n  \"version\": 1,\n  \"dependencies\": {\n    \"net9.0\": {\n      \"coverlet.collector\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[6.0.2, )\",\n        \"resolved\": \"6.0.2\",\n        \"contentHash\": \"bJShQ6uWRTQ100ZeyiMqcFlhP7WJ+bCuabUs885dJiBEzMsJMSFr7BOyeCw4rgvQokteGi5rKQTlkhfQPUXg2A==\"\n      },\n      \"Microsoft.NET.Test.Sdk\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[17.12.0, )\",\n        \"resolved\": \"17.12.0\",\n        \"contentHash\": \"kt/PKBZ91rFCWxVIJZSgVLk+YR+4KxTuHf799ho8WNiK5ZQpJNAEZCAWX86vcKrs+DiYjiibpYKdGZP6+/N17w==\",\n        \"dependencies\": {\n          \"Microsoft.CodeCoverage\": \"17.12.0\",\n          \"Microsoft.TestPlatform.TestHost\": \"17.12.0\"\n        }\n      },\n      \"NUnit\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[4.2.2, )\",\n        \"resolved\": \"4.2.2\",\n        \"contentHash\": \"mon0OPko28yZ/foVXrhiUvq1LReaGsBdziumyyYGxV/pOE4q92fuYeN+AF+gEU5pCjzykcdBt5l7xobTaiBjsg==\"\n      },\n      \"NUnit.Analyzers\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[4.3.0, )\",\n        \"resolved\": \"4.3.0\",\n        \"contentHash\": \"Ki4p1XrmnYil64HE9VkJSuo6KBr8vg7Mut43atYvItDp3HwIcRY5hi+n5o8GaX1IBCwYLaJgW5ZfZuBVPYXEkg==\"\n      },\n      \"NUnit3TestAdapter\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[4.6.0, )\",\n        \"resolved\": \"4.6.0\",\n        \"contentHash\": \"R7e1+a4vuV/YS+ItfL7f//rG+JBvVeVLX4mHzFEZo4W1qEKl8Zz27AqvQSAqo+BtIzUCo4aAJMYa56VXS4hudw==\"\n      },\n      \"NunitXml.TestLogger\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[4.1.0, )\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"l2zl8JttE12XY2QOf/W/PWcukhzp0Ez2XpD5s1HDk/RoLE3QLVKvQoOlAIbzbchtScNN9Hmuv6Iku6XOtZMrGg==\"\n      },\n      \"Microsoft.CodeCoverage\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"17.12.0\",\n        \"contentHash\": \"4svMznBd5JM21JIG2xZKGNanAHNXplxf/kQDFfLHXQ3OnpJkayRK/TjacFjA+EYmoyuNXHo/sOETEfcYtAzIrA==\"\n      },\n      \"Microsoft.TestPlatform.ObjectModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"17.12.0\",\n        \"contentHash\": \"TDqkTKLfQuAaPcEb3pDDWnh7b3SyZF+/W9OZvWFp6eJCIiiYFdSB6taE2I6tWrFw5ywhzOb6sreoGJTI6m3rSQ==\",\n        \"dependencies\": {\n          \"System.Reflection.Metadata\": \"1.6.0\"\n        }\n      },\n      \"Microsoft.TestPlatform.TestHost\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"17.12.0\",\n        \"contentHash\": \"MiPEJQNyADfwZ4pJNpQex+t9/jOClBGMiCiVVFuELCMSX2nmNfvUor3uFVxNNCg30uxDP8JDYfPnMXQzsfzYyg==\",\n        \"dependencies\": {\n          \"Microsoft.TestPlatform.ObjectModel\": \"17.12.0\",\n          \"Newtonsoft.Json\": \"13.0.1\"\n        }\n      },\n      \"Newtonsoft.Json\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"13.0.1\",\n        \"contentHash\": \"ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==\"\n      },\n      \"System.Reflection.Metadata\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.6.0\",\n        \"contentHash\": \"COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==\"\n      },\n      \"calculator\": {\n        \"type\": \"Project\"\n      }\n    }\n  }\n}"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/samples/csharp/Calculator/Calculator.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 12.00\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Calculator\", \"Calculator\\Calculator.csproj\", \"{4E9E1E84-CC5E-4A6D-BB67-C9D2C085E392}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Calculator.MSTest\", \"Calculator.MSTest\\Calculator.MSTest.csproj\", \"{E96FEC27-B3AD-468F-BCB6-1F280B6FB73A}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Calculator.NUnit3\", \"Calculator.NUnit3\\Calculator.NUnit3.csproj\", \"{94125E14-4A76-4834-8FCD-E235D9E54A2B}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Calculator.xUnit\", \"Calculator.xUnit\\Calculator.xUnit.csproj\", \"{00583775-C9F9-42B6-9395-52A533F70B89}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Calculator.NUnit4\", \"Calculator.NUnit4\\Calculator.NUnit4.csproj\", \"{A0A67F53-D948-4D5D-96A3-A01092B31F9E}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"Docs\", \"Docs\", \"{89ABDCD4-0251-47DF-9C82-755A3DB78641}\"\n\tProjectSection(SolutionItems) = preProject\n\t\tReadMe.md = ReadMe.md\n\tEndProjectSection\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Any CPU = Debug|Any CPU\n\t\tRelease|Any CPU = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{4E9E1E84-CC5E-4A6D-BB67-C9D2C085E392}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{4E9E1E84-CC5E-4A6D-BB67-C9D2C085E392}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{4E9E1E84-CC5E-4A6D-BB67-C9D2C085E392}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{4E9E1E84-CC5E-4A6D-BB67-C9D2C085E392}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{E96FEC27-B3AD-468F-BCB6-1F280B6FB73A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{E96FEC27-B3AD-468F-BCB6-1F280B6FB73A}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{E96FEC27-B3AD-468F-BCB6-1F280B6FB73A}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{E96FEC27-B3AD-468F-BCB6-1F280B6FB73A}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{94125E14-4A76-4834-8FCD-E235D9E54A2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{94125E14-4A76-4834-8FCD-E235D9E54A2B}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{94125E14-4A76-4834-8FCD-E235D9E54A2B}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{94125E14-4A76-4834-8FCD-E235D9E54A2B}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{00583775-C9F9-42B6-9395-52A533F70B89}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{00583775-C9F9-42B6-9395-52A533F70B89}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{00583775-C9F9-42B6-9395-52A533F70B89}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{00583775-C9F9-42B6-9395-52A533F70B89}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{A0A67F53-D948-4D5D-96A3-A01092B31F9E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{A0A67F53-D948-4D5D-96A3-A01092B31F9E}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{A0A67F53-D948-4D5D-96A3-A01092B31F9E}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{A0A67F53-D948-4D5D-96A3-A01092B31F9E}.Release|Any CPU.Build.0 = Release|Any CPU\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/samples/csharp/Calculator/Calculator.xUnit/Calculator.xUnit.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n    <PropertyGroup>\n        <TargetFramework>net9.0</TargetFramework>\n        <ImplicitUsings>enable</ImplicitUsings>\n        <Nullable>enable</Nullable>\n        <IsPackable>false</IsPackable>\n    </PropertyGroup>\n\n    <ItemGroup>\n        <PackageReference Include=\"coverlet.collector\" Version=\"6.0.2\"/>\n        <PackageReference Include=\"Microsoft.NET.Test.Sdk\" Version=\"17.12.0\" />\n        <PackageReference Include=\"xunit\" Version=\"2.9.2\"/>\n        <PackageReference Include=\"XunitXml.TestLogger\" Version=\"4.1.0\" />\n        <PackageReference Include=\"xunit.runner.visualstudio\" Version=\"2.8.2\"/>\n    </ItemGroup>\n\n    <ItemGroup>\n        <Using Include=\"Xunit\"/>\n    </ItemGroup>\n\n    <ItemGroup>\n      <ProjectReference Include=\"..\\Calculator\\Calculator.csproj\" />\n    </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/samples/csharp/Calculator/Calculator.xUnit/CalculatorTests.cs",
    "content": "﻿namespace Calculator.xUnit;\n\npublic class Tests\n{\n    [Fact]\n    public void TestMethod1()\n    {\n        var calculator = new Calculator();\n        var result = calculator.Add(1, 2, x => x > 0);\n        Assert.Equal(3, result);\n    }\n}\n\npublic abstract class BaseClass<T> where T : class\n{\n    [Fact]\n    public void TestMethodInBaseClass() =>\n        Assert.Equal(3, 3);\n\n    [Fact]\n    public virtual void VirtualMethodInBaseClass() =>\n        Assert.Equal(1, 1);\n}\n\npublic sealed class Derived : BaseClass<string>\n{\n    [Fact]\n    public override void VirtualMethodInBaseClass() =>\n        Assert.Equal(1, 1);\n}\n\npublic class GenericTests\n{\n    [Theory]\n    [InlineData(typeof(int))]\n    [InlineData(typeof(string))]\n    public void GenericTestMethod<T>(Type type) => Console.WriteLine(type);\n}\n\npublic sealed class GenericDerivedFromGenericClass<T> : BaseClass<T> where T : class\n{\n    [Fact]\n    public void GenericDerivedFromGenericClass_PassMethod() =>\n        Assert.Equal(1, 1);\n}\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/samples/csharp/Calculator/Calculator.xUnit/packages.lock.json",
    "content": "{\n  \"version\": 1,\n  \"dependencies\": {\n    \"net9.0\": {\n      \"coverlet.collector\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[6.0.2, )\",\n        \"resolved\": \"6.0.2\",\n        \"contentHash\": \"bJShQ6uWRTQ100ZeyiMqcFlhP7WJ+bCuabUs885dJiBEzMsJMSFr7BOyeCw4rgvQokteGi5rKQTlkhfQPUXg2A==\"\n      },\n      \"Microsoft.NET.Test.Sdk\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[17.12.0, )\",\n        \"resolved\": \"17.12.0\",\n        \"contentHash\": \"kt/PKBZ91rFCWxVIJZSgVLk+YR+4KxTuHf799ho8WNiK5ZQpJNAEZCAWX86vcKrs+DiYjiibpYKdGZP6+/N17w==\",\n        \"dependencies\": {\n          \"Microsoft.CodeCoverage\": \"17.12.0\",\n          \"Microsoft.TestPlatform.TestHost\": \"17.12.0\"\n        }\n      },\n      \"xunit\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[2.9.2, )\",\n        \"resolved\": \"2.9.2\",\n        \"contentHash\": \"7LhFS2N9Z6Xgg8aE5lY95cneYivRMfRI8v+4PATa4S64D5Z/Plkg0qa8dTRHSiGRgVZ/CL2gEfJDE5AUhOX+2Q==\",\n        \"dependencies\": {\n          \"xunit.analyzers\": \"1.16.0\",\n          \"xunit.assert\": \"2.9.2\",\n          \"xunit.core\": \"[2.9.2]\"\n        }\n      },\n      \"xunit.runner.visualstudio\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[2.8.2, )\",\n        \"resolved\": \"2.8.2\",\n        \"contentHash\": \"vm1tbfXhFmjFMUmS4M0J0ASXz3/U5XvXBa6DOQUL3fEz4Vt6YPhv+ESCarx6M6D+9kJkJYZKCNvJMas1+nVfmQ==\"\n      },\n      \"XunitXml.TestLogger\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[4.1.0, )\",\n        \"resolved\": \"4.1.0\",\n        \"contentHash\": \"cXnWPsaHkDh9Nw2SDqtVSD6NUIvV6pqoDvjaQte+jS57zdq0il4Ahgu2NF13VHT1jUPS09facofXIolVY9ZfxA==\"\n      },\n      \"Microsoft.CodeCoverage\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"17.12.0\",\n        \"contentHash\": \"4svMznBd5JM21JIG2xZKGNanAHNXplxf/kQDFfLHXQ3OnpJkayRK/TjacFjA+EYmoyuNXHo/sOETEfcYtAzIrA==\"\n      },\n      \"Microsoft.TestPlatform.ObjectModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"17.12.0\",\n        \"contentHash\": \"TDqkTKLfQuAaPcEb3pDDWnh7b3SyZF+/W9OZvWFp6eJCIiiYFdSB6taE2I6tWrFw5ywhzOb6sreoGJTI6m3rSQ==\",\n        \"dependencies\": {\n          \"System.Reflection.Metadata\": \"1.6.0\"\n        }\n      },\n      \"Microsoft.TestPlatform.TestHost\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"17.12.0\",\n        \"contentHash\": \"MiPEJQNyADfwZ4pJNpQex+t9/jOClBGMiCiVVFuELCMSX2nmNfvUor3uFVxNNCg30uxDP8JDYfPnMXQzsfzYyg==\",\n        \"dependencies\": {\n          \"Microsoft.TestPlatform.ObjectModel\": \"17.12.0\",\n          \"Newtonsoft.Json\": \"13.0.1\"\n        }\n      },\n      \"Newtonsoft.Json\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"13.0.1\",\n        \"contentHash\": \"ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==\"\n      },\n      \"System.Reflection.Metadata\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.6.0\",\n        \"contentHash\": \"COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==\"\n      },\n      \"xunit.abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.0.3\",\n        \"contentHash\": \"pot1I4YOxlWjIb5jmwvvQNbTrZ3lJQ+jUGkGjWE3hEFM0l5gOnBWS+H3qsex68s5cO52g+44vpGzhAt+42vwKg==\"\n      },\n      \"xunit.analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.16.0\",\n        \"contentHash\": \"hptYM7vGr46GUIgZt21YHO4rfuBAQS2eINbFo16CV/Dqq+24Tp+P5gDCACu1AbFfW4Sp/WRfDPSK8fmUUb8s0Q==\"\n      },\n      \"xunit.assert\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.9.2\",\n        \"contentHash\": \"QkNBAQG4pa66cholm28AxijBjrmki98/vsEh4Sx5iplzotvPgpiotcxqJQMRC8d7RV7nIT8ozh97957hDnZwsQ==\"\n      },\n      \"xunit.core\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.9.2\",\n        \"contentHash\": \"O6RrNSdmZ0xgEn5kT927PNwog5vxTtKrWMihhhrT0Sg9jQ7iBDciYOwzBgP2krBEk5/GBXI18R1lKvmnxGcb4w==\",\n        \"dependencies\": {\n          \"xunit.extensibility.core\": \"[2.9.2]\",\n          \"xunit.extensibility.execution\": \"[2.9.2]\"\n        }\n      },\n      \"xunit.extensibility.core\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.9.2\",\n        \"contentHash\": \"Ol+KlBJz1x8BrdnhN2DeOuLrr1I/cTwtHCggL9BvYqFuVd/TUSzxNT5O0NxCIXth30bsKxgMfdqLTcORtM52yQ==\",\n        \"dependencies\": {\n          \"xunit.abstractions\": \"2.0.3\"\n        }\n      },\n      \"xunit.extensibility.execution\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.9.2\",\n        \"contentHash\": \"rKMpq4GsIUIJibXuZoZ8lYp5EpROlnYaRpwu9Zr0sRZXE7JqJfEEbCsUriZqB+ByXCLFBJyjkTRULMdC+U566g==\",\n        \"dependencies\": {\n          \"xunit.extensibility.core\": \"[2.9.2]\"\n        }\n      },\n      \"calculator\": {\n        \"type\": \"Project\"\n      }\n    }\n  }\n}"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/samples/vbnet/Calculator/Calculator/Calculator.vb",
    "content": "Public Class Calculator\n    Public Function Add(a As Integer, b As Integer, predicate As Predicate(Of Integer)) As Integer\n        Dim sum = a + b\n        Return If(predicate(sum), sum, 0)\n    End Function\nEnd Class\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/samples/vbnet/Calculator/Calculator/Calculator.vbproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n    <PropertyGroup>\n        <RootNamespace>Calculator</RootNamespace>\n        <TargetFramework>net9.0</TargetFramework>\n    </PropertyGroup>\n\n</Project>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/samples/vbnet/Calculator/Calculator.MSTest/Calculator.MSTest.vbproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n    <PropertyGroup>\n        <TargetFramework>net9.0</TargetFramework>\n        <LangVersion>latest</LangVersion>\n        <ImplicitUsings>enable</ImplicitUsings>\n        <Nullable>enable</Nullable>\n    </PropertyGroup>\n\n    <ItemGroup>\n        <PackageReference Include=\"Microsoft.NET.Test.Sdk\" Version=\"17.12.0\" />\n        <PackageReference Include=\"MSTest\" Version=\"3.6.3\" />\n    </ItemGroup>\n\n    <ItemGroup>\n        <Using Include=\"Microsoft.VisualStudio.TestTools.UnitTesting\"/>\n    </ItemGroup>\n\n    <ItemGroup>\n      <ProjectReference Include=\"..\\Calculator\\Calculator.vbproj\" />\n    </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/samples/vbnet/Calculator/Calculator.MSTest/CalculatorTests.vb",
    "content": "﻿Imports Microsoft.VisualStudio.TestTools.UnitTesting\n\n<TestClass>\nPublic NotInheritable Class CalculatorTests\n    <TestMethod>\n    Public Sub TestMethod1()\n        Dim calculator As New Calculator()\n        Dim result = calculator.Add(1, 2, Function(x) x > 0)\n        Assert.AreEqual(3, result)\n    End Sub\n\n    <TestMethod>\n    Public Sub GenericMethod(Of T As Class)()\n        Assert.AreEqual(1, 1)\n    End Sub\nEnd Class\n\n<TestClass>\nPublic MustInherit Class BaseClass(Of T As Class)\n    <TestMethod>\n    Public Sub TestMethodInBaseClass()\n        Assert.AreEqual(1, 1)\n    End Sub\n\n    <TestMethod>\n    Public Overridable Sub VirtualMethodInBaseClass()\n        Assert.AreEqual(1, 1)\n    End Sub\nEnd Class\n\n<TestClass>\nPublic NotInheritable Class Derived\n    Inherits BaseClass(Of String)\n\n    <TestMethod>\n    Public Overrides Sub VirtualMethodInBaseClass()\n        Assert.AreEqual(1, 1)\n    End Sub\nEnd Class\n\n<TestClass>\nPublic NotInheritable Class GenericCalculatorTests(Of T As Class)\n    Inherits BaseClass(Of T)\n\n    <TestMethod>\n    Public Sub Method()\n        Assert.AreEqual(1, 1)\n    End Sub\n\n    <TestMethod>\n    Public Sub GenericMethod(Of T)()\n        Assert.AreEqual(1, 1)\n    End Sub\n\n    <TestMethod>\n    Public Overrides Sub VirtualMethodInBaseClass()\n        Assert.AreEqual(1, 1)\n    End Sub\nEnd Class\n\n<TestClass>\nPublic Class GenericTests\n    <DataTestMethod>\n    <DataRow(GetType(Integer))>\n    <DataRow(GetType(String))>\n    Public Sub GenericTestMethod(Of T)(type As Type)\n    End Sub\nEnd Class\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/samples/vbnet/Calculator/Calculator.MSTest/MSTestSettings.vb",
    "content": "﻿Imports Microsoft.VisualStudio.TestTools.UnitTesting\n\n<Assembly: Parallelize(Scope := ExecutionScope.MethodLevel)>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/samples/vbnet/Calculator/Calculator.NUnit3/Calculator.NUnit3.vbproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n    <PropertyGroup>\n        <TargetFramework>net9.0</TargetFramework>\n        <LangVersion>latest</LangVersion>\n        <IsPackable>false</IsPackable>\n    </PropertyGroup>\n\n    <ItemGroup>\n      <PackageReference Include=\"coverlet.collector\" Version=\"6.0.2\"/>\n      <PackageReference Include=\"Microsoft.NET.Test.Sdk\" Version=\"17.12.0\" />\n      <PackageReference Include=\"NUnit\" Version=\"3.14.0\"/>\n      <PackageReference Include=\"NUnit.Analyzers\" Version=\"3.10.0\"/>\n      <PackageReference Include=\"NUnit3TestAdapter\" Version=\"3.17.0\"/>\n      <PackageReference Include=\"NunitXml.TestLogger\" Version=\"3.1.20\" />\n    </ItemGroup>\n\n    <ItemGroup>\n      <ProjectReference Include=\"..\\Calculator\\Calculator.vbproj\" />\n    </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/samples/vbnet/Calculator/Calculator.NUnit3/CalculatorTests.vb",
    "content": "﻿Imports NUnit.Framework\n\n<TestFixture>\nPublic Class Tests\n    <Test>\n    Public Sub TestMethod1()\n        Dim calculator As New Calculator()\n        Dim result = calculator.Add(1, 2, Function(x) x > 0)\n        Assert.That(result, [Is].EqualTo(3))\n    End Sub\nEnd Class\n\n<TestFixture>\nPublic Class BaseClass(Of T As Class)\n    <Test>\n    Public Sub TestMethodInBaseClass()\n        Assert.AreEqual(1, 1)\n    End Sub\n\n    <Test>\n    Public Overridable Sub VirtualMethodInBaseClass()\n        Assert.AreEqual(1, 1)\n    End Sub\nEnd Class\n\n<TestFixture>\nPublic NotInheritable Class Derived\n    Inherits BaseClass(Of String)\n\n    <Test>\n    Public Overrides Sub VirtualMethodInBaseClass()\n        Assert.AreEqual(1, 1)\n    End Sub\nEnd Class\n\n<TestFixture>\nPublic NotInheritable Class GenericCalculatorTests(Of T As Class)\n    Inherits BaseClass(Of T)\n\n    <Test>\n    Public Sub Method()\n        Assert.AreEqual(1, 1)\n    End Sub\n\n    <Test>\n    Public Sub GenericMethod(Of T)()\n        Assert.AreEqual(1, 1)\n    End Sub\n\n    <Test>\n    Public Overrides Sub VirtualMethodInBaseClass()\n        Assert.AreEqual(1, 1)\n    End Sub\nEnd Class\n\n<TestFixture>\nPublic Class GenericTests\n    <TestCase(42)>\n    <TestCase(\"string\")>\n    <TestCase(Double.Epsilon)>\n    Public Sub GenericTest(Of T)(instance As T)\n        Console.WriteLine(instance)\n    End Sub\nEnd Class\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/samples/vbnet/Calculator/Calculator.NUnit4/Calculator.NUnit4.vbproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n    <PropertyGroup>\n        <TargetFramework>net9.0</TargetFramework>\n        <LangVersion>latest</LangVersion>\n        <IsPackable>false</IsPackable>\n    </PropertyGroup>\n\n    <ItemGroup>\n      <PackageReference Include=\"coverlet.collector\" Version=\"6.0.2\"/>\n      <PackageReference Include=\"Microsoft.NET.Test.Sdk\" Version=\"17.12.0\" />\n      <PackageReference Include=\"NUnit\" Version=\"4.2.2\"/>\n      <PackageReference Include=\"NUnit.Analyzers\" Version=\"4.3.0\"/>\n      <PackageReference Include=\"NUnit3TestAdapter\" Version=\"4.6.0\"/>\n      <PackageReference Include=\"NunitXml.TestLogger\" Version=\"4.1.0\" />\n    </ItemGroup>\n\n    <ItemGroup>\n      <ProjectReference Include=\"..\\Calculator\\Calculator.vbproj\" />\n    </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/samples/vbnet/Calculator/Calculator.NUnit4/CalculatorTests.vb",
    "content": "﻿Imports NUnit.Framework\n\n<TestFixture>\nPublic Class Tests\n    <Test>\n    Public Sub TestMethod1()\n        Dim calculator As New Calculator()\n        Dim result = calculator.Add(1, 2, Function(x) x > 0)\n        Assert.That(result, [Is].EqualTo(3))\n    End Sub\nEnd Class\n\n<TestFixture>\nPublic Class BaseClass(Of T As Class)\n    <Test>\n    Public Sub TestMethodInBaseClass()\n        Assert.That(3, [Is].EqualTo(3))\n    End Sub\n\n    <Test>\n    Public Overridable Sub VirtualMethodInBaseClass()\n        Assert.That(3, [Is].EqualTo(3))\n    End Sub\nEnd Class\n\n<TestFixture>\nPublic NotInheritable Class Derived\n    Inherits BaseClass(Of String)\n\n    <Test>\n    Public Overrides Sub VirtualMethodInBaseClass()\n        Assert.That(3, [Is].EqualTo(3))\n    End Sub\nEnd Class\n\n<TestFixture>\nPublic NotInheritable Class GenericCalculatorTests(Of T As Class)\n    Inherits BaseClass(Of T)\n\n    <Test>\n    Public Sub Method()\n        Assert.That(3, [Is].EqualTo(3))\n    End Sub\n\n    <Test>\n    Public Sub GenericMethod(Of T)()\n        Assert.That(3, [Is].EqualTo(3))\n    End Sub\n\n    <Test>\n    Public Overrides Sub VirtualMethodInBaseClass()\n        Assert.That(3, [Is].EqualTo(3))\n    End Sub\nEnd Class\n\n<TestFixture>\nPublic Class GenericTests\n    <TestCase(42)>\n    <TestCase(\"string\")>\n    <TestCase(Double.Epsilon)>\n    Public Sub GenericTest(Of T)(instance As T)\n        Console.WriteLine(instance)\n    End Sub\nEnd Class\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/samples/vbnet/Calculator/Calculator.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 12.00\nProject(\"{F184B08F-C81C-45F6-A57F-5ABD9991F28F}\") = \"Calculator\", \"Calculator\\Calculator.vbproj\", \"{BA527903-CAAE-4D1C-9430-87F37067C0DA}\"\nEndProject\nProject(\"{F184B08F-C81C-45F6-A57F-5ABD9991F28F}\") = \"Calculator.MSTest\", \"Calculator.MSTest\\Calculator.MSTest.vbproj\", \"{5792EDB2-31A7-430D-84E8-36561F196816}\"\nEndProject\nProject(\"{F184B08F-C81C-45F6-A57F-5ABD9991F28F}\") = \"Calculator.NUnit3\", \"Calculator.NUnit3\\Calculator.NUnit3.vbproj\", \"{76E34C8E-BC12-48C4-9823-AFDFE93BFABD}\"\nEndProject\nProject(\"{F184B08F-C81C-45F6-A57F-5ABD9991F28F}\") = \"Calculator.NUnit4\", \"Calculator.NUnit4\\Calculator.NUnit4.vbproj\", \"{D0353802-B9B2-4A87-855E-87E349484EF4}\"\nEndProject\nProject(\"{F184B08F-C81C-45F6-A57F-5ABD9991F28F}\") = \"Calculator.xUnit\", \"Calculator.xUnit\\Calculator.xUnit.vbproj\", \"{FE05C6BB-57FE-4D95-A1A9-91161C75EED8}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Any CPU = Debug|Any CPU\n\t\tRelease|Any CPU = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{BA527903-CAAE-4D1C-9430-87F37067C0DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{BA527903-CAAE-4D1C-9430-87F37067C0DA}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{BA527903-CAAE-4D1C-9430-87F37067C0DA}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{BA527903-CAAE-4D1C-9430-87F37067C0DA}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{5792EDB2-31A7-430D-84E8-36561F196816}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{5792EDB2-31A7-430D-84E8-36561F196816}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{5792EDB2-31A7-430D-84E8-36561F196816}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{5792EDB2-31A7-430D-84E8-36561F196816}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{76E34C8E-BC12-48C4-9823-AFDFE93BFABD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{76E34C8E-BC12-48C4-9823-AFDFE93BFABD}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{76E34C8E-BC12-48C4-9823-AFDFE93BFABD}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{76E34C8E-BC12-48C4-9823-AFDFE93BFABD}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{D0353802-B9B2-4A87-855E-87E349484EF4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{D0353802-B9B2-4A87-855E-87E349484EF4}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{D0353802-B9B2-4A87-855E-87E349484EF4}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{D0353802-B9B2-4A87-855E-87E349484EF4}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{FE05C6BB-57FE-4D95-A1A9-91161C75EED8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{FE05C6BB-57FE-4D95-A1A9-91161C75EED8}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{FE05C6BB-57FE-4D95-A1A9-91161C75EED8}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{FE05C6BB-57FE-4D95-A1A9-91161C75EED8}.Release|Any CPU.Build.0 = Release|Any CPU\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/samples/vbnet/Calculator/Calculator.xUnit/Calculator.xUnit.vbproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n    <PropertyGroup>\n        <RootNamespace>Calculator.xUnit</RootNamespace>\n        <TargetFramework>net9.0</TargetFramework>\n        <IsPackable>false</IsPackable>\n    </PropertyGroup>\n\n    <ItemGroup>\n      <PackageReference Include=\"coverlet.collector\" Version=\"6.0.2\"/>\n      <PackageReference Include=\"Microsoft.NET.Test.Sdk\" Version=\"17.12.0\" />\n      <PackageReference Include=\"xunit\" Version=\"2.9.2\"/>\n      <PackageReference Include=\"XunitXml.TestLogger\" Version=\"4.1.0\" />\n      <PackageReference Include=\"xunit.runner.visualstudio\" Version=\"2.8.2\"/>\n    </ItemGroup>\n\n    <ItemGroup>\n      <ProjectReference Include=\"..\\Calculator\\Calculator.vbproj\" />\n    </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/samples/vbnet/Calculator/Calculator.xUnit/CalculatorTests.vb",
    "content": "﻿Imports Xunit\n\nPublic Class Tests\n    <Fact>\n    Public Sub TestMethod1()\n        Dim calculator As New Calculator()\n        Dim result = calculator.Add(1, 2, Function(x) x > 0)\n        Assert.Equal(3, result)\n    End Sub\nEnd Class\n\nPublic MustInherit Class BaseClass(Of T As Class)\n    <Fact>\n    Public Sub TestMethodInBaseClass()\n        Assert.Equal(3, 3)\n    End Sub\n\n    <Fact>\n    Public Overridable Sub VirtualMethodInBaseClass()\n        Assert.Equal(1, 1)\n    End Sub\nEnd Class\n\nPublic NotInheritable Class Derived\n    Inherits BaseClass(Of String)\n\n    <Fact>\n    Public Overrides Sub VirtualMethodInBaseClass()\n        Assert.Equal(1, 1)\n    End Sub\nEnd Class\n\nPublic Class GenericTests\n    <Theory>\n    <InlineData(GetType(Integer))>\n    <InlineData(GetType(String))>\n    Public Sub GenericTestMethod(Of T)(type As Type)\n        Console.WriteLine(type)\n    End Sub\nEnd Class\n\nPublic NotInheritable Class GenericDerivedFromGenericClass(Of T As Class, U As Class)\n    Inherits BaseClass(Of T)\n\n    <Fact>\n    Public Sub GenericMethod(Of T, U)()\n        Assert.Equal(1, 1)\n    End Sub\n\nEnd Class\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/visualstudio_coverage_xml/deterministic_source_paths.coveragexml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<!--\n    The file from the integration test project CoverageTest.DeterministicSourcePaths.\n-->\n<results>\n  <modules>\n    <module name=\"CoverageTest.DeterministicSourcePaths.tests.dll\" path=\"CoverageTest.DeterministicSourcePaths.tests.dll\" id=\"D56BC170BF52284F8137CB445BC6115201000000\" block_coverage=\"100.00\" line_coverage=\"100.00\" blocks_covered=\"3\" blocks_not_covered=\"0\" lines_covered=\"1\" lines_partially_covered=\"0\" lines_not_covered=\"0\">\n      <functions>\n        <function id=\"8284\" token=\"0x6000003\" name=\"TestMethod1()\" namespace=\"Repro3362.Tests\" type_name=\"UnitTest1\" block_coverage=\"100.00\" line_coverage=\"100.00\" blocks_covered=\"3\" blocks_not_covered=\"0\" lines_covered=\"1\" lines_partially_covered=\"0\" lines_not_covered=\"0\">\n          <ranges>\n            <range source_id=\"0\" covered=\"yes\" start_line=\"9\" start_column=\"38\" end_line=\"9\" end_column=\"57\" />\n          </ranges>\n        </function>\n      </functions>\n      <source_files>\n        <source_file id=\"0\" path=\"C:\\Workspace\\sonar-dotnet\\its\\projects\\CoverageTest.DeterministicSourcePaths\\CoverageTest.DeterministicSourcePaths.Tests\\FooTests.cs\" checksum_type=\"unknown\">\n        </source_file>\n      </source_files>\n    </module>\n    <module name=\"CoverageTest.DeterministicSourcePaths.dll\" path=\"CoverageTest.DeterministicSourcePaths.dll\" id=\"DCBBF5335692704B877E036875DA445301000000\" block_coverage=\"50.00\" line_coverage=\"50.00\" blocks_covered=\"1\" blocks_not_covered=\"1\" lines_covered=\"3\" lines_partially_covered=\"0\" lines_not_covered=\"3\">\n      <functions>\n        <function id=\"8272\" token=\"0x6000001\" name=\"Covered()\" namespace=\"Repro3362\" type_name=\"Foo\" block_coverage=\"100.00\" line_coverage=\"100.00\" blocks_covered=\"1\" blocks_not_covered=\"0\" lines_covered=\"3\" lines_partially_covered=\"0\" lines_not_covered=\"0\">\n          <ranges>\n            <range source_id=\"0\" covered=\"yes\" start_line=\"6\" start_column=\"9\" end_line=\"6\" end_column=\"10\" />\n            <range source_id=\"0\" covered=\"yes\" start_line=\"7\" start_column=\"13\" end_line=\"7\" end_column=\"27\" />\n            <range source_id=\"0\" covered=\"yes\" start_line=\"8\" start_column=\"9\" end_line=\"8\" end_column=\"10\" />\n          </ranges>\n        </function>\n        <function id=\"8288\" token=\"0x6000002\" name=\"NotCovered()\" namespace=\"Repro3362\" type_name=\"Foo\" block_coverage=\"0.00\" line_coverage=\"0.00\" blocks_covered=\"0\" blocks_not_covered=\"1\" lines_covered=\"0\" lines_partially_covered=\"0\" lines_not_covered=\"3\">\n          <ranges>\n            <range source_id=\"0\" covered=\"no\" start_line=\"11\" start_column=\"9\" end_line=\"11\" end_column=\"10\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"12\" start_column=\"13\" end_line=\"12\" end_column=\"27\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"13\" start_column=\"9\" end_line=\"13\" end_column=\"10\" />\n          </ranges>\n        </function>\n      </functions>\n      <source_files>\n        <source_file id=\"0\" path=\"/_/its/projects/CoverageTest.DeterministicSourcePaths/CoverageTest.DeterministicSourcePaths/Foo.cs\" checksum_type=\"unknown\">\n        </source_file>\n      </source_files>\n    </module>\n  </modules>\n</results>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/visualstudio_coverage_xml/getter_setter.coveragexml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<!--\nBelow is the code for which this coverage file has been created,\ntogether with the commands to generate the file and the tools versions.\n\nNote: the file paths were manually changed inside the report to be relative.\n________________________________________________________\n\nnamespace GetSet\n{\n    public class Bar\n    {\n        public int ImplicitProperty { get; set; }\n    }\n}\n________________________________________________________\n\nusing GetSet;\n\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\n\nnamespace GetSetTests\n{\n    [TestClass]\n    public class BarTests\n    {\n        [TestMethod]\n        public void TestSetter()\n        {\n            Bar bar = new Bar();\n            Assert.AreEqual(0, bar.ImplicitProperty);\n        }\n    }\n}\n________________________________________________________\n\nmsbuild .\\GetSetCoverage.sln /t:Rebuild\nvstest.console.exe /EnableCodeCoverage .\\GetSetTests\\bin\\Debug\\GetSetTests.dll\nCodeCoverage.exe analyze /output:\"VisualStudio.coveragexml\" \"PATH_TO_REPORT\"\n\nMicrosoft (R) Test Execution Command Line Tool Version 16.3.0-preview-20190715-02\nMicrosoft (R) Coverage Collection Tool Version 16.0.30319.200\n-->\n<results>\n  <modules>\n    <module name=\"getsettests.dll\" path=\"getsettests.dll\" id=\"AD29545BFA674942BB39D2056219B41201000000\" block_coverage=\"100.00\" line_coverage=\"100.00\" blocks_covered=\"4\" blocks_not_covered=\"0\" lines_covered=\"4\" lines_partially_covered=\"0\" lines_not_covered=\"0\">\n      <functions>\n        <function id=\"8272\" token=\"0x6000001\" name=\"TestSetter()\" namespace=\"GetSetTests\" type_name=\"BarTests\" block_coverage=\"100.00\" line_coverage=\"100.00\" blocks_covered=\"4\" blocks_not_covered=\"0\" lines_covered=\"4\" lines_partially_covered=\"0\" lines_not_covered=\"0\">\n          <ranges>\n            <range source_id=\"0\" covered=\"yes\" start_line=\"13\" start_column=\"9\" end_line=\"13\" end_column=\"10\" />\n            <range source_id=\"0\" covered=\"yes\" start_line=\"14\" start_column=\"13\" end_line=\"14\" end_column=\"33\" />\n            <range source_id=\"0\" covered=\"yes\" start_line=\"15\" start_column=\"13\" end_line=\"15\" end_column=\"54\" />\n            <range source_id=\"0\" covered=\"yes\" start_line=\"16\" start_column=\"9\" end_line=\"16\" end_column=\"10\" />\n          </ranges>\n        </function>\n      </functions>\n      <source_files>\n        <source_file id=\"0\" path=\"GetSetTests\\BarTests.cs\">\n        </source_file>\n      </source_files>\n    </module>\n    <module name=\"getset.dll\" path=\"getset.dll\" id=\"C5314C3FF7DBF64CBB578659F3B3DDCE01000000\" block_coverage=\"50.00\" line_coverage=\"50.00\" blocks_covered=\"1\" blocks_not_covered=\"1\" lines_covered=\"1\" lines_partially_covered=\"0\" lines_not_covered=\"1\">\n      <functions>\n        <function id=\"8272\" token=\"0x6000001\" name=\"get_ImplicitProperty()\" namespace=\"GetSet\" type_name=\"Bar\" block_coverage=\"100.00\" line_coverage=\"100.00\" blocks_covered=\"1\" blocks_not_covered=\"0\" lines_covered=\"1\" lines_partially_covered=\"0\" lines_not_covered=\"0\">\n          <ranges>\n            <range source_id=\"0\" covered=\"yes\" start_line=\"11\" start_column=\"39\" end_line=\"11\" end_column=\"43\" />\n          </ranges>\n        </function>\n        <function id=\"8280\" token=\"0x6000002\" name=\"set_ImplicitProperty(int)\" namespace=\"GetSet\" type_name=\"Bar\" block_coverage=\"0.00\" line_coverage=\"0.00\" blocks_covered=\"0\" blocks_not_covered=\"1\" lines_covered=\"0\" lines_partially_covered=\"0\" lines_not_covered=\"1\">\n          <ranges>\n            <range source_id=\"0\" covered=\"no\" start_line=\"11\" start_column=\"44\" end_line=\"11\" end_column=\"48\" />\n          </ranges>\n        </function>\n      </functions>\n      <source_files>\n        <source_file id=\"0\" path=\"GetSet\\Bar.cs\">\n        </source_file>\n      </source_files>\n    </module>\n  </modules>\n</results>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/visualstudio_coverage_xml/getter_setter_multiple_per_line.coveragexml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<!--\nBelow is the code for which this coverage file has been created,\ntogether with the commands to generate the file and the tools versions.\n\nNote: the file paths were manually changed inside the report to be relative.\n________________________________________________________\n\nnamespace GetSet\n{\n    public class Bar\n    {\n        public int CoveredGet { get; set; } public int UncoveredProperty { get; set; } public int CoveredSet { get; set; }\n    }\n}\n________________________________________________________\n\nusing GetSet;\n\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\n\nnamespace GetSetTests\n{\n    [TestClass]\n    public class BarTests\n    {\n        [TestMethod]\n        public void TestSetter()\n        {\n            Bar bar = new Bar();\n            Assert.AreEqual(0, bar.CoveredGet);\n            bar.CoveredSet = 1;\n        }\n    }\n}\n________________________________________________________\n\nmsbuild .\\GetSetCoverage.sln /t:Rebuild\nvstest.console.exe /EnableCodeCoverage .\\GetSetTests\\bin\\Debug\\GetSetTests.dll\nCodeCoverage.exe analyze /output:\"VisualStudio.coveragexml\" \"PATH_TO_REPORT\"\n\nMicrosoft (R) Test Execution Command Line Tool Version 16.3.0-preview-20190715-02\nMicrosoft (R) Coverage Collection Tool Version 16.0.30319.200\n-->\n<results>\n  <modules>\n    <module name=\"getset.dll\" path=\"getset.dll\" id=\"0C3B423C78A2DD4882C30C0BA23F6EB001000000\" block_coverage=\"33.33\" line_coverage=\"33.33\" blocks_covered=\"2\" blocks_not_covered=\"4\" lines_covered=\"2\" lines_partially_covered=\"0\" lines_not_covered=\"4\">\n      <functions>\n        <function id=\"8272\" token=\"0x6000001\" name=\"get_CoveredGet()\" namespace=\"GetSet\" type_name=\"Bar\" block_coverage=\"100.00\" line_coverage=\"100.00\" blocks_covered=\"1\" blocks_not_covered=\"0\" lines_covered=\"1\" lines_partially_covered=\"0\" lines_not_covered=\"0\">\n          <ranges>\n            <range source_id=\"0\" covered=\"yes\" start_line=\"11\" start_column=\"33\" end_line=\"11\" end_column=\"37\" />\n          </ranges>\n        </function>\n        <function id=\"8280\" token=\"0x6000002\" name=\"set_CoveredGet(int)\" namespace=\"GetSet\" type_name=\"Bar\" block_coverage=\"0.00\" line_coverage=\"0.00\" blocks_covered=\"0\" blocks_not_covered=\"1\" lines_covered=\"0\" lines_partially_covered=\"0\" lines_not_covered=\"1\">\n          <ranges>\n            <range source_id=\"0\" covered=\"no\" start_line=\"11\" start_column=\"38\" end_line=\"11\" end_column=\"42\" />\n          </ranges>\n        </function>\n        <function id=\"8289\" token=\"0x6000003\" name=\"get_UncoveredProperty()\" namespace=\"GetSet\" type_name=\"Bar\" block_coverage=\"0.00\" line_coverage=\"0.00\" blocks_covered=\"0\" blocks_not_covered=\"1\" lines_covered=\"0\" lines_partially_covered=\"0\" lines_not_covered=\"1\">\n          <ranges>\n            <range source_id=\"0\" covered=\"no\" start_line=\"11\" start_column=\"76\" end_line=\"11\" end_column=\"80\" />\n          </ranges>\n        </function>\n        <function id=\"8297\" token=\"0x6000004\" name=\"set_UncoveredProperty(int)\" namespace=\"GetSet\" type_name=\"Bar\" block_coverage=\"0.00\" line_coverage=\"0.00\" blocks_covered=\"0\" blocks_not_covered=\"1\" lines_covered=\"0\" lines_partially_covered=\"0\" lines_not_covered=\"1\">\n          <ranges>\n            <range source_id=\"0\" covered=\"no\" start_line=\"11\" start_column=\"81\" end_line=\"11\" end_column=\"85\" />\n          </ranges>\n        </function>\n        <function id=\"8306\" token=\"0x6000005\" name=\"get_CoveredSet()\" namespace=\"GetSet\" type_name=\"Bar\" block_coverage=\"0.00\" line_coverage=\"0.00\" blocks_covered=\"0\" blocks_not_covered=\"1\" lines_covered=\"0\" lines_partially_covered=\"0\" lines_not_covered=\"1\">\n          <ranges>\n            <range source_id=\"0\" covered=\"no\" start_line=\"11\" start_column=\"112\" end_line=\"11\" end_column=\"116\" />\n          </ranges>\n        </function>\n        <function id=\"8314\" token=\"0x6000006\" name=\"set_CoveredSet(int)\" namespace=\"GetSet\" type_name=\"Bar\" block_coverage=\"100.00\" line_coverage=\"100.00\" blocks_covered=\"1\" blocks_not_covered=\"0\" lines_covered=\"1\" lines_partially_covered=\"0\" lines_not_covered=\"0\">\n          <ranges>\n            <range source_id=\"0\" covered=\"yes\" start_line=\"11\" start_column=\"117\" end_line=\"11\" end_column=\"121\" />\n          </ranges>\n        </function>\n      </functions>\n      <source_files>\n        <source_file id=\"0\" path=\"GetSet\\Bar.cs\">\n        </source_file>\n      </source_files>\n    </module>\n    <module name=\"getsettests.dll\" path=\"getsettests.dll\" id=\"D65A79000FA6CD42A919DDEE2E30D54301000000\" block_coverage=\"100.00\" line_coverage=\"100.00\" blocks_covered=\"5\" blocks_not_covered=\"0\" lines_covered=\"5\" lines_partially_covered=\"0\" lines_not_covered=\"0\">\n      <functions>\n        <function id=\"8272\" token=\"0x6000001\" name=\"TestSetter()\" namespace=\"GetSetTests\" type_name=\"BarTests\" block_coverage=\"100.00\" line_coverage=\"100.00\" blocks_covered=\"5\" blocks_not_covered=\"0\" lines_covered=\"5\" lines_partially_covered=\"0\" lines_not_covered=\"0\">\n          <ranges>\n            <range source_id=\"0\" covered=\"yes\" start_line=\"13\" start_column=\"9\" end_line=\"13\" end_column=\"10\" />\n            <range source_id=\"0\" covered=\"yes\" start_line=\"14\" start_column=\"13\" end_line=\"14\" end_column=\"33\" />\n            <range source_id=\"0\" covered=\"yes\" start_line=\"15\" start_column=\"13\" end_line=\"15\" end_column=\"48\" />\n            <range source_id=\"0\" covered=\"yes\" start_line=\"16\" start_column=\"13\" end_line=\"16\" end_column=\"32\" />\n            <range source_id=\"0\" covered=\"yes\" start_line=\"17\" start_column=\"9\" end_line=\"17\" end_column=\"10\" />\n          </ranges>\n        </function>\n      </functions>\n      <source_files>\n        <source_file id=\"0\" path=\"GetSetTests\\BarTests.cs\">\n        </source_file>\n      </source_files>\n    </module>\n  </modules>\n</results>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/visualstudio_coverage_xml/invalid_path.coveragexml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<results>\n  <modules>\n    <module name=\"calcmultiplytest.dll\" path=\"calcmultiplytest.dll\" id=\"9753A02D1CD4A149AF8424F2CCB0D1CE01000000\" block_coverage=\"100.00\" line_coverage=\"100.00\" blocks_covered=\"3\" blocks_not_covered=\"0\" lines_covered=\"3\" lines_partially_covered=\"0\" lines_not_covered=\"0\">\n      <functions>\n        <function id=\"8272\" token=\"0x6000001\" name=\"TestMethod1()\" type_name=\"MultiplyTest\" block_coverage=\"100.00\" line_coverage=\"100.00\" blocks_covered=\"3\" blocks_not_covered=\"0\" lines_covered=\"3\" lines_partially_covered=\"0\" lines_not_covered=\"0\">\n          <ranges>\n            <range source_id=\"0\" covered=\"yes\" start_line=\"13\" start_column=\"9\" end_line=\"13\" end_column=\"10\" />\n            <range source_id=\"0\" covered=\"yes\" start_line=\"14\" start_column=\"13\" end_line=\"14\" end_column=\"55\" />\n            <range source_id=\"0\" covered=\"yes\" start_line=\"15\" start_column=\"9\" end_line=\"15\" end_column=\"10\" />\n          </ranges>\n        </function>\n      </functions>\n      <source_files>\n        <source_file id=\"0\" path=\"CalcMultiplyTest\\MultiplyTest.cs\">\n        </source_file>\n      </source_files>\n    </module>\n    <module name=\"mylibrary.dll\" path=\"mylibrary.dll\" id=\"FB216D2B58233E4094446935C1C5AF4C01000000\" block_coverage=\"20.00\" line_coverage=\"18.75\" blocks_covered=\"2\" blocks_not_covered=\"8\" lines_covered=\"3\" lines_partially_covered=\"0\" lines_not_covered=\"13\">\n      <functions>\n        <function id=\"8272\" token=\"0x6000001\" name=\"Add(int, int)\" type_name=\"Calc\" block_coverage=\"0.00\" line_coverage=\"0.00\" blocks_covered=\"0\" blocks_not_covered=\"2\" lines_covered=\"0\" lines_partially_covered=\"0\" lines_not_covered=\"3\">\n          <ranges>\n            <range source_id=\"0\" covered=\"no\" start_line=\"12\" start_column=\"9\" end_line=\"12\" end_column=\"10\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"13\" start_column=\"13\" end_line=\"13\" end_column=\"33\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"14\" start_column=\"9\" end_line=\"14\" end_column=\"10\" />\n          </ranges>\n        </function>\n        <function id=\"8296\" token=\"0x6000002\" name=\"Multiply(int, int)\" type_name=\"Calc\" block_coverage=\"100.00\" line_coverage=\"100.00\" blocks_covered=\"2\" blocks_not_covered=\"0\" lines_covered=\"3\" lines_partially_covered=\"0\" lines_not_covered=\"0\">\n          <ranges>\n            <range source_id=\"0\" covered=\"yes\" start_line=\"17\" start_column=\"9\" end_line=\"17\" end_column=\"10\" />\n            <range source_id=\"0\" covered=\"partial\" start_line=\"18\" start_column=\"13\" end_line=\"18\" end_column=\"33\" />\n            <range source_id=\"0\" covered=\"yes\" start_line=\"19\" start_column=\"9\" end_line=\"19\" end_column=\"10\" />\n          </ranges>\n        </function>\n        <function id=\"8320\" token=\"0x6000003\" name=\"Divide(int, int)\" type_name=\"Calc\" block_coverage=\"0.00\" line_coverage=\"0.00\" blocks_covered=\"0\" blocks_not_covered=\"5\" lines_covered=\"0\" lines_partially_covered=\"0\" lines_not_covered=\"7\">\n          <ranges>\n            <range source_id=\"0\" covered=\"no\" start_line=\"22\" start_column=\"9\" end_line=\"22\" end_column=\"10\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"23\" start_column=\"13\" end_line=\"23\" end_column=\"28\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"24\" start_column=\"13\" end_line=\"24\" end_column=\"14\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"25\" start_column=\"17\" end_line=\"25\" end_column=\"63\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"26\" start_column=\"13\" end_line=\"26\" end_column=\"14\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"28\" start_column=\"13\" end_line=\"28\" end_column=\"33\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"29\" start_column=\"9\" end_line=\"29\" end_column=\"10\" />\n          </ranges>\n        </function>\n        <function id=\"8362\" token=\"0x6000004\" name=\"horrible_code(out int)\" type_name=\"Calc\" block_coverage=\"0.00\" line_coverage=\"0.00\" blocks_covered=\"0\" blocks_not_covered=\"1\" lines_covered=\"0\" lines_partially_covered=\"0\" lines_not_covered=\"3\">\n          <ranges>\n            <range source_id=\"0\" covered=\"no\" start_line=\"32\" start_column=\"9\" end_line=\"32\" end_column=\"10\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"33\" start_column=\"13\" end_line=\"33\" end_column=\"25\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"34\" start_column=\"9\" end_line=\"34\" end_column=\"10\" />\n          </ranges>\n        </function>\n      </functions>\n      <source_files>\n        <source_file id=\"0\" path=\"z:\\*&quot;?.cs\">\n        </source_file>\n      </source_files>\n    </module>\n  </modules>\n</results>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/visualstudio_coverage_xml/invalid_root.coveragexml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<foo />\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/visualstudio_coverage_xml/no_ranges.coveragexml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<results>\n  <modules>\n    <module name=\"calcmultiplytest.dll\" path=\"calcmultiplytest.dll\" id=\"9753A02D1CD4A149AF8424F2CCB0D1CE01000000\" block_coverage=\"100.00\" line_coverage=\"100.00\" blocks_covered=\"3\" blocks_not_covered=\"0\" lines_covered=\"3\" lines_partially_covered=\"0\" lines_not_covered=\"0\">\n      <functions>\n        <function id=\"8272\" token=\"0x6000001\" name=\"TestMethod1()\" type_name=\"MultiplyTest\" block_coverage=\"100.00\" line_coverage=\"100.00\" blocks_covered=\"3\" blocks_not_covered=\"0\" lines_covered=\"3\" lines_partially_covered=\"0\" lines_not_covered=\"0\">\n          <ranges>\n              <!-- manually removed ranges to test branch coverage for this case-->\n          </ranges>\n        </function>\n      </functions>\n      <source_files>\n        <source_file id=\"0\" path=\"CalcMultiplyTest\\MultiplyTest.cs\">\n        </source_file>\n      </source_files>\n    </module>\n    <module name=\"mylibrary.dll\" path=\"mylibrary.dll\" id=\"FB216D2B58233E4094446935C1C5AF4C01000000\" block_coverage=\"20.00\" line_coverage=\"18.75\" blocks_covered=\"2\" blocks_not_covered=\"8\" lines_covered=\"3\" lines_partially_covered=\"0\" lines_not_covered=\"13\">\n      <functions>\n        <function id=\"8272\" token=\"0x6000001\" name=\"Add(int, int)\" type_name=\"Calc\" block_coverage=\"0.00\" line_coverage=\"0.00\" blocks_covered=\"0\" blocks_not_covered=\"2\" lines_covered=\"0\" lines_partially_covered=\"0\" lines_not_covered=\"3\">\n          <ranges>\n            <!-- manually removed ranges to test branch coverage for this case-->\n          </ranges>\n        </function>\n        <function id=\"8296\" token=\"0x6000002\" name=\"Multiply(int, int)\" type_name=\"Calc\" block_coverage=\"100.00\" line_coverage=\"100.00\" blocks_covered=\"2\" blocks_not_covered=\"0\" lines_covered=\"3\" lines_partially_covered=\"0\" lines_not_covered=\"0\">\n          <ranges>\n            <!-- manually removed ranges to test branch coverage for this case-->\n          </ranges>\n        </function>\n        <function id=\"8320\" token=\"0x6000003\" name=\"Divide(int, int)\" type_name=\"Calc\" block_coverage=\"0.00\" line_coverage=\"0.00\" blocks_covered=\"0\" blocks_not_covered=\"5\" lines_covered=\"0\" lines_partially_covered=\"0\" lines_not_covered=\"7\">\n          <ranges>\n            <range source_id=\"0\" covered=\"no\" start_line=\"22\" start_column=\"9\" end_line=\"22\" end_column=\"10\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"23\" start_column=\"13\" end_line=\"23\" end_column=\"28\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"24\" start_column=\"13\" end_line=\"24\" end_column=\"14\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"25\" start_column=\"17\" end_line=\"25\" end_column=\"63\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"26\" start_column=\"13\" end_line=\"26\" end_column=\"14\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"28\" start_column=\"13\" end_line=\"28\" end_column=\"33\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"29\" start_column=\"9\" end_line=\"29\" end_column=\"10\" />\n          </ranges>\n        </function>\n        <function id=\"8362\" token=\"0x6000004\" name=\"horrible_code(out int)\" type_name=\"Calc\" block_coverage=\"0.00\" line_coverage=\"0.00\" blocks_covered=\"0\" blocks_not_covered=\"1\" lines_covered=\"0\" lines_partially_covered=\"0\" lines_not_covered=\"3\">\n          <ranges>\n            <range source_id=\"0\" covered=\"no\" start_line=\"32\" start_column=\"9\" end_line=\"32\" end_column=\"10\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"33\" start_column=\"13\" end_line=\"33\" end_column=\"25\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"34\" start_column=\"9\" end_line=\"34\" end_column=\"10\" />\n          </ranges>\n        </function>\n      </functions>\n      <source_files>\n        <source_file id=\"0\" path=\"MyLibrary\\Calc.cs\">\n        </source_file>\n      </source_files>\n    </module>\n  </modules>\n</results>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/visualstudio_coverage_xml/valid.coveragexml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<results>\n  <modules>\n    <module name=\"calcmultiplytest.dll\" path=\"calcmultiplytest.dll\" id=\"9753A02D1CD4A149AF8424F2CCB0D1CE01000000\" block_coverage=\"100.00\" line_coverage=\"100.00\" blocks_covered=\"3\" blocks_not_covered=\"0\" lines_covered=\"3\" lines_partially_covered=\"0\" lines_not_covered=\"0\">\n      <functions>\n        <function id=\"8272\" token=\"0x6000001\" name=\"TestMethod1()\" type_name=\"MultiplyTest\" block_coverage=\"100.00\" line_coverage=\"100.00\" blocks_covered=\"3\" blocks_not_covered=\"0\" lines_covered=\"3\" lines_partially_covered=\"0\" lines_not_covered=\"0\">\n          <ranges>\n            <range source_id=\"0\" covered=\"yes\" start_line=\"13\" start_column=\"9\" end_line=\"13\" end_column=\"10\" />\n            <range source_id=\"0\" covered=\"yes\" start_line=\"14\" start_column=\"13\" end_line=\"14\" end_column=\"55\" />\n            <range source_id=\"0\" covered=\"yes\" start_line=\"15\" start_column=\"9\" end_line=\"15\" end_column=\"10\" />\n          </ranges>\n        </function>\n      </functions>\n      <source_files>\n        <source_file id=\"0\" path=\"CalcMultiplyTest\\MultiplyTest.cs\">\n        </source_file>\n      </source_files>\n    </module>\n    <module name=\"mylibrary.dll\" path=\"mylibrary.dll\" id=\"FB216D2B58233E4094446935C1C5AF4C01000000\" block_coverage=\"20.00\" line_coverage=\"18.75\" blocks_covered=\"2\" blocks_not_covered=\"8\" lines_covered=\"3\" lines_partially_covered=\"0\" lines_not_covered=\"13\">\n      <functions>\n        <function id=\"8272\" token=\"0x6000001\" name=\"Add(int, int)\" type_name=\"Calc\" block_coverage=\"0.00\" line_coverage=\"0.00\" blocks_covered=\"0\" blocks_not_covered=\"2\" lines_covered=\"0\" lines_partially_covered=\"0\" lines_not_covered=\"3\">\n          <ranges>\n            <range source_id=\"0\" covered=\"no\" start_line=\"12\" start_column=\"9\" end_line=\"12\" end_column=\"10\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"13\" start_column=\"13\" end_line=\"13\" end_column=\"33\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"14\" start_column=\"9\" end_line=\"14\" end_column=\"10\" />\n          </ranges>\n        </function>\n        <function id=\"8296\" token=\"0x6000002\" name=\"Multiply(int, int)\" type_name=\"Calc\" block_coverage=\"100.00\" line_coverage=\"100.00\" blocks_covered=\"2\" blocks_not_covered=\"0\" lines_covered=\"3\" lines_partially_covered=\"0\" lines_not_covered=\"0\">\n          <ranges>\n            <range source_id=\"0\" covered=\"yes\" start_line=\"17\" start_column=\"9\" end_line=\"17\" end_column=\"10\" />\n            <range source_id=\"0\" covered=\"partial\" start_line=\"18\" start_column=\"13\" end_line=\"18\" end_column=\"33\" />\n            <range source_id=\"0\" covered=\"yes\" start_line=\"19\" start_column=\"9\" end_line=\"19\" end_column=\"10\" />\n          </ranges>\n        </function>\n        <function id=\"8320\" token=\"0x6000003\" name=\"Divide(int, int)\" type_name=\"Calc\" block_coverage=\"0.00\" line_coverage=\"0.00\" blocks_covered=\"0\" blocks_not_covered=\"5\" lines_covered=\"0\" lines_partially_covered=\"0\" lines_not_covered=\"7\">\n          <ranges>\n            <range source_id=\"0\" covered=\"no\" start_line=\"22\" start_column=\"9\" end_line=\"22\" end_column=\"10\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"23\" start_column=\"13\" end_line=\"23\" end_column=\"28\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"24\" start_column=\"13\" end_line=\"24\" end_column=\"14\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"25\" start_column=\"17\" end_line=\"25\" end_column=\"63\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"26\" start_column=\"13\" end_line=\"26\" end_column=\"14\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"28\" start_column=\"13\" end_line=\"28\" end_column=\"33\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"29\" start_column=\"9\" end_line=\"29\" end_column=\"10\" />\n          </ranges>\n        </function>\n        <function id=\"8362\" token=\"0x6000004\" name=\"horrible_code(out int)\" type_name=\"Calc\" block_coverage=\"0.00\" line_coverage=\"0.00\" blocks_covered=\"0\" blocks_not_covered=\"1\" lines_covered=\"0\" lines_partially_covered=\"0\" lines_not_covered=\"3\">\n          <ranges>\n            <range source_id=\"0\" covered=\"no\" start_line=\"32\" start_column=\"9\" end_line=\"32\" end_column=\"10\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"33\" start_column=\"13\" end_line=\"33\" end_column=\"25\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"34\" start_column=\"9\" end_line=\"34\" end_column=\"10\" />\n          </ranges>\n        </function>\n      </functions>\n      <source_files>\n        <source_file id=\"0\" path=\"MyLibrary\\Calc.cs\">\n        </source_file>\n      </source_files>\n    </module>\n  </modules>\n</results>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/visualstudio_coverage_xml/valid_complex_case.coveragexml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<!--\nBelow is the code for which this coverage file has been created,\ntogether with the commands to generate the file and the tools versions.\n\nNote: the file paths were manually changed inside the report to be relative.\n________________________________________________________\n\nnamespace GetSet\n{\n    public class Bar\n    {\n        public int CoveredGet { get; set; } public int UncoveredProperty { get; set; } public int CoveredSet { get; set; }\n\n        public int CoveredGetOnSecondLine { get; set; }\n\n        public int CoveredProperty { get; set; }\n\n        public int ArrowMethod(bool condition) => condition ? CoveredGetOnSecondLine : UncoveredProperty;\n\n        public int BodyMethod()\n        {\n            var x = CoveredProperty; CoveredProperty = 1; goto label; UncoveredProperty = 1;\n\n            UncoveredProperty = 1;\n\n            label:\n            CoveredSet = 1;\n\n            return CoveredGet;\n        }\n    }\n}\n\nnamespace GetSet\n{\n    public class FooCallsBar\n    {\n        public void CallBar(Bar bar)\n        {\n            Console.WriteLine(bar.CoveredGet);\n            Console.WriteLine(bar.CoveredProperty);\n        }\n    }\n}\n________________________________________________________\n\nusing GetSet;\n\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\n\nnamespace GetSetTests\n{\n    [TestClass]\n    public class BarTests\n    {\n        [TestMethod]\n        public void CallMethods()\n        {\n            Bar bar = new Bar();\n            bar.BodyMethod();\n            bar.ArrowMethod(true);\n        }\n\n        [TestMethod]\n        public void CallBarViaFoo()\n        {\n            FooCallsBar fooCallsBar = new FooCallsBar();\n            fooCallsBar.CallBar(new Bar());\n        }\n    }\n}\n________________________________________________________\n\nmsbuild .\\GetSetCoverage.sln /t:Rebuild\nvstest.console.exe /EnableCodeCoverage .\\GetSetTests\\bin\\Debug\\GetSetTests.dll\nCodeCoverage.exe analyze /output:\"VisualStudio.coveragexml\" \"PATH_TO_REPORT\"\n\nMicrosoft (R) Test Execution Command Line Tool Version 16.3.0-preview-20190715-02\nMicrosoft (R) Coverage Collection Tool Version 16.0.30319.200\n-->\n<results>\n  <modules>\n    <module name=\"getset.dll\" path=\"getset.dll\" id=\"4F29D1E955107F4585CB1B5DC2CC1F9001000000\" block_coverage=\"74.07\" line_coverage=\"71.43\" blocks_covered=\"20\" blocks_not_covered=\"7\" lines_covered=\"15\" lines_partially_covered=\"1\" lines_not_covered=\"5\">\n      <functions>\n        <function id=\"8272\" token=\"0x6000001\" name=\"get_CoveredGet()\" namespace=\"GetSet\" type_name=\"Bar\" block_coverage=\"100.00\" line_coverage=\"100.00\" blocks_covered=\"1\" blocks_not_covered=\"0\" lines_covered=\"1\" lines_partially_covered=\"0\" lines_not_covered=\"0\">\n          <ranges>\n            <range source_id=\"1\" covered=\"yes\" start_line=\"11\" start_column=\"33\" end_line=\"11\" end_column=\"37\" />\n          </ranges>\n        </function>\n        <function id=\"8280\" token=\"0x6000002\" name=\"set_CoveredGet(int)\" namespace=\"GetSet\" type_name=\"Bar\" block_coverage=\"0.00\" line_coverage=\"0.00\" blocks_covered=\"0\" blocks_not_covered=\"1\" lines_covered=\"0\" lines_partially_covered=\"0\" lines_not_covered=\"1\">\n          <ranges>\n            <range source_id=\"1\" covered=\"no\" start_line=\"11\" start_column=\"38\" end_line=\"11\" end_column=\"42\" />\n          </ranges>\n        </function>\n        <function id=\"8289\" token=\"0x6000003\" name=\"get_UncoveredProperty()\" namespace=\"GetSet\" type_name=\"Bar\" block_coverage=\"0.00\" line_coverage=\"0.00\" blocks_covered=\"0\" blocks_not_covered=\"1\" lines_covered=\"0\" lines_partially_covered=\"0\" lines_not_covered=\"1\">\n          <ranges>\n            <range source_id=\"1\" covered=\"no\" start_line=\"11\" start_column=\"76\" end_line=\"11\" end_column=\"80\" />\n          </ranges>\n        </function>\n        <function id=\"8297\" token=\"0x6000004\" name=\"set_UncoveredProperty(int)\" namespace=\"GetSet\" type_name=\"Bar\" block_coverage=\"0.00\" line_coverage=\"0.00\" blocks_covered=\"0\" blocks_not_covered=\"1\" lines_covered=\"0\" lines_partially_covered=\"0\" lines_not_covered=\"1\">\n          <ranges>\n            <range source_id=\"1\" covered=\"no\" start_line=\"11\" start_column=\"81\" end_line=\"11\" end_column=\"85\" />\n          </ranges>\n        </function>\n        <function id=\"8306\" token=\"0x6000005\" name=\"get_CoveredSet()\" namespace=\"GetSet\" type_name=\"Bar\" block_coverage=\"0.00\" line_coverage=\"0.00\" blocks_covered=\"0\" blocks_not_covered=\"1\" lines_covered=\"0\" lines_partially_covered=\"0\" lines_not_covered=\"1\">\n          <ranges>\n            <range source_id=\"1\" covered=\"no\" start_line=\"11\" start_column=\"112\" end_line=\"11\" end_column=\"116\" />\n          </ranges>\n        </function>\n        <function id=\"8314\" token=\"0x6000006\" name=\"set_CoveredSet(int)\" namespace=\"GetSet\" type_name=\"Bar\" block_coverage=\"100.00\" line_coverage=\"100.00\" blocks_covered=\"1\" blocks_not_covered=\"0\" lines_covered=\"1\" lines_partially_covered=\"0\" lines_not_covered=\"0\">\n          <ranges>\n            <range source_id=\"1\" covered=\"yes\" start_line=\"11\" start_column=\"117\" end_line=\"11\" end_column=\"121\" />\n          </ranges>\n        </function>\n        <function id=\"8323\" token=\"0x6000007\" name=\"get_CoveredGetOnSecondLine()\" namespace=\"GetSet\" type_name=\"Bar\" block_coverage=\"100.00\" line_coverage=\"100.00\" blocks_covered=\"1\" blocks_not_covered=\"0\" lines_covered=\"1\" lines_partially_covered=\"0\" lines_not_covered=\"0\">\n          <ranges>\n            <range source_id=\"1\" covered=\"yes\" start_line=\"13\" start_column=\"45\" end_line=\"13\" end_column=\"49\" />\n          </ranges>\n        </function>\n        <function id=\"8331\" token=\"0x6000008\" name=\"set_CoveredGetOnSecondLine(int)\" namespace=\"GetSet\" type_name=\"Bar\" block_coverage=\"0.00\" line_coverage=\"0.00\" blocks_covered=\"0\" blocks_not_covered=\"1\" lines_covered=\"0\" lines_partially_covered=\"0\" lines_not_covered=\"1\">\n          <ranges>\n            <range source_id=\"1\" covered=\"no\" start_line=\"13\" start_column=\"50\" end_line=\"13\" end_column=\"54\" />\n          </ranges>\n        </function>\n        <function id=\"8340\" token=\"0x6000009\" name=\"get_CoveredProperty()\" namespace=\"GetSet\" type_name=\"Bar\" block_coverage=\"100.00\" line_coverage=\"100.00\" blocks_covered=\"1\" blocks_not_covered=\"0\" lines_covered=\"1\" lines_partially_covered=\"0\" lines_not_covered=\"0\">\n          <ranges>\n            <range source_id=\"1\" covered=\"yes\" start_line=\"15\" start_column=\"38\" end_line=\"15\" end_column=\"42\" />\n          </ranges>\n        </function>\n        <function id=\"8348\" token=\"0x600000a\" name=\"set_CoveredProperty(int)\" namespace=\"GetSet\" type_name=\"Bar\" block_coverage=\"100.00\" line_coverage=\"100.00\" blocks_covered=\"1\" blocks_not_covered=\"0\" lines_covered=\"1\" lines_partially_covered=\"0\" lines_not_covered=\"0\">\n          <ranges>\n            <range source_id=\"1\" covered=\"yes\" start_line=\"15\" start_column=\"43\" end_line=\"15\" end_column=\"47\" />\n          </ranges>\n        </function>\n        <function id=\"8357\" token=\"0x600000b\" name=\"ArrowMethod(bool)\" namespace=\"GetSet\" type_name=\"Bar\" block_coverage=\"60.00\" line_coverage=\"0.00\" blocks_covered=\"3\" blocks_not_covered=\"2\" lines_covered=\"0\" lines_partially_covered=\"1\" lines_not_covered=\"0\">\n          <ranges>\n            <range source_id=\"1\" covered=\"partial\" start_line=\"17\" start_column=\"51\" end_line=\"17\" end_column=\"105\" />\n          </ranges>\n        </function>\n        <function id=\"8376\" token=\"0x600000c\" name=\"BodyMethod()\" namespace=\"GetSet\" type_name=\"Bar\" block_coverage=\"100.00\" line_coverage=\"100.00\" blocks_covered=\"7\" blocks_not_covered=\"0\" lines_covered=\"6\" lines_partially_covered=\"0\" lines_not_covered=\"0\">\n          <ranges>\n            <range source_id=\"1\" covered=\"yes\" start_line=\"20\" start_column=\"9\" end_line=\"20\" end_column=\"10\" />\n            <range source_id=\"1\" covered=\"yes\" start_line=\"21\" start_column=\"13\" end_line=\"21\" end_column=\"37\" />\n            <range source_id=\"1\" covered=\"yes\" start_line=\"21\" start_column=\"38\" end_line=\"21\" end_column=\"58\" />\n            <range source_id=\"1\" covered=\"yes\" start_line=\"21\" start_column=\"59\" end_line=\"21\" end_column=\"70\" />\n            <range source_id=\"1\" covered=\"yes\" start_line=\"25\" start_column=\"13\" end_line=\"25\" end_column=\"19\" />\n            <range source_id=\"1\" covered=\"yes\" start_line=\"26\" start_column=\"13\" end_line=\"26\" end_column=\"28\" />\n            <range source_id=\"1\" covered=\"yes\" start_line=\"28\" start_column=\"13\" end_line=\"28\" end_column=\"31\" />\n            <range source_id=\"1\" covered=\"yes\" start_line=\"29\" start_column=\"9\" end_line=\"29\" end_column=\"10\" />\n          </ranges>\n        </function>\n        <function id=\"8435\" token=\"0x600000e\" name=\"CallBar(GetSet.Bar)\" namespace=\"GetSet\" type_name=\"FooCallsBar\" block_coverage=\"100.00\" line_coverage=\"100.00\" blocks_covered=\"5\" blocks_not_covered=\"0\" lines_covered=\"4\" lines_partially_covered=\"0\" lines_not_covered=\"0\">\n          <ranges>\n            <range source_id=\"0\" covered=\"yes\" start_line=\"8\" start_column=\"9\" end_line=\"8\" end_column=\"10\" />\n            <range source_id=\"0\" covered=\"yes\" start_line=\"9\" start_column=\"13\" end_line=\"9\" end_column=\"47\" />\n            <range source_id=\"0\" covered=\"yes\" start_line=\"10\" start_column=\"13\" end_line=\"10\" end_column=\"52\" />\n            <range source_id=\"0\" covered=\"yes\" start_line=\"11\" start_column=\"9\" end_line=\"11\" end_column=\"10\" />\n          </ranges>\n        </function>\n      </functions>\n      <source_files>\n        <source_file id=\"0\" path=\"GetSet\\FooCallsBar.cs\">\n        </source_file>\n        <source_file id=\"1\" path=\"GetSet\\Bar.cs\">\n        </source_file>\n      </source_files>\n    </module>\n    <module name=\"getsettests.dll\" path=\"getsettests.dll\" id=\"7CA67A8D14F6144B94385F5DF112418B01000000\" block_coverage=\"100.00\" line_coverage=\"100.00\" blocks_covered=\"8\" blocks_not_covered=\"0\" lines_covered=\"9\" lines_partially_covered=\"0\" lines_not_covered=\"0\">\n      <functions>\n        <function id=\"8272\" token=\"0x6000001\" name=\"CallMethods()\" namespace=\"GetSetTests\" type_name=\"BarTests\" block_coverage=\"100.00\" line_coverage=\"100.00\" blocks_covered=\"4\" blocks_not_covered=\"0\" lines_covered=\"5\" lines_partially_covered=\"0\" lines_not_covered=\"0\">\n          <ranges>\n            <range source_id=\"0\" covered=\"yes\" start_line=\"13\" start_column=\"9\" end_line=\"13\" end_column=\"10\" />\n            <range source_id=\"0\" covered=\"yes\" start_line=\"14\" start_column=\"13\" end_line=\"14\" end_column=\"33\" />\n            <range source_id=\"0\" covered=\"yes\" start_line=\"15\" start_column=\"13\" end_line=\"15\" end_column=\"30\" />\n            <range source_id=\"0\" covered=\"yes\" start_line=\"16\" start_column=\"13\" end_line=\"16\" end_column=\"35\" />\n            <range source_id=\"0\" covered=\"yes\" start_line=\"17\" start_column=\"9\" end_line=\"17\" end_column=\"10\" />\n          </ranges>\n        </function>\n        <function id=\"8308\" token=\"0x6000002\" name=\"CallBarViaFoo()\" namespace=\"GetSetTests\" type_name=\"BarTests\" block_coverage=\"100.00\" line_coverage=\"100.00\" blocks_covered=\"4\" blocks_not_covered=\"0\" lines_covered=\"4\" lines_partially_covered=\"0\" lines_not_covered=\"0\">\n          <ranges>\n            <range source_id=\"0\" covered=\"yes\" start_line=\"21\" start_column=\"9\" end_line=\"21\" end_column=\"10\" />\n            <range source_id=\"0\" covered=\"yes\" start_line=\"22\" start_column=\"13\" end_line=\"22\" end_column=\"57\" />\n            <range source_id=\"0\" covered=\"yes\" start_line=\"23\" start_column=\"13\" end_line=\"23\" end_column=\"44\" />\n            <range source_id=\"0\" covered=\"yes\" start_line=\"24\" start_column=\"9\" end_line=\"24\" end_column=\"10\" />\n          </ranges>\n        </function>\n      </functions>\n      <source_files>\n        <source_file id=\"0\" path=\"GetSetTests\\BarTests.cs\">\n        </source_file>\n      </source_files>\n    </module>\n  </modules>\n</results>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/visualstudio_coverage_xml/wrong_covered.coveragexml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<results>\n  <modules>\n    <module name=\"calcmultiplytest.dll\" path=\"calcmultiplytest.dll\" id=\"9753A02D1CD4A149AF8424F2CCB0D1CE01000000\" block_coverage=\"100.00\" line_coverage=\"100.00\" blocks_covered=\"3\" blocks_not_covered=\"0\" lines_covered=\"3\" lines_partially_covered=\"0\" lines_not_covered=\"0\">\n      <functions>\n        <function id=\"8272\" token=\"0x6000001\" name=\"TestMethod1()\" type_name=\"MultiplyTest\" block_coverage=\"100.00\" line_coverage=\"100.00\" blocks_covered=\"3\" blocks_not_covered=\"0\" lines_covered=\"3\" lines_partially_covered=\"0\" lines_not_covered=\"0\">\n          <ranges>\n            <range source_id=\"0\" covered=\"yes\" start_line=\"13\" start_column=\"9\" end_line=\"13\" end_column=\"10\" />\n            <range source_id=\"0\" covered=\"yes\" start_line=\"14\" start_column=\"13\" end_line=\"14\" end_column=\"55\" />\n            <range source_id=\"0\" covered=\"yes\" start_line=\"15\" start_column=\"9\" end_line=\"15\" end_column=\"10\" />\n          </ranges>\n        </function>\n      </functions>\n      <source_files>\n        <source_file id=\"0\" path=\"CalcMultiplyTest\\MultiplyTest.cs\">\n        </source_file>\n      </source_files>\n    </module>\n    <module name=\"mylibrary.dll\" path=\"mylibrary.dll\" id=\"FB216D2B58233E4094446935C1C5AF4C01000000\" block_coverage=\"20.00\" line_coverage=\"18.75\" blocks_covered=\"2\" blocks_not_covered=\"8\" lines_covered=\"3\" lines_partially_covered=\"0\" lines_not_covered=\"13\">\n      <functions>\n        <function id=\"8272\" token=\"0x6000001\" name=\"Add(int, int)\" type_name=\"Calc\" block_coverage=\"0.00\" line_coverage=\"0.00\" blocks_covered=\"0\" blocks_not_covered=\"2\" lines_covered=\"0\" lines_partially_covered=\"0\" lines_not_covered=\"3\">\n          <ranges>\n            <range source_id=\"0\" covered=\"no\" start_line=\"12\" start_column=\"9\" end_line=\"12\" end_column=\"10\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"13\" start_column=\"13\" end_line=\"13\" end_column=\"33\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"14\" start_column=\"9\" end_line=\"14\" end_column=\"10\" />\n          </ranges>\n        </function>\n        <function id=\"8296\" token=\"0x6000002\" name=\"Multiply(int, int)\" type_name=\"Calc\" block_coverage=\"100.00\" line_coverage=\"100.00\" blocks_covered=\"2\" blocks_not_covered=\"0\" lines_covered=\"3\" lines_partially_covered=\"0\" lines_not_covered=\"0\">\n          <ranges>\n            <range source_id=\"0\" covered=\"yes\" start_line=\"17\" start_column=\"9\" end_line=\"17\" end_column=\"10\" />\n            <range source_id=\"0\" covered=\"yes\" start_line=\"18\" start_column=\"13\" end_line=\"18\" end_column=\"33\" />\n            <range source_id=\"0\" covered=\"yes\" start_line=\"19\" start_column=\"9\" end_line=\"19\" end_column=\"10\" />\n          </ranges>\n        </function>\n        <function id=\"8320\" token=\"0x6000003\" name=\"Divide(int, int)\" type_name=\"Calc\" block_coverage=\"0.00\" line_coverage=\"0.00\" blocks_covered=\"0\" blocks_not_covered=\"5\" lines_covered=\"0\" lines_partially_covered=\"0\" lines_not_covered=\"7\">\n          <ranges>\n            <range source_id=\"0\" covered=\"no\" start_line=\"22\" start_column=\"9\" end_line=\"22\" end_column=\"10\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"23\" start_column=\"13\" end_line=\"23\" end_column=\"28\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"24\" start_column=\"13\" end_line=\"24\" end_column=\"14\" />\n            <range source_id=\"0\" covered=\"foo\" start_line=\"25\" start_column=\"17\" end_line=\"25\" end_column=\"63\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"26\" start_column=\"13\" end_line=\"26\" end_column=\"14\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"28\" start_column=\"13\" end_line=\"28\" end_column=\"33\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"29\" start_column=\"9\" end_line=\"29\" end_column=\"10\" />\n          </ranges>\n        </function>\n        <function id=\"8362\" token=\"0x6000004\" name=\"horrible_code(out int)\" type_name=\"Calc\" block_coverage=\"0.00\" line_coverage=\"0.00\" blocks_covered=\"0\" blocks_not_covered=\"1\" lines_covered=\"0\" lines_partially_covered=\"0\" lines_not_covered=\"3\">\n          <ranges>\n            <range source_id=\"0\" covered=\"no\" start_line=\"32\" start_column=\"9\" end_line=\"32\" end_column=\"10\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"33\" start_column=\"13\" end_line=\"33\" end_column=\"25\" />\n            <range source_id=\"0\" covered=\"no\" start_line=\"34\" start_column=\"9\" end_line=\"34\" end_column=\"10\" />\n          </ranges>\n        </function>\n      </functions>\n      <source_files>\n        <source_file id=\"0\" path=\"MyLibrary\\Calc.cs\">\n        </source_file>\n      </source_files>\n    </module>\n  </modules>\n</results>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/visualstudio_test_results/invalid_character.trx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<TestRun id=\"32dc72b7-35f4-4972-bcfb-972b70eb45bc\" name=\"alexander.meseldzija@PC-L0109 2024-11-25 15:38:27\" runUser=\"PC-L0109\\alexander.meseldzija\" xmlns=\"http://microsoft.com/schemas/VisualStudio/TeamTest/2010\">\n  <Times creation=\"2024-11-25T15:38:27.5859867+01:00\" queuing=\"2024-11-25T15:38:27.5859872+01:00\" start=\"2024-11-25T15:38:26.7286526+01:00\" finish=\"2024-11-25T15:38:27.6045199+01:00\" />\n  <TestSettings name=\"default\" id=\"5291548f-8adc-4573-93b0-5bcf78054c8b\">\n    <Deployment runDeploymentRoot=\"alexander.meseldzija_PC-L0109_2024-11-25_15_38_27\" />\n  </TestSettings>\n  <Results>\n    <UnitTestResult executionId=\"eff25556-c0df-4a48-b88d-2286e542af4f\" testId=\"d7744238-9adf-b364-3d70-ae38261a8cd8\" testName=\"TestShouldFail\" computerName=\"PC-L0109\" duration=\"00:00:00.0183996\" startTime=\"2024-11-25T15:38:27.3755778+01:00\" endTime=\"2024-11-25T15:38:27.3951390+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"Failed\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"eff25556-c0df-4a48-b88d-2286e542af4f\">\n    <Output>\n      <StdOut><</StdOut>\n    </Output>\n    </UnitTestResult>\n  </Results>\n  <ResultSummary outcome=\"Failed\">\n    <Counters total=\"1\" executed=\"1\" passed=\"0\" failed=\"1\" error=\"0\" timeout=\"0\" aborted=\"0\" inconclusive=\"0\" passedButRunAborted=\"0\" notRunnable=\"0\" notExecuted=\"0\" disconnected=\"0\" warning=\"0\" completed=\"0\" inProgress=\"0\" pending=\"0\" />\n    <Output>\n      <StdOut>Test 'TestShouldSkip' was skipped in the test run.&#xD;\n  </ResultSummary>\n</TestRun>"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/visualstudio_test_results/invalid_dates.trx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<TestRun id=\"32dc72b7-35f4-4972-bcfb-972b70eb45bc\" name=\"alexander.meseldzija@PC-L0109 2024-11-25 15:38:27\" runUser=\"PC-L0109\\alexander.meseldzija\" xmlns=\"http://microsoft.com/schemas/VisualStudio/TeamTest/2010\">\n  <Results>\n    <UnitTestResult executionId=\"eff25556-c0df-4a48-b88d-2286e542af4f\" testId=\"d7744238-9adf-b364-3d70-ae38261a8cd8\" testName=\"TestWithBadDates\" computerName=\"PC-L0109\" duration=\"00:00:00.0183996\" startTime=\"2016-xx-14T17:04:31.1+01:00\" endTime=\"2016-xx-14T17:04:31.9162137+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"Failed\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"eff25556-c0df-4a48-b88d-2286e542af4f\"/>\n  </Results>\n  <TestDefinitions>\n    <UnitTest name=\"TestDoesNotExist\" storage=\"c:\\dev\\playground\\playground.test\\bin\\debug\\net9.0\\playground.test.dll\" id=\"d7744238-9adf-b364-3d70-ae38261a8cd8\">\n      <Execution id=\"eff25556-c0df-4a48-b88d-2286e542af4f\" />\n      <TestMethod codeBase=\"C:\\dev\\Playground\\Playground.Test\\bin\\Debug\\net9.0\\Playground.Test.dll\" adapterTypeName=\"executor://mstestadapter/v2\" className=\"TestProject1.UnitTest1\" name=\"TestWithBadDates\" />\n    </UnitTest>\n  </TestDefinitions>\n  <TestEntries>\n    <TestEntry testId=\"d7744238-9adf-b364-3d70-ae38261a8cd8\" executionId=\"eff25556-c0df-4a48-b88d-2286e542af4f\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" />\n  </TestEntries>\n  <TestLists>\n    <TestList name=\"Results Not in a List\" id=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" />\n    <TestList name=\"All Loaded Results\" id=\"19431567-8539-422a-85d7-44ee4e166bda\" />\n  </TestLists>\n  <ResultSummary outcome=\"Failed\">\n    <Counters total=\"1\" executed=\"1\" passed=\"0\" failed=\"1\" error=\"0\" timeout=\"0\" aborted=\"0\" inconclusive=\"0\" passedButRunAborted=\"0\" notRunnable=\"0\" notExecuted=\"0\" disconnected=\"0\" warning=\"0\" completed=\"0\" inProgress=\"0\" pending=\"0\" />\n  </ResultSummary>\n</TestRun>"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/visualstudio_test_results/invalid_test_outcome.trx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<TestRun id=\"32dc72b7-35f4-4972-bcfb-972b70eb45bc\" name=\"alexander.meseldzija@PC-L0109 2024-11-25 15:38:27\" runUser=\"PC-L0109\\alexander.meseldzija\" xmlns=\"http://microsoft.com/schemas/VisualStudio/TeamTest/2010\">\n  <Results>\n    <UnitTestResult executionId=\"eff25556-c0df-4a48-b88d-2286e542af4f\" testId=\"d7744238-9adf-b364-3d70-ae38261a8cd8\" testName=\"TestDoesNotExist\" computerName=\"PC-L0109\" duration=\"00:00:00.0183996\" startTime=\"2024-11-25T15:38:27.3755778+01:00\" endTime=\"2024-11-25T15:38:27.3951390+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"ThisDoesntMatch\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"eff25556-c0df-4a48-b88d-2286e542af4f\"/>\n  </Results>\n  <TestDefinitions>\n    <UnitTest name=\"InvalidOutcome\" storage=\"c:\\dev\\playground\\playground.test\\bin\\debug\\net9.0\\playground.test.dll\" id=\"d7744238-9adf-b364-3d70-ae38261a8cd8\">\n      <Execution id=\"eff25556-c0df-4a48-b88d-2286e542af4f\" />\n      <TestMethod codeBase=\"C:\\dev\\Playground\\Playground.Test\\bin\\Debug\\net9.0\\Playground.Test.dll\" adapterTypeName=\"executor://mstestadapter/v2\" className=\"TestProject1.UnitTest1\" name=\"InvalidOutcome\" />\n    </UnitTest>\n  </TestDefinitions>\n  <TestEntries>\n    <TestEntry testId=\"d7744238-9adf-b364-3d70-ae38261a8cd8\" executionId=\"eff25556-c0df-4a48-b88d-2286e542af4f\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" />\n  </TestEntries>\n  <TestLists>\n    <TestList name=\"Results Not in a List\" id=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" />\n    <TestList name=\"All Loaded Results\" id=\"19431567-8539-422a-85d7-44ee4e166bda\" />\n  </TestLists>\n  <ResultSummary outcome=\"Failed\">\n    <Counters total=\"1\" executed=\"1\" passed=\"0\" failed=\"1\" error=\"0\" timeout=\"0\" aborted=\"0\" inconclusive=\"0\" passedButRunAborted=\"0\" notRunnable=\"0\" notExecuted=\"0\" disconnected=\"0\" warning=\"0\" completed=\"0\" inProgress=\"0\" pending=\"0\" />\n  </ResultSummary>\n</TestRun>"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/visualstudio_test_results/multiple_runs_same_test.trx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<TestRun id=\"5fc83781-628c-4eb3-b808-82dcc2474a5c\" name=\"costin.zaharia@PC0245 2024-12-13 11:08:01\" runUser=\"PC0245\\costin.zaharia\" xmlns=\"http://microsoft.com/schemas/VisualStudio/TeamTest/2010\">\n  <Times creation=\"2024-12-13T11:08:01.4331844+01:00\" queuing=\"2024-12-13T11:08:01.4331853+01:00\" start=\"2024-12-13T11:08:00.4760240+01:00\" finish=\"2024-12-13T11:08:01.4375292+01:00\" />\n  <TestSettings name=\"default\" id=\"250a438c-efdc-4d0c-8af6-3a143cdc354b\">\n    <Deployment runDeploymentRoot=\"costin.zaharia_PC0245_2024-12-13_11_08_01\" />\n  </TestSettings>\n  <Results>\n    <UnitTestResult executionId=\"14413bbf-9618-4c07-a933-75bc942bb726\" testId=\"ab6094d2-07ab-58c5-03e0-a4fb244efd26\" testName=\"TestMethod1 (Struct,&quot;struct&quot;)\" computerName=\"PC0245\" duration=\"00:00:00.0027973\" startTime=\"2024-12-13T11:08:01.2301061+01:00\" endTime=\"2024-12-13T11:08:01.2544703+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"Passed\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"14413bbf-9618-4c07-a933-75bc942bb726\" />\n    <UnitTestResult executionId=\"681a22c2-5761-47c0-b192-df62de73c644\" testId=\"ab6094d2-07ab-58c5-03e0-a4fb244efd26\" testName=\"TestMethod1 (Struct,&quot;struct&quot;)\" computerName=\"PC0245\" duration=\"00:00:00.0002375\" startTime=\"2024-12-13T11:08:01.2579245+01:00\" endTime=\"2024-12-13T11:08:01.2592873+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"Passed\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"681a22c2-5761-47c0-b192-df62de73c644\" />\n  </Results>\n  <TestDefinitions>\n    <UnitTest name=\"TestMethod1 (Struct,&quot;struct&quot;)\" storage=\"d:\\src\\playgroud\\testreport\\testreport\\bin\\debug\\net9.0\\testreport.dll\" id=\"ab6094d2-07ab-58c5-03e0-a4fb244efd26\">\n      <Execution id=\"14413bbf-9618-4c07-a933-75bc942bb726\" />\n      <TestMethod codeBase=\"D:\\src\\playgroud\\TestReport\\TestReport\\bin\\Debug\\net9.0\\TestReport.dll\" adapterTypeName=\"executor://mstestadapter/v2\" className=\"TestReport.Test1\" name=\"TestMethod1\" />\n    </UnitTest>\n  </TestDefinitions>\n  <TestEntries>\n    <TestEntry testId=\"ab6094d2-07ab-58c5-03e0-a4fb244efd26\" executionId=\"14413bbf-9618-4c07-a933-75bc942bb726\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" />\n    <TestEntry testId=\"ab6094d2-07ab-58c5-03e0-a4fb244efd26\" executionId=\"681a22c2-5761-47c0-b192-df62de73c644\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" />\n  </TestEntries>\n  <TestLists>\n    <TestList name=\"Results Not in a List\" id=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" />\n    <TestList name=\"All Loaded Results\" id=\"19431567-8539-422a-85d7-44ee4e166bda\" />\n  </TestLists>\n  <ResultSummary outcome=\"Completed\">\n    <Counters total=\"2\" executed=\"2\" passed=\"2\" failed=\"0\" error=\"0\" timeout=\"0\" aborted=\"0\" inconclusive=\"0\" passedButRunAborted=\"0\" notRunnable=\"0\" notExecuted=\"0\" disconnected=\"0\" warning=\"0\" completed=\"0\" inProgress=\"0\" pending=\"0\" />\n  </ResultSummary>\n</TestRun>"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/visualstudio_test_results/nunitproject_with_vs_logger.trx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<TestRun id=\"244abbbf-e5fd-4541-88a6-3a9919f4c512\" name=\"costin.zaharia@PC0245 2024-12-18 09:07:08\" runUser=\"PC0245\\costin.zaharia\" xmlns=\"http://microsoft.com/schemas/VisualStudio/TeamTest/2010\">\n  <Times creation=\"2024-12-18T09:07:08.1509825+01:00\" queuing=\"2024-12-18T09:07:08.1509833+01:00\" start=\"2024-12-18T09:07:07.2829123+01:00\" finish=\"2024-12-18T09:07:08.1570787+01:00\" />\n  <TestSettings name=\"default\" id=\"5834e899-200f-4680-b96f-f63a3b5458d7\">\n    <Deployment runDeploymentRoot=\"costin.zaharia_PC0245_2024-12-18_09_07_08\" />\n  </TestSettings>\n  <Results>\n    <UnitTestResult executionId=\"ec34f6ce-6a37-409f-acb8-e0612f3a2e8c\" testId=\"dfbab7a8-4d30-e4af-b7e9-5f143fa0d63c\" testName=\"GenericTest&lt;String&gt;(&quot;string&quot;)\" computerName=\"PC0245\" duration=\"00:00:00.0000790\" startTime=\"2024-12-18T09:07:08.0222850+01:00\" endTime=\"2024-12-18T09:07:08.0223635+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"Passed\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"ec34f6ce-6a37-409f-acb8-e0612f3a2e8c\">\n      <Output>\n        <StdOut>string</StdOut>\n      </Output>\n    </UnitTestResult>\n    <UnitTestResult executionId=\"825207e6-be1f-43c6-8344-52a8d2c0c0e4\" testId=\"e856dddd-b0b9-1283-7d12-995daa1c2159\" testName=\"VirtualMethodInBaseClass\" computerName=\"PC0245\" duration=\"00:00:00.0001050\" startTime=\"2024-12-18T09:07:08.0195757+01:00\" endTime=\"2024-12-18T09:07:08.0196808+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"Passed\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"825207e6-be1f-43c6-8344-52a8d2c0c0e4\" />\n    <UnitTestResult executionId=\"db3f6b01-0d00-4646-b059-b1dc94d7b5c1\" testId=\"04f8f26c-73f6-0a50-702c-3424ece7fca7\" testName=\"GenericTest&lt;Int32&gt;(42)\" computerName=\"PC0245\" duration=\"00:00:00.0002980\" startTime=\"2024-12-18T09:07:08.0219758+01:00\" endTime=\"2024-12-18T09:07:08.0222734+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"Passed\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"db3f6b01-0d00-4646-b059-b1dc94d7b5c1\">\n      <Output>\n        <StdOut>42</StdOut>\n      </Output>\n    </UnitTestResult>\n    <UnitTestResult executionId=\"20849c95-99a1-410e-9302-e0ddb7d84f4d\" testId=\"d19495ce-8556-0afa-0598-f28569986b94\" testName=\"TestMethod1\" computerName=\"PC0245\" duration=\"00:00:00.0015540\" startTime=\"2024-12-18T09:07:08.0226028+01:00\" endTime=\"2024-12-18T09:07:08.0241562+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"Passed\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"20849c95-99a1-410e-9302-e0ddb7d84f4d\" />\n    <UnitTestResult executionId=\"841b18f1-7990-48d7-a9e2-171ac06b79f2\" testId=\"b1d90856-8e97-2f05-b5a1-46236018b4f5\" testName=\"GenericTest&lt;Double&gt;(5E-324.0d)\" computerName=\"PC0245\" duration=\"00:00:00.0000760\" startTime=\"2024-12-18T09:07:08.0223698+01:00\" endTime=\"2024-12-18T09:07:08.0224454+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"Passed\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"841b18f1-7990-48d7-a9e2-171ac06b79f2\">\n      <Output>\n        <StdOut>5E-324</StdOut>\n      </Output>\n    </UnitTestResult>\n    <UnitTestResult executionId=\"b0d0933f-c9c3-4657-ab58-14cca4274b66\" testId=\"7c7642ed-18fb-4d66-c0f5-3e220f7aa426\" testName=\"TestMethodInBaseClass\" computerName=\"PC0245\" duration=\"00:00:00.0070170\" startTime=\"2024-12-18T09:07:08.0114692+01:00\" endTime=\"2024-12-18T09:07:08.0184419+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"Passed\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"b0d0933f-c9c3-4657-ab58-14cca4274b66\" />\n  </Results>\n  <TestDefinitions>\n    <UnitTest name=\"GenericTest&lt;String&gt;(&quot;string&quot;)\" storage=\"d:\\src\\playgroud\\calculator\\calculator.nunit3\\bin\\debug\\net9.0\\calculator.nunit3.dll\" id=\"dfbab7a8-4d30-e4af-b7e9-5f143fa0d63c\">\n      <Execution id=\"ec34f6ce-6a37-409f-acb8-e0612f3a2e8c\" />\n      <TestMethod codeBase=\"D:\\src\\playgroud\\Calculator\\Calculator.NUnit3\\bin\\Debug\\net9.0\\Calculator.NUnit3.dll\" adapterTypeName=\"executor://nunit3testexecutor/\" className=\"Calculator.NUnit3.GenericTests\" name=\"GenericTest&lt;String&gt;(&quot;string&quot;)\" />\n    </UnitTest>\n    <UnitTest name=\"GenericTest&lt;Double&gt;(5E-324.0d)\" storage=\"d:\\src\\playgroud\\calculator\\calculator.nunit3\\bin\\debug\\net9.0\\calculator.nunit3.dll\" id=\"b1d90856-8e97-2f05-b5a1-46236018b4f5\">\n      <Execution id=\"841b18f1-7990-48d7-a9e2-171ac06b79f2\" />\n      <TestMethod codeBase=\"D:\\src\\playgroud\\Calculator\\Calculator.NUnit3\\bin\\Debug\\net9.0\\Calculator.NUnit3.dll\" adapterTypeName=\"executor://nunit3testexecutor/\" className=\"Calculator.NUnit3.GenericTests\" name=\"GenericTest&lt;Double&gt;(5E-324.0d)\" />\n    </UnitTest>\n    <UnitTest name=\"TestMethodInBaseClass\" storage=\"d:\\src\\playgroud\\calculator\\calculator.nunit3\\bin\\debug\\net9.0\\calculator.nunit3.dll\" id=\"7c7642ed-18fb-4d66-c0f5-3e220f7aa426\">\n      <Execution id=\"b0d0933f-c9c3-4657-ab58-14cca4274b66\" />\n      <TestMethod codeBase=\"D:\\src\\playgroud\\Calculator\\Calculator.NUnit3\\bin\\Debug\\net9.0\\Calculator.NUnit3.dll\" adapterTypeName=\"executor://nunit3testexecutor/\" className=\"Calculator.NUnit3.Derived\" name=\"TestMethodInBaseClass\" />\n    </UnitTest>\n    <UnitTest name=\"GenericTest&lt;Int32&gt;(42)\" storage=\"d:\\src\\playgroud\\calculator\\calculator.nunit3\\bin\\debug\\net9.0\\calculator.nunit3.dll\" id=\"04f8f26c-73f6-0a50-702c-3424ece7fca7\">\n      <Execution id=\"db3f6b01-0d00-4646-b059-b1dc94d7b5c1\" />\n      <TestMethod codeBase=\"D:\\src\\playgroud\\Calculator\\Calculator.NUnit3\\bin\\Debug\\net9.0\\Calculator.NUnit3.dll\" adapterTypeName=\"executor://nunit3testexecutor/\" className=\"Calculator.NUnit3.GenericTests\" name=\"GenericTest&lt;Int32&gt;(42)\" />\n    </UnitTest>\n    <UnitTest name=\"TestMethod1\" storage=\"d:\\src\\playgroud\\calculator\\calculator.nunit3\\bin\\debug\\net9.0\\calculator.nunit3.dll\" id=\"d19495ce-8556-0afa-0598-f28569986b94\">\n      <Execution id=\"20849c95-99a1-410e-9302-e0ddb7d84f4d\" />\n      <TestMethod codeBase=\"D:\\src\\playgroud\\Calculator\\Calculator.NUnit3\\bin\\Debug\\net9.0\\Calculator.NUnit3.dll\" adapterTypeName=\"executor://nunit3testexecutor/\" className=\"Calculator.NUnit3.Tests\" name=\"TestMethod1\" />\n    </UnitTest>\n    <UnitTest name=\"VirtualMethodInBaseClass\" storage=\"d:\\src\\playgroud\\calculator\\calculator.nunit3\\bin\\debug\\net9.0\\calculator.nunit3.dll\" id=\"e856dddd-b0b9-1283-7d12-995daa1c2159\">\n      <Execution id=\"825207e6-be1f-43c6-8344-52a8d2c0c0e4\" />\n      <TestMethod codeBase=\"D:\\src\\playgroud\\Calculator\\Calculator.NUnit3\\bin\\Debug\\net9.0\\Calculator.NUnit3.dll\" adapterTypeName=\"executor://nunit3testexecutor/\" className=\"Calculator.NUnit3.Derived\" name=\"VirtualMethodInBaseClass\" />\n    </UnitTest>\n  </TestDefinitions>\n  <TestEntries>\n    <TestEntry testId=\"dfbab7a8-4d30-e4af-b7e9-5f143fa0d63c\" executionId=\"ec34f6ce-6a37-409f-acb8-e0612f3a2e8c\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" />\n    <TestEntry testId=\"e856dddd-b0b9-1283-7d12-995daa1c2159\" executionId=\"825207e6-be1f-43c6-8344-52a8d2c0c0e4\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" />\n    <TestEntry testId=\"04f8f26c-73f6-0a50-702c-3424ece7fca7\" executionId=\"db3f6b01-0d00-4646-b059-b1dc94d7b5c1\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" />\n    <TestEntry testId=\"d19495ce-8556-0afa-0598-f28569986b94\" executionId=\"20849c95-99a1-410e-9302-e0ddb7d84f4d\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" />\n    <TestEntry testId=\"b1d90856-8e97-2f05-b5a1-46236018b4f5\" executionId=\"841b18f1-7990-48d7-a9e2-171ac06b79f2\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" />\n    <TestEntry testId=\"7c7642ed-18fb-4d66-c0f5-3e220f7aa426\" executionId=\"b0d0933f-c9c3-4657-ab58-14cca4274b66\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" />\n  </TestEntries>\n  <TestLists>\n    <TestList name=\"Results Not in a List\" id=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" />\n    <TestList name=\"All Loaded Results\" id=\"19431567-8539-422a-85d7-44ee4e166bda\" />\n  </TestLists>\n  <ResultSummary outcome=\"Completed\">\n    <Counters total=\"6\" executed=\"6\" passed=\"6\" failed=\"0\" error=\"0\" timeout=\"0\" aborted=\"0\" inconclusive=\"0\" passedButRunAborted=\"0\" notRunnable=\"0\" notExecuted=\"0\" disconnected=\"0\" warning=\"0\" completed=\"0\" inProgress=\"0\" pending=\"0\" />\n    <Output>\n      <StdOut>NUnit Adapter 3.17.0.0: Test execution started&#xD;\nRunning all tests in D:\\src\\playgroud\\Calculator\\Calculator.NUnit3\\bin\\Debug\\net9.0\\Calculator.NUnit3.dll&#xD;\n   NUnit3TestExecutor discovered 6 of 6 NUnit test cases&#xD;\n42&#xD;\n&#xD;\nstring&#xD;\n&#xD;\n5E-324&#xD;\n&#xD;\nNUnit Adapter 3.17.0.0: Test execution complete&#xD;\n</StdOut>\n    </Output>\n  </ResultSummary>\n</TestRun>"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/visualstudio_test_results/projects/TestReport/TestReport/Test1.cs",
    "content": "﻿namespace TestReport;\n\n[TestClass]\npublic sealed class Test1\n{\n    public enum Type : byte\n    {\n        Struct = 10,\n        Structure = 10\n    }\n\n    [DataTestMethod]\n    [DataRow(Type.Struct, \"struct\")]\n    [DataRow(Type.Structure, \"struct\")]\n    public void TestMethod1(Type type, string expected)\n    {\n    }\n}"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/visualstudio_test_results/projects/TestReport/TestReport/TestReport.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n    <PropertyGroup>\n        <TargetFramework>net9.0</TargetFramework>\n        <LangVersion>latest</LangVersion>\n        <ImplicitUsings>enable</ImplicitUsings>\n        <Nullable>enable</Nullable>\n    </PropertyGroup>\n\n    <ItemGroup>\n        <PackageReference Include=\"Microsoft.NET.Test.Sdk\" Version=\"17.12.0\" />\n        <PackageReference Include=\"MSTest\" Version=\"3.6.4\" />\n    </ItemGroup>\n\n    <ItemGroup>\n        <Using Include=\"Microsoft.VisualStudio.TestTools.UnitTesting\"/>\n    </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/visualstudio_test_results/projects/TestReport/TestReport/packages.lock.json",
    "content": "{\n  \"version\": 1,\n  \"dependencies\": {\n    \"net9.0\": {\n      \"Microsoft.NET.Test.Sdk\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[17.12.0, )\",\n        \"resolved\": \"17.12.0\",\n        \"contentHash\": \"kt/PKBZ91rFCWxVIJZSgVLk+YR+4KxTuHf799ho8WNiK5ZQpJNAEZCAWX86vcKrs+DiYjiibpYKdGZP6+/N17w==\",\n        \"dependencies\": {\n          \"Microsoft.CodeCoverage\": \"17.12.0\",\n          \"Microsoft.TestPlatform.TestHost\": \"17.12.0\"\n        }\n      },\n      \"MSTest\": {\n        \"type\": \"Direct\",\n        \"requested\": \"[3.6.4, )\",\n        \"resolved\": \"3.6.4\",\n        \"contentHash\": \"PDBqb7FT15DBD/LQtAr2Eq/UY9YVTgsY7CD7ZiDnamc/RI+/2VSak6qotTV+x2oyhcRJxE4USRgyqXIRlyU3kw==\",\n        \"dependencies\": {\n          \"MSTest.Analyzers\": \"[3.6.4]\",\n          \"MSTest.TestAdapter\": \"[3.6.4]\",\n          \"MSTest.TestFramework\": \"[3.6.4]\",\n          \"Microsoft.NET.Test.Sdk\": \"17.11.1\"\n        }\n      },\n      \"Microsoft.ApplicationInsights\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"2.22.0\",\n        \"contentHash\": \"3AOM9bZtku7RQwHyMEY3tQMrHIgjcfRDa6YQpd/QG2LDGvMydSlL9Di+8LLMt7J2RDdfJ7/2jdYv6yHcMJAnNw==\",\n        \"dependencies\": {\n          \"System.Diagnostics.DiagnosticSource\": \"5.0.0\"\n        }\n      },\n      \"Microsoft.CodeCoverage\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"17.12.0\",\n        \"contentHash\": \"4svMznBd5JM21JIG2xZKGNanAHNXplxf/kQDFfLHXQ3OnpJkayRK/TjacFjA+EYmoyuNXHo/sOETEfcYtAzIrA==\"\n      },\n      \"Microsoft.Testing.Extensions.Telemetry\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.4.3\",\n        \"contentHash\": \"dh8jnqWikxQXJ4kWy8B82PtSAlQCnvDKh1128arDmSW5OU5xWA84HwruV3TanXi3ZjIHn1wWFCgtMOhcDNwBow==\",\n        \"dependencies\": {\n          \"Microsoft.ApplicationInsights\": \"2.22.0\",\n          \"Microsoft.Testing.Platform\": \"1.4.3\"\n        }\n      },\n      \"Microsoft.Testing.Extensions.TrxReport.Abstractions\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.4.3\",\n        \"contentHash\": \"16sWznD6ZMok/zgW+vrO6zerCFMD9N+ey9bi1iV/e9xxsQb4V4y/aW6cY/Y7E9jA7pc+aZ6ffZby43yxQOoYZA==\",\n        \"dependencies\": {\n          \"Microsoft.Testing.Platform\": \"1.4.3\"\n        }\n      },\n      \"Microsoft.Testing.Extensions.VSTestBridge\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.4.3\",\n        \"contentHash\": \"xZ6oyNYh2aM5Wb+HJAy1fj2C4CNRVhINXHCjlWs/2C8hEIpdqVSpP3y6HWUN40KpFqyGD4myHGR1Rflm28UpcQ==\",\n        \"dependencies\": {\n          \"Microsoft.ApplicationInsights\": \"2.22.0\",\n          \"Microsoft.TestPlatform.ObjectModel\": \"17.11.1\",\n          \"Microsoft.Testing.Extensions.Telemetry\": \"1.4.3\",\n          \"Microsoft.Testing.Extensions.TrxReport.Abstractions\": \"1.4.3\",\n          \"Microsoft.Testing.Platform\": \"1.4.3\"\n        }\n      },\n      \"Microsoft.Testing.Platform\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.4.3\",\n        \"contentHash\": \"NedIbwl1T7+ZMeg7gwk0Db8/RFLf0siyVpeTcRMMOle6Xl/ujaYOM4Aduo8rEfVqNj3kcQ7blegpyT3dHi+0PA==\"\n      },\n      \"Microsoft.Testing.Platform.MSBuild\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.4.3\",\n        \"contentHash\": \"1gGqgHtiZ6tZn/6Tby+qlKpNe5Ye/5LnxlSsyl4XMZ4m4V+Cu1K1m+gD1zxoxHIvLjgX8mCnQRK95MGBBFuumw==\",\n        \"dependencies\": {\n          \"Microsoft.Testing.Platform\": \"1.4.3\"\n        }\n      },\n      \"Microsoft.TestPlatform.ObjectModel\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"17.12.0\",\n        \"contentHash\": \"TDqkTKLfQuAaPcEb3pDDWnh7b3SyZF+/W9OZvWFp6eJCIiiYFdSB6taE2I6tWrFw5ywhzOb6sreoGJTI6m3rSQ==\",\n        \"dependencies\": {\n          \"System.Reflection.Metadata\": \"1.6.0\"\n        }\n      },\n      \"Microsoft.TestPlatform.TestHost\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"17.12.0\",\n        \"contentHash\": \"MiPEJQNyADfwZ4pJNpQex+t9/jOClBGMiCiVVFuELCMSX2nmNfvUor3uFVxNNCg30uxDP8JDYfPnMXQzsfzYyg==\",\n        \"dependencies\": {\n          \"Microsoft.TestPlatform.ObjectModel\": \"17.12.0\",\n          \"Newtonsoft.Json\": \"13.0.1\"\n        }\n      },\n      \"MSTest.Analyzers\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"3.6.4\",\n        \"contentHash\": \"4gU/VdItLebmE2+UkOaqffVmVa/in0VeIF9fmN/fG0tj5AHAasjasJcZa9U2uXBNX03cKCWlgWenlhKLz343NQ==\"\n      },\n      \"MSTest.TestAdapter\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"3.6.4\",\n        \"contentHash\": \"YdwseRA+nDhRqD2oPHjCE4KzLEN5B10A61lOslE3N3OvUwHJ6ezyZZjYWf7mrZ8jckCcx/UlBclTzgWUpMpPQw==\",\n        \"dependencies\": {\n          \"Microsoft.Testing.Extensions.VSTestBridge\": \"1.4.3\",\n          \"Microsoft.Testing.Platform.MSBuild\": \"1.4.3\"\n        }\n      },\n      \"MSTest.TestFramework\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"3.6.4\",\n        \"contentHash\": \"3nV+2CJluKmiJpCSqQfXu5idCq35+vqFywjScyauTIz0Zk7KJw7Qpzv8gtwow0To7pxIlIvwkq9rbMB+V6eOow==\"\n      },\n      \"Newtonsoft.Json\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"13.0.1\",\n        \"contentHash\": \"ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==\"\n      },\n      \"System.Diagnostics.DiagnosticSource\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"5.0.0\",\n        \"contentHash\": \"tCQTzPsGZh/A9LhhA6zrqCRV4hOHsK90/G7q3Khxmn6tnB1PuNU0cRaKANP2AWcF9bn0zsuOoZOSrHuJk6oNBA==\"\n      },\n      \"System.Reflection.Metadata\": {\n        \"type\": \"Transitive\",\n        \"resolved\": \"1.6.0\",\n        \"contentHash\": \"COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==\"\n      }\n    }\n  }\n}"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/visualstudio_test_results/projects/TestReport/TestReport.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 12.00\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"TestReport\", \"TestReport\\TestReport.csproj\", \"{686C4A1D-76AB-4AF9-86E9-BAF5CC22A1F8}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Any CPU = Debug|Any CPU\n\t\tRelease|Any CPU = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{686C4A1D-76AB-4AF9-86E9-BAF5CC22A1F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{686C4A1D-76AB-4AF9-86E9-BAF5CC22A1F8}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{686C4A1D-76AB-4AF9-86E9-BAF5CC22A1F8}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{686C4A1D-76AB-4AF9-86E9-BAF5CC22A1F8}.Release|Any CPU.Build.0 = Release|Any CPU\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/visualstudio_test_results/readme.md",
    "content": "# Generating VS Test Results\n\n## Valid.trx\n\nThese results are generated from [this project](https://github.com/alex-meseldzija-sonarsource/Playground/tree/main/Playground.Test) by running the `dotnet test --logger:trx` command\n\nThis will generate a valid .trx file in Playground/Playground.Test/TestResults.\n\nThese results do not cover the full possibilities of results possible from .trx files.\nThere is no documentation on how the outcome value is determined so many are added manually.\n\nUnder the `<Results>` tag these tests are added to hit all possible outcomes\n\n```xml\n    <UnitTestResult executionId=\"b93d94d0-7d71-492e-9d2e-acfb902c888d\" testId=\"2386b338-1542-4ec7-a8b2-cdfbaa53ba67\" testName=\"TestMethod5 (1,2)\" computerName=\"PC-L0109\" duration=\"00:00:00.0001001\" startTime=\"2024-11-25T15:38:27.3972727+01:00\" endTime=\"2024-11-25T15:38:27.4000768+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"Warning\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n    <UnitTestResult executionId=\"8cf735d6-85fb-4f31-8258-7ff19fc56bbe\" testId=\"35fa7c77-814c-4fae-913d-282d27c9d317\" testName=\"TestMethod5 (2,1)\" computerName=\"PC-L0109\" duration=\"00:00:00.0001001\" startTime=\"2024-11-25T15:38:27.3972727+01:00\" endTime=\"2024-11-25T15:38:27.4000768+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"Error\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n    <UnitTestResult executionId=\"7cd0835a-a270-49be-bf79-ecae420940e8\" testId=\"ebb027a0-c08c-4edb-b618-97dc337b39fe\" testName=\"TestMethod5 (2,2)\" computerName=\"PC-L0109\" duration=\"00:00:00.0001001\" startTime=\"2024-11-25T15:38:27.3972727+01:00\" endTime=\"2024-11-25T15:38:27.4000768+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"PassedButRunAborted\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n    <UnitTestResult executionId=\"5ecd7703-31f9-49f3-97bc-fccd97bb97c4\" testId=\"358b3d3f-0c53-478e-9943-28ad836e4539\" testName=\"TestMethod5 (1,3)\" computerName=\"PC-L0109\" duration=\"00:00:00.0001001\" startTime=\"2024-11-25T15:38:27.3972727+01:00\" endTime=\"2024-11-25T15:38:27.4000768+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"NotExecuted\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n    <UnitTestResult executionId=\"ef149fac-e774-44e2-ae72-ac52efa688be\" testId=\"98d81cac-eddf-41ef-98b6-a008cc35182b\" testName=\"TestMethod5 (3,1)\" computerName=\"PC-L0109\" duration=\"00:00:00.0001001\" startTime=\"2024-11-25T15:38:27.3972727+01:00\" endTime=\"2024-11-25T15:38:27.4000768+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"Inconclusive\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n    <UnitTestResult executionId=\"bbd331db-a908-4b7b-b4ed-d0bff07ab6b3\" testId=\"0628e8f4-6604-423d-a520-a7011d0637eb\" testName=\"TestMethod5 (2,3)\" computerName=\"PC-L0109\" duration=\"00:00:00.0001001\" startTime=\"2024-11-25T15:38:27.3972727+01:00\" endTime=\"2024-11-25T15:38:27.4000768+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"Completed\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n    <UnitTestResult executionId=\"5c71e89b-7d7c-46f8-851e-a9a152398281\" testId=\"ddfa5c76-cbe1-4372-8a85-a236697ddf5b\" testName=\"TestMethod5 (3,2)\" computerName=\"PC-L0109\" duration=\"00:00:00.0001001\" startTime=\"2024-11-25T15:38:27.3972727+01:00\" endTime=\"2024-11-25T15:38:27.4000768+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"Timeout\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n    <UnitTestResult executionId=\"61a90e58-33a5-48c7-9d1f-ecfcf82a5625\" testId=\"0683bb92-89c8-4e66-a1f8-522e2199ef53\" testName=\"TestMethod5 (3,3)\" computerName=\"PC-L0109\" duration=\"00:00:00.0001001\" startTime=\"2024-11-25T15:38:27.3972727+01:00\" endTime=\"2024-11-25T15:38:27.4000768+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"Aborted\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n    <UnitTestResult executionId=\"ba64eb5c-6ab2-4fc0-83f5-f29d0bea1ab1\" testId=\"5553b0bd-1390-49c8-bfff-70b4c94a4321\" testName=\"TestMethod5 (4,1)\" computerName=\"PC-L0109\" duration=\"00:00:00.0001001\" startTime=\"2024-11-25T15:38:27.3972727+01:00\" endTime=\"2024-11-25T15:38:27.4000768+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"Blocked\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n    <UnitTestResult executionId=\"abe9481a-f298-4416-ae61-4c893c7c801d\" testId=\"5733759c-ad55-9784-8372-5dfbf9179fbc\" testName=\"TestMethod5 (1,4)\" computerName=\"PC-L0109\" duration=\"00:00:00.0001001\" startTime=\"2024-11-25T15:38:27.3972727+01:00\" endTime=\"2024-11-25T15:38:27.4000768+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"NotRunnable\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n```\n\nThen Under the `<TestDefinitions>` tag these are added. Please note that the `<UnitTest id>`value matches exactly to a `<UnitTestResult testId>` value.\n\n```xml\n    <UnitTest name=\"TestMethod5 (1,2)\" storage=\"c:\\dev\\playground\\playground.test\\bin\\debug\\net9.0\\playground.test.dll\" id=\"2386b338-1542-4ec7-a8b2-cdfbaa53ba67\">\n      <Execution id=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n      <TestMethod codeBase=\"C:\\dev\\Playground\\Playground.Test\\bin\\Debug\\net9.0\\Playground.Test.dll\" adapterTypeName=\"executor://mstestadapter/v2\" className=\"TestProject1.UnitTest2\" name=\"TestMethod5\" />\n    </UnitTest>\n    <UnitTest name=\"TestMethod5 (2,1)\" storage=\"c:\\dev\\playground\\playground.test\\bin\\debug\\net9.0\\playground.test.dll\" id=\"35fa7c77-814c-4fae-913d-282d27c9d317\">\n      <Execution id=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n      <TestMethod codeBase=\"C:\\dev\\Playground\\Playground.Test\\bin\\Debug\\net9.0\\Playground.Test.dll\" adapterTypeName=\"executor://mstestadapter/v2\" className=\"TestProject1.UnitTest2\" name=\"TestMethod5\" />\n    </UnitTest>\n    <UnitTest name=\"TestMethod5 (2,2)\" storage=\"c:\\dev\\playground\\playground.test\\bin\\debug\\net9.0\\playground.test.dll\" id=\"ebb027a0-c08c-4edb-b618-97dc337b39fe\">\n      <Execution id=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n      <TestMethod codeBase=\"C:\\dev\\Playground\\Playground.Test\\bin\\Debug\\net9.0\\Playground.Test.dll\" adapterTypeName=\"executor://mstestadapter/v2\" className=\"TestProject1.UnitTest2\" name=\"TestMethod5\" />\n    </UnitTest>\n    <UnitTest name=\"TestMethod5 (1,3)\" storage=\"c:\\dev\\playground\\playground.test\\bin\\debug\\net9.0\\playground.test.dll\" id=\"358b3d3f-0c53-478e-9943-28ad836e4539\">\n      <Execution id=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n      <TestMethod codeBase=\"C:\\dev\\Playground\\Playground.Test\\bin\\Debug\\net9.0\\Playground.Test.dll\" adapterTypeName=\"executor://mstestadapter/v2\" className=\"TestProject1.UnitTest2\" name=\"TestMethod5\" />\n    </UnitTest>\n    <UnitTest name=\"TestMethod5 (3,1)\" storage=\"c:\\dev\\playground\\playground.test\\bin\\debug\\net9.0\\playground.test.dll\" id=\"98d81cac-eddf-41ef-98b6-a008cc35182b\">\n      <Execution id=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n      <TestMethod codeBase=\"C:\\dev\\Playground\\Playground.Test\\bin\\Debug\\net9.0\\Playground.Test.dll\" adapterTypeName=\"executor://mstestadapter/v2\" className=\"TestProject1.UnitTest2\" name=\"TestMethod5\" />\n    </UnitTest>\n    <UnitTest name=\"TestMethod5 (2,3)\" storage=\"c:\\dev\\playground\\playground.test\\bin\\debug\\net9.0\\playground.test.dll\" id=\"ddfa5c76-cbe1-4372-8a85-a236697ddf5b\">\n      <Execution id=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n      <TestMethod codeBase=\"C:\\dev\\Playground\\Playground.Test\\bin\\Debug\\net9.0\\Playground.Test.dll\" adapterTypeName=\"executor://mstestadapter/v2\" className=\"TestProject1.UnitTest2\" name=\"TestMethod5\" />\n    </UnitTest>\n    <UnitTest name=\"TestMethod5 (3,2)\" storage=\"c:\\dev\\playground\\playground.test\\bin\\debug\\net9.0\\playground.test.dll\" id=\"0683bb92-89c8-4e66-a1f8-522e2199ef53\">\n      <Execution id=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n      <TestMethod codeBase=\"C:\\dev\\Playground\\Playground.Test\\bin\\Debug\\net9.0\\Playground.Test.dll\" adapterTypeName=\"executor://mstestadapter/v2\" className=\"TestProject1.UnitTest2\" name=\"TestMethod5\" />\n    </UnitTest>\n    <UnitTest name=\"TestMethod5 (3,3)\" storage=\"c:\\dev\\playground\\playground.test\\bin\\debug\\net9.0\\playground.test.dll\" id=\"5553b0bd-1390-49c8-bfff-70b4c94a4321\">\n      <Execution id=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n      <TestMethod codeBase=\"C:\\dev\\Playground\\Playground.Test\\bin\\Debug\\net9.0\\Playground.Test.dll\" adapterTypeName=\"executor://mstestadapter/v2\" className=\"TestProject1.UnitTest2\" name=\"TestMethod5\" />\n    </UnitTest>\n    <UnitTest name=\"TestMethod5 (4,1)\" storage=\"c:\\dev\\playground\\playground.test\\bin\\debug\\net9.0\\playground.test.dll\" id=\"5733759c-ad55-9784-8372-5dfbf9179fbc\">\n      <Execution id=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n      <TestMethod codeBase=\"C:\\dev\\Playground\\Playground.Test\\bin\\Debug\\net9.0\\Playground.Test.dll\" adapterTypeName=\"executor://mstestadapter/v2\" className=\"TestProject1.UnitTest2\" name=\"TestMethod5\" />\n    </UnitTest>\n    <UnitTest name=\"TestMethod5 (1,4)\" storage=\"c:\\dev\\playground\\playground.test\\bin\\debug\\net9.0\\playground.test.dll\" id=\"9c66db0f-1976-ce08-cc4c-71201b65b30a\">\n      <Execution id=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n      <TestMethod codeBase=\"C:\\dev\\Playground\\Playground.Test\\bin\\Debug\\net9.0\\Playground.Test.dll\" adapterTypeName=\"executor://mstestadapter/v2\" className=\"TestProject1.UnitTest2\" name=\"TestMethod5\" />\n    </UnitTest>\n```\n\n## invalid_character.trx\n\nThis is a valid .trx file that has been modified to be an invalid .trx and invalid .xml.\nThere can be only 1 UnitTestResult tag and no Test Definition tags, otherwise the XMLParserHelper will not throw an exception.\n\n```xml\n    <UnitTestResult executionId=\"eff25556-c0df-4a48-b88d-2286e542af4f\" testId=\"d7744238-9adf-b364-3d70-ae38261a8cd8\" testName=\"TestShouldFail\" computerName=\"PC-L0109\" duration=\"00:00:00.0183996\" startTime=\"2024-11-25T15:38:27.3755778+01:00\" endTime=\"2024-11-25T15:38:27.3951390+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"Failed\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"eff25556-c0df-4a48-b88d-2286e542af4f\">\n    <Output>\n      <StdOut><</StdOut>\n    </Output>\n    </UnitTestResult>\n```\n\n## invalid_dates.trx\n\nThis is a valid .trx file that has been modified to have an invalid datetime format.\n\n```xml\n<UnitTestResult startTime=\"2016-xx-14T17:04:31.1+01:00\" endTime=\"2016-xx-14T17:04:31.9162137+01:00\" />\n```\n\n## invalid_test_outcome.trx\n\nThis is a valid .trx file that has been modified to have an outcome that doesn't exist.\n\n```xml\n<UnitTestResult outcome=\"ThisDoesntMatch\"/>\n```\n\n## test_name_not mapped.trx\n\nThis is a valid .trx file consisting of a single unit test extracted from valid.trx that is then not mapped correctly in the Hashmap provided to the VisualStudioTestResultParser.\n\n## test_result_no_test_method.trx\n\nThis is a valid .trx file consisting of a a single unit test extracted from valid.trx that has had the methodName tag removed from the UnitTestResult tag.\n\n## multiple_runs_same_test.trx\n\nGenerated by analyzing the [TestReport project](projects/TestReport) with the `dotnet test --logger:trx` command."
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/visualstudio_test_results/test_name_not_mapped.trx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<TestRun id=\"32dc72b7-35f4-4972-bcfb-972b70eb45bc\" name=\"alexander.meseldzija@PC-L0109 2024-11-25 15:38:27\" runUser=\"PC-L0109\\alexander.meseldzija\" xmlns=\"http://microsoft.com/schemas/VisualStudio/TeamTest/2010\">\n  <Results>\n    <UnitTestResult executionId=\"eff25556-c0df-4a48-b88d-2286e542af4f\" testId=\"d7744238-9adf-b364-3d70-ae38261a8cd8\" testName=\"TestDoesNotExist\" computerName=\"PC-L0109\" duration=\"00:00:00.0183996\" startTime=\"2024-11-25T15:38:27.3755778+01:00\" endTime=\"2024-11-25T15:38:27.3951390+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"Failed\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"eff25556-c0df-4a48-b88d-2286e542af4f\"/>\n  </Results>\n  <TestDefinitions>\n    <UnitTest name=\"TestDoesNotExist\" storage=\"c:\\dev\\playground\\playground.test\\bin\\debug\\net9.0\\playground.test.dll\" id=\"d7744238-9adf-b364-3d70-ae38261a8cd8\">\n      <Execution id=\"eff25556-c0df-4a48-b88d-2286e542af4f\" />\n      <TestMethod codeBase=\"C:\\dev\\Playground\\Playground.Test\\bin\\Debug\\net9.0\\Playground.Test.dll\" adapterTypeName=\"executor://mstestadapter/v2\" className=\"TestProject1.UnitTest1\" name=\"TestShouldFail\" />\n    </UnitTest>\n  </TestDefinitions>\n  <TestEntries>\n    <TestEntry testId=\"d7744238-9adf-b364-3d70-ae38261a8cd8\" executionId=\"eff25556-c0df-4a48-b88d-2286e542af4f\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" />\n  </TestEntries>\n  <TestLists>\n    <TestList name=\"Results Not in a List\" id=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" />\n    <TestList name=\"All Loaded Results\" id=\"19431567-8539-422a-85d7-44ee4e166bda\" />\n  </TestLists>\n  <ResultSummary outcome=\"Failed\">\n    <Counters total=\"1\" executed=\"1\" passed=\"0\" failed=\"1\" error=\"0\" timeout=\"0\" aborted=\"0\" inconclusive=\"0\" passedButRunAborted=\"0\" notRunnable=\"0\" notExecuted=\"0\" disconnected=\"0\" warning=\"0\" completed=\"0\" inProgress=\"0\" pending=\"0\" />\n  </ResultSummary>\n</TestRun>"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/visualstudio_test_results/test_result_no_test_method.trx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<TestRun id=\"32dc72b7-35f4-4972-bcfb-972b70eb45bc\" name=\"alexander.meseldzija@PC-L0109 2024-11-25 15:38:27\" runUser=\"PC-L0109\\alexander.meseldzija\" xmlns=\"http://microsoft.com/schemas/VisualStudio/TeamTest/2010\">\n  <Results>\n    <UnitTestResult executionId=\"eff25556-c0df-4a48-b88d-2286e542af4f\" testId=\"d7744238-9adf-b364-3d70-ae38261a8cd8\" testName=\"NoTestMethod\" computerName=\"PC-L0109\" duration=\"00:00:00.0183996\" startTime=\"2024-11-25T15:38:27.3755778+01:00\" endTime=\"2024-11-25T15:38:27.3951390+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"Passed\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"eff25556-c0df-4a48-b88d-2286e542af4f\"/>\n  </Results>\n  <TestDefinitions>\n    <UnitTest name=\"NoTestMethod\" storage=\"c:\\dev\\playground\\playground.test\\bin\\debug\\net9.0\\playground.test.dll\" id=\"d7744238-9adf-b364-3d70-ae38261a8cd8\">\n      <Execution id=\"eff25556-c0df-4a48-b88d-2286e542af4f\" />\n    </UnitTest>\n  </TestDefinitions>\n  <TestLists>\n    <TestList name=\"Results Not in a List\" id=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" />\n    <TestList name=\"All Loaded Results\" id=\"19431567-8539-422a-85d7-44ee4e166bda\" />\n  </TestLists>\n  <ResultSummary outcome=\"Passed\">\n    <Counters total=\"1\" executed=\"1\" passed=\"1\" failed=\"0\" error=\"0\" timeout=\"0\" aborted=\"0\" inconclusive=\"0\" passedButRunAborted=\"0\" notRunnable=\"0\" notExecuted=\"0\" disconnected=\"0\" warning=\"0\" completed=\"0\" inProgress=\"0\" pending=\"0\" />\n  </ResultSummary>\n</TestRun>"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/visualstudio_test_results/valid.trx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<TestRun id=\"32dc72b7-35f4-4972-bcfb-972b70eb45bc\" name=\"alexander.meseldzija@PC-L0109 2024-11-25 15:38:27\" runUser=\"PC-L0109\\alexander.meseldzija\" xmlns=\"http://microsoft.com/schemas/VisualStudio/TeamTest/2010\">\n  <Times creation=\"2024-11-25T15:38:27.5859867+01:00\" queuing=\"2024-11-25T15:38:27.5859872+01:00\" start=\"2024-11-25T15:38:26.7286526+01:00\" finish=\"2024-11-25T15:38:27.6045199+01:00\" />\n  <TestSettings name=\"default\" id=\"5291548f-8adc-4573-93b0-5bcf78054c8b\">\n    <Deployment runDeploymentRoot=\"alexander.meseldzija_PC-L0109_2024-11-25_15_38_27\" />\n  </TestSettings>\n  <Results>\n    <UnitTestResult executionId=\"eff25556-c0df-4a48-b88d-2286e542af4f\" testId=\"d7744238-9adf-b364-3d70-ae38261a8cd8\" testName=\"TestShouldFail\" computerName=\"PC-L0109\" duration=\"00:00:00.0183996\" startTime=\"2024-11-25T15:38:27.3755778+01:00\" endTime=\"2024-11-25T15:38:27.3951390+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"Failed\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"eff25556-c0df-4a48-b88d-2286e542af4f\">\n      <Output>\n        <ErrorInfo>\n          <Message>Assert.IsTrue failed. </Message>\n          <StackTrace>   at TestProject1.UnitTest1.TestShouldFail() in C:\\dev\\Playground\\Playground.Test\\UnitTest1.cs:line 18&#xD;\n   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)&#xD;\n   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)&#xD;\n</StackTrace>\n        </ErrorInfo>\n      </Output>\n    </UnitTestResult>\n    <UnitTestResult executionId=\"c5323fd6-c065-4917-b646-a4e7f6073f6c\" testId=\"8099befc-4d3c-2f96-8986-47ced62d8a09\" testName=\"TestMethod1 (True)\" computerName=\"PC-L0109\" duration=\"00:00:00.0017276\" startTime=\"2024-11-25T15:38:27.3554881+01:00\" endTime=\"2024-11-25T15:38:27.3703725+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"Passed\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"c5323fd6-c065-4917-b646-a4e7f6073f6c\" />\n    <UnitTestResult executionId=\"4a54ce7d-7ef5-4471-b092-c80815ecf8db\" testId=\"336f6912-993b-bafa-0b01-72bc265df384\" testName=\"TestShouldError\" computerName=\"PC-L0109\" duration=\"00:00:00.0013372\" startTime=\"2024-11-25T15:38:27.3956241+01:00\" endTime=\"2024-11-25T15:38:27.3972174+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"Failed\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"4a54ce7d-7ef5-4471-b092-c80815ecf8db\">\n      <Output>\n        <ErrorInfo>\n          <Message>Test method TestProject1.UnitTest1.TestShouldError threw exception: &#xD;\nSystem.Exception: This is an error</Message>\n          <StackTrace>    at TestProject1.UnitTest1.TestShouldError() in C:\\dev\\Playground\\Playground.Test\\UnitTest1.cs:line 31&#xD;\n   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)&#xD;\n   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)&#xD;\n</StackTrace>\n        </ErrorInfo>\n      </Output>\n    </UnitTestResult>\n    <UnitTestResult executionId=\"4c3e5933-5e82-4937-8098-d237cebc9405\" testId=\"2184a87e-c02e-442c-8320-09fecdc30623\" testName=\"TestMethod5 (1,1)\" computerName=\"PC-L0109\" duration=\"00:00:00.0001001\" startTime=\"2024-11-25T15:38:27.3972727+01:00\" endTime=\"2024-11-25T15:38:27.4000768+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"Passed\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n    <UnitTestResult executionId=\"b93d94d0-7d71-492e-9d2e-acfb902c888d\" testId=\"2386b338-1542-4ec7-a8b2-cdfbaa53ba67\" testName=\"TestMethod5 (1,2)\" computerName=\"PC-L0109\" duration=\"00:00:00.0001001\" startTime=\"2024-11-25T15:38:27.3972727+01:00\" endTime=\"2024-11-25T15:38:27.4000768+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"Warning\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n    <UnitTestResult executionId=\"8cf735d6-85fb-4f31-8258-7ff19fc56bbe\" testId=\"35fa7c77-814c-4fae-913d-282d27c9d317\" testName=\"TestMethod5 (2,1)\" computerName=\"PC-L0109\" duration=\"00:00:00.0001001\" startTime=\"2024-11-25T15:38:27.3972727+01:00\" endTime=\"2024-11-25T15:38:27.4000768+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"Error\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n    <UnitTestResult executionId=\"7cd0835a-a270-49be-bf79-ecae420940e8\" testId=\"ebb027a0-c08c-4edb-b618-97dc337b39fe\" testName=\"TestMethod5 (2,2)\" computerName=\"PC-L0109\" duration=\"00:00:00.0001001\" startTime=\"2024-11-25T15:38:27.3972727+01:00\" endTime=\"2024-11-25T15:38:27.4000768+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"PassedButRunAborted\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n    <UnitTestResult executionId=\"5ecd7703-31f9-49f3-97bc-fccd97bb97c4\" testId=\"358b3d3f-0c53-478e-9943-28ad836e4539\" testName=\"TestMethod5 (1,3)\" computerName=\"PC-L0109\" duration=\"00:00:00.0001001\" startTime=\"2024-11-25T15:38:27.3972727+01:00\" endTime=\"2024-11-25T15:38:27.4000768+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"NotExecuted\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n    <UnitTestResult executionId=\"ef149fac-e774-44e2-ae72-ac52efa688be\" testId=\"98d81cac-eddf-41ef-98b6-a008cc35182b\" testName=\"TestMethod5 (3,1)\" computerName=\"PC-L0109\" duration=\"00:00:00.0001001\" startTime=\"2024-11-25T15:38:27.3972727+01:00\" endTime=\"2024-11-25T15:38:27.4000768+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"Inconclusive\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n    <UnitTestResult executionId=\"bbd331db-a908-4b7b-b4ed-d0bff07ab6b3\" testId=\"0628e8f4-6604-423d-a520-a7011d0637eb\" testName=\"TestMethod5 (2,3)\" computerName=\"PC-L0109\" duration=\"00:00:00.0001001\" startTime=\"2024-11-25T15:38:27.3972727+01:00\" endTime=\"2024-11-25T15:38:27.4000768+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"Completed\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n    <UnitTestResult executionId=\"5c71e89b-7d7c-46f8-851e-a9a152398281\" testId=\"ddfa5c76-cbe1-4372-8a85-a236697ddf5b\" testName=\"TestMethod5 (3,2)\" computerName=\"PC-L0109\" duration=\"00:00:00.0001001\" startTime=\"2024-11-25T15:38:27.3972727+01:00\" endTime=\"2024-11-25T15:38:27.4000768+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"Timeout\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n    <UnitTestResult executionId=\"61a90e58-33a5-48c7-9d1f-ecfcf82a5625\" testId=\"0683bb92-89c8-4e66-a1f8-522e2199ef53\" testName=\"TestMethod5 (3,3)\" computerName=\"PC-L0109\" duration=\"00:00:00.0001001\" startTime=\"2024-11-25T15:38:27.3972727+01:00\" endTime=\"2024-11-25T15:38:27.4000768+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"Aborted\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n    <UnitTestResult executionId=\"ba64eb5c-6ab2-4fc0-83f5-f29d0bea1ab1\" testId=\"5553b0bd-1390-49c8-bfff-70b4c94a4321\" testName=\"TestMethod5 (4,1)\" computerName=\"PC-L0109\" duration=\"00:00:00.0001001\" startTime=\"2024-11-25T15:38:27.3972727+01:00\" endTime=\"2024-11-25T15:38:27.4000768+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"Blocked\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n    <UnitTestResult executionId=\"abe9481a-f298-4416-ae61-4c893c7c801d\" testId=\"5733759c-ad55-9784-8372-5dfbf9179fbc\" testName=\"TestMethod5 (1,4)\" computerName=\"PC-L0109\" duration=\"00:00:00.0001001\" startTime=\"2024-11-25T15:38:27.3972727+01:00\" endTime=\"2024-11-25T15:38:27.4000768+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"NotRunnable\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n    <UnitTestResult executionId=\"7e223b20-72cb-4952-9e29-e176ffd50293\" testId=\"9c66db0f-1976-ce08-cc4c-71201b65b30a\" testName=\"TestMethod1 (False)\" computerName=\"PC-L0109\" duration=\"00:00:00.0002625\" startTime=\"2024-11-25T15:38:27.3747344+01:00\" endTime=\"2024-11-25T15:38:27.3753361+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"Passed\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"7e223b20-72cb-4952-9e29-e176ffd50293\" />\n    <UnitTestResult executionId=\"449ad3c5-0ff2-42ac-b9dc-0d31b4ea9d7d\" testId=\"c7dc64cd-0233-3937-7ce3-ae46f9eabe5c\" testName=\"TestShouldSkip\" computerName=\"PC-L0109\" startTime=\"2024-11-25T15:38:27.3952632+01:00\" endTime=\"2024-11-25T15:38:27.3955760+01:00\" testType=\"13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b\" outcome=\"NotExecuted\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" relativeResultsDirectory=\"449ad3c5-0ff2-42ac-b9dc-0d31b4ea9d7d\">\n      <Output></Output>\n    </UnitTestResult>\n  </Results>\n  <TestDefinitions>\n    <UnitTest name=\"TestShouldSkip\" storage=\"c:\\dev\\playground\\playground.test\\bin\\debug\\net9.0\\playground.test.dll\" id=\"c7dc64cd-0233-3937-7ce3-ae46f9eabe5c\">\n      <Execution id=\"449ad3c5-0ff2-42ac-b9dc-0d31b4ea9d7d\" />\n      <TestMethod codeBase=\"C:\\dev\\Playground\\Playground.Test\\bin\\Debug\\net9.0\\Playground.Test.dll\" adapterTypeName=\"executor://mstestadapter/v2\" className=\"TestProject1.UnitTest1\" name=\"TestShouldSkip\" />\n    </UnitTest>\n    <UnitTest name=\"TestShouldFail\" storage=\"c:\\dev\\playground\\playground.test\\bin\\debug\\net9.0\\playground.test.dll\" id=\"d7744238-9adf-b364-3d70-ae38261a8cd8\">\n      <Execution id=\"eff25556-c0df-4a48-b88d-2286e542af4f\" />\n      <TestMethod codeBase=\"C:\\dev\\Playground\\Playground.Test\\bin\\Debug\\net9.0\\Playground.Test.dll\" adapterTypeName=\"executor://mstestadapter/v2\" className=\"TestProject1.UnitTest1\" name=\"TestShouldFail\" />\n    </UnitTest>\n        <UnitTest name=\"TestMethod5 (1,1)\" storage=\"c:\\dev\\playground\\playground.test\\bin\\debug\\net9.0\\playground.test.dll\" id=\"2184a87e-c02e-442c-8320-09fecdc30623\">\n      <Execution id=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n      <TestMethod codeBase=\"C:\\dev\\Playground\\Playground.Test\\bin\\Debug\\net9.0\\Playground.Test.dll\" adapterTypeName=\"executor://mstestadapter/v2\" className=\"TestProject1.UnitTest2\" name=\"TestMethod5\" />\n    </UnitTest>\n    <UnitTest name=\"TestMethod5 (1,2)\" storage=\"c:\\dev\\playground\\playground.test\\bin\\debug\\net9.0\\playground.test.dll\" id=\"2386b338-1542-4ec7-a8b2-cdfbaa53ba67\">\n      <Execution id=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n      <TestMethod codeBase=\"C:\\dev\\Playground\\Playground.Test\\bin\\Debug\\net9.0\\Playground.Test.dll\" adapterTypeName=\"executor://mstestadapter/v2\" className=\"TestProject1.UnitTest2\" name=\"TestMethod5\" />\n    </UnitTest>\n    <UnitTest name=\"TestMethod5 (2,1)\" storage=\"c:\\dev\\playground\\playground.test\\bin\\debug\\net9.0\\playground.test.dll\" id=\"35fa7c77-814c-4fae-913d-282d27c9d317\">\n      <Execution id=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n      <TestMethod codeBase=\"C:\\dev\\Playground\\Playground.Test\\bin\\Debug\\net9.0\\Playground.Test.dll\" adapterTypeName=\"executor://mstestadapter/v2\" className=\"TestProject1.UnitTest2\" name=\"TestMethod5\" />\n    </UnitTest>\n    <UnitTest name=\"TestMethod5 (2,2)\" storage=\"c:\\dev\\playground\\playground.test\\bin\\debug\\net9.0\\playground.test.dll\" id=\"ebb027a0-c08c-4edb-b618-97dc337b39fe\">\n      <Execution id=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n      <TestMethod codeBase=\"C:\\dev\\Playground\\Playground.Test\\bin\\Debug\\net9.0\\Playground.Test.dll\" adapterTypeName=\"executor://mstestadapter/v2\" className=\"TestProject1.UnitTest2\" name=\"TestMethod5\" />\n    </UnitTest>\n    <UnitTest name=\"TestMethod5 (1,3)\" storage=\"c:\\dev\\playground\\playground.test\\bin\\debug\\net9.0\\playground.test.dll\" id=\"358b3d3f-0c53-478e-9943-28ad836e4539\">\n      <Execution id=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n      <TestMethod codeBase=\"C:\\dev\\Playground\\Playground.Test\\bin\\Debug\\net9.0\\Playground.Test.dll\" adapterTypeName=\"executor://mstestadapter/v2\" className=\"TestProject1.UnitTest2\" name=\"TestMethod5\" />\n    </UnitTest>\n    <UnitTest name=\"TestMethod5 (3,1)\" storage=\"c:\\dev\\playground\\playground.test\\bin\\debug\\net9.0\\playground.test.dll\" id=\"98d81cac-eddf-41ef-98b6-a008cc35182b\">\n      <Execution id=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n      <TestMethod codeBase=\"C:\\dev\\Playground\\Playground.Test\\bin\\Debug\\net9.0\\Playground.Test.dll\" adapterTypeName=\"executor://mstestadapter/v2\" className=\"TestProject1.UnitTest2\" name=\"TestMethod5\" />\n    </UnitTest>\n    <UnitTest name=\"TestMethod5 (2,3)\" storage=\"c:\\dev\\playground\\playground.test\\bin\\debug\\net9.0\\playground.test.dll\" id=\"ddfa5c76-cbe1-4372-8a85-a236697ddf5b\">\n      <Execution id=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n      <TestMethod codeBase=\"C:\\dev\\Playground\\Playground.Test\\bin\\Debug\\net9.0\\Playground.Test.dll\" adapterTypeName=\"executor://mstestadapter/v2\" className=\"TestProject1.UnitTest2\" name=\"TestMethod5\" />\n    </UnitTest>\n    <UnitTest name=\"TestMethod5 (3,2)\" storage=\"c:\\dev\\playground\\playground.test\\bin\\debug\\net9.0\\playground.test.dll\" id=\"0683bb92-89c8-4e66-a1f8-522e2199ef53\">\n      <Execution id=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n      <TestMethod codeBase=\"C:\\dev\\Playground\\Playground.Test\\bin\\Debug\\net9.0\\Playground.Test.dll\" adapterTypeName=\"executor://mstestadapter/v2\" className=\"TestProject1.UnitTest2\" name=\"TestMethod5\" />\n    </UnitTest>\n    <UnitTest name=\"TestMethod5 (3,3)\" storage=\"c:\\dev\\playground\\playground.test\\bin\\debug\\net9.0\\playground.test.dll\" id=\"5553b0bd-1390-49c8-bfff-70b4c94a4321\">\n      <Execution id=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n      <TestMethod codeBase=\"C:\\dev\\Playground\\Playground.Test\\bin\\Debug\\net9.0\\Playground.Test.dll\" adapterTypeName=\"executor://mstestadapter/v2\" className=\"TestProject1.UnitTest2\" name=\"TestMethod5\" />\n    </UnitTest>\n    <UnitTest name=\"TestMethod5 (4,1)\" storage=\"c:\\dev\\playground\\playground.test\\bin\\debug\\net9.0\\playground.test.dll\" id=\"5733759c-ad55-9784-8372-5dfbf9179fbc\">\n      <Execution id=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n      <TestMethod codeBase=\"C:\\dev\\Playground\\Playground.Test\\bin\\Debug\\net9.0\\Playground.Test.dll\" adapterTypeName=\"executor://mstestadapter/v2\" className=\"TestProject1.UnitTest2\" name=\"TestMethod5\" />\n    </UnitTest>\n    <UnitTest name=\"TestMethod5 (1,4)\" storage=\"c:\\dev\\playground\\playground.test\\bin\\debug\\net9.0\\playground.test.dll\" id=\"9c66db0f-1976-ce08-cc4c-71201b65b30a\">\n      <Execution id=\"abe9481a-f298-4416-ae61-4c893c7c801d\" />\n      <TestMethod codeBase=\"C:\\dev\\Playground\\Playground.Test\\bin\\Debug\\net9.0\\Playground.Test.dll\" adapterTypeName=\"executor://mstestadapter/v2\" className=\"TestProject1.UnitTest2\" name=\"TestMethod5\" />\n    </UnitTest>\n    <UnitTest name=\"TestMethod1 (True)\" storage=\"c:\\dev\\playground\\playground.test\\bin\\debug\\net9.0\\playground.test.dll\" id=\"8099befc-4d3c-2f96-8986-47ced62d8a09\">\n      <Execution id=\"c5323fd6-c065-4917-b646-a4e7f6073f6c\" />\n      <TestMethod codeBase=\"C:\\dev\\Playground\\Playground.Test\\bin\\Debug\\net9.0\\Playground.Test.dll\" adapterTypeName=\"executor://mstestadapter/v2\" className=\"TestProject1.UnitTest1\" name=\"TestMethod1\" />\n    </UnitTest>\n    <UnitTest name=\"TestShouldError\" storage=\"c:\\dev\\playground\\playground.test\\bin\\debug\\net9.0\\playground.test.dll\" id=\"336f6912-993b-bafa-0b01-72bc265df384\">\n      <Execution id=\"4a54ce7d-7ef5-4471-b092-c80815ecf8db\" />\n      <TestMethod codeBase=\"C:\\dev\\Playground\\Playground.Test\\bin\\Debug\\net9.0\\Playground.Test.dll\" adapterTypeName=\"executor://mstestadapter/v2\" className=\"TestProject1.UnitTest1\" name=\"TestShouldError\" />\n    </UnitTest>\n    <UnitTest name=\"TestMethod1 (False)\" storage=\"c:\\dev\\playground\\playground.test\\bin\\debug\\net9.0\\playground.test.dll\" id=\"9c66db0f-1976-ce08-cc4c-71201b65b30a\">\n      <Execution id=\"7e223b20-72cb-4952-9e29-e176ffd50293\" />\n      <TestMethod codeBase=\"C:\\dev\\Playground\\Playground.Test\\bin\\Debug\\net9.0\\Playground.Test.dll\" adapterTypeName=\"executor://mstestadapter/v2\" className=\"TestProject1.UnitTest1\" name=\"TestMethod1\" />\n    </UnitTest>\n  </TestDefinitions>\n  <TestEntries>\n    <TestEntry testId=\"d7744238-9adf-b364-3d70-ae38261a8cd8\" executionId=\"eff25556-c0df-4a48-b88d-2286e542af4f\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" />\n    <TestEntry testId=\"8099befc-4d3c-2f96-8986-47ced62d8a09\" executionId=\"c5323fd6-c065-4917-b646-a4e7f6073f6c\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" />\n    <TestEntry testId=\"336f6912-993b-bafa-0b01-72bc265df384\" executionId=\"4a54ce7d-7ef5-4471-b092-c80815ecf8db\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" />\n    <TestEntry testId=\"5733759c-ad55-9784-8372-5dfbf9179fbc\" executionId=\"abe9481a-f298-4416-ae61-4c893c7c801d\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" />\n    <TestEntry testId=\"9c66db0f-1976-ce08-cc4c-71201b65b30a\" executionId=\"7e223b20-72cb-4952-9e29-e176ffd50293\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" />\n    <TestEntry testId=\"c7dc64cd-0233-3937-7ce3-ae46f9eabe5c\" executionId=\"449ad3c5-0ff2-42ac-b9dc-0d31b4ea9d7d\" testListId=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" />\n  </TestEntries>\n  <TestLists>\n    <TestList name=\"Results Not in a List\" id=\"8c84fa94-04c1-424b-9868-57a2d4851a1d\" />\n    <TestList name=\"All Loaded Results\" id=\"19431567-8539-422a-85d7-44ee4e166bda\" />\n  </TestLists>\n  <ResultSummary outcome=\"Failed\">\n    <Counters total=\"6\" executed=\"5\" passed=\"3\" failed=\"2\" error=\"0\" timeout=\"0\" aborted=\"0\" inconclusive=\"0\" passedButRunAborted=\"0\" notRunnable=\"0\" notExecuted=\"0\" disconnected=\"0\" warning=\"0\" completed=\"0\" inProgress=\"0\" pending=\"0\" />\n    <Output>\n      <StdOut>Test 'TestShouldSkip' was skipped in the test run.&#xD;\n</StdOut>\n    </Output>\n  </ResultSummary>\n</TestRun>"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/xml_parser_helper/invalid_prolog.txt",
    "content": "#\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/xml_parser_helper/valid.xml",
    "content": "<foo myDouble=\"0.123\" myCommaDouble=\"1,234\" myString=\"hello\">\n  <bar c=\"0\" />\n</foo>\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/xunit/ReadMe.md",
    "content": "# Generating XUnit Test Results\n\n## valid.xml\n\nThese results are generated from [this project](https://github.com/alex-meseldzija-sonarsource/Playground/tree/main/XUnit) by running the `dotnet test --logger:xunit` command\n\nThis will generate a valid .xml file in Playground/XUnit/TestResults.\n\nAn extra assembly was also added.\n\n```xml\n  <assembly name=\"C:\\dev\\Playground\\XUnit\\bin\\Debug\\net9.0\\XUnitTestProj2.dll\" run-date=\"2024-11-20\" run-time=\"09:45:53\" total=\"1\" passed=\"1\" failed=\"0\" skipped=\"0\" time=\"0.006\" errors=\"0\">\n    <errors />\n    <collection total=\"1\" passed=\"0\" failed=\"0\" skipped=\"1\" name=\"Test collection for XUnitTestProject2.UnitTest2\" time=\"0.006\">\n      <test name=\"XUnitTestProject2.UnitTest2.XUnitTestNotRun\" type=\"XUnitTestProject2.UnitTest2\" method=\"XUnitTestNotRun\" time=\"0.0061234\" result=\"NotRun\">\n        <traits />\n      </test>\n    </collection>\n  </assembly>\n```\n\n## valid_data_attribute.xml\n\nThis is a valid xml file that was generated from the above xunit project but with a single cs file consisting of:\n\n```csharp\nnamespace DataDrivenWithXUnit.Test\n{\n    public class CalculatorTestWithClassData\n    {\n        [Theory]\n        [ClassData(typeof(TestClassDataGenerator))]\n        public void Add_ShouldReturnCorrectSum(int a, int b, int expected)\n        {\n            // Act\n            int result = Hello.AddNumber(a, b);\n\n            // Assert\n            Assert.Equal(expected, result);\n        }\n\n\n    }\n\n    public class TestClassDataGenerator : IEnumerable<object[]>\n    {\n        public IEnumerator<object[]> GetEnumerator()\n        {\n            yield return new object[] { 2, 3, 5 }; // Test case 1\n            yield return new object[] { -1, 1, 0 }; // Test case 2\n        }\n\n        IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();\n    }\n}\n```\n\n## valid_generic_methods_csharp.xml\n\nThis file is generated using the [Calculator](../samples/csharp/Calculator) project and was manually modified to:\n - use relative path for the assembly\n - keep only the `collection` with `Calculator.xUnit.GenericTests.GenericTestMethod` tests\n\n## valid_generic_methods_vbnet.xml\n\nThis file is generated using the [Calculator](../samples/vbnet/Calculator) project and was manually modified to:\n- use relative path for the assembly\n- keep only the `collection` with `Calculator.xUnit.GenericTests.GenericTestMethod` tests\n\n## valid_no_execution_time.xml\n\nThis is a valid .xml file that consists of a single unit test that has had the execution time removed.\n\n## invalid_test_outcome.xml\n\nThis is a valid .xml file that has been modified to have an outcome that doesn't exist.\n\n```xml\n<test result=\"SomeOtherResult\"/>\n```\n\n## test_name_not_mapped.xml\n\nThis is a valid .xml file consisting of a single unit test extracted from valid.xml that is then not mapped correctly in the Hashmap provided to the XUnitTestResultParser.\n\n## invalid_root.xml\n\nThis is a valid .xml file but not a valid XUnit report, it has had its root tag replace with \n\n```xml\n<foo/>\n```\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/xunit/invalid_root.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<foo />\n"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/xunit/invalid_test_outcome.xml",
    "content": "<assemblies timestamp=\"11/20/2024 09:45:53\">\n  <assembly name=\"C:\\dev\\Playground\\XUnit\\bin\\Debug\\net9.0\\XUnitTestProj.dll\" run-date=\"2024-11-20\" run-time=\"09:45:53\" total=\"1\" passed=\"1\" failed=\"0\" skipped=\"0\" time=\"0.665\" errors=\"0\">\n    <errors />\n    <collection total=\"1\" passed=\"1\" failed=\"0\" skipped=\"0\" name=\"Test collection for XUnitTestProject1.UnitTest1\" time=\"0.006\">\n      <test name=\"XUnitTestProject1.UnitTest1.XUnitTestMethod1\" type=\"XUnitTestProject1.UnitTest1\" method=\"XUnitTestMethod1\" time=\"0.0061234\" result=\"SomeOtherResult\">\n        <traits />\n      </test>\n    </collection>\n  </assembly>\n</assemblies>"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/xunit/test_name_not_mapped.xml",
    "content": "<assemblies timestamp=\"11/20/2024 09:45:53\">\n  <assembly name=\"C:\\dev\\Playground\\XUnit\\bin\\Debug\\net9.0\\XUnitTestProj.dll\" run-date=\"2024-11-20\" run-time=\"09:45:53\" total=\"4\" passed=\"1\" failed=\"2\" skipped=\"1\" time=\"0.665\" errors=\"0\">\n    <errors />\n    <collection total=\"1\" passed=\"1\" failed=\"0\" skipped=\"0\" name=\"Test collection for XUnitTestProject1.UnitTest1\" time=\"0.006\">\n      <test name=\"XUnitTestProject1.UnitTest1.TestMethodDoesNotExist\" type=\"XUnitTestProject1.UnitTest1\" method=\"TestMethodDoesNotExist\" time=\"0.006\" result=\"Pass\">\n        <traits />\n      </test>\n    </collection>\n  </assembly>\n</assemblies>"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/xunit/valid.xml",
    "content": "<assemblies timestamp=\"11/20/2024 09:45:53\">\n  <assembly name=\"C:\\dev\\Playground\\XUnit\\bin\\Debug\\net9.0\\XUnitTestProj.dll\" run-date=\"2024-11-20\" run-time=\"09:45:53\" total=\"4\" passed=\"1\" failed=\"2\" skipped=\"1\" time=\"0.665\" errors=\"0\">\n    <errors />\n    <collection total=\"4\" passed=\"1\" failed=\"2\" skipped=\"1\" name=\"Test collection for XUnitTestProject1.UnitTest1\" time=\"0.006\">\n      <test name=\"XUnitTestProject1.UnitTest1.XUnitTestMethod1\" type=\"XUnitTestProject1.UnitTest1\" method=\"XUnitTestMethod1\" time=\"0.0037958\" result=\"Pass\">\n        <traits />\n      </test>\n      <test name=\"XUnitTestProject1.UnitTest1.XUnitTestShouldFail\" type=\"XUnitTestProject1.UnitTest1\" method=\"XUnitTestShouldFail\" time=\"0.0011735\" result=\"Fail\">\n        <failure>\n          <message>Assert.True() Failure\nExpected: True\nActual:   False</message>\n          <stack-trace>   at XUnitTestProject1.UnitTest1.XUnitTestShouldFail() in C:\\dev\\Playground\\XUnit\\UnitTest1.cs:line 16\n   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)\n   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)</stack-trace>\n        </failure>\n        <traits />\n      </test>\n      <test name=\"XUnitTestProject1.UnitTest1.XUnitTestShouldSkip\" type=\"XUnitTestProject1.UnitTest1\" method=\"XUnitTestShouldSkip\" time=\"0.0010000\" result=\"Skip\">\n        <reason><![CDATA[I Said So]]></reason>\n        <traits />\n      </test>\n      <test name=\"XUnitTestProject1.UnitTest1.XUnitTestShouldError\" type=\"XUnitTestProject1.UnitTest1\" method=\"XUnitTestShouldError\" time=\"0.0001715\" result=\"Fail\">\n        <failure>\n          <message>System.Exception : This is an error</message>\n          <stack-trace>   at XUnitTestProject1.UnitTest1.XUnitTestShouldError() in C:\\dev\\Playground\\XUnit\\UnitTest1.cs:line 28\n   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)\n   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)</stack-trace>\n        </failure>\n        <traits />\n      </test>\n    </collection>\n  </assembly>\n  <assembly name=\"C:\\dev\\Playground\\XUnit\\bin\\Debug\\net9.0\\XUnitTestProj2.dll\" run-date=\"2024-11-20\" run-time=\"09:45:53\" total=\"1\" passed=\"1\" failed=\"0\" skipped=\"0\" time=\"0.006\" errors=\"0\">\n    <errors />\n    <collection total=\"1\" passed=\"0\" failed=\"0\" skipped=\"1\" name=\"Test collection for XUnitTestProject2.UnitTest2\" time=\"0.006\">\n      <test name=\"XUnitTestProject2.UnitTest2.XUnitTestNotRun\" type=\"XUnitTestProject2.UnitTest2\" method=\"XUnitTestNotRun\" time=\"0.0061234\" result=\"NotRun\">\n        <traits />\n      </test>\n    </collection>\n  </assembly>\n</assemblies>"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/xunit/valid_data_attribute.xml",
    "content": "<assemblies timestamp=\"11/22/2024 07:56:39\">\n  <assembly name=\"C:\\dev\\Playground\\XUnit\\bin\\Debug\\net9.0\\XUnitTestProj.dll\" run-date=\"2024-11-22\" run-time=\"07:56:39\" total=\"2\" passed=\"2\" failed=\"0\" skipped=\"0\" time=\"0.008\" errors=\"0\">\n    <errors />\n    <collection total=\"2\" passed=\"2\" failed=\"0\" skipped=\"0\" name=\"Test collection for DataDrivenWithXUnit.Test.CalculatorTestWithClassData\" time=\"0.009\">\n      <test name=\"DataDrivenWithXUnit.Test.CalculatorTestWithClassData.Add_ShouldReturnCorrectSum(a: -1, b: 1, expected: 0)\" type=\"DataDrivenWithXUnit.Test.CalculatorTestWithClassData\" method=\"Add_ShouldReturnCorrectSum(a: -1, b: 1, expected: 0)\" time=\"0.0082545\" result=\"Pass\">\n        <traits />\n      </test>\n      <test name=\"DataDrivenWithXUnit.Test.CalculatorTestWithClassData.Add_ShouldReturnCorrectSum(a: 2, b: 3, expected: 5)\" type=\"DataDrivenWithXUnit.Test.CalculatorTestWithClassData\" method=\"Add_ShouldReturnCorrectSum(a: 2, b: 3, expected: 5)\" time=\"0.0003051\" result=\"Pass\">\n        <traits />\n      </test>\n    </collection>\n  </assembly>\n</assemblies>"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/xunit/valid_generic_methods_csharp.xml",
    "content": "<assemblies timestamp=\"12/11/2024 16:59:07\">\n  <assembly name=\"Calculator.xUnit\\bin\\Debug\\net9.0\\Calculator.xUnit.dll\" run-date=\"2024-12-11\" run-time=\"16:59:07\" total=\"8\" passed=\"5\" failed=\"3\" skipped=\"0\" time=\"0.795\" errors=\"0\">\n    <errors />\n    <collection total=\"3\" passed=\"0\" failed=\"3\" skipped=\"0\" name=\"Test collection for Calculator.xUnit\" time=\"0.003\">\n      <test name=\"Calculator.xUnit.GenericDerivedFromGenericClass`1.VirtualMethodInBaseClass\" type=\"Calculator.xUnit\" method=\"GenericDerivedFromGenericClass`1.VirtualMethodInBaseClass\" time=\"0.0010000\" result=\"Fail\">\n        <failure>\n          <message>System.ArgumentException : Cannot create an instance of Calculator.xUnit.GenericDerivedFromGenericClass`1[T] because Type.ContainsGenericParameters is true.</message>\n          <stack-trace>   at System.RuntimeType.CreateInstanceCheckThis()\n   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)\n   at System.Activator.CreateInstance(Type type, Object[] args)\n   at ReflectionAbstractionExtensions.&lt;&gt;c__DisplayClass0_0.&lt;CreateTestClass&gt;b__0() in /_/src/xunit.execution/Extensions/ReflectionAbstractionExtensions.cs:line 42\n   at ReflectionAbstractionExtensions.CreateTestClass(ITest test, Type testClassType, Object[] constructorArguments, IMessageBus messageBus, ExecutionTimer timer, CancellationTokenSource cancellationTokenSource) in /_/src/xunit.execution/Extensions/ReflectionAbstractionExtensions.cs:line 42</stack-trace>\n        </failure>\n        <traits />\n      </test>\n      <test name=\"Calculator.xUnit.GenericDerivedFromGenericClass`1.GenericDerivedFromGenericClass_PassMethod\" type=\"Calculator.xUnit\" method=\"GenericDerivedFromGenericClass`1.GenericDerivedFromGenericClass_PassMethod\" time=\"0.0010000\" result=\"Fail\">\n        <failure>\n          <message>System.ArgumentException : Cannot create an instance of Calculator.xUnit.GenericDerivedFromGenericClass`1[T] because Type.ContainsGenericParameters is true.</message>\n          <stack-trace>   at System.RuntimeType.CreateInstanceCheckThis()\n   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)\n   at System.Activator.CreateInstance(Type type, Object[] args)\n   at ReflectionAbstractionExtensions.&lt;&gt;c__DisplayClass0_0.&lt;CreateTestClass&gt;b__0() in /_/src/xunit.execution/Extensions/ReflectionAbstractionExtensions.cs:line 42\n   at ReflectionAbstractionExtensions.CreateTestClass(ITest test, Type testClassType, Object[] constructorArguments, IMessageBus messageBus, ExecutionTimer timer, CancellationTokenSource cancellationTokenSource) in /_/src/xunit.execution/Extensions/ReflectionAbstractionExtensions.cs:line 42</stack-trace>\n        </failure>\n        <traits />\n      </test>\n      <test name=\"Calculator.xUnit.GenericDerivedFromGenericClass`1.TestMethodInBaseClass\" type=\"Calculator.xUnit\" method=\"GenericDerivedFromGenericClass`1.TestMethodInBaseClass\" time=\"0.0010000\" result=\"Fail\">\n        <failure>\n          <message>System.ArgumentException : Cannot create an instance of Calculator.xUnit.GenericDerivedFromGenericClass`1[T] because Type.ContainsGenericParameters is true.</message>\n          <stack-trace>   at System.RuntimeType.CreateInstanceCheckThis()\n   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)\n   at System.Activator.CreateInstance(Type type, Object[] args)\n   at ReflectionAbstractionExtensions.&lt;&gt;c__DisplayClass0_0.&lt;CreateTestClass&gt;b__0() in /_/src/xunit.execution/Extensions/ReflectionAbstractionExtensions.cs:line 42\n   at ReflectionAbstractionExtensions.CreateTestClass(ITest test, Type testClassType, Object[] constructorArguments, IMessageBus messageBus, ExecutionTimer timer, CancellationTokenSource cancellationTokenSource) in /_/src/xunit.execution/Extensions/ReflectionAbstractionExtensions.cs:line 42</stack-trace>\n        </failure>\n        <traits />\n      </test>\n    </collection>\n    <collection total=\"2\" passed=\"2\" failed=\"0\" skipped=\"0\" name=\"Test collection for Calculator.xUnit.Derived\" time=\"0.010\">\n      <test name=\"Calculator.xUnit.Derived.VirtualMethodInBaseClass\" type=\"Calculator.xUnit.Derived\" method=\"VirtualMethodInBaseClass\" time=\"0.0100342\" result=\"Pass\">\n        <traits />\n      </test>\n      <test name=\"Calculator.xUnit.Derived.TestMethodInBaseClass\" type=\"Calculator.xUnit.Derived\" method=\"TestMethodInBaseClass\" time=\"0.0000956\" result=\"Pass\">\n        <traits />\n      </test>\n    </collection>\n    <collection total=\"2\" passed=\"2\" failed=\"0\" skipped=\"0\" name=\"Test collection for Calculator.xUnit.GenericTests\" time=\"0.009\">\n      <test name=\"Calculator.xUnit.GenericTests.GenericTestMethod&lt;Object&gt;(type: typeof(string))\" type=\"Calculator.xUnit.GenericTests\" method=\"GenericTestMethod(type: typeof(string))\" time=\"0.0079932\" result=\"Pass\">\n        <traits />\n      </test>\n      <test name=\"Calculator.xUnit.GenericTests.GenericTestMethod&lt;Object&gt;(type: typeof(int))\" type=\"Calculator.xUnit.GenericTests\" method=\"GenericTestMethod(type: typeof(int))\" time=\"0.0005094\" result=\"Pass\">\n        <traits />\n      </test>\n    </collection>\n    <collection total=\"1\" passed=\"1\" failed=\"0\" skipped=\"0\" name=\"Test collection for Calculator.xUnit.Tests\" time=\"0.010\">\n      <test name=\"Calculator.xUnit.Tests.TestMethod1\" type=\"Calculator.xUnit.Tests\" method=\"TestMethod1\" time=\"0.0099173\" result=\"Pass\">\n        <traits />\n      </test>\n    </collection>\n  </assembly>\n</assemblies>"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/xunit/valid_generic_methods_vbnet.xml",
    "content": "<assemblies timestamp=\"12/12/2024 12:18:14\">\n  <assembly name=\"Calculator.xUnit\\bin\\Debug\\net9.0\\Calculator.xUnit.dll\" run-date=\"2024-12-12\" run-time=\"12:18:14\" total=\"8\" passed=\"5\" failed=\"3\" skipped=\"0\" time=\"0.703\" errors=\"0\">\n    <errors />\n    <collection total=\"3\" passed=\"0\" failed=\"3\" skipped=\"0\" name=\"Test collection for Calculator.xUnit\" time=\"0.003\">\n      <test name=\"Calculator.xUnit.GenericDerivedFromGenericClass`2.VirtualMethodInBaseClass\" type=\"Calculator.xUnit\" method=\"GenericDerivedFromGenericClass`2.VirtualMethodInBaseClass\" time=\"0.0010000\" result=\"Fail\">\n        <failure>\n          <message>System.ArgumentException : Cannot create an instance of Calculator.xUnit.GenericDerivedFromGenericClass`2[T,U] because Type.ContainsGenericParameters is true.</message>\n          <stack-trace>   at System.RuntimeType.CreateInstanceCheckThis()\n            at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)\n            at System.Activator.CreateInstance(Type type, Object[] args)\n            at ReflectionAbstractionExtensions.&lt;&gt;c__DisplayClass0_0.&lt;CreateTestClass&gt;b__0() in /_/src/xunit.execution/Extensions/ReflectionAbstractionExtensions.cs:line 42\n            at ReflectionAbstractionExtensions.CreateTestClass(ITest test, Type testClassType, Object[] constructorArguments, IMessageBus messageBus, ExecutionTimer timer, CancellationTokenSource cancellationTokenSource) in /_/src/xunit.execution/Extensions/ReflectionAbstractionExtensions.cs:line 42</stack-trace>\n        </failure>\n        <traits />\n      </test>\n      <test name=\"Calculator.xUnit.GenericDerivedFromGenericClass`2.GenericMethod\" type=\"Calculator.xUnit\" method=\"GenericDerivedFromGenericClass`2.GenericMethod\" time=\"0.0010000\" result=\"Fail\">\n        <failure>\n          <message>System.InvalidOperationException : [Fact] methods are not allowed to be generic.</message>\n          <stack-trace></stack-trace>\n        </failure>\n        <traits />\n      </test>\n      <test name=\"Calculator.xUnit.GenericDerivedFromGenericClass`2.TestMethodInBaseClass\" type=\"Calculator.xUnit\" method=\"GenericDerivedFromGenericClass`2.TestMethodInBaseClass\" time=\"0.0010000\" result=\"Fail\">\n        <failure>\n          <message>System.ArgumentException : Cannot create an instance of Calculator.xUnit.GenericDerivedFromGenericClass`2[T,U] because Type.ContainsGenericParameters is true.</message>\n          <stack-trace>   at System.RuntimeType.CreateInstanceCheckThis()\n            at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)\n            at System.Activator.CreateInstance(Type type, Object[] args)\n            at ReflectionAbstractionExtensions.&lt;&gt;c__DisplayClass0_0.&lt;CreateTestClass&gt;b__0() in /_/src/xunit.execution/Extensions/ReflectionAbstractionExtensions.cs:line 42\n            at ReflectionAbstractionExtensions.CreateTestClass(ITest test, Type testClassType, Object[] constructorArguments, IMessageBus messageBus, ExecutionTimer timer, CancellationTokenSource cancellationTokenSource) in /_/src/xunit.execution/Extensions/ReflectionAbstractionExtensions.cs:line 42</stack-trace>\n        </failure>\n        <traits />\n      </test>\n    </collection>\n    <collection total=\"2\" passed=\"2\" failed=\"0\" skipped=\"0\" name=\"Test collection for Calculator.xUnit.Derived\" time=\"0.015\">\n      <test name=\"Calculator.xUnit.Derived.VirtualMethodInBaseClass\" type=\"Calculator.xUnit.Derived\" method=\"VirtualMethodInBaseClass\" time=\"0.0145392\" result=\"Pass\">\n        <traits />\n      </test>\n      <test name=\"Calculator.xUnit.Derived.TestMethodInBaseClass\" type=\"Calculator.xUnit.Derived\" method=\"TestMethodInBaseClass\" time=\"0.0000549\" result=\"Pass\">\n        <traits />\n      </test>\n    </collection>\n    <collection total=\"2\" passed=\"2\" failed=\"0\" skipped=\"0\" name=\"Test collection for Calculator.xUnit.GenericTests\" time=\"0.014\">\n      <test name=\"Calculator.xUnit.GenericTests.GenericTestMethod&lt;Object&gt;(type: typeof(string))\" type=\"Calculator.xUnit.GenericTests\" method=\"GenericTestMethod(type: typeof(string))\" time=\"0.0142225\" result=\"Pass\">\n        <traits />\n      </test>\n      <test name=\"Calculator.xUnit.GenericTests.GenericTestMethod&lt;Object&gt;(type: typeof(int))\" type=\"Calculator.xUnit.GenericTests\" method=\"GenericTestMethod(type: typeof(int))\" time=\"0.0001561\" result=\"Pass\">\n        <traits />\n      </test>\n    </collection>\n    <collection total=\"1\" passed=\"1\" failed=\"0\" skipped=\"0\" name=\"Test collection for Calculator.xUnit.Tests\" time=\"0.014\">\n      <test name=\"Calculator.xUnit.Tests.TestMethod1\" type=\"Calculator.xUnit.Tests\" method=\"TestMethod1\" time=\"0.0144938\" result=\"Pass\">\n        <traits />\n      </test>\n    </collection>\n  </assembly>\n</assemblies>"
  },
  {
    "path": "sonar-dotnet-core/src/test/resources/xunit/valid_no_execution_time.xml",
    "content": "<assemblies timestamp=\"11/20/2024 09:45:53\">\n  <assembly name=\"C:\\dev\\Playground\\XUnit\\bin\\Debug\\net9.0\\XUnitTestProj.dll\" run-date=\"2024-11-20\" run-time=\"09:45:53\" total=\"1\" passed=\"1\" failed=\"0\" skipped=\"0\"  errors=\"0\">\n    <errors />\n    <collection total=\"1\" passed=\"1\" failed=\"0\" skipped=\"0\" name=\"Test collection for XUnitTestProject1.UnitTest1\">\n      <test name=\"XUnitTestProject1.UnitTest1.XUnitTestMethod1\" type=\"XUnitTestProject1.UnitTest1\" method=\"XUnitTestMethod1\" result=\"Pass\">\n        <traits />\n      </test>\n    </collection>\n  </assembly>\n</assemblies>"
  },
  {
    "path": "sonar-vbnet-core/README.md",
    "content": "# Common code for VB.NET SonarQube plugins\n\nThis folder contains the common code for VB.NET plugins for SonarQube.\n\nTo get more information please read the repository main [README](../README.md).\n"
  },
  {
    "path": "sonar-vbnet-core/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <parent>\n    <groupId>org.sonarsource.dotnet</groupId>\n    <artifactId>sonar-dotnet</artifactId>\n    <version>10.26-SNAPSHOT</version>\n  </parent>\n\n  <artifactId>sonar-vbnet-core</artifactId>\n\n  <name>SonarSource :: VB.NET :: Core</name>\n  <description>Shared code between VB.NET plugins</description>\n  <inceptionYear>2012</inceptionYear>\n\n  <dependencies>\n    <!-- provided at runtime -->\n    <dependency>\n      <groupId>org.sonarsource.api.plugin</groupId>\n      <artifactId>sonar-plugin-api</artifactId>\n    </dependency>\n    <dependency>\n      <groupId>org.slf4j</groupId>\n      <artifactId>slf4j-api</artifactId>\n      <scope>provided</scope>\n    </dependency>\n\n    <!-- Compile dependencies -->\n    <dependency>\n      <groupId>${project.groupId}</groupId>\n      <artifactId>sonar-dotnet-core</artifactId>\n      <version>${project.version}</version>\n    </dependency>\n\n    <!-- unit tests -->\n    <dependency>\n      <groupId>org.junit.jupiter</groupId>\n      <artifactId>junit-jupiter-engine</artifactId>\n    </dependency>\n    <dependency>\n      <groupId>org.sonarsource.api.plugin</groupId>\n      <artifactId>sonar-plugin-api-test-fixtures</artifactId>\n    </dependency>\n    <dependency>\n      <groupId>org.assertj</groupId>\n      <artifactId>assertj-core</artifactId>\n    </dependency>\n    <dependency>\n      <groupId>org.mockito</groupId>\n      <artifactId>mockito-core</artifactId>\n    </dependency>\n    <dependency>\n      <groupId>org.sonarsource.sonarqube</groupId>\n      <artifactId>sonar-plugin-api-impl</artifactId>\n    </dependency>\n  </dependencies>\n\n  <build>\n    <extensions>\n      <extension>\n        <groupId>kr.motd.maven</groupId>\n        <artifactId>os-maven-plugin</artifactId>\n        <version>1.7.1</version>\n      </extension>\n    </extensions>\n    <pluginManagement>\n      <plugins>\n        <plugin>\n          <groupId>org.apache.maven.plugins</groupId>\n          <artifactId>maven-antrun-plugin</artifactId>\n          <version>3.2.0</version>\n        </plugin>\n        <plugin>\n          <groupId>org.codehaus.mojo</groupId>\n          <artifactId>build-helper-maven-plugin</artifactId>\n          <version>3.6.1</version>\n        </plugin>\n      </plugins>\n    </pluginManagement>\n  </build>\n\n</project>\n"
  },
  {
    "path": "sonar-vbnet-core/src/main/java/org/sonar/plugins/vbnetenterprise/api/ProfileRegistrar.java",
    "content": "/*\n * SonarSource :: VB.NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n// This class needs to be in this specific package in order to be accessed by other plugins (e.g. sonar-security-vbnet-frontend-plugin)\n// See https://docs.sonarsource.com/sonarqube-server/latest/extension-guide/developing-a-plugin/plugin-basics/#exposing-apis-to-other-plugins\npackage org.sonar.plugins.vbnetenterprise.api;\n\nimport org.sonar.api.rule.RuleKey;\nimport org.sonar.api.server.ServerSide;\nimport org.sonarsource.api.sonarlint.SonarLintSide;\n\nimport java.util.Collection;\n\n/**\n * This interface can be used to provide additional rule keys in the builtin default quality profile.\n *\n * <pre>\n *   {@code\n *     public void register(RegistrarContext registrarContext) {\n *       registrarContext.registerDefaultQualityProfileRules(ruleKeys);\n *     }\n *   }\n * </pre>\n */\n@SonarLintSide\n@ServerSide\npublic interface ProfileRegistrar {\n\n  /**\n   * This method is called on server side and during an analysis to modify the builtin default quality profile for vbnet.\n   */\n  void register(RegistrarContext registrarContext);\n\n  interface RegistrarContext {\n\n    /**\n     * Registers additional rules into the \"Sonar Way\" default quality profile for the language \"vbnet\".\n     */\n    void registerDefaultQualityProfileRules(Collection<RuleKey> ruleKeys);\n  }\n}\n"
  },
  {
    "path": "sonar-vbnet-core/src/main/java/org/sonar/plugins/vbnetenterprise/api/package-info.java",
    "content": "/*\n * SonarSource :: VB.NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n@ParametersAreNonnullByDefault\npackage org.sonar.plugins.vbnetenterprise.api;\n\nimport javax.annotation.ParametersAreNonnullByDefault;\n"
  },
  {
    "path": "sonar-vbnet-core/src/main/java/org/sonarsource/vbnet/core/VbNetCoreExtensions.java",
    "content": "/*\n * SonarSource :: VB.NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.vbnet.core;\n\nimport org.sonar.api.Plugin.Context;\nimport org.sonarsource.dotnet.shared.plugins.CodeCoverageProvider;\nimport org.sonarsource.dotnet.shared.plugins.DotNetRulesDefinition;\nimport org.sonarsource.dotnet.shared.plugins.EncodingPerFile;\nimport org.sonarsource.dotnet.shared.plugins.GlobalProtobufFileProcessor;\nimport org.sonarsource.dotnet.shared.plugins.HashProvider;\nimport org.sonarsource.dotnet.shared.plugins.MethodDeclarationsCollector;\nimport org.sonarsource.dotnet.shared.plugins.ModuleConfiguration;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\nimport org.sonarsource.dotnet.shared.plugins.ProjectTypeCollector;\nimport org.sonarsource.dotnet.shared.plugins.ProtobufDataImporter;\nimport org.sonarsource.dotnet.shared.plugins.RealPathProvider;\nimport org.sonarsource.dotnet.shared.plugins.ReportPathCollector;\nimport org.sonarsource.dotnet.shared.plugins.RoslynDataImporter;\nimport org.sonarsource.dotnet.shared.plugins.RoslynRules;\nimport org.sonarsource.dotnet.shared.plugins.TelemetryCollector;\nimport org.sonarsource.dotnet.shared.plugins.UnitTestResultsProvider;\nimport org.sonarsource.dotnet.shared.plugins.filters.GeneratedFileFilter;\nimport org.sonarsource.dotnet.shared.plugins.filters.WrongEncodingFileFilter;\nimport org.sonarsource.dotnet.shared.plugins.sensors.DotNetSensor;\nimport org.sonarsource.dotnet.shared.plugins.sensors.FileTypeSensor;\nimport org.sonarsource.dotnet.shared.plugins.sensors.LogSensor;\nimport org.sonarsource.dotnet.shared.plugins.sensors.MethodDeclarationsSensor;\nimport org.sonarsource.dotnet.shared.plugins.sensors.PropertiesSensor;\nimport org.sonarsource.dotnet.shared.plugins.sensors.TelemetryJsonProcessor;\nimport org.sonarsource.dotnet.shared.plugins.sensors.TelemetryJsonProjectCollector;\nimport org.sonarsource.dotnet.shared.plugins.sensors.TelemetryJsonSensor;\nimport org.sonarsource.dotnet.shared.plugins.sensors.TelemetryProcessor;\nimport org.sonarsource.dotnet.shared.plugins.sensors.TelemetrySensor;\nimport org.sonarsource.dotnet.shared.plugins.telemetryjson.TelemetryJsonCollector;\n\npublic class VbNetCoreExtensions {\n\n  private VbNetCoreExtensions() {\n    // Private constructor to prevent instantiation\n  }\n\n  public static void register(Context context, PluginMetadata metadata) {\n    context.addExtensions(\n      // module-level components (some relying on deprecated Scanner APIs)\n      FileTypeSensor.class,\n      LogSensor.class,\n      MethodDeclarationsCollector.class,\n      MethodDeclarationsSensor.class,\n      TelemetryCollector.class,\n      TelemetrySensor.class,\n      TelemetryProcessor.class,\n      TelemetryJsonCollector.class,\n      TelemetryJsonSensor.class,\n      TelemetryJsonProjectCollector.class,\n      TelemetryJsonProcessor.class,\n      PropertiesSensor.class,\n      ModuleConfiguration.class,\n      RealPathProvider.class,\n      // global components\n      // collectors - they are populated by the module-level sensors\n      ProjectTypeCollector.class,\n      ReportPathCollector.class,\n      HashProvider.class,\n      DotNetRulesDefinition.class,\n      GlobalProtobufFileProcessor.class,\n      RoslynRules.class,\n      VbNetSonarWayProfile.class,\n      // sensor\n      DotNetSensor.class,\n      VbNetFileCacheSensor.class,\n      // language-specific\n      metadata,\n      VbNetCorePluginMetadata.VbNet.class,\n      VbNetLanguageConfiguration.class,\n      // filters\n      EncodingPerFile.class,\n      GeneratedFileFilter.class,\n      WrongEncodingFileFilter.class,\n      // importers / exporters\n      ProtobufDataImporter.class,\n      RoslynDataImporter.class);\n\n    context.addExtensions(new VbNetPropertyDefinitions(metadata).create());\n    context.addExtensions(new CodeCoverageProvider(metadata).extensions());\n    context.addExtensions(new UnitTestResultsProvider(metadata).extensions());\n  }\n}\n"
  },
  {
    "path": "sonar-vbnet-core/src/main/java/org/sonarsource/vbnet/core/VbNetCorePluginMetadata.java",
    "content": "/*\n * SonarSource :: VB.NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.vbnet.core;\n\nimport java.util.Objects;\nimport org.sonar.api.config.Configuration;\nimport org.sonar.api.resources.AbstractLanguage;\nimport org.sonarsource.dotnet.shared.plugins.AbstractPropertyDefinitions;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\n\npublic abstract class VbNetCorePluginMetadata implements PluginMetadata {\n\n  @Override\n  public String languageKey() {\n    return VbNet.LANGUAGE_KEY;\n  }\n\n  @Override\n  public String languageName() {\n    return VbNet.LANGUAGE_NAME;\n  }\n\n  @Override\n  public String repositoryKey() {\n    return \"vbnet\";\n  }\n\n  @Override\n  public String fileSuffixesKey() {\n    return AbstractPropertyDefinitions.fileSuffixProperty(languageKey());\n  }\n\n  @Override\n  public String fileSuffixesDefaultValue() {\n    return \".vb\";\n  }\n\n  public class VbNet extends AbstractLanguage {\n\n    // Do not make these fields public and access them directly. Use the methods in VBnetCorePluginMetadata instead.\n    private static final String LANGUAGE_KEY = \"vbnet\";\n    private static final String LANGUAGE_NAME = \"VB.NET\";\n    private final Configuration configuration;\n\n    public VbNet(Configuration configuration) {\n      super(languageKey(), languageName());\n      this.configuration = configuration;\n    }\n\n    @Override\n    public String[] getFileSuffixes() {\n      return configuration.getStringArray(fileSuffixesKey());\n    }\n\n    @Override\n    public boolean equals(Object o) {\n      return super.equals(o) && o instanceof VbNet vbNet && configuration == vbNet.configuration;\n    }\n\n    @Override\n    public int hashCode() {\n      return Objects.hash(super.hashCode(), configuration.hashCode());\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-vbnet-core/src/main/java/org/sonarsource/vbnet/core/VbNetFileCacheSensor.java",
    "content": "/*\n * SonarSource :: VB.NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.vbnet.core;\n\nimport org.sonarsource.dotnet.shared.plugins.HashProvider;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\nimport org.sonarsource.dotnet.shared.plugins.sensors.AbstractFileCacheSensor;\n\npublic class VbNetFileCacheSensor extends AbstractFileCacheSensor {\n  public VbNetFileCacheSensor(PluginMetadata metadata, HashProvider hashProvider) {\n    super(metadata, hashProvider);\n  }\n}\n"
  },
  {
    "path": "sonar-vbnet-core/src/main/java/org/sonarsource/vbnet/core/VbNetLanguageConfiguration.java",
    "content": "/*\n * SonarSource :: VB.NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.vbnet.core;\n\nimport org.sonar.api.config.Configuration;\nimport org.sonarsource.dotnet.shared.plugins.AbstractLanguageConfiguration;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\n\npublic class VbNetLanguageConfiguration extends AbstractLanguageConfiguration {\n  public VbNetLanguageConfiguration(Configuration configuration, PluginMetadata metadata) {\n    super(configuration, metadata);\n  }\n}\n"
  },
  {
    "path": "sonar-vbnet-core/src/main/java/org/sonarsource/vbnet/core/VbNetPropertyDefinitions.java",
    "content": "/*\n * SonarSource :: VB.NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.vbnet.core;\n\nimport org.sonarsource.dotnet.shared.plugins.AbstractPropertyDefinitions;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\n\npublic class VbNetPropertyDefinitions extends AbstractPropertyDefinitions {\n\n  public VbNetPropertyDefinitions(PluginMetadata metadata) {\n    super(metadata);\n  }\n}\n"
  },
  {
    "path": "sonar-vbnet-core/src/main/java/org/sonarsource/vbnet/core/VbNetSonarWayProfile.java",
    "content": "/*\n * SonarSource :: VB.NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.vbnet.core;\n\nimport org.sonar.api.rule.RuleKey;\nimport org.sonar.plugins.vbnetenterprise.api.ProfileRegistrar;\nimport org.sonarsource.dotnet.shared.plugins.AbstractSonarWayProfile;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\nimport org.sonarsource.dotnet.shared.plugins.RoslynRules;\n\npublic class VbNetSonarWayProfile extends AbstractSonarWayProfile {\n  private final ProfileRegistrar[] profileRegistrars;\n\n  // The constructors cannot be merged because SonarQube Cloud does not support dependency injection for @Nullable arguments.\n  public VbNetSonarWayProfile(PluginMetadata metadata, RoslynRules roslynRules) {\n    super(metadata, roslynRules);\n    this.profileRegistrars = null;\n  }\n\n  public VbNetSonarWayProfile(PluginMetadata metadata, RoslynRules roslynRules, ProfileRegistrar[] profileRegistrars) {\n    super(metadata, roslynRules);\n    this.profileRegistrars = profileRegistrars;\n  }\n\n  @Override\n  protected void registerRulesFromRegistrars(NewBuiltInQualityProfile profile) {\n    if (profileRegistrars != null) {\n      for (var profileRegistrar : profileRegistrars) {\n        profileRegistrar.register(rules -> {\n          for (RuleKey ruleKey : rules) {\n            profile.activateRule(ruleKey.repository(), ruleKey.rule());\n          }\n        });\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-vbnet-core/src/main/java/org/sonarsource/vbnet/core/package-info.java",
    "content": "/*\n * SonarSource :: VB.NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n@ParametersAreNonnullByDefault\npackage org.sonarsource.vbnet.core;\n\nimport javax.annotation.ParametersAreNonnullByDefault;\n"
  },
  {
    "path": "sonar-vbnet-core/src/test/java/org/sonarsource/vbnet/core/TestVbNetMetadata.java",
    "content": "/*\n * SonarSource :: VB.NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.vbnet.core;\n\nclass TestVbNetMetadata extends VbNetCorePluginMetadata {\n\n  public static final TestVbNetMetadata INSTANCE = new TestVbNetMetadata();\n\n  @Override\n  public String pluginKey() {\n    return \"VbNet Test Plugin Key\";\n  }\n\n  @Override\n  public String analyzerProjectName() {\n    return \"VbNet Test Project Name\";\n  }\n\n  @Override\n  public String resourcesDirectory() {\n    return \"VbNet Test Resources Directory\";\n  }\n}\n"
  },
  {
    "path": "sonar-vbnet-core/src/test/java/org/sonarsource/vbnet/core/VbNetCoreExtensionsTest.java",
    "content": "/*\n * SonarSource :: VB.NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.vbnet.core;\n\nimport org.junit.jupiter.api.Test;\nimport org.sonar.api.Plugin;\nimport org.sonar.api.SonarEdition;\nimport org.sonar.api.SonarQubeSide;\nimport org.sonar.api.SonarRuntime;\nimport org.sonar.api.internal.SonarRuntimeImpl;\nimport org.sonar.api.utils.Version;\nimport org.sonarsource.dotnet.shared.plugins.CodeCoverageProvider;\nimport org.sonarsource.dotnet.shared.plugins.DotNetRulesDefinition;\nimport org.sonarsource.dotnet.shared.plugins.EncodingPerFile;\nimport org.sonarsource.dotnet.shared.plugins.GlobalProtobufFileProcessor;\nimport org.sonarsource.dotnet.shared.plugins.HashProvider;\nimport org.sonarsource.dotnet.shared.plugins.MethodDeclarationsCollector;\nimport org.sonarsource.dotnet.shared.plugins.ModuleConfiguration;\nimport org.sonarsource.dotnet.shared.plugins.ProjectTypeCollector;\nimport org.sonarsource.dotnet.shared.plugins.ProtobufDataImporter;\nimport org.sonarsource.dotnet.shared.plugins.RealPathProvider;\nimport org.sonarsource.dotnet.shared.plugins.ReportPathCollector;\nimport org.sonarsource.dotnet.shared.plugins.RoslynDataImporter;\nimport org.sonarsource.dotnet.shared.plugins.RoslynRules;\nimport org.sonarsource.dotnet.shared.plugins.TelemetryCollector;\nimport org.sonarsource.dotnet.shared.plugins.UnitTestResultsProvider;\nimport org.sonarsource.dotnet.shared.plugins.filters.GeneratedFileFilter;\nimport org.sonarsource.dotnet.shared.plugins.filters.WrongEncodingFileFilter;\nimport org.sonarsource.dotnet.shared.plugins.sensors.DotNetSensor;\nimport org.sonarsource.dotnet.shared.plugins.sensors.FileTypeSensor;\nimport org.sonarsource.dotnet.shared.plugins.sensors.LogSensor;\nimport org.sonarsource.dotnet.shared.plugins.sensors.MethodDeclarationsSensor;\nimport org.sonarsource.dotnet.shared.plugins.sensors.PropertiesSensor;\nimport org.sonarsource.dotnet.shared.plugins.sensors.TelemetryJsonProcessor;\nimport org.sonarsource.dotnet.shared.plugins.sensors.TelemetryJsonProjectCollector;\nimport org.sonarsource.dotnet.shared.plugins.sensors.TelemetryJsonSensor;\nimport org.sonarsource.dotnet.shared.plugins.sensors.TelemetryProcessor;\nimport org.sonarsource.dotnet.shared.plugins.sensors.TelemetrySensor;\nimport org.sonarsource.dotnet.shared.plugins.telemetryjson.TelemetryJsonCollector;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.sonarsource.dotnet.shared.PropertyUtils.nonProperties;\n\nclass VbNetCoreExtensionsTest {\n  @Test\n  void register() {\n    SonarRuntime sonarRuntime = SonarRuntimeImpl.forSonarQube(Version.create(9, 9), SonarQubeSide.SCANNER, SonarEdition.COMMUNITY);\n    Plugin.Context context = new Plugin.Context(sonarRuntime);\n    VbNetCoreExtensions.register(context, TestVbNetMetadata.INSTANCE);\n    var extensions = context.getExtensions();\n\n    Object[] expectedExtensions = new Object[]{\n      // module-level components (some relying on deprecated Scanner APIs)\n      FileTypeSensor.class,\n      LogSensor.class,\n      MethodDeclarationsCollector.class,\n      MethodDeclarationsSensor.class,\n      TelemetryCollector.class,\n      TelemetrySensor.class,\n      TelemetryProcessor.class,\n      TelemetryJsonCollector.class,\n      TelemetryJsonSensor.class,\n      TelemetryJsonProjectCollector.class,\n      TelemetryJsonProcessor.class,\n      PropertiesSensor.class,\n      ModuleConfiguration.class,\n      RealPathProvider.class,\n      // global components\n      // collectors - they are populated by the module-level sensors\n      ProjectTypeCollector.class,\n      ReportPathCollector.class,\n      HashProvider.class,\n      DotNetRulesDefinition.class,\n      GlobalProtobufFileProcessor.class,\n      RoslynRules.class,\n      VbNetSonarWayProfile.class,\n      // sensor\n      DotNetSensor.class,\n      VbNetFileCacheSensor.class,\n      // language-specific\n      TestVbNetMetadata.INSTANCE,\n      VbNetCorePluginMetadata.VbNet.class,\n      VbNetLanguageConfiguration.class,\n      // filters\n      EncodingPerFile.class,\n      GeneratedFileFilter.class,\n      WrongEncodingFileFilter.class,\n      // importers / exporters\n      ProtobufDataImporter.class,\n      RoslynDataImporter.class\n    };\n\n    assertThat(nonProperties(extensions)).contains(expectedExtensions);\n    assertThat(extensions).hasSize(\n      expectedExtensions.length\n        + new CodeCoverageProvider(TestVbNetMetadata.INSTANCE).extensions().size()\n        + new UnitTestResultsProvider(TestVbNetMetadata.INSTANCE).extensions().size()\n        + new VbNetPropertyDefinitions(TestVbNetMetadata.INSTANCE).create().size());\n  }\n}\n"
  },
  {
    "path": "sonar-vbnet-core/src/test/java/org/sonarsource/vbnet/core/VbNetCorePluginMetadataTest.java",
    "content": "/*\n * SonarSource :: VB.NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.vbnet.core;\n\nimport org.junit.jupiter.api.Test;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nclass VbNetCorePluginMetadataTest {\n\n  @Test\n  void pluginProperties() {\n    VbNetCorePluginMetadata sut = new VbNetCorePluginMetadata() {\n      @Override\n      public String pluginKey() {\n        return null;\n      }\n\n      @Override\n      public String analyzerProjectName() {\n        return null;\n      }\n\n      @Override\n      public String resourcesDirectory() {\n        return null;\n      }\n    };\n\n    assertThat(sut.languageKey()).isEqualTo(\"vbnet\");\n    assertThat(sut.languageName()).isEqualTo(\"VB.NET\");\n    assertThat(sut.repositoryKey()).isEqualTo(\"vbnet\");\n    assertThat(sut.fileSuffixesKey()).isEqualTo(\"sonar.vbnet.file.suffixes\");\n    assertThat(sut.fileSuffixesDefaultValue()).isEqualTo(\".vb\");\n  }\n}\n"
  },
  {
    "path": "sonar-vbnet-core/src/test/java/org/sonarsource/vbnet/core/VbNetFileCacheSensorTest.java",
    "content": "/*\n * SonarSource :: VB.NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.vbnet.core;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.nio.file.Path;\nimport java.security.NoSuchAlgorithmException;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\nimport org.junit.jupiter.api.io.TempDir;\nimport org.slf4j.event.Level;\nimport org.sonar.api.batch.fs.InputFile;\nimport org.sonar.api.batch.fs.internal.TestInputFileBuilder;\nimport org.sonar.api.batch.sensor.cache.WriteCache;\nimport org.sonar.api.batch.sensor.internal.SensorContextTester;\nimport org.sonar.api.config.internal.MapSettings;\nimport org.sonar.api.testfixtures.log.LogTesterJUnit5;\nimport org.sonarsource.dotnet.shared.plugins.HashProvider;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.ArgumentMatchers.any;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\nclass VbNetFileCacheSensorTest {\n  @TempDir\n  public Path basePath;\n\n  @RegisterExtension\n  public LogTesterJUnit5 logTester = new LogTesterJUnit5().setLevel(Level.DEBUG);\n\n  @Test\n  void execute_whenCacheIsEnabled_itAddsOnlyTheLanguageFiles() throws IOException, NoSuchAlgorithmException {\n    var canonicalBasePath = new File(basePath.toString()).getCanonicalPath();\n    var settings = new MapSettings();\n    settings.setProperty(TestVbNetMetadata.INSTANCE.fileSuffixesKey(), \".vb\");\n    settings.setProperty(\"sonar.pullrequest.cache.basepath\", canonicalBasePath);\n    var hashProvider = mock(HashProvider.class);\n    when(hashProvider.computeHash(any())).thenReturn(new byte[]{42});\n    var context = SensorContextTester.create(basePath);\n    context.setCacheEnabled(true);\n    context.setSettings(settings);\n    context.setNextCache(mock(WriteCache.class));\n    AddFile(context, basePath.toFile(), \"CSharp/Foo.cs\", \"other-language-key\");\n    AddFile(context, basePath.toFile(), \"VB/Bar.vb\", TestVbNetMetadata.INSTANCE.languageKey());\n    var sut = new VbNetFileCacheSensor(TestVbNetMetadata.INSTANCE, hashProvider);\n\n    sut.execute(context);\n\n    assertThat(logTester.logs(Level.WARN)).isEmpty();\n    assertThat(logTester.logs(Level.DEBUG)).containsExactly(\n      \"Incremental PR analysis: Preparing to upload file hashes.\",\n      \"Incremental PR analysis: basePathUri: \" + Path.of(canonicalBasePath).toUri(),\n      \"Incremental PR analysis: Adding hash for 'VB/Bar.vb' to the cache.\"\n    );\n  }\n\n  private static void AddFile(SensorContextTester context, File basePath, String filePath, String languageKey) {\n    context.fileSystem().add(new TestInputFileBuilder(\"project-key\", basePath, new File(basePath, filePath)).setLanguage(languageKey).setType(InputFile.Type.MAIN).build());\n  }\n}\n"
  },
  {
    "path": "sonar-vbnet-core/src/test/java/org/sonarsource/vbnet/core/VbNetLanguageConfigurationTest.java",
    "content": "/*\n * SonarSource :: VB.NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.vbnet.core;\n\nimport org.junit.jupiter.api.Test;\nimport org.sonar.api.config.Configuration;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\nclass VbNetLanguageConfigurationTest {\n\n  @Test\n  void reads_correct_language() {\n    Configuration configuration = mock(Configuration.class);\n    when(configuration.getStringArray(\"sonar.cs.roslyn.bugCategories\")).thenReturn(new String[]{\"C#\"});\n    when(configuration.getStringArray(\"sonar.vbnet.roslyn.bugCategories\")).thenReturn(new String[]{\"VB.NET\"});\n    VbNetLanguageConfiguration config = new VbNetLanguageConfiguration(configuration, TestVbNetMetadata.INSTANCE);\n\n    assertThat(config.bugCategories()).containsExactly(\"VB.NET\");\n  }\n}\n"
  },
  {
    "path": "sonar-vbnet-core/src/test/java/org/sonarsource/vbnet/core/VbNetPropertyDefinitionsTest.java",
    "content": "/*\n * SonarSource :: VB.NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.vbnet.core;\n\nimport java.util.List;\nimport org.junit.jupiter.api.Test;\nimport org.sonar.api.config.PropertyDefinition;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nclass VbNetPropertyDefinitionsTest {\n\n  @Test\n  void create() {\n    VbNetPropertyDefinitions sut = new VbNetPropertyDefinitions(TestVbNetMetadata.INSTANCE);\n    List<PropertyDefinition> properties = sut.create();\n    assertThat(properties)\n      .hasSize(17);\n  }\n\n  @Test\n  void create_containsScannerForDotNetProperties() {\n    VbNetPropertyDefinitions sut = new VbNetPropertyDefinitions(TestVbNetMetadata.INSTANCE);\n    List<PropertyDefinition> properties = sut.create();\n    // These must exist for S4NET to download the ZIP with analyzers from the server and populate the Sonar-cs.ruleset.\n    assertThat(properties)\n      .extracting(PropertyDefinition::key)\n      .contains(\n        \"sonar.vbnet.analyzer.dotnet.pluginKey\",\n        \"sonar.vbnet.analyzer.dotnet.pluginVersion\",\n        \"sonar.vbnet.analyzer.dotnet.staticResourceName\");\n  }\n\n  @Test\n  void create_containsLegacyScannerForDotNetProperties() {\n    VbNetPropertyDefinitions sut = new VbNetPropertyDefinitions(TestVbNetMetadata.INSTANCE);\n    List<PropertyDefinition> properties = sut.create();\n    // These must exist for S4NET <= 9.0.2 to download the ZIP with analyzers from the server and populate the Sonar-cs.ruleset.\n    assertThat(properties)\n      .extracting(PropertyDefinition::key)\n      .contains(\n        \"sonaranalyzer-vbnet.pluginKey\",\n        \"sonaranalyzer-vbnet.pluginVersion\",\n        \"sonaranalyzer-vbnet.staticResourceName\",\n        \"sonaranalyzer-vbnet.analyzerId\",\n        \"sonaranalyzer-vbnet.ruleNamespace\");\n  }\n}\n"
  },
  {
    "path": "sonar-vbnet-core/src/test/java/org/sonarsource/vbnet/core/VbNetSonarWayProfileTest.java",
    "content": "/*\n * SonarSource :: VB.NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.vbnet.core;\n\nimport org.junit.jupiter.api.BeforeAll;\nimport org.junit.jupiter.api.Test;\nimport org.sonar.api.rule.RuleKey;\nimport org.sonar.api.server.profile.BuiltInQualityProfilesDefinition;\nimport org.sonar.plugins.vbnetenterprise.api.ProfileRegistrar;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\nimport org.sonarsource.dotnet.shared.plugins.RoslynRules;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.junit.jupiter.api.Assertions.assertDoesNotThrow;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\nclass VbNetSonarWayProfileTest {\n  private static RoslynRules roslynRules;\n  private static final PluginMetadata metadata = new TestVbNetMetadata() {\n    @Override\n    public String resourcesDirectory() {\n      return \"VbNetSonarWayProfileTest\";\n    }\n  };\n\n  @BeforeAll\n  static void beforeAll() {\n    roslynRules = mock(RoslynRules.class);\n    when(roslynRules.rules()).thenReturn(new ArrayList<>());\n  }\n\n  @Test\n  void does_not_throw() {\n    assertDoesNotThrow(() -> new VbNetSonarWayProfile(TestVbNetMetadata.INSTANCE, mock(RoslynRules.class)));\n  }\n\n  @Test\n  void sonar_way_can_be_define_with_no_profile_registrars_given() {\n    assertDoesNotThrow(() -> {\n      VbNetSonarWayProfile sonarWay = new VbNetSonarWayProfile(metadata, roslynRules);\n      sonarWay.define(new BuiltInQualityProfilesDefinition.Context());\n    });\n  }\n\n  @Test\n  void profile_registrars_can_add_rules_to_sonar_way() {\n    BuiltInQualityProfilesDefinition.Context context = new BuiltInQualityProfilesDefinition.Context();\n    ProfileRegistrar[] profileRegistrars = new ProfileRegistrar[] {\n      r -> r.registerDefaultQualityProfileRules(\n        List.of(\n          RuleKey.of(metadata.repositoryKey(), \"additionalRule1\"),\n          RuleKey.of(metadata.repositoryKey(), \"additionalRule2\"))),\n      r -> r.registerDefaultQualityProfileRules(\n        List.of(RuleKey.of(metadata.repositoryKey(), \"anotherRule1\")))};\n    VbNetSonarWayProfile sonarWay = new VbNetSonarWayProfile(metadata, roslynRules, profileRegistrars);\n    sonarWay.define(context);\n\n    BuiltInQualityProfilesDefinition.BuiltInQualityProfile builtIn = context.profile(\"vbnet\", \"Sonar way\");\n    assertThat(builtIn.language()).isEqualTo(metadata.languageKey());\n    List.of(\"additionalRule1\", \"additionalRule2\", \"anotherRule1\")\n      .forEach(\n        ruleKey -> assertThat(builtIn.rule(RuleKey.of(metadata.repositoryKey(), ruleKey))).isNotNull());\n  }\n}\n"
  },
  {
    "path": "sonar-vbnet-core/src/test/java/org/sonarsource/vbnet/core/VbNetTest.java",
    "content": "/*\n * SonarSource :: VB.NET :: Core\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonarsource.vbnet.core;\n\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.sonar.api.config.PropertyDefinitions;\nimport org.sonar.api.config.internal.MapSettings;\nimport org.sonar.api.resources.AbstractLanguage;\nimport org.sonar.api.utils.System2;\nimport org.sonarsource.vbnet.core.VbNetCorePluginMetadata.VbNet;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.mockito.Mockito.mock;\n\nclass VbNetTest {\n\n  private MapSettings settings;\n  private VbNetCorePluginMetadata.VbNet vbnet;\n\n  @BeforeEach\n  public void init() {\n    PropertyDefinitions defs = new PropertyDefinitions(mock(System2.class),\n      new VbNetPropertyDefinitions(TestVbNetMetadata.INSTANCE).create());\n    settings = new MapSettings(defs);\n    vbnet = TestVbNetMetadata.INSTANCE.new VbNet(settings.asConfig());\n  }\n\n  @Test\n  void shouldGetDefaultFileSuffixes() {\n    assertThat(vbnet.getFileSuffixes()).containsOnly(\".vb\");\n  }\n\n  @Test\n  void shouldGetCustomFileSuffixes() {\n    settings.setProperty(TestVbNetMetadata.INSTANCE.fileSuffixesKey(), \".vb,.vbnet\");\n    assertThat(vbnet.getFileSuffixes()).containsOnly(\".vb\", \".vbnet\");\n  }\n\n  @Test\n  void equals_and_hashCode_considers_configuration() {\n    MapSettings otherSettings = new MapSettings();\n    otherSettings.setProperty(\"key\", \"value\");\n    VbNet otherVbNet = TestVbNetMetadata.INSTANCE.new VbNet(otherSettings.asConfig());\n    VbNet sameVbNet =  TestVbNetMetadata.INSTANCE.new VbNet(settings.asConfig());\n    FakeVbNet fakeVbNet = new FakeVbNet();\n\n    assertThat(vbnet).isEqualTo(sameVbNet)\n      .isNotEqualTo(otherVbNet)\n      .isNotEqualTo(fakeVbNet)\n      .isNotEqualTo(null)\n      .hasSameHashCodeAs(sameVbNet);\n    assertThat(vbnet.hashCode()).isNotEqualTo(otherVbNet.hashCode());\n  }\n\n  private class FakeVbNet extends AbstractLanguage {\n\n    public FakeVbNet() {\n      super( TestVbNetMetadata.INSTANCE.languageKey(), TestVbNetMetadata.INSTANCE.languageName());\n    }\n\n    @Override\n    public String[] getFileSuffixes() {\n      return new String[0];\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-vbnet-core/src/test/resources/VbNetSonarWayProfileTest/Sonar_way_profile.json",
    "content": "{\n  \"name\": \"Sonar way\",\n  \"ruleKeys\": [\n  ]\n}\n"
  },
  {
    "path": "sonar-vbnet-plugin/README.md",
    "content": "# Code Quality and Security for VB.NET\n\nThis folder contains the code specific to the VB.NET plugin for SonarQube.\n\nTo get more information please read the repository main [README](../README.md).\n"
  },
  {
    "path": "sonar-vbnet-plugin/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <parent>\n    <groupId>org.sonarsource.dotnet</groupId>\n    <artifactId>sonar-dotnet</artifactId>\n    <version>10.26-SNAPSHOT</version>\n  </parent>\n\n  <artifactId>sonar-vbnet-plugin</artifactId>\n  <packaging>sonar-plugin</packaging>\n\n  <name>SonarVB</name>\n  <description>Code Analyzer for VB.NET</description>\n  <url>http://redirect.sonarsource.com/plugins/vbnet.html</url>\n  <inceptionYear>2012</inceptionYear>\n\n  <licenses>\n    <license>\n      <name>SSALv1</name>\n      <url>https://sonarsource.com/license/ssal/</url>\n      <distribution>repo</distribution>\n    </license>\n  </licenses>\n\n  <dependencies>\n    <!-- provided at runtime -->\n    <dependency>\n      <groupId>org.sonarsource.api.plugin</groupId>\n      <artifactId>sonar-plugin-api</artifactId>\n    </dependency>\n    <dependency>\n      <groupId>org.slf4j</groupId>\n      <artifactId>slf4j-api</artifactId>\n      <scope>provided</scope>\n    </dependency>\n\n    <!-- compiled -->\n    <dependency>\n      <groupId>${project.groupId}</groupId>\n      <artifactId>sonar-dotnet-core</artifactId>\n      <version>${project.version}</version>\n    </dependency>\n    <dependency>\n      <groupId>${project.groupId}</groupId>\n      <artifactId>sonar-vbnet-core</artifactId>\n      <version>${project.version}</version>\n    </dependency>\n    <dependency>\n      <groupId>org.sonarsource.analyzer-commons</groupId>\n      <artifactId>sonar-analyzer-commons</artifactId>\n    </dependency>\n\n    <!-- test dependencies -->\n    <dependency>\n      <groupId>org.junit.jupiter</groupId>\n      <artifactId>junit-jupiter-engine</artifactId>\n    </dependency>\n    <dependency>\n      <groupId>org.assertj</groupId>\n      <artifactId>assertj-core</artifactId>\n    </dependency>\n    <dependency>\n      <groupId>org.apache.commons</groupId>\n      <artifactId>commons-lang3</artifactId>\n    </dependency>\n    <dependency>\n      <groupId>org.mockito</groupId>\n      <artifactId>mockito-core</artifactId>\n    </dependency>\n    <dependency>\n      <groupId>org.codehaus.woodstox</groupId>\n      <artifactId>stax2-api</artifactId>\n    </dependency>\n    <dependency>\n      <groupId>org.codehaus.staxmate</groupId>\n      <artifactId>staxmate</artifactId>\n      <exclusions>\n        <exclusion>\n          <groupId>org.codehaus.woodstox</groupId>\n          <artifactId>woodstox-core-asl</artifactId>\n        </exclusion>\n        <exclusion>\n          <groupId>stax</groupId>\n          <artifactId>stax-api</artifactId>\n        </exclusion>\n        <exclusion>\n          <groupId>org.codehaus.woodstox</groupId>\n          <artifactId>stax2-api</artifactId>\n        </exclusion>\n      </exclusions>\n    </dependency>\n    <dependency>\n      <groupId>org.sonarsource.sonarqube</groupId>\n      <artifactId>sonar-plugin-api-impl</artifactId>\n      <exclusions>\n        <exclusion>\n          <groupId>junit</groupId>\n          <artifactId>junit</artifactId>\n        </exclusion>\n      </exclusions>\n    </dependency>\n    <dependency>\n      <groupId>org.sonarsource.api.plugin</groupId>\n      <artifactId>sonar-plugin-api-test-fixtures</artifactId>\n    </dependency>\n  </dependencies>\n\n  <build>\n    <resources>\n      <resource>\n        <directory>../</directory>\n        <targetPath>licenses</targetPath>\n        <includes>\n          <include>LICENSE.txt</include>\n        </includes>\n      </resource>\n      <resource>\n        <directory>../Licenses/THIRD_PARTY_LICENSES</directory>\n        <targetPath>licenses/THIRD_PARTY_LICENSES</targetPath>\n        <excludes>\n          <exclude>org.sonarsource.dotnet.sonar-csharp-core-LICENSE.txt</exclude>\n        </excludes>\n      </resource>\n      <resource>\n        <directory>${sonarAnalyzer.workDirectory}</directory>\n        <includes>\n          <include>org/sonar/plugins/vbnet/*.json</include>\n          <include>org/sonar/plugins/vbnet/*.html</include>\n          <include>static/SonarAnalyzer-vbnet-${project.version}.zip</include>\n        </includes>\n      </resource>\n    </resources>\n\n    <plugins>\n      <plugin>\n        <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId>\n        <artifactId>sonar-packaging-maven-plugin</artifactId>\n        <configuration>\n          <pluginName>VB.NET Code Quality and Security</pluginName>\n          <pluginClass>org.sonar.plugins.vbnet.VbNetPlugin</pluginClass>\n          <skipDependenciesPackaging>true</skipDependenciesPackaging>\n          <sonarLintSupported>false</sonarLintSupported>\n          <pluginApiMinVersion>${plugin.api.min.version}</pluginApiMinVersion>\n          <requiredForLanguages>vbnet</requiredForLanguages>\n        </configuration>\n      </plugin>\n      <plugin>\n        <artifactId>maven-shade-plugin</artifactId>\n        <executions>\n          <execution>\n            <phase>package</phase>\n            <goals>\n              <goal>shade</goal>\n            </goals>\n            <configuration>\n              <shadedArtifactAttached>false</shadedArtifactAttached>\n              <createDependencyReducedPom>false</createDependencyReducedPom>\n              <minimizeJar>true</minimizeJar>\n              <filters>\n                <filter>\n                  <artifact>*:*</artifact>\n                  <excludes>\n                    <exclude>META-INF/LICENSE*</exclude>\n                    <exclude>META-INF/NOTICE*</exclude>\n                    <exclude>META-INF/*.RSA</exclude>\n                    <exclude>META-INF/*.SF</exclude>\n                    <exclude>license/*</exclude>\n                    <exclude>LICENSE*</exclude>\n                    <exclude>NOTICE*</exclude>\n                  </excludes>\n                </filter>\n              </filters>\n            </configuration>\n          </execution>\n        </executions>\n      </plugin>\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-enforcer-plugin</artifactId>\n        <executions>\n          <execution>\n            <id>enforce-plugin-size</id>\n            <goals>\n              <goal>enforce</goal>\n            </goals>\n            <phase>verify</phase>\n            <configuration>\n              <rules>\n                <requireFilesSize>\n                  <maxsize>5300000</maxsize>\n                  <minsize>4600000</minsize>\n                  <files>\n                    <file>${project.build.directory}/${project.build.finalName}.jar</file>\n                  </files>\n                </requireFilesSize>\n              </rules>\n            </configuration>\n          </execution>\n        </executions>\n      </plugin>\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-antrun-plugin</artifactId>\n        <version>3.2.0</version>\n        <executions>\n          <execution>\n            <id>copy-analyzer-data</id>\n            <phase>validate</phase>\n            <configuration>\n              <exportAntProperties>true</exportAntProperties>\n              <target>\n                <copy todir=\"${sonarAnalyzer.workDirectory}/SonarAnalyzer.VisualBasic\">\n                  <fileset dir=\"${packaging.directory}/binaries/SonarAnalyzer.VisualBasic/\">\n                    <include name=\"*.dll\"/>\n                  </fileset>\n                </copy>\n                <copy todir=\"${sonarAnalyzer.workDirectory}/SonarAnalyzer.VisualBasic/licenses/\">\n                  <fileset dir=\"${project.build.directory}/../..\">\n                    <include name=\"LICENSE.txt\"/>\n                  </fileset>\n                </copy>\n                <copy todir=\"${sonarAnalyzer.workDirectory}/SonarAnalyzer.VisualBasic/licenses/THIRD_PARTY_LICENSES/\">\n                  <fileset dir=\"${packaging.directory}/Licenses/THIRD_PARTY_LICENSES/\">\n                    <include name=\"*.txt\"/>\n                  </fileset>\n                </copy>\n                <zip destfile=\"${sonarAnalyzer.workDirectory}/static/SonarAnalyzer-vbnet-${project.version}.zip\"\n                     basedir=\"${sonarAnalyzer.workDirectory}/SonarAnalyzer.VisualBasic\"/>\n                <copy todir=\"${sonarAnalyzer.workDirectory}/org/sonar/plugins/vbnet\">\n                  <fileset dir=\"${rspec.directory}/vbnet\">\n                    <include name=\"*.json\"/>\n                    <include name=\"*.html\"/>\n                  </fileset>\n                </copy>\n                <exec executable=\"dotnet\"\n                      failonerror=\"true\"\n                      dir=\"${packaging.directory}/binaries/RuleDescriptorGenerator\">\n                  <arg value=\"RuleDescriptorGenerator.dll\"/>\n                  <arg value=\"${sonarAnalyzer.workDirectory}/org/sonar/plugins/vbnet/Rules.json\"/>\n                  <arg value=\"${packaging.directory}/binaries/SonarAnalyzer.VisualBasic/SonarAnalyzer.VisualBasic.dll\"/>\n                </exec>\n              </target>\n            </configuration>\n            <goals>\n              <goal>run</goal>\n            </goals>\n          </execution>\n        </executions>\n      </plugin>\n    </plugins>\n  </build>\n</project>\n"
  },
  {
    "path": "sonar-vbnet-plugin/src/main/java/org/sonar/plugins/vbnet/VbNetPlugin.java",
    "content": "/*\n * SonarVB\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.vbnet;\n\nimport org.sonar.api.Plugin;\nimport org.sonarsource.dotnet.shared.plugins.PluginMetadata;\nimport org.sonarsource.vbnet.core.VbNetCoreExtensions;\nimport org.sonarsource.vbnet.core.VbNetCorePluginMetadata;\n\npublic class VbNetPlugin implements Plugin {\n\n  // Do NOT add any public fields here, and do NOT reference them directly. Add them to PluginMetadata and inject the metadata.\n  static final PluginMetadata METADATA = new VbNetPluginMetadata();\n\n  @Override\n  public void define(Context context) {\n    VbNetCoreExtensions.register(context, METADATA);\n  }\n\n  private static class VbNetPluginMetadata extends VbNetCorePluginMetadata {\n\n    @Override\n    public String pluginKey() {\n      return \"vbnet\";\n    }\n\n    @Override\n    public String analyzerProjectName() {\n      return \"SonarAnalyzer.VisualBasic\";\n    }\n\n    @Override\n    public String resourcesDirectory() {\n      return \"/org/sonar/plugins/vbnet\";\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-vbnet-plugin/src/main/java/org/sonar/plugins/vbnet/package-info.java",
    "content": "/*\n * SonarVB\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\n@ParametersAreNonnullByDefault\npackage org.sonar.plugins.vbnet;\n\nimport javax.annotation.ParametersAreNonnullByDefault;\n\n"
  },
  {
    "path": "sonar-vbnet-plugin/src/test/java/org/sonar/plugins/vbnet/VbNetPluginTest.java",
    "content": "/*\n * SonarVB\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.vbnet;\n\nimport org.junit.jupiter.api.Test;\nimport org.sonar.api.Plugin;\nimport org.sonar.api.SonarEdition;\nimport org.sonar.api.SonarQubeSide;\nimport org.sonar.api.SonarRuntime;\nimport org.sonar.api.internal.SonarRuntimeImpl;\nimport org.sonar.api.utils.Version;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nclass VbNetPluginTest {\n\n  @Test\n  void getExtensions() {\n    SonarRuntime sonarRuntime = SonarRuntimeImpl.forSonarQube(Version.create(7, 9), SonarQubeSide.SCANNER, SonarEdition.COMMUNITY);\n\n    Plugin.Context context = new Plugin.Context(sonarRuntime);\n    new VbNetPlugin().define(context);\n    assertThat(context.getExtensions()).hasSize(62);\n  }\n\n  @Test\n  void pluginProperties() {\n    assertThat(VbNetPlugin.METADATA.languageKey()).isEqualTo(\"vbnet\");\n    assertThat(VbNetPlugin.METADATA.languageName()).isEqualTo(\"VB.NET\");\n    assertThat(VbNetPlugin.METADATA.repositoryKey()).isEqualTo(\"vbnet\");\n    assertThat(VbNetPlugin.METADATA.fileSuffixesKey()).isEqualTo(\"sonar.vbnet.file.suffixes\");\n    assertThat(VbNetPlugin.METADATA.fileSuffixesDefaultValue()).isEqualTo(\".vb\");\n    assertThat(VbNetPlugin.METADATA.resourcesDirectory()).isEqualTo(\"/org/sonar/plugins/vbnet\");\n    assertThat(VbNetPlugin.METADATA.pluginKey()).isEqualTo(\"vbnet\");\n    assertThat(VbNetPlugin.METADATA.analyzerProjectName()).isEqualTo(\"SonarAnalyzer.VisualBasic\");\n  }\n}\n"
  },
  {
    "path": "sonar-vbnet-plugin/src/test/java/org/sonar/plugins/vbnet/VbNetRulesDefinitionTest.java",
    "content": "/*\n * SonarVB\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.vbnet;\n\nimport org.junit.jupiter.api.BeforeAll;\nimport org.junit.jupiter.api.Test;\nimport org.sonar.api.SonarEdition;\nimport org.sonar.api.SonarQubeSide;\nimport org.sonar.api.SonarRuntime;\nimport org.sonar.api.internal.SonarRuntimeImpl;\nimport org.sonar.api.server.rule.RulesDefinition;\nimport org.sonar.api.server.rule.RulesDefinition.Rule;\nimport org.sonar.api.utils.Version;\nimport org.sonarsource.dotnet.shared.plugins.DotNetRulesDefinition;\nimport org.sonarsource.dotnet.shared.plugins.RoslynRules;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nclass VbNetRulesDefinitionTest {\n  private static final RulesDefinition.Context CONTEXT = new RulesDefinition.Context();\n  private static final SonarRuntime SONAR_RUNTIME = SonarRuntimeImpl.forSonarQube(Version.create(10, 10), SonarQubeSide.SCANNER,\n    SonarEdition.COMMUNITY);\n  private static final RoslynRules ROSLYN_RULES = new RoslynRules(VbNetPlugin.METADATA);\n\n  private static RulesDefinition.Repository ruleRepo;\n\n  @BeforeAll\n  static void setupContext() {\n    DotNetRulesDefinition definition = new DotNetRulesDefinition(VbNetPlugin.METADATA, SONAR_RUNTIME, ROSLYN_RULES);\n    definition.define(CONTEXT);\n    ruleRepo = CONTEXT.repository(\"vbnet\");\n  }\n\n  @Test\n  void rules_areDefined() {\n    assertThat(CONTEXT.repositories()).hasSize(1);\n    Rule s1197 = ruleRepo.rule(\"S1197\");\n    assertThat(s1197).isNotNull();\n    assertThat(s1197.name()).isEqualTo(\"Array designators \\\"()\\\" should be on the type, not the variable\");\n  }\n\n  @Test\n  void symbolicExecutionRules_areNotDefined() {\n    assertThat(CONTEXT.repositories()).hasSize(1);\n    assertThat(ruleRepo.rule(\"S2259\")).isNull();\n  }\n\n  @Test\n  void allRules_haveMetadata() {\n    for (RulesDefinition.Rule rule : ruleRepo.rules()) {\n      assertThat(rule.name()).isNotEmpty();\n      assertThat(rule.type()).isNotNull();\n      assertThat(rule.status()).isNotNull();\n      assertThat(rule.severity()).isNotEmpty();\n    }\n  }\n\n  @Test\n  void allRules_haveHtmlDescription() {\n    for (RulesDefinition.Rule rule : ruleRepo.rules()) {\n      assertThat(rule.htmlDescription()).isNotEmpty().hasSizeGreaterThan(100);\n    }\n  }\n}\n"
  },
  {
    "path": "sonar-vbnet-plugin/src/test/java/org/sonar/plugins/vbnet/VbNetSonarWayProfileTest.java",
    "content": "/*\n * SonarVB\n * Copyright (C) SonarSource Sàrl\n * mailto:info AT sonarsource DOT com\n *\n * You can redistribute and/or modify this program under the terms of\n * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the Sonar Source-Available License for more details.\n *\n * You should have received a copy of the Sonar Source-Available License\n * along with this program; if not, see https://sonarsource.com/license/ssal/\n */\npackage org.sonar.plugins.vbnet;\n\nimport org.junit.jupiter.api.BeforeAll;\nimport org.junit.jupiter.api.Test;\nimport org.sonar.api.rule.RuleKey;\nimport org.sonar.api.server.profile.BuiltInQualityProfilesDefinition.BuiltInQualityProfile;\nimport org.sonar.api.server.profile.BuiltInQualityProfilesDefinition.Context;\nimport org.sonarsource.dotnet.shared.plugins.RoslynRules;\nimport org.sonarsource.vbnet.core.VbNetSonarWayProfile;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nclass VbNetSonarWayProfileTest {\n\n  private static final RoslynRules ROSLYN_RULES = new RoslynRules(VbNetPlugin.METADATA);\n  private static final String REPOSITORY_KEY = VbNetPlugin.METADATA.repositoryKey();\n  private static BuiltInQualityProfile profile;\n\n  @BeforeAll\n  static void setup() {\n    Context context = new Context();\n    VbNetSonarWayProfile profileDef = new VbNetSonarWayProfile(VbNetPlugin.METADATA, ROSLYN_RULES);\n    profileDef.define(context);\n    profile = context.profile(\"vbnet\", \"Sonar way\");\n  }\n\n  @Test\n  void expected_rules_in_sonar_way() {\n    // SonarWay rules\n    assertThat(profile.rule(RuleKey.of(REPOSITORY_KEY, \"S2347\"))).isNotNull();\n    assertThat(profile.rule(RuleKey.of(REPOSITORY_KEY, \"S2349\"))).isNotNull();\n\n    // Non Sonarway rules\n    assertThat(profile.rule(RuleKey.of(REPOSITORY_KEY, \"S2348\"))).isNull();\n    assertThat(profile.rule(RuleKey.of(REPOSITORY_KEY, \"S2354\"))).isNull();\n  }\n\n  @Test\n  void hotspots_in_sonar_way() {\n    assertThat(profile.rule(RuleKey.of(REPOSITORY_KEY, \"S4507\"))).isNotNull();\n    assertThat(profile.rule(RuleKey.of(REPOSITORY_KEY, \"S5042\"))).isNotNull();\n    assertThat(profile.rule(RuleKey.of(REPOSITORY_KEY, \"S2077\"))).isNotNull();\n    assertThat(profile.rule(RuleKey.of(REPOSITORY_KEY, \"S2068\"))).isNotNull();\n    assertThat(profile.rule(RuleKey.of(REPOSITORY_KEY, \"S1313\"))).isNotNull();\n    assertThat(profile.rule(RuleKey.of(REPOSITORY_KEY, \"S4790\"))).isNotNull();\n  }\n\n\n  @Test\n  void symbolic_execution_not_in_sonar_way() {\n    assertThat(profile.rule(RuleKey.of(REPOSITORY_KEY, \"S2222\"))).isNull();\n    assertThat(profile.rule(RuleKey.of(REPOSITORY_KEY, \"S2259\"))).isNull();\n    assertThat(profile.rule(RuleKey.of(REPOSITORY_KEY, \"S2583\"))).isNull();\n    assertThat(profile.rule(RuleKey.of(REPOSITORY_KEY, \"S2589\"))).isNull();\n  }\n}\n"
  },
  {
    "path": "sonar-vbnet-plugin/src/test/resources/Program.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Diagnostics.CodeAnalysis;\n\n\n//-----------------------------------------------------------------------\n// <copyright file=\"ArgumentValidation.cs\" company=\"SonarSource SA and Microsoft Corporation\">\n//   Copyright (c) SonarSource SA and Microsoft Corporation.  All rights reserved.\n//   Licensed under the MIT License. See License.txt in the project root for license information.\n// </copyright>\n//-----------------------------------------------------------------------\nnamespace ConsoleApplication1\n{\n    /// <summary>\n    /// Static methods that implement aspects of the NUnit framework that cut\n    /// across individual test types, extensions, etc. Some of these use the\n    /// methods of the Reflect class to implement operations specific to the\n    /// NUnit Framework.\n    /// </summary>\n    public class Program\n    {\n        public static int Add(int op1, int op2)\n        {\n            if (op1 == 0)\n            {\n                return op2;\n            }\n\n            if (op2 == 0)\n            {\n                return op1;\n            }\n\n            return op1 + op2;\n        }\n\n        static void Main(string[] args)\n        {\n        }\n    }\n\n    class IFoo\n    {\n    }\n\n    class IBar  // NOSONAR\n    {\n    }\n\n    [SuppressMessage(\"Maintainability\", \"S2326:Unused type parameters should be removed\")]\n    class MoreMath<T> // Noncompliant; <T>is ignored\n    {\n        public int Add<T>(int a, int b) // Noncompliant; <T> is ignored\n        {\n            return a + b;\n        }\n    }\n\n}\n"
  },
  {
    "path": "sonar-vbnet-plugin/src/test/scripts/echo.bat",
    "content": "@ECHO OFF\n@ECHO \"Parameter: \" + %1\n"
  },
  {
    "path": "sonar-vbnet-plugin/src/test/scripts/echo.sh",
    "content": "#!/bin/sh\necho \"Parameter: \" + $1"
  },
  {
    "path": "sonar-vbnet-plugin/src/test/scripts/forever.bat",
    "content": "@ECHO OFF\n\n:LOOP\n  @ping 127.0.0.1 -n 2 -w 1000 > nul\nGOTO LOOP\n"
  },
  {
    "path": "sonar-vbnet-plugin/src/test/scripts/forever.sh",
    "content": "#!/bin/sh\nwhile test \"notempty\"\ndo\n  sleep 1\ndone"
  }
]